From: Andrea Bianco Date: Mon, 4 Apr 2022 21:55:22 +0000 (+0200) Subject: Built motion from commit da617fac.|2.6.6 X-Git-Tag: 2.6.6 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22javascript:;/%22?a=commitdiff_plain;h=fe8c827137dd3c5e6b46ed251e0129d077b10dab;p=motion2.git Built motion from commit da617fac.|2.6.6 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 6535a09..c12d009 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-04T21:35:56.346Z", + "time": "2022-04-04T21:47:09.903Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f2523e8..d30b1d0 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-04T21:35:56.346Z", + "time": "2022-04-04T21:47:09.903Z", "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 a6e2f1f..a071611 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 _0xea1f=['TEXT','exports','getDataValue','action','STRING','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x3c180c,_0x52406){var _0xc5f9fe=function(_0xc27d5c){while(--_0xc27d5c){_0x3c180c['push'](_0x3c180c['shift']());}};_0xc5f9fe(++_0x52406);}(_0xea1f,0x6a));var _0xfea1=function(_0x5714dc,_0x3df6e4){_0x5714dc=_0x5714dc-0x0;var _0x58a901=_0xea1f[_0x5714dc];return _0x58a901;};'use strict';var Sequelize=require('sequelize');module[_0xfea1('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x421457){return this[_0xfea1('0x1')](_0xfea1('0x2'));}},'action':{'type':Sequelize[_0xfea1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xfea1('0x4'),_0xfea1('0x5'),'jscripty',_0xfea1('0x6'),'browser',_0xfea1('0x7'),_0xfea1('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xfea1('0x9')},'data1':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comment':_0xfea1('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xfea1('0xb')},'data3':{'type':Sequelize[_0xfea1('0x3')](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[_0xfea1('0x3')](0x1000),'comments':_0xfea1('0xc')},'data5':{'type':Sequelize[_0xfea1('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xfea1('0x3')],'comments':_0xfea1('0xd')},'data7':{'type':Sequelize[_0xfea1('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xd535=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x45e135,_0x4e7c9b){var _0x31853e=function(_0x329f10){while(--_0x329f10){_0x45e135['push'](_0x45e135['shift']());}};_0x31853e(++_0x4e7c9b);}(_0xd535,0x167));var _0x5d53=function(_0x2eb40c,_0x3f90cf){_0x2eb40c=_0x2eb40c-0x0;var _0x250b6d=_0xd535[_0x2eb40c];return _0x250b6d;};'use strict';var Sequelize=require(_0x5d53('0x0'));module[_0x5d53('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17dd80){return this[_0x5d53('0x2')](_0x5d53('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5d53('0x4'),_0x5d53('0x5'),_0x5d53('0x6'),'urlForward',_0x5d53('0x7'),'bot',_0x5d53('0x8')]],'msg':_0x5d53('0x9')}},'comment':_0x5d53('0x9')},'data1':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comment':_0x5d53('0xb')},'data2':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comment':_0x5d53('0xc')},'data3':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comment':_0x5d53('0xd')},'data4':{'type':Sequelize[_0x5d53('0xa')](0x1000),'comments':_0x5d53('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x5d53('0xa')],'comments':_0x5d53('0xf')},'data7':{'type':Sequelize[_0x5d53('0x10')],'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 a2f5383..a648ca0 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 _0x43db=['status','end','json','undefined','count','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x43db,0x7a));var _0xb43d=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x43db[_0x2d4421];return _0x2d3b01;};'use strict';var emlformat=require(_0xb43d('0x0'));var rimraf=require(_0xb43d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb43d('0x2'));var rp=require(_0xb43d('0x3'));var moment=require(_0xb43d('0x4'));var BPromise=require(_0xb43d('0x5'));var Mustache=require(_0xb43d('0x6'));var util=require(_0xb43d('0x7'));var path=require(_0xb43d('0x8'));var sox=require(_0xb43d('0x9'));var csv=require('to-csv');var ejs=require(_0xb43d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb43d('0xb'));var squel=require(_0xb43d('0xc'));var crypto=require(_0xb43d('0xd'));var jsforce=require(_0xb43d('0xe'));var deskjs=require(_0xb43d('0xf'));var toCsv=require(_0xb43d('0x10'));var querystring=require(_0xb43d('0x11'));var Papa=require(_0xb43d('0x12'));var Redis=require(_0xb43d('0x13'));var authService=require(_0xb43d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb43d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb43d('0x16'))(_0xb43d('0x17'));var utils=require(_0xb43d('0x18'));var config=require(_0xb43d('0x19'));var licenseUtil=require(_0xb43d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371f08,_0x2a3960){_0x2a3960=_0x2a3960||0xcc;return function(_0x219d27){if(_0x219d27){return _0x371f08[_0xb43d('0x1b')](_0x2a3960);}return _0x371f08[_0xb43d('0x1c')](_0x2a3960)[_0xb43d('0x1d')]();};}function respondWithResult(_0x31d79e,_0x2d3f8e){_0x2d3f8e=_0x2d3f8e||0xc8;return function(_0x1dfc82){if(_0x1dfc82){return _0x31d79e[_0xb43d('0x1c')](_0x2d3f8e)[_0xb43d('0x1e')](_0x1dfc82);}};}function respondWithFilteredResult(_0x15c00b,_0x180a47){return function(_0x2be3f6){if(_0x2be3f6){var _0x20db51=typeof _0x180a47['offset']===_0xb43d('0x1f')&&typeof _0x180a47['limit']===_0xb43d('0x1f');var _0x54abc4=_0x2be3f6[_0xb43d('0x20')];var _0x39ff64=_0x20db51?0x0:_0x180a47[_0xb43d('0x21')];var _0x136e79=_0x20db51?_0x2be3f6['count']:_0x180a47['offset']+_0x180a47[_0xb43d('0x22')];var _0x45f8a4;if(_0x136e79>=_0x54abc4){_0x136e79=_0x54abc4;_0x45f8a4=0xc8;}else{_0x45f8a4=0xce;}_0x15c00b[_0xb43d('0x1c')](_0x45f8a4);return _0x15c00b[_0xb43d('0x23')]('Content-Range',_0x39ff64+'-'+_0x136e79+'/'+_0x54abc4)[_0xb43d('0x1e')](_0x2be3f6);}return null;};}function patchUpdates(_0x5eb094){return function(_0x522da3){try{jsonpatch[_0xb43d('0x24')](_0x522da3,_0x5eb094,!![]);}catch(_0xe0536f){return BPromise[_0xb43d('0x25')](_0xe0536f);}return _0x522da3['save']();};}function saveUpdates(_0x412722,_0x18a52b){return function(_0x303fc2){if(_0x303fc2){return _0x303fc2[_0xb43d('0x26')](_0x412722)['then'](function(_0x39eab8){return _0x39eab8;});}return null;};}function removeEntity(_0x7f0a2e,_0x31b537){return function(_0x5fc649){if(_0x5fc649){return _0x5fc649[_0xb43d('0x27')]()[_0xb43d('0x28')](function(){_0x7f0a2e[_0xb43d('0x1c')](0xcc)[_0xb43d('0x1d')]();});}};}function handleEntityNotFound(_0x5896b1,_0x46b0b2){return function(_0x565589){if(!_0x565589){_0x5896b1[_0xb43d('0x1b')](0x194);}return _0x565589;};}function handleError(_0x477fe4,_0x38f9b2){_0x38f9b2=_0x38f9b2||0x1f4;return function(_0x14fb5f){logger[_0xb43d('0x29')](_0x14fb5f[_0xb43d('0x2a')]);if(_0x14fb5f[_0xb43d('0x2b')]){delete _0x14fb5f['name'];}_0x477fe4[_0xb43d('0x1c')](_0x38f9b2)[_0xb43d('0x2c')](_0x14fb5f);};}exports[_0xb43d('0x26')]=function(_0xab1497,_0x83cb18){if(_0xab1497[_0xb43d('0x2d')]['id']){delete _0xab1497[_0xb43d('0x2d')]['id'];}return db['Action'][_0xb43d('0x2e')]({'where':{'id':_0xab1497[_0xb43d('0x2f')]['id']}})[_0xb43d('0x28')](handleEntityNotFound(_0x83cb18,null))['then'](saveUpdates(_0xab1497[_0xb43d('0x2d')],null))[_0xb43d('0x28')](respondWithResult(_0x83cb18,null))[_0xb43d('0x30')](handleError(_0x83cb18,null));};exports['destroy']=function(_0x5088ea,_0x49510){return db[_0xb43d('0x31')]['find']({'where':{'id':_0x5088ea['params']['id']}})[_0xb43d('0x28')](handleEntityNotFound(_0x49510,null))[_0xb43d('0x28')](removeEntity(_0x49510,null))[_0xb43d('0x30')](handleError(_0x49510,null));}; \ No newline at end of file +var _0xf8ef=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','sendStatus','name','send','body','Action','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x2b4d01,_0x4c6044){var _0x4195d7=function(_0x59935){while(--_0x59935){_0x2b4d01['push'](_0x2b4d01['shift']());}};_0x4195d7(++_0x4c6044);}(_0xf8ef,0x13e));var _0xff8e=function(_0x390db1,_0x468c8b){_0x390db1=_0x390db1-0x0;var _0x4910c7=_0xf8ef[_0x390db1];return _0x4910c7;};'use strict';var emlformat=require(_0xff8e('0x0'));var rimraf=require(_0xff8e('0x1'));var zipdir=require(_0xff8e('0x2'));var jsonpatch=require(_0xff8e('0x3'));var rp=require(_0xff8e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xff8e('0x5'));var path=require(_0xff8e('0x6'));var sox=require(_0xff8e('0x7'));var csv=require(_0xff8e('0x8'));var ejs=require(_0xff8e('0x9'));var fs=require('fs');var fs_extra=require(_0xff8e('0xa'));var _=require(_0xff8e('0xb'));var squel=require(_0xff8e('0xc'));var crypto=require(_0xff8e('0xd'));var jsforce=require(_0xff8e('0xe'));var deskjs=require(_0xff8e('0xf'));var toCsv=require(_0xff8e('0x8'));var querystring=require('querystring');var Papa=require(_0xff8e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xff8e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff8e('0x12'));var logger=require('../../config/logger')(_0xff8e('0x13'));var utils=require('../../config/utils');var config=require(_0xff8e('0x14'));var licenseUtil=require(_0xff8e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2243dc,_0x4da014){_0x4da014=_0x4da014||0xcc;return function(_0xd8177b){if(_0xd8177b){return _0x2243dc['sendStatus'](_0x4da014);}return _0x2243dc[_0xff8e('0x16')](_0x4da014)[_0xff8e('0x17')]();};}function respondWithResult(_0x3585ff,_0x580989){_0x580989=_0x580989||0xc8;return function(_0x3e4f97){if(_0x3e4f97){return _0x3585ff[_0xff8e('0x16')](_0x580989)[_0xff8e('0x18')](_0x3e4f97);}};}function respondWithFilteredResult(_0x4a6860,_0x1c9d72){return function(_0x5617c7){if(_0x5617c7){var _0x150bc2=typeof _0x1c9d72[_0xff8e('0x19')]===_0xff8e('0x1a')&&typeof _0x1c9d72[_0xff8e('0x1b')]===_0xff8e('0x1a');var _0x37ba77=_0x5617c7['count'];var _0x29d48d=_0x150bc2?0x0:_0x1c9d72[_0xff8e('0x19')];var _0x103b66=_0x150bc2?_0x5617c7['count']:_0x1c9d72[_0xff8e('0x19')]+_0x1c9d72[_0xff8e('0x1b')];var _0x549666;if(_0x103b66>=_0x37ba77){_0x103b66=_0x37ba77;_0x549666=0xc8;}else{_0x549666=0xce;}_0x4a6860[_0xff8e('0x16')](_0x549666);return _0x4a6860['set'](_0xff8e('0x1c'),_0x29d48d+'-'+_0x103b66+'/'+_0x37ba77)[_0xff8e('0x18')](_0x5617c7);}return null;};}function patchUpdates(_0x84e6be){return function(_0x5c2bb4){try{jsonpatch['apply'](_0x5c2bb4,_0x84e6be,!![]);}catch(_0x54a804){return BPromise[_0xff8e('0x1d')](_0x54a804);}return _0x5c2bb4[_0xff8e('0x1e')]();};}function saveUpdates(_0x61c559,_0x469944){return function(_0x4e8aec){if(_0x4e8aec){return _0x4e8aec[_0xff8e('0x1f')](_0x61c559)[_0xff8e('0x20')](function(_0x321f75){return _0x321f75;});}return null;};}function removeEntity(_0x47bbd0,_0x5a45f9){return function(_0x20a89b){if(_0x20a89b){return _0x20a89b[_0xff8e('0x21')]()[_0xff8e('0x20')](function(){_0x47bbd0[_0xff8e('0x16')](0xcc)[_0xff8e('0x17')]();});}};}function handleEntityNotFound(_0x42efce,_0x5ed118){return function(_0x9d3df){if(!_0x9d3df){_0x42efce[_0xff8e('0x22')](0x194);}return _0x9d3df;};}function handleError(_0x31552c,_0x42428a){_0x42428a=_0x42428a||0x1f4;return function(_0x38e460){logger['error'](_0x38e460['stack']);if(_0x38e460[_0xff8e('0x23')]){delete _0x38e460['name'];}_0x31552c[_0xff8e('0x16')](_0x42428a)[_0xff8e('0x24')](_0x38e460);};}exports['update']=function(_0x2acf9e,_0xc88fbc){if(_0x2acf9e[_0xff8e('0x25')]['id']){delete _0x2acf9e['body']['id'];}return db[_0xff8e('0x26')][_0xff8e('0x27')]({'where':{'id':_0x2acf9e[_0xff8e('0x28')]['id']}})[_0xff8e('0x20')](handleEntityNotFound(_0xc88fbc,null))[_0xff8e('0x20')](saveUpdates(_0x2acf9e[_0xff8e('0x25')],null))[_0xff8e('0x20')](respondWithResult(_0xc88fbc,null))['catch'](handleError(_0xc88fbc,null));};exports[_0xff8e('0x21')]=function(_0x1ff97d,_0x162dc9){return db[_0xff8e('0x26')]['find']({'where':{'id':_0x1ff97d[_0xff8e('0x28')]['id']}})[_0xff8e('0x20')](handleEntityNotFound(_0x162dc9,null))[_0xff8e('0x20')](removeEntity(_0x162dc9,null))['catch'](handleError(_0x162dc9,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 0490692..d435cb6 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 _0xd933=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports'];(function(_0x177fdb,_0x702728){var _0x537fe5=function(_0x580ffe){while(--_0x580ffe){_0x177fdb['push'](_0x177fdb['shift']());}};_0x537fe5(++_0x702728);}(_0xd933,0x1c8));var _0x3d93=function(_0x3fc386,_0x413579){_0x3fc386=_0x3fc386-0x0;var _0x42c521=_0xd933[_0x3fc386];return _0x42c521;};'use strict';var _=require(_0x3d93('0x0'));var util=require(_0x3d93('0x1'));var logger=require(_0x3d93('0x2'))('api');var moment=require(_0x3d93('0x3'));var BPromise=require(_0x3d93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d93('0x5'));var rimraf=require('rimraf');var config=require(_0x3d93('0x6'));var attributes=require('./action.attributes');module[_0x3d93('0x7')]=function(_0x56581d,_0x34b7d1){return _0x56581d['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e18=['tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action'];(function(_0x39e1e5,_0x1410c9){var _0x146024=function(_0x3aabbb){while(--_0x3aabbb){_0x39e1e5['push'](_0x39e1e5['shift']());}};_0x146024(++_0x1410c9);}(_0x8e18,0x1ae));var _0x88e1=function(_0x4938b5,_0x2e6769){_0x4938b5=_0x4938b5-0x0;var _0x4a9486=_0x8e18[_0x4938b5];return _0x4a9486;};'use strict';var _=require(_0x88e1('0x0'));var util=require(_0x88e1('0x1'));var logger=require(_0x88e1('0x2'))(_0x88e1('0x3'));var moment=require(_0x88e1('0x4'));var BPromise=require('bluebird');var rp=require(_0x88e1('0x5'));var fs=require('fs');var path=require(_0x88e1('0x6'));var rimraf=require(_0x88e1('0x7'));var config=require(_0x88e1('0x8'));var attributes=require(_0x88e1('0x9'));module[_0x88e1('0xa')]=function(_0x528360,_0x20d067){return _0x528360['define'](_0x88e1('0xb'),attributes,{'tableName':_0x88e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 85b6d57..58028db 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x7217,0x19e));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4975,0x86));var _0x5497=function(_0xd7677c,_0x3d8096){_0xd7677c=_0xd7677c-0x0;var _0x467b2b=_0x4975[_0xd7677c];return _0x467b2b;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index ce739ad..688180e 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 _0x1eb3=['delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./action.controller','/:id','update'];(function(_0x103f5f,_0x2d0dd1){var _0x388142=function(_0x44e6c2){while(--_0x44e6c2){_0x103f5f['push'](_0x103f5f['shift']());}};_0x388142(++_0x2d0dd1);}(_0x1eb3,0x9d));var _0x31eb=function(_0x1979f4,_0x3366aa){_0x1979f4=_0x1979f4-0x0;var _0x32a04e=_0x1eb3[_0x1979f4];return _0x32a04e;};'use strict';var multer=require(_0x31eb('0x0'));var util=require(_0x31eb('0x1'));var path=require(_0x31eb('0x2'));var timeout=require(_0x31eb('0x3'));var express=require(_0x31eb('0x4'));var router=express[_0x31eb('0x5')]();var fs_extra=require(_0x31eb('0x6'));var auth=require(_0x31eb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x31eb('0x8'));router['put'](_0x31eb('0x9'),auth['isAuthenticated'](),controller[_0x31eb('0xa')]);router[_0x31eb('0xb')](_0x31eb('0x9'),auth[_0x31eb('0xc')](),controller['destroy']);module[_0x31eb('0xd')]=router; \ No newline at end of file +var _0x1686=['fs-extra','../../components/auth/service','../../config/environment','put','isAuthenticated','update','delete','/:id','multer','util','path','connect-timeout'];(function(_0x4ac8d1,_0x4384ae){var _0x2ef84e=function(_0xc0c2b0){while(--_0xc0c2b0){_0x4ac8d1['push'](_0x4ac8d1['shift']());}};_0x2ef84e(++_0x4384ae);}(_0x1686,0x104));var _0x6168=function(_0xf4972d,_0xf1c2ee){_0xf4972d=_0xf4972d-0x0;var _0x125f00=_0x1686[_0xf4972d];return _0x125f00;};'use strict';var multer=require(_0x6168('0x0'));var util=require(_0x6168('0x1'));var path=require(_0x6168('0x2'));var timeout=require(_0x6168('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6168('0x4'));var auth=require(_0x6168('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6168('0x6'));var controller=require('./action.controller');router[_0x6168('0x7')]('/:id',auth[_0x6168('0x8')](),controller[_0x6168('0x9')]);router[_0x6168('0xa')](_0x6168('0xb'),auth[_0x6168('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 15b7ae3..df072e1 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0xcae7af,_0x12ea35){var _0x476c98=function(_0x5e6a77){while(--_0x5e6a77){_0xcae7af['push'](_0xcae7af['shift']());}};_0x476c98(++_0x12ea35);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x3604fd,_0x36d36c){var _0x449dff=function(_0x20ad1e){while(--_0x20ad1e){_0x3604fd['push'](_0x3604fd['shift']());}};_0x449dff(++_0x36d36c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x25cf87,_0x1bbc50){_0x25cf87=_0x25cf87-0x0;var _0x353cca=_0x3eea[_0x25cf87];return _0x353cca;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 502adac..922eab5 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 _0xf0b0=['groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NOT\x20NULL','keyBy','replace','alias','output','web','%s-%s.%s','randomstring','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','savename','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','find','catch','create','body','role','user','Reports','UserProfileSection','UserProfileResource','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','format'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xf0b0,0xd1));var _0x0f0b=function(_0x26a99d,_0x1a746e){_0x26a99d=_0x26a99d-0x0;var _0x231c06=_0xf0b0[_0x26a99d];return _0x231c06;};'use strict';var emlformat=require(_0x0f0b('0x0'));var rimraf=require(_0x0f0b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f0b('0x2'));var rp=require(_0x0f0b('0x3'));var moment=require(_0x0f0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0f0b('0x5'));var util=require(_0x0f0b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0f0b('0x7'));var ejs=require(_0x0f0b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f0b('0x9'));var squel=require(_0x0f0b('0xa'));var crypto=require(_0x0f0b('0xb'));var jsforce=require(_0x0f0b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0f0b('0x7'));var querystring=require('querystring');var Papa=require(_0x0f0b('0xd'));var Redis=require('ioredis');var authService=require(_0x0f0b('0xe'));var qs=require(_0x0f0b('0xf'));var as=require(_0x0f0b('0x10'));var hardwareService=require(_0x0f0b('0x11'));var logger=require('../../config/logger')(_0x0f0b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0f0b('0x13'));var db=require(_0x0f0b('0x14'))['db'];var dbH=require(_0x0f0b('0x14'))[_0x0f0b('0x15')];function respondWithStatusCode(_0x500eea,_0x47a443){_0x47a443=_0x47a443||0xcc;return function(_0x568a05){if(_0x568a05){return _0x500eea[_0x0f0b('0x16')](_0x47a443);}return _0x500eea[_0x0f0b('0x17')](_0x47a443)[_0x0f0b('0x18')]();};}function respondWithResult(_0x4f4bbf,_0x3fa206){_0x3fa206=_0x3fa206||0xc8;return function(_0x53dedc){if(_0x53dedc){return _0x4f4bbf[_0x0f0b('0x17')](_0x3fa206)[_0x0f0b('0x19')](_0x53dedc);}};}function respondWithFilteredResult(_0x1334e6,_0x5491ab){return function(_0x3a64dc){if(_0x3a64dc){var _0x3d6293=typeof _0x5491ab[_0x0f0b('0x1a')]===_0x0f0b('0x1b')&&typeof _0x5491ab['limit']===_0x0f0b('0x1b');var _0xd0f672=_0x3a64dc[_0x0f0b('0x1c')];var _0x1da8e0=_0x3d6293?0x0:_0x5491ab[_0x0f0b('0x1a')];var _0x148284=_0x3d6293?_0x3a64dc[_0x0f0b('0x1c')]:_0x5491ab['offset']+_0x5491ab[_0x0f0b('0x1d')];var _0x2cd771;if(_0x148284>=_0xd0f672){_0x148284=_0xd0f672;_0x2cd771=0xc8;}else{_0x2cd771=0xce;}_0x1334e6['status'](_0x2cd771);return _0x1334e6[_0x0f0b('0x1e')](_0x0f0b('0x1f'),_0x1da8e0+'-'+_0x148284+'/'+_0xd0f672)[_0x0f0b('0x19')](_0x3a64dc);}return null;};}function patchUpdates(_0x35fe61){return function(_0x5d8060){try{jsonpatch[_0x0f0b('0x20')](_0x5d8060,_0x35fe61,!![]);}catch(_0x5a1a44){return BPromise[_0x0f0b('0x21')](_0x5a1a44);}return _0x5d8060[_0x0f0b('0x22')]();};}function saveUpdates(_0x26b05f,_0x2bf01f){return function(_0x219d06){if(_0x219d06){return _0x219d06[_0x0f0b('0x23')](_0x26b05f)[_0x0f0b('0x24')](function(_0x4930d7){return _0x4930d7;});}return null;};}function removeEntity(_0x5bac1a,_0x3201f4){return function(_0x2f3aa4){if(_0x2f3aa4){return _0x2f3aa4[_0x0f0b('0x25')]()[_0x0f0b('0x24')](function(){var _0x43093c=_0x2f3aa4[_0x0f0b('0x26')]({'plain':!![]});var _0x4d47aa=_0x0f0b('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d47aa,'resourceId':_0x43093c['id']}})['then'](function(){return _0x2f3aa4;});})[_0x0f0b('0x24')](function(){_0x5bac1a[_0x0f0b('0x17')](0xcc)[_0x0f0b('0x18')]();});}};}function handleEntityNotFound(_0x3fb4f7,_0x16de11){return function(_0x2aaa8d){if(!_0x2aaa8d){_0x3fb4f7[_0x0f0b('0x16')](0x194);}return _0x2aaa8d;};}function handleError(_0x7b4193,_0x155902){_0x155902=_0x155902||0x1f4;return function(_0x3ce895){logger[_0x0f0b('0x28')](_0x3ce895[_0x0f0b('0x29')]);if(_0x3ce895[_0x0f0b('0x2a')]){delete _0x3ce895[_0x0f0b('0x2a')];}_0x7b4193[_0x0f0b('0x17')](_0x155902)[_0x0f0b('0x2b')](_0x3ce895);};}exports[_0x0f0b('0x2c')]=function(_0x2f5788,_0x561fa4){var _0x35a6ea={},_0xabb8dc={},_0x4dd243={'count':0x0,'rows':[]};var _0x376b24=_[_0x0f0b('0x2d')](db[_0x0f0b('0x2e')][_0x0f0b('0x2f')],function(_0x2acd9f){return{'name':_0x2acd9f[_0x0f0b('0x30')],'type':_0x2acd9f[_0x0f0b('0x31')][_0x0f0b('0x32')]};});_0xabb8dc['model']=_['map'](_0x376b24,_0x0f0b('0x2a'));_0xabb8dc['query']=_['keys'](_0x2f5788['query']);_0xabb8dc['filters']=_[_0x0f0b('0x33')](_0xabb8dc[_0x0f0b('0x34')],_0xabb8dc[_0x0f0b('0x35')]);_0x35a6ea['attributes']=_['intersection'](_0xabb8dc['model'],qs[_0x0f0b('0x36')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x36')]));_0x35a6ea[_0x0f0b('0x37')]=_0x35a6ea['attributes'][_0x0f0b('0x38')]?_0x35a6ea[_0x0f0b('0x37')]:_0xabb8dc[_0x0f0b('0x34')];if(!_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x39')](_0x0f0b('0x3a'))){_0x35a6ea[_0x0f0b('0x1d')]=qs[_0x0f0b('0x1d')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x1d')]);_0x35a6ea[_0x0f0b('0x1a')]=qs['offset'](_0x2f5788[_0x0f0b('0x35')]['offset']);}_0x35a6ea[_0x0f0b('0x3b')]=qs[_0x0f0b('0x3c')](_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x3c')]);_0x35a6ea[_0x0f0b('0x3d')]=qs[_0x0f0b('0x3e')](_[_0x0f0b('0x3f')](_0x2f5788[_0x0f0b('0x35')],_0xabb8dc[_0x0f0b('0x3e')]),_0x376b24);if(_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x40')]){_0x35a6ea[_0x0f0b('0x3d')]=_[_0x0f0b('0x41')](_0x35a6ea[_0x0f0b('0x3d')],{'$or':_[_0x0f0b('0x2d')](_0x376b24,function(_0x4f9553){if(_0x4f9553['type']!==_0x0f0b('0x42')){var _0x222efd={};_0x222efd[_0x4f9553[_0x0f0b('0x2a')]]={'$like':'%'+_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x40')]+'%'};return _0x222efd;}})});}_0x35a6ea=_[_0x0f0b('0x41')]({},_0x35a6ea,_0x2f5788[_0x0f0b('0x43')]);var _0x462fae={'where':_0x35a6ea[_0x0f0b('0x3d')]};return db[_0x0f0b('0x2e')][_0x0f0b('0x1c')](_0x462fae)[_0x0f0b('0x24')](function(_0x593476){_0x4dd243[_0x0f0b('0x1c')]=_0x593476;if(_0x2f5788[_0x0f0b('0x35')][_0x0f0b('0x44')]){_0x35a6ea[_0x0f0b('0x45')]=[{'all':!![]}];}return db[_0x0f0b('0x2e')][_0x0f0b('0x46')](_0x35a6ea);})[_0x0f0b('0x24')](function(_0x19590a){_0x4dd243['rows']=_0x19590a;return _0x4dd243;})[_0x0f0b('0x24')](respondWithFilteredResult(_0x561fa4,_0x35a6ea))['catch'](handleError(_0x561fa4,null));};exports['show']=function(_0xfa16be,_0xfa3fe6){var _0x568125={'raw':![],'where':{'id':_0xfa16be[_0x0f0b('0x47')]['id']}},_0x11228d={};_0x11228d[_0x0f0b('0x34')]=_[_0x0f0b('0x48')](db[_0x0f0b('0x2e')][_0x0f0b('0x2f')]);_0x11228d[_0x0f0b('0x35')]=_[_0x0f0b('0x48')](_0xfa16be[_0x0f0b('0x35')]);_0x11228d[_0x0f0b('0x3e')]=_[_0x0f0b('0x33')](_0x11228d['model'],_0x11228d[_0x0f0b('0x35')]);_0x568125[_0x0f0b('0x37')]=_['intersection'](_0x11228d[_0x0f0b('0x34')],qs[_0x0f0b('0x36')](_0xfa16be[_0x0f0b('0x35')][_0x0f0b('0x36')]));_0x568125['attributes']=_0x568125[_0x0f0b('0x37')][_0x0f0b('0x38')]?_0x568125[_0x0f0b('0x37')]:_0x11228d[_0x0f0b('0x34')];if(_0xfa16be[_0x0f0b('0x35')][_0x0f0b('0x44')]){_0x568125[_0x0f0b('0x45')]=[{'all':!![]}];}_0x568125=_[_0x0f0b('0x41')]({},_0x568125,_0xfa16be[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0x568125)[_0x0f0b('0x24')](handleEntityNotFound(_0xfa3fe6,null))['then'](respondWithResult(_0xfa3fe6,null))[_0x0f0b('0x4a')](handleError(_0xfa3fe6,null));};exports[_0x0f0b('0x4b')]=function(_0x381118,_0x132526){return db[_0x0f0b('0x2e')]['create'](_0x381118[_0x0f0b('0x4c')],{})['then'](function(_0x20c01c){var _0x238323=_0x381118['user']['get']({'plain':!![]});if(!_0x238323)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x238323[_0x0f0b('0x4d')]===_0x0f0b('0x4e')){var _0x4eacd2=_0x20c01c[_0x0f0b('0x26')]({'plain':!![]});var _0x1e9397=_0x0f0b('0x4f');return db[_0x0f0b('0x50')][_0x0f0b('0x49')]({'where':{'name':_0x1e9397,'userProfileId':_0x238323['userProfileId']},'raw':!![]})[_0x0f0b('0x24')](function(_0x3b1ae9){if(_0x3b1ae9&&_0x3b1ae9['autoAssociation']===0x0){return db[_0x0f0b('0x51')]['create']({'name':_0x4eacd2['name'],'resourceId':_0x4eacd2['id'],'type':_0x0f0b('0x27'),'sectionId':_0x3b1ae9['id']},{})['then'](function(){return _0x20c01c;});}else{return _0x20c01c;}})['catch'](function(_0x44afec){logger[_0x0f0b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44afec);throw _0x44afec;});}return _0x20c01c;})[_0x0f0b('0x24')](respondWithResult(_0x132526,0xc9))[_0x0f0b('0x4a')](handleError(_0x132526,null));};exports[_0x0f0b('0x23')]=function(_0x717119,_0x16f4cd){if(_0x717119[_0x0f0b('0x4c')]['id']){delete _0x717119[_0x0f0b('0x4c')]['id'];}return db[_0x0f0b('0x2e')][_0x0f0b('0x49')]({'where':{'id':_0x717119['params']['id']}})[_0x0f0b('0x24')](handleEntityNotFound(_0x16f4cd,null))[_0x0f0b('0x24')](saveUpdates(_0x717119[_0x0f0b('0x4c')],null))[_0x0f0b('0x24')](respondWithResult(_0x16f4cd,null))['catch'](handleError(_0x16f4cd,null));};exports[_0x0f0b('0x25')]=function(_0x38eefb,_0x2b88f8){return db[_0x0f0b('0x2e')][_0x0f0b('0x49')]({'where':{'id':_0x38eefb['params']['id']}})[_0x0f0b('0x24')](handleEntityNotFound(_0x2b88f8,null))[_0x0f0b('0x24')](removeEntity(_0x2b88f8,null))[_0x0f0b('0x4a')](handleError(_0x2b88f8,null));};exports[_0x0f0b('0x52')]=function(_0x375f0f,_0x2feab2){var _0xd25624=0xa;var _0x4b6520=[_0x0f0b('0x53'),_0x0f0b('0x54'),_0x0f0b('0x55'),_0x0f0b('0x56')];var _0x5c4649={'SUM':'SUM(%s)','COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0f0b('0x58'),'MIN':_0x0f0b('0x59'),'AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0f0b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb61db={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x0f0b('0x5c'),'ROUND':_0x0f0b('0x5d'),'UNIX_TIMESTAMP':_0x0f0b('0x5e')};var _0x27c9b6=function(_0x282005){return!_[_0x0f0b('0x5f')]([_0x0f0b('0x60'),'IS\x20NOT\x20NULL',_0x0f0b('0x61'),_0x0f0b('0x62')],_0x282005);};var _0x100a5e=function(_0x9e852e){if(!_0x9e852e||!_0x9e852e[_0x0f0b('0x63')]['length']){return'';}for(var _0x200963='(',_0x1760c5=0x0;_0x1760c5<_0x9e852e['rules']['length'];_0x1760c5+=0x1){_0x1760c5>0x0&&(_0x200963+='\x20'+_0x9e852e[_0x0f0b('0x64')]+'\x20');_0x200963+=_0x9e852e[_0x0f0b('0x63')][_0x1760c5]['group']?_0x100a5e(_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x65')]):_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x66')]+'\x20'+_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x67')]+(_0x27c9b6(_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x67')])?'\x20'+_0x9e852e[_0x0f0b('0x63')][_0x1760c5][_0x0f0b('0x68')]:'');}return _0x200963+')';};var _0x837d00={'where':{'id':_0x375f0f[_0x0f0b('0x47')]['id']}},_0x1f69a4,_0x352073,_0x23e42e,_0x2c7867,_0x247e35;_0x837d00=_[_0x0f0b('0x41')]({},_0x837d00,_0x375f0f[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0x837d00)[_0x0f0b('0x24')](function(_0x4513ad){if(_0x4513ad){_0x1f69a4=_0x4513ad;return _0x4513ad[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0xf68000){if(_0xf68000){if(!_0xf68000[_0x0f0b('0x38')]){throw new db[(_0x0f0b('0x6a'))][(_0x0f0b('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x352073=_0xf68000;return db[_0x0f0b('0x6c')][_0x0f0b('0x46')]({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x4dda88){if(_0x4dda88){_0x23e42e=_['keyBy'](_0x4dda88,'id');var _0x593af5;var _0x387281=squel[_0x0f0b('0x6d')]();_0x387281[_0x0f0b('0x6e')](_0x1f69a4['table']);for(var _0x2fc598=0x0;_0x2fc598<_0x352073[_0x0f0b('0x38')];_0x2fc598+=0x1){_0x593af5=_0x352073[_0x2fc598]['MetricId']?_0x23e42e[_0x352073[_0x2fc598][_0x0f0b('0x6f')]][_0x0f0b('0x70')]:_0x352073[_0x2fc598][_0x0f0b('0x66')];_0x593af5=_0x352073[_0x2fc598][_0x0f0b('0x71')]?_['replace'](_0x5c4649[_0x352073[_0x2fc598][_0x0f0b('0x71')]],'%s',_0x593af5):_0x593af5;_0x593af5=_0x352073[_0x2fc598][_0x0f0b('0x72')]?_['replace'](_0xb61db[_0x352073[_0x2fc598][_0x0f0b('0x72')]],'%s',_0x593af5):_0x593af5;if(_0x352073[_0x2fc598][_0x0f0b('0x73')]){_0x387281[_0x0f0b('0x65')](_0x593af5);}_0x352073[_0x2fc598][_0x0f0b('0x74')]&&_0x387281['order'](_0x593af5,_0x352073[_0x2fc598]['orderBy']===_0x0f0b('0x75')?![]:!![]);_0x387281[_0x0f0b('0x66')](_0x593af5,_0x352073[_0x2fc598]['alias']||_0x593af5);}if(_0x1f69a4[_0x0f0b('0x76')]){_0x1f69a4[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x1f69a4[_0x0f0b('0x76')]);for(var _0x6343d2=0x0;_0x6343d2<_0x1f69a4[_0x0f0b('0x76')][_0x0f0b('0x38')];_0x6343d2+=0x1){if(_0x1f69a4['joins'][_0x6343d2][_0x0f0b('0x31')]&&_[_0x0f0b('0x5f')](_0x4b6520,_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x31')])&&_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x78')]&&_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x79')]&&_0x1f69a4['joins'][_0x6343d2][_0x0f0b('0x7a')]){_0x387281[_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x31')]](_0x1f69a4['joins'][_0x6343d2]['foreignTable'],null,util['format'](_0x0f0b('0x7b'),_0x1f69a4[_0x0f0b('0x7c')],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2][_0x0f0b('0x78')],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2]['foreignTable'],_0x1f69a4[_0x0f0b('0x76')][_0x6343d2]['foreignKey']));}}}if(_0x1f69a4['conditions']){_0x1f69a4[_0x0f0b('0x7d')]=JSON[_0x0f0b('0x77')](_0x1f69a4[_0x0f0b('0x7d')]);_0x387281[_0x0f0b('0x3d')](_0x100a5e(_0x1f69a4[_0x0f0b('0x7d')][_0x0f0b('0x65')]));}_0x247e35=_0x387281[_0x0f0b('0x7e')]();_0x387281[_0x0f0b('0x1d')](_0xd25624);_0x387281[_0x0f0b('0x1a')](0x0);logger[_0x0f0b('0x7f')](_0x0f0b('0x80'),_0x387281[_0x0f0b('0x81')]());return dbH[_0x0f0b('0x82')]['query'](_0x387281[_0x0f0b('0x81')](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});}})[_0x0f0b('0x24')](respondWithResult(_0x2feab2,null))['catch'](handleError(_0x2feab2,null));};function runReport(_0x241b12,_0x545300,_0x3f9c7f){var _0x3b6b97=_0x545300['name'];var _0x4b44db=0xa;var _0x2b7045=[_0x0f0b('0x53'),'left_join',_0x0f0b('0x55'),_0x0f0b('0x56')];var _0x27a014={'SUM':_0x0f0b('0x84'),'COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':_0x0f0b('0x85'),'MAX':_0x0f0b('0x58'),'MIN':_0x0f0b('0x59'),'AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0f0b('0x86')};var _0x4c79a5={'SEC_TO_TIME':_0x0f0b('0x87'),'DATE':_0x0f0b('0x88'),'HOUR':'HOUR(%s)','ROUND':_0x0f0b('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xee87dd=function(_0x2e169a){return!_[_0x0f0b('0x5f')](['IS\x20NULL',_0x0f0b('0x89'),_0x0f0b('0x61'),_0x0f0b('0x62')],_0x2e169a);};var _0x5e5052=function(_0x5b3fbc){if(!_0x5b3fbc||!_0x5b3fbc[_0x0f0b('0x63')][_0x0f0b('0x38')]){return'';}for(var _0x4d4f01='(',_0x570576=0x0;_0x570576<_0x5b3fbc[_0x0f0b('0x63')]['length'];_0x570576+=0x1){_0x570576>0x0&&(_0x4d4f01+='\x20'+_0x5b3fbc['operator']+'\x20');_0x4d4f01+=_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x65')]?_0x5e5052(_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x65')]):_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x66')]+'\x20'+_0x5b3fbc['rules'][_0x570576][_0x0f0b('0x67')]+(_0xee87dd(_0x5b3fbc[_0x0f0b('0x63')][_0x570576][_0x0f0b('0x67')])?'\x20'+_0x5b3fbc[_0x0f0b('0x63')][_0x570576]['value']:'');}return _0x4d4f01+')';};var _0x1bbe2e={'where':{'id':_0x241b12['id']}},_0x225111,_0x3b14e5,_0x385f5e,_0x152efe,_0x353587;_0x1bbe2e=_[_0x0f0b('0x41')]({},_0x1bbe2e,_0x3f9c7f);return db[_0x0f0b('0x2e')]['find'](_0x1bbe2e)['then'](function(_0x5c7e34){if(_0x5c7e34){_0x225111=_0x5c7e34;return _0x5c7e34[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0x40bc66){if(_0x40bc66){if(!_0x40bc66['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3b14e5=_0x40bc66;return db['AnalyticMetric'][_0x0f0b('0x46')]({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x39fa07){if(_0x39fa07){_0x385f5e=_[_0x0f0b('0x8a')](_0x39fa07,'id');var _0xca7b98;var _0x10b4ec=squel[_0x0f0b('0x6d')]();_0x10b4ec[_0x0f0b('0x6e')](_0x225111['table']);for(var _0x3e2eb6=0x0;_0x3e2eb6<_0x3b14e5[_0x0f0b('0x38')];_0x3e2eb6+=0x1){_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x6f')]?_0x385f5e[_0x3b14e5[_0x3e2eb6][_0x0f0b('0x6f')]]['metric']:_0x3b14e5[_0x3e2eb6]['field'];_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x71')]?_[_0x0f0b('0x8b')](_0x27a014[_0x3b14e5[_0x3e2eb6][_0x0f0b('0x71')]],'%s',_0xca7b98):_0xca7b98;_0xca7b98=_0x3b14e5[_0x3e2eb6][_0x0f0b('0x72')]?_[_0x0f0b('0x8b')](_0x4c79a5[_0x3b14e5[_0x3e2eb6]['format']],'%s',_0xca7b98):_0xca7b98;if(_0x3b14e5[_0x3e2eb6]['groupBy']){_0x10b4ec[_0x0f0b('0x65')](_0xca7b98);}_0x3b14e5[_0x3e2eb6]['orderBy']&&_0x10b4ec[_0x0f0b('0x3b')](_0xca7b98,_0x3b14e5[_0x3e2eb6]['orderBy']==='DESC'?![]:!![]);_0x10b4ec[_0x0f0b('0x66')](_0xca7b98,_0x3b14e5[_0x3e2eb6][_0x0f0b('0x8c')]||_0xca7b98);}if(_0x225111['joins']){_0x225111[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x225111[_0x0f0b('0x76')]);for(var _0x2ba180=0x0;_0x2ba180<_0x225111['joins']['length'];_0x2ba180+=0x1){if(_0x225111['joins'][_0x2ba180][_0x0f0b('0x31')]&&_[_0x0f0b('0x5f')](_0x2b7045,_0x225111['joins'][_0x2ba180]['type'])&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x78')]&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x79')]&&_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x7a')]){_0x10b4ec[_0x225111['joins'][_0x2ba180][_0x0f0b('0x31')]](_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x79')],null,util[_0x0f0b('0x72')](_0x0f0b('0x7b'),_0x225111[_0x0f0b('0x7c')],_0x225111[_0x0f0b('0x76')][_0x2ba180][_0x0f0b('0x78')],_0x225111[_0x0f0b('0x76')][_0x2ba180]['foreignTable'],_0x225111['joins'][_0x2ba180][_0x0f0b('0x7a')]));}}}if(_0x225111['conditions']){_0x225111['conditions']=JSON[_0x0f0b('0x77')](_0x225111[_0x0f0b('0x7d')]);_0x10b4ec['where'](_0x5e5052(_0x225111[_0x0f0b('0x7d')][_0x0f0b('0x65')]));}_0x353587=_0x10b4ec[_0x0f0b('0x7e')]();_0x10b4ec['limit'](_0x4b44db);_0x10b4ec[_0x0f0b('0x1a')](0x0);return;}})[_0x0f0b('0x24')](function(){if(_0x545300[_0x0f0b('0x8d')]===_0x0f0b('0x8e')){return null;}var _0xa122dc=_['merge'](_0x545300,{'name':_0x545300['fullPath']||_0x545300[_0x0f0b('0x2a')]||_0x225111[_0x0f0b('0x2a')],'basename':_0x3b6b97,'savename':util[_0x0f0b('0x72')](_0x0f0b('0x8f'),_0x545300[_0x0f0b('0x2a')]||_0x225111['name'],require(_0x0f0b('0x90'))['generate'](0x4),_0x545300[_0x0f0b('0x8d')]||'csv'),'reportId':_0x225111['id'],'reportType':_0x0f0b('0x91')});return db['AnalyticExtractedReport'][_0x0f0b('0x4b')](_0xa122dc,{'raw':!![]});})['then'](function(_0x47d422){if(_0x225111['table']===_0x0f0b('0x92')){_0x353587[_0x0f0b('0x3d')](_0x225111[_0x0f0b('0x7c')]+_0x0f0b('0x93'),_0x545300['startDate'],_0x545300[_0x0f0b('0x94')]);}else{_0x353587[_0x0f0b('0x3d')](_0x225111['table']+_0x0f0b('0x95'),_0x545300[_0x0f0b('0x96')],_0x545300['endDate']);}if(_0x47d422){logger[_0x0f0b('0x97')](_0x0f0b('0x98'),_0x353587[_0x0f0b('0x81')]());require(_0x0f0b('0x99'))['fork'](path[_0x0f0b('0x53')](__dirname,'../../components/export/',_0x47d422[_0x0f0b('0x8d')]),[_0x47d422['id'],_0x353587[_0x0f0b('0x81')](),path[_0x0f0b('0x53')](__dirname,'../../files/reports',_0x47d422[_0x0f0b('0x9a')]),_0x3b6b97]);return _0x47d422;}else{var _0x4ec957=squel[_0x0f0b('0x6d')]();_0x4ec957[_0x0f0b('0x6e')]('('+_0x353587[_0x0f0b('0x81')]()+')',_0x0f0b('0x9b'));_0x4ec957[_0x0f0b('0x66')](_0x0f0b('0x9c'),'count');_0x353587[_0x0f0b('0x1d')](_0x545300[_0x0f0b('0x1d')]||_0x4b44db);_0x353587[_0x0f0b('0x1a')](_0x545300[_0x0f0b('0x1a')]||0x0);return dbH[_0x0f0b('0x82')][_0x0f0b('0x35')](_0x4ec957[_0x0f0b('0x81')](),{'type':dbH['sequelize'][_0x0f0b('0x83')][_0x0f0b('0x9d')]})[_0x0f0b('0x24')](function(_0x4da2a9){if(!_0x4da2a9['length']){_0x152efe=0x0;}else{_0x152efe=_0x4da2a9[0x0][_0x0f0b('0x1c')]||0x0;}return dbH[_0x0f0b('0x82')]['query'](_0x353587['toString'](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});})[_0x0f0b('0x24')](function(_0x1ee745){return{'rows':_0x1ee745||[],'count':_0x152efe};});}});}exports[_0x0f0b('0x9e')]=function(_0x16e285,_0x28bb1a){return runReport(_0x16e285[_0x0f0b('0x47')],_0x16e285[_0x0f0b('0x35')],_0x16e285[_0x0f0b('0x43')])[_0x0f0b('0x24')](respondWithResult(_0x28bb1a,null))[_0x0f0b('0x4a')](handleError(_0x28bb1a,null));};exports[_0x0f0b('0x9f')]=runReport;exports[_0x0f0b('0x35')]=function(_0x210ea4,_0x57d3b2){var _0x1b8ea3=0xa;var _0x23a01b=[_0x0f0b('0x53'),_0x0f0b('0x54'),'right_join',_0x0f0b('0x56')];var _0x5c9b7f={'SUM':_0x0f0b('0x84'),'COUNT':_0x0f0b('0x57'),'COUNT DISTINCT':_0x0f0b('0x85'),'MAX':_0x0f0b('0x58'),'MIN':'MIN(%s)','AVG':_0x0f0b('0x5a'),'GROUP_CONCAT':_0x0f0b('0xa0'),'GROUP_CONCAT ASC':_0x0f0b('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x51c664={'SEC_TO_TIME':_0x0f0b('0x87'),'DATE':_0x0f0b('0x88'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0f0b('0x5e')};var _0x140551=function(_0x119e12){return!_['includes']([_0x0f0b('0x60'),_0x0f0b('0x89'),_0x0f0b('0x61'),'IS\x20NOT\x20EMPTY'],_0x119e12);};var _0x1f0338=function(_0x271554){if(!_0x271554||!_0x271554[_0x0f0b('0x63')][_0x0f0b('0x38')]){return'';}for(var _0x53c66b='(',_0x2d8029=0x0;_0x2d8029<_0x271554[_0x0f0b('0x63')][_0x0f0b('0x38')];_0x2d8029+=0x1){_0x2d8029>0x0&&(_0x53c66b+='\x20'+_0x271554[_0x0f0b('0x64')]+'\x20');_0x53c66b+=_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x65')]?_0x1f0338(_0x271554['rules'][_0x2d8029][_0x0f0b('0x65')]):_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x66')]+'\x20'+_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x67')]+(_0x140551(_0x271554[_0x0f0b('0x63')][_0x2d8029][_0x0f0b('0x67')])?'\x20'+_0x271554[_0x0f0b('0x63')][_0x2d8029]['value']:'');}return _0x53c66b+')';};var _0xa16e36={'where':{'id':_0x210ea4['params']['id']}},_0x1a3a6b,_0x2ca80c,_0x1c9718,_0x39c043,_0x28087d;_0xa16e36=_['merge']({},_0xa16e36,_0x210ea4[_0x0f0b('0x43')]);return db[_0x0f0b('0x2e')][_0x0f0b('0x49')](_0xa16e36)[_0x0f0b('0x24')](function(_0x36d195){if(_0x36d195){_0x1a3a6b=_0x36d195;return _0x36d195[_0x0f0b('0x69')]();}return null;})[_0x0f0b('0x24')](function(_0x2eddcc){if(_0x2eddcc){if(!_0x2eddcc['length']){throw new db[(_0x0f0b('0x6a'))][(_0x0f0b('0x6b'))](_0x0f0b('0xa1'),0x193);}_0x2ca80c=_0x2eddcc;return db[_0x0f0b('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x0f0b('0x24')](function(_0x59d053){if(_0x59d053){_0x1c9718=_[_0x0f0b('0x8a')](_0x59d053,'id');var _0x21e782;var _0x34eb5b=squel[_0x0f0b('0x6d')]();_0x34eb5b[_0x0f0b('0x6e')](_0x1a3a6b[_0x0f0b('0x7c')]);for(var _0x37d017=0x0;_0x37d017<_0x2ca80c['length'];_0x37d017+=0x1){_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x6f')]?_0x1c9718[_0x2ca80c[_0x37d017]['MetricId']][_0x0f0b('0x70')]:_0x2ca80c[_0x37d017][_0x0f0b('0x66')];_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x71')]?_[_0x0f0b('0x8b')](_0x5c9b7f[_0x2ca80c[_0x37d017][_0x0f0b('0x71')]],'%s',_0x21e782):_0x21e782;_0x21e782=_0x2ca80c[_0x37d017][_0x0f0b('0x72')]?_[_0x0f0b('0x8b')](_0x51c664[_0x2ca80c[_0x37d017][_0x0f0b('0x72')]],'%s',_0x21e782):_0x21e782;if(_0x2ca80c[_0x37d017][_0x0f0b('0x73')]){_0x34eb5b[_0x0f0b('0x65')](_0x21e782);}_0x2ca80c[_0x37d017][_0x0f0b('0x74')]&&_0x34eb5b[_0x0f0b('0x3b')](_0x21e782,_0x2ca80c[_0x37d017][_0x0f0b('0x74')]===_0x0f0b('0x75')?![]:!![]);_0x34eb5b[_0x0f0b('0x66')](_0x21e782,_0x2ca80c[_0x37d017][_0x0f0b('0x8c')]||_0x21e782);}if(_0x1a3a6b[_0x0f0b('0x76')]){_0x1a3a6b[_0x0f0b('0x76')]=JSON[_0x0f0b('0x77')](_0x1a3a6b[_0x0f0b('0x76')]);for(var _0x5c1b8c=0x0;_0x5c1b8c<_0x1a3a6b['joins'][_0x0f0b('0x38')];_0x5c1b8c+=0x1){if(_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x31')]&&_['includes'](_0x23a01b,_0x1a3a6b['joins'][_0x5c1b8c]['type'])&&_0x1a3a6b['joins'][_0x5c1b8c][_0x0f0b('0x78')]&&_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')]&&_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c]['foreignKey']){_0x34eb5b[_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x31')]](_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')],null,util[_0x0f0b('0x72')](_0x0f0b('0x7b'),_0x1a3a6b['table'],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x78')],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x79')],_0x1a3a6b[_0x0f0b('0x76')][_0x5c1b8c][_0x0f0b('0x7a')]));}}}if(_0x1a3a6b[_0x0f0b('0x7d')]){_0x1a3a6b[_0x0f0b('0x7d')]=JSON[_0x0f0b('0x77')](_0x1a3a6b[_0x0f0b('0x7d')]);_0x34eb5b[_0x0f0b('0x3d')](_0x1f0338(_0x1a3a6b['conditions'][_0x0f0b('0x65')]));}_0x28087d=_0x34eb5b[_0x0f0b('0x7e')]();_0x34eb5b[_0x0f0b('0x1d')](_0x1b8ea3);_0x34eb5b[_0x0f0b('0x1a')](0x0);logger['debug'](_0x0f0b('0x80'),_0x34eb5b[_0x0f0b('0x81')]());return dbH[_0x0f0b('0x82')][_0x0f0b('0x35')](_0x34eb5b['toString'](),{'type':dbH[_0x0f0b('0x82')][_0x0f0b('0x83')]['SELECT']});}})[_0x0f0b('0x24')](function(){return{'sql':_0x28087d[_0x0f0b('0x81')]()};})['then'](respondWithResult(_0x57d3b2,null))[_0x0f0b('0x4a')](handleError(_0x57d3b2,null));}; \ No newline at end of file +var _0xc2bd=['QueryTypes','SELECT','SUM(%s)','AVG(%s)','IS\x20NOT\x20EMPTY','AnalyticMetric','from','order','output','fullPath','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','runReport','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize'];(function(_0x4ced13,_0x365022){var _0x2fdce1=function(_0x590571){while(--_0x590571){_0x4ced13['push'](_0x4ced13['shift']());}};_0x2fdce1(++_0x365022);}(_0xc2bd,0x16c));var _0xdc2b=function(_0x3824c8,_0x4698cb){_0x3824c8=_0x3824c8-0x0;var _0x319c42=_0xc2bd[_0x3824c8];return _0x319c42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc2b('0x0'));var zipdir=require(_0xdc2b('0x1'));var jsonpatch=require(_0xdc2b('0x2'));var rp=require(_0xdc2b('0x3'));var moment=require(_0xdc2b('0x4'));var BPromise=require(_0xdc2b('0x5'));var Mustache=require(_0xdc2b('0x6'));var util=require(_0xdc2b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdc2b('0x8'));var ejs=require(_0xdc2b('0x9'));var fs=require('fs');var fs_extra=require(_0xdc2b('0xa'));var _=require(_0xdc2b('0xb'));var squel=require(_0xdc2b('0xc'));var crypto=require(_0xdc2b('0xd'));var jsforce=require(_0xdc2b('0xe'));var deskjs=require(_0xdc2b('0xf'));var toCsv=require(_0xdc2b('0x8'));var querystring=require('querystring');var Papa=require(_0xdc2b('0x10'));var Redis=require(_0xdc2b('0x11'));var authService=require(_0xdc2b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdc2b('0x13'));var hardwareService=require(_0xdc2b('0x14'));var logger=require('../../config/logger')(_0xdc2b('0x15'));var utils=require(_0xdc2b('0x16'));var config=require(_0xdc2b('0x17'));var licenseUtil=require(_0xdc2b('0x18'));var db=require(_0xdc2b('0x19'))['db'];var dbH=require(_0xdc2b('0x19'))[_0xdc2b('0x1a')];function respondWithStatusCode(_0x47641d,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xcc;return function(_0x5bcd2f){if(_0x5bcd2f){return _0x47641d[_0xdc2b('0x1b')](_0x5adc9c);}return _0x47641d[_0xdc2b('0x1c')](_0x5adc9c)[_0xdc2b('0x1d')]();};}function respondWithResult(_0x13fe28,_0x149dc7){_0x149dc7=_0x149dc7||0xc8;return function(_0x549dfb){if(_0x549dfb){return _0x13fe28['status'](_0x149dc7)[_0xdc2b('0x1e')](_0x549dfb);}};}function respondWithFilteredResult(_0x3de711,_0x3716bf){return function(_0x763ce1){if(_0x763ce1){var _0x528afe=typeof _0x3716bf['offset']===_0xdc2b('0x1f')&&typeof _0x3716bf[_0xdc2b('0x20')]===_0xdc2b('0x1f');var _0x1dbad7=_0x763ce1[_0xdc2b('0x21')];var _0x5037a5=_0x528afe?0x0:_0x3716bf[_0xdc2b('0x22')];var _0x1b2d20=_0x528afe?_0x763ce1[_0xdc2b('0x21')]:_0x3716bf[_0xdc2b('0x22')]+_0x3716bf[_0xdc2b('0x20')];var _0x45e9b2;if(_0x1b2d20>=_0x1dbad7){_0x1b2d20=_0x1dbad7;_0x45e9b2=0xc8;}else{_0x45e9b2=0xce;}_0x3de711[_0xdc2b('0x1c')](_0x45e9b2);return _0x3de711[_0xdc2b('0x23')](_0xdc2b('0x24'),_0x5037a5+'-'+_0x1b2d20+'/'+_0x1dbad7)[_0xdc2b('0x1e')](_0x763ce1);}return null;};}function patchUpdates(_0x2f2fd8){return function(_0x6590d0){try{jsonpatch[_0xdc2b('0x25')](_0x6590d0,_0x2f2fd8,!![]);}catch(_0x2656ae){return BPromise[_0xdc2b('0x26')](_0x2656ae);}return _0x6590d0['save']();};}function saveUpdates(_0x269696,_0x19648d){return function(_0x529f4a){if(_0x529f4a){return _0x529f4a[_0xdc2b('0x27')](_0x269696)[_0xdc2b('0x28')](function(_0x2ecb30){return _0x2ecb30;});}return null;};}function removeEntity(_0x1c19d7,_0x350875){return function(_0x2b91b7){if(_0x2b91b7){return _0x2b91b7['destroy']()[_0xdc2b('0x28')](function(){var _0x28e613=_0x2b91b7[_0xdc2b('0x29')]({'plain':!![]});var _0x5a92c1=_0xdc2b('0x2a');return db[_0xdc2b('0x2b')][_0xdc2b('0x2c')]({'where':{'type':_0x5a92c1,'resourceId':_0x28e613['id']}})[_0xdc2b('0x28')](function(){return _0x2b91b7;});})[_0xdc2b('0x28')](function(){_0x1c19d7[_0xdc2b('0x1c')](0xcc)[_0xdc2b('0x1d')]();});}};}function handleEntityNotFound(_0x3e7ac0,_0x9f89cf){return function(_0x2b8e69){if(!_0x2b8e69){_0x3e7ac0[_0xdc2b('0x1b')](0x194);}return _0x2b8e69;};}function handleError(_0x553312,_0x2577b1){_0x2577b1=_0x2577b1||0x1f4;return function(_0x402f58){logger[_0xdc2b('0x2d')](_0x402f58[_0xdc2b('0x2e')]);if(_0x402f58[_0xdc2b('0x2f')]){delete _0x402f58[_0xdc2b('0x2f')];}_0x553312[_0xdc2b('0x1c')](_0x2577b1)[_0xdc2b('0x30')](_0x402f58);};}exports[_0xdc2b('0x31')]=function(_0x1efbed,_0x2287f4){var _0x4dec6f={},_0xe69375={},_0x1aa441={'count':0x0,'rows':[]};var _0x24617f=_[_0xdc2b('0x32')](db[_0xdc2b('0x33')][_0xdc2b('0x34')],function(_0x4a9a9b){return{'name':_0x4a9a9b[_0xdc2b('0x35')],'type':_0x4a9a9b[_0xdc2b('0x36')]['key']};});_0xe69375['model']=_[_0xdc2b('0x32')](_0x24617f,_0xdc2b('0x2f'));_0xe69375[_0xdc2b('0x37')]=_[_0xdc2b('0x38')](_0x1efbed['query']);_0xe69375[_0xdc2b('0x39')]=_[_0xdc2b('0x3a')](_0xe69375['model'],_0xe69375[_0xdc2b('0x37')]);_0x4dec6f['attributes']=_[_0xdc2b('0x3a')](_0xe69375[_0xdc2b('0x3b')],qs[_0xdc2b('0x3c')](_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x3c')]));_0x4dec6f[_0xdc2b('0x3d')]=_0x4dec6f[_0xdc2b('0x3d')][_0xdc2b('0x3e')]?_0x4dec6f[_0xdc2b('0x3d')]:_0xe69375[_0xdc2b('0x3b')];if(!_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x3f')]('nolimit')){_0x4dec6f['limit']=qs[_0xdc2b('0x20')](_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x20')]);_0x4dec6f['offset']=qs[_0xdc2b('0x22')](_0x1efbed[_0xdc2b('0x37')]['offset']);}_0x4dec6f['order']=qs[_0xdc2b('0x40')](_0x1efbed['query'][_0xdc2b('0x40')]);_0x4dec6f[_0xdc2b('0x41')]=qs['filters'](_[_0xdc2b('0x42')](_0x1efbed[_0xdc2b('0x37')],_0xe69375['filters']),_0x24617f);if(_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x43')]){_0x4dec6f[_0xdc2b('0x41')]=_[_0xdc2b('0x44')](_0x4dec6f[_0xdc2b('0x41')],{'$or':_['map'](_0x24617f,function(_0x511a1f){if(_0x511a1f[_0xdc2b('0x36')]!==_0xdc2b('0x45')){var _0x917a0d={};_0x917a0d[_0x511a1f[_0xdc2b('0x2f')]]={'$like':'%'+_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x43')]+'%'};return _0x917a0d;}})});}_0x4dec6f=_['merge']({},_0x4dec6f,_0x1efbed[_0xdc2b('0x46')]);var _0x4df7b2={'where':_0x4dec6f[_0xdc2b('0x41')]};return db[_0xdc2b('0x33')]['count'](_0x4df7b2)[_0xdc2b('0x28')](function(_0x159657){_0x1aa441[_0xdc2b('0x21')]=_0x159657;if(_0x1efbed[_0xdc2b('0x37')][_0xdc2b('0x47')]){_0x4dec6f[_0xdc2b('0x48')]=[{'all':!![]}];}return db[_0xdc2b('0x33')][_0xdc2b('0x49')](_0x4dec6f);})[_0xdc2b('0x28')](function(_0x3405a6){_0x1aa441[_0xdc2b('0x4a')]=_0x3405a6;return _0x1aa441;})[_0xdc2b('0x28')](respondWithFilteredResult(_0x2287f4,_0x4dec6f))[_0xdc2b('0x4b')](handleError(_0x2287f4,null));};exports[_0xdc2b('0x4c')]=function(_0x2ea012,_0x43f9f4){var _0x3ae89f={'raw':![],'where':{'id':_0x2ea012[_0xdc2b('0x4d')]['id']}},_0x38b9e2={};_0x38b9e2[_0xdc2b('0x3b')]=_[_0xdc2b('0x38')](db[_0xdc2b('0x33')][_0xdc2b('0x34')]);_0x38b9e2[_0xdc2b('0x37')]=_[_0xdc2b('0x38')](_0x2ea012[_0xdc2b('0x37')]);_0x38b9e2['filters']=_[_0xdc2b('0x3a')](_0x38b9e2[_0xdc2b('0x3b')],_0x38b9e2['query']);_0x3ae89f[_0xdc2b('0x3d')]=_['intersection'](_0x38b9e2[_0xdc2b('0x3b')],qs[_0xdc2b('0x3c')](_0x2ea012[_0xdc2b('0x37')][_0xdc2b('0x3c')]));_0x3ae89f[_0xdc2b('0x3d')]=_0x3ae89f[_0xdc2b('0x3d')][_0xdc2b('0x3e')]?_0x3ae89f[_0xdc2b('0x3d')]:_0x38b9e2[_0xdc2b('0x3b')];if(_0x2ea012[_0xdc2b('0x37')][_0xdc2b('0x47')]){_0x3ae89f[_0xdc2b('0x48')]=[{'all':!![]}];}_0x3ae89f=_['merge']({},_0x3ae89f,_0x2ea012[_0xdc2b('0x46')]);return db[_0xdc2b('0x33')][_0xdc2b('0x4e')](_0x3ae89f)[_0xdc2b('0x28')](handleEntityNotFound(_0x43f9f4,null))[_0xdc2b('0x28')](respondWithResult(_0x43f9f4,null))[_0xdc2b('0x4b')](handleError(_0x43f9f4,null));};exports[_0xdc2b('0x4f')]=function(_0x43ac98,_0x40e841){return db['AnalyticCustomReport'][_0xdc2b('0x4f')](_0x43ac98['body'],{})[_0xdc2b('0x28')](function(_0x1ee570){var _0x2d3bef=_0x43ac98[_0xdc2b('0x50')][_0xdc2b('0x29')]({'plain':!![]});if(!_0x2d3bef)throw new Error(_0xdc2b('0x51'));if(_0x2d3bef['role']===_0xdc2b('0x50')){var _0x521fdf=_0x1ee570['get']({'plain':!![]});var _0x55c54c=_0xdc2b('0x52');return db[_0xdc2b('0x53')][_0xdc2b('0x4e')]({'where':{'name':_0x55c54c,'userProfileId':_0x2d3bef[_0xdc2b('0x54')]},'raw':!![]})[_0xdc2b('0x28')](function(_0x5c0454){if(_0x5c0454&&_0x5c0454[_0xdc2b('0x55')]===0x0){return db[_0xdc2b('0x2b')][_0xdc2b('0x4f')]({'name':_0x521fdf[_0xdc2b('0x2f')],'resourceId':_0x521fdf['id'],'type':_0xdc2b('0x2a'),'sectionId':_0x5c0454['id']},{})[_0xdc2b('0x28')](function(){return _0x1ee570;});}else{return _0x1ee570;}})[_0xdc2b('0x4b')](function(_0x20bf4d){logger[_0xdc2b('0x2d')](_0xdc2b('0x56'),_0x20bf4d);throw _0x20bf4d;});}return _0x1ee570;})['then'](respondWithResult(_0x40e841,0xc9))['catch'](handleError(_0x40e841,null));};exports['update']=function(_0xacf28c,_0x3193bf){if(_0xacf28c[_0xdc2b('0x57')]['id']){delete _0xacf28c[_0xdc2b('0x57')]['id'];}return db[_0xdc2b('0x33')][_0xdc2b('0x4e')]({'where':{'id':_0xacf28c[_0xdc2b('0x4d')]['id']}})[_0xdc2b('0x28')](handleEntityNotFound(_0x3193bf,null))[_0xdc2b('0x28')](saveUpdates(_0xacf28c[_0xdc2b('0x57')],null))['then'](respondWithResult(_0x3193bf,null))['catch'](handleError(_0x3193bf,null));};exports[_0xdc2b('0x2c')]=function(_0x4ed318,_0x58d73c){return db[_0xdc2b('0x33')][_0xdc2b('0x4e')]({'where':{'id':_0x4ed318[_0xdc2b('0x4d')]['id']}})[_0xdc2b('0x28')](handleEntityNotFound(_0x58d73c,null))[_0xdc2b('0x28')](removeEntity(_0x58d73c,null))[_0xdc2b('0x4b')](handleError(_0x58d73c,null));};exports['preview']=function(_0x2b4fcc,_0x2a0f08){var _0x4362fd=0xa;var _0x521835=[_0xdc2b('0x58'),_0xdc2b('0x59'),_0xdc2b('0x5a'),_0xdc2b('0x5b')];var _0x366112={'SUM':'SUM(%s)','COUNT':_0xdc2b('0x5c'),'COUNT DISTINCT':_0xdc2b('0x5d'),'MAX':_0xdc2b('0x5e'),'MIN':_0xdc2b('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xdc2b('0x60'),'GROUP_CONCAT ASC':_0xdc2b('0x61'),'GROUP_CONCAT DESC':_0xdc2b('0x62')};var _0x344d56={'SEC_TO_TIME':_0xdc2b('0x63'),'DATE':_0xdc2b('0x64'),'HOUR':_0xdc2b('0x65'),'ROUND':_0xdc2b('0x66'),'UNIX_TIMESTAMP':_0xdc2b('0x67')};var _0x3046eb=function(_0x5813f4){return!_[_0xdc2b('0x68')]([_0xdc2b('0x69'),_0xdc2b('0x6a'),_0xdc2b('0x6b'),'IS\x20NOT\x20EMPTY'],_0x5813f4);};var _0x2065db=function(_0x141ddd){if(!_0x141ddd||!_0x141ddd[_0xdc2b('0x6c')][_0xdc2b('0x3e')]){return'';}for(var _0x192597='(',_0x3c7246=0x0;_0x3c7246<_0x141ddd[_0xdc2b('0x6c')][_0xdc2b('0x3e')];_0x3c7246+=0x1){_0x3c7246>0x0&&(_0x192597+='\x20'+_0x141ddd[_0xdc2b('0x6d')]+'\x20');_0x192597+=_0x141ddd[_0xdc2b('0x6c')][_0x3c7246][_0xdc2b('0x6e')]?_0x2065db(_0x141ddd['rules'][_0x3c7246][_0xdc2b('0x6e')]):_0x141ddd[_0xdc2b('0x6c')][_0x3c7246][_0xdc2b('0x6f')]+'\x20'+_0x141ddd[_0xdc2b('0x6c')][_0x3c7246]['condition']+(_0x3046eb(_0x141ddd[_0xdc2b('0x6c')][_0x3c7246][_0xdc2b('0x70')])?'\x20'+_0x141ddd['rules'][_0x3c7246][_0xdc2b('0x71')]:'');}return _0x192597+')';};var _0x2697d4={'where':{'id':_0x2b4fcc[_0xdc2b('0x4d')]['id']}},_0x2f414,_0x1ca5a8,_0x4bc3c4,_0x2d7639,_0x2e70d8;_0x2697d4=_[_0xdc2b('0x44')]({},_0x2697d4,_0x2b4fcc[_0xdc2b('0x46')]);return db['AnalyticCustomReport'][_0xdc2b('0x4e')](_0x2697d4)[_0xdc2b('0x28')](function(_0x391ed5){if(_0x391ed5){_0x2f414=_0x391ed5;return _0x391ed5[_0xdc2b('0x72')]();}return null;})[_0xdc2b('0x28')](function(_0x4d6c90){if(_0x4d6c90){if(!_0x4d6c90[_0xdc2b('0x3e')]){throw new db[(_0xdc2b('0x73'))][(_0xdc2b('0x74'))](_0xdc2b('0x75'),0x193);}_0x1ca5a8=_0x4d6c90;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xdc2b('0x28')](function(_0x880388){if(_0x880388){_0x4bc3c4=_[_0xdc2b('0x76')](_0x880388,'id');var _0x35d3cf;var _0x12c082=squel[_0xdc2b('0x77')]();_0x12c082['from'](_0x2f414[_0xdc2b('0x78')]);for(var _0xb72d1=0x0;_0xb72d1<_0x1ca5a8[_0xdc2b('0x3e')];_0xb72d1+=0x1){_0x35d3cf=_0x1ca5a8[_0xb72d1][_0xdc2b('0x79')]?_0x4bc3c4[_0x1ca5a8[_0xb72d1]['MetricId']][_0xdc2b('0x7a')]:_0x1ca5a8[_0xb72d1][_0xdc2b('0x6f')];_0x35d3cf=_0x1ca5a8[_0xb72d1][_0xdc2b('0x7b')]?_[_0xdc2b('0x7c')](_0x366112[_0x1ca5a8[_0xb72d1]['function']],'%s',_0x35d3cf):_0x35d3cf;_0x35d3cf=_0x1ca5a8[_0xb72d1][_0xdc2b('0x7d')]?_[_0xdc2b('0x7c')](_0x344d56[_0x1ca5a8[_0xb72d1][_0xdc2b('0x7d')]],'%s',_0x35d3cf):_0x35d3cf;if(_0x1ca5a8[_0xb72d1][_0xdc2b('0x7e')]){_0x12c082[_0xdc2b('0x6e')](_0x35d3cf);}_0x1ca5a8[_0xb72d1]['orderBy']&&_0x12c082['order'](_0x35d3cf,_0x1ca5a8[_0xb72d1][_0xdc2b('0x7f')]===_0xdc2b('0x80')?![]:!![]);_0x12c082[_0xdc2b('0x6f')](_0x35d3cf,_0x1ca5a8[_0xb72d1][_0xdc2b('0x81')]||_0x35d3cf);}if(_0x2f414[_0xdc2b('0x82')]){_0x2f414[_0xdc2b('0x82')]=JSON['parse'](_0x2f414[_0xdc2b('0x82')]);for(var _0x166047=0x0;_0x166047<_0x2f414[_0xdc2b('0x82')][_0xdc2b('0x3e')];_0x166047+=0x1){if(_0x2f414['joins'][_0x166047][_0xdc2b('0x36')]&&_[_0xdc2b('0x68')](_0x521835,_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x36')])&&_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x83')]&&_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x84')]&&_0x2f414['joins'][_0x166047][_0xdc2b('0x85')]){_0x12c082[_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x36')]](_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x84')],null,util['format'](_0xdc2b('0x86'),_0x2f414[_0xdc2b('0x78')],_0x2f414[_0xdc2b('0x82')][_0x166047]['parentKey'],_0x2f414[_0xdc2b('0x82')][_0x166047][_0xdc2b('0x84')],_0x2f414['joins'][_0x166047]['foreignKey']));}}}if(_0x2f414[_0xdc2b('0x87')]){_0x2f414['conditions']=JSON[_0xdc2b('0x88')](_0x2f414[_0xdc2b('0x87')]);_0x12c082['where'](_0x2065db(_0x2f414[_0xdc2b('0x87')][_0xdc2b('0x6e')]));}_0x2e70d8=_0x12c082[_0xdc2b('0x89')]();_0x12c082[_0xdc2b('0x20')](_0x4362fd);_0x12c082['offset'](0x0);logger['debug']('Limited\x20Query:',_0x12c082[_0xdc2b('0x8a')]());return dbH['sequelize'][_0xdc2b('0x37')](_0x12c082[_0xdc2b('0x8a')](),{'type':dbH[_0xdc2b('0x8b')][_0xdc2b('0x8c')][_0xdc2b('0x8d')]});}})[_0xdc2b('0x28')](respondWithResult(_0x2a0f08,null))[_0xdc2b('0x4b')](handleError(_0x2a0f08,null));};function runReport(_0x31969f,_0x5c495f,_0x41d2d7){var _0x20de25=_0x5c495f['name'];var _0x40592e=0xa;var _0x152f5b=['join','left_join',_0xdc2b('0x5a'),_0xdc2b('0x5b')];var _0x57aeee={'SUM':_0xdc2b('0x8e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdc2b('0x5e'),'MIN':_0xdc2b('0x5f'),'AVG':_0xdc2b('0x8f'),'GROUP_CONCAT':_0xdc2b('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x45402d={'SEC_TO_TIME':_0xdc2b('0x63'),'DATE':_0xdc2b('0x64'),'HOUR':_0xdc2b('0x65'),'ROUND':_0xdc2b('0x66'),'UNIX_TIMESTAMP':_0xdc2b('0x67')};var _0x4bf264=function(_0x2ef7c1){return!_[_0xdc2b('0x68')]([_0xdc2b('0x69'),_0xdc2b('0x6a'),_0xdc2b('0x6b'),_0xdc2b('0x90')],_0x2ef7c1);};var _0xd600f8=function(_0x2dffba){if(!_0x2dffba||!_0x2dffba['rules'][_0xdc2b('0x3e')]){return'';}for(var _0xd55db7='(',_0x4d6b90=0x0;_0x4d6b90<_0x2dffba[_0xdc2b('0x6c')]['length'];_0x4d6b90+=0x1){_0x4d6b90>0x0&&(_0xd55db7+='\x20'+_0x2dffba[_0xdc2b('0x6d')]+'\x20');_0xd55db7+=_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90][_0xdc2b('0x6e')]?_0xd600f8(_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90][_0xdc2b('0x6e')]):_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90]['field']+'\x20'+_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90][_0xdc2b('0x70')]+(_0x4bf264(_0x2dffba[_0xdc2b('0x6c')][_0x4d6b90]['condition'])?'\x20'+_0x2dffba['rules'][_0x4d6b90][_0xdc2b('0x71')]:'');}return _0xd55db7+')';};var _0x4bf51b={'where':{'id':_0x31969f['id']}},_0x212159,_0x2fc427,_0x47fefa,_0x298c66,_0xbb22e9;_0x4bf51b=_[_0xdc2b('0x44')]({},_0x4bf51b,_0x41d2d7);return db[_0xdc2b('0x33')][_0xdc2b('0x4e')](_0x4bf51b)[_0xdc2b('0x28')](function(_0x54e798){if(_0x54e798){_0x212159=_0x54e798;return _0x54e798[_0xdc2b('0x72')]();}return null;})[_0xdc2b('0x28')](function(_0x579150){if(_0x579150){if(!_0x579150[_0xdc2b('0x3e')]){throw new db[(_0xdc2b('0x73'))][(_0xdc2b('0x74'))](_0xdc2b('0x75'),0x193);}_0x2fc427=_0x579150;return db[_0xdc2b('0x91')][_0xdc2b('0x49')]({'raw':!![]});}return null;})['then'](function(_0x440843){if(_0x440843){_0x47fefa=_['keyBy'](_0x440843,'id');var _0x8d5b29;var _0x3f63c1=squel[_0xdc2b('0x77')]();_0x3f63c1[_0xdc2b('0x92')](_0x212159[_0xdc2b('0x78')]);for(var _0x1173ad=0x0;_0x1173ad<_0x2fc427[_0xdc2b('0x3e')];_0x1173ad+=0x1){_0x8d5b29=_0x2fc427[_0x1173ad][_0xdc2b('0x79')]?_0x47fefa[_0x2fc427[_0x1173ad][_0xdc2b('0x79')]][_0xdc2b('0x7a')]:_0x2fc427[_0x1173ad]['field'];_0x8d5b29=_0x2fc427[_0x1173ad][_0xdc2b('0x7b')]?_['replace'](_0x57aeee[_0x2fc427[_0x1173ad][_0xdc2b('0x7b')]],'%s',_0x8d5b29):_0x8d5b29;_0x8d5b29=_0x2fc427[_0x1173ad][_0xdc2b('0x7d')]?_[_0xdc2b('0x7c')](_0x45402d[_0x2fc427[_0x1173ad]['format']],'%s',_0x8d5b29):_0x8d5b29;if(_0x2fc427[_0x1173ad]['groupBy']){_0x3f63c1[_0xdc2b('0x6e')](_0x8d5b29);}_0x2fc427[_0x1173ad][_0xdc2b('0x7f')]&&_0x3f63c1[_0xdc2b('0x93')](_0x8d5b29,_0x2fc427[_0x1173ad][_0xdc2b('0x7f')]==='DESC'?![]:!![]);_0x3f63c1[_0xdc2b('0x6f')](_0x8d5b29,_0x2fc427[_0x1173ad][_0xdc2b('0x81')]||_0x8d5b29);}if(_0x212159['joins']){_0x212159[_0xdc2b('0x82')]=JSON[_0xdc2b('0x88')](_0x212159[_0xdc2b('0x82')]);for(var _0x248a66=0x0;_0x248a66<_0x212159[_0xdc2b('0x82')][_0xdc2b('0x3e')];_0x248a66+=0x1){if(_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x36')]&&_[_0xdc2b('0x68')](_0x152f5b,_0x212159[_0xdc2b('0x82')][_0x248a66]['type'])&&_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x83')]&&_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x84')]&&_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x85')]){_0x3f63c1[_0x212159[_0xdc2b('0x82')][_0x248a66][_0xdc2b('0x36')]](_0x212159['joins'][_0x248a66][_0xdc2b('0x84')],null,util[_0xdc2b('0x7d')](_0xdc2b('0x86'),_0x212159[_0xdc2b('0x78')],_0x212159[_0xdc2b('0x82')][_0x248a66]['parentKey'],_0x212159['joins'][_0x248a66]['foreignTable'],_0x212159['joins'][_0x248a66][_0xdc2b('0x85')]));}}}if(_0x212159[_0xdc2b('0x87')]){_0x212159[_0xdc2b('0x87')]=JSON['parse'](_0x212159[_0xdc2b('0x87')]);_0x3f63c1[_0xdc2b('0x41')](_0xd600f8(_0x212159['conditions']['group']));}_0xbb22e9=_0x3f63c1[_0xdc2b('0x89')]();_0x3f63c1['limit'](_0x40592e);_0x3f63c1['offset'](0x0);return;}})[_0xdc2b('0x28')](function(){if(_0x5c495f[_0xdc2b('0x94')]==='web'){return null;}var _0x52a227=_[_0xdc2b('0x44')](_0x5c495f,{'name':_0x5c495f[_0xdc2b('0x95')]||_0x5c495f[_0xdc2b('0x2f')]||_0x212159[_0xdc2b('0x2f')],'basename':_0x20de25,'savename':util[_0xdc2b('0x7d')]('%s-%s.%s',_0x5c495f[_0xdc2b('0x2f')]||_0x212159['name'],require('randomstring')['generate'](0x4),_0x5c495f[_0xdc2b('0x94')]||_0xdc2b('0x96')),'reportId':_0x212159['id'],'reportType':_0xdc2b('0x97')});return db[_0xdc2b('0x98')][_0xdc2b('0x4f')](_0x52a227,{'raw':!![]});})[_0xdc2b('0x28')](function(_0x454540){if(_0x212159['table']===_0xdc2b('0x99')){_0xbb22e9[_0xdc2b('0x41')](_0x212159['table']+_0xdc2b('0x9a'),_0x5c495f[_0xdc2b('0x9b')],_0x5c495f[_0xdc2b('0x9c')]);}else{_0xbb22e9[_0xdc2b('0x41')](_0x212159[_0xdc2b('0x78')]+_0xdc2b('0x9d'),_0x5c495f[_0xdc2b('0x9b')],_0x5c495f[_0xdc2b('0x9c')]);}if(_0x454540){logger[_0xdc2b('0x9e')](_0xdc2b('0x9f'),_0xbb22e9['toString']());require(_0xdc2b('0xa0'))[_0xdc2b('0xa1')](path[_0xdc2b('0x58')](__dirname,'../../components/export/',_0x454540['output']),[_0x454540['id'],_0xbb22e9['toString'](),path[_0xdc2b('0x58')](__dirname,_0xdc2b('0xa2'),_0x454540[_0xdc2b('0xa3')]),_0x20de25]);return _0x454540;}else{var _0x1e1c19=squel[_0xdc2b('0x77')]();_0x1e1c19['from']('('+_0xbb22e9[_0xdc2b('0x8a')]()+')',_0xdc2b('0xa4'));_0x1e1c19[_0xdc2b('0x6f')]('COUNT(*)',_0xdc2b('0x21'));_0xbb22e9[_0xdc2b('0x20')](_0x5c495f[_0xdc2b('0x20')]||_0x40592e);_0xbb22e9[_0xdc2b('0x22')](_0x5c495f[_0xdc2b('0x22')]||0x0);return dbH[_0xdc2b('0x8b')][_0xdc2b('0x37')](_0x1e1c19[_0xdc2b('0x8a')](),{'type':dbH['sequelize'][_0xdc2b('0x8c')][_0xdc2b('0x8d')]})[_0xdc2b('0x28')](function(_0x4bc87d){if(!_0x4bc87d[_0xdc2b('0x3e')]){_0x298c66=0x0;}else{_0x298c66=_0x4bc87d[0x0][_0xdc2b('0x21')]||0x0;}return dbH[_0xdc2b('0x8b')][_0xdc2b('0x37')](_0xbb22e9[_0xdc2b('0x8a')](),{'type':dbH['sequelize'][_0xdc2b('0x8c')]['SELECT']});})[_0xdc2b('0x28')](function(_0xddd1ee){return{'rows':_0xddd1ee||[],'count':_0x298c66};});}});}exports['run']=function(_0x2df528,_0x2acf3d){return runReport(_0x2df528[_0xdc2b('0x4d')],_0x2df528[_0xdc2b('0x37')],_0x2df528[_0xdc2b('0x46')])[_0xdc2b('0x28')](respondWithResult(_0x2acf3d,null))['catch'](handleError(_0x2acf3d,null));};exports[_0xdc2b('0xa5')]=runReport;exports[_0xdc2b('0x37')]=function(_0x2d8c07,_0x5d645f){var _0x3e606d=0xa;var _0x2c81c6=[_0xdc2b('0x58'),'left_join',_0xdc2b('0x5a'),_0xdc2b('0x5b')];var _0x301b5a={'SUM':_0xdc2b('0x8e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdc2b('0x5e'),'MIN':_0xdc2b('0x5f'),'AVG':_0xdc2b('0x8f'),'GROUP_CONCAT':_0xdc2b('0x60'),'GROUP_CONCAT ASC':_0xdc2b('0x61'),'GROUP_CONCAT DESC':_0xdc2b('0x62')};var _0x2f84e2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdc2b('0x64'),'HOUR':_0xdc2b('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdc2b('0x67')};var _0x213e1f=function(_0x559b17){return!_[_0xdc2b('0x68')](['IS\x20NULL',_0xdc2b('0x6a'),_0xdc2b('0x6b'),_0xdc2b('0x90')],_0x559b17);};var _0x19b5f1=function(_0x5045ac){if(!_0x5045ac||!_0x5045ac['rules']['length']){return'';}for(var _0xe87c0c='(',_0x14d3ae=0x0;_0x14d3ae<_0x5045ac[_0xdc2b('0x6c')][_0xdc2b('0x3e')];_0x14d3ae+=0x1){_0x14d3ae>0x0&&(_0xe87c0c+='\x20'+_0x5045ac[_0xdc2b('0x6d')]+'\x20');_0xe87c0c+=_0x5045ac['rules'][_0x14d3ae][_0xdc2b('0x6e')]?_0x19b5f1(_0x5045ac['rules'][_0x14d3ae]['group']):_0x5045ac[_0xdc2b('0x6c')][_0x14d3ae][_0xdc2b('0x6f')]+'\x20'+_0x5045ac['rules'][_0x14d3ae][_0xdc2b('0x70')]+(_0x213e1f(_0x5045ac[_0xdc2b('0x6c')][_0x14d3ae][_0xdc2b('0x70')])?'\x20'+_0x5045ac['rules'][_0x14d3ae][_0xdc2b('0x71')]:'');}return _0xe87c0c+')';};var _0x4ef4ad={'where':{'id':_0x2d8c07[_0xdc2b('0x4d')]['id']}},_0x811668,_0x2cbfdd,_0x6178d2,_0x5b78ee,_0xe524f5;_0x4ef4ad=_['merge']({},_0x4ef4ad,_0x2d8c07[_0xdc2b('0x46')]);return db[_0xdc2b('0x33')][_0xdc2b('0x4e')](_0x4ef4ad)[_0xdc2b('0x28')](function(_0x4dc3aa){if(_0x4dc3aa){_0x811668=_0x4dc3aa;return _0x4dc3aa[_0xdc2b('0x72')]();}return null;})[_0xdc2b('0x28')](function(_0x450b2a){if(_0x450b2a){if(!_0x450b2a[_0xdc2b('0x3e')]){throw new db['Sequelize'][(_0xdc2b('0x74'))](_0xdc2b('0x75'),0x193);}_0x2cbfdd=_0x450b2a;return db['AnalyticMetric'][_0xdc2b('0x49')]({'raw':!![]});}return null;})['then'](function(_0x40b156){if(_0x40b156){_0x6178d2=_[_0xdc2b('0x76')](_0x40b156,'id');var _0x11ccb9;var _0x1a52d1=squel['select']();_0x1a52d1['from'](_0x811668[_0xdc2b('0x78')]);for(var _0x1ee4e8=0x0;_0x1ee4e8<_0x2cbfdd[_0xdc2b('0x3e')];_0x1ee4e8+=0x1){_0x11ccb9=_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x79')]?_0x6178d2[_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x79')]][_0xdc2b('0x7a')]:_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x6f')];_0x11ccb9=_0x2cbfdd[_0x1ee4e8]['function']?_[_0xdc2b('0x7c')](_0x301b5a[_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7b')]],'%s',_0x11ccb9):_0x11ccb9;_0x11ccb9=_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7d')]?_[_0xdc2b('0x7c')](_0x2f84e2[_0x2cbfdd[_0x1ee4e8]['format']],'%s',_0x11ccb9):_0x11ccb9;if(_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7e')]){_0x1a52d1[_0xdc2b('0x6e')](_0x11ccb9);}_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x7f')]&&_0x1a52d1[_0xdc2b('0x93')](_0x11ccb9,_0x2cbfdd[_0x1ee4e8]['orderBy']==='DESC'?![]:!![]);_0x1a52d1[_0xdc2b('0x6f')](_0x11ccb9,_0x2cbfdd[_0x1ee4e8][_0xdc2b('0x81')]||_0x11ccb9);}if(_0x811668[_0xdc2b('0x82')]){_0x811668['joins']=JSON[_0xdc2b('0x88')](_0x811668['joins']);for(var _0x46e159=0x0;_0x46e159<_0x811668[_0xdc2b('0x82')][_0xdc2b('0x3e')];_0x46e159+=0x1){if(_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x36')]&&_[_0xdc2b('0x68')](_0x2c81c6,_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x36')])&&_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x83')]&&_0x811668[_0xdc2b('0x82')][_0x46e159]['foreignTable']&&_0x811668['joins'][_0x46e159][_0xdc2b('0x85')]){_0x1a52d1[_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x36')]](_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x84')],null,util[_0xdc2b('0x7d')](_0xdc2b('0x86'),_0x811668[_0xdc2b('0x78')],_0x811668['joins'][_0x46e159]['parentKey'],_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x84')],_0x811668[_0xdc2b('0x82')][_0x46e159][_0xdc2b('0x85')]));}}}if(_0x811668['conditions']){_0x811668[_0xdc2b('0x87')]=JSON[_0xdc2b('0x88')](_0x811668[_0xdc2b('0x87')]);_0x1a52d1[_0xdc2b('0x41')](_0x19b5f1(_0x811668[_0xdc2b('0x87')][_0xdc2b('0x6e')]));}_0xe524f5=_0x1a52d1[_0xdc2b('0x89')]();_0x1a52d1[_0xdc2b('0x20')](_0x3e606d);_0x1a52d1['offset'](0x0);logger[_0xdc2b('0xa6')](_0xdc2b('0xa7'),_0x1a52d1[_0xdc2b('0x8a')]());return dbH[_0xdc2b('0x8b')]['query'](_0x1a52d1[_0xdc2b('0x8a')](),{'type':dbH['sequelize'][_0xdc2b('0x8c')][_0xdc2b('0x8d')]});}})[_0xdc2b('0x28')](function(){return{'sql':_0xe524f5[_0xdc2b('0x8a')]()};})['then'](respondWithResult(_0x5d645f,null))[_0xdc2b('0x4b')](handleError(_0x5d645f,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 01442a7..1821347 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 _0x5742=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0x2d7766,_0x17b192){var _0x597efb=function(_0x224d6d){while(--_0x224d6d){_0x2d7766['push'](_0x2d7766['shift']());}};_0x597efb(++_0x17b192);}(_0x5742,0x160));var _0x2574=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x5742[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x2574('0x0'));var util=require(_0x2574('0x1'));var logger=require(_0x2574('0x2'))('api');var moment=require(_0x2574('0x3'));var BPromise=require(_0x2574('0x4'));var rp=require(_0x2574('0x5'));var fs=require('fs');var path=require(_0x2574('0x6'));var rimraf=require('rimraf');var config=require(_0x2574('0x7'));var attributes=require(_0x2574('0x8'));module['exports']=function(_0x1a95d2,_0xbed560){return _0x1a95d2['define'](_0x2574('0x9'),attributes,{'tableName':_0x2574('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6a1=['bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x3ef90f,_0x46f414){var _0x278fab=function(_0x3ef740){while(--_0x3ef740){_0x3ef90f['push'](_0x3ef90f['shift']());}};_0x278fab(++_0x46f414);}(_0xc6a1,0xaf));var _0x1c6a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc6a1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1c6a('0x0'));var util=require(_0x1c6a('0x1'));var logger=require(_0x1c6a('0x2'))(_0x1c6a('0x3'));var moment=require(_0x1c6a('0x4'));var BPromise=require(_0x1c6a('0x5'));var rp=require(_0x1c6a('0x6'));var fs=require('fs');var path=require(_0x1c6a('0x7'));var rimraf=require('rimraf');var config=require(_0x1c6a('0x8'));var attributes=require(_0x1c6a('0x9'));module['exports']=function(_0x2efda3,_0x19c50f){return _0x2efda3['define'](_0x1c6a('0xa'),attributes,{'tableName':_0x1c6a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index e23ae88..73d9b0d 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 _0x6d76=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x4c4b99,_0x3a290f){var _0x150415=function(_0x4b9e37){while(--_0x4b9e37){_0x4c4b99['push'](_0x4c4b99['shift']());}};_0x150415(++_0x3a290f);}(_0x6d76,0x109));var _0x66d7=function(_0x191b08,_0x23f80a){_0x191b08=_0x191b08-0x0;var _0x5d7e91=_0x6d76[_0x191b08];return _0x5d7e91;};'use strict';var _=require(_0x66d7('0x0'));var util=require('util');var moment=require(_0x66d7('0x1'));var BPromise=require(_0x66d7('0x2'));var rs=require(_0x66d7('0x3'));var fs=require('fs');var Redis=require(_0x66d7('0x4'));var db=require(_0x66d7('0x5'))['db'];var utils=require(_0x66d7('0x6'));var logger=require(_0x66d7('0x7'))(_0x66d7('0x8'));var config=require(_0x66d7('0x9'));var jayson=require(_0x66d7('0xa'));var client=jayson[_0x66d7('0xb')][_0x66d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x104ccd,_0x5b9bef,_0x86668c){return new BPromise(function(_0x2fe861,_0x509fff){return client[_0x66d7('0xd')](_0x104ccd,_0x86668c)[_0x66d7('0xe')](function(_0x24f8e7){logger[_0x66d7('0xf')](_0x66d7('0x10'),_0x5b9bef,'request\x20sent');logger['debug'](_0x66d7('0x11'),_0x5b9bef,'request\x20sent',JSON[_0x66d7('0x12')](_0x24f8e7));if(_0x24f8e7[_0x66d7('0x13')]){if(_0x24f8e7[_0x66d7('0x13')][_0x66d7('0x14')]===0x1f4){logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x24f8e7['error']['message']);return _0x509fff(_0x24f8e7['error']['message']);}logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x24f8e7[_0x66d7('0x13')]['message']);return _0x2fe861(_0x24f8e7[_0x66d7('0x13')][_0x66d7('0x15')]);}else{logger[_0x66d7('0xf')](_0x66d7('0x10'),_0x5b9bef,_0x66d7('0x16'));_0x2fe861(_0x24f8e7['result'][_0x66d7('0x15')]);}})[_0x66d7('0x17')](function(_0x5bd07f){logger[_0x66d7('0x13')](_0x66d7('0x10'),_0x5b9bef,_0x5bd07f);_0x509fff(_0x5bd07f);});});} \ No newline at end of file +var _0x1bdb=['moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util'];(function(_0x33485c,_0x92f25){var _0x4a0a6d=function(_0x52fe3b){while(--_0x52fe3b){_0x33485c['push'](_0x33485c['shift']());}};_0x4a0a6d(++_0x92f25);}(_0x1bdb,0x18b));var _0xb1bd=function(_0x3ab53f,_0x508ae7){_0x3ab53f=_0x3ab53f-0x0;var _0x42c654=_0x1bdb[_0x3ab53f];return _0x42c654;};'use strict';var _=require('lodash');var util=require(_0xb1bd('0x0'));var moment=require(_0xb1bd('0x1'));var BPromise=require(_0xb1bd('0x2'));var rs=require(_0xb1bd('0x3'));var fs=require('fs');var Redis=require(_0xb1bd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb1bd('0x5'));var client=jayson[_0xb1bd('0x6')][_0xb1bd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28a080,_0x204a85,_0x28161d){return new BPromise(function(_0x3f934f,_0xaf7b47){return client[_0xb1bd('0x8')](_0x28a080,_0x28161d)['then'](function(_0x232129){logger['info'](_0xb1bd('0x9'),_0x204a85,_0xb1bd('0xa'));logger['debug'](_0xb1bd('0xb'),_0x204a85,_0xb1bd('0xa'),JSON[_0xb1bd('0xc')](_0x232129));if(_0x232129['error']){if(_0x232129['error']['code']===0x1f4){logger[_0xb1bd('0xd')](_0xb1bd('0x9'),_0x204a85,_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);return _0xaf7b47(_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x204a85,_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);return _0x3f934f(_0x232129[_0xb1bd('0xd')][_0xb1bd('0xe')]);}else{logger[_0xb1bd('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x204a85,'request\x20sent');_0x3f934f(_0x232129[_0xb1bd('0x10')]['message']);}})[_0xb1bd('0x11')](function(_0x207406){logger[_0xb1bd('0xd')](_0xb1bd('0x9'),_0x204a85,_0x207406);_0xaf7b47(_0x207406);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 140e192..9c2c17b 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 _0xe072=['put','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','create'];(function(_0x53263b,_0x299c08){var _0x3fd94b=function(_0x489939){while(--_0x489939){_0x53263b['push'](_0x53263b['shift']());}};_0x3fd94b(++_0x299c08);}(_0xe072,0x17d));var _0x2e07=function(_0x36221a,_0x37c5b5){_0x36221a=_0x36221a-0x0;var _0x233141=_0xe072[_0x36221a];return _0x233141;};'use strict';var multer=require(_0x2e07('0x0'));var util=require('util');var path=require(_0x2e07('0x1'));var timeout=require(_0x2e07('0x2'));var express=require('express');var router=express[_0x2e07('0x3')]();var fs_extra=require(_0x2e07('0x4'));var auth=require(_0x2e07('0x5'));var interaction=require(_0x2e07('0x6'));var config=require('../../config/environment');var controller=require(_0x2e07('0x7'));router[_0x2e07('0x8')]('/',auth[_0x2e07('0x9')](),controller['index']);router[_0x2e07('0x8')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xb')]);router[_0x2e07('0x8')](_0x2e07('0xc'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xd')]);router[_0x2e07('0x8')](_0x2e07('0xe'),auth[_0x2e07('0x9')](),controller[_0x2e07('0xf')]);router[_0x2e07('0x8')](_0x2e07('0x10'),auth[_0x2e07('0x9')](),controller['query']);router['post']('/',auth[_0x2e07('0x9')](),controller[_0x2e07('0x11')]);router[_0x2e07('0x12')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller['update']);router[_0x2e07('0x13')](_0x2e07('0xa'),auth[_0x2e07('0x9')](),controller[_0x2e07('0x14')]);module['exports']=router; \ No newline at end of file +var _0xee5f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','exports','path'];(function(_0x3c99f5,_0x3c4b1a){var _0x3b958e=function(_0x18d09d){while(--_0x18d09d){_0x3c99f5['push'](_0x3c99f5['shift']());}};_0x3b958e(++_0x3c4b1a);}(_0xee5f,0x1c7));var _0xfee5=function(_0x238f7e,_0x4ecfc0){_0x238f7e=_0x238f7e-0x0;var _0x2244f6=_0xee5f[_0x238f7e];return _0x2244f6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfee5('0x0'));var timeout=require(_0xfee5('0x1'));var express=require('express');var router=express[_0xfee5('0x2')]();var fs_extra=require(_0xfee5('0x3'));var auth=require(_0xfee5('0x4'));var interaction=require(_0xfee5('0x5'));var config=require(_0xfee5('0x6'));var controller=require(_0xfee5('0x7'));router[_0xfee5('0x8')]('/',auth[_0xfee5('0x9')](),controller[_0xfee5('0xa')]);router[_0xfee5('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfee5('0x8')](_0xfee5('0xb'),auth[_0xfee5('0x9')](),controller[_0xfee5('0xc')]);router[_0xfee5('0x8')](_0xfee5('0xd'),auth[_0xfee5('0x9')](),controller[_0xfee5('0xe')]);router[_0xfee5('0x8')](_0xfee5('0xf'),auth['isAuthenticated'](),controller[_0xfee5('0x10')]);router[_0xfee5('0x11')]('/',auth[_0xfee5('0x9')](),controller[_0xfee5('0x12')]);router[_0xfee5('0x13')](_0xfee5('0x14'),auth[_0xfee5('0x9')](),controller[_0xfee5('0x15')]);router[_0xfee5('0x16')](_0xfee5('0x14'),auth[_0xfee5('0x9')](),controller['destroy']);module[_0xfee5('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 5c55fd9..aeb732c 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 _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x55e62b,_0x4f34ac){var _0xa7162f=function(_0x178227){while(--_0x178227){_0x55e62b['push'](_0x55e62b['shift']());}};_0xa7162f(++_0x4f34ac);}(_0x814b,0x1a2));var _0xb814=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x814b[_0x5c6022];return _0x4ab5af;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}}; \ No newline at end of file +var _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x5fd1,0x155));var _0x15fd=function(_0x1937bf,_0x50299c){_0x1937bf=_0x1937bf-0x0;var _0x5b4ec7=_0x5fd1[_0x1937bf];return _0x5b4ec7;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 50fd6a8..eb042a0 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x31c0e3,_0x3c5cd6){var _0xf34e31=function(_0x312d15){while(--_0x312d15){_0x31c0e3['push'](_0x31c0e3['shift']());}};_0xf34e31(++_0x3c5cd6);}(_0xba34,0x119));var _0x4ba3=function(_0x2106c4,_0x5a3042){_0x2106c4=_0x2106c4-0x0;var _0x287771=_0xba34[_0x2106c4];return _0x287771;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file +var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x26a515,_0x286339){var _0x314682=function(_0x501b51){while(--_0x501b51){_0x26a515['push'](_0x26a515['shift']());}};_0x314682(++_0x286339);}(_0xba34,0x119));var _0x4ba3=function(_0xa7519e,_0x5760c5){_0xa7519e=_0xa7519e-0x0;var _0xea20b9=_0xba34[_0xa7519e];return _0xea20b9;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index cbee07a..ca2b8c4 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 _0xa649=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x32a3c4,_0x1e7e25){var _0x24ddc2=function(_0x31ef94){while(--_0x31ef94){_0x32a3c4['push'](_0x32a3c4['shift']());}};_0x24ddc2(++_0x1e7e25);}(_0xa649,0x12c));var _0x9a64=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa649[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x9a64('0x0'));var util=require(_0x9a64('0x1'));var logger=require(_0x9a64('0x2'))(_0x9a64('0x3'));var moment=require(_0x9a64('0x4'));var BPromise=require(_0x9a64('0x5'));var rp=require(_0x9a64('0x6'));var fs=require('fs');var path=require(_0x9a64('0x7'));var rimraf=require(_0x9a64('0x8'));var config=require(_0x9a64('0x9'));var attributes=require(_0x9a64('0xa'));module[_0x9a64('0xb')]=function(_0x276dc0,_0x145014){return _0x276dc0[_0x9a64('0xc')]('AnalyticDefaultReport',attributes,{'tableName':_0x9a64('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78df=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x78df,0x1e4));var _0xf78d=function(_0x2af0d0,_0x415e1c){_0x2af0d0=_0x2af0d0-0x0;var _0x114c4a=_0x78df[_0x2af0d0];return _0x114c4a;};'use strict';var _=require(_0xf78d('0x0'));var util=require('util');var logger=require(_0xf78d('0x1'))(_0xf78d('0x2'));var moment=require('moment');var BPromise=require(_0xf78d('0x3'));var rp=require(_0xf78d('0x4'));var fs=require('fs');var path=require(_0xf78d('0x5'));var rimraf=require(_0xf78d('0x6'));var config=require(_0xf78d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0xf78d('0x8')]=function(_0x19b858,_0x3529b6){return _0x19b858[_0xf78d('0x9')](_0xf78d('0xa'),attributes,{'tableName':_0xf78d('0xb'),'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 34eb131..6293c37 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 _0x466f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis'];(function(_0x456bd2,_0x156c79){var _0x2218c1=function(_0x44f2d4){while(--_0x44f2d4){_0x456bd2['push'](_0x456bd2['shift']());}};_0x2218c1(++_0x156c79);}(_0x466f,0x9c));var _0xf466=function(_0x18ce99,_0x5ee120){_0x18ce99=_0x18ce99-0x0;var _0x243bfb=_0x466f[_0x18ce99];return _0x243bfb;};'use strict';var _=require('lodash');var util=require(_0xf466('0x0'));var moment=require('moment');var BPromise=require(_0xf466('0x1'));var rs=require(_0xf466('0x2'));var fs=require('fs');var Redis=require(_0xf466('0x3'));var db=require(_0xf466('0x4'))['db'];var utils=require(_0xf466('0x5'));var logger=require(_0xf466('0x6'))('rpc');var config=require(_0xf466('0x7'));var jayson=require(_0xf466('0x8'));var client=jayson[_0xf466('0x9')][_0xf466('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x392209,_0x3388b2,_0x52bb57){return new BPromise(function(_0x3a218d,_0x8cfd4f){return client['request'](_0x392209,_0x52bb57)[_0xf466('0xb')](function(_0x1c716b){logger[_0xf466('0xc')](_0xf466('0xd'),_0x3388b2,_0xf466('0xe'));logger['debug'](_0xf466('0xf'),_0x3388b2,_0xf466('0xe'),JSON['stringify'](_0x1c716b));if(_0x1c716b[_0xf466('0x10')]){if(_0x1c716b[_0xf466('0x10')][_0xf466('0x11')]===0x1f4){logger[_0xf466('0x10')](_0xf466('0xd'),_0x3388b2,_0x1c716b[_0xf466('0x10')]['message']);return _0x8cfd4f(_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);}logger[_0xf466('0x10')](_0xf466('0xd'),_0x3388b2,_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);return _0x3a218d(_0x1c716b[_0xf466('0x10')][_0xf466('0x12')]);}else{logger[_0xf466('0xc')](_0xf466('0xd'),_0x3388b2,_0xf466('0xe'));_0x3a218d(_0x1c716b['result'][_0xf466('0x12')]);}})[_0xf466('0x13')](function(_0x593762){logger['error'](_0xf466('0xd'),_0x3388b2,_0x593762);_0x8cfd4f(_0x593762);});});} \ No newline at end of file +var _0x8823=['../../config/logger','rpc','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x19fea3,_0x364f67){var _0xdb1fa4=function(_0x5e5c5e){while(--_0x5e5c5e){_0x19fea3['push'](_0x19fea3['shift']());}};_0xdb1fa4(++_0x364f67);}(_0x8823,0x117));var _0x3882=function(_0x1a2624,_0x5cf832){_0x1a2624=_0x1a2624-0x0;var _0x449318=_0x8823[_0x1a2624];return _0x449318;};'use strict';var _=require(_0x3882('0x0'));var util=require(_0x3882('0x1'));var moment=require('moment');var BPromise=require(_0x3882('0x2'));var rs=require(_0x3882('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3882('0x4'))['db'];var utils=require(_0x3882('0x5'));var logger=require(_0x3882('0x6'))(_0x3882('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3882('0x8')][_0x3882('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c26da,_0x9cd50c,_0x206d0c){return new BPromise(function(_0x34dd10,_0x12cb9b){return client[_0x3882('0xa')](_0x1c26da,_0x206d0c)['then'](function(_0x2f4b30){logger[_0x3882('0xb')](_0x3882('0xc'),_0x9cd50c,_0x3882('0xd'));logger['debug'](_0x3882('0xe'),_0x9cd50c,'request\x20sent',JSON[_0x3882('0xf')](_0x2f4b30));if(_0x2f4b30[_0x3882('0x10')]){if(_0x2f4b30[_0x3882('0x10')][_0x3882('0x11')]===0x1f4){logger[_0x3882('0x10')](_0x3882('0xc'),_0x9cd50c,_0x2f4b30[_0x3882('0x10')][_0x3882('0x12')]);return _0x12cb9b(_0x2f4b30[_0x3882('0x10')][_0x3882('0x12')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x9cd50c,_0x2f4b30['error'][_0x3882('0x12')]);return _0x34dd10(_0x2f4b30['error']['message']);}else{logger[_0x3882('0xb')](_0x3882('0xc'),_0x9cd50c,_0x3882('0xd'));_0x34dd10(_0x2f4b30['result']['message']);}})['catch'](function(_0x1e8634){logger[_0x3882('0x10')](_0x3882('0xc'),_0x9cd50c,_0x1e8634);_0x12cb9b(_0x1e8634);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index ab95296..5b8c8d8 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 _0x9a4e=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9a4e,0x1ba));var _0xe9a4=function(_0x4742d4,_0x43f49a){_0x4742d4=_0x4742d4-0x0;var _0xc2518f=_0x9a4e[_0x4742d4];return _0xc2518f;};'use strict';var multer=require(_0xe9a4('0x0'));var util=require(_0xe9a4('0x1'));var path=require(_0xe9a4('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9a4('0x3'));var router=express[_0xe9a4('0x4')]();var fs_extra=require(_0xe9a4('0x5'));var auth=require(_0xe9a4('0x6'));var interaction=require(_0xe9a4('0x7'));var config=require('../../config/environment');var controller=require(_0xe9a4('0x8'));router[_0xe9a4('0x9')]('/',auth[_0xe9a4('0xa')](),controller[_0xe9a4('0xb')]);router['get'](_0xe9a4('0xc'),auth['isAuthenticated'](),controller[_0xe9a4('0xd')]);router[_0xe9a4('0x9')](_0xe9a4('0xe'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0xf')]);router[_0xe9a4('0x9')](_0xe9a4('0x10'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x11')]);router[_0xe9a4('0x9')](_0xe9a4('0x12'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x13')]);router[_0xe9a4('0x14')]('/',auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x15')]);router[_0xe9a4('0x16')](_0xe9a4('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe9a4('0x17')](_0xe9a4('0xc'),auth[_0xe9a4('0xa')](),controller[_0xe9a4('0x18')]);module['exports']=router; \ No newline at end of file +var _0x3c71=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0xaf3811,_0x4042ff){var _0x1c6ce4=function(_0x313e54){while(--_0x313e54){_0xaf3811['push'](_0xaf3811['shift']());}};_0x1c6ce4(++_0x4042ff);}(_0x3c71,0x1db));var _0x13c7=function(_0x3372fa,_0x1a6c8c){_0x3372fa=_0x3372fa-0x0;var _0x1c1bc7=_0x3c71[_0x3372fa];return _0x1c1bc7;};'use strict';var multer=require(_0x13c7('0x0'));var util=require(_0x13c7('0x1'));var path=require(_0x13c7('0x2'));var timeout=require(_0x13c7('0x3'));var express=require('express');var router=express[_0x13c7('0x4')]();var fs_extra=require(_0x13c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x13c7('0x6'));var config=require(_0x13c7('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x13c7('0x8')]('/',auth[_0x13c7('0x9')](),controller[_0x13c7('0xa')]);router[_0x13c7('0x8')](_0x13c7('0xb'),auth[_0x13c7('0x9')](),controller[_0x13c7('0xc')]);router['get'](_0x13c7('0xd'),auth['isAuthenticated'](),controller[_0x13c7('0xe')]);router['get'](_0x13c7('0xf'),auth['isAuthenticated'](),controller[_0x13c7('0x10')]);router['get'](_0x13c7('0x11'),auth[_0x13c7('0x9')](),controller[_0x13c7('0x12')]);router[_0x13c7('0x13')]('/',auth[_0x13c7('0x9')](),controller[_0x13c7('0x14')]);router[_0x13c7('0x15')](_0x13c7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x13c7('0x16')](_0x13c7('0xb'),auth[_0x13c7('0x9')](),controller['destroy']);module[_0x13c7('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 6c2442a..0ef8d77 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 _0xb0b5=['manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xb0b5,0x12c));var _0x5b0b=function(_0x19cd29,_0x1ac3e7){_0x19cd29=_0x19cd29-0x0;var _0x27c96d=_0xb0b5[_0x19cd29];return _0x27c96d;};'use strict';var Sequelize=require(_0x5b0b('0x0'));var moment=require(_0x5b0b('0x1'));module[_0x5b0b('0x2')]={'name':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x5b0b('0x4')](_0x5b0b('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x5b0b('0x5')},'savename':{'type':Sequelize[_0x5b0b('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5b0b('0x6')]},'endDate':{'type':Sequelize[_0x5b0b('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x5b0b('0x7')},'type':{'type':Sequelize[_0x5b0b('0x4')](_0x5b0b('0x8'),_0x5b0b('0x9')),'allowNull':![],'defaultValue':_0x5b0b('0x8')},'reportId':{'type':Sequelize[_0x5b0b('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5b0b('0x3')]}}; \ No newline at end of file +var _0x016f=['moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x56c7f1,_0x13dd9a){var _0x3b7569=function(_0x1d81e8){while(--_0x1d81e8){_0x56c7f1['push'](_0x56c7f1['shift']());}};_0x3b7569(++_0x13dd9a);}(_0x016f,0x108));var _0xf016=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x016f[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf016('0x0'));module[_0xf016('0x1')]={'name':{'type':Sequelize[_0xf016('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf016('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf016('0x3')](_0xf016('0x4'),_0xf016('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xf016('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xf016('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xf016('0x7')},'type':{'type':Sequelize[_0xf016('0x3')](_0xf016('0x8'),_0xf016('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf016('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index fec83ca..7a64020 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 _0xc7ae=['Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','server/files/reports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc7ae,0x1f0));var _0xec7a=function(_0x286712,_0x6d9ea5){_0x286712=_0x286712-0x0;var _0x3a538c=_0xc7ae[_0x286712];return _0x3a538c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec7a('0x0'));var zipdir=require(_0xec7a('0x1'));var jsonpatch=require(_0xec7a('0x2'));var rp=require(_0xec7a('0x3'));var moment=require(_0xec7a('0x4'));var BPromise=require(_0xec7a('0x5'));var Mustache=require(_0xec7a('0x6'));var util=require(_0xec7a('0x7'));var path=require('path');var sox=require(_0xec7a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec7a('0x9'));var _=require(_0xec7a('0xa'));var squel=require(_0xec7a('0xb'));var crypto=require(_0xec7a('0xc'));var jsforce=require(_0xec7a('0xd'));var deskjs=require(_0xec7a('0xe'));var toCsv=require(_0xec7a('0xf'));var querystring=require(_0xec7a('0x10'));var Papa=require('papaparse');var Redis=require(_0xec7a('0x11'));var authService=require(_0xec7a('0x12'));var qs=require(_0xec7a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec7a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xec7a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec7a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dede9,_0x4f388d){_0x4f388d=_0x4f388d||0xcc;return function(_0x563922){if(_0x563922){return _0x4dede9['sendStatus'](_0x4f388d);}return _0x4dede9['status'](_0x4f388d)[_0xec7a('0x17')]();};}function respondWithResult(_0x196996,_0xd27f94){_0xd27f94=_0xd27f94||0xc8;return function(_0x4d06cc){if(_0x4d06cc){return _0x196996[_0xec7a('0x18')](_0xd27f94)[_0xec7a('0x19')](_0x4d06cc);}};}function respondWithFilteredResult(_0x17afbf,_0x3ecedc){return function(_0x25407e){if(_0x25407e){var _0x57dfd8=typeof _0x3ecedc[_0xec7a('0x1a')]==='undefined'&&typeof _0x3ecedc[_0xec7a('0x1b')]===_0xec7a('0x1c');var _0x4bc54e=_0x25407e[_0xec7a('0x1d')];var _0xfd3ad8=_0x57dfd8?0x0:_0x3ecedc[_0xec7a('0x1a')];var _0x4ce5a9=_0x57dfd8?_0x25407e[_0xec7a('0x1d')]:_0x3ecedc[_0xec7a('0x1a')]+_0x3ecedc[_0xec7a('0x1b')];var _0x21de0d;if(_0x4ce5a9>=_0x4bc54e){_0x4ce5a9=_0x4bc54e;_0x21de0d=0xc8;}else{_0x21de0d=0xce;}_0x17afbf['status'](_0x21de0d);return _0x17afbf[_0xec7a('0x1e')](_0xec7a('0x1f'),_0xfd3ad8+'-'+_0x4ce5a9+'/'+_0x4bc54e)[_0xec7a('0x19')](_0x25407e);}return null;};}function patchUpdates(_0x1683b9){return function(_0x2d44e0){try{jsonpatch[_0xec7a('0x20')](_0x2d44e0,_0x1683b9,!![]);}catch(_0x2e4d71){return BPromise[_0xec7a('0x21')](_0x2e4d71);}return _0x2d44e0[_0xec7a('0x22')]();};}function saveUpdates(_0x4d9e9a,_0x5736b5){return function(_0x31daeb){if(_0x31daeb){return _0x31daeb[_0xec7a('0x23')](_0x4d9e9a)[_0xec7a('0x24')](function(_0x59b441){return _0x59b441;});}return null;};}function removeEntity(_0x3be193,_0x4075fb){return function(_0x21bdbc){if(_0x21bdbc){return _0x21bdbc[_0xec7a('0x25')]()[_0xec7a('0x24')](function(){var _0x301018=_0x21bdbc[_0xec7a('0x26')]({'plain':!![]});var _0xab9ec7=_0xec7a('0x27');return db[_0xec7a('0x28')]['destroy']({'where':{'type':_0xab9ec7,'resourceId':_0x301018['id']}})[_0xec7a('0x24')](function(){return _0x21bdbc;});})[_0xec7a('0x24')](function(){_0x3be193[_0xec7a('0x18')](0xcc)[_0xec7a('0x17')]();});}};}function handleEntityNotFound(_0x22e983,_0x3f4ad4){return function(_0x362a61){if(!_0x362a61){_0x22e983[_0xec7a('0x29')](0x194);}return _0x362a61;};}function handleError(_0x227bef,_0x466340){_0x466340=_0x466340||0x1f4;return function(_0x384902){logger[_0xec7a('0x2a')](_0x384902[_0xec7a('0x2b')]);if(_0x384902[_0xec7a('0x2c')]){delete _0x384902[_0xec7a('0x2c')];}_0x227bef[_0xec7a('0x18')](_0x466340)[_0xec7a('0x2d')](_0x384902);};}exports[_0xec7a('0x2e')]=function(_0x656855,_0x246c6f){var _0x112e44={},_0x3979fa={},_0x3f6bca={'count':0x0,'rows':[]};var _0x55a5c2=_[_0xec7a('0x2f')](db[_0xec7a('0x30')][_0xec7a('0x31')],function(_0x11a57d){return{'name':_0x11a57d[_0xec7a('0x32')],'type':_0x11a57d[_0xec7a('0x33')][_0xec7a('0x34')]};});_0x3979fa['model']=_[_0xec7a('0x2f')](_0x55a5c2,_0xec7a('0x2c'));_0x3979fa[_0xec7a('0x35')]=_[_0xec7a('0x36')](_0x656855[_0xec7a('0x35')]);_0x3979fa[_0xec7a('0x37')]=_[_0xec7a('0x38')](_0x3979fa[_0xec7a('0x39')],_0x3979fa['query']);_0x112e44[_0xec7a('0x3a')]=_[_0xec7a('0x38')](_0x3979fa[_0xec7a('0x39')],qs[_0xec7a('0x3b')](_0x656855[_0xec7a('0x35')][_0xec7a('0x3b')]));_0x112e44['attributes']=_0x112e44[_0xec7a('0x3a')][_0xec7a('0x3c')]?_0x112e44[_0xec7a('0x3a')]:_0x3979fa[_0xec7a('0x39')];if(!_0x656855[_0xec7a('0x35')][_0xec7a('0x3d')](_0xec7a('0x3e'))){_0x112e44[_0xec7a('0x1b')]=qs[_0xec7a('0x1b')](_0x656855[_0xec7a('0x35')][_0xec7a('0x1b')]);_0x112e44[_0xec7a('0x1a')]=qs[_0xec7a('0x1a')](_0x656855[_0xec7a('0x35')]['offset']);}_0x112e44[_0xec7a('0x3f')]=qs[_0xec7a('0x40')](_0x656855['query'][_0xec7a('0x40')]);_0x112e44[_0xec7a('0x41')]=qs[_0xec7a('0x37')](_['pick'](_0x656855[_0xec7a('0x35')],_0x3979fa[_0xec7a('0x37')]),_0x55a5c2);if(_0x656855[_0xec7a('0x35')][_0xec7a('0x42')]){_0x112e44['where']=_[_0xec7a('0x43')](_0x112e44['where'],{'$or':_['map'](_0x55a5c2,function(_0x695bc2){if(_0x695bc2[_0xec7a('0x33')]!==_0xec7a('0x44')){var _0x597ac9={};_0x597ac9[_0x695bc2[_0xec7a('0x2c')]]={'$like':'%'+_0x656855[_0xec7a('0x35')][_0xec7a('0x42')]+'%'};return _0x597ac9;}})});}_0x112e44=_[_0xec7a('0x43')]({},_0x112e44,_0x656855[_0xec7a('0x45')]);var _0x42763a={'where':_0x112e44['where']};return db[_0xec7a('0x30')][_0xec7a('0x1d')](_0x42763a)[_0xec7a('0x24')](function(_0x576cda){_0x3f6bca[_0xec7a('0x1d')]=_0x576cda;if(_0x656855[_0xec7a('0x35')][_0xec7a('0x46')]){_0x112e44[_0xec7a('0x47')]=[{'all':!![]}];}return db[_0xec7a('0x30')][_0xec7a('0x48')](_0x112e44);})[_0xec7a('0x24')](function(_0x4f1f2e){_0x3f6bca[_0xec7a('0x49')]=_0x4f1f2e;return _0x3f6bca;})[_0xec7a('0x24')](respondWithFilteredResult(_0x246c6f,_0x112e44))[_0xec7a('0x4a')](handleError(_0x246c6f,null));};exports['show']=function(_0xbcf6e9,_0x7d293d){var _0x56beec={'raw':!![],'where':{'id':_0xbcf6e9[_0xec7a('0x4b')]['id']}},_0x1566da={};_0x1566da[_0xec7a('0x39')]=_[_0xec7a('0x36')](db[_0xec7a('0x30')]['rawAttributes']);_0x1566da[_0xec7a('0x35')]=_[_0xec7a('0x36')](_0xbcf6e9[_0xec7a('0x35')]);_0x1566da['filters']=_[_0xec7a('0x38')](_0x1566da['model'],_0x1566da['query']);_0x56beec[_0xec7a('0x3a')]=_[_0xec7a('0x38')](_0x1566da[_0xec7a('0x39')],qs['fields'](_0xbcf6e9[_0xec7a('0x35')]['fields']));_0x56beec[_0xec7a('0x3a')]=_0x56beec[_0xec7a('0x3a')]['length']?_0x56beec[_0xec7a('0x3a')]:_0x1566da['model'];if(_0xbcf6e9[_0xec7a('0x35')]['includeAll']){_0x56beec['include']=[{'all':!![]}];}_0x56beec=_[_0xec7a('0x43')]({},_0x56beec,_0xbcf6e9[_0xec7a('0x45')]);return db['AnalyticExtractedReport'][_0xec7a('0x4c')](_0x56beec)['then'](handleEntityNotFound(_0x7d293d,null))['then'](respondWithResult(_0x7d293d,null))[_0xec7a('0x4a')](handleError(_0x7d293d,null));};exports[_0xec7a('0x4d')]=function(_0x5510d8,_0x2fe136){return db[_0xec7a('0x30')][_0xec7a('0x4d')](_0x5510d8[_0xec7a('0x4e')],{})['then'](function(_0x181766){var _0x56e3b6=_0x5510d8[_0xec7a('0x4f')][_0xec7a('0x26')]({'plain':!![]});if(!_0x56e3b6)throw new Error(_0xec7a('0x50'));if(_0x56e3b6[_0xec7a('0x51')]===_0xec7a('0x4f')){var _0x53fcee=_0x181766[_0xec7a('0x26')]({'plain':!![]});var _0x5a6c01=_0xec7a('0x27');return db[_0xec7a('0x52')][_0xec7a('0x4c')]({'where':{'name':_0x5a6c01,'userProfileId':_0x56e3b6[_0xec7a('0x53')]},'raw':!![]})[_0xec7a('0x24')](function(_0x43eae2){if(_0x43eae2&&_0x43eae2[_0xec7a('0x54')]===0x0){return db[_0xec7a('0x28')]['create']({'name':_0x53fcee[_0xec7a('0x2c')],'resourceId':_0x53fcee['id'],'type':_0x43eae2['name'],'sectionId':_0x43eae2['id']},{})[_0xec7a('0x24')](function(){return _0x181766;});}else{return _0x181766;}})[_0xec7a('0x4a')](function(_0x4dd79d){logger[_0xec7a('0x2a')](_0xec7a('0x55'),_0x4dd79d);throw _0x4dd79d;});}return _0x181766;})['then'](respondWithResult(_0x2fe136,0xc9))[_0xec7a('0x4a')](handleError(_0x2fe136,null));};exports[_0xec7a('0x23')]=function(_0x30b559,_0x48c88a){if(_0x30b559[_0xec7a('0x4e')]['id']){delete _0x30b559['body']['id'];}return db[_0xec7a('0x30')][_0xec7a('0x4c')]({'where':{'id':_0x30b559[_0xec7a('0x4b')]['id']}})[_0xec7a('0x24')](handleEntityNotFound(_0x48c88a,null))[_0xec7a('0x24')](saveUpdates(_0x30b559[_0xec7a('0x4e')],null))[_0xec7a('0x24')](respondWithResult(_0x48c88a,null))['catch'](handleError(_0x48c88a,null));};exports[_0xec7a('0x25')]=function(_0x1deadb,_0x5c64ea){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1deadb[_0xec7a('0x4b')]['id']}})[_0xec7a('0x24')](handleEntityNotFound(_0x5c64ea,null))[_0xec7a('0x24')](removeEntity(_0x5c64ea,null))['catch'](handleError(_0x5c64ea,null));};exports['download']=function(_0x288872,_0x27022d,_0x229d3e){return db[_0xec7a('0x30')][_0xec7a('0x4c')]({'where':{'id':_0x288872['params']['id']},'attributes':[_0xec7a('0x2c'),_0xec7a('0x56'),_0xec7a('0x57'),_0xec7a('0x58')],'raw':!![]})[_0xec7a('0x24')](handleEntityNotFound(_0x27022d,null))[_0xec7a('0x24')](function(_0x5d6277){if(_0x5d6277){if(!fs[_0xec7a('0x59')](path[_0xec7a('0x5a')](config['root'],_0xec7a('0x5b'),_0x5d6277[_0xec7a('0x57')]))){throw new db[(_0xec7a('0x5c'))][(_0xec7a('0x5d'))](_0xec7a('0x5e'));}if(_0x288872[_0xec7a('0x35')][_0xec7a('0x5f')]){return _0x27022d['sendStatus'](0xc8);}return _0x27022d[_0xec7a('0x60')](path['join'](config['root'],_0xec7a('0x5b'),_0x5d6277[_0xec7a('0x57')]),util['format']('%s.%s',_0x5d6277[_0xec7a('0x56')]||_0x5d6277[_0xec7a('0x2c')],_0x5d6277[_0xec7a('0x58')][_0xec7a('0x61')]()));}})[_0xec7a('0x4a')](handleError(_0x27022d,null));}; \ No newline at end of file +var _0x9f5a=['request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','toLowerCase','rimraf','zip-dir'];(function(_0xdf152f,_0x1c6343){var _0x7f0dc1=function(_0x13dbd5){while(--_0x13dbd5){_0xdf152f['push'](_0xdf152f['shift']());}};_0x7f0dc1(++_0x1c6343);}(_0x9f5a,0x11b));var _0xa9f5=function(_0x493465,_0x52b487){_0x493465=_0x493465-0x0;var _0x52aefb=_0x9f5a[_0x493465];return _0x52aefb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9f5('0x0'));var zipdir=require(_0xa9f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa9f5('0x2'));var moment=require(_0xa9f5('0x3'));var BPromise=require(_0xa9f5('0x4'));var Mustache=require('mustache');var util=require(_0xa9f5('0x5'));var path=require('path');var sox=require(_0xa9f5('0x6'));var csv=require(_0xa9f5('0x7'));var ejs=require(_0xa9f5('0x8'));var fs=require('fs');var fs_extra=require(_0xa9f5('0x9'));var _=require(_0xa9f5('0xa'));var squel=require(_0xa9f5('0xb'));var crypto=require(_0xa9f5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa9f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa9f5('0xe'));var Papa=require(_0xa9f5('0xf'));var Redis=require(_0xa9f5('0x10'));var authService=require(_0xa9f5('0x11'));var qs=require(_0xa9f5('0x12'));var as=require(_0xa9f5('0x13'));var hardwareService=require(_0xa9f5('0x14'));var logger=require(_0xa9f5('0x15'))(_0xa9f5('0x16'));var utils=require('../../config/utils');var config=require(_0xa9f5('0x17'));var licenseUtil=require(_0xa9f5('0x18'));var db=require(_0xa9f5('0x19'))['db'];function respondWithStatusCode(_0x3451af,_0x51a461){_0x51a461=_0x51a461||0xcc;return function(_0x119fe4){if(_0x119fe4){return _0x3451af[_0xa9f5('0x1a')](_0x51a461);}return _0x3451af[_0xa9f5('0x1b')](_0x51a461)[_0xa9f5('0x1c')]();};}function respondWithResult(_0x27ad20,_0x438a29){_0x438a29=_0x438a29||0xc8;return function(_0x232452){if(_0x232452){return _0x27ad20[_0xa9f5('0x1b')](_0x438a29)[_0xa9f5('0x1d')](_0x232452);}};}function respondWithFilteredResult(_0x2a4b8d,_0x32b579){return function(_0x634f2c){if(_0x634f2c){var _0x36296c=typeof _0x32b579['offset']===_0xa9f5('0x1e')&&typeof _0x32b579[_0xa9f5('0x1f')]==='undefined';var _0x4d038e=_0x634f2c['count'];var _0x4eb272=_0x36296c?0x0:_0x32b579[_0xa9f5('0x20')];var _0x450458=_0x36296c?_0x634f2c['count']:_0x32b579['offset']+_0x32b579[_0xa9f5('0x1f')];var _0x180568;if(_0x450458>=_0x4d038e){_0x450458=_0x4d038e;_0x180568=0xc8;}else{_0x180568=0xce;}_0x2a4b8d[_0xa9f5('0x1b')](_0x180568);return _0x2a4b8d['set'](_0xa9f5('0x21'),_0x4eb272+'-'+_0x450458+'/'+_0x4d038e)[_0xa9f5('0x1d')](_0x634f2c);}return null;};}function patchUpdates(_0x15d5dd){return function(_0x2aecb8){try{jsonpatch[_0xa9f5('0x22')](_0x2aecb8,_0x15d5dd,!![]);}catch(_0x14e054){return BPromise[_0xa9f5('0x23')](_0x14e054);}return _0x2aecb8[_0xa9f5('0x24')]();};}function saveUpdates(_0x2f4b5d,_0x5b8ea7){return function(_0x2251f8){if(_0x2251f8){return _0x2251f8[_0xa9f5('0x25')](_0x2f4b5d)[_0xa9f5('0x26')](function(_0x356515){return _0x356515;});}return null;};}function removeEntity(_0xe8cbc9,_0xd53bb9){return function(_0x907bbe){if(_0x907bbe){return _0x907bbe[_0xa9f5('0x27')]()['then'](function(){var _0xacf515=_0x907bbe[_0xa9f5('0x28')]({'plain':!![]});var _0x4ba02e=_0xa9f5('0x29');return db[_0xa9f5('0x2a')]['destroy']({'where':{'type':_0x4ba02e,'resourceId':_0xacf515['id']}})[_0xa9f5('0x26')](function(){return _0x907bbe;});})[_0xa9f5('0x26')](function(){_0xe8cbc9['status'](0xcc)[_0xa9f5('0x1c')]();});}};}function handleEntityNotFound(_0x45ad07,_0x12bccf){return function(_0x783fe7){if(!_0x783fe7){_0x45ad07[_0xa9f5('0x1a')](0x194);}return _0x783fe7;};}function handleError(_0x5c8098,_0x37b9e1){_0x37b9e1=_0x37b9e1||0x1f4;return function(_0x4da190){logger[_0xa9f5('0x2b')](_0x4da190[_0xa9f5('0x2c')]);if(_0x4da190[_0xa9f5('0x2d')]){delete _0x4da190[_0xa9f5('0x2d')];}_0x5c8098[_0xa9f5('0x1b')](_0x37b9e1)['send'](_0x4da190);};}exports[_0xa9f5('0x2e')]=function(_0x4a8074,_0x49b743){var _0x458b6e={},_0x37375d={},_0x1b5839={'count':0x0,'rows':[]};var _0x4e720e=_[_0xa9f5('0x2f')](db[_0xa9f5('0x30')][_0xa9f5('0x31')],function(_0x2ea5a0){return{'name':_0x2ea5a0[_0xa9f5('0x32')],'type':_0x2ea5a0['type'][_0xa9f5('0x33')]};});_0x37375d[_0xa9f5('0x34')]=_[_0xa9f5('0x2f')](_0x4e720e,_0xa9f5('0x2d'));_0x37375d[_0xa9f5('0x35')]=_[_0xa9f5('0x36')](_0x4a8074[_0xa9f5('0x35')]);_0x37375d['filters']=_[_0xa9f5('0x37')](_0x37375d['model'],_0x37375d[_0xa9f5('0x35')]);_0x458b6e['attributes']=_[_0xa9f5('0x37')](_0x37375d[_0xa9f5('0x34')],qs[_0xa9f5('0x38')](_0x4a8074[_0xa9f5('0x35')]['fields']));_0x458b6e[_0xa9f5('0x39')]=_0x458b6e['attributes'][_0xa9f5('0x3a')]?_0x458b6e[_0xa9f5('0x39')]:_0x37375d[_0xa9f5('0x34')];if(!_0x4a8074['query'][_0xa9f5('0x3b')](_0xa9f5('0x3c'))){_0x458b6e[_0xa9f5('0x1f')]=qs['limit'](_0x4a8074[_0xa9f5('0x35')][_0xa9f5('0x1f')]);_0x458b6e['offset']=qs[_0xa9f5('0x20')](_0x4a8074[_0xa9f5('0x35')][_0xa9f5('0x20')]);}_0x458b6e['order']=qs[_0xa9f5('0x3d')](_0x4a8074['query'][_0xa9f5('0x3d')]);_0x458b6e[_0xa9f5('0x3e')]=qs[_0xa9f5('0x3f')](_[_0xa9f5('0x40')](_0x4a8074['query'],_0x37375d[_0xa9f5('0x3f')]),_0x4e720e);if(_0x4a8074[_0xa9f5('0x35')]['filter']){_0x458b6e[_0xa9f5('0x3e')]=_[_0xa9f5('0x41')](_0x458b6e[_0xa9f5('0x3e')],{'$or':_[_0xa9f5('0x2f')](_0x4e720e,function(_0x378205){if(_0x378205[_0xa9f5('0x42')]!==_0xa9f5('0x43')){var _0x200372={};_0x200372[_0x378205[_0xa9f5('0x2d')]]={'$like':'%'+_0x4a8074['query']['filter']+'%'};return _0x200372;}})});}_0x458b6e=_['merge']({},_0x458b6e,_0x4a8074['options']);var _0x69479f={'where':_0x458b6e[_0xa9f5('0x3e')]};return db[_0xa9f5('0x30')][_0xa9f5('0x44')](_0x69479f)[_0xa9f5('0x26')](function(_0x2dcd81){_0x1b5839['count']=_0x2dcd81;if(_0x4a8074['query'][_0xa9f5('0x45')]){_0x458b6e[_0xa9f5('0x46')]=[{'all':!![]}];}return db[_0xa9f5('0x30')][_0xa9f5('0x47')](_0x458b6e);})[_0xa9f5('0x26')](function(_0x31da34){_0x1b5839[_0xa9f5('0x48')]=_0x31da34;return _0x1b5839;})[_0xa9f5('0x26')](respondWithFilteredResult(_0x49b743,_0x458b6e))[_0xa9f5('0x49')](handleError(_0x49b743,null));};exports['show']=function(_0x15fd7c,_0x2dbf38){var _0x22b942={'raw':!![],'where':{'id':_0x15fd7c[_0xa9f5('0x4a')]['id']}},_0x36cffb={};_0x36cffb[_0xa9f5('0x34')]=_['keys'](db[_0xa9f5('0x30')][_0xa9f5('0x31')]);_0x36cffb[_0xa9f5('0x35')]=_[_0xa9f5('0x36')](_0x15fd7c['query']);_0x36cffb[_0xa9f5('0x3f')]=_[_0xa9f5('0x37')](_0x36cffb[_0xa9f5('0x34')],_0x36cffb[_0xa9f5('0x35')]);_0x22b942[_0xa9f5('0x39')]=_[_0xa9f5('0x37')](_0x36cffb[_0xa9f5('0x34')],qs[_0xa9f5('0x38')](_0x15fd7c[_0xa9f5('0x35')][_0xa9f5('0x38')]));_0x22b942[_0xa9f5('0x39')]=_0x22b942['attributes'][_0xa9f5('0x3a')]?_0x22b942[_0xa9f5('0x39')]:_0x36cffb[_0xa9f5('0x34')];if(_0x15fd7c[_0xa9f5('0x35')][_0xa9f5('0x45')]){_0x22b942['include']=[{'all':!![]}];}_0x22b942=_['merge']({},_0x22b942,_0x15fd7c['options']);return db[_0xa9f5('0x30')][_0xa9f5('0x4b')](_0x22b942)[_0xa9f5('0x26')](handleEntityNotFound(_0x2dbf38,null))['then'](respondWithResult(_0x2dbf38,null))[_0xa9f5('0x49')](handleError(_0x2dbf38,null));};exports[_0xa9f5('0x4c')]=function(_0x2adba1,_0x19b9f7){return db[_0xa9f5('0x30')][_0xa9f5('0x4c')](_0x2adba1[_0xa9f5('0x4d')],{})[_0xa9f5('0x26')](function(_0x584587){var _0x1551dc=_0x2adba1[_0xa9f5('0x4e')][_0xa9f5('0x28')]({'plain':!![]});if(!_0x1551dc)throw new Error(_0xa9f5('0x4f'));if(_0x1551dc['role']==='user'){var _0x2e6d49=_0x584587[_0xa9f5('0x28')]({'plain':!![]});var _0x4f76f6=_0xa9f5('0x29');return db['UserProfileSection'][_0xa9f5('0x4b')]({'where':{'name':_0x4f76f6,'userProfileId':_0x1551dc[_0xa9f5('0x50')]},'raw':!![]})[_0xa9f5('0x26')](function(_0x289a90){if(_0x289a90&&_0x289a90[_0xa9f5('0x51')]===0x0){return db[_0xa9f5('0x2a')][_0xa9f5('0x4c')]({'name':_0x2e6d49[_0xa9f5('0x2d')],'resourceId':_0x2e6d49['id'],'type':_0x289a90[_0xa9f5('0x2d')],'sectionId':_0x289a90['id']},{})['then'](function(){return _0x584587;});}else{return _0x584587;}})[_0xa9f5('0x49')](function(_0x5e1cb7){logger[_0xa9f5('0x2b')](_0xa9f5('0x52'),_0x5e1cb7);throw _0x5e1cb7;});}return _0x584587;})['then'](respondWithResult(_0x19b9f7,0xc9))['catch'](handleError(_0x19b9f7,null));};exports[_0xa9f5('0x25')]=function(_0x4c4a15,_0x56aebb){if(_0x4c4a15[_0xa9f5('0x4d')]['id']){delete _0x4c4a15[_0xa9f5('0x4d')]['id'];}return db[_0xa9f5('0x30')]['find']({'where':{'id':_0x4c4a15['params']['id']}})[_0xa9f5('0x26')](handleEntityNotFound(_0x56aebb,null))['then'](saveUpdates(_0x4c4a15[_0xa9f5('0x4d')],null))[_0xa9f5('0x26')](respondWithResult(_0x56aebb,null))[_0xa9f5('0x49')](handleError(_0x56aebb,null));};exports[_0xa9f5('0x27')]=function(_0x36d5ea,_0x3bf069){return db[_0xa9f5('0x30')]['find']({'where':{'id':_0x36d5ea[_0xa9f5('0x4a')]['id']}})[_0xa9f5('0x26')](handleEntityNotFound(_0x3bf069,null))[_0xa9f5('0x26')](removeEntity(_0x3bf069,null))[_0xa9f5('0x49')](handleError(_0x3bf069,null));};exports[_0xa9f5('0x53')]=function(_0x14c682,_0x589e24,_0x19b964){return db[_0xa9f5('0x30')][_0xa9f5('0x4b')]({'where':{'id':_0x14c682[_0xa9f5('0x4a')]['id']},'attributes':[_0xa9f5('0x2d'),_0xa9f5('0x54'),'savename',_0xa9f5('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x589e24,null))['then'](function(_0x1dd6b2){if(_0x1dd6b2){if(!fs[_0xa9f5('0x56')](path[_0xa9f5('0x57')](config[_0xa9f5('0x58')],'server/files/reports',_0x1dd6b2['savename']))){throw new db['Sequelize'][(_0xa9f5('0x59'))](_0xa9f5('0x5a'));}if(_0x14c682[_0xa9f5('0x35')][_0xa9f5('0x5b')]){return _0x589e24['sendStatus'](0xc8);}return _0x589e24[_0xa9f5('0x53')](path[_0xa9f5('0x57')](config[_0xa9f5('0x58')],_0xa9f5('0x5c'),_0x1dd6b2['savename']),util[_0xa9f5('0x5d')]('%s.%s',_0x1dd6b2[_0xa9f5('0x54')]||_0x1dd6b2[_0xa9f5('0x2d')],_0x1dd6b2[_0xa9f5('0x55')][_0xa9f5('0x5e')]()));}})[_0xa9f5('0x49')](handleError(_0x589e24,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b883fcb..117c586 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 _0xe535=['rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','bluebird','path'];(function(_0x5b83a2,_0x23c6b9){var _0x3e1bb1=function(_0x2762a7){while(--_0x2762a7){_0x5b83a2['push'](_0x5b83a2['shift']());}};_0x3e1bb1(++_0x23c6b9);}(_0xe535,0x1a8));var _0x5e53=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xe535[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x5e53('0x0'));var util=require('util');var logger=require(_0x5e53('0x1'))('api');var moment=require(_0x5e53('0x2'));var BPromise=require(_0x5e53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e53('0x4'));var rimraf=require(_0x5e53('0x5'));var config=require(_0x5e53('0x6'));var attributes=require(_0x5e53('0x7'));module['exports']=function(_0x39672b,_0x12deda){return _0x39672b[_0x5e53('0x8')](_0x5e53('0x9'),attributes,{'tableName':_0x5e53('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4300=['analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4300,0xa9));var _0x0430=function(_0x35af9b,_0x4caccb){_0x35af9b=_0x35af9b-0x0;var _0x3e5f32=_0x4300[_0x35af9b];return _0x3e5f32;};'use strict';var _=require('lodash');var util=require(_0x0430('0x0'));var logger=require(_0x0430('0x1'))(_0x0430('0x2'));var moment=require('moment');var BPromise=require(_0x0430('0x3'));var rp=require(_0x0430('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0430('0x5'));var config=require(_0x0430('0x6'));var attributes=require(_0x0430('0x7'));module[_0x0430('0x8')]=function(_0x556d49,_0x2b29ed){return _0x556d49[_0x0430('0x9')](_0x0430('0xa'),attributes,{'tableName':_0x0430('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 0ab35eb..62a54ee 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 _0xfc73=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','request\x20sent','debug','stringify','code','error','AnalyticExtractedReport,\x20%s,\x20%s','message'];(function(_0x70f557,_0x50e9ce){var _0x4e840b=function(_0x4d9f52){while(--_0x4d9f52){_0x70f557['push'](_0x70f557['shift']());}};_0x4e840b(++_0x50e9ce);}(_0xfc73,0x190));var _0x3fc7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfc73[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var moment=require(_0x3fc7('0x2'));var BPromise=require(_0x3fc7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc7('0x4'));var db=require(_0x3fc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3fc7('0x6'));var config=require(_0x3fc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3fc7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16a843,_0x595f79,_0x3068db){return new BPromise(function(_0x57f2b5,_0x1c4cab){return client[_0x3fc7('0x9')](_0x16a843,_0x3068db)['then'](function(_0x257b44){logger[_0x3fc7('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));logger[_0x3fc7('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x595f79,'request\x20sent',JSON[_0x3fc7('0xd')](_0x257b44));if(_0x257b44['error']){if(_0x257b44['error'][_0x3fc7('0xe')]===0x1f4){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x257b44[_0x3fc7('0xf')]['message']);return _0x1c4cab(_0x257b44[_0x3fc7('0xf')][_0x3fc7('0x11')]);}logger[_0x3fc7('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x257b44['error']['message']);return _0x57f2b5(_0x257b44['error']['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));_0x57f2b5(_0x257b44['result']['message']);}})[_0x3fc7('0x12')](function(_0x989094){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x989094);_0x1c4cab(_0x989094);});});} \ No newline at end of file +var _0xf2a2=['client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4afc06,_0x47a48c){var _0x1fa407=function(_0x224f85){while(--_0x224f85){_0x4afc06['push'](_0x4afc06['shift']());}};_0x1fa407(++_0x47a48c);}(_0xf2a2,0x1d7));var _0x2f2a=function(_0x2ba0b0,_0x4e81fa){_0x2ba0b0=_0x2ba0b0-0x0;var _0x563593=_0xf2a2[_0x2ba0b0];return _0x563593;};'use strict';var _=require(_0x2f2a('0x0'));var util=require('util');var moment=require(_0x2f2a('0x1'));var BPromise=require(_0x2f2a('0x2'));var rs=require(_0x2f2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f2a('0x4'))['db'];var utils=require(_0x2f2a('0x5'));var logger=require(_0x2f2a('0x6'))(_0x2f2a('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f2a('0x8'));var client=jayson[_0x2f2a('0x9')][_0x2f2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17adea,_0x506990,_0x53f615){return new BPromise(function(_0x48420b,_0x3d744d){return client[_0x2f2a('0xb')](_0x17adea,_0x53f615)[_0x2f2a('0xc')](function(_0x4209e0){logger[_0x2f2a('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x506990,_0x2f2a('0xe'));logger[_0x2f2a('0xf')](_0x2f2a('0x10'),_0x506990,_0x2f2a('0xe'),JSON[_0x2f2a('0x11')](_0x4209e0));if(_0x4209e0[_0x2f2a('0x12')]){if(_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x13')]===0x1f4){logger['error'](_0x2f2a('0x14'),_0x506990,_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x15')]);return _0x3d744d(_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x15')]);}logger[_0x2f2a('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x506990,_0x4209e0[_0x2f2a('0x12')]['message']);return _0x48420b(_0x4209e0[_0x2f2a('0x12')][_0x2f2a('0x15')]);}else{logger[_0x2f2a('0xd')](_0x2f2a('0x14'),_0x506990,'request\x20sent');_0x48420b(_0x4209e0[_0x2f2a('0x16')]['message']);}})[_0x2f2a('0x17')](function(_0x5bf432){logger['error'](_0x2f2a('0x14'),_0x506990,_0x5bf432);_0x3d744d(_0x5bf432);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 14cd990..aebb36e 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 _0x1377=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','show','/:id/download','download','post','create','put'];(function(_0xb36a0c,_0x73a4de){var _0x33f2ab=function(_0x5d375f){while(--_0x5d375f){_0xb36a0c['push'](_0xb36a0c['shift']());}};_0x33f2ab(++_0x73a4de);}(_0x1377,0x146));var _0x7137=function(_0x4ff480,_0x5c99ce){_0x4ff480=_0x4ff480-0x0;var _0x4836a6=_0x1377[_0x4ff480];return _0x4836a6;};'use strict';var multer=require(_0x7137('0x0'));var util=require(_0x7137('0x1'));var path=require(_0x7137('0x2'));var timeout=require(_0x7137('0x3'));var express=require(_0x7137('0x4'));var router=express[_0x7137('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7137('0x6'));var interaction=require(_0x7137('0x7'));var config=require(_0x7137('0x8'));var controller=require(_0x7137('0x9'));router['get']('/',auth[_0x7137('0xa')](),controller[_0x7137('0xb')]);router[_0x7137('0xc')]('/:id',auth[_0x7137('0xa')](),controller[_0x7137('0xd')]);router[_0x7137('0xc')](_0x7137('0xe'),auth[_0x7137('0xa')](),controller[_0x7137('0xf')]);router[_0x7137('0x10')]('/',auth[_0x7137('0xa')](),controller[_0x7137('0x11')]);router[_0x7137('0x12')](_0x7137('0x13'),auth[_0x7137('0xa')](),controller[_0x7137('0x14')]);router['delete'](_0x7137('0x13'),auth[_0x7137('0xa')](),controller[_0x7137('0x15')]);module[_0x7137('0x16')]=router; \ No newline at end of file +var _0xcaf1=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','create','update','delete','destroy'];(function(_0x32f850,_0x6ba444){var _0x38e424=function(_0x14e281){while(--_0x14e281){_0x32f850['push'](_0x32f850['shift']());}};_0x38e424(++_0x6ba444);}(_0xcaf1,0xe5));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x1caf('0x0'));var path=require(_0x1caf('0x1'));var timeout=require(_0x1caf('0x2'));var express=require(_0x1caf('0x3'));var router=express[_0x1caf('0x4')]();var fs_extra=require(_0x1caf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1caf('0x6'));var config=require(_0x1caf('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x1caf('0x8')]('/',auth[_0x1caf('0x9')](),controller[_0x1caf('0xa')]);router[_0x1caf('0x8')](_0x1caf('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1caf('0x8')](_0x1caf('0xc'),auth['isAuthenticated'](),controller[_0x1caf('0xd')]);router['post']('/',auth[_0x1caf('0x9')](),controller[_0x1caf('0xe')]);router['put'](_0x1caf('0xb'),auth[_0x1caf('0x9')](),controller[_0x1caf('0xf')]);router[_0x1caf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1caf('0x11')]);module[_0x1caf('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 1599703..acc2c9c 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 _0x16ab=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x592a1c,_0x4f773e){var _0x27a3bb=function(_0x6bcfff){while(--_0x6bcfff){_0x592a1c['push'](_0x592a1c['shift']());}};_0x27a3bb(++_0x4f773e);}(_0x16ab,0x1a6));var _0xb16a=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x16ab[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0xb16a('0x0'));module[_0xb16a('0x1')]={'field':{'type':Sequelize[_0xb16a('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb16a('0x3')]},'format':{'type':Sequelize[_0xb16a('0x3')]},'groupBy':{'type':Sequelize[_0xb16a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb16a('0x3')]},'custom':{'type':Sequelize[_0xb16a('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xefee=['TEXT','STRING','sequelize','exports'];(function(_0x427cce,_0x718314){var _0x283078=function(_0x5ebae4){while(--_0x5ebae4){_0x427cce['push'](_0x427cce['shift']());}};_0x283078(++_0x718314);}(_0xefee,0x6a));var _0xeefe=function(_0x5dc3fe,_0x5ba5a8){_0x5dc3fe=_0x5dc3fe-0x0;var _0x316c3a=_0xefee[_0x5dc3fe];return _0x316c3a;};'use strict';var Sequelize=require(_0xeefe('0x0'));module[_0xeefe('0x1')]={'field':{'type':Sequelize[_0xeefe('0x2')]},'alias':{'type':Sequelize[_0xeefe('0x3')]},'function':{'type':Sequelize[_0xeefe('0x3')]},'format':{'type':Sequelize[_0xeefe('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xeefe('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 9329526..c336680 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 _0xe738=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','type','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','update','destroy','stack','name','send','index','map','AnalyticFieldReport','key','model'];(function(_0x65e1d5,_0x463f69){var _0x1aaa37=function(_0x4579ad){while(--_0x4579ad){_0x65e1d5['push'](_0x65e1d5['shift']());}};_0x1aaa37(++_0x463f69);}(_0xe738,0x113));var _0x8e73=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe738[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x8e73('0x0'));var rimraf=require(_0x8e73('0x1'));var zipdir=require(_0x8e73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e73('0x3'));var moment=require(_0x8e73('0x4'));var BPromise=require(_0x8e73('0x5'));var Mustache=require(_0x8e73('0x6'));var util=require(_0x8e73('0x7'));var path=require(_0x8e73('0x8'));var sox=require('sox');var csv=require(_0x8e73('0x9'));var ejs=require(_0x8e73('0xa'));var fs=require('fs');var fs_extra=require(_0x8e73('0xb'));var _=require(_0x8e73('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8e73('0xd'));var deskjs=require(_0x8e73('0xe'));var toCsv=require(_0x8e73('0x9'));var querystring=require('querystring');var Papa=require(_0x8e73('0xf'));var Redis=require(_0x8e73('0x10'));var authService=require(_0x8e73('0x11'));var qs=require(_0x8e73('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e73('0x13'));var logger=require(_0x8e73('0x14'))(_0x8e73('0x15'));var utils=require(_0x8e73('0x16'));var config=require(_0x8e73('0x17'));var licenseUtil=require(_0x8e73('0x18'));var db=require(_0x8e73('0x19'))['db'];function respondWithStatusCode(_0x1503bb,_0x5dbd00){_0x5dbd00=_0x5dbd00||0xcc;return function(_0x206780){if(_0x206780){return _0x1503bb[_0x8e73('0x1a')](_0x5dbd00);}return _0x1503bb['status'](_0x5dbd00)[_0x8e73('0x1b')]();};}function respondWithResult(_0x5bbe06,_0x3ecd98){_0x3ecd98=_0x3ecd98||0xc8;return function(_0x529106){if(_0x529106){return _0x5bbe06[_0x8e73('0x1c')](_0x3ecd98)[_0x8e73('0x1d')](_0x529106);}};}function respondWithFilteredResult(_0x53d523,_0x5cf330){return function(_0x5aa3f4){if(_0x5aa3f4){var _0x10c24e=typeof _0x5cf330[_0x8e73('0x1e')]===_0x8e73('0x1f')&&typeof _0x5cf330['limit']===_0x8e73('0x1f');var _0x2ce77c=_0x5aa3f4['count'];var _0x186e33=_0x10c24e?0x0:_0x5cf330[_0x8e73('0x1e')];var _0x3dc6f2=_0x10c24e?_0x5aa3f4[_0x8e73('0x20')]:_0x5cf330['offset']+_0x5cf330['limit'];var _0x2eacad;if(_0x3dc6f2>=_0x2ce77c){_0x3dc6f2=_0x2ce77c;_0x2eacad=0xc8;}else{_0x2eacad=0xce;}_0x53d523[_0x8e73('0x1c')](_0x2eacad);return _0x53d523[_0x8e73('0x21')](_0x8e73('0x22'),_0x186e33+'-'+_0x3dc6f2+'/'+_0x2ce77c)['json'](_0x5aa3f4);}return null;};}function patchUpdates(_0x5e0791){return function(_0x10f76e){try{jsonpatch['apply'](_0x10f76e,_0x5e0791,!![]);}catch(_0x58b25e){return BPromise['reject'](_0x58b25e);}return _0x10f76e['save']();};}function saveUpdates(_0x38fbd5,_0x382511){return function(_0x2154f9){if(_0x2154f9){return _0x2154f9[_0x8e73('0x23')](_0x38fbd5)['then'](function(_0x11f9a2){return _0x11f9a2;});}return null;};}function removeEntity(_0x51bee3,_0x48aec9){return function(_0x1f7e9b){if(_0x1f7e9b){return _0x1f7e9b[_0x8e73('0x24')]()['then'](function(){_0x51bee3[_0x8e73('0x1c')](0xcc)[_0x8e73('0x1b')]();});}};}function handleEntityNotFound(_0x278147,_0x584ecd){return function(_0x1ca89a){if(!_0x1ca89a){_0x278147[_0x8e73('0x1a')](0x194);}return _0x1ca89a;};}function handleError(_0x2ea916,_0x3f4a2e){_0x3f4a2e=_0x3f4a2e||0x1f4;return function(_0x4a804f){logger['error'](_0x4a804f[_0x8e73('0x25')]);if(_0x4a804f[_0x8e73('0x26')]){delete _0x4a804f[_0x8e73('0x26')];}_0x2ea916[_0x8e73('0x1c')](_0x3f4a2e)[_0x8e73('0x27')](_0x4a804f);};}exports[_0x8e73('0x28')]=function(_0x2d2e7a,_0x33b4c9){var _0x42f36a={},_0x5f525a={},_0x395835={'count':0x0,'rows':[]};var _0x4f0662=_[_0x8e73('0x29')](db[_0x8e73('0x2a')]['rawAttributes'],function(_0x5527a0){return{'name':_0x5527a0['fieldName'],'type':_0x5527a0['type'][_0x8e73('0x2b')]};});_0x5f525a[_0x8e73('0x2c')]=_['map'](_0x4f0662,_0x8e73('0x26'));_0x5f525a['query']=_['keys'](_0x2d2e7a[_0x8e73('0x2d')]);_0x5f525a['filters']=_[_0x8e73('0x2e')](_0x5f525a[_0x8e73('0x2c')],_0x5f525a[_0x8e73('0x2d')]);_0x42f36a[_0x8e73('0x2f')]=_[_0x8e73('0x2e')](_0x5f525a[_0x8e73('0x2c')],qs['fields'](_0x2d2e7a['query'][_0x8e73('0x30')]));_0x42f36a[_0x8e73('0x2f')]=_0x42f36a[_0x8e73('0x2f')][_0x8e73('0x31')]?_0x42f36a['attributes']:_0x5f525a[_0x8e73('0x2c')];if(!_0x2d2e7a['query'][_0x8e73('0x32')](_0x8e73('0x33'))){_0x42f36a[_0x8e73('0x34')]=qs['limit'](_0x2d2e7a['query'][_0x8e73('0x34')]);_0x42f36a[_0x8e73('0x1e')]=qs[_0x8e73('0x1e')](_0x2d2e7a['query']['offset']);}_0x42f36a[_0x8e73('0x35')]=qs[_0x8e73('0x36')](_0x2d2e7a[_0x8e73('0x2d')]['sort']);_0x42f36a[_0x8e73('0x37')]=qs[_0x8e73('0x38')](_[_0x8e73('0x39')](_0x2d2e7a['query'],_0x5f525a[_0x8e73('0x38')]),_0x4f0662);if(_0x2d2e7a[_0x8e73('0x2d')]['filter']){_0x42f36a[_0x8e73('0x37')]=_['merge'](_0x42f36a[_0x8e73('0x37')],{'$or':_[_0x8e73('0x29')](_0x4f0662,function(_0x3a4b64){if(_0x3a4b64[_0x8e73('0x3a')]!==_0x8e73('0x3b')){var _0x110d69={};_0x110d69[_0x3a4b64[_0x8e73('0x26')]]={'$like':'%'+_0x2d2e7a[_0x8e73('0x2d')][_0x8e73('0x3c')]+'%'};return _0x110d69;}})});}_0x42f36a=_['merge']({},_0x42f36a,_0x2d2e7a[_0x8e73('0x3d')]);var _0x4d6d35={'where':_0x42f36a[_0x8e73('0x37')]};return db[_0x8e73('0x2a')][_0x8e73('0x20')](_0x4d6d35)[_0x8e73('0x3e')](function(_0x16ca68){_0x395835[_0x8e73('0x20')]=_0x16ca68;if(_0x2d2e7a[_0x8e73('0x2d')][_0x8e73('0x3f')]){_0x42f36a[_0x8e73('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x8e73('0x41')](_0x42f36a);})[_0x8e73('0x3e')](function(_0x4264a6){_0x395835[_0x8e73('0x42')]=_0x4264a6;return _0x395835;})[_0x8e73('0x3e')](respondWithFilteredResult(_0x33b4c9,_0x42f36a))[_0x8e73('0x43')](handleError(_0x33b4c9,null));};exports[_0x8e73('0x44')]=function(_0x108b52,_0xb1fda8){var _0x39dfca={'raw':![],'where':{'id':_0x108b52[_0x8e73('0x45')]['id']}},_0x3cc006={};_0x3cc006[_0x8e73('0x2c')]=_[_0x8e73('0x46')](db['AnalyticFieldReport']['rawAttributes']);_0x3cc006[_0x8e73('0x2d')]=_[_0x8e73('0x46')](_0x108b52[_0x8e73('0x2d')]);_0x3cc006[_0x8e73('0x38')]=_[_0x8e73('0x2e')](_0x3cc006[_0x8e73('0x2c')],_0x3cc006['query']);_0x39dfca['attributes']=_[_0x8e73('0x2e')](_0x3cc006[_0x8e73('0x2c')],qs[_0x8e73('0x30')](_0x108b52[_0x8e73('0x2d')]['fields']));_0x39dfca[_0x8e73('0x2f')]=_0x39dfca[_0x8e73('0x2f')][_0x8e73('0x31')]?_0x39dfca[_0x8e73('0x2f')]:_0x3cc006[_0x8e73('0x2c')];if(_0x108b52[_0x8e73('0x2d')][_0x8e73('0x3f')]){_0x39dfca[_0x8e73('0x40')]=[{'all':!![]}];}_0x39dfca=_[_0x8e73('0x47')]({},_0x39dfca,_0x108b52[_0x8e73('0x3d')]);return db[_0x8e73('0x2a')][_0x8e73('0x48')](_0x39dfca)[_0x8e73('0x3e')](handleEntityNotFound(_0xb1fda8,null))[_0x8e73('0x3e')](respondWithResult(_0xb1fda8,null))[_0x8e73('0x43')](handleError(_0xb1fda8,null));};exports['create']=function(_0x27b343,_0x2a80dd){return db[_0x8e73('0x2a')][_0x8e73('0x49')](_0x27b343[_0x8e73('0x4a')],{})[_0x8e73('0x3e')](respondWithResult(_0x2a80dd,0xc9))[_0x8e73('0x43')](handleError(_0x2a80dd,null));};exports[_0x8e73('0x4b')]=function(_0x5d82fe,_0x481a03){return db[_0x8e73('0x2a')][_0x8e73('0x4b')](_0x5d82fe['body'],{'raw':![],'individualHooks':!![]})[_0x8e73('0x3e')](respondWithResult(_0x481a03,0xc9))[_0x8e73('0x43')](handleError(_0x481a03,null));};exports[_0x8e73('0x23')]=function(_0x3ee027,_0x5d4352){if(_0x3ee027[_0x8e73('0x4a')]['id']){delete _0x3ee027['body']['id'];}return db[_0x8e73('0x2a')][_0x8e73('0x48')]({'where':{'id':_0x3ee027[_0x8e73('0x45')]['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x5d4352,null))[_0x8e73('0x3e')](saveUpdates(_0x3ee027[_0x8e73('0x4a')],null))[_0x8e73('0x3e')](respondWithResult(_0x5d4352,null))[_0x8e73('0x43')](handleError(_0x5d4352,null));};exports[_0x8e73('0x24')]=function(_0x2f1d0f,_0x4d239c){return db[_0x8e73('0x2a')][_0x8e73('0x48')]({'where':{'id':_0x2f1d0f['params']['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x4d239c,null))['then'](removeEntity(_0x4d239c,null))[_0x8e73('0x43')](handleError(_0x4d239c,null));};exports['bulkDestroy']=function(_0x4efb02,_0x4a0e18){return db['AnalyticFieldReport'][_0x8e73('0x24')]({'where':{'id':_0x4efb02[_0x8e73('0x2d')][_0x8e73('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x8e73('0x3e')](respondWithResult(_0x4a0e18,0xcc))['catch'](handleError(_0x4a0e18,null));};exports[_0x8e73('0x4d')]=function(_0x23a6ad,_0x4a0fb9,_0x20cf36){return db[_0x8e73('0x4e')][_0x8e73('0x4f')]({'where':{'id':_0x23a6ad['params']['id']}})[_0x8e73('0x3e')](handleEntityNotFound(_0x4a0fb9,null))[_0x8e73('0x3e')](function(_0x11653a){if(_0x11653a){return db['sequelize']['transaction'](function(_0x25020b){return db['AnalyticFieldReport'][_0x8e73('0x24')]({'where':{'CustomReportId':_0x23a6ad[_0x8e73('0x45')]['id']},'transaction':_0x25020b})['then'](function(_0x226f0c){var _0x427f42=_[_0x8e73('0x29')](_0x23a6ad['body'],function(_0x3044d5){delete _0x3044d5['id'];_0x3044d5['CustomReportId']=_0x23a6ad[_0x8e73('0x45')]['id'];return _0x3044d5;});return db[_0x8e73('0x2a')][_0x8e73('0x4b')](_0x427f42,{'transaction':_0x25020b});});})['then'](function(){return db[_0x8e73('0x2a')][_0x8e73('0x41')]({'where':{'CustomReportId':_0x23a6ad['params']['id']}});});}})[_0x8e73('0x3e')](respondWithResult(_0x4a0fb9,null))['catch'](handleError(_0x4a0fb9,null));}; \ No newline at end of file +var _0xad42=['filter','includeAll','include','findAll','rows','show','params','options','catch','create','body','bulkCreate','find','bulkDestroy','destroy','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','limit','count','set','Content-Range','save','then','end','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL'];(function(_0x1e6878,_0x783f07){var _0x189e27=function(_0x1f784a){while(--_0x1f784a){_0x1e6878['push'](_0x1e6878['shift']());}};_0x189e27(++_0x783f07);}(_0xad42,0xb2));var _0x2ad4=function(_0x5b3737,_0x54a3e0){_0x5b3737=_0x5b3737-0x0;var _0x1e9b47=_0xad42[_0x5b3737];return _0x1e9b47;};'use strict';var emlformat=require(_0x2ad4('0x0'));var rimraf=require(_0x2ad4('0x1'));var zipdir=require(_0x2ad4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ad4('0x3'));var moment=require(_0x2ad4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ad4('0x5'));var util=require(_0x2ad4('0x6'));var path=require(_0x2ad4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ad4('0x8'));var _=require(_0x2ad4('0x9'));var squel=require(_0x2ad4('0xa'));var crypto=require(_0x2ad4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2ad4('0xc'));var toCsv=require(_0x2ad4('0xd'));var querystring=require(_0x2ad4('0xe'));var Papa=require(_0x2ad4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2ad4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ad4('0x11'));var logger=require(_0x2ad4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2ad4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ad4('0x14'))['db'];function respondWithStatusCode(_0x263c76,_0x33deb5){_0x33deb5=_0x33deb5||0xcc;return function(_0x1be770){if(_0x1be770){return _0x263c76['sendStatus'](_0x33deb5);}return _0x263c76['status'](_0x33deb5)['end']();};}function respondWithResult(_0x4be9b6,_0x37c72c){_0x37c72c=_0x37c72c||0xc8;return function(_0xbd6753){if(_0xbd6753){return _0x4be9b6[_0x2ad4('0x15')](_0x37c72c)[_0x2ad4('0x16')](_0xbd6753);}};}function respondWithFilteredResult(_0x33b4cd,_0x45b6fd){return function(_0x161d1f){if(_0x161d1f){var _0x22b0f4=typeof _0x45b6fd[_0x2ad4('0x17')]==='undefined'&&typeof _0x45b6fd[_0x2ad4('0x18')]==='undefined';var _0x3c9a20=_0x161d1f[_0x2ad4('0x19')];var _0x16f28b=_0x22b0f4?0x0:_0x45b6fd[_0x2ad4('0x17')];var _0x2dd15e=_0x22b0f4?_0x161d1f[_0x2ad4('0x19')]:_0x45b6fd[_0x2ad4('0x17')]+_0x45b6fd[_0x2ad4('0x18')];var _0x47dc0;if(_0x2dd15e>=_0x3c9a20){_0x2dd15e=_0x3c9a20;_0x47dc0=0xc8;}else{_0x47dc0=0xce;}_0x33b4cd[_0x2ad4('0x15')](_0x47dc0);return _0x33b4cd[_0x2ad4('0x1a')](_0x2ad4('0x1b'),_0x16f28b+'-'+_0x2dd15e+'/'+_0x3c9a20)[_0x2ad4('0x16')](_0x161d1f);}return null;};}function patchUpdates(_0x46add0){return function(_0x2823fb){try{jsonpatch['apply'](_0x2823fb,_0x46add0,!![]);}catch(_0xeaa6e5){return BPromise['reject'](_0xeaa6e5);}return _0x2823fb[_0x2ad4('0x1c')]();};}function saveUpdates(_0x75f964,_0x34812c){return function(_0x300b18){if(_0x300b18){return _0x300b18['update'](_0x75f964)[_0x2ad4('0x1d')](function(_0x5ccd08){return _0x5ccd08;});}return null;};}function removeEntity(_0x401855,_0x1b4e9a){return function(_0x5e7630){if(_0x5e7630){return _0x5e7630['destroy']()[_0x2ad4('0x1d')](function(){_0x401855[_0x2ad4('0x15')](0xcc)[_0x2ad4('0x1e')]();});}};}function handleEntityNotFound(_0x2a22b2,_0x7c2aae){return function(_0x517ed2){if(!_0x517ed2){_0x2a22b2[_0x2ad4('0x1f')](0x194);}return _0x517ed2;};}function handleError(_0x2a9350,_0x161ca1){_0x161ca1=_0x161ca1||0x1f4;return function(_0x2220f5){logger[_0x2ad4('0x20')](_0x2220f5[_0x2ad4('0x21')]);if(_0x2220f5[_0x2ad4('0x22')]){delete _0x2220f5[_0x2ad4('0x22')];}_0x2a9350[_0x2ad4('0x15')](_0x161ca1)[_0x2ad4('0x23')](_0x2220f5);};}exports[_0x2ad4('0x24')]=function(_0x3c7277,_0x468334){var _0x37323f={},_0x1075ce={},_0x26dcc7={'count':0x0,'rows':[]};var _0x26d4f4=_[_0x2ad4('0x25')](db[_0x2ad4('0x26')][_0x2ad4('0x27')],function(_0x1f1c67){return{'name':_0x1f1c67[_0x2ad4('0x28')],'type':_0x1f1c67[_0x2ad4('0x29')][_0x2ad4('0x2a')]};});_0x1075ce[_0x2ad4('0x2b')]=_[_0x2ad4('0x25')](_0x26d4f4,_0x2ad4('0x22'));_0x1075ce['query']=_[_0x2ad4('0x2c')](_0x3c7277[_0x2ad4('0x2d')]);_0x1075ce['filters']=_[_0x2ad4('0x2e')](_0x1075ce[_0x2ad4('0x2b')],_0x1075ce[_0x2ad4('0x2d')]);_0x37323f['attributes']=_[_0x2ad4('0x2e')](_0x1075ce[_0x2ad4('0x2b')],qs['fields'](_0x3c7277['query'][_0x2ad4('0x2f')]));_0x37323f[_0x2ad4('0x30')]=_0x37323f[_0x2ad4('0x30')][_0x2ad4('0x31')]?_0x37323f['attributes']:_0x1075ce[_0x2ad4('0x2b')];if(!_0x3c7277['query'][_0x2ad4('0x32')](_0x2ad4('0x33'))){_0x37323f['limit']=qs['limit'](_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x18')]);_0x37323f['offset']=qs['offset'](_0x3c7277['query'][_0x2ad4('0x17')]);}_0x37323f[_0x2ad4('0x34')]=qs[_0x2ad4('0x35')](_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x35')]);_0x37323f[_0x2ad4('0x36')]=qs['filters'](_[_0x2ad4('0x37')](_0x3c7277[_0x2ad4('0x2d')],_0x1075ce[_0x2ad4('0x38')]),_0x26d4f4);if(_0x3c7277[_0x2ad4('0x2d')]['filter']){_0x37323f[_0x2ad4('0x36')]=_[_0x2ad4('0x39')](_0x37323f[_0x2ad4('0x36')],{'$or':_[_0x2ad4('0x25')](_0x26d4f4,function(_0x449db9){if(_0x449db9[_0x2ad4('0x29')]!==_0x2ad4('0x3a')){var _0x5e8c8a={};_0x5e8c8a[_0x449db9[_0x2ad4('0x22')]]={'$like':'%'+_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x3b')]+'%'};return _0x5e8c8a;}})});}_0x37323f=_[_0x2ad4('0x39')]({},_0x37323f,_0x3c7277['options']);var _0x5c8d4e={'where':_0x37323f[_0x2ad4('0x36')]};return db['AnalyticFieldReport'][_0x2ad4('0x19')](_0x5c8d4e)[_0x2ad4('0x1d')](function(_0x56d33a){_0x26dcc7[_0x2ad4('0x19')]=_0x56d33a;if(_0x3c7277[_0x2ad4('0x2d')][_0x2ad4('0x3c')]){_0x37323f[_0x2ad4('0x3d')]=[{'all':!![]}];}return db[_0x2ad4('0x26')][_0x2ad4('0x3e')](_0x37323f);})[_0x2ad4('0x1d')](function(_0x146f9d){_0x26dcc7[_0x2ad4('0x3f')]=_0x146f9d;return _0x26dcc7;})['then'](respondWithFilteredResult(_0x468334,_0x37323f))['catch'](handleError(_0x468334,null));};exports[_0x2ad4('0x40')]=function(_0x49d889,_0x564abd){var _0x5a2059={'raw':![],'where':{'id':_0x49d889[_0x2ad4('0x41')]['id']}},_0x598c24={};_0x598c24[_0x2ad4('0x2b')]=_['keys'](db[_0x2ad4('0x26')][_0x2ad4('0x27')]);_0x598c24['query']=_[_0x2ad4('0x2c')](_0x49d889[_0x2ad4('0x2d')]);_0x598c24['filters']=_[_0x2ad4('0x2e')](_0x598c24[_0x2ad4('0x2b')],_0x598c24['query']);_0x5a2059[_0x2ad4('0x30')]=_[_0x2ad4('0x2e')](_0x598c24['model'],qs['fields'](_0x49d889['query'][_0x2ad4('0x2f')]));_0x5a2059['attributes']=_0x5a2059[_0x2ad4('0x30')]['length']?_0x5a2059['attributes']:_0x598c24[_0x2ad4('0x2b')];if(_0x49d889[_0x2ad4('0x2d')][_0x2ad4('0x3c')]){_0x5a2059[_0x2ad4('0x3d')]=[{'all':!![]}];}_0x5a2059=_[_0x2ad4('0x39')]({},_0x5a2059,_0x49d889[_0x2ad4('0x42')]);return db[_0x2ad4('0x26')]['find'](_0x5a2059)[_0x2ad4('0x1d')](handleEntityNotFound(_0x564abd,null))['then'](respondWithResult(_0x564abd,null))[_0x2ad4('0x43')](handleError(_0x564abd,null));};exports[_0x2ad4('0x44')]=function(_0x185d6c,_0x336eac){return db[_0x2ad4('0x26')][_0x2ad4('0x44')](_0x185d6c[_0x2ad4('0x45')],{})[_0x2ad4('0x1d')](respondWithResult(_0x336eac,0xc9))[_0x2ad4('0x43')](handleError(_0x336eac,null));};exports[_0x2ad4('0x46')]=function(_0x151721,_0x4c6cff){return db[_0x2ad4('0x26')][_0x2ad4('0x46')](_0x151721[_0x2ad4('0x45')],{'raw':![],'individualHooks':!![]})[_0x2ad4('0x1d')](respondWithResult(_0x4c6cff,0xc9))[_0x2ad4('0x43')](handleError(_0x4c6cff,null));};exports['update']=function(_0x52287a,_0x36abb6){if(_0x52287a[_0x2ad4('0x45')]['id']){delete _0x52287a['body']['id'];}return db['AnalyticFieldReport'][_0x2ad4('0x47')]({'where':{'id':_0x52287a['params']['id']}})[_0x2ad4('0x1d')](handleEntityNotFound(_0x36abb6,null))[_0x2ad4('0x1d')](saveUpdates(_0x52287a[_0x2ad4('0x45')],null))[_0x2ad4('0x1d')](respondWithResult(_0x36abb6,null))[_0x2ad4('0x43')](handleError(_0x36abb6,null));};exports['destroy']=function(_0x268798,_0x5552d3){return db[_0x2ad4('0x26')][_0x2ad4('0x47')]({'where':{'id':_0x268798[_0x2ad4('0x41')]['id']}})[_0x2ad4('0x1d')](handleEntityNotFound(_0x5552d3,null))['then'](removeEntity(_0x5552d3,null))[_0x2ad4('0x43')](handleError(_0x5552d3,null));};exports[_0x2ad4('0x48')]=function(_0x4b7d02,_0x46c9a6){return db[_0x2ad4('0x26')][_0x2ad4('0x49')]({'where':{'id':_0x4b7d02[_0x2ad4('0x2d')][_0x2ad4('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x46c9a6,0xcc))['catch'](handleError(_0x46c9a6,null));};exports['addFields']=function(_0x5bfcf6,_0xbe00f8,_0x1cda72){return db[_0x2ad4('0x4b')][_0x2ad4('0x4c')]({'where':{'id':_0x5bfcf6[_0x2ad4('0x41')]['id']}})['then'](handleEntityNotFound(_0xbe00f8,null))[_0x2ad4('0x1d')](function(_0x1463f8){if(_0x1463f8){return db[_0x2ad4('0x4d')]['transaction'](function(_0x21b6ed){return db['AnalyticFieldReport'][_0x2ad4('0x49')]({'where':{'CustomReportId':_0x5bfcf6['params']['id']},'transaction':_0x21b6ed})['then'](function(_0x544551){var _0x3b2105=_[_0x2ad4('0x25')](_0x5bfcf6[_0x2ad4('0x45')],function(_0xf92d4){delete _0xf92d4['id'];_0xf92d4[_0x2ad4('0x4e')]=_0x5bfcf6['params']['id'];return _0xf92d4;});return db[_0x2ad4('0x26')][_0x2ad4('0x46')](_0x3b2105,{'transaction':_0x21b6ed});});})[_0x2ad4('0x1d')](function(){return db[_0x2ad4('0x26')][_0x2ad4('0x3e')]({'where':{'CustomReportId':_0x5bfcf6[_0x2ad4('0x41')]['id']}});});}})[_0x2ad4('0x1d')](respondWithResult(_0xbe00f8,null))['catch'](handleError(_0xbe00f8,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index e280f90..d8590eb 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 _0x59b3=['AnalyticFieldReport','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x59b3,0x140));var _0x359b=function(_0xae0c01,_0x449c99){_0xae0c01=_0xae0c01-0x0;var _0x913e86=_0x59b3[_0xae0c01];return _0x913e86;};'use strict';var _=require(_0x359b('0x0'));var util=require(_0x359b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x359b('0x2'));var BPromise=require(_0x359b('0x3'));var rp=require(_0x359b('0x4'));var fs=require('fs');var path=require(_0x359b('0x5'));var rimraf=require(_0x359b('0x6'));var config=require(_0x359b('0x7'));var attributes=require(_0x359b('0x8'));module[_0x359b('0x9')]=function(_0x36031d,_0x34f688){return _0x36031d['define'](_0x359b('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4833=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird'];(function(_0x77b38c,_0x546837){var _0x462441=function(_0x212edb){while(--_0x212edb){_0x77b38c['push'](_0x77b38c['shift']());}};_0x462441(++_0x546837);}(_0x4833,0xad));var _0x3483=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x4833[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0x3483('0x0'));var util=require(_0x3483('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3483('0x2'));var rp=require(_0x3483('0x3'));var fs=require('fs');var path=require(_0x3483('0x4'));var rimraf=require(_0x3483('0x5'));var config=require(_0x3483('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x3483('0x7')]=function(_0x5ded00,_0x3e1898){return _0x5ded00[_0x3483('0x8')](_0x3483('0x9'),attributes,{'tableName':_0x3483('0xa'),'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 f5aef53..905636a 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 _0x0130=['request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http'];(function(_0x3dfd79,_0x37d23b){var _0x3a2714=function(_0x1114cb){while(--_0x1114cb){_0x3dfd79['push'](_0x3dfd79['shift']());}};_0x3a2714(++_0x37d23b);}(_0x0130,0x11d));var _0x0013=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x0130[_0x4f4c2a];return _0xd15be6;};'use strict';var _=require(_0x0013('0x0'));var util=require('util');var moment=require(_0x0013('0x1'));var BPromise=require(_0x0013('0x2'));var rs=require(_0x0013('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0013('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0013('0x5'));var jayson=require(_0x0013('0x6'));var client=jayson[_0x0013('0x7')][_0x0013('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1053b6,_0x33f663,_0x1b89f6){return new BPromise(function(_0x47e5df,_0x362ce5){return client[_0x0013('0x9')](_0x1053b6,_0x1b89f6)[_0x0013('0xa')](function(_0x3df82a){logger[_0x0013('0xb')](_0x0013('0xc'),_0x33f663,_0x0013('0xd'));logger[_0x0013('0xe')](_0x0013('0xf'),_0x33f663,_0x0013('0xd'),JSON[_0x0013('0x10')](_0x3df82a));if(_0x3df82a[_0x0013('0x11')]){if(_0x3df82a[_0x0013('0x11')][_0x0013('0x12')]===0x1f4){logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x3df82a['error']['message']);return _0x362ce5(_0x3df82a[_0x0013('0x11')][_0x0013('0x13')]);}logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x3df82a['error'][_0x0013('0x13')]);return _0x47e5df(_0x3df82a[_0x0013('0x11')]['message']);}else{logger[_0x0013('0xb')](_0x0013('0xc'),_0x33f663,_0x0013('0xd'));_0x47e5df(_0x3df82a[_0x0013('0x14')][_0x0013('0x13')]);}})['catch'](function(_0x2711ed){logger[_0x0013('0x11')](_0x0013('0xc'),_0x33f663,_0x2711ed);_0x362ce5(_0x2711ed);});});} \ No newline at end of file +var _0x3279=['../../config/environment','jayson/promise','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x374f51,_0x44f7ae){var _0x58c371=function(_0x3988c8){while(--_0x3988c8){_0x374f51['push'](_0x374f51['shift']());}};_0x58c371(++_0x44f7ae);}(_0x3279,0x8b));var _0x9327=function(_0x305158,_0xd21e46){_0x305158=_0x305158-0x0;var _0x31518e=_0x3279[_0x305158];return _0x31518e;};'use strict';var _=require(_0x9327('0x0'));var util=require(_0x9327('0x1'));var moment=require('moment');var BPromise=require(_0x9327('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9327('0x3'));var db=require(_0x9327('0x4'))['db'];var utils=require(_0x9327('0x5'));var logger=require(_0x9327('0x6'))(_0x9327('0x7'));var config=require(_0x9327('0x8'));var jayson=require(_0x9327('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe137dd,_0x52baca,_0x3f0ca2){return new BPromise(function(_0x38c189,_0x5080d3){return client['request'](_0xe137dd,_0x3f0ca2)[_0x9327('0xa')](function(_0x9ca971){logger[_0x9327('0xb')](_0x9327('0xc'),_0x52baca,_0x9327('0xd'));logger[_0x9327('0xe')](_0x9327('0xf'),_0x52baca,_0x9327('0xd'),JSON[_0x9327('0x10')](_0x9ca971));if(_0x9ca971[_0x9327('0x11')]){if(_0x9ca971[_0x9327('0x11')]['code']===0x1f4){logger[_0x9327('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52baca,_0x9ca971['error'][_0x9327('0x12')]);return _0x5080d3(_0x9ca971['error'][_0x9327('0x12')]);}logger['error'](_0x9327('0xc'),_0x52baca,_0x9ca971['error']['message']);return _0x38c189(_0x9ca971[_0x9327('0x11')][_0x9327('0x12')]);}else{logger['info'](_0x9327('0xc'),_0x52baca,_0x9327('0xd'));_0x38c189(_0x9ca971[_0x9327('0x13')]['message']);}})[_0x9327('0x14')](function(_0xcb13d4){logger[_0x9327('0x11')](_0x9327('0xc'),_0x52baca,_0xcb13d4);_0x5080d3(_0xcb13d4);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b2241f0..572302b 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(_0x595d76,_0x18d497){var _0xbac517=function(_0x20baee){while(--_0x20baee){_0x595d76['push'](_0x595d76['shift']());}};_0xbac517(++_0x18d497);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x5e624f,_0x393089){var _0x3c5d04=function(_0xd6fe24){while(--_0xd6fe24){_0x5e624f['push'](_0x5e624f['shift']());}};_0x3c5d04(++_0x393089);}(_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('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 2681a13..20e4f90 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 _0x9c00=['sequelize','exports','STRING','TEXT'];(function(_0x5ca784,_0x28bea2){var _0x5aa579=function(_0x531234){while(--_0x531234){_0x5ca784['push'](_0x5ca784['shift']());}};_0x5aa579(++_0x28bea2);}(_0x9c00,0x1a0));var _0x09c0=function(_0x308375,_0x3a93cc){_0x308375=_0x308375-0x0;var _0x18d40c=_0x9c00[_0x308375];return _0x18d40c;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x09c0('0x2')]},'metric':{'type':Sequelize[_0x09c0('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34b7=['TEXT','STRING','name'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x34b7,0x196));var _0x734b=function(_0x4b4950,_0x103d19){_0x4b4950=_0x4b4950-0x0;var _0x401a6e=_0x34b7[_0x4b4950];return _0x401a6e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x734b('0x0')],'allowNull':![],'unique':_0x734b('0x1')},'table':{'type':Sequelize[_0x734b('0x0')]},'metric':{'type':Sequelize[_0x734b('0x2')]},'description':{'type':Sequelize[_0x734b('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 05f532a..e52935b 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 _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(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0x55ca,0x126));var _0xa55c=function(_0x4b3413,_0x58c416){_0x4b3413=_0x4b3413-0x0;var _0x3b01ba=_0x55ca[_0x4b3413];return _0x3b01ba;};'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 +var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x5775c4,_0x11631c){var _0xa2e3a1=function(_0x3c9a67){while(--_0x3c9a67){_0x5775c4['push'](_0x5775c4['shift']());}};_0xa2e3a1(++_0x11631c);}(_0x6aa7,0x178));var _0x76aa=function(_0x218e36,_0x2ae2d5){_0x218e36=_0x218e36-0x0;var _0x315be6=_0x6aa7[_0x218e36];return _0x315be6;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index a458b08..9242114 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 _0xd991=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0xd991,0x115));var _0x1d99=function(_0x547a18,_0x3d92c9){_0x547a18=_0x547a18-0x0;var _0x49a74f=_0xd991[_0x547a18];return _0x49a74f;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var logger=require(_0x1d99('0x2'))(_0x1d99('0x3'));var moment=require(_0x1d99('0x4'));var BPromise=require('bluebird');var rp=require(_0x1d99('0x5'));var fs=require('fs');var path=require(_0x1d99('0x6'));var rimraf=require(_0x1d99('0x7'));var config=require(_0x1d99('0x8'));var attributes=require(_0x1d99('0x9'));module[_0x1d99('0xa')]=function(_0x5f3a37,_0x1adbca){return _0x5f3a37[_0x1d99('0xb')]('AnalyticMetric',attributes,{'tableName':_0x1d99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbacd=['api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x35efd7,_0x5a97e6){var _0x3d9b5d=function(_0x45fa98){while(--_0x45fa98){_0x35efd7['push'](_0x35efd7['shift']());}};_0x3d9b5d(++_0x5a97e6);}(_0xbacd,0x1c5));var _0xdbac=function(_0x44bf2d,_0x47c4b){_0x44bf2d=_0x44bf2d-0x0;var _0x5c793a=_0xbacd[_0x44bf2d];return _0x5c793a;};'use strict';var _=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var logger=require('../../config/logger')(_0xdbac('0x2'));var moment=require(_0xdbac('0x3'));var BPromise=require(_0xdbac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbac('0x5'));var rimraf=require(_0xdbac('0x6'));var config=require(_0xdbac('0x7'));var attributes=require(_0xdbac('0x8'));module[_0xdbac('0x9')]=function(_0x376641,_0x19134a){return _0x376641[_0xdbac('0xa')](_0xdbac('0xb'),attributes,{'tableName':_0xdbac('0xc'),'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 de53e47..e219b44 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 _0xc83a=['jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b03a5,_0x812ea1){var _0x12d60d=function(_0x336667){while(--_0x336667){_0x1b03a5['push'](_0x1b03a5['shift']());}};_0x12d60d(++_0x812ea1);}(_0xc83a,0x10a));var _0xac83=function(_0x44757b,_0x1133d4){_0x44757b=_0x44757b-0x0;var _0x2e53d6=_0xc83a[_0x44757b];return _0x2e53d6;};'use strict';var _=require(_0xac83('0x0'));var util=require('util');var moment=require(_0xac83('0x1'));var BPromise=require(_0xac83('0x2'));var rs=require(_0xac83('0x3'));var fs=require('fs');var Redis=require(_0xac83('0x4'));var db=require(_0xac83('0x5'))['db'];var utils=require(_0xac83('0x6'));var logger=require(_0xac83('0x7'))(_0xac83('0x8'));var config=require(_0xac83('0x9'));var jayson=require(_0xac83('0xa'));var client=jayson['client'][_0xac83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1351a2,_0x43a764,_0x442ffb){return new BPromise(function(_0x5c7679,_0x27ec9a){return client[_0xac83('0xc')](_0x1351a2,_0x442ffb)[_0xac83('0xd')](function(_0xc1e695){logger[_0xac83('0xe')](_0xac83('0xf'),_0x43a764,_0xac83('0x10'));logger[_0xac83('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'),JSON['stringify'](_0xc1e695));if(_0xc1e695['error']){if(_0xc1e695[_0xac83('0x12')][_0xac83('0x13')]===0x1f4){logger[_0xac83('0x12')](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')]['message']);return _0x27ec9a(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}logger['error'](_0xac83('0xf'),_0x43a764,_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);return _0x5c7679(_0xc1e695[_0xac83('0x12')][_0xac83('0x14')]);}else{logger[_0xac83('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0xac83('0x10'));_0x5c7679(_0xc1e695[_0xac83('0x15')][_0xac83('0x14')]);}})[_0xac83('0x16')](function(_0x14ebeb){logger[_0xac83('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x43a764,_0x14ebeb);_0x27ec9a(_0x14ebeb);});});} \ No newline at end of file +var _0x738b=['debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0x738b,0x79));var _0xb738=function(_0x3318be,_0x1c7bcd){_0x3318be=_0x3318be-0x0;var _0x1229e4=_0x738b[_0x3318be];return _0x1229e4;};'use strict';var _=require(_0xb738('0x0'));var util=require(_0xb738('0x1'));var moment=require(_0xb738('0x2'));var BPromise=require(_0xb738('0x3'));var rs=require(_0xb738('0x4'));var fs=require('fs');var Redis=require(_0xb738('0x5'));var db=require(_0xb738('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb738('0x7'))(_0xb738('0x8'));var config=require(_0xb738('0x9'));var jayson=require(_0xb738('0xa'));var client=jayson[_0xb738('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bace8,_0x4bd31d,_0x22abd0){return new BPromise(function(_0x4a4e68,_0x480266){return client[_0xb738('0xc')](_0x1bace8,_0x22abd0)[_0xb738('0xd')](function(_0x5b8d47){logger[_0xb738('0xe')](_0xb738('0xf'),_0x4bd31d,_0xb738('0x10'));logger[_0xb738('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4bd31d,'request\x20sent',JSON[_0xb738('0x12')](_0x5b8d47));if(_0x5b8d47[_0xb738('0x13')]){if(_0x5b8d47['error'][_0xb738('0x14')]===0x1f4){logger[_0xb738('0x13')](_0xb738('0xf'),_0x4bd31d,_0x5b8d47[_0xb738('0x13')][_0xb738('0x15')]);return _0x480266(_0x5b8d47[_0xb738('0x13')][_0xb738('0x15')]);}logger[_0xb738('0x13')](_0xb738('0xf'),_0x4bd31d,_0x5b8d47[_0xb738('0x13')][_0xb738('0x15')]);return _0x4a4e68(_0x5b8d47['error'][_0xb738('0x15')]);}else{logger[_0xb738('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x4bd31d,_0xb738('0x10'));_0x4a4e68(_0x5b8d47[_0xb738('0x16')]['message']);}})['catch'](function(_0x425033){logger[_0xb738('0x13')](_0xb738('0xf'),_0x4bd31d,_0x425033);_0x480266(_0x425033);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 400ace3..4acd3e2 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 _0x37cc=['index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4752d4,_0x350e24){var _0x567af7=function(_0xf245f2){while(--_0xf245f2){_0x4752d4['push'](_0x4752d4['shift']());}};_0x567af7(++_0x350e24);}(_0x37cc,0x185));var _0xc37c=function(_0x474ef8,_0x543bc0){_0x474ef8=_0x474ef8-0x0;var _0x403ed1=_0x37cc[_0x474ef8];return _0x403ed1;};'use strict';var multer=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var path=require(_0xc37c('0x2'));var timeout=require(_0xc37c('0x3'));var express=require(_0xc37c('0x4'));var router=express[_0xc37c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc37c('0x6'));var config=require(_0xc37c('0x7'));var controller=require(_0xc37c('0x8'));router[_0xc37c('0x9')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xb')]);router[_0xc37c('0x9')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller['show']);router[_0xc37c('0xd')]('/',auth[_0xc37c('0xa')](),controller[_0xc37c('0xe')]);router[_0xc37c('0xf')](_0xc37c('0xc'),auth['isAuthenticated'](),controller[_0xc37c('0x10')]);router[_0xc37c('0x11')](_0xc37c('0xc'),auth[_0xc37c('0xa')](),controller[_0xc37c('0x12')]);module[_0xc37c('0x13')]=router; \ No newline at end of file +var _0x06bf=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5efd08,_0xf901dd){var _0x43f697=function(_0x1de0f1){while(--_0x1de0f1){_0x5efd08['push'](_0x5efd08['shift']());}};_0x43f697(++_0xf901dd);}(_0x06bf,0x105));var _0xf06b=function(_0x571675,_0x1e2bc1){_0x571675=_0x571675-0x0;var _0x48743f=_0x06bf[_0x571675];return _0x48743f;};'use strict';var multer=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var path=require(_0xf06b('0x2'));var timeout=require(_0xf06b('0x3'));var express=require(_0xf06b('0x4'));var router=express[_0xf06b('0x5')]();var fs_extra=require(_0xf06b('0x6'));var auth=require(_0xf06b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf06b('0x8'));var controller=require(_0xf06b('0x9'));router[_0xf06b('0xa')]('/',auth['isAuthenticated'](),controller[_0xf06b('0xb')]);router[_0xf06b('0xa')](_0xf06b('0xc'),auth[_0xf06b('0xd')](),controller['show']);router[_0xf06b('0xe')]('/',auth[_0xf06b('0xd')](),controller['create']);router['put'](_0xf06b('0xc'),auth[_0xf06b('0xd')](),controller[_0xf06b('0xf')]);router[_0xf06b('0x10')](_0xf06b('0xc'),auth[_0xf06b('0xd')](),controller[_0xf06b('0x11')]);module[_0xf06b('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 d02867c..55bef11 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 _0xc663=['TEXT'];(function(_0x46cd90,_0x25b41a){var _0x3320b8=function(_0x2ea9f6){while(--_0x2ea9f6){_0x46cd90['push'](_0x46cd90['shift']());}};_0x3320b8(++_0x25b41a);}(_0xc663,0x1ea));var _0x3c66=function(_0x59400c,_0x364897){_0x59400c=_0x59400c-0x0;var _0x51508d=_0xc663[_0x59400c];return _0x51508d;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x3c66('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x2367=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2367,0x9f));var _0x7236=function(_0x5cabb7,_0xf7fc24){_0x5cabb7=_0x5cabb7-0x0;var _0x4c63b8=_0x2367[_0x5cabb7];return _0x4c63b8;};'use strict';var Sequelize=require(_0x7236('0x0'));module[_0x7236('0x1')]={'tree':{'type':Sequelize[_0x7236('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 2fc5f30..9738b30 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 _0xa9e7=['query','length','nolimit','order','where','filters','pick','filter','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','intersection','attributes','fields'];(function(_0x53aa46,_0x597524){var _0x5f37f5=function(_0x59b095){while(--_0x59b095){_0x53aa46['push'](_0x53aa46['shift']());}};_0x5f37f5(++_0x597524);}(_0xa9e7,0x185));var _0x7a9e=function(_0x3ff95a,_0x2aeb82){_0x3ff95a=_0x3ff95a-0x0;var _0x172fd5=_0xa9e7[_0x3ff95a];return _0x172fd5;};'use strict';var emlformat=require(_0x7a9e('0x0'));var rimraf=require(_0x7a9e('0x1'));var zipdir=require(_0x7a9e('0x2'));var jsonpatch=require(_0x7a9e('0x3'));var rp=require('request-promise');var moment=require(_0x7a9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a9e('0x5'));var util=require(_0x7a9e('0x6'));var path=require(_0x7a9e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a9e('0x8'));var _=require(_0x7a9e('0x9'));var squel=require(_0x7a9e('0xa'));var crypto=require(_0x7a9e('0xb'));var jsforce=require(_0x7a9e('0xc'));var deskjs=require(_0x7a9e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a9e('0xe'));var Papa=require(_0x7a9e('0xf'));var Redis=require('ioredis');var authService=require(_0x7a9e('0x10'));var qs=require(_0x7a9e('0x11'));var as=require(_0x7a9e('0x12'));var hardwareService=require(_0x7a9e('0x13'));var logger=require(_0x7a9e('0x14'))(_0x7a9e('0x15'));var utils=require('../../config/utils');var config=require(_0x7a9e('0x16'));var licenseUtil=require(_0x7a9e('0x17'));var db=require(_0x7a9e('0x18'))['db'];function respondWithStatusCode(_0xd88a5a,_0x35a1fb){_0x35a1fb=_0x35a1fb||0xcc;return function(_0x575248){if(_0x575248){return _0xd88a5a[_0x7a9e('0x19')](_0x35a1fb);}return _0xd88a5a['status'](_0x35a1fb)[_0x7a9e('0x1a')]();};}function respondWithResult(_0x19d33e,_0x5039e2){_0x5039e2=_0x5039e2||0xc8;return function(_0x5b7f91){if(_0x5b7f91){return _0x19d33e[_0x7a9e('0x1b')](_0x5039e2)[_0x7a9e('0x1c')](_0x5b7f91);}};}function respondWithFilteredResult(_0xcfc2c3,_0x122ba8){return function(_0x496078){if(_0x496078){var _0x35ca55=typeof _0x122ba8[_0x7a9e('0x1d')]===_0x7a9e('0x1e')&&typeof _0x122ba8[_0x7a9e('0x1f')]===_0x7a9e('0x1e');var _0x262b8f=_0x496078[_0x7a9e('0x20')];var _0xba9b1=_0x35ca55?0x0:_0x122ba8['offset'];var _0x483be8=_0x35ca55?_0x496078[_0x7a9e('0x20')]:_0x122ba8[_0x7a9e('0x1d')]+_0x122ba8[_0x7a9e('0x1f')];var _0x285383;if(_0x483be8>=_0x262b8f){_0x483be8=_0x262b8f;_0x285383=0xc8;}else{_0x285383=0xce;}_0xcfc2c3[_0x7a9e('0x1b')](_0x285383);return _0xcfc2c3[_0x7a9e('0x21')](_0x7a9e('0x22'),_0xba9b1+'-'+_0x483be8+'/'+_0x262b8f)['json'](_0x496078);}return null;};}function patchUpdates(_0x51aa59){return function(_0x2dad2f){try{jsonpatch[_0x7a9e('0x23')](_0x2dad2f,_0x51aa59,!![]);}catch(_0x252450){return BPromise[_0x7a9e('0x24')](_0x252450);}return _0x2dad2f[_0x7a9e('0x25')]();};}function saveUpdates(_0x58ebf7,_0x422506){return function(_0x5cd019){if(_0x5cd019){return _0x5cd019['update'](_0x58ebf7)[_0x7a9e('0x26')](function(_0x1c289c){return _0x1c289c;});}return null;};}function removeEntity(_0x34a89a,_0x2bbc51){return function(_0x23d40a){if(_0x23d40a){return _0x23d40a[_0x7a9e('0x27')]()[_0x7a9e('0x26')](function(){_0x34a89a['status'](0xcc)[_0x7a9e('0x1a')]();});}};}function handleEntityNotFound(_0x2aca80,_0x1744b3){return function(_0x274a04){if(!_0x274a04){_0x2aca80[_0x7a9e('0x19')](0x194);}return _0x274a04;};}function handleError(_0x102e66,_0x3bf0bd){_0x3bf0bd=_0x3bf0bd||0x1f4;return function(_0x53e2a6){logger[_0x7a9e('0x28')](_0x53e2a6[_0x7a9e('0x29')]);if(_0x53e2a6[_0x7a9e('0x2a')]){delete _0x53e2a6[_0x7a9e('0x2a')];}_0x102e66[_0x7a9e('0x1b')](_0x3bf0bd)[_0x7a9e('0x2b')](_0x53e2a6);};}exports[_0x7a9e('0x2c')]=function(_0x472094,_0x530d4d){var _0x281068={},_0x415d4c={},_0x258270={'count':0x0,'rows':[]};var _0x16a1ca=_['map'](db[_0x7a9e('0x2d')][_0x7a9e('0x2e')],function(_0x17ef91){return{'name':_0x17ef91[_0x7a9e('0x2f')],'type':_0x17ef91[_0x7a9e('0x30')][_0x7a9e('0x31')]};});_0x415d4c[_0x7a9e('0x32')]=_[_0x7a9e('0x33')](_0x16a1ca,_0x7a9e('0x2a'));_0x415d4c['query']=_['keys'](_0x472094['query']);_0x415d4c['filters']=_[_0x7a9e('0x34')](_0x415d4c[_0x7a9e('0x32')],_0x415d4c['query']);_0x281068[_0x7a9e('0x35')]=_[_0x7a9e('0x34')](_0x415d4c[_0x7a9e('0x32')],qs[_0x7a9e('0x36')](_0x472094[_0x7a9e('0x37')]['fields']));_0x281068['attributes']=_0x281068[_0x7a9e('0x35')][_0x7a9e('0x38')]?_0x281068[_0x7a9e('0x35')]:_0x415d4c['model'];if(!_0x472094[_0x7a9e('0x37')]['hasOwnProperty'](_0x7a9e('0x39'))){_0x281068['limit']=qs[_0x7a9e('0x1f')](_0x472094[_0x7a9e('0x37')][_0x7a9e('0x1f')]);_0x281068['offset']=qs[_0x7a9e('0x1d')](_0x472094['query'][_0x7a9e('0x1d')]);}_0x281068[_0x7a9e('0x3a')]=qs['sort'](_0x472094['query']['sort']);_0x281068[_0x7a9e('0x3b')]=qs[_0x7a9e('0x3c')](_[_0x7a9e('0x3d')](_0x472094[_0x7a9e('0x37')],_0x415d4c[_0x7a9e('0x3c')]),_0x16a1ca);if(_0x472094['query']['filter']){_0x281068[_0x7a9e('0x3b')]=_['merge'](_0x281068['where'],{'$or':_[_0x7a9e('0x33')](_0x16a1ca,function(_0x23df03){if(_0x23df03['type']!=='VIRTUAL'){var _0x17b49a={};_0x17b49a[_0x23df03[_0x7a9e('0x2a')]]={'$like':'%'+_0x472094['query'][_0x7a9e('0x3e')]+'%'};return _0x17b49a;}})});}_0x281068=_['merge']({},_0x281068,_0x472094['options']);var _0x564ab8={'where':_0x281068[_0x7a9e('0x3b')]};return db['AnalyticTreeReport']['count'](_0x564ab8)['then'](function(_0x179e0b){_0x258270[_0x7a9e('0x20')]=_0x179e0b;if(_0x472094[_0x7a9e('0x37')][_0x7a9e('0x3f')]){_0x281068[_0x7a9e('0x40')]=[{'all':!![]}];}return db[_0x7a9e('0x2d')][_0x7a9e('0x41')](_0x281068);})[_0x7a9e('0x26')](function(_0x488561){_0x258270[_0x7a9e('0x42')]=_0x488561;return _0x258270;})[_0x7a9e('0x26')](respondWithFilteredResult(_0x530d4d,_0x281068))[_0x7a9e('0x43')](handleError(_0x530d4d,null));};exports['show']=function(_0x12f378,_0x27cccd){var _0x529e35={'raw':!![],'where':{'id':_0x12f378[_0x7a9e('0x44')]['id']}},_0x34b3e8={};_0x34b3e8[_0x7a9e('0x32')]=_[_0x7a9e('0x45')](db['AnalyticTreeReport'][_0x7a9e('0x2e')]);_0x34b3e8[_0x7a9e('0x37')]=_[_0x7a9e('0x45')](_0x12f378[_0x7a9e('0x37')]);_0x34b3e8[_0x7a9e('0x3c')]=_[_0x7a9e('0x34')](_0x34b3e8[_0x7a9e('0x32')],_0x34b3e8[_0x7a9e('0x37')]);_0x529e35[_0x7a9e('0x35')]=_[_0x7a9e('0x34')](_0x34b3e8[_0x7a9e('0x32')],qs[_0x7a9e('0x36')](_0x12f378[_0x7a9e('0x37')]['fields']));_0x529e35[_0x7a9e('0x35')]=_0x529e35[_0x7a9e('0x35')][_0x7a9e('0x38')]?_0x529e35[_0x7a9e('0x35')]:_0x34b3e8['model'];if(_0x12f378[_0x7a9e('0x37')][_0x7a9e('0x3f')]){_0x529e35[_0x7a9e('0x40')]=[{'all':!![]}];}_0x529e35=_['merge']({},_0x529e35,_0x12f378['options']);return db['AnalyticTreeReport'][_0x7a9e('0x46')](_0x529e35)[_0x7a9e('0x26')](handleEntityNotFound(_0x27cccd,null))[_0x7a9e('0x26')](respondWithResult(_0x27cccd,null))[_0x7a9e('0x43')](handleError(_0x27cccd,null));};exports[_0x7a9e('0x47')]=function(_0x235e3,_0x2b5c32){return db['AnalyticTreeReport'][_0x7a9e('0x47')](_0x235e3[_0x7a9e('0x48')],{})[_0x7a9e('0x26')](respondWithResult(_0x2b5c32,0xc9))['catch'](handleError(_0x2b5c32,null));};exports[_0x7a9e('0x49')]=function(_0x2966a2,_0x3498e1){if(_0x2966a2[_0x7a9e('0x48')]['id']){delete _0x2966a2['body']['id'];}return db[_0x7a9e('0x2d')][_0x7a9e('0x46')]({'where':{'id':_0x2966a2[_0x7a9e('0x44')]['id']}})[_0x7a9e('0x26')](handleEntityNotFound(_0x3498e1,null))['then'](saveUpdates(_0x2966a2['body'],null))['then'](respondWithResult(_0x3498e1,null))['catch'](handleError(_0x3498e1,null));};exports[_0x7a9e('0x27')]=function(_0x1d6c20,_0x2ea9e0){return db[_0x7a9e('0x2d')]['find']({'where':{'id':_0x1d6c20[_0x7a9e('0x44')]['id']}})[_0x7a9e('0x26')](handleEntityNotFound(_0x2ea9e0,null))[_0x7a9e('0x26')](removeEntity(_0x2ea9e0,null))[_0x7a9e('0x43')](handleError(_0x2ea9e0,null));}; \ No newline at end of file +var _0x17f7=['rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport'];(function(_0x4b6cc8,_0x355e5b){var _0x5c4743=function(_0x68d0f6){while(--_0x68d0f6){_0x4b6cc8['push'](_0x4b6cc8['shift']());}};_0x5c4743(++_0x355e5b);}(_0x17f7,0xb3));var _0x717f=function(_0x10ffa7,_0x16f24a){_0x10ffa7=_0x10ffa7-0x0;var _0x2bd7a1=_0x17f7[_0x10ffa7];return _0x2bd7a1;};'use strict';var emlformat=require(_0x717f('0x0'));var rimraf=require(_0x717f('0x1'));var zipdir=require(_0x717f('0x2'));var jsonpatch=require(_0x717f('0x3'));var rp=require('request-promise');var moment=require(_0x717f('0x4'));var BPromise=require(_0x717f('0x5'));var Mustache=require('mustache');var util=require(_0x717f('0x6'));var path=require(_0x717f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x717f('0x8'));var fs=require('fs');var fs_extra=require(_0x717f('0x9'));var _=require('lodash');var squel=require(_0x717f('0xa'));var crypto=require('crypto');var jsforce=require(_0x717f('0xb'));var deskjs=require(_0x717f('0xc'));var toCsv=require(_0x717f('0xd'));var querystring=require(_0x717f('0xe'));var Papa=require(_0x717f('0xf'));var Redis=require(_0x717f('0x10'));var authService=require(_0x717f('0x11'));var qs=require(_0x717f('0x12'));var as=require(_0x717f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x717f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x717f('0x15'));var db=require(_0x717f('0x16'))['db'];function respondWithStatusCode(_0x24a034,_0x1bd659){_0x1bd659=_0x1bd659||0xcc;return function(_0x395225){if(_0x395225){return _0x24a034[_0x717f('0x17')](_0x1bd659);}return _0x24a034[_0x717f('0x18')](_0x1bd659)[_0x717f('0x19')]();};}function respondWithResult(_0x3963ea,_0x1fd2d1){_0x1fd2d1=_0x1fd2d1||0xc8;return function(_0x244c8a){if(_0x244c8a){return _0x3963ea[_0x717f('0x18')](_0x1fd2d1)['json'](_0x244c8a);}};}function respondWithFilteredResult(_0x2925b8,_0xa9f875){return function(_0x4f79e1){if(_0x4f79e1){var _0x2509b4=typeof _0xa9f875['offset']==='undefined'&&typeof _0xa9f875[_0x717f('0x1a')]===_0x717f('0x1b');var _0x65dab1=_0x4f79e1[_0x717f('0x1c')];var _0x2dbdc5=_0x2509b4?0x0:_0xa9f875[_0x717f('0x1d')];var _0x3f0731=_0x2509b4?_0x4f79e1['count']:_0xa9f875[_0x717f('0x1d')]+_0xa9f875['limit'];var _0x4971dc;if(_0x3f0731>=_0x65dab1){_0x3f0731=_0x65dab1;_0x4971dc=0xc8;}else{_0x4971dc=0xce;}_0x2925b8[_0x717f('0x18')](_0x4971dc);return _0x2925b8['set'](_0x717f('0x1e'),_0x2dbdc5+'-'+_0x3f0731+'/'+_0x65dab1)[_0x717f('0x1f')](_0x4f79e1);}return null;};}function patchUpdates(_0x51e3ba){return function(_0x4f89f1){try{jsonpatch[_0x717f('0x20')](_0x4f89f1,_0x51e3ba,!![]);}catch(_0x2980ff){return BPromise[_0x717f('0x21')](_0x2980ff);}return _0x4f89f1['save']();};}function saveUpdates(_0x54dadd,_0x2c5e93){return function(_0x319fe1){if(_0x319fe1){return _0x319fe1[_0x717f('0x22')](_0x54dadd)[_0x717f('0x23')](function(_0xbecce){return _0xbecce;});}return null;};}function removeEntity(_0x492f55,_0x4727d5){return function(_0x36157f){if(_0x36157f){return _0x36157f[_0x717f('0x24')]()[_0x717f('0x23')](function(){_0x492f55[_0x717f('0x18')](0xcc)[_0x717f('0x19')]();});}};}function handleEntityNotFound(_0x504efc,_0x44676d){return function(_0x30a7f3){if(!_0x30a7f3){_0x504efc[_0x717f('0x17')](0x194);}return _0x30a7f3;};}function handleError(_0x305598,_0xe99596){_0xe99596=_0xe99596||0x1f4;return function(_0xba09d1){logger[_0x717f('0x25')](_0xba09d1[_0x717f('0x26')]);if(_0xba09d1[_0x717f('0x27')]){delete _0xba09d1[_0x717f('0x27')];}_0x305598[_0x717f('0x18')](_0xe99596)[_0x717f('0x28')](_0xba09d1);};}exports['index']=function(_0x56b91e,_0xbbc317){var _0x3ee693={},_0x96da61={},_0xfb12b5={'count':0x0,'rows':[]};var _0x2f455c=_[_0x717f('0x29')](db[_0x717f('0x2a')][_0x717f('0x2b')],function(_0x474e10){return{'name':_0x474e10[_0x717f('0x2c')],'type':_0x474e10[_0x717f('0x2d')][_0x717f('0x2e')]};});_0x96da61['model']=_[_0x717f('0x29')](_0x2f455c,_0x717f('0x27'));_0x96da61[_0x717f('0x2f')]=_[_0x717f('0x30')](_0x56b91e[_0x717f('0x2f')]);_0x96da61['filters']=_[_0x717f('0x31')](_0x96da61['model'],_0x96da61[_0x717f('0x2f')]);_0x3ee693[_0x717f('0x32')]=_['intersection'](_0x96da61[_0x717f('0x33')],qs['fields'](_0x56b91e[_0x717f('0x2f')][_0x717f('0x34')]));_0x3ee693[_0x717f('0x32')]=_0x3ee693[_0x717f('0x32')][_0x717f('0x35')]?_0x3ee693['attributes']:_0x96da61['model'];if(!_0x56b91e[_0x717f('0x2f')][_0x717f('0x36')](_0x717f('0x37'))){_0x3ee693[_0x717f('0x1a')]=qs[_0x717f('0x1a')](_0x56b91e['query']['limit']);_0x3ee693[_0x717f('0x1d')]=qs[_0x717f('0x1d')](_0x56b91e[_0x717f('0x2f')][_0x717f('0x1d')]);}_0x3ee693[_0x717f('0x38')]=qs['sort'](_0x56b91e['query'][_0x717f('0x39')]);_0x3ee693[_0x717f('0x3a')]=qs[_0x717f('0x3b')](_[_0x717f('0x3c')](_0x56b91e[_0x717f('0x2f')],_0x96da61[_0x717f('0x3b')]),_0x2f455c);if(_0x56b91e[_0x717f('0x2f')][_0x717f('0x3d')]){_0x3ee693[_0x717f('0x3a')]=_['merge'](_0x3ee693[_0x717f('0x3a')],{'$or':_[_0x717f('0x29')](_0x2f455c,function(_0x410533){if(_0x410533[_0x717f('0x2d')]!==_0x717f('0x3e')){var _0x11dab3={};_0x11dab3[_0x410533[_0x717f('0x27')]]={'$like':'%'+_0x56b91e[_0x717f('0x2f')][_0x717f('0x3d')]+'%'};return _0x11dab3;}})});}_0x3ee693=_[_0x717f('0x3f')]({},_0x3ee693,_0x56b91e[_0x717f('0x40')]);var _0x26e2f9={'where':_0x3ee693['where']};return db[_0x717f('0x2a')]['count'](_0x26e2f9)[_0x717f('0x23')](function(_0x4e79e8){_0xfb12b5[_0x717f('0x1c')]=_0x4e79e8;if(_0x56b91e['query']['includeAll']){_0x3ee693[_0x717f('0x41')]=[{'all':!![]}];}return db[_0x717f('0x2a')][_0x717f('0x42')](_0x3ee693);})['then'](function(_0x4743c4){_0xfb12b5[_0x717f('0x43')]=_0x4743c4;return _0xfb12b5;})[_0x717f('0x23')](respondWithFilteredResult(_0xbbc317,_0x3ee693))['catch'](handleError(_0xbbc317,null));};exports[_0x717f('0x44')]=function(_0x44bd0,_0x598628){var _0x1c7860={'raw':!![],'where':{'id':_0x44bd0[_0x717f('0x45')]['id']}},_0x1a0601={};_0x1a0601[_0x717f('0x33')]=_[_0x717f('0x30')](db['AnalyticTreeReport'][_0x717f('0x2b')]);_0x1a0601[_0x717f('0x2f')]=_[_0x717f('0x30')](_0x44bd0[_0x717f('0x2f')]);_0x1a0601[_0x717f('0x3b')]=_['intersection'](_0x1a0601['model'],_0x1a0601[_0x717f('0x2f')]);_0x1c7860['attributes']=_['intersection'](_0x1a0601[_0x717f('0x33')],qs['fields'](_0x44bd0[_0x717f('0x2f')][_0x717f('0x34')]));_0x1c7860[_0x717f('0x32')]=_0x1c7860[_0x717f('0x32')][_0x717f('0x35')]?_0x1c7860['attributes']:_0x1a0601['model'];if(_0x44bd0['query']['includeAll']){_0x1c7860[_0x717f('0x41')]=[{'all':!![]}];}_0x1c7860=_[_0x717f('0x3f')]({},_0x1c7860,_0x44bd0[_0x717f('0x40')]);return db[_0x717f('0x2a')][_0x717f('0x46')](_0x1c7860)[_0x717f('0x23')](handleEntityNotFound(_0x598628,null))[_0x717f('0x23')](respondWithResult(_0x598628,null))['catch'](handleError(_0x598628,null));};exports[_0x717f('0x47')]=function(_0x52ddc7,_0x389595){return db[_0x717f('0x2a')]['create'](_0x52ddc7[_0x717f('0x48')],{})[_0x717f('0x23')](respondWithResult(_0x389595,0xc9))[_0x717f('0x49')](handleError(_0x389595,null));};exports[_0x717f('0x22')]=function(_0x21e565,_0x4dbc3a){if(_0x21e565[_0x717f('0x48')]['id']){delete _0x21e565[_0x717f('0x48')]['id'];}return db[_0x717f('0x2a')][_0x717f('0x46')]({'where':{'id':_0x21e565[_0x717f('0x45')]['id']}})[_0x717f('0x23')](handleEntityNotFound(_0x4dbc3a,null))['then'](saveUpdates(_0x21e565[_0x717f('0x48')],null))[_0x717f('0x23')](respondWithResult(_0x4dbc3a,null))[_0x717f('0x49')](handleError(_0x4dbc3a,null));};exports[_0x717f('0x24')]=function(_0x3652fa,_0x38eb1f){return db[_0x717f('0x2a')]['find']({'where':{'id':_0x3652fa[_0x717f('0x45')]['id']}})[_0x717f('0x23')](handleEntityNotFound(_0x38eb1f,null))[_0x717f('0x23')](removeEntity(_0x38eb1f,null))[_0x717f('0x49')](handleError(_0x38eb1f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index ed99622..f4fe575 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 _0xfb78=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x21cb9b,_0x5a2407){var _0x13a6fd=function(_0x1ff1da){while(--_0x1ff1da){_0x21cb9b['push'](_0x21cb9b['shift']());}};_0x13a6fd(++_0x5a2407);}(_0xfb78,0x8d));var _0x8fb7=function(_0x44044a,_0x3a0097){_0x44044a=_0x44044a-0x0;var _0x43bb6e=_0xfb78[_0x44044a];return _0x43bb6e;};'use strict';var _=require(_0x8fb7('0x0'));var util=require(_0x8fb7('0x1'));var logger=require(_0x8fb7('0x2'))(_0x8fb7('0x3'));var moment=require(_0x8fb7('0x4'));var BPromise=require(_0x8fb7('0x5'));var rp=require(_0x8fb7('0x6'));var fs=require('fs');var path=require(_0x8fb7('0x7'));var rimraf=require(_0x8fb7('0x8'));var config=require(_0x8fb7('0x9'));var attributes=require(_0x8fb7('0xa'));module[_0x8fb7('0xb')]=function(_0x38ce80,_0x5b8834){return _0x38ce80[_0x8fb7('0xc')](_0x8fb7('0xd'),attributes,{'tableName':_0x8fb7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbd7=['path','../../config/environment','exports','define','AnalyticTreeReport','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0xcbd7,0x1c8));var _0x7cbd=function(_0x54810f,_0x6da227){_0x54810f=_0x54810f-0x0;var _0x3e04fa=_0xcbd7[_0x54810f];return _0x3e04fa;};'use strict';var _=require(_0x7cbd('0x0'));var util=require('util');var logger=require(_0x7cbd('0x1'))(_0x7cbd('0x2'));var moment=require(_0x7cbd('0x3'));var BPromise=require(_0x7cbd('0x4'));var rp=require(_0x7cbd('0x5'));var fs=require('fs');var path=require(_0x7cbd('0x6'));var rimraf=require('rimraf');var config=require(_0x7cbd('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x7cbd('0x8')]=function(_0x19f53d,_0x5760d4){return _0x19f53d[_0x7cbd('0x9')](_0x7cbd('0xa'),attributes,{'tableName':'analytics_report_trees','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 ddb4757..1ad0e75 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x493049,_0x15e22d){var _0x10c1c7=function(_0x15d34e){while(--_0x15d34e){_0x493049['push'](_0x493049['shift']());}};_0x10c1c7(++_0x15e22d);}(_0x1261,0x144));var _0x1126=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0x1261[_0x57dc85];return _0x563a2e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x38b9eb,_0x298f2f){var _0x1426da=function(_0xbad634){while(--_0xbad634){_0x38b9eb['push'](_0x38b9eb['shift']());}};_0x1426da(++_0x298f2f);}(_0x2ef3,0xba));var _0x32ef=function(_0x3fcc36,_0x10fb08){_0x3fcc36=_0x3fcc36-0x0;var _0x2adc58=_0x2ef3[_0x3fcc36];return _0x2adc58;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 71711e8..ab1d915 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 _0xe040=['post','create','put','update','delete','destroy','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe040,0x1af));var _0x0e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe040[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0e04('0x0'));var timeout=require('connect-timeout');var express=require(_0x0e04('0x1'));var router=express[_0x0e04('0x2')]();var fs_extra=require(_0x0e04('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0e04('0x4'));var config=require(_0x0e04('0x5'));var controller=require(_0x0e04('0x6'));router[_0x0e04('0x7')]('/',auth[_0x0e04('0x8')](),controller['index']);router[_0x0e04('0x7')](_0x0e04('0x9'),auth[_0x0e04('0x8')](),controller[_0x0e04('0xa')]);router[_0x0e04('0xb')]('/',auth[_0x0e04('0x8')](),controller[_0x0e04('0xc')]);router[_0x0e04('0xd')](_0x0e04('0x9'),auth['isAuthenticated'](),controller[_0x0e04('0xe')]);router[_0x0e04('0xf')](_0x0e04('0x9'),auth[_0x0e04('0x8')](),controller[_0x0e04('0x10')]);module['exports']=router; \ No newline at end of file +var _0x120d=['create','delete','destroy','exports','express','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0x120d,0x1a6));var _0xd120=function(_0x28b4cd,_0x573ff1){_0x28b4cd=_0x28b4cd-0x0;var _0x4229cc=_0x120d[_0x28b4cd];return _0x4229cc;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd120('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd120('0x1'));var controller=require('./analyticTreeReport.controller');router[_0xd120('0x2')]('/',auth[_0xd120('0x3')](),controller[_0xd120('0x4')]);router[_0xd120('0x2')](_0xd120('0x5'),auth[_0xd120('0x3')](),controller['show']);router[_0xd120('0x6')]('/',auth[_0xd120('0x3')](),controller[_0xd120('0x7')]);router['put'](_0xd120('0x5'),auth[_0xd120('0x3')](),controller['update']);router[_0xd120('0x8')](_0xd120('0x5'),auth['isAuthenticated'](),controller[_0xd120('0x9')]);module[_0xd120('0xa')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index fb61029..a47a289 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 _0xeb79=['STRING'];(function(_0x14b004,_0x297060){var _0x3d501f=function(_0x4a38ac){while(--_0x4a38ac){_0x14b004['push'](_0x14b004['shift']());}};_0x3d501f(++_0x297060);}(_0xeb79,0x87));var _0x9eb7=function(_0x11d10f,_0x275d65){_0x11d10f=_0x11d10f-0x0;var _0x4f3a86=_0xeb79[_0x11d10f];return _0x4f3a86;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9eb7('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9eb7('0x0')]}}; \ No newline at end of file +var _0xa3e6=['sequelize','STRING'];(function(_0x47a41f,_0x48d92b){var _0x2411f5=function(_0x3f5b72){while(--_0x3f5b72){_0x47a41f['push'](_0x47a41f['shift']());}};_0x2411f5(++_0x48d92b);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x5130dc,_0x1901d5){_0x5130dc=_0x5130dc-0x0;var _0x145729=_0xa3e6[_0x5130dc];return _0x145729;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a3e('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a3e('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 291e96d..a5f93f4 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 _0x2f31=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','then','end','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','options','get','updatedAt','omit','body','createdAt','update','find','params','create','file','originalname','basename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x2f31,0x100));var _0x12f3=function(_0x58404e,_0x179d39){_0x58404e=_0x58404e-0x0;var _0x436571=_0x2f31[_0x58404e];return _0x436571;};'use strict';var emlformat=require(_0x12f3('0x0'));var rimraf=require(_0x12f3('0x1'));var zipdir=require(_0x12f3('0x2'));var jsonpatch=require(_0x12f3('0x3'));var rp=require(_0x12f3('0x4'));var moment=require(_0x12f3('0x5'));var BPromise=require(_0x12f3('0x6'));var Mustache=require(_0x12f3('0x7'));var util=require('util');var path=require(_0x12f3('0x8'));var sox=require(_0x12f3('0x9'));var csv=require(_0x12f3('0xa'));var ejs=require(_0x12f3('0xb'));var fs=require('fs');var fs_extra=require(_0x12f3('0xc'));var _=require(_0x12f3('0xd'));var squel=require('squel');var crypto=require(_0x12f3('0xe'));var jsforce=require(_0x12f3('0xf'));var deskjs=require(_0x12f3('0x10'));var toCsv=require(_0x12f3('0xa'));var querystring=require(_0x12f3('0x11'));var Papa=require(_0x12f3('0x12'));var Redis=require(_0x12f3('0x13'));var authService=require(_0x12f3('0x14'));var qs=require(_0x12f3('0x15'));var as=require(_0x12f3('0x16'));var hardwareService=require(_0x12f3('0x17'));var logger=require(_0x12f3('0x18'))(_0x12f3('0x19'));var utils=require(_0x12f3('0x1a'));var config=require(_0x12f3('0x1b'));var licenseUtil=require(_0x12f3('0x1c'));var db=require(_0x12f3('0x1d'))['db'];function respondWithStatusCode(_0x486961,_0x193461){_0x193461=_0x193461||0xcc;return function(_0x1e5f63){if(_0x1e5f63){return _0x486961[_0x12f3('0x1e')](_0x193461);}return _0x486961[_0x12f3('0x1f')](_0x193461)['end']();};}function respondWithResult(_0x2685d6,_0x2d5722){_0x2d5722=_0x2d5722||0xc8;return function(_0x582b8e){if(_0x582b8e){return _0x2685d6[_0x12f3('0x1f')](_0x2d5722)['json'](_0x582b8e);}};}function respondWithFilteredResult(_0x1e6788,_0x2fd376){return function(_0x431806){if(_0x431806){var _0x5aba51=typeof _0x2fd376[_0x12f3('0x20')]==='undefined'&&typeof _0x2fd376['limit']===_0x12f3('0x21');var _0x2a6aef=_0x431806[_0x12f3('0x22')];var _0x1a7ab0=_0x5aba51?0x0:_0x2fd376[_0x12f3('0x20')];var _0x253ab8=_0x5aba51?_0x431806[_0x12f3('0x22')]:_0x2fd376[_0x12f3('0x20')]+_0x2fd376[_0x12f3('0x23')];var _0x1dfd79;if(_0x253ab8>=_0x2a6aef){_0x253ab8=_0x2a6aef;_0x1dfd79=0xc8;}else{_0x1dfd79=0xce;}_0x1e6788[_0x12f3('0x1f')](_0x1dfd79);return _0x1e6788[_0x12f3('0x24')](_0x12f3('0x25'),_0x1a7ab0+'-'+_0x253ab8+'/'+_0x2a6aef)['json'](_0x431806);}return null;};}function patchUpdates(_0x56f3ae){return function(_0x4b7df3){try{jsonpatch[_0x12f3('0x26')](_0x4b7df3,_0x56f3ae,!![]);}catch(_0x20b50b){return BPromise[_0x12f3('0x27')](_0x20b50b);}return _0x4b7df3['save']();};}function saveUpdates(_0x14d297,_0x17fadc){return function(_0x3b378a){if(_0x3b378a){return _0x3b378a['update'](_0x14d297)['then'](function(_0x5ed878){return _0x5ed878;});}return null;};}function removeEntity(_0x5ca832,_0x28a13b){return function(_0x3ef402){if(_0x3ef402){return _0x3ef402['destroy']()[_0x12f3('0x28')](function(){_0x5ca832['status'](0xcc)[_0x12f3('0x29')]();});}};}function handleEntityNotFound(_0x465e9d,_0x1ade23){return function(_0x18807b){if(!_0x18807b){_0x465e9d['sendStatus'](0x194);}return _0x18807b;};}function handleError(_0x4c11fb,_0x21bc2e){_0x21bc2e=_0x21bc2e||0x1f4;return function(_0x1c73b8){logger[_0x12f3('0x2a')](_0x1c73b8[_0x12f3('0x2b')]);if(_0x1c73b8[_0x12f3('0x2c')]){delete _0x1c73b8[_0x12f3('0x2c')];}_0x4c11fb[_0x12f3('0x1f')](_0x21bc2e)[_0x12f3('0x2d')](_0x1c73b8);};}exports[_0x12f3('0x2e')]=function(_0x115e98,_0x3cbee1){var _0xcf00f5={},_0x231e33={},_0x352f77={'count':0x0,'rows':[]};var _0x156fb4=_['map'](db[_0x12f3('0x2f')][_0x12f3('0x30')],function(_0x3a8d68){return{'name':_0x3a8d68[_0x12f3('0x31')],'type':_0x3a8d68['type'][_0x12f3('0x32')]};});_0x231e33[_0x12f3('0x33')]=_[_0x12f3('0x34')](_0x156fb4,_0x12f3('0x2c'));_0x231e33['query']=_[_0x12f3('0x35')](_0x115e98['query']);_0x231e33[_0x12f3('0x36')]=_[_0x12f3('0x37')](_0x231e33['model'],_0x231e33[_0x12f3('0x38')]);_0xcf00f5['attributes']=_[_0x12f3('0x37')](_0x231e33[_0x12f3('0x33')],qs[_0x12f3('0x39')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x39')]));_0xcf00f5[_0x12f3('0x3a')]=_0xcf00f5['attributes'][_0x12f3('0x3b')]?_0xcf00f5[_0x12f3('0x3a')]:_0x231e33[_0x12f3('0x33')];if(!_0x115e98[_0x12f3('0x38')][_0x12f3('0x3c')]('nolimit')){_0xcf00f5[_0x12f3('0x23')]=qs[_0x12f3('0x23')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x23')]);_0xcf00f5['offset']=qs[_0x12f3('0x20')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x20')]);}_0xcf00f5[_0x12f3('0x3d')]=qs[_0x12f3('0x3e')](_0x115e98[_0x12f3('0x38')][_0x12f3('0x3e')]);_0xcf00f5[_0x12f3('0x3f')]=qs['filters'](_['pick'](_0x115e98[_0x12f3('0x38')],_0x231e33[_0x12f3('0x36')]),_0x156fb4);if(_0x115e98[_0x12f3('0x38')]['filter']){_0xcf00f5[_0x12f3('0x3f')]=_[_0x12f3('0x40')](_0xcf00f5[_0x12f3('0x3f')],{'$or':_[_0x12f3('0x34')](_0x156fb4,function(_0x41cc9d){if(_0x41cc9d[_0x12f3('0x41')]!==_0x12f3('0x42')){var _0xefa749={};_0xefa749[_0x41cc9d['name']]={'$like':'%'+_0x115e98[_0x12f3('0x38')][_0x12f3('0x43')]+'%'};return _0xefa749;}})});}_0xcf00f5=_['merge']({},_0xcf00f5,_0x115e98['options']);var _0x28e32a={'where':_0xcf00f5[_0x12f3('0x3f')]};return db[_0x12f3('0x2f')][_0x12f3('0x22')](_0x28e32a)[_0x12f3('0x28')](function(_0x388fad){_0x352f77[_0x12f3('0x22')]=_0x388fad;if(_0x115e98[_0x12f3('0x38')][_0x12f3('0x44')]){_0xcf00f5[_0x12f3('0x45')]=[{'all':!![]}];}return db[_0x12f3('0x2f')]['findAll'](_0xcf00f5);})[_0x12f3('0x28')](function(_0x5d0867){_0x352f77[_0x12f3('0x46')]=_0x5d0867;return _0x352f77;})[_0x12f3('0x28')](respondWithFilteredResult(_0x3cbee1,_0xcf00f5))[_0x12f3('0x47')](handleError(_0x3cbee1,null));};exports[_0x12f3('0x48')]=function(_0xd5dea7,_0x400fcb){var _0x498ac2={'raw':!![],'where':{'id':_0xd5dea7['params']['id']}},_0x57cfcb={};_0x57cfcb['model']=_[_0x12f3('0x35')](db['Attachment'][_0x12f3('0x30')]);_0x57cfcb['query']=_[_0x12f3('0x35')](_0xd5dea7[_0x12f3('0x38')]);_0x57cfcb[_0x12f3('0x36')]=_[_0x12f3('0x37')](_0x57cfcb[_0x12f3('0x33')],_0x57cfcb[_0x12f3('0x38')]);_0x498ac2[_0x12f3('0x3a')]=_[_0x12f3('0x37')](_0x57cfcb['model'],qs['fields'](_0xd5dea7[_0x12f3('0x38')][_0x12f3('0x39')]));_0x498ac2['attributes']=_0x498ac2[_0x12f3('0x3a')]['length']?_0x498ac2[_0x12f3('0x3a')]:_0x57cfcb['model'];if(_0xd5dea7[_0x12f3('0x38')][_0x12f3('0x44')]){_0x498ac2[_0x12f3('0x45')]=[{'all':!![]}];}_0x498ac2=_[_0x12f3('0x40')]({},_0x498ac2,_0xd5dea7['options']);return db['Attachment']['find'](_0x498ac2)[_0x12f3('0x28')](handleEntityNotFound(_0x400fcb,null))[_0x12f3('0x28')](respondWithResult(_0x400fcb,null))[_0x12f3('0x47')](handleError(_0x400fcb,null));};exports['clone']=function(_0x278cc8,_0x590753){var _0x1ad71b={'where':{'id':_0x278cc8['params']['id']}},_0x16d31b={};_0x16d31b[_0x12f3('0x33')]=_[_0x12f3('0x35')](db['Attachment']['rawAttributes']);_0x1ad71b[_0x12f3('0x3a')]=_[_0x12f3('0x37')](_0x16d31b['model'],qs[_0x12f3('0x39')](_0x278cc8['query'][_0x12f3('0x39')]));_0x1ad71b[_0x12f3('0x3a')]=_0x1ad71b[_0x12f3('0x3a')][_0x12f3('0x3b')]?_0x1ad71b['attributes']:_0x16d31b[_0x12f3('0x33')];if(_0x278cc8[_0x12f3('0x38')][_0x12f3('0x44')]){_0x1ad71b[_0x12f3('0x45')]=[{'all':!![]}];}_0x1ad71b=_['merge']({},_0x1ad71b,_0x278cc8[_0x12f3('0x49')]);return db[_0x12f3('0x2f')]['find'](_0x1ad71b)[_0x12f3('0x28')](handleEntityNotFound(_0x590753,null))['then'](function(_0xc44fd1){if(_0xc44fd1){var _0x307f4c=_0xc44fd1[_0x12f3('0x4a')]({'plain':!![]});_0x307f4c=qs['omit'](_0x307f4c,['id','createdAt',_0x12f3('0x4b')]);_0x278cc8['body']=_[_0x12f3('0x4c')](_0x278cc8[_0x12f3('0x4d')],['id',_0x12f3('0x4e'),_0x12f3('0x4b')]);return db[_0x12f3('0x2f')]['create'](_[_0x12f3('0x40')](_0x307f4c,_0x278cc8[_0x12f3('0x4d')]),{'include':_0x278cc8[_0x12f3('0x38')][_0x12f3('0x44')]?[{'all':!![]}]:undefined});}})[_0x12f3('0x28')](respondWithResult(_0x590753,0xc9))[_0x12f3('0x47')](handleError(_0x590753,null));};exports[_0x12f3('0x4f')]=function(_0x21b1ab,_0x17c04b){if(_0x21b1ab['body']['id']){delete _0x21b1ab[_0x12f3('0x4d')]['id'];}return db[_0x12f3('0x2f')][_0x12f3('0x50')]({'where':{'id':_0x21b1ab[_0x12f3('0x51')]['id']}})['then'](handleEntityNotFound(_0x17c04b,null))[_0x12f3('0x28')](saveUpdates(_0x21b1ab['body'],null))['then'](respondWithResult(_0x17c04b,null))[_0x12f3('0x47')](handleError(_0x17c04b,null));};exports['destroy']=function(_0x2162b3,_0x521a75){return db['Attachment']['find']({'where':{'id':_0x2162b3[_0x12f3('0x51')]['id']}})[_0x12f3('0x28')](handleEntityNotFound(_0x521a75,null))[_0x12f3('0x28')](removeEntity(_0x521a75,null))[_0x12f3('0x47')](handleError(_0x521a75,null));};exports[_0x12f3('0x52')]=function(_0x5c24c3,_0x301e35,_0x520990){_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x2c')]=_0x5c24c3[_0x12f3('0x53')][_0x12f3('0x54')];_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x55')]=_0x5c24c3[_0x12f3('0x53')]['filename'];_0x5c24c3[_0x12f3('0x4d')][_0x12f3('0x41')]=_0x5c24c3['file']['mimetype'];return db[_0x12f3('0x2f')][_0x12f3('0x52')](_0x5c24c3[_0x12f3('0x4d')])[_0x12f3('0x28')](respondWithResult(_0x301e35,0xc9))[_0x12f3('0x47')](handleError(_0x301e35,null));};exports['download']=function(_0x58ca65,_0x5ecda0,_0x261fb8){return db[_0x12f3('0x2f')][_0x12f3('0x56')]({'where':{'id':_0x58ca65[_0x12f3('0x51')]['id']},'raw':!![]})[_0x12f3('0x28')](handleEntityNotFound(_0x5ecda0,null))['then'](function(_0xf1e178){if(_0xf1e178){var _0x20f6e4=_0xf1e178[_0x12f3('0x57')]!==null;var _0x5cdf26=path[_0x12f3('0x58')](config[_0x12f3('0x59')],_0x12f3('0x5a'));if(_0x20f6e4){_0x5cdf26=path['join'](_0x5cdf26,_0x12f3('0x5b'));}var _0x192603=path[_0x12f3('0x58')](_0x5cdf26,_0xf1e178['basename']);return _0x5ecda0[_0x12f3('0x5c')](_0x192603);}})[_0x12f3('0x47')](handleError(_0x5ecda0,null));}; \ No newline at end of file +var _0xe342=['fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','Attachment','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','clone','params','find','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe342,0x14f));var _0x2e34=function(_0x2df523,_0x11b09e){_0x2df523=_0x2df523-0x0;var _0x43f919=_0xe342[_0x2df523];return _0x43f919;};'use strict';var emlformat=require(_0x2e34('0x0'));var rimraf=require(_0x2e34('0x1'));var zipdir=require(_0x2e34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2e34('0x3'));var Mustache=require(_0x2e34('0x4'));var util=require(_0x2e34('0x5'));var path=require(_0x2e34('0x6'));var sox=require(_0x2e34('0x7'));var csv=require('to-csv');var ejs=require(_0x2e34('0x8'));var fs=require('fs');var fs_extra=require(_0x2e34('0x9'));var _=require('lodash');var squel=require(_0x2e34('0xa'));var crypto=require(_0x2e34('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2e34('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e34('0xd'));var Redis=require(_0x2e34('0xe'));var authService=require(_0x2e34('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2e34('0x10'));var hardwareService=require(_0x2e34('0x11'));var logger=require('../../config/logger')(_0x2e34('0x12'));var utils=require('../../config/utils');var config=require(_0x2e34('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e34('0x14'))['db'];function respondWithStatusCode(_0x26a41a,_0x2cd9ee){_0x2cd9ee=_0x2cd9ee||0xcc;return function(_0x4f943f){if(_0x4f943f){return _0x26a41a['sendStatus'](_0x2cd9ee);}return _0x26a41a[_0x2e34('0x15')](_0x2cd9ee)['end']();};}function respondWithResult(_0x2c9625,_0x11b283){_0x11b283=_0x11b283||0xc8;return function(_0x23e3d3){if(_0x23e3d3){return _0x2c9625['status'](_0x11b283)[_0x2e34('0x16')](_0x23e3d3);}};}function respondWithFilteredResult(_0x3470b5,_0x1eaf41){return function(_0x12f975){if(_0x12f975){var _0x28dbe0=typeof _0x1eaf41[_0x2e34('0x17')]===_0x2e34('0x18')&&typeof _0x1eaf41['limit']===_0x2e34('0x18');var _0x510265=_0x12f975[_0x2e34('0x19')];var _0x178fbc=_0x28dbe0?0x0:_0x1eaf41[_0x2e34('0x17')];var _0x252be4=_0x28dbe0?_0x12f975['count']:_0x1eaf41[_0x2e34('0x17')]+_0x1eaf41[_0x2e34('0x1a')];var _0x10edd5;if(_0x252be4>=_0x510265){_0x252be4=_0x510265;_0x10edd5=0xc8;}else{_0x10edd5=0xce;}_0x3470b5[_0x2e34('0x15')](_0x10edd5);return _0x3470b5['set'](_0x2e34('0x1b'),_0x178fbc+'-'+_0x252be4+'/'+_0x510265)[_0x2e34('0x16')](_0x12f975);}return null;};}function patchUpdates(_0x1575c9){return function(_0x50b9b8){try{jsonpatch[_0x2e34('0x1c')](_0x50b9b8,_0x1575c9,!![]);}catch(_0x4df389){return BPromise[_0x2e34('0x1d')](_0x4df389);}return _0x50b9b8[_0x2e34('0x1e')]();};}function saveUpdates(_0x5712ff,_0x527478){return function(_0xf635d2){if(_0xf635d2){return _0xf635d2[_0x2e34('0x1f')](_0x5712ff)[_0x2e34('0x20')](function(_0x48477b){return _0x48477b;});}return null;};}function removeEntity(_0x146290,_0x51e2fb){return function(_0xede190){if(_0xede190){return _0xede190[_0x2e34('0x21')]()[_0x2e34('0x20')](function(){_0x146290['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53dc55,_0x28e4fa){return function(_0x36f3df){if(!_0x36f3df){_0x53dc55[_0x2e34('0x22')](0x194);}return _0x36f3df;};}function handleError(_0x2eeb8c,_0x3776bd){_0x3776bd=_0x3776bd||0x1f4;return function(_0x35909d){logger['error'](_0x35909d[_0x2e34('0x23')]);if(_0x35909d[_0x2e34('0x24')]){delete _0x35909d['name'];}_0x2eeb8c['status'](_0x3776bd)[_0x2e34('0x25')](_0x35909d);};}exports['index']=function(_0xee938c,_0x27422b){var _0xf9611d={},_0x1efb1d={},_0x5743fe={'count':0x0,'rows':[]};var _0x5edae3=_[_0x2e34('0x26')](db[_0x2e34('0x27')][_0x2e34('0x28')],function(_0x372e7b){return{'name':_0x372e7b[_0x2e34('0x29')],'type':_0x372e7b['type']['key']};});_0x1efb1d[_0x2e34('0x2a')]=_[_0x2e34('0x26')](_0x5edae3,_0x2e34('0x24'));_0x1efb1d['query']=_[_0x2e34('0x2b')](_0xee938c[_0x2e34('0x2c')]);_0x1efb1d[_0x2e34('0x2d')]=_[_0x2e34('0x2e')](_0x1efb1d[_0x2e34('0x2a')],_0x1efb1d[_0x2e34('0x2c')]);_0xf9611d[_0x2e34('0x2f')]=_[_0x2e34('0x2e')](_0x1efb1d[_0x2e34('0x2a')],qs[_0x2e34('0x30')](_0xee938c[_0x2e34('0x2c')]['fields']));_0xf9611d['attributes']=_0xf9611d[_0x2e34('0x2f')][_0x2e34('0x31')]?_0xf9611d[_0x2e34('0x2f')]:_0x1efb1d[_0x2e34('0x2a')];if(!_0xee938c[_0x2e34('0x2c')][_0x2e34('0x32')](_0x2e34('0x33'))){_0xf9611d[_0x2e34('0x1a')]=qs[_0x2e34('0x1a')](_0xee938c[_0x2e34('0x2c')][_0x2e34('0x1a')]);_0xf9611d[_0x2e34('0x17')]=qs[_0x2e34('0x17')](_0xee938c['query']['offset']);}_0xf9611d[_0x2e34('0x34')]=qs[_0x2e34('0x35')](_0xee938c[_0x2e34('0x2c')][_0x2e34('0x35')]);_0xf9611d[_0x2e34('0x36')]=qs[_0x2e34('0x2d')](_[_0x2e34('0x37')](_0xee938c[_0x2e34('0x2c')],_0x1efb1d[_0x2e34('0x2d')]),_0x5edae3);if(_0xee938c[_0x2e34('0x2c')][_0x2e34('0x38')]){_0xf9611d[_0x2e34('0x36')]=_[_0x2e34('0x39')](_0xf9611d[_0x2e34('0x36')],{'$or':_[_0x2e34('0x26')](_0x5edae3,function(_0xcbf3f8){if(_0xcbf3f8[_0x2e34('0x3a')]!==_0x2e34('0x3b')){var _0x5dde2c={};_0x5dde2c[_0xcbf3f8[_0x2e34('0x24')]]={'$like':'%'+_0xee938c['query'][_0x2e34('0x38')]+'%'};return _0x5dde2c;}})});}_0xf9611d=_['merge']({},_0xf9611d,_0xee938c[_0x2e34('0x3c')]);var _0x3ae9b4={'where':_0xf9611d['where']};return db[_0x2e34('0x27')][_0x2e34('0x19')](_0x3ae9b4)[_0x2e34('0x20')](function(_0xfd0c1e){_0x5743fe['count']=_0xfd0c1e;if(_0xee938c[_0x2e34('0x2c')][_0x2e34('0x3d')]){_0xf9611d[_0x2e34('0x3e')]=[{'all':!![]}];}return db[_0x2e34('0x27')]['findAll'](_0xf9611d);})[_0x2e34('0x20')](function(_0x2e9c9c){_0x5743fe[_0x2e34('0x3f')]=_0x2e9c9c;return _0x5743fe;})['then'](respondWithFilteredResult(_0x27422b,_0xf9611d))[_0x2e34('0x40')](handleError(_0x27422b,null));};exports[_0x2e34('0x41')]=function(_0x45665c,_0x4d9685){var _0x51b306={'raw':!![],'where':{'id':_0x45665c['params']['id']}},_0x5ad312={};_0x5ad312['model']=_[_0x2e34('0x2b')](db['Attachment'][_0x2e34('0x28')]);_0x5ad312[_0x2e34('0x2c')]=_[_0x2e34('0x2b')](_0x45665c[_0x2e34('0x2c')]);_0x5ad312[_0x2e34('0x2d')]=_[_0x2e34('0x2e')](_0x5ad312[_0x2e34('0x2a')],_0x5ad312[_0x2e34('0x2c')]);_0x51b306[_0x2e34('0x2f')]=_['intersection'](_0x5ad312['model'],qs[_0x2e34('0x30')](_0x45665c[_0x2e34('0x2c')][_0x2e34('0x30')]));_0x51b306[_0x2e34('0x2f')]=_0x51b306[_0x2e34('0x2f')][_0x2e34('0x31')]?_0x51b306[_0x2e34('0x2f')]:_0x5ad312[_0x2e34('0x2a')];if(_0x45665c[_0x2e34('0x2c')][_0x2e34('0x3d')]){_0x51b306[_0x2e34('0x3e')]=[{'all':!![]}];}_0x51b306=_['merge']({},_0x51b306,_0x45665c[_0x2e34('0x3c')]);return db[_0x2e34('0x27')]['find'](_0x51b306)[_0x2e34('0x20')](handleEntityNotFound(_0x4d9685,null))[_0x2e34('0x20')](respondWithResult(_0x4d9685,null))[_0x2e34('0x40')](handleError(_0x4d9685,null));};exports[_0x2e34('0x42')]=function(_0x4deccf,_0xefe9d0){var _0x1d9b8d={'where':{'id':_0x4deccf[_0x2e34('0x43')]['id']}},_0x821c13={};_0x821c13[_0x2e34('0x2a')]=_[_0x2e34('0x2b')](db[_0x2e34('0x27')][_0x2e34('0x28')]);_0x1d9b8d[_0x2e34('0x2f')]=_[_0x2e34('0x2e')](_0x821c13['model'],qs[_0x2e34('0x30')](_0x4deccf[_0x2e34('0x2c')][_0x2e34('0x30')]));_0x1d9b8d[_0x2e34('0x2f')]=_0x1d9b8d[_0x2e34('0x2f')][_0x2e34('0x31')]?_0x1d9b8d[_0x2e34('0x2f')]:_0x821c13[_0x2e34('0x2a')];if(_0x4deccf['query'][_0x2e34('0x3d')]){_0x1d9b8d['include']=[{'all':!![]}];}_0x1d9b8d=_[_0x2e34('0x39')]({},_0x1d9b8d,_0x4deccf[_0x2e34('0x3c')]);return db[_0x2e34('0x27')][_0x2e34('0x44')](_0x1d9b8d)[_0x2e34('0x20')](handleEntityNotFound(_0xefe9d0,null))[_0x2e34('0x20')](function(_0x1eb4e2){if(_0x1eb4e2){var _0x564b33=_0x1eb4e2['get']({'plain':!![]});_0x564b33=qs[_0x2e34('0x45')](_0x564b33,['id',_0x2e34('0x46'),_0x2e34('0x47')]);_0x4deccf[_0x2e34('0x48')]=_['omit'](_0x4deccf[_0x2e34('0x48')],['id','createdAt',_0x2e34('0x47')]);return db[_0x2e34('0x27')][_0x2e34('0x49')](_['merge'](_0x564b33,_0x4deccf[_0x2e34('0x48')]),{'include':_0x4deccf['query'][_0x2e34('0x3d')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xefe9d0,0xc9))[_0x2e34('0x40')](handleError(_0xefe9d0,null));};exports[_0x2e34('0x1f')]=function(_0x2faee6,_0x48e91b){if(_0x2faee6['body']['id']){delete _0x2faee6['body']['id'];}return db['Attachment'][_0x2e34('0x44')]({'where':{'id':_0x2faee6[_0x2e34('0x43')]['id']}})[_0x2e34('0x20')](handleEntityNotFound(_0x48e91b,null))['then'](saveUpdates(_0x2faee6['body'],null))['then'](respondWithResult(_0x48e91b,null))[_0x2e34('0x40')](handleError(_0x48e91b,null));};exports[_0x2e34('0x21')]=function(_0x5b364a,_0x341bb8){return db['Attachment']['find']({'where':{'id':_0x5b364a[_0x2e34('0x43')]['id']}})['then'](handleEntityNotFound(_0x341bb8,null))[_0x2e34('0x20')](removeEntity(_0x341bb8,null))['catch'](handleError(_0x341bb8,null));};exports[_0x2e34('0x49')]=function(_0x2b4845,_0x4690e5,_0x588af1){_0x2b4845['body'][_0x2e34('0x24')]=_0x2b4845['file'][_0x2e34('0x4a')];_0x2b4845[_0x2e34('0x48')][_0x2e34('0x4b')]=_0x2b4845[_0x2e34('0x4c')][_0x2e34('0x4d')];_0x2b4845[_0x2e34('0x48')][_0x2e34('0x3a')]=_0x2b4845[_0x2e34('0x4c')][_0x2e34('0x4e')];return db[_0x2e34('0x27')][_0x2e34('0x49')](_0x2b4845[_0x2e34('0x48')])['then'](respondWithResult(_0x4690e5,0xc9))[_0x2e34('0x40')](handleError(_0x4690e5,null));};exports[_0x2e34('0x4f')]=function(_0x2ef8aa,_0x108a8d,_0x1a5fab){return db['Attachment'][_0x2e34('0x50')]({'where':{'id':_0x2ef8aa[_0x2e34('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x108a8d,null))[_0x2e34('0x20')](function(_0x22ce4d){if(_0x22ce4d){var _0x58e3cb=_0x22ce4d[_0x2e34('0x51')]!==null;var _0x1fd2a1=path[_0x2e34('0x52')](config[_0x2e34('0x53')],_0x2e34('0x54'));if(_0x58e3cb){_0x1fd2a1=path[_0x2e34('0x52')](_0x1fd2a1,_0x2e34('0x55'));}var _0x177d78=path[_0x2e34('0x52')](_0x1fd2a1,_0x22ce4d[_0x2e34('0x4b')]);return _0x108a8d[_0x2e34('0x4f')](_0x177d78);}})[_0x2e34('0x40')](handleError(_0x108a8d,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 2079804..81016fb 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 _0xc9be=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger','api','moment'];(function(_0x1c12b9,_0x2e14ed){var _0x2784ec=function(_0x4efebc){while(--_0x4efebc){_0x1c12b9['push'](_0x1c12b9['shift']());}};_0x2784ec(++_0x2e14ed);}(_0xc9be,0xf8));var _0xec9b=function(_0x3a1f2b,_0x1c6ea2){_0x3a1f2b=_0x3a1f2b-0x0;var _0x2c569b=_0xc9be[_0x3a1f2b];return _0x2c569b;};'use strict';var _=require('lodash');var util=require(_0xec9b('0x0'));var logger=require(_0xec9b('0x1'))(_0xec9b('0x2'));var moment=require(_0xec9b('0x3'));var BPromise=require(_0xec9b('0x4'));var rp=require(_0xec9b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec9b('0x6'));var config=require(_0xec9b('0x7'));var attributes=require(_0xec9b('0x8'));module[_0xec9b('0x9')]=function(_0x9d0472,_0x348c81){return _0x9d0472[_0xec9b('0xa')]('Attachment',attributes,{'tableName':_0xec9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e57=['request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','util','api'];(function(_0x22b70c,_0x297ae6){var _0x3fb6c7=function(_0x1162e2){while(--_0x1162e2){_0x22b70c['push'](_0x22b70c['shift']());}};_0x3fb6c7(++_0x297ae6);}(_0x7e57,0x1e7));var _0x77e5=function(_0x5b1c58,_0x29581b){_0x5b1c58=_0x5b1c58-0x0;var _0x2e25d3=_0x7e57[_0x5b1c58];return _0x2e25d3;};'use strict';var _=require(_0x77e5('0x0'));var util=require(_0x77e5('0x1'));var logger=require('../../config/logger')(_0x77e5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x77e5('0x3'));var fs=require('fs');var path=require(_0x77e5('0x4'));var rimraf=require('rimraf');var config=require(_0x77e5('0x5'));var attributes=require(_0x77e5('0x6'));module[_0x77e5('0x7')]=function(_0xd282bf,_0x1bcead){return _0xd282bf['define'](_0x77e5('0x8'),attributes,{'tableName':_0x77e5('0x9'),'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 5d0b6e0..4d466c4 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 _0x66fa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','result','catch','Attachment','body','options','raw','CreateAttachment','lodash','util','moment','ioredis'];(function(_0x46ed8e,_0x16dfc8){var _0xc3bb00=function(_0x1633e6){while(--_0x1633e6){_0x46ed8e['push'](_0x46ed8e['shift']());}};_0xc3bb00(++_0x16dfc8);}(_0x66fa,0x168));var _0xa66f=function(_0x245300,_0x17d477){_0x245300=_0x245300-0x0;var _0x206824=_0x66fa[_0x245300];return _0x206824;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});}exports['CreateAttachment']=function(_0x4d5e31){var _0x162a28=this;return new Promise(function(_0x16648b,_0x1b4ab0){return db[_0xa66f('0x17')]['create'](_0x4d5e31[_0xa66f('0x18')],{'raw':_0x4d5e31[_0xa66f('0x19')]?_0x4d5e31['options'][_0xa66f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3f4977){logger[_0xa66f('0xe')]('CreateAttachment',_0x4d5e31);logger['debug'](_0xa66f('0x1b'),_0x4d5e31,JSON['stringify'](_0x3f4977));_0x16648b(_0x3f4977);})['catch'](function(_0x59f7aa){logger['error'](_0xa66f('0x1b'),_0x59f7aa[_0xa66f('0x14')],_0x4d5e31);_0x1b4ab0(_0x162a28[_0xa66f('0x13')](0x1f4,_0x59f7aa['message']));});});}; \ No newline at end of file +var _0x4517=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateAttachment','create','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4517,0x112));var _0x7451=function(_0x5c79b2,_0x404254){_0x5c79b2=_0x5c79b2-0x0;var _0x61f405=_0x4517[_0x5c79b2];return _0x61f405;};'use strict';var _=require('lodash');var util=require(_0x7451('0x0'));var moment=require(_0x7451('0x1'));var BPromise=require('bluebird');var rs=require(_0x7451('0x2'));var fs=require('fs');var Redis=require(_0x7451('0x3'));var db=require(_0x7451('0x4'))['db'];var utils=require(_0x7451('0x5'));var logger=require(_0x7451('0x6'))(_0x7451('0x7'));var config=require(_0x7451('0x8'));var jayson=require(_0x7451('0x9'));var client=jayson[_0x7451('0xa')][_0x7451('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ac271,_0x1bfc08,_0x26306e){return new BPromise(function(_0x443b80,_0x2c2ace){return client[_0x7451('0xc')](_0x3ac271,_0x26306e)[_0x7451('0xd')](function(_0x4b7888){logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));logger[_0x7451('0x11')](_0x7451('0x12'),_0x1bfc08,_0x7451('0x10'),JSON[_0x7451('0x13')](_0x4b7888));if(_0x4b7888['error']){if(_0x4b7888['error'][_0x7451('0x14')]===0x1f4){logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')]['message']);return _0x2c2ace(_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);}logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);return _0x443b80(_0x4b7888[_0x7451('0x15')]['message']);}else{logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));_0x443b80(_0x4b7888['result']['message']);}})[_0x7451('0x17')](function(_0x1db688){logger[_0x7451('0x15')](_0x7451('0xf'),_0x1bfc08,_0x1db688);_0x2c2ace(_0x1db688);});});}exports[_0x7451('0x18')]=function(_0xd47ee4){var _0x31a4b2=this;return new Promise(function(_0x1120b1,_0x125ab1){return db['Attachment'][_0x7451('0x19')](_0xd47ee4[_0x7451('0x1a')],{'raw':_0xd47ee4[_0x7451('0x1b')]?_0xd47ee4['options'][_0x7451('0x1c')]===undefined?!![]:![]:!![]})[_0x7451('0xd')](function(_0x3ffb08){logger[_0x7451('0xe')](_0x7451('0x18'),_0xd47ee4);logger[_0x7451('0x11')](_0x7451('0x18'),_0xd47ee4,JSON['stringify'](_0x3ffb08));_0x1120b1(_0x3ffb08);})[_0x7451('0x17')](function(_0x309be0){logger['error'](_0x7451('0x18'),_0x309be0[_0x7451('0x16')],_0xd47ee4);_0x125ab1(_0x31a4b2[_0x7451('0x15')](0x1f4,_0x309be0['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a0a428c..78dbb24 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x38562a,_0x53ba1f){var _0x63d8aa=function(_0x33aabe){while(--_0x33aabe){_0x38562a['push'](_0x38562a['shift']());}};_0x63d8aa(++_0x53ba1f);}(_0xadb5,0xad));var _0x5adb=function(_0x1dd4ea,_0x508eb9){_0x1dd4ea=_0x1dd4ea-0x0;var _0x34eabd=_0xadb5[_0x1dd4ea];return _0x34eabd;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x3f2893,_0x31da6e){var _0x3a0136=function(_0x1e1fb8){while(--_0x1e1fb8){_0x3f2893['push'](_0x3f2893['shift']());}};_0x3a0136(++_0x31da6e);}(_0xadb5,0xad));var _0x5adb=function(_0x5d2ae0,_0x1cc0bf){_0x5d2ae0=_0x5d2ae0-0x0;var _0x3b3760=_0xadb5[_0x5d2ae0];return _0x3b3760;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 70c5887..6f8d505 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8477=['undefined','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','disabled','blocked','blockedAt','admin','agent','then','name','add','minutes','getLicense','catch','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8477,0xea));var _0x7847=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x8477[_0x4dc7b9];return _0x3ab114;};'use strict';var passport=require(_0x7847('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0x7847('0x1'));var ActiveDirectory=require(_0x7847('0x2'));var BPromise=require(_0x7847('0x3'));var util=require(_0x7847('0x4'));var db=require(_0x7847('0x5'))['db'];var authService=require(_0x7847('0x6'));var utils=require('../../config/utils');var config=require(_0x7847('0x7'));var logger=require(_0x7847('0x8'))(_0x7847('0x9'));function isActiveDirectoryConfigured(_0x189b7d){var _0x5944d8=![];if(typeof _0x189b7d[_0x7847('0xa')]!==_0x7847('0xb')){_0x5944d8=_0x189b7d[_0x7847('0xa')][_0x7847('0xc')]&&_0x189b7d[_0x7847('0xa')][_0x7847('0xd')]&&_0x189b7d[_0x7847('0xa')][_0x7847('0xe')];}return _0x5944d8;}function adAuthenticate(_0x59c223,_0x2cc6c5,_0x5ca9ba){return new BPromise(function(_0x5c7f02,_0x283f92){try{var _0x4b9763=new ActiveDirectory(_0x59c223);_0x4b9763['authenticate'](_0x2cc6c5,_0x5ca9ba,function(_0x42d0bb,_0x2b14f6){if(_0x42d0bb){logger[_0x7847('0xf')](_0x7847('0x10'),_0x2cc6c5,util['inspect'](_0x42d0bb,{'showHidden':![],'depth':null}));_0x283f92(_0x7847('0x11'));}else if(!_0x2b14f6){logger[_0x7847('0xf')](_0x7847('0x12'),_0x2cc6c5);_0x283f92(_0x7847('0x11'));}else{_0x5c7f02(_0x2b14f6);}});}catch(_0x18a120){_0x283f92(_0x18a120);}});}function ActiveDirectoryAuthenticate(_0x1abe4e,_0x688007,_0x1d5edf,_0x41d22f){var _0xdf74d1,_0x2737cc;if(!isActiveDirectoryConfigured(config)){logger[_0x7847('0xf')](_0x7847('0x13'),_0x688007);return _0x41d22f(null,![],{'message':_0x7847('0x11')});}return db[_0x7847('0x14')][_0x7847('0x15')]({'where':{'id':0x1},'attributes':[_0x7847('0x16'),_0x7847('0x17')],'raw':!![]})['then'](function(_0x180c68){_0xdf74d1=_0x180c68;if(!_0xdf74d1[_0x7847('0x16')]){logger[_0x7847('0xf')](_0x7847('0x18'),_0x688007);throw new Error(_0x7847('0x11'));}return _0x1abe4e[_0x7847('0x15')]({'attributes':['id','name',_0x7847('0x19'),'salt',_0x7847('0x1a'),_0x7847('0x1b'),_0x7847('0x1c'),_0x7847('0x1d'),'online'],'where':{'name':_0x688007,'role':{'$or':[_0x7847('0x1e'),'user',_0x7847('0x1f')]},'adSsoEnabled':!![]}});})[_0x7847('0x20')](function(_0x1b2347){if(!_0x1b2347||_0x1b2347&&_0x1b2347[_0x7847('0x21')]!==_0x688007){throw new Error(_0x7847('0x11'));}_0x2737cc=_0x1b2347;var _0x420a5c=_0x2737cc[_0x7847('0x21')]+'@'+config[_0x7847('0xa')]['domain'];return adAuthenticate(config[_0x7847('0xa')],_0x420a5c,_0x1d5edf);})['then'](function(_0x19cf92){if(_0x2737cc[_0x7847('0x1b')]){throw new Error(_0x7847('0x11'));}if(_0xdf74d1['blockDuration']>0x0){if(_0x2737cc[_0x7847('0x1c')]){if(moment(_0x2737cc[_0x7847('0x1d')])[_0x7847('0x22')](_0xdf74d1[_0x7847('0x17')],_0x7847('0x23'))>moment()){throw new Error(_0x7847('0x11'));}return utils['clearBlockUser'](_0x2737cc,0x0,![],null)['then'](function(){return utils[_0x7847('0x24')](_0x2737cc);})[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}else{return utils[_0x7847('0x24')](_0x2737cc)[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}}else{return utils[_0x7847('0x24')](_0x2737cc)[_0x7847('0x20')](function(){return _0x41d22f(null,_0x2737cc);});}})[_0x7847('0x25')](function(_0xc8c7b2){return _0x41d22f(null,![],_0xc8c7b2);});}function handleError(_0x3e476b,_0x48c02f,_0x42f37b){return _0x3e476b['status'](_0x48c02f||0x1f4)[_0x7847('0x26')]({'message':_0x42f37b?_0x42f37b[_0x7847('0x27')]||_0x42f37b:''});}exports[_0x7847('0x28')]=function(_0x397df7,_0x27ac27,_0x122a18){passport[_0x7847('0x29')](_0x7847('0x2a'),function(_0x13fc8c,_0x44c365,_0x4ac4fd){var _0x3f20b1=_0x13fc8c||_0x4ac4fd;if(_0x3f20b1){return handleError(_0x27ac27,0x191,_0x3f20b1);}if(!_0x44c365){return handleError(_0x27ac27,0x194,{'message':_0x7847('0x2b')});}else{var _0x2facd6={'payload':{'id':_0x44c365['id'],'role':_0x44c365[_0x7847('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x7847('0x2c')](_0x2facd6)[_0x7847('0x20')](function(_0x4900e5){_0x27ac27[_0x7847('0x2d')]({'id':_0x44c365['id'],'token':_0x4900e5,'statusCall':'','isAlreadyLogged':_0x44c365[_0x7847('0x2e')]});});}})(_0x397df7,_0x27ac27,_0x122a18);};passport[_0x7847('0x2f')](_0x7847('0x2a'),new LocalStrategy({'usernameField':_0x7847('0x21'),'passwordField':_0x7847('0x19')},function(_0x4cc548,_0x3a3fcf,_0x2bd48c){return ActiveDirectoryAuthenticate(db[_0x7847('0x30')],_0x4cc548,_0x3a3fcf,_0x2bd48c);})); \ No newline at end of file +var _0x029a=['signToken','json','use','ad-login','User','passport-local','Strategy','activedirectory2','util','../../mysqldb','../../config/utils','../../config/logger','activedirectory','undefined','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','findOne','name','salt','role','disabled','blocked','online','admin','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0xa59345,_0x86f01c){var _0x22fc32=function(_0x1c5423){while(--_0x1c5423){_0xa59345['push'](_0xa59345['shift']());}};_0x22fc32(++_0x86f01c);}(_0x029a,0xb5));var _0xa029=function(_0x5a404a,_0x31e13f){_0x5a404a=_0x5a404a-0x0;var _0x25e98e=_0x029a[_0x5a404a];return _0x25e98e;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xa029('0x0'))[_0xa029('0x1')];var moment=require('moment');var ActiveDirectory=require(_0xa029('0x2'));var BPromise=require('bluebird');var util=require(_0xa029('0x3'));var db=require(_0xa029('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xa029('0x5'));var config=require('../../config/environment');var logger=require(_0xa029('0x6'))('api');function isActiveDirectoryConfigured(_0x22ac41){var _0x19c403=![];if(typeof _0x22ac41[_0xa029('0x7')]!==_0xa029('0x8')){_0x19c403=_0x22ac41[_0xa029('0x7')]['baseDN']&&_0x22ac41[_0xa029('0x7')]['url']&&_0x22ac41[_0xa029('0x7')][_0xa029('0x9')];}return _0x19c403;}function adAuthenticate(_0x2ec357,_0x49edf9,_0x128c70){return new BPromise(function(_0x2d95de,_0x22e9f7){try{var _0x4ea3b8=new ActiveDirectory(_0x2ec357);_0x4ea3b8[_0xa029('0xa')](_0x49edf9,_0x128c70,function(_0x4e8c53,_0x5bfbda){if(_0x4e8c53){logger['error'](_0xa029('0xb'),_0x49edf9,util['inspect'](_0x4e8c53,{'showHidden':![],'depth':null}));_0x22e9f7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5bfbda){logger[_0xa029('0xc')](_0xa029('0xd'),_0x49edf9);_0x22e9f7(_0xa029('0xe'));}else{_0x2d95de(_0x5bfbda);}});}catch(_0x53d7b3){_0x22e9f7(_0x53d7b3);}});}function ActiveDirectoryAuthenticate(_0x4d2d29,_0x2a9e09,_0x32593f,_0x33c07e){var _0x52cdf4,_0x555198;if(!isActiveDirectoryConfigured(config)){logger[_0xa029('0xc')](_0xa029('0xf'),_0x2a9e09);return _0x33c07e(null,![],{'message':_0xa029('0xe')});}return db[_0xa029('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0xa029('0x11'),_0xa029('0x12')],'raw':!![]})[_0xa029('0x13')](function(_0x10a6a4){_0x52cdf4=_0x10a6a4;if(!_0x52cdf4['adSsoEnabled']){logger[_0xa029('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x2a9e09);throw new Error(_0xa029('0xe'));}return _0x4d2d29[_0xa029('0x14')]({'attributes':['id',_0xa029('0x15'),'password',_0xa029('0x16'),_0xa029('0x17'),_0xa029('0x18'),_0xa029('0x19'),'blockedAt',_0xa029('0x1a')],'where':{'name':_0x2a9e09,'role':{'$or':[_0xa029('0x1b'),'user',_0xa029('0x1c')]},'adSsoEnabled':!![]}});})[_0xa029('0x13')](function(_0x536ec2){if(!_0x536ec2||_0x536ec2&&_0x536ec2['name']!==_0x2a9e09){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x555198=_0x536ec2;var _0x3972d2=_0x555198[_0xa029('0x15')]+'@'+config[_0xa029('0x7')][_0xa029('0x9')];return adAuthenticate(config['activedirectory'],_0x3972d2,_0x32593f);})[_0xa029('0x13')](function(_0x3d7d2a){if(_0x555198['disabled']){throw new Error(_0xa029('0xe'));}if(_0x52cdf4[_0xa029('0x12')]>0x0){if(_0x555198[_0xa029('0x19')]){if(moment(_0x555198[_0xa029('0x1d')])[_0xa029('0x1e')](_0x52cdf4[_0xa029('0x12')],_0xa029('0x1f'))>moment()){throw new Error(_0xa029('0xe'));}return utils[_0xa029('0x20')](_0x555198,0x0,![],null)['then'](function(){return utils['getLicense'](_0x555198);})[_0xa029('0x13')](function(){return _0x33c07e(null,_0x555198);});}else{return utils[_0xa029('0x21')](_0x555198)[_0xa029('0x13')](function(){return _0x33c07e(null,_0x555198);});}}else{return utils['getLicense'](_0x555198)[_0xa029('0x13')](function(){return _0x33c07e(null,_0x555198);});}})[_0xa029('0x22')](function(_0x79efb6){return _0x33c07e(null,![],_0x79efb6);});}function handleError(_0x2c72fa,_0x4376ae,_0x41e1ce){return _0x2c72fa['status'](_0x4376ae||0x1f4)[_0xa029('0x23')]({'message':_0x41e1ce?_0x41e1ce[_0xa029('0x24')]||_0x41e1ce:''});}exports[_0xa029('0x25')]=function(_0x50af21,_0x4deaf7,_0x398672){passport[_0xa029('0xa')]('ad-login',function(_0x3432ce,_0x3d45d9,_0x550154){var _0x1cbc06=_0x3432ce||_0x550154;if(_0x1cbc06){return handleError(_0x4deaf7,0x191,_0x1cbc06);}if(!_0x3d45d9){return handleError(_0x4deaf7,0x194,{'message':_0xa029('0x26')});}else{var _0x4d25df={'payload':{'id':_0x3d45d9['id'],'role':_0x3d45d9[_0xa029('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0xa029('0x27')](_0x4d25df)[_0xa029('0x13')](function(_0x4de2d5){_0x4deaf7[_0xa029('0x28')]({'id':_0x3d45d9['id'],'token':_0x4de2d5,'statusCall':'','isAlreadyLogged':_0x3d45d9[_0xa029('0x1a')]});});}})(_0x50af21,_0x4deaf7,_0x398672);};passport[_0xa029('0x29')](_0xa029('0x2a'),new LocalStrategy({'usernameField':_0xa029('0x15'),'passwordField':'password'},function(_0x318336,_0x422209,_0x20498e){return ActiveDirectoryAuthenticate(db[_0xa029('0x2b')],_0x318336,_0x422209,_0x20498e);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index f485563..60e5ea7 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8771=['exports','express','Router','login'];(function(_0x534971,_0x1a8061){var _0x575c2f=function(_0x222f11){while(--_0x222f11){_0x534971['push'](_0x534971['shift']());}};_0x575c2f(++_0x1a8061);}(_0x8771,0x75));var _0x1877=function(_0x3f1718,_0x5360ad){_0x3f1718=_0x3f1718-0x0;var _0x29627e=_0x8771[_0x3f1718];return _0x29627e;};'use strict';var express=require(_0x1877('0x0'));var router=express[_0x1877('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x1877('0x2')]);module[_0x1877('0x3')]=router; \ No newline at end of file +var _0x4ee4=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x23e00d,_0x4e6f3d){var _0x2ebc05=function(_0x20fd35){while(--_0x20fd35){_0x23e00d['push'](_0x23e00d['shift']());}};_0x2ebc05(++_0x4e6f3d);}(_0x4ee4,0x160));var _0x44ee=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x4ee4[_0x3a9661];return _0x5bb119;};'use strict';var express=require(_0x44ee('0x0'));var router=express[_0x44ee('0x1')]();var controller=require(_0x44ee('0x2'));router[_0x44ee('0x3')]('/',controller[_0x44ee('0x4')]);module[_0x44ee('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index a4aeb5e..e5ac1fa 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed583,_0x512eb2){_0x1ed583=_0x1ed583-0x0;var _0x42a452=_0x7a54[_0x1ed583];return _0x42a452;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x39cc5e,_0xca88a3){_0x39cc5e=_0x39cc5e-0x0;var _0x168686=_0x7a54[_0x39cc5e];return _0x168686;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 8f42b43..f23ea83 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 _0x6412=['get','login','/callback','callback','isMiddleware','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x4e3780,_0x5c62fb){var _0x1d8532=function(_0x1010ab){while(--_0x1010ab){_0x4e3780['push'](_0x4e3780['shift']());}};_0x1d8532(++_0x5c62fb);}(_0x6412,0x1c8));var _0x2641=function(_0x40ae87,_0x29c4c6){_0x40ae87=_0x40ae87-0x0;var _0x49a0bb=_0x6412[_0x40ae87];return _0x49a0bb;};'use strict';var express=require(_0x2641('0x0'));var passport=require(_0x2641('0x1'));var router=express[_0x2641('0x2')]();var controller=require(_0x2641('0x3'));var userController=require(_0x2641('0x4'));var authService=require(_0x2641('0x5'));router[_0x2641('0x6')]('/',controller[_0x2641('0x7')]);router['get'](_0x2641('0x8'),controller[_0x2641('0x9')],authService[_0x2641('0xa')],userController[_0x2641('0x7')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x1057=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback'];(function(_0x2f7f62,_0x48fa3a){var _0x477878=function(_0x4b6229){while(--_0x4b6229){_0x2f7f62['push'](_0x2f7f62['shift']());}};_0x477878(++_0x48fa3a);}(_0x1057,0xc3));var _0x7105=function(_0x15d1d9,_0x41960f){_0x15d1d9=_0x15d1d9-0x0;var _0x5acc6f=_0x1057[_0x15d1d9];return _0x5acc6f;};'use strict';var express=require(_0x7105('0x0'));var passport=require(_0x7105('0x1'));var router=express[_0x7105('0x2')]();var controller=require(_0x7105('0x3'));var userController=require(_0x7105('0x4'));var authService=require('../../components/auth/service');router[_0x7105('0x5')]('/',controller[_0x7105('0x6')]);router[_0x7105('0x5')](_0x7105('0x7'),controller[_0x7105('0x8')],authService[_0x7105('0x9')],userController[_0x7105('0x6')],authService[_0x7105('0xa')]);module[_0x7105('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index e8e6044..fcd0f4b 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 _0xf8a8=['xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','Reset\x20Email\x20sent!','params','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','util','passport','passport-local','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','password','salt','disabled','blocked','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','error','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save'];(function(_0x495869,_0x43e996){var _0x1a5786=function(_0x45192c){while(--_0x45192c){_0x495869['push'](_0x495869['shift']());}};_0x1a5786(++_0x43e996);}(_0xf8a8,0xff));var _0x8f8a=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xf8a8[_0x4e9628];return _0x27bc8c;};'use strict';var util=require(_0x8f8a('0x0'));var passport=require(_0x8f8a('0x1'));var LocalStrategy=require(_0x8f8a('0x2'))['Strategy'];var jayson=require(_0x8f8a('0x3'));var _=require(_0x8f8a('0x4'));var rs=require('randomstring');var moment=require(_0x8f8a('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x8f8a('0x6'));var utils=require(_0x8f8a('0x7'));var client=jayson[_0x8f8a('0x8')][_0x8f8a('0x9')]({'port':0x232b});function localAuthenticate(_0x5ef965,_0x1160d0,_0x57ed11,_0x495896){var _0x4c5a10,_0x501ea0;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x8f8a('0xa'),_0x8f8a('0xb')],'raw':!![]})[_0x8f8a('0xc')](function(_0x420ddb){_0x4c5a10=_0x420ddb;return _0x5ef965['findOne']({'attributes':['id','name',_0x8f8a('0xd'),_0x8f8a('0xe'),'role',_0x8f8a('0xf'),_0x8f8a('0x10'),'blockedAt','loginAttempts'],'where':{'name':_0x1160d0,'role':{'$or':[_0x8f8a('0x11'),_0x8f8a('0x12'),_0x8f8a('0x13')]}}});})['then'](function(_0x1e0646){if(!_0x1e0646||_0x1e0646&&_0x1e0646[_0x8f8a('0x14')]!==_0x1160d0){throw new Error(_0x8f8a('0x15'));}else{_0x501ea0=_0x1e0646;return _0x501ea0;}})[_0x8f8a('0xc')](function(){_0x501ea0[_0x8f8a('0x16')](_0x57ed11,function(_0x57b3c7,_0x33f502){var _0xa8d8a0=_0x501ea0[_0x8f8a('0x17')]+0x1;if(_0x57b3c7){return _0x495896(_0x57b3c7);}else if(!_0x33f502){if(_0x501ea0[_0x8f8a('0xf')]){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else if(_0x4c5a10[_0x8f8a('0xa')]>0x0){if(_0x501ea0[_0x8f8a('0x10')]){if(_0x4c5a10[_0x8f8a('0xb')]>0x0){if(moment(_0x501ea0['blockedAt'])[_0x8f8a('0x18')](_0x4c5a10[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else{return utils[_0x8f8a('0x1a')](_0x501ea0,_0xa8d8a0,![],null)['then'](function(){return _0x495896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{if(_0xa8d8a0>=_0x4c5a10[_0x8f8a('0xa')]){return utils[_0x8f8a('0x1a')](_0x501ea0,0x0,!![],moment())[_0x8f8a('0xc')](function(){return _0x495896(null,![],{'message':_0x8f8a('0x15')});});}else{return utils[_0x8f8a('0x1a')](_0x501ea0,_0xa8d8a0,![],null)[_0x8f8a('0xc')](function(){return _0x495896(null,![],{'message':_0x8f8a('0x15')});});}}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{if(_0x501ea0[_0x8f8a('0xf')]){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else if(_0x4c5a10[_0x8f8a('0xa')]>0x0){if(_0x501ea0[_0x8f8a('0x10')]){if(_0x4c5a10[_0x8f8a('0xb')]>0x0){if(moment(_0x501ea0[_0x8f8a('0x1b')])[_0x8f8a('0x18')](_0x4c5a10[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){return _0x495896(null,![],{'message':_0x8f8a('0x15')});}else{return utils['clearBlockUser'](_0x501ea0,0x0,![],null)[_0x8f8a('0xc')](function(){return utils[_0x8f8a('0x1c')](_0x501ea0);})[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);});}}else{return _0x495896(null,![],{'message':_0x8f8a('0x15')});}}else{return utils[_0x8f8a('0x1a')](_0x501ea0,0x0,![],null)[_0x8f8a('0xc')](function(){return utils['getLicense'](_0x501ea0);})[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);})[_0x8f8a('0x1d')](function(_0xefafe3){return _0x495896(null,![],_0xefafe3);});}}else{if(_0x501ea0[_0x8f8a('0x10')]){return _0x495896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8f8a('0x1c')](_0x501ea0)[_0x8f8a('0xc')](function(){return _0x495896(null,_0x501ea0);});}}}});})[_0x8f8a('0x1d')](function(_0x53f446){return _0x495896(null,![],_0x53f446);});}function sendServiceMail(_0x2e9bbd){return db[_0x8f8a('0x1e')][_0x8f8a('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x8f8a('0x20')],'include':[{'model':db[_0x8f8a('0x21')],'as':_0x8f8a('0x22'),'include':[{'model':db[_0x8f8a('0x23')],'as':_0x8f8a('0x23')}]}]})[_0x8f8a('0xc')](function(_0x1687e9){if(!_0x1687e9){throw new Error(_0x8f8a('0x24'));}var _0x5e10ad=_0x1687e9[_0x8f8a('0x25')]();var _0x5a1c6e={'account':_0x5e10ad,'message':_[_0x8f8a('0x26')]({'from':util[_0x8f8a('0x27')](_0x8f8a('0x28'),_0x1687e9[_0x8f8a('0x14')],_0x1687e9[_0x8f8a('0x20')]||_0x1687e9[_0x8f8a('0x22')][_0x8f8a('0x12')])},_0x2e9bbd)};return client['request']('SendMail',_0x5a1c6e);})[_0x8f8a('0xc')](function(_0x5cdeda){if(_0x5cdeda[_0x8f8a('0x29')]){throw new Error(util[_0x8f8a('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5cdeda[_0x8f8a('0x29')][_0x8f8a('0x2a')]||JSON[_0x8f8a('0x2b')](_0x5cdeda[_0x8f8a('0x29')])));}return!![];});}function handleError(_0x5206d0,_0x58075b,_0x1552c1){return _0x5206d0[_0x8f8a('0x2c')](_0x58075b||0x1f4)[_0x8f8a('0x2d')]({'message':_0x1552c1?_0x1552c1['message']||_0x1552c1:''});}exports[_0x8f8a('0x2e')]=function(_0x49af2e,_0x4c5cbb,_0x3f1220){passport[_0x8f8a('0x16')](_0x8f8a('0x2f'),function(_0x5b3dec,_0x3ebb02,_0x5120cc){var _0x31e687=_0x5b3dec||_0x5120cc;if(_0x31e687){return handleError(_0x4c5cbb,0x191,_0x31e687);}if(!_0x3ebb02){return handleError(_0x4c5cbb,0x194,{'message':_0x8f8a('0x30')});}else{var _0x18ee8c={'payload':{'id':_0x3ebb02['id'],'role':_0x3ebb02[_0x8f8a('0x31')]},'options':{'expiresIn':0x15180}};return authService[_0x8f8a('0x32')](_0x18ee8c)[_0x8f8a('0xc')](function(_0x212309){_0x4c5cbb['json']({'id':_0x3ebb02['id'],'token':_0x212309,'statusCall':'','isAlreadyLogged':_0x3ebb02[_0x8f8a('0x33')]});});}})(_0x49af2e,_0x4c5cbb,_0x3f1220);};exports[_0x8f8a('0x34')]=function(_0x3a9f93,_0x408617){if(!_0x3a9f93[_0x8f8a('0x35')][_0x8f8a('0x20')]){return handleError(_0x408617,0x1f4,{'message':_0x8f8a('0x36')});}var _0x27def4=rs['generate']();_0x3a9f93[_0x8f8a('0x35')]['email']=_0x3a9f93[_0x8f8a('0x35')]['email'][_0x8f8a('0x37')]()['toLowerCase']();var _0x1c3123;return db[_0x8f8a('0x38')]['findOne']({'where':{'id':0x1},'attributes':[_0x8f8a('0xa'),_0x8f8a('0xb')],'raw':!![]})[_0x8f8a('0xc')](function(_0x2381e5){_0x1c3123=_0x2381e5;return db[_0x8f8a('0x39')][_0x8f8a('0x1f')]({'where':{'email':_0x3a9f93[_0x8f8a('0x35')][_0x8f8a('0x20')]}});})['then'](function(_0x54665c){if(!_0x54665c){throw new Error(_0x8f8a('0x3a'));}if(_0x54665c[_0x8f8a('0xf')]){throw new Error(_0x8f8a('0x3b'));}if(_0x54665c['blocked']){if(moment(_0x54665c[_0x8f8a('0x1b')])[_0x8f8a('0x18')](_0x1c3123[_0x8f8a('0xb')],_0x8f8a('0x19'))>moment()){throw new Error(_0x8f8a('0x3c'));}else{_0x54665c[_0x8f8a('0x10')]=![];_0x54665c['blockedAt']=null;}}_0x54665c[_0x8f8a('0x3d')]=_0x27def4;_0x54665c[_0x8f8a('0x3e')]=Date[_0x8f8a('0x3f')]()+0x36ee80;return _0x54665c[_0x8f8a('0x40')]();})[_0x8f8a('0xc')](function(){return sendServiceMail({'to':_0x3a9f93['body'][_0x8f8a('0x20')],'subject':_0x8f8a('0x41'),'text':_0x8f8a('0x42')+_0x8f8a('0x43')+_0x8f8a('0x44')+_0x3a9f93['headers'][_0x8f8a('0x45')]+'/reset/'+_0x27def4+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x8f8a('0xc')](function(){_0x408617[_0x8f8a('0x2c')](0xc8)[_0x8f8a('0x2d')]({'message':_0x8f8a('0x46')});})['catch'](function(_0x52bd85){return handleError(_0x408617,0x1f4,_0x52bd85);});};exports['reset']=function(_0x119d21,_0x25bfbd){return db['User']['find']({'where':{'resetPasswordToken':_0x119d21[_0x8f8a('0x47')]['token'],'resetPasswordExpires':{'$gt':Date[_0x8f8a('0x3f')]()}}})[_0x8f8a('0xc')](function(_0x3504a3){if(!_0x3504a3){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x8f8a('0x48')]({'attributes':['id',_0x8f8a('0x49'),_0x8f8a('0x4a'),_0x8f8a('0x4b')]})[_0x8f8a('0xc')](function(_0x120fec){if(_0x120fec['securePassword'])authService[_0x8f8a('0x4c')](_0x119d21[_0x8f8a('0x35')][_0x8f8a('0xd')]);if(!_0x120fec[_0x8f8a('0x4a')]||!_0x3504a3[_0x8f8a('0x4d')])return _0x3504a3;authService[_0x8f8a('0x4e')](_0x119d21[_0x8f8a('0x35')]['password'],_0x3504a3[_0x8f8a('0x4d')],_0x120fec[_0x8f8a('0x4b')]);return _0x3504a3;})[_0x8f8a('0xc')](function(){_0x3504a3['password']=_0x119d21[_0x8f8a('0x35')][_0x8f8a('0xd')];_0x3504a3[_0x8f8a('0x3d')]=null;_0x3504a3['resetPasswordExpires']=null;return _0x3504a3[_0x8f8a('0x40')]();});})[_0x8f8a('0xc')](function(){_0x25bfbd[_0x8f8a('0x2c')](0xc8)[_0x8f8a('0x2d')]({'message':'Password\x20reset!'});})[_0x8f8a('0x1d')](function(_0x529aa2){return handleError(_0x25bfbd,0x1f4,_0x529aa2);});};passport[_0x8f8a('0x4f')](_0x8f8a('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x8f8a('0xd')},function(_0x205886,_0x12f9fe,_0x4746ab){return localAuthenticate(db[_0x8f8a('0x39')],_0x205886,_0x12f9fe,_0x4746ab);})); \ No newline at end of file +var _0x6b4a=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','save','use','util','passport','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','admin','user'];(function(_0x3adf40,_0x165ffb){var _0x2b15a6=function(_0x281cf2){while(--_0x281cf2){_0x3adf40['push'](_0x3adf40['shift']());}};_0x2b15a6(++_0x165ffb);}(_0x6b4a,0x86));var _0xa6b4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6b4a[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xa6b4('0x0'));var passport=require(_0xa6b4('0x1'));var LocalStrategy=require('passport-local')[_0xa6b4('0x2')];var jayson=require(_0xa6b4('0x3'));var _=require('lodash');var rs=require(_0xa6b4('0x4'));var moment=require(_0xa6b4('0x5'));var db=require(_0xa6b4('0x6'))['db'];var authService=require(_0xa6b4('0x7'));var utils=require('../../config/utils');var client=jayson['client'][_0xa6b4('0x8')]({'port':0x232b});function localAuthenticate(_0x41a3fb,_0x29073d,_0x553cdf,_0x1532ad){var _0x31b40a,_0x20758b;return db[_0xa6b4('0x9')][_0xa6b4('0xa')]({'where':{'id':0x1},'attributes':[_0xa6b4('0xb'),_0xa6b4('0xc')],'raw':!![]})[_0xa6b4('0xd')](function(_0x1fc163){_0x31b40a=_0x1fc163;return _0x41a3fb['findOne']({'attributes':['id',_0xa6b4('0xe'),_0xa6b4('0xf'),_0xa6b4('0x10'),_0xa6b4('0x11'),_0xa6b4('0x12'),'blocked',_0xa6b4('0x13'),'loginAttempts'],'where':{'name':_0x29073d,'role':{'$or':[_0xa6b4('0x14'),_0xa6b4('0x15'),_0xa6b4('0x16')]}}});})[_0xa6b4('0xd')](function(_0x58fd28){if(!_0x58fd28||_0x58fd28&&_0x58fd28[_0xa6b4('0xe')]!==_0x29073d){throw new Error(_0xa6b4('0x17'));}else{_0x20758b=_0x58fd28;return _0x20758b;}})[_0xa6b4('0xd')](function(){_0x20758b['authenticate'](_0x553cdf,function(_0x2be6b8,_0x3a1b84){var _0x1a30c9=_0x20758b['loginAttempts']+0x1;if(_0x2be6b8){return _0x1532ad(_0x2be6b8);}else if(!_0x3a1b84){if(_0x20758b['disabled']){return _0x1532ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x31b40a[_0xa6b4('0xb')]>0x0){if(_0x20758b[_0xa6b4('0x18')]){if(_0x31b40a[_0xa6b4('0xc')]>0x0){if(moment(_0x20758b[_0xa6b4('0x13')])[_0xa6b4('0x19')](_0x31b40a['blockDuration'],_0xa6b4('0x1a'))>moment()){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}else{return utils['clearBlockUser'](_0x20758b,_0x1a30c9,![],null)['then'](function(){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});});}}else{return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}}else{if(_0x1a30c9>=_0x31b40a[_0xa6b4('0xb')]){return utils[_0xa6b4('0x1b')](_0x20758b,0x0,!![],moment())['then'](function(){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});});}else{return utils[_0xa6b4('0x1b')](_0x20758b,_0x1a30c9,![],null)[_0xa6b4('0xd')](function(){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});});}}}else{return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}}else{if(_0x20758b[_0xa6b4('0x12')]){return _0x1532ad(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x31b40a[_0xa6b4('0xb')]>0x0){if(_0x20758b[_0xa6b4('0x18')]){if(_0x31b40a[_0xa6b4('0xc')]>0x0){if(moment(_0x20758b[_0xa6b4('0x13')])['add'](_0x31b40a[_0xa6b4('0xc')],_0xa6b4('0x1a'))>moment()){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}else{return utils[_0xa6b4('0x1b')](_0x20758b,0x0,![],null)['then'](function(){return utils[_0xa6b4('0x1c')](_0x20758b);})[_0xa6b4('0xd')](function(){return _0x1532ad(null,_0x20758b);});}}else{return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}}else{return utils['clearBlockUser'](_0x20758b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x20758b);})[_0xa6b4('0xd')](function(){return _0x1532ad(null,_0x20758b);})['catch'](function(_0x3e4170){return _0x1532ad(null,![],_0x3e4170);});}}else{if(_0x20758b[_0xa6b4('0x18')]){return _0x1532ad(null,![],{'message':_0xa6b4('0x17')});}else{return utils[_0xa6b4('0x1c')](_0x20758b)[_0xa6b4('0xd')](function(){return _0x1532ad(null,_0x20758b);});}}}});})[_0xa6b4('0x1d')](function(_0x249a2d){return _0x1532ad(null,![],_0x249a2d);});}function sendServiceMail(_0x328c38){return db[_0xa6b4('0x1e')][_0xa6b4('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xa6b4('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xa6b4('0x20'),'include':[{'model':db[_0xa6b4('0x21')],'as':_0xa6b4('0x21')}]}]})[_0xa6b4('0xd')](function(_0x34c17d){if(!_0x34c17d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x59bcca=_0x34c17d[_0xa6b4('0x22')]();var _0xa9ce78={'account':_0x59bcca,'message':_[_0xa6b4('0x23')]({'from':util[_0xa6b4('0x24')](_0xa6b4('0x25'),_0x34c17d[_0xa6b4('0xe')],_0x34c17d[_0xa6b4('0x26')]||_0x34c17d[_0xa6b4('0x20')][_0xa6b4('0x15')])},_0x328c38)};return client[_0xa6b4('0x27')](_0xa6b4('0x28'),_0xa9ce78);})['then'](function(_0xaed830){if(_0xaed830['error']){throw new Error(util[_0xa6b4('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xaed830[_0xa6b4('0x29')][_0xa6b4('0x2a')]||JSON[_0xa6b4('0x2b')](_0xaed830[_0xa6b4('0x29')])));}return!![];});}function handleError(_0x297bc4,_0x3457d4,_0x217696){return _0x297bc4['status'](_0x3457d4||0x1f4)[_0xa6b4('0x2c')]({'message':_0x217696?_0x217696[_0xa6b4('0x2a')]||_0x217696:''});}exports[_0xa6b4('0x2d')]=function(_0x25a43a,_0xb341ca,_0x4b42b9){passport[_0xa6b4('0x2e')](_0xa6b4('0x2f'),function(_0x428e5f,_0x162391,_0x5ced6b){var _0x15d5bf=_0x428e5f||_0x5ced6b;if(_0x15d5bf){return handleError(_0xb341ca,0x191,_0x15d5bf);}if(!_0x162391){return handleError(_0xb341ca,0x194,{'message':_0xa6b4('0x30')});}else{var _0x39f4d8={'payload':{'id':_0x162391['id'],'role':_0x162391['role']},'options':{'expiresIn':0x15180}};return authService[_0xa6b4('0x31')](_0x39f4d8)[_0xa6b4('0xd')](function(_0x4bfec0){_0xb341ca[_0xa6b4('0x32')]({'id':_0x162391['id'],'token':_0x4bfec0,'statusCall':'','isAlreadyLogged':_0x162391['online']});});}})(_0x25a43a,_0xb341ca,_0x4b42b9);};exports[_0xa6b4('0x33')]=function(_0x50f65,_0x33b0b8){if(!_0x50f65[_0xa6b4('0x34')][_0xa6b4('0x26')]){return handleError(_0x33b0b8,0x1f4,{'message':_0xa6b4('0x35')});}var _0x4dbe8b=rs[_0xa6b4('0x36')]();_0x50f65[_0xa6b4('0x34')]['email']=_0x50f65[_0xa6b4('0x34')][_0xa6b4('0x26')]['trim']()['toLowerCase']();var _0x326a8b;return db[_0xa6b4('0x9')][_0xa6b4('0xa')]({'where':{'id':0x1},'attributes':[_0xa6b4('0xb'),_0xa6b4('0xc')],'raw':!![]})[_0xa6b4('0xd')](function(_0x109ba4){_0x326a8b=_0x109ba4;return db[_0xa6b4('0x37')][_0xa6b4('0x1f')]({'where':{'email':_0x50f65['body'][_0xa6b4('0x26')]}});})[_0xa6b4('0xd')](function(_0x544db8){if(!_0x544db8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x544db8[_0xa6b4('0x12')]){throw new Error(_0xa6b4('0x38'));}if(_0x544db8[_0xa6b4('0x18')]){if(moment(_0x544db8[_0xa6b4('0x13')])[_0xa6b4('0x19')](_0x326a8b[_0xa6b4('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x544db8[_0xa6b4('0x18')]=![];_0x544db8[_0xa6b4('0x13')]=null;}}_0x544db8[_0xa6b4('0x39')]=_0x4dbe8b;_0x544db8['resetPasswordExpires']=Date[_0xa6b4('0x3a')]()+0x36ee80;return _0x544db8['save']();})[_0xa6b4('0xd')](function(){return sendServiceMail({'to':_0x50f65[_0xa6b4('0x34')][_0xa6b4('0x26')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa6b4('0x3b')+_0xa6b4('0x3c')+_0xa6b4('0x3d')+_0x50f65[_0xa6b4('0x3e')]['host']+'/reset/'+_0x4dbe8b+'\x0a\x0a'+_0xa6b4('0x3f')});})[_0xa6b4('0xd')](function(){_0x33b0b8[_0xa6b4('0x40')](0xc8)[_0xa6b4('0x2c')]({'message':_0xa6b4('0x41')});})[_0xa6b4('0x1d')](function(_0xef3eee){return handleError(_0x33b0b8,0x1f4,_0xef3eee);});};exports[_0xa6b4('0x42')]=function(_0xf284f9,_0xde7531){return db[_0xa6b4('0x37')][_0xa6b4('0x1f')]({'where':{'resetPasswordToken':_0xf284f9['params'][_0xa6b4('0x43')],'resetPasswordExpires':{'$gt':Date[_0xa6b4('0x3a')]()}}})['then'](function(_0x10cabb){if(!_0x10cabb){throw new Error(_0xa6b4('0x44'));}return db[_0xa6b4('0x9')]['findOne']({'attributes':['id','securePassword',_0xa6b4('0x45'),_0xa6b4('0x46')]})[_0xa6b4('0xd')](function(_0x196083){if(_0x196083[_0xa6b4('0x47')])authService[_0xa6b4('0x48')](_0xf284f9[_0xa6b4('0x34')][_0xa6b4('0xf')]);if(!_0x196083[_0xa6b4('0x45')]||!_0x10cabb[_0xa6b4('0x49')])return _0x10cabb;authService[_0xa6b4('0x4a')](_0xf284f9[_0xa6b4('0x34')][_0xa6b4('0xf')],_0x10cabb[_0xa6b4('0x49')],_0x196083[_0xa6b4('0x46')]);return _0x10cabb;})[_0xa6b4('0xd')](function(){_0x10cabb[_0xa6b4('0xf')]=_0xf284f9[_0xa6b4('0x34')][_0xa6b4('0xf')];_0x10cabb[_0xa6b4('0x39')]=null;_0x10cabb[_0xa6b4('0x4b')]=null;return _0x10cabb[_0xa6b4('0x4c')]();});})['then'](function(){_0xde7531[_0xa6b4('0x40')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x5149a4){return handleError(_0xde7531,0x1f4,_0x5149a4);});};passport[_0xa6b4('0x4d')]('local-login',new LocalStrategy({'usernameField':_0xa6b4('0xe'),'passwordField':_0xa6b4('0xf')},function(_0x15cca9,_0x4f923e,_0x383ea9){return localAuthenticate(db['User'],_0x15cca9,_0x4f923e,_0x383ea9);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 60ae898..823deb4 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 _0x6007=['/reset/:token','reset','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x202aa2,_0x584b66){var _0x4e8000=function(_0x400b30){while(--_0x400b30){_0x202aa2['push'](_0x202aa2['shift']());}};_0x4e8000(++_0x584b66);}(_0x6007,0x1b2));var _0x7600=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x6007[_0x3e21f4];return _0x40fc49;};'use strict';var express=require(_0x7600('0x0'));var router=express[_0x7600('0x1')]();var controller=require(_0x7600('0x2'));router[_0x7600('0x3')]('/',controller[_0x7600('0x4')]);router[_0x7600('0x3')](_0x7600('0x5'),controller[_0x7600('0x6')]);router[_0x7600('0x3')](_0x7600('0x7'),controller[_0x7600('0x8')]);module['exports']=router; \ No newline at end of file +var _0x9ac6=['exports','express','Router','./authLocal.controller','post','forgot','/reset/:token','reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ac6,0x119));var _0x69ac=function(_0x563b77,_0x5f04b5){_0x563b77=_0x563b77-0x0;var _0x458a6b=_0x9ac6[_0x563b77];return _0x458a6b;};'use strict';var express=require(_0x69ac('0x0'));var router=express[_0x69ac('0x1')]();var controller=require(_0x69ac('0x2'));router[_0x69ac('0x3')]('/',controller['login']);router['post']('/forgot',controller[_0x69ac('0x4')]);router[_0x69ac('0x3')](_0x69ac('0x5'),controller[_0x69ac('0x6')]);module[_0x69ac('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 7de711c..58d297a 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 _0x2f4a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5a7d41,_0x4447e2){var _0x98d8fa=function(_0x2ce1cf){while(--_0x2ce1cf){_0x5a7d41['push'](_0x5a7d41['shift']());}};_0x98d8fa(++_0x4447e2);}(_0x2f4a,0x187));var _0xa2f4=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2f4a[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require(_0xa2f4('0x0'));module[_0xa2f4('0x1')]={'name':{'type':Sequelize[_0xa2f4('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa2f4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa2f4('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x703d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x25d9a5,_0x31708a){var _0x166b18=function(_0x12cfee){while(--_0x12cfee){_0x25d9a5['push'](_0x25d9a5['shift']());}};_0x166b18(++_0x31708a);}(_0x703d,0x190));var _0xd703=function(_0xfc7051,_0x21e5a6){_0xfc7051=_0xfc7051-0x0;var _0x584180=_0x703d[_0xfc7051];return _0x584180;};'use strict';var Sequelize=require(_0xd703('0x0'));module[_0xd703('0x1')]={'name':{'type':Sequelize[_0xd703('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd703('0x2')]},'description':{'type':Sequelize[_0xd703('0x2')]},'status':{'type':Sequelize[_0xd703('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 201d585..b3b6a64 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 _0x8fad=['create','body','Condition','addConditions','ids','omit','getConditions','Action','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','length','query','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','Automation','find'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8fad,0x1a4));var _0xd8fa=function(_0x19e540,_0x597c37){_0x19e540=_0x19e540-0x0;var _0x2fefb6=_0x8fad[_0x19e540];return _0x2fefb6;};'use strict';var emlformat=require(_0xd8fa('0x0'));var rimraf=require(_0xd8fa('0x1'));var zipdir=require(_0xd8fa('0x2'));var jsonpatch=require(_0xd8fa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8fa('0x4'));var Mustache=require(_0xd8fa('0x5'));var util=require('util');var path=require(_0xd8fa('0x6'));var sox=require(_0xd8fa('0x7'));var csv=require(_0xd8fa('0x8'));var ejs=require(_0xd8fa('0x9'));var fs=require('fs');var fs_extra=require(_0xd8fa('0xa'));var _=require(_0xd8fa('0xb'));var squel=require(_0xd8fa('0xc'));var crypto=require(_0xd8fa('0xd'));var jsforce=require(_0xd8fa('0xe'));var deskjs=require(_0xd8fa('0xf'));var toCsv=require(_0xd8fa('0x8'));var querystring=require(_0xd8fa('0x10'));var Papa=require(_0xd8fa('0x11'));var Redis=require('ioredis');var authService=require(_0xd8fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd8fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8fa('0x14'))('api');var utils=require(_0xd8fa('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd8fa('0x16'));var db=require(_0xd8fa('0x17'))['db'];function respondWithStatusCode(_0x51c64b,_0x272548){_0x272548=_0x272548||0xcc;return function(_0x35d263){if(_0x35d263){return _0x51c64b[_0xd8fa('0x18')](_0x272548);}return _0x51c64b[_0xd8fa('0x19')](_0x272548)[_0xd8fa('0x1a')]();};}function respondWithResult(_0x246819,_0xfaec91){_0xfaec91=_0xfaec91||0xc8;return function(_0x550da5){if(_0x550da5){return _0x246819[_0xd8fa('0x19')](_0xfaec91)[_0xd8fa('0x1b')](_0x550da5);}};}function respondWithFilteredResult(_0x42dc5e,_0x3afa46){return function(_0x3e65e3){if(_0x3e65e3){var _0x1d1afb=typeof _0x3afa46[_0xd8fa('0x1c')]===_0xd8fa('0x1d')&&typeof _0x3afa46[_0xd8fa('0x1e')]===_0xd8fa('0x1d');var _0x468056=_0x3e65e3[_0xd8fa('0x1f')];var _0x48a019=_0x1d1afb?0x0:_0x3afa46['offset'];var _0x54f28d=_0x1d1afb?_0x3e65e3[_0xd8fa('0x1f')]:_0x3afa46[_0xd8fa('0x1c')]+_0x3afa46[_0xd8fa('0x1e')];var _0x313d93;if(_0x54f28d>=_0x468056){_0x54f28d=_0x468056;_0x313d93=0xc8;}else{_0x313d93=0xce;}_0x42dc5e['status'](_0x313d93);return _0x42dc5e[_0xd8fa('0x20')](_0xd8fa('0x21'),_0x48a019+'-'+_0x54f28d+'/'+_0x468056)[_0xd8fa('0x1b')](_0x3e65e3);}return null;};}function patchUpdates(_0x33f94a){return function(_0x3d28c1){try{jsonpatch[_0xd8fa('0x22')](_0x3d28c1,_0x33f94a,!![]);}catch(_0x105286){return BPromise['reject'](_0x105286);}return _0x3d28c1[_0xd8fa('0x23')]();};}function saveUpdates(_0x117f93,_0x37b27b){return function(_0x54e737){if(_0x54e737){return _0x54e737[_0xd8fa('0x24')](_0x117f93)[_0xd8fa('0x25')](function(_0x16e7dc){return _0x16e7dc;});}return null;};}function removeEntity(_0x222c34,_0x55dd27){return function(_0x4e7106){if(_0x4e7106){return _0x4e7106[_0xd8fa('0x26')]()['then'](function(){_0x222c34[_0xd8fa('0x19')](0xcc)[_0xd8fa('0x1a')]();});}};}function handleEntityNotFound(_0x3d679e,_0x2f4b30){return function(_0x5c535f){if(!_0x5c535f){_0x3d679e['sendStatus'](0x194);}return _0x5c535f;};}function handleError(_0x55967c,_0x365982){_0x365982=_0x365982||0x1f4;return function(_0x12ba4f){logger[_0xd8fa('0x27')](_0x12ba4f['stack']);if(_0x12ba4f[_0xd8fa('0x28')]){delete _0x12ba4f[_0xd8fa('0x28')];}_0x55967c[_0xd8fa('0x19')](_0x365982)['send'](_0x12ba4f);};}exports['index']=function(_0x5b37a3,_0x53f446){var _0x23711d={},_0x50e99f={},_0x3d061e={'count':0x0,'rows':[]};var _0xfd6ac=_[_0xd8fa('0x29')](db['Automation'][_0xd8fa('0x2a')],function(_0x5209d7){return{'name':_0x5209d7[_0xd8fa('0x2b')],'type':_0x5209d7[_0xd8fa('0x2c')][_0xd8fa('0x2d')]};});_0x50e99f[_0xd8fa('0x2e')]=_[_0xd8fa('0x29')](_0xfd6ac,_0xd8fa('0x28'));_0x50e99f['query']=_[_0xd8fa('0x2f')](_0x5b37a3['query']);_0x50e99f[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x50e99f['model'],_0x50e99f['query']);_0x23711d['attributes']=_[_0xd8fa('0x31')](_0x50e99f[_0xd8fa('0x2e')],qs['fields'](_0x5b37a3['query']['fields']));_0x23711d['attributes']=_0x23711d[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x23711d[_0xd8fa('0x32')]:_0x50e99f['model'];if(!_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x35')](_0xd8fa('0x36'))){_0x23711d['limit']=qs[_0xd8fa('0x1e')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x1e')]);_0x23711d[_0xd8fa('0x1c')]=qs[_0xd8fa('0x1c')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x1c')]);}_0x23711d[_0xd8fa('0x37')]=qs[_0xd8fa('0x38')](_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x38')]);_0x23711d[_0xd8fa('0x39')]=qs[_0xd8fa('0x30')](_['pick'](_0x5b37a3[_0xd8fa('0x34')],_0x50e99f[_0xd8fa('0x30')]),_0xfd6ac);if(_0x5b37a3['query'][_0xd8fa('0x3a')]){_0x23711d[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x23711d[_0xd8fa('0x39')],{'$or':_['map'](_0xfd6ac,function(_0x2ac500){if(_0x2ac500[_0xd8fa('0x2c')]!==_0xd8fa('0x3c')){var _0x5726cc={};_0x5726cc[_0x2ac500['name']]={'$like':'%'+_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x5726cc;}})});}_0x23711d=_[_0xd8fa('0x3b')]({},_0x23711d,_0x5b37a3[_0xd8fa('0x3d')]);var _0x650ea7={'where':_0x23711d[_0xd8fa('0x39')]};return db['Automation'][_0xd8fa('0x1f')](_0x650ea7)[_0xd8fa('0x25')](function(_0x18476a){_0x3d061e['count']=_0x18476a;if(_0x5b37a3[_0xd8fa('0x34')][_0xd8fa('0x3e')]){_0x23711d['include']=[{'all':!![]}];}return db['Automation'][_0xd8fa('0x3f')](_0x23711d);})[_0xd8fa('0x25')](function(_0x209e71){_0x3d061e[_0xd8fa('0x40')]=_0x209e71;return _0x3d061e;})[_0xd8fa('0x25')](respondWithFilteredResult(_0x53f446,_0x23711d))[_0xd8fa('0x41')](handleError(_0x53f446,null));};exports[_0xd8fa('0x42')]=function(_0x83eb25,_0x4702a2){var _0x5269fd={'raw':![],'where':{'id':_0x83eb25[_0xd8fa('0x43')]['id']}},_0x3c2dc5={};_0x3c2dc5[_0xd8fa('0x2e')]=_[_0xd8fa('0x2f')](db['Automation'][_0xd8fa('0x2a')]);_0x3c2dc5[_0xd8fa('0x34')]=_['keys'](_0x83eb25[_0xd8fa('0x34')]);_0x3c2dc5['filters']=_[_0xd8fa('0x31')](_0x3c2dc5['model'],_0x3c2dc5[_0xd8fa('0x34')]);_0x5269fd[_0xd8fa('0x32')]=_[_0xd8fa('0x31')](_0x3c2dc5[_0xd8fa('0x2e')],qs[_0xd8fa('0x44')](_0x83eb25[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x5269fd[_0xd8fa('0x32')]=_0x5269fd[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x5269fd['attributes']:_0x3c2dc5[_0xd8fa('0x2e')];if(_0x83eb25[_0xd8fa('0x34')]['includeAll']){_0x5269fd[_0xd8fa('0x45')]=[{'all':!![]}];}_0x5269fd=_[_0xd8fa('0x3b')]({},_0x5269fd,_0x83eb25[_0xd8fa('0x3d')]);return db[_0xd8fa('0x46')][_0xd8fa('0x47')](_0x5269fd)[_0xd8fa('0x25')](handleEntityNotFound(_0x4702a2,null))[_0xd8fa('0x25')](respondWithResult(_0x4702a2,null))[_0xd8fa('0x41')](handleError(_0x4702a2,null));};exports['create']=function(_0x18840e,_0x48887b){return db[_0xd8fa('0x46')][_0xd8fa('0x48')](_0x18840e[_0xd8fa('0x49')],{})['then'](respondWithResult(_0x48887b,0xc9))[_0xd8fa('0x41')](handleError(_0x48887b,null));};exports[_0xd8fa('0x24')]=function(_0x3725fb,_0x568930){if(_0x3725fb['body']['id']){delete _0x3725fb['body']['id'];}return db[_0xd8fa('0x46')]['find']({'where':{'id':_0x3725fb[_0xd8fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x568930,null))['then'](saveUpdates(_0x3725fb[_0xd8fa('0x49')],null))[_0xd8fa('0x25')](respondWithResult(_0x568930,null))[_0xd8fa('0x41')](handleError(_0x568930,null));};exports['destroy']=function(_0x3428a1,_0x870a57){return db[_0xd8fa('0x46')][_0xd8fa('0x47')]({'where':{'id':_0x3428a1[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x870a57,null))[_0xd8fa('0x25')](removeEntity(_0x870a57,null))[_0xd8fa('0x41')](handleError(_0x870a57,null));};exports['addConditions']=function(_0x1294f5,_0x3b487a,_0xf5b97e){return db[_0xd8fa('0x4a')]['find']({'where':{'id':_0x1294f5[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x3b487a,null))[_0xd8fa('0x25')](function(_0x4d0d5a){if(_0x4d0d5a){return _0x4d0d5a[_0xd8fa('0x4b')](_0x1294f5[_0xd8fa('0x49')][_0xd8fa('0x4c')],_[_0xd8fa('0x4d')](_0x1294f5[_0xd8fa('0x49')],[_0xd8fa('0x4c'),'id'])||{});}})[_0xd8fa('0x25')](respondWithResult(_0x3b487a,null))[_0xd8fa('0x41')](handleError(_0x3b487a,null));};exports['getConditions']=function(_0x306871,_0x304580,_0x1ef13f){var _0x403c7f={};var _0x2608be={};var _0x5462b8;var _0xfa3e8a;return db[_0xd8fa('0x46')]['findOne']({'where':{'id':_0x306871[_0xd8fa('0x43')]['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x304580,null))[_0xd8fa('0x25')](function(_0x56f4dc){if(_0x56f4dc){_0x5462b8=_0x56f4dc;_0x2608be[_0xd8fa('0x2e')]=_['keys'](db['Condition'][_0xd8fa('0x2a')]);_0x2608be[_0xd8fa('0x34')]=_['keys'](_0x306871[_0xd8fa('0x34')]);_0x2608be[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x2608be[_0xd8fa('0x2e')],_0x2608be['query']);_0x403c7f['attributes']=_['intersection'](_0x2608be[_0xd8fa('0x2e')],qs['fields'](_0x306871[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x403c7f[_0xd8fa('0x32')]=_0x403c7f[_0xd8fa('0x32')][_0xd8fa('0x33')]?_0x403c7f[_0xd8fa('0x32')]:_0x2608be[_0xd8fa('0x2e')];_0x403c7f[_0xd8fa('0x37')]=qs['sort'](_0x306871[_0xd8fa('0x34')]['sort']);_0x403c7f[_0xd8fa('0x39')]=qs[_0xd8fa('0x30')](_['pick'](_0x306871['query'],_0x2608be[_0xd8fa('0x30')]));if(_0x306871[_0xd8fa('0x34')]['filter']){_0x403c7f[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x403c7f['where'],{'$or':_['map'](_0x403c7f[_0xd8fa('0x32')],function(_0x445b25){var _0x18c74f={};_0x18c74f[_0x445b25]={'$like':'%'+_0x306871[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x18c74f;})});}_0x403c7f=_[_0xd8fa('0x3b')]({},_0x403c7f,_0x306871[_0xd8fa('0x3d')]);return _0x5462b8[_0xd8fa('0x4e')](_0x403c7f);}})[_0xd8fa('0x25')](function(_0x25d758){if(_0x25d758){_0xfa3e8a=_0x25d758['length'];if(!_0x306871['query'][_0xd8fa('0x35')](_0xd8fa('0x36'))){_0x403c7f['limit']=qs['limit'](_0x306871[_0xd8fa('0x34')][_0xd8fa('0x1e')]);_0x403c7f['offset']=qs[_0xd8fa('0x1c')](_0x306871['query'][_0xd8fa('0x1c')]);}return _0x5462b8[_0xd8fa('0x4e')](_0x403c7f);}})[_0xd8fa('0x25')](function(_0x2e2d32){if(_0x2e2d32){return _0x2e2d32?{'count':_0xfa3e8a,'rows':_0x2e2d32}:null;}})[_0xd8fa('0x25')](respondWithResult(_0x304580,null))[_0xd8fa('0x41')](handleError(_0x304580,null));};exports['addActions']=function(_0x5676a7,_0x22f268,_0xb14774){return db[_0xd8fa('0x4f')][_0xd8fa('0x47')]({'where':{'id':_0x5676a7['params']['id']}})[_0xd8fa('0x25')](handleEntityNotFound(_0x22f268,null))[_0xd8fa('0x25')](function(_0x54c9c9){if(_0x54c9c9){return _0x54c9c9['addActions'](_0x5676a7[_0xd8fa('0x49')]['ids'],_[_0xd8fa('0x4d')](_0x5676a7[_0xd8fa('0x49')],[_0xd8fa('0x4c'),'id'])||{});}})[_0xd8fa('0x25')](respondWithResult(_0x22f268,null))[_0xd8fa('0x41')](handleError(_0x22f268,null));};exports[_0xd8fa('0x50')]=function(_0x2f38d9,_0x639d0,_0x3d3040){var _0x533caf={};var _0x248982={};var _0x309b9a;var _0x46661a;return db[_0xd8fa('0x46')]['findOne']({'where':{'id':_0x2f38d9[_0xd8fa('0x43')]['id']}})['then'](handleEntityNotFound(_0x639d0,null))['then'](function(_0x45421a){if(_0x45421a){_0x309b9a=_0x45421a;_0x248982[_0xd8fa('0x2e')]=_[_0xd8fa('0x2f')](db[_0xd8fa('0x4f')][_0xd8fa('0x2a')]);_0x248982[_0xd8fa('0x34')]=_['keys'](_0x2f38d9[_0xd8fa('0x34')]);_0x248982[_0xd8fa('0x30')]=_[_0xd8fa('0x31')](_0x248982['model'],_0x248982['query']);_0x533caf[_0xd8fa('0x32')]=_[_0xd8fa('0x31')](_0x248982['model'],qs[_0xd8fa('0x44')](_0x2f38d9[_0xd8fa('0x34')][_0xd8fa('0x44')]));_0x533caf[_0xd8fa('0x32')]=_0x533caf['attributes'][_0xd8fa('0x33')]?_0x533caf[_0xd8fa('0x32')]:_0x248982[_0xd8fa('0x2e')];_0x533caf[_0xd8fa('0x37')]=qs[_0xd8fa('0x38')](_0x2f38d9['query'][_0xd8fa('0x38')]);_0x533caf['where']=qs[_0xd8fa('0x30')](_[_0xd8fa('0x51')](_0x2f38d9[_0xd8fa('0x34')],_0x248982[_0xd8fa('0x30')]));if(_0x2f38d9['query'][_0xd8fa('0x3a')]){_0x533caf[_0xd8fa('0x39')]=_[_0xd8fa('0x3b')](_0x533caf['where'],{'$or':_[_0xd8fa('0x29')](_0x533caf[_0xd8fa('0x32')],function(_0x428d50){var _0x370eff={};_0x370eff[_0x428d50]={'$like':'%'+_0x2f38d9[_0xd8fa('0x34')][_0xd8fa('0x3a')]+'%'};return _0x370eff;})});}_0x533caf=_['merge']({},_0x533caf,_0x2f38d9['options']);return _0x309b9a['getActions'](_0x533caf);}})[_0xd8fa('0x25')](function(_0xc8e648){if(_0xc8e648){_0x46661a=_0xc8e648[_0xd8fa('0x33')];if(!_0x2f38d9[_0xd8fa('0x34')]['hasOwnProperty'](_0xd8fa('0x36'))){_0x533caf[_0xd8fa('0x1e')]=qs[_0xd8fa('0x1e')](_0x2f38d9['query'][_0xd8fa('0x1e')]);_0x533caf[_0xd8fa('0x1c')]=qs[_0xd8fa('0x1c')](_0x2f38d9[_0xd8fa('0x34')]['offset']);}return _0x309b9a[_0xd8fa('0x50')](_0x533caf);}})[_0xd8fa('0x25')](function(_0x118ffc){if(_0x118ffc){return _0x118ffc?{'count':_0x46661a,'rows':_0x118ffc}:null;}})[_0xd8fa('0x25')](respondWithResult(_0x639d0,null))['catch'](handleError(_0x639d0,null));}; \ No newline at end of file +var _0xa524=['reject','save','update','then','destroy','end','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','create','body','params','find','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','count','offset','apply'];(function(_0x5919a0,_0x3d3c9a){var _0x1ccfaa=function(_0x3de102){while(--_0x3de102){_0x5919a0['push'](_0x5919a0['shift']());}};_0x1ccfaa(++_0x3d3c9a);}(_0xa524,0x83));var _0x4a52=function(_0x33925b,_0x95cfc6){_0x33925b=_0x33925b-0x0;var _0x375e21=_0xa524[_0x33925b];return _0x375e21;};'use strict';var emlformat=require(_0x4a52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a52('0x1'));var jsonpatch=require(_0x4a52('0x2'));var rp=require(_0x4a52('0x3'));var moment=require('moment');var BPromise=require(_0x4a52('0x4'));var Mustache=require(_0x4a52('0x5'));var util=require(_0x4a52('0x6'));var path=require('path');var sox=require(_0x4a52('0x7'));var csv=require(_0x4a52('0x8'));var ejs=require(_0x4a52('0x9'));var fs=require('fs');var fs_extra=require(_0x4a52('0xa'));var _=require(_0x4a52('0xb'));var squel=require(_0x4a52('0xc'));var crypto=require(_0x4a52('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a52('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a52('0xf'));var Redis=require('ioredis');var authService=require(_0x4a52('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a52('0x11'))(_0x4a52('0x12'));var utils=require(_0x4a52('0x13'));var config=require(_0x4a52('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a52('0x15'))['db'];function respondWithStatusCode(_0x299cfa,_0x5c940d){_0x5c940d=_0x5c940d||0xcc;return function(_0x1a2dc7){if(_0x1a2dc7){return _0x299cfa[_0x4a52('0x16')](_0x5c940d);}return _0x299cfa[_0x4a52('0x17')](_0x5c940d)['end']();};}function respondWithResult(_0x540d20,_0x33f74b){_0x33f74b=_0x33f74b||0xc8;return function(_0x5138b6){if(_0x5138b6){return _0x540d20[_0x4a52('0x17')](_0x33f74b)[_0x4a52('0x18')](_0x5138b6);}};}function respondWithFilteredResult(_0x247602,_0x1e589d){return function(_0x6806d5){if(_0x6806d5){var _0x4a53e3=typeof _0x1e589d['offset']==='undefined'&&typeof _0x1e589d[_0x4a52('0x19')]==='undefined';var _0x454c53=_0x6806d5[_0x4a52('0x1a')];var _0x440de4=_0x4a53e3?0x0:_0x1e589d[_0x4a52('0x1b')];var _0x5a772e=_0x4a53e3?_0x6806d5[_0x4a52('0x1a')]:_0x1e589d['offset']+_0x1e589d[_0x4a52('0x19')];var _0x30617b;if(_0x5a772e>=_0x454c53){_0x5a772e=_0x454c53;_0x30617b=0xc8;}else{_0x30617b=0xce;}_0x247602[_0x4a52('0x17')](_0x30617b);return _0x247602['set']('Content-Range',_0x440de4+'-'+_0x5a772e+'/'+_0x454c53)[_0x4a52('0x18')](_0x6806d5);}return null;};}function patchUpdates(_0x489627){return function(_0x46d07){try{jsonpatch[_0x4a52('0x1c')](_0x46d07,_0x489627,!![]);}catch(_0x3d6802){return BPromise[_0x4a52('0x1d')](_0x3d6802);}return _0x46d07[_0x4a52('0x1e')]();};}function saveUpdates(_0x25cb60,_0x3aeccd){return function(_0x51b755){if(_0x51b755){return _0x51b755[_0x4a52('0x1f')](_0x25cb60)[_0x4a52('0x20')](function(_0x2c280e){return _0x2c280e;});}return null;};}function removeEntity(_0x40cce4,_0x2910af){return function(_0x5774f2){if(_0x5774f2){return _0x5774f2[_0x4a52('0x21')]()['then'](function(){_0x40cce4['status'](0xcc)[_0x4a52('0x22')]();});}};}function handleEntityNotFound(_0x54c1e6,_0x3b4557){return function(_0x43ff7a){if(!_0x43ff7a){_0x54c1e6[_0x4a52('0x16')](0x194);}return _0x43ff7a;};}function handleError(_0x5a8180,_0x342d66){_0x342d66=_0x342d66||0x1f4;return function(_0x3b8abe){logger['error'](_0x3b8abe[_0x4a52('0x23')]);if(_0x3b8abe[_0x4a52('0x24')]){delete _0x3b8abe['name'];}_0x5a8180[_0x4a52('0x17')](_0x342d66)['send'](_0x3b8abe);};}exports[_0x4a52('0x25')]=function(_0x5e329d,_0x14f37d){var _0x5e8aba={},_0x228737={},_0x4c2a51={'count':0x0,'rows':[]};var _0x282bb6=_[_0x4a52('0x26')](db[_0x4a52('0x27')][_0x4a52('0x28')],function(_0x4ce016){return{'name':_0x4ce016[_0x4a52('0x29')],'type':_0x4ce016[_0x4a52('0x2a')][_0x4a52('0x2b')]};});_0x228737[_0x4a52('0x2c')]=_['map'](_0x282bb6,'name');_0x228737[_0x4a52('0x2d')]=_[_0x4a52('0x2e')](_0x5e329d['query']);_0x228737[_0x4a52('0x2f')]=_[_0x4a52('0x30')](_0x228737[_0x4a52('0x2c')],_0x228737['query']);_0x5e8aba['attributes']=_['intersection'](_0x228737[_0x4a52('0x2c')],qs[_0x4a52('0x31')](_0x5e329d['query'][_0x4a52('0x31')]));_0x5e8aba['attributes']=_0x5e8aba[_0x4a52('0x32')][_0x4a52('0x33')]?_0x5e8aba[_0x4a52('0x32')]:_0x228737[_0x4a52('0x2c')];if(!_0x5e329d[_0x4a52('0x2d')][_0x4a52('0x34')](_0x4a52('0x35'))){_0x5e8aba['limit']=qs[_0x4a52('0x19')](_0x5e329d[_0x4a52('0x2d')]['limit']);_0x5e8aba[_0x4a52('0x1b')]=qs[_0x4a52('0x1b')](_0x5e329d['query'][_0x4a52('0x1b')]);}_0x5e8aba[_0x4a52('0x36')]=qs[_0x4a52('0x37')](_0x5e329d[_0x4a52('0x2d')]['sort']);_0x5e8aba[_0x4a52('0x38')]=qs[_0x4a52('0x2f')](_[_0x4a52('0x39')](_0x5e329d['query'],_0x228737[_0x4a52('0x2f')]),_0x282bb6);if(_0x5e329d[_0x4a52('0x2d')][_0x4a52('0x3a')]){_0x5e8aba[_0x4a52('0x38')]=_[_0x4a52('0x3b')](_0x5e8aba[_0x4a52('0x38')],{'$or':_['map'](_0x282bb6,function(_0x51b940){if(_0x51b940[_0x4a52('0x2a')]!==_0x4a52('0x3c')){var _0xa9aab3={};_0xa9aab3[_0x51b940['name']]={'$like':'%'+_0x5e329d[_0x4a52('0x2d')]['filter']+'%'};return _0xa9aab3;}})});}_0x5e8aba=_[_0x4a52('0x3b')]({},_0x5e8aba,_0x5e329d[_0x4a52('0x3d')]);var _0x433fb5={'where':_0x5e8aba['where']};return db[_0x4a52('0x27')][_0x4a52('0x1a')](_0x433fb5)[_0x4a52('0x20')](function(_0x479f2b){_0x4c2a51[_0x4a52('0x1a')]=_0x479f2b;if(_0x5e329d[_0x4a52('0x2d')][_0x4a52('0x3e')]){_0x5e8aba['include']=[{'all':!![]}];}return db[_0x4a52('0x27')][_0x4a52('0x3f')](_0x5e8aba);})['then'](function(_0x1a0571){_0x4c2a51[_0x4a52('0x40')]=_0x1a0571;return _0x4c2a51;})[_0x4a52('0x20')](respondWithFilteredResult(_0x14f37d,_0x5e8aba))[_0x4a52('0x41')](handleError(_0x14f37d,null));};exports['show']=function(_0x2eb9c4,_0x22d151){var _0x26cbcf={'raw':![],'where':{'id':_0x2eb9c4['params']['id']}},_0x5db31f={};_0x5db31f[_0x4a52('0x2c')]=_['keys'](db['Automation'][_0x4a52('0x28')]);_0x5db31f[_0x4a52('0x2d')]=_[_0x4a52('0x2e')](_0x2eb9c4[_0x4a52('0x2d')]);_0x5db31f['filters']=_[_0x4a52('0x30')](_0x5db31f['model'],_0x5db31f['query']);_0x26cbcf['attributes']=_['intersection'](_0x5db31f['model'],qs[_0x4a52('0x31')](_0x2eb9c4[_0x4a52('0x2d')][_0x4a52('0x31')]));_0x26cbcf[_0x4a52('0x32')]=_0x26cbcf['attributes']['length']?_0x26cbcf[_0x4a52('0x32')]:_0x5db31f[_0x4a52('0x2c')];if(_0x2eb9c4[_0x4a52('0x2d')][_0x4a52('0x3e')]){_0x26cbcf[_0x4a52('0x42')]=[{'all':!![]}];}_0x26cbcf=_['merge']({},_0x26cbcf,_0x2eb9c4['options']);return db[_0x4a52('0x27')]['find'](_0x26cbcf)[_0x4a52('0x20')](handleEntityNotFound(_0x22d151,null))[_0x4a52('0x20')](respondWithResult(_0x22d151,null))['catch'](handleError(_0x22d151,null));};exports[_0x4a52('0x43')]=function(_0x16ff75,_0x383508){return db[_0x4a52('0x27')][_0x4a52('0x43')](_0x16ff75[_0x4a52('0x44')],{})['then'](respondWithResult(_0x383508,0xc9))[_0x4a52('0x41')](handleError(_0x383508,null));};exports[_0x4a52('0x1f')]=function(_0xaea45b,_0x20b0d8){if(_0xaea45b[_0x4a52('0x44')]['id']){delete _0xaea45b[_0x4a52('0x44')]['id'];}return db[_0x4a52('0x27')]['find']({'where':{'id':_0xaea45b[_0x4a52('0x45')]['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x20b0d8,null))[_0x4a52('0x20')](saveUpdates(_0xaea45b[_0x4a52('0x44')],null))['then'](respondWithResult(_0x20b0d8,null))[_0x4a52('0x41')](handleError(_0x20b0d8,null));};exports[_0x4a52('0x21')]=function(_0x4a7f27,_0x44483c){return db['Automation'][_0x4a52('0x46')]({'where':{'id':_0x4a7f27['params']['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x44483c,null))['then'](removeEntity(_0x44483c,null))[_0x4a52('0x41')](handleError(_0x44483c,null));};exports[_0x4a52('0x47')]=function(_0xea63e,_0x466e72,_0x3781a6){return db[_0x4a52('0x48')][_0x4a52('0x46')]({'where':{'id':_0xea63e[_0x4a52('0x45')]['id']}})['then'](handleEntityNotFound(_0x466e72,null))[_0x4a52('0x20')](function(_0x440797){if(_0x440797){return _0x440797[_0x4a52('0x47')](_0xea63e[_0x4a52('0x44')][_0x4a52('0x49')],_[_0x4a52('0x4a')](_0xea63e['body'],[_0x4a52('0x49'),'id'])||{});}})[_0x4a52('0x20')](respondWithResult(_0x466e72,null))[_0x4a52('0x41')](handleError(_0x466e72,null));};exports[_0x4a52('0x4b')]=function(_0x19c988,_0x7616f,_0x4c2699){var _0x318d3a={};var _0x3cfde1={};var _0x2feb47;var _0x2703ef;return db[_0x4a52('0x27')][_0x4a52('0x4c')]({'where':{'id':_0x19c988[_0x4a52('0x45')]['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x7616f,null))['then'](function(_0x2fdc8c){if(_0x2fdc8c){_0x2feb47=_0x2fdc8c;_0x3cfde1[_0x4a52('0x2c')]=_[_0x4a52('0x2e')](db['Condition']['rawAttributes']);_0x3cfde1[_0x4a52('0x2d')]=_['keys'](_0x19c988[_0x4a52('0x2d')]);_0x3cfde1['filters']=_[_0x4a52('0x30')](_0x3cfde1[_0x4a52('0x2c')],_0x3cfde1['query']);_0x318d3a['attributes']=_['intersection'](_0x3cfde1['model'],qs['fields'](_0x19c988[_0x4a52('0x2d')][_0x4a52('0x31')]));_0x318d3a['attributes']=_0x318d3a['attributes'][_0x4a52('0x33')]?_0x318d3a[_0x4a52('0x32')]:_0x3cfde1['model'];_0x318d3a[_0x4a52('0x36')]=qs[_0x4a52('0x37')](_0x19c988[_0x4a52('0x2d')][_0x4a52('0x37')]);_0x318d3a[_0x4a52('0x38')]=qs[_0x4a52('0x2f')](_[_0x4a52('0x39')](_0x19c988['query'],_0x3cfde1[_0x4a52('0x2f')]));if(_0x19c988[_0x4a52('0x2d')][_0x4a52('0x3a')]){_0x318d3a[_0x4a52('0x38')]=_[_0x4a52('0x3b')](_0x318d3a[_0x4a52('0x38')],{'$or':_['map'](_0x318d3a[_0x4a52('0x32')],function(_0x4a4993){var _0x4b8a77={};_0x4b8a77[_0x4a4993]={'$like':'%'+_0x19c988[_0x4a52('0x2d')][_0x4a52('0x3a')]+'%'};return _0x4b8a77;})});}_0x318d3a=_[_0x4a52('0x3b')]({},_0x318d3a,_0x19c988['options']);return _0x2feb47[_0x4a52('0x4b')](_0x318d3a);}})[_0x4a52('0x20')](function(_0x3a670f){if(_0x3a670f){_0x2703ef=_0x3a670f[_0x4a52('0x33')];if(!_0x19c988[_0x4a52('0x2d')][_0x4a52('0x34')](_0x4a52('0x35'))){_0x318d3a[_0x4a52('0x19')]=qs[_0x4a52('0x19')](_0x19c988['query'][_0x4a52('0x19')]);_0x318d3a['offset']=qs[_0x4a52('0x1b')](_0x19c988['query'][_0x4a52('0x1b')]);}return _0x2feb47[_0x4a52('0x4b')](_0x318d3a);}})[_0x4a52('0x20')](function(_0x50aec0){if(_0x50aec0){return _0x50aec0?{'count':_0x2703ef,'rows':_0x50aec0}:null;}})[_0x4a52('0x20')](respondWithResult(_0x7616f,null))['catch'](handleError(_0x7616f,null));};exports[_0x4a52('0x4d')]=function(_0x86079a,_0x128527,_0x453fed){return db[_0x4a52('0x4e')][_0x4a52('0x46')]({'where':{'id':_0x86079a[_0x4a52('0x45')]['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x128527,null))[_0x4a52('0x20')](function(_0x504e89){if(_0x504e89){return _0x504e89[_0x4a52('0x4d')](_0x86079a['body'][_0x4a52('0x49')],_[_0x4a52('0x4a')](_0x86079a[_0x4a52('0x44')],[_0x4a52('0x49'),'id'])||{});}})['then'](respondWithResult(_0x128527,null))[_0x4a52('0x41')](handleError(_0x128527,null));};exports[_0x4a52('0x4f')]=function(_0x5791ec,_0x3fe2f2,_0x4315db){var _0x13792c={};var _0x3f1438={};var _0x252d83;var _0x4628f6;return db['Automation'][_0x4a52('0x4c')]({'where':{'id':_0x5791ec['params']['id']}})[_0x4a52('0x20')](handleEntityNotFound(_0x3fe2f2,null))['then'](function(_0x5ca71f){if(_0x5ca71f){_0x252d83=_0x5ca71f;_0x3f1438[_0x4a52('0x2c')]=_[_0x4a52('0x2e')](db['Action'][_0x4a52('0x28')]);_0x3f1438[_0x4a52('0x2d')]=_['keys'](_0x5791ec['query']);_0x3f1438[_0x4a52('0x2f')]=_['intersection'](_0x3f1438[_0x4a52('0x2c')],_0x3f1438['query']);_0x13792c[_0x4a52('0x32')]=_[_0x4a52('0x30')](_0x3f1438['model'],qs['fields'](_0x5791ec[_0x4a52('0x2d')][_0x4a52('0x31')]));_0x13792c[_0x4a52('0x32')]=_0x13792c[_0x4a52('0x32')][_0x4a52('0x33')]?_0x13792c[_0x4a52('0x32')]:_0x3f1438[_0x4a52('0x2c')];_0x13792c[_0x4a52('0x36')]=qs[_0x4a52('0x37')](_0x5791ec[_0x4a52('0x2d')][_0x4a52('0x37')]);_0x13792c[_0x4a52('0x38')]=qs[_0x4a52('0x2f')](_[_0x4a52('0x39')](_0x5791ec[_0x4a52('0x2d')],_0x3f1438[_0x4a52('0x2f')]));if(_0x5791ec[_0x4a52('0x2d')][_0x4a52('0x3a')]){_0x13792c['where']=_[_0x4a52('0x3b')](_0x13792c[_0x4a52('0x38')],{'$or':_[_0x4a52('0x26')](_0x13792c['attributes'],function(_0x43c5c8){var _0x429d0e={};_0x429d0e[_0x43c5c8]={'$like':'%'+_0x5791ec[_0x4a52('0x2d')]['filter']+'%'};return _0x429d0e;})});}_0x13792c=_[_0x4a52('0x3b')]({},_0x13792c,_0x5791ec[_0x4a52('0x3d')]);return _0x252d83[_0x4a52('0x4f')](_0x13792c);}})['then'](function(_0x495799){if(_0x495799){_0x4628f6=_0x495799['length'];if(!_0x5791ec['query'][_0x4a52('0x34')](_0x4a52('0x35'))){_0x13792c['limit']=qs[_0x4a52('0x19')](_0x5791ec[_0x4a52('0x2d')]['limit']);_0x13792c[_0x4a52('0x1b')]=qs[_0x4a52('0x1b')](_0x5791ec[_0x4a52('0x2d')]['offset']);}return _0x252d83[_0x4a52('0x4f')](_0x13792c);}})[_0x4a52('0x20')](function(_0x27886b){if(_0x27886b){return _0x27886b?{'count':_0x4628f6,'rows':_0x27886b}:null;}})[_0x4a52('0x20')](respondWithResult(_0x3fe2f2,null))[_0x4a52('0x41')](handleError(_0x3fe2f2,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3ccba71..360b6bc 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 _0xd558=['util','../../config/logger','api','moment','request-promise','path','rimraf','./automation.attributes','exports','define','tools_automations','lodash'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xd558,0xb3));var _0x8d55=function(_0x26bf59,_0x3fd050){_0x26bf59=_0x26bf59-0x0;var _0x14a039=_0xd558[_0x26bf59];return _0x14a039;};'use strict';var _=require(_0x8d55('0x0'));var util=require(_0x8d55('0x1'));var logger=require(_0x8d55('0x2'))(_0x8d55('0x3'));var moment=require(_0x8d55('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d55('0x5'));var fs=require('fs');var path=require(_0x8d55('0x6'));var rimraf=require(_0x8d55('0x7'));var config=require('../../config/environment');var attributes=require(_0x8d55('0x8'));module[_0x8d55('0x9')]=function(_0x33e204,_0x4a4317){return _0x33e204[_0x8d55('0xa')]('Automation',attributes,{'tableName':_0x8d55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02e1=['moment','bluebird','request-promise','path','../../config/environment','exports','define','Automation','tools_automations','lodash','api'];(function(_0x411254,_0x3a4f1e){var _0x32c1e6=function(_0x166371){while(--_0x166371){_0x411254['push'](_0x411254['shift']());}};_0x32c1e6(++_0x3a4f1e);}(_0x02e1,0x132));var _0x102e=function(_0x419a47,_0x17697b){_0x419a47=_0x419a47-0x0;var _0x46ea5e=_0x02e1[_0x419a47];return _0x46ea5e;};'use strict';var _=require(_0x102e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x102e('0x1'));var moment=require(_0x102e('0x2'));var BPromise=require(_0x102e('0x3'));var rp=require(_0x102e('0x4'));var fs=require('fs');var path=require(_0x102e('0x5'));var rimraf=require('rimraf');var config=require(_0x102e('0x6'));var attributes=require('./automation.attributes');module[_0x102e('0x7')]=function(_0x1bfbcf,_0x37384a){return _0x1bfbcf[_0x102e('0x8')](_0x102e('0x9'),attributes,{'tableName':_0x102e('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 990ee7b..aeb64c1 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 _0xf603=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xf603,0xeb));var _0x3f60=function(_0x34890c,_0x3ca746){_0x34890c=_0x34890c-0x0;var _0x129ef6=_0xf603[_0x34890c];return _0x129ef6;};'use strict';var _=require(_0x3f60('0x0'));var util=require(_0x3f60('0x1'));var moment=require(_0x3f60('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f60('0x3'));var fs=require('fs');var Redis=require(_0x3f60('0x4'));var db=require(_0x3f60('0x5'))['db'];var utils=require(_0x3f60('0x6'));var logger=require(_0x3f60('0x7'))('rpc');var config=require(_0x3f60('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ec43c,_0x375f1e,_0x17659b){return new BPromise(function(_0x434249,_0x9282dd){return client['request'](_0x1ec43c,_0x17659b)[_0x3f60('0xa')](function(_0x33dcc8){logger[_0x3f60('0xb')](_0x3f60('0xc'),_0x375f1e,'request\x20sent');logger['debug'](_0x3f60('0xd'),_0x375f1e,_0x3f60('0xe'),JSON[_0x3f60('0xf')](_0x33dcc8));if(_0x33dcc8['error']){if(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x11')]===0x1f4){logger[_0x3f60('0x10')]('Automation,\x20%s,\x20%s',_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x9282dd(_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);}logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x33dcc8[_0x3f60('0x10')][_0x3f60('0x12')]);return _0x434249(_0x33dcc8['error']['message']);}else{logger['info'](_0x3f60('0xc'),_0x375f1e,_0x3f60('0xe'));_0x434249(_0x33dcc8[_0x3f60('0x13')][_0x3f60('0x12')]);}})[_0x3f60('0x14')](function(_0x224982){logger[_0x3f60('0x10')](_0x3f60('0xc'),_0x375f1e,_0x224982);_0x9282dd(_0x224982);});});} \ No newline at end of file +var _0xb6fa=['then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2820f0,_0x3ff9bc){var _0x50a3f3=function(_0x20cf86){while(--_0x20cf86){_0x2820f0['push'](_0x2820f0['shift']());}};_0x50a3f3(++_0x3ff9bc);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0xb6fa[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab6f('0x2'))['db'];var utils=require(_0xab6f('0x3'));var logger=require('../../config/logger')(_0xab6f('0x4'));var config=require(_0xab6f('0x5'));var jayson=require(_0xab6f('0x6'));var client=jayson[_0xab6f('0x7')][_0xab6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x895acc,_0x16b84e,_0x1b4da9){return new BPromise(function(_0x46b0f6,_0x85cb19){return client[_0xab6f('0x9')](_0x895acc,_0x1b4da9)[_0xab6f('0xa')](function(_0x199f2d){logger[_0xab6f('0xb')](_0xab6f('0xc'),_0x16b84e,_0xab6f('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x16b84e,_0xab6f('0xd'),JSON[_0xab6f('0xe')](_0x199f2d));if(_0x199f2d['error']){if(_0x199f2d[_0xab6f('0xf')][_0xab6f('0x10')]===0x1f4){logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')][_0xab6f('0x11')]);return _0x85cb19(_0x199f2d[_0xab6f('0xf')]['message']);}logger[_0xab6f('0xf')](_0xab6f('0xc'),_0x16b84e,_0x199f2d[_0xab6f('0xf')]['message']);return _0x46b0f6(_0x199f2d[_0xab6f('0xf')]['message']);}else{logger['info'](_0xab6f('0xc'),_0x16b84e,'request\x20sent');_0x46b0f6(_0x199f2d[_0xab6f('0x12')][_0xab6f('0x11')]);}})[_0xab6f('0x13')](function(_0x59b934){logger[_0xab6f('0xf')]('Automation,\x20%s,\x20%s',_0x16b84e,_0x59b934);_0x85cb19(_0x59b934);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 7aeb653..1cc4601 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 _0xc5b1=['getActions','post','create','addConditions','addActions','put','update','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x5d0b34,_0x20557b){var _0x472a0f=function(_0x3e7ff9){while(--_0x3e7ff9){_0x5d0b34['push'](_0x5d0b34['shift']());}};_0x472a0f(++_0x20557b);}(_0xc5b1,0x106));var _0x1c5b=function(_0x55889e,_0x466fbf){_0x55889e=_0x55889e-0x0;var _0x48a697=_0xc5b1[_0x55889e];return _0x48a697;};'use strict';var multer=require(_0x1c5b('0x0'));var util=require(_0x1c5b('0x1'));var path=require(_0x1c5b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1c5b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1c5b('0x4'));var config=require(_0x1c5b('0x5'));var controller=require('./automation.controller');router[_0x1c5b('0x6')]('/',auth['isAuthenticated'](),controller[_0x1c5b('0x7')]);router[_0x1c5b('0x6')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xa')]);router['get'](_0x1c5b('0xb'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0xc')]);router[_0x1c5b('0x6')](_0x1c5b('0xd'),auth['isAuthenticated'](),controller[_0x1c5b('0xe')]);router[_0x1c5b('0xf')]('/',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x10')]);router[_0x1c5b('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x1c5b('0x11')]);router['post']('/:id/actions',auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x12')]);router[_0x1c5b('0x13')](_0x1c5b('0x8'),auth[_0x1c5b('0x9')](),controller[_0x1c5b('0x14')]);router['delete'](_0x1c5b('0x8'),auth['isAuthenticated'](),controller[_0x1c5b('0x15')]);module[_0x1c5b('0x16')]=router; \ No newline at end of file +var _0x12dc=['./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x10f060,_0x312a7b){var _0x512722=function(_0x2b0ce0){while(--_0x2b0ce0){_0x10f060['push'](_0x10f060['shift']());}};_0x512722(++_0x312a7b);}(_0x12dc,0xb4));var _0xc12d=function(_0x2a909c,_0x41eaf8){_0x2a909c=_0x2a909c-0x0;var _0x490155=_0x12dc[_0x2a909c];return _0x490155;};'use strict';var multer=require(_0xc12d('0x0'));var util=require(_0xc12d('0x1'));var path=require('path');var timeout=require(_0xc12d('0x2'));var express=require(_0xc12d('0x3'));var router=express[_0xc12d('0x4')]();var fs_extra=require(_0xc12d('0x5'));var auth=require(_0xc12d('0x6'));var interaction=require(_0xc12d('0x7'));var config=require(_0xc12d('0x8'));var controller=require(_0xc12d('0x9'));router[_0xc12d('0xa')]('/',auth['isAuthenticated'](),controller[_0xc12d('0xb')]);router[_0xc12d('0xa')](_0xc12d('0xc'),auth[_0xc12d('0xd')](),controller[_0xc12d('0xe')]);router[_0xc12d('0xa')]('/:id/conditions',auth[_0xc12d('0xd')](),controller[_0xc12d('0xf')]);router['get'](_0xc12d('0x10'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x11')]);router[_0xc12d('0x12')]('/',auth[_0xc12d('0xd')](),controller[_0xc12d('0x13')]);router[_0xc12d('0x12')](_0xc12d('0x14'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x15')]);router[_0xc12d('0x12')](_0xc12d('0x10'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x16')]);router[_0xc12d('0x17')]('/:id',auth[_0xc12d('0xd')](),controller[_0xc12d('0x18')]);router['delete'](_0xc12d('0xc'),auth[_0xc12d('0xd')](),controller[_0xc12d('0x19')]);module[_0xc12d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 682bf40..d369c06 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 _0xeb1c=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#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','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x193de9,_0x27d9d0){var _0x3c8210=function(_0x20d2e7){while(--_0x20d2e7){_0x193de9['push'](_0x193de9['shift']());}};_0x3c8210(++_0x27d9d0);}(_0xeb1c,0xa0));var _0xceb1=function(_0x19796e,_0x4802dc){_0x19796e=_0x19796e-0x0;var _0x45172a=_0xeb1c[_0x19796e];return _0x45172a;};'use strict';var Sequelize=require(_0xceb1('0x0'));module[_0xceb1('0x1')]={'name':{'type':Sequelize[_0xceb1('0x2')],'unique':_0xceb1('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xceb1('0x4')),'allowNull':![],'defaultValue':_0xceb1('0x4')},'description':{'type':Sequelize[_0xceb1('0x2')]},'active':{'type':Sequelize[_0xceb1('0x5')],'defaultValue':0x0,'comment':_0xceb1('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xceb1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xceb1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xceb1('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xceb1('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'comment':_0xceb1('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xceb1('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xceb1('0x2')],'defaultValue':_0xceb1('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xceb1('0x11'),'never',_0xceb1('0x12')),'defaultValue':_0xceb1('0x11')},'dialAMDActive':{'type':Sequelize[_0xceb1('0x5')],'defaultValue':0x0,'comment':_0xceb1('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xceb1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceb1('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xceb1('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb1('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xceb1('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceb1('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xceb1('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xceb1('0x9')](0x9)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xceb1('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xceb1('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb1('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xceb1('0x1b')]('DESC',_0xceb1('0x1c')),'defaultValue':_0xceb1('0x1d')},'dialPrefix':{'type':Sequelize[_0xceb1('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceb1('0x1e')},'dialCutDigit':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xceb1('0x9')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceb1('0x9')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x23')}}; \ No newline at end of file +var _0xe03a=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#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'];(function(_0x522a82,_0x40ebe6){var _0x173340=function(_0x173c77){while(--_0x173c77){_0x522a82['push'](_0x522a82['shift']());}};_0x173340(++_0x40ebe6);}(_0xe03a,0x130));var _0xae03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe03a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xae03('0x0'));module['exports']={'name':{'type':Sequelize[_0xae03('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xae03('0x2')]('ivr'),'allowNull':![],'defaultValue':_0xae03('0x3')},'description':{'type':Sequelize[_0xae03('0x1')]},'active':{'type':Sequelize[_0xae03('0x4')],'defaultValue':0x0,'comment':_0xae03('0x5')},'limitCalls':{'type':Sequelize[_0xae03('0x6')](0x4)[_0xae03('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xae03('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xae03('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xae03('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xae03('0x1')],'defaultValue':_0xae03('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xae03('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xae03('0x4')],'defaultValue':0x0,'comment':_0xae03('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0xae03('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xae03('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xae03('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xae03('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xae03('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xae03('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xae03('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xae03('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xae03('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xae03('0x6')](0x9)[_0xae03('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xae03('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xae03('0x2')](_0xae03('0x18'),_0xae03('0x19')),'defaultValue':_0xae03('0x18')},'dialPrefix':{'type':Sequelize[_0xae03('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xae03('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xae03('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xae03('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xae03('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xae03('0x6')](0x3)[_0xae03('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae03('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xae03('0x6')](0x5)[_0xae03('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae03('0x20')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 9f54128..c4b9862 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 _0x4f8b=['COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','stack','name','send','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Campaign','includeAll','include','findAll','catch','rawAttributes','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','error','clone','params','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','ids','spread','dialCheckDuplicateType','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','insert','into','fromQuery'];(function(_0x18036c,_0x25ac78){var _0x53b19f=function(_0x56f6d0){while(--_0x56f6d0){_0x18036c['push'](_0x18036c['shift']());}};_0x53b19f(++_0x25ac78);}(_0x4f8b,0x12e));var _0xb4f8=function(_0x45a666,_0x1ad7d3){_0x45a666=_0x45a666-0x0;var _0x813b90=_0x4f8b[_0x45a666];return _0x813b90;};'use strict';var emlformat=require(_0xb4f8('0x0'));var rimraf=require(_0xb4f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4f8('0x2'));var moment=require(_0xb4f8('0x3'));var BPromise=require(_0xb4f8('0x4'));var Mustache=require(_0xb4f8('0x5'));var util=require(_0xb4f8('0x6'));var path=require('path');var sox=require(_0xb4f8('0x7'));var csv=require(_0xb4f8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb4f8('0x9'));var _=require(_0xb4f8('0xa'));var squel=require('squel');var crypto=require(_0xb4f8('0xb'));var jsforce=require(_0xb4f8('0xc'));var deskjs=require(_0xb4f8('0xd'));var toCsv=require(_0xb4f8('0x8'));var querystring=require(_0xb4f8('0xe'));var Papa=require(_0xb4f8('0xf'));var Redis=require(_0xb4f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4f8('0x11'));var as=require(_0xb4f8('0x12'));var hardwareService=require(_0xb4f8('0x13'));var logger=require(_0xb4f8('0x14'))(_0xb4f8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb4f8('0x16'))['db'];function respondWithStatusCode(_0x55f60b,_0x26c8fb){_0x26c8fb=_0x26c8fb||0xcc;return function(_0x1d0a37){if(_0x1d0a37){return _0x55f60b['sendStatus'](_0x26c8fb);}return _0x55f60b[_0xb4f8('0x17')](_0x26c8fb)[_0xb4f8('0x18')]();};}function respondWithResult(_0xacdbad,_0x309b62){_0x309b62=_0x309b62||0xc8;return function(_0x4d3017){if(_0x4d3017){return _0xacdbad[_0xb4f8('0x17')](_0x309b62)[_0xb4f8('0x19')](_0x4d3017);}};}function respondWithFilteredResult(_0x39ed9e,_0x4f00a0){return function(_0x2061e2){if(_0x2061e2){var _0x47ebe5=typeof _0x4f00a0[_0xb4f8('0x1a')]===_0xb4f8('0x1b')&&typeof _0x4f00a0[_0xb4f8('0x1c')]===_0xb4f8('0x1b');var _0x578e4c=_0x2061e2[_0xb4f8('0x1d')];var _0x4c3e35=_0x47ebe5?0x0:_0x4f00a0[_0xb4f8('0x1a')];var _0x1a50bd=_0x47ebe5?_0x2061e2[_0xb4f8('0x1d')]:_0x4f00a0['offset']+_0x4f00a0[_0xb4f8('0x1c')];var _0x4eff64;if(_0x1a50bd>=_0x578e4c){_0x1a50bd=_0x578e4c;_0x4eff64=0xc8;}else{_0x4eff64=0xce;}_0x39ed9e[_0xb4f8('0x17')](_0x4eff64);return _0x39ed9e['set'](_0xb4f8('0x1e'),_0x4c3e35+'-'+_0x1a50bd+'/'+_0x578e4c)[_0xb4f8('0x19')](_0x2061e2);}return null;};}function patchUpdates(_0x1c1a84){return function(_0x380649){try{jsonpatch[_0xb4f8('0x1f')](_0x380649,_0x1c1a84,!![]);}catch(_0x3ef98c){return BPromise[_0xb4f8('0x20')](_0x3ef98c);}return _0x380649['save']();};}function saveUpdates(_0x53ce83,_0x4415e7){return function(_0x35311c){if(_0x35311c){return _0x35311c[_0xb4f8('0x21')](_0x53ce83)[_0xb4f8('0x22')](function(_0x2bfdf2){return _0x2bfdf2;});}return null;};}function removeEntity(_0x56eb04,_0x3eb502){return function(_0x3a37e9){if(_0x3a37e9){return _0x3a37e9['destroy']()[_0xb4f8('0x22')](function(){var _0x18efcb=_0x3a37e9[_0xb4f8('0x23')]({'plain':!![]});var _0x54e6fc=_0xb4f8('0x24');return db[_0xb4f8('0x25')][_0xb4f8('0x26')]({'where':{'type':_0x54e6fc,'resourceId':_0x18efcb['id']}})['then'](function(){return _0x3a37e9;});})[_0xb4f8('0x22')](function(){_0x56eb04[_0xb4f8('0x17')](0xcc)[_0xb4f8('0x18')]();});}};}function handleEntityNotFound(_0x5ab6ac,_0x46d85e){return function(_0x1847c6){if(!_0x1847c6){_0x5ab6ac[_0xb4f8('0x27')](0x194);}return _0x1847c6;};}function handleError(_0x2801d9,_0x2183e1){_0x2183e1=_0x2183e1||0x1f4;return function(_0x44ed1f){logger['error'](_0x44ed1f[_0xb4f8('0x28')]);if(_0x44ed1f[_0xb4f8('0x29')]){delete _0x44ed1f[_0xb4f8('0x29')];}_0x2801d9[_0xb4f8('0x17')](_0x2183e1)[_0xb4f8('0x2a')](_0x44ed1f);};}exports['index']=function(_0x45cd75,_0xd58c27){var _0xfbd30f={},_0x511bf8={},_0x3b3a40={'count':0x0,'rows':[]};var _0x312f9a=_['map'](db['Campaign']['rawAttributes'],function(_0x5c5899){return{'name':_0x5c5899[_0xb4f8('0x2b')],'type':_0x5c5899[_0xb4f8('0x2c')][_0xb4f8('0x2d')]};});_0x511bf8[_0xb4f8('0x2e')]=_[_0xb4f8('0x2f')](_0x312f9a,_0xb4f8('0x29'));_0x511bf8['query']=_[_0xb4f8('0x30')](_0x45cd75[_0xb4f8('0x31')]);_0x511bf8[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x511bf8[_0xb4f8('0x2e')],_0x511bf8[_0xb4f8('0x31')]);_0xfbd30f['attributes']=_[_0xb4f8('0x33')](_0x511bf8['model'],qs['fields'](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xfbd30f[_0xb4f8('0x35')]=_0xfbd30f['attributes'][_0xb4f8('0x36')]?_0xfbd30f[_0xb4f8('0x35')]:_0x511bf8[_0xb4f8('0x2e')];if(!_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0xfbd30f['limit']=qs[_0xb4f8('0x1c')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xfbd30f['offset']=qs[_0xb4f8('0x1a')](_0x45cd75['query']['offset']);}_0xfbd30f[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xfbd30f[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x45cd75['query'],_0x511bf8[_0xb4f8('0x32')]),_0x312f9a);if(_0x45cd75['query'][_0xb4f8('0x3d')]){_0xfbd30f['where']=_['merge'](_0xfbd30f[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x312f9a,function(_0x45a398){if(_0x45a398[_0xb4f8('0x2c')]!=='VIRTUAL'){var _0x61fbbb={};_0x61fbbb[_0x45a398[_0xb4f8('0x29')]]={'$like':'%'+_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x61fbbb;}})});}_0xfbd30f=_[_0xb4f8('0x3e')]({},_0xfbd30f,_0x45cd75[_0xb4f8('0x3f')]);var _0x541c17={'where':_0xfbd30f['where']};return db[_0xb4f8('0x40')][_0xb4f8('0x1d')](_0x541c17)[_0xb4f8('0x22')](function(_0x468066){_0x3b3a40[_0xb4f8('0x1d')]=_0x468066;if(_0x45cd75[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xfbd30f[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x40')][_0xb4f8('0x43')](_0xfbd30f);})[_0xb4f8('0x22')](function(_0x10910c){_0x3b3a40['rows']=_0x10910c;return _0x3b3a40;})['then'](respondWithFilteredResult(_0xd58c27,_0xfbd30f))[_0xb4f8('0x44')](handleError(_0xd58c27,null));};exports['show']=function(_0x3ebe57,_0x2b5526){var _0xb7ccef={'raw':![],'where':{'id':_0x3ebe57['params']['id']}},_0x20d4ef={};_0x20d4ef[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['Campaign'][_0xb4f8('0x45')]);_0x20d4ef[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3ebe57['query']);_0x20d4ef[_0xb4f8('0x32')]=_['intersection'](_0x20d4ef['model'],_0x20d4ef[_0xb4f8('0x31')]);_0xb7ccef[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x20d4ef[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0xb7ccef[_0xb4f8('0x35')]=_0xb7ccef[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xb7ccef[_0xb4f8('0x35')]:_0x20d4ef['model'];if(_0x3ebe57[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0xb7ccef[_0xb4f8('0x42')]=[{'all':!![]}];}_0xb7ccef=_['merge']({},_0xb7ccef,_0x3ebe57['options']);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0xb7ccef)[_0xb4f8('0x22')](handleEntityNotFound(_0x2b5526,null))[_0xb4f8('0x22')](respondWithResult(_0x2b5526,null))['catch'](handleError(_0x2b5526,null));};exports['create']=function(_0x354193,_0xd6f96a){return db[_0xb4f8('0x40')]['create'](_0x354193['body'],{})[_0xb4f8('0x22')](function(_0x209080){var _0x5af092=_0x354193['user'][_0xb4f8('0x23')]({'plain':!![]});if(!_0x5af092)throw new Error(_0xb4f8('0x47'));if(_0x5af092[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x764bee=_0x209080[_0xb4f8('0x23')]({'plain':!![]});var _0x2bedde='IvrCampaigns';return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2bedde,'userProfileId':_0x5af092[_0xb4f8('0x4a')]},'raw':!![]})[_0xb4f8('0x22')](function(_0x26b3e9){if(_0x26b3e9&&_0x26b3e9[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x764bee[_0xb4f8('0x29')],'resourceId':_0x764bee['id'],'type':_0x26b3e9[_0xb4f8('0x29')],'sectionId':_0x26b3e9['id']},{})[_0xb4f8('0x22')](function(){return _0x209080;});}else{return _0x209080;}})[_0xb4f8('0x44')](function(_0x2fa127){logger[_0xb4f8('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fa127);throw _0x2fa127;});}return _0x209080;})[_0xb4f8('0x22')](respondWithResult(_0xd6f96a,0xc9))[_0xb4f8('0x44')](handleError(_0xd6f96a,null));};exports[_0xb4f8('0x4e')]=function(_0x145972,_0x26ec45){var _0x19723f={'where':{'id':_0x145972[_0xb4f8('0x4f')]['id']}},_0x4f7d97={};_0x4f7d97[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x40')][_0xb4f8('0x45')]);_0x19723f[_0xb4f8('0x35')]=_['intersection'](_0x4f7d97[_0xb4f8('0x2e')],qs['fields'](_0x145972['query'][_0xb4f8('0x34')]));_0x19723f[_0xb4f8('0x35')]=_0x19723f[_0xb4f8('0x35')]['length']?_0x19723f['attributes']:_0x4f7d97[_0xb4f8('0x2e')];if(_0x145972[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x19723f[_0xb4f8('0x42')]=[{'all':!![]}];}_0x19723f=_[_0xb4f8('0x3e')]({},_0x19723f,_0x145972[_0xb4f8('0x3f')]);return db[_0xb4f8('0x40')][_0xb4f8('0x46')](_0x19723f)['then'](handleEntityNotFound(_0x26ec45,null))[_0xb4f8('0x22')](function(_0x2b5f3b){if(_0x2b5f3b){var _0xb7ff27=_0x2b5f3b[_0xb4f8('0x23')]({'plain':!![]});_0xb7ff27=qs[_0xb4f8('0x50')](_0xb7ff27,['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);_0x145972[_0xb4f8('0x53')]=_[_0xb4f8('0x50')](_0x145972[_0xb4f8('0x53')],['id',_0xb4f8('0x51'),_0xb4f8('0x52')]);return db['Campaign'][_0xb4f8('0x4c')](_[_0xb4f8('0x3e')](_0xb7ff27,_0x145972[_0xb4f8('0x53')]),{'include':_0x145972['query']['includeAll']?[{'all':!![]}]:undefined})[_0xb4f8('0x22')](function(_0x190860){var _0x2b0e43=_0x145972[_0xb4f8('0x49')]['get']({'plain':!![]});if(!_0x2b0e43)throw new Error(_0xb4f8('0x47'));if(_0x2b0e43[_0xb4f8('0x48')]===_0xb4f8('0x49')){var _0x2b7c6f=_0x190860[_0xb4f8('0x23')]({'plain':!![]});var _0x2ed38c=_0xb4f8('0x24');return db['UserProfileSection'][_0xb4f8('0x46')]({'where':{'name':_0x2ed38c,'userProfileId':_0x2b0e43['userProfileId']},'raw':!![]})[_0xb4f8('0x22')](function(_0x4335a2){if(_0x4335a2&&_0x4335a2[_0xb4f8('0x4b')]===0x0){return db[_0xb4f8('0x25')][_0xb4f8('0x4c')]({'name':_0x2b7c6f[_0xb4f8('0x29')],'resourceId':_0x2b7c6f['id'],'type':_0x4335a2[_0xb4f8('0x29')],'sectionId':_0x4335a2['id']},{})[_0xb4f8('0x22')](function(){return _0x190860;});}else{return _0x190860;}})[_0xb4f8('0x44')](function(_0xe413a6){logger['error'](_0xb4f8('0x54'),_0xe413a6);throw _0xe413a6;});}return _0x190860;});}})[_0xb4f8('0x22')](respondWithResult(_0x26ec45,0xc9))['catch'](handleError(_0x26ec45,null));};exports[_0xb4f8('0x21')]=function(_0x5181da,_0x51036a){if(_0x5181da['body']['id']){delete _0x5181da[_0xb4f8('0x53')]['id'];}return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5181da[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x51036a,null))[_0xb4f8('0x22')](saveUpdates(_0x5181da[_0xb4f8('0x53')],null))[_0xb4f8('0x22')](respondWithResult(_0x51036a,null))['catch'](handleError(_0x51036a,null));};exports['destroy']=function(_0x287159,_0x4ad8cc){return db[_0xb4f8('0x40')][_0xb4f8('0x46')]({'where':{'id':_0x287159['params']['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x4ad8cc,null))['then'](removeEntity(_0x4ad8cc,null))[_0xb4f8('0x44')](handleError(_0x4ad8cc,null));};exports[_0xb4f8('0x55')]=function(_0x3d7c55,_0x27957e,_0x5cf35f){var _0x5c61c3={'raw':!![],'where':{}};var _0x2bf0af={};var _0x452fad={'count':0x0,'rows':[]};return db['Campaign'][_0xb4f8('0x56')]({'where':{'id':_0x3d7c55[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x27957e,null))[_0xb4f8('0x22')](function(_0x5b91b7){if(_0x5b91b7){_0x2bf0af[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x57')][_0xb4f8('0x45')]);_0x2bf0af[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3d7c55['query']);_0x2bf0af[_0xb4f8('0x32')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],_0x2bf0af[_0xb4f8('0x31')]);_0x5c61c3[_0xb4f8('0x35')]=_['intersection'](_0x2bf0af[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x5c61c3[_0xb4f8('0x35')]=_0x5c61c3[_0xb4f8('0x35')]['length']?_0x5c61c3[_0xb4f8('0x35')]:_0x2bf0af[_0xb4f8('0x2e')];if(!_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x5c61c3[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x5c61c3[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x5c61c3[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x3d7c55[_0xb4f8('0x31')]['sort']);_0x5c61c3[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x3d7c55[_0xb4f8('0x31')],_0x2bf0af[_0xb4f8('0x32')]));_0x5c61c3[_0xb4f8('0x3b')][_0xb4f8('0x58')]=_0x5b91b7['id'];if(_0x3d7c55[_0xb4f8('0x31')]['filter']){_0x5c61c3[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x5c61c3[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x5c61c3[_0xb4f8('0x35')],function(_0x33d582){var _0x1ebf98={};_0x1ebf98[_0x33d582]={'$like':'%'+_0x3d7c55[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x1ebf98;})});}_0x5c61c3=_[_0xb4f8('0x3e')]({},_0x5c61c3,_0x3d7c55[_0xb4f8('0x3f')]);return db[_0xb4f8('0x57')][_0xb4f8('0x1d')]({'where':_0x5c61c3[_0xb4f8('0x3b')]})['then'](function(_0x504d70){_0x452fad['count']=_0x504d70;if(_0x3d7c55['query'][_0xb4f8('0x41')]){_0x5c61c3[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0xb4f8('0x43')](_0x5c61c3);})['then'](function(_0x157c94){_0x452fad[_0xb4f8('0x59')]=_0x157c94;return _0x452fad;});}})['then'](respondWithFilteredResult(_0x27957e,_0x5c61c3))[_0xb4f8('0x44')](handleError(_0x27957e,null));};exports[_0xb4f8('0x5a')]=function(_0x3b0a96,_0x143f5e,_0xd679bb){var _0x38cf92={'raw':!![],'where':{}};var _0x10e684={};var _0x38ff42={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x3b0a96[_0xb4f8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x143f5e,null))[_0xb4f8('0x22')](function(_0x328f16){if(_0x328f16){_0x10e684[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db['CmHopperHistory']['rawAttributes']);_0x10e684[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x3b0a96[_0xb4f8('0x31')]);_0x10e684[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x10e684[_0xb4f8('0x2e')],_0x10e684[_0xb4f8('0x31')]);_0x38cf92[_0xb4f8('0x35')]=_['intersection'](_0x10e684[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x3b0a96['query']['fields']));_0x38cf92[_0xb4f8('0x35')]=_0x38cf92[_0xb4f8('0x35')]['length']?_0x38cf92['attributes']:_0x10e684[_0xb4f8('0x2e')];if(!_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x37')]('nolimit')){_0x38cf92[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x38cf92[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}_0x38cf92[_0xb4f8('0x39')]=qs['sort'](_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0x38cf92[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x3b0a96['query'],_0x10e684['filters']));_0x38cf92[_0xb4f8('0x3b')]['CampaignId']=_0x328f16['id'];if(_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x38cf92[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x38cf92[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x38cf92[_0xb4f8('0x35')],function(_0x6fdde9){var _0x56a972={};_0x56a972[_0x6fdde9]={'$like':'%'+_0x3b0a96[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x56a972;})});}_0x38cf92=_[_0xb4f8('0x3e')]({},_0x38cf92,_0x3b0a96[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5b')]['count']({'where':_0x38cf92['where']})[_0xb4f8('0x22')](function(_0x11107c){_0x38ff42[_0xb4f8('0x1d')]=_0x11107c;if(_0x3b0a96['query'][_0xb4f8('0x41')]){_0x38cf92[_0xb4f8('0x42')]=[{'all':!![]}];}return db[_0xb4f8('0x5b')]['findAll'](_0x38cf92);})[_0xb4f8('0x22')](function(_0x51ac1c){_0x38ff42[_0xb4f8('0x59')]=_0x51ac1c;return _0x38ff42;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x143f5e,_0x38cf92))[_0xb4f8('0x44')](handleError(_0x143f5e,null));};exports[_0xb4f8('0x5c')]=function(_0x2293de,_0x7efc72,_0x28ee6d){var _0x190b52={'raw':!![],'where':{}};var _0x16e5d1={};var _0x5f2268={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x2293de[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x7efc72,null))[_0xb4f8('0x22')](function(_0x260599){if(_0x260599){_0x16e5d1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5d')][_0xb4f8('0x45')]);_0x16e5d1[_0xb4f8('0x31')]=_['keys'](_0x2293de[_0xb4f8('0x31')]);_0x16e5d1[_0xb4f8('0x32')]=_['intersection'](_0x16e5d1[_0xb4f8('0x2e')],_0x16e5d1[_0xb4f8('0x31')]);_0x190b52[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x16e5d1[_0xb4f8('0x2e')],qs[_0xb4f8('0x34')](_0x2293de[_0xb4f8('0x31')]['fields']));_0x190b52[_0xb4f8('0x35')]=_0x190b52[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0x190b52[_0xb4f8('0x35')]:_0x16e5d1['model'];if(!_0x2293de['query'][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x190b52[_0xb4f8('0x1c')]=qs[_0xb4f8('0x1c')](_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0x190b52[_0xb4f8('0x1a')]=qs['offset'](_0x2293de['query'][_0xb4f8('0x1a')]);}_0x190b52['order']=qs[_0xb4f8('0x3a')](_0x2293de['query'][_0xb4f8('0x3a')]);_0x190b52['where']=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x2293de[_0xb4f8('0x31')],_0x16e5d1[_0xb4f8('0x32')]));_0x190b52['where']['CampaignId']=_0x260599['id'];if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x190b52[_0xb4f8('0x3b')]=_['merge'](_0x190b52[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x190b52[_0xb4f8('0x35')],function(_0x49ce04){var _0x429b74={};_0x429b74[_0x49ce04]={'$like':'%'+_0x2293de[_0xb4f8('0x31')]['filter']+'%'};return _0x429b74;})});}_0x190b52=_[_0xb4f8('0x3e')]({},_0x190b52,_0x2293de[_0xb4f8('0x3f')]);return db[_0xb4f8('0x5d')][_0xb4f8('0x1d')]({'where':_0x190b52[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x317852){_0x5f2268[_0xb4f8('0x1d')]=_0x317852;if(_0x2293de[_0xb4f8('0x31')][_0xb4f8('0x41')]){_0x190b52['include']=[{'all':!![]}];}return db[_0xb4f8('0x5d')][_0xb4f8('0x43')](_0x190b52);})[_0xb4f8('0x22')](function(_0x832959){_0x5f2268[_0xb4f8('0x59')]=_0x832959;return _0x5f2268;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x7efc72,_0x190b52))['catch'](handleError(_0x7efc72,null));};exports['getHopperBlacks']=function(_0x4c3a22,_0x22e240,_0x523834){var _0x1d0f50={'raw':!![],'where':{}};var _0x5cdcf1={};var _0x13ca9c={'count':0x0,'rows':[]};return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x4c3a22['params']['id']}})['then'](handleEntityNotFound(_0x22e240,null))['then'](function(_0xeaf7ea){if(_0xeaf7ea){_0x5cdcf1[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5e')][_0xb4f8('0x45')]);_0x5cdcf1[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x4c3a22[_0xb4f8('0x31')]);_0x5cdcf1[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x5cdcf1[_0xb4f8('0x2e')],_0x5cdcf1[_0xb4f8('0x31')]);_0x1d0f50['attributes']=_[_0xb4f8('0x33')](_0x5cdcf1['model'],qs[_0xb4f8('0x34')](_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x1d0f50[_0xb4f8('0x35')]=_0x1d0f50[_0xb4f8('0x35')]['length']?_0x1d0f50[_0xb4f8('0x35')]:_0x5cdcf1[_0xb4f8('0x2e')];if(!_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x1d0f50['limit']=qs[_0xb4f8('0x1c')](_0x4c3a22['query']['limit']);_0x1d0f50[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x4c3a22[_0xb4f8('0x31')]['offset']);}_0x1d0f50[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x4c3a22['query'][_0xb4f8('0x3a')]);_0x1d0f50[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0x4c3a22[_0xb4f8('0x31')],_0x5cdcf1[_0xb4f8('0x32')]));_0x1d0f50['where']['CampaignId']=_0xeaf7ea['id'];if(_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x1d0f50[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0x1d0f50[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x1d0f50[_0xb4f8('0x35')],function(_0x217727){var _0x402bc5={};_0x402bc5[_0x217727]={'$like':'%'+_0x4c3a22[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x402bc5;})});}_0x1d0f50=_['merge']({},_0x1d0f50,_0x4c3a22['options']);return db[_0xb4f8('0x5e')][_0xb4f8('0x1d')]({'where':_0x1d0f50[_0xb4f8('0x3b')]})[_0xb4f8('0x22')](function(_0x2f783c){_0x13ca9c[_0xb4f8('0x1d')]=_0x2f783c;if(_0x4c3a22['query']['includeAll']){_0x1d0f50[_0xb4f8('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xb4f8('0x43')](_0x1d0f50);})[_0xb4f8('0x22')](function(_0x4db640){_0x13ca9c[_0xb4f8('0x59')]=_0x4db640;return _0x13ca9c;});}})[_0xb4f8('0x22')](respondWithFilteredResult(_0x22e240,_0x1d0f50))[_0xb4f8('0x44')](handleError(_0x22e240,null));};exports['getLists']=function(_0x544389,_0x52dde0,_0x4ad351){var _0x9510d1={};var _0x16a448={};var _0x359578;var _0x1bf012;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0x544389[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x52dde0,null))[_0xb4f8('0x22')](function(_0x2fcef7){if(_0x2fcef7){_0x359578=_0x2fcef7;_0x16a448[_0xb4f8('0x2e')]=_['keys'](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x16a448[_0xb4f8('0x31')]=_[_0xb4f8('0x30')](_0x544389[_0xb4f8('0x31')]);_0x16a448['filters']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],_0x16a448[_0xb4f8('0x31')]);_0x9510d1['attributes']=_[_0xb4f8('0x33')](_0x16a448[_0xb4f8('0x2e')],qs['fields'](_0x544389[_0xb4f8('0x31')][_0xb4f8('0x34')]));_0x9510d1['attributes']=_0x9510d1[_0xb4f8('0x35')]['length']?_0x9510d1[_0xb4f8('0x35')]:_0x16a448[_0xb4f8('0x2e')];_0x9510d1[_0xb4f8('0x39')]=qs[_0xb4f8('0x3a')](_0x544389['query'][_0xb4f8('0x3a')]);_0x9510d1[_0xb4f8('0x3b')]=qs['filters'](_[_0xb4f8('0x3c')](_0x544389[_0xb4f8('0x31')],_0x16a448['filters']));if(_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0x9510d1['where']=_[_0xb4f8('0x3e')](_0x9510d1[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0x9510d1['attributes'],function(_0x39dfec){var _0x22475={};_0x22475[_0x39dfec]={'$like':'%'+_0x544389[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x22475;})});}_0x9510d1=_[_0xb4f8('0x3e')]({},_0x9510d1,_0x544389[_0xb4f8('0x3f')]);return _0x359578[_0xb4f8('0x60')](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x650c44){if(_0x650c44){_0x1bf012=_0x650c44[_0xb4f8('0x36')];if(!_0x544389[_0xb4f8('0x31')][_0xb4f8('0x37')](_0xb4f8('0x38'))){_0x9510d1['limit']=qs[_0xb4f8('0x1c')](_0x544389['query'][_0xb4f8('0x1c')]);_0x9510d1[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0x544389['query'][_0xb4f8('0x1a')]);}return _0x359578['getLists'](_0x9510d1);}})[_0xb4f8('0x22')](function(_0x57a8eb){if(_0x57a8eb){return _0x57a8eb?{'count':_0x1bf012,'rows':_0x57a8eb}:null;}})['then'](respondWithResult(_0x52dde0,null))[_0xb4f8('0x44')](handleError(_0x52dde0,null));};exports[_0xb4f8('0x61')]=function(_0x13ff2e,_0x2c3742,_0x261fda){var _0x3377ed,_0xbdc026;var _0x1cdb4e=[];var _0x5e598b=moment()[_0xb4f8('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x13ff2e[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x2c3742,null))[_0xb4f8('0x22')](function(_0x3c6af0){if(_0x3c6af0){_0xbdc026=_0x3c6af0;return _0x3c6af0[_0xb4f8('0x61')](_0x13ff2e[_0xb4f8('0x53')][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x13ff2e[_0xb4f8('0x53')],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x41e7e3){var _0x2da7b7;var _0x2f77e4;_0x3377ed=_0x41e7e3||[];var _0x1a27fd=[];if(_0x41e7e3){for(var _0x223316=0x0;_0x223316<_0x41e7e3[_0xb4f8('0x36')];_0x223316+=0x1){var _0x3c6efe=_0x41e7e3[_0x223316][_0xb4f8('0x23')]({'plain':!![]});_0xbdc026[_0xb4f8('0x65')]=_0x13ff2e['body'][_0xb4f8('0x65')]?_0x13ff2e['body'][_0xb4f8('0x65')]:_0xbdc026[_0xb4f8('0x65')];switch(_0xbdc026[_0xb4f8('0x65')]){case'always':_0x2da7b7=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xb4f8('0x66'),_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId',_0xb4f8('0x51'),_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x66'),_0xb4f8('0x66'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')]('id','ContactId')[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e['params']['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))['from'](_0xb4f8('0x6f'))['where'](_0xb4f8('0x70'))[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())['where'](_0xb4f8('0x71'))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')](_0xb4f8('0x73'))[_0xb4f8('0x74')](_0xb4f8('0x75'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e[_0xb4f8('0x4f')]['id']['toString']()))[_0xb4f8('0x3b')](_0xb4f8('0x72'),squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('COALESCE(phone,\x27\x27)')[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')]('CampaignId\x20=\x20?',_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;case _0xb4f8('0x78'):_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),'ContactId','ListId','CampaignId',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field']('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id']['toString'](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))['field']('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')]('deletedAt\x20IS\x20NULL')[_0xb4f8('0x3b')]('ListId\x20=\x20?',_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x71'))[_0xb4f8('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xb4f8('0x7c'))[_0xb4f8('0x74')](_0xb4f8('0x77'))[_0xb4f8('0x3b')](_0xb4f8('0x76'),_0x13ff2e['params']['id'][_0xb4f8('0x6e')]())))[_0xb4f8('0x6e')]();break;default:_0x2da7b7=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')](_0xb4f8('0x77'))[_0xb4f8('0x7b')](['phone',_0xb4f8('0x67'),_0xb4f8('0x68'),_0xb4f8('0x69'),_0xb4f8('0x58'),_0xb4f8('0x51'),_0xb4f8('0x52')],squel['select']()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))['field'](_0xb4f8('0x6c'),_0xb4f8('0x67'))['field']('id',_0xb4f8('0x68'))[_0xb4f8('0x6b')](_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),_0xb4f8('0x58'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x51'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27',_0xb4f8('0x52'))[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3c6efe['CmListId'][_0xb4f8('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb4f8('0x6e')]();}_0x2f77e4=squel[_0xb4f8('0x79')]()['into'](_0xb4f8('0x7e'))['fromQuery'](['cmHopperId','scheduledAt','phone','OrderBy',_0xb4f8('0x51'),'updatedAt'],squel[_0xb4f8('0x6a')]()['field'](_0xb4f8('0x7f'),'id')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x67'))[_0xb4f8('0x6b')](_0xb4f8('0x80'),'phone')['field'](_0xb4f8('0x81'),_0xb4f8('0x82'))[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','createdAt')[_0xb4f8('0x6b')]('\x27'+_0x5e598b+'\x27','updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x83'),'ci')['join'](_0xb4f8('0x77'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xb4f8('0x3b')](_0xb4f8('0x84'),_0x3c6efe[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')](_0xb4f8('0x85'),_0x13ff2e[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')]())['where']('h.createdAt\x20=\x20?',_0x5e598b))[_0xb4f8('0x6e')]();_0x1a27fd[_0xb4f8('0x86')](db[_0xb4f8('0x87')]['query'](_0x2da7b7));_0x1cdb4e['push'](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x2f77e4));}return BPromise[_0xb4f8('0x88')](_0x1a27fd);}})['then'](function(){return BPromise[_0xb4f8('0x88')](_0x1cdb4e);})[_0xb4f8('0x22')](function(){return _0x3377ed;})[_0xb4f8('0x22')](respondWithResult(_0x2c3742,null))[_0xb4f8('0x44')](handleError(_0x2c3742,null));};exports[_0xb4f8('0x89')]=function(_0x24352f,_0xf312f2,_0x1b8554){return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0xf312f2,null))[_0xb4f8('0x22')](function(_0x24a96c){if(_0x24a96c){return _0x24a96c[_0xb4f8('0x89')](_0x24352f['query'][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x512186){if(_0x512186){return db[_0xb4f8('0x57')][_0xb4f8('0x26')]({'where':{'ListId':_0x24352f[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x24352f[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x512186;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0xf312f2,null))[_0xb4f8('0x44')](handleError(_0xf312f2,null));};exports[_0xb4f8('0x8a')]=function(_0xcb45c2,_0x3fc537,_0x4dc1b7){var _0xd35ee9={};var _0x231489={};var _0x26479;var _0x6448bf;return db[_0xb4f8('0x40')][_0xb4f8('0x56')]({'where':{'id':_0xcb45c2[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x3fc537,null))[_0xb4f8('0x22')](function(_0x3cfce2){if(_0x3cfce2){_0x26479=_0x3cfce2;_0x231489[_0xb4f8('0x2e')]=_[_0xb4f8('0x30')](db[_0xb4f8('0x5f')][_0xb4f8('0x45')]);_0x231489[_0xb4f8('0x31')]=_['keys'](_0xcb45c2[_0xb4f8('0x31')]);_0x231489[_0xb4f8('0x32')]=_[_0xb4f8('0x33')](_0x231489[_0xb4f8('0x2e')],_0x231489['query']);_0xd35ee9[_0xb4f8('0x35')]=_[_0xb4f8('0x33')](_0x231489['model'],qs[_0xb4f8('0x34')](_0xcb45c2[_0xb4f8('0x31')]['fields']));_0xd35ee9[_0xb4f8('0x35')]=_0xd35ee9[_0xb4f8('0x35')][_0xb4f8('0x36')]?_0xd35ee9[_0xb4f8('0x35')]:_0x231489['model'];_0xd35ee9[_0xb4f8('0x39')]=qs['sort'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3a')]);_0xd35ee9[_0xb4f8('0x3b')]=qs[_0xb4f8('0x32')](_[_0xb4f8('0x3c')](_0xcb45c2[_0xb4f8('0x31')],_0x231489['filters']));if(_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]){_0xd35ee9[_0xb4f8('0x3b')]=_[_0xb4f8('0x3e')](_0xd35ee9[_0xb4f8('0x3b')],{'$or':_[_0xb4f8('0x2f')](_0xd35ee9[_0xb4f8('0x35')],function(_0x558c26){var _0x2dda50={};_0x2dda50[_0x558c26]={'$like':'%'+_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x3d')]+'%'};return _0x2dda50;})});}_0xd35ee9=_['merge']({},_0xd35ee9,_0xcb45c2[_0xb4f8('0x3f')]);return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x5289c9){if(_0x5289c9){_0x6448bf=_0x5289c9[_0xb4f8('0x36')];if(!_0xcb45c2[_0xb4f8('0x31')]['hasOwnProperty']('nolimit')){_0xd35ee9[_0xb4f8('0x1c')]=qs['limit'](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1c')]);_0xd35ee9[_0xb4f8('0x1a')]=qs[_0xb4f8('0x1a')](_0xcb45c2[_0xb4f8('0x31')][_0xb4f8('0x1a')]);}return _0x26479[_0xb4f8('0x8a')](_0xd35ee9);}})[_0xb4f8('0x22')](function(_0x40329d){if(_0x40329d){return _0x40329d?{'count':_0x6448bf,'rows':_0x40329d}:null;}})[_0xb4f8('0x22')](respondWithResult(_0x3fc537,null))[_0xb4f8('0x44')](handleError(_0x3fc537,null));};exports[_0xb4f8('0x8b')]=function(_0x503f08,_0x5a22a0,_0x319c39){var _0x2360b0,_0x48f759;var _0x4f686c=[];var _0x314d21=moment()[_0xb4f8('0x62')](_0xb4f8('0x8c'));return db['Campaign'][_0xb4f8('0x46')]({'where':{'id':_0x503f08[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x5a22a0,null))['then'](function(_0x18c7d3){if(_0x18c7d3){_0x48f759=_0x18c7d3;return _0x18c7d3[_0xb4f8('0x8b')](_0x503f08['body'][_0xb4f8('0x63')],_[_0xb4f8('0x50')](_0x503f08['body'],[_0xb4f8('0x63'),'id'])||{});}return null;})[_0xb4f8('0x64')](function(_0x4abfd0){var _0x19a586;var _0x4b4456;_0x2360b0=_0x4abfd0||[];var _0x53365d=[];if(_0x4abfd0){for(var _0x221c3a=0x0;_0x221c3a<_0x4abfd0['length'];_0x221c3a+=0x1){var _0x3ac0cc=_0x4abfd0[_0x221c3a][_0xb4f8('0x23')]({'plain':!![]});_0x19a586=squel[_0xb4f8('0x79')]()[_0xb4f8('0x7a')]('cm_hopper_black')[_0xb4f8('0x7b')](['phone',_0xb4f8('0x68'),_0xb4f8('0x69'),'CampaignId','createdAt',_0xb4f8('0x52')],squel[_0xb4f8('0x6a')]()[_0xb4f8('0x6b')]('phone',_0xb4f8('0x66'))[_0xb4f8('0x6b')]('id',_0xb4f8('0x68'))['field'](_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')](),_0xb4f8('0x69'))[_0xb4f8('0x6b')](_0x503f08[_0xb4f8('0x4f')]['id'][_0xb4f8('0x6e')](),'CampaignId')[_0xb4f8('0x6b')](_0xb4f8('0x6c'),_0xb4f8('0x51'))[_0xb4f8('0x6b')](_0xb4f8('0x6c'),'updatedAt')[_0xb4f8('0x74')](_0xb4f8('0x6f'))[_0xb4f8('0x3b')](_0xb4f8('0x70'))[_0xb4f8('0x3b')](_0xb4f8('0x7d'),_0x3ac0cc[_0xb4f8('0x6d')][_0xb4f8('0x6e')]())[_0xb4f8('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x53365d[_0xb4f8('0x86')](db[_0xb4f8('0x87')][_0xb4f8('0x31')](_0x19a586));}return BPromise[_0xb4f8('0x88')](_0x53365d);}})[_0xb4f8('0x22')](function(){return _0x2360b0;})['then'](respondWithResult(_0x5a22a0,null))[_0xb4f8('0x44')](handleError(_0x5a22a0,null));};exports[_0xb4f8('0x8d')]=function(_0x5100d8,_0x380ca2,_0x13523d){return db[_0xb4f8('0x40')]['find']({'where':{'id':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](handleEntityNotFound(_0x380ca2,null))[_0xb4f8('0x22')](function(_0x1df1a4){if(_0x1df1a4){return _0x1df1a4['removeBlackLists'](_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')]);}})[_0xb4f8('0x22')](function(_0x19346f){if(_0x19346f){return db[_0xb4f8('0x5e')][_0xb4f8('0x26')]({'where':{'ListId':_0x5100d8[_0xb4f8('0x31')][_0xb4f8('0x63')],'CampaignId':_0x5100d8[_0xb4f8('0x4f')]['id']}})[_0xb4f8('0x22')](function(){return _0x19346f;});}})[_0xb4f8('0x22')](respondWithStatusCode(_0x380ca2,null))[_0xb4f8('0x44')](handleError(_0x380ca2,null));}; \ No newline at end of file +var _0xf78d=['getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','catch','clone','find','omit','updatedAt','body','createdAt','findOne','CmHopper','order','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists'];(function(_0x4a7b46,_0x5e916c){var _0x436bee=function(_0x1c98ba){while(--_0x1c98ba){_0x4a7b46['push'](_0x4a7b46['shift']());}};_0x436bee(++_0x5e916c);}(_0xf78d,0x1c7));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf78('0x0'));var zipdir=require(_0xdf78('0x1'));var jsonpatch=require(_0xdf78('0x2'));var rp=require(_0xdf78('0x3'));var moment=require(_0xdf78('0x4'));var BPromise=require(_0xdf78('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdf78('0x6'));var sox=require(_0xdf78('0x7'));var csv=require(_0xdf78('0x8'));var ejs=require(_0xdf78('0x9'));var fs=require('fs');var fs_extra=require(_0xdf78('0xa'));var _=require(_0xdf78('0xb'));var squel=require(_0xdf78('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdf78('0xd'));var toCsv=require(_0xdf78('0x8'));var querystring=require('querystring');var Papa=require(_0xdf78('0xe'));var Redis=require(_0xdf78('0xf'));var authService=require(_0xdf78('0x10'));var qs=require(_0xdf78('0x11'));var as=require(_0xdf78('0x12'));var hardwareService=require(_0xdf78('0x13'));var logger=require(_0xdf78('0x14'))(_0xdf78('0x15'));var utils=require(_0xdf78('0x16'));var config=require(_0xdf78('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf78('0x18'))['db'];function respondWithStatusCode(_0x568d77,_0x3b801f){_0x3b801f=_0x3b801f||0xcc;return function(_0x264c77){if(_0x264c77){return _0x568d77[_0xdf78('0x19')](_0x3b801f);}return _0x568d77[_0xdf78('0x1a')](_0x3b801f)[_0xdf78('0x1b')]();};}function respondWithResult(_0x3c3756,_0x49da82){_0x49da82=_0x49da82||0xc8;return function(_0x4d572d){if(_0x4d572d){return _0x3c3756[_0xdf78('0x1a')](_0x49da82)[_0xdf78('0x1c')](_0x4d572d);}};}function respondWithFilteredResult(_0x2c8038,_0x3bd337){return function(_0x38eeb7){if(_0x38eeb7){var _0x1a6afb=typeof _0x3bd337['offset']===_0xdf78('0x1d')&&typeof _0x3bd337[_0xdf78('0x1e')]===_0xdf78('0x1d');var _0x11dc81=_0x38eeb7[_0xdf78('0x1f')];var _0x9f719b=_0x1a6afb?0x0:_0x3bd337['offset'];var _0x47cc46=_0x1a6afb?_0x38eeb7['count']:_0x3bd337[_0xdf78('0x20')]+_0x3bd337[_0xdf78('0x1e')];var _0x2a869b;if(_0x47cc46>=_0x11dc81){_0x47cc46=_0x11dc81;_0x2a869b=0xc8;}else{_0x2a869b=0xce;}_0x2c8038[_0xdf78('0x1a')](_0x2a869b);return _0x2c8038[_0xdf78('0x21')]('Content-Range',_0x9f719b+'-'+_0x47cc46+'/'+_0x11dc81)[_0xdf78('0x1c')](_0x38eeb7);}return null;};}function patchUpdates(_0xd5e2ff){return function(_0x2e21fd){try{jsonpatch[_0xdf78('0x22')](_0x2e21fd,_0xd5e2ff,!![]);}catch(_0x5b40b3){return BPromise[_0xdf78('0x23')](_0x5b40b3);}return _0x2e21fd[_0xdf78('0x24')]();};}function saveUpdates(_0x490671,_0x486e90){return function(_0x3e6e9a){if(_0x3e6e9a){return _0x3e6e9a[_0xdf78('0x25')](_0x490671)['then'](function(_0x1ae1f8){return _0x1ae1f8;});}return null;};}function removeEntity(_0x358fc7,_0x13d9eb){return function(_0x109bb3){if(_0x109bb3){return _0x109bb3[_0xdf78('0x26')]()[_0xdf78('0x27')](function(){var _0x464c7e=_0x109bb3['get']({'plain':!![]});var _0x23c13e=_0xdf78('0x28');return db[_0xdf78('0x29')][_0xdf78('0x26')]({'where':{'type':_0x23c13e,'resourceId':_0x464c7e['id']}})['then'](function(){return _0x109bb3;});})[_0xdf78('0x27')](function(){_0x358fc7[_0xdf78('0x1a')](0xcc)[_0xdf78('0x1b')]();});}};}function handleEntityNotFound(_0x4bea0e,_0x29c7d1){return function(_0x43c853){if(!_0x43c853){_0x4bea0e[_0xdf78('0x19')](0x194);}return _0x43c853;};}function handleError(_0x4e33b2,_0x3bc0ee){_0x3bc0ee=_0x3bc0ee||0x1f4;return function(_0xb43a55){logger[_0xdf78('0x2a')](_0xb43a55['stack']);if(_0xb43a55[_0xdf78('0x2b')]){delete _0xb43a55[_0xdf78('0x2b')];}_0x4e33b2[_0xdf78('0x1a')](_0x3bc0ee)[_0xdf78('0x2c')](_0xb43a55);};}exports[_0xdf78('0x2d')]=function(_0x477a0a,_0x26a253){var _0x274d63={},_0x2582af={},_0xd346b2={'count':0x0,'rows':[]};var _0x7dad59=_[_0xdf78('0x2e')](db[_0xdf78('0x2f')][_0xdf78('0x30')],function(_0x586115){return{'name':_0x586115['fieldName'],'type':_0x586115['type'][_0xdf78('0x31')]};});_0x2582af[_0xdf78('0x32')]=_[_0xdf78('0x2e')](_0x7dad59,_0xdf78('0x2b'));_0x2582af['query']=_['keys'](_0x477a0a['query']);_0x2582af['filters']=_[_0xdf78('0x33')](_0x2582af[_0xdf78('0x32')],_0x2582af[_0xdf78('0x34')]);_0x274d63[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x2582af['model'],qs[_0xdf78('0x36')](_0x477a0a[_0xdf78('0x34')][_0xdf78('0x36')]));_0x274d63[_0xdf78('0x35')]=_0x274d63[_0xdf78('0x35')][_0xdf78('0x37')]?_0x274d63[_0xdf78('0x35')]:_0x2582af[_0xdf78('0x32')];if(!_0x477a0a[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x274d63[_0xdf78('0x1e')]=qs['limit'](_0x477a0a[_0xdf78('0x34')][_0xdf78('0x1e')]);_0x274d63[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x477a0a[_0xdf78('0x34')]['offset']);}_0x274d63['order']=qs[_0xdf78('0x3a')](_0x477a0a[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x274d63[_0xdf78('0x3b')]=qs[_0xdf78('0x3c')](_[_0xdf78('0x3d')](_0x477a0a[_0xdf78('0x34')],_0x2582af['filters']),_0x7dad59);if(_0x477a0a[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x274d63[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x274d63[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x7dad59,function(_0xd7f2db){if(_0xd7f2db['type']!==_0xdf78('0x40')){var _0x16d381={};_0x16d381[_0xd7f2db[_0xdf78('0x2b')]]={'$like':'%'+_0x477a0a['query']['filter']+'%'};return _0x16d381;}})});}_0x274d63=_[_0xdf78('0x3f')]({},_0x274d63,_0x477a0a['options']);var _0x39672c={'where':_0x274d63[_0xdf78('0x3b')]};return db[_0xdf78('0x2f')][_0xdf78('0x1f')](_0x39672c)[_0xdf78('0x27')](function(_0x569095){_0xd346b2[_0xdf78('0x1f')]=_0x569095;if(_0x477a0a[_0xdf78('0x34')][_0xdf78('0x41')]){_0x274d63[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x2f')]['findAll'](_0x274d63);})[_0xdf78('0x27')](function(_0x44a03a){_0xd346b2[_0xdf78('0x43')]=_0x44a03a;return _0xd346b2;})[_0xdf78('0x27')](respondWithFilteredResult(_0x26a253,_0x274d63))['catch'](handleError(_0x26a253,null));};exports[_0xdf78('0x44')]=function(_0x434155,_0xe34589){var _0x20b470={'raw':![],'where':{'id':_0x434155[_0xdf78('0x45')]['id']}},_0x1da3d6={};_0x1da3d6['model']=_[_0xdf78('0x46')](db['Campaign']['rawAttributes']);_0x1da3d6['query']=_[_0xdf78('0x46')](_0x434155['query']);_0x1da3d6[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0x1da3d6[_0xdf78('0x32')],_0x1da3d6[_0xdf78('0x34')]);_0x20b470[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x1da3d6[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x434155[_0xdf78('0x34')][_0xdf78('0x36')]));_0x20b470['attributes']=_0x20b470[_0xdf78('0x35')][_0xdf78('0x37')]?_0x20b470[_0xdf78('0x35')]:_0x1da3d6[_0xdf78('0x32')];if(_0x434155[_0xdf78('0x34')][_0xdf78('0x41')]){_0x20b470[_0xdf78('0x42')]=[{'all':!![]}];}_0x20b470=_[_0xdf78('0x3f')]({},_0x20b470,_0x434155[_0xdf78('0x47')]);return db[_0xdf78('0x2f')]['find'](_0x20b470)[_0xdf78('0x27')](handleEntityNotFound(_0xe34589,null))[_0xdf78('0x27')](respondWithResult(_0xe34589,null))['catch'](handleError(_0xe34589,null));};exports[_0xdf78('0x48')]=function(_0x405160,_0x1fa09d){return db[_0xdf78('0x2f')][_0xdf78('0x48')](_0x405160['body'],{})['then'](function(_0xe78e5d){var _0x1df907=_0x405160['user'][_0xdf78('0x49')]({'plain':!![]});if(!_0x1df907)throw new Error(_0xdf78('0x4a'));if(_0x1df907[_0xdf78('0x4b')]===_0xdf78('0x4c')){var _0x175ad3=_0xe78e5d[_0xdf78('0x49')]({'plain':!![]});var _0xc71a68='IvrCampaigns';return db[_0xdf78('0x4d')]['find']({'where':{'name':_0xc71a68,'userProfileId':_0x1df907[_0xdf78('0x4e')]},'raw':!![]})['then'](function(_0x32b1b7){if(_0x32b1b7&&_0x32b1b7[_0xdf78('0x4f')]===0x0){return db[_0xdf78('0x29')][_0xdf78('0x48')]({'name':_0x175ad3[_0xdf78('0x2b')],'resourceId':_0x175ad3['id'],'type':_0x32b1b7[_0xdf78('0x2b')],'sectionId':_0x32b1b7['id']},{})[_0xdf78('0x27')](function(){return _0xe78e5d;});}else{return _0xe78e5d;}})[_0xdf78('0x50')](function(_0x58d756){logger[_0xdf78('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58d756);throw _0x58d756;});}return _0xe78e5d;})[_0xdf78('0x27')](respondWithResult(_0x1fa09d,0xc9))['catch'](handleError(_0x1fa09d,null));};exports[_0xdf78('0x51')]=function(_0x473ae9,_0x540555){var _0x251c98={'where':{'id':_0x473ae9[_0xdf78('0x45')]['id']}},_0x313b69={};_0x313b69[_0xdf78('0x32')]=_['keys'](db['Campaign'][_0xdf78('0x30')]);_0x251c98['attributes']=_[_0xdf78('0x33')](_0x313b69[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x473ae9[_0xdf78('0x34')]['fields']));_0x251c98[_0xdf78('0x35')]=_0x251c98['attributes'][_0xdf78('0x37')]?_0x251c98[_0xdf78('0x35')]:_0x313b69[_0xdf78('0x32')];if(_0x473ae9[_0xdf78('0x34')][_0xdf78('0x41')]){_0x251c98['include']=[{'all':!![]}];}_0x251c98=_[_0xdf78('0x3f')]({},_0x251c98,_0x473ae9[_0xdf78('0x47')]);return db[_0xdf78('0x2f')][_0xdf78('0x52')](_0x251c98)[_0xdf78('0x27')](handleEntityNotFound(_0x540555,null))['then'](function(_0x5a0b8f){if(_0x5a0b8f){var _0x608031=_0x5a0b8f['get']({'plain':!![]});_0x608031=qs[_0xdf78('0x53')](_0x608031,['id','createdAt',_0xdf78('0x54')]);_0x473ae9[_0xdf78('0x55')]=_[_0xdf78('0x53')](_0x473ae9[_0xdf78('0x55')],['id',_0xdf78('0x56'),_0xdf78('0x54')]);return db[_0xdf78('0x2f')][_0xdf78('0x48')](_[_0xdf78('0x3f')](_0x608031,_0x473ae9[_0xdf78('0x55')]),{'include':_0x473ae9[_0xdf78('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xdf78('0x27')](function(_0x124bfe){var _0x121f49=_0x473ae9['user'][_0xdf78('0x49')]({'plain':!![]});if(!_0x121f49)throw new Error(_0xdf78('0x4a'));if(_0x121f49[_0xdf78('0x4b')]===_0xdf78('0x4c')){var _0xe12bde=_0x124bfe[_0xdf78('0x49')]({'plain':!![]});var _0x5e9f19=_0xdf78('0x28');return db[_0xdf78('0x4d')][_0xdf78('0x52')]({'where':{'name':_0x5e9f19,'userProfileId':_0x121f49[_0xdf78('0x4e')]},'raw':!![]})['then'](function(_0x564235){if(_0x564235&&_0x564235[_0xdf78('0x4f')]===0x0){return db[_0xdf78('0x29')][_0xdf78('0x48')]({'name':_0xe12bde[_0xdf78('0x2b')],'resourceId':_0xe12bde['id'],'type':_0x564235['name'],'sectionId':_0x564235['id']},{})[_0xdf78('0x27')](function(){return _0x124bfe;});}else{return _0x124bfe;}})[_0xdf78('0x50')](function(_0x424862){logger[_0xdf78('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x424862);throw _0x424862;});}return _0x124bfe;});}})[_0xdf78('0x27')](respondWithResult(_0x540555,0xc9))['catch'](handleError(_0x540555,null));};exports[_0xdf78('0x25')]=function(_0x39de07,_0x11ca82){if(_0x39de07[_0xdf78('0x55')]['id']){delete _0x39de07[_0xdf78('0x55')]['id'];}return db[_0xdf78('0x2f')][_0xdf78('0x52')]({'where':{'id':_0x39de07['params']['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x11ca82,null))[_0xdf78('0x27')](saveUpdates(_0x39de07[_0xdf78('0x55')],null))['then'](respondWithResult(_0x11ca82,null))[_0xdf78('0x50')](handleError(_0x11ca82,null));};exports[_0xdf78('0x26')]=function(_0x408971,_0x305857){return db[_0xdf78('0x2f')]['find']({'where':{'id':_0x408971[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x305857,null))[_0xdf78('0x27')](removeEntity(_0x305857,null))[_0xdf78('0x50')](handleError(_0x305857,null));};exports['getHoppers']=function(_0x55c3e0,_0x51ca55,_0x42e6de){var _0x1a1b9a={'raw':!![],'where':{}};var _0xeef722={};var _0x19019a={'count':0x0,'rows':[]};return db['Campaign'][_0xdf78('0x57')]({'where':{'id':_0x55c3e0[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x51ca55,null))[_0xdf78('0x27')](function(_0x137fc4){if(_0x137fc4){_0xeef722['model']=_[_0xdf78('0x46')](db[_0xdf78('0x58')][_0xdf78('0x30')]);_0xeef722[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x55c3e0[_0xdf78('0x34')]);_0xeef722[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0xeef722['model'],_0xeef722[_0xdf78('0x34')]);_0x1a1b9a[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0xeef722[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x36')]));_0x1a1b9a['attributes']=_0x1a1b9a[_0xdf78('0x35')][_0xdf78('0x37')]?_0x1a1b9a['attributes']:_0xeef722[_0xdf78('0x32')];if(!_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x1a1b9a[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x55c3e0['query'][_0xdf78('0x1e')]);_0x1a1b9a['offset']=qs[_0xdf78('0x20')](_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x20')]);}_0x1a1b9a[_0xdf78('0x59')]=qs[_0xdf78('0x3a')](_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x1a1b9a['where']=qs[_0xdf78('0x3c')](_[_0xdf78('0x3d')](_0x55c3e0[_0xdf78('0x34')],_0xeef722['filters']));_0x1a1b9a[_0xdf78('0x3b')][_0xdf78('0x5a')]=_0x137fc4['id'];if(_0x55c3e0[_0xdf78('0x34')]['filter']){_0x1a1b9a[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x1a1b9a[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x1a1b9a[_0xdf78('0x35')],function(_0x10f9e3){var _0x3bd440={};_0x3bd440[_0x10f9e3]={'$like':'%'+_0x55c3e0[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x3bd440;})});}_0x1a1b9a=_['merge']({},_0x1a1b9a,_0x55c3e0[_0xdf78('0x47')]);return db[_0xdf78('0x58')][_0xdf78('0x1f')]({'where':_0x1a1b9a[_0xdf78('0x3b')]})[_0xdf78('0x27')](function(_0x3e99ba){_0x19019a['count']=_0x3e99ba;if(_0x55c3e0['query'][_0xdf78('0x41')]){_0x1a1b9a['include']=[{'all':!![]}];}return db[_0xdf78('0x58')][_0xdf78('0x5b')](_0x1a1b9a);})[_0xdf78('0x27')](function(_0x4052cb){_0x19019a[_0xdf78('0x43')]=_0x4052cb;return _0x19019a;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x51ca55,_0x1a1b9a))[_0xdf78('0x50')](handleError(_0x51ca55,null));};exports[_0xdf78('0x5c')]=function(_0x10c898,_0x478a16,_0x1cfa5e){var _0x430ea0={'raw':!![],'where':{}};var _0x539ff4={};var _0x17bead={'count':0x0,'rows':[]};return db[_0xdf78('0x2f')][_0xdf78('0x57')]({'where':{'id':_0x10c898[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x478a16,null))[_0xdf78('0x27')](function(_0x1c5c11){if(_0x1c5c11){_0x539ff4[_0xdf78('0x32')]=_['keys'](db[_0xdf78('0x5d')][_0xdf78('0x30')]);_0x539ff4[_0xdf78('0x34')]=_['keys'](_0x10c898[_0xdf78('0x34')]);_0x539ff4[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0x539ff4['model'],_0x539ff4[_0xdf78('0x34')]);_0x430ea0[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x539ff4[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x10c898[_0xdf78('0x34')][_0xdf78('0x36')]));_0x430ea0[_0xdf78('0x35')]=_0x430ea0[_0xdf78('0x35')][_0xdf78('0x37')]?_0x430ea0['attributes']:_0x539ff4[_0xdf78('0x32')];if(!_0x10c898[_0xdf78('0x34')][_0xdf78('0x38')]('nolimit')){_0x430ea0['limit']=qs['limit'](_0x10c898['query'][_0xdf78('0x1e')]);_0x430ea0['offset']=qs[_0xdf78('0x20')](_0x10c898[_0xdf78('0x34')][_0xdf78('0x20')]);}_0x430ea0[_0xdf78('0x59')]=qs[_0xdf78('0x3a')](_0x10c898[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x430ea0[_0xdf78('0x3b')]=qs['filters'](_[_0xdf78('0x3d')](_0x10c898[_0xdf78('0x34')],_0x539ff4['filters']));_0x430ea0[_0xdf78('0x3b')]['CampaignId']=_0x1c5c11['id'];if(_0x10c898[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x430ea0[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x430ea0[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x430ea0[_0xdf78('0x35')],function(_0x6b7884){var _0x367b86={};_0x367b86[_0x6b7884]={'$like':'%'+_0x10c898[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x367b86;})});}_0x430ea0=_[_0xdf78('0x3f')]({},_0x430ea0,_0x10c898[_0xdf78('0x47')]);return db['CmHopperHistory'][_0xdf78('0x1f')]({'where':_0x430ea0[_0xdf78('0x3b')]})['then'](function(_0x54ee79){_0x17bead[_0xdf78('0x1f')]=_0x54ee79;if(_0x10c898['query'][_0xdf78('0x41')]){_0x430ea0[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x5d')][_0xdf78('0x5b')](_0x430ea0);})[_0xdf78('0x27')](function(_0x2bb5f1){_0x17bead[_0xdf78('0x43')]=_0x2bb5f1;return _0x17bead;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x478a16,_0x430ea0))[_0xdf78('0x50')](handleError(_0x478a16,null));};exports[_0xdf78('0x5e')]=function(_0x56cba8,_0x64cbe3,_0x1db9df){var _0xd98929={'raw':!![],'where':{}};var _0x159071={};var _0x4154f1={'count':0x0,'rows':[]};return db['Campaign'][_0xdf78('0x57')]({'where':{'id':_0x56cba8[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x64cbe3,null))[_0xdf78('0x27')](function(_0x319a5e){if(_0x319a5e){_0x159071['model']=_[_0xdf78('0x46')](db[_0xdf78('0x5f')][_0xdf78('0x30')]);_0x159071[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x56cba8[_0xdf78('0x34')]);_0x159071[_0xdf78('0x3c')]=_[_0xdf78('0x33')](_0x159071['model'],_0x159071['query']);_0xd98929[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x159071['model'],qs[_0xdf78('0x36')](_0x56cba8[_0xdf78('0x34')][_0xdf78('0x36')]));_0xd98929['attributes']=_0xd98929[_0xdf78('0x35')][_0xdf78('0x37')]?_0xd98929[_0xdf78('0x35')]:_0x159071['model'];if(!_0x56cba8[_0xdf78('0x34')]['hasOwnProperty'](_0xdf78('0x39'))){_0xd98929[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x56cba8['query'][_0xdf78('0x1e')]);_0xd98929[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x56cba8['query'][_0xdf78('0x20')]);}_0xd98929['order']=qs[_0xdf78('0x3a')](_0x56cba8[_0xdf78('0x34')]['sort']);_0xd98929[_0xdf78('0x3b')]=qs['filters'](_['pick'](_0x56cba8[_0xdf78('0x34')],_0x159071['filters']));_0xd98929['where'][_0xdf78('0x5a')]=_0x319a5e['id'];if(_0x56cba8['query'][_0xdf78('0x3e')]){_0xd98929[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0xd98929[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0xd98929[_0xdf78('0x35')],function(_0x38cc8c){var _0x361226={};_0x361226[_0x38cc8c]={'$like':'%'+_0x56cba8['query'][_0xdf78('0x3e')]+'%'};return _0x361226;})});}_0xd98929=_[_0xdf78('0x3f')]({},_0xd98929,_0x56cba8[_0xdf78('0x47')]);return db['CmHopperFinal'][_0xdf78('0x1f')]({'where':_0xd98929[_0xdf78('0x3b')]})[_0xdf78('0x27')](function(_0x21b269){_0x4154f1[_0xdf78('0x1f')]=_0x21b269;if(_0x56cba8[_0xdf78('0x34')][_0xdf78('0x41')]){_0xd98929[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x5f')][_0xdf78('0x5b')](_0xd98929);})[_0xdf78('0x27')](function(_0x288834){_0x4154f1[_0xdf78('0x43')]=_0x288834;return _0x4154f1;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x64cbe3,_0xd98929))[_0xdf78('0x50')](handleError(_0x64cbe3,null));};exports[_0xdf78('0x60')]=function(_0x295d7f,_0x2efe2d,_0x21a907){var _0x4e88c4={'raw':!![],'where':{}};var _0x39f279={};var _0x5465fe={'count':0x0,'rows':[]};return db['Campaign'][_0xdf78('0x57')]({'where':{'id':_0x295d7f[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x2efe2d,null))[_0xdf78('0x27')](function(_0x10b13b){if(_0x10b13b){_0x39f279[_0xdf78('0x32')]=_['keys'](db[_0xdf78('0x61')][_0xdf78('0x30')]);_0x39f279[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x295d7f['query']);_0x39f279[_0xdf78('0x3c')]=_['intersection'](_0x39f279[_0xdf78('0x32')],_0x39f279[_0xdf78('0x34')]);_0x4e88c4['attributes']=_[_0xdf78('0x33')](_0x39f279[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x295d7f[_0xdf78('0x34')][_0xdf78('0x36')]));_0x4e88c4[_0xdf78('0x35')]=_0x4e88c4[_0xdf78('0x35')][_0xdf78('0x37')]?_0x4e88c4[_0xdf78('0x35')]:_0x39f279[_0xdf78('0x32')];if(!_0x295d7f[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x4e88c4[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x295d7f['query'][_0xdf78('0x1e')]);_0x4e88c4[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x295d7f[_0xdf78('0x34')]['offset']);}_0x4e88c4[_0xdf78('0x59')]=qs['sort'](_0x295d7f[_0xdf78('0x34')][_0xdf78('0x3a')]);_0x4e88c4[_0xdf78('0x3b')]=qs[_0xdf78('0x3c')](_['pick'](_0x295d7f[_0xdf78('0x34')],_0x39f279['filters']));_0x4e88c4[_0xdf78('0x3b')]['CampaignId']=_0x10b13b['id'];if(_0x295d7f[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x4e88c4[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x4e88c4[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x4e88c4['attributes'],function(_0x167889){var _0x5790b1={};_0x5790b1[_0x167889]={'$like':'%'+_0x295d7f[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x5790b1;})});}_0x4e88c4=_[_0xdf78('0x3f')]({},_0x4e88c4,_0x295d7f[_0xdf78('0x47')]);return db[_0xdf78('0x61')][_0xdf78('0x1f')]({'where':_0x4e88c4[_0xdf78('0x3b')]})[_0xdf78('0x27')](function(_0x2a0650){_0x5465fe[_0xdf78('0x1f')]=_0x2a0650;if(_0x295d7f[_0xdf78('0x34')][_0xdf78('0x41')]){_0x4e88c4[_0xdf78('0x42')]=[{'all':!![]}];}return db[_0xdf78('0x61')][_0xdf78('0x5b')](_0x4e88c4);})[_0xdf78('0x27')](function(_0xd43b34){_0x5465fe[_0xdf78('0x43')]=_0xd43b34;return _0x5465fe;});}})[_0xdf78('0x27')](respondWithFilteredResult(_0x2efe2d,_0x4e88c4))[_0xdf78('0x50')](handleError(_0x2efe2d,null));};exports[_0xdf78('0x62')]=function(_0x323b3d,_0x176279,_0xa592ba){var _0x33095b={};var _0x1f12bc={};var _0x45e577;var _0x448ba5;return db[_0xdf78('0x2f')][_0xdf78('0x57')]({'where':{'id':_0x323b3d['params']['id']}})['then'](handleEntityNotFound(_0x176279,null))['then'](function(_0x2c8f52){if(_0x2c8f52){_0x45e577=_0x2c8f52;_0x1f12bc[_0xdf78('0x32')]=_[_0xdf78('0x46')](db[_0xdf78('0x63')][_0xdf78('0x30')]);_0x1f12bc[_0xdf78('0x34')]=_['keys'](_0x323b3d['query']);_0x1f12bc['filters']=_[_0xdf78('0x33')](_0x1f12bc[_0xdf78('0x32')],_0x1f12bc[_0xdf78('0x34')]);_0x33095b[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x1f12bc[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x323b3d['query']['fields']));_0x33095b[_0xdf78('0x35')]=_0x33095b[_0xdf78('0x35')][_0xdf78('0x37')]?_0x33095b[_0xdf78('0x35')]:_0x1f12bc[_0xdf78('0x32')];_0x33095b[_0xdf78('0x59')]=qs[_0xdf78('0x3a')](_0x323b3d['query'][_0xdf78('0x3a')]);_0x33095b[_0xdf78('0x3b')]=qs[_0xdf78('0x3c')](_[_0xdf78('0x3d')](_0x323b3d[_0xdf78('0x34')],_0x1f12bc[_0xdf78('0x3c')]));if(_0x323b3d['query'][_0xdf78('0x3e')]){_0x33095b[_0xdf78('0x3b')]=_['merge'](_0x33095b[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x33095b[_0xdf78('0x35')],function(_0x24811e){var _0x464e97={};_0x464e97[_0x24811e]={'$like':'%'+_0x323b3d[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x464e97;})});}_0x33095b=_[_0xdf78('0x3f')]({},_0x33095b,_0x323b3d['options']);return _0x45e577[_0xdf78('0x62')](_0x33095b);}})[_0xdf78('0x27')](function(_0x574d01){if(_0x574d01){_0x448ba5=_0x574d01[_0xdf78('0x37')];if(!_0x323b3d[_0xdf78('0x34')]['hasOwnProperty'](_0xdf78('0x39'))){_0x33095b[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x323b3d['query']['limit']);_0x33095b[_0xdf78('0x20')]=qs[_0xdf78('0x20')](_0x323b3d[_0xdf78('0x34')][_0xdf78('0x20')]);}return _0x45e577[_0xdf78('0x62')](_0x33095b);}})[_0xdf78('0x27')](function(_0x21efb6){if(_0x21efb6){return _0x21efb6?{'count':_0x448ba5,'rows':_0x21efb6}:null;}})[_0xdf78('0x27')](respondWithResult(_0x176279,null))[_0xdf78('0x50')](handleError(_0x176279,null));};exports[_0xdf78('0x64')]=function(_0x25554a,_0x5c67d6,_0x323b8e){var _0x5623ab,_0x5080de;var _0x3a4460=[];var _0x40d1b1=moment()[_0xdf78('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xdf78('0x2f')][_0xdf78('0x52')]({'where':{'id':_0x25554a[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x5c67d6,null))['then'](function(_0x2e8dcb){if(_0x2e8dcb){_0x5080de=_0x2e8dcb;return _0x2e8dcb['addLists'](_0x25554a[_0xdf78('0x55')][_0xdf78('0x66')],_[_0xdf78('0x53')](_0x25554a['body'],['ids','id'])||{});}return null;})[_0xdf78('0x67')](function(_0x3a00ea){var _0x541dd0;var _0x594b4d;_0x5623ab=_0x3a00ea||[];var _0x2112f3=[];if(_0x3a00ea){for(var _0x289036=0x0;_0x289036<_0x3a00ea[_0xdf78('0x37')];_0x289036+=0x1){var _0x3f420a=_0x3a00ea[_0x289036]['get']({'plain':!![]});_0x5080de[_0xdf78('0x68')]=_0x25554a[_0xdf78('0x55')][_0xdf78('0x68')]?_0x25554a[_0xdf78('0x55')][_0xdf78('0x68')]:_0x5080de[_0xdf78('0x68')];switch(_0x5080de[_0xdf78('0x68')]){case _0xdf78('0x69'):_0x541dd0=squel[_0xdf78('0x6a')]()['into'](_0xdf78('0x6b'))['fromQuery']([_0xdf78('0x6c'),'scheduledAt',_0xdf78('0x6d'),_0xdf78('0x6e'),_0xdf78('0x5a'),'createdAt','updatedAt'],squel[_0xdf78('0x6f')]()[_0xdf78('0x70')]('phone','phone')['field']('NOW()',_0xdf78('0x71'))[_0xdf78('0x70')]('id','ContactId')['field'](_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')](),'ListId')[_0xdf78('0x70')](_0x25554a[_0xdf78('0x45')]['id']['toString'](),_0xdf78('0x5a'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x56'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x54'))[_0xdf78('0x74')](_0xdf78('0x75'))['where'](_0xdf78('0x76'))[_0xdf78('0x3b')](_0xdf78('0x77'),_0x3f420a[_0xdf78('0x72')]['toString']())[_0xdf78('0x3b')](_0xdf78('0x78'))[_0xdf78('0x3b')](_0xdf78('0x79'),squel[_0xdf78('0x6f')]()['field'](_0xdf78('0x7a'))[_0xdf78('0x74')](_0xdf78('0x7b'))[_0xdf78('0x3b')](_0xdf78('0x7c'),_0x25554a['params']['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdf78('0x70')](_0xdf78('0x7d'))[_0xdf78('0x74')]('cm_hopper')[_0xdf78('0x3b')](_0xdf78('0x7c'),_0x25554a[_0xdf78('0x45')]['id']['toString']())))[_0xdf78('0x73')]();break;case _0xdf78('0x7e'):_0x541dd0=squel[_0xdf78('0x6a')]()[_0xdf78('0x7f')](_0xdf78('0x6b'))[_0xdf78('0x80')](['phone',_0xdf78('0x71'),_0xdf78('0x6d'),'ListId',_0xdf78('0x5a'),'createdAt',_0xdf78('0x54')],squel['select']()['field']('phone',_0xdf78('0x6c'))[_0xdf78('0x70')]('NOW()','scheduledAt')[_0xdf78('0x70')]('id','ContactId')[_0xdf78('0x70')](_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')](),_0xdf78('0x6e'))[_0xdf78('0x70')](_0x25554a[_0xdf78('0x45')]['id']['toString'](),_0xdf78('0x5a'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x56'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x54'))[_0xdf78('0x74')](_0xdf78('0x75'))[_0xdf78('0x3b')](_0xdf78('0x76'))[_0xdf78('0x3b')](_0xdf78('0x77'),_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xdf78('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdf78('0x6f')]()[_0xdf78('0x70')](_0xdf78('0x7d'))['from'](_0xdf78('0x6b'))[_0xdf78('0x3b')](_0xdf78('0x7c'),_0x25554a['params']['id']['toString']())))['toString']();break;default:_0x541dd0=squel[_0xdf78('0x6a')]()[_0xdf78('0x7f')](_0xdf78('0x6b'))[_0xdf78('0x80')]([_0xdf78('0x6c'),'scheduledAt',_0xdf78('0x6d'),_0xdf78('0x6e'),'CampaignId',_0xdf78('0x56'),_0xdf78('0x54')],squel[_0xdf78('0x6f')]()[_0xdf78('0x70')](_0xdf78('0x6c'),_0xdf78('0x6c'))[_0xdf78('0x70')](_0xdf78('0x81'),_0xdf78('0x71'))[_0xdf78('0x70')]('id',_0xdf78('0x6d'))[_0xdf78('0x70')](_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')](),_0xdf78('0x6e'))[_0xdf78('0x70')](_0x25554a[_0xdf78('0x45')]['id'][_0xdf78('0x73')](),_0xdf78('0x5a'))['field']('\x27'+_0x40d1b1+'\x27',_0xdf78('0x56'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27',_0xdf78('0x54'))['from'](_0xdf78('0x75'))[_0xdf78('0x3b')](_0xdf78('0x76'))[_0xdf78('0x3b')]('ListId\x20=\x20?',_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')]())[_0xdf78('0x3b')](_0xdf78('0x78')))[_0xdf78('0x73')]();}_0x594b4d=squel['insert']()[_0xdf78('0x7f')](_0xdf78('0x82'))[_0xdf78('0x80')]([_0xdf78('0x83'),_0xdf78('0x71'),_0xdf78('0x6c'),_0xdf78('0x84'),'createdAt',_0xdf78('0x54')],squel['select']()[_0xdf78('0x70')](_0xdf78('0x85'),'id')[_0xdf78('0x70')](_0xdf78('0x81'),'scheduledAt')[_0xdf78('0x70')](_0xdf78('0x86'),_0xdf78('0x6c'))[_0xdf78('0x70')](_0xdf78('0x87'),_0xdf78('0x84'))[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27','createdAt')[_0xdf78('0x70')]('\x27'+_0x40d1b1+'\x27','updatedAt')[_0xdf78('0x74')](_0xdf78('0x88'),'ci')['join'](_0xdf78('0x6b'),'h',_0xdf78('0x89'))['where'](_0xdf78('0x8a'),_0x3f420a[_0xdf78('0x72')][_0xdf78('0x73')]())[_0xdf78('0x3b')](_0xdf78('0x8b'),_0x25554a[_0xdf78('0x45')]['id'][_0xdf78('0x73')]())['where'](_0xdf78('0x8c'),_0x40d1b1))['toString']();_0x2112f3[_0xdf78('0x8d')](db[_0xdf78('0x8e')][_0xdf78('0x34')](_0x541dd0));_0x3a4460[_0xdf78('0x8d')](db[_0xdf78('0x8e')]['query'](_0x594b4d));}return BPromise[_0xdf78('0x8f')](_0x2112f3);}})['then'](function(){return BPromise['all'](_0x3a4460);})[_0xdf78('0x27')](function(){return _0x5623ab;})[_0xdf78('0x27')](respondWithResult(_0x5c67d6,null))[_0xdf78('0x50')](handleError(_0x5c67d6,null));};exports[_0xdf78('0x90')]=function(_0x228dc1,_0x2dc608,_0x125484){return db[_0xdf78('0x2f')]['find']({'where':{'id':_0x228dc1[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x2dc608,null))[_0xdf78('0x27')](function(_0x4c3999){if(_0x4c3999){return _0x4c3999[_0xdf78('0x90')](_0x228dc1[_0xdf78('0x34')][_0xdf78('0x66')]);}})['then'](function(_0x139c90){if(_0x139c90){return db[_0xdf78('0x58')]['destroy']({'where':{'ListId':_0x228dc1[_0xdf78('0x34')][_0xdf78('0x66')],'CampaignId':_0x228dc1[_0xdf78('0x45')]['id']}})['then'](function(){return _0x139c90;});}})[_0xdf78('0x27')](respondWithStatusCode(_0x2dc608,null))[_0xdf78('0x50')](handleError(_0x2dc608,null));};exports[_0xdf78('0x91')]=function(_0x181c12,_0x16fcea,_0x4562f7){var _0x46ebba={};var _0x5dcd6c={};var _0x1cb00a;var _0x397e2e;return db[_0xdf78('0x2f')][_0xdf78('0x57')]({'where':{'id':_0x181c12[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](handleEntityNotFound(_0x16fcea,null))[_0xdf78('0x27')](function(_0xe1bc11){if(_0xe1bc11){_0x1cb00a=_0xe1bc11;_0x5dcd6c[_0xdf78('0x32')]=_[_0xdf78('0x46')](db[_0xdf78('0x63')][_0xdf78('0x30')]);_0x5dcd6c[_0xdf78('0x34')]=_[_0xdf78('0x46')](_0x181c12[_0xdf78('0x34')]);_0x5dcd6c['filters']=_[_0xdf78('0x33')](_0x5dcd6c[_0xdf78('0x32')],_0x5dcd6c['query']);_0x46ebba[_0xdf78('0x35')]=_[_0xdf78('0x33')](_0x5dcd6c[_0xdf78('0x32')],qs[_0xdf78('0x36')](_0x181c12[_0xdf78('0x34')][_0xdf78('0x36')]));_0x46ebba[_0xdf78('0x35')]=_0x46ebba[_0xdf78('0x35')][_0xdf78('0x37')]?_0x46ebba['attributes']:_0x5dcd6c[_0xdf78('0x32')];_0x46ebba[_0xdf78('0x59')]=qs['sort'](_0x181c12[_0xdf78('0x34')]['sort']);_0x46ebba['where']=qs[_0xdf78('0x3c')](_['pick'](_0x181c12[_0xdf78('0x34')],_0x5dcd6c['filters']));if(_0x181c12[_0xdf78('0x34')][_0xdf78('0x3e')]){_0x46ebba[_0xdf78('0x3b')]=_[_0xdf78('0x3f')](_0x46ebba[_0xdf78('0x3b')],{'$or':_[_0xdf78('0x2e')](_0x46ebba[_0xdf78('0x35')],function(_0x2f43f8){var _0x54b959={};_0x54b959[_0x2f43f8]={'$like':'%'+_0x181c12[_0xdf78('0x34')][_0xdf78('0x3e')]+'%'};return _0x54b959;})});}_0x46ebba=_['merge']({},_0x46ebba,_0x181c12['options']);return _0x1cb00a[_0xdf78('0x91')](_0x46ebba);}})['then'](function(_0x4c7f7e){if(_0x4c7f7e){_0x397e2e=_0x4c7f7e[_0xdf78('0x37')];if(!_0x181c12[_0xdf78('0x34')][_0xdf78('0x38')](_0xdf78('0x39'))){_0x46ebba[_0xdf78('0x1e')]=qs[_0xdf78('0x1e')](_0x181c12[_0xdf78('0x34')][_0xdf78('0x1e')]);_0x46ebba[_0xdf78('0x20')]=qs['offset'](_0x181c12[_0xdf78('0x34')][_0xdf78('0x20')]);}return _0x1cb00a[_0xdf78('0x91')](_0x46ebba);}})[_0xdf78('0x27')](function(_0x28df20){if(_0x28df20){return _0x28df20?{'count':_0x397e2e,'rows':_0x28df20}:null;}})[_0xdf78('0x27')](respondWithResult(_0x16fcea,null))[_0xdf78('0x50')](handleError(_0x16fcea,null));};exports[_0xdf78('0x92')]=function(_0x5d0d1d,_0x54b0bc,_0x2b4ca6){var _0x392490,_0x2cbe28;var _0x460249=[];var _0x354e30=moment()[_0xdf78('0x65')](_0xdf78('0x93'));return db[_0xdf78('0x2f')]['find']({'where':{'id':_0x5d0d1d[_0xdf78('0x45')]['id']}})['then'](handleEntityNotFound(_0x54b0bc,null))[_0xdf78('0x27')](function(_0x139d0b){if(_0x139d0b){_0x2cbe28=_0x139d0b;return _0x139d0b[_0xdf78('0x92')](_0x5d0d1d[_0xdf78('0x55')][_0xdf78('0x66')],_[_0xdf78('0x53')](_0x5d0d1d[_0xdf78('0x55')],[_0xdf78('0x66'),'id'])||{});}return null;})[_0xdf78('0x67')](function(_0x1a931f){var _0x3a7172;var _0x58689a;_0x392490=_0x1a931f||[];var _0x183b73=[];if(_0x1a931f){for(var _0x5a5e4c=0x0;_0x5a5e4c<_0x1a931f[_0xdf78('0x37')];_0x5a5e4c+=0x1){var _0x141c82=_0x1a931f[_0x5a5e4c][_0xdf78('0x49')]({'plain':!![]});_0x3a7172=squel[_0xdf78('0x6a')]()[_0xdf78('0x7f')](_0xdf78('0x94'))[_0xdf78('0x80')]([_0xdf78('0x6c'),_0xdf78('0x6d'),'ListId','CampaignId','createdAt',_0xdf78('0x54')],squel['select']()[_0xdf78('0x70')](_0xdf78('0x6c'),_0xdf78('0x6c'))[_0xdf78('0x70')]('id',_0xdf78('0x6d'))['field'](_0x141c82[_0xdf78('0x72')][_0xdf78('0x73')](),_0xdf78('0x6e'))[_0xdf78('0x70')](_0x5d0d1d['params']['id'][_0xdf78('0x73')](),_0xdf78('0x5a'))[_0xdf78('0x70')]('NOW()',_0xdf78('0x56'))[_0xdf78('0x70')](_0xdf78('0x81'),_0xdf78('0x54'))[_0xdf78('0x74')]('cm_contacts')[_0xdf78('0x3b')](_0xdf78('0x76'))[_0xdf78('0x3b')](_0xdf78('0x77'),_0x141c82[_0xdf78('0x72')]['toString']())[_0xdf78('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x183b73[_0xdf78('0x8d')](db['sequelize']['query'](_0x3a7172));}return BPromise[_0xdf78('0x8f')](_0x183b73);}})[_0xdf78('0x27')](function(){return _0x392490;})[_0xdf78('0x27')](respondWithResult(_0x54b0bc,null))[_0xdf78('0x50')](handleError(_0x54b0bc,null));};exports['removeBlackLists']=function(_0xa928bd,_0x447680,_0x578b14){return db[_0xdf78('0x2f')][_0xdf78('0x52')]({'where':{'id':_0xa928bd['params']['id']}})['then'](handleEntityNotFound(_0x447680,null))[_0xdf78('0x27')](function(_0x338f5b){if(_0x338f5b){return _0x338f5b[_0xdf78('0x95')](_0xa928bd[_0xdf78('0x34')][_0xdf78('0x66')]);}})[_0xdf78('0x27')](function(_0x127904){if(_0x127904){return db[_0xdf78('0x61')][_0xdf78('0x26')]({'where':{'ListId':_0xa928bd['query'][_0xdf78('0x66')],'CampaignId':_0xa928bd[_0xdf78('0x45')]['id']}})[_0xdf78('0x27')](function(){return _0x127904;});}})[_0xdf78('0x27')](respondWithStatusCode(_0x447680,null))[_0xdf78('0x50')](handleError(_0x447680,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index fb720d6..1df0341 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x19c978,_0x451c13){var _0x1eab29=function(_0x382ac1){while(--_0x382ac1){_0x19c978['push'](_0x19c978['shift']());}};_0x1eab29(++_0x451c13);}(_0x7a54,0x106));var _0x47a5=function(_0xcc8c43,_0x2cce66){_0xcc8c43=_0xcc8c43-0x0;var _0x531584=_0x7a54[_0xcc8c43];return _0x531584;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 6fa8ce7..e29657f 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 _0x1fdc=['raw','attributes','limit','include','model','map','GetCampaign','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','findAll','options'];(function(_0x297b65,_0x2f9f76){var _0x58f565=function(_0x33da2b){while(--_0x33da2b){_0x297b65['push'](_0x297b65['shift']());}};_0x58f565(++_0x2f9f76);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x1fdc[_0x178f52];return _0x556f99;};'use strict';var _=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var moment=require('moment');var BPromise=require(_0xc1fd('0x2'));var rs=require(_0xc1fd('0x3'));var fs=require('fs');var Redis=require(_0xc1fd('0x4'));var db=require(_0xc1fd('0x5'))['db'];var utils=require(_0xc1fd('0x6'));var logger=require(_0xc1fd('0x7'))(_0xc1fd('0x8'));var config=require('../../config/environment');var jayson=require(_0xc1fd('0x9'));var client=jayson[_0xc1fd('0xa')][_0xc1fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf6faef,_0x1865d0,_0x3eebe6){return new BPromise(function(_0x43b858,_0x2e06e4){return client[_0xc1fd('0xc')](_0xf6faef,_0x3eebe6)[_0xc1fd('0xd')](function(_0x37fb6c){logger[_0xc1fd('0xe')](_0xc1fd('0xf'),_0x1865d0,'request\x20sent');logger[_0xc1fd('0x10')](_0xc1fd('0x11'),_0x1865d0,'request\x20sent',JSON[_0xc1fd('0x12')](_0x37fb6c));if(_0x37fb6c['error']){if(_0x37fb6c[_0xc1fd('0x13')]['code']===0x1f4){logger[_0xc1fd('0x13')](_0xc1fd('0xf'),_0x1865d0,_0x37fb6c[_0xc1fd('0x13')]['message']);return _0x2e06e4(_0x37fb6c[_0xc1fd('0x13')][_0xc1fd('0x14')]);}logger[_0xc1fd('0x13')](_0xc1fd('0xf'),_0x1865d0,_0x37fb6c['error']['message']);return _0x43b858(_0x37fb6c[_0xc1fd('0x13')][_0xc1fd('0x14')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x1865d0,'request\x20sent');_0x43b858(_0x37fb6c[_0xc1fd('0x15')][_0xc1fd('0x14')]);}})[_0xc1fd('0x16')](function(_0x1ddbff){logger['error'](_0xc1fd('0xf'),_0x1865d0,_0x1ddbff);_0x2e06e4(_0x1ddbff);});});}exports['GetCampaign']=function(_0x3634e3){var _0x115b23=this;return new Promise(function(_0x12398e,_0x3a03a2){return db[_0xc1fd('0x17')][_0xc1fd('0x18')]({'raw':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1a')]===undefined?!![]:![]:!![],'where':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3[_0xc1fd('0x19')]['where']||null:null,'attributes':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3['options'][_0xc1fd('0x1b')]||null:null,'limit':_0x3634e3['options']?_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1c')]||null:null,'include':_0x3634e3[_0xc1fd('0x19')]?_0x3634e3['options'][_0xc1fd('0x1d')]?_['map'](_0x3634e3[_0xc1fd('0x19')][_0xc1fd('0x1d')],function(_0x3cf4a2){return{'model':db[_0x3cf4a2[_0xc1fd('0x1e')]],'as':_0x3cf4a2['as'],'attributes':_0x3cf4a2[_0xc1fd('0x1b')],'include':_0x3cf4a2[_0xc1fd('0x1d')]?_[_0xc1fd('0x1f')](_0x3cf4a2['include'],function(_0x16509d){return{'model':db[_0x16509d['model']],'as':_0x16509d['as'],'attributes':_0x16509d['attributes'],'include':_0x16509d['include']?_[_0xc1fd('0x1f')](_0x16509d[_0xc1fd('0x1d')],function(_0x236efa){return{'model':db[_0x236efa[_0xc1fd('0x1e')]],'as':_0x236efa['as'],'attributes':_0x236efa[_0xc1fd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc1fd('0xd')](function(_0x25bf22){logger['info'](_0xc1fd('0x20'),_0x3634e3);logger[_0xc1fd('0x10')](_0xc1fd('0x20'),_0x3634e3,JSON[_0xc1fd('0x12')](_0x25bf22));_0x12398e(_0x25bf22);})[_0xc1fd('0x16')](function(_0x19bdef){logger[_0xc1fd('0x13')](_0xc1fd('0x20'),_0x19bdef[_0xc1fd('0x14')],_0x3634e3);_0x3a03a2(_0x115b23[_0xc1fd('0x13')](0x1f4,_0x19bdef['message']));});});}; \ No newline at end of file +var _0x44a3=['limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','Campaign,\x20%s,\x20%s','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes'];(function(_0x2134c0,_0x3debba){var _0x397455=function(_0xa5f5ec){while(--_0xa5f5ec){_0x2134c0['push'](_0x2134c0['shift']());}};_0x397455(++_0x3debba);}(_0x44a3,0x1a9));var _0x344a=function(_0x38a62f,_0x26b533){_0x38a62f=_0x38a62f-0x0;var _0x1f734b=_0x44a3[_0x38a62f];return _0x1f734b;};'use strict';var _=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var moment=require(_0x344a('0x2'));var BPromise=require(_0x344a('0x3'));var rs=require(_0x344a('0x4'));var fs=require('fs');var Redis=require(_0x344a('0x5'));var db=require(_0x344a('0x6'))['db'];var utils=require(_0x344a('0x7'));var logger=require('../../config/logger')(_0x344a('0x8'));var config=require(_0x344a('0x9'));var jayson=require(_0x344a('0xa'));var client=jayson[_0x344a('0xb')][_0x344a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504bd1,_0x553d97,_0x55ddca){return new BPromise(function(_0x484661,_0x475dab){return client[_0x344a('0xd')](_0x504bd1,_0x55ddca)[_0x344a('0xe')](function(_0x233ca1){logger[_0x344a('0xf')]('Campaign,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'));logger[_0x344a('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x553d97,_0x344a('0x10'),JSON['stringify'](_0x233ca1));if(_0x233ca1[_0x344a('0x12')]){if(_0x233ca1['error'][_0x344a('0x13')]===0x1f4){logger[_0x344a('0x12')]('Campaign,\x20%s,\x20%s',_0x553d97,_0x233ca1['error'][_0x344a('0x14')]);return _0x475dab(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}logger[_0x344a('0x12')](_0x344a('0x15'),_0x553d97,_0x233ca1[_0x344a('0x12')]['message']);return _0x484661(_0x233ca1[_0x344a('0x12')][_0x344a('0x14')]);}else{logger[_0x344a('0xf')](_0x344a('0x15'),_0x553d97,'request\x20sent');_0x484661(_0x233ca1['result'][_0x344a('0x14')]);}})[_0x344a('0x16')](function(_0x36227e){logger[_0x344a('0x12')]('Campaign,\x20%s,\x20%s',_0x553d97,_0x36227e);_0x475dab(_0x36227e);});});}exports[_0x344a('0x17')]=function(_0x277c06){var _0x49b55f=this;return new Promise(function(_0x9fe854,_0x274016){return db[_0x344a('0x18')][_0x344a('0x19')]({'raw':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1b')]===undefined?!![]:![]:!![],'where':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1c')]||null:null,'attributes':_0x277c06['options']?_0x277c06[_0x344a('0x1a')][_0x344a('0x1d')]||null:null,'limit':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1e')]||null:null,'include':_0x277c06[_0x344a('0x1a')]?_0x277c06[_0x344a('0x1a')][_0x344a('0x1f')]?_[_0x344a('0x20')](_0x277c06[_0x344a('0x1a')][_0x344a('0x1f')],function(_0x3b2ab9){return{'model':db[_0x3b2ab9[_0x344a('0x21')]],'as':_0x3b2ab9['as'],'attributes':_0x3b2ab9[_0x344a('0x1d')],'include':_0x3b2ab9['include']?_[_0x344a('0x20')](_0x3b2ab9['include'],function(_0x2a5e49){return{'model':db[_0x2a5e49['model']],'as':_0x2a5e49['as'],'attributes':_0x2a5e49[_0x344a('0x1d')],'include':_0x2a5e49[_0x344a('0x1f')]?_[_0x344a('0x20')](_0x2a5e49[_0x344a('0x1f')],function(_0x26f059){return{'model':db[_0x26f059[_0x344a('0x21')]],'as':_0x26f059['as'],'attributes':_0x26f059[_0x344a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x344a('0xe')](function(_0x4f2499){logger[_0x344a('0xf')](_0x344a('0x17'),_0x277c06);logger[_0x344a('0x11')](_0x344a('0x17'),_0x277c06,JSON[_0x344a('0x22')](_0x4f2499));_0x9fe854(_0x4f2499);})[_0x344a('0x16')](function(_0x5b877d){logger[_0x344a('0x12')]('GetCampaign',_0x5b877d['message'],_0x277c06);_0x274016(_0x49b55f[_0x344a('0x12')](0x1f4,_0x5b877d[_0x344a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index b78e907..cf74afd 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 _0x34bd=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','post','addLists','addBlackLists','update','delete','removeLists','removeBlackLists','exports'];(function(_0x25ffd4,_0x16b31d){var _0x414452=function(_0x4440d2){while(--_0x4440d2){_0x25ffd4['push'](_0x25ffd4['shift']());}};_0x414452(++_0x16b31d);}(_0x34bd,0x10e));var _0xd34b=function(_0x4883cb,_0x3df63c){_0x4883cb=_0x4883cb-0x0;var _0x33aad7=_0x34bd[_0x4883cb];return _0x33aad7;};'use strict';var multer=require(_0xd34b('0x0'));var util=require('util');var path=require(_0xd34b('0x1'));var timeout=require(_0xd34b('0x2'));var express=require(_0xd34b('0x3'));var router=express[_0xd34b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd34b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd34b('0x6'));var controller=require(_0xd34b('0x7'));router[_0xd34b('0x8')]('/',auth[_0xd34b('0x9')](),controller['index']);router['get'](_0xd34b('0xa'),auth[_0xd34b('0x9')](),controller['show']);router[_0xd34b('0x8')]('/:id/hoppers',auth[_0xd34b('0x9')](),controller['getHoppers']);router[_0xd34b('0x8')](_0xd34b('0xb'),auth[_0xd34b('0x9')](),controller[_0xd34b('0xc')]);router[_0xd34b('0x8')](_0xd34b('0xd'),auth[_0xd34b('0x9')](),controller[_0xd34b('0xe')]);router[_0xd34b('0x8')](_0xd34b('0xf'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x10')]);router['get'](_0xd34b('0x11'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x12')]);router[_0xd34b('0x8')](_0xd34b('0x13'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xd34b('0x9')](),controller[_0xd34b('0x14')]);router['post'](_0xd34b('0x15'),auth[_0xd34b('0x9')](),controller['clone']);router[_0xd34b('0x16')](_0xd34b('0x11'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x17')]);router[_0xd34b('0x16')](_0xd34b('0x13'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x18')]);router['put'](_0xd34b('0xa'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x19')]);router['delete']('/:id',auth[_0xd34b('0x9')](),controller['destroy']);router[_0xd34b('0x1a')]('/:id/lists',auth[_0xd34b('0x9')](),controller[_0xd34b('0x1b')]);router[_0xd34b('0x1a')](_0xd34b('0x13'),auth[_0xd34b('0x9')](),controller[_0xd34b('0x1c')]);module[_0xd34b('0x1d')]=router; \ No newline at end of file +var _0x970a=['/:id/hopper_black','getHopperBlacks','/:id/lists','post','create','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x16b3df,_0x4af07f){var _0x486cca=function(_0x137847){while(--_0x137847){_0x16b3df['push'](_0x16b3df['shift']());}};_0x486cca(++_0x4af07f);}(_0x970a,0xee));var _0xa970=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x970a[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0xa970('0x0'));var util=require(_0xa970('0x1'));var path=require(_0xa970('0x2'));var timeout=require(_0xa970('0x3'));var express=require(_0xa970('0x4'));var router=express[_0xa970('0x5')]();var fs_extra=require(_0xa970('0x6'));var auth=require(_0xa970('0x7'));var interaction=require(_0xa970('0x8'));var config=require(_0xa970('0x9'));var controller=require(_0xa970('0xa'));router[_0xa970('0xb')]('/',auth[_0xa970('0xc')](),controller[_0xa970('0xd')]);router[_0xa970('0xb')](_0xa970('0xe'),auth['isAuthenticated'](),controller[_0xa970('0xf')]);router[_0xa970('0xb')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xa970('0x10')]);router[_0xa970('0xb')](_0xa970('0x11'),auth[_0xa970('0xc')](),controller[_0xa970('0x12')]);router[_0xa970('0xb')](_0xa970('0x13'),auth[_0xa970('0xc')](),controller[_0xa970('0x14')]);router[_0xa970('0xb')](_0xa970('0x15'),auth[_0xa970('0xc')](),controller[_0xa970('0x16')]);router['get'](_0xa970('0x17'),auth[_0xa970('0xc')](),controller['getLists']);router[_0xa970('0xb')]('/:id/blacklists',auth[_0xa970('0xc')](),controller['getBlackLists']);router[_0xa970('0x18')]('/',auth[_0xa970('0xc')](),controller[_0xa970('0x19')]);router[_0xa970('0x18')]('/:id/clone',auth[_0xa970('0xc')](),controller[_0xa970('0x1a')]);router[_0xa970('0x18')](_0xa970('0x17'),auth[_0xa970('0xc')](),controller[_0xa970('0x1b')]);router[_0xa970('0x18')](_0xa970('0x1c'),auth['isAuthenticated'](),controller[_0xa970('0x1d')]);router[_0xa970('0x1e')](_0xa970('0xe'),auth[_0xa970('0xc')](),controller[_0xa970('0x1f')]);router[_0xa970('0x20')](_0xa970('0xe'),auth['isAuthenticated'](),controller[_0xa970('0x21')]);router[_0xa970('0x20')](_0xa970('0x17'),auth[_0xa970('0xc')](),controller[_0xa970('0x22')]);router['delete']('/:id/blacklists',auth[_0xa970('0xc')](),controller[_0xa970('0x23')]);module[_0xa970('0x24')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9d22d98..bfcf98a 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 _0xab5e=['STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x2d489a,_0x25ce3c){var _0x11b301=function(_0x2bc6f1){while(--_0x2bc6f1){_0x2d489a['push'](_0x2d489a['shift']());}};_0x11b301(++_0x25ce3c);}(_0xab5e,0x1b8));var _0xeab5=function(_0x2836c2,_0x2524fa){_0x2836c2=_0x2836c2-0x0;var _0x1e6a75=_0xab5e[_0x2836c2];return _0x1e6a75;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0xeab5('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0xeab5('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xeab5('0x2')],'get':function(){return this[_0xeab5('0x3')]('key');}}}; \ No newline at end of file +var _0x27f7=['getDataValue','key','exports','TEXT','STRING','VIRTUAL'];(function(_0x32e9e9,_0x3df5aa){var _0x400b63=function(_0x5d0454){while(--_0x5d0454){_0x32e9e9['push'](_0x32e9e9['shift']());}};_0x400b63(++_0x3df5aa);}(_0x27f7,0x1d0));var _0x727f=function(_0x9f5cc8,_0x48b161){_0x9f5cc8=_0x9f5cc8-0x0;var _0x30fc68=_0x27f7[_0x9f5cc8];return _0x30fc68;};'use strict';var Sequelize=require('sequelize');module[_0x727f('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x727f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x727f('0x2')]},'name':{'type':Sequelize[_0x727f('0x3')],'get':function(){return this[_0x727f('0x4')](_0x727f('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 4709650..73511e6 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 _0xa5fa=['order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','filters','intersection','model','query','attributes','fields','length','nolimit'];(function(_0x80f331,_0x49a354){var _0x41f184=function(_0x1aa518){while(--_0x1aa518){_0x80f331['push'](_0x80f331['shift']());}};_0x41f184(++_0x49a354);}(_0xa5fa,0x73));var _0xaa5f=function(_0x1bdda0,_0x29dedf){_0x1bdda0=_0x1bdda0-0x0;var _0x269a8f=_0xa5fa[_0x1bdda0];return _0x269a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa5f('0x0'));var jsonpatch=require(_0xaa5f('0x1'));var rp=require(_0xaa5f('0x2'));var moment=require(_0xaa5f('0x3'));var BPromise=require(_0xaa5f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaa5f('0x5'));var sox=require(_0xaa5f('0x6'));var csv=require(_0xaa5f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa5f('0x8'));var _=require('lodash');var squel=require(_0xaa5f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa5f('0xa'));var toCsv=require(_0xaa5f('0x7'));var querystring=require(_0xaa5f('0xb'));var Papa=require('papaparse');var Redis=require(_0xaa5f('0xc'));var authService=require(_0xaa5f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa5f('0xf'))('api');var utils=require(_0xaa5f('0x10'));var config=require(_0xaa5f('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2608bf,_0x2c1676){_0x2c1676=_0x2c1676||0xcc;return function(_0x4ba398){if(_0x4ba398){return _0x2608bf[_0xaa5f('0x12')](_0x2c1676);}return _0x2608bf[_0xaa5f('0x13')](_0x2c1676)[_0xaa5f('0x14')]();};}function respondWithResult(_0x36ce3a,_0xa5de96){_0xa5de96=_0xa5de96||0xc8;return function(_0x3ccc8b){if(_0x3ccc8b){return _0x36ce3a[_0xaa5f('0x13')](_0xa5de96)[_0xaa5f('0x15')](_0x3ccc8b);}};}function respondWithFilteredResult(_0x1d672e,_0x28fa45){return function(_0x5d1d12){if(_0x5d1d12){var _0x25be5f=typeof _0x28fa45[_0xaa5f('0x16')]==='undefined'&&typeof _0x28fa45[_0xaa5f('0x17')]===_0xaa5f('0x18');var _0x3c66f9=_0x5d1d12[_0xaa5f('0x19')];var _0x5a6a14=_0x25be5f?0x0:_0x28fa45['offset'];var _0xefd006=_0x25be5f?_0x5d1d12['count']:_0x28fa45[_0xaa5f('0x16')]+_0x28fa45['limit'];var _0x5b46f5;if(_0xefd006>=_0x3c66f9){_0xefd006=_0x3c66f9;_0x5b46f5=0xc8;}else{_0x5b46f5=0xce;}_0x1d672e['status'](_0x5b46f5);return _0x1d672e[_0xaa5f('0x1a')](_0xaa5f('0x1b'),_0x5a6a14+'-'+_0xefd006+'/'+_0x3c66f9)[_0xaa5f('0x15')](_0x5d1d12);}return null;};}function patchUpdates(_0x3805ea){return function(_0x5b2699){try{jsonpatch[_0xaa5f('0x1c')](_0x5b2699,_0x3805ea,!![]);}catch(_0x5958c7){return BPromise[_0xaa5f('0x1d')](_0x5958c7);}return _0x5b2699[_0xaa5f('0x1e')]();};}function saveUpdates(_0x26e74b,_0x9c0fd){return function(_0x473783){if(_0x473783){return _0x473783[_0xaa5f('0x1f')](_0x26e74b)[_0xaa5f('0x20')](function(_0x3e4933){return _0x3e4933;});}return null;};}function removeEntity(_0x546b6c,_0x4378a2){return function(_0x16b52c){if(_0x16b52c){return _0x16b52c[_0xaa5f('0x21')]()[_0xaa5f('0x20')](function(){var _0x28afde=_0x16b52c[_0xaa5f('0x22')]({'plain':!![]});var _0x15c022='CannedAnswers';return db[_0xaa5f('0x23')][_0xaa5f('0x21')]({'where':{'type':_0x15c022,'resourceId':_0x28afde['id']}})[_0xaa5f('0x20')](function(){return _0x16b52c;});})[_0xaa5f('0x20')](function(){_0x546b6c[_0xaa5f('0x13')](0xcc)[_0xaa5f('0x14')]();});}};}function handleEntityNotFound(_0x1bbce6,_0x1a32cb){return function(_0x5a3ccf){if(!_0x5a3ccf){_0x1bbce6['sendStatus'](0x194);}return _0x5a3ccf;};}function handleError(_0x5652b2,_0xff81f1){_0xff81f1=_0xff81f1||0x1f4;return function(_0x5532e4){logger[_0xaa5f('0x24')](_0x5532e4[_0xaa5f('0x25')]);if(_0x5532e4['name']){delete _0x5532e4[_0xaa5f('0x26')];}_0x5652b2[_0xaa5f('0x13')](_0xff81f1)[_0xaa5f('0x27')](_0x5532e4);};}exports[_0xaa5f('0x28')]=function(_0x2f3d68,_0x3ddaa1){var _0xaa08fb={},_0x181ddc={},_0x269411={'count':0x0,'rows':[]};var _0x2bd8ec=_[_0xaa5f('0x29')](db[_0xaa5f('0x2a')][_0xaa5f('0x2b')],function(_0x4201bd){return{'name':_0x4201bd[_0xaa5f('0x2c')],'type':_0x4201bd['type']['key']};});_0x181ddc['model']=_[_0xaa5f('0x29')](_0x2bd8ec,_0xaa5f('0x26'));_0x181ddc['query']=_['keys'](_0x2f3d68['query']);_0x181ddc[_0xaa5f('0x2d')]=_[_0xaa5f('0x2e')](_0x181ddc[_0xaa5f('0x2f')],_0x181ddc[_0xaa5f('0x30')]);_0xaa08fb[_0xaa5f('0x31')]=_[_0xaa5f('0x2e')](_0x181ddc[_0xaa5f('0x2f')],qs[_0xaa5f('0x32')](_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x32')]));_0xaa08fb[_0xaa5f('0x31')]=_0xaa08fb[_0xaa5f('0x31')][_0xaa5f('0x33')]?_0xaa08fb[_0xaa5f('0x31')]:_0x181ddc['model'];if(!_0x2f3d68[_0xaa5f('0x30')]['hasOwnProperty'](_0xaa5f('0x34'))){_0xaa08fb[_0xaa5f('0x17')]=qs[_0xaa5f('0x17')](_0x2f3d68[_0xaa5f('0x30')]['limit']);_0xaa08fb[_0xaa5f('0x16')]=qs[_0xaa5f('0x16')](_0x2f3d68[_0xaa5f('0x30')]['offset']);}_0xaa08fb[_0xaa5f('0x35')]=qs[_0xaa5f('0x36')](_0x2f3d68['query']['sort']);_0xaa08fb[_0xaa5f('0x37')]=qs[_0xaa5f('0x2d')](_['pick'](_0x2f3d68['query'],_0x181ddc[_0xaa5f('0x2d')]),_0x2bd8ec);if(_0x2f3d68['query'][_0xaa5f('0x38')]){_0xaa08fb[_0xaa5f('0x37')]=_[_0xaa5f('0x39')](_0xaa08fb[_0xaa5f('0x37')],{'$or':[{'key':{'$like':'%'+_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x38')]+'%'}},{'value':{'$like':'%'+_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x38')]+'%'}}]});}_0xaa08fb=_[_0xaa5f('0x39')]({},_0xaa08fb,_0x2f3d68[_0xaa5f('0x3a')]);var _0xb57091={'where':_0xaa08fb[_0xaa5f('0x37')]};return db['CannedAnswer']['count'](_0xb57091)[_0xaa5f('0x20')](function(_0x301d0b){_0x269411[_0xaa5f('0x19')]=_0x301d0b;if(_0x2f3d68[_0xaa5f('0x30')][_0xaa5f('0x3b')]){_0xaa08fb[_0xaa5f('0x3c')]=[{'all':!![]}];}return db[_0xaa5f('0x2a')][_0xaa5f('0x3d')](_0xaa08fb);})[_0xaa5f('0x20')](function(_0x241223){_0x269411['rows']=_0x241223;return _0x269411;})[_0xaa5f('0x20')](respondWithFilteredResult(_0x3ddaa1,_0xaa08fb))[_0xaa5f('0x3e')](handleError(_0x3ddaa1,null));};exports[_0xaa5f('0x3f')]=function(_0x1491b6,_0xf45aa9){var _0x765dc4={'raw':!![],'where':{'id':_0x1491b6[_0xaa5f('0x40')]['id']}},_0x5f4dbd={};_0x5f4dbd['model']=_[_0xaa5f('0x41')](db[_0xaa5f('0x2a')]['rawAttributes']);_0x5f4dbd['query']=_['keys'](_0x1491b6['query']);_0x5f4dbd[_0xaa5f('0x2d')]=_['intersection'](_0x5f4dbd[_0xaa5f('0x2f')],_0x5f4dbd[_0xaa5f('0x30')]);_0x765dc4[_0xaa5f('0x31')]=_[_0xaa5f('0x2e')](_0x5f4dbd[_0xaa5f('0x2f')],qs[_0xaa5f('0x32')](_0x1491b6['query'][_0xaa5f('0x32')]));_0x765dc4[_0xaa5f('0x31')]=_0x765dc4['attributes'][_0xaa5f('0x33')]?_0x765dc4[_0xaa5f('0x31')]:_0x5f4dbd['model'];if(_0x1491b6[_0xaa5f('0x30')]['includeAll']){_0x765dc4[_0xaa5f('0x3c')]=[{'all':!![]}];}_0x765dc4=_['merge']({},_0x765dc4,_0x1491b6[_0xaa5f('0x3a')]);return db[_0xaa5f('0x2a')][_0xaa5f('0x42')](_0x765dc4)[_0xaa5f('0x20')](handleEntityNotFound(_0xf45aa9,null))[_0xaa5f('0x20')](respondWithResult(_0xf45aa9,null))[_0xaa5f('0x3e')](handleError(_0xf45aa9,null));};exports['update']=function(_0x325169,_0x49c3b8){if(_0x325169[_0xaa5f('0x43')]['id']){delete _0x325169['body']['id'];}return db[_0xaa5f('0x2a')][_0xaa5f('0x42')]({'where':{'id':_0x325169[_0xaa5f('0x40')]['id']}})[_0xaa5f('0x20')](handleEntityNotFound(_0x49c3b8,null))['then'](saveUpdates(_0x325169[_0xaa5f('0x43')],null))[_0xaa5f('0x20')](respondWithResult(_0x49c3b8,null))['catch'](handleError(_0x49c3b8,null));};exports['destroy']=function(_0x443a3d,_0xf32077){return db[_0xaa5f('0x2a')][_0xaa5f('0x42')]({'where':{'id':_0x443a3d[_0xaa5f('0x40')]['id']}})[_0xaa5f('0x20')](handleEntityNotFound(_0xf32077,null))[_0xaa5f('0x20')](removeEntity(_0xf32077,null))[_0xaa5f('0x3e')](handleError(_0xf32077,null));};exports['create']=function(_0x38cdbf,_0x246fd5){var _0x2d9d52={'key':_0x38cdbf['body'][_0xaa5f('0x44')]};if(_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x45')]){_0x2d9d52['MailAccountId']=_0x38cdbf[_0xaa5f('0x43')]['MailAccountId'];}else if(_0x38cdbf[_0xaa5f('0x43')]['SmsAccountId']){_0x2d9d52[_0xaa5f('0x46')]=_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x46')];}else if(_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x47')]){_0x2d9d52[_0xaa5f('0x47')]=_0x38cdbf[_0xaa5f('0x43')][_0xaa5f('0x47')];}else if(_0x38cdbf['body'][_0xaa5f('0x48')]){_0x2d9d52[_0xaa5f('0x48')]=_0x38cdbf[_0xaa5f('0x43')]['ChatWebsiteId'];}return db[_0xaa5f('0x2a')]['find']({'where':_0x2d9d52})[_0xaa5f('0x20')](function(_0x3252ed){if(_0x3252ed){throw new db[(_0xaa5f('0x49'))][(_0xaa5f('0x4a'))](_0xaa5f('0x4b'));}return db[_0xaa5f('0x2a')]['create'](_0x38cdbf[_0xaa5f('0x43')]);})[_0xaa5f('0x20')](function(_0x4082e7){var _0x388bc2=_0x38cdbf['user'][_0xaa5f('0x22')]({'plain':!![]});if(!_0x388bc2)throw new Error(_0xaa5f('0x4c'));if(_0x388bc2[_0xaa5f('0x4d')]===_0xaa5f('0x4e')){var _0x26fe32=_0x4082e7['get']({'plain':!![]});return db[_0xaa5f('0x4f')][_0xaa5f('0x42')]({'where':{'name':_0xaa5f('0x50'),'userProfileId':_0x388bc2['userProfileId']},'raw':!![]})['then'](function(_0x54d8b8){if(_0x54d8b8&&_0x54d8b8[_0xaa5f('0x51')]===0x0){return db[_0xaa5f('0x23')][_0xaa5f('0x52')]({'name':_0x26fe32['name'],'resourceId':_0x26fe32['id'],'type':_0x54d8b8[_0xaa5f('0x26')],'sectionId':_0x54d8b8['id']},{})[_0xaa5f('0x20')](function(){return _0x4082e7;});}else{return _0x4082e7;}})['catch'](function(_0x36adf1){logger[_0xaa5f('0x24')](_0xaa5f('0x53'),_0x36adf1);throw _0x36adf1;});}return _0x4082e7;})[_0xaa5f('0x20')](respondWithResult(_0x246fd5,0xc9))[_0xaa5f('0x3e')](handleError(_0x246fd5,null));}; \ No newline at end of file +var _0xa123=['keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CannedAnswer','includeAll','findAll','rows','show','params','include','options','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','map','rawAttributes','type','key','query'];(function(_0x559d14,_0x3a0215){var _0x595aed=function(_0x56fdb9){while(--_0x56fdb9){_0x559d14['push'](_0x559d14['shift']());}};_0x595aed(++_0x3a0215);}(_0xa123,0x7f));var _0x3a12=function(_0x495857,_0x4c04b2){_0x495857=_0x495857-0x0;var _0x252d16=_0xa123[_0x495857];return _0x252d16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a12('0x0'));var zipdir=require(_0x3a12('0x1'));var jsonpatch=require(_0x3a12('0x2'));var rp=require(_0x3a12('0x3'));var moment=require(_0x3a12('0x4'));var BPromise=require(_0x3a12('0x5'));var Mustache=require(_0x3a12('0x6'));var util=require(_0x3a12('0x7'));var path=require(_0x3a12('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3a12('0x9'));var fs=require('fs');var fs_extra=require(_0x3a12('0xa'));var _=require(_0x3a12('0xb'));var squel=require(_0x3a12('0xc'));var crypto=require('crypto');var jsforce=require(_0x3a12('0xd'));var deskjs=require(_0x3a12('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a12('0xf'));var Papa=require(_0x3a12('0x10'));var Redis=require(_0x3a12('0x11'));var authService=require(_0x3a12('0x12'));var qs=require(_0x3a12('0x13'));var as=require(_0x3a12('0x14'));var hardwareService=require(_0x3a12('0x15'));var logger=require(_0x3a12('0x16'))(_0x3a12('0x17'));var utils=require(_0x3a12('0x18'));var config=require(_0x3a12('0x19'));var licenseUtil=require(_0x3a12('0x1a'));var db=require(_0x3a12('0x1b'))['db'];function respondWithStatusCode(_0x20cce2,_0x361696){_0x361696=_0x361696||0xcc;return function(_0x4871f6){if(_0x4871f6){return _0x20cce2[_0x3a12('0x1c')](_0x361696);}return _0x20cce2[_0x3a12('0x1d')](_0x361696)[_0x3a12('0x1e')]();};}function respondWithResult(_0x4177f4,_0x109fb8){_0x109fb8=_0x109fb8||0xc8;return function(_0x1998e2){if(_0x1998e2){return _0x4177f4['status'](_0x109fb8)[_0x3a12('0x1f')](_0x1998e2);}};}function respondWithFilteredResult(_0x42f70b,_0x4a79a0){return function(_0x3c3805){if(_0x3c3805){var _0x296f76=typeof _0x4a79a0['offset']===_0x3a12('0x20')&&typeof _0x4a79a0[_0x3a12('0x21')]===_0x3a12('0x20');var _0x1b0d55=_0x3c3805[_0x3a12('0x22')];var _0x4fc76f=_0x296f76?0x0:_0x4a79a0[_0x3a12('0x23')];var _0x41e2c9=_0x296f76?_0x3c3805[_0x3a12('0x22')]:_0x4a79a0[_0x3a12('0x23')]+_0x4a79a0[_0x3a12('0x21')];var _0x38ccd2;if(_0x41e2c9>=_0x1b0d55){_0x41e2c9=_0x1b0d55;_0x38ccd2=0xc8;}else{_0x38ccd2=0xce;}_0x42f70b[_0x3a12('0x1d')](_0x38ccd2);return _0x42f70b[_0x3a12('0x24')]('Content-Range',_0x4fc76f+'-'+_0x41e2c9+'/'+_0x1b0d55)['json'](_0x3c3805);}return null;};}function patchUpdates(_0x3b1de0){return function(_0x2f932f){try{jsonpatch[_0x3a12('0x25')](_0x2f932f,_0x3b1de0,!![]);}catch(_0x5c10cf){return BPromise[_0x3a12('0x26')](_0x5c10cf);}return _0x2f932f[_0x3a12('0x27')]();};}function saveUpdates(_0x394fe1,_0x1f88ee){return function(_0x26e014){if(_0x26e014){return _0x26e014[_0x3a12('0x28')](_0x394fe1)[_0x3a12('0x29')](function(_0x5c0089){return _0x5c0089;});}return null;};}function removeEntity(_0x5b2ca1,_0x1ddb2e){return function(_0x28eec7){if(_0x28eec7){return _0x28eec7[_0x3a12('0x2a')]()[_0x3a12('0x29')](function(){var _0xd3611=_0x28eec7[_0x3a12('0x2b')]({'plain':!![]});var _0x39648d=_0x3a12('0x2c');return db[_0x3a12('0x2d')][_0x3a12('0x2a')]({'where':{'type':_0x39648d,'resourceId':_0xd3611['id']}})['then'](function(){return _0x28eec7;});})[_0x3a12('0x29')](function(){_0x5b2ca1[_0x3a12('0x1d')](0xcc)[_0x3a12('0x1e')]();});}};}function handleEntityNotFound(_0x26a5d4,_0x3fb260){return function(_0xc8dbbf){if(!_0xc8dbbf){_0x26a5d4[_0x3a12('0x1c')](0x194);}return _0xc8dbbf;};}function handleError(_0x349c1c,_0x36afbf){_0x36afbf=_0x36afbf||0x1f4;return function(_0x499371){logger[_0x3a12('0x2e')](_0x499371['stack']);if(_0x499371['name']){delete _0x499371[_0x3a12('0x2f')];}_0x349c1c['status'](_0x36afbf)['send'](_0x499371);};}exports['index']=function(_0xf9a097,_0x59dbe5){var _0x3f4f9d={},_0x3bcaab={},_0x5acc5b={'count':0x0,'rows':[]};var _0x4d94d5=_[_0x3a12('0x30')](db['CannedAnswer'][_0x3a12('0x31')],function(_0x1f2920){return{'name':_0x1f2920['fieldName'],'type':_0x1f2920[_0x3a12('0x32')][_0x3a12('0x33')]};});_0x3bcaab['model']=_[_0x3a12('0x30')](_0x4d94d5,_0x3a12('0x2f'));_0x3bcaab[_0x3a12('0x34')]=_[_0x3a12('0x35')](_0xf9a097[_0x3a12('0x34')]);_0x3bcaab[_0x3a12('0x36')]=_[_0x3a12('0x37')](_0x3bcaab[_0x3a12('0x38')],_0x3bcaab[_0x3a12('0x34')]);_0x3f4f9d[_0x3a12('0x39')]=_[_0x3a12('0x37')](_0x3bcaab[_0x3a12('0x38')],qs[_0x3a12('0x3a')](_0xf9a097[_0x3a12('0x34')][_0x3a12('0x3a')]));_0x3f4f9d['attributes']=_0x3f4f9d[_0x3a12('0x39')]['length']?_0x3f4f9d[_0x3a12('0x39')]:_0x3bcaab[_0x3a12('0x38')];if(!_0xf9a097[_0x3a12('0x34')][_0x3a12('0x3b')](_0x3a12('0x3c'))){_0x3f4f9d[_0x3a12('0x21')]=qs['limit'](_0xf9a097[_0x3a12('0x34')]['limit']);_0x3f4f9d['offset']=qs[_0x3a12('0x23')](_0xf9a097['query'][_0x3a12('0x23')]);}_0x3f4f9d[_0x3a12('0x3d')]=qs[_0x3a12('0x3e')](_0xf9a097[_0x3a12('0x34')][_0x3a12('0x3e')]);_0x3f4f9d[_0x3a12('0x3f')]=qs[_0x3a12('0x36')](_[_0x3a12('0x40')](_0xf9a097[_0x3a12('0x34')],_0x3bcaab[_0x3a12('0x36')]),_0x4d94d5);if(_0xf9a097[_0x3a12('0x34')][_0x3a12('0x41')]){_0x3f4f9d['where']=_[_0x3a12('0x42')](_0x3f4f9d['where'],{'$or':[{'key':{'$like':'%'+_0xf9a097[_0x3a12('0x34')]['filter']+'%'}},{'value':{'$like':'%'+_0xf9a097[_0x3a12('0x34')][_0x3a12('0x41')]+'%'}}]});}_0x3f4f9d=_[_0x3a12('0x42')]({},_0x3f4f9d,_0xf9a097['options']);var _0x368572={'where':_0x3f4f9d['where']};return db[_0x3a12('0x43')][_0x3a12('0x22')](_0x368572)[_0x3a12('0x29')](function(_0x3861bd){_0x5acc5b['count']=_0x3861bd;if(_0xf9a097[_0x3a12('0x34')][_0x3a12('0x44')]){_0x3f4f9d['include']=[{'all':!![]}];}return db[_0x3a12('0x43')][_0x3a12('0x45')](_0x3f4f9d);})[_0x3a12('0x29')](function(_0x3e1d74){_0x5acc5b[_0x3a12('0x46')]=_0x3e1d74;return _0x5acc5b;})[_0x3a12('0x29')](respondWithFilteredResult(_0x59dbe5,_0x3f4f9d))['catch'](handleError(_0x59dbe5,null));};exports[_0x3a12('0x47')]=function(_0x3dbd8b,_0x524843){var _0x33fd2f={'raw':!![],'where':{'id':_0x3dbd8b[_0x3a12('0x48')]['id']}},_0x5e1020={};_0x5e1020[_0x3a12('0x38')]=_[_0x3a12('0x35')](db[_0x3a12('0x43')]['rawAttributes']);_0x5e1020[_0x3a12('0x34')]=_['keys'](_0x3dbd8b[_0x3a12('0x34')]);_0x5e1020['filters']=_[_0x3a12('0x37')](_0x5e1020['model'],_0x5e1020[_0x3a12('0x34')]);_0x33fd2f['attributes']=_[_0x3a12('0x37')](_0x5e1020[_0x3a12('0x38')],qs[_0x3a12('0x3a')](_0x3dbd8b['query']['fields']));_0x33fd2f[_0x3a12('0x39')]=_0x33fd2f[_0x3a12('0x39')]['length']?_0x33fd2f['attributes']:_0x5e1020[_0x3a12('0x38')];if(_0x3dbd8b[_0x3a12('0x34')][_0x3a12('0x44')]){_0x33fd2f[_0x3a12('0x49')]=[{'all':!![]}];}_0x33fd2f=_['merge']({},_0x33fd2f,_0x3dbd8b[_0x3a12('0x4a')]);return db[_0x3a12('0x43')][_0x3a12('0x4b')](_0x33fd2f)['then'](handleEntityNotFound(_0x524843,null))[_0x3a12('0x29')](respondWithResult(_0x524843,null))[_0x3a12('0x4c')](handleError(_0x524843,null));};exports[_0x3a12('0x28')]=function(_0x3b692c,_0xfa62){if(_0x3b692c[_0x3a12('0x4d')]['id']){delete _0x3b692c[_0x3a12('0x4d')]['id'];}return db[_0x3a12('0x43')][_0x3a12('0x4b')]({'where':{'id':_0x3b692c[_0x3a12('0x48')]['id']}})[_0x3a12('0x29')](handleEntityNotFound(_0xfa62,null))[_0x3a12('0x29')](saveUpdates(_0x3b692c[_0x3a12('0x4d')],null))[_0x3a12('0x29')](respondWithResult(_0xfa62,null))[_0x3a12('0x4c')](handleError(_0xfa62,null));};exports[_0x3a12('0x2a')]=function(_0x4f38c6,_0x27c13f){return db['CannedAnswer'][_0x3a12('0x4b')]({'where':{'id':_0x4f38c6['params']['id']}})[_0x3a12('0x29')](handleEntityNotFound(_0x27c13f,null))[_0x3a12('0x29')](removeEntity(_0x27c13f,null))['catch'](handleError(_0x27c13f,null));};exports[_0x3a12('0x4e')]=function(_0x109584,_0xefee9b){var _0x5e1647={'key':_0x109584[_0x3a12('0x4d')][_0x3a12('0x33')]};if(_0x109584[_0x3a12('0x4d')][_0x3a12('0x4f')]){_0x5e1647[_0x3a12('0x4f')]=_0x109584[_0x3a12('0x4d')][_0x3a12('0x4f')];}else if(_0x109584['body']['SmsAccountId']){_0x5e1647['SmsAccountId']=_0x109584['body'][_0x3a12('0x50')];}else if(_0x109584[_0x3a12('0x4d')]['OpenchannelAccountId']){_0x5e1647[_0x3a12('0x51')]=_0x109584[_0x3a12('0x4d')]['OpenchannelAccountId'];}else if(_0x109584[_0x3a12('0x4d')][_0x3a12('0x52')]){_0x5e1647[_0x3a12('0x52')]=_0x109584[_0x3a12('0x4d')]['ChatWebsiteId'];}return db[_0x3a12('0x43')][_0x3a12('0x4b')]({'where':_0x5e1647})['then'](function(_0x18a909){if(_0x18a909){throw new db[(_0x3a12('0x53'))][(_0x3a12('0x54'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x3a12('0x43')][_0x3a12('0x4e')](_0x109584[_0x3a12('0x4d')]);})['then'](function(_0x102205){var _0x5f1631=_0x109584['user'][_0x3a12('0x2b')]({'plain':!![]});if(!_0x5f1631)throw new Error(_0x3a12('0x55'));if(_0x5f1631[_0x3a12('0x56')]===_0x3a12('0x57')){var _0x3a691c=_0x102205[_0x3a12('0x2b')]({'plain':!![]});return db[_0x3a12('0x58')][_0x3a12('0x4b')]({'where':{'name':_0x3a12('0x2c'),'userProfileId':_0x5f1631['userProfileId']},'raw':!![]})['then'](function(_0xd2a945){if(_0xd2a945&&_0xd2a945['autoAssociation']===0x0){return db[_0x3a12('0x2d')][_0x3a12('0x4e')]({'name':_0x3a691c[_0x3a12('0x2f')],'resourceId':_0x3a691c['id'],'type':_0xd2a945[_0x3a12('0x2f')],'sectionId':_0xd2a945['id']},{})[_0x3a12('0x29')](function(){return _0x102205;});}else{return _0x102205;}})[_0x3a12('0x4c')](function(_0x4c1100){logger[_0x3a12('0x2e')](_0x3a12('0x59'),_0x4c1100);throw _0x4c1100;});}return _0x102205;})[_0x3a12('0x29')](respondWithResult(_0xefee9b,0xc9))['catch'](handleError(_0xefee9b,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 8df0ef5..ad72dfe 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 _0xc27f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util'];(function(_0x176afa,_0x1b2eaa){var _0x1394c7=function(_0x323b7f){while(--_0x323b7f){_0x176afa['push'](_0x176afa['shift']());}};_0x1394c7(++_0x1b2eaa);}(_0xc27f,0x85));var _0xfc27=function(_0x2718cf,_0x48ebf6){_0x2718cf=_0x2718cf-0x0;var _0x89ce77=_0xc27f[_0x2718cf];return _0x89ce77;};'use strict';var _=require(_0xfc27('0x0'));var util=require(_0xfc27('0x1'));var logger=require(_0xfc27('0x2'))('api');var moment=require(_0xfc27('0x3'));var BPromise=require(_0xfc27('0x4'));var rp=require(_0xfc27('0x5'));var fs=require('fs');var path=require(_0xfc27('0x6'));var rimraf=require(_0xfc27('0x7'));var config=require(_0xfc27('0x8'));var attributes=require(_0xfc27('0x9'));module[_0xfc27('0xa')]=function(_0x14c86a,_0x15c405){return _0x14c86a[_0xfc27('0xb')](_0xfc27('0xc'),attributes,{'tableName':_0xfc27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfc27('0xe')});}; \ No newline at end of file +var _0x324f=['define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','./cannedAnswer.attributes','exports'];(function(_0x270c25,_0x2f0ed7){var _0x3c8aa2=function(_0x4a3d20){while(--_0x4a3d20){_0x270c25['push'](_0x270c25['shift']());}};_0x3c8aa2(++_0x2f0ed7);}(_0x324f,0x94));var _0xf324=function(_0x43f1a6,_0x2458f6){_0x43f1a6=_0x43f1a6-0x0;var _0xd10cd3=_0x324f[_0x43f1a6];return _0xd10cd3;};'use strict';var _=require(_0xf324('0x0'));var util=require(_0xf324('0x1'));var logger=require(_0xf324('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf324('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf324('0x4'));var rimraf=require(_0xf324('0x5'));var config=require('../../config/environment');var attributes=require(_0xf324('0x6'));module[_0xf324('0x7')]=function(_0x5657a5,_0x19ef3b){return _0x5657a5[_0xf324('0x8')](_0xf324('0x9'),attributes,{'tableName':_0xf324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf324('0xb'),'collate':_0xf324('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a888d5d..26b16d6 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(_0x22ff5d,_0x171b60){var _0x4d706b=function(_0x163f26){while(--_0x163f26){_0x22ff5d['push'](_0x22ff5d['shift']());}};_0x4d706b(++_0x171b60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x215c3e,_0x391e25){var _0x1a52e7=function(_0x36970f){while(--_0x36970f){_0x215c3e['push'](_0x215c3e['shift']());}};_0x1a52e7(++_0x391e25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 6cde163..23bffbf 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 _0x74dd=['/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put'];(function(_0x10dfe6,_0x1a7a72){var _0x34dfe2=function(_0x2db5a8){while(--_0x2db5a8){_0x10dfe6['push'](_0x10dfe6['shift']());}};_0x34dfe2(++_0x1a7a72);}(_0x74dd,0xc3));var _0xd74d=function(_0x165834,_0x49e6d7){_0x165834=_0x165834-0x0;var _0x2f8df1=_0x74dd[_0x165834];return _0x2f8df1;};'use strict';var multer=require(_0xd74d('0x0'));var util=require(_0xd74d('0x1'));var path=require(_0xd74d('0x2'));var timeout=require('connect-timeout');var express=require(_0xd74d('0x3'));var router=express['Router']();var fs_extra=require(_0xd74d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd74d('0x5'));var config=require(_0xd74d('0x6'));var controller=require('./cannedAnswer.controller');router[_0xd74d('0x7')]('/',auth[_0xd74d('0x8')](),controller[_0xd74d('0x9')]);router[_0xd74d('0x7')]('/:id',auth[_0xd74d('0x8')](),controller[_0xd74d('0xa')]);router[_0xd74d('0xb')]('/',auth[_0xd74d('0x8')](),controller['create']);router[_0xd74d('0xc')](_0xd74d('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd74d('0x8')](),controller[_0xd74d('0xe')]);module[_0xd74d('0xf')]=router; \ No newline at end of file +var _0x3d56=['create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','post'];(function(_0x3da502,_0xc234d1){var _0x1263cd=function(_0x406caa){while(--_0x406caa){_0x3da502['push'](_0x3da502['shift']());}};_0x1263cd(++_0xc234d1);}(_0x3d56,0x156));var _0x63d5=function(_0x39b1fe,_0x4f8f17){_0x39b1fe=_0x39b1fe-0x0;var _0x306bfb=_0x3d56[_0x39b1fe];return _0x306bfb;};'use strict';var multer=require('multer');var util=require(_0x63d5('0x0'));var path=require(_0x63d5('0x1'));var timeout=require('connect-timeout');var express=require(_0x63d5('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x63d5('0x3'));var interaction=require(_0x63d5('0x4'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x63d5('0x5')]('/',auth['isAuthenticated'](),controller[_0x63d5('0x6')]);router['get'](_0x63d5('0x7'),auth[_0x63d5('0x8')](),controller['show']);router[_0x63d5('0x9')]('/',auth[_0x63d5('0x8')](),controller[_0x63d5('0xa')]);router[_0x63d5('0xb')](_0x63d5('0x7'),auth[_0x63d5('0x8')](),controller[_0x63d5('0xc')]);router[_0x63d5('0xd')](_0x63d5('0x7'),auth['isAuthenticated'](),controller[_0x63d5('0xe')]);module[_0x63d5('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 11f80d2..3227aff 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 _0x8bf7=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8bf7,0x139));var _0x78bf=function(_0x1e62f5,_0x4aba3f){_0x1e62f5=_0x1e62f5-0x0;var _0x5dfa2c=_0x8bf7[_0x1e62f5];return _0x5dfa2c;};'use strict';var Sequelize=require(_0x78bf('0x0'));module[_0x78bf('0x1')]={'calldate':{'type':Sequelize[_0x78bf('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x78bf('0x3')]},'src':{'type':Sequelize[_0x78bf('0x3')]},'dst':{'type':Sequelize[_0x78bf('0x3')]},'dcontext':{'type':Sequelize[_0x78bf('0x3')]},'channel':{'type':Sequelize[_0x78bf('0x3')]},'dstchannel':{'type':Sequelize[_0x78bf('0x3')]},'lastapp':{'type':Sequelize[_0x78bf('0x3')]},'lastdata':{'type':Sequelize[_0x78bf('0x3')]},'duration':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x78bf('0x3')]},'amaflags':{'type':Sequelize[_0x78bf('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x78bf('0x3')]},'userfield':{'type':Sequelize[_0x78bf('0x3')]},'uniqueid':{'type':Sequelize[_0x78bf('0x3')]},'linkedid':{'type':Sequelize[_0x78bf('0x3')]},'sequence':{'type':Sequelize[_0x78bf('0x3')]},'peeraccount':{'type':Sequelize[_0x78bf('0x3')]},'type':{'type':Sequelize[_0x78bf('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4458=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x485357,_0x3b58c9){var _0xbf2b19=function(_0x490c3f){while(--_0x490c3f){_0x485357['push'](_0x485357['shift']());}};_0xbf2b19(++_0x3b58c9);}(_0x4458,0x1e4));var _0x8445=function(_0x14007e,_0x3a64ec){_0x14007e=_0x14007e-0x0;var _0x56b82f=_0x4458[_0x14007e];return _0x56b82f;};'use strict';var Sequelize=require(_0x8445('0x0'));module[_0x8445('0x1')]={'calldate':{'type':Sequelize[_0x8445('0x2')],'allowNull':![],'defaultValue':_0x8445('0x3')},'clid':{'type':Sequelize[_0x8445('0x4')]},'src':{'type':Sequelize[_0x8445('0x4')]},'dst':{'type':Sequelize[_0x8445('0x4')]},'dcontext':{'type':Sequelize[_0x8445('0x4')]},'channel':{'type':Sequelize[_0x8445('0x4')]},'dstchannel':{'type':Sequelize[_0x8445('0x4')]},'lastapp':{'type':Sequelize[_0x8445('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8445('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8445('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8445('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x8445('0x4')]},'uniqueid':{'type':Sequelize[_0x8445('0x4')]},'linkedid':{'type':Sequelize[_0x8445('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x8445('0x4')]},'type':{'type':Sequelize[_0x8445('0x4')]},'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 0e183b8..4ddc99b 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 _0xabce=['../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','Cdr','rawAttributes','type','model','query','keys','filters','attributes','fields','length','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','params','intersection','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x23e779,_0x1663ff){var _0x3b0649=function(_0x1c4f69){while(--_0x1c4f69){_0x23e779['push'](_0x23e779['shift']());}};_0x3b0649(++_0x1663ff);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28'));_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x31')](_0x48fb52[_0xeabc('0x30')]);_0x2b568f[_0xeabc('0x32')]=_['intersection'](_0x2b568f[_0xeabc('0x2f')],_0x2b568f[_0xeabc('0x30')]);_0x38572d[_0xeabc('0x33')]=_['intersection'](_0x2b568f[_0xeabc('0x2f')],qs[_0xeabc('0x34')](_0x48fb52[_0xeabc('0x30')]['fields']));_0x38572d[_0xeabc('0x33')]=_0x38572d[_0xeabc('0x33')][_0xeabc('0x35')]?_0x38572d['attributes']:_0x2b568f[_0xeabc('0x2f')];if(!_0x48fb52[_0xeabc('0x30')]['hasOwnProperty']('nolimit')){_0x38572d[_0xeabc('0x1d')]=qs[_0xeabc('0x1d')](_0x48fb52['query'][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52[_0xeabc('0x30')][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x36')](_0x48fb52['query'][_0xeabc('0x36')]);_0x38572d[_0xeabc('0x37')]=qs[_0xeabc('0x32')](_['pick'](_0x48fb52['query'],_0x2b568f[_0xeabc('0x32')]),_0x149170);if(_0x48fb52['query'][_0xeabc('0x38')]){_0x38572d['where']=_['merge'](_0x38572d['where'],{'$or':_['map'](_0x149170,function(_0x1e222a){if(_0x1e222a['type']!==_0xeabc('0x39')){var _0x1ebfb6={};_0x1ebfb6[_0x1e222a['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x30')]['filter']+'%'};return _0x1ebfb6;}})});}_0x38572d=_[_0xeabc('0x3a')]({},_0x38572d,_0x48fb52['options']);var _0xbd7f03={'where':_0x38572d[_0xeabc('0x37')]};return db[_0xeabc('0x2c')]['count'](_0xbd7f03)['then'](function(_0x54a3ae){_0x2f8633[_0xeabc('0x1e')]=_0x54a3ae;if(_0x48fb52[_0xeabc('0x30')][_0xeabc('0x3b')]){_0x38572d['include']=[{'all':!![]}];}return db['Cdr'][_0xeabc('0x3c')](_0x38572d);})[_0xeabc('0x25')](function(_0x5e9cb3){_0x2f8633[_0xeabc('0x3d')]=_0x5e9cb3;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))[_0xeabc('0x3e')](handleError(_0x2163e6,null));};exports['show']=function(_0x5defaa,_0x5cd04d){var _0x25958b={'raw':!![],'where':{'id':_0x5defaa[_0xeabc('0x3f')]['id']}},_0x37c926={};_0x37c926[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')]['rawAttributes']);_0x37c926[_0xeabc('0x30')]=_[_0xeabc('0x31')](_0x5defaa[_0xeabc('0x30')]);_0x37c926[_0xeabc('0x32')]=_[_0xeabc('0x40')](_0x37c926['model'],_0x37c926['query']);_0x25958b[_0xeabc('0x33')]=_['intersection'](_0x37c926[_0xeabc('0x2f')],qs[_0xeabc('0x34')](_0x5defaa['query'][_0xeabc('0x34')]));_0x25958b[_0xeabc('0x33')]=_0x25958b[_0xeabc('0x33')][_0xeabc('0x35')]?_0x25958b[_0xeabc('0x33')]:_0x37c926[_0xeabc('0x2f')];if(_0x5defaa[_0xeabc('0x30')]['includeAll']){_0x25958b[_0xeabc('0x41')]=[{'all':!![]}];}_0x25958b=_[_0xeabc('0x3a')]({},_0x25958b,_0x5defaa[_0xeabc('0x42')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0x25958b)[_0xeabc('0x25')](handleEntityNotFound(_0x5cd04d,null))[_0xeabc('0x25')](respondWithResult(_0x5cd04d,null))[_0xeabc('0x3e')](handleError(_0x5cd04d,null));};exports[_0xeabc('0x44')]=function(_0x44e714,_0x5689fc){return db[_0xeabc('0x2c')][_0xeabc('0x44')](_0x44e714[_0xeabc('0x45')],{})[_0xeabc('0x25')](respondWithResult(_0x5689fc,0xc9))[_0xeabc('0x3e')](handleError(_0x5689fc,null));};exports[_0xeabc('0x24')]=function(_0x268d95,_0x48df43){if(_0x268d95[_0xeabc('0x45')]['id']){delete _0x268d95[_0xeabc('0x45')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x268d95[_0xeabc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x48df43,null))[_0xeabc('0x25')](saveUpdates(_0x268d95[_0xeabc('0x45')],null))[_0xeabc('0x25')](respondWithResult(_0x48df43,null))[_0xeabc('0x3e')](handleError(_0x48df43,null));};exports['destroy']=function(_0x400b82,_0x1b3aa4){return db['Cdr'][_0xeabc('0x43')]({'where':{'id':_0x400b82['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1b3aa4,null))['then'](removeEntity(_0x1b3aa4,null))[_0xeabc('0x3e')](handleError(_0x1b3aa4,null));};exports[_0xeabc('0x46')]=function(_0x38f988,_0x1524c3){return db[_0xeabc('0x2c')][_0xeabc('0x46')]()[_0xeabc('0x25')](respondWithResult(_0x1524c3,null))[_0xeabc('0x3e')](handleError(_0x1524c3,null));}; \ No newline at end of file +var _0x7a59=['describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','Cdr','findAll','show','params','keys','include','find','create','body','catch','update'];(function(_0x2dd20a,_0x272c2e){var _0x57dacd=function(_0x4b7acf){while(--_0x4b7acf){_0x2dd20a['push'](_0x2dd20a['shift']());}};_0x57dacd(++_0x272c2e);}(_0x7a59,0x16e));var _0x97a5=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7a59[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require(_0x97a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a5('0x1'));var rp=require(_0x97a5('0x2'));var moment=require(_0x97a5('0x3'));var BPromise=require(_0x97a5('0x4'));var Mustache=require(_0x97a5('0x5'));var util=require('util');var path=require(_0x97a5('0x6'));var sox=require(_0x97a5('0x7'));var csv=require(_0x97a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a5('0x9'));var _=require(_0x97a5('0xa'));var squel=require(_0x97a5('0xb'));var crypto=require(_0x97a5('0xc'));var jsforce=require(_0x97a5('0xd'));var deskjs=require(_0x97a5('0xe'));var toCsv=require(_0x97a5('0x8'));var querystring=require('querystring');var Papa=require(_0x97a5('0xf'));var Redis=require(_0x97a5('0x10'));var authService=require(_0x97a5('0x11'));var qs=require(_0x97a5('0x12'));var as=require(_0x97a5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x97a5('0x14'));var utils=require(_0x97a5('0x15'));var config=require(_0x97a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a5('0x17'))['db'];function respondWithStatusCode(_0x350720,_0x55305a){_0x55305a=_0x55305a||0xcc;return function(_0x4f85a0){if(_0x4f85a0){return _0x350720[_0x97a5('0x18')](_0x55305a);}return _0x350720[_0x97a5('0x19')](_0x55305a)['end']();};}function respondWithResult(_0x595437,_0x51d5e2){_0x51d5e2=_0x51d5e2||0xc8;return function(_0x5a4471){if(_0x5a4471){return _0x595437[_0x97a5('0x19')](_0x51d5e2)[_0x97a5('0x1a')](_0x5a4471);}};}function respondWithFilteredResult(_0x3603e4,_0x4d8ba7){return function(_0x1a7a62){if(_0x1a7a62){var _0x3fa986=typeof _0x4d8ba7['offset']===_0x97a5('0x1b')&&typeof _0x4d8ba7['limit']===_0x97a5('0x1b');var _0x55071b=_0x1a7a62['count'];var _0x52ce92=_0x3fa986?0x0:_0x4d8ba7[_0x97a5('0x1c')];var _0x5c5740=_0x3fa986?_0x1a7a62[_0x97a5('0x1d')]:_0x4d8ba7[_0x97a5('0x1c')]+_0x4d8ba7[_0x97a5('0x1e')];var _0x1efe8c;if(_0x5c5740>=_0x55071b){_0x5c5740=_0x55071b;_0x1efe8c=0xc8;}else{_0x1efe8c=0xce;}_0x3603e4['status'](_0x1efe8c);return _0x3603e4['set'](_0x97a5('0x1f'),_0x52ce92+'-'+_0x5c5740+'/'+_0x55071b)[_0x97a5('0x1a')](_0x1a7a62);}return null;};}function patchUpdates(_0x4e3386){return function(_0x51858b){try{jsonpatch[_0x97a5('0x20')](_0x51858b,_0x4e3386,!![]);}catch(_0x3d7dba){return BPromise[_0x97a5('0x21')](_0x3d7dba);}return _0x51858b['save']();};}function saveUpdates(_0x34fb55,_0x3a5849){return function(_0x23f4f8){if(_0x23f4f8){return _0x23f4f8['update'](_0x34fb55)[_0x97a5('0x22')](function(_0x33d6da){return _0x33d6da;});}return null;};}function removeEntity(_0x4e2074,_0x5e731e){return function(_0x469592){if(_0x469592){return _0x469592[_0x97a5('0x23')]()[_0x97a5('0x22')](function(){_0x4e2074[_0x97a5('0x19')](0xcc)[_0x97a5('0x24')]();});}};}function handleEntityNotFound(_0x302d78,_0xf7ad1e){return function(_0x4743e0){if(!_0x4743e0){_0x302d78['sendStatus'](0x194);}return _0x4743e0;};}function handleError(_0x2038dd,_0x46ee45){_0x46ee45=_0x46ee45||0x1f4;return function(_0x2ca97c){logger[_0x97a5('0x25')](_0x2ca97c[_0x97a5('0x26')]);if(_0x2ca97c[_0x97a5('0x27')]){delete _0x2ca97c['name'];}_0x2038dd[_0x97a5('0x19')](_0x46ee45)[_0x97a5('0x28')](_0x2ca97c);};}exports['index']=function(_0x274ccb,_0x52248f){var _0x48f1c1={},_0x1bdb74={},_0x2eaae4={'count':0x0,'rows':[]};var _0x5c1c67=_[_0x97a5('0x29')](db['Cdr'][_0x97a5('0x2a')],function(_0x3c5d02){return{'name':_0x3c5d02[_0x97a5('0x2b')],'type':_0x3c5d02[_0x97a5('0x2c')]['key']};});_0x1bdb74['model']=_[_0x97a5('0x29')](_0x5c1c67,_0x97a5('0x27'));_0x1bdb74[_0x97a5('0x2d')]=_['keys'](_0x274ccb[_0x97a5('0x2d')]);_0x1bdb74[_0x97a5('0x2e')]=_['intersection'](_0x1bdb74[_0x97a5('0x2f')],_0x1bdb74[_0x97a5('0x2d')]);_0x48f1c1['attributes']=_[_0x97a5('0x30')](_0x1bdb74[_0x97a5('0x2f')],qs[_0x97a5('0x31')](_0x274ccb['query'][_0x97a5('0x31')]));_0x48f1c1[_0x97a5('0x32')]=_0x48f1c1[_0x97a5('0x32')][_0x97a5('0x33')]?_0x48f1c1[_0x97a5('0x32')]:_0x1bdb74[_0x97a5('0x2f')];if(!_0x274ccb[_0x97a5('0x2d')]['hasOwnProperty'](_0x97a5('0x34'))){_0x48f1c1[_0x97a5('0x1e')]=qs[_0x97a5('0x1e')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1e')]);_0x48f1c1[_0x97a5('0x1c')]=qs[_0x97a5('0x1c')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x1c')]);}_0x48f1c1[_0x97a5('0x35')]=qs[_0x97a5('0x36')](_0x274ccb[_0x97a5('0x2d')][_0x97a5('0x36')]);_0x48f1c1['where']=qs[_0x97a5('0x2e')](_[_0x97a5('0x37')](_0x274ccb[_0x97a5('0x2d')],_0x1bdb74[_0x97a5('0x2e')]),_0x5c1c67);if(_0x274ccb[_0x97a5('0x2d')]['filter']){_0x48f1c1['where']=_[_0x97a5('0x38')](_0x48f1c1[_0x97a5('0x39')],{'$or':_[_0x97a5('0x29')](_0x5c1c67,function(_0x45a548){if(_0x45a548[_0x97a5('0x2c')]!==_0x97a5('0x3a')){var _0x57333b={};_0x57333b[_0x45a548[_0x97a5('0x27')]]={'$like':'%'+_0x274ccb['query'][_0x97a5('0x3b')]+'%'};return _0x57333b;}})});}_0x48f1c1=_[_0x97a5('0x38')]({},_0x48f1c1,_0x274ccb[_0x97a5('0x3c')]);var _0x798318={'where':_0x48f1c1[_0x97a5('0x39')]};return db['Cdr'][_0x97a5('0x1d')](_0x798318)[_0x97a5('0x22')](function(_0x64505){_0x2eaae4[_0x97a5('0x1d')]=_0x64505;if(_0x274ccb[_0x97a5('0x2d')]['includeAll']){_0x48f1c1['include']=[{'all':!![]}];}return db[_0x97a5('0x3d')][_0x97a5('0x3e')](_0x48f1c1);})[_0x97a5('0x22')](function(_0x20dbc6){_0x2eaae4['rows']=_0x20dbc6;return _0x2eaae4;})[_0x97a5('0x22')](respondWithFilteredResult(_0x52248f,_0x48f1c1))['catch'](handleError(_0x52248f,null));};exports[_0x97a5('0x3f')]=function(_0x331108,_0x111e72){var _0x5baf77={'raw':!![],'where':{'id':_0x331108[_0x97a5('0x40')]['id']}},_0xefb019={};_0xefb019['model']=_[_0x97a5('0x41')](db[_0x97a5('0x3d')][_0x97a5('0x2a')]);_0xefb019[_0x97a5('0x2d')]=_[_0x97a5('0x41')](_0x331108[_0x97a5('0x2d')]);_0xefb019[_0x97a5('0x2e')]=_[_0x97a5('0x30')](_0xefb019[_0x97a5('0x2f')],_0xefb019[_0x97a5('0x2d')]);_0x5baf77[_0x97a5('0x32')]=_[_0x97a5('0x30')](_0xefb019['model'],qs[_0x97a5('0x31')](_0x331108[_0x97a5('0x2d')][_0x97a5('0x31')]));_0x5baf77['attributes']=_0x5baf77[_0x97a5('0x32')][_0x97a5('0x33')]?_0x5baf77[_0x97a5('0x32')]:_0xefb019[_0x97a5('0x2f')];if(_0x331108[_0x97a5('0x2d')]['includeAll']){_0x5baf77[_0x97a5('0x42')]=[{'all':!![]}];}_0x5baf77=_[_0x97a5('0x38')]({},_0x5baf77,_0x331108[_0x97a5('0x3c')]);return db[_0x97a5('0x3d')][_0x97a5('0x43')](_0x5baf77)['then'](handleEntityNotFound(_0x111e72,null))[_0x97a5('0x22')](respondWithResult(_0x111e72,null))['catch'](handleError(_0x111e72,null));};exports[_0x97a5('0x44')]=function(_0x235f9d,_0x330f6a){return db['Cdr'][_0x97a5('0x44')](_0x235f9d[_0x97a5('0x45')],{})[_0x97a5('0x22')](respondWithResult(_0x330f6a,0xc9))[_0x97a5('0x46')](handleError(_0x330f6a,null));};exports[_0x97a5('0x47')]=function(_0x42ced6,_0x49b215){if(_0x42ced6[_0x97a5('0x45')]['id']){delete _0x42ced6[_0x97a5('0x45')]['id'];}return db[_0x97a5('0x3d')][_0x97a5('0x43')]({'where':{'id':_0x42ced6['params']['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x49b215,null))[_0x97a5('0x22')](saveUpdates(_0x42ced6['body'],null))[_0x97a5('0x22')](respondWithResult(_0x49b215,null))[_0x97a5('0x46')](handleError(_0x49b215,null));};exports[_0x97a5('0x23')]=function(_0x56890f,_0x2a6fa0){return db[_0x97a5('0x3d')]['find']({'where':{'id':_0x56890f[_0x97a5('0x40')]['id']}})[_0x97a5('0x22')](handleEntityNotFound(_0x2a6fa0,null))[_0x97a5('0x22')](removeEntity(_0x2a6fa0,null))['catch'](handleError(_0x2a6fa0,null));};exports[_0x97a5('0x48')]=function(_0xc3c9e5,_0x7adad){return db['Cdr']['describe']()[_0x97a5('0x22')](respondWithResult(_0x7adad,null))[_0x97a5('0x46')](handleError(_0x7adad,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 552800b..e14be76 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(_0x5a0918,_0x3f3a02){var _0x524d59=function(_0x1a0c72){while(--_0x1a0c72){_0x5a0918['push'](_0x5a0918['shift']());}};_0x524d59(++_0x3f3a02);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3898ef,_0x39f8d2){var _0x70c0a4=function(_0x4bcd7d){while(--_0x4bcd7d){_0x3898ef['push'](_0x3898ef['shift']());}};_0x70c0a4(++_0x39f8d2);}(_0x7a54,0x106));var _0x47a5=function(_0x54773a,_0xe68d8e){_0x54773a=_0x54773a-0x0;var _0x3302f4=_0x7a54[_0x54773a];return _0x3302f4;};'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 615d7c0..bc0e709 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 _0x41d2=['error','code','message','info','request\x20sent','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x164271,_0x55ecdc){var _0xfd6455=function(_0x2b0d25){while(--_0x2b0d25){_0x164271['push'](_0x164271['shift']());}};_0xfd6455(++_0x55ecdc);}(_0x41d2,0x18c));var _0x241d=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x41d2[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x241d('0x0'));var util=require(_0x241d('0x1'));var moment=require(_0x241d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x241d('0x3'));var db=require(_0x241d('0x4'))['db'];var utils=require(_0x241d('0x5'));var logger=require(_0x241d('0x6'))(_0x241d('0x7'));var config=require(_0x241d('0x8'));var jayson=require(_0x241d('0x9'));var client=jayson[_0x241d('0xa')][_0x241d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39aadd,_0x3c1d54,_0x3447e){return new BPromise(function(_0x39ed5b,_0x60afc2){return client[_0x241d('0xc')](_0x39aadd,_0x3447e)[_0x241d('0xd')](function(_0x282534){logger['info'](_0x241d('0xe'),_0x3c1d54,'request\x20sent');logger[_0x241d('0xf')](_0x241d('0x10'),_0x3c1d54,'request\x20sent',JSON[_0x241d('0x11')](_0x282534));if(_0x282534[_0x241d('0x12')]){if(_0x282534[_0x241d('0x12')][_0x241d('0x13')]===0x1f4){logger[_0x241d('0x12')](_0x241d('0xe'),_0x3c1d54,_0x282534[_0x241d('0x12')][_0x241d('0x14')]);return _0x60afc2(_0x282534[_0x241d('0x12')][_0x241d('0x14')]);}logger['error'](_0x241d('0xe'),_0x3c1d54,_0x282534[_0x241d('0x12')]['message']);return _0x39ed5b(_0x282534[_0x241d('0x12')][_0x241d('0x14')]);}else{logger[_0x241d('0x15')]('Cdr,\x20%s,\x20%s',_0x3c1d54,_0x241d('0x16'));_0x39ed5b(_0x282534['result'][_0x241d('0x14')]);}})['catch'](function(_0x4a0e59){logger['error']('Cdr,\x20%s,\x20%s',_0x3c1d54,_0x4a0e59);_0x60afc2(_0x4a0e59);});});} \ No newline at end of file +var _0xca00=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xca00,0x1e0));var _0x0ca0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0ca0('0x0'));var util=require(_0x0ca0('0x1'));var moment=require('moment');var BPromise=require(_0x0ca0('0x2'));var rs=require(_0x0ca0('0x3'));var fs=require('fs');var Redis=require(_0x0ca0('0x4'));var db=require(_0x0ca0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0ca0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ca0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x142368,_0x3d0492,_0x441fca){return new BPromise(function(_0x4e0785,_0x5e0abe){return client['request'](_0x142368,_0x441fca)[_0x0ca0('0x8')](function(_0x2a24d1){logger[_0x0ca0('0x9')](_0x0ca0('0xa'),_0x3d0492,'request\x20sent');logger[_0x0ca0('0xb')](_0x0ca0('0xc'),_0x3d0492,_0x0ca0('0xd'),JSON[_0x0ca0('0xe')](_0x2a24d1));if(_0x2a24d1[_0x0ca0('0xf')]){if(_0x2a24d1['error'][_0x0ca0('0x10')]===0x1f4){logger[_0x0ca0('0xf')](_0x0ca0('0xa'),_0x3d0492,_0x2a24d1[_0x0ca0('0xf')][_0x0ca0('0x11')]);return _0x5e0abe(_0x2a24d1[_0x0ca0('0xf')][_0x0ca0('0x11')]);}logger[_0x0ca0('0xf')]('Cdr,\x20%s,\x20%s',_0x3d0492,_0x2a24d1[_0x0ca0('0xf')]['message']);return _0x4e0785(_0x2a24d1[_0x0ca0('0xf')][_0x0ca0('0x11')]);}else{logger[_0x0ca0('0x9')](_0x0ca0('0xa'),_0x3d0492,_0x0ca0('0xd'));_0x4e0785(_0x2a24d1[_0x0ca0('0x12')][_0x0ca0('0x11')]);}})['catch'](function(_0x15446a){logger[_0x0ca0('0xf')]('Cdr,\x20%s,\x20%s',_0x3d0492,_0x15446a);_0x5e0abe(_0x15446a);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 938923c..b843e33 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(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2238d6,_0x397180){var _0x3fcc31=function(_0x2e0997){while(--_0x2e0997){_0x2238d6['push'](_0x2238d6['shift']());}};_0x3fcc31(++_0x397180);}(_0xb10b,0x12a));var _0xbb10=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xb10b[_0x4358f5];return _0x4d8104;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index c7e0f7e..3682bd0 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 _0x8750=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x16ca76,_0x258915){var _0xbfbbad=function(_0x5e1266){while(--_0x5e1266){_0x16ca76['push'](_0x16ca76['shift']());}};_0xbfbbad(++_0x258915);}(_0x8750,0x14c));var _0x0875=function(_0xa11dda,_0x4bbf0c){_0xa11dda=_0xa11dda-0x0;var _0x3a2138=_0x8750[_0xa11dda];return _0x3a2138;};'use strict';var Sequelize=require(_0x0875('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0875('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0875('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0875('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0875('0x2')],'defaultValue':_0x0875('0x4')}}; \ No newline at end of file +var _0x1cd5=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x1cd5,0x79));var _0x51cd=function(_0x402122,_0x5d6a41){_0x402122=_0x402122-0x0;var _0x1791df=_0x1cd5[_0x402122];return _0x1791df;};'use strict';var Sequelize=require(_0x51cd('0x0'));module[_0x51cd('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x51cd('0x2')],'allowNull':![],'defaultValue':_0x51cd('0x3')},'appdata':{'type':Sequelize[_0x51cd('0x4')]()},'description':{'type':Sequelize[_0x51cd('0x2')]},'interval':{'type':Sequelize[_0x51cd('0x2')],'defaultValue':_0x51cd('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index a815873..ec497d1 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 _0xce3a=['../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x476d90,_0x459710){var _0x56f307=function(_0x1082fb){while(--_0x1082fb){_0x476d90['push'](_0x476d90['shift']());}};_0x56f307(++_0x459710);}(_0xce3a,0x194));var _0xace3=function(_0x11e1b6,_0x28e796){_0x11e1b6=_0x11e1b6-0x0;var _0x275329=_0xce3a[_0x11e1b6];return _0x275329;};'use strict';var emlformat=require(_0xace3('0x0'));var rimraf=require(_0xace3('0x1'));var zipdir=require(_0xace3('0x2'));var jsonpatch=require(_0xace3('0x3'));var rp=require(_0xace3('0x4'));var moment=require(_0xace3('0x5'));var BPromise=require(_0xace3('0x6'));var Mustache=require(_0xace3('0x7'));var util=require(_0xace3('0x8'));var path=require(_0xace3('0x9'));var sox=require(_0xace3('0xa'));var csv=require(_0xace3('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xace3('0xc'));var _=require(_0xace3('0xd'));var squel=require(_0xace3('0xe'));var crypto=require(_0xace3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xace3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xace3('0x11'));var Papa=require(_0xace3('0x12'));var Redis=require(_0xace3('0x13'));var authService=require(_0xace3('0x14'));var qs=require(_0xace3('0x15'));var as=require(_0xace3('0x16'));var hardwareService=require(_0xace3('0x17'));var logger=require(_0xace3('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be1f1,_0x3566ad){_0x3566ad=_0x3566ad||0xcc;return function(_0x5ac505){if(_0x5ac505){return _0x4be1f1[_0xace3('0x1a')](_0x3566ad);}return _0x4be1f1['status'](_0x3566ad)[_0xace3('0x1b')]();};}function respondWithResult(_0x19dc11,_0x16ef3e){_0x16ef3e=_0x16ef3e||0xc8;return function(_0x5983b9){if(_0x5983b9){return _0x19dc11[_0xace3('0x1c')](_0x16ef3e)[_0xace3('0x1d')](_0x5983b9);}};}function respondWithFilteredResult(_0x1cfa39,_0x54ec35){return function(_0x51ed6c){if(_0x51ed6c){var _0x1ad5c0=typeof _0x54ec35[_0xace3('0x1e')]===_0xace3('0x1f')&&typeof _0x54ec35[_0xace3('0x20')]==='undefined';var _0x3debc2=_0x51ed6c[_0xace3('0x21')];var _0x39536d=_0x1ad5c0?0x0:_0x54ec35[_0xace3('0x1e')];var _0x2ef370=_0x1ad5c0?_0x51ed6c[_0xace3('0x21')]:_0x54ec35['offset']+_0x54ec35['limit'];var _0x2ee18d;if(_0x2ef370>=_0x3debc2){_0x2ef370=_0x3debc2;_0x2ee18d=0xc8;}else{_0x2ee18d=0xce;}_0x1cfa39['status'](_0x2ee18d);return _0x1cfa39[_0xace3('0x22')](_0xace3('0x23'),_0x39536d+'-'+_0x2ef370+'/'+_0x3debc2)['json'](_0x51ed6c);}return null;};}function patchUpdates(_0xab91f7){return function(_0x16f406){try{jsonpatch['apply'](_0x16f406,_0xab91f7,!![]);}catch(_0x4b90c9){return BPromise['reject'](_0x4b90c9);}return _0x16f406[_0xace3('0x24')]();};}function saveUpdates(_0x1ed5fe,_0x3bbe41){return function(_0x34a7a5){if(_0x34a7a5){return _0x34a7a5[_0xace3('0x25')](_0x1ed5fe)[_0xace3('0x26')](function(_0xa9b5ed){return _0xa9b5ed;});}return null;};}function removeEntity(_0x3c0a56,_0x5a4c02){return function(_0x5980fe){if(_0x5980fe){return _0x5980fe['destroy']()['then'](function(){_0x3c0a56[_0xace3('0x1c')](0xcc)[_0xace3('0x1b')]();});}};}function handleEntityNotFound(_0x2c137d,_0xf42f4){return function(_0x4b287c){if(!_0x4b287c){_0x2c137d[_0xace3('0x1a')](0x194);}return _0x4b287c;};}function handleError(_0x3b4cb5,_0x144f86){_0x144f86=_0x144f86||0x1f4;return function(_0x32e39d){logger[_0xace3('0x27')](_0x32e39d[_0xace3('0x28')]);if(_0x32e39d[_0xace3('0x29')]){delete _0x32e39d['name'];}_0x3b4cb5[_0xace3('0x1c')](_0x144f86)[_0xace3('0x2a')](_0x32e39d);};}exports[_0xace3('0x2b')]=function(_0x3aa28a,_0x599e73){var _0x56efae={'raw':!![],'where':{'id':_0x3aa28a[_0xace3('0x2c')]['id']}},_0x3b1ad1={};_0x3b1ad1[_0xace3('0x2d')]=_[_0xace3('0x2e')](db['ChatApplication'][_0xace3('0x2f')]);_0x3b1ad1[_0xace3('0x30')]=_[_0xace3('0x2e')](_0x3aa28a[_0xace3('0x30')]);_0x3b1ad1[_0xace3('0x31')]=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],_0x3b1ad1['query']);_0x56efae['attributes']=_[_0xace3('0x32')](_0x3b1ad1[_0xace3('0x2d')],qs[_0xace3('0x33')](_0x3aa28a[_0xace3('0x30')][_0xace3('0x33')]));_0x56efae[_0xace3('0x34')]=_0x56efae[_0xace3('0x34')][_0xace3('0x35')]?_0x56efae[_0xace3('0x34')]:_0x3b1ad1[_0xace3('0x2d')];if(_0x3aa28a[_0xace3('0x30')][_0xace3('0x36')]){_0x56efae[_0xace3('0x37')]=[{'all':!![]}];}_0x56efae=_[_0xace3('0x38')]({},_0x56efae,_0x3aa28a[_0xace3('0x39')]);return db[_0xace3('0x3a')]['find'](_0x56efae)[_0xace3('0x26')](handleEntityNotFound(_0x599e73,null))[_0xace3('0x26')](respondWithResult(_0x599e73,null))[_0xace3('0x3b')](handleError(_0x599e73,null));};exports[_0xace3('0x25')]=function(_0x39a447,_0xe0243b){if(_0x39a447[_0xace3('0x3c')]['id']){delete _0x39a447[_0xace3('0x3c')]['id'];}return db[_0xace3('0x3a')]['find']({'where':{'id':_0x39a447[_0xace3('0x2c')]['id']}})[_0xace3('0x26')](handleEntityNotFound(_0xe0243b,null))[_0xace3('0x26')](saveUpdates(_0x39a447[_0xace3('0x3c')],null))['then'](respondWithResult(_0xe0243b,null))['catch'](handleError(_0xe0243b,null));};exports['destroy']=function(_0x541d51,_0x181d79){return db[_0xace3('0x3a')]['find']({'where':{'id':_0x541d51[_0xace3('0x2c')]['id']}})['then'](handleEntityNotFound(_0x181d79,null))['then'](removeEntity(_0x181d79,null))[_0xace3('0x3b')](handleError(_0x181d79,null));}; \ No newline at end of file +var _0x9ffd=['fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','params','model','keys','ChatApplication','rawAttributes','filters','intersection','attributes','fields','length','query','includeAll','include','merge','options','find','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3f78b9,_0xf6f234){_0x3f78b9=_0x3f78b9-0x0;var _0x768e6c=_0x9ffd[_0x3f78b9];return _0x768e6c;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca906,_0x4d86fe){return function(_0x285002){if(!_0x285002){_0x3ca906['sendStatus'](0x194);}return _0x285002;};}function handleError(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0x1f4;return function(_0x2138b4){logger[_0xd9ff('0x26')](_0x2138b4['stack']);if(_0x2138b4[_0xd9ff('0x27')]){delete _0x2138b4[_0xd9ff('0x27')];}_0x10cbdd[_0xd9ff('0x1b')](_0x159e56)[_0xd9ff('0x28')](_0x2138b4);};}exports['show']=function(_0x1d3684,_0x3792d9){var _0x44b5a7={'raw':!![],'where':{'id':_0x1d3684[_0xd9ff('0x29')]['id']}},_0x45fb63={};_0x45fb63[_0xd9ff('0x2a')]=_[_0xd9ff('0x2b')](db[_0xd9ff('0x2c')][_0xd9ff('0x2d')]);_0x45fb63['query']=_[_0xd9ff('0x2b')](_0x1d3684['query']);_0x45fb63[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x45fb63[_0xd9ff('0x2a')],_0x45fb63['query']);_0x44b5a7[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x45fb63[_0xd9ff('0x2a')],qs[_0xd9ff('0x31')](_0x1d3684['query'][_0xd9ff('0x31')]));_0x44b5a7['attributes']=_0x44b5a7[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x44b5a7[_0xd9ff('0x30')]:_0x45fb63[_0xd9ff('0x2a')];if(_0x1d3684[_0xd9ff('0x33')][_0xd9ff('0x34')]){_0x44b5a7[_0xd9ff('0x35')]=[{'all':!![]}];}_0x44b5a7=_[_0xd9ff('0x36')]({},_0x44b5a7,_0x1d3684[_0xd9ff('0x37')]);return db[_0xd9ff('0x2c')][_0xd9ff('0x38')](_0x44b5a7)[_0xd9ff('0x25')](handleEntityNotFound(_0x3792d9,null))[_0xd9ff('0x25')](respondWithResult(_0x3792d9,null))[_0xd9ff('0x39')](handleError(_0x3792d9,null));};exports['update']=function(_0x13322f,_0x1ef7c3){if(_0x13322f[_0xd9ff('0x3a')]['id']){delete _0x13322f['body']['id'];}return db[_0xd9ff('0x2c')]['find']({'where':{'id':_0x13322f[_0xd9ff('0x29')]['id']}})['then'](handleEntityNotFound(_0x1ef7c3,null))[_0xd9ff('0x25')](saveUpdates(_0x13322f['body'],null))[_0xd9ff('0x25')](respondWithResult(_0x1ef7c3,null))[_0xd9ff('0x39')](handleError(_0x1ef7c3,null));};exports[_0xd9ff('0x3b')]=function(_0x5e2391,_0x4db3f6){return db['ChatApplication'][_0xd9ff('0x38')]({'where':{'id':_0x5e2391[_0xd9ff('0x29')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x4db3f6,null))[_0xd9ff('0x25')](removeEntity(_0x4db3f6,null))[_0xd9ff('0x39')](handleError(_0x4db3f6,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 88d3dc8..02d5131 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 _0x8e0d=['moment','request-promise','path','rimraf','../../config/environment','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x8517b6,_0x1e38eb){var _0x2b1844=function(_0x4460b0){while(--_0x4460b0){_0x8517b6['push'](_0x8517b6['shift']());}};_0x2b1844(++_0x1e38eb);}(_0x8e0d,0x82));var _0xd8e0=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x8e0d[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd8e0('0x1'));var moment=require(_0xd8e0('0x2'));var BPromise=require('bluebird');var rp=require(_0xd8e0('0x3'));var fs=require('fs');var path=require(_0xd8e0('0x4'));var rimraf=require(_0xd8e0('0x5'));var config=require(_0xd8e0('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x2e79ab,_0x33ff41){return _0x2e79ab[_0xd8e0('0x7')](_0xd8e0('0x8'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8e0('0x9'),'collate':_0xd8e0('0xa')});}; \ No newline at end of file +var _0xfe6a=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4'];(function(_0x380774,_0x2424bf){var _0x1e0bac=function(_0x46a6ec){while(--_0x46a6ec){_0x380774['push'](_0x380774['shift']());}};_0x1e0bac(++_0x2424bf);}(_0xfe6a,0x16c));var _0xafe6=function(_0x3fe8c1,_0x50a69a){_0x3fe8c1=_0x3fe8c1-0x0;var _0x25eced=_0xfe6a[_0x3fe8c1];return _0x25eced;};'use strict';var _=require(_0xafe6('0x0'));var util=require(_0xafe6('0x1'));var logger=require(_0xafe6('0x2'))('api');var moment=require(_0xafe6('0x3'));var BPromise=require(_0xafe6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xafe6('0x5'));var rimraf=require(_0xafe6('0x6'));var config=require(_0xafe6('0x7'));var attributes=require(_0xafe6('0x8'));module[_0xafe6('0x9')]=function(_0x14c224,_0x27d937){return _0x14c224[_0xafe6('0xa')](_0xafe6('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xafe6('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 64ae0a3..0ab8028 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 _0x33dd=['jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x33dd,0x1db));var _0xd33d=function(_0x354264,_0x58e09b){_0x354264=_0x354264-0x0;var _0x3a5e8e=_0x33dd[_0x354264];return _0x3a5e8e;};'use strict';var _=require('lodash');var util=require(_0xd33d('0x0'));var moment=require(_0xd33d('0x1'));var BPromise=require(_0xd33d('0x2'));var rs=require(_0xd33d('0x3'));var fs=require('fs');var Redis=require(_0xd33d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd33d('0x5'));var logger=require(_0xd33d('0x6'))('rpc');var config=require(_0xd33d('0x7'));var jayson=require(_0xd33d('0x8'));var client=jayson['client'][_0xd33d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247d16,_0x4632b7,_0x23ac7a){return new BPromise(function(_0x4f503d,_0x43dfe0){return client[_0xd33d('0xa')](_0x247d16,_0x23ac7a)[_0xd33d('0xb')](function(_0x202625){logger[_0xd33d('0xc')](_0xd33d('0xd'),_0x4632b7,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4632b7,_0xd33d('0xe'),JSON[_0xd33d('0xf')](_0x202625));if(_0x202625[_0xd33d('0x10')]){if(_0x202625[_0xd33d('0x10')][_0xd33d('0x11')]===0x1f4){logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x202625[_0xd33d('0x10')]['message']);return _0x43dfe0(_0x202625['error'][_0xd33d('0x12')]);}logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x202625[_0xd33d('0x10')][_0xd33d('0x12')]);return _0x4f503d(_0x202625[_0xd33d('0x10')]['message']);}else{logger['info'](_0xd33d('0xd'),_0x4632b7,_0xd33d('0xe'));_0x4f503d(_0x202625[_0xd33d('0x13')]['message']);}})[_0xd33d('0x14')](function(_0x5490dd){logger[_0xd33d('0x10')](_0xd33d('0xd'),_0x4632b7,_0x5490dd);_0x43dfe0(_0x5490dd);});});} \ No newline at end of file +var _0xdf30=['http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x35bdab,_0x28a695){var _0xbe96b0=function(_0x425977){while(--_0x425977){_0x35bdab['push'](_0x35bdab['shift']());}};_0xbe96b0(++_0x28a695);}(_0xdf30,0x65));var _0x0df3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf30[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0df3('0x0'));var util=require(_0x0df3('0x1'));var moment=require(_0x0df3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0df3('0x3'));var fs=require('fs');var Redis=require(_0x0df3('0x4'));var db=require(_0x0df3('0x5'))['db'];var utils=require(_0x0df3('0x6'));var logger=require(_0x0df3('0x7'))(_0x0df3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0df3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34c0b4,_0x196ebd,_0x140541){return new BPromise(function(_0x153175,_0x1a74fc){return client[_0x0df3('0xa')](_0x34c0b4,_0x140541)[_0x0df3('0xb')](function(_0x41e02b){logger[_0x0df3('0xc')](_0x0df3('0xd'),_0x196ebd,_0x0df3('0xe'));logger[_0x0df3('0xf')](_0x0df3('0x10'),_0x196ebd,_0x0df3('0xe'),JSON[_0x0df3('0x11')](_0x41e02b));if(_0x41e02b['error']){if(_0x41e02b['error']['code']===0x1f4){logger[_0x0df3('0x12')](_0x0df3('0xd'),_0x196ebd,_0x41e02b['error'][_0x0df3('0x13')]);return _0x1a74fc(_0x41e02b[_0x0df3('0x12')][_0x0df3('0x13')]);}logger[_0x0df3('0x12')](_0x0df3('0xd'),_0x196ebd,_0x41e02b[_0x0df3('0x12')][_0x0df3('0x13')]);return _0x153175(_0x41e02b[_0x0df3('0x12')][_0x0df3('0x13')]);}else{logger[_0x0df3('0xc')]('ChatApplication,\x20%s,\x20%s',_0x196ebd,_0x0df3('0xe'));_0x153175(_0x41e02b[_0x0df3('0x14')][_0x0df3('0x13')]);}})[_0x0df3('0x15')](function(_0x4405ab){logger[_0x0df3('0x12')](_0x0df3('0xd'),_0x196ebd,_0x4405ab);_0x1a74fc(_0x4405ab);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 27720d5..30b47f9 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 _0xe2c0=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x53bea5,_0xfbebf2){var _0x10e9bc=function(_0x565ef6){while(--_0x565ef6){_0x53bea5['push'](_0x53bea5['shift']());}};_0x10e9bc(++_0xfbebf2);}(_0xe2c0,0x126));var _0x0e2c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe2c0[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x0e2c('0x0'));var util=require(_0x0e2c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0e2c('0x2'));var router=express[_0x0e2c('0x3')]();var fs_extra=require(_0x0e2c('0x4'));var auth=require(_0x0e2c('0x5'));var interaction=require(_0x0e2c('0x6'));var config=require(_0x0e2c('0x7'));var controller=require(_0x0e2c('0x8'));router['get'](_0x0e2c('0x9'),auth[_0x0e2c('0xa')](),controller[_0x0e2c('0xb')]);router[_0x0e2c('0xc')](_0x0e2c('0x9'),auth['isAuthenticated'](),controller[_0x0e2c('0xd')]);router[_0x0e2c('0xe')]('/:id',auth[_0x0e2c('0xa')](),controller[_0x0e2c('0xf')]);module[_0x0e2c('0x10')]=router; \ No newline at end of file +var _0x5511=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','put','delete','multer'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5511,0x110));var _0x1551=function(_0x393ea8,_0x4ef9d4){_0x393ea8=_0x393ea8-0x0;var _0x1455af=_0x5511[_0x393ea8];return _0x1455af;};'use strict';var multer=require(_0x1551('0x0'));var util=require(_0x1551('0x1'));var path=require(_0x1551('0x2'));var timeout=require(_0x1551('0x3'));var express=require(_0x1551('0x4'));var router=express[_0x1551('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1551('0x6'));var interaction=require(_0x1551('0x7'));var config=require('../../config/environment');var controller=require(_0x1551('0x8'));router['get'](_0x1551('0x9'),auth[_0x1551('0xa')](),controller['show']);router[_0x1551('0xb')](_0x1551('0x9'),auth[_0x1551('0xa')](),controller['update']);router[_0x1551('0xc')](_0x1551('0x9'),auth[_0x1551('0xa')](),controller['destroy']);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 526073b..7e81ae0 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 _0x110e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2e3f2c,_0x1ff03d){var _0x214fa6=function(_0x1fefce){while(--_0x1fefce){_0x2e3f2c['push'](_0x2e3f2c['shift']());}};_0x214fa6(++_0x1ff03d);}(_0x110e,0x68));var _0xe110=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x110e[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xe110('0x0'));module[_0xe110('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe110('0x2')]},'write':{'type':Sequelize[_0xe110('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x032f=['sequelize','exports','STRING'];(function(_0x408f4b,_0x9acffc){var _0x1c574e=function(_0x34d9f6){while(--_0x34d9f6){_0x408f4b['push'](_0x408f4b['shift']());}};_0x1c574e(++_0x9acffc);}(_0x032f,0x7b));var _0xf032=function(_0x254635,_0x472b4c){_0x254635=_0x254635-0x0;var _0x35293c=_0x032f[_0x254635];return _0x35293c;};'use strict';var Sequelize=require(_0xf032('0x0'));module[_0xf032('0x1')]={'name':{'type':Sequelize[_0xf032('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf032('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 da110ef..c5130a3 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 _0xb450=['format','YYYY-MM-DD\x20HH:mm:ss','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','register','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ChatGroup','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','body','catch','params','ChatInternalMessage','toInteger','ids','getMembers','findOne','User','removeMembers','ChatGroupId','create','getMessages','$gte'];(function(_0x1108d7,_0x16c93c){var _0x1d7eca=function(_0x4925ce){while(--_0x4925ce){_0x1108d7['push'](_0x1108d7['shift']());}};_0x1d7eca(++_0x16c93c);}(_0xb450,0x172));var _0x0b45=function(_0x29e2fe,_0x6b9ce6){_0x29e2fe=_0x29e2fe-0x0;var _0x16f447=_0xb450[_0x29e2fe];return _0x16f447;};'use strict';var emlformat=require(_0x0b45('0x0'));var rimraf=require(_0x0b45('0x1'));var zipdir=require(_0x0b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b45('0x3'));var moment=require(_0x0b45('0x4'));var BPromise=require(_0x0b45('0x5'));var Mustache=require(_0x0b45('0x6'));var util=require(_0x0b45('0x7'));var path=require(_0x0b45('0x8'));var sox=require(_0x0b45('0x9'));var csv=require(_0x0b45('0xa'));var ejs=require(_0x0b45('0xb'));var fs=require('fs');var fs_extra=require(_0x0b45('0xc'));var _=require(_0x0b45('0xd'));var squel=require(_0x0b45('0xe'));var crypto=require(_0x0b45('0xf'));var jsforce=require(_0x0b45('0x10'));var deskjs=require(_0x0b45('0x11'));var toCsv=require(_0x0b45('0xa'));var querystring=require(_0x0b45('0x12'));var Papa=require('papaparse');var Redis=require(_0x0b45('0x13'));var authService=require(_0x0b45('0x14'));var qs=require(_0x0b45('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b45('0x16'));var logger=require('../../config/logger')(_0x0b45('0x17'));var utils=require('../../config/utils');var config=require(_0x0b45('0x18'));var licenseUtil=require(_0x0b45('0x19'));var db=require(_0x0b45('0x1a'))['db'];config[_0x0b45('0x1b')]=_['defaults'](config[_0x0b45('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b45('0x1b')]));require('./chatGroup.socket')[_0x0b45('0x1c')](socket);function respondWithStatusCode(_0x42a563,_0x111582){_0x111582=_0x111582||0xcc;return function(_0x415a6f){if(_0x415a6f){return _0x42a563[_0x0b45('0x1d')](_0x111582);}return _0x42a563['status'](_0x111582)[_0x0b45('0x1e')]();};}function respondWithResult(_0x270272,_0x122f10){_0x122f10=_0x122f10||0xc8;return function(_0x1ce2f7){if(_0x1ce2f7){return _0x270272['status'](_0x122f10)[_0x0b45('0x1f')](_0x1ce2f7);}};}function respondWithFilteredResult(_0x7226ab,_0x1337e5){return function(_0x16a57b){if(_0x16a57b){var _0x2d91ca=typeof _0x1337e5[_0x0b45('0x20')]==='undefined'&&typeof _0x1337e5[_0x0b45('0x21')]==='undefined';var _0x470101=_0x16a57b[_0x0b45('0x22')];var _0x4e9aea=_0x2d91ca?0x0:_0x1337e5[_0x0b45('0x20')];var _0x1c0782=_0x2d91ca?_0x16a57b['count']:_0x1337e5[_0x0b45('0x20')]+_0x1337e5[_0x0b45('0x21')];var _0x251f59;if(_0x1c0782>=_0x470101){_0x1c0782=_0x470101;_0x251f59=0xc8;}else{_0x251f59=0xce;}_0x7226ab[_0x0b45('0x23')](_0x251f59);return _0x7226ab[_0x0b45('0x24')](_0x0b45('0x25'),_0x4e9aea+'-'+_0x1c0782+'/'+_0x470101)[_0x0b45('0x1f')](_0x16a57b);}return null;};}function patchUpdates(_0x493299){return function(_0x29df47){try{jsonpatch[_0x0b45('0x26')](_0x29df47,_0x493299,!![]);}catch(_0x450aec){return BPromise[_0x0b45('0x27')](_0x450aec);}return _0x29df47[_0x0b45('0x28')]();};}function saveUpdates(_0x3bfaf3,_0x5722bf){return function(_0x1c228c){if(_0x1c228c){return _0x1c228c['update'](_0x3bfaf3)[_0x0b45('0x29')](function(_0x38fe15){return _0x38fe15;});}return null;};}function removeEntity(_0x1ef1bd,_0x83206e){return function(_0x10b421){if(_0x10b421){return _0x10b421[_0x0b45('0x2a')]()['then'](function(){_0x1ef1bd['status'](0xcc)[_0x0b45('0x1e')]();});}};}function handleEntityNotFound(_0x919961,_0x43bbfb){return function(_0x1b55f8){if(!_0x1b55f8){_0x919961['sendStatus'](0x194);}return _0x1b55f8;};}function handleError(_0x49f04b,_0x39d81c){_0x39d81c=_0x39d81c||0x1f4;return function(_0x4ba84e){logger[_0x0b45('0x2b')](_0x4ba84e['stack']);if(_0x4ba84e[_0x0b45('0x2c')]){delete _0x4ba84e[_0x0b45('0x2c')];}_0x49f04b[_0x0b45('0x23')](_0x39d81c)[_0x0b45('0x2d')](_0x4ba84e);};}exports[_0x0b45('0x2e')]=function(_0x5abf1b,_0x5c6bc8){var _0x2ede53={},_0x44e25d={},_0x4c536a={'count':0x0,'rows':[]};var _0x5aa47e=_[_0x0b45('0x2f')](db[_0x0b45('0x30')]['rawAttributes'],function(_0x448a5f){return{'name':_0x448a5f[_0x0b45('0x31')],'type':_0x448a5f[_0x0b45('0x32')][_0x0b45('0x33')]};});_0x44e25d['model']=_[_0x0b45('0x2f')](_0x5aa47e,'name');_0x44e25d[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x5abf1b[_0x0b45('0x34')]);_0x44e25d['filters']=_[_0x0b45('0x36')](_0x44e25d['model'],_0x44e25d[_0x0b45('0x34')]);_0x2ede53[_0x0b45('0x37')]=_[_0x0b45('0x36')](_0x44e25d[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x39')]));_0x2ede53[_0x0b45('0x37')]=_0x2ede53['attributes'][_0x0b45('0x3a')]?_0x2ede53['attributes']:_0x44e25d[_0x0b45('0x38')];if(!_0x5abf1b['query'][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x2ede53['limit']=qs[_0x0b45('0x21')](_0x5abf1b[_0x0b45('0x34')]['limit']);_0x2ede53['offset']=qs[_0x0b45('0x20')](_0x5abf1b[_0x0b45('0x34')]['offset']);}_0x2ede53[_0x0b45('0x3d')]=qs[_0x0b45('0x3e')](_0x5abf1b[_0x0b45('0x34')]['sort']);_0x2ede53[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x5abf1b[_0x0b45('0x34')],_0x44e25d[_0x0b45('0x40')]),_0x5aa47e);if(_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x42')]){_0x2ede53[_0x0b45('0x3f')]=_[_0x0b45('0x43')](_0x2ede53['where'],{'$or':_[_0x0b45('0x2f')](_0x5aa47e,function(_0x181b26){if(_0x181b26[_0x0b45('0x32')]!==_0x0b45('0x44')){var _0x50f278={};_0x50f278[_0x181b26[_0x0b45('0x2c')]]={'$like':'%'+_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x50f278;}})});}_0x2ede53=_[_0x0b45('0x43')]({},_0x2ede53,_0x5abf1b[_0x0b45('0x45')]);var _0x427984={'where':_0x2ede53[_0x0b45('0x3f')]};return db[_0x0b45('0x30')]['count'](_0x427984)[_0x0b45('0x29')](function(_0x1c2ab8){_0x4c536a[_0x0b45('0x22')]=_0x1c2ab8;if(_0x5abf1b[_0x0b45('0x34')][_0x0b45('0x46')]){_0x2ede53[_0x0b45('0x47')]=[{'all':!![]}];}return db[_0x0b45('0x30')][_0x0b45('0x48')](_0x2ede53);})[_0x0b45('0x29')](function(_0x1135f0){_0x4c536a[_0x0b45('0x49')]=_0x1135f0;return _0x4c536a;})['then'](respondWithFilteredResult(_0x5c6bc8,_0x2ede53))['catch'](handleError(_0x5c6bc8,null));};exports['show']=function(_0x52eace,_0x547454){var _0x4554f4={'raw':!![],'where':{'id':_0x52eace['params']['id']}},_0x2fa93f={};_0x2fa93f[_0x0b45('0x38')]=_[_0x0b45('0x35')](db[_0x0b45('0x30')][_0x0b45('0x4a')]);_0x2fa93f[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x52eace[_0x0b45('0x34')]);_0x2fa93f[_0x0b45('0x40')]=_[_0x0b45('0x36')](_0x2fa93f['model'],_0x2fa93f['query']);_0x4554f4['attributes']=_['intersection'](_0x2fa93f[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x52eace[_0x0b45('0x34')][_0x0b45('0x39')]));_0x4554f4[_0x0b45('0x37')]=_0x4554f4[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x4554f4['attributes']:_0x2fa93f[_0x0b45('0x38')];if(_0x52eace[_0x0b45('0x34')]['includeAll']){_0x4554f4[_0x0b45('0x47')]=[{'all':!![]}];}_0x4554f4=_[_0x0b45('0x43')]({},_0x4554f4,_0x52eace[_0x0b45('0x45')]);return db[_0x0b45('0x30')][_0x0b45('0x4b')](_0x4554f4)[_0x0b45('0x29')](handleEntityNotFound(_0x547454,null))['then'](respondWithResult(_0x547454,null))['catch'](handleError(_0x547454,null));};exports['create']=function(_0x3fb57b,_0x5a5419){return db[_0x0b45('0x30')]['create'](_0x3fb57b[_0x0b45('0x4c')],{})[_0x0b45('0x29')](respondWithResult(_0x5a5419,0xc9))[_0x0b45('0x4d')](handleError(_0x5a5419,null));};exports['update']=function(_0x52c1c1,_0x4f41cd){if(_0x52c1c1[_0x0b45('0x4c')]['id']){delete _0x52c1c1[_0x0b45('0x4c')]['id'];}return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x52c1c1[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x4f41cd,null))[_0x0b45('0x29')](saveUpdates(_0x52c1c1[_0x0b45('0x4c')],null))[_0x0b45('0x29')](respondWithResult(_0x4f41cd,null))[_0x0b45('0x4d')](handleError(_0x4f41cd,null));};exports[_0x0b45('0x2a')]=function(_0x885922,_0x2344e3){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x885922[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x2344e3,null))[_0x0b45('0x29')](removeEntity(_0x2344e3,null))[_0x0b45('0x4d')](handleError(_0x2344e3,null));};exports['describe']=function(_0x142e68,_0x1c6b98){return db[_0x0b45('0x30')]['describe']()['then'](respondWithResult(_0x1c6b98,null))[_0x0b45('0x4d')](handleError(_0x1c6b98,null));};exports['getUnread']=function(_0x38cbeb,_0x4257c1,_0xc823d9){return db[_0x0b45('0x4f')][_0x0b45('0x22')]({'where':{'ChatGroupId':_0x38cbeb[_0x0b45('0x4e')]['id'],'ToId':_0x38cbeb['user']['id'],'read':![]}})[_0x0b45('0x29')](function(_0x4aaceb){return{'id':_[_0x0b45('0x50')](_0x38cbeb[_0x0b45('0x4e')]['id']),'count':_0x4aaceb};})['then'](respondWithResult(_0x4257c1,null))['catch'](handleError(_0x4257c1,null));};exports['addMembers']=function(_0x1c1f8f,_0x4bc576,_0x295fb8){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x1c1f8f[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x4bc576,null))['then'](function(_0x5cd897){if(_0x5cd897){return _0x5cd897['addMembers'](_0x1c1f8f[_0x0b45('0x4c')][_0x0b45('0x51')],_['omit'](_0x1c1f8f[_0x0b45('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0x4bc576,null))[_0x0b45('0x4d')](handleError(_0x4bc576,null));};exports[_0x0b45('0x52')]=function(_0x3d163a,_0x217f27,_0x52ca65){var _0x2af765={};var _0x415669={};var _0xcbced4;var _0x1da544;return db[_0x0b45('0x30')][_0x0b45('0x53')]({'where':{'id':_0x3d163a['params']['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0x217f27,null))[_0x0b45('0x29')](function(_0x340504){if(_0x340504){_0xcbced4=_0x340504;_0x415669['model']=_[_0x0b45('0x35')](db[_0x0b45('0x54')][_0x0b45('0x4a')]);_0x415669[_0x0b45('0x34')]=_[_0x0b45('0x35')](_0x3d163a[_0x0b45('0x34')]);_0x415669[_0x0b45('0x40')]=_['intersection'](_0x415669[_0x0b45('0x38')],_0x415669[_0x0b45('0x34')]);_0x2af765[_0x0b45('0x37')]=_[_0x0b45('0x36')](_0x415669[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x3d163a[_0x0b45('0x34')][_0x0b45('0x39')]));_0x2af765[_0x0b45('0x37')]=_0x2af765[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x2af765[_0x0b45('0x37')]:_0x415669[_0x0b45('0x38')];_0x2af765['order']=qs[_0x0b45('0x3e')](_0x3d163a[_0x0b45('0x34')][_0x0b45('0x3e')]);_0x2af765[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x3d163a['query'],_0x415669['filters']));if(_0x3d163a['query']['filter']){_0x2af765[_0x0b45('0x3f')]=_['merge'](_0x2af765[_0x0b45('0x3f')],{'$or':_[_0x0b45('0x2f')](_0x2af765[_0x0b45('0x37')],function(_0x19c736){var _0x249cdf={};_0x249cdf[_0x19c736]={'$like':'%'+_0x3d163a[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x249cdf;})});}_0x2af765=_['merge']({},_0x2af765,_0x3d163a['options']);return _0xcbced4['getMembers'](_0x2af765);}})[_0x0b45('0x29')](function(_0x48e435){if(_0x48e435){_0x1da544=_0x48e435['length'];if(!_0x3d163a['query'][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x2af765[_0x0b45('0x21')]=qs[_0x0b45('0x21')](_0x3d163a['query'][_0x0b45('0x21')]);_0x2af765[_0x0b45('0x20')]=qs[_0x0b45('0x20')](_0x3d163a[_0x0b45('0x34')]['offset']);}return _0xcbced4[_0x0b45('0x52')](_0x2af765);}})[_0x0b45('0x29')](function(_0x3d9263){if(_0x3d9263){return _0x3d9263?{'count':_0x1da544,'rows':_0x3d9263}:null;}})[_0x0b45('0x29')](respondWithResult(_0x217f27,null))[_0x0b45('0x4d')](handleError(_0x217f27,null));};exports[_0x0b45('0x55')]=function(_0x3d2906,_0x64b159,_0x5d801a){return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x3d2906[_0x0b45('0x4e')]['id']}})['then'](handleEntityNotFound(_0x64b159,null))[_0x0b45('0x29')](function(_0x9a97b8){if(_0x9a97b8){return _0x9a97b8[_0x0b45('0x55')](_0x3d2906[_0x0b45('0x34')][_0x0b45('0x51')]);}})[_0x0b45('0x29')](respondWithStatusCode(_0x64b159,null))[_0x0b45('0x4d')](handleError(_0x64b159,null));};exports['addMessage']=function(_0x4656b1,_0xf0357a,_0x4a3945){if(_0x4656b1[_0x0b45('0x4c')]['id']){delete _0x4656b1[_0x0b45('0x4c')]['id'];}return db[_0x0b45('0x30')][_0x0b45('0x4b')]({'where':{'id':_0x4656b1[_0x0b45('0x4e')]['id']}})[_0x0b45('0x29')](handleEntityNotFound(_0xf0357a,null))['then'](function(_0x8966b6){if(_0x8966b6){_0x4656b1['body'][_0x0b45('0x56')]=_0x8966b6['id'];return db[_0x0b45('0x4f')][_0x0b45('0x57')](_0x4656b1[_0x0b45('0x4c')]);}})[_0x0b45('0x29')](respondWithResult(_0xf0357a,null))[_0x0b45('0x4d')](handleError(_0xf0357a,null));};exports[_0x0b45('0x58')]=function(_0x4cc2ba,_0x198379,_0x5a6c07){var _0x54fc96={};var _0x1024b4={};var _0x8e4512;var _0x4d4b30;return db[_0x0b45('0x30')]['findOne']({'where':{'id':_0x4cc2ba[_0x0b45('0x4e')]['id']}})['then'](handleEntityNotFound(_0x198379,null))[_0x0b45('0x29')](function(_0x4f4612){if(_0x4f4612){_0x8e4512=_0x4f4612;_0x1024b4[_0x0b45('0x38')]=_[_0x0b45('0x35')](db[_0x0b45('0x4f')][_0x0b45('0x4a')]);_0x1024b4['query']=_[_0x0b45('0x35')](_0x4cc2ba[_0x0b45('0x34')]);_0x1024b4[_0x0b45('0x40')]=_['intersection'](_0x1024b4[_0x0b45('0x38')],_0x1024b4[_0x0b45('0x34')]);_0x54fc96['attributes']=_[_0x0b45('0x36')](_0x1024b4[_0x0b45('0x38')],qs[_0x0b45('0x39')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x39')]));_0x54fc96['attributes']=_0x54fc96[_0x0b45('0x37')][_0x0b45('0x3a')]?_0x54fc96[_0x0b45('0x37')]:_0x1024b4[_0x0b45('0x38')];_0x54fc96[_0x0b45('0x3d')]=qs[_0x0b45('0x3e')](_0x4cc2ba[_0x0b45('0x34')]['sort']);_0x54fc96[_0x0b45('0x3f')]=qs[_0x0b45('0x40')](_[_0x0b45('0x41')](_0x4cc2ba[_0x0b45('0x34')],_0x1024b4[_0x0b45('0x40')]));if(_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x42')]){_0x54fc96[_0x0b45('0x3f')]=_['merge'](_0x54fc96[_0x0b45('0x3f')],{'$or':_['map'](_0x54fc96[_0x0b45('0x37')],function(_0x538471){var _0x13b954={};_0x13b954[_0x538471]={'$like':'%'+_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x42')]+'%'};return _0x13b954;})});}if(_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x59')]){var _0x596bf3=_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x59')]['split'](',');var _0x492be4={};_0x492be4[_0x596bf3[0x0]]={'$gte':moment(_0x596bf3[0x1])[_0x0b45('0x5a')](_0x0b45('0x5b'))};_0x54fc96[_0x0b45('0x3f')]=_[_0x0b45('0x43')](_0x54fc96[_0x0b45('0x3f')],_0x492be4);}_0x54fc96=_[_0x0b45('0x43')]({},_0x54fc96,_0x4cc2ba[_0x0b45('0x45')]);return _0x8e4512['getMessages'](_0x54fc96);}})[_0x0b45('0x29')](function(_0xb1c411){if(_0xb1c411){_0x4d4b30=_0xb1c411['length'];if(!_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x3b')](_0x0b45('0x3c'))){_0x54fc96[_0x0b45('0x21')]=qs[_0x0b45('0x21')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x21')]);_0x54fc96[_0x0b45('0x20')]=qs[_0x0b45('0x20')](_0x4cc2ba[_0x0b45('0x34')][_0x0b45('0x20')]);}return _0x8e4512[_0x0b45('0x58')](_0x54fc96);}})['then'](function(_0x710b0c){if(_0x710b0c){return _0x710b0c?{'count':_0x4d4b30,'rows':_0x710b0c}:null;}})[_0x0b45('0x29')](respondWithResult(_0x198379,null))['catch'](handleError(_0x198379,null));}; \ No newline at end of file +var _0x07c4=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','merge','where','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','describe','user','toInteger','addMembers','ids','omit','getMembers','keys','User','pick','addMessage','ChatInternalMessage','getMessages','findOne','$gte','format','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x07c4,0x1bf));var _0x407c=function(_0x3eca29,_0x54951b){_0x3eca29=_0x3eca29-0x0;var _0x44a019=_0x07c4[_0x3eca29];return _0x44a019;};'use strict';var emlformat=require(_0x407c('0x0'));var rimraf=require(_0x407c('0x1'));var zipdir=require(_0x407c('0x2'));var jsonpatch=require(_0x407c('0x3'));var rp=require(_0x407c('0x4'));var moment=require(_0x407c('0x5'));var BPromise=require(_0x407c('0x6'));var Mustache=require(_0x407c('0x7'));var util=require(_0x407c('0x8'));var path=require('path');var sox=require(_0x407c('0x9'));var csv=require(_0x407c('0xa'));var ejs=require(_0x407c('0xb'));var fs=require('fs');var fs_extra=require(_0x407c('0xc'));var _=require(_0x407c('0xd'));var squel=require(_0x407c('0xe'));var crypto=require(_0x407c('0xf'));var jsforce=require(_0x407c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x407c('0xa'));var querystring=require(_0x407c('0x11'));var Papa=require(_0x407c('0x12'));var Redis=require(_0x407c('0x13'));var authService=require(_0x407c('0x14'));var qs=require(_0x407c('0x15'));var as=require(_0x407c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x407c('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x407c('0x18')]=_[_0x407c('0x19')](config[_0x407c('0x18')],{'host':_0x407c('0x1a'),'port':0x18eb});var socket=require(_0x407c('0x1b'))(new Redis(config[_0x407c('0x18')]));require(_0x407c('0x1c'))['register'](socket);function respondWithStatusCode(_0x973426,_0x402144){_0x402144=_0x402144||0xcc;return function(_0x2296fe){if(_0x2296fe){return _0x973426[_0x407c('0x1d')](_0x402144);}return _0x973426[_0x407c('0x1e')](_0x402144)[_0x407c('0x1f')]();};}function respondWithResult(_0x29056b,_0x2322d7){_0x2322d7=_0x2322d7||0xc8;return function(_0x1986c8){if(_0x1986c8){return _0x29056b['status'](_0x2322d7)['json'](_0x1986c8);}};}function respondWithFilteredResult(_0x2a0094,_0x249565){return function(_0x43dce6){if(_0x43dce6){var _0x231a43=typeof _0x249565[_0x407c('0x20')]==='undefined'&&typeof _0x249565['limit']===_0x407c('0x21');var _0x702204=_0x43dce6[_0x407c('0x22')];var _0x5ab2ca=_0x231a43?0x0:_0x249565[_0x407c('0x20')];var _0x37997c=_0x231a43?_0x43dce6[_0x407c('0x22')]:_0x249565[_0x407c('0x20')]+_0x249565[_0x407c('0x23')];var _0xb88f6;if(_0x37997c>=_0x702204){_0x37997c=_0x702204;_0xb88f6=0xc8;}else{_0xb88f6=0xce;}_0x2a0094[_0x407c('0x1e')](_0xb88f6);return _0x2a0094['set'](_0x407c('0x24'),_0x5ab2ca+'-'+_0x37997c+'/'+_0x702204)['json'](_0x43dce6);}return null;};}function patchUpdates(_0x5c2813){return function(_0x35b9de){try{jsonpatch[_0x407c('0x25')](_0x35b9de,_0x5c2813,!![]);}catch(_0x10bd3f){return BPromise[_0x407c('0x26')](_0x10bd3f);}return _0x35b9de[_0x407c('0x27')]();};}function saveUpdates(_0x1ced44,_0x408323){return function(_0x59db4c){if(_0x59db4c){return _0x59db4c[_0x407c('0x28')](_0x1ced44)['then'](function(_0x43079e){return _0x43079e;});}return null;};}function removeEntity(_0x1b1015,_0x1fd53f){return function(_0x4f2f44){if(_0x4f2f44){return _0x4f2f44['destroy']()[_0x407c('0x29')](function(){_0x1b1015[_0x407c('0x1e')](0xcc)[_0x407c('0x1f')]();});}};}function handleEntityNotFound(_0x127df1,_0x5bce43){return function(_0x3d88c1){if(!_0x3d88c1){_0x127df1[_0x407c('0x1d')](0x194);}return _0x3d88c1;};}function handleError(_0x2ca55c,_0xfc5a7e){_0xfc5a7e=_0xfc5a7e||0x1f4;return function(_0x230590){logger[_0x407c('0x2a')](_0x230590['stack']);if(_0x230590[_0x407c('0x2b')]){delete _0x230590[_0x407c('0x2b')];}_0x2ca55c[_0x407c('0x1e')](_0xfc5a7e)[_0x407c('0x2c')](_0x230590);};}exports[_0x407c('0x2d')]=function(_0x533ec0,_0x3cb16a){var _0x133d01={},_0x43977d={},_0x163fae={'count':0x0,'rows':[]};var _0x117f77=_[_0x407c('0x2e')](db[_0x407c('0x2f')][_0x407c('0x30')],function(_0x5590ce){return{'name':_0x5590ce['fieldName'],'type':_0x5590ce[_0x407c('0x31')][_0x407c('0x32')]};});_0x43977d[_0x407c('0x33')]=_[_0x407c('0x2e')](_0x117f77,_0x407c('0x2b'));_0x43977d[_0x407c('0x34')]=_['keys'](_0x533ec0[_0x407c('0x34')]);_0x43977d[_0x407c('0x35')]=_[_0x407c('0x36')](_0x43977d[_0x407c('0x33')],_0x43977d[_0x407c('0x34')]);_0x133d01[_0x407c('0x37')]=_[_0x407c('0x36')](_0x43977d['model'],qs[_0x407c('0x38')](_0x533ec0['query'][_0x407c('0x38')]));_0x133d01[_0x407c('0x37')]=_0x133d01[_0x407c('0x37')][_0x407c('0x39')]?_0x133d01[_0x407c('0x37')]:_0x43977d[_0x407c('0x33')];if(!_0x533ec0['query']['hasOwnProperty'](_0x407c('0x3a'))){_0x133d01[_0x407c('0x23')]=qs[_0x407c('0x23')](_0x533ec0[_0x407c('0x34')]['limit']);_0x133d01[_0x407c('0x20')]=qs['offset'](_0x533ec0[_0x407c('0x34')][_0x407c('0x20')]);}_0x133d01[_0x407c('0x3b')]=qs[_0x407c('0x3c')](_0x533ec0[_0x407c('0x34')][_0x407c('0x3c')]);_0x133d01['where']=qs[_0x407c('0x35')](_['pick'](_0x533ec0[_0x407c('0x34')],_0x43977d[_0x407c('0x35')]),_0x117f77);if(_0x533ec0['query'][_0x407c('0x3d')]){_0x133d01['where']=_[_0x407c('0x3e')](_0x133d01[_0x407c('0x3f')],{'$or':_[_0x407c('0x2e')](_0x117f77,function(_0x501553){if(_0x501553[_0x407c('0x31')]!==_0x407c('0x40')){var _0x41eac4={};_0x41eac4[_0x501553['name']]={'$like':'%'+_0x533ec0[_0x407c('0x34')][_0x407c('0x3d')]+'%'};return _0x41eac4;}})});}_0x133d01=_[_0x407c('0x3e')]({},_0x133d01,_0x533ec0['options']);var _0x3ce804={'where':_0x133d01[_0x407c('0x3f')]};return db['ChatGroup']['count'](_0x3ce804)['then'](function(_0xa92283){_0x163fae[_0x407c('0x22')]=_0xa92283;if(_0x533ec0[_0x407c('0x34')]['includeAll']){_0x133d01[_0x407c('0x41')]=[{'all':!![]}];}return db[_0x407c('0x2f')][_0x407c('0x42')](_0x133d01);})[_0x407c('0x29')](function(_0x1798e2){_0x163fae[_0x407c('0x43')]=_0x1798e2;return _0x163fae;})[_0x407c('0x29')](respondWithFilteredResult(_0x3cb16a,_0x133d01))[_0x407c('0x44')](handleError(_0x3cb16a,null));};exports[_0x407c('0x45')]=function(_0x88fedd,_0x3a81fb){var _0x33bd85={'raw':!![],'where':{'id':_0x88fedd['params']['id']}},_0x29714c={};_0x29714c[_0x407c('0x33')]=_['keys'](db['ChatGroup'][_0x407c('0x30')]);_0x29714c['query']=_['keys'](_0x88fedd[_0x407c('0x34')]);_0x29714c[_0x407c('0x35')]=_[_0x407c('0x36')](_0x29714c[_0x407c('0x33')],_0x29714c['query']);_0x33bd85[_0x407c('0x37')]=_[_0x407c('0x36')](_0x29714c[_0x407c('0x33')],qs[_0x407c('0x38')](_0x88fedd[_0x407c('0x34')][_0x407c('0x38')]));_0x33bd85[_0x407c('0x37')]=_0x33bd85[_0x407c('0x37')][_0x407c('0x39')]?_0x33bd85[_0x407c('0x37')]:_0x29714c['model'];if(_0x88fedd['query'][_0x407c('0x46')]){_0x33bd85[_0x407c('0x41')]=[{'all':!![]}];}_0x33bd85=_['merge']({},_0x33bd85,_0x88fedd[_0x407c('0x47')]);return db[_0x407c('0x2f')][_0x407c('0x48')](_0x33bd85)[_0x407c('0x29')](handleEntityNotFound(_0x3a81fb,null))[_0x407c('0x29')](respondWithResult(_0x3a81fb,null))[_0x407c('0x44')](handleError(_0x3a81fb,null));};exports[_0x407c('0x49')]=function(_0x264a6e,_0x464264){return db[_0x407c('0x2f')][_0x407c('0x49')](_0x264a6e[_0x407c('0x4a')],{})['then'](respondWithResult(_0x464264,0xc9))[_0x407c('0x44')](handleError(_0x464264,null));};exports['update']=function(_0x316d12,_0x3bfe4e){if(_0x316d12[_0x407c('0x4a')]['id']){delete _0x316d12['body']['id'];}return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x316d12[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x3bfe4e,null))['then'](saveUpdates(_0x316d12[_0x407c('0x4a')],null))[_0x407c('0x29')](respondWithResult(_0x3bfe4e,null))[_0x407c('0x44')](handleError(_0x3bfe4e,null));};exports['destroy']=function(_0x1a010c,_0x14a2c2){return db['ChatGroup'][_0x407c('0x48')]({'where':{'id':_0x1a010c[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x14a2c2,null))[_0x407c('0x29')](removeEntity(_0x14a2c2,null))[_0x407c('0x44')](handleError(_0x14a2c2,null));};exports[_0x407c('0x4c')]=function(_0x3aaf16,_0x562b3a){return db[_0x407c('0x2f')][_0x407c('0x4c')]()[_0x407c('0x29')](respondWithResult(_0x562b3a,null))['catch'](handleError(_0x562b3a,null));};exports['getUnread']=function(_0x50a565,_0x188511,_0x1a4637){return db['ChatInternalMessage'][_0x407c('0x22')]({'where':{'ChatGroupId':_0x50a565[_0x407c('0x4b')]['id'],'ToId':_0x50a565[_0x407c('0x4d')]['id'],'read':![]}})['then'](function(_0x6205e0){return{'id':_[_0x407c('0x4e')](_0x50a565[_0x407c('0x4b')]['id']),'count':_0x6205e0};})[_0x407c('0x29')](respondWithResult(_0x188511,null))['catch'](handleError(_0x188511,null));};exports['addMembers']=function(_0x3e8dfc,_0x51c43d,_0x218ef6){return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x3e8dfc[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x51c43d,null))['then'](function(_0x2cd109){if(_0x2cd109){return _0x2cd109[_0x407c('0x4f')](_0x3e8dfc[_0x407c('0x4a')][_0x407c('0x50')],_[_0x407c('0x51')](_0x3e8dfc['body'],[_0x407c('0x50'),'id'])||{});}})[_0x407c('0x29')](respondWithResult(_0x51c43d,null))[_0x407c('0x44')](handleError(_0x51c43d,null));};exports[_0x407c('0x52')]=function(_0x35df04,_0x13933d,_0x3737ad){var _0x2a4512={};var _0x31bf64={};var _0x4fa90c;var _0x2498da;return db[_0x407c('0x2f')]['findOne']({'where':{'id':_0x35df04[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x13933d,null))['then'](function(_0xd2dc48){if(_0xd2dc48){_0x4fa90c=_0xd2dc48;_0x31bf64[_0x407c('0x33')]=_[_0x407c('0x53')](db[_0x407c('0x54')][_0x407c('0x30')]);_0x31bf64['query']=_[_0x407c('0x53')](_0x35df04[_0x407c('0x34')]);_0x31bf64[_0x407c('0x35')]=_[_0x407c('0x36')](_0x31bf64[_0x407c('0x33')],_0x31bf64[_0x407c('0x34')]);_0x2a4512[_0x407c('0x37')]=_[_0x407c('0x36')](_0x31bf64[_0x407c('0x33')],qs[_0x407c('0x38')](_0x35df04[_0x407c('0x34')][_0x407c('0x38')]));_0x2a4512[_0x407c('0x37')]=_0x2a4512['attributes'][_0x407c('0x39')]?_0x2a4512['attributes']:_0x31bf64[_0x407c('0x33')];_0x2a4512[_0x407c('0x3b')]=qs['sort'](_0x35df04['query'][_0x407c('0x3c')]);_0x2a4512[_0x407c('0x3f')]=qs[_0x407c('0x35')](_[_0x407c('0x55')](_0x35df04[_0x407c('0x34')],_0x31bf64[_0x407c('0x35')]));if(_0x35df04[_0x407c('0x34')][_0x407c('0x3d')]){_0x2a4512['where']=_['merge'](_0x2a4512[_0x407c('0x3f')],{'$or':_['map'](_0x2a4512[_0x407c('0x37')],function(_0x46fc80){var _0xf161c2={};_0xf161c2[_0x46fc80]={'$like':'%'+_0x35df04['query'][_0x407c('0x3d')]+'%'};return _0xf161c2;})});}_0x2a4512=_['merge']({},_0x2a4512,_0x35df04[_0x407c('0x47')]);return _0x4fa90c[_0x407c('0x52')](_0x2a4512);}})[_0x407c('0x29')](function(_0x353d80){if(_0x353d80){_0x2498da=_0x353d80['length'];if(!_0x35df04[_0x407c('0x34')]['hasOwnProperty']('nolimit')){_0x2a4512[_0x407c('0x23')]=qs[_0x407c('0x23')](_0x35df04['query'][_0x407c('0x23')]);_0x2a4512[_0x407c('0x20')]=qs['offset'](_0x35df04['query']['offset']);}return _0x4fa90c['getMembers'](_0x2a4512);}})[_0x407c('0x29')](function(_0x250305){if(_0x250305){return _0x250305?{'count':_0x2498da,'rows':_0x250305}:null;}})['then'](respondWithResult(_0x13933d,null))[_0x407c('0x44')](handleError(_0x13933d,null));};exports['removeMembers']=function(_0x3d9d96,_0x5812bc,_0x5e7b22){return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x3d9d96['params']['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x5812bc,null))[_0x407c('0x29')](function(_0xb93433){if(_0xb93433){return _0xb93433['removeMembers'](_0x3d9d96[_0x407c('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x5812bc,null))[_0x407c('0x44')](handleError(_0x5812bc,null));};exports[_0x407c('0x56')]=function(_0x1b4bfb,_0x2b103e,_0x3c6fdb){if(_0x1b4bfb[_0x407c('0x4a')]['id']){delete _0x1b4bfb[_0x407c('0x4a')]['id'];}return db[_0x407c('0x2f')][_0x407c('0x48')]({'where':{'id':_0x1b4bfb[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x2b103e,null))['then'](function(_0x2a911a){if(_0x2a911a){_0x1b4bfb['body']['ChatGroupId']=_0x2a911a['id'];return db[_0x407c('0x57')][_0x407c('0x49')](_0x1b4bfb['body']);}})[_0x407c('0x29')](respondWithResult(_0x2b103e,null))[_0x407c('0x44')](handleError(_0x2b103e,null));};exports[_0x407c('0x58')]=function(_0x566b82,_0x26c322,_0x485274){var _0x454a39={};var _0x289121={};var _0x7268bd;var _0xadcccc;return db[_0x407c('0x2f')][_0x407c('0x59')]({'where':{'id':_0x566b82[_0x407c('0x4b')]['id']}})[_0x407c('0x29')](handleEntityNotFound(_0x26c322,null))[_0x407c('0x29')](function(_0x4e1aed){if(_0x4e1aed){_0x7268bd=_0x4e1aed;_0x289121[_0x407c('0x33')]=_[_0x407c('0x53')](db['ChatInternalMessage'][_0x407c('0x30')]);_0x289121[_0x407c('0x34')]=_[_0x407c('0x53')](_0x566b82['query']);_0x289121['filters']=_[_0x407c('0x36')](_0x289121[_0x407c('0x33')],_0x289121[_0x407c('0x34')]);_0x454a39[_0x407c('0x37')]=_[_0x407c('0x36')](_0x289121[_0x407c('0x33')],qs[_0x407c('0x38')](_0x566b82[_0x407c('0x34')][_0x407c('0x38')]));_0x454a39[_0x407c('0x37')]=_0x454a39[_0x407c('0x37')]['length']?_0x454a39['attributes']:_0x289121[_0x407c('0x33')];_0x454a39[_0x407c('0x3b')]=qs[_0x407c('0x3c')](_0x566b82['query']['sort']);_0x454a39[_0x407c('0x3f')]=qs[_0x407c('0x35')](_[_0x407c('0x55')](_0x566b82['query'],_0x289121['filters']));if(_0x566b82['query'][_0x407c('0x3d')]){_0x454a39[_0x407c('0x3f')]=_[_0x407c('0x3e')](_0x454a39[_0x407c('0x3f')],{'$or':_[_0x407c('0x2e')](_0x454a39[_0x407c('0x37')],function(_0x6f29be){var _0x45285c={};_0x45285c[_0x6f29be]={'$like':'%'+_0x566b82['query'][_0x407c('0x3d')]+'%'};return _0x45285c;})});}if(_0x566b82[_0x407c('0x34')][_0x407c('0x5a')]){var _0x2dc30c=_0x566b82[_0x407c('0x34')][_0x407c('0x5a')]['split'](',');var _0x2a192c={};_0x2a192c[_0x2dc30c[0x0]]={'$gte':moment(_0x2dc30c[0x1])[_0x407c('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x454a39[_0x407c('0x3f')]=_[_0x407c('0x3e')](_0x454a39[_0x407c('0x3f')],_0x2a192c);}_0x454a39=_['merge']({},_0x454a39,_0x566b82[_0x407c('0x47')]);return _0x7268bd[_0x407c('0x58')](_0x454a39);}})[_0x407c('0x29')](function(_0x31face){if(_0x31face){_0xadcccc=_0x31face[_0x407c('0x39')];if(!_0x566b82[_0x407c('0x34')][_0x407c('0x5c')]('nolimit')){_0x454a39[_0x407c('0x23')]=qs['limit'](_0x566b82[_0x407c('0x34')]['limit']);_0x454a39[_0x407c('0x20')]=qs[_0x407c('0x20')](_0x566b82['query'][_0x407c('0x20')]);}return _0x7268bd[_0x407c('0x58')](_0x454a39);}})[_0x407c('0x29')](function(_0x1bd7e0){if(_0x1bd7e0){return _0x1bd7e0?{'count':_0xadcccc,'rows':_0x1bd7e0}:null;}})['then'](respondWithResult(_0x26c322,null))[_0x407c('0x44')](handleError(_0x26c322,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3ec2c53..c26e0f7 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 _0x1c2f=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hook'];(function(_0x2feb93,_0x572c96){var _0x3254e2=function(_0x573dbd){while(--_0x573dbd){_0x2feb93['push'](_0x2feb93['shift']());}};_0x3254e2(++_0x572c96);}(_0x1c2f,0x1c3));var _0xf1c2=function(_0x526889,_0x3f9043){_0x526889=_0x526889-0x0;var _0x21ad5e=_0x1c2f[_0x526889];return _0x21ad5e;};'use strict';var EventEmitter=require(_0xf1c2('0x0'));var ChatGroup=require(_0xf1c2('0x1'))['db'][_0xf1c2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf1c2('0x3')](0x0);var events={'afterCreate':_0xf1c2('0x4'),'afterUpdate':_0xf1c2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a5c9b){return function(_0x229abd,_0x1a0233,_0x296405){ChatGroupEvents['emit'](_0x2a5c9b+':'+_0x229abd['id'],_0x229abd);ChatGroupEvents[_0xf1c2('0x6')](_0x2a5c9b,_0x229abd);_0x296405(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf1c2('0x7')](e,emitEvent(event));}}module[_0xf1c2('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xa3a4=['ChatGroup','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x222472,_0x33ea87){var _0x5d601f=function(_0x53fc6f){while(--_0x53fc6f){_0x222472['push'](_0x222472['shift']());}};_0x5d601f(++_0x33ea87);}(_0xa3a4,0x6e));var _0x4a3a=function(_0x4e2e88,_0x4e0be3){_0x4e2e88=_0x4e2e88-0x0;var _0x5bc238=_0xa3a4[_0x4e2e88];return _0x5bc238;};'use strict';var EventEmitter=require(_0x4a3a('0x0'));var ChatGroup=require(_0x4a3a('0x1'))['db'][_0x4a3a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4a3a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a3a('0x4'),'afterDestroy':_0x4a3a('0x5')};function emitEvent(_0x465d18){return function(_0x27b07f,_0x5446e7,_0xcce8e0){ChatGroupEvents[_0x4a3a('0x6')](_0x465d18+':'+_0x27b07f['id'],_0x27b07f);ChatGroupEvents['emit'](_0x465d18,_0x27b07f);_0xcce8e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4a3a('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index b48eed5..e313c45 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 _0x092d=['../../config/logger','bluebird','request-promise','path','../../config/environment','ChatGroup','chat_groups'];(function(_0x5cbad7,_0x54313c){var _0x540c34=function(_0x337b4b){while(--_0x337b4b){_0x5cbad7['push'](_0x5cbad7['shift']());}};_0x540c34(++_0x54313c);}(_0x092d,0xee));var _0xd092=function(_0x1b1c4f,_0x32eb9c){_0x1b1c4f=_0x1b1c4f-0x0;var _0x3f02c1=_0x092d[_0x1b1c4f];return _0x3f02c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd092('0x0'))('api');var moment=require('moment');var BPromise=require(_0xd092('0x1'));var rp=require(_0xd092('0x2'));var fs=require('fs');var path=require(_0xd092('0x3'));var rimraf=require('rimraf');var config=require(_0xd092('0x4'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x32c2b9,_0x836db2){return _0x32c2b9['define'](_0xd092('0x5'),attributes,{'tableName':_0xd092('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5d7=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','util'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xe5d7,0x17b));var _0x7e5d=function(_0x3aed66,_0x11d651){_0x3aed66=_0x3aed66-0x0;var _0x1f51e9=_0xe5d7[_0x3aed66];return _0x1f51e9;};'use strict';var _=require('lodash');var util=require(_0x7e5d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7e5d('0x1'));var rp=require(_0x7e5d('0x2'));var fs=require('fs');var path=require(_0x7e5d('0x3'));var rimraf=require(_0x7e5d('0x4'));var config=require(_0x7e5d('0x5'));var attributes=require(_0x7e5d('0x6'));module['exports']=function(_0x205825,_0x1d720e){return _0x205825[_0x7e5d('0x7')](_0x7e5d('0x8'),attributes,{'tableName':_0x7e5d('0x9'),'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 5c265da..3def441 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 _0x851c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x4ce860,_0x24ca0c){var _0x587afc=function(_0xc1a4e8){while(--_0xc1a4e8){_0x4ce860['push'](_0x4ce860['shift']());}};_0x587afc(++_0x24ca0c);}(_0x851c,0x19d));var _0xc851=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x851c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc851('0x0'));var util=require(_0xc851('0x1'));var moment=require(_0xc851('0x2'));var BPromise=require(_0xc851('0x3'));var rs=require(_0xc851('0x4'));var fs=require('fs');var Redis=require(_0xc851('0x5'));var db=require(_0xc851('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc851('0x7'))(_0xc851('0x8'));var config=require('../../config/environment');var jayson=require(_0xc851('0x9'));var client=jayson[_0xc851('0xa')]['http']({'port':0x232a});config[_0xc851('0xb')]=_['defaults'](config['redis'],{'host':_0xc851('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc851('0xd'))[_0xc851('0xe')](socket);function respondWithRpcPromise(_0x3b4e80,_0x177de0,_0x1f1524){return new BPromise(function(_0x1ee38d,_0x33772a){return client[_0xc851('0xf')](_0x3b4e80,_0x1f1524)['then'](function(_0x3a1ce8){logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));logger[_0xc851('0x13')](_0xc851('0x14'),_0x177de0,_0xc851('0x12'),JSON[_0xc851('0x15')](_0x3a1ce8));if(_0x3a1ce8[_0xc851('0x16')]){if(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x17')]===0x1f4){logger[_0xc851('0x16')](_0xc851('0x11'),_0x177de0,_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);return _0x33772a(_0x3a1ce8[_0xc851('0x16')]['message']);}logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x3a1ce8[_0xc851('0x16')]['message']);return _0x1ee38d(_0x3a1ce8[_0xc851('0x16')][_0xc851('0x18')]);}else{logger[_0xc851('0x10')](_0xc851('0x11'),_0x177de0,_0xc851('0x12'));_0x1ee38d(_0x3a1ce8[_0xc851('0x19')][_0xc851('0x18')]);}})['catch'](function(_0x27c098){logger[_0xc851('0x16')]('ChatGroup,\x20%s,\x20%s',_0x177de0,_0x27c098);_0x33772a(_0x27c098);});});} \ No newline at end of file +var _0x6315=['http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatGroup,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ebb27,_0x206118){var _0x515e54=function(_0x5ebb86){while(--_0x5ebb86){_0x2ebb27['push'](_0x2ebb27['shift']());}};_0x515e54(++_0x206118);}(_0x6315,0x65));var _0x5631=function(_0x49899e,_0x68bbd5){_0x49899e=_0x49899e-0x0;var _0x11cf80=_0x6315[_0x49899e];return _0x11cf80;};'use strict';var _=require('lodash');var util=require(_0x5631('0x0'));var moment=require(_0x5631('0x1'));var BPromise=require(_0x5631('0x2'));var rs=require(_0x5631('0x3'));var fs=require('fs');var Redis=require(_0x5631('0x4'));var db=require(_0x5631('0x5'))['db'];var utils=require(_0x5631('0x6'));var logger=require(_0x5631('0x7'))(_0x5631('0x8'));var config=require(_0x5631('0x9'));var jayson=require(_0x5631('0xa'));var client=jayson['client'][_0x5631('0xb')]({'port':0x232a});config[_0x5631('0xc')]=_['defaults'](config[_0x5631('0xc')],{'host':_0x5631('0xd'),'port':0x18eb});var socket=require(_0x5631('0xe'))(new Redis(config[_0x5631('0xc')]));require(_0x5631('0xf'))[_0x5631('0x10')](socket);function respondWithRpcPromise(_0x525998,_0x2dbe9b,_0x5a214b){return new BPromise(function(_0x16db6a,_0x2d46b2){return client[_0x5631('0x11')](_0x525998,_0x5a214b)[_0x5631('0x12')](function(_0x4a88be){logger[_0x5631('0x13')]('ChatGroup,\x20%s,\x20%s',_0x2dbe9b,'request\x20sent');logger[_0x5631('0x14')](_0x5631('0x15'),_0x2dbe9b,_0x5631('0x16'),JSON[_0x5631('0x17')](_0x4a88be));if(_0x4a88be[_0x5631('0x18')]){if(_0x4a88be[_0x5631('0x18')]['code']===0x1f4){logger[_0x5631('0x18')](_0x5631('0x19'),_0x2dbe9b,_0x4a88be[_0x5631('0x18')][_0x5631('0x1a')]);return _0x2d46b2(_0x4a88be[_0x5631('0x18')][_0x5631('0x1a')]);}logger[_0x5631('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2dbe9b,_0x4a88be[_0x5631('0x18')]['message']);return _0x16db6a(_0x4a88be[_0x5631('0x18')]['message']);}else{logger['info'](_0x5631('0x19'),_0x2dbe9b,_0x5631('0x16'));_0x16db6a(_0x4a88be['result'][_0x5631('0x1a')]);}})[_0x5631('0x1b')](function(_0x94386a){logger[_0x5631('0x18')](_0x5631('0x19'),_0x2dbe9b,_0x94386a);_0x2d46b2(_0x94386a);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index bea667c..4d13273 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 _0x0e95=['removeListener','register','length','./chatGroup.events','save','remove','emit'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0e95,0x1d1));var _0x50e9=function(_0x2c2c86,_0x58399b){_0x2c2c86=_0x2c2c86-0x0;var _0xe6ede3=_0x0e95[_0x2c2c86];return _0xe6ede3;};'use strict';var ChatGroupEvents=require(_0x50e9('0x0'));var events=[_0x50e9('0x1'),_0x50e9('0x2'),'update'];function createListener(_0x55097d,_0x5712a6){return function(_0x4694f1){_0x5712a6[_0x50e9('0x3')](_0x55097d,_0x4694f1);};}function removeListener(_0x2ae11a,_0x483613){return function(){ChatGroupEvents[_0x50e9('0x4')](_0x2ae11a,_0x483613);};}exports[_0x50e9('0x5')]=function(_0x1be434){for(var _0x4ded02=0x0,_0x2d31d6=events[_0x50e9('0x6')];_0x4ded02<_0x2d31d6;_0x4ded02++){var _0x5e2a43=events[_0x4ded02];var _0x1e2bd1=createListener('chatGroup:'+_0x5e2a43,_0x1be434);ChatGroupEvents['on'](_0x5e2a43,_0x1e2bd1);}}; \ No newline at end of file +var _0x4faf=['register','length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x5ed493,_0x42449e){var _0x1dec6b=function(_0x1283e9){while(--_0x1283e9){_0x5ed493['push'](_0x5ed493['shift']());}};_0x1dec6b(++_0x42449e);}(_0x4faf,0x1d7));var _0xf4fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4faf[_0x20a584];return _0x4b41a8;};'use strict';var ChatGroupEvents=require(_0xf4fa('0x0'));var events=[_0xf4fa('0x1'),_0xf4fa('0x2'),_0xf4fa('0x3')];function createListener(_0x54627e,_0x428a21){return function(_0x564b8c){_0x428a21[_0xf4fa('0x4')](_0x54627e,_0x564b8c);};}function removeListener(_0x3518bd,_0x2bd5fb){return function(){ChatGroupEvents[_0xf4fa('0x5')](_0x3518bd,_0x2bd5fb);};}exports[_0xf4fa('0x6')]=function(_0x5608dd){for(var _0x50b5b2=0x0,_0x3f8a77=events[_0xf4fa('0x7')];_0x50b5b2<_0x3f8a77;_0x50b5b2++){var _0x29452b=events[_0x50b5b2];var _0x598c60=createListener(_0xf4fa('0x8')+_0x29452b,_0x5608dd);ChatGroupEvents['on'](_0x29452b,_0x598c60);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 07aed85..7759ab3 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 _0xe6d7=['../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','put','update','delete','removeMembers','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x734baa,_0x4072d5){var _0x1920d4=function(_0x4c02ba){while(--_0x4c02ba){_0x734baa['push'](_0x734baa['shift']());}};_0x1920d4(++_0x4072d5);}(_0xe6d7,0x124));var _0x7e6d=function(_0x4781b1,_0x109c44){_0x4781b1=_0x4781b1-0x0;var _0x13ecb1=_0xe6d7[_0x4781b1];return _0x13ecb1;};'use strict';var multer=require(_0x7e6d('0x0'));var util=require(_0x7e6d('0x1'));var path=require(_0x7e6d('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e6d('0x3'));var router=express[_0x7e6d('0x4')]();var fs_extra=require(_0x7e6d('0x5'));var auth=require(_0x7e6d('0x6'));var interaction=require(_0x7e6d('0x7'));var config=require(_0x7e6d('0x8'));var controller=require(_0x7e6d('0x9'));router[_0x7e6d('0xa')]('/',auth[_0x7e6d('0xb')](),controller[_0x7e6d('0xc')]);router[_0x7e6d('0xa')](_0x7e6d('0xd'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0xe')]);router[_0x7e6d('0xa')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x10')]);router['get'](_0x7e6d('0x11'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x12')]);router[_0x7e6d('0xa')](_0x7e6d('0x13'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x14')]);router['get'](_0x7e6d('0x15'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7e6d('0x17')]);router[_0x7e6d('0x18')](_0x7e6d('0x13'),auth['isAuthenticated'](),controller[_0x7e6d('0x19')]);router[_0x7e6d('0x18')]('/:id/messages',auth[_0x7e6d('0xb')](),controller['addMessage']);router[_0x7e6d('0x1a')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x1b')]);router[_0x7e6d('0x1c')](_0x7e6d('0xf'),auth[_0x7e6d('0xb')](),controller['destroy']);router[_0x7e6d('0x1c')](_0x7e6d('0x13'),auth[_0x7e6d('0xb')](),controller[_0x7e6d('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xafc6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0x389290,_0x16aa43){var _0x529d99=function(_0x12658c){while(--_0x12658c){_0x389290['push'](_0x389290['shift']());}};_0x529d99(++_0x16aa43);}(_0xafc6,0xaa));var _0x6afc=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xafc6[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var path=require(_0x6afc('0x2'));var timeout=require(_0x6afc('0x3'));var express=require('express');var router=express[_0x6afc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6afc('0x5'));var interaction=require(_0x6afc('0x6'));var config=require(_0x6afc('0x7'));var controller=require(_0x6afc('0x8'));router[_0x6afc('0x9')]('/',auth[_0x6afc('0xa')](),controller['index']);router[_0x6afc('0x9')](_0x6afc('0xb'),auth[_0x6afc('0xa')](),controller[_0x6afc('0xc')]);router[_0x6afc('0x9')](_0x6afc('0xd'),auth[_0x6afc('0xa')](),controller[_0x6afc('0xe')]);router[_0x6afc('0x9')](_0x6afc('0xf'),auth['isAuthenticated'](),controller[_0x6afc('0x10')]);router[_0x6afc('0x9')](_0x6afc('0x11'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x12')]);router[_0x6afc('0x9')](_0x6afc('0x13'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x14')]);router['post']('/',auth[_0x6afc('0xa')](),controller['create']);router[_0x6afc('0x15')](_0x6afc('0x11'),auth[_0x6afc('0xa')](),controller['addMembers']);router[_0x6afc('0x15')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6afc('0x16')]);router[_0x6afc('0x17')](_0x6afc('0xd'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x18')]);router[_0x6afc('0x19')](_0x6afc('0xd'),auth[_0x6afc('0xa')](),controller[_0x6afc('0x1a')]);router[_0x6afc('0x19')]('/:id/members',auth[_0x6afc('0xa')](),controller[_0x6afc('0x1b')]);module[_0x6afc('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 86ae0d7..70e123e 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 _0x1152=['long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE','STRING'];(function(_0x305cc5,_0x317607){var _0x3ef26f=function(_0x309528){while(--_0x309528){_0x305cc5['push'](_0x305cc5['shift']());}};_0x3ef26f(++_0x317607);}(_0x1152,0x182));var _0x2115=function(_0x23f50a,_0x1e0fbc){_0x23f50a=_0x23f50a-0x0;var _0x3d48e2=_0x1152[_0x23f50a];return _0x3d48e2;};'use strict';var Sequelize=require(_0x2115('0x0'));module[_0x2115('0x1')]={'closed':{'type':Sequelize[_0x2115('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2115('0x3')]},'ratingType':{'type':Sequelize[_0x2115('0x4')](_0x2115('0x5'),_0x2115('0x6')),'defaultValue':_0x2115('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2115('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2115('0x8')]},'disposition':{'type':Sequelize[_0x2115('0x9')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x2115('0x9')]},'osVersion':{'type':Sequelize[_0x2115('0x9')]},'deviceModel':{'type':Sequelize[_0x2115('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x2115('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2115('0x7')](_0x2115('0xa'))},'read1stAt':{'type':Sequelize[_0x2115('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2115('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2115('0x9')]},'customerPort':{'type':Sequelize[_0x2115('0x9')]},'vidaooSessionId':{'type':Sequelize[_0x2115('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x2115('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xa7fa=['long','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x3b1743,_0x299e84){var _0x11a35e=function(_0x1da950){while(--_0x1da950){_0x3b1743['push'](_0x3b1743['shift']());}};_0x11a35e(++_0x299e84);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa7f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaa7f('0x1')]},'ratingType':{'type':Sequelize[_0xaa7f('0x2')](_0xaa7f('0x3'),_0xaa7f('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xaa7f('0x5')]},'pathTranscript':{'type':Sequelize[_0xaa7f('0x5')]},'mailTranscript':{'type':Sequelize[_0xaa7f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xaa7f('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaa7f('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xaa7f('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xaa7f('0x6')]},'osVersion':{'type':Sequelize[_0xaa7f('0x6')]},'deviceModel':{'type':Sequelize[_0xaa7f('0x6')]},'deviceVendor':{'type':Sequelize[_0xaa7f('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xaa7f('0x5')]},'customerIp':{'type':Sequelize[_0xaa7f('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xaa7f('0x8'))},'read1stAt':{'type':Sequelize[_0xaa7f('0x7')]},'lastMsgAt':{'type':Sequelize[_0xaa7f('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xaa7f('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xaa7f('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xaa7f('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xaa7f('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 94b8e94..e2f246d 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 _0x3a2d=['rawAttributes','filters','intersection','attributes','fields','includeAll','include','merge','options','create','body','update','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','POST','vidaooTopic','isNull','follow','vidaooMetadata','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','User','ChatWebsiteId','CmContact','ContactId','Messages','length','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','UserId','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','push','rows','addTags','spread','Tag','color','emit','removeTags','unix','toString','files','server','attachments','transcript-%d-%s.zip','createdAt','secret','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','disposition','osName','customerIp','customerPort','tail','existsSync','createReadStream','firstName','lastName','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','zip-dir','request-promise','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','destroy','stack','name','send','render','contact','agent','account','index','map','type','key','findAll','chat','query','user','catch','params','model','keys','ChatInteraction'];(function(_0xaa87c6,_0x20ed4f){var _0x4df3ed=function(_0x3c8b81){while(--_0x3c8b81){_0xaa87c6['push'](_0xaa87c6['shift']());}};_0x4df3ed(++_0x20ed4f);}(_0x3a2d,0x169));var _0xd3a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a2d[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd3a2('0x0'));var rp=require(_0xd3a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd3a2('0x2'));var util=require(_0xd3a2('0x3'));var path=require(_0xd3a2('0x4'));var ejs=require(_0xd3a2('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd3a2('0x6'));var interaction=require(_0xd3a2('0x7'));var qs=require(_0xd3a2('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xd3a2('0x9'))(_0xd3a2('0xa'));var config=require(_0xd3a2('0xb'));var db=require(_0xd3a2('0xc'))['db'];config[_0xd3a2('0xd')]=_['defaults'](config[_0xd3a2('0xd')],{'host':_0xd3a2('0xe'),'port':0x18eb});var socket=require(_0xd3a2('0xf'))(new Redis(config['redis']));require(_0xd3a2('0x10'))[_0xd3a2('0x11')](socket);var jayson=require(_0xd3a2('0x12'));var client=jayson[_0xd3a2('0x13')]['http']({'port':0x232b});var client9004=jayson[_0xd3a2('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4a2891,_0x304a13,_0x5964b0,_0x3afb38){return new BPromise(function(_0x42f1e9,_0x2c1347){var _0x48371f=_0x3afb38||client;return _0x48371f['request'](_0x4a2891,_0x5964b0)[_0xd3a2('0x14')](function(_0x47b003){logger[_0xd3a2('0x15')](_0xd3a2('0x16'),_0x304a13,_0xd3a2('0x17'));logger[_0xd3a2('0x18')](_0xd3a2('0x19'),_0x304a13,_0xd3a2('0x17'),JSON[_0xd3a2('0x1a')](_0x47b003));if(_0x47b003[_0xd3a2('0x1b')]){if(_0x47b003['error']['code']===0x1f4){logger[_0xd3a2('0x1b')](_0xd3a2('0x16'),_0x304a13,_0x47b003[_0xd3a2('0x1b')][_0xd3a2('0x1c')]);return _0x2c1347(_0x47b003[_0xd3a2('0x1b')]['message']);}logger[_0xd3a2('0x1b')](_0xd3a2('0x16'),_0x304a13,_0x47b003['error'][_0xd3a2('0x1c')]);return _0x42f1e9(_0x47b003[_0xd3a2('0x1b')][_0xd3a2('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x304a13,_0xd3a2('0x17'));_0x42f1e9(_0x47b003['result'][_0xd3a2('0x1c')]);}})['catch'](function(_0x50c604){logger['error'](_0xd3a2('0x16'),_0x304a13,_0x50c604);_0x2c1347(_0x50c604);});});}function respondWithStatusCode(_0x301214,_0xcf1792){_0xcf1792=_0xcf1792||0xcc;return function(_0x1ee570){if(_0x1ee570){return _0x301214[_0xd3a2('0x1d')](_0xcf1792);}return _0x301214[_0xd3a2('0x1e')](_0xcf1792)['end']();};}function respondWithResult(_0x29e196,_0x383c92){_0x383c92=_0x383c92||0xc8;return function(_0x546886){if(_0x546886){return _0x29e196[_0xd3a2('0x1e')](_0x383c92)['json'](_0x546886);}};}function respondWithFilteredResult(_0x5822da,_0x49e0af){return function(_0x35a739){if(_0x35a739){var _0x340ce6=typeof _0x49e0af['offset']==='undefined'&&typeof _0x49e0af[_0xd3a2('0x1f')]===_0xd3a2('0x20');var _0x525a4e=_0x35a739[_0xd3a2('0x21')];var _0x315aff=_0x340ce6?0x0:_0x49e0af['offset'];var _0xf9f47f=_0x340ce6?_0x35a739[_0xd3a2('0x21')]:_0x49e0af[_0xd3a2('0x22')]+_0x49e0af[_0xd3a2('0x1f')];var _0x4f3cf8;if(_0xf9f47f>=_0x525a4e){_0xf9f47f=_0x525a4e;_0x4f3cf8=0xc8;}else{_0x4f3cf8=0xce;}_0x5822da['status'](_0x4f3cf8);return _0x5822da[_0xd3a2('0x23')](_0xd3a2('0x24'),_0x315aff+'-'+_0xf9f47f+'/'+_0x525a4e)[_0xd3a2('0x25')](_0x35a739);}return null;};}function saveUpdates(_0x3841f7){return function(_0x229322){if(_0x229322){return _0x229322['update'](_0x3841f7)[_0xd3a2('0x14')](function(_0x39f209){return _0x39f209;});}return null;};}function removeEntity(_0x575937){return function(_0x29bf89){if(_0x29bf89){return _0x29bf89[_0xd3a2('0x26')]()[_0xd3a2('0x14')](function(){_0x575937[_0xd3a2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16afac){return function(_0x5265fa){if(!_0x5265fa){_0x16afac[_0xd3a2('0x1d')](0x194);}return _0x5265fa;};}function handleError(_0x24fb96,_0x46b71c){_0x46b71c=_0x46b71c||0x1f4;return function(_0x56720d){logger['error'](_0x56720d[_0xd3a2('0x27')]);if(_0x56720d[_0xd3a2('0x28')]){delete _0x56720d[_0xd3a2('0x28')];}_0x24fb96[_0xd3a2('0x1e')](_0x46b71c)[_0xd3a2('0x29')](_0x56720d);};}function getMustacheRender(_0x484f5f,_0x1db1d7){return Mustache[_0xd3a2('0x2a')](_0x484f5f,_['merge'](_0x1db1d7['body'],{'contact':_0x1db1d7[_0xd3a2('0x2b')],'message':_0x1db1d7[_0xd3a2('0x1c')],'agent':_0x1db1d7[_0xd3a2('0x2c')],'interaction':_0x1db1d7['interaction'],'account':_0x1db1d7[_0xd3a2('0x2d')]}))||'';}exports[_0xd3a2('0x2e')]=function(_0x336220,_0x1de314){var _0x5a8670={};var _0xab06ac=_[_0xd3a2('0x2f')](db['ChatInteraction']['rawAttributes'],function(_0x565833){return{'name':_0x565833['fieldName'],'type':_0x565833[_0xd3a2('0x30')][_0xd3a2('0x31')]};});_0x5a8670=qs['getOptions'](_0xab06ac,_0x336220);return interaction[_0xd3a2('0x32')](_0xd3a2('0x33'),_0x336220[_0xd3a2('0x34')],_0x336220[_0xd3a2('0x35')],_0x5a8670,_0xab06ac)['then'](respondWithFilteredResult(_0x1de314,_0x5a8670))[_0xd3a2('0x36')](handleError(_0x1de314,null));};exports['show']=function(_0x407be8,_0x3a9615){var _0xc930a3={'raw':![],'where':{'id':_0x407be8[_0xd3a2('0x37')]['id']}},_0x7b2150={};_0x7b2150[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db[_0xd3a2('0x3a')][_0xd3a2('0x3b')]);_0x7b2150[_0xd3a2('0x34')]=_[_0xd3a2('0x39')](_0x407be8['query']);_0x7b2150[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x7b2150[_0xd3a2('0x38')],_0x7b2150['query']);_0xc930a3[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x7b2150['model'],qs[_0xd3a2('0x3f')](_0x407be8[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0xc930a3['attributes']=_0xc930a3['attributes']['length']?_0xc930a3['attributes']:_0x7b2150[_0xd3a2('0x38')];if(_0x407be8['query'][_0xd3a2('0x40')]){_0xc930a3[_0xd3a2('0x41')]=[{'all':!![]}];}_0xc930a3=_[_0xd3a2('0x42')]({},_0xc930a3,_0x407be8[_0xd3a2('0x43')]);return db['ChatInteraction']['find'](_0xc930a3)[_0xd3a2('0x14')](handleEntityNotFound(_0x3a9615,null))['then'](respondWithResult(_0x3a9615,null))['catch'](handleError(_0x3a9615,null));};exports[_0xd3a2('0x44')]=function(_0x3ec1fb,_0x18a672){return db[_0xd3a2('0x3a')]['create'](_0x3ec1fb[_0xd3a2('0x45')],{})[_0xd3a2('0x14')](respondWithResult(_0x18a672,0xc9))[_0xd3a2('0x36')](handleError(_0x18a672,null));};exports[_0xd3a2('0x46')]=function(_0x325c0d,_0x298557){if(_0x325c0d[_0xd3a2('0x45')]['id']){delete _0x325c0d['body']['id'];}return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x325c0d[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x298557,null))[_0xd3a2('0x14')](saveUpdates(_0x325c0d[_0xd3a2('0x45')],null))[_0xd3a2('0x14')](respondWithResult(_0x298557,null))[_0xd3a2('0x36')](handleError(_0x298557,null));};exports['destroy']=function(_0x1dca0a,_0x2719fd){return db['ChatInteraction']['find']({'where':{'id':_0x1dca0a[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x2719fd,null))[_0xd3a2('0x14')](removeEntity(_0x2719fd,null))[_0xd3a2('0x36')](handleError(_0x2719fd,null));};exports[_0xd3a2('0x48')]=function(_0x425a6f,_0x2fa2bd){return db['ChatInteraction'][_0xd3a2('0x48')]()[_0xd3a2('0x14')](respondWithResult(_0x2fa2bd,null))[_0xd3a2('0x36')](handleError(_0x2fa2bd,null));};exports[_0xd3a2('0x49')]=function(_0x1ce12a,_0x5f3da2){var _0x201b34=_0x1ce12a[_0xd3a2('0x37')]['id'];var _0x15d713;var _0x22d4c7;var _0x2e0a42;return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x201b34}})['then'](function(_0x1e8f3a){_0x15d713=_0x1e8f3a;return db[_0xd3a2('0x4b')][_0xd3a2('0x4a')]({'where':{'id':_0x1e8f3a['ChatWebsiteId']},'attributes':['id',_0xd3a2('0x4c'),_0xd3a2('0x4d'),'vidaooTopic',_0xd3a2('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xd3a2('0x14')](function(_0x3f32c8){if(_0x3f32c8&&_0x3f32c8[_0xd3a2('0x4c')]&&_0x3f32c8['vidaooEscalation']){_0x22d4c7=_0x3f32c8;var _0x5b3f2={'interaction':{'id':_0x201b34},'agent':{'id':_0x1ce12a[_0xd3a2('0x35')]['id'],'name':_0x1ce12a[_0xd3a2('0x35')][_0xd3a2('0x28')],'fullname':_0x1ce12a['user'][_0xd3a2('0x4f')],'email':_0x1ce12a['user'][_0xd3a2('0x50')]},'contact':_0x1ce12a[_0xd3a2('0x45')][_0xd3a2('0x2b')],'account':_0x1ce12a[_0xd3a2('0x45')][_0xd3a2('0x2d')]};var _0x1bf660={'rejectUnauthorized':![],'method':_0xd3a2('0x51'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3f32c8[_0xd3a2('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ce12a[_0xd3a2('0x35')][_0xd3a2('0x50')]],'buttons':null,'topic':_0x22d4c7[_0xd3a2('0x52')],'note':_[_0xd3a2('0x53')](_0x22d4c7[_0xd3a2('0x4e')])?null:getMustacheRender(_0x22d4c7['vidaooNote'],_0x5b3f2),'metadata':null},'redirect':_0xd3a2('0x54'),'json':!![]};try{if(!_[_0xd3a2('0x53')](_0x22d4c7[_0xd3a2('0x55')])){var _0x59686d=getMustacheRender(_0x22d4c7[_0xd3a2('0x55')],_0x5b3f2);var _0x2bd1de=JSON[_0xd3a2('0x56')](_0x59686d);_0x1bf660[_0xd3a2('0x45')]['metadata']=_0x2bd1de;}}catch(_0x3ca44a){throw new db[(_0xd3a2('0x57'))]['ValidationError'](_0xd3a2('0x58'));}return rp(_0x1bf660);}else{throw new db[(_0xd3a2('0x57'))][(_0xd3a2('0x59'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd3a2('0x14')](function(_0x3a2a0d){_0x2e0a42=_0x3a2a0d;if(_0x2e0a42['id']){var _0x315f28={'body':_0x2e0a42[_0xd3a2('0x5a')],'ChatWebsiteId':_0x22d4c7['id'],'ChatInteractionId':_0x15d713['id'],'direction':'out','UserId':_0x1ce12a[_0xd3a2('0x35')]['id']};return db['ChatMessage'][_0xd3a2('0x44')](_0x315f28,{});}else{throw new db[(_0xd3a2('0x57'))]['ValidationError'](_0xd3a2('0x5b'));}})[_0xd3a2('0x14')](function(){return _0x15d713[_0xd3a2('0x5c')]({'vidaooSessionId':_0x2e0a42['id']});})[_0xd3a2('0x14')](respondWithResult(_0x5f3da2,null))[_0xd3a2('0x36')](handleError(_0x5f3da2,null));};exports[_0xd3a2('0x5d')]=function(_0x25290f,_0x5b943f){if(_0x25290f[_0xd3a2('0x45')]['id']){delete _0x25290f[_0xd3a2('0x45')]['id'];}return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x25290f[_0xd3a2('0x37')]['id']},'include':[{'model':db['CmContact'],'as':_0xd3a2('0x5e')}]})['then'](handleEntityNotFound(_0x5b943f,null))[_0xd3a2('0x14')](saveUpdates(_0x25290f[_0xd3a2('0x45')],null))[_0xd3a2('0x14')](respondWithResult(_0x5b943f,null))[_0xd3a2('0x36')](handleError(_0x5b943f,null));};exports[_0xd3a2('0x5f')]=function(_0x424742,_0x20bbc9){if(_0x424742[_0xd3a2('0x45')]['id']){delete _0x424742[_0xd3a2('0x45')]['id'];}return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x424742[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](function(_0x471226){if(!_0x471226){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd3a2('0x5f'),0x194,_0xd3a2('0x60'));_0x20bbc9[_0xd3a2('0x1d')](0x194);}else{if(_0x471226['UserId']){throw new db[(_0xd3a2('0x57'))][(_0xd3a2('0x59'))](_0xd3a2('0x61'));}}return _0x471226;})['then'](function(_0x60a9c1){if(_0x60a9c1){return _0x60a9c1['update']({'closed':_0x424742[_0xd3a2('0x45')][_0xd3a2('0x62')],'disposition':_0x424742[_0xd3a2('0x45')]['disposition']})[_0xd3a2('0x14')](function(_0x587594){return _0x587594;});}})[_0xd3a2('0x14')](function(){return respondWithRpcPromise(_0xd3a2('0x63'),_0xd3a2('0x5f'),_0x424742[_0xd3a2('0x45')],client9004);})[_0xd3a2('0x14')](respondWithResult(_0x20bbc9,null))[_0xd3a2('0x36')](handleError(_0x20bbc9,null));};exports[_0xd3a2('0x64')]=function(_0x401adb,_0x481ab6){_0x401adb[_0xd3a2('0x45')]['name']=_0x401adb['file'][_0xd3a2('0x65')];_0x401adb[_0xd3a2('0x45')][_0xd3a2('0x66')]=_0x401adb[_0xd3a2('0x67')][_0xd3a2('0x68')];_0x401adb[_0xd3a2('0x45')]['type']=_0x401adb[_0xd3a2('0x67')][_0xd3a2('0x69')];return db['Attachment']['create'](_0x401adb[_0xd3a2('0x45')])[_0xd3a2('0x14')](respondWithResult(_0x481ab6,0xc9))[_0xd3a2('0x36')](handleError(_0x481ab6,null));};exports[_0xd3a2('0x6a')]=function(_0x128381,_0x540a05){return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x128381[_0xd3a2('0x37')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x540a05,null))['then'](function(_0x534165){if(_0x534165){if(_0x534165['closed']){return _0x540a05[_0xd3a2('0x1e')](0x193)[_0xd3a2('0x25')]({'status':0x193,'message':_0xd3a2('0x6b')});}return db[_0xd3a2('0x6c')][_0xd3a2('0x4a')]({'where':{'id':_0x128381['query'][_0xd3a2('0x6d')]},'raw':!![]})['then'](handleEntityNotFound(_0x540a05,null));}})[_0xd3a2('0x14')](function(_0x1949f2){if(_0x1949f2){var _0x48b8a2=_0x1949f2[_0xd3a2('0x6e')]!==null;var _0xee6f5d=path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],'server/files/attachments/');if(_0x48b8a2){_0xee6f5d=path[_0xd3a2('0x6f')](_0xee6f5d,_0xd3a2('0x71'));}var _0x33380c=path[_0xd3a2('0x6f')](_0xee6f5d,_0x1949f2['basename']);return _0x540a05[_0xd3a2('0x72')](_0x33380c);}})[_0xd3a2('0x36')](handleError(_0x540a05,null));};exports[_0xd3a2('0x73')]=function(_0x1aac99,_0xbdb1ce){var _0x366162=null;var _0xd94ca7=null;var _0x5b1cd8=null;if(_0x1aac99[_0xd3a2('0x45')]['id']){delete _0x1aac99[_0xd3a2('0x45')]['id'];}if(_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x74')]){_0x5b1cd8=path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],_0xd3a2('0x75'),util[_0xd3a2('0x76')](_0xd3a2('0x77'),Date[_0xd3a2('0x78')]()));_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x79')]=_0x5b1cd8;}return db['ChatInteraction'][_0xd3a2('0x47')]({'where':{'id':_0x1aac99[_0xd3a2('0x37')]['id']},'include':[{'model':db[_0xd3a2('0x7a')],'as':'Messages','include':[{'model':db[_0xd3a2('0x7b')],'as':_0xd3a2('0x7b')}]}]})[_0xd3a2('0x14')](handleEntityNotFound(_0xbdb1ce,null))[_0xd3a2('0x14')](saveUpdates(_0x1aac99[_0xd3a2('0x45')],null))['then'](function(_0x3a7be7){if(_0x3a7be7){_0x366162=_0x3a7be7;return db[_0xd3a2('0x4b')][_0xd3a2('0x47')]({'where':{'id':_0x366162[_0xd3a2('0x7c')]}});}})[_0xd3a2('0x14')](function(_0x2cbbdf){if(_0x2cbbdf){_0xd94ca7=_0x2cbbdf;return db[_0xd3a2('0x7d')][_0xd3a2('0x47')]({'where':{'id':_0x366162[_0xd3a2('0x7e')]}});}})[_0xd3a2('0x14')](function(_0x5f26db){if(_0x5f26db){if(_0x5b1cd8){var _0x1bcdb1=null;for(var _0x9b58e0=0x1;_0x9b58e0<_0x366162[_0xd3a2('0x7f')][_0xd3a2('0x80')];++_0x9b58e0){_0x1bcdb1=_0x366162[_0xd3a2('0x7f')][_0x9b58e0];var _0x5a4a6d=_0x1bcdb1['UserId']?util[_0xd3a2('0x76')](_0xd3a2('0x81'),_0xd94ca7[_0xd3a2('0x82')],_0x1bcdb1['UserId']):_0xd3a2('0x83');var _0x28133c=_0x1aac99['body'][_0xd3a2('0x84')]||util[_0xd3a2('0x76')]('%s%d',_0xd3a2('0x85'),_0x1bcdb1[_0xd3a2('0x7e')]);switch(_0xd94ca7[_0xd3a2('0x86')]){case _0xd3a2('0x87'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?util[_0xd3a2('0x76')](_0xd3a2('0x81'),_0xd94ca7['agentAlias'],_0x1bcdb1[_0xd3a2('0x88')]):'System';break;case _0xd3a2('0x89'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?_0x1bcdb1['User'][_0xd3a2('0x8a')]||_0x1bcdb1[_0xd3a2('0x7b')][_0xd3a2('0x4f')]:_0xd3a2('0x83');break;case _0xd3a2('0x8b'):_0x5a4a6d=_0x1bcdb1[_0xd3a2('0x88')]?_0x1bcdb1[_0xd3a2('0x7b')][_0xd3a2('0x4f')]:_0xd3a2('0x83');break;default:_0x5a4a6d=_0x1bcdb1['UserId']?util[_0xd3a2('0x76')]('%s%d',_0xd94ca7[_0xd3a2('0x82')],_0x1bcdb1[_0xd3a2('0x88')]):_0xd3a2('0x83');}var _0x165cdc=util['format'](_0xd3a2('0x8c'),moment(_0x1bcdb1['createdAt'])[_0xd3a2('0x76')](_0xd3a2('0x8d')),_0x1bcdb1[_0xd3a2('0x8e')]==='in'?_0x28133c:_0x5a4a6d,_0x1bcdb1[_0xd3a2('0x45')]);if(!_0x1bcdb1['secret']){fs[_0xd3a2('0x8f')](_0x5b1cd8,_0x165cdc);}}return db[_0xd3a2('0x90')][_0xd3a2('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xd3a2('0x91')],'as':_0xd3a2('0x92'),'raw':!![],'include':[{'model':db[_0xd3a2('0x93')],'as':_0xd3a2('0x93'),'raw':!![]}]}]});}}})[_0xd3a2('0x14')](function(_0x194a9c){if(!_0x194a9c||!_0x194a9c[_0xd3a2('0x92')]||!_0x1aac99['body'])return _0x366162;var _0x49d030=_0x194a9c['getSmtpOptions']();return respondWithRpcPromise(_0xd3a2('0x94'),'sendMail',{'account':_0x49d030,'message':{'from':util[_0xd3a2('0x76')](_0xd3a2('0x95'),_0x194a9c[_0xd3a2('0x28')],_0x194a9c[_0xd3a2('0x50')]||_0x194a9c[_0xd3a2('0x92')][_0xd3a2('0x35')]),'to':_0x1aac99['body'][_0xd3a2('0x74')],'subject':_0xd3a2('0x96'),'text':util[_0xd3a2('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1aac99[_0xd3a2('0x45')][_0xd3a2('0x74')]),'attachments':[{'path':_0x5b1cd8}]}})[_0xd3a2('0x14')](function(){return _0x366162;})[_0xd3a2('0x36')](function(_0x404d00){logger[_0xd3a2('0x1b')](_0x404d00);});})['then'](respondWithStatusCode(_0xbdb1ce,0xc8))[_0xd3a2('0x36')](handleError(_0xbdb1ce,null));};exports[_0xd3a2('0x97')]=function(_0x40d87b,_0x22837e){return db['ChatMessage'][_0xd3a2('0x47')]({'where':{'id':_0x40d87b['params']['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x22837e,null))['then'](function(_0x31689a){if(_0x31689a){return _0x31689a['addMessage'](_0x40d87b[_0xd3a2('0x45')][_0xd3a2('0x98')],_[_0xd3a2('0x99')](_0x40d87b[_0xd3a2('0x45')],[_0xd3a2('0x98'),'id'])||{});}})[_0xd3a2('0x14')](respondWithResult(_0x22837e,null))['catch'](handleError(_0x22837e,null));};exports[_0xd3a2('0x9a')]=function(_0x31f618,_0x448f1c){var _0x141a62={'raw':![],'where':{}};var _0x52a704={};var _0x3d5ddc={'count':0x0,'rows':[]};return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x31f618['params']['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x448f1c,null))[_0xd3a2('0x14')](function(_0x1ba39b){if(_0x1ba39b){_0x52a704[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db['ChatMessage'][_0xd3a2('0x3b')]);_0x52a704[_0xd3a2('0x34')]=_['keys'](_0x31f618[_0xd3a2('0x34')]);_0x52a704[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x52a704[_0xd3a2('0x38')],_0x52a704[_0xd3a2('0x34')]);_0x141a62[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x52a704['model'],qs[_0xd3a2('0x3f')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0x141a62[_0xd3a2('0x3e')]=_0x141a62[_0xd3a2('0x3e')][_0xd3a2('0x80')]?_0x141a62[_0xd3a2('0x3e')]:_0x52a704['model'];if(!_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x9b')](_0xd3a2('0x9c'))){_0x141a62['limit']=qs[_0xd3a2('0x1f')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x1f')]);_0x141a62[_0xd3a2('0x22')]=qs[_0xd3a2('0x22')](_0x31f618['query'][_0xd3a2('0x22')]);}_0x141a62[_0xd3a2('0x9d')]=qs[_0xd3a2('0x9e')](_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x9e')]);_0x141a62[_0xd3a2('0x9f')]=qs[_0xd3a2('0x3c')](_[_0xd3a2('0xa0')](_0x31f618[_0xd3a2('0x34')],_0x52a704[_0xd3a2('0x3c')]));_0x141a62['where'][_0xd3a2('0xa1')]=_0x1ba39b['id'];if(_0x31f618['query'][_0xd3a2('0xa2')]){_0x141a62['where']=_['merge'](_0x141a62[_0xd3a2('0x9f')],{'$or':_['map'](_0x141a62[_0xd3a2('0x3e')],function(_0x5f51ac){var _0x519ae9={};_0x519ae9[_0x5f51ac]={'$like':'%'+_0x31f618['query'][_0xd3a2('0xa2')]+'%'};return _0x519ae9;})});}if(_0x31f618[_0xd3a2('0x34')][_0xd3a2('0xa3')]){var _0x13595e=_0x31f618[_0xd3a2('0x34')][_0xd3a2('0xa3')][_0xd3a2('0xa4')](',');var _0x13f07c={};_0x13f07c[_0x13595e[0x0]]={'$gte':moment(_0x13595e[0x1])[_0xd3a2('0x76')](_0xd3a2('0xa5'))};_0x141a62[_0xd3a2('0x9f')]=_[_0xd3a2('0x42')](_0x141a62[_0xd3a2('0x9f')],_0x13f07c);}_0x141a62=_[_0xd3a2('0x42')]({},_0x141a62,_0x31f618[_0xd3a2('0x43')]);return db[_0xd3a2('0x7a')][_0xd3a2('0x21')]({'where':_0x141a62['where']})[_0xd3a2('0x14')](function(_0x442d3d){_0x3d5ddc['count']=_0x442d3d;if(_0x31f618[_0xd3a2('0x34')][_0xd3a2('0x40')]){_0x141a62['include']=[{'all':!![]}];}return db[_0xd3a2('0x7a')][_0xd3a2('0x32')](_0x141a62);})[_0xd3a2('0x14')](function(_0xef8852){_0x3d5ddc['rows']=_0xef8852;return _0x3d5ddc;});}})[_0xd3a2('0x14')](respondWithFilteredResult(_0x448f1c,_0x141a62))[_0xd3a2('0x36')](handleError(_0x448f1c,null));};exports[_0xd3a2('0xa6')]=function(_0x34060d,_0x48dc64){var _0x12f512={'where':{}},_0x209474={},_0x2f9b01={'count':0x0,'rows':[]};return db[_0xd3a2('0x3a')][_0xd3a2('0x4a')]({'where':{'id':_0x34060d['params']['id']}})['then'](handleEntityNotFound(_0x48dc64,null))[_0xd3a2('0x14')](function(_0x468a3e){if(_0x468a3e){_0x209474[_0xd3a2('0x38')]=_[_0xd3a2('0x39')](db['ChatMessage'][_0xd3a2('0x3b')]);_0x209474[_0xd3a2('0x34')]=_[_0xd3a2('0x39')](_0x34060d[_0xd3a2('0x34')]);_0x209474[_0xd3a2('0x3c')]=_[_0xd3a2('0x3d')](_0x209474[_0xd3a2('0x38')],_0x209474[_0xd3a2('0x34')]);_0x12f512[_0xd3a2('0x3e')]=_[_0xd3a2('0x3d')](_0x209474[_0xd3a2('0x38')],qs[_0xd3a2('0x3f')](_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x3f')]));_0x12f512[_0xd3a2('0x3e')]=_0x12f512[_0xd3a2('0x3e')][_0xd3a2('0x80')]?_0x12f512[_0xd3a2('0x3e')]:_0x209474[_0xd3a2('0x38')];if(!_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x9b')](_0xd3a2('0x9c'))){_0x12f512[_0xd3a2('0x1f')]=qs[_0xd3a2('0x1f')](_0x34060d['query'][_0xd3a2('0x1f')]);_0x12f512[_0xd3a2('0x22')]=qs[_0xd3a2('0x22')](_0x34060d[_0xd3a2('0x34')]['offset']);}_0x12f512['order']=qs['sort'](_0x34060d[_0xd3a2('0x34')]['sort']);_0x12f512['where']=qs[_0xd3a2('0x3c')](_[_0xd3a2('0xa0')](_0x34060d['query'],_0x209474[_0xd3a2('0x3c')]));_0x12f512[_0xd3a2('0x9f')]['ChatInteractionId']=_0x468a3e['id'];if(_0x34060d[_0xd3a2('0x34')]['filter']){_0x12f512['where']=_[_0xd3a2('0x42')](_0x12f512['where'],{'$or':_[_0xd3a2('0x2f')](_0x12f512[_0xd3a2('0x3e')],function(_0x4d1030){var _0x51dd1e={};_0x51dd1e[_0x4d1030]={'$like':'%'+_0x34060d[_0xd3a2('0x34')][_0xd3a2('0xa2')]+'%'};return _0x51dd1e;})});}_0x12f512[_0xd3a2('0x9f')]['secret']=![];if(_0x34060d[_0xd3a2('0x34')]['id']){_0x12f512[_0xd3a2('0x9f')]['id']={'$gt':_0x34060d[_0xd3a2('0x34')]['id']};}_0x12f512=_[_0xd3a2('0x42')]({},_0x12f512,_0x34060d[_0xd3a2('0x43')]);return db['ChatMessage'][_0xd3a2('0x21')]({'where':_0x12f512[_0xd3a2('0x9f')]})[_0xd3a2('0x14')](function(_0x106e7b){_0x2f9b01[_0xd3a2('0x21')]=_0x106e7b;_0x12f512[_0xd3a2('0x41')]=[];if(_0x34060d['query'][_0xd3a2('0xa7')]){_0x12f512['include'][_0xd3a2('0xa8')]({'model':db['User'],'as':'User','attributes':['id',_0xd3a2('0x4f'),'alias']});}if(_0x34060d[_0xd3a2('0x34')][_0xd3a2('0x40')]){_0x12f512['include']=[{'all':!![]}];}return db[_0xd3a2('0x7a')][_0xd3a2('0x32')](_0x12f512);})['then'](function(_0x3a62a6){_0x2f9b01[_0xd3a2('0xa9')]=_0x3a62a6;return _0x2f9b01;});}})[_0xd3a2('0x14')](respondWithFilteredResult(_0x48dc64,_0x12f512))['catch'](handleError(_0x48dc64,null));};exports[_0xd3a2('0xaa')]=function(_0x37f23d,_0x3638dc){return db[_0xd3a2('0x3a')][_0xd3a2('0x47')]({'where':{'id':_0x37f23d[_0xd3a2('0x37')]['id']}})[_0xd3a2('0x14')](handleEntityNotFound(_0x3638dc,null))[_0xd3a2('0x14')](function(_0x50e43c){if(_0x50e43c){return _0x50e43c['setTags'](_0x37f23d[_0xd3a2('0x45')][_0xd3a2('0x98')],_[_0xd3a2('0x99')](_0x37f23d[_0xd3a2('0x45')],[_0xd3a2('0x98'),'id'])||{})[_0xd3a2('0xab')](function(){return db[_0xd3a2('0xac')][_0xd3a2('0x32')]({'attributes':['id',_0xd3a2('0x28'),_0xd3a2('0xad')],'where':{'id':_0x37f23d[_0xd3a2('0x45')][_0xd3a2('0x98')]}});})[_0xd3a2('0x14')](function(_0x1e9b25){socket[_0xd3a2('0xae')]('chatInteractionTags:save',{'id':Number(_0x37f23d['params']['id']),'tags':_0x1e9b25||[]});return{'id':Number(_0x37f23d['params']['id']),'tags':_0x1e9b25||[]};});}})[_0xd3a2('0x14')](respondWithResult(_0x3638dc,null))[_0xd3a2('0x36')](handleError(_0x3638dc,null));};exports[_0xd3a2('0xaf')]=function(_0x1569a3,_0x1b2995){return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x1569a3[_0xd3a2('0x37')]['id']}})['then'](handleEntityNotFound(_0x1b2995,null))[_0xd3a2('0x14')](function(_0x26db4b){if(_0x26db4b){return _0x26db4b['removeTags'](_0x1569a3[_0xd3a2('0x34')][_0xd3a2('0x98')]);}})[_0xd3a2('0x14')](respondWithStatusCode(_0x1b2995,null))[_0xd3a2('0x36')](handleError(_0x1b2995,null));};exports[_0xd3a2('0x72')]=function(_0x5e9266,_0x1cb4ae){var _0x1a8cfd=moment()[_0xd3a2('0xb0')]()[_0xd3a2('0xb1')]();var _0x130e6a=path['join'](config[_0xd3a2('0x70')],'server',_0xd3a2('0xb2'),'tmp');var _0xe25068=path['join'](config[_0xd3a2('0x70')],_0xd3a2('0xb3'),'files',_0xd3a2('0xb4'));var _0xd7612e=path[_0xd3a2('0x6f')](_0x130e6a,_0x1a8cfd);var _0x7a7737=util[_0xd3a2('0x76')](_0xd3a2('0xb5'),_0x5e9266[_0xd3a2('0x37')]['id'],_0x1a8cfd);var _0x8cb96f=path['join'](_0x130e6a,_0x7a7737);var _0x2562a0=[];_0x2562a0['push']({'model':db[_0xd3a2('0x7b')],'as':_0xd3a2('0x7b'),'attributes':['id',_0xd3a2('0x4f')],'raw':!![]});_0x2562a0[_0xd3a2('0xa8')]({'model':db[_0xd3a2('0x7d')],'as':_0xd3a2('0x5e'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x5e9266[_0xd3a2('0x34')][_0xd3a2('0xb4')]){_0x2562a0[_0xd3a2('0xa8')]({'model':db[_0xd3a2('0x6c')],'as':_0xd3a2('0x6c'),'raw':!![]});}var _0x27b020=[{'model':db[_0xd3a2('0x7a')],'as':_0xd3a2('0x7f'),'attributes':['id',_0xd3a2('0x45'),_0xd3a2('0xb6'),_0xd3a2('0x8e'),_0xd3a2('0xb7'),_0xd3a2('0xb8')],'include':_0x2562a0}];_0x27b020['push']({'model':db[_0xd3a2('0x4b')],'as':_0xd3a2('0xb9'),'attributes':['id','name']});_0x27b020[_0xd3a2('0xa8')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd3a2('0x4f')]});return db[_0xd3a2('0x3a')]['find']({'where':{'id':_0x5e9266[_0xd3a2('0x37')]['id']},'include':_0x27b020})[_0xd3a2('0x14')](handleEntityNotFound(_0x1cb4ae,null))[_0xd3a2('0x14')](function(_0x263f61){if(_0x263f61){var _0x178605=_0x263f61[_0xd3a2('0xba')]({'plain':!![]});fs[_0xd3a2('0xbb')](_0xd7612e);var _0x3d687b={'channel':_0xd3a2('0xbc'),'account':_0x178605['Account']['name'],'agent':_0x178605['Owner']?_0x178605[_0xd3a2('0xbd')][_0xd3a2('0x4f')]:_0xd3a2('0xbe'),'createdAt':moment(_0x178605[_0xd3a2('0xb6')])[_0xd3a2('0x76')](_0xd3a2('0xa5'))[_0xd3a2('0xb1')](),'closedAt':_0x178605[_0xd3a2('0x62')]?moment(_0x178605[_0xd3a2('0xbf')])['format'](_0xd3a2('0xa5'))['toString']():'','disposition':_0x178605[_0xd3a2('0xc0')],'chatInfo':{'browser':_0x178605['browserName'],'os':_0x178605[_0xd3a2('0xc1')],'referer':_0x178605['referer'],'customerIp':_0x178605[_0xd3a2('0xc2')],'customerPort':_0x178605[_0xd3a2('0xc3')]?_0x178605[_0xd3a2('0xc3')]:_0xd3a2('0xbe')},'messages':_(_0x178605[_0xd3a2('0x7f')])[_0xd3a2('0xc4')]()[_0xd3a2('0xa2')]({'secret':![]})[_0xd3a2('0x2f')](function(_0x22a116){if(_0x22a116[_0xd3a2('0x6c')]){var _0x4d0dad=path[_0xd3a2('0x6f')](_0xe25068,_0x22a116['Attachment']['basename']);if(fs[_0xd3a2('0xc5')](_0x4d0dad)){fs[_0xd3a2('0xc6')](_0x4d0dad)['pipe'](fs['createWriteStream'](path[_0xd3a2('0x6f')](_0xd7612e,_0x22a116['Attachment'][_0xd3a2('0x66')])));}}return{'date':moment(_0x22a116['createdAt'])[_0xd3a2('0x76')](_0xd3a2('0xa5'))[_0xd3a2('0xb1')](),'sender':_0x22a116[_0xd3a2('0x8e')]==='out'?_0x22a116['User']?_0x22a116[_0xd3a2('0x7b')]['fullname']:_0xd3a2('0x83'):_0x22a116[_0xd3a2('0x5e')][_0xd3a2('0xc7')]+(_0x22a116[_0xd3a2('0x5e')]['lastName']?'\x20'+_0x22a116['Contact'][_0xd3a2('0xc8')]:''),'body':_0x22a116[_0xd3a2('0x6c')]?_0x22a116[_0xd3a2('0x6c')][_0xd3a2('0x66')]:_0x22a116['body'],'direction':_0x22a116[_0xd3a2('0x8e')]===_0xd3a2('0xc9')?'A':'C','secret':_0x22a116[_0xd3a2('0xb7')],'read':_0x22a116[_0xd3a2('0xb8')],'attachment':_0x22a116[_0xd3a2('0x6c')]};})[_0xd3a2('0xca')]()};return ejs[_0xd3a2('0xcb')](path[_0xd3a2('0x6f')](config[_0xd3a2('0x70')],_0xd3a2('0xb3'),_0xd3a2('0xcc'),_0xd3a2('0xcd')),{'interaction':_0x3d687b})[_0xd3a2('0x14')](function(_0xdac1d3){var _0xbde4a8=path['join'](_0xd7612e,_0xd3a2('0xce')+_0x178605['id']+'-'+_0x1a8cfd+_0xd3a2('0xcf'));var _0x150d07={'path':_0xbde4a8,'channel':'Chat','interactionId':_0x178605['id']};return pdf[_0xd3a2('0xd0')](_0xdac1d3,_0x150d07);})['then'](function(){return new Promise(function(_0x59ed47,_0x5b4076){zipdir(_0xd7612e,{'saveTo':_0x8cb96f},function(_0x13283a,_0x4b9e70){if(_0x13283a)return _0x5b4076(_0x13283a);return _0x59ed47(_0x4b9e70);});})[_0xd3a2('0x14')](function(){return new BPromise(function(_0x3d8176,_0x4141d3){rimraf(_0xd7612e,function(_0x3c1df5){if(_0x3c1df5)_0x4141d3(_0x3c1df5);return _0x3d8176();});});})[_0xd3a2('0x14')](function(){return _0x1cb4ae[_0xd3a2('0x72')](_0x8cb96f,_0x7a7737,function(_0x3c84d9){if(_0x3c84d9){logger['error'](_0xd3a2('0xd1'),_0x3c84d9);}else{fs['unlinkSync'](_0x8cb96f);}});});});}else{return _0x1cb4ae[_0xd3a2('0x1d')](0xc8);}})['catch'](handleError(_0x1cb4ae,null));}; \ No newline at end of file +var _0x6e8f=['ChatInteraction','rawAttributes','fieldName','type','key','getOptions','chat','query','user','show','params','model','keys','attributes','fields','length','includeAll','options','create','update','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','Messages','User','ChatWebsiteId','ContactId','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','intersection','hasOwnProperty','nolimit','order','sort','where','filters','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','secret','includeAgent','push','alias','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','unix','toString','server','files','CmContact','lastName','Account','mkdirSync','Chat','Owner','N.A.','osName','referer','customerIp','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','.pdf','err','unlinkSync','rimraf','request-promise','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','destroy','stack','name','send','render','merge','body','contact','agent','interaction','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e8f,0x16f));var _0xf6e8=function(_0xf0ebae,_0x4c6b6f){_0xf0ebae=_0xf0ebae-0x0;var _0x2588ff=_0x6e8f[_0xf0ebae];return _0x2588ff;};'use strict';var rimraf=require(_0xf6e8('0x0'));var zipdir=require('zip-dir');var rp=require(_0xf6e8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6e8('0x2'));var path=require(_0xf6e8('0x3'));var ejs=require(_0xf6e8('0x4'));var fs=require('fs');var _=require(_0xf6e8('0x5'));var Redis=require(_0xf6e8('0x6'));var interaction=require(_0xf6e8('0x7'));var qs=require(_0xf6e8('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xf6e8('0x9'))(_0xf6e8('0xa'));var config=require(_0xf6e8('0xb'));var db=require(_0xf6e8('0xc'))['db'];config['redis']=_['defaults'](config[_0xf6e8('0xd')],{'host':_0xf6e8('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6e8('0xd')]));require(_0xf6e8('0xf'))[_0xf6e8('0x10')](socket);var jayson=require(_0xf6e8('0x11'));var client=jayson['client'][_0xf6e8('0x12')]({'port':0x232b});var client9004=jayson['client'][_0xf6e8('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x1a882b,_0x2805e6,_0x2465b0,_0x44b71f){return new BPromise(function(_0x51cd0a,_0x5ab3d2){var _0x492984=_0x44b71f||client;return _0x492984[_0xf6e8('0x13')](_0x1a882b,_0x2465b0)[_0xf6e8('0x14')](function(_0x4d2fbf){logger[_0xf6e8('0x15')](_0xf6e8('0x16'),_0x2805e6,'request\x20sent');logger[_0xf6e8('0x17')](_0xf6e8('0x18'),_0x2805e6,_0xf6e8('0x19'),JSON[_0xf6e8('0x1a')](_0x4d2fbf));if(_0x4d2fbf['error']){if(_0x4d2fbf['error']['code']===0x1f4){logger[_0xf6e8('0x1b')](_0xf6e8('0x16'),_0x2805e6,_0x4d2fbf['error'][_0xf6e8('0x1c')]);return _0x5ab3d2(_0x4d2fbf['error'][_0xf6e8('0x1c')]);}logger[_0xf6e8('0x1b')](_0xf6e8('0x16'),_0x2805e6,_0x4d2fbf['error'][_0xf6e8('0x1c')]);return _0x51cd0a(_0x4d2fbf[_0xf6e8('0x1b')][_0xf6e8('0x1c')]);}else{logger[_0xf6e8('0x15')](_0xf6e8('0x16'),_0x2805e6,'request\x20sent');_0x51cd0a(_0x4d2fbf['result'][_0xf6e8('0x1c')]);}})[_0xf6e8('0x1d')](function(_0x3ce618){logger[_0xf6e8('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x2805e6,_0x3ce618);_0x5ab3d2(_0x3ce618);});});}function respondWithStatusCode(_0xc45546,_0x107138){_0x107138=_0x107138||0xcc;return function(_0x42dabd){if(_0x42dabd){return _0xc45546[_0xf6e8('0x1e')](_0x107138);}return _0xc45546[_0xf6e8('0x1f')](_0x107138)[_0xf6e8('0x20')]();};}function respondWithResult(_0x223d37,_0x2e33cf){_0x2e33cf=_0x2e33cf||0xc8;return function(_0x1cf75d){if(_0x1cf75d){return _0x223d37[_0xf6e8('0x1f')](_0x2e33cf)[_0xf6e8('0x21')](_0x1cf75d);}};}function respondWithFilteredResult(_0x4a55f8,_0x38376f){return function(_0x742f22){if(_0x742f22){var _0x26536e=typeof _0x38376f['offset']===_0xf6e8('0x22')&&typeof _0x38376f[_0xf6e8('0x23')]===_0xf6e8('0x22');var _0x4d257f=_0x742f22['count'];var _0x1c7a9a=_0x26536e?0x0:_0x38376f[_0xf6e8('0x24')];var _0x4ae81c=_0x26536e?_0x742f22[_0xf6e8('0x25')]:_0x38376f['offset']+_0x38376f[_0xf6e8('0x23')];var _0x55100d;if(_0x4ae81c>=_0x4d257f){_0x4ae81c=_0x4d257f;_0x55100d=0xc8;}else{_0x55100d=0xce;}_0x4a55f8[_0xf6e8('0x1f')](_0x55100d);return _0x4a55f8[_0xf6e8('0x26')]('Content-Range',_0x1c7a9a+'-'+_0x4ae81c+'/'+_0x4d257f)[_0xf6e8('0x21')](_0x742f22);}return null;};}function saveUpdates(_0x29dcae){return function(_0x1e0265){if(_0x1e0265){return _0x1e0265['update'](_0x29dcae)[_0xf6e8('0x14')](function(_0x310ce7){return _0x310ce7;});}return null;};}function removeEntity(_0x1d9349){return function(_0xb0fe0e){if(_0xb0fe0e){return _0xb0fe0e[_0xf6e8('0x27')]()[_0xf6e8('0x14')](function(){_0x1d9349['status'](0xcc)[_0xf6e8('0x20')]();});}};}function handleEntityNotFound(_0x3c7730){return function(_0x1acc32){if(!_0x1acc32){_0x3c7730[_0xf6e8('0x1e')](0x194);}return _0x1acc32;};}function handleError(_0x3cb002,_0x28e966){_0x28e966=_0x28e966||0x1f4;return function(_0x4487f4){logger['error'](_0x4487f4[_0xf6e8('0x28')]);if(_0x4487f4[_0xf6e8('0x29')]){delete _0x4487f4['name'];}_0x3cb002[_0xf6e8('0x1f')](_0x28e966)[_0xf6e8('0x2a')](_0x4487f4);};}function getMustacheRender(_0xf34fea,_0xaa9867){return Mustache[_0xf6e8('0x2b')](_0xf34fea,_[_0xf6e8('0x2c')](_0xaa9867[_0xf6e8('0x2d')],{'contact':_0xaa9867[_0xf6e8('0x2e')],'message':_0xaa9867[_0xf6e8('0x1c')],'agent':_0xaa9867[_0xf6e8('0x2f')],'interaction':_0xaa9867[_0xf6e8('0x30')],'account':_0xaa9867['account']}))||'';}exports[_0xf6e8('0x31')]=function(_0xe978a2,_0x4b054d){var _0x532192={};var _0x551f05=_[_0xf6e8('0x32')](db[_0xf6e8('0x33')][_0xf6e8('0x34')],function(_0x3e7df1){return{'name':_0x3e7df1[_0xf6e8('0x35')],'type':_0x3e7df1[_0xf6e8('0x36')][_0xf6e8('0x37')]};});_0x532192=qs[_0xf6e8('0x38')](_0x551f05,_0xe978a2);return interaction['findAll'](_0xf6e8('0x39'),_0xe978a2[_0xf6e8('0x3a')],_0xe978a2[_0xf6e8('0x3b')],_0x532192,_0x551f05)[_0xf6e8('0x14')](respondWithFilteredResult(_0x4b054d,_0x532192))['catch'](handleError(_0x4b054d,null));};exports[_0xf6e8('0x3c')]=function(_0x42c844,_0x3363cb){var _0x6194dc={'raw':![],'where':{'id':_0x42c844[_0xf6e8('0x3d')]['id']}},_0x187a5d={};_0x187a5d[_0xf6e8('0x3e')]=_[_0xf6e8('0x3f')](db[_0xf6e8('0x33')][_0xf6e8('0x34')]);_0x187a5d[_0xf6e8('0x3a')]=_[_0xf6e8('0x3f')](_0x42c844[_0xf6e8('0x3a')]);_0x187a5d['filters']=_['intersection'](_0x187a5d[_0xf6e8('0x3e')],_0x187a5d['query']);_0x6194dc[_0xf6e8('0x40')]=_['intersection'](_0x187a5d[_0xf6e8('0x3e')],qs['fields'](_0x42c844['query'][_0xf6e8('0x41')]));_0x6194dc['attributes']=_0x6194dc[_0xf6e8('0x40')][_0xf6e8('0x42')]?_0x6194dc['attributes']:_0x187a5d[_0xf6e8('0x3e')];if(_0x42c844[_0xf6e8('0x3a')][_0xf6e8('0x43')]){_0x6194dc['include']=[{'all':!![]}];}_0x6194dc=_[_0xf6e8('0x2c')]({},_0x6194dc,_0x42c844[_0xf6e8('0x44')]);return db[_0xf6e8('0x33')]['find'](_0x6194dc)[_0xf6e8('0x14')](handleEntityNotFound(_0x3363cb,null))[_0xf6e8('0x14')](respondWithResult(_0x3363cb,null))[_0xf6e8('0x1d')](handleError(_0x3363cb,null));};exports[_0xf6e8('0x45')]=function(_0x1e452d,_0x407a39){return db[_0xf6e8('0x33')][_0xf6e8('0x45')](_0x1e452d[_0xf6e8('0x2d')],{})[_0xf6e8('0x14')](respondWithResult(_0x407a39,0xc9))[_0xf6e8('0x1d')](handleError(_0x407a39,null));};exports[_0xf6e8('0x46')]=function(_0x5a3c27,_0xcbfa86){if(_0x5a3c27['body']['id']){delete _0x5a3c27[_0xf6e8('0x2d')]['id'];}return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x5a3c27[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0xcbfa86,null))['then'](saveUpdates(_0x5a3c27[_0xf6e8('0x2d')],null))[_0xf6e8('0x14')](respondWithResult(_0xcbfa86,null))['catch'](handleError(_0xcbfa86,null));};exports[_0xf6e8('0x27')]=function(_0x52ea89,_0x12e507){return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x52ea89['params']['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x12e507,null))['then'](removeEntity(_0x12e507,null))[_0xf6e8('0x1d')](handleError(_0x12e507,null));};exports[_0xf6e8('0x48')]=function(_0x8e501a,_0x30570c){return db[_0xf6e8('0x33')]['describe']()[_0xf6e8('0x14')](respondWithResult(_0x30570c,null))[_0xf6e8('0x1d')](handleError(_0x30570c,null));};exports[_0xf6e8('0x49')]=function(_0x50fa7a,_0x3c008f){var _0x217bc8=_0x50fa7a[_0xf6e8('0x3d')]['id'];var _0xcda1ad;var _0x5dc90b;var _0x3c8ec2;return db['ChatInteraction'][_0xf6e8('0x4a')]({'where':{'id':_0x217bc8}})[_0xf6e8('0x14')](function(_0x2f9ee0){_0xcda1ad=_0x2f9ee0;return db[_0xf6e8('0x4b')][_0xf6e8('0x4a')]({'where':{'id':_0x2f9ee0['ChatWebsiteId']},'attributes':['id',_0xf6e8('0x4c'),_0xf6e8('0x4d'),'vidaooTopic',_0xf6e8('0x4e'),'vidaooMetadata'],'raw':!![]});})[_0xf6e8('0x14')](function(_0x9d9a34){if(_0x9d9a34&&_0x9d9a34[_0xf6e8('0x4c')]&&_0x9d9a34['vidaooEscalation']){_0x5dc90b=_0x9d9a34;var _0x1ee590={'interaction':{'id':_0x217bc8},'agent':{'id':_0x50fa7a[_0xf6e8('0x3b')]['id'],'name':_0x50fa7a[_0xf6e8('0x3b')][_0xf6e8('0x29')],'fullname':_0x50fa7a[_0xf6e8('0x3b')]['fullname'],'email':_0x50fa7a[_0xf6e8('0x3b')][_0xf6e8('0x4f')]},'contact':_0x50fa7a[_0xf6e8('0x2d')]['contact'],'account':_0x50fa7a[_0xf6e8('0x2d')][_0xf6e8('0x50')]};var _0x396845={'rejectUnauthorized':![],'method':_0xf6e8('0x51'),'url':_0xf6e8('0x52'),'headers':{'X-APIKEY':_0x9d9a34[_0xf6e8('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x50fa7a[_0xf6e8('0x3b')][_0xf6e8('0x4f')]],'buttons':null,'topic':_0x5dc90b[_0xf6e8('0x53')],'note':_[_0xf6e8('0x54')](_0x5dc90b['vidaooNote'])?null:getMustacheRender(_0x5dc90b['vidaooNote'],_0x1ee590),'metadata':null},'redirect':_0xf6e8('0x55'),'json':!![]};try{if(!_[_0xf6e8('0x54')](_0x5dc90b[_0xf6e8('0x56')])){var _0x342aeb=getMustacheRender(_0x5dc90b[_0xf6e8('0x56')],_0x1ee590);var _0x42f536=JSON[_0xf6e8('0x57')](_0x342aeb);_0x396845[_0xf6e8('0x2d')][_0xf6e8('0x58')]=_0x42f536;}}catch(_0x23ec6f){throw new db[(_0xf6e8('0x59'))][(_0xf6e8('0x5a'))](_0xf6e8('0x5b'));}return rp(_0x396845);}else{throw new db[(_0xf6e8('0x59'))]['ValidationError'](_0xf6e8('0x5c'));}})['then'](function(_0xa80fc1){_0x3c8ec2=_0xa80fc1;if(_0x3c8ec2['id']){var _0xa5adaf={'body':_0x3c8ec2[_0xf6e8('0x5d')],'ChatWebsiteId':_0x5dc90b['id'],'ChatInteractionId':_0xcda1ad['id'],'direction':_0xf6e8('0x5e'),'UserId':_0x50fa7a['user']['id']};return db[_0xf6e8('0x5f')][_0xf6e8('0x45')](_0xa5adaf,{});}else{throw new db[(_0xf6e8('0x59'))][(_0xf6e8('0x5a'))](_0xf6e8('0x60'));}})[_0xf6e8('0x14')](function(){return _0xcda1ad[_0xf6e8('0x61')]({'vidaooSessionId':_0x3c8ec2['id']});})[_0xf6e8('0x14')](respondWithResult(_0x3c008f,null))[_0xf6e8('0x1d')](handleError(_0x3c008f,null));};exports[_0xf6e8('0x62')]=function(_0x511bb2,_0x270812){if(_0x511bb2['body']['id']){delete _0x511bb2[_0xf6e8('0x2d')]['id'];}return db[_0xf6e8('0x33')]['find']({'where':{'id':_0x511bb2[_0xf6e8('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xf6e8('0x63')}]})[_0xf6e8('0x14')](handleEntityNotFound(_0x270812,null))[_0xf6e8('0x14')](saveUpdates(_0x511bb2[_0xf6e8('0x2d')],null))[_0xf6e8('0x14')](respondWithResult(_0x270812,null))[_0xf6e8('0x1d')](handleError(_0x270812,null));};exports[_0xf6e8('0x64')]=function(_0x797d9f,_0x192dca){if(_0x797d9f[_0xf6e8('0x2d')]['id']){delete _0x797d9f[_0xf6e8('0x2d')]['id'];}return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x797d9f[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](function(_0x4a6908){if(!_0x4a6908){logger['error'](_0xf6e8('0x65'),_0xf6e8('0x64'),0x194,_0xf6e8('0x66'));_0x192dca[_0xf6e8('0x1e')](0x194);}else{if(_0x4a6908[_0xf6e8('0x67')]){throw new db['Sequelize'][(_0xf6e8('0x5a'))](_0xf6e8('0x68'));}}return _0x4a6908;})[_0xf6e8('0x14')](function(_0x4e1359){if(_0x4e1359){return _0x4e1359[_0xf6e8('0x46')]({'closed':_0x797d9f[_0xf6e8('0x2d')][_0xf6e8('0x69')],'disposition':_0x797d9f['body'][_0xf6e8('0x6a')]})[_0xf6e8('0x14')](function(_0x2eceac){return _0x2eceac;});}})[_0xf6e8('0x14')](function(){return respondWithRpcPromise(_0xf6e8('0x6b'),_0xf6e8('0x64'),_0x797d9f[_0xf6e8('0x2d')],client9004);})[_0xf6e8('0x14')](respondWithResult(_0x192dca,null))['catch'](handleError(_0x192dca,null));};exports[_0xf6e8('0x6c')]=function(_0x15a0b0,_0x16a84a){_0x15a0b0[_0xf6e8('0x2d')][_0xf6e8('0x29')]=_0x15a0b0['file']['originalname'];_0x15a0b0[_0xf6e8('0x2d')][_0xf6e8('0x6d')]=_0x15a0b0[_0xf6e8('0x6e')][_0xf6e8('0x6f')];_0x15a0b0[_0xf6e8('0x2d')][_0xf6e8('0x36')]=_0x15a0b0[_0xf6e8('0x6e')][_0xf6e8('0x70')];return db[_0xf6e8('0x71')][_0xf6e8('0x45')](_0x15a0b0[_0xf6e8('0x2d')])['then'](respondWithResult(_0x16a84a,0xc9))[_0xf6e8('0x1d')](handleError(_0x16a84a,null));};exports[_0xf6e8('0x72')]=function(_0x2f61e8,_0x593718){return db[_0xf6e8('0x33')][_0xf6e8('0x4a')]({'where':{'id':_0x2f61e8[_0xf6e8('0x3d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x593718,null))['then'](function(_0x487cd3){if(_0x487cd3){if(_0x487cd3[_0xf6e8('0x69')]){return _0x593718[_0xf6e8('0x1f')](0x193)[_0xf6e8('0x21')]({'status':0x193,'message':_0xf6e8('0x73')});}return db[_0xf6e8('0x71')]['findOne']({'where':{'id':_0x2f61e8[_0xf6e8('0x3a')]['attachId']},'raw':!![]})[_0xf6e8('0x14')](handleEntityNotFound(_0x593718,null));}})[_0xf6e8('0x14')](function(_0x109b4c){if(_0x109b4c){var _0xe59481=_0x109b4c['ChatOfflineMessageId']!==null;var _0x12a615=path[_0xf6e8('0x74')](config['root'],_0xf6e8('0x75'));if(_0xe59481){_0x12a615=path['join'](_0x12a615,_0xf6e8('0x76'));}var _0x5c7dce=path['join'](_0x12a615,_0x109b4c[_0xf6e8('0x6d')]);return _0x593718[_0xf6e8('0x77')](_0x5c7dce);}})[_0xf6e8('0x1d')](handleError(_0x593718,null));};exports[_0xf6e8('0x78')]=function(_0x307b96,_0x32b671){var _0x516fd4=null;var _0x5dd13c=null;var _0x299a93=null;if(_0x307b96[_0xf6e8('0x2d')]['id']){delete _0x307b96[_0xf6e8('0x2d')]['id'];}if(_0x307b96['body'][_0xf6e8('0x79')]){_0x299a93=path[_0xf6e8('0x74')](config[_0xf6e8('0x7a')],_0xf6e8('0x7b'),util['format'](_0xf6e8('0x7c'),Date[_0xf6e8('0x7d')]()));_0x307b96[_0xf6e8('0x2d')]['pathTranscript']=_0x299a93;}return db[_0xf6e8('0x33')]['find']({'where':{'id':_0x307b96['params']['id']},'include':[{'model':db[_0xf6e8('0x5f')],'as':_0xf6e8('0x7e'),'include':[{'model':db[_0xf6e8('0x7f')],'as':_0xf6e8('0x7f')}]}]})['then'](handleEntityNotFound(_0x32b671,null))[_0xf6e8('0x14')](saveUpdates(_0x307b96[_0xf6e8('0x2d')],null))[_0xf6e8('0x14')](function(_0x38b131){if(_0x38b131){_0x516fd4=_0x38b131;return db[_0xf6e8('0x4b')][_0xf6e8('0x47')]({'where':{'id':_0x516fd4[_0xf6e8('0x80')]}});}})['then'](function(_0x1569cc){if(_0x1569cc){_0x5dd13c=_0x1569cc;return db['CmContact'][_0xf6e8('0x47')]({'where':{'id':_0x516fd4[_0xf6e8('0x81')]}});}})['then'](function(_0x3edcf2){if(_0x3edcf2){if(_0x299a93){var _0x2d8767=null;for(var _0x2dba89=0x1;_0x2dba89<_0x516fd4[_0xf6e8('0x7e')][_0xf6e8('0x42')];++_0x2dba89){_0x2d8767=_0x516fd4['Messages'][_0x2dba89];var _0x4729b9=_0x2d8767['UserId']?util[_0xf6e8('0x82')]('%s%d',_0x5dd13c[_0xf6e8('0x83')],_0x2d8767[_0xf6e8('0x67')]):_0xf6e8('0x84');var _0x4fe4f8=_0x307b96[_0xf6e8('0x2d')][_0xf6e8('0x85')]||util['format'](_0xf6e8('0x86'),_0xf6e8('0x87'),_0x2d8767[_0xf6e8('0x81')]);switch(_0x5dd13c[_0xf6e8('0x88')]){case _0xf6e8('0x89'):_0x4729b9=_0x2d8767['UserId']?util[_0xf6e8('0x82')](_0xf6e8('0x86'),_0x5dd13c[_0xf6e8('0x83')],_0x2d8767[_0xf6e8('0x67')]):'System';break;case _0xf6e8('0x8a'):_0x4729b9=_0x2d8767[_0xf6e8('0x67')]?_0x2d8767[_0xf6e8('0x7f')]['alias']||_0x2d8767[_0xf6e8('0x7f')][_0xf6e8('0x8b')]:_0xf6e8('0x84');break;case _0xf6e8('0x8c'):_0x4729b9=_0x2d8767[_0xf6e8('0x67')]?_0x2d8767[_0xf6e8('0x7f')][_0xf6e8('0x8b')]:_0xf6e8('0x84');break;default:_0x4729b9=_0x2d8767[_0xf6e8('0x67')]?util['format'](_0xf6e8('0x86'),_0x5dd13c[_0xf6e8('0x83')],_0x2d8767['UserId']):'System';}var _0x45a3fb=util[_0xf6e8('0x82')](_0xf6e8('0x8d'),moment(_0x2d8767[_0xf6e8('0x8e')])[_0xf6e8('0x82')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2d8767[_0xf6e8('0x8f')]==='in'?_0x4fe4f8:_0x4729b9,_0x2d8767['body']);if(!_0x2d8767['secret']){fs[_0xf6e8('0x90')](_0x299a93,_0x45a3fb);}}return db[_0xf6e8('0x91')][_0xf6e8('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xf6e8('0x92')],'as':_0xf6e8('0x93'),'raw':!![],'include':[{'model':db[_0xf6e8('0x94')],'as':_0xf6e8('0x94'),'raw':!![]}]}]});}}})['then'](function(_0x3db798){if(!_0x3db798||!_0x3db798[_0xf6e8('0x93')]||!_0x307b96[_0xf6e8('0x2d')])return _0x516fd4;var _0x38a3f1=_0x3db798[_0xf6e8('0x95')]();return respondWithRpcPromise(_0xf6e8('0x96'),_0xf6e8('0x97'),{'account':_0x38a3f1,'message':{'from':util[_0xf6e8('0x82')](_0xf6e8('0x98'),_0x3db798[_0xf6e8('0x29')],_0x3db798[_0xf6e8('0x4f')]||_0x3db798[_0xf6e8('0x93')][_0xf6e8('0x3b')]),'to':_0x307b96[_0xf6e8('0x2d')]['mailTranscript'],'subject':_0xf6e8('0x99'),'text':util[_0xf6e8('0x82')](_0xf6e8('0x9a'),_0x307b96['body'][_0xf6e8('0x79')]),'attachments':[{'path':_0x299a93}]}})[_0xf6e8('0x14')](function(){return _0x516fd4;})[_0xf6e8('0x1d')](function(_0x37e9ae){logger['error'](_0x37e9ae);});})[_0xf6e8('0x14')](respondWithStatusCode(_0x32b671,0xc8))['catch'](handleError(_0x32b671,null));};exports[_0xf6e8('0x9b')]=function(_0x2c8ace,_0x2014e6){return db[_0xf6e8('0x5f')]['find']({'where':{'id':_0x2c8ace[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x2014e6,null))[_0xf6e8('0x14')](function(_0x4a242d){if(_0x4a242d){return _0x4a242d['addMessage'](_0x2c8ace[_0xf6e8('0x2d')][_0xf6e8('0x9c')],_['omit'](_0x2c8ace['body'],['ids','id'])||{});}})[_0xf6e8('0x14')](respondWithResult(_0x2014e6,null))[_0xf6e8('0x1d')](handleError(_0x2014e6,null));};exports['getMessages']=function(_0x2caa89,_0x451ea7){var _0x213a07={'raw':![],'where':{}};var _0x5ee162={};var _0x122a00={'count':0x0,'rows':[]};return db[_0xf6e8('0x33')]['findOne']({'where':{'id':_0x2caa89['params']['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x451ea7,null))['then'](function(_0x52d113){if(_0x52d113){_0x5ee162[_0xf6e8('0x3e')]=_[_0xf6e8('0x3f')](db[_0xf6e8('0x5f')][_0xf6e8('0x34')]);_0x5ee162[_0xf6e8('0x3a')]=_['keys'](_0x2caa89[_0xf6e8('0x3a')]);_0x5ee162['filters']=_[_0xf6e8('0x9d')](_0x5ee162[_0xf6e8('0x3e')],_0x5ee162[_0xf6e8('0x3a')]);_0x213a07[_0xf6e8('0x40')]=_[_0xf6e8('0x9d')](_0x5ee162[_0xf6e8('0x3e')],qs['fields'](_0x2caa89['query'][_0xf6e8('0x41')]));_0x213a07['attributes']=_0x213a07[_0xf6e8('0x40')][_0xf6e8('0x42')]?_0x213a07['attributes']:_0x5ee162[_0xf6e8('0x3e')];if(!_0x2caa89[_0xf6e8('0x3a')][_0xf6e8('0x9e')](_0xf6e8('0x9f'))){_0x213a07[_0xf6e8('0x23')]=qs[_0xf6e8('0x23')](_0x2caa89[_0xf6e8('0x3a')]['limit']);_0x213a07[_0xf6e8('0x24')]=qs[_0xf6e8('0x24')](_0x2caa89[_0xf6e8('0x3a')][_0xf6e8('0x24')]);}_0x213a07[_0xf6e8('0xa0')]=qs[_0xf6e8('0xa1')](_0x2caa89[_0xf6e8('0x3a')]['sort']);_0x213a07[_0xf6e8('0xa2')]=qs[_0xf6e8('0xa3')](_[_0xf6e8('0xa4')](_0x2caa89[_0xf6e8('0x3a')],_0x5ee162[_0xf6e8('0xa3')]));_0x213a07[_0xf6e8('0xa2')][_0xf6e8('0xa5')]=_0x52d113['id'];if(_0x2caa89[_0xf6e8('0x3a')][_0xf6e8('0xa6')]){_0x213a07[_0xf6e8('0xa2')]=_['merge'](_0x213a07[_0xf6e8('0xa2')],{'$or':_[_0xf6e8('0x32')](_0x213a07['attributes'],function(_0x7e1ed6){var _0x3a2a5a={};_0x3a2a5a[_0x7e1ed6]={'$like':'%'+_0x2caa89['query'][_0xf6e8('0xa6')]+'%'};return _0x3a2a5a;})});}if(_0x2caa89[_0xf6e8('0x3a')]['$gte']){var _0x597e04=_0x2caa89['query'][_0xf6e8('0xa7')][_0xf6e8('0xa8')](',');var _0x9ae1c3={};_0x9ae1c3[_0x597e04[0x0]]={'$gte':moment(_0x597e04[0x1])['format'](_0xf6e8('0xa9'))};_0x213a07['where']=_['merge'](_0x213a07['where'],_0x9ae1c3);}_0x213a07=_['merge']({},_0x213a07,_0x2caa89[_0xf6e8('0x44')]);return db['ChatMessage']['count']({'where':_0x213a07[_0xf6e8('0xa2')]})[_0xf6e8('0x14')](function(_0x1f1903){_0x122a00[_0xf6e8('0x25')]=_0x1f1903;if(_0x2caa89['query']['includeAll']){_0x213a07[_0xf6e8('0xaa')]=[{'all':!![]}];}return db[_0xf6e8('0x5f')][_0xf6e8('0xab')](_0x213a07);})[_0xf6e8('0x14')](function(_0x3440d2){_0x122a00['rows']=_0x3440d2;return _0x122a00;});}})[_0xf6e8('0x14')](respondWithFilteredResult(_0x451ea7,_0x213a07))[_0xf6e8('0x1d')](handleError(_0x451ea7,null));};exports[_0xf6e8('0xac')]=function(_0x2abf38,_0x2ea641){var _0x406ce4={'where':{}},_0x583c7c={},_0xb99f4={'count':0x0,'rows':[]};return db[_0xf6e8('0x33')][_0xf6e8('0x4a')]({'where':{'id':_0x2abf38['params']['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x2ea641,null))['then'](function(_0x2fa6fd){if(_0x2fa6fd){_0x583c7c[_0xf6e8('0x3e')]=_[_0xf6e8('0x3f')](db['ChatMessage'][_0xf6e8('0x34')]);_0x583c7c['query']=_[_0xf6e8('0x3f')](_0x2abf38['query']);_0x583c7c[_0xf6e8('0xa3')]=_['intersection'](_0x583c7c['model'],_0x583c7c['query']);_0x406ce4[_0xf6e8('0x40')]=_[_0xf6e8('0x9d')](_0x583c7c[_0xf6e8('0x3e')],qs['fields'](_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x41')]));_0x406ce4[_0xf6e8('0x40')]=_0x406ce4[_0xf6e8('0x40')][_0xf6e8('0x42')]?_0x406ce4[_0xf6e8('0x40')]:_0x583c7c['model'];if(!_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x9e')](_0xf6e8('0x9f'))){_0x406ce4['limit']=qs[_0xf6e8('0x23')](_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x23')]);_0x406ce4[_0xf6e8('0x24')]=qs['offset'](_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x24')]);}_0x406ce4[_0xf6e8('0xa0')]=qs[_0xf6e8('0xa1')](_0x2abf38['query']['sort']);_0x406ce4[_0xf6e8('0xa2')]=qs['filters'](_[_0xf6e8('0xa4')](_0x2abf38[_0xf6e8('0x3a')],_0x583c7c[_0xf6e8('0xa3')]));_0x406ce4['where'][_0xf6e8('0xa5')]=_0x2fa6fd['id'];if(_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0xa6')]){_0x406ce4[_0xf6e8('0xa2')]=_[_0xf6e8('0x2c')](_0x406ce4[_0xf6e8('0xa2')],{'$or':_[_0xf6e8('0x32')](_0x406ce4[_0xf6e8('0x40')],function(_0x4130a8){var _0x37cc22={};_0x37cc22[_0x4130a8]={'$like':'%'+_0x2abf38[_0xf6e8('0x3a')]['filter']+'%'};return _0x37cc22;})});}_0x406ce4[_0xf6e8('0xa2')][_0xf6e8('0xad')]=![];if(_0x2abf38[_0xf6e8('0x3a')]['id']){_0x406ce4[_0xf6e8('0xa2')]['id']={'$gt':_0x2abf38[_0xf6e8('0x3a')]['id']};}_0x406ce4=_[_0xf6e8('0x2c')]({},_0x406ce4,_0x2abf38['options']);return db['ChatMessage']['count']({'where':_0x406ce4[_0xf6e8('0xa2')]})[_0xf6e8('0x14')](function(_0x4ee5b2){_0xb99f4['count']=_0x4ee5b2;_0x406ce4[_0xf6e8('0xaa')]=[];if(_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0xae')]){_0x406ce4[_0xf6e8('0xaa')][_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x7f')],'as':_0xf6e8('0x7f'),'attributes':['id',_0xf6e8('0x8b'),_0xf6e8('0xb0')]});}if(_0x2abf38[_0xf6e8('0x3a')][_0xf6e8('0x43')]){_0x406ce4['include']=[{'all':!![]}];}return db['ChatMessage'][_0xf6e8('0xab')](_0x406ce4);})[_0xf6e8('0x14')](function(_0x15b28c){_0xb99f4[_0xf6e8('0xb1')]=_0x15b28c;return _0xb99f4;});}})['then'](respondWithFilteredResult(_0x2ea641,_0x406ce4))[_0xf6e8('0x1d')](handleError(_0x2ea641,null));};exports[_0xf6e8('0xb2')]=function(_0x5e486d,_0x3fd7c2){return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x5e486d['params']['id']}})['then'](handleEntityNotFound(_0x3fd7c2,null))[_0xf6e8('0x14')](function(_0x4caae0){if(_0x4caae0){return _0x4caae0[_0xf6e8('0xb3')](_0x5e486d[_0xf6e8('0x2d')]['ids'],_[_0xf6e8('0xb4')](_0x5e486d['body'],[_0xf6e8('0x9c'),'id'])||{})[_0xf6e8('0xb5')](function(){return db[_0xf6e8('0xb6')][_0xf6e8('0xab')]({'attributes':['id',_0xf6e8('0x29'),_0xf6e8('0xb7')],'where':{'id':_0x5e486d[_0xf6e8('0x2d')][_0xf6e8('0x9c')]}});})[_0xf6e8('0x14')](function(_0xfa3772){socket[_0xf6e8('0xb8')]('chatInteractionTags:save',{'id':Number(_0x5e486d[_0xf6e8('0x3d')]['id']),'tags':_0xfa3772||[]});return{'id':Number(_0x5e486d[_0xf6e8('0x3d')]['id']),'tags':_0xfa3772||[]};});}})[_0xf6e8('0x14')](respondWithResult(_0x3fd7c2,null))[_0xf6e8('0x1d')](handleError(_0x3fd7c2,null));};exports['removeTags']=function(_0x20fbc2,_0x5ae839){return db[_0xf6e8('0x33')][_0xf6e8('0x47')]({'where':{'id':_0x20fbc2[_0xf6e8('0x3d')]['id']}})[_0xf6e8('0x14')](handleEntityNotFound(_0x5ae839,null))[_0xf6e8('0x14')](function(_0x1bb33a){if(_0x1bb33a){return _0x1bb33a[_0xf6e8('0xb9')](_0x20fbc2[_0xf6e8('0x3a')][_0xf6e8('0x9c')]);}})[_0xf6e8('0x14')](respondWithStatusCode(_0x5ae839,null))[_0xf6e8('0x1d')](handleError(_0x5ae839,null));};exports[_0xf6e8('0x77')]=function(_0x597e3b,_0x2eecfa){var _0xda9469=moment()[_0xf6e8('0xba')]()[_0xf6e8('0xbb')]();var _0x58f61d=path['join'](config[_0xf6e8('0x7a')],_0xf6e8('0xbc'),_0xf6e8('0xbd'),'tmp');var _0x5c5d40=path[_0xf6e8('0x74')](config[_0xf6e8('0x7a')],'server','files','attachments');var _0x32f7ed=path['join'](_0x58f61d,_0xda9469);var _0x5cc39e=util[_0xf6e8('0x82')]('transcript-%d-%s.zip',_0x597e3b['params']['id'],_0xda9469);var _0x5627d0=path[_0xf6e8('0x74')](_0x58f61d,_0x5cc39e);var _0x683ef1=[];_0x683ef1['push']({'model':db[_0xf6e8('0x7f')],'as':_0xf6e8('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x683ef1[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0xbe')],'as':_0xf6e8('0x63'),'attributes':['id','firstName',_0xf6e8('0xbf')],'raw':!![]});if(_0x597e3b['query']['attachments']){_0x683ef1[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x71')],'as':_0xf6e8('0x71'),'raw':!![]});}var _0x1b43ce=[{'model':db[_0xf6e8('0x5f')],'as':_0xf6e8('0x7e'),'attributes':['id',_0xf6e8('0x2d'),'createdAt',_0xf6e8('0x8f'),_0xf6e8('0xad'),'read'],'include':_0x683ef1}];_0x1b43ce[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x4b')],'as':_0xf6e8('0xc0'),'attributes':['id',_0xf6e8('0x29')]});_0x1b43ce[_0xf6e8('0xaf')]({'model':db[_0xf6e8('0x7f')],'as':'Owner','attributes':['id',_0xf6e8('0x8b')]});return db[_0xf6e8('0x33')]['find']({'where':{'id':_0x597e3b[_0xf6e8('0x3d')]['id']},'include':_0x1b43ce})[_0xf6e8('0x14')](handleEntityNotFound(_0x2eecfa,null))[_0xf6e8('0x14')](function(_0x2fb3fb){if(_0x2fb3fb){var _0x322220=_0x2fb3fb['get']({'plain':!![]});fs[_0xf6e8('0xc1')](_0x32f7ed);var _0x511f22={'channel':_0xf6e8('0xc2'),'account':_0x322220['Account'][_0xf6e8('0x29')],'agent':_0x322220[_0xf6e8('0xc3')]?_0x322220[_0xf6e8('0xc3')][_0xf6e8('0x8b')]:_0xf6e8('0xc4'),'createdAt':moment(_0x322220[_0xf6e8('0x8e')])[_0xf6e8('0x82')](_0xf6e8('0xa9'))[_0xf6e8('0xbb')](),'closedAt':_0x322220[_0xf6e8('0x69')]?moment(_0x322220['closedAt'])[_0xf6e8('0x82')](_0xf6e8('0xa9'))[_0xf6e8('0xbb')]():'','disposition':_0x322220[_0xf6e8('0x6a')],'chatInfo':{'browser':_0x322220['browserName'],'os':_0x322220[_0xf6e8('0xc5')],'referer':_0x322220[_0xf6e8('0xc6')],'customerIp':_0x322220[_0xf6e8('0xc7')],'customerPort':_0x322220['customerPort']?_0x322220['customerPort']:_0xf6e8('0xc4')},'messages':_(_0x322220[_0xf6e8('0x7e')])['tail']()[_0xf6e8('0xa6')]({'secret':![]})[_0xf6e8('0x32')](function(_0x59782e){if(_0x59782e[_0xf6e8('0x71')]){var _0x2c8225=path[_0xf6e8('0x74')](_0x5c5d40,_0x59782e['Attachment'][_0xf6e8('0x6d')]);if(fs[_0xf6e8('0xc8')](_0x2c8225)){fs[_0xf6e8('0xc9')](_0x2c8225)[_0xf6e8('0xca')](fs[_0xf6e8('0xcb')](path[_0xf6e8('0x74')](_0x32f7ed,_0x59782e[_0xf6e8('0x71')][_0xf6e8('0x6d')])));}}return{'date':moment(_0x59782e[_0xf6e8('0x8e')])[_0xf6e8('0x82')](_0xf6e8('0xa9'))['toString'](),'sender':_0x59782e[_0xf6e8('0x8f')]===_0xf6e8('0x5e')?_0x59782e[_0xf6e8('0x7f')]?_0x59782e['User'][_0xf6e8('0x8b')]:_0xf6e8('0x84'):_0x59782e[_0xf6e8('0x63')]['firstName']+(_0x59782e[_0xf6e8('0x63')]['lastName']?'\x20'+_0x59782e['Contact'][_0xf6e8('0xbf')]:''),'body':_0x59782e['Attachment']?_0x59782e[_0xf6e8('0x71')]['basename']:_0x59782e['body'],'direction':_0x59782e[_0xf6e8('0x8f')]==='out'?'A':'C','secret':_0x59782e[_0xf6e8('0xad')],'read':_0x59782e['read'],'attachment':_0x59782e['Attachment']};})[_0xf6e8('0xcc')]()};return ejs[_0xf6e8('0xcd')](path[_0xf6e8('0x74')](config[_0xf6e8('0x7a')],_0xf6e8('0xbc'),'views','downloadInteraction.ejs'),{'interaction':_0x511f22})[_0xf6e8('0x14')](function(_0x15d32f){var _0x14e785=path[_0xf6e8('0x74')](_0x32f7ed,'transcript-'+_0x322220['id']+'-'+_0xda9469+_0xf6e8('0xce'));var _0x166fc0={'path':_0x14e785,'channel':_0xf6e8('0xc2'),'interactionId':_0x322220['id']};return pdf['createPdfFromHTML'](_0x15d32f,_0x166fc0);})['then'](function(){return new Promise(function(_0x3efb1b,_0x1c6439){zipdir(_0x32f7ed,{'saveTo':_0x5627d0},function(_0x2ae667,_0x14cad5){if(_0x2ae667)return _0x1c6439(_0x2ae667);return _0x3efb1b(_0x14cad5);});})[_0xf6e8('0x14')](function(){return new BPromise(function(_0x3abad9,_0x33595a){rimraf(_0x32f7ed,function(_0xfa6e11){if(_0xfa6e11)_0x33595a(_0xfa6e11);return _0x3abad9();});});})[_0xf6e8('0x14')](function(){return _0x2eecfa[_0xf6e8('0x77')](_0x5627d0,_0x5cc39e,function(_0x57ed03){if(_0x57ed03){logger[_0xf6e8('0x1b')](_0xf6e8('0xcf'),_0x57ed03);}else{fs[_0xf6e8('0xd0')](_0x5627d0);}});});});}else{return _0x2eecfa[_0xf6e8('0x1e')](0xc8);}})[_0xf6e8('0x1d')](handleError(_0x2eecfa,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 2235edd..9e6d756 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 _0xa273=['getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove'];(function(_0xf49f22,_0x6ee4cf){var _0x3b7136=function(_0x3b0b22){while(--_0x3b0b22){_0xf49f22['push'](_0xf49f22['shift']());}};_0x3b7136(++_0x6ee4cf);}(_0xa273,0x1e7));var _0x3a27=function(_0x3cb704,_0x24fbb4){_0x3cb704=_0x3cb704-0x0;var _0x216b57=_0xa273[_0x3cb704];return _0x216b57;};'use strict';var EventEmitter=require(_0x3a27('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x3a27('0x1'))['db'][_0x3a27('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3a27('0x3')](0x0);var events={'afterCreate':_0x3a27('0x4'),'afterUpdate':'update','afterDestroy':_0x3a27('0x5')};function emitEvent(_0xee8c89){return function(_0x2759b0,_0x2e547b,_0x291555){_0x2759b0[_0x3a27('0x6')]({'attributes':['id'],'raw':!![]})[_0x3a27('0x7')](function(_0x230534){_0x2759b0['setDataValue'](_0x3a27('0x8'),_0x230534[_0x3a27('0x9')](function(_0x2ff5ba){return{'id':_0x2ff5ba['id']};}));return ChatMessage[_0x3a27('0xa')]({'where':{'ChatInteractionId':_0x2759b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3a27('0x7')](function(_0x49e23e){_0x2759b0[_0x3a27('0xb')](_0x3a27('0xc'),_0x49e23e[_0x3a27('0xd')]);ChatInteractionEvents[_0x3a27('0xe')](_0xee8c89+':'+_0x2759b0['id'],_0x2759b0);ChatInteractionEvents[_0x3a27('0xe')](_0xee8c89,_0x2759b0);_0x291555(null);})[_0x3a27('0xf')](_0x291555(null));};}for(var e in events){if(events[_0x3a27('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x39f2=['setMaxListeners','save','update','remove','then','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatInteraction'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x39f2,0x166));var _0x239f=function(_0x828773,_0x1117a){_0x828773=_0x828773-0x0;var _0x216ad6=_0x39f2[_0x828773];return _0x216ad6;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x239f('0x0'))['db'][_0x239f('0x1')];var ChatMessage=require(_0x239f('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x239f('0x2')](0x0);var events={'afterCreate':_0x239f('0x3'),'afterUpdate':_0x239f('0x4'),'afterDestroy':_0x239f('0x5')};function emitEvent(_0x373290){return function(_0x310854,_0x256309,_0x505831){_0x310854['getUsers']({'attributes':['id'],'raw':!![]})[_0x239f('0x6')](function(_0x16f060){_0x310854['setDataValue'](_0x239f('0x7'),_0x16f060[_0x239f('0x8')](function(_0x545d72){return{'id':_0x545d72['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x310854['id'],'direction':'in','read':![]},'raw':!![]});})[_0x239f('0x6')](function(_0x341675){_0x310854['setDataValue'](_0x239f('0x9'),_0x341675[_0x239f('0xa')]);ChatInteractionEvents['emit'](_0x373290+':'+_0x310854['id'],_0x310854);ChatInteractionEvents[_0x239f('0xb')](_0x373290,_0x310854);_0x505831(null);})[_0x239f('0xc')](_0x505831(null));};}for(var e in events){if(events[_0x239f('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x239f('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 96ccdbb..8d2d039 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 _0x5934=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger'];(function(_0x476402,_0x1afd41){var _0x2b088f=function(_0x2e975a){while(--_0x2e975a){_0x476402['push'](_0x476402['shift']());}};_0x2b088f(++_0x1afd41);}(_0x5934,0x1ec));var _0x4593=function(_0x2b3040,_0x371507){_0x2b3040=_0x2b3040-0x0;var _0x415fed=_0x5934[_0x2b3040];return _0x415fed;};'use strict';var _=require('lodash');var util=require(_0x4593('0x0'));var logger=require(_0x4593('0x1'))(_0x4593('0x2'));var moment=require(_0x4593('0x3'));var BPromise=require(_0x4593('0x4'));var rp=require(_0x4593('0x5'));var fs=require('fs');var path=require(_0x4593('0x6'));var rimraf=require(_0x4593('0x7'));var config=require(_0x4593('0x8'));var attributes=require(_0x4593('0x9'));module[_0x4593('0xa')]=function(_0x973ee1,_0xe1fb6b){return _0x973ee1[_0x4593('0xb')](_0x4593('0xc'),attributes,{'tableName':_0x4593('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x31ed94,_0xb17c74,_0x1f9161){if(_0x31ed94['changed'](_0x4593('0xe'))){_0x31ed94[_0x4593('0xf')]=moment()[_0x4593('0x10')](_0x4593('0x11'));}_0x1f9161(null,_0x31ed94);}},'charset':_0x4593('0x12'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x32f1=['moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','closedAt','utf8mb4','lodash','../../config/logger','api'];(function(_0x1ef183,_0x341141){var _0x7fd9e2=function(_0x58d089){while(--_0x58d089){_0x1ef183['push'](_0x1ef183['shift']());}};_0x7fd9e2(++_0x341141);}(_0x32f1,0xd9));var _0x132f=function(_0x469739,_0x40eab1){_0x469739=_0x469739-0x0;var _0x3e23fb=_0x32f1[_0x469739];return _0x3e23fb;};'use strict';var _=require(_0x132f('0x0'));var util=require('util');var logger=require(_0x132f('0x1'))(_0x132f('0x2'));var moment=require(_0x132f('0x3'));var BPromise=require('bluebird');var rp=require(_0x132f('0x4'));var fs=require('fs');var path=require(_0x132f('0x5'));var rimraf=require(_0x132f('0x6'));var config=require('../../config/environment');var attributes=require(_0x132f('0x7'));module[_0x132f('0x8')]=function(_0x304b27,_0x1676ea){return _0x304b27['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b247a,_0xb03c2f,_0x4b2ec1){if(_0x4b247a['changed']('closed')){_0x4b247a[_0x132f('0x9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4b2ec1(null,_0x4b247a);}},'charset':_0x132f('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 53e1a3d..164c8fe 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 _0x41be=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','info','debug','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','body','options','where','attributes','then','UpdateChatInteraction','ChatInteraction','find','addTags','ids','spread','AddTags'];(function(_0x41bb2d,_0x534f1f){var _0x23b677=function(_0x4f53de){while(--_0x4f53de){_0x41bb2d['push'](_0x41bb2d['shift']());}};_0x23b677(++_0x534f1f);}(_0x41be,0x186));var _0xe41b=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x41be[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0xe41b('0x0'));var util=require(_0xe41b('0x1'));var moment=require(_0xe41b('0x2'));var BPromise=require(_0xe41b('0x3'));var rs=require(_0xe41b('0x4'));var fs=require('fs');var Redis=require(_0xe41b('0x5'));var db=require(_0xe41b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe41b('0x7'));var jayson=require(_0xe41b('0x8'));var client=jayson[_0xe41b('0x9')][_0xe41b('0xa')]({'port':0x232a});config[_0xe41b('0xb')]=_[_0xe41b('0xc')](config['redis'],{'host':_0xe41b('0xd'),'port':0x18eb});var socket=require(_0xe41b('0xe'))(new Redis(config['redis']));require(_0xe41b('0xf'))[_0xe41b('0x10')](socket);function respondWithRpcPromise(_0x455088,_0x404832,_0x2ae5e1){return new BPromise(function(_0x380cfa,_0x4c5132){return client['request'](_0x455088,_0x2ae5e1)['then'](function(_0x367cd1){logger[_0xe41b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x404832,'request\x20sent');logger[_0xe41b('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x404832,_0xe41b('0x13'),JSON[_0xe41b('0x14')](_0x367cd1));if(_0x367cd1[_0xe41b('0x15')]){if(_0x367cd1[_0xe41b('0x15')][_0xe41b('0x16')]===0x1f4){logger[_0xe41b('0x15')](_0xe41b('0x17'),_0x404832,_0x367cd1[_0xe41b('0x15')][_0xe41b('0x18')]);return _0x4c5132(_0x367cd1['error'][_0xe41b('0x18')]);}logger['error'](_0xe41b('0x17'),_0x404832,_0x367cd1['error'][_0xe41b('0x18')]);return _0x380cfa(_0x367cd1[_0xe41b('0x15')][_0xe41b('0x18')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x404832,_0xe41b('0x13'));_0x380cfa(_0x367cd1[_0xe41b('0x19')][_0xe41b('0x18')]);}})[_0xe41b('0x1a')](function(_0x488efa){logger['error'](_0xe41b('0x17'),_0x404832,_0x488efa);_0x4c5132(_0x488efa);});});}exports['UpdateChatInteraction']=function(_0x36f7fc){var _0x5103ac=this;return new Promise(function(_0x24dfc1,_0x27c967){return db['ChatInteraction']['update'](_0x36f7fc[_0xe41b('0x1b')],{'raw':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f7fc['options']?_0x36f7fc[_0xe41b('0x1c')][_0xe41b('0x1d')]||null:null,'attributes':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')][_0xe41b('0x1e')]||null:null,'limit':_0x36f7fc[_0xe41b('0x1c')]?_0x36f7fc[_0xe41b('0x1c')]['limit']||null:null})[_0xe41b('0x1f')](function(_0x299444){logger[_0xe41b('0x11')](_0xe41b('0x20'),_0x36f7fc);logger[_0xe41b('0x12')](_0xe41b('0x20'),_0x36f7fc,JSON[_0xe41b('0x14')](_0x299444));_0x24dfc1(_0x299444);})[_0xe41b('0x1a')](function(_0x455379){logger[_0xe41b('0x15')](_0xe41b('0x20'),_0x455379[_0xe41b('0x18')],_0x36f7fc);_0x27c967(_0x5103ac['error'](0x1f4,_0x455379[_0xe41b('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x1861f6){return new Promise(function(_0x379d7e,_0x36ac72){return db[_0xe41b('0x21')][_0xe41b('0x22')]({'where':_0x1861f6[_0xe41b('0x1c')]?_0x1861f6[_0xe41b('0x1c')][_0xe41b('0x1d')]||null:null})[_0xe41b('0x1f')](function(_0x495b6e){if(_0x495b6e){return _0x495b6e[_0xe41b('0x23')](_0x1861f6[_0xe41b('0x1b')][_0xe41b('0x24')],_['omit'](_0x1861f6[_0xe41b('0x1b')],[_0xe41b('0x24'),'id'])||{});}})[_0xe41b('0x25')](function(_0x2a5cc2){logger[_0xe41b('0x11')](_0xe41b('0x26'),_0x1861f6);logger[_0xe41b('0x12')](_0xe41b('0x26'),_0x1861f6,JSON[_0xe41b('0x14')](_0x2a5cc2));_0x379d7e(_0x2a5cc2);})[_0xe41b('0x1a')](function(_0x5e823d){logger['error'](_0xe41b('0x26'),_0x5e823d[_0xe41b('0x18')],_0x1861f6);_0x36ac72(_this[_0xe41b('0x15')](0x1f4,_0x5e823d[_0xe41b('0x18')]));});});}; \ No newline at end of file +var _0xc673=['jayson/promise','http','defaults','localhost','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ChatInteraction','update','body','options','raw','where','debug','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2d8143,_0x26e147){var _0x118f5f=function(_0x114eb2){while(--_0x114eb2){_0x2d8143['push'](_0x2d8143['shift']());}};_0x118f5f(++_0x26e147);}(_0xc673,0xe0));var _0x3c67=function(_0x5df995,_0x269f1e){_0x5df995=_0x5df995-0x0;var _0x4b10a6=_0xc673[_0x5df995];return _0x4b10a6;};'use strict';var _=require(_0x3c67('0x0'));var util=require(_0x3c67('0x1'));var moment=require('moment');var BPromise=require(_0x3c67('0x2'));var rs=require(_0x3c67('0x3'));var fs=require('fs');var Redis=require(_0x3c67('0x4'));var db=require(_0x3c67('0x5'))['db'];var utils=require(_0x3c67('0x6'));var logger=require(_0x3c67('0x7'))(_0x3c67('0x8'));var config=require(_0x3c67('0x9'));var jayson=require(_0x3c67('0xa'));var client=jayson['client'][_0x3c67('0xb')]({'port':0x232a});config['redis']=_[_0x3c67('0xc')](config['redis'],{'host':_0x3c67('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c67('0xe')]));require(_0x3c67('0xf'))[_0x3c67('0x10')](socket);function respondWithRpcPromise(_0x5395cd,_0x42ae0a,_0x21fdcb){return new BPromise(function(_0x1dc297,_0x336320){return client[_0x3c67('0x11')](_0x5395cd,_0x21fdcb)[_0x3c67('0x12')](function(_0x3d2ef7){logger[_0x3c67('0x13')](_0x3c67('0x14'),_0x42ae0a,_0x3c67('0x15'));logger['debug'](_0x3c67('0x16'),_0x42ae0a,_0x3c67('0x15'),JSON[_0x3c67('0x17')](_0x3d2ef7));if(_0x3d2ef7[_0x3c67('0x18')]){if(_0x3d2ef7['error']['code']===0x1f4){logger[_0x3c67('0x18')](_0x3c67('0x14'),_0x42ae0a,_0x3d2ef7[_0x3c67('0x18')][_0x3c67('0x19')]);return _0x336320(_0x3d2ef7['error'][_0x3c67('0x19')]);}logger[_0x3c67('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x42ae0a,_0x3d2ef7[_0x3c67('0x18')][_0x3c67('0x19')]);return _0x1dc297(_0x3d2ef7[_0x3c67('0x18')][_0x3c67('0x19')]);}else{logger[_0x3c67('0x13')](_0x3c67('0x14'),_0x42ae0a,_0x3c67('0x15'));_0x1dc297(_0x3d2ef7['result'][_0x3c67('0x19')]);}})[_0x3c67('0x1a')](function(_0x3bb967){logger['error'](_0x3c67('0x14'),_0x42ae0a,_0x3bb967);_0x336320(_0x3bb967);});});}exports['UpdateChatInteraction']=function(_0x3586e2){var _0x2c595a=this;return new Promise(function(_0x485004,_0x30042c){return db[_0x3c67('0x1b')][_0x3c67('0x1c')](_0x3586e2[_0x3c67('0x1d')],{'raw':_0x3586e2['options']?_0x3586e2[_0x3c67('0x1e')][_0x3c67('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3586e2[_0x3c67('0x1e')]?_0x3586e2[_0x3c67('0x1e')][_0x3c67('0x20')]||null:null,'attributes':_0x3586e2[_0x3c67('0x1e')]?_0x3586e2[_0x3c67('0x1e')]['attributes']||null:null,'limit':_0x3586e2[_0x3c67('0x1e')]?_0x3586e2[_0x3c67('0x1e')]['limit']||null:null})['then'](function(_0x2f503b){logger['info']('UpdateChatInteraction',_0x3586e2);logger[_0x3c67('0x21')](_0x3c67('0x22'),_0x3586e2,JSON[_0x3c67('0x17')](_0x2f503b));_0x485004(_0x2f503b);})[_0x3c67('0x1a')](function(_0x13f4f3){logger[_0x3c67('0x18')](_0x3c67('0x22'),_0x13f4f3[_0x3c67('0x19')],_0x3586e2);_0x30042c(_0x2c595a[_0x3c67('0x18')](0x1f4,_0x13f4f3[_0x3c67('0x19')]));});});};exports[_0x3c67('0x23')]=function(_0x4bcafd){return new Promise(function(_0x142dea,_0x29fc70){return db['ChatInteraction']['find']({'where':_0x4bcafd[_0x3c67('0x1e')]?_0x4bcafd[_0x3c67('0x1e')][_0x3c67('0x20')]||null:null})[_0x3c67('0x12')](function(_0x29827f){if(_0x29827f){return _0x29827f[_0x3c67('0x24')](_0x4bcafd[_0x3c67('0x1d')][_0x3c67('0x25')],_['omit'](_0x4bcafd[_0x3c67('0x1d')],['ids','id'])||{});}})['spread'](function(_0x260523){logger[_0x3c67('0x13')]('AddTags',_0x4bcafd);logger[_0x3c67('0x21')](_0x3c67('0x26'),_0x4bcafd,JSON[_0x3c67('0x17')](_0x260523));_0x142dea(_0x260523);})[_0x3c67('0x1a')](function(_0x3342a5){logger[_0x3c67('0x18')](_0x3c67('0x26'),_0x3342a5['message'],_0x4bcafd);_0x29fc70(_this[_0x3c67('0x18')](0x1f4,_0x3342a5[_0x3c67('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0d3871b..d63a246 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 _0x8b91=['emit','removeListener','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x5e20f6,_0x427b74){var _0x4e96d3=function(_0x1a7d3d){while(--_0x1a7d3d){_0x5e20f6['push'](_0x5e20f6['shift']());}};_0x4e96d3(++_0x427b74);}(_0x8b91,0x17e));var _0x18b9=function(_0x1c0abe,_0x28a701){_0x1c0abe=_0x1c0abe-0x0;var _0x24d9bf=_0x8b91[_0x1c0abe];return _0x24d9bf;};'use strict';var ChatInteractionEvents=require(_0x18b9('0x0'));var events=[_0x18b9('0x1'),_0x18b9('0x2'),'update'];function createListener(_0x194721,_0x3fb7d4){return function(_0xfeb4d3){_0x3fb7d4[_0x18b9('0x3')](_0x194721,_0xfeb4d3);};}function removeListener(_0xa87b43,_0x4071e3){return function(){ChatInteractionEvents[_0x18b9('0x4')](_0xa87b43,_0x4071e3);};}exports[_0x18b9('0x5')]=function(_0x10aa74){for(var _0x1c4e97=0x0,_0x4990c5=events['length'];_0x1c4e97<_0x4990c5;_0x1c4e97++){var _0x1839cf=events[_0x1c4e97];var _0x45dfcd=createListener(_0x18b9('0x6')+_0x1839cf,_0x10aa74);ChatInteractionEvents['on'](_0x1839cf,_0x45dfcd);}}; \ No newline at end of file +var _0xbb50=['./chatInteraction.events','save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x183196,_0x29bbb7){var _0x1d4d69=function(_0x4c2ba6){while(--_0x4c2ba6){_0x183196['push'](_0x183196['shift']());}};_0x1d4d69(++_0x29bbb7);}(_0xbb50,0x1d8));var _0x0bb5=function(_0x2d6138,_0x219734){_0x2d6138=_0x2d6138-0x0;var _0x55eb00=_0xbb50[_0x2d6138];return _0x55eb00;};'use strict';var ChatInteractionEvents=require(_0x0bb5('0x0'));var events=[_0x0bb5('0x1'),_0x0bb5('0x2'),_0x0bb5('0x3')];function createListener(_0x2bdf96,_0x51b347){return function(_0x53cd77){_0x51b347[_0x0bb5('0x4')](_0x2bdf96,_0x53cd77);};}function removeListener(_0x23ebdc,_0x5418c4){return function(){ChatInteractionEvents[_0x0bb5('0x5')](_0x23ebdc,_0x5418c4);};}exports['register']=function(_0x4e5835){for(var _0x26ddcc=0x0,_0x392049=events[_0x0bb5('0x6')];_0x26ddcc<_0x392049;_0x26ddcc++){var _0x2dfac9=events[_0x26ddcc];var _0xbf56=createListener(_0x0bb5('0x7')+_0x2dfac9,_0x4e5835);ChatInteractionEvents['on'](_0x2dfac9,_0xbf56);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4405cd2..54b9590 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 _0xc3f2=['originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','chatinteraction:destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now'];(function(_0x449cee,_0x3d88b0){var _0x58de0a=function(_0x3636a6){while(--_0x3636a6){_0x449cee['push'](_0x449cee['shift']());}};_0x58de0a(++_0x3d88b0);}(_0xc3f2,0x144));var _0x2c3f=function(_0x5c9c01,_0x2d2fc5){_0x5c9c01=_0x5c9c01-0x0;var _0xee7501=_0xc3f2[_0x5c9c01];return _0xee7501;};'use strict';var multer=require(_0x2c3f('0x0'));var util=require('util');var path=require(_0x2c3f('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c3f('0x2'));var router=express[_0x2c3f('0x3')]();var fs_extra=require(_0x2c3f('0x4'));var auth=require(_0x2c3f('0x5'));var interaction=require(_0x2c3f('0x6'));var config=require(_0x2c3f('0x7'));var controller=require(_0x2c3f('0x8'));router[_0x2c3f('0x9')]('/',auth[_0x2c3f('0xa')](),controller[_0x2c3f('0xb')]);router['get']('/describe',auth[_0x2c3f('0xa')](),controller[_0x2c3f('0xc')]);router[_0x2c3f('0x9')](_0x2c3f('0xd'),auth[_0x2c3f('0xe')](),controller[_0x2c3f('0xf')]);router[_0x2c3f('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x2c3f('0x10')]);router[_0x2c3f('0x9')](_0x2c3f('0x11'),auth[_0x2c3f('0xa')](),controller[_0x2c3f('0x12')]);router['get'](_0x2c3f('0x13'),auth[_0x2c3f('0xe')](),controller[_0x2c3f('0x14')]);router[_0x2c3f('0x9')](_0x2c3f('0x15'),auth['isAuthenticated'](),controller[_0x2c3f('0x16')]);router[_0x2c3f('0x17')]('/',auth['isAuthenticated'](),controller[_0x2c3f('0x18')]);router[_0x2c3f('0x17')](_0x2c3f('0x19'),auth[_0x2c3f('0xa')](),controller[_0x2c3f('0x1a')]);var upload=multer({'storage':multer[_0x2c3f('0x1b')]({'destination':function(_0x146ec6,_0x432c19,_0x1c0025){_0x1c0025(null,path[_0x2c3f('0x1c')](config[_0x2c3f('0x1d')],_0x2c3f('0x1e')));},'filename':function(_0x1c8124,_0x3a0770,_0x1c25ea){_0x1c25ea(null,util['format'](_0x2c3f('0x1f'),Date[_0x2c3f('0x20')](),_0x3a0770[_0x2c3f('0x21')][_0x2c3f('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c3f('0x17')](_0x2c3f('0x23'),upload[_0x2c3f('0x24')](_0x2c3f('0x25')),controller[_0x2c3f('0x26')]);router['post']('/:id/messages',auth[_0x2c3f('0xe')](),controller[_0x2c3f('0x27')]);router['post'](_0x2c3f('0x28'),auth['isAuthenticated'](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),'chatinteraction:addtags'),controller[_0x2c3f('0x2b')]);router[_0x2c3f('0x2c')](_0x2c3f('0xd'),auth[_0x2c3f('0xa')](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),_0x2c3f('0x2d')),controller[_0x2c3f('0x2e')]);router['put'](_0x2c3f('0x2f'),controller['customUpdate']);router[_0x2c3f('0x2c')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x2c3f('0x2c')](_0x2c3f('0x30'),controller[_0x2c3f('0x31')]);router['delete']('/:id',auth[_0x2c3f('0xa')](),interaction[_0x2c3f('0x29')](_0x2c3f('0x2a'),_0x2c3f('0x32')),controller['destroy']);router['delete'](_0x2c3f('0x28'),auth[_0x2c3f('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x89f0=['/:id/attachment_upload','single','attachmentUpload','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace'];(function(_0x1e2f72,_0x4ecd3d){var _0x2f00a8=function(_0xf1ee63){while(--_0xf1ee63){_0x1e2f72['push'](_0x1e2f72['shift']());}};_0x2f00a8(++_0x4ecd3d);}(_0x89f0,0xb9));var _0x089f=function(_0xe80a60,_0x482e2b){_0xe80a60=_0xe80a60-0x0;var _0x2cca08=_0x89f0[_0xe80a60];return _0x2cca08;};'use strict';var multer=require(_0x089f('0x0'));var util=require(_0x089f('0x1'));var path=require(_0x089f('0x2'));var timeout=require(_0x089f('0x3'));var express=require(_0x089f('0x4'));var router=express[_0x089f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x089f('0x6'));var interaction=require(_0x089f('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x089f('0x8')]('/',auth[_0x089f('0x9')](),controller[_0x089f('0xa')]);router[_0x089f('0x8')](_0x089f('0xb'),auth[_0x089f('0x9')](),controller[_0x089f('0xc')]);router[_0x089f('0x8')](_0x089f('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x089f('0xe')]);router['get'](_0x089f('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x089f('0x10')]);router[_0x089f('0x8')](_0x089f('0x11'),auth[_0x089f('0x9')](),controller[_0x089f('0x12')]);router[_0x089f('0x8')](_0x089f('0x13'),auth[_0x089f('0x14')](),controller[_0x089f('0x15')]);router[_0x089f('0x8')]('/:id/download',auth[_0x089f('0x9')](),controller[_0x089f('0x16')]);router[_0x089f('0x17')]('/',auth[_0x089f('0x9')](),controller[_0x089f('0x18')]);router[_0x089f('0x17')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x089f('0x19')]);var upload=multer({'storage':multer[_0x089f('0x1a')]({'destination':function(_0x7875d0,_0x38a3ed,_0x3e073b){_0x3e073b(null,path[_0x089f('0x1b')](config[_0x089f('0x1c')],_0x089f('0x1d')));},'filename':function(_0x2f8337,_0x11f3bb,_0x30dc55){_0x30dc55(null,util[_0x089f('0x1e')](_0x089f('0x1f'),Date[_0x089f('0x20')](),_0x11f3bb[_0x089f('0x21')][_0x089f('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x089f('0x17')](_0x089f('0x23'),upload[_0x089f('0x24')]('file'),controller[_0x089f('0x25')]);router['post']('/:id/messages',auth[_0x089f('0x14')](),controller['addMessage']);router[_0x089f('0x17')](_0x089f('0x26'),auth[_0x089f('0x9')](),interaction['tracked']('chat',_0x089f('0x27')),controller[_0x089f('0x28')]);router[_0x089f('0x29')]('/:id',auth[_0x089f('0x9')](),interaction[_0x089f('0x2a')](_0x089f('0x2b'),'chatinteraction:update'),controller[_0x089f('0x2c')]);router['put'](_0x089f('0x2d'),controller[_0x089f('0x2e')]);router['put'](_0x089f('0x2f'),auth[_0x089f('0x14')](),controller[_0x089f('0x30')]);router[_0x089f('0x29')](_0x089f('0x31'),controller[_0x089f('0x32')]);router[_0x089f('0x33')](_0x089f('0xd'),auth[_0x089f('0x9')](),interaction[_0x089f('0x2a')](_0x089f('0x2b'),'chatinteraction:destroy'),controller[_0x089f('0x34')]);router[_0x089f('0x33')](_0x089f('0x26'),auth[_0x089f('0x9')](),controller[_0x089f('0x35')]);module[_0x089f('0x36')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index c205d55..f6d0e2c 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 _0x8ff2=['sequelize','exports','TEXT','medium'];(function(_0x45ad2b,_0x50d0b9){var _0x289a91=function(_0x2daa30){while(--_0x2daa30){_0x45ad2b['push'](_0x45ad2b['shift']());}};_0x289a91(++_0x50d0b9);}(_0x8ff2,0x190));var _0x28ff=function(_0x5a699d,_0x3327e7){_0x5a699d=_0x5a699d-0x0;var _0x2101f9=_0x8ff2[_0x5a699d];return _0x2101f9;};'use strict';var Sequelize=require(_0x28ff('0x0'));module[_0x28ff('0x1')]={'body':{'type':Sequelize[_0x28ff('0x2')](_0x28ff('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x48b2=['INTEGER','sequelize','exports','TEXT','BOOLEAN'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x48b2,0x173));var _0x248b=function(_0x4ac0cb,_0x53672c){_0x4ac0cb=_0x4ac0cb-0x0;var _0x2d28b6=_0x48b2[_0x4ac0cb];return _0x2d28b6;};'use strict';var Sequelize=require(_0x248b('0x0'));module[_0x248b('0x1')]={'body':{'type':Sequelize[_0x248b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x248b('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x248b('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 22978ec..51378d6 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 _0x7e88=['options','ChatInternalMessage','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','role','userpic','internal','online','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','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','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','map','rawAttributes','type','key','keys','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e88,0x1d6));var _0x87e8=function(_0x36ff64,_0x9f727a){_0x36ff64=_0x36ff64-0x0;var _0x4ac4b6=_0x7e88[_0x36ff64];return _0x4ac4b6;};'use strict';var emlformat=require(_0x87e8('0x0'));var rimraf=require(_0x87e8('0x1'));var zipdir=require(_0x87e8('0x2'));var jsonpatch=require(_0x87e8('0x3'));var rp=require('request-promise');var moment=require(_0x87e8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x87e8('0x5'));var path=require(_0x87e8('0x6'));var sox=require(_0x87e8('0x7'));var csv=require('to-csv');var ejs=require(_0x87e8('0x8'));var fs=require('fs');var fs_extra=require(_0x87e8('0x9'));var _=require(_0x87e8('0xa'));var squel=require(_0x87e8('0xb'));var crypto=require('crypto');var jsforce=require(_0x87e8('0xc'));var deskjs=require(_0x87e8('0xd'));var toCsv=require(_0x87e8('0xe'));var querystring=require(_0x87e8('0xf'));var Papa=require(_0x87e8('0x10'));var Redis=require('ioredis');var authService=require(_0x87e8('0x11'));var qs=require(_0x87e8('0x12'));var as=require(_0x87e8('0x13'));var hardwareService=require(_0x87e8('0x14'));var logger=require('../../config/logger')(_0x87e8('0x15'));var utils=require('../../config/utils');var config=require(_0x87e8('0x16'));var licenseUtil=require(_0x87e8('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x87e8('0x18')],{'host':_0x87e8('0x19'),'port':0x18eb});var socket=require(_0x87e8('0x1a'))(new Redis(config[_0x87e8('0x18')]));require(_0x87e8('0x1b'))[_0x87e8('0x1c')](socket);function respondWithStatusCode(_0x36d87d,_0x348486){_0x348486=_0x348486||0xcc;return function(_0x6d918c){if(_0x6d918c){return _0x36d87d[_0x87e8('0x1d')](_0x348486);}return _0x36d87d['status'](_0x348486)[_0x87e8('0x1e')]();};}function respondWithResult(_0x161205,_0x4359d3){_0x4359d3=_0x4359d3||0xc8;return function(_0x321a1b){if(_0x321a1b){return _0x161205[_0x87e8('0x1f')](_0x4359d3)[_0x87e8('0x20')](_0x321a1b);}};}function respondWithFilteredResult(_0x4aab58,_0x34e798){return function(_0x2e430d){if(_0x2e430d){var _0x33d72e=typeof _0x34e798[_0x87e8('0x21')]===_0x87e8('0x22')&&typeof _0x34e798[_0x87e8('0x23')]===_0x87e8('0x22');var _0x5039bf=_0x2e430d[_0x87e8('0x24')];var _0x9a8e2f=_0x33d72e?0x0:_0x34e798[_0x87e8('0x21')];var _0x5969d1=_0x33d72e?_0x2e430d['count']:_0x34e798['offset']+_0x34e798[_0x87e8('0x23')];var _0xa74854;if(_0x5969d1>=_0x5039bf){_0x5969d1=_0x5039bf;_0xa74854=0xc8;}else{_0xa74854=0xce;}_0x4aab58[_0x87e8('0x1f')](_0xa74854);return _0x4aab58[_0x87e8('0x25')]('Content-Range',_0x9a8e2f+'-'+_0x5969d1+'/'+_0x5039bf)['json'](_0x2e430d);}return null;};}function patchUpdates(_0x5657e6){return function(_0x4bdc30){try{jsonpatch[_0x87e8('0x26')](_0x4bdc30,_0x5657e6,!![]);}catch(_0xc0c843){return BPromise[_0x87e8('0x27')](_0xc0c843);}return _0x4bdc30[_0x87e8('0x28')]();};}function saveUpdates(_0x5dac13,_0x31e112){return function(_0x4b3437){if(_0x4b3437){return _0x4b3437[_0x87e8('0x29')](_0x5dac13)['then'](function(_0x1681a2){return _0x1681a2;});}return null;};}function removeEntity(_0x2f53af,_0x3b291a){return function(_0x1f0b9a){if(_0x1f0b9a){return _0x1f0b9a[_0x87e8('0x2a')]()[_0x87e8('0x2b')](function(){_0x2f53af[_0x87e8('0x1f')](0xcc)[_0x87e8('0x1e')]();});}};}function handleEntityNotFound(_0x422916,_0x523564){return function(_0x98fc24){if(!_0x98fc24){_0x422916['sendStatus'](0x194);}return _0x98fc24;};}function handleError(_0x499232,_0x1f8725){_0x1f8725=_0x1f8725||0x1f4;return function(_0x746d1f){logger['error'](_0x746d1f['stack']);if(_0x746d1f[_0x87e8('0x2c')]){delete _0x746d1f[_0x87e8('0x2c')];}_0x499232[_0x87e8('0x1f')](_0x1f8725)[_0x87e8('0x2d')](_0x746d1f);};}exports['index']=function(_0x3c6699,_0x538141){var _0x4e3f7c={},_0x437575={},_0x353f7c={'count':0x0,'rows':[]};var _0x34cfd4=_[_0x87e8('0x2e')](db['ChatInternalMessage'][_0x87e8('0x2f')],function(_0x5253f7){return{'name':_0x5253f7['fieldName'],'type':_0x5253f7[_0x87e8('0x30')][_0x87e8('0x31')]};});_0x437575['model']=_[_0x87e8('0x2e')](_0x34cfd4,_0x87e8('0x2c'));_0x437575['query']=_[_0x87e8('0x32')](_0x3c6699['query']);_0x437575['filters']=_['intersection'](_0x437575[_0x87e8('0x33')],_0x437575[_0x87e8('0x34')]);_0x4e3f7c['attributes']=_['intersection'](_0x437575['model'],qs[_0x87e8('0x35')](_0x3c6699[_0x87e8('0x34')][_0x87e8('0x35')]));_0x4e3f7c[_0x87e8('0x36')]=_0x4e3f7c[_0x87e8('0x36')][_0x87e8('0x37')]?_0x4e3f7c[_0x87e8('0x36')]:_0x437575['model'];if(!_0x3c6699[_0x87e8('0x34')][_0x87e8('0x38')](_0x87e8('0x39'))){_0x4e3f7c[_0x87e8('0x23')]=qs[_0x87e8('0x23')](_0x3c6699['query'][_0x87e8('0x23')]);_0x4e3f7c[_0x87e8('0x21')]=qs[_0x87e8('0x21')](_0x3c6699[_0x87e8('0x34')][_0x87e8('0x21')]);}_0x4e3f7c['order']=qs[_0x87e8('0x3a')](_0x3c6699[_0x87e8('0x34')]['sort']);_0x4e3f7c[_0x87e8('0x3b')]=qs[_0x87e8('0x3c')](_[_0x87e8('0x3d')](_0x3c6699['query'],_0x437575[_0x87e8('0x3c')]),_0x34cfd4);if(_0x3c6699[_0x87e8('0x34')]['filter']){_0x4e3f7c['where']=_[_0x87e8('0x3e')](_0x4e3f7c[_0x87e8('0x3b')],{'$or':_[_0x87e8('0x2e')](_0x34cfd4,function(_0x1dbc63){if(_0x1dbc63[_0x87e8('0x30')]!==_0x87e8('0x3f')){var _0x51d0f5={};_0x51d0f5[_0x1dbc63[_0x87e8('0x2c')]]={'$like':'%'+_0x3c6699['query'][_0x87e8('0x40')]+'%'};return _0x51d0f5;}})});}_0x4e3f7c=_[_0x87e8('0x3e')]({},_0x4e3f7c,_0x3c6699[_0x87e8('0x41')]);var _0x3f7326={'where':_0x4e3f7c[_0x87e8('0x3b')]};return db[_0x87e8('0x42')][_0x87e8('0x24')](_0x3f7326)[_0x87e8('0x2b')](function(_0x72047d){_0x353f7c[_0x87e8('0x24')]=_0x72047d;if(_0x3c6699['query'][_0x87e8('0x43')]){_0x4e3f7c[_0x87e8('0x44')]=[{'all':!![]}];}return db[_0x87e8('0x42')][_0x87e8('0x45')](_0x4e3f7c);})[_0x87e8('0x2b')](function(_0xae5a0a){_0x353f7c['rows']=_0xae5a0a;return _0x353f7c;})['then'](respondWithFilteredResult(_0x538141,_0x4e3f7c))[_0x87e8('0x46')](handleError(_0x538141,null));};exports[_0x87e8('0x47')]=function(_0x2ddc27,_0x58988f){var _0x4f0961={'raw':!![],'where':{'id':_0x2ddc27[_0x87e8('0x48')]['id']}},_0x828275={};_0x828275[_0x87e8('0x33')]=_['keys'](db[_0x87e8('0x42')][_0x87e8('0x2f')]);_0x828275[_0x87e8('0x34')]=_[_0x87e8('0x32')](_0x2ddc27[_0x87e8('0x34')]);_0x828275[_0x87e8('0x3c')]=_[_0x87e8('0x49')](_0x828275['model'],_0x828275[_0x87e8('0x34')]);_0x4f0961[_0x87e8('0x36')]=_[_0x87e8('0x49')](_0x828275[_0x87e8('0x33')],qs[_0x87e8('0x35')](_0x2ddc27[_0x87e8('0x34')]['fields']));_0x4f0961[_0x87e8('0x36')]=_0x4f0961[_0x87e8('0x36')]['length']?_0x4f0961[_0x87e8('0x36')]:_0x828275[_0x87e8('0x33')];if(_0x2ddc27['query'][_0x87e8('0x43')]){_0x4f0961[_0x87e8('0x44')]=[{'all':!![]}];}_0x4f0961=_[_0x87e8('0x3e')]({},_0x4f0961,_0x2ddc27[_0x87e8('0x41')]);return db[_0x87e8('0x42')][_0x87e8('0x4a')](_0x4f0961)[_0x87e8('0x2b')](handleEntityNotFound(_0x58988f,null))[_0x87e8('0x2b')](respondWithResult(_0x58988f,null))[_0x87e8('0x46')](handleError(_0x58988f,null));};exports[_0x87e8('0x4b')]=function(_0x4e71c2,_0x4852a6){return db[_0x87e8('0x42')][_0x87e8('0x4b')](_0x4e71c2['body'],{})['then'](respondWithResult(_0x4852a6,0xc9))[_0x87e8('0x46')](handleError(_0x4852a6,null));};exports[_0x87e8('0x29')]=function(_0x4e0346,_0x51c9c0){if(_0x4e0346[_0x87e8('0x4c')]['id']){delete _0x4e0346[_0x87e8('0x4c')]['id'];}return db[_0x87e8('0x42')][_0x87e8('0x4a')]({'where':{'id':_0x4e0346[_0x87e8('0x48')]['id']}})[_0x87e8('0x2b')](handleEntityNotFound(_0x51c9c0,null))[_0x87e8('0x2b')](saveUpdates(_0x4e0346[_0x87e8('0x4c')],null))[_0x87e8('0x2b')](respondWithResult(_0x51c9c0,null))[_0x87e8('0x46')](handleError(_0x51c9c0,null));};exports[_0x87e8('0x2a')]=function(_0x292240,_0x1a3ba8){return db['ChatInternalMessage'][_0x87e8('0x4a')]({'where':{'id':_0x292240[_0x87e8('0x48')]['id']}})[_0x87e8('0x2b')](handleEntityNotFound(_0x1a3ba8,null))[_0x87e8('0x2b')](removeEntity(_0x1a3ba8,null))[_0x87e8('0x46')](handleError(_0x1a3ba8,null));};exports[_0x87e8('0x4d')]=function(_0x5c022d,_0x204c40){return db[_0x87e8('0x42')]['describe']()['then'](respondWithResult(_0x204c40,null))[_0x87e8('0x46')](handleError(_0x204c40,null));};function wrapUser(_0x3af655){return function(_0x28c8fd){var _0x36b760=_0x3af655['get']({'plain':!![]});_0x36b760['messages']=[];if(_0x28c8fd){_0x36b760['lastMessageAt']=_0x28c8fd['createdAt'];_0x36b760['lastMessage']=_0x28c8fd;}else{_0x36b760[_0x87e8('0x4e')]=moment(0x0)[_0x87e8('0x4f')](_0x87e8('0x50'));_0x36b760[_0x87e8('0x51')]={};}return _0x36b760;};}exports[_0x87e8('0x52')]=function(_0x55eebd,_0x5cfffb,_0x4b2797){var _0x1a0200=[];return db[_0x87e8('0x53')][_0x87e8('0x45')]({'where':{'role':[_0x87e8('0x54'),_0x87e8('0x55'),_0x87e8('0x56')]},'attributes':['id','fullname',_0x87e8('0x2c'),_0x87e8('0x57'),_0x87e8('0x58'),_0x87e8('0x59'),_0x87e8('0x5a'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0x87e8('0x3a')](_0x87e8('0x5b')),'include':[{'model':db[_0x87e8('0x5c')],'as':_0x87e8('0x5d'),'attributes':['id',_0x87e8('0x2c'),_0x87e8('0x30')],'through':{'attributes':[]}}]})['then'](function(_0x3d4135){if(_0x3d4135){var _0x323633=_0x55eebd[_0x87e8('0x56')]['get']({'plain':!![]});if(!_0x323633)throw new Error(_0x87e8('0x5e'));if(_0x323633[_0x87e8('0x57')]===_0x87e8('0x56')){return db[_0x87e8('0x5f')][_0x87e8('0x4a')]({'where':{'name':_0x87e8('0x60'),'userProfileId':_0x323633[_0x87e8('0x61')]},'raw':!![]})[_0x87e8('0x2b')](function(_0x34c92e){if(_0x34c92e){if(_0x34c92e['autoAssociation']===0x0){return db[_0x87e8('0x62')]['findAll']({'where':{'sectionId':_0x34c92e['id']},'raw':!![]})['then'](function(_0x593cd2){var _0x3af402=[];if(_[_0x87e8('0x63')](_0x593cd2)){_0x3af402=_[_0x87e8('0x40')](_0x3d4135,function(_0x36eee6){if(_0x36eee6[_0x87e8('0x57')]!==_0x87e8('0x54')){return _0x36eee6;}});return _0x3af402;}else{for(var _0x183a51=0x0;_0x183a51<_0x3d4135['length'];_0x183a51++){var _0x52227a=_0x3d4135[_0x183a51];if(_0x52227a['role']===_0x87e8('0x54')){var _0x320e47=_[_0x87e8('0x4a')](_0x593cd2,function(_0x4ec2b0){return _0x4ec2b0[_0x87e8('0x64')]===_0x52227a['id'];});if(_0x320e47)_0x3af402[_0x87e8('0x65')](_0x52227a);}else{_0x3af402['push'](_0x52227a);}}return _0x3af402;}});}else{return _0x3d4135;}}else{var _0x149401=_[_0x87e8('0x40')](_0x3d4135,function(_0x2c6d4a){if(_0x2c6d4a[_0x87e8('0x57')]!=='agent'){return _0x2c6d4a;}});return _0x149401;}});}else{return _0x3d4135;}}})['then'](function(_0xf11f56){var _0x299463=[];if(_0xf11f56){_0x1a0200=_0xf11f56;for(var _0x49f957=0x0;_0x49f957<_0xf11f56[_0x87e8('0x37')];_0x49f957+=0x1){_0x1a0200[_0x49f957]['messages']=[];_0x299463[_0x87e8('0x65')](db[_0x87e8('0x42')][_0x87e8('0x4a')]({'where':{'FromId':[_0x55eebd['user']['id'],_0xf11f56[_0x49f957]['id']],'ToId':[_0x55eebd['user']['id'],_0xf11f56[_0x49f957]['id']],'ChatGroupId':null},'attributes':['id',_0x87e8('0x66'),_0x87e8('0x67'),'ToId',_0x87e8('0x68'),_0x87e8('0x4c')],'order':qs[_0x87e8('0x3a')](_0x87e8('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x87e8('0x2b')](wrapUser(_0xf11f56[_0x49f957])));}return BPromise[_0x87e8('0x6a')](_0x299463);}return[];})[_0x87e8('0x2b')](function(_0x1716e8){return{'rows':_0x1716e8,'count':_0x1716e8[_0x87e8('0x37')]};})[_0x87e8('0x2b')](respondWithResult(_0x5cfffb,null))[_0x87e8('0x46')](handleError(_0x5cfffb,null));}; \ No newline at end of file +var _0x0d2d=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','limit','undefined','count','offset','apply','reject','save','update','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','include','findAll','catch','params','length','includeAll','find','create','body','describe','get','messages','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','role','userpic','internal','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x16db5c,_0x7d65ee){var _0x40e126=function(_0x5add7b){while(--_0x5add7b){_0x16db5c['push'](_0x16db5c['shift']());}};_0x40e126(++_0x7d65ee);}(_0x0d2d,0xc7));var _0xd0d2=function(_0x59562c,_0x1b801f){_0x59562c=_0x59562c-0x0;var _0xa27606=_0x0d2d[_0x59562c];return _0xa27606;};'use strict';var emlformat=require(_0xd0d2('0x0'));var rimraf=require(_0xd0d2('0x1'));var zipdir=require(_0xd0d2('0x2'));var jsonpatch=require(_0xd0d2('0x3'));var rp=require('request-promise');var moment=require(_0xd0d2('0x4'));var BPromise=require(_0xd0d2('0x5'));var Mustache=require(_0xd0d2('0x6'));var util=require(_0xd0d2('0x7'));var path=require('path');var sox=require(_0xd0d2('0x8'));var csv=require(_0xd0d2('0x9'));var ejs=require(_0xd0d2('0xa'));var fs=require('fs');var fs_extra=require(_0xd0d2('0xb'));var _=require(_0xd0d2('0xc'));var squel=require(_0xd0d2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd0d2('0x9'));var querystring=require(_0xd0d2('0xe'));var Papa=require(_0xd0d2('0xf'));var Redis=require('ioredis');var authService=require(_0xd0d2('0x10'));var qs=require(_0xd0d2('0x11'));var as=require(_0xd0d2('0x12'));var hardwareService=require(_0xd0d2('0x13'));var logger=require(_0xd0d2('0x14'))(_0xd0d2('0x15'));var utils=require('../../config/utils');var config=require(_0xd0d2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0d2('0x17'))['db'];config[_0xd0d2('0x18')]=_[_0xd0d2('0x19')](config[_0xd0d2('0x18')],{'host':_0xd0d2('0x1a'),'port':0x18eb});var socket=require(_0xd0d2('0x1b'))(new Redis(config[_0xd0d2('0x18')]));require(_0xd0d2('0x1c'))[_0xd0d2('0x1d')](socket);function respondWithStatusCode(_0x5ed312,_0x2e5b41){_0x2e5b41=_0x2e5b41||0xcc;return function(_0x395eb0){if(_0x395eb0){return _0x5ed312[_0xd0d2('0x1e')](_0x2e5b41);}return _0x5ed312[_0xd0d2('0x1f')](_0x2e5b41)['end']();};}function respondWithResult(_0x39e94f,_0x2c47cd){_0x2c47cd=_0x2c47cd||0xc8;return function(_0x39d4cc){if(_0x39d4cc){return _0x39e94f[_0xd0d2('0x1f')](_0x2c47cd)[_0xd0d2('0x20')](_0x39d4cc);}};}function respondWithFilteredResult(_0x21a754,_0x2a0dba){return function(_0x46c0e4){if(_0x46c0e4){var _0x4b9f68=typeof _0x2a0dba['offset']==='undefined'&&typeof _0x2a0dba[_0xd0d2('0x21')]===_0xd0d2('0x22');var _0x3ae9ba=_0x46c0e4[_0xd0d2('0x23')];var _0x509c14=_0x4b9f68?0x0:_0x2a0dba[_0xd0d2('0x24')];var _0x126a79=_0x4b9f68?_0x46c0e4[_0xd0d2('0x23')]:_0x2a0dba[_0xd0d2('0x24')]+_0x2a0dba[_0xd0d2('0x21')];var _0x48e98f;if(_0x126a79>=_0x3ae9ba){_0x126a79=_0x3ae9ba;_0x48e98f=0xc8;}else{_0x48e98f=0xce;}_0x21a754[_0xd0d2('0x1f')](_0x48e98f);return _0x21a754['set']('Content-Range',_0x509c14+'-'+_0x126a79+'/'+_0x3ae9ba)[_0xd0d2('0x20')](_0x46c0e4);}return null;};}function patchUpdates(_0x33a50c){return function(_0xa6e0c7){try{jsonpatch[_0xd0d2('0x25')](_0xa6e0c7,_0x33a50c,!![]);}catch(_0x52be66){return BPromise[_0xd0d2('0x26')](_0x52be66);}return _0xa6e0c7[_0xd0d2('0x27')]();};}function saveUpdates(_0x5e757c,_0x44f828){return function(_0x171631){if(_0x171631){return _0x171631[_0xd0d2('0x28')](_0x5e757c)[_0xd0d2('0x29')](function(_0x19ad26){return _0x19ad26;});}return null;};}function removeEntity(_0x39b1e2,_0x2dd776){return function(_0x1245d4){if(_0x1245d4){return _0x1245d4['destroy']()[_0xd0d2('0x29')](function(){_0x39b1e2['status'](0xcc)[_0xd0d2('0x2a')]();});}};}function handleEntityNotFound(_0x4b77f7,_0x10f8f5){return function(_0x125db2){if(!_0x125db2){_0x4b77f7[_0xd0d2('0x1e')](0x194);}return _0x125db2;};}function handleError(_0x38118e,_0x2eb363){_0x2eb363=_0x2eb363||0x1f4;return function(_0x5ad454){logger[_0xd0d2('0x2b')](_0x5ad454['stack']);if(_0x5ad454[_0xd0d2('0x2c')]){delete _0x5ad454[_0xd0d2('0x2c')];}_0x38118e[_0xd0d2('0x1f')](_0x2eb363)[_0xd0d2('0x2d')](_0x5ad454);};}exports[_0xd0d2('0x2e')]=function(_0x5c48a4,_0x1b1f74){var _0x445d81={},_0x183615={},_0x59d97d={'count':0x0,'rows':[]};var _0x9270b8=_[_0xd0d2('0x2f')](db['ChatInternalMessage'][_0xd0d2('0x30')],function(_0x49ff46){return{'name':_0x49ff46[_0xd0d2('0x31')],'type':_0x49ff46[_0xd0d2('0x32')][_0xd0d2('0x33')]};});_0x183615[_0xd0d2('0x34')]=_[_0xd0d2('0x2f')](_0x9270b8,_0xd0d2('0x2c'));_0x183615['query']=_[_0xd0d2('0x35')](_0x5c48a4[_0xd0d2('0x36')]);_0x183615[_0xd0d2('0x37')]=_[_0xd0d2('0x38')](_0x183615[_0xd0d2('0x34')],_0x183615['query']);_0x445d81[_0xd0d2('0x39')]=_[_0xd0d2('0x38')](_0x183615[_0xd0d2('0x34')],qs[_0xd0d2('0x3a')](_0x5c48a4['query'][_0xd0d2('0x3a')]));_0x445d81[_0xd0d2('0x39')]=_0x445d81[_0xd0d2('0x39')]['length']?_0x445d81['attributes']:_0x183615[_0xd0d2('0x34')];if(!_0x5c48a4['query'][_0xd0d2('0x3b')](_0xd0d2('0x3c'))){_0x445d81[_0xd0d2('0x21')]=qs[_0xd0d2('0x21')](_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x21')]);_0x445d81[_0xd0d2('0x24')]=qs[_0xd0d2('0x24')](_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x24')]);}_0x445d81[_0xd0d2('0x3d')]=qs[_0xd0d2('0x3e')](_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x3e')]);_0x445d81[_0xd0d2('0x3f')]=qs[_0xd0d2('0x37')](_[_0xd0d2('0x40')](_0x5c48a4[_0xd0d2('0x36')],_0x183615['filters']),_0x9270b8);if(_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x41')]){_0x445d81[_0xd0d2('0x3f')]=_[_0xd0d2('0x42')](_0x445d81[_0xd0d2('0x3f')],{'$or':_[_0xd0d2('0x2f')](_0x9270b8,function(_0x315d91){if(_0x315d91['type']!==_0xd0d2('0x43')){var _0x226641={};_0x226641[_0x315d91[_0xd0d2('0x2c')]]={'$like':'%'+_0x5c48a4[_0xd0d2('0x36')][_0xd0d2('0x41')]+'%'};return _0x226641;}})});}_0x445d81=_['merge']({},_0x445d81,_0x5c48a4[_0xd0d2('0x44')]);var _0x3e9de6={'where':_0x445d81[_0xd0d2('0x3f')]};return db[_0xd0d2('0x45')][_0xd0d2('0x23')](_0x3e9de6)['then'](function(_0x3217f0){_0x59d97d['count']=_0x3217f0;if(_0x5c48a4[_0xd0d2('0x36')]['includeAll']){_0x445d81[_0xd0d2('0x46')]=[{'all':!![]}];}return db[_0xd0d2('0x45')][_0xd0d2('0x47')](_0x445d81);})[_0xd0d2('0x29')](function(_0x259242){_0x59d97d['rows']=_0x259242;return _0x59d97d;})[_0xd0d2('0x29')](respondWithFilteredResult(_0x1b1f74,_0x445d81))[_0xd0d2('0x48')](handleError(_0x1b1f74,null));};exports['show']=function(_0x59133c,_0x723efb){var _0x3cba41={'raw':!![],'where':{'id':_0x59133c[_0xd0d2('0x49')]['id']}},_0x4e0746={};_0x4e0746[_0xd0d2('0x34')]=_[_0xd0d2('0x35')](db[_0xd0d2('0x45')]['rawAttributes']);_0x4e0746[_0xd0d2('0x36')]=_[_0xd0d2('0x35')](_0x59133c[_0xd0d2('0x36')]);_0x4e0746[_0xd0d2('0x37')]=_[_0xd0d2('0x38')](_0x4e0746['model'],_0x4e0746[_0xd0d2('0x36')]);_0x3cba41[_0xd0d2('0x39')]=_[_0xd0d2('0x38')](_0x4e0746['model'],qs[_0xd0d2('0x3a')](_0x59133c[_0xd0d2('0x36')][_0xd0d2('0x3a')]));_0x3cba41['attributes']=_0x3cba41[_0xd0d2('0x39')][_0xd0d2('0x4a')]?_0x3cba41[_0xd0d2('0x39')]:_0x4e0746['model'];if(_0x59133c['query'][_0xd0d2('0x4b')]){_0x3cba41[_0xd0d2('0x46')]=[{'all':!![]}];}_0x3cba41=_[_0xd0d2('0x42')]({},_0x3cba41,_0x59133c['options']);return db[_0xd0d2('0x45')][_0xd0d2('0x4c')](_0x3cba41)[_0xd0d2('0x29')](handleEntityNotFound(_0x723efb,null))['then'](respondWithResult(_0x723efb,null))[_0xd0d2('0x48')](handleError(_0x723efb,null));};exports[_0xd0d2('0x4d')]=function(_0x299f75,_0x30cc69){return db[_0xd0d2('0x45')][_0xd0d2('0x4d')](_0x299f75[_0xd0d2('0x4e')],{})[_0xd0d2('0x29')](respondWithResult(_0x30cc69,0xc9))[_0xd0d2('0x48')](handleError(_0x30cc69,null));};exports[_0xd0d2('0x28')]=function(_0x2dfd59,_0x41ff58){if(_0x2dfd59['body']['id']){delete _0x2dfd59[_0xd0d2('0x4e')]['id'];}return db[_0xd0d2('0x45')][_0xd0d2('0x4c')]({'where':{'id':_0x2dfd59['params']['id']}})[_0xd0d2('0x29')](handleEntityNotFound(_0x41ff58,null))[_0xd0d2('0x29')](saveUpdates(_0x2dfd59['body'],null))[_0xd0d2('0x29')](respondWithResult(_0x41ff58,null))[_0xd0d2('0x48')](handleError(_0x41ff58,null));};exports['destroy']=function(_0x181db4,_0x1fe7b6){return db[_0xd0d2('0x45')]['find']({'where':{'id':_0x181db4[_0xd0d2('0x49')]['id']}})['then'](handleEntityNotFound(_0x1fe7b6,null))[_0xd0d2('0x29')](removeEntity(_0x1fe7b6,null))[_0xd0d2('0x48')](handleError(_0x1fe7b6,null));};exports[_0xd0d2('0x4f')]=function(_0x51893f,_0x5dd716){return db[_0xd0d2('0x45')]['describe']()[_0xd0d2('0x29')](respondWithResult(_0x5dd716,null))[_0xd0d2('0x48')](handleError(_0x5dd716,null));};function wrapUser(_0x338f23){return function(_0x1fc6cf){var _0x505381=_0x338f23[_0xd0d2('0x50')]({'plain':!![]});_0x505381[_0xd0d2('0x51')]=[];if(_0x1fc6cf){_0x505381['lastMessageAt']=_0x1fc6cf['createdAt'];_0x505381[_0xd0d2('0x52')]=_0x1fc6cf;}else{_0x505381[_0xd0d2('0x53')]=moment(0x0)['format'](_0xd0d2('0x54'));_0x505381[_0xd0d2('0x52')]={};}return _0x505381;};}exports['getUsers']=function(_0x3434c0,_0x22cbbe,_0xa86f61){var _0x267ee6=[];return db[_0xd0d2('0x55')][_0xd0d2('0x47')]({'where':{'role':[_0xd0d2('0x56'),_0xd0d2('0x57'),'user']},'attributes':['id','fullname',_0xd0d2('0x2c'),_0xd0d2('0x58'),_0xd0d2('0x59'),_0xd0d2('0x5a'),'online',_0xd0d2('0x5b'),_0xd0d2('0x5c'),'showWebBar'],'order':qs[_0xd0d2('0x3e')](_0xd0d2('0x5d')),'include':[{'model':db[_0xd0d2('0x5e')],'as':_0xd0d2('0x5f'),'attributes':['id','name',_0xd0d2('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x3363c3){if(_0x3363c3){var _0x5afe84=_0x3434c0[_0xd0d2('0x60')][_0xd0d2('0x50')]({'plain':!![]});if(!_0x5afe84)throw new Error(_0xd0d2('0x61'));if(_0x5afe84[_0xd0d2('0x58')]===_0xd0d2('0x60')){return db[_0xd0d2('0x62')][_0xd0d2('0x4c')]({'where':{'name':_0xd0d2('0x63'),'userProfileId':_0x5afe84[_0xd0d2('0x64')]},'raw':!![]})[_0xd0d2('0x29')](function(_0x2dc540){if(_0x2dc540){if(_0x2dc540[_0xd0d2('0x65')]===0x0){return db[_0xd0d2('0x66')]['findAll']({'where':{'sectionId':_0x2dc540['id']},'raw':!![]})[_0xd0d2('0x29')](function(_0x3cdd55){var _0xd05037=[];if(_[_0xd0d2('0x67')](_0x3cdd55)){_0xd05037=_[_0xd0d2('0x41')](_0x3363c3,function(_0x3f0961){if(_0x3f0961[_0xd0d2('0x58')]!==_0xd0d2('0x56')){return _0x3f0961;}});return _0xd05037;}else{for(var _0x223d27=0x0;_0x223d27<_0x3363c3[_0xd0d2('0x4a')];_0x223d27++){var _0xdd0480=_0x3363c3[_0x223d27];if(_0xdd0480[_0xd0d2('0x58')]===_0xd0d2('0x56')){var _0x496227=_[_0xd0d2('0x4c')](_0x3cdd55,function(_0xc1acd4){return _0xc1acd4[_0xd0d2('0x68')]===_0xdd0480['id'];});if(_0x496227)_0xd05037['push'](_0xdd0480);}else{_0xd05037[_0xd0d2('0x69')](_0xdd0480);}}return _0xd05037;}});}else{return _0x3363c3;}}else{var _0x1034e4=_['filter'](_0x3363c3,function(_0x571a43){if(_0x571a43[_0xd0d2('0x58')]!==_0xd0d2('0x56')){return _0x571a43;}});return _0x1034e4;}});}else{return _0x3363c3;}}})['then'](function(_0x318ddf){var _0x83db67=[];if(_0x318ddf){_0x267ee6=_0x318ddf;for(var _0xa54021=0x0;_0xa54021<_0x318ddf[_0xd0d2('0x4a')];_0xa54021+=0x1){_0x267ee6[_0xa54021][_0xd0d2('0x51')]=[];_0x83db67['push'](db[_0xd0d2('0x45')]['find']({'where':{'FromId':[_0x3434c0[_0xd0d2('0x60')]['id'],_0x318ddf[_0xa54021]['id']],'ToId':[_0x3434c0['user']['id'],_0x318ddf[_0xa54021]['id']],'ChatGroupId':null},'attributes':['id',_0xd0d2('0x6a'),_0xd0d2('0x6b'),_0xd0d2('0x6c'),_0xd0d2('0x6d'),_0xd0d2('0x4e')],'order':qs[_0xd0d2('0x3e')](_0xd0d2('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd0d2('0x29')](wrapUser(_0x318ddf[_0xa54021])));}return BPromise[_0xd0d2('0x6f')](_0x83db67);}return[];})[_0xd0d2('0x29')](function(_0x4f0123){return{'rows':_0x4f0123,'count':_0x4f0123[_0xd0d2('0x4a')]};})[_0xd0d2('0x29')](respondWithResult(_0x22cbbe,null))[_0xd0d2('0x48')](handleError(_0x22cbbe,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ea41d1b..72ba116 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 _0x1c9e=['save','update','remove','emit','hook','exports','../../mysqldb','ChatInternalMessage'];(function(_0x5da2bd,_0x10eaab){var _0x59b4ce=function(_0x1362ae){while(--_0x1362ae){_0x5da2bd['push'](_0x5da2bd['shift']());}};_0x59b4ce(++_0x10eaab);}(_0x1c9e,0x146));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xe1c9('0x0'))['db'][_0xe1c9('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1c9('0x2'),'afterUpdate':_0xe1c9('0x3'),'afterDestroy':_0xe1c9('0x4')};function emitEvent(_0xbd2502){return function(_0x186359,_0x1b8a78,_0x3212b4){ChatInternalMessageEvents['emit'](_0xbd2502+':'+_0x186359['id'],_0x186359);ChatInternalMessageEvents[_0xe1c9('0x5')](_0xbd2502,_0x186359);_0x3212b4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xe1c9('0x6')](e,emitEvent(event));}}module[_0xe1c9('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xb63d=['exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1ff7b4,_0x28ea89){var _0x34a452=function(_0x22ad3a){while(--_0x22ad3a){_0x1ff7b4['push'](_0x1ff7b4['shift']());}};_0x34a452(++_0x28ea89);}(_0xb63d,0x83));var _0xdb63=function(_0x2a2d81,_0x1fb7e7){_0x2a2d81=_0x2a2d81-0x0;var _0x29a338=_0xb63d[_0x2a2d81];return _0x29a338;};'use strict';var EventEmitter=require(_0xdb63('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xdb63('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdb63('0x2')](0x0);var events={'afterCreate':_0xdb63('0x3'),'afterUpdate':_0xdb63('0x4'),'afterDestroy':_0xdb63('0x5')};function emitEvent(_0x4d8097){return function(_0x50c54f,_0x1fcdcb,_0x535271){ChatInternalMessageEvents[_0xdb63('0x6')](_0x4d8097+':'+_0x50c54f['id'],_0x50c54f);ChatInternalMessageEvents[_0xdb63('0x6')](_0x4d8097,_0x50c54f);_0x535271(null);};}for(var e in events){if(events[_0xdb63('0x7')](e)){var event=events[e];ChatInternalMessage[_0xdb63('0x8')](e,emitEvent(event));}}module[_0xdb63('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c411071..f418796 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 _0x9a3b=['../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3f044e,_0x56ddcf){var _0x1ff697=function(_0x5c76e4){while(--_0x5c76e4){_0x3f044e['push'](_0x3f044e['shift']());}};_0x1ff697(++_0x56ddcf);}(_0x9a3b,0xbd));var _0xb9a3=function(_0x1411e8,_0x249a68){_0x1411e8=_0x1411e8-0x0;var _0x5b844e=_0x9a3b[_0x1411e8];return _0x5b844e;};'use strict';var _=require(_0xb9a3('0x0'));var util=require(_0xb9a3('0x1'));var logger=require(_0xb9a3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb9a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9a3('0x4'));var rimraf=require(_0xb9a3('0x5'));var config=require(_0xb9a3('0x6'));var attributes=require(_0xb9a3('0x7'));module['exports']=function(_0x7b0d5e,_0x2c7631){return _0x7b0d5e[_0xb9a3('0x8')](_0xb9a3('0x9'),attributes,{'tableName':_0xb9a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9a3('0xb'),'collate':_0xb9a3('0xc')});}; \ No newline at end of file +var _0x61e2=['request-promise','rimraf','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x5eb6e6,_0x17f551){var _0x35c38b=function(_0xa3592){while(--_0xa3592){_0x5eb6e6['push'](_0x5eb6e6['shift']());}};_0x35c38b(++_0x17f551);}(_0x61e2,0x10e));var _0x261e=function(_0x113129,_0x3c4b4b){_0x113129=_0x113129-0x0;var _0xf36838=_0x61e2[_0x113129];return _0xf36838;};'use strict';var _=require(_0x261e('0x0'));var util=require(_0x261e('0x1'));var logger=require(_0x261e('0x2'))(_0x261e('0x3'));var moment=require('moment');var BPromise=require(_0x261e('0x4'));var rp=require(_0x261e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x261e('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x261e('0x7')]=function(_0x5c3fee,_0x5f12b9){return _0x5c3fee['define'](_0x261e('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x261e('0x9'),'collate':_0x261e('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 8ae9aef..28cc775 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 _0x6909=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','bluebird','randomstring'];(function(_0x45030e,_0x32b6b8){var _0x4df3be=function(_0x1fe781){while(--_0x1fe781){_0x45030e['push'](_0x45030e['shift']());}};_0x4df3be(++_0x32b6b8);}(_0x6909,0x1e3));var _0x9690=function(_0xc8c5bf,_0x5af025){_0xc8c5bf=_0xc8c5bf-0x0;var _0x5d53af=_0x6909[_0xc8c5bf];return _0x5d53af;};'use strict';var _=require('lodash');var util=require(_0x9690('0x0'));var moment=require('moment');var BPromise=require(_0x9690('0x1'));var rs=require(_0x9690('0x2'));var fs=require('fs');var Redis=require(_0x9690('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9690('0x4'));var logger=require(_0x9690('0x5'))(_0x9690('0x6'));var config=require('../../config/environment');var jayson=require(_0x9690('0x7'));var client=jayson[_0x9690('0x8')][_0x9690('0x9')]({'port':0x232a});config[_0x9690('0xa')]=_[_0x9690('0xb')](config[_0x9690('0xa')],{'host':_0x9690('0xc'),'port':0x18eb});var socket=require(_0x9690('0xd'))(new Redis(config[_0x9690('0xa')]));require(_0x9690('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c89e0,_0x2658c6,_0x24eae8){return new BPromise(function(_0x39847f,_0x12b229){return client[_0x9690('0xf')](_0x3c89e0,_0x24eae8)[_0x9690('0x10')](function(_0x201381){logger[_0x9690('0x11')](_0x9690('0x12'),_0x2658c6,'request\x20sent');logger[_0x9690('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2658c6,'request\x20sent',JSON[_0x9690('0x14')](_0x201381));if(_0x201381[_0x9690('0x15')]){if(_0x201381[_0x9690('0x15')][_0x9690('0x16')]===0x1f4){logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x12b229(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}logger[_0x9690('0x15')](_0x9690('0x12'),_0x2658c6,_0x201381[_0x9690('0x15')][_0x9690('0x17')]);return _0x39847f(_0x201381[_0x9690('0x15')][_0x9690('0x17')]);}else{logger['info'](_0x9690('0x12'),_0x2658c6,_0x9690('0x18'));_0x39847f(_0x201381[_0x9690('0x19')][_0x9690('0x17')]);}})[_0x9690('0x1a')](function(_0x3ad729){logger[_0x9690('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2658c6,_0x3ad729);_0x12b229(_0x3ad729);});});} \ No newline at end of file +var _0xafc6=['http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1e6737,_0x3a00b9){var _0x13209b=function(_0x161523){while(--_0x161523){_0x1e6737['push'](_0x1e6737['shift']());}};_0x13209b(++_0x3a00b9);}(_0xafc6,0xf9));var _0x6afc=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xafc6[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x6afc('0x0'));var util=require(_0x6afc('0x1'));var moment=require(_0x6afc('0x2'));var BPromise=require(_0x6afc('0x3'));var rs=require(_0x6afc('0x4'));var fs=require('fs');var Redis=require(_0x6afc('0x5'));var db=require(_0x6afc('0x6'))['db'];var utils=require(_0x6afc('0x7'));var logger=require('../../config/logger')(_0x6afc('0x8'));var config=require(_0x6afc('0x9'));var jayson=require(_0x6afc('0xa'));var client=jayson[_0x6afc('0xb')][_0x6afc('0xc')]({'port':0x232a});config[_0x6afc('0xd')]=_[_0x6afc('0xe')](config[_0x6afc('0xd')],{'host':_0x6afc('0xf'),'port':0x18eb});var socket=require(_0x6afc('0x10'))(new Redis(config[_0x6afc('0xd')]));require('./chatInternalMessage.socket')[_0x6afc('0x11')](socket);function respondWithRpcPromise(_0x252760,_0x5b68d6,_0x4dc0ab){return new BPromise(function(_0x51454f,_0x3d687e){return client['request'](_0x252760,_0x4dc0ab)[_0x6afc('0x12')](function(_0x39348d){logger[_0x6afc('0x13')](_0x6afc('0x14'),_0x5b68d6,_0x6afc('0x15'));logger[_0x6afc('0x16')](_0x6afc('0x17'),_0x5b68d6,_0x6afc('0x15'),JSON[_0x6afc('0x18')](_0x39348d));if(_0x39348d[_0x6afc('0x19')]){if(_0x39348d[_0x6afc('0x19')]['code']===0x1f4){logger[_0x6afc('0x19')](_0x6afc('0x14'),_0x5b68d6,_0x39348d[_0x6afc('0x19')][_0x6afc('0x1a')]);return _0x3d687e(_0x39348d[_0x6afc('0x19')][_0x6afc('0x1a')]);}logger[_0x6afc('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x5b68d6,_0x39348d[_0x6afc('0x19')][_0x6afc('0x1a')]);return _0x51454f(_0x39348d['error']['message']);}else{logger[_0x6afc('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x5b68d6,'request\x20sent');_0x51454f(_0x39348d[_0x6afc('0x1b')][_0x6afc('0x1a')]);}})[_0x6afc('0x1c')](function(_0x1ed261){logger[_0x6afc('0x19')](_0x6afc('0x14'),_0x5b68d6,_0x1ed261);_0x3d687e(_0x1ed261);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 6191799..107db1f 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 _0xeb24=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0xecd71a,_0x3543fd){var _0x445a0a=function(_0x5e68f2){while(--_0x5e68f2){_0xecd71a['push'](_0xecd71a['shift']());}};_0x445a0a(++_0x3543fd);}(_0xeb24,0x9d));var _0x4eb2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xeb24[_0x1694f5];return _0x5b4321;};'use strict';var ChatInternalMessageEvents=require(_0x4eb2('0x0'));var events=[_0x4eb2('0x1'),_0x4eb2('0x2'),_0x4eb2('0x3')];function createListener(_0x2217f5,_0x445280){return function(_0x388845){_0x445280['emit'](_0x2217f5,_0x388845);};}function removeListener(_0x26a55e,_0x3e4ce9){return function(){ChatInternalMessageEvents[_0x4eb2('0x4')](_0x26a55e,_0x3e4ce9);};}exports['register']=function(_0x15df94){for(var _0x5917c9=0x0,_0x230c79=events[_0x4eb2('0x5')];_0x5917c9<_0x230c79;_0x5917c9++){var _0x1c59fc=events[_0x5917c9];var _0x1afc00=createListener(_0x4eb2('0x6')+_0x1c59fc,_0x15df94);ChatInternalMessageEvents['on'](_0x1c59fc,_0x1afc00);}}; \ No newline at end of file +var _0xf11f=['update','emit','removeListener','register','length','save','remove'];(function(_0x14f137,_0x3670a7){var _0x6169b6=function(_0x1f076e){while(--_0x1f076e){_0x14f137['push'](_0x14f137['shift']());}};_0x6169b6(++_0x3670a7);}(_0xf11f,0x1a9));var _0xff11=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xf11f[_0xf6e75d];return _0x27514d;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xff11('0x0'),_0xff11('0x1'),_0xff11('0x2')];function createListener(_0x396e19,_0x3af83a){return function(_0x370f84){_0x3af83a[_0xff11('0x3')](_0x396e19,_0x370f84);};}function removeListener(_0x325f44,_0x1234d8){return function(){ChatInternalMessageEvents[_0xff11('0x4')](_0x325f44,_0x1234d8);};}exports[_0xff11('0x5')]=function(_0x4a846c){for(var _0x4cc7e9=0x0,_0x124c42=events[_0xff11('0x6')];_0x4cc7e9<_0x124c42;_0x4cc7e9++){var _0x39d076=events[_0x4cc7e9];var _0x47609a=createListener('chatInternalMessage:'+_0x39d076,_0x4a846c);ChatInternalMessageEvents['on'](_0x39d076,_0x47609a);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 2faff9f..c793dd7 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 _0x9028=['/describe','describe','/users','getUsers','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x9028,0x137));var _0x8902=function(_0xfb4ed5,_0x3ebd19){_0xfb4ed5=_0xfb4ed5-0x0;var _0x581224=_0x9028[_0xfb4ed5];return _0x581224;};'use strict';var multer=require(_0x8902('0x0'));var util=require(_0x8902('0x1'));var path=require(_0x8902('0x2'));var timeout=require(_0x8902('0x3'));var express=require(_0x8902('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8902('0x5'));var interaction=require(_0x8902('0x6'));var config=require(_0x8902('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x8902('0x8')]('/',auth[_0x8902('0x9')](),controller[_0x8902('0xa')]);router[_0x8902('0x8')](_0x8902('0xb'),auth[_0x8902('0x9')](),controller[_0x8902('0xc')]);router['get'](_0x8902('0xd'),auth[_0x8902('0x9')](),controller[_0x8902('0xe')]);router[_0x8902('0x8')](_0x8902('0xf'),auth[_0x8902('0x9')](),controller[_0x8902('0x10')]);router[_0x8902('0x11')]('/',auth[_0x8902('0x9')](),controller[_0x8902('0x12')]);router[_0x8902('0x13')]('/:id',controller[_0x8902('0x14')]);router['delete'](_0x8902('0xf'),auth[_0x8902('0x9')](),controller[_0x8902('0x15')]);module[_0x8902('0x16')]=router; \ No newline at end of file +var _0xe8e6=['../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','getUsers','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe8e6,0x1c3));var _0x6e8e=function(_0x12c66e,_0xea7b4){_0x12c66e=_0x12c66e-0x0;var _0x19481a=_0xe8e6[_0x12c66e];return _0x19481a;};'use strict';var multer=require(_0x6e8e('0x0'));var util=require(_0x6e8e('0x1'));var path=require(_0x6e8e('0x2'));var timeout=require(_0x6e8e('0x3'));var express=require(_0x6e8e('0x4'));var router=express[_0x6e8e('0x5')]();var fs_extra=require(_0x6e8e('0x6'));var auth=require(_0x6e8e('0x7'));var interaction=require(_0x6e8e('0x8'));var config=require(_0x6e8e('0x9'));var controller=require(_0x6e8e('0xa'));router[_0x6e8e('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6e8e('0xb')](_0x6e8e('0xc'),auth[_0x6e8e('0xd')](),controller[_0x6e8e('0xe')]);router['get']('/users',auth['isAuthenticated'](),controller[_0x6e8e('0xf')]);router[_0x6e8e('0xb')](_0x6e8e('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x6e8e('0x11')]('/',auth[_0x6e8e('0xd')](),controller[_0x6e8e('0x12')]);router['put'](_0x6e8e('0x10'),controller[_0x6e8e('0x13')]);router[_0x6e8e('0x14')](_0x6e8e('0x10'),auth[_0x6e8e('0xd')](),controller[_0x6e8e('0x15')]);module[_0x6e8e('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index a234ecc..38b7dbf 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 _0xadcc=['TEXT','medium','BOOLEAN','ENUM','DATE','STRING','sequelize'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xadcc,0x76));var _0xcadc=function(_0x52d8ae,_0x372b3e){_0x52d8ae=_0x52d8ae-0x0;var _0x43c27b=_0xadcc[_0x52d8ae];return _0x43c27b;};'use strict';var Sequelize=require(_0xcadc('0x0'));module['exports']={'body':{'type':Sequelize[_0xcadc('0x1')](_0xcadc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcadc('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcadc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcadc('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xcadc('0x5')]},'providerName':{'type':Sequelize[_0xcadc('0x6')]},'providerResponse':{'type':Sequelize[_0xcadc('0x1')]}}; \ No newline at end of file +var _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x46bc83,_0xb1194e){var _0x51be8d=function(_0x4d97b6){while(--_0x4d97b6){_0x46bc83['push'](_0x46bc83['shift']());}};_0x51be8d(++_0xb1194e);}(_0x1bd1,0x123));var _0x11bd=function(_0x57b6ae,_0x2ca66e){_0x57b6ae=_0x57b6ae-0x0;var _0x8d7f4a=_0x1bd1[_0x57b6ae];return _0x8d7f4a;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index fec7052..30b1261 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 _0xb13a=['apply','save','update','sendStatus','name','send','index','map','ChatMessage','rawAttributes','type','key','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','Sequelize','interface','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','http','client','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','result','end','json','offset','undefined','limit','count','status','Content-Range'];(function(_0x438dab,_0x2d002a){var _0x416056=function(_0x14715a){while(--_0x14715a){_0x438dab['push'](_0x438dab['shift']());}};_0x416056(++_0x2d002a);}(_0xb13a,0x1ee));var _0xab13=function(_0x4480a6,_0x8cd58e){_0x4480a6=_0x4480a6-0x0;var _0x162965=_0xb13a[_0x4480a6];return _0x162965;};'use strict';var emlformat=require(_0xab13('0x0'));var rimraf=require(_0xab13('0x1'));var zipdir=require(_0xab13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab13('0x3'));var moment=require(_0xab13('0x4'));var BPromise=require(_0xab13('0x5'));var Mustache=require(_0xab13('0x6'));var util=require(_0xab13('0x7'));var path=require(_0xab13('0x8'));var sox=require(_0xab13('0x9'));var csv=require(_0xab13('0xa'));var ejs=require(_0xab13('0xb'));var fs=require('fs');var fs_extra=require(_0xab13('0xc'));var _=require(_0xab13('0xd'));var squel=require('squel');var crypto=require(_0xab13('0xe'));var jsforce=require(_0xab13('0xf'));var deskjs=require(_0xab13('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab13('0x11'));var Redis=require(_0xab13('0x12'));var authService=require(_0xab13('0x13'));var qs=require(_0xab13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab13('0x15'));var logger=require(_0xab13('0x16'))(_0xab13('0x17'));var utils=require(_0xab13('0x18'));var config=require(_0xab13('0x19'));var licenseUtil=require(_0xab13('0x1a'));var db=require(_0xab13('0x1b'))['db'];config[_0xab13('0x1c')]=_[_0xab13('0x1d')](config['redis'],{'host':_0xab13('0x1e'),'port':0x18eb});var socket=require(_0xab13('0x1f'))(new Redis(config[_0xab13('0x1c')]));require(_0xab13('0x20'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xab13('0x21')]({'port':0x232c});var client9002=jayson[_0xab13('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d2cfd,_0x42e85e,_0x5b9b66,_0x3cb6f4){return new BPromise(function(_0xcfb8d8,_0x4868a9){var _0x608187=_0x3cb6f4||client;return _0x608187['request'](_0x2d2cfd,_0x5b9b66)[_0xab13('0x23')](function(_0x4c8cf9){logger[_0xab13('0x24')]('ChatMessage,\x20%s,\x20%s',_0x42e85e,'request\x20sent');logger[_0xab13('0x25')](_0xab13('0x26'),_0x42e85e,_0xab13('0x27'),JSON[_0xab13('0x28')](_0x4c8cf9));if(_0x4c8cf9['error']){if(_0x4c8cf9['error'][_0xab13('0x29')]===0x1f4){logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x4c8cf9[_0xab13('0x2a')][_0xab13('0x2c')]);return _0x4868a9(_0x4c8cf9[_0xab13('0x2a')]['message']);}logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x4c8cf9[_0xab13('0x2a')][_0xab13('0x2c')]);return _0xcfb8d8(_0x4c8cf9['error'][_0xab13('0x2c')]);}else{logger['info'](_0xab13('0x2b'),_0x42e85e,_0xab13('0x27'));_0xcfb8d8(_0x4c8cf9[_0xab13('0x2d')]['message']);}})['catch'](function(_0x32f8ce){logger[_0xab13('0x2a')](_0xab13('0x2b'),_0x42e85e,_0x32f8ce);_0x4868a9(_0x32f8ce);});});}function respondWithStatusCode(_0x16d52b,_0x5e3a5a){_0x5e3a5a=_0x5e3a5a||0xcc;return function(_0x5f38f4){if(_0x5f38f4){return _0x16d52b['sendStatus'](_0x5e3a5a);}return _0x16d52b['status'](_0x5e3a5a)[_0xab13('0x2e')]();};}function respondWithResult(_0x351126,_0x203ba6){_0x203ba6=_0x203ba6||0xc8;return function(_0x13576a){if(_0x13576a){return _0x351126['status'](_0x203ba6)[_0xab13('0x2f')](_0x13576a);}};}function respondWithFilteredResult(_0x1f8d22,_0x32703d){return function(_0x38e41a){if(_0x38e41a){var _0x33664f=typeof _0x32703d[_0xab13('0x30')]===_0xab13('0x31')&&typeof _0x32703d[_0xab13('0x32')]===_0xab13('0x31');var _0x24b5c4=_0x38e41a[_0xab13('0x33')];var _0x54a1da=_0x33664f?0x0:_0x32703d[_0xab13('0x30')];var _0x388629=_0x33664f?_0x38e41a[_0xab13('0x33')]:_0x32703d['offset']+_0x32703d[_0xab13('0x32')];var _0x59521f;if(_0x388629>=_0x24b5c4){_0x388629=_0x24b5c4;_0x59521f=0xc8;}else{_0x59521f=0xce;}_0x1f8d22[_0xab13('0x34')](_0x59521f);return _0x1f8d22['set'](_0xab13('0x35'),_0x54a1da+'-'+_0x388629+'/'+_0x24b5c4)['json'](_0x38e41a);}return null;};}function patchUpdates(_0x31a475){return function(_0x1a136f){try{jsonpatch[_0xab13('0x36')](_0x1a136f,_0x31a475,!![]);}catch(_0x358e1b){return BPromise['reject'](_0x358e1b);}return _0x1a136f[_0xab13('0x37')]();};}function saveUpdates(_0x3d14e2,_0x5cfd7a){return function(_0x47e893){if(_0x47e893){return _0x47e893[_0xab13('0x38')](_0x3d14e2)[_0xab13('0x23')](function(_0x3b81f7){return _0x3b81f7;});}return null;};}function removeEntity(_0x23a57d,_0x2546b1){return function(_0x224718){if(_0x224718){return _0x224718['destroy']()[_0xab13('0x23')](function(){_0x23a57d[_0xab13('0x34')](0xcc)[_0xab13('0x2e')]();});}};}function handleEntityNotFound(_0x32b9ea,_0x120b0e){return function(_0x401dc8){if(!_0x401dc8){_0x32b9ea[_0xab13('0x39')](0x194);}return _0x401dc8;};}function handleError(_0x70bcda,_0x543107){_0x543107=_0x543107||0x1f4;return function(_0x299f25){logger['error'](_0x299f25['stack']);if(_0x299f25[_0xab13('0x3a')]){delete _0x299f25[_0xab13('0x3a')];}_0x70bcda[_0xab13('0x34')](_0x543107)[_0xab13('0x3b')](_0x299f25);};}exports[_0xab13('0x3c')]=function(_0x55a19b,_0x59432d){var _0x5245a5={},_0x58254f={},_0x3e7461={'count':0x0,'rows':[]};var _0x2dd284=_[_0xab13('0x3d')](db[_0xab13('0x3e')][_0xab13('0x3f')],function(_0x507519){return{'name':_0x507519['fieldName'],'type':_0x507519[_0xab13('0x40')][_0xab13('0x41')]};});_0x58254f['model']=_[_0xab13('0x3d')](_0x2dd284,'name');_0x58254f['query']=_['keys'](_0x55a19b['query']);_0x58254f[_0xab13('0x42')]=_[_0xab13('0x43')](_0x58254f[_0xab13('0x44')],_0x58254f['query']);_0x5245a5[_0xab13('0x45')]=_[_0xab13('0x43')](_0x58254f['model'],qs[_0xab13('0x46')](_0x55a19b[_0xab13('0x47')][_0xab13('0x46')]));_0x5245a5[_0xab13('0x45')]=_0x5245a5[_0xab13('0x45')][_0xab13('0x48')]?_0x5245a5[_0xab13('0x45')]:_0x58254f['model'];if(!_0x55a19b['query'][_0xab13('0x49')](_0xab13('0x4a'))){_0x5245a5[_0xab13('0x32')]=qs[_0xab13('0x32')](_0x55a19b[_0xab13('0x47')][_0xab13('0x32')]);_0x5245a5[_0xab13('0x30')]=qs[_0xab13('0x30')](_0x55a19b[_0xab13('0x47')][_0xab13('0x30')]);}_0x5245a5[_0xab13('0x4b')]=qs[_0xab13('0x4c')](_0x55a19b[_0xab13('0x47')]['sort']);_0x5245a5[_0xab13('0x4d')]=qs[_0xab13('0x42')](_[_0xab13('0x4e')](_0x55a19b[_0xab13('0x47')],_0x58254f[_0xab13('0x42')]),_0x2dd284);if(_0x55a19b[_0xab13('0x47')][_0xab13('0x4f')]){_0x5245a5[_0xab13('0x4d')]=_[_0xab13('0x50')](_0x5245a5[_0xab13('0x4d')],{'$or':_[_0xab13('0x3d')](_0x2dd284,function(_0xe2558b){if(_0xe2558b[_0xab13('0x40')]!==_0xab13('0x51')){var _0x312efb={};_0x312efb[_0xe2558b[_0xab13('0x3a')]]={'$like':'%'+_0x55a19b[_0xab13('0x47')]['filter']+'%'};return _0x312efb;}})});}_0x5245a5=_[_0xab13('0x50')]({},_0x5245a5,_0x55a19b['options']);var _0x842ad8={'where':_0x5245a5[_0xab13('0x4d')]};return db[_0xab13('0x3e')]['count'](_0x842ad8)[_0xab13('0x23')](function(_0x3a2c32){_0x3e7461['count']=_0x3a2c32;if(_0x55a19b[_0xab13('0x47')][_0xab13('0x52')]){_0x5245a5[_0xab13('0x53')]=[{'all':!![]}];}return db[_0xab13('0x3e')][_0xab13('0x54')](_0x5245a5);})['then'](function(_0xc7273c){_0x3e7461[_0xab13('0x55')]=_0xc7273c;return _0x3e7461;})[_0xab13('0x23')](respondWithFilteredResult(_0x59432d,_0x5245a5))[_0xab13('0x56')](handleError(_0x59432d,null));};exports[_0xab13('0x57')]=function(_0xd24b55,_0x5abc13){var _0x427c57={'raw':!![],'where':{'id':_0xd24b55[_0xab13('0x58')]['id']}},_0x42914a={};_0x42914a[_0xab13('0x44')]=_[_0xab13('0x59')](db[_0xab13('0x3e')][_0xab13('0x3f')]);_0x42914a[_0xab13('0x47')]=_[_0xab13('0x59')](_0xd24b55[_0xab13('0x47')]);_0x42914a[_0xab13('0x42')]=_[_0xab13('0x43')](_0x42914a[_0xab13('0x44')],_0x42914a[_0xab13('0x47')]);_0x427c57['attributes']=_[_0xab13('0x43')](_0x42914a[_0xab13('0x44')],qs['fields'](_0xd24b55[_0xab13('0x47')]['fields']));_0x427c57[_0xab13('0x45')]=_0x427c57['attributes']['length']?_0x427c57[_0xab13('0x45')]:_0x42914a[_0xab13('0x44')];if(_0xd24b55[_0xab13('0x47')][_0xab13('0x52')]){_0x427c57[_0xab13('0x53')]=[{'all':!![]}];}_0x427c57=_[_0xab13('0x50')]({},_0x427c57,_0xd24b55[_0xab13('0x5a')]);return db[_0xab13('0x3e')][_0xab13('0x5b')](_0x427c57)[_0xab13('0x23')](handleEntityNotFound(_0x5abc13,null))[_0xab13('0x23')](respondWithResult(_0x5abc13,null))[_0xab13('0x56')](handleError(_0x5abc13,null));};exports[_0xab13('0x5c')]=function(_0x31390b,_0x5b514e){return db[_0xab13('0x3e')][_0xab13('0x5c')](_0x31390b[_0xab13('0x5d')],{})[_0xab13('0x23')](respondWithResult(_0x5b514e,0xc9))['catch'](handleError(_0x5b514e,null));};exports['update']=function(_0x21394d,_0x27731a){if(_0x21394d['body']['id']){delete _0x21394d[_0xab13('0x5d')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x21394d['params']['id']}})[_0xab13('0x23')](handleEntityNotFound(_0x27731a,null))[_0xab13('0x23')](saveUpdates(_0x21394d[_0xab13('0x5d')],null))['then'](respondWithResult(_0x27731a,null))[_0xab13('0x56')](handleError(_0x27731a,null));};exports['destroy']=function(_0x1b9adc,_0x133437){return db['ChatMessage'][_0xab13('0x5b')]({'where':{'id':_0x1b9adc[_0xab13('0x58')]['id']}})['then'](handleEntityNotFound(_0x133437,null))[_0xab13('0x23')](removeEntity(_0x133437,null))[_0xab13('0x56')](handleError(_0x133437,null));};exports['describe']=function(_0x305792,_0x4ae8fb){return db['ChatMessage']['describe']()[_0xab13('0x23')](respondWithResult(_0x4ae8fb,null))['catch'](handleError(_0x4ae8fb,null));};var interaction_log=require(_0xab13('0x16'))('chat-interactions');exports['accept']=function(_0x431eac,_0x542ae8,_0x3b5f16){var _0x2ab668={'agent':{},'channel':_0xab13('0x5e')};if(_0x431eac[_0xab13('0x5d')]['id']){delete _0x431eac['body']['id'];}_0x431eac['body'][_0xab13('0x5f')]=!![];_0x431eac[_0xab13('0x5d')][_0xab13('0x60')]=moment()['format'](_0xab13('0x61'));_0x431eac[_0xab13('0x5d')]['UserId']=_0x431eac['body'][_0xab13('0x62')]||_0x431eac[_0xab13('0x63')]['id'];_0x2ab668['agent']['id']=_0x431eac[_0xab13('0x5d')][_0xab13('0x62')];return db['ChatMessage'][_0xab13('0x5b')]({'where':{'id':_0x431eac[_0xab13('0x58')]['id'],'UserId':null}})[_0xab13('0x23')](handleEntityNotFound(_0x542ae8,null))[_0xab13('0x23')](saveUpdates(_0x431eac['body'],null))['then'](function(_0x4649e9){if(_0x4649e9){_0x2ab668[_0xab13('0x2c')]=_0x4649e9['get']({'plain':!![]});return db[_0xab13('0x64')][_0xab13('0x5b')]({'where':{'id':_0x4649e9[_0xab13('0x65')]}});}return null;})[_0xab13('0x23')](handleEntityNotFound(_0x542ae8,null))[_0xab13('0x23')](function(_0x214338){if(_0x214338){return _0x214338[_0xab13('0x38')]({'UserId':_0x431eac['body']['UserId'],'read1stAt':_[_0xab13('0x66')](_0x214338[_0xab13('0x67')])?moment()['format'](_0xab13('0x61')):undefined});}return null;})[_0xab13('0x23')](function(_0xf9b0cf){if(_0xf9b0cf){_0x2ab668[_0xab13('0x68')]=_0xf9b0cf['get']({'plain':!![]});interaction_log['info'](_0xab13('0x69'),_0x431eac[_0xab13('0x63')]['id'],_0x431eac[_0xab13('0x63')][_0xab13('0x3a')],_0x431eac[_0xab13('0x63')][_0xab13('0x6a')],_0x2ab668[_0xab13('0x68')]['id'],_0x431eac[_0xab13('0x5d')]?JSON['stringify'](_0x431eac['body']):_0xab13('0x6b'));return respondWithRpcPromise(_0xab13('0x6c'),_0xab13('0x6d'),_0x2ab668);}return null;})['then'](function(_0x5041f6){var _0xb0b8ec=_0xab13('0x6e')+_0x5041f6[_0xab13('0x2c')]['ContactId'];return db['sequelize']['query'](_0xb0b8ec,{'type':db['Sequelize'][_0xab13('0x6f')][_0xab13('0x70')],'raw':!![]})[_0xab13('0x23')](function(_0x723896){return _0x723896;});})[_0xab13('0x23')](function(_0x358758){if(_0x358758){_0x2ab668[_0xab13('0x2c')][_0xab13('0x71')]=_0x358758[0x0];if(!_0x431eac[_0xab13('0x5d')][_0xab13('0x62')])return;return db[_0xab13('0x72')][_0xab13('0x5b')]({'where':{'id':_0x431eac[_0xab13('0x5d')][_0xab13('0x62')],'role':_0xab13('0x73')},'attributes':['id','name',_0xab13('0x74'),_0xab13('0x75'),_0xab13('0x76')],'raw':!![]});}return null;})[_0xab13('0x23')](function(_0x4e9ef6){if(!_0x4e9ef6)return null;_0x2ab668[_0xab13('0x2c')][_0xab13('0x73')]=_0x4e9ef6;return _0x2ab668;})[_0xab13('0x23')](function(_0x153717){if(_0x153717){if(_0x431eac[_0xab13('0x5d')][_0xab13('0x77')]){_0x2ab668[_0xab13('0x2c')]['interface']=util['format']('SIP/%s',_0x431eac[_0xab13('0x63')][_0xab13('0x3a')]);_0x2ab668[_0xab13('0x2c')][_0xab13('0x78')]=_0x2ab668['channel'];_0x2ab668[_0xab13('0x2c')][_0xab13('0x79')]=_0x2ab668[_0xab13('0x78')];_0x2ab668[_0xab13('0x2c')][_0xab13('0x7a')]=_0xab13('0x7b');return respondWithRpcPromise(_0xab13('0x7c'),'EventManager',{'event':_0xab13('0x7d'),'message':_[_0xab13('0x50')](_0x2ab668[_0xab13('0x2c')],JSON[_0xab13('0x7e')](_0x2ab668[_0xab13('0x68')][_0xab13('0x7f')]))},client9002)[_0xab13('0x23')](function(){return _0x2ab668;});}return _0x2ab668;}return null;})[_0xab13('0x23')](respondWithResult(_0x542ae8,null))[_0xab13('0x56')](handleError(_0x542ae8,null));};var interaction_log=require(_0xab13('0x16'))(_0xab13('0x80'));exports['reject']=function(_0x571d49,_0xbde7b4,_0x2de912){var _0x57ee36={'agent':{},'channel':_0xab13('0x5e')};if(_0x571d49[_0xab13('0x5d')]['id']){delete _0x571d49[_0xab13('0x5d')]['id'];}_0x571d49[_0xab13('0x5d')][_0xab13('0x62')]=_0x571d49[_0xab13('0x5d')][_0xab13('0x62')]||_0x571d49[_0xab13('0x63')]['id'];_0x57ee36[_0xab13('0x73')]['id']=_0x571d49[_0xab13('0x5d')][_0xab13('0x62')];return db[_0xab13('0x3e')][_0xab13('0x5b')]({'where':{'id':_0x571d49[_0xab13('0x58')]['id'],'UserId':null}})[_0xab13('0x23')](handleEntityNotFound(_0xbde7b4,null))['then'](function(_0x117dec){if(_0x117dec){_0x57ee36[_0xab13('0x2c')]=_0x117dec[_0xab13('0x81')]({'plain':!![]});return db[_0xab13('0x64')][_0xab13('0x5b')]({'where':{'id':_0x117dec[_0xab13('0x65')]}});}return null;})[_0xab13('0x23')](handleEntityNotFound(_0xbde7b4,null))[_0xab13('0x23')](function(_0x3a1dc3){if(_0x3a1dc3){_0x57ee36['interaction']=_0x3a1dc3[_0xab13('0x81')]({'plain':!![]});interaction_log[_0xab13('0x24')](_0xab13('0x82'),_0x571d49[_0xab13('0x63')]['id'],_0x571d49[_0xab13('0x63')][_0xab13('0x3a')],_0x571d49[_0xab13('0x63')][_0xab13('0x6a')],_0x57ee36[_0xab13('0x68')]['id'],_0x571d49['body']?JSON[_0xab13('0x28')](_0x571d49[_0xab13('0x5d')]):'null');return respondWithRpcPromise(_0xab13('0x83'),'rejectMessage',_0x57ee36);}return null;})[_0xab13('0x23')](function(_0x26613e){var _0x389b58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26613e[_0xab13('0x2c')][_0xab13('0x84')];return db[_0xab13('0x85')][_0xab13('0x47')](_0x389b58,{'type':db[_0xab13('0x86')][_0xab13('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x4dbe30){return _0x4dbe30;});})[_0xab13('0x23')](function(_0x113459){if(_0x113459){_0x57ee36[_0xab13('0x2c')][_0xab13('0x71')]=_0x113459[0x0];if(!_0x571d49[_0xab13('0x5d')]['UserId'])return;return db['User']['find']({'where':{'id':_0x571d49[_0xab13('0x5d')][_0xab13('0x62')],'role':_0xab13('0x73')},'attributes':['id',_0xab13('0x3a'),_0xab13('0x74'),_0xab13('0x75'),_0xab13('0x76')],'raw':!![]});}return null;})['then'](function(_0x33d718){if(!_0x33d718)return null;_0x57ee36[_0xab13('0x2c')][_0xab13('0x73')]=_0x33d718;return _0x57ee36;})[_0xab13('0x23')](function(_0x88cd6c){if(_0x88cd6c){_0x88cd6c[_0xab13('0x2c')][_0xab13('0x87')]=util['format']('SIP/%s',_0x571d49[_0xab13('0x63')][_0xab13('0x3a')]);_0x88cd6c[_0xab13('0x2c')]['channel']=_0x57ee36[_0xab13('0x78')];_0x88cd6c['message'][_0xab13('0x79')]=_0x57ee36[_0xab13('0x78')];_0x88cd6c[_0xab13('0x2c')]['event']='reject';respondWithRpcPromise(_0xab13('0x7c'),_0xab13('0x7c'),{'event':_0xab13('0x88'),'message':_['merge'](_0x57ee36[_0xab13('0x2c')],JSON[_0xab13('0x7e')](_0x57ee36[_0xab13('0x68')][_0xab13('0x7f')]))},client9002);return _0x57ee36;}return null;})['then'](respondWithResult(_0xbde7b4,null))[_0xab13('0x56')](handleError(_0xbde7b4,null));}; \ No newline at end of file +var _0x1b03=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatMessage','includeAll','findAll','catch','show','params','keys','find','create','body','update','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','contact','internal','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x1b03,0x190));var _0x31b0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b03[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x31b0('0x0'));var rimraf=require(_0x31b0('0x1'));var zipdir=require(_0x31b0('0x2'));var jsonpatch=require(_0x31b0('0x3'));var rp=require(_0x31b0('0x4'));var moment=require(_0x31b0('0x5'));var BPromise=require(_0x31b0('0x6'));var Mustache=require('mustache');var util=require(_0x31b0('0x7'));var path=require(_0x31b0('0x8'));var sox=require(_0x31b0('0x9'));var csv=require('to-csv');var ejs=require(_0x31b0('0xa'));var fs=require('fs');var fs_extra=require(_0x31b0('0xb'));var _=require(_0x31b0('0xc'));var squel=require('squel');var crypto=require(_0x31b0('0xd'));var jsforce=require(_0x31b0('0xe'));var deskjs=require(_0x31b0('0xf'));var toCsv=require(_0x31b0('0x10'));var querystring=require(_0x31b0('0x11'));var Papa=require(_0x31b0('0x12'));var Redis=require(_0x31b0('0x13'));var authService=require(_0x31b0('0x14'));var qs=require(_0x31b0('0x15'));var as=require(_0x31b0('0x16'));var hardwareService=require(_0x31b0('0x17'));var logger=require(_0x31b0('0x18'))('api');var utils=require(_0x31b0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x31b0('0x1a'));var db=require(_0x31b0('0x1b'))['db'];config[_0x31b0('0x1c')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x31b0('0x1d'))(new Redis(config[_0x31b0('0x1c')]));require(_0x31b0('0x1e'))[_0x31b0('0x1f')](socket);var jayson=require(_0x31b0('0x20'));var client=jayson[_0x31b0('0x21')][_0x31b0('0x22')]({'port':0x232c});var client9002=jayson[_0x31b0('0x21')][_0x31b0('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4ba9e8,_0x5c2618,_0xf6a73a,_0x52a65a){return new BPromise(function(_0x20a2b1,_0x4f42a3){var _0x53e2d8=_0x52a65a||client;return _0x53e2d8[_0x31b0('0x23')](_0x4ba9e8,_0xf6a73a)[_0x31b0('0x24')](function(_0x349571){logger[_0x31b0('0x25')]('ChatMessage,\x20%s,\x20%s',_0x5c2618,_0x31b0('0x26'));logger[_0x31b0('0x27')](_0x31b0('0x28'),_0x5c2618,_0x31b0('0x26'),JSON[_0x31b0('0x29')](_0x349571));if(_0x349571[_0x31b0('0x2a')]){if(_0x349571[_0x31b0('0x2a')][_0x31b0('0x2b')]===0x1f4){logger['error'](_0x31b0('0x2c'),_0x5c2618,_0x349571['error']['message']);return _0x4f42a3(_0x349571[_0x31b0('0x2a')][_0x31b0('0x2d')]);}logger[_0x31b0('0x2a')](_0x31b0('0x2c'),_0x5c2618,_0x349571['error'][_0x31b0('0x2d')]);return _0x20a2b1(_0x349571[_0x31b0('0x2a')]['message']);}else{logger[_0x31b0('0x25')](_0x31b0('0x2c'),_0x5c2618,_0x31b0('0x26'));_0x20a2b1(_0x349571[_0x31b0('0x2e')]['message']);}})['catch'](function(_0x5eb8b8){logger[_0x31b0('0x2a')](_0x31b0('0x2c'),_0x5c2618,_0x5eb8b8);_0x4f42a3(_0x5eb8b8);});});}function respondWithStatusCode(_0x3b65cf,_0x16c0dd){_0x16c0dd=_0x16c0dd||0xcc;return function(_0x682042){if(_0x682042){return _0x3b65cf[_0x31b0('0x2f')](_0x16c0dd);}return _0x3b65cf['status'](_0x16c0dd)[_0x31b0('0x30')]();};}function respondWithResult(_0x44f2bf,_0xd205b9){_0xd205b9=_0xd205b9||0xc8;return function(_0x5c572f){if(_0x5c572f){return _0x44f2bf[_0x31b0('0x31')](_0xd205b9)[_0x31b0('0x32')](_0x5c572f);}};}function respondWithFilteredResult(_0x5974fc,_0x48797c){return function(_0x1d5e5d){if(_0x1d5e5d){var _0x579d89=typeof _0x48797c['offset']===_0x31b0('0x33')&&typeof _0x48797c[_0x31b0('0x34')]===_0x31b0('0x33');var _0x19eed5=_0x1d5e5d[_0x31b0('0x35')];var _0x17554c=_0x579d89?0x0:_0x48797c[_0x31b0('0x36')];var _0x4f902d=_0x579d89?_0x1d5e5d[_0x31b0('0x35')]:_0x48797c[_0x31b0('0x36')]+_0x48797c['limit'];var _0x26fab9;if(_0x4f902d>=_0x19eed5){_0x4f902d=_0x19eed5;_0x26fab9=0xc8;}else{_0x26fab9=0xce;}_0x5974fc[_0x31b0('0x31')](_0x26fab9);return _0x5974fc[_0x31b0('0x37')](_0x31b0('0x38'),_0x17554c+'-'+_0x4f902d+'/'+_0x19eed5)[_0x31b0('0x32')](_0x1d5e5d);}return null;};}function patchUpdates(_0x28a9c0){return function(_0x1b5f12){try{jsonpatch[_0x31b0('0x39')](_0x1b5f12,_0x28a9c0,!![]);}catch(_0x4c191b){return BPromise[_0x31b0('0x3a')](_0x4c191b);}return _0x1b5f12['save']();};}function saveUpdates(_0x465f33,_0x36c8af){return function(_0x39db3a){if(_0x39db3a){return _0x39db3a['update'](_0x465f33)[_0x31b0('0x24')](function(_0x5b24c8){return _0x5b24c8;});}return null;};}function removeEntity(_0x483c98,_0x491b6e){return function(_0x33ab44){if(_0x33ab44){return _0x33ab44[_0x31b0('0x3b')]()[_0x31b0('0x24')](function(){_0x483c98[_0x31b0('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c10d,_0x4c1d69){return function(_0x2e56a2){if(!_0x2e56a2){_0x20c10d[_0x31b0('0x2f')](0x194);}return _0x2e56a2;};}function handleError(_0x19c412,_0x1ef7ee){_0x1ef7ee=_0x1ef7ee||0x1f4;return function(_0x21eebd){logger[_0x31b0('0x2a')](_0x21eebd[_0x31b0('0x3c')]);if(_0x21eebd[_0x31b0('0x3d')]){delete _0x21eebd['name'];}_0x19c412['status'](_0x1ef7ee)[_0x31b0('0x3e')](_0x21eebd);};}exports['index']=function(_0x2dd93e,_0x4c01e3){var _0x5e7237={},_0x45c661={},_0x38321b={'count':0x0,'rows':[]};var _0x1a6d91=_[_0x31b0('0x3f')](db['ChatMessage'][_0x31b0('0x40')],function(_0xb2fd28){return{'name':_0xb2fd28[_0x31b0('0x41')],'type':_0xb2fd28[_0x31b0('0x42')][_0x31b0('0x43')]};});_0x45c661[_0x31b0('0x44')]=_[_0x31b0('0x3f')](_0x1a6d91,_0x31b0('0x3d'));_0x45c661[_0x31b0('0x45')]=_['keys'](_0x2dd93e[_0x31b0('0x45')]);_0x45c661[_0x31b0('0x46')]=_[_0x31b0('0x47')](_0x45c661['model'],_0x45c661[_0x31b0('0x45')]);_0x5e7237[_0x31b0('0x48')]=_[_0x31b0('0x47')](_0x45c661[_0x31b0('0x44')],qs[_0x31b0('0x49')](_0x2dd93e[_0x31b0('0x45')]['fields']));_0x5e7237[_0x31b0('0x48')]=_0x5e7237['attributes'][_0x31b0('0x4a')]?_0x5e7237[_0x31b0('0x48')]:_0x45c661['model'];if(!_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x4b')](_0x31b0('0x4c'))){_0x5e7237[_0x31b0('0x34')]=qs[_0x31b0('0x34')](_0x2dd93e[_0x31b0('0x45')]['limit']);_0x5e7237['offset']=qs[_0x31b0('0x36')](_0x2dd93e['query']['offset']);}_0x5e7237[_0x31b0('0x4d')]=qs[_0x31b0('0x4e')](_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x4e')]);_0x5e7237['where']=qs[_0x31b0('0x46')](_[_0x31b0('0x4f')](_0x2dd93e['query'],_0x45c661[_0x31b0('0x46')]),_0x1a6d91);if(_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x50')]){_0x5e7237[_0x31b0('0x51')]=_[_0x31b0('0x52')](_0x5e7237['where'],{'$or':_[_0x31b0('0x3f')](_0x1a6d91,function(_0x3abdeb){if(_0x3abdeb[_0x31b0('0x42')]!=='VIRTUAL'){var _0x231a9b={};_0x231a9b[_0x3abdeb[_0x31b0('0x3d')]]={'$like':'%'+_0x2dd93e['query'][_0x31b0('0x50')]+'%'};return _0x231a9b;}})});}_0x5e7237=_[_0x31b0('0x52')]({},_0x5e7237,_0x2dd93e[_0x31b0('0x53')]);var _0x3a759f={'where':_0x5e7237[_0x31b0('0x51')]};return db[_0x31b0('0x54')][_0x31b0('0x35')](_0x3a759f)['then'](function(_0x21c896){_0x38321b['count']=_0x21c896;if(_0x2dd93e[_0x31b0('0x45')][_0x31b0('0x55')]){_0x5e7237['include']=[{'all':!![]}];}return db[_0x31b0('0x54')][_0x31b0('0x56')](_0x5e7237);})[_0x31b0('0x24')](function(_0x124549){_0x38321b['rows']=_0x124549;return _0x38321b;})['then'](respondWithFilteredResult(_0x4c01e3,_0x5e7237))[_0x31b0('0x57')](handleError(_0x4c01e3,null));};exports[_0x31b0('0x58')]=function(_0xbdfbec,_0x97a37f){var _0x57c2d1={'raw':!![],'where':{'id':_0xbdfbec[_0x31b0('0x59')]['id']}},_0x5d71d5={};_0x5d71d5[_0x31b0('0x44')]=_['keys'](db[_0x31b0('0x54')]['rawAttributes']);_0x5d71d5[_0x31b0('0x45')]=_[_0x31b0('0x5a')](_0xbdfbec[_0x31b0('0x45')]);_0x5d71d5['filters']=_[_0x31b0('0x47')](_0x5d71d5[_0x31b0('0x44')],_0x5d71d5[_0x31b0('0x45')]);_0x57c2d1[_0x31b0('0x48')]=_[_0x31b0('0x47')](_0x5d71d5[_0x31b0('0x44')],qs[_0x31b0('0x49')](_0xbdfbec[_0x31b0('0x45')][_0x31b0('0x49')]));_0x57c2d1[_0x31b0('0x48')]=_0x57c2d1[_0x31b0('0x48')]['length']?_0x57c2d1[_0x31b0('0x48')]:_0x5d71d5[_0x31b0('0x44')];if(_0xbdfbec[_0x31b0('0x45')][_0x31b0('0x55')]){_0x57c2d1['include']=[{'all':!![]}];}_0x57c2d1=_[_0x31b0('0x52')]({},_0x57c2d1,_0xbdfbec['options']);return db[_0x31b0('0x54')][_0x31b0('0x5b')](_0x57c2d1)[_0x31b0('0x24')](handleEntityNotFound(_0x97a37f,null))[_0x31b0('0x24')](respondWithResult(_0x97a37f,null))['catch'](handleError(_0x97a37f,null));};exports[_0x31b0('0x5c')]=function(_0x28e225,_0x603d0e){return db[_0x31b0('0x54')][_0x31b0('0x5c')](_0x28e225[_0x31b0('0x5d')],{})['then'](respondWithResult(_0x603d0e,0xc9))['catch'](handleError(_0x603d0e,null));};exports[_0x31b0('0x5e')]=function(_0x29392d,_0x2afc96){if(_0x29392d[_0x31b0('0x5d')]['id']){delete _0x29392d['body']['id'];}return db[_0x31b0('0x54')][_0x31b0('0x5b')]({'where':{'id':_0x29392d['params']['id']}})[_0x31b0('0x24')](handleEntityNotFound(_0x2afc96,null))[_0x31b0('0x24')](saveUpdates(_0x29392d[_0x31b0('0x5d')],null))[_0x31b0('0x24')](respondWithResult(_0x2afc96,null))[_0x31b0('0x57')](handleError(_0x2afc96,null));};exports[_0x31b0('0x3b')]=function(_0x843ccb,_0x49f777){return db[_0x31b0('0x54')][_0x31b0('0x5b')]({'where':{'id':_0x843ccb[_0x31b0('0x59')]['id']}})[_0x31b0('0x24')](handleEntityNotFound(_0x49f777,null))[_0x31b0('0x24')](removeEntity(_0x49f777,null))[_0x31b0('0x57')](handleError(_0x49f777,null));};exports[_0x31b0('0x5f')]=function(_0x151c3b,_0x15bf7b){return db['ChatMessage']['describe']()[_0x31b0('0x24')](respondWithResult(_0x15bf7b,null))[_0x31b0('0x57')](handleError(_0x15bf7b,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x31b0('0x60')]=function(_0x4ad449,_0x219fff,_0xd701bb){var _0x28f00e={'agent':{},'channel':_0x31b0('0x61')};if(_0x4ad449[_0x31b0('0x5d')]['id']){delete _0x4ad449[_0x31b0('0x5d')]['id'];}_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x62')]=!![];_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x63')]=moment()['format'](_0x31b0('0x64'));_0x4ad449['body'][_0x31b0('0x65')]=_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')]||_0x4ad449[_0x31b0('0x66')]['id'];_0x28f00e['agent']['id']=_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')];return db['ChatMessage'][_0x31b0('0x5b')]({'where':{'id':_0x4ad449[_0x31b0('0x59')]['id'],'UserId':null}})[_0x31b0('0x24')](handleEntityNotFound(_0x219fff,null))['then'](saveUpdates(_0x4ad449[_0x31b0('0x5d')],null))['then'](function(_0x3dfb05){if(_0x3dfb05){_0x28f00e[_0x31b0('0x2d')]=_0x3dfb05[_0x31b0('0x67')]({'plain':!![]});return db[_0x31b0('0x68')][_0x31b0('0x5b')]({'where':{'id':_0x3dfb05[_0x31b0('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x219fff,null))[_0x31b0('0x24')](function(_0x430496){if(_0x430496){return _0x430496[_0x31b0('0x5e')]({'UserId':_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')],'read1stAt':_['isNil'](_0x430496[_0x31b0('0x6a')])?moment()[_0x31b0('0x6b')](_0x31b0('0x64')):undefined});}return null;})[_0x31b0('0x24')](function(_0x1ad05a){if(_0x1ad05a){_0x28f00e[_0x31b0('0x6c')]=_0x1ad05a[_0x31b0('0x67')]({'plain':!![]});interaction_log[_0x31b0('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ad449[_0x31b0('0x66')]['id'],_0x4ad449['user'][_0x31b0('0x3d')],_0x4ad449['user'][_0x31b0('0x6d')],_0x28f00e[_0x31b0('0x6c')]['id'],_0x4ad449['body']?JSON['stringify'](_0x4ad449[_0x31b0('0x5d')]):_0x31b0('0x6e'));return respondWithRpcPromise(_0x31b0('0x6f'),_0x31b0('0x70'),_0x28f00e);}return null;})[_0x31b0('0x24')](function(_0x47e329){var _0xb4f49c=_0x31b0('0x71')+_0x47e329[_0x31b0('0x2d')]['ContactId'];return db[_0x31b0('0x72')][_0x31b0('0x45')](_0xb4f49c,{'type':db[_0x31b0('0x73')][_0x31b0('0x74')][_0x31b0('0x75')],'raw':!![]})[_0x31b0('0x24')](function(_0x2d2446){return _0x2d2446;});})['then'](function(_0x2f0b4a){if(_0x2f0b4a){_0x28f00e[_0x31b0('0x2d')]['contact']=_0x2f0b4a[0x0];if(!_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')])return;return db[_0x31b0('0x76')][_0x31b0('0x5b')]({'where':{'id':_0x4ad449[_0x31b0('0x5d')][_0x31b0('0x65')],'role':_0x31b0('0x77')},'attributes':['id',_0x31b0('0x3d'),_0x31b0('0x78'),_0x31b0('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x20fba3){if(!_0x20fba3)return null;_0x28f00e[_0x31b0('0x2d')][_0x31b0('0x77')]=_0x20fba3;return _0x28f00e;})[_0x31b0('0x24')](function(_0xade74e){if(_0xade74e){if(_0x4ad449['body'][_0x31b0('0x7a')]){_0x28f00e['message']['interface']=util['format'](_0x31b0('0x7b'),_0x4ad449[_0x31b0('0x66')][_0x31b0('0x3d')]);_0x28f00e[_0x31b0('0x2d')][_0x31b0('0x7c')]=_0x28f00e['channel'];_0x28f00e[_0x31b0('0x2d')][_0x31b0('0x7d')]=_0x28f00e[_0x31b0('0x7c')];_0x28f00e['message'][_0x31b0('0x7e')]=_0x31b0('0x60');return respondWithRpcPromise(_0x31b0('0x7f'),'EventManager',{'event':_0x31b0('0x80'),'message':_['merge'](_0x28f00e[_0x31b0('0x2d')],JSON[_0x31b0('0x81')](_0x28f00e[_0x31b0('0x6c')][_0x31b0('0x82')]))},client9002)[_0x31b0('0x24')](function(){return _0x28f00e;});}return _0x28f00e;}return null;})[_0x31b0('0x24')](respondWithResult(_0x219fff,null))[_0x31b0('0x57')](handleError(_0x219fff,null));};var interaction_log=require(_0x31b0('0x18'))(_0x31b0('0x83'));exports[_0x31b0('0x3a')]=function(_0xc60d5b,_0x4b0cb0,_0xcad88d){var _0x113c3f={'agent':{},'channel':'chat'};if(_0xc60d5b['body']['id']){delete _0xc60d5b[_0x31b0('0x5d')]['id'];}_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')]=_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')]||_0xc60d5b[_0x31b0('0x66')]['id'];_0x113c3f[_0x31b0('0x77')]['id']=_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')];return db[_0x31b0('0x54')][_0x31b0('0x5b')]({'where':{'id':_0xc60d5b['params']['id'],'UserId':null}})[_0x31b0('0x24')](handleEntityNotFound(_0x4b0cb0,null))['then'](function(_0x35ebd3){if(_0x35ebd3){_0x113c3f[_0x31b0('0x2d')]=_0x35ebd3[_0x31b0('0x67')]({'plain':!![]});return db['ChatInteraction'][_0x31b0('0x5b')]({'where':{'id':_0x35ebd3['ChatInteractionId']}});}return null;})[_0x31b0('0x24')](handleEntityNotFound(_0x4b0cb0,null))[_0x31b0('0x24')](function(_0x429883){if(_0x429883){_0x113c3f[_0x31b0('0x6c')]=_0x429883[_0x31b0('0x67')]({'plain':!![]});interaction_log[_0x31b0('0x25')](_0x31b0('0x84'),_0xc60d5b[_0x31b0('0x66')]['id'],_0xc60d5b[_0x31b0('0x66')]['name'],_0xc60d5b[_0x31b0('0x66')][_0x31b0('0x6d')],_0x113c3f[_0x31b0('0x6c')]['id'],_0xc60d5b[_0x31b0('0x5d')]?JSON[_0x31b0('0x29')](_0xc60d5b[_0x31b0('0x5d')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x113c3f);}return null;})[_0x31b0('0x24')](function(_0x2e8eb1){var _0x348a87=_0x31b0('0x71')+_0x2e8eb1[_0x31b0('0x2d')][_0x31b0('0x85')];return db[_0x31b0('0x72')]['query'](_0x348a87,{'type':db['Sequelize'][_0x31b0('0x74')][_0x31b0('0x75')],'raw':!![]})[_0x31b0('0x24')](function(_0x39f095){return _0x39f095;});})['then'](function(_0x4d3e7a){if(_0x4d3e7a){_0x113c3f[_0x31b0('0x2d')][_0x31b0('0x86')]=_0x4d3e7a[0x0];if(!_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')])return;return db[_0x31b0('0x76')]['find']({'where':{'id':_0xc60d5b[_0x31b0('0x5d')][_0x31b0('0x65')],'role':_0x31b0('0x77')},'attributes':['id',_0x31b0('0x3d'),_0x31b0('0x78'),_0x31b0('0x79'),_0x31b0('0x87')],'raw':!![]});}return null;})[_0x31b0('0x24')](function(_0x4bf925){if(!_0x4bf925)return null;_0x113c3f[_0x31b0('0x2d')]['agent']=_0x4bf925;return _0x113c3f;})['then'](function(_0x451153){if(_0x451153){_0x451153[_0x31b0('0x2d')][_0x31b0('0x88')]=util[_0x31b0('0x6b')](_0x31b0('0x7b'),_0xc60d5b[_0x31b0('0x66')]['name']);_0x451153[_0x31b0('0x2d')]['channel']=_0x113c3f[_0x31b0('0x7c')];_0x451153['message'][_0x31b0('0x7d')]=_0x113c3f['channel'];_0x451153[_0x31b0('0x2d')][_0x31b0('0x7e')]=_0x31b0('0x3a');respondWithRpcPromise(_0x31b0('0x7f'),_0x31b0('0x7f'),{'event':_0x31b0('0x89'),'message':_[_0x31b0('0x52')](_0x113c3f[_0x31b0('0x2d')],JSON[_0x31b0('0x81')](_0x113c3f['interaction']['formData']))},client9002);return _0x113c3f;}return null;})[_0x31b0('0x24')](respondWithResult(_0x4b0cb0,null))[_0x31b0('0x57')](handleError(_0x4b0cb0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index c91aa73..235d076 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 _0x3b59=['hook','exports','events','../../mysqldb','ChatMessage','save','remove','emit'];(function(_0x31fc7d,_0x1b97e5){var _0x50b1bb=function(_0x506980){while(--_0x506980){_0x31fc7d['push'](_0x31fc7d['shift']());}};_0x50b1bb(++_0x1b97e5);}(_0x3b59,0xb2));var _0x93b5=function(_0x3f7a85,_0x165430){_0x3f7a85=_0x3f7a85-0x0;var _0x3bddbd=_0x3b59[_0x3f7a85];return _0x3bddbd;};'use strict';var EventEmitter=require(_0x93b5('0x0'));var ChatMessage=require(_0x93b5('0x1'))['db'][_0x93b5('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93b5('0x3'),'afterUpdate':'update','afterDestroy':_0x93b5('0x4')};function emitEvent(_0xb42f55){return function(_0x166110,_0x3280e4,_0x109e73){ChatMessageEvents['emit'](_0xb42f55+':'+_0x166110['id'],_0x166110);ChatMessageEvents[_0x93b5('0x5')](_0xb42f55,_0x166110);_0x109e73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x93b5('0x6')](e,emitEvent(event));}}module[_0x93b5('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x42d9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x42d9,0x14d));var _0x942d=function(_0x17aa7a,_0x2be8e4){_0x17aa7a=_0x17aa7a-0x0;var _0x2321f8=_0x42d9[_0x17aa7a];return _0x2321f8;};'use strict';var EventEmitter=require(_0x942d('0x0'));var ChatMessage=require(_0x942d('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x942d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1186b8){return function(_0xe26964,_0x5e03d1,_0x31cc6e){ChatMessageEvents['emit'](_0x1186b8+':'+_0xe26964['id'],_0xe26964);ChatMessageEvents[_0x942d('0x3')](_0x1186b8,_0xe26964);_0x31cc6e(null);};}for(var e in events){if(events[_0x942d('0x4')](e)){var event=events[e];ChatMessage[_0x942d('0x5')](e,emitEvent(event));}}module[_0x942d('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 8a71839..2d67734 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 _0x048f=['isNil','ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','toLowerCase','direction','out'];(function(_0x21322f,_0x483b21){var _0x33e9d1=function(_0x24b3c5){while(--_0x24b3c5){_0x21322f['push'](_0x21322f['shift']());}};_0x33e9d1(++_0x483b21);}(_0x048f,0xcd));var _0xf048=function(_0x3d91a1,_0x35073a){_0x3d91a1=_0x3d91a1-0x0;var _0x1c2f8f=_0x048f[_0x3d91a1];return _0x1c2f8f;};'use strict';var _=require(_0xf048('0x0'));var util=require(_0xf048('0x1'));var logger=require(_0xf048('0x2'))(_0xf048('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf048('0x4'));var fs=require('fs');var path=require(_0xf048('0x5'));var rimraf=require(_0xf048('0x6'));var config=require(_0xf048('0x7'));var attributes=require(_0xf048('0x8'));module[_0xf048('0x9')]=function(_0x766333,_0xa9a18b){return _0x766333[_0xf048('0xa')](_0xf048('0xb'),attributes,{'tableName':_0xf048('0xc'),'paranoid':![],'indexes':[{'name':_0xf048('0xd'),'fields':['body'],'type':_0xf048('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x513f6c,_0x3faa04,_0x2a160c){var _0x477835=_0x766333[_0xf048('0xf')];var _0x34e4f9=_0x513f6c['get']({'plain':!![]});if(_0x34e4f9['direction'][_0xf048('0x10')]()==='in'||_0x34e4f9[_0xf048('0x11')][_0xf048('0x10')]()===_0xf048('0x12')&&!_0x34e4f9['secret']&&!_[_0xf048('0x13')](_0x34e4f9['UserId'])){_0x477835[_0xf048('0x14')][_0xf048('0x15')]({'where':{'id':_0x34e4f9[_0xf048('0x16')]}})[_0xf048('0x17')](function(_0x202932){if(_0x202932){_0x202932['update']({'lastMsgAt':_0x34e4f9['createdAt'],'lastMsgDirection':_0x34e4f9['direction'][_0xf048('0x10')]()});}})[_0xf048('0x18')](function(_0x53f2a5){console[_0xf048('0x19')](_0x53f2a5);});}_0x2a160c();}},'charset':_0xf048('0x1a'),'collate':_0xf048('0x1b')});}; \ No newline at end of file +var _0x89c3=['direction','toLowerCase','out','UserId','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','fti_chat_messages','body','FULLTEXT','models'];(function(_0x25e350,_0x43988b){var _0x4391b8=function(_0x4beaa0){while(--_0x4beaa0){_0x25e350['push'](_0x25e350['shift']());}};_0x4391b8(++_0x43988b);}(_0x89c3,0xff));var _0x389c=function(_0x86e220,_0x3a8190){_0x86e220=_0x86e220-0x0;var _0x327dfe=_0x89c3[_0x86e220];return _0x327dfe;};'use strict';var _=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var logger=require(_0x389c('0x2'))(_0x389c('0x3'));var moment=require(_0x389c('0x4'));var BPromise=require(_0x389c('0x5'));var rp=require(_0x389c('0x6'));var fs=require('fs');var path=require(_0x389c('0x7'));var rimraf=require('rimraf');var config=require(_0x389c('0x8'));var attributes=require('./chatMessage.attributes');module[_0x389c('0x9')]=function(_0x4bece6,_0x51f5f5){return _0x4bece6[_0x389c('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x389c('0xb'),'fields':[_0x389c('0xc')],'type':_0x389c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2efa82,_0x41c92b,_0x1c574b){var _0x2a7d64=_0x4bece6[_0x389c('0xe')];var _0x13b41=_0x2efa82['get']({'plain':!![]});if(_0x13b41[_0x389c('0xf')][_0x389c('0x10')]()==='in'||_0x13b41[_0x389c('0xf')][_0x389c('0x10')]()===_0x389c('0x11')&&!_0x13b41['secret']&&!_['isNil'](_0x13b41[_0x389c('0x12')])){_0x2a7d64[_0x389c('0x13')][_0x389c('0x14')]({'where':{'id':_0x13b41['ChatInteractionId']}})[_0x389c('0x15')](function(_0x4bde6d){if(_0x4bde6d){_0x4bde6d[_0x389c('0x16')]({'lastMsgAt':_0x13b41[_0x389c('0x17')],'lastMsgDirection':_0x13b41['direction'][_0x389c('0x10')]()});}})[_0x389c('0x18')](function(_0x36c118){console['error'](_0x36c118);});}_0x1c574b();}},'charset':_0x389c('0x19'),'collate':_0x389c('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 68552c7..8fa70fd 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 _0x427e=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x78d885,_0x19dec7){var _0x317585=function(_0x3da287){while(--_0x3da287){_0x78d885['push'](_0x78d885['shift']());}};_0x317585(++_0x19dec7);}(_0x427e,0x11a));var _0xe427=function(_0x108c50,_0x1d4f5e){_0x108c50=_0x108c50-0x0;var _0x12b058=_0x427e[_0x108c50];return _0x12b058;};'use strict';var _=require(_0xe427('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe427('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe427('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe427('0x3'))(_0xe427('0x4'));var config=require('../../config/environment');var jayson=require(_0xe427('0x5'));var client=jayson[_0xe427('0x6')][_0xe427('0x7')]({'port':0x232a});config[_0xe427('0x8')]=_[_0xe427('0x9')](config[_0xe427('0x8')],{'host':_0xe427('0xa'),'port':0x18eb});var socket=require(_0xe427('0xb'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe427('0xc')](socket);function respondWithRpcPromise(_0x1416b6,_0x381c7f,_0x25a1bc){return new BPromise(function(_0x3b3f9d,_0x2aecd7){return client[_0xe427('0xd')](_0x1416b6,_0x25a1bc)[_0xe427('0xe')](function(_0x5f2fad){logger['info'](_0xe427('0xf'),_0x381c7f,_0xe427('0x10'));logger['debug'](_0xe427('0x11'),_0x381c7f,_0xe427('0x10'),JSON[_0xe427('0x12')](_0x5f2fad));if(_0x5f2fad[_0xe427('0x13')]){if(_0x5f2fad[_0xe427('0x13')][_0xe427('0x14')]===0x1f4){logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x5f2fad[_0xe427('0x13')]['message']);return _0x2aecd7(_0x5f2fad['error'][_0xe427('0x15')]);}logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x5f2fad['error'][_0xe427('0x15')]);return _0x3b3f9d(_0x5f2fad[_0xe427('0x13')][_0xe427('0x15')]);}else{logger[_0xe427('0x16')](_0xe427('0xf'),_0x381c7f,'request\x20sent');_0x3b3f9d(_0x5f2fad[_0xe427('0x17')][_0xe427('0x15')]);}})[_0xe427('0x18')](function(_0x58637e){logger[_0xe427('0x13')](_0xe427('0xf'),_0x381c7f,_0x58637e);_0x2aecd7(_0x58637e);});});}exports[_0xe427('0x19')]=function(_0x1c49dc){var _0x5bc6ac=this;return new Promise(function(_0x5b1ef9,_0x219dde){return db[_0xe427('0x1a')][_0xe427('0x1b')](_0x1c49dc[_0xe427('0x1c')],{'raw':_0x1c49dc[_0xe427('0x1d')]?_0x1c49dc[_0xe427('0x1d')][_0xe427('0x1e')]===undefined?!![]:![]:!![]})[_0xe427('0xe')](function(_0x283bc4){logger['info'](_0xe427('0x19'),_0x1c49dc);logger[_0xe427('0x1f')](_0xe427('0x19'),_0x1c49dc,JSON[_0xe427('0x12')](_0x283bc4));_0x5b1ef9(_0x283bc4);})[_0xe427('0x18')](function(_0x90c4ce){logger['error'](_0xe427('0x19'),_0x90c4ce[_0xe427('0x15')],_0x1c49dc);_0x219dde(_0x5bc6ac['error'](0x1f4,_0x90c4ce[_0xe427('0x15')]));});});}; \ No newline at end of file +var _0xfeea=['client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfeea,0xf7));var _0xafee=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xfeea[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0xafee('0x0'));var util=require(_0xafee('0x1'));var moment=require(_0xafee('0x2'));var BPromise=require(_0xafee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafee('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xafee('0x5'));var logger=require(_0xafee('0x6'))(_0xafee('0x7'));var config=require('../../config/environment');var jayson=require(_0xafee('0x8'));var client=jayson[_0xafee('0x9')]['http']({'port':0x232a});config[_0xafee('0xa')]=_[_0xafee('0xb')](config[_0xafee('0xa')],{'host':_0xafee('0xc'),'port':0x18eb});var socket=require(_0xafee('0xd'))(new Redis(config[_0xafee('0xa')]));require(_0xafee('0xe'))['register'](socket);function respondWithRpcPromise(_0xa36673,_0x19b930,_0x23ff35){return new BPromise(function(_0x3db012,_0x304cf4){return client[_0xafee('0xf')](_0xa36673,_0x23ff35)[_0xafee('0x10')](function(_0x4c040e){logger[_0xafee('0x11')](_0xafee('0x12'),_0x19b930,'request\x20sent');logger[_0xafee('0x13')](_0xafee('0x14'),_0x19b930,'request\x20sent',JSON[_0xafee('0x15')](_0x4c040e));if(_0x4c040e[_0xafee('0x16')]){if(_0x4c040e['error'][_0xafee('0x17')]===0x1f4){logger['error'](_0xafee('0x12'),_0x19b930,_0x4c040e[_0xafee('0x16')]['message']);return _0x304cf4(_0x4c040e[_0xafee('0x16')][_0xafee('0x18')]);}logger[_0xafee('0x16')](_0xafee('0x12'),_0x19b930,_0x4c040e[_0xafee('0x16')][_0xafee('0x18')]);return _0x3db012(_0x4c040e['error']['message']);}else{logger[_0xafee('0x11')](_0xafee('0x12'),_0x19b930,_0xafee('0x19'));_0x3db012(_0x4c040e['result']['message']);}})['catch'](function(_0x5e41e1){logger[_0xafee('0x16')](_0xafee('0x12'),_0x19b930,_0x5e41e1);_0x304cf4(_0x5e41e1);});});}exports[_0xafee('0x1a')]=function(_0x276f50){var _0x392ff0=this;return new Promise(function(_0x3f4437,_0x18e62b){return db[_0xafee('0x1b')][_0xafee('0x1c')](_0x276f50[_0xafee('0x1d')],{'raw':_0x276f50[_0xafee('0x1e')]?_0x276f50['options'][_0xafee('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xc7c699){logger[_0xafee('0x11')](_0xafee('0x1a'),_0x276f50);logger[_0xafee('0x13')]('CreateChatMessage',_0x276f50,JSON[_0xafee('0x15')](_0xc7c699));_0x3f4437(_0xc7c699);})['catch'](function(_0x508379){logger[_0xafee('0x16')](_0xafee('0x1a'),_0x508379['message'],_0x276f50);_0x18e62b(_0x392ff0[_0xafee('0x16')](0x1f4,_0x508379[_0xafee('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index de89a6f..9cf9654 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 _0x10af=['./chatMessage.events','remove','update','emit','register','length','chatMessage:'];(function(_0x37d6d4,_0x143af3){var _0x179d36=function(_0x4be729){while(--_0x4be729){_0x37d6d4['push'](_0x37d6d4['shift']());}};_0x179d36(++_0x143af3);}(_0x10af,0xfc));var _0xf10a=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x10af[_0xac151d];return _0x111dba;};'use strict';var ChatMessageEvents=require(_0xf10a('0x0'));var events=['save',_0xf10a('0x1'),_0xf10a('0x2')];function createListener(_0x1e42f5,_0x211890){return function(_0x453e1a){_0x211890[_0xf10a('0x3')](_0x1e42f5,_0x453e1a);};}function removeListener(_0xbffc71,_0x13b338){return function(){ChatMessageEvents['removeListener'](_0xbffc71,_0x13b338);};}exports[_0xf10a('0x4')]=function(_0xf86ea1){for(var _0x5c9a4c=0x0,_0x4cd7e4=events[_0xf10a('0x5')];_0x5c9a4c<_0x4cd7e4;_0x5c9a4c++){var _0x1563fb=events[_0x5c9a4c];var _0x2ade36=createListener(_0xf10a('0x6')+_0x1563fb,_0xf86ea1);ChatMessageEvents['on'](_0x1563fb,_0x2ade36);}}; \ No newline at end of file +var _0x1501=['save','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x1501,0x126));var _0x1150=function(_0x479f6f,_0x1c26c4){_0x479f6f=_0x479f6f-0x0;var _0x24e701=_0x1501[_0x479f6f];return _0x24e701;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x1150('0x0'),_0x1150('0x1'),_0x1150('0x2')];function createListener(_0x4c704f,_0x14d425){return function(_0x323ec2){_0x14d425[_0x1150('0x3')](_0x4c704f,_0x323ec2);};}function removeListener(_0x28eb65,_0x4d218f){return function(){ChatMessageEvents[_0x1150('0x4')](_0x28eb65,_0x4d218f);};}exports['register']=function(_0x63c724){for(var _0x316a7d=0x0,_0x2fc391=events[_0x1150('0x5')];_0x316a7d<_0x2fc391;_0x316a7d++){var _0x24340c=events[_0x316a7d];var _0x321d80=createListener(_0x1150('0x6')+_0x24340c,_0x63c724);ChatMessageEvents['on'](_0x24340c,_0x321d80);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 87805af..bf48dd4 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 _0x2d1b=['get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x2d1b,0x12b));var _0xb2d1=function(_0x1b04d2,_0x43190c){_0x1b04d2=_0x1b04d2-0x0;var _0x95da=_0x2d1b[_0x1b04d2];return _0x95da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb2d1('0x0'));var timeout=require(_0xb2d1('0x1'));var express=require(_0xb2d1('0x2'));var router=express[_0xb2d1('0x3')]();var fs_extra=require(_0xb2d1('0x4'));var auth=require(_0xb2d1('0x5'));var interaction=require(_0xb2d1('0x6'));var config=require(_0xb2d1('0x7'));var controller=require(_0xb2d1('0x8'));router[_0xb2d1('0x9')]('/',auth[_0xb2d1('0xa')](),controller[_0xb2d1('0xb')]);router['get'](_0xb2d1('0xc'),auth['isAuthenticated'](),controller[_0xb2d1('0xd')]);router[_0xb2d1('0x9')](_0xb2d1('0xe'),auth['isAuthenticated'](),controller[_0xb2d1('0xf')]);router[_0xb2d1('0x10')]('/',auth['isAuthenticated'](),interaction[_0xb2d1('0x11')]('chat',_0xb2d1('0x12')),controller[_0xb2d1('0x13')]);router[_0xb2d1('0x14')]('/:id',controller['update']);router[_0xb2d1('0x14')](_0xb2d1('0x15'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x16')]);router[_0xb2d1('0x14')](_0xb2d1('0x17'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x18')]);router[_0xb2d1('0x19')](_0xb2d1('0xe'),auth[_0xb2d1('0xa')](),controller[_0xb2d1('0x1a')]);module[_0xb2d1('0x1b')]=router; \ No newline at end of file +var _0xf05d=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xf05d,0x18f));var _0xdf05=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf05d[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf05('0x0'));var timeout=require(_0xdf05('0x1'));var express=require(_0xdf05('0x2'));var router=express[_0xdf05('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf05('0x4'));var interaction=require(_0xdf05('0x5'));var config=require('../../config/environment');var controller=require(_0xdf05('0x6'));router[_0xdf05('0x7')]('/',auth[_0xdf05('0x8')](),controller[_0xdf05('0x9')]);router[_0xdf05('0x7')](_0xdf05('0xa'),auth[_0xdf05('0x8')](),controller[_0xdf05('0xb')]);router[_0xdf05('0x7')](_0xdf05('0xc'),auth[_0xdf05('0x8')](),controller['show']);router[_0xdf05('0xd')]('/',auth[_0xdf05('0x8')](),interaction[_0xdf05('0xe')](_0xdf05('0xf'),_0xdf05('0x10')),controller[_0xdf05('0x11')]);router[_0xdf05('0x12')](_0xdf05('0xc'),controller[_0xdf05('0x13')]);router[_0xdf05('0x12')](_0xdf05('0x14'),auth[_0xdf05('0x8')](),controller[_0xdf05('0x15')]);router[_0xdf05('0x12')](_0xdf05('0x16'),auth[_0xdf05('0x8')](),controller[_0xdf05('0x17')]);router[_0xdf05('0x18')]('/:id',auth[_0xdf05('0x8')](),controller[_0xdf05('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 5b78079..42900a6 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 _0x2032=['medium','exports','TEXT'];(function(_0x3a7941,_0x55edac){var _0x1aa996=function(_0x3a3d50){while(--_0x3a3d50){_0x3a7941['push'](_0x3a7941['shift']());}};_0x1aa996(++_0x55edac);}(_0x2032,0xd9));var _0x2203=function(_0x44827b,_0x19bce6){_0x44827b=_0x44827b-0x0;var _0x63346b=_0x2032[_0x44827b];return _0x63346b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x2ae482,_0x276e1e){var _0x4379b7=function(_0x4af7d5){while(--_0x4af7d5){_0x2ae482['push'](_0x2ae482['shift']());}};_0x4379b7(++_0x276e1e);}(_0xb10b,0x12a));var _0xbb10=function(_0xfcf737,_0x132075){_0xfcf737=_0xfcf737-0x0;var _0x5eccbe=_0xb10b[_0xfcf737];return _0x5eccbe;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index e14d4c9..2dba45f 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(_0x5a73ad,_0x2a42fb){var _0x35cffc=function(_0x4dec93){while(--_0x4dec93){_0x5a73ad['push'](_0x5a73ad['shift']());}};_0x35cffc(++_0x2a42fb);}(_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(){_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(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0x28dc5e,_0xddcafb){_0x28dc5e=_0x28dc5e-0x0;var _0x3f0126=_0x7a54[_0x28dc5e];return _0x3f0126;};'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.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 8880626..84456fe 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49b9=['hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x49b9,0xaa));var _0x949b=function(_0x19901f,_0x52bc26){_0x19901f=_0x19901f-0x0;var _0x12b88a=_0x49b9[_0x19901f];return _0x12b88a;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x949b('0x0'))['db'][_0x949b('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x949b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x949b('0x3'),'afterDestroy':_0x949b('0x4')};function emitEvent(_0x1ded3c){return function(_0x1e77d1,_0x202b64,_0x134f2b){ChatOfflineMessageEvents[_0x949b('0x5')](_0x1ded3c+':'+_0x1e77d1['id'],_0x1e77d1);ChatOfflineMessageEvents[_0x949b('0x5')](_0x1ded3c,_0x1e77d1);_0x134f2b(null);};}for(var e in events){if(events[_0x949b('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x949b('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x2447=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2447,0x1dd));var _0x7244=function(_0x482bc7,_0x172d4a){_0x482bc7=_0x482bc7-0x0;var _0x43d0b6=_0x2447[_0x482bc7];return _0x43d0b6;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x7244('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7244('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7244('0x2'),'afterDestroy':_0x7244('0x3')};function emitEvent(_0x463433){return function(_0x30f6a4,_0x1c10bf,_0x4eb872){ChatOfflineMessageEvents[_0x7244('0x4')](_0x463433+':'+_0x30f6a4['id'],_0x30f6a4);ChatOfflineMessageEvents[_0x7244('0x4')](_0x463433,_0x30f6a4);_0x4eb872(null);};}for(var e in events){if(events[_0x7244('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x7244('0x6')](e,emitEvent(event));}}module[_0x7244('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 4b865a4..b71da66 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 _0x5ae4=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x5ae4,0x12f));var _0x45ae=function(_0x35e5dd,_0x1ffea9){_0x35e5dd=_0x35e5dd-0x0;var _0xa8bef7=_0x5ae4[_0x35e5dd];return _0xa8bef7;};'use strict';var attributes=require(_0x45ae('0x0'));module[_0x45ae('0x1')]=function(_0x2e76dc){return _0x2e76dc['define']('ChatOfflineMessage',attributes,{'tableName':_0x45ae('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x45ae('0x3'),'collate':_0x45ae('0x4')});}; \ No newline at end of file +var _0x142f=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x142f,0x136));var _0xf142=function(_0x816de3,_0x38d085){_0x816de3=_0x816de3-0x0;var _0x1e539e=_0x142f[_0x816de3];return _0x1e539e;};'use strict';var attributes=require(_0xf142('0x0'));module['exports']=function(_0x39e1df){return _0x39e1df['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf142('0x1'),'collate':_0xf142('0x2')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index c640954..143e53b 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 _0x63b7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x63b7,0x1e2));var _0x763b=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x63b7[_0x4fbb15];return _0x436338;};'use strict';var _=require('lodash');var util=require(_0x763b('0x0'));var moment=require('moment');var BPromise=require(_0x763b('0x1'));var rs=require(_0x763b('0x2'));var fs=require('fs');var Redis=require(_0x763b('0x3'));var db=require(_0x763b('0x4'))['db'];var utils=require(_0x763b('0x5'));var logger=require('../../config/logger')(_0x763b('0x6'));var config=require(_0x763b('0x7'));var jayson=require(_0x763b('0x8'));var client=jayson['client'][_0x763b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe9cf0,_0x464ab0,_0x218a1f){return new BPromise(function(_0xffb979,_0x476fc4){return client[_0x763b('0xa')](_0xbe9cf0,_0x218a1f)[_0x763b('0xb')](function(_0x2833b2){logger['info'](_0x763b('0xc'),_0x464ab0,_0x763b('0xd'));logger[_0x763b('0xe')](_0x763b('0xf'),_0x464ab0,_0x763b('0xd'),JSON[_0x763b('0x10')](_0x2833b2));if(_0x2833b2['error']){if(_0x2833b2[_0x763b('0x11')][_0x763b('0x12')]===0x1f4){logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0x476fc4(_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);}logger[_0x763b('0x11')](_0x763b('0xc'),_0x464ab0,_0x2833b2[_0x763b('0x11')][_0x763b('0x13')]);return _0xffb979(_0x2833b2['error'][_0x763b('0x13')]);}else{logger[_0x763b('0x14')](_0x763b('0xc'),_0x464ab0,'request\x20sent');_0xffb979(_0x2833b2[_0x763b('0x15')]['message']);}})[_0x763b('0x16')](function(_0x493346){logger[_0x763b('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x464ab0,_0x493346);_0x476fc4(_0x493346);});});} \ No newline at end of file +var _0x7fcf=['ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','info'];(function(_0x3a7bdf,_0x58bdd8){var _0x35a9a8=function(_0x21da98){while(--_0x21da98){_0x3a7bdf['push'](_0x3a7bdf['shift']());}};_0x35a9a8(++_0x58bdd8);}(_0x7fcf,0xce));var _0xf7fc=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x7fcf[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0xf7fc('0x0'));var moment=require(_0xf7fc('0x1'));var BPromise=require(_0xf7fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7fc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7fc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf7fc('0x5'));var jayson=require(_0xf7fc('0x6'));var client=jayson[_0xf7fc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x87869b,_0x5efb7a,_0x44007d){return new BPromise(function(_0x246819,_0x75925a){return client[_0xf7fc('0x8')](_0x87869b,_0x44007d)['then'](function(_0x383197){logger[_0xf7fc('0x9')](_0xf7fc('0xa'),_0x5efb7a,'request\x20sent');logger[_0xf7fc('0xb')](_0xf7fc('0xc'),_0x5efb7a,_0xf7fc('0xd'),JSON[_0xf7fc('0xe')](_0x383197));if(_0x383197[_0xf7fc('0xf')]){if(_0x383197[_0xf7fc('0xf')][_0xf7fc('0x10')]===0x1f4){logger[_0xf7fc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5efb7a,_0x383197[_0xf7fc('0xf')][_0xf7fc('0x11')]);return _0x75925a(_0x383197[_0xf7fc('0xf')]['message']);}logger['error'](_0xf7fc('0xa'),_0x5efb7a,_0x383197['error'][_0xf7fc('0x11')]);return _0x246819(_0x383197['error'][_0xf7fc('0x11')]);}else{logger[_0xf7fc('0x9')](_0xf7fc('0xa'),_0x5efb7a,'request\x20sent');_0x246819(_0x383197['result']['message']);}})['catch'](function(_0x13e07c){logger[_0xf7fc('0xf')](_0xf7fc('0xa'),_0x5efb7a,_0x13e07c);_0x75925a(_0x13e07c);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index d826b4f..6a0b8ec 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 _0x3d39=['describe','/:id','post','create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x326c48,_0x31eee6){var _0xf71bc5=function(_0x391b95){while(--_0x391b95){_0x326c48['push'](_0x326c48['shift']());}};_0xf71bc5(++_0x31eee6);}(_0x3d39,0x1d6));var _0x93d3=function(_0x288339,_0x1b55cb){_0x288339=_0x288339-0x0;var _0x31d315=_0x3d39[_0x288339];return _0x31d315;};'use strict';var multer=require('multer');var util=require(_0x93d3('0x0'));var path=require('path');var timeout=require(_0x93d3('0x1'));var express=require(_0x93d3('0x2'));var router=express[_0x93d3('0x3')]();var fs_extra=require(_0x93d3('0x4'));var auth=require(_0x93d3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93d3('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x93d3('0x7')]('/',auth[_0x93d3('0x8')](),controller[_0x93d3('0x9')]);router[_0x93d3('0x7')]('/describe',auth[_0x93d3('0x8')](),controller[_0x93d3('0xa')]);router['get'](_0x93d3('0xb'),auth[_0x93d3('0x8')](),controller['show']);router[_0x93d3('0xc')]('/',auth[_0x93d3('0x8')](),controller[_0x93d3('0xd')]);router['put'](_0x93d3('0xb'),auth['isAuthenticated'](),controller[_0x93d3('0xe')]);router['delete'](_0x93d3('0xb'),auth[_0x93d3('0x8')](),controller[_0x93d3('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc689=['destroy','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','post','update','delete'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xc689,0x1a2));var _0x9c68=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xc689[_0x4c3ffe];return _0x28d3eb;};'use strict';var multer=require('multer');var util=require(_0x9c68('0x0'));var path=require('path');var timeout=require(_0x9c68('0x1'));var express=require(_0x9c68('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9c68('0x3'));var config=require(_0x9c68('0x4'));var controller=require(_0x9c68('0x5'));router[_0x9c68('0x6')]('/',auth[_0x9c68('0x7')](),controller[_0x9c68('0x8')]);router['get'](_0x9c68('0x9'),auth[_0x9c68('0x7')](),controller['describe']);router[_0x9c68('0x6')](_0x9c68('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9c68('0xb')]('/',auth[_0x9c68('0x7')](),controller['create']);router['put']('/:id',auth[_0x9c68('0x7')](),controller[_0x9c68('0xc')]);router[_0x9c68('0xd')](_0x9c68('0xa'),auth['isAuthenticated'](),controller[_0x9c68('0xe')]);module[_0x9c68('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 2fe1625..8396dfa 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 _0x08cb=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x558d22,_0x43749f){var _0x1c20af=function(_0x382fcd){while(--_0x382fcd){_0x558d22['push'](_0x558d22['shift']());}};_0x1c20af(++_0x43749f);}(_0x08cb,0x135));var _0xb08c=function(_0x381b14,_0x44738b){_0x381b14=_0x381b14-0x0;var _0x271127=_0x08cb[_0x381b14];return _0x271127;};'use strict';var Sequelize=require(_0xb08c('0x0'));module[_0xb08c('0x1')]={'name':{'type':Sequelize[_0xb08c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb08c('0x3')](_0xb08c('0x4'),_0xb08c('0x5')),'defaultValue':_0xb08c('0x4')},'selector':{'type':Sequelize[_0xb08c('0x2')]},'timeout':{'type':Sequelize[_0xb08c('0x6')]}}; \ No newline at end of file +var _0xa511=['timeout','INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa511,0x158));var _0x1a51=function(_0x1f34c3,_0x3ce50b){_0x1f34c3=_0x1f34c3-0x0;var _0x46608b=_0xa511[_0x1f34c3];return _0x46608b;};'use strict';var Sequelize=require('sequelize');module[_0x1a51('0x0')]={'name':{'type':Sequelize[_0x1a51('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1a51('0x2')](_0x1a51('0x3'),_0x1a51('0x4')),'defaultValue':_0x1a51('0x3')},'selector':{'type':Sequelize[_0x1a51('0x1')]},'timeout':{'type':Sequelize[_0x1a51('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 9f788d5..9c6ec60 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 _0xe64a=['length','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','keys','query','filters','intersection','model','attributes','fields'];(function(_0x1e1962,_0x5a2061){var _0x3c06be=function(_0x37761b){while(--_0x37761b){_0x1e1962['push'](_0x1e1962['shift']());}};_0x3c06be(++_0x5a2061);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae64('0x0'));var rimraf=require(_0xae64('0x1'));var zipdir=require(_0xae64('0x2'));var jsonpatch=require(_0xae64('0x3'));var rp=require(_0xae64('0x4'));var moment=require(_0xae64('0x5'));var BPromise=require(_0xae64('0x6'));var Mustache=require(_0xae64('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae64('0x8'));var fs=require('fs');var fs_extra=require(_0xae64('0x9'));var _=require(_0xae64('0xa'));var squel=require(_0xae64('0xb'));var crypto=require(_0xae64('0xc'));var jsforce=require(_0xae64('0xd'));var deskjs=require(_0xae64('0xe'));var toCsv=require(_0xae64('0xf'));var querystring=require(_0xae64('0x10'));var Papa=require(_0xae64('0x11'));var Redis=require(_0xae64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xae64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xae64('0x14'))(_0xae64('0x15'));var utils=require(_0xae64('0x16'));var config=require(_0xae64('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xae64('0x18'))['db'];function respondWithStatusCode(_0x58d0de,_0x59b60a){_0x59b60a=_0x59b60a||0xcc;return function(_0x345caf){if(_0x345caf){return _0x58d0de[_0xae64('0x19')](_0x59b60a);}return _0x58d0de[_0xae64('0x1a')](_0x59b60a)['end']();};}function respondWithResult(_0x1247b0,_0x760b31){_0x760b31=_0x760b31||0xc8;return function(_0x306804){if(_0x306804){return _0x1247b0[_0xae64('0x1a')](_0x760b31)[_0xae64('0x1b')](_0x306804);}};}function respondWithFilteredResult(_0x4c7d1c,_0x2950c5){return function(_0x37bc58){if(_0x37bc58){var _0x717724=typeof _0x2950c5[_0xae64('0x1c')]===_0xae64('0x1d')&&typeof _0x2950c5['limit']===_0xae64('0x1d');var _0x21c285=_0x37bc58[_0xae64('0x1e')];var _0x4613d9=_0x717724?0x0:_0x2950c5[_0xae64('0x1c')];var _0x227223=_0x717724?_0x37bc58[_0xae64('0x1e')]:_0x2950c5[_0xae64('0x1c')]+_0x2950c5['limit'];var _0x3cdd98;if(_0x227223>=_0x21c285){_0x227223=_0x21c285;_0x3cdd98=0xc8;}else{_0x3cdd98=0xce;}_0x4c7d1c[_0xae64('0x1a')](_0x3cdd98);return _0x4c7d1c[_0xae64('0x1f')](_0xae64('0x20'),_0x4613d9+'-'+_0x227223+'/'+_0x21c285)[_0xae64('0x1b')](_0x37bc58);}return null;};}function patchUpdates(_0x20ca7f){return function(_0x49bab9){try{jsonpatch[_0xae64('0x21')](_0x49bab9,_0x20ca7f,!![]);}catch(_0x4a4c4e){return BPromise[_0xae64('0x22')](_0x4a4c4e);}return _0x49bab9[_0xae64('0x23')]();};}function saveUpdates(_0x12d94d,_0x394afa){return function(_0x4406dc){if(_0x4406dc){return _0x4406dc[_0xae64('0x24')](_0x12d94d)[_0xae64('0x25')](function(_0x127ae2){return _0x127ae2;});}return null;};}function removeEntity(_0x24a35f,_0x2e6852){return function(_0x131225){if(_0x131225){return _0x131225[_0xae64('0x26')]()[_0xae64('0x25')](function(){_0x24a35f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6eb56,_0xd5ecaf){return function(_0x22d91a){if(!_0x22d91a){_0x6eb56[_0xae64('0x19')](0x194);}return _0x22d91a;};}function handleError(_0x4d987f,_0x518969){_0x518969=_0x518969||0x1f4;return function(_0x562c2d){logger[_0xae64('0x27')](_0x562c2d[_0xae64('0x28')]);if(_0x562c2d['name']){delete _0x562c2d[_0xae64('0x29')];}_0x4d987f[_0xae64('0x1a')](_0x518969)[_0xae64('0x2a')](_0x562c2d);};}exports['show']=function(_0x3b946c,_0x562eb4){var _0x55f53d={'raw':!![],'where':{'id':_0x3b946c[_0xae64('0x2b')]['id']}},_0x5e4b2c={};_0x5e4b2c['model']=_[_0xae64('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x5e4b2c['query']=_[_0xae64('0x2c')](_0x3b946c[_0xae64('0x2d')]);_0x5e4b2c[_0xae64('0x2e')]=_[_0xae64('0x2f')](_0x5e4b2c[_0xae64('0x30')],_0x5e4b2c[_0xae64('0x2d')]);_0x55f53d[_0xae64('0x31')]=_[_0xae64('0x2f')](_0x5e4b2c[_0xae64('0x30')],qs['fields'](_0x3b946c[_0xae64('0x2d')][_0xae64('0x32')]));_0x55f53d[_0xae64('0x31')]=_0x55f53d[_0xae64('0x31')][_0xae64('0x33')]?_0x55f53d[_0xae64('0x31')]:_0x5e4b2c['model'];if(_0x3b946c[_0xae64('0x2d')]['includeAll']){_0x55f53d['include']=[{'all':!![]}];}_0x55f53d=_[_0xae64('0x34')]({},_0x55f53d,_0x3b946c[_0xae64('0x35')]);return db[_0xae64('0x36')][_0xae64('0x37')](_0x55f53d)[_0xae64('0x25')](handleEntityNotFound(_0x562eb4,null))[_0xae64('0x25')](respondWithResult(_0x562eb4,null))[_0xae64('0x38')](handleError(_0x562eb4,null));};exports['create']=function(_0xe53734,_0x4437e9){return db[_0xae64('0x36')][_0xae64('0x39')](_0xe53734[_0xae64('0x3a')],{})[_0xae64('0x25')](respondWithResult(_0x4437e9,0xc9))['catch'](handleError(_0x4437e9,null));};exports[_0xae64('0x24')]=function(_0x28269b,_0x3afc79){if(_0x28269b[_0xae64('0x3a')]['id']){delete _0x28269b['body']['id'];}return db[_0xae64('0x36')][_0xae64('0x37')]({'where':{'id':_0x28269b['params']['id']}})[_0xae64('0x25')](handleEntityNotFound(_0x3afc79,null))[_0xae64('0x25')](saveUpdates(_0x28269b['body'],null))[_0xae64('0x25')](respondWithResult(_0x3afc79,null))[_0xae64('0x38')](handleError(_0x3afc79,null));};exports[_0xae64('0x26')]=function(_0x19a5b7,_0x4c55b3){return db[_0xae64('0x36')][_0xae64('0x37')]({'where':{'id':_0x19a5b7[_0xae64('0x2b')]['id']}})[_0xae64('0x25')](handleEntityNotFound(_0x4c55b3,null))[_0xae64('0x25')](removeEntity(_0x4c55b3,null))[_0xae64('0x38')](handleError(_0x4c55b3,null));}; \ No newline at end of file +var _0x5a01=['intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters'];(function(_0x2274e4,_0x5ed9e6){var _0x4d8a02=function(_0x187e19){while(--_0x187e19){_0x2274e4['push'](_0x2274e4['shift']());}};_0x4d8a02(++_0x5ed9e6);}(_0x5a01,0x1af));var _0x15a0=function(_0x5e31e2,_0x273090){_0x5e31e2=_0x5e31e2-0x0;var _0x294e2c=_0x5a01[_0x5e31e2];return _0x294e2c;};'use strict';var emlformat=require(_0x15a0('0x0'));var rimraf=require(_0x15a0('0x1'));var zipdir=require(_0x15a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x15a0('0x3'));var BPromise=require(_0x15a0('0x4'));var Mustache=require('mustache');var util=require(_0x15a0('0x5'));var path=require(_0x15a0('0x6'));var sox=require(_0x15a0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15a0('0x8'));var _=require(_0x15a0('0x9'));var squel=require(_0x15a0('0xa'));var crypto=require('crypto');var jsforce=require(_0x15a0('0xb'));var deskjs=require(_0x15a0('0xc'));var toCsv=require(_0x15a0('0xd'));var querystring=require(_0x15a0('0xe'));var Papa=require(_0x15a0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15a0('0x10'));var as=require(_0x15a0('0x11'));var hardwareService=require(_0x15a0('0x12'));var logger=require(_0x15a0('0x13'))(_0x15a0('0x14'));var utils=require(_0x15a0('0x15'));var config=require(_0x15a0('0x16'));var licenseUtil=require(_0x15a0('0x17'));var db=require(_0x15a0('0x18'))['db'];function respondWithStatusCode(_0x131ea2,_0x17108f){_0x17108f=_0x17108f||0xcc;return function(_0x418907){if(_0x418907){return _0x131ea2['sendStatus'](_0x17108f);}return _0x131ea2['status'](_0x17108f)[_0x15a0('0x19')]();};}function respondWithResult(_0x1bacb4,_0xa580bf){_0xa580bf=_0xa580bf||0xc8;return function(_0x1c4d39){if(_0x1c4d39){return _0x1bacb4[_0x15a0('0x1a')](_0xa580bf)[_0x15a0('0x1b')](_0x1c4d39);}};}function respondWithFilteredResult(_0x2595c1,_0x2568ee){return function(_0x2b8a17){if(_0x2b8a17){var _0x547d10=typeof _0x2568ee[_0x15a0('0x1c')]==='undefined'&&typeof _0x2568ee['limit']===_0x15a0('0x1d');var _0x2896bb=_0x2b8a17[_0x15a0('0x1e')];var _0x29383c=_0x547d10?0x0:_0x2568ee['offset'];var _0x5e7b01=_0x547d10?_0x2b8a17[_0x15a0('0x1e')]:_0x2568ee[_0x15a0('0x1c')]+_0x2568ee['limit'];var _0x1a71b6;if(_0x5e7b01>=_0x2896bb){_0x5e7b01=_0x2896bb;_0x1a71b6=0xc8;}else{_0x1a71b6=0xce;}_0x2595c1['status'](_0x1a71b6);return _0x2595c1[_0x15a0('0x1f')](_0x15a0('0x20'),_0x29383c+'-'+_0x5e7b01+'/'+_0x2896bb)[_0x15a0('0x1b')](_0x2b8a17);}return null;};}function patchUpdates(_0xc035d3){return function(_0x225aac){try{jsonpatch[_0x15a0('0x21')](_0x225aac,_0xc035d3,!![]);}catch(_0x43f77b){return BPromise['reject'](_0x43f77b);}return _0x225aac['save']();};}function saveUpdates(_0x32eafd,_0x23a2f6){return function(_0x349623){if(_0x349623){return _0x349623[_0x15a0('0x22')](_0x32eafd)[_0x15a0('0x23')](function(_0x3a06cc){return _0x3a06cc;});}return null;};}function removeEntity(_0x42dc91,_0x53e470){return function(_0x559024){if(_0x559024){return _0x559024[_0x15a0('0x24')]()['then'](function(){_0x42dc91[_0x15a0('0x1a')](0xcc)[_0x15a0('0x19')]();});}};}function handleEntityNotFound(_0xd7e6b3,_0x2845ec){return function(_0x23a06b){if(!_0x23a06b){_0xd7e6b3[_0x15a0('0x25')](0x194);}return _0x23a06b;};}function handleError(_0x3b050f,_0x299183){_0x299183=_0x299183||0x1f4;return function(_0x3608d6){logger[_0x15a0('0x26')](_0x3608d6[_0x15a0('0x27')]);if(_0x3608d6['name']){delete _0x3608d6[_0x15a0('0x28')];}_0x3b050f['status'](_0x299183)[_0x15a0('0x29')](_0x3608d6);};}exports['show']=function(_0x14f059,_0x192b11){var _0x1a20ed={'raw':!![],'where':{'id':_0x14f059[_0x15a0('0x2a')]['id']}},_0x15a2e7={};_0x15a2e7[_0x15a0('0x2b')]=_[_0x15a0('0x2c')](db[_0x15a0('0x2d')][_0x15a0('0x2e')]);_0x15a2e7[_0x15a0('0x2f')]=_[_0x15a0('0x2c')](_0x14f059[_0x15a0('0x2f')]);_0x15a2e7[_0x15a0('0x30')]=_[_0x15a0('0x31')](_0x15a2e7[_0x15a0('0x2b')],_0x15a2e7['query']);_0x1a20ed[_0x15a0('0x32')]=_[_0x15a0('0x31')](_0x15a2e7['model'],qs['fields'](_0x14f059[_0x15a0('0x2f')][_0x15a0('0x33')]));_0x1a20ed['attributes']=_0x1a20ed[_0x15a0('0x32')][_0x15a0('0x34')]?_0x1a20ed['attributes']:_0x15a2e7[_0x15a0('0x2b')];if(_0x14f059[_0x15a0('0x2f')][_0x15a0('0x35')]){_0x1a20ed['include']=[{'all':!![]}];}_0x1a20ed=_[_0x15a0('0x36')]({},_0x1a20ed,_0x14f059[_0x15a0('0x37')]);return db[_0x15a0('0x2d')][_0x15a0('0x38')](_0x1a20ed)['then'](handleEntityNotFound(_0x192b11,null))[_0x15a0('0x23')](respondWithResult(_0x192b11,null))[_0x15a0('0x39')](handleError(_0x192b11,null));};exports['create']=function(_0x502fc5,_0x4faadc){return db[_0x15a0('0x2d')][_0x15a0('0x3a')](_0x502fc5[_0x15a0('0x3b')],{})[_0x15a0('0x23')](respondWithResult(_0x4faadc,0xc9))[_0x15a0('0x39')](handleError(_0x4faadc,null));};exports[_0x15a0('0x22')]=function(_0x4703fe,_0x31e58d){if(_0x4703fe[_0x15a0('0x3b')]['id']){delete _0x4703fe[_0x15a0('0x3b')]['id'];}return db[_0x15a0('0x2d')][_0x15a0('0x38')]({'where':{'id':_0x4703fe[_0x15a0('0x2a')]['id']}})[_0x15a0('0x23')](handleEntityNotFound(_0x31e58d,null))[_0x15a0('0x23')](saveUpdates(_0x4703fe[_0x15a0('0x3b')],null))[_0x15a0('0x23')](respondWithResult(_0x31e58d,null))[_0x15a0('0x39')](handleError(_0x31e58d,null));};exports[_0x15a0('0x24')]=function(_0x475430,_0xe7f6bd){return db[_0x15a0('0x2d')]['find']({'where':{'id':_0x475430[_0x15a0('0x2a')]['id']}})[_0x15a0('0x23')](handleEntityNotFound(_0xe7f6bd,null))[_0x15a0('0x23')](removeEntity(_0xe7f6bd,null))[_0x15a0('0x39')](handleError(_0xe7f6bd,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 702ba23..9d0f4bb 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 _0x1b4e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x2f0eba,_0x21bcdf){var _0x586783=function(_0x261d26){while(--_0x261d26){_0x2f0eba['push'](_0x2f0eba['shift']());}};_0x586783(++_0x21bcdf);}(_0x1b4e,0x14c));var _0xe1b4=function(_0xa80bab,_0x1a6417){_0xa80bab=_0xa80bab-0x0;var _0xcae729=_0x1b4e[_0xa80bab];return _0xcae729;};'use strict';var _=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var logger=require(_0xe1b4('0x2'))(_0xe1b4('0x3'));var moment=require(_0xe1b4('0x4'));var BPromise=require(_0xe1b4('0x5'));var rp=require(_0xe1b4('0x6'));var fs=require('fs');var path=require(_0xe1b4('0x7'));var rimraf=require(_0xe1b4('0x8'));var config=require(_0xe1b4('0x9'));var attributes=require(_0xe1b4('0xa'));module['exports']=function(_0x560488,_0x4278b4){return _0x560488[_0xe1b4('0xb')](_0xe1b4('0xc'),attributes,{'tableName':_0xe1b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a51=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x2d4d56,_0x2b0908){var _0x43136f=function(_0x1c7060){while(--_0x1c7060){_0x2d4d56['push'](_0x2d4d56['shift']());}};_0x43136f(++_0x2b0908);}(_0x0a51,0x8d));var _0x10a5=function(_0x1d3321,_0x118267){_0x1d3321=_0x1d3321-0x0;var _0x359aa3=_0x0a51[_0x1d3321];return _0x359aa3;};'use strict';var _=require(_0x10a5('0x0'));var util=require(_0x10a5('0x1'));var logger=require(_0x10a5('0x2'))('api');var moment=require(_0x10a5('0x3'));var BPromise=require(_0x10a5('0x4'));var rp=require(_0x10a5('0x5'));var fs=require('fs');var path=require(_0x10a5('0x6'));var rimraf=require(_0x10a5('0x7'));var config=require('../../config/environment');var attributes=require(_0x10a5('0x8'));module[_0x10a5('0x9')]=function(_0x529e56,_0x292c5d){return _0x529e56[_0x10a5('0xa')](_0x10a5('0xb'),attributes,{'tableName':_0x10a5('0xc'),'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 e6281ba..ed7c763 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 _0xd0c8=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0c8,0x119));var _0x8d0c=function(_0x46c947,_0x32abe8){_0x46c947=_0x46c947-0x0;var _0x530a46=_0xd0c8[_0x46c947];return _0x530a46;};'use strict';var _=require('lodash');var util=require(_0x8d0c('0x0'));var moment=require(_0x8d0c('0x1'));var BPromise=require(_0x8d0c('0x2'));var rs=require(_0x8d0c('0x3'));var fs=require('fs');var Redis=require(_0x8d0c('0x4'));var db=require(_0x8d0c('0x5'))['db'];var utils=require(_0x8d0c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8d0c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d0c('0x8')][_0x8d0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b3cf8,_0x4ed527,_0x1e2d7b){return new BPromise(function(_0x509623,_0x57e4cd){return client[_0x8d0c('0xa')](_0x9b3cf8,_0x1e2d7b)[_0x8d0c('0xb')](function(_0x1b24bc){logger[_0x8d0c('0xc')](_0x8d0c('0xd'),_0x4ed527,_0x8d0c('0xe'));logger[_0x8d0c('0xf')](_0x8d0c('0x10'),_0x4ed527,_0x8d0c('0xe'),JSON[_0x8d0c('0x11')](_0x1b24bc));if(_0x1b24bc[_0x8d0c('0x12')]){if(_0x1b24bc['error'][_0x8d0c('0x13')]===0x1f4){logger[_0x8d0c('0x12')](_0x8d0c('0xd'),_0x4ed527,_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);return _0x57e4cd(_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4ed527,_0x1b24bc[_0x8d0c('0x12')]['message']);return _0x509623(_0x1b24bc[_0x8d0c('0x12')][_0x8d0c('0x14')]);}else{logger[_0x8d0c('0xc')](_0x8d0c('0xd'),_0x4ed527,_0x8d0c('0xe'));_0x509623(_0x1b24bc[_0x8d0c('0x15')]['message']);}})[_0x8d0c('0x16')](function(_0x2a8ebe){logger[_0x8d0c('0x12')](_0x8d0c('0xd'),_0x4ed527,_0x2a8ebe);_0x57e4cd(_0x2a8ebe);});});} \ No newline at end of file +var _0xf14f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xf14f,0x8a));var _0xff14=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xf14f[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0xff14('0x0'));var util=require(_0xff14('0x1'));var moment=require(_0xff14('0x2'));var BPromise=require(_0xff14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff14('0x4'));var db=require(_0xff14('0x5'))['db'];var utils=require(_0xff14('0x6'));var logger=require(_0xff14('0x7'))(_0xff14('0x8'));var config=require(_0xff14('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff14('0xa')][_0xff14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b228d,_0x3d9047,_0x18e19a){return new BPromise(function(_0x323ee5,_0xa7090e){return client[_0xff14('0xc')](_0x5b228d,_0x18e19a)[_0xff14('0xd')](function(_0x1115e3){logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,_0xff14('0x10'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3d9047,_0xff14('0x10'),JSON[_0xff14('0x11')](_0x1115e3));if(_0x1115e3[_0xff14('0x12')]){if(_0x1115e3[_0xff14('0x12')][_0xff14('0x13')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0xa7090e(_0x1115e3['error'][_0xff14('0x14')]);}logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);return _0x323ee5(_0x1115e3[_0xff14('0x12')][_0xff14('0x14')]);}else{logger[_0xff14('0xe')](_0xff14('0xf'),_0x3d9047,'request\x20sent');_0x323ee5(_0x1115e3[_0xff14('0x15')]['message']);}})[_0xff14('0x16')](function(_0x5a5845){logger[_0xff14('0x12')](_0xff14('0xf'),_0x3d9047,_0x5a5845);_0xa7090e(_0x5a5845);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 9cf87e6..3103c43 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x5f2000,_0x11e9f7){var _0x11e7ee=function(_0x2e27e7){while(--_0x2e27e7){_0x5f2000['push'](_0x5f2000['shift']());}};_0x11e7ee(++_0x11e9f7);}(_0x032e,0x124));var _0xe032=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x032e[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file +var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x568fc3,_0x56fedc){var _0x160dbe=function(_0xf8583d){while(--_0xf8583d){_0x568fc3['push'](_0x568fc3['shift']());}};_0x160dbe(++_0x56fedc);}(_0x4819,0xcd));var _0x9481=function(_0x81d23e,_0x176dc5){_0x81d23e=_0x81d23e-0x0;var _0x1ec56d=_0x4819[_0x81d23e];return _0x1ec56d;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('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 2cbda1f..12c78f0 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 _0x8ed7=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x248b46,_0x4d7f9d){var _0x21b566=function(_0x192675){while(--_0x192675){_0x248b46['push'](_0x248b46['shift']());}};_0x21b566(++_0x4d7f9d);}(_0x8ed7,0xe6));var _0x78ed=function(_0x132987,_0x2ff9f6){_0x132987=_0x132987-0x0;var _0x4a8073=_0x8ed7[_0x132987];return _0x4a8073;};'use strict';var Sequelize=require(_0x78ed('0x0'));module[_0x78ed('0x1')]={'name':{'type':Sequelize[_0x78ed('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x78ed('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78ed('0x4')](_0x78ed('0x5'),_0x78ed('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x45f8=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x45f8,0xbf));var _0x845f=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0x45f8[_0x7feb90];return _0x3c5b33;};'use strict';var Sequelize=require(_0x845f('0x0'));module[_0x845f('0x1')]={'name':{'type':Sequelize[_0x845f('0x2')],'unique':_0x845f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x845f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x845f('0x5')](_0x845f('0x6'),_0x845f('0x7'),_0x845f('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0440ff0..e6aaafd 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 _0x6713=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','UserProfileResource','name','map','ChatQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','length','nolimit','order','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x263149,_0x1529c5){var _0x49c433=function(_0x189a39){while(--_0x189a39){_0x263149['push'](_0x263149['shift']());}};_0x49c433(++_0x1529c5);}(_0x6713,0x112));var _0x3671=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x6713[_0x343090];return _0x3ff3e8;};'use strict';var emlformat=require(_0x3671('0x0'));var rimraf=require(_0x3671('0x1'));var zipdir=require(_0x3671('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3671('0x3'));var moment=require(_0x3671('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3671('0x5'));var path=require('path');var sox=require(_0x3671('0x6'));var csv=require('to-csv');var ejs=require(_0x3671('0x7'));var fs=require('fs');var fs_extra=require(_0x3671('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3671('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3671('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3671('0xb'));var Papa=require(_0x3671('0xc'));var Redis=require(_0x3671('0xd'));var authService=require(_0x3671('0xe'));var qs=require(_0x3671('0xf'));var as=require(_0x3671('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3671('0x11'))('api');var utils=require(_0x3671('0x12'));var config=require(_0x3671('0x13'));var licenseUtil=require(_0x3671('0x14'));var db=require(_0x3671('0x15'))['db'];config['redis']=_[_0x3671('0x16')](config[_0x3671('0x17')],{'host':_0x3671('0x18'),'port':0x18eb});var socket=require(_0x3671('0x19'))(new Redis(config[_0x3671('0x17')]));require('./chatQueue.socket')[_0x3671('0x1a')](socket);var jayson=require(_0x3671('0x1b'));var client=jayson[_0x3671('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b9df,_0x508f5d,_0x765daa,_0x2d65f9){return new BPromise(function(_0x50bcce,_0x57adb9){var _0x186d85=_0x2d65f9||client;return _0x186d85[_0x3671('0x1d')](_0x53b9df,_0x765daa)[_0x3671('0x1e')](function(_0x2cbaba){logger[_0x3671('0x1f')](_0x3671('0x20'),_0x508f5d,_0x3671('0x21'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x508f5d,_0x3671('0x21'),JSON[_0x3671('0x22')](_0x2cbaba));if(_0x2cbaba[_0x3671('0x23')]){if(_0x2cbaba[_0x3671('0x23')][_0x3671('0x24')]===0x1f4){logger[_0x3671('0x23')](_0x3671('0x20'),_0x508f5d,_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);return _0x57adb9(_0x2cbaba['error']['message']);}logger['error'](_0x3671('0x20'),_0x508f5d,_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);return _0x50bcce(_0x2cbaba[_0x3671('0x23')][_0x3671('0x25')]);}else{logger[_0x3671('0x1f')](_0x3671('0x20'),_0x508f5d,_0x3671('0x21'));_0x50bcce(_0x2cbaba[_0x3671('0x26')]['message']);}})['catch'](function(_0x1c566e){logger['error'](_0x3671('0x20'),_0x508f5d,_0x1c566e);_0x57adb9(_0x1c566e);});});}function respondWithStatusCode(_0x1ca26b,_0xbc35f6){_0xbc35f6=_0xbc35f6||0xcc;return function(_0x1bf11d){if(_0x1bf11d){return _0x1ca26b[_0x3671('0x27')](_0xbc35f6);}return _0x1ca26b[_0x3671('0x28')](_0xbc35f6)[_0x3671('0x29')]();};}function respondWithResult(_0x491465,_0x10e6b9){_0x10e6b9=_0x10e6b9||0xc8;return function(_0x184302){if(_0x184302){return _0x491465[_0x3671('0x28')](_0x10e6b9)[_0x3671('0x2a')](_0x184302);}};}function respondWithFilteredResult(_0x2720f2,_0x32d258){return function(_0x5cf443){if(_0x5cf443){var _0x5a487e=typeof _0x32d258[_0x3671('0x2b')]==='undefined'&&typeof _0x32d258[_0x3671('0x2c')]===_0x3671('0x2d');var _0xb44e80=_0x5cf443[_0x3671('0x2e')];var _0x4b17e8=_0x5a487e?0x0:_0x32d258[_0x3671('0x2b')];var _0x7dbdbf=_0x5a487e?_0x5cf443['count']:_0x32d258[_0x3671('0x2b')]+_0x32d258['limit'];var _0x5b30aa;if(_0x7dbdbf>=_0xb44e80){_0x7dbdbf=_0xb44e80;_0x5b30aa=0xc8;}else{_0x5b30aa=0xce;}_0x2720f2['status'](_0x5b30aa);return _0x2720f2[_0x3671('0x2f')](_0x3671('0x30'),_0x4b17e8+'-'+_0x7dbdbf+'/'+_0xb44e80)['json'](_0x5cf443);}return null;};}function patchUpdates(_0x38bf26){return function(_0x5e77ff){try{jsonpatch['apply'](_0x5e77ff,_0x38bf26,!![]);}catch(_0x2b39d6){return BPromise['reject'](_0x2b39d6);}return _0x5e77ff['save']();};}function saveUpdates(_0x14f95a,_0x2c3b42){return function(_0x462416){if(_0x462416){return _0x462416[_0x3671('0x31')](_0x14f95a)[_0x3671('0x1e')](function(_0x2b2ac3){return _0x2b2ac3;});}return null;};}function removeEntity(_0x2e2a48,_0x3e3806){return function(_0x2e51ca){if(_0x2e51ca){return _0x2e51ca[_0x3671('0x32')]()[_0x3671('0x1e')](function(){var _0x2777ba=_0x2e51ca[_0x3671('0x33')]({'plain':!![]});var _0x152ddf='ChatQueues';return db[_0x3671('0x34')]['destroy']({'where':{'type':_0x152ddf,'resourceId':_0x2777ba['id']}})[_0x3671('0x1e')](function(){return _0x2e51ca;});})[_0x3671('0x1e')](function(){_0x2e2a48['status'](0xcc)[_0x3671('0x29')]();});}};}function handleEntityNotFound(_0x17e22a,_0x56509a){return function(_0x5167b5){if(!_0x5167b5){_0x17e22a[_0x3671('0x27')](0x194);}return _0x5167b5;};}function handleError(_0xb7a8ee,_0x2ce012){_0x2ce012=_0x2ce012||0x1f4;return function(_0x5172b5){logger[_0x3671('0x23')](_0x5172b5['stack']);if(_0x5172b5[_0x3671('0x35')]){delete _0x5172b5[_0x3671('0x35')];}_0xb7a8ee['status'](_0x2ce012)['send'](_0x5172b5);};}exports['index']=function(_0x28a233,_0x52f145){var _0xe04a0c={},_0x2aa638={},_0x16a270={'count':0x0,'rows':[]};var _0x30e1dc=_[_0x3671('0x36')](db[_0x3671('0x37')][_0x3671('0x38')],function(_0x266a4d){return{'name':_0x266a4d[_0x3671('0x39')],'type':_0x266a4d[_0x3671('0x3a')]['key']};});_0x2aa638[_0x3671('0x3b')]=_[_0x3671('0x36')](_0x30e1dc,_0x3671('0x35'));_0x2aa638[_0x3671('0x3c')]=_['keys'](_0x28a233[_0x3671('0x3c')]);_0x2aa638[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x2aa638[_0x3671('0x3b')],_0x2aa638['query']);_0xe04a0c[_0x3671('0x3f')]=_['intersection'](_0x2aa638[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x28a233['query'][_0x3671('0x40')]));_0xe04a0c[_0x3671('0x3f')]=_0xe04a0c[_0x3671('0x3f')]['length']?_0xe04a0c[_0x3671('0x3f')]:_0x2aa638[_0x3671('0x3b')];if(!_0x28a233[_0x3671('0x3c')][_0x3671('0x41')]('nolimit')){_0xe04a0c[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0x28a233['query']['limit']);_0xe04a0c['offset']=qs['offset'](_0x28a233['query'][_0x3671('0x2b')]);}_0xe04a0c['order']=qs['sort'](_0x28a233['query'][_0x3671('0x42')]);_0xe04a0c[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0x28a233[_0x3671('0x3c')],_0x2aa638[_0x3671('0x3d')]),_0x30e1dc);if(_0x28a233[_0x3671('0x3c')][_0x3671('0x45')]){_0xe04a0c[_0x3671('0x43')]=_['merge'](_0xe04a0c[_0x3671('0x43')],{'$or':_[_0x3671('0x36')](_0x30e1dc,function(_0x5098bf){if(_0x5098bf[_0x3671('0x3a')]!==_0x3671('0x46')){var _0x51c92d={};_0x51c92d[_0x5098bf[_0x3671('0x35')]]={'$like':'%'+_0x28a233['query'][_0x3671('0x45')]+'%'};return _0x51c92d;}})});}_0xe04a0c=_[_0x3671('0x47')]({},_0xe04a0c,_0x28a233[_0x3671('0x48')]);var _0x132b52={'where':_0xe04a0c[_0x3671('0x43')]};return db[_0x3671('0x37')][_0x3671('0x2e')](_0x132b52)[_0x3671('0x1e')](function(_0x5ad692){_0x16a270['count']=_0x5ad692;if(_0x28a233[_0x3671('0x3c')]['includeAll']){_0xe04a0c[_0x3671('0x49')]=[{'all':!![]}];}return db['ChatQueue'][_0x3671('0x4a')](_0xe04a0c);})[_0x3671('0x1e')](function(_0x40d309){_0x16a270[_0x3671('0x4b')]=_0x40d309;return _0x16a270;})[_0x3671('0x1e')](respondWithFilteredResult(_0x52f145,_0xe04a0c))['catch'](handleError(_0x52f145,null));};exports[_0x3671('0x4c')]=function(_0x2c9cf7,_0x25c942){var _0x159be2={'raw':!![],'where':{'id':_0x2c9cf7[_0x3671('0x4d')]['id']}},_0x5222a4={};_0x5222a4[_0x3671('0x3b')]=_[_0x3671('0x4e')](db[_0x3671('0x37')][_0x3671('0x38')]);_0x5222a4[_0x3671('0x3c')]=_[_0x3671('0x4e')](_0x2c9cf7[_0x3671('0x3c')]);_0x5222a4['filters']=_[_0x3671('0x3e')](_0x5222a4['model'],_0x5222a4[_0x3671('0x3c')]);_0x159be2[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x5222a4[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x2c9cf7[_0x3671('0x3c')][_0x3671('0x40')]));_0x159be2['attributes']=_0x159be2[_0x3671('0x3f')]['length']?_0x159be2[_0x3671('0x3f')]:_0x5222a4[_0x3671('0x3b')];if(_0x2c9cf7[_0x3671('0x3c')]['includeAll']){_0x159be2[_0x3671('0x49')]=[{'all':!![]}];}_0x159be2=_['merge']({},_0x159be2,_0x2c9cf7[_0x3671('0x48')]);return db[_0x3671('0x37')][_0x3671('0x4f')](_0x159be2)[_0x3671('0x1e')](handleEntityNotFound(_0x25c942,null))[_0x3671('0x1e')](respondWithResult(_0x25c942,null))[_0x3671('0x50')](handleError(_0x25c942,null));};exports[_0x3671('0x51')]=function(_0x16e3c5,_0x57aa7d){return db[_0x3671('0x37')]['create'](_0x16e3c5['body'],{})[_0x3671('0x1e')](function(_0xa96db8){var _0x42fcb8=_0x16e3c5[_0x3671('0x52')][_0x3671('0x33')]({'plain':!![]});if(!_0x42fcb8)throw new Error(_0x3671('0x53'));if(_0x42fcb8[_0x3671('0x54')]===_0x3671('0x52')){var _0x12a95=_0xa96db8[_0x3671('0x33')]({'plain':!![]});var _0x3d6d28='ChatQueues';return db[_0x3671('0x55')][_0x3671('0x4f')]({'where':{'name':_0x3d6d28,'userProfileId':_0x42fcb8[_0x3671('0x56')]},'raw':!![]})[_0x3671('0x1e')](function(_0x2c3595){if(_0x2c3595&&_0x2c3595[_0x3671('0x57')]===0x0){return db['UserProfileResource'][_0x3671('0x51')]({'name':_0x12a95[_0x3671('0x35')],'resourceId':_0x12a95['id'],'type':_0x2c3595[_0x3671('0x35')],'sectionId':_0x2c3595['id']},{})[_0x3671('0x1e')](function(){return _0xa96db8;});}else{return _0xa96db8;}})[_0x3671('0x50')](function(_0x25c0a1){logger[_0x3671('0x23')](_0x3671('0x58'),_0x25c0a1);throw _0x25c0a1;});}return _0xa96db8;})[_0x3671('0x1e')](respondWithResult(_0x57aa7d,0xc9))[_0x3671('0x50')](handleError(_0x57aa7d,null));};exports[_0x3671('0x31')]=function(_0x46a19a,_0x541be8){if(_0x46a19a[_0x3671('0x59')]['id']){delete _0x46a19a[_0x3671('0x59')]['id'];}return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x46a19a[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x541be8,null))[_0x3671('0x1e')](saveUpdates(_0x46a19a[_0x3671('0x59')],null))[_0x3671('0x1e')](respondWithResult(_0x541be8,null))[_0x3671('0x50')](handleError(_0x541be8,null));};exports[_0x3671('0x32')]=function(_0x21ba83,_0x3a9fa7){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x21ba83[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x3a9fa7,null))[_0x3671('0x1e')](removeEntity(_0x3a9fa7,null))[_0x3671('0x50')](handleError(_0x3a9fa7,null));};exports[_0x3671('0x5a')]=function(_0x5abba8,_0x15ce03){return db[_0x3671('0x37')][_0x3671('0x5a')]()[_0x3671('0x1e')](respondWithResult(_0x15ce03,null))[_0x3671('0x50')](handleError(_0x15ce03,null));};exports['getMembers']=function(_0x5a0ece,_0x2be030,_0x1d3683){var _0x45075c={'raw':!![],'where':{}},_0x9256ef={},_0x51586e;return db[_0x3671('0x37')][_0x3671('0x5b')]({'where':{'id':_0x5a0ece['params']['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x2be030,null))[_0x3671('0x1e')](function(_0x56d7db){if(_0x56d7db){_0x51586e=_0x56d7db[_0x3671('0x33')]({'plain':!![]});_0x9256ef['model']=_[_0x3671('0x4e')](db[_0x3671('0x5c')][_0x3671('0x38')]);_0x9256ef[_0x3671('0x3c')]=_['keys'](_0x5a0ece[_0x3671('0x3c')]);_0x9256ef[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x9256ef[_0x3671('0x3b')],_0x9256ef[_0x3671('0x3c')]);_0x45075c[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x9256ef[_0x3671('0x3b')],qs[_0x3671('0x40')](_0x5a0ece[_0x3671('0x3c')][_0x3671('0x40')]));_0x45075c[_0x3671('0x3f')]=_0x45075c[_0x3671('0x3f')][_0x3671('0x5d')]?_0x45075c[_0x3671('0x3f')]:_0x9256ef['model'];if(!_0x5a0ece[_0x3671('0x3c')][_0x3671('0x41')](_0x3671('0x5e'))){_0x45075c[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0x5a0ece['query'][_0x3671('0x2c')]);_0x45075c['offset']=qs[_0x3671('0x2b')](_0x5a0ece[_0x3671('0x3c')]['offset']);}_0x45075c[_0x3671('0x5f')]=qs['sort'](_0x5a0ece['query'][_0x3671('0x42')]);_0x45075c[_0x3671('0x43')]=qs['filters'](_[_0x3671('0x44')](_0x5a0ece[_0x3671('0x3c')],_0x9256ef[_0x3671('0x3d')]));_0x45075c['where'][_0x3671('0x60')]=_0x56d7db['id'];if(_0x5a0ece[_0x3671('0x3c')][_0x3671('0x45')]){_0x45075c[_0x3671('0x43')]=_[_0x3671('0x47')](_0x45075c['where'],{'$or':_[_0x3671('0x36')](_0x45075c[_0x3671('0x3f')],function(_0x1ab6ce){var _0x5e4557={};_0x5e4557[_0x1ab6ce]={'$like':'%'+_0x5a0ece[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x5e4557;})});}_0x45075c=_[_0x3671('0x47')]({},_0x45075c,_0x5a0ece['options']);return db[_0x3671('0x5c')][_0x3671('0x4a')](_0x45075c);}})[_0x3671('0x1e')](function(_0x3942c2){if(_0x3942c2){return db[_0x3671('0x61')]['findAndCountAll']({'where':{'id':_[_0x3671('0x36')](_0x3942c2,_0x3671('0x62')),'role':_0x3671('0x63')},'attributes':['id',_0x3671('0x35'),_0x3671('0x64'),_0x3671('0x65'),_0x3671('0x66')]});}})['then'](function(_0x2a08cf){if(_0x2a08cf){return{'count':_0x2a08cf['count'],'rows':_[_0x3671('0x36')](_0x2a08cf[_0x3671('0x4b')],function(_0x36e1c6){return{'membername':_0x36e1c6[_0x3671('0x35')],'UserId':_0x36e1c6['id'],'queue_name':_0x51586e[_0x3671('0x35')],'ChatQueueId':_0x51586e['id'],'interface':util[_0x3671('0x67')](_0x3671('0x68'),_0x3671('0x69'),_0x36e1c6[_0x3671('0x35')]),'penalty':0x0,'paused':_0x36e1c6[_0x3671('0x64')],'createdAt':_0x36e1c6[_0x3671('0x66')],'updatedAt':_0x36e1c6[_0x3671('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3671('0x1e')](respondWithFilteredResult(_0x2be030,_0x45075c))[_0x3671('0x50')](handleError(_0x2be030,null));};exports[_0x3671('0x6a')]=function(_0xaf3d09,_0x567c1d,_0x23b647){var _0x5e7528={};var _0x3fb376={};var _0x4bd66b;var _0xa342b;return db[_0x3671('0x37')]['findOne']({'where':{'id':_0xaf3d09[_0x3671('0x4d')]['id']}})['then'](handleEntityNotFound(_0x567c1d,null))[_0x3671('0x1e')](function(_0x5adf6a){if(_0x5adf6a){_0x4bd66b=_0x5adf6a;_0x3fb376[_0x3671('0x3b')]=_[_0x3671('0x4e')](db[_0x3671('0x6b')]['rawAttributes']);_0x3fb376[_0x3671('0x3c')]=_['keys'](_0xaf3d09[_0x3671('0x3c')]);_0x3fb376[_0x3671('0x3d')]=_['intersection'](_0x3fb376[_0x3671('0x3b')],_0x3fb376[_0x3671('0x3c')]);_0x5e7528[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x3fb376[_0x3671('0x3b')],qs[_0x3671('0x40')](_0xaf3d09['query']['fields']));_0x5e7528[_0x3671('0x3f')]=_0x5e7528[_0x3671('0x3f')][_0x3671('0x5d')]?_0x5e7528[_0x3671('0x3f')]:_0x3fb376[_0x3671('0x3b')];_0x5e7528[_0x3671('0x5f')]=qs['sort'](_0xaf3d09[_0x3671('0x3c')][_0x3671('0x42')]);_0x5e7528[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0xaf3d09[_0x3671('0x3c')],_0x3fb376[_0x3671('0x3d')]));if(_0xaf3d09[_0x3671('0x3c')][_0x3671('0x45')]){_0x5e7528['where']=_[_0x3671('0x47')](_0x5e7528['where'],{'$or':_[_0x3671('0x36')](_0x5e7528['attributes'],function(_0x41d937){var _0x4e743e={};_0x4e743e[_0x41d937]={'$like':'%'+_0xaf3d09[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x4e743e;})});}_0x5e7528=_['merge']({},_0x5e7528,_0xaf3d09['options']);return _0x4bd66b[_0x3671('0x6a')](_0x5e7528);}})['then'](function(_0x2b61ae){if(_0x2b61ae){_0xa342b=_0x2b61ae[_0x3671('0x5d')];if(!_0xaf3d09[_0x3671('0x3c')]['hasOwnProperty'](_0x3671('0x5e'))){_0x5e7528[_0x3671('0x2c')]=qs[_0x3671('0x2c')](_0xaf3d09['query'][_0x3671('0x2c')]);_0x5e7528[_0x3671('0x2b')]=qs[_0x3671('0x2b')](_0xaf3d09['query']['offset']);}return _0x4bd66b[_0x3671('0x6a')](_0x5e7528);}})[_0x3671('0x1e')](function(_0x5b0ee0){if(_0x5b0ee0){return _0x5b0ee0?{'count':_0xa342b,'rows':_0x5b0ee0}:null;}})[_0x3671('0x1e')](respondWithResult(_0x567c1d,null))['catch'](handleError(_0x567c1d,null));};exports[_0x3671('0x6c')]=function(_0x5de147,_0xc3dfcf,_0xf3f272){var _0x28278f=_0x5de147[_0x3671('0x59')][_0x3671('0x6d')];return db['Team']['findAll']({'where':{'id':_0x28278f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x3671('0x35'),_0x3671('0x6e'),_0x3671('0x6f'),_0x3671('0x70')],'raw':!![]}]})[_0x3671('0x1e')](function(_0x288f49){if(_0x288f49){var _0x2a94e8=_[_0x3671('0x71')](_0x288f49,function(_0x309ee9){var _0xaf8224=_0x309ee9[_0x3671('0x33')]({'plain':!![]});return _0xaf8224['Agents'];});return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x5de147[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](function(_0x2efd82){return db[_0x3671('0x72')]['transaction'](function(_0x53d32f){return _0x2efd82[_0x3671('0x6c')](_0x28278f,{'transaction':_0x53d32f})[_0x3671('0x1e')](function(){return BPromise[_0x3671('0x73')](_0x2a94e8,function(_0x5f3bf3){return db['UserChatQueue'][_0x3671('0x74')]({'where':{'UserId':_0x5f3bf3['id'],'ChatQueueId':_0x5de147[_0x3671('0x4d')]['id']},'transaction':_0x53d32f});});})[_0x3671('0x1e')](function(){_0x2a94e8[_0x3671('0x75')](function(_0x59efa9){socket[_0x3671('0x76')](_0x3671('0x77'),{'UserId':_0x59efa9['id'],'ChatQueueId':_0x2efd82['id']});});});});});}})[_0x3671('0x1e')](respondWithStatusCode(_0xc3dfcf,null))[_0x3671('0x50')](handleError(_0xc3dfcf,null));};exports[_0x3671('0x78')]=function(_0x2da42d,_0x1e5b25,_0x151133){return db[_0x3671('0x6b')][_0x3671('0x4a')]({'where':{'id':_0x2da42d[_0x3671('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3671('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3671('0x1e')](handleEntityNotFound(_0x1e5b25,null))[_0x3671('0x1e')](function(_0x59f3e8){var _0x135d86=_[_0x3671('0x36')](_0x59f3e8,'id');var _0xd7b0f3=[];var _0xba0076=[];var _0x412051=squel['select']();_0x412051['field'](_0x3671('0x79'))[_0x3671('0x7a')](_0x3671('0x7b'),'tq')['join'](_0x3671('0x7c'),'ut',_0x3671('0x7d'))[_0x3671('0x43')](_0x3671('0x7e'),_0x2da42d[_0x3671('0x4d')]['id']);for(var _0x5143ab=0x0;_0x5143ab<_0x59f3e8[_0x3671('0x5d')];_0x5143ab+=0x1){let _0x4f12da=_0x59f3e8[_0x5143ab];for(var _0x13b51d=0x0;_0x13b51d<_0x4f12da['Agents'][_0x3671('0x5d')];_0x13b51d+=0x1){let _0x3f10e4=_0x4f12da['Agents'][_0x13b51d];var _0x2c983a=_0x412051['clone']();_0x2c983a[_0x3671('0x43')](_0x3671('0x7f'),_0x3f10e4['id']);_0xba0076[_0x3671('0x80')](db['sequelize'][_0x3671('0x3c')](_0x2c983a[_0x3671('0x81')](),{'type':db[_0x3671('0x72')][_0x3671('0x82')][_0x3671('0x83')]})[_0x3671('0x1e')](function(_0x17c69f){if(_0x17c69f['length']===0x1){return _0x3f10e4['id'];}else{var _0x3e09c5=_['every'](_[_0x3671('0x36')](_0x17c69f,_0x3671('0x84')),function(_0x3c9799){return _[_0x3671('0x85')](_0x135d86,_0x3c9799);});if(_0x3e09c5){return _0x3f10e4['id'];}}}));}}return BPromise['all'](_0xba0076)['then'](function(_0x1c80db){_0xd7b0f3=_(_0xd7b0f3)[_0x3671('0x86')](_0x1c80db)[_0x3671('0x87')]()['value']();return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x2da42d['params']['id']}})[_0x3671('0x1e')](function(_0x56b57a){return db[_0x3671('0x72')][_0x3671('0x88')](function(_0x9d7615){return _0x56b57a[_0x3671('0x78')](_0x2da42d[_0x3671('0x3c')][_0x3671('0x6d')],{'transaction':_0x9d7615})[_0x3671('0x1e')](function(){if(!_[_0x3671('0x89')](_0xd7b0f3)){return _0x56b57a[_0x3671('0x8a')](_0xd7b0f3,{'transaction':_0x9d7615});}})['then'](function(){_0xd7b0f3['forEach'](function(_0x27f129){socket['emit'](_0x3671('0x8b'),{'UserId':_0x27f129,'ChatQueueId':_0x56b57a['id']});});});});});});})['then'](respondWithStatusCode(_0x1e5b25,null))[_0x3671('0x50')](handleError(_0x1e5b25,null));};exports[_0x3671('0x8c')]=function(_0x3ccf90,_0x4361a0,_0x4bda5a){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0x3ccf90[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x4361a0,null))[_0x3671('0x1e')](function(_0x236714){if(_0x236714){return _0x236714[_0x3671('0x8c')](_0x3ccf90[_0x3671('0x59')][_0x3671('0x6d')],_[_0x3671('0x8d')](_0x3ccf90[_0x3671('0x59')],[_0x3671('0x6d'),'id'])||{})['spread'](function(_0x29d083){for(var _0x14d685=0x0;_0x14d685<_0x3ccf90[_0x3671('0x59')]['ids'][_0x3671('0x5d')];_0x14d685+=0x1){socket[_0x3671('0x76')](_0x3671('0x77'),{'UserId':Number(_0x3ccf90[_0x3671('0x59')][_0x3671('0x6d')][_0x14d685]),'ChatQueueId':Number(_0x3ccf90[_0x3671('0x4d')]['id'])});}return _0x29d083;});}})[_0x3671('0x1e')](respondWithResult(_0x4361a0,null))[_0x3671('0x50')](handleError(_0x4361a0,null));};exports['removeAgents']=function(_0xbaea02,_0x1db395,_0x243062){return db[_0x3671('0x37')][_0x3671('0x4f')]({'where':{'id':_0xbaea02[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x1db395,null))['then'](function(_0x195fea){if(_0x195fea){return _0x195fea[_0x3671('0x8a')](_0xbaea02['query'][_0x3671('0x6d')])[_0x3671('0x1e')](function(){if(_[_0x3671('0x8e')](_0xbaea02[_0x3671('0x3c')][_0x3671('0x6d')])){for(var _0x19b2fc=0x0;_0x19b2fc<_0xbaea02['query'][_0x3671('0x6d')][_0x3671('0x5d')];_0x19b2fc+=0x1){socket[_0x3671('0x76')]('userChatQueue:remove',{'UserId':Number(_0xbaea02[_0x3671('0x3c')]['ids'][_0x19b2fc]),'ChatQueueId':Number(_0xbaea02[_0x3671('0x4d')]['id'])});}}else{socket[_0x3671('0x76')](_0x3671('0x8b'),{'UserId':Number(_0xbaea02[_0x3671('0x3c')]['ids']),'ChatQueueId':Number(_0xbaea02[_0x3671('0x4d')]['id'])});}});}})[_0x3671('0x1e')](respondWithStatusCode(_0x1db395,null))[_0x3671('0x50')](handleError(_0x1db395,null));};exports[_0x3671('0x8f')]=function(_0xbc2696,_0x3d3bc9,_0x135286){var _0x1469b9={};var _0x4cf558={};var _0x588e23;var _0xcca819;return db[_0x3671('0x37')][_0x3671('0x5b')]({'where':{'id':_0xbc2696[_0x3671('0x4d')]['id']}})[_0x3671('0x1e')](handleEntityNotFound(_0x3d3bc9,null))[_0x3671('0x1e')](function(_0x19ff6c){if(_0x19ff6c){_0x588e23=_0x19ff6c;_0x4cf558['model']=_[_0x3671('0x4e')](db[_0x3671('0x61')][_0x3671('0x38')]);_0x4cf558['query']=_[_0x3671('0x4e')](_0xbc2696['query']);_0x4cf558[_0x3671('0x3d')]=_[_0x3671('0x3e')](_0x4cf558[_0x3671('0x3b')],_0x4cf558[_0x3671('0x3c')]);_0x1469b9[_0x3671('0x3f')]=_[_0x3671('0x3e')](_0x4cf558[_0x3671('0x3b')],qs['fields'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x40')]));_0x1469b9[_0x3671('0x3f')]=_0x1469b9[_0x3671('0x3f')]['length']?_0x1469b9[_0x3671('0x3f')]:_0x4cf558[_0x3671('0x3b')];_0x1469b9['order']=qs['sort'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x42')]);_0x1469b9[_0x3671('0x43')]=qs[_0x3671('0x3d')](_[_0x3671('0x44')](_0xbc2696['query'],_0x4cf558[_0x3671('0x3d')]));if(_0xbc2696[_0x3671('0x3c')]['filter']){_0x1469b9['where']=_[_0x3671('0x47')](_0x1469b9[_0x3671('0x43')],{'$or':_['map'](_0x1469b9[_0x3671('0x3f')],function(_0x552667){var _0x1af9f2={};_0x1af9f2[_0x552667]={'$like':'%'+_0xbc2696[_0x3671('0x3c')][_0x3671('0x45')]+'%'};return _0x1af9f2;})});}_0x1469b9=_['merge']({},_0x1469b9,_0xbc2696[_0x3671('0x48')]);return _0x588e23[_0x3671('0x8f')](_0x1469b9);}})['then'](function(_0x47b3af){if(_0x47b3af){_0xcca819=_0x47b3af['length'];if(!_0xbc2696[_0x3671('0x3c')][_0x3671('0x41')](_0x3671('0x5e'))){_0x1469b9[_0x3671('0x2c')]=qs['limit'](_0xbc2696[_0x3671('0x3c')][_0x3671('0x2c')]);_0x1469b9[_0x3671('0x2b')]=qs[_0x3671('0x2b')](_0xbc2696[_0x3671('0x3c')][_0x3671('0x2b')]);}return _0x588e23[_0x3671('0x8f')](_0x1469b9);}})['then'](function(_0x9ac553){if(_0x9ac553){return _0x9ac553?{'count':_0xcca819,'rows':_0x9ac553}:null;}})[_0x3671('0x1e')](respondWithResult(_0x3d3bc9,null))['catch'](handleError(_0x3d3bc9,null));}; \ No newline at end of file +var _0xc62c=['includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserChatQueue','ChatQueueId','User','findAndCountAll','chatPause','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','includes','all','union','value','isEmpty','forEach','userChatQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','params'];(function(_0x157d89,_0x31c6b3){var _0x592f7c=function(_0xfede7d){while(--_0xfede7d){_0x157d89['push'](_0x157d89['shift']());}};_0x592f7c(++_0x31c6b3);}(_0xc62c,0xdb));var _0xcc62=function(_0xac8961,_0xf8bea5){_0xac8961=_0xac8961-0x0;var _0x27727f=_0xc62c[_0xac8961];return _0x27727f;};'use strict';var emlformat=require(_0xcc62('0x0'));var rimraf=require(_0xcc62('0x1'));var zipdir=require(_0xcc62('0x2'));var jsonpatch=require(_0xcc62('0x3'));var rp=require('request-promise');var moment=require(_0xcc62('0x4'));var BPromise=require(_0xcc62('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcc62('0x6'));var sox=require(_0xcc62('0x7'));var csv=require(_0xcc62('0x8'));var ejs=require(_0xcc62('0x9'));var fs=require('fs');var fs_extra=require(_0xcc62('0xa'));var _=require('lodash');var squel=require(_0xcc62('0xb'));var crypto=require(_0xcc62('0xc'));var jsforce=require(_0xcc62('0xd'));var deskjs=require(_0xcc62('0xe'));var toCsv=require(_0xcc62('0x8'));var querystring=require('querystring');var Papa=require(_0xcc62('0xf'));var Redis=require(_0xcc62('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcc62('0x11'));var as=require(_0xcc62('0x12'));var hardwareService=require(_0xcc62('0x13'));var logger=require(_0xcc62('0x14'))(_0xcc62('0x15'));var utils=require(_0xcc62('0x16'));var config=require(_0xcc62('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc62('0x18'))['db'];config[_0xcc62('0x19')]=_[_0xcc62('0x1a')](config['redis'],{'host':_0xcc62('0x1b'),'port':0x18eb});var socket=require(_0xcc62('0x1c'))(new Redis(config[_0xcc62('0x19')]));require(_0xcc62('0x1d'))['register'](socket);var jayson=require(_0xcc62('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x307eb7,_0x171021,_0x1be36b,_0x5dc646){return new BPromise(function(_0x459b66,_0x119b17){var _0x324bd7=_0x5dc646||client;return _0x324bd7[_0xcc62('0x1f')](_0x307eb7,_0x1be36b)[_0xcc62('0x20')](function(_0xd41b2c){logger[_0xcc62('0x21')](_0xcc62('0x22'),_0x171021,_0xcc62('0x23'));logger[_0xcc62('0x24')](_0xcc62('0x25'),_0x171021,_0xcc62('0x23'),JSON[_0xcc62('0x26')](_0xd41b2c));if(_0xd41b2c[_0xcc62('0x27')]){if(_0xd41b2c['error'][_0xcc62('0x28')]===0x1f4){logger[_0xcc62('0x27')]('ChatQueue,\x20%s,\x20%s',_0x171021,_0xd41b2c[_0xcc62('0x27')][_0xcc62('0x29')]);return _0x119b17(_0xd41b2c[_0xcc62('0x27')][_0xcc62('0x29')]);}logger['error'](_0xcc62('0x22'),_0x171021,_0xd41b2c['error']['message']);return _0x459b66(_0xd41b2c[_0xcc62('0x27')][_0xcc62('0x29')]);}else{logger[_0xcc62('0x21')](_0xcc62('0x22'),_0x171021,_0xcc62('0x23'));_0x459b66(_0xd41b2c['result'][_0xcc62('0x29')]);}})[_0xcc62('0x2a')](function(_0x158dba){logger[_0xcc62('0x27')](_0xcc62('0x22'),_0x171021,_0x158dba);_0x119b17(_0x158dba);});});}function respondWithStatusCode(_0x49f3b9,_0x4bb506){_0x4bb506=_0x4bb506||0xcc;return function(_0x2bb2e6){if(_0x2bb2e6){return _0x49f3b9[_0xcc62('0x2b')](_0x4bb506);}return _0x49f3b9['status'](_0x4bb506)[_0xcc62('0x2c')]();};}function respondWithResult(_0x4f6236,_0x5593b8){_0x5593b8=_0x5593b8||0xc8;return function(_0xd0702e){if(_0xd0702e){return _0x4f6236[_0xcc62('0x2d')](_0x5593b8)[_0xcc62('0x2e')](_0xd0702e);}};}function respondWithFilteredResult(_0x48ae7f,_0x33fc22){return function(_0xbc361e){if(_0xbc361e){var _0x33c3c8=typeof _0x33fc22[_0xcc62('0x2f')]===_0xcc62('0x30')&&typeof _0x33fc22[_0xcc62('0x31')]===_0xcc62('0x30');var _0x28a21f=_0xbc361e[_0xcc62('0x32')];var _0xb3febc=_0x33c3c8?0x0:_0x33fc22[_0xcc62('0x2f')];var _0x27d713=_0x33c3c8?_0xbc361e[_0xcc62('0x32')]:_0x33fc22[_0xcc62('0x2f')]+_0x33fc22[_0xcc62('0x31')];var _0x1d3e0d;if(_0x27d713>=_0x28a21f){_0x27d713=_0x28a21f;_0x1d3e0d=0xc8;}else{_0x1d3e0d=0xce;}_0x48ae7f['status'](_0x1d3e0d);return _0x48ae7f[_0xcc62('0x33')](_0xcc62('0x34'),_0xb3febc+'-'+_0x27d713+'/'+_0x28a21f)[_0xcc62('0x2e')](_0xbc361e);}return null;};}function patchUpdates(_0x44c030){return function(_0x2a723a){try{jsonpatch[_0xcc62('0x35')](_0x2a723a,_0x44c030,!![]);}catch(_0x47940e){return BPromise[_0xcc62('0x36')](_0x47940e);}return _0x2a723a[_0xcc62('0x37')]();};}function saveUpdates(_0x455215,_0x57d8fb){return function(_0x187207){if(_0x187207){return _0x187207['update'](_0x455215)[_0xcc62('0x20')](function(_0x343250){return _0x343250;});}return null;};}function removeEntity(_0x1bac77,_0x299711){return function(_0x1c336e){if(_0x1c336e){return _0x1c336e[_0xcc62('0x38')]()[_0xcc62('0x20')](function(){var _0xba67fb=_0x1c336e['get']({'plain':!![]});var _0xed77ff='ChatQueues';return db[_0xcc62('0x39')][_0xcc62('0x38')]({'where':{'type':_0xed77ff,'resourceId':_0xba67fb['id']}})[_0xcc62('0x20')](function(){return _0x1c336e;});})[_0xcc62('0x20')](function(){_0x1bac77[_0xcc62('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22aec2,_0xed77b1){return function(_0x3bb597){if(!_0x3bb597){_0x22aec2[_0xcc62('0x2b')](0x194);}return _0x3bb597;};}function handleError(_0x155b1c,_0x3ad46f){_0x3ad46f=_0x3ad46f||0x1f4;return function(_0x2b0061){logger['error'](_0x2b0061['stack']);if(_0x2b0061[_0xcc62('0x3a')]){delete _0x2b0061[_0xcc62('0x3a')];}_0x155b1c[_0xcc62('0x2d')](_0x3ad46f)[_0xcc62('0x3b')](_0x2b0061);};}exports[_0xcc62('0x3c')]=function(_0x21bceb,_0x1d1de8){var _0x3685ad={},_0x1d6384={},_0x44e6ff={'count':0x0,'rows':[]};var _0x401a05=_[_0xcc62('0x3d')](db[_0xcc62('0x3e')][_0xcc62('0x3f')],function(_0x3bd2ef){return{'name':_0x3bd2ef[_0xcc62('0x40')],'type':_0x3bd2ef[_0xcc62('0x41')]['key']};});_0x1d6384[_0xcc62('0x42')]=_['map'](_0x401a05,_0xcc62('0x3a'));_0x1d6384['query']=_[_0xcc62('0x43')](_0x21bceb[_0xcc62('0x44')]);_0x1d6384[_0xcc62('0x45')]=_['intersection'](_0x1d6384[_0xcc62('0x42')],_0x1d6384[_0xcc62('0x44')]);_0x3685ad[_0xcc62('0x46')]=_[_0xcc62('0x47')](_0x1d6384['model'],qs['fields'](_0x21bceb[_0xcc62('0x44')][_0xcc62('0x48')]));_0x3685ad['attributes']=_0x3685ad[_0xcc62('0x46')][_0xcc62('0x49')]?_0x3685ad['attributes']:_0x1d6384[_0xcc62('0x42')];if(!_0x21bceb['query'][_0xcc62('0x4a')](_0xcc62('0x4b'))){_0x3685ad[_0xcc62('0x31')]=qs[_0xcc62('0x31')](_0x21bceb[_0xcc62('0x44')][_0xcc62('0x31')]);_0x3685ad['offset']=qs[_0xcc62('0x2f')](_0x21bceb['query'][_0xcc62('0x2f')]);}_0x3685ad[_0xcc62('0x4c')]=qs[_0xcc62('0x4d')](_0x21bceb[_0xcc62('0x44')][_0xcc62('0x4d')]);_0x3685ad[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x21bceb['query'],_0x1d6384[_0xcc62('0x45')]),_0x401a05);if(_0x21bceb[_0xcc62('0x44')][_0xcc62('0x50')]){_0x3685ad['where']=_[_0xcc62('0x51')](_0x3685ad['where'],{'$or':_[_0xcc62('0x3d')](_0x401a05,function(_0x33c230){if(_0x33c230[_0xcc62('0x41')]!=='VIRTUAL'){var _0x26d44b={};_0x26d44b[_0x33c230[_0xcc62('0x3a')]]={'$like':'%'+_0x21bceb[_0xcc62('0x44')]['filter']+'%'};return _0x26d44b;}})});}_0x3685ad=_[_0xcc62('0x51')]({},_0x3685ad,_0x21bceb[_0xcc62('0x52')]);var _0x5a171c={'where':_0x3685ad[_0xcc62('0x4e')]};return db[_0xcc62('0x3e')]['count'](_0x5a171c)[_0xcc62('0x20')](function(_0x8e5c5d){_0x44e6ff[_0xcc62('0x32')]=_0x8e5c5d;if(_0x21bceb[_0xcc62('0x44')]['includeAll']){_0x3685ad[_0xcc62('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0xcc62('0x54')](_0x3685ad);})[_0xcc62('0x20')](function(_0x46f35a){_0x44e6ff[_0xcc62('0x55')]=_0x46f35a;return _0x44e6ff;})[_0xcc62('0x20')](respondWithFilteredResult(_0x1d1de8,_0x3685ad))['catch'](handleError(_0x1d1de8,null));};exports['show']=function(_0x1d7408,_0x252e3a){var _0x290f60={'raw':!![],'where':{'id':_0x1d7408[_0xcc62('0x56')]['id']}},_0x3b96d1={};_0x3b96d1[_0xcc62('0x42')]=_[_0xcc62('0x43')](db[_0xcc62('0x3e')]['rawAttributes']);_0x3b96d1[_0xcc62('0x44')]=_['keys'](_0x1d7408[_0xcc62('0x44')]);_0x3b96d1[_0xcc62('0x45')]=_[_0xcc62('0x47')](_0x3b96d1[_0xcc62('0x42')],_0x3b96d1[_0xcc62('0x44')]);_0x290f60[_0xcc62('0x46')]=_['intersection'](_0x3b96d1['model'],qs[_0xcc62('0x48')](_0x1d7408[_0xcc62('0x44')]['fields']));_0x290f60['attributes']=_0x290f60[_0xcc62('0x46')][_0xcc62('0x49')]?_0x290f60[_0xcc62('0x46')]:_0x3b96d1[_0xcc62('0x42')];if(_0x1d7408[_0xcc62('0x44')][_0xcc62('0x57')]){_0x290f60[_0xcc62('0x53')]=[{'all':!![]}];}_0x290f60=_[_0xcc62('0x51')]({},_0x290f60,_0x1d7408[_0xcc62('0x52')]);return db[_0xcc62('0x3e')]['find'](_0x290f60)[_0xcc62('0x20')](handleEntityNotFound(_0x252e3a,null))[_0xcc62('0x20')](respondWithResult(_0x252e3a,null))[_0xcc62('0x2a')](handleError(_0x252e3a,null));};exports['create']=function(_0x1f1d89,_0x2949ec){return db[_0xcc62('0x3e')][_0xcc62('0x58')](_0x1f1d89[_0xcc62('0x59')],{})[_0xcc62('0x20')](function(_0x5e8bcd){var _0x4e2b13=_0x1f1d89[_0xcc62('0x5a')][_0xcc62('0x5b')]({'plain':!![]});if(!_0x4e2b13)throw new Error(_0xcc62('0x5c'));if(_0x4e2b13[_0xcc62('0x5d')]==='user'){var _0x471eb5=_0x5e8bcd[_0xcc62('0x5b')]({'plain':!![]});var _0x3f4963=_0xcc62('0x5e');return db[_0xcc62('0x5f')][_0xcc62('0x60')]({'where':{'name':_0x3f4963,'userProfileId':_0x4e2b13[_0xcc62('0x61')]},'raw':!![]})[_0xcc62('0x20')](function(_0x2984b4){if(_0x2984b4&&_0x2984b4[_0xcc62('0x62')]===0x0){return db[_0xcc62('0x39')][_0xcc62('0x58')]({'name':_0x471eb5['name'],'resourceId':_0x471eb5['id'],'type':_0x2984b4[_0xcc62('0x3a')],'sectionId':_0x2984b4['id']},{})[_0xcc62('0x20')](function(){return _0x5e8bcd;});}else{return _0x5e8bcd;}})['catch'](function(_0x24b6ed){logger[_0xcc62('0x27')](_0xcc62('0x63'),_0x24b6ed);throw _0x24b6ed;});}return _0x5e8bcd;})[_0xcc62('0x20')](respondWithResult(_0x2949ec,0xc9))[_0xcc62('0x2a')](handleError(_0x2949ec,null));};exports[_0xcc62('0x64')]=function(_0x1880ed,_0x278992){if(_0x1880ed[_0xcc62('0x59')]['id']){delete _0x1880ed[_0xcc62('0x59')]['id'];}return db['ChatQueue'][_0xcc62('0x60')]({'where':{'id':_0x1880ed['params']['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x278992,null))[_0xcc62('0x20')](saveUpdates(_0x1880ed[_0xcc62('0x59')],null))[_0xcc62('0x20')](respondWithResult(_0x278992,null))[_0xcc62('0x2a')](handleError(_0x278992,null));};exports[_0xcc62('0x38')]=function(_0xa810c6,_0x4dd379){return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0xa810c6[_0xcc62('0x56')]['id']}})['then'](handleEntityNotFound(_0x4dd379,null))['then'](removeEntity(_0x4dd379,null))[_0xcc62('0x2a')](handleError(_0x4dd379,null));};exports['describe']=function(_0x498c73,_0x59f771){return db[_0xcc62('0x3e')][_0xcc62('0x65')]()['then'](respondWithResult(_0x59f771,null))[_0xcc62('0x2a')](handleError(_0x59f771,null));};exports[_0xcc62('0x66')]=function(_0x442bb0,_0x82bc1e,_0x1a6d8a){var _0x213517={'raw':!![],'where':{}},_0x288fd2={},_0x296e80;return db['ChatQueue']['findOne']({'where':{'id':_0x442bb0[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x82bc1e,null))[_0xcc62('0x20')](function(_0x193a6b){if(_0x193a6b){_0x296e80=_0x193a6b['get']({'plain':!![]});_0x288fd2[_0xcc62('0x42')]=_[_0xcc62('0x43')](db[_0xcc62('0x67')]['rawAttributes']);_0x288fd2[_0xcc62('0x44')]=_[_0xcc62('0x43')](_0x442bb0['query']);_0x288fd2[_0xcc62('0x45')]=_['intersection'](_0x288fd2['model'],_0x288fd2[_0xcc62('0x44')]);_0x213517[_0xcc62('0x46')]=_[_0xcc62('0x47')](_0x288fd2[_0xcc62('0x42')],qs[_0xcc62('0x48')](_0x442bb0[_0xcc62('0x44')]['fields']));_0x213517[_0xcc62('0x46')]=_0x213517[_0xcc62('0x46')][_0xcc62('0x49')]?_0x213517[_0xcc62('0x46')]:_0x288fd2[_0xcc62('0x42')];if(!_0x442bb0[_0xcc62('0x44')]['hasOwnProperty'](_0xcc62('0x4b'))){_0x213517[_0xcc62('0x31')]=qs[_0xcc62('0x31')](_0x442bb0['query']['limit']);_0x213517['offset']=qs[_0xcc62('0x2f')](_0x442bb0[_0xcc62('0x44')][_0xcc62('0x2f')]);}_0x213517['order']=qs[_0xcc62('0x4d')](_0x442bb0[_0xcc62('0x44')][_0xcc62('0x4d')]);_0x213517[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x442bb0[_0xcc62('0x44')],_0x288fd2['filters']));_0x213517[_0xcc62('0x4e')][_0xcc62('0x68')]=_0x193a6b['id'];if(_0x442bb0[_0xcc62('0x44')][_0xcc62('0x50')]){_0x213517[_0xcc62('0x4e')]=_[_0xcc62('0x51')](_0x213517[_0xcc62('0x4e')],{'$or':_[_0xcc62('0x3d')](_0x213517[_0xcc62('0x46')],function(_0x13fd88){var _0x13f6b6={};_0x13f6b6[_0x13fd88]={'$like':'%'+_0x442bb0[_0xcc62('0x44')][_0xcc62('0x50')]+'%'};return _0x13f6b6;})});}_0x213517=_['merge']({},_0x213517,_0x442bb0[_0xcc62('0x52')]);return db[_0xcc62('0x67')]['findAll'](_0x213517);}})[_0xcc62('0x20')](function(_0x4725d1){if(_0x4725d1){return db[_0xcc62('0x69')][_0xcc62('0x6a')]({'where':{'id':_[_0xcc62('0x3d')](_0x4725d1,'UserId'),'role':'agent'},'attributes':['id',_0xcc62('0x3a'),_0xcc62('0x6b'),'updatedAt','createdAt']});}})[_0xcc62('0x20')](function(_0x3ebe47){if(_0x3ebe47){return{'count':_0x3ebe47['count'],'rows':_[_0xcc62('0x3d')](_0x3ebe47['rows'],function(_0x1214e3){return{'membername':_0x1214e3[_0xcc62('0x3a')],'UserId':_0x1214e3['id'],'queue_name':_0x296e80[_0xcc62('0x3a')],'ChatQueueId':_0x296e80['id'],'interface':util[_0xcc62('0x6c')](_0xcc62('0x6d'),_0xcc62('0x6e'),_0x1214e3[_0xcc62('0x3a')]),'penalty':0x0,'paused':_0x1214e3[_0xcc62('0x6b')],'createdAt':_0x1214e3[_0xcc62('0x6f')],'updatedAt':_0x1214e3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x82bc1e,_0x213517))[_0xcc62('0x2a')](handleError(_0x82bc1e,null));};exports[_0xcc62('0x70')]=function(_0x4cd0c8,_0x34e607,_0x1be142){var _0x4423cb={};var _0x5d2d72={};var _0x41d633;var _0x1648fd;return db[_0xcc62('0x3e')]['findOne']({'where':{'id':_0x4cd0c8['params']['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x34e607,null))[_0xcc62('0x20')](function(_0x5f2de4){if(_0x5f2de4){_0x41d633=_0x5f2de4;_0x5d2d72['model']=_['keys'](db[_0xcc62('0x71')]['rawAttributes']);_0x5d2d72[_0xcc62('0x44')]=_[_0xcc62('0x43')](_0x4cd0c8['query']);_0x5d2d72[_0xcc62('0x45')]=_['intersection'](_0x5d2d72[_0xcc62('0x42')],_0x5d2d72[_0xcc62('0x44')]);_0x4423cb[_0xcc62('0x46')]=_['intersection'](_0x5d2d72[_0xcc62('0x42')],qs[_0xcc62('0x48')](_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x48')]));_0x4423cb['attributes']=_0x4423cb[_0xcc62('0x46')][_0xcc62('0x49')]?_0x4423cb[_0xcc62('0x46')]:_0x5d2d72['model'];_0x4423cb[_0xcc62('0x4c')]=qs['sort'](_0x4cd0c8[_0xcc62('0x44')]['sort']);_0x4423cb[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x4cd0c8[_0xcc62('0x44')],_0x5d2d72[_0xcc62('0x45')]));if(_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x50')]){_0x4423cb['where']=_[_0xcc62('0x51')](_0x4423cb[_0xcc62('0x4e')],{'$or':_[_0xcc62('0x3d')](_0x4423cb['attributes'],function(_0x442749){var _0x4fdd6f={};_0x4fdd6f[_0x442749]={'$like':'%'+_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x50')]+'%'};return _0x4fdd6f;})});}_0x4423cb=_['merge']({},_0x4423cb,_0x4cd0c8['options']);return _0x41d633['getTeams'](_0x4423cb);}})[_0xcc62('0x20')](function(_0x59c0c6){if(_0x59c0c6){_0x1648fd=_0x59c0c6[_0xcc62('0x49')];if(!_0x4cd0c8[_0xcc62('0x44')]['hasOwnProperty'](_0xcc62('0x4b'))){_0x4423cb[_0xcc62('0x31')]=qs['limit'](_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x31')]);_0x4423cb[_0xcc62('0x2f')]=qs[_0xcc62('0x2f')](_0x4cd0c8[_0xcc62('0x44')][_0xcc62('0x2f')]);}return _0x41d633[_0xcc62('0x70')](_0x4423cb);}})[_0xcc62('0x20')](function(_0x2f5316){if(_0x2f5316){return _0x2f5316?{'count':_0x1648fd,'rows':_0x2f5316}:null;}})[_0xcc62('0x20')](respondWithResult(_0x34e607,null))[_0xcc62('0x2a')](handleError(_0x34e607,null));};exports[_0xcc62('0x72')]=function(_0x14927b,_0x157110,_0x24b03d){var _0x41cf98=_0x14927b[_0xcc62('0x59')][_0xcc62('0x73')];return db[_0xcc62('0x71')][_0xcc62('0x54')]({'where':{'id':_0x41cf98},'attributes':['id'],'include':[{'model':db[_0xcc62('0x69')],'as':_0xcc62('0x74'),'attributes':['id',_0xcc62('0x3a'),_0xcc62('0x75'),_0xcc62('0x76'),'interface'],'raw':!![]}]})[_0xcc62('0x20')](function(_0x5b789a){if(_0x5b789a){var _0x1dd461=_[_0xcc62('0x77')](_0x5b789a,function(_0x56d085){var _0x258695=_0x56d085[_0xcc62('0x5b')]({'plain':!![]});return _0x258695[_0xcc62('0x74')];});return db[_0xcc62('0x3e')]['find']({'where':{'id':_0x14927b[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](function(_0x1a12f5){return db[_0xcc62('0x78')][_0xcc62('0x79')](function(_0xf7903d){return _0x1a12f5[_0xcc62('0x72')](_0x41cf98,{'transaction':_0xf7903d})[_0xcc62('0x20')](function(){return BPromise['each'](_0x1dd461,function(_0x22f449){return db['UserChatQueue'][_0xcc62('0x7a')]({'where':{'UserId':_0x22f449['id'],'ChatQueueId':_0x14927b[_0xcc62('0x56')]['id']},'transaction':_0xf7903d});});})['then'](function(){_0x1dd461['forEach'](function(_0x1595fe){socket[_0xcc62('0x7b')](_0xcc62('0x7c'),{'UserId':_0x1595fe['id'],'ChatQueueId':_0x1a12f5['id']});});});});});}})[_0xcc62('0x20')](respondWithStatusCode(_0x157110,null))[_0xcc62('0x2a')](handleError(_0x157110,null));};exports[_0xcc62('0x7d')]=function(_0x3ef4b8,_0x5765d6,_0x4bf26b){return db[_0xcc62('0x71')][_0xcc62('0x54')]({'where':{'id':_0x3ef4b8[_0xcc62('0x44')][_0xcc62('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcc62('0x74'),'attributes':['id'],'raw':!![]}]})[_0xcc62('0x20')](handleEntityNotFound(_0x5765d6,null))[_0xcc62('0x20')](function(_0x336d76){var _0x17481e=_[_0xcc62('0x3d')](_0x336d76,'id');var _0x5af7ac=[];var _0x3c943b=[];var _0x635c9e=squel[_0xcc62('0x7e')]();_0x635c9e[_0xcc62('0x7f')](_0xcc62('0x80'))[_0xcc62('0x81')](_0xcc62('0x82'),'tq')[_0xcc62('0x83')](_0xcc62('0x84'),'ut',_0xcc62('0x85'))[_0xcc62('0x4e')](_0xcc62('0x86'),_0x3ef4b8[_0xcc62('0x56')]['id']);for(var _0x1ed40e=0x0;_0x1ed40e<_0x336d76[_0xcc62('0x49')];_0x1ed40e+=0x1){let _0x517abb=_0x336d76[_0x1ed40e];for(var _0x19dcb2=0x0;_0x19dcb2<_0x517abb['Agents'][_0xcc62('0x49')];_0x19dcb2+=0x1){let _0x33ba08=_0x517abb[_0xcc62('0x74')][_0x19dcb2];var _0x674c03=_0x635c9e[_0xcc62('0x87')]();_0x674c03[_0xcc62('0x4e')]('ut.UserId\x20=\x20?',_0x33ba08['id']);_0x3c943b[_0xcc62('0x88')](db[_0xcc62('0x78')]['query'](_0x674c03[_0xcc62('0x89')](),{'type':db[_0xcc62('0x78')][_0xcc62('0x8a')]['SELECT']})[_0xcc62('0x20')](function(_0x9677d1){if(_0x9677d1[_0xcc62('0x49')]===0x1){return _0x33ba08['id'];}else{var _0x181bfd=_['every'](_['map'](_0x9677d1,_0xcc62('0x8b')),function(_0x5aacd4){return _[_0xcc62('0x8c')](_0x17481e,_0x5aacd4);});if(_0x181bfd){return _0x33ba08['id'];}}}));}}return BPromise[_0xcc62('0x8d')](_0x3c943b)['then'](function(_0x31c4de){_0x5af7ac=_(_0x5af7ac)[_0xcc62('0x8e')](_0x31c4de)['compact']()[_0xcc62('0x8f')]();return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0x3ef4b8[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](function(_0x4a3bc8){return db[_0xcc62('0x78')]['transaction'](function(_0x451ae3){return _0x4a3bc8[_0xcc62('0x7d')](_0x3ef4b8['query'][_0xcc62('0x73')],{'transaction':_0x451ae3})['then'](function(){if(!_[_0xcc62('0x90')](_0x5af7ac)){return _0x4a3bc8['removeAgents'](_0x5af7ac,{'transaction':_0x451ae3});}})[_0xcc62('0x20')](function(){_0x5af7ac[_0xcc62('0x91')](function(_0x4456f0){socket[_0xcc62('0x7b')](_0xcc62('0x92'),{'UserId':_0x4456f0,'ChatQueueId':_0x4a3bc8['id']});});});});});});})[_0xcc62('0x20')](respondWithStatusCode(_0x5765d6,null))[_0xcc62('0x2a')](handleError(_0x5765d6,null));};exports[_0xcc62('0x93')]=function(_0x389c5b,_0x542013,_0x485683){return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0x389c5b[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x542013,null))['then'](function(_0x354f36){if(_0x354f36){return _0x354f36['addAgents'](_0x389c5b[_0xcc62('0x59')][_0xcc62('0x73')],_['omit'](_0x389c5b[_0xcc62('0x59')],[_0xcc62('0x73'),'id'])||{})[_0xcc62('0x94')](function(_0x3a0088){for(var _0x529b1d=0x0;_0x529b1d<_0x389c5b[_0xcc62('0x59')][_0xcc62('0x73')][_0xcc62('0x49')];_0x529b1d+=0x1){socket[_0xcc62('0x7b')]('userChatQueue:save',{'UserId':Number(_0x389c5b[_0xcc62('0x59')][_0xcc62('0x73')][_0x529b1d]),'ChatQueueId':Number(_0x389c5b[_0xcc62('0x56')]['id'])});}return _0x3a0088;});}})['then'](respondWithResult(_0x542013,null))[_0xcc62('0x2a')](handleError(_0x542013,null));};exports[_0xcc62('0x95')]=function(_0x2b1d17,_0x4c3929,_0x5ebb15){return db[_0xcc62('0x3e')][_0xcc62('0x60')]({'where':{'id':_0x2b1d17[_0xcc62('0x56')]['id']}})['then'](handleEntityNotFound(_0x4c3929,null))[_0xcc62('0x20')](function(_0x1e6eb0){if(_0x1e6eb0){return _0x1e6eb0[_0xcc62('0x95')](_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')])['then'](function(){if(_[_0xcc62('0x96')](_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')])){for(var _0x210bba=0x0;_0x210bba<_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')][_0xcc62('0x49')];_0x210bba+=0x1){socket['emit'](_0xcc62('0x92'),{'UserId':Number(_0x2b1d17['query'][_0xcc62('0x73')][_0x210bba]),'ChatQueueId':Number(_0x2b1d17['params']['id'])});}}else{socket[_0xcc62('0x7b')](_0xcc62('0x92'),{'UserId':Number(_0x2b1d17[_0xcc62('0x44')][_0xcc62('0x73')]),'ChatQueueId':Number(_0x2b1d17[_0xcc62('0x56')]['id'])});}});}})[_0xcc62('0x20')](respondWithStatusCode(_0x4c3929,null))[_0xcc62('0x2a')](handleError(_0x4c3929,null));};exports[_0xcc62('0x97')]=function(_0x3e4d20,_0x451bdd,_0x3c51cc){var _0x42e847={};var _0x4fae9c={};var _0x491cbe;var _0x5bda80;return db['ChatQueue'][_0xcc62('0x98')]({'where':{'id':_0x3e4d20[_0xcc62('0x56')]['id']}})[_0xcc62('0x20')](handleEntityNotFound(_0x451bdd,null))['then'](function(_0x51fa46){if(_0x51fa46){_0x491cbe=_0x51fa46;_0x4fae9c['model']=_['keys'](db[_0xcc62('0x69')][_0xcc62('0x3f')]);_0x4fae9c[_0xcc62('0x44')]=_[_0xcc62('0x43')](_0x3e4d20[_0xcc62('0x44')]);_0x4fae9c[_0xcc62('0x45')]=_[_0xcc62('0x47')](_0x4fae9c['model'],_0x4fae9c[_0xcc62('0x44')]);_0x42e847[_0xcc62('0x46')]=_[_0xcc62('0x47')](_0x4fae9c[_0xcc62('0x42')],qs[_0xcc62('0x48')](_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x48')]));_0x42e847[_0xcc62('0x46')]=_0x42e847[_0xcc62('0x46')]['length']?_0x42e847[_0xcc62('0x46')]:_0x4fae9c[_0xcc62('0x42')];_0x42e847['order']=qs['sort'](_0x3e4d20['query'][_0xcc62('0x4d')]);_0x42e847[_0xcc62('0x4e')]=qs[_0xcc62('0x45')](_[_0xcc62('0x4f')](_0x3e4d20[_0xcc62('0x44')],_0x4fae9c[_0xcc62('0x45')]));if(_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x50')]){_0x42e847['where']=_[_0xcc62('0x51')](_0x42e847['where'],{'$or':_[_0xcc62('0x3d')](_0x42e847['attributes'],function(_0x3bd5f4){var _0x44ed74={};_0x44ed74[_0x3bd5f4]={'$like':'%'+_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x50')]+'%'};return _0x44ed74;})});}_0x42e847=_['merge']({},_0x42e847,_0x3e4d20[_0xcc62('0x52')]);return _0x491cbe[_0xcc62('0x97')](_0x42e847);}})[_0xcc62('0x20')](function(_0x380d64){if(_0x380d64){_0x5bda80=_0x380d64[_0xcc62('0x49')];if(!_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x4a')](_0xcc62('0x4b'))){_0x42e847['limit']=qs[_0xcc62('0x31')](_0x3e4d20[_0xcc62('0x44')][_0xcc62('0x31')]);_0x42e847[_0xcc62('0x2f')]=qs[_0xcc62('0x2f')](_0x3e4d20['query']['offset']);}return _0x491cbe[_0xcc62('0x97')](_0x42e847);}})[_0xcc62('0x20')](function(_0x23b322){if(_0x23b322){return _0x23b322?{'count':_0x5bda80,'rows':_0x23b322}:null;}})[_0xcc62('0x20')](respondWithResult(_0x451bdd,null))[_0xcc62('0x2a')](handleError(_0x451bdd,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 775a539..7be0090 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 _0x75df=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove'];(function(_0x2ed95a,_0x334656){var _0x57cd63=function(_0x5d36d9){while(--_0x5d36d9){_0x2ed95a['push'](_0x2ed95a['shift']());}};_0x57cd63(++_0x334656);}(_0x75df,0x1e9));var _0xf75d=function(_0xf88ceb,_0x151528){_0xf88ceb=_0xf88ceb-0x0;var _0x217c3a=_0x75df[_0xf88ceb];return _0x217c3a;};'use strict';var EventEmitter=require(_0xf75d('0x0'));var ChatQueue=require(_0xf75d('0x1'))['db'][_0xf75d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf75d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf75d('0x4'),'afterDestroy':_0xf75d('0x5')};function emitEvent(_0x397c53){return function(_0x359de0,_0x306aec,_0x4f8bcf){ChatQueueEvents[_0xf75d('0x6')](_0x397c53+':'+_0x359de0['id'],_0x359de0);ChatQueueEvents[_0xf75d('0x6')](_0x397c53,_0x359de0);_0x4f8bcf(null);};}for(var e in events){if(events[_0xf75d('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xf75d('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x9a45=['update','remove','hook','ChatQueue','setMaxListeners','save'];(function(_0x3c24ff,_0x4d3305){var _0x41ac70=function(_0x20209b){while(--_0x20209b){_0x3c24ff['push'](_0x3c24ff['shift']());}};_0x41ac70(++_0x4d3305);}(_0x9a45,0x11d));var _0x59a4=function(_0xa23904,_0x2dc7a9){_0xa23904=_0xa23904-0x0;var _0x7548c6=_0x9a45[_0xa23904];return _0x7548c6;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x59a4('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x59a4('0x1')](0x0);var events={'afterCreate':_0x59a4('0x2'),'afterUpdate':_0x59a4('0x3'),'afterDestroy':_0x59a4('0x4')};function emitEvent(_0x2c06ef){return function(_0xeb0162,_0x16da99,_0x25e40b){ChatQueueEvents['emit'](_0x2c06ef+':'+_0xeb0162['id'],_0xeb0162);ChatQueueEvents['emit'](_0x2c06ef,_0xeb0162);_0x25e40b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x59a4('0x5')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f4a1f68..3b3118e 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 _0x0390=['../../config/logger','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x23b38e,_0x5df2a5){var _0x28723b=function(_0x4e6420){while(--_0x4e6420){_0x23b38e['push'](_0x23b38e['shift']());}};_0x28723b(++_0x5df2a5);}(_0x0390,0x112));var _0x0039=function(_0x80ee51,_0x3ca199){_0x80ee51=_0x80ee51-0x0;var _0x4f20ef=_0x0390[_0x80ee51];return _0x4f20ef;};'use strict';var _=require(_0x0039('0x0'));var util=require(_0x0039('0x1'));var logger=require(_0x0039('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0039('0x3'));var rp=require(_0x0039('0x4'));var fs=require('fs');var path=require(_0x0039('0x5'));var rimraf=require(_0x0039('0x6'));var config=require('../../config/environment');var attributes=require(_0x0039('0x7'));module[_0x0039('0x8')]=function(_0x42cc63,_0x1bfd94){return _0x42cc63[_0x0039('0x9')](_0x0039('0xa'),attributes,{'tableName':_0x0039('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2085=['bluebird','request-promise','rimraf','./chatQueue.attributes','ChatQueue','chat_queues','lodash','util'];(function(_0x496b4b,_0x16d3ff){var _0x192549=function(_0x159dff){while(--_0x159dff){_0x496b4b['push'](_0x496b4b['shift']());}};_0x192549(++_0x16d3ff);}(_0x2085,0x136));var _0x5208=function(_0x2bf8ac,_0x4226be){_0x2bf8ac=_0x2bf8ac-0x0;var _0x3ef094=_0x2085[_0x2bf8ac];return _0x3ef094;};'use strict';var _=require(_0x5208('0x0'));var util=require(_0x5208('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5208('0x2'));var rp=require(_0x5208('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5208('0x4'));var config=require('../../config/environment');var attributes=require(_0x5208('0x5'));module['exports']=function(_0x416d86,_0x4f8f42){return _0x416d86['define'](_0x5208('0x6'),attributes,{'tableName':_0x5208('0x7'),'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 6dd25f2..998df33 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 _0x3276=['model','map','ShowChatQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x318248,_0x3d2dbc){var _0x3eb033=function(_0xb4dce){while(--_0xb4dce){_0x318248['push'](_0x318248['shift']());}};_0x3eb033(++_0x3d2dbc);}(_0x3276,0xc7));var _0x6327=function(_0x4c6e82,_0x1cfb6f){_0x4c6e82=_0x4c6e82-0x0;var _0x30785b=_0x3276[_0x4c6e82];return _0x30785b;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6327('0x1'));var rs=require(_0x6327('0x2'));var fs=require('fs');var Redis=require(_0x6327('0x3'));var db=require(_0x6327('0x4'))['db'];var utils=require(_0x6327('0x5'));var logger=require(_0x6327('0x6'))(_0x6327('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6327('0x8')][_0x6327('0x9')]({'port':0x232a});config[_0x6327('0xa')]=_['defaults'](config[_0x6327('0xa')],{'host':_0x6327('0xb'),'port':0x18eb});var socket=require(_0x6327('0xc'))(new Redis(config[_0x6327('0xa')]));require('./chatQueue.socket')[_0x6327('0xd')](socket);function respondWithRpcPromise(_0x1687c4,_0x4e8256,_0x443b6f){return new BPromise(function(_0x289415,_0x572a9f){return client[_0x6327('0xe')](_0x1687c4,_0x443b6f)[_0x6327('0xf')](function(_0x95c9be){logger['info'](_0x6327('0x10'),_0x4e8256,_0x6327('0x11'));logger[_0x6327('0x12')](_0x6327('0x13'),_0x4e8256,_0x6327('0x11'),JSON[_0x6327('0x14')](_0x95c9be));if(_0x95c9be[_0x6327('0x15')]){if(_0x95c9be[_0x6327('0x15')][_0x6327('0x16')]===0x1f4){logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x95c9be[_0x6327('0x15')]['message']);return _0x572a9f(_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);}logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);return _0x289415(_0x95c9be[_0x6327('0x15')][_0x6327('0x17')]);}else{logger[_0x6327('0x18')](_0x6327('0x10'),_0x4e8256,_0x6327('0x11'));_0x289415(_0x95c9be[_0x6327('0x19')][_0x6327('0x17')]);}})[_0x6327('0x1a')](function(_0x7168f7){logger[_0x6327('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4e8256,_0x7168f7);_0x572a9f(_0x7168f7);});});}exports[_0x6327('0x1b')]=function(_0x12c33f){var _0x29b061=this;return new Promise(function(_0x341916,_0x4cbc80){return db['ChatQueue'][_0x6327('0x1c')]({'raw':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x1e')]===undefined?!![]:![]:!![],'where':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x1f')]||null:null,'attributes':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x20')]||null:null,'limit':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x21')]||null:null,'include':_0x12c33f[_0x6327('0x1d')]?_0x12c33f[_0x6327('0x1d')][_0x6327('0x22')]?_['map'](_0x12c33f['options'][_0x6327('0x22')],function(_0x499321){return{'model':db[_0x499321[_0x6327('0x23')]],'as':_0x499321['as'],'attributes':_0x499321['attributes'],'include':_0x499321[_0x6327('0x22')]?_['map'](_0x499321[_0x6327('0x22')],function(_0x1eae65){return{'model':db[_0x1eae65['model']],'as':_0x1eae65['as'],'attributes':_0x1eae65[_0x6327('0x20')],'include':_0x1eae65[_0x6327('0x22')]?_[_0x6327('0x24')](_0x1eae65[_0x6327('0x22')],function(_0x894157){return{'model':db[_0x894157[_0x6327('0x23')]],'as':_0x894157['as'],'attributes':_0x894157[_0x6327('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6327('0xf')](function(_0x58b590){logger[_0x6327('0x18')](_0x6327('0x1b'),_0x12c33f);logger['debug'](_0x6327('0x1b'),_0x12c33f,JSON[_0x6327('0x14')](_0x58b590));_0x341916(_0x58b590);})['catch'](function(_0x43bcd0){logger[_0x6327('0x15')](_0x6327('0x1b'),_0x43bcd0['message'],_0x12c33f);_0x4cbc80(_0x29b061[_0x6327('0x15')](0x1f4,_0x43bcd0[_0x6327('0x17')]));});});};exports[_0x6327('0x25')]=function(_0x2c986a){var _0x523b52=this;return new Promise(function(_0xf7b0a3,_0x543d31){return db['ChatQueue'][_0x6327('0x26')]({'raw':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')][_0x6327('0x1e')]===undefined?!![]:![]:!![],'where':_0x2c986a['options']?_0x2c986a[_0x6327('0x1d')][_0x6327('0x1f')]||null:null,'attributes':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')]['attributes']||null:null,'include':_0x2c986a[_0x6327('0x1d')]?_0x2c986a[_0x6327('0x1d')][_0x6327('0x22')]?_['map'](_0x2c986a[_0x6327('0x1d')][_0x6327('0x22')],function(_0x456090){return{'model':db[_0x456090['model']],'as':_0x456090['as'],'attributes':_0x456090['attributes'],'include':_0x456090[_0x6327('0x22')]?_['map'](_0x456090[_0x6327('0x22')],function(_0x4b3d89){return{'model':db[_0x4b3d89[_0x6327('0x23')]],'as':_0x4b3d89['as'],'attributes':_0x4b3d89[_0x6327('0x20')],'include':_0x4b3d89[_0x6327('0x22')]?_[_0x6327('0x24')](_0x4b3d89[_0x6327('0x22')],function(_0x2b1982){return{'model':db[_0x2b1982['model']],'as':_0x2b1982['as'],'attributes':_0x2b1982[_0x6327('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6327('0xf')](function(_0x154733){logger[_0x6327('0x18')]('ShowChatQueue',_0x2c986a);logger['debug'](_0x6327('0x25'),_0x2c986a,JSON[_0x6327('0x14')](_0x154733));_0xf7b0a3(_0x154733);})[_0x6327('0x1a')](function(_0x2b1b3f){logger[_0x6327('0x15')]('ShowChatQueue',_0x2b1b3f[_0x6327('0x17')],_0x2c986a);_0x543d31(_0x523b52[_0x6327('0x15')](0x1f4,_0x2b1b3f[_0x6327('0x17')]));});});}; \ No newline at end of file +var _0x9f4d=['attributes','limit','include','model','map','GetChatQueue','stringify','catch','ShowChatQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','ChatQueue','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x113876,_0x2d243d){_0x113876=_0x113876-0x0;var _0x3da554=_0x9f4d[_0x113876];return _0x3da554;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var moment=require(_0xd9f4('0x2'));var BPromise=require(_0xd9f4('0x3'));var rs=require(_0xd9f4('0x4'));var fs=require('fs');var Redis=require(_0xd9f4('0x5'));var db=require(_0xd9f4('0x6'))['db'];var utils=require(_0xd9f4('0x7'));var logger=require(_0xd9f4('0x8'))('rpc');var config=require(_0xd9f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9f4('0xa')][_0xd9f4('0xb')]({'port':0x232a});config[_0xd9f4('0xc')]=_[_0xd9f4('0xd')](config['redis'],{'host':_0xd9f4('0xe'),'port':0x18eb});var socket=require(_0xd9f4('0xf'))(new Redis(config['redis']));require(_0xd9f4('0x10'))['register'](socket);function respondWithRpcPromise(_0x16cacf,_0x41709a,_0x2deeb5){return new BPromise(function(_0x429d90,_0x2bd084){return client['request'](_0x16cacf,_0x2deeb5)[_0xd9f4('0x11')](function(_0x312d09){logger[_0xd9f4('0x12')](_0xd9f4('0x13'),_0x41709a,_0xd9f4('0x14'));logger[_0xd9f4('0x15')](_0xd9f4('0x16'),_0x41709a,_0xd9f4('0x14'),JSON['stringify'](_0x312d09));if(_0x312d09[_0xd9f4('0x17')]){if(_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x18')]===0x1f4){logger[_0xd9f4('0x17')](_0xd9f4('0x13'),_0x41709a,_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x19')]);return _0x2bd084(_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x19')]);}logger[_0xd9f4('0x17')](_0xd9f4('0x13'),_0x41709a,_0x312d09[_0xd9f4('0x17')][_0xd9f4('0x19')]);return _0x429d90(_0x312d09['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x41709a,_0xd9f4('0x14'));_0x429d90(_0x312d09[_0xd9f4('0x1a')][_0xd9f4('0x19')]);}})['catch'](function(_0x45f93c){logger[_0xd9f4('0x17')](_0xd9f4('0x13'),_0x41709a,_0x45f93c);_0x2bd084(_0x45f93c);});});}exports['GetChatQueue']=function(_0x32ab66){var _0x591be1=this;return new Promise(function(_0x313bf2,_0x93e8df){return db[_0xd9f4('0x1b')]['findAll']({'raw':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32ab66['options']?_0x32ab66[_0xd9f4('0x1c')]['where']||null:null,'attributes':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1d')]||null:null,'limit':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1e')]||null:null,'include':_0x32ab66[_0xd9f4('0x1c')]?_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1f')]?_['map'](_0x32ab66[_0xd9f4('0x1c')][_0xd9f4('0x1f')],function(_0x1fe43b){return{'model':db[_0x1fe43b[_0xd9f4('0x20')]],'as':_0x1fe43b['as'],'attributes':_0x1fe43b[_0xd9f4('0x1d')],'include':_0x1fe43b[_0xd9f4('0x1f')]?_[_0xd9f4('0x21')](_0x1fe43b['include'],function(_0x17e017){return{'model':db[_0x17e017[_0xd9f4('0x20')]],'as':_0x17e017['as'],'attributes':_0x17e017[_0xd9f4('0x1d')],'include':_0x17e017[_0xd9f4('0x1f')]?_['map'](_0x17e017['include'],function(_0x478bc6){return{'model':db[_0x478bc6[_0xd9f4('0x20')]],'as':_0x478bc6['as'],'attributes':_0x478bc6['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9f4('0x11')](function(_0x453a08){logger['info']('GetChatQueue',_0x32ab66);logger[_0xd9f4('0x15')](_0xd9f4('0x22'),_0x32ab66,JSON[_0xd9f4('0x23')](_0x453a08));_0x313bf2(_0x453a08);})[_0xd9f4('0x24')](function(_0x8c3e50){logger[_0xd9f4('0x17')](_0xd9f4('0x22'),_0x8c3e50[_0xd9f4('0x19')],_0x32ab66);_0x93e8df(_0x591be1[_0xd9f4('0x17')](0x1f4,_0x8c3e50[_0xd9f4('0x19')]));});});};exports[_0xd9f4('0x25')]=function(_0x40b489){var _0x52d081=this;return new Promise(function(_0x2924e6,_0x505867){return db[_0xd9f4('0x1b')][_0xd9f4('0x26')]({'raw':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')][_0xd9f4('0x27')]===undefined?!![]:![]:!![],'where':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')][_0xd9f4('0x28')]||null:null,'attributes':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')][_0xd9f4('0x1d')]||null:null,'include':_0x40b489[_0xd9f4('0x1c')]?_0x40b489[_0xd9f4('0x1c')]['include']?_['map'](_0x40b489['options'][_0xd9f4('0x1f')],function(_0x9c3f8b){return{'model':db[_0x9c3f8b[_0xd9f4('0x20')]],'as':_0x9c3f8b['as'],'attributes':_0x9c3f8b[_0xd9f4('0x1d')],'include':_0x9c3f8b[_0xd9f4('0x1f')]?_[_0xd9f4('0x21')](_0x9c3f8b[_0xd9f4('0x1f')],function(_0x2c313f){return{'model':db[_0x2c313f[_0xd9f4('0x20')]],'as':_0x2c313f['as'],'attributes':_0x2c313f[_0xd9f4('0x1d')],'include':_0x2c313f[_0xd9f4('0x1f')]?_['map'](_0x2c313f['include'],function(_0x1ba715){return{'model':db[_0x1ba715[_0xd9f4('0x20')]],'as':_0x1ba715['as'],'attributes':_0x1ba715[_0xd9f4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd9f4('0x11')](function(_0x3dea70){logger[_0xd9f4('0x12')](_0xd9f4('0x25'),_0x40b489);logger[_0xd9f4('0x15')](_0xd9f4('0x25'),_0x40b489,JSON[_0xd9f4('0x23')](_0x3dea70));_0x2924e6(_0x3dea70);})[_0xd9f4('0x24')](function(_0x32bd8b){logger[_0xd9f4('0x17')]('ShowChatQueue',_0x32bd8b['message'],_0x40b489);_0x505867(_0x52d081[_0xd9f4('0x17')](0x1f4,_0x32bd8b[_0xd9f4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index bff65b2..3c8bcff 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 _0xb903=['update','emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xb903,0x185));var _0x3b90=function(_0x13d403,_0x21edc6){_0x13d403=_0x13d403-0x0;var _0x56d417=_0xb903[_0x13d403];return _0x56d417;};'use strict';var ChatQueueEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){ChatQueueEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);ChatQueueEvents['on'](_0x153283,_0x2e4c06);}}; \ No newline at end of file +var _0xb66c=['chatQueue:','./chatQueue.events','remove','removeListener','register','length'];(function(_0xdaab62,_0x2728ab){var _0x13d767=function(_0x14bf14){while(--_0x14bf14){_0xdaab62['push'](_0xdaab62['shift']());}};_0x13d767(++_0x2728ab);}(_0xb66c,0x175));var _0xcb66=function(_0xaa9a84,_0x421998){_0xaa9a84=_0xaa9a84-0x0;var _0x22ee25=_0xb66c[_0xaa9a84];return _0x22ee25;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0xa3993,_0x439f3d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 3b1855c..3610c33 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x160ad5,_0x596e86){var _0x11fb42=function(_0x1fdaa5){while(--_0x1fdaa5){_0x160ad5['push'](_0x160ad5['shift']());}};_0x11fb42(++_0x596e86);}(_0x008c,0x188));var _0xc008=function(_0x32084f,_0x28fc38){_0x32084f=_0x32084f-0x0;var _0x187302=_0x008c[_0x32084f];return _0x187302;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2810e4,_0x528e9e){var _0x17d891=function(_0x174b60){while(--_0x174b60){_0x2810e4['push'](_0x2810e4['shift']());}};_0x17d891(++_0x528e9e);}(_0x55ca,0x126));var _0xa55c=function(_0x7e918f,_0x48cf10){_0x7e918f=_0x7e918f-0x0;var _0x5b35ab=_0x55ca[_0x7e918f];return _0x5b35ab;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('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 894fe54..3552b33 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 _0xf304=['STRING','DATE','moment','sequelize','exports'];(function(_0x67788c,_0x3d2b63){var _0x49d59a=function(_0x5883ab){while(--_0x5883ab){_0x67788c['push'](_0x67788c['shift']());}};_0x49d59a(++_0x3d2b63);}(_0xf304,0x1c4));var _0x4f30=function(_0x327fd2,_0x22bb1a){_0x327fd2=_0x327fd2-0x0;var _0x30f4f3=_0xf304[_0x327fd2];return _0x30f4f3;};'use strict';var moment=require(_0x4f30('0x0'));var Sequelize=require(_0x4f30('0x1'));module[_0x4f30('0x2')]={'uniqueid':{'type':Sequelize[_0x4f30('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4f30('0x3')]},'joinAt':{'type':Sequelize[_0x4f30('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4f30('0x4')]},'reason':{'type':Sequelize[_0x4f30('0x3')]}}; \ No newline at end of file +var _0x2f66=['moment','sequelize','exports','STRING','DATE'];(function(_0x1ac6dc,_0x1b26f0){var _0x1081d1=function(_0x43ad04){while(--_0x43ad04){_0x1ac6dc['push'](_0x1ac6dc['shift']());}};_0x1081d1(++_0x1b26f0);}(_0x2f66,0x1ea));var _0x62f6=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x2f66[_0x1f44e4];return _0x591989;};'use strict';var moment=require(_0x62f6('0x0'));var Sequelize=require(_0x62f6('0x1'));module[_0x62f6('0x2')]={'uniqueid':{'type':Sequelize[_0x62f6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x62f6('0x3')]},'joinAt':{'type':Sequelize[_0x62f6('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x62f6('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x62f6('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 52a86c8..93d4a2f 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 _0x9962=['type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatQueueReport','count','includeAll','include','rows','catch','keys','rawAttributes','find','create','update','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','fieldName'];(function(_0x382ddf,_0x2b149a){var _0x23914c=function(_0x3b0cb8){while(--_0x3b0cb8){_0x382ddf['push'](_0x382ddf['shift']());}};_0x23914c(++_0x2b149a);}(_0x9962,0xb8));var _0x2996=function(_0x574b67,_0x38cfc1){_0x574b67=_0x574b67-0x0;var _0x5a8ccd=_0x9962[_0x574b67];return _0x5a8ccd;};'use strict';var emlformat=require(_0x2996('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2996('0x1'));var jsonpatch=require(_0x2996('0x2'));var rp=require(_0x2996('0x3'));var moment=require('moment');var BPromise=require(_0x2996('0x4'));var Mustache=require('mustache');var util=require(_0x2996('0x5'));var path=require(_0x2996('0x6'));var sox=require('sox');var csv=require(_0x2996('0x7'));var ejs=require(_0x2996('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2996('0x9'));var squel=require(_0x2996('0xa'));var crypto=require(_0x2996('0xb'));var jsforce=require(_0x2996('0xc'));var deskjs=require(_0x2996('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2996('0xe'));var Papa=require('papaparse');var Redis=require(_0x2996('0xf'));var authService=require(_0x2996('0x10'));var qs=require(_0x2996('0x11'));var as=require(_0x2996('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2996('0x13'))(_0x2996('0x14'));var utils=require(_0x2996('0x15'));var config=require(_0x2996('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2996('0x17'))['db'];function respondWithStatusCode(_0x21f096,_0x10a958){_0x10a958=_0x10a958||0xcc;return function(_0x30b5e4){if(_0x30b5e4){return _0x21f096['sendStatus'](_0x10a958);}return _0x21f096[_0x2996('0x18')](_0x10a958)['end']();};}function respondWithResult(_0x4117f5,_0x468a4f){_0x468a4f=_0x468a4f||0xc8;return function(_0x5b942f){if(_0x5b942f){return _0x4117f5[_0x2996('0x18')](_0x468a4f)[_0x2996('0x19')](_0x5b942f);}};}function respondWithFilteredResult(_0x39b18e,_0x43e380){return function(_0xc267fb){if(_0xc267fb){var _0xb50801=typeof _0x43e380[_0x2996('0x1a')]==='undefined'&&typeof _0x43e380['limit']===_0x2996('0x1b');var _0x5d8236=_0xc267fb['count'];var _0x4c29bd=_0xb50801?0x0:_0x43e380[_0x2996('0x1a')];var _0x149c68=_0xb50801?_0xc267fb['count']:_0x43e380[_0x2996('0x1a')]+_0x43e380[_0x2996('0x1c')];var _0x9743ee;if(_0x149c68>=_0x5d8236){_0x149c68=_0x5d8236;_0x9743ee=0xc8;}else{_0x9743ee=0xce;}_0x39b18e[_0x2996('0x18')](_0x9743ee);return _0x39b18e[_0x2996('0x1d')](_0x2996('0x1e'),_0x4c29bd+'-'+_0x149c68+'/'+_0x5d8236)[_0x2996('0x19')](_0xc267fb);}return null;};}function patchUpdates(_0x232ec9){return function(_0x2c5cb3){try{jsonpatch[_0x2996('0x1f')](_0x2c5cb3,_0x232ec9,!![]);}catch(_0x5bfc6d){return BPromise[_0x2996('0x20')](_0x5bfc6d);}return _0x2c5cb3[_0x2996('0x21')]();};}function saveUpdates(_0x43e835,_0x64a05b){return function(_0xa39f6d){if(_0xa39f6d){return _0xa39f6d['update'](_0x43e835)[_0x2996('0x22')](function(_0x42e5f5){return _0x42e5f5;});}return null;};}function removeEntity(_0x2bfb2b,_0x4de34d){return function(_0xbc555a){if(_0xbc555a){return _0xbc555a[_0x2996('0x23')]()[_0x2996('0x22')](function(){_0x2bfb2b['status'](0xcc)[_0x2996('0x24')]();});}};}function handleEntityNotFound(_0x88f1c5,_0x2177b1){return function(_0x53c636){if(!_0x53c636){_0x88f1c5[_0x2996('0x25')](0x194);}return _0x53c636;};}function handleError(_0x15ab22,_0x5636eb){_0x5636eb=_0x5636eb||0x1f4;return function(_0x229fad){logger[_0x2996('0x26')](_0x229fad[_0x2996('0x27')]);if(_0x229fad[_0x2996('0x28')]){delete _0x229fad['name'];}_0x15ab22[_0x2996('0x18')](_0x5636eb)[_0x2996('0x29')](_0x229fad);};}exports['index']=function(_0x52b2e6,_0x12959f){var _0x4941c3={},_0x3adddd={},_0x3a509f={'count':0x0,'rows':[]};var _0x13bfc0=_[_0x2996('0x2a')](db['ChatQueueReport']['rawAttributes'],function(_0x365ea1){return{'name':_0x365ea1[_0x2996('0x2b')],'type':_0x365ea1[_0x2996('0x2c')][_0x2996('0x2d')]};});_0x3adddd[_0x2996('0x2e')]=_[_0x2996('0x2a')](_0x13bfc0,_0x2996('0x28'));_0x3adddd[_0x2996('0x2f')]=_['keys'](_0x52b2e6[_0x2996('0x2f')]);_0x3adddd[_0x2996('0x30')]=_['intersection'](_0x3adddd[_0x2996('0x2e')],_0x3adddd['query']);_0x4941c3[_0x2996('0x31')]=_[_0x2996('0x32')](_0x3adddd[_0x2996('0x2e')],qs['fields'](_0x52b2e6['query'][_0x2996('0x33')]));_0x4941c3['attributes']=_0x4941c3[_0x2996('0x31')][_0x2996('0x34')]?_0x4941c3['attributes']:_0x3adddd[_0x2996('0x2e')];if(!_0x52b2e6[_0x2996('0x2f')][_0x2996('0x35')](_0x2996('0x36'))){_0x4941c3[_0x2996('0x1c')]=qs[_0x2996('0x1c')](_0x52b2e6['query']['limit']);_0x4941c3[_0x2996('0x1a')]=qs[_0x2996('0x1a')](_0x52b2e6[_0x2996('0x2f')][_0x2996('0x1a')]);}_0x4941c3[_0x2996('0x37')]=qs[_0x2996('0x38')](_0x52b2e6['query'][_0x2996('0x38')]);_0x4941c3[_0x2996('0x39')]=qs['filters'](_['pick'](_0x52b2e6[_0x2996('0x2f')],_0x3adddd[_0x2996('0x30')]),_0x13bfc0);if(_0x52b2e6['query'][_0x2996('0x3a')]){_0x4941c3[_0x2996('0x39')]=_[_0x2996('0x3b')](_0x4941c3[_0x2996('0x39')],{'$or':_[_0x2996('0x2a')](_0x13bfc0,function(_0x32c13f){if(_0x32c13f[_0x2996('0x2c')]!==_0x2996('0x3c')){var _0x4fb862={};_0x4fb862[_0x32c13f[_0x2996('0x28')]]={'$like':'%'+_0x52b2e6[_0x2996('0x2f')][_0x2996('0x3a')]+'%'};return _0x4fb862;}})});}_0x4941c3=_['merge']({},_0x4941c3,_0x52b2e6[_0x2996('0x3d')]);var _0x4d825e={'where':_0x4941c3[_0x2996('0x39')]};return db[_0x2996('0x3e')][_0x2996('0x3f')](_0x4d825e)[_0x2996('0x22')](function(_0x308984){_0x3a509f[_0x2996('0x3f')]=_0x308984;if(_0x52b2e6[_0x2996('0x2f')][_0x2996('0x40')]){_0x4941c3[_0x2996('0x41')]=[{'all':!![]}];}return db[_0x2996('0x3e')]['findAll'](_0x4941c3);})[_0x2996('0x22')](function(_0x329c71){_0x3a509f[_0x2996('0x42')]=_0x329c71;return _0x3a509f;})['then'](respondWithFilteredResult(_0x12959f,_0x4941c3))[_0x2996('0x43')](handleError(_0x12959f,null));};exports['show']=function(_0x59965f,_0x19eeae){var _0x256190={'raw':!![],'where':{'id':_0x59965f['params']['id']}},_0x134437={};_0x134437[_0x2996('0x2e')]=_[_0x2996('0x44')](db[_0x2996('0x3e')][_0x2996('0x45')]);_0x134437[_0x2996('0x2f')]=_[_0x2996('0x44')](_0x59965f['query']);_0x134437['filters']=_[_0x2996('0x32')](_0x134437[_0x2996('0x2e')],_0x134437[_0x2996('0x2f')]);_0x256190[_0x2996('0x31')]=_[_0x2996('0x32')](_0x134437[_0x2996('0x2e')],qs[_0x2996('0x33')](_0x59965f[_0x2996('0x2f')]['fields']));_0x256190['attributes']=_0x256190['attributes'][_0x2996('0x34')]?_0x256190[_0x2996('0x31')]:_0x134437['model'];if(_0x59965f[_0x2996('0x2f')][_0x2996('0x40')]){_0x256190[_0x2996('0x41')]=[{'all':!![]}];}_0x256190=_['merge']({},_0x256190,_0x59965f[_0x2996('0x3d')]);return db[_0x2996('0x3e')][_0x2996('0x46')](_0x256190)[_0x2996('0x22')](handleEntityNotFound(_0x19eeae,null))[_0x2996('0x22')](respondWithResult(_0x19eeae,null))[_0x2996('0x43')](handleError(_0x19eeae,null));};exports[_0x2996('0x47')]=function(_0xf9427e,_0x246351){return db[_0x2996('0x3e')]['create'](_0xf9427e['body'],{})['then'](respondWithResult(_0x246351,0xc9))[_0x2996('0x43')](handleError(_0x246351,null));};exports[_0x2996('0x48')]=function(_0x1a4ea5,_0x7d35b5){if(_0x1a4ea5[_0x2996('0x49')]['id']){delete _0x1a4ea5[_0x2996('0x49')]['id'];}return db[_0x2996('0x3e')][_0x2996('0x46')]({'where':{'id':_0x1a4ea5[_0x2996('0x4a')]['id']}})[_0x2996('0x22')](handleEntityNotFound(_0x7d35b5,null))['then'](saveUpdates(_0x1a4ea5['body'],null))[_0x2996('0x22')](respondWithResult(_0x7d35b5,null))[_0x2996('0x43')](handleError(_0x7d35b5,null));};exports[_0x2996('0x23')]=function(_0x2ecb3a,_0x17c346){return db[_0x2996('0x3e')][_0x2996('0x46')]({'where':{'id':_0x2ecb3a['params']['id']}})[_0x2996('0x22')](handleEntityNotFound(_0x17c346,null))[_0x2996('0x22')](removeEntity(_0x17c346,null))[_0x2996('0x43')](handleError(_0x17c346,null));};exports[_0x2996('0x4b')]=function(_0x223fba,_0x1805fd){return db['ChatQueueReport'][_0x2996('0x4b')]()[_0x2996('0x22')](respondWithResult(_0x1805fd,null))[_0x2996('0x43')](handleError(_0x1805fd,null));}; \ No newline at end of file +var _0x5496=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x5104a0,_0x3aa5a7){var _0x21346e=function(_0x5d1fe6){while(--_0x5d1fe6){_0x5104a0['push'](_0x5104a0['shift']());}};_0x21346e(++_0x3aa5a7);}(_0x5496,0x175));var _0x6549=function(_0x15b696,_0x2aeaf4){_0x15b696=_0x15b696-0x0;var _0x4a699b=_0x5496[_0x15b696];return _0x4a699b;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':!![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['ChatQueueReport'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));};exports['describe']=function(_0x28af00,_0x4bbc61){return db[_0x6549('0x2b')][_0x6549('0x4e')]()[_0x6549('0x26')](respondWithResult(_0x4bbc61,null))[_0x6549('0x43')](handleError(_0x4bbc61,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index fa15de0..f542349 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2f256e,_0x37b94a){var _0x425d16=function(_0x5303b5){while(--_0x5303b5){_0x2f256e['push'](_0x2f256e['shift']());}};_0x425d16(++_0x37b94a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x46bad4,_0x3b00ae){var _0x445453=function(_0x35a08f){while(--_0x35a08f){_0x46bad4['push'](_0x46bad4['shift']());}};_0x445453(++_0x3b00ae);}(_0x757a,0xde));var _0xa757=function(_0x51f847,_0x58d557){_0x51f847=_0x51f847-0x0;var _0x4edd00=_0x757a[_0x51f847];return _0x4edd00;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 4010cc5..257f90d 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 _0x0c29=['error','code','message','result','CreateChatQueueReport','ChatQueueReport','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d3ef6,_0x1e4798){var _0xa4be17=function(_0x492d8a){while(--_0x492d8a){_0x4d3ef6['push'](_0x4d3ef6['shift']());}};_0xa4be17(++_0x1e4798);}(_0x0c29,0x69));var _0x90c2=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x0c29[_0x32c012];return _0x48562e;};'use strict';var _=require(_0x90c2('0x0'));var util=require('util');var moment=require(_0x90c2('0x1'));var BPromise=require(_0x90c2('0x2'));var rs=require(_0x90c2('0x3'));var fs=require('fs');var Redis=require(_0x90c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90c2('0x5'));var config=require(_0x90c2('0x6'));var jayson=require(_0x90c2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30ba30,_0x279aae,_0x14b516){return new BPromise(function(_0xed30ba,_0x103cfa){return client['request'](_0x30ba30,_0x14b516)[_0x90c2('0x8')](function(_0x53aaea){logger[_0x90c2('0x9')](_0x90c2('0xa'),_0x279aae,_0x90c2('0xb'));logger[_0x90c2('0xc')](_0x90c2('0xd'),_0x279aae,_0x90c2('0xb'),JSON[_0x90c2('0xe')](_0x53aaea));if(_0x53aaea['error']){if(_0x53aaea[_0x90c2('0xf')][_0x90c2('0x10')]===0x1f4){logger[_0x90c2('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x279aae,_0x53aaea[_0x90c2('0xf')][_0x90c2('0x11')]);return _0x103cfa(_0x53aaea[_0x90c2('0xf')][_0x90c2('0x11')]);}logger[_0x90c2('0xf')](_0x90c2('0xa'),_0x279aae,_0x53aaea[_0x90c2('0xf')]['message']);return _0xed30ba(_0x53aaea[_0x90c2('0xf')]['message']);}else{logger['info'](_0x90c2('0xa'),_0x279aae,_0x90c2('0xb'));_0xed30ba(_0x53aaea[_0x90c2('0x12')][_0x90c2('0x11')]);}})['catch'](function(_0x357f42){logger[_0x90c2('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x279aae,_0x357f42);_0x103cfa(_0x357f42);});});}exports[_0x90c2('0x13')]=function(_0xe8b6a9){var _0x5b338c=this;return new Promise(function(_0x5097ec,_0xddb970){return db[_0x90c2('0x14')]['create'](_0xe8b6a9['body'],{'raw':_0xe8b6a9['options']?_0xe8b6a9[_0x90c2('0x15')][_0x90c2('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x348db2){logger[_0x90c2('0x9')](_0x90c2('0x13'),_0xe8b6a9);logger['debug'](_0x90c2('0x13'),_0xe8b6a9,JSON['stringify'](_0x348db2));_0x5097ec(_0x348db2);})[_0x90c2('0x17')](function(_0x2184d4){logger[_0x90c2('0xf')](_0x90c2('0x13'),_0x2184d4[_0x90c2('0x11')],_0xe8b6a9);_0xddb970(_0x5b338c['error'](0x1f4,_0x2184d4[_0x90c2('0x11')]));});});};exports[_0x90c2('0x18')]=function(_0x409baf){var _0xe4cd8=this;return new Promise(function(_0x447adc,_0x54e6da){return db[_0x90c2('0x14')][_0x90c2('0x19')](_0x409baf[_0x90c2('0x1a')],{'raw':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1b')]||null:null,'attributes':_0x409baf[_0x90c2('0x15')]?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1c')]||null:null,'limit':_0x409baf['options']?_0x409baf[_0x90c2('0x15')][_0x90c2('0x1d')]||null:null})[_0x90c2('0x8')](function(_0x1e5463){logger[_0x90c2('0x9')](_0x90c2('0x18'),_0x409baf);logger[_0x90c2('0xc')](_0x90c2('0x18'),_0x409baf,JSON[_0x90c2('0xe')](_0x1e5463));_0x447adc(_0x1e5463);})[_0x90c2('0x17')](function(_0xb88f91){logger['error'](_0x90c2('0x18'),_0xb88f91[_0x90c2('0x11')],_0x409baf);_0x54e6da(_0xe4cd8[_0x90c2('0xf')](0x1f4,_0xb88f91['message']));});});}; \ No newline at end of file +var _0x746e=['ChatQueueReport','create','body','options','raw','then','debug','stringify','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x2224a7,_0x188491){var _0x55bc4a=function(_0x46ed8f){while(--_0x46ed8f){_0x2224a7['push'](_0x2224a7['shift']());}};_0x55bc4a(++_0x188491);}(_0x746e,0x140));var _0xe746=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x746e[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xe746('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe746('0x1'));var rs=require(_0xe746('0x2'));var fs=require('fs');var Redis=require(_0xe746('0x3'));var db=require(_0xe746('0x4'))['db'];var utils=require(_0xe746('0x5'));var logger=require('../../config/logger')(_0xe746('0x6'));var config=require(_0xe746('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe746('0x8')][_0xe746('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fb899,_0xe6a104,_0x5e28eb){return new BPromise(function(_0xc37940,_0xab6d11){return client[_0xe746('0xa')](_0x1fb899,_0x5e28eb)['then'](function(_0x30d4e2){logger[_0xe746('0xb')](_0xe746('0xc'),_0xe6a104,'request\x20sent');logger['debug'](_0xe746('0xd'),_0xe6a104,_0xe746('0xe'),JSON['stringify'](_0x30d4e2));if(_0x30d4e2[_0xe746('0xf')]){if(_0x30d4e2[_0xe746('0xf')][_0xe746('0x10')]===0x1f4){logger[_0xe746('0xf')](_0xe746('0xc'),_0xe6a104,_0x30d4e2[_0xe746('0xf')][_0xe746('0x11')]);return _0xab6d11(_0x30d4e2[_0xe746('0xf')][_0xe746('0x11')]);}logger['error'](_0xe746('0xc'),_0xe6a104,_0x30d4e2[_0xe746('0xf')][_0xe746('0x11')]);return _0xc37940(_0x30d4e2[_0xe746('0xf')]['message']);}else{logger['info'](_0xe746('0xc'),_0xe6a104,'request\x20sent');_0xc37940(_0x30d4e2[_0xe746('0x12')]['message']);}})[_0xe746('0x13')](function(_0x4b6ad7){logger[_0xe746('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0xe6a104,_0x4b6ad7);_0xab6d11(_0x4b6ad7);});});}exports['CreateChatQueueReport']=function(_0x185b7f){var _0x2cb71c=this;return new Promise(function(_0x317693,_0x15ba8c){return db[_0xe746('0x14')][_0xe746('0x15')](_0x185b7f[_0xe746('0x16')],{'raw':_0x185b7f[_0xe746('0x17')]?_0x185b7f[_0xe746('0x17')][_0xe746('0x18')]===undefined?!![]:![]:!![]})[_0xe746('0x19')](function(_0x32190a){logger[_0xe746('0xb')]('CreateChatQueueReport',_0x185b7f);logger[_0xe746('0x1a')]('CreateChatQueueReport',_0x185b7f,JSON[_0xe746('0x1b')](_0x32190a));_0x317693(_0x32190a);})[_0xe746('0x13')](function(_0x312b38){logger[_0xe746('0xf')](_0xe746('0x1c'),_0x312b38['message'],_0x185b7f);_0x15ba8c(_0x2cb71c[_0xe746('0xf')](0x1f4,_0x312b38[_0xe746('0x11')]));});});};exports[_0xe746('0x1d')]=function(_0x421e22){var _0x195715=this;return new Promise(function(_0x392afd,_0x57c2bc){return db[_0xe746('0x14')][_0xe746('0x1e')](_0x421e22[_0xe746('0x16')],{'raw':_0x421e22['options']?_0x421e22['options'][_0xe746('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x421e22[_0xe746('0x17')]?_0x421e22['options'][_0xe746('0x1f')]||null:null,'attributes':_0x421e22['options']?_0x421e22[_0xe746('0x17')][_0xe746('0x20')]||null:null,'limit':_0x421e22['options']?_0x421e22[_0xe746('0x17')][_0xe746('0x21')]||null:null})[_0xe746('0x19')](function(_0x1915ed){logger[_0xe746('0xb')](_0xe746('0x1d'),_0x421e22);logger['debug'](_0xe746('0x1d'),_0x421e22,JSON[_0xe746('0x1b')](_0x1915ed));_0x392afd(_0x1915ed);})['catch'](function(_0x1ed4f5){logger[_0xe746('0xf')](_0xe746('0x1d'),_0x1ed4f5[_0xe746('0x11')],_0x421e22);_0x57c2bc(_0x195715[_0xe746('0xf')](0x1f4,_0x1ed4f5[_0xe746('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 7e6c8af..6ea4b47 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 _0x8eae=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0x8eae,0xfc));var _0xe8ea=function(_0xf7dd0f,_0x396c3b){_0xf7dd0f=_0xf7dd0f-0x0;var _0x3fc64b=_0x8eae[_0xf7dd0f];return _0x3fc64b;};'use strict';var multer=require(_0xe8ea('0x0'));var util=require(_0xe8ea('0x1'));var path=require(_0xe8ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8ea('0x3')]();var fs_extra=require(_0xe8ea('0x4'));var auth=require(_0xe8ea('0x5'));var interaction=require(_0xe8ea('0x6'));var config=require(_0xe8ea('0x7'));var controller=require(_0xe8ea('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8ea('0x9')]);router['get'](_0xe8ea('0xa'),auth[_0xe8ea('0xb')](),controller[_0xe8ea('0xc')]);router[_0xe8ea('0xd')](_0xe8ea('0xe'),auth['isAuthenticated'](),controller[_0xe8ea('0xf')]);router['post']('/',auth[_0xe8ea('0xb')](),controller['create']);router[_0xe8ea('0x10')]('/:id',auth[_0xe8ea('0xb')](),controller[_0xe8ea('0x11')]);router[_0xe8ea('0x12')]('/:id',auth[_0xe8ea('0xb')](),controller[_0xe8ea('0x13')]);module[_0xe8ea('0x14')]=router; \ No newline at end of file +var _0x4438=['get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x51b8e0,_0x3a2475){var _0x2689c5=function(_0x39905f){while(--_0x39905f){_0x51b8e0['push'](_0x51b8e0['shift']());}};_0x2689c5(++_0x3a2475);}(_0x4438,0x1c4));var _0x8443=function(_0x45d85f,_0xdd9183){_0x45d85f=_0x45d85f-0x0;var _0x4619d5=_0x4438[_0x45d85f];return _0x4619d5;};'use strict';var multer=require(_0x8443('0x0'));var util=require(_0x8443('0x1'));var path=require(_0x8443('0x2'));var timeout=require(_0x8443('0x3'));var express=require('express');var router=express[_0x8443('0x4')]();var fs_extra=require(_0x8443('0x5'));var auth=require(_0x8443('0x6'));var interaction=require(_0x8443('0x7'));var config=require(_0x8443('0x8'));var controller=require(_0x8443('0x9'));router[_0x8443('0xa')]('/',auth[_0x8443('0xb')](),controller[_0x8443('0xc')]);router[_0x8443('0xa')]('/describe',auth[_0x8443('0xb')](),controller[_0x8443('0xd')]);router[_0x8443('0xa')](_0x8443('0xe'),auth['isAuthenticated'](),controller[_0x8443('0xf')]);router[_0x8443('0x10')]('/',auth['isAuthenticated'](),controller[_0x8443('0x11')]);router[_0x8443('0x12')](_0x8443('0xe'),auth['isAuthenticated'](),controller[_0x8443('0x13')]);router['delete'](_0x8443('0xe'),auth[_0x8443('0xb')](),controller[_0x8443('0x14')]);module[_0x8443('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index f3bc246..d370288 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1a96db,_0x3e9f20){_0x1a96db=_0x1a96db-0x0;var _0x5a4091=_0xb43b[_0x1a96db];return _0x5a4091;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3b0eb4,_0x34d616){var _0x1bef6a=function(_0x2042cb){while(--_0x2042cb){_0x3b0eb4['push'](_0x3b0eb4['shift']());}};_0x1bef6a(++_0x34d616);}(_0x70e0,0x17b));var _0x070e=function(_0x163133,_0x2a6853){_0x163133=_0x163133-0x0;var _0x15352d=_0x70e0[_0x163133];return _0x15352d;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 588a931..b658ecc 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 _0xd112=['Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count'];(function(_0x5d2999,_0x3a6edd){var _0x59aec0=function(_0x159fab){while(--_0x159fab){_0x5d2999['push'](_0x5d2999['shift']());}};_0x59aec0(++_0x3a6edd);}(_0xd112,0x10a));var _0x2d11=function(_0x568e7c,_0x5ea152){_0x568e7c=_0x568e7c-0x0;var _0x4682a7=_0xd112[_0x568e7c];return _0x4682a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d11('0x0'));var zipdir=require(_0x2d11('0x1'));var jsonpatch=require(_0x2d11('0x2'));var rp=require(_0x2d11('0x3'));var moment=require(_0x2d11('0x4'));var BPromise=require(_0x2d11('0x5'));var Mustache=require(_0x2d11('0x6'));var util=require(_0x2d11('0x7'));var path=require('path');var sox=require(_0x2d11('0x8'));var csv=require('to-csv');var ejs=require(_0x2d11('0x9'));var fs=require('fs');var fs_extra=require(_0x2d11('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2d11('0xb'));var jsforce=require(_0x2d11('0xc'));var deskjs=require(_0x2d11('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d11('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2d11('0xf'));var hardwareService=require(_0x2d11('0x10'));var logger=require(_0x2d11('0x11'))(_0x2d11('0x12'));var utils=require(_0x2d11('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2d11('0x14'));var db=require(_0x2d11('0x15'))['db'];function respondWithStatusCode(_0x3b7209,_0x4051fe){_0x4051fe=_0x4051fe||0xcc;return function(_0x389aff){if(_0x389aff){return _0x3b7209[_0x2d11('0x16')](_0x4051fe);}return _0x3b7209[_0x2d11('0x17')](_0x4051fe)[_0x2d11('0x18')]();};}function respondWithResult(_0x247c79,_0x4dfa4e){_0x4dfa4e=_0x4dfa4e||0xc8;return function(_0x400e2e){if(_0x400e2e){return _0x247c79[_0x2d11('0x17')](_0x4dfa4e)[_0x2d11('0x19')](_0x400e2e);}};}function respondWithFilteredResult(_0x427bbc,_0x33906b){return function(_0x4a1c71){if(_0x4a1c71){var _0x39648d=typeof _0x33906b['offset']==='undefined'&&typeof _0x33906b[_0x2d11('0x1a')]===_0x2d11('0x1b');var _0x33f7d9=_0x4a1c71['count'];var _0x2a7a49=_0x39648d?0x0:_0x33906b[_0x2d11('0x1c')];var _0x28233f=_0x39648d?_0x4a1c71[_0x2d11('0x1d')]:_0x33906b[_0x2d11('0x1c')]+_0x33906b['limit'];var _0xbdf6a4;if(_0x28233f>=_0x33f7d9){_0x28233f=_0x33f7d9;_0xbdf6a4=0xc8;}else{_0xbdf6a4=0xce;}_0x427bbc[_0x2d11('0x17')](_0xbdf6a4);return _0x427bbc['set'](_0x2d11('0x1e'),_0x2a7a49+'-'+_0x28233f+'/'+_0x33f7d9)['json'](_0x4a1c71);}return null;};}function patchUpdates(_0x2dd685){return function(_0x4498ba){try{jsonpatch[_0x2d11('0x1f')](_0x4498ba,_0x2dd685,!![]);}catch(_0x15c3d4){return BPromise[_0x2d11('0x20')](_0x15c3d4);}return _0x4498ba[_0x2d11('0x21')]();};}function saveUpdates(_0x32b4c9,_0x34d0fb){return function(_0x43a366){if(_0x43a366){return _0x43a366[_0x2d11('0x22')](_0x32b4c9)[_0x2d11('0x23')](function(_0x49f64c){return _0x49f64c;});}return null;};}function removeEntity(_0x3959f0,_0x442959){return function(_0x4a7103){if(_0x4a7103){return _0x4a7103[_0x2d11('0x24')]()[_0x2d11('0x23')](function(){_0x3959f0[_0x2d11('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c1c0b,_0xbb6f9c){return function(_0x1e5e5f){if(!_0x1e5e5f){_0x2c1c0b[_0x2d11('0x16')](0x194);}return _0x1e5e5f;};}function handleError(_0x3b6448,_0x11d4a4){_0x11d4a4=_0x11d4a4||0x1f4;return function(_0x2990ad){logger[_0x2d11('0x25')](_0x2990ad['stack']);if(_0x2990ad[_0x2d11('0x26')]){delete _0x2990ad[_0x2d11('0x26')];}_0x3b6448[_0x2d11('0x17')](_0x11d4a4)[_0x2d11('0x27')](_0x2990ad);};}exports[_0x2d11('0x28')]=function(_0x5bb753,_0x4da22e){var _0x5c327c={},_0x2e2169={},_0x294343={'count':0x0,'rows':[]};var _0x282045=_[_0x2d11('0x29')](db[_0x2d11('0x2a')][_0x2d11('0x2b')],function(_0x1391a1){return{'name':_0x1391a1[_0x2d11('0x2c')],'type':_0x1391a1[_0x2d11('0x2d')][_0x2d11('0x2e')]};});_0x2e2169[_0x2d11('0x2f')]=_[_0x2d11('0x29')](_0x282045,'name');_0x2e2169['query']=_['keys'](_0x5bb753[_0x2d11('0x30')]);_0x2e2169[_0x2d11('0x31')]=_[_0x2d11('0x32')](_0x2e2169[_0x2d11('0x2f')],_0x2e2169[_0x2d11('0x30')]);_0x5c327c[_0x2d11('0x33')]=_[_0x2d11('0x32')](_0x2e2169[_0x2d11('0x2f')],qs[_0x2d11('0x34')](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x34')]));_0x5c327c[_0x2d11('0x33')]=_0x5c327c[_0x2d11('0x33')][_0x2d11('0x35')]?_0x5c327c['attributes']:_0x2e2169[_0x2d11('0x2f')];if(!_0x5bb753[_0x2d11('0x30')]['hasOwnProperty'](_0x2d11('0x36'))){_0x5c327c['limit']=qs['limit'](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x1a')]);_0x5c327c[_0x2d11('0x1c')]=qs['offset'](_0x5bb753[_0x2d11('0x30')]['offset']);}_0x5c327c[_0x2d11('0x37')]=qs[_0x2d11('0x38')](_0x5bb753[_0x2d11('0x30')][_0x2d11('0x38')]);_0x5c327c[_0x2d11('0x39')]=qs[_0x2d11('0x31')](_[_0x2d11('0x3a')](_0x5bb753[_0x2d11('0x30')],_0x2e2169['filters']),_0x282045);if(_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3b')]){_0x5c327c[_0x2d11('0x39')]=_[_0x2d11('0x3c')](_0x5c327c[_0x2d11('0x39')],{'$or':_['map'](_0x282045,function(_0x33c4f2){if(_0x33c4f2['type']!==_0x2d11('0x3d')){var _0x4629bc={};_0x4629bc[_0x33c4f2[_0x2d11('0x26')]]={'$like':'%'+_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3b')]+'%'};return _0x4629bc;}})});}_0x5c327c=_[_0x2d11('0x3c')]({},_0x5c327c,_0x5bb753[_0x2d11('0x3e')]);var _0x267bac={'where':_0x5c327c['where']};return db[_0x2d11('0x2a')][_0x2d11('0x1d')](_0x267bac)[_0x2d11('0x23')](function(_0xcfd2c8){_0x294343[_0x2d11('0x1d')]=_0xcfd2c8;if(_0x5bb753[_0x2d11('0x30')][_0x2d11('0x3f')]){_0x5c327c[_0x2d11('0x40')]=[{'all':!![]}];}return db[_0x2d11('0x2a')][_0x2d11('0x41')](_0x5c327c);})['then'](function(_0x702954){_0x294343[_0x2d11('0x42')]=_0x702954;return _0x294343;})[_0x2d11('0x23')](respondWithFilteredResult(_0x4da22e,_0x5c327c))[_0x2d11('0x43')](handleError(_0x4da22e,null));};exports['show']=function(_0x184a4e,_0x195c53){var _0x34e9bc={'raw':!![],'where':{'id':_0x184a4e[_0x2d11('0x44')]['id']}},_0x18198b={};_0x18198b[_0x2d11('0x2f')]=_[_0x2d11('0x45')](db[_0x2d11('0x2a')][_0x2d11('0x2b')]);_0x18198b[_0x2d11('0x30')]=_['keys'](_0x184a4e[_0x2d11('0x30')]);_0x18198b[_0x2d11('0x31')]=_['intersection'](_0x18198b[_0x2d11('0x2f')],_0x18198b[_0x2d11('0x30')]);_0x34e9bc[_0x2d11('0x33')]=_[_0x2d11('0x32')](_0x18198b[_0x2d11('0x2f')],qs[_0x2d11('0x34')](_0x184a4e[_0x2d11('0x30')][_0x2d11('0x34')]));_0x34e9bc[_0x2d11('0x33')]=_0x34e9bc[_0x2d11('0x33')]['length']?_0x34e9bc[_0x2d11('0x33')]:_0x18198b[_0x2d11('0x2f')];if(_0x184a4e[_0x2d11('0x30')]['includeAll']){_0x34e9bc[_0x2d11('0x40')]=[{'all':!![]}];}_0x34e9bc=_[_0x2d11('0x3c')]({},_0x34e9bc,_0x184a4e[_0x2d11('0x3e')]);return db[_0x2d11('0x2a')]['find'](_0x34e9bc)[_0x2d11('0x23')](handleEntityNotFound(_0x195c53,null))[_0x2d11('0x23')](respondWithResult(_0x195c53,null))[_0x2d11('0x43')](handleError(_0x195c53,null));};exports['create']=function(_0x4874de,_0x15aef8){return db['ChatTransferReport'][_0x2d11('0x46')](_0x4874de[_0x2d11('0x47')],{})[_0x2d11('0x23')](respondWithResult(_0x15aef8,0xc9))[_0x2d11('0x43')](handleError(_0x15aef8,null));};exports[_0x2d11('0x22')]=function(_0x299f8f,_0x457fab){if(_0x299f8f[_0x2d11('0x47')]['id']){delete _0x299f8f[_0x2d11('0x47')]['id'];}return db[_0x2d11('0x2a')]['find']({'where':{'id':_0x299f8f[_0x2d11('0x44')]['id']}})['then'](handleEntityNotFound(_0x457fab,null))['then'](saveUpdates(_0x299f8f[_0x2d11('0x47')],null))['then'](respondWithResult(_0x457fab,null))[_0x2d11('0x43')](handleError(_0x457fab,null));};exports[_0x2d11('0x24')]=function(_0x3bedb1,_0x2b515b){return db[_0x2d11('0x2a')][_0x2d11('0x48')]({'where':{'id':_0x3bedb1[_0x2d11('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b515b,null))[_0x2d11('0x23')](removeEntity(_0x2b515b,null))[_0x2d11('0x43')](handleError(_0x2b515b,null));};exports[_0x2d11('0x49')]=function(_0x21ec11,_0x38a2d5){return db[_0x2d11('0x2a')][_0x2d11('0x49')]()[_0x2d11('0x23')](respondWithResult(_0x38a2d5,null))[_0x2d11('0x43')](handleError(_0x38a2d5,null));}; \ No newline at end of file +var _0xa797=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir'];(function(_0x364f8e,_0x5def7b){var _0xe226d8=function(_0x2e9889){while(--_0x2e9889){_0x364f8e['push'](_0x364f8e['shift']());}};_0xe226d8(++_0x5def7b);}(_0xa797,0x90));var _0x7a79=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xa797[_0x1406ae];return _0x23a076;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a79('0x0'));var zipdir=require(_0x7a79('0x1'));var jsonpatch=require(_0x7a79('0x2'));var rp=require(_0x7a79('0x3'));var moment=require(_0x7a79('0x4'));var BPromise=require(_0x7a79('0x5'));var Mustache=require(_0x7a79('0x6'));var util=require(_0x7a79('0x7'));var path=require(_0x7a79('0x8'));var sox=require(_0x7a79('0x9'));var csv=require(_0x7a79('0xa'));var ejs=require(_0x7a79('0xb'));var fs=require('fs');var fs_extra=require(_0x7a79('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a79('0xd'));var deskjs=require(_0x7a79('0xe'));var toCsv=require(_0x7a79('0xa'));var querystring=require('querystring');var Papa=require(_0x7a79('0xf'));var Redis=require(_0x7a79('0x10'));var authService=require(_0x7a79('0x11'));var qs=require(_0x7a79('0x12'));var as=require(_0x7a79('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7a79('0x14'));var utils=require(_0x7a79('0x15'));var config=require(_0x7a79('0x16'));var licenseUtil=require(_0x7a79('0x17'));var db=require(_0x7a79('0x18'))['db'];function respondWithStatusCode(_0x2e0ed0,_0x4887a3){_0x4887a3=_0x4887a3||0xcc;return function(_0x37f795){if(_0x37f795){return _0x2e0ed0[_0x7a79('0x19')](_0x4887a3);}return _0x2e0ed0[_0x7a79('0x1a')](_0x4887a3)[_0x7a79('0x1b')]();};}function respondWithResult(_0x4c1960,_0x33292d){_0x33292d=_0x33292d||0xc8;return function(_0x5bce9c){if(_0x5bce9c){return _0x4c1960[_0x7a79('0x1a')](_0x33292d)['json'](_0x5bce9c);}};}function respondWithFilteredResult(_0x3498cc,_0x3539df){return function(_0x44fa17){if(_0x44fa17){var _0x38ab21=typeof _0x3539df[_0x7a79('0x1c')]===_0x7a79('0x1d')&&typeof _0x3539df[_0x7a79('0x1e')]===_0x7a79('0x1d');var _0x4c81f7=_0x44fa17['count'];var _0x506a2d=_0x38ab21?0x0:_0x3539df[_0x7a79('0x1c')];var _0xa13c26=_0x38ab21?_0x44fa17[_0x7a79('0x1f')]:_0x3539df[_0x7a79('0x1c')]+_0x3539df[_0x7a79('0x1e')];var _0x53bcbf;if(_0xa13c26>=_0x4c81f7){_0xa13c26=_0x4c81f7;_0x53bcbf=0xc8;}else{_0x53bcbf=0xce;}_0x3498cc[_0x7a79('0x1a')](_0x53bcbf);return _0x3498cc['set']('Content-Range',_0x506a2d+'-'+_0xa13c26+'/'+_0x4c81f7)[_0x7a79('0x20')](_0x44fa17);}return null;};}function patchUpdates(_0x4c77d8){return function(_0x1aebe7){try{jsonpatch[_0x7a79('0x21')](_0x1aebe7,_0x4c77d8,!![]);}catch(_0x1a0f40){return BPromise['reject'](_0x1a0f40);}return _0x1aebe7[_0x7a79('0x22')]();};}function saveUpdates(_0x222845,_0x6e6917){return function(_0x129660){if(_0x129660){return _0x129660[_0x7a79('0x23')](_0x222845)[_0x7a79('0x24')](function(_0x3617f1){return _0x3617f1;});}return null;};}function removeEntity(_0x50c6c6,_0x424ef3){return function(_0x43b447){if(_0x43b447){return _0x43b447[_0x7a79('0x25')]()['then'](function(){_0x50c6c6[_0x7a79('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x655492,_0x2fb100){return function(_0xd17c08){if(!_0xd17c08){_0x655492[_0x7a79('0x19')](0x194);}return _0xd17c08;};}function handleError(_0x12b58e,_0x51d137){_0x51d137=_0x51d137||0x1f4;return function(_0x3b8c7e){logger[_0x7a79('0x26')](_0x3b8c7e['stack']);if(_0x3b8c7e[_0x7a79('0x27')]){delete _0x3b8c7e[_0x7a79('0x27')];}_0x12b58e[_0x7a79('0x1a')](_0x51d137)['send'](_0x3b8c7e);};}exports[_0x7a79('0x28')]=function(_0x23a14b,_0x5ecf2d){var _0x5dff39={},_0x5b9a6e={},_0x22e896={'count':0x0,'rows':[]};var _0xa317fa=_[_0x7a79('0x29')](db[_0x7a79('0x2a')][_0x7a79('0x2b')],function(_0x3676c6){return{'name':_0x3676c6[_0x7a79('0x2c')],'type':_0x3676c6['type'][_0x7a79('0x2d')]};});_0x5b9a6e[_0x7a79('0x2e')]=_[_0x7a79('0x29')](_0xa317fa,_0x7a79('0x27'));_0x5b9a6e['query']=_[_0x7a79('0x2f')](_0x23a14b[_0x7a79('0x30')]);_0x5b9a6e[_0x7a79('0x31')]=_[_0x7a79('0x32')](_0x5b9a6e[_0x7a79('0x2e')],_0x5b9a6e[_0x7a79('0x30')]);_0x5dff39['attributes']=_[_0x7a79('0x32')](_0x5b9a6e[_0x7a79('0x2e')],qs['fields'](_0x23a14b['query'][_0x7a79('0x33')]));_0x5dff39[_0x7a79('0x34')]=_0x5dff39[_0x7a79('0x34')][_0x7a79('0x35')]?_0x5dff39['attributes']:_0x5b9a6e['model'];if(!_0x23a14b[_0x7a79('0x30')][_0x7a79('0x36')](_0x7a79('0x37'))){_0x5dff39[_0x7a79('0x1e')]=qs[_0x7a79('0x1e')](_0x23a14b[_0x7a79('0x30')]['limit']);_0x5dff39[_0x7a79('0x1c')]=qs[_0x7a79('0x1c')](_0x23a14b[_0x7a79('0x30')]['offset']);}_0x5dff39['order']=qs['sort'](_0x23a14b[_0x7a79('0x30')][_0x7a79('0x38')]);_0x5dff39[_0x7a79('0x39')]=qs[_0x7a79('0x31')](_[_0x7a79('0x3a')](_0x23a14b['query'],_0x5b9a6e[_0x7a79('0x31')]),_0xa317fa);if(_0x23a14b[_0x7a79('0x30')]['filter']){_0x5dff39['where']=_[_0x7a79('0x3b')](_0x5dff39['where'],{'$or':_['map'](_0xa317fa,function(_0xdd1826){if(_0xdd1826[_0x7a79('0x3c')]!=='VIRTUAL'){var _0xac42c4={};_0xac42c4[_0xdd1826[_0x7a79('0x27')]]={'$like':'%'+_0x23a14b[_0x7a79('0x30')][_0x7a79('0x3d')]+'%'};return _0xac42c4;}})});}_0x5dff39=_['merge']({},_0x5dff39,_0x23a14b[_0x7a79('0x3e')]);var _0x19964e={'where':_0x5dff39[_0x7a79('0x39')]};return db[_0x7a79('0x2a')][_0x7a79('0x1f')](_0x19964e)[_0x7a79('0x24')](function(_0xee5b1a){_0x22e896['count']=_0xee5b1a;if(_0x23a14b[_0x7a79('0x30')][_0x7a79('0x3f')]){_0x5dff39[_0x7a79('0x40')]=[{'all':!![]}];}return db[_0x7a79('0x2a')][_0x7a79('0x41')](_0x5dff39);})[_0x7a79('0x24')](function(_0x4d3757){_0x22e896[_0x7a79('0x42')]=_0x4d3757;return _0x22e896;})[_0x7a79('0x24')](respondWithFilteredResult(_0x5ecf2d,_0x5dff39))[_0x7a79('0x43')](handleError(_0x5ecf2d,null));};exports['show']=function(_0x352d11,_0x5d0775){var _0x519977={'raw':!![],'where':{'id':_0x352d11[_0x7a79('0x44')]['id']}},_0x26cc31={};_0x26cc31[_0x7a79('0x2e')]=_[_0x7a79('0x2f')](db[_0x7a79('0x2a')][_0x7a79('0x2b')]);_0x26cc31[_0x7a79('0x30')]=_[_0x7a79('0x2f')](_0x352d11['query']);_0x26cc31[_0x7a79('0x31')]=_[_0x7a79('0x32')](_0x26cc31[_0x7a79('0x2e')],_0x26cc31[_0x7a79('0x30')]);_0x519977['attributes']=_[_0x7a79('0x32')](_0x26cc31[_0x7a79('0x2e')],qs['fields'](_0x352d11['query'][_0x7a79('0x33')]));_0x519977[_0x7a79('0x34')]=_0x519977[_0x7a79('0x34')][_0x7a79('0x35')]?_0x519977[_0x7a79('0x34')]:_0x26cc31[_0x7a79('0x2e')];if(_0x352d11['query']['includeAll']){_0x519977[_0x7a79('0x40')]=[{'all':!![]}];}_0x519977=_[_0x7a79('0x3b')]({},_0x519977,_0x352d11[_0x7a79('0x3e')]);return db[_0x7a79('0x2a')][_0x7a79('0x45')](_0x519977)['then'](handleEntityNotFound(_0x5d0775,null))[_0x7a79('0x24')](respondWithResult(_0x5d0775,null))[_0x7a79('0x43')](handleError(_0x5d0775,null));};exports[_0x7a79('0x46')]=function(_0x2a5eb4,_0x3a7265){return db[_0x7a79('0x2a')][_0x7a79('0x46')](_0x2a5eb4[_0x7a79('0x47')],{})[_0x7a79('0x24')](respondWithResult(_0x3a7265,0xc9))[_0x7a79('0x43')](handleError(_0x3a7265,null));};exports[_0x7a79('0x23')]=function(_0x5088ff,_0x54f289){if(_0x5088ff['body']['id']){delete _0x5088ff['body']['id'];}return db[_0x7a79('0x2a')]['find']({'where':{'id':_0x5088ff['params']['id']}})['then'](handleEntityNotFound(_0x54f289,null))[_0x7a79('0x24')](saveUpdates(_0x5088ff[_0x7a79('0x47')],null))['then'](respondWithResult(_0x54f289,null))[_0x7a79('0x43')](handleError(_0x54f289,null));};exports[_0x7a79('0x25')]=function(_0x5b36e8,_0x4fe009){return db[_0x7a79('0x2a')][_0x7a79('0x45')]({'where':{'id':_0x5b36e8['params']['id']}})[_0x7a79('0x24')](handleEntityNotFound(_0x4fe009,null))[_0x7a79('0x24')](removeEntity(_0x4fe009,null))[_0x7a79('0x43')](handleError(_0x4fe009,null));};exports[_0x7a79('0x48')]=function(_0x426aa5,_0xfbbd96){return db[_0x7a79('0x2a')][_0x7a79('0x48')]()['then'](respondWithResult(_0xfbbd96,null))[_0x7a79('0x43')](handleError(_0xfbbd96,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3936301..31d6712 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 _0xcb49=['exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatTransferReport.attributes'];(function(_0x836cfe,_0x3654f5){var _0x102c56=function(_0x8c5895){while(--_0x8c5895){_0x836cfe['push'](_0x836cfe['shift']());}};_0x102c56(++_0x3654f5);}(_0xcb49,0x109));var _0x9cb4=function(_0x3c9a89,_0x378778){_0x3c9a89=_0x3c9a89-0x0;var _0x1eb47b=_0xcb49[_0x3c9a89];return _0x1eb47b;};'use strict';var _=require('lodash');var util=require(_0x9cb4('0x0'));var logger=require(_0x9cb4('0x1'))(_0x9cb4('0x2'));var moment=require(_0x9cb4('0x3'));var BPromise=require(_0x9cb4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cb4('0x5'));var rimraf=require(_0x9cb4('0x6'));var config=require('../../config/environment');var attributes=require(_0x9cb4('0x7'));module[_0x9cb4('0x8')]=function(_0x3a48ad,_0x119b69){return _0x3a48ad[_0x9cb4('0x9')](_0x9cb4('0xa'),attributes,{'tableName':_0x9cb4('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9cb4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9576=['../../config/logger','api','moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x16fc52,_0x20de03){var _0x580914=function(_0x1d6d24){while(--_0x1d6d24){_0x16fc52['push'](_0x16fc52['shift']());}};_0x580914(++_0x20de03);}(_0x9576,0x1ab));var _0x6957=function(_0x15271c,_0x31ff9b){_0x15271c=_0x15271c-0x0;var _0x338f64=_0x9576[_0x15271c];return _0x338f64;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var logger=require(_0x6957('0x2'))(_0x6957('0x3'));var moment=require(_0x6957('0x4'));var BPromise=require(_0x6957('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6957('0x6'));var rimraf=require('rimraf');var config=require(_0x6957('0x7'));var attributes=require(_0x6957('0x8'));module['exports']=function(_0x40e58c,_0x17d277){return _0x40e58c[_0x6957('0x9')](_0x6957('0xa'),attributes,{'tableName':_0x6957('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6957('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 344a68f..21cf583 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 _0x0423=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils'];(function(_0x5c5fe7,_0x2a64eb){var _0xd817f=function(_0x54b2f2){while(--_0x54b2f2){_0x5c5fe7['push'](_0x5c5fe7['shift']());}};_0xd817f(++_0x2a64eb);}(_0x0423,0x18b));var _0x3042=function(_0x43028e,_0x33a648){_0x43028e=_0x43028e-0x0;var _0x2fed6d=_0x0423[_0x43028e];return _0x2fed6d;};'use strict';var _=require(_0x3042('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3042('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3042('0x2'))['db'];var utils=require(_0x3042('0x3'));var logger=require(_0x3042('0x4'))(_0x3042('0x5'));var config=require(_0x3042('0x6'));var jayson=require(_0x3042('0x7'));var client=jayson['client'][_0x3042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21a40d,_0x298fff,_0x55ce30){return new BPromise(function(_0x37daed,_0x373f35){return client[_0x3042('0x9')](_0x21a40d,_0x55ce30)[_0x3042('0xa')](function(_0x514e3a){logger['info'](_0x3042('0xb'),_0x298fff,_0x3042('0xc'));logger['debug'](_0x3042('0xd'),_0x298fff,'request\x20sent',JSON[_0x3042('0xe')](_0x514e3a));if(_0x514e3a[_0x3042('0xf')]){if(_0x514e3a[_0x3042('0xf')]['code']===0x1f4){logger[_0x3042('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);return _0x373f35(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x514e3a['error'][_0x3042('0x10')]);return _0x37daed(_0x514e3a[_0x3042('0xf')][_0x3042('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x298fff,_0x3042('0xc'));_0x37daed(_0x514e3a[_0x3042('0x11')][_0x3042('0x10')]);}})[_0x3042('0x12')](function(_0x41884d){logger[_0x3042('0xf')](_0x3042('0xb'),_0x298fff,_0x41884d);_0x373f35(_0x41884d);});});} \ No newline at end of file +var _0x0f62=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x486b7c,_0x9e78bd){var _0x22c5d7=function(_0x59530c){while(--_0x59530c){_0x486b7c['push'](_0x486b7c['shift']());}};_0x22c5d7(++_0x9e78bd);}(_0x0f62,0x190));var _0x20f6=function(_0x452cbe,_0x17501d){_0x452cbe=_0x452cbe-0x0;var _0x7f5fd=_0x0f62[_0x452cbe];return _0x7f5fd;};'use strict';var _=require(_0x20f6('0x0'));var util=require(_0x20f6('0x1'));var moment=require(_0x20f6('0x2'));var BPromise=require(_0x20f6('0x3'));var rs=require(_0x20f6('0x4'));var fs=require('fs');var Redis=require(_0x20f6('0x5'));var db=require(_0x20f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x20f6('0x7'))('rpc');var config=require(_0x20f6('0x8'));var jayson=require(_0x20f6('0x9'));var client=jayson[_0x20f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319d4d,_0x11762b,_0x4fe6af){return new BPromise(function(_0xc2757f,_0xe60ed6){return client[_0x20f6('0xb')](_0x319d4d,_0x4fe6af)[_0x20f6('0xc')](function(_0x3d17d1){logger[_0x20f6('0xd')](_0x20f6('0xe'),_0x11762b,_0x20f6('0xf'));logger['debug'](_0x20f6('0x10'),_0x11762b,_0x20f6('0xf'),JSON[_0x20f6('0x11')](_0x3d17d1));if(_0x3d17d1[_0x20f6('0x12')]){if(_0x3d17d1[_0x20f6('0x12')][_0x20f6('0x13')]===0x1f4){logger[_0x20f6('0x12')](_0x20f6('0xe'),_0x11762b,_0x3d17d1['error'][_0x20f6('0x14')]);return _0xe60ed6(_0x3d17d1[_0x20f6('0x12')]['message']);}logger[_0x20f6('0x12')](_0x20f6('0xe'),_0x11762b,_0x3d17d1['error'][_0x20f6('0x14')]);return _0xc2757f(_0x3d17d1[_0x20f6('0x12')]['message']);}else{logger['info'](_0x20f6('0xe'),_0x11762b,'request\x20sent');_0xc2757f(_0x3d17d1[_0x20f6('0x15')][_0x20f6('0x14')]);}})['catch'](function(_0x4f082f){logger[_0x20f6('0x12')](_0x20f6('0xe'),_0x11762b,_0x4f082f);_0xe60ed6(_0x4f082f);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 06bb73c..e98846d 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 _0x88ce=['create','/:id','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','/describe','isAuthenticated','describe','get','show','post'];(function(_0x3abbbc,_0x2ad6e6){var _0x4d33de=function(_0x3fd049){while(--_0x3fd049){_0x3abbbc['push'](_0x3abbbc['shift']());}};_0x4d33de(++_0x2ad6e6);}(_0x88ce,0x159));var _0xe88c=function(_0x479127,_0x43686d){_0x479127=_0x479127-0x0;var _0x16eb43=_0x88ce[_0x479127];return _0x16eb43;};'use strict';var multer=require(_0xe88c('0x0'));var util=require(_0xe88c('0x1'));var path=require('path');var timeout=require(_0xe88c('0x2'));var express=require('express');var router=express[_0xe88c('0x3')]();var fs_extra=require(_0xe88c('0x4'));var auth=require(_0xe88c('0x5'));var interaction=require(_0xe88c('0x6'));var config=require('../../config/environment');var controller=require(_0xe88c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe88c('0x8')]);router['get'](_0xe88c('0x9'),auth[_0xe88c('0xa')](),controller[_0xe88c('0xb')]);router[_0xe88c('0xc')]('/:id',auth[_0xe88c('0xa')](),controller[_0xe88c('0xd')]);router[_0xe88c('0xe')]('/',auth[_0xe88c('0xa')](),controller[_0xe88c('0xf')]);router['put'](_0xe88c('0x10'),auth[_0xe88c('0xa')](),controller[_0xe88c('0x11')]);router[_0xe88c('0x12')]('/:id',auth[_0xe88c('0xa')](),controller['destroy']);module[_0xe88c('0x13')]=router; \ No newline at end of file +var _0xff1d=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xff1d,0x11b));var _0xdff1=function(_0x1ba8ff,_0x19a44b){_0x1ba8ff=_0x1ba8ff-0x0;var _0x8ba836=_0xff1d[_0x1ba8ff];return _0x8ba836;};'use strict';var multer=require(_0xdff1('0x0'));var util=require(_0xdff1('0x1'));var path=require(_0xdff1('0x2'));var timeout=require(_0xdff1('0x3'));var express=require(_0xdff1('0x4'));var router=express[_0xdff1('0x5')]();var fs_extra=require(_0xdff1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdff1('0x7'));var config=require('../../config/environment');var controller=require(_0xdff1('0x8'));router[_0xdff1('0x9')]('/',auth[_0xdff1('0xa')](),controller[_0xdff1('0xb')]);router['get'](_0xdff1('0xc'),auth[_0xdff1('0xa')](),controller[_0xdff1('0xd')]);router[_0xdff1('0x9')]('/:id',auth[_0xdff1('0xa')](),controller[_0xdff1('0xe')]);router[_0xdff1('0xf')]('/',auth[_0xdff1('0xa')](),controller['create']);router[_0xdff1('0x10')]('/:id',auth[_0xdff1('0xa')](),controller['update']);router['delete'](_0xdff1('0x11'),auth['isAuthenticated'](),controller[_0xdff1('0x12')]);module[_0xdff1('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 b0fd0c1..00c8d27 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 _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','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','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x2a8f2d,_0xd027fa){var _0x1084c4=function(_0xe3cac2){while(--_0xe3cac2){_0x2a8f2d['push'](_0x2a8f2d['shift']());}};_0x1084c4(++_0xd027fa);}(_0xee5b,0x1f4));var _0xbee5=function(_0x4587bb,_0xcea66a){_0x4587bb=_0x4587bb-0x0;var _0x46b1a2=_0xee5b[_0x4587bb];return _0x46b1a2;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file +var _0xaa88=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Skip','Feedback','star','thumb','input','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','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.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','INTEGER','CHAT','#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'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xaa88,0x137));var _0x8aa8=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xaa88[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aa8('0x4')},'description':{'type':Sequelize[_0x8aa8('0x3')]},'mapKey':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8aa8('0x3')]},'animation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0xb'),'squared'),'defaultValue':_0x8aa8('0xb')},'header_online':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xc')},'offline_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xd')},'download_transcript':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8aa8('0xe')]},'closingQuestion':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x11')},'noteTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x13')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x14')},'conditionAgreement':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x15')},'ratingType':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0x16'),_0x8aa8('0x17')),'defaultValue':_0x8aa8('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x8aa8('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8aa8('0x18'),'props':{'title':_0x8aa8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8aa8('0x1a')](_0x8aa8('0x1b'))?JSON[_0x8aa8('0x1c')](this['getDataValue']('onlineForm')):{};},'set':function(_0x2d1508){return this[_0x8aa8('0x1d')](_0x8aa8('0x1b'),JSON[_0x8aa8('0x1e')](_0x2d1508));}},'offlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':_0x8aa8('0x5')},'variable':null},{'type':_0x8aa8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8aa8('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8aa8('0x21'))?JSON[_0x8aa8('0x1c')](this[_0x8aa8('0x1a')](_0x8aa8('0x21'))):{};},'set':function(_0xe07a83){return this['setDataValue'](_0x8aa8('0x21'),JSON[_0x8aa8('0x1e')](_0xe07a83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x22')]();}},'autoclose':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8aa8('0x3')]},'forwardOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8aa8('0x3')]},'waitingTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x23')},'waitingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return _0x8aa8('0x28');}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2c')},'messagesAlignment':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8aa8('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0x2b')],'comment':_0x8aa8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aa8('0x30'),'set':function(_0x3c6115){if(!_0x3c6115)this[_0x8aa8('0x1d')](_0x8aa8('0x31'),null);this[_0x8aa8('0x1d')](_0x8aa8('0x32'),_0x3c6115);}},'vidaooEscalation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8aa8('0x3')]},'vidaooTopic':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x33')},'vidaooNote':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':function(){return _0x8aa8('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8aa8('0xe')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index e33c076..d6f91e5 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 _0x7a82=['priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','forcedOwnership','startRouting','Start','EventManager','offline','files','CompanyId','from\x20is\x20mandatory','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','attachments','addInteraction','ids','getInteractions','Contact','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','License','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','omit','userChatWebsite:save','isArray','emit','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','http','client','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','include','rows','removeDispositions','CannedAnswer','getAnswers','order','removeAnswers','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','Contacts','DESC','ChatApplication','Applications','List','account','applications','list'];(function(_0x31bf14,_0x2c3fd3){var _0x9e9c5c=function(_0x2c8ccb){while(--_0x2c8ccb){_0x31bf14['push'](_0x31bf14['shift']());}};_0x9e9c5c(++_0x2c3fd3);}(_0x7a82,0x1aa));var _0x27a8=function(_0x13a11e,_0x472c7b){_0x13a11e=_0x13a11e-0x0;var _0x34e24=_0x7a82[_0x13a11e];return _0x34e24;};'use strict';var BPromise=require(_0x27a8('0x0'));var Mustache=require(_0x27a8('0x1'));var util=require(_0x27a8('0x2'));var path=require(_0x27a8('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x27a8('0x4'));var Redis=require(_0x27a8('0x5'));var qs=require(_0x27a8('0x6'));var logger=require(_0x27a8('0x7'))(_0x27a8('0x8'));var config=require(_0x27a8('0x9'));var db=require(_0x27a8('0xa'))['db'];config['redis']=_[_0x27a8('0xb')](config[_0x27a8('0xc')],{'host':_0x27a8('0xd'),'port':0x18eb});var socket=require(_0x27a8('0xe'))(new Redis(config[_0x27a8('0xc')]));require(_0x27a8('0xf'))[_0x27a8('0x10')](socket);var htmlToText=require(_0x27a8('0x11'));var jayson=require(_0x27a8('0x12'));var client=jayson['client'][_0x27a8('0x13')]({'port':0x232c});var client9002=jayson[_0x27a8('0x14')][_0x27a8('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x27a8('0x13')]({'port':0x232b});var client9001=jayson[_0x27a8('0x14')][_0x27a8('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x332399,_0x16005b,_0x360bd7,_0x36c180){return new BPromise(function(_0xf04bae,_0x509522){var _0x18439a=_0x36c180||client;return _0x18439a['request'](_0x332399,_0x360bd7)[_0x27a8('0x15')](function(_0x448357){logger[_0x27a8('0x16')](_0x27a8('0x17'),_0x16005b,'request\x20sent');logger[_0x27a8('0x18')](_0x27a8('0x19'),_0x16005b,_0x27a8('0x1a'),JSON[_0x27a8('0x1b')](_0x448357));if(_0x448357[_0x27a8('0x1c')]){if(_0x448357[_0x27a8('0x1c')]['code']===0x1f4){logger['error'](_0x27a8('0x17'),_0x16005b,_0x448357[_0x27a8('0x1c')][_0x27a8('0x1d')]);return _0x509522(_0x448357[_0x27a8('0x1c')]['message']);}logger[_0x27a8('0x1c')](_0x27a8('0x17'),_0x16005b,_0x448357[_0x27a8('0x1c')][_0x27a8('0x1d')]);return _0xf04bae(_0x448357[_0x27a8('0x1c')]['message']);}else{logger[_0x27a8('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x16005b,_0x27a8('0x1a'));_0xf04bae(_0x448357['result'][_0x27a8('0x1d')]);}})[_0x27a8('0x1e')](function(_0x233f85){logger[_0x27a8('0x1c')](_0x27a8('0x17'),_0x16005b,_0x233f85);_0x509522(_0x233f85);});});}function respondWithStatusCode(_0x5b0bf4,_0x32fee7){_0x32fee7=_0x32fee7||0xcc;return function(_0x5760d2){if(_0x5760d2){return _0x5b0bf4[_0x27a8('0x1f')](_0x32fee7);}return _0x5b0bf4[_0x27a8('0x20')](_0x32fee7)[_0x27a8('0x21')]();};}function respondWithResult(_0x1e4e98,_0x8ea839){_0x8ea839=_0x8ea839||0xc8;return function(_0x15fbf1){if(_0x15fbf1){return _0x1e4e98[_0x27a8('0x20')](_0x8ea839)[_0x27a8('0x22')](_0x15fbf1);}};}function respondWithFilteredResult(_0x89a919,_0x36074f){return function(_0x29f49b){if(_0x29f49b){var _0x3f4bf7=typeof _0x36074f[_0x27a8('0x23')]===_0x27a8('0x24')&&typeof _0x36074f[_0x27a8('0x25')]===_0x27a8('0x24');var _0x407eaf=_0x29f49b[_0x27a8('0x26')];var _0x465c7e=_0x3f4bf7?0x0:_0x36074f[_0x27a8('0x23')];var _0x37ae32=_0x3f4bf7?_0x29f49b[_0x27a8('0x26')]:_0x36074f['offset']+_0x36074f[_0x27a8('0x25')];var _0x25af59;if(_0x37ae32>=_0x407eaf){_0x37ae32=_0x407eaf;_0x25af59=0xc8;}else{_0x25af59=0xce;}_0x89a919[_0x27a8('0x20')](_0x25af59);return _0x89a919[_0x27a8('0x27')](_0x27a8('0x28'),_0x465c7e+'-'+_0x37ae32+'/'+_0x407eaf)[_0x27a8('0x22')](_0x29f49b);}return null;};}function saveUpdates(_0x5107a5){return function(_0x1911d4){if(_0x1911d4){return _0x1911d4['update'](_0x5107a5)[_0x27a8('0x15')](function(_0xb9962b){return _0xb9962b;});}return null;};}function removeEntity(_0x528863){return function(_0x55beaf){if(_0x55beaf){return _0x55beaf[_0x27a8('0x29')]()[_0x27a8('0x15')](function(){var _0x2573c5=_0x55beaf[_0x27a8('0x2a')]({'plain':!![]});var _0x4f2de4=_0x27a8('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x4f2de4,'resourceId':_0x2573c5['id']}})['then'](function(){return _0x55beaf;});})['then'](function(){_0x528863['status'](0xcc)[_0x27a8('0x21')]();});}};}function handleEntityNotFound(_0x3f1580){return function(_0x43d24f){if(!_0x43d24f){_0x3f1580[_0x27a8('0x1f')](0x194);}return _0x43d24f;};}function handleError(_0x38469b,_0x2f7032){_0x2f7032=_0x2f7032||0x1f4;return function(_0x5281e1){logger['error'](_0x5281e1[_0x27a8('0x2c')]);if(_0x5281e1[_0x27a8('0x2d')]){delete _0x5281e1[_0x27a8('0x2d')];}_0x38469b[_0x27a8('0x20')](_0x2f7032)[_0x27a8('0x2e')](_0x5281e1);};}exports[_0x27a8('0x2f')]=function(_0x4599cd,_0x406272){var _0x20c0a7={'include':[{'model':db['Pause'],'as':_0x27a8('0x30')}]},_0x3a3d95={},_0x2d9fc0={'count':0x0,'rows':[]};var _0x512600=_[_0x27a8('0x31')](db[_0x27a8('0x32')][_0x27a8('0x33')],function(_0x3e3a73){return{'name':_0x3e3a73[_0x27a8('0x34')],'type':_0x3e3a73[_0x27a8('0x35')][_0x27a8('0x36')]};});_0x3a3d95[_0x27a8('0x37')]=_[_0x27a8('0x31')](_0x512600,'name');_0x3a3d95[_0x27a8('0x38')]=_['keys'](_0x4599cd['query']);_0x3a3d95[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x3a3d95['model'],_0x3a3d95['query']);_0x20c0a7[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x3a3d95['model'],qs[_0x27a8('0x3c')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x20c0a7[_0x27a8('0x3b')]=_0x20c0a7[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x20c0a7[_0x27a8('0x3b')]:_0x3a3d95[_0x27a8('0x37')];if(!_0x4599cd['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x20c0a7[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x4599cd[_0x27a8('0x38')]['limit']);_0x20c0a7[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x20c0a7['order']=qs[_0x27a8('0x40')](_0x4599cd[_0x27a8('0x38')][_0x27a8('0x40')]);_0x20c0a7['where']=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x4599cd[_0x27a8('0x38')],_0x3a3d95[_0x27a8('0x39')]),_0x512600);if(_0x4599cd['query'][_0x27a8('0x42')]){_0x20c0a7[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x20c0a7[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x512600,function(_0x4a7eb7){if(_0x4a7eb7['type']!==_0x27a8('0x45')){var _0x328fd4={};_0x328fd4[_0x4a7eb7[_0x27a8('0x2d')]]={'$like':'%'+_0x4599cd['query'][_0x27a8('0x42')]+'%'};return _0x328fd4;}})});}_0x20c0a7=_[_0x27a8('0x44')]({},_0x20c0a7,_0x4599cd[_0x27a8('0x46')]);var _0x9082a4={'where':_0x20c0a7[_0x27a8('0x43')]};return db[_0x27a8('0x32')][_0x27a8('0x26')](_0x9082a4)['then'](function(_0x3704b4){_0x2d9fc0[_0x27a8('0x26')]=_0x3704b4;if(_0x4599cd[_0x27a8('0x38')][_0x27a8('0x47')]){_0x20c0a7['include']=[{'all':!![]}];}return db[_0x27a8('0x32')][_0x27a8('0x48')](_0x20c0a7);})['then'](function(_0x2e0088){_0x2d9fc0['rows']=_0x2e0088;return _0x2d9fc0;})[_0x27a8('0x15')](respondWithFilteredResult(_0x406272,_0x20c0a7))[_0x27a8('0x1e')](handleError(_0x406272,null));};exports[_0x27a8('0x49')]=function(_0x37d886,_0x1cfb24){var _0x15f9ea={'raw':![],'where':{'id':_0x37d886[_0x27a8('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0x27a8('0x30')}]},_0x3f54c3={};_0x3f54c3[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db[_0x27a8('0x32')]['rawAttributes']);_0x3f54c3[_0x27a8('0x38')]=_['keys'](_0x37d886['query']);_0x3f54c3[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x3f54c3[_0x27a8('0x37')],_0x3f54c3['query']);_0x15f9ea['attributes']=_[_0x27a8('0x3a')](_0x3f54c3[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x37d886[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x15f9ea[_0x27a8('0x3b')]=_0x15f9ea[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x15f9ea[_0x27a8('0x3b')]:_0x3f54c3[_0x27a8('0x37')];if(_0x37d886['query'][_0x27a8('0x47')]){_0x15f9ea['include']=[{'all':!![]}];}_0x15f9ea=_[_0x27a8('0x44')]({},_0x15f9ea,_0x37d886[_0x27a8('0x46')]);return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x15f9ea)[_0x27a8('0x15')](handleEntityNotFound(_0x1cfb24,null))[_0x27a8('0x15')](respondWithResult(_0x1cfb24,null))['catch'](handleError(_0x1cfb24,null));};exports[_0x27a8('0x4d')]=function(_0xbba4dc,_0x1f1df7){return db[_0x27a8('0x32')][_0x27a8('0x4d')](_0xbba4dc[_0x27a8('0x4e')],{})[_0x27a8('0x15')](function(_0x1ad217){var _0x273823=_0xbba4dc[_0x27a8('0x4f')]['get']({'plain':!![]});if(!_0x273823)throw new Error(_0x27a8('0x50'));if(_0x273823[_0x27a8('0x51')]===_0x27a8('0x4f')){var _0x45d039=_0x1ad217[_0x27a8('0x2a')]({'plain':!![]});var _0x594c63=_0x27a8('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x594c63,'userProfileId':_0x273823[_0x27a8('0x52')]},'raw':!![]})[_0x27a8('0x15')](function(_0x114725){if(_0x114725&&_0x114725[_0x27a8('0x53')]===0x0){return db[_0x27a8('0x54')]['create']({'name':_0x45d039['name'],'resourceId':_0x45d039['id'],'type':_0x114725[_0x27a8('0x2d')],'sectionId':_0x114725['id']},{})[_0x27a8('0x15')](function(){return _0x1ad217;});}else{return _0x1ad217;}})[_0x27a8('0x1e')](function(_0xfe4ea7){logger['error'](_0x27a8('0x55'),_0xfe4ea7);throw _0xfe4ea7;});}return _0x1ad217;})[_0x27a8('0x15')](respondWithResult(_0x1f1df7,0xc9))['catch'](handleError(_0x1f1df7,null));};exports[_0x27a8('0x56')]=function(_0x4223f9,_0x3b855f){if(_0x4223f9[_0x27a8('0x4e')]['id']){delete _0x4223f9[_0x27a8('0x4e')]['id'];}return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x4223f9['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x27a8('0x15')](handleEntityNotFound(_0x3b855f,null))[_0x27a8('0x15')](saveUpdates(_0x4223f9[_0x27a8('0x4e')],null))[_0x27a8('0x15')](respondWithResult(_0x3b855f,null))[_0x27a8('0x1e')](handleError(_0x3b855f,null));};exports['destroy']=function(_0x51411a,_0x271648){return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x51411a['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x271648,null))[_0x27a8('0x15')](removeEntity(_0x271648,null))[_0x27a8('0x1e')](handleError(_0x271648,null));};exports['describe']=function(_0x55cfda,_0x2574a7){return db['ChatWebsite']['describe']()[_0x27a8('0x15')](respondWithResult(_0x2574a7,null))['catch'](handleError(_0x2574a7,null));};exports[_0x27a8('0x57')]=function(_0x5212ca,_0x2aaa29){if(_0x5212ca[_0x27a8('0x4e')]['id']){delete _0x5212ca[_0x27a8('0x4e')]['id'];}return db[_0x27a8('0x32')]['find']({'where':{'id':_0x5212ca[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2aaa29,null))[_0x27a8('0x15')](function(_0x36b449){if(_0x36b449){_0x5212ca['body'][_0x27a8('0x58')]=_0x36b449['id'];return db[_0x27a8('0x59')][_0x27a8('0x4d')](_0x5212ca[_0x27a8('0x4e')]);}})[_0x27a8('0x15')](respondWithResult(_0x2aaa29,null))[_0x27a8('0x1e')](handleError(_0x2aaa29,null));};exports[_0x27a8('0x5a')]=function(_0x3fa588,_0x4a8dc4){var _0x5ab9bc={'raw':![],'where':{}};var _0x5492f5={};var _0x500a7e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x27a8('0x5b')]({'where':{'id':_0x3fa588[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x4a8dc4,null))[_0x27a8('0x15')](function(_0x36c339){if(_0x36c339){_0x5492f5['model']=_['keys'](db['Disposition'][_0x27a8('0x33')]);_0x5492f5[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x3fa588[_0x27a8('0x38')]);_0x5492f5['filters']=_[_0x27a8('0x3a')](_0x5492f5['model'],_0x5492f5[_0x27a8('0x38')]);_0x5ab9bc['attributes']=_[_0x27a8('0x3a')](_0x5492f5[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x3fa588[_0x27a8('0x38')]['fields']));_0x5ab9bc[_0x27a8('0x3b')]=_0x5ab9bc['attributes'][_0x27a8('0x3d')]?_0x5ab9bc[_0x27a8('0x3b')]:_0x5492f5[_0x27a8('0x37')];if(!_0x3fa588['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x5ab9bc[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x3fa588[_0x27a8('0x38')]['limit']);_0x5ab9bc[_0x27a8('0x23')]=qs['offset'](_0x3fa588[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x5ab9bc['order']=qs[_0x27a8('0x40')](_0x3fa588[_0x27a8('0x38')][_0x27a8('0x40')]);_0x5ab9bc[_0x27a8('0x43')]=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x3fa588[_0x27a8('0x38')],_0x5492f5['filters']));_0x5ab9bc['where'][_0x27a8('0x58')]=_0x36c339['id'];if(_0x3fa588['query'][_0x27a8('0x42')]){_0x5ab9bc[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x5ab9bc['where'],{'$or':_[_0x27a8('0x31')](_0x5ab9bc[_0x27a8('0x3b')],function(_0x328b23){var _0x838e53={};_0x838e53[_0x328b23]={'$like':'%'+_0x3fa588['query'][_0x27a8('0x42')]+'%'};return _0x838e53;})});}_0x5ab9bc=_[_0x27a8('0x44')]({},_0x5ab9bc,_0x3fa588[_0x27a8('0x46')]);return db[_0x27a8('0x59')][_0x27a8('0x26')]({'where':_0x5ab9bc['where']})[_0x27a8('0x15')](function(_0x1cb673){_0x500a7e[_0x27a8('0x26')]=_0x1cb673;if(_0x3fa588[_0x27a8('0x38')][_0x27a8('0x47')]){_0x5ab9bc[_0x27a8('0x5c')]=[{'all':!![]}];}return db[_0x27a8('0x59')]['findAll'](_0x5ab9bc);})['then'](function(_0x1e2940){_0x500a7e[_0x27a8('0x5d')]=_0x1e2940;return _0x500a7e;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0x4a8dc4,_0x5ab9bc))[_0x27a8('0x1e')](handleError(_0x4a8dc4,null));};exports[_0x27a8('0x5e')]=function(_0x32c81a,_0x3b5901){return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x32c81a['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x3b5901,null))[_0x27a8('0x15')](function(_0x9dbf72){if(_0x9dbf72){return _0x9dbf72[_0x27a8('0x5e')](_0x32c81a['query']['ids']);}})[_0x27a8('0x15')](respondWithStatusCode(_0x3b5901,null))[_0x27a8('0x1e')](handleError(_0x3b5901,null));};exports['addAnswer']=function(_0x15331b,_0x10921a){if(_0x15331b[_0x27a8('0x4e')]['id']){delete _0x15331b[_0x27a8('0x4e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x15331b[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10921a,null))[_0x27a8('0x15')](function(_0xcdf3b2){if(_0xcdf3b2){_0x15331b[_0x27a8('0x4e')][_0x27a8('0x58')]=_0xcdf3b2['id'];return db[_0x27a8('0x5f')][_0x27a8('0x4d')](_0x15331b[_0x27a8('0x4e')]);}})['then'](respondWithResult(_0x10921a,null))[_0x27a8('0x1e')](handleError(_0x10921a,null));};exports[_0x27a8('0x60')]=function(_0x3c3065,_0xff14db){var _0x39b3b9={'raw':![],'where':{}};var _0x18ecb5={};var _0x2a9ae1={'count':0x0,'rows':[]};return db[_0x27a8('0x32')]['findOne']({'where':{'id':_0x3c3065[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0xff14db,null))[_0x27a8('0x15')](function(_0xeb1d8){if(_0xeb1d8){_0x18ecb5['model']=_[_0x27a8('0x4b')](db[_0x27a8('0x5f')][_0x27a8('0x33')]);_0x18ecb5[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x3c3065[_0x27a8('0x38')]);_0x18ecb5[_0x27a8('0x39')]=_['intersection'](_0x18ecb5[_0x27a8('0x37')],_0x18ecb5['query']);_0x39b3b9[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x18ecb5[_0x27a8('0x37')],qs['fields'](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x39b3b9['attributes']=_0x39b3b9[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x39b3b9[_0x27a8('0x3b')]:_0x18ecb5[_0x27a8('0x37')];if(!_0x3c3065[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x39b3b9[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x25')]);_0x39b3b9[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x3c3065[_0x27a8('0x38')]['offset']);}_0x39b3b9[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x3c3065[_0x27a8('0x38')][_0x27a8('0x40')]);_0x39b3b9[_0x27a8('0x43')]=qs[_0x27a8('0x39')](_[_0x27a8('0x41')](_0x3c3065[_0x27a8('0x38')],_0x18ecb5[_0x27a8('0x39')]));_0x39b3b9['where']['ChatWebsiteId']=_0xeb1d8['id'];if(_0x3c3065[_0x27a8('0x38')]['filter']){_0x39b3b9['where']=_[_0x27a8('0x44')](_0x39b3b9[_0x27a8('0x43')],{'$or':_['map'](_0x39b3b9['attributes'],function(_0x25d8a2){var _0x53d7f7={};_0x53d7f7[_0x25d8a2]={'$like':'%'+_0x3c3065['query']['filter']+'%'};return _0x53d7f7;})});}_0x39b3b9=_[_0x27a8('0x44')]({},_0x39b3b9,_0x3c3065[_0x27a8('0x46')]);return db[_0x27a8('0x5f')][_0x27a8('0x26')]({'where':_0x39b3b9['where']})['then'](function(_0x4aef7d){_0x2a9ae1['count']=_0x4aef7d;if(_0x3c3065[_0x27a8('0x38')]['includeAll']){_0x39b3b9[_0x27a8('0x5c')]=[{'all':!![]}];}return db[_0x27a8('0x5f')][_0x27a8('0x48')](_0x39b3b9);})[_0x27a8('0x15')](function(_0x5833de){_0x2a9ae1[_0x27a8('0x5d')]=_0x5833de;return _0x2a9ae1;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0xff14db,_0x39b3b9))[_0x27a8('0x1e')](handleError(_0xff14db,null));};exports[_0x27a8('0x62')]=function(_0x193003,_0x2fb868){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x193003[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2fb868,null))['then'](function(_0x30dc7d){if(_0x30dc7d){return _0x30dc7d[_0x27a8('0x62')](_0x193003[_0x27a8('0x38')]['ids']);}})[_0x27a8('0x15')](respondWithStatusCode(_0x2fb868,null))['catch'](handleError(_0x2fb868,null));};exports['addLogo']=function(_0x52435d,_0x2321b7){_0x52435d['body'][_0x27a8('0x63')]=_0x52435d[_0x27a8('0x64')][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x52435d[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2321b7,null))[_0x27a8('0x15')](saveUpdates(_0x52435d[_0x27a8('0x4e')],null))['then'](respondWithResult(_0x2321b7,null))['catch'](handleError(_0x2321b7,null));};exports['addAvatar']=function(_0x3c8b5f,_0x2d2627){_0x3c8b5f[_0x27a8('0x4e')]['agentAvatar']=_0x3c8b5f[_0x27a8('0x64')]['filename'];return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x3c8b5f[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2d2627,null))[_0x27a8('0x15')](saveUpdates(_0x3c8b5f[_0x27a8('0x4e')],null))[_0x27a8('0x15')](respondWithResult(_0x2d2627,null))[_0x27a8('0x1e')](handleError(_0x2d2627,null));};exports[_0x27a8('0x66')]=function(_0x1f23b6,_0x1d9a88){_0x1f23b6[_0x27a8('0x4e')][_0x27a8('0x67')]=_0x1f23b6[_0x27a8('0x64')][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x1f23b6['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x1d9a88,null))[_0x27a8('0x15')](saveUpdates(_0x1f23b6['body'],null))['then'](respondWithResult(_0x1d9a88,null))['catch'](handleError(_0x1d9a88,null));};exports[_0x27a8('0x68')]=function(_0x1652b5,_0x7348be){_0x1652b5['body'][_0x27a8('0x69')]=_0x1652b5['file'][_0x27a8('0x65')];return db[_0x27a8('0x32')]['find']({'where':{'id':_0x1652b5[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x7348be,null))['then'](saveUpdates(_0x1652b5['body'],null))[_0x27a8('0x15')](respondWithResult(_0x7348be,null))[_0x27a8('0x1e')](handleError(_0x7348be,null));};exports[_0x27a8('0x6a')]=function(_0x281b11,_0x9cb4b0){var _0x5c0c6f=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],'server/files/images/logos/default_logo.svg');var _0xc9f49a={'where':{'id':_0x281b11[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x63')],'raw':!![]};var _0x20f334=![];return require(_0x27a8('0x6d'))[_0x27a8('0x6e')]()['then'](function(_0x247fe8){if(_0x247fe8){_0x20f334=_0x247fe8[_0x27a8('0x6f')];}})[_0x27a8('0x15')](function(){return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0xc9f49a);})[_0x27a8('0x15')](handleEntityNotFound(_0x9cb4b0,null))[_0x27a8('0x15')](function(_0x37ec00){if(_0x37ec00){if(!_[_0x27a8('0x70')](_0x37ec00[_0x27a8('0x63')])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x72'),_0x37ec00[_0x27a8('0x63')]))&&_0x20f334){_0x5c0c6f=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x72'),_0x37ec00[_0x27a8('0x63')]);}}return _0x9cb4b0[_0x27a8('0x73')](_0x5c0c6f);}})[_0x27a8('0x1e')](handleError(_0x9cb4b0,null));};exports[_0x27a8('0x74')]=function(_0x45f655,_0x182339){var _0x25fc49=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x75'));var _0x4c2068={'where':{'id':_0x45f655['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x4c2068)['then'](handleEntityNotFound(_0x182339,null))[_0x27a8('0x15')](function(_0x130a44){if(_0x130a44){if(!_['isNil'](_0x130a44[_0x27a8('0x76')])){if(fs[_0x27a8('0x71')](path['join'](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x130a44[_0x27a8('0x76')]))){_0x25fc49=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],'server/files/images/avatars/',_0x130a44[_0x27a8('0x76')]);}}return _0x182339[_0x27a8('0x73')](_0x25fc49);}})[_0x27a8('0x1e')](handleError(_0x182339,null));};exports[_0x27a8('0x78')]=function(_0x4b1404,_0x1a0a07){var _0x284100=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x79'));var _0x370398={'where':{'id':_0x4b1404[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x67'),_0x27a8('0x7a')],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x370398)['then'](handleEntityNotFound(_0x1a0a07,null))[_0x27a8('0x15')](function(_0x1abd35){if(_0x1abd35){if(!_['isNil'](_0x1abd35['customerAvatar'])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config['root'],_0x27a8('0x77'),_0x1abd35[_0x27a8('0x67')]))&&_0x1abd35[_0x27a8('0x7a')]){_0x284100=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x1abd35[_0x27a8('0x67')]);}}return _0x1a0a07[_0x27a8('0x73')](_0x284100);}})[_0x27a8('0x1e')](handleError(_0x1a0a07,null));};exports[_0x27a8('0x7b')]=function(_0x3f75a3,_0x3a6515){var _0x2f95cc=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x7c'));var _0x37578b={'where':{'id':_0x3f75a3[_0x27a8('0x4a')]['id']},'attributes':['id',_0x27a8('0x69')],'raw':!![]};return db[_0x27a8('0x32')][_0x27a8('0x4c')](_0x37578b)['then'](handleEntityNotFound(_0x3a6515,null))['then'](function(_0x18c9a5){if(_0x18c9a5){if(!_[_0x27a8('0x70')](_0x18c9a5[_0x27a8('0x69')])){if(fs[_0x27a8('0x71')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x18c9a5[_0x27a8('0x69')]))){_0x2f95cc=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0x77'),_0x18c9a5[_0x27a8('0x69')]);}}return _0x3a6515[_0x27a8('0x73')](_0x2f95cc);}})[_0x27a8('0x1e')](handleError(_0x3a6515,null));};exports[_0x27a8('0x7d')]=function(_0x38df5b,_0xcab211){var _0x1d4272=require(_0x27a8('0x7e'));var _0xc9995c=new _0x1d4272();var _0xc8723b=_0xc9995c[_0x27a8('0x7f')](_0x38df5b[_0x27a8('0x80')]['user-agent'])[_0x27a8('0x81')]();var _0x39c32b={'body':_0x38df5b[_0x27a8('0x4e')],'channel':_0x27a8('0x82')};var _0x3f500e=[];var _0x14092b=[];var _0x5b262f={};var _0x32fa91=![];return db[_0x27a8('0x83')][_0x27a8('0x84')]()[_0x27a8('0x15')](function(_0x335e12){if(!_0x335e12){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x87'));}_0x3f500e=_[_0x27a8('0x88')](_[_0x27a8('0x4b')](_0x335e12),[_0x27a8('0x89'),_0x27a8('0x8a')]);_0x14092b=_['difference'](_[_0x27a8('0x4b')](_0x335e12),[_0x27a8('0x89'),_0x27a8('0x8a'),'CompanyId',_0x27a8('0x8b')]);if(_0x38df5b[_0x27a8('0x4e')]['id']){delete _0x38df5b[_0x27a8('0x4e')]['id'];}if(_['isNil'](_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x8c')])){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('from\x20is\x20mandatory');}if(_[_0x27a8('0x70')](_0x38df5b['body'][_0x27a8('0x4e')])||_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x4e')]===''){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x8d'));}if(_[_0x27a8('0x70')](_0x38df5b['body']['mapKey'])){throw new db['Sequelize'][(_0x27a8('0x86'))](_0x27a8('0x8e')+_0x14092b);}if(!_[_0x27a8('0x8f')](_0x14092b,_0x38df5b[_0x27a8('0x4e')]['mapKey'])){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14092b);}_0x5b262f[_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x90')]]=_0x38df5b[_0x27a8('0x4e')]['from'];})[_0x27a8('0x15')](function(){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x38df5b[_0x27a8('0x4a')]['id']},'include':[{'model':db[_0x27a8('0x91')],'as':'List','include':[{'model':db['CmContact'],'as':_0x27a8('0x92'),'where':_0x5b262f,'limit':0x1,'order':[[_0x27a8('0x8a'),_0x27a8('0x93')]]}]},{'model':db[_0x27a8('0x94')],'as':_0x27a8('0x95')}]});})['then'](handleEntityNotFound(_0xcab211,null))['then'](function(_0x433de3){if(_0x433de3&&_0x433de3[_0x27a8('0x96')]){_0x39c32b[_0x27a8('0x97')]=_0x433de3;_0x39c32b[_0x27a8('0x98')]=_0x433de3['Applications'];_0x39c32b[_0x27a8('0x99')]=_0x433de3[_0x27a8('0x96')];_0x39c32b[_0x27a8('0x98')]=_['orderBy'](_0x39c32b['applications'],[_0x27a8('0x9a')],[_0x27a8('0x9b')]);if(_0x39c32b[_0x27a8('0x97')][_0x27a8('0x95')]){delete _0x39c32b['account'][_0x27a8('0x95')];}if(_0x39c32b['account'][_0x27a8('0x96')]&&_0x39c32b[_0x27a8('0x97')][_0x27a8('0x96')][_0x27a8('0x92')][_0x27a8('0x3d')]){return _0x39c32b[_0x27a8('0x97')]['List']['Contacts'][0x0];}var _0x754075=_[_0x27a8('0xb')](_0x38df5b[_0x27a8('0x4e')],{'firstName':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x8c')],'ListId':_0x433de3[_0x27a8('0x8b')]});_0x754075[_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x90')]]=_0x38df5b['body'][_0x27a8('0x8c')];return db[_0x27a8('0x83')]['create'](_0x754075,{'fields':_0x3f500e,'raw':!![]});}})[_0x27a8('0x15')](handleEntityNotFound(_0xcab211,null))[_0x27a8('0x15')](function(_0x4b9d1a){_0x39c32b[_0x27a8('0x9c')]=_0x4b9d1a;var _0x397d60=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x9d')];if(_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9e')]){_0x397d60=_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9e')];}else if(_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9f')]){_0x397d60=_[_0x27a8('0xa0')](_0x38df5b[_0x27a8('0x80')][_0x27a8('0x9f')][_0x27a8('0xa1')](','));}if(_0x4b9d1a){var _0x21b562={'ContactId':_0x4b9d1a['id'],'ChatWebsiteId':_0x38df5b[_0x27a8('0x4a')]['id'],'from':(_0x4b9d1a[_0x27a8('0xa2')]||'')+'\x20'+(_0x4b9d1a[_0x27a8('0xa3')]||''),'customerIp':_0x397d60,'customerPort':_0x38df5b[_0x27a8('0x80')][_0x27a8('0xa4')]?_0x38df5b['headers'][_0x27a8('0xa4')]:null,'referer':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xa5')],'browserName':_0xc8723b[_0x27a8('0xa6')][_0x27a8('0x2d')]&&_0xc8723b[_0x27a8('0xa6')][_0x27a8('0xa7')]?util['format'](_0x27a8('0xa8'),_0xc8723b[_0x27a8('0xa6')]['name'],_0xc8723b['browser']['version']):_0x27a8('0xa9'),'browserVersion':_0xc8723b[_0x27a8('0xa6')]['version']||_0x27a8('0xa9'),'osName':util[_0x27a8('0xaa')]('%s\x20%s',_0xc8723b['os'][_0x27a8('0x2d')],_0xc8723b['os'][_0x27a8('0xa7')]),'osVersion':_0xc8723b['os'][_0x27a8('0xa7')],'deviceModel':_0xc8723b[_0x27a8('0xab')][_0x27a8('0x37')]&&_0xc8723b['device'][_0x27a8('0xac')]?util[_0x27a8('0xaa')](_0x27a8('0xad'),_0xc8723b[_0x27a8('0xab')][_0x27a8('0x37')],_0xc8723b['device'][_0x27a8('0xac')],_0xc8723b[_0x27a8('0xab')][_0x27a8('0x35')]):null,'deviceVendor':_0xc8723b[_0x27a8('0xab')][_0x27a8('0xac')],'deviceType':_0xc8723b[_0x27a8('0xab')][_0x27a8('0x35')],'formData':JSON[_0x27a8('0x1b')](_0x38df5b[_0x27a8('0x4e')])};var _0x6384d4={'ChatWebsiteId':_0x38df5b['params']['id'],'closed':![]};if(_0x38df5b['body'][_0x27a8('0xae')]){_0x6384d4[_0x27a8('0xae')]=_0x38df5b['body'][_0x27a8('0xae')];return db['ChatInteraction'][_0x27a8('0x4c')]({'where':_0x6384d4})[_0x27a8('0x15')](function(_0x226a52){if(_0x226a52){return[_0x226a52,![]];}_0x21b562[_0x27a8('0xae')]=_0x38df5b['body'][_0x27a8('0xae')];_0x21b562[_0x27a8('0xaf')]=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xaf')];return db[_0x27a8('0xb0')][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x3b69db){return[_0x3b69db,!![]];});});}_0x6384d4['ContactId']=_0x4b9d1a['id'];if(_0x38df5b[_0x27a8('0x4e')]['interaction']&&_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb1')]['id']){_0x6384d4['id']=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb1')]['id'];return db['ChatInteraction'][_0x27a8('0x4c')]({'where':_0x6384d4})['then'](function(_0x2ed05a){if(_0x2ed05a){return[_0x2ed05a,![]];}return db['ChatInteraction'][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x4b2005){return[_0x4b2005,!![]];});});}return db[_0x27a8('0xb0')][_0x27a8('0x4d')](_0x21b562)[_0x27a8('0x15')](function(_0x539c1e){return[_0x539c1e,!![]];});}})[_0x27a8('0xb2')](function(_0x24e81b,_0x149012){if(_0x24e81b){_0x32fa91=_0x149012;if(!_0x149012){var _0x4b9240={'from':(_0x39c32b[_0x27a8('0x9c')][_0x27a8('0xa2')]||'')+'\x20'+(_0x39c32b[_0x27a8('0x9c')]['lastName']||'')};if(_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xae')]&&_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')]&&_0x38df5b[_0x27a8('0x4e')]['threadId']!=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')]){_0x4b9240[_0x27a8('0xae')]=_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb3')];}return _0x24e81b['update'](_0x4b9240);}else{return _0x24e81b;}}})['then'](function(_0x320a29){_0x39c32b[_0x27a8('0xb1')]=_0x320a29[_0x27a8('0x2a')]({'plain':!![]});_0x39c32b['interaction'][_0x27a8('0xb4')]=_0x32fa91;if(_0x39c32b['interaction'][_0x27a8('0xb4')]){if(_0x39c32b[_0x27a8('0x97')]['autoclose']){_0x39c32b['applications'][_0x27a8('0xb5')]({'id':0x0,'priority':_0x39c32b[_0x27a8('0x98')][_0x27a8('0x3d')]+0x1,'app':_0x27a8('0xb6'),'appdata':_0x27a8('0xb7'),'interval':'*,*,*,*'});}}return db[_0x27a8('0xb8')][_0x27a8('0x4d')]({'body':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0x4e')],'ChatWebsiteId':_0x38df5b[_0x27a8('0x4a')]['id'],'ChatInteractionId':_0x320a29['id'],'direction':'in','ContactId':_0x39c32b[_0x27a8('0x9c')]['id'],'AttachmentId':_0x38df5b[_0x27a8('0x4e')][_0x27a8('0xb9')]});})['then'](function(_0x5977e0){_0x39c32b[_0x27a8('0x1d')]=_0x5977e0;if(_0x39c32b[_0x27a8('0xb1')]['UserId']){return db['User'][_0x27a8('0x4c')]({'attributes':['id',_0x27a8('0x2d')],'where':{'id':_0x39c32b[_0x27a8('0xb1')][_0x27a8('0xba')]}})[_0x27a8('0x15')](function(_0x5ec681){if(_0x5ec681){_0x39c32b[_0x27a8('0x98')][_0x27a8('0xbb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ec681[_0x27a8('0x2d')]+','+(_0x39c32b['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x39c32b[_0x27a8('0xbc')]=!![];}return respondWithRpcPromise('Start',_0x27a8('0xbd'),_0x39c32b);});}return respondWithRpcPromise(_0x27a8('0xbe'),_0x27a8('0xbd'),_0x39c32b);})[_0x27a8('0x15')](function(_0x568d9b){respondWithRpcPromise(_0x27a8('0xbf'),_0x27a8('0xbf'),{'event':'notify','message':_0x568d9b},client9002);return _0x568d9b;})[_0x27a8('0x15')](respondWithResult(_0xcab211,null))['catch'](handleError(_0xcab211,null));};exports[_0x27a8('0xc0')]=function(_0x1ed75b,_0x5454c2){var _0x457cd1,_0x2ce6dd,_0x406b0e;var _0x2a5b45=[];var _0xdeb614={};var _0x37cd9e=_0x1ed75b[_0x27a8('0xc1')]||[];var _0x44d8e8=[];var _0x172ab1;return db[_0x27a8('0x83')][_0x27a8('0x84')]()[_0x27a8('0x15')](function(_0x39fbf2){if(!_0x39fbf2){throw new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('no\x20available\x20attributes');}_0x2a5b45=_[_0x27a8('0x88')](_[_0x27a8('0x4b')](_0x39fbf2),[_0x27a8('0x89'),_0x27a8('0x8a'),_0x27a8('0xc2'),_0x27a8('0x8b')]);if(_0x1ed75b[_0x27a8('0x4e')]['id']){delete _0x1ed75b[_0x27a8('0x4e')]['id'];}if(_[_0x27a8('0x70')](_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x8c')])){throw _0x5454c2['status'](0x1f4)['send'](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0xc3')));}if(_[_0x27a8('0x70')](_0x1ed75b[_0x27a8('0x4e')]['body'])||_0x1ed75b['body'][_0x27a8('0x4e')]===''){throw _0x5454c2[_0x27a8('0x20')](0x1f4)[_0x27a8('0x2e')](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))](_0x27a8('0x8d')));}if(_[_0x27a8('0x70')](_0x1ed75b['body'][_0x27a8('0xc4')])){throw _0x5454c2[_0x27a8('0x20')](0x1f4)[_0x27a8('0x2e')](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a5b45));}if(!_[_0x27a8('0x8f')](_0x2a5b45,_0x1ed75b['body'][_0x27a8('0xc4')])){throw _0x5454c2[_0x27a8('0x20')](0x1f4)['send'](new db[(_0x27a8('0x85'))][(_0x27a8('0x86'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a5b45));}_0xdeb614[_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0xc4')]]=_0x1ed75b[_0x27a8('0x4e')]['from'];})[_0x27a8('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1ed75b[_0x27a8('0x4a')]['id']},'include':[{'model':db[_0x27a8('0x91')],'as':_0x27a8('0x96')},{'model':db[_0x27a8('0xc5')],'as':_0x27a8('0xc5')}]});})[_0x27a8('0x15')](handleEntityNotFound(_0x5454c2,null))[_0x27a8('0x15')](function(_0x50456b){if(_0x50456b&&_0x50456b[_0x27a8('0x96')]){_0x2ce6dd=_0x50456b;var _0x57961c=_[_0x27a8('0xb')](_0x1ed75b['body'],{'firstName':_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x8c')],'phone':_0x1ed75b[_0x27a8('0x4e')]['from'],'ListId':_0x50456b[_0x27a8('0x8b')]});_0x57961c[_0x1ed75b[_0x27a8('0x4e')]['mapKeyOffline']]=_0x1ed75b[_0x27a8('0x4e')]['from'];return db['CmContact'][_0x27a8('0xc6')]({'where':_0xdeb614,'defaults':_0x57961c});}})[_0x27a8('0xb2')](function(_0xf09e8e){if(_0xf09e8e){_0x406b0e=_0xf09e8e;var _0x213df4=fs[_0x27a8('0xc7')](path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0xc8')),_0x27a8('0xc9'));var _0x27faa3=ejs[_0x27a8('0xca')](_0x213df4,{'body':_['toPairs'](_0x1ed75b[_0x27a8('0x4e')][_0x27a8('0x4e')]),'bodyTitle':_0x2ce6dd['offlineMessageBody']});return db['ChatOfflineMessage'][_0x27a8('0x4d')]({'body':_0x27faa3,'plainBody':htmlToText[_0x27a8('0xcb')](_0x27faa3),'ContactId':_0xf09e8e['id'],'ChatWebsiteId':_0x2ce6dd['id']});}})['then'](function(_0x32df13){_0x172ab1=_0x32df13;if(_0x37cd9e[_0x27a8('0x3d')]){var _0xd09318=_0x37cd9e[_0x27a8('0x31')](function(_0x68cc7a){return{'name':_0x68cc7a[_0x27a8('0xcc')],'basename':_0x68cc7a[_0x27a8('0x65')],'type':_0x68cc7a[_0x27a8('0xcd')],'ChatOfflineMessageId':_0x32df13['id']};});_0x44d8e8=_0xd09318[_0x27a8('0x31')](_0x8509c5=>{var _0x2cecfc={'filename':_0x8509c5[_0x27a8('0x2d')],'path':path['join'](config[_0x27a8('0x6c')],_0x27a8('0xce'),'files','attachments',_0x27a8('0xcf'),_0x8509c5[_0x27a8('0xd0')])};return _0x2cecfc;});if(!_0x2ce6dd[_0x27a8('0xd1')]){return db['sequelize'][_0x27a8('0xd2')](function(_0x1fd9de){return db[_0x27a8('0xd3')]['bulkCreate'](_0xd09318,{'transaction':_0x1fd9de});});}}})[_0x27a8('0x15')](function(){if(_0x172ab1){_0x457cd1=_0x172ab1;return db['MailAccount'][_0x27a8('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x27a8('0xd4')],'as':_0x27a8('0xd5'),'raw':!![],'include':[{'model':db[_0x27a8('0xd6')],'as':_0x27a8('0xd6'),'raw':!![]}]}]});}})['then'](function(_0x46318c){if(_0x46318c&&_0x46318c[_0x27a8('0xd5')]&&_0x2ce6dd[_0x27a8('0xd7')]&&_0x2ce6dd[_0x27a8('0xd8')]){var _0x1f7a58=_0x46318c[_0x27a8('0xd9')]();return respondWithRpcPromise(_0x27a8('0xda'),_0x27a8('0xdb'),{'account':_0x1f7a58,'message':{'from':util[_0x27a8('0xaa')](_0x27a8('0xdc'),_0x46318c[_0x27a8('0x2d')],_0x46318c['email']||_0x46318c[_0x27a8('0xd5')][_0x27a8('0x4f')]),'to':_0x2ce6dd[_0x27a8('0xd8')],'subject':_0x2ce6dd[_0x27a8('0xdd')],'html':_0x457cd1[_0x27a8('0x4e')],'attachments':_0x44d8e8}},client9003)[_0x27a8('0x15')](function(){return _0x457cd1;})[_0x27a8('0x1e')](function(_0xf8b1e8){logger[_0x27a8('0x1c')](_0xf8b1e8);});}})[_0x27a8('0x15')](function(){if(_0x2ce6dd&&_0x2ce6dd[_0x27a8('0xd1')]&&_0x2ce6dd[_0x27a8('0xde')]){var _0x5771c7=[];if(_0x37cd9e['length']){_0x5771c7=_0x37cd9e[_0x27a8('0x31')](function(_0x31768d){return{'name':_0x31768d[_0x27a8('0xcc')],'basename':_0x31768d[_0x27a8('0x65')],'type':_0x31768d['mimetype'],'ChatOfflineMessageId':_0x172ab1['id']};});}var _0x85d97;if(!_[_0x27a8('0x70')](_0x2ce6dd[_0x27a8('0xdf')])){var _0xed8c32=_[_0x27a8('0x31')](_0x1ed75b['body'],function(_0x1fdb16){return _0x1fdb16;});var _0x362f58=_[_0x27a8('0xe0')](_0xed8c32)[0x0];var _0x1d17e8=_[_0x27a8('0xe1')](_0x362f58,function(_0x283f30){return _0x283f30;});_0x85d97=_0x1d17e8[0x1][_0x2ce6dd[_0x27a8('0xdf')]];}var _0x3e7f89={'from':_0x406b0e[_0x27a8('0xe2')],'firstName':_0x406b0e[_0x27a8('0xa2')],'lastName':_0x406b0e['lastName'],'mapKey':_0x27a8('0xe2'),'message':{'from':_0x406b0e[_0x27a8('0xe2')],'to':_0x2ce6dd[_0x27a8('0xc5')][_0x27a8('0xe2')],'cc':'','subject':_['isNil'](_0x85d97)?_0x2ce6dd[_0x27a8('0xdd')]:_0x85d97,'messageId':'','sentAt':new Date(),'attach':_0x5771c7[_0x27a8('0x3d')],'attachments':_0x5771c7,'originChannel':'Chat','ChatWebsiteId':_0x2ce6dd['id'],'ChatOfflineMessageId':_0x457cd1['id'],'originTo':_0x2ce6dd[_0x27a8('0xc5')][_0x27a8('0xe2')]},'body':_0x457cd1['body']};var _0x2096a1={'account':{'id':_0x2ce6dd[_0x27a8('0xde')]},'body':_0x3e7f89,'log':_0x27a8('0xe3')};return respondWithRpcPromise(_0x27a8('0xe3'),_0x27a8('0xe4'),_0x2096a1,client9001)[_0x27a8('0x15')](function(){return _0x457cd1;})['catch'](function(_0x2cc2d4){logger[_0x27a8('0x1c')](_0x2cc2d4);});}return;})[_0x27a8('0x15')](function(){if(_0x457cd1){return _0x457cd1;}})[_0x27a8('0x15')](respondWithResult(_0x5454c2,null))[_0x27a8('0x1e')](function(_0x1eff23){logger[_0x27a8('0x1c')](_0x27a8('0x1e'),_0x1eff23);for(var _0x2432fe of _0x37cd9e){var _0x17f099=path[_0x27a8('0x6b')](config[_0x27a8('0x6c')],_0x27a8('0xce'),_0x27a8('0xc1'),_0x27a8('0xe5'),_0x27a8('0xcf'),_0x2432fe[_0x27a8('0x65')]);fs_extra['remove'](_0x17f099)['catch'](function(_0x161705){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x17f099,_0x161705);});}});};exports[_0x27a8('0xe6')]=function(_0x199387,_0x8d9f9c){return db[_0x27a8('0xb0')][_0x27a8('0x4c')]({'where':{'id':_0x199387['params']['id']}})['then'](handleEntityNotFound(_0x8d9f9c,null))[_0x27a8('0x15')](function(_0x314206){if(_0x314206){return _0x314206[_0x27a8('0xe6')](_0x199387[_0x27a8('0x4e')][_0x27a8('0xe7')],_['omit'](_0x199387['body'],[_0x27a8('0xe7'),'id'])||{});}})[_0x27a8('0x15')](respondWithResult(_0x8d9f9c,null))[_0x27a8('0x1e')](handleError(_0x8d9f9c,null));};exports[_0x27a8('0xe8')]=function(_0x1c6c8c,_0x3c4ab1){var _0x2b3e00={'raw':![],'where':{}};var _0x161f6f={};var _0x2541e5={'count':0x0,'rows':[]};return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x1c6c8c['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x3c4ab1,null))['then'](function(_0x1d2664){if(_0x1d2664){_0x161f6f[_0x27a8('0x37')]=_['keys'](db['ChatInteraction'][_0x27a8('0x33')]);_0x161f6f['query']=_['keys'](_0x1c6c8c[_0x27a8('0x38')]);_0x161f6f[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x161f6f[_0x27a8('0x37')],_0x161f6f['query']);_0x2b3e00[_0x27a8('0x3b')]=_['intersection'](_0x161f6f[_0x27a8('0x37')],qs['fields'](_0x1c6c8c['query']['fields']));_0x2b3e00['attributes']=_0x2b3e00[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x2b3e00[_0x27a8('0x3b')]:_0x161f6f[_0x27a8('0x37')];if(!_0x1c6c8c['query']['hasOwnProperty'](_0x27a8('0x3f'))){_0x2b3e00[_0x27a8('0x25')]=qs['limit'](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x25')]);_0x2b3e00['offset']=qs['offset'](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x23')]);}_0x2b3e00[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x40')]);_0x2b3e00['where']=qs['filters'](_[_0x27a8('0x41')](_0x1c6c8c[_0x27a8('0x38')],_0x161f6f[_0x27a8('0x39')]));_0x2b3e00[_0x27a8('0x43')]['ChatWebsiteId']=_0x1d2664['id'];if(_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0x42')]){_0x2b3e00[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x2b3e00[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x2b3e00[_0x27a8('0x3b')],function(_0x22692f){var _0x346323={};_0x346323[_0x22692f]={'$like':'%'+_0x1c6c8c[_0x27a8('0x38')]['filter']+'%'};return _0x346323;})});}_0x2b3e00=_['merge']({},_0x2b3e00,_0x1c6c8c['options']);return db['ChatInteraction'][_0x27a8('0x26')]({'where':_0x2b3e00[_0x27a8('0x43')]})['then'](function(_0x280528){_0x2541e5[_0x27a8('0x26')]=_0x280528;if(_0x1c6c8c['query']['includeAll']){_0x2b3e00['include']=[{'model':db[_0x27a8('0x83')],'as':_0x27a8('0xe9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x27a8('0xea'),_0x27a8('0xeb')],'required':![]},{'model':db[_0x27a8('0xec')],'as':'Tags','attributes':['id',_0x27a8('0x2d'),_0x27a8('0xed')],'where':_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0xee')]?{'id':_0x1c6c8c[_0x27a8('0x38')][_0x27a8('0xee')]}:undefined,'required':_0x1c6c8c['query']['tag']?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x2b3e00);})['then'](function(_0x261aaf){_0x2541e5[_0x27a8('0x5d')]=_0x261aaf;return _0x2541e5;});}})['then'](respondWithFilteredResult(_0x3c4ab1,_0x2b3e00))[_0x27a8('0x1e')](handleError(_0x3c4ab1,null));};function iftimePromise(_0x2e593f,_0x4bae04){return respondWithRpcPromise(_0x27a8('0xef'),_0x27a8('0xf0'),{'command':_0x4bae04[_0x27a8('0xf1')]?util[_0x27a8('0xaa')]('iftime\x20%s,%s',_0x2e593f['interval'],_0x4bae04[_0x27a8('0xf1')]):util['format'](_0x27a8('0xf2'),_0x2e593f['interval'])},client9002)[_0x27a8('0x15')](function(_0x6c3943){var _0xb9ce30=_0x6c3943&&_0x6c3943['indexOf'](_0x27a8('0xf3'))>=0x0?!![]:![];logger[_0x27a8('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4bae04['id'],_0x2e593f['id'],_0x2e593f['interval'],_0xb9ce30?_0x27a8('0xf4'):_0x27a8('0xf5'),_0x4bae04[_0x27a8('0xf1')]?_0x4bae04[_0x27a8('0xf1')]:_0x27a8('0xf6'));return _0xb9ce30;})['catch'](function(_0x3f1f40){logger[_0x27a8('0x1c')](_0x27a8('0xf7'),_0x4bae04['id'],_0x2e593f['id'],_0x2e593f['interval'],util[_0x27a8('0xf8')](_0x3f1f40,{'showHidden':![],'depth':null}),_0x4bae04[_0x27a8('0xf1')]?_0x4bae04[_0x27a8('0xf1')]:_0x27a8('0xf6'));return![];});}exports[_0x27a8('0xf0')]=function(_0x4e6888,_0x32c4c8){var _0x4d1abd=0x0;var _0x20c8ff=0x0;var _0x766c78=![];var _0x45b2fb;var _0x27baf5;return db[_0x27a8('0x32')][_0x27a8('0x4c')]({'where':{'id':_0x4e6888['params']['id']},'include':[{'model':db['Interval'],'as':_0x27a8('0xf9'),'include':[{'model':db[_0x27a8('0xf9')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x27a8('0x15')](handleEntityNotFound(_0x32c4c8,null))[_0x27a8('0x15')](function(_0x467130){if(_0x467130){_0x45b2fb=_0x467130;return _0x467130[_0x27a8('0xfa')]({'raw':!![]});}})[_0x27a8('0x15')](function(_0x3fda45){if(_0x45b2fb){if(_0x3fda45){_0x27baf5=_0x3fda45;}}return require(_0x27a8('0x6d'))[_0x27a8('0x6e')]();})[_0x27a8('0x15')](function(_0x44dea6){if(_0x44dea6){_0x20c8ff=_0x44dea6['virtual'];_0x766c78=_0x44dea6['custom'];}})[_0x27a8('0x15')](function(){return db['ChatInteraction'][_0x27a8('0x26')]({'where':{'closed':![]}});})[_0x27a8('0x15')](function(_0x24f062){_0x4d1abd=_0x24f062;if(_0x20c8ff&&_0x24f062>_0x20c8ff){return db[_0x27a8('0xfb')][_0x27a8('0x5b')]({'where':{'id':0x1}})[_0x27a8('0x15')](function(_0x1c9d01){if(_0x1c9d01){_0x1c9d01['increment'](_0x27a8('0xfc'));}});}})[_0x27a8('0x15')](function(){if(_0x45b2fb[_0x27a8('0xf9')]&&_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')]){var _0x3a57bf=[];for(var _0x12fc5b=0x0;_0x12fc5b<_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')][_0x27a8('0x3d')];_0x12fc5b++){var _0x4c44e0=_0x45b2fb[_0x27a8('0xf9')][_0x27a8('0xfd')][_0x12fc5b][_0x27a8('0x2a')]({'plain':!![]});_0x3a57bf[_0x27a8('0xb5')](iftimePromise(_0x4c44e0,_0x45b2fb));}return BPromise[_0x27a8('0xfe')](_0x3a57bf)[_0x27a8('0x15')](function(_0x4da9f4){return _[_0x27a8('0xff')](_0x4da9f4);});}else{return!![];}})[_0x27a8('0x15')](function(_0x22dcc7){var _0x2df73d=fs['readFileSync'](path[_0x27a8('0x6b')](config['root'],_0x27a8('0x100')),_0x27a8('0xc9'));var _0x10c754={'remote':_0x45b2fb[_0x27a8('0x101')],'query':querystring[_0x27a8('0x1b')](_[_0x27a8('0x44')](_0x45b2fb['get']({'plain':!![]}),{'customerIp':_0x4e6888['headers'][_0x27a8('0x9f')]||_0x4e6888['headers']['x-real-ip']||_0x4e6888['connection']['remoteAddress']||_0x4e6888['ip'],'referer':_0x4e6888[_0x27a8('0x80')]['referer'],'openedInteractions':_0x4d1abd,'maxInteractions':_0x20c8ff,'virtual':_0x766c78['virtual'],'online':_0x22dcc7,'custom':_0x766c78}))[_0x27a8('0x102')](/'/g,'\x5c\x27')};_0x32c4c8[_0x27a8('0x2e')](ejs[_0x27a8('0xca')](Mustache[_0x27a8('0xca')](_0x2df73d,_0x10c754),{'proactiveActions':_0x27baf5,'alignment':_0x45b2fb[_0x27a8('0x103')],'verticalAlignment':_0x45b2fb['verticalAlignment'],'div_color':_0x45b2fb[_0x27a8('0xed')],'labelText':_0x45b2fb[_0x27a8('0x104')],'text_color':_0x45b2fb[_0x27a8('0x105')],'text_button_color':_0x45b2fb[_0x27a8('0x106')],'button_color':_0x45b2fb[_0x27a8('0x107')],'background_color':_0x45b2fb[_0x27a8('0x108')],'hideWhenOffline':_0x45b2fb['hideWhenOffline'],'interval':_0x45b2fb[_0x27a8('0x109')]}));})[_0x27a8('0x1e')](handleError(_0x32c4c8,null));};exports['addApplications']=function(_0xd5fbb9,_0x3c54d4){var _0x395a8d=_0xd5fbb9[_0x27a8('0x4a')]['id'];var _0x613c6e=_0xd5fbb9[_0x27a8('0x4e')];var _0x265ea9=0xc8;var _0x2f7065=null;return db['sequelize'][_0x27a8('0xd2')]({'isolationLevel':db[_0x27a8('0x10a')][_0x27a8('0x10b')][_0x27a8('0x10c')][_0x27a8('0x10d')]},function(_0x2db188){return db['ChatWebsite'][_0x27a8('0x5b')]({'where':{'id':_0x395a8d},'transaction':_0x2db188})[_0x27a8('0x15')](function(_0x5dbb93){if(_0x5dbb93){return db[_0x27a8('0x94')][_0x27a8('0x29')]({'where':{'ChatWebsiteId':_0x395a8d},'transaction':_0x2db188})[_0x27a8('0x15')](function(){var _0x9d3337=_[_0x27a8('0x31')](_0x613c6e,function(_0xf38248){_0xf38248[_0x27a8('0x58')]=_0x395a8d;return _0xf38248;});return db['ChatApplication'][_0x27a8('0x10e')](_0x9d3337,{'transaction':_0x2db188});});}else{_0x265ea9=0x194;_0x2f7065=[];}});})[_0x27a8('0x15')](function(){if(_0x265ea9!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x395a8d},'order':_0x27a8('0x9a')})[_0x27a8('0x15')](function(_0x2bc8a3){_0x2f7065=_0x2bc8a3;});}})[_0x27a8('0x1e')](function(_0xd6ee99){_0x265ea9=0x1f4;logger['error'](_0xd6ee99['stack']);if(_0xd6ee99[_0x27a8('0x2d')]){delete _0xd6ee99[_0x27a8('0x2d')];}_0x2f7065=_0xd6ee99;})[_0x27a8('0x10f')](function(){if(_0x2f7065===null){_0x3c54d4[_0x27a8('0x1f')](_0x265ea9);}else{if(_0x265ea9===0x1f4){_0x3c54d4[_0x27a8('0x20')](_0x265ea9)[_0x27a8('0x2e')](_0x2f7065);}else{_0x3c54d4[_0x27a8('0x20')](_0x265ea9)[_0x27a8('0x22')](_0x2f7065);}}});};exports[_0x27a8('0x110')]=function(_0x6ea4ae,_0x59d4fe){var _0x32e56f={};var _0x20b9dd={};var _0x5c879d;var _0x4ef215;return db[_0x27a8('0x32')]['findOne']({'where':{'id':_0x6ea4ae[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x59d4fe,null))[_0x27a8('0x15')](function(_0x1ddac9){if(_0x1ddac9){_0x5c879d=_0x1ddac9;_0x20b9dd[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db['ChatApplication']['rawAttributes']);_0x20b9dd[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x6ea4ae['query']);_0x20b9dd[_0x27a8('0x39')]=_['intersection'](_0x20b9dd[_0x27a8('0x37')],_0x20b9dd['query']);_0x32e56f[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x20b9dd[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x32e56f[_0x27a8('0x3b')]=_0x32e56f[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x32e56f['attributes']:_0x20b9dd[_0x27a8('0x37')];_0x32e56f[_0x27a8('0x61')]=qs[_0x27a8('0x40')](_0x6ea4ae[_0x27a8('0x38')]['sort']);_0x32e56f['where']=qs['filters'](_[_0x27a8('0x41')](_0x6ea4ae[_0x27a8('0x38')],_0x20b9dd[_0x27a8('0x39')]));if(_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x42')]){_0x32e56f['where']=_['merge'](_0x32e56f[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x32e56f[_0x27a8('0x3b')],function(_0x5e82be){var _0x227ac0={};_0x227ac0[_0x5e82be]={'$like':'%'+_0x6ea4ae[_0x27a8('0x38')]['filter']+'%'};return _0x227ac0;})});}_0x32e56f=_[_0x27a8('0x44')]({},_0x32e56f,_0x6ea4ae['options']);return _0x5c879d[_0x27a8('0x110')](_0x32e56f);}})[_0x27a8('0x15')](function(_0x17d410){if(_0x17d410){_0x4ef215=_0x17d410['length'];if(!_0x6ea4ae['query'][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x32e56f[_0x27a8('0x25')]=qs['limit'](_0x6ea4ae[_0x27a8('0x38')]['limit']);_0x32e56f[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x6ea4ae[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x5c879d['getApplications'](_0x32e56f);}})[_0x27a8('0x15')](function(_0x14fce6){if(_0x14fce6){return _0x14fce6?{'count':_0x4ef215,'rows':_0x14fce6}:null;}})[_0x27a8('0x15')](respondWithResult(_0x59d4fe,null))[_0x27a8('0x1e')](handleError(_0x59d4fe,null));};exports[_0x27a8('0x111')]=function(_0x2b4cac,_0x245de7){return db[_0x27a8('0x112')][_0x27a8('0x4c')]({'where':{'id':_0x2b4cac[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x245de7,null))['then'](function(_0x644328){if(_0x644328){return _0x644328['addProactiveActions'](_0x2b4cac[_0x27a8('0x4e')]['ids'],_['omit'](_0x2b4cac[_0x27a8('0x4e')],['ids','id'])||{});}})[_0x27a8('0x15')](respondWithResult(_0x245de7,null))['catch'](handleError(_0x245de7,null));};exports['getProactiveActions']=function(_0x306d58,_0x2a6e64){var _0x40ddbc={};var _0x31f722={};var _0x497948;var _0x472fbf;return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x306d58[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x2a6e64,null))[_0x27a8('0x15')](function(_0x8d9d90){if(_0x8d9d90){_0x497948=_0x8d9d90;_0x31f722[_0x27a8('0x37')]=_['keys'](db['ChatProactiveAction'][_0x27a8('0x33')]);_0x31f722[_0x27a8('0x38')]=_['keys'](_0x306d58[_0x27a8('0x38')]);_0x31f722[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x31f722[_0x27a8('0x37')],_0x31f722[_0x27a8('0x38')]);_0x40ddbc[_0x27a8('0x3b')]=_['intersection'](_0x31f722['model'],qs['fields'](_0x306d58[_0x27a8('0x38')]['fields']));_0x40ddbc[_0x27a8('0x3b')]=_0x40ddbc[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x40ddbc[_0x27a8('0x3b')]:_0x31f722[_0x27a8('0x37')];_0x40ddbc['order']=qs[_0x27a8('0x40')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x40')]);_0x40ddbc['where']=qs['filters'](_[_0x27a8('0x41')](_0x306d58[_0x27a8('0x38')],_0x31f722[_0x27a8('0x39')]));if(_0x306d58[_0x27a8('0x38')][_0x27a8('0x42')]){_0x40ddbc[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x40ddbc[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x40ddbc[_0x27a8('0x3b')],function(_0xc5dfa9){var _0x1e2921={};_0x1e2921[_0xc5dfa9]={'$like':'%'+_0x306d58[_0x27a8('0x38')]['filter']+'%'};return _0x1e2921;})});}_0x40ddbc=_[_0x27a8('0x44')]({},_0x40ddbc,_0x306d58[_0x27a8('0x46')]);return _0x497948[_0x27a8('0xfa')](_0x40ddbc);}})[_0x27a8('0x15')](function(_0x306f19){if(_0x306f19){_0x472fbf=_0x306f19[_0x27a8('0x3d')];if(!_0x306d58[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x40ddbc[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x25')]);_0x40ddbc[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x306d58[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x497948[_0x27a8('0xfa')](_0x40ddbc);}})[_0x27a8('0x15')](function(_0x3442a7){if(_0x3442a7){return _0x3442a7?{'count':_0x472fbf,'rows':_0x3442a7}:null;}})[_0x27a8('0x15')](respondWithResult(_0x2a6e64,null))[_0x27a8('0x1e')](handleError(_0x2a6e64,null));};exports[_0x27a8('0x113')]=function(_0x1b0a3b,_0x5b7b4c){var _0x168439=_0x1b0a3b[_0x27a8('0x38')]['online']===_0x27a8('0x114')?_0x27a8('0x115'):_0x27a8('0x116');return db[_0x27a8('0x32')]['find']({'attributes':['id',_0x168439],'where':{'id':_0x1b0a3b[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x5b7b4c,null))[_0x27a8('0x15')](function(_0x97777a){if(_0x97777a){var _0x4d4ecf=_0x97777a[_0x168439];var _0x4b3552=_0x4d4ecf&&_0x4d4ecf[_0x27a8('0x117')]?_0x4d4ecf[_0x27a8('0x117')]:[];_0x5b7b4c[_0x27a8('0x2e')]({'fromKey':_[_0x27a8('0x70')](_0x4d4ecf['fromKey'])?undefined:_0x4d4ecf[_0x27a8('0x118')],'count':_0x4b3552[_0x27a8('0x3d')],'rows':_0x4b3552});}})[_0x27a8('0x1e')](handleError(_0x5b7b4c,null));};exports['getOfflineMessages']=function(_0x25dc08,_0x7740f5){var _0x3a2083={'raw':![],'where':{}};var _0x1d20d2={};var _0x24d204={'count':0x0,'rows':[]};return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x25dc08[_0x27a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7740f5,null))[_0x27a8('0x15')](function(_0x170cf9){if(_0x170cf9){_0x1d20d2[_0x27a8('0x37')]=_[_0x27a8('0x4b')](db['ChatOfflineMessage'][_0x27a8('0x33')]);_0x1d20d2[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x25dc08[_0x27a8('0x38')]);_0x1d20d2['filters']=_[_0x27a8('0x3a')](_0x1d20d2[_0x27a8('0x37')],_0x1d20d2[_0x27a8('0x38')]);_0x3a2083['attributes']=_[_0x27a8('0x3a')](_0x1d20d2[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x25dc08[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x3a2083['attributes']=_0x3a2083[_0x27a8('0x3b')]['length']?_0x3a2083[_0x27a8('0x3b')]:_0x1d20d2[_0x27a8('0x37')];if(!_0x25dc08[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x3a2083[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x25dc08[_0x27a8('0x38')][_0x27a8('0x25')]);_0x3a2083[_0x27a8('0x23')]=qs[_0x27a8('0x23')](_0x25dc08['query']['offset']);}_0x3a2083['order']=qs[_0x27a8('0x40')](_0x25dc08[_0x27a8('0x38')]['sort']);_0x3a2083['where']=qs['filters'](_[_0x27a8('0x41')](_0x25dc08[_0x27a8('0x38')],_0x1d20d2['filters']));_0x3a2083['where'][_0x27a8('0x58')]=_0x170cf9['id'];if(_0x25dc08[_0x27a8('0x38')][_0x27a8('0x42')]){_0x3a2083[_0x27a8('0x43')]=_['merge'](_0x3a2083[_0x27a8('0x43')],{'$or':_[_0x27a8('0x31')](_0x3a2083[_0x27a8('0x3b')],function(_0x31b13e){var _0x3b32f8={};_0x3b32f8[_0x31b13e]={'$like':'%'+_0x25dc08[_0x27a8('0x38')]['filter']+'%'};return _0x3b32f8;})});}_0x3a2083=_[_0x27a8('0x44')]({},_0x3a2083,_0x25dc08['options']);return db[_0x27a8('0x119')][_0x27a8('0x26')]({'where':_0x3a2083[_0x27a8('0x43')]})[_0x27a8('0x15')](function(_0x5a8976){_0x24d204['count']=_0x5a8976;if(_0x25dc08[_0x27a8('0x38')][_0x27a8('0x47')]){_0x3a2083[_0x27a8('0x5c')]=[{'all':!![]}];}else{_0x3a2083[_0x27a8('0x5c')]=[{'model':db[_0x27a8('0x83')],'as':_0x27a8('0xe9'),'required':![]},{'model':db[_0x27a8('0xd3')],'as':_0x27a8('0x11a'),'required':![]}];}return db[_0x27a8('0x119')]['findAll'](_0x3a2083);})[_0x27a8('0x15')](function(_0x13e046){_0x24d204[_0x27a8('0x5d')]=_0x13e046;return _0x24d204;});}})[_0x27a8('0x15')](respondWithFilteredResult(_0x7740f5,_0x3a2083))[_0x27a8('0x1e')](handleError(_0x7740f5,null));};exports['addAgents']=function(_0x3d1c19,_0x5d8ce9){return db[_0x27a8('0x32')]['find']({'where':{'id':_0x3d1c19[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x5d8ce9,null))['then'](function(_0x13ec03){if(_0x13ec03){return _0x13ec03['addAgents'](_0x3d1c19[_0x27a8('0x4e')][_0x27a8('0xe7')],_[_0x27a8('0x11b')](_0x3d1c19[_0x27a8('0x4e')],['ids','id'])||{})[_0x27a8('0xb2')](function(_0x495bbd){for(var _0x1368cd=0x0;_0x1368cd<_0x3d1c19[_0x27a8('0x4e')][_0x27a8('0xe7')][_0x27a8('0x3d')];_0x1368cd+=0x1){socket['emit'](_0x27a8('0x11c'),{'UserId':Number(_0x3d1c19['body'][_0x27a8('0xe7')][_0x1368cd]),'ChatWebsiteId':Number(_0x3d1c19[_0x27a8('0x4a')]['id'])});}return _0x495bbd;});}})[_0x27a8('0x15')](respondWithResult(_0x5d8ce9,null))[_0x27a8('0x1e')](handleError(_0x5d8ce9,null));};exports['removeAgents']=function(_0x2704b2,_0x10e447){return db['ChatWebsite'][_0x27a8('0x4c')]({'where':{'id':_0x2704b2[_0x27a8('0x4a')]['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x10e447,null))[_0x27a8('0x15')](function(_0xc00666){if(_0xc00666){return _0xc00666['removeAgents'](_0x2704b2['query'][_0x27a8('0xe7')])['then'](function(){if(_[_0x27a8('0x11d')](_0x2704b2[_0x27a8('0x38')][_0x27a8('0xe7')])){for(var _0xcb15b9=0x0;_0xcb15b9<_0x2704b2[_0x27a8('0x38')]['ids'][_0x27a8('0x3d')];_0xcb15b9+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2704b2['query']['ids'][_0xcb15b9]),'ChatWebsiteId':Number(_0x2704b2[_0x27a8('0x4a')]['id'])});}}else{socket[_0x27a8('0x11e')](_0x27a8('0x11f'),{'UserId':Number(_0x2704b2[_0x27a8('0x38')][_0x27a8('0xe7')]),'ChatWebsiteId':Number(_0x2704b2[_0x27a8('0x4a')]['id'])});}});}})[_0x27a8('0x15')](respondWithStatusCode(_0x10e447,null))['catch'](handleError(_0x10e447,null));};exports[_0x27a8('0x120')]=function(_0x47307c,_0x11026e){var _0x46f5d3={};var _0x555d59={};var _0x52daa9;var _0x19bbaa;return db[_0x27a8('0x32')][_0x27a8('0x5b')]({'where':{'id':_0x47307c['params']['id']}})[_0x27a8('0x15')](handleEntityNotFound(_0x11026e,null))['then'](function(_0x22bd18){if(_0x22bd18){_0x52daa9=_0x22bd18;_0x555d59['model']=_[_0x27a8('0x4b')](db[_0x27a8('0x121')][_0x27a8('0x33')]);_0x555d59[_0x27a8('0x38')]=_[_0x27a8('0x4b')](_0x47307c[_0x27a8('0x38')]);_0x555d59[_0x27a8('0x39')]=_[_0x27a8('0x3a')](_0x555d59[_0x27a8('0x37')],_0x555d59[_0x27a8('0x38')]);_0x46f5d3[_0x27a8('0x3b')]=_[_0x27a8('0x3a')](_0x555d59[_0x27a8('0x37')],qs[_0x27a8('0x3c')](_0x47307c[_0x27a8('0x38')][_0x27a8('0x3c')]));_0x46f5d3['attributes']=_0x46f5d3[_0x27a8('0x3b')][_0x27a8('0x3d')]?_0x46f5d3[_0x27a8('0x3b')]:_0x555d59[_0x27a8('0x37')];_0x46f5d3['order']=qs['sort'](_0x47307c[_0x27a8('0x38')][_0x27a8('0x40')]);_0x46f5d3['where']=qs['filters'](_[_0x27a8('0x41')](_0x47307c[_0x27a8('0x38')],_0x555d59[_0x27a8('0x39')]));if(_0x47307c['query'][_0x27a8('0x42')]){_0x46f5d3[_0x27a8('0x43')]=_[_0x27a8('0x44')](_0x46f5d3[_0x27a8('0x43')],{'$or':_['map'](_0x46f5d3['attributes'],function(_0xd15ec9){var _0x3a7d58={};_0x3a7d58[_0xd15ec9]={'$like':'%'+_0x47307c['query'][_0x27a8('0x42')]+'%'};return _0x3a7d58;})});}_0x46f5d3=_[_0x27a8('0x44')]({},_0x46f5d3,_0x47307c[_0x27a8('0x46')]);return _0x52daa9[_0x27a8('0x120')](_0x46f5d3);}})['then'](function(_0x337722){if(_0x337722){_0x19bbaa=_0x337722['length'];if(!_0x47307c[_0x27a8('0x38')][_0x27a8('0x3e')](_0x27a8('0x3f'))){_0x46f5d3[_0x27a8('0x25')]=qs[_0x27a8('0x25')](_0x47307c[_0x27a8('0x38')]['limit']);_0x46f5d3['offset']=qs['offset'](_0x47307c[_0x27a8('0x38')][_0x27a8('0x23')]);}return _0x52daa9[_0x27a8('0x120')](_0x46f5d3);}})[_0x27a8('0x15')](function(_0x8c1c0a){if(_0x8c1c0a){return _0x8c1c0a?{'count':_0x19bbaa,'rows':_0x8c1c0a}:null;}})[_0x27a8('0x15')](respondWithResult(_0x11026e,null))[_0x27a8('0x1e')](handleError(_0x11026e,null));}; \ No newline at end of file +var _0x812b=['toPairsIn','mapValues','email','Chat','MailAccountId','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','replace','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','http','client','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','end','json','undefined','limit','count','offset','status','set','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ChatWebsiteId','findOne','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','order','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','isNil','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','user-agent','getResult','chat','no\x20available\x20attributes','difference','updatedAt','createdAt','Sequelize','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','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','ChatInteraction','threadId','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','UserId','User','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','files','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','offlineMessageSubject','openNewInteraction','subjectOffline'];(function(_0x561b0d,_0x2de288){var _0x4e4bcf=function(_0x13834f){while(--_0x13834f){_0x561b0d['push'](_0x561b0d['shift']());}};_0x4e4bcf(++_0x2de288);}(_0x812b,0x17c));var _0xb812=function(_0xbda849,_0x2dcb1a){_0xbda849=_0xbda849-0x0;var _0x2d3e9d=_0x812b[_0xbda849];return _0x2d3e9d;};'use strict';var BPromise=require(_0xb812('0x0'));var Mustache=require(_0xb812('0x1'));var util=require(_0xb812('0x2'));var path=require(_0xb812('0x3'));var ejs=require(_0xb812('0x4'));var fs=require('fs');var fs_extra=require(_0xb812('0x5'));var _=require(_0xb812('0x6'));var querystring=require(_0xb812('0x7'));var Redis=require(_0xb812('0x8'));var qs=require(_0xb812('0x9'));var logger=require(_0xb812('0xa'))('api');var config=require('../../config/environment');var db=require(_0xb812('0xb'))['db'];config[_0xb812('0xc')]=_[_0xb812('0xd')](config[_0xb812('0xc')],{'host':_0xb812('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb812('0xc')]));require(_0xb812('0xf'))[_0xb812('0x10')](socket);var htmlToText=require(_0xb812('0x11'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb812('0x12')]({'port':0x232c});var client9002=jayson['client'][_0xb812('0x12')]({'port':0x232a});var client9003=jayson['client'][_0xb812('0x12')]({'port':0x232b});var client9001=jayson[_0xb812('0x13')][_0xb812('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x1624ca,_0x2f571a,_0xf51b5c,_0x2709de){return new BPromise(function(_0x2c5847,_0x544a6c){var _0x1164e8=_0x2709de||client;return _0x1164e8[_0xb812('0x14')](_0x1624ca,_0xf51b5c)[_0xb812('0x15')](function(_0x27a446){logger[_0xb812('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2f571a,'request\x20sent');logger[_0xb812('0x17')](_0xb812('0x18'),_0x2f571a,_0xb812('0x19'),JSON[_0xb812('0x1a')](_0x27a446));if(_0x27a446[_0xb812('0x1b')]){if(_0x27a446[_0xb812('0x1b')][_0xb812('0x1c')]===0x1f4){logger[_0xb812('0x1b')](_0xb812('0x1d'),_0x2f571a,_0x27a446[_0xb812('0x1b')][_0xb812('0x1e')]);return _0x544a6c(_0x27a446['error']['message']);}logger[_0xb812('0x1b')](_0xb812('0x1d'),_0x2f571a,_0x27a446[_0xb812('0x1b')][_0xb812('0x1e')]);return _0x2c5847(_0x27a446[_0xb812('0x1b')][_0xb812('0x1e')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2f571a,_0xb812('0x19'));_0x2c5847(_0x27a446[_0xb812('0x1f')][_0xb812('0x1e')]);}})[_0xb812('0x20')](function(_0x2d05e1){logger[_0xb812('0x1b')](_0xb812('0x1d'),_0x2f571a,_0x2d05e1);_0x544a6c(_0x2d05e1);});});}function respondWithStatusCode(_0x1d955e,_0x294222){_0x294222=_0x294222||0xcc;return function(_0x30121a){if(_0x30121a){return _0x1d955e['sendStatus'](_0x294222);}return _0x1d955e['status'](_0x294222)[_0xb812('0x21')]();};}function respondWithResult(_0x42298b,_0x1f28ab){_0x1f28ab=_0x1f28ab||0xc8;return function(_0x547c0f){if(_0x547c0f){return _0x42298b['status'](_0x1f28ab)[_0xb812('0x22')](_0x547c0f);}};}function respondWithFilteredResult(_0x3381a0,_0x452f75){return function(_0x39f3ff){if(_0x39f3ff){var _0x1ed76e=typeof _0x452f75['offset']===_0xb812('0x23')&&typeof _0x452f75[_0xb812('0x24')]===_0xb812('0x23');var _0x4b340a=_0x39f3ff[_0xb812('0x25')];var _0x5a75de=_0x1ed76e?0x0:_0x452f75[_0xb812('0x26')];var _0x1ac24f=_0x1ed76e?_0x39f3ff[_0xb812('0x25')]:_0x452f75['offset']+_0x452f75[_0xb812('0x24')];var _0x21ed16;if(_0x1ac24f>=_0x4b340a){_0x1ac24f=_0x4b340a;_0x21ed16=0xc8;}else{_0x21ed16=0xce;}_0x3381a0[_0xb812('0x27')](_0x21ed16);return _0x3381a0[_0xb812('0x28')]('Content-Range',_0x5a75de+'-'+_0x1ac24f+'/'+_0x4b340a)[_0xb812('0x22')](_0x39f3ff);}return null;};}function saveUpdates(_0x2ac7e4){return function(_0x2c716b){if(_0x2c716b){return _0x2c716b['update'](_0x2ac7e4)[_0xb812('0x15')](function(_0x5cadb3){return _0x5cadb3;});}return null;};}function removeEntity(_0x31f5f7){return function(_0x5ea3fd){if(_0x5ea3fd){return _0x5ea3fd[_0xb812('0x29')]()['then'](function(){var _0x1a23f1=_0x5ea3fd[_0xb812('0x2a')]({'plain':!![]});var _0x1ecc28='ChatWebsites';return db[_0xb812('0x2b')][_0xb812('0x29')]({'where':{'type':_0x1ecc28,'resourceId':_0x1a23f1['id']}})[_0xb812('0x15')](function(){return _0x5ea3fd;});})['then'](function(){_0x31f5f7[_0xb812('0x27')](0xcc)[_0xb812('0x21')]();});}};}function handleEntityNotFound(_0x5804c8){return function(_0x47732c){if(!_0x47732c){_0x5804c8['sendStatus'](0x194);}return _0x47732c;};}function handleError(_0x189729,_0x4f9974){_0x4f9974=_0x4f9974||0x1f4;return function(_0x6e32cd){logger[_0xb812('0x1b')](_0x6e32cd[_0xb812('0x2c')]);if(_0x6e32cd[_0xb812('0x2d')]){delete _0x6e32cd['name'];}_0x189729[_0xb812('0x27')](_0x4f9974)[_0xb812('0x2e')](_0x6e32cd);};}exports[_0xb812('0x2f')]=function(_0x25e47c,_0xcc912){var _0x4961d3={'include':[{'model':db[_0xb812('0x30')],'as':_0xb812('0x31')}]},_0x5d64d8={},_0x4fcf97={'count':0x0,'rows':[]};var _0x420123=_[_0xb812('0x32')](db[_0xb812('0x33')]['rawAttributes'],function(_0x32e02f){return{'name':_0x32e02f['fieldName'],'type':_0x32e02f['type'][_0xb812('0x34')]};});_0x5d64d8[_0xb812('0x35')]=_[_0xb812('0x32')](_0x420123,_0xb812('0x2d'));_0x5d64d8['query']=_[_0xb812('0x36')](_0x25e47c[_0xb812('0x37')]);_0x5d64d8[_0xb812('0x38')]=_['intersection'](_0x5d64d8[_0xb812('0x35')],_0x5d64d8[_0xb812('0x37')]);_0x4961d3['attributes']=_[_0xb812('0x39')](_0x5d64d8[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x25e47c['query'][_0xb812('0x3a')]));_0x4961d3[_0xb812('0x3b')]=_0x4961d3[_0xb812('0x3b')][_0xb812('0x3c')]?_0x4961d3['attributes']:_0x5d64d8['model'];if(!_0x25e47c[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x4961d3[_0xb812('0x24')]=qs['limit'](_0x25e47c[_0xb812('0x37')]['limit']);_0x4961d3[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x25e47c[_0xb812('0x37')][_0xb812('0x26')]);}_0x4961d3['order']=qs[_0xb812('0x3f')](_0x25e47c[_0xb812('0x37')][_0xb812('0x3f')]);_0x4961d3[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x25e47c[_0xb812('0x37')],_0x5d64d8[_0xb812('0x38')]),_0x420123);if(_0x25e47c['query'][_0xb812('0x42')]){_0x4961d3[_0xb812('0x40')]=_['merge'](_0x4961d3[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x420123,function(_0x3ca266){if(_0x3ca266[_0xb812('0x43')]!==_0xb812('0x44')){var _0x3555e4={};_0x3555e4[_0x3ca266[_0xb812('0x2d')]]={'$like':'%'+_0x25e47c[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x3555e4;}})});}_0x4961d3=_[_0xb812('0x45')]({},_0x4961d3,_0x25e47c[_0xb812('0x46')]);var _0x5076fb={'where':_0x4961d3[_0xb812('0x40')]};return db[_0xb812('0x33')]['count'](_0x5076fb)[_0xb812('0x15')](function(_0x1613e5){_0x4fcf97[_0xb812('0x25')]=_0x1613e5;if(_0x25e47c[_0xb812('0x37')][_0xb812('0x47')]){_0x4961d3[_0xb812('0x48')]=[{'all':!![]}];}return db[_0xb812('0x33')][_0xb812('0x49')](_0x4961d3);})['then'](function(_0x265ea3){_0x4fcf97[_0xb812('0x4a')]=_0x265ea3;return _0x4fcf97;})[_0xb812('0x15')](respondWithFilteredResult(_0xcc912,_0x4961d3))[_0xb812('0x20')](handleError(_0xcc912,null));};exports[_0xb812('0x4b')]=function(_0x439ade,_0x519bd6){var _0xa7968a={'raw':![],'where':{'id':_0x439ade['params']['id']},'include':[{'model':db[_0xb812('0x30')],'as':_0xb812('0x31')}]},_0x1e05aa={};_0x1e05aa['model']=_[_0xb812('0x36')](db['ChatWebsite'][_0xb812('0x4c')]);_0x1e05aa['query']=_[_0xb812('0x36')](_0x439ade['query']);_0x1e05aa[_0xb812('0x38')]=_[_0xb812('0x39')](_0x1e05aa[_0xb812('0x35')],_0x1e05aa[_0xb812('0x37')]);_0xa7968a[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x1e05aa[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x439ade[_0xb812('0x37')]['fields']));_0xa7968a[_0xb812('0x3b')]=_0xa7968a[_0xb812('0x3b')]['length']?_0xa7968a[_0xb812('0x3b')]:_0x1e05aa['model'];if(_0x439ade[_0xb812('0x37')][_0xb812('0x47')]){_0xa7968a[_0xb812('0x48')]=[{'all':!![]}];}_0xa7968a=_[_0xb812('0x45')]({},_0xa7968a,_0x439ade[_0xb812('0x46')]);return db[_0xb812('0x33')][_0xb812('0x4d')](_0xa7968a)[_0xb812('0x15')](handleEntityNotFound(_0x519bd6,null))[_0xb812('0x15')](respondWithResult(_0x519bd6,null))[_0xb812('0x20')](handleError(_0x519bd6,null));};exports['create']=function(_0x5aff41,_0x6fe28c){return db[_0xb812('0x33')]['create'](_0x5aff41[_0xb812('0x4e')],{})[_0xb812('0x15')](function(_0x375351){var _0x1e224f=_0x5aff41[_0xb812('0x4f')]['get']({'plain':!![]});if(!_0x1e224f)throw new Error(_0xb812('0x50'));if(_0x1e224f[_0xb812('0x51')]===_0xb812('0x4f')){var _0x98752=_0x375351[_0xb812('0x2a')]({'plain':!![]});var _0xb10bfc=_0xb812('0x52');return db[_0xb812('0x53')][_0xb812('0x4d')]({'where':{'name':_0xb10bfc,'userProfileId':_0x1e224f[_0xb812('0x54')]},'raw':!![]})['then'](function(_0x2f3312){if(_0x2f3312&&_0x2f3312[_0xb812('0x55')]===0x0){return db['UserProfileResource'][_0xb812('0x56')]({'name':_0x98752[_0xb812('0x2d')],'resourceId':_0x98752['id'],'type':_0x2f3312[_0xb812('0x2d')],'sectionId':_0x2f3312['id']},{})[_0xb812('0x15')](function(){return _0x375351;});}else{return _0x375351;}})[_0xb812('0x20')](function(_0x3c5253){logger['error'](_0xb812('0x57'),_0x3c5253);throw _0x3c5253;});}return _0x375351;})[_0xb812('0x15')](respondWithResult(_0x6fe28c,0xc9))['catch'](handleError(_0x6fe28c,null));};exports[_0xb812('0x58')]=function(_0x560d18,_0x4d7efe){if(_0x560d18['body']['id']){delete _0x560d18[_0xb812('0x4e')]['id'];}return db['ChatWebsite'][_0xb812('0x4d')]({'where':{'id':_0x560d18[_0xb812('0x59')]['id']},'include':[{'model':db[_0xb812('0x30')],'as':_0xb812('0x31')}]})[_0xb812('0x15')](handleEntityNotFound(_0x4d7efe,null))['then'](saveUpdates(_0x560d18[_0xb812('0x4e')],null))[_0xb812('0x15')](respondWithResult(_0x4d7efe,null))[_0xb812('0x20')](handleError(_0x4d7efe,null));};exports[_0xb812('0x29')]=function(_0x37eb6d,_0x58717c){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x37eb6d['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x58717c,null))[_0xb812('0x15')](removeEntity(_0x58717c,null))[_0xb812('0x20')](handleError(_0x58717c,null));};exports[_0xb812('0x5a')]=function(_0x3a8d21,_0x4d55cb){return db[_0xb812('0x33')][_0xb812('0x5a')]()[_0xb812('0x15')](respondWithResult(_0x4d55cb,null))[_0xb812('0x20')](handleError(_0x4d55cb,null));};exports[_0xb812('0x5b')]=function(_0x1a0a8d,_0xbf2242){if(_0x1a0a8d[_0xb812('0x4e')]['id']){delete _0x1a0a8d[_0xb812('0x4e')]['id'];}return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x1a0a8d[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0xbf2242,null))['then'](function(_0xf7e82c){if(_0xf7e82c){_0x1a0a8d[_0xb812('0x4e')][_0xb812('0x5c')]=_0xf7e82c['id'];return db['Disposition'][_0xb812('0x56')](_0x1a0a8d[_0xb812('0x4e')]);}})[_0xb812('0x15')](respondWithResult(_0xbf2242,null))[_0xb812('0x20')](handleError(_0xbf2242,null));};exports['getDispositions']=function(_0x55afc0,_0x16967a){var _0x1df794={'raw':![],'where':{}};var _0x54a066={};var _0xf1c82a={'count':0x0,'rows':[]};return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x55afc0[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0x16967a,null))['then'](function(_0x3da0b4){if(_0x3da0b4){_0x54a066['model']=_[_0xb812('0x36')](db[_0xb812('0x5e')]['rawAttributes']);_0x54a066[_0xb812('0x37')]=_[_0xb812('0x36')](_0x55afc0['query']);_0x54a066['filters']=_[_0xb812('0x39')](_0x54a066[_0xb812('0x35')],_0x54a066['query']);_0x1df794[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x54a066['model'],qs[_0xb812('0x3a')](_0x55afc0['query']['fields']));_0x1df794[_0xb812('0x3b')]=_0x1df794[_0xb812('0x3b')][_0xb812('0x3c')]?_0x1df794[_0xb812('0x3b')]:_0x54a066[_0xb812('0x35')];if(!_0x55afc0[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x1df794[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x55afc0[_0xb812('0x37')][_0xb812('0x24')]);_0x1df794[_0xb812('0x26')]=qs['offset'](_0x55afc0[_0xb812('0x37')][_0xb812('0x26')]);}_0x1df794['order']=qs['sort'](_0x55afc0['query'][_0xb812('0x3f')]);_0x1df794[_0xb812('0x40')]=qs['filters'](_[_0xb812('0x41')](_0x55afc0[_0xb812('0x37')],_0x54a066['filters']));_0x1df794[_0xb812('0x40')]['ChatWebsiteId']=_0x3da0b4['id'];if(_0x55afc0[_0xb812('0x37')]['filter']){_0x1df794[_0xb812('0x40')]=_[_0xb812('0x45')](_0x1df794['where'],{'$or':_[_0xb812('0x32')](_0x1df794[_0xb812('0x3b')],function(_0x2e5e04){var _0x573e4e={};_0x573e4e[_0x2e5e04]={'$like':'%'+_0x55afc0['query'][_0xb812('0x42')]+'%'};return _0x573e4e;})});}_0x1df794=_[_0xb812('0x45')]({},_0x1df794,_0x55afc0['options']);return db[_0xb812('0x5e')][_0xb812('0x25')]({'where':_0x1df794['where']})['then'](function(_0x49a188){_0xf1c82a[_0xb812('0x25')]=_0x49a188;if(_0x55afc0['query'][_0xb812('0x47')]){_0x1df794['include']=[{'all':!![]}];}return db[_0xb812('0x5e')]['findAll'](_0x1df794);})['then'](function(_0x1d9b55){_0xf1c82a[_0xb812('0x4a')]=_0x1d9b55;return _0xf1c82a;});}})['then'](respondWithFilteredResult(_0x16967a,_0x1df794))['catch'](handleError(_0x16967a,null));};exports[_0xb812('0x5f')]=function(_0x5f33e8,_0x30ba59){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x5f33e8[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x30ba59,null))[_0xb812('0x15')](function(_0x543603){if(_0x543603){return _0x543603[_0xb812('0x5f')](_0x5f33e8[_0xb812('0x37')][_0xb812('0x60')]);}})[_0xb812('0x15')](respondWithStatusCode(_0x30ba59,null))[_0xb812('0x20')](handleError(_0x30ba59,null));};exports[_0xb812('0x61')]=function(_0x32d4cf,_0x480e5a){if(_0x32d4cf['body']['id']){delete _0x32d4cf['body']['id'];}return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x32d4cf['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x480e5a,null))[_0xb812('0x15')](function(_0x422416){if(_0x422416){_0x32d4cf['body'][_0xb812('0x5c')]=_0x422416['id'];return db['CannedAnswer']['create'](_0x32d4cf[_0xb812('0x4e')]);}})[_0xb812('0x15')](respondWithResult(_0x480e5a,null))[_0xb812('0x20')](handleError(_0x480e5a,null));};exports[_0xb812('0x62')]=function(_0x4364cf,_0x3f3974){var _0x4c1702={'raw':![],'where':{}};var _0x3ccf45={};var _0x5647a4={'count':0x0,'rows':[]};return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x4364cf[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x3f3974,null))[_0xb812('0x15')](function(_0x4b50d8){if(_0x4b50d8){_0x3ccf45['model']=_[_0xb812('0x36')](db[_0xb812('0x63')][_0xb812('0x4c')]);_0x3ccf45[_0xb812('0x37')]=_['keys'](_0x4364cf['query']);_0x3ccf45['filters']=_[_0xb812('0x39')](_0x3ccf45[_0xb812('0x35')],_0x3ccf45['query']);_0x4c1702[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x3ccf45[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x4364cf[_0xb812('0x37')]['fields']));_0x4c1702[_0xb812('0x3b')]=_0x4c1702[_0xb812('0x3b')]['length']?_0x4c1702['attributes']:_0x3ccf45[_0xb812('0x35')];if(!_0x4364cf[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x4c1702[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x4364cf[_0xb812('0x37')][_0xb812('0x24')]);_0x4c1702[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x4364cf['query']['offset']);}_0x4c1702[_0xb812('0x64')]=qs[_0xb812('0x3f')](_0x4364cf[_0xb812('0x37')][_0xb812('0x3f')]);_0x4c1702[_0xb812('0x40')]=qs[_0xb812('0x38')](_['pick'](_0x4364cf['query'],_0x3ccf45[_0xb812('0x38')]));_0x4c1702[_0xb812('0x40')][_0xb812('0x5c')]=_0x4b50d8['id'];if(_0x4364cf[_0xb812('0x37')][_0xb812('0x42')]){_0x4c1702['where']=_[_0xb812('0x45')](_0x4c1702[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x4c1702[_0xb812('0x3b')],function(_0x5a5ba9){var _0x44d830={};_0x44d830[_0x5a5ba9]={'$like':'%'+_0x4364cf['query']['filter']+'%'};return _0x44d830;})});}_0x4c1702=_[_0xb812('0x45')]({},_0x4c1702,_0x4364cf[_0xb812('0x46')]);return db[_0xb812('0x63')][_0xb812('0x25')]({'where':_0x4c1702[_0xb812('0x40')]})['then'](function(_0x4e837e){_0x5647a4[_0xb812('0x25')]=_0x4e837e;if(_0x4364cf[_0xb812('0x37')][_0xb812('0x47')]){_0x4c1702[_0xb812('0x48')]=[{'all':!![]}];}return db[_0xb812('0x63')][_0xb812('0x49')](_0x4c1702);})['then'](function(_0x314be3){_0x5647a4[_0xb812('0x4a')]=_0x314be3;return _0x5647a4;});}})[_0xb812('0x15')](respondWithFilteredResult(_0x3f3974,_0x4c1702))[_0xb812('0x20')](handleError(_0x3f3974,null));};exports['removeAnswers']=function(_0x440343,_0x161ff6){return db['ChatWebsite'][_0xb812('0x4d')]({'where':{'id':_0x440343[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x161ff6,null))[_0xb812('0x15')](function(_0x56957a){if(_0x56957a){return _0x56957a[_0xb812('0x65')](_0x440343[_0xb812('0x37')][_0xb812('0x60')]);}})[_0xb812('0x15')](respondWithStatusCode(_0x161ff6,null))[_0xb812('0x20')](handleError(_0x161ff6,null));};exports[_0xb812('0x66')]=function(_0xca083f,_0xcd1cfa){_0xca083f['body'][_0xb812('0x67')]=_0xca083f[_0xb812('0x68')][_0xb812('0x69')];return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0xca083f[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0xcd1cfa,null))['then'](saveUpdates(_0xca083f['body'],null))[_0xb812('0x15')](respondWithResult(_0xcd1cfa,null))[_0xb812('0x20')](handleError(_0xcd1cfa,null));};exports[_0xb812('0x6a')]=function(_0x374b6e,_0x1ff8d5){_0x374b6e[_0xb812('0x4e')]['agentAvatar']=_0x374b6e[_0xb812('0x68')][_0xb812('0x69')];return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x374b6e[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x1ff8d5,null))['then'](saveUpdates(_0x374b6e[_0xb812('0x4e')],null))['then'](respondWithResult(_0x1ff8d5,null))[_0xb812('0x20')](handleError(_0x1ff8d5,null));};exports[_0xb812('0x6b')]=function(_0x5c4c8f,_0x1b4f8a){_0x5c4c8f['body']['customerAvatar']=_0x5c4c8f[_0xb812('0x68')][_0xb812('0x69')];return db['ChatWebsite'][_0xb812('0x4d')]({'where':{'id':_0x5c4c8f[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x1b4f8a,null))[_0xb812('0x15')](saveUpdates(_0x5c4c8f[_0xb812('0x4e')],null))['then'](respondWithResult(_0x1b4f8a,null))[_0xb812('0x20')](handleError(_0x1b4f8a,null));};exports[_0xb812('0x6c')]=function(_0x4b7e78,_0x3334a6){_0x4b7e78['body'][_0xb812('0x6d')]=_0x4b7e78[_0xb812('0x68')][_0xb812('0x69')];return db['ChatWebsite']['find']({'where':{'id':_0x4b7e78[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x3334a6,null))[_0xb812('0x15')](saveUpdates(_0x4b7e78[_0xb812('0x4e')],null))[_0xb812('0x15')](respondWithResult(_0x3334a6,null))[_0xb812('0x20')](handleError(_0x3334a6,null));};exports[_0xb812('0x6e')]=function(_0x2fa724,_0x5c212d){var _0x36120d=path['join'](config[_0xb812('0x6f')],_0xb812('0x70'));var _0x46eebc={'where':{'id':_0x2fa724[_0xb812('0x59')]['id']},'attributes':['id',_0xb812('0x67')],'raw':!![]};var _0x148108=![];return require('../../config/license/util')['getLicense']()[_0xb812('0x15')](function(_0x3d9007){if(_0x3d9007){_0x148108=_0x3d9007[_0xb812('0x71')];}})[_0xb812('0x15')](function(){return db['ChatWebsite'][_0xb812('0x4d')](_0x46eebc);})['then'](handleEntityNotFound(_0x5c212d,null))[_0xb812('0x15')](function(_0x37a9db){if(_0x37a9db){if(!_['isNil'](_0x37a9db[_0xb812('0x67')])){if(fs[_0xb812('0x72')](path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0x74'),_0x37a9db[_0xb812('0x67')]))&&_0x148108){_0x36120d=path[_0xb812('0x73')](config[_0xb812('0x6f')],'server/files/images/logos/',_0x37a9db[_0xb812('0x67')]);}}return _0x5c212d[_0xb812('0x75')](_0x36120d);}})[_0xb812('0x20')](handleError(_0x5c212d,null));};exports[_0xb812('0x76')]=function(_0x5d2871,_0x43bdbb){var _0x373e2f=path[_0xb812('0x73')](config['root'],_0xb812('0x77'));var _0x35c136={'where':{'id':_0x5d2871['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x35c136)[_0xb812('0x15')](handleEntityNotFound(_0x43bdbb,null))[_0xb812('0x15')](function(_0x323429){if(_0x323429){if(!_['isNil'](_0x323429[_0xb812('0x78')])){if(fs['existsSync'](path['join'](config[_0xb812('0x6f')],_0xb812('0x79'),_0x323429[_0xb812('0x78')]))){_0x373e2f=path['join'](config['root'],_0xb812('0x79'),_0x323429[_0xb812('0x78')]);}}return _0x43bdbb[_0xb812('0x75')](_0x373e2f);}})[_0xb812('0x20')](handleError(_0x43bdbb,null));};exports[_0xb812('0x7a')]=function(_0x3b2f3e,_0x24474c){var _0x316591=path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0x7b'));var _0x153542={'where':{'id':_0x3b2f3e[_0xb812('0x59')]['id']},'attributes':['id',_0xb812('0x7c'),_0xb812('0x7d')],'raw':!![]};return db['ChatWebsite']['find'](_0x153542)[_0xb812('0x15')](handleEntityNotFound(_0x24474c,null))[_0xb812('0x15')](function(_0x4e2860){if(_0x4e2860){if(!_[_0xb812('0x7e')](_0x4e2860[_0xb812('0x7c')])){if(fs[_0xb812('0x72')](path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0x79'),_0x4e2860[_0xb812('0x7c')]))&&_0x4e2860[_0xb812('0x7d')]){_0x316591=path['join'](config['root'],'server/files/images/avatars/',_0x4e2860['customerAvatar']);}}return _0x24474c[_0xb812('0x75')](_0x316591);}})[_0xb812('0x20')](handleError(_0x24474c,null));};exports[_0xb812('0x7f')]=function(_0x5c3130,_0x499772){var _0x5dcc94=path[_0xb812('0x73')](config['root'],_0xb812('0x80'));var _0xfeedf6={'where':{'id':_0x5c3130['params']['id']},'attributes':['id',_0xb812('0x6d')],'raw':!![]};return db['ChatWebsite'][_0xb812('0x4d')](_0xfeedf6)[_0xb812('0x15')](handleEntityNotFound(_0x499772,null))['then'](function(_0xf98ae1){if(_0xf98ae1){if(!_['isNil'](_0xf98ae1['systemAvatar'])){if(fs[_0xb812('0x72')](path[_0xb812('0x73')](config['root'],_0xb812('0x79'),_0xf98ae1[_0xb812('0x6d')]))){_0x5dcc94=path[_0xb812('0x73')](config[_0xb812('0x6f')],'server/files/images/avatars/',_0xf98ae1['systemAvatar']);}}return _0x499772['download'](_0x5dcc94);}})[_0xb812('0x20')](handleError(_0x499772,null));};exports[_0xb812('0x81')]=function(_0x48b316,_0x296ca6){var _0x45fc2d=require(_0xb812('0x82'));var _0x74c64d=new _0x45fc2d();var _0x40ff1a=_0x74c64d['setUA'](_0x48b316['headers'][_0xb812('0x83')])[_0xb812('0x84')]();var _0x20ec6b={'body':_0x48b316[_0xb812('0x4e')],'channel':_0xb812('0x85')};var _0x49d0e7=[];var _0x179bd7=[];var _0x13e838={};var _0x468492=![];return db['CmContact']['describe']()[_0xb812('0x15')](function(_0x2df5f4){if(!_0x2df5f4){throw new db['Sequelize']['ValidationError'](_0xb812('0x86'));}_0x49d0e7=_[_0xb812('0x87')](_[_0xb812('0x36')](_0x2df5f4),['createdAt',_0xb812('0x88')]);_0x179bd7=_[_0xb812('0x87')](_[_0xb812('0x36')](_0x2df5f4),[_0xb812('0x89'),_0xb812('0x88'),'CompanyId','ListId']);if(_0x48b316['body']['id']){delete _0x48b316[_0xb812('0x4e')]['id'];}if(_['isNil'](_0x48b316[_0xb812('0x4e')]['from'])){throw new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0x8c'));}if(_['isNil'](_0x48b316['body'][_0xb812('0x4e')])||_0x48b316[_0xb812('0x4e')][_0xb812('0x4e')]===''){throw new db[(_0xb812('0x8a'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb812('0x7e')](_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')])){throw new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0x8e')+_0x179bd7);}if(!_['includes'](_0x179bd7,_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')])){throw new db['Sequelize'][(_0xb812('0x8b'))](_0xb812('0x8f')+_0x179bd7);}_0x13e838[_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')]]=_0x48b316[_0xb812('0x4e')][_0xb812('0x90')];})[_0xb812('0x15')](function(){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x48b316['params']['id']},'include':[{'model':db[_0xb812('0x91')],'as':_0xb812('0x92'),'include':[{'model':db[_0xb812('0x93')],'as':_0xb812('0x94'),'where':_0x13e838,'limit':0x1,'order':[[_0xb812('0x88'),_0xb812('0x95')]]}]},{'model':db[_0xb812('0x96')],'as':_0xb812('0x97')}]});})[_0xb812('0x15')](handleEntityNotFound(_0x296ca6,null))['then'](function(_0x4184dc){if(_0x4184dc&&_0x4184dc[_0xb812('0x92')]){_0x20ec6b[_0xb812('0x98')]=_0x4184dc;_0x20ec6b[_0xb812('0x99')]=_0x4184dc[_0xb812('0x97')];_0x20ec6b[_0xb812('0x9a')]=_0x4184dc[_0xb812('0x92')];_0x20ec6b[_0xb812('0x99')]=_[_0xb812('0x9b')](_0x20ec6b[_0xb812('0x99')],[_0xb812('0x9c')],[_0xb812('0x9d')]);if(_0x20ec6b[_0xb812('0x98')][_0xb812('0x97')]){delete _0x20ec6b[_0xb812('0x98')]['Applications'];}if(_0x20ec6b[_0xb812('0x98')][_0xb812('0x92')]&&_0x20ec6b[_0xb812('0x98')][_0xb812('0x92')][_0xb812('0x94')][_0xb812('0x3c')]){return _0x20ec6b['account'][_0xb812('0x92')][_0xb812('0x94')][0x0];}var _0x294c60=_['defaults'](_0x48b316[_0xb812('0x4e')],{'firstName':_0x48b316[_0xb812('0x4e')][_0xb812('0x90')],'ListId':_0x4184dc['ListId']});_0x294c60[_0x48b316[_0xb812('0x4e')][_0xb812('0x8d')]]=_0x48b316[_0xb812('0x4e')][_0xb812('0x90')];return db[_0xb812('0x93')]['create'](_0x294c60,{'fields':_0x49d0e7,'raw':!![]});}})[_0xb812('0x15')](handleEntityNotFound(_0x296ca6,null))[_0xb812('0x15')](function(_0xbec519){_0x20ec6b[_0xb812('0x9e')]=_0xbec519;var _0x37aa85=_0x48b316[_0xb812('0x4e')][_0xb812('0x9f')];if(_0x48b316['headers'][_0xb812('0xa0')]){_0x37aa85=_0x48b316[_0xb812('0xa1')]['cf-connecting-ip'];}else if(_0x48b316['headers'][_0xb812('0xa2')]){_0x37aa85=_[_0xb812('0xa3')](_0x48b316[_0xb812('0xa1')]['x-forwarded-for'][_0xb812('0xa4')](','));}if(_0xbec519){var _0x274841={'ContactId':_0xbec519['id'],'ChatWebsiteId':_0x48b316[_0xb812('0x59')]['id'],'from':(_0xbec519[_0xb812('0xa5')]||'')+'\x20'+(_0xbec519[_0xb812('0xa6')]||''),'customerIp':_0x37aa85,'customerPort':_0x48b316[_0xb812('0xa1')][_0xb812('0xa7')]?_0x48b316[_0xb812('0xa1')][_0xb812('0xa7')]:null,'referer':_0x48b316['body']['referer'],'browserName':_0x40ff1a[_0xb812('0xa8')]['name']&&_0x40ff1a[_0xb812('0xa8')][_0xb812('0xa9')]?util[_0xb812('0xaa')](_0xb812('0xab'),_0x40ff1a[_0xb812('0xa8')][_0xb812('0x2d')],_0x40ff1a[_0xb812('0xa8')]['version']):_0xb812('0xac'),'browserVersion':_0x40ff1a[_0xb812('0xa8')][_0xb812('0xa9')]||_0xb812('0xac'),'osName':util['format']('%s\x20%s',_0x40ff1a['os']['name'],_0x40ff1a['os']['version']),'osVersion':_0x40ff1a['os'][_0xb812('0xa9')],'deviceModel':_0x40ff1a['device'][_0xb812('0x35')]&&_0x40ff1a[_0xb812('0xad')][_0xb812('0xae')]?util[_0xb812('0xaa')](_0xb812('0xaf'),_0x40ff1a[_0xb812('0xad')][_0xb812('0x35')],_0x40ff1a[_0xb812('0xad')][_0xb812('0xae')],_0x40ff1a[_0xb812('0xad')][_0xb812('0x43')]):null,'deviceVendor':_0x40ff1a['device'][_0xb812('0xae')],'deviceType':_0x40ff1a[_0xb812('0xad')]['type'],'formData':JSON[_0xb812('0x1a')](_0x48b316[_0xb812('0x4e')])};var _0x14d876={'ChatWebsiteId':_0x48b316[_0xb812('0x59')]['id'],'closed':![]};if(_0x48b316[_0xb812('0x4e')]['threadId']){_0x14d876['threadId']=_0x48b316['body']['threadId'];return db[_0xb812('0xb0')]['find']({'where':_0x14d876})[_0xb812('0x15')](function(_0x12898d){if(_0x12898d){return[_0x12898d,![]];}_0x274841[_0xb812('0xb1')]=_0x48b316['body'][_0xb812('0xb1')];_0x274841[_0xb812('0xb2')]=_0x48b316[_0xb812('0x4e')]['externalUrl'];return db['ChatInteraction'][_0xb812('0x56')](_0x274841)['then'](function(_0xf65210){return[_0xf65210,!![]];});});}_0x14d876[_0xb812('0xb3')]=_0xbec519['id'];if(_0x48b316[_0xb812('0x4e')]['interaction']&&_0x48b316[_0xb812('0x4e')][_0xb812('0xb4')]['id']){_0x14d876['id']=_0x48b316[_0xb812('0x4e')]['interaction']['id'];return db[_0xb812('0xb0')][_0xb812('0x4d')]({'where':_0x14d876})[_0xb812('0x15')](function(_0x6978fb){if(_0x6978fb){return[_0x6978fb,![]];}return db[_0xb812('0xb0')][_0xb812('0x56')](_0x274841)[_0xb812('0x15')](function(_0x45adb6){return[_0x45adb6,!![]];});});}return db['ChatInteraction']['create'](_0x274841)[_0xb812('0x15')](function(_0x4c31bd){return[_0x4c31bd,!![]];});}})['spread'](function(_0x33c3a2,_0xeb64cf){if(_0x33c3a2){_0x468492=_0xeb64cf;if(!_0xeb64cf){var _0xc5b70a={'from':(_0x20ec6b[_0xb812('0x9e')][_0xb812('0xa5')]||'')+'\x20'+(_0x20ec6b['contact'][_0xb812('0xa6')]||'')};if(_0x48b316[_0xb812('0x4e')][_0xb812('0xb1')]&&_0x48b316['body']['messageId']&&_0x48b316[_0xb812('0x4e')]['threadId']!=_0x48b316[_0xb812('0x4e')][_0xb812('0xb5')]){_0xc5b70a['threadId']=_0x48b316[_0xb812('0x4e')][_0xb812('0xb5')];}return _0x33c3a2['update'](_0xc5b70a);}else{return _0x33c3a2;}}})[_0xb812('0x15')](function(_0x353ee6){_0x20ec6b['interaction']=_0x353ee6[_0xb812('0x2a')]({'plain':!![]});_0x20ec6b['interaction']['created']=_0x468492;if(_0x20ec6b[_0xb812('0xb4')][_0xb812('0xb6')]){if(_0x20ec6b[_0xb812('0x98')][_0xb812('0xb7')]){_0x20ec6b[_0xb812('0x99')][_0xb812('0xb8')]({'id':0x0,'priority':_0x20ec6b['applications']['length']+0x1,'app':_0xb812('0xb9'),'appdata':_0xb812('0xba'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xb812('0x56')]({'body':_0x48b316[_0xb812('0x4e')][_0xb812('0x4e')],'ChatWebsiteId':_0x48b316[_0xb812('0x59')]['id'],'ChatInteractionId':_0x353ee6['id'],'direction':'in','ContactId':_0x20ec6b[_0xb812('0x9e')]['id'],'AttachmentId':_0x48b316['body']['AttachmentId']});})[_0xb812('0x15')](function(_0x3db82f){_0x20ec6b[_0xb812('0x1e')]=_0x3db82f;if(_0x20ec6b[_0xb812('0xb4')][_0xb812('0xbb')]){return db[_0xb812('0xbc')][_0xb812('0x4d')]({'attributes':['id','name'],'where':{'id':_0x20ec6b['interaction'][_0xb812('0xbb')]}})[_0xb812('0x15')](function(_0x1831b1){if(_0x1831b1){_0x20ec6b[_0xb812('0x99')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1831b1[_0xb812('0x2d')]+','+(_0x20ec6b[_0xb812('0x98')][_0xb812('0xbd')]||0xa),'interval':_0xb812('0xbe')});_0x20ec6b['forcedOwnership']=!![];}return respondWithRpcPromise(_0xb812('0xbf'),'startRouting',_0x20ec6b);});}return respondWithRpcPromise(_0xb812('0xbf'),_0xb812('0xc0'),_0x20ec6b);})['then'](function(_0x6643b3){respondWithRpcPromise(_0xb812('0xc1'),'EventManager',{'event':_0xb812('0x81'),'message':_0x6643b3},client9002);return _0x6643b3;})[_0xb812('0x15')](respondWithResult(_0x296ca6,null))[_0xb812('0x20')](handleError(_0x296ca6,null));};exports[_0xb812('0xc2')]=function(_0x9b85cc,_0x2ee8f5){var _0x37d4aa,_0x381547,_0x54316f;var _0x26f310=[];var _0x2c376d={};var _0x18d95c=_0x9b85cc[_0xb812('0xc3')]||[];var _0x1ee497=[];var _0x305c1c;return db[_0xb812('0x93')][_0xb812('0x5a')]()['then'](function(_0xf4a335){if(!_0xf4a335){throw new db['Sequelize'][(_0xb812('0x8b'))]('no\x20available\x20attributes');}_0x26f310=_[_0xb812('0x87')](_['keys'](_0xf4a335),['createdAt',_0xb812('0x88'),'CompanyId',_0xb812('0xc4')]);if(_0x9b85cc[_0xb812('0x4e')]['id']){delete _0x9b85cc['body']['id'];}if(_[_0xb812('0x7e')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0x90')])){throw _0x2ee8f5[_0xb812('0x27')](0x1f4)['send'](new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0x8c')));}if(_[_0xb812('0x7e')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0x4e')])||_0x9b85cc['body'][_0xb812('0x4e')]===''){throw _0x2ee8f5[_0xb812('0x27')](0x1f4)[_0xb812('0x2e')](new db[(_0xb812('0x8a'))][(_0xb812('0x8b'))](_0xb812('0xc5')));}if(_[_0xb812('0x7e')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0xc6')])){throw _0x2ee8f5['status'](0x1f4)['send'](new db['Sequelize'][(_0xb812('0x8b'))](_0xb812('0xc7')+_0x26f310));}if(!_[_0xb812('0xc8')](_0x26f310,_0x9b85cc[_0xb812('0x4e')]['mapKeyOffline'])){throw _0x2ee8f5[_0xb812('0x27')](0x1f4)['send'](new db[(_0xb812('0x8a'))]['ValidationError'](_0xb812('0xc9')+_0x26f310));}_0x2c376d[_0x9b85cc[_0xb812('0x4e')][_0xb812('0xc6')]]=_0x9b85cc['body']['from'];})[_0xb812('0x15')](function(){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x9b85cc[_0xb812('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xb812('0x92')},{'model':db[_0xb812('0xca')],'as':_0xb812('0xca')}]});})['then'](handleEntityNotFound(_0x2ee8f5,null))[_0xb812('0x15')](function(_0x2f1025){if(_0x2f1025&&_0x2f1025['List']){_0x381547=_0x2f1025;var _0x42c0d4=_[_0xb812('0xd')](_0x9b85cc['body'],{'firstName':_0x9b85cc['body'][_0xb812('0x90')],'phone':_0x9b85cc['body'][_0xb812('0x90')],'ListId':_0x2f1025[_0xb812('0xc4')]});_0x42c0d4[_0x9b85cc[_0xb812('0x4e')][_0xb812('0xc6')]]=_0x9b85cc[_0xb812('0x4e')][_0xb812('0x90')];return db['CmContact'][_0xb812('0xcb')]({'where':_0x2c376d,'defaults':_0x42c0d4});}})[_0xb812('0xcc')](function(_0x2d6070){if(_0x2d6070){_0x54316f=_0x2d6070;var _0x16b21a=fs[_0xb812('0xcd')](path['join'](config[_0xb812('0x6f')],_0xb812('0xce')),_0xb812('0xcf'));var _0x5deeb7=ejs[_0xb812('0xd0')](_0x16b21a,{'body':_[_0xb812('0xd1')](_0x9b85cc[_0xb812('0x4e')][_0xb812('0x4e')]),'bodyTitle':_0x381547[_0xb812('0xd2')]});return db[_0xb812('0xd3')][_0xb812('0x56')]({'body':_0x5deeb7,'plainBody':htmlToText[_0xb812('0xd4')](_0x5deeb7),'ContactId':_0x2d6070['id'],'ChatWebsiteId':_0x381547['id']});}})[_0xb812('0x15')](function(_0x569ce9){_0x305c1c=_0x569ce9;if(_0x18d95c[_0xb812('0x3c')]){var _0x2705c5=_0x18d95c[_0xb812('0x32')](function(_0x321561){return{'name':_0x321561[_0xb812('0xd5')],'basename':_0x321561[_0xb812('0x69')],'type':_0x321561[_0xb812('0xd6')],'ChatOfflineMessageId':_0x569ce9['id']};});_0x1ee497=_0x2705c5[_0xb812('0x32')](_0x475265=>{var _0x13d412={'filename':_0x475265[_0xb812('0x2d')],'path':path['join'](config[_0xb812('0x6f')],_0xb812('0xd7'),_0xb812('0xc3'),_0xb812('0xd8'),_0xb812('0xd9'),_0x475265['basename'])};return _0x13d412;});if(!_0x381547['openNewInteraction']){return db[_0xb812('0xda')]['transaction'](function(_0x2241d4){return db[_0xb812('0xdb')][_0xb812('0xdc')](_0x2705c5,{'transaction':_0x2241d4});});}}})['then'](function(){if(_0x305c1c){_0x37d4aa=_0x305c1c;return db['MailAccount'][_0xb812('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xb812('0xdd')],'as':_0xb812('0xde'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xb812('0xdf'),'raw':!![]}]}]});}})[_0xb812('0x15')](function(_0x37b171){if(_0x37b171&&_0x37b171[_0xb812('0xde')]&&_0x381547[_0xb812('0xe0')]&&_0x381547[_0xb812('0xe1')]){var _0x563d42=_0x37b171[_0xb812('0xe2')]();return respondWithRpcPromise(_0xb812('0xe3'),_0xb812('0xe4'),{'account':_0x563d42,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x37b171['name'],_0x37b171['email']||_0x37b171[_0xb812('0xde')][_0xb812('0x4f')]),'to':_0x381547[_0xb812('0xe1')],'subject':_0x381547[_0xb812('0xe5')],'html':_0x37d4aa[_0xb812('0x4e')],'attachments':_0x1ee497}},client9003)['then'](function(){return _0x37d4aa;})['catch'](function(_0x4d77d1){logger['error'](_0x4d77d1);});}})['then'](function(){if(_0x381547&&_0x381547[_0xb812('0xe6')]&&_0x381547['MailAccountId']){var _0x3caa93=[];if(_0x18d95c['length']){_0x3caa93=_0x18d95c[_0xb812('0x32')](function(_0x190001){return{'name':_0x190001[_0xb812('0xd5')],'basename':_0x190001[_0xb812('0x69')],'type':_0x190001['mimetype'],'ChatOfflineMessageId':_0x305c1c['id']};});}var _0x10a88c;if(!_[_0xb812('0x7e')](_0x381547[_0xb812('0xe7')])){var _0x252ab1=_['map'](_0x9b85cc['body'],function(_0x4d44d0){return _0x4d44d0;});var _0x16929a=_[_0xb812('0xe8')](_0x252ab1)[0x0];var _0x5efcdc=_[_0xb812('0xe9')](_0x16929a,function(_0x328bfc){return _0x328bfc;});_0x10a88c=_0x5efcdc[0x1][_0x381547[_0xb812('0xe7')]];}var _0x53c48c={'from':_0x54316f[_0xb812('0xea')],'firstName':_0x54316f[_0xb812('0xa5')],'lastName':_0x54316f[_0xb812('0xa6')],'mapKey':_0xb812('0xea'),'message':{'from':_0x54316f['email'],'to':_0x381547[_0xb812('0xca')][_0xb812('0xea')],'cc':'','subject':_[_0xb812('0x7e')](_0x10a88c)?_0x381547['offlineMessageSubject']:_0x10a88c,'messageId':'','sentAt':new Date(),'attach':_0x3caa93[_0xb812('0x3c')],'attachments':_0x3caa93,'originChannel':_0xb812('0xeb'),'ChatWebsiteId':_0x381547['id'],'ChatOfflineMessageId':_0x37d4aa['id'],'originTo':_0x381547[_0xb812('0xca')][_0xb812('0xea')]},'body':_0x37d4aa['body']};var _0x3b1b0c={'account':{'id':_0x381547[_0xb812('0xec')]},'body':_0x53c48c,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x3b1b0c,client9001)[_0xb812('0x15')](function(){return _0x37d4aa;})[_0xb812('0x20')](function(_0x25a167){logger[_0xb812('0x1b')](_0x25a167);});}return;})[_0xb812('0x15')](function(){if(_0x37d4aa){return _0x37d4aa;}})[_0xb812('0x15')](respondWithResult(_0x2ee8f5,null))[_0xb812('0x20')](function(_0x61aa6a){logger[_0xb812('0x1b')](_0xb812('0x20'),_0x61aa6a);for(var _0x1b309f of _0x18d95c){var _0x2417fe=path[_0xb812('0x73')](config[_0xb812('0x6f')],_0xb812('0xd7'),_0xb812('0xc3'),_0xb812('0xd8'),_0xb812('0xd9'),_0x1b309f[_0xb812('0x69')]);fs_extra[_0xb812('0xed')](_0x2417fe)[_0xb812('0x20')](function(_0x4e2cf9){logger[_0xb812('0x1b')](_0xb812('0xee'),_0x2417fe,_0x4e2cf9);});}});};exports[_0xb812('0xef')]=function(_0x1e1a3f,_0x348bd0){return db[_0xb812('0xb0')][_0xb812('0x4d')]({'where':{'id':_0x1e1a3f[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0x348bd0,null))[_0xb812('0x15')](function(_0x400770){if(_0x400770){return _0x400770[_0xb812('0xef')](_0x1e1a3f[_0xb812('0x4e')][_0xb812('0x60')],_[_0xb812('0xf0')](_0x1e1a3f[_0xb812('0x4e')],[_0xb812('0x60'),'id'])||{});}})[_0xb812('0x15')](respondWithResult(_0x348bd0,null))['catch'](handleError(_0x348bd0,null));};exports[_0xb812('0xf1')]=function(_0x519882,_0xded69b){var _0x16c3f1={'raw':![],'where':{}};var _0x155487={};var _0x49bd50={'count':0x0,'rows':[]};return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x519882['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0xded69b,null))[_0xb812('0x15')](function(_0x110796){if(_0x110796){_0x155487[_0xb812('0x35')]=_['keys'](db[_0xb812('0xb0')]['rawAttributes']);_0x155487[_0xb812('0x37')]=_[_0xb812('0x36')](_0x519882[_0xb812('0x37')]);_0x155487[_0xb812('0x38')]=_[_0xb812('0x39')](_0x155487[_0xb812('0x35')],_0x155487[_0xb812('0x37')]);_0x16c3f1[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x155487[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x519882['query'][_0xb812('0x3a')]));_0x16c3f1[_0xb812('0x3b')]=_0x16c3f1[_0xb812('0x3b')][_0xb812('0x3c')]?_0x16c3f1[_0xb812('0x3b')]:_0x155487[_0xb812('0x35')];if(!_0x519882[_0xb812('0x37')][_0xb812('0x3d')](_0xb812('0x3e'))){_0x16c3f1[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x519882['query'][_0xb812('0x24')]);_0x16c3f1[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x519882[_0xb812('0x37')]['offset']);}_0x16c3f1[_0xb812('0x64')]=qs['sort'](_0x519882[_0xb812('0x37')]['sort']);_0x16c3f1[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x519882[_0xb812('0x37')],_0x155487[_0xb812('0x38')]));_0x16c3f1[_0xb812('0x40')]['ChatWebsiteId']=_0x110796['id'];if(_0x519882[_0xb812('0x37')][_0xb812('0x42')]){_0x16c3f1[_0xb812('0x40')]=_[_0xb812('0x45')](_0x16c3f1['where'],{'$or':_['map'](_0x16c3f1['attributes'],function(_0x9fae00){var _0xb2798={};_0xb2798[_0x9fae00]={'$like':'%'+_0x519882[_0xb812('0x37')]['filter']+'%'};return _0xb2798;})});}_0x16c3f1=_[_0xb812('0x45')]({},_0x16c3f1,_0x519882[_0xb812('0x46')]);return db['ChatInteraction']['count']({'where':_0x16c3f1[_0xb812('0x40')]})['then'](function(_0x535e5d){_0x49bd50[_0xb812('0x25')]=_0x535e5d;if(_0x519882[_0xb812('0x37')][_0xb812('0x47')]){_0x16c3f1[_0xb812('0x48')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xb812('0xf2'),'attributes':['name','fullname',_0xb812('0xf3')],'required':![]},{'model':db['Tag'],'as':_0xb812('0xf4'),'attributes':['id',_0xb812('0x2d'),_0xb812('0xf5')],'where':_0x519882['query'][_0xb812('0xf6')]?{'id':_0x519882['query'][_0xb812('0xf6')]}:undefined,'required':_0x519882[_0xb812('0x37')][_0xb812('0xf6')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x16c3f1);})[_0xb812('0x15')](function(_0x44de53){_0x49bd50[_0xb812('0x4a')]=_0x44de53;return _0x49bd50;});}})['then'](respondWithFilteredResult(_0xded69b,_0x16c3f1))[_0xb812('0x20')](handleError(_0xded69b,null));};function iftimePromise(_0x2d3fc0,_0x1c98b9){return respondWithRpcPromise(_0xb812('0xf7'),_0xb812('0xf8'),{'command':_0x1c98b9['timezone']?util[_0xb812('0xaa')](_0xb812('0xf9'),_0x2d3fc0[_0xb812('0xfa')],_0x1c98b9[_0xb812('0xfb')]):util[_0xb812('0xaa')](_0xb812('0xfc'),_0x2d3fc0[_0xb812('0xfa')])},client9002)[_0xb812('0x15')](function(_0xac4122){var _0x3ed0cd=_0xac4122&&_0xac4122[_0xb812('0xfd')](_0xb812('0xfe'))>=0x0?!![]:![];logger[_0xb812('0x16')](_0xb812('0xff'),_0x1c98b9['id'],_0x2d3fc0['id'],_0x2d3fc0[_0xb812('0xfa')],_0x3ed0cd?_0xb812('0x100'):_0xb812('0x101'),_0x1c98b9[_0xb812('0xfb')]?_0x1c98b9[_0xb812('0xfb')]:_0xb812('0x102'));return _0x3ed0cd;})['catch'](function(_0xdeffac){logger['error'](_0xb812('0xff'),_0x1c98b9['id'],_0x2d3fc0['id'],_0x2d3fc0['interval'],util[_0xb812('0x103')](_0xdeffac,{'showHidden':![],'depth':null}),_0x1c98b9['timezone']?_0x1c98b9[_0xb812('0xfb')]:_0xb812('0x102'));return![];});}exports[_0xb812('0xf8')]=function(_0x23c066,_0x40f135){var _0x3dbc68=0x0;var _0x100573=0x0;var _0x40735c=![];var _0x6ed7cc;var _0x790f2d;return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x23c066[_0xb812('0x59')]['id']},'include':[{'model':db[_0xb812('0x104')],'as':_0xb812('0x104'),'include':[{'model':db[_0xb812('0x104')],'as':_0xb812('0x105'),'attributes':['id',_0xb812('0xfa')],'raw':!![]}]}]})[_0xb812('0x15')](handleEntityNotFound(_0x40f135,null))[_0xb812('0x15')](function(_0x126fa9){if(_0x126fa9){_0x6ed7cc=_0x126fa9;return _0x126fa9[_0xb812('0x106')]({'raw':!![]});}})[_0xb812('0x15')](function(_0x4701d8){if(_0x6ed7cc){if(_0x4701d8){_0x790f2d=_0x4701d8;}}return require(_0xb812('0x107'))[_0xb812('0x108')]();})[_0xb812('0x15')](function(_0x490713){if(_0x490713){_0x100573=_0x490713[_0xb812('0x109')];_0x40735c=_0x490713[_0xb812('0x71')];}})[_0xb812('0x15')](function(){return db['ChatInteraction'][_0xb812('0x25')]({'where':{'closed':![]}});})[_0xb812('0x15')](function(_0x376974){_0x3dbc68=_0x376974;if(_0x100573&&_0x376974>_0x100573){return db[_0xb812('0x10a')][_0xb812('0x5d')]({'where':{'id':0x1}})['then'](function(_0x4438af){if(_0x4438af){_0x4438af[_0xb812('0x10b')](_0xb812('0x10c'));}});}})[_0xb812('0x15')](function(){if(_0x6ed7cc[_0xb812('0x104')]&&_0x6ed7cc[_0xb812('0x104')][_0xb812('0x105')]){var _0x129aaf=[];for(var _0x2c4720=0x0;_0x2c4720<_0x6ed7cc[_0xb812('0x104')][_0xb812('0x105')][_0xb812('0x3c')];_0x2c4720++){var _0xbe166b=_0x6ed7cc['Interval'][_0xb812('0x105')][_0x2c4720][_0xb812('0x2a')]({'plain':!![]});_0x129aaf['push'](iftimePromise(_0xbe166b,_0x6ed7cc));}return BPromise[_0xb812('0x10d')](_0x129aaf)[_0xb812('0x15')](function(_0x4902ac){return _[_0xb812('0x10e')](_0x4902ac);});}else{return!![];}})['then'](function(_0x20f87b){var _0x4d0a2c=fs[_0xb812('0xcd')](path['join'](config[_0xb812('0x6f')],_0xb812('0x10f')),'utf8');var _0x29172f={'remote':_0x6ed7cc[_0xb812('0x110')],'query':querystring[_0xb812('0x1a')](_[_0xb812('0x45')](_0x6ed7cc['get']({'plain':!![]}),{'customerIp':_0x23c066['headers'][_0xb812('0xa2')]||_0x23c066[_0xb812('0xa1')][_0xb812('0x111')]||_0x23c066[_0xb812('0x112')][_0xb812('0x113')]||_0x23c066['ip'],'referer':_0x23c066[_0xb812('0xa1')][_0xb812('0x114')],'openedInteractions':_0x3dbc68,'maxInteractions':_0x100573,'virtual':_0x40735c[_0xb812('0x109')],'online':_0x20f87b,'custom':_0x40735c}))[_0xb812('0x115')](/'/g,'\x5c\x27')};_0x40f135[_0xb812('0x2e')](ejs[_0xb812('0xd0')](Mustache[_0xb812('0xd0')](_0x4d0a2c,_0x29172f),{'proactiveActions':_0x790f2d,'alignment':_0x6ed7cc['alignment'],'verticalAlignment':_0x6ed7cc[_0xb812('0x116')],'div_color':_0x6ed7cc[_0xb812('0xf5')],'labelText':_0x6ed7cc['labelText'],'text_color':_0x6ed7cc[_0xb812('0x117')],'text_button_color':_0x6ed7cc[_0xb812('0x118')],'button_color':_0x6ed7cc[_0xb812('0x119')],'background_color':_0x6ed7cc['backgroundColor'],'hideWhenOffline':_0x6ed7cc[_0xb812('0x11a')],'interval':_0x6ed7cc[_0xb812('0x11b')]}));})[_0xb812('0x20')](handleError(_0x40f135,null));};exports['addApplications']=function(_0x33a445,_0x26faeb){var _0xd073f=_0x33a445[_0xb812('0x59')]['id'];var _0x3d34fb=_0x33a445[_0xb812('0x4e')];var _0x481acb=0xc8;var _0xb806b=null;return db[_0xb812('0xda')][_0xb812('0x11c')]({'isolationLevel':db[_0xb812('0xda')][_0xb812('0x11d')][_0xb812('0x11e')]['READ_COMMITTED']},function(_0x1b4beb){return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0xd073f},'transaction':_0x1b4beb})[_0xb812('0x15')](function(_0x1d365a){if(_0x1d365a){return db[_0xb812('0x96')]['destroy']({'where':{'ChatWebsiteId':_0xd073f},'transaction':_0x1b4beb})[_0xb812('0x15')](function(){var _0x4ae62e=_[_0xb812('0x32')](_0x3d34fb,function(_0x341a98){_0x341a98[_0xb812('0x5c')]=_0xd073f;return _0x341a98;});return db['ChatApplication'][_0xb812('0xdc')](_0x4ae62e,{'transaction':_0x1b4beb});});}else{_0x481acb=0x194;_0xb806b=[];}});})[_0xb812('0x15')](function(){if(_0x481acb!==0x194){return db[_0xb812('0x96')][_0xb812('0x11f')]({'where':{'ChatWebsiteId':_0xd073f},'order':_0xb812('0x9c')})['then'](function(_0x972968){_0xb806b=_0x972968;});}})[_0xb812('0x20')](function(_0x5d4a09){_0x481acb=0x1f4;logger['error'](_0x5d4a09[_0xb812('0x2c')]);if(_0x5d4a09['name']){delete _0x5d4a09[_0xb812('0x2d')];}_0xb806b=_0x5d4a09;})['finally'](function(){if(_0xb806b===null){_0x26faeb['sendStatus'](_0x481acb);}else{if(_0x481acb===0x1f4){_0x26faeb[_0xb812('0x27')](_0x481acb)[_0xb812('0x2e')](_0xb806b);}else{_0x26faeb[_0xb812('0x27')](_0x481acb)[_0xb812('0x22')](_0xb806b);}}});};exports['getApplications']=function(_0x25ad4a,_0x4d602b){var _0x1f83ca={};var _0x14ef56={};var _0x8bdf5d;var _0x36b7b0;return db['ChatWebsite'][_0xb812('0x5d')]({'where':{'id':_0x25ad4a[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x4d602b,null))[_0xb812('0x15')](function(_0x57f2e3){if(_0x57f2e3){_0x8bdf5d=_0x57f2e3;_0x14ef56[_0xb812('0x35')]=_[_0xb812('0x36')](db[_0xb812('0x96')]['rawAttributes']);_0x14ef56['query']=_[_0xb812('0x36')](_0x25ad4a[_0xb812('0x37')]);_0x14ef56[_0xb812('0x38')]=_['intersection'](_0x14ef56['model'],_0x14ef56[_0xb812('0x37')]);_0x1f83ca[_0xb812('0x3b')]=_[_0xb812('0x39')](_0x14ef56[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x25ad4a[_0xb812('0x37')][_0xb812('0x3a')]));_0x1f83ca['attributes']=_0x1f83ca['attributes'][_0xb812('0x3c')]?_0x1f83ca[_0xb812('0x3b')]:_0x14ef56[_0xb812('0x35')];_0x1f83ca['order']=qs[_0xb812('0x3f')](_0x25ad4a[_0xb812('0x37')][_0xb812('0x3f')]);_0x1f83ca[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x25ad4a[_0xb812('0x37')],_0x14ef56[_0xb812('0x38')]));if(_0x25ad4a[_0xb812('0x37')][_0xb812('0x42')]){_0x1f83ca['where']=_[_0xb812('0x45')](_0x1f83ca[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x1f83ca['attributes'],function(_0x3f2adb){var _0x4bffef={};_0x4bffef[_0x3f2adb]={'$like':'%'+_0x25ad4a[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x4bffef;})});}_0x1f83ca=_['merge']({},_0x1f83ca,_0x25ad4a[_0xb812('0x46')]);return _0x8bdf5d[_0xb812('0x120')](_0x1f83ca);}})[_0xb812('0x15')](function(_0x50d7f7){if(_0x50d7f7){_0x36b7b0=_0x50d7f7[_0xb812('0x3c')];if(!_0x25ad4a['query'][_0xb812('0x3d')](_0xb812('0x3e'))){_0x1f83ca[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x25ad4a['query'][_0xb812('0x24')]);_0x1f83ca[_0xb812('0x26')]=qs['offset'](_0x25ad4a['query'][_0xb812('0x26')]);}return _0x8bdf5d[_0xb812('0x120')](_0x1f83ca);}})[_0xb812('0x15')](function(_0x596cee){if(_0x596cee){return _0x596cee?{'count':_0x36b7b0,'rows':_0x596cee}:null;}})[_0xb812('0x15')](respondWithResult(_0x4d602b,null))['catch'](handleError(_0x4d602b,null));};exports[_0xb812('0x121')]=function(_0x420af5,_0x364695){return db[_0xb812('0x122')][_0xb812('0x4d')]({'where':{'id':_0x420af5[_0xb812('0x59')]['id']}})['then'](handleEntityNotFound(_0x364695,null))['then'](function(_0x261cca){if(_0x261cca){return _0x261cca[_0xb812('0x121')](_0x420af5[_0xb812('0x4e')][_0xb812('0x60')],_[_0xb812('0xf0')](_0x420af5['body'],[_0xb812('0x60'),'id'])||{});}})[_0xb812('0x15')](respondWithResult(_0x364695,null))[_0xb812('0x20')](handleError(_0x364695,null));};exports[_0xb812('0x106')]=function(_0x5061ef,_0x3d5c7c){var _0x3e05f3={};var _0x219452={};var _0x26e6eb;var _0x250f7c;return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x5061ef['params']['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x3d5c7c,null))[_0xb812('0x15')](function(_0x160b54){if(_0x160b54){_0x26e6eb=_0x160b54;_0x219452['model']=_['keys'](db[_0xb812('0x123')][_0xb812('0x4c')]);_0x219452[_0xb812('0x37')]=_['keys'](_0x5061ef[_0xb812('0x37')]);_0x219452[_0xb812('0x38')]=_[_0xb812('0x39')](_0x219452[_0xb812('0x35')],_0x219452[_0xb812('0x37')]);_0x3e05f3[_0xb812('0x3b')]=_['intersection'](_0x219452['model'],qs[_0xb812('0x3a')](_0x5061ef[_0xb812('0x37')]['fields']));_0x3e05f3['attributes']=_0x3e05f3[_0xb812('0x3b')]['length']?_0x3e05f3['attributes']:_0x219452[_0xb812('0x35')];_0x3e05f3[_0xb812('0x64')]=qs[_0xb812('0x3f')](_0x5061ef[_0xb812('0x37')]['sort']);_0x3e05f3[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x5061ef[_0xb812('0x37')],_0x219452[_0xb812('0x38')]));if(_0x5061ef['query']['filter']){_0x3e05f3['where']=_['merge'](_0x3e05f3[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x3e05f3['attributes'],function(_0x60c370){var _0x4fc3d0={};_0x4fc3d0[_0x60c370]={'$like':'%'+_0x5061ef[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x4fc3d0;})});}_0x3e05f3=_[_0xb812('0x45')]({},_0x3e05f3,_0x5061ef[_0xb812('0x46')]);return _0x26e6eb[_0xb812('0x106')](_0x3e05f3);}})[_0xb812('0x15')](function(_0x2f780b){if(_0x2f780b){_0x250f7c=_0x2f780b[_0xb812('0x3c')];if(!_0x5061ef['query'][_0xb812('0x3d')](_0xb812('0x3e'))){_0x3e05f3['limit']=qs['limit'](_0x5061ef[_0xb812('0x37')][_0xb812('0x24')]);_0x3e05f3['offset']=qs[_0xb812('0x26')](_0x5061ef[_0xb812('0x37')]['offset']);}return _0x26e6eb[_0xb812('0x106')](_0x3e05f3);}})[_0xb812('0x15')](function(_0x4e42f2){if(_0x4e42f2){return _0x4e42f2?{'count':_0x250f7c,'rows':_0x4e42f2}:null;}})[_0xb812('0x15')](respondWithResult(_0x3d5c7c,null))[_0xb812('0x20')](handleError(_0x3d5c7c,null));};exports[_0xb812('0x124')]=function(_0x38dd21,_0x401c04){var _0x5b8c57=_0x38dd21[_0xb812('0x37')][_0xb812('0x125')]===_0xb812('0x126')?_0xb812('0x127'):_0xb812('0x128');return db[_0xb812('0x33')][_0xb812('0x4d')]({'attributes':['id',_0x5b8c57],'where':{'id':_0x38dd21[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x401c04,null))['then'](function(_0x1a80cf){if(_0x1a80cf){var _0x5d5152=_0x1a80cf[_0x5b8c57];var _0x5ba97f=_0x5d5152&&_0x5d5152[_0xb812('0x129')]?_0x5d5152[_0xb812('0x129')]:[];_0x401c04['send']({'fromKey':_[_0xb812('0x7e')](_0x5d5152[_0xb812('0x12a')])?undefined:_0x5d5152[_0xb812('0x12a')],'count':_0x5ba97f[_0xb812('0x3c')],'rows':_0x5ba97f});}})[_0xb812('0x20')](handleError(_0x401c04,null));};exports[_0xb812('0x12b')]=function(_0x45d88d,_0x33d17a){var _0xa6e790={'raw':![],'where':{}};var _0xc59ec4={};var _0xe8c692={'count':0x0,'rows':[]};return db[_0xb812('0x33')]['findOne']({'where':{'id':_0x45d88d[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x33d17a,null))['then'](function(_0x4bfd92){if(_0x4bfd92){_0xc59ec4[_0xb812('0x35')]=_[_0xb812('0x36')](db[_0xb812('0xd3')][_0xb812('0x4c')]);_0xc59ec4[_0xb812('0x37')]=_[_0xb812('0x36')](_0x45d88d[_0xb812('0x37')]);_0xc59ec4['filters']=_[_0xb812('0x39')](_0xc59ec4['model'],_0xc59ec4[_0xb812('0x37')]);_0xa6e790['attributes']=_['intersection'](_0xc59ec4[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x45d88d['query'][_0xb812('0x3a')]));_0xa6e790[_0xb812('0x3b')]=_0xa6e790['attributes'][_0xb812('0x3c')]?_0xa6e790[_0xb812('0x3b')]:_0xc59ec4[_0xb812('0x35')];if(!_0x45d88d['query']['hasOwnProperty'](_0xb812('0x3e'))){_0xa6e790[_0xb812('0x24')]=qs[_0xb812('0x24')](_0x45d88d['query']['limit']);_0xa6e790[_0xb812('0x26')]=qs[_0xb812('0x26')](_0x45d88d[_0xb812('0x37')]['offset']);}_0xa6e790[_0xb812('0x64')]=qs['sort'](_0x45d88d[_0xb812('0x37')][_0xb812('0x3f')]);_0xa6e790[_0xb812('0x40')]=qs[_0xb812('0x38')](_[_0xb812('0x41')](_0x45d88d[_0xb812('0x37')],_0xc59ec4[_0xb812('0x38')]));_0xa6e790[_0xb812('0x40')]['ChatWebsiteId']=_0x4bfd92['id'];if(_0x45d88d[_0xb812('0x37')][_0xb812('0x42')]){_0xa6e790['where']=_[_0xb812('0x45')](_0xa6e790[_0xb812('0x40')],{'$or':_['map'](_0xa6e790[_0xb812('0x3b')],function(_0x2a30e2){var _0x3d4eba={};_0x3d4eba[_0x2a30e2]={'$like':'%'+_0x45d88d[_0xb812('0x37')][_0xb812('0x42')]+'%'};return _0x3d4eba;})});}_0xa6e790=_[_0xb812('0x45')]({},_0xa6e790,_0x45d88d[_0xb812('0x46')]);return db[_0xb812('0xd3')][_0xb812('0x25')]({'where':_0xa6e790['where']})[_0xb812('0x15')](function(_0x146eac){_0xe8c692[_0xb812('0x25')]=_0x146eac;if(_0x45d88d['query'][_0xb812('0x47')]){_0xa6e790[_0xb812('0x48')]=[{'all':!![]}];}else{_0xa6e790[_0xb812('0x48')]=[{'model':db[_0xb812('0x93')],'as':'Contact','required':![]},{'model':db[_0xb812('0xdb')],'as':'Attachments','required':![]}];}return db[_0xb812('0xd3')][_0xb812('0x49')](_0xa6e790);})['then'](function(_0x4b6555){_0xe8c692[_0xb812('0x4a')]=_0x4b6555;return _0xe8c692;});}})['then'](respondWithFilteredResult(_0x33d17a,_0xa6e790))[_0xb812('0x20')](handleError(_0x33d17a,null));};exports['addAgents']=function(_0x581422,_0x1be14e){return db[_0xb812('0x33')][_0xb812('0x4d')]({'where':{'id':_0x581422[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x1be14e,null))[_0xb812('0x15')](function(_0x4bad3e){if(_0x4bad3e){return _0x4bad3e[_0xb812('0x12c')](_0x581422[_0xb812('0x4e')]['ids'],_[_0xb812('0xf0')](_0x581422[_0xb812('0x4e')],[_0xb812('0x60'),'id'])||{})['spread'](function(_0x5e2970){for(var _0x5bcb9a=0x0;_0x5bcb9a<_0x581422[_0xb812('0x4e')]['ids'][_0xb812('0x3c')];_0x5bcb9a+=0x1){socket[_0xb812('0x12d')](_0xb812('0x12e'),{'UserId':Number(_0x581422[_0xb812('0x4e')][_0xb812('0x60')][_0x5bcb9a]),'ChatWebsiteId':Number(_0x581422[_0xb812('0x59')]['id'])});}return _0x5e2970;});}})[_0xb812('0x15')](respondWithResult(_0x1be14e,null))[_0xb812('0x20')](handleError(_0x1be14e,null));};exports[_0xb812('0x12f')]=function(_0x7d443a,_0x4c5794){return db['ChatWebsite']['find']({'where':{'id':_0x7d443a[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0x4c5794,null))[_0xb812('0x15')](function(_0x4448f4){if(_0x4448f4){return _0x4448f4['removeAgents'](_0x7d443a[_0xb812('0x37')][_0xb812('0x60')])[_0xb812('0x15')](function(){if(_[_0xb812('0x130')](_0x7d443a[_0xb812('0x37')][_0xb812('0x60')])){for(var _0x3d6c02=0x0;_0x3d6c02<_0x7d443a[_0xb812('0x37')]['ids'][_0xb812('0x3c')];_0x3d6c02+=0x1){socket[_0xb812('0x12d')]('userChatWebsite:remove',{'UserId':Number(_0x7d443a[_0xb812('0x37')]['ids'][_0x3d6c02]),'ChatWebsiteId':Number(_0x7d443a[_0xb812('0x59')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x7d443a['query'][_0xb812('0x60')]),'ChatWebsiteId':Number(_0x7d443a[_0xb812('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c5794,null))[_0xb812('0x20')](handleError(_0x4c5794,null));};exports[_0xb812('0x131')]=function(_0x1fa3e5,_0xee328b){var _0x269e6a={};var _0x1f982b={};var _0x573115;var _0x111733;return db[_0xb812('0x33')][_0xb812('0x5d')]({'where':{'id':_0x1fa3e5[_0xb812('0x59')]['id']}})[_0xb812('0x15')](handleEntityNotFound(_0xee328b,null))[_0xb812('0x15')](function(_0x3141ad){if(_0x3141ad){_0x573115=_0x3141ad;_0x1f982b[_0xb812('0x35')]=_[_0xb812('0x36')](db[_0xb812('0xbc')][_0xb812('0x4c')]);_0x1f982b[_0xb812('0x37')]=_[_0xb812('0x36')](_0x1fa3e5[_0xb812('0x37')]);_0x1f982b[_0xb812('0x38')]=_[_0xb812('0x39')](_0x1f982b[_0xb812('0x35')],_0x1f982b['query']);_0x269e6a['attributes']=_[_0xb812('0x39')](_0x1f982b[_0xb812('0x35')],qs[_0xb812('0x3a')](_0x1fa3e5[_0xb812('0x37')][_0xb812('0x3a')]));_0x269e6a[_0xb812('0x3b')]=_0x269e6a[_0xb812('0x3b')]['length']?_0x269e6a[_0xb812('0x3b')]:_0x1f982b['model'];_0x269e6a[_0xb812('0x64')]=qs[_0xb812('0x3f')](_0x1fa3e5[_0xb812('0x37')][_0xb812('0x3f')]);_0x269e6a[_0xb812('0x40')]=qs['filters'](_[_0xb812('0x41')](_0x1fa3e5['query'],_0x1f982b[_0xb812('0x38')]));if(_0x1fa3e5[_0xb812('0x37')]['filter']){_0x269e6a[_0xb812('0x40')]=_[_0xb812('0x45')](_0x269e6a[_0xb812('0x40')],{'$or':_[_0xb812('0x32')](_0x269e6a['attributes'],function(_0x2c21a2){var _0x39e8da={};_0x39e8da[_0x2c21a2]={'$like':'%'+_0x1fa3e5['query'][_0xb812('0x42')]+'%'};return _0x39e8da;})});}_0x269e6a=_[_0xb812('0x45')]({},_0x269e6a,_0x1fa3e5[_0xb812('0x46')]);return _0x573115[_0xb812('0x131')](_0x269e6a);}})[_0xb812('0x15')](function(_0x8840e6){if(_0x8840e6){_0x111733=_0x8840e6[_0xb812('0x3c')];if(!_0x1fa3e5['query'][_0xb812('0x3d')](_0xb812('0x3e'))){_0x269e6a[_0xb812('0x24')]=qs['limit'](_0x1fa3e5['query'][_0xb812('0x24')]);_0x269e6a[_0xb812('0x26')]=qs['offset'](_0x1fa3e5[_0xb812('0x37')][_0xb812('0x26')]);}return _0x573115[_0xb812('0x131')](_0x269e6a);}})[_0xb812('0x15')](function(_0x497b49){if(_0x497b49){return _0x497b49?{'count':_0x111733,'rows':_0x497b49}:null;}})[_0xb812('0x15')](respondWithResult(_0xee328b,null))['catch'](handleError(_0xee328b,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 3d1feaf..d9d3543 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 _0xc01b=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit'];(function(_0x142ea2,_0x49f3dd){var _0x181e26=function(_0x2bd79c){while(--_0x2bd79c){_0x142ea2['push'](_0x142ea2['shift']());}};_0x181e26(++_0x49f3dd);}(_0xc01b,0x65));var _0xbc01=function(_0x3ebe26,_0x4e880f){_0x3ebe26=_0x3ebe26-0x0;var _0x3e7ac7=_0xc01b[_0x3ebe26];return _0x3e7ac7;};'use strict';var EventEmitter=require(_0xbc01('0x0'));var ChatWebsite=require(_0xbc01('0x1'))['db'][_0xbc01('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbc01('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc01('0x4'),'afterDestroy':_0xbc01('0x5')};function emitEvent(_0x48fa3f){return function(_0x538b32,_0x52b070,_0x17f136){ChatWebsiteEvents[_0xbc01('0x6')](_0x48fa3f+':'+_0x538b32['id'],_0x538b32);ChatWebsiteEvents['emit'](_0x48fa3f,_0x538b32);_0x17f136(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xbc01('0x7')](e,emitEvent(event));}}module[_0xbc01('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x7250=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7250,0x1b1));var _0x0725=function(_0x1829c7,_0x34b9e0){_0x1829c7=_0x1829c7-0x0;var _0x2a76b6=_0x7250[_0x1829c7];return _0x2a76b6;};'use strict';var EventEmitter=require(_0x0725('0x0'));var ChatWebsite=require(_0x0725('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0725('0x2')](0x0);var events={'afterCreate':_0x0725('0x3'),'afterUpdate':_0x0725('0x4'),'afterDestroy':_0x0725('0x5')};function emitEvent(_0x425376){return function(_0x4724ef,_0x53cc59,_0x34a7d5){ChatWebsiteEvents['emit'](_0x425376+':'+_0x4724ef['id'],_0x4724ef);ChatWebsiteEvents['emit'](_0x425376,_0x4724ef);_0x34a7d5(null);};}for(var e in events){if(events[_0x0725('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x0725('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 3e6beb9..bdc6fc7 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 _0x5973=['request-promise','path','rimraf','./chatWebsite.attributes','lodash','../../config/logger','api','bluebird'];(function(_0x4909de,_0x5bc251){var _0x384a9f=function(_0x5226b4){while(--_0x5226b4){_0x4909de['push'](_0x4909de['shift']());}};_0x384a9f(++_0x5bc251);}(_0x5973,0x10c));var _0x3597=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x5973[_0x4aa4af];return _0x3bf44a;};'use strict';var _=require(_0x3597('0x0'));var util=require('util');var logger=require(_0x3597('0x1'))(_0x3597('0x2'));var moment=require('moment');var BPromise=require(_0x3597('0x3'));var rp=require(_0x3597('0x4'));var fs=require('fs');var path=require(_0x3597('0x5'));var rimraf=require(_0x3597('0x6'));var config=require('../../config/environment');var attributes=require(_0x3597('0x7'));module['exports']=function(_0x19e278,_0x2d25cd){return _0x19e278['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9816=['define','ChatWebsite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9816,0x1f0));var _0x6981=function(_0x29a513,_0x364b5d){_0x29a513=_0x29a513-0x0;var _0x1f777b=_0x9816[_0x29a513];return _0x1f777b;};'use strict';var _=require('lodash');var util=require(_0x6981('0x0'));var logger=require(_0x6981('0x1'))(_0x6981('0x2'));var moment=require(_0x6981('0x3'));var BPromise=require(_0x6981('0x4'));var rp=require(_0x6981('0x5'));var fs=require('fs');var path=require(_0x6981('0x6'));var rimraf=require(_0x6981('0x7'));var config=require(_0x6981('0x8'));var attributes=require(_0x6981('0x9'));module[_0x6981('0xa')]=function(_0x265e6c,_0xa4f67c){return _0x265e6c[_0x6981('0xb')](_0x6981('0xc'),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 0fa3e0b..f5d5e64 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 _0x1b5d=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1b5d,0x183));var _0xd1b5=function(_0x5a0b6c,_0x175969){_0x5a0b6c=_0x5a0b6c-0x0;var _0x539441=_0x1b5d[_0x5a0b6c];return _0x539441;};'use strict';var _=require(_0xd1b5('0x0'));var util=require(_0xd1b5('0x1'));var moment=require(_0xd1b5('0x2'));var BPromise=require(_0xd1b5('0x3'));var rs=require(_0xd1b5('0x4'));var fs=require('fs');var Redis=require(_0xd1b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1b5('0x6'));var logger=require('../../config/logger')(_0xd1b5('0x7'));var config=require(_0xd1b5('0x8'));var jayson=require(_0xd1b5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd1b5('0xa')]=_[_0xd1b5('0xb')](config['redis'],{'host':_0xd1b5('0xc'),'port':0x18eb});var socket=require(_0xd1b5('0xd'))(new Redis(config['redis']));require(_0xd1b5('0xe'))[_0xd1b5('0xf')](socket);function respondWithRpcPromise(_0x5d7dd8,_0x1c7d48,_0x41c233){return new BPromise(function(_0x53070c,_0x110800){return client[_0xd1b5('0x10')](_0x5d7dd8,_0x41c233)['then'](function(_0x9dc7fc){logger[_0xd1b5('0x11')](_0xd1b5('0x12'),_0x1c7d48,'request\x20sent');logger[_0xd1b5('0x13')](_0xd1b5('0x14'),_0x1c7d48,'request\x20sent',JSON[_0xd1b5('0x15')](_0x9dc7fc));if(_0x9dc7fc[_0xd1b5('0x16')]){if(_0x9dc7fc[_0xd1b5('0x16')][_0xd1b5('0x17')]===0x1f4){logger['error'](_0xd1b5('0x12'),_0x1c7d48,_0x9dc7fc['error']['message']);return _0x110800(_0x9dc7fc[_0xd1b5('0x16')][_0xd1b5('0x18')]);}logger[_0xd1b5('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1c7d48,_0x9dc7fc[_0xd1b5('0x16')]['message']);return _0x53070c(_0x9dc7fc[_0xd1b5('0x16')]['message']);}else{logger[_0xd1b5('0x11')](_0xd1b5('0x12'),_0x1c7d48,_0xd1b5('0x19'));_0x53070c(_0x9dc7fc['result'][_0xd1b5('0x18')]);}})['catch'](function(_0x20d430){logger['error'](_0xd1b5('0x12'),_0x1c7d48,_0x20d430);_0x110800(_0x20d430);});});} \ No newline at end of file +var _0xc318=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x18c861,_0xd8380){var _0x5be7da=function(_0x886d27){while(--_0x886d27){_0x18c861['push'](_0x18c861['shift']());}};_0x5be7da(++_0xd8380);}(_0xc318,0xb6));var _0x8c31=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc318[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x8c31('0x0'));var util=require(_0x8c31('0x1'));var moment=require(_0x8c31('0x2'));var BPromise=require(_0x8c31('0x3'));var rs=require(_0x8c31('0x4'));var fs=require('fs');var Redis=require(_0x8c31('0x5'));var db=require(_0x8c31('0x6'))['db'];var utils=require(_0x8c31('0x7'));var logger=require(_0x8c31('0x8'))(_0x8c31('0x9'));var config=require(_0x8c31('0xa'));var jayson=require(_0x8c31('0xb'));var client=jayson[_0x8c31('0xc')]['http']({'port':0x232a});config[_0x8c31('0xd')]=_['defaults'](config['redis'],{'host':_0x8c31('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c31('0xd')]));require(_0x8c31('0xf'))[_0x8c31('0x10')](socket);function respondWithRpcPromise(_0x464b17,_0x36c6b3,_0xbe9c5a){return new BPromise(function(_0x3be848,_0x1d8116){return client[_0x8c31('0x11')](_0x464b17,_0xbe9c5a)[_0x8c31('0x12')](function(_0x75cb4){logger[_0x8c31('0x13')](_0x8c31('0x14'),_0x36c6b3,_0x8c31('0x15'));logger[_0x8c31('0x16')](_0x8c31('0x17'),_0x36c6b3,_0x8c31('0x15'),JSON['stringify'](_0x75cb4));if(_0x75cb4[_0x8c31('0x18')]){if(_0x75cb4[_0x8c31('0x18')][_0x8c31('0x19')]===0x1f4){logger[_0x8c31('0x18')](_0x8c31('0x14'),_0x36c6b3,_0x75cb4[_0x8c31('0x18')][_0x8c31('0x1a')]);return _0x1d8116(_0x75cb4[_0x8c31('0x18')][_0x8c31('0x1a')]);}logger[_0x8c31('0x18')](_0x8c31('0x14'),_0x36c6b3,_0x75cb4[_0x8c31('0x18')][_0x8c31('0x1a')]);return _0x3be848(_0x75cb4['error']['message']);}else{logger[_0x8c31('0x13')](_0x8c31('0x14'),_0x36c6b3,_0x8c31('0x15'));_0x3be848(_0x75cb4[_0x8c31('0x1b')][_0x8c31('0x1a')]);}})[_0x8c31('0x1c')](function(_0x4149f7){logger[_0x8c31('0x18')](_0x8c31('0x14'),_0x36c6b3,_0x4149f7);_0x1d8116(_0x4149f7);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7408d20..aefbe9e 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 _0x5587=['update','removeListener','register','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x14bf27,_0x4888c5){var _0x3fbf35=function(_0x2a36e9){while(--_0x2a36e9){_0x14bf27['push'](_0x14bf27['shift']());}};_0x3fbf35(++_0x4888c5);}(_0x5587,0x1ee));var _0x7558=function(_0x3e1a3c,_0x2292fc){_0x3e1a3c=_0x3e1a3c-0x0;var _0x246da8=_0x5587[_0x3e1a3c];return _0x246da8;};'use strict';var ChatWebsiteEvents=require(_0x7558('0x0'));var events=[_0x7558('0x1'),_0x7558('0x2'),_0x7558('0x3')];function createListener(_0x22fa8e,_0x5868f9){return function(_0x47412b){_0x5868f9['emit'](_0x22fa8e,_0x47412b);};}function removeListener(_0x2a953e,_0x2afc0c){return function(){ChatWebsiteEvents[_0x7558('0x4')](_0x2a953e,_0x2afc0c);};}exports[_0x7558('0x5')]=function(_0x506fe5){for(var _0x37124e=0x0,_0x1a754d=events['length'];_0x37124e<_0x1a754d;_0x37124e++){var _0x125e34=events[_0x37124e];var _0x3026df=createListener(_0x7558('0x6')+_0x125e34,_0x506fe5);ChatWebsiteEvents['on'](_0x125e34,_0x3026df);}}; \ No newline at end of file +var _0x1899=['chatWebsite:','remove','update','removeListener','register','length'];(function(_0x4a29b4,_0x6cad7b){var _0x280ffb=function(_0x531666){while(--_0x531666){_0x4a29b4['push'](_0x4a29b4['shift']());}};_0x280ffb(++_0x6cad7b);}(_0x1899,0x79));var _0x9189=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1899[_0x59ee6f];return _0x4c0979;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x9189('0x0'),_0x9189('0x1')];function createListener(_0x401abe,_0x407dac){return function(_0x104198){_0x407dac['emit'](_0x401abe,_0x104198);};}function removeListener(_0x24b6fe,_0xaedbb4){return function(){ChatWebsiteEvents[_0x9189('0x2')](_0x24b6fe,_0xaedbb4);};}exports[_0x9189('0x3')]=function(_0x5be503){for(var _0x5e0c2a=0x0,_0x4c832b=events[_0x9189('0x4')];_0x5e0c2a<_0x4c832b;_0x5e0c2a++){var _0x5a19a1=events[_0x5e0c2a];var _0x4ad3b8=createListener(_0x9189('0x5')+_0x5a19a1,_0x5be503);ChatWebsiteEvents['on'](_0x5a19a1,_0x4ad3b8);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 6932fed..84e74b3 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 _0x837e=['replace','/:id/offline','addInteraction','/:id/applications','addApplications','addAgents','put','/:id','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/system_avatar','getInteractions','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','root','server/files/images/logos/','%s-%s','originalname','/:id/logo','file','addLogo','now','single','addAvatar','join','server/files/images/avatars/','format','/:id/customer_avatar','addCustomerAvatar','diskStorage','addSystemAvatar','/:id/notify','attachments','offline-chat','ensureDir','extname'];(function(_0x18fab5,_0x26cc8f){var _0x4dedae=function(_0x4cf737){while(--_0x4cf737){_0x18fab5['push'](_0x18fab5['shift']());}};_0x4dedae(++_0x26cc8f);}(_0x837e,0x90));var _0xe837=function(_0x5200ec,_0x5401b2){_0x5200ec=_0x5200ec-0x0;var _0x27ab97=_0x837e[_0x5200ec];return _0x27ab97;};'use strict';var multer=require(_0xe837('0x0'));var util=require(_0xe837('0x1'));var path=require(_0xe837('0x2'));var timeout=require(_0xe837('0x3'));var express=require(_0xe837('0x4'));var router=express[_0xe837('0x5')]();var fs_extra=require(_0xe837('0x6'));var auth=require(_0xe837('0x7'));var interaction=require(_0xe837('0x8'));var config=require(_0xe837('0x9'));var controller=require('./chatWebsite.controller');router[_0xe837('0xa')]('/',auth[_0xe837('0xb')](),controller['index']);router['get'](_0xe837('0xc'),auth[_0xe837('0xb')](),controller[_0xe837('0xd')]);router['get']('/:id',auth[_0xe837('0xb')](),controller[_0xe837('0xe')]);router['get'](_0xe837('0xf'),auth[_0xe837('0xb')](),controller['getDispositions']);router[_0xe837('0xa')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller[_0xe837('0x11')]);router['get']('/:id/logo',controller[_0xe837('0x12')]);router[_0xe837('0xa')](_0xe837('0x13'),controller['getAvatar']);router[_0xe837('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xe837('0xa')](_0xe837('0x14'),controller['getSystemAvatar']);router[_0xe837('0xa')]('/:id/interactions',auth[_0xe837('0xb')](),controller[_0xe837('0x15')]);router[_0xe837('0xa')]('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth[_0xe837('0xb')](),controller['getApplications']);router[_0xe837('0xa')](_0xe837('0x16'),auth[_0xe837('0xb')](),controller['getProactiveActions']);router[_0xe837('0xa')](_0xe837('0x17'),controller['getFields']);router[_0xe837('0xa')](_0xe837('0x18'),auth[_0xe837('0xb')](),controller[_0xe837('0x19')]);router[_0xe837('0xa')](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller['getAgents']);router[_0xe837('0x1b')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe837('0x1b')](_0xe837('0xf'),auth[_0xe837('0xb')](),controller[_0xe837('0x1c')]);router[_0xe837('0x1b')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x37595e,_0xdf1739,_0x353189){_0x353189(null,path['join'](config[_0xe837('0x1d')],_0xe837('0x1e')));},'filename':function(_0x128bc1,_0x59c59b,_0xc515d1){_0xc515d1(null,util['format'](_0xe837('0x1f'),Date['now'](),_0x59c59b[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x21'),upload['single'](_0xe837('0x22')),controller[_0xe837('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51fc12,_0x11cfe8,_0x18a954){_0x18a954(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3b73a0,_0x728779,_0x208e2b){_0x208e2b(null,util['format']('%s-%s',Date[_0xe837('0x24')](),_0x728779[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x13'),upload[_0xe837('0x25')](_0xe837('0x22')),controller[_0xe837('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a53ee,_0x3f96fa,_0x5e7e0d){_0x5e7e0d(null,path[_0xe837('0x27')](config['root'],_0xe837('0x28')));},'filename':function(_0x1eda6f,_0x1cc840,_0x5523b2){_0x5523b2(null,util[_0xe837('0x29')](_0xe837('0x1f'),Date[_0xe837('0x24')](),_0x1cc840[_0xe837('0x20')]));}})});router[_0xe837('0x1b')](_0xe837('0x2a'),upload[_0xe837('0x25')](_0xe837('0x22')),controller[_0xe837('0x2b')]);var upload=multer({'storage':multer[_0xe837('0x2c')]({'destination':function(_0x38d555,_0x4fe8bd,_0xb05bca){_0xb05bca(null,path[_0xe837('0x27')](config[_0xe837('0x1d')],_0xe837('0x28')));},'filename':function(_0x533f92,_0x52f361,_0xb1a4fb){_0xb1a4fb(null,util['format'](_0xe837('0x1f'),Date[_0xe837('0x24')](),_0x52f361['originalname']));}})});router[_0xe837('0x1b')](_0xe837('0x14'),upload['single'](_0xe837('0x22')),controller[_0xe837('0x2d')]);router[_0xe837('0x1b')](_0xe837('0x2e'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xe837('0x2c')]({'destination':function(_0x2c7fa0,_0x16230c,_0x26f57c){const _0x30c0c9=path[_0xe837('0x27')](config[_0xe837('0x1d')],'server/files',_0xe837('0x2f'),_0xe837('0x30'));fs_extra[_0xe837('0x31')](_0x30c0c9,function(){_0x26f57c(null,_0x30c0c9);});},'filename':function(_0x202ca3,_0x68022e,_0x3cb680){const _0x12df1d=_0x68022e[_0xe837('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x398dc9=path[_0xe837('0x32')](_0x12df1d);const _0x33d998=Date[_0xe837('0x24')]()+'-'+_0x12df1d[_0xe837('0x33')](_0x398dc9,'')+_0x398dc9;_0x3cb680(null,_0x33d998);}})});router[_0xe837('0x1b')](_0xe837('0x34'),offlineUploadMulter['any'](),controller['offline']);router[_0xe837('0x1b')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xe837('0x35')]);router['post'](_0xe837('0x36'),auth[_0xe837('0xb')](),controller[_0xe837('0x37')]);router[_0xe837('0x1b')]('/:id/proactive_actions',auth[_0xe837('0xb')](),controller['addProactiveActions']);router['post'](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller[_0xe837('0x38')]);router[_0xe837('0x39')](_0xe837('0x3a'),auth[_0xe837('0xb')](),controller['update']);router['delete'](_0xe837('0x3a'),auth[_0xe837('0xb')](),controller[_0xe837('0x3b')]);router[_0xe837('0x3c')](_0xe837('0xf'),auth[_0xe837('0xb')](),controller[_0xe837('0x3d')]);router[_0xe837('0x3c')](_0xe837('0x10'),auth[_0xe837('0xb')](),controller[_0xe837('0x3e')]);router[_0xe837('0x3c')](_0xe837('0x1a'),auth[_0xe837('0xb')](),controller[_0xe837('0x3f')]);module[_0xe837('0x40')]=router; \ No newline at end of file +var _0x292d=['originalname','single','file','addLogo','join','root','%s-%s','addAvatar','server/files/images/avatars/','notify','server/files','attachments','offline-chat','ensureDir','/:id/offline','any','offline','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','now'];(function(_0x4721e4,_0x52615b){var _0x168c20=function(_0x525e1e){while(--_0x525e1e){_0x4721e4['push'](_0x4721e4['shift']());}};_0x168c20(++_0x52615b);}(_0x292d,0x134));var _0xd292=function(_0x55e059,_0x2df2c5){_0x55e059=_0x55e059-0x0;var _0x1e6bb7=_0x292d[_0x55e059];return _0x1e6bb7;};'use strict';var multer=require(_0xd292('0x0'));var util=require(_0xd292('0x1'));var path=require(_0xd292('0x2'));var timeout=require(_0xd292('0x3'));var express=require(_0xd292('0x4'));var router=express[_0xd292('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd292('0x6'));var config=require(_0xd292('0x7'));var controller=require(_0xd292('0x8'));router[_0xd292('0x9')]('/',auth[_0xd292('0xa')](),controller[_0xd292('0xb')]);router['get']('/describe',auth[_0xd292('0xa')](),controller[_0xd292('0xc')]);router[_0xd292('0x9')](_0xd292('0xd'),auth[_0xd292('0xa')](),controller[_0xd292('0xe')]);router['get'](_0xd292('0xf'),auth[_0xd292('0xa')](),controller[_0xd292('0x10')]);router['get'](_0xd292('0x11'),auth[_0xd292('0xa')](),controller['getAnswers']);router[_0xd292('0x9')](_0xd292('0x12'),controller['getLogo']);router[_0xd292('0x9')](_0xd292('0x13'),controller[_0xd292('0x14')]);router['get'](_0xd292('0x15'),controller[_0xd292('0x16')]);router[_0xd292('0x9')]('/:id/system_avatar',controller[_0xd292('0x17')]);router[_0xd292('0x9')](_0xd292('0x18'),auth[_0xd292('0xa')](),controller[_0xd292('0x19')]);router['get'](_0xd292('0x1a'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xd292('0xa')](),controller[_0xd292('0x1b')]);router['get'](_0xd292('0x1c'),auth[_0xd292('0xa')](),controller[_0xd292('0x1d')]);router[_0xd292('0x9')](_0xd292('0x1e'),controller['getFields']);router[_0xd292('0x9')](_0xd292('0x1f'),auth[_0xd292('0xa')](),controller[_0xd292('0x20')]);router[_0xd292('0x9')](_0xd292('0x21'),auth[_0xd292('0xa')](),controller['getAgents']);router[_0xd292('0x22')]('/',auth[_0xd292('0xa')](),controller[_0xd292('0x23')]);router['post'](_0xd292('0xf'),auth[_0xd292('0xa')](),controller[_0xd292('0x24')]);router[_0xd292('0x22')](_0xd292('0x11'),auth['isAuthenticated'](),controller[_0xd292('0x25')]);var upload=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x3719fb,_0x188d70,_0x49e141){_0x49e141(null,path['join'](config['root'],_0xd292('0x27')));},'filename':function(_0x45f17b,_0x43b3ac,_0xf6c15f){_0xf6c15f(null,util[_0xd292('0x28')]('%s-%s',Date[_0xd292('0x29')](),_0x43b3ac[_0xd292('0x2a')]));}})});router[_0xd292('0x22')](_0xd292('0x12'),upload[_0xd292('0x2b')](_0xd292('0x2c')),controller[_0xd292('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5bbb4,_0x2aaa77,_0x4127b5){_0x4127b5(null,path[_0xd292('0x2e')](config[_0xd292('0x2f')],'server/files/images/avatars/'));},'filename':function(_0x107cbb,_0x4ce20f,_0x2f3fed){_0x2f3fed(null,util['format'](_0xd292('0x30'),Date[_0xd292('0x29')](),_0x4ce20f['originalname']));}})});router[_0xd292('0x22')]('/:id/avatar',upload[_0xd292('0x2b')]('file'),controller[_0xd292('0x31')]);var upload=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x3bc015,_0x5316a1,_0x2c75aa){_0x2c75aa(null,path[_0xd292('0x2e')](config[_0xd292('0x2f')],_0xd292('0x32')));},'filename':function(_0x549cff,_0x32af85,_0x4fef45){_0x4fef45(null,util[_0xd292('0x28')](_0xd292('0x30'),Date['now'](),_0x32af85['originalname']));}})});router[_0xd292('0x22')](_0xd292('0x15'),upload[_0xd292('0x2b')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x12f399,_0x187920,_0x185aec){_0x185aec(null,path[_0xd292('0x2e')](config[_0xd292('0x2f')],_0xd292('0x32')));},'filename':function(_0xc99e2c,_0x2832f3,_0x6c8ea5){_0x6c8ea5(null,util[_0xd292('0x28')]('%s-%s',Date[_0xd292('0x29')](),_0x2832f3[_0xd292('0x2a')]));}})});router[_0xd292('0x22')]('/:id/system_avatar',upload[_0xd292('0x2b')](_0xd292('0x2c')),controller['addSystemAvatar']);router[_0xd292('0x22')]('/:id/notify',controller[_0xd292('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xd292('0x26')]({'destination':function(_0x2e020c,_0x395a35,_0xca99ea){const _0x5f3f8b=path[_0xd292('0x2e')](config[_0xd292('0x2f')],_0xd292('0x34'),_0xd292('0x35'),_0xd292('0x36'));fs_extra[_0xd292('0x37')](_0x5f3f8b,function(){_0xca99ea(null,_0x5f3f8b);});},'filename':function(_0x8feb04,_0x50949e,_0x567c70){const _0x164460=_0x50949e[_0xd292('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xa99af5=path['extname'](_0x164460);const _0x501584=Date['now']()+'-'+_0x164460['replace'](_0xa99af5,'')+_0xa99af5;_0x567c70(null,_0x501584);}})});router[_0xd292('0x22')](_0xd292('0x38'),offlineUploadMulter[_0xd292('0x39')](),controller[_0xd292('0x3a')]);router[_0xd292('0x22')](_0xd292('0x18'),auth[_0xd292('0xa')](),controller[_0xd292('0x3b')]);router[_0xd292('0x22')](_0xd292('0x3c'),auth[_0xd292('0xa')](),controller['addApplications']);router[_0xd292('0x22')](_0xd292('0x1c'),auth[_0xd292('0xa')](),controller[_0xd292('0x3d')]);router[_0xd292('0x22')](_0xd292('0x21'),auth[_0xd292('0xa')](),controller[_0xd292('0x3e')]);router[_0xd292('0x3f')](_0xd292('0xd'),auth[_0xd292('0xa')](),controller[_0xd292('0x40')]);router['delete']('/:id',auth[_0xd292('0xa')](),controller[_0xd292('0x41')]);router['delete'](_0xd292('0xf'),auth[_0xd292('0xa')](),controller['removeDispositions']);router[_0xd292('0x42')]('/:id/canned_answers',auth[_0xd292('0xa')](),controller[_0xd292('0x43')]);router[_0xd292('0x42')](_0xd292('0x21'),auth['isAuthenticated'](),controller[_0xd292('0x44')]);module[_0xd292('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 02bec9f..e823182 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d16=['/client-logs','use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d16,0xac));var _0x68d1=function(_0x56db77,_0x36c201){_0x56db77=_0x56db77-0x0;var _0x1536b5=_0x8d16[_0x56db77];return _0x1536b5;};var beaverLogger=require(_0x68d1('0x0'));var express=require('express');var auth=require(_0x68d1('0x1'));var config=require(_0x68d1('0x2'));var router=express[_0x68d1('0x3')]();var isProduction=config['env']===_0x68d1('0x4')||![];function clientSideLogs(_0x159c69,_0x239eb5,_0x350e3d){var _0x227d4b=_0x159c69[_0x68d1('0x5')][_0x68d1('0x6')](_0x68d1('0x7'));if(!_0x227d4b){throw new Error(_0x68d1('0x8'));}return beaverLogger[_0x68d1('0x9')]({'uri':_0x68d1('0xa'),'logger':_0x227d4b,'enableCors':!isProduction})(_0x159c69,_0x239eb5,_0x350e3d);}router[_0x68d1('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x68d1('0xc')]=router; \ No newline at end of file +var _0xa6aa=['Router','env','production','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xa6aa,0x88));var _0xaa6a=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xa6aa[_0x4914e2];return _0x2dcd07;};var beaverLogger=require(_0xaa6a('0x0'));var express=require(_0xaa6a('0x1'));var auth=require(_0xaa6a('0x2'));var config=require(_0xaa6a('0x3'));var router=express[_0xaa6a('0x4')]();var isProduction=config[_0xaa6a('0x5')]===_0xaa6a('0x6')||![];function clientSideLogs(_0x4f1579,_0x409bfe,_0x22dd76){var _0x47c78f=_0x4f1579[_0xaa6a('0x7')][_0xaa6a('0x8')]('client-side-logger');if(!_0x47c78f){throw new Error(_0xaa6a('0x9'));}return beaverLogger[_0xaa6a('0xa')]({'uri':'/client-logs','logger':_0x47c78f,'enableCors':!isProduction})(_0x4f1579,_0x409bfe,_0x22dd76);}router[_0xaa6a('0xb')](auth[_0xaa6a('0xc')](),clientSideLogs);module[_0xaa6a('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 0b99df9..b401a2c 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 _0xff86=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x3dd3b9,_0xe55c40){var _0x1e70f0=function(_0x38a5a5){while(--_0x38a5a5){_0x3dd3b9['push'](_0x3dd3b9['shift']());}};_0x1e70f0(++_0xe55c40);}(_0xff86,0xff));var _0x6ff8=function(_0x360a3b,_0x10b3a6){_0x360a3b=_0x360a3b-0x0;var _0x3a8938=_0xff86[_0x360a3b];return _0x3a8938;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6ff8('0x0')](_0x6ff8('0x1'),_0x6ff8('0x2'),_0x6ff8('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6ff8('0x0')](_0x6ff8('0x4'),_0x6ff8('0x5'))},'data1':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x7')},'data2':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x8')},'data3':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0x9')},'data4':{'type':Sequelize[_0x6ff8('0x6')],'comment':_0x6ff8('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x6ff8('0xb')],'comment':_0x6ff8('0xc')},'data7':{'type':Sequelize[_0x6ff8('0xb')],'comment':_0x6ff8('0xd')}}; \ No newline at end of file +var _0x90c2=['ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x1d3aef,_0x4002ea){var _0xa94a6a=function(_0xd26f4b){while(--_0xd26f4b){_0x1d3aef['push'](_0x1d3aef['shift']());}};_0xa94a6a(++_0x4002ea);}(_0x90c2,0x1a2));var _0x290c=function(_0x5d1f6a,_0xf6481c){_0x5d1f6a=_0x5d1f6a-0x0;var _0x9d09e8=_0x90c2[_0x5d1f6a];return _0x9d09e8;};'use strict';var Sequelize=require(_0x290c('0x0'));module[_0x290c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x290c('0x2')]('AmazonAWS',_0x290c('0x3'),_0x290c('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x290c('0x2')](_0x290c('0x5'),_0x290c('0x6'))},'data1':{'type':Sequelize[_0x290c('0x7')],'comment':_0x290c('0x8')},'data2':{'type':Sequelize[_0x290c('0x7')],'comment':_0x290c('0x9')},'data3':{'type':Sequelize[_0x290c('0x7')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x290c('0x7')],'comment':_0x290c('0xa')},'data5':{'type':Sequelize[_0x290c('0xb')],'comment':_0x290c('0xc')},'data6':{'type':Sequelize[_0x290c('0xb')],'comment':_0x290c('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0x290c('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 37aa1dc..55b4da8 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 _0x09a0=['find','Name\x20parameter\x20not\x20specified','body','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','sendStatus','status','end','json','offset','count','limit','set','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','length'];(function(_0x324642,_0x1adc4e){var _0x16d6f6=function(_0x30d3c5){while(--_0x30d3c5){_0x324642['push'](_0x324642['shift']());}};_0x16d6f6(++_0x1adc4e);}(_0x09a0,0x191));var _0x009a=function(_0x212212,_0x45c310){_0x212212=_0x212212-0x0;var _0x351f5a=_0x09a0[_0x212212];return _0x351f5a;};'use strict';var _=require(_0x009a('0x0'));var Redis=require(_0x009a('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x009a('0x2'));var config=require(_0x009a('0x3'));var logger=require(_0x009a('0x4'))(_0x009a('0x5'));var db=require(_0x009a('0x6'))['db'];var oauth=require(_0x009a('0x7'));config['redis']=_[_0x009a('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x009a('0x9')]);function respondWithStatusCode(_0x347559,_0x4770ce){_0x4770ce=_0x4770ce||0xcc;return function(_0x545155){if(_0x545155){return _0x347559[_0x009a('0xa')](_0x4770ce);}return _0x347559[_0x009a('0xb')](_0x4770ce)[_0x009a('0xc')]();};}function respondWithResult(_0x50e3c1,_0x31bb9d){_0x31bb9d=_0x31bb9d||0xc8;return function(_0x473512){if(_0x473512){return _0x50e3c1['status'](_0x31bb9d)[_0x009a('0xd')](_0x473512);}};}function respondWithFilteredResult(_0x318ea1,_0x5d48b3){return function(_0x5addfd){if(_0x5addfd){var _0x511b81=typeof _0x5d48b3[_0x009a('0xe')]==='undefined'&&typeof _0x5d48b3['limit']==='undefined';var _0x62b735=_0x5addfd[_0x009a('0xf')];var _0x41c02a=_0x511b81?0x0:_0x5d48b3['offset'];var _0x10897b=_0x511b81?_0x5addfd['count']:_0x5d48b3['offset']+_0x5d48b3[_0x009a('0x10')];var _0x1316f7;if(_0x10897b>=_0x62b735){_0x10897b=_0x62b735;_0x1316f7=0xc8;}else{_0x1316f7=0xce;}_0x318ea1[_0x009a('0xb')](_0x1316f7);return _0x318ea1[_0x009a('0x11')](_0x009a('0x12'),_0x41c02a+'-'+_0x10897b+'/'+_0x62b735)[_0x009a('0xd')](_0x5addfd);}return null;};}function saveUpdates(_0x1643ad){return function(_0x7d7837){if(_0x7d7837){return _0x7d7837[_0x009a('0x13')](_0x1643ad)[_0x009a('0x14')](function(_0xeccff){return _0xeccff;});}return null;};}function removeEntity(_0x10677e){return function(_0x5acc9f){if(_0x5acc9f){return _0x5acc9f[_0x009a('0x15')]()['then'](function(){_0x10677e[_0x009a('0xb')](0xcc)[_0x009a('0xc')]();});}};}function handleEntityNotFound(_0x29bfbe){return function(_0x2e7f14){if(!_0x2e7f14){_0x29bfbe['sendStatus'](0x194);}return _0x2e7f14;};}function handleError(_0xd66d51,_0x30cf18){_0x30cf18=_0x30cf18||0x1f4;return function(_0x2f0b3c){logger[_0x009a('0x16')](_0x2f0b3c['stack']);if(_0x2f0b3c[_0x009a('0x17')]){delete _0x2f0b3c[_0x009a('0x17')];}_0xd66d51[_0x009a('0xb')](_0x30cf18)[_0x009a('0x18')](_0x2f0b3c);};}function maskClientSecret(_0x527506){return _[_0x009a('0x19')](_0x527506[_0x009a('0x1a')](0x0,0x3),0x14,'*');}exports[_0x009a('0x1b')]=function(_0x5ab2a4,_0x2c8b3a){var _0x1381de={},_0x10fa70={},_0x12ff93={'count':0x0,'rows':[]};var _0x3dc4fb=_[_0x009a('0x1c')](db[_0x009a('0x1d')][_0x009a('0x1e')],function(_0x22160f){return{'name':_0x22160f[_0x009a('0x1f')],'type':_0x22160f[_0x009a('0x20')][_0x009a('0x21')]};});_0x10fa70['model']=_[_0x009a('0x1c')](_0x3dc4fb,_0x009a('0x17'));_0x10fa70[_0x009a('0x22')]=_[_0x009a('0x23')](_0x5ab2a4['query']);_0x10fa70[_0x009a('0x24')]=_[_0x009a('0x25')](_0x10fa70[_0x009a('0x26')],_0x10fa70[_0x009a('0x22')]);_0x1381de[_0x009a('0x27')]=_[_0x009a('0x25')](_0x10fa70[_0x009a('0x26')],qs['fields'](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x28')]));_0x1381de['attributes']=_0x1381de[_0x009a('0x27')]['length']?_0x1381de['attributes']:_0x10fa70[_0x009a('0x26')];if(!_0x5ab2a4[_0x009a('0x22')][_0x009a('0x29')](_0x009a('0x2a'))){_0x1381de[_0x009a('0x10')]=qs['limit'](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x10')]);_0x1381de[_0x009a('0xe')]=qs[_0x009a('0xe')](_0x5ab2a4[_0x009a('0x22')][_0x009a('0xe')]);}_0x1381de['order']=qs[_0x009a('0x2b')](_0x5ab2a4[_0x009a('0x22')][_0x009a('0x2b')]);_0x1381de['where']=qs[_0x009a('0x24')](_['pick'](_0x5ab2a4[_0x009a('0x22')],_0x10fa70['filters']),_0x3dc4fb);if(_0x5ab2a4['query'][_0x009a('0x2c')]){_0x1381de[_0x009a('0x2d')]=_[_0x009a('0x2e')](_0x1381de['where'],{'$or':_[_0x009a('0x1c')](_0x3dc4fb,function(_0x57603e){if(_0x57603e[_0x009a('0x20')]!==_0x009a('0x2f')){var _0x2c27fc={};_0x2c27fc[_0x57603e[_0x009a('0x17')]]={'$like':'%'+_0x5ab2a4[_0x009a('0x22')][_0x009a('0x2c')]+'%'};return _0x2c27fc;}})});}_0x1381de=_[_0x009a('0x2e')]({},_0x1381de,_0x5ab2a4[_0x009a('0x30')]);var _0x37312d={'where':_0x1381de[_0x009a('0x2d')]};return db[_0x009a('0x1d')][_0x009a('0xf')](_0x37312d)[_0x009a('0x14')](function(_0x11f701){_0x12ff93[_0x009a('0xf')]=_0x11f701;if(_0x5ab2a4[_0x009a('0x22')][_0x009a('0x31')]){_0x1381de['include']=[{'all':!![]}];}return db[_0x009a('0x1d')][_0x009a('0x32')](_0x1381de);})[_0x009a('0x14')](function(_0x98012e){_0x12ff93['rows']=_[_0x009a('0x1c')](_0x98012e,function(_0x43ea5b){if(_0x43ea5b[_0x009a('0x33')]===_0x009a('0x34')){var _0x45241e=encryptor[_0x009a('0x35')](_0x43ea5b['data3']);_0x43ea5b[_0x009a('0x36')]=maskClientSecret(_0x45241e);}return _0x43ea5b;});return _0x12ff93;})[_0x009a('0x14')](respondWithFilteredResult(_0x2c8b3a,_0x1381de))[_0x009a('0x37')](handleError(_0x2c8b3a,null));};exports[_0x009a('0x38')]=function(_0x2a97a6,_0x2c4aa6){var _0x4d923f={'raw':!![],'where':{'id':_0x2a97a6[_0x009a('0x39')]['id']}},_0x40d44e={};_0x40d44e[_0x009a('0x26')]=_[_0x009a('0x23')](db['CloudProvider'][_0x009a('0x1e')]);_0x40d44e[_0x009a('0x22')]=_[_0x009a('0x23')](_0x2a97a6['query']);_0x40d44e['filters']=_[_0x009a('0x25')](_0x40d44e[_0x009a('0x26')],_0x40d44e['query']);_0x4d923f[_0x009a('0x27')]=_['intersection'](_0x40d44e[_0x009a('0x26')],qs[_0x009a('0x28')](_0x2a97a6[_0x009a('0x22')][_0x009a('0x28')]));_0x4d923f['attributes']=_0x4d923f['attributes'][_0x009a('0x3a')]?_0x4d923f[_0x009a('0x27')]:_0x40d44e[_0x009a('0x26')];if(_0x2a97a6[_0x009a('0x22')][_0x009a('0x31')]){_0x4d923f['include']=[{'all':!![]}];}_0x4d923f=_['merge']({},_0x4d923f,_0x2a97a6[_0x009a('0x30')]);return db[_0x009a('0x1d')][_0x009a('0x3b')](_0x4d923f)['then'](handleEntityNotFound(_0x2c4aa6,null))[_0x009a('0x14')](function(_0x565175){if(_0x565175[_0x009a('0x33')]==='MicrosoftAzure'){var _0x3be605=encryptor[_0x009a('0x35')](_0x565175[_0x009a('0x36')]);_0x565175[_0x009a('0x36')]=maskClientSecret(_0x3be605);}return _0x565175;})[_0x009a('0x14')](respondWithResult(_0x2c4aa6,null))['catch'](handleError(_0x2c4aa6,null));};exports['create']=function(_0x2de557,_0x1c77fc){if(!_0x2de557['body'][_0x009a('0x17')])throw new Error(_0x009a('0x3c'));if(!_0x2de557[_0x009a('0x3d')][_0x009a('0x33')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x22bfa0=db[_0x009a('0x1d')][_0x009a('0x1e')][_0x009a('0x33')][_0x009a('0x3e')];if(!_0x22bfa0['includes'](_0x2de557['body'][_0x009a('0x33')]))throw new Error(_0x009a('0x3f')+_0x22bfa0[_0x009a('0x40')](',\x20'));if(_0x2de557['body'][_0x009a('0x33')]===_0x009a('0x34')&&_0x2de557['body'][_0x009a('0x36')]){_0x2de557[_0x009a('0x3d')][_0x009a('0x36')]=encryptor['encryptString'](_0x2de557['body'][_0x009a('0x36')]);}return db[_0x009a('0x1d')]['create'](_0x2de557[_0x009a('0x3d')],{})[_0x009a('0x14')](respondWithResult(_0x1c77fc,0xc9))[_0x009a('0x37')](handleError(_0x1c77fc,null));};exports[_0x009a('0x13')]=function(_0xed6156,_0x3ddb8e){if(_0xed6156['body']['id']){delete _0xed6156[_0x009a('0x3d')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0xed6156[_0x009a('0x39')]['id']}})[_0x009a('0x14')](handleEntityNotFound(_0x3ddb8e,null))['then'](function(_0x235f2f){if(_0x235f2f[_0x009a('0x33')]===_0x009a('0x34')&&_0xed6156['body'][_0x009a('0x36')]){_0xed6156[_0x009a('0x3d')][_0x009a('0x36')]=encryptor[_0x009a('0x41')](_0xed6156[_0x009a('0x3d')][_0x009a('0x36')]);}return _0x235f2f;})[_0x009a('0x14')](saveUpdates(_0xed6156['body'],null))[_0x009a('0x14')](respondWithResult(_0x3ddb8e,null))[_0x009a('0x37')](handleError(_0x3ddb8e,null));};exports['destroy']=function(_0x45e8bb,_0x23c94b){return db[_0x009a('0x1d')]['find']({'where':{'id':_0x45e8bb[_0x009a('0x39')]['id']}})['then'](handleEntityNotFound(_0x23c94b,null))[_0x009a('0x14')](removeEntity(_0x23c94b,null))[_0x009a('0x37')](handleError(_0x23c94b,null));};exports[_0x009a('0x42')]=function(_0x42c4e1,_0x6bb874){return db[_0x009a('0x1d')]['findOne']({'where':{'id':_0x42c4e1[_0x009a('0x39')]['id']},'raw':!![]})[_0x009a('0x14')](function(_0x5d1bcd){if(!_0x5d1bcd)return _0x6bb874[_0x009a('0xa')](0x194);return{'url':oauth[_0x009a('0x43')](_0x5d1bcd,_0x42c4e1['user']['id'])};})[_0x009a('0x14')](respondWithResult(_0x6bb874,null))[_0x009a('0x37')](handleError(_0x6bb874,null));};exports[_0x009a('0x44')]=function(_0x535c63,_0x291286){var _0x13593c=_0x535c63[_0x009a('0x3d')];var _0x1ebeaa;var _0x3d0121;if(_0x13593c[_0x009a('0x16')])throw _0x13593c;redis[_0x009a('0x45')](_0x13593c['state'])[_0x009a('0x14')](function(_0x2980bc){if(!_0x2980bc)throw new Error(_0x009a('0x46'));_0x1ebeaa=JSON[_0x009a('0x47')](_0x2980bc);var _0x297e94=Buffer[_0x009a('0x48')](_0x13593c[_0x009a('0x49')],'base64')[_0x009a('0x4a')](_0x009a('0x4b'));_0x3d0121=JSON[_0x009a('0x47')](_0x297e94);if(!oauth[_0x009a('0x4c')](_0x13593c[_0x009a('0x4d')],_0x1ebeaa[_0x009a('0x4e')]))throw new Error(_0x009a('0x4f'));redis['del'](_0x13593c['state']);return oauth[_0x009a('0x50')](_0x13593c[_0x009a('0x51')],_0x1ebeaa);})[_0x009a('0x14')](function(_0x2a3a72){_0x1ebeaa[_0x009a('0x52')]=_0x2a3a72['access_token'];_0x1ebeaa[_0x009a('0x53')]=_0x2a3a72[_0x009a('0x54')];return db['CloudProvider']['update']({'data5':_0x1ebeaa['data5'],'data6':_0x1ebeaa[_0x009a('0x53')]},{'where':{'id':_0x1ebeaa['id']}});})[_0x009a('0x14')](function(){oauth[_0x009a('0x55')](_0x1ebeaa);socket['emit'](_0x009a('0x56'),{'id':_0x3d0121['id']});return;})[_0x009a('0x14')](respondWithStatusCode(_0x291286,null))['catch'](function(_0x5d9796){if(_0x3d0121){socket[_0x009a('0x57')]('microsoftAuthorization:error',{'id':_0x3d0121['id']});}if(!_0x1ebeaa){logger[_0x009a('0x16')](_0x009a('0x58'),_0x5d9796);return _0x291286[_0x009a('0xb')](0x1f4)[_0x009a('0x18')](_0x5d9796[_0x009a('0x59')]);}logger[_0x009a('0x16')](_0x009a('0x5a'),_0x1ebeaa['id'],JSON[_0x009a('0x5b')](_0x5d9796));});}; \ No newline at end of file +var _0x0b20=['sort','where','pick','VIRTUAL','filter','merge','options','then','include','findAll','rows','MicrosoftAzure','decryptString','data3','show','includeAll','find','service','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','data6','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','order'];(function(_0x485d2c,_0x4a841a){var _0x41308c=function(_0x22e5e1){while(--_0x22e5e1){_0x485d2c['push'](_0x485d2c['shift']());}};_0x41308c(++_0x4a841a);}(_0x0b20,0xe8));var _0x00b2=function(_0x484c46,_0x1b2295){_0x484c46=_0x484c46-0x0;var _0x225ff1=_0x0b20[_0x484c46];return _0x225ff1;};'use strict';var _=require(_0x00b2('0x0'));var Redis=require(_0x00b2('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x00b2('0x2'));var config=require('../../config/environment');var logger=require(_0x00b2('0x3'))(_0x00b2('0x4'));var db=require(_0x00b2('0x5'))['db'];var oauth=require(_0x00b2('0x6'));config[_0x00b2('0x7')]=_[_0x00b2('0x8')](config['redis'],{'host':_0x00b2('0x9'),'port':0x18eb});var socket=require(_0x00b2('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x00b2('0x7')]);function respondWithStatusCode(_0x1136e2,_0x13657c){_0x13657c=_0x13657c||0xcc;return function(_0x27b797){if(_0x27b797){return _0x1136e2['sendStatus'](_0x13657c);}return _0x1136e2[_0x00b2('0xb')](_0x13657c)[_0x00b2('0xc')]();};}function respondWithResult(_0x3fbb1e,_0x24c15f){_0x24c15f=_0x24c15f||0xc8;return function(_0x4f217c){if(_0x4f217c){return _0x3fbb1e['status'](_0x24c15f)[_0x00b2('0xd')](_0x4f217c);}};}function respondWithFilteredResult(_0x46b5ac,_0x2d1eff){return function(_0x49796e){if(_0x49796e){var _0x25c775=typeof _0x2d1eff[_0x00b2('0xe')]===_0x00b2('0xf')&&typeof _0x2d1eff[_0x00b2('0x10')]===_0x00b2('0xf');var _0x257ee7=_0x49796e[_0x00b2('0x11')];var _0x3c464e=_0x25c775?0x0:_0x2d1eff[_0x00b2('0xe')];var _0x30b528=_0x25c775?_0x49796e['count']:_0x2d1eff['offset']+_0x2d1eff[_0x00b2('0x10')];var _0x22c816;if(_0x30b528>=_0x257ee7){_0x30b528=_0x257ee7;_0x22c816=0xc8;}else{_0x22c816=0xce;}_0x46b5ac[_0x00b2('0xb')](_0x22c816);return _0x46b5ac[_0x00b2('0x12')](_0x00b2('0x13'),_0x3c464e+'-'+_0x30b528+'/'+_0x257ee7)[_0x00b2('0xd')](_0x49796e);}return null;};}function saveUpdates(_0x1cc679){return function(_0x3e505a){if(_0x3e505a){return _0x3e505a[_0x00b2('0x14')](_0x1cc679)['then'](function(_0x4332fb){return _0x4332fb;});}return null;};}function removeEntity(_0x2a9ff0){return function(_0x121d42){if(_0x121d42){return _0x121d42['destroy']()['then'](function(){_0x2a9ff0[_0x00b2('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x506448){return function(_0x293546){if(!_0x293546){_0x506448['sendStatus'](0x194);}return _0x293546;};}function handleError(_0x22eb83,_0x52afe7){_0x52afe7=_0x52afe7||0x1f4;return function(_0x49078e){logger[_0x00b2('0x15')](_0x49078e['stack']);if(_0x49078e[_0x00b2('0x16')]){delete _0x49078e[_0x00b2('0x16')];}_0x22eb83[_0x00b2('0xb')](_0x52afe7)[_0x00b2('0x17')](_0x49078e);};}function maskClientSecret(_0x4d2e2f){return _[_0x00b2('0x18')](_0x4d2e2f[_0x00b2('0x19')](0x0,0x3),0x14,'*');}exports[_0x00b2('0x1a')]=function(_0x496653,_0x23f4d0){var _0x34d138={},_0x278302={},_0x8a2513={'count':0x0,'rows':[]};var _0xd071ee=_[_0x00b2('0x1b')](db[_0x00b2('0x1c')][_0x00b2('0x1d')],function(_0x596558){return{'name':_0x596558[_0x00b2('0x1e')],'type':_0x596558[_0x00b2('0x1f')][_0x00b2('0x20')]};});_0x278302['model']=_[_0x00b2('0x1b')](_0xd071ee,_0x00b2('0x16'));_0x278302['query']=_[_0x00b2('0x21')](_0x496653[_0x00b2('0x22')]);_0x278302[_0x00b2('0x23')]=_[_0x00b2('0x24')](_0x278302['model'],_0x278302[_0x00b2('0x22')]);_0x34d138[_0x00b2('0x25')]=_['intersection'](_0x278302[_0x00b2('0x26')],qs[_0x00b2('0x27')](_0x496653[_0x00b2('0x22')][_0x00b2('0x27')]));_0x34d138[_0x00b2('0x25')]=_0x34d138['attributes']['length']?_0x34d138[_0x00b2('0x25')]:_0x278302[_0x00b2('0x26')];if(!_0x496653[_0x00b2('0x22')]['hasOwnProperty']('nolimit')){_0x34d138[_0x00b2('0x10')]=qs[_0x00b2('0x10')](_0x496653[_0x00b2('0x22')][_0x00b2('0x10')]);_0x34d138[_0x00b2('0xe')]=qs[_0x00b2('0xe')](_0x496653[_0x00b2('0x22')][_0x00b2('0xe')]);}_0x34d138[_0x00b2('0x28')]=qs['sort'](_0x496653[_0x00b2('0x22')][_0x00b2('0x29')]);_0x34d138[_0x00b2('0x2a')]=qs[_0x00b2('0x23')](_[_0x00b2('0x2b')](_0x496653[_0x00b2('0x22')],_0x278302[_0x00b2('0x23')]),_0xd071ee);if(_0x496653[_0x00b2('0x22')]['filter']){_0x34d138['where']=_['merge'](_0x34d138[_0x00b2('0x2a')],{'$or':_[_0x00b2('0x1b')](_0xd071ee,function(_0x1d3bdd){if(_0x1d3bdd['type']!==_0x00b2('0x2c')){var _0xea7172={};_0xea7172[_0x1d3bdd[_0x00b2('0x16')]]={'$like':'%'+_0x496653[_0x00b2('0x22')][_0x00b2('0x2d')]+'%'};return _0xea7172;}})});}_0x34d138=_[_0x00b2('0x2e')]({},_0x34d138,_0x496653[_0x00b2('0x2f')]);var _0xf1a7a1={'where':_0x34d138[_0x00b2('0x2a')]};return db['CloudProvider'][_0x00b2('0x11')](_0xf1a7a1)[_0x00b2('0x30')](function(_0xe074fb){_0x8a2513[_0x00b2('0x11')]=_0xe074fb;if(_0x496653[_0x00b2('0x22')]['includeAll']){_0x34d138[_0x00b2('0x31')]=[{'all':!![]}];}return db[_0x00b2('0x1c')][_0x00b2('0x32')](_0x34d138);})[_0x00b2('0x30')](function(_0x57af2c){_0x8a2513[_0x00b2('0x33')]=_[_0x00b2('0x1b')](_0x57af2c,function(_0x28ea64){if(_0x28ea64['service']===_0x00b2('0x34')){var _0x294b1a=encryptor[_0x00b2('0x35')](_0x28ea64[_0x00b2('0x36')]);_0x28ea64[_0x00b2('0x36')]=maskClientSecret(_0x294b1a);}return _0x28ea64;});return _0x8a2513;})[_0x00b2('0x30')](respondWithFilteredResult(_0x23f4d0,_0x34d138))['catch'](handleError(_0x23f4d0,null));};exports[_0x00b2('0x37')]=function(_0x5652e9,_0x58e279){var _0x8b2997={'raw':!![],'where':{'id':_0x5652e9['params']['id']}},_0x226e67={};_0x226e67[_0x00b2('0x26')]=_['keys'](db[_0x00b2('0x1c')]['rawAttributes']);_0x226e67[_0x00b2('0x22')]=_['keys'](_0x5652e9[_0x00b2('0x22')]);_0x226e67[_0x00b2('0x23')]=_[_0x00b2('0x24')](_0x226e67[_0x00b2('0x26')],_0x226e67[_0x00b2('0x22')]);_0x8b2997[_0x00b2('0x25')]=_['intersection'](_0x226e67['model'],qs[_0x00b2('0x27')](_0x5652e9[_0x00b2('0x22')][_0x00b2('0x27')]));_0x8b2997[_0x00b2('0x25')]=_0x8b2997['attributes']['length']?_0x8b2997[_0x00b2('0x25')]:_0x226e67[_0x00b2('0x26')];if(_0x5652e9[_0x00b2('0x22')][_0x00b2('0x38')]){_0x8b2997[_0x00b2('0x31')]=[{'all':!![]}];}_0x8b2997=_[_0x00b2('0x2e')]({},_0x8b2997,_0x5652e9[_0x00b2('0x2f')]);return db[_0x00b2('0x1c')][_0x00b2('0x39')](_0x8b2997)[_0x00b2('0x30')](handleEntityNotFound(_0x58e279,null))['then'](function(_0x403867){if(_0x403867[_0x00b2('0x3a')]===_0x00b2('0x34')){var _0x30681f=encryptor[_0x00b2('0x35')](_0x403867[_0x00b2('0x36')]);_0x403867[_0x00b2('0x36')]=maskClientSecret(_0x30681f);}return _0x403867;})['then'](respondWithResult(_0x58e279,null))[_0x00b2('0x3b')](handleError(_0x58e279,null));};exports[_0x00b2('0x3c')]=function(_0x1b6d3c,_0x1be2ed){if(!_0x1b6d3c[_0x00b2('0x3d')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1b6d3c[_0x00b2('0x3d')][_0x00b2('0x3a')])throw new Error(_0x00b2('0x3e'));var _0x3c5f42=db[_0x00b2('0x1c')][_0x00b2('0x1d')][_0x00b2('0x3a')][_0x00b2('0x3f')];if(!_0x3c5f42[_0x00b2('0x40')](_0x1b6d3c['body'][_0x00b2('0x3a')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3c5f42[_0x00b2('0x41')](',\x20'));if(_0x1b6d3c['body'][_0x00b2('0x3a')]===_0x00b2('0x34')&&_0x1b6d3c[_0x00b2('0x3d')][_0x00b2('0x36')]){_0x1b6d3c[_0x00b2('0x3d')][_0x00b2('0x36')]=encryptor[_0x00b2('0x42')](_0x1b6d3c['body'][_0x00b2('0x36')]);}return db['CloudProvider']['create'](_0x1b6d3c[_0x00b2('0x3d')],{})[_0x00b2('0x30')](respondWithResult(_0x1be2ed,0xc9))[_0x00b2('0x3b')](handleError(_0x1be2ed,null));};exports['update']=function(_0x499fc4,_0x220433){if(_0x499fc4['body']['id']){delete _0x499fc4['body']['id'];}return db[_0x00b2('0x1c')][_0x00b2('0x39')]({'where':{'id':_0x499fc4[_0x00b2('0x43')]['id']}})[_0x00b2('0x30')](handleEntityNotFound(_0x220433,null))[_0x00b2('0x30')](function(_0xdc9b52){if(_0xdc9b52[_0x00b2('0x3a')]==='MicrosoftAzure'&&_0x499fc4[_0x00b2('0x3d')][_0x00b2('0x36')]){_0x499fc4['body'][_0x00b2('0x36')]=encryptor[_0x00b2('0x42')](_0x499fc4[_0x00b2('0x3d')][_0x00b2('0x36')]);}return _0xdc9b52;})[_0x00b2('0x30')](saveUpdates(_0x499fc4['body'],null))[_0x00b2('0x30')](respondWithResult(_0x220433,null))['catch'](handleError(_0x220433,null));};exports['destroy']=function(_0x2d9a5f,_0xa20362){return db[_0x00b2('0x1c')]['find']({'where':{'id':_0x2d9a5f[_0x00b2('0x43')]['id']}})['then'](handleEntityNotFound(_0xa20362,null))[_0x00b2('0x30')](removeEntity(_0xa20362,null))[_0x00b2('0x3b')](handleError(_0xa20362,null));};exports[_0x00b2('0x44')]=function(_0xa5f3c4,_0x3efc80){return db[_0x00b2('0x1c')]['findOne']({'where':{'id':_0xa5f3c4[_0x00b2('0x43')]['id']},'raw':!![]})[_0x00b2('0x30')](function(_0x3d2a8b){if(!_0x3d2a8b)return _0x3efc80['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3d2a8b,_0xa5f3c4['user']['id'])};})['then'](respondWithResult(_0x3efc80,null))[_0x00b2('0x3b')](handleError(_0x3efc80,null));};exports[_0x00b2('0x45')]=function(_0xd51740,_0x42988f){var _0x11c8aa=_0xd51740[_0x00b2('0x3d')];var _0x16043c;var _0x1e0070;if(_0x11c8aa[_0x00b2('0x15')])throw _0x11c8aa;redis[_0x00b2('0x46')](_0x11c8aa[_0x00b2('0x47')])[_0x00b2('0x30')](function(_0xb34f1b){if(!_0xb34f1b)throw new Error(_0x00b2('0x48'));_0x16043c=JSON[_0x00b2('0x49')](_0xb34f1b);var _0x409398=Buffer[_0x00b2('0x4a')](_0x11c8aa['state'],_0x00b2('0x4b'))[_0x00b2('0x4c')](_0x00b2('0x4d'));_0x1e0070=JSON[_0x00b2('0x49')](_0x409398);if(!oauth['isValidIdToken'](_0x11c8aa[_0x00b2('0x4e')],_0x16043c[_0x00b2('0x4f')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x00b2('0x50')](_0x11c8aa[_0x00b2('0x47')]);return oauth[_0x00b2('0x51')](_0x11c8aa[_0x00b2('0x52')],_0x16043c);})[_0x00b2('0x30')](function(_0x3a3390){_0x16043c['data5']=_0x3a3390[_0x00b2('0x53')];_0x16043c['data6']=_0x3a3390[_0x00b2('0x54')];return db['CloudProvider']['update']({'data5':_0x16043c['data5'],'data6':_0x16043c[_0x00b2('0x55')]},{'where':{'id':_0x16043c['id']}});})[_0x00b2('0x30')](function(){oauth['startRefreshInterval'](_0x16043c);socket['emit']('microsoftAuthorization:success',{'id':_0x1e0070['id']});return;})[_0x00b2('0x30')](respondWithStatusCode(_0x42988f,null))[_0x00b2('0x3b')](function(_0x12ec4e){if(_0x1e0070){socket['emit'](_0x00b2('0x56'),{'id':_0x1e0070['id']});}if(!_0x16043c){logger[_0x00b2('0x15')](_0x00b2('0x57'),_0x12ec4e);return _0x42988f['status'](0x1f4)[_0x00b2('0x17')](_0x12ec4e[_0x00b2('0x58')]);}logger['error'](_0x00b2('0x59'),_0x16043c['id'],JSON[_0x00b2('0x5a')](_0x12ec4e));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 485d8b8..837dc56 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 _0xf57e=['path','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','api','moment'];(function(_0x2391d5,_0x1073a5){var _0x1387b1=function(_0x38e514){while(--_0x38e514){_0x2391d5['push'](_0x2391d5['shift']());}};_0x1387b1(++_0x1073a5);}(_0xf57e,0xa6));var _0xef57=function(_0x1066e1,_0x433c9d){_0x1066e1=_0x1066e1-0x0;var _0x83cf2f=_0xf57e[_0x1066e1];return _0x83cf2f;};'use strict';var _=require(_0xef57('0x0'));var util=require(_0xef57('0x1'));var logger=require('../../config/logger')(_0xef57('0x2'));var moment=require(_0xef57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xef57('0x4'));var rimraf=require('rimraf');var config=require(_0xef57('0x5'));var attributes=require(_0xef57('0x6'));module[_0xef57('0x7')]=function(_0x1b9591,_0x1715f1){return _0x1b9591[_0xef57('0x8')]('CloudProvider',attributes,{'tableName':_0xef57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e29=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash'];(function(_0x992c91,_0x5d8313){var _0x504c90=function(_0x2fcd84){while(--_0x2fcd84){_0x992c91['push'](_0x992c91['shift']());}};_0x504c90(++_0x5d8313);}(_0x2e29,0x185));var _0x92e2=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x2e29[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x92e2('0x0'));var util=require(_0x92e2('0x1'));var logger=require(_0x92e2('0x2'))(_0x92e2('0x3'));var moment=require(_0x92e2('0x4'));var BPromise=require(_0x92e2('0x5'));var rp=require(_0x92e2('0x6'));var fs=require('fs');var path=require(_0x92e2('0x7'));var rimraf=require(_0x92e2('0x8'));var config=require(_0x92e2('0x9'));var attributes=require(_0x92e2('0xa'));module[_0x92e2('0xb')]=function(_0x91a1b0,_0x2ba275){return _0x91a1b0['define']('CloudProvider',attributes,{'tableName':_0x92e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 2e6a7c0..6b7bb03 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e93=['client_id','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','login','key','value','oauth2/','data1','decode','aud','audience','unix','resolve','findOne','then','data6','decryptString','data3','POST','data5','access_token','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data2','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','from','stringify','toString','base64','randomBytes'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x0e93,0x1e7));var _0x30e9=function(_0x38f953,_0x3f66bd){_0x38f953=_0x38f953-0x0;var _0x4a7531=_0x0e93[_0x38f953];return _0x4a7531;};'use strict';var _=require('lodash');var crypto=require(_0x30e9('0x0'));var jwt=require(_0x30e9('0x1'));var moment=require(_0x30e9('0x2'));var Redis=require(_0x30e9('0x3'));var rp=require(_0x30e9('0x4'));var util=require(_0x30e9('0x5'));var encryptor=require(_0x30e9('0x6'));var config=require(_0x30e9('0x7'));var logger=require('../../config/logger')(_0x30e9('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x30e9('0x9'))['db'];config['redis']=_[_0x30e9('0xa')](config[_0x30e9('0xb')],{'host':_0x30e9('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x30e9('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x30e9('0xe'),_0x30e9('0xf'),_0x30e9('0x10'),_0x30e9('0x11'),_0x30e9('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x30e9('0x13')],'Dynamics365':[_0x30e9('0xe'),_0x30e9('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x30e9('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x30e9('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x580044){var _0x24eace=_[_0x30e9('0x16')](AZURE_AUTH_SCOPES[_0x580044[_0x30e9('0x17')]]);if(_0x580044[_0x30e9('0x17')]===_0x30e9('0x18'))_0x24eace[_0x30e9('0x19')](_0x580044[_0x30e9('0x1a')]+_0x30e9('0x1b'));return _0x24eace[_0x30e9('0x1c')]('\x20');}function getAccessTokenScope(_0x3128f5){if(_0x3128f5[_0x30e9('0x17')]===_0x30e9('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x3128f5[_0x30e9('0x17')]===_0x30e9('0x18'))return _0x3128f5[_0x30e9('0x1a')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xcabd73,_0x99cfc2){var _0x2496e3=MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0xcabd73['data2']);var _0x264a84=[_0x30e9('0x20'),'id_token'];var _0x34d9f2=Buffer[_0x30e9('0x21')](JSON[_0x30e9('0x22')]({'id':_0x99cfc2}))[_0x30e9('0x23')](_0x30e9('0x24'));var _0x1111d7=crypto[_0x30e9('0x25')](0x10)[_0x30e9('0x23')]('hex');var _0x6e7e51=getAuthorizationScopes(_0xcabd73);var _0x2f7a83=[{'key':_0x30e9('0x26'),'value':_0xcabd73['data1']},{'key':_0x30e9('0x27'),'value':encodeURIComponent(_0x264a84[_0x30e9('0x1c')]('\x20'))},{'key':_0x30e9('0x28'),'value':_0xcabd73[_0x30e9('0x29')]},{'key':_0x30e9('0x2a'),'value':'form_post'},{'key':_0x30e9('0x2b'),'value':encodeURIComponent(_0x6e7e51)},{'key':_0x30e9('0x2c'),'value':_0x34d9f2},{'key':_0x30e9('0x2d'),'value':_0x1111d7},{'key':_0x30e9('0x2e'),'value':_0x30e9('0x2f')}];var _0x2ed3e7=_0x2496e3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x30e9('0x16')](_0x2f7a83,function(_0x328818){return _0x328818[_0x30e9('0x30')]+'='+_0x328818[_0x30e9('0x31')];})[_0x30e9('0x1c')]('&');_0xcabd73['oauth2Claims']={'issuer':_0x2496e3[_0x30e9('0x1e')](_0x30e9('0x32'),''),'audience':_0xcabd73[_0x30e9('0x33')],'state':_0x34d9f2,'nonce':_0x1111d7};redis['set'](_0x34d9f2,JSON['stringify'](_0xcabd73));return _0x2ed3e7;}function isValidIdToken(_0x3f27cb,_0x59ce56){try{var _0x58fa30=jwt[_0x30e9('0x34')](_0x3f27cb,{'complete':!![]});var _0x2cfde3=_0x58fa30['payload'];if(_0x2cfde3['iss']!==_0x59ce56['issuer'])return![];if(_0x2cfde3[_0x30e9('0x35')]!==_0x59ce56[_0x30e9('0x36')])return![];if(_0x2cfde3[_0x30e9('0x2d')]!==_0x59ce56[_0x30e9('0x2d')])return![];if(moment()['isAfter'](moment[_0x30e9('0x37')](_0x2cfde3['exp'])))return![];return!![];}catch(_0x403716){throw _0x403716;}}function refreshOauth2MicrosoftAccessToken(_0x2232c0){return Promise[_0x30e9('0x38')]()['then'](function(){if(_0x2232c0['data3'])return _0x2232c0;return db['CloudProvider'][_0x30e9('0x39')]({'where':{'id':_0x2232c0['id']},'raw':!![]});})[_0x30e9('0x3a')](function(_0x526103){var _0x2e74f6={'grant_type':'refresh_token','refresh_token':_0x526103[_0x30e9('0x3b')],'scope':getAccessTokenScope(_0x526103),'redirect_uri':_0x526103[_0x30e9('0x29')],'client_id':_0x526103[_0x30e9('0x33')],'client_secret':encryptor[_0x30e9('0x3c')](_0x526103[_0x30e9('0x3d')])};var _0xfac8bc={'method':_0x30e9('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0x526103['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e74f6,'json':!![]};return rp(_0xfac8bc);})[_0x30e9('0x3a')](function(_0x325409){_0x2232c0[_0x30e9('0x3f')]=_0x325409[_0x30e9('0x40')];_0x2232c0[_0x30e9('0x3b')]=_0x325409['refresh_token'];return db[_0x30e9('0x41')]['update']({'data5':_0x2232c0[_0x30e9('0x3f')],'data6':_0x2232c0[_0x30e9('0x3b')]},{'where':{'id':_0x2232c0['id']}});})[_0x30e9('0x3a')](function(){return _0x2232c0;})[_0x30e9('0x42')](function(_0x350c99){logger[_0x30e9('0x43')](_0x30e9('0x44'),_0x2232c0['id'],_0x350c99);});}function getOauth2MicrosoftAccessToken(_0x203ca0,_0x3fa448){var _0x44997f={'grant_type':_0x30e9('0x45'),'code':_0x203ca0,'scope':getAccessTokenScope(_0x3fa448),'redirect_uri':_0x3fa448[_0x30e9('0x29')],'client_id':_0x3fa448[_0x30e9('0x33')],'client_secret':encryptor['decryptString'](_0x3fa448[_0x30e9('0x3d')])};var _0x3d7335={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x30e9('0x1e')](_0x30e9('0x1f'),_0x3fa448[_0x30e9('0x46')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x44997f,'json':!![]};return rp(_0x3d7335);}function startRefreshInterval(_0x149a50){var _0x280a92=schedule['intervals'];if(_0x280a92[_0x149a50['id']])clearInterval(_0x280a92[_0x149a50['id']]);_0x280a92[_0x149a50['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x149a50['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x280a92;}function startAllRefreshIntervals(){return db[_0x30e9('0x41')][_0x30e9('0x47')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x30e9('0x3a')](function(_0x340ed7){var _0x62ed43=_0x340ed7[_0x30e9('0x16')](function(_0x4d0df1){return refreshOauth2MicrosoftAccessToken(_0x4d0df1)['then'](function(_0x2813a1){startRefreshInterval(_0x2813a1);});});return Promise[_0x30e9('0x48')](_0x62ed43);})[_0x30e9('0x42')](function(_0xe776b4){var _0xb5f0de=_0xe776b4?util[_0x30e9('0x49')](_0xe776b4,{'showHidden':![],'depth':null}):'';logger[_0x30e9('0x43')](_0x30e9('0x4a'),_0xb5f0de);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xea42=['Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','bind','intervals','findAll','all','inspect','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','code','from','base64','randomBytes','client_id','data1','response_type','redirect_uri','form_post','scope','state','nonce','prompt','login','key','join','stringify','decode','iss','issuer','aud','isAfter','unix','resolve','then','data3','findOne','refresh_token','decryptString','POST','data2','data5','access_token','CloudProvider','data6','catch','error'];(function(_0x8907b9,_0x3484b9){var _0x60982d=function(_0x2a5a09){while(--_0x2a5a09){_0x8907b9['push'](_0x8907b9['shift']());}};_0x60982d(++_0x3484b9);}(_0xea42,0xf9));var _0x2ea4=function(_0x1e08e0,_0x1c7e1c){_0x1e08e0=_0x1e08e0-0x0;var _0x15ce0e=_0xea42[_0x1e08e0];return _0x15ce0e;};'use strict';var _=require(_0x2ea4('0x0'));var crypto=require(_0x2ea4('0x1'));var jwt=require(_0x2ea4('0x2'));var moment=require('moment');var Redis=require(_0x2ea4('0x3'));var rp=require(_0x2ea4('0x4'));var util=require(_0x2ea4('0x5'));var encryptor=require(_0x2ea4('0x6'));var config=require(_0x2ea4('0x7'));var logger=require(_0x2ea4('0x8'))(_0x2ea4('0x9'));var schedule=require(_0x2ea4('0xa'));var db=require(_0x2ea4('0xb'))['db'];config[_0x2ea4('0xc')]=_[_0x2ea4('0xd')](config[_0x2ea4('0xc')],{'host':_0x2ea4('0xe'),'port':0x18eb});var redis=new Redis(config[_0x2ea4('0xc')]);var MICROSOFT_AUTH_URL=_0x2ea4('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2ea4('0x10'),_0x2ea4('0x11'),_0x2ea4('0x12'),_0x2ea4('0x13'),_0x2ea4('0x14'),_0x2ea4('0x15'),_0x2ea4('0x16')],'Dynamics365':[_0x2ea4('0x10'),_0x2ea4('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x2ea4('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0x2ea4('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1758fc){var _0x4b44fc=_[_0x2ea4('0x19')](AZURE_AUTH_SCOPES[_0x1758fc['type']]);if(_0x1758fc[_0x2ea4('0x1a')]===_0x2ea4('0x1b'))_0x4b44fc[_0x2ea4('0x1c')](_0x1758fc[_0x2ea4('0x1d')]+_0x2ea4('0x1e'));return _0x4b44fc['join']('\x20');}function getAccessTokenScope(_0x228c99){if(_0x228c99[_0x2ea4('0x1a')]===_0x2ea4('0x1f'))return _0x2ea4('0x14');if(_0x228c99[_0x2ea4('0x1a')]===_0x2ea4('0x1b'))return _0x228c99[_0x2ea4('0x1d')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xfcc38e,_0x4c708a){var _0x5350c9=MICROSOFT_AUTH_URL[_0x2ea4('0x20')](_0x2ea4('0x21'),_0xfcc38e['data2']);var _0x52ac3b=[_0x2ea4('0x22'),'id_token'];var _0x293ea2=Buffer[_0x2ea4('0x23')](JSON['stringify']({'id':_0x4c708a}))['toString'](_0x2ea4('0x24'));var _0x2c0b65=crypto[_0x2ea4('0x25')](0x10)['toString']('hex');var _0x521bcc=getAuthorizationScopes(_0xfcc38e);var _0x3c65e8=[{'key':_0x2ea4('0x26'),'value':_0xfcc38e[_0x2ea4('0x27')]},{'key':_0x2ea4('0x28'),'value':encodeURIComponent(_0x52ac3b['join']('\x20'))},{'key':_0x2ea4('0x29'),'value':_0xfcc38e['data4']},{'key':'response_mode','value':_0x2ea4('0x2a')},{'key':_0x2ea4('0x2b'),'value':encodeURIComponent(_0x521bcc)},{'key':_0x2ea4('0x2c'),'value':_0x293ea2},{'key':_0x2ea4('0x2d'),'value':_0x2c0b65},{'key':_0x2ea4('0x2e'),'value':_0x2ea4('0x2f')}];var _0x51f08b=_0x5350c9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x2ea4('0x19')](_0x3c65e8,function(_0x38273b){return _0x38273b[_0x2ea4('0x30')]+'='+_0x38273b['value'];})[_0x2ea4('0x31')]('&');_0xfcc38e['oauth2Claims']={'issuer':_0x5350c9['replace']('oauth2/',''),'audience':_0xfcc38e['data1'],'state':_0x293ea2,'nonce':_0x2c0b65};redis['set'](_0x293ea2,JSON[_0x2ea4('0x32')](_0xfcc38e));return _0x51f08b;}function isValidIdToken(_0x44e67b,_0x4b10c2){try{var _0x33d62d=jwt[_0x2ea4('0x33')](_0x44e67b,{'complete':!![]});var _0x360eee=_0x33d62d['payload'];if(_0x360eee[_0x2ea4('0x34')]!==_0x4b10c2[_0x2ea4('0x35')])return![];if(_0x360eee[_0x2ea4('0x36')]!==_0x4b10c2['audience'])return![];if(_0x360eee['nonce']!==_0x4b10c2[_0x2ea4('0x2d')])return![];if(moment()[_0x2ea4('0x37')](moment[_0x2ea4('0x38')](_0x360eee['exp'])))return![];return!![];}catch(_0x4cf61a){throw _0x4cf61a;}}function refreshOauth2MicrosoftAccessToken(_0x1a8be7){return Promise[_0x2ea4('0x39')]()[_0x2ea4('0x3a')](function(){if(_0x1a8be7[_0x2ea4('0x3b')])return _0x1a8be7;return db['CloudProvider'][_0x2ea4('0x3c')]({'where':{'id':_0x1a8be7['id']},'raw':!![]});})[_0x2ea4('0x3a')](function(_0x1b7709){var _0x18ee80={'grant_type':_0x2ea4('0x3d'),'refresh_token':_0x1b7709['data6'],'scope':getAccessTokenScope(_0x1b7709),'redirect_uri':_0x1b7709['data4'],'client_id':_0x1b7709['data1'],'client_secret':encryptor[_0x2ea4('0x3e')](_0x1b7709[_0x2ea4('0x3b')])};var _0x5bb2c3={'method':_0x2ea4('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0x2ea4('0x21'),_0x1b7709[_0x2ea4('0x40')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x18ee80,'json':!![]};return rp(_0x5bb2c3);})[_0x2ea4('0x3a')](function(_0x21a3d2){_0x1a8be7[_0x2ea4('0x41')]=_0x21a3d2[_0x2ea4('0x42')];_0x1a8be7['data6']=_0x21a3d2[_0x2ea4('0x3d')];return db[_0x2ea4('0x43')]['update']({'data5':_0x1a8be7[_0x2ea4('0x41')],'data6':_0x1a8be7[_0x2ea4('0x44')]},{'where':{'id':_0x1a8be7['id']}});})[_0x2ea4('0x3a')](function(){return _0x1a8be7;})[_0x2ea4('0x45')](function(_0x485f78){logger[_0x2ea4('0x46')](_0x2ea4('0x47'),_0x1a8be7['id'],_0x485f78);});}function getOauth2MicrosoftAccessToken(_0x2141ae,_0x35824e){var _0x12a377={'grant_type':_0x2ea4('0x48'),'code':_0x2141ae,'scope':getAccessTokenScope(_0x35824e),'redirect_uri':_0x35824e[_0x2ea4('0x49')],'client_id':_0x35824e[_0x2ea4('0x27')],'client_secret':encryptor['decryptString'](_0x35824e[_0x2ea4('0x3b')])};var _0x347afb={'method':_0x2ea4('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x2ea4('0x20')]('{TENANT_ID}',_0x35824e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12a377,'json':!![]};return rp(_0x347afb);}function startRefreshInterval(_0xab50b4){var _0x4b8be2=schedule['intervals'];if(_0x4b8be2[_0xab50b4['id']])clearInterval(_0x4b8be2[_0xab50b4['id']]);_0x4b8be2[_0xab50b4['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2ea4('0x4a')](this,{'id':_0xab50b4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2ea4('0x4b')]=_0x4b8be2;}function startAllRefreshIntervals(){return db[_0x2ea4('0x43')][_0x2ea4('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2ea4('0x3a')](function(_0x37f71f){var _0x15565e=_0x37f71f[_0x2ea4('0x19')](function(_0x52c248){return refreshOauth2MicrosoftAccessToken(_0x52c248)[_0x2ea4('0x3a')](function(_0xf5d5ee){startRefreshInterval(_0xf5d5ee);});});return Promise[_0x2ea4('0x4d')](_0x15565e);})[_0x2ea4('0x45')](function(_0x1c5d56){var _0x302bbb=_0x1c5d56?util[_0x2ea4('0x4e')](_0x1c5d56,{'showHidden':![],'depth':null}):'';logger[_0x2ea4('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x302bbb);});}module[_0x2ea4('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index bbfe184..1de8f0f 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 _0x3d3d=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1e729a,_0x52f00e){var _0x3a8044=function(_0x303fa0){while(--_0x303fa0){_0x1e729a['push'](_0x1e729a['shift']());}};_0x3a8044(++_0x52f00e);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var moment=require(_0xd3d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3d3('0x2'));var fs=require('fs');var Redis=require(_0xd3d3('0x3'));var db=require(_0xd3d3('0x4'))['db'];var utils=require(_0xd3d3('0x5'));var logger=require(_0xd3d3('0x6'))(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var jayson=require(_0xd3d3('0x9'));var client=jayson[_0xd3d3('0xa')][_0xd3d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aa421,_0x1f47fe,_0x263940){return new BPromise(function(_0x3fe58e,_0x2ed96f){return client['request'](_0x4aa421,_0x263940)[_0xd3d3('0xc')](function(_0x412054){logger[_0xd3d3('0xd')](_0xd3d3('0xe'),_0x1f47fe,'request\x20sent');logger[_0xd3d3('0xf')](_0xd3d3('0x10'),_0x1f47fe,_0xd3d3('0x11'),JSON[_0xd3d3('0x12')](_0x412054));if(_0x412054[_0xd3d3('0x13')]){if(_0x412054[_0xd3d3('0x13')]['code']===0x1f4){logger[_0xd3d3('0x13')]('CloudProvider,\x20%s,\x20%s',_0x1f47fe,_0x412054['error']['message']);return _0x2ed96f(_0x412054[_0xd3d3('0x13')]['message']);}logger['error'](_0xd3d3('0xe'),_0x1f47fe,_0x412054[_0xd3d3('0x13')]['message']);return _0x3fe58e(_0x412054[_0xd3d3('0x13')]['message']);}else{logger['info'](_0xd3d3('0xe'),_0x1f47fe,_0xd3d3('0x11'));_0x3fe58e(_0x412054[_0xd3d3('0x14')][_0xd3d3('0x15')]);}})[_0xd3d3('0x16')](function(_0x5c3462){logger[_0xd3d3('0x13')](_0xd3d3('0xe'),_0x1f47fe,_0x5c3462);_0x2ed96f(_0x5c3462);});});} \ No newline at end of file +var _0x6ac2=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6ac2,0x184));var _0x26ac=function(_0x5bca5e,_0x3852c){_0x5bca5e=_0x5bca5e-0x0;var _0x1dc1ea=_0x6ac2[_0x5bca5e];return _0x1dc1ea;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var rs=require(_0x26ac('0x3'));var fs=require('fs');var Redis=require(_0x26ac('0x4'));var db=require(_0x26ac('0x5'))['db'];var utils=require(_0x26ac('0x6'));var logger=require('../../config/logger')(_0x26ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x26ac('0x8'));var client=jayson[_0x26ac('0x9')][_0x26ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x159ba6,_0x36389c,_0x444ca1){return new BPromise(function(_0x1906d0,_0xd8b1e5){return client['request'](_0x159ba6,_0x444ca1)['then'](function(_0x27ff15){logger[_0x26ac('0xb')](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));logger['debug'](_0x26ac('0xe'),_0x36389c,_0x26ac('0xd'),JSON[_0x26ac('0xf')](_0x27ff15));if(_0x27ff15[_0x26ac('0x10')]){if(_0x27ff15['error']['code']===0x1f4){logger[_0x26ac('0x10')](_0x26ac('0xc'),_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0xd8b1e5(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);return _0x1906d0(_0x27ff15[_0x26ac('0x10')][_0x26ac('0x11')]);}else{logger['info'](_0x26ac('0xc'),_0x36389c,_0x26ac('0xd'));_0x1906d0(_0x27ff15['result'][_0x26ac('0x11')]);}})[_0x26ac('0x12')](function(_0x3b7c5d){logger[_0x26ac('0x10')]('CloudProvider,\x20%s,\x20%s',_0x36389c,_0x3b7c5d);_0xd8b1e5(_0x3b7c5d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 6ddeaf8..9071c85 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 _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x2192d5,_0x58909a){var _0x2e7eb9=function(_0x48c970){while(--_0x48c970){_0x2192d5['push'](_0x2192d5['shift']());}};_0x2e7eb9(++_0x58909a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x1a0e7c,_0x1545a1){_0x1a0e7c=_0x1a0e7c-0x0;var _0x1180ae=_0x7a54[_0x1a0e7c];return _0x1180ae;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index b0ccce4..4a79c4d 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 _0xd0a7=['STRING'];(function(_0x25fd8b,_0x4f6771){var _0x2ebe10=function(_0x13cd93){while(--_0x13cd93){_0x25fd8b['push'](_0x25fd8b['shift']());}};_0x2ebe10(++_0x4f6771);}(_0xd0a7,0x11b));var _0x7d0a=function(_0x4b54f8,_0x419eca){_0x4b54f8=_0x4b54f8-0x0;var _0x3c1443=_0xd0a7[_0x4b54f8];return _0x3c1443;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7d0a('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7d0a('0x0')]},'companyId':{'type':Sequelize[_0x7d0a('0x0')]},'website':{'type':Sequelize[_0x7d0a('0x0')]},'phone':{'type':Sequelize[_0x7d0a('0x0')]},'fax':{'type':Sequelize[_0x7d0a('0x0')]},'type':{'type':Sequelize[_0x7d0a('0x0')]},'street':{'type':Sequelize[_0x7d0a('0x0')]},'postalCode':{'type':Sequelize[_0x7d0a('0x0')]},'city':{'type':Sequelize[_0x7d0a('0x0')]},'country':{'type':Sequelize[_0x7d0a('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7d0a('0x0')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x7d0a('0x0')]},'sCity':{'type':Sequelize[_0x7d0a('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7d0a('0x0')]}}; \ No newline at end of file +var _0xee74=['STRING','name','exports'];(function(_0x448666,_0x30e0f3){var _0x506f4c=function(_0x5c1255){while(--_0x5c1255){_0x448666['push'](_0x448666['shift']());}};_0x506f4c(++_0x30e0f3);}(_0xee74,0x1eb));var _0x4ee7=function(_0x534d1c,_0x2413b6){_0x534d1c=_0x534d1c-0x0;var _0x39adfe=_0xee74[_0x534d1c];return _0x39adfe;};'use strict';var Sequelize=require('sequelize');module[_0x4ee7('0x0')]={'name':{'type':Sequelize[_0x4ee7('0x1')],'unique':_0x4ee7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4ee7('0x1')]},'companyId':{'type':Sequelize[_0x4ee7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4ee7('0x1')]},'fax':{'type':Sequelize[_0x4ee7('0x1')]},'type':{'type':Sequelize[_0x4ee7('0x1')]},'street':{'type':Sequelize[_0x4ee7('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4ee7('0x1')]},'country':{'type':Sequelize[_0x4ee7('0x1')]},'email':{'type':Sequelize[_0x4ee7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4ee7('0x1')]},'sStreet':{'type':Sequelize[_0x4ee7('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4ee7('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 113f499..acf94da 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 _0x56e3=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','omit','ids','rawAttributes','getContacts','eml-format','rimraf','zip-dir'];(function(_0x2c4d2c,_0x433527){var _0x769dcf=function(_0x3c31db){while(--_0x3c31db){_0x2c4d2c['push'](_0x2c4d2c['shift']());}};_0x769dcf(++_0x433527);}(_0x56e3,0xb1));var _0x356e=function(_0x532c60,_0x408037){_0x532c60=_0x532c60-0x0;var _0x49daa9=_0x56e3[_0x532c60];return _0x49daa9;};'use strict';var emlformat=require(_0x356e('0x0'));var rimraf=require(_0x356e('0x1'));var zipdir=require(_0x356e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x356e('0x3'));var moment=require(_0x356e('0x4'));var BPromise=require(_0x356e('0x5'));var Mustache=require(_0x356e('0x6'));var util=require(_0x356e('0x7'));var path=require('path');var sox=require(_0x356e('0x8'));var csv=require(_0x356e('0x9'));var ejs=require(_0x356e('0xa'));var fs=require('fs');var fs_extra=require(_0x356e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x356e('0xc'));var jsforce=require(_0x356e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x356e('0xe'));var Papa=require(_0x356e('0xf'));var Redis=require(_0x356e('0x10'));var authService=require(_0x356e('0x11'));var qs=require(_0x356e('0x12'));var as=require(_0x356e('0x13'));var hardwareService=require(_0x356e('0x14'));var logger=require(_0x356e('0x15'))('api');var utils=require(_0x356e('0x16'));var config=require(_0x356e('0x17'));var licenseUtil=require(_0x356e('0x18'));var db=require(_0x356e('0x19'))['db'];function respondWithStatusCode(_0x2b3c82,_0x319c7e){_0x319c7e=_0x319c7e||0xcc;return function(_0x14cb35){if(_0x14cb35){return _0x2b3c82[_0x356e('0x1a')](_0x319c7e);}return _0x2b3c82[_0x356e('0x1b')](_0x319c7e)[_0x356e('0x1c')]();};}function respondWithResult(_0x3f9341,_0x347b3f){_0x347b3f=_0x347b3f||0xc8;return function(_0x50b4a3){if(_0x50b4a3){return _0x3f9341[_0x356e('0x1b')](_0x347b3f)['json'](_0x50b4a3);}};}function respondWithFilteredResult(_0xf79876,_0x3e0b82){return function(_0x1c79f1){if(_0x1c79f1){var _0x640a31=typeof _0x3e0b82[_0x356e('0x1d')]===_0x356e('0x1e')&&typeof _0x3e0b82[_0x356e('0x1f')]===_0x356e('0x1e');var _0x2d0f65=_0x1c79f1[_0x356e('0x20')];var _0x237ce2=_0x640a31?0x0:_0x3e0b82[_0x356e('0x1d')];var _0x3f3a49=_0x640a31?_0x1c79f1[_0x356e('0x20')]:_0x3e0b82[_0x356e('0x1d')]+_0x3e0b82['limit'];var _0x21cdad;if(_0x3f3a49>=_0x2d0f65){_0x3f3a49=_0x2d0f65;_0x21cdad=0xc8;}else{_0x21cdad=0xce;}_0xf79876['status'](_0x21cdad);return _0xf79876[_0x356e('0x21')]('Content-Range',_0x237ce2+'-'+_0x3f3a49+'/'+_0x2d0f65)[_0x356e('0x22')](_0x1c79f1);}return null;};}function patchUpdates(_0x49cf69){return function(_0x28a4be){try{jsonpatch[_0x356e('0x23')](_0x28a4be,_0x49cf69,!![]);}catch(_0x444515){return BPromise[_0x356e('0x24')](_0x444515);}return _0x28a4be[_0x356e('0x25')]();};}function saveUpdates(_0xfb013d,_0x2a274c){return function(_0x47f546){if(_0x47f546){return _0x47f546[_0x356e('0x26')](_0xfb013d)[_0x356e('0x27')](function(_0x3546ab){return _0x3546ab;});}return null;};}function removeEntity(_0xd95b04,_0x2eec8e){return function(_0x2c633f){if(_0x2c633f){return _0x2c633f['destroy']()[_0x356e('0x27')](function(){var _0x25b65b=_0x2c633f[_0x356e('0x28')]({'plain':!![]});var _0x522675='Companies';return db[_0x356e('0x29')]['destroy']({'where':{'type':_0x522675,'resourceId':_0x25b65b['id']}})[_0x356e('0x27')](function(){return _0x2c633f;});})[_0x356e('0x27')](function(){_0xd95b04['status'](0xcc)[_0x356e('0x1c')]();});}};}function handleEntityNotFound(_0x39c3d8,_0x2e347e){return function(_0xedbf05){if(!_0xedbf05){_0x39c3d8[_0x356e('0x1a')](0x194);}return _0xedbf05;};}function handleError(_0x341b2a,_0x4db357){_0x4db357=_0x4db357||0x1f4;return function(_0x140593){logger[_0x356e('0x2a')](_0x140593[_0x356e('0x2b')]);if(_0x140593[_0x356e('0x2c')]){delete _0x140593['name'];}_0x341b2a['status'](_0x4db357)['send'](_0x140593);};}exports['index']=function(_0x5989d6,_0x245f1e){var _0x48a1ff={},_0x3eaa35={},_0x4c2aa7={'count':0x0,'rows':[]};return db[_0x356e('0x2d')][_0x356e('0x2e')]()['then'](function(_0xac1a77){_0x3eaa35[_0x356e('0x2f')]=_['keys'](_0xac1a77);_0x3eaa35[_0x356e('0x30')]=_[_0x356e('0x31')](_0x5989d6['query']);_0x3eaa35[_0x356e('0x32')]=_[_0x356e('0x33')](_0x3eaa35[_0x356e('0x2f')],_0x3eaa35[_0x356e('0x30')]);_0x48a1ff[_0x356e('0x34')]=_[_0x356e('0x33')](_0x3eaa35['model'],qs[_0x356e('0x35')](_0x5989d6['query'][_0x356e('0x35')]));_0x48a1ff['attributes']=_0x48a1ff[_0x356e('0x34')]['length']?_0x48a1ff[_0x356e('0x34')]:_0x3eaa35[_0x356e('0x2f')];if(!_0x5989d6[_0x356e('0x30')][_0x356e('0x36')](_0x356e('0x37'))){_0x48a1ff[_0x356e('0x1f')]=qs[_0x356e('0x1f')](_0x5989d6[_0x356e('0x30')]['limit']);_0x48a1ff[_0x356e('0x1d')]=qs[_0x356e('0x1d')](_0x5989d6[_0x356e('0x30')][_0x356e('0x1d')]);}_0x48a1ff[_0x356e('0x38')]=qs[_0x356e('0x39')](_0x5989d6[_0x356e('0x30')]['sort']);_0x48a1ff[_0x356e('0x3a')]=qs['filters'](_[_0x356e('0x3b')](_0x5989d6[_0x356e('0x30')],_0x3eaa35[_0x356e('0x32')]),_0xac1a77);if(_0x5989d6['query'][_0x356e('0x3c')]){_0x48a1ff[_0x356e('0x3a')]=_[_0x356e('0x3d')](_0x48a1ff['where'],{'$or':_[_0x356e('0x3e')](_0x48a1ff[_0x356e('0x34')],function(_0x4a6a78){var _0x5dc2b4={};_0x5dc2b4[_0x4a6a78]={'$like':'%'+_0x5989d6['query'][_0x356e('0x3c')]+'%'};return _0x5dc2b4;})});}_0x48a1ff=_[_0x356e('0x3d')]({},_0x48a1ff,_0x5989d6[_0x356e('0x3f')]);var _0x4e0ce5={'where':_0x48a1ff[_0x356e('0x3a')]};return db[_0x356e('0x2d')][_0x356e('0x20')](_0x4e0ce5)[_0x356e('0x27')](function(_0x59b4db){_0x4c2aa7['count']=_0x59b4db;if(_0x5989d6[_0x356e('0x30')]['includeAll']){_0x48a1ff[_0x356e('0x40')]=[{'all':!![]}];}return db['CmCompany'][_0x356e('0x41')](_0x48a1ff);})[_0x356e('0x27')](function(_0x256def){_0x4c2aa7[_0x356e('0x42')]=_0x256def;return _0x4c2aa7;})[_0x356e('0x27')](respondWithFilteredResult(_0x245f1e,_0x48a1ff))[_0x356e('0x43')](handleError(_0x245f1e,null));})[_0x356e('0x43')](handleError(_0x245f1e,null));};exports[_0x356e('0x44')]=function(_0x327571,_0x2a239c){var _0x2da428={'raw':![],'where':{'id':_0x327571[_0x356e('0x45')]['id']}},_0xa528ef={};_0xa528ef[_0x356e('0x2f')]=_['keys'](db['CmCompany']['rawAttributes']);_0xa528ef[_0x356e('0x30')]=_[_0x356e('0x31')](_0x327571[_0x356e('0x30')]);_0xa528ef['filters']=_[_0x356e('0x33')](_0xa528ef[_0x356e('0x2f')],_0xa528ef['query']);_0x2da428[_0x356e('0x34')]=_[_0x356e('0x33')](_0xa528ef[_0x356e('0x2f')],qs['fields'](_0x327571['query']['fields']));_0x2da428['attributes']=_0x2da428[_0x356e('0x34')][_0x356e('0x46')]?_0x2da428[_0x356e('0x34')]:_0xa528ef['model'];if(_0x327571[_0x356e('0x30')][_0x356e('0x47')]){_0x2da428[_0x356e('0x40')]=[{'all':!![]}];}_0x2da428=_[_0x356e('0x3d')]({},_0x2da428,_0x327571[_0x356e('0x3f')]);return db['CmCompany']['find'](_0x2da428)['then'](handleEntityNotFound(_0x2a239c,null))[_0x356e('0x27')](respondWithResult(_0x2a239c,null))[_0x356e('0x43')](handleError(_0x2a239c,null));};exports[_0x356e('0x48')]=function(_0x1a6981,_0x4fca88){return db[_0x356e('0x2d')]['create'](_0x1a6981[_0x356e('0x49')],{})['then'](function(_0x36c7bb){var _0x2616e5=_0x1a6981[_0x356e('0x4a')]['get']({'plain':!![]});if(!_0x2616e5)throw new Error(_0x356e('0x4b'));if(_0x2616e5[_0x356e('0x4c')]===_0x356e('0x4a')){var _0x4772b7=_0x36c7bb[_0x356e('0x28')]({'plain':!![]});var _0x45be74=_0x356e('0x4d');return db[_0x356e('0x4e')][_0x356e('0x4f')]({'where':{'name':_0x45be74,'userProfileId':_0x2616e5[_0x356e('0x50')]},'raw':!![]})['then'](function(_0x419784){if(_0x419784&&_0x419784[_0x356e('0x51')]===0x0){return db[_0x356e('0x29')][_0x356e('0x48')]({'name':_0x4772b7[_0x356e('0x2c')],'resourceId':_0x4772b7['id'],'type':_0x419784[_0x356e('0x2c')],'sectionId':_0x419784['id']},{})[_0x356e('0x27')](function(){return _0x36c7bb;});}else{return _0x36c7bb;}})[_0x356e('0x43')](function(_0x3d6f94){logger[_0x356e('0x2a')](_0x356e('0x52'),_0x3d6f94);throw _0x3d6f94;});}return _0x36c7bb;})[_0x356e('0x27')](respondWithResult(_0x4fca88,0xc9))[_0x356e('0x43')](handleError(_0x4fca88,null));};exports['update']=function(_0x256b8d,_0x258c45){if(_0x256b8d[_0x356e('0x49')]['id']){delete _0x256b8d[_0x356e('0x49')]['id'];}return db[_0x356e('0x2d')][_0x356e('0x4f')]({'where':{'id':_0x256b8d[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x258c45,null))[_0x356e('0x27')](saveUpdates(_0x256b8d[_0x356e('0x49')],null))[_0x356e('0x27')](respondWithResult(_0x258c45,null))['catch'](handleError(_0x258c45,null));};exports[_0x356e('0x53')]=function(_0x432f5f,_0x1e4d4d){return db[_0x356e('0x2d')][_0x356e('0x4f')]({'where':{'id':_0x432f5f[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x1e4d4d,null))[_0x356e('0x27')](removeEntity(_0x1e4d4d,null))[_0x356e('0x43')](handleError(_0x1e4d4d,null));};exports['describe']=function(_0x5bafd9,_0x1c69d4){return db[_0x356e('0x2d')][_0x356e('0x2e')]()['then'](respondWithResult(_0x1c69d4,null))['catch'](handleError(_0x1c69d4,null));};exports[_0x356e('0x54')]=function(_0x4a0522,_0x44d1b0,_0x102270){return db[_0x356e('0x55')][_0x356e('0x4f')]({'where':{'id':_0x4a0522[_0x356e('0x45')]['id']}})['then'](handleEntityNotFound(_0x44d1b0,null))[_0x356e('0x27')](function(_0x3a6ea7){if(_0x3a6ea7){return _0x3a6ea7[_0x356e('0x54')](_0x4a0522[_0x356e('0x49')]['ids'],_[_0x356e('0x56')](_0x4a0522[_0x356e('0x49')],[_0x356e('0x57'),'id'])||{});}})['then'](respondWithResult(_0x44d1b0,null))['catch'](handleError(_0x44d1b0,null));};exports['getContacts']=function(_0x32fcb0,_0x4b64c7,_0x587bf2){var _0x4ad12a={};var _0x3e4d17={};var _0x4980fc;var _0x40ca20;return db[_0x356e('0x2d')]['findOne']({'where':{'id':_0x32fcb0[_0x356e('0x45')]['id']}})[_0x356e('0x27')](handleEntityNotFound(_0x4b64c7,null))[_0x356e('0x27')](function(_0x3868c4){if(_0x3868c4){_0x4980fc=_0x3868c4;_0x3e4d17[_0x356e('0x2f')]=_[_0x356e('0x31')](db[_0x356e('0x55')][_0x356e('0x58')]);_0x3e4d17[_0x356e('0x30')]=_['keys'](_0x32fcb0[_0x356e('0x30')]);_0x3e4d17[_0x356e('0x32')]=_[_0x356e('0x33')](_0x3e4d17[_0x356e('0x2f')],_0x3e4d17[_0x356e('0x30')]);_0x4ad12a[_0x356e('0x34')]=_['intersection'](_0x3e4d17[_0x356e('0x2f')],qs[_0x356e('0x35')](_0x32fcb0[_0x356e('0x30')]['fields']));_0x4ad12a[_0x356e('0x34')]=_0x4ad12a['attributes'][_0x356e('0x46')]?_0x4ad12a[_0x356e('0x34')]:_0x3e4d17['model'];_0x4ad12a[_0x356e('0x38')]=qs['sort'](_0x32fcb0[_0x356e('0x30')]['sort']);_0x4ad12a['where']=qs[_0x356e('0x32')](_[_0x356e('0x3b')](_0x32fcb0[_0x356e('0x30')],_0x3e4d17[_0x356e('0x32')]));if(_0x32fcb0[_0x356e('0x30')]['filter']){_0x4ad12a[_0x356e('0x3a')]=_[_0x356e('0x3d')](_0x4ad12a[_0x356e('0x3a')],{'$or':_[_0x356e('0x3e')](_0x4ad12a[_0x356e('0x34')],function(_0x29749b){var _0x339331={};_0x339331[_0x29749b]={'$like':'%'+_0x32fcb0[_0x356e('0x30')][_0x356e('0x3c')]+'%'};return _0x339331;})});}_0x4ad12a=_[_0x356e('0x3d')]({},_0x4ad12a,_0x32fcb0[_0x356e('0x3f')]);return _0x4980fc['getContacts'](_0x4ad12a);}})[_0x356e('0x27')](function(_0x5cb3ae){if(_0x5cb3ae){_0x40ca20=_0x5cb3ae[_0x356e('0x46')];if(!_0x32fcb0[_0x356e('0x30')][_0x356e('0x36')](_0x356e('0x37'))){_0x4ad12a[_0x356e('0x1f')]=qs['limit'](_0x32fcb0[_0x356e('0x30')][_0x356e('0x1f')]);_0x4ad12a['offset']=qs[_0x356e('0x1d')](_0x32fcb0[_0x356e('0x30')]['offset']);}return _0x4980fc[_0x356e('0x59')](_0x4ad12a);}})[_0x356e('0x27')](function(_0x3a175b){if(_0x3a175b){return _0x3a175b?{'count':_0x40ca20,'rows':_0x3a175b}:null;}})[_0x356e('0x27')](respondWithResult(_0x4b64c7,null))[_0x356e('0x43')](handleError(_0x4b64c7,null));}; \ No newline at end of file +var _0xeb5c=['user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','CmContact','addContacts','ids','getContacts','rawAttributes','map','eml-format','zip-dir','fast-json-patch','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','filter','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x46ca9b,_0x3e05d4){var _0x35f75b=function(_0x169cdf){while(--_0x169cdf){_0x46ca9b['push'](_0x46ca9b['shift']());}};_0x35f75b(++_0x3e05d4);}(_0xeb5c,0x114));var _0xceb5=function(_0x5924c8,_0x3326f2){_0x5924c8=_0x5924c8-0x0;var _0x2cf1c9=_0xeb5c[_0x5924c8];return _0x2cf1c9;};'use strict';var emlformat=require(_0xceb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xceb5('0x1'));var jsonpatch=require(_0xceb5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xceb5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xceb5('0x4'));var sox=require(_0xceb5('0x5'));var csv=require(_0xceb5('0x6'));var ejs=require(_0xceb5('0x7'));var fs=require('fs');var fs_extra=require(_0xceb5('0x8'));var _=require(_0xceb5('0x9'));var squel=require(_0xceb5('0xa'));var crypto=require(_0xceb5('0xb'));var jsforce=require(_0xceb5('0xc'));var deskjs=require(_0xceb5('0xd'));var toCsv=require(_0xceb5('0x6'));var querystring=require(_0xceb5('0xe'));var Papa=require(_0xceb5('0xf'));var Redis=require(_0xceb5('0x10'));var authService=require(_0xceb5('0x11'));var qs=require(_0xceb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xceb5('0x13'))(_0xceb5('0x14'));var utils=require(_0xceb5('0x15'));var config=require(_0xceb5('0x16'));var licenseUtil=require(_0xceb5('0x17'));var db=require(_0xceb5('0x18'))['db'];function respondWithStatusCode(_0x23b797,_0xd2b5fa){_0xd2b5fa=_0xd2b5fa||0xcc;return function(_0x414bd3){if(_0x414bd3){return _0x23b797[_0xceb5('0x19')](_0xd2b5fa);}return _0x23b797[_0xceb5('0x1a')](_0xd2b5fa)[_0xceb5('0x1b')]();};}function respondWithResult(_0x2e1865,_0x2c8e52){_0x2c8e52=_0x2c8e52||0xc8;return function(_0xc7b6be){if(_0xc7b6be){return _0x2e1865['status'](_0x2c8e52)[_0xceb5('0x1c')](_0xc7b6be);}};}function respondWithFilteredResult(_0x1d6e8b,_0x52092c){return function(_0xb23481){if(_0xb23481){var _0x3fc01e=typeof _0x52092c[_0xceb5('0x1d')]===_0xceb5('0x1e')&&typeof _0x52092c['limit']==='undefined';var _0x20b33b=_0xb23481[_0xceb5('0x1f')];var _0x34faed=_0x3fc01e?0x0:_0x52092c[_0xceb5('0x1d')];var _0x3206c1=_0x3fc01e?_0xb23481['count']:_0x52092c[_0xceb5('0x1d')]+_0x52092c['limit'];var _0x318778;if(_0x3206c1>=_0x20b33b){_0x3206c1=_0x20b33b;_0x318778=0xc8;}else{_0x318778=0xce;}_0x1d6e8b[_0xceb5('0x1a')](_0x318778);return _0x1d6e8b['set'](_0xceb5('0x20'),_0x34faed+'-'+_0x3206c1+'/'+_0x20b33b)[_0xceb5('0x1c')](_0xb23481);}return null;};}function patchUpdates(_0x22b187){return function(_0x1da8a8){try{jsonpatch[_0xceb5('0x21')](_0x1da8a8,_0x22b187,!![]);}catch(_0x4d7c3e){return BPromise[_0xceb5('0x22')](_0x4d7c3e);}return _0x1da8a8['save']();};}function saveUpdates(_0x52b583,_0x5c31c1){return function(_0x5cce1d){if(_0x5cce1d){return _0x5cce1d[_0xceb5('0x23')](_0x52b583)[_0xceb5('0x24')](function(_0x284db4){return _0x284db4;});}return null;};}function removeEntity(_0x54a68e,_0xb3ef43){return function(_0x5d1a1a){if(_0x5d1a1a){return _0x5d1a1a[_0xceb5('0x25')]()[_0xceb5('0x24')](function(){var _0x5e1f0f=_0x5d1a1a[_0xceb5('0x26')]({'plain':!![]});var _0x1594e2=_0xceb5('0x27');return db['UserProfileResource'][_0xceb5('0x25')]({'where':{'type':_0x1594e2,'resourceId':_0x5e1f0f['id']}})[_0xceb5('0x24')](function(){return _0x5d1a1a;});})[_0xceb5('0x24')](function(){_0x54a68e[_0xceb5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a310b,_0x2d3679){return function(_0x358a6d){if(!_0x358a6d){_0x1a310b[_0xceb5('0x19')](0x194);}return _0x358a6d;};}function handleError(_0x436eb8,_0x3ee204){_0x3ee204=_0x3ee204||0x1f4;return function(_0x13cf1e){logger[_0xceb5('0x28')](_0x13cf1e[_0xceb5('0x29')]);if(_0x13cf1e[_0xceb5('0x2a')]){delete _0x13cf1e[_0xceb5('0x2a')];}_0x436eb8[_0xceb5('0x1a')](_0x3ee204)[_0xceb5('0x2b')](_0x13cf1e);};}exports[_0xceb5('0x2c')]=function(_0x87d3a8,_0x33014f){var _0x221114={},_0x2145be={},_0x19e01e={'count':0x0,'rows':[]};return db[_0xceb5('0x2d')]['describe']()['then'](function(_0x4b76c0){_0x2145be['model']=_['keys'](_0x4b76c0);_0x2145be[_0xceb5('0x2e')]=_[_0xceb5('0x2f')](_0x87d3a8[_0xceb5('0x2e')]);_0x2145be[_0xceb5('0x30')]=_['intersection'](_0x2145be[_0xceb5('0x31')],_0x2145be[_0xceb5('0x2e')]);_0x221114[_0xceb5('0x32')]=_[_0xceb5('0x33')](_0x2145be['model'],qs[_0xceb5('0x34')](_0x87d3a8['query'][_0xceb5('0x34')]));_0x221114['attributes']=_0x221114[_0xceb5('0x32')][_0xceb5('0x35')]?_0x221114[_0xceb5('0x32')]:_0x2145be[_0xceb5('0x31')];if(!_0x87d3a8['query'][_0xceb5('0x36')](_0xceb5('0x37'))){_0x221114[_0xceb5('0x38')]=qs[_0xceb5('0x38')](_0x87d3a8['query'][_0xceb5('0x38')]);_0x221114[_0xceb5('0x1d')]=qs[_0xceb5('0x1d')](_0x87d3a8[_0xceb5('0x2e')][_0xceb5('0x1d')]);}_0x221114[_0xceb5('0x39')]=qs[_0xceb5('0x3a')](_0x87d3a8[_0xceb5('0x2e')][_0xceb5('0x3a')]);_0x221114['where']=qs[_0xceb5('0x30')](_[_0xceb5('0x3b')](_0x87d3a8['query'],_0x2145be['filters']),_0x4b76c0);if(_0x87d3a8[_0xceb5('0x2e')]['filter']){_0x221114['where']=_[_0xceb5('0x3c')](_0x221114[_0xceb5('0x3d')],{'$or':_['map'](_0x221114['attributes'],function(_0x57fb8f){var _0x3b40a5={};_0x3b40a5[_0x57fb8f]={'$like':'%'+_0x87d3a8[_0xceb5('0x2e')][_0xceb5('0x3e')]+'%'};return _0x3b40a5;})});}_0x221114=_['merge']({},_0x221114,_0x87d3a8['options']);var _0x39dbfa={'where':_0x221114[_0xceb5('0x3d')]};return db[_0xceb5('0x2d')][_0xceb5('0x1f')](_0x39dbfa)[_0xceb5('0x24')](function(_0x5100a3){_0x19e01e[_0xceb5('0x1f')]=_0x5100a3;if(_0x87d3a8[_0xceb5('0x2e')]['includeAll']){_0x221114['include']=[{'all':!![]}];}return db['CmCompany'][_0xceb5('0x3f')](_0x221114);})[_0xceb5('0x24')](function(_0x41330d){_0x19e01e[_0xceb5('0x40')]=_0x41330d;return _0x19e01e;})[_0xceb5('0x24')](respondWithFilteredResult(_0x33014f,_0x221114))[_0xceb5('0x41')](handleError(_0x33014f,null));})[_0xceb5('0x41')](handleError(_0x33014f,null));};exports[_0xceb5('0x42')]=function(_0x19ecc1,_0x429553){var _0x49e002={'raw':![],'where':{'id':_0x19ecc1[_0xceb5('0x43')]['id']}},_0x593849={};_0x593849[_0xceb5('0x31')]=_['keys'](db['CmCompany']['rawAttributes']);_0x593849[_0xceb5('0x2e')]=_[_0xceb5('0x2f')](_0x19ecc1[_0xceb5('0x2e')]);_0x593849[_0xceb5('0x30')]=_['intersection'](_0x593849['model'],_0x593849[_0xceb5('0x2e')]);_0x49e002[_0xceb5('0x32')]=_[_0xceb5('0x33')](_0x593849[_0xceb5('0x31')],qs[_0xceb5('0x34')](_0x19ecc1[_0xceb5('0x2e')][_0xceb5('0x34')]));_0x49e002['attributes']=_0x49e002[_0xceb5('0x32')]['length']?_0x49e002[_0xceb5('0x32')]:_0x593849[_0xceb5('0x31')];if(_0x19ecc1[_0xceb5('0x2e')][_0xceb5('0x44')]){_0x49e002[_0xceb5('0x45')]=[{'all':!![]}];}_0x49e002=_[_0xceb5('0x3c')]({},_0x49e002,_0x19ecc1[_0xceb5('0x46')]);return db[_0xceb5('0x2d')][_0xceb5('0x47')](_0x49e002)[_0xceb5('0x24')](handleEntityNotFound(_0x429553,null))[_0xceb5('0x24')](respondWithResult(_0x429553,null))[_0xceb5('0x41')](handleError(_0x429553,null));};exports['create']=function(_0x3cf319,_0xf67136){return db[_0xceb5('0x2d')][_0xceb5('0x48')](_0x3cf319[_0xceb5('0x49')],{})[_0xceb5('0x24')](function(_0x38d6d8){var _0x3c10ec=_0x3cf319['user'][_0xceb5('0x26')]({'plain':!![]});if(!_0x3c10ec)throw new Error(_0xceb5('0x4a'));if(_0x3c10ec[_0xceb5('0x4b')]===_0xceb5('0x4c')){var _0xccc0cd=_0x38d6d8[_0xceb5('0x26')]({'plain':!![]});var _0x3af57f=_0xceb5('0x27');return db[_0xceb5('0x4d')][_0xceb5('0x47')]({'where':{'name':_0x3af57f,'userProfileId':_0x3c10ec['userProfileId']},'raw':!![]})[_0xceb5('0x24')](function(_0x42e5b1){if(_0x42e5b1&&_0x42e5b1[_0xceb5('0x4e')]===0x0){return db[_0xceb5('0x4f')][_0xceb5('0x48')]({'name':_0xccc0cd[_0xceb5('0x2a')],'resourceId':_0xccc0cd['id'],'type':_0x42e5b1[_0xceb5('0x2a')],'sectionId':_0x42e5b1['id']},{})[_0xceb5('0x24')](function(){return _0x38d6d8;});}else{return _0x38d6d8;}})[_0xceb5('0x41')](function(_0x26514b){logger[_0xceb5('0x28')](_0xceb5('0x50'),_0x26514b);throw _0x26514b;});}return _0x38d6d8;})[_0xceb5('0x24')](respondWithResult(_0xf67136,0xc9))[_0xceb5('0x41')](handleError(_0xf67136,null));};exports[_0xceb5('0x23')]=function(_0x4f442b,_0xda2f7d){if(_0x4f442b[_0xceb5('0x49')]['id']){delete _0x4f442b['body']['id'];}return db['CmCompany'][_0xceb5('0x47')]({'where':{'id':_0x4f442b['params']['id']}})[_0xceb5('0x24')](handleEntityNotFound(_0xda2f7d,null))[_0xceb5('0x24')](saveUpdates(_0x4f442b[_0xceb5('0x49')],null))[_0xceb5('0x24')](respondWithResult(_0xda2f7d,null))[_0xceb5('0x41')](handleError(_0xda2f7d,null));};exports[_0xceb5('0x25')]=function(_0x32f74a,_0x1265c8){return db['CmCompany'][_0xceb5('0x47')]({'where':{'id':_0x32f74a[_0xceb5('0x43')]['id']}})[_0xceb5('0x24')](handleEntityNotFound(_0x1265c8,null))['then'](removeEntity(_0x1265c8,null))[_0xceb5('0x41')](handleError(_0x1265c8,null));};exports['describe']=function(_0x25e1e6,_0x4c4adc){return db[_0xceb5('0x2d')][_0xceb5('0x51')]()[_0xceb5('0x24')](respondWithResult(_0x4c4adc,null))[_0xceb5('0x41')](handleError(_0x4c4adc,null));};exports['addContacts']=function(_0x15dc80,_0x187a42,_0x576e2d){return db[_0xceb5('0x52')][_0xceb5('0x47')]({'where':{'id':_0x15dc80[_0xceb5('0x43')]['id']}})[_0xceb5('0x24')](handleEntityNotFound(_0x187a42,null))[_0xceb5('0x24')](function(_0x38ff69){if(_0x38ff69){return _0x38ff69[_0xceb5('0x53')](_0x15dc80['body'][_0xceb5('0x54')],_['omit'](_0x15dc80[_0xceb5('0x49')],[_0xceb5('0x54'),'id'])||{});}})[_0xceb5('0x24')](respondWithResult(_0x187a42,null))[_0xceb5('0x41')](handleError(_0x187a42,null));};exports[_0xceb5('0x55')]=function(_0x8b9862,_0x3c3cbe,_0x554b86){var _0x4b0764={};var _0x44982f={};var _0xfd1463;var _0x90f27c;return db[_0xceb5('0x2d')]['findOne']({'where':{'id':_0x8b9862[_0xceb5('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c3cbe,null))[_0xceb5('0x24')](function(_0x4f915f){if(_0x4f915f){_0xfd1463=_0x4f915f;_0x44982f['model']=_[_0xceb5('0x2f')](db[_0xceb5('0x52')][_0xceb5('0x56')]);_0x44982f[_0xceb5('0x2e')]=_[_0xceb5('0x2f')](_0x8b9862['query']);_0x44982f[_0xceb5('0x30')]=_[_0xceb5('0x33')](_0x44982f['model'],_0x44982f['query']);_0x4b0764[_0xceb5('0x32')]=_[_0xceb5('0x33')](_0x44982f[_0xceb5('0x31')],qs['fields'](_0x8b9862[_0xceb5('0x2e')][_0xceb5('0x34')]));_0x4b0764[_0xceb5('0x32')]=_0x4b0764['attributes'][_0xceb5('0x35')]?_0x4b0764[_0xceb5('0x32')]:_0x44982f['model'];_0x4b0764[_0xceb5('0x39')]=qs[_0xceb5('0x3a')](_0x8b9862['query'][_0xceb5('0x3a')]);_0x4b0764[_0xceb5('0x3d')]=qs[_0xceb5('0x30')](_['pick'](_0x8b9862['query'],_0x44982f[_0xceb5('0x30')]));if(_0x8b9862['query'][_0xceb5('0x3e')]){_0x4b0764[_0xceb5('0x3d')]=_[_0xceb5('0x3c')](_0x4b0764['where'],{'$or':_[_0xceb5('0x57')](_0x4b0764[_0xceb5('0x32')],function(_0x1dbf59){var _0x50ca0e={};_0x50ca0e[_0x1dbf59]={'$like':'%'+_0x8b9862[_0xceb5('0x2e')]['filter']+'%'};return _0x50ca0e;})});}_0x4b0764=_[_0xceb5('0x3c')]({},_0x4b0764,_0x8b9862[_0xceb5('0x46')]);return _0xfd1463[_0xceb5('0x55')](_0x4b0764);}})[_0xceb5('0x24')](function(_0x3be68f){if(_0x3be68f){_0x90f27c=_0x3be68f['length'];if(!_0x8b9862[_0xceb5('0x2e')]['hasOwnProperty'](_0xceb5('0x37'))){_0x4b0764['limit']=qs[_0xceb5('0x38')](_0x8b9862[_0xceb5('0x2e')][_0xceb5('0x38')]);_0x4b0764[_0xceb5('0x1d')]=qs[_0xceb5('0x1d')](_0x8b9862[_0xceb5('0x2e')]['offset']);}return _0xfd1463[_0xceb5('0x55')](_0x4b0764);}})[_0xceb5('0x24')](function(_0x558ee9){if(_0x558ee9){return _0x558ee9?{'count':_0x90f27c,'rows':_0x558ee9}:null;}})['then'](respondWithResult(_0x3c3cbe,null))[_0xceb5('0x41')](handleError(_0x3c3cbe,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index d56adc5..4314186 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 _0x10cc=['cm_companies','lodash','moment','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x4ef48d,_0x373152){var _0x1e9115=function(_0xa99fb6){while(--_0xa99fb6){_0x4ef48d['push'](_0x4ef48d['shift']());}};_0x1e9115(++_0x373152);}(_0x10cc,0x6f));var _0xc10c=function(_0x1e7600,_0x11348d){_0x1e7600=_0x1e7600-0x0;var _0x80b052=_0x10cc[_0x1e7600];return _0x80b052;};'use strict';var _=require(_0xc10c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc10c('0x1'));var BPromise=require('bluebird');var rp=require(_0xc10c('0x2'));var fs=require('fs');var path=require(_0xc10c('0x3'));var rimraf=require(_0xc10c('0x4'));var config=require('../../config/environment');var attributes=require(_0xc10c('0x5'));module[_0xc10c('0x6')]=function(_0x482cc2,_0x3a9e2f){return _0x482cc2[_0xc10c('0x7')](_0xc10c('0x8'),attributes,{'tableName':_0xc10c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf767=['CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xf767,0x77));var _0x7f76=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0xf767[_0xe1a3a5];return _0x362646;};'use strict';var _=require(_0x7f76('0x0'));var util=require(_0x7f76('0x1'));var logger=require('../../config/logger')(_0x7f76('0x2'));var moment=require(_0x7f76('0x3'));var BPromise=require(_0x7f76('0x4'));var rp=require(_0x7f76('0x5'));var fs=require('fs');var path=require(_0x7f76('0x6'));var rimraf=require('rimraf');var config=require(_0x7f76('0x7'));var attributes=require(_0x7f76('0x8'));module[_0x7f76('0x9')]=function(_0x495355,_0x4832d1){return _0x495355[_0x7f76('0xa')](_0x7f76('0xb'),attributes,{'tableName':_0x7f76('0xc'),'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 ff512c7..5847130 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 _0xd483=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0xd483,0x158));var _0x3d48=function(_0x493f9b,_0x3df205){_0x493f9b=_0x493f9b-0x0;var _0x1cb2e4=_0xd483[_0x493f9b];return _0x1cb2e4;};'use strict';var _=require('lodash');var util=require(_0x3d48('0x0'));var moment=require(_0x3d48('0x1'));var BPromise=require(_0x3d48('0x2'));var rs=require(_0x3d48('0x3'));var fs=require('fs');var Redis=require(_0x3d48('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d48('0x5'))(_0x3d48('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d48('0x7')][_0x3d48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c1f9e,_0x19d8f0,_0x423c26){return new BPromise(function(_0x1899eb,_0x504d53){return client[_0x3d48('0x9')](_0x3c1f9e,_0x423c26)[_0x3d48('0xa')](function(_0x373278){logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x19d8f0,_0x3d48('0xd'));logger[_0x3d48('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x19d8f0,_0x3d48('0xd'),JSON[_0x3d48('0xf')](_0x373278));if(_0x373278[_0x3d48('0x10')]){if(_0x373278['error']['code']===0x1f4){logger[_0x3d48('0x10')](_0x3d48('0xc'),_0x19d8f0,_0x373278[_0x3d48('0x10')][_0x3d48('0x11')]);return _0x504d53(_0x373278[_0x3d48('0x10')]['message']);}logger[_0x3d48('0x10')]('CmCompany,\x20%s,\x20%s',_0x19d8f0,_0x373278[_0x3d48('0x10')][_0x3d48('0x11')]);return _0x1899eb(_0x373278[_0x3d48('0x10')]['message']);}else{logger[_0x3d48('0xb')](_0x3d48('0xc'),_0x19d8f0,_0x3d48('0xd'));_0x1899eb(_0x373278[_0x3d48('0x12')][_0x3d48('0x11')]);}})[_0x3d48('0x13')](function(_0x53a278){logger['error']('CmCompany,\x20%s,\x20%s',_0x19d8f0,_0x53a278);_0x504d53(_0x53a278);});});} \ No newline at end of file +var _0xcb1c=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2b0fed,_0x2a4779){var _0x34bfad=function(_0x47852b){while(--_0x47852b){_0x2b0fed['push'](_0x2b0fed['shift']());}};_0x34bfad(++_0x2a4779);}(_0xcb1c,0x1e6));var _0xccb1=function(_0x3a17b0,_0x32a3b6){_0x3a17b0=_0x3a17b0-0x0;var _0xda8c4=_0xcb1c[_0x3a17b0];return _0xda8c4;};'use strict';var _=require(_0xccb1('0x0'));var util=require(_0xccb1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xccb1('0x2'));var fs=require('fs');var Redis=require(_0xccb1('0x3'));var db=require(_0xccb1('0x4'))['db'];var utils=require(_0xccb1('0x5'));var logger=require(_0xccb1('0x6'))(_0xccb1('0x7'));var config=require(_0xccb1('0x8'));var jayson=require(_0xccb1('0x9'));var client=jayson['client'][_0xccb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12730c,_0x4f8ace,_0x43d6f9){return new BPromise(function(_0x7e694d,_0x462892){return client[_0xccb1('0xb')](_0x12730c,_0x43d6f9)[_0xccb1('0xc')](function(_0x6be1ce){logger[_0xccb1('0xd')](_0xccb1('0xe'),_0x4f8ace,_0xccb1('0xf'));logger['debug'](_0xccb1('0x10'),_0x4f8ace,_0xccb1('0xf'),JSON[_0xccb1('0x11')](_0x6be1ce));if(_0x6be1ce['error']){if(_0x6be1ce[_0xccb1('0x12')]['code']===0x1f4){logger[_0xccb1('0x12')](_0xccb1('0xe'),_0x4f8ace,_0x6be1ce[_0xccb1('0x12')]['message']);return _0x462892(_0x6be1ce[_0xccb1('0x12')]['message']);}logger[_0xccb1('0x12')]('CmCompany,\x20%s,\x20%s',_0x4f8ace,_0x6be1ce[_0xccb1('0x12')]['message']);return _0x7e694d(_0x6be1ce[_0xccb1('0x12')][_0xccb1('0x13')]);}else{logger[_0xccb1('0xd')]('CmCompany,\x20%s,\x20%s',_0x4f8ace,_0xccb1('0xf'));_0x7e694d(_0x6be1ce[_0xccb1('0x14')][_0xccb1('0x13')]);}})[_0xccb1('0x15')](function(_0x11791b){logger[_0xccb1('0x12')](_0xccb1('0xe'),_0x4f8ace,_0x11791b);_0x462892(_0x11791b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b646b02..34a4c00 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 _0x910f=['post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','/:id','show','/:id/contacts','getContacts'];(function(_0x3ac2d9,_0x74b171){var _0x226f20=function(_0x508369){while(--_0x508369){_0x3ac2d9['push'](_0x3ac2d9['shift']());}};_0x226f20(++_0x74b171);}(_0x910f,0xb0));var _0xf910=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x910f[_0x2850c0];return _0x21e830;};'use strict';var multer=require(_0xf910('0x0'));var util=require(_0xf910('0x1'));var path=require(_0xf910('0x2'));var timeout=require(_0xf910('0x3'));var express=require(_0xf910('0x4'));var router=express[_0xf910('0x5')]();var fs_extra=require(_0xf910('0x6'));var auth=require(_0xf910('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0xf910('0x8')](),controller[_0xf910('0x9')]);router[_0xf910('0xa')](_0xf910('0xb'),auth[_0xf910('0x8')](),controller['describe']);router[_0xf910('0xa')](_0xf910('0xc'),auth[_0xf910('0x8')](),controller[_0xf910('0xd')]);router[_0xf910('0xa')](_0xf910('0xe'),auth['isAuthenticated'](),controller[_0xf910('0xf')]);router[_0xf910('0x10')]('/',auth[_0xf910('0x8')](),controller[_0xf910('0x11')]);router[_0xf910('0x10')]('/:id/contacts',auth[_0xf910('0x8')](),controller[_0xf910('0x12')]);router[_0xf910('0x13')](_0xf910('0xc'),auth['isAuthenticated'](),controller[_0xf910('0x14')]);router[_0xf910('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xf910('0x16')]);module[_0xf910('0x17')]=router; \ No newline at end of file +var _0x6523=['/:id','show','post','/:id/contacts','addContacts','update','destroy','exports','path','express','Router','../../config/environment','./cmCompany.controller','get','isAuthenticated','describe'];(function(_0x7ca45d,_0x2859ad){var _0x211de5=function(_0x3ddb6b){while(--_0x3ddb6b){_0x7ca45d['push'](_0x7ca45d['shift']());}};_0x211de5(++_0x2859ad);}(_0x6523,0x148));var _0x3652=function(_0x7074d5,_0x427953){_0x7074d5=_0x7074d5-0x0;var _0xced075=_0x6523[_0x7074d5];return _0xced075;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3652('0x0'));var timeout=require('connect-timeout');var express=require(_0x3652('0x1'));var router=express[_0x3652('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3652('0x3'));var controller=require(_0x3652('0x4'));router[_0x3652('0x5')]('/',auth[_0x3652('0x6')](),controller['index']);router[_0x3652('0x5')]('/describe',auth[_0x3652('0x6')](),controller[_0x3652('0x7')]);router['get'](_0x3652('0x8'),auth['isAuthenticated'](),controller[_0x3652('0x9')]);router[_0x3652('0x5')]('/:id/contacts',auth[_0x3652('0x6')](),controller['getContacts']);router[_0x3652('0xa')]('/',auth[_0x3652('0x6')](),controller['create']);router['post'](_0x3652('0xb'),auth['isAuthenticated'](),controller[_0x3652('0xc')]);router['put']('/:id',auth[_0x3652('0x6')](),controller[_0x3652('0xd')]);router['delete'](_0x3652('0x8'),auth[_0x3652('0x6')](),controller[_0x3652('0xe')]);module[_0x3652('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 90a564c..9a7a061 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 _0x1d50=['lodash','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1d50,0xfc));var _0x01d5=function(_0x5023ff,_0x3b7100){_0x5023ff=_0x5023ff-0x0;var _0x409ec3=_0x1d50[_0x5023ff];return _0x409ec3;};'use strict';var _=require(_0x01d5('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x01d5('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x01d5('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x01d5('0x1')]},'description':{'type':Sequelize[_0x01d5('0x2')]},'phone':{'type':Sequelize[_0x01d5('0x1')]},'mobile':{'type':Sequelize[_0x01d5('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x01d5('0x1')]},'facebook':{'type':Sequelize[_0x01d5('0x1')]},'fb_data':{'type':Sequelize[_0x01d5('0x1')]},'twitter':{'type':Sequelize[_0x01d5('0x1')]},'skype':{'type':Sequelize[_0x01d5('0x1')]},'teams':{'type':Sequelize[_0x01d5('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x01d5('0x1')]},'wechat':{'type':Sequelize[_0x01d5('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x01d5('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x01d5('0x1')]},'priority':{'type':Sequelize[_0x01d5('0x3')](0x2)[_0x01d5('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x01d5('0x5')],'defaultValue':Sequelize[_0x01d5('0x6')]},'dialTimezone':{'type':Sequelize[_0x01d5('0x1')]},'utcOffset':{'type':Sequelize[_0x01d5('0x3')]}}; \ No newline at end of file +var _0x29b9=['DATE','NOW','lodash','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3cf227,_0x2b6213){var _0x5590c2=function(_0x48c11c){while(--_0x48c11c){_0x3cf227['push'](_0x3cf227['shift']());}};_0x5590c2(++_0x2b6213);}(_0x29b9,0x17c));var _0x929b=function(_0xefed01,_0x5bac62){_0xefed01=_0xefed01-0x0;var _0x138c35=_0x29b9[_0xefed01];return _0x138c35;};'use strict';var _=require(_0x929b('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x929b('0x1')]},'street':{'type':Sequelize[_0x929b('0x1')]},'postalCode':{'type':Sequelize[_0x929b('0x1')]},'city':{'type':Sequelize[_0x929b('0x1')]},'country':{'type':Sequelize[_0x929b('0x1')]},'dateOfBirth':{'type':Sequelize[_0x929b('0x1')]},'description':{'type':Sequelize[_0x929b('0x2')]},'phone':{'type':Sequelize[_0x929b('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x929b('0x1')]},'facebook':{'type':Sequelize[_0x929b('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x929b('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x929b('0x1')]},'viber':{'type':Sequelize[_0x929b('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x929b('0x1')]},'telegram':{'type':Sequelize[_0x929b('0x1')]},'UserId':{'type':Sequelize[_0x929b('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x929b('0x1')]},'priority':{'type':Sequelize[_0x929b('0x3')](0x2)[_0x929b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x929b('0x5')],'defaultValue':Sequelize[_0x929b('0x6')]},'dialTimezone':{'type':Sequelize[_0x929b('0x1')]},'utcOffset':{'type':Sequelize[_0x929b('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 4ec716d..e5ca75f 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 1fc8572..737810e 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5992=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x424f2e,_0x1c3e1a){var _0x4bee9a=function(_0x150fa1){while(--_0x150fa1){_0x424f2e['push'](_0x424f2e['shift']());}};_0x4bee9a(++_0x1c3e1a);}(_0x5992,0x177));var _0x2599=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x5992[_0x24061a];return _0x82054e;};'use strict';var EventEmitter=require(_0x2599('0x0'));var CmContact=require(_0x2599('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x2599('0x2')](0x0);var events={'afterCreate':_0x2599('0x3'),'afterUpdate':_0x2599('0x4'),'afterDestroy':_0x2599('0x5')};function emitEvent(_0x6becd8){return function(_0x412dcc,_0x48568f,_0x3863f5){CmContactEvents['emit'](_0x6becd8+':'+_0x412dcc['id'],_0x412dcc);CmContactEvents[_0x2599('0x6')](_0x6becd8,_0x412dcc);_0x3863f5(null);};}for(var e in events){if(events[_0x2599('0x7')](e)){var event=events[e];CmContact[_0x2599('0x8')](e,emitEvent(event));}}module[_0x2599('0x9')]=CmContactEvents; \ No newline at end of file +var _0x7a98=['hook','CmContact','remove','emit','hasOwnProperty'];(function(_0x469ccf,_0x1897a3){var _0x425e20=function(_0x34f716){while(--_0x34f716){_0x469ccf['push'](_0x469ccf['shift']());}};_0x425e20(++_0x1897a3);}(_0x7a98,0x18c));var _0x87a9=function(_0x40f9ca,_0xfbe7fb){_0x40f9ca=_0x40f9ca-0x0;var _0x596ba5=_0x7a98[_0x40f9ca];return _0x596ba5;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db'][_0x87a9('0x0')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x87a9('0x1')};function emitEvent(_0x257bae){return function(_0xd09f98,_0x32bffa,_0x47fd5b){CmContactEvents[_0x87a9('0x2')](_0x257bae+':'+_0xd09f98['id'],_0xd09f98);CmContactEvents[_0x87a9('0x2')](_0x257bae,_0xd09f98);_0x47fd5b(null);};}for(var e in events){if(events[_0x87a9('0x3')](e)){var event=events[e];CmContact[_0x87a9('0x4')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index f8fb611..0ff7820 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9e7=['CmHopperFinal','cmContact,\x20afterCreate,\x20','ListId','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','length','get','VoiceQueue','CmList','BlackLists','CmHopperBlack','afterCreate','always','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','api','moment','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','error','cmContact','inspect','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','isNil','timezones','utcOffset','scheduledat','minutes','then','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xd9e7,0x177));var _0x7d9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xd9e7[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x7d9e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d9e('0x1'));var moment=require(_0x7d9e('0x2'));var BPromise=require(_0x7d9e('0x3'));var rp=require(_0x7d9e('0x4'));var fs=require('fs');var path=require(_0x7d9e('0x5'));var rimraf=require('rimraf');var config=require(_0x7d9e('0x6'));var shared=require(_0x7d9e('0x7'));var attributes=require(_0x7d9e('0x8'));module[_0x7d9e('0x9')]=function(_0x522fa6,_0x477196){return _0x522fa6['define'](_0x7d9e('0xa'),attributes,{'tableName':_0x7d9e('0xb'),'paranoid':!![],'indexes':[{'name':_0x7d9e('0xc'),'fields':['phone']},{'name':_0x7d9e('0xd'),'fields':['firstName','lastName',_0x7d9e('0xc'),'mobile','fax',_0x7d9e('0xe')],'type':_0x7d9e('0xf')}],'timestamps':!![],'charset':_0x7d9e('0x10'),'collate':_0x7d9e('0x11'),'hooks':{'afterCreate':function(_0x2608b5,_0x587789,_0xf55945){var _0x1a70d1=_0x522fa6['models'];var _0x2386ab=_0x2608b5['get']({'plain':!![]});function _0x26661b(){return function(_0x293a6b){logger[_0x7d9e('0x12')](_0x7d9e('0x13'),'afterCreate',util[_0x7d9e('0x14')](_0x293a6b,{'showHidden':![],'depth':null}));};}function _0x15729c(_0x229a11,_0x63f6e2){var _0x23411b=_0x63f6e2['scheduledat']?_0x63f6e2['scheduledat']:moment()[_0x7d9e('0x15')](_0x7d9e('0x16'));return new BPromise(function(_0xbfe01d,_0x2b847f){if(_['isNil'](_0x63f6e2[_0x7d9e('0x17')])){_0xbfe01d({'ret':_0x23411b});}else{_0x1a70d1['VoiceQueue']['findOne']({'where':{'id':_0x229a11['id']}})['then'](function(_0x4e8742){if(!_['isNil'](_0x4e8742)){var _0x20dfa2=_0x4e8742[_0x7d9e('0x17')];if(!_[_0x7d9e('0x18')](_0x20dfa2)){var _0x445eda=shared[_0x7d9e('0x19')];var _0x18b342=_0x445eda[_0x20dfa2];var _0xa2823e=_0x445eda[_0x63f6e2['dialTimezone']];if(!_[_0x7d9e('0x18')](_0x18b342)&&!_[_0x7d9e('0x18')](_0xa2823e)){var _0x3d6253=_0x18b342[_0x7d9e('0x1a')]-_0xa2823e[_0x7d9e('0x1a')];_0x23411b=_0x63f6e2[_0x7d9e('0x1b')]?_0x63f6e2[_0x7d9e('0x1b')]:moment();var _0x4da768=moment(_0x23411b)['add'](_0x3d6253,_0x7d9e('0x1c'));_0xbfe01d({'ret':_0x4da768[_0x7d9e('0x15')](_0x7d9e('0x16'))});}else _0xbfe01d({'ret':_0x23411b});}else _0xbfe01d({'ret':_0x23411b});}else{_0xbfe01d({'ret':_0x23411b});}});}});return 0xa;}var _0x15ad46=function(_0x22c421){return new BPromise(function(_0x11b150,_0x69d0cf){_0x15729c(_0x22c421,_0x2386ab)[_0x7d9e('0x1d')](function(_0x53e647){_0x2386ab[_0x7d9e('0x1b')]=_0x53e647[_0x7d9e('0x1e')];_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x20')]({'where':{'phone':_0x2386ab[_0x7d9e('0xc')],'VoiceQueueId':_0x22c421['id']}})[_0x7d9e('0x1d')](function(_0x4ff2d7){if(!_['isNil'](_0x4ff2d7)){throw new Error(_0x7d9e('0x21')+_0x2386ab[_0x7d9e('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x22c421['id']);}return _0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab['phone'],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab['ListId'],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab[_0x7d9e('0x1b')]:moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab['callbackUniqueid']?_0x2386ab[_0x7d9e('0x24')]:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'VoiceQueueId':_0x22c421['id']});})[_0x7d9e('0x25')](function(_0x242916){_0x69d0cf(_0x242916);});});});};var _0x1efc20=function(_0x5b86dd){return new BPromise(function(_0x54f2b8,_0x398965){_0x15729c(_0x5b86dd,_0x2386ab)[_0x7d9e('0x1d')](function(_0x2dca4c){_0x2386ab[_0x7d9e('0x1b')]=_0x2dca4c[_0x7d9e('0x1e')];_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x20')]({'where':{'phone':_0x2386ab['phone'],'VoiceQueueId':_0x5b86dd['id']}})[_0x7d9e('0x1d')](function(_0x46377e){if(!_[_0x7d9e('0x18')](_0x46377e)){throw new Error(_0x7d9e('0x21')+_0x2386ab[_0x7d9e('0xc')]+_0x7d9e('0x26')+_0x5b86dd['id']);}return _0x1a70d1[_0x7d9e('0x27')][_0x7d9e('0x20')]({'where':{'calleridnum':_0x2386ab['phone'],'VoiceQueueId':_0x5b86dd['id']}});})[_0x7d9e('0x1d')](function(_0x18612f){if(!_[_0x7d9e('0x18')](_0x18612f)){throw new Error(_0x7d9e('0x28')+_0x2386ab['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5b86dd['id']);}return _0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab['phone'],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab['priority']:0x2,'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab[_0x7d9e('0x1b')]:moment()['format'](_0x7d9e('0x16')),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab['callbackUniqueid']?_0x2386ab[_0x7d9e('0x24')]:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()['format'](_0x7d9e('0x16')):undefined,'VoiceQueueId':_0x5b86dd['id']});})[_0x7d9e('0x25')](function(_0x3a7d75){_0x398965(_0x3a7d75);});});});};function _0x5ddb6a(){return function(_0x17158c){logger[_0x7d9e('0x12')](_0x7d9e('0x13'),'afterCreate',util[_0x7d9e('0x14')](_0x17158c,{'showHidden':![],'depth':null}));};}function _0x3f4f5a(_0x2b142a,_0x1a240d){var _0x2ce55b=_0x1a240d[_0x7d9e('0x1b')]?_0x1a240d[_0x7d9e('0x1b')]:moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2b324c,_0x5f5b64){if(_[_0x7d9e('0x18')](_0x1a240d[_0x7d9e('0x17')])){_0x2b324c({'ret':_0x2ce55b});}else{_0x1a70d1[_0x7d9e('0x2a')][_0x7d9e('0x20')]({'where':{'id':_0x2b142a['id']}})['then'](function(_0x503bb3){if(!_[_0x7d9e('0x18')](_0x503bb3)){var _0x1d817d=_0x503bb3[_0x7d9e('0x17')];if(!_['isNil'](_0x1d817d)){var _0x20f7e2=shared[_0x7d9e('0x19')];var _0x38d85a=_0x20f7e2[_0x1d817d];var _0x23ffd3=_0x20f7e2[_0x1a240d[_0x7d9e('0x17')]];if(!_[_0x7d9e('0x18')](_0x38d85a)&&!_[_0x7d9e('0x18')](_0x23ffd3)){var _0x5c4f1b=_0x38d85a['utcOffset']-_0x23ffd3['utcOffset'];_0x2ce55b=_0x1a240d['scheduledat']?_0x1a240d[_0x7d9e('0x1b')]:moment();var _0x538eaf=moment(_0x2ce55b)['add'](_0x5c4f1b,'minutes');_0x2b324c({'ret':_0x538eaf[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2b324c({'ret':_0x2ce55b});}else _0x2b324c({'ret':_0x2ce55b});}else{_0x2b324c({'ret':_0x2ce55b});}});}});return 0xa;}var _0x4ceb5d=function(_0x3d3510){return new BPromise(function(_0x1666e6,_0x30bba0){_0x3f4f5a(_0x3d3510,_0x2386ab)[_0x7d9e('0x1d')](function(_0x559919){_0x2386ab[_0x7d9e('0x1b')]=_0x559919[_0x7d9e('0x1e')];_0x1a70d1['CmHopper']['findOne']({'where':{'phone':_0x2386ab[_0x7d9e('0xc')],'CampaignId':_0x3d3510['id']}})[_0x7d9e('0x1d')](function(_0x404d8e){if(!_[_0x7d9e('0x18')](_0x404d8e)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2386ab['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3d3510['id']);}return _0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab[_0x7d9e('0x1b')]:moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab[_0x7d9e('0x24')]:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'CampaignId':_0x3d3510['id']});})['catch'](function(_0x294e6e){_0x30bba0(_0x294e6e);});});});};var _0xdeb077=function(_0x1bff35){return new BPromise(function(_0x431c02,_0x49da92){_0x3f4f5a(_0x1bff35,_0x2386ab)[_0x7d9e('0x1d')](function(_0x4f29e7){_0x2386ab[_0x7d9e('0x1b')]=_0x4f29e7[_0x7d9e('0x1e')];_0x1a70d1['CmHopper'][_0x7d9e('0x20')]({'where':{'phone':_0x2386ab['phone'],'CampaignId':_0x1bff35['id']}})[_0x7d9e('0x1d')](function(_0x2a00f6){if(!_[_0x7d9e('0x18')](_0x2a00f6)){throw new Error(_0x7d9e('0x21')+_0x2386ab[_0x7d9e('0xc')]+_0x7d9e('0x2b')+_0x1bff35['id']);}return _0x1a70d1[_0x7d9e('0x27')]['findOne']({'where':{'calleridnum':_0x2386ab[_0x7d9e('0xc')],'CampaignId':_0x1bff35['id']}});})[_0x7d9e('0x1d')](function(_0x49fce7){if(!_[_0x7d9e('0x18')](_0x49fce7)){throw new Error(_0x7d9e('0x28')+_0x2386ab[_0x7d9e('0xc')]+_0x7d9e('0x2c')+_0x1bff35['id']);}return _0x1a70d1['CmHopper'][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'scheduledat':_0x2386ab['scheduledat']?_0x2386ab['scheduledat']:moment()[_0x7d9e('0x15')](_0x7d9e('0x16')),'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab['callbackUniqueid']:undefined,'callbackat':_0x2386ab['callbackUniqueid']?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'CampaignId':_0x1bff35['id']});})[_0x7d9e('0x25')](function(_0x443f99){_0x49da92(_0x443f99);});});});};if(_0x2386ab['ListId']){_0x1a70d1['VoiceQueue'][_0x7d9e('0x2d')]({'where':{'type':_0x7d9e('0x2e')},'attributes':['id',_0x7d9e('0x2f'),_0x7d9e('0x17')],'include':[{'model':_0x1a70d1['CmList'],'as':'Lists','where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})[_0x7d9e('0x1d')](function(_0x114e3b){if(_0x114e3b){var _0x236897=[];for(var _0x3435ea=0x0,_0x3140fc;_0x3435ea<_0x114e3b[_0x7d9e('0x30')];_0x3435ea+=0x1){_0x3140fc=_0x114e3b[_0x3435ea][_0x7d9e('0x31')]({'plain':!![]});switch(_0x3140fc[_0x7d9e('0x2f')]){case'always':_0x1efc20(_0x3140fc)[_0x7d9e('0x25')](_0x26661b());break;case'onlyIfOpen':_0x15ad46(_0x3140fc)[_0x7d9e('0x25')](_0x26661b());break;default:_0x3f4f5a(_0x3140fc,_0x2386ab)[_0x7d9e('0x1d')](function(_0x350879){_0x2386ab['scheduledat']=_0x350879[_0x7d9e('0x1e')];_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab['scheduledat']:moment()[_0x7d9e('0x15')](_0x7d9e('0x16')),'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab[_0x7d9e('0x23')]:0x2,'callback':_0x2386ab[_0x7d9e('0x24')]?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab['callbackUniqueid']:undefined,'callbackat':_0x2386ab[_0x7d9e('0x24')]?moment()[_0x7d9e('0x15')](_0x7d9e('0x16')):undefined,'VoiceQueueId':_0x3140fc['id']})[_0x7d9e('0x25')](_0x26661b());});}}}})[_0x7d9e('0x1d')](function(){return _0x1a70d1[_0x7d9e('0x32')][_0x7d9e('0x2d')]({'where':{'type':_0x7d9e('0x2e')},'attributes':['id'],'include':[{'model':_0x1a70d1[_0x7d9e('0x33')],'as':_0x7d9e('0x34'),'where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})['then'](function(_0x2fcce2){if(_0x2fcce2){var _0x1c175f=[];for(var _0x29d2e=0x0,_0x44e4e6;_0x29d2e<_0x2fcce2[_0x7d9e('0x30')];_0x29d2e+=0x1){_0x44e4e6=_0x2fcce2[_0x29d2e][_0x7d9e('0x31')]({'plain':!![]});_0x1a70d1[_0x7d9e('0x35')][_0x7d9e('0x22')]({'phone':_0x2386ab['phone'],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'VoiceQueueId':_0x44e4e6['id']})[_0x7d9e('0x25')](function(_0x4f681c){logger[_0x7d9e('0x12')]('cmContact,\x20%s,\x20%s',_0x7d9e('0x36'),_0x4f681c['message']);});}}});})[_0x7d9e('0x1d')](function(){return _0x1a70d1[_0x7d9e('0x2a')][_0x7d9e('0x2d')]({'attributes':['id',_0x7d9e('0x2f'),_0x7d9e('0x17')],'include':[{'model':_0x1a70d1['CmList'],'as':'Lists','where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})[_0x7d9e('0x1d')](function(_0x2fc0b1){if(_0x2fc0b1){var _0x5f2587=[];for(var _0x18d256=0x0,_0x425454;_0x18d256<_0x2fc0b1[_0x7d9e('0x30')];_0x18d256+=0x1){_0x425454=_0x2fc0b1[_0x18d256][_0x7d9e('0x31')]({'plain':!![]});switch(_0x425454[_0x7d9e('0x2f')]){case _0x7d9e('0x37'):_0xdeb077(_0x425454)[_0x7d9e('0x25')](_0x5ddb6a());break;case'onlyIfOpen':_0x4ceb5d(_0x425454)[_0x7d9e('0x25')](_0x5ddb6a());break;default:_0x1a70d1[_0x7d9e('0x1f')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'scheduledat':_0x2386ab[_0x7d9e('0x1b')]?_0x2386ab['scheduledat']:moment()['format'](_0x7d9e('0x16')),'priority':_0x2386ab[_0x7d9e('0x23')]?_0x2386ab['priority']:0x2,'callback':_0x2386ab['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2386ab[_0x7d9e('0x24')]?_0x2386ab['callbackUniqueid']:undefined,'callbackat':_0x2386ab[_0x7d9e('0x24')]?moment()[_0x7d9e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x425454['id']})[_0x7d9e('0x25')](_0x5ddb6a());}}}});})[_0x7d9e('0x1d')](function(){return _0x1a70d1['Campaign'][_0x7d9e('0x2d')]({'attributes':['id'],'include':[{'model':_0x1a70d1['CmList'],'as':'BlackLists','where':{'id':_0x2386ab[_0x7d9e('0x29')]}}]})[_0x7d9e('0x1d')](function(_0x3774ce){if(_0x3774ce){var _0x53c30d=[];for(var _0x1ed18f=0x0,_0x1b39f7;_0x1ed18f<_0x3774ce[_0x7d9e('0x30')];_0x1ed18f+=0x1){_0x1b39f7=_0x3774ce[_0x1ed18f][_0x7d9e('0x31')]({'plain':!![]});_0x1a70d1[_0x7d9e('0x35')][_0x7d9e('0x22')]({'phone':_0x2386ab[_0x7d9e('0xc')],'ContactId':_0x2386ab['id'],'ListId':_0x2386ab[_0x7d9e('0x29')],'CampaignId':_0x1b39f7['id']})[_0x7d9e('0x25')](function(_0x5f1199){logger[_0x7d9e('0x12')](_0x7d9e('0x38'),_0x7d9e('0x36'),_0x5f1199[_0x7d9e('0x39')]);});}}});})['then'](function(){_0xf55945();})['catch'](function(_0x6c9575){logger[_0x7d9e('0x12')](_0x7d9e('0x38'),_0x7d9e('0x36'),_0x6c9575[_0x7d9e('0x39')]);_0xf55945(_0x6c9575);});}else{_0xf55945(new Error(_0x7d9e('0x3a')));}},'afterDestroy':function(_0x2591de,_0x24b2c8,_0x3eb064){var _0x538296=_0x522fa6[_0x7d9e('0x3b')];var _0x34f98f=_0x2591de['get']({'plain':!![]});return _0x538296[_0x7d9e('0x1f')][_0x7d9e('0x2d')]({'raw':!![],'where':{'ListId':_0x34f98f[_0x7d9e('0x29')],'ContactId':_0x34f98f['id']}})['then'](function(_0x4d1ee){if(!_[_0x7d9e('0x3c')](_0x4d1ee)){var _0x481770=[];for(var _0x1658c7=0x0;_0x1658c7<_0x4d1ee['length'];_0x1658c7+=0x1){var _0x436cff=_0x538296[_0x7d9e('0x1f')][_0x7d9e('0x3d')]({'where':{'ListId':_0x4d1ee[_0x1658c7][_0x7d9e('0x29')],'ContactId':_0x4d1ee[_0x1658c7][_0x7d9e('0x3e')],'VoiceQueueId':_0x4d1ee[_0x1658c7][_0x7d9e('0x3f')],'CampaignId':_0x4d1ee[_0x1658c7][_0x7d9e('0x40')]}});_0x481770[_0x7d9e('0x41')](_0x436cff);}return BPromise[_0x7d9e('0x42')](_0x481770);}})[_0x7d9e('0x1d')](function(_0x4afada){logger['info'](_0x7d9e('0x43'),util['inspect'](_0x4afada,{'showHidden':![],'depth':null}));_0x3eb064();})['catch'](function(_0xa548d1){logger[_0x7d9e('0x12')](_0x7d9e('0x44'),util[_0x7d9e('0x14')](_0xa548d1,{'showHidden':![],'depth':null}));_0x3eb064(_0xa548d1);});}}});}; \ No newline at end of file +var _0xe183=['onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','moment','bluebird','request-promise','path','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','minutes','then','ret','CmHopper','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','Campaign','add','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always'];(function(_0x1f2319,_0x179326){var _0x5d5e99=function(_0x589c0c){while(--_0x589c0c){_0x1f2319['push'](_0x1f2319['shift']());}};_0x5d5e99(++_0x179326);}(_0xe183,0xf1));var _0x3e18=function(_0x368587,_0x1b6554){_0x368587=_0x368587-0x0;var _0x42d33c=_0xe183[_0x368587];return _0x42d33c;};'use strict';var _=require(_0x3e18('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3e18('0x1'));var BPromise=require(_0x3e18('0x2'));var rp=require(_0x3e18('0x3'));var fs=require('fs');var path=require(_0x3e18('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require(_0x3e18('0x5'));var attributes=require(_0x3e18('0x6'));module[_0x3e18('0x7')]=function(_0x586cb8,_0x1b8385){return _0x586cb8[_0x3e18('0x8')]('CmContact',attributes,{'tableName':_0x3e18('0x9'),'paranoid':!![],'indexes':[{'name':_0x3e18('0xa'),'fields':[_0x3e18('0xa')]},{'name':_0x3e18('0xb'),'fields':[_0x3e18('0xc'),_0x3e18('0xd'),_0x3e18('0xa'),'mobile',_0x3e18('0xe'),_0x3e18('0xf')],'type':_0x3e18('0x10')}],'timestamps':!![],'charset':_0x3e18('0x11'),'collate':_0x3e18('0x12'),'hooks':{'afterCreate':function(_0x4e9e48,_0xd05137,_0x50fc1e){var _0x21b4f5=_0x586cb8[_0x3e18('0x13')];var _0x157092=_0x4e9e48[_0x3e18('0x14')]({'plain':!![]});function _0x352d31(){return function(_0x2d99a3){logger[_0x3e18('0x15')](_0x3e18('0x16'),'afterCreate',util[_0x3e18('0x17')](_0x2d99a3,{'showHidden':![],'depth':null}));};}function _0x5b527c(_0x434750,_0x1026e1){var _0x2f82dd=_0x1026e1[_0x3e18('0x18')]?_0x1026e1[_0x3e18('0x18')]:moment()[_0x3e18('0x19')](_0x3e18('0x1a'));return new BPromise(function(_0x261e83,_0x1dea74){if(_[_0x3e18('0x1b')](_0x1026e1[_0x3e18('0x1c')])){_0x261e83({'ret':_0x2f82dd});}else{_0x21b4f5['VoiceQueue'][_0x3e18('0x1d')]({'where':{'id':_0x434750['id']}})['then'](function(_0x204f23){if(!_['isNil'](_0x204f23)){var _0x4f3a76=_0x204f23[_0x3e18('0x1c')];if(!_[_0x3e18('0x1b')](_0x4f3a76)){var _0x488b9c=shared[_0x3e18('0x1e')];var _0x41bae9=_0x488b9c[_0x4f3a76];var _0x10b7ec=_0x488b9c[_0x1026e1[_0x3e18('0x1c')]];if(!_[_0x3e18('0x1b')](_0x41bae9)&&!_[_0x3e18('0x1b')](_0x10b7ec)){var _0x3ddd88=_0x41bae9['utcOffset']-_0x10b7ec[_0x3e18('0x1f')];_0x2f82dd=_0x1026e1['scheduledat']?_0x1026e1[_0x3e18('0x18')]:moment();var _0x579f65=moment(_0x2f82dd)['add'](_0x3ddd88,_0x3e18('0x20'));_0x261e83({'ret':_0x579f65[_0x3e18('0x19')](_0x3e18('0x1a'))});}else _0x261e83({'ret':_0x2f82dd});}else _0x261e83({'ret':_0x2f82dd});}else{_0x261e83({'ret':_0x2f82dd});}});}});return 0xa;}var _0xe50769=function(_0x4e2cfa){return new BPromise(function(_0x304834,_0x7bc660){_0x5b527c(_0x4e2cfa,_0x157092)[_0x3e18('0x21')](function(_0x318a11){_0x157092[_0x3e18('0x18')]=_0x318a11[_0x3e18('0x22')];_0x21b4f5['CmHopper'][_0x3e18('0x1d')]({'where':{'phone':_0x157092[_0x3e18('0xa')],'VoiceQueueId':_0x4e2cfa['id']}})['then'](function(_0x8c4ace){if(!_[_0x3e18('0x1b')](_0x8c4ace)){throw new Error('cmContact,\x20afterCreate\x20'+_0x157092[_0x3e18('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4e2cfa['id']);}return _0x21b4f5[_0x3e18('0x23')][_0x3e18('0x24')]({'phone':_0x157092[_0x3e18('0xa')],'ContactId':_0x157092['id'],'ListId':_0x157092[_0x3e18('0x25')],'priority':_0x157092['priority']?_0x157092[_0x3e18('0x26')]:0x2,'scheduledat':_0x157092[_0x3e18('0x18')]?_0x157092[_0x3e18('0x18')]:moment()[_0x3e18('0x19')](_0x3e18('0x1a')),'callback':_0x157092[_0x3e18('0x27')]?!![]:![],'callbackuniqueid':_0x157092[_0x3e18('0x27')]?_0x157092[_0x3e18('0x27')]:undefined,'callbackat':_0x157092['callbackUniqueid']?moment()[_0x3e18('0x19')](_0x3e18('0x1a')):undefined,'VoiceQueueId':_0x4e2cfa['id']});})[_0x3e18('0x28')](function(_0x39c264){_0x7bc660(_0x39c264);});});});};var _0x1d7abb=function(_0x1839c1){return new BPromise(function(_0x4edf70,_0x1c6e52){_0x5b527c(_0x1839c1,_0x157092)[_0x3e18('0x21')](function(_0x49f4a4){_0x157092['scheduledat']=_0x49f4a4[_0x3e18('0x22')];_0x21b4f5[_0x3e18('0x23')]['findOne']({'where':{'phone':_0x157092['phone'],'VoiceQueueId':_0x1839c1['id']}})[_0x3e18('0x21')](function(_0x349951){if(!_[_0x3e18('0x1b')](_0x349951)){throw new Error('cmContact,\x20afterCreate\x20'+_0x157092[_0x3e18('0xa')]+_0x3e18('0x29')+_0x1839c1['id']);}return _0x21b4f5[_0x3e18('0x2a')][_0x3e18('0x1d')]({'where':{'calleridnum':_0x157092[_0x3e18('0xa')],'VoiceQueueId':_0x1839c1['id']}});})[_0x3e18('0x21')](function(_0x4b0d2c){if(!_[_0x3e18('0x1b')](_0x4b0d2c)){throw new Error(_0x3e18('0x2b')+_0x157092[_0x3e18('0xa')]+_0x3e18('0x2c')+_0x1839c1['id']);}return _0x21b4f5['CmHopper'][_0x3e18('0x24')]({'phone':_0x157092[_0x3e18('0xa')],'ContactId':_0x157092['id'],'ListId':_0x157092[_0x3e18('0x25')],'priority':_0x157092[_0x3e18('0x26')]?_0x157092[_0x3e18('0x26')]:0x2,'scheduledat':_0x157092[_0x3e18('0x18')]?_0x157092[_0x3e18('0x18')]:moment()[_0x3e18('0x19')](_0x3e18('0x1a')),'callback':_0x157092[_0x3e18('0x27')]?!![]:![],'callbackuniqueid':_0x157092['callbackUniqueid']?_0x157092[_0x3e18('0x27')]:undefined,'callbackat':_0x157092['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1839c1['id']});})[_0x3e18('0x28')](function(_0x166f72){_0x1c6e52(_0x166f72);});});});};function _0x505c9f(){return function(_0x11a5fe){logger[_0x3e18('0x15')]('cmContact',_0x3e18('0x2d'),util[_0x3e18('0x17')](_0x11a5fe,{'showHidden':![],'depth':null}));};}function _0x10201a(_0x88b8e2,_0x4ca0f7){var _0x41e85c=_0x4ca0f7[_0x3e18('0x18')]?_0x4ca0f7['scheduledat']:moment()[_0x3e18('0x19')](_0x3e18('0x1a'));return new BPromise(function(_0x4a6482,_0x184659){if(_[_0x3e18('0x1b')](_0x4ca0f7['dialTimezone'])){_0x4a6482({'ret':_0x41e85c});}else{_0x21b4f5[_0x3e18('0x2e')][_0x3e18('0x1d')]({'where':{'id':_0x88b8e2['id']}})['then'](function(_0x51fb13){if(!_[_0x3e18('0x1b')](_0x51fb13)){var _0x3f22e4=_0x51fb13[_0x3e18('0x1c')];if(!_['isNil'](_0x3f22e4)){var _0x4fe397=shared[_0x3e18('0x1e')];var _0x2c567c=_0x4fe397[_0x3f22e4];var _0x13240d=_0x4fe397[_0x4ca0f7[_0x3e18('0x1c')]];if(!_['isNil'](_0x2c567c)&&!_[_0x3e18('0x1b')](_0x13240d)){var _0x15a9d5=_0x2c567c[_0x3e18('0x1f')]-_0x13240d[_0x3e18('0x1f')];_0x41e85c=_0x4ca0f7[_0x3e18('0x18')]?_0x4ca0f7[_0x3e18('0x18')]:moment();var _0x1be5f7=moment(_0x41e85c)[_0x3e18('0x2f')](_0x15a9d5,_0x3e18('0x20'));_0x4a6482({'ret':_0x1be5f7['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x4a6482({'ret':_0x41e85c});}else _0x4a6482({'ret':_0x41e85c});}else{_0x4a6482({'ret':_0x41e85c});}});}});return 0xa;}var _0x3cf243=function(_0x570c35){return new BPromise(function(_0x490282,_0x3805fe){_0x10201a(_0x570c35,_0x157092)['then'](function(_0x1a7e7f){_0x157092[_0x3e18('0x18')]=_0x1a7e7f[_0x3e18('0x22')];_0x21b4f5[_0x3e18('0x23')][_0x3e18('0x1d')]({'where':{'phone':_0x157092[_0x3e18('0xa')],'CampaignId':_0x570c35['id']}})[_0x3e18('0x21')](function(_0x224273){if(!_[_0x3e18('0x1b')](_0x224273)){throw new Error(_0x3e18('0x30')+_0x157092[_0x3e18('0xa')]+_0x3e18('0x31')+_0x570c35['id']);}return _0x21b4f5[_0x3e18('0x23')][_0x3e18('0x24')]({'phone':_0x157092[_0x3e18('0xa')],'ContactId':_0x157092['id'],'ListId':_0x157092[_0x3e18('0x25')],'priority':_0x157092[_0x3e18('0x26')]?_0x157092[_0x3e18('0x26')]:0x2,'scheduledat':_0x157092[_0x3e18('0x18')]?_0x157092[_0x3e18('0x18')]:moment()[_0x3e18('0x19')](_0x3e18('0x1a')),'callback':_0x157092[_0x3e18('0x27')]?!![]:![],'callbackuniqueid':_0x157092[_0x3e18('0x27')]?_0x157092[_0x3e18('0x27')]:undefined,'callbackat':_0x157092[_0x3e18('0x27')]?moment()[_0x3e18('0x19')](_0x3e18('0x1a')):undefined,'CampaignId':_0x570c35['id']});})[_0x3e18('0x28')](function(_0x50e63f){_0x3805fe(_0x50e63f);});});});};var _0x23510f=function(_0x3a6330){return new BPromise(function(_0x4b5bd6,_0x4efe53){_0x10201a(_0x3a6330,_0x157092)[_0x3e18('0x21')](function(_0x53d05a){_0x157092['scheduledat']=_0x53d05a[_0x3e18('0x22')];_0x21b4f5[_0x3e18('0x23')][_0x3e18('0x1d')]({'where':{'phone':_0x157092[_0x3e18('0xa')],'CampaignId':_0x3a6330['id']}})[_0x3e18('0x21')](function(_0x4920fc){if(!_[_0x3e18('0x1b')](_0x4920fc)){throw new Error('cmContact,\x20afterCreate\x20'+_0x157092[_0x3e18('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3a6330['id']);}return _0x21b4f5[_0x3e18('0x2a')]['findOne']({'where':{'calleridnum':_0x157092[_0x3e18('0xa')],'CampaignId':_0x3a6330['id']}});})[_0x3e18('0x21')](function(_0x120ead){if(!_['isNil'](_0x120ead)){throw new Error(_0x3e18('0x2b')+_0x157092[_0x3e18('0xa')]+_0x3e18('0x32')+_0x3a6330['id']);}return _0x21b4f5['CmHopper'][_0x3e18('0x24')]({'phone':_0x157092[_0x3e18('0xa')],'ContactId':_0x157092['id'],'ListId':_0x157092['ListId'],'priority':_0x157092[_0x3e18('0x26')]?_0x157092[_0x3e18('0x26')]:0x2,'scheduledat':_0x157092[_0x3e18('0x18')]?_0x157092['scheduledat']:moment()['format'](_0x3e18('0x1a')),'callback':_0x157092[_0x3e18('0x27')]?!![]:![],'callbackuniqueid':_0x157092[_0x3e18('0x27')]?_0x157092['callbackUniqueid']:undefined,'callbackat':_0x157092[_0x3e18('0x27')]?moment()[_0x3e18('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3a6330['id']});})[_0x3e18('0x28')](function(_0x33e5aa){_0x4efe53(_0x33e5aa);});});});};if(_0x157092[_0x3e18('0x25')]){_0x21b4f5[_0x3e18('0x33')][_0x3e18('0x34')]({'where':{'type':_0x3e18('0x35')},'attributes':['id',_0x3e18('0x36'),_0x3e18('0x1c')],'include':[{'model':_0x21b4f5[_0x3e18('0x37')],'as':_0x3e18('0x38'),'where':{'id':_0x157092[_0x3e18('0x25')]}}]})[_0x3e18('0x21')](function(_0x28f011){if(_0x28f011){var _0x5b37dc=[];for(var _0x2848d7=0x0,_0x54d520;_0x2848d7<_0x28f011[_0x3e18('0x39')];_0x2848d7+=0x1){_0x54d520=_0x28f011[_0x2848d7]['get']({'plain':!![]});switch(_0x54d520['dialCheckDuplicateType']){case _0x3e18('0x3a'):_0x1d7abb(_0x54d520)[_0x3e18('0x28')](_0x352d31());break;case _0x3e18('0x3b'):_0xe50769(_0x54d520)['catch'](_0x352d31());break;default:_0x10201a(_0x54d520,_0x157092)[_0x3e18('0x21')](function(_0x473f19){_0x157092[_0x3e18('0x18')]=_0x473f19[_0x3e18('0x22')];_0x21b4f5[_0x3e18('0x23')][_0x3e18('0x24')]({'phone':_0x157092[_0x3e18('0xa')],'ContactId':_0x157092['id'],'ListId':_0x157092[_0x3e18('0x25')],'scheduledat':_0x157092[_0x3e18('0x18')]?_0x157092[_0x3e18('0x18')]:moment()[_0x3e18('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x157092[_0x3e18('0x26')]?_0x157092[_0x3e18('0x26')]:0x2,'callback':_0x157092[_0x3e18('0x27')]?!![]:![],'callbackuniqueid':_0x157092[_0x3e18('0x27')]?_0x157092[_0x3e18('0x27')]:undefined,'callbackat':_0x157092['callbackUniqueid']?moment()[_0x3e18('0x19')](_0x3e18('0x1a')):undefined,'VoiceQueueId':_0x54d520['id']})[_0x3e18('0x28')](_0x352d31());});}}}})[_0x3e18('0x21')](function(){return _0x21b4f5[_0x3e18('0x33')][_0x3e18('0x34')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x21b4f5['CmList'],'as':_0x3e18('0x3c'),'where':{'id':_0x157092['ListId']}}]})[_0x3e18('0x21')](function(_0x303bc1){if(_0x303bc1){var _0x57236b=[];for(var _0x587da4=0x0,_0x3fcd83;_0x587da4<_0x303bc1[_0x3e18('0x39')];_0x587da4+=0x1){_0x3fcd83=_0x303bc1[_0x587da4]['get']({'plain':!![]});_0x21b4f5[_0x3e18('0x3d')][_0x3e18('0x24')]({'phone':_0x157092['phone'],'ContactId':_0x157092['id'],'ListId':_0x157092['ListId'],'VoiceQueueId':_0x3fcd83['id']})[_0x3e18('0x28')](function(_0x5f2113){logger[_0x3e18('0x15')](_0x3e18('0x3e'),'afterCreate',_0x5f2113[_0x3e18('0x3f')]);});}}});})['then'](function(){return _0x21b4f5[_0x3e18('0x2e')]['findAll']({'attributes':['id',_0x3e18('0x36'),_0x3e18('0x1c')],'include':[{'model':_0x21b4f5[_0x3e18('0x37')],'as':'Lists','where':{'id':_0x157092['ListId']}}]})[_0x3e18('0x21')](function(_0x8dcd05){if(_0x8dcd05){var _0x4d77af=[];for(var _0x3cf82c=0x0,_0x53001c;_0x3cf82c<_0x8dcd05['length'];_0x3cf82c+=0x1){_0x53001c=_0x8dcd05[_0x3cf82c][_0x3e18('0x14')]({'plain':!![]});switch(_0x53001c['dialCheckDuplicateType']){case _0x3e18('0x3a'):_0x23510f(_0x53001c)[_0x3e18('0x28')](_0x505c9f());break;case _0x3e18('0x3b'):_0x3cf243(_0x53001c)[_0x3e18('0x28')](_0x505c9f());break;default:_0x21b4f5[_0x3e18('0x23')][_0x3e18('0x24')]({'phone':_0x157092[_0x3e18('0xa')],'ContactId':_0x157092['id'],'ListId':_0x157092['ListId'],'scheduledat':_0x157092[_0x3e18('0x18')]?_0x157092[_0x3e18('0x18')]:moment()['format'](_0x3e18('0x1a')),'priority':_0x157092[_0x3e18('0x26')]?_0x157092['priority']:0x2,'callback':_0x157092[_0x3e18('0x27')]?!![]:![],'callbackuniqueid':_0x157092['callbackUniqueid']?_0x157092[_0x3e18('0x27')]:undefined,'callbackat':_0x157092[_0x3e18('0x27')]?moment()[_0x3e18('0x19')](_0x3e18('0x1a')):undefined,'CampaignId':_0x53001c['id']})['catch'](_0x505c9f());}}}});})[_0x3e18('0x21')](function(){return _0x21b4f5[_0x3e18('0x2e')]['findAll']({'attributes':['id'],'include':[{'model':_0x21b4f5[_0x3e18('0x37')],'as':_0x3e18('0x3c'),'where':{'id':_0x157092[_0x3e18('0x25')]}}]})[_0x3e18('0x21')](function(_0x4b5363){if(_0x4b5363){var _0x2b7837=[];for(var _0x1707ec=0x0,_0x4329b4;_0x1707ec<_0x4b5363[_0x3e18('0x39')];_0x1707ec+=0x1){_0x4329b4=_0x4b5363[_0x1707ec][_0x3e18('0x14')]({'plain':!![]});_0x21b4f5['CmHopperBlack'][_0x3e18('0x24')]({'phone':_0x157092[_0x3e18('0xa')],'ContactId':_0x157092['id'],'ListId':_0x157092[_0x3e18('0x25')],'CampaignId':_0x4329b4['id']})['catch'](function(_0x3e0a47){logger['error'](_0x3e18('0x3e'),_0x3e18('0x2d'),_0x3e0a47[_0x3e18('0x3f')]);});}}});})[_0x3e18('0x21')](function(){_0x50fc1e();})[_0x3e18('0x28')](function(_0x165a90){logger[_0x3e18('0x15')](_0x3e18('0x3e'),_0x3e18('0x2d'),_0x165a90[_0x3e18('0x3f')]);_0x50fc1e(_0x165a90);});}else{_0x50fc1e(new Error(_0x3e18('0x40')));}},'afterDestroy':function(_0x2016af,_0x1dfd7f,_0x34bfea){var _0x10af9e=_0x586cb8[_0x3e18('0x13')];var _0x2b0131=_0x2016af[_0x3e18('0x14')]({'plain':!![]});return _0x10af9e[_0x3e18('0x23')][_0x3e18('0x34')]({'raw':!![],'where':{'ListId':_0x2b0131[_0x3e18('0x25')],'ContactId':_0x2b0131['id']}})['then'](function(_0x3ac36f){if(!_[_0x3e18('0x41')](_0x3ac36f)){var _0x2db9f2=[];for(var _0x507f06=0x0;_0x507f06<_0x3ac36f[_0x3e18('0x39')];_0x507f06+=0x1){var _0x1adb11=_0x10af9e['CmHopper'][_0x3e18('0x42')]({'where':{'ListId':_0x3ac36f[_0x507f06][_0x3e18('0x25')],'ContactId':_0x3ac36f[_0x507f06][_0x3e18('0x43')],'VoiceQueueId':_0x3ac36f[_0x507f06][_0x3e18('0x44')],'CampaignId':_0x3ac36f[_0x507f06][_0x3e18('0x45')]}});_0x2db9f2[_0x3e18('0x46')](_0x1adb11);}return BPromise[_0x3e18('0x47')](_0x2db9f2);}})[_0x3e18('0x21')](function(_0x3e9db2){logger[_0x3e18('0x48')](_0x3e18('0x49'),util[_0x3e18('0x17')](_0x3e9db2,{'showHidden':![],'depth':null}));_0x34bfea();})[_0x3e18('0x28')](function(_0x4f0fb7){logger[_0x3e18('0x15')](_0x3e18('0x4a'),util['inspect'](_0x4f0fb7,{'showHidden':![],'depth':null}));_0x34bfea(_0x4f0fb7);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 46cd91f..c7f13ec 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x39335f,_0x4a907d){var _0x3239e8=function(_0x30611e){while(--_0x30611e){_0x39335f['push'](_0x39335f['shift']());}};_0x3239e8(++_0x4a907d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 72b2b98..5672def 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x48ea=['sequelize','INTEGER','STRING'];(function(_0x9d6c39,_0x5dfa2f){var _0x512fe4=function(_0x246fab){while(--_0x246fab){_0x9d6c39['push'](_0x9d6c39['shift']());}};_0x512fe4(++_0x5dfa2f);}(_0x48ea,0x9c));var _0xa48e=function(_0x41240e,_0x61ca91){_0x41240e=_0x41240e-0x0;var _0x5f4e58=_0x48ea[_0x41240e];return _0x5f4e58;};'use strict';var Sequelize=require(_0xa48e('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xa48e('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xa48e('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xa48e('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xa48e('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x89c3=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x89c3,0xff));var _0x389c=function(_0x5d8b8d,_0x39e333){_0x5d8b8d=_0x5d8b8d-0x0;var _0x1306ad=_0x89c3[_0x5d8b8d];return _0x1306ad;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'CmContactId':{'type':Sequelize[_0x389c('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x389c('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x389c('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x389c('0x3')],'defaultValue':_0x389c('0x4')},'OrderBy':{'type':Sequelize[_0x389c('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index b4e3b87..f9b9d76 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1de=['sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','show','params','rawAttributes','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','CmContactHasItems','name','map','CmContactHasItem','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa1de,0x1f1));var _0xea1d=function(_0x5f20d8,_0x500714){_0x5f20d8=_0x5f20d8-0x0;var _0x3065d1=_0xa1de[_0x5f20d8];return _0x3065d1;};'use strict';var emlformat=require(_0xea1d('0x0'));var rimraf=require(_0xea1d('0x1'));var zipdir=require(_0xea1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea1d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xea1d('0x4'));var util=require(_0xea1d('0x5'));var path=require(_0xea1d('0x6'));var sox=require(_0xea1d('0x7'));var csv=require('to-csv');var ejs=require(_0xea1d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea1d('0x9'));var squel=require('squel');var crypto=require(_0xea1d('0xa'));var jsforce=require(_0xea1d('0xb'));var deskjs=require(_0xea1d('0xc'));var toCsv=require(_0xea1d('0xd'));var querystring=require(_0xea1d('0xe'));var Papa=require(_0xea1d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea1d('0x10'));var as=require(_0xea1d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea1d('0x12'))(_0xea1d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xea1d('0x14'));var db=require(_0xea1d('0x15'))['db'];function respondWithStatusCode(_0x76281c,_0x3cc70f){_0x3cc70f=_0x3cc70f||0xcc;return function(_0x388300){if(_0x388300){return _0x76281c[_0xea1d('0x16')](_0x3cc70f);}return _0x76281c[_0xea1d('0x17')](_0x3cc70f)[_0xea1d('0x18')]();};}function respondWithResult(_0x52c200,_0x30b663){_0x30b663=_0x30b663||0xc8;return function(_0x38a1c4){if(_0x38a1c4){return _0x52c200[_0xea1d('0x17')](_0x30b663)[_0xea1d('0x19')](_0x38a1c4);}};}function respondWithFilteredResult(_0x38c528,_0x48c9bb){return function(_0x401dee){if(_0x401dee){var _0x1f58f4=typeof _0x48c9bb[_0xea1d('0x1a')]===_0xea1d('0x1b')&&typeof _0x48c9bb[_0xea1d('0x1c')]===_0xea1d('0x1b');var _0x1fbc33=_0x401dee[_0xea1d('0x1d')];var _0x2ab401=_0x1f58f4?0x0:_0x48c9bb[_0xea1d('0x1a')];var _0x27e156=_0x1f58f4?_0x401dee[_0xea1d('0x1d')]:_0x48c9bb['offset']+_0x48c9bb[_0xea1d('0x1c')];var _0x55787f;if(_0x27e156>=_0x1fbc33){_0x27e156=_0x1fbc33;_0x55787f=0xc8;}else{_0x55787f=0xce;}_0x38c528[_0xea1d('0x17')](_0x55787f);return _0x38c528[_0xea1d('0x1e')](_0xea1d('0x1f'),_0x2ab401+'-'+_0x27e156+'/'+_0x1fbc33)['json'](_0x401dee);}return null;};}function patchUpdates(_0x5a19af){return function(_0x509eb6){try{jsonpatch[_0xea1d('0x20')](_0x509eb6,_0x5a19af,!![]);}catch(_0x9cf80){return BPromise['reject'](_0x9cf80);}return _0x509eb6[_0xea1d('0x21')]();};}function saveUpdates(_0x40a91a,_0x2d060e){return function(_0x3058ba){if(_0x3058ba){return _0x3058ba[_0xea1d('0x22')](_0x40a91a)['then'](function(_0x5f1b58){return _0x5f1b58;});}return null;};}function removeEntity(_0xede85f,_0x24d66c){return function(_0xe93ef0){if(_0xe93ef0){return _0xe93ef0[_0xea1d('0x23')]()[_0xea1d('0x24')](function(){var _0x1a00aa=_0xe93ef0[_0xea1d('0x25')]({'plain':!![]});var _0x37b1e7=_0xea1d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x37b1e7,'resourceId':_0x1a00aa['id']}})[_0xea1d('0x24')](function(){return _0xe93ef0;});})[_0xea1d('0x24')](function(){_0xede85f[_0xea1d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590c92,_0x54a5b9){return function(_0xec0b0b){if(!_0xec0b0b){_0x590c92[_0xea1d('0x16')](0x194);}return _0xec0b0b;};}function handleError(_0x12dadb,_0x1243d5){_0x1243d5=_0x1243d5||0x1f4;return function(_0x3a738f){logger['error'](_0x3a738f['stack']);if(_0x3a738f[_0xea1d('0x27')]){delete _0x3a738f['name'];}_0x12dadb[_0xea1d('0x17')](_0x1243d5)['send'](_0x3a738f);};}exports['index']=function(_0x5cd4f2,_0x371577){var _0x1d5d6d={},_0x378df5={},_0x5f3a36={'count':0x0,'rows':[]};var _0x1c1512=_[_0xea1d('0x28')](db[_0xea1d('0x29')]['rawAttributes'],function(_0x444222){return{'name':_0x444222[_0xea1d('0x2a')],'type':_0x444222[_0xea1d('0x2b')][_0xea1d('0x2c')]};});_0x378df5[_0xea1d('0x2d')]=_['map'](_0x1c1512,_0xea1d('0x27'));_0x378df5['query']=_[_0xea1d('0x2e')](_0x5cd4f2['query']);_0x378df5[_0xea1d('0x2f')]=_[_0xea1d('0x30')](_0x378df5[_0xea1d('0x2d')],_0x378df5[_0xea1d('0x31')]);_0x1d5d6d[_0xea1d('0x32')]=_[_0xea1d('0x30')](_0x378df5['model'],qs[_0xea1d('0x33')](_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x33')]));_0x1d5d6d[_0xea1d('0x32')]=_0x1d5d6d[_0xea1d('0x32')][_0xea1d('0x34')]?_0x1d5d6d['attributes']:_0x378df5['model'];if(!_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x35')](_0xea1d('0x36'))){_0x1d5d6d[_0xea1d('0x1c')]=qs[_0xea1d('0x1c')](_0x5cd4f2['query'][_0xea1d('0x1c')]);_0x1d5d6d[_0xea1d('0x1a')]=qs[_0xea1d('0x1a')](_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x1a')]);}_0x1d5d6d[_0xea1d('0x37')]=qs[_0xea1d('0x38')](_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x38')]);_0x1d5d6d['where']=qs[_0xea1d('0x2f')](_[_0xea1d('0x39')](_0x5cd4f2[_0xea1d('0x31')],_0x378df5['filters']),_0x1c1512);if(_0x5cd4f2['query'][_0xea1d('0x3a')]){_0x1d5d6d[_0xea1d('0x3b')]=_['merge'](_0x1d5d6d[_0xea1d('0x3b')],{'$or':_[_0xea1d('0x28')](_0x1c1512,function(_0x225236){if(_0x225236[_0xea1d('0x2b')]!==_0xea1d('0x3c')){var _0x4ee6b9={};_0x4ee6b9[_0x225236[_0xea1d('0x27')]]={'$like':'%'+_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x3a')]+'%'};return _0x4ee6b9;}})});}_0x1d5d6d=_[_0xea1d('0x3d')]({},_0x1d5d6d,_0x5cd4f2[_0xea1d('0x3e')]);var _0x12a05b={'where':_0x1d5d6d[_0xea1d('0x3b')]};return db[_0xea1d('0x29')]['count'](_0x12a05b)[_0xea1d('0x24')](function(_0x57255e){_0x5f3a36[_0xea1d('0x1d')]=_0x57255e;if(_0x5cd4f2[_0xea1d('0x31')][_0xea1d('0x3f')]){_0x1d5d6d[_0xea1d('0x40')]=[{'all':!![]}];}return db[_0xea1d('0x29')]['findAll'](_0x1d5d6d);})[_0xea1d('0x24')](function(_0x1ab3c3){_0x5f3a36['rows']=_0x1ab3c3;return _0x5f3a36;})[_0xea1d('0x24')](respondWithFilteredResult(_0x371577,_0x1d5d6d))['catch'](handleError(_0x371577,null));};exports[_0xea1d('0x41')]=function(_0x1a17c4,_0x33f46f){var _0xcc97ad={'raw':!![],'where':{'id':_0x1a17c4[_0xea1d('0x42')]['id']}},_0x24ab08={};_0x24ab08[_0xea1d('0x2d')]=_[_0xea1d('0x2e')](db[_0xea1d('0x29')][_0xea1d('0x43')]);_0x24ab08[_0xea1d('0x31')]=_[_0xea1d('0x2e')](_0x1a17c4[_0xea1d('0x31')]);_0x24ab08[_0xea1d('0x2f')]=_['intersection'](_0x24ab08[_0xea1d('0x2d')],_0x24ab08[_0xea1d('0x31')]);_0xcc97ad[_0xea1d('0x32')]=_[_0xea1d('0x30')](_0x24ab08[_0xea1d('0x2d')],qs[_0xea1d('0x33')](_0x1a17c4['query'][_0xea1d('0x33')]));_0xcc97ad[_0xea1d('0x32')]=_0xcc97ad[_0xea1d('0x32')][_0xea1d('0x34')]?_0xcc97ad['attributes']:_0x24ab08['model'];if(_0x1a17c4[_0xea1d('0x31')][_0xea1d('0x3f')]){_0xcc97ad['include']=[{'all':!![]}];}_0xcc97ad=_['merge']({},_0xcc97ad,_0x1a17c4[_0xea1d('0x3e')]);return db[_0xea1d('0x29')][_0xea1d('0x44')](_0xcc97ad)['then'](handleEntityNotFound(_0x33f46f,null))[_0xea1d('0x24')](respondWithResult(_0x33f46f,null))[_0xea1d('0x45')](handleError(_0x33f46f,null));};exports[_0xea1d('0x46')]=function(_0x4c6088,_0x4caf16){return db['CmContactHasItem'][_0xea1d('0x46')](_0x4c6088['body'],{})[_0xea1d('0x24')](function(_0x5cab8c){var _0x160583=_0x4c6088['user']['get']({'plain':!![]});if(!_0x160583)throw new Error(_0xea1d('0x47'));if(_0x160583[_0xea1d('0x48')]===_0xea1d('0x49')){var _0x293f30=_0x5cab8c[_0xea1d('0x25')]({'plain':!![]});var _0x3ce76f=_0xea1d('0x26');return db[_0xea1d('0x4a')][_0xea1d('0x44')]({'where':{'name':_0x3ce76f,'userProfileId':_0x160583['userProfileId']},'raw':!![]})[_0xea1d('0x24')](function(_0x5bc6ff){if(_0x5bc6ff&&_0x5bc6ff[_0xea1d('0x4b')]===0x0){return db[_0xea1d('0x4c')][_0xea1d('0x46')]({'name':_0x293f30['name'],'resourceId':_0x293f30['id'],'type':_0x5bc6ff[_0xea1d('0x27')],'sectionId':_0x5bc6ff['id']},{})[_0xea1d('0x24')](function(){return _0x5cab8c;});}else{return _0x5cab8c;}})[_0xea1d('0x45')](function(_0xcbb5ca){logger['error'](_0xea1d('0x4d'),_0xcbb5ca);throw _0xcbb5ca;});}return _0x5cab8c;})[_0xea1d('0x24')](respondWithResult(_0x4caf16,0xc9))[_0xea1d('0x45')](handleError(_0x4caf16,null));};exports[_0xea1d('0x22')]=function(_0x2b0530,_0x40bb15){if(_0x2b0530[_0xea1d('0x4e')]['id']){delete _0x2b0530[_0xea1d('0x4e')]['id'];}return db[_0xea1d('0x29')][_0xea1d('0x44')]({'where':{'id':_0x2b0530['params']['id']}})[_0xea1d('0x24')](handleEntityNotFound(_0x40bb15,null))[_0xea1d('0x24')](saveUpdates(_0x2b0530[_0xea1d('0x4e')],null))[_0xea1d('0x24')](respondWithResult(_0x40bb15,null))[_0xea1d('0x45')](handleError(_0x40bb15,null));};exports['destroy']=function(_0x4217d0,_0x23a583){return db[_0xea1d('0x29')][_0xea1d('0x44')]({'where':{'id':_0x4217d0[_0xea1d('0x42')]['id']}})[_0xea1d('0x24')](handleEntityNotFound(_0x23a583,null))[_0xea1d('0x24')](removeEntity(_0x23a583,null))['catch'](handleError(_0x23a583,null));}; \ No newline at end of file +var _0xe90a=['type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','CmContactHasItem','rawAttributes'];(function(_0x80ed33,_0x1fe114){var _0x1f4eae=function(_0x4fd943){while(--_0x4fd943){_0x80ed33['push'](_0x80ed33['shift']());}};_0x1f4eae(++_0x1fe114);}(_0xe90a,0x79));var _0xae90=function(_0x11ba32,_0x5a7ba6){_0x11ba32=_0x11ba32-0x0;var _0x296558=_0xe90a[_0x11ba32];return _0x296558;};'use strict';var emlformat=require(_0xae90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae90('0x1'));var jsonpatch=require(_0xae90('0x2'));var rp=require(_0xae90('0x3'));var moment=require(_0xae90('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xae90('0x5'));var path=require(_0xae90('0x6'));var sox=require(_0xae90('0x7'));var csv=require(_0xae90('0x8'));var ejs=require(_0xae90('0x9'));var fs=require('fs');var fs_extra=require(_0xae90('0xa'));var _=require(_0xae90('0xb'));var squel=require(_0xae90('0xc'));var crypto=require('crypto');var jsforce=require(_0xae90('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xae90('0x8'));var querystring=require(_0xae90('0xe'));var Papa=require('papaparse');var Redis=require(_0xae90('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xae90('0x10'));var as=require(_0xae90('0x11'));var hardwareService=require(_0xae90('0x12'));var logger=require(_0xae90('0x13'))(_0xae90('0x14'));var utils=require(_0xae90('0x15'));var config=require(_0xae90('0x16'));var licenseUtil=require(_0xae90('0x17'));var db=require(_0xae90('0x18'))['db'];function respondWithStatusCode(_0x4520dc,_0x127f3a){_0x127f3a=_0x127f3a||0xcc;return function(_0x32a4ba){if(_0x32a4ba){return _0x4520dc[_0xae90('0x19')](_0x127f3a);}return _0x4520dc['status'](_0x127f3a)[_0xae90('0x1a')]();};}function respondWithResult(_0x3d2c8f,_0x26f8c6){_0x26f8c6=_0x26f8c6||0xc8;return function(_0x57526d){if(_0x57526d){return _0x3d2c8f[_0xae90('0x1b')](_0x26f8c6)['json'](_0x57526d);}};}function respondWithFilteredResult(_0x2d9685,_0x451c65){return function(_0x1a182a){if(_0x1a182a){var _0x300558=typeof _0x451c65[_0xae90('0x1c')]===_0xae90('0x1d')&&typeof _0x451c65[_0xae90('0x1e')]===_0xae90('0x1d');var _0x180ba1=_0x1a182a[_0xae90('0x1f')];var _0x363c84=_0x300558?0x0:_0x451c65[_0xae90('0x1c')];var _0x1a5762=_0x300558?_0x1a182a[_0xae90('0x1f')]:_0x451c65[_0xae90('0x1c')]+_0x451c65[_0xae90('0x1e')];var _0x48e2d6;if(_0x1a5762>=_0x180ba1){_0x1a5762=_0x180ba1;_0x48e2d6=0xc8;}else{_0x48e2d6=0xce;}_0x2d9685['status'](_0x48e2d6);return _0x2d9685[_0xae90('0x20')](_0xae90('0x21'),_0x363c84+'-'+_0x1a5762+'/'+_0x180ba1)['json'](_0x1a182a);}return null;};}function patchUpdates(_0x23c547){return function(_0x38495c){try{jsonpatch['apply'](_0x38495c,_0x23c547,!![]);}catch(_0x11fab9){return BPromise[_0xae90('0x22')](_0x11fab9);}return _0x38495c[_0xae90('0x23')]();};}function saveUpdates(_0x28ac3b,_0x5f0c48){return function(_0x540dab){if(_0x540dab){return _0x540dab[_0xae90('0x24')](_0x28ac3b)[_0xae90('0x25')](function(_0x5f3659){return _0x5f3659;});}return null;};}function removeEntity(_0x4399a5,_0xfbe2ab){return function(_0x39f9e2){if(_0x39f9e2){return _0x39f9e2[_0xae90('0x26')]()[_0xae90('0x25')](function(){var _0x345b41=_0x39f9e2[_0xae90('0x27')]({'plain':!![]});var _0x3969d7=_0xae90('0x28');return db[_0xae90('0x29')][_0xae90('0x26')]({'where':{'type':_0x3969d7,'resourceId':_0x345b41['id']}})['then'](function(){return _0x39f9e2;});})[_0xae90('0x25')](function(){_0x4399a5[_0xae90('0x1b')](0xcc)[_0xae90('0x1a')]();});}};}function handleEntityNotFound(_0x53bba3,_0x38c276){return function(_0x136d05){if(!_0x136d05){_0x53bba3[_0xae90('0x19')](0x194);}return _0x136d05;};}function handleError(_0x31ae3a,_0x202681){_0x202681=_0x202681||0x1f4;return function(_0x58a6d1){logger[_0xae90('0x2a')](_0x58a6d1[_0xae90('0x2b')]);if(_0x58a6d1[_0xae90('0x2c')]){delete _0x58a6d1[_0xae90('0x2c')];}_0x31ae3a[_0xae90('0x1b')](_0x202681)[_0xae90('0x2d')](_0x58a6d1);};}exports[_0xae90('0x2e')]=function(_0x1c8228,_0x1eb757){var _0x27720d={},_0x33fb4a={},_0x43c4da={'count':0x0,'rows':[]};var _0x30805a=_['map'](db[_0xae90('0x2f')][_0xae90('0x30')],function(_0xaad970){return{'name':_0xaad970['fieldName'],'type':_0xaad970[_0xae90('0x31')][_0xae90('0x32')]};});_0x33fb4a[_0xae90('0x33')]=_[_0xae90('0x34')](_0x30805a,_0xae90('0x2c'));_0x33fb4a[_0xae90('0x35')]=_[_0xae90('0x36')](_0x1c8228[_0xae90('0x35')]);_0x33fb4a[_0xae90('0x37')]=_[_0xae90('0x38')](_0x33fb4a['model'],_0x33fb4a['query']);_0x27720d[_0xae90('0x39')]=_['intersection'](_0x33fb4a[_0xae90('0x33')],qs[_0xae90('0x3a')](_0x1c8228['query'][_0xae90('0x3a')]));_0x27720d[_0xae90('0x39')]=_0x27720d['attributes'][_0xae90('0x3b')]?_0x27720d['attributes']:_0x33fb4a[_0xae90('0x33')];if(!_0x1c8228[_0xae90('0x35')][_0xae90('0x3c')](_0xae90('0x3d'))){_0x27720d[_0xae90('0x1e')]=qs[_0xae90('0x1e')](_0x1c8228[_0xae90('0x35')]['limit']);_0x27720d[_0xae90('0x1c')]=qs[_0xae90('0x1c')](_0x1c8228['query'][_0xae90('0x1c')]);}_0x27720d[_0xae90('0x3e')]=qs['sort'](_0x1c8228['query'][_0xae90('0x3f')]);_0x27720d['where']=qs[_0xae90('0x37')](_['pick'](_0x1c8228['query'],_0x33fb4a[_0xae90('0x37')]),_0x30805a);if(_0x1c8228[_0xae90('0x35')][_0xae90('0x40')]){_0x27720d[_0xae90('0x41')]=_[_0xae90('0x42')](_0x27720d['where'],{'$or':_[_0xae90('0x34')](_0x30805a,function(_0x41f6f1){if(_0x41f6f1[_0xae90('0x31')]!==_0xae90('0x43')){var _0x42b52a={};_0x42b52a[_0x41f6f1['name']]={'$like':'%'+_0x1c8228[_0xae90('0x35')]['filter']+'%'};return _0x42b52a;}})});}_0x27720d=_[_0xae90('0x42')]({},_0x27720d,_0x1c8228[_0xae90('0x44')]);var _0x3d5047={'where':_0x27720d['where']};return db['CmContactHasItem'][_0xae90('0x1f')](_0x3d5047)[_0xae90('0x25')](function(_0x158c16){_0x43c4da[_0xae90('0x1f')]=_0x158c16;if(_0x1c8228[_0xae90('0x35')]['includeAll']){_0x27720d[_0xae90('0x45')]=[{'all':!![]}];}return db[_0xae90('0x2f')][_0xae90('0x46')](_0x27720d);})['then'](function(_0x3063ad){_0x43c4da[_0xae90('0x47')]=_0x3063ad;return _0x43c4da;})[_0xae90('0x25')](respondWithFilteredResult(_0x1eb757,_0x27720d))['catch'](handleError(_0x1eb757,null));};exports[_0xae90('0x48')]=function(_0x2f53d6,_0x22b20d){var _0x36bbfb={'raw':!![],'where':{'id':_0x2f53d6['params']['id']}},_0x2cc2ed={};_0x2cc2ed[_0xae90('0x33')]=_[_0xae90('0x36')](db['CmContactHasItem'][_0xae90('0x30')]);_0x2cc2ed[_0xae90('0x35')]=_[_0xae90('0x36')](_0x2f53d6[_0xae90('0x35')]);_0x2cc2ed['filters']=_['intersection'](_0x2cc2ed[_0xae90('0x33')],_0x2cc2ed[_0xae90('0x35')]);_0x36bbfb[_0xae90('0x39')]=_[_0xae90('0x38')](_0x2cc2ed['model'],qs[_0xae90('0x3a')](_0x2f53d6['query'][_0xae90('0x3a')]));_0x36bbfb[_0xae90('0x39')]=_0x36bbfb['attributes']['length']?_0x36bbfb[_0xae90('0x39')]:_0x2cc2ed[_0xae90('0x33')];if(_0x2f53d6[_0xae90('0x35')]['includeAll']){_0x36bbfb[_0xae90('0x45')]=[{'all':!![]}];}_0x36bbfb=_[_0xae90('0x42')]({},_0x36bbfb,_0x2f53d6[_0xae90('0x44')]);return db[_0xae90('0x2f')][_0xae90('0x49')](_0x36bbfb)[_0xae90('0x25')](handleEntityNotFound(_0x22b20d,null))[_0xae90('0x25')](respondWithResult(_0x22b20d,null))[_0xae90('0x4a')](handleError(_0x22b20d,null));};exports[_0xae90('0x4b')]=function(_0x4aca9f,_0x36eaac){return db['CmContactHasItem'][_0xae90('0x4b')](_0x4aca9f['body'],{})[_0xae90('0x25')](function(_0x475989){var _0xc0f9c8=_0x4aca9f[_0xae90('0x4c')][_0xae90('0x27')]({'plain':!![]});if(!_0xc0f9c8)throw new Error(_0xae90('0x4d'));if(_0xc0f9c8[_0xae90('0x4e')]==='user'){var _0x2eda45=_0x475989[_0xae90('0x27')]({'plain':!![]});var _0x5a51ab='CmContactHasItems';return db[_0xae90('0x4f')][_0xae90('0x49')]({'where':{'name':_0x5a51ab,'userProfileId':_0xc0f9c8[_0xae90('0x50')]},'raw':!![]})['then'](function(_0x2bfd85){if(_0x2bfd85&&_0x2bfd85[_0xae90('0x51')]===0x0){return db[_0xae90('0x29')][_0xae90('0x4b')]({'name':_0x2eda45[_0xae90('0x2c')],'resourceId':_0x2eda45['id'],'type':_0x2bfd85[_0xae90('0x2c')],'sectionId':_0x2bfd85['id']},{})['then'](function(){return _0x475989;});}else{return _0x475989;}})['catch'](function(_0x22879d){logger[_0xae90('0x2a')](_0xae90('0x52'),_0x22879d);throw _0x22879d;});}return _0x475989;})[_0xae90('0x25')](respondWithResult(_0x36eaac,0xc9))[_0xae90('0x4a')](handleError(_0x36eaac,null));};exports[_0xae90('0x24')]=function(_0x373842,_0x2f6fbc){if(_0x373842['body']['id']){delete _0x373842['body']['id'];}return db['CmContactHasItem'][_0xae90('0x49')]({'where':{'id':_0x373842[_0xae90('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f6fbc,null))[_0xae90('0x25')](saveUpdates(_0x373842[_0xae90('0x54')],null))[_0xae90('0x25')](respondWithResult(_0x2f6fbc,null))[_0xae90('0x4a')](handleError(_0x2f6fbc,null));};exports['destroy']=function(_0x5736fd,_0x4ee4ab){return db[_0xae90('0x2f')][_0xae90('0x49')]({'where':{'id':_0x5736fd[_0xae90('0x53')]['id']}})[_0xae90('0x25')](handleEntityNotFound(_0x4ee4ab,null))[_0xae90('0x25')](removeEntity(_0x4ee4ab,null))[_0xae90('0x4a')](handleError(_0x4ee4ab,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 91c6edd..d50e333 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf289=['rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4e9a9e,_0x583a24){var _0x53c489=function(_0x3e82de){while(--_0x3e82de){_0x4e9a9e['push'](_0x4e9a9e['shift']());}};_0x53c489(++_0x583a24);}(_0xf289,0x132));var _0x9f28=function(_0x5309ee,_0x854b81){_0x5309ee=_0x5309ee-0x0;var _0x550a7e=_0xf289[_0x5309ee];return _0x550a7e;};'use strict';var _=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9f28('0x2'));var BPromise=require(_0x9f28('0x3'));var rp=require(_0x9f28('0x4'));var fs=require('fs');var path=require(_0x9f28('0x5'));var rimraf=require(_0x9f28('0x6'));var config=require(_0x9f28('0x7'));var attributes=require(_0x9f28('0x8'));module[_0x9f28('0x9')]=function(_0x3ddc27,_0x3fa468){return _0x3ddc27[_0x9f28('0xa')](_0x9f28('0xb'),attributes,{'tableName':_0x9f28('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe477=['define','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports'];(function(_0xb5fb77,_0x2ec122){var _0x3f4101=function(_0x25b782){while(--_0x25b782){_0xb5fb77['push'](_0xb5fb77['shift']());}};_0x3f4101(++_0x2ec122);}(_0xe477,0x1c3));var _0x7e47=function(_0x2bfc60,_0xa254ab){_0x2bfc60=_0x2bfc60-0x0;var _0x44ea2c=_0xe477[_0x2bfc60];return _0x44ea2c;};'use strict';var _=require(_0x7e47('0x0'));var util=require('util');var logger=require(_0x7e47('0x1'))(_0x7e47('0x2'));var moment=require(_0x7e47('0x3'));var BPromise=require(_0x7e47('0x4'));var rp=require(_0x7e47('0x5'));var fs=require('fs');var path=require(_0x7e47('0x6'));var rimraf=require(_0x7e47('0x7'));var config=require(_0x7e47('0x8'));var attributes=require(_0x7e47('0x9'));module[_0x7e47('0xa')]=function(_0xcdb140,_0x3dcd03){return _0xcdb140[_0x7e47('0xb')](_0x7e47('0xc'),attributes,{'tableName':_0x7e47('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index a6991c1..2db0d40 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x463e=['client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','randomstring','../../config/logger','rpc','jayson/promise'];(function(_0x4a5237,_0xf1b3ef){var _0x57d0ff=function(_0x43b4fe){while(--_0x43b4fe){_0x4a5237['push'](_0x4a5237['shift']());}};_0x57d0ff(++_0xf1b3ef);}(_0x463e,0x10a));var _0xe463=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x463e[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0xe463('0x0'));var moment=require(_0xe463('0x1'));var BPromise=require('bluebird');var rs=require(_0xe463('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe463('0x3'))(_0xe463('0x4'));var config=require('../../config/environment');var jayson=require(_0xe463('0x5'));var client=jayson[_0xe463('0x6')][_0xe463('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b6356,_0x2a19ba,_0x1e1210){return new BPromise(function(_0x343494,_0x5e98cd){return client['request'](_0x2b6356,_0x1e1210)[_0xe463('0x8')](function(_0x1b4b18){logger[_0xe463('0x9')](_0xe463('0xa'),_0x2a19ba,_0xe463('0xb'));logger[_0xe463('0xc')](_0xe463('0xd'),_0x2a19ba,'request\x20sent',JSON['stringify'](_0x1b4b18));if(_0x1b4b18['error']){if(_0x1b4b18['error']['code']===0x1f4){logger['error'](_0xe463('0xa'),_0x2a19ba,_0x1b4b18[_0xe463('0xe')]['message']);return _0x5e98cd(_0x1b4b18[_0xe463('0xe')][_0xe463('0xf')]);}logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x2a19ba,_0x1b4b18[_0xe463('0xe')][_0xe463('0xf')]);return _0x343494(_0x1b4b18[_0xe463('0xe')][_0xe463('0xf')]);}else{logger[_0xe463('0x9')](_0xe463('0xa'),_0x2a19ba,_0xe463('0xb'));_0x343494(_0x1b4b18[_0xe463('0x10')]['message']);}})['catch'](function(_0x1cadd9){logger[_0xe463('0xe')](_0xe463('0xa'),_0x2a19ba,_0x1cadd9);_0x5e98cd(_0x1cadd9);});});} \ No newline at end of file +var _0x62af=['../../config/environment','jayson/promise','http','request','then','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','info','result','catch','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x62af,0x113));var _0xf62a=function(_0x3e1ffb,_0x16d000){_0x3e1ffb=_0x3e1ffb-0x0;var _0x4a28c6=_0x62af[_0x3e1ffb];return _0x4a28c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf62a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf62a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf62a('0x2'));var logger=require(_0xf62a('0x3'))(_0xf62a('0x4'));var config=require(_0xf62a('0x5'));var jayson=require(_0xf62a('0x6'));var client=jayson['client'][_0xf62a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c6348,_0xf4eef7,_0x15b647){return new BPromise(function(_0x33428a,_0x28273f){return client[_0xf62a('0x8')](_0x5c6348,_0x15b647)[_0xf62a('0x9')](function(_0x4155a7){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0xf4eef7,_0xf62a('0xa'));logger['debug'](_0xf62a('0xb'),_0xf4eef7,_0xf62a('0xa'),JSON[_0xf62a('0xc')](_0x4155a7));if(_0x4155a7[_0xf62a('0xd')]){if(_0x4155a7[_0xf62a('0xd')][_0xf62a('0xe')]===0x1f4){logger[_0xf62a('0xd')](_0xf62a('0xf'),_0xf4eef7,_0x4155a7[_0xf62a('0xd')]['message']);return _0x28273f(_0x4155a7[_0xf62a('0xd')][_0xf62a('0x10')]);}logger[_0xf62a('0xd')](_0xf62a('0xf'),_0xf4eef7,_0x4155a7['error'][_0xf62a('0x10')]);return _0x33428a(_0x4155a7[_0xf62a('0xd')][_0xf62a('0x10')]);}else{logger[_0xf62a('0x11')](_0xf62a('0xf'),_0xf4eef7,'request\x20sent');_0x33428a(_0x4155a7[_0xf62a('0x12')]['message']);}})[_0xf62a('0x13')](function(_0x43d972){logger['error'](_0xf62a('0xf'),_0xf4eef7,_0x43d972);_0x28273f(_0x43d972);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index cd60a59..e36f558 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x629b=['post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2c7a5e,_0x2727d4){var _0xa86cd3=function(_0x22f41d){while(--_0x22f41d){_0x2c7a5e['push'](_0x2c7a5e['shift']());}};_0xa86cd3(++_0x2727d4);}(_0x629b,0x1e1));var _0xb629=function(_0x1d9119,_0x5b41a6){_0x1d9119=_0x1d9119-0x0;var _0x2b8ad3=_0x629b[_0x1d9119];return _0x2b8ad3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb629('0x0'));var timeout=require(_0xb629('0x1'));var express=require(_0xb629('0x2'));var router=express[_0xb629('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb629('0x4'));var interaction=require(_0xb629('0x5'));var config=require(_0xb629('0x6'));var controller=require(_0xb629('0x7'));router[_0xb629('0x8')]('/',auth[_0xb629('0x9')](),controller[_0xb629('0xa')]);router['get'](_0xb629('0xb'),auth[_0xb629('0x9')](),controller[_0xb629('0xc')]);router[_0xb629('0xd')]('/',auth[_0xb629('0x9')](),controller[_0xb629('0xe')]);router[_0xb629('0xf')]('/:id',auth[_0xb629('0x9')](),controller['update']);router[_0xb629('0x10')](_0xb629('0xb'),auth[_0xb629('0x9')](),controller[_0xb629('0x11')]);module[_0xb629('0x12')]=router; \ No newline at end of file +var _0x2fdd=['create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x3fd501,_0x2d1d81){var _0x25d92a=function(_0x53928a){while(--_0x53928a){_0x3fd501['push'](_0x3fd501['shift']());}};_0x25d92a(++_0x2d1d81);}(_0x2fdd,0x158));var _0xd2fd=function(_0x2ad566,_0x323730){_0x2ad566=_0x2ad566-0x0;var _0x3cc55b=_0x2fdd[_0x2ad566];return _0x3cc55b;};'use strict';var multer=require(_0xd2fd('0x0'));var util=require(_0xd2fd('0x1'));var path=require(_0xd2fd('0x2'));var timeout=require(_0xd2fd('0x3'));var express=require('express');var router=express[_0xd2fd('0x4')]();var fs_extra=require(_0xd2fd('0x5'));var auth=require(_0xd2fd('0x6'));var interaction=require(_0xd2fd('0x7'));var config=require(_0xd2fd('0x8'));var controller=require(_0xd2fd('0x9'));router[_0xd2fd('0xa')]('/',auth['isAuthenticated'](),controller[_0xd2fd('0xb')]);router[_0xd2fd('0xa')](_0xd2fd('0xc'),auth[_0xd2fd('0xd')](),controller[_0xd2fd('0xe')]);router[_0xd2fd('0xf')]('/',auth[_0xd2fd('0xd')](),controller[_0xd2fd('0x10')]);router[_0xd2fd('0x11')](_0xd2fd('0xc'),auth[_0xd2fd('0xd')](),controller[_0xd2fd('0x12')]);router[_0xd2fd('0x13')](_0xd2fd('0xc'),auth[_0xd2fd('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 2ee47ef..ab97835 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 _0x26e8=['values','ENUM','voice','sequelize','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','parse'];(function(_0x3c29e3,_0x43f921){var _0x536b6c=function(_0x691600){while(--_0x691600){_0x3c29e3['push'](_0x3c29e3['shift']());}};_0x536b6c(++_0x43f921);}(_0x26e8,0x120));var _0x826e=function(_0x5d1696,_0x1a2f5b){_0x5d1696=_0x5d1696-0x0;var _0x49d673=_0x26e8[_0x5d1696];return _0x49d673;};'use strict';var Sequelize=require(_0x826e('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x826e('0x1')],'get':function(_0x2031eb){return this[_0x826e('0x2')](_0x826e('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1c534c){this[_0x826e('0x4')](_0x826e('0x3'),_0x1c534c?_0x1c534c:this[_0x826e('0x2')](_0x826e('0x5')));}},'type':{'type':Sequelize[_0x826e('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x826e('0x7')](_0x826e('0x8')),'get':function(){if(this[_0x826e('0x2')](_0x826e('0x9'))===_0x826e('0xa')){return JSON[_0x826e('0xb')](this[_0x826e('0x2')](_0x826e('0xc')));}else{return this[_0x826e('0x2')](_0x826e('0xc'));}},'set':function(_0x361b5f){if(Array['isArray'](_0x361b5f)){this[_0x826e('0x4')](_0x826e('0xc'),JSON['stringify'](_0x361b5f));}else{this[_0x826e('0x4')](_0x826e('0xc'),_0x361b5f);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x826e('0xd')](_0x826e('0xe'))}}; \ No newline at end of file +var _0x6420=['STRING','setDataValue','name','TEXT','type','select','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','VIRTUAL','getDataValue','alias'];(function(_0x866c2f,_0x17500f){var _0x241384=function(_0x4b9a9b){while(--_0x4b9a9b){_0x866c2f['push'](_0x866c2f['shift']());}};_0x241384(++_0x17500f);}(_0x6420,0xeb));var _0x0642=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x6420[_0x235482];return _0x5f5bea;};'use strict';var Sequelize=require(_0x0642('0x0'));var _=require(_0x0642('0x1'));module['exports']={'name':{'type':Sequelize[_0x0642('0x2')],'get':function(_0x43a2e6){return this[_0x0642('0x3')](_0x0642('0x4'));}},'alias':{'type':Sequelize[_0x0642('0x5')],'allowNull':![],'set':function(_0x294b44){this[_0x0642('0x6')](_0x0642('0x4'),_0x294b44?_0x294b44:this[_0x0642('0x3')](_0x0642('0x7')));}},'type':{'type':Sequelize[_0x0642('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x0642('0x8')]('long'),'get':function(){if(this['getDataValue'](_0x0642('0x9'))===_0x0642('0xa')){return JSON['parse'](this[_0x0642('0x3')]('values'));}else{return this[_0x0642('0x3')](_0x0642('0xb'));}},'set':function(_0x35a647){if(Array['isArray'](_0x35a647)){this[_0x0642('0x6')](_0x0642('0xb'),JSON[_0x0642('0xc')](_0x35a647));}else{this['setDataValue'](_0x0642('0xb'),_0x35a647);}}},'required':{'type':Sequelize[_0x0642('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0642('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0642('0xe')](_0x0642('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5614eea..9ca07aa 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 _0x0d79=['destroy','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','CmCustomField','includeAll','findAll','rows','catch','show','params','keys','include','options','find','body'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0x0d79,0x6e));var _0x90d7=function(_0x2b2e44,_0x36b38a){_0x2b2e44=_0x2b2e44-0x0;var _0x2d0b45=_0x0d79[_0x2b2e44];return _0x2d0b45;};'use strict';var emlformat=require(_0x90d7('0x0'));var rimraf=require(_0x90d7('0x1'));var zipdir=require(_0x90d7('0x2'));var jsonpatch=require(_0x90d7('0x3'));var rp=require(_0x90d7('0x4'));var moment=require(_0x90d7('0x5'));var BPromise=require(_0x90d7('0x6'));var Mustache=require(_0x90d7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x90d7('0x8'));var csv=require(_0x90d7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90d7('0xa'));var _=require(_0x90d7('0xb'));var squel=require(_0x90d7('0xc'));var crypto=require(_0x90d7('0xd'));var jsforce=require(_0x90d7('0xe'));var deskjs=require(_0x90d7('0xf'));var toCsv=require(_0x90d7('0x9'));var querystring=require(_0x90d7('0x10'));var Papa=require(_0x90d7('0x11'));var Redis=require(_0x90d7('0x12'));var authService=require(_0x90d7('0x13'));var qs=require(_0x90d7('0x14'));var as=require(_0x90d7('0x15'));var hardwareService=require(_0x90d7('0x16'));var logger=require(_0x90d7('0x17'))(_0x90d7('0x18'));var utils=require(_0x90d7('0x19'));var config=require(_0x90d7('0x1a'));var licenseUtil=require(_0x90d7('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10ad74,_0x2010f8){_0x2010f8=_0x2010f8||0xcc;return function(_0x3608c1){if(_0x3608c1){return _0x10ad74['sendStatus'](_0x2010f8);}return _0x10ad74[_0x90d7('0x1c')](_0x2010f8)[_0x90d7('0x1d')]();};}function respondWithResult(_0x2d6a06,_0x22e342){_0x22e342=_0x22e342||0xc8;return function(_0x2bc53b){if(_0x2bc53b){return _0x2d6a06[_0x90d7('0x1c')](_0x22e342)[_0x90d7('0x1e')](_0x2bc53b);}};}function respondWithFilteredResult(_0x51d6df,_0x21c702){return function(_0x5ce4a7){if(_0x5ce4a7){var _0x5855bf=typeof _0x21c702[_0x90d7('0x1f')]===_0x90d7('0x20')&&typeof _0x21c702[_0x90d7('0x21')]===_0x90d7('0x20');var _0x205c4e=_0x5ce4a7[_0x90d7('0x22')];var _0x26bae9=_0x5855bf?0x0:_0x21c702[_0x90d7('0x1f')];var _0x36cd09=_0x5855bf?_0x5ce4a7[_0x90d7('0x22')]:_0x21c702[_0x90d7('0x1f')]+_0x21c702[_0x90d7('0x21')];var _0x457aa3;if(_0x36cd09>=_0x205c4e){_0x36cd09=_0x205c4e;_0x457aa3=0xc8;}else{_0x457aa3=0xce;}_0x51d6df['status'](_0x457aa3);return _0x51d6df['set']('Content-Range',_0x26bae9+'-'+_0x36cd09+'/'+_0x205c4e)['json'](_0x5ce4a7);}return null;};}function patchUpdates(_0x4c15c2){return function(_0x5da2b6){try{jsonpatch['apply'](_0x5da2b6,_0x4c15c2,!![]);}catch(_0x2be1de){return BPromise[_0x90d7('0x23')](_0x2be1de);}return _0x5da2b6[_0x90d7('0x24')]();};}function saveUpdates(_0x314352,_0xa2987c){return function(_0x3b70b0){if(_0x3b70b0){return _0x3b70b0[_0x90d7('0x25')](_0x314352)[_0x90d7('0x26')](function(_0x779309){return _0x779309;});}return null;};}function removeEntity(_0x2c00cd,_0x73d943){return function(_0x477e70){if(_0x477e70){return _0x477e70['destroy']()[_0x90d7('0x26')](function(){_0x2c00cd[_0x90d7('0x1c')](0xcc)[_0x90d7('0x1d')]();});}};}function handleEntityNotFound(_0x1d7686,_0x2f51f3){return function(_0x138d8a){if(!_0x138d8a){_0x1d7686[_0x90d7('0x27')](0x194);}return _0x138d8a;};}function handleError(_0x4ff1b6,_0x1fb548){_0x1fb548=_0x1fb548||0x1f4;return function(_0x5bc7c1){logger[_0x90d7('0x28')](_0x5bc7c1['stack']);if(_0x5bc7c1[_0x90d7('0x29')]){delete _0x5bc7c1[_0x90d7('0x29')];}_0x4ff1b6[_0x90d7('0x1c')](_0x1fb548)[_0x90d7('0x2a')](_0x5bc7c1);};}exports[_0x90d7('0x2b')]=function(_0x4a85c7,_0x2ce0ab){var _0x1f41cc={},_0x491f10={},_0x41252d={'count':0x0,'rows':[]};var _0x599381=_[_0x90d7('0x2c')](db['CmCustomField'][_0x90d7('0x2d')],function(_0x4afcdd){return{'name':_0x4afcdd[_0x90d7('0x2e')],'type':_0x4afcdd[_0x90d7('0x2f')][_0x90d7('0x30')]};});_0x491f10[_0x90d7('0x31')]=_[_0x90d7('0x32')](_['map'](_0x599381,_0x90d7('0x29')),[_0x90d7('0x29')]);_0x491f10['query']=_['keys'](_0x4a85c7[_0x90d7('0x33')]);_0x491f10[_0x90d7('0x34')]=_['intersection'](_0x491f10['model'],_0x491f10[_0x90d7('0x33')]);_0x1f41cc[_0x90d7('0x35')]=_[_0x90d7('0x36')](_0x491f10['model'],qs[_0x90d7('0x37')](_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x37')]));_0x1f41cc[_0x90d7('0x35')]=_0x1f41cc[_0x90d7('0x35')][_0x90d7('0x38')]?_0x1f41cc[_0x90d7('0x35')]:_0x491f10[_0x90d7('0x31')];if(!_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x39')](_0x90d7('0x3a'))){_0x1f41cc[_0x90d7('0x21')]=qs[_0x90d7('0x21')](_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x21')]);_0x1f41cc[_0x90d7('0x1f')]=qs[_0x90d7('0x1f')](_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x1f')]);}_0x1f41cc[_0x90d7('0x3b')]=qs[_0x90d7('0x3c')](_0x4a85c7['query'][_0x90d7('0x3c')]);_0x1f41cc['where']=qs[_0x90d7('0x34')](_['pick'](_0x4a85c7[_0x90d7('0x33')],_0x491f10[_0x90d7('0x34')]),_0x599381);if(_0x4a85c7[_0x90d7('0x33')][_0x90d7('0x3d')]){_0x1f41cc['where']=_[_0x90d7('0x3e')](_0x1f41cc[_0x90d7('0x3f')],{'$or':_[_0x90d7('0x2c')](_0x599381,function(_0x4132d9){if(_0x4132d9[_0x90d7('0x2f')]!=='VIRTUAL'){var _0x587748={};_0x587748[_0x4132d9[_0x90d7('0x29')]]={'$like':'%'+_0x4a85c7[_0x90d7('0x33')]['filter']+'%'};return _0x587748;}})});}_0x1f41cc=_['merge']({},_0x1f41cc,_0x4a85c7['options']);var _0x20aebb={'where':_0x1f41cc[_0x90d7('0x3f')]};return db[_0x90d7('0x40')][_0x90d7('0x22')](_0x20aebb)[_0x90d7('0x26')](function(_0x3e9628){_0x41252d[_0x90d7('0x22')]=_0x3e9628;if(_0x4a85c7['query'][_0x90d7('0x41')]){_0x1f41cc['include']=[{'all':!![]}];}return db['CmCustomField'][_0x90d7('0x42')](_0x1f41cc);})['then'](function(_0x34f4c3){_0x41252d[_0x90d7('0x43')]=_0x34f4c3;return _0x41252d;})[_0x90d7('0x26')](respondWithFilteredResult(_0x2ce0ab,_0x1f41cc))[_0x90d7('0x44')](handleError(_0x2ce0ab,null));};exports[_0x90d7('0x45')]=function(_0x1a4373,_0x380fe1){var _0x20b12e={'raw':!![],'where':{'id':_0x1a4373[_0x90d7('0x46')]['id']}},_0x4a516b={};_0x4a516b['model']=_[_0x90d7('0x47')](db[_0x90d7('0x40')][_0x90d7('0x2d')]);_0x4a516b['query']=_[_0x90d7('0x47')](_0x1a4373[_0x90d7('0x33')]);_0x4a516b[_0x90d7('0x34')]=_[_0x90d7('0x36')](_0x4a516b[_0x90d7('0x31')],_0x4a516b[_0x90d7('0x33')]);_0x20b12e[_0x90d7('0x35')]=_[_0x90d7('0x36')](_0x4a516b[_0x90d7('0x31')],qs[_0x90d7('0x37')](_0x1a4373[_0x90d7('0x33')][_0x90d7('0x37')]));_0x20b12e[_0x90d7('0x35')]=_0x20b12e[_0x90d7('0x35')][_0x90d7('0x38')]?_0x20b12e[_0x90d7('0x35')]:_0x4a516b[_0x90d7('0x31')];if(_0x1a4373[_0x90d7('0x33')][_0x90d7('0x41')]){_0x20b12e[_0x90d7('0x48')]=[{'all':!![]}];}_0x20b12e=_[_0x90d7('0x3e')]({},_0x20b12e,_0x1a4373[_0x90d7('0x49')]);return db[_0x90d7('0x40')][_0x90d7('0x4a')](_0x20b12e)[_0x90d7('0x26')](handleEntityNotFound(_0x380fe1,null))[_0x90d7('0x26')](respondWithResult(_0x380fe1,null))['catch'](handleError(_0x380fe1,null));};exports[_0x90d7('0x25')]=function(_0xc5749,_0x382972){if(_0xc5749[_0x90d7('0x4b')]['id']){delete _0xc5749[_0x90d7('0x4b')]['id'];}return db[_0x90d7('0x40')]['find']({'where':{'id':_0xc5749[_0x90d7('0x46')]['id']}})[_0x90d7('0x26')](handleEntityNotFound(_0x382972,null))[_0x90d7('0x26')](saveUpdates(_0xc5749[_0x90d7('0x4b')],null))['then'](respondWithResult(_0x382972,null))[_0x90d7('0x44')](handleError(_0x382972,null));};exports[_0x90d7('0x4c')]=function(_0x12447e,_0x35e160){return db[_0x90d7('0x40')][_0x90d7('0x4a')]({'where':{'id':_0x12447e[_0x90d7('0x46')]['id']}})[_0x90d7('0x26')](handleEntityNotFound(_0x35e160,null))['then'](removeEntity(_0x35e160,null))[_0x90d7('0x44')](handleError(_0x35e160,null));};exports[_0x90d7('0x4d')]=function(_0x4316e8,_0x57d1dd){var _0x1d5433;return db[_0x90d7('0x4e')][_0x90d7('0x4f')](function(_0x1c8b52){return db[_0x90d7('0x40')][_0x90d7('0x4d')](_0x4316e8[_0x90d7('0x4b')],{'transaction':_0x1c8b52})[_0x90d7('0x26')](function(_0x47a31d){_0x1d5433=_0x47a31d;var _0x544395={'type':db[_0x90d7('0x50')][_0x90d7('0x51')],'transaction':_0x1c8b52};switch(_0x4316e8[_0x90d7('0x4b')][_0x90d7('0x2f')]){case _0x90d7('0x52'):_0x544395[_0x90d7('0x2f')]=db[_0x90d7('0x50')][_0x90d7('0x51')];break;case _0x90d7('0x53'):_0x544395['type']=db['Sequelize'][_0x90d7('0x54')];break;case _0x90d7('0x55'):_0x544395[_0x90d7('0x2f')]=db[_0x90d7('0x50')][_0x90d7('0x56')];_0x544395[_0x90d7('0x57')]=![];break;default:}return db[_0x90d7('0x4e')][_0x90d7('0x58')][_0x90d7('0x59')](_0x90d7('0x5a'),util[_0x90d7('0x5b')](_0x90d7('0x5c'),_0x1d5433['id']),_0x544395);})[_0x90d7('0x26')](function(){return _0x1d5433;});})[_0x90d7('0x26')](respondWithResult(_0x57d1dd,0xc9))[_0x90d7('0x44')](handleError(_0x57d1dd,null));}; \ No newline at end of file +var _0x4727=['json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','map','CmCustomField','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','rows','rawAttributes','length','find','update','body','params','catch','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xdb07e8,_0x35c2fd){var _0xdf79b3=function(_0x1d3eea){while(--_0x1d3eea){_0xdb07e8['push'](_0xdb07e8['shift']());}};_0xdf79b3(++_0x35c2fd);}(_0x4727,0x187));var _0x7472=function(_0x5772b2,_0x31bcee){_0x5772b2=_0x5772b2-0x0;var _0x1024c0=_0x4727[_0x5772b2];return _0x1024c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7472('0x0'));var zipdir=require(_0x7472('0x1'));var jsonpatch=require(_0x7472('0x2'));var rp=require(_0x7472('0x3'));var moment=require(_0x7472('0x4'));var BPromise=require(_0x7472('0x5'));var Mustache=require('mustache');var util=require(_0x7472('0x6'));var path=require(_0x7472('0x7'));var sox=require('sox');var csv=require(_0x7472('0x8'));var ejs=require(_0x7472('0x9'));var fs=require('fs');var fs_extra=require(_0x7472('0xa'));var _=require(_0x7472('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7472('0xc'));var toCsv=require(_0x7472('0x8'));var querystring=require(_0x7472('0xd'));var Papa=require(_0x7472('0xe'));var Redis=require(_0x7472('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7472('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7472('0x11'));var logger=require(_0x7472('0x12'))(_0x7472('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7472('0x14'));var db=require(_0x7472('0x15'))['db'];function respondWithStatusCode(_0x1ec7d5,_0x3946b2){_0x3946b2=_0x3946b2||0xcc;return function(_0x322a84){if(_0x322a84){return _0x1ec7d5[_0x7472('0x16')](_0x3946b2);}return _0x1ec7d5['status'](_0x3946b2)['end']();};}function respondWithResult(_0x442461,_0x4daa57){_0x4daa57=_0x4daa57||0xc8;return function(_0x18b636){if(_0x18b636){return _0x442461[_0x7472('0x17')](_0x4daa57)[_0x7472('0x18')](_0x18b636);}};}function respondWithFilteredResult(_0x39084d,_0x2be20d){return function(_0x1d93e0){if(_0x1d93e0){var _0x112675=typeof _0x2be20d[_0x7472('0x19')]===_0x7472('0x1a')&&typeof _0x2be20d[_0x7472('0x1b')]===_0x7472('0x1a');var _0x114633=_0x1d93e0[_0x7472('0x1c')];var _0x5cb68e=_0x112675?0x0:_0x2be20d[_0x7472('0x19')];var _0x2c3d14=_0x112675?_0x1d93e0[_0x7472('0x1c')]:_0x2be20d[_0x7472('0x19')]+_0x2be20d[_0x7472('0x1b')];var _0x446648;if(_0x2c3d14>=_0x114633){_0x2c3d14=_0x114633;_0x446648=0xc8;}else{_0x446648=0xce;}_0x39084d[_0x7472('0x17')](_0x446648);return _0x39084d[_0x7472('0x1d')](_0x7472('0x1e'),_0x5cb68e+'-'+_0x2c3d14+'/'+_0x114633)[_0x7472('0x18')](_0x1d93e0);}return null;};}function patchUpdates(_0x4eee68){return function(_0x54eec5){try{jsonpatch['apply'](_0x54eec5,_0x4eee68,!![]);}catch(_0x446880){return BPromise[_0x7472('0x1f')](_0x446880);}return _0x54eec5[_0x7472('0x20')]();};}function saveUpdates(_0x5f2a35,_0x4a942a){return function(_0x5f0d26){if(_0x5f0d26){return _0x5f0d26['update'](_0x5f2a35)[_0x7472('0x21')](function(_0x265228){return _0x265228;});}return null;};}function removeEntity(_0x42ed47,_0x27ab59){return function(_0x265835){if(_0x265835){return _0x265835[_0x7472('0x22')]()['then'](function(){_0x42ed47[_0x7472('0x17')](0xcc)[_0x7472('0x23')]();});}};}function handleEntityNotFound(_0x2d3df1,_0x3d68af){return function(_0x3caa42){if(!_0x3caa42){_0x2d3df1[_0x7472('0x16')](0x194);}return _0x3caa42;};}function handleError(_0x1d1c97,_0xb9e151){_0xb9e151=_0xb9e151||0x1f4;return function(_0x59eb89){logger[_0x7472('0x24')](_0x59eb89[_0x7472('0x25')]);if(_0x59eb89['name']){delete _0x59eb89[_0x7472('0x26')];}_0x1d1c97[_0x7472('0x17')](_0xb9e151)[_0x7472('0x27')](_0x59eb89);};}exports['index']=function(_0x15d21e,_0x246c6e){var _0x30d94b={},_0x42642a={},_0x41db92={'count':0x0,'rows':[]};var _0x10a902=_[_0x7472('0x28')](db[_0x7472('0x29')]['rawAttributes'],function(_0x5887f9){return{'name':_0x5887f9[_0x7472('0x2a')],'type':_0x5887f9[_0x7472('0x2b')][_0x7472('0x2c')]};});_0x42642a['model']=_[_0x7472('0x2d')](_[_0x7472('0x28')](_0x10a902,_0x7472('0x26')),['name']);_0x42642a['query']=_[_0x7472('0x2e')](_0x15d21e[_0x7472('0x2f')]);_0x42642a[_0x7472('0x30')]=_[_0x7472('0x31')](_0x42642a[_0x7472('0x32')],_0x42642a[_0x7472('0x2f')]);_0x30d94b[_0x7472('0x33')]=_['intersection'](_0x42642a[_0x7472('0x32')],qs[_0x7472('0x34')](_0x15d21e[_0x7472('0x2f')][_0x7472('0x34')]));_0x30d94b[_0x7472('0x33')]=_0x30d94b[_0x7472('0x33')]['length']?_0x30d94b['attributes']:_0x42642a[_0x7472('0x32')];if(!_0x15d21e['query'][_0x7472('0x35')]('nolimit')){_0x30d94b['limit']=qs[_0x7472('0x1b')](_0x15d21e[_0x7472('0x2f')][_0x7472('0x1b')]);_0x30d94b[_0x7472('0x19')]=qs[_0x7472('0x19')](_0x15d21e[_0x7472('0x2f')][_0x7472('0x19')]);}_0x30d94b[_0x7472('0x36')]=qs[_0x7472('0x37')](_0x15d21e[_0x7472('0x2f')][_0x7472('0x37')]);_0x30d94b[_0x7472('0x38')]=qs[_0x7472('0x30')](_['pick'](_0x15d21e['query'],_0x42642a[_0x7472('0x30')]),_0x10a902);if(_0x15d21e[_0x7472('0x2f')][_0x7472('0x39')]){_0x30d94b[_0x7472('0x38')]=_[_0x7472('0x3a')](_0x30d94b[_0x7472('0x38')],{'$or':_[_0x7472('0x28')](_0x10a902,function(_0x32d7b9){if(_0x32d7b9[_0x7472('0x2b')]!==_0x7472('0x3b')){var _0xe23867={};_0xe23867[_0x32d7b9[_0x7472('0x26')]]={'$like':'%'+_0x15d21e[_0x7472('0x2f')][_0x7472('0x39')]+'%'};return _0xe23867;}})});}_0x30d94b=_[_0x7472('0x3a')]({},_0x30d94b,_0x15d21e[_0x7472('0x3c')]);var _0x23b26b={'where':_0x30d94b[_0x7472('0x38')]};return db[_0x7472('0x29')][_0x7472('0x1c')](_0x23b26b)[_0x7472('0x21')](function(_0x32fdd9){_0x41db92['count']=_0x32fdd9;if(_0x15d21e[_0x7472('0x2f')]['includeAll']){_0x30d94b[_0x7472('0x3d')]=[{'all':!![]}];}return db[_0x7472('0x29')]['findAll'](_0x30d94b);})[_0x7472('0x21')](function(_0x41bccb){_0x41db92[_0x7472('0x3e')]=_0x41bccb;return _0x41db92;})[_0x7472('0x21')](respondWithFilteredResult(_0x246c6e,_0x30d94b))['catch'](handleError(_0x246c6e,null));};exports['show']=function(_0x473b42,_0x3f4b4a){var _0x3568c8={'raw':!![],'where':{'id':_0x473b42['params']['id']}},_0x31c278={};_0x31c278[_0x7472('0x32')]=_[_0x7472('0x2e')](db[_0x7472('0x29')][_0x7472('0x3f')]);_0x31c278[_0x7472('0x2f')]=_['keys'](_0x473b42[_0x7472('0x2f')]);_0x31c278[_0x7472('0x30')]=_['intersection'](_0x31c278[_0x7472('0x32')],_0x31c278['query']);_0x3568c8['attributes']=_[_0x7472('0x31')](_0x31c278['model'],qs[_0x7472('0x34')](_0x473b42[_0x7472('0x2f')][_0x7472('0x34')]));_0x3568c8[_0x7472('0x33')]=_0x3568c8[_0x7472('0x33')][_0x7472('0x40')]?_0x3568c8[_0x7472('0x33')]:_0x31c278[_0x7472('0x32')];if(_0x473b42[_0x7472('0x2f')]['includeAll']){_0x3568c8['include']=[{'all':!![]}];}_0x3568c8=_[_0x7472('0x3a')]({},_0x3568c8,_0x473b42[_0x7472('0x3c')]);return db[_0x7472('0x29')][_0x7472('0x41')](_0x3568c8)[_0x7472('0x21')](handleEntityNotFound(_0x3f4b4a,null))[_0x7472('0x21')](respondWithResult(_0x3f4b4a,null))['catch'](handleError(_0x3f4b4a,null));};exports[_0x7472('0x42')]=function(_0x195cb7,_0x2e8aaa){if(_0x195cb7[_0x7472('0x43')]['id']){delete _0x195cb7[_0x7472('0x43')]['id'];}return db['CmCustomField'][_0x7472('0x41')]({'where':{'id':_0x195cb7[_0x7472('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e8aaa,null))[_0x7472('0x21')](saveUpdates(_0x195cb7[_0x7472('0x43')],null))[_0x7472('0x21')](respondWithResult(_0x2e8aaa,null))[_0x7472('0x45')](handleError(_0x2e8aaa,null));};exports[_0x7472('0x22')]=function(_0x444dd5,_0x11e12f){return db[_0x7472('0x29')]['find']({'where':{'id':_0x444dd5[_0x7472('0x44')]['id']}})['then'](handleEntityNotFound(_0x11e12f,null))[_0x7472('0x21')](removeEntity(_0x11e12f,null))['catch'](handleError(_0x11e12f,null));};exports[_0x7472('0x46')]=function(_0x3ed9e1,_0x30bef9){var _0x3fad48;return db[_0x7472('0x47')][_0x7472('0x48')](function(_0x4026ec){return db[_0x7472('0x29')][_0x7472('0x46')](_0x3ed9e1[_0x7472('0x43')],{'transaction':_0x4026ec})[_0x7472('0x21')](function(_0x555d41){_0x3fad48=_0x555d41;var _0x102240={'type':db[_0x7472('0x49')][_0x7472('0x4a')],'transaction':_0x4026ec};switch(_0x3ed9e1['body']['type']){case _0x7472('0x4b'):_0x102240[_0x7472('0x2b')]=db[_0x7472('0x49')][_0x7472('0x4a')];break;case'number':_0x102240[_0x7472('0x2b')]=db[_0x7472('0x49')][_0x7472('0x4c')];break;case'switch':_0x102240[_0x7472('0x2b')]=db[_0x7472('0x49')][_0x7472('0x4d')];_0x102240[_0x7472('0x4e')]=![];break;default:}return db['sequelize'][_0x7472('0x4f')][_0x7472('0x50')]('cm_contacts',util[_0x7472('0x51')](_0x7472('0x52'),_0x3fad48['id']),_0x102240);})['then'](function(){return _0x3fad48;});})[_0x7472('0x21')](respondWithResult(_0x30bef9,0xc9))['catch'](handleError(_0x30bef9,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 4c2cf63..64ae4a7 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 _0x3372=['api','moment','request-promise','path','rimraf','../../config/environment','define','lodash','util','../../config/logger'];(function(_0x2996a2,_0xe05735){var _0x33dabe=function(_0x4417c7){while(--_0x4417c7){_0x2996a2['push'](_0x2996a2['shift']());}};_0x33dabe(++_0xe05735);}(_0x3372,0x179));var _0x2337=function(_0x32aeef,_0x1dc19c){_0x32aeef=_0x32aeef-0x0;var _0x3c2a10=_0x3372[_0x32aeef];return _0x3c2a10;};'use strict';var _=require(_0x2337('0x0'));var util=require(_0x2337('0x1'));var logger=require(_0x2337('0x2'))(_0x2337('0x3'));var moment=require(_0x2337('0x4'));var BPromise=require('bluebird');var rp=require(_0x2337('0x5'));var fs=require('fs');var path=require(_0x2337('0x6'));var rimraf=require(_0x2337('0x7'));var config=require(_0x2337('0x8'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x217b52,_0x2b00b2){return _0x217b52[_0x2337('0x9')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x415d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x225500,_0x253031){var _0x50d476=function(_0x1a2261){while(--_0x1a2261){_0x225500['push'](_0x225500['shift']());}};_0x50d476(++_0x253031);}(_0x415d,0x1ec));var _0xd415=function(_0x543d39,_0x471d0a){_0x543d39=_0x543d39-0x0;var _0x5b3b5e=_0x415d[_0x543d39];return _0x5b3b5e;};'use strict';var _=require(_0xd415('0x0'));var util=require(_0xd415('0x1'));var logger=require('../../config/logger')(_0xd415('0x2'));var moment=require('moment');var BPromise=require(_0xd415('0x3'));var rp=require(_0xd415('0x4'));var fs=require('fs');var path=require(_0xd415('0x5'));var rimraf=require(_0xd415('0x6'));var config=require(_0xd415('0x7'));var attributes=require(_0xd415('0x8'));module[_0xd415('0x9')]=function(_0x2e495f,_0x44125e){return _0x2e495f[_0xd415('0xa')](_0xd415('0xb'),attributes,{'tableName':_0xd415('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index c84adf9..c98150e 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 _0x7adb=['result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x27ef37,_0x52cb2f){var _0x5d8bd8=function(_0x11027d){while(--_0x11027d){_0x27ef37['push'](_0x27ef37['shift']());}};_0x5d8bd8(++_0x52cb2f);}(_0x7adb,0x7f));var _0xb7ad=function(_0x1c05c8,_0x1b93ee){_0x1c05c8=_0x1c05c8-0x0;var _0x10789b=_0x7adb[_0x1c05c8];return _0x10789b;};'use strict';var _=require('lodash');var util=require(_0xb7ad('0x0'));var moment=require(_0xb7ad('0x1'));var BPromise=require('bluebird');var rs=require(_0xb7ad('0x2'));var fs=require('fs');var Redis=require(_0xb7ad('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7ad('0x4'));var logger=require(_0xb7ad('0x5'))(_0xb7ad('0x6'));var config=require('../../config/environment');var jayson=require(_0xb7ad('0x7'));var client=jayson['client'][_0xb7ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ad4a5,_0x5057cb,_0x40ea6e){return new BPromise(function(_0x59c3c4,_0x30dad8){return client[_0xb7ad('0x9')](_0x5ad4a5,_0x40ea6e)[_0xb7ad('0xa')](function(_0x4238e1){logger[_0xb7ad('0xb')](_0xb7ad('0xc'),_0x5057cb,_0xb7ad('0xd'));logger[_0xb7ad('0xe')](_0xb7ad('0xf'),_0x5057cb,_0xb7ad('0xd'),JSON[_0xb7ad('0x10')](_0x4238e1));if(_0x4238e1['error']){if(_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x12')]===0x1f4){logger[_0xb7ad('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5057cb,_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x13')]);return _0x30dad8(_0x4238e1[_0xb7ad('0x11')]['message']);}logger['error'](_0xb7ad('0xc'),_0x5057cb,_0x4238e1['error'][_0xb7ad('0x13')]);return _0x59c3c4(_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x13')]);}else{logger[_0xb7ad('0xb')]('CmCustomField,\x20%s,\x20%s',_0x5057cb,'request\x20sent');_0x59c3c4(_0x4238e1[_0xb7ad('0x14')][_0xb7ad('0x13')]);}})['catch'](function(_0x1a017b){logger[_0xb7ad('0x11')]('CmCustomField,\x20%s,\x20%s',_0x5057cb,_0x1a017b);_0x30dad8(_0x1a017b);});});} \ No newline at end of file +var _0xf15e=['CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x42f251,_0x392e02){var _0x2c299e=function(_0x190d1b){while(--_0x190d1b){_0x42f251['push'](_0x42f251['shift']());}};_0x2c299e(++_0x392e02);}(_0xf15e,0xef));var _0xef15=function(_0x503aaf,_0x1f32fe){_0x503aaf=_0x503aaf-0x0;var _0x4694af=_0xf15e[_0x503aaf];return _0x4694af;};'use strict';var _=require(_0xef15('0x0'));var util=require('util');var moment=require(_0xef15('0x1'));var BPromise=require(_0xef15('0x2'));var rs=require(_0xef15('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xef15('0x4'));var logger=require(_0xef15('0x5'))(_0xef15('0x6'));var config=require(_0xef15('0x7'));var jayson=require(_0xef15('0x8'));var client=jayson[_0xef15('0x9')][_0xef15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a310,_0x2eba1a,_0x7d102d){return new BPromise(function(_0x379049,_0x208c3c){return client[_0xef15('0xb')](_0x35a310,_0x7d102d)[_0xef15('0xc')](function(_0x583cbd){logger['info'](_0xef15('0xd'),_0x2eba1a,_0xef15('0xe'));logger[_0xef15('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x2eba1a,_0xef15('0xe'),JSON[_0xef15('0x10')](_0x583cbd));if(_0x583cbd['error']){if(_0x583cbd[_0xef15('0x11')]['code']===0x1f4){logger['error'](_0xef15('0xd'),_0x2eba1a,_0x583cbd[_0xef15('0x11')][_0xef15('0x12')]);return _0x208c3c(_0x583cbd[_0xef15('0x11')][_0xef15('0x12')]);}logger[_0xef15('0x11')](_0xef15('0xd'),_0x2eba1a,_0x583cbd[_0xef15('0x11')][_0xef15('0x12')]);return _0x379049(_0x583cbd['error']['message']);}else{logger[_0xef15('0x13')](_0xef15('0xd'),_0x2eba1a,_0xef15('0xe'));_0x379049(_0x583cbd['result']['message']);}})[_0xef15('0x14')](function(_0x17e232){logger['error'](_0xef15('0xd'),_0x2eba1a,_0x17e232);_0x208c3c(_0x17e232);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 973dabd..b219411 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 _0x2f91=['isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x44414f,_0x27a407){var _0x3edcc3=function(_0x51ed21){while(--_0x51ed21){_0x44414f['push'](_0x44414f['shift']());}};_0x3edcc3(++_0x27a407);}(_0x2f91,0x98));var _0x12f9=function(_0x1fe224,_0x110738){_0x1fe224=_0x1fe224-0x0;var _0x300515=_0x2f91[_0x1fe224];return _0x300515;};'use strict';var multer=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var path=require(_0x12f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x12f9('0x3'));var router=express[_0x12f9('0x4')]();var fs_extra=require(_0x12f9('0x5'));var auth=require(_0x12f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12f9('0x7'));var controller=require(_0x12f9('0x8'));router[_0x12f9('0x9')]('/',auth[_0x12f9('0xa')](),controller['index']);router[_0x12f9('0x9')](_0x12f9('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x12f9('0xa')](),controller[_0x12f9('0xc')]);router[_0x12f9('0xd')](_0x12f9('0xb'),auth[_0x12f9('0xa')](),controller[_0x12f9('0xe')]);router[_0x12f9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x12f9('0x10')]);module[_0x12f9('0x11')]=router; \ No newline at end of file +var _0x9490=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x461c63,_0x2b02cb){var _0x470660=function(_0x370824){while(--_0x370824){_0x461c63['push'](_0x461c63['shift']());}};_0x470660(++_0x2b02cb);}(_0x9490,0x15c));var _0x0949=function(_0x491986,_0x3d2a1c){_0x491986=_0x491986-0x0;var _0xfa0fff=_0x9490[_0x491986];return _0xfa0fff;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0949('0x0'));var express=require('express');var router=express[_0x0949('0x1')]();var fs_extra=require(_0x0949('0x2'));var auth=require(_0x0949('0x3'));var interaction=require(_0x0949('0x4'));var config=require(_0x0949('0x5'));var controller=require('./cmCustomField.controller');router[_0x0949('0x6')]('/',auth[_0x0949('0x7')](),controller[_0x0949('0x8')]);router[_0x0949('0x6')](_0x0949('0x9'),auth['isAuthenticated'](),controller[_0x0949('0xa')]);router[_0x0949('0xb')]('/',auth[_0x0949('0x7')](),controller['create']);router[_0x0949('0xc')](_0x0949('0x9'),auth[_0x0949('0x7')](),controller[_0x0949('0xd')]);router['delete'](_0x0949('0x9'),auth[_0x0949('0x7')](),controller[_0x0949('0xe')]);module[_0x0949('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 3ce5859..0d037fc 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 _0xb987=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format'];(function(_0x1e6956,_0xb7be5c){var _0x52d73e=function(_0x365846){while(--_0x365846){_0x1e6956['push'](_0x1e6956['shift']());}};_0x52d73e(++_0xb7be5c);}(_0xb987,0x16c));var _0x7b98=function(_0x444b13,_0x119afe){_0x444b13=_0x444b13-0x0;var _0x1c12dc=_0xb987[_0x444b13];return _0x1c12dc;};'use strict';var moment=require(_0x7b98('0x0'));var Sequelize=require(_0x7b98('0x1'));module['exports']={'phone':{'type':Sequelize[_0x7b98('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x7b98('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7b98('0x4')],'defaultValue':moment()[_0x7b98('0x5')](_0x7b98('0x6'))},'countbusyretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7b98('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7b98('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7b98('0x4')]},'priority':{'type':Sequelize[_0x7b98('0x7')](0x2)[_0x7b98('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7b98('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7b98('0x7')],'unique':_0x7b98('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x7b98('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x7b98('0x7')],'unique':_0x7b98('0x9')},'CampaignId':{'type':Sequelize[_0x7b98('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7b98('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x7b98('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7b98('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x7b98('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xe1ce=['STRING','UNSIGNED','contactListQueue','moment','sequelize','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x5a474d,_0x3c85e2){var _0x512f2a=function(_0x2f6669){while(--_0x2f6669){_0x5a474d['push'](_0x5a474d['shift']());}};_0x512f2a(++_0x3c85e2);}(_0xe1ce,0xc1));var _0xee1c=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xe1ce[_0x5f0089];return _0x193892;};'use strict';var moment=require(_0xee1c('0x0'));var Sequelize=require(_0xee1c('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xee1c('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xee1c('0x3')],'defaultValue':moment()[_0xee1c('0x4')](_0xee1c('0x5'))},'countbusyretry':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xee1c('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xee1c('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xee1c('0x3')]},'priority':{'type':Sequelize[_0xee1c('0x6')](0x2)[_0xee1c('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xee1c('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xee1c('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xee1c('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xee1c('0x6')],'unique':_0xee1c('0x9')},'CampaignId':{'type':Sequelize[_0xee1c('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xee1c('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xee1c('0x7')]},'recallmeNotifiedDate':{'type':Sequelize[_0xee1c('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0765e3c..dec33fc 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 _0xb717=['LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','scheduledat','recallme','Contact','getOpenContacts','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','then','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','concat','$or','$gte','$lt','$lte','$ne','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contains','$any','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','UserId','user','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne'];(function(_0x3e9d48,_0x4079a4){var _0x4050ba=function(_0x4a2b79){while(--_0x4a2b79){_0x3e9d48['push'](_0x3e9d48['shift']());}};_0x4050ba(++_0x4079a4);}(_0xb717,0x1b4));var _0x7b71=function(_0x126d27,_0x3d45de){_0x126d27=_0x126d27-0x0;var _0x8f915a=_0xb717[_0x126d27];return _0x8f915a;};'use strict';var moment=require(_0x7b71('0x0'));var _=require('lodash');var qs=require(_0x7b71('0x1'));var logger=require('../../config/logger')(_0x7b71('0x2'));var shared=require(_0x7b71('0x3'));var db=require(_0x7b71('0x4'))['db'];function respondWithResult(_0x52c5dd,_0x238319){_0x238319=_0x238319||0xc8;return function(_0x2e583f){if(_0x2e583f){return _0x52c5dd[_0x7b71('0x5')](_0x238319)[_0x7b71('0x6')](_0x2e583f);}};}function respondWithFilteredResult(_0x3d3643,_0x593c15){return function(_0x217efe){if(_0x217efe){var _0x27b060=typeof _0x593c15[_0x7b71('0x7')]===_0x7b71('0x8')&&typeof _0x593c15[_0x7b71('0x9')]==='undefined';var _0x18867f=_0x217efe[_0x7b71('0xa')];var _0x53857a=_0x27b060?0x0:_0x593c15[_0x7b71('0x7')];var _0x45bbcd=_0x27b060?_0x217efe[_0x7b71('0xa')]:_0x593c15['offset']+_0x593c15[_0x7b71('0x9')];var _0x4a39d4;if(_0x45bbcd>=_0x18867f){_0x45bbcd=_0x18867f;_0x4a39d4=0xc8;}else{_0x4a39d4=0xce;}_0x3d3643[_0x7b71('0x5')](_0x4a39d4);return _0x3d3643['set'](_0x7b71('0xb'),_0x53857a+'-'+_0x45bbcd+'/'+_0x18867f)[_0x7b71('0x6')](_0x217efe);}return null;};}function saveUpdates(_0x291ba5,_0x101181){return function(_0x45c890){if(_0x45c890){return _0x45c890['update'](_0x291ba5)[_0x7b71('0xc')](function(_0x481d32){return _0x481d32;});}return null;};}function handleEntityNotFound(_0x121e8f,_0x22114a){return function(_0x4f1f41){if(!_0x4f1f41){_0x121e8f[_0x7b71('0xd')](0x194);}return _0x4f1f41;};}function handleError(_0x3598cc,_0x4266e5){_0x4266e5=_0x4266e5||0x1f4;return function(_0x5888f9){logger['error'](_0x5888f9[_0x7b71('0xe')]);if(_0x5888f9[_0x7b71('0xf')]){delete _0x5888f9[_0x7b71('0xf')];}_0x3598cc[_0x7b71('0x5')](_0x4266e5)['send'](_0x5888f9);};}exports[_0x7b71('0x10')]=function(_0x5ca420,_0x4adce8){var _0x1fd67d={},_0xbde25={},_0x2c35c4={'count':0x0,'rows':[]};var _0x46c47d=_[_0x7b71('0x11')](db['CmHopper'][_0x7b71('0x12')],function(_0x1cdbd0){return{'name':_0x1cdbd0[_0x7b71('0x13')],'type':_0x1cdbd0[_0x7b71('0x14')][_0x7b71('0x15')]};});_0xbde25[_0x7b71('0x16')]=_['map'](_0x46c47d,_0x7b71('0xf'));_0xbde25[_0x7b71('0x17')]=_[_0x7b71('0x18')](_0x5ca420[_0x7b71('0x17')]);_0xbde25['filters']=_['intersection'](_0xbde25[_0x7b71('0x16')],_0xbde25[_0x7b71('0x17')]);_0xbde25[_0x7b71('0x19')]=_[_0x7b71('0x1a')](_0xbde25[_0x7b71('0x19')],['$and',_0x7b71('0x1b'),'$gt',_0x7b71('0x1c'),_0x7b71('0x1d'),_0x7b71('0x1e'),_0x7b71('0x1f'),'$eq','$not',_0x7b71('0x20'),_0x7b71('0x21'),'$in',_0x7b71('0x22'),_0x7b71('0x23'),_0x7b71('0x24'),_0x7b71('0x25'),_0x7b71('0x26'),'$like','$overlap',_0x7b71('0x27'),'$contained',_0x7b71('0x28')]);_0x1fd67d['attributes']=_[_0x7b71('0x29')](_0xbde25[_0x7b71('0x16')],qs[_0x7b71('0x2a')](_0x5ca420['query'][_0x7b71('0x2a')]));_0x1fd67d[_0x7b71('0x2b')]=_0x1fd67d[_0x7b71('0x2b')]['length']?_0x1fd67d[_0x7b71('0x2b')]:_0xbde25[_0x7b71('0x16')];if(!_0x5ca420[_0x7b71('0x17')][_0x7b71('0x2c')](_0x7b71('0x2d'))){_0x1fd67d[_0x7b71('0x9')]=qs[_0x7b71('0x9')](_0x5ca420[_0x7b71('0x17')]['limit']);_0x1fd67d[_0x7b71('0x7')]=qs[_0x7b71('0x7')](_0x5ca420[_0x7b71('0x17')]['offset']);}_0x1fd67d[_0x7b71('0x2e')]=qs[_0x7b71('0x2f')](_0x5ca420[_0x7b71('0x17')][_0x7b71('0x2f')]);_0x1fd67d[_0x7b71('0x30')]=qs[_0x7b71('0x19')](_['pick'](_0x5ca420[_0x7b71('0x17')],_0xbde25[_0x7b71('0x19')]),_0x46c47d);if(_0x5ca420[_0x7b71('0x17')][_0x7b71('0x31')]){_0x1fd67d[_0x7b71('0x30')]=_['merge'](_0x1fd67d[_0x7b71('0x30')],{'$or':_[_0x7b71('0x11')](_0x46c47d,function(_0x28bb40){if(_0x28bb40[_0x7b71('0x14')]!==_0x7b71('0x32')){var _0x27c98c={};_0x27c98c[_0x28bb40[_0x7b71('0xf')]]={'$like':'%'+_0x5ca420[_0x7b71('0x17')]['filter']+'%'};return _0x27c98c;}})});}_0x1fd67d=_[_0x7b71('0x33')]({},_0x1fd67d,_0x5ca420[_0x7b71('0x34')]);var _0x2a3330={'where':_0x1fd67d[_0x7b71('0x30')]};return db[_0x7b71('0x35')][_0x7b71('0xa')](_0x2a3330)[_0x7b71('0xc')](function(_0x4d58d5){_0x2c35c4[_0x7b71('0xa')]=_0x4d58d5;if(_0x5ca420[_0x7b71('0x17')][_0x7b71('0x36')]){_0x1fd67d[_0x7b71('0x37')]=[{'all':!![]}];}return db['CmHopper'][_0x7b71('0x38')](_0x1fd67d);})[_0x7b71('0xc')](function(_0x3cd757){_0x2c35c4[_0x7b71('0x39')]=_0x3cd757;return _0x2c35c4;})[_0x7b71('0xc')](respondWithFilteredResult(_0x4adce8,_0x1fd67d))[_0x7b71('0x3a')](handleError(_0x4adce8,null));};exports[_0x7b71('0x3b')]=function(_0x343d7e,_0x30e9d1){var _0x6cc0ab={'raw':!![],'where':{'id':_0x343d7e[_0x7b71('0x3c')]['id']}},_0xa1db9f={};_0xa1db9f['model']=_[_0x7b71('0x18')](db[_0x7b71('0x35')]['rawAttributes']);_0xa1db9f[_0x7b71('0x17')]=_[_0x7b71('0x18')](_0x343d7e[_0x7b71('0x17')]);_0xa1db9f[_0x7b71('0x19')]=_[_0x7b71('0x29')](_0xa1db9f['model'],_0xa1db9f[_0x7b71('0x17')]);_0x6cc0ab[_0x7b71('0x2b')]=_[_0x7b71('0x29')](_0xa1db9f[_0x7b71('0x16')],qs[_0x7b71('0x2a')](_0x343d7e['query']['fields']));_0x6cc0ab[_0x7b71('0x2b')]=_0x6cc0ab['attributes'][_0x7b71('0x3d')]?_0x6cc0ab[_0x7b71('0x2b')]:_0xa1db9f[_0x7b71('0x16')];if(_0x343d7e[_0x7b71('0x17')][_0x7b71('0x36')]){_0x6cc0ab[_0x7b71('0x37')]=[{'all':!![]}];}_0x6cc0ab=_[_0x7b71('0x33')]({},_0x6cc0ab,_0x343d7e['options']);return db[_0x7b71('0x35')][_0x7b71('0x3e')](_0x6cc0ab)['then'](handleEntityNotFound(_0x30e9d1,null))[_0x7b71('0xc')](respondWithResult(_0x30e9d1,null))[_0x7b71('0x3a')](handleError(_0x30e9d1,null));};exports[_0x7b71('0x3f')]=function(_0x443e61,_0x1b8fc3){return db[_0x7b71('0x35')][_0x7b71('0x3f')](_0x443e61[_0x7b71('0x40')],{})[_0x7b71('0xc')](respondWithResult(_0x1b8fc3,0xc9))[_0x7b71('0x3a')](handleError(_0x1b8fc3,null));};exports[_0x7b71('0x41')]=function(_0x1080e2,_0x153084){if(_0x1080e2['body']['id']){delete _0x1080e2[_0x7b71('0x40')]['id'];}return db[_0x7b71('0x35')]['find']({'where':{'id':_0x1080e2['params']['id']}})['then'](handleEntityNotFound(_0x153084,null))[_0x7b71('0xc')](saveUpdates(_0x1080e2[_0x7b71('0x40')],null))[_0x7b71('0xc')](respondWithResult(_0x153084,null))['catch'](handleError(_0x153084,null));};exports[_0x7b71('0x42')]=function(_0x3f6ae9,_0x50173b){return db[_0x7b71('0x35')][_0x7b71('0x42')]()[_0x7b71('0xc')](respondWithResult(_0x50173b,null))['catch'](handleError(_0x50173b,null));};exports[_0x7b71('0x43')]=function(_0x18cb19,_0x945c68){var _0xc3c557;var _0x20e9ed=_0x18cb19[_0x7b71('0x3c')]['id'];return db[_0x7b71('0x35')][_0x7b71('0x3e')]({'where':{'id':_0x18cb19[_0x7b71('0x3c')]['id']}})[_0x7b71('0xc')](handleEntityNotFound(_0x945c68,null))[_0x7b71('0xc')](function(_0xe6825d){if(_0xe6825d){return _0xe6825d['destroy']()[_0x7b71('0xc')](function(_0x504cdf){return _0x504cdf;});}})[_0x7b71('0xc')](function(_0x154f72){_0xc3c557=_0x154f72;if(_0x154f72){if(_0x154f72[_0x7b71('0x44')]||_0x154f72[_0x7b71('0x45')]){return db[_0x154f72[_0x7b71('0x44')]?_0x7b71('0x46'):'Campaign'][_0x7b71('0x3e')]({'where':{'id':_0x154f72['VoiceQueueId']?_0x154f72['VoiceQueueId']:_0x154f72[_0x7b71('0x45')]},'attributes':['id','name'],'raw':!![]});}}})[_0x7b71('0xc')](function(_0x1e8092){var _0x3bb43f={};if(_0x1e8092){_[_0x7b71('0x33')](_0x3bb43f,_[_0x7b71('0x47')](_0xc3c557[_0x7b71('0x48')],[_0x7b71('0x49'),_0x7b71('0x4a'),'id']));_0x3bb43f[_0x7b71('0x4b')]=0x15;_0x3bb43f[_0x7b71('0x4c')]=_0x7b71('0x4d');_0x3bb43f['campaign']=_0x1e8092['name'];_0x3bb43f[_0x7b71('0x4e')]=_0x18cb19['user'][_0x7b71('0xf')];_0x3bb43f[_0x7b71('0x4f')]=_0x18cb19[_0x7b71('0x50')]['id'];_0x3bb43f['deleted']=!![];_0x3bb43f['deletedat']=moment()['format'](_0x7b71('0x51'));_0x3bb43f['calleridnum']=_0xc3c557[_0x7b71('0x52')];_0x3bb43f[_0x7b71('0x53')]=_0xc3c557['VoiceQueueId']?_0x7b71('0x54'):'ivr';return db[_0x7b71('0x55')]['find']({'where':{'id':_0x3bb43f[_0x7b71('0x56')]},'attributes':['firstName',_0x7b71('0x57')]})['then'](function(_0x1c1f3c){if(!_['isNil'](_0x945c68)&&!_[_0x7b71('0x58')](_0x1c1f3c[_0x7b71('0x59')])){_0x3bb43f[_0x7b71('0x5a')]=_0x1c1f3c['firstName'];if(!_['isNil'](_0x1c1f3c[_0x7b71('0x57')])){_0x3bb43f[_0x7b71('0x5a')]+='\x20'+_0x1c1f3c[_0x7b71('0x57')];}}})[_0x7b71('0x5b')](function(){return db[_0x7b71('0x5c')][_0x7b71('0x3f')](_0x3bb43f);});}})['then'](function(_0x1f7cec){return db[_0x7b71('0x5d')]['destroy']({'where':{'CmHopperId':_0x20e9ed}});})[_0x7b71('0xc')](function(){return _0x945c68['status'](0xcc)[_0x7b71('0x5e')]();})[_0x7b71('0x3a')](handleError(_0x945c68,null));};exports[_0x7b71('0x5f')]=function(_0x357e11,_0x4e478d){var _0x38dbd7=[];return db[_0x7b71('0x55')][_0x7b71('0x42')]()[_0x7b71('0xc')](function(_0x4448a2){_0x38dbd7=_[_0x7b71('0x18')](_0x4448a2);return _0x357e11[_0x7b71('0x50')][_0x7b71('0x60')]({'where':{'type':_0x7b71('0x61'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x7b71('0x62'),_0x7b71('0x63')],'raw':!![]});})[_0x7b71('0xc')](function(_0x1180ed){if(_0x1180ed&&_0x1180ed[_0x7b71('0x3d')]){return db[_0x7b71('0x64')][_0x7b71('0x65')](function(_0x2f1b0b){var _0x144906={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7b71('0x66')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x7b71('0x11')](_0x1180ed,'id')},'$or':[{'UserId':null},{'UserId':_0x357e11['user']['id']}]};var _0x498df3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1180ed)[_0x7b71('0x31')]([_0x7b71('0x63'),0x0])[_0x7b71('0x11')]('id')[_0x7b71('0x67')]()},'$or':[{'UserId':null},{'UserId':_0x357e11[_0x7b71('0x50')]['id']}]};var _0x3fd1f9={'$or':[_0x144906,_0x498df3]};var _0x430edc=[];if(_0x357e11[_0x7b71('0x40')][_0x7b71('0x68')]&&_0x357e11['body'][_0x7b71('0x68')]===_0x7b71('0x69')){if(!_[_0x7b71('0x6a')](_0x357e11['body'][_0x7b71('0x6b')])){_0x3fd1f9['id']={'$in':_0x357e11[_0x7b71('0x40')][_0x7b71('0x6b')]};}_0x430edc=[[_0x7b71('0x6c'),'ASC'],['scheduledAt',_0x1180ed[0x0][_0x7b71('0x62')]===_0x7b71('0x6d')?_0x7b71('0x6e'):_0x7b71('0x6d')],db[_0x7b71('0x64')][_0x7b71('0x6f')](_0x7b71('0x70')),['id',_0x7b71('0x6e')]];}else{if(!_[_0x7b71('0x6a')](_0x357e11['body'][_0x7b71('0x6b')])){_0x3fd1f9['id']={'$notIn':_0x357e11[_0x7b71('0x40')][_0x7b71('0x6b')]};}_0x430edc=[[_0x7b71('0x6c'),_0x7b71('0x6e')],[_0x7b71('0x71'),_0x1180ed[0x0][_0x7b71('0x62')]],db[_0x7b71('0x64')]['literal'](_0x7b71('0x72')),['id',_0x7b71('0x6d')]];}return db['CmHopper'][_0x7b71('0x73')]({'attributes':['id','scheduledat','phone','recallme'],'where':_0x3fd1f9,'order':_0x430edc,'transaction':_0x2f1b0b,'lock':_0x2f1b0b[_0x7b71('0x74')][_0x7b71('0x75')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x38dbd7,'include':[{'model':db[_0x7b71('0x76')],'as':_0x7b71('0x77'),'attributes':['id',_0x7b71('0xf')]}]},{'model':db[_0x7b71('0x78')],'as':_0x7b71('0x79'),'attributes':['id',_0x7b71('0xf')]},{'model':db[_0x7b71('0x46')],'as':_0x7b71('0x7a'),'attributes':['id',_0x7b71('0xf'),_0x7b71('0x7b')]}]})[_0x7b71('0xc')](function(_0x2d0ef1){if(_0x2d0ef1){return _0x2d0ef1[_0x7b71('0x41')]({'UserId':_0x357e11[_0x7b71('0x50')]['id']},{'transaction':_0x2f1b0b});}});});}})[_0x7b71('0xc')](handleEntityNotFound(_0x4e478d,null))[_0x7b71('0xc')](respondWithResult(_0x4e478d,null))[_0x7b71('0x3a')](handleError(_0x4e478d,null));};exports[_0x7b71('0x7c')]=function(_0x58d4a5,_0x55f34c,_0x564b69){var _0x4269a6=[];var _0x58ed1d=_0x58d4a5[_0x7b71('0x3c')]['id'];var _0xe5e271=_0x58d4a5[_0x7b71('0x50')]['id'];return db[_0x7b71('0x55')][_0x7b71('0x42')]()[_0x7b71('0xc')](function(_0x5baa81){_0x4269a6=_[_0x7b71('0x18')](_0x5baa81);return db[_0x7b71('0x64')][_0x7b71('0x65')](function(_0x23b852){const _0x392a99={'id':_0x58ed1d};return db['CmHopper']['findOne']({'attributes':['id',_0x7b71('0x7d'),_0x7b71('0x7e')],'where':_0x392a99,'transaction':_0x23b852,'lock':_0x23b852[_0x7b71('0x74')][_0x7b71('0x75')],'include':[{'model':db[_0x7b71('0x55')],'as':_0x7b71('0x7f'),'attributes':_0x4269a6,'include':[{'model':db[_0x7b71('0x76')],'as':_0x7b71('0x77'),'attributes':['id',_0x7b71('0xf')]}]},{'model':db[_0x7b71('0x78')],'as':_0x7b71('0x79'),'attributes':['id','name']},{'model':db[_0x7b71('0x46')],'as':'Queue','attributes':['id','name',_0x7b71('0x7b')]}]})['then'](function(_0x10b311){if(_0x10b311){return _0x10b311['update']({'UserId':_0xe5e271},{'transaction':_0x23b852});}});});})['then'](handleEntityNotFound(_0x55f34c,null))[_0x7b71('0xc')](respondWithResult(_0x55f34c,null))[_0x7b71('0x3a')](handleError(_0x55f34c,null));};exports[_0x7b71('0x80')]=function(_0x4f91b9,_0x88d1cf){return _0x4f91b9[_0x7b71('0x50')][_0x7b71('0x60')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7b71('0x81')},'attributes':['id'],'raw':!![]})[_0x7b71('0xc')](function(_0x4458f8){if(_0x4458f8&&_0x4458f8[_0x7b71('0x3d')]){return db['CmHopper'][_0x7b71('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7b71('0x66')](_0x7b71('0x51'))},'VoiceQueueId':{'$in':_[_0x7b71('0x11')](_0x4458f8,'id')},'$or':[{'UserId':null},{'UserId':_0x4f91b9[_0x7b71('0x50')]['id']}]}});}return 0x0;})[_0x7b71('0xc')](function(_0x25f71c){if(!_[_0x7b71('0x58')](_0x25f71c)&&_[_0x7b71('0x82')](_0x25f71c)){return _0x88d1cf[_0x7b71('0x5')](0xc8)[_0x7b71('0x6')]({'contacts':_0x25f71c});}else{logger[_0x7b71('0x83')](_0x7b71('0x84'),_0x7b71('0x80'),0x194,'entity\x20not\x20found');_0x88d1cf['sendStatus'](0x194);}})[_0x7b71('0x3a')](handleError(_0x88d1cf,null));};exports[_0x7b71('0x85')]=function(_0x9e404c,_0x3553de){var _0x457115=shared['timezones'];var _0x25c02f=[];_[_0x7b71('0x11')](_0x457115,function(_0x46d05a){_0x25c02f[_0x7b71('0x86')]({'id':_0x46d05a[_0x7b71('0xf')],'name':_0x46d05a[_0x7b71('0xf')],'utcOffset':_0x46d05a[_0x7b71('0x87')]});});return _0x3553de[_0x7b71('0x5')](0xc8)['json']({'tz':_0x25c02f});};exports[_0x7b71('0x88')]=function(_0x57cc1e,_0x56f4d0){var _0x5768b5=shared[_0x7b71('0x89')];var _0x268d9b={};if(!_[_0x7b71('0x58')](_0x5768b5[_0x57cc1e['body']['id']]))_0x268d9b=_0x5768b5[_0x57cc1e[_0x7b71('0x40')]['id']];return _0x56f4d0[_0x7b71('0x5')](0xc8)[_0x7b71('0x6')](_0x268d9b);}; \ No newline at end of file +var _0x8819=['dialActive','getPreviewRecall','transaction','findOne','CmCompany','List','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','getTimezone','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','limit','count','offset','set','sendStatus','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','$and','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','find','body','update','describe','destroy','params','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','create','CmHopperAdditionalPhone','getPreview','CmContact','getVoiceQueues','preview','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','Company','CmList'];(function(_0x499a43,_0x3cbee7){var _0x4e607e=function(_0xd7f146){while(--_0xd7f146){_0x499a43['push'](_0x499a43['shift']());}};_0x4e607e(++_0x3cbee7);}(_0x8819,0x94));var _0x9881=function(_0x166c12,_0x5c32f7){_0x166c12=_0x166c12-0x0;var _0x555f67=_0x8819[_0x166c12];return _0x555f67;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x9881('0x0'));var logger=require(_0x9881('0x1'))(_0x9881('0x2'));var shared=require(_0x9881('0x3'));var db=require(_0x9881('0x4'))['db'];function respondWithResult(_0x5e52c5,_0x333d6f){_0x333d6f=_0x333d6f||0xc8;return function(_0x446deb){if(_0x446deb){return _0x5e52c5[_0x9881('0x5')](_0x333d6f)[_0x9881('0x6')](_0x446deb);}};}function respondWithFilteredResult(_0x1791fd,_0x2a3664){return function(_0x5f1d45){if(_0x5f1d45){var _0x353966=typeof _0x2a3664['offset']==='undefined'&&typeof _0x2a3664[_0x9881('0x7')]==='undefined';var _0x5c2c0f=_0x5f1d45[_0x9881('0x8')];var _0x4adf62=_0x353966?0x0:_0x2a3664[_0x9881('0x9')];var _0x39122e=_0x353966?_0x5f1d45[_0x9881('0x8')]:_0x2a3664['offset']+_0x2a3664[_0x9881('0x7')];var _0x1327e8;if(_0x39122e>=_0x5c2c0f){_0x39122e=_0x5c2c0f;_0x1327e8=0xc8;}else{_0x1327e8=0xce;}_0x1791fd[_0x9881('0x5')](_0x1327e8);return _0x1791fd[_0x9881('0xa')]('Content-Range',_0x4adf62+'-'+_0x39122e+'/'+_0x5c2c0f)[_0x9881('0x6')](_0x5f1d45);}return null;};}function saveUpdates(_0x26ee3f,_0x5c6d2d){return function(_0x42850e){if(_0x42850e){return _0x42850e['update'](_0x26ee3f)['then'](function(_0x48cfe1){return _0x48cfe1;});}return null;};}function handleEntityNotFound(_0x58f526,_0x12794f){return function(_0x3178d7){if(!_0x3178d7){_0x58f526[_0x9881('0xb')](0x194);}return _0x3178d7;};}function handleError(_0x1947e8,_0x39d127){_0x39d127=_0x39d127||0x1f4;return function(_0x1d57ea){logger['error'](_0x1d57ea[_0x9881('0xc')]);if(_0x1d57ea[_0x9881('0xd')]){delete _0x1d57ea[_0x9881('0xd')];}_0x1947e8['status'](_0x39d127)['send'](_0x1d57ea);};}exports['index']=function(_0x280ea2,_0x4c3493){var _0x620a9a={},_0x5a9848={},_0x59ff56={'count':0x0,'rows':[]};var _0x1f6e20=_[_0x9881('0xe')](db[_0x9881('0xf')][_0x9881('0x10')],function(_0x43f8a2){return{'name':_0x43f8a2[_0x9881('0x11')],'type':_0x43f8a2[_0x9881('0x12')][_0x9881('0x13')]};});_0x5a9848[_0x9881('0x14')]=_[_0x9881('0xe')](_0x1f6e20,_0x9881('0xd'));_0x5a9848[_0x9881('0x15')]=_[_0x9881('0x16')](_0x280ea2[_0x9881('0x15')]);_0x5a9848[_0x9881('0x17')]=_['intersection'](_0x5a9848['model'],_0x5a9848[_0x9881('0x15')]);_0x5a9848['filters']=_['concat'](_0x5a9848[_0x9881('0x17')],[_0x9881('0x18'),'$or','$gt',_0x9881('0x19'),'$lt',_0x9881('0x1a'),_0x9881('0x1b'),_0x9881('0x1c'),_0x9881('0x1d'),_0x9881('0x1e'),_0x9881('0x1f'),_0x9881('0x20'),_0x9881('0x21'),_0x9881('0x22'),_0x9881('0x23'),_0x9881('0x24'),_0x9881('0x25'),_0x9881('0x22'),'$overlap',_0x9881('0x26'),_0x9881('0x27'),'$any']);_0x620a9a[_0x9881('0x28')]=_[_0x9881('0x29')](_0x5a9848['model'],qs[_0x9881('0x2a')](_0x280ea2[_0x9881('0x15')][_0x9881('0x2a')]));_0x620a9a[_0x9881('0x28')]=_0x620a9a[_0x9881('0x28')][_0x9881('0x2b')]?_0x620a9a[_0x9881('0x28')]:_0x5a9848[_0x9881('0x14')];if(!_0x280ea2['query'][_0x9881('0x2c')](_0x9881('0x2d'))){_0x620a9a[_0x9881('0x7')]=qs[_0x9881('0x7')](_0x280ea2[_0x9881('0x15')][_0x9881('0x7')]);_0x620a9a['offset']=qs[_0x9881('0x9')](_0x280ea2[_0x9881('0x15')]['offset']);}_0x620a9a[_0x9881('0x2e')]=qs[_0x9881('0x2f')](_0x280ea2[_0x9881('0x15')][_0x9881('0x2f')]);_0x620a9a[_0x9881('0x30')]=qs['filters'](_[_0x9881('0x31')](_0x280ea2[_0x9881('0x15')],_0x5a9848[_0x9881('0x17')]),_0x1f6e20);if(_0x280ea2[_0x9881('0x15')][_0x9881('0x32')]){_0x620a9a[_0x9881('0x30')]=_[_0x9881('0x33')](_0x620a9a[_0x9881('0x30')],{'$or':_[_0x9881('0xe')](_0x1f6e20,function(_0x26c829){if(_0x26c829[_0x9881('0x12')]!==_0x9881('0x34')){var _0xfff6a5={};_0xfff6a5[_0x26c829[_0x9881('0xd')]]={'$like':'%'+_0x280ea2[_0x9881('0x15')][_0x9881('0x32')]+'%'};return _0xfff6a5;}})});}_0x620a9a=_['merge']({},_0x620a9a,_0x280ea2[_0x9881('0x35')]);var _0x5f14d5={'where':_0x620a9a[_0x9881('0x30')]};return db['CmHopper'][_0x9881('0x8')](_0x5f14d5)[_0x9881('0x36')](function(_0x4c865e){_0x59ff56[_0x9881('0x8')]=_0x4c865e;if(_0x280ea2['query'][_0x9881('0x37')]){_0x620a9a[_0x9881('0x38')]=[{'all':!![]}];}return db[_0x9881('0xf')][_0x9881('0x39')](_0x620a9a);})['then'](function(_0x2b2a0b){_0x59ff56[_0x9881('0x3a')]=_0x2b2a0b;return _0x59ff56;})[_0x9881('0x36')](respondWithFilteredResult(_0x4c3493,_0x620a9a))[_0x9881('0x3b')](handleError(_0x4c3493,null));};exports[_0x9881('0x3c')]=function(_0x201dcd,_0x100139){var _0x4feb70={'raw':!![],'where':{'id':_0x201dcd['params']['id']}},_0x3f25db={};_0x3f25db[_0x9881('0x14')]=_[_0x9881('0x16')](db[_0x9881('0xf')]['rawAttributes']);_0x3f25db[_0x9881('0x15')]=_[_0x9881('0x16')](_0x201dcd[_0x9881('0x15')]);_0x3f25db['filters']=_[_0x9881('0x29')](_0x3f25db[_0x9881('0x14')],_0x3f25db['query']);_0x4feb70[_0x9881('0x28')]=_[_0x9881('0x29')](_0x3f25db[_0x9881('0x14')],qs[_0x9881('0x2a')](_0x201dcd[_0x9881('0x15')][_0x9881('0x2a')]));_0x4feb70[_0x9881('0x28')]=_0x4feb70[_0x9881('0x28')][_0x9881('0x2b')]?_0x4feb70[_0x9881('0x28')]:_0x3f25db['model'];if(_0x201dcd[_0x9881('0x15')][_0x9881('0x37')]){_0x4feb70[_0x9881('0x38')]=[{'all':!![]}];}_0x4feb70=_[_0x9881('0x33')]({},_0x4feb70,_0x201dcd[_0x9881('0x35')]);return db['CmHopper'][_0x9881('0x3d')](_0x4feb70)[_0x9881('0x36')](handleEntityNotFound(_0x100139,null))[_0x9881('0x36')](respondWithResult(_0x100139,null))[_0x9881('0x3b')](handleError(_0x100139,null));};exports['create']=function(_0x28f0c0,_0xc9713c){return db[_0x9881('0xf')]['create'](_0x28f0c0[_0x9881('0x3e')],{})[_0x9881('0x36')](respondWithResult(_0xc9713c,0xc9))[_0x9881('0x3b')](handleError(_0xc9713c,null));};exports[_0x9881('0x3f')]=function(_0x193c45,_0x391777){if(_0x193c45[_0x9881('0x3e')]['id']){delete _0x193c45[_0x9881('0x3e')]['id'];}return db[_0x9881('0xf')][_0x9881('0x3d')]({'where':{'id':_0x193c45['params']['id']}})[_0x9881('0x36')](handleEntityNotFound(_0x391777,null))[_0x9881('0x36')](saveUpdates(_0x193c45[_0x9881('0x3e')],null))['then'](respondWithResult(_0x391777,null))[_0x9881('0x3b')](handleError(_0x391777,null));};exports[_0x9881('0x40')]=function(_0x1e1f0f,_0x573b4f){return db['CmHopper'][_0x9881('0x40')]()[_0x9881('0x36')](respondWithResult(_0x573b4f,null))[_0x9881('0x3b')](handleError(_0x573b4f,null));};exports[_0x9881('0x41')]=function(_0x49c478,_0x514263){var _0x3689d7;var _0x355357=_0x49c478[_0x9881('0x42')]['id'];return db['CmHopper'][_0x9881('0x3d')]({'where':{'id':_0x49c478[_0x9881('0x42')]['id']}})['then'](handleEntityNotFound(_0x514263,null))[_0x9881('0x36')](function(_0x262b8b){if(_0x262b8b){return _0x262b8b[_0x9881('0x41')]()[_0x9881('0x36')](function(_0x21720a){return _0x21720a;});}})[_0x9881('0x36')](function(_0x43f17d){_0x3689d7=_0x43f17d;if(_0x43f17d){if(_0x43f17d['VoiceQueueId']||_0x43f17d[_0x9881('0x43')]){return db[_0x43f17d['VoiceQueueId']?_0x9881('0x44'):_0x9881('0x45')][_0x9881('0x3d')]({'where':{'id':_0x43f17d[_0x9881('0x46')]?_0x43f17d['VoiceQueueId']:_0x43f17d['CampaignId']},'attributes':['id',_0x9881('0xd')],'raw':!![]});}}})[_0x9881('0x36')](function(_0x2fdba2){var _0x49d8b6={};if(_0x2fdba2){_[_0x9881('0x33')](_0x49d8b6,_[_0x9881('0x47')](_0x3689d7[_0x9881('0x48')],[_0x9881('0x49'),_0x9881('0x4a'),'id']));_0x49d8b6[_0x9881('0x4b')]=0x15;_0x49d8b6['statedesc']=_0x9881('0x4c');_0x49d8b6[_0x9881('0x4d')]=_0x2fdba2[_0x9881('0xd')];_0x49d8b6[_0x9881('0x4e')]=_0x49c478[_0x9881('0x4f')]['name'];_0x49d8b6['UserId']=_0x49c478['user']['id'];_0x49d8b6[_0x9881('0x4c')]=!![];_0x49d8b6[_0x9881('0x50')]=moment()[_0x9881('0x51')](_0x9881('0x52'));_0x49d8b6[_0x9881('0x53')]=_0x3689d7[_0x9881('0x54')];_0x49d8b6['campaigntype']=_0x3689d7['VoiceQueueId']?_0x9881('0x55'):_0x9881('0x56');return db['CmContact'][_0x9881('0x3d')]({'where':{'id':_0x49d8b6[_0x9881('0x57')]},'attributes':[_0x9881('0x58'),_0x9881('0x59')]})['then'](function(_0x3efda3){if(!_['isNil'](_0x514263)&&!_[_0x9881('0x5a')](_0x3efda3[_0x9881('0x58')])){_0x49d8b6[_0x9881('0x5b')]=_0x3efda3['firstName'];if(!_['isNil'](_0x3efda3['lastName'])){_0x49d8b6[_0x9881('0x5b')]+='\x20'+_0x3efda3[_0x9881('0x59')];}}})['finally'](function(){return db[_0x9881('0x5c')][_0x9881('0x5d')](_0x49d8b6);});}})[_0x9881('0x36')](function(_0x165274){return db[_0x9881('0x5e')][_0x9881('0x41')]({'where':{'CmHopperId':_0x355357}});})[_0x9881('0x36')](function(){return _0x514263[_0x9881('0x5')](0xcc)['end']();})['catch'](handleError(_0x514263,null));};exports[_0x9881('0x5f')]=function(_0x4012d9,_0xb9d0ac){var _0x12f6eb=[];return db[_0x9881('0x60')][_0x9881('0x40')]()['then'](function(_0x438a14){_0x12f6eb=_[_0x9881('0x16')](_0x438a14);return _0x4012d9[_0x9881('0x4f')][_0x9881('0x61')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x9881('0x62')},'attributes':['id','dialOrderByScheduledAt',_0x9881('0x63')],'raw':!![]});})[_0x9881('0x36')](function(_0xc1fd9b){if(_0xc1fd9b&&_0xc1fd9b[_0x9881('0x2b')]){return db['sequelize']['transaction'](function(_0x23f6cf){var _0x5d218e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9881('0x52'))},'VoiceQueueId':{'$in':_[_0x9881('0xe')](_0xc1fd9b,'id')},'$or':[{'UserId':null},{'UserId':_0x4012d9[_0x9881('0x4f')]['id']}]};var _0x4b5491={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xc1fd9b)[_0x9881('0x32')]([_0x9881('0x63'),0x0])['map']('id')[_0x9881('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x4012d9[_0x9881('0x4f')]['id']}]};var _0x4d5ea0={'$or':[_0x5d218e,_0x4b5491]};var _0x21503c=[];if(_0x4012d9['body'][_0x9881('0x65')]&&_0x4012d9[_0x9881('0x3e')][_0x9881('0x65')]===_0x9881('0x66')){if(!_[_0x9881('0x67')](_0x4012d9[_0x9881('0x3e')]['hopperIds'])){_0x4d5ea0['id']={'$in':_0x4012d9[_0x9881('0x3e')][_0x9881('0x68')]};}_0x21503c=[[_0x9881('0x69'),_0x9881('0x6a')],[_0x9881('0x6b'),_0xc1fd9b[0x0][_0x9881('0x6c')]===_0x9881('0x6a')?_0x9881('0x6d'):_0x9881('0x6a')],db[_0x9881('0x6e')][_0x9881('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x9881('0x6d')]];}else{if(!_[_0x9881('0x67')](_0x4012d9['body'][_0x9881('0x68')])){_0x4d5ea0['id']={'$notIn':_0x4012d9[_0x9881('0x3e')]['hopperIds']};}_0x21503c=[[_0x9881('0x69'),_0x9881('0x6d')],[_0x9881('0x6b'),_0xc1fd9b[0x0][_0x9881('0x6c')]],db[_0x9881('0x6e')]['literal'](_0x9881('0x70')),['id',_0x9881('0x6a')]];}return db[_0x9881('0xf')]['findOne']({'attributes':['id',_0x9881('0x71'),_0x9881('0x54'),_0x9881('0x72')],'where':_0x4d5ea0,'order':_0x21503c,'transaction':_0x23f6cf,'lock':_0x23f6cf[_0x9881('0x73')][_0x9881('0x74')],'include':[{'model':db['CmContact'],'as':_0x9881('0x75'),'attributes':_0x12f6eb,'include':[{'model':db['CmCompany'],'as':_0x9881('0x76'),'attributes':['id',_0x9881('0xd')]}]},{'model':db[_0x9881('0x77')],'as':'List','attributes':['id',_0x9881('0xd')]},{'model':db[_0x9881('0x44')],'as':'Queue','attributes':['id',_0x9881('0xd'),_0x9881('0x78')]}]})[_0x9881('0x36')](function(_0x4263ac){if(_0x4263ac){return _0x4263ac[_0x9881('0x3f')]({'UserId':_0x4012d9[_0x9881('0x4f')]['id']},{'transaction':_0x23f6cf});}});});}})['then'](handleEntityNotFound(_0xb9d0ac,null))[_0x9881('0x36')](respondWithResult(_0xb9d0ac,null))[_0x9881('0x3b')](handleError(_0xb9d0ac,null));};exports[_0x9881('0x79')]=function(_0x15f887,_0x578ac5,_0x1489cf){var _0x30bd50=[];var _0x5125c1=_0x15f887[_0x9881('0x42')]['id'];var _0x30a343=_0x15f887[_0x9881('0x4f')]['id'];return db['CmContact']['describe']()['then'](function(_0x57c931){_0x30bd50=_[_0x9881('0x16')](_0x57c931);return db[_0x9881('0x6e')][_0x9881('0x7a')](function(_0x237757){const _0x47739f={'id':_0x5125c1};return db[_0x9881('0xf')][_0x9881('0x7b')]({'attributes':['id',_0x9881('0x71'),'recallme'],'where':_0x47739f,'transaction':_0x237757,'lock':_0x237757[_0x9881('0x73')][_0x9881('0x74')],'include':[{'model':db[_0x9881('0x60')],'as':'Contact','attributes':_0x30bd50,'include':[{'model':db[_0x9881('0x7c')],'as':_0x9881('0x76'),'attributes':['id',_0x9881('0xd')]}]},{'model':db[_0x9881('0x77')],'as':_0x9881('0x7d'),'attributes':['id',_0x9881('0xd')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x9881('0xd'),_0x9881('0x78')]}]})[_0x9881('0x36')](function(_0x54af49){if(_0x54af49){return _0x54af49[_0x9881('0x3f')]({'UserId':_0x30a343},{'transaction':_0x237757});}});});})[_0x9881('0x36')](handleEntityNotFound(_0x578ac5,null))[_0x9881('0x36')](respondWithResult(_0x578ac5,null))['catch'](handleError(_0x578ac5,null));};exports[_0x9881('0x7e')]=function(_0x13dc4d,_0x2f654f){return _0x13dc4d[_0x9881('0x4f')][_0x9881('0x61')]({'where':{'type':_0x9881('0x7f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x21bc73){if(_0x21bc73&&_0x21bc73[_0x9881('0x2b')]){return db['CmHopper'][_0x9881('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9881('0x51')](_0x9881('0x52'))},'VoiceQueueId':{'$in':_[_0x9881('0xe')](_0x21bc73,'id')},'$or':[{'UserId':null},{'UserId':_0x13dc4d['user']['id']}]}});}return 0x0;})[_0x9881('0x36')](function(_0x569561){if(!_[_0x9881('0x5a')](_0x569561)&&_[_0x9881('0x80')](_0x569561)){return _0x2f654f[_0x9881('0x5')](0xc8)['json']({'contacts':_0x569561});}else{logger['error'](_0x9881('0x81'),_0x9881('0x7e'),0x194,_0x9881('0x82'));_0x2f654f['sendStatus'](0x194);}})[_0x9881('0x3b')](handleError(_0x2f654f,null));};exports[_0x9881('0x83')]=function(_0x942159,_0x1c8218){var _0x19937d=shared[_0x9881('0x84')];var _0x5f26da=[];_[_0x9881('0xe')](_0x19937d,function(_0x487668){_0x5f26da['push']({'id':_0x487668[_0x9881('0xd')],'name':_0x487668[_0x9881('0xd')],'utcOffset':_0x487668['utcOffset']});});return _0x1c8218[_0x9881('0x5')](0xc8)['json']({'tz':_0x5f26da});};exports[_0x9881('0x85')]=function(_0x21a524,_0x2d598b){var _0x5e8c3a=shared[_0x9881('0x84')];var _0x49ea3d={};if(!_[_0x9881('0x5a')](_0x5e8c3a[_0x21a524[_0x9881('0x3e')]['id']]))_0x49ea3d=_0x5e8c3a[_0x21a524[_0x9881('0x3e')]['id']];return _0x2d598b[_0x9881('0x5')](0xc8)[_0x9881('0x6')](_0x49ea3d);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 87636e1..ba1a0af 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 _0x687b=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0xce51e,_0x5d388f){_0xce51e=_0xce51e-0x0;var _0x442be7=_0x687b[_0xce51e];return _0x442be7;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]},{'name':'phone','fields':[_0xb687('0xd')]},{'name':_0xb687('0xe'),'fields':[_0xb687('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x536b15,_0x49bd40){_0x536b15=_0x536b15-0x0;var _0x1fd33a=_0xc6ac[_0x536b15];return _0x1fd33a;};'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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index a323682..9eb9897 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 _0xaf5a=['CountReScheduled','sequelize','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','describe','UserId','GetContactRecallMe','GetCmHopperPreview','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','name','CmList','List','CmHopperHandlePreviewRecallNotifications','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopper','findAll','options','raw','include','map','model','attributes','info','stringify','CmHopper','find','where','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','transaction','order','LOCK','UPDATE','Contact','keys','User','voicePause','length','push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','MoveContactManagedDialer'];(function(_0x4d911b,_0x5781b6){var _0x472305=function(_0x5d906e){while(--_0x5d906e){_0x4d911b['push'](_0x4d911b['shift']());}};_0x472305(++_0x5781b6);}(_0xaf5a,0x71));var _0xaaf5=function(_0x1106f4,_0x36cfdb){_0x1106f4=_0x1106f4-0x0;var _0x383deb=_0xaf5a[_0x1106f4];return _0x383deb;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var moment=require(_0xaaf5('0x1'));var BPromise=require('bluebird');var db=require(_0xaaf5('0x2'))['db'];var logger=require(_0xaaf5('0x3'))(_0xaaf5('0x4'));var jayson=require(_0xaaf5('0x5'));var client=jayson['client'][_0xaaf5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x518eb7,_0x3f9991,_0x5660a6){return new BPromise(function(_0x19d6f7,_0x37d9e3){return client['request'](_0x518eb7,_0x5660a6)[_0xaaf5('0x7')](function(_0x46123f){logger['info'](_0xaaf5('0x8'),_0x3f9991,_0xaaf5('0x9'));logger[_0xaaf5('0xa')](_0xaaf5('0xb'),_0x3f9991,_0xaaf5('0x9'),JSON['stringify'](_0x46123f));if(_0x46123f[_0xaaf5('0xc')]){if(_0x46123f[_0xaaf5('0xc')]['code']===0x1f4){logger[_0xaaf5('0xc')](_0xaaf5('0x8'),_0x3f9991,_0x46123f['error'][_0xaaf5('0xd')]);return _0x37d9e3(_0x46123f[_0xaaf5('0xc')][_0xaaf5('0xd')]);}logger[_0xaaf5('0xc')](_0xaaf5('0x8'),_0x3f9991,_0x46123f[_0xaaf5('0xc')][_0xaaf5('0xd')]);return _0x19d6f7(_0x46123f[_0xaaf5('0xc')]['message']);}else{logger['info'](_0xaaf5('0x8'),_0x3f9991,_0xaaf5('0x9'));_0x19d6f7(_0x46123f[_0xaaf5('0xe')][_0xaaf5('0xd')]);}})[_0xaaf5('0xf')](function(_0x15a658){logger[_0xaaf5('0xc')](_0xaaf5('0x8'),_0x3f9991,_0x15a658);_0x37d9e3(_0x15a658);});});}exports[_0xaaf5('0x10')]=function(_0x2abe2c){var _0x225b89=this;return new Promise(function(_0x169372,_0x35d8df){return db['CmHopper'][_0xaaf5('0x11')]({'raw':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c[_0xaaf5('0x12')][_0xaaf5('0x13')]===undefined?!![]:![]:!![],'where':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c['options']['where']||null:null,'attributes':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c[_0xaaf5('0x12')]['attributes']||null:null,'limit':_0x2abe2c[_0xaaf5('0x12')]?_0x2abe2c['options']['limit']||null:null,'include':_0x2abe2c['options']?_0x2abe2c['options'][_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x2abe2c[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x1aa4b0){return{'model':db[_0x1aa4b0[_0xaaf5('0x16')]],'as':_0x1aa4b0['as'],'attributes':_0x1aa4b0[_0xaaf5('0x17')],'include':_0x1aa4b0[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x1aa4b0[_0xaaf5('0x14')],function(_0x1eef63){return{'model':db[_0x1eef63[_0xaaf5('0x16')]],'as':_0x1eef63['as'],'attributes':_0x1eef63[_0xaaf5('0x17')],'include':_0x1eef63['include']?_[_0xaaf5('0x15')](_0x1eef63[_0xaaf5('0x14')],function(_0x5e95bd){return{'model':db[_0x5e95bd[_0xaaf5('0x16')]],'as':_0x5e95bd['as'],'attributes':_0x5e95bd[_0xaaf5('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20b7b5){logger[_0xaaf5('0x18')](_0xaaf5('0x10'),_0x2abe2c);logger['debug'](_0xaaf5('0x10'),_0x2abe2c,JSON[_0xaaf5('0x19')](_0x20b7b5));_0x169372(_0x20b7b5);})[_0xaaf5('0xf')](function(_0x17bc82){logger[_0xaaf5('0xc')](_0xaaf5('0x10'),_0x17bc82[_0xaaf5('0xd')],_0x2abe2c);_0x35d8df(_0x225b89[_0xaaf5('0xc')](0x1f4,_0x17bc82['message']));});});};exports['ShowCmHopper']=function(_0x2d573b){var _0x2155e3=this;return new Promise(function(_0x1f2979,_0x11af8f){return db[_0xaaf5('0x1a')][_0xaaf5('0x1b')]({'raw':_0x2d573b[_0xaaf5('0x12')]?_0x2d573b['options'][_0xaaf5('0x13')]===undefined?!![]:![]:!![],'where':_0x2d573b[_0xaaf5('0x12')]?_0x2d573b['options'][_0xaaf5('0x1c')]||null:null,'attributes':_0x2d573b['options']?_0x2d573b['options'][_0xaaf5('0x17')]||null:null,'include':_0x2d573b[_0xaaf5('0x12')]?_0x2d573b[_0xaaf5('0x12')][_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x2d573b[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x466e04){return{'model':db[_0x466e04['model']],'as':_0x466e04['as'],'attributes':_0x466e04[_0xaaf5('0x17')],'include':_0x466e04['include']?_[_0xaaf5('0x15')](_0x466e04[_0xaaf5('0x14')],function(_0x3c9b82){return{'model':db[_0x3c9b82[_0xaaf5('0x16')]],'as':_0x3c9b82['as'],'attributes':_0x3c9b82[_0xaaf5('0x17')],'include':_0x3c9b82[_0xaaf5('0x14')]?_['map'](_0x3c9b82[_0xaaf5('0x14')],function(_0x3a3375){return{'model':db[_0x3a3375['model']],'as':_0x3a3375['as'],'attributes':_0x3a3375['attributes']};}):[]};}):[]};}):[]:[]})[_0xaaf5('0x7')](function(_0x2a189d){logger[_0xaaf5('0x18')](_0xaaf5('0x1d'),_0x2d573b);logger[_0xaaf5('0xa')](_0xaaf5('0x1d'),_0x2d573b,JSON[_0xaaf5('0x19')](_0x2a189d));_0x1f2979(_0x2a189d);})[_0xaaf5('0xf')](function(_0x4d75fc){logger[_0xaaf5('0xc')](_0xaaf5('0x1d'),_0x4d75fc[_0xaaf5('0xd')],_0x2d573b);_0x11af8f(_0x2155e3[_0xaaf5('0xc')](0x1f4,_0x4d75fc[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x1e')]=function(_0x476116){var _0x7b6a4=this;return new Promise(function(_0x41ab32,_0x30be57){return db[_0xaaf5('0x1a')][_0xaaf5('0x1f')](_0x476116[_0xaaf5('0x20')],{'raw':_0x476116[_0xaaf5('0x12')]?_0x476116[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![]})[_0xaaf5('0x7')](function(_0x39eee4){logger[_0xaaf5('0x18')](_0xaaf5('0x1e'),_0x476116);logger[_0xaaf5('0xa')]('CreateCmHopper',_0x476116,JSON[_0xaaf5('0x19')](_0x39eee4));_0x41ab32(_0x39eee4);})[_0xaaf5('0xf')](function(_0x57a89b){logger['error'](_0xaaf5('0x1e'),_0x57a89b[_0xaaf5('0xd')],_0x476116);_0x30be57(_0x7b6a4[_0xaaf5('0xc')](0x1f4,_0x57a89b[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x21')]=function(_0x373648){var _0x1ed174=this;return new Promise(function(_0x14213a,_0x393512){return db[_0xaaf5('0x1a')]['update'](_0x373648[_0xaaf5('0x20')],{'raw':_0x373648[_0xaaf5('0x12')]?_0x373648[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x373648['options']?_0x373648[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x373648[_0xaaf5('0x12')]?_0x373648['options'][_0xaaf5('0x17')]||null:null,'limit':_0x373648[_0xaaf5('0x12')]?_0x373648[_0xaaf5('0x12')][_0xaaf5('0x22')]||null:null})['then'](function(_0x40c5f8){logger[_0xaaf5('0x18')]('UpdateCmHopper',_0x373648);logger[_0xaaf5('0x18')](_0xaaf5('0x23'),JSON[_0xaaf5('0x19')](_0x373648[_0xaaf5('0x12')][_0xaaf5('0x1c')]),_0x373648[_0xaaf5('0x20')][_0xaaf5('0x24')]);logger[_0xaaf5('0xa')](_0xaaf5('0x21'),_0x373648,JSON[_0xaaf5('0x19')](_0x40c5f8));_0x14213a(_0x40c5f8);})[_0xaaf5('0xf')](function(_0x218721){logger['error'](_0xaaf5('0x21'),_0x218721[_0xaaf5('0xd')],_0x373648);_0x393512(_0x1ed174['error'](0x1f4,_0x218721[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x25')]=function(_0x26cccc){var _0xe9c6d2=this;return new Promise(function(_0x25c96a,_0x5b0b68){return db[_0xaaf5('0x1a')]['destroy']({'where':_0x26cccc[_0xaaf5('0x12')]?_0x26cccc[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null})[_0xaaf5('0x7')](function(_0x1c9830){logger[_0xaaf5('0x18')]('DestroyCmHopper',_0x26cccc);logger[_0xaaf5('0xa')](_0xaaf5('0x25'),_0x26cccc,JSON[_0xaaf5('0x19')](_0x1c9830));_0x25c96a(_0x1c9830);})[_0xaaf5('0xf')](function(_0x1b3e89){logger[_0xaaf5('0xc')](_0xaaf5('0x25'),_0x1b3e89[_0xaaf5('0xd')],_0x26cccc);_0x5b0b68(_0xe9c6d2['error'](0x1f4,_0x1b3e89[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x26')]=function(_0x468cef){var _0x44ace4=this;return new Promise(function(_0x918607,_0x1c6131){return db[_0xaaf5('0x27')]['describe']()[_0xaaf5('0x7')](function(_0x13e2b7){return db['sequelize'][_0xaaf5('0x28')](function(_0x5e1ae6){return db[_0xaaf5('0x1a')][_0xaaf5('0x11')]({'where':_0x468cef['options']?_0x468cef[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x468cef['options']?_0x468cef[_0xaaf5('0x12')]['attributes']||null:null,'limit':_0x468cef['options']?_0x468cef['options'][_0xaaf5('0x22')]||null:null,'order':_0x468cef[_0xaaf5('0x12')]?_0x468cef[_0xaaf5('0x12')][_0xaaf5('0x29')]||null:null,'transaction':_0x5e1ae6,'lock':_0x5e1ae6[_0xaaf5('0x2a')][_0xaaf5('0x2b')],'include':[{'model':db[_0xaaf5('0x27')],'as':_0xaaf5('0x2c'),'attributes':_[_0xaaf5('0x2d')](_0x13e2b7)},{'model':db[_0xaaf5('0x2e')],'as':'Agent','attributes':['id','name',_0xaaf5('0x2f')]}]})[_0xaaf5('0x7')](function(_0x226102){var _0x31e04e=[];var _0x494876=[];for(var _0x235b7f=0x0;_0x235b7f<_0x226102[_0xaaf5('0x30')];_0x235b7f+=0x1){var _0x1d6a0a=_0x226102[_0x235b7f]['UserId'];if(_0x1d6a0a===null){_0x31e04e[_0xaaf5('0x31')](_0x226102[_0x235b7f][_0xaaf5('0x32')](_0x468cef[_0xaaf5('0x20')],{'transaction':_0x5e1ae6}));}else if(!_0x494876['includes'](_0x1d6a0a)){_0x494876[_0xaaf5('0x31')](_0x1d6a0a);_0x31e04e[_0xaaf5('0x31')](_0x226102[_0x235b7f]['update'](_0x468cef['body'],{'transaction':_0x5e1ae6}));}}return BPromise[_0xaaf5('0x33')](_0x31e04e);});})['then'](function(_0x45fc61){logger[_0xaaf5('0x18')](_0xaaf5('0x26'),_0x468cef);if(_0x45fc61['length']>0x0){logger[_0xaaf5('0x18')](_0xaaf5('0x34'),_0x45fc61[0x0][_0xaaf5('0x35')]['id'],_0x45fc61[0x0][_0xaaf5('0x35')][_0xaaf5('0x36')],_0x45fc61[0x0][_0xaaf5('0x35')]['active']);}logger['debug'](_0xaaf5('0x26'),_0x468cef,JSON[_0xaaf5('0x19')](_0x45fc61));_0x918607(_0x45fc61);})[_0xaaf5('0xf')](function(_0x51c37c){logger['error'](_0xaaf5('0x26'),_0x51c37c['message'],_0x468cef);_0x1c6131(_0x44ace4['error'](0x1f4,_0x51c37c[_0xaaf5('0xd')]));});});});};exports['MoveContactManagedDialer']=function(_0x3061a9){var _0x3d0da4=this;return new Promise(function(_0x7b07f5,_0x5dfaf9){return db['sequelize']['transaction'](function(_0x21c0fc){return db[_0xaaf5('0x37')][_0xaaf5('0x1f')](_0x3061a9['body'],{'raw':_0x3061a9[_0xaaf5('0x12')]?_0x3061a9[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![],'transaction':_0x21c0fc})[_0xaaf5('0x7')](function(){logger[_0xaaf5('0x18')](_0xaaf5('0x38'),JSON[_0xaaf5('0x19')](_0x3061a9[_0xaaf5('0x12')]['where']),_0x3061a9['options'][_0xaaf5('0x1c')][_0xaaf5('0x24')]);return db[_0xaaf5('0x1a')][_0xaaf5('0x39')]({'where':_0x3061a9['options']?_0x3061a9[_0xaaf5('0x12')]['where']||null:null,'transaction':_0x21c0fc});});})[_0xaaf5('0x7')](function(_0x465961){logger[_0xaaf5('0x18')](_0xaaf5('0x3a'),_0x3061a9);logger[_0xaaf5('0xa')](_0xaaf5('0x3a'),_0x3061a9,JSON[_0xaaf5('0x19')](_0x465961));_0x7b07f5(_0x465961);})['catch'](function(_0x1e8938){logger[_0xaaf5('0xc')](_0xaaf5('0x3a'),_0x1e8938[_0xaaf5('0xd')],_0x3061a9);_0x5dfaf9(_0x3d0da4[_0xaaf5('0xc')](0x1f4,_0x1e8938[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x3b')]=function(_0x58570d){var _0x45f723=this;return new Promise(function(_0xbd5f45,_0x5d0df4){return db['CmHopper'][_0xaaf5('0x11')]({'raw':_0x58570d[_0xaaf5('0x12')]?_0x58570d['options'][_0xaaf5('0x13')]===undefined?!![]:![]:!![],'where':_0x58570d['options']?_0x58570d['options'][_0xaaf5('0x1c')]||null:null,'attributes':[[db[_0xaaf5('0x3c')]['fn']('COUNT',db[_0xaaf5('0x3c')]['fn']('IF',db[_0xaaf5('0x3c')][_0xaaf5('0x3d')](_0xaaf5('0x3e')+util[_0xaaf5('0x3f')](_0xaaf5('0x40'),moment()[_0xaaf5('0x3f')](_0xaaf5('0x41')))+'\x20,\x201,\x20null'))),_0xaaf5('0x42')]]})[_0xaaf5('0x7')](function(_0x59dcb1){logger['info'](_0xaaf5('0x3b'),_0x58570d);logger[_0xaaf5('0xa')]('CountReScheduled',_0x58570d,JSON['stringify'](_0x59dcb1));_0xbd5f45(_0x59dcb1);})[_0xaaf5('0xf')](function(_0x22d076){logger[_0xaaf5('0xc')]('CountReScheduled',_0x22d076[_0xaaf5('0xd')],_0x58570d);_0x5d0df4(_0x45f723['error'](0x1f4,_0x22d076[_0xaaf5('0xd')]));});});};exports['GetContactRecallMe']=function(_0x44e425){var _0x47a134=this;return new Promise(function(_0x58267f,_0x15739c){return db[_0xaaf5('0x27')][_0xaaf5('0x43')]()['then'](function(_0x2b5035){return db[_0xaaf5('0x3c')]['transaction'](function(_0x57aaa2){return db['CmHopper'][_0xaaf5('0x11')]({'where':_0x44e425['options']?_0x44e425[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x44e425[_0xaaf5('0x12')]?_0x44e425['options'][_0xaaf5('0x17')]||null:null,'limit':0x1,'order':_0x44e425[_0xaaf5('0x12')]?_0x44e425[_0xaaf5('0x12')]['order']||null:null,'group':db['CmHopper'][_0xaaf5('0x44')],'transaction':_0x57aaa2,'lock':_0x57aaa2['LOCK'][_0xaaf5('0x2b')],'include':_0x44e425[_0xaaf5('0x12')]?_0x44e425[_0xaaf5('0x12')]['include']?_['map'](_0x44e425[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x3e7446){return{'model':db[_0x3e7446['model']],'as':_0x3e7446['as'],'attributes':_0x3e7446[_0xaaf5('0x17')],'include':_0x3e7446[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x3e7446[_0xaaf5('0x14')],function(_0x23b70d){return{'model':db[_0x23b70d['model']],'as':_0x23b70d['as'],'attributes':_0x23b70d[_0xaaf5('0x17')],'include':_0x23b70d[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x23b70d['include'],function(_0x5534ca){return{'model':db[_0x5534ca[_0xaaf5('0x16')]],'as':_0x5534ca['as'],'attributes':_0x5534ca[_0xaaf5('0x17')]};}):[]};}):[]};}):[]:[]})[_0xaaf5('0x7')](function(_0x47186b){var _0x569359=[];for(var _0x9da04a=0x0;_0x9da04a<_0x47186b['length'];_0x9da04a+=0x1){_0x569359['push'](_0x47186b[_0x9da04a][_0xaaf5('0x32')](_0x44e425[_0xaaf5('0x20')],{'transaction':_0x57aaa2}));}return BPromise[_0xaaf5('0x33')](_0x569359);});})['then'](function(_0x587612){logger['info'](_0xaaf5('0x45'),_0x44e425);logger[_0xaaf5('0xa')](_0xaaf5('0x45'),_0x44e425,JSON[_0xaaf5('0x19')](_0x587612));_0x58267f(_0x587612);})[_0xaaf5('0xf')](function(_0x40f9dd){logger[_0xaaf5('0xc')]('GetContactRecallMe',_0x40f9dd[_0xaaf5('0xd')],_0x44e425);_0x15739c(_0x47a134[_0xaaf5('0xc')](0x1f4,_0x40f9dd[_0xaaf5('0xd')]));});});});};exports[_0xaaf5('0x46')]=function(_0x40e7d5){var _0xddc7fd=this;return new Promise(function(_0x38aff0,_0x59fa2f){db[_0xaaf5('0x27')][_0xaaf5('0x43')]()[_0xaaf5('0x7')](function(_0x6f697f){return db['CmHopper'][_0xaaf5('0x11')]({'raw':_0x40e7d5[_0xaaf5('0x12')]?_0x40e7d5[_0xaaf5('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x40e7d5['options']?_0x40e7d5[_0xaaf5('0x12')][_0xaaf5('0x1c')]||null:null,'attributes':_0x40e7d5['options']?_0x40e7d5[_0xaaf5('0x12')][_0xaaf5('0x17')]||null:null,'limit':_0x40e7d5[_0xaaf5('0x12')]?_0x40e7d5[_0xaaf5('0x12')]['limit']||null:null,'include':_0x40e7d5[_0xaaf5('0x12')]?_0x40e7d5[_0xaaf5('0x12')]['include']?_[_0xaaf5('0x15')](_0x40e7d5[_0xaaf5('0x12')][_0xaaf5('0x14')],function(_0x6b254f){return{'model':db[_0x6b254f[_0xaaf5('0x16')]],'as':_0x6b254f['as'],'attributes':_0x6b254f['as']===_0xaaf5('0x2c')?_[_0xaaf5('0x2d')](_0x6f697f):_0x6b254f['attributes'],'include':_0x6b254f['include']?_[_0xaaf5('0x15')](_0x6b254f[_0xaaf5('0x14')],function(_0x2edf1a){return{'model':db[_0x2edf1a['model']],'as':_0x2edf1a['as'],'attributes':_0x2edf1a[_0xaaf5('0x17')],'include':_0x2edf1a[_0xaaf5('0x14')]?_[_0xaaf5('0x15')](_0x2edf1a[_0xaaf5('0x14')],function(_0x3cfdb7){return{'model':db[_0x3cfdb7[_0xaaf5('0x16')]],'as':_0x3cfdb7['as'],'attributes':_0x3cfdb7['attributes']};}):[]};}):[]};}):[]:[]})[_0xaaf5('0x7')](function(_0x4287f3){logger[_0xaaf5('0x18')](_0xaaf5('0x10'),_0x40e7d5);logger[_0xaaf5('0xa')](_0xaaf5('0x10'),_0x40e7d5,JSON[_0xaaf5('0x19')](_0x4287f3));_0x38aff0(_0x4287f3);})[_0xaaf5('0xf')](function(_0x3882db){logger[_0xaaf5('0xc')]('GetCmHopper',_0x3882db['message'],_0x40e7d5);_0x59fa2f(_0xddc7fd[_0xaaf5('0xc')](0x1f4,_0x3882db[_0xaaf5('0xd')]));});});});};exports['GetContactByPhone']=function(_0x36d1c1){var _0x43f4b8=this;return new Promise(function(_0xc87901,_0x2ec44b){return db[_0xaaf5('0x27')]['findOne']({'raw':!![],'where':{'phone':_0x36d1c1[_0xaaf5('0x12')]['where'][_0xaaf5('0x47')]},'attributes':['id',_0xaaf5('0x48')],'order':[['id',_0xaaf5('0x49')]]})[_0xaaf5('0x7')](function(_0x359856){logger[_0xaaf5('0x18')](_0xaaf5('0x4a'),_0x36d1c1);logger[_0xaaf5('0xa')](_0xaaf5('0x4a'),_0x36d1c1,JSON[_0xaaf5('0x19')](_0x359856));_0xc87901(_0x359856);})[_0xaaf5('0xf')](function(_0x3c208e){logger[_0xaaf5('0xc')](_0xaaf5('0x4a'),_0x3c208e[_0xaaf5('0xd')],_0x36d1c1);_0x2ec44b(_0x43f4b8['error'](0x1f4,_0x3c208e[_0xaaf5('0xd')]));});});};exports[_0xaaf5('0x4b')]=function(_0x415311){var _0x598ee2=this;return new Promise(function(_0x78aee9,_0x38287e){return db['sequelize'][_0xaaf5('0x28')](function(_0x3e371b){return db[_0xaaf5('0x1a')][_0xaaf5('0x32')](_0x415311[_0xaaf5('0x20')],{'where':{},'transaction':_0x3e371b})[_0xaaf5('0x7')](function(_0xa7c057){logger[_0xaaf5('0x18')](_0xaaf5('0x4b'),_0x415311);logger[_0xaaf5('0xa')]('ResetActiveCalls',_0x415311,JSON[_0xaaf5('0x19')](_0xa7c057));_0x78aee9(_0xa7c057);})[_0xaaf5('0xf')](function(_0x480e1f){logger[_0xaaf5('0xc')](_0xaaf5('0x4b'),_0x480e1f[_0xaaf5('0xd')],_0x415311);_0x38287e(_0x598ee2[_0xaaf5('0xc')](0x1f4,_0x480e1f[_0xaaf5('0xd')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3de78a){var _0x164199=this;var _0x3266e7=_0x3de78a[_0xaaf5('0x20')][_0xaaf5('0x1c')][_0xaaf5('0x4c')];var _0x50b33f=_0x3de78a[_0xaaf5('0x20')][_0xaaf5('0x1c')][_0xaaf5('0x4d')];var _0x5db161=_0x3de78a['body'][_0xaaf5('0x1c')]['availableAgentsIds'];return new Promise(function(_0x201a82,_0x462037){return db[_0xaaf5('0x1a')][_0xaaf5('0x11')]({'where':{'voiceQueueId':{'$in':_0x3266e7},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xaaf5('0x3c')][_0xaaf5('0x3d')](_0xaaf5('0x4e')+_0x50b33f+_0xaaf5('0x4f')),'$gt':db[_0xaaf5('0x3c')]['literal'](_0xaaf5('0x50'))}},'UserId':{'$in':_0x5db161}},'include':[{'model':db[_0xaaf5('0x27')],'as':_0xaaf5('0x2c')},{'model':db['User'],'as':_0xaaf5('0x51'),'attributes':['id',_0xaaf5('0x52'),_0xaaf5('0x2f')]},{'model':db[_0xaaf5('0x53')],'as':_0xaaf5('0x54')}]})[_0xaaf5('0x7')](function(_0x123ab3){if(_0x123ab3[_0xaaf5('0x30')]>0x0){return db[_0xaaf5('0x3c')]['transaction'](function(_0x391b15){return db[_0xaaf5('0x1a')][_0xaaf5('0x32')]({'recallmeNotifiedDate':db[_0xaaf5('0x3c')]['literal'](_0xaaf5('0x50'))},{'where':{'id':{'$in':_['map'](_0x123ab3,'id')}},'transaction':_0x391b15})[_0xaaf5('0x7')](function(){_0x201a82(_0x123ab3);})[_0xaaf5('0xf')](function(_0x3d6c7e){logger[_0xaaf5('0xc')](_0xaaf5('0x55'),_0x3d6c7e[_0xaaf5('0xd')],_0x3de78a);_0x462037(_0x164199[_0xaaf5('0xc')](0x1f4,_0x3d6c7e[_0xaaf5('0xd')]));});})[_0xaaf5('0xf')](function(_0x429f4d){logger[_0xaaf5('0xc')](_0xaaf5('0x55'),_0x429f4d[_0xaaf5('0xd')],_0x3de78a);_0x462037(_0x164199[_0xaaf5('0xc')](0x1f4,_0x429f4d[_0xaaf5('0xd')]));});}else{_0x201a82(_0x123ab3);}});});}; \ No newline at end of file +var _0xb39f=['request','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowCmHopper','CreateCmHopper','CmHopper','create','body','update','active','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','length','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','order','UserId','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','jayson/promise','http'];(function(_0x5aa133,_0x58ae47){var _0x51532c=function(_0x4a0141){while(--_0x4a0141){_0x5aa133['push'](_0x5aa133['shift']());}};_0x51532c(++_0x58ae47);}(_0xb39f,0x1e6));var _0xfb39=function(_0x5dbf3d,_0x5cf985){_0x5dbf3d=_0x5dbf3d-0x0;var _0x2a3d57=_0xb39f[_0x5dbf3d];return _0x2a3d57;};'use strict';var _=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var moment=require(_0xfb39('0x2'));var BPromise=require(_0xfb39('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');var jayson=require(_0xfb39('0x4'));var client=jayson['client'][_0xfb39('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x241b89,_0x598366,_0x1619f6){return new BPromise(function(_0x455dbe,_0x45bb1c){return client[_0xfb39('0x6')](_0x241b89,_0x1619f6)['then'](function(_0x4daba2){logger[_0xfb39('0x7')](_0xfb39('0x8'),_0x598366,'request\x20sent');logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x598366,_0xfb39('0x9'),JSON[_0xfb39('0xa')](_0x4daba2));if(_0x4daba2[_0xfb39('0xb')]){if(_0x4daba2[_0xfb39('0xb')][_0xfb39('0xc')]===0x1f4){logger['error'](_0xfb39('0x8'),_0x598366,_0x4daba2[_0xfb39('0xb')][_0xfb39('0xd')]);return _0x45bb1c(_0x4daba2[_0xfb39('0xb')][_0xfb39('0xd')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x598366,_0x4daba2[_0xfb39('0xb')][_0xfb39('0xd')]);return _0x455dbe(_0x4daba2[_0xfb39('0xb')]['message']);}else{logger[_0xfb39('0x7')](_0xfb39('0x8'),_0x598366,'request\x20sent');_0x455dbe(_0x4daba2['result'][_0xfb39('0xd')]);}})[_0xfb39('0xe')](function(_0x31b1dc){logger['error']('CmHopper,\x20%s,\x20%s',_0x598366,_0x31b1dc);_0x45bb1c(_0x31b1dc);});});}exports[_0xfb39('0xf')]=function(_0x2965fb){var _0x1b24b7=this;return new Promise(function(_0x1d1ad3,_0x31b652){return db['CmHopper'][_0xfb39('0x10')]({'raw':_0x2965fb[_0xfb39('0x11')]?_0x2965fb[_0xfb39('0x11')][_0xfb39('0x12')]===undefined?!![]:![]:!![],'where':_0x2965fb['options']?_0x2965fb['options'][_0xfb39('0x13')]||null:null,'attributes':_0x2965fb[_0xfb39('0x11')]?_0x2965fb[_0xfb39('0x11')][_0xfb39('0x14')]||null:null,'limit':_0x2965fb[_0xfb39('0x11')]?_0x2965fb['options'][_0xfb39('0x15')]||null:null,'include':_0x2965fb[_0xfb39('0x11')]?_0x2965fb[_0xfb39('0x11')][_0xfb39('0x16')]?_[_0xfb39('0x17')](_0x2965fb['options']['include'],function(_0x2932d0){return{'model':db[_0x2932d0[_0xfb39('0x18')]],'as':_0x2932d0['as'],'attributes':_0x2932d0['attributes'],'include':_0x2932d0[_0xfb39('0x16')]?_[_0xfb39('0x17')](_0x2932d0[_0xfb39('0x16')],function(_0x4944d4){return{'model':db[_0x4944d4['model']],'as':_0x4944d4['as'],'attributes':_0x4944d4[_0xfb39('0x14')],'include':_0x4944d4['include']?_[_0xfb39('0x17')](_0x4944d4[_0xfb39('0x16')],function(_0x30dbc5){return{'model':db[_0x30dbc5[_0xfb39('0x18')]],'as':_0x30dbc5['as'],'attributes':_0x30dbc5[_0xfb39('0x14')]};}):[]};}):[]};}):[]:[]})[_0xfb39('0x19')](function(_0x38e145){logger[_0xfb39('0x7')](_0xfb39('0xf'),_0x2965fb);logger[_0xfb39('0x1a')](_0xfb39('0xf'),_0x2965fb,JSON[_0xfb39('0xa')](_0x38e145));_0x1d1ad3(_0x38e145);})[_0xfb39('0xe')](function(_0x338b5a){logger['error']('GetCmHopper',_0x338b5a[_0xfb39('0xd')],_0x2965fb);_0x31b652(_0x1b24b7[_0xfb39('0xb')](0x1f4,_0x338b5a[_0xfb39('0xd')]));});});};exports[_0xfb39('0x1b')]=function(_0x2605ed){var _0x497b25=this;return new Promise(function(_0x546872,_0x4665e9){return db['CmHopper']['find']({'raw':_0x2605ed[_0xfb39('0x11')]?_0x2605ed[_0xfb39('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x2605ed['options']?_0x2605ed[_0xfb39('0x11')][_0xfb39('0x13')]||null:null,'attributes':_0x2605ed[_0xfb39('0x11')]?_0x2605ed[_0xfb39('0x11')][_0xfb39('0x14')]||null:null,'include':_0x2605ed['options']?_0x2605ed[_0xfb39('0x11')][_0xfb39('0x16')]?_['map'](_0x2605ed[_0xfb39('0x11')]['include'],function(_0xd711a8){return{'model':db[_0xd711a8[_0xfb39('0x18')]],'as':_0xd711a8['as'],'attributes':_0xd711a8['attributes'],'include':_0xd711a8[_0xfb39('0x16')]?_['map'](_0xd711a8['include'],function(_0x218863){return{'model':db[_0x218863[_0xfb39('0x18')]],'as':_0x218863['as'],'attributes':_0x218863[_0xfb39('0x14')],'include':_0x218863[_0xfb39('0x16')]?_[_0xfb39('0x17')](_0x218863[_0xfb39('0x16')],function(_0x77e2b5){return{'model':db[_0x77e2b5[_0xfb39('0x18')]],'as':_0x77e2b5['as'],'attributes':_0x77e2b5[_0xfb39('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x213ba8){logger[_0xfb39('0x7')](_0xfb39('0x1b'),_0x2605ed);logger[_0xfb39('0x1a')](_0xfb39('0x1b'),_0x2605ed,JSON[_0xfb39('0xa')](_0x213ba8));_0x546872(_0x213ba8);})[_0xfb39('0xe')](function(_0x3e6201){logger['error'](_0xfb39('0x1b'),_0x3e6201[_0xfb39('0xd')],_0x2605ed);_0x4665e9(_0x497b25['error'](0x1f4,_0x3e6201[_0xfb39('0xd')]));});});};exports[_0xfb39('0x1c')]=function(_0x43caab){var _0x2eb592=this;return new Promise(function(_0x2297df,_0x1347c0){return db[_0xfb39('0x1d')][_0xfb39('0x1e')](_0x43caab[_0xfb39('0x1f')],{'raw':_0x43caab[_0xfb39('0x11')]?_0x43caab[_0xfb39('0x11')]['raw']===undefined?!![]:![]:!![]})[_0xfb39('0x19')](function(_0x21845e){logger['info'](_0xfb39('0x1c'),_0x43caab);logger[_0xfb39('0x1a')](_0xfb39('0x1c'),_0x43caab,JSON['stringify'](_0x21845e));_0x2297df(_0x21845e);})[_0xfb39('0xe')](function(_0xe9d5d4){logger['error'](_0xfb39('0x1c'),_0xe9d5d4['message'],_0x43caab);_0x1347c0(_0x2eb592[_0xfb39('0xb')](0x1f4,_0xe9d5d4['message']));});});};exports['UpdateCmHopper']=function(_0x545180){var _0x3b754e=this;return new Promise(function(_0x30e9a3,_0x4f5eb6){return db[_0xfb39('0x1d')][_0xfb39('0x20')](_0x545180[_0xfb39('0x1f')],{'raw':_0x545180[_0xfb39('0x11')]?_0x545180['options'][_0xfb39('0x12')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x545180[_0xfb39('0x11')]?_0x545180[_0xfb39('0x11')]['where']||null:null,'attributes':_0x545180['options']?_0x545180[_0xfb39('0x11')]['attributes']||null:null,'limit':_0x545180[_0xfb39('0x11')]?_0x545180[_0xfb39('0x11')][_0xfb39('0x15')]||null:null})['then'](function(_0x301f5f){logger[_0xfb39('0x7')]('UpdateCmHopper',_0x545180);logger[_0xfb39('0x7')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x545180[_0xfb39('0x11')][_0xfb39('0x13')]),_0x545180[_0xfb39('0x1f')][_0xfb39('0x21')]);logger['debug'](_0xfb39('0x22'),_0x545180,JSON['stringify'](_0x301f5f));_0x30e9a3(_0x301f5f);})[_0xfb39('0xe')](function(_0x4c67e5){logger[_0xfb39('0xb')](_0xfb39('0x22'),_0x4c67e5[_0xfb39('0xd')],_0x545180);_0x4f5eb6(_0x3b754e[_0xfb39('0xb')](0x1f4,_0x4c67e5[_0xfb39('0xd')]));});});};exports['DestroyCmHopper']=function(_0x1ecb78){var _0x51268e=this;return new Promise(function(_0x43ccf4,_0x544293){return db[_0xfb39('0x1d')][_0xfb39('0x23')]({'where':_0x1ecb78['options']?_0x1ecb78[_0xfb39('0x11')][_0xfb39('0x13')]||null:null})[_0xfb39('0x19')](function(_0x43c619){logger[_0xfb39('0x7')](_0xfb39('0x24'),_0x1ecb78);logger['debug']('DestroyCmHopper',_0x1ecb78,JSON[_0xfb39('0xa')](_0x43c619));_0x43ccf4(_0x43c619);})[_0xfb39('0xe')](function(_0x6a1010){logger[_0xfb39('0xb')](_0xfb39('0x24'),_0x6a1010['message'],_0x1ecb78);_0x544293(_0x51268e[_0xfb39('0xb')](0x1f4,_0x6a1010[_0xfb39('0xd')]));});});};exports[_0xfb39('0x25')]=function(_0x11d1e8){var _0x1bf596=this;return new Promise(function(_0x7cdf0a,_0x575e9e){return db[_0xfb39('0x26')][_0xfb39('0x27')]()['then'](function(_0x3cd627){return db[_0xfb39('0x28')][_0xfb39('0x29')](function(_0x1b2cc7){return db[_0xfb39('0x1d')][_0xfb39('0x10')]({'where':_0x11d1e8[_0xfb39('0x11')]?_0x11d1e8[_0xfb39('0x11')][_0xfb39('0x13')]||null:null,'attributes':_0x11d1e8['options']?_0x11d1e8[_0xfb39('0x11')][_0xfb39('0x14')]||null:null,'limit':_0x11d1e8['options']?_0x11d1e8[_0xfb39('0x11')]['limit']||null:null,'order':_0x11d1e8['options']?_0x11d1e8[_0xfb39('0x11')]['order']||null:null,'transaction':_0x1b2cc7,'lock':_0x1b2cc7[_0xfb39('0x2a')][_0xfb39('0x2b')],'include':[{'model':db[_0xfb39('0x26')],'as':_0xfb39('0x2c'),'attributes':_[_0xfb39('0x2d')](_0x3cd627)},{'model':db[_0xfb39('0x2e')],'as':_0xfb39('0x2f'),'attributes':['id','name',_0xfb39('0x30')]}]})['then'](function(_0x1f3ed2){var _0x20bb30=[];var _0x1bfb1d=[];for(var _0x204280=0x0;_0x204280<_0x1f3ed2[_0xfb39('0x31')];_0x204280+=0x1){var _0x16f2d0=_0x1f3ed2[_0x204280]['UserId'];if(_0x16f2d0===null){_0x20bb30[_0xfb39('0x32')](_0x1f3ed2[_0x204280][_0xfb39('0x20')](_0x11d1e8[_0xfb39('0x1f')],{'transaction':_0x1b2cc7}));}else if(!_0x1bfb1d['includes'](_0x16f2d0)){_0x1bfb1d[_0xfb39('0x32')](_0x16f2d0);_0x20bb30[_0xfb39('0x32')](_0x1f3ed2[_0x204280][_0xfb39('0x20')](_0x11d1e8[_0xfb39('0x1f')],{'transaction':_0x1b2cc7}));}}return BPromise[_0xfb39('0x33')](_0x20bb30);});})['then'](function(_0x27be76){logger[_0xfb39('0x7')]('GetContactDialer',_0x11d1e8);if(_0x27be76['length']>0x0){logger[_0xfb39('0x7')](_0xfb39('0x34'),_0x27be76[0x0][_0xfb39('0x35')]['id'],_0x27be76[0x0]['dataValues'][_0xfb39('0x36')],_0x27be76[0x0][_0xfb39('0x35')][_0xfb39('0x21')]);}logger[_0xfb39('0x1a')](_0xfb39('0x25'),_0x11d1e8,JSON[_0xfb39('0xa')](_0x27be76));_0x7cdf0a(_0x27be76);})['catch'](function(_0x8737c8){logger[_0xfb39('0xb')](_0xfb39('0x25'),_0x8737c8[_0xfb39('0xd')],_0x11d1e8);_0x575e9e(_0x1bf596[_0xfb39('0xb')](0x1f4,_0x8737c8[_0xfb39('0xd')]));});});});};exports[_0xfb39('0x37')]=function(_0x5bf003){var _0x4f76cb=this;return new Promise(function(_0x4f42c7,_0xbd11d6){return db['sequelize']['transaction'](function(_0x3d4615){return db[_0xfb39('0x38')][_0xfb39('0x1e')](_0x5bf003[_0xfb39('0x1f')],{'raw':_0x5bf003[_0xfb39('0x11')]?_0x5bf003['options'][_0xfb39('0x12')]===undefined?!![]:![]:!![],'transaction':_0x3d4615})[_0xfb39('0x19')](function(){logger[_0xfb39('0x7')](_0xfb39('0x39'),JSON[_0xfb39('0xa')](_0x5bf003['options']['where']),_0x5bf003['options'][_0xfb39('0x13')][_0xfb39('0x21')]);return db['CmHopper'][_0xfb39('0x23')]({'where':_0x5bf003[_0xfb39('0x11')]?_0x5bf003[_0xfb39('0x11')]['where']||null:null,'transaction':_0x3d4615});});})[_0xfb39('0x19')](function(_0x22c134){logger[_0xfb39('0x7')](_0xfb39('0x37'),_0x5bf003);logger[_0xfb39('0x1a')](_0xfb39('0x37'),_0x5bf003,JSON['stringify'](_0x22c134));_0x4f42c7(_0x22c134);})[_0xfb39('0xe')](function(_0x16c4e4){logger[_0xfb39('0xb')](_0xfb39('0x37'),_0x16c4e4[_0xfb39('0xd')],_0x5bf003);_0xbd11d6(_0x4f76cb[_0xfb39('0xb')](0x1f4,_0x16c4e4[_0xfb39('0xd')]));});});};exports[_0xfb39('0x3a')]=function(_0x33feb3){var _0x2294ce=this;return new Promise(function(_0x49b93f,_0x45c93d){return db[_0xfb39('0x1d')]['findAll']({'raw':_0x33feb3[_0xfb39('0x11')]?_0x33feb3[_0xfb39('0x11')][_0xfb39('0x12')]===undefined?!![]:![]:!![],'where':_0x33feb3['options']?_0x33feb3['options'][_0xfb39('0x13')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xfb39('0x28')]['fn']('IF',db[_0xfb39('0x28')][_0xfb39('0x3b')](_0xfb39('0x3c')+util[_0xfb39('0x3d')](_0xfb39('0x3e'),moment()[_0xfb39('0x3d')](_0xfb39('0x3f')))+_0xfb39('0x40')))),'contactsRescheduled']]})[_0xfb39('0x19')](function(_0x4b9a63){logger[_0xfb39('0x7')](_0xfb39('0x3a'),_0x33feb3);logger[_0xfb39('0x1a')](_0xfb39('0x3a'),_0x33feb3,JSON[_0xfb39('0xa')](_0x4b9a63));_0x49b93f(_0x4b9a63);})[_0xfb39('0xe')](function(_0xe0f578){logger[_0xfb39('0xb')](_0xfb39('0x3a'),_0xe0f578['message'],_0x33feb3);_0x45c93d(_0x2294ce['error'](0x1f4,_0xe0f578['message']));});});};exports[_0xfb39('0x41')]=function(_0x4fa898){var _0x220646=this;return new Promise(function(_0x4ec156,_0x3e8771){return db['CmContact']['describe']()[_0xfb39('0x19')](function(_0x33c1ac){return db[_0xfb39('0x28')][_0xfb39('0x29')](function(_0x74ba98){return db[_0xfb39('0x1d')][_0xfb39('0x10')]({'where':_0x4fa898['options']?_0x4fa898[_0xfb39('0x11')][_0xfb39('0x13')]||null:null,'attributes':_0x4fa898[_0xfb39('0x11')]?_0x4fa898['options'][_0xfb39('0x14')]||null:null,'limit':0x1,'order':_0x4fa898[_0xfb39('0x11')]?_0x4fa898['options'][_0xfb39('0x42')]||null:null,'group':db[_0xfb39('0x1d')][_0xfb39('0x43')],'transaction':_0x74ba98,'lock':_0x74ba98['LOCK']['UPDATE'],'include':_0x4fa898[_0xfb39('0x11')]?_0x4fa898[_0xfb39('0x11')][_0xfb39('0x16')]?_[_0xfb39('0x17')](_0x4fa898['options']['include'],function(_0xa25a53){return{'model':db[_0xa25a53[_0xfb39('0x18')]],'as':_0xa25a53['as'],'attributes':_0xa25a53['attributes'],'include':_0xa25a53['include']?_[_0xfb39('0x17')](_0xa25a53['include'],function(_0x3c4b66){return{'model':db[_0x3c4b66[_0xfb39('0x18')]],'as':_0x3c4b66['as'],'attributes':_0x3c4b66[_0xfb39('0x14')],'include':_0x3c4b66[_0xfb39('0x16')]?_['map'](_0x3c4b66[_0xfb39('0x16')],function(_0x386f58){return{'model':db[_0x386f58[_0xfb39('0x18')]],'as':_0x386f58['as'],'attributes':_0x386f58[_0xfb39('0x14')]};}):[]};}):[]};}):[]:[]})[_0xfb39('0x19')](function(_0xca7144){var _0x353e72=[];for(var _0x3d12aa=0x0;_0x3d12aa<_0xca7144[_0xfb39('0x31')];_0x3d12aa+=0x1){_0x353e72[_0xfb39('0x32')](_0xca7144[_0x3d12aa][_0xfb39('0x20')](_0x4fa898[_0xfb39('0x1f')],{'transaction':_0x74ba98}));}return BPromise[_0xfb39('0x33')](_0x353e72);});})[_0xfb39('0x19')](function(_0x9c8650){logger[_0xfb39('0x7')](_0xfb39('0x41'),_0x4fa898);logger['debug'](_0xfb39('0x41'),_0x4fa898,JSON['stringify'](_0x9c8650));_0x4ec156(_0x9c8650);})['catch'](function(_0x29e4f0){logger[_0xfb39('0xb')](_0xfb39('0x41'),_0x29e4f0['message'],_0x4fa898);_0x3e8771(_0x220646[_0xfb39('0xb')](0x1f4,_0x29e4f0[_0xfb39('0xd')]));});});});};exports['GetCmHopperPreview']=function(_0x5212b4){var _0xbd2832=this;return new Promise(function(_0x6bdd14,_0x3dcf47){db[_0xfb39('0x26')][_0xfb39('0x27')]()[_0xfb39('0x19')](function(_0x114ec1){return db[_0xfb39('0x1d')][_0xfb39('0x10')]({'raw':_0x5212b4[_0xfb39('0x11')]?_0x5212b4[_0xfb39('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x5212b4[_0xfb39('0x11')]?_0x5212b4[_0xfb39('0x11')][_0xfb39('0x13')]||null:null,'attributes':_0x5212b4[_0xfb39('0x11')]?_0x5212b4['options'][_0xfb39('0x14')]||null:null,'limit':_0x5212b4[_0xfb39('0x11')]?_0x5212b4['options']['limit']||null:null,'include':_0x5212b4['options']?_0x5212b4[_0xfb39('0x11')][_0xfb39('0x16')]?_[_0xfb39('0x17')](_0x5212b4[_0xfb39('0x11')]['include'],function(_0x3fd85d){return{'model':db[_0x3fd85d[_0xfb39('0x18')]],'as':_0x3fd85d['as'],'attributes':_0x3fd85d['as']===_0xfb39('0x2c')?_[_0xfb39('0x2d')](_0x114ec1):_0x3fd85d['attributes'],'include':_0x3fd85d[_0xfb39('0x16')]?_[_0xfb39('0x17')](_0x3fd85d[_0xfb39('0x16')],function(_0x2e63a5){return{'model':db[_0x2e63a5['model']],'as':_0x2e63a5['as'],'attributes':_0x2e63a5[_0xfb39('0x14')],'include':_0x2e63a5[_0xfb39('0x16')]?_[_0xfb39('0x17')](_0x2e63a5[_0xfb39('0x16')],function(_0x2744fc){return{'model':db[_0x2744fc[_0xfb39('0x18')]],'as':_0x2744fc['as'],'attributes':_0x2744fc[_0xfb39('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x120fba){logger[_0xfb39('0x7')](_0xfb39('0xf'),_0x5212b4);logger[_0xfb39('0x1a')](_0xfb39('0xf'),_0x5212b4,JSON['stringify'](_0x120fba));_0x6bdd14(_0x120fba);})[_0xfb39('0xe')](function(_0x5e86cc){logger[_0xfb39('0xb')](_0xfb39('0xf'),_0x5e86cc[_0xfb39('0xd')],_0x5212b4);_0x3dcf47(_0xbd2832['error'](0x1f4,_0x5e86cc[_0xfb39('0xd')]));});});});};exports['GetContactByPhone']=function(_0x11c7f6){var _0x5ee358=this;return new Promise(function(_0x1cc72e,_0x4a1aea){return db['CmContact'][_0xfb39('0x44')]({'raw':!![],'where':{'phone':_0x11c7f6[_0xfb39('0x11')]['where'][_0xfb39('0x45')]},'attributes':['id',_0xfb39('0x46')],'order':[['id',_0xfb39('0x47')]]})[_0xfb39('0x19')](function(_0x48ced1){logger[_0xfb39('0x7')](_0xfb39('0x48'),_0x11c7f6);logger['debug'](_0xfb39('0x48'),_0x11c7f6,JSON[_0xfb39('0xa')](_0x48ced1));_0x1cc72e(_0x48ced1);})[_0xfb39('0xe')](function(_0x57b75f){logger[_0xfb39('0xb')](_0xfb39('0x48'),_0x57b75f[_0xfb39('0xd')],_0x11c7f6);_0x4a1aea(_0x5ee358['error'](0x1f4,_0x57b75f['message']));});});};exports[_0xfb39('0x49')]=function(_0x549587){var _0x6e567f=this;return new Promise(function(_0x210678,_0x6dd7){return db[_0xfb39('0x28')][_0xfb39('0x29')](function(_0x59fc97){return db['CmHopper'][_0xfb39('0x20')](_0x549587[_0xfb39('0x1f')],{'where':{},'transaction':_0x59fc97})[_0xfb39('0x19')](function(_0x58ac0d){logger[_0xfb39('0x7')](_0xfb39('0x49'),_0x549587);logger['debug'](_0xfb39('0x49'),_0x549587,JSON[_0xfb39('0xa')](_0x58ac0d));_0x210678(_0x58ac0d);})[_0xfb39('0xe')](function(_0x140e1e){logger[_0xfb39('0xb')]('ResetActiveCalls',_0x140e1e['message'],_0x549587);_0x6dd7(_0x6e567f[_0xfb39('0xb')](0x1f4,_0x140e1e[_0xfb39('0xd')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0xd248a4){var _0x18094a=this;var _0x593ce6=_0xd248a4[_0xfb39('0x1f')][_0xfb39('0x13')][_0xfb39('0x4a')];var _0x2612c7=_0xd248a4[_0xfb39('0x1f')][_0xfb39('0x13')]['interval'];var _0xdde8d9=_0xd248a4[_0xfb39('0x1f')]['where'][_0xfb39('0x4b')];return new Promise(function(_0x556977,_0xfaa389){return db[_0xfb39('0x1d')]['findAll']({'where':{'voiceQueueId':{'$in':_0x593ce6},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xfb39('0x28')][_0xfb39('0x3b')](_0xfb39('0x4c')+_0x2612c7+_0xfb39('0x4d')),'$gt':db[_0xfb39('0x28')][_0xfb39('0x3b')](_0xfb39('0x4e'))}},'UserId':{'$in':_0xdde8d9}},'include':[{'model':db[_0xfb39('0x26')],'as':'Contact'},{'model':db[_0xfb39('0x2e')],'as':'Agent','attributes':['id','name',_0xfb39('0x30')]},{'model':db[_0xfb39('0x4f')],'as':_0xfb39('0x50')}]})[_0xfb39('0x19')](function(_0xd791a6){if(_0xd791a6[_0xfb39('0x31')]>0x0){return db[_0xfb39('0x28')][_0xfb39('0x29')](function(_0x1c1b69){return db['CmHopper'][_0xfb39('0x20')]({'recallmeNotifiedDate':db[_0xfb39('0x28')][_0xfb39('0x3b')]('NOW()')},{'where':{'id':{'$in':_[_0xfb39('0x17')](_0xd791a6,'id')}},'transaction':_0x1c1b69})[_0xfb39('0x19')](function(){_0x556977(_0xd791a6);})[_0xfb39('0xe')](function(_0x3655eb){logger['error'](_0xfb39('0x51'),_0x3655eb[_0xfb39('0xd')],_0xd248a4);_0xfaa389(_0x18094a[_0xfb39('0xb')](0x1f4,_0x3655eb[_0xfb39('0xd')]));});})[_0xfb39('0xe')](function(_0x5be5f1){logger[_0xfb39('0xb')](_0xfb39('0x51'),_0x5be5f1['message'],_0xd248a4);_0xfaa389(_0x18094a[_0xfb39('0xb')](0x1f4,_0x5be5f1['message']));});}else{_0x556977(_0xd791a6);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index ed8c63d..4324bc1 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 _0x0bf2=['/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','/:id','update','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','/describe','describe','get','/opencontacts','getOpenContacts'];(function(_0x5cac54,_0x431445){var _0x399d30=function(_0x58722d){while(--_0x58722d){_0x5cac54['push'](_0x5cac54['shift']());}};_0x399d30(++_0x431445);}(_0x0bf2,0xf9));var _0x20bf=function(_0x98df36,_0x3008fc){_0x98df36=_0x98df36-0x0;var _0x55c56a=_0x0bf2[_0x98df36];return _0x55c56a;};'use strict';var express=require(_0x20bf('0x0'));var router=express[_0x20bf('0x1')]();var auth=require(_0x20bf('0x2'));var controller=require(_0x20bf('0x3'));router['get']('/',auth[_0x20bf('0x4')](),controller[_0x20bf('0x5')]);router['get'](_0x20bf('0x6'),auth['isAuthenticated'](),controller[_0x20bf('0x7')]);router[_0x20bf('0x8')](_0x20bf('0x9'),auth['isAuthenticated'](),controller[_0x20bf('0xa')]);router['get'](_0x20bf('0xb'),auth[_0x20bf('0x4')](),controller[_0x20bf('0xc')]);router[_0x20bf('0x8')]('/:id',auth[_0x20bf('0x4')](),controller[_0x20bf('0xd')]);router[_0x20bf('0x8')](_0x20bf('0xe'),auth[_0x20bf('0x4')](),controller[_0x20bf('0xf')]);router[_0x20bf('0x10')]('/',auth[_0x20bf('0x4')](),controller[_0x20bf('0x11')]);router[_0x20bf('0x10')](_0x20bf('0x12'),auth['isAuthenticated'](),controller[_0x20bf('0x13')]);router[_0x20bf('0x10')](_0x20bf('0x14'),auth[_0x20bf('0x4')](),controller[_0x20bf('0x15')]);router['put'](_0x20bf('0x16'),auth[_0x20bf('0x4')](),controller[_0x20bf('0x17')]);router['delete'](_0x20bf('0x16'),auth['isAuthenticated'](),controller[_0x20bf('0x18')]);module[_0x20bf('0x19')]=router; \ No newline at end of file +var _0xbfbe=['/opencontacts','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','/:id','update','delete','destroy','express','Router','get','index','/describe','isAuthenticated','describe'];(function(_0x3b962a,_0x27ccf3){var _0xf4961=function(_0x488068){while(--_0x488068){_0x3b962a['push'](_0x3b962a['shift']());}};_0xf4961(++_0x27ccf3);}(_0xbfbe,0x1ae));var _0xebfb=function(_0x44976e,_0x311385){_0x44976e=_0x44976e-0x0;var _0x4852b2=_0xbfbe[_0x44976e];return _0x4852b2;};'use strict';var express=require(_0xebfb('0x0'));var router=express[_0xebfb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0xebfb('0x2')]('/',auth['isAuthenticated'](),controller[_0xebfb('0x3')]);router[_0xebfb('0x2')](_0xebfb('0x4'),auth[_0xebfb('0x5')](),controller[_0xebfb('0x6')]);router[_0xebfb('0x2')](_0xebfb('0x7'),auth[_0xebfb('0x5')](),controller[_0xebfb('0x8')]);router[_0xebfb('0x2')](_0xebfb('0x9'),auth['isAuthenticated'](),controller[_0xebfb('0xa')]);router['get']('/:id',auth[_0xebfb('0x5')](),controller[_0xebfb('0xb')]);router[_0xebfb('0x2')](_0xebfb('0xc'),auth['isAuthenticated'](),controller[_0xebfb('0xd')]);router[_0xebfb('0xe')]('/',auth[_0xebfb('0x5')](),controller[_0xebfb('0xf')]);router[_0xebfb('0xe')](_0xebfb('0x10'),auth['isAuthenticated'](),controller[_0xebfb('0x11')]);router[_0xebfb('0xe')]('/timezone',auth[_0xebfb('0x5')](),controller[_0xebfb('0x12')]);router['put'](_0xebfb('0x13'),auth[_0xebfb('0x5')](),controller[_0xebfb('0x14')]);router[_0xebfb('0x15')]('/:id',auth[_0xebfb('0x5')](),controller[_0xebfb('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 01beddb..90139b3 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb32=['sequelize','exports','INTEGER','DATE','format'];(function(_0x1c31a9,_0x35c105){var _0x14187a=function(_0x481c81){while(--_0x481c81){_0x1c31a9['push'](_0x1c31a9['shift']());}};_0x14187a(++_0x35c105);}(_0xbb32,0xdc));var _0x2bb3=function(_0x73e4cf,_0x2a8375){_0x73e4cf=_0x73e4cf-0x0;var _0x1e1bf8=_0xbb32[_0x73e4cf];return _0x1e1bf8;};'use strict';var moment=require('moment');var Sequelize=require(_0x2bb3('0x0'));module[_0x2bb3('0x1')]={'CmHopperId':{'type':Sequelize[_0x2bb3('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2bb3('0x3')],'defaultValue':moment()[_0x2bb3('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2bb3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xca84=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','STRING','INTEGER'];(function(_0x51ba34,_0x37ccda){var _0x4c4c2d=function(_0xd853c9){while(--_0xd853c9){_0x51ba34['push'](_0x51ba34['shift']());}};_0x4c4c2d(++_0x37ccda);}(_0xca84,0x9d));var _0x4ca8=function(_0xf766ea,_0x12f2b6){_0xf766ea=_0xf766ea-0x0;var _0x56059b=_0xca84[_0xf766ea];return _0x56059b;};'use strict';var moment=require(_0x4ca8('0x0'));var Sequelize=require(_0x4ca8('0x1'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x4ca8('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x4ca8('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4ca8('0x4')],'defaultValue':moment()[_0x4ca8('0x5')](_0x4ca8('0x6'))},'countbusyretry':{'type':Sequelize[_0x4ca8('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4ca8('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4ca8('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4ca8('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4ca8('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4ca8('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 1d0cb62..c34ff9c 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ffb=['hasOwnProperty','limit','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','attributes','merge','create','body','get','user','CmHopperAdditionalPhones','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','CmHopperAdditionalPhone','fieldName','key','model','map','query','intersection','fields','length'];(function(_0x58806e,_0x4310bc){var _0x4c6ea3=function(_0x24df51){while(--_0x24df51){_0x58806e['push'](_0x58806e['shift']());}};_0x4c6ea3(++_0x4310bc);}(_0x8ffb,0x1eb));var _0xb8ff=function(_0x58ceee,_0x2be7ab){_0x58ceee=_0x58ceee-0x0;var _0x2c5da6=_0x8ffb[_0x58ceee];return _0x2c5da6;};'use strict';var emlformat=require(_0xb8ff('0x0'));var rimraf=require(_0xb8ff('0x1'));var zipdir=require(_0xb8ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8ff('0x3'));var moment=require(_0xb8ff('0x4'));var BPromise=require(_0xb8ff('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb8ff('0x6'));var csv=require(_0xb8ff('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8ff('0x8'));var _=require(_0xb8ff('0x9'));var squel=require('squel');var crypto=require(_0xb8ff('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb8ff('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb8ff('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb8ff('0xd'));var qs=require(_0xb8ff('0xe'));var as=require(_0xb8ff('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8ff('0x10'))(_0xb8ff('0x11'));var utils=require('../../config/utils');var config=require(_0xb8ff('0x12'));var licenseUtil=require(_0xb8ff('0x13'));var db=require(_0xb8ff('0x14'))['db'];function respondWithStatusCode(_0x29f59a,_0x7b42b1){_0x7b42b1=_0x7b42b1||0xcc;return function(_0x343477){if(_0x343477){return _0x29f59a['sendStatus'](_0x7b42b1);}return _0x29f59a[_0xb8ff('0x15')](_0x7b42b1)[_0xb8ff('0x16')]();};}function respondWithResult(_0x20c0e5,_0x4b5c60){_0x4b5c60=_0x4b5c60||0xc8;return function(_0x110589){if(_0x110589){return _0x20c0e5[_0xb8ff('0x15')](_0x4b5c60)[_0xb8ff('0x17')](_0x110589);}};}function respondWithFilteredResult(_0x328159,_0x18e93c){return function(_0x575ea6){if(_0x575ea6){var _0x50f478=typeof _0x18e93c['offset']===_0xb8ff('0x18')&&typeof _0x18e93c['limit']===_0xb8ff('0x18');var _0x2fe761=_0x575ea6[_0xb8ff('0x19')];var _0x406778=_0x50f478?0x0:_0x18e93c[_0xb8ff('0x1a')];var _0x450a12=_0x50f478?_0x575ea6[_0xb8ff('0x19')]:_0x18e93c[_0xb8ff('0x1a')]+_0x18e93c['limit'];var _0x12de79;if(_0x450a12>=_0x2fe761){_0x450a12=_0x2fe761;_0x12de79=0xc8;}else{_0x12de79=0xce;}_0x328159[_0xb8ff('0x15')](_0x12de79);return _0x328159[_0xb8ff('0x1b')](_0xb8ff('0x1c'),_0x406778+'-'+_0x450a12+'/'+_0x2fe761)['json'](_0x575ea6);}return null;};}function patchUpdates(_0xd258c8){return function(_0x3d0a44){try{jsonpatch['apply'](_0x3d0a44,_0xd258c8,!![]);}catch(_0x15f1a5){return BPromise[_0xb8ff('0x1d')](_0x15f1a5);}return _0x3d0a44['save']();};}function saveUpdates(_0x1119a1,_0x112229){return function(_0x31fdc5){if(_0x31fdc5){return _0x31fdc5[_0xb8ff('0x1e')](_0x1119a1)[_0xb8ff('0x1f')](function(_0x816807){return _0x816807;});}return null;};}function removeEntity(_0x227e78,_0x2dcbc7){return function(_0x59166b){if(_0x59166b){return _0x59166b[_0xb8ff('0x20')]()[_0xb8ff('0x1f')](function(){var _0x86e426=_0x59166b['get']({'plain':!![]});var _0x3f9275='CmHopperAdditionalPhones';return db['UserProfileResource'][_0xb8ff('0x20')]({'where':{'type':_0x3f9275,'resourceId':_0x86e426['id']}})[_0xb8ff('0x1f')](function(){return _0x59166b;});})[_0xb8ff('0x1f')](function(){_0x227e78[_0xb8ff('0x15')](0xcc)[_0xb8ff('0x16')]();});}};}function handleEntityNotFound(_0x53b921,_0x48b411){return function(_0x40af3c){if(!_0x40af3c){_0x53b921[_0xb8ff('0x21')](0x194);}return _0x40af3c;};}function handleError(_0x431282,_0x32c71c){_0x32c71c=_0x32c71c||0x1f4;return function(_0x540d39){logger[_0xb8ff('0x22')](_0x540d39[_0xb8ff('0x23')]);if(_0x540d39[_0xb8ff('0x24')]){delete _0x540d39[_0xb8ff('0x24')];}_0x431282[_0xb8ff('0x15')](_0x32c71c)[_0xb8ff('0x25')](_0x540d39);};}exports[_0xb8ff('0x26')]=function(_0x2a3346,_0x5bd0c4){var _0x2c4c42={},_0x465b99={},_0x2d6c56={'count':0x0,'rows':[]};var _0x24d323=_['map'](db[_0xb8ff('0x27')]['rawAttributes'],function(_0x31a9a1){return{'name':_0x31a9a1[_0xb8ff('0x28')],'type':_0x31a9a1['type'][_0xb8ff('0x29')]};});_0x465b99[_0xb8ff('0x2a')]=_[_0xb8ff('0x2b')](_0x24d323,_0xb8ff('0x24'));_0x465b99[_0xb8ff('0x2c')]=_['keys'](_0x2a3346[_0xb8ff('0x2c')]);_0x465b99['filters']=_[_0xb8ff('0x2d')](_0x465b99[_0xb8ff('0x2a')],_0x465b99['query']);_0x2c4c42['attributes']=_['intersection'](_0x465b99[_0xb8ff('0x2a')],qs[_0xb8ff('0x2e')](_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x2e')]));_0x2c4c42['attributes']=_0x2c4c42['attributes'][_0xb8ff('0x2f')]?_0x2c4c42['attributes']:_0x465b99[_0xb8ff('0x2a')];if(!_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x30')]('nolimit')){_0x2c4c42[_0xb8ff('0x31')]=qs[_0xb8ff('0x31')](_0x2a3346[_0xb8ff('0x2c')]['limit']);_0x2c4c42[_0xb8ff('0x1a')]=qs['offset'](_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x1a')]);}_0x2c4c42['order']=qs[_0xb8ff('0x32')](_0x2a3346[_0xb8ff('0x2c')]['sort']);_0x2c4c42[_0xb8ff('0x33')]=qs['filters'](_[_0xb8ff('0x34')](_0x2a3346['query'],_0x465b99[_0xb8ff('0x35')]),_0x24d323);if(_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x36')]){_0x2c4c42[_0xb8ff('0x33')]=_['merge'](_0x2c4c42[_0xb8ff('0x33')],{'$or':_[_0xb8ff('0x2b')](_0x24d323,function(_0x1fdc37){if(_0x1fdc37[_0xb8ff('0x37')]!==_0xb8ff('0x38')){var _0x469df1={};_0x469df1[_0x1fdc37[_0xb8ff('0x24')]]={'$like':'%'+_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x36')]+'%'};return _0x469df1;}})});}_0x2c4c42=_['merge']({},_0x2c4c42,_0x2a3346[_0xb8ff('0x39')]);var _0x2ffcdc={'where':_0x2c4c42['where']};return db['CmHopperAdditionalPhone'][_0xb8ff('0x19')](_0x2ffcdc)['then'](function(_0x58cd58){_0x2d6c56[_0xb8ff('0x19')]=_0x58cd58;if(_0x2a3346[_0xb8ff('0x2c')][_0xb8ff('0x3a')]){_0x2c4c42[_0xb8ff('0x3b')]=[{'all':!![]}];}return db[_0xb8ff('0x27')][_0xb8ff('0x3c')](_0x2c4c42);})[_0xb8ff('0x1f')](function(_0xb25dc7){_0x2d6c56[_0xb8ff('0x3d')]=_0xb25dc7;return _0x2d6c56;})[_0xb8ff('0x1f')](respondWithFilteredResult(_0x5bd0c4,_0x2c4c42))[_0xb8ff('0x3e')](handleError(_0x5bd0c4,null));};exports[_0xb8ff('0x3f')]=function(_0x27ed15,_0x5bfbd5){var _0x55f198={'raw':!![],'where':{'id':_0x27ed15['params']['id']}},_0x3c2fcc={};_0x3c2fcc[_0xb8ff('0x2a')]=_[_0xb8ff('0x40')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x3c2fcc['query']=_[_0xb8ff('0x40')](_0x27ed15['query']);_0x3c2fcc[_0xb8ff('0x35')]=_[_0xb8ff('0x2d')](_0x3c2fcc[_0xb8ff('0x2a')],_0x3c2fcc[_0xb8ff('0x2c')]);_0x55f198[_0xb8ff('0x41')]=_[_0xb8ff('0x2d')](_0x3c2fcc[_0xb8ff('0x2a')],qs[_0xb8ff('0x2e')](_0x27ed15[_0xb8ff('0x2c')][_0xb8ff('0x2e')]));_0x55f198[_0xb8ff('0x41')]=_0x55f198['attributes'][_0xb8ff('0x2f')]?_0x55f198[_0xb8ff('0x41')]:_0x3c2fcc[_0xb8ff('0x2a')];if(_0x27ed15[_0xb8ff('0x2c')]['includeAll']){_0x55f198[_0xb8ff('0x3b')]=[{'all':!![]}];}_0x55f198=_[_0xb8ff('0x42')]({},_0x55f198,_0x27ed15['options']);return db[_0xb8ff('0x27')]['find'](_0x55f198)[_0xb8ff('0x1f')](handleEntityNotFound(_0x5bfbd5,null))[_0xb8ff('0x1f')](respondWithResult(_0x5bfbd5,null))[_0xb8ff('0x3e')](handleError(_0x5bfbd5,null));};exports[_0xb8ff('0x43')]=function(_0x36338c,_0x23fe0a){return db[_0xb8ff('0x27')][_0xb8ff('0x43')](_0x36338c[_0xb8ff('0x44')],{})['then'](function(_0x5a7641){var _0x45e579=_0x36338c['user'][_0xb8ff('0x45')]({'plain':!![]});if(!_0x45e579)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45e579['role']===_0xb8ff('0x46')){var _0x242d8b=_0x5a7641[_0xb8ff('0x45')]({'plain':!![]});var _0x334ec8=_0xb8ff('0x47');return db[_0xb8ff('0x48')][_0xb8ff('0x49')]({'where':{'name':_0x334ec8,'userProfileId':_0x45e579[_0xb8ff('0x4a')]},'raw':!![]})[_0xb8ff('0x1f')](function(_0x1ef006){if(_0x1ef006&&_0x1ef006['autoAssociation']===0x0){return db[_0xb8ff('0x4b')][_0xb8ff('0x43')]({'name':_0x242d8b['name'],'resourceId':_0x242d8b['id'],'type':_0x1ef006[_0xb8ff('0x24')],'sectionId':_0x1ef006['id']},{})[_0xb8ff('0x1f')](function(){return _0x5a7641;});}else{return _0x5a7641;}})['catch'](function(_0x193955){logger[_0xb8ff('0x22')](_0xb8ff('0x4c'),_0x193955);throw _0x193955;});}return _0x5a7641;})['then'](respondWithResult(_0x23fe0a,0xc9))['catch'](handleError(_0x23fe0a,null));};exports[_0xb8ff('0x1e')]=function(_0x314d30,_0x203e09){if(_0x314d30[_0xb8ff('0x44')]['id']){delete _0x314d30[_0xb8ff('0x44')]['id'];}return db[_0xb8ff('0x27')][_0xb8ff('0x49')]({'where':{'id':_0x314d30['params']['id']}})[_0xb8ff('0x1f')](handleEntityNotFound(_0x203e09,null))[_0xb8ff('0x1f')](saveUpdates(_0x314d30[_0xb8ff('0x44')],null))[_0xb8ff('0x1f')](respondWithResult(_0x203e09,null))[_0xb8ff('0x3e')](handleError(_0x203e09,null));};exports[_0xb8ff('0x20')]=function(_0x4dd994,_0x46de29){return db[_0xb8ff('0x27')][_0xb8ff('0x49')]({'where':{'id':_0x4dd994['params']['id']}})['then'](handleEntityNotFound(_0x46de29,null))[_0xb8ff('0x1f')](removeEntity(_0x46de29,null))[_0xb8ff('0x3e')](handleError(_0x46de29,null));}; \ No newline at end of file +var _0x83f4=['../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','end','sendStatus','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','keys','include','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83f4,0x134));var _0x483f=function(_0x37c003,_0x190644){_0x37c003=_0x37c003-0x0;var _0x1449f6=_0x83f4[_0x37c003];return _0x1449f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x483f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x483f('0x1'));var rp=require(_0x483f('0x2'));var moment=require(_0x483f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x483f('0x4'));var path=require(_0x483f('0x5'));var sox=require('sox');var csv=require(_0x483f('0x6'));var ejs=require(_0x483f('0x7'));var fs=require('fs');var fs_extra=require(_0x483f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x483f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x483f('0xa'));var toCsv=require(_0x483f('0x6'));var querystring=require('querystring');var Papa=require(_0x483f('0xb'));var Redis=require(_0x483f('0xc'));var authService=require(_0x483f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x483f('0xe'));var hardwareService=require(_0x483f('0xf'));var logger=require(_0x483f('0x10'))(_0x483f('0x11'));var utils=require('../../config/utils');var config=require(_0x483f('0x12'));var licenseUtil=require(_0x483f('0x13'));var db=require(_0x483f('0x14'))['db'];function respondWithStatusCode(_0x32878f,_0x5d24b4){_0x5d24b4=_0x5d24b4||0xcc;return function(_0x3a6477){if(_0x3a6477){return _0x32878f['sendStatus'](_0x5d24b4);}return _0x32878f[_0x483f('0x15')](_0x5d24b4)['end']();};}function respondWithResult(_0x2c6b31,_0x2e2c20){_0x2e2c20=_0x2e2c20||0xc8;return function(_0x2b0d1f){if(_0x2b0d1f){return _0x2c6b31['status'](_0x2e2c20)['json'](_0x2b0d1f);}};}function respondWithFilteredResult(_0x269fe9,_0xd3a755){return function(_0x17c545){if(_0x17c545){var _0x292de1=typeof _0xd3a755[_0x483f('0x16')]==='undefined'&&typeof _0xd3a755[_0x483f('0x17')]===_0x483f('0x18');var _0x47995e=_0x17c545[_0x483f('0x19')];var _0x5494f5=_0x292de1?0x0:_0xd3a755[_0x483f('0x16')];var _0x3887d5=_0x292de1?_0x17c545['count']:_0xd3a755['offset']+_0xd3a755[_0x483f('0x17')];var _0x3daa2b;if(_0x3887d5>=_0x47995e){_0x3887d5=_0x47995e;_0x3daa2b=0xc8;}else{_0x3daa2b=0xce;}_0x269fe9[_0x483f('0x15')](_0x3daa2b);return _0x269fe9[_0x483f('0x1a')](_0x483f('0x1b'),_0x5494f5+'-'+_0x3887d5+'/'+_0x47995e)[_0x483f('0x1c')](_0x17c545);}return null;};}function patchUpdates(_0x273a45){return function(_0x13772f){try{jsonpatch[_0x483f('0x1d')](_0x13772f,_0x273a45,!![]);}catch(_0x1fc85c){return BPromise[_0x483f('0x1e')](_0x1fc85c);}return _0x13772f['save']();};}function saveUpdates(_0x59747f,_0x201874){return function(_0x1790dd){if(_0x1790dd){return _0x1790dd[_0x483f('0x1f')](_0x59747f)[_0x483f('0x20')](function(_0x15ce3b){return _0x15ce3b;});}return null;};}function removeEntity(_0x312880,_0x48f71d){return function(_0x2502fe){if(_0x2502fe){return _0x2502fe[_0x483f('0x21')]()[_0x483f('0x20')](function(){var _0x1f09de=_0x2502fe['get']({'plain':!![]});var _0x9622c1=_0x483f('0x22');return db[_0x483f('0x23')][_0x483f('0x21')]({'where':{'type':_0x9622c1,'resourceId':_0x1f09de['id']}})[_0x483f('0x20')](function(){return _0x2502fe;});})[_0x483f('0x20')](function(){_0x312880['status'](0xcc)[_0x483f('0x24')]();});}};}function handleEntityNotFound(_0x3933ae,_0x60339a){return function(_0x4f3b28){if(!_0x4f3b28){_0x3933ae[_0x483f('0x25')](0x194);}return _0x4f3b28;};}function handleError(_0x2bf59f,_0x5a3121){_0x5a3121=_0x5a3121||0x1f4;return function(_0x60327d){logger[_0x483f('0x26')](_0x60327d[_0x483f('0x27')]);if(_0x60327d[_0x483f('0x28')]){delete _0x60327d[_0x483f('0x28')];}_0x2bf59f[_0x483f('0x15')](_0x5a3121)[_0x483f('0x29')](_0x60327d);};}exports['index']=function(_0x421eb7,_0x1269f1){var _0x3a06e2={},_0x5436a6={},_0x1fddc6={'count':0x0,'rows':[]};var _0x2999a7=_[_0x483f('0x2a')](db[_0x483f('0x2b')][_0x483f('0x2c')],function(_0x18ddec){return{'name':_0x18ddec[_0x483f('0x2d')],'type':_0x18ddec[_0x483f('0x2e')][_0x483f('0x2f')]};});_0x5436a6[_0x483f('0x30')]=_[_0x483f('0x2a')](_0x2999a7,_0x483f('0x28'));_0x5436a6[_0x483f('0x31')]=_['keys'](_0x421eb7[_0x483f('0x31')]);_0x5436a6[_0x483f('0x32')]=_[_0x483f('0x33')](_0x5436a6[_0x483f('0x30')],_0x5436a6['query']);_0x3a06e2['attributes']=_[_0x483f('0x33')](_0x5436a6[_0x483f('0x30')],qs['fields'](_0x421eb7[_0x483f('0x31')][_0x483f('0x34')]));_0x3a06e2['attributes']=_0x3a06e2[_0x483f('0x35')][_0x483f('0x36')]?_0x3a06e2[_0x483f('0x35')]:_0x5436a6[_0x483f('0x30')];if(!_0x421eb7['query'][_0x483f('0x37')]('nolimit')){_0x3a06e2[_0x483f('0x17')]=qs[_0x483f('0x17')](_0x421eb7[_0x483f('0x31')][_0x483f('0x17')]);_0x3a06e2[_0x483f('0x16')]=qs[_0x483f('0x16')](_0x421eb7[_0x483f('0x31')][_0x483f('0x16')]);}_0x3a06e2[_0x483f('0x38')]=qs['sort'](_0x421eb7[_0x483f('0x31')]['sort']);_0x3a06e2['where']=qs[_0x483f('0x32')](_[_0x483f('0x39')](_0x421eb7[_0x483f('0x31')],_0x5436a6[_0x483f('0x32')]),_0x2999a7);if(_0x421eb7[_0x483f('0x31')][_0x483f('0x3a')]){_0x3a06e2['where']=_[_0x483f('0x3b')](_0x3a06e2[_0x483f('0x3c')],{'$or':_[_0x483f('0x2a')](_0x2999a7,function(_0x894b0a){if(_0x894b0a[_0x483f('0x2e')]!==_0x483f('0x3d')){var _0x3f4e7e={};_0x3f4e7e[_0x894b0a['name']]={'$like':'%'+_0x421eb7[_0x483f('0x31')][_0x483f('0x3a')]+'%'};return _0x3f4e7e;}})});}_0x3a06e2=_[_0x483f('0x3b')]({},_0x3a06e2,_0x421eb7[_0x483f('0x3e')]);var _0x3541f5={'where':_0x3a06e2['where']};return db[_0x483f('0x2b')]['count'](_0x3541f5)[_0x483f('0x20')](function(_0x311670){_0x1fddc6[_0x483f('0x19')]=_0x311670;if(_0x421eb7['query'][_0x483f('0x3f')]){_0x3a06e2['include']=[{'all':!![]}];}return db[_0x483f('0x2b')][_0x483f('0x40')](_0x3a06e2);})[_0x483f('0x20')](function(_0x36aaa5){_0x1fddc6[_0x483f('0x41')]=_0x36aaa5;return _0x1fddc6;})[_0x483f('0x20')](respondWithFilteredResult(_0x1269f1,_0x3a06e2))['catch'](handleError(_0x1269f1,null));};exports[_0x483f('0x42')]=function(_0x36ae0b,_0x2cedbe){var _0x4ad2b2={'raw':!![],'where':{'id':_0x36ae0b['params']['id']}},_0x219c2b={};_0x219c2b[_0x483f('0x30')]=_[_0x483f('0x43')](db[_0x483f('0x2b')][_0x483f('0x2c')]);_0x219c2b[_0x483f('0x31')]=_['keys'](_0x36ae0b[_0x483f('0x31')]);_0x219c2b[_0x483f('0x32')]=_[_0x483f('0x33')](_0x219c2b[_0x483f('0x30')],_0x219c2b[_0x483f('0x31')]);_0x4ad2b2[_0x483f('0x35')]=_['intersection'](_0x219c2b[_0x483f('0x30')],qs[_0x483f('0x34')](_0x36ae0b[_0x483f('0x31')][_0x483f('0x34')]));_0x4ad2b2['attributes']=_0x4ad2b2[_0x483f('0x35')][_0x483f('0x36')]?_0x4ad2b2[_0x483f('0x35')]:_0x219c2b['model'];if(_0x36ae0b['query'][_0x483f('0x3f')]){_0x4ad2b2[_0x483f('0x44')]=[{'all':!![]}];}_0x4ad2b2=_['merge']({},_0x4ad2b2,_0x36ae0b['options']);return db['CmHopperAdditionalPhone']['find'](_0x4ad2b2)[_0x483f('0x20')](handleEntityNotFound(_0x2cedbe,null))[_0x483f('0x20')](respondWithResult(_0x2cedbe,null))[_0x483f('0x45')](handleError(_0x2cedbe,null));};exports[_0x483f('0x46')]=function(_0x5e7b78,_0x32d77a){return db[_0x483f('0x2b')][_0x483f('0x46')](_0x5e7b78[_0x483f('0x47')],{})[_0x483f('0x20')](function(_0x27fd5e){var _0x4b58ce=_0x5e7b78[_0x483f('0x48')][_0x483f('0x49')]({'plain':!![]});if(!_0x4b58ce)throw new Error(_0x483f('0x4a'));if(_0x4b58ce[_0x483f('0x4b')]===_0x483f('0x48')){var _0x2fc217=_0x27fd5e[_0x483f('0x49')]({'plain':!![]});var _0x5b1ecd=_0x483f('0x22');return db[_0x483f('0x4c')][_0x483f('0x4d')]({'where':{'name':_0x5b1ecd,'userProfileId':_0x4b58ce[_0x483f('0x4e')]},'raw':!![]})[_0x483f('0x20')](function(_0x2a8739){if(_0x2a8739&&_0x2a8739[_0x483f('0x4f')]===0x0){return db[_0x483f('0x23')][_0x483f('0x46')]({'name':_0x2fc217[_0x483f('0x28')],'resourceId':_0x2fc217['id'],'type':_0x2a8739[_0x483f('0x28')],'sectionId':_0x2a8739['id']},{})[_0x483f('0x20')](function(){return _0x27fd5e;});}else{return _0x27fd5e;}})[_0x483f('0x45')](function(_0x3f967f){logger[_0x483f('0x26')](_0x483f('0x50'),_0x3f967f);throw _0x3f967f;});}return _0x27fd5e;})[_0x483f('0x20')](respondWithResult(_0x32d77a,0xc9))[_0x483f('0x45')](handleError(_0x32d77a,null));};exports[_0x483f('0x1f')]=function(_0x4e8f5b,_0x561cc1){if(_0x4e8f5b[_0x483f('0x47')]['id']){delete _0x4e8f5b[_0x483f('0x47')]['id'];}return db[_0x483f('0x2b')][_0x483f('0x4d')]({'where':{'id':_0x4e8f5b[_0x483f('0x51')]['id']}})['then'](handleEntityNotFound(_0x561cc1,null))[_0x483f('0x20')](saveUpdates(_0x4e8f5b['body'],null))['then'](respondWithResult(_0x561cc1,null))[_0x483f('0x45')](handleError(_0x561cc1,null));};exports[_0x483f('0x21')]=function(_0x152fd3,_0x3274f7){return db[_0x483f('0x2b')][_0x483f('0x4d')]({'where':{'id':_0x152fd3[_0x483f('0x51')]['id']}})['then'](handleEntityNotFound(_0x3274f7,null))[_0x483f('0x20')](removeEntity(_0x3274f7,null))['catch'](handleError(_0x3274f7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 77dc216..5bc1321 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2001=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports'];(function(_0x3736ba,_0x16ef6b){var _0x2c066a=function(_0x119f35){while(--_0x119f35){_0x3736ba['push'](_0x3736ba['shift']());}};_0x2c066a(++_0x16ef6b);}(_0x2001,0xf3));var _0x1200=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2001[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x1200('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1200('0x1'));var moment=require(_0x1200('0x2'));var BPromise=require(_0x1200('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1200('0x4'));var rimraf=require(_0x1200('0x5'));var config=require(_0x1200('0x6'));var attributes=require(_0x1200('0x7'));module[_0x1200('0x8')]=function(_0x1bba62,_0x3db51e){return _0x1bba62[_0x1200('0x9')](_0x1200('0xa'),attributes,{'tableName':_0x1200('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f98=['path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1156e1,_0x3cf35d){var _0x3ca770=function(_0xd1d16a){while(--_0xd1d16a){_0x1156e1['push'](_0x1156e1['shift']());}};_0x3ca770(++_0x3cf35d);}(_0x3f98,0x19a));var _0x83f9=function(_0x542a9c,_0x5f2c44){_0x542a9c=_0x542a9c-0x0;var _0x2531fc=_0x3f98[_0x542a9c];return _0x2531fc;};'use strict';var _=require(_0x83f9('0x0'));var util=require(_0x83f9('0x1'));var logger=require(_0x83f9('0x2'))(_0x83f9('0x3'));var moment=require(_0x83f9('0x4'));var BPromise=require('bluebird');var rp=require(_0x83f9('0x5'));var fs=require('fs');var path=require(_0x83f9('0x6'));var rimraf=require(_0x83f9('0x7'));var config=require(_0x83f9('0x8'));var attributes=require(_0x83f9('0x9'));module[_0x83f9('0xa')]=function(_0x3ebad2,_0x39b9cd){return _0x3ebad2[_0x83f9('0xb')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x83f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 93b809c..a562afe 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0fe=['ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countnoanswerretry','countdropretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','phone','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','CmHopper','findOne','body'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0xb0fe,0xd2));var _0xeb0f=function(_0x1faa61,_0x1bd7e2){_0x1faa61=_0x1faa61-0x0;var _0x3f0e58=_0xb0fe[_0x1faa61];return _0x3f0e58;};'use strict';var _=require('lodash');var util=require(_0xeb0f('0x0'));var moment=require(_0xeb0f('0x1'));var BPromise=require(_0xeb0f('0x2'));var rs=require(_0xeb0f('0x3'));var fs=require('fs');var Redis=require(_0xeb0f('0x4'));var db=require(_0xeb0f('0x5'))['db'];var utils=require(_0xeb0f('0x6'));var logger=require('../../config/logger')(_0xeb0f('0x7'));var config=require(_0xeb0f('0x8'));var jayson=require(_0xeb0f('0x9'));var client=jayson['client'][_0xeb0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a19cb,_0x29502d,_0x219fa5){return new BPromise(function(_0x34e0fe,_0x1106f7){return client[_0xeb0f('0xb')](_0x3a19cb,_0x219fa5)[_0xeb0f('0xc')](function(_0x4524f8){logger[_0xeb0f('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x29502d,'request\x20sent');logger[_0xeb0f('0xe')](_0xeb0f('0xf'),_0x29502d,_0xeb0f('0x10'),JSON['stringify'](_0x4524f8));if(_0x4524f8[_0xeb0f('0x11')]){if(_0x4524f8['error'][_0xeb0f('0x12')]===0x1f4){logger[_0xeb0f('0x11')](_0xeb0f('0x13'),_0x29502d,_0x4524f8[_0xeb0f('0x11')][_0xeb0f('0x14')]);return _0x1106f7(_0x4524f8['error'][_0xeb0f('0x14')]);}logger[_0xeb0f('0x11')](_0xeb0f('0x13'),_0x29502d,_0x4524f8[_0xeb0f('0x11')]['message']);return _0x34e0fe(_0x4524f8[_0xeb0f('0x11')]['message']);}else{logger[_0xeb0f('0xd')](_0xeb0f('0x13'),_0x29502d,'request\x20sent');_0x34e0fe(_0x4524f8[_0xeb0f('0x15')][_0xeb0f('0x14')]);}})[_0xeb0f('0x16')](function(_0x543f94){logger[_0xeb0f('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x29502d,_0x543f94);_0x1106f7(_0x543f94);});});}exports['VerifyAdditionalPhones']=function(_0xd5fa6c){var _0x4e91fe=this;return new Promise(function(_0x441688,_0x4aed6e){return db[_0xeb0f('0x17')][_0xeb0f('0x18')]({'raw':!![],'where':{'ContactId':_0xd5fa6c[_0xeb0f('0x19')][_0xeb0f('0x1a')],'ListId':_0xd5fa6c[_0xeb0f('0x19')][_0xeb0f('0x1b')],'VoiceQueueId':_0xd5fa6c['body'][_0xeb0f('0x1c')]===undefined?null:_0xd5fa6c[_0xeb0f('0x19')][_0xeb0f('0x1c')],'CampaignId':_0xd5fa6c[_0xeb0f('0x19')]['CampaignId']===undefined?null:_0xd5fa6c['body'][_0xeb0f('0x1d')]}})['then'](function(_0x260625){if(_0x260625!=null){return db[_0xeb0f('0x1e')][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x260625['id'],'OrderBy':{'$gt':_0x260625['OrderBy']}},'order':[[_0xeb0f('0x1f'),_0xeb0f('0x20')]]})['then'](function(_0x4d6f1){var _0x4c9e69=0x0;if(_0x4d6f1){if(_0x4d6f1[_0xeb0f('0x21')]+_0x4d6f1[_0xeb0f('0x22')]+_0x4d6f1['countnoanswerretry']+_0x4d6f1[_0xeb0f('0x23')]+_0x4d6f1['countdropretry']+_0x4d6f1[_0xeb0f('0x24')]+_0x4d6f1[_0xeb0f('0x25')]+_0x4d6f1[_0xeb0f('0x26')]<_0xd5fa6c[_0xeb0f('0x27')]['dialGlobalMaxRetry'])_0x4c9e69=0x1;_0x441688({'additional':_0x4c9e69});}else{return db[_0xeb0f('0x1e')][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x260625['id']},'order':[[_0xeb0f('0x1f'),_0xeb0f('0x20')]]})[_0xeb0f('0xc')](function(_0x3aee93){var _0x2cd79b=0x0;if(_0x3aee93){if(_0x3aee93[_0xeb0f('0x21')]+_0x3aee93[_0xeb0f('0x22')]+_0x3aee93[_0xeb0f('0x28')]+_0x3aee93[_0xeb0f('0x23')]+_0x3aee93[_0xeb0f('0x29')]+_0x3aee93[_0xeb0f('0x24')]+_0x3aee93[_0xeb0f('0x25')]+_0x3aee93[_0xeb0f('0x26')]<_0xd5fa6c[_0xeb0f('0x27')][_0xeb0f('0x2a')])_0x2cd79b=0x1;_0x441688({'additional':_0x2cd79b});}else{_0x441688({'additional':0x0});}})['catch'](function(_0x492d4e){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x492d4e[_0xeb0f('0x14')]);_0x4aed6e(_0x4e91fe['error'](0x1f4,_0x492d4e[_0xeb0f('0x14')]));});}})['catch'](function(_0x3880d9){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x3880d9[_0xeb0f('0x14')]);_0x4aed6e(_0x4e91fe[_0xeb0f('0x11')](0x1f4,_0x3880d9[_0xeb0f('0x14')]));});}else _0x441688({'additional':0x0});});});};exports[_0xeb0f('0x2c')]=function(_0x2ac8bf){var _0x45a171=this;return new Promise(function(_0x27b06e,_0x1df63b){return db[_0xeb0f('0x17')][_0xeb0f('0x18')]({'raw':!![],'where':{'ContactId':_0x2ac8bf['body'][_0xeb0f('0x1a')],'ListId':_0x2ac8bf['body'][_0xeb0f('0x1b')],'VoiceQueueId':_0x2ac8bf[_0xeb0f('0x19')][_0xeb0f('0x1c')]===undefined?null:_0x2ac8bf['body'][_0xeb0f('0x1c')],'CampaignId':_0x2ac8bf[_0xeb0f('0x19')][_0xeb0f('0x1d')]===undefined?null:_0x2ac8bf[_0xeb0f('0x19')][_0xeb0f('0x1d')]}})[_0xeb0f('0xc')](function(_0x37010b){if(_0x37010b!=null){return db[_0xeb0f('0x1e')][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x37010b['id'],'OrderBy':{'$gte':_0x37010b[_0xeb0f('0x1f')]}},'order':[['OrderBy',_0xeb0f('0x20')]]})[_0xeb0f('0xc')](function(_0x2a0104){if(_0x2a0104)return activateAdditionalPhone(_0x37010b,_0x2ac8bf[_0xeb0f('0x19')],_0x2a0104,_0x2ac8bf[_0xeb0f('0x2d')],_0x2ac8bf[_0xeb0f('0x2e')])[_0xeb0f('0xc')](function(_0x1f85ff){_0x27b06e(_0x1f85ff);});else{return db['CmHopperAdditionalPhone'][_0xeb0f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x37010b['id']},'order':[['OrderBy',_0xeb0f('0x20')]]})[_0xeb0f('0xc')](function(_0x52a024){if(_0x52a024)return activateAdditionalPhone(_0x37010b,_0x2ac8bf['body'],_0x52a024,_0x2ac8bf[_0xeb0f('0x2d')],_0x2ac8bf[_0xeb0f('0x2e')])['then'](function(_0x39355d){_0x27b06e(_0x39355d);});else{_0x27b06e({'id':_0x37010b['id'],'phone':''});}})[_0xeb0f('0x16')](function(_0x4b4757){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x4b4757[_0xeb0f('0x14')]);_0x1df63b(_0x45a171[_0xeb0f('0x11')](0x1f4,_0x4b4757[_0xeb0f('0x14')]));});}})['catch'](function(_0x34571a){logger[_0xeb0f('0x11')](_0xeb0f('0x2b'),_0x34571a[_0xeb0f('0x14')]);_0x1df63b(_0x45a171[_0xeb0f('0x11')](0x1f4,_0x34571a[_0xeb0f('0x14')]));});}else _0x27b06e(0x1);});});};function activateAdditionalPhone(_0xe56a84,_0x241c07,_0x3c540f,_0xe7a55,_0x1de0f4){return new Promise(function(_0x5a844c,_0x3d5da6){var _0x3f9ade;if(_['isNil'](_0x3c540f[_0xeb0f('0x2f')])){_0x3c540f[_0xeb0f('0x2f')]=moment();}if(moment()>moment(_0x3c540f['scheduledat'])){_0x3f9ade=moment()['add'](_0x1de0f4||0x3,'minutes');}else{if(_0x3c540f[_0xeb0f('0x1f')]==0x0){_0x3f9ade=moment(_0x3c540f[_0xeb0f('0x2f')]);}else{_0x3f9ade=moment()[_0xeb0f('0x30')](_0x1de0f4||0x3,_0xeb0f('0x31'));}}if(_[_0xeb0f('0x32')](_0x3f9ade)){_0x3f9ade=moment()[_0xeb0f('0x30')](_0x1de0f4||0x3,_0xeb0f('0x31'));}var _0x4e03c9={'phone':_0xe56a84[_0xeb0f('0x33')],'active':0x0,'OrderBy':_[_0xeb0f('0x32')](_0xe56a84[_0xeb0f('0x1f')])?0x0:_0xe56a84[_0xeb0f('0x1f')],'scheduledat':moment()[_0xeb0f('0x30')](_0xe7a55||0x1,_0xeb0f('0x31')),'countbusyretry':_0x241c07[_0xeb0f('0x21')],'countcongestionretry':_0x241c07[_0xeb0f('0x22')],'countnoanswerretry':_0x241c07['countnoanswerretry'],'countnosuchnumberretry':_0x241c07['countnosuchnumberretry'],'countdropretry':_0x241c07[_0xeb0f('0x29')],'countabandonedretry':_0x241c07[_0xeb0f('0x24')],'countmachineretry':_0x241c07['countmachineretry'],'countagentrejectretry':_0x241c07[_0xeb0f('0x26')],'createdAt':_0x241c07[_0xeb0f('0x34')],'updatedAt':_0x241c07[_0xeb0f('0x35')]};var _0x5bc0cc={'CmHopperId':_0xe56a84['id'],'phone':_0x3c540f['phone'],'active':0x0,'OrderBy':_[_0xeb0f('0x32')](_0x3c540f[_0xeb0f('0x1f')])?0x0:_0x3c540f[_0xeb0f('0x1f')],'scheduledat':_0x3f9ade,'countbusyretry':_0x3c540f[_0xeb0f('0x21')],'countcongestionretry':_0x3c540f[_0xeb0f('0x22')],'countnoanswerretry':_0x3c540f[_0xeb0f('0x28')],'countnosuchnumberretry':_0x3c540f[_0xeb0f('0x23')],'countdropretry':_0x3c540f[_0xeb0f('0x29')],'countabandonedretry':_0x3c540f['countabandonedretry'],'countmachineretry':_0x3c540f[_0xeb0f('0x25')],'countagentrejectretry':_0x3c540f[_0xeb0f('0x26')],'createdAt':_0x3c540f['createdAt'],'updatedAt':_0x3c540f[_0xeb0f('0x35')]};return db[_0xeb0f('0x36')]['transaction'](function(_0x2fb259){return db[_0xeb0f('0x1e')][_0xeb0f('0x37')](_0x4e03c9,{'where':{'id':_0x3c540f['id']}},{'transaction':_0x2fb259})[_0xeb0f('0xc')](function(){return db[_0xeb0f('0x17')][_0xeb0f('0x37')](_0x5bc0cc,{'where':{'id':_0xe56a84['id']}},{'transaction':_0x2fb259});});})[_0xeb0f('0xc')](function(_0x3a7785){_0x5a844c({'id':_0xe56a84['id'],'phone':_0x3c540f[_0xeb0f('0x33')]});})['catch'](function(_0x4775d6){logger[_0xeb0f('0x11')](_0xeb0f('0x38'),_0x4775d6[_0xeb0f('0x14')]);_0x3d5da6({'error':_0x4775d6[_0xeb0f('0x14')]});});});}exports[_0xeb0f('0x39')]=function(_0x56af02){var _0x5ca23f=this;return new Promise(function(_0x4bea0d,_0x1ed26f){return db[_0xeb0f('0x17')][_0xeb0f('0x37')](_0x56af02[_0xeb0f('0x19')][_0xeb0f('0x3a')],{'where':{'id':_0x56af02[_0xeb0f('0x19')]['id']}})[_0xeb0f('0xc')](function(_0x1430f1){_0x4bea0d(_0x1430f1);})['catch'](function(_0x34f625){logger[_0xeb0f('0x11')](_0xeb0f('0x39'),_0x34f625['message']);_0x1ed26f(_0x5ca23f[_0xeb0f('0x11')](0x1f4,_0x34f625[_0xeb0f('0x14')]));});});}; \ No newline at end of file +var _0x8ab3=['IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','ASC','entity','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','countabandonedretry','createdAt','updatedAt','countnosuchnumberretry','update','phone'];(function(_0x1fb299,_0x13dcc9){var _0x5db7da=function(_0x4f8e98){while(--_0x4f8e98){_0x1fb299['push'](_0x1fb299['shift']());}};_0x5db7da(++_0x13dcc9);}(_0x8ab3,0xad));var _0x38ab=function(_0x498b38,_0x2d9583){_0x498b38=_0x498b38-0x0;var _0x10feb7=_0x8ab3[_0x498b38];return _0x10feb7;};'use strict';var _=require(_0x38ab('0x0'));var util=require(_0x38ab('0x1'));var moment=require(_0x38ab('0x2'));var BPromise=require(_0x38ab('0x3'));var rs=require(_0x38ab('0x4'));var fs=require('fs');var Redis=require(_0x38ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x38ab('0x6'));var logger=require(_0x38ab('0x7'))(_0x38ab('0x8'));var config=require('../../config/environment');var jayson=require(_0x38ab('0x9'));var client=jayson['client'][_0x38ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df2cd,_0x4268e4,_0x54f71d){return new BPromise(function(_0x22a2ec,_0x588fe5){return client[_0x38ab('0xb')](_0x3df2cd,_0x54f71d)[_0x38ab('0xc')](function(_0xaaa731){logger['info'](_0x38ab('0xd'),_0x4268e4,_0x38ab('0xe'));logger[_0x38ab('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x4268e4,'request\x20sent',JSON[_0x38ab('0x10')](_0xaaa731));if(_0xaaa731[_0x38ab('0x11')]){if(_0xaaa731[_0x38ab('0x11')][_0x38ab('0x12')]===0x1f4){logger[_0x38ab('0x11')](_0x38ab('0xd'),_0x4268e4,_0xaaa731['error'][_0x38ab('0x13')]);return _0x588fe5(_0xaaa731[_0x38ab('0x11')][_0x38ab('0x13')]);}logger[_0x38ab('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4268e4,_0xaaa731['error'][_0x38ab('0x13')]);return _0x22a2ec(_0xaaa731[_0x38ab('0x11')][_0x38ab('0x13')]);}else{logger[_0x38ab('0x14')](_0x38ab('0xd'),_0x4268e4,'request\x20sent');_0x22a2ec(_0xaaa731[_0x38ab('0x15')][_0x38ab('0x13')]);}})[_0x38ab('0x16')](function(_0xbc8f44){logger[_0x38ab('0x11')](_0x38ab('0xd'),_0x4268e4,_0xbc8f44);_0x588fe5(_0xbc8f44);});});}exports[_0x38ab('0x17')]=function(_0x420948){var _0x4eb211=this;return new Promise(function(_0x58ff93,_0x1a75fd){return db[_0x38ab('0x18')]['findOne']({'raw':!![],'where':{'ContactId':_0x420948[_0x38ab('0x19')][_0x38ab('0x1a')],'ListId':_0x420948[_0x38ab('0x19')][_0x38ab('0x1b')],'VoiceQueueId':_0x420948[_0x38ab('0x19')][_0x38ab('0x1c')]===undefined?null:_0x420948[_0x38ab('0x19')][_0x38ab('0x1c')],'CampaignId':_0x420948[_0x38ab('0x19')][_0x38ab('0x1d')]===undefined?null:_0x420948[_0x38ab('0x19')][_0x38ab('0x1d')]}})[_0x38ab('0xc')](function(_0x56f2da){if(_0x56f2da!=null){return db[_0x38ab('0x1e')][_0x38ab('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x56f2da['id'],'OrderBy':{'$gt':_0x56f2da[_0x38ab('0x20')]}},'order':[[_0x38ab('0x20'),'ASC']]})[_0x38ab('0xc')](function(_0x520b25){var _0xa45dd3=0x0;if(_0x520b25){if(_0x520b25[_0x38ab('0x21')]+_0x520b25[_0x38ab('0x22')]+_0x520b25[_0x38ab('0x23')]+_0x520b25['countnosuchnumberretry']+_0x520b25[_0x38ab('0x24')]+_0x520b25['countabandonedretry']+_0x520b25[_0x38ab('0x25')]+_0x520b25[_0x38ab('0x26')]<_0x420948['entity'][_0x38ab('0x27')])_0xa45dd3=0x1;_0x58ff93({'additional':_0xa45dd3});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x56f2da['id']},'order':[[_0x38ab('0x20'),_0x38ab('0x28')]]})['then'](function(_0xe362fd){var _0x550189=0x0;if(_0xe362fd){if(_0xe362fd[_0x38ab('0x21')]+_0xe362fd[_0x38ab('0x22')]+_0xe362fd[_0x38ab('0x23')]+_0xe362fd['countnosuchnumberretry']+_0xe362fd[_0x38ab('0x24')]+_0xe362fd['countabandonedretry']+_0xe362fd[_0x38ab('0x25')]+_0xe362fd[_0x38ab('0x26')]<_0x420948[_0x38ab('0x29')][_0x38ab('0x27')])_0x550189=0x1;_0x58ff93({'additional':_0x550189});}else{_0x58ff93({'additional':0x0});}})[_0x38ab('0x16')](function(_0x559ec2){logger[_0x38ab('0x11')](_0x38ab('0x17'),_0x559ec2[_0x38ab('0x13')]);_0x1a75fd(_0x4eb211[_0x38ab('0x11')](0x1f4,_0x559ec2[_0x38ab('0x13')]));});}})[_0x38ab('0x16')](function(_0x3216f5){logger[_0x38ab('0x11')](_0x38ab('0x17'),_0x3216f5[_0x38ab('0x13')]);_0x1a75fd(_0x4eb211[_0x38ab('0x11')](0x1f4,_0x3216f5[_0x38ab('0x13')]));});}else _0x58ff93({'additional':0x0});});});};exports[_0x38ab('0x2a')]=function(_0x3588c7){var _0x5c6861=this;return new Promise(function(_0x4b676e,_0x52305c){return db[_0x38ab('0x18')]['findOne']({'raw':!![],'where':{'ContactId':_0x3588c7[_0x38ab('0x19')][_0x38ab('0x1a')],'ListId':_0x3588c7[_0x38ab('0x19')][_0x38ab('0x1b')],'VoiceQueueId':_0x3588c7[_0x38ab('0x19')]['VoiceQueueId']===undefined?null:_0x3588c7[_0x38ab('0x19')]['VoiceQueueId'],'CampaignId':_0x3588c7[_0x38ab('0x19')][_0x38ab('0x1d')]===undefined?null:_0x3588c7[_0x38ab('0x19')][_0x38ab('0x1d')]}})[_0x38ab('0xc')](function(_0x52c2f0){if(_0x52c2f0!=null){return db[_0x38ab('0x1e')][_0x38ab('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x52c2f0['id'],'OrderBy':{'$gte':_0x52c2f0[_0x38ab('0x20')]}},'order':[[_0x38ab('0x20'),'ASC']]})[_0x38ab('0xc')](function(_0x58e4a3){if(_0x58e4a3)return activateAdditionalPhone(_0x52c2f0,_0x3588c7[_0x38ab('0x19')],_0x58e4a3,_0x3588c7[_0x38ab('0x2b')],_0x3588c7[_0x38ab('0x2c')])['then'](function(_0x3b97fb){_0x4b676e(_0x3b97fb);});else{return db[_0x38ab('0x1e')][_0x38ab('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x52c2f0['id']},'order':[[_0x38ab('0x20'),_0x38ab('0x28')]]})['then'](function(_0x4255cf){if(_0x4255cf)return activateAdditionalPhone(_0x52c2f0,_0x3588c7[_0x38ab('0x19')],_0x4255cf,_0x3588c7[_0x38ab('0x2b')],_0x3588c7[_0x38ab('0x2c')])[_0x38ab('0xc')](function(_0x3d2d92){_0x4b676e(_0x3d2d92);});else{_0x4b676e({'id':_0x52c2f0['id'],'phone':''});}})[_0x38ab('0x16')](function(_0xb56cde){logger[_0x38ab('0x11')](_0x38ab('0x17'),_0xb56cde['message']);_0x52305c(_0x5c6861[_0x38ab('0x11')](0x1f4,_0xb56cde['message']));});}})[_0x38ab('0x16')](function(_0x12a0c4){logger[_0x38ab('0x11')](_0x38ab('0x17'),_0x12a0c4['message']);_0x52305c(_0x5c6861['error'](0x1f4,_0x12a0c4['message']));});}else _0x4b676e(0x1);});});};function activateAdditionalPhone(_0x157317,_0x3ef80e,_0x5cb218,_0x46acc0,_0x4f06f3){return new Promise(function(_0x1f1e9d,_0x57cabf){var _0x26e71c;if(_['isNil'](_0x5cb218[_0x38ab('0x2d')])){_0x5cb218['scheduledat']=moment();}if(moment()>moment(_0x5cb218[_0x38ab('0x2d')])){_0x26e71c=moment()[_0x38ab('0x2e')](_0x4f06f3||0x3,_0x38ab('0x2f'));}else{if(_0x5cb218[_0x38ab('0x20')]==0x0){_0x26e71c=moment(_0x5cb218[_0x38ab('0x2d')]);}else{_0x26e71c=moment()[_0x38ab('0x2e')](_0x4f06f3||0x3,'minutes');}}if(_[_0x38ab('0x30')](_0x26e71c)){_0x26e71c=moment()[_0x38ab('0x2e')](_0x4f06f3||0x3,_0x38ab('0x2f'));}var _0x4c9a82={'phone':_0x157317['phone'],'active':0x0,'OrderBy':_[_0x38ab('0x30')](_0x157317[_0x38ab('0x20')])?0x0:_0x157317[_0x38ab('0x20')],'scheduledat':moment()[_0x38ab('0x2e')](_0x46acc0||0x1,_0x38ab('0x2f')),'countbusyretry':_0x3ef80e['countbusyretry'],'countcongestionretry':_0x3ef80e[_0x38ab('0x22')],'countnoanswerretry':_0x3ef80e[_0x38ab('0x23')],'countnosuchnumberretry':_0x3ef80e['countnosuchnumberretry'],'countdropretry':_0x3ef80e[_0x38ab('0x24')],'countabandonedretry':_0x3ef80e[_0x38ab('0x31')],'countmachineretry':_0x3ef80e['countmachineretry'],'countagentrejectretry':_0x3ef80e[_0x38ab('0x26')],'createdAt':_0x3ef80e[_0x38ab('0x32')],'updatedAt':_0x3ef80e[_0x38ab('0x33')]};var _0x5d9856={'CmHopperId':_0x157317['id'],'phone':_0x5cb218['phone'],'active':0x0,'OrderBy':_[_0x38ab('0x30')](_0x5cb218['OrderBy'])?0x0:_0x5cb218['OrderBy'],'scheduledat':_0x26e71c,'countbusyretry':_0x5cb218[_0x38ab('0x21')],'countcongestionretry':_0x5cb218[_0x38ab('0x22')],'countnoanswerretry':_0x5cb218[_0x38ab('0x23')],'countnosuchnumberretry':_0x5cb218[_0x38ab('0x34')],'countdropretry':_0x5cb218[_0x38ab('0x24')],'countabandonedretry':_0x5cb218[_0x38ab('0x31')],'countmachineretry':_0x5cb218[_0x38ab('0x25')],'countagentrejectretry':_0x5cb218[_0x38ab('0x26')],'createdAt':_0x5cb218[_0x38ab('0x32')],'updatedAt':_0x5cb218['updatedAt']};return db['sequelize']['transaction'](function(_0x380888){return db[_0x38ab('0x1e')][_0x38ab('0x35')](_0x4c9a82,{'where':{'id':_0x5cb218['id']}},{'transaction':_0x380888})[_0x38ab('0xc')](function(){return db['CmHopper']['update'](_0x5d9856,{'where':{'id':_0x157317['id']}},{'transaction':_0x380888});});})[_0x38ab('0xc')](function(_0x16d197){_0x1f1e9d({'id':_0x157317['id'],'phone':_0x5cb218[_0x38ab('0x36')]});})[_0x38ab('0x16')](function(_0x490d77){logger[_0x38ab('0x11')]('activateAdditionalPhone',_0x490d77[_0x38ab('0x13')]);_0x57cabf({'error':_0x490d77[_0x38ab('0x13')]});});});}exports[_0x38ab('0x37')]=function(_0x2c37a4){var _0x4541cc=this;return new Promise(function(_0x4aac29,_0x1aa605){return db['CmHopper'][_0x38ab('0x35')](_0x2c37a4[_0x38ab('0x19')][_0x38ab('0x38')],{'where':{'id':_0x2c37a4[_0x38ab('0x19')]['id']}})[_0x38ab('0xc')](function(_0x3515f5){_0x4aac29(_0x3515f5);})['catch'](function(_0x3fae3a){logger['error'](_0x38ab('0x37'),_0x3fae3a[_0x38ab('0x13')]);_0x1aa605(_0x4541cc['error'](0x1f4,_0x3fae3a['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index e2cc10a..35c506c 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd5de=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','put','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5de,0x176));var _0xed5d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd5de[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0xed5d('0x0'));var util=require('util');var path=require(_0xed5d('0x1'));var timeout=require(_0xed5d('0x2'));var express=require(_0xed5d('0x3'));var router=express[_0xed5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed5d('0x5'));var interaction=require(_0xed5d('0x6'));var config=require(_0xed5d('0x7'));var controller=require(_0xed5d('0x8'));router['get']('/',auth[_0xed5d('0x9')](),controller[_0xed5d('0xa')]);router[_0xed5d('0xb')](_0xed5d('0xc'),auth[_0xed5d('0x9')](),controller['show']);router['post']('/',auth[_0xed5d('0x9')](),controller['create']);router[_0xed5d('0xd')](_0xed5d('0xc'),auth[_0xed5d('0x9')](),controller[_0xed5d('0xe')]);router['delete'](_0xed5d('0xc'),auth[_0xed5d('0x9')](),controller[_0xed5d('0xf')]);module[_0xed5d('0x10')]=router; \ No newline at end of file +var _0x70f9=['get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','./cmHopperAdditionalPhone.controller'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x70f9,0x14e));var _0x970f=function(_0x2e2eab,_0x2e609a){_0x2e2eab=_0x2e2eab-0x0;var _0x2357bc=_0x70f9[_0x2e2eab];return _0x2357bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x970f('0x0'));var timeout=require(_0x970f('0x1'));var express=require(_0x970f('0x2'));var router=express['Router']();var fs_extra=require(_0x970f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x970f('0x4'));var config=require('../../config/environment');var controller=require(_0x970f('0x5'));router[_0x970f('0x6')]('/',auth[_0x970f('0x7')](),controller['index']);router[_0x970f('0x6')](_0x970f('0x8'),auth[_0x970f('0x7')](),controller[_0x970f('0x9')]);router[_0x970f('0xa')]('/',auth['isAuthenticated'](),controller[_0x970f('0xb')]);router[_0x970f('0xc')](_0x970f('0x8'),auth[_0x970f('0x7')](),controller[_0x970f('0xd')]);router[_0x970f('0xe')](_0x970f('0x8'),auth[_0x970f('0x7')](),controller[_0x970f('0xf')]);module[_0x970f('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index c74bc5f..0d97fd1 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 _0xd86a=['exports','contactListQueue','INTEGER','moment','sequelize'];(function(_0x4552ea,_0x5c6323){var _0x45499a=function(_0x174340){while(--_0x174340){_0x4552ea['push'](_0x4552ea['shift']());}};_0x45499a(++_0x5c6323);}(_0xd86a,0xf3));var _0xad86=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xd86a[_0x339129];return _0x1570df;};'use strict';var moment=require(_0xad86('0x0'));var Sequelize=require(_0xad86('0x1'));module[_0xad86('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xad86('0x3')},'ListId':{'type':Sequelize[_0xad86('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xad86('0x3')}}; \ No newline at end of file +var _0x2234=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2234,0x16e));var _0x4223=function(_0x1f909a,_0x15d56f){_0x1f909a=_0x1f909a-0x0;var _0x543f16=_0x2234[_0x1f909a];return _0x543f16;};'use strict';var moment=require(_0x4223('0x0'));var Sequelize=require(_0x4223('0x1'));module[_0x4223('0x2')]={'phone':{'type':Sequelize[_0x4223('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4223('0x4')],'unique':_0x4223('0x5')},'ListId':{'type':Sequelize[_0x4223('0x4')],'unique':_0x4223('0x5')},'VoiceQueueId':{'type':Sequelize[_0x4223('0x4')],'unique':_0x4223('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c107645..7d96cf3 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 _0xf3dc=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3dc,0x1a5));var _0xcf3d=function(_0x1e2671,_0x4cf90a){_0x1e2671=_0x1e2671-0x0;var _0x492489=_0xf3dc[_0x1e2671];return _0x492489;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcf3d('0x0'));var jsonpatch=require(_0xcf3d('0x1'));var rp=require(_0xcf3d('0x2'));var moment=require(_0xcf3d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xcf3d('0x4'));var sox=require(_0xcf3d('0x5'));var csv=require(_0xcf3d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf3d('0x7'));var _=require(_0xcf3d('0x8'));var squel=require(_0xcf3d('0x9'));var crypto=require(_0xcf3d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf3d('0x6'));var querystring=require(_0xcf3d('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcf3d('0xc'));var qs=require(_0xcf3d('0xd'));var as=require(_0xcf3d('0xe'));var hardwareService=require(_0xcf3d('0xf'));var logger=require(_0xcf3d('0x10'))(_0xcf3d('0x11'));var utils=require(_0xcf3d('0x12'));var config=require(_0xcf3d('0x13'));var licenseUtil=require(_0xcf3d('0x14'));var db=require(_0xcf3d('0x15'))['db'];function respondWithStatusCode(_0x35ef3f,_0x2986a6){_0x2986a6=_0x2986a6||0xcc;return function(_0x21973d){if(_0x21973d){return _0x35ef3f[_0xcf3d('0x16')](_0x2986a6);}return _0x35ef3f['status'](_0x2986a6)[_0xcf3d('0x17')]();};}function respondWithResult(_0x521e2c,_0x4d5795){_0x4d5795=_0x4d5795||0xc8;return function(_0x39eaee){if(_0x39eaee){return _0x521e2c[_0xcf3d('0x18')](_0x4d5795)['json'](_0x39eaee);}};}function respondWithFilteredResult(_0x172268,_0x755730){return function(_0x331fc1){if(_0x331fc1){var _0x102483=typeof _0x755730[_0xcf3d('0x19')]===_0xcf3d('0x1a')&&typeof _0x755730[_0xcf3d('0x1b')]==='undefined';var _0x43f567=_0x331fc1[_0xcf3d('0x1c')];var _0x523f44=_0x102483?0x0:_0x755730[_0xcf3d('0x19')];var _0x3a4f9f=_0x102483?_0x331fc1[_0xcf3d('0x1c')]:_0x755730['offset']+_0x755730['limit'];var _0x5b49df;if(_0x3a4f9f>=_0x43f567){_0x3a4f9f=_0x43f567;_0x5b49df=0xc8;}else{_0x5b49df=0xce;}_0x172268[_0xcf3d('0x18')](_0x5b49df);return _0x172268[_0xcf3d('0x1d')]('Content-Range',_0x523f44+'-'+_0x3a4f9f+'/'+_0x43f567)[_0xcf3d('0x1e')](_0x331fc1);}return null;};}function patchUpdates(_0x1b7d58){return function(_0x191f86){try{jsonpatch[_0xcf3d('0x1f')](_0x191f86,_0x1b7d58,!![]);}catch(_0x555f4a){return BPromise[_0xcf3d('0x20')](_0x555f4a);}return _0x191f86[_0xcf3d('0x21')]();};}function saveUpdates(_0x4c936b,_0x9f492e){return function(_0x254e2e){if(_0x254e2e){return _0x254e2e[_0xcf3d('0x22')](_0x4c936b)[_0xcf3d('0x23')](function(_0x3136c6){return _0x3136c6;});}return null;};}function removeEntity(_0x175ae6,_0x39fc91){return function(_0x425388){if(_0x425388){return _0x425388[_0xcf3d('0x24')]()[_0xcf3d('0x23')](function(){_0x175ae6[_0xcf3d('0x18')](0xcc)[_0xcf3d('0x17')]();});}};}function handleEntityNotFound(_0x185865,_0x58dae4){return function(_0x3af7fe){if(!_0x3af7fe){_0x185865[_0xcf3d('0x16')](0x194);}return _0x3af7fe;};}function handleError(_0x41dacf,_0x1adafc){_0x1adafc=_0x1adafc||0x1f4;return function(_0x30e3c4){logger[_0xcf3d('0x25')](_0x30e3c4[_0xcf3d('0x26')]);if(_0x30e3c4['name']){delete _0x30e3c4[_0xcf3d('0x27')];}_0x41dacf[_0xcf3d('0x18')](_0x1adafc)[_0xcf3d('0x28')](_0x30e3c4);};}exports[_0xcf3d('0x29')]=function(_0x54dd26,_0x13ee10){var _0x181dc9={},_0xb3b55f={},_0x1ab3c7={'count':0x0,'rows':[]};var _0x2ec466=_[_0xcf3d('0x2a')](db[_0xcf3d('0x2b')][_0xcf3d('0x2c')],function(_0x2e3028){return{'name':_0x2e3028[_0xcf3d('0x2d')],'type':_0x2e3028[_0xcf3d('0x2e')][_0xcf3d('0x2f')]};});_0xb3b55f[_0xcf3d('0x30')]=_[_0xcf3d('0x2a')](_0x2ec466,_0xcf3d('0x27'));_0xb3b55f[_0xcf3d('0x31')]=_[_0xcf3d('0x32')](_0x54dd26[_0xcf3d('0x31')]);_0xb3b55f[_0xcf3d('0x33')]=_['intersection'](_0xb3b55f[_0xcf3d('0x30')],_0xb3b55f[_0xcf3d('0x31')]);_0x181dc9[_0xcf3d('0x34')]=_[_0xcf3d('0x35')](_0xb3b55f[_0xcf3d('0x30')],qs['fields'](_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x36')]));_0x181dc9[_0xcf3d('0x34')]=_0x181dc9['attributes']['length']?_0x181dc9[_0xcf3d('0x34')]:_0xb3b55f['model'];if(!_0x54dd26['query'][_0xcf3d('0x37')](_0xcf3d('0x38'))){_0x181dc9[_0xcf3d('0x1b')]=qs[_0xcf3d('0x1b')](_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x1b')]);_0x181dc9['offset']=qs[_0xcf3d('0x19')](_0x54dd26[_0xcf3d('0x31')]['offset']);}_0x181dc9[_0xcf3d('0x39')]=qs[_0xcf3d('0x3a')](_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x3a')]);_0x181dc9['where']=qs['filters'](_[_0xcf3d('0x3b')](_0x54dd26['query'],_0xb3b55f[_0xcf3d('0x33')]),_0x2ec466);if(_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x3c')]){_0x181dc9['where']=_[_0xcf3d('0x3d')](_0x181dc9[_0xcf3d('0x3e')],{'$or':_[_0xcf3d('0x2a')](_0x2ec466,function(_0x4a4551){if(_0x4a4551[_0xcf3d('0x2e')]!==_0xcf3d('0x3f')){var _0x37cc9f={};_0x37cc9f[_0x4a4551[_0xcf3d('0x27')]]={'$like':'%'+_0x54dd26[_0xcf3d('0x31')]['filter']+'%'};return _0x37cc9f;}})});}_0x181dc9=_[_0xcf3d('0x3d')]({},_0x181dc9,_0x54dd26[_0xcf3d('0x40')]);var _0x564af9={'where':_0x181dc9[_0xcf3d('0x3e')]};return db[_0xcf3d('0x2b')][_0xcf3d('0x1c')](_0x564af9)[_0xcf3d('0x23')](function(_0x4319a5){_0x1ab3c7[_0xcf3d('0x1c')]=_0x4319a5;if(_0x54dd26[_0xcf3d('0x31')][_0xcf3d('0x41')]){_0x181dc9[_0xcf3d('0x42')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x181dc9);})[_0xcf3d('0x23')](function(_0x1150ca){_0x1ab3c7[_0xcf3d('0x43')]=_0x1150ca;return _0x1ab3c7;})[_0xcf3d('0x23')](respondWithFilteredResult(_0x13ee10,_0x181dc9))['catch'](handleError(_0x13ee10,null));};exports[_0xcf3d('0x44')]=function(_0x34bc7,_0x9ca4f0){var _0x306408={'raw':!![],'where':{'id':_0x34bc7[_0xcf3d('0x45')]['id']}},_0x4e7946={};_0x4e7946[_0xcf3d('0x30')]=_['keys'](db['CmHopperBlack'][_0xcf3d('0x2c')]);_0x4e7946[_0xcf3d('0x31')]=_[_0xcf3d('0x32')](_0x34bc7[_0xcf3d('0x31')]);_0x4e7946['filters']=_[_0xcf3d('0x35')](_0x4e7946[_0xcf3d('0x30')],_0x4e7946[_0xcf3d('0x31')]);_0x306408[_0xcf3d('0x34')]=_['intersection'](_0x4e7946[_0xcf3d('0x30')],qs[_0xcf3d('0x36')](_0x34bc7[_0xcf3d('0x31')]['fields']));_0x306408[_0xcf3d('0x34')]=_0x306408['attributes'][_0xcf3d('0x46')]?_0x306408['attributes']:_0x4e7946[_0xcf3d('0x30')];if(_0x34bc7[_0xcf3d('0x31')]['includeAll']){_0x306408[_0xcf3d('0x42')]=[{'all':!![]}];}_0x306408=_['merge']({},_0x306408,_0x34bc7[_0xcf3d('0x40')]);return db[_0xcf3d('0x2b')]['find'](_0x306408)[_0xcf3d('0x23')](handleEntityNotFound(_0x9ca4f0,null))[_0xcf3d('0x23')](respondWithResult(_0x9ca4f0,null))[_0xcf3d('0x47')](handleError(_0x9ca4f0,null));};exports[_0xcf3d('0x22')]=function(_0x94d374,_0x53c2c2){if(_0x94d374[_0xcf3d('0x48')]['id']){delete _0x94d374[_0xcf3d('0x48')]['id'];}return db[_0xcf3d('0x2b')]['find']({'where':{'id':_0x94d374[_0xcf3d('0x45')]['id']}})[_0xcf3d('0x23')](handleEntityNotFound(_0x53c2c2,null))[_0xcf3d('0x23')](saveUpdates(_0x94d374[_0xcf3d('0x48')],null))[_0xcf3d('0x23')](respondWithResult(_0x53c2c2,null))[_0xcf3d('0x47')](handleError(_0x53c2c2,null));};exports[_0xcf3d('0x24')]=function(_0x2b2d05,_0x57010b){return db['CmHopperBlack'][_0xcf3d('0x49')]({'where':{'id':_0x2b2d05[_0xcf3d('0x45')]['id']}})[_0xcf3d('0x23')](handleEntityNotFound(_0x57010b,null))[_0xcf3d('0x23')](removeEntity(_0x57010b,null))[_0xcf3d('0x47')](handleError(_0x57010b,null));};exports[_0xcf3d('0x4a')]=function(_0x5bab28,_0x80c089){return db[_0xcf3d('0x2b')][_0xcf3d('0x4a')]()['then'](respondWithResult(_0x80c089,null))['catch'](handleError(_0x80c089,null));}; \ No newline at end of file +var _0x0af5=['ejs','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopperBlack','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','length','find','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x2d4efc,_0x148c09){var _0x14c7b5=function(_0x46a18a){while(--_0x46a18a){_0x2d4efc['push'](_0x2d4efc['shift']());}};_0x14c7b5(++_0x148c09);}(_0x0af5,0x158));var _0x50af=function(_0x53df17,_0x561dab){_0x53df17=_0x53df17-0x0;var _0x17eefe=_0x0af5[_0x53df17];return _0x17eefe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50af('0x0'));var zipdir=require(_0x50af('0x1'));var jsonpatch=require(_0x50af('0x2'));var rp=require(_0x50af('0x3'));var moment=require(_0x50af('0x4'));var BPromise=require(_0x50af('0x5'));var Mustache=require(_0x50af('0x6'));var util=require(_0x50af('0x7'));var path=require(_0x50af('0x8'));var sox=require(_0x50af('0x9'));var csv=require(_0x50af('0xa'));var ejs=require(_0x50af('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x50af('0xc'));var crypto=require(_0x50af('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50af('0xa'));var querystring=require(_0x50af('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x50af('0xf'));var qs=require(_0x50af('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50af('0x11'));var logger=require(_0x50af('0x12'))(_0x50af('0x13'));var utils=require(_0x50af('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x50af('0x15'));var db=require(_0x50af('0x16'))['db'];function respondWithStatusCode(_0x2792bb,_0x3373bf){_0x3373bf=_0x3373bf||0xcc;return function(_0x252a02){if(_0x252a02){return _0x2792bb[_0x50af('0x17')](_0x3373bf);}return _0x2792bb['status'](_0x3373bf)['end']();};}function respondWithResult(_0x569851,_0x620389){_0x620389=_0x620389||0xc8;return function(_0x561cd2){if(_0x561cd2){return _0x569851[_0x50af('0x18')](_0x620389)[_0x50af('0x19')](_0x561cd2);}};}function respondWithFilteredResult(_0x4fba1c,_0x5c3db3){return function(_0x1378fd){if(_0x1378fd){var _0x13cbf4=typeof _0x5c3db3['offset']==='undefined'&&typeof _0x5c3db3[_0x50af('0x1a')]===_0x50af('0x1b');var _0x33869f=_0x1378fd[_0x50af('0x1c')];var _0x1906e6=_0x13cbf4?0x0:_0x5c3db3[_0x50af('0x1d')];var _0x23bad2=_0x13cbf4?_0x1378fd[_0x50af('0x1c')]:_0x5c3db3[_0x50af('0x1d')]+_0x5c3db3[_0x50af('0x1a')];var _0x5c6f8e;if(_0x23bad2>=_0x33869f){_0x23bad2=_0x33869f;_0x5c6f8e=0xc8;}else{_0x5c6f8e=0xce;}_0x4fba1c[_0x50af('0x18')](_0x5c6f8e);return _0x4fba1c[_0x50af('0x1e')](_0x50af('0x1f'),_0x1906e6+'-'+_0x23bad2+'/'+_0x33869f)[_0x50af('0x19')](_0x1378fd);}return null;};}function patchUpdates(_0x4b0164){return function(_0x2a96fb){try{jsonpatch[_0x50af('0x20')](_0x2a96fb,_0x4b0164,!![]);}catch(_0x4b5e21){return BPromise[_0x50af('0x21')](_0x4b5e21);}return _0x2a96fb[_0x50af('0x22')]();};}function saveUpdates(_0x3b6d04,_0x2d093c){return function(_0xb6de0d){if(_0xb6de0d){return _0xb6de0d[_0x50af('0x23')](_0x3b6d04)[_0x50af('0x24')](function(_0x53e362){return _0x53e362;});}return null;};}function removeEntity(_0x76a6b3,_0x156154){return function(_0x3c6388){if(_0x3c6388){return _0x3c6388[_0x50af('0x25')]()[_0x50af('0x24')](function(){_0x76a6b3[_0x50af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb3c15a,_0x1550ee){return function(_0x5e096d){if(!_0x5e096d){_0xb3c15a[_0x50af('0x17')](0x194);}return _0x5e096d;};}function handleError(_0x3fa2da,_0x311b08){_0x311b08=_0x311b08||0x1f4;return function(_0x5dc58a){logger['error'](_0x5dc58a[_0x50af('0x26')]);if(_0x5dc58a[_0x50af('0x27')]){delete _0x5dc58a[_0x50af('0x27')];}_0x3fa2da[_0x50af('0x18')](_0x311b08)[_0x50af('0x28')](_0x5dc58a);};}exports[_0x50af('0x29')]=function(_0x520bd6,_0x212fc2){var _0x5122e5={},_0x1a1104={},_0x382c5d={'count':0x0,'rows':[]};var _0x4118af=_['map'](db[_0x50af('0x2a')]['rawAttributes'],function(_0xadca5b){return{'name':_0xadca5b['fieldName'],'type':_0xadca5b['type']['key']};});_0x1a1104[_0x50af('0x2b')]=_[_0x50af('0x2c')](_0x4118af,_0x50af('0x27'));_0x1a1104[_0x50af('0x2d')]=_[_0x50af('0x2e')](_0x520bd6[_0x50af('0x2d')]);_0x1a1104[_0x50af('0x2f')]=_[_0x50af('0x30')](_0x1a1104[_0x50af('0x2b')],_0x1a1104[_0x50af('0x2d')]);_0x5122e5['attributes']=_[_0x50af('0x30')](_0x1a1104[_0x50af('0x2b')],qs[_0x50af('0x31')](_0x520bd6[_0x50af('0x2d')][_0x50af('0x31')]));_0x5122e5['attributes']=_0x5122e5[_0x50af('0x32')]['length']?_0x5122e5['attributes']:_0x1a1104['model'];if(!_0x520bd6[_0x50af('0x2d')][_0x50af('0x33')](_0x50af('0x34'))){_0x5122e5[_0x50af('0x1a')]=qs[_0x50af('0x1a')](_0x520bd6['query']['limit']);_0x5122e5[_0x50af('0x1d')]=qs[_0x50af('0x1d')](_0x520bd6[_0x50af('0x2d')][_0x50af('0x1d')]);}_0x5122e5[_0x50af('0x35')]=qs['sort'](_0x520bd6[_0x50af('0x2d')][_0x50af('0x36')]);_0x5122e5[_0x50af('0x37')]=qs[_0x50af('0x2f')](_['pick'](_0x520bd6[_0x50af('0x2d')],_0x1a1104[_0x50af('0x2f')]),_0x4118af);if(_0x520bd6[_0x50af('0x2d')][_0x50af('0x38')]){_0x5122e5[_0x50af('0x37')]=_['merge'](_0x5122e5['where'],{'$or':_['map'](_0x4118af,function(_0x198ec5){if(_0x198ec5[_0x50af('0x39')]!==_0x50af('0x3a')){var _0x194539={};_0x194539[_0x198ec5[_0x50af('0x27')]]={'$like':'%'+_0x520bd6[_0x50af('0x2d')][_0x50af('0x38')]+'%'};return _0x194539;}})});}_0x5122e5=_[_0x50af('0x3b')]({},_0x5122e5,_0x520bd6[_0x50af('0x3c')]);var _0x2d2a3f={'where':_0x5122e5[_0x50af('0x37')]};return db[_0x50af('0x2a')][_0x50af('0x1c')](_0x2d2a3f)[_0x50af('0x24')](function(_0xb96d73){_0x382c5d[_0x50af('0x1c')]=_0xb96d73;if(_0x520bd6['query'][_0x50af('0x3d')]){_0x5122e5[_0x50af('0x3e')]=[{'all':!![]}];}return db[_0x50af('0x2a')]['findAll'](_0x5122e5);})['then'](function(_0x208c88){_0x382c5d[_0x50af('0x3f')]=_0x208c88;return _0x382c5d;})[_0x50af('0x24')](respondWithFilteredResult(_0x212fc2,_0x5122e5))[_0x50af('0x40')](handleError(_0x212fc2,null));};exports[_0x50af('0x41')]=function(_0x2917b7,_0x37bdfc){var _0x3f74bb={'raw':!![],'where':{'id':_0x2917b7['params']['id']}},_0x533d35={};_0x533d35[_0x50af('0x2b')]=_[_0x50af('0x2e')](db['CmHopperBlack']['rawAttributes']);_0x533d35[_0x50af('0x2d')]=_[_0x50af('0x2e')](_0x2917b7[_0x50af('0x2d')]);_0x533d35['filters']=_[_0x50af('0x30')](_0x533d35[_0x50af('0x2b')],_0x533d35[_0x50af('0x2d')]);_0x3f74bb[_0x50af('0x32')]=_[_0x50af('0x30')](_0x533d35[_0x50af('0x2b')],qs[_0x50af('0x31')](_0x2917b7[_0x50af('0x2d')][_0x50af('0x31')]));_0x3f74bb['attributes']=_0x3f74bb[_0x50af('0x32')][_0x50af('0x42')]?_0x3f74bb[_0x50af('0x32')]:_0x533d35[_0x50af('0x2b')];if(_0x2917b7['query']['includeAll']){_0x3f74bb['include']=[{'all':!![]}];}_0x3f74bb=_[_0x50af('0x3b')]({},_0x3f74bb,_0x2917b7[_0x50af('0x3c')]);return db['CmHopperBlack'][_0x50af('0x43')](_0x3f74bb)[_0x50af('0x24')](handleEntityNotFound(_0x37bdfc,null))[_0x50af('0x24')](respondWithResult(_0x37bdfc,null))[_0x50af('0x40')](handleError(_0x37bdfc,null));};exports[_0x50af('0x23')]=function(_0xb64bed,_0x59057e){if(_0xb64bed['body']['id']){delete _0xb64bed[_0x50af('0x44')]['id'];}return db[_0x50af('0x2a')][_0x50af('0x43')]({'where':{'id':_0xb64bed[_0x50af('0x45')]['id']}})[_0x50af('0x24')](handleEntityNotFound(_0x59057e,null))[_0x50af('0x24')](saveUpdates(_0xb64bed['body'],null))[_0x50af('0x24')](respondWithResult(_0x59057e,null))[_0x50af('0x40')](handleError(_0x59057e,null));};exports['destroy']=function(_0x48448e,_0x3ea494){return db[_0x50af('0x2a')][_0x50af('0x43')]({'where':{'id':_0x48448e[_0x50af('0x45')]['id']}})[_0x50af('0x24')](handleEntityNotFound(_0x3ea494,null))[_0x50af('0x24')](removeEntity(_0x3ea494,null))[_0x50af('0x40')](handleError(_0x3ea494,null));};exports[_0x50af('0x46')]=function(_0x173a2a,_0x37ce38){return db['CmHopperBlack'][_0x50af('0x46')]()[_0x50af('0x24')](respondWithResult(_0x37ce38,null))[_0x50af('0x40')](handleError(_0x37ce38,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ac2af71..14e4c9c 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 _0x5dad=['cm_hopper_black','util','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x5cd1c9,_0x5127b3){var _0x5b6728=function(_0x5d0797){while(--_0x5d0797){_0x5cd1c9['push'](_0x5cd1c9['shift']());}};_0x5b6728(++_0x5127b3);}(_0x5dad,0x105));var _0xd5da=function(_0x385432,_0x3ff55a){_0x385432=_0x385432-0x0;var _0x509b08=_0x5dad[_0x385432];return _0x509b08;};'use strict';var _=require('lodash');var util=require(_0xd5da('0x0'));var logger=require('../../config/logger')(_0xd5da('0x1'));var moment=require(_0xd5da('0x2'));var BPromise=require(_0xd5da('0x3'));var rp=require(_0xd5da('0x4'));var fs=require('fs');var path=require(_0xd5da('0x5'));var rimraf=require(_0xd5da('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0xd5da('0x7')]=function(_0x5912ce,_0x3c2fbd){return _0x5912ce[_0xd5da('0x8')]('CmHopperBlack',attributes,{'tableName':_0xd5da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5c=['../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x9d5c,0x11d));var _0xc9d5=function(_0xf50434,_0x61b31c){_0xf50434=_0xf50434-0x0;var _0x580ee5=_0x9d5c[_0xf50434];return _0x580ee5;};'use strict';var _=require(_0xc9d5('0x0'));var util=require('util');var logger=require(_0xc9d5('0x1'))(_0xc9d5('0x2'));var moment=require(_0xc9d5('0x3'));var BPromise=require(_0xc9d5('0x4'));var rp=require(_0xc9d5('0x5'));var fs=require('fs');var path=require(_0xc9d5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc9d5('0x7'));module[_0xc9d5('0x8')]=function(_0x44c80b,_0x5ba40e){return _0x44c80b[_0xc9d5('0x9')]('CmHopperBlack',attributes,{'tableName':_0xc9d5('0xa'),'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 86e266c..bec68aa 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 _0x1844=['UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','stringify'];(function(_0x29b37f,_0x50117a){var _0x3025eb=function(_0x50b857){while(--_0x50b857){_0x29b37f['push'](_0x29b37f['shift']());}};_0x3025eb(++_0x50117a);}(_0x1844,0x1da));var _0x4184=function(_0x3acf41,_0x12370b){_0x3acf41=_0x3acf41-0x0;var _0x4a72f1=_0x1844[_0x3acf41];return _0x4a72f1;};'use strict';var _=require(_0x4184('0x0'));var util=require('util');var moment=require(_0x4184('0x1'));var BPromise=require(_0x4184('0x2'));var rs=require(_0x4184('0x3'));var fs=require('fs');var Redis=require(_0x4184('0x4'));var db=require(_0x4184('0x5'))['db'];var utils=require(_0x4184('0x6'));var logger=require(_0x4184('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4184('0x8'));var client=jayson[_0x4184('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279832,_0x37e57f,_0xc8d2d8){return new BPromise(function(_0x1be8bd,_0x29b779){return client[_0x4184('0xa')](_0x279832,_0xc8d2d8)[_0x4184('0xb')](function(_0x153027){logger[_0x4184('0xc')](_0x4184('0xd'),_0x37e57f,'request\x20sent');logger[_0x4184('0xe')](_0x4184('0xf'),_0x37e57f,_0x4184('0x10'),JSON['stringify'](_0x153027));if(_0x153027[_0x4184('0x11')]){if(_0x153027[_0x4184('0x11')][_0x4184('0x12')]===0x1f4){logger[_0x4184('0x11')](_0x4184('0xd'),_0x37e57f,_0x153027[_0x4184('0x11')][_0x4184('0x13')]);return _0x29b779(_0x153027['error'][_0x4184('0x13')]);}logger[_0x4184('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x37e57f,_0x153027[_0x4184('0x11')]['message']);return _0x1be8bd(_0x153027[_0x4184('0x11')]['message']);}else{logger['info'](_0x4184('0xd'),_0x37e57f,'request\x20sent');_0x1be8bd(_0x153027[_0x4184('0x14')][_0x4184('0x13')]);}})[_0x4184('0x15')](function(_0x51a597){logger[_0x4184('0x11')](_0x4184('0xd'),_0x37e57f,_0x51a597);_0x29b779(_0x51a597);});});}exports[_0x4184('0x16')]=function(_0x1d9d06){var _0x1951ca=this;return new Promise(function(_0x5cafeb,_0x3d4ea1){return db['CmHopperBlack'][_0x4184('0x17')]({'raw':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06[_0x4184('0x18')][_0x4184('0x19')]===undefined?!![]:![]:!![],'where':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06['options'][_0x4184('0x1a')]||null:null,'attributes':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06[_0x4184('0x18')][_0x4184('0x1b')]||null:null,'limit':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06['options'][_0x4184('0x1c')]||null:null,'include':_0x1d9d06[_0x4184('0x18')]?_0x1d9d06[_0x4184('0x18')][_0x4184('0x1d')]?_[_0x4184('0x1e')](_0x1d9d06['options'][_0x4184('0x1d')],function(_0x3021ae){return{'model':db[_0x3021ae[_0x4184('0x1f')]],'as':_0x3021ae['as'],'attributes':_0x3021ae['attributes'],'include':_0x3021ae[_0x4184('0x1d')]?_[_0x4184('0x1e')](_0x3021ae[_0x4184('0x1d')],function(_0x4ee1ab){return{'model':db[_0x4ee1ab['model']],'as':_0x4ee1ab['as'],'attributes':_0x4ee1ab[_0x4184('0x1b')],'include':_0x4ee1ab[_0x4184('0x1d')]?_[_0x4184('0x1e')](_0x4ee1ab[_0x4184('0x1d')],function(_0x20fd2b){return{'model':db[_0x20fd2b[_0x4184('0x1f')]],'as':_0x20fd2b['as'],'attributes':_0x20fd2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4184('0xb')](function(_0x7766c1){logger[_0x4184('0xc')](_0x4184('0x16'),_0x1d9d06);logger[_0x4184('0xe')](_0x4184('0x16'),_0x1d9d06,JSON[_0x4184('0x20')](_0x7766c1));_0x5cafeb(_0x7766c1);})['catch'](function(_0x1e2677){logger[_0x4184('0x11')](_0x4184('0x16'),_0x1e2677[_0x4184('0x13')],_0x1d9d06);_0x3d4ea1(_0x1951ca['error'](0x1f4,_0x1e2677[_0x4184('0x13')]));});});};exports[_0x4184('0x21')]=function(_0x57b801){var _0x5bc092=this;return new Promise(function(_0x2057df,_0xe4749a){return db[_0x4184('0x22')][_0x4184('0x23')](_0x57b801[_0x4184('0x24')],{'raw':_0x57b801[_0x4184('0x18')]?_0x57b801[_0x4184('0x18')][_0x4184('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57b801['options']?_0x57b801[_0x4184('0x18')]['where']||null:null,'attributes':_0x57b801[_0x4184('0x18')]?_0x57b801[_0x4184('0x18')][_0x4184('0x1b')]||null:null,'limit':_0x57b801[_0x4184('0x18')]?_0x57b801[_0x4184('0x18')][_0x4184('0x1c')]||null:null})[_0x4184('0xb')](function(_0x2b1a0a){logger[_0x4184('0xc')](_0x4184('0x21'),_0x57b801);logger[_0x4184('0xe')](_0x4184('0x21'),_0x57b801,JSON['stringify'](_0x2b1a0a));_0x2057df(_0x2b1a0a);})[_0x4184('0x15')](function(_0x11f9d2){logger[_0x4184('0x11')]('UpdateCmHopperBlack',_0x11f9d2[_0x4184('0x13')],_0x57b801);_0xe4749a(_0x5bc092[_0x4184('0x11')](0x1f4,_0x11f9d2['message']));});});};exports[_0x4184('0x25')]=function(_0x4eccbb){var _0x58a754=this;return new Promise(function(_0x294e12,_0x28048e){return db[_0x4184('0x22')][_0x4184('0x26')]({'where':_0x4eccbb[_0x4184('0x18')]?_0x4eccbb[_0x4184('0x18')][_0x4184('0x1a')]||null:null})['then'](function(_0x20d2d6){logger[_0x4184('0xc')](_0x4184('0x25'),_0x4eccbb);logger['debug']('DestroyCmHopperBlack',_0x4eccbb,JSON['stringify'](_0x20d2d6));_0x294e12(_0x20d2d6);})[_0x4184('0x15')](function(_0x4af8ae){logger['error']('DestroyCmHopperBlack',_0x4af8ae['message'],_0x4eccbb);_0x28048e(_0x58a754['error'](0x1f4,_0x4af8ae['message']));});});}; \ No newline at end of file +var _0xec62=['model','UpdateCmHopperBlack','update','debug','catch','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','CmHopperBlack,\x20%s,\x20%s','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','attributes','map'];(function(_0x1cbf0f,_0x51d421){var _0x16d41c=function(_0x43235c){while(--_0x43235c){_0x1cbf0f['push'](_0x1cbf0f['shift']());}};_0x16d41c(++_0x51d421);}(_0xec62,0x7c));var _0x2ec6=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0xec62[_0x55ef8b];return _0x359c84;};'use strict';var _=require(_0x2ec6('0x0'));var util=require(_0x2ec6('0x1'));var moment=require(_0x2ec6('0x2'));var BPromise=require(_0x2ec6('0x3'));var rs=require(_0x2ec6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ec6('0x5'))['db'];var utils=require(_0x2ec6('0x6'));var logger=require(_0x2ec6('0x7'))('rpc');var config=require(_0x2ec6('0x8'));var jayson=require(_0x2ec6('0x9'));var client=jayson['client'][_0x2ec6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12d033,_0x157484,_0x16e08a){return new BPromise(function(_0x4b8809,_0x35fb1e){return client[_0x2ec6('0xb')](_0x12d033,_0x16e08a)[_0x2ec6('0xc')](function(_0x40a345){logger[_0x2ec6('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x157484,_0x2ec6('0xe'));logger['debug'](_0x2ec6('0xf'),_0x157484,_0x2ec6('0xe'),JSON[_0x2ec6('0x10')](_0x40a345));if(_0x40a345['error']){if(_0x40a345['error'][_0x2ec6('0x11')]===0x1f4){logger[_0x2ec6('0x12')](_0x2ec6('0x13'),_0x157484,_0x40a345[_0x2ec6('0x12')]['message']);return _0x35fb1e(_0x40a345[_0x2ec6('0x12')][_0x2ec6('0x14')]);}logger[_0x2ec6('0x12')](_0x2ec6('0x13'),_0x157484,_0x40a345[_0x2ec6('0x12')][_0x2ec6('0x14')]);return _0x4b8809(_0x40a345[_0x2ec6('0x12')][_0x2ec6('0x14')]);}else{logger[_0x2ec6('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x157484,_0x2ec6('0xe'));_0x4b8809(_0x40a345[_0x2ec6('0x15')][_0x2ec6('0x14')]);}})['catch'](function(_0x3af710){logger[_0x2ec6('0x12')](_0x2ec6('0x13'),_0x157484,_0x3af710);_0x35fb1e(_0x3af710);});});}exports[_0x2ec6('0x16')]=function(_0x10e421){var _0x580212=this;return new Promise(function(_0x508e19,_0xb53789){return db[_0x2ec6('0x17')][_0x2ec6('0x18')]({'raw':_0x10e421[_0x2ec6('0x19')]?_0x10e421[_0x2ec6('0x19')][_0x2ec6('0x1a')]===undefined?!![]:![]:!![],'where':_0x10e421[_0x2ec6('0x19')]?_0x10e421[_0x2ec6('0x19')][_0x2ec6('0x1b')]||null:null,'attributes':_0x10e421[_0x2ec6('0x19')]?_0x10e421[_0x2ec6('0x19')]['attributes']||null:null,'limit':_0x10e421['options']?_0x10e421[_0x2ec6('0x19')][_0x2ec6('0x1c')]||null:null,'include':_0x10e421[_0x2ec6('0x19')]?_0x10e421['options'][_0x2ec6('0x1d')]?_['map'](_0x10e421['options']['include'],function(_0x5b2ea5){return{'model':db[_0x5b2ea5['model']],'as':_0x5b2ea5['as'],'attributes':_0x5b2ea5[_0x2ec6('0x1e')],'include':_0x5b2ea5[_0x2ec6('0x1d')]?_[_0x2ec6('0x1f')](_0x5b2ea5[_0x2ec6('0x1d')],function(_0x3da05f){return{'model':db[_0x3da05f[_0x2ec6('0x20')]],'as':_0x3da05f['as'],'attributes':_0x3da05f['attributes'],'include':_0x3da05f['include']?_[_0x2ec6('0x1f')](_0x3da05f[_0x2ec6('0x1d')],function(_0x1d8681){return{'model':db[_0x1d8681[_0x2ec6('0x20')]],'as':_0x1d8681['as'],'attributes':_0x1d8681[_0x2ec6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2ec6('0xc')](function(_0x24ecb9){logger[_0x2ec6('0xd')](_0x2ec6('0x16'),_0x10e421);logger['debug'](_0x2ec6('0x16'),_0x10e421,JSON[_0x2ec6('0x10')](_0x24ecb9));_0x508e19(_0x24ecb9);})['catch'](function(_0x170e3f){logger[_0x2ec6('0x12')](_0x2ec6('0x16'),_0x170e3f[_0x2ec6('0x14')],_0x10e421);_0xb53789(_0x580212[_0x2ec6('0x12')](0x1f4,_0x170e3f[_0x2ec6('0x14')]));});});};exports[_0x2ec6('0x21')]=function(_0x6584e1){var _0x2f1b1c=this;return new Promise(function(_0x5af409,_0x5e97af){return db[_0x2ec6('0x17')][_0x2ec6('0x22')](_0x6584e1['body'],{'raw':_0x6584e1[_0x2ec6('0x19')]?_0x6584e1['options'][_0x2ec6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6584e1[_0x2ec6('0x19')]?_0x6584e1[_0x2ec6('0x19')][_0x2ec6('0x1b')]||null:null,'attributes':_0x6584e1['options']?_0x6584e1[_0x2ec6('0x19')][_0x2ec6('0x1e')]||null:null,'limit':_0x6584e1['options']?_0x6584e1['options']['limit']||null:null})['then'](function(_0x1cfba1){logger['info'](_0x2ec6('0x21'),_0x6584e1);logger[_0x2ec6('0x23')](_0x2ec6('0x21'),_0x6584e1,JSON[_0x2ec6('0x10')](_0x1cfba1));_0x5af409(_0x1cfba1);})[_0x2ec6('0x24')](function(_0x3c9684){logger['error'](_0x2ec6('0x21'),_0x3c9684[_0x2ec6('0x14')],_0x6584e1);_0x5e97af(_0x2f1b1c[_0x2ec6('0x12')](0x1f4,_0x3c9684[_0x2ec6('0x14')]));});});};exports[_0x2ec6('0x25')]=function(_0x2b16ec){var _0x4bb10e=this;return new Promise(function(_0x50b52f,_0x396342){return db['CmHopperBlack'][_0x2ec6('0x26')]({'where':_0x2b16ec['options']?_0x2b16ec[_0x2ec6('0x19')]['where']||null:null})['then'](function(_0x3a25aa){logger['info']('DestroyCmHopperBlack',_0x2b16ec);logger[_0x2ec6('0x23')]('DestroyCmHopperBlack',_0x2b16ec,JSON['stringify'](_0x3a25aa));_0x50b52f(_0x3a25aa);})['catch'](function(_0x2cd87f){logger['error'](_0x2ec6('0x25'),_0x2cd87f['message'],_0x2b16ec);_0x396342(_0x4bb10e[_0x2ec6('0x12')](0x1f4,_0x2cd87f['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 938ba1e..b294acc 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 _0x4fb4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0xb49cb8,_0x39474b){var _0x879ead=function(_0x596639){while(--_0x596639){_0xb49cb8['push'](_0xb49cb8['shift']());}};_0x879ead(++_0x39474b);}(_0x4fb4,0x190));var _0x44fb=function(_0x3e71d5,_0xd5fcd2){_0x3e71d5=_0x3e71d5-0x0;var _0x92f22a=_0x4fb4[_0x3e71d5];return _0x92f22a;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4fb4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0x3d71ba,_0x49a38b){var _0x5e0ed0=function(_0x4d0bfb){while(--_0x4d0bfb){_0x3d71ba['push'](_0x3d71ba['shift']());}};_0x5e0ed0(++_0x49a38b);}(_0x4fb4,0x190));var _0x44fb=function(_0x4818c,_0x293e26){_0x4818c=_0x4818c-0x0;var _0x59c621=_0x4fb4[_0x4818c];return _0x59c621;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 46b02c5..aa05253 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 _0xd8e1=['INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','DATE'];(function(_0x52c38c,_0x5f059f){var _0x2cc213=function(_0x5bf78d){while(--_0x5bf78d){_0x52c38c['push'](_0x52c38c['shift']());}};_0x2cc213(++_0x5f059f);}(_0xd8e1,0x7e));var _0x1d8e=function(_0x4264ee,_0x520320){_0x4264ee=_0x4264ee-0x0;var _0x46d043=_0xd8e1[_0x4264ee];return _0x46d043;};'use strict';var Sequelize=require(_0x1d8e('0x0'));var moment=require(_0x1d8e('0x1'));module[_0x1d8e('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1d8e('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1d8e('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x1d8e('0x5')]},'originatecalleridname':{'type':Sequelize[_0x1d8e('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1d8e('0x5')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1d8e('0x3')]},'answertime':{'type':Sequelize[_0x1d8e('0x3')]},'droptime':{'type':Sequelize[_0x1d8e('0x3')]},'endtime':{'type':Sequelize[_0x1d8e('0x3')]},'ringtime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1d8e('0x5')]},'campaign':{'type':Sequelize[_0x1d8e('0x5')]},'campaigntype':{'type':Sequelize[_0x1d8e('0x5')]},'membername':{'type':Sequelize[_0x1d8e('0x5')]},'reason':{'type':Sequelize[_0x1d8e('0x5')]},'disposition':{'type':Sequelize[_0x1d8e('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1d8e('0x5')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x3be18f){var _0x250129=this[_0x1d8e('0x6')](_0x1d8e('0x7'));if(_0x250129&&_0x3be18f){this[_0x1d8e('0x8')](_0x1d8e('0x9'),moment(_0x3be18f)[_0x1d8e('0xa')](moment(_0x250129),_0x1d8e('0xb')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1d8e('0x3')]},'callback':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1d8e('0x3')]},'deleted':{'type':Sequelize[_0x1d8e('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1d8e('0x3')]},'recallme':{'type':Sequelize[_0x1d8e('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1d8e('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1d8e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6c40=['followuptime','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c40,0x147));var _0x06c4=function(_0x8e7c57,_0x396e48){_0x8e7c57=_0x8e7c57-0x0;var _0x4e2ea2=_0x6c40[_0x8e7c57];return _0x4e2ea2;};'use strict';var Sequelize=require(_0x06c4('0x0'));var moment=require(_0x06c4('0x1'));module[_0x06c4('0x2')]={'state':{'type':Sequelize[_0x06c4('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x06c4('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x06c4('0x4')]},'originatecalleridname':{'type':Sequelize[_0x06c4('0x4')]},'calleridnum':{'type':Sequelize[_0x06c4('0x4')]},'calleridname':{'type':Sequelize[_0x06c4('0x4')]},'starttime':{'type':Sequelize[_0x06c4('0x5')]},'responsetime':{'type':Sequelize[_0x06c4('0x5')]},'answertime':{'type':Sequelize[_0x06c4('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x06c4('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x06c4('0x4')]},'campaign':{'type':Sequelize[_0x06c4('0x4')]},'campaigntype':{'type':Sequelize[_0x06c4('0x4')]},'membername':{'type':Sequelize[_0x06c4('0x4')]},'reason':{'type':Sequelize[_0x06c4('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x06c4('0x4')]},'thirdDisposition':{'type':Sequelize[_0x06c4('0x4')]},'dispositionat':{'type':Sequelize[_0x06c4('0x5')],'set':function(_0xf9ef30){var _0x5e8473=this[_0x06c4('0x6')](_0x06c4('0x7'));if(_0x5e8473&&_0xf9ef30){this[_0x06c4('0x8')](_0x06c4('0x9'),moment(_0xf9ef30)['diff'](moment(_0x5e8473),_0x06c4('0xa')));}}},'amd':{'type':Sequelize[_0x06c4('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x06c4('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x06c4('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x06c4('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x06c4('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x06c4('0x5')]},'recallme':{'type':Sequelize[_0x06c4('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x06c4('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x06c4('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 07e5e1a..5c66b95 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 _0xda19=['map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperFinal','includeAll','findAll','catch','show','uniqueid','body','find','params','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','fromQuery','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','ListId','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send'];(function(_0x298b0d,_0x1f3a6a){var _0x3c3a87=function(_0x38c989){while(--_0x38c989){_0x298b0d['push'](_0x298b0d['shift']());}};_0x3c3a87(++_0x1f3a6a);}(_0xda19,0xd5));var _0x9da1=function(_0x193bdc,_0x9734ea){_0x193bdc=_0x193bdc-0x0;var _0x21ba96=_0xda19[_0x193bdc];return _0x21ba96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['CmHopperFinal'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['describe']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['describe']()[_0x9da1('0x24')](respondWithResult(_0x351d4d,null))['catch'](handleError(_0x351d4d,null));};exports['update']=function(_0xfbdde9,_0x43c47d){if(_0xfbdde9['body'][_0x9da1('0x43')]){delete _0xfbdde9[_0x9da1('0x44')]['uniqueid'];}return db[_0x9da1('0x3e')][_0x9da1('0x45')]({'where':{'uniqueid':_0xfbdde9[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x43c47d,null))[_0x9da1('0x24')](saveUpdates(_0xfbdde9[_0x9da1('0x44')],null))[_0x9da1('0x24')](respondWithResult(_0x43c47d,null))[_0x9da1('0x41')](handleError(_0x43c47d,null));};exports[_0x9da1('0x47')]=function(_0x5c9b46,_0x147c65,_0xe6c667){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x5c9b46['params']['id']},'attributes':[[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4b')))),_0x9da1('0x4c')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x4d')))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),'busyContacts'],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db['sequelize']['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0x9da1('0x55')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x147c65,null))[_0x9da1('0x24')](respondWithResult(_0x147c65,null))[_0x9da1('0x41')](handleError(_0x147c65,null));};exports[_0x9da1('0x57')]=function(_0x562e05,_0x1a9df0,_0x5c236e){return db[_0x9da1('0x3e')][_0x9da1('0x40')]({'raw':![],'where':{'CampaignId':_0x562e05[_0x9da1('0x46')]['id']},'attributes':[[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x4b')))),'noSuchContacts'],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize'][_0x9da1('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x9da1('0x4e')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')]['literal'](_0x9da1('0x4f')))),_0x9da1('0x58')],[db['sequelize']['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x50')))),_0x9da1('0x51')],[db[_0x9da1('0x49')]['fn']('COUNT',db[_0x9da1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x9da1('0x59')))),_0x9da1('0x52')],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x53')))),_0x9da1('0x54')],[db['sequelize']['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x5a')))),'reCallContacts'],[db[_0x9da1('0x49')]['fn'](_0x9da1('0x48'),db[_0x9da1('0x49')]['fn']('IF',db[_0x9da1('0x49')][_0x9da1('0x4a')](_0x9da1('0x56')))),'answeringMachine']]})[_0x9da1('0x24')](handleEntityNotFound(_0x1a9df0,null))['then'](respondWithResult(_0x1a9df0,null))[_0x9da1('0x41')](handleError(_0x1a9df0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x7cfa7e,_0xdd3997,_0x44b6c0){return db[_0x9da1('0x5b')]['find']({'where':{'id':_0x7cfa7e['params']['id']}})['then'](handleEntityNotFound(_0xdd3997,null))[_0x9da1('0x24')](function(_0x2b1a71){var _0x266533;if(_0x2b1a71){_0x266533=squel[_0x9da1('0x5c')]()['into']('cm_hopper')[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),'ContactId','ListId',_0x9da1('0x60'),_0x9da1('0x61'),_0x9da1('0x62')],squel['select']()['field'](_0x9da1('0x63'),_0x9da1('0x5e'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))['field'](_0x9da1('0x66'),_0x9da1('0x67'))[_0x9da1('0x64')](_0x9da1('0x68'),'ListId')[_0x9da1('0x64')](_0x9da1('0x69'),_0x9da1('0x60'))['field'](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')]('NOW()',_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')]('VoiceQueueId\x20=\x20?',_0x7cfa7e[_0x9da1('0x46')]['id']['toString']())[_0x9da1('0x38')](_0x9da1('0x6b'),_0x7cfa7e[_0x9da1('0x44')][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x5e'))[_0x9da1('0x6a')]('cm_hopper')[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('calleridnum')['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x71'),_0x7cfa7e[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))[_0x9da1('0x74')](_0x9da1('0x67')))[_0x9da1('0x6d')]();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x266533);}return[];})[_0x9da1('0x24')](respondWithResult(_0xdd3997,null))['catch'](handleError(_0xdd3997,null));};exports[_0x9da1('0x75')]=function(_0x3a0a84,_0x3f9782,_0x30b6fc){return db[_0x9da1('0x76')]['find']({'where':{'id':_0x3a0a84[_0x9da1('0x46')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x3f9782,null))['then'](function(_0x33b625){var _0x5a0533;if(_0x33b625){_0x5a0533=squel[_0x9da1('0x5c')]()['into'](_0x9da1('0x77'))[_0x9da1('0x5d')]([_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x67'),_0x9da1('0x78'),_0x9da1('0x79'),_0x9da1('0x61'),_0x9da1('0x62')],squel[_0x9da1('0x70')]()[_0x9da1('0x64')](_0x9da1('0x63'),'phone')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x5f'))[_0x9da1('0x64')](_0x9da1('0x66'),_0x9da1('0x67'))['field']('ANY_VALUE(ListId)',_0x9da1('0x78'))[_0x9da1('0x64')](_0x9da1('0x7a'),'CampaignId')[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x61'))[_0x9da1('0x64')](_0x9da1('0x65'),_0x9da1('0x62'))[_0x9da1('0x6a')]('cm_hopper_final')[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84['params']['id']['toString']())[_0x9da1('0x38')]('state\x20=\x20?',_0x3a0a84['body'][_0x9da1('0x6c')][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x6e'))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()[_0x9da1('0x64')]('phone')['from'](_0x9da1('0x77'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]()))[_0x9da1('0x38')](_0x9da1('0x6f'),squel[_0x9da1('0x70')]()['field'](_0x9da1('0x7c'))['from'](_0x9da1('0x72'))[_0x9da1('0x38')](_0x9da1('0x7b'),_0x3a0a84[_0x9da1('0x46')]['id'][_0x9da1('0x6d')]())[_0x9da1('0x38')](_0x9da1('0x73')))['group'](_0x9da1('0x67')))['toString']();return db[_0x9da1('0x49')][_0x9da1('0x2e')](_0x5a0533);}return[];})[_0x9da1('0x24')](respondWithResult(_0x3f9782,null))[_0x9da1('0x41')](handleError(_0x3f9782,null));};exports['checkContactHopper']=function(_0x3310af,_0x1f93bf,_0x2afe1e){return db[_0x9da1('0x7d')][_0x9da1('0x7e')]({'where':{'VoiceQueueId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x60')],'CampaignId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x79')],'ContactId':_0x3310af[_0x9da1('0x44')][_0x9da1('0x67')]}})[_0x9da1('0x24')](handleEntityNotFound(_0x1f93bf,null))[_0x9da1('0x24')](function(_0x32ff53){if(_0x32ff53){return _0x32ff53;}return null;})['then'](respondWithResult(_0x1f93bf,null))[_0x9da1('0x41')](handleError(_0x1f93bf,null));}; \ No newline at end of file +var _0x7c09=['sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','noAnswerContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','state\x20=\x204','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x3e14d5,_0x335926){var _0x2f9742=function(_0x55e290){while(--_0x55e290){_0x3e14d5['push'](_0x3e14d5['shift']());}};_0x2f9742(++_0x335926);}(_0x7c09,0x102));var _0x97c0=function(_0x219ef6,_0x4de6c7){_0x219ef6=_0x219ef6-0x0;var _0x1f29e5=_0x7c09[_0x219ef6];return _0x1f29e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['CmHopperFinal'][_0x97c0('0x48')]()[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,null))[_0x97c0('0x43')](handleError(_0x4ff0a5,null));};exports['update']=function(_0x3e09d5,_0xac56ac){if(_0x3e09d5[_0x97c0('0x49')][_0x97c0('0x4a')]){delete _0x3e09d5[_0x97c0('0x49')]['uniqueid'];}return db[_0x97c0('0x2b')][_0x97c0('0x47')]({'where':{'uniqueid':_0x3e09d5[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0xac56ac,null))['then'](saveUpdates(_0x3e09d5[_0x97c0('0x49')],null))['then'](respondWithResult(_0xac56ac,null))['catch'](handleError(_0xac56ac,null));};exports[_0x97c0('0x4b')]=function(_0x20e2a5,_0x23c7ad,_0x53a255){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x20e2a5[_0x97c0('0x45')]['id']},'attributes':[[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x4f')))),'noSuchContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x50')))),'noAnswerContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x53')))),_0x97c0('0x54')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x55')))),_0x97c0('0x56')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x59')))),'reCallContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x97c0('0x5a')]]})[_0x97c0('0x24')](handleEntityNotFound(_0x23c7ad,null))[_0x97c0('0x24')](respondWithResult(_0x23c7ad,null))[_0x97c0('0x43')](handleError(_0x23c7ad,null));};exports[_0x97c0('0x5b')]=function(_0x2bb5d3,_0x52643e,_0x3349df){return db[_0x97c0('0x2b')][_0x97c0('0x41')]({'raw':![],'where':{'CampaignId':_0x2bb5d3[_0x97c0('0x45')]['id']},'attributes':[[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x200,\x201,\x20null'))),_0x97c0('0x5c')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x50')))),_0x97c0('0x5d')],[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),_0x97c0('0x54')],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x55')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x59')))),_0x97c0('0x5e')],[db[_0x97c0('0x4c')]['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x5f')))),_0x97c0('0x5a')]]})['then'](handleEntityNotFound(_0x52643e,null))[_0x97c0('0x24')](respondWithResult(_0x52643e,null))[_0x97c0('0x43')](handleError(_0x52643e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x4116c9,_0x30ffa8,_0x1cfe22){return db['VoiceQueue'][_0x97c0('0x47')]({'where':{'id':_0x4116c9[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x30ffa8,null))[_0x97c0('0x24')](function(_0x4d40cd){var _0x4ee6a2;if(_0x4d40cd){_0x4ee6a2=squel['insert']()[_0x97c0('0x60')](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),_0x97c0('0x66'),_0x97c0('0x67'),'createdAt','updatedAt'],squel[_0x97c0('0x68')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x64'))[_0x97c0('0x69')](_0x97c0('0x6b'),'ContactId')['field'](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x6d'),'VoiceQueueId')[_0x97c0('0x69')]('NOW()',_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x74'),_0x4116c9['body']['state'][_0x97c0('0x73')]())[_0x97c0('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x97c0('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x97c0('0x68')]()[_0x97c0('0x69')]('phone')[_0x97c0('0x70')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]()))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9['params']['id'][_0x97c0('0x73')]())['where']('state\x20=\x204'))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')]['query'](_0x4ee6a2);}return[];})[_0x97c0('0x24')](respondWithResult(_0x30ffa8,null))[_0x97c0('0x43')](handleError(_0x30ffa8,null));};exports[_0x97c0('0x78')]=function(_0x5bb9de,_0x388ba1,_0x550a68){return db[_0x97c0('0x79')][_0x97c0('0x47')]({'where':{'id':_0x5bb9de[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x388ba1,null))[_0x97c0('0x24')](function(_0x44f6bc){var _0x37cdb3;if(_0x44f6bc){_0x37cdb3=squel[_0x97c0('0x7a')]()['into'](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),'ListId',_0x97c0('0x7b'),_0x97c0('0x6e'),'updatedAt'],squel['select']()[_0x97c0('0x69')](_0x97c0('0x7c'),_0x97c0('0x63'))['field']('NOW()',_0x97c0('0x64'))['field'](_0x97c0('0x6b'),_0x97c0('0x65'))[_0x97c0('0x69')](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x7d'),'CampaignId')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x74'),_0x5bb9de['body'][_0x97c0('0x7f')][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x80'))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x63'))[_0x97c0('0x70')](_0x97c0('0x61'))[_0x97c0('0x39')]('CampaignId\x20=\x20?',_0x5bb9de[_0x97c0('0x45')]['id']['toString']()))[_0x97c0('0x39')](_0x97c0('0x75'),squel[_0x97c0('0x68')]()['field'](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de['params']['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x81')))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')][_0x97c0('0x2f')](_0x37cdb3);}return[];})[_0x97c0('0x24')](respondWithResult(_0x388ba1,null))[_0x97c0('0x43')](handleError(_0x388ba1,null));};exports[_0x97c0('0x82')]=function(_0x3ebd11,_0x44b374,_0x493e62){return db[_0x97c0('0x83')][_0x97c0('0x84')]({'where':{'VoiceQueueId':_0x3ebd11[_0x97c0('0x49')]['VoiceQueueId'],'CampaignId':_0x3ebd11['body'][_0x97c0('0x7b')],'ContactId':_0x3ebd11[_0x97c0('0x49')][_0x97c0('0x65')]}})[_0x97c0('0x24')](handleEntityNotFound(_0x44b374,null))[_0x97c0('0x24')](function(_0x120d78){if(_0x120d78){return _0x120d78;}return null;})[_0x97c0('0x24')](respondWithResult(_0x44b374,null))[_0x97c0('0x43')](handleError(_0x44b374,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index aa2950e..02b98fc 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 _0xfb4b=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','util'];(function(_0x5807c9,_0x556d63){var _0xe912f6=function(_0x1c63fb){while(--_0x1c63fb){_0x5807c9['push'](_0x5807c9['shift']());}};_0xe912f6(++_0x556d63);}(_0xfb4b,0x192));var _0xbfb4=function(_0x3ebdb3,_0x38f046){_0x3ebdb3=_0x3ebdb3-0x0;var _0x82ed19=_0xfb4b[_0x3ebdb3];return _0x82ed19;};'use strict';var _=require('lodash');var util=require(_0xbfb4('0x0'));var logger=require(_0xbfb4('0x1'))(_0xbfb4('0x2'));var moment=require('moment');var BPromise=require(_0xbfb4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfb4('0x4'));var rimraf=require(_0xbfb4('0x5'));var config=require(_0xbfb4('0x6'));var attributes=require(_0xbfb4('0x7'));module[_0xbfb4('0x8')]=function(_0x525b26,_0x3dce2f){return _0x525b26[_0xbfb4('0x9')](_0xbfb4('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xbfb4('0xb'),'fields':[_0xbfb4('0xb')]},{'name':_0xbfb4('0xc'),'fields':[_0xbfb4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6688=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x1914db,_0x827c49){var _0x5ad148=function(_0xa35a9e){while(--_0xa35a9e){_0x1914db['push'](_0x1914db['shift']());}};_0x5ad148(++_0x827c49);}(_0x6688,0xbd));var _0x8668=function(_0x97fcd6,_0x2d57e6){_0x97fcd6=_0x97fcd6-0x0;var _0x3cb3ad=_0x6688[_0x97fcd6];return _0x3cb3ad;};'use strict';var _=require(_0x8668('0x0'));var util=require(_0x8668('0x1'));var logger=require(_0x8668('0x2'))(_0x8668('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8668('0x4'));var fs=require('fs');var path=require(_0x8668('0x5'));var rimraf=require('rimraf');var config=require(_0x8668('0x6'));var attributes=require(_0x8668('0x7'));module[_0x8668('0x8')]=function(_0x289090,_0x267d1a){return _0x289090[_0x8668('0x9')](_0x8668('0xa'),attributes,{'tableName':_0x8668('0xb'),'paranoid':![],'indexes':[{'name':_0x8668('0xc'),'fields':[_0x8668('0xc')]},{'name':_0x8668('0xd'),'fields':[_0x8668('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 42575aa..5f7a145 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x42dcfa,_0x39f34f){var _0x27d30c=function(_0x399347){while(--_0x399347){_0x42dcfa['push'](_0x42dcfa['shift']());}};_0x27d30c(++_0x39f34f);}(_0x7a54,0x106));var _0x47a5=function(_0x22b1df,_0x1b701f){_0x22b1df=_0x22b1df-0x0;var _0x588f5e=_0x7a54[_0x22b1df];return _0x588f5e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x3f5cdc,_0x1affc4){var _0x42d2ae=function(_0x3a9bb7){while(--_0x3a9bb7){_0x3f5cdc['push'](_0x3f5cdc['shift']());}};_0x42d2ae(++_0x1affc4);}(_0xb10b,0x12a));var _0xbb10=function(_0x45ce90,_0x114609){_0x45ce90=_0x45ce90-0x0;var _0x313c45=_0xb10b[_0x45ce90];return _0x313c45;};'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 2f97a91..ec4a8af 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 _0x6951=['index','describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated'];(function(_0x5efe3f,_0x337564){var _0x39bbf9=function(_0x560397){while(--_0x560397){_0x5efe3f['push'](_0x5efe3f['shift']());}};_0x39bbf9(++_0x337564);}(_0x6951,0x9d));var _0x1695=function(_0x3af4ab,_0x4744f2){_0x3af4ab=_0x3af4ab-0x0;var _0x132195=_0x6951[_0x3af4ab];return _0x132195;};'use strict';var multer=require('multer');var util=require(_0x1695('0x0'));var path=require('path');var timeout=require(_0x1695('0x1'));var express=require(_0x1695('0x2'));var router=express[_0x1695('0x3')]();var fs_extra=require(_0x1695('0x4'));var auth=require(_0x1695('0x5'));var interaction=require(_0x1695('0x6'));var config=require(_0x1695('0x7'));var controller=require(_0x1695('0x8'));router[_0x1695('0x9')]('/',auth[_0x1695('0xa')](),controller[_0x1695('0xb')]);router[_0x1695('0x9')]('/describe',auth[_0x1695('0xa')](),controller[_0x1695('0xc')]);router[_0x1695('0x9')]('/:id',auth[_0x1695('0xa')](),controller[_0x1695('0xd')]);router[_0x1695('0x9')](_0x1695('0xe'),auth[_0x1695('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x1695('0x9')](_0x1695('0xf'),auth['isAuthenticated'](),controller[_0x1695('0x10')]);router[_0x1695('0x11')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x1695('0x11')](_0x1695('0x12'),auth[_0x1695('0xa')](),controller[_0x1695('0x13')]);router['post']('/checkContactHopper',auth[_0x1695('0xa')](),controller[_0x1695('0x14')]);router[_0x1695('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1695('0x16')]);module[_0x1695('0x17')]=router; \ No newline at end of file +var _0xf604=['post','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal'];(function(_0x10c0c6,_0x5cdcef){var _0x1a0d90=function(_0x22a4d3){while(--_0x22a4d3){_0x10c0c6['push'](_0x10c0c6['shift']());}};_0x1a0d90(++_0x5cdcef);}(_0xf604,0x1a4));var _0x4f60=function(_0xdb6398,_0x2d07b3){_0xdb6398=_0xdb6398-0x0;var _0x5dd76b=_0xf604[_0xdb6398];return _0x5dd76b;};'use strict';var multer=require(_0x4f60('0x0'));var util=require(_0x4f60('0x1'));var path=require(_0x4f60('0x2'));var timeout=require(_0x4f60('0x3'));var express=require(_0x4f60('0x4'));var router=express[_0x4f60('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4f60('0x6'));var config=require(_0x4f60('0x7'));var controller=require(_0x4f60('0x8'));router[_0x4f60('0x9')]('/',auth[_0x4f60('0xa')](),controller[_0x4f60('0xb')]);router[_0x4f60('0x9')]('/describe',auth[_0x4f60('0xa')](),controller[_0x4f60('0xc')]);router[_0x4f60('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4f60('0x9')]('/voice/queue/countAttributes/:id',auth[_0x4f60('0xa')](),controller[_0x4f60('0xd')]);router[_0x4f60('0x9')](_0x4f60('0xe'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x4f60('0xf'),auth[_0x4f60('0xa')](),controller[_0x4f60('0x10')]);router[_0x4f60('0x11')]('/voice/campaign/moveContacts/:id',auth[_0x4f60('0xa')](),controller[_0x4f60('0x12')]);router['post'](_0x4f60('0x13'),auth[_0x4f60('0xa')](),controller[_0x4f60('0x14')]);router['put'](_0x4f60('0x15'),auth[_0x4f60('0xa')](),controller['update']);module[_0x4f60('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 89612d7..bebf83a 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 _0xeca8=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x4a6979,_0x5f3d1a){var _0x226f93=function(_0x471572){while(--_0x471572){_0x4a6979['push'](_0x4a6979['shift']());}};_0x226f93(++_0x5f3d1a);}(_0xeca8,0x1f2));var _0x8eca=function(_0x50256a,_0x1ec1ad){_0x50256a=_0x50256a-0x0;var _0xcd4fc2=_0xeca8[_0x50256a];return _0xcd4fc2;};'use strict';var Sequelize=require(_0x8eca('0x0'));module[_0x8eca('0x1')]={'state':{'type':Sequelize[_0x8eca('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8eca('0x3')]},'scheduledat':{'type':Sequelize[_0x8eca('0x4')]},'countbusyretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8eca('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8eca('0x3')]},'originatecalleridname':{'type':Sequelize[_0x8eca('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8eca('0x3')]},'starttime':{'type':Sequelize[_0x8eca('0x4')]},'responsetime':{'type':Sequelize[_0x8eca('0x4')]},'answertime':{'type':Sequelize[_0x8eca('0x4')]},'droptime':{'type':Sequelize[_0x8eca('0x4')]},'endtime':{'type':Sequelize[_0x8eca('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8eca('0x3')]},'campaign':{'type':Sequelize[_0x8eca('0x3')]},'campaigntype':{'type':Sequelize[_0x8eca('0x3')]},'membername':{'type':Sequelize[_0x8eca('0x3')]},'reason':{'type':Sequelize[_0x8eca('0x3')]},'amd':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8eca('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8eca('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8eca('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8eca('0x3')]}}; \ No newline at end of file +var _0x14c5=['INTEGER','DATE','STRING','BOOLEAN','sequelize','exports'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0x14c5,0x1de));var _0x514c=function(_0x3afd6d,_0x1742a5){_0x3afd6d=_0x3afd6d-0x0;var _0x3c18ce=_0x14c5[_0x3afd6d];return _0x3c18ce;};'use strict';var Sequelize=require(_0x514c('0x0'));module[_0x514c('0x1')]={'state':{'type':Sequelize[_0x514c('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x514c('0x3')]},'countbusyretry':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x514c('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x514c('0x4')]},'originatecalleridname':{'type':Sequelize[_0x514c('0x4')]},'calleridnum':{'type':Sequelize[_0x514c('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x514c('0x3')]},'responsetime':{'type':Sequelize[_0x514c('0x3')]},'answertime':{'type':Sequelize[_0x514c('0x3')]},'droptime':{'type':Sequelize[_0x514c('0x3')]},'endtime':{'type':Sequelize[_0x514c('0x3')]},'ringtime':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x514c('0x4')]},'campaign':{'type':Sequelize[_0x514c('0x4')]},'campaigntype':{'type':Sequelize[_0x514c('0x4')]},'membername':{'type':Sequelize[_0x514c('0x4')]},'reason':{'type':Sequelize[_0x514c('0x4')]},'amd':{'type':Sequelize[_0x514c('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x514c('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x514c('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x514c('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x514c('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x514c('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x514c('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x514c('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 15c58b7..bb55508 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 _0x4d84=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','rows','show','length','includeAll','find','create','body','catch','describe','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x387a18,_0x4d00c6){var _0x219016=function(_0x5c343b){while(--_0x5c343b){_0x387a18['push'](_0x387a18['shift']());}};_0x219016(++_0x4d00c6);}(_0x4d84,0xf9));var _0x44d8=function(_0x2edf70,_0x3b24e1){_0x2edf70=_0x2edf70-0x0;var _0x193515=_0x4d84[_0x2edf70];return _0x193515;};'use strict';var emlformat=require(_0x44d8('0x0'));var rimraf=require(_0x44d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44d8('0x2'));var rp=require(_0x44d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44d8('0x4'));var util=require(_0x44d8('0x5'));var path=require(_0x44d8('0x6'));var sox=require(_0x44d8('0x7'));var csv=require(_0x44d8('0x8'));var ejs=require(_0x44d8('0x9'));var fs=require('fs');var fs_extra=require(_0x44d8('0xa'));var _=require(_0x44d8('0xb'));var squel=require('squel');var crypto=require(_0x44d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x44d8('0xd'));var toCsv=require(_0x44d8('0x8'));var querystring=require(_0x44d8('0xe'));var Papa=require('papaparse');var Redis=require(_0x44d8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x44d8('0x10'));var as=require(_0x44d8('0x11'));var hardwareService=require(_0x44d8('0x12'));var logger=require(_0x44d8('0x13'))(_0x44d8('0x14'));var utils=require(_0x44d8('0x15'));var config=require(_0x44d8('0x16'));var licenseUtil=require(_0x44d8('0x17'));var db=require(_0x44d8('0x18'))['db'];function respondWithStatusCode(_0x51f32e,_0x26bc7e){_0x26bc7e=_0x26bc7e||0xcc;return function(_0x26b3b0){if(_0x26b3b0){return _0x51f32e['sendStatus'](_0x26bc7e);}return _0x51f32e[_0x44d8('0x19')](_0x26bc7e)['end']();};}function respondWithResult(_0x4e80a9,_0x1d82a8){_0x1d82a8=_0x1d82a8||0xc8;return function(_0x2fb39e){if(_0x2fb39e){return _0x4e80a9[_0x44d8('0x19')](_0x1d82a8)[_0x44d8('0x1a')](_0x2fb39e);}};}function respondWithFilteredResult(_0x46e0e5,_0x3a6514){return function(_0x20dfd9){if(_0x20dfd9){var _0x56d95f=typeof _0x3a6514[_0x44d8('0x1b')]===_0x44d8('0x1c')&&typeof _0x3a6514[_0x44d8('0x1d')]===_0x44d8('0x1c');var _0x3996c8=_0x20dfd9[_0x44d8('0x1e')];var _0x3258a3=_0x56d95f?0x0:_0x3a6514[_0x44d8('0x1b')];var _0x1e2e3a=_0x56d95f?_0x20dfd9[_0x44d8('0x1e')]:_0x3a6514[_0x44d8('0x1b')]+_0x3a6514[_0x44d8('0x1d')];var _0x1b6602;if(_0x1e2e3a>=_0x3996c8){_0x1e2e3a=_0x3996c8;_0x1b6602=0xc8;}else{_0x1b6602=0xce;}_0x46e0e5[_0x44d8('0x19')](_0x1b6602);return _0x46e0e5['set'](_0x44d8('0x1f'),_0x3258a3+'-'+_0x1e2e3a+'/'+_0x3996c8)['json'](_0x20dfd9);}return null;};}function patchUpdates(_0x422ebc){return function(_0x24f74d){try{jsonpatch['apply'](_0x24f74d,_0x422ebc,!![]);}catch(_0x33db4c){return BPromise[_0x44d8('0x20')](_0x33db4c);}return _0x24f74d[_0x44d8('0x21')]();};}function saveUpdates(_0x13839b,_0x4d5998){return function(_0x1573a3){if(_0x1573a3){return _0x1573a3[_0x44d8('0x22')](_0x13839b)[_0x44d8('0x23')](function(_0x313d18){return _0x313d18;});}return null;};}function removeEntity(_0x587568,_0x91a5f4){return function(_0x57bf04){if(_0x57bf04){return _0x57bf04[_0x44d8('0x24')]()[_0x44d8('0x23')](function(){_0x587568[_0x44d8('0x19')](0xcc)[_0x44d8('0x25')]();});}};}function handleEntityNotFound(_0x46645a,_0x3e42f5){return function(_0x598705){if(!_0x598705){_0x46645a['sendStatus'](0x194);}return _0x598705;};}function handleError(_0x444fa3,_0x17d6d4){_0x17d6d4=_0x17d6d4||0x1f4;return function(_0xafee8f){logger[_0x44d8('0x26')](_0xafee8f[_0x44d8('0x27')]);if(_0xafee8f[_0x44d8('0x28')]){delete _0xafee8f[_0x44d8('0x28')];}_0x444fa3[_0x44d8('0x19')](_0x17d6d4)['send'](_0xafee8f);};}exports[_0x44d8('0x29')]=function(_0x35e157,_0x5595af){var _0x350569={},_0x5898a0={},_0x43e3d8={'count':0x0,'rows':[]};var _0x42c017=_[_0x44d8('0x2a')](db[_0x44d8('0x2b')][_0x44d8('0x2c')],function(_0x21070e){return{'name':_0x21070e[_0x44d8('0x2d')],'type':_0x21070e[_0x44d8('0x2e')][_0x44d8('0x2f')]};});_0x5898a0[_0x44d8('0x30')]=_['map'](_0x42c017,_0x44d8('0x28'));_0x5898a0[_0x44d8('0x31')]=_[_0x44d8('0x32')](_0x35e157['query']);_0x5898a0[_0x44d8('0x33')]=_[_0x44d8('0x34')](_0x5898a0[_0x44d8('0x30')],_0x5898a0['query']);_0x350569['attributes']=_[_0x44d8('0x34')](_0x5898a0[_0x44d8('0x30')],qs['fields'](_0x35e157[_0x44d8('0x31')][_0x44d8('0x35')]));_0x350569[_0x44d8('0x36')]=_0x350569[_0x44d8('0x36')]['length']?_0x350569[_0x44d8('0x36')]:_0x5898a0[_0x44d8('0x30')];if(!_0x35e157[_0x44d8('0x31')][_0x44d8('0x37')](_0x44d8('0x38'))){_0x350569['limit']=qs[_0x44d8('0x1d')](_0x35e157[_0x44d8('0x31')][_0x44d8('0x1d')]);_0x350569[_0x44d8('0x1b')]=qs['offset'](_0x35e157[_0x44d8('0x31')][_0x44d8('0x1b')]);}_0x350569[_0x44d8('0x39')]=qs['sort'](_0x35e157[_0x44d8('0x31')][_0x44d8('0x3a')]);_0x350569[_0x44d8('0x3b')]=qs[_0x44d8('0x33')](_['pick'](_0x35e157[_0x44d8('0x31')],_0x5898a0[_0x44d8('0x33')]),_0x42c017);if(_0x35e157[_0x44d8('0x31')]['filter']){_0x350569['where']=_[_0x44d8('0x3c')](_0x350569[_0x44d8('0x3b')],{'$or':_['map'](_0x42c017,function(_0x469318){if(_0x469318[_0x44d8('0x2e')]!=='VIRTUAL'){var _0x59ec2c={};_0x59ec2c[_0x469318[_0x44d8('0x28')]]={'$like':'%'+_0x35e157[_0x44d8('0x31')][_0x44d8('0x3d')]+'%'};return _0x59ec2c;}})});}_0x350569=_[_0x44d8('0x3c')]({},_0x350569,_0x35e157[_0x44d8('0x3e')]);var _0x565db9={'where':_0x350569['where']};return db[_0x44d8('0x2b')][_0x44d8('0x1e')](_0x565db9)['then'](function(_0x8ceb6e){_0x43e3d8[_0x44d8('0x1e')]=_0x8ceb6e;if(_0x35e157[_0x44d8('0x31')]['includeAll']){_0x350569[_0x44d8('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x44d8('0x40')](_0x350569);})[_0x44d8('0x23')](function(_0x1b1c19){_0x43e3d8[_0x44d8('0x41')]=_0x1b1c19;return _0x43e3d8;})['then'](respondWithFilteredResult(_0x5595af,_0x350569))['catch'](handleError(_0x5595af,null));};exports[_0x44d8('0x42')]=function(_0xa8c8fe,_0x5111ed){var _0x107645={'raw':!![],'where':{'id':_0xa8c8fe['params']['id']}},_0x2c6943={};_0x2c6943[_0x44d8('0x30')]=_[_0x44d8('0x32')](db[_0x44d8('0x2b')][_0x44d8('0x2c')]);_0x2c6943[_0x44d8('0x31')]=_[_0x44d8('0x32')](_0xa8c8fe[_0x44d8('0x31')]);_0x2c6943[_0x44d8('0x33')]=_['intersection'](_0x2c6943[_0x44d8('0x30')],_0x2c6943['query']);_0x107645['attributes']=_['intersection'](_0x2c6943[_0x44d8('0x30')],qs[_0x44d8('0x35')](_0xa8c8fe[_0x44d8('0x31')][_0x44d8('0x35')]));_0x107645[_0x44d8('0x36')]=_0x107645[_0x44d8('0x36')][_0x44d8('0x43')]?_0x107645[_0x44d8('0x36')]:_0x2c6943[_0x44d8('0x30')];if(_0xa8c8fe[_0x44d8('0x31')][_0x44d8('0x44')]){_0x107645[_0x44d8('0x3f')]=[{'all':!![]}];}_0x107645=_[_0x44d8('0x3c')]({},_0x107645,_0xa8c8fe['options']);return db[_0x44d8('0x2b')][_0x44d8('0x45')](_0x107645)[_0x44d8('0x23')](handleEntityNotFound(_0x5111ed,null))[_0x44d8('0x23')](respondWithResult(_0x5111ed,null))['catch'](handleError(_0x5111ed,null));};exports[_0x44d8('0x46')]=function(_0x2b4f32,_0x162b46){return db[_0x44d8('0x2b')]['create'](_0x2b4f32[_0x44d8('0x47')],{})[_0x44d8('0x23')](respondWithResult(_0x162b46,0xc9))[_0x44d8('0x48')](handleError(_0x162b46,null));};exports[_0x44d8('0x49')]=function(_0x51abb1,_0x5f33df){return db['CmHopperHistory'][_0x44d8('0x49')]()['then'](respondWithResult(_0x5f33df,null))['catch'](handleError(_0x5f33df,null));};exports[_0x44d8('0x22')]=function(_0x2a3cd0,_0x53e74a){if(_0x2a3cd0['body']['uniqueid']){delete _0x2a3cd0[_0x44d8('0x47')]['uniqueid'];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x2a3cd0[_0x44d8('0x4a')]['id']}})[_0x44d8('0x23')](handleEntityNotFound(_0x53e74a,null))['then'](saveUpdates(_0x2a3cd0[_0x44d8('0x47')],null))[_0x44d8('0x23')](respondWithResult(_0x53e74a,null))['catch'](handleError(_0x53e74a,null));}; \ No newline at end of file +var _0xe18d=['apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','describe','body','uniqueid','params','eml-format','rimraf','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x2f3462,_0x5f5b23){var _0xc56703=function(_0x46b3d1){while(--_0x46b3d1){_0x2f3462['push'](_0x2f3462['shift']());}};_0xc56703(++_0x5f5b23);}(_0xe18d,0x1ef));var _0xde18=function(_0x7b0c0c,_0x317221){_0x7b0c0c=_0x7b0c0c-0x0;var _0x769c3b=_0xe18d[_0x7b0c0c];return _0x769c3b;};'use strict';var emlformat=require(_0xde18('0x0'));var rimraf=require(_0xde18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xde18('0x2'));var Mustache=require(_0xde18('0x3'));var util=require('util');var path=require('path');var sox=require(_0xde18('0x4'));var csv=require(_0xde18('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde18('0x6'));var _=require(_0xde18('0x7'));var squel=require(_0xde18('0x8'));var crypto=require('crypto');var jsforce=require(_0xde18('0x9'));var deskjs=require(_0xde18('0xa'));var toCsv=require('to-csv');var querystring=require(_0xde18('0xb'));var Papa=require(_0xde18('0xc'));var Redis=require('ioredis');var authService=require(_0xde18('0xd'));var qs=require(_0xde18('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde18('0xf'));var logger=require(_0xde18('0x10'))(_0xde18('0x11'));var utils=require('../../config/utils');var config=require(_0xde18('0x12'));var licenseUtil=require(_0xde18('0x13'));var db=require(_0xde18('0x14'))['db'];function respondWithStatusCode(_0x274f13,_0x16afef){_0x16afef=_0x16afef||0xcc;return function(_0x229b38){if(_0x229b38){return _0x274f13[_0xde18('0x15')](_0x16afef);}return _0x274f13['status'](_0x16afef)['end']();};}function respondWithResult(_0x481b86,_0xaf628d){_0xaf628d=_0xaf628d||0xc8;return function(_0x3c9de6){if(_0x3c9de6){return _0x481b86[_0xde18('0x16')](_0xaf628d)[_0xde18('0x17')](_0x3c9de6);}};}function respondWithFilteredResult(_0xf6ff88,_0x339a9c){return function(_0x73be17){if(_0x73be17){var _0x43a7d1=typeof _0x339a9c['offset']===_0xde18('0x18')&&typeof _0x339a9c[_0xde18('0x19')]==='undefined';var _0xe4bf47=_0x73be17[_0xde18('0x1a')];var _0x3ef78b=_0x43a7d1?0x0:_0x339a9c[_0xde18('0x1b')];var _0x2482b6=_0x43a7d1?_0x73be17[_0xde18('0x1a')]:_0x339a9c['offset']+_0x339a9c[_0xde18('0x19')];var _0x45f60d;if(_0x2482b6>=_0xe4bf47){_0x2482b6=_0xe4bf47;_0x45f60d=0xc8;}else{_0x45f60d=0xce;}_0xf6ff88[_0xde18('0x16')](_0x45f60d);return _0xf6ff88[_0xde18('0x1c')](_0xde18('0x1d'),_0x3ef78b+'-'+_0x2482b6+'/'+_0xe4bf47)[_0xde18('0x17')](_0x73be17);}return null;};}function patchUpdates(_0xc61eec){return function(_0x493fb4){try{jsonpatch[_0xde18('0x1e')](_0x493fb4,_0xc61eec,!![]);}catch(_0x291deb){return BPromise[_0xde18('0x1f')](_0x291deb);}return _0x493fb4[_0xde18('0x20')]();};}function saveUpdates(_0x4e395d,_0x44fd28){return function(_0x369228){if(_0x369228){return _0x369228[_0xde18('0x21')](_0x4e395d)[_0xde18('0x22')](function(_0x5a1fcf){return _0x5a1fcf;});}return null;};}function removeEntity(_0x227d27,_0x53c89e){return function(_0x6e11da){if(_0x6e11da){return _0x6e11da[_0xde18('0x23')]()[_0xde18('0x22')](function(){_0x227d27[_0xde18('0x16')](0xcc)[_0xde18('0x24')]();});}};}function handleEntityNotFound(_0x5b634e,_0x2458aa){return function(_0x2367c7){if(!_0x2367c7){_0x5b634e[_0xde18('0x15')](0x194);}return _0x2367c7;};}function handleError(_0x29466c,_0x207b42){_0x207b42=_0x207b42||0x1f4;return function(_0x504bae){logger[_0xde18('0x25')](_0x504bae[_0xde18('0x26')]);if(_0x504bae['name']){delete _0x504bae[_0xde18('0x27')];}_0x29466c['status'](_0x207b42)[_0xde18('0x28')](_0x504bae);};}exports[_0xde18('0x29')]=function(_0x4d0cb3,_0xca4c8a){var _0x3421ce={},_0x423a7d={},_0x7d86c1={'count':0x0,'rows':[]};var _0x59f5a9=_[_0xde18('0x2a')](db[_0xde18('0x2b')][_0xde18('0x2c')],function(_0x35ba69){return{'name':_0x35ba69['fieldName'],'type':_0x35ba69[_0xde18('0x2d')][_0xde18('0x2e')]};});_0x423a7d[_0xde18('0x2f')]=_['map'](_0x59f5a9,_0xde18('0x27'));_0x423a7d[_0xde18('0x30')]=_['keys'](_0x4d0cb3[_0xde18('0x30')]);_0x423a7d[_0xde18('0x31')]=_['intersection'](_0x423a7d[_0xde18('0x2f')],_0x423a7d[_0xde18('0x30')]);_0x3421ce[_0xde18('0x32')]=_[_0xde18('0x33')](_0x423a7d[_0xde18('0x2f')],qs[_0xde18('0x34')](_0x4d0cb3[_0xde18('0x30')][_0xde18('0x34')]));_0x3421ce['attributes']=_0x3421ce['attributes'][_0xde18('0x35')]?_0x3421ce[_0xde18('0x32')]:_0x423a7d[_0xde18('0x2f')];if(!_0x4d0cb3[_0xde18('0x30')][_0xde18('0x36')](_0xde18('0x37'))){_0x3421ce[_0xde18('0x19')]=qs['limit'](_0x4d0cb3[_0xde18('0x30')][_0xde18('0x19')]);_0x3421ce[_0xde18('0x1b')]=qs['offset'](_0x4d0cb3['query'][_0xde18('0x1b')]);}_0x3421ce[_0xde18('0x38')]=qs['sort'](_0x4d0cb3[_0xde18('0x30')]['sort']);_0x3421ce['where']=qs[_0xde18('0x31')](_[_0xde18('0x39')](_0x4d0cb3[_0xde18('0x30')],_0x423a7d[_0xde18('0x31')]),_0x59f5a9);if(_0x4d0cb3[_0xde18('0x30')][_0xde18('0x3a')]){_0x3421ce[_0xde18('0x3b')]=_[_0xde18('0x3c')](_0x3421ce[_0xde18('0x3b')],{'$or':_['map'](_0x59f5a9,function(_0x11c742){if(_0x11c742[_0xde18('0x2d')]!==_0xde18('0x3d')){var _0x377172={};_0x377172[_0x11c742[_0xde18('0x27')]]={'$like':'%'+_0x4d0cb3[_0xde18('0x30')][_0xde18('0x3a')]+'%'};return _0x377172;}})});}_0x3421ce=_['merge']({},_0x3421ce,_0x4d0cb3[_0xde18('0x3e')]);var _0x30d870={'where':_0x3421ce[_0xde18('0x3b')]};return db[_0xde18('0x2b')]['count'](_0x30d870)[_0xde18('0x22')](function(_0x5da9f1){_0x7d86c1['count']=_0x5da9f1;if(_0x4d0cb3[_0xde18('0x30')][_0xde18('0x3f')]){_0x3421ce[_0xde18('0x40')]=[{'all':!![]}];}return db[_0xde18('0x2b')][_0xde18('0x41')](_0x3421ce);})['then'](function(_0x4503c8){_0x7d86c1[_0xde18('0x42')]=_0x4503c8;return _0x7d86c1;})['then'](respondWithFilteredResult(_0xca4c8a,_0x3421ce))[_0xde18('0x43')](handleError(_0xca4c8a,null));};exports[_0xde18('0x44')]=function(_0x456cf8,_0x34ee49){var _0x2bbed2={'raw':!![],'where':{'id':_0x456cf8['params']['id']}},_0x5dcb69={};_0x5dcb69['model']=_['keys'](db['CmHopperHistory'][_0xde18('0x2c')]);_0x5dcb69[_0xde18('0x30')]=_[_0xde18('0x45')](_0x456cf8['query']);_0x5dcb69[_0xde18('0x31')]=_[_0xde18('0x33')](_0x5dcb69[_0xde18('0x2f')],_0x5dcb69['query']);_0x2bbed2[_0xde18('0x32')]=_['intersection'](_0x5dcb69[_0xde18('0x2f')],qs['fields'](_0x456cf8[_0xde18('0x30')][_0xde18('0x34')]));_0x2bbed2['attributes']=_0x2bbed2[_0xde18('0x32')][_0xde18('0x35')]?_0x2bbed2[_0xde18('0x32')]:_0x5dcb69['model'];if(_0x456cf8[_0xde18('0x30')][_0xde18('0x3f')]){_0x2bbed2[_0xde18('0x40')]=[{'all':!![]}];}_0x2bbed2=_['merge']({},_0x2bbed2,_0x456cf8[_0xde18('0x3e')]);return db['CmHopperHistory'][_0xde18('0x46')](_0x2bbed2)['then'](handleEntityNotFound(_0x34ee49,null))['then'](respondWithResult(_0x34ee49,null))[_0xde18('0x43')](handleError(_0x34ee49,null));};exports['create']=function(_0x2d7ffe,_0x462c41){return db['CmHopperHistory']['create'](_0x2d7ffe['body'],{})[_0xde18('0x22')](respondWithResult(_0x462c41,0xc9))[_0xde18('0x43')](handleError(_0x462c41,null));};exports[_0xde18('0x47')]=function(_0x339ca4,_0xcf7c3d){return db[_0xde18('0x2b')]['describe']()[_0xde18('0x22')](respondWithResult(_0xcf7c3d,null))[_0xde18('0x43')](handleError(_0xcf7c3d,null));};exports[_0xde18('0x21')]=function(_0xc55549,_0x1ed8a6){if(_0xc55549[_0xde18('0x48')][_0xde18('0x49')]){delete _0xc55549[_0xde18('0x48')][_0xde18('0x49')];}return db['CmHopperHistory'][_0xde18('0x46')]({'where':{'uniqueid':_0xc55549[_0xde18('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ed8a6,null))['then'](saveUpdates(_0xc55549[_0xde18('0x48')],null))[_0xde18('0x22')](respondWithResult(_0x1ed8a6,null))[_0xde18('0x43')](handleError(_0x1ed8a6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 2fe0c3f..2df5d8a 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 _0x7880=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x240645,_0x49729a){var _0x47b1b8=function(_0x29a312){while(--_0x29a312){_0x240645['push'](_0x240645['shift']());}};_0x47b1b8(++_0x49729a);}(_0x7880,0x1f4));var _0x0788=function(_0x49b59f,_0x1f3a28){_0x49b59f=_0x49b59f-0x0;var _0x46f0de=_0x7880[_0x49b59f];return _0x46f0de;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[{'name':_0x0788('0xd'),'fields':['endtime']},{'name':_0x0788('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaac4=['bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','lodash','util','api','moment'];(function(_0x58f5cf,_0x1d3594){var _0x23ca03=function(_0x572c60){while(--_0x572c60){_0x58f5cf['push'](_0x58f5cf['shift']());}};_0x23ca03(++_0x1d3594);}(_0xaac4,0x6c));var _0x4aac=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xaac4[_0x43b584];return _0x48f27b;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var logger=require('../../config/logger')(_0x4aac('0x2'));var moment=require(_0x4aac('0x3'));var BPromise=require(_0x4aac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4aac('0x5'));var rimraf=require(_0x4aac('0x6'));var config=require(_0x4aac('0x7'));var attributes=require(_0x4aac('0x8'));module[_0x4aac('0x9')]=function(_0x4c94f2,_0x2d795c){return _0x4c94f2[_0x4aac('0xa')](_0x4aac('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x4aac('0xc'),'fields':['endtime']},{'name':_0x4aac('0xd'),'fields':[_0x4aac('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d54d935..6c29911 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 _0x4517=['ivrTotalCallsDays','GetCampaignHopperHistory','util','moment','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','code','error','message','catch','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','COUNT','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','where','campaign','name'];(function(_0x38bf5f,_0x18d825){var _0x3d65c8=function(_0x1321e1){while(--_0x1321e1){_0x38bf5f['push'](_0x38bf5f['shift']());}};_0x3d65c8(++_0x18d825);}(_0x4517,0x112));var _0x7451=function(_0x5860c4,_0x16e0f6){_0x5860c4=_0x5860c4-0x0;var _0x311879=_0x4517[_0x5860c4];return _0x311879;};'use strict';var _=require('lodash');var util=require(_0x7451('0x0'));var moment=require(_0x7451('0x1'));var BPromise=require('bluebird');var rs=require(_0x7451('0x2'));var fs=require('fs');var Redis=require(_0x7451('0x3'));var db=require(_0x7451('0x4'))['db'];var utils=require(_0x7451('0x5'));var logger=require(_0x7451('0x6'))(_0x7451('0x7'));var config=require(_0x7451('0x8'));var jayson=require(_0x7451('0x9'));var client=jayson[_0x7451('0xa')][_0x7451('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ac271,_0x1bfc08,_0x26306e){return new BPromise(function(_0x443b80,_0x2c2ace){return client[_0x7451('0xc')](_0x3ac271,_0x26306e)[_0x7451('0xd')](function(_0x4b7888){logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));logger[_0x7451('0x11')](_0x7451('0x12'),_0x1bfc08,_0x7451('0x10'),JSON[_0x7451('0x13')](_0x4b7888));if(_0x4b7888['error']){if(_0x4b7888['error'][_0x7451('0x14')]===0x1f4){logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')]['message']);return _0x2c2ace(_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);}logger['error'](_0x7451('0xf'),_0x1bfc08,_0x4b7888[_0x7451('0x15')][_0x7451('0x16')]);return _0x443b80(_0x4b7888[_0x7451('0x15')]['message']);}else{logger[_0x7451('0xe')](_0x7451('0xf'),_0x1bfc08,_0x7451('0x10'));_0x443b80(_0x4b7888['result']['message']);}})[_0x7451('0x17')](function(_0x1db688){logger[_0x7451('0x15')](_0x7451('0xf'),_0x1bfc08,_0x1db688);_0x2c2ace(_0x1db688);});});}exports[_0x7451('0x18')]=function(_0xd47ee4){var _0x31a4b2=this;return new Promise(function(_0x1120b1,_0x125ab1){return db['CmHopperHistory'][_0x7451('0x19')](_0xd47ee4[_0x7451('0x1a')],{'raw':_0xd47ee4[_0x7451('0x1b')]?_0xd47ee4['options'][_0x7451('0x1c')]===undefined?!![]:![]:!![]})[_0x7451('0xd')](function(_0x3ffb08){logger[_0x7451('0xe')](_0x7451('0x18'),_0xd47ee4);logger[_0x7451('0x11')](_0x7451('0x18'),_0xd47ee4,JSON['stringify'](_0x3ffb08));_0x1120b1(_0x3ffb08);})[_0x7451('0x17')](function(_0x309be0){logger['error'](_0x7451('0x18'),_0x309be0[_0x7451('0x16')],_0xd47ee4);_0x125ab1(_0x31a4b2[_0x7451('0x15')](0x1f4,_0x309be0['message']));});});};exports[_0x7451('0x1d')]=function(_0x21dd67){var _0x21cc22=this;return new Promise(function(_0x1fc076,_0x37bc47){return db[_0x7451('0x1e')][_0x7451('0x1f')]({'raw':_0x21dd67[_0x7451('0x1b')]?_0x21dd67[_0x7451('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21dd67[_0x7451('0x1b')]?_0x21dd67[_0x7451('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')][_0x7451('0x22')]('id')),_0x7451('0x23')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db['sequelize']['fn']('IF',db[_0x7451('0x21')]['literal'](_0x7451('0x24')))),_0x7451('0x25')],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db['sequelize'][_0x7451('0x26')](_0x7451('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0x7451('0x29'),db[_0x7451('0x21')]['fn']('IF',db['sequelize']['literal'](_0x7451('0x2a')))),_0x7451('0x2b')],[db[_0x7451('0x21')]['fn'](_0x7451('0x29'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x2c')))),'predictiveIntervalAvgTalktime']]})[_0x7451('0xd')](function(_0x11aead){logger['info'](_0x7451('0x1d'),_0x21dd67);logger[_0x7451('0x11')](_0x7451('0x1d'),_0x21dd67,JSON[_0x7451('0x13')](_0x11aead));_0x1fc076(_0x11aead);})[_0x7451('0x17')](function(_0x40af89){logger['error'](_0x7451('0x1d'),_0x40af89[_0x7451('0x16')],_0x21dd67);_0x37bc47(_0x21cc22['error'](0x1f4,_0x40af89[_0x7451('0x16')]));});});};exports[_0x7451('0x2d')]=function(_0x4e761d){var _0x5820e2=this;return new Promise(function(_0x59393b,_0x54b60f){return db['CmHopperHistory'][_0x7451('0x1f')]({'raw':_0x4e761d[_0x7451('0x1b')]?_0x4e761d[_0x7451('0x1b')][_0x7451('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e761d[_0x7451('0x1b')]?_0x4e761d['options']['where']||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x2e')))),_0x7451('0x2f')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x7451('0x21')]['fn']('COUNT',db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x7451('0x30')],[db['sequelize']['fn'](_0x7451('0x20'),db['sequelize']['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')]('`state`\x20=\x205,\x201,\x20null'))),_0x7451('0x31')],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x32')))),_0x7451('0x33')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x34')))),_0x7451('0x35')],[db[_0x7451('0x21')]['fn']('COUNT',db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x36')))),'outboundDropCallsDayCallersExit'],[db[_0x7451('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x7451('0x37')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db['sequelize']['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x38')))),_0x7451('0x39')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x7451('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x3a')))),_0x7451('0x3b')],[db[_0x7451('0x21')]['fn']('COUNT',db[_0x7451('0x21')]['fn']('IF',db['sequelize'][_0x7451('0x26')](_0x7451('0x3c')))),_0x7451('0x3d')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')][_0x7451('0x26')](_0x7451('0x3e')))),'outboundReCallsDay']],'group':['campaign']})[_0x7451('0xd')](function(_0x94f802){logger['info']('GetVoiceQueueHopperHistory',_0x4e761d);logger['debug'](_0x7451('0x2d'),_0x4e761d,JSON[_0x7451('0x13')](_0x94f802));_0x59393b(_0x94f802);})[_0x7451('0x17')](function(_0x22c4db){logger[_0x7451('0x15')](_0x7451('0x2d'),_0x22c4db['message'],_0x4e761d);_0x54b60f(_0x5820e2[_0x7451('0x15')](0x1f4,_0x22c4db['message']));});});};exports['GetCampaignHopperHistory']=function(_0x5e6649){var _0x107039=this;return new Promise(function(_0x3db1fe,_0x2548be){return db[_0x7451('0x1e')][_0x7451('0x1f')]({'raw':_0x5e6649[_0x7451('0x1b')]?_0x5e6649[_0x7451('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5e6649[_0x7451('0x1b')]?_0x5e6649[_0x7451('0x1b')][_0x7451('0x3f')]||null:null,'attributes':[[_0x7451('0x40'),_0x7451('0x41')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db['sequelize'][_0x7451('0x22')]('id')),_0x7451('0x42')],[db[_0x7451('0x21')]['fn'](_0x7451('0x20'),db[_0x7451('0x21')]['fn']('IF',db[_0x7451('0x21')]['literal'](_0x7451('0x24')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x7451('0xd')](function(_0x2282b9){logger[_0x7451('0xe')](_0x7451('0x43'),_0x5e6649);logger[_0x7451('0x11')](_0x7451('0x43'),_0x5e6649,JSON['stringify'](_0x2282b9));_0x3db1fe(_0x2282b9);})[_0x7451('0x17')](function(_0x528c4b){logger[_0x7451('0x15')](_0x7451('0x43'),_0x528c4b['message'],_0x5e6649);_0x2548be(_0x107039['error'](0x1f4,_0x528c4b['message']));});});}; \ No newline at end of file +var _0x9114=['predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateCmHopperHistory','CmHopperHistory','body','options','raw','catch','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x9114,0x72));var _0x4911=function(_0x300ea3,_0x46c53d){_0x300ea3=_0x300ea3-0x0;var _0x2fd19f=_0x9114[_0x300ea3];return _0x2fd19f;};'use strict';var _=require(_0x4911('0x0'));var util=require(_0x4911('0x1'));var moment=require(_0x4911('0x2'));var BPromise=require(_0x4911('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4911('0x4'));var db=require(_0x4911('0x5'))['db'];var utils=require(_0x4911('0x6'));var logger=require(_0x4911('0x7'))(_0x4911('0x8'));var config=require(_0x4911('0x9'));var jayson=require(_0x4911('0xa'));var client=jayson[_0x4911('0xb')][_0x4911('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x483d72,_0x24e64d,_0x1db97a){return new BPromise(function(_0x43f1f7,_0x39be30){return client[_0x4911('0xd')](_0x483d72,_0x1db97a)[_0x4911('0xe')](function(_0x2353c0){logger[_0x4911('0xf')](_0x4911('0x10'),_0x24e64d,_0x4911('0x11'));logger[_0x4911('0x12')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x24e64d,_0x4911('0x11'),JSON[_0x4911('0x13')](_0x2353c0));if(_0x2353c0[_0x4911('0x14')]){if(_0x2353c0[_0x4911('0x14')]['code']===0x1f4){logger[_0x4911('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x24e64d,_0x2353c0['error']['message']);return _0x39be30(_0x2353c0[_0x4911('0x14')]['message']);}logger[_0x4911('0x14')](_0x4911('0x10'),_0x24e64d,_0x2353c0[_0x4911('0x14')][_0x4911('0x15')]);return _0x43f1f7(_0x2353c0[_0x4911('0x14')][_0x4911('0x15')]);}else{logger['info'](_0x4911('0x10'),_0x24e64d,_0x4911('0x11'));_0x43f1f7(_0x2353c0[_0x4911('0x16')][_0x4911('0x15')]);}})['catch'](function(_0x4d81ca){logger[_0x4911('0x14')](_0x4911('0x10'),_0x24e64d,_0x4d81ca);_0x39be30(_0x4d81ca);});});}exports[_0x4911('0x17')]=function(_0x3f179c){var _0x3f2fab=this;return new Promise(function(_0x51bda4,_0x408189){return db[_0x4911('0x18')]['create'](_0x3f179c[_0x4911('0x19')],{'raw':_0x3f179c[_0x4911('0x1a')]?_0x3f179c[_0x4911('0x1a')][_0x4911('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xdd837c){logger[_0x4911('0xf')]('CreateCmHopperHistory',_0x3f179c);logger[_0x4911('0x12')]('CreateCmHopperHistory',_0x3f179c,JSON[_0x4911('0x13')](_0xdd837c));_0x51bda4(_0xdd837c);})[_0x4911('0x1c')](function(_0x596a6f){logger[_0x4911('0x14')](_0x4911('0x17'),_0x596a6f[_0x4911('0x15')],_0x3f179c);_0x408189(_0x3f2fab[_0x4911('0x14')](0x1f4,_0x596a6f[_0x4911('0x15')]));});});};exports[_0x4911('0x1d')]=function(_0x40ca91){var _0x1babb8=this;return new Promise(function(_0x447399,_0x2b4dfb){return db['CmHopperHistory'][_0x4911('0x1e')]({'raw':_0x40ca91[_0x4911('0x1a')]?_0x40ca91[_0x4911('0x1a')][_0x4911('0x1b')]===undefined?!![]:![]:!![],'where':_0x40ca91[_0x4911('0x1a')]?_0x40ca91['options'][_0x4911('0x1f')]||null:null,'attributes':[[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db['sequelize'][_0x4911('0x22')]('id')),_0x4911('0x23')],[db[_0x4911('0x20')]['fn']('COUNT',db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x25')))),_0x4911('0x26')],[db[_0x4911('0x20')]['fn']('COUNT',db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x27')))),_0x4911('0x28')],[db[_0x4911('0x20')]['fn']('COUNT',db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x29')))),_0x4911('0x2a')],[db[_0x4911('0x20')]['fn'](_0x4911('0x2b'),db[_0x4911('0x20')]['fn']('IF',db['sequelize'][_0x4911('0x24')](_0x4911('0x2c')))),_0x4911('0x2d')],[db[_0x4911('0x20')]['fn'](_0x4911('0x2b'),db['sequelize']['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x2e')))),_0x4911('0x2f')]]})[_0x4911('0xe')](function(_0x39f082){logger[_0x4911('0xf')](_0x4911('0x1d'),_0x40ca91);logger[_0x4911('0x12')](_0x4911('0x1d'),_0x40ca91,JSON[_0x4911('0x13')](_0x39f082));_0x447399(_0x39f082);})['catch'](function(_0x230836){logger[_0x4911('0x14')](_0x4911('0x1d'),_0x230836[_0x4911('0x15')],_0x40ca91);_0x2b4dfb(_0x1babb8[_0x4911('0x14')](0x1f4,_0x230836['message']));});});};exports[_0x4911('0x30')]=function(_0x11c7c1){var _0x470dd0=this;return new Promise(function(_0x198d30,_0x336711){return db[_0x4911('0x18')]['findAll']({'raw':_0x11c7c1[_0x4911('0x1a')]?_0x11c7c1[_0x4911('0x1a')][_0x4911('0x1b')]===undefined?!![]:![]:!![],'where':_0x11c7c1['options']?_0x11c7c1[_0x4911('0x1a')]['where']||null:null,'attributes':[[_0x4911('0x31'),_0x4911('0x32')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db['sequelize']['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x33')))),_0x4911('0x34')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x35')))),_0x4911('0x36')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x25')))),'outboundAnswerCallsDay'],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x37')))),_0x4911('0x38')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')]['literal'](_0x4911('0x39')))),_0x4911('0x3a')],[db['sequelize']['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x3b')))),_0x4911('0x3c')],[db['sequelize']['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')]['literal'](_0x4911('0x3d')))),_0x4911('0x3e')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x3f')))),_0x4911('0x40')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')]('`state`\x20=\x2013,\x201,\x20null'))),_0x4911('0x41')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db['sequelize'][_0x4911('0x24')](_0x4911('0x42')))),_0x4911('0x43')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x44')))),'outboundRejectCallsDay'],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')]['literal'](_0x4911('0x45')))),'outboundAnswerAgiCallsDay'],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x46')))),_0x4911('0x47')],[db['sequelize']['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')](_0x4911('0x48')))),'outboundReCallsDay']],'group':[_0x4911('0x31')]})[_0x4911('0xe')](function(_0x981dff){logger[_0x4911('0xf')](_0x4911('0x30'),_0x11c7c1);logger['debug'](_0x4911('0x30'),_0x11c7c1,JSON[_0x4911('0x13')](_0x981dff));_0x198d30(_0x981dff);})['catch'](function(_0x1e376e){logger[_0x4911('0x14')]('GetVoiceQueueHopperHistory',_0x1e376e['message'],_0x11c7c1);_0x336711(_0x470dd0[_0x4911('0x14')](0x1f4,_0x1e376e[_0x4911('0x15')]));});});};exports[_0x4911('0x49')]=function(_0x1be4f5){var _0x590a96=this;return new Promise(function(_0xac9839,_0x112212){return db['CmHopperHistory'][_0x4911('0x1e')]({'raw':_0x1be4f5[_0x4911('0x1a')]?_0x1be4f5[_0x4911('0x1a')][_0x4911('0x1b')]===undefined?!![]:![]:!![],'where':_0x1be4f5[_0x4911('0x1a')]?_0x1be4f5[_0x4911('0x1a')][_0x4911('0x1f')]||null:null,'attributes':[[_0x4911('0x31'),_0x4911('0x32')],[db['sequelize']['fn'](_0x4911('0x21'),db['sequelize'][_0x4911('0x22')]('id')),_0x4911('0x4a')],[db[_0x4911('0x20')]['fn'](_0x4911('0x21'),db[_0x4911('0x20')]['fn']('IF',db[_0x4911('0x20')][_0x4911('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x4911('0x4b')]],'group':[_0x4911('0x31')]})['then'](function(_0xb9e75e){logger[_0x4911('0xf')](_0x4911('0x49'),_0x1be4f5);logger['debug']('GetCampaignHopperHistory',_0x1be4f5,JSON[_0x4911('0x13')](_0xb9e75e));_0xac9839(_0xb9e75e);})['catch'](function(_0x47911c){logger[_0x4911('0x14')](_0x4911('0x49'),_0x47911c[_0x4911('0x15')],_0x1be4f5);_0x112212(_0x590a96['error'](0x1f4,_0x47911c[_0x4911('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3e4f8ba..9d646e1 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 _0xd6a6=['/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xd6a6,0x126));var _0x6d6a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd6a6[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6d6a('0x0'));var util=require(_0x6d6a('0x1'));var path=require(_0x6d6a('0x2'));var timeout=require(_0x6d6a('0x3'));var express=require('express');var router=express[_0x6d6a('0x4')]();var fs_extra=require(_0x6d6a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d6a('0x6'));var controller=require(_0x6d6a('0x7'));router[_0x6d6a('0x8')]('/',auth[_0x6d6a('0x9')](),controller['index']);router[_0x6d6a('0x8')](_0x6d6a('0xa'),auth[_0x6d6a('0x9')](),controller[_0x6d6a('0xb')]);router[_0x6d6a('0x8')](_0x6d6a('0xc'),auth[_0x6d6a('0x9')](),controller[_0x6d6a('0xd')]);router[_0x6d6a('0xe')]('/',auth['isAuthenticated'](),controller[_0x6d6a('0xf')]);router[_0x6d6a('0x10')](_0x6d6a('0xc'),auth[_0x6d6a('0x9')](),controller[_0x6d6a('0x11')]);module[_0x6d6a('0x12')]=router; \ No newline at end of file +var _0x18d8=['../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','/describe','describe','get','show','post','put','/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe6f9c,_0x39c9de){var _0x3a06ac=function(_0x454f8f){while(--_0x454f8f){_0xe6f9c['push'](_0xe6f9c['shift']());}};_0x3a06ac(++_0x39c9de);}(_0x18d8,0x109));var _0x818d=function(_0x31c6f2,_0x575581){_0x31c6f2=_0x31c6f2-0x0;var _0x13d020=_0x18d8[_0x31c6f2];return _0x13d020;};'use strict';var multer=require('multer');var util=require(_0x818d('0x0'));var path=require(_0x818d('0x1'));var timeout=require(_0x818d('0x2'));var express=require(_0x818d('0x3'));var router=express[_0x818d('0x4')]();var fs_extra=require(_0x818d('0x5'));var auth=require(_0x818d('0x6'));var interaction=require(_0x818d('0x7'));var config=require(_0x818d('0x8'));var controller=require(_0x818d('0x9'));router['get']('/',auth[_0x818d('0xa')](),controller[_0x818d('0xb')]);router['get'](_0x818d('0xc'),auth[_0x818d('0xa')](),controller[_0x818d('0xd')]);router[_0x818d('0xe')]('/:id',auth[_0x818d('0xa')](),controller[_0x818d('0xf')]);router[_0x818d('0x10')]('/',auth[_0x818d('0xa')](),controller['create']);router[_0x818d('0x11')](_0x818d('0x12'),auth[_0x818d('0xa')](),controller[_0x818d('0x13')]);module[_0x818d('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index bfd8424..f26fa9c 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 _0x308a=['STRING','name','sequelize'];(function(_0x20be95,_0x3a60f8){var _0x661441=function(_0x59925b){while(--_0x59925b){_0x20be95['push'](_0x20be95['shift']());}};_0x661441(++_0x3a60f8);}(_0x308a,0x71));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa308('0x0'));module['exports']={'name':{'type':Sequelize[_0xa308('0x1')],'unique':_0xa308('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa308('0x1')]},'dialPrefix':{'type':Sequelize[_0xa308('0x1')]}}; \ No newline at end of file +var _0xac65=['sequelize','exports','STRING'];(function(_0x21c303,_0x1b7a33){var _0x5cfa16=function(_0x144e5e){while(--_0x144e5e){_0x21c303['push'](_0x21c303['shift']());}};_0x5cfa16(++_0x1b7a33);}(_0xac65,0x11d));var _0x5ac6=function(_0x3ec86e,_0x4106b2){_0x3ec86e=_0x3ec86e-0x0;var _0x4df0b6=_0xac65[_0x3ec86e];return _0x4df0b6;};'use strict';var Sequelize=require(_0x5ac6('0x0'));module[_0x5ac6('0x1')]={'name':{'type':Sequelize[_0x5ac6('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5ac6('0x2')]},'dialPrefix':{'type':Sequelize[_0x5ac6('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 140b0b8..5515591 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 _0x32bf=['describe','addDisposition','params','ListId','Disposition','findOne','nolimit','filter','findAll','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','include','show','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x32bf,0xf9));var _0xf32b=function(_0x23f2be,_0x21e788){_0x23f2be=_0x23f2be-0x0;var _0x5eea88=_0x32bf[_0x23f2be];return _0x5eea88;};'use strict';var emlformat=require(_0xf32b('0x0'));var rimraf=require(_0xf32b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf32b('0x2'));var rp=require('request-promise');var moment=require(_0xf32b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf32b('0x4'));var util=require(_0xf32b('0x5'));var path=require(_0xf32b('0x6'));var sox=require('sox');var csv=require(_0xf32b('0x7'));var ejs=require(_0xf32b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf32b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf32b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf32b('0x7'));var querystring=require('querystring');var Papa=require(_0xf32b('0xb'));var Redis=require('ioredis');var authService=require(_0xf32b('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xf32b('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf32b('0xe'))(_0xf32b('0xf'));var utils=require(_0xf32b('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var csv_results;config[_0xf32b('0x11')]=_[_0xf32b('0x12')](config[_0xf32b('0x11')],{'host':_0xf32b('0x13'),'port':0x18eb});var socket=require(_0xf32b('0x14'))(new Redis(config[_0xf32b('0x11')]));require(_0xf32b('0x15'))[_0xf32b('0x16')](socket);function respondWithStatusCode(_0x2940b4,_0x47cc47){_0x47cc47=_0x47cc47||0xcc;return function(_0xc43765){if(_0xc43765){return _0x2940b4[_0xf32b('0x17')](_0x47cc47);}return _0x2940b4[_0xf32b('0x18')](_0x47cc47)[_0xf32b('0x19')]();};}function respondWithResult(_0x231560,_0x4c3356){_0x4c3356=_0x4c3356||0xc8;return function(_0x347feb){if(_0x347feb){return _0x231560['status'](_0x4c3356)[_0xf32b('0x1a')](_0x347feb);}};}function respondWithFilteredResult(_0x1fbf7e,_0x54266f){return function(_0x148639){if(_0x148639){var _0x2ab137=typeof _0x54266f[_0xf32b('0x1b')]===_0xf32b('0x1c')&&typeof _0x54266f[_0xf32b('0x1d')]===_0xf32b('0x1c');var _0x27cc12=_0x148639[_0xf32b('0x1e')];var _0x46f045=_0x2ab137?0x0:_0x54266f[_0xf32b('0x1b')];var _0x2c0f4e=_0x2ab137?_0x148639[_0xf32b('0x1e')]:_0x54266f['offset']+_0x54266f['limit'];var _0x4f3040;if(_0x2c0f4e>=_0x27cc12){_0x2c0f4e=_0x27cc12;_0x4f3040=0xc8;}else{_0x4f3040=0xce;}_0x1fbf7e[_0xf32b('0x18')](_0x4f3040);return _0x1fbf7e['set'](_0xf32b('0x1f'),_0x46f045+'-'+_0x2c0f4e+'/'+_0x27cc12)[_0xf32b('0x1a')](_0x148639);}return null;};}function patchUpdates(_0x4c7982){return function(_0x58a0ae){try{jsonpatch['apply'](_0x58a0ae,_0x4c7982,!![]);}catch(_0x44a51b){return BPromise[_0xf32b('0x20')](_0x44a51b);}return _0x58a0ae[_0xf32b('0x21')]();};}function saveUpdates(_0x1e943f,_0x9744ff){return function(_0x5a4886){if(_0x5a4886){return _0x5a4886[_0xf32b('0x22')](_0x1e943f)[_0xf32b('0x23')](function(_0x6ce394){return _0x6ce394;});}return null;};}function removeEntity(_0x197d83,_0x42dc8f){return function(_0x3540b5){if(_0x3540b5){return _0x3540b5[_0xf32b('0x24')]()['then'](function(){var _0x8a2e13=_0x3540b5[_0xf32b('0x25')]({'plain':!![]});var _0xad781b='Lists';return db['UserProfileResource'][_0xf32b('0x24')]({'where':{'type':_0xad781b,'resourceId':_0x8a2e13['id']}})[_0xf32b('0x23')](function(){return _0x3540b5;});})[_0xf32b('0x23')](function(){_0x197d83['status'](0xcc)[_0xf32b('0x19')]();});}};}function handleEntityNotFound(_0x481615,_0x57df47){return function(_0x21d8f8){if(!_0x21d8f8){_0x481615[_0xf32b('0x17')](0x194);}return _0x21d8f8;};}function handleError(_0x508257,_0x1d82f3){_0x1d82f3=_0x1d82f3||0x1f4;return function(_0x307852){logger[_0xf32b('0x26')](_0x307852[_0xf32b('0x27')]);if(_0x307852[_0xf32b('0x28')]){delete _0x307852[_0xf32b('0x28')];}_0x508257[_0xf32b('0x18')](_0x1d82f3)['send'](_0x307852);};}exports[_0xf32b('0x29')]=function(_0x5519ef,_0x432727){var _0x1454db={},_0x39132d={},_0x10578c={'count':0x0,'rows':[]};var _0x11f7ab=_[_0xf32b('0x2a')](db[_0xf32b('0x2b')][_0xf32b('0x2c')],function(_0x41c0cf){return{'name':_0x41c0cf[_0xf32b('0x2d')],'type':_0x41c0cf[_0xf32b('0x2e')][_0xf32b('0x2f')]};});_0x39132d[_0xf32b('0x30')]=_[_0xf32b('0x2a')](_0x11f7ab,'name');_0x39132d[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x5519ef['query']);_0x39132d[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0x39132d[_0xf32b('0x30')],_0x39132d['query']);_0x1454db[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0x39132d[_0xf32b('0x30')],qs[_0xf32b('0x36')](_0x5519ef['query'][_0xf32b('0x36')]));_0x1454db[_0xf32b('0x35')]=_0x1454db[_0xf32b('0x35')]['length']?_0x1454db['attributes']:_0x39132d['model'];if(!_0x5519ef[_0xf32b('0x31')][_0xf32b('0x37')]('nolimit')){_0x1454db[_0xf32b('0x1d')]=qs[_0xf32b('0x1d')](_0x5519ef[_0xf32b('0x31')][_0xf32b('0x1d')]);_0x1454db[_0xf32b('0x1b')]=qs['offset'](_0x5519ef[_0xf32b('0x31')][_0xf32b('0x1b')]);}_0x1454db[_0xf32b('0x38')]=qs[_0xf32b('0x39')](_0x5519ef[_0xf32b('0x31')][_0xf32b('0x39')]);_0x1454db[_0xf32b('0x3a')]=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x5519ef[_0xf32b('0x31')],_0x39132d['filters']),_0x11f7ab);if(_0x5519ef[_0xf32b('0x31')]['filter']){_0x1454db[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x1454db['where'],{'$or':_[_0xf32b('0x2a')](_0x11f7ab,function(_0x1944cd){if(_0x1944cd['type']!==_0xf32b('0x3d')){var _0x33434e={};_0x33434e[_0x1944cd[_0xf32b('0x28')]]={'$like':'%'+_0x5519ef[_0xf32b('0x31')]['filter']+'%'};return _0x33434e;}})});}_0x1454db=_['merge']({},_0x1454db,_0x5519ef['options']);var _0x4334dd={'where':_0x1454db[_0xf32b('0x3a')]};return db['CmList'][_0xf32b('0x1e')](_0x4334dd)[_0xf32b('0x23')](function(_0x7bda7c){_0x10578c[_0xf32b('0x1e')]=_0x7bda7c;if(_0x5519ef[_0xf32b('0x31')][_0xf32b('0x3e')]){_0x1454db[_0xf32b('0x3f')]=[{'all':!![]}];}return db[_0xf32b('0x2b')]['findAll'](_0x1454db);})[_0xf32b('0x23')](function(_0x3ffd66){_0x10578c['rows']=_0x3ffd66;return _0x10578c;})[_0xf32b('0x23')](respondWithFilteredResult(_0x432727,_0x1454db))['catch'](handleError(_0x432727,null));};exports[_0xf32b('0x40')]=function(_0x2dfda7,_0x3df429){var _0x49ed45={'raw':![],'where':{'id':_0x2dfda7['params']['id']}},_0x3968ba={};_0x3968ba['model']=_[_0xf32b('0x32')](db['CmList']['rawAttributes']);_0x3968ba['query']=_[_0xf32b('0x32')](_0x2dfda7[_0xf32b('0x31')]);_0x3968ba[_0xf32b('0x33')]=_['intersection'](_0x3968ba[_0xf32b('0x30')],_0x3968ba[_0xf32b('0x31')]);_0x49ed45[_0xf32b('0x35')]=_['intersection'](_0x3968ba[_0xf32b('0x30')],qs[_0xf32b('0x36')](_0x2dfda7[_0xf32b('0x31')]['fields']));_0x49ed45[_0xf32b('0x35')]=_0x49ed45[_0xf32b('0x35')][_0xf32b('0x41')]?_0x49ed45[_0xf32b('0x35')]:_0x3968ba[_0xf32b('0x30')];if(_0x2dfda7[_0xf32b('0x31')]['includeAll']){_0x49ed45[_0xf32b('0x3f')]=[{'all':!![]}];}_0x49ed45=_['merge']({},_0x49ed45,_0x2dfda7[_0xf32b('0x42')]);return db[_0xf32b('0x2b')][_0xf32b('0x43')](_0x49ed45)[_0xf32b('0x23')](handleEntityNotFound(_0x3df429,null))[_0xf32b('0x23')](respondWithResult(_0x3df429,null))[_0xf32b('0x44')](handleError(_0x3df429,null));};exports[_0xf32b('0x45')]=function(_0x46bce9,_0x2a4b9c){return db[_0xf32b('0x2b')][_0xf32b('0x45')](_0x46bce9[_0xf32b('0x46')],{})[_0xf32b('0x23')](function(_0x577b3f){var _0x30c58a=_0x46bce9[_0xf32b('0x47')][_0xf32b('0x25')]({'plain':!![]});if(!_0x30c58a)throw new Error(_0xf32b('0x48'));if(_0x30c58a[_0xf32b('0x49')]===_0xf32b('0x47')){var _0x53edd7=_0x577b3f['get']({'plain':!![]});var _0x4851c0=_0xf32b('0x4a');return db[_0xf32b('0x4b')][_0xf32b('0x43')]({'where':{'name':_0x4851c0,'userProfileId':_0x30c58a[_0xf32b('0x4c')]},'raw':!![]})['then'](function(_0x2044a1){if(_0x2044a1&&_0x2044a1['autoAssociation']===0x0){return db[_0xf32b('0x4d')][_0xf32b('0x45')]({'name':_0x53edd7[_0xf32b('0x28')],'resourceId':_0x53edd7['id'],'type':_0x2044a1['name'],'sectionId':_0x2044a1['id']},{})[_0xf32b('0x23')](function(){return _0x577b3f;});}else{return _0x577b3f;}})[_0xf32b('0x44')](function(_0xac69b6){logger[_0xf32b('0x26')](_0xf32b('0x4e'),_0xac69b6);throw _0xac69b6;});}return _0x577b3f;})[_0xf32b('0x23')](respondWithResult(_0x2a4b9c,0xc9))['catch'](handleError(_0x2a4b9c,null));};exports['update']=function(_0x59ac1b,_0x37d567){if(_0x59ac1b[_0xf32b('0x46')]['id']){delete _0x59ac1b[_0xf32b('0x46')]['id'];}return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x59ac1b['params']['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x37d567,null))[_0xf32b('0x23')](saveUpdates(_0x59ac1b[_0xf32b('0x46')],null))[_0xf32b('0x23')](respondWithResult(_0x37d567,null))[_0xf32b('0x44')](handleError(_0x37d567,null));};exports[_0xf32b('0x24')]=function(_0x58048e,_0x51460c){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x58048e['params']['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x51460c,null))[_0xf32b('0x23')](removeEntity(_0x51460c,null))[_0xf32b('0x44')](handleError(_0x51460c,null));};exports[_0xf32b('0x4f')]=function(_0x5b428e,_0x211c21){return db[_0xf32b('0x2b')][_0xf32b('0x4f')]()[_0xf32b('0x23')](respondWithResult(_0x211c21,null))[_0xf32b('0x44')](handleError(_0x211c21,null));};exports[_0xf32b('0x50')]=function(_0x3c6102,_0x58c372,_0x247385){if(_0x3c6102['body']['id']){delete _0x3c6102['body']['id'];}return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x3c6102[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x58c372,null))[_0xf32b('0x23')](function(_0x499e8a){if(_0x499e8a){_0x3c6102[_0xf32b('0x46')][_0xf32b('0x52')]=_0x499e8a['id'];return db[_0xf32b('0x53')][_0xf32b('0x45')](_0x3c6102[_0xf32b('0x46')]);}})[_0xf32b('0x23')](respondWithResult(_0x58c372,null))[_0xf32b('0x44')](handleError(_0x58c372,null));};exports['getDispositions']=function(_0x2e8c32,_0x122ac7,_0x3321bc){var _0x550ac3={'raw':![],'where':{}};var _0x16302f={};var _0x452beb={'count':0x0,'rows':[]};return db[_0xf32b('0x2b')][_0xf32b('0x54')]({'where':{'id':_0x2e8c32[_0xf32b('0x51')]['id']}})['then'](handleEntityNotFound(_0x122ac7,null))['then'](function(_0x36992e){if(_0x36992e){_0x16302f[_0xf32b('0x30')]=_[_0xf32b('0x32')](db[_0xf32b('0x53')][_0xf32b('0x2c')]);_0x16302f[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x2e8c32[_0xf32b('0x31')]);_0x16302f[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0x16302f[_0xf32b('0x30')],_0x16302f[_0xf32b('0x31')]);_0x550ac3[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0x16302f['model'],qs[_0xf32b('0x36')](_0x2e8c32[_0xf32b('0x31')]['fields']));_0x550ac3[_0xf32b('0x35')]=_0x550ac3[_0xf32b('0x35')][_0xf32b('0x41')]?_0x550ac3[_0xf32b('0x35')]:_0x16302f[_0xf32b('0x30')];if(!_0x2e8c32['query'][_0xf32b('0x37')](_0xf32b('0x55'))){_0x550ac3[_0xf32b('0x1d')]=qs[_0xf32b('0x1d')](_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x1d')]);_0x550ac3['offset']=qs[_0xf32b('0x1b')](_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x1b')]);}_0x550ac3[_0xf32b('0x38')]=qs['sort'](_0x2e8c32[_0xf32b('0x31')]['sort']);_0x550ac3['where']=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x2e8c32['query'],_0x16302f[_0xf32b('0x33')]));_0x550ac3[_0xf32b('0x3a')][_0xf32b('0x52')]=_0x36992e['id'];if(_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x56')]){_0x550ac3[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x550ac3[_0xf32b('0x3a')],{'$or':_[_0xf32b('0x2a')](_0x550ac3[_0xf32b('0x35')],function(_0x14a770){var _0x38abf5={};_0x38abf5[_0x14a770]={'$like':'%'+_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x56')]+'%'};return _0x38abf5;})});}_0x550ac3=_[_0xf32b('0x3c')]({},_0x550ac3,_0x2e8c32[_0xf32b('0x42')]);return db[_0xf32b('0x53')][_0xf32b('0x1e')]({'where':_0x550ac3[_0xf32b('0x3a')]})[_0xf32b('0x23')](function(_0x2b3394){_0x452beb['count']=_0x2b3394;if(_0x2e8c32[_0xf32b('0x31')][_0xf32b('0x3e')]){_0x550ac3['include']=[{'all':!![]}];}return db[_0xf32b('0x53')][_0xf32b('0x57')](_0x550ac3);})[_0xf32b('0x23')](function(_0x219278){_0x452beb[_0xf32b('0x58')]=_0x219278;return _0x452beb;});}})[_0xf32b('0x23')](respondWithFilteredResult(_0x122ac7,_0x550ac3))['catch'](handleError(_0x122ac7,null));};exports[_0xf32b('0x59')]=function(_0x367007,_0xc7834e,_0x29592a){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x367007[_0xf32b('0x51')]['id']}})['then'](handleEntityNotFound(_0xc7834e,null))[_0xf32b('0x23')](function(_0x5b8cf2){if(_0x5b8cf2){return _0x5b8cf2[_0xf32b('0x59')](_0x367007[_0xf32b('0x31')]['ids']);}})[_0xf32b('0x23')](respondWithStatusCode(_0xc7834e,null))[_0xf32b('0x44')](handleError(_0xc7834e,null));};exports[_0xf32b('0x5a')]=function(_0x5762b1,_0x44ba1b,_0x5960aa){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x5762b1[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x44ba1b,null))[_0xf32b('0x23')](function(_0x7c015b){if(_0x7c015b){var _0x4e1d29=[];var _0x250a46={'success':[],'errors':[]};return db[_0xf32b('0x5b')][_0xf32b('0x4f')]()[_0xf32b('0x23')](function(_0x15dbaa){if(_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')]&&_[_0xf32b('0x5d')](_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')])){if(_0x5762b1[_0xf32b('0x46')]['tags'][_0xf32b('0x41')]){_0x5762b1['body'][_0xf32b('0x5c')]=_0x5762b1['body'][_0xf32b('0x5c')][_0xf32b('0x5e')](';')+';';}else{_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')]=null;}}else{_0x5762b1[_0xf32b('0x46')][_0xf32b('0x5c')]=null;}if(_0x5762b1['body']&&_['isArray'](_0x5762b1[_0xf32b('0x46')])){for(var _0x341d40=0x0;_0x341d40<_0x5762b1['body'][_0xf32b('0x41')];_0x341d40+=0x1){_0x5762b1['body'][_0x341d40]['ListId']=_0x5762b1[_0xf32b('0x51')]['id'];_0x4e1d29[_0xf32b('0x5f')](_0x5762b1['body'][_0x341d40]);}return BPromise[_0xf32b('0x60')](_0x4e1d29,function(_0x40216e){return db[_0xf32b('0x5b')][_0xf32b('0x45')](_['omit'](_0x40216e,[_0xf32b('0x61'),'id'])||{},{'fields':_[_0xf32b('0x32')](_0x15dbaa),'raw':!![]})[_0xf32b('0x23')](function(_0x15a608){_0x250a46[_0xf32b('0x62')]['push'](_0x15a608[_0xf32b('0x63')]);})[_0xf32b('0x44')](function(_0x4926a3){_0x250a46[_0xf32b('0x64')][_0xf32b('0x5f')]({'data':_0x40216e,'error':_0x4926a3[_0xf32b('0x65')]});});})[_0xf32b('0x23')](function(_0x2e2b0c){return _0x250a46;})['catch'](function(_0x1a6bd1){return _0x1a6bd1;});}else{_0x44ba1b[_0xf32b('0x18')](0x190)[_0xf32b('0x1a')]({'message':_0xf32b('0x66')});}});}})['then'](respondWithResult(_0x44ba1b,null))[_0xf32b('0x44')](handleError(_0x44ba1b,null));};exports[_0xf32b('0x67')]=function(_0x2ca96d,_0x3dc2a5,_0x4aa3af){var _0x129e0f;return db[_0xf32b('0x2b')]['find']({'where':{'id':_0x2ca96d[_0xf32b('0x51')]['id']},'include':[{'model':db[_0xf32b('0x68')],'as':'CustomFields'}]})[_0xf32b('0x23')](handleEntityNotFound(_0x3dc2a5,null))[_0xf32b('0x23')](function(_0x1f679c){if(_0x1f679c){_0x129e0f=_0x1f679c;return db[_0xf32b('0x5b')][_0xf32b('0x2c')];}})['then'](function(_0xe3615f){if(_0xe3615f){var _0x26a3b8={};var _0x177883={};_0x177883[_0xf32b('0x30')]=_[_0xf32b('0x69')](_[_0xf32b('0x32')](_0xe3615f),_['map'](_0x129e0f[_0xf32b('0x6a')],function(_0x503fb6){return util[_0xf32b('0x6b')](_0xf32b('0x6c'),_0x503fb6['id']);}));_0x177883[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x2ca96d[_0xf32b('0x31')]);_0x177883['filters']=_[_0xf32b('0x34')](_0x177883[_0xf32b('0x30')],_0x177883[_0xf32b('0x31')]);_0x26a3b8[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0x177883['model'],qs[_0xf32b('0x36')](_0x2ca96d[_0xf32b('0x31')]['fields']));_0x26a3b8[_0xf32b('0x35')]=_0x26a3b8[_0xf32b('0x35')]['length']?_0x26a3b8[_0xf32b('0x35')]:_0x177883[_0xf32b('0x30')];if(!_0x2ca96d['query'][_0xf32b('0x37')](_0xf32b('0x55'))){_0x26a3b8['limit']=qs[_0xf32b('0x1d')](_0x2ca96d['query'][_0xf32b('0x1d')]);_0x26a3b8[_0xf32b('0x1b')]=qs[_0xf32b('0x1b')](_0x2ca96d[_0xf32b('0x31')][_0xf32b('0x1b')]);}_0x26a3b8[_0xf32b('0x38')]=qs['sort'](_0x2ca96d[_0xf32b('0x31')][_0xf32b('0x39')]);_0x26a3b8['where']=qs['filters'](_[_0xf32b('0x3b')](_0x2ca96d[_0xf32b('0x31')],_0x177883['filters']));_0x26a3b8[_0xf32b('0x6d')]=!![];if(_0x2ca96d[_0xf32b('0x31')][_0xf32b('0x56')]){_0x26a3b8[_0xf32b('0x3a')]=_['merge'](_0x26a3b8['where'],{'$or':_['map'](_0x26a3b8[_0xf32b('0x35')],function(_0x3e8230){var _0x30021b={};_0x30021b[_0x3e8230]={'$like':'%'+_0x2ca96d['query']['filter']+'%'};return _0x30021b;})});}_0x26a3b8=_['merge']({},_0x26a3b8,_0x2ca96d[_0xf32b('0x42')]);return _0x129e0f[_0xf32b('0x67')](_0x26a3b8);}})[_0xf32b('0x23')](respondWithResult(_0x3dc2a5,null))[_0xf32b('0x44')](handleError(_0x3dc2a5,null));};exports[_0xf32b('0x6e')]=function(_0x1c657e,_0x172d4a,_0x346d96){var _0x181b08;var _0x48c461;var _0x421c35;var _0x5994a5=_0x1c657e[_0xf32b('0x51')]['id'];csv_results=[];return db[_0xf32b('0x6f')][_0xf32b('0x57')]({'attributes':['id',_0xf32b('0x28')],'raw':!![],'order':[_0xf32b('0x70')]})[_0xf32b('0x23')](function(_0x344a3d){_0x181b08=_0x344a3d;var _0x41d116=_[_0xf32b('0x32')](db[_0xf32b('0x5b')]['rawAttributes']);return db[_0xf32b('0x68')][_0xf32b('0x57')]({'raw':!![],'attributes':['id',_0xf32b('0x71')]})[_0xf32b('0x23')](function(_0x379e4e){_0x48c461=_0x379e4e;var _0x40e949=squel[_0xf32b('0x72')]()['fields'](_0x41d116)[_0xf32b('0x73')](_0xf32b('0x74'),'c')[_0xf32b('0x3a')](_0xf32b('0x75'),_0x5994a5)[_0xf32b('0x3a')](_0xf32b('0x76'))[_0xf32b('0x77')]();for(var _0x4f678d=0x0;_0x4f678d<_0x48c461[_0xf32b('0x41')];_0x4f678d++){_0x40e949[_0xf32b('0x78')](_0xf32b('0x79')+_0x48c461[_0x4f678d]['id'],_0xf32b('0x7a')+_0x48c461[_0x4f678d][_0xf32b('0x71')]);}for(var _0x4f678d=0x0;_0x4f678d<_0x181b08[_0xf32b('0x41')];_0x4f678d++){_0x40e949['field'](squel[_0xf32b('0x72')]()[_0xf32b('0x78')](_0xf32b('0x7b'))[_0xf32b('0x73')](_0xf32b('0x7c'))['where'](_0xf32b('0x7d'),_0x181b08[_0x4f678d]['id'])[_0xf32b('0x3a')]('CmContactId\x20=\x20c.id'),_0xf32b('0x7e')+_0x181b08[_0x4f678d][_0xf32b('0x28')]);_0x40e949[_0xf32b('0x78')](squel[_0xf32b('0x72')]()[_0xf32b('0x78')](_0xf32b('0x7f'))[_0xf32b('0x73')](_0xf32b('0x7c'))['where']('ItemTypeId\x20=\x20?',_0x181b08[_0x4f678d]['id'])[_0xf32b('0x3a')](_0xf32b('0x80')),'description_additionalPhone_'+_0x181b08[_0x4f678d]['name']);}var _0x5d5066=[];_0x5d5066[_0xf32b('0x5f')](_0x40e949[_0xf32b('0x81')]());BPromise[_0xf32b('0x60')](_0x5d5066,handleQuery)[_0xf32b('0x23')](function(_0x4e453a){handleQuery(_0x40e949[_0xf32b('0x81')]());var _0x237242=csv_results[0x0];if(!_[_0xf32b('0x82')](_0x237242)){var _0x5182c8=toCsv(_0x237242);var _0x41b48e=Date[_0xf32b('0x83')]();fs[_0xf32b('0x84')](util[_0xf32b('0x6b')](_0xf32b('0x85'),_0x5994a5,_0x41b48e),_0x5182c8);_0x172d4a['setHeader'](_0xf32b('0x86'),_0xf32b('0x87')+util[_0xf32b('0x6b')](_0xf32b('0x88'),_0x5994a5,_0x41b48e));_0x172d4a[_0xf32b('0x89')](_0xf32b('0x8a'),_0xf32b('0x8b'));return _0x172d4a['download'](util[_0xf32b('0x6b')](_0xf32b('0x85'),_0x5994a5,_0x41b48e));}else{return _0x172d4a[_0xf32b('0x17')](0xcc);}});});});};exports['addCustomField']=function(_0x999d6d,_0x2f089e,_0x11bb73){var _0x131fb9;delete _0x999d6d[_0xf32b('0x46')]['id'];return db[_0xf32b('0x2b')][_0xf32b('0x54')]({'where':{'id':_0x999d6d[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x2f089e,null))[_0xf32b('0x23')](function(_0x548105){if(_0x548105){return db[_0xf32b('0x8c')][_0xf32b('0x8d')](function(_0x58e320){return db['CmCustomField']['create'](_0x999d6d['body'],{'transaction':_0x58e320})['then'](function(_0x1bc9d1){_0x131fb9=_0x1bc9d1;return _0x548105[_0xf32b('0x8e')](_0x1bc9d1,{'transaction':_0x58e320});})[_0xf32b('0x23')](function(){var _0x3ce490={'type':db[_0xf32b('0x8f')][_0xf32b('0x90')],'transaction':_0x58e320};switch(_0x999d6d[_0xf32b('0x46')][_0xf32b('0x2e')]){case'text':_0x3ce490[_0xf32b('0x2e')]=db['Sequelize'][_0xf32b('0x90')];break;case _0xf32b('0x91'):_0x3ce490['type']=db[_0xf32b('0x8f')][_0xf32b('0x92')];break;case _0xf32b('0x93'):_0x3ce490['type']=db[_0xf32b('0x8f')]['BOOLEAN'];_0x3ce490['defaultValue']=![];break;default:}return db[_0xf32b('0x8c')][_0xf32b('0x94')][_0xf32b('0x95')]('cm_contacts',util['format'](_0xf32b('0x96'),_0x131fb9['id']),_0x3ce490);})[_0xf32b('0x23')](function(){return _0x131fb9;});});}})[_0xf32b('0x23')](respondWithResult(_0x2f089e,null))[_0xf32b('0x44')](handleError(_0x2f089e,null));};exports[_0xf32b('0x97')]=function(_0x460e18,_0x5a533f,_0x123e1c){var _0x5973f7={};var _0x210e5e={};var _0x5e16de;var _0x484c91;return db[_0xf32b('0x2b')]['findOne']({'where':{'id':_0x460e18['params']['id']}})['then'](handleEntityNotFound(_0x5a533f,null))[_0xf32b('0x23')](function(_0x3dd896){if(_0x3dd896){_0x5e16de=_0x3dd896;_0x210e5e[_0xf32b('0x30')]=_[_0xf32b('0x32')](db[_0xf32b('0x68')]['rawAttributes']);_0x210e5e[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x460e18[_0xf32b('0x31')]);_0x210e5e[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0x210e5e[_0xf32b('0x30')],_0x210e5e[_0xf32b('0x31')]);_0x5973f7[_0xf32b('0x35')]=_['intersection'](_0x210e5e['model'],qs[_0xf32b('0x36')](_0x460e18[_0xf32b('0x31')][_0xf32b('0x36')]));_0x5973f7[_0xf32b('0x35')]=_0x5973f7['attributes'][_0xf32b('0x41')]?_0x5973f7[_0xf32b('0x35')]:_0x210e5e[_0xf32b('0x30')];_0x5973f7[_0xf32b('0x38')]=qs[_0xf32b('0x39')](_0x460e18[_0xf32b('0x31')]['sort']);_0x5973f7[_0xf32b('0x3a')]=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x460e18[_0xf32b('0x31')],_0x210e5e[_0xf32b('0x33')]));_0x5973f7[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x5973f7[_0xf32b('0x3a')],{'$or':[{'ListId':_0x3dd896['id']},{'ListId':null}]});if(_0x460e18[_0xf32b('0x31')][_0xf32b('0x56')]){_0x5973f7[_0xf32b('0x3a')]=_['merge'](_0x5973f7[_0xf32b('0x3a')],{'$or':_[_0xf32b('0x2a')](_0x5973f7[_0xf32b('0x35')],function(_0x2821ee){var _0x4703e3={};_0x4703e3[_0x2821ee]={'$like':'%'+_0x460e18[_0xf32b('0x31')][_0xf32b('0x56')]+'%'};return _0x4703e3;})});}_0x5973f7=_[_0xf32b('0x3c')]({},_0x5973f7,_0x460e18[_0xf32b('0x42')]);return db[_0xf32b('0x68')][_0xf32b('0x98')](_0x5973f7);}})[_0xf32b('0x23')](respondWithResult(_0x5a533f,null))[_0xf32b('0x44')](handleError(_0x5a533f,null));};exports[_0xf32b('0x99')]=function(_0x18e48f,_0x4596f3){return db[_0xf32b('0x68')][_0xf32b('0x98')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x4596f3,null))[_0xf32b('0x23')](function(_0x22b2d7){return _0x22b2d7;})[_0xf32b('0x23')](respondWithResult(_0x4596f3,null))['catch'](handleError(_0x4596f3,null));};exports[_0xf32b('0x9a')]=function(_0x2b5168,_0x4a5606,_0x13260b){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x2b5168[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x4a5606,null))['then'](function(_0x27aabe){if(_0x27aabe){return _0x27aabe[_0xf32b('0x9a')](_0x2b5168['body']['ids'],_[_0xf32b('0x9b')](_0x2b5168['body'],[_0xf32b('0x61'),'id'])||{})[_0xf32b('0x9c')](function(_0x3441d8){for(var _0x215279=0x0;_0x215279<_0x2b5168[_0xf32b('0x46')][_0xf32b('0x61')][_0xf32b('0x41')];_0x215279+=0x1){socket[_0xf32b('0x9d')](_0xf32b('0x9e'),{'UserId':Number(_0x2b5168[_0xf32b('0x46')][_0xf32b('0x61')][_0x215279]),'CmListId':Number(_0x2b5168[_0xf32b('0x51')]['id'])});}return _0x3441d8;});}})['then'](respondWithResult(_0x4a5606,null))[_0xf32b('0x44')](handleError(_0x4a5606,null));};exports[_0xf32b('0x9f')]=function(_0x9d90fc,_0x4dffec,_0x16bd6f){return db[_0xf32b('0x2b')][_0xf32b('0x43')]({'where':{'id':_0x9d90fc[_0xf32b('0x51')]['id']}})[_0xf32b('0x23')](handleEntityNotFound(_0x4dffec,null))[_0xf32b('0x23')](function(_0x53764a){if(_0x53764a){return _0x53764a[_0xf32b('0x9f')](_0x9d90fc['query'][_0xf32b('0x61')])['then'](function(){if(_[_0xf32b('0x5d')](_0x9d90fc[_0xf32b('0x31')][_0xf32b('0x61')])){for(var _0x3c75bc=0x0;_0x3c75bc<_0x9d90fc[_0xf32b('0x31')][_0xf32b('0x61')][_0xf32b('0x41')];_0x3c75bc+=0x1){socket[_0xf32b('0x9d')](_0xf32b('0xa0'),{'UserId':Number(_0x9d90fc['query'][_0xf32b('0x61')][_0x3c75bc]),'CmListId':Number(_0x9d90fc['params']['id'])});}}else{socket[_0xf32b('0x9d')](_0xf32b('0xa0'),{'UserId':Number(_0x9d90fc['query'][_0xf32b('0x61')]),'CmListId':Number(_0x9d90fc['params']['id'])});}});}})[_0xf32b('0x23')](respondWithStatusCode(_0x4dffec,null))[_0xf32b('0x44')](handleError(_0x4dffec,null));};exports[_0xf32b('0xa1')]=function(_0x183066,_0x22f89f,_0x2ed169){var _0x3f975c={};var _0xf2e82a={};var _0x5a7d3c;var _0x2e2b76;return db[_0xf32b('0x2b')][_0xf32b('0x54')]({'where':{'id':_0x183066['params']['id']}})['then'](handleEntityNotFound(_0x22f89f,null))[_0xf32b('0x23')](function(_0x5b4ab3){if(_0x5b4ab3){_0x5a7d3c=_0x5b4ab3;_0xf2e82a[_0xf32b('0x30')]=_[_0xf32b('0x32')](db[_0xf32b('0xa2')][_0xf32b('0x2c')]);_0xf2e82a[_0xf32b('0x31')]=_[_0xf32b('0x32')](_0x183066[_0xf32b('0x31')]);_0xf2e82a[_0xf32b('0x33')]=_[_0xf32b('0x34')](_0xf2e82a[_0xf32b('0x30')],_0xf2e82a['query']);_0x3f975c[_0xf32b('0x35')]=_[_0xf32b('0x34')](_0xf2e82a['model'],qs[_0xf32b('0x36')](_0x183066['query'][_0xf32b('0x36')]));_0x3f975c[_0xf32b('0x35')]=_0x3f975c[_0xf32b('0x35')]['length']?_0x3f975c[_0xf32b('0x35')]:_0xf2e82a['model'];_0x3f975c['order']=qs[_0xf32b('0x39')](_0x183066[_0xf32b('0x31')]['sort']);_0x3f975c[_0xf32b('0x3a')]=qs[_0xf32b('0x33')](_[_0xf32b('0x3b')](_0x183066['query'],_0xf2e82a[_0xf32b('0x33')]));if(_0x183066['query']['filter']){_0x3f975c[_0xf32b('0x3a')]=_[_0xf32b('0x3c')](_0x3f975c[_0xf32b('0x3a')],{'$or':_[_0xf32b('0x2a')](_0x3f975c[_0xf32b('0x35')],function(_0x52bbf5){var _0x3c9435={};_0x3c9435[_0x52bbf5]={'$like':'%'+_0x183066[_0xf32b('0x31')]['filter']+'%'};return _0x3c9435;})});}_0x3f975c=_[_0xf32b('0x3c')]({},_0x3f975c,_0x183066[_0xf32b('0x42')]);return _0x5a7d3c['getAgents'](_0x3f975c);}})[_0xf32b('0x23')](function(_0xc75f8e){if(_0xc75f8e){_0x2e2b76=_0xc75f8e[_0xf32b('0x41')];if(!_0x183066[_0xf32b('0x31')]['hasOwnProperty'](_0xf32b('0x55'))){_0x3f975c[_0xf32b('0x1d')]=qs['limit'](_0x183066['query'][_0xf32b('0x1d')]);_0x3f975c[_0xf32b('0x1b')]=qs['offset'](_0x183066[_0xf32b('0x31')][_0xf32b('0x1b')]);}return _0x5a7d3c[_0xf32b('0xa1')](_0x3f975c);}})[_0xf32b('0x23')](function(_0xedf72b){if(_0xedf72b){return _0xedf72b?{'count':_0x2e2b76,'rows':_0xedf72b}:null;}})['then'](respondWithResult(_0x22f89f,null))[_0xf32b('0x44')](handleError(_0x22f89f,null));};function handleQuery(_0x4a9b5a){logger[_0xf32b('0xa3')](_0x4a9b5a);return db[_0xf32b('0x8c')][_0xf32b('0x31')](_0x4a9b5a)[_0xf32b('0x9c')](function(_0x10632f){csv_results[_0xf32b('0x5f')](_0x10632f);})[_0xf32b('0x44')](function(_0x559df5){logger[_0xf32b('0x26')](_0x559df5[_0xf32b('0x65')]);});} \ No newline at end of file +var _0x0ae6=['c.cf_','customField_','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','download','Sequelize','text','number','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','get','Lists','error','name','send','index','map','CmList','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ListId','Disposition','findOne','removeDispositions','addContacts','CmContact','tags','join','isArray','push','each','omit','ids','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','nolimit','raw','ContactItemType','alias','select','c.ListId\x20=\x20?','field'];(function(_0x5927af,_0x4c56da){var _0x460dde=function(_0x18fb38){while(--_0x18fb38){_0x5927af['push'](_0x5927af['shift']());}};_0x460dde(++_0x4c56da);}(_0x0ae6,0x164));var _0x60ae=function(_0x493bf4,_0x17ed8f){_0x493bf4=_0x493bf4-0x0;var _0x28f46a=_0x0ae6[_0x493bf4];return _0x28f46a;};'use strict';var emlformat=require(_0x60ae('0x0'));var rimraf=require(_0x60ae('0x1'));var zipdir=require(_0x60ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x60ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x60ae('0x4'));var util=require(_0x60ae('0x5'));var path=require(_0x60ae('0x6'));var sox=require(_0x60ae('0x7'));var csv=require(_0x60ae('0x8'));var ejs=require(_0x60ae('0x9'));var fs=require('fs');var fs_extra=require(_0x60ae('0xa'));var _=require(_0x60ae('0xb'));var squel=require(_0x60ae('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x60ae('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x60ae('0xe'));var Redis=require(_0x60ae('0xf'));var authService=require(_0x60ae('0x10'));var qs=require(_0x60ae('0x11'));var as=require(_0x60ae('0x12'));var hardwareService=require(_0x60ae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x60ae('0x14'));var config=require(_0x60ae('0x15'));var licenseUtil=require(_0x60ae('0x16'));var db=require(_0x60ae('0x17'))['db'];var csv_results;config['redis']=_[_0x60ae('0x18')](config[_0x60ae('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x60ae('0x1a'))[_0x60ae('0x1b')](socket);function respondWithStatusCode(_0x27b0b5,_0x54cf36){_0x54cf36=_0x54cf36||0xcc;return function(_0x45a6bc){if(_0x45a6bc){return _0x27b0b5[_0x60ae('0x1c')](_0x54cf36);}return _0x27b0b5[_0x60ae('0x1d')](_0x54cf36)[_0x60ae('0x1e')]();};}function respondWithResult(_0x5361d7,_0x142e84){_0x142e84=_0x142e84||0xc8;return function(_0x2cc5a5){if(_0x2cc5a5){return _0x5361d7[_0x60ae('0x1d')](_0x142e84)[_0x60ae('0x1f')](_0x2cc5a5);}};}function respondWithFilteredResult(_0x45a9ff,_0x11951e){return function(_0x525dac){if(_0x525dac){var _0x47a73c=typeof _0x11951e['offset']===_0x60ae('0x20')&&typeof _0x11951e[_0x60ae('0x21')]===_0x60ae('0x20');var _0x344f81=_0x525dac[_0x60ae('0x22')];var _0x424c48=_0x47a73c?0x0:_0x11951e[_0x60ae('0x23')];var _0x368d75=_0x47a73c?_0x525dac[_0x60ae('0x22')]:_0x11951e[_0x60ae('0x23')]+_0x11951e['limit'];var _0x1bc443;if(_0x368d75>=_0x344f81){_0x368d75=_0x344f81;_0x1bc443=0xc8;}else{_0x1bc443=0xce;}_0x45a9ff['status'](_0x1bc443);return _0x45a9ff[_0x60ae('0x24')](_0x60ae('0x25'),_0x424c48+'-'+_0x368d75+'/'+_0x344f81)[_0x60ae('0x1f')](_0x525dac);}return null;};}function patchUpdates(_0x48a0e0){return function(_0x3db0ba){try{jsonpatch['apply'](_0x3db0ba,_0x48a0e0,!![]);}catch(_0x341bb1){return BPromise[_0x60ae('0x26')](_0x341bb1);}return _0x3db0ba[_0x60ae('0x27')]();};}function saveUpdates(_0x4bf65c,_0x22423a){return function(_0x5cf9c3){if(_0x5cf9c3){return _0x5cf9c3['update'](_0x4bf65c)[_0x60ae('0x28')](function(_0x4d6e59){return _0x4d6e59;});}return null;};}function removeEntity(_0x2f6561,_0x44920f){return function(_0x1fcac8){if(_0x1fcac8){return _0x1fcac8[_0x60ae('0x29')]()[_0x60ae('0x28')](function(){var _0x3c036d=_0x1fcac8[_0x60ae('0x2a')]({'plain':!![]});var _0x57b95a=_0x60ae('0x2b');return db['UserProfileResource'][_0x60ae('0x29')]({'where':{'type':_0x57b95a,'resourceId':_0x3c036d['id']}})[_0x60ae('0x28')](function(){return _0x1fcac8;});})[_0x60ae('0x28')](function(){_0x2f6561['status'](0xcc)[_0x60ae('0x1e')]();});}};}function handleEntityNotFound(_0x39fcc2,_0x5d63bc){return function(_0x3b6e24){if(!_0x3b6e24){_0x39fcc2['sendStatus'](0x194);}return _0x3b6e24;};}function handleError(_0x5d1ecd,_0x27836e){_0x27836e=_0x27836e||0x1f4;return function(_0x70d8ac){logger[_0x60ae('0x2c')](_0x70d8ac['stack']);if(_0x70d8ac[_0x60ae('0x2d')]){delete _0x70d8ac[_0x60ae('0x2d')];}_0x5d1ecd['status'](_0x27836e)[_0x60ae('0x2e')](_0x70d8ac);};}exports[_0x60ae('0x2f')]=function(_0x4055b5,_0x44a451){var _0x2b4185={},_0x483758={},_0x554c9b={'count':0x0,'rows':[]};var _0xc85a1d=_[_0x60ae('0x30')](db[_0x60ae('0x31')][_0x60ae('0x32')],function(_0x38a624){return{'name':_0x38a624['fieldName'],'type':_0x38a624[_0x60ae('0x33')]['key']};});_0x483758[_0x60ae('0x34')]=_[_0x60ae('0x30')](_0xc85a1d,_0x60ae('0x2d'));_0x483758[_0x60ae('0x35')]=_[_0x60ae('0x36')](_0x4055b5[_0x60ae('0x35')]);_0x483758[_0x60ae('0x37')]=_[_0x60ae('0x38')](_0x483758['model'],_0x483758['query']);_0x2b4185['attributes']=_[_0x60ae('0x38')](_0x483758[_0x60ae('0x34')],qs[_0x60ae('0x39')](_0x4055b5[_0x60ae('0x35')][_0x60ae('0x39')]));_0x2b4185['attributes']=_0x2b4185[_0x60ae('0x3a')][_0x60ae('0x3b')]?_0x2b4185['attributes']:_0x483758[_0x60ae('0x34')];if(!_0x4055b5[_0x60ae('0x35')][_0x60ae('0x3c')]('nolimit')){_0x2b4185[_0x60ae('0x21')]=qs[_0x60ae('0x21')](_0x4055b5[_0x60ae('0x35')]['limit']);_0x2b4185[_0x60ae('0x23')]=qs[_0x60ae('0x23')](_0x4055b5[_0x60ae('0x35')][_0x60ae('0x23')]);}_0x2b4185[_0x60ae('0x3d')]=qs['sort'](_0x4055b5[_0x60ae('0x35')][_0x60ae('0x3e')]);_0x2b4185[_0x60ae('0x3f')]=qs[_0x60ae('0x37')](_[_0x60ae('0x40')](_0x4055b5[_0x60ae('0x35')],_0x483758[_0x60ae('0x37')]),_0xc85a1d);if(_0x4055b5['query'][_0x60ae('0x41')]){_0x2b4185['where']=_[_0x60ae('0x42')](_0x2b4185[_0x60ae('0x3f')],{'$or':_[_0x60ae('0x30')](_0xc85a1d,function(_0x285ab6){if(_0x285ab6['type']!==_0x60ae('0x43')){var _0x1ba01f={};_0x1ba01f[_0x285ab6[_0x60ae('0x2d')]]={'$like':'%'+_0x4055b5[_0x60ae('0x35')][_0x60ae('0x41')]+'%'};return _0x1ba01f;}})});}_0x2b4185=_['merge']({},_0x2b4185,_0x4055b5['options']);var _0x5224af={'where':_0x2b4185['where']};return db[_0x60ae('0x31')]['count'](_0x5224af)['then'](function(_0x18afd0){_0x554c9b[_0x60ae('0x22')]=_0x18afd0;if(_0x4055b5[_0x60ae('0x35')][_0x60ae('0x44')]){_0x2b4185['include']=[{'all':!![]}];}return db[_0x60ae('0x31')][_0x60ae('0x45')](_0x2b4185);})[_0x60ae('0x28')](function(_0x385745){_0x554c9b[_0x60ae('0x46')]=_0x385745;return _0x554c9b;})['then'](respondWithFilteredResult(_0x44a451,_0x2b4185))[_0x60ae('0x47')](handleError(_0x44a451,null));};exports['show']=function(_0x40cd9e,_0x54db04){var _0x1a1507={'raw':![],'where':{'id':_0x40cd9e[_0x60ae('0x48')]['id']}},_0x3a1a7c={};_0x3a1a7c[_0x60ae('0x34')]=_[_0x60ae('0x36')](db[_0x60ae('0x31')][_0x60ae('0x32')]);_0x3a1a7c['query']=_[_0x60ae('0x36')](_0x40cd9e['query']);_0x3a1a7c[_0x60ae('0x37')]=_[_0x60ae('0x38')](_0x3a1a7c[_0x60ae('0x34')],_0x3a1a7c['query']);_0x1a1507['attributes']=_[_0x60ae('0x38')](_0x3a1a7c['model'],qs[_0x60ae('0x39')](_0x40cd9e[_0x60ae('0x35')][_0x60ae('0x39')]));_0x1a1507['attributes']=_0x1a1507['attributes']['length']?_0x1a1507[_0x60ae('0x3a')]:_0x3a1a7c[_0x60ae('0x34')];if(_0x40cd9e[_0x60ae('0x35')][_0x60ae('0x44')]){_0x1a1507[_0x60ae('0x49')]=[{'all':!![]}];}_0x1a1507=_[_0x60ae('0x42')]({},_0x1a1507,_0x40cd9e[_0x60ae('0x4a')]);return db[_0x60ae('0x31')][_0x60ae('0x4b')](_0x1a1507)['then'](handleEntityNotFound(_0x54db04,null))[_0x60ae('0x28')](respondWithResult(_0x54db04,null))['catch'](handleError(_0x54db04,null));};exports[_0x60ae('0x4c')]=function(_0x17fef7,_0x375463){return db['CmList'][_0x60ae('0x4c')](_0x17fef7[_0x60ae('0x4d')],{})['then'](function(_0x24592a){var _0x2798ae=_0x17fef7[_0x60ae('0x4e')][_0x60ae('0x2a')]({'plain':!![]});if(!_0x2798ae)throw new Error(_0x60ae('0x4f'));if(_0x2798ae[_0x60ae('0x50')]==='user'){var _0x4ce4b9=_0x24592a['get']({'plain':!![]});var _0x417a95='Lists';return db[_0x60ae('0x51')][_0x60ae('0x4b')]({'where':{'name':_0x417a95,'userProfileId':_0x2798ae[_0x60ae('0x52')]},'raw':!![]})[_0x60ae('0x28')](function(_0x266716){if(_0x266716&&_0x266716[_0x60ae('0x53')]===0x0){return db[_0x60ae('0x54')][_0x60ae('0x4c')]({'name':_0x4ce4b9[_0x60ae('0x2d')],'resourceId':_0x4ce4b9['id'],'type':_0x266716[_0x60ae('0x2d')],'sectionId':_0x266716['id']},{})['then'](function(){return _0x24592a;});}else{return _0x24592a;}})[_0x60ae('0x47')](function(_0x4df8f1){logger[_0x60ae('0x2c')](_0x60ae('0x55'),_0x4df8f1);throw _0x4df8f1;});}return _0x24592a;})[_0x60ae('0x28')](respondWithResult(_0x375463,0xc9))[_0x60ae('0x47')](handleError(_0x375463,null));};exports[_0x60ae('0x56')]=function(_0x3a5854,_0x161280){if(_0x3a5854[_0x60ae('0x4d')]['id']){delete _0x3a5854[_0x60ae('0x4d')]['id'];}return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x3a5854[_0x60ae('0x48')]['id']}})[_0x60ae('0x28')](handleEntityNotFound(_0x161280,null))[_0x60ae('0x28')](saveUpdates(_0x3a5854[_0x60ae('0x4d')],null))['then'](respondWithResult(_0x161280,null))[_0x60ae('0x47')](handleError(_0x161280,null));};exports[_0x60ae('0x29')]=function(_0x5ecec,_0x1006e2){return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x5ecec[_0x60ae('0x48')]['id']}})[_0x60ae('0x28')](handleEntityNotFound(_0x1006e2,null))[_0x60ae('0x28')](removeEntity(_0x1006e2,null))[_0x60ae('0x47')](handleError(_0x1006e2,null));};exports['describe']=function(_0x37b392,_0x3b8940){return db[_0x60ae('0x31')][_0x60ae('0x57')]()[_0x60ae('0x28')](respondWithResult(_0x3b8940,null))[_0x60ae('0x47')](handleError(_0x3b8940,null));};exports['addDisposition']=function(_0x5653b7,_0x2413c0,_0x2c066f){if(_0x5653b7[_0x60ae('0x4d')]['id']){delete _0x5653b7[_0x60ae('0x4d')]['id'];}return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x5653b7['params']['id']}})[_0x60ae('0x28')](handleEntityNotFound(_0x2413c0,null))[_0x60ae('0x28')](function(_0x25fcbf){if(_0x25fcbf){_0x5653b7[_0x60ae('0x4d')][_0x60ae('0x58')]=_0x25fcbf['id'];return db[_0x60ae('0x59')][_0x60ae('0x4c')](_0x5653b7[_0x60ae('0x4d')]);}})[_0x60ae('0x28')](respondWithResult(_0x2413c0,null))[_0x60ae('0x47')](handleError(_0x2413c0,null));};exports['getDispositions']=function(_0x3e60c0,_0xe2f3c3,_0x577bae){var _0xd28d95={'raw':![],'where':{}};var _0x12144c={};var _0x46738e={'count':0x0,'rows':[]};return db['CmList'][_0x60ae('0x5a')]({'where':{'id':_0x3e60c0[_0x60ae('0x48')]['id']}})[_0x60ae('0x28')](handleEntityNotFound(_0xe2f3c3,null))[_0x60ae('0x28')](function(_0x1181c2){if(_0x1181c2){_0x12144c[_0x60ae('0x34')]=_[_0x60ae('0x36')](db[_0x60ae('0x59')][_0x60ae('0x32')]);_0x12144c['query']=_[_0x60ae('0x36')](_0x3e60c0['query']);_0x12144c[_0x60ae('0x37')]=_[_0x60ae('0x38')](_0x12144c['model'],_0x12144c[_0x60ae('0x35')]);_0xd28d95[_0x60ae('0x3a')]=_[_0x60ae('0x38')](_0x12144c['model'],qs[_0x60ae('0x39')](_0x3e60c0[_0x60ae('0x35')]['fields']));_0xd28d95['attributes']=_0xd28d95['attributes'][_0x60ae('0x3b')]?_0xd28d95[_0x60ae('0x3a')]:_0x12144c[_0x60ae('0x34')];if(!_0x3e60c0['query'][_0x60ae('0x3c')]('nolimit')){_0xd28d95[_0x60ae('0x21')]=qs[_0x60ae('0x21')](_0x3e60c0[_0x60ae('0x35')][_0x60ae('0x21')]);_0xd28d95[_0x60ae('0x23')]=qs[_0x60ae('0x23')](_0x3e60c0[_0x60ae('0x35')]['offset']);}_0xd28d95[_0x60ae('0x3d')]=qs[_0x60ae('0x3e')](_0x3e60c0['query'][_0x60ae('0x3e')]);_0xd28d95['where']=qs['filters'](_[_0x60ae('0x40')](_0x3e60c0[_0x60ae('0x35')],_0x12144c[_0x60ae('0x37')]));_0xd28d95[_0x60ae('0x3f')][_0x60ae('0x58')]=_0x1181c2['id'];if(_0x3e60c0[_0x60ae('0x35')]['filter']){_0xd28d95['where']=_[_0x60ae('0x42')](_0xd28d95[_0x60ae('0x3f')],{'$or':_['map'](_0xd28d95[_0x60ae('0x3a')],function(_0x486489){var _0x1ddd91={};_0x1ddd91[_0x486489]={'$like':'%'+_0x3e60c0['query'][_0x60ae('0x41')]+'%'};return _0x1ddd91;})});}_0xd28d95=_['merge']({},_0xd28d95,_0x3e60c0[_0x60ae('0x4a')]);return db['Disposition'][_0x60ae('0x22')]({'where':_0xd28d95[_0x60ae('0x3f')]})[_0x60ae('0x28')](function(_0x4b1a06){_0x46738e[_0x60ae('0x22')]=_0x4b1a06;if(_0x3e60c0[_0x60ae('0x35')]['includeAll']){_0xd28d95[_0x60ae('0x49')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xd28d95);})[_0x60ae('0x28')](function(_0x7350f6){_0x46738e['rows']=_0x7350f6;return _0x46738e;});}})[_0x60ae('0x28')](respondWithFilteredResult(_0xe2f3c3,_0xd28d95))[_0x60ae('0x47')](handleError(_0xe2f3c3,null));};exports[_0x60ae('0x5b')]=function(_0x10c117,_0x4c9a74,_0x2fb86e){return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x10c117[_0x60ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c9a74,null))['then'](function(_0x20818d){if(_0x20818d){return _0x20818d[_0x60ae('0x5b')](_0x10c117[_0x60ae('0x35')]['ids']);}})[_0x60ae('0x28')](respondWithStatusCode(_0x4c9a74,null))[_0x60ae('0x47')](handleError(_0x4c9a74,null));};exports[_0x60ae('0x5c')]=function(_0x30c224,_0x403c9d,_0x3f47d8){return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x30c224[_0x60ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x403c9d,null))[_0x60ae('0x28')](function(_0x2c9458){if(_0x2c9458){var _0x493a97=[];var _0x494511={'success':[],'errors':[]};return db[_0x60ae('0x5d')]['describe']()[_0x60ae('0x28')](function(_0x189c43){if(_0x30c224[_0x60ae('0x4d')][_0x60ae('0x5e')]&&_['isArray'](_0x30c224['body'][_0x60ae('0x5e')])){if(_0x30c224['body'][_0x60ae('0x5e')][_0x60ae('0x3b')]){_0x30c224[_0x60ae('0x4d')][_0x60ae('0x5e')]=_0x30c224['body'][_0x60ae('0x5e')][_0x60ae('0x5f')](';')+';';}else{_0x30c224[_0x60ae('0x4d')]['tags']=null;}}else{_0x30c224['body']['tags']=null;}if(_0x30c224[_0x60ae('0x4d')]&&_[_0x60ae('0x60')](_0x30c224['body'])){for(var _0x33375d=0x0;_0x33375d<_0x30c224[_0x60ae('0x4d')]['length'];_0x33375d+=0x1){_0x30c224[_0x60ae('0x4d')][_0x33375d][_0x60ae('0x58')]=_0x30c224['params']['id'];_0x493a97[_0x60ae('0x61')](_0x30c224[_0x60ae('0x4d')][_0x33375d]);}return BPromise[_0x60ae('0x62')](_0x493a97,function(_0x533bfe){return db[_0x60ae('0x5d')][_0x60ae('0x4c')](_[_0x60ae('0x63')](_0x533bfe,[_0x60ae('0x64'),'id'])||{},{'fields':_[_0x60ae('0x36')](_0x189c43),'raw':!![]})[_0x60ae('0x28')](function(_0x487300){_0x494511[_0x60ae('0x65')][_0x60ae('0x61')](_0x487300['dataValues']);})[_0x60ae('0x47')](function(_0x533e3c){_0x494511[_0x60ae('0x66')][_0x60ae('0x61')]({'data':_0x533bfe,'error':_0x533e3c[_0x60ae('0x67')]});});})[_0x60ae('0x28')](function(_0x38c00f){return _0x494511;})[_0x60ae('0x47')](function(_0x1d263b){return _0x1d263b;});}else{_0x403c9d[_0x60ae('0x1d')](0x190)[_0x60ae('0x1f')]({'message':_0x60ae('0x68')});}});}})[_0x60ae('0x28')](respondWithResult(_0x403c9d,null))[_0x60ae('0x47')](handleError(_0x403c9d,null));};exports[_0x60ae('0x69')]=function(_0x376552,_0x5c986f,_0x19e880){var _0x44cea9;return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x376552['params']['id']},'include':[{'model':db[_0x60ae('0x6a')],'as':_0x60ae('0x6b')}]})[_0x60ae('0x28')](handleEntityNotFound(_0x5c986f,null))['then'](function(_0x193947){if(_0x193947){_0x44cea9=_0x193947;return db[_0x60ae('0x5d')][_0x60ae('0x32')];}})['then'](function(_0x2c3bb6){if(_0x2c3bb6){var _0x83e775={};var _0xe857c0={};_0xe857c0[_0x60ae('0x34')]=_[_0x60ae('0x6c')](_[_0x60ae('0x36')](_0x2c3bb6),_[_0x60ae('0x30')](_0x44cea9[_0x60ae('0x6b')],function(_0x3ce879){return util[_0x60ae('0x6d')](_0x60ae('0x6e'),_0x3ce879['id']);}));_0xe857c0[_0x60ae('0x35')]=_['keys'](_0x376552[_0x60ae('0x35')]);_0xe857c0['filters']=_['intersection'](_0xe857c0[_0x60ae('0x34')],_0xe857c0[_0x60ae('0x35')]);_0x83e775[_0x60ae('0x3a')]=_[_0x60ae('0x38')](_0xe857c0['model'],qs[_0x60ae('0x39')](_0x376552['query']['fields']));_0x83e775[_0x60ae('0x3a')]=_0x83e775[_0x60ae('0x3a')][_0x60ae('0x3b')]?_0x83e775[_0x60ae('0x3a')]:_0xe857c0[_0x60ae('0x34')];if(!_0x376552[_0x60ae('0x35')][_0x60ae('0x3c')](_0x60ae('0x6f'))){_0x83e775[_0x60ae('0x21')]=qs[_0x60ae('0x21')](_0x376552[_0x60ae('0x35')][_0x60ae('0x21')]);_0x83e775[_0x60ae('0x23')]=qs[_0x60ae('0x23')](_0x376552[_0x60ae('0x35')][_0x60ae('0x23')]);}_0x83e775[_0x60ae('0x3d')]=qs[_0x60ae('0x3e')](_0x376552[_0x60ae('0x35')][_0x60ae('0x3e')]);_0x83e775['where']=qs[_0x60ae('0x37')](_['pick'](_0x376552[_0x60ae('0x35')],_0xe857c0['filters']));_0x83e775[_0x60ae('0x70')]=!![];if(_0x376552[_0x60ae('0x35')][_0x60ae('0x41')]){_0x83e775[_0x60ae('0x3f')]=_[_0x60ae('0x42')](_0x83e775['where'],{'$or':_[_0x60ae('0x30')](_0x83e775[_0x60ae('0x3a')],function(_0x2f4324){var _0x40374c={};_0x40374c[_0x2f4324]={'$like':'%'+_0x376552[_0x60ae('0x35')][_0x60ae('0x41')]+'%'};return _0x40374c;})});}_0x83e775=_[_0x60ae('0x42')]({},_0x83e775,_0x376552['options']);return _0x44cea9['getContacts'](_0x83e775);}})[_0x60ae('0x28')](respondWithResult(_0x5c986f,null))[_0x60ae('0x47')](handleError(_0x5c986f,null));};exports['getContactsCsv']=function(_0x46b916,_0x19629f,_0x500fa0){var _0x351298;var _0x29f987;var _0x5bc246;var _0x3f90d8=_0x46b916['params']['id'];csv_results=[];return db[_0x60ae('0x71')]['findAll']({'attributes':['id',_0x60ae('0x2d')],'raw':!![],'order':['OrderBy']})[_0x60ae('0x28')](function(_0x29665d){_0x351298=_0x29665d;var _0x5c5931=_[_0x60ae('0x36')](db[_0x60ae('0x5d')][_0x60ae('0x32')]);return db[_0x60ae('0x6a')][_0x60ae('0x45')]({'raw':!![],'attributes':['id',_0x60ae('0x72')]})[_0x60ae('0x28')](function(_0x2088a9){_0x29f987=_0x2088a9;var _0x1b2510=squel[_0x60ae('0x73')]()[_0x60ae('0x39')](_0x5c5931)['from']('cm_contacts','c')['where'](_0x60ae('0x74'),_0x3f90d8)[_0x60ae('0x3f')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x4a542f=0x0;_0x4a542f<_0x29f987[_0x60ae('0x3b')];_0x4a542f++){_0x1b2510[_0x60ae('0x75')](_0x60ae('0x76')+_0x29f987[_0x4a542f]['id'],_0x60ae('0x77')+_0x29f987[_0x4a542f]['alias']);}for(var _0x4a542f=0x0;_0x4a542f<_0x351298['length'];_0x4a542f++){_0x1b2510[_0x60ae('0x75')](squel[_0x60ae('0x73')]()[_0x60ae('0x75')](_0x60ae('0x78'))[_0x60ae('0x79')](_0x60ae('0x7a'))[_0x60ae('0x3f')](_0x60ae('0x7b'),_0x351298[_0x4a542f]['id'])[_0x60ae('0x3f')](_0x60ae('0x7c')),_0x60ae('0x7d')+_0x351298[_0x4a542f][_0x60ae('0x2d')]);_0x1b2510[_0x60ae('0x75')](squel['select']()[_0x60ae('0x75')](_0x60ae('0x7e'))[_0x60ae('0x79')](_0x60ae('0x7a'))[_0x60ae('0x3f')](_0x60ae('0x7b'),_0x351298[_0x4a542f]['id'])[_0x60ae('0x3f')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x351298[_0x4a542f][_0x60ae('0x2d')]);}var _0x43547d=[];_0x43547d[_0x60ae('0x61')](_0x1b2510['toString']());BPromise[_0x60ae('0x62')](_0x43547d,handleQuery)[_0x60ae('0x28')](function(_0x41fe50){handleQuery(_0x1b2510['toString']());var _0x1f7624=csv_results[0x0];if(!_[_0x60ae('0x7f')](_0x1f7624)){var _0x1c250d=toCsv(_0x1f7624);var _0x3490c8=Date['now']();fs[_0x60ae('0x80')](util[_0x60ae('0x6d')](_0x60ae('0x81'),_0x3f90d8,_0x3490c8),_0x1c250d);_0x19629f['setHeader'](_0x60ae('0x82'),_0x60ae('0x83')+util[_0x60ae('0x6d')](_0x60ae('0x84'),_0x3f90d8,_0x3490c8));_0x19629f[_0x60ae('0x85')]('Content-type',_0x60ae('0x86'));return _0x19629f[_0x60ae('0x87')](util['format'](_0x60ae('0x81'),_0x3f90d8,_0x3490c8));}else{return _0x19629f[_0x60ae('0x1c')](0xcc);}});});});};exports['addCustomField']=function(_0x569753,_0x2e64e2,_0x900230){var _0x25b35b;delete _0x569753[_0x60ae('0x4d')]['id'];return db[_0x60ae('0x31')]['findOne']({'where':{'id':_0x569753['params']['id']}})[_0x60ae('0x28')](handleEntityNotFound(_0x2e64e2,null))[_0x60ae('0x28')](function(_0x186ab3){if(_0x186ab3){return db['sequelize']['transaction'](function(_0x2dd591){return db[_0x60ae('0x6a')][_0x60ae('0x4c')](_0x569753[_0x60ae('0x4d')],{'transaction':_0x2dd591})[_0x60ae('0x28')](function(_0x5d80f3){_0x25b35b=_0x5d80f3;return _0x186ab3['addCustomFields'](_0x5d80f3,{'transaction':_0x2dd591});})['then'](function(){var _0x43dfdc={'type':db[_0x60ae('0x88')]['TEXT'],'transaction':_0x2dd591};switch(_0x569753[_0x60ae('0x4d')][_0x60ae('0x33')]){case _0x60ae('0x89'):_0x43dfdc[_0x60ae('0x33')]=db['Sequelize']['TEXT'];break;case _0x60ae('0x8a'):_0x43dfdc[_0x60ae('0x33')]=db[_0x60ae('0x88')]['INTEGER'];break;case _0x60ae('0x8b'):_0x43dfdc[_0x60ae('0x33')]=db[_0x60ae('0x88')][_0x60ae('0x8c')];_0x43dfdc[_0x60ae('0x8d')]=![];break;default:}return db[_0x60ae('0x8e')][_0x60ae('0x8f')]['addColumn'](_0x60ae('0x90'),util['format'](_0x60ae('0x91'),_0x25b35b['id']),_0x43dfdc);})['then'](function(){return _0x25b35b;});});}})[_0x60ae('0x28')](respondWithResult(_0x2e64e2,null))['catch'](handleError(_0x2e64e2,null));};exports[_0x60ae('0x92')]=function(_0x38e098,_0x5e0fda,_0x1016c6){var _0x495bc8={};var _0x26e8d8={};var _0xad4ff3;var _0x1f6afd;return db[_0x60ae('0x31')][_0x60ae('0x5a')]({'where':{'id':_0x38e098[_0x60ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e0fda,null))[_0x60ae('0x28')](function(_0x1045c9){if(_0x1045c9){_0xad4ff3=_0x1045c9;_0x26e8d8[_0x60ae('0x34')]=_[_0x60ae('0x36')](db[_0x60ae('0x6a')][_0x60ae('0x32')]);_0x26e8d8[_0x60ae('0x35')]=_['keys'](_0x38e098[_0x60ae('0x35')]);_0x26e8d8[_0x60ae('0x37')]=_[_0x60ae('0x38')](_0x26e8d8[_0x60ae('0x34')],_0x26e8d8['query']);_0x495bc8[_0x60ae('0x3a')]=_[_0x60ae('0x38')](_0x26e8d8[_0x60ae('0x34')],qs[_0x60ae('0x39')](_0x38e098[_0x60ae('0x35')][_0x60ae('0x39')]));_0x495bc8[_0x60ae('0x3a')]=_0x495bc8['attributes']['length']?_0x495bc8[_0x60ae('0x3a')]:_0x26e8d8[_0x60ae('0x34')];_0x495bc8[_0x60ae('0x3d')]=qs['sort'](_0x38e098[_0x60ae('0x35')][_0x60ae('0x3e')]);_0x495bc8['where']=qs[_0x60ae('0x37')](_[_0x60ae('0x40')](_0x38e098[_0x60ae('0x35')],_0x26e8d8['filters']));_0x495bc8[_0x60ae('0x3f')]=_[_0x60ae('0x42')](_0x495bc8[_0x60ae('0x3f')],{'$or':[{'ListId':_0x1045c9['id']},{'ListId':null}]});if(_0x38e098[_0x60ae('0x35')]['filter']){_0x495bc8['where']=_[_0x60ae('0x42')](_0x495bc8[_0x60ae('0x3f')],{'$or':_[_0x60ae('0x30')](_0x495bc8[_0x60ae('0x3a')],function(_0x2da469){var _0x4e33aa={};_0x4e33aa[_0x2da469]={'$like':'%'+_0x38e098[_0x60ae('0x35')][_0x60ae('0x41')]+'%'};return _0x4e33aa;})});}_0x495bc8=_['merge']({},_0x495bc8,_0x38e098['options']);return db[_0x60ae('0x6a')][_0x60ae('0x93')](_0x495bc8);}})['then'](respondWithResult(_0x5e0fda,null))[_0x60ae('0x47')](handleError(_0x5e0fda,null));};exports[_0x60ae('0x94')]=function(_0x4f4112,_0x4985e5){return db[_0x60ae('0x6a')][_0x60ae('0x93')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x4985e5,null))[_0x60ae('0x28')](function(_0x51e8af){return _0x51e8af;})[_0x60ae('0x28')](respondWithResult(_0x4985e5,null))[_0x60ae('0x47')](handleError(_0x4985e5,null));};exports[_0x60ae('0x95')]=function(_0x2391bb,_0x3b9c42,_0x4f19c7){return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x2391bb[_0x60ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b9c42,null))[_0x60ae('0x28')](function(_0xfce5f){if(_0xfce5f){return _0xfce5f[_0x60ae('0x95')](_0x2391bb[_0x60ae('0x4d')][_0x60ae('0x64')],_[_0x60ae('0x63')](_0x2391bb[_0x60ae('0x4d')],[_0x60ae('0x64'),'id'])||{})[_0x60ae('0x96')](function(_0xa03200){for(var _0xd123bd=0x0;_0xd123bd<_0x2391bb[_0x60ae('0x4d')][_0x60ae('0x64')][_0x60ae('0x3b')];_0xd123bd+=0x1){socket['emit'](_0x60ae('0x97'),{'UserId':Number(_0x2391bb['body'][_0x60ae('0x64')][_0xd123bd]),'CmListId':Number(_0x2391bb[_0x60ae('0x48')]['id'])});}return _0xa03200;});}})['then'](respondWithResult(_0x3b9c42,null))[_0x60ae('0x47')](handleError(_0x3b9c42,null));};exports[_0x60ae('0x98')]=function(_0x3f6020,_0x133fc4,_0x3bf39a){return db[_0x60ae('0x31')][_0x60ae('0x4b')]({'where':{'id':_0x3f6020[_0x60ae('0x48')]['id']}})[_0x60ae('0x28')](handleEntityNotFound(_0x133fc4,null))[_0x60ae('0x28')](function(_0x453cf3){if(_0x453cf3){return _0x453cf3['removeAgents'](_0x3f6020[_0x60ae('0x35')][_0x60ae('0x64')])[_0x60ae('0x28')](function(){if(_[_0x60ae('0x60')](_0x3f6020[_0x60ae('0x35')][_0x60ae('0x64')])){for(var _0x491284=0x0;_0x491284<_0x3f6020[_0x60ae('0x35')]['ids']['length'];_0x491284+=0x1){socket[_0x60ae('0x99')](_0x60ae('0x9a'),{'UserId':Number(_0x3f6020['query']['ids'][_0x491284]),'CmListId':Number(_0x3f6020[_0x60ae('0x48')]['id'])});}}else{socket['emit'](_0x60ae('0x9a'),{'UserId':Number(_0x3f6020[_0x60ae('0x35')][_0x60ae('0x64')]),'CmListId':Number(_0x3f6020[_0x60ae('0x48')]['id'])});}});}})[_0x60ae('0x28')](respondWithStatusCode(_0x133fc4,null))[_0x60ae('0x47')](handleError(_0x133fc4,null));};exports[_0x60ae('0x9b')]=function(_0x1fdec7,_0x49ebac,_0x42880f){var _0x2ca858={};var _0x2d6a83={};var _0x43f272;var _0x388a00;return db[_0x60ae('0x31')][_0x60ae('0x5a')]({'where':{'id':_0x1fdec7['params']['id']}})[_0x60ae('0x28')](handleEntityNotFound(_0x49ebac,null))['then'](function(_0x35fc42){if(_0x35fc42){_0x43f272=_0x35fc42;_0x2d6a83['model']=_[_0x60ae('0x36')](db[_0x60ae('0x9c')][_0x60ae('0x32')]);_0x2d6a83[_0x60ae('0x35')]=_[_0x60ae('0x36')](_0x1fdec7[_0x60ae('0x35')]);_0x2d6a83[_0x60ae('0x37')]=_[_0x60ae('0x38')](_0x2d6a83['model'],_0x2d6a83[_0x60ae('0x35')]);_0x2ca858[_0x60ae('0x3a')]=_[_0x60ae('0x38')](_0x2d6a83[_0x60ae('0x34')],qs[_0x60ae('0x39')](_0x1fdec7[_0x60ae('0x35')][_0x60ae('0x39')]));_0x2ca858[_0x60ae('0x3a')]=_0x2ca858[_0x60ae('0x3a')][_0x60ae('0x3b')]?_0x2ca858['attributes']:_0x2d6a83[_0x60ae('0x34')];_0x2ca858['order']=qs[_0x60ae('0x3e')](_0x1fdec7[_0x60ae('0x35')][_0x60ae('0x3e')]);_0x2ca858[_0x60ae('0x3f')]=qs[_0x60ae('0x37')](_[_0x60ae('0x40')](_0x1fdec7[_0x60ae('0x35')],_0x2d6a83['filters']));if(_0x1fdec7['query'][_0x60ae('0x41')]){_0x2ca858['where']=_[_0x60ae('0x42')](_0x2ca858[_0x60ae('0x3f')],{'$or':_[_0x60ae('0x30')](_0x2ca858['attributes'],function(_0x3b9270){var _0xe3d087={};_0xe3d087[_0x3b9270]={'$like':'%'+_0x1fdec7[_0x60ae('0x35')][_0x60ae('0x41')]+'%'};return _0xe3d087;})});}_0x2ca858=_[_0x60ae('0x42')]({},_0x2ca858,_0x1fdec7['options']);return _0x43f272[_0x60ae('0x9b')](_0x2ca858);}})[_0x60ae('0x28')](function(_0x591f8e){if(_0x591f8e){_0x388a00=_0x591f8e[_0x60ae('0x3b')];if(!_0x1fdec7[_0x60ae('0x35')]['hasOwnProperty']('nolimit')){_0x2ca858['limit']=qs[_0x60ae('0x21')](_0x1fdec7[_0x60ae('0x35')][_0x60ae('0x21')]);_0x2ca858['offset']=qs['offset'](_0x1fdec7[_0x60ae('0x35')][_0x60ae('0x23')]);}return _0x43f272[_0x60ae('0x9b')](_0x2ca858);}})[_0x60ae('0x28')](function(_0xd0380f){if(_0xd0380f){return _0xd0380f?{'count':_0x388a00,'rows':_0xd0380f}:null;}})['then'](respondWithResult(_0x49ebac,null))[_0x60ae('0x47')](handleError(_0x49ebac,null));};function handleQuery(_0x53bcaa){logger[_0x60ae('0x9d')](_0x53bcaa);return db['sequelize'][_0x60ae('0x35')](_0x53bcaa)[_0x60ae('0x96')](function(_0x31de91){csv_results[_0x60ae('0x61')](_0x31de91);})[_0x60ae('0x47')](function(_0xdfe2da){logger['error'](_0xdfe2da[_0x60ae('0x67')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 98cb708..7b376d8 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x55ca,0x126));var _0xa55c=function(_0x3367b7,_0x1e0234){_0x3367b7=_0x3367b7-0x0;var _0x52bb97=_0x55ca[_0x3367b7];return _0x52bb97;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x50d6d6,_0x189c68){var _0x5d9bb4=function(_0x12ba37){while(--_0x12ba37){_0x50d6d6['push'](_0x50d6d6['shift']());}};_0x5d9bb4(++_0x189c68);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 0670598..259165c 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 _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','../../config/logger','api'];(function(_0x43ab88,_0x389b5d){var _0x1c8e83=function(_0x2820a8){while(--_0x2820a8){_0x43ab88['push'](_0x43ab88['shift']());}};_0x1c8e83(++_0x389b5d);}(_0x1339,0x1ed));var _0x9133=function(_0x37cd6f,_0x46982d){_0x37cd6f=_0x37cd6f-0x0;var _0x1bde0b=_0x1339[_0x37cd6f];return _0x1bde0b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./cmList.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd64b=['define','CmList','cm_lists','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xb15182,_0x48d8fb){var _0x4a8749=function(_0x28684d){while(--_0x28684d){_0xb15182['push'](_0xb15182['shift']());}};_0x4a8749(++_0x48d8fb);}(_0xd64b,0xc1));var _0xbd64=function(_0x4b8fc7,_0x5022fc){_0x4b8fc7=_0x4b8fc7-0x0;var _0x249f4a=_0xd64b[_0x4b8fc7];return _0x249f4a;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'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 ba765c2..2258959 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 _0x59d0=['error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x34bb68,_0x5b0079){var _0x3db9fb=function(_0x2c87bd){while(--_0x2c87bd){_0x34bb68['push'](_0x34bb68['shift']());}};_0x3db9fb(++_0x5b0079);}(_0x59d0,0xad));var _0x059d=function(_0x1a6817,_0x3cbd16){_0x1a6817=_0x1a6817-0x0;var _0x1ecee3=_0x59d0[_0x1a6817];return _0x1ecee3;};'use strict';var _=require(_0x059d('0x0'));var util=require(_0x059d('0x1'));var moment=require(_0x059d('0x2'));var BPromise=require('bluebird');var rs=require(_0x059d('0x3'));var fs=require('fs');var Redis=require(_0x059d('0x4'));var db=require(_0x059d('0x5'))['db'];var utils=require(_0x059d('0x6'));var logger=require(_0x059d('0x7'))('rpc');var config=require(_0x059d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x059d('0x9')][_0x059d('0xa')]({'port':0x232a});config[_0x059d('0xb')]=_[_0x059d('0xc')](config[_0x059d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x059d('0xd'))(new Redis(config['redis']));require(_0x059d('0xe'))[_0x059d('0xf')](socket);function respondWithRpcPromise(_0x28deed,_0x3ff977,_0x706df3){return new BPromise(function(_0xde161c,_0xbcb429){return client[_0x059d('0x10')](_0x28deed,_0x706df3)[_0x059d('0x11')](function(_0x588c8e){logger['info'](_0x059d('0x12'),_0x3ff977,'request\x20sent');logger[_0x059d('0x13')](_0x059d('0x14'),_0x3ff977,_0x059d('0x15'),JSON[_0x059d('0x16')](_0x588c8e));if(_0x588c8e['error']){if(_0x588c8e[_0x059d('0x17')][_0x059d('0x18')]===0x1f4){logger[_0x059d('0x17')](_0x059d('0x12'),_0x3ff977,_0x588c8e[_0x059d('0x17')][_0x059d('0x19')]);return _0xbcb429(_0x588c8e[_0x059d('0x17')][_0x059d('0x19')]);}logger[_0x059d('0x17')](_0x059d('0x12'),_0x3ff977,_0x588c8e[_0x059d('0x17')][_0x059d('0x19')]);return _0xde161c(_0x588c8e['error'][_0x059d('0x19')]);}else{logger[_0x059d('0x1a')](_0x059d('0x12'),_0x3ff977,_0x059d('0x15'));_0xde161c(_0x588c8e['result'][_0x059d('0x19')]);}})[_0x059d('0x1b')](function(_0x1e661a){logger['error'](_0x059d('0x12'),_0x3ff977,_0x1e661a);_0xbcb429(_0x1e661a);});});} \ No newline at end of file +var _0x8708=['register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket'];(function(_0x100d4c,_0x1d1e60){var _0x1bce92=function(_0x2dcb8d){while(--_0x2dcb8d){_0x100d4c['push'](_0x100d4c['shift']());}};_0x1bce92(++_0x1d1e60);}(_0x8708,0x98));var _0x8870=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8708[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x8870('0x0'));var util=require(_0x8870('0x1'));var moment=require('moment');var BPromise=require(_0x8870('0x2'));var rs=require(_0x8870('0x3'));var fs=require('fs');var Redis=require(_0x8870('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8870('0x5'));var logger=require(_0x8870('0x6'))(_0x8870('0x7'));var config=require(_0x8870('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8870('0x9')][_0x8870('0xa')]({'port':0x232a});config[_0x8870('0xb')]=_[_0x8870('0xc')](config[_0x8870('0xb')],{'host':_0x8870('0xd'),'port':0x18eb});var socket=require(_0x8870('0xe'))(new Redis(config['redis']));require(_0x8870('0xf'))[_0x8870('0x10')](socket);function respondWithRpcPromise(_0xf5873d,_0x47479b,_0x213083){return new BPromise(function(_0x5dcadb,_0x42e9ea){return client[_0x8870('0x11')](_0xf5873d,_0x213083)[_0x8870('0x12')](function(_0x1dce2c){logger['info'](_0x8870('0x13'),_0x47479b,_0x8870('0x14'));logger[_0x8870('0x15')](_0x8870('0x16'),_0x47479b,_0x8870('0x14'),JSON[_0x8870('0x17')](_0x1dce2c));if(_0x1dce2c['error']){if(_0x1dce2c['error'][_0x8870('0x18')]===0x1f4){logger[_0x8870('0x19')](_0x8870('0x13'),_0x47479b,_0x1dce2c[_0x8870('0x19')][_0x8870('0x1a')]);return _0x42e9ea(_0x1dce2c[_0x8870('0x19')][_0x8870('0x1a')]);}logger[_0x8870('0x19')](_0x8870('0x13'),_0x47479b,_0x1dce2c[_0x8870('0x19')]['message']);return _0x5dcadb(_0x1dce2c[_0x8870('0x19')][_0x8870('0x1a')]);}else{logger['info'](_0x8870('0x13'),_0x47479b,_0x8870('0x14'));_0x5dcadb(_0x1dce2c['result']['message']);}})[_0x8870('0x1b')](function(_0xb045af){logger['error'](_0x8870('0x13'),_0x47479b,_0xb045af);_0x42e9ea(_0xb045af);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 9cd9558..125544a 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 _0x9ea3=['remove','update','removeListener','length','cmList:','./cmList.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ea3,0x12b));var _0x39ea=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x9ea3[_0x2b9b7f];return _0x4ed19a;};'use strict';var CmListEvents=require(_0x39ea('0x0'));var events=[_0x39ea('0x1'),_0x39ea('0x2'),_0x39ea('0x3')];function createListener(_0x29fa61,_0xe542cc){return function(_0x42ebe8){_0xe542cc['emit'](_0x29fa61,_0x42ebe8);};}function removeListener(_0xc887b3,_0x129660){return function(){CmListEvents[_0x39ea('0x4')](_0xc887b3,_0x129660);};}exports['register']=function(_0x42db10){for(var _0x48469e=0x0,_0x509a46=events[_0x39ea('0x5')];_0x48469e<_0x509a46;_0x48469e++){var _0x3f9ee0=events[_0x48469e];var _0x460dcd=createListener(_0x39ea('0x6')+_0x3f9ee0,_0x42db10);CmListEvents['on'](_0x3f9ee0,_0x460dcd);}}; \ No newline at end of file +var _0x36c3=['update','emit','removeListener','length','cmList:','save','remove'];(function(_0xe9f235,_0x3385ce){var _0x151875=function(_0x177c83){while(--_0x177c83){_0xe9f235['push'](_0xe9f235['shift']());}};_0x151875(++_0x3385ce);}(_0x36c3,0x132));var _0x336c=function(_0x127074,_0x3bd855){_0x127074=_0x127074-0x0;var _0x4c9463=_0x36c3[_0x127074];return _0x4c9463;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x336c('0x0'),_0x336c('0x1'),_0x336c('0x2')];function createListener(_0x8bb688,_0x5a51bc){return function(_0x1a1c2e){_0x5a51bc[_0x336c('0x3')](_0x8bb688,_0x1a1c2e);};}function removeListener(_0x518cbc,_0x3a293d){return function(){CmListEvents[_0x336c('0x4')](_0x518cbc,_0x3a293d);};}exports['register']=function(_0x28c2e1){for(var _0x984420=0x0,_0x1be751=events[_0x336c('0x5')];_0x984420<_0x1be751;_0x984420++){var _0x145e20=events[_0x984420];var _0x2c5315=createListener(_0x336c('0x6')+_0x145e20,_0x28c2e1);CmListEvents['on'](_0x145e20,_0x2c5315);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 9b5874e..655ed67 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 _0x6b94=['isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addContacts','addCustomField','put','delete','removeDispositions','removeAgents','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get'];(function(_0x450bf7,_0x1d4752){var _0x134163=function(_0x4ea7a8){while(--_0x4ea7a8){_0x450bf7['push'](_0x450bf7['shift']());}};_0x134163(++_0x1d4752);}(_0x6b94,0x78));var _0x46b9=function(_0x38630a,_0x1a5823){_0x38630a=_0x38630a-0x0;var _0x6fd946=_0x6b94[_0x38630a];return _0x6fd946;};'use strict';var multer=require(_0x46b9('0x0'));var util=require(_0x46b9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x46b9('0x2'));var router=express[_0x46b9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x46b9('0x4'));var interaction=require(_0x46b9('0x5'));var config=require('../../config/environment');var controller=require(_0x46b9('0x6'));router[_0x46b9('0x7')]('/',auth[_0x46b9('0x8')](),controller[_0x46b9('0x9')]);router[_0x46b9('0x7')](_0x46b9('0xa'),auth[_0x46b9('0x8')](),controller[_0x46b9('0xb')]);router[_0x46b9('0x7')](_0x46b9('0xc'),auth[_0x46b9('0x8')](),controller[_0x46b9('0xd')]);router['get'](_0x46b9('0xe'),auth[_0x46b9('0x8')](),controller[_0x46b9('0xf')]);router[_0x46b9('0x7')](_0x46b9('0x10'),auth['isAuthenticated'](),controller[_0x46b9('0x11')]);router['get'](_0x46b9('0x12'),auth[_0x46b9('0x8')](),controller['getContacts']);router[_0x46b9('0x7')](_0x46b9('0x13'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x14')]);router[_0x46b9('0x7')](_0x46b9('0x15'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x16')]);router['get'](_0x46b9('0x17'),auth[_0x46b9('0x8')](),controller['getAgents']);router[_0x46b9('0x18')]('/',auth[_0x46b9('0x8')](),controller[_0x46b9('0x19')]);router['post']('/:id/dispositions',auth[_0x46b9('0x8')](),controller['addDisposition']);router[_0x46b9('0x18')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x46b9('0x1a')]);router['post'](_0x46b9('0x15'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x1b')]);router[_0x46b9('0x18')]('/:id/users',auth[_0x46b9('0x8')](),controller['addAgents']);router[_0x46b9('0x1c')](_0x46b9('0xe'),auth[_0x46b9('0x8')](),controller['update']);router[_0x46b9('0x1d')]('/:id',auth[_0x46b9('0x8')](),controller['destroy']);router[_0x46b9('0x1d')](_0x46b9('0x10'),auth['isAuthenticated'](),controller[_0x46b9('0x1e')]);router[_0x46b9('0x1d')](_0x46b9('0x17'),auth[_0x46b9('0x8')](),controller[_0x46b9('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x656f=['describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','addDisposition','addCustomField','/:id/users','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index'];(function(_0x178049,_0x55b96c){var _0x5c8910=function(_0xd1b6ec){while(--_0xd1b6ec){_0x178049['push'](_0x178049['shift']());}};_0x5c8910(++_0x55b96c);}(_0x656f,0xc4));var _0xf656=function(_0x189890,_0x29544b){_0x189890=_0x189890-0x0;var _0x3e1ecf=_0x656f[_0x189890];return _0x3e1ecf;};'use strict';var multer=require(_0xf656('0x0'));var util=require(_0xf656('0x1'));var path=require(_0xf656('0x2'));var timeout=require(_0xf656('0x3'));var express=require(_0xf656('0x4'));var router=express[_0xf656('0x5')]();var fs_extra=require(_0xf656('0x6'));var auth=require(_0xf656('0x7'));var interaction=require(_0xf656('0x8'));var config=require(_0xf656('0x9'));var controller=require(_0xf656('0xa'));router[_0xf656('0xb')]('/',auth[_0xf656('0xc')](),controller[_0xf656('0xd')]);router[_0xf656('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf656('0xe')]);router[_0xf656('0xb')](_0xf656('0xf'),auth[_0xf656('0xc')](),controller[_0xf656('0x10')]);router[_0xf656('0xb')](_0xf656('0x11'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf656('0x12'),auth[_0xf656('0xc')](),controller[_0xf656('0x13')]);router['get'](_0xf656('0x14'),auth[_0xf656('0xc')](),controller[_0xf656('0x15')]);router[_0xf656('0xb')](_0xf656('0x16'),auth[_0xf656('0xc')](),controller[_0xf656('0x17')]);router[_0xf656('0xb')](_0xf656('0x18'),auth[_0xf656('0xc')](),controller[_0xf656('0x19')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xf656('0x1a')]);router[_0xf656('0x1b')]('/',auth[_0xf656('0xc')](),controller['create']);router[_0xf656('0x1b')](_0xf656('0x12'),auth[_0xf656('0xc')](),controller[_0xf656('0x1c')]);router[_0xf656('0x1b')](_0xf656('0x14'),auth[_0xf656('0xc')](),controller['addContacts']);router[_0xf656('0x1b')](_0xf656('0x18'),auth[_0xf656('0xc')](),controller[_0xf656('0x1d')]);router[_0xf656('0x1b')](_0xf656('0x1e'),auth[_0xf656('0xc')](),controller['addAgents']);router[_0xf656('0x1f')](_0xf656('0x11'),auth['isAuthenticated'](),controller[_0xf656('0x20')]);router[_0xf656('0x21')](_0xf656('0x11'),auth[_0xf656('0xc')](),controller['destroy']);router['delete'](_0xf656('0x12'),auth[_0xf656('0xc')](),controller['removeDispositions']);router[_0xf656('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xf656('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 296fbc8..a813fbe 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 _0x3a4d=['getDataValue','field','STRING','sequelize','exports','VIRTUAL'];(function(_0x36bed9,_0x79c1cb){var _0x5bf8e1=function(_0x199d4b){while(--_0x199d4b){_0x36bed9['push'](_0x36bed9['shift']());}};_0x5bf8e1(++_0x79c1cb);}(_0x3a4d,0xd5));var _0xd3a4=function(_0x4ff939,_0x5f54ea){_0x4ff939=_0x4ff939-0x0;var _0x3f8ba8=_0x3a4d[_0x4ff939];return _0x3f8ba8;};'use strict';var Sequelize=require(_0xd3a4('0x0'));module[_0xd3a4('0x1')]={'name':{'type':Sequelize[_0xd3a4('0x2')],'get':function(_0x19f1c9){return this[_0xd3a4('0x3')](_0xd3a4('0x4'));}},'field':{'type':Sequelize[_0xd3a4('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xd3a4('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x49b6=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x261723,_0x3e4f2b){var _0x430146=function(_0x32fe17){while(--_0x32fe17){_0x261723['push'](_0x261723['shift']());}};_0x430146(++_0x3e4f2b);}(_0x49b6,0x179));var _0x649b=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0x49b6[_0x5b3950];return _0x41e436;};'use strict';var Sequelize=require(_0x649b('0x0'));module[_0x649b('0x1')]={'name':{'type':Sequelize[_0x649b('0x2')],'get':function(_0x101a3c){return this[_0x649b('0x3')](_0x649b('0x4'));}},'field':{'type':Sequelize[_0x649b('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x649b('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x649b('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index fbf3e09..d3ae330 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x479034,_0x3bc665){var _0x3f1b69=function(_0x53a5ae){while(--_0x53a5ae){_0x479034['push'](_0x479034['shift']());}};_0x3f1b69(++_0x3bc665);}(_0x7a54,0x106));var _0x47a5=function(_0x560750,_0x48b57a){_0x560750=_0x560750-0x0;var _0x263126=_0x7a54[_0x560750];return _0x263126;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x24ea47,_0x2d4084){var _0x4ffa00=function(_0xcd45d3){while(--_0xcd45d3){_0x24ea47['push'](_0x24ea47['shift']());}};_0x4ffa00(++_0x2d4084);}(_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 b3aecc5..a2a645d 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 _0x51a2=['tools_conditions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./condition.attributes','define'];(function(_0x7dad80,_0x5aa23f){var _0x2d9b68=function(_0x37aa85){while(--_0x37aa85){_0x7dad80['push'](_0x7dad80['shift']());}};_0x2d9b68(++_0x5aa23f);}(_0x51a2,0xa1));var _0x251a=function(_0x1236b7,_0x1c53bf){_0x1236b7=_0x1236b7-0x0;var _0x58e712=_0x51a2[_0x1236b7];return _0x58e712;};'use strict';var _=require(_0x251a('0x0'));var util=require(_0x251a('0x1'));var logger=require(_0x251a('0x2'))(_0x251a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x251a('0x4'));var fs=require('fs');var path=require(_0x251a('0x5'));var rimraf=require('rimraf');var config=require(_0x251a('0x6'));var attributes=require(_0x251a('0x7'));module['exports']=function(_0x12649d,_0x4eafe6){return _0x12649d[_0x251a('0x8')]('Condition',attributes,{'tableName':_0x251a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bc1=['define','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x56cc28,_0x4a921e){var _0x1f5798=function(_0x45f7a5){while(--_0x45f7a5){_0x56cc28['push'](_0x56cc28['shift']());}};_0x1f5798(++_0x4a921e);}(_0x9bc1,0xf3));var _0x19bc=function(_0x1ded25,_0x26be3d){_0x1ded25=_0x1ded25-0x0;var _0x8ec99f=_0x9bc1[_0x1ded25];return _0x8ec99f;};'use strict';var _=require(_0x19bc('0x0'));var util=require('util');var logger=require(_0x19bc('0x1'))(_0x19bc('0x2'));var moment=require(_0x19bc('0x3'));var BPromise=require(_0x19bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19bc('0x5'));var rimraf=require(_0x19bc('0x6'));var config=require(_0x19bc('0x7'));var attributes=require('./condition.attributes');module[_0x19bc('0x8')]=function(_0x28a25c,_0x232a00){return _0x28a25c[_0x19bc('0x9')](_0x19bc('0xa'),attributes,{'tableName':_0x19bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 37947d5..389808c 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 _0x803f=['client','http','info','Condition,\x20%s,\x20%s','debug','request\x20sent','code','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34ac63,_0x40f4da){var _0x44aee2=function(_0x5a1140){while(--_0x5a1140){_0x34ac63['push'](_0x34ac63['shift']());}};_0x44aee2(++_0x40f4da);}(_0x803f,0x10e));var _0xf803=function(_0x1a2793,_0x8c946d){_0x1a2793=_0x1a2793-0x0;var _0x580695=_0x803f[_0x1a2793];return _0x580695;};'use strict';var _=require(_0xf803('0x0'));var util=require('util');var moment=require(_0xf803('0x1'));var BPromise=require(_0xf803('0x2'));var rs=require(_0xf803('0x3'));var fs=require('fs');var Redis=require(_0xf803('0x4'));var db=require(_0xf803('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf803('0x6'))(_0xf803('0x7'));var config=require(_0xf803('0x8'));var jayson=require(_0xf803('0x9'));var client=jayson[_0xf803('0xa')][_0xf803('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1080ac,_0x3d7ccb,_0x32a09e){return new BPromise(function(_0x33f2b4,_0x5d83d3){return client['request'](_0x1080ac,_0x32a09e)['then'](function(_0x56dd99){logger[_0xf803('0xc')](_0xf803('0xd'),_0x3d7ccb,'request\x20sent');logger[_0xf803('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x3d7ccb,_0xf803('0xf'),JSON['stringify'](_0x56dd99));if(_0x56dd99['error']){if(_0x56dd99['error'][_0xf803('0x10')]===0x1f4){logger[_0xf803('0x11')](_0xf803('0xd'),_0x3d7ccb,_0x56dd99[_0xf803('0x11')]['message']);return _0x5d83d3(_0x56dd99['error']['message']);}logger[_0xf803('0x11')](_0xf803('0xd'),_0x3d7ccb,_0x56dd99[_0xf803('0x11')][_0xf803('0x12')]);return _0x33f2b4(_0x56dd99[_0xf803('0x11')][_0xf803('0x12')]);}else{logger[_0xf803('0xc')](_0xf803('0xd'),_0x3d7ccb,'request\x20sent');_0x33f2b4(_0x56dd99['result'][_0xf803('0x12')]);}})[_0xf803('0x13')](function(_0x50e02a){logger[_0xf803('0x11')](_0xf803('0xd'),_0x3d7ccb,_0x50e02a);_0x5d83d3(_0x50e02a);});});} \ No newline at end of file +var _0x8a41=['http','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x3a0380,_0x4014c8){var _0x162bbb=function(_0x59178c){while(--_0x59178c){_0x3a0380['push'](_0x3a0380['shift']());}};_0x162bbb(++_0x4014c8);}(_0x8a41,0xfc));var _0x18a4=function(_0x525067,_0x128b80){_0x525067=_0x525067-0x0;var _0x21ab1a=_0x8a41[_0x525067];return _0x21ab1a;};'use strict';var _=require(_0x18a4('0x0'));var util=require(_0x18a4('0x1'));var moment=require(_0x18a4('0x2'));var BPromise=require(_0x18a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18a4('0x4'));var db=require(_0x18a4('0x5'))['db'];var utils=require(_0x18a4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x18a4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x18a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53533c,_0x58eb3d,_0x3fd42f){return new BPromise(function(_0x2900ea,_0x335c14){return client['request'](_0x53533c,_0x3fd42f)[_0x18a4('0x9')](function(_0x3efabf){logger[_0x18a4('0xa')]('Condition,\x20%s,\x20%s',_0x58eb3d,'request\x20sent');logger[_0x18a4('0xb')](_0x18a4('0xc'),_0x58eb3d,_0x18a4('0xd'),JSON['stringify'](_0x3efabf));if(_0x3efabf[_0x18a4('0xe')]){if(_0x3efabf[_0x18a4('0xe')][_0x18a4('0xf')]===0x1f4){logger[_0x18a4('0xe')]('Condition,\x20%s,\x20%s',_0x58eb3d,_0x3efabf[_0x18a4('0xe')][_0x18a4('0x10')]);return _0x335c14(_0x3efabf[_0x18a4('0xe')][_0x18a4('0x10')]);}logger['error'](_0x18a4('0x11'),_0x58eb3d,_0x3efabf[_0x18a4('0xe')][_0x18a4('0x10')]);return _0x2900ea(_0x3efabf[_0x18a4('0xe')][_0x18a4('0x10')]);}else{logger[_0x18a4('0xa')]('Condition,\x20%s,\x20%s',_0x58eb3d,_0x18a4('0xd'));_0x2900ea(_0x3efabf[_0x18a4('0x12')][_0x18a4('0x10')]);}})[_0x18a4('0x13')](function(_0xff6afe){logger[_0x18a4('0xe')](_0x18a4('0x11'),_0x58eb3d,_0xff6afe);_0x335c14(_0xff6afe);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 01c1561..baec0c6 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 _0x759f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x759f,0xef));var _0xf759=function(_0x7b02ad,_0x2b4b59){_0x7b02ad=_0x7b02ad-0x0;var _0x4c1303=_0x759f[_0x7b02ad];return _0x4c1303;};'use strict';var multer=require('multer');var util=require(_0xf759('0x0'));var path=require(_0xf759('0x1'));var timeout=require(_0xf759('0x2'));var express=require(_0xf759('0x3'));var router=express[_0xf759('0x4')]();var fs_extra=require(_0xf759('0x5'));var auth=require(_0xf759('0x6'));var interaction=require(_0xf759('0x7'));var config=require('../../config/environment');var controller=require(_0xf759('0x8'));router[_0xf759('0x9')](_0xf759('0xa'),auth[_0xf759('0xb')](),controller['update']);router[_0xf759('0xc')](_0xf759('0xa'),auth[_0xf759('0xb')](),controller[_0xf759('0xd')]);module[_0xf759('0xe')]=router; \ No newline at end of file +var _0x266d=['path','express','fs-extra','../../components/auth/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','multer'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x266d,0xef));var _0xd266=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x266d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xd266('0x0'));var util=require('util');var path=require(_0xd266('0x1'));var timeout=require('connect-timeout');var express=require(_0xd266('0x2'));var router=express['Router']();var fs_extra=require(_0xd266('0x3'));var auth=require(_0xd266('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd266('0x5'));router[_0xd266('0x6')](_0xd266('0x7'),auth[_0xd266('0x8')](),controller[_0xd266('0x9')]);router[_0xd266('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd266('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index c8369f0..b28cd36 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f73=['exports','STRING','sequelize'];(function(_0x584f18,_0x44690d){var _0x30cff1=function(_0x5a57ad){while(--_0x5a57ad){_0x584f18['push'](_0x584f18['shift']());}};_0x30cff1(++_0x44690d);}(_0x0f73,0x146));var _0x30f7=function(_0x4ca652,_0x4fa38a){_0x4ca652=_0x4ca652-0x0;var _0x5361a1=_0x0f73[_0x4ca652];return _0x5361a1;};'use strict';var Sequelize=require(_0x30f7('0x0'));module[_0x30f7('0x1')]={'name':{'type':Sequelize[_0x30f7('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x30f7('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xe5ba=['STRING','sequelize'];(function(_0xa966e9,_0x2f70f2){var _0x216493=function(_0x35a81c){while(--_0x35a81c){_0xa966e9['push'](_0xa966e9['shift']());}};_0x216493(++_0x2f70f2);}(_0xe5ba,0x16d));var _0xae5b=function(_0x1ad5fe,_0x5384a5){_0x1ad5fe=_0x1ad5fe-0x0;var _0x21b72a=_0xe5ba[_0x1ad5fe];return _0x21b72a;};'use strict';var Sequelize=require(_0xae5b('0x0'));module['exports']={'name':{'type':Sequelize[_0xae5b('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index e1340fb..8fab329 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb44a=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ContactItemTypes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','CmContactHasItem','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','error','stack','name','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xb44a,0x1c2));var _0xab44=function(_0x3f7861,_0x13619b){_0x3f7861=_0x3f7861-0x0;var _0x36fdae=_0xb44a[_0x3f7861];return _0x36fdae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab44('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab44('0x2'));var util=require('util');var path=require(_0xab44('0x3'));var sox=require(_0xab44('0x4'));var csv=require(_0xab44('0x5'));var ejs=require(_0xab44('0x6'));var fs=require('fs');var fs_extra=require(_0xab44('0x7'));var _=require(_0xab44('0x8'));var squel=require(_0xab44('0x9'));var crypto=require(_0xab44('0xa'));var jsforce=require(_0xab44('0xb'));var deskjs=require(_0xab44('0xc'));var toCsv=require(_0xab44('0x5'));var querystring=require(_0xab44('0xd'));var Papa=require(_0xab44('0xe'));var Redis=require('ioredis');var authService=require(_0xab44('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xab44('0x11'));var utils=require(_0xab44('0x12'));var config=require(_0xab44('0x13'));var licenseUtil=require(_0xab44('0x14'));var db=require(_0xab44('0x15'))['db'];function respondWithStatusCode(_0x237c26,_0x52d282){_0x52d282=_0x52d282||0xcc;return function(_0x57fcff){if(_0x57fcff){return _0x237c26[_0xab44('0x16')](_0x52d282);}return _0x237c26['status'](_0x52d282)[_0xab44('0x17')]();};}function respondWithResult(_0x5ae369,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x15b98a){if(_0x15b98a){return _0x5ae369[_0xab44('0x18')](_0x25f611)[_0xab44('0x19')](_0x15b98a);}};}function respondWithFilteredResult(_0x31404d,_0x41701b){return function(_0x4875df){if(_0x4875df){var _0x51251b=typeof _0x41701b[_0xab44('0x1a')]===_0xab44('0x1b')&&typeof _0x41701b[_0xab44('0x1c')]===_0xab44('0x1b');var _0xffdfbc=_0x4875df[_0xab44('0x1d')];var _0x354b09=_0x51251b?0x0:_0x41701b[_0xab44('0x1a')];var _0x310b15=_0x51251b?_0x4875df[_0xab44('0x1d')]:_0x41701b[_0xab44('0x1a')]+_0x41701b['limit'];var _0xb779bb;if(_0x310b15>=_0xffdfbc){_0x310b15=_0xffdfbc;_0xb779bb=0xc8;}else{_0xb779bb=0xce;}_0x31404d[_0xab44('0x18')](_0xb779bb);return _0x31404d[_0xab44('0x1e')](_0xab44('0x1f'),_0x354b09+'-'+_0x310b15+'/'+_0xffdfbc)[_0xab44('0x19')](_0x4875df);}return null;};}function patchUpdates(_0x5123b1){return function(_0xcd426){try{jsonpatch['apply'](_0xcd426,_0x5123b1,!![]);}catch(_0x1f7311){return BPromise[_0xab44('0x20')](_0x1f7311);}return _0xcd426[_0xab44('0x21')]();};}function saveUpdates(_0x355083,_0x486317){return function(_0x3a2b1d){if(_0x3a2b1d){return _0x3a2b1d[_0xab44('0x22')](_0x355083)[_0xab44('0x23')](function(_0x3b17d5){return _0x3b17d5;});}return null;};}function removeEntity(_0x11f0b,_0x402950){return function(_0x43f1c6){if(_0x43f1c6){return _0x43f1c6['destroy']()['then'](function(){var _0x1d4a2f=_0x43f1c6['get']({'plain':!![]});var _0x2439f3='ContactItemTypes';return db[_0xab44('0x24')]['destroy']({'where':{'type':_0x2439f3,'resourceId':_0x1d4a2f['id']}})['then'](function(){return _0x43f1c6;});})[_0xab44('0x23')](function(){_0x11f0b[_0xab44('0x18')](0xcc)[_0xab44('0x17')]();});}};}function handleEntityNotFound(_0x4620ed,_0x132bf6){return function(_0x4e820c){if(!_0x4e820c){_0x4620ed[_0xab44('0x16')](0x194);}return _0x4e820c;};}function handleError(_0x5587fe,_0x5071f3){_0x5071f3=_0x5071f3||0x1f4;return function(_0x887b0d){logger[_0xab44('0x25')](_0x887b0d[_0xab44('0x26')]);if(_0x887b0d[_0xab44('0x27')]){delete _0x887b0d[_0xab44('0x27')];}_0x5587fe[_0xab44('0x18')](_0x5071f3)['send'](_0x887b0d);};}exports[_0xab44('0x28')]=function(_0x43a42d,_0x36f9b6){var _0x47e1be={},_0x54cac8={},_0x106d3a={'count':0x0,'rows':[]};var _0x5082e4=_['map'](db[_0xab44('0x29')][_0xab44('0x2a')],function(_0x160177){return{'name':_0x160177[_0xab44('0x2b')],'type':_0x160177[_0xab44('0x2c')][_0xab44('0x2d')]};});_0x54cac8[_0xab44('0x2e')]=_[_0xab44('0x2f')](_0x5082e4,_0xab44('0x27'));_0x54cac8[_0xab44('0x30')]=_[_0xab44('0x31')](_0x43a42d[_0xab44('0x30')]);_0x54cac8[_0xab44('0x32')]=_[_0xab44('0x33')](_0x54cac8['model'],_0x54cac8['query']);_0x47e1be[_0xab44('0x34')]=_[_0xab44('0x33')](_0x54cac8['model'],qs[_0xab44('0x35')](_0x43a42d[_0xab44('0x30')][_0xab44('0x35')]));_0x47e1be[_0xab44('0x34')]=_0x47e1be[_0xab44('0x34')][_0xab44('0x36')]?_0x47e1be[_0xab44('0x34')]:_0x54cac8[_0xab44('0x2e')];if(!_0x43a42d[_0xab44('0x30')][_0xab44('0x37')](_0xab44('0x38'))){_0x47e1be[_0xab44('0x1c')]=qs[_0xab44('0x1c')](_0x43a42d[_0xab44('0x30')][_0xab44('0x1c')]);_0x47e1be[_0xab44('0x1a')]=qs[_0xab44('0x1a')](_0x43a42d[_0xab44('0x30')]['offset']);}_0x47e1be[_0xab44('0x39')]=qs[_0xab44('0x3a')](_0x43a42d[_0xab44('0x30')][_0xab44('0x3a')]);_0x47e1be['where']=qs[_0xab44('0x32')](_[_0xab44('0x3b')](_0x43a42d[_0xab44('0x30')],_0x54cac8[_0xab44('0x32')]),_0x5082e4);if(_0x43a42d[_0xab44('0x30')]['filter']){_0x47e1be[_0xab44('0x3c')]=_[_0xab44('0x3d')](_0x47e1be[_0xab44('0x3c')],{'$or':_['map'](_0x5082e4,function(_0x3ef5ea){if(_0x3ef5ea[_0xab44('0x2c')]!==_0xab44('0x3e')){var _0xf80acf={};_0xf80acf[_0x3ef5ea[_0xab44('0x27')]]={'$like':'%'+_0x43a42d['query'][_0xab44('0x3f')]+'%'};return _0xf80acf;}})});}_0x47e1be=_['merge']({},_0x47e1be,_0x43a42d[_0xab44('0x40')]);var _0x4f2b94={'where':_0x47e1be['where']};return db['ContactItemType']['count'](_0x4f2b94)['then'](function(_0x120585){_0x106d3a[_0xab44('0x1d')]=_0x120585;if(_0x43a42d[_0xab44('0x30')][_0xab44('0x41')]){_0x47e1be[_0xab44('0x42')]=[{'all':!![]}];}return db[_0xab44('0x29')][_0xab44('0x43')](_0x47e1be);})[_0xab44('0x23')](function(_0x4429e6){_0x106d3a[_0xab44('0x44')]=_0x4429e6;return _0x106d3a;})['then'](respondWithFilteredResult(_0x36f9b6,_0x47e1be))[_0xab44('0x45')](handleError(_0x36f9b6,null));};exports[_0xab44('0x46')]=function(_0x3cb9fc,_0x9a6da5){var _0x54f603={'raw':!![],'where':{'id':_0x3cb9fc[_0xab44('0x47')]['id']}},_0x3e9a79={};_0x3e9a79[_0xab44('0x2e')]=_[_0xab44('0x31')](db[_0xab44('0x29')][_0xab44('0x2a')]);_0x3e9a79['query']=_['keys'](_0x3cb9fc[_0xab44('0x30')]);_0x3e9a79[_0xab44('0x32')]=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],_0x3e9a79[_0xab44('0x30')]);_0x54f603['attributes']=_[_0xab44('0x33')](_0x3e9a79[_0xab44('0x2e')],qs[_0xab44('0x35')](_0x3cb9fc[_0xab44('0x30')]['fields']));_0x54f603[_0xab44('0x34')]=_0x54f603[_0xab44('0x34')][_0xab44('0x36')]?_0x54f603['attributes']:_0x3e9a79[_0xab44('0x2e')];if(_0x3cb9fc[_0xab44('0x30')][_0xab44('0x41')]){_0x54f603[_0xab44('0x42')]=[{'all':!![]}];}_0x54f603=_['merge']({},_0x54f603,_0x3cb9fc[_0xab44('0x40')]);return db['ContactItemType'][_0xab44('0x48')](_0x54f603)[_0xab44('0x23')](handleEntityNotFound(_0x9a6da5,null))[_0xab44('0x23')](respondWithResult(_0x9a6da5,null))[_0xab44('0x45')](handleError(_0x9a6da5,null));};exports['create']=function(_0x328891,_0x5497a3){return db[_0xab44('0x29')][_0xab44('0x49')](_0x328891[_0xab44('0x4a')],{})[_0xab44('0x23')](function(_0x14bd54){var _0x4eeef0=_0x328891[_0xab44('0x4b')]['get']({'plain':!![]});if(!_0x4eeef0)throw new Error(_0xab44('0x4c'));if(_0x4eeef0[_0xab44('0x4d')]===_0xab44('0x4b')){var _0x50b705=_0x14bd54[_0xab44('0x4e')]({'plain':!![]});var _0x105a89=_0xab44('0x4f');return db[_0xab44('0x50')][_0xab44('0x48')]({'where':{'name':_0x105a89,'userProfileId':_0x4eeef0['userProfileId']},'raw':!![]})['then'](function(_0xe5302b){if(_0xe5302b&&_0xe5302b[_0xab44('0x51')]===0x0){return db[_0xab44('0x24')]['create']({'name':_0x50b705[_0xab44('0x27')],'resourceId':_0x50b705['id'],'type':_0xe5302b[_0xab44('0x27')],'sectionId':_0xe5302b['id']},{})[_0xab44('0x23')](function(){return _0x14bd54;});}else{return _0x14bd54;}})[_0xab44('0x45')](function(_0x4eb2eb){logger['error'](_0xab44('0x52'),_0x4eb2eb);throw _0x4eb2eb;});}return _0x14bd54;})[_0xab44('0x23')](respondWithResult(_0x5497a3,0xc9))[_0xab44('0x45')](handleError(_0x5497a3,null));};exports[_0xab44('0x22')]=function(_0x109f38,_0x2234c0){if(_0x109f38[_0xab44('0x4a')]['id']){delete _0x109f38[_0xab44('0x4a')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x109f38[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x2234c0,null))[_0xab44('0x23')](saveUpdates(_0x109f38[_0xab44('0x4a')],null))[_0xab44('0x23')](respondWithResult(_0x2234c0,null))[_0xab44('0x45')](handleError(_0x2234c0,null));};exports[_0xab44('0x53')]=function(_0x411bac,_0x1e606b){return db['ContactItemType'][_0xab44('0x48')]({'where':{'id':_0x411bac[_0xab44('0x47')]['id']}})[_0xab44('0x23')](handleEntityNotFound(_0x1e606b,null))[_0xab44('0x23')](db[_0xab44('0x54')][_0xab44('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x411bac[_0xab44('0x47')]['id']}}))[_0xab44('0x23')](removeEntity(_0x1e606b,null))['catch'](handleError(_0x1e606b,null));}; \ No newline at end of file +var _0x36ee=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','stack','index','map','ContactItemType','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4d82a4,_0x13d5bd){var _0x274108=function(_0x3f7da1){while(--_0x3f7da1){_0x4d82a4['push'](_0x4d82a4['shift']());}};_0x274108(++_0x13d5bd);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){var _0xb32195=_0x4749a8[_0xe36e('0x28')]({'plain':!![]});var _0x1507f9=_0xe36e('0x29');return db['UserProfileResource'][_0xe36e('0x27')]({'where':{'type':_0x1507f9,'resourceId':_0xb32195['id']}})[_0xe36e('0x26')](function(){return _0x4749a8;});})[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d757c,_0x5a3133){return function(_0xf7b02e){if(!_0xf7b02e){_0x2d757c['sendStatus'](0x194);}return _0xf7b02e;};}function handleError(_0x19f001,_0x5884cb){_0x5884cb=_0x5884cb||0x1f4;return function(_0x410504){logger['error'](_0x410504[_0xe36e('0x2a')]);if(_0x410504['name']){delete _0x410504['name'];}_0x19f001['status'](_0x5884cb)['send'](_0x410504);};}exports[_0xe36e('0x2b')]=function(_0x1fc639,_0x4cf185){var _0x4ac819={},_0x1fa1ec={},_0xb8d44e={'count':0x0,'rows':[]};var _0x259e19=_[_0xe36e('0x2c')](db[_0xe36e('0x2d')][_0xe36e('0x2e')],function(_0x57bb9b){return{'name':_0x57bb9b[_0xe36e('0x2f')],'type':_0x57bb9b[_0xe36e('0x30')]['key']};});_0x1fa1ec[_0xe36e('0x31')]=_[_0xe36e('0x2c')](_0x259e19,_0xe36e('0x32'));_0x1fa1ec[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x1fc639[_0xe36e('0x33')]);_0x1fa1ec[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x1fa1ec[_0xe36e('0x31')],_0x1fa1ec[_0xe36e('0x33')]);_0x4ac819[_0xe36e('0x37')]=_['intersection'](_0x1fa1ec[_0xe36e('0x31')],qs['fields'](_0x1fc639['query'][_0xe36e('0x38')]));_0x4ac819['attributes']=_0x4ac819[_0xe36e('0x37')][_0xe36e('0x39')]?_0x4ac819[_0xe36e('0x37')]:_0x1fa1ec[_0xe36e('0x31')];if(!_0x1fc639['query']['hasOwnProperty'](_0xe36e('0x3a'))){_0x4ac819[_0xe36e('0x1e')]=qs[_0xe36e('0x1e')](_0x1fc639[_0xe36e('0x33')]['limit']);_0x4ac819[_0xe36e('0x1c')]=qs[_0xe36e('0x1c')](_0x1fc639[_0xe36e('0x33')]['offset']);}_0x4ac819[_0xe36e('0x3b')]=qs[_0xe36e('0x3c')](_0x1fc639['query'][_0xe36e('0x3c')]);_0x4ac819[_0xe36e('0x3d')]=qs[_0xe36e('0x35')](_[_0xe36e('0x3e')](_0x1fc639[_0xe36e('0x33')],_0x1fa1ec[_0xe36e('0x35')]),_0x259e19);if(_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]){_0x4ac819[_0xe36e('0x3d')]=_[_0xe36e('0x40')](_0x4ac819[_0xe36e('0x3d')],{'$or':_[_0xe36e('0x2c')](_0x259e19,function(_0x3c4703){if(_0x3c4703['type']!==_0xe36e('0x41')){var _0x134fb2={};_0x134fb2[_0x3c4703[_0xe36e('0x32')]]={'$like':'%'+_0x1fc639[_0xe36e('0x33')][_0xe36e('0x3f')]+'%'};return _0x134fb2;}})});}_0x4ac819=_['merge']({},_0x4ac819,_0x1fc639['options']);var _0x4094c6={'where':_0x4ac819[_0xe36e('0x3d')]};return db[_0xe36e('0x2d')][_0xe36e('0x1f')](_0x4094c6)[_0xe36e('0x26')](function(_0x34a1ba){_0xb8d44e[_0xe36e('0x1f')]=_0x34a1ba;if(_0x1fc639[_0xe36e('0x33')]['includeAll']){_0x4ac819[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2d')]['findAll'](_0x4ac819);})[_0xe36e('0x26')](function(_0x5ef3e4){_0xb8d44e[_0xe36e('0x43')]=_0x5ef3e4;return _0xb8d44e;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4cf185,_0x4ac819))[_0xe36e('0x44')](handleError(_0x4cf185,null));};exports[_0xe36e('0x45')]=function(_0x3b1269,_0x4c5e10){var _0x2ffc34={'raw':!![],'where':{'id':_0x3b1269[_0xe36e('0x46')]['id']}},_0x2961c9={};_0x2961c9[_0xe36e('0x31')]=_[_0xe36e('0x34')](db[_0xe36e('0x2d')]['rawAttributes']);_0x2961c9[_0xe36e('0x33')]=_[_0xe36e('0x34')](_0x3b1269[_0xe36e('0x33')]);_0x2961c9[_0xe36e('0x35')]=_[_0xe36e('0x36')](_0x2961c9['model'],_0x2961c9[_0xe36e('0x33')]);_0x2ffc34[_0xe36e('0x37')]=_[_0xe36e('0x36')](_0x2961c9[_0xe36e('0x31')],qs[_0xe36e('0x38')](_0x3b1269[_0xe36e('0x33')][_0xe36e('0x38')]));_0x2ffc34[_0xe36e('0x37')]=_0x2ffc34[_0xe36e('0x37')]['length']?_0x2ffc34['attributes']:_0x2961c9[_0xe36e('0x31')];if(_0x3b1269['query'][_0xe36e('0x47')]){_0x2ffc34[_0xe36e('0x42')]=[{'all':!![]}];}_0x2ffc34=_[_0xe36e('0x40')]({},_0x2ffc34,_0x3b1269[_0xe36e('0x48')]);return db['ContactItemType'][_0xe36e('0x49')](_0x2ffc34)[_0xe36e('0x26')](handleEntityNotFound(_0x4c5e10,null))['then'](respondWithResult(_0x4c5e10,null))[_0xe36e('0x44')](handleError(_0x4c5e10,null));};exports[_0xe36e('0x4a')]=function(_0x2c26e6,_0x42eae5){return db[_0xe36e('0x2d')][_0xe36e('0x4a')](_0x2c26e6[_0xe36e('0x4b')],{})[_0xe36e('0x26')](function(_0x17555e){var _0x3a99aa=_0x2c26e6[_0xe36e('0x4c')][_0xe36e('0x28')]({'plain':!![]});if(!_0x3a99aa)throw new Error(_0xe36e('0x4d'));if(_0x3a99aa[_0xe36e('0x4e')]===_0xe36e('0x4c')){var _0x5678d3=_0x17555e[_0xe36e('0x28')]({'plain':!![]});var _0x55aadf='ContactItemTypes';return db[_0xe36e('0x4f')][_0xe36e('0x49')]({'where':{'name':_0x55aadf,'userProfileId':_0x3a99aa['userProfileId']},'raw':!![]})[_0xe36e('0x26')](function(_0x3814eb){if(_0x3814eb&&_0x3814eb[_0xe36e('0x50')]===0x0){return db[_0xe36e('0x51')][_0xe36e('0x4a')]({'name':_0x5678d3[_0xe36e('0x32')],'resourceId':_0x5678d3['id'],'type':_0x3814eb[_0xe36e('0x32')],'sectionId':_0x3814eb['id']},{})[_0xe36e('0x26')](function(){return _0x17555e;});}else{return _0x17555e;}})[_0xe36e('0x44')](function(_0x55d190){logger[_0xe36e('0x52')](_0xe36e('0x53'),_0x55d190);throw _0x55d190;});}return _0x17555e;})['then'](respondWithResult(_0x42eae5,0xc9))[_0xe36e('0x44')](handleError(_0x42eae5,null));};exports[_0xe36e('0x25')]=function(_0x3e1040,_0x206f75){if(_0x3e1040[_0xe36e('0x4b')]['id']){delete _0x3e1040['body']['id'];}return db['ContactItemType']['find']({'where':{'id':_0x3e1040['params']['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x206f75,null))[_0xe36e('0x26')](saveUpdates(_0x3e1040[_0xe36e('0x4b')],null))[_0xe36e('0x26')](respondWithResult(_0x206f75,null))[_0xe36e('0x44')](handleError(_0x206f75,null));};exports[_0xe36e('0x27')]=function(_0x7c3766,_0x17965c){return db[_0xe36e('0x2d')]['find']({'where':{'id':_0x7c3766[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x17965c,null))['then'](db[_0xe36e('0x54')][_0xe36e('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x7c3766[_0xe36e('0x46')]['id']}}))[_0xe36e('0x26')](removeEntity(_0x17965c,null))[_0xe36e('0x44')](handleError(_0x17965c,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 8c5abf2..4a8ba4d 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf96e=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','lodash','util'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0xf96e,0x1ae));var _0xef96=function(_0x6f8f05,_0x29fece){_0x6f8f05=_0x6f8f05-0x0;var _0x1602a8=_0xf96e[_0x6f8f05];return _0x1602a8;};'use strict';var _=require(_0xef96('0x0'));var util=require(_0xef96('0x1'));var logger=require(_0xef96('0x2'))(_0xef96('0x3'));var moment=require(_0xef96('0x4'));var BPromise=require('bluebird');var rp=require(_0xef96('0x5'));var fs=require('fs');var path=require(_0xef96('0x6'));var rimraf=require(_0xef96('0x7'));var config=require(_0xef96('0x8'));var attributes=require(_0xef96('0x9'));module[_0xef96('0xa')]=function(_0x3b115a,_0x507a5e){return _0x3b115a[_0xef96('0xb')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec51=['request-promise','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','moment','bluebird'];(function(_0x6f5b62,_0x5d0a6f){var _0x3dc469=function(_0x4c4a7a){while(--_0x4c4a7a){_0x6f5b62['push'](_0x6f5b62['shift']());}};_0x3dc469(++_0x5d0a6f);}(_0xec51,0x6b));var _0x1ec5=function(_0x45e83a,_0x430070){_0x45e83a=_0x45e83a-0x0;var _0x2e46e9=_0xec51[_0x45e83a];return _0x2e46e9;};'use strict';var _=require(_0x1ec5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1ec5('0x1'));var BPromise=require(_0x1ec5('0x2'));var rp=require(_0x1ec5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1ec5('0x4'));var attributes=require(_0x1ec5('0x5'));module[_0x1ec5('0x6')]=function(_0x528938,_0x1a8bd3){return _0x528938[_0x1ec5('0x7')](_0x1ec5('0x8'),attributes,{'tableName':_0x1ec5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index f3e5eff..b2846a2 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbafb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x14cb58,_0x214d62){var _0x5f097e=function(_0x5b8666){while(--_0x5b8666){_0x14cb58['push'](_0x14cb58['shift']());}};_0x5f097e(++_0x214d62);}(_0xbafb,0xf0));var _0xbbaf=function(_0x22c7fd,_0x363269){_0x22c7fd=_0x22c7fd-0x0;var _0x4ca673=_0xbafb[_0x22c7fd];return _0x4ca673;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbbaf('0x0'));var rs=require(_0xbbaf('0x1'));var fs=require('fs');var Redis=require(_0xbbaf('0x2'));var db=require(_0xbbaf('0x3'))['db'];var utils=require(_0xbbaf('0x4'));var logger=require(_0xbbaf('0x5'))(_0xbbaf('0x6'));var config=require('../../config/environment');var jayson=require(_0xbbaf('0x7'));var client=jayson['client'][_0xbbaf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c7004,_0x3f6862,_0x751f84){return new BPromise(function(_0x52baa6,_0x211314){return client[_0xbbaf('0x9')](_0x3c7004,_0x751f84)[_0xbbaf('0xa')](function(_0x263dc5){logger['info'](_0xbbaf('0xb'),_0x3f6862,_0xbbaf('0xc'));logger[_0xbbaf('0xd')](_0xbbaf('0xe'),_0x3f6862,_0xbbaf('0xc'),JSON[_0xbbaf('0xf')](_0x263dc5));if(_0x263dc5[_0xbbaf('0x10')]){if(_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x11')]===0x1f4){logger[_0xbbaf('0x10')](_0xbbaf('0xb'),_0x3f6862,_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);return _0x211314(_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);}logger[_0xbbaf('0x10')](_0xbbaf('0xb'),_0x3f6862,_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);return _0x52baa6(_0x263dc5[_0xbbaf('0x10')][_0xbbaf('0x12')]);}else{logger[_0xbbaf('0x13')](_0xbbaf('0xb'),_0x3f6862,'request\x20sent');_0x52baa6(_0x263dc5['result'][_0xbbaf('0x12')]);}})['catch'](function(_0x327f67){logger[_0xbbaf('0x10')](_0xbbaf('0xb'),_0x3f6862,_0x327f67);_0x211314(_0x327f67);});});} \ No newline at end of file +var _0x45e2=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment'];(function(_0x1c4c90,_0x30f655){var _0x57ee6d=function(_0x3795e2){while(--_0x3795e2){_0x1c4c90['push'](_0x1c4c90['shift']());}};_0x57ee6d(++_0x30f655);}(_0x45e2,0x1a0));var _0x245e=function(_0x194b97,_0x51282e){_0x194b97=_0x194b97-0x0;var _0x3db970=_0x45e2[_0x194b97];return _0x3db970;};'use strict';var _=require('lodash');var util=require(_0x245e('0x0'));var moment=require(_0x245e('0x1'));var BPromise=require('bluebird');var rs=require(_0x245e('0x2'));var fs=require('fs');var Redis=require(_0x245e('0x3'));var db=require(_0x245e('0x4'))['db'];var utils=require(_0x245e('0x5'));var logger=require('../../config/logger')(_0x245e('0x6'));var config=require('../../config/environment');var jayson=require(_0x245e('0x7'));var client=jayson['client'][_0x245e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a45de,_0xd1cc9d,_0x2b9b9f){return new BPromise(function(_0x6a0a8f,_0x3e5320){return client['request'](_0x2a45de,_0x2b9b9f)['then'](function(_0x549bee){logger[_0x245e('0x9')](_0x245e('0xa'),_0xd1cc9d,_0x245e('0xb'));logger[_0x245e('0xc')](_0x245e('0xd'),_0xd1cc9d,'request\x20sent',JSON[_0x245e('0xe')](_0x549bee));if(_0x549bee['error']){if(_0x549bee[_0x245e('0xf')][_0x245e('0x10')]===0x1f4){logger[_0x245e('0xf')](_0x245e('0xa'),_0xd1cc9d,_0x549bee[_0x245e('0xf')][_0x245e('0x11')]);return _0x3e5320(_0x549bee[_0x245e('0xf')]['message']);}logger[_0x245e('0xf')](_0x245e('0xa'),_0xd1cc9d,_0x549bee[_0x245e('0xf')]['message']);return _0x6a0a8f(_0x549bee[_0x245e('0xf')][_0x245e('0x11')]);}else{logger[_0x245e('0x9')]('ContactItemType,\x20%s,\x20%s',_0xd1cc9d,_0x245e('0xb'));_0x6a0a8f(_0x549bee[_0x245e('0x12')][_0x245e('0x11')]);}})['catch'](function(_0x149404){logger[_0x245e('0xf')](_0x245e('0xa'),_0xd1cc9d,_0x149404);_0x3e5320(_0x149404);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 5617b93..4993470 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x79c7=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','show'];(function(_0x86b88f,_0x12d21f){var _0x3e3bc4=function(_0xc3bdd){while(--_0xc3bdd){_0x86b88f['push'](_0x86b88f['shift']());}};_0x3e3bc4(++_0x12d21f);}(_0x79c7,0x154));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x779c('0x0'));var util=require(_0x779c('0x1'));var path=require(_0x779c('0x2'));var timeout=require(_0x779c('0x3'));var express=require(_0x779c('0x4'));var router=express[_0x779c('0x5')]();var fs_extra=require(_0x779c('0x6'));var auth=require(_0x779c('0x7'));var interaction=require(_0x779c('0x8'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router['get']('/',auth[_0x779c('0x9')](),controller['index']);router['get'](_0x779c('0xa'),auth['isAuthenticated'](),controller[_0x779c('0xb')]);router['post']('/',auth[_0x779c('0x9')](),controller[_0x779c('0xc')]);router['put'](_0x779c('0xa'),auth[_0x779c('0x9')](),controller['update']);router[_0x779c('0xd')]('/:id',auth[_0x779c('0x9')](),controller[_0x779c('0xe')]);module[_0x779c('0xf')]=router; \ No newline at end of file +var _0xb7a6=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x3ccbc6,_0x5cb69e){var _0x495b23=function(_0x2eaa8f){while(--_0x2eaa8f){_0x3ccbc6['push'](_0x3ccbc6['shift']());}};_0x495b23(++_0x5cb69e);}(_0xb7a6,0x17f));var _0x6b7a=function(_0x97c1a,_0x43a076){_0x97c1a=_0x97c1a-0x0;var _0x1f86d0=_0xb7a6[_0x97c1a];return _0x1f86d0;};'use strict';var multer=require(_0x6b7a('0x0'));var util=require(_0x6b7a('0x1'));var path=require(_0x6b7a('0x2'));var timeout=require(_0x6b7a('0x3'));var express=require(_0x6b7a('0x4'));var router=express[_0x6b7a('0x5')]();var fs_extra=require(_0x6b7a('0x6'));var auth=require(_0x6b7a('0x7'));var interaction=require(_0x6b7a('0x8'));var config=require('../../config/environment');var controller=require(_0x6b7a('0x9'));router[_0x6b7a('0xa')]('/',auth['isAuthenticated'](),controller[_0x6b7a('0xb')]);router[_0x6b7a('0xa')](_0x6b7a('0xc'),auth[_0x6b7a('0xd')](),controller[_0x6b7a('0xe')]);router[_0x6b7a('0xf')]('/',auth[_0x6b7a('0xd')](),controller[_0x6b7a('0x10')]);router[_0x6b7a('0x11')](_0x6b7a('0xc'),auth['isAuthenticated'](),controller[_0x6b7a('0x12')]);router[_0x6b7a('0x13')]('/:id',auth[_0x6b7a('0xd')](),controller['destroy']);module[_0x6b7a('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index b65bf88..bae19e0 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 _0xb10b=['name','sequelize','STRING'];(function(_0x4e3557,_0x31c9e4){var _0x3e82d5=function(_0x55e147){while(--_0x55e147){_0x4e3557['push'](_0x4e3557['shift']());}};_0x3e82d5(++_0x31c9e4);}(_0xb10b,0x12a));var _0xbb10=function(_0x441fae,_0x3ab2ee){_0x441fae=_0x441fae-0x0;var _0x189025=_0xb10b[_0x441fae];return _0x189025;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 0098fa4..4177b7b 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 _0xbfe0=['undefined','limit','count','set','apply','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','body','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrFaxAccounts','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','status','json','offset'];(function(_0x3e6ac0,_0x34b200){var _0xe1dee5=function(_0x8864a8){while(--_0x8864a8){_0x3e6ac0['push'](_0x3e6ac0['shift']());}};_0xe1dee5(++_0x34b200);}(_0xbfe0,0xeb));var _0x0bfe=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xbfe0[_0x18fb16];return _0x147b0d;};'use strict';var emlformat=require(_0x0bfe('0x0'));var rimraf=require(_0x0bfe('0x1'));var zipdir=require(_0x0bfe('0x2'));var jsonpatch=require(_0x0bfe('0x3'));var rp=require('request-promise');var moment=require(_0x0bfe('0x4'));var BPromise=require(_0x0bfe('0x5'));var Mustache=require('mustache');var util=require(_0x0bfe('0x6'));var path=require(_0x0bfe('0x7'));var sox=require(_0x0bfe('0x8'));var csv=require(_0x0bfe('0x9'));var ejs=require(_0x0bfe('0xa'));var fs=require('fs');var fs_extra=require(_0x0bfe('0xb'));var _=require(_0x0bfe('0xc'));var squel=require(_0x0bfe('0xd'));var crypto=require(_0x0bfe('0xe'));var jsforce=require(_0x0bfe('0xf'));var deskjs=require(_0x0bfe('0x10'));var toCsv=require(_0x0bfe('0x9'));var querystring=require(_0x0bfe('0x11'));var Papa=require(_0x0bfe('0x12'));var Redis=require('ioredis');var authService=require(_0x0bfe('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bfe('0x14'));var logger=require('../../config/logger')(_0x0bfe('0x15'));var utils=require(_0x0bfe('0x16'));var config=require(_0x0bfe('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bfe('0x18'))['db'];config[_0x0bfe('0x19')]=_[_0x0bfe('0x1a')](config[_0x0bfe('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0bfe('0x1b'))(new Redis(config[_0x0bfe('0x19')]));require(_0x0bfe('0x1c'))['register'](socket);function respondWithStatusCode(_0x3d6e16,_0x2a975a){_0x2a975a=_0x2a975a||0xcc;return function(_0x518676){if(_0x518676){return _0x3d6e16[_0x0bfe('0x1d')](_0x2a975a);}return _0x3d6e16[_0x0bfe('0x1e')](_0x2a975a)['end']();};}function respondWithResult(_0x57ae1e,_0x5c8d9f){_0x5c8d9f=_0x5c8d9f||0xc8;return function(_0x3b63e6){if(_0x3b63e6){return _0x57ae1e[_0x0bfe('0x1e')](_0x5c8d9f)[_0x0bfe('0x1f')](_0x3b63e6);}};}function respondWithFilteredResult(_0x199588,_0x26f465){return function(_0x1b7342){if(_0x1b7342){var _0x335f1d=typeof _0x26f465[_0x0bfe('0x20')]===_0x0bfe('0x21')&&typeof _0x26f465[_0x0bfe('0x22')]===_0x0bfe('0x21');var _0x7b91dd=_0x1b7342[_0x0bfe('0x23')];var _0x13bb3f=_0x335f1d?0x0:_0x26f465[_0x0bfe('0x20')];var _0x47ead3=_0x335f1d?_0x1b7342['count']:_0x26f465['offset']+_0x26f465[_0x0bfe('0x22')];var _0x52af65;if(_0x47ead3>=_0x7b91dd){_0x47ead3=_0x7b91dd;_0x52af65=0xc8;}else{_0x52af65=0xce;}_0x199588[_0x0bfe('0x1e')](_0x52af65);return _0x199588[_0x0bfe('0x24')]('Content-Range',_0x13bb3f+'-'+_0x47ead3+'/'+_0x7b91dd)['json'](_0x1b7342);}return null;};}function patchUpdates(_0x2e71d6){return function(_0x13b2bc){try{jsonpatch[_0x0bfe('0x25')](_0x13b2bc,_0x2e71d6,!![]);}catch(_0x4aacb2){return BPromise['reject'](_0x4aacb2);}return _0x13b2bc[_0x0bfe('0x26')]();};}function saveUpdates(_0x4e871b,_0xcd7559){return function(_0x1f7451){if(_0x1f7451){return _0x1f7451[_0x0bfe('0x27')](_0x4e871b)[_0x0bfe('0x28')](function(_0x5adf01){return _0x5adf01;});}return null;};}function removeEntity(_0x2cae7d,_0x575df4){return function(_0x57edfc){if(_0x57edfc){return _0x57edfc[_0x0bfe('0x29')]()[_0x0bfe('0x28')](function(){var _0x2fa328=_0x57edfc['get']({'plain':!![]});var _0x43c392=_0x0bfe('0x2a');return db[_0x0bfe('0x2b')]['destroy']({'where':{'type':_0x43c392,'resourceId':_0x2fa328['id']}})['then'](function(){return _0x57edfc;});})['then'](function(){_0x2cae7d[_0x0bfe('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5845,_0x194d41){return function(_0x1a33fc){if(!_0x1a33fc){_0x2f5845['sendStatus'](0x194);}return _0x1a33fc;};}function handleError(_0x87c8e0,_0x36963a){_0x36963a=_0x36963a||0x1f4;return function(_0x537e5f){logger[_0x0bfe('0x2c')](_0x537e5f[_0x0bfe('0x2d')]);if(_0x537e5f[_0x0bfe('0x2e')]){delete _0x537e5f[_0x0bfe('0x2e')];}_0x87c8e0['status'](_0x36963a)[_0x0bfe('0x2f')](_0x537e5f);};}exports[_0x0bfe('0x30')]=function(_0x18c08d,_0x25aa22){var _0x4cc14e={},_0x103aeb={},_0x128988={'count':0x0,'rows':[]};var _0x53c5f6=_['map'](db[_0x0bfe('0x31')]['rawAttributes'],function(_0x23c08b){return{'name':_0x23c08b[_0x0bfe('0x32')],'type':_0x23c08b[_0x0bfe('0x33')][_0x0bfe('0x34')]};});_0x103aeb[_0x0bfe('0x35')]=_[_0x0bfe('0x36')](_0x53c5f6,_0x0bfe('0x2e'));_0x103aeb[_0x0bfe('0x37')]=_[_0x0bfe('0x38')](_0x18c08d[_0x0bfe('0x37')]);_0x103aeb[_0x0bfe('0x39')]=_[_0x0bfe('0x3a')](_0x103aeb[_0x0bfe('0x35')],_0x103aeb[_0x0bfe('0x37')]);_0x4cc14e[_0x0bfe('0x3b')]=_[_0x0bfe('0x3a')](_0x103aeb[_0x0bfe('0x35')],qs[_0x0bfe('0x3c')](_0x18c08d['query']['fields']));_0x4cc14e['attributes']=_0x4cc14e[_0x0bfe('0x3b')]['length']?_0x4cc14e['attributes']:_0x103aeb['model'];if(!_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x3d')](_0x0bfe('0x3e'))){_0x4cc14e[_0x0bfe('0x22')]=qs['limit'](_0x18c08d['query'][_0x0bfe('0x22')]);_0x4cc14e[_0x0bfe('0x20')]=qs[_0x0bfe('0x20')](_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x20')]);}_0x4cc14e['order']=qs[_0x0bfe('0x3f')](_0x18c08d['query'][_0x0bfe('0x3f')]);_0x4cc14e[_0x0bfe('0x40')]=qs[_0x0bfe('0x39')](_['pick'](_0x18c08d[_0x0bfe('0x37')],_0x103aeb[_0x0bfe('0x39')]),_0x53c5f6);if(_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x41')]){_0x4cc14e['where']=_['merge'](_0x4cc14e[_0x0bfe('0x40')],{'$or':_[_0x0bfe('0x36')](_0x53c5f6,function(_0x1074ac){if(_0x1074ac[_0x0bfe('0x33')]!==_0x0bfe('0x42')){var _0x5f29a6={};_0x5f29a6[_0x1074ac['name']]={'$like':'%'+_0x18c08d['query'][_0x0bfe('0x41')]+'%'};return _0x5f29a6;}})});}_0x4cc14e=_[_0x0bfe('0x43')]({},_0x4cc14e,_0x18c08d['options']);var _0xd8f324={'where':_0x4cc14e[_0x0bfe('0x40')]};return db['Dashboard'][_0x0bfe('0x23')](_0xd8f324)[_0x0bfe('0x28')](function(_0x5e182f){_0x128988[_0x0bfe('0x23')]=_0x5e182f;if(_0x18c08d[_0x0bfe('0x37')][_0x0bfe('0x44')]){_0x4cc14e[_0x0bfe('0x45')]=[{'all':!![]}];}return db[_0x0bfe('0x31')][_0x0bfe('0x46')](_0x4cc14e);})['then'](function(_0x254d2e){_0x128988[_0x0bfe('0x47')]=_0x254d2e;return _0x128988;})[_0x0bfe('0x28')](respondWithFilteredResult(_0x25aa22,_0x4cc14e))[_0x0bfe('0x48')](handleError(_0x25aa22,null));};exports[_0x0bfe('0x49')]=function(_0x1ea8e1,_0xab9c67){var _0x54d80e={'raw':![],'where':{'id':_0x1ea8e1[_0x0bfe('0x4a')]['id']}},_0x24c7ec={};_0x24c7ec[_0x0bfe('0x35')]=_[_0x0bfe('0x38')](db[_0x0bfe('0x31')][_0x0bfe('0x4b')]);_0x24c7ec['query']=_[_0x0bfe('0x38')](_0x1ea8e1['query']);_0x24c7ec[_0x0bfe('0x39')]=_[_0x0bfe('0x3a')](_0x24c7ec[_0x0bfe('0x35')],_0x24c7ec[_0x0bfe('0x37')]);_0x54d80e[_0x0bfe('0x3b')]=_[_0x0bfe('0x3a')](_0x24c7ec[_0x0bfe('0x35')],qs[_0x0bfe('0x3c')](_0x1ea8e1[_0x0bfe('0x37')][_0x0bfe('0x3c')]));_0x54d80e['attributes']=_0x54d80e[_0x0bfe('0x3b')]['length']?_0x54d80e[_0x0bfe('0x3b')]:_0x24c7ec[_0x0bfe('0x35')];if(_0x1ea8e1['query'][_0x0bfe('0x44')]){_0x54d80e[_0x0bfe('0x45')]=[{'all':!![]}];}_0x54d80e=_[_0x0bfe('0x43')]({},_0x54d80e,_0x1ea8e1[_0x0bfe('0x4c')]);return db[_0x0bfe('0x31')][_0x0bfe('0x4d')](_0x54d80e)['then'](handleEntityNotFound(_0xab9c67,null))[_0x0bfe('0x28')](respondWithResult(_0xab9c67,null))['catch'](handleError(_0xab9c67,null));};exports[_0x0bfe('0x4e')]=function(_0x3ae67e,_0x21b0b1){return db[_0x0bfe('0x31')][_0x0bfe('0x4e')](_0x3ae67e['body'],{})[_0x0bfe('0x28')](function(_0x15a07e){var _0x13a978=_0x3ae67e[_0x0bfe('0x4f')][_0x0bfe('0x50')]({'plain':!![]});if(!_0x13a978)throw new Error(_0x0bfe('0x51'));if(_0x13a978[_0x0bfe('0x52')]===_0x0bfe('0x4f')){var _0x6c7ed4=_0x15a07e[_0x0bfe('0x50')]({'plain':!![]});var _0x2125fc=_0x0bfe('0x2a');return db[_0x0bfe('0x53')][_0x0bfe('0x4d')]({'where':{'name':_0x2125fc,'userProfileId':_0x13a978[_0x0bfe('0x54')]},'raw':!![]})[_0x0bfe('0x28')](function(_0xecd966){if(_0xecd966&&_0xecd966[_0x0bfe('0x55')]===0x0){return db[_0x0bfe('0x2b')][_0x0bfe('0x4e')]({'name':_0x6c7ed4[_0x0bfe('0x2e')],'resourceId':_0x6c7ed4['id'],'type':_0xecd966[_0x0bfe('0x2e')],'sectionId':_0xecd966['id']},{})['then'](function(){return _0x15a07e;});}else{return _0x15a07e;}})[_0x0bfe('0x48')](function(_0x49fa0b){logger['error'](_0x0bfe('0x56'),_0x49fa0b);throw _0x49fa0b;});}return _0x15a07e;})[_0x0bfe('0x28')](respondWithResult(_0x21b0b1,0xc9))[_0x0bfe('0x48')](handleError(_0x21b0b1,null));};exports['clone']=function(_0x6030ef,_0x2779f4){var _0x47088a={'where':{'id':_0x6030ef[_0x0bfe('0x4a')]['id']}},_0x115dcb={};_0x115dcb[_0x0bfe('0x35')]=_[_0x0bfe('0x38')](db[_0x0bfe('0x31')][_0x0bfe('0x4b')]);_0x47088a[_0x0bfe('0x3b')]=_['intersection'](_0x115dcb['model'],qs[_0x0bfe('0x3c')](_0x6030ef[_0x0bfe('0x37')][_0x0bfe('0x3c')]));_0x47088a[_0x0bfe('0x3b')]=_0x47088a[_0x0bfe('0x3b')][_0x0bfe('0x57')]?_0x47088a['attributes']:_0x115dcb['model'];if(_0x6030ef['query']['includeAll']){_0x47088a[_0x0bfe('0x45')]=[{'all':!![]}];}_0x47088a=_['merge']({},_0x47088a,_0x6030ef[_0x0bfe('0x4c')]);return db[_0x0bfe('0x31')][_0x0bfe('0x4d')](_0x47088a)[_0x0bfe('0x28')](handleEntityNotFound(_0x2779f4,null))[_0x0bfe('0x28')](function(_0x542ada){if(_0x542ada){var _0x29cafc=_0x542ada['get']({'plain':!![]});_0x29cafc=qs[_0x0bfe('0x58')](_0x29cafc,['id',_0x0bfe('0x59'),_0x0bfe('0x5a')]);_0x6030ef[_0x0bfe('0x5b')]=_[_0x0bfe('0x58')](_0x6030ef[_0x0bfe('0x5b')],['id',_0x0bfe('0x59'),_0x0bfe('0x5a')]);return db[_0x0bfe('0x31')]['create'](_['merge'](_0x29cafc,_0x6030ef['body']),{'include':_0x6030ef[_0x0bfe('0x37')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2635d0){var _0x589ec1=_0x6030ef['user'][_0x0bfe('0x50')]({'plain':!![]});if(!_0x589ec1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x589ec1['role']===_0x0bfe('0x4f')){var _0x356d4d=_0x2635d0[_0x0bfe('0x50')]({'plain':!![]});var _0x2fd00e=_0x0bfe('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x2fd00e,'userProfileId':_0x589ec1[_0x0bfe('0x54')]},'raw':!![]})[_0x0bfe('0x28')](function(_0x589ff2){if(_0x589ff2&&_0x589ff2['autoAssociation']===0x0){return db[_0x0bfe('0x2b')]['create']({'name':_0x356d4d[_0x0bfe('0x2e')],'resourceId':_0x356d4d['id'],'type':_0x589ff2[_0x0bfe('0x2e')],'sectionId':_0x589ff2['id']},{})[_0x0bfe('0x28')](function(){return _0x2635d0;});}else{return _0x2635d0;}})[_0x0bfe('0x48')](function(_0x4741e5){logger[_0x0bfe('0x2c')](_0x0bfe('0x56'),_0x4741e5);throw _0x4741e5;});}return _0x2635d0;});}})[_0x0bfe('0x28')](respondWithResult(_0x2779f4,0xc9))[_0x0bfe('0x48')](handleError(_0x2779f4,null));};exports[_0x0bfe('0x27')]=function(_0xddbe99,_0x1c58a9){if(_0xddbe99[_0x0bfe('0x5b')]['id']){delete _0xddbe99[_0x0bfe('0x5b')]['id'];}return db['Dashboard'][_0x0bfe('0x4d')]({'where':{'id':_0xddbe99[_0x0bfe('0x4a')]['id']}})[_0x0bfe('0x28')](handleEntityNotFound(_0x1c58a9,null))[_0x0bfe('0x28')](saveUpdates(_0xddbe99[_0x0bfe('0x5b')],null))['then'](respondWithResult(_0x1c58a9,null))['catch'](handleError(_0x1c58a9,null));};exports['destroy']=function(_0x157bf9,_0x1b61e8){return db[_0x0bfe('0x31')][_0x0bfe('0x4d')]({'where':{'id':_0x157bf9['params']['id']}})['then'](handleEntityNotFound(_0x1b61e8,null))[_0x0bfe('0x28')](removeEntity(_0x1b61e8,null))[_0x0bfe('0x48')](handleError(_0x1b61e8,null));};function widgetAttributes(_0x507953){try{switch(_0x507953['type']){case'iframe':return[{'name':_0x0bfe('0x5c'),'value':_0x507953[_0x0bfe('0x5c')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953['attrs'][0x0][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x5f')}];case _0x0bfe('0x60'):return[{'name':_0x0bfe('0x61'),'value':_0x507953[_0x0bfe('0x61')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0x0]?_0x507953[_0x0bfe('0x5d')][0x0][_0x0bfe('0x5e')]:undefined)||''}];case _0x0bfe('0x62'):return[{'name':_0x0bfe('0x63'),'value':_0x507953[_0x0bfe('0x63')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953['attrs'][0x0][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x64')},{'name':_0x0bfe('0x65'),'value':_0x507953[_0x0bfe('0x65')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1]['value']:undefined)||_0x0bfe('0x66')},{'name':_0x0bfe('0x67'),'value':_0x507953[_0x0bfe('0x67')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x2]?_0x507953[_0x0bfe('0x5d')][0x2][_0x0bfe('0x5e')]:undefined)||0xc}];case _0x0bfe('0x68'):return[{'name':'attrMetric','value':_0x507953[_0x0bfe('0x69')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953[_0x0bfe('0x5d')][0x0][_0x0bfe('0x5e')]:undefined)||'total'},{'name':_0x0bfe('0x6a'),'value':_0x507953['attrVoiceQueues']||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1][_0x0bfe('0x5e')]:undefined)||[]},{'name':'attrFontSize','value':_0x507953['attrFontSize']||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x2]?_0x507953[_0x0bfe('0x5d')][0x2][_0x0bfe('0x5e')]:undefined)||0x14},{'name':'attrChannel','value':_0x507953[_0x0bfe('0x6b')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x3]?_0x507953[_0x0bfe('0x5d')][0x3][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x6c')},{'name':_0x0bfe('0x6d'),'value':_0x507953[_0x0bfe('0x6d')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x4]?_0x507953[_0x0bfe('0x5d')][0x4][_0x0bfe('0x5e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x507953['attrFaxAccounts']||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x5]?_0x507953[_0x0bfe('0x5d')][0x5][_0x0bfe('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x507953[_0x0bfe('0x6e')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x6]?_0x507953['attrs'][0x6][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x6f'),'value':_0x507953[_0x0bfe('0x6f')]||(_0x507953['attrs']&&_0x507953['attrs'][0x7]?_0x507953['attrs'][0x7][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x70'),'value':_0x507953[_0x0bfe('0x70')]||(_0x507953['attrs']&&_0x507953['attrs'][0x8]?_0x507953[_0x0bfe('0x5d')][0x8][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x71'),'value':_0x507953[_0x0bfe('0x71')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x9]?_0x507953[_0x0bfe('0x5d')][0x9][_0x0bfe('0x5e')]:undefined)||''}];case _0x0bfe('0x72'):case _0x0bfe('0x73'):return[{'name':'attrSerie1','value':_0x507953[_0x0bfe('0x74')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953[_0x0bfe('0x5d')][0x0][_0x0bfe('0x5e')]:undefined)||_0x0bfe('0x75')},{'name':_0x0bfe('0x76'),'value':_0x507953[_0x0bfe('0x76')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1][_0x0bfe('0x5e')]:undefined)||null},{'name':_0x0bfe('0x77'),'value':_0x507953['attrSerie3']||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x2]?_0x507953['attrs'][0x2]['value']:undefined)||null},{'name':_0x0bfe('0x6a'),'value':_0x507953[_0x0bfe('0x6a')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x3]?_0x507953['attrs'][0x3][_0x0bfe('0x5e')]:undefined)||[]},{'name':'attrChannel','value':_0x507953[_0x0bfe('0x6b')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0x4]?_0x507953[_0x0bfe('0x5d')][0x4]['value']:undefined)||_0x0bfe('0x6c')},{'name':_0x0bfe('0x6d'),'value':_0x507953[_0x0bfe('0x6d')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x5]?_0x507953['attrs'][0x5][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x78'),'value':_0x507953[_0x0bfe('0x78')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0x6]?_0x507953[_0x0bfe('0x5d')][0x6][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x6e'),'value':_0x507953[_0x0bfe('0x6e')]||(_0x507953['attrs']&&_0x507953[_0x0bfe('0x5d')][0x7]?_0x507953[_0x0bfe('0x5d')][0x7]['value']:undefined)||''},{'name':_0x0bfe('0x6f'),'value':_0x507953[_0x0bfe('0x6f')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x8]?_0x507953[_0x0bfe('0x5d')][0x8][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x70'),'value':_0x507953[_0x0bfe('0x70')]||(_0x507953['attrs']&&_0x507953['attrs'][0x9]?_0x507953[_0x0bfe('0x5d')][0x9][_0x0bfe('0x5e')]:undefined)||''},{'name':_0x0bfe('0x71'),'value':_0x507953[_0x0bfe('0x71')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953['attrs'][0xa]?_0x507953['attrs'][0xa]['value']:undefined)||''}];case _0x0bfe('0x79'):return[{'name':'attrReport','type':_0x507953[_0x0bfe('0x7a')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953['attrs'][0x0][_0x0bfe('0x33')]:undefined)||null,'value':_0x507953[_0x0bfe('0x7b')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x0]?_0x507953[_0x0bfe('0x5d')][0x0]['value']:undefined)||null},{'name':_0x0bfe('0x7c'),'value':_0x507953[_0x0bfe('0x7c')]||(_0x507953[_0x0bfe('0x5d')]&&_0x507953[_0x0bfe('0x5d')][0x1]?_0x507953[_0x0bfe('0x5d')][0x1][_0x0bfe('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x4015e6){logger[_0x0bfe('0x2c')](_0x0bfe('0x7d'),JSON[_0x0bfe('0x7e')](_0x4015e6));return[];}}exports[_0x0bfe('0x7f')]=function(_0x3d1aac,_0x22c591,_0x351de1){if(_0x3d1aac[_0x0bfe('0x5b')]['id']){delete _0x3d1aac[_0x0bfe('0x5b')]['id'];}return db[_0x0bfe('0x31')][_0x0bfe('0x4d')]({'where':{'id':_0x3d1aac[_0x0bfe('0x4a')]['id']}})[_0x0bfe('0x28')](handleEntityNotFound(_0x22c591,null))[_0x0bfe('0x28')](function(_0x4941b8){if(_0x4941b8){_0x3d1aac[_0x0bfe('0x5b')][_0x0bfe('0x80')]=_0x4941b8['id'];_0x3d1aac['body'][_0x0bfe('0x5d')]=widgetAttributes(_0x3d1aac[_0x0bfe('0x5b')]);return db[_0x0bfe('0x81')]['create'](_0x3d1aac[_0x0bfe('0x5b')]);}})[_0x0bfe('0x28')](respondWithResult(_0x22c591,null))['catch'](handleError(_0x22c591,null));};exports[_0x0bfe('0x82')]=function(_0x105454,_0x2e8572,_0x322ce8){var _0x3a9a1f={};var _0xc88b64={};var _0x31683e;var _0x1b763a;return db[_0x0bfe('0x31')][_0x0bfe('0x83')]({'where':{'id':_0x105454[_0x0bfe('0x4a')]['id']}})[_0x0bfe('0x28')](handleEntityNotFound(_0x2e8572,null))[_0x0bfe('0x28')](function(_0x5da56a){if(_0x5da56a){_0x31683e=_0x5da56a;_0xc88b64['model']=_['keys'](db['DashboardItem'][_0x0bfe('0x4b')]);_0xc88b64['query']=_[_0x0bfe('0x38')](_0x105454[_0x0bfe('0x37')]);_0xc88b64[_0x0bfe('0x39')]=_[_0x0bfe('0x3a')](_0xc88b64[_0x0bfe('0x35')],_0xc88b64[_0x0bfe('0x37')]);_0x3a9a1f[_0x0bfe('0x3b')]=_['intersection'](_0xc88b64[_0x0bfe('0x35')],qs[_0x0bfe('0x3c')](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x3c')]));_0x3a9a1f['attributes']=_0x3a9a1f[_0x0bfe('0x3b')]['length']?_0x3a9a1f[_0x0bfe('0x3b')]:_0xc88b64[_0x0bfe('0x35')];_0x3a9a1f[_0x0bfe('0x84')]=qs[_0x0bfe('0x3f')](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x3f')]);_0x3a9a1f[_0x0bfe('0x40')]=qs[_0x0bfe('0x39')](_[_0x0bfe('0x85')](_0x105454[_0x0bfe('0x37')],_0xc88b64[_0x0bfe('0x39')]));if(_0x105454['query'][_0x0bfe('0x41')]){_0x3a9a1f[_0x0bfe('0x40')]=_['merge'](_0x3a9a1f['where'],{'$or':_[_0x0bfe('0x36')](_0x3a9a1f[_0x0bfe('0x3b')],function(_0x5aaa27){var _0x25a9ba={};_0x25a9ba[_0x5aaa27]={'$like':'%'+_0x105454[_0x0bfe('0x37')][_0x0bfe('0x41')]+'%'};return _0x25a9ba;})});}_0x3a9a1f=_[_0x0bfe('0x43')]({},_0x3a9a1f,_0x105454['options']);return _0x31683e['getItems'](_0x3a9a1f);}})[_0x0bfe('0x28')](function(_0x667d9c){if(_0x667d9c){_0x1b763a=_0x667d9c[_0x0bfe('0x57')];if(!_0x105454['query'][_0x0bfe('0x3d')](_0x0bfe('0x3e'))){_0x3a9a1f[_0x0bfe('0x22')]=qs['limit'](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x22')]);_0x3a9a1f[_0x0bfe('0x20')]=qs[_0x0bfe('0x20')](_0x105454[_0x0bfe('0x37')][_0x0bfe('0x20')]);}return _0x31683e[_0x0bfe('0x82')](_0x3a9a1f);}})[_0x0bfe('0x28')](function(_0x4fe857){if(_0x4fe857){return _0x4fe857?{'count':_0x1b763a,'rows':_0x4fe857}:null;}})['then'](respondWithResult(_0x2e8572,null))[_0x0bfe('0x48')](handleError(_0x2e8572,null));}; \ No newline at end of file +var _0xf21d=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','clone','createdAt','updatedAt','role','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','value','https://','custom','attrPath','attrs','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardItem','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','pick','filter','where','merge','VIRTUAL','includeAll','Dashboard','show','params','length','include','options','catch','create','body'];(function(_0x3cdf50,_0x3e8eb2){var _0x22d47a=function(_0xdc5336){while(--_0xdc5336){_0x3cdf50['push'](_0x3cdf50['shift']());}};_0x22d47a(++_0x3e8eb2);}(_0xf21d,0x1a2));var _0xdf21=function(_0x56f04e,_0x7e70c1){_0x56f04e=_0x56f04e-0x0;var _0x24e26a=_0xf21d[_0x56f04e];return _0x24e26a;};'use strict';var emlformat=require(_0xdf21('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf21('0x1'));var jsonpatch=require(_0xdf21('0x2'));var rp=require(_0xdf21('0x3'));var moment=require('moment');var BPromise=require(_0xdf21('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdf21('0x5'));var ejs=require(_0xdf21('0x6'));var fs=require('fs');var fs_extra=require(_0xdf21('0x7'));var _=require(_0xdf21('0x8'));var squel=require(_0xdf21('0x9'));var crypto=require(_0xdf21('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdf21('0xb'));var toCsv=require(_0xdf21('0x5'));var querystring=require(_0xdf21('0xc'));var Papa=require('papaparse');var Redis=require(_0xdf21('0xd'));var authService=require(_0xdf21('0xe'));var qs=require(_0xdf21('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf21('0x10'))('api');var utils=require(_0xdf21('0x11'));var config=require(_0xdf21('0x12'));var licenseUtil=require(_0xdf21('0x13'));var db=require(_0xdf21('0x14'))['db'];config[_0xdf21('0x15')]=_[_0xdf21('0x16')](config[_0xdf21('0x15')],{'host':_0xdf21('0x17'),'port':0x18eb});var socket=require(_0xdf21('0x18'))(new Redis(config[_0xdf21('0x15')]));require('./dashboard.socket')[_0xdf21('0x19')](socket);function respondWithStatusCode(_0x5b7b88,_0x55e13f){_0x55e13f=_0x55e13f||0xcc;return function(_0x3b5e17){if(_0x3b5e17){return _0x5b7b88['sendStatus'](_0x55e13f);}return _0x5b7b88[_0xdf21('0x1a')](_0x55e13f)[_0xdf21('0x1b')]();};}function respondWithResult(_0x2cd3be,_0x205c5f){_0x205c5f=_0x205c5f||0xc8;return function(_0x23733b){if(_0x23733b){return _0x2cd3be[_0xdf21('0x1a')](_0x205c5f)[_0xdf21('0x1c')](_0x23733b);}};}function respondWithFilteredResult(_0x59afb4,_0x2f1d00){return function(_0x890cd5){if(_0x890cd5){var _0x13e4cf=typeof _0x2f1d00['offset']===_0xdf21('0x1d')&&typeof _0x2f1d00[_0xdf21('0x1e')]===_0xdf21('0x1d');var _0x2e0d62=_0x890cd5[_0xdf21('0x1f')];var _0x457ed7=_0x13e4cf?0x0:_0x2f1d00[_0xdf21('0x20')];var _0x2e7c16=_0x13e4cf?_0x890cd5[_0xdf21('0x1f')]:_0x2f1d00[_0xdf21('0x20')]+_0x2f1d00[_0xdf21('0x1e')];var _0x5440c1;if(_0x2e7c16>=_0x2e0d62){_0x2e7c16=_0x2e0d62;_0x5440c1=0xc8;}else{_0x5440c1=0xce;}_0x59afb4[_0xdf21('0x1a')](_0x5440c1);return _0x59afb4[_0xdf21('0x21')](_0xdf21('0x22'),_0x457ed7+'-'+_0x2e7c16+'/'+_0x2e0d62)[_0xdf21('0x1c')](_0x890cd5);}return null;};}function patchUpdates(_0x533639){return function(_0x30d219){try{jsonpatch[_0xdf21('0x23')](_0x30d219,_0x533639,!![]);}catch(_0x131df1){return BPromise[_0xdf21('0x24')](_0x131df1);}return _0x30d219[_0xdf21('0x25')]();};}function saveUpdates(_0x4de04c,_0xe168a3){return function(_0x5cf5a7){if(_0x5cf5a7){return _0x5cf5a7[_0xdf21('0x26')](_0x4de04c)[_0xdf21('0x27')](function(_0x374b2d){return _0x374b2d;});}return null;};}function removeEntity(_0x43bb6d,_0x539f8d){return function(_0x176224){if(_0x176224){return _0x176224[_0xdf21('0x28')]()[_0xdf21('0x27')](function(){var _0x3bfca9=_0x176224['get']({'plain':!![]});var _0x5899f2=_0xdf21('0x29');return db[_0xdf21('0x2a')][_0xdf21('0x28')]({'where':{'type':_0x5899f2,'resourceId':_0x3bfca9['id']}})['then'](function(){return _0x176224;});})[_0xdf21('0x27')](function(){_0x43bb6d[_0xdf21('0x1a')](0xcc)[_0xdf21('0x1b')]();});}};}function handleEntityNotFound(_0x1851e9,_0x383392){return function(_0x193ceb){if(!_0x193ceb){_0x1851e9['sendStatus'](0x194);}return _0x193ceb;};}function handleError(_0xb27433,_0x145ede){_0x145ede=_0x145ede||0x1f4;return function(_0x534777){logger[_0xdf21('0x2b')](_0x534777['stack']);if(_0x534777[_0xdf21('0x2c')]){delete _0x534777[_0xdf21('0x2c')];}_0xb27433[_0xdf21('0x1a')](_0x145ede)[_0xdf21('0x2d')](_0x534777);};}exports['index']=function(_0x34b5b0,_0x53200c){var _0x94cdfc={},_0x49a3ab={},_0x176832={'count':0x0,'rows':[]};var _0x51493a=_[_0xdf21('0x2e')](db['Dashboard'][_0xdf21('0x2f')],function(_0x85a8c7){return{'name':_0x85a8c7[_0xdf21('0x30')],'type':_0x85a8c7[_0xdf21('0x31')][_0xdf21('0x32')]};});_0x49a3ab[_0xdf21('0x33')]=_[_0xdf21('0x2e')](_0x51493a,_0xdf21('0x2c'));_0x49a3ab[_0xdf21('0x34')]=_[_0xdf21('0x35')](_0x34b5b0['query']);_0x49a3ab[_0xdf21('0x36')]=_[_0xdf21('0x37')](_0x49a3ab[_0xdf21('0x33')],_0x49a3ab[_0xdf21('0x34')]);_0x94cdfc['attributes']=_[_0xdf21('0x37')](_0x49a3ab[_0xdf21('0x33')],qs[_0xdf21('0x38')](_0x34b5b0[_0xdf21('0x34')][_0xdf21('0x38')]));_0x94cdfc['attributes']=_0x94cdfc[_0xdf21('0x39')]['length']?_0x94cdfc[_0xdf21('0x39')]:_0x49a3ab['model'];if(!_0x34b5b0[_0xdf21('0x34')]['hasOwnProperty']('nolimit')){_0x94cdfc[_0xdf21('0x1e')]=qs[_0xdf21('0x1e')](_0x34b5b0['query'][_0xdf21('0x1e')]);_0x94cdfc[_0xdf21('0x20')]=qs[_0xdf21('0x20')](_0x34b5b0[_0xdf21('0x34')][_0xdf21('0x20')]);}_0x94cdfc['order']=qs['sort'](_0x34b5b0[_0xdf21('0x34')][_0xdf21('0x3a')]);_0x94cdfc['where']=qs[_0xdf21('0x36')](_[_0xdf21('0x3b')](_0x34b5b0['query'],_0x49a3ab[_0xdf21('0x36')]),_0x51493a);if(_0x34b5b0[_0xdf21('0x34')][_0xdf21('0x3c')]){_0x94cdfc[_0xdf21('0x3d')]=_[_0xdf21('0x3e')](_0x94cdfc[_0xdf21('0x3d')],{'$or':_[_0xdf21('0x2e')](_0x51493a,function(_0x5c5df5){if(_0x5c5df5[_0xdf21('0x31')]!==_0xdf21('0x3f')){var _0x461d6d={};_0x461d6d[_0x5c5df5[_0xdf21('0x2c')]]={'$like':'%'+_0x34b5b0[_0xdf21('0x34')][_0xdf21('0x3c')]+'%'};return _0x461d6d;}})});}_0x94cdfc=_[_0xdf21('0x3e')]({},_0x94cdfc,_0x34b5b0['options']);var _0xaa6d3b={'where':_0x94cdfc[_0xdf21('0x3d')]};return db['Dashboard']['count'](_0xaa6d3b)[_0xdf21('0x27')](function(_0x4f49cc){_0x176832['count']=_0x4f49cc;if(_0x34b5b0[_0xdf21('0x34')][_0xdf21('0x40')]){_0x94cdfc['include']=[{'all':!![]}];}return db[_0xdf21('0x41')]['findAll'](_0x94cdfc);})[_0xdf21('0x27')](function(_0x546792){_0x176832['rows']=_0x546792;return _0x176832;})[_0xdf21('0x27')](respondWithFilteredResult(_0x53200c,_0x94cdfc))['catch'](handleError(_0x53200c,null));};exports[_0xdf21('0x42')]=function(_0x524179,_0x121dd1){var _0x417740={'raw':![],'where':{'id':_0x524179[_0xdf21('0x43')]['id']}},_0x2a93f1={};_0x2a93f1['model']=_['keys'](db[_0xdf21('0x41')][_0xdf21('0x2f')]);_0x2a93f1[_0xdf21('0x34')]=_[_0xdf21('0x35')](_0x524179[_0xdf21('0x34')]);_0x2a93f1[_0xdf21('0x36')]=_[_0xdf21('0x37')](_0x2a93f1[_0xdf21('0x33')],_0x2a93f1[_0xdf21('0x34')]);_0x417740['attributes']=_[_0xdf21('0x37')](_0x2a93f1[_0xdf21('0x33')],qs[_0xdf21('0x38')](_0x524179[_0xdf21('0x34')][_0xdf21('0x38')]));_0x417740[_0xdf21('0x39')]=_0x417740[_0xdf21('0x39')][_0xdf21('0x44')]?_0x417740[_0xdf21('0x39')]:_0x2a93f1[_0xdf21('0x33')];if(_0x524179[_0xdf21('0x34')]['includeAll']){_0x417740[_0xdf21('0x45')]=[{'all':!![]}];}_0x417740=_[_0xdf21('0x3e')]({},_0x417740,_0x524179[_0xdf21('0x46')]);return db[_0xdf21('0x41')]['find'](_0x417740)[_0xdf21('0x27')](handleEntityNotFound(_0x121dd1,null))[_0xdf21('0x27')](respondWithResult(_0x121dd1,null))[_0xdf21('0x47')](handleError(_0x121dd1,null));};exports[_0xdf21('0x48')]=function(_0xb27869,_0x27d1cd){return db[_0xdf21('0x41')][_0xdf21('0x48')](_0xb27869[_0xdf21('0x49')],{})[_0xdf21('0x27')](function(_0x4de19f){var _0x5e8c75=_0xb27869['user'][_0xdf21('0x4a')]({'plain':!![]});if(!_0x5e8c75)throw new Error(_0xdf21('0x4b'));if(_0x5e8c75['role']===_0xdf21('0x4c')){var _0x215659=_0x4de19f[_0xdf21('0x4a')]({'plain':!![]});var _0x5aed03=_0xdf21('0x29');return db[_0xdf21('0x4d')]['find']({'where':{'name':_0x5aed03,'userProfileId':_0x5e8c75['userProfileId']},'raw':!![]})['then'](function(_0x2486b1){if(_0x2486b1&&_0x2486b1[_0xdf21('0x4e')]===0x0){return db[_0xdf21('0x2a')][_0xdf21('0x48')]({'name':_0x215659['name'],'resourceId':_0x215659['id'],'type':_0x2486b1[_0xdf21('0x2c')],'sectionId':_0x2486b1['id']},{})[_0xdf21('0x27')](function(){return _0x4de19f;});}else{return _0x4de19f;}})[_0xdf21('0x47')](function(_0x46484c){logger[_0xdf21('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46484c);throw _0x46484c;});}return _0x4de19f;})['then'](respondWithResult(_0x27d1cd,0xc9))[_0xdf21('0x47')](handleError(_0x27d1cd,null));};exports[_0xdf21('0x4f')]=function(_0x4b0fcb,_0x55b0c2){var _0xe5cea1={'where':{'id':_0x4b0fcb[_0xdf21('0x43')]['id']}},_0x3dc0d9={};_0x3dc0d9[_0xdf21('0x33')]=_[_0xdf21('0x35')](db[_0xdf21('0x41')][_0xdf21('0x2f')]);_0xe5cea1[_0xdf21('0x39')]=_[_0xdf21('0x37')](_0x3dc0d9['model'],qs[_0xdf21('0x38')](_0x4b0fcb[_0xdf21('0x34')][_0xdf21('0x38')]));_0xe5cea1[_0xdf21('0x39')]=_0xe5cea1[_0xdf21('0x39')][_0xdf21('0x44')]?_0xe5cea1[_0xdf21('0x39')]:_0x3dc0d9[_0xdf21('0x33')];if(_0x4b0fcb['query']['includeAll']){_0xe5cea1[_0xdf21('0x45')]=[{'all':!![]}];}_0xe5cea1=_[_0xdf21('0x3e')]({},_0xe5cea1,_0x4b0fcb[_0xdf21('0x46')]);return db[_0xdf21('0x41')]['find'](_0xe5cea1)[_0xdf21('0x27')](handleEntityNotFound(_0x55b0c2,null))[_0xdf21('0x27')](function(_0x307912){if(_0x307912){var _0x19574c=_0x307912[_0xdf21('0x4a')]({'plain':!![]});_0x19574c=qs['omit'](_0x19574c,['id',_0xdf21('0x50'),'updatedAt']);_0x4b0fcb[_0xdf21('0x49')]=_['omit'](_0x4b0fcb['body'],['id',_0xdf21('0x50'),_0xdf21('0x51')]);return db[_0xdf21('0x41')][_0xdf21('0x48')](_[_0xdf21('0x3e')](_0x19574c,_0x4b0fcb['body']),{'include':_0x4b0fcb[_0xdf21('0x34')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2a44bd){var _0xaf7ce9=_0x4b0fcb[_0xdf21('0x4c')]['get']({'plain':!![]});if(!_0xaf7ce9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaf7ce9[_0xdf21('0x52')]==='user'){var _0x2d5d61=_0x2a44bd['get']({'plain':!![]});var _0x35e04a=_0xdf21('0x29');return db[_0xdf21('0x4d')][_0xdf21('0x53')]({'where':{'name':_0x35e04a,'userProfileId':_0xaf7ce9['userProfileId']},'raw':!![]})[_0xdf21('0x27')](function(_0x26682d){if(_0x26682d&&_0x26682d[_0xdf21('0x4e')]===0x0){return db[_0xdf21('0x2a')][_0xdf21('0x48')]({'name':_0x2d5d61['name'],'resourceId':_0x2d5d61['id'],'type':_0x26682d[_0xdf21('0x2c')],'sectionId':_0x26682d['id']},{})['then'](function(){return _0x2a44bd;});}else{return _0x2a44bd;}})[_0xdf21('0x47')](function(_0x42124e){logger[_0xdf21('0x2b')](_0xdf21('0x54'),_0x42124e);throw _0x42124e;});}return _0x2a44bd;});}})[_0xdf21('0x27')](respondWithResult(_0x55b0c2,0xc9))['catch'](handleError(_0x55b0c2,null));};exports['update']=function(_0x2de205,_0x1b0bb7){if(_0x2de205[_0xdf21('0x49')]['id']){delete _0x2de205[_0xdf21('0x49')]['id'];}return db[_0xdf21('0x41')][_0xdf21('0x53')]({'where':{'id':_0x2de205[_0xdf21('0x43')]['id']}})[_0xdf21('0x27')](handleEntityNotFound(_0x1b0bb7,null))[_0xdf21('0x27')](saveUpdates(_0x2de205['body'],null))[_0xdf21('0x27')](respondWithResult(_0x1b0bb7,null))[_0xdf21('0x47')](handleError(_0x1b0bb7,null));};exports[_0xdf21('0x28')]=function(_0x1f1c02,_0x56c44d){return db[_0xdf21('0x41')][_0xdf21('0x53')]({'where':{'id':_0x1f1c02['params']['id']}})[_0xdf21('0x27')](handleEntityNotFound(_0x56c44d,null))[_0xdf21('0x27')](removeEntity(_0x56c44d,null))[_0xdf21('0x47')](handleError(_0x56c44d,null));};function widgetAttributes(_0x155be0){try{switch(_0x155be0[_0xdf21('0x31')]){case _0xdf21('0x55'):return[{'name':_0xdf21('0x56'),'value':_0x155be0[_0xdf21('0x56')]||(_0x155be0['attrs']&&_0x155be0['attrs'][0x0]?_0x155be0['attrs'][0x0][_0xdf21('0x57')]:undefined)||_0xdf21('0x58')}];case _0xdf21('0x59'):return[{'name':'attrPath','value':_0x155be0[_0xdf21('0x5a')]||(_0x155be0['attrs']&&_0x155be0[_0xdf21('0x5b')][0x0]?_0x155be0[_0xdf21('0x5b')][0x0][_0xdf21('0x57')]:undefined)||''}];case'clock':return[{'name':_0xdf21('0x5c'),'value':_0x155be0['attrHourFormat']||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x0]?_0x155be0[_0xdf21('0x5b')][0x0][_0xdf21('0x57')]:undefined)||_0xdf21('0x5d')},{'name':_0xdf21('0x5e'),'value':_0x155be0[_0xdf21('0x5e')]||(_0x155be0['attrs']&&_0x155be0[_0xdf21('0x5b')][0x1]?_0x155be0[_0xdf21('0x5b')][0x1]['value']:undefined)||_0xdf21('0x5f')},{'name':'attrFontSize','value':_0x155be0[_0xdf21('0x60')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0['attrs'][0x2]?_0x155be0[_0xdf21('0x5b')][0x2][_0xdf21('0x57')]:undefined)||0xc}];case _0xdf21('0x61'):return[{'name':_0xdf21('0x62'),'value':_0x155be0[_0xdf21('0x62')]||(_0x155be0['attrs']&&_0x155be0[_0xdf21('0x5b')][0x0]?_0x155be0[_0xdf21('0x5b')][0x0][_0xdf21('0x57')]:undefined)||_0xdf21('0x63')},{'name':_0xdf21('0x64'),'value':_0x155be0[_0xdf21('0x64')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x1]?_0x155be0[_0xdf21('0x5b')][0x1][_0xdf21('0x57')]:undefined)||[]},{'name':_0xdf21('0x60'),'value':_0x155be0['attrFontSize']||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0['attrs'][0x2]?_0x155be0[_0xdf21('0x5b')][0x2][_0xdf21('0x57')]:undefined)||0x14},{'name':_0xdf21('0x65'),'value':_0x155be0['attrChannel']||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0['attrs'][0x3]?_0x155be0[_0xdf21('0x5b')][0x3][_0xdf21('0x57')]:undefined)||_0xdf21('0x66')},{'name':_0xdf21('0x67'),'value':_0x155be0[_0xdf21('0x67')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x4]?_0x155be0[_0xdf21('0x5b')][0x4][_0xdf21('0x57')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x155be0[_0xdf21('0x68')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x5]?_0x155be0['attrs'][0x5][_0xdf21('0x57')]:undefined)||''},{'name':_0xdf21('0x69'),'value':_0x155be0[_0xdf21('0x69')]||(_0x155be0['attrs']&&_0x155be0[_0xdf21('0x5b')][0x6]?_0x155be0[_0xdf21('0x5b')][0x6][_0xdf21('0x57')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x155be0[_0xdf21('0x6a')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x7]?_0x155be0['attrs'][0x7][_0xdf21('0x57')]:undefined)||''},{'name':_0xdf21('0x6b'),'value':_0x155be0['attrWhatsappAccounts']||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0['attrs'][0x8]?_0x155be0[_0xdf21('0x5b')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x155be0[_0xdf21('0x6c')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x9]?_0x155be0[_0xdf21('0x5b')][0x9]['value']:undefined)||''}];case _0xdf21('0x6d'):case _0xdf21('0x6e'):return[{'name':_0xdf21('0x6f'),'value':_0x155be0['attrSerie1']||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x0]?_0x155be0['attrs'][0x0][_0xdf21('0x57')]:undefined)||_0xdf21('0x63')},{'name':_0xdf21('0x70'),'value':_0x155be0[_0xdf21('0x70')]||(_0x155be0['attrs']&&_0x155be0[_0xdf21('0x5b')][0x1]?_0x155be0[_0xdf21('0x5b')][0x1]['value']:undefined)||null},{'name':_0xdf21('0x71'),'value':_0x155be0['attrSerie3']||(_0x155be0['attrs']&&_0x155be0[_0xdf21('0x5b')][0x2]?_0x155be0[_0xdf21('0x5b')][0x2]['value']:undefined)||null},{'name':_0xdf21('0x64'),'value':_0x155be0[_0xdf21('0x64')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0['attrs'][0x3]?_0x155be0[_0xdf21('0x5b')][0x3][_0xdf21('0x57')]:undefined)||[]},{'name':'attrChannel','value':_0x155be0['attrChannel']||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x4]?_0x155be0['attrs'][0x4][_0xdf21('0x57')]:undefined)||_0xdf21('0x66')},{'name':_0xdf21('0x67'),'value':_0x155be0[_0xdf21('0x67')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0['attrs'][0x5]?_0x155be0['attrs'][0x5]['value']:undefined)||''},{'name':_0xdf21('0x68'),'value':_0x155be0[_0xdf21('0x68')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x6]?_0x155be0[_0xdf21('0x5b')][0x6][_0xdf21('0x57')]:undefined)||''},{'name':_0xdf21('0x69'),'value':_0x155be0[_0xdf21('0x69')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x7]?_0x155be0['attrs'][0x7][_0xdf21('0x57')]:undefined)||''},{'name':_0xdf21('0x6a'),'value':_0x155be0[_0xdf21('0x6a')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x8]?_0x155be0[_0xdf21('0x5b')][0x8][_0xdf21('0x57')]:undefined)||''},{'name':_0xdf21('0x6b'),'value':_0x155be0[_0xdf21('0x6b')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x9]?_0x155be0[_0xdf21('0x5b')][0x9][_0xdf21('0x57')]:undefined)||''},{'name':_0xdf21('0x6c'),'value':_0x155be0[_0xdf21('0x6c')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0xa]?_0x155be0[_0xdf21('0x5b')][0xa]['value']:undefined)||''}];case _0xdf21('0x72'):return[{'name':_0xdf21('0x73'),'type':_0x155be0[_0xdf21('0x74')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x0]?_0x155be0[_0xdf21('0x5b')][0x0][_0xdf21('0x31')]:undefined)||null,'value':_0x155be0[_0xdf21('0x73')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x0]?_0x155be0[_0xdf21('0x5b')][0x0][_0xdf21('0x57')]:undefined)||null},{'name':'attrRefresh','value':_0x155be0[_0xdf21('0x75')]||(_0x155be0[_0xdf21('0x5b')]&&_0x155be0[_0xdf21('0x5b')][0x1]?_0x155be0[_0xdf21('0x5b')][0x1][_0xdf21('0x57')]:undefined)||0x0}];default:return[];}}catch(_0x28b7cc){logger[_0xdf21('0x2b')]('widgetAttributes:\x20%s',JSON[_0xdf21('0x76')](_0x28b7cc));return[];}}exports[_0xdf21('0x77')]=function(_0x1f03e2,_0x42aad3,_0x179416){if(_0x1f03e2['body']['id']){delete _0x1f03e2['body']['id'];}return db[_0xdf21('0x41')][_0xdf21('0x53')]({'where':{'id':_0x1f03e2[_0xdf21('0x43')]['id']}})['then'](handleEntityNotFound(_0x42aad3,null))[_0xdf21('0x27')](function(_0x1448b8){if(_0x1448b8){_0x1f03e2[_0xdf21('0x49')]['DashboardId']=_0x1448b8['id'];_0x1f03e2['body']['attrs']=widgetAttributes(_0x1f03e2['body']);return db[_0xdf21('0x78')]['create'](_0x1f03e2[_0xdf21('0x49')]);}})[_0xdf21('0x27')](respondWithResult(_0x42aad3,null))[_0xdf21('0x47')](handleError(_0x42aad3,null));};exports['getItems']=function(_0x4fa60b,_0x50de03,_0x178233){var _0x4a786b={};var _0x23f109={};var _0x1e0ba0;var _0x32f691;return db[_0xdf21('0x41')]['findOne']({'where':{'id':_0x4fa60b['params']['id']}})[_0xdf21('0x27')](handleEntityNotFound(_0x50de03,null))[_0xdf21('0x27')](function(_0x493052){if(_0x493052){_0x1e0ba0=_0x493052;_0x23f109[_0xdf21('0x33')]=_[_0xdf21('0x35')](db['DashboardItem'][_0xdf21('0x2f')]);_0x23f109[_0xdf21('0x34')]=_[_0xdf21('0x35')](_0x4fa60b['query']);_0x23f109['filters']=_[_0xdf21('0x37')](_0x23f109[_0xdf21('0x33')],_0x23f109[_0xdf21('0x34')]);_0x4a786b[_0xdf21('0x39')]=_['intersection'](_0x23f109['model'],qs[_0xdf21('0x38')](_0x4fa60b[_0xdf21('0x34')][_0xdf21('0x38')]));_0x4a786b[_0xdf21('0x39')]=_0x4a786b[_0xdf21('0x39')][_0xdf21('0x44')]?_0x4a786b[_0xdf21('0x39')]:_0x23f109[_0xdf21('0x33')];_0x4a786b['order']=qs['sort'](_0x4fa60b['query'][_0xdf21('0x3a')]);_0x4a786b[_0xdf21('0x3d')]=qs[_0xdf21('0x36')](_[_0xdf21('0x3b')](_0x4fa60b[_0xdf21('0x34')],_0x23f109[_0xdf21('0x36')]));if(_0x4fa60b[_0xdf21('0x34')][_0xdf21('0x3c')]){_0x4a786b[_0xdf21('0x3d')]=_['merge'](_0x4a786b[_0xdf21('0x3d')],{'$or':_['map'](_0x4a786b[_0xdf21('0x39')],function(_0x4164d7){var _0x4a85d3={};_0x4a85d3[_0x4164d7]={'$like':'%'+_0x4fa60b[_0xdf21('0x34')]['filter']+'%'};return _0x4a85d3;})});}_0x4a786b=_[_0xdf21('0x3e')]({},_0x4a786b,_0x4fa60b['options']);return _0x1e0ba0['getItems'](_0x4a786b);}})['then'](function(_0x5f0659){if(_0x5f0659){_0x32f691=_0x5f0659[_0xdf21('0x44')];if(!_0x4fa60b[_0xdf21('0x34')][_0xdf21('0x79')](_0xdf21('0x7a'))){_0x4a786b[_0xdf21('0x1e')]=qs[_0xdf21('0x1e')](_0x4fa60b[_0xdf21('0x34')][_0xdf21('0x1e')]);_0x4a786b[_0xdf21('0x20')]=qs[_0xdf21('0x20')](_0x4fa60b[_0xdf21('0x34')][_0xdf21('0x20')]);}return _0x1e0ba0['getItems'](_0x4a786b);}})[_0xdf21('0x27')](function(_0x10f364){if(_0x10f364){return _0x10f364?{'count':_0x32f691,'rows':_0x10f364}:null;}})['then'](respondWithResult(_0x50de03,null))['catch'](handleError(_0x50de03,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7d3fc07..679c34b 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 _0x1cce=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x274253,_0x259430){var _0x46179a=function(_0x5869cd){while(--_0x5869cd){_0x274253['push'](_0x274253['shift']());}};_0x46179a(++_0x259430);}(_0x1cce,0x80));var _0xe1cc=function(_0x53080e,_0x252127){_0x53080e=_0x53080e-0x0;var _0x1a0c14=_0x1cce[_0x53080e];return _0x1a0c14;};'use strict';var EventEmitter=require(_0xe1cc('0x0'));var Dashboard=require(_0xe1cc('0x1'))['db'][_0xe1cc('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe1cc('0x3')](0x0);var events={'afterCreate':_0xe1cc('0x4'),'afterUpdate':_0xe1cc('0x5'),'afterDestroy':_0xe1cc('0x6')};function emitEvent(_0x5c168b){return function(_0x5720e8,_0x434241,_0x5de6a9){DashboardEvents[_0xe1cc('0x7')](_0x5c168b+':'+_0x5720e8['id'],_0x5720e8);DashboardEvents[_0xe1cc('0x7')](_0x5c168b,_0x5720e8);_0x5de6a9(null);};}for(var e in events){if(events[_0xe1cc('0x8')](e)){var event=events[e];Dashboard[_0xe1cc('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xf398=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0xf398,0x181));var _0x8f39=function(_0x5324a2,_0x55f16c){_0x5324a2=_0x5324a2-0x0;var _0x4f9892=_0xf398[_0x5324a2];return _0x4f9892;};'use strict';var EventEmitter=require(_0x8f39('0x0'));var Dashboard=require(_0x8f39('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8f39('0x2')](0x0);var events={'afterCreate':_0x8f39('0x3'),'afterUpdate':_0x8f39('0x4'),'afterDestroy':_0x8f39('0x5')};function emitEvent(_0x58d0fa){return function(_0x2c2360,_0x6337a,_0x79e024){DashboardEvents[_0x8f39('0x6')](_0x58d0fa+':'+_0x2c2360['id'],_0x2c2360);DashboardEvents[_0x8f39('0x6')](_0x58d0fa,_0x2c2360);_0x79e024(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8f39('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 18182e8..1ccbd22 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 _0x55be=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x55be,0x1ce));var _0xe55b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x55be[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe55b('0x0'));var util=require(_0xe55b('0x1'));var logger=require(_0xe55b('0x2'))('api');var moment=require(_0xe55b('0x3'));var BPromise=require(_0xe55b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe55b('0x5'));var rimraf=require(_0xe55b('0x6'));var config=require(_0xe55b('0x7'));var attributes=require(_0xe55b('0x8'));module[_0xe55b('0x9')]=function(_0x1eebac,_0x50c3eb){return _0x1eebac[_0xe55b('0xa')](_0xe55b('0xb'),attributes,{'tableName':_0xe55b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde44=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xde44,0x160));var _0x4de4=function(_0x233079,_0x333ea6){_0x233079=_0x233079-0x0;var _0x136769=_0xde44[_0x233079];return _0x136769;};'use strict';var _=require(_0x4de4('0x0'));var util=require(_0x4de4('0x1'));var logger=require(_0x4de4('0x2'))(_0x4de4('0x3'));var moment=require('moment');var BPromise=require(_0x4de4('0x4'));var rp=require(_0x4de4('0x5'));var fs=require('fs');var path=require(_0x4de4('0x6'));var rimraf=require(_0x4de4('0x7'));var config=require(_0x4de4('0x8'));var attributes=require('./dashboard.attributes');module[_0x4de4('0x9')]=function(_0x536a5b,_0x1794e1){return _0x536a5b[_0x4de4('0xa')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index c290078..36a36fd 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 _0x622f=['redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x622f,0xe9));var _0xf622=function(_0x5db810,_0x140222){_0x5db810=_0x5db810-0x0;var _0x14a975=_0x622f[_0x5db810];return _0x14a975;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf622('0x0'));var BPromise=require(_0xf622('0x1'));var rs=require(_0xf622('0x2'));var fs=require('fs');var Redis=require(_0xf622('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf622('0x4'))(_0xf622('0x5'));var config=require(_0xf622('0x6'));var jayson=require(_0xf622('0x7'));var client=jayson[_0xf622('0x8')][_0xf622('0x9')]({'port':0x232a});config[_0xf622('0xa')]=_['defaults'](config['redis'],{'host':_0xf622('0xb'),'port':0x18eb});var socket=require(_0xf622('0xc'))(new Redis(config[_0xf622('0xa')]));require(_0xf622('0xd'))[_0xf622('0xe')](socket);function respondWithRpcPromise(_0x286aef,_0x2ee4ff,_0x1ede4a){return new BPromise(function(_0x3cee86,_0x111f8a){return client[_0xf622('0xf')](_0x286aef,_0x1ede4a)[_0xf622('0x10')](function(_0x2feaab){logger[_0xf622('0x11')](_0xf622('0x12'),_0x2ee4ff,_0xf622('0x13'));logger[_0xf622('0x14')](_0xf622('0x15'),_0x2ee4ff,_0xf622('0x13'),JSON[_0xf622('0x16')](_0x2feaab));if(_0x2feaab['error']){if(_0x2feaab['error'][_0xf622('0x17')]===0x1f4){logger[_0xf622('0x18')](_0xf622('0x12'),_0x2ee4ff,_0x2feaab[_0xf622('0x18')][_0xf622('0x19')]);return _0x111f8a(_0x2feaab[_0xf622('0x18')]['message']);}logger[_0xf622('0x18')](_0xf622('0x12'),_0x2ee4ff,_0x2feaab[_0xf622('0x18')][_0xf622('0x19')]);return _0x3cee86(_0x2feaab[_0xf622('0x18')][_0xf622('0x19')]);}else{logger[_0xf622('0x11')](_0xf622('0x12'),_0x2ee4ff,'request\x20sent');_0x3cee86(_0x2feaab[_0xf622('0x1a')]['message']);}})['catch'](function(_0x20add4){logger['error'](_0xf622('0x12'),_0x2ee4ff,_0x20add4);_0x111f8a(_0x20add4);});});} \ No newline at end of file +var _0x057c=['rpc','client','http','redis','defaults','socket.io-emitter','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x4d6321,_0x13044d){var _0x185667=function(_0x556b6a){while(--_0x556b6a){_0x4d6321['push'](_0x4d6321['shift']());}};_0x185667(++_0x13044d);}(_0x057c,0xd2));var _0xc057=function(_0x5d55eb,_0x761a8e){_0x5d55eb=_0x5d55eb-0x0;var _0x3e6204=_0x057c[_0x5d55eb];return _0x3e6204;};'use strict';var _=require(_0xc057('0x0'));var util=require(_0xc057('0x1'));var moment=require(_0xc057('0x2'));var BPromise=require(_0xc057('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc057('0x4'));var logger=require(_0xc057('0x5'))(_0xc057('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc057('0x7')][_0xc057('0x8')]({'port':0x232a});config[_0xc057('0x9')]=_[_0xc057('0xa')](config[_0xc057('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc057('0xb'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x346457,_0x171885,_0x2fc8db){return new BPromise(function(_0x3fb9d0,_0x3c8266){return client[_0xc057('0xc')](_0x346457,_0x2fc8db)[_0xc057('0xd')](function(_0x5b9ef0){logger[_0xc057('0xe')]('Dashboard,\x20%s,\x20%s',_0x171885,'request\x20sent');logger[_0xc057('0xf')](_0xc057('0x10'),_0x171885,_0xc057('0x11'),JSON[_0xc057('0x12')](_0x5b9ef0));if(_0x5b9ef0[_0xc057('0x13')]){if(_0x5b9ef0[_0xc057('0x13')][_0xc057('0x14')]===0x1f4){logger[_0xc057('0x13')](_0xc057('0x15'),_0x171885,_0x5b9ef0['error'][_0xc057('0x16')]);return _0x3c8266(_0x5b9ef0[_0xc057('0x13')][_0xc057('0x16')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x171885,_0x5b9ef0[_0xc057('0x13')]['message']);return _0x3fb9d0(_0x5b9ef0[_0xc057('0x13')][_0xc057('0x16')]);}else{logger[_0xc057('0xe')](_0xc057('0x15'),_0x171885,'request\x20sent');_0x3fb9d0(_0x5b9ef0[_0xc057('0x17')][_0xc057('0x16')]);}})['catch'](function(_0x3548a2){logger[_0xc057('0x13')](_0xc057('0x15'),_0x171885,_0x3548a2);_0x3c8266(_0x3548a2);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 9ad13fb..2e70697 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 _0x3450=['update','emit','removeListener','register','dashboard:','./dashboard.events','remove'];(function(_0xfe56d3,_0x12ea3d){var _0x22b265=function(_0x41786b){while(--_0x41786b){_0xfe56d3['push'](_0xfe56d3['shift']());}};_0x22b265(++_0x12ea3d);}(_0x3450,0x75));var _0x0345=function(_0x458848,_0x2dcecd){_0x458848=_0x458848-0x0;var _0x20469e=_0x3450[_0x458848];return _0x20469e;};'use strict';var DashboardEvents=require(_0x0345('0x0'));var events=['save',_0x0345('0x1'),_0x0345('0x2')];function createListener(_0x416cbd,_0x168395){return function(_0x513f9f){_0x168395[_0x0345('0x3')](_0x416cbd,_0x513f9f);};}function removeListener(_0x239110,_0x43d3d8){return function(){DashboardEvents[_0x0345('0x4')](_0x239110,_0x43d3d8);};}exports[_0x0345('0x5')]=function(_0xdfe6ce){for(var _0x4dca6f=0x0,_0xb7a5fb=events['length'];_0x4dca6f<_0xb7a5fb;_0x4dca6f++){var _0xa25973=events[_0x4dca6f];var _0x1b2d7b=createListener(_0x0345('0x6')+_0xa25973,_0xdfe6ce);DashboardEvents['on'](_0xa25973,_0x1b2d7b);}}; \ No newline at end of file +var _0x528c=['length','dashboard:','./dashboard.events','update','emit','removeListener','register'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x528c,0x1ec));var _0xc528=function(_0x21a190,_0x191132){_0x21a190=_0x21a190-0x0;var _0x2424a0=_0x528c[_0x21a190];return _0x2424a0;};'use strict';var DashboardEvents=require(_0xc528('0x0'));var events=['save','remove',_0xc528('0x1')];function createListener(_0x150aff,_0x391888){return function(_0xd24197){_0x391888[_0xc528('0x2')](_0x150aff,_0xd24197);};}function removeListener(_0x51c42f,_0xf8f324){return function(){DashboardEvents[_0xc528('0x3')](_0x51c42f,_0xf8f324);};}exports[_0xc528('0x4')]=function(_0x239e6e){for(var _0x1478ad=0x0,_0x2ba5d0=events[_0xc528('0x5')];_0x1478ad<_0x2ba5d0;_0x1478ad++){var _0x31f563=events[_0x1478ad];var _0x134823=createListener(_0xc528('0x6')+_0x31f563,_0x239e6e);DashboardEvents['on'](_0x31f563,_0x134823);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 397e68c..5efdbd7 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 _0xede9=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','multer','util','path','express'];(function(_0x3bd89a,_0x35056d){var _0x37c2e9=function(_0x3d2af2){while(--_0x3d2af2){_0x3bd89a['push'](_0x3bd89a['shift']());}};_0x37c2e9(++_0x35056d);}(_0xede9,0x92));var _0x9ede=function(_0x74708,_0x258c50){_0x74708=_0x74708-0x0;var _0x18b05d=_0xede9[_0x74708];return _0x18b05d;};'use strict';var multer=require(_0x9ede('0x0'));var util=require(_0x9ede('0x1'));var path=require(_0x9ede('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ede('0x3'));var router=express[_0x9ede('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ede('0x5'));var interaction=require(_0x9ede('0x6'));var config=require(_0x9ede('0x7'));var controller=require(_0x9ede('0x8'));router[_0x9ede('0x9')]('/',auth[_0x9ede('0xa')](),controller[_0x9ede('0xb')]);router[_0x9ede('0x9')](_0x9ede('0xc'),auth[_0x9ede('0xa')](),controller[_0x9ede('0xd')]);router[_0x9ede('0x9')]('/:id/items',auth[_0x9ede('0xa')](),controller[_0x9ede('0xe')]);router[_0x9ede('0xf')]('/',auth[_0x9ede('0xa')](),controller[_0x9ede('0x10')]);router[_0x9ede('0xf')](_0x9ede('0x11'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x12')]);router['post'](_0x9ede('0x13'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x14')]);router[_0x9ede('0x15')](_0x9ede('0xc'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x16')]);router[_0x9ede('0x17')](_0x9ede('0xc'),auth[_0x9ede('0xa')](),controller[_0x9ede('0x18')]);module['exports']=router; \ No newline at end of file +var _0x7111=['/:id/items','post','create','/:id/clone','addItem','put','/:id','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x4730d7,_0x1f68ea){var _0x4ef008=function(_0x183127){while(--_0x183127){_0x4730d7['push'](_0x4730d7['shift']());}};_0x4ef008(++_0x1f68ea);}(_0x7111,0x198));var _0x1711=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x7111[_0x4ed4d2];return _0x15ae2e;};'use strict';var multer=require('multer');var util=require(_0x1711('0x0'));var path=require(_0x1711('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1711('0x2')]();var fs_extra=require(_0x1711('0x3'));var auth=require(_0x1711('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1711('0x5'));var controller=require('./dashboard.controller');router[_0x1711('0x6')]('/',auth[_0x1711('0x7')](),controller[_0x1711('0x8')]);router[_0x1711('0x6')]('/:id',auth[_0x1711('0x7')](),controller[_0x1711('0x9')]);router['get'](_0x1711('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x1711('0xb')]('/',auth['isAuthenticated'](),controller[_0x1711('0xc')]);router['post'](_0x1711('0xd'),auth['isAuthenticated'](),controller['clone']);router[_0x1711('0xb')](_0x1711('0xa'),auth[_0x1711('0x7')](),controller[_0x1711('0xe')]);router[_0x1711('0xf')](_0x1711('0x10'),auth[_0x1711('0x7')](),controller['update']);router['delete'](_0x1711('0x10'),auth['isAuthenticated'](),controller[_0x1711('0x11')]);module[_0x1711('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 90e85d6..65decd7 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 _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x33de54,_0x5434b9){var _0x18fe1f=function(_0x3fe66c){while(--_0x3fe66c){_0x33de54['push'](_0x33de54['shift']());}};_0x18fe1f(++_0x5434b9);}(_0xeda8,0x104));var _0x8eda=function(_0x32a970,_0x9f2d36){_0x32a970=_0x32a970-0x0;var _0x2a1c89=_0xeda8[_0x32a970];return _0x2a1c89;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xacf4=['lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER','#2196f3'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xacf4,0xe7));var _0x4acf=function(_0xb905fe,_0x123c76){_0xb905fe=_0xb905fe-0x0;var _0x497fb4=_0xacf4[_0xb905fe];return _0x497fb4;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x4acf('0x0'));module[_0x4acf('0x1')]={'title':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4acf('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4acf('0x3')](_0x4acf('0x4')),'get':function(){try{return JSON[_0x4acf('0x5')](this['getDataValue'](_0x4acf('0x6')));}catch(_0x2124c8){return[];}},'set':function(_0x4e0c43){try{this[_0x4acf('0x7')](_0x4acf('0x6'),JSON[_0x4acf('0x8')](_0x4e0c43));}catch(_0x45a5a4){this[_0x4acf('0x7')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x4acf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4acf('0x9')]},'col':{'type':Sequelize[_0x4acf('0x9')]},'background':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4acf('0x2')],'allowNull':![],'defaultValue':_0x4acf('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize['INTEGER'],'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 fe20ddd..f26edc7 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 _0x4f0d=['reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','DashboardItem','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','body','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0x4f0d[_0x423549];return _0xdcb104;};'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('request-promise');var moment=require(_0xd4f0('0x0'));var BPromise=require(_0xd4f0('0x1'));var Mustache=require(_0xd4f0('0x2'));var util=require('util');var path=require(_0xd4f0('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd4f0('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4f0('0x5'));var squel=require(_0xd4f0('0x6'));var crypto=require('crypto');var jsforce=require(_0xd4f0('0x7'));var deskjs=require(_0xd4f0('0x8'));var toCsv=require(_0xd4f0('0x9'));var querystring=require(_0xd4f0('0xa'));var Papa=require(_0xd4f0('0xb'));var Redis=require('ioredis');var authService=require(_0xd4f0('0xc'));var qs=require(_0xd4f0('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4f0('0xe'))(_0xd4f0('0xf'));var utils=require('../../config/utils');var config=require(_0xd4f0('0x10'));var licenseUtil=require(_0xd4f0('0x11'));var db=require(_0xd4f0('0x12'))['db'];config[_0xd4f0('0x13')]=_[_0xd4f0('0x14')](config['redis'],{'host':_0xd4f0('0x15'),'port':0x18eb});var socket=require(_0xd4f0('0x16'))(new Redis(config[_0xd4f0('0x13')]));require(_0xd4f0('0x17'))[_0xd4f0('0x18')](socket);function respondWithStatusCode(_0x544936,_0x100cd4){_0x100cd4=_0x100cd4||0xcc;return function(_0x386f84){if(_0x386f84){return _0x544936[_0xd4f0('0x19')](_0x100cd4);}return _0x544936[_0xd4f0('0x1a')](_0x100cd4)[_0xd4f0('0x1b')]();};}function respondWithResult(_0x2dd02d,_0x4f8e76){_0x4f8e76=_0x4f8e76||0xc8;return function(_0x5adf8a){if(_0x5adf8a){return _0x2dd02d[_0xd4f0('0x1a')](_0x4f8e76)[_0xd4f0('0x1c')](_0x5adf8a);}};}function respondWithFilteredResult(_0xff90e,_0x7b2ca4){return function(_0x4d0dcc){if(_0x4d0dcc){var _0x5bf265=typeof _0x7b2ca4[_0xd4f0('0x1d')]===_0xd4f0('0x1e')&&typeof _0x7b2ca4[_0xd4f0('0x1f')]===_0xd4f0('0x1e');var _0x7560d6=_0x4d0dcc[_0xd4f0('0x20')];var _0x57d418=_0x5bf265?0x0:_0x7b2ca4[_0xd4f0('0x1d')];var _0x2f0b79=_0x5bf265?_0x4d0dcc[_0xd4f0('0x20')]:_0x7b2ca4['offset']+_0x7b2ca4[_0xd4f0('0x1f')];var _0x474c22;if(_0x2f0b79>=_0x7560d6){_0x2f0b79=_0x7560d6;_0x474c22=0xc8;}else{_0x474c22=0xce;}_0xff90e[_0xd4f0('0x1a')](_0x474c22);return _0xff90e['set'](_0xd4f0('0x21'),_0x57d418+'-'+_0x2f0b79+'/'+_0x7560d6)[_0xd4f0('0x1c')](_0x4d0dcc);}return null;};}function patchUpdates(_0x655480){return function(_0x5b94bb){try{jsonpatch[_0xd4f0('0x22')](_0x5b94bb,_0x655480,!![]);}catch(_0x174e52){return BPromise[_0xd4f0('0x23')](_0x174e52);}return _0x5b94bb[_0xd4f0('0x24')]();};}function saveUpdates(_0x4fd650,_0x1552e9){return function(_0x3345c6){if(_0x3345c6){return _0x3345c6[_0xd4f0('0x25')](_0x4fd650)[_0xd4f0('0x26')](function(_0x5f4858){return _0x5f4858;});}return null;};}function removeEntity(_0x37e8a1,_0x49b94b){return function(_0x15e310){if(_0x15e310){return _0x15e310[_0xd4f0('0x27')]()[_0xd4f0('0x26')](function(){_0x37e8a1[_0xd4f0('0x1a')](0xcc)[_0xd4f0('0x1b')]();});}};}function handleEntityNotFound(_0x2f4291,_0x1dd584){return function(_0xe25e57){if(!_0xe25e57){_0x2f4291[_0xd4f0('0x19')](0x194);}return _0xe25e57;};}function handleError(_0x2c1f4f,_0xe2bf28){_0xe2bf28=_0xe2bf28||0x1f4;return function(_0x4ea8aa){logger[_0xd4f0('0x28')](_0x4ea8aa[_0xd4f0('0x29')]);if(_0x4ea8aa[_0xd4f0('0x2a')]){delete _0x4ea8aa[_0xd4f0('0x2a')];}_0x2c1f4f['status'](_0xe2bf28)[_0xd4f0('0x2b')](_0x4ea8aa);};}exports[_0xd4f0('0x2c')]=function(_0x401a5b,_0x40da73){var _0x4b8244={'raw':![],'where':{'id':_0x401a5b[_0xd4f0('0x2d')]['id']}},_0x39c44a={};_0x39c44a[_0xd4f0('0x2e')]=_[_0xd4f0('0x2f')](db['DashboardItem'][_0xd4f0('0x30')]);_0x39c44a[_0xd4f0('0x31')]=_[_0xd4f0('0x2f')](_0x401a5b[_0xd4f0('0x31')]);_0x39c44a[_0xd4f0('0x32')]=_[_0xd4f0('0x33')](_0x39c44a[_0xd4f0('0x2e')],_0x39c44a[_0xd4f0('0x31')]);_0x4b8244[_0xd4f0('0x34')]=_[_0xd4f0('0x33')](_0x39c44a[_0xd4f0('0x2e')],qs['fields'](_0x401a5b[_0xd4f0('0x31')][_0xd4f0('0x35')]));_0x4b8244[_0xd4f0('0x34')]=_0x4b8244[_0xd4f0('0x34')][_0xd4f0('0x36')]?_0x4b8244['attributes']:_0x39c44a[_0xd4f0('0x2e')];if(_0x401a5b[_0xd4f0('0x31')]['includeAll']){_0x4b8244[_0xd4f0('0x37')]=[{'all':!![]}];}_0x4b8244=_[_0xd4f0('0x38')]({},_0x4b8244,_0x401a5b[_0xd4f0('0x39')]);return db['DashboardItem'][_0xd4f0('0x3a')](_0x4b8244)['then'](handleEntityNotFound(_0x40da73,null))['then'](respondWithResult(_0x40da73,null))['catch'](handleError(_0x40da73,null));};exports[_0xd4f0('0x27')]=function(_0x33c1ea,_0x23283b){return db[_0xd4f0('0x3b')][_0xd4f0('0x3a')]({'where':{'id':_0x33c1ea['params']['id']}})['then'](handleEntityNotFound(_0x23283b,null))[_0xd4f0('0x26')](removeEntity(_0x23283b,null))[_0xd4f0('0x3c')](handleError(_0x23283b,null));};function widgetAttributes(_0x386ec3){try{switch(_0x386ec3['type']){case _0xd4f0('0x3d'):return[{'name':_0xd4f0('0x3e'),'value':_0x386ec3[_0xd4f0('0x3e')]||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x41')}];case _0xd4f0('0x42'):return[{'name':_0xd4f0('0x43'),'value':_0x386ec3[_0xd4f0('0x43')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x44'):return[{'name':'attrHourFormat','value':_0x386ec3[_0xd4f0('0x45')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x46')},{'name':'attrTimezone','value':_0x386ec3[_0xd4f0('0x47')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x48')},{'name':'attrFontSize','value':_0x386ec3[_0xd4f0('0x49')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x2]?_0x386ec3['attrs'][0x2][_0xd4f0('0x40')]:undefined)||0xc}];case _0xd4f0('0x4a'):return[{'name':_0xd4f0('0x4b'),'value':_0x386ec3['attrMetric']||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x4c')},{'name':_0xd4f0('0x4d'),'value':_0x386ec3[_0xd4f0('0x4d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||[]},{'name':_0xd4f0('0x49'),'value':_0x386ec3[_0xd4f0('0x49')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x2]?_0x386ec3[_0xd4f0('0x3f')][0x2]['value']:undefined)||0x14},{'name':_0xd4f0('0x4e'),'value':_0x386ec3['attrChannel']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x3]?_0x386ec3[_0xd4f0('0x3f')][0x3]['value']:undefined)||_0xd4f0('0x4f')},{'name':_0xd4f0('0x50'),'value':_0x386ec3['attrEmailAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x4]?_0x386ec3[_0xd4f0('0x3f')][0x4][_0xd4f0('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x386ec3[_0xd4f0('0x51')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x5]?_0x386ec3[_0xd4f0('0x3f')][0x5][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x52'),'value':_0x386ec3[_0xd4f0('0x52')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x6]?_0x386ec3[_0xd4f0('0x3f')][0x6][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x53'),'value':_0x386ec3['attrOpenchannelAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x7]?_0x386ec3[_0xd4f0('0x3f')][0x7][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x54'),'value':_0x386ec3['attrWhatsappAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x8]?_0x386ec3[_0xd4f0('0x3f')][0x8][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x55'),'value':_0x386ec3[_0xd4f0('0x55')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x9]?_0x386ec3[_0xd4f0('0x3f')][0x9][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x56'):case _0xd4f0('0x57'):return[{'name':_0xd4f0('0x58'),'value':_0x386ec3[_0xd4f0('0x58')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0]['value']:undefined)||_0xd4f0('0x4c')},{'name':_0xd4f0('0x59'),'value':_0x386ec3[_0xd4f0('0x59')]||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1]['value']:undefined)||null},{'name':_0xd4f0('0x5a'),'value':_0x386ec3[_0xd4f0('0x5a')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x2]?_0x386ec3['attrs'][0x2][_0xd4f0('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x386ec3[_0xd4f0('0x4d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x3]?_0x386ec3[_0xd4f0('0x3f')][0x3][_0xd4f0('0x40')]:undefined)||[]},{'name':'attrChannel','value':_0x386ec3['attrChannel']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x4]?_0x386ec3[_0xd4f0('0x3f')][0x4][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x4f')},{'name':_0xd4f0('0x50'),'value':_0x386ec3[_0xd4f0('0x50')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x5]?_0x386ec3['attrs'][0x5][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x51'),'value':_0x386ec3['attrFaxAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x6]?_0x386ec3[_0xd4f0('0x3f')][0x6][_0xd4f0('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x386ec3['attrSmsAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x7]?_0x386ec3['attrs'][0x7]['value']:undefined)||''},{'name':_0xd4f0('0x53'),'value':_0x386ec3[_0xd4f0('0x53')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x8]?_0x386ec3[_0xd4f0('0x3f')][0x8][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x54'),'value':_0x386ec3[_0xd4f0('0x54')]||(_0x386ec3['attrs']&&_0x386ec3['attrs'][0x9]?_0x386ec3[_0xd4f0('0x3f')][0x9]['value']:undefined)||''},{'name':_0xd4f0('0x55'),'value':_0x386ec3['attrChatWebsites']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0xa]?_0x386ec3['attrs'][0xa][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x5b'):return[{'name':_0xd4f0('0x5c'),'type':_0x386ec3[_0xd4f0('0x5d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0]['type']:undefined)||null,'value':_0x386ec3['attrReport']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x386ec3[_0xd4f0('0x5e')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x3d4979){logger[_0xd4f0('0x28')]('widgetAttributes:\x20%s',JSON[_0xd4f0('0x5f')](_0x3d4979));return[];}}exports['create']=function(_0x1c0afe,_0x41da67){if(_0x1c0afe[_0xd4f0('0x60')]){_0x1c0afe[_0xd4f0('0x60')][_0xd4f0('0x3f')]=widgetAttributes(_0x1c0afe['body']);}return db[_0xd4f0('0x3b')]['create'](_0x1c0afe[_0xd4f0('0x60')],{})[_0xd4f0('0x26')](respondWithResult(_0x41da67,0xc9))['catch'](handleError(_0x41da67,null));};exports[_0xd4f0('0x25')]=function(_0x45427c,_0x5e330c){if(_0x45427c[_0xd4f0('0x60')]['id']){delete _0x45427c[_0xd4f0('0x60')]['id'];}_0x45427c[_0xd4f0('0x60')][_0xd4f0('0x3f')]=widgetAttributes(_0x45427c[_0xd4f0('0x60')]);return db[_0xd4f0('0x3b')]['find']({'where':{'id':_0x45427c[_0xd4f0('0x2d')]['id']}})[_0xd4f0('0x26')](handleEntityNotFound(_0x5e330c,null))[_0xd4f0('0x26')](saveUpdates(_0x45427c['body'],null))[_0xd4f0('0x26')](respondWithResult(_0x5e330c,null))[_0xd4f0('0x3c')](handleError(_0x5e330c,null));}; \ No newline at end of file +var _0x6144=['DashboardItem','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','keys'];(function(_0x44ba64,_0x2c16ca){var _0xf05c45=function(_0x2d5f62){while(--_0x2d5f62){_0x44ba64['push'](_0x44ba64['shift']());}};_0xf05c45(++_0x2c16ca);}(_0x6144,0x99));var _0x4614=function(_0x56a6ee,_0x4a7e3c){_0x56a6ee=_0x56a6ee-0x0;var _0x55edf9=_0x6144[_0x56a6ee];return _0x55edf9;};'use strict';var emlformat=require(_0x4614('0x0'));var rimraf=require(_0x4614('0x1'));var zipdir=require(_0x4614('0x2'));var jsonpatch=require(_0x4614('0x3'));var rp=require('request-promise');var moment=require(_0x4614('0x4'));var BPromise=require(_0x4614('0x5'));var Mustache=require(_0x4614('0x6'));var util=require(_0x4614('0x7'));var path=require('path');var sox=require(_0x4614('0x8'));var csv=require(_0x4614('0x9'));var ejs=require(_0x4614('0xa'));var fs=require('fs');var fs_extra=require(_0x4614('0xb'));var _=require(_0x4614('0xc'));var squel=require('squel');var crypto=require(_0x4614('0xd'));var jsforce=require(_0x4614('0xe'));var deskjs=require(_0x4614('0xf'));var toCsv=require(_0x4614('0x9'));var querystring=require('querystring');var Papa=require(_0x4614('0x10'));var Redis=require(_0x4614('0x11'));var authService=require(_0x4614('0x12'));var qs=require(_0x4614('0x13'));var as=require(_0x4614('0x14'));var hardwareService=require(_0x4614('0x15'));var logger=require(_0x4614('0x16'))('api');var utils=require(_0x4614('0x17'));var config=require(_0x4614('0x18'));var licenseUtil=require(_0x4614('0x19'));var db=require(_0x4614('0x1a'))['db'];config['redis']=_['defaults'](config[_0x4614('0x1b')],{'host':_0x4614('0x1c'),'port':0x18eb});var socket=require(_0x4614('0x1d'))(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x33beae,_0x19683b){_0x19683b=_0x19683b||0xcc;return function(_0x4fa635){if(_0x4fa635){return _0x33beae[_0x4614('0x1e')](_0x19683b);}return _0x33beae[_0x4614('0x1f')](_0x19683b)[_0x4614('0x20')]();};}function respondWithResult(_0x4d5801,_0x4503e3){_0x4503e3=_0x4503e3||0xc8;return function(_0x300237){if(_0x300237){return _0x4d5801[_0x4614('0x1f')](_0x4503e3)[_0x4614('0x21')](_0x300237);}};}function respondWithFilteredResult(_0x353295,_0x2ba4a2){return function(_0x5d10fc){if(_0x5d10fc){var _0x29f526=typeof _0x2ba4a2[_0x4614('0x22')]==='undefined'&&typeof _0x2ba4a2[_0x4614('0x23')]===_0x4614('0x24');var _0x27de9=_0x5d10fc['count'];var _0x52ec09=_0x29f526?0x0:_0x2ba4a2[_0x4614('0x22')];var _0x16f9db=_0x29f526?_0x5d10fc[_0x4614('0x25')]:_0x2ba4a2['offset']+_0x2ba4a2[_0x4614('0x23')];var _0x5c0f26;if(_0x16f9db>=_0x27de9){_0x16f9db=_0x27de9;_0x5c0f26=0xc8;}else{_0x5c0f26=0xce;}_0x353295['status'](_0x5c0f26);return _0x353295[_0x4614('0x26')](_0x4614('0x27'),_0x52ec09+'-'+_0x16f9db+'/'+_0x27de9)[_0x4614('0x21')](_0x5d10fc);}return null;};}function patchUpdates(_0x55e73e){return function(_0x319ceb){try{jsonpatch[_0x4614('0x28')](_0x319ceb,_0x55e73e,!![]);}catch(_0x35038b){return BPromise['reject'](_0x35038b);}return _0x319ceb[_0x4614('0x29')]();};}function saveUpdates(_0x261120,_0x4ed541){return function(_0x46f5c5){if(_0x46f5c5){return _0x46f5c5[_0x4614('0x2a')](_0x261120)[_0x4614('0x2b')](function(_0x51edf0){return _0x51edf0;});}return null;};}function removeEntity(_0x3a0e22,_0x488736){return function(_0x3347be){if(_0x3347be){return _0x3347be[_0x4614('0x2c')]()[_0x4614('0x2b')](function(){_0x3a0e22[_0x4614('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x122b50,_0x1b909c){return function(_0x48bf58){if(!_0x48bf58){_0x122b50['sendStatus'](0x194);}return _0x48bf58;};}function handleError(_0x17783c,_0x41592f){_0x41592f=_0x41592f||0x1f4;return function(_0x1526a7){logger['error'](_0x1526a7[_0x4614('0x2d')]);if(_0x1526a7[_0x4614('0x2e')]){delete _0x1526a7[_0x4614('0x2e')];}_0x17783c[_0x4614('0x1f')](_0x41592f)[_0x4614('0x2f')](_0x1526a7);};}exports[_0x4614('0x30')]=function(_0x439102,_0xce27a8){var _0x1bbe82={'raw':![],'where':{'id':_0x439102[_0x4614('0x31')]['id']}},_0x1a0f26={};_0x1a0f26['model']=_[_0x4614('0x32')](db[_0x4614('0x33')][_0x4614('0x34')]);_0x1a0f26[_0x4614('0x35')]=_['keys'](_0x439102[_0x4614('0x35')]);_0x1a0f26['filters']=_[_0x4614('0x36')](_0x1a0f26[_0x4614('0x37')],_0x1a0f26[_0x4614('0x35')]);_0x1bbe82[_0x4614('0x38')]=_['intersection'](_0x1a0f26[_0x4614('0x37')],qs[_0x4614('0x39')](_0x439102[_0x4614('0x35')]['fields']));_0x1bbe82['attributes']=_0x1bbe82[_0x4614('0x38')][_0x4614('0x3a')]?_0x1bbe82['attributes']:_0x1a0f26[_0x4614('0x37')];if(_0x439102['query'][_0x4614('0x3b')]){_0x1bbe82[_0x4614('0x3c')]=[{'all':!![]}];}_0x1bbe82=_[_0x4614('0x3d')]({},_0x1bbe82,_0x439102[_0x4614('0x3e')]);return db[_0x4614('0x33')]['find'](_0x1bbe82)['then'](handleEntityNotFound(_0xce27a8,null))[_0x4614('0x2b')](respondWithResult(_0xce27a8,null))['catch'](handleError(_0xce27a8,null));};exports['destroy']=function(_0xdc8b0e,_0x10f8b8){return db['DashboardItem'][_0x4614('0x3f')]({'where':{'id':_0xdc8b0e[_0x4614('0x31')]['id']}})[_0x4614('0x2b')](handleEntityNotFound(_0x10f8b8,null))[_0x4614('0x2b')](removeEntity(_0x10f8b8,null))[_0x4614('0x40')](handleError(_0x10f8b8,null));};function widgetAttributes(_0x11668d){try{switch(_0x11668d[_0x4614('0x41')]){case _0x4614('0x42'):return[{'name':_0x4614('0x43'),'value':_0x11668d[_0x4614('0x43')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x0]?_0x11668d[_0x4614('0x44')][0x0][_0x4614('0x45')]:undefined)||'https://'}];case _0x4614('0x46'):return[{'name':_0x4614('0x47'),'value':_0x11668d[_0x4614('0x47')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x0]?_0x11668d['attrs'][0x0][_0x4614('0x45')]:undefined)||''}];case'clock':return[{'name':_0x4614('0x48'),'value':_0x11668d[_0x4614('0x48')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x0]?_0x11668d[_0x4614('0x44')][0x0][_0x4614('0x45')]:undefined)||_0x4614('0x49')},{'name':'attrTimezone','value':_0x11668d[_0x4614('0x4a')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x1]?_0x11668d['attrs'][0x1][_0x4614('0x45')]:undefined)||_0x4614('0x4b')},{'name':'attrFontSize','value':_0x11668d[_0x4614('0x4c')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x2]?_0x11668d['attrs'][0x2]['value']:undefined)||0xc}];case _0x4614('0x4d'):return[{'name':_0x4614('0x4e'),'value':_0x11668d[_0x4614('0x4e')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x0]?_0x11668d[_0x4614('0x44')][0x0]['value']:undefined)||_0x4614('0x4f')},{'name':_0x4614('0x50'),'value':_0x11668d[_0x4614('0x50')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x1]?_0x11668d[_0x4614('0x44')][0x1]['value']:undefined)||[]},{'name':_0x4614('0x4c'),'value':_0x11668d[_0x4614('0x4c')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x2]?_0x11668d[_0x4614('0x44')][0x2][_0x4614('0x45')]:undefined)||0x14},{'name':_0x4614('0x51'),'value':_0x11668d[_0x4614('0x51')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d['attrs'][0x3]?_0x11668d[_0x4614('0x44')][0x3]['value']:undefined)||_0x4614('0x52')},{'name':_0x4614('0x53'),'value':_0x11668d[_0x4614('0x53')]||(_0x11668d['attrs']&&_0x11668d['attrs'][0x4]?_0x11668d[_0x4614('0x44')][0x4][_0x4614('0x45')]:undefined)||''},{'name':_0x4614('0x54'),'value':_0x11668d[_0x4614('0x54')]||(_0x11668d['attrs']&&_0x11668d['attrs'][0x5]?_0x11668d['attrs'][0x5][_0x4614('0x45')]:undefined)||''},{'name':_0x4614('0x55'),'value':_0x11668d[_0x4614('0x55')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x6]?_0x11668d[_0x4614('0x44')][0x6][_0x4614('0x45')]:undefined)||''},{'name':_0x4614('0x56'),'value':_0x11668d[_0x4614('0x56')]||(_0x11668d['attrs']&&_0x11668d['attrs'][0x7]?_0x11668d[_0x4614('0x44')][0x7][_0x4614('0x45')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x11668d[_0x4614('0x57')]||(_0x11668d['attrs']&&_0x11668d[_0x4614('0x44')][0x8]?_0x11668d[_0x4614('0x44')][0x8][_0x4614('0x45')]:undefined)||''},{'name':_0x4614('0x58'),'value':_0x11668d['attrChatWebsites']||(_0x11668d['attrs']&&_0x11668d[_0x4614('0x44')][0x9]?_0x11668d[_0x4614('0x44')][0x9]['value']:undefined)||''}];case _0x4614('0x59'):case _0x4614('0x5a'):return[{'name':_0x4614('0x5b'),'value':_0x11668d[_0x4614('0x5b')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x0]?_0x11668d['attrs'][0x0][_0x4614('0x45')]:undefined)||_0x4614('0x4f')},{'name':_0x4614('0x5c'),'value':_0x11668d[_0x4614('0x5c')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x1]?_0x11668d[_0x4614('0x44')][0x1][_0x4614('0x45')]:undefined)||null},{'name':_0x4614('0x5d'),'value':_0x11668d[_0x4614('0x5d')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x2]?_0x11668d[_0x4614('0x44')][0x2][_0x4614('0x45')]:undefined)||null},{'name':_0x4614('0x50'),'value':_0x11668d[_0x4614('0x50')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x3]?_0x11668d['attrs'][0x3][_0x4614('0x45')]:undefined)||[]},{'name':_0x4614('0x51'),'value':_0x11668d[_0x4614('0x51')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x4]?_0x11668d[_0x4614('0x44')][0x4][_0x4614('0x45')]:undefined)||_0x4614('0x52')},{'name':'attrEmailAccounts','value':_0x11668d[_0x4614('0x53')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d['attrs'][0x5]?_0x11668d[_0x4614('0x44')][0x5][_0x4614('0x45')]:undefined)||''},{'name':_0x4614('0x54'),'value':_0x11668d['attrFaxAccounts']||(_0x11668d[_0x4614('0x44')]&&_0x11668d['attrs'][0x6]?_0x11668d[_0x4614('0x44')][0x6][_0x4614('0x45')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x11668d[_0x4614('0x55')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x7]?_0x11668d[_0x4614('0x44')][0x7][_0x4614('0x45')]:undefined)||''},{'name':_0x4614('0x56'),'value':_0x11668d[_0x4614('0x56')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x8]?_0x11668d[_0x4614('0x44')][0x8][_0x4614('0x45')]:undefined)||''},{'name':_0x4614('0x57'),'value':_0x11668d['attrWhatsappAccounts']||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x9]?_0x11668d[_0x4614('0x44')][0x9][_0x4614('0x45')]:undefined)||''},{'name':'attrChatWebsites','value':_0x11668d[_0x4614('0x58')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d['attrs'][0xa]?_0x11668d[_0x4614('0x44')][0xa][_0x4614('0x45')]:undefined)||''}];case _0x4614('0x5e'):return[{'name':_0x4614('0x5f'),'type':_0x11668d[_0x4614('0x60')]||(_0x11668d['attrs']&&_0x11668d['attrs'][0x0]?_0x11668d[_0x4614('0x44')][0x0][_0x4614('0x41')]:undefined)||null,'value':_0x11668d[_0x4614('0x5f')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x0]?_0x11668d[_0x4614('0x44')][0x0]['value']:undefined)||null},{'name':_0x4614('0x61'),'value':_0x11668d[_0x4614('0x61')]||(_0x11668d[_0x4614('0x44')]&&_0x11668d[_0x4614('0x44')][0x1]?_0x11668d[_0x4614('0x44')][0x1][_0x4614('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x15521a){logger[_0x4614('0x62')]('widgetAttributes:\x20%s',JSON[_0x4614('0x63')](_0x15521a));return[];}}exports[_0x4614('0x64')]=function(_0x5c858e,_0x56212c){if(_0x5c858e['body']){_0x5c858e[_0x4614('0x65')]['attrs']=widgetAttributes(_0x5c858e[_0x4614('0x65')]);}return db['DashboardItem'][_0x4614('0x64')](_0x5c858e[_0x4614('0x65')],{})[_0x4614('0x2b')](respondWithResult(_0x56212c,0xc9))[_0x4614('0x40')](handleError(_0x56212c,null));};exports[_0x4614('0x2a')]=function(_0x250792,_0x14789e){if(_0x250792[_0x4614('0x65')]['id']){delete _0x250792[_0x4614('0x65')]['id'];}_0x250792['body'][_0x4614('0x44')]=widgetAttributes(_0x250792[_0x4614('0x65')]);return db[_0x4614('0x33')][_0x4614('0x3f')]({'where':{'id':_0x250792['params']['id']}})['then'](handleEntityNotFound(_0x14789e,null))['then'](saveUpdates(_0x250792[_0x4614('0x65')],null))['then'](respondWithResult(_0x14789e,null))[_0x4614('0x40')](handleError(_0x14789e,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 80baf09..d469ad6 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 _0xa363=['update','remove','hook','exports','events','setMaxListeners','save'];(function(_0x2568e6,_0x11db36){var _0x22d5eb=function(_0x2eede4){while(--_0x2eede4){_0x2568e6['push'](_0x2568e6['shift']());}};_0x22d5eb(++_0x11db36);}(_0xa363,0x1af));var _0x3a36=function(_0x5719d4,_0x10ebb3){_0x5719d4=_0x5719d4-0x0;var _0x128cc9=_0xa363[_0x5719d4];return _0x128cc9;};'use strict';var EventEmitter=require(_0x3a36('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3a36('0x1')](0x0);var events={'afterCreate':_0x3a36('0x2'),'afterUpdate':_0x3a36('0x3'),'afterDestroy':_0x3a36('0x4')};function emitEvent(_0x287be1){return function(_0x128058,_0x500641,_0x898ae7){DashboardItemEvents['emit'](_0x287be1+':'+_0x128058['id'],_0x128058);DashboardItemEvents['emit'](_0x287be1,_0x128058);_0x898ae7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x3a36('0x5')](e,emitEvent(event));}}module[_0x3a36('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xe112=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x242f87,_0x5d3876){var _0x6f8ed9=function(_0x5796a0){while(--_0x5796a0){_0x242f87['push'](_0x242f87['shift']());}};_0x6f8ed9(++_0x5d3876);}(_0xe112,0x1f4));var _0x2e11=function(_0x1ecc12,_0x13ae9d){_0x1ecc12=_0x1ecc12-0x0;var _0x3976ba=_0xe112[_0x1ecc12];return _0x3976ba;};'use strict';var EventEmitter=require(_0x2e11('0x0'));var DashboardItem=require(_0x2e11('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2e11('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e11('0x3'),'afterDestroy':_0x2e11('0x4')};function emitEvent(_0x25beae){return function(_0x49aef9,_0x51aed4,_0x335487){DashboardItemEvents[_0x2e11('0x5')](_0x25beae+':'+_0x49aef9['id'],_0x49aef9);DashboardItemEvents[_0x2e11('0x5')](_0x25beae,_0x49aef9);_0x335487(null);};}for(var e in events){if(events[_0x2e11('0x6')](e)){var event=events[e];DashboardItem[_0x2e11('0x7')](e,emitEvent(event));}}module[_0x2e11('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 3af7bd1..c98e6af 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 _0xab1e=['dashboard_items','api','moment','bluebird','request-promise','path','./dashboardItem.attributes','define'];(function(_0x21d691,_0x114a69){var _0x5b6fe6=function(_0x141727){while(--_0x141727){_0x21d691['push'](_0x21d691['shift']());}};_0x5b6fe6(++_0x114a69);}(_0xab1e,0x81));var _0xeab1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xab1e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xeab1('0x0'));var moment=require(_0xeab1('0x1'));var BPromise=require(_0xeab1('0x2'));var rp=require(_0xeab1('0x3'));var fs=require('fs');var path=require(_0xeab1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeab1('0x5'));module['exports']=function(_0x34cab1,_0x4c6daf){return _0x34cab1[_0xeab1('0x6')]('DashboardItem',attributes,{'tableName':_0xeab1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ddc=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird'];(function(_0x348eda,_0x2515dc){var _0x402b5e=function(_0x3cd955){while(--_0x3cd955){_0x348eda['push'](_0x348eda['shift']());}};_0x402b5e(++_0x2515dc);}(_0x5ddc,0x13d));var _0xc5dd=function(_0xd21181,_0x17444d){_0xd21181=_0xd21181-0x0;var _0xbf0e69=_0x5ddc[_0xd21181];return _0xbf0e69;};'use strict';var _=require('lodash');var util=require(_0xc5dd('0x0'));var logger=require(_0xc5dd('0x1'))(_0xc5dd('0x2'));var moment=require(_0xc5dd('0x3'));var BPromise=require(_0xc5dd('0x4'));var rp=require(_0xc5dd('0x5'));var fs=require('fs');var path=require(_0xc5dd('0x6'));var rimraf=require(_0xc5dd('0x7'));var config=require(_0xc5dd('0x8'));var attributes=require(_0xc5dd('0x9'));module[_0xc5dd('0xa')]=function(_0x3d64a8,_0x2bfe44){return _0x3d64a8[_0xc5dd('0xb')](_0xc5dd('0xc'),attributes,{'tableName':_0xc5dd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index f5e7f6b..eafff64 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 _0xf338=['stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xf338,0x109));var _0x8f33=function(_0x36f688,_0x136a34){_0x36f688=_0x36f688-0x0;var _0x5483e4=_0xf338[_0x36f688];return _0x5483e4;};'use strict';var _=require(_0x8f33('0x0'));var util=require(_0x8f33('0x1'));var moment=require(_0x8f33('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f33('0x3'));var fs=require('fs');var Redis=require(_0x8f33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f33('0x5'));var logger=require(_0x8f33('0x6'))(_0x8f33('0x7'));var config=require(_0x8f33('0x8'));var jayson=require(_0x8f33('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x8f33('0xa')]=_['defaults'](config['redis'],{'host':_0x8f33('0xb'),'port':0x18eb});var socket=require(_0x8f33('0xc'))(new Redis(config[_0x8f33('0xa')]));require(_0x8f33('0xd'))[_0x8f33('0xe')](socket);function respondWithRpcPromise(_0x564d5b,_0x59d014,_0xf1aa61){return new BPromise(function(_0x213efc,_0x2d5722){return client[_0x8f33('0xf')](_0x564d5b,_0xf1aa61)[_0x8f33('0x10')](function(_0x2f9f30){logger[_0x8f33('0x11')](_0x8f33('0x12'),_0x59d014,_0x8f33('0x13'));logger[_0x8f33('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x59d014,_0x8f33('0x13'),JSON[_0x8f33('0x15')](_0x2f9f30));if(_0x2f9f30[_0x8f33('0x16')]){if(_0x2f9f30[_0x8f33('0x16')][_0x8f33('0x17')]===0x1f4){logger[_0x8f33('0x16')]('DashboardItem,\x20%s,\x20%s',_0x59d014,_0x2f9f30[_0x8f33('0x16')]['message']);return _0x2d5722(_0x2f9f30[_0x8f33('0x16')][_0x8f33('0x18')]);}logger[_0x8f33('0x16')](_0x8f33('0x12'),_0x59d014,_0x2f9f30[_0x8f33('0x16')]['message']);return _0x213efc(_0x2f9f30[_0x8f33('0x16')][_0x8f33('0x18')]);}else{logger[_0x8f33('0x11')](_0x8f33('0x12'),_0x59d014,'request\x20sent');_0x213efc(_0x2f9f30[_0x8f33('0x19')][_0x8f33('0x18')]);}})['catch'](function(_0x386be8){logger[_0x8f33('0x16')](_0x8f33('0x12'),_0x59d014,_0x386be8);_0x2d5722(_0x386be8);});});} \ No newline at end of file +var _0x1733=['register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0x1733,0x9f));var _0x3173=function(_0x40d7f8,_0x457196){_0x40d7f8=_0x40d7f8-0x0;var _0x1ce34a=_0x1733[_0x40d7f8];return _0x1ce34a;};'use strict';var _=require('lodash');var util=require(_0x3173('0x0'));var moment=require(_0x3173('0x1'));var BPromise=require(_0x3173('0x2'));var rs=require(_0x3173('0x3'));var fs=require('fs');var Redis=require(_0x3173('0x4'));var db=require(_0x3173('0x5'))['db'];var utils=require(_0x3173('0x6'));var logger=require('../../config/logger')(_0x3173('0x7'));var config=require(_0x3173('0x8'));var jayson=require(_0x3173('0x9'));var client=jayson[_0x3173('0xa')][_0x3173('0xb')]({'port':0x232a});config[_0x3173('0xc')]=_['defaults'](config[_0x3173('0xc')],{'host':_0x3173('0xd'),'port':0x18eb});var socket=require(_0x3173('0xe'))(new Redis(config[_0x3173('0xc')]));require('./dashboardItem.socket')[_0x3173('0xf')](socket);function respondWithRpcPromise(_0x3e4dca,_0x488784,_0x491fb8){return new BPromise(function(_0x5643ef,_0x3cba98){return client[_0x3173('0x10')](_0x3e4dca,_0x491fb8)[_0x3173('0x11')](function(_0x45fb75){logger[_0x3173('0x12')](_0x3173('0x13'),_0x488784,'request\x20sent');logger[_0x3173('0x14')](_0x3173('0x15'),_0x488784,_0x3173('0x16'),JSON[_0x3173('0x17')](_0x45fb75));if(_0x45fb75[_0x3173('0x18')]){if(_0x45fb75[_0x3173('0x18')][_0x3173('0x19')]===0x1f4){logger['error'](_0x3173('0x13'),_0x488784,_0x45fb75['error']['message']);return _0x3cba98(_0x45fb75[_0x3173('0x18')][_0x3173('0x1a')]);}logger[_0x3173('0x18')]('DashboardItem,\x20%s,\x20%s',_0x488784,_0x45fb75[_0x3173('0x18')][_0x3173('0x1a')]);return _0x5643ef(_0x45fb75['error']['message']);}else{logger[_0x3173('0x12')]('DashboardItem,\x20%s,\x20%s',_0x488784,_0x3173('0x16'));_0x5643ef(_0x45fb75[_0x3173('0x1b')]['message']);}})[_0x3173('0x1c')](function(_0x265ce6){logger[_0x3173('0x18')](_0x3173('0x13'),_0x488784,_0x265ce6);_0x3cba98(_0x265ce6);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 2c4feb7..db7d2ea 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 _0x176b=['save','remove','update','emit','removeListener','register','dashboardItem:','./dashboardItem.events'];(function(_0x48fddb,_0x37a2d3){var _0x22dad1=function(_0x4d32d6){while(--_0x4d32d6){_0x48fddb['push'](_0x48fddb['shift']());}};_0x22dad1(++_0x37a2d3);}(_0x176b,0xe7));var _0xb176=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0x176b[_0x5e07a7];return _0x22ced5;};'use strict';var DashboardItemEvents=require(_0xb176('0x0'));var events=[_0xb176('0x1'),_0xb176('0x2'),_0xb176('0x3')];function createListener(_0x5e26da,_0x2fa66c){return function(_0x4cc6bb){_0x2fa66c[_0xb176('0x4')](_0x5e26da,_0x4cc6bb);};}function removeListener(_0x441fc1,_0x5dfdf7){return function(){DashboardItemEvents[_0xb176('0x5')](_0x441fc1,_0x5dfdf7);};}exports[_0xb176('0x6')]=function(_0x4060ef){for(var _0x22cbb9=0x0,_0x2aece9=events['length'];_0x22cbb9<_0x2aece9;_0x22cbb9++){var _0xfe7733=events[_0x22cbb9];var _0x1285c0=createListener(_0xb176('0x7')+_0xfe7733,_0x4060ef);DashboardItemEvents['on'](_0xfe7733,_0x1285c0);}}; \ No newline at end of file +var _0x0ac5=['./dashboardItem.events','save','remove','update','removeListener','register','length','dashboardItem:'];(function(_0x1ddba4,_0x4dedc4){var _0x3a9ddf=function(_0x12cf6d){while(--_0x12cf6d){_0x1ddba4['push'](_0x1ddba4['shift']());}};_0x3a9ddf(++_0x4dedc4);}(_0x0ac5,0x80));var _0x50ac=function(_0x2c729e,_0x54c02e){_0x2c729e=_0x2c729e-0x0;var _0x48b575=_0x0ac5[_0x2c729e];return _0x48b575;};'use strict';var DashboardItemEvents=require(_0x50ac('0x0'));var events=[_0x50ac('0x1'),_0x50ac('0x2'),_0x50ac('0x3')];function createListener(_0x9eabc8,_0x2a634e){return function(_0x42121b){_0x2a634e['emit'](_0x9eabc8,_0x42121b);};}function removeListener(_0x410bf4,_0x216f18){return function(){DashboardItemEvents[_0x50ac('0x4')](_0x410bf4,_0x216f18);};}exports[_0x50ac('0x5')]=function(_0x4ec571){for(var _0x2cf6fc=0x0,_0x1baca4=events[_0x50ac('0x6')];_0x2cf6fc<_0x1baca4;_0x2cf6fc++){var _0x4e0f70=events[_0x2cf6fc];var _0x317161=createListener(_0x50ac('0x7')+_0x4e0f70,_0x4ec571);DashboardItemEvents['on'](_0x4e0f70,_0x317161);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 7ba42fb..81c75d1 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 _0x5659=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','put','update','delete','util','path'];(function(_0x3988c6,_0x18fb1d){var _0x12633a=function(_0x4a64cd){while(--_0x4a64cd){_0x3988c6['push'](_0x3988c6['shift']());}};_0x12633a(++_0x18fb1d);}(_0x5659,0x1da));var _0x9565=function(_0x276f6d,_0x10a50e){_0x276f6d=_0x276f6d-0x0;var _0xda31b5=_0x5659[_0x276f6d];return _0xda31b5;};'use strict';var multer=require('multer');var util=require(_0x9565('0x0'));var path=require(_0x9565('0x1'));var timeout=require(_0x9565('0x2'));var express=require(_0x9565('0x3'));var router=express[_0x9565('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9565('0x5'));var config=require(_0x9565('0x6'));var controller=require(_0x9565('0x7'));router['get'](_0x9565('0x8'),auth[_0x9565('0x9')](),controller['show']);router[_0x9565('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9565('0xb')](_0x9565('0x8'),auth[_0x9565('0x9')](),controller[_0x9565('0xc')]);router[_0x9565('0xd')](_0x9565('0x8'),auth[_0x9565('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8216=['fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xcca3e4,_0xeb08c0){var _0x10da4c=function(_0x3d2928){while(--_0x3d2928){_0xcca3e4['push'](_0xcca3e4['shift']());}};_0x10da4c(++_0xeb08c0);}(_0x8216,0x6c));var _0x6821=function(_0x656c4c,_0x2ff3b2){_0x656c4c=_0x656c4c-0x0;var _0xbaeb91=_0x8216[_0x656c4c];return _0xbaeb91;};'use strict';var multer=require(_0x6821('0x0'));var util=require(_0x6821('0x1'));var path=require(_0x6821('0x2'));var timeout=require(_0x6821('0x3'));var express=require(_0x6821('0x4'));var router=express[_0x6821('0x5')]();var fs_extra=require(_0x6821('0x6'));var auth=require(_0x6821('0x7'));var interaction=require(_0x6821('0x8'));var config=require('../../config/environment');var controller=require(_0x6821('0x9'));router[_0x6821('0xa')](_0x6821('0xb'),auth[_0x6821('0xc')](),controller[_0x6821('0xd')]);router[_0x6821('0xe')]('/',auth[_0x6821('0xc')](),controller[_0x6821('0xf')]);router[_0x6821('0x10')](_0x6821('0xb'),auth['isAuthenticated'](),controller[_0x6821('0x11')]);router['delete'](_0x6821('0xb'),auth['isAuthenticated'](),controller[_0x6821('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 58411e7..53db733 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 _0x078f=['ENUM','first','second','third','sequelize','exports','STRING'];(function(_0x4ed5d7,_0x1a61a8){var _0x9a927c=function(_0x6b6e9a){while(--_0x6b6e9a){_0x4ed5d7['push'](_0x4ed5d7['shift']());}};_0x9a927c(++_0x1a61a8);}(_0x078f,0xc1));var _0xf078=function(_0x39d2de,_0x25dcb6){_0x39d2de=_0x39d2de-0x0;var _0x211d52=_0x078f[_0x39d2de];return _0x211d52;};'use strict';var Sequelize=require(_0xf078('0x0'));module[_0xf078('0x1')]={'name':{'type':Sequelize[_0xf078('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x4'),_0xf078('0x5'),_0xf078('0x6')),'allowNull':![],'defaultValue':_0xf078('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef52=['exports','STRING','second','first'];(function(_0x18d494,_0x13f3e8){var _0x2b42e2=function(_0x3e983b){while(--_0x3e983b){_0x18d494['push'](_0x18d494['shift']());}};_0x2b42e2(++_0x13f3e8);}(_0xef52,0x78));var _0x2ef5=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0xef52[_0x2a7b8e];return _0x29b5c8;};'use strict';var Sequelize=require('sequelize');module[_0x2ef5('0x0')]={'name':{'type':Sequelize[_0x2ef5('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x2ef5('0x2'),'third'),'allowNull':![],'defaultValue':_0x2ef5('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 571c1e8..aca822f 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 _0xf446=['then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update'];(function(_0x1e5abc,_0x48f83a){var _0x3cfab7=function(_0x3ca178){while(--_0x3ca178){_0x1e5abc['push'](_0x1e5abc['shift']());}};_0x3cfab7(++_0x48f83a);}(_0xf446,0x1c0));var _0x6f44=function(_0x141e5b,_0x44b460){_0x141e5b=_0x141e5b-0x0;var _0x1ce0ee=_0xf446[_0x141e5b];return _0x1ce0ee;};'use strict';var emlformat=require(_0x6f44('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f44('0x1'));var jsonpatch=require(_0x6f44('0x2'));var rp=require('request-promise');var moment=require(_0x6f44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6f44('0x4'));var util=require(_0x6f44('0x5'));var path=require('path');var sox=require(_0x6f44('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f44('0x7'));var squel=require('squel');var crypto=require(_0x6f44('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f44('0x9'));var querystring=require('querystring');var Papa=require(_0x6f44('0xa'));var Redis=require(_0x6f44('0xb'));var authService=require(_0x6f44('0xc'));var qs=require(_0x6f44('0xd'));var as=require(_0x6f44('0xe'));var hardwareService=require(_0x6f44('0xf'));var logger=require(_0x6f44('0x10'))(_0x6f44('0x11'));var utils=require('../../config/utils');var config=require(_0x6f44('0x12'));var licenseUtil=require(_0x6f44('0x13'));var db=require(_0x6f44('0x14'))['db'];function respondWithStatusCode(_0x4bacc0,_0x305757){_0x305757=_0x305757||0xcc;return function(_0x381112){if(_0x381112){return _0x4bacc0[_0x6f44('0x15')](_0x305757);}return _0x4bacc0[_0x6f44('0x16')](_0x305757)['end']();};}function respondWithResult(_0x82c009,_0x4f1b19){_0x4f1b19=_0x4f1b19||0xc8;return function(_0x310dec){if(_0x310dec){return _0x82c009['status'](_0x4f1b19)['json'](_0x310dec);}};}function respondWithFilteredResult(_0x33e088,_0xe5c968){return function(_0x33a130){if(_0x33a130){var _0x22200e=typeof _0xe5c968[_0x6f44('0x17')]===_0x6f44('0x18')&&typeof _0xe5c968[_0x6f44('0x19')]===_0x6f44('0x18');var _0x16021b=_0x33a130[_0x6f44('0x1a')];var _0x27062e=_0x22200e?0x0:_0xe5c968['offset'];var _0x11b488=_0x22200e?_0x33a130[_0x6f44('0x1a')]:_0xe5c968[_0x6f44('0x17')]+_0xe5c968[_0x6f44('0x19')];var _0x46c693;if(_0x11b488>=_0x16021b){_0x11b488=_0x16021b;_0x46c693=0xc8;}else{_0x46c693=0xce;}_0x33e088['status'](_0x46c693);return _0x33e088[_0x6f44('0x1b')]('Content-Range',_0x27062e+'-'+_0x11b488+'/'+_0x16021b)[_0x6f44('0x1c')](_0x33a130);}return null;};}function patchUpdates(_0x57d6a2){return function(_0x3c1265){try{jsonpatch['apply'](_0x3c1265,_0x57d6a2,!![]);}catch(_0x415cce){return BPromise[_0x6f44('0x1d')](_0x415cce);}return _0x3c1265[_0x6f44('0x1e')]();};}function saveUpdates(_0xf1a57c,_0x1137db){return function(_0x1418e1){if(_0x1418e1){return _0x1418e1[_0x6f44('0x1f')](_0xf1a57c)[_0x6f44('0x20')](function(_0x3e121e){return _0x3e121e;});}return null;};}function removeEntity(_0x50bbad,_0x56cbea){return function(_0x3583c7){if(_0x3583c7){return _0x3583c7[_0x6f44('0x21')]()[_0x6f44('0x20')](function(){var _0x3cdc68=_0x3583c7[_0x6f44('0x22')]({'plain':!![]});var _0x2681a9='Dispositions';return db[_0x6f44('0x23')][_0x6f44('0x21')]({'where':{'type':_0x2681a9,'resourceId':_0x3cdc68['id']}})['then'](function(){return _0x3583c7;});})['then'](function(){_0x50bbad[_0x6f44('0x16')](0xcc)[_0x6f44('0x24')]();});}};}function handleEntityNotFound(_0x2a8d41,_0x3773dd){return function(_0xe22f1e){if(!_0xe22f1e){_0x2a8d41[_0x6f44('0x15')](0x194);}return _0xe22f1e;};}function handleError(_0x4c994b,_0x2de691){_0x2de691=_0x2de691||0x1f4;return function(_0x47feea){logger[_0x6f44('0x25')](_0x47feea[_0x6f44('0x26')]);if(_0x47feea[_0x6f44('0x27')]){delete _0x47feea['name'];}_0x4c994b[_0x6f44('0x16')](_0x2de691)[_0x6f44('0x28')](_0x47feea);};}exports[_0x6f44('0x29')]=function(_0x5d9b58,_0x5e7651){var _0x1d8a0e={},_0x2fb85f={},_0x21ef32={'count':0x0,'rows':[]};var _0x5b1562=_[_0x6f44('0x2a')](db[_0x6f44('0x2b')][_0x6f44('0x2c')],function(_0x417ec8){return{'name':_0x417ec8[_0x6f44('0x2d')],'type':_0x417ec8[_0x6f44('0x2e')][_0x6f44('0x2f')]};});_0x2fb85f[_0x6f44('0x30')]=_[_0x6f44('0x2a')](_0x5b1562,_0x6f44('0x27'));_0x2fb85f[_0x6f44('0x31')]=_[_0x6f44('0x32')](_0x5d9b58['query']);_0x2fb85f['filters']=_[_0x6f44('0x33')](_0x2fb85f[_0x6f44('0x30')],_0x2fb85f[_0x6f44('0x31')]);_0x1d8a0e['attributes']=_[_0x6f44('0x33')](_0x2fb85f[_0x6f44('0x30')],qs[_0x6f44('0x34')](_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x34')]));_0x1d8a0e[_0x6f44('0x35')]=_0x1d8a0e[_0x6f44('0x35')][_0x6f44('0x36')]?_0x1d8a0e[_0x6f44('0x35')]:_0x2fb85f['model'];if(!_0x5d9b58[_0x6f44('0x31')]['hasOwnProperty']('nolimit')){_0x1d8a0e['limit']=qs[_0x6f44('0x19')](_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x19')]);_0x1d8a0e[_0x6f44('0x17')]=qs[_0x6f44('0x17')](_0x5d9b58['query'][_0x6f44('0x17')]);}_0x1d8a0e[_0x6f44('0x37')]=qs[_0x6f44('0x38')](_0x5d9b58['query'][_0x6f44('0x38')]);_0x1d8a0e[_0x6f44('0x39')]=qs[_0x6f44('0x3a')](_[_0x6f44('0x3b')](_0x5d9b58[_0x6f44('0x31')],_0x2fb85f['filters']),_0x5b1562);if(_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x3c')]){_0x1d8a0e[_0x6f44('0x39')]=_['merge'](_0x1d8a0e['where'],{'$or':_['map'](_0x5b1562,function(_0x3d3b96){if(_0x3d3b96['type']!==_0x6f44('0x3d')){var _0x580f15={};_0x580f15[_0x3d3b96[_0x6f44('0x27')]]={'$like':'%'+_0x5d9b58[_0x6f44('0x31')][_0x6f44('0x3c')]+'%'};return _0x580f15;}})});}_0x1d8a0e=_[_0x6f44('0x3e')]({},_0x1d8a0e,_0x5d9b58[_0x6f44('0x3f')]);var _0x1227c3={'where':_0x1d8a0e['where']};return db[_0x6f44('0x2b')][_0x6f44('0x1a')](_0x1227c3)[_0x6f44('0x20')](function(_0x297999){_0x21ef32[_0x6f44('0x1a')]=_0x297999;if(_0x5d9b58['query'][_0x6f44('0x40')]){_0x1d8a0e[_0x6f44('0x41')]=[{'all':!![]}];}return db[_0x6f44('0x2b')][_0x6f44('0x42')](_0x1d8a0e);})[_0x6f44('0x20')](function(_0x3d1162){_0x21ef32[_0x6f44('0x43')]=_0x3d1162;return _0x21ef32;})[_0x6f44('0x20')](respondWithFilteredResult(_0x5e7651,_0x1d8a0e))[_0x6f44('0x44')](handleError(_0x5e7651,null));};exports['show']=function(_0x241beb,_0x50f3ae){var _0x1b763a={'raw':!![],'where':{'id':_0x241beb[_0x6f44('0x45')]['id']}},_0x37ec2d={};_0x37ec2d[_0x6f44('0x30')]=_['keys'](db[_0x6f44('0x2b')][_0x6f44('0x2c')]);_0x37ec2d['query']=_[_0x6f44('0x32')](_0x241beb[_0x6f44('0x31')]);_0x37ec2d[_0x6f44('0x3a')]=_[_0x6f44('0x33')](_0x37ec2d[_0x6f44('0x30')],_0x37ec2d[_0x6f44('0x31')]);_0x1b763a[_0x6f44('0x35')]=_[_0x6f44('0x33')](_0x37ec2d['model'],qs[_0x6f44('0x34')](_0x241beb[_0x6f44('0x31')]['fields']));_0x1b763a[_0x6f44('0x35')]=_0x1b763a['attributes']['length']?_0x1b763a['attributes']:_0x37ec2d[_0x6f44('0x30')];if(_0x241beb['query']['includeAll']){_0x1b763a[_0x6f44('0x41')]=[{'all':!![]}];}_0x1b763a=_[_0x6f44('0x3e')]({},_0x1b763a,_0x241beb[_0x6f44('0x3f')]);return db[_0x6f44('0x2b')][_0x6f44('0x46')](_0x1b763a)['then'](handleEntityNotFound(_0x50f3ae,null))[_0x6f44('0x20')](respondWithResult(_0x50f3ae,null))[_0x6f44('0x44')](handleError(_0x50f3ae,null));};exports[_0x6f44('0x47')]=function(_0x35668c,_0x1fe022){return db['Disposition'][_0x6f44('0x47')](_0x35668c[_0x6f44('0x48')],{})[_0x6f44('0x20')](function(_0x2087f7){var _0x45c6df=_0x35668c['user']['get']({'plain':!![]});if(!_0x45c6df)throw new Error(_0x6f44('0x49'));if(_0x45c6df['role']===_0x6f44('0x4a')){var _0x55bda4=_0x2087f7['get']({'plain':!![]});var _0x39cc92=_0x6f44('0x4b');return db[_0x6f44('0x4c')][_0x6f44('0x46')]({'where':{'name':_0x39cc92,'userProfileId':_0x45c6df[_0x6f44('0x4d')]},'raw':!![]})['then'](function(_0x2f188f){if(_0x2f188f&&_0x2f188f[_0x6f44('0x4e')]===0x0){return db[_0x6f44('0x23')][_0x6f44('0x47')]({'name':_0x55bda4['name'],'resourceId':_0x55bda4['id'],'type':_0x2f188f[_0x6f44('0x27')],'sectionId':_0x2f188f['id']},{})[_0x6f44('0x20')](function(){return _0x2087f7;});}else{return _0x2087f7;}})[_0x6f44('0x44')](function(_0x170fb3){logger[_0x6f44('0x25')](_0x6f44('0x4f'),_0x170fb3);throw _0x170fb3;});}return _0x2087f7;})[_0x6f44('0x20')](respondWithResult(_0x1fe022,0xc9))[_0x6f44('0x44')](handleError(_0x1fe022,null));};exports['update']=function(_0x14c5bc,_0x5a5d79){if(_0x14c5bc[_0x6f44('0x48')]['id']){delete _0x14c5bc[_0x6f44('0x48')]['id'];}return db['Disposition'][_0x6f44('0x46')]({'where':{'id':_0x14c5bc[_0x6f44('0x45')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x5a5d79,null))[_0x6f44('0x20')](saveUpdates(_0x14c5bc['body'],null))['then'](respondWithResult(_0x5a5d79,null))[_0x6f44('0x44')](handleError(_0x5a5d79,null));};exports[_0x6f44('0x21')]=function(_0x86ef2d,_0x34925f){return db[_0x6f44('0x2b')][_0x6f44('0x46')]({'where':{'id':_0x86ef2d[_0x6f44('0x45')]['id']}})[_0x6f44('0x20')](handleEntityNotFound(_0x34925f,null))[_0x6f44('0x20')](removeEntity(_0x34925f,null))['catch'](handleError(_0x34925f,null));}; \ No newline at end of file +var _0xd4f0=['status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','map','Disposition','type','key','model','keys','query','filters','attributes','fields','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','catch','rawAttributes','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus'];(function(_0xba2b15,_0x561ebb){var _0x55d073=function(_0x1cd022){while(--_0x1cd022){_0xba2b15['push'](_0xba2b15['shift']());}};_0x55d073(++_0x561ebb);}(_0xd4f0,0x122));var _0x0d4f=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0xd4f0[_0x3eb630];return _0x1b840d;};'use strict';var emlformat=require(_0x0d4f('0x0'));var rimraf=require(_0x0d4f('0x1'));var zipdir=require(_0x0d4f('0x2'));var jsonpatch=require(_0x0d4f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d4f('0x4'));var util=require(_0x0d4f('0x5'));var path=require(_0x0d4f('0x6'));var sox=require(_0x0d4f('0x7'));var csv=require(_0x0d4f('0x8'));var ejs=require(_0x0d4f('0x9'));var fs=require('fs');var fs_extra=require(_0x0d4f('0xa'));var _=require(_0x0d4f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0d4f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0d4f('0xd'));var Papa=require(_0x0d4f('0xe'));var Redis=require(_0x0d4f('0xf'));var authService=require(_0x0d4f('0x10'));var qs=require(_0x0d4f('0x11'));var as=require(_0x0d4f('0x12'));var hardwareService=require(_0x0d4f('0x13'));var logger=require(_0x0d4f('0x14'))(_0x0d4f('0x15'));var utils=require(_0x0d4f('0x16'));var config=require(_0x0d4f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d4f('0x18'))['db'];function respondWithStatusCode(_0x2ab9a0,_0x184f43){_0x184f43=_0x184f43||0xcc;return function(_0x566141){if(_0x566141){return _0x2ab9a0[_0x0d4f('0x19')](_0x184f43);}return _0x2ab9a0[_0x0d4f('0x1a')](_0x184f43)[_0x0d4f('0x1b')]();};}function respondWithResult(_0x21a25e,_0x227c78){_0x227c78=_0x227c78||0xc8;return function(_0x51da55){if(_0x51da55){return _0x21a25e[_0x0d4f('0x1a')](_0x227c78)[_0x0d4f('0x1c')](_0x51da55);}};}function respondWithFilteredResult(_0x2283c2,_0x33b90f){return function(_0x208c9b){if(_0x208c9b){var _0x800d67=typeof _0x33b90f[_0x0d4f('0x1d')]===_0x0d4f('0x1e')&&typeof _0x33b90f[_0x0d4f('0x1f')]===_0x0d4f('0x1e');var _0x21420c=_0x208c9b['count'];var _0x4072d8=_0x800d67?0x0:_0x33b90f[_0x0d4f('0x1d')];var _0x4421da=_0x800d67?_0x208c9b['count']:_0x33b90f[_0x0d4f('0x1d')]+_0x33b90f[_0x0d4f('0x1f')];var _0x59a5ab;if(_0x4421da>=_0x21420c){_0x4421da=_0x21420c;_0x59a5ab=0xc8;}else{_0x59a5ab=0xce;}_0x2283c2[_0x0d4f('0x1a')](_0x59a5ab);return _0x2283c2['set'](_0x0d4f('0x20'),_0x4072d8+'-'+_0x4421da+'/'+_0x21420c)['json'](_0x208c9b);}return null;};}function patchUpdates(_0x307987){return function(_0x3cc0bd){try{jsonpatch[_0x0d4f('0x21')](_0x3cc0bd,_0x307987,!![]);}catch(_0x190580){return BPromise[_0x0d4f('0x22')](_0x190580);}return _0x3cc0bd[_0x0d4f('0x23')]();};}function saveUpdates(_0x414123,_0x134005){return function(_0x40db78){if(_0x40db78){return _0x40db78[_0x0d4f('0x24')](_0x414123)[_0x0d4f('0x25')](function(_0x40cac8){return _0x40cac8;});}return null;};}function removeEntity(_0x2f667e,_0x525768){return function(_0x2b1493){if(_0x2b1493){return _0x2b1493[_0x0d4f('0x26')]()['then'](function(){var _0x3bf34a=_0x2b1493[_0x0d4f('0x27')]({'plain':!![]});var _0x28e753='Dispositions';return db[_0x0d4f('0x28')][_0x0d4f('0x26')]({'where':{'type':_0x28e753,'resourceId':_0x3bf34a['id']}})[_0x0d4f('0x25')](function(){return _0x2b1493;});})[_0x0d4f('0x25')](function(){_0x2f667e[_0x0d4f('0x1a')](0xcc)[_0x0d4f('0x1b')]();});}};}function handleEntityNotFound(_0x348d6b,_0x3b144d){return function(_0x69a009){if(!_0x69a009){_0x348d6b[_0x0d4f('0x19')](0x194);}return _0x69a009;};}function handleError(_0x2c57a6,_0x34db76){_0x34db76=_0x34db76||0x1f4;return function(_0x1e58e6){logger[_0x0d4f('0x29')](_0x1e58e6['stack']);if(_0x1e58e6[_0x0d4f('0x2a')]){delete _0x1e58e6['name'];}_0x2c57a6[_0x0d4f('0x1a')](_0x34db76)[_0x0d4f('0x2b')](_0x1e58e6);};}exports['index']=function(_0x222194,_0x53e63c){var _0x231773={},_0x55a3b9={},_0x46a0bd={'count':0x0,'rows':[]};var _0x1234eb=_[_0x0d4f('0x2c')](db[_0x0d4f('0x2d')]['rawAttributes'],function(_0x371641){return{'name':_0x371641['fieldName'],'type':_0x371641[_0x0d4f('0x2e')][_0x0d4f('0x2f')]};});_0x55a3b9[_0x0d4f('0x30')]=_[_0x0d4f('0x2c')](_0x1234eb,_0x0d4f('0x2a'));_0x55a3b9['query']=_[_0x0d4f('0x31')](_0x222194[_0x0d4f('0x32')]);_0x55a3b9[_0x0d4f('0x33')]=_['intersection'](_0x55a3b9[_0x0d4f('0x30')],_0x55a3b9[_0x0d4f('0x32')]);_0x231773[_0x0d4f('0x34')]=_['intersection'](_0x55a3b9['model'],qs[_0x0d4f('0x35')](_0x222194['query'][_0x0d4f('0x35')]));_0x231773[_0x0d4f('0x34')]=_0x231773['attributes']['length']?_0x231773[_0x0d4f('0x34')]:_0x55a3b9[_0x0d4f('0x30')];if(!_0x222194[_0x0d4f('0x32')]['hasOwnProperty'](_0x0d4f('0x36'))){_0x231773['limit']=qs[_0x0d4f('0x1f')](_0x222194[_0x0d4f('0x32')][_0x0d4f('0x1f')]);_0x231773[_0x0d4f('0x1d')]=qs[_0x0d4f('0x1d')](_0x222194[_0x0d4f('0x32')][_0x0d4f('0x1d')]);}_0x231773['order']=qs[_0x0d4f('0x37')](_0x222194[_0x0d4f('0x32')][_0x0d4f('0x37')]);_0x231773['where']=qs[_0x0d4f('0x33')](_[_0x0d4f('0x38')](_0x222194[_0x0d4f('0x32')],_0x55a3b9[_0x0d4f('0x33')]),_0x1234eb);if(_0x222194[_0x0d4f('0x32')][_0x0d4f('0x39')]){_0x231773['where']=_[_0x0d4f('0x3a')](_0x231773['where'],{'$or':_[_0x0d4f('0x2c')](_0x1234eb,function(_0x48a039){if(_0x48a039[_0x0d4f('0x2e')]!==_0x0d4f('0x3b')){var _0x1264f4={};_0x1264f4[_0x48a039['name']]={'$like':'%'+_0x222194['query'][_0x0d4f('0x39')]+'%'};return _0x1264f4;}})});}_0x231773=_[_0x0d4f('0x3a')]({},_0x231773,_0x222194[_0x0d4f('0x3c')]);var _0x31428c={'where':_0x231773[_0x0d4f('0x3d')]};return db[_0x0d4f('0x2d')][_0x0d4f('0x3e')](_0x31428c)['then'](function(_0x46d2c2){_0x46a0bd['count']=_0x46d2c2;if(_0x222194[_0x0d4f('0x32')][_0x0d4f('0x3f')]){_0x231773[_0x0d4f('0x40')]=[{'all':!![]}];}return db['Disposition'][_0x0d4f('0x41')](_0x231773);})[_0x0d4f('0x25')](function(_0x16ff2a){_0x46a0bd['rows']=_0x16ff2a;return _0x46a0bd;})['then'](respondWithFilteredResult(_0x53e63c,_0x231773))[_0x0d4f('0x42')](handleError(_0x53e63c,null));};exports['show']=function(_0xdd80aa,_0x549d23){var _0x591374={'raw':!![],'where':{'id':_0xdd80aa['params']['id']}},_0x3ae5ac={};_0x3ae5ac[_0x0d4f('0x30')]=_['keys'](db[_0x0d4f('0x2d')][_0x0d4f('0x43')]);_0x3ae5ac[_0x0d4f('0x32')]=_['keys'](_0xdd80aa[_0x0d4f('0x32')]);_0x3ae5ac['filters']=_[_0x0d4f('0x44')](_0x3ae5ac['model'],_0x3ae5ac[_0x0d4f('0x32')]);_0x591374[_0x0d4f('0x34')]=_[_0x0d4f('0x44')](_0x3ae5ac[_0x0d4f('0x30')],qs['fields'](_0xdd80aa[_0x0d4f('0x32')]['fields']));_0x591374['attributes']=_0x591374[_0x0d4f('0x34')][_0x0d4f('0x45')]?_0x591374['attributes']:_0x3ae5ac[_0x0d4f('0x30')];if(_0xdd80aa[_0x0d4f('0x32')][_0x0d4f('0x3f')]){_0x591374[_0x0d4f('0x40')]=[{'all':!![]}];}_0x591374=_[_0x0d4f('0x3a')]({},_0x591374,_0xdd80aa[_0x0d4f('0x3c')]);return db[_0x0d4f('0x2d')][_0x0d4f('0x46')](_0x591374)[_0x0d4f('0x25')](handleEntityNotFound(_0x549d23,null))[_0x0d4f('0x25')](respondWithResult(_0x549d23,null))[_0x0d4f('0x42')](handleError(_0x549d23,null));};exports[_0x0d4f('0x47')]=function(_0x2ed6ad,_0x50fd54){return db['Disposition'][_0x0d4f('0x47')](_0x2ed6ad[_0x0d4f('0x48')],{})[_0x0d4f('0x25')](function(_0x1faeec){var _0x293849=_0x2ed6ad[_0x0d4f('0x49')][_0x0d4f('0x27')]({'plain':!![]});if(!_0x293849)throw new Error(_0x0d4f('0x4a'));if(_0x293849['role']===_0x0d4f('0x49')){var _0x3b22b4=_0x1faeec[_0x0d4f('0x27')]({'plain':!![]});var _0x29dfcd='Dispositions';return db[_0x0d4f('0x4b')][_0x0d4f('0x46')]({'where':{'name':_0x29dfcd,'userProfileId':_0x293849[_0x0d4f('0x4c')]},'raw':!![]})[_0x0d4f('0x25')](function(_0x16efca){if(_0x16efca&&_0x16efca['autoAssociation']===0x0){return db[_0x0d4f('0x28')][_0x0d4f('0x47')]({'name':_0x3b22b4[_0x0d4f('0x2a')],'resourceId':_0x3b22b4['id'],'type':_0x16efca[_0x0d4f('0x2a')],'sectionId':_0x16efca['id']},{})[_0x0d4f('0x25')](function(){return _0x1faeec;});}else{return _0x1faeec;}})['catch'](function(_0x3350c7){logger[_0x0d4f('0x29')](_0x0d4f('0x4d'),_0x3350c7);throw _0x3350c7;});}return _0x1faeec;})['then'](respondWithResult(_0x50fd54,0xc9))[_0x0d4f('0x42')](handleError(_0x50fd54,null));};exports[_0x0d4f('0x24')]=function(_0x5e9c2c,_0x1d0267){if(_0x5e9c2c['body']['id']){delete _0x5e9c2c[_0x0d4f('0x48')]['id'];}return db[_0x0d4f('0x2d')][_0x0d4f('0x46')]({'where':{'id':_0x5e9c2c[_0x0d4f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1d0267,null))[_0x0d4f('0x25')](saveUpdates(_0x5e9c2c[_0x0d4f('0x48')],null))['then'](respondWithResult(_0x1d0267,null))[_0x0d4f('0x42')](handleError(_0x1d0267,null));};exports[_0x0d4f('0x26')]=function(_0x25b393,_0x4475e1){return db['Disposition'][_0x0d4f('0x46')]({'where':{'id':_0x25b393[_0x0d4f('0x4e')]['id']}})[_0x0d4f('0x25')](handleEntityNotFound(_0x4475e1,null))[_0x0d4f('0x25')](removeEntity(_0x4475e1,null))[_0x0d4f('0x42')](handleError(_0x4475e1,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index fefc859..46150d7 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 _0x6d78=['name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','tools_dispositions','name_voice'];(function(_0x511a9d,_0x1fa193){var _0x3d2b65=function(_0x8859d1){while(--_0x8859d1){_0x511a9d['push'](_0x511a9d['shift']());}};_0x3d2b65(++_0x1fa193);}(_0x6d78,0x105));var _0x86d7=function(_0x417a23,_0x2a228d){_0x417a23=_0x417a23-0x0;var _0x3aeb3f=_0x6d78[_0x417a23];return _0x3aeb3f;};'use strict';var _=require(_0x86d7('0x0'));var util=require('util');var logger=require(_0x86d7('0x1'))(_0x86d7('0x2'));var moment=require(_0x86d7('0x3'));var BPromise=require(_0x86d7('0x4'));var rp=require(_0x86d7('0x5'));var fs=require('fs');var path=require(_0x86d7('0x6'));var rimraf=require('rimraf');var config=require(_0x86d7('0x7'));var attributes=require('./disposition.attributes');module[_0x86d7('0x8')]=function(_0xf178c7,_0x4634db){return _0xf178c7[_0x86d7('0x9')]('Disposition',attributes,{'tableName':_0x86d7('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x86d7('0xb'),'fields':[_0x86d7('0xc'),_0x86d7('0xd')]},{'unique':!![],'name':_0x86d7('0xe'),'fields':[_0x86d7('0xc'),_0x86d7('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x86d7('0xc'),'MailAccountId']},{'unique':!![],'name':_0x86d7('0x10'),'fields':[_0x86d7('0xc'),_0x86d7('0x11')]},{'unique':!![],'name':'name_fax','fields':[_0x86d7('0xc'),'FaxAccountId']},{'unique':!![],'name':_0x86d7('0x12'),'fields':[_0x86d7('0xc'),_0x86d7('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x86d7('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f0=['name_fax','name_openchannel','WhatsappAccountId','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0xb3f0,0x96));var _0x0b3f=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0xb3f0[_0x365be9];return _0x185c12;};'use strict';var _=require('lodash');var util=require(_0x0b3f('0x0'));var logger=require(_0x0b3f('0x1'))('api');var moment=require(_0x0b3f('0x2'));var BPromise=require(_0x0b3f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b3f('0x4'));var rimraf=require(_0x0b3f('0x5'));var config=require(_0x0b3f('0x6'));var attributes=require(_0x0b3f('0x7'));module[_0x0b3f('0x8')]=function(_0x37cf64,_0x15d87d){return _0x37cf64['define'](_0x0b3f('0x9'),attributes,{'tableName':_0x0b3f('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0b3f('0xb'),'fields':['name',_0x0b3f('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x0b3f('0xd'),_0x0b3f('0xe')]},{'unique':!![],'name':_0x0b3f('0xf'),'fields':[_0x0b3f('0xd'),'MailAccountId']},{'unique':!![],'name':_0x0b3f('0x10'),'fields':[_0x0b3f('0xd'),_0x0b3f('0x11')]},{'unique':!![],'name':_0x0b3f('0x12'),'fields':[_0x0b3f('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x0b3f('0x13'),'fields':[_0x0b3f('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x0b3f('0xd'),_0x0b3f('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 662577b..e23a658 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(_0x4f9c5a,_0x3fc99e){var _0x23def1=function(_0x50f172){while(--_0x50f172){_0x4f9c5a['push'](_0x4f9c5a['shift']());}};_0x23def1(++_0x3fc99e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x263b6c,_0x46d6e3){var _0x30cd22=function(_0x1a3416){while(--_0x1a3416){_0x263b6c['push'](_0x263b6c['shift']());}};_0x30cd22(++_0x46d6e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 b522734..9b4e6d6 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 _0x592d=['index','show','create','/:id','update','delete','express','Router','fs-extra','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x2f0e20,_0x4e75f2){var _0x2ebd44=function(_0x1e7296){while(--_0x1e7296){_0x2f0e20['push'](_0x2f0e20['shift']());}};_0x2ebd44(++_0x4e75f2);}(_0x592d,0x1cd));var _0xd592=function(_0x4db470,_0x1662db){_0x4db470=_0x4db470-0x0;var _0x2415f1=_0x592d[_0x4db470];return _0x2415f1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd592('0x0'));var router=express[_0xd592('0x1')]();var fs_extra=require(_0xd592('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd592('0x3'));var controller=require(_0xd592('0x4'));router[_0xd592('0x5')]('/',auth[_0xd592('0x6')](),controller[_0xd592('0x7')]);router[_0xd592('0x5')]('/:id',auth[_0xd592('0x6')](),controller[_0xd592('0x8')]);router['post']('/',auth[_0xd592('0x6')](),controller[_0xd592('0x9')]);router['put'](_0xd592('0xa'),auth[_0xd592('0x6')](),controller[_0xd592('0xb')]);router[_0xd592('0xc')]('/:id',auth[_0xd592('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x88a3=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','show','create','update'];(function(_0x376ca8,_0xdd626){var _0x254920=function(_0x2cee5c){while(--_0x2cee5c){_0x376ca8['push'](_0x376ca8['shift']());}};_0x254920(++_0xdd626);}(_0x88a3,0x1b3));var _0x388a=function(_0x3fd275,_0xf0cd7){_0x3fd275=_0x3fd275-0x0;var _0xe4f14f=_0x88a3[_0x3fd275];return _0xe4f14f;};'use strict';var multer=require(_0x388a('0x0'));var util=require(_0x388a('0x1'));var path=require(_0x388a('0x2'));var timeout=require('connect-timeout');var express=require(_0x388a('0x3'));var router=express[_0x388a('0x4')]();var fs_extra=require(_0x388a('0x5'));var auth=require(_0x388a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router['get']('/',auth[_0x388a('0x7')](),controller['index']);router[_0x388a('0x8')](_0x388a('0x9'),auth['isAuthenticated'](),controller[_0x388a('0xa')]);router['post']('/',auth[_0x388a('0x7')](),controller[_0x388a('0xb')]);router['put'](_0x388a('0x9'),auth[_0x388a('0x7')](),controller[_0x388a('0xc')]);router[_0x388a('0xd')](_0x388a('0x9'),auth[_0x388a('0x7')](),controller[_0x388a('0xe')]);module[_0x388a('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 1b20ac2..5642fc6 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 _0xe163=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','KHOMP','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING'];(function(_0x162c87,_0x3b82e7){var _0x4ae338=function(_0x3879f8){while(--_0x3879f8){_0x162c87['push'](_0x162c87['shift']());}};_0x4ae338(++_0x3b82e7);}(_0xe163,0x1b2));var _0x3e16=function(_0x3b31f1,_0x42b2ac){_0x3b31f1=_0x3b31f1-0x0;var _0x4d7832=_0xe163[_0x3b31f1];return _0x4d7832;};'use strict';var Sequelize=require(_0x3e16('0x0'));module[_0x3e16('0x1')]={'name':{'type':Sequelize[_0x3e16('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3e16('0x2')]},'ecm':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0x4'),'no'),'defaultValue':_0x3e16('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x3e16('0x5')},'localstationid':{'type':Sequelize[_0x3e16('0x2')],'unique':_0x3e16('0x6')},'minrate':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0x7'),_0x3e16('0x8'),_0x3e16('0x9'),_0x3e16('0xa'),_0x3e16('0xb'),_0x3e16('0xc')),'defaultValue':_0x3e16('0x8')},'maxrate':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0x7'),_0x3e16('0x8'),_0x3e16('0x9'),_0x3e16('0xa'),_0x3e16('0xb'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x3e16('0x2')],'defaultValue':_0x3e16('0xd')},'gateway':{'type':Sequelize[_0x3e16('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x3e16('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x3e16('0x3')](_0x3e16('0xe'),_0x3e16('0xf'),'DADHI',_0x3e16('0x10')),'defaultValue':_0x3e16('0xe')},'key':{'type':Sequelize[_0x3e16('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3e16('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3e16('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3e16('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e16('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3e16('0x12')],'defaultValue':![],'comment':_0x3e16('0x14'),'set':function(_0x55d0c5){if(!_0x55d0c5)this['setDataValue'](_0x3e16('0x15'),null);this[_0x3e16('0x16')]('mandatoryDisposition',_0x55d0c5);}}}; \ No newline at end of file +var _0x039d=['7200','9600','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0xc5a47f,_0x2ed42f){var _0x514abc=function(_0x5f4b36){while(--_0x5f4b36){_0xc5a47f['push'](_0xc5a47f['shift']());}};_0x514abc(++_0x2ed42f);}(_0x039d,0x1ac));var _0xd039=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x039d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd039('0x0'));module[_0xd039('0x1')]={'name':{'type':Sequelize[_0xd039('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd039('0x2')]},'ecm':{'type':Sequelize[_0xd039('0x3')](_0xd039('0x4'),'no'),'defaultValue':_0xd039('0x4')},'headerinfo':{'type':Sequelize[_0xd039('0x2')],'defaultValue':_0xd039('0x5')},'localstationid':{'type':Sequelize[_0xd039('0x2')],'unique':_0xd039('0x6')},'minrate':{'type':Sequelize['ENUM'](_0xd039('0x7'),_0xd039('0x8'),_0xd039('0x9'),_0xd039('0xa'),_0xd039('0xb'),'14400'),'defaultValue':_0xd039('0x8')},'maxrate':{'type':Sequelize['ENUM']('2400',_0xd039('0x8'),_0xd039('0x9'),_0xd039('0xa'),_0xd039('0xb'),_0xd039('0xc')),'defaultValue':_0xd039('0xc')},'modem':{'type':Sequelize[_0xd039('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd039('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd039('0x3')](_0xd039('0xe'),_0xd039('0xf'),_0xd039('0x10'),_0xd039('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd039('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd039('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd039('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd039('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd039('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd039('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd039('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd039('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xd039('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xd039('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x369358){if(!_0x369358)this[_0xd039('0x15')](_0xd039('0x16'),null);this['setDataValue']('mandatoryDisposition',_0x369358);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7976eb8..f3cb210 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 _0xea29=['FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','priority','finally','getApplications','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','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','VoiceExtension','updateAccountApplications','TrunkId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','CmContact','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','emit','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','http','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','fieldName','key','map','query','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition'];(function(_0x1ce979,_0x1dc8aa){var _0x5cd3f1=function(_0xcf768){while(--_0xcf768){_0x1ce979['push'](_0x1ce979['shift']());}};_0x5cd3f1(++_0x1dc8aa);}(_0xea29,0x1ed));var _0x9ea2=function(_0x494368,_0x56d9a3){_0x494368=_0x494368-0x0;var _0x1491a3=_0xea29[_0x494368];return _0x1491a3;};'use strict';var emlformat=require(_0x9ea2('0x0'));var rimraf=require(_0x9ea2('0x1'));var zipdir=require(_0x9ea2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ea2('0x3'));var moment=require('moment');var BPromise=require(_0x9ea2('0x4'));var Mustache=require(_0x9ea2('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9ea2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ea2('0x7'));var _=require(_0x9ea2('0x8'));var squel=require(_0x9ea2('0x9'));var crypto=require(_0x9ea2('0xa'));var jsforce=require(_0x9ea2('0xb'));var deskjs=require(_0x9ea2('0xc'));var toCsv=require(_0x9ea2('0x6'));var querystring=require(_0x9ea2('0xd'));var Papa=require(_0x9ea2('0xe'));var Redis=require(_0x9ea2('0xf'));var authService=require(_0x9ea2('0x10'));var qs=require(_0x9ea2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ea2('0x12'));var logger=require(_0x9ea2('0x13'))(_0x9ea2('0x14'));var utils=require(_0x9ea2('0x15'));var config=require(_0x9ea2('0x16'));var licenseUtil=require(_0x9ea2('0x17'));var db=require(_0x9ea2('0x18'))['db'];config[_0x9ea2('0x19')]=_[_0x9ea2('0x1a')](config['redis'],{'host':_0x9ea2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ea2('0x19')]));require(_0x9ea2('0x1c'))[_0x9ea2('0x1d')](socket);var jayson=require(_0x9ea2('0x1e'));var client=jayson['client'][_0x9ea2('0x1f')]({'port':0x232c});var client9002=jayson[_0x9ea2('0x20')][_0x9ea2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x366766,_0x15ca6a,_0x2dca0b,_0x172489){return new BPromise(function(_0x3cdf7c,_0x3b6fd4){var _0x49487a=_0x172489||client;return _0x49487a[_0x9ea2('0x21')](_0x366766,_0x2dca0b)['then'](function(_0x56515a){logger[_0x9ea2('0x22')](_0x9ea2('0x23'),_0x15ca6a,_0x9ea2('0x24'));logger['debug'](_0x9ea2('0x25'),_0x15ca6a,_0x9ea2('0x24'),JSON[_0x9ea2('0x26')](_0x56515a));if(_0x56515a[_0x9ea2('0x27')]){if(_0x56515a['error'][_0x9ea2('0x28')]===0x1f4){logger[_0x9ea2('0x27')](_0x9ea2('0x23'),_0x15ca6a,_0x56515a[_0x9ea2('0x27')][_0x9ea2('0x29')]);return _0x3b6fd4(_0x56515a['error'][_0x9ea2('0x29')]);}logger['error'](_0x9ea2('0x23'),_0x15ca6a,_0x56515a['error'][_0x9ea2('0x29')]);return _0x3cdf7c(_0x56515a[_0x9ea2('0x27')][_0x9ea2('0x29')]);}else{logger['info'](_0x9ea2('0x23'),_0x15ca6a,_0x9ea2('0x24'));_0x3cdf7c(_0x56515a[_0x9ea2('0x2a')]['message']);}})[_0x9ea2('0x2b')](function(_0x3265ff){logger[_0x9ea2('0x27')](_0x9ea2('0x23'),_0x15ca6a,_0x3265ff);_0x3b6fd4(_0x3265ff);});});}function respondWithStatusCode(_0x425768,_0x4f57ca){_0x4f57ca=_0x4f57ca||0xcc;return function(_0x5875c8){if(_0x5875c8){return _0x425768['sendStatus'](_0x4f57ca);}return _0x425768[_0x9ea2('0x2c')](_0x4f57ca)[_0x9ea2('0x2d')]();};}function respondWithResult(_0x49f22c,_0x36576e){_0x36576e=_0x36576e||0xc8;return function(_0xfcb9f0){if(_0xfcb9f0){return _0x49f22c[_0x9ea2('0x2c')](_0x36576e)[_0x9ea2('0x2e')](_0xfcb9f0);}};}function respondWithFilteredResult(_0x22fc3d,_0x2a38ae){return function(_0x1a69b3){if(_0x1a69b3){var _0x5dc8e7=typeof _0x2a38ae[_0x9ea2('0x2f')]===_0x9ea2('0x30')&&typeof _0x2a38ae[_0x9ea2('0x31')]===_0x9ea2('0x30');var _0x198223=_0x1a69b3[_0x9ea2('0x32')];var _0x27b96f=_0x5dc8e7?0x0:_0x2a38ae[_0x9ea2('0x2f')];var _0x526e18=_0x5dc8e7?_0x1a69b3[_0x9ea2('0x32')]:_0x2a38ae[_0x9ea2('0x2f')]+_0x2a38ae[_0x9ea2('0x31')];var _0x3b8c28;if(_0x526e18>=_0x198223){_0x526e18=_0x198223;_0x3b8c28=0xc8;}else{_0x3b8c28=0xce;}_0x22fc3d[_0x9ea2('0x2c')](_0x3b8c28);return _0x22fc3d[_0x9ea2('0x33')]('Content-Range',_0x27b96f+'-'+_0x526e18+'/'+_0x198223)[_0x9ea2('0x2e')](_0x1a69b3);}return null;};}function patchUpdates(_0x1e2b3b){return function(_0x12e453){try{jsonpatch[_0x9ea2('0x34')](_0x12e453,_0x1e2b3b,!![]);}catch(_0x4926db){return BPromise[_0x9ea2('0x35')](_0x4926db);}return _0x12e453[_0x9ea2('0x36')]();};}function saveUpdates(_0x52ffa1,_0x38cf07){return function(_0x3d9d4a){if(_0x3d9d4a){return _0x3d9d4a[_0x9ea2('0x37')](_0x52ffa1)[_0x9ea2('0x38')](function(_0x3d9098){return _0x3d9098;});}return null;};}function removeEntity(_0x2e21f3,_0x5e34de){return function(_0x432651){if(_0x432651){return _0x432651[_0x9ea2('0x39')]()[_0x9ea2('0x38')](function(){var _0x4d04ae=_0x432651['get']({'plain':!![]});var _0x2daeb3=_0x9ea2('0x3a');return db[_0x9ea2('0x3b')]['destroy']({'where':{'type':_0x2daeb3,'resourceId':_0x4d04ae['id']}})[_0x9ea2('0x38')](function(){return _0x432651;});})[_0x9ea2('0x38')](function(){_0x2e21f3[_0x9ea2('0x2c')](0xcc)[_0x9ea2('0x2d')]();});}};}function handleEntityNotFound(_0x48fc8b,_0x2489da){return function(_0x2733d2){if(!_0x2733d2){_0x48fc8b[_0x9ea2('0x3c')](0x194);}return _0x2733d2;};}function handleError(_0xfa8d7,_0x14a5eb){_0x14a5eb=_0x14a5eb||0x1f4;return function(_0xede113){logger[_0x9ea2('0x27')](_0xede113[_0x9ea2('0x3d')]);if(_0xede113[_0x9ea2('0x3e')]){delete _0xede113[_0x9ea2('0x3e')];}_0xfa8d7[_0x9ea2('0x2c')](_0x14a5eb)[_0x9ea2('0x3f')](_0xede113);};}exports[_0x9ea2('0x40')]=function(_0x328436,_0x3ea8e4){var _0x1cf82c={'include':[{'model':db[_0x9ea2('0x41')],'as':_0x9ea2('0x42')}]},_0x49481c={},_0x1f2f70={'count':0x0,'rows':[]};var _0x1762e1=_['map'](db[_0x9ea2('0x43')]['rawAttributes'],function(_0x413667){return{'name':_0x413667[_0x9ea2('0x44')],'type':_0x413667['type'][_0x9ea2('0x45')]};});_0x49481c['model']=_[_0x9ea2('0x46')](_0x1762e1,_0x9ea2('0x3e'));_0x49481c['query']=_['keys'](_0x328436[_0x9ea2('0x47')]);_0x49481c['filters']=_['intersection'](_0x49481c[_0x9ea2('0x48')],_0x49481c[_0x9ea2('0x47')]);_0x1cf82c[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x49481c[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x328436['query']['fields']));_0x1cf82c['attributes']=_0x1cf82c[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x1cf82c[_0x9ea2('0x49')]:_0x49481c[_0x9ea2('0x48')];if(!_0x328436[_0x9ea2('0x47')]['hasOwnProperty'](_0x9ea2('0x4d'))){_0x1cf82c['limit']=qs[_0x9ea2('0x31')](_0x328436[_0x9ea2('0x47')][_0x9ea2('0x31')]);_0x1cf82c[_0x9ea2('0x2f')]=qs['offset'](_0x328436[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x1cf82c[_0x9ea2('0x4e')]=qs[_0x9ea2('0x4f')](_0x328436[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x1cf82c[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x328436['query'],_0x49481c[_0x9ea2('0x51')]),_0x1762e1);if(_0x328436[_0x9ea2('0x47')]['filter']){_0x1cf82c[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x1cf82c[_0x9ea2('0x50')],{'$or':_[_0x9ea2('0x46')](_0x1762e1,function(_0x282e62){if(_0x282e62['type']!=='VIRTUAL'){var _0xf548fa={};_0xf548fa[_0x282e62[_0x9ea2('0x3e')]]={'$like':'%'+_0x328436[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0xf548fa;}})});}_0x1cf82c=_['merge']({},_0x1cf82c,_0x328436[_0x9ea2('0x55')]);var _0x40fbf8={'where':_0x1cf82c[_0x9ea2('0x50')]};return db['FaxAccount'][_0x9ea2('0x32')](_0x40fbf8)[_0x9ea2('0x38')](function(_0x5e03d7){_0x1f2f70[_0x9ea2('0x32')]=_0x5e03d7;if(_0x328436['query'][_0x9ea2('0x56')]){_0x1cf82c[_0x9ea2('0x57')]=[{'all':!![]}];}return db[_0x9ea2('0x43')][_0x9ea2('0x58')](_0x1cf82c);})[_0x9ea2('0x38')](function(_0xa3879f){_0x1f2f70[_0x9ea2('0x59')]=_0xa3879f;return _0x1f2f70;})['then'](respondWithFilteredResult(_0x3ea8e4,_0x1cf82c))[_0x9ea2('0x2b')](handleError(_0x3ea8e4,null));};exports[_0x9ea2('0x5a')]=function(_0x3aa84f,_0x304177){var _0x5f8b9c={'raw':![],'where':{'id':_0x3aa84f[_0x9ea2('0x5b')]['id']},'include':[{'model':db[_0x9ea2('0x41')],'as':_0x9ea2('0x42')}]},_0x26f465={};_0x26f465[_0x9ea2('0x48')]=_['keys'](db['FaxAccount'][_0x9ea2('0x5c')]);_0x26f465[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x3aa84f[_0x9ea2('0x47')]);_0x26f465['filters']=_['intersection'](_0x26f465[_0x9ea2('0x48')],_0x26f465[_0x9ea2('0x47')]);_0x5f8b9c[_0x9ea2('0x49')]=_['intersection'](_0x26f465['model'],qs[_0x9ea2('0x4b')](_0x3aa84f['query'][_0x9ea2('0x4b')]));_0x5f8b9c[_0x9ea2('0x49')]=_0x5f8b9c[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x5f8b9c[_0x9ea2('0x49')]:_0x26f465['model'];if(_0x3aa84f[_0x9ea2('0x47')][_0x9ea2('0x56')]){_0x5f8b9c[_0x9ea2('0x57')]=[{'all':!![]}];}_0x5f8b9c=_[_0x9ea2('0x53')]({},_0x5f8b9c,_0x3aa84f[_0x9ea2('0x55')]);return db['FaxAccount'][_0x9ea2('0x5e')](_0x5f8b9c)[_0x9ea2('0x38')](handleEntityNotFound(_0x304177,null))[_0x9ea2('0x38')](respondWithResult(_0x304177,null))[_0x9ea2('0x2b')](handleError(_0x304177,null));};exports[_0x9ea2('0x5f')]=function(_0x140112,_0x2961a2){return db[_0x9ea2('0x43')]['create'](_0x140112[_0x9ea2('0x60')],{})[_0x9ea2('0x38')](function(_0x10d6c4){var _0x56adee=_0x140112[_0x9ea2('0x61')]['get']({'plain':!![]});if(!_0x56adee)throw new Error(_0x9ea2('0x62'));if(_0x56adee[_0x9ea2('0x63')]===_0x9ea2('0x61')){var _0x54a2fc=_0x10d6c4[_0x9ea2('0x64')]({'plain':!![]});var _0x47fc2a=_0x9ea2('0x3a');return db[_0x9ea2('0x65')][_0x9ea2('0x5e')]({'where':{'name':_0x47fc2a,'userProfileId':_0x56adee[_0x9ea2('0x66')]},'raw':!![]})[_0x9ea2('0x38')](function(_0x43a305){if(_0x43a305&&_0x43a305[_0x9ea2('0x67')]===0x0){return db[_0x9ea2('0x3b')][_0x9ea2('0x5f')]({'name':_0x54a2fc['name'],'resourceId':_0x54a2fc['id'],'type':_0x43a305['name'],'sectionId':_0x43a305['id']},{})['then'](function(){return _0x10d6c4;});}else{return _0x10d6c4;}})[_0x9ea2('0x2b')](function(_0x5df2ed){logger[_0x9ea2('0x27')](_0x9ea2('0x68'),_0x5df2ed);throw _0x5df2ed;});}return _0x10d6c4;})[_0x9ea2('0x38')](respondWithResult(_0x2961a2,0xc9))[_0x9ea2('0x2b')](handleError(_0x2961a2,null));};exports[_0x9ea2('0x37')]=function(_0x52d1b7,_0x414f54){if(_0x52d1b7[_0x9ea2('0x60')]['id']){delete _0x52d1b7[_0x9ea2('0x60')]['id'];}return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x52d1b7[_0x9ea2('0x5b')]['id']},'include':[{'model':db[_0x9ea2('0x41')],'as':_0x9ea2('0x42')}]})[_0x9ea2('0x38')](handleEntityNotFound(_0x414f54,null))[_0x9ea2('0x38')](saveUpdates(_0x52d1b7[_0x9ea2('0x60')],null))[_0x9ea2('0x38')](respondWithResult(_0x414f54,null))[_0x9ea2('0x2b')](handleError(_0x414f54,null));};exports[_0x9ea2('0x39')]=function(_0x20e2a6,_0x55c73c){return db['FaxAccount'][_0x9ea2('0x5e')]({'where':{'id':_0x20e2a6[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x55c73c,null))[_0x9ea2('0x38')](removeEntity(_0x55c73c,null))['catch'](handleError(_0x55c73c,null));};exports[_0x9ea2('0x69')]=function(_0x284c35,_0x57d482){return db[_0x9ea2('0x43')][_0x9ea2('0x69')]()[_0x9ea2('0x38')](respondWithResult(_0x57d482,null))[_0x9ea2('0x2b')](handleError(_0x57d482,null));};exports[_0x9ea2('0x6a')]=function(_0x5ce0c6,_0x5a3c26,_0x312579){if(_0x5ce0c6[_0x9ea2('0x60')]['id']){delete _0x5ce0c6[_0x9ea2('0x60')]['id'];}return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x5ce0c6['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x5a3c26,null))[_0x9ea2('0x38')](function(_0x1c229c){if(_0x1c229c){_0x5ce0c6[_0x9ea2('0x60')][_0x9ea2('0x6b')]=_0x1c229c['id'];return db[_0x9ea2('0x6c')]['create'](_0x5ce0c6['body']);}})[_0x9ea2('0x38')](respondWithResult(_0x5a3c26,null))[_0x9ea2('0x2b')](handleError(_0x5a3c26,null));};exports[_0x9ea2('0x6d')]=function(_0x200d59,_0x2ae061,_0x4a7c75){var _0x3333b9={'raw':![],'where':{}};var _0x2039ba={};var _0x24f517={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x200d59[_0x9ea2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2ae061,null))[_0x9ea2('0x38')](function(_0x2c6696){if(_0x2c6696){_0x2039ba[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db[_0x9ea2('0x6c')]['rawAttributes']);_0x2039ba[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x200d59[_0x9ea2('0x47')]);_0x2039ba[_0x9ea2('0x51')]=_[_0x9ea2('0x4a')](_0x2039ba[_0x9ea2('0x48')],_0x2039ba[_0x9ea2('0x47')]);_0x3333b9[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x2039ba[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x200d59['query'][_0x9ea2('0x4b')]));_0x3333b9['attributes']=_0x3333b9['attributes']['length']?_0x3333b9[_0x9ea2('0x49')]:_0x2039ba[_0x9ea2('0x48')];if(!_0x200d59['query'][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x3333b9[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x200d59['query'][_0x9ea2('0x31')]);_0x3333b9['offset']=qs[_0x9ea2('0x2f')](_0x200d59[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x3333b9['order']=qs[_0x9ea2('0x4f')](_0x200d59[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x3333b9[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x200d59[_0x9ea2('0x47')],_0x2039ba[_0x9ea2('0x51')]));_0x3333b9[_0x9ea2('0x50')]['FaxAccountId']=_0x2c6696['id'];if(_0x200d59[_0x9ea2('0x47')][_0x9ea2('0x54')]){_0x3333b9[_0x9ea2('0x50')]=_['merge'](_0x3333b9[_0x9ea2('0x50')],{'$or':_[_0x9ea2('0x46')](_0x3333b9[_0x9ea2('0x49')],function(_0x285cc6){var _0x1f9955={};_0x1f9955[_0x285cc6]={'$like':'%'+_0x200d59[_0x9ea2('0x47')]['filter']+'%'};return _0x1f9955;})});}_0x3333b9=_[_0x9ea2('0x53')]({},_0x3333b9,_0x200d59['options']);return db['Disposition'][_0x9ea2('0x32')]({'where':_0x3333b9['where']})[_0x9ea2('0x38')](function(_0x2e926e){_0x24f517[_0x9ea2('0x32')]=_0x2e926e;if(_0x200d59[_0x9ea2('0x47')]['includeAll']){_0x3333b9['include']=[{'all':!![]}];}return db[_0x9ea2('0x6c')][_0x9ea2('0x58')](_0x3333b9);})[_0x9ea2('0x38')](function(_0x5d4b28){_0x24f517[_0x9ea2('0x59')]=_0x5d4b28;return _0x24f517;});}})[_0x9ea2('0x38')](respondWithFilteredResult(_0x2ae061,_0x3333b9))[_0x9ea2('0x2b')](handleError(_0x2ae061,null));};exports[_0x9ea2('0x70')]=function(_0x1346c2,_0x2b92f2,_0x22148d){return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x1346c2[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x2b92f2,null))[_0x9ea2('0x38')](function(_0xde7b46){if(_0xde7b46){return _0xde7b46[_0x9ea2('0x70')](_0x1346c2[_0x9ea2('0x47')][_0x9ea2('0x71')]);}})['then'](respondWithStatusCode(_0x2b92f2,null))[_0x9ea2('0x2b')](handleError(_0x2b92f2,null));};exports[_0x9ea2('0x72')]=function(_0x18540d,_0x5643e1,_0x3b880e){if(_0x18540d[_0x9ea2('0x60')]['id']){delete _0x18540d[_0x9ea2('0x60')]['id'];}return db['FaxAccount'][_0x9ea2('0x5e')]({'where':{'id':_0x18540d[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x5643e1,null))[_0x9ea2('0x38')](function(_0x5c80a4){if(_0x5c80a4){_0x18540d['body'][_0x9ea2('0x6b')]=_0x5c80a4['id'];return db[_0x9ea2('0x73')]['create'](_0x18540d[_0x9ea2('0x60')]);}})[_0x9ea2('0x38')](respondWithResult(_0x5643e1,null))[_0x9ea2('0x2b')](handleError(_0x5643e1,null));};exports[_0x9ea2('0x74')]=function(_0x7bdbb5,_0x3c2cff,_0x44b2b0){var _0x12fae4={'raw':![],'where':{}};var _0x4e3cf2={};var _0x6ec025={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')]['findOne']({'where':{'id':_0x7bdbb5['params']['id']}})['then'](handleEntityNotFound(_0x3c2cff,null))[_0x9ea2('0x38')](function(_0x49aae5){if(_0x49aae5){_0x4e3cf2[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db['CannedAnswer']['rawAttributes']);_0x4e3cf2[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x7bdbb5[_0x9ea2('0x47')]);_0x4e3cf2[_0x9ea2('0x51')]=_['intersection'](_0x4e3cf2[_0x9ea2('0x48')],_0x4e3cf2[_0x9ea2('0x47')]);_0x12fae4[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x4e3cf2['model'],qs[_0x9ea2('0x4b')](_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x4b')]));_0x12fae4[_0x9ea2('0x49')]=_0x12fae4[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x12fae4['attributes']:_0x4e3cf2[_0x9ea2('0x48')];if(!_0x7bdbb5['query'][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x12fae4['limit']=qs['limit'](_0x7bdbb5['query']['limit']);_0x12fae4[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x12fae4[_0x9ea2('0x4e')]=qs[_0x9ea2('0x4f')](_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x12fae4[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x7bdbb5[_0x9ea2('0x47')],_0x4e3cf2[_0x9ea2('0x51')]));_0x12fae4[_0x9ea2('0x50')][_0x9ea2('0x6b')]=_0x49aae5['id'];if(_0x7bdbb5[_0x9ea2('0x47')][_0x9ea2('0x54')]){_0x12fae4[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x12fae4[_0x9ea2('0x50')],{'$or':_['map'](_0x12fae4[_0x9ea2('0x49')],function(_0x1a52a3){var _0x5cf0c3={};_0x5cf0c3[_0x1a52a3]={'$like':'%'+_0x7bdbb5['query'][_0x9ea2('0x54')]+'%'};return _0x5cf0c3;})});}_0x12fae4=_[_0x9ea2('0x53')]({},_0x12fae4,_0x7bdbb5[_0x9ea2('0x55')]);return db[_0x9ea2('0x73')][_0x9ea2('0x32')]({'where':_0x12fae4[_0x9ea2('0x50')]})['then'](function(_0x574a10){_0x6ec025[_0x9ea2('0x32')]=_0x574a10;if(_0x7bdbb5[_0x9ea2('0x47')]['includeAll']){_0x12fae4[_0x9ea2('0x57')]=[{'all':!![]}];}return db[_0x9ea2('0x73')][_0x9ea2('0x58')](_0x12fae4);})[_0x9ea2('0x38')](function(_0x49f965){_0x6ec025[_0x9ea2('0x59')]=_0x49f965;return _0x6ec025;});}})[_0x9ea2('0x38')](respondWithFilteredResult(_0x3c2cff,_0x12fae4))['catch'](handleError(_0x3c2cff,null));};exports['removeAnswers']=function(_0x3aedbb,_0x1b3904,_0x12575f){return db[_0x9ea2('0x43')]['find']({'where':{'id':_0x3aedbb['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x1b3904,null))[_0x9ea2('0x38')](function(_0x557704){if(_0x557704){return _0x557704[_0x9ea2('0x75')](_0x3aedbb['query'][_0x9ea2('0x71')]);}})[_0x9ea2('0x38')](respondWithStatusCode(_0x1b3904,null))['catch'](handleError(_0x1b3904,null));};exports[_0x9ea2('0x76')]=function(_0x3beb42,_0x22ebe6,_0x1a9f44){return db[_0x9ea2('0x77')][_0x9ea2('0x5e')]({'where':{'id':_0x3beb42[_0x9ea2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x22ebe6,null))[_0x9ea2('0x38')](function(_0x309094){if(_0x309094){return _0x309094[_0x9ea2('0x76')](_0x3beb42['body'][_0x9ea2('0x71')],_[_0x9ea2('0x78')](_0x3beb42[_0x9ea2('0x60')],[_0x9ea2('0x71'),'id'])||{});}})[_0x9ea2('0x38')](respondWithResult(_0x22ebe6,null))[_0x9ea2('0x2b')](handleError(_0x22ebe6,null));};exports['getInteractions']=function(_0x3ef466,_0x99304c,_0x2eaff5){var _0x29f947={'raw':![],'where':{}};var _0x27ba65={};var _0x3675aa={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x3ef466['params']['id']}})['then'](handleEntityNotFound(_0x99304c,null))[_0x9ea2('0x38')](function(_0x486b9c){if(_0x486b9c){_0x27ba65[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db[_0x9ea2('0x77')][_0x9ea2('0x5c')]);_0x27ba65[_0x9ea2('0x47')]=_[_0x9ea2('0x5d')](_0x3ef466[_0x9ea2('0x47')]);_0x27ba65[_0x9ea2('0x51')]=_[_0x9ea2('0x4a')](_0x27ba65[_0x9ea2('0x48')],_0x27ba65['query']);_0x29f947['attributes']=_[_0x9ea2('0x4a')](_0x27ba65[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x3ef466[_0x9ea2('0x47')]['fields']));_0x29f947[_0x9ea2('0x49')]=_0x29f947[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x29f947[_0x9ea2('0x49')]:_0x27ba65['model'];if(!_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x6f')]('nolimit')){_0x29f947[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x31')]);_0x29f947['offset']=qs[_0x9ea2('0x2f')](_0x3ef466[_0x9ea2('0x47')]['offset']);}_0x29f947[_0x9ea2('0x4e')]=qs[_0x9ea2('0x4f')](_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x29f947[_0x9ea2('0x50')]=qs['filters'](_['pick'](_0x3ef466[_0x9ea2('0x47')],_0x27ba65['filters']));_0x29f947[_0x9ea2('0x50')][_0x9ea2('0x6b')]=_0x486b9c['id'];if(_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x54')]){_0x29f947[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x29f947[_0x9ea2('0x50')],{'$or':_['map'](_0x29f947['attributes'],function(_0xf8c456){var _0x58977={};_0x58977[_0xf8c456]={'$like':'%'+_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0x58977;})});}_0x29f947=_['merge']({},_0x29f947,_0x3ef466['options']);return db[_0x9ea2('0x77')][_0x9ea2('0x32')]({'where':_0x29f947[_0x9ea2('0x50')]})[_0x9ea2('0x38')](function(_0x3c0fd5){_0x3675aa[_0x9ea2('0x32')]=_0x3c0fd5;if(_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x56')]){_0x29f947[_0x9ea2('0x57')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x9ea2('0x79')],'as':_0x9ea2('0x7a'),'attributes':['name',_0x9ea2('0x7b'),_0x9ea2('0x7c')],'required':![]},{'model':db[_0x9ea2('0x7d')],'as':_0x9ea2('0x7e'),'attributes':['id',_0x9ea2('0x3e'),_0x9ea2('0x7f')],'where':_0x3ef466[_0x9ea2('0x47')][_0x9ea2('0x80')]?{'id':_0x3ef466[_0x9ea2('0x47')]['tag']}:undefined,'required':_0x3ef466['query'][_0x9ea2('0x80')]?!![]:![]}];}return db[_0x9ea2('0x77')][_0x9ea2('0x58')](_0x29f947);})[_0x9ea2('0x38')](function(_0x25f297){_0x3675aa[_0x9ea2('0x59')]=_0x25f297;return _0x3675aa;});}})[_0x9ea2('0x38')](respondWithFilteredResult(_0x99304c,_0x29f947))[_0x9ea2('0x2b')](handleError(_0x99304c,null));};exports[_0x9ea2('0x81')]=function(_0x5e79f2,_0x3cb70e){var _0x205c7a=_0x5e79f2[_0x9ea2('0x5b')]['id'];var _0x55effb=_0x5e79f2[_0x9ea2('0x60')];var _0xf835c4=0xc8;var _0x22e671=null;return db[_0x9ea2('0x82')]['transaction']({'isolationLevel':db[_0x9ea2('0x82')][_0x9ea2('0x83')][_0x9ea2('0x84')][_0x9ea2('0x85')]},function(_0x1c1749){return db['FaxAccount']['findOne']({'where':{'id':_0x205c7a},'transaction':_0x1c1749})[_0x9ea2('0x38')](function(_0x483fed){if(_0x483fed){return db['FaxApplication'][_0x9ea2('0x39')]({'where':{'FaxAccountId':_0x205c7a},'transaction':_0x1c1749})[_0x9ea2('0x38')](function(){var _0x6197d4=_[_0x9ea2('0x46')](_0x55effb,function(_0xad8c78){_0xad8c78[_0x9ea2('0x6b')]=_0x205c7a;return _0xad8c78;});return db['FaxApplication'][_0x9ea2('0x86')](_0x6197d4,{'transaction':_0x1c1749});});}else{_0xf835c4=0x194;_0x22e671=[];}});})['then'](function(){if(_0xf835c4!==0x194){return db[_0x9ea2('0x87')]['findAndCountAll']({'where':{'FaxAccountId':_0x205c7a},'order':_0x9ea2('0x88')})['then'](function(_0x14bd59){_0x22e671=_0x14bd59;});}})[_0x9ea2('0x2b')](function(_0x3ceeb6){_0xf835c4=0x1f4;logger[_0x9ea2('0x27')](_0x3ceeb6[_0x9ea2('0x3d')]);if(_0x3ceeb6['name']){delete _0x3ceeb6[_0x9ea2('0x3e')];}_0x22e671=_0x3ceeb6;})[_0x9ea2('0x89')](function(){if(_0x22e671===null){_0x3cb70e[_0x9ea2('0x3c')](_0xf835c4);}else{if(_0xf835c4===0x1f4){_0x3cb70e[_0x9ea2('0x2c')](_0xf835c4)[_0x9ea2('0x3f')](_0x22e671);}else{_0x3cb70e[_0x9ea2('0x2c')](_0xf835c4)['json'](_0x22e671);}}});};exports[_0x9ea2('0x8a')]=function(_0x1d924a,_0x76a550,_0x4fc877){var _0x3d25e9={};var _0x825188={};var _0x157be0;var _0x308768;return db['FaxAccount'][_0x9ea2('0x6e')]({'where':{'id':_0x1d924a['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x76a550,null))[_0x9ea2('0x38')](function(_0x52ca79){if(_0x52ca79){_0x157be0=_0x52ca79;_0x825188[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db['FaxApplication'][_0x9ea2('0x5c')]);_0x825188[_0x9ea2('0x47')]=_['keys'](_0x1d924a[_0x9ea2('0x47')]);_0x825188['filters']=_[_0x9ea2('0x4a')](_0x825188[_0x9ea2('0x48')],_0x825188[_0x9ea2('0x47')]);_0x3d25e9[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x825188['model'],qs[_0x9ea2('0x4b')](_0x1d924a[_0x9ea2('0x47')]['fields']));_0x3d25e9[_0x9ea2('0x49')]=_0x3d25e9[_0x9ea2('0x49')]['length']?_0x3d25e9[_0x9ea2('0x49')]:_0x825188[_0x9ea2('0x48')];_0x3d25e9['order']=qs[_0x9ea2('0x4f')](_0x1d924a[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x3d25e9[_0x9ea2('0x50')]=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x1d924a[_0x9ea2('0x47')],_0x825188[_0x9ea2('0x51')]));if(_0x1d924a[_0x9ea2('0x47')]['filter']){_0x3d25e9[_0x9ea2('0x50')]=_[_0x9ea2('0x53')](_0x3d25e9['where'],{'$or':_[_0x9ea2('0x46')](_0x3d25e9[_0x9ea2('0x49')],function(_0x2e8acb){var _0x257acb={};_0x257acb[_0x2e8acb]={'$like':'%'+_0x1d924a[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0x257acb;})});}_0x3d25e9=_[_0x9ea2('0x53')]({},_0x3d25e9,_0x1d924a[_0x9ea2('0x55')]);return _0x157be0[_0x9ea2('0x8a')](_0x3d25e9);}})[_0x9ea2('0x38')](function(_0x3cab2c){if(_0x3cab2c){_0x308768=_0x3cab2c[_0x9ea2('0x4c')];if(!_0x1d924a[_0x9ea2('0x47')]['hasOwnProperty'](_0x9ea2('0x4d'))){_0x3d25e9[_0x9ea2('0x31')]=qs['limit'](_0x1d924a['query'][_0x9ea2('0x31')]);_0x3d25e9[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x1d924a[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}return _0x157be0[_0x9ea2('0x8a')](_0x3d25e9);}})['then'](function(_0x382f11){if(_0x382f11){return _0x382f11?{'count':_0x308768,'rows':_0x382f11}:null;}})['then'](respondWithResult(_0x76a550,null))[_0x9ea2('0x2b')](handleError(_0x76a550,null));};function Extension(_0x5a733d,_0x374fd2,_0x2f5c60,_0x4f3301){this['context']=_0x9ea2('0x8b');this[_0x9ea2('0x8c')]=_0x5a733d[_0x9ea2('0x8d')];this[_0x9ea2('0x8e')]=_0x4f3301;this['type']=_0x9ea2('0x8f');this['description']=_0x9ea2('0x90');this[_0x9ea2('0x6b')]=_0x5a733d['id'];this[_0x9ea2('0x88')]=_0x374fd2;this[_0x9ea2('0x91')]=_0x2f5c60;}function createExtensionsReciveFax(_0x38f74f){var _0x13fd84=0x1;var _0x34e4a4=[];_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,'',_0x9ea2('0x93')));_0x13fd84+=0x1;_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,_0x9ea2('0x94'),'Set'));_0x13fd84+=0x1;for(var _0x2eeab4 in _0x38f74f){if(_0x38f74f[_0x9ea2('0x6f')](_0x2eeab4)&&(_0x2eeab4==='ecm'||_0x2eeab4===_0x9ea2('0x8d')||_0x2eeab4===_0x9ea2('0x95')||_0x2eeab4===_0x9ea2('0x96')||_0x2eeab4===_0x9ea2('0x97')||_0x2eeab4===_0x9ea2('0x98')||_0x2eeab4===_0x9ea2('0x99')||_0x2eeab4===_0x9ea2('0x9a')||_0x2eeab4===_0x9ea2('0x9b'))){_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,_0x9ea2('0x9c')+_0x2eeab4+')='+_0x38f74f[_0x2eeab4],_0x9ea2('0x9d')));_0x13fd84+=0x1;}}_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,'6',_0x9ea2('0x9e')));_0x13fd84+=0x1;_0x34e4a4[_0x9ea2('0x92')](new Extension(_0x38f74f,_0x13fd84,_0x9ea2('0x9f'),_0x9ea2('0xa0')));_0x13fd84=0x0;return _0x34e4a4;}exports[_0x9ea2('0xa1')]=function(_0x14ba7a,_0x47ff6b,_0x2701c3){var _0x4d5318;return db[_0x9ea2('0x82')]['transaction'](function(_0x2b92cf){return db[_0x9ea2('0x43')][_0x9ea2('0x5f')](_0x14ba7a[_0x9ea2('0x60')],{'transaction':_0x2b92cf})['then'](function(_0x4716f9){_0x4d5318=_0x4716f9[_0x9ea2('0x64')]({'plain':!![]});return db[_0x9ea2('0xa2')]['bulkCreate'](createExtensionsReciveFax(_0x4d5318),{'transaction':_0x2b92cf});});})[_0x9ea2('0x38')](function(){return _0x4d5318;})[_0x9ea2('0x38')](respondWithResult(_0x47ff6b,null))[_0x9ea2('0x2b')](handleError(_0x47ff6b,null));};exports[_0x9ea2('0xa3')]=function(_0xe5a30a,_0x30f8ea,_0x4b6396){var _0x2fa701;return db[_0x9ea2('0x82')]['transaction'](function(_0x1a8c7b){return db[_0x9ea2('0x43')][_0x9ea2('0x37')](_0xe5a30a['body'],{'where':{'id':_0xe5a30a[_0x9ea2('0x60')]['id']},'transaction':_0x1a8c7b})[_0x9ea2('0x38')](function(_0x1dc66a){return db[_0x9ea2('0xa2')][_0x9ea2('0x39')]({'where':{'FaxAccountId':_0xe5a30a['body']['id']},'transaction':_0x1a8c7b})['then'](function(_0x54c751){return db[_0x9ea2('0xa2')][_0x9ea2('0x86')](createExtensionsReciveFax(_[_0x9ea2('0x78')](_0xe5a30a['body'],['tech',_0x9ea2('0x45'),'createdAt','updatedAt',_0x9ea2('0xa4'),'ListId'])),{'transaction':_0x1a8c7b});});});})['then'](function(){return db[_0x9ea2('0x43')]['findById'](_0xe5a30a[_0x9ea2('0x60')]['id']);})['then'](respondWithResult(_0x30f8ea,null))['catch'](handleError(_0x30f8ea,null));};exports[_0x9ea2('0xa5')]=function(_0x38b89c,_0x51ea74,_0x2d7cfe){var _0x4dbab7={'raw':!![],'where':{}};var _0x496a5f={};var _0x33e1fe={'count':0x0,'rows':[]};return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x38b89c['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x51ea74,null))[_0x9ea2('0x38')](function(_0x57506a){if(_0x57506a){_0x496a5f[_0x9ea2('0x48')]=_[_0x9ea2('0x5d')](db['FaxMessage'][_0x9ea2('0x5c')]);_0x496a5f[_0x9ea2('0x47')]=_['keys'](_0x38b89c[_0x9ea2('0x47')]);_0x496a5f[_0x9ea2('0x51')]=_['intersection'](_0x496a5f['model'],_0x496a5f[_0x9ea2('0x47')]);_0x4dbab7[_0x9ea2('0x49')]=_[_0x9ea2('0x4a')](_0x496a5f[_0x9ea2('0x48')],qs[_0x9ea2('0x4b')](_0x38b89c[_0x9ea2('0x47')]['fields']));_0x4dbab7[_0x9ea2('0x49')]=_0x4dbab7[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x4dbab7[_0x9ea2('0x49')]:_0x496a5f[_0x9ea2('0x48')];if(!_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x4dbab7[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x31')]);_0x4dbab7[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x2f')]);}_0x4dbab7[_0x9ea2('0x4e')]=qs['sort'](_0x38b89c[_0x9ea2('0x47')]['sort']);_0x4dbab7[_0x9ea2('0x50')]=qs['filters'](_[_0x9ea2('0x52')](_0x38b89c['query'],_0x496a5f[_0x9ea2('0x51')]));_0x4dbab7['where']['FaxAccountId']=_0x57506a['id'];if(_0x38b89c['query'][_0x9ea2('0x54')]){_0x4dbab7['where']=_[_0x9ea2('0x53')](_0x4dbab7[_0x9ea2('0x50')],{'$or':_['map'](_0x4dbab7[_0x9ea2('0x49')],function(_0x4eb1c7){var _0x50b102={};_0x50b102[_0x4eb1c7]={'$like':'%'+_0x38b89c[_0x9ea2('0x47')]['filter']+'%'};return _0x50b102;})});}if(_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0xa6')]){var _0x4a7f07=_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0xa6')]['split'](',');var _0x5c9f56={};_0x5c9f56[_0x4a7f07[0x0]]={'$gte':moment(_0x4a7f07[0x1])[_0x9ea2('0xa7')](_0x9ea2('0xa8'))};_0x4dbab7[_0x9ea2('0x50')]=_['merge'](_0x4dbab7[_0x9ea2('0x50')],_0x5c9f56);}_0x4dbab7=_[_0x9ea2('0x53')]({},_0x4dbab7,_0x38b89c[_0x9ea2('0x55')]);return db[_0x9ea2('0xa9')][_0x9ea2('0x32')]({'where':_0x4dbab7[_0x9ea2('0x50')]})[_0x9ea2('0x38')](function(_0x143abd){_0x33e1fe[_0x9ea2('0x32')]=_0x143abd;if(_0x38b89c[_0x9ea2('0x47')][_0x9ea2('0x56')]){_0x4dbab7[_0x9ea2('0x57')]=[{'all':!![]}];}return db[_0x9ea2('0xa9')][_0x9ea2('0x58')](_0x4dbab7);})[_0x9ea2('0x38')](function(_0x42da60){_0x33e1fe['rows']=_0x42da60;return _0x33e1fe;});}})['then'](respondWithFilteredResult(_0x51ea74,_0x4dbab7))[_0x9ea2('0x2b')](handleError(_0x51ea74,null));};exports[_0x9ea2('0x3f')]=function(_0x4a8f3a,_0xd27033,_0x6a42da){var _0xe9aff7,_0x5d0109={},_0x43187b;if(_0x4a8f3a[_0x9ea2('0x60')]['to']){_0x43187b=_0x4a8f3a['body']['to'][0x0];}return db[_0x9ea2('0x43')][_0x9ea2('0x5e')]({'where':{'id':_0x4a8f3a[_0x9ea2('0x5b')]['id']},'include':[{'model':db[_0x9ea2('0xaa')],'as':_0x9ea2('0xab'),'include':[{'model':db['CmContact'],'as':_0x9ea2('0xac'),'where':{'fax':_0x43187b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x9ea2('0x38')](handleEntityNotFound(_0xd27033,null))[_0x9ea2('0x38')](function(_0x43d14a){_0xe9aff7=_0x43d14a;if(_0x4a8f3a['body'][_0x9ea2('0xad')]&&_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][_0x9ea2('0x4c')]){for(var _0x215111=0x0;_0x215111<_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][_0x9ea2('0x4c')];_0x215111+=0x1){_0x4a8f3a['body'][_0x9ea2('0xad')][_0x215111]={'filename':_0x4a8f3a['body'][_0x9ea2('0xad')][_0x215111][_0x9ea2('0x3e')],'id':_0x4a8f3a[_0x9ea2('0x60')]['attachments'][_0x215111]['id'],'path':path[_0x9ea2('0xae')](config[_0x9ea2('0xaf')],'server/files/attachments',_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][_0x215111][_0x9ea2('0xb0')])};}}return respondWithRpcPromise(_0x9ea2('0xb1'),_0x9ea2('0xb1'),{'FaxAccountId':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x5b')]['id'])?undefined:_0x4a8f3a[_0x9ea2('0x5b')]['id'],'path':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x60')]['attachments'][0x0][_0x9ea2('0xb3')])?undefined:_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][0x0][_0x9ea2('0xb3')],'fax':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0])?undefined:_0x4a8f3a['body']['to'][0x0]},client9002);})[_0x9ea2('0x38')](function(){if(_0xe9aff7){if(_['isNil'](_0x4a8f3a[_0x9ea2('0x60')]['from'])){_0x4a8f3a['body'][_0x9ea2('0xb4')]=util[_0x9ea2('0xa7')](_0x9ea2('0xb5'),_0xe9aff7[_0x9ea2('0x3e')],_0xe9aff7[_0x9ea2('0xb6')]);}if(_0xe9aff7[_0x9ea2('0xab')]){if(_0xe9aff7[_0x9ea2('0xab')][_0x9ea2('0xac')]['length']){return _0xe9aff7[_0x9ea2('0xab')][_0x9ea2('0xac')][0x0];}else{return db[_0x9ea2('0xb7')][_0x9ea2('0x5f')](_[_0x9ea2('0x1a')](_0x4a8f3a[_0x9ea2('0x60')],{'firstName':_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'phone':_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'fax':_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'ListId':_0xe9aff7[_0x9ea2('0xb8')]}));}}else{throw new Error(_0x9ea2('0xb9'));}}else{throw new Error(_0x9ea2('0xba'));}})[_0x9ea2('0x38')](function(_0x2ba120){if(_0x2ba120){return db[_0x9ea2('0x77')][_0x9ea2('0x5e')]({'where':{'ContactId':_0x2ba120['id'],'closed':![],'FaxAccountId':_0xe9aff7['id']}})['then'](function(_0x46a3f7){if(_0x46a3f7){return[_0x46a3f7,![]];}return db['FaxInteraction'][_0x9ea2('0x5f')]({'UserId':_0x4a8f3a[_0x9ea2('0x61')]['id'],'ContactId':_0x2ba120['id'],'FaxAccountId':_0xe9aff7['id'],'fax':_0x4a8f3a['body']['to'][0x0],'firstMsgDirection':_0x9ea2('0xbb'),'Messages':[_[_0x9ea2('0x53')](_0x4a8f3a[_0x9ea2('0x60')],{'read':![],'body':_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][0x0]['filename'],'FaxAccountId':_0xe9aff7['id'],'UserId':_0x4a8f3a[_0x9ea2('0x61')]['id'],'ContactId':_0x2ba120['id'],'AttachmentId':_0x4a8f3a['body'][_0x9ea2('0xad')][0x0]['id']})]},{'include':[{'model':db[_0x9ea2('0xa9')],'as':_0x9ea2('0xbc')}]})[_0x9ea2('0x38')](function(_0x2b9e82){return[_0x2b9e82,!![]];});});}else{throw new Error(_0x9ea2('0xbd'));}})[_0x9ea2('0xbe')](function(_0x3f3b9a,_0x2ebfed){if(_0x2ebfed){return _0x3f3b9a;}return db[_0x9ea2('0xa9')]['create']({'direction':_0x9ea2('0xbb'),'read':![],'body':_0x4a8f3a['body']['attachments'][0x0][_0x9ea2('0xbf')],'FaxAccountId':_0xe9aff7['id'],'FaxInteractionId':_0x3f3b9a['id'],'UserId':_0x4a8f3a[_0x9ea2('0x61')]['id'],'ContactId':_0x3f3b9a['ContactId'],'AttachmentId':_0x4a8f3a[_0x9ea2('0x60')][_0x9ea2('0xad')][0x0]['id']})[_0x9ea2('0x38')](function(_0x53ff23){_0x3f3b9a[_0x9ea2('0xc0')][_0x9ea2('0xbc')]=[];_0x3f3b9a[_0x9ea2('0xc0')]['Messages'][_0x9ea2('0x92')](_0x53ff23['dataValues']);return _0x3f3b9a;});})[_0x9ea2('0x38')](function(_0x4f5d0c){respondWithRpcPromise(_0x9ea2('0xc1'),_0x9ea2('0xc1'),{'FaxAccountId':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x5b')]['id'])?undefined:_0x4a8f3a['params']['id'],'path':_[_0x9ea2('0xb2')](_0x4a8f3a['body'][_0x9ea2('0xad')][0x0][_0x9ea2('0xb3')])?undefined:_0x4a8f3a['body'][_0x9ea2('0xad')][0x0][_0x9ea2('0xb3')],'fax':_[_0x9ea2('0xb2')](_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0])?undefined:_0x4a8f3a[_0x9ea2('0x60')]['to'][0x0],'AttachmentId':_0x4a8f3a[_0x9ea2('0x60')]['attachments'][0x0]['id']},client9002)['then'](function(_0x131012){logger[_0x9ea2('0x22')]('SendFaxRpc,\x20%s',_0x131012);})['catch'](function(_0x2bbe67){logger[_0x9ea2('0x22')](_0x9ea2('0xc2'),_0x2bbe67);});return _0x4f5d0c;})[_0x9ea2('0x38')](respondWithResult(_0xd27033,null))['catch'](handleError(_0xd27033,null));};exports['addAgents']=function(_0x16a584,_0x52cf68,_0x5b6799){return db['FaxAccount']['find']({'where':{'id':_0x16a584['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x52cf68,null))['then'](function(_0x5265ba){if(_0x5265ba){return _0x5265ba[_0x9ea2('0xc3')](_0x16a584['body'][_0x9ea2('0x71')],_[_0x9ea2('0x78')](_0x16a584[_0x9ea2('0x60')],[_0x9ea2('0x71'),'id'])||{})[_0x9ea2('0xbe')](function(_0x280d7e){for(var _0x87831=0x0;_0x87831<_0x16a584[_0x9ea2('0x60')][_0x9ea2('0x71')]['length'];_0x87831+=0x1){socket['emit'](_0x9ea2('0xc4'),{'UserId':Number(_0x16a584[_0x9ea2('0x60')]['ids'][_0x87831]),'FaxAccountId':Number(_0x16a584[_0x9ea2('0x5b')]['id'])});}return _0x280d7e;});}})[_0x9ea2('0x38')](respondWithResult(_0x52cf68,null))['catch'](handleError(_0x52cf68,null));};exports[_0x9ea2('0xc5')]=function(_0x3ca842,_0x1dad9f,_0x345f91){return db[_0x9ea2('0x43')]['find']({'where':{'id':_0x3ca842['params']['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x1dad9f,null))['then'](function(_0x10b659){if(_0x10b659){return _0x10b659[_0x9ea2('0xc5')](_0x3ca842['query'][_0x9ea2('0x71')])[_0x9ea2('0x38')](function(){if(_['isArray'](_0x3ca842[_0x9ea2('0x47')][_0x9ea2('0x71')])){for(var _0x32a774=0x0;_0x32a774<_0x3ca842[_0x9ea2('0x47')][_0x9ea2('0x71')][_0x9ea2('0x4c')];_0x32a774+=0x1){socket[_0x9ea2('0xc6')]('userFaxAccount:remove',{'UserId':Number(_0x3ca842[_0x9ea2('0x47')][_0x9ea2('0x71')][_0x32a774]),'FaxAccountId':Number(_0x3ca842[_0x9ea2('0x5b')]['id'])});}}else{socket[_0x9ea2('0xc6')]('userFaxAccount:remove',{'UserId':Number(_0x3ca842['query'][_0x9ea2('0x71')]),'FaxAccountId':Number(_0x3ca842['params']['id'])});}});}})[_0x9ea2('0x38')](respondWithStatusCode(_0x1dad9f,null))[_0x9ea2('0x2b')](handleError(_0x1dad9f,null));};exports[_0x9ea2('0xc7')]=function(_0x1fb5eb,_0x52c50b,_0x371cd1){var _0x567bcc={};var _0x1aa9dd={};var _0x24125c;var _0xfa20ba;return db[_0x9ea2('0x43')][_0x9ea2('0x6e')]({'where':{'id':_0x1fb5eb[_0x9ea2('0x5b')]['id']}})[_0x9ea2('0x38')](handleEntityNotFound(_0x52c50b,null))['then'](function(_0x340ff2){if(_0x340ff2){_0x24125c=_0x340ff2;_0x1aa9dd['model']=_[_0x9ea2('0x5d')](db['User'][_0x9ea2('0x5c')]);_0x1aa9dd[_0x9ea2('0x47')]=_['keys'](_0x1fb5eb['query']);_0x1aa9dd['filters']=_['intersection'](_0x1aa9dd[_0x9ea2('0x48')],_0x1aa9dd[_0x9ea2('0x47')]);_0x567bcc[_0x9ea2('0x49')]=_['intersection'](_0x1aa9dd[_0x9ea2('0x48')],qs['fields'](_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x4b')]));_0x567bcc[_0x9ea2('0x49')]=_0x567bcc[_0x9ea2('0x49')][_0x9ea2('0x4c')]?_0x567bcc['attributes']:_0x1aa9dd[_0x9ea2('0x48')];_0x567bcc['order']=qs['sort'](_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x4f')]);_0x567bcc['where']=qs[_0x9ea2('0x51')](_[_0x9ea2('0x52')](_0x1fb5eb[_0x9ea2('0x47')],_0x1aa9dd[_0x9ea2('0x51')]));if(_0x1fb5eb['query'][_0x9ea2('0x54')]){_0x567bcc['where']=_[_0x9ea2('0x53')](_0x567bcc[_0x9ea2('0x50')],{'$or':_[_0x9ea2('0x46')](_0x567bcc[_0x9ea2('0x49')],function(_0x484ade){var _0x2a9977={};_0x2a9977[_0x484ade]={'$like':'%'+_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x54')]+'%'};return _0x2a9977;})});}_0x567bcc=_[_0x9ea2('0x53')]({},_0x567bcc,_0x1fb5eb[_0x9ea2('0x55')]);return _0x24125c[_0x9ea2('0xc7')](_0x567bcc);}})['then'](function(_0x584d79){if(_0x584d79){_0xfa20ba=_0x584d79['length'];if(!_0x1fb5eb[_0x9ea2('0x47')][_0x9ea2('0x6f')](_0x9ea2('0x4d'))){_0x567bcc[_0x9ea2('0x31')]=qs[_0x9ea2('0x31')](_0x1fb5eb['query']['limit']);_0x567bcc[_0x9ea2('0x2f')]=qs[_0x9ea2('0x2f')](_0x1fb5eb[_0x9ea2('0x47')]['offset']);}return _0x24125c[_0x9ea2('0xc7')](_0x567bcc);}})[_0x9ea2('0x38')](function(_0x56a1b7){if(_0x56a1b7){return _0x56a1b7?{'count':_0xfa20ba,'rows':_0x56a1b7}:null;}})[_0x9ea2('0x38')](respondWithResult(_0x52c50b,null))[_0x9ea2('0x2b')](handleError(_0x52c50b,null));}; \ No newline at end of file +var _0xeba1=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','keys','find','create','body','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','hasOwnProperty','User','Owner','fullname','internal','color','tag','findAll','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','Set','gateway','faxdetect','maxrate','minrate','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','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','CmContact','Contacts','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','user','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x59b7ce,_0x2e0160){var _0x5c878a=function(_0x348342){while(--_0x348342){_0x59b7ce['push'](_0x59b7ce['shift']());}};_0x5c878a(++_0x2e0160);}(_0xeba1,0xb8));var _0x1eba=function(_0x3babbd,_0x540d72){_0x3babbd=_0x3babbd-0x0;var _0x5f3a22=_0xeba1[_0x3babbd];return _0x5f3a22;};'use strict';var emlformat=require(_0x1eba('0x0'));var rimraf=require(_0x1eba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1eba('0x2'));var rp=require(_0x1eba('0x3'));var moment=require(_0x1eba('0x4'));var BPromise=require(_0x1eba('0x5'));var Mustache=require(_0x1eba('0x6'));var util=require(_0x1eba('0x7'));var path=require(_0x1eba('0x8'));var sox=require('sox');var csv=require(_0x1eba('0x9'));var ejs=require(_0x1eba('0xa'));var fs=require('fs');var fs_extra=require(_0x1eba('0xb'));var _=require('lodash');var squel=require(_0x1eba('0xc'));var crypto=require(_0x1eba('0xd'));var jsforce=require(_0x1eba('0xe'));var deskjs=require(_0x1eba('0xf'));var toCsv=require(_0x1eba('0x9'));var querystring=require(_0x1eba('0x10'));var Papa=require(_0x1eba('0x11'));var Redis=require(_0x1eba('0x12'));var authService=require(_0x1eba('0x13'));var qs=require(_0x1eba('0x14'));var as=require(_0x1eba('0x15'));var hardwareService=require(_0x1eba('0x16'));var logger=require(_0x1eba('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x1eba('0x18'));var licenseUtil=require(_0x1eba('0x19'));var db=require(_0x1eba('0x1a'))['db'];config[_0x1eba('0x1b')]=_['defaults'](config['redis'],{'host':_0x1eba('0x1c'),'port':0x18eb});var socket=require(_0x1eba('0x1d'))(new Redis(config['redis']));require(_0x1eba('0x1e'))[_0x1eba('0x1f')](socket);var jayson=require(_0x1eba('0x20'));var client=jayson[_0x1eba('0x21')]['http']({'port':0x232c});var client9002=jayson[_0x1eba('0x21')][_0x1eba('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2b7322,_0xd01682,_0x48abee,_0x2b564a){return new BPromise(function(_0x2b5559,_0x400de7){var _0x34cc61=_0x2b564a||client;return _0x34cc61['request'](_0x2b7322,_0x48abee)[_0x1eba('0x23')](function(_0x32a6f4){logger[_0x1eba('0x24')](_0x1eba('0x25'),_0xd01682,'request\x20sent');logger[_0x1eba('0x26')](_0x1eba('0x27'),_0xd01682,_0x1eba('0x28'),JSON[_0x1eba('0x29')](_0x32a6f4));if(_0x32a6f4[_0x1eba('0x2a')]){if(_0x32a6f4['error'][_0x1eba('0x2b')]===0x1f4){logger['error'](_0x1eba('0x25'),_0xd01682,_0x32a6f4[_0x1eba('0x2a')][_0x1eba('0x2c')]);return _0x400de7(_0x32a6f4[_0x1eba('0x2a')][_0x1eba('0x2c')]);}logger[_0x1eba('0x2a')](_0x1eba('0x25'),_0xd01682,_0x32a6f4['error'][_0x1eba('0x2c')]);return _0x2b5559(_0x32a6f4[_0x1eba('0x2a')]['message']);}else{logger[_0x1eba('0x24')](_0x1eba('0x25'),_0xd01682,_0x1eba('0x28'));_0x2b5559(_0x32a6f4[_0x1eba('0x2d')][_0x1eba('0x2c')]);}})[_0x1eba('0x2e')](function(_0x11cfa0){logger[_0x1eba('0x2a')]('FaxAccount,\x20%s,\x20%s',_0xd01682,_0x11cfa0);_0x400de7(_0x11cfa0);});});}function respondWithStatusCode(_0x413c19,_0x3ed813){_0x3ed813=_0x3ed813||0xcc;return function(_0x586b21){if(_0x586b21){return _0x413c19['sendStatus'](_0x3ed813);}return _0x413c19[_0x1eba('0x2f')](_0x3ed813)[_0x1eba('0x30')]();};}function respondWithResult(_0x20d1e0,_0x59b67f){_0x59b67f=_0x59b67f||0xc8;return function(_0xc4f6a8){if(_0xc4f6a8){return _0x20d1e0[_0x1eba('0x2f')](_0x59b67f)[_0x1eba('0x31')](_0xc4f6a8);}};}function respondWithFilteredResult(_0x109828,_0x4e5f6b){return function(_0x1049f5){if(_0x1049f5){var _0x4f6b34=typeof _0x4e5f6b[_0x1eba('0x32')]===_0x1eba('0x33')&&typeof _0x4e5f6b[_0x1eba('0x34')]===_0x1eba('0x33');var _0x14a69c=_0x1049f5[_0x1eba('0x35')];var _0x53c4f1=_0x4f6b34?0x0:_0x4e5f6b['offset'];var _0x1789ff=_0x4f6b34?_0x1049f5[_0x1eba('0x35')]:_0x4e5f6b[_0x1eba('0x32')]+_0x4e5f6b['limit'];var _0x1fa462;if(_0x1789ff>=_0x14a69c){_0x1789ff=_0x14a69c;_0x1fa462=0xc8;}else{_0x1fa462=0xce;}_0x109828[_0x1eba('0x2f')](_0x1fa462);return _0x109828['set'](_0x1eba('0x36'),_0x53c4f1+'-'+_0x1789ff+'/'+_0x14a69c)[_0x1eba('0x31')](_0x1049f5);}return null;};}function patchUpdates(_0x4493bb){return function(_0x56b2b3){try{jsonpatch[_0x1eba('0x37')](_0x56b2b3,_0x4493bb,!![]);}catch(_0xa7491){return BPromise['reject'](_0xa7491);}return _0x56b2b3[_0x1eba('0x38')]();};}function saveUpdates(_0x33162a,_0x3aa3fe){return function(_0xcfb82e){if(_0xcfb82e){return _0xcfb82e[_0x1eba('0x39')](_0x33162a)[_0x1eba('0x23')](function(_0x505142){return _0x505142;});}return null;};}function removeEntity(_0x55beda,_0x3e1abe){return function(_0x31f4bd){if(_0x31f4bd){return _0x31f4bd[_0x1eba('0x3a')]()['then'](function(){var _0x5a019e=_0x31f4bd[_0x1eba('0x3b')]({'plain':!![]});var _0x5f22c7=_0x1eba('0x3c');return db[_0x1eba('0x3d')]['destroy']({'where':{'type':_0x5f22c7,'resourceId':_0x5a019e['id']}})[_0x1eba('0x23')](function(){return _0x31f4bd;});})[_0x1eba('0x23')](function(){_0x55beda['status'](0xcc)[_0x1eba('0x30')]();});}};}function handleEntityNotFound(_0x1f0491,_0x428a36){return function(_0x3e588d){if(!_0x3e588d){_0x1f0491[_0x1eba('0x3e')](0x194);}return _0x3e588d;};}function handleError(_0x1f3729,_0x252c47){_0x252c47=_0x252c47||0x1f4;return function(_0x4e00dc){logger[_0x1eba('0x2a')](_0x4e00dc[_0x1eba('0x3f')]);if(_0x4e00dc[_0x1eba('0x40')]){delete _0x4e00dc[_0x1eba('0x40')];}_0x1f3729['status'](_0x252c47)[_0x1eba('0x41')](_0x4e00dc);};}exports[_0x1eba('0x42')]=function(_0xae58b7,_0x51da15){var _0xe8aed6={'include':[{'model':db[_0x1eba('0x43')],'as':_0x1eba('0x44')}]},_0x404205={},_0x231883={'count':0x0,'rows':[]};var _0x111c4c=_[_0x1eba('0x45')](db[_0x1eba('0x46')][_0x1eba('0x47')],function(_0x543e77){return{'name':_0x543e77[_0x1eba('0x48')],'type':_0x543e77[_0x1eba('0x49')][_0x1eba('0x4a')]};});_0x404205[_0x1eba('0x4b')]=_[_0x1eba('0x45')](_0x111c4c,'name');_0x404205[_0x1eba('0x4c')]=_['keys'](_0xae58b7[_0x1eba('0x4c')]);_0x404205[_0x1eba('0x4d')]=_[_0x1eba('0x4e')](_0x404205[_0x1eba('0x4b')],_0x404205[_0x1eba('0x4c')]);_0xe8aed6[_0x1eba('0x4f')]=_[_0x1eba('0x4e')](_0x404205[_0x1eba('0x4b')],qs[_0x1eba('0x50')](_0xae58b7[_0x1eba('0x4c')][_0x1eba('0x50')]));_0xe8aed6[_0x1eba('0x4f')]=_0xe8aed6[_0x1eba('0x4f')][_0x1eba('0x51')]?_0xe8aed6['attributes']:_0x404205[_0x1eba('0x4b')];if(!_0xae58b7[_0x1eba('0x4c')]['hasOwnProperty'](_0x1eba('0x52'))){_0xe8aed6[_0x1eba('0x34')]=qs[_0x1eba('0x34')](_0xae58b7[_0x1eba('0x4c')]['limit']);_0xe8aed6[_0x1eba('0x32')]=qs[_0x1eba('0x32')](_0xae58b7[_0x1eba('0x4c')][_0x1eba('0x32')]);}_0xe8aed6[_0x1eba('0x53')]=qs[_0x1eba('0x54')](_0xae58b7['query'][_0x1eba('0x54')]);_0xe8aed6[_0x1eba('0x55')]=qs[_0x1eba('0x4d')](_[_0x1eba('0x56')](_0xae58b7[_0x1eba('0x4c')],_0x404205[_0x1eba('0x4d')]),_0x111c4c);if(_0xae58b7[_0x1eba('0x4c')][_0x1eba('0x57')]){_0xe8aed6['where']=_[_0x1eba('0x58')](_0xe8aed6['where'],{'$or':_['map'](_0x111c4c,function(_0x22877a){if(_0x22877a[_0x1eba('0x49')]!=='VIRTUAL'){var _0x4e836f={};_0x4e836f[_0x22877a[_0x1eba('0x40')]]={'$like':'%'+_0xae58b7['query'][_0x1eba('0x57')]+'%'};return _0x4e836f;}})});}_0xe8aed6=_[_0x1eba('0x58')]({},_0xe8aed6,_0xae58b7[_0x1eba('0x59')]);var _0x2e768d={'where':_0xe8aed6['where']};return db[_0x1eba('0x46')][_0x1eba('0x35')](_0x2e768d)[_0x1eba('0x23')](function(_0x2b49c9){_0x231883[_0x1eba('0x35')]=_0x2b49c9;if(_0xae58b7[_0x1eba('0x4c')][_0x1eba('0x5a')]){_0xe8aed6[_0x1eba('0x5b')]=[{'all':!![]}];}return db[_0x1eba('0x46')]['findAll'](_0xe8aed6);})[_0x1eba('0x23')](function(_0x3f6cf0){_0x231883[_0x1eba('0x5c')]=_0x3f6cf0;return _0x231883;})[_0x1eba('0x23')](respondWithFilteredResult(_0x51da15,_0xe8aed6))[_0x1eba('0x2e')](handleError(_0x51da15,null));};exports[_0x1eba('0x5d')]=function(_0x2a4485,_0x59ea59){var _0x42934e={'raw':![],'where':{'id':_0x2a4485['params']['id']},'include':[{'model':db[_0x1eba('0x43')],'as':_0x1eba('0x44')}]},_0x47f620={};_0x47f620[_0x1eba('0x4b')]=_[_0x1eba('0x5e')](db['FaxAccount'][_0x1eba('0x47')]);_0x47f620[_0x1eba('0x4c')]=_['keys'](_0x2a4485[_0x1eba('0x4c')]);_0x47f620[_0x1eba('0x4d')]=_[_0x1eba('0x4e')](_0x47f620['model'],_0x47f620[_0x1eba('0x4c')]);_0x42934e[_0x1eba('0x4f')]=_[_0x1eba('0x4e')](_0x47f620['model'],qs[_0x1eba('0x50')](_0x2a4485[_0x1eba('0x4c')]['fields']));_0x42934e[_0x1eba('0x4f')]=_0x42934e['attributes'][_0x1eba('0x51')]?_0x42934e[_0x1eba('0x4f')]:_0x47f620['model'];if(_0x2a4485[_0x1eba('0x4c')][_0x1eba('0x5a')]){_0x42934e[_0x1eba('0x5b')]=[{'all':!![]}];}_0x42934e=_[_0x1eba('0x58')]({},_0x42934e,_0x2a4485[_0x1eba('0x59')]);return db['FaxAccount'][_0x1eba('0x5f')](_0x42934e)[_0x1eba('0x23')](handleEntityNotFound(_0x59ea59,null))[_0x1eba('0x23')](respondWithResult(_0x59ea59,null))['catch'](handleError(_0x59ea59,null));};exports[_0x1eba('0x60')]=function(_0x560215,_0x5e2d52){return db[_0x1eba('0x46')][_0x1eba('0x60')](_0x560215[_0x1eba('0x61')],{})[_0x1eba('0x23')](function(_0x5cd0b9){var _0x395622=_0x560215['user'][_0x1eba('0x3b')]({'plain':!![]});if(!_0x395622)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x395622[_0x1eba('0x62')]==='user'){var _0x2ee008=_0x5cd0b9[_0x1eba('0x3b')]({'plain':!![]});var _0x1d2c34='FaxAccounts';return db[_0x1eba('0x63')][_0x1eba('0x5f')]({'where':{'name':_0x1d2c34,'userProfileId':_0x395622['userProfileId']},'raw':!![]})[_0x1eba('0x23')](function(_0x38831f){if(_0x38831f&&_0x38831f[_0x1eba('0x64')]===0x0){return db[_0x1eba('0x3d')][_0x1eba('0x60')]({'name':_0x2ee008['name'],'resourceId':_0x2ee008['id'],'type':_0x38831f[_0x1eba('0x40')],'sectionId':_0x38831f['id']},{})[_0x1eba('0x23')](function(){return _0x5cd0b9;});}else{return _0x5cd0b9;}})[_0x1eba('0x2e')](function(_0xa8e9eb){logger['error'](_0x1eba('0x65'),_0xa8e9eb);throw _0xa8e9eb;});}return _0x5cd0b9;})['then'](respondWithResult(_0x5e2d52,0xc9))[_0x1eba('0x2e')](handleError(_0x5e2d52,null));};exports[_0x1eba('0x39')]=function(_0x529b4c,_0x2b6f04){if(_0x529b4c[_0x1eba('0x61')]['id']){delete _0x529b4c['body']['id'];}return db[_0x1eba('0x46')][_0x1eba('0x5f')]({'where':{'id':_0x529b4c['params']['id']},'include':[{'model':db[_0x1eba('0x43')],'as':_0x1eba('0x44')}]})[_0x1eba('0x23')](handleEntityNotFound(_0x2b6f04,null))[_0x1eba('0x23')](saveUpdates(_0x529b4c[_0x1eba('0x61')],null))[_0x1eba('0x23')](respondWithResult(_0x2b6f04,null))[_0x1eba('0x2e')](handleError(_0x2b6f04,null));};exports[_0x1eba('0x3a')]=function(_0x1d6ecd,_0x15502c){return db[_0x1eba('0x46')]['find']({'where':{'id':_0x1d6ecd[_0x1eba('0x66')]['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x15502c,null))[_0x1eba('0x23')](removeEntity(_0x15502c,null))[_0x1eba('0x2e')](handleError(_0x15502c,null));};exports[_0x1eba('0x67')]=function(_0x44bd96,_0x1c7063){return db[_0x1eba('0x46')][_0x1eba('0x67')]()[_0x1eba('0x23')](respondWithResult(_0x1c7063,null))['catch'](handleError(_0x1c7063,null));};exports[_0x1eba('0x68')]=function(_0x24159b,_0x3b9418,_0x3d7a75){if(_0x24159b[_0x1eba('0x61')]['id']){delete _0x24159b['body']['id'];}return db[_0x1eba('0x46')][_0x1eba('0x5f')]({'where':{'id':_0x24159b['params']['id']}})['then'](handleEntityNotFound(_0x3b9418,null))['then'](function(_0x287da6){if(_0x287da6){_0x24159b[_0x1eba('0x61')][_0x1eba('0x69')]=_0x287da6['id'];return db[_0x1eba('0x6a')][_0x1eba('0x60')](_0x24159b[_0x1eba('0x61')]);}})['then'](respondWithResult(_0x3b9418,null))[_0x1eba('0x2e')](handleError(_0x3b9418,null));};exports[_0x1eba('0x6b')]=function(_0x47d062,_0x3c767a,_0x4b0c98){var _0x3f858f={'raw':![],'where':{}};var _0x55e09={};var _0x190ff7={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1eba('0x6c')]({'where':{'id':_0x47d062[_0x1eba('0x66')]['id']}})['then'](handleEntityNotFound(_0x3c767a,null))[_0x1eba('0x23')](function(_0x5bdf1a){if(_0x5bdf1a){_0x55e09['model']=_[_0x1eba('0x5e')](db['Disposition'][_0x1eba('0x47')]);_0x55e09[_0x1eba('0x4c')]=_['keys'](_0x47d062['query']);_0x55e09[_0x1eba('0x4d')]=_[_0x1eba('0x4e')](_0x55e09[_0x1eba('0x4b')],_0x55e09[_0x1eba('0x4c')]);_0x3f858f[_0x1eba('0x4f')]=_[_0x1eba('0x4e')](_0x55e09['model'],qs[_0x1eba('0x50')](_0x47d062[_0x1eba('0x4c')]['fields']));_0x3f858f[_0x1eba('0x4f')]=_0x3f858f['attributes']['length']?_0x3f858f['attributes']:_0x55e09['model'];if(!_0x47d062[_0x1eba('0x4c')]['hasOwnProperty'](_0x1eba('0x52'))){_0x3f858f[_0x1eba('0x34')]=qs['limit'](_0x47d062[_0x1eba('0x4c')][_0x1eba('0x34')]);_0x3f858f[_0x1eba('0x32')]=qs[_0x1eba('0x32')](_0x47d062[_0x1eba('0x4c')][_0x1eba('0x32')]);}_0x3f858f[_0x1eba('0x53')]=qs[_0x1eba('0x54')](_0x47d062['query'][_0x1eba('0x54')]);_0x3f858f[_0x1eba('0x55')]=qs[_0x1eba('0x4d')](_[_0x1eba('0x56')](_0x47d062[_0x1eba('0x4c')],_0x55e09[_0x1eba('0x4d')]));_0x3f858f['where'][_0x1eba('0x69')]=_0x5bdf1a['id'];if(_0x47d062[_0x1eba('0x4c')][_0x1eba('0x57')]){_0x3f858f[_0x1eba('0x55')]=_[_0x1eba('0x58')](_0x3f858f[_0x1eba('0x55')],{'$or':_['map'](_0x3f858f['attributes'],function(_0x47cda3){var _0x1f0a3b={};_0x1f0a3b[_0x47cda3]={'$like':'%'+_0x47d062[_0x1eba('0x4c')][_0x1eba('0x57')]+'%'};return _0x1f0a3b;})});}_0x3f858f=_[_0x1eba('0x58')]({},_0x3f858f,_0x47d062[_0x1eba('0x59')]);return db[_0x1eba('0x6a')][_0x1eba('0x35')]({'where':_0x3f858f[_0x1eba('0x55')]})[_0x1eba('0x23')](function(_0x2c2070){_0x190ff7['count']=_0x2c2070;if(_0x47d062[_0x1eba('0x4c')][_0x1eba('0x5a')]){_0x3f858f[_0x1eba('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3f858f);})[_0x1eba('0x23')](function(_0xa56bf9){_0x190ff7[_0x1eba('0x5c')]=_0xa56bf9;return _0x190ff7;});}})[_0x1eba('0x23')](respondWithFilteredResult(_0x3c767a,_0x3f858f))[_0x1eba('0x2e')](handleError(_0x3c767a,null));};exports[_0x1eba('0x6d')]=function(_0x25b131,_0x2ef10a,_0x3407a5){return db[_0x1eba('0x46')]['find']({'where':{'id':_0x25b131['params']['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x2ef10a,null))['then'](function(_0x39012b){if(_0x39012b){return _0x39012b[_0x1eba('0x6d')](_0x25b131[_0x1eba('0x4c')][_0x1eba('0x6e')]);}})[_0x1eba('0x23')](respondWithStatusCode(_0x2ef10a,null))[_0x1eba('0x2e')](handleError(_0x2ef10a,null));};exports[_0x1eba('0x6f')]=function(_0x144597,_0x1a789a,_0x59fa51){if(_0x144597[_0x1eba('0x61')]['id']){delete _0x144597[_0x1eba('0x61')]['id'];}return db[_0x1eba('0x46')][_0x1eba('0x5f')]({'where':{'id':_0x144597[_0x1eba('0x66')]['id']}})['then'](handleEntityNotFound(_0x1a789a,null))[_0x1eba('0x23')](function(_0x35f01c){if(_0x35f01c){_0x144597['body'][_0x1eba('0x69')]=_0x35f01c['id'];return db[_0x1eba('0x70')][_0x1eba('0x60')](_0x144597[_0x1eba('0x61')]);}})[_0x1eba('0x23')](respondWithResult(_0x1a789a,null))[_0x1eba('0x2e')](handleError(_0x1a789a,null));};exports[_0x1eba('0x71')]=function(_0x42863b,_0x408bf2,_0x58f1b9){var _0x26ba82={'raw':![],'where':{}};var _0x304149={};var _0x3d1f87={'count':0x0,'rows':[]};return db[_0x1eba('0x46')][_0x1eba('0x6c')]({'where':{'id':_0x42863b[_0x1eba('0x66')]['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x408bf2,null))[_0x1eba('0x23')](function(_0x4a821f){if(_0x4a821f){_0x304149['model']=_[_0x1eba('0x5e')](db[_0x1eba('0x70')][_0x1eba('0x47')]);_0x304149['query']=_['keys'](_0x42863b[_0x1eba('0x4c')]);_0x304149[_0x1eba('0x4d')]=_[_0x1eba('0x4e')](_0x304149[_0x1eba('0x4b')],_0x304149['query']);_0x26ba82[_0x1eba('0x4f')]=_[_0x1eba('0x4e')](_0x304149[_0x1eba('0x4b')],qs[_0x1eba('0x50')](_0x42863b[_0x1eba('0x4c')][_0x1eba('0x50')]));_0x26ba82['attributes']=_0x26ba82[_0x1eba('0x4f')][_0x1eba('0x51')]?_0x26ba82[_0x1eba('0x4f')]:_0x304149['model'];if(!_0x42863b[_0x1eba('0x4c')]['hasOwnProperty']('nolimit')){_0x26ba82[_0x1eba('0x34')]=qs['limit'](_0x42863b[_0x1eba('0x4c')][_0x1eba('0x34')]);_0x26ba82[_0x1eba('0x32')]=qs[_0x1eba('0x32')](_0x42863b[_0x1eba('0x4c')][_0x1eba('0x32')]);}_0x26ba82[_0x1eba('0x53')]=qs[_0x1eba('0x54')](_0x42863b[_0x1eba('0x4c')][_0x1eba('0x54')]);_0x26ba82[_0x1eba('0x55')]=qs['filters'](_['pick'](_0x42863b['query'],_0x304149['filters']));_0x26ba82[_0x1eba('0x55')][_0x1eba('0x69')]=_0x4a821f['id'];if(_0x42863b[_0x1eba('0x4c')]['filter']){_0x26ba82[_0x1eba('0x55')]=_[_0x1eba('0x58')](_0x26ba82[_0x1eba('0x55')],{'$or':_[_0x1eba('0x45')](_0x26ba82[_0x1eba('0x4f')],function(_0x25e67e){var _0x3561e3={};_0x3561e3[_0x25e67e]={'$like':'%'+_0x42863b[_0x1eba('0x4c')][_0x1eba('0x57')]+'%'};return _0x3561e3;})});}_0x26ba82=_[_0x1eba('0x58')]({},_0x26ba82,_0x42863b[_0x1eba('0x59')]);return db[_0x1eba('0x70')][_0x1eba('0x35')]({'where':_0x26ba82[_0x1eba('0x55')]})[_0x1eba('0x23')](function(_0x2dd565){_0x3d1f87[_0x1eba('0x35')]=_0x2dd565;if(_0x42863b[_0x1eba('0x4c')][_0x1eba('0x5a')]){_0x26ba82[_0x1eba('0x5b')]=[{'all':!![]}];}return db[_0x1eba('0x70')]['findAll'](_0x26ba82);})[_0x1eba('0x23')](function(_0x2f2bd0){_0x3d1f87[_0x1eba('0x5c')]=_0x2f2bd0;return _0x3d1f87;});}})[_0x1eba('0x23')](respondWithFilteredResult(_0x408bf2,_0x26ba82))[_0x1eba('0x2e')](handleError(_0x408bf2,null));};exports[_0x1eba('0x72')]=function(_0x1168d9,_0x47db91,_0x30afc4){return db[_0x1eba('0x46')][_0x1eba('0x5f')]({'where':{'id':_0x1168d9['params']['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x47db91,null))['then'](function(_0x4f7812){if(_0x4f7812){return _0x4f7812['removeAnswers'](_0x1168d9[_0x1eba('0x4c')][_0x1eba('0x6e')]);}})['then'](respondWithStatusCode(_0x47db91,null))['catch'](handleError(_0x47db91,null));};exports[_0x1eba('0x73')]=function(_0x5ba892,_0x3a659b,_0xa48fed){return db[_0x1eba('0x74')][_0x1eba('0x5f')]({'where':{'id':_0x5ba892[_0x1eba('0x66')]['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x3a659b,null))['then'](function(_0xc48067){if(_0xc48067){return _0xc48067[_0x1eba('0x73')](_0x5ba892[_0x1eba('0x61')][_0x1eba('0x6e')],_[_0x1eba('0x75')](_0x5ba892[_0x1eba('0x61')],[_0x1eba('0x6e'),'id'])||{});}})[_0x1eba('0x23')](respondWithResult(_0x3a659b,null))[_0x1eba('0x2e')](handleError(_0x3a659b,null));};exports[_0x1eba('0x76')]=function(_0x3d2816,_0x226a88,_0x196e63){var _0x2fb90c={'raw':![],'where':{}};var _0x473ced={};var _0x15e86a={'count':0x0,'rows':[]};return db[_0x1eba('0x46')][_0x1eba('0x6c')]({'where':{'id':_0x3d2816[_0x1eba('0x66')]['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x226a88,null))[_0x1eba('0x23')](function(_0x559996){if(_0x559996){_0x473ced['model']=_[_0x1eba('0x5e')](db['FaxInteraction'][_0x1eba('0x47')]);_0x473ced[_0x1eba('0x4c')]=_[_0x1eba('0x5e')](_0x3d2816[_0x1eba('0x4c')]);_0x473ced[_0x1eba('0x4d')]=_[_0x1eba('0x4e')](_0x473ced[_0x1eba('0x4b')],_0x473ced[_0x1eba('0x4c')]);_0x2fb90c[_0x1eba('0x4f')]=_['intersection'](_0x473ced[_0x1eba('0x4b')],qs[_0x1eba('0x50')](_0x3d2816[_0x1eba('0x4c')]['fields']));_0x2fb90c[_0x1eba('0x4f')]=_0x2fb90c['attributes'][_0x1eba('0x51')]?_0x2fb90c['attributes']:_0x473ced[_0x1eba('0x4b')];if(!_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x77')]('nolimit')){_0x2fb90c['limit']=qs[_0x1eba('0x34')](_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x34')]);_0x2fb90c['offset']=qs['offset'](_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x32')]);}_0x2fb90c['order']=qs[_0x1eba('0x54')](_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x54')]);_0x2fb90c[_0x1eba('0x55')]=qs[_0x1eba('0x4d')](_['pick'](_0x3d2816['query'],_0x473ced[_0x1eba('0x4d')]));_0x2fb90c[_0x1eba('0x55')][_0x1eba('0x69')]=_0x559996['id'];if(_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x57')]){_0x2fb90c[_0x1eba('0x55')]=_['merge'](_0x2fb90c[_0x1eba('0x55')],{'$or':_[_0x1eba('0x45')](_0x2fb90c[_0x1eba('0x4f')],function(_0xbc4596){var _0x559357={};_0x559357[_0xbc4596]={'$like':'%'+_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x57')]+'%'};return _0x559357;})});}_0x2fb90c=_['merge']({},_0x2fb90c,_0x3d2816[_0x1eba('0x59')]);return db[_0x1eba('0x74')]['count']({'where':_0x2fb90c[_0x1eba('0x55')]})[_0x1eba('0x23')](function(_0x40c14d){_0x15e86a['count']=_0x40c14d;if(_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x5a')]){_0x2fb90c['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x1eba('0x78')],'as':_0x1eba('0x79'),'attributes':[_0x1eba('0x40'),_0x1eba('0x7a'),_0x1eba('0x7b')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x1eba('0x7c')],'where':_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x7d')]?{'id':_0x3d2816[_0x1eba('0x4c')][_0x1eba('0x7d')]}:undefined,'required':_0x3d2816[_0x1eba('0x4c')]['tag']?!![]:![]}];}return db[_0x1eba('0x74')][_0x1eba('0x7e')](_0x2fb90c);})[_0x1eba('0x23')](function(_0x5eeb1c){_0x15e86a['rows']=_0x5eeb1c;return _0x15e86a;});}})[_0x1eba('0x23')](respondWithFilteredResult(_0x226a88,_0x2fb90c))[_0x1eba('0x2e')](handleError(_0x226a88,null));};exports['addApplications']=function(_0x33d893,_0x4e663d){var _0xb85f3=_0x33d893[_0x1eba('0x66')]['id'];var _0x2afba3=_0x33d893['body'];var _0x377658=0xc8;var _0x48b4d9=null;return db[_0x1eba('0x7f')][_0x1eba('0x80')]({'isolationLevel':db['sequelize'][_0x1eba('0x81')][_0x1eba('0x82')][_0x1eba('0x83')]},function(_0x4357b8){return db[_0x1eba('0x46')][_0x1eba('0x6c')]({'where':{'id':_0xb85f3},'transaction':_0x4357b8})[_0x1eba('0x23')](function(_0x47eb59){if(_0x47eb59){return db[_0x1eba('0x84')][_0x1eba('0x3a')]({'where':{'FaxAccountId':_0xb85f3},'transaction':_0x4357b8})[_0x1eba('0x23')](function(){var _0x2e9ddb=_['map'](_0x2afba3,function(_0x528078){_0x528078['FaxAccountId']=_0xb85f3;return _0x528078;});return db['FaxApplication'][_0x1eba('0x85')](_0x2e9ddb,{'transaction':_0x4357b8});});}else{_0x377658=0x194;_0x48b4d9=[];}});})[_0x1eba('0x23')](function(){if(_0x377658!==0x194){return db[_0x1eba('0x84')][_0x1eba('0x86')]({'where':{'FaxAccountId':_0xb85f3},'order':_0x1eba('0x87')})[_0x1eba('0x23')](function(_0x49b8b4){_0x48b4d9=_0x49b8b4;});}})['catch'](function(_0x34f9da){_0x377658=0x1f4;logger[_0x1eba('0x2a')](_0x34f9da['stack']);if(_0x34f9da[_0x1eba('0x40')]){delete _0x34f9da[_0x1eba('0x40')];}_0x48b4d9=_0x34f9da;})[_0x1eba('0x88')](function(){if(_0x48b4d9===null){_0x4e663d[_0x1eba('0x3e')](_0x377658);}else{if(_0x377658===0x1f4){_0x4e663d['status'](_0x377658)['send'](_0x48b4d9);}else{_0x4e663d[_0x1eba('0x2f')](_0x377658)[_0x1eba('0x31')](_0x48b4d9);}}});};exports[_0x1eba('0x89')]=function(_0x5cb413,_0x1eed4d,_0x3e1253){var _0x5d4a1e={};var _0x35f5fb={};var _0x36fbd7;var _0x5b563f;return db[_0x1eba('0x46')]['findOne']({'where':{'id':_0x5cb413['params']['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x1eed4d,null))[_0x1eba('0x23')](function(_0x102d3e){if(_0x102d3e){_0x36fbd7=_0x102d3e;_0x35f5fb[_0x1eba('0x4b')]=_[_0x1eba('0x5e')](db[_0x1eba('0x84')][_0x1eba('0x47')]);_0x35f5fb[_0x1eba('0x4c')]=_[_0x1eba('0x5e')](_0x5cb413[_0x1eba('0x4c')]);_0x35f5fb[_0x1eba('0x4d')]=_['intersection'](_0x35f5fb['model'],_0x35f5fb[_0x1eba('0x4c')]);_0x5d4a1e['attributes']=_['intersection'](_0x35f5fb['model'],qs[_0x1eba('0x50')](_0x5cb413[_0x1eba('0x4c')][_0x1eba('0x50')]));_0x5d4a1e['attributes']=_0x5d4a1e[_0x1eba('0x4f')]['length']?_0x5d4a1e[_0x1eba('0x4f')]:_0x35f5fb[_0x1eba('0x4b')];_0x5d4a1e['order']=qs[_0x1eba('0x54')](_0x5cb413[_0x1eba('0x4c')]['sort']);_0x5d4a1e[_0x1eba('0x55')]=qs[_0x1eba('0x4d')](_[_0x1eba('0x56')](_0x5cb413[_0x1eba('0x4c')],_0x35f5fb['filters']));if(_0x5cb413[_0x1eba('0x4c')][_0x1eba('0x57')]){_0x5d4a1e[_0x1eba('0x55')]=_['merge'](_0x5d4a1e['where'],{'$or':_[_0x1eba('0x45')](_0x5d4a1e['attributes'],function(_0x20b21d){var _0x416ed1={};_0x416ed1[_0x20b21d]={'$like':'%'+_0x5cb413[_0x1eba('0x4c')][_0x1eba('0x57')]+'%'};return _0x416ed1;})});}_0x5d4a1e=_['merge']({},_0x5d4a1e,_0x5cb413[_0x1eba('0x59')]);return _0x36fbd7[_0x1eba('0x89')](_0x5d4a1e);}})[_0x1eba('0x23')](function(_0x37d6f3){if(_0x37d6f3){_0x5b563f=_0x37d6f3[_0x1eba('0x51')];if(!_0x5cb413[_0x1eba('0x4c')][_0x1eba('0x77')](_0x1eba('0x52'))){_0x5d4a1e[_0x1eba('0x34')]=qs[_0x1eba('0x34')](_0x5cb413[_0x1eba('0x4c')]['limit']);_0x5d4a1e[_0x1eba('0x32')]=qs[_0x1eba('0x32')](_0x5cb413[_0x1eba('0x4c')][_0x1eba('0x32')]);}return _0x36fbd7[_0x1eba('0x89')](_0x5d4a1e);}})[_0x1eba('0x23')](function(_0x18514f){if(_0x18514f){return _0x18514f?{'count':_0x5b563f,'rows':_0x18514f}:null;}})[_0x1eba('0x23')](respondWithResult(_0x1eed4d,null))[_0x1eba('0x2e')](handleError(_0x1eed4d,null));};function Extension(_0x2180a1,_0xb12fd9,_0x3f8300,_0x1562e7){this['context']=_0x1eba('0x8a');this[_0x1eba('0x8b')]=_0x2180a1[_0x1eba('0x8c')];this[_0x1eba('0x8d')]=_0x1562e7;this['type']=_0x1eba('0x8e');this['description']=_0x1eba('0x8f');this['FaxAccountId']=_0x2180a1['id'];this['priority']=_0xb12fd9;this[_0x1eba('0x90')]=_0x3f8300;}function createExtensionsReciveFax(_0x51c711){var _0x346d7f=0x1;var _0x37d24a=[];_0x37d24a[_0x1eba('0x91')](new Extension(_0x51c711,_0x346d7f,'',_0x1eba('0x92')));_0x346d7f+=0x1;_0x37d24a['push'](new Extension(_0x51c711,_0x346d7f,'CDR(type)=inbound-fax',_0x1eba('0x93')));_0x346d7f+=0x1;for(var _0x3df33b in _0x51c711){if(_0x51c711[_0x1eba('0x77')](_0x3df33b)&&(_0x3df33b==='ecm'||_0x3df33b===_0x1eba('0x8c')||_0x3df33b===_0x1eba('0x94')||_0x3df33b===_0x1eba('0x95')||_0x3df33b==='headerinfo'||_0x3df33b===_0x1eba('0x96')||_0x3df33b===_0x1eba('0x97')||_0x3df33b==='modem'||_0x3df33b===_0x1eba('0x98'))){_0x37d24a[_0x1eba('0x91')](new Extension(_0x51c711,_0x346d7f,_0x1eba('0x99')+_0x3df33b+')='+_0x51c711[_0x3df33b],_0x1eba('0x93')));_0x346d7f+=0x1;}}_0x37d24a[_0x1eba('0x91')](new Extension(_0x51c711,_0x346d7f,'6',_0x1eba('0x9a')));_0x346d7f+=0x1;_0x37d24a[_0x1eba('0x91')](new Extension(_0x51c711,_0x346d7f,_0x1eba('0x9b'),_0x1eba('0x9c')));_0x346d7f=0x0;return _0x37d24a;}exports[_0x1eba('0x9d')]=function(_0x5dae26,_0x4ebf69,_0x3fef4b){var _0x4d2494;return db[_0x1eba('0x7f')][_0x1eba('0x80')](function(_0x59e393){return db['FaxAccount'][_0x1eba('0x60')](_0x5dae26[_0x1eba('0x61')],{'transaction':_0x59e393})['then'](function(_0x172c3c){_0x4d2494=_0x172c3c[_0x1eba('0x3b')]({'plain':!![]});return db[_0x1eba('0x9e')]['bulkCreate'](createExtensionsReciveFax(_0x4d2494),{'transaction':_0x59e393});});})['then'](function(){return _0x4d2494;})[_0x1eba('0x23')](respondWithResult(_0x4ebf69,null))[_0x1eba('0x2e')](handleError(_0x4ebf69,null));};exports[_0x1eba('0x9f')]=function(_0x33dce9,_0xf79f26,_0x29541d){var _0x5c0f61;return db[_0x1eba('0x7f')][_0x1eba('0x80')](function(_0x157dff){return db['FaxAccount'][_0x1eba('0x39')](_0x33dce9[_0x1eba('0x61')],{'where':{'id':_0x33dce9[_0x1eba('0x61')]['id']},'transaction':_0x157dff})[_0x1eba('0x23')](function(_0x251a38){return db[_0x1eba('0x9e')][_0x1eba('0x3a')]({'where':{'FaxAccountId':_0x33dce9[_0x1eba('0x61')]['id']},'transaction':_0x157dff})['then'](function(_0x1ffca3){return db['VoiceExtension'][_0x1eba('0x85')](createExtensionsReciveFax(_['omit'](_0x33dce9[_0x1eba('0x61')],[_0x1eba('0xa0'),'key',_0x1eba('0xa1'),_0x1eba('0xa2'),'TrunkId',_0x1eba('0xa3')])),{'transaction':_0x157dff});});});})[_0x1eba('0x23')](function(){return db['FaxAccount']['findById'](_0x33dce9[_0x1eba('0x61')]['id']);})[_0x1eba('0x23')](respondWithResult(_0xf79f26,null))[_0x1eba('0x2e')](handleError(_0xf79f26,null));};exports[_0x1eba('0xa4')]=function(_0x2e3848,_0x367ce9,_0xf80ce5){var _0x357281={'raw':!![],'where':{}};var _0x1232e4={};var _0x2e1db9={'count':0x0,'rows':[]};return db[_0x1eba('0x46')]['findOne']({'where':{'id':_0x2e3848[_0x1eba('0x66')]['id']}})['then'](handleEntityNotFound(_0x367ce9,null))[_0x1eba('0x23')](function(_0x40f9f8){if(_0x40f9f8){_0x1232e4['model']=_[_0x1eba('0x5e')](db['FaxMessage'][_0x1eba('0x47')]);_0x1232e4[_0x1eba('0x4c')]=_[_0x1eba('0x5e')](_0x2e3848[_0x1eba('0x4c')]);_0x1232e4['filters']=_[_0x1eba('0x4e')](_0x1232e4[_0x1eba('0x4b')],_0x1232e4[_0x1eba('0x4c')]);_0x357281['attributes']=_[_0x1eba('0x4e')](_0x1232e4['model'],qs[_0x1eba('0x50')](_0x2e3848[_0x1eba('0x4c')][_0x1eba('0x50')]));_0x357281[_0x1eba('0x4f')]=_0x357281['attributes'][_0x1eba('0x51')]?_0x357281[_0x1eba('0x4f')]:_0x1232e4[_0x1eba('0x4b')];if(!_0x2e3848[_0x1eba('0x4c')][_0x1eba('0x77')](_0x1eba('0x52'))){_0x357281[_0x1eba('0x34')]=qs['limit'](_0x2e3848[_0x1eba('0x4c')][_0x1eba('0x34')]);_0x357281[_0x1eba('0x32')]=qs['offset'](_0x2e3848[_0x1eba('0x4c')][_0x1eba('0x32')]);}_0x357281['order']=qs[_0x1eba('0x54')](_0x2e3848[_0x1eba('0x4c')][_0x1eba('0x54')]);_0x357281['where']=qs[_0x1eba('0x4d')](_[_0x1eba('0x56')](_0x2e3848[_0x1eba('0x4c')],_0x1232e4[_0x1eba('0x4d')]));_0x357281[_0x1eba('0x55')][_0x1eba('0x69')]=_0x40f9f8['id'];if(_0x2e3848[_0x1eba('0x4c')][_0x1eba('0x57')]){_0x357281['where']=_[_0x1eba('0x58')](_0x357281[_0x1eba('0x55')],{'$or':_[_0x1eba('0x45')](_0x357281[_0x1eba('0x4f')],function(_0x29d87f){var _0x3bc7f1={};_0x3bc7f1[_0x29d87f]={'$like':'%'+_0x2e3848[_0x1eba('0x4c')]['filter']+'%'};return _0x3bc7f1;})});}if(_0x2e3848[_0x1eba('0x4c')][_0x1eba('0xa5')]){var _0xb255ef=_0x2e3848[_0x1eba('0x4c')][_0x1eba('0xa5')]['split'](',');var _0x6dedb4={};_0x6dedb4[_0xb255ef[0x0]]={'$gte':moment(_0xb255ef[0x1])[_0x1eba('0xa6')](_0x1eba('0xa7'))};_0x357281[_0x1eba('0x55')]=_[_0x1eba('0x58')](_0x357281[_0x1eba('0x55')],_0x6dedb4);}_0x357281=_[_0x1eba('0x58')]({},_0x357281,_0x2e3848[_0x1eba('0x59')]);return db[_0x1eba('0xa8')]['count']({'where':_0x357281[_0x1eba('0x55')]})[_0x1eba('0x23')](function(_0x43e4f5){_0x2e1db9[_0x1eba('0x35')]=_0x43e4f5;if(_0x2e3848['query']['includeAll']){_0x357281['include']=[{'all':!![]}];}return db['FaxMessage'][_0x1eba('0x7e')](_0x357281);})[_0x1eba('0x23')](function(_0x42456a){_0x2e1db9[_0x1eba('0x5c')]=_0x42456a;return _0x2e1db9;});}})[_0x1eba('0x23')](respondWithFilteredResult(_0x367ce9,_0x357281))[_0x1eba('0x2e')](handleError(_0x367ce9,null));};exports[_0x1eba('0x41')]=function(_0x31f2df,_0x77485e,_0x1c110d){var _0x4966c7,_0x12f95b={},_0x31c11e;if(_0x31f2df['body']['to']){_0x31c11e=_0x31f2df[_0x1eba('0x61')]['to'][0x0];}return db[_0x1eba('0x46')][_0x1eba('0x5f')]({'where':{'id':_0x31f2df['params']['id']},'include':[{'model':db[_0x1eba('0xa9')],'as':_0x1eba('0xaa'),'include':[{'model':db[_0x1eba('0xab')],'as':_0x1eba('0xac'),'where':{'fax':_0x31c11e},'limit':0x1,'order':[[_0x1eba('0xa2'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x77485e,null))['then'](function(_0x3a4828){_0x4966c7=_0x3a4828;if(_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')]&&_0x31f2df[_0x1eba('0x61')]['attachments'][_0x1eba('0x51')]){for(var _0x1ac1d0=0x0;_0x1ac1d0<_0x31f2df['body'][_0x1eba('0xad')]['length'];_0x1ac1d0+=0x1){_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')][_0x1ac1d0]={'filename':_0x31f2df['body'][_0x1eba('0xad')][_0x1ac1d0]['name'],'id':_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')][_0x1ac1d0]['id'],'path':path[_0x1eba('0xae')](config[_0x1eba('0xaf')],_0x1eba('0xb0'),_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')][_0x1ac1d0]['basename'])};}}return respondWithRpcPromise(_0x1eba('0xb1'),_0x1eba('0xb1'),{'FaxAccountId':_[_0x1eba('0xb2')](_0x31f2df['params']['id'])?undefined:_0x31f2df[_0x1eba('0x66')]['id'],'path':_[_0x1eba('0xb2')](_0x31f2df['body']['attachments'][0x0][_0x1eba('0x8')])?undefined:_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')][0x0]['path'],'fax':_[_0x1eba('0xb2')](_0x31f2df[_0x1eba('0x61')]['to'][0x0])?undefined:_0x31f2df[_0x1eba('0x61')]['to'][0x0]},client9002);})[_0x1eba('0x23')](function(){if(_0x4966c7){if(_[_0x1eba('0xb2')](_0x31f2df[_0x1eba('0x61')][_0x1eba('0xb3')])){_0x31f2df[_0x1eba('0x61')][_0x1eba('0xb3')]=util[_0x1eba('0xa6')](_0x1eba('0xb4'),_0x4966c7[_0x1eba('0x40')],_0x4966c7['fax']);}if(_0x4966c7[_0x1eba('0xaa')]){if(_0x4966c7['List'][_0x1eba('0xac')]['length']){return _0x4966c7[_0x1eba('0xaa')][_0x1eba('0xac')][0x0];}else{return db[_0x1eba('0xab')]['create'](_['defaults'](_0x31f2df[_0x1eba('0x61')],{'firstName':_0x31f2df[_0x1eba('0x61')]['to'][0x0],'phone':_0x31f2df['body']['to'][0x0],'fax':_0x31f2df[_0x1eba('0x61')]['to'][0x0],'ListId':_0x4966c7[_0x1eba('0xa3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x1eba('0x23')](function(_0x245599){if(_0x245599){return db[_0x1eba('0x74')][_0x1eba('0x5f')]({'where':{'ContactId':_0x245599['id'],'closed':![],'FaxAccountId':_0x4966c7['id']}})[_0x1eba('0x23')](function(_0x2f301e){if(_0x2f301e){return[_0x2f301e,![]];}return db['FaxInteraction']['create']({'UserId':_0x31f2df[_0x1eba('0xb5')]['id'],'ContactId':_0x245599['id'],'FaxAccountId':_0x4966c7['id'],'fax':_0x31f2df[_0x1eba('0x61')]['to'][0x0],'firstMsgDirection':_0x1eba('0xb6'),'Messages':[_[_0x1eba('0x58')](_0x31f2df['body'],{'read':![],'body':_0x31f2df['body'][_0x1eba('0xad')][0x0][_0x1eba('0xb7')],'FaxAccountId':_0x4966c7['id'],'UserId':_0x31f2df[_0x1eba('0xb5')]['id'],'ContactId':_0x245599['id'],'AttachmentId':_0x31f2df[_0x1eba('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x1eba('0xa8')],'as':_0x1eba('0xb8')}]})[_0x1eba('0x23')](function(_0x25caad){return[_0x25caad,!![]];});});}else{throw new Error(_0x1eba('0xb9'));}})[_0x1eba('0xba')](function(_0x2b3090,_0x9744d7){if(_0x9744d7){return _0x2b3090;}return db['FaxMessage'][_0x1eba('0x60')]({'direction':_0x1eba('0xb6'),'read':![],'body':_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')][0x0]['filename'],'FaxAccountId':_0x4966c7['id'],'FaxInteractionId':_0x2b3090['id'],'UserId':_0x31f2df['user']['id'],'ContactId':_0x2b3090[_0x1eba('0xbb')],'AttachmentId':_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')][0x0]['id']})[_0x1eba('0x23')](function(_0xa9e3b6){_0x2b3090[_0x1eba('0xbc')][_0x1eba('0xb8')]=[];_0x2b3090[_0x1eba('0xbc')]['Messages'][_0x1eba('0x91')](_0xa9e3b6['dataValues']);return _0x2b3090;});})['then'](function(_0x151808){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x1eba('0xb2')](_0x31f2df[_0x1eba('0x66')]['id'])?undefined:_0x31f2df[_0x1eba('0x66')]['id'],'path':_['isNil'](_0x31f2df['body']['attachments'][0x0][_0x1eba('0x8')])?undefined:_0x31f2df['body']['attachments'][0x0][_0x1eba('0x8')],'fax':_['isNil'](_0x31f2df[_0x1eba('0x61')]['to'][0x0])?undefined:_0x31f2df[_0x1eba('0x61')]['to'][0x0],'AttachmentId':_0x31f2df[_0x1eba('0x61')][_0x1eba('0xad')][0x0]['id']},client9002)['then'](function(_0x3a952c){logger['info'](_0x1eba('0xbd'),_0x3a952c);})[_0x1eba('0x2e')](function(_0x28b9ac){logger[_0x1eba('0x24')]('SendFaxRpc,\x20%s',_0x28b9ac);});return _0x151808;})[_0x1eba('0x23')](respondWithResult(_0x77485e,null))['catch'](handleError(_0x77485e,null));};exports['addAgents']=function(_0x4ae6a8,_0x501942,_0x190270){return db[_0x1eba('0x46')][_0x1eba('0x5f')]({'where':{'id':_0x4ae6a8[_0x1eba('0x66')]['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x501942,null))['then'](function(_0xf9fa47){if(_0xf9fa47){return _0xf9fa47[_0x1eba('0xbe')](_0x4ae6a8[_0x1eba('0x61')][_0x1eba('0x6e')],_['omit'](_0x4ae6a8[_0x1eba('0x61')],[_0x1eba('0x6e'),'id'])||{})[_0x1eba('0xba')](function(_0x27ca16){for(var _0x16dfbf=0x0;_0x16dfbf<_0x4ae6a8[_0x1eba('0x61')][_0x1eba('0x6e')][_0x1eba('0x51')];_0x16dfbf+=0x1){socket[_0x1eba('0xbf')](_0x1eba('0xc0'),{'UserId':Number(_0x4ae6a8['body']['ids'][_0x16dfbf]),'FaxAccountId':Number(_0x4ae6a8[_0x1eba('0x66')]['id'])});}return _0x27ca16;});}})['then'](respondWithResult(_0x501942,null))['catch'](handleError(_0x501942,null));};exports[_0x1eba('0xc1')]=function(_0x454f32,_0x448325,_0x3dfef6){return db[_0x1eba('0x46')][_0x1eba('0x5f')]({'where':{'id':_0x454f32['params']['id']}})[_0x1eba('0x23')](handleEntityNotFound(_0x448325,null))['then'](function(_0x4d8cb7){if(_0x4d8cb7){return _0x4d8cb7[_0x1eba('0xc1')](_0x454f32[_0x1eba('0x4c')]['ids'])['then'](function(){if(_[_0x1eba('0xc2')](_0x454f32[_0x1eba('0x4c')][_0x1eba('0x6e')])){for(var _0x15e8d3=0x0;_0x15e8d3<_0x454f32[_0x1eba('0x4c')][_0x1eba('0x6e')][_0x1eba('0x51')];_0x15e8d3+=0x1){socket[_0x1eba('0xbf')](_0x1eba('0xc3'),{'UserId':Number(_0x454f32[_0x1eba('0x4c')][_0x1eba('0x6e')][_0x15e8d3]),'FaxAccountId':Number(_0x454f32[_0x1eba('0x66')]['id'])});}}else{socket[_0x1eba('0xbf')](_0x1eba('0xc3'),{'UserId':Number(_0x454f32[_0x1eba('0x4c')][_0x1eba('0x6e')]),'FaxAccountId':Number(_0x454f32['params']['id'])});}});}})[_0x1eba('0x23')](respondWithStatusCode(_0x448325,null))['catch'](handleError(_0x448325,null));};exports[_0x1eba('0xc4')]=function(_0x46fdb8,_0x33056c,_0x73e625){var _0x14ac9c={};var _0x300a84={};var _0x45ebb5;var _0x52ebe2;return db[_0x1eba('0x46')][_0x1eba('0x6c')]({'where':{'id':_0x46fdb8[_0x1eba('0x66')]['id']}})['then'](handleEntityNotFound(_0x33056c,null))[_0x1eba('0x23')](function(_0x23aedf){if(_0x23aedf){_0x45ebb5=_0x23aedf;_0x300a84[_0x1eba('0x4b')]=_[_0x1eba('0x5e')](db[_0x1eba('0x78')]['rawAttributes']);_0x300a84[_0x1eba('0x4c')]=_['keys'](_0x46fdb8['query']);_0x300a84[_0x1eba('0x4d')]=_[_0x1eba('0x4e')](_0x300a84[_0x1eba('0x4b')],_0x300a84[_0x1eba('0x4c')]);_0x14ac9c['attributes']=_[_0x1eba('0x4e')](_0x300a84[_0x1eba('0x4b')],qs[_0x1eba('0x50')](_0x46fdb8[_0x1eba('0x4c')][_0x1eba('0x50')]));_0x14ac9c[_0x1eba('0x4f')]=_0x14ac9c[_0x1eba('0x4f')][_0x1eba('0x51')]?_0x14ac9c[_0x1eba('0x4f')]:_0x300a84[_0x1eba('0x4b')];_0x14ac9c[_0x1eba('0x53')]=qs[_0x1eba('0x54')](_0x46fdb8[_0x1eba('0x4c')][_0x1eba('0x54')]);_0x14ac9c[_0x1eba('0x55')]=qs['filters'](_['pick'](_0x46fdb8[_0x1eba('0x4c')],_0x300a84['filters']));if(_0x46fdb8[_0x1eba('0x4c')][_0x1eba('0x57')]){_0x14ac9c[_0x1eba('0x55')]=_[_0x1eba('0x58')](_0x14ac9c['where'],{'$or':_[_0x1eba('0x45')](_0x14ac9c['attributes'],function(_0x1f1230){var _0x32b918={};_0x32b918[_0x1f1230]={'$like':'%'+_0x46fdb8[_0x1eba('0x4c')][_0x1eba('0x57')]+'%'};return _0x32b918;})});}_0x14ac9c=_[_0x1eba('0x58')]({},_0x14ac9c,_0x46fdb8[_0x1eba('0x59')]);return _0x45ebb5[_0x1eba('0xc4')](_0x14ac9c);}})['then'](function(_0x547b32){if(_0x547b32){_0x52ebe2=_0x547b32['length'];if(!_0x46fdb8[_0x1eba('0x4c')][_0x1eba('0x77')](_0x1eba('0x52'))){_0x14ac9c[_0x1eba('0x34')]=qs[_0x1eba('0x34')](_0x46fdb8[_0x1eba('0x4c')]['limit']);_0x14ac9c[_0x1eba('0x32')]=qs[_0x1eba('0x32')](_0x46fdb8[_0x1eba('0x4c')][_0x1eba('0x32')]);}return _0x45ebb5[_0x1eba('0xc4')](_0x14ac9c);}})[_0x1eba('0x23')](function(_0x42481a){if(_0x42481a){return _0x42481a?{'count':_0x52ebe2,'rows':_0x42481a}:null;}})['then'](respondWithResult(_0x33056c,null))[_0x1eba('0x2e')](handleError(_0x33056c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 3cf1054..673e953 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 _0x8731=['save','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x8731,0x193));var _0x1873=function(_0x3fec83,_0x59591f){_0x3fec83=_0x3fec83-0x0;var _0x5b37dd=_0x8731[_0x3fec83];return _0x5b37dd;};'use strict';var EventEmitter=require(_0x1873('0x0'));var FaxAccount=require(_0x1873('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1873('0x2')](0x0);var events={'afterCreate':_0x1873('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a77d3){return function(_0x4cb726,_0x1ba46e,_0x49835a){FaxAccountEvents['emit'](_0x4a77d3+':'+_0x4cb726['id'],_0x4cb726);FaxAccountEvents['emit'](_0x4a77d3,_0x4cb726);_0x49835a(null);};}for(var e in events){if(events[_0x1873('0x4')](e)){var event=events[e];FaxAccount[_0x1873('0x5')](e,emitEvent(event));}}module[_0x1873('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0x6dbf=['remove','emit','exports','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x6dbf,0xfb));var _0xf6db=function(_0x51fb75,_0x1a4706){_0x51fb75=_0x51fb75-0x0;var _0x2b9da8=_0x6dbf[_0x51fb75];return _0x2b9da8;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xf6db('0x0'))['db'][_0xf6db('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf6db('0x2')](0x0);var events={'afterCreate':_0xf6db('0x3'),'afterUpdate':_0xf6db('0x4'),'afterDestroy':_0xf6db('0x5')};function emitEvent(_0x5d7e78){return function(_0x53144c,_0x357283,_0x423996){FaxAccountEvents[_0xf6db('0x6')](_0x5d7e78+':'+_0x53144c['id'],_0x53144c);FaxAccountEvents['emit'](_0x5d7e78,_0x53144c);_0x423996(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xf6db('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index e6d9006..26a00e4 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 _0x876b=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts'];(function(_0x3c0c9e,_0x3ecdee){var _0x5ba5fe=function(_0x1f4a60){while(--_0x1f4a60){_0x3c0c9e['push'](_0x3c0c9e['shift']());}};_0x5ba5fe(++_0x3ecdee);}(_0x876b,0x78));var _0xb876=function(_0x2dacf3,_0x135506){_0x2dacf3=_0x2dacf3-0x0;var _0x5c64ac=_0x876b[_0x2dacf3];return _0x5c64ac;};'use strict';var _=require(_0xb876('0x0'));var util=require(_0xb876('0x1'));var logger=require(_0xb876('0x2'))('api');var moment=require(_0xb876('0x3'));var BPromise=require('bluebird');var rp=require(_0xb876('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb876('0x5'));var config=require(_0xb876('0x6'));var attributes=require(_0xb876('0x7'));module[_0xb876('0x8')]=function(_0x5aea53,_0x5890ea){return _0x5aea53[_0xb876('0x9')](_0xb876('0xa'),attributes,{'tableName':_0xb876('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2902=['rimraf','../../config/environment','./faxAccount.attributes','define','fax_accounts','lodash','api','moment','bluebird'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0x2902,0x15b));var _0x2290=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x2902[_0x287a47];return _0x3fb726;};'use strict';var _=require(_0x2290('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2290('0x1'));var moment=require(_0x2290('0x2'));var BPromise=require(_0x2290('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2290('0x4'));var config=require(_0x2290('0x5'));var attributes=require(_0x2290('0x6'));module['exports']=function(_0x3b3b5d,_0x3cad1f){return _0x3b3b5d[_0x2290('0x7')]('FaxAccount',attributes,{'tableName':_0x2290('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index f02199c..52dc20a 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 _0x008b=['ContactId','AttachmentId','UserId','name','agent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','NotifyFaxAccount','body','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','priority','asc','length','CmContact','create','contact','fax','FaxInteraction','find','Contact\x20not\x20found','push','unmanaged','*,*,*,*','created','interaction','FaxMessage'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x008b,0x1c4));var _0xb008=function(_0x1bfd60,_0x11cad){_0x1bfd60=_0x1bfd60-0x0;var _0x168c28=_0x008b[_0x1bfd60];return _0x168c28;};'use strict';var _=require(_0xb008('0x0'));var util=require(_0xb008('0x1'));var moment=require(_0xb008('0x2'));var BPromise=require('bluebird');var rs=require(_0xb008('0x3'));var fs=require('fs');var Redis=require(_0xb008('0x4'));var db=require(_0xb008('0x5'))['db'];var utils=require(_0xb008('0x6'));var logger=require('../../config/logger')(_0xb008('0x7'));var config=require(_0xb008('0x8'));var jayson=require(_0xb008('0x9'));var client=jayson[_0xb008('0xa')][_0xb008('0xb')]({'port':0x232c});config[_0xb008('0xc')]=_[_0xb008('0xd')](config[_0xb008('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb008('0xe'))(new Redis(config['redis']));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1cb2f6,_0x409199,_0xd9d3a1){return new BPromise(function(_0x88b469,_0x33c44e){return client[_0xb008('0xf')](_0x1cb2f6,_0xd9d3a1)[_0xb008('0x10')](function(_0x11967a){logger[_0xb008('0x11')]('FaxAccount,\x20%s,\x20%s',_0x409199,_0xb008('0x12'));logger[_0xb008('0x13')](_0xb008('0x14'),_0x409199,'request\x20sent',JSON[_0xb008('0x15')](_0x11967a));if(_0x11967a[_0xb008('0x16')]){if(_0x11967a[_0xb008('0x16')]['code']===0x1f4){logger[_0xb008('0x16')]('FaxAccount,\x20%s,\x20%s',_0x409199,_0x11967a[_0xb008('0x16')]['message']);return _0x33c44e(_0x11967a[_0xb008('0x16')][_0xb008('0x17')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x409199,_0x11967a[_0xb008('0x16')]['message']);return _0x88b469(_0x11967a[_0xb008('0x16')][_0xb008('0x17')]);}else{logger[_0xb008('0x11')](_0xb008('0x18'),_0x409199,'request\x20sent');_0x88b469(_0x11967a[_0xb008('0x19')][_0xb008('0x17')]);}})[_0xb008('0x1a')](function(_0x1845b5){logger['error'](_0xb008('0x18'),_0x409199,_0x1845b5);_0x33c44e(_0x1845b5);});});}exports[_0xb008('0x1b')]=function(_0x3132dc){var _0x495747=this;return new Promise(function(_0xff03a1,_0x3c4cd5){return db[_0xb008('0x1c')][_0xb008('0x1d')]({'raw':_0x3132dc[_0xb008('0x1e')]?_0x3132dc[_0xb008('0x1e')][_0xb008('0x1f')]===undefined?!![]:![]:!![],'where':_0x3132dc['options']?_0x3132dc[_0xb008('0x1e')][_0xb008('0x20')]||null:null,'attributes':_0x3132dc['options']?_0x3132dc['options']['attributes']||null:null,'limit':_0x3132dc[_0xb008('0x1e')]?_0x3132dc[_0xb008('0x1e')][_0xb008('0x21')]||null:null,'include':_0x3132dc[_0xb008('0x1e')]?_0x3132dc[_0xb008('0x1e')][_0xb008('0x22')]?_[_0xb008('0x23')](_0x3132dc[_0xb008('0x1e')]['include'],function(_0x539296){return{'model':db[_0x539296[_0xb008('0x24')]],'as':_0x539296['as'],'attributes':_0x539296[_0xb008('0x25')],'include':_0x539296[_0xb008('0x22')]?_[_0xb008('0x23')](_0x539296[_0xb008('0x22')],function(_0x370953){return{'model':db[_0x370953[_0xb008('0x24')]],'as':_0x370953['as'],'attributes':_0x370953[_0xb008('0x25')],'include':_0x370953[_0xb008('0x22')]?_[_0xb008('0x23')](_0x370953['include'],function(_0x2fa9f8){return{'model':db[_0x2fa9f8[_0xb008('0x24')]],'as':_0x2fa9f8['as'],'attributes':_0x2fa9f8[_0xb008('0x25')]};}):[]};}):[]};}):[]:[]})[_0xb008('0x10')](function(_0xddafa5){logger[_0xb008('0x11')](_0xb008('0x1b'),_0x3132dc);logger[_0xb008('0x13')](_0xb008('0x1b'),_0x3132dc,JSON[_0xb008('0x15')](_0xddafa5));_0xff03a1(_0xddafa5);})[_0xb008('0x1a')](function(_0x415f19){logger[_0xb008('0x16')](_0xb008('0x1b'),_0x415f19[_0xb008('0x17')],_0x3132dc);_0x3c4cd5(_0x495747[_0xb008('0x16')](0x1f4,_0x415f19[_0xb008('0x17')]));});});};exports[_0xb008('0x26')]=function(_0x5f1a25,_0x21cf7c,_0x1074b2){var _0x49d04c=this;return new Promise(function(_0x1df491,_0x96274a){var _0x5bf4bc={'body':_0x5f1a25[_0xb008('0x27')],'channel':'fax'};var _0x49148b=[];var _0x3a76ae=[];var _0x26ccc4={};return db['CmContact']['describe']()[_0xb008('0x10')](function(_0x368839){if(!_0x368839){throw new db[(_0xb008('0x28'))][(_0xb008('0x29'))](_0xb008('0x2a'));}_0x49148b=_[_0xb008('0x2b')](_['keys'](_0x368839),[_0xb008('0x2c'),_0xb008('0x2d')]);_0x3a76ae=_[_0xb008('0x2b')](_['keys'](_0x368839),['createdAt',_0xb008('0x2d'),_0xb008('0x2e'),_0xb008('0x2f')]);if(_0x5f1a25[_0xb008('0x27')]['id']){delete _0x5f1a25['body']['id'];}if(_['isNil'](_0x5f1a25['body']['from'])){throw new db['Sequelize']['ValidationError'](_0xb008('0x30'));}if(_[_0xb008('0x31')](_0x5f1a25[_0xb008('0x27')][_0xb008('0x27')])||_0x5f1a25[_0xb008('0x27')][_0xb008('0x27')]===''){throw new db[(_0xb008('0x28'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x5f1a25[_0xb008('0x27')][_0xb008('0x32')])){throw new db[(_0xb008('0x28'))]['ValidationError'](_0xb008('0x33')+_0x3a76ae);}if(!_[_0xb008('0x34')](_0x3a76ae,_0x5f1a25[_0xb008('0x27')][_0xb008('0x32')])){throw new db['Sequelize'][(_0xb008('0x29'))](_0xb008('0x35')+_0x3a76ae);}_0x26ccc4[_0x5f1a25[_0xb008('0x27')]['mapKey']]=_0x5f1a25[_0xb008('0x27')][_0xb008('0x36')];})['then'](function(){return db[_0xb008('0x1c')]['find']({'where':{'id':_0x5f1a25[_0xb008('0x37')]['id']},'include':[{'model':db[_0xb008('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb008('0x39'),'where':_0x26ccc4,'limit':0x1,'order':[['updatedAt',_0xb008('0x3a')]]}]},{'model':db[_0xb008('0x3b')],'as':_0xb008('0x3c')}]});})['then'](function(_0x3ceb9f){if(_0x3ceb9f&&_0x3ceb9f[_0xb008('0x3d')]){var _0x183e1a=_0x3ceb9f[_0xb008('0x3e')]({'plain':!![]});_0x5bf4bc[_0xb008('0x37')]=_0x183e1a;_0x5bf4bc[_0xb008('0x3f')]=_0x183e1a[_0xb008('0x3c')];_0x5bf4bc[_0xb008('0x40')]=_0x183e1a[_0xb008('0x3d')];_0x5bf4bc[_0xb008('0x3f')]=_[_0xb008('0x41')](_0x5bf4bc[_0xb008('0x3f')],[_0xb008('0x42')],[_0xb008('0x43')]);if(_0x5bf4bc[_0xb008('0x37')][_0xb008('0x3c')]){delete _0x5bf4bc[_0xb008('0x37')][_0xb008('0x3c')];}if(_0x5bf4bc[_0xb008('0x37')][_0xb008('0x3d')]&&_0x5bf4bc[_0xb008('0x37')][_0xb008('0x3d')][_0xb008('0x39')][_0xb008('0x44')]){return _0x5bf4bc[_0xb008('0x37')][_0xb008('0x3d')][_0xb008('0x39')][0x0];}var _0x6c7c23=_[_0xb008('0xd')](_0x5f1a25['body'],{'firstName':_0x5f1a25['body']['from'],'ListId':_0x183e1a[_0xb008('0x2f')]});_0x6c7c23[_0x5f1a25['body'][_0xb008('0x32')]]=_0x5f1a25[_0xb008('0x27')][_0xb008('0x36')];return db[_0xb008('0x45')][_0xb008('0x46')](_0x6c7c23,{'fields':_0x49148b,'raw':!![]});}})[_0xb008('0x10')](function(_0x12d432){_0x5bf4bc[_0xb008('0x47')]=_0x12d432;if(_0x12d432){var _0x55a788={'ContactId':_0x12d432['id'],'FaxAccountId':_0x5f1a25[_0xb008('0x37')]['id'],'fax':_0x12d432[_0xb008('0x48')]};return db[_0xb008('0x49')][_0xb008('0x4a')]({'where':{'ContactId':_0x12d432['id'],'closed':![],'FaxAccountId':_0x5f1a25[_0xb008('0x37')]['id']}})[_0xb008('0x10')](function(_0x1e8c7c){if(_0x1e8c7c){return[_0x1e8c7c,![]];}return db['FaxInteraction']['create'](_0x55a788)['then'](function(_0x7db97b){return[_0x7db97b,!![]];});});}else{throw new Error(_0xb008('0x4b'));}})['spread'](function(_0x4518c1,_0x5c2283){var _0x301716=_0x4518c1[_0xb008('0x3e')]({'plain':!![]});if(_0x5c2283){if(_0x5bf4bc['account']['autoclose']){_0x5bf4bc['applications'][_0xb008('0x4c')]({'id':0x0,'priority':_0x5bf4bc[_0xb008('0x3f')][_0xb008('0x44')]+0x1,'app':'close','appdata':_0xb008('0x4d'),'interval':_0xb008('0x4e')});}_0x301716[_0xb008('0x4f')]=!![];}else{_0x301716[_0xb008('0x4f')]=![];}_0x5bf4bc[_0xb008('0x50')]=_0x301716;return db[_0xb008('0x51')][_0xb008('0x46')]({'body':_0x5f1a25[_0xb008('0x27')][_0xb008('0x27')],'FaxAccountId':_0x5f1a25['account']['id'],'FaxInteractionId':_0x4518c1['id'],'direction':'in','ContactId':_0x4518c1[_0xb008('0x52')],'AttachmentId':_0x5f1a25[_0xb008('0x27')][_0xb008('0x53')]});})[_0xb008('0x10')](function(_0x52bf71){_0x5bf4bc['message']=_0x52bf71;if(_0x5bf4bc[_0xb008('0x50')][_0xb008('0x54')]){return db['User'][_0xb008('0x4a')]({'attributes':['id',_0xb008('0x55')],'where':{'id':_0x5bf4bc['interaction'][_0xb008('0x54')]}})[_0xb008('0x10')](function(_0x571499){if(_0x571499){_0x5bf4bc[_0xb008('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb008('0x56'),'appdata':_0x571499[_0xb008('0x55')]+','+(_0x5bf4bc[_0xb008('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0xb008('0x4e')});}return respondWithRpcPromise(_0xb008('0x57'),'startRouting',_0x5bf4bc);});}return respondWithRpcPromise(_0xb008('0x57'),_0xb008('0x58'),_0x5bf4bc);})['then'](function(_0x1b7e24){_0x1df491(_0x1b7e24);})['catch'](function(_0x375b37){_0x96274a(_0x49d04c[_0xb008('0x16')](0x1f4,_0x375b37[_0xb008('0x17')]));});});}; \ No newline at end of file +var _0x6223=['ContactId','AttachmentId','UserId','User','name','unshift','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','list','applications','orderBy','priority','asc','length','from','create','contact','FaxInteraction','spread','get','autoclose','push','close','unmanaged','created','interaction','FaxMessage'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x6223,0x1e3));var _0x3622=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x6223[_0x5b27da];return _0x3254f4;};'use strict';var _=require(_0x3622('0x0'));var util=require(_0x3622('0x1'));var moment=require(_0x3622('0x2'));var BPromise=require(_0x3622('0x3'));var rs=require(_0x3622('0x4'));var fs=require('fs');var Redis=require(_0x3622('0x5'));var db=require(_0x3622('0x6'))['db'];var utils=require(_0x3622('0x7'));var logger=require(_0x3622('0x8'))(_0x3622('0x9'));var config=require(_0x3622('0xa'));var jayson=require(_0x3622('0xb'));var client=jayson[_0x3622('0xc')][_0x3622('0xd')]({'port':0x232c});config[_0x3622('0xe')]=_[_0x3622('0xf')](config[_0x3622('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x3622('0x10'))(new Redis(config[_0x3622('0xe')]));require(_0x3622('0x11'))[_0x3622('0x12')](socket);function respondWithRpcPromise(_0x4374d7,_0x1b7d9d,_0x52be7f){return new BPromise(function(_0x47c301,_0x562377){return client[_0x3622('0x13')](_0x4374d7,_0x52be7f)[_0x3622('0x14')](function(_0x271427){logger['info'](_0x3622('0x15'),_0x1b7d9d,'request\x20sent');logger[_0x3622('0x16')](_0x3622('0x17'),_0x1b7d9d,'request\x20sent',JSON[_0x3622('0x18')](_0x271427));if(_0x271427[_0x3622('0x19')]){if(_0x271427[_0x3622('0x19')]['code']===0x1f4){logger['error'](_0x3622('0x15'),_0x1b7d9d,_0x271427[_0x3622('0x19')]['message']);return _0x562377(_0x271427[_0x3622('0x19')][_0x3622('0x1a')]);}logger[_0x3622('0x19')](_0x3622('0x15'),_0x1b7d9d,_0x271427['error']['message']);return _0x47c301(_0x271427[_0x3622('0x19')][_0x3622('0x1a')]);}else{logger[_0x3622('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x1b7d9d,_0x3622('0x1c'));_0x47c301(_0x271427[_0x3622('0x1d')][_0x3622('0x1a')]);}})[_0x3622('0x1e')](function(_0x344261){logger[_0x3622('0x19')](_0x3622('0x15'),_0x1b7d9d,_0x344261);_0x562377(_0x344261);});});}exports['GetFaxAccount']=function(_0x4dbbba){var _0x5adb80=this;return new Promise(function(_0x15f0ac,_0x29b715){return db[_0x3622('0x1f')][_0x3622('0x20')]({'raw':_0x4dbbba['options']?_0x4dbbba[_0x3622('0x21')][_0x3622('0x22')]===undefined?!![]:![]:!![],'where':_0x4dbbba[_0x3622('0x21')]?_0x4dbbba['options']['where']||null:null,'attributes':_0x4dbbba[_0x3622('0x21')]?_0x4dbbba[_0x3622('0x21')][_0x3622('0x23')]||null:null,'limit':_0x4dbbba['options']?_0x4dbbba['options'][_0x3622('0x24')]||null:null,'include':_0x4dbbba['options']?_0x4dbbba[_0x3622('0x21')][_0x3622('0x25')]?_[_0x3622('0x26')](_0x4dbbba[_0x3622('0x21')][_0x3622('0x25')],function(_0x54c5af){return{'model':db[_0x54c5af[_0x3622('0x27')]],'as':_0x54c5af['as'],'attributes':_0x54c5af['attributes'],'include':_0x54c5af[_0x3622('0x25')]?_[_0x3622('0x26')](_0x54c5af[_0x3622('0x25')],function(_0x516dfc){return{'model':db[_0x516dfc[_0x3622('0x27')]],'as':_0x516dfc['as'],'attributes':_0x516dfc[_0x3622('0x23')],'include':_0x516dfc[_0x3622('0x25')]?_[_0x3622('0x26')](_0x516dfc['include'],function(_0x31c986){return{'model':db[_0x31c986[_0x3622('0x27')]],'as':_0x31c986['as'],'attributes':_0x31c986['attributes']};}):[]};}):[]};}):[]:[]})[_0x3622('0x14')](function(_0x2e29cc){logger[_0x3622('0x1b')](_0x3622('0x28'),_0x4dbbba);logger[_0x3622('0x16')](_0x3622('0x28'),_0x4dbbba,JSON[_0x3622('0x18')](_0x2e29cc));_0x15f0ac(_0x2e29cc);})[_0x3622('0x1e')](function(_0x4406e5){logger['error'](_0x3622('0x28'),_0x4406e5['message'],_0x4dbbba);_0x29b715(_0x5adb80['error'](0x1f4,_0x4406e5[_0x3622('0x1a')]));});});};exports[_0x3622('0x29')]=function(_0x37d757,_0x3c5a9d,_0x1ac7ac){var _0x1ebdbb=this;return new Promise(function(_0x5abae5,_0x31799d){var _0x528a0e={'body':_0x37d757[_0x3622('0x2a')],'channel':_0x3622('0x2b')};var _0x38e413=[];var _0x572f8e=[];var _0x475ad6={};return db[_0x3622('0x2c')][_0x3622('0x2d')]()[_0x3622('0x14')](function(_0x1ab659){if(!_0x1ab659){throw new db[(_0x3622('0x2e'))][(_0x3622('0x2f'))](_0x3622('0x30'));}_0x38e413=_[_0x3622('0x31')](_['keys'](_0x1ab659),['createdAt',_0x3622('0x32')]);_0x572f8e=_['difference'](_[_0x3622('0x33')](_0x1ab659),[_0x3622('0x34'),_0x3622('0x32'),_0x3622('0x35'),_0x3622('0x36')]);if(_0x37d757['body']['id']){delete _0x37d757[_0x3622('0x2a')]['id'];}if(_['isNil'](_0x37d757[_0x3622('0x2a')]['from'])){throw new db[(_0x3622('0x2e'))][(_0x3622('0x2f'))]('from\x20is\x20mandatory');}if(_[_0x3622('0x37')](_0x37d757[_0x3622('0x2a')]['body'])||_0x37d757[_0x3622('0x2a')][_0x3622('0x2a')]===''){throw new db['Sequelize'][(_0x3622('0x2f'))](_0x3622('0x38'));}if(_[_0x3622('0x37')](_0x37d757[_0x3622('0x2a')][_0x3622('0x39')])){throw new db[(_0x3622('0x2e'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x572f8e);}if(!_[_0x3622('0x3a')](_0x572f8e,_0x37d757[_0x3622('0x2a')][_0x3622('0x39')])){throw new db[(_0x3622('0x2e'))][(_0x3622('0x2f'))](_0x3622('0x3b')+_0x572f8e);}_0x475ad6[_0x37d757[_0x3622('0x2a')]['mapKey']]=_0x37d757[_0x3622('0x2a')]['from'];})['then'](function(){return db['FaxAccount'][_0x3622('0x3c')]({'where':{'id':_0x37d757[_0x3622('0x3d')]['id']},'include':[{'model':db[_0x3622('0x3e')],'as':_0x3622('0x3f'),'include':[{'model':db['CmContact'],'as':_0x3622('0x40'),'where':_0x475ad6,'limit':0x1,'order':[[_0x3622('0x32'),_0x3622('0x41')]]}]},{'model':db[_0x3622('0x42')],'as':_0x3622('0x43')}]});})[_0x3622('0x14')](function(_0x12344b){if(_0x12344b&&_0x12344b[_0x3622('0x3f')]){var _0x21cf95=_0x12344b['get']({'plain':!![]});_0x528a0e[_0x3622('0x3d')]=_0x21cf95;_0x528a0e['applications']=_0x21cf95['Applications'];_0x528a0e[_0x3622('0x44')]=_0x21cf95[_0x3622('0x3f')];_0x528a0e[_0x3622('0x45')]=_[_0x3622('0x46')](_0x528a0e[_0x3622('0x45')],[_0x3622('0x47')],[_0x3622('0x48')]);if(_0x528a0e[_0x3622('0x3d')][_0x3622('0x43')]){delete _0x528a0e['account'][_0x3622('0x43')];}if(_0x528a0e[_0x3622('0x3d')][_0x3622('0x3f')]&&_0x528a0e[_0x3622('0x3d')][_0x3622('0x3f')][_0x3622('0x40')][_0x3622('0x49')]){return _0x528a0e['account'][_0x3622('0x3f')][_0x3622('0x40')][0x0];}var _0x4107f2=_[_0x3622('0xf')](_0x37d757[_0x3622('0x2a')],{'firstName':_0x37d757[_0x3622('0x2a')][_0x3622('0x4a')],'ListId':_0x21cf95[_0x3622('0x36')]});_0x4107f2[_0x37d757[_0x3622('0x2a')]['mapKey']]=_0x37d757[_0x3622('0x2a')][_0x3622('0x4a')];return db[_0x3622('0x2c')][_0x3622('0x4b')](_0x4107f2,{'fields':_0x38e413,'raw':!![]});}})['then'](function(_0xf35d93){_0x528a0e[_0x3622('0x4c')]=_0xf35d93;if(_0xf35d93){var _0x49d1f6={'ContactId':_0xf35d93['id'],'FaxAccountId':_0x37d757[_0x3622('0x3d')]['id'],'fax':_0xf35d93[_0x3622('0x2b')]};return db[_0x3622('0x4d')][_0x3622('0x3c')]({'where':{'ContactId':_0xf35d93['id'],'closed':![],'FaxAccountId':_0x37d757[_0x3622('0x3d')]['id']}})[_0x3622('0x14')](function(_0x3b27fc){if(_0x3b27fc){return[_0x3b27fc,![]];}return db['FaxInteraction']['create'](_0x49d1f6)[_0x3622('0x14')](function(_0x5b1467){return[_0x5b1467,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3622('0x4e')](function(_0x55049f,_0x47fe9c){var _0x19df11=_0x55049f[_0x3622('0x4f')]({'plain':!![]});if(_0x47fe9c){if(_0x528a0e[_0x3622('0x3d')][_0x3622('0x50')]){_0x528a0e[_0x3622('0x45')][_0x3622('0x51')]({'id':0x0,'priority':_0x528a0e['applications'][_0x3622('0x49')]+0x1,'app':_0x3622('0x52'),'appdata':_0x3622('0x53'),'interval':'*,*,*,*'});}_0x19df11[_0x3622('0x54')]=!![];}else{_0x19df11[_0x3622('0x54')]=![];}_0x528a0e[_0x3622('0x55')]=_0x19df11;return db[_0x3622('0x56')][_0x3622('0x4b')]({'body':_0x37d757[_0x3622('0x2a')][_0x3622('0x2a')],'FaxAccountId':_0x37d757[_0x3622('0x3d')]['id'],'FaxInteractionId':_0x55049f['id'],'direction':'in','ContactId':_0x55049f[_0x3622('0x57')],'AttachmentId':_0x37d757['body'][_0x3622('0x58')]});})[_0x3622('0x14')](function(_0x438439){_0x528a0e['message']=_0x438439;if(_0x528a0e[_0x3622('0x55')][_0x3622('0x59')]){return db[_0x3622('0x5a')][_0x3622('0x3c')]({'attributes':['id',_0x3622('0x5b')],'where':{'id':_0x528a0e[_0x3622('0x55')][_0x3622('0x59')]}})['then'](function(_0x44e961){if(_0x44e961){_0x528a0e[_0x3622('0x45')][_0x3622('0x5c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x44e961[_0x3622('0x5b')]+','+(_0x528a0e[_0x3622('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3622('0x5d'),_0x3622('0x5e'),_0x528a0e);});}return respondWithRpcPromise('Start',_0x3622('0x5e'),_0x528a0e);})[_0x3622('0x14')](function(_0xea9325){_0x5abae5(_0xea9325);})[_0x3622('0x1e')](function(_0x1f0fd5){_0x31799d(_0x1ebdbb[_0x3622('0x19')](0x1f4,_0x1f0fd5[_0x3622('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index a11e95a..79ba081 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 _0xee99=['remove','update','emit','removeListener','faxAccount:','./faxAccount.events','save'];(function(_0x2c0ff7,_0x5dd45e){var _0x57742=function(_0x5562ce){while(--_0x5562ce){_0x2c0ff7['push'](_0x2c0ff7['shift']());}};_0x57742(++_0x5dd45e);}(_0xee99,0x19b));var _0x9ee9=function(_0x298546,_0x588e3a){_0x298546=_0x298546-0x0;var _0x1cb95c=_0xee99[_0x298546];return _0x1cb95c;};'use strict';var FaxAccountEvents=require(_0x9ee9('0x0'));var events=[_0x9ee9('0x1'),_0x9ee9('0x2'),_0x9ee9('0x3')];function createListener(_0x331156,_0x4c85e4){return function(_0x1da634){_0x4c85e4[_0x9ee9('0x4')](_0x331156,_0x1da634);};}function removeListener(_0x204946,_0x51ae1a){return function(){FaxAccountEvents[_0x9ee9('0x5')](_0x204946,_0x51ae1a);};}exports['register']=function(_0x1cbe2f){for(var _0x3965fc=0x0,_0x329aaf=events['length'];_0x3965fc<_0x329aaf;_0x3965fc++){var _0x488fe5=events[_0x3965fc];var _0x1f362f=createListener(_0x9ee9('0x6')+_0x488fe5,_0x1cbe2f);FaxAccountEvents['on'](_0x488fe5,_0x1f362f);}}; \ No newline at end of file +var _0x670c=['remove','update','emit','removeListener','length','faxAccount:','./faxAccount.events','save'];(function(_0x23aeaf,_0x241fa7){var _0x118109=function(_0x3971ca){while(--_0x3971ca){_0x23aeaf['push'](_0x23aeaf['shift']());}};_0x118109(++_0x241fa7);}(_0x670c,0x12e));var _0xc670=function(_0x2ce437,_0x4426f1){_0x2ce437=_0x2ce437-0x0;var _0x30e478=_0x670c[_0x2ce437];return _0x30e478;};'use strict';var FaxAccountEvents=require(_0xc670('0x0'));var events=[_0xc670('0x1'),_0xc670('0x2'),_0xc670('0x3')];function createListener(_0x4b0d26,_0x471f41){return function(_0xf31022){_0x471f41[_0xc670('0x4')](_0x4b0d26,_0xf31022);};}function removeListener(_0x4773cd,_0x14ec79){return function(){FaxAccountEvents[_0xc670('0x5')](_0x4773cd,_0x14ec79);};}exports['register']=function(_0x38780f){for(var _0x3b3765=0x0,_0x4575e5=events[_0xc670('0x6')];_0x3b3765<_0x4575e5;_0x3b3765++){var _0x277c3a=events[_0x3b3765];var _0x9f7e53=createListener(_0xc670('0x7')+_0x277c3a,_0x38780f);FaxAccountEvents['on'](_0x277c3a,_0x9f7e53);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9a2b5a7..e6db3b1 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(_0x8efa6d,_0x51a861){var _0x3ce69a=function(_0x2bd97d){while(--_0x2bd97d){_0x8efa6d['push'](_0x8efa6d['shift']());}};_0x3ce69a(++_0x51a861);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +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(_0x10703f,_0x2e8b8e){var _0x14d2ff=function(_0x598ff7){while(--_0x598ff7){_0x10703f['push'](_0x10703f['shift']());}};_0x14d2ff(++_0x2e8b8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 84b204f..3c2463e 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 _0x7761=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4ab504,_0x32273f){var _0x2aa2c5=function(_0x5046d5){while(--_0x5046d5){_0x4ab504['push'](_0x4ab504['shift']());}};_0x2aa2c5(++_0x32273f);}(_0x7761,0x1c6));var _0x1776=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7761[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1776('0x0'));module[_0x1776('0x1')]={'priority':{'type':Sequelize[_0x1776('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1776('0x3')],'allowNull':![],'defaultValue':_0x1776('0x4')},'appdata':{'type':Sequelize[_0x1776('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1776('0x3')],'defaultValue':_0x1776('0x6')}}; \ No newline at end of file +var _0x0aa4=['*,*,*,*','STRING','noop','TEXT'];(function(_0x2c9e54,_0x178247){var _0x25d074=function(_0x14e87e){while(--_0x14e87e){_0x2c9e54['push'](_0x2c9e54['shift']());}};_0x25d074(++_0x178247);}(_0x0aa4,0x1e1));var _0x40aa=function(_0xba7ced,_0x2d9e87){_0xba7ced=_0xba7ced-0x0;var _0x9cf458=_0x0aa4[_0xba7ced];return _0x9cf458;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x40aa('0x0')],'allowNull':![],'defaultValue':_0x40aa('0x1')},'appdata':{'type':Sequelize[_0x40aa('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x40aa('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 27690c8..476918a 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 _0xd362=['VIRTUAL','options','FaxApplication','include','findAll','rows','show','params','keys','fields','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge'];(function(_0xa61555,_0x1bc1a5){var _0x2e248d=function(_0x4f491c){while(--_0x4f491c){_0xa61555['push'](_0xa61555['shift']());}};_0x2e248d(++_0x1bc1a5);}(_0xd362,0xe9));var _0x2d36=function(_0x3ff372,_0xe314){_0x3ff372=_0x3ff372-0x0;var _0x328737=_0xd362[_0x3ff372];return _0x328737;};'use strict';var emlformat=require(_0x2d36('0x0'));var rimraf=require(_0x2d36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d36('0x2'));var rp=require(_0x2d36('0x3'));var moment=require(_0x2d36('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d36('0x5'));var util=require('util');var path=require(_0x2d36('0x6'));var sox=require(_0x2d36('0x7'));var csv=require(_0x2d36('0x8'));var ejs=require(_0x2d36('0x9'));var fs=require('fs');var fs_extra=require(_0x2d36('0xa'));var _=require(_0x2d36('0xb'));var squel=require(_0x2d36('0xc'));var crypto=require(_0x2d36('0xd'));var jsforce=require(_0x2d36('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2d36('0x8'));var querystring=require(_0x2d36('0xf'));var Papa=require(_0x2d36('0x10'));var Redis=require(_0x2d36('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2d36('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d36('0x13'))('api');var utils=require(_0x2d36('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d36('0x15'));var db=require(_0x2d36('0x16'))['db'];function respondWithStatusCode(_0x1f191f,_0x137829){_0x137829=_0x137829||0xcc;return function(_0xe648db){if(_0xe648db){return _0x1f191f[_0x2d36('0x17')](_0x137829);}return _0x1f191f[_0x2d36('0x18')](_0x137829)[_0x2d36('0x19')]();};}function respondWithResult(_0x23039a,_0x57bdfe){_0x57bdfe=_0x57bdfe||0xc8;return function(_0x4085bd){if(_0x4085bd){return _0x23039a[_0x2d36('0x18')](_0x57bdfe)[_0x2d36('0x1a')](_0x4085bd);}};}function respondWithFilteredResult(_0xb84598,_0x86a060){return function(_0x23b3f1){if(_0x23b3f1){var _0x2a5678=typeof _0x86a060[_0x2d36('0x1b')]===_0x2d36('0x1c')&&typeof _0x86a060['limit']==='undefined';var _0x17c9e1=_0x23b3f1[_0x2d36('0x1d')];var _0x3df147=_0x2a5678?0x0:_0x86a060[_0x2d36('0x1b')];var _0x4ccb10=_0x2a5678?_0x23b3f1[_0x2d36('0x1d')]:_0x86a060['offset']+_0x86a060[_0x2d36('0x1e')];var _0x3a926c;if(_0x4ccb10>=_0x17c9e1){_0x4ccb10=_0x17c9e1;_0x3a926c=0xc8;}else{_0x3a926c=0xce;}_0xb84598['status'](_0x3a926c);return _0xb84598[_0x2d36('0x1f')]('Content-Range',_0x3df147+'-'+_0x4ccb10+'/'+_0x17c9e1)[_0x2d36('0x1a')](_0x23b3f1);}return null;};}function patchUpdates(_0x2e2f64){return function(_0x5a9b03){try{jsonpatch['apply'](_0x5a9b03,_0x2e2f64,!![]);}catch(_0x3221ab){return BPromise[_0x2d36('0x20')](_0x3221ab);}return _0x5a9b03[_0x2d36('0x21')]();};}function saveUpdates(_0x5e8dc2,_0x1f408d){return function(_0x415684){if(_0x415684){return _0x415684[_0x2d36('0x22')](_0x5e8dc2)['then'](function(_0x55d43a){return _0x55d43a;});}return null;};}function removeEntity(_0x5ba4a7,_0x5b6cfb){return function(_0x13f370){if(_0x13f370){return _0x13f370[_0x2d36('0x23')]()[_0x2d36('0x24')](function(){_0x5ba4a7[_0x2d36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cd096,_0x55addd){return function(_0x3b131a){if(!_0x3b131a){_0x1cd096[_0x2d36('0x17')](0x194);}return _0x3b131a;};}function handleError(_0x4ebeaa,_0x24b975){_0x24b975=_0x24b975||0x1f4;return function(_0x349afa){logger['error'](_0x349afa[_0x2d36('0x25')]);if(_0x349afa['name']){delete _0x349afa[_0x2d36('0x26')];}_0x4ebeaa[_0x2d36('0x18')](_0x24b975)[_0x2d36('0x27')](_0x349afa);};}exports[_0x2d36('0x28')]=function(_0xcc1554,_0x120f0d){var _0x41a784={},_0x24716d={},_0x2b8b5e={'count':0x0,'rows':[]};var _0x53880b=_[_0x2d36('0x29')](db['FaxApplication'][_0x2d36('0x2a')],function(_0x109b3e){return{'name':_0x109b3e['fieldName'],'type':_0x109b3e[_0x2d36('0x2b')][_0x2d36('0x2c')]};});_0x24716d[_0x2d36('0x2d')]=_[_0x2d36('0x29')](_0x53880b,_0x2d36('0x26'));_0x24716d[_0x2d36('0x2e')]=_['keys'](_0xcc1554['query']);_0x24716d['filters']=_[_0x2d36('0x2f')](_0x24716d[_0x2d36('0x2d')],_0x24716d[_0x2d36('0x2e')]);_0x41a784['attributes']=_[_0x2d36('0x2f')](_0x24716d['model'],qs['fields'](_0xcc1554[_0x2d36('0x2e')]['fields']));_0x41a784[_0x2d36('0x30')]=_0x41a784[_0x2d36('0x30')][_0x2d36('0x31')]?_0x41a784[_0x2d36('0x30')]:_0x24716d[_0x2d36('0x2d')];if(!_0xcc1554[_0x2d36('0x2e')][_0x2d36('0x32')](_0x2d36('0x33'))){_0x41a784[_0x2d36('0x1e')]=qs[_0x2d36('0x1e')](_0xcc1554[_0x2d36('0x2e')][_0x2d36('0x1e')]);_0x41a784[_0x2d36('0x1b')]=qs[_0x2d36('0x1b')](_0xcc1554['query'][_0x2d36('0x1b')]);}_0x41a784[_0x2d36('0x34')]=qs[_0x2d36('0x35')](_0xcc1554[_0x2d36('0x2e')]['sort']);_0x41a784[_0x2d36('0x36')]=qs['filters'](_[_0x2d36('0x37')](_0xcc1554[_0x2d36('0x2e')],_0x24716d[_0x2d36('0x38')]),_0x53880b);if(_0xcc1554['query'][_0x2d36('0x39')]){_0x41a784['where']=_[_0x2d36('0x3a')](_0x41a784[_0x2d36('0x36')],{'$or':_['map'](_0x53880b,function(_0xf1b43c){if(_0xf1b43c[_0x2d36('0x2b')]!==_0x2d36('0x3b')){var _0x1db01a={};_0x1db01a[_0xf1b43c[_0x2d36('0x26')]]={'$like':'%'+_0xcc1554[_0x2d36('0x2e')][_0x2d36('0x39')]+'%'};return _0x1db01a;}})});}_0x41a784=_[_0x2d36('0x3a')]({},_0x41a784,_0xcc1554[_0x2d36('0x3c')]);var _0x182ef5={'where':_0x41a784['where']};return db[_0x2d36('0x3d')][_0x2d36('0x1d')](_0x182ef5)['then'](function(_0x11318b){_0x2b8b5e[_0x2d36('0x1d')]=_0x11318b;if(_0xcc1554[_0x2d36('0x2e')]['includeAll']){_0x41a784[_0x2d36('0x3e')]=[{'all':!![]}];}return db[_0x2d36('0x3d')][_0x2d36('0x3f')](_0x41a784);})['then'](function(_0x2f59c9){_0x2b8b5e[_0x2d36('0x40')]=_0x2f59c9;return _0x2b8b5e;})[_0x2d36('0x24')](respondWithFilteredResult(_0x120f0d,_0x41a784))['catch'](handleError(_0x120f0d,null));};exports[_0x2d36('0x41')]=function(_0x4cea3e,_0x137bd6){var _0x149167={'raw':!![],'where':{'id':_0x4cea3e[_0x2d36('0x42')]['id']}},_0x4c1c4d={};_0x4c1c4d[_0x2d36('0x2d')]=_[_0x2d36('0x43')](db[_0x2d36('0x3d')][_0x2d36('0x2a')]);_0x4c1c4d[_0x2d36('0x2e')]=_[_0x2d36('0x43')](_0x4cea3e['query']);_0x4c1c4d[_0x2d36('0x38')]=_[_0x2d36('0x2f')](_0x4c1c4d[_0x2d36('0x2d')],_0x4c1c4d[_0x2d36('0x2e')]);_0x149167[_0x2d36('0x30')]=_[_0x2d36('0x2f')](_0x4c1c4d[_0x2d36('0x2d')],qs[_0x2d36('0x44')](_0x4cea3e[_0x2d36('0x2e')][_0x2d36('0x44')]));_0x149167[_0x2d36('0x30')]=_0x149167['attributes'][_0x2d36('0x31')]?_0x149167['attributes']:_0x4c1c4d[_0x2d36('0x2d')];if(_0x4cea3e['query']['includeAll']){_0x149167[_0x2d36('0x3e')]=[{'all':!![]}];}_0x149167=_[_0x2d36('0x3a')]({},_0x149167,_0x4cea3e[_0x2d36('0x3c')]);return db['FaxApplication'][_0x2d36('0x45')](_0x149167)[_0x2d36('0x24')](handleEntityNotFound(_0x137bd6,null))[_0x2d36('0x24')](respondWithResult(_0x137bd6,null))[_0x2d36('0x46')](handleError(_0x137bd6,null));};exports[_0x2d36('0x47')]=function(_0x49a01b,_0x54a71e){return db[_0x2d36('0x3d')]['create'](_0x49a01b[_0x2d36('0x48')],{})[_0x2d36('0x24')](respondWithResult(_0x54a71e,0xc9))[_0x2d36('0x46')](handleError(_0x54a71e,null));};exports[_0x2d36('0x22')]=function(_0x38c1ea,_0x29abd1){if(_0x38c1ea[_0x2d36('0x48')]['id']){delete _0x38c1ea[_0x2d36('0x48')]['id'];}return db[_0x2d36('0x3d')][_0x2d36('0x45')]({'where':{'id':_0x38c1ea[_0x2d36('0x42')]['id']}})[_0x2d36('0x24')](handleEntityNotFound(_0x29abd1,null))[_0x2d36('0x24')](saveUpdates(_0x38c1ea[_0x2d36('0x48')],null))[_0x2d36('0x24')](respondWithResult(_0x29abd1,null))[_0x2d36('0x46')](handleError(_0x29abd1,null));};exports['destroy']=function(_0x283eef,_0x49745f){return db['FaxApplication']['find']({'where':{'id':_0x283eef[_0x2d36('0x42')]['id']}})['then'](handleEntityNotFound(_0x49745f,null))[_0x2d36('0x24')](removeEntity(_0x49745f,null))[_0x2d36('0x46')](handleError(_0x49745f,null));}; \ No newline at end of file +var _0x882c=['apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','FaxApplication','includeAll','findAll','rows','catch','show','params','length','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x48f763,_0x52b2d1){var _0x4da63f=function(_0x33ea2c){while(--_0x33ea2c){_0x48f763['push'](_0x48f763['shift']());}};_0x4da63f(++_0x52b2d1);}(_0x882c,0x1a6));var _0xc882=function(_0x3e186f,_0x2eb7be){_0x3e186f=_0x3e186f-0x0;var _0x3595bf=_0x882c[_0x3e186f];return _0x3595bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc882('0x0'));var zipdir=require(_0xc882('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc882('0x2'));var moment=require(_0xc882('0x3'));var BPromise=require(_0xc882('0x4'));var Mustache=require(_0xc882('0x5'));var util=require('util');var path=require(_0xc882('0x6'));var sox=require(_0xc882('0x7'));var csv=require('to-csv');var ejs=require(_0xc882('0x8'));var fs=require('fs');var fs_extra=require(_0xc882('0x9'));var _=require(_0xc882('0xa'));var squel=require(_0xc882('0xb'));var crypto=require('crypto');var jsforce=require(_0xc882('0xc'));var deskjs=require(_0xc882('0xd'));var toCsv=require(_0xc882('0xe'));var querystring=require(_0xc882('0xf'));var Papa=require(_0xc882('0x10'));var Redis=require(_0xc882('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc882('0x12'));var hardwareService=require(_0xc882('0x13'));var logger=require('../../config/logger')(_0xc882('0x14'));var utils=require(_0xc882('0x15'));var config=require(_0xc882('0x16'));var licenseUtil=require(_0xc882('0x17'));var db=require(_0xc882('0x18'))['db'];function respondWithStatusCode(_0x213293,_0x17031c){_0x17031c=_0x17031c||0xcc;return function(_0x264f0e){if(_0x264f0e){return _0x213293[_0xc882('0x19')](_0x17031c);}return _0x213293['status'](_0x17031c)['end']();};}function respondWithResult(_0x579121,_0x5a505e){_0x5a505e=_0x5a505e||0xc8;return function(_0x437c33){if(_0x437c33){return _0x579121[_0xc882('0x1a')](_0x5a505e)[_0xc882('0x1b')](_0x437c33);}};}function respondWithFilteredResult(_0x4d630e,_0x112a23){return function(_0x14c142){if(_0x14c142){var _0x3210db=typeof _0x112a23[_0xc882('0x1c')]===_0xc882('0x1d')&&typeof _0x112a23[_0xc882('0x1e')]===_0xc882('0x1d');var _0xcc5770=_0x14c142[_0xc882('0x1f')];var _0x2b1bb4=_0x3210db?0x0:_0x112a23[_0xc882('0x1c')];var _0x994184=_0x3210db?_0x14c142['count']:_0x112a23['offset']+_0x112a23[_0xc882('0x1e')];var _0x3b2e70;if(_0x994184>=_0xcc5770){_0x994184=_0xcc5770;_0x3b2e70=0xc8;}else{_0x3b2e70=0xce;}_0x4d630e[_0xc882('0x1a')](_0x3b2e70);return _0x4d630e[_0xc882('0x20')](_0xc882('0x21'),_0x2b1bb4+'-'+_0x994184+'/'+_0xcc5770)[_0xc882('0x1b')](_0x14c142);}return null;};}function patchUpdates(_0x3a46b7){return function(_0x28d849){try{jsonpatch[_0xc882('0x22')](_0x28d849,_0x3a46b7,!![]);}catch(_0x44a1aa){return BPromise[_0xc882('0x23')](_0x44a1aa);}return _0x28d849[_0xc882('0x24')]();};}function saveUpdates(_0x27dbd7,_0x2cfa4f){return function(_0x2a2d5f){if(_0x2a2d5f){return _0x2a2d5f[_0xc882('0x25')](_0x27dbd7)[_0xc882('0x26')](function(_0x5f40c2){return _0x5f40c2;});}return null;};}function removeEntity(_0x31f257,_0xda6f8b){return function(_0x2219a6){if(_0x2219a6){return _0x2219a6[_0xc882('0x27')]()[_0xc882('0x26')](function(){_0x31f257[_0xc882('0x1a')](0xcc)[_0xc882('0x28')]();});}};}function handleEntityNotFound(_0x536df5,_0x289ce4){return function(_0x47ea87){if(!_0x47ea87){_0x536df5['sendStatus'](0x194);}return _0x47ea87;};}function handleError(_0x50e756,_0x59f590){_0x59f590=_0x59f590||0x1f4;return function(_0x761d02){logger[_0xc882('0x29')](_0x761d02[_0xc882('0x2a')]);if(_0x761d02['name']){delete _0x761d02[_0xc882('0x2b')];}_0x50e756[_0xc882('0x1a')](_0x59f590)[_0xc882('0x2c')](_0x761d02);};}exports[_0xc882('0x2d')]=function(_0x43f289,_0x2c42b1){var _0x2a5d1e={},_0x52716e={},_0x3edd32={'count':0x0,'rows':[]};var _0x2b00e4=_[_0xc882('0x2e')](db['FaxApplication'][_0xc882('0x2f')],function(_0x2a33a2){return{'name':_0x2a33a2[_0xc882('0x30')],'type':_0x2a33a2[_0xc882('0x31')]['key']};});_0x52716e[_0xc882('0x32')]=_['map'](_0x2b00e4,'name');_0x52716e[_0xc882('0x33')]=_[_0xc882('0x34')](_0x43f289[_0xc882('0x33')]);_0x52716e['filters']=_[_0xc882('0x35')](_0x52716e['model'],_0x52716e['query']);_0x2a5d1e[_0xc882('0x36')]=_[_0xc882('0x35')](_0x52716e[_0xc882('0x32')],qs[_0xc882('0x37')](_0x43f289[_0xc882('0x33')][_0xc882('0x37')]));_0x2a5d1e[_0xc882('0x36')]=_0x2a5d1e[_0xc882('0x36')]['length']?_0x2a5d1e[_0xc882('0x36')]:_0x52716e[_0xc882('0x32')];if(!_0x43f289[_0xc882('0x33')][_0xc882('0x38')](_0xc882('0x39'))){_0x2a5d1e[_0xc882('0x1e')]=qs[_0xc882('0x1e')](_0x43f289[_0xc882('0x33')][_0xc882('0x1e')]);_0x2a5d1e['offset']=qs[_0xc882('0x1c')](_0x43f289[_0xc882('0x33')]['offset']);}_0x2a5d1e[_0xc882('0x3a')]=qs['sort'](_0x43f289[_0xc882('0x33')][_0xc882('0x3b')]);_0x2a5d1e[_0xc882('0x3c')]=qs[_0xc882('0x3d')](_[_0xc882('0x3e')](_0x43f289[_0xc882('0x33')],_0x52716e['filters']),_0x2b00e4);if(_0x43f289[_0xc882('0x33')][_0xc882('0x3f')]){_0x2a5d1e['where']=_[_0xc882('0x40')](_0x2a5d1e[_0xc882('0x3c')],{'$or':_['map'](_0x2b00e4,function(_0x222638){if(_0x222638['type']!=='VIRTUAL'){var _0xd6886c={};_0xd6886c[_0x222638[_0xc882('0x2b')]]={'$like':'%'+_0x43f289[_0xc882('0x33')]['filter']+'%'};return _0xd6886c;}})});}_0x2a5d1e=_[_0xc882('0x40')]({},_0x2a5d1e,_0x43f289[_0xc882('0x41')]);var _0x570ccd={'where':_0x2a5d1e[_0xc882('0x3c')]};return db[_0xc882('0x42')][_0xc882('0x1f')](_0x570ccd)[_0xc882('0x26')](function(_0x2cbac8){_0x3edd32[_0xc882('0x1f')]=_0x2cbac8;if(_0x43f289[_0xc882('0x33')][_0xc882('0x43')]){_0x2a5d1e['include']=[{'all':!![]}];}return db[_0xc882('0x42')][_0xc882('0x44')](_0x2a5d1e);})['then'](function(_0xdf7508){_0x3edd32[_0xc882('0x45')]=_0xdf7508;return _0x3edd32;})[_0xc882('0x26')](respondWithFilteredResult(_0x2c42b1,_0x2a5d1e))[_0xc882('0x46')](handleError(_0x2c42b1,null));};exports[_0xc882('0x47')]=function(_0x35964c,_0x4050f8){var _0x84adc8={'raw':!![],'where':{'id':_0x35964c[_0xc882('0x48')]['id']}},_0x5b1850={};_0x5b1850[_0xc882('0x32')]=_['keys'](db[_0xc882('0x42')]['rawAttributes']);_0x5b1850['query']=_['keys'](_0x35964c[_0xc882('0x33')]);_0x5b1850['filters']=_['intersection'](_0x5b1850[_0xc882('0x32')],_0x5b1850[_0xc882('0x33')]);_0x84adc8['attributes']=_[_0xc882('0x35')](_0x5b1850[_0xc882('0x32')],qs[_0xc882('0x37')](_0x35964c[_0xc882('0x33')]['fields']));_0x84adc8[_0xc882('0x36')]=_0x84adc8['attributes'][_0xc882('0x49')]?_0x84adc8[_0xc882('0x36')]:_0x5b1850[_0xc882('0x32')];if(_0x35964c[_0xc882('0x33')]['includeAll']){_0x84adc8['include']=[{'all':!![]}];}_0x84adc8=_[_0xc882('0x40')]({},_0x84adc8,_0x35964c[_0xc882('0x41')]);return db['FaxApplication']['find'](_0x84adc8)[_0xc882('0x26')](handleEntityNotFound(_0x4050f8,null))[_0xc882('0x26')](respondWithResult(_0x4050f8,null))['catch'](handleError(_0x4050f8,null));};exports['create']=function(_0x85bcf2,_0x54d2dc){return db[_0xc882('0x42')]['create'](_0x85bcf2[_0xc882('0x4a')],{})[_0xc882('0x26')](respondWithResult(_0x54d2dc,0xc9))[_0xc882('0x46')](handleError(_0x54d2dc,null));};exports[_0xc882('0x25')]=function(_0x3d2319,_0x51eb95){if(_0x3d2319[_0xc882('0x4a')]['id']){delete _0x3d2319['body']['id'];}return db[_0xc882('0x42')][_0xc882('0x4b')]({'where':{'id':_0x3d2319['params']['id']}})[_0xc882('0x26')](handleEntityNotFound(_0x51eb95,null))[_0xc882('0x26')](saveUpdates(_0x3d2319[_0xc882('0x4a')],null))[_0xc882('0x26')](respondWithResult(_0x51eb95,null))[_0xc882('0x46')](handleError(_0x51eb95,null));};exports[_0xc882('0x27')]=function(_0x44d949,_0x5b7179){return db[_0xc882('0x42')][_0xc882('0x4b')]({'where':{'id':_0x44d949[_0xc882('0x48')]['id']}})[_0xc882('0x26')](handleEntityNotFound(_0x5b7179,null))[_0xc882('0x26')](removeEntity(_0x5b7179,null))['catch'](handleError(_0x5b7179,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 93c1fe4..166dbe3 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 _0x3ff0=['../../config/logger','bluebird','request-promise','path','rimraf','./faxApplication.attributes','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x8d4a5c,_0x59ee6e){var _0x4714ba=function(_0x5ba9ba){while(--_0x5ba9ba){_0x8d4a5c['push'](_0x8d4a5c['shift']());}};_0x4714ba(++_0x59ee6e);}(_0x3ff0,0xdb));var _0x03ff=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x3ff0[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0x03ff('0x0'));var util=require('util');var logger=require(_0x03ff('0x1'))('api');var moment=require('moment');var BPromise=require(_0x03ff('0x2'));var rp=require(_0x03ff('0x3'));var fs=require('fs');var path=require(_0x03ff('0x4'));var rimraf=require(_0x03ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x03ff('0x6'));module['exports']=function(_0x33f38e,_0x52dbf8){return _0x33f38e['define']('FaxApplication',attributes,{'tableName':_0x03ff('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03ff('0x8'),'collate':_0x03ff('0x9')});}; \ No newline at end of file +var _0xe45e=['fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x337d98,_0x487f68){var _0x499bf8=function(_0x5cf7b3){while(--_0x5cf7b3){_0x337d98['push'](_0x337d98['shift']());}};_0x499bf8(++_0x487f68);}(_0xe45e,0x16a));var _0xee45=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0xe45e[_0x2cacef];return _0x289ba6;};'use strict';var _=require(_0xee45('0x0'));var util=require(_0xee45('0x1'));var logger=require(_0xee45('0x2'))(_0xee45('0x3'));var moment=require('moment');var BPromise=require(_0xee45('0x4'));var rp=require(_0xee45('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee45('0x6'));var config=require(_0xee45('0x7'));var attributes=require('./faxApplication.attributes');module[_0xee45('0x8')]=function(_0x46f2c9,_0xc5241b){return _0x46f2c9[_0xee45('0x9')]('FaxApplication',attributes,{'tableName':_0xee45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xee45('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 079c5e6..224d808 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 _0x3f32=['http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x580a59,_0x21266c){var _0x19da51=function(_0x772ac8){while(--_0x772ac8){_0x580a59['push'](_0x580a59['shift']());}};_0x19da51(++_0x21266c);}(_0x3f32,0x160));var _0x23f3=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0x3f32[_0x2e067a];return _0xc64976;};'use strict';var _=require(_0x23f3('0x0'));var util=require(_0x23f3('0x1'));var moment=require(_0x23f3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23f3('0x3'));var fs=require('fs');var Redis=require(_0x23f3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x23f3('0x5'));var logger=require(_0x23f3('0x6'))(_0x23f3('0x7'));var config=require(_0x23f3('0x8'));var jayson=require(_0x23f3('0x9'));var client=jayson[_0x23f3('0xa')][_0x23f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e926,_0x462a6e,_0x23acf7){return new BPromise(function(_0x5db79b,_0x5e3900){return client[_0x23f3('0xc')](_0x12e926,_0x23acf7)[_0x23f3('0xd')](function(_0x2af775){logger[_0x23f3('0xe')](_0x23f3('0xf'),_0x462a6e,_0x23f3('0x10'));logger[_0x23f3('0x11')](_0x23f3('0x12'),_0x462a6e,_0x23f3('0x10'),JSON['stringify'](_0x2af775));if(_0x2af775[_0x23f3('0x13')]){if(_0x2af775['error'][_0x23f3('0x14')]===0x1f4){logger[_0x23f3('0x13')]('FaxApplication,\x20%s,\x20%s',_0x462a6e,_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);return _0x5e3900(_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);}logger['error'](_0x23f3('0xf'),_0x462a6e,_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);return _0x5db79b(_0x2af775[_0x23f3('0x13')][_0x23f3('0x15')]);}else{logger[_0x23f3('0xe')]('FaxApplication,\x20%s,\x20%s',_0x462a6e,_0x23f3('0x10'));_0x5db79b(_0x2af775[_0x23f3('0x16')][_0x23f3('0x15')]);}})[_0x23f3('0x17')](function(_0x578e12){logger[_0x23f3('0x13')](_0x23f3('0xf'),_0x462a6e,_0x578e12);_0x5e3900(_0x578e12);});});}exports[_0x23f3('0x18')]=function(_0x45c239){var _0x1dcc7f=this;return new Promise(function(_0x1b1ce9,_0x220b91){return db[_0x23f3('0x19')][_0x23f3('0x1a')](_0x45c239[_0x23f3('0x1b')],{'raw':_0x45c239[_0x23f3('0x1c')]?_0x45c239[_0x23f3('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45c239[_0x23f3('0x1c')]?_0x45c239[_0x23f3('0x1c')][_0x23f3('0x1d')]||null:null,'attributes':_0x45c239['options']?_0x45c239['options'][_0x23f3('0x1e')]||null:null,'limit':_0x45c239['options']?_0x45c239['options'][_0x23f3('0x1f')]||null:null})[_0x23f3('0xd')](function(_0x540709){logger[_0x23f3('0xe')](_0x23f3('0x18'),_0x45c239);logger['debug']('UpdateFaxApplication',_0x45c239,JSON[_0x23f3('0x20')](_0x540709));_0x1b1ce9(_0x540709);})[_0x23f3('0x17')](function(_0x34ffd4){logger['error'](_0x23f3('0x18'),_0x34ffd4[_0x23f3('0x15')],_0x45c239);_0x220b91(_0x1dcc7f[_0x23f3('0x13')](0x1f4,_0x34ffd4[_0x23f3('0x15')]));});});}; \ No newline at end of file +var _0x30ef=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','UpdateFaxApplication','update','body','options','raw','where','attributes','catch'];(function(_0x11acac,_0x37d55f){var _0x1daa7e=function(_0x31d253){while(--_0x31d253){_0x11acac['push'](_0x11acac['shift']());}};_0x1daa7e(++_0x37d55f);}(_0x30ef,0x129));var _0xf30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf30e('0x0'));var util=require(_0xf30e('0x1'));var moment=require(_0xf30e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf30e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf30e('0x4'))['db'];var utils=require(_0xf30e('0x5'));var logger=require(_0xf30e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf30e('0x7'));var client=jayson[_0xf30e('0x8')][_0xf30e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x275039,_0x50a731,_0x15e980){return new BPromise(function(_0x461f53,_0x506d8c){return client[_0xf30e('0xa')](_0x275039,_0x15e980)[_0xf30e('0xb')](function(_0xd03d10){logger[_0xf30e('0xc')](_0xf30e('0xd'),_0x50a731,_0xf30e('0xe'));logger[_0xf30e('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x50a731,'request\x20sent',JSON[_0xf30e('0x10')](_0xd03d10));if(_0xd03d10[_0xf30e('0x11')]){if(_0xd03d10['error']['code']===0x1f4){logger['error'](_0xf30e('0xd'),_0x50a731,_0xd03d10['error'][_0xf30e('0x12')]);return _0x506d8c(_0xd03d10[_0xf30e('0x11')][_0xf30e('0x12')]);}logger[_0xf30e('0x11')](_0xf30e('0xd'),_0x50a731,_0xd03d10[_0xf30e('0x11')][_0xf30e('0x12')]);return _0x461f53(_0xd03d10[_0xf30e('0x11')][_0xf30e('0x12')]);}else{logger[_0xf30e('0xc')](_0xf30e('0xd'),_0x50a731,'request\x20sent');_0x461f53(_0xd03d10['result'][_0xf30e('0x12')]);}})['catch'](function(_0x4e5b26){logger['error'](_0xf30e('0xd'),_0x50a731,_0x4e5b26);_0x506d8c(_0x4e5b26);});});}exports[_0xf30e('0x13')]=function(_0x26c099){var _0x410543=this;return new Promise(function(_0x4e9a1c,_0x16d1ab){return db['FaxApplication'][_0xf30e('0x14')](_0x26c099[_0xf30e('0x15')],{'raw':_0x26c099['options']?_0x26c099[_0xf30e('0x16')][_0xf30e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26c099[_0xf30e('0x16')]?_0x26c099['options'][_0xf30e('0x18')]||null:null,'attributes':_0x26c099[_0xf30e('0x16')]?_0x26c099[_0xf30e('0x16')][_0xf30e('0x19')]||null:null,'limit':_0x26c099[_0xf30e('0x16')]?_0x26c099[_0xf30e('0x16')]['limit']||null:null})[_0xf30e('0xb')](function(_0x3e5245){logger[_0xf30e('0xc')](_0xf30e('0x13'),_0x26c099);logger[_0xf30e('0xf')]('UpdateFaxApplication',_0x26c099,JSON[_0xf30e('0x10')](_0x3e5245));_0x4e9a1c(_0x3e5245);})[_0xf30e('0x1a')](function(_0x323903){logger[_0xf30e('0x11')](_0xf30e('0x13'),_0x323903[_0xf30e('0x12')],_0x26c099);_0x16d1ab(_0x410543[_0xf30e('0x11')](0x1f4,_0x323903['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d931859..940a42e 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 _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x4317d0,_0x2d972b){var _0x25ce3a=function(_0x429110){while(--_0x429110){_0x4317d0['push'](_0x4317d0['shift']());}};_0x25ce3a(++_0x2d972b);}(_0x5c00,0x17e));var _0x05c0=function(_0x4cb231,_0x3d3c5b){_0x4cb231=_0x4cb231-0x0;var _0x4d5063=_0x5c00[_0x4cb231];return _0x4d5063;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0598=['../../components/auth/service','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x973f6e,_0x2df734){var _0x3959a6=function(_0x55dd6c){while(--_0x55dd6c){_0x973f6e['push'](_0x973f6e['shift']());}};_0x3959a6(++_0x2df734);}(_0x0598,0x92));var _0x8059=function(_0x2db6c0,_0x1fe0ab){_0x2db6c0=_0x2db6c0-0x0;var _0x3a2e45=_0x0598[_0x2db6c0];return _0x3a2e45;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxApplication.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8059('0xa')](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router[_0x8059('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0xd')]);module[_0x8059('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 028a2b9..48deafd 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 _0x4646=['out','BOOLEAN','STRING','DATE','ENUM'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4646,0x191));var _0x6464=function(_0x335586,_0x249160){_0x335586=_0x335586-0x0;var _0x4c5d42=_0x4646[_0x335586];return _0x4c5d42;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x6464('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6464('0x1')]},'secondDisposition':{'type':Sequelize[_0x6464('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6464('0x1')]},'read1stAt':{'type':Sequelize[_0x6464('0x2')]},'fax':{'type':Sequelize[_0x6464('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x6464('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6464('0x3')]('in',_0x6464('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xc4ee=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0xc4ee,0x19f));var _0xec4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4ee[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xec4e('0x0')]={'closed':{'type':Sequelize[_0xec4e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xec4e('0x2')]},'disposition':{'type':Sequelize[_0xec4e('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xec4e('0x3')]},'note':{'type':Sequelize[_0xec4e('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xec4e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xec4e('0x4')]('in',_0xec4e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'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 e2b26b0..160ef83 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 _0xa704=['download','toString','join','root','files','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','status','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','findAll','fax','query','user','catch','show','params','model','keys','attributes','intersection','fields','includeAll','merge','options','find','body','update','describe','FaxMessage','addMessage','omit','getMessages','filters','length','nolimit','order','where','pick','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','ids','spread','Tag','color','emit','faxInteractionTags:save','removeTags'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa704,0x1b7));var _0x4a70=function(_0x29a134,_0x194c27){_0x29a134=_0x29a134-0x0;var _0x136398=_0xa704[_0x29a134];return _0x136398;};'use strict';var rimraf=require(_0x4a70('0x0'));var zipdir=require('zip-dir');var moment=require(_0x4a70('0x1'));var BPromise=require(_0x4a70('0x2'));var util=require(_0x4a70('0x3'));var path=require(_0x4a70('0x4'));var fs=require('fs');var _=require(_0x4a70('0x5'));var Redis=require(_0x4a70('0x6'));var interaction=require(_0x4a70('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x4a70('0x8'))(_0x4a70('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4a70('0xa')]=_[_0x4a70('0xb')](config['redis'],{'host':_0x4a70('0xc'),'port':0x18eb});var socket=require(_0x4a70('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x4a70('0xe')](socket);function respondWithStatusCode(_0x49bbe4,_0x5c12da){_0x5c12da=_0x5c12da||0xcc;return function(_0xd6b26c){if(_0xd6b26c){return _0x49bbe4[_0x4a70('0xf')](_0x5c12da);}return _0x49bbe4['status'](_0x5c12da)[_0x4a70('0x10')]();};}function respondWithResult(_0x3f7658,_0xf6f486){_0xf6f486=_0xf6f486||0xc8;return function(_0x3c59ce){if(_0x3c59ce){return _0x3f7658['status'](_0xf6f486)[_0x4a70('0x11')](_0x3c59ce);}};}function respondWithFilteredResult(_0x246b6b,_0x3f55b3){return function(_0x33d30c){if(_0x33d30c){var _0x4c1cc1=typeof _0x3f55b3[_0x4a70('0x12')]===_0x4a70('0x13')&&typeof _0x3f55b3[_0x4a70('0x14')]===_0x4a70('0x13');var _0x377a86=_0x33d30c[_0x4a70('0x15')];var _0x5b400b=_0x4c1cc1?0x0:_0x3f55b3['offset'];var _0x26920f=_0x4c1cc1?_0x33d30c[_0x4a70('0x15')]:_0x3f55b3['offset']+_0x3f55b3[_0x4a70('0x14')];var _0x5d79a7;if(_0x26920f>=_0x377a86){_0x26920f=_0x377a86;_0x5d79a7=0xc8;}else{_0x5d79a7=0xce;}_0x246b6b['status'](_0x5d79a7);return _0x246b6b[_0x4a70('0x16')](_0x4a70('0x17'),_0x5b400b+'-'+_0x26920f+'/'+_0x377a86)[_0x4a70('0x11')](_0x33d30c);}return null;};}function saveUpdates(_0xa7ca00){return function(_0x249074){if(_0x249074){return _0x249074['update'](_0xa7ca00)[_0x4a70('0x18')](function(_0x5bbd4b){return _0x5bbd4b;});}return null;};}function removeEntity(_0x524d50){return function(_0x4f031f){if(_0x4f031f){return _0x4f031f[_0x4a70('0x19')]()[_0x4a70('0x18')](function(){_0x524d50[_0x4a70('0x1a')](0xcc)[_0x4a70('0x10')]();});}};}function handleEntityNotFound(_0x181e3d){return function(_0x41d485){if(!_0x41d485){_0x181e3d[_0x4a70('0xf')](0x194);}return _0x41d485;};}function handleError(_0x3a231d,_0x221407){_0x221407=_0x221407||0x1f4;return function(_0x490304){logger[_0x4a70('0x1b')](_0x490304[_0x4a70('0x1c')]);if(_0x490304[_0x4a70('0x1d')]){delete _0x490304[_0x4a70('0x1d')];}_0x3a231d['status'](_0x221407)[_0x4a70('0x1e')](_0x490304);};}exports[_0x4a70('0x1f')]=function(_0x52546a,_0x4fb05d){var _0x573987={};var _0x22186c=_[_0x4a70('0x20')](db[_0x4a70('0x21')][_0x4a70('0x22')],function(_0x111853){return{'name':_0x111853[_0x4a70('0x23')],'type':_0x111853[_0x4a70('0x24')]['key']};});_0x573987=qs['getOptions'](_0x22186c,_0x52546a);return interaction[_0x4a70('0x25')](_0x4a70('0x26'),_0x52546a[_0x4a70('0x27')],_0x52546a[_0x4a70('0x28')],_0x573987,_0x22186c)[_0x4a70('0x18')](respondWithFilteredResult(_0x4fb05d,_0x573987))[_0x4a70('0x29')](handleError(_0x4fb05d,null));};exports[_0x4a70('0x2a')]=function(_0x4b643b,_0x4a79d4){var _0x2afebb={'raw':![],'where':{'id':_0x4b643b[_0x4a70('0x2b')]['id']}},_0xb9b72a={};_0xb9b72a[_0x4a70('0x2c')]=_[_0x4a70('0x2d')](db['FaxInteraction'][_0x4a70('0x22')]);_0xb9b72a[_0x4a70('0x27')]=_[_0x4a70('0x2d')](_0x4b643b[_0x4a70('0x27')]);_0xb9b72a['filters']=_['intersection'](_0xb9b72a[_0x4a70('0x2c')],_0xb9b72a[_0x4a70('0x27')]);_0x2afebb[_0x4a70('0x2e')]=_[_0x4a70('0x2f')](_0xb9b72a[_0x4a70('0x2c')],qs[_0x4a70('0x30')](_0x4b643b[_0x4a70('0x27')][_0x4a70('0x30')]));_0x2afebb[_0x4a70('0x2e')]=_0x2afebb[_0x4a70('0x2e')]['length']?_0x2afebb[_0x4a70('0x2e')]:_0xb9b72a[_0x4a70('0x2c')];if(_0x4b643b['query'][_0x4a70('0x31')]){_0x2afebb['include']=[{'all':!![]}];}_0x2afebb=_[_0x4a70('0x32')]({},_0x2afebb,_0x4b643b[_0x4a70('0x33')]);return db[_0x4a70('0x21')][_0x4a70('0x34')](_0x2afebb)['then'](handleEntityNotFound(_0x4a79d4,null))[_0x4a70('0x18')](respondWithResult(_0x4a79d4,null))[_0x4a70('0x29')](handleError(_0x4a79d4,null));};exports['create']=function(_0x5d1271,_0x288612){return db['FaxInteraction']['create'](_0x5d1271[_0x4a70('0x35')],{})[_0x4a70('0x18')](respondWithResult(_0x288612,0xc9))[_0x4a70('0x29')](handleError(_0x288612,null));};exports[_0x4a70('0x36')]=function(_0x55388e,_0x258bf3){if(_0x55388e[_0x4a70('0x35')]['id']){delete _0x55388e['body']['id'];}return db['FaxInteraction'][_0x4a70('0x34')]({'where':{'id':_0x55388e[_0x4a70('0x2b')]['id']}})['then'](handleEntityNotFound(_0x258bf3,null))[_0x4a70('0x18')](saveUpdates(_0x55388e[_0x4a70('0x35')],null))[_0x4a70('0x18')](respondWithResult(_0x258bf3,null))[_0x4a70('0x29')](handleError(_0x258bf3,null));};exports['destroy']=function(_0x98aa36,_0xa0afd7){return db[_0x4a70('0x21')]['find']({'where':{'id':_0x98aa36[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0xa0afd7,null))['then'](removeEntity(_0xa0afd7,null))[_0x4a70('0x29')](handleError(_0xa0afd7,null));};exports[_0x4a70('0x37')]=function(_0xe3620d,_0x58d1b3){return db[_0x4a70('0x21')][_0x4a70('0x37')]()[_0x4a70('0x18')](respondWithResult(_0x58d1b3,null))[_0x4a70('0x29')](handleError(_0x58d1b3,null));};exports['addMessage']=function(_0x20b252,_0x3318d1){return db[_0x4a70('0x38')]['find']({'where':{'id':_0x20b252[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0x3318d1,null))['then'](function(_0x5ec442){if(_0x5ec442){return _0x5ec442[_0x4a70('0x39')](_0x20b252['body']['ids'],_[_0x4a70('0x3a')](_0x20b252[_0x4a70('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x3318d1,null))[_0x4a70('0x29')](handleError(_0x3318d1,null));};exports[_0x4a70('0x3b')]=function(_0x568ef8,_0x18b246){var _0x56cf84={'raw':![],'where':{}};var _0x50a0d1={};var _0x381822={'count':0x0,'rows':[]};return db[_0x4a70('0x21')]['findOne']({'where':{'id':_0x568ef8[_0x4a70('0x2b')]['id']}})['then'](handleEntityNotFound(_0x18b246,null))[_0x4a70('0x18')](function(_0x7792e0){if(_0x7792e0){_0x50a0d1['model']=_[_0x4a70('0x2d')](db[_0x4a70('0x38')][_0x4a70('0x22')]);_0x50a0d1['query']=_[_0x4a70('0x2d')](_0x568ef8['query']);_0x50a0d1[_0x4a70('0x3c')]=_[_0x4a70('0x2f')](_0x50a0d1[_0x4a70('0x2c')],_0x50a0d1[_0x4a70('0x27')]);_0x56cf84[_0x4a70('0x2e')]=_[_0x4a70('0x2f')](_0x50a0d1[_0x4a70('0x2c')],qs[_0x4a70('0x30')](_0x568ef8[_0x4a70('0x27')][_0x4a70('0x30')]));_0x56cf84[_0x4a70('0x2e')]=_0x56cf84[_0x4a70('0x2e')][_0x4a70('0x3d')]?_0x56cf84[_0x4a70('0x2e')]:_0x50a0d1[_0x4a70('0x2c')];if(!_0x568ef8[_0x4a70('0x27')]['hasOwnProperty'](_0x4a70('0x3e'))){_0x56cf84[_0x4a70('0x14')]=qs['limit'](_0x568ef8['query'][_0x4a70('0x14')]);_0x56cf84[_0x4a70('0x12')]=qs[_0x4a70('0x12')](_0x568ef8[_0x4a70('0x27')][_0x4a70('0x12')]);}_0x56cf84[_0x4a70('0x3f')]=qs['sort'](_0x568ef8['query']['sort']);_0x56cf84[_0x4a70('0x40')]=qs[_0x4a70('0x3c')](_[_0x4a70('0x41')](_0x568ef8[_0x4a70('0x27')],_0x50a0d1[_0x4a70('0x3c')]));_0x56cf84[_0x4a70('0x40')]['FaxInteractionId']=_0x7792e0['id'];if(_0x568ef8[_0x4a70('0x27')][_0x4a70('0x42')]){_0x56cf84[_0x4a70('0x40')]=_['merge'](_0x56cf84[_0x4a70('0x40')],{'$or':_[_0x4a70('0x20')](_0x56cf84['attributes'],function(_0x16138f){var _0x5df17d={};_0x5df17d[_0x16138f]={'$like':'%'+_0x568ef8[_0x4a70('0x27')][_0x4a70('0x42')]+'%'};return _0x5df17d;})});}if(_0x568ef8[_0x4a70('0x27')]['$gte']){var _0xfc7f66=_0x568ef8[_0x4a70('0x27')]['$gte'][_0x4a70('0x43')](',');var _0x1038ed={};_0x1038ed[_0xfc7f66[0x0]]={'$gte':moment(_0xfc7f66[0x1])[_0x4a70('0x44')](_0x4a70('0x45'))};_0x56cf84[_0x4a70('0x40')]=_[_0x4a70('0x32')](_0x56cf84[_0x4a70('0x40')],_0x1038ed);}_0x56cf84=_[_0x4a70('0x32')]({},_0x56cf84,_0x568ef8['options']);return db['FaxMessage'][_0x4a70('0x15')]({'where':_0x56cf84[_0x4a70('0x40')]})[_0x4a70('0x18')](function(_0x3fd4e4){_0x381822[_0x4a70('0x15')]=_0x3fd4e4;if(_0x568ef8[_0x4a70('0x27')][_0x4a70('0x31')]){_0x56cf84[_0x4a70('0x46')]=[{'all':!![]}];}return db['FaxMessage'][_0x4a70('0x25')](_0x56cf84);})['then'](function(_0x5b62b7){_0x381822[_0x4a70('0x47')]=_0x5b62b7;return _0x381822;});}})['then'](respondWithFilteredResult(_0x18b246,_0x56cf84))[_0x4a70('0x29')](handleError(_0x18b246,null));};exports[_0x4a70('0x48')]=function(_0x574c87,_0x1fe795){return db['FaxInteraction'][_0x4a70('0x34')]({'where':{'id':_0x574c87[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0x1fe795,null))[_0x4a70('0x18')](function(_0x541faa){if(_0x541faa){return _0x541faa[_0x4a70('0x49')](_0x574c87[_0x4a70('0x35')][_0x4a70('0x4a')],_[_0x4a70('0x3a')](_0x574c87[_0x4a70('0x35')],[_0x4a70('0x4a'),'id'])||{})[_0x4a70('0x4b')](function(){return db[_0x4a70('0x4c')][_0x4a70('0x25')]({'attributes':['id',_0x4a70('0x1d'),_0x4a70('0x4d')],'where':{'id':_0x574c87[_0x4a70('0x35')]['ids']}});})[_0x4a70('0x18')](function(_0x3c5d40){socket[_0x4a70('0x4e')](_0x4a70('0x4f'),{'id':Number(_0x574c87[_0x4a70('0x2b')]['id']),'tags':_0x3c5d40||[]});return{'id':Number(_0x574c87[_0x4a70('0x2b')]['id']),'tags':_0x3c5d40||[]};});}})[_0x4a70('0x18')](respondWithResult(_0x1fe795,null))[_0x4a70('0x29')](handleError(_0x1fe795,null));};exports[_0x4a70('0x50')]=function(_0x3b26c3,_0x45534a){return db[_0x4a70('0x21')][_0x4a70('0x34')]({'where':{'id':_0x3b26c3[_0x4a70('0x2b')]['id']}})[_0x4a70('0x18')](handleEntityNotFound(_0x45534a,null))[_0x4a70('0x18')](function(_0x221a40){if(_0x221a40){return _0x221a40['removeTags'](_0x3b26c3['query']['ids']);}})[_0x4a70('0x18')](respondWithStatusCode(_0x45534a,null))[_0x4a70('0x29')](handleError(_0x45534a,null));};exports[_0x4a70('0x51')]=function(_0x2291f6,_0xf6de97){var _0xb9ddfa=moment()['unix']()[_0x4a70('0x52')]();var _0x97632f=path[_0x4a70('0x53')](config[_0x4a70('0x54')],'server',_0x4a70('0x55'),'tmp');var _0x6780f2=path[_0x4a70('0x53')](config[_0x4a70('0x54')],_0x4a70('0x56'),'files',_0x4a70('0x57'));var _0x1110a5=path[_0x4a70('0x53')](_0x97632f,_0xb9ddfa);var _0x1032b7=util[_0x4a70('0x44')](_0x4a70('0x58'),_0x2291f6[_0x4a70('0x2b')]['id'],_0xb9ddfa);var _0x35fe8d=path['join'](_0x97632f,_0x1032b7);var _0x2114b0=[];_0x2114b0[_0x4a70('0x59')]({'model':db[_0x4a70('0x5a')],'as':_0x4a70('0x5a'),'raw':!![]});var _0x202e48=[{'model':db[_0x4a70('0x38')],'as':_0x4a70('0x5b'),'attributes':['id',_0x4a70('0x35'),_0x4a70('0x5c')],'include':_0x2114b0}];return db[_0x4a70('0x21')][_0x4a70('0x34')]({'where':{'id':_0x2291f6[_0x4a70('0x2b')]['id']},'include':_0x202e48})['then'](handleEntityNotFound(_0xf6de97,null))[_0x4a70('0x18')](function(_0x150652){if(_0x150652&&_0x150652[_0x4a70('0x5b')]){var _0xe6d97c=_0x150652[_0x4a70('0x5d')]({'plain':!![]});fs[_0x4a70('0x5e')](_0x1110a5);for(var _0x2494dc=0x0;_0x2494dc<_0xe6d97c[_0x4a70('0x5b')][_0x4a70('0x3d')];_0x2494dc++){var _0x210dad=_0xe6d97c[_0x4a70('0x5b')][_0x2494dc][_0x4a70('0x5a')];if(_0x210dad){var _0x1ab3e0=path[_0x4a70('0x53')](_0x6780f2,_0x210dad[_0x4a70('0x5f')]);if(fs[_0x4a70('0x60')](_0x1ab3e0)){fs[_0x4a70('0x61')](_0x1ab3e0)[_0x4a70('0x62')](fs[_0x4a70('0x63')](path[_0x4a70('0x53')](_0x1110a5,_0x210dad[_0x4a70('0x5f')])));}}}return BPromise[_0x4a70('0x64')]()[_0x4a70('0x18')](function(){return new BPromise(function(_0x4228c7,_0x444780){zipdir(_0x1110a5,{'saveTo':_0x35fe8d},function(_0x398191,_0x4f409c){if(_0x398191)return _0x444780(_0x398191);return _0x4228c7(_0x4f409c);});})[_0x4a70('0x18')](function(){return new BPromise(function(_0x3f32c0,_0x1a2c6c){rimraf(_0x1110a5,function(_0x1e8b9b){if(_0x1e8b9b)_0x1a2c6c(_0x1e8b9b);return _0x3f32c0();});});})['then'](function(){return _0xf6de97[_0x4a70('0x51')](_0x35fe8d,_0x1032b7,function(_0x483b01){if(_0x483b01){console[_0x4a70('0x65')](_0x4a70('0x66'),_0x483b01);}else{fs[_0x4a70('0x67')](_0x35fe8d);}});});});}else{return _0xf6de97[_0x4a70('0xf')](0xc8);}})['catch'](handleError(_0xf6de97,null));}; \ No newline at end of file +var _0x36ff=['error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','user','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','update','body','describe','addMessage','FaxMessage','ids','getMessages','findOne','nolimit','order','sort','pick','where','FaxInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','setTags','omit','spread','Tag','color','faxInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','unlinkSync','rimraf','zip-dir','bluebird','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','json','offset','undefined','count','limit','Content-Range','destroy','then','status','sendStatus'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x36ff,0xb5));var _0xf36f=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x36ff[_0x5c351c];return _0x26f3b3;};'use strict';var rimraf=require(_0xf36f('0x0'));var zipdir=require(_0xf36f('0x1'));var moment=require('moment');var BPromise=require(_0xf36f('0x2'));var util=require(_0xf36f('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xf36f('0x4'));var interaction=require(_0xf36f('0x5'));var qs=require(_0xf36f('0x6'));var logger=require(_0xf36f('0x7'))(_0xf36f('0x8'));var config=require('../../config/environment');var db=require(_0xf36f('0x9'))['db'];config[_0xf36f('0xa')]=_[_0xf36f('0xb')](config[_0xf36f('0xa')],{'host':_0xf36f('0xc'),'port':0x18eb});var socket=require(_0xf36f('0xd'))(new Redis(config[_0xf36f('0xa')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4e24d2,_0x579f58){_0x579f58=_0x579f58||0xcc;return function(_0x1d6c87){if(_0x1d6c87){return _0x4e24d2['sendStatus'](_0x579f58);}return _0x4e24d2['status'](_0x579f58)[_0xf36f('0xe')]();};}function respondWithResult(_0x2a29dc,_0x5584af){_0x5584af=_0x5584af||0xc8;return function(_0x2deabc){if(_0x2deabc){return _0x2a29dc['status'](_0x5584af)[_0xf36f('0xf')](_0x2deabc);}};}function respondWithFilteredResult(_0x253ad2,_0x8aac4b){return function(_0x26bc4){if(_0x26bc4){var _0x5e5533=typeof _0x8aac4b[_0xf36f('0x10')]===_0xf36f('0x11')&&typeof _0x8aac4b['limit']===_0xf36f('0x11');var _0x5828eb=_0x26bc4['count'];var _0x41bd31=_0x5e5533?0x0:_0x8aac4b['offset'];var _0x46e01f=_0x5e5533?_0x26bc4[_0xf36f('0x12')]:_0x8aac4b['offset']+_0x8aac4b[_0xf36f('0x13')];var _0x1d3abe;if(_0x46e01f>=_0x5828eb){_0x46e01f=_0x5828eb;_0x1d3abe=0xc8;}else{_0x1d3abe=0xce;}_0x253ad2['status'](_0x1d3abe);return _0x253ad2['set'](_0xf36f('0x14'),_0x41bd31+'-'+_0x46e01f+'/'+_0x5828eb)[_0xf36f('0xf')](_0x26bc4);}return null;};}function saveUpdates(_0x306d26){return function(_0x52d8c8){if(_0x52d8c8){return _0x52d8c8['update'](_0x306d26)['then'](function(_0x3d713e){return _0x3d713e;});}return null;};}function removeEntity(_0x4140eb){return function(_0x3b1b13){if(_0x3b1b13){return _0x3b1b13[_0xf36f('0x15')]()[_0xf36f('0x16')](function(){_0x4140eb[_0xf36f('0x17')](0xcc)[_0xf36f('0xe')]();});}};}function handleEntityNotFound(_0x410193){return function(_0x3d9992){if(!_0x3d9992){_0x410193[_0xf36f('0x18')](0x194);}return _0x3d9992;};}function handleError(_0x30f396,_0x2f928e){_0x2f928e=_0x2f928e||0x1f4;return function(_0x53a808){logger[_0xf36f('0x19')](_0x53a808[_0xf36f('0x1a')]);if(_0x53a808[_0xf36f('0x1b')]){delete _0x53a808['name'];}_0x30f396[_0xf36f('0x17')](_0x2f928e)[_0xf36f('0x1c')](_0x53a808);};}exports[_0xf36f('0x1d')]=function(_0x4617e7,_0x4326da){var _0x273d67={};var _0x17e6bb=_[_0xf36f('0x1e')](db[_0xf36f('0x1f')][_0xf36f('0x20')],function(_0x4949be){return{'name':_0x4949be[_0xf36f('0x21')],'type':_0x4949be[_0xf36f('0x22')][_0xf36f('0x23')]};});_0x273d67=qs[_0xf36f('0x24')](_0x17e6bb,_0x4617e7);return interaction[_0xf36f('0x25')](_0xf36f('0x26'),_0x4617e7['query'],_0x4617e7[_0xf36f('0x27')],_0x273d67,_0x17e6bb)[_0xf36f('0x16')](respondWithFilteredResult(_0x4326da,_0x273d67))['catch'](handleError(_0x4326da,null));};exports[_0xf36f('0x28')]=function(_0x488e05,_0x312078){var _0x59af2d={'raw':![],'where':{'id':_0x488e05[_0xf36f('0x29')]['id']}},_0x5e9389={};_0x5e9389[_0xf36f('0x2a')]=_[_0xf36f('0x2b')](db[_0xf36f('0x1f')]['rawAttributes']);_0x5e9389['query']=_[_0xf36f('0x2b')](_0x488e05[_0xf36f('0x2c')]);_0x5e9389[_0xf36f('0x2d')]=_[_0xf36f('0x2e')](_0x5e9389['model'],_0x5e9389[_0xf36f('0x2c')]);_0x59af2d[_0xf36f('0x2f')]=_[_0xf36f('0x2e')](_0x5e9389[_0xf36f('0x2a')],qs[_0xf36f('0x30')](_0x488e05[_0xf36f('0x2c')][_0xf36f('0x30')]));_0x59af2d[_0xf36f('0x2f')]=_0x59af2d[_0xf36f('0x2f')][_0xf36f('0x31')]?_0x59af2d['attributes']:_0x5e9389[_0xf36f('0x2a')];if(_0x488e05[_0xf36f('0x2c')][_0xf36f('0x32')]){_0x59af2d['include']=[{'all':!![]}];}_0x59af2d=_[_0xf36f('0x33')]({},_0x59af2d,_0x488e05[_0xf36f('0x34')]);return db['FaxInteraction'][_0xf36f('0x35')](_0x59af2d)[_0xf36f('0x16')](handleEntityNotFound(_0x312078,null))['then'](respondWithResult(_0x312078,null))[_0xf36f('0x36')](handleError(_0x312078,null));};exports[_0xf36f('0x37')]=function(_0xabb1af,_0x5c17c0){return db['FaxInteraction'][_0xf36f('0x37')](_0xabb1af['body'],{})[_0xf36f('0x16')](respondWithResult(_0x5c17c0,0xc9))[_0xf36f('0x36')](handleError(_0x5c17c0,null));};exports[_0xf36f('0x38')]=function(_0x1028f8,_0xdc67ed){if(_0x1028f8[_0xf36f('0x39')]['id']){delete _0x1028f8[_0xf36f('0x39')]['id'];}return db[_0xf36f('0x1f')]['find']({'where':{'id':_0x1028f8[_0xf36f('0x29')]['id']}})[_0xf36f('0x16')](handleEntityNotFound(_0xdc67ed,null))[_0xf36f('0x16')](saveUpdates(_0x1028f8[_0xf36f('0x39')],null))[_0xf36f('0x16')](respondWithResult(_0xdc67ed,null))[_0xf36f('0x36')](handleError(_0xdc67ed,null));};exports[_0xf36f('0x15')]=function(_0x29c64c,_0x5d3668){return db['FaxInteraction'][_0xf36f('0x35')]({'where':{'id':_0x29c64c['params']['id']}})[_0xf36f('0x16')](handleEntityNotFound(_0x5d3668,null))['then'](removeEntity(_0x5d3668,null))['catch'](handleError(_0x5d3668,null));};exports[_0xf36f('0x3a')]=function(_0x986a7d,_0x4226b3){return db[_0xf36f('0x1f')][_0xf36f('0x3a')]()['then'](respondWithResult(_0x4226b3,null))[_0xf36f('0x36')](handleError(_0x4226b3,null));};exports[_0xf36f('0x3b')]=function(_0x12a7b6,_0x584f8a){return db[_0xf36f('0x3c')][_0xf36f('0x35')]({'where':{'id':_0x12a7b6['params']['id']}})['then'](handleEntityNotFound(_0x584f8a,null))[_0xf36f('0x16')](function(_0x150cdb){if(_0x150cdb){return _0x150cdb['addMessage'](_0x12a7b6[_0xf36f('0x39')][_0xf36f('0x3d')],_['omit'](_0x12a7b6[_0xf36f('0x39')],[_0xf36f('0x3d'),'id'])||{});}})[_0xf36f('0x16')](respondWithResult(_0x584f8a,null))[_0xf36f('0x36')](handleError(_0x584f8a,null));};exports[_0xf36f('0x3e')]=function(_0x5119b3,_0x260be0){var _0x257c91={'raw':![],'where':{}};var _0x2b8032={};var _0x469f04={'count':0x0,'rows':[]};return db[_0xf36f('0x1f')][_0xf36f('0x3f')]({'where':{'id':_0x5119b3[_0xf36f('0x29')]['id']}})[_0xf36f('0x16')](handleEntityNotFound(_0x260be0,null))[_0xf36f('0x16')](function(_0x13a64a){if(_0x13a64a){_0x2b8032[_0xf36f('0x2a')]=_[_0xf36f('0x2b')](db[_0xf36f('0x3c')][_0xf36f('0x20')]);_0x2b8032[_0xf36f('0x2c')]=_[_0xf36f('0x2b')](_0x5119b3['query']);_0x2b8032[_0xf36f('0x2d')]=_[_0xf36f('0x2e')](_0x2b8032[_0xf36f('0x2a')],_0x2b8032[_0xf36f('0x2c')]);_0x257c91[_0xf36f('0x2f')]=_[_0xf36f('0x2e')](_0x2b8032[_0xf36f('0x2a')],qs[_0xf36f('0x30')](_0x5119b3[_0xf36f('0x2c')][_0xf36f('0x30')]));_0x257c91[_0xf36f('0x2f')]=_0x257c91[_0xf36f('0x2f')]['length']?_0x257c91[_0xf36f('0x2f')]:_0x2b8032[_0xf36f('0x2a')];if(!_0x5119b3[_0xf36f('0x2c')]['hasOwnProperty'](_0xf36f('0x40'))){_0x257c91[_0xf36f('0x13')]=qs[_0xf36f('0x13')](_0x5119b3[_0xf36f('0x2c')][_0xf36f('0x13')]);_0x257c91['offset']=qs['offset'](_0x5119b3[_0xf36f('0x2c')]['offset']);}_0x257c91[_0xf36f('0x41')]=qs[_0xf36f('0x42')](_0x5119b3['query'][_0xf36f('0x42')]);_0x257c91['where']=qs['filters'](_[_0xf36f('0x43')](_0x5119b3['query'],_0x2b8032['filters']));_0x257c91[_0xf36f('0x44')][_0xf36f('0x45')]=_0x13a64a['id'];if(_0x5119b3[_0xf36f('0x2c')]['filter']){_0x257c91['where']=_[_0xf36f('0x33')](_0x257c91[_0xf36f('0x44')],{'$or':_[_0xf36f('0x1e')](_0x257c91[_0xf36f('0x2f')],function(_0x2112f3){var _0x5d9a41={};_0x5d9a41[_0x2112f3]={'$like':'%'+_0x5119b3[_0xf36f('0x2c')][_0xf36f('0x46')]+'%'};return _0x5d9a41;})});}if(_0x5119b3[_0xf36f('0x2c')][_0xf36f('0x47')]){var _0x3d19cd=_0x5119b3[_0xf36f('0x2c')][_0xf36f('0x47')]['split'](',');var _0x5369d7={};_0x5369d7[_0x3d19cd[0x0]]={'$gte':moment(_0x3d19cd[0x1])[_0xf36f('0x48')](_0xf36f('0x49'))};_0x257c91['where']=_[_0xf36f('0x33')](_0x257c91[_0xf36f('0x44')],_0x5369d7);}_0x257c91=_[_0xf36f('0x33')]({},_0x257c91,_0x5119b3[_0xf36f('0x34')]);return db[_0xf36f('0x3c')][_0xf36f('0x12')]({'where':_0x257c91['where']})[_0xf36f('0x16')](function(_0x2a4f32){_0x469f04[_0xf36f('0x12')]=_0x2a4f32;if(_0x5119b3[_0xf36f('0x2c')][_0xf36f('0x32')]){_0x257c91[_0xf36f('0x4a')]=[{'all':!![]}];}return db[_0xf36f('0x3c')][_0xf36f('0x25')](_0x257c91);})[_0xf36f('0x16')](function(_0x4e75ee){_0x469f04['rows']=_0x4e75ee;return _0x469f04;});}})[_0xf36f('0x16')](respondWithFilteredResult(_0x260be0,_0x257c91))[_0xf36f('0x36')](handleError(_0x260be0,null));};exports['addTags']=function(_0x5c110f,_0x2d1ed5){return db['FaxInteraction'][_0xf36f('0x35')]({'where':{'id':_0x5c110f['params']['id']}})['then'](handleEntityNotFound(_0x2d1ed5,null))[_0xf36f('0x16')](function(_0x454422){if(_0x454422){return _0x454422[_0xf36f('0x4b')](_0x5c110f['body'][_0xf36f('0x3d')],_[_0xf36f('0x4c')](_0x5c110f[_0xf36f('0x39')],[_0xf36f('0x3d'),'id'])||{})[_0xf36f('0x4d')](function(){return db[_0xf36f('0x4e')][_0xf36f('0x25')]({'attributes':['id','name',_0xf36f('0x4f')],'where':{'id':_0x5c110f[_0xf36f('0x39')]['ids']}});})[_0xf36f('0x16')](function(_0x35facc){socket['emit'](_0xf36f('0x50'),{'id':Number(_0x5c110f[_0xf36f('0x29')]['id']),'tags':_0x35facc||[]});return{'id':Number(_0x5c110f['params']['id']),'tags':_0x35facc||[]};});}})[_0xf36f('0x16')](respondWithResult(_0x2d1ed5,null))['catch'](handleError(_0x2d1ed5,null));};exports[_0xf36f('0x51')]=function(_0x45603d,_0x54b2d2){return db['FaxInteraction'][_0xf36f('0x35')]({'where':{'id':_0x45603d[_0xf36f('0x29')]['id']}})['then'](handleEntityNotFound(_0x54b2d2,null))[_0xf36f('0x16')](function(_0x16e344){if(_0x16e344){return _0x16e344[_0xf36f('0x51')](_0x45603d[_0xf36f('0x2c')][_0xf36f('0x3d')]);}})['then'](respondWithStatusCode(_0x54b2d2,null))[_0xf36f('0x36')](handleError(_0x54b2d2,null));};exports['download']=function(_0x3aa016,_0x590e02){var _0x5cb637=moment()[_0xf36f('0x52')]()[_0xf36f('0x53')]();var _0x363517=path[_0xf36f('0x54')](config[_0xf36f('0x55')],_0xf36f('0x56'),_0xf36f('0x57'),_0xf36f('0x58'));var _0x4a1c20=path[_0xf36f('0x54')](config[_0xf36f('0x55')],_0xf36f('0x56'),_0xf36f('0x57'),_0xf36f('0x59'));var _0x8595da=path[_0xf36f('0x54')](_0x363517,_0x5cb637);var _0x154073=util[_0xf36f('0x48')](_0xf36f('0x5a'),_0x3aa016[_0xf36f('0x29')]['id'],_0x5cb637);var _0x225a47=path[_0xf36f('0x54')](_0x363517,_0x154073);var _0x408ceb=[];_0x408ceb['push']({'model':db['Attachment'],'as':_0xf36f('0x5b'),'raw':!![]});var _0x53bfb8=[{'model':db[_0xf36f('0x3c')],'as':_0xf36f('0x5c'),'attributes':['id',_0xf36f('0x39'),_0xf36f('0x5d')],'include':_0x408ceb}];return db['FaxInteraction'][_0xf36f('0x35')]({'where':{'id':_0x3aa016[_0xf36f('0x29')]['id']},'include':_0x53bfb8})[_0xf36f('0x16')](handleEntityNotFound(_0x590e02,null))[_0xf36f('0x16')](function(_0x2abf19){if(_0x2abf19&&_0x2abf19['Messages']){var _0x59bc9d=_0x2abf19[_0xf36f('0x5e')]({'plain':!![]});fs[_0xf36f('0x5f')](_0x8595da);for(var _0x13e082=0x0;_0x13e082<_0x59bc9d[_0xf36f('0x5c')]['length'];_0x13e082++){var _0x4e5dd5=_0x59bc9d['Messages'][_0x13e082][_0xf36f('0x5b')];if(_0x4e5dd5){var _0x3d3d04=path[_0xf36f('0x54')](_0x4a1c20,_0x4e5dd5[_0xf36f('0x60')]);if(fs[_0xf36f('0x61')](_0x3d3d04)){fs[_0xf36f('0x62')](_0x3d3d04)[_0xf36f('0x63')](fs[_0xf36f('0x64')](path[_0xf36f('0x54')](_0x8595da,_0x4e5dd5[_0xf36f('0x60')])));}}}return BPromise['resolve']()[_0xf36f('0x16')](function(){return new BPromise(function(_0x13aced,_0x1b7f5f){zipdir(_0x8595da,{'saveTo':_0x225a47},function(_0x4b3c88,_0x291ad1){if(_0x4b3c88)return _0x1b7f5f(_0x4b3c88);return _0x13aced(_0x291ad1);});})[_0xf36f('0x16')](function(){return new BPromise(function(_0x23595e,_0x2159a0){rimraf(_0x8595da,function(_0x23ae34){if(_0x23ae34)_0x2159a0(_0x23ae34);return _0x23595e();});});})[_0xf36f('0x16')](function(){return _0x590e02[_0xf36f('0x65')](_0x225a47,_0x154073,function(_0x100a37){if(_0x100a37){console['log']('err',_0x100a37);}else{fs[_0xf36f('0x66')](_0x225a47);}});});});}else{return _0x590e02[_0xf36f('0x18')](0xc8);}})[_0xf36f('0x36')](handleError(_0x590e02,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b7ea8b2..e7e9ec2 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 _0xa18a=['map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xa18a,0xa0));var _0xaa18=function(_0x42fa36,_0x3f72f5){_0x42fa36=_0x42fa36-0x0;var _0x2a02c4=_0xa18a[_0x42fa36];return _0x2a02c4;};'use strict';var EventEmitter=require(_0xaa18('0x0'));var FaxInteraction=require(_0xaa18('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xaa18('0x1'))['db'][_0xaa18('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xaa18('0x3')](0x0);var events={'afterCreate':_0xaa18('0x4'),'afterUpdate':_0xaa18('0x5'),'afterDestroy':_0xaa18('0x6')};function emitEvent(_0x40abd6){return function(_0x57b5ea,_0x1f94bf,_0x58f914){_0x57b5ea[_0xaa18('0x7')]({'attributes':['id'],'raw':!![]})[_0xaa18('0x8')](function(_0x57b9a9){_0x57b5ea[_0xaa18('0x9')](_0xaa18('0xa'),_0x57b9a9[_0xaa18('0xb')](function(_0x2297da){return{'id':_0x2297da['id']};}));return FaxMessage[_0xaa18('0xc')]({'where':{'FaxInteractionId':_0x57b5ea['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaa18('0x8')](function(_0x120b09){_0x57b5ea['setDataValue'](_0xaa18('0xd'),_0x120b09[_0xaa18('0xe')]);FaxInteractionEvents[_0xaa18('0xf')](_0x40abd6+':'+_0x57b5ea['id'],_0x57b5ea);FaxInteractionEvents['emit'](_0x40abd6,_0x57b5ea);_0x58f914(null);})[_0xaa18('0x10')](_0x58f914(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xaa18('0x11')](e,emitEvent(event));}}module[_0xaa18('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0xf2ef=['remove','then','map','findAll','setDataValue','length','emit','catch','exports','events','../../mysqldb','FaxInteraction','FaxMessage','save','update'];(function(_0x3207d2,_0x41d478){var _0x102231=function(_0x3864fe){while(--_0x3864fe){_0x3207d2['push'](_0x3207d2['shift']());}};_0x102231(++_0x41d478);}(_0xf2ef,0x90));var _0xff2e=function(_0x14d318,_0x3f7a0e){_0x14d318=_0x14d318-0x0;var _0x5dca86=_0xf2ef[_0x14d318];return _0x5dca86;};'use strict';var EventEmitter=require(_0xff2e('0x0'));var FaxInteraction=require(_0xff2e('0x1'))['db'][_0xff2e('0x2')];var FaxMessage=require(_0xff2e('0x1'))['db'][_0xff2e('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff2e('0x4'),'afterUpdate':_0xff2e('0x5'),'afterDestroy':_0xff2e('0x6')};function emitEvent(_0x3c9b74){return function(_0x8553a0,_0xf9390d,_0x2acabd){_0x8553a0['getUsers']({'attributes':['id'],'raw':!![]})[_0xff2e('0x7')](function(_0x357a29){_0x8553a0['setDataValue']('Users',_0x357a29[_0xff2e('0x8')](function(_0x9aa3b2){return{'id':_0x9aa3b2['id']};}));return FaxMessage[_0xff2e('0x9')]({'where':{'FaxInteractionId':_0x8553a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xff2e('0x7')](function(_0x4c7f65){_0x8553a0[_0xff2e('0xa')]('unreadMessages',_0x4c7f65[_0xff2e('0xb')]);FaxInteractionEvents['emit'](_0x3c9b74+':'+_0x8553a0['id'],_0x8553a0);FaxInteractionEvents[_0xff2e('0xc')](_0x3c9b74,_0x8553a0);_0x2acabd(null);})[_0xff2e('0xd')](_0x2acabd(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xff2e('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 7e642ef..5c93f4a 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 _0xd9c4=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x36fe1e,_0x175199){var _0x3368ef=function(_0x74679f){while(--_0x74679f){_0x36fe1e['push'](_0x36fe1e['shift']());}};_0x3368ef(++_0x175199);}(_0xd9c4,0xee));var _0x4d9c=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xd9c4[_0x339129];return _0x1570df;};'use strict';var _=require(_0x4d9c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4d9c('0x1'));var moment=require(_0x4d9c('0x2'));var BPromise=require(_0x4d9c('0x3'));var rp=require(_0x4d9c('0x4'));var fs=require('fs');var path=require(_0x4d9c('0x5'));var rimraf=require(_0x4d9c('0x6'));var config=require(_0x4d9c('0x7'));var attributes=require(_0x4d9c('0x8'));module[_0x4d9c('0x9')]=function(_0x1fa517,_0x1ee9e9){return _0x1fa517[_0x4d9c('0xa')]('FaxInteraction',attributes,{'tableName':_0x4d9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe9ce3c,_0x386bbb,_0x4b863b){if(_0xe9ce3c[_0x4d9c('0xc')](_0x4d9c('0xd'))){_0xe9ce3c[_0x4d9c('0xe')]=moment()[_0x4d9c('0xf')](_0x4d9c('0x10'));}_0x4b863b(null,_0xe9ce3c);}}});}; \ No newline at end of file +var _0xbb4d=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','FaxInteraction','fax_interactions','changed'];(function(_0x2942e5,_0xf3b0b5){var _0x214494=function(_0x280495){while(--_0x280495){_0x2942e5['push'](_0x2942e5['shift']());}};_0x214494(++_0xf3b0b5);}(_0xbb4d,0x74));var _0xdbb4=function(_0x3b0a38,_0x2c9cd2){_0x3b0a38=_0x3b0a38-0x0;var _0x35aadf=_0xbb4d[_0x3b0a38];return _0x35aadf;};'use strict';var _=require(_0xdbb4('0x0'));var util=require(_0xdbb4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdbb4('0x2'));var BPromise=require(_0xdbb4('0x3'));var rp=require(_0xdbb4('0x4'));var fs=require('fs');var path=require(_0xdbb4('0x5'));var rimraf=require(_0xdbb4('0x6'));var config=require(_0xdbb4('0x7'));var attributes=require(_0xdbb4('0x8'));module['exports']=function(_0x3f7b12,_0x3d1c5f){return _0x3f7b12['define'](_0xdbb4('0x9'),attributes,{'tableName':_0xdbb4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10c1c2,_0x5e7f40,_0x15745a){if(_0x10c1c2[_0xdbb4('0xb')](_0xdbb4('0xc'))){_0x10c1c2[_0xdbb4('0xd')]=moment()[_0xdbb4('0xe')](_0xdbb4('0xf'));}_0x15745a(null,_0x10c1c2);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5ac28a6..9e4d768 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 _0xd9fb=['omit','spread','AddTags','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','addTags','ids'];(function(_0x19f9ba,_0x5c2938){var _0x556aef=function(_0x2579da){while(--_0x2579da){_0x19f9ba['push'](_0x19f9ba['shift']());}};_0x556aef(++_0x5c2938);}(_0xd9fb,0x88));var _0xbd9f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xd9fb[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xbd9f('0x0'));var util=require('util');var moment=require(_0xbd9f('0x1'));var BPromise=require(_0xbd9f('0x2'));var rs=require(_0xbd9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd9f('0x5'))(_0xbd9f('0x6'));var config=require(_0xbd9f('0x7'));var jayson=require(_0xbd9f('0x8'));var client=jayson[_0xbd9f('0x9')][_0xbd9f('0xa')]({'port':0x232a});config['redis']=_[_0xbd9f('0xb')](config[_0xbd9f('0xc')],{'host':_0xbd9f('0xd'),'port':0x18eb});var socket=require(_0xbd9f('0xe'))(new Redis(config['redis']));require(_0xbd9f('0xf'))[_0xbd9f('0x10')](socket);function respondWithRpcPromise(_0x1e10a8,_0x390b36,_0x6c2e7){return new BPromise(function(_0x5ec584,_0x2f3f80){return client[_0xbd9f('0x11')](_0x1e10a8,_0x6c2e7)[_0xbd9f('0x12')](function(_0x14fe7d){logger[_0xbd9f('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x390b36,_0xbd9f('0x14'));logger[_0xbd9f('0x15')](_0xbd9f('0x16'),_0x390b36,'request\x20sent',JSON['stringify'](_0x14fe7d));if(_0x14fe7d['error']){if(_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x18')]===0x1f4){logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x1a')]);return _0x2f3f80(_0x14fe7d[_0xbd9f('0x17')][_0xbd9f('0x1a')]);}logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x14fe7d['error'][_0xbd9f('0x1a')]);return _0x5ec584(_0x14fe7d['error'][_0xbd9f('0x1a')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x390b36,_0xbd9f('0x14'));_0x5ec584(_0x14fe7d[_0xbd9f('0x1b')]['message']);}})[_0xbd9f('0x1c')](function(_0x4d28d1){logger[_0xbd9f('0x17')](_0xbd9f('0x19'),_0x390b36,_0x4d28d1);_0x2f3f80(_0x4d28d1);});});}exports['UpdateFaxInteraction']=function(_0x2acca2){var _0x48e637=this;return new Promise(function(_0x29471b,_0x4ddf40){return db['FaxInteraction'][_0xbd9f('0x1d')](_0x2acca2[_0xbd9f('0x1e')],{'raw':_0x2acca2['options']?_0x2acca2[_0xbd9f('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acca2[_0xbd9f('0x1f')]?_0x2acca2['options'][_0xbd9f('0x20')]||null:null,'attributes':_0x2acca2[_0xbd9f('0x1f')]?_0x2acca2[_0xbd9f('0x1f')][_0xbd9f('0x21')]||null:null,'limit':_0x2acca2['options']?_0x2acca2[_0xbd9f('0x1f')][_0xbd9f('0x22')]||null:null})[_0xbd9f('0x12')](function(_0x75b16b){logger[_0xbd9f('0x13')](_0xbd9f('0x23'),_0x2acca2);logger['debug'](_0xbd9f('0x23'),_0x2acca2,JSON['stringify'](_0x75b16b));_0x29471b(_0x75b16b);})['catch'](function(_0x2f0698){logger[_0xbd9f('0x17')](_0xbd9f('0x23'),_0x2f0698[_0xbd9f('0x1a')],_0x2acca2);_0x4ddf40(_0x48e637['error'](0x1f4,_0x2f0698[_0xbd9f('0x1a')]));});});};exports[_0xbd9f('0x24')]=function(_0x4fb83e){return new Promise(function(_0x470258,_0x36982c){return db[_0xbd9f('0x25')]['find']({'where':_0x4fb83e[_0xbd9f('0x1f')]?_0x4fb83e[_0xbd9f('0x1f')][_0xbd9f('0x20')]||null:null})[_0xbd9f('0x12')](function(_0x1c32fc){if(_0x1c32fc){return _0x1c32fc[_0xbd9f('0x26')](_0x4fb83e[_0xbd9f('0x1e')][_0xbd9f('0x27')],_[_0xbd9f('0x28')](_0x4fb83e[_0xbd9f('0x1e')],[_0xbd9f('0x27'),'id'])||{});}})[_0xbd9f('0x29')](function(_0x56e8bc){logger['info'](_0xbd9f('0x2a'),_0x4fb83e);logger[_0xbd9f('0x15')](_0xbd9f('0x2a'),_0x4fb83e,JSON[_0xbd9f('0x2b')](_0x56e8bc));_0x470258(_0x56e8bc);})[_0xbd9f('0x1c')](function(_0x4ca3a1){logger[_0xbd9f('0x17')](_0xbd9f('0x2a'),_0x4ca3a1['message'],_0x4fb83e);_0x36982c(_this[_0xbd9f('0x17')](0x1f4,_0x4ca3a1[_0xbd9f('0x1a')]));});});}; \ No newline at end of file +var _0x281a=['AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','limit','stringify'];(function(_0x43a45e,_0x4f9fca){var _0x1058f5=function(_0x1f4ba9){while(--_0x1f4ba9){_0x43a45e['push'](_0x43a45e['shift']());}};_0x1058f5(++_0x4f9fca);}(_0x281a,0xa6));var _0xa281=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x281a[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0xa281('0x0'));var moment=require(_0xa281('0x1'));var BPromise=require(_0xa281('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa281('0x3'));var db=require(_0xa281('0x4'))['db'];var utils=require(_0xa281('0x5'));var logger=require(_0xa281('0x6'))(_0xa281('0x7'));var config=require(_0xa281('0x8'));var jayson=require(_0xa281('0x9'));var client=jayson['client'][_0xa281('0xa')]({'port':0x232a});config[_0xa281('0xb')]=_[_0xa281('0xc')](config[_0xa281('0xb')],{'host':_0xa281('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa281('0xb')]));require('./faxInteraction.socket')[_0xa281('0xe')](socket);function respondWithRpcPromise(_0x5e35f2,_0x2f5575,_0x48d052){return new BPromise(function(_0x26e694,_0x5e0111){return client[_0xa281('0xf')](_0x5e35f2,_0x48d052)[_0xa281('0x10')](function(_0x390622){logger[_0xa281('0x11')](_0xa281('0x12'),_0x2f5575,_0xa281('0x13'));logger['debug'](_0xa281('0x14'),_0x2f5575,_0xa281('0x13'),JSON['stringify'](_0x390622));if(_0x390622[_0xa281('0x15')]){if(_0x390622[_0xa281('0x15')][_0xa281('0x16')]===0x1f4){logger[_0xa281('0x15')](_0xa281('0x12'),_0x2f5575,_0x390622['error']['message']);return _0x5e0111(_0x390622[_0xa281('0x15')][_0xa281('0x17')]);}logger[_0xa281('0x15')](_0xa281('0x12'),_0x2f5575,_0x390622[_0xa281('0x15')][_0xa281('0x17')]);return _0x26e694(_0x390622[_0xa281('0x15')][_0xa281('0x17')]);}else{logger[_0xa281('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x2f5575,_0xa281('0x13'));_0x26e694(_0x390622[_0xa281('0x18')][_0xa281('0x17')]);}})[_0xa281('0x19')](function(_0x4e9fc2){logger[_0xa281('0x15')](_0xa281('0x12'),_0x2f5575,_0x4e9fc2);_0x5e0111(_0x4e9fc2);});});}exports[_0xa281('0x1a')]=function(_0x1c0686){var _0x4c1e99=this;return new Promise(function(_0x1a3f1a,_0x5d04c2){return db[_0xa281('0x1b')]['update'](_0x1c0686[_0xa281('0x1c')],{'raw':_0x1c0686[_0xa281('0x1d')]?_0x1c0686[_0xa281('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c0686[_0xa281('0x1d')]?_0x1c0686[_0xa281('0x1d')][_0xa281('0x1e')]||null:null,'attributes':_0x1c0686['options']?_0x1c0686[_0xa281('0x1d')][_0xa281('0x1f')]||null:null,'limit':_0x1c0686[_0xa281('0x1d')]?_0x1c0686[_0xa281('0x1d')][_0xa281('0x20')]||null:null})[_0xa281('0x10')](function(_0x17e90c){logger[_0xa281('0x11')](_0xa281('0x1a'),_0x1c0686);logger['debug'](_0xa281('0x1a'),_0x1c0686,JSON[_0xa281('0x21')](_0x17e90c));_0x1a3f1a(_0x17e90c);})['catch'](function(_0x388c1d){logger[_0xa281('0x15')](_0xa281('0x1a'),_0x388c1d[_0xa281('0x17')],_0x1c0686);_0x5d04c2(_0x4c1e99[_0xa281('0x15')](0x1f4,_0x388c1d[_0xa281('0x17')]));});});};exports[_0xa281('0x22')]=function(_0x1f2a50){return new Promise(function(_0x52d5e3,_0x35b297){return db[_0xa281('0x1b')]['find']({'where':_0x1f2a50[_0xa281('0x1d')]?_0x1f2a50[_0xa281('0x1d')][_0xa281('0x1e')]||null:null})[_0xa281('0x10')](function(_0x112ac6){if(_0x112ac6){return _0x112ac6[_0xa281('0x23')](_0x1f2a50['body'][_0xa281('0x24')],_[_0xa281('0x25')](_0x1f2a50[_0xa281('0x1c')],[_0xa281('0x24'),'id'])||{});}})[_0xa281('0x26')](function(_0x5c0b43){logger[_0xa281('0x11')]('AddTags',_0x1f2a50);logger['debug'](_0xa281('0x27'),_0x1f2a50,JSON[_0xa281('0x21')](_0x5c0b43));_0x52d5e3(_0x5c0b43);})[_0xa281('0x19')](function(_0x36ccd5){logger['error'](_0xa281('0x27'),_0x36ccd5[_0xa281('0x17')],_0x1f2a50);_0x35b297(_this['error'](0x1f4,_0x36ccd5[_0xa281('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 7943cc2..e63054d 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 _0xf7e5=['update','removeListener','register','length','faxInteraction:','./faxInteraction.events','remove'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xf7e5,0x11d));var _0x5f7e=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xf7e5[_0xe6e78c];return _0x2a09c8;};'use strict';var FaxInteractionEvents=require(_0x5f7e('0x0'));var events=['save',_0x5f7e('0x1'),_0x5f7e('0x2')];function createListener(_0x2d6de6,_0x4692ba){return function(_0x414340){_0x4692ba['emit'](_0x2d6de6,_0x414340);};}function removeListener(_0x5e965d,_0x4732b8){return function(){FaxInteractionEvents[_0x5f7e('0x3')](_0x5e965d,_0x4732b8);};}exports[_0x5f7e('0x4')]=function(_0x273955){for(var _0xe6bde7=0x0,_0x375c0e=events[_0x5f7e('0x5')];_0xe6bde7<_0x375c0e;_0xe6bde7++){var _0x30e935=events[_0xe6bde7];var _0x3a7001=createListener(_0x5f7e('0x6')+_0x30e935,_0x273955);FaxInteractionEvents['on'](_0x30e935,_0x3a7001);}}; \ No newline at end of file +var _0xd6ae=['faxInteraction:','save','remove','update','removeListener','register','length'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd6ae,0xf6));var _0xed6a=function(_0x3481a9,_0x5f4963){_0x3481a9=_0x3481a9-0x0;var _0xe7222f=_0xd6ae[_0x3481a9];return _0xe7222f;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xed6a('0x0'),_0xed6a('0x1'),_0xed6a('0x2')];function createListener(_0x12a305,_0x2a44e4){return function(_0x40ab9b){_0x2a44e4['emit'](_0x12a305,_0x40ab9b);};}function removeListener(_0x5583bc,_0x48618a){return function(){FaxInteractionEvents[_0xed6a('0x3')](_0x5583bc,_0x48618a);};}exports[_0xed6a('0x4')]=function(_0x465e65){for(var _0x5a769c=0x0,_0x1bfe2c=events[_0xed6a('0x5')];_0x5a769c<_0x1bfe2c;_0x5a769c++){var _0x1d8f40=events[_0x5a769c];var _0x2861f4=createListener(_0xed6a('0x6')+_0x1d8f40,_0x465e65);FaxInteractionEvents['on'](_0x1d8f40,_0x2861f4);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index f975d2e..ac52420 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 _0x93e2=['faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax'];(function(_0x5d15e3,_0x360f9a){var _0x17dab8=function(_0xfb03f1){while(--_0xfb03f1){_0x5d15e3['push'](_0x5d15e3['shift']());}};_0x17dab8(++_0x360f9a);}(_0x93e2,0x106));var _0x293e=function(_0x3bdc0f,_0x4f0015){_0x3bdc0f=_0x3bdc0f-0x0;var _0xb5ec5b=_0x93e2[_0x3bdc0f];return _0xb5ec5b;};'use strict';var multer=require('multer');var util=require(_0x293e('0x0'));var path=require(_0x293e('0x1'));var timeout=require(_0x293e('0x2'));var express=require(_0x293e('0x3'));var router=express[_0x293e('0x4')]();var fs_extra=require(_0x293e('0x5'));var auth=require(_0x293e('0x6'));var interaction=require(_0x293e('0x7'));var config=require(_0x293e('0x8'));var controller=require('./faxInteraction.controller');router[_0x293e('0x9')]('/',auth[_0x293e('0xa')](),controller[_0x293e('0xb')]);router[_0x293e('0x9')](_0x293e('0xc'),auth[_0x293e('0xa')](),controller[_0x293e('0xd')]);router['get'](_0x293e('0xe'),auth[_0x293e('0xa')](),controller[_0x293e('0xf')]);router[_0x293e('0x9')](_0x293e('0x10'),auth[_0x293e('0xa')](),controller[_0x293e('0x11')]);router[_0x293e('0x9')](_0x293e('0x12'),auth['isAuthenticated'](),controller[_0x293e('0x13')]);router[_0x293e('0x14')]('/',auth[_0x293e('0xa')](),controller[_0x293e('0x15')]);router[_0x293e('0x14')](_0x293e('0x10'),auth['isAuthenticated'](),controller[_0x293e('0x16')]);router[_0x293e('0x14')](_0x293e('0x17'),auth[_0x293e('0xa')](),interaction[_0x293e('0x18')](_0x293e('0x19'),_0x293e('0x1a')),controller[_0x293e('0x1b')]);router[_0x293e('0x1c')]('/:id',auth[_0x293e('0xa')](),interaction[_0x293e('0x18')](_0x293e('0x19'),_0x293e('0x1d')),controller[_0x293e('0x1e')]);router[_0x293e('0x1f')]('/:id',auth['isAuthenticated'](),interaction[_0x293e('0x18')]('fax',_0x293e('0x20')),controller[_0x293e('0x21')]);router[_0x293e('0x1f')](_0x293e('0x17'),auth[_0x293e('0xa')](),controller[_0x293e('0x22')]);module[_0x293e('0x23')]=router; \ No newline at end of file +var _0x6fb8=['/describe','describe','/:id','getMessages','post','create','/:id/messages','addMessage','/:id/tags','fax','addTags','put','tracked','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index'];(function(_0x1c4b44,_0x2377de){var _0x10d72b=function(_0x2bd31e){while(--_0x2bd31e){_0x1c4b44['push'](_0x1c4b44['shift']());}};_0x10d72b(++_0x2377de);}(_0x6fb8,0x104));var _0x86fb=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0x6fb8[_0x173f10];return _0x53142d;};'use strict';var multer=require(_0x86fb('0x0'));var util=require('util');var path=require(_0x86fb('0x1'));var timeout=require(_0x86fb('0x2'));var express=require('express');var router=express[_0x86fb('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86fb('0x4'));var config=require(_0x86fb('0x5'));var controller=require(_0x86fb('0x6'));router[_0x86fb('0x7')]('/',auth[_0x86fb('0x8')](),controller[_0x86fb('0x9')]);router[_0x86fb('0x7')](_0x86fb('0xa'),auth[_0x86fb('0x8')](),controller[_0x86fb('0xb')]);router[_0x86fb('0x7')](_0x86fb('0xc'),auth[_0x86fb('0x8')](),controller['show']);router[_0x86fb('0x7')]('/:id/messages',auth[_0x86fb('0x8')](),controller[_0x86fb('0xd')]);router[_0x86fb('0x7')]('/:id/download',auth[_0x86fb('0x8')](),controller['download']);router[_0x86fb('0xe')]('/',auth[_0x86fb('0x8')](),controller[_0x86fb('0xf')]);router[_0x86fb('0xe')](_0x86fb('0x10'),auth[_0x86fb('0x8')](),controller[_0x86fb('0x11')]);router[_0x86fb('0xe')](_0x86fb('0x12'),auth[_0x86fb('0x8')](),interaction['tracked'](_0x86fb('0x13'),'faxinteraction:addtags'),controller[_0x86fb('0x14')]);router[_0x86fb('0x15')]('/:id',auth[_0x86fb('0x8')](),interaction[_0x86fb('0x16')](_0x86fb('0x13'),_0x86fb('0x17')),controller[_0x86fb('0x18')]);router['delete'](_0x86fb('0xc'),auth[_0x86fb('0x8')](),interaction[_0x86fb('0x16')](_0x86fb('0x13'),_0x86fb('0x19')),controller[_0x86fb('0x1a')]);router[_0x86fb('0x1b')]('/:id/tags',auth[_0x86fb('0x8')](),controller[_0x86fb('0x1c')]);module[_0x86fb('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 766150f..aae179c 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 _0xe198=['ENUM','out','TEXT','sequelize','exports','BOOLEAN'];(function(_0x2507c8,_0x270912){var _0x598c9a=function(_0x53487b){while(--_0x53487b){_0x2507c8['push'](_0x2507c8['shift']());}};_0x598c9a(++_0x270912);}(_0xe198,0x6f));var _0x8e19=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xe198[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0x8e19('0x0'));module[_0x8e19('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8e19('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8e19('0x3')]('in',_0x8e19('0x4')),'defaultValue':_0x8e19('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8e19('0x5')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x1ddc=['out','DATE','exports','TEXT','medium','ENUM'];(function(_0x46b39d,_0x405169){var _0x3b5e10=function(_0x3b2471){while(--_0x3b2471){_0x46b39d['push'](_0x46b39d['shift']());}};_0x3b5e10(++_0x405169);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x3cc543,_0x27e41b){_0x3cc543=_0x3cc543-0x0;var _0x2dc069=_0x1ddc[_0x3cc543];return _0x2dc069;};'use strict';var Sequelize=require('sequelize');module[_0xc1dd('0x0')]={'body':{'type':Sequelize[_0xc1dd('0x1')](_0xc1dd('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc1dd('0x3')]('in',_0xc1dd('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xc1dd('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xc1dd('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 16f94a3..41e2455 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 _0x7555=['YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','FaxInteractionId','RejectMessage','contact','agent','internal','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','keys','length','find','body','destroy','params','describe','fax-interactions','fax','read','readAt','format'];(function(_0x5b8bf3,_0x3637b9){var _0x1c0a36=function(_0x3df331){while(--_0x3df331){_0x5b8bf3['push'](_0x5b8bf3['shift']());}};_0x1c0a36(++_0x3637b9);}(_0x7555,0xc5));var _0x5755=function(_0x4445d4,_0x38ae54){_0x4445d4=_0x4445d4-0x0;var _0x3cbd43=_0x7555[_0x4445d4];return _0x3cbd43;};'use strict';var emlformat=require(_0x5755('0x0'));var rimraf=require(_0x5755('0x1'));var zipdir=require(_0x5755('0x2'));var jsonpatch=require(_0x5755('0x3'));var rp=require(_0x5755('0x4'));var moment=require(_0x5755('0x5'));var BPromise=require(_0x5755('0x6'));var Mustache=require('mustache');var util=require(_0x5755('0x7'));var path=require(_0x5755('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5755('0x9'));var fs=require('fs');var fs_extra=require(_0x5755('0xa'));var _=require(_0x5755('0xb'));var squel=require(_0x5755('0xc'));var crypto=require('crypto');var jsforce=require(_0x5755('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5755('0xe'));var Papa=require(_0x5755('0xf'));var Redis=require(_0x5755('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5755('0x11'));var as=require(_0x5755('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5755('0x13'))(_0x5755('0x14'));var utils=require(_0x5755('0x15'));var config=require(_0x5755('0x16'));var licenseUtil=require(_0x5755('0x17'));var db=require(_0x5755('0x18'))['db'];config['redis']=_[_0x5755('0x19')](config[_0x5755('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5755('0x1b'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x5755('0x1c')](socket);var jayson=require(_0x5755('0x1d'));var client=jayson['client'][_0x5755('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x5755('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ca68b,_0x45f189,_0x20f7a1,_0x1d93e3){return new BPromise(function(_0xa0e585,_0x42313a){var _0x472889=_0x1d93e3||client;return _0x472889[_0x5755('0x1f')](_0x5ca68b,_0x20f7a1)[_0x5755('0x20')](function(_0x384f5b){logger[_0x5755('0x21')](_0x5755('0x22'),_0x45f189,_0x5755('0x23'));logger['debug'](_0x5755('0x24'),_0x45f189,_0x5755('0x23'),JSON['stringify'](_0x384f5b));if(_0x384f5b[_0x5755('0x25')]){if(_0x384f5b[_0x5755('0x25')][_0x5755('0x26')]===0x1f4){logger[_0x5755('0x25')](_0x5755('0x22'),_0x45f189,_0x384f5b[_0x5755('0x25')][_0x5755('0x27')]);return _0x42313a(_0x384f5b[_0x5755('0x25')][_0x5755('0x27')]);}logger[_0x5755('0x25')](_0x5755('0x22'),_0x45f189,_0x384f5b['error'][_0x5755('0x27')]);return _0xa0e585(_0x384f5b['error'][_0x5755('0x27')]);}else{logger[_0x5755('0x21')](_0x5755('0x22'),_0x45f189,'request\x20sent');_0xa0e585(_0x384f5b[_0x5755('0x28')][_0x5755('0x27')]);}})[_0x5755('0x29')](function(_0x11ba43){logger[_0x5755('0x25')]('FaxMessage,\x20%s,\x20%s',_0x45f189,_0x11ba43);_0x42313a(_0x11ba43);});});}function respondWithStatusCode(_0x3985bc,_0x18babc){_0x18babc=_0x18babc||0xcc;return function(_0x21e715){if(_0x21e715){return _0x3985bc[_0x5755('0x2a')](_0x18babc);}return _0x3985bc[_0x5755('0x2b')](_0x18babc)[_0x5755('0x2c')]();};}function respondWithResult(_0x41d534,_0xc67872){_0xc67872=_0xc67872||0xc8;return function(_0x4cfc56){if(_0x4cfc56){return _0x41d534['status'](_0xc67872)[_0x5755('0x2d')](_0x4cfc56);}};}function respondWithFilteredResult(_0x39dc3a,_0x41a0cb){return function(_0x370374){if(_0x370374){var _0x85053f=typeof _0x41a0cb['offset']===_0x5755('0x2e')&&typeof _0x41a0cb[_0x5755('0x2f')]===_0x5755('0x2e');var _0x2c2d9b=_0x370374['count'];var _0x28c479=_0x85053f?0x0:_0x41a0cb['offset'];var _0x1f354b=_0x85053f?_0x370374[_0x5755('0x30')]:_0x41a0cb[_0x5755('0x31')]+_0x41a0cb[_0x5755('0x2f')];var _0x1205eb;if(_0x1f354b>=_0x2c2d9b){_0x1f354b=_0x2c2d9b;_0x1205eb=0xc8;}else{_0x1205eb=0xce;}_0x39dc3a['status'](_0x1205eb);return _0x39dc3a[_0x5755('0x32')](_0x5755('0x33'),_0x28c479+'-'+_0x1f354b+'/'+_0x2c2d9b)[_0x5755('0x2d')](_0x370374);}return null;};}function patchUpdates(_0x4462da){return function(_0x4251e8){try{jsonpatch[_0x5755('0x34')](_0x4251e8,_0x4462da,!![]);}catch(_0xc4ee3e){return BPromise[_0x5755('0x35')](_0xc4ee3e);}return _0x4251e8[_0x5755('0x36')]();};}function saveUpdates(_0x4fed30,_0x517041){return function(_0x1f8a3e){if(_0x1f8a3e){return _0x1f8a3e[_0x5755('0x37')](_0x4fed30)[_0x5755('0x20')](function(_0x21fe5a){return _0x21fe5a;});}return null;};}function removeEntity(_0x2e9199,_0x2d8a48){return function(_0x261f48){if(_0x261f48){return _0x261f48['destroy']()[_0x5755('0x20')](function(){_0x2e9199[_0x5755('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f95f,_0xb8b588){return function(_0x23786a){if(!_0x23786a){_0x47f95f['sendStatus'](0x194);}return _0x23786a;};}function handleError(_0x1f0bd2,_0x511372){_0x511372=_0x511372||0x1f4;return function(_0x456c53){logger[_0x5755('0x25')](_0x456c53[_0x5755('0x38')]);if(_0x456c53[_0x5755('0x39')]){delete _0x456c53[_0x5755('0x39')];}_0x1f0bd2[_0x5755('0x2b')](_0x511372)['send'](_0x456c53);};}exports[_0x5755('0x3a')]=function(_0x967b7e,_0x22d435){var _0x1c51c5={},_0x379e5b={},_0x2e911d={'count':0x0,'rows':[]};var _0xce4f0=_[_0x5755('0x3b')](db[_0x5755('0x3c')][_0x5755('0x3d')],function(_0x2908a8){return{'name':_0x2908a8[_0x5755('0x3e')],'type':_0x2908a8[_0x5755('0x3f')][_0x5755('0x40')]};});_0x379e5b[_0x5755('0x41')]=_[_0x5755('0x3b')](_0xce4f0,'name');_0x379e5b[_0x5755('0x42')]=_['keys'](_0x967b7e[_0x5755('0x42')]);_0x379e5b[_0x5755('0x43')]=_['intersection'](_0x379e5b[_0x5755('0x41')],_0x379e5b[_0x5755('0x42')]);_0x1c51c5[_0x5755('0x44')]=_[_0x5755('0x45')](_0x379e5b[_0x5755('0x41')],qs[_0x5755('0x46')](_0x967b7e[_0x5755('0x42')][_0x5755('0x46')]));_0x1c51c5['attributes']=_0x1c51c5[_0x5755('0x44')]['length']?_0x1c51c5[_0x5755('0x44')]:_0x379e5b[_0x5755('0x41')];if(!_0x967b7e[_0x5755('0x42')][_0x5755('0x47')](_0x5755('0x48'))){_0x1c51c5[_0x5755('0x2f')]=qs[_0x5755('0x2f')](_0x967b7e[_0x5755('0x42')]['limit']);_0x1c51c5[_0x5755('0x31')]=qs[_0x5755('0x31')](_0x967b7e['query'][_0x5755('0x31')]);}_0x1c51c5[_0x5755('0x49')]=qs[_0x5755('0x4a')](_0x967b7e['query'][_0x5755('0x4a')]);_0x1c51c5[_0x5755('0x4b')]=qs[_0x5755('0x43')](_[_0x5755('0x4c')](_0x967b7e[_0x5755('0x42')],_0x379e5b['filters']),_0xce4f0);if(_0x967b7e[_0x5755('0x42')][_0x5755('0x4d')]){_0x1c51c5[_0x5755('0x4b')]=_['merge'](_0x1c51c5['where'],{'$or':_[_0x5755('0x3b')](_0xce4f0,function(_0xc94b40){if(_0xc94b40[_0x5755('0x3f')]!==_0x5755('0x4e')){var _0x45fdcd={};_0x45fdcd[_0xc94b40[_0x5755('0x39')]]={'$like':'%'+_0x967b7e[_0x5755('0x42')][_0x5755('0x4d')]+'%'};return _0x45fdcd;}})});}_0x1c51c5=_[_0x5755('0x4f')]({},_0x1c51c5,_0x967b7e[_0x5755('0x50')]);var _0x4183e2={'where':_0x1c51c5[_0x5755('0x4b')]};return db[_0x5755('0x3c')][_0x5755('0x30')](_0x4183e2)[_0x5755('0x20')](function(_0x568c6e){_0x2e911d[_0x5755('0x30')]=_0x568c6e;if(_0x967b7e[_0x5755('0x42')][_0x5755('0x51')]){_0x1c51c5[_0x5755('0x52')]=[{'all':!![]}];}return db[_0x5755('0x3c')][_0x5755('0x53')](_0x1c51c5);})['then'](function(_0x801785){_0x2e911d['rows']=_0x801785;return _0x2e911d;})[_0x5755('0x20')](respondWithFilteredResult(_0x22d435,_0x1c51c5))[_0x5755('0x29')](handleError(_0x22d435,null));};exports[_0x5755('0x54')]=function(_0x1a22bf,_0x31f611){var _0x3da44c={'raw':!![],'where':{'id':_0x1a22bf['params']['id']}},_0x4a139f={};_0x4a139f[_0x5755('0x41')]=_[_0x5755('0x55')](db['FaxMessage'][_0x5755('0x3d')]);_0x4a139f[_0x5755('0x42')]=_['keys'](_0x1a22bf[_0x5755('0x42')]);_0x4a139f[_0x5755('0x43')]=_[_0x5755('0x45')](_0x4a139f[_0x5755('0x41')],_0x4a139f[_0x5755('0x42')]);_0x3da44c[_0x5755('0x44')]=_[_0x5755('0x45')](_0x4a139f[_0x5755('0x41')],qs[_0x5755('0x46')](_0x1a22bf[_0x5755('0x42')][_0x5755('0x46')]));_0x3da44c['attributes']=_0x3da44c[_0x5755('0x44')][_0x5755('0x56')]?_0x3da44c[_0x5755('0x44')]:_0x4a139f['model'];if(_0x1a22bf[_0x5755('0x42')]['includeAll']){_0x3da44c[_0x5755('0x52')]=[{'all':!![]}];}_0x3da44c=_[_0x5755('0x4f')]({},_0x3da44c,_0x1a22bf['options']);return db[_0x5755('0x3c')][_0x5755('0x57')](_0x3da44c)[_0x5755('0x20')](handleEntityNotFound(_0x31f611,null))[_0x5755('0x20')](respondWithResult(_0x31f611,null))['catch'](handleError(_0x31f611,null));};exports[_0x5755('0x37')]=function(_0x3087f9,_0x496952){if(_0x3087f9[_0x5755('0x58')]['id']){delete _0x3087f9[_0x5755('0x58')]['id'];}return db[_0x5755('0x3c')][_0x5755('0x57')]({'where':{'id':_0x3087f9['params']['id']}})[_0x5755('0x20')](handleEntityNotFound(_0x496952,null))[_0x5755('0x20')](saveUpdates(_0x3087f9[_0x5755('0x58')],null))[_0x5755('0x20')](respondWithResult(_0x496952,null))[_0x5755('0x29')](handleError(_0x496952,null));};exports[_0x5755('0x59')]=function(_0x3bd469,_0x4e6b45){return db[_0x5755('0x3c')][_0x5755('0x57')]({'where':{'id':_0x3bd469[_0x5755('0x5a')]['id']}})[_0x5755('0x20')](handleEntityNotFound(_0x4e6b45,null))[_0x5755('0x20')](removeEntity(_0x4e6b45,null))['catch'](handleError(_0x4e6b45,null));};exports[_0x5755('0x5b')]=function(_0x1eeb35,_0x7d616e){return db[_0x5755('0x3c')][_0x5755('0x5b')]()[_0x5755('0x20')](respondWithResult(_0x7d616e,null))[_0x5755('0x29')](handleError(_0x7d616e,null));};var interaction_log=require(_0x5755('0x13'))(_0x5755('0x5c'));exports['accept']=function(_0x5f50c,_0x211119,_0x39a55f){var _0x754fe2={'agent':{},'channel':_0x5755('0x5d')};if(_0x5f50c['body']['id']){delete _0x5f50c[_0x5755('0x58')]['id'];}_0x5f50c[_0x5755('0x58')][_0x5755('0x5e')]=!![];_0x5f50c[_0x5755('0x58')][_0x5755('0x5f')]=moment()[_0x5755('0x60')](_0x5755('0x61'));_0x5f50c['body'][_0x5755('0x62')]=_0x5f50c['body']['UserId']||_0x5f50c['user']['id'];_0x754fe2['agent']['id']=_0x5f50c[_0x5755('0x58')][_0x5755('0x62')];return db[_0x5755('0x3c')][_0x5755('0x57')]({'where':{'id':_0x5f50c[_0x5755('0x5a')]['id'],'UserId':null}})[_0x5755('0x20')](handleEntityNotFound(_0x211119,null))[_0x5755('0x20')](saveUpdates(_0x5f50c[_0x5755('0x58')],null))['then'](function(_0x5a2525){if(_0x5a2525){_0x754fe2['message']=_0x5a2525[_0x5755('0x63')]({'plain':!![]});return db[_0x5755('0x64')][_0x5755('0x57')]({'where':{'id':_0x5a2525['FaxInteractionId']}});}return null;})[_0x5755('0x20')](handleEntityNotFound(_0x211119,null))[_0x5755('0x20')](function(_0x392532){if(_0x392532){return _0x392532['update']({'UserId':_0x5f50c[_0x5755('0x58')][_0x5755('0x62')],'read1stAt':_[_0x5755('0x65')](_0x392532[_0x5755('0x66')])?moment()[_0x5755('0x60')](_0x5755('0x61')):undefined});}return null;})[_0x5755('0x20')](function(_0x50a73c){if(_0x50a73c){_0x754fe2[_0x5755('0x67')]=_0x50a73c[_0x5755('0x63')]({'plain':!![]});interaction_log[_0x5755('0x21')](_0x5755('0x68'),_0x5f50c[_0x5755('0x69')]['id'],_0x5f50c['user'][_0x5755('0x39')],_0x5f50c[_0x5755('0x69')][_0x5755('0x6a')],_0x754fe2[_0x5755('0x67')]['id'],_0x5f50c[_0x5755('0x58')]?JSON[_0x5755('0x6b')](_0x5f50c[_0x5755('0x58')]):_0x5755('0x6c'));return respondWithRpcPromise(_0x5755('0x6d'),_0x5755('0x6e'),_0x754fe2);}return null;})[_0x5755('0x20')](function(_0x1d5c11){var _0x169722='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1d5c11[_0x5755('0x27')][_0x5755('0x6f')];return db[_0x5755('0x70')][_0x5755('0x42')](_0x169722,{'type':db[_0x5755('0x71')]['QueryTypes'][_0x5755('0x72')],'raw':!![]})['then'](function(_0x4fbe26){return _0x4fbe26;});})[_0x5755('0x20')](function(_0x33bb64){if(_0x33bb64){_0x754fe2[_0x5755('0x27')]['contact']=_0x33bb64[0x0];if(!_0x5f50c['body']['UserId'])return;return db['User'][_0x5755('0x57')]({'where':{'id':_0x5f50c[_0x5755('0x58')][_0x5755('0x62')],'role':'agent'},'attributes':['id',_0x5755('0x39'),_0x5755('0x73'),_0x5755('0x74'),'internal'],'raw':!![]});}return null;})[_0x5755('0x20')](function(_0x12154b){if(!_0x12154b)return null;_0x754fe2[_0x5755('0x27')]['agent']=_0x12154b;return _0x754fe2;})[_0x5755('0x20')](function(_0x998b50){if(_0x998b50){if(_0x5f50c[_0x5755('0x58')][_0x5755('0x75')]){_0x754fe2[_0x5755('0x27')][_0x5755('0x76')]=util['format'](_0x5755('0x77'),_0x5f50c[_0x5755('0x69')][_0x5755('0x39')]);_0x754fe2['message'][_0x5755('0x78')]=_0x754fe2['channel'];_0x754fe2['message'][_0x5755('0x79')]=_0x754fe2['channel'];_0x754fe2[_0x5755('0x27')][_0x5755('0x7a')]=_0x5755('0x7b');return respondWithRpcPromise(_0x5755('0x7c'),'EventManager',{'event':_0x5755('0x7d'),'message':_0x754fe2[_0x5755('0x27')]},client9002)['then'](function(){return _0x754fe2;});}return _0x754fe2;}return null;})[_0x5755('0x20')](respondWithResult(_0x211119,null))[_0x5755('0x29')](handleError(_0x211119,null));};var interaction_log=require(_0x5755('0x13'))(_0x5755('0x5c'));exports[_0x5755('0x35')]=function(_0x2d4f04,_0x1239c5,_0x2fcfe3){var _0x5b3931={'agent':{},'channel':_0x5755('0x5d')};if(_0x2d4f04[_0x5755('0x58')]['id']){delete _0x2d4f04['body']['id'];}_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')]=_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')]||_0x2d4f04[_0x5755('0x69')]['id'];_0x5b3931['agent']['id']=_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')];return db[_0x5755('0x3c')]['find']({'where':{'id':_0x2d4f04[_0x5755('0x5a')]['id'],'UserId':null}})[_0x5755('0x20')](handleEntityNotFound(_0x1239c5,null))[_0x5755('0x20')](function(_0x1fa1af){if(_0x1fa1af){_0x5b3931[_0x5755('0x27')]=_0x1fa1af['get']({'plain':!![]});return db[_0x5755('0x64')][_0x5755('0x57')]({'where':{'id':_0x1fa1af[_0x5755('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x1239c5,null))[_0x5755('0x20')](function(_0x388aaf){if(_0x388aaf){_0x5b3931[_0x5755('0x67')]=_0x388aaf[_0x5755('0x63')]({'plain':!![]});interaction_log[_0x5755('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d4f04[_0x5755('0x69')]['id'],_0x2d4f04[_0x5755('0x69')][_0x5755('0x39')],_0x2d4f04[_0x5755('0x69')][_0x5755('0x6a')],_0x5b3931[_0x5755('0x67')]['id'],_0x2d4f04[_0x5755('0x58')]?JSON[_0x5755('0x6b')](_0x2d4f04['body']):_0x5755('0x6c'));return respondWithRpcPromise(_0x5755('0x7f'),'rejectMessage',_0x5b3931);}return null;})[_0x5755('0x20')](function(_0x3c30de){var _0x5c1928='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3c30de['message'][_0x5755('0x6f')];return db[_0x5755('0x70')][_0x5755('0x42')](_0x5c1928,{'type':db[_0x5755('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5755('0x20')](function(_0x2f5ae0){return _0x2f5ae0;});})[_0x5755('0x20')](function(_0x4c4f77){if(_0x4c4f77){_0x5b3931[_0x5755('0x27')][_0x5755('0x80')]=_0x4c4f77[0x0];if(!_0x2d4f04[_0x5755('0x58')][_0x5755('0x62')])return;return db['User']['find']({'where':{'id':_0x2d4f04['body'][_0x5755('0x62')],'role':_0x5755('0x81')},'attributes':['id',_0x5755('0x39'),'fullname',_0x5755('0x74'),_0x5755('0x82')],'raw':!![]});}return null;})[_0x5755('0x20')](function(_0x13bda8){if(!_0x13bda8)return null;_0x5b3931[_0x5755('0x27')][_0x5755('0x81')]=_0x13bda8;return _0x5b3931;})[_0x5755('0x20')](function(_0x544041){if(_0x544041){_0x544041[_0x5755('0x27')]['interface']=util[_0x5755('0x60')](_0x5755('0x77'),_0x2d4f04[_0x5755('0x69')][_0x5755('0x39')]);_0x544041[_0x5755('0x27')][_0x5755('0x78')]=_0x5b3931[_0x5755('0x78')];_0x544041[_0x5755('0x27')][_0x5755('0x79')]=_0x5b3931[_0x5755('0x78')];_0x544041[_0x5755('0x27')][_0x5755('0x7a')]='reject';respondWithRpcPromise(_0x5755('0x7c'),_0x5755('0x7c'),{'event':_0x5755('0x83'),'message':_0x544041['message']},client9002);return _0x5b3931;}return null;})['then'](respondWithResult(_0x1239c5,null))[_0x5755('0x29')](handleError(_0x1239c5,null));};exports[_0x5755('0x84')]=function(_0xff8c5f,_0xfdded5){var _0x5b9876;return db[_0x5755('0x3c')][_0x5755('0x84')](_0xff8c5f[_0x5755('0x58')],{})['then'](function(_0x58581e){_0x5b9876=_0x58581e;return db[_0x5755('0x85')][_0x5755('0x86')]({'where':{'id':_0x5b9876['ContactId']}});})['then'](function(_0x272d90){if(_[_0x5755('0x65')](_0x272d90)){return;}else{_0x5b9876['fax']=_0x272d90[_0x5755('0x5d')];return db['Attachment'][_0x5755('0x86')]({'where':{'id':_0x5b9876[_0x5755('0x87')]}});}})[_0x5755('0x20')](function(_0x506835){return respondWithRpcPromise(_0x5755('0x88'),_0x5755('0x88'),{'FaxAccountId':_['isNil'](_0xff8c5f['body'])?undefined:_0xff8c5f[_0x5755('0x58')][_0x5755('0x89')],'path':_[_0x5755('0x65')](_0x506835)?undefined:util[_0x5755('0x60')](_0x5755('0x8a'),_0x506835[_0x5755('0x8b')]),'fax':_[_0x5755('0x65')](_0x5b9876[_0x5755('0x5d')])?undefined:_0x5b9876[_0x5755('0x5d')],'AttachmentId':_0x5b9876[_0x5755('0x87')]},client9002);})['then'](respondWithResult(_0xfdded5,0xc9))[_0x5755('0x29')](handleError(_0xfdded5,null));};exports[_0x5755('0x8c')]=function(_0xa19b3f,_0x505c97){var _0x10e8d6=path[_0x5755('0x8d')](config[_0x5755('0x8e')],_0x5755('0x8f'),_0x5755('0x90'),_0x5755('0x91'));return db[_0x5755('0x3c')]['find']({'where':{'id':_0xa19b3f[_0x5755('0x5a')]['id']},'include':[{'model':db[_0x5755('0x92')],'as':_0x5755('0x92')}]})[_0x5755('0x20')](handleEntityNotFound(_0x505c97,null))[_0x5755('0x20')](function(_0x52083b){if(_0x52083b){return _0x505c97[_0x5755('0x8c')](path['join'](_0x10e8d6,_0x52083b[_0x5755('0x92')][_0x5755('0x8b')]));}})[_0x5755('0x29')](handleError(_0x505c97,null));}; \ No newline at end of file +var _0x71ff=['attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','show','length','includeAll','find','update','body','params','describe','fax-interactions','accept','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE: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','email','internal','agent','SIP/%s','channel','event','EventManager','acceptmessage','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','interface','motionChannel','create','CmContact','findOne','Attachment','SendFax','FaxAccountId','format','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','eml-format','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','destroy','stack','name','index','FaxMessage','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection'];(function(_0x352041,_0x170746){var _0x38be0b=function(_0x5b5e00){while(--_0x5b5e00){_0x352041['push'](_0x352041['shift']());}};_0x38be0b(++_0x170746);}(_0x71ff,0x1f4));var _0xf71f=function(_0x2cae8e,_0x32a809){_0x2cae8e=_0x2cae8e-0x0;var _0x59fd42=_0x71ff[_0x2cae8e];return _0x59fd42;};'use strict';var emlformat=require(_0xf71f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf71f('0x1'));var moment=require(_0xf71f('0x2'));var BPromise=require(_0xf71f('0x3'));var Mustache=require('mustache');var util=require(_0xf71f('0x4'));var path=require('path');var sox=require(_0xf71f('0x5'));var csv=require('to-csv');var ejs=require(_0xf71f('0x6'));var fs=require('fs');var fs_extra=require(_0xf71f('0x7'));var _=require(_0xf71f('0x8'));var squel=require(_0xf71f('0x9'));var crypto=require('crypto');var jsforce=require(_0xf71f('0xa'));var deskjs=require(_0xf71f('0xb'));var toCsv=require(_0xf71f('0xc'));var querystring=require('querystring');var Papa=require(_0xf71f('0xd'));var Redis=require(_0xf71f('0xe'));var authService=require(_0xf71f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf71f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf71f('0x11'))(_0xf71f('0x12'));var utils=require(_0xf71f('0x13'));var config=require(_0xf71f('0x14'));var licenseUtil=require(_0xf71f('0x15'));var db=require(_0xf71f('0x16'))['db'];config[_0xf71f('0x17')]=_[_0xf71f('0x18')](config[_0xf71f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xf71f('0x19'))(new Redis(config['redis']));require(_0xf71f('0x1a'))['register'](socket);var jayson=require(_0xf71f('0x1b'));var client=jayson[_0xf71f('0x1c')][_0xf71f('0x1d')]({'port':0x232c});var client9002=jayson[_0xf71f('0x1c')][_0xf71f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x331b04,_0x32bbe9,_0x5aeb92,_0x29d3ad){return new BPromise(function(_0x424b0a,_0x3c0a5c){var _0x53bb93=_0x29d3ad||client;return _0x53bb93[_0xf71f('0x1e')](_0x331b04,_0x5aeb92)[_0xf71f('0x1f')](function(_0x2b9944){logger[_0xf71f('0x20')]('FaxMessage,\x20%s,\x20%s',_0x32bbe9,_0xf71f('0x21'));logger[_0xf71f('0x22')](_0xf71f('0x23'),_0x32bbe9,_0xf71f('0x21'),JSON[_0xf71f('0x24')](_0x2b9944));if(_0x2b9944['error']){if(_0x2b9944[_0xf71f('0x25')][_0xf71f('0x26')]===0x1f4){logger['error'](_0xf71f('0x27'),_0x32bbe9,_0x2b9944['error'][_0xf71f('0x28')]);return _0x3c0a5c(_0x2b9944[_0xf71f('0x25')][_0xf71f('0x28')]);}logger[_0xf71f('0x25')](_0xf71f('0x27'),_0x32bbe9,_0x2b9944[_0xf71f('0x25')]['message']);return _0x424b0a(_0x2b9944[_0xf71f('0x25')][_0xf71f('0x28')]);}else{logger[_0xf71f('0x20')](_0xf71f('0x27'),_0x32bbe9,_0xf71f('0x21'));_0x424b0a(_0x2b9944[_0xf71f('0x29')][_0xf71f('0x28')]);}})[_0xf71f('0x2a')](function(_0x35896e){logger[_0xf71f('0x25')](_0xf71f('0x27'),_0x32bbe9,_0x35896e);_0x3c0a5c(_0x35896e);});});}function respondWithStatusCode(_0x1a37ab,_0x5dc1b0){_0x5dc1b0=_0x5dc1b0||0xcc;return function(_0x31d272){if(_0x31d272){return _0x1a37ab[_0xf71f('0x2b')](_0x5dc1b0);}return _0x1a37ab['status'](_0x5dc1b0)[_0xf71f('0x2c')]();};}function respondWithResult(_0x1968af,_0x3eb8c0){_0x3eb8c0=_0x3eb8c0||0xc8;return function(_0x526e21){if(_0x526e21){return _0x1968af['status'](_0x3eb8c0)[_0xf71f('0x2d')](_0x526e21);}};}function respondWithFilteredResult(_0x3a7c0f,_0x47ccf9){return function(_0x3441eb){if(_0x3441eb){var _0x2f67c7=typeof _0x47ccf9[_0xf71f('0x2e')]==='undefined'&&typeof _0x47ccf9['limit']===_0xf71f('0x2f');var _0x19c8e2=_0x3441eb[_0xf71f('0x30')];var _0x258509=_0x2f67c7?0x0:_0x47ccf9[_0xf71f('0x2e')];var _0x26f3aa=_0x2f67c7?_0x3441eb['count']:_0x47ccf9[_0xf71f('0x2e')]+_0x47ccf9[_0xf71f('0x31')];var _0x25b3e4;if(_0x26f3aa>=_0x19c8e2){_0x26f3aa=_0x19c8e2;_0x25b3e4=0xc8;}else{_0x25b3e4=0xce;}_0x3a7c0f[_0xf71f('0x32')](_0x25b3e4);return _0x3a7c0f[_0xf71f('0x33')](_0xf71f('0x34'),_0x258509+'-'+_0x26f3aa+'/'+_0x19c8e2)[_0xf71f('0x2d')](_0x3441eb);}return null;};}function patchUpdates(_0x1d191e){return function(_0x551a55){try{jsonpatch[_0xf71f('0x35')](_0x551a55,_0x1d191e,!![]);}catch(_0x23819b){return BPromise['reject'](_0x23819b);}return _0x551a55['save']();};}function saveUpdates(_0x39768b,_0x40a3d8){return function(_0x398b8e){if(_0x398b8e){return _0x398b8e['update'](_0x39768b)['then'](function(_0x2c7d76){return _0x2c7d76;});}return null;};}function removeEntity(_0x56329a,_0x5d36d4){return function(_0x58d89c){if(_0x58d89c){return _0x58d89c[_0xf71f('0x36')]()['then'](function(){_0x56329a[_0xf71f('0x32')](0xcc)[_0xf71f('0x2c')]();});}};}function handleEntityNotFound(_0x1d3bb2,_0xb174be){return function(_0x11d963){if(!_0x11d963){_0x1d3bb2['sendStatus'](0x194);}return _0x11d963;};}function handleError(_0x174ff1,_0x58fef1){_0x58fef1=_0x58fef1||0x1f4;return function(_0x1da1b2){logger[_0xf71f('0x25')](_0x1da1b2[_0xf71f('0x37')]);if(_0x1da1b2[_0xf71f('0x38')]){delete _0x1da1b2[_0xf71f('0x38')];}_0x174ff1[_0xf71f('0x32')](_0x58fef1)['send'](_0x1da1b2);};}exports[_0xf71f('0x39')]=function(_0x9b1e69,_0x264f7c){var _0x56672e={},_0x47d493={},_0x24d911={'count':0x0,'rows':[]};var _0x4eaa29=_['map'](db[_0xf71f('0x3a')][_0xf71f('0x3b')],function(_0x1d6922){return{'name':_0x1d6922[_0xf71f('0x3c')],'type':_0x1d6922[_0xf71f('0x3d')]['key']};});_0x47d493[_0xf71f('0x3e')]=_[_0xf71f('0x3f')](_0x4eaa29,_0xf71f('0x38'));_0x47d493['query']=_[_0xf71f('0x40')](_0x9b1e69[_0xf71f('0x41')]);_0x47d493[_0xf71f('0x42')]=_[_0xf71f('0x43')](_0x47d493[_0xf71f('0x3e')],_0x47d493[_0xf71f('0x41')]);_0x56672e[_0xf71f('0x44')]=_[_0xf71f('0x43')](_0x47d493['model'],qs[_0xf71f('0x45')](_0x9b1e69[_0xf71f('0x41')][_0xf71f('0x45')]));_0x56672e[_0xf71f('0x44')]=_0x56672e[_0xf71f('0x44')]['length']?_0x56672e[_0xf71f('0x44')]:_0x47d493[_0xf71f('0x3e')];if(!_0x9b1e69[_0xf71f('0x41')][_0xf71f('0x46')](_0xf71f('0x47'))){_0x56672e[_0xf71f('0x31')]=qs[_0xf71f('0x31')](_0x9b1e69[_0xf71f('0x41')][_0xf71f('0x31')]);_0x56672e[_0xf71f('0x2e')]=qs[_0xf71f('0x2e')](_0x9b1e69[_0xf71f('0x41')][_0xf71f('0x2e')]);}_0x56672e['order']=qs['sort'](_0x9b1e69['query'][_0xf71f('0x48')]);_0x56672e[_0xf71f('0x49')]=qs[_0xf71f('0x42')](_[_0xf71f('0x4a')](_0x9b1e69[_0xf71f('0x41')],_0x47d493[_0xf71f('0x42')]),_0x4eaa29);if(_0x9b1e69[_0xf71f('0x41')][_0xf71f('0x4b')]){_0x56672e['where']=_[_0xf71f('0x4c')](_0x56672e[_0xf71f('0x49')],{'$or':_[_0xf71f('0x3f')](_0x4eaa29,function(_0x32dcf6){if(_0x32dcf6[_0xf71f('0x3d')]!=='VIRTUAL'){var _0x43c5ea={};_0x43c5ea[_0x32dcf6[_0xf71f('0x38')]]={'$like':'%'+_0x9b1e69[_0xf71f('0x41')][_0xf71f('0x4b')]+'%'};return _0x43c5ea;}})});}_0x56672e=_[_0xf71f('0x4c')]({},_0x56672e,_0x9b1e69[_0xf71f('0x4d')]);var _0x504a64={'where':_0x56672e[_0xf71f('0x49')]};return db[_0xf71f('0x3a')][_0xf71f('0x30')](_0x504a64)['then'](function(_0x51c7e0){_0x24d911['count']=_0x51c7e0;if(_0x9b1e69[_0xf71f('0x41')]['includeAll']){_0x56672e[_0xf71f('0x4e')]=[{'all':!![]}];}return db[_0xf71f('0x3a')][_0xf71f('0x4f')](_0x56672e);})[_0xf71f('0x1f')](function(_0x5bcccd){_0x24d911[_0xf71f('0x50')]=_0x5bcccd;return _0x24d911;})[_0xf71f('0x1f')](respondWithFilteredResult(_0x264f7c,_0x56672e))[_0xf71f('0x2a')](handleError(_0x264f7c,null));};exports[_0xf71f('0x51')]=function(_0x50ae20,_0xb13352){var _0x106dd0={'raw':!![],'where':{'id':_0x50ae20['params']['id']}},_0x1af481={};_0x1af481[_0xf71f('0x3e')]=_[_0xf71f('0x40')](db['FaxMessage'][_0xf71f('0x3b')]);_0x1af481[_0xf71f('0x41')]=_[_0xf71f('0x40')](_0x50ae20[_0xf71f('0x41')]);_0x1af481[_0xf71f('0x42')]=_[_0xf71f('0x43')](_0x1af481[_0xf71f('0x3e')],_0x1af481['query']);_0x106dd0[_0xf71f('0x44')]=_[_0xf71f('0x43')](_0x1af481[_0xf71f('0x3e')],qs[_0xf71f('0x45')](_0x50ae20[_0xf71f('0x41')][_0xf71f('0x45')]));_0x106dd0[_0xf71f('0x44')]=_0x106dd0['attributes'][_0xf71f('0x52')]?_0x106dd0[_0xf71f('0x44')]:_0x1af481[_0xf71f('0x3e')];if(_0x50ae20[_0xf71f('0x41')][_0xf71f('0x53')]){_0x106dd0['include']=[{'all':!![]}];}_0x106dd0=_[_0xf71f('0x4c')]({},_0x106dd0,_0x50ae20[_0xf71f('0x4d')]);return db[_0xf71f('0x3a')][_0xf71f('0x54')](_0x106dd0)[_0xf71f('0x1f')](handleEntityNotFound(_0xb13352,null))[_0xf71f('0x1f')](respondWithResult(_0xb13352,null))[_0xf71f('0x2a')](handleError(_0xb13352,null));};exports[_0xf71f('0x55')]=function(_0x18bad8,_0x584582){if(_0x18bad8['body']['id']){delete _0x18bad8[_0xf71f('0x56')]['id'];}return db['FaxMessage'][_0xf71f('0x54')]({'where':{'id':_0x18bad8['params']['id']}})[_0xf71f('0x1f')](handleEntityNotFound(_0x584582,null))[_0xf71f('0x1f')](saveUpdates(_0x18bad8[_0xf71f('0x56')],null))[_0xf71f('0x1f')](respondWithResult(_0x584582,null))[_0xf71f('0x2a')](handleError(_0x584582,null));};exports[_0xf71f('0x36')]=function(_0x79808e,_0x2ffcc8){return db[_0xf71f('0x3a')][_0xf71f('0x54')]({'where':{'id':_0x79808e[_0xf71f('0x57')]['id']}})[_0xf71f('0x1f')](handleEntityNotFound(_0x2ffcc8,null))['then'](removeEntity(_0x2ffcc8,null))[_0xf71f('0x2a')](handleError(_0x2ffcc8,null));};exports[_0xf71f('0x58')]=function(_0x1b096c,_0x86293a){return db[_0xf71f('0x3a')][_0xf71f('0x58')]()['then'](respondWithResult(_0x86293a,null))['catch'](handleError(_0x86293a,null));};var interaction_log=require(_0xf71f('0x11'))(_0xf71f('0x59'));exports[_0xf71f('0x5a')]=function(_0x4d33cf,_0x2d1ab8,_0x229b1f){var _0x173e57={'agent':{},'channel':_0xf71f('0x5b')};if(_0x4d33cf[_0xf71f('0x56')]['id']){delete _0x4d33cf[_0xf71f('0x56')]['id'];}_0x4d33cf[_0xf71f('0x56')][_0xf71f('0x5c')]=!![];_0x4d33cf[_0xf71f('0x56')]['readAt']=moment()['format'](_0xf71f('0x5d'));_0x4d33cf[_0xf71f('0x56')][_0xf71f('0x5e')]=_0x4d33cf[_0xf71f('0x56')][_0xf71f('0x5e')]||_0x4d33cf[_0xf71f('0x5f')]['id'];_0x173e57['agent']['id']=_0x4d33cf[_0xf71f('0x56')][_0xf71f('0x5e')];return db[_0xf71f('0x3a')][_0xf71f('0x54')]({'where':{'id':_0x4d33cf[_0xf71f('0x57')]['id'],'UserId':null}})[_0xf71f('0x1f')](handleEntityNotFound(_0x2d1ab8,null))[_0xf71f('0x1f')](saveUpdates(_0x4d33cf[_0xf71f('0x56')],null))[_0xf71f('0x1f')](function(_0x3f233f){if(_0x3f233f){_0x173e57[_0xf71f('0x28')]=_0x3f233f[_0xf71f('0x60')]({'plain':!![]});return db[_0xf71f('0x61')][_0xf71f('0x54')]({'where':{'id':_0x3f233f[_0xf71f('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x2d1ab8,null))['then'](function(_0x4f9c89){if(_0x4f9c89){return _0x4f9c89['update']({'UserId':_0x4d33cf['body']['UserId'],'read1stAt':_[_0xf71f('0x63')](_0x4f9c89[_0xf71f('0x64')])?moment()['format'](_0xf71f('0x5d')):undefined});}return null;})['then'](function(_0x210d7a){if(_0x210d7a){_0x173e57[_0xf71f('0x65')]=_0x210d7a['get']({'plain':!![]});interaction_log[_0xf71f('0x20')](_0xf71f('0x66'),_0x4d33cf[_0xf71f('0x5f')]['id'],_0x4d33cf[_0xf71f('0x5f')]['name'],_0x4d33cf['user'][_0xf71f('0x67')],_0x173e57[_0xf71f('0x65')]['id'],_0x4d33cf[_0xf71f('0x56')]?JSON[_0xf71f('0x24')](_0x4d33cf['body']):_0xf71f('0x68'));return respondWithRpcPromise(_0xf71f('0x69'),_0xf71f('0x6a'),_0x173e57);}return null;})[_0xf71f('0x1f')](function(_0xff666e){var _0x1310ae=_0xf71f('0x6b')+_0xff666e[_0xf71f('0x28')][_0xf71f('0x6c')];return db[_0xf71f('0x6d')][_0xf71f('0x41')](_0x1310ae,{'type':db[_0xf71f('0x6e')][_0xf71f('0x6f')][_0xf71f('0x70')],'raw':!![]})[_0xf71f('0x1f')](function(_0x494857){return _0x494857;});})[_0xf71f('0x1f')](function(_0x8be0a3){if(_0x8be0a3){_0x173e57[_0xf71f('0x28')][_0xf71f('0x71')]=_0x8be0a3[0x0];if(!_0x4d33cf[_0xf71f('0x56')][_0xf71f('0x5e')])return;return db['User'][_0xf71f('0x54')]({'where':{'id':_0x4d33cf['body'][_0xf71f('0x5e')],'role':'agent'},'attributes':['id',_0xf71f('0x38'),'fullname',_0xf71f('0x72'),_0xf71f('0x73')],'raw':!![]});}return null;})[_0xf71f('0x1f')](function(_0x3e68db){if(!_0x3e68db)return null;_0x173e57[_0xf71f('0x28')][_0xf71f('0x74')]=_0x3e68db;return _0x173e57;})[_0xf71f('0x1f')](function(_0x513759){if(_0x513759){if(_0x4d33cf[_0xf71f('0x56')]['manual']){_0x173e57[_0xf71f('0x28')]['interface']=util['format'](_0xf71f('0x75'),_0x4d33cf[_0xf71f('0x5f')][_0xf71f('0x38')]);_0x173e57['message'][_0xf71f('0x76')]=_0x173e57[_0xf71f('0x76')];_0x173e57[_0xf71f('0x28')]['motionChannel']=_0x173e57[_0xf71f('0x76')];_0x173e57['message'][_0xf71f('0x77')]=_0xf71f('0x5a');return respondWithRpcPromise(_0xf71f('0x78'),_0xf71f('0x78'),{'event':_0xf71f('0x79'),'message':_0x173e57[_0xf71f('0x28')]},client9002)[_0xf71f('0x1f')](function(){return _0x173e57;});}return _0x173e57;}return null;})[_0xf71f('0x1f')](respondWithResult(_0x2d1ab8,null))[_0xf71f('0x2a')](handleError(_0x2d1ab8,null));};var interaction_log=require(_0xf71f('0x11'))(_0xf71f('0x59'));exports[_0xf71f('0x7a')]=function(_0x403148,_0x271bac,_0x33e64a){var _0x29cf85={'agent':{},'channel':'fax'};if(_0x403148['body']['id']){delete _0x403148[_0xf71f('0x56')]['id'];}_0x403148[_0xf71f('0x56')][_0xf71f('0x5e')]=_0x403148[_0xf71f('0x56')]['UserId']||_0x403148[_0xf71f('0x5f')]['id'];_0x29cf85[_0xf71f('0x74')]['id']=_0x403148[_0xf71f('0x56')]['UserId'];return db[_0xf71f('0x3a')]['find']({'where':{'id':_0x403148[_0xf71f('0x57')]['id'],'UserId':null}})[_0xf71f('0x1f')](handleEntityNotFound(_0x271bac,null))[_0xf71f('0x1f')](function(_0x3c4f4e){if(_0x3c4f4e){_0x29cf85['message']=_0x3c4f4e['get']({'plain':!![]});return db['FaxInteraction'][_0xf71f('0x54')]({'where':{'id':_0x3c4f4e[_0xf71f('0x62')]}});}return null;})[_0xf71f('0x1f')](handleEntityNotFound(_0x271bac,null))[_0xf71f('0x1f')](function(_0xf68073){if(_0xf68073){_0x29cf85['interaction']=_0xf68073['get']({'plain':!![]});interaction_log[_0xf71f('0x20')](_0xf71f('0x7b'),_0x403148[_0xf71f('0x5f')]['id'],_0x403148[_0xf71f('0x5f')][_0xf71f('0x38')],_0x403148[_0xf71f('0x5f')][_0xf71f('0x67')],_0x29cf85['interaction']['id'],_0x403148[_0xf71f('0x56')]?JSON[_0xf71f('0x24')](_0x403148[_0xf71f('0x56')]):_0xf71f('0x68'));return respondWithRpcPromise(_0xf71f('0x7c'),'rejectMessage',_0x29cf85);}return null;})[_0xf71f('0x1f')](function(_0x2a4282){var _0x52ccbb=_0xf71f('0x6b')+_0x2a4282[_0xf71f('0x28')][_0xf71f('0x6c')];return db[_0xf71f('0x6d')][_0xf71f('0x41')](_0x52ccbb,{'type':db['Sequelize'][_0xf71f('0x6f')][_0xf71f('0x70')],'raw':!![]})['then'](function(_0x2abe35){return _0x2abe35;});})[_0xf71f('0x1f')](function(_0x1c023a){if(_0x1c023a){_0x29cf85[_0xf71f('0x28')]['contact']=_0x1c023a[0x0];if(!_0x403148['body'][_0xf71f('0x5e')])return;return db[_0xf71f('0x7d')]['find']({'where':{'id':_0x403148[_0xf71f('0x56')][_0xf71f('0x5e')],'role':_0xf71f('0x74')},'attributes':['id',_0xf71f('0x38'),'fullname',_0xf71f('0x72'),_0xf71f('0x73')],'raw':!![]});}return null;})[_0xf71f('0x1f')](function(_0x2db7be){if(!_0x2db7be)return null;_0x29cf85['message'][_0xf71f('0x74')]=_0x2db7be;return _0x29cf85;})['then'](function(_0x574db7){if(_0x574db7){_0x574db7[_0xf71f('0x28')][_0xf71f('0x7e')]=util['format'](_0xf71f('0x75'),_0x403148[_0xf71f('0x5f')][_0xf71f('0x38')]);_0x574db7[_0xf71f('0x28')][_0xf71f('0x76')]=_0x29cf85['channel'];_0x574db7[_0xf71f('0x28')][_0xf71f('0x7f')]=_0x29cf85[_0xf71f('0x76')];_0x574db7['message'][_0xf71f('0x77')]=_0xf71f('0x7a');respondWithRpcPromise(_0xf71f('0x78'),_0xf71f('0x78'),{'event':'rejectmessage','message':_0x574db7[_0xf71f('0x28')]},client9002);return _0x29cf85;}return null;})[_0xf71f('0x1f')](respondWithResult(_0x271bac,null))['catch'](handleError(_0x271bac,null));};exports[_0xf71f('0x80')]=function(_0x2d0f77,_0x59c197){var _0x3bcc33;return db[_0xf71f('0x3a')]['create'](_0x2d0f77[_0xf71f('0x56')],{})['then'](function(_0x3d21f7){_0x3bcc33=_0x3d21f7;return db[_0xf71f('0x81')][_0xf71f('0x82')]({'where':{'id':_0x3bcc33[_0xf71f('0x6c')]}});})[_0xf71f('0x1f')](function(_0x178da8){if(_[_0xf71f('0x63')](_0x178da8)){return;}else{_0x3bcc33[_0xf71f('0x5b')]=_0x178da8['fax'];return db[_0xf71f('0x83')][_0xf71f('0x82')]({'where':{'id':_0x3bcc33['AttachmentId']}});}})[_0xf71f('0x1f')](function(_0x625632){return respondWithRpcPromise('SendFax',_0xf71f('0x84'),{'FaxAccountId':_[_0xf71f('0x63')](_0x2d0f77[_0xf71f('0x56')])?undefined:_0x2d0f77[_0xf71f('0x56')][_0xf71f('0x85')],'path':_['isNil'](_0x625632)?undefined:util[_0xf71f('0x86')](_0xf71f('0x87'),_0x625632[_0xf71f('0x88')]),'fax':_[_0xf71f('0x63')](_0x3bcc33[_0xf71f('0x5b')])?undefined:_0x3bcc33[_0xf71f('0x5b')],'AttachmentId':_0x3bcc33['AttachmentId']},client9002);})[_0xf71f('0x1f')](respondWithResult(_0x59c197,0xc9))[_0xf71f('0x2a')](handleError(_0x59c197,null));};exports[_0xf71f('0x89')]=function(_0xc3d6df,_0x79989){var _0xbbd56c=path[_0xf71f('0x8a')](config[_0xf71f('0x8b')],_0xf71f('0x8c'),'files',_0xf71f('0x8d'));return db[_0xf71f('0x3a')]['find']({'where':{'id':_0xc3d6df['params']['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0xf71f('0x1f')](handleEntityNotFound(_0x79989,null))[_0xf71f('0x1f')](function(_0xcc9482){if(_0xcc9482){return _0x79989['download'](path[_0xf71f('0x8a')](_0xbbd56c,_0xcc9482[_0xf71f('0x83')][_0xf71f('0x88')]));}})[_0xf71f('0x2a')](handleError(_0x79989,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 02d5f73..5edd80a 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 _0x3714=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x52b0b5,_0x2ced39){var _0x1a57cc=function(_0x5f3f46){while(--_0x5f3f46){_0x52b0b5['push'](_0x52b0b5['shift']());}};_0x1a57cc(++_0x2ced39);}(_0x3714,0x95));var _0x4371=function(_0x2a992b,_0x3dd1e0){_0x2a992b=_0x2a992b-0x0;var _0x44777c=_0x3714[_0x2a992b];return _0x44777c;};'use strict';var EventEmitter=require(_0x4371('0x0'));var FaxMessage=require(_0x4371('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4371('0x2')](0x0);var events={'afterCreate':_0x4371('0x3'),'afterUpdate':_0x4371('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21bccf){return function(_0x20929e,_0x2c0435,_0x5a2ffa){FaxMessageEvents[_0x4371('0x5')](_0x21bccf+':'+_0x20929e['id'],_0x20929e);FaxMessageEvents['emit'](_0x21bccf,_0x20929e);_0x5a2ffa(null);};}for(var e in events){if(events[_0x4371('0x6')](e)){var event=events[e];FaxMessage[_0x4371('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x8ff3=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x37d0c3,_0x31c478){var _0x4684d6=function(_0x1cbc5c){while(--_0x1cbc5c){_0x37d0c3['push'](_0x37d0c3['shift']());}};_0x4684d6(++_0x31c478);}(_0x8ff3,0x72));var _0x38ff=function(_0x51b42e,_0x8dea09){_0x51b42e=_0x51b42e-0x0;var _0x43ed23=_0x8ff3[_0x51b42e];return _0x43ed23;};'use strict';var EventEmitter=require(_0x38ff('0x0'));var FaxMessage=require(_0x38ff('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x38ff('0x2')](0x0);var events={'afterCreate':_0x38ff('0x3'),'afterUpdate':_0x38ff('0x4'),'afterDestroy':_0x38ff('0x5')};function emitEvent(_0x33ac8d){return function(_0x5bf243,_0x5f377c,_0x35d87f){FaxMessageEvents['emit'](_0x33ac8d+':'+_0x5bf243['id'],_0x5bf243);FaxMessageEvents[_0x38ff('0x6')](_0x33ac8d,_0x5bf243);_0x35d87f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x38ff('0x7')](e,emitEvent(event));}}module[_0x38ff('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 4c733e2..4ccc9f1 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 _0x95af=['moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger'];(function(_0x4f6988,_0x2b2ae2){var _0x366a93=function(_0x5f469c){while(--_0x5f469c){_0x4f6988['push'](_0x4f6988['shift']());}};_0x366a93(++_0x2b2ae2);}(_0x95af,0xb3));var _0xf95a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95af[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf95a('0x0'));var util=require(_0xf95a('0x1'));var logger=require(_0xf95a('0x2'))('api');var moment=require(_0xf95a('0x3'));var BPromise=require(_0xf95a('0x4'));var rp=require(_0xf95a('0x5'));var fs=require('fs');var path=require(_0xf95a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf95a('0x7'));module[_0xf95a('0x8')]=function(_0x189783,_0x3c6549){return _0x189783[_0xf95a('0x9')](_0xf95a('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xf95a('0xb')],'type':_0xf95a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27372d,_0x25b9ed,_0x28748a){var _0x591bce=_0x189783[_0xf95a('0xd')];var _0xa05122=_0x27372d[_0xf95a('0xe')]({'plain':!![]});if(_0xa05122[_0xf95a('0xf')][_0xf95a('0x10')]()==='in'||_0xa05122['direction']['toLowerCase']()==='out'&&!_0xa05122['secret']&&!_[_0xf95a('0x11')](_0xa05122[_0xf95a('0x12')])){_0x591bce['FaxInteraction'][_0xf95a('0x13')]({'where':{'id':_0xa05122['FaxInteractionId']}})[_0xf95a('0x14')](function(_0x43f7e8){if(_0x43f7e8){_0x43f7e8[_0xf95a('0x15')]({'lastMsgAt':_0xa05122[_0xf95a('0x16')],'lastMsgDirection':_0xa05122[_0xf95a('0xf')][_0xf95a('0x10')]()});}})[_0xf95a('0x17')](function(_0x5044a4){console[_0xf95a('0x18')](_0x5044a4);});}_0x28748a();}},'charset':_0xf95a('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb5c1=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','catch'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xb5c1,0x1f2));var _0x1b5c=function(_0x1a4f2b,_0x4d0023){_0x1a4f2b=_0x1a4f2b-0x0;var _0x4ce7fb=_0xb5c1[_0x1a4f2b];return _0x4ce7fb;};'use strict';var _=require(_0x1b5c('0x0'));var util=require(_0x1b5c('0x1'));var logger=require(_0x1b5c('0x2'))(_0x1b5c('0x3'));var moment=require(_0x1b5c('0x4'));var BPromise=require(_0x1b5c('0x5'));var rp=require(_0x1b5c('0x6'));var fs=require('fs');var path=require(_0x1b5c('0x7'));var rimraf=require(_0x1b5c('0x8'));var config=require(_0x1b5c('0x9'));var attributes=require('./faxMessage.attributes');module[_0x1b5c('0xa')]=function(_0x2505e0,_0x2d2ac0){return _0x2505e0[_0x1b5c('0xb')](_0x1b5c('0xc'),attributes,{'tableName':_0x1b5c('0xd'),'paranoid':![],'indexes':[{'name':_0x1b5c('0xe'),'fields':[_0x1b5c('0xf')],'type':_0x1b5c('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fcb0d,_0x53ce43,_0x20ab12){var _0x4a0ef3=_0x2505e0[_0x1b5c('0x11')];var _0x33c517=_0x4fcb0d[_0x1b5c('0x12')]({'plain':!![]});if(_0x33c517[_0x1b5c('0x13')]['toLowerCase']()==='in'||_0x33c517[_0x1b5c('0x13')][_0x1b5c('0x14')]()===_0x1b5c('0x15')&&!_0x33c517[_0x1b5c('0x16')]&&!_[_0x1b5c('0x17')](_0x33c517[_0x1b5c('0x18')])){_0x4a0ef3[_0x1b5c('0x19')]['findOne']({'where':{'id':_0x33c517[_0x1b5c('0x1a')]}})[_0x1b5c('0x1b')](function(_0x4f893b){if(_0x4f893b){_0x4f893b[_0x1b5c('0x1c')]({'lastMsgAt':_0x33c517['createdAt'],'lastMsgDirection':_0x33c517[_0x1b5c('0x13')][_0x1b5c('0x14')]()});}})[_0x1b5c('0x1d')](function(_0x320de4){console[_0x1b5c('0x1e')](_0x320de4);});}_0x20ab12();}},'charset':_0x1b5c('0x1f'),'collate':_0x1b5c('0x20')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 810e420..7b3318e 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 _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x5b2eef,_0x3aab32){var _0x44a109=function(_0x2fbbd9){while(--_0x2fbbd9){_0x5b2eef['push'](_0x5b2eef['shift']());}};_0x44a109(++_0x3aab32);}(_0x6aa7,0x178));var _0x76aa=function(_0x312c66,_0x4ddaeb){_0x312c66=_0x312c66-0x0;var _0x106387=_0x6aa7[_0x312c66];return _0x106387;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});}; \ No newline at end of file +var _0xe5b3=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','then','info'];(function(_0x3a69a6,_0x524813){var _0x3b20c9=function(_0xff3134){while(--_0xff3134){_0x3a69a6['push'](_0x3a69a6['shift']());}};_0x3b20c9(++_0x524813);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4c6560,_0x5d8c5c){_0x4c6560=_0x4c6560-0x0;var _0x378098=_0xe5b3[_0x4c6560];return _0x378098;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});config[_0x3e5b('0xc')]=_['defaults'](config[_0x3e5b('0xc')],{'host':_0x3e5b('0xd'),'port':0x18eb});var socket=require(_0x3e5b('0xe'))(new Redis(config[_0x3e5b('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1fef54,_0x3d3b6e,_0x22fc1a){return new BPromise(function(_0x17dee7,_0xeeaabc){return client['request'](_0x1fef54,_0x22fc1a)[_0x3e5b('0xf')](function(_0x52efbd){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,_0x3e5b('0x12'));logger[_0x3e5b('0x13')](_0x3e5b('0x14'),_0x3d3b6e,_0x3e5b('0x12'),JSON[_0x3e5b('0x15')](_0x52efbd));if(_0x52efbd['error']){if(_0x52efbd[_0x3e5b('0x16')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd[_0x3e5b('0x16')][_0x3e5b('0x17')]);return _0xeeaabc(_0x52efbd[_0x3e5b('0x16')]['message']);}logger[_0x3e5b('0x16')]('FaxMessage,\x20%s,\x20%s',_0x3d3b6e,_0x52efbd['error'][_0x3e5b('0x17')]);return _0x17dee7(_0x52efbd[_0x3e5b('0x16')]['message']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x3d3b6e,'request\x20sent');_0x17dee7(_0x52efbd[_0x3e5b('0x18')][_0x3e5b('0x17')]);}})['catch'](function(_0x4b189d){logger[_0x3e5b('0x16')](_0x3e5b('0x11'),_0x3d3b6e,_0x4b189d);_0xeeaabc(_0x4b189d);});});}exports[_0x3e5b('0x19')]=function(_0xff4aba){var _0x24de5b=this;return new Promise(function(_0x1564b5,_0x447d36){return db[_0x3e5b('0x1a')][_0x3e5b('0x1b')](_0xff4aba[_0x3e5b('0x1c')],{'raw':_0xff4aba[_0x3e5b('0x1d')]?_0xff4aba[_0x3e5b('0x1d')][_0x3e5b('0x1e')]===undefined?!![]:![]:!![]})[_0x3e5b('0xf')](function(_0x5b46d4){logger[_0x3e5b('0x10')](_0x3e5b('0x19'),_0xff4aba);logger[_0x3e5b('0x13')](_0x3e5b('0x19'),_0xff4aba,JSON['stringify'](_0x5b46d4));_0x1564b5(_0x5b46d4);})[_0x3e5b('0x1f')](function(_0x5b33bb){logger[_0x3e5b('0x16')](_0x3e5b('0x19'),_0x5b33bb['message'],_0xff4aba);_0x447d36(_0x24de5b[_0x3e5b('0x16')](0x1f4,_0x5b33bb[_0x3e5b('0x17')]));});});};exports[_0x3e5b('0x20')]=function(_0x3c8965){var _0x3bb749=this;return new Promise(function(_0x26c7f2,_0x160e87){return db[_0x3e5b('0x1a')]['update'](_0x3c8965[_0x3e5b('0x1c')],{'raw':_0x3c8965['options']?_0x3c8965[_0x3e5b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x21')]||null:null,'attributes':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x22')]||null:null,'limit':_0x3c8965[_0x3e5b('0x1d')]?_0x3c8965[_0x3e5b('0x1d')][_0x3e5b('0x23')]||null:null})[_0x3e5b('0xf')](function(_0x1e1565){logger['info'](_0x3e5b('0x20'),_0x3c8965);logger[_0x3e5b('0x13')](_0x3e5b('0x20'),_0x3c8965,JSON[_0x3e5b('0x15')](_0x1e1565));_0x26c7f2(_0x1e1565);})[_0x3e5b('0x1f')](function(_0x31e9f9){logger[_0x3e5b('0x16')]('UpdateFaxMessage',_0x31e9f9[_0x3e5b('0x17')],_0x3c8965);_0x160e87(_0x3bb749['error'](0x1f4,_0x31e9f9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 10f0f79..54256a7 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 _0x65f8=['register','length','./faxMessage.events','save','emit'];(function(_0x426e8f,_0x158d3c){var _0x369f29=function(_0x3d394b){while(--_0x3d394b){_0x426e8f['push'](_0x426e8f['shift']());}};_0x369f29(++_0x158d3c);}(_0x65f8,0xd9));var _0x865f=function(_0x3af016,_0x33ce3b){_0x3af016=_0x3af016-0x0;var _0xdb337b=_0x65f8[_0x3af016];return _0xdb337b;};'use strict';var FaxMessageEvents=require(_0x865f('0x0'));var events=[_0x865f('0x1'),'remove','update'];function createListener(_0x17bb43,_0x5a218a){return function(_0x1253d1){_0x5a218a[_0x865f('0x2')](_0x17bb43,_0x1253d1);};}function removeListener(_0xc4dec8,_0x1498e1){return function(){FaxMessageEvents['removeListener'](_0xc4dec8,_0x1498e1);};}exports[_0x865f('0x3')]=function(_0x208502){for(var _0x1a074f=0x0,_0x4053c5=events[_0x865f('0x4')];_0x1a074f<_0x4053c5;_0x1a074f++){var _0x3eb088=events[_0x1a074f];var _0x4d2c00=createListener('faxMessage:'+_0x3eb088,_0x208502);FaxMessageEvents['on'](_0x3eb088,_0x4d2c00);}}; \ No newline at end of file +var _0xcf19=['register','length','save','remove','update','emit','removeListener'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcf19,0xf7));var _0x9cf1=function(_0x20c512,_0x36c198){_0x20c512=_0x20c512-0x0;var _0x25236e=_0xcf19[_0x20c512];return _0x25236e;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x9cf1('0x0'),_0x9cf1('0x1'),_0x9cf1('0x2')];function createListener(_0x35e524,_0xf32e1f){return function(_0x39be84){_0xf32e1f[_0x9cf1('0x3')](_0x35e524,_0x39be84);};}function removeListener(_0x4898cd,_0x19f5c4){return function(){FaxMessageEvents[_0x9cf1('0x4')](_0x4898cd,_0x19f5c4);};}exports[_0x9cf1('0x5')]=function(_0x3d4430){for(var _0x3a36dc=0x0,_0x594e2d=events[_0x9cf1('0x6')];_0x3a36dc<_0x594e2d;_0x3a36dc++){var _0xce3e09=events[_0x3a36dc];var _0xdb8d19=createListener('faxMessage:'+_0xce3e09,_0x3d4430);FaxMessageEvents['on'](_0xce3e09,_0xdb8d19);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 415cef9..f225271 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 _0xf72b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express'];(function(_0x2495f3,_0x4cbf1c){var _0x29bd4a=function(_0x7696bd){while(--_0x7696bd){_0x2495f3['push'](_0x2495f3['shift']());}};_0x29bd4a(++_0x4cbf1c);}(_0xf72b,0x1d9));var _0xbf72=function(_0x19f7b9,_0x55d570){_0x19f7b9=_0x19f7b9-0x0;var _0x337418=_0xf72b[_0x19f7b9];return _0x337418;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['download']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),interaction[_0xbf72('0x10')](_0xbf72('0x11'),_0xbf72('0x12')),controller[_0xbf72('0x13')]);router[_0xbf72('0x14')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0x15')]);router[_0xbf72('0x14')](_0xbf72('0x16'),auth['isAuthenticated'](),controller[_0xbf72('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xbf72('0x18')]);router[_0xbf72('0x19')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x1a')]);module[_0xbf72('0x1b')]=router; \ No newline at end of file +var _0x6c76=['path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util'];(function(_0x584b87,_0x3542b8){var _0x3e7b7e=function(_0xe8964d){while(--_0xe8964d){_0x584b87['push'](_0x584b87['shift']());}};_0x3e7b7e(++_0x3542b8);}(_0x6c76,0x184));var _0x66c7=function(_0x41a10f,_0xa263){_0x41a10f=_0x41a10f-0x0;var _0x3cb877=_0x6c76[_0x41a10f];return _0x3cb877;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./faxMessage.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0x7')](_0x66c7('0xc'),auth[_0x66c7('0x8')](),controller['download']);router[_0x66c7('0xd')]('/',auth[_0x66c7('0x8')](),interaction[_0x66c7('0xe')](_0x66c7('0xf'),_0x66c7('0x10')),controller[_0x66c7('0x11')]);router[_0x66c7('0x12')]('/:id',auth[_0x66c7('0x8')](),controller[_0x66c7('0x13')]);router[_0x66c7('0x12')](_0x66c7('0x14'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x15')]);router[_0x66c7('0x12')](_0x66c7('0x16'),auth[_0x66c7('0x8')](),controller['reject']);router[_0x66c7('0x17')]('/:id',auth[_0x66c7('0x8')](),controller[_0x66c7('0x18')]);module[_0x66c7('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 2b91b46..a450088 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 _0x8e8d=['name','INTEGER','ENUM','sequelize','exports','STRING'];(function(_0x5ce8e6,_0xba66d5){var _0x11bd61=function(_0x2b2de9){while(--_0x2b2de9){_0x5ce8e6['push'](_0x5ce8e6['shift']());}};_0x11bd61(++_0xba66d5);}(_0x8e8d,0x141));var _0xd8e8=function(_0x1b4c3b,_0x438db8){_0x1b4c3b=_0x1b4c3b-0x0;var _0x295897=_0x8e8d[_0x1b4c3b];return _0x295897;};'use strict';var Sequelize=require(_0xd8e8('0x0'));module[_0xd8e8('0x1')]={'name':{'type':Sequelize[_0xd8e8('0x2')],'unique':_0xd8e8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd8e8('0x2')]},'timeout':{'type':Sequelize[_0xd8e8('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd8e8('0x5')]('rrmemory','beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd8e8('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d1a=['INTEGER','sequelize','exports','name','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4c7958,_0x2c58ed){var _0x4f9953=function(_0x2fbb33){while(--_0x2fbb33){_0x4c7958['push'](_0x4c7958['shift']());}};_0x4f9953(++_0x2c58ed);}(_0x6d1a,0x91));var _0xa6d1=function(_0x1f4e9e,_0x1d05d8){_0x1f4e9e=_0x1f4e9e-0x0;var _0x25070e=_0x6d1a[_0x1f4e9e];return _0x25070e;};'use strict';var Sequelize=require(_0xa6d1('0x0'));module[_0xa6d1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa6d1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa6d1('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa6d1('0x4')](_0xa6d1('0x5'),_0xa6d1('0x6'),_0xa6d1('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa6d1('0x8')],'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 fa3fa4c..5cb622f 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 _0x327c=['sequelize','toString','SELECT','every','includes','all','compact','value','removeTeams','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','SIP','getTeams','Team','addTeams','online','voicePause','interface','flatMap','transaction','findOrCreate','emit','ids','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push'];(function(_0x36a6d7,_0x4e56e6){var _0x277b5e=function(_0xddfda4){while(--_0xddfda4){_0x36a6d7['push'](_0x36a6d7['shift']());}};_0x277b5e(++_0x4e56e6);}(_0x327c,0x1b8));var _0xc327=function(_0x17fb07,_0x2a5f45){_0x17fb07=_0x17fb07-0x0;var _0x2b3613=_0x327c[_0x17fb07];return _0x2b3613;};'use strict';var emlformat=require(_0xc327('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc327('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc327('0x2'));var moment=require(_0xc327('0x3'));var BPromise=require(_0xc327('0x4'));var Mustache=require(_0xc327('0x5'));var util=require(_0xc327('0x6'));var path=require(_0xc327('0x7'));var sox=require(_0xc327('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc327('0x9'));var _=require(_0xc327('0xa'));var squel=require(_0xc327('0xb'));var crypto=require(_0xc327('0xc'));var jsforce=require(_0xc327('0xd'));var deskjs=require(_0xc327('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc327('0xf'));var Papa=require(_0xc327('0x10'));var Redis=require('ioredis');var authService=require(_0xc327('0x11'));var qs=require(_0xc327('0x12'));var as=require(_0xc327('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc327('0x14'))(_0xc327('0x15'));var utils=require('../../config/utils');var config=require(_0xc327('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc327('0x17'))['db'];config[_0xc327('0x18')]=_[_0xc327('0x19')](config[_0xc327('0x18')],{'host':_0xc327('0x1a'),'port':0x18eb});var socket=require(_0xc327('0x1b'))(new Redis(config[_0xc327('0x18')]));require(_0xc327('0x1c'))[_0xc327('0x1d')](socket);function respondWithStatusCode(_0x4da981,_0x2794ae){_0x2794ae=_0x2794ae||0xcc;return function(_0x390fd0){if(_0x390fd0){return _0x4da981['sendStatus'](_0x2794ae);}return _0x4da981[_0xc327('0x1e')](_0x2794ae)[_0xc327('0x1f')]();};}function respondWithResult(_0x471ac2,_0x401344){_0x401344=_0x401344||0xc8;return function(_0x576eef){if(_0x576eef){return _0x471ac2[_0xc327('0x1e')](_0x401344)[_0xc327('0x20')](_0x576eef);}};}function respondWithFilteredResult(_0x3112d5,_0x1d4513){return function(_0x28b671){if(_0x28b671){var _0x513351=typeof _0x1d4513[_0xc327('0x21')]===_0xc327('0x22')&&typeof _0x1d4513[_0xc327('0x23')]===_0xc327('0x22');var _0x256db8=_0x28b671[_0xc327('0x24')];var _0x13116e=_0x513351?0x0:_0x1d4513[_0xc327('0x21')];var _0x53abdb=_0x513351?_0x28b671[_0xc327('0x24')]:_0x1d4513[_0xc327('0x21')]+_0x1d4513['limit'];var _0x3da6d8;if(_0x53abdb>=_0x256db8){_0x53abdb=_0x256db8;_0x3da6d8=0xc8;}else{_0x3da6d8=0xce;}_0x3112d5[_0xc327('0x1e')](_0x3da6d8);return _0x3112d5['set'](_0xc327('0x25'),_0x13116e+'-'+_0x53abdb+'/'+_0x256db8)['json'](_0x28b671);}return null;};}function patchUpdates(_0x47f2f2){return function(_0x4d3936){try{jsonpatch[_0xc327('0x26')](_0x4d3936,_0x47f2f2,!![]);}catch(_0x121f2e){return BPromise[_0xc327('0x27')](_0x121f2e);}return _0x4d3936[_0xc327('0x28')]();};}function saveUpdates(_0x452c01,_0x2ad5bf){return function(_0x45b0ca){if(_0x45b0ca){return _0x45b0ca['update'](_0x452c01)[_0xc327('0x29')](function(_0xef90f6){return _0xef90f6;});}return null;};}function removeEntity(_0x109add,_0x576dc6){return function(_0x2da442){if(_0x2da442){return _0x2da442['destroy']()[_0xc327('0x29')](function(){var _0x37ca8e=_0x2da442[_0xc327('0x2a')]({'plain':!![]});var _0x3f428d=_0xc327('0x2b');return db[_0xc327('0x2c')][_0xc327('0x2d')]({'where':{'type':_0x3f428d,'resourceId':_0x37ca8e['id']}})[_0xc327('0x29')](function(){return _0x2da442;});})['then'](function(){_0x109add['status'](0xcc)[_0xc327('0x1f')]();});}};}function handleEntityNotFound(_0x442ce4,_0x2b7d8c){return function(_0x202106){if(!_0x202106){_0x442ce4[_0xc327('0x2e')](0x194);}return _0x202106;};}function handleError(_0x171e4d,_0x3dbc19){_0x3dbc19=_0x3dbc19||0x1f4;return function(_0x2b2e75){logger[_0xc327('0x2f')](_0x2b2e75[_0xc327('0x30')]);if(_0x2b2e75[_0xc327('0x31')]){delete _0x2b2e75[_0xc327('0x31')];}_0x171e4d['status'](_0x3dbc19)[_0xc327('0x32')](_0x2b2e75);};}exports['index']=function(_0x48be43,_0x2f40c8){var _0x23903d={},_0x139349={},_0x4eda1d={'count':0x0,'rows':[]};var _0x37be69=_[_0xc327('0x33')](db[_0xc327('0x34')][_0xc327('0x35')],function(_0x175acc){return{'name':_0x175acc[_0xc327('0x36')],'type':_0x175acc[_0xc327('0x37')][_0xc327('0x38')]};});_0x139349[_0xc327('0x39')]=_[_0xc327('0x33')](_0x37be69,'name');_0x139349[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x48be43[_0xc327('0x3a')]);_0x139349[_0xc327('0x3c')]=_['intersection'](_0x139349['model'],_0x139349[_0xc327('0x3a')]);_0x23903d[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x139349['model'],qs[_0xc327('0x3f')](_0x48be43[_0xc327('0x3a')][_0xc327('0x3f')]));_0x23903d[_0xc327('0x3d')]=_0x23903d[_0xc327('0x3d')][_0xc327('0x40')]?_0x23903d['attributes']:_0x139349['model'];if(!_0x48be43[_0xc327('0x3a')][_0xc327('0x41')](_0xc327('0x42'))){_0x23903d[_0xc327('0x23')]=qs[_0xc327('0x23')](_0x48be43[_0xc327('0x3a')][_0xc327('0x23')]);_0x23903d[_0xc327('0x21')]=qs[_0xc327('0x21')](_0x48be43[_0xc327('0x3a')][_0xc327('0x21')]);}_0x23903d[_0xc327('0x43')]=qs['sort'](_0x48be43[_0xc327('0x3a')][_0xc327('0x44')]);_0x23903d[_0xc327('0x45')]=qs[_0xc327('0x3c')](_[_0xc327('0x46')](_0x48be43[_0xc327('0x3a')],_0x139349[_0xc327('0x3c')]),_0x37be69);if(_0x48be43[_0xc327('0x3a')][_0xc327('0x47')]){_0x23903d['where']=_[_0xc327('0x48')](_0x23903d[_0xc327('0x45')],{'$or':_[_0xc327('0x33')](_0x37be69,function(_0x591d0f){if(_0x591d0f[_0xc327('0x37')]!==_0xc327('0x49')){var _0x4f0166={};_0x4f0166[_0x591d0f[_0xc327('0x31')]]={'$like':'%'+_0x48be43[_0xc327('0x3a')][_0xc327('0x47')]+'%'};return _0x4f0166;}})});}_0x23903d=_[_0xc327('0x48')]({},_0x23903d,_0x48be43[_0xc327('0x4a')]);var _0x2dc5f5={'where':_0x23903d[_0xc327('0x45')]};return db[_0xc327('0x34')][_0xc327('0x24')](_0x2dc5f5)[_0xc327('0x29')](function(_0x3b0751){_0x4eda1d[_0xc327('0x24')]=_0x3b0751;if(_0x48be43['query'][_0xc327('0x4b')]){_0x23903d[_0xc327('0x4c')]=[{'all':!![]}];}return db['FaxQueue'][_0xc327('0x4d')](_0x23903d);})['then'](function(_0x11cbfb){_0x4eda1d[_0xc327('0x4e')]=_0x11cbfb;return _0x4eda1d;})[_0xc327('0x29')](respondWithFilteredResult(_0x2f40c8,_0x23903d))[_0xc327('0x4f')](handleError(_0x2f40c8,null));};exports['show']=function(_0x9b5f63,_0x2a8457){var _0x38a596={'raw':!![],'where':{'id':_0x9b5f63['params']['id']}},_0x15a5e3={};_0x15a5e3[_0xc327('0x39')]=_[_0xc327('0x3b')](db[_0xc327('0x34')][_0xc327('0x35')]);_0x15a5e3[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x9b5f63['query']);_0x15a5e3['filters']=_[_0xc327('0x3e')](_0x15a5e3[_0xc327('0x39')],_0x15a5e3[_0xc327('0x3a')]);_0x38a596[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x15a5e3['model'],qs[_0xc327('0x3f')](_0x9b5f63[_0xc327('0x3a')][_0xc327('0x3f')]));_0x38a596[_0xc327('0x3d')]=_0x38a596['attributes'][_0xc327('0x40')]?_0x38a596[_0xc327('0x3d')]:_0x15a5e3[_0xc327('0x39')];if(_0x9b5f63['query']['includeAll']){_0x38a596['include']=[{'all':!![]}];}_0x38a596=_['merge']({},_0x38a596,_0x9b5f63[_0xc327('0x4a')]);return db[_0xc327('0x34')][_0xc327('0x50')](_0x38a596)[_0xc327('0x29')](handleEntityNotFound(_0x2a8457,null))['then'](respondWithResult(_0x2a8457,null))[_0xc327('0x4f')](handleError(_0x2a8457,null));};exports[_0xc327('0x51')]=function(_0x1acb5e,_0x32e81b){return db[_0xc327('0x34')][_0xc327('0x51')](_0x1acb5e[_0xc327('0x52')],{})[_0xc327('0x29')](function(_0xfe0392){var _0x53af60=_0x1acb5e[_0xc327('0x53')][_0xc327('0x2a')]({'plain':!![]});if(!_0x53af60)throw new Error(_0xc327('0x54'));if(_0x53af60[_0xc327('0x55')]===_0xc327('0x53')){var _0x2e9da0=_0xfe0392[_0xc327('0x2a')]({'plain':!![]});var _0xaa539b='FaxQueues';return db['UserProfileSection'][_0xc327('0x50')]({'where':{'name':_0xaa539b,'userProfileId':_0x53af60[_0xc327('0x56')]},'raw':!![]})[_0xc327('0x29')](function(_0x431fcf){if(_0x431fcf&&_0x431fcf[_0xc327('0x57')]===0x0){return db[_0xc327('0x2c')][_0xc327('0x51')]({'name':_0x2e9da0[_0xc327('0x31')],'resourceId':_0x2e9da0['id'],'type':_0x431fcf[_0xc327('0x31')],'sectionId':_0x431fcf['id']},{})[_0xc327('0x29')](function(){return _0xfe0392;});}else{return _0xfe0392;}})[_0xc327('0x4f')](function(_0x208920){logger[_0xc327('0x2f')](_0xc327('0x58'),_0x208920);throw _0x208920;});}return _0xfe0392;})[_0xc327('0x29')](respondWithResult(_0x32e81b,0xc9))[_0xc327('0x4f')](handleError(_0x32e81b,null));};exports[_0xc327('0x59')]=function(_0x1343ef,_0x36eed0){if(_0x1343ef['body']['id']){delete _0x1343ef[_0xc327('0x52')]['id'];}return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x1343ef[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x36eed0,null))[_0xc327('0x29')](saveUpdates(_0x1343ef[_0xc327('0x52')],null))[_0xc327('0x29')](respondWithResult(_0x36eed0,null))[_0xc327('0x4f')](handleError(_0x36eed0,null));};exports[_0xc327('0x2d')]=function(_0x14619d,_0x50ff26){return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x14619d[_0xc327('0x5a')]['id']}})['then'](handleEntityNotFound(_0x50ff26,null))['then'](removeEntity(_0x50ff26,null))[_0xc327('0x4f')](handleError(_0x50ff26,null));};exports['describe']=function(_0x550ce3,_0x2a6e9b){return db['FaxQueue']['describe']()[_0xc327('0x29')](respondWithResult(_0x2a6e9b,null))['catch'](handleError(_0x2a6e9b,null));};exports[_0xc327('0x5b')]=function(_0xcfb445,_0x16f872,_0x394a61){var _0x5d0769={'raw':!![],'where':{}},_0x43c30d={},_0x37c799;return db['FaxQueue'][_0xc327('0x5c')]({'where':{'id':_0xcfb445[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x16f872,null))[_0xc327('0x29')](function(_0x24e9e3){if(_0x24e9e3){_0x37c799=_0x24e9e3[_0xc327('0x2a')]({'plain':!![]});_0x43c30d['model']=_[_0xc327('0x3b')](db[_0xc327('0x5d')][_0xc327('0x35')]);_0x43c30d['query']=_[_0xc327('0x3b')](_0xcfb445['query']);_0x43c30d[_0xc327('0x3c')]=_['intersection'](_0x43c30d['model'],_0x43c30d['query']);_0x5d0769['attributes']=_['intersection'](_0x43c30d['model'],qs[_0xc327('0x3f')](_0xcfb445[_0xc327('0x3a')]['fields']));_0x5d0769[_0xc327('0x3d')]=_0x5d0769[_0xc327('0x3d')][_0xc327('0x40')]?_0x5d0769[_0xc327('0x3d')]:_0x43c30d[_0xc327('0x39')];if(!_0xcfb445['query'][_0xc327('0x41')](_0xc327('0x42'))){_0x5d0769[_0xc327('0x23')]=qs['limit'](_0xcfb445[_0xc327('0x3a')][_0xc327('0x23')]);_0x5d0769[_0xc327('0x21')]=qs['offset'](_0xcfb445['query']['offset']);}_0x5d0769[_0xc327('0x43')]=qs[_0xc327('0x44')](_0xcfb445[_0xc327('0x3a')][_0xc327('0x44')]);_0x5d0769[_0xc327('0x45')]=qs[_0xc327('0x3c')](_[_0xc327('0x46')](_0xcfb445[_0xc327('0x3a')],_0x43c30d[_0xc327('0x3c')]));_0x5d0769[_0xc327('0x45')][_0xc327('0x5e')]=_0x24e9e3['id'];if(_0xcfb445['query'][_0xc327('0x47')]){_0x5d0769[_0xc327('0x45')]=_[_0xc327('0x48')](_0x5d0769[_0xc327('0x45')],{'$or':_[_0xc327('0x33')](_0x5d0769[_0xc327('0x3d')],function(_0x398012){var _0x3a7303={};_0x3a7303[_0x398012]={'$like':'%'+_0xcfb445[_0xc327('0x3a')][_0xc327('0x47')]+'%'};return _0x3a7303;})});}_0x5d0769=_['merge']({},_0x5d0769,_0xcfb445[_0xc327('0x4a')]);return db['UserFaxQueue'][_0xc327('0x4d')](_0x5d0769);}})['then'](function(_0x5a5bba){if(_0x5a5bba){return db[_0xc327('0x5f')][_0xc327('0x60')]({'where':{'id':_['map'](_0x5a5bba,_0xc327('0x61')),'role':_0xc327('0x62')},'attributes':['id',_0xc327('0x31'),_0xc327('0x63'),'updatedAt',_0xc327('0x64')]});}})['then'](function(_0x52c582){if(_0x52c582){return{'count':_0x52c582['count'],'rows':_[_0xc327('0x33')](_0x52c582[_0xc327('0x4e')],function(_0x222d99){return{'membername':_0x222d99[_0xc327('0x31')],'UserId':_0x222d99['id'],'queue_name':_0x37c799[_0xc327('0x31')],'FaxQueueId':_0x37c799['id'],'interface':util[_0xc327('0x65')]('%s/%s',_0xc327('0x66'),_0x222d99[_0xc327('0x31')]),'penalty':0x0,'paused':_0x222d99[_0xc327('0x63')],'createdAt':_0x222d99[_0xc327('0x64')],'updatedAt':_0x222d99['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc327('0x29')](respondWithFilteredResult(_0x16f872,_0x5d0769))[_0xc327('0x4f')](handleError(_0x16f872,null));};exports[_0xc327('0x67')]=function(_0x14cf29,_0x1bba72,_0x5d4058){var _0x1b32e4={};var _0x4bf37a={};var _0xe33da4;var _0x4de125;return db['FaxQueue'][_0xc327('0x5c')]({'where':{'id':_0x14cf29[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x1bba72,null))[_0xc327('0x29')](function(_0x5ee166){if(_0x5ee166){_0xe33da4=_0x5ee166;_0x4bf37a[_0xc327('0x39')]=_[_0xc327('0x3b')](db[_0xc327('0x68')][_0xc327('0x35')]);_0x4bf37a[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x14cf29[_0xc327('0x3a')]);_0x4bf37a[_0xc327('0x3c')]=_['intersection'](_0x4bf37a[_0xc327('0x39')],_0x4bf37a[_0xc327('0x3a')]);_0x1b32e4[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x4bf37a['model'],qs[_0xc327('0x3f')](_0x14cf29[_0xc327('0x3a')][_0xc327('0x3f')]));_0x1b32e4[_0xc327('0x3d')]=_0x1b32e4[_0xc327('0x3d')][_0xc327('0x40')]?_0x1b32e4[_0xc327('0x3d')]:_0x4bf37a['model'];_0x1b32e4[_0xc327('0x43')]=qs['sort'](_0x14cf29['query'][_0xc327('0x44')]);_0x1b32e4[_0xc327('0x45')]=qs[_0xc327('0x3c')](_['pick'](_0x14cf29[_0xc327('0x3a')],_0x4bf37a[_0xc327('0x3c')]));if(_0x14cf29[_0xc327('0x3a')]['filter']){_0x1b32e4[_0xc327('0x45')]=_['merge'](_0x1b32e4[_0xc327('0x45')],{'$or':_['map'](_0x1b32e4[_0xc327('0x3d')],function(_0x4144aa){var _0x364d2b={};_0x364d2b[_0x4144aa]={'$like':'%'+_0x14cf29[_0xc327('0x3a')]['filter']+'%'};return _0x364d2b;})});}_0x1b32e4=_[_0xc327('0x48')]({},_0x1b32e4,_0x14cf29['options']);return _0xe33da4[_0xc327('0x67')](_0x1b32e4);}})[_0xc327('0x29')](function(_0xae17f8){if(_0xae17f8){_0x4de125=_0xae17f8[_0xc327('0x40')];if(!_0x14cf29[_0xc327('0x3a')][_0xc327('0x41')](_0xc327('0x42'))){_0x1b32e4[_0xc327('0x23')]=qs[_0xc327('0x23')](_0x14cf29[_0xc327('0x3a')][_0xc327('0x23')]);_0x1b32e4[_0xc327('0x21')]=qs['offset'](_0x14cf29[_0xc327('0x3a')]['offset']);}return _0xe33da4[_0xc327('0x67')](_0x1b32e4);}})[_0xc327('0x29')](function(_0x10a95a){if(_0x10a95a){return _0x10a95a?{'count':_0x4de125,'rows':_0x10a95a}:null;}})[_0xc327('0x29')](respondWithResult(_0x1bba72,null))['catch'](handleError(_0x1bba72,null));};exports[_0xc327('0x69')]=function(_0x5a6b4f,_0x1d287d,_0x5d9c88){var _0x3af4fd=_0x5a6b4f['body']['ids'];return db['Team'][_0xc327('0x4d')]({'where':{'id':_0x3af4fd},'attributes':['id'],'include':[{'model':db[_0xc327('0x5f')],'as':'Agents','attributes':['id',_0xc327('0x31'),_0xc327('0x6a'),_0xc327('0x6b'),_0xc327('0x6c')],'raw':!![]}]})['then'](function(_0x4a5e1d){if(_0x4a5e1d){var _0x4a937e=_[_0xc327('0x6d')](_0x4a5e1d,function(_0x7a27b4){var _0xc7e317=_0x7a27b4['get']({'plain':!![]});return _0xc7e317['Agents'];});return db['FaxQueue'][_0xc327('0x50')]({'where':{'id':_0x5a6b4f['params']['id']}})['then'](function(_0x556627){return db['sequelize'][_0xc327('0x6e')](function(_0x48f5f8){return _0x556627[_0xc327('0x69')](_0x3af4fd,{'transaction':_0x48f5f8})['then'](function(){return BPromise['each'](_0x4a937e,function(_0x2327de){return db[_0xc327('0x5d')][_0xc327('0x6f')]({'where':{'UserId':_0x2327de['id'],'FaxQueueId':_0x5a6b4f[_0xc327('0x5a')]['id']},'transaction':_0x48f5f8});});})[_0xc327('0x29')](function(){_0x4a937e['forEach'](function(_0x37a8e8){socket[_0xc327('0x70')]('userFaxQueue:save',{'UserId':_0x37a8e8['id'],'FaxQueueId':_0x556627['id']});});});});});}})[_0xc327('0x29')](respondWithStatusCode(_0x1d287d,null))[_0xc327('0x4f')](handleError(_0x1d287d,null));};exports['removeTeams']=function(_0x1e0859,_0x2f87d9,_0x59b21d){return db[_0xc327('0x68')]['findAll']({'where':{'id':_0x1e0859[_0xc327('0x3a')][_0xc327('0x71')]},'attributes':['id'],'include':[{'model':db[_0xc327('0x5f')],'as':_0xc327('0x72'),'attributes':['id'],'raw':!![]}]})[_0xc327('0x29')](handleEntityNotFound(_0x2f87d9,null))[_0xc327('0x29')](function(_0x52acb5){var _0xb85406=_[_0xc327('0x33')](_0x52acb5,'id');var _0x941d8a=[];var _0x41efb4=[];var _0x2ad3c3=squel[_0xc327('0x73')]();_0x2ad3c3[_0xc327('0x74')](_0xc327('0x75'))[_0xc327('0x76')](_0xc327('0x77'),'tq')[_0xc327('0x78')]('user_has_teams','ut',_0xc327('0x79'))[_0xc327('0x45')]('FaxQueueId\x20=\x20?',_0x1e0859['params']['id']);for(var _0x1fb724=0x0;_0x1fb724<_0x52acb5[_0xc327('0x40')];_0x1fb724+=0x1){let _0x274c1a=_0x52acb5[_0x1fb724];for(var _0x1dbc95=0x0;_0x1dbc95<_0x274c1a['Agents'][_0xc327('0x40')];_0x1dbc95+=0x1){let _0x511bfa=_0x274c1a[_0xc327('0x72')][_0x1dbc95];var _0x28a26b=_0x2ad3c3[_0xc327('0x7a')]();_0x28a26b[_0xc327('0x45')]('ut.UserId\x20=\x20?',_0x511bfa['id']);_0x41efb4[_0xc327('0x7b')](db[_0xc327('0x7c')][_0xc327('0x3a')](_0x28a26b[_0xc327('0x7d')](),{'type':db[_0xc327('0x7c')]['QueryTypes'][_0xc327('0x7e')]})['then'](function(_0x26a351){if(_0x26a351[_0xc327('0x40')]===0x1){return _0x511bfa['id'];}else{var _0x47f5a0=_[_0xc327('0x7f')](_[_0xc327('0x33')](_0x26a351,'TeamId'),function(_0x3d0eea){return _[_0xc327('0x80')](_0xb85406,_0x3d0eea);});if(_0x47f5a0){return _0x511bfa['id'];}}}));}}return BPromise[_0xc327('0x81')](_0x41efb4)[_0xc327('0x29')](function(_0x1c55f7){_0x941d8a=_(_0x941d8a)['union'](_0x1c55f7)[_0xc327('0x82')]()[_0xc327('0x83')]();return db[_0xc327('0x34')]['find']({'where':{'id':_0x1e0859[_0xc327('0x5a')]['id']}})['then'](function(_0x401793){return db[_0xc327('0x7c')][_0xc327('0x6e')](function(_0x407aea){return _0x401793[_0xc327('0x84')](_0x1e0859['query'][_0xc327('0x71')],{'transaction':_0x407aea})['then'](function(){if(!_[_0xc327('0x85')](_0x941d8a)){return _0x401793[_0xc327('0x86')](_0x941d8a,{'transaction':_0x407aea});}})[_0xc327('0x29')](function(){_0x941d8a[_0xc327('0x87')](function(_0x22ca90){socket[_0xc327('0x70')](_0xc327('0x88'),{'UserId':_0x22ca90,'FaxQueueId':_0x401793['id']});});});});});});})[_0xc327('0x29')](respondWithStatusCode(_0x2f87d9,null))[_0xc327('0x4f')](handleError(_0x2f87d9,null));};exports[_0xc327('0x89')]=function(_0x47c73c,_0x35c50f,_0x81b775){return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x47c73c[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x35c50f,null))[_0xc327('0x29')](function(_0x1f8493){if(_0x1f8493){return _0x1f8493[_0xc327('0x89')](_0x47c73c[_0xc327('0x52')][_0xc327('0x71')],_[_0xc327('0x8a')](_0x47c73c[_0xc327('0x52')],[_0xc327('0x71'),'id'])||{})[_0xc327('0x8b')](function(_0x4d0e2f){for(var _0x470de0=0x0;_0x470de0<_0x47c73c[_0xc327('0x52')][_0xc327('0x71')]['length'];_0x470de0+=0x1){socket[_0xc327('0x70')]('userFaxQueue:save',{'UserId':Number(_0x47c73c[_0xc327('0x52')]['ids'][_0x470de0]),'FaxQueueId':Number(_0x47c73c[_0xc327('0x5a')]['id'])});}return _0x4d0e2f;});}})[_0xc327('0x29')](respondWithResult(_0x35c50f,null))[_0xc327('0x4f')](handleError(_0x35c50f,null));};exports[_0xc327('0x86')]=function(_0x374623,_0x3ce130,_0x66fb92){return db[_0xc327('0x34')][_0xc327('0x50')]({'where':{'id':_0x374623[_0xc327('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ce130,null))['then'](function(_0x3943fb){if(_0x3943fb){return _0x3943fb[_0xc327('0x86')](_0x374623[_0xc327('0x3a')]['ids'])[_0xc327('0x29')](function(){if(_['isArray'](_0x374623[_0xc327('0x3a')][_0xc327('0x71')])){for(var _0x234996=0x0;_0x234996<_0x374623[_0xc327('0x3a')][_0xc327('0x71')][_0xc327('0x40')];_0x234996+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x374623[_0xc327('0x3a')][_0xc327('0x71')][_0x234996]),'FaxQueueId':Number(_0x374623['params']['id'])});}}else{socket['emit'](_0xc327('0x88'),{'UserId':Number(_0x374623[_0xc327('0x3a')]['ids']),'FaxQueueId':Number(_0x374623[_0xc327('0x5a')]['id'])});}});}})[_0xc327('0x29')](respondWithStatusCode(_0x3ce130,null))[_0xc327('0x4f')](handleError(_0x3ce130,null));};exports['getAgents']=function(_0x6512f1,_0x3f2768,_0x541314){var _0x40de0f={};var _0x161229={};var _0x1d1209;var _0x24ad6;return db[_0xc327('0x34')][_0xc327('0x5c')]({'where':{'id':_0x6512f1[_0xc327('0x5a')]['id']}})[_0xc327('0x29')](handleEntityNotFound(_0x3f2768,null))[_0xc327('0x29')](function(_0x178e55){if(_0x178e55){_0x1d1209=_0x178e55;_0x161229[_0xc327('0x39')]=_[_0xc327('0x3b')](db[_0xc327('0x5f')][_0xc327('0x35')]);_0x161229[_0xc327('0x3a')]=_[_0xc327('0x3b')](_0x6512f1[_0xc327('0x3a')]);_0x161229[_0xc327('0x3c')]=_['intersection'](_0x161229[_0xc327('0x39')],_0x161229[_0xc327('0x3a')]);_0x40de0f[_0xc327('0x3d')]=_[_0xc327('0x3e')](_0x161229[_0xc327('0x39')],qs['fields'](_0x6512f1[_0xc327('0x3a')][_0xc327('0x3f')]));_0x40de0f[_0xc327('0x3d')]=_0x40de0f['attributes'][_0xc327('0x40')]?_0x40de0f[_0xc327('0x3d')]:_0x161229[_0xc327('0x39')];_0x40de0f[_0xc327('0x43')]=qs['sort'](_0x6512f1[_0xc327('0x3a')]['sort']);_0x40de0f[_0xc327('0x45')]=qs[_0xc327('0x3c')](_[_0xc327('0x46')](_0x6512f1[_0xc327('0x3a')],_0x161229[_0xc327('0x3c')]));if(_0x6512f1[_0xc327('0x3a')][_0xc327('0x47')]){_0x40de0f[_0xc327('0x45')]=_[_0xc327('0x48')](_0x40de0f['where'],{'$or':_[_0xc327('0x33')](_0x40de0f['attributes'],function(_0x4ddc70){var _0x42b7fd={};_0x42b7fd[_0x4ddc70]={'$like':'%'+_0x6512f1[_0xc327('0x3a')]['filter']+'%'};return _0x42b7fd;})});}_0x40de0f=_[_0xc327('0x48')]({},_0x40de0f,_0x6512f1[_0xc327('0x4a')]);return _0x1d1209[_0xc327('0x8c')](_0x40de0f);}})[_0xc327('0x29')](function(_0x252ec3){if(_0x252ec3){_0x24ad6=_0x252ec3[_0xc327('0x40')];if(!_0x6512f1[_0xc327('0x3a')][_0xc327('0x41')](_0xc327('0x42'))){_0x40de0f['limit']=qs[_0xc327('0x23')](_0x6512f1[_0xc327('0x3a')][_0xc327('0x23')]);_0x40de0f[_0xc327('0x21')]=qs[_0xc327('0x21')](_0x6512f1[_0xc327('0x3a')][_0xc327('0x21')]);}return _0x1d1209[_0xc327('0x8c')](_0x40de0f);}})[_0xc327('0x29')](function(_0x197333){if(_0x197333){return _0x197333?{'count':_0x24ad6,'rows':_0x197333}:null;}})[_0xc327('0x29')](respondWithResult(_0x3f2768,null))[_0xc327('0x4f')](handleError(_0x3f2768,null));}; \ No newline at end of file +var _0x0723=['getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','FaxQueues','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','FaxQueueId','UserFaxQueue','User','UserId','agent','faxPause','createdAt','rows','format','%s/%s','SIP','updatedAt'];(function(_0x3f6be7,_0x57f5f){var _0x2b6a99=function(_0x1cad90){while(--_0x1cad90){_0x3f6be7['push'](_0x3f6be7['shift']());}};_0x2b6a99(++_0x57f5f);}(_0x0723,0x1e2));var _0x3072=function(_0x415317,_0x49eec6){_0x415317=_0x415317-0x0;var _0x218c36=_0x0723[_0x415317];return _0x218c36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3072('0x0'));var zipdir=require(_0x3072('0x1'));var jsonpatch=require(_0x3072('0x2'));var rp=require(_0x3072('0x3'));var moment=require(_0x3072('0x4'));var BPromise=require(_0x3072('0x5'));var Mustache=require('mustache');var util=require(_0x3072('0x6'));var path=require(_0x3072('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3072('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3072('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3072('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3072('0xb'));var querystring=require(_0x3072('0xc'));var Papa=require(_0x3072('0xd'));var Redis=require(_0x3072('0xe'));var authService=require(_0x3072('0xf'));var qs=require(_0x3072('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3072('0x11'));var logger=require('../../config/logger')(_0x3072('0x12'));var utils=require(_0x3072('0x13'));var config=require(_0x3072('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3072('0x15')]=_[_0x3072('0x16')](config['redis'],{'host':_0x3072('0x17'),'port':0x18eb});var socket=require(_0x3072('0x18'))(new Redis(config[_0x3072('0x15')]));require(_0x3072('0x19'))[_0x3072('0x1a')](socket);function respondWithStatusCode(_0x550b4e,_0x290818){_0x290818=_0x290818||0xcc;return function(_0x583d61){if(_0x583d61){return _0x550b4e[_0x3072('0x1b')](_0x290818);}return _0x550b4e[_0x3072('0x1c')](_0x290818)[_0x3072('0x1d')]();};}function respondWithResult(_0x3a038b,_0x5b29cc){_0x5b29cc=_0x5b29cc||0xc8;return function(_0x258d61){if(_0x258d61){return _0x3a038b[_0x3072('0x1c')](_0x5b29cc)[_0x3072('0x1e')](_0x258d61);}};}function respondWithFilteredResult(_0xcb8592,_0x1d7769){return function(_0x2f47a8){if(_0x2f47a8){var _0x2b0380=typeof _0x1d7769[_0x3072('0x1f')]===_0x3072('0x20')&&typeof _0x1d7769[_0x3072('0x21')]===_0x3072('0x20');var _0x457f49=_0x2f47a8['count'];var _0x13db0a=_0x2b0380?0x0:_0x1d7769['offset'];var _0x399d6b=_0x2b0380?_0x2f47a8[_0x3072('0x22')]:_0x1d7769['offset']+_0x1d7769[_0x3072('0x21')];var _0x47e562;if(_0x399d6b>=_0x457f49){_0x399d6b=_0x457f49;_0x47e562=0xc8;}else{_0x47e562=0xce;}_0xcb8592[_0x3072('0x1c')](_0x47e562);return _0xcb8592['set'](_0x3072('0x23'),_0x13db0a+'-'+_0x399d6b+'/'+_0x457f49)['json'](_0x2f47a8);}return null;};}function patchUpdates(_0x2178e2){return function(_0x2e433c){try{jsonpatch['apply'](_0x2e433c,_0x2178e2,!![]);}catch(_0x5e206c){return BPromise[_0x3072('0x24')](_0x5e206c);}return _0x2e433c[_0x3072('0x25')]();};}function saveUpdates(_0x53d7b3,_0xfdfd22){return function(_0x220d68){if(_0x220d68){return _0x220d68[_0x3072('0x26')](_0x53d7b3)[_0x3072('0x27')](function(_0x4f06fa){return _0x4f06fa;});}return null;};}function removeEntity(_0x4f0371,_0x410b97){return function(_0x1ecdab){if(_0x1ecdab){return _0x1ecdab[_0x3072('0x28')]()[_0x3072('0x27')](function(){var _0x462e06=_0x1ecdab[_0x3072('0x29')]({'plain':!![]});var _0x11c009=_0x3072('0x2a');return db['UserProfileResource'][_0x3072('0x28')]({'where':{'type':_0x11c009,'resourceId':_0x462e06['id']}})[_0x3072('0x27')](function(){return _0x1ecdab;});})[_0x3072('0x27')](function(){_0x4f0371[_0x3072('0x1c')](0xcc)[_0x3072('0x1d')]();});}};}function handleEntityNotFound(_0x31bad0,_0x694072){return function(_0x426507){if(!_0x426507){_0x31bad0[_0x3072('0x1b')](0x194);}return _0x426507;};}function handleError(_0x1af78c,_0x25533a){_0x25533a=_0x25533a||0x1f4;return function(_0x493cbb){logger['error'](_0x493cbb[_0x3072('0x2b')]);if(_0x493cbb[_0x3072('0x2c')]){delete _0x493cbb[_0x3072('0x2c')];}_0x1af78c[_0x3072('0x1c')](_0x25533a)[_0x3072('0x2d')](_0x493cbb);};}exports[_0x3072('0x2e')]=function(_0x48630b,_0x566f27){var _0x54cce4={},_0x3a8887={},_0x82bc48={'count':0x0,'rows':[]};var _0x43e5cd=_['map'](db[_0x3072('0x2f')][_0x3072('0x30')],function(_0x340ad2){return{'name':_0x340ad2[_0x3072('0x31')],'type':_0x340ad2[_0x3072('0x32')][_0x3072('0x33')]};});_0x3a8887[_0x3072('0x34')]=_[_0x3072('0x35')](_0x43e5cd,'name');_0x3a8887[_0x3072('0x36')]=_[_0x3072('0x37')](_0x48630b[_0x3072('0x36')]);_0x3a8887[_0x3072('0x38')]=_[_0x3072('0x39')](_0x3a8887[_0x3072('0x34')],_0x3a8887[_0x3072('0x36')]);_0x54cce4[_0x3072('0x3a')]=_['intersection'](_0x3a8887[_0x3072('0x34')],qs[_0x3072('0x3b')](_0x48630b[_0x3072('0x36')][_0x3072('0x3b')]));_0x54cce4[_0x3072('0x3a')]=_0x54cce4[_0x3072('0x3a')][_0x3072('0x3c')]?_0x54cce4[_0x3072('0x3a')]:_0x3a8887[_0x3072('0x34')];if(!_0x48630b[_0x3072('0x36')]['hasOwnProperty'](_0x3072('0x3d'))){_0x54cce4[_0x3072('0x21')]=qs[_0x3072('0x21')](_0x48630b['query']['limit']);_0x54cce4['offset']=qs[_0x3072('0x1f')](_0x48630b[_0x3072('0x36')]['offset']);}_0x54cce4['order']=qs[_0x3072('0x3e')](_0x48630b['query'][_0x3072('0x3e')]);_0x54cce4[_0x3072('0x3f')]=qs[_0x3072('0x38')](_[_0x3072('0x40')](_0x48630b[_0x3072('0x36')],_0x3a8887[_0x3072('0x38')]),_0x43e5cd);if(_0x48630b[_0x3072('0x36')]['filter']){_0x54cce4[_0x3072('0x3f')]=_[_0x3072('0x41')](_0x54cce4[_0x3072('0x3f')],{'$or':_['map'](_0x43e5cd,function(_0x54d37d){if(_0x54d37d[_0x3072('0x32')]!==_0x3072('0x42')){var _0x120221={};_0x120221[_0x54d37d[_0x3072('0x2c')]]={'$like':'%'+_0x48630b['query'][_0x3072('0x43')]+'%'};return _0x120221;}})});}_0x54cce4=_['merge']({},_0x54cce4,_0x48630b['options']);var _0x50343a={'where':_0x54cce4[_0x3072('0x3f')]};return db[_0x3072('0x2f')][_0x3072('0x22')](_0x50343a)['then'](function(_0x31460f){_0x82bc48[_0x3072('0x22')]=_0x31460f;if(_0x48630b[_0x3072('0x36')][_0x3072('0x44')]){_0x54cce4[_0x3072('0x45')]=[{'all':!![]}];}return db[_0x3072('0x2f')][_0x3072('0x46')](_0x54cce4);})[_0x3072('0x27')](function(_0x4de6cd){_0x82bc48['rows']=_0x4de6cd;return _0x82bc48;})[_0x3072('0x27')](respondWithFilteredResult(_0x566f27,_0x54cce4))[_0x3072('0x47')](handleError(_0x566f27,null));};exports[_0x3072('0x48')]=function(_0x258e74,_0x461ccf){var _0x4dacbe={'raw':!![],'where':{'id':_0x258e74['params']['id']}},_0x2264fb={};_0x2264fb[_0x3072('0x34')]=_[_0x3072('0x37')](db['FaxQueue'][_0x3072('0x30')]);_0x2264fb[_0x3072('0x36')]=_['keys'](_0x258e74[_0x3072('0x36')]);_0x2264fb[_0x3072('0x38')]=_[_0x3072('0x39')](_0x2264fb[_0x3072('0x34')],_0x2264fb[_0x3072('0x36')]);_0x4dacbe[_0x3072('0x3a')]=_['intersection'](_0x2264fb['model'],qs[_0x3072('0x3b')](_0x258e74[_0x3072('0x36')][_0x3072('0x3b')]));_0x4dacbe[_0x3072('0x3a')]=_0x4dacbe[_0x3072('0x3a')][_0x3072('0x3c')]?_0x4dacbe[_0x3072('0x3a')]:_0x2264fb[_0x3072('0x34')];if(_0x258e74[_0x3072('0x36')][_0x3072('0x44')]){_0x4dacbe[_0x3072('0x45')]=[{'all':!![]}];}_0x4dacbe=_[_0x3072('0x41')]({},_0x4dacbe,_0x258e74[_0x3072('0x49')]);return db[_0x3072('0x2f')][_0x3072('0x4a')](_0x4dacbe)['then'](handleEntityNotFound(_0x461ccf,null))[_0x3072('0x27')](respondWithResult(_0x461ccf,null))[_0x3072('0x47')](handleError(_0x461ccf,null));};exports[_0x3072('0x4b')]=function(_0xfe7a2d,_0x209e9f){return db[_0x3072('0x2f')][_0x3072('0x4b')](_0xfe7a2d[_0x3072('0x4c')],{})[_0x3072('0x27')](function(_0x8b68c7){var _0x3ae4e3=_0xfe7a2d[_0x3072('0x4d')]['get']({'plain':!![]});if(!_0x3ae4e3)throw new Error(_0x3072('0x4e'));if(_0x3ae4e3[_0x3072('0x4f')]===_0x3072('0x4d')){var _0x5dc9f8=_0x8b68c7[_0x3072('0x29')]({'plain':!![]});var _0x361f3a=_0x3072('0x2a');return db[_0x3072('0x50')]['find']({'where':{'name':_0x361f3a,'userProfileId':_0x3ae4e3[_0x3072('0x51')]},'raw':!![]})[_0x3072('0x27')](function(_0x53514f){if(_0x53514f&&_0x53514f[_0x3072('0x52')]===0x0){return db[_0x3072('0x53')][_0x3072('0x4b')]({'name':_0x5dc9f8[_0x3072('0x2c')],'resourceId':_0x5dc9f8['id'],'type':_0x53514f[_0x3072('0x2c')],'sectionId':_0x53514f['id']},{})[_0x3072('0x27')](function(){return _0x8b68c7;});}else{return _0x8b68c7;}})['catch'](function(_0x15d956){logger['error'](_0x3072('0x54'),_0x15d956);throw _0x15d956;});}return _0x8b68c7;})[_0x3072('0x27')](respondWithResult(_0x209e9f,0xc9))['catch'](handleError(_0x209e9f,null));};exports[_0x3072('0x26')]=function(_0x4c5605,_0x1cb79c){if(_0x4c5605[_0x3072('0x4c')]['id']){delete _0x4c5605['body']['id'];}return db[_0x3072('0x2f')][_0x3072('0x4a')]({'where':{'id':_0x4c5605[_0x3072('0x55')]['id']}})[_0x3072('0x27')](handleEntityNotFound(_0x1cb79c,null))[_0x3072('0x27')](saveUpdates(_0x4c5605[_0x3072('0x4c')],null))['then'](respondWithResult(_0x1cb79c,null))[_0x3072('0x47')](handleError(_0x1cb79c,null));};exports[_0x3072('0x28')]=function(_0x41f269,_0x64a23c){return db['FaxQueue'][_0x3072('0x4a')]({'where':{'id':_0x41f269[_0x3072('0x55')]['id']}})[_0x3072('0x27')](handleEntityNotFound(_0x64a23c,null))[_0x3072('0x27')](removeEntity(_0x64a23c,null))[_0x3072('0x47')](handleError(_0x64a23c,null));};exports[_0x3072('0x56')]=function(_0x3ad5d6,_0x5e6de2){return db[_0x3072('0x2f')][_0x3072('0x56')]()['then'](respondWithResult(_0x5e6de2,null))[_0x3072('0x47')](handleError(_0x5e6de2,null));};exports[_0x3072('0x57')]=function(_0x5e93e8,_0x2fed63,_0x1773e9){var _0x479fa2={'raw':!![],'where':{}},_0x1fb303={},_0x3c8f28;return db['FaxQueue'][_0x3072('0x58')]({'where':{'id':_0x5e93e8[_0x3072('0x55')]['id']}})['then'](handleEntityNotFound(_0x2fed63,null))[_0x3072('0x27')](function(_0x4a60e1){if(_0x4a60e1){_0x3c8f28=_0x4a60e1[_0x3072('0x29')]({'plain':!![]});_0x1fb303[_0x3072('0x34')]=_[_0x3072('0x37')](db['UserFaxQueue'][_0x3072('0x30')]);_0x1fb303[_0x3072('0x36')]=_[_0x3072('0x37')](_0x5e93e8['query']);_0x1fb303['filters']=_[_0x3072('0x39')](_0x1fb303[_0x3072('0x34')],_0x1fb303[_0x3072('0x36')]);_0x479fa2[_0x3072('0x3a')]=_[_0x3072('0x39')](_0x1fb303['model'],qs[_0x3072('0x3b')](_0x5e93e8[_0x3072('0x36')][_0x3072('0x3b')]));_0x479fa2['attributes']=_0x479fa2['attributes']['length']?_0x479fa2[_0x3072('0x3a')]:_0x1fb303[_0x3072('0x34')];if(!_0x5e93e8[_0x3072('0x36')][_0x3072('0x59')](_0x3072('0x3d'))){_0x479fa2['limit']=qs['limit'](_0x5e93e8[_0x3072('0x36')][_0x3072('0x21')]);_0x479fa2[_0x3072('0x1f')]=qs[_0x3072('0x1f')](_0x5e93e8[_0x3072('0x36')][_0x3072('0x1f')]);}_0x479fa2['order']=qs[_0x3072('0x3e')](_0x5e93e8[_0x3072('0x36')][_0x3072('0x3e')]);_0x479fa2[_0x3072('0x3f')]=qs[_0x3072('0x38')](_[_0x3072('0x40')](_0x5e93e8[_0x3072('0x36')],_0x1fb303[_0x3072('0x38')]));_0x479fa2[_0x3072('0x3f')][_0x3072('0x5a')]=_0x4a60e1['id'];if(_0x5e93e8[_0x3072('0x36')][_0x3072('0x43')]){_0x479fa2['where']=_[_0x3072('0x41')](_0x479fa2[_0x3072('0x3f')],{'$or':_['map'](_0x479fa2['attributes'],function(_0x2041f5){var _0x15ba5e={};_0x15ba5e[_0x2041f5]={'$like':'%'+_0x5e93e8[_0x3072('0x36')]['filter']+'%'};return _0x15ba5e;})});}_0x479fa2=_['merge']({},_0x479fa2,_0x5e93e8[_0x3072('0x49')]);return db[_0x3072('0x5b')][_0x3072('0x46')](_0x479fa2);}})[_0x3072('0x27')](function(_0xc28ac0){if(_0xc28ac0){return db[_0x3072('0x5c')]['findAndCountAll']({'where':{'id':_[_0x3072('0x35')](_0xc28ac0,_0x3072('0x5d')),'role':_0x3072('0x5e')},'attributes':['id','name',_0x3072('0x5f'),'updatedAt',_0x3072('0x60')]});}})[_0x3072('0x27')](function(_0x3b9517){if(_0x3b9517){return{'count':_0x3b9517[_0x3072('0x22')],'rows':_[_0x3072('0x35')](_0x3b9517[_0x3072('0x61')],function(_0x5a4cf5){return{'membername':_0x5a4cf5['name'],'UserId':_0x5a4cf5['id'],'queue_name':_0x3c8f28[_0x3072('0x2c')],'FaxQueueId':_0x3c8f28['id'],'interface':util[_0x3072('0x62')](_0x3072('0x63'),_0x3072('0x64'),_0x5a4cf5[_0x3072('0x2c')]),'penalty':0x0,'paused':_0x5a4cf5[_0x3072('0x5f')],'createdAt':_0x5a4cf5[_0x3072('0x60')],'updatedAt':_0x5a4cf5[_0x3072('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2fed63,_0x479fa2))[_0x3072('0x47')](handleError(_0x2fed63,null));};exports[_0x3072('0x66')]=function(_0x12d34,_0x42941b,_0x143d61){var _0x24f40b={};var _0x537d95={};var _0x251f7d;var _0x4feb64;return db[_0x3072('0x2f')][_0x3072('0x58')]({'where':{'id':_0x12d34[_0x3072('0x55')]['id']}})[_0x3072('0x27')](handleEntityNotFound(_0x42941b,null))[_0x3072('0x27')](function(_0x3a808e){if(_0x3a808e){_0x251f7d=_0x3a808e;_0x537d95[_0x3072('0x34')]=_['keys'](db[_0x3072('0x67')][_0x3072('0x30')]);_0x537d95['query']=_['keys'](_0x12d34[_0x3072('0x36')]);_0x537d95[_0x3072('0x38')]=_[_0x3072('0x39')](_0x537d95[_0x3072('0x34')],_0x537d95[_0x3072('0x36')]);_0x24f40b[_0x3072('0x3a')]=_['intersection'](_0x537d95[_0x3072('0x34')],qs['fields'](_0x12d34[_0x3072('0x36')]['fields']));_0x24f40b[_0x3072('0x3a')]=_0x24f40b[_0x3072('0x3a')][_0x3072('0x3c')]?_0x24f40b[_0x3072('0x3a')]:_0x537d95[_0x3072('0x34')];_0x24f40b[_0x3072('0x68')]=qs[_0x3072('0x3e')](_0x12d34['query'][_0x3072('0x3e')]);_0x24f40b['where']=qs[_0x3072('0x38')](_[_0x3072('0x40')](_0x12d34['query'],_0x537d95[_0x3072('0x38')]));if(_0x12d34[_0x3072('0x36')]['filter']){_0x24f40b[_0x3072('0x3f')]=_[_0x3072('0x41')](_0x24f40b['where'],{'$or':_['map'](_0x24f40b[_0x3072('0x3a')],function(_0x122151){var _0x540a53={};_0x540a53[_0x122151]={'$like':'%'+_0x12d34[_0x3072('0x36')]['filter']+'%'};return _0x540a53;})});}_0x24f40b=_[_0x3072('0x41')]({},_0x24f40b,_0x12d34[_0x3072('0x49')]);return _0x251f7d['getTeams'](_0x24f40b);}})[_0x3072('0x27')](function(_0x56ed97){if(_0x56ed97){_0x4feb64=_0x56ed97[_0x3072('0x3c')];if(!_0x12d34[_0x3072('0x36')]['hasOwnProperty'](_0x3072('0x3d'))){_0x24f40b[_0x3072('0x21')]=qs[_0x3072('0x21')](_0x12d34[_0x3072('0x36')][_0x3072('0x21')]);_0x24f40b[_0x3072('0x1f')]=qs[_0x3072('0x1f')](_0x12d34['query'][_0x3072('0x1f')]);}return _0x251f7d['getTeams'](_0x24f40b);}})[_0x3072('0x27')](function(_0x141019){if(_0x141019){return _0x141019?{'count':_0x4feb64,'rows':_0x141019}:null;}})[_0x3072('0x27')](respondWithResult(_0x42941b,null))[_0x3072('0x47')](handleError(_0x42941b,null));};exports[_0x3072('0x69')]=function(_0x4a9d87,_0x57465b,_0x3ffba2){var _0x3bc623=_0x4a9d87[_0x3072('0x4c')][_0x3072('0x6a')];return db[_0x3072('0x67')][_0x3072('0x46')]({'where':{'id':_0x3bc623},'attributes':['id'],'include':[{'model':db[_0x3072('0x5c')],'as':_0x3072('0x6b'),'attributes':['id',_0x3072('0x2c'),_0x3072('0x6c'),_0x3072('0x6d'),_0x3072('0x6e')],'raw':!![]}]})[_0x3072('0x27')](function(_0x402840){if(_0x402840){var _0xdb25e=_[_0x3072('0x6f')](_0x402840,function(_0x3cd282){var _0x138215=_0x3cd282['get']({'plain':!![]});return _0x138215['Agents'];});return db['FaxQueue'][_0x3072('0x4a')]({'where':{'id':_0x4a9d87[_0x3072('0x55')]['id']}})[_0x3072('0x27')](function(_0x22b379){return db[_0x3072('0x70')][_0x3072('0x71')](function(_0x32f58a){return _0x22b379['addTeams'](_0x3bc623,{'transaction':_0x32f58a})[_0x3072('0x27')](function(){return BPromise[_0x3072('0x72')](_0xdb25e,function(_0x57cc1b){return db[_0x3072('0x5b')][_0x3072('0x73')]({'where':{'UserId':_0x57cc1b['id'],'FaxQueueId':_0x4a9d87[_0x3072('0x55')]['id']},'transaction':_0x32f58a});});})[_0x3072('0x27')](function(){_0xdb25e['forEach'](function(_0x2ae46a){socket[_0x3072('0x74')](_0x3072('0x75'),{'UserId':_0x2ae46a['id'],'FaxQueueId':_0x22b379['id']});});});});});}})[_0x3072('0x27')](respondWithStatusCode(_0x57465b,null))[_0x3072('0x47')](handleError(_0x57465b,null));};exports[_0x3072('0x76')]=function(_0x362b10,_0x12fe6c,_0x3e86cd){return db['Team'][_0x3072('0x46')]({'where':{'id':_0x362b10[_0x3072('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3072('0x5c')],'as':_0x3072('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x3072('0x27')](handleEntityNotFound(_0x12fe6c,null))[_0x3072('0x27')](function(_0x365d3b){var _0x45cd65=_['map'](_0x365d3b,'id');var _0x48c603=[];var _0x5a2c66=[];var _0x4bd9e2=squel[_0x3072('0x77')]();_0x4bd9e2['field'](_0x3072('0x78'))[_0x3072('0x79')](_0x3072('0x7a'),'tq')[_0x3072('0x7b')](_0x3072('0x7c'),'ut',_0x3072('0x7d'))['where']('FaxQueueId\x20=\x20?',_0x362b10['params']['id']);for(var _0x130342=0x0;_0x130342<_0x365d3b[_0x3072('0x3c')];_0x130342+=0x1){let _0x261ca2=_0x365d3b[_0x130342];for(var _0x265edb=0x0;_0x265edb<_0x261ca2[_0x3072('0x6b')][_0x3072('0x3c')];_0x265edb+=0x1){let _0x3a3897=_0x261ca2[_0x3072('0x6b')][_0x265edb];var _0x33af90=_0x4bd9e2[_0x3072('0x7e')]();_0x33af90[_0x3072('0x3f')](_0x3072('0x7f'),_0x3a3897['id']);_0x5a2c66[_0x3072('0x80')](db[_0x3072('0x70')]['query'](_0x33af90[_0x3072('0x81')](),{'type':db['sequelize'][_0x3072('0x82')][_0x3072('0x83')]})[_0x3072('0x27')](function(_0x472f00){if(_0x472f00[_0x3072('0x3c')]===0x1){return _0x3a3897['id'];}else{var _0x43b7a0=_[_0x3072('0x84')](_[_0x3072('0x35')](_0x472f00,_0x3072('0x85')),function(_0x1d13cf){return _[_0x3072('0x86')](_0x45cd65,_0x1d13cf);});if(_0x43b7a0){return _0x3a3897['id'];}}}));}}return BPromise['all'](_0x5a2c66)[_0x3072('0x27')](function(_0xeeee54){_0x48c603=_(_0x48c603)[_0x3072('0x87')](_0xeeee54)[_0x3072('0x88')]()[_0x3072('0x89')]();return db[_0x3072('0x2f')][_0x3072('0x4a')]({'where':{'id':_0x362b10['params']['id']}})[_0x3072('0x27')](function(_0x462562){return db[_0x3072('0x70')][_0x3072('0x71')](function(_0x505908){return _0x462562[_0x3072('0x76')](_0x362b10[_0x3072('0x36')]['ids'],{'transaction':_0x505908})[_0x3072('0x27')](function(){if(!_[_0x3072('0x8a')](_0x48c603)){return _0x462562[_0x3072('0x8b')](_0x48c603,{'transaction':_0x505908});}})[_0x3072('0x27')](function(){_0x48c603[_0x3072('0x8c')](function(_0x282f06){socket['emit'](_0x3072('0x8d'),{'UserId':_0x282f06,'FaxQueueId':_0x462562['id']});});});});});});})['then'](respondWithStatusCode(_0x12fe6c,null))[_0x3072('0x47')](handleError(_0x12fe6c,null));};exports[_0x3072('0x8e')]=function(_0x413172,_0x5738ef,_0x48d2cd){return db[_0x3072('0x2f')][_0x3072('0x4a')]({'where':{'id':_0x413172['params']['id']}})[_0x3072('0x27')](handleEntityNotFound(_0x5738ef,null))[_0x3072('0x27')](function(_0x1f026b){if(_0x1f026b){return _0x1f026b['addAgents'](_0x413172[_0x3072('0x4c')][_0x3072('0x6a')],_[_0x3072('0x8f')](_0x413172[_0x3072('0x4c')],['ids','id'])||{})['spread'](function(_0x21da9b){for(var _0xa727cc=0x0;_0xa727cc<_0x413172['body'][_0x3072('0x6a')][_0x3072('0x3c')];_0xa727cc+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x413172[_0x3072('0x4c')]['ids'][_0xa727cc]),'FaxQueueId':Number(_0x413172[_0x3072('0x55')]['id'])});}return _0x21da9b;});}})[_0x3072('0x27')](respondWithResult(_0x5738ef,null))[_0x3072('0x47')](handleError(_0x5738ef,null));};exports['removeAgents']=function(_0x12eaf2,_0x41b7e,_0x4be6ef){return db[_0x3072('0x2f')][_0x3072('0x4a')]({'where':{'id':_0x12eaf2[_0x3072('0x55')]['id']}})[_0x3072('0x27')](handleEntityNotFound(_0x41b7e,null))[_0x3072('0x27')](function(_0x33065b){if(_0x33065b){return _0x33065b[_0x3072('0x8b')](_0x12eaf2[_0x3072('0x36')][_0x3072('0x6a')])[_0x3072('0x27')](function(){if(_[_0x3072('0x90')](_0x12eaf2[_0x3072('0x36')]['ids'])){for(var _0x1873b6=0x0;_0x1873b6<_0x12eaf2[_0x3072('0x36')][_0x3072('0x6a')][_0x3072('0x3c')];_0x1873b6+=0x1){socket[_0x3072('0x74')](_0x3072('0x8d'),{'UserId':Number(_0x12eaf2[_0x3072('0x36')][_0x3072('0x6a')][_0x1873b6]),'FaxQueueId':Number(_0x12eaf2[_0x3072('0x55')]['id'])});}}else{socket[_0x3072('0x74')](_0x3072('0x8d'),{'UserId':Number(_0x12eaf2['query'][_0x3072('0x6a')]),'FaxQueueId':Number(_0x12eaf2['params']['id'])});}});}})[_0x3072('0x27')](respondWithStatusCode(_0x41b7e,null))[_0x3072('0x47')](handleError(_0x41b7e,null));};exports[_0x3072('0x91')]=function(_0x49b588,_0x157382,_0x534c87){var _0x40e1ba={};var _0x251031={};var _0x2b0b23;var _0x3197cc;return db['FaxQueue'][_0x3072('0x58')]({'where':{'id':_0x49b588[_0x3072('0x55')]['id']}})['then'](handleEntityNotFound(_0x157382,null))[_0x3072('0x27')](function(_0x49a364){if(_0x49a364){_0x2b0b23=_0x49a364;_0x251031[_0x3072('0x34')]=_['keys'](db[_0x3072('0x5c')][_0x3072('0x30')]);_0x251031[_0x3072('0x36')]=_[_0x3072('0x37')](_0x49b588['query']);_0x251031[_0x3072('0x38')]=_['intersection'](_0x251031[_0x3072('0x34')],_0x251031[_0x3072('0x36')]);_0x40e1ba[_0x3072('0x3a')]=_[_0x3072('0x39')](_0x251031[_0x3072('0x34')],qs[_0x3072('0x3b')](_0x49b588[_0x3072('0x36')]['fields']));_0x40e1ba[_0x3072('0x3a')]=_0x40e1ba[_0x3072('0x3a')][_0x3072('0x3c')]?_0x40e1ba[_0x3072('0x3a')]:_0x251031['model'];_0x40e1ba[_0x3072('0x68')]=qs[_0x3072('0x3e')](_0x49b588['query'][_0x3072('0x3e')]);_0x40e1ba['where']=qs['filters'](_[_0x3072('0x40')](_0x49b588['query'],_0x251031[_0x3072('0x38')]));if(_0x49b588[_0x3072('0x36')][_0x3072('0x43')]){_0x40e1ba[_0x3072('0x3f')]=_['merge'](_0x40e1ba[_0x3072('0x3f')],{'$or':_['map'](_0x40e1ba[_0x3072('0x3a')],function(_0x11c5bb){var _0x2fe8a1={};_0x2fe8a1[_0x11c5bb]={'$like':'%'+_0x49b588[_0x3072('0x36')][_0x3072('0x43')]+'%'};return _0x2fe8a1;})});}_0x40e1ba=_[_0x3072('0x41')]({},_0x40e1ba,_0x49b588[_0x3072('0x49')]);return _0x2b0b23['getAgents'](_0x40e1ba);}})[_0x3072('0x27')](function(_0x2958bf){if(_0x2958bf){_0x3197cc=_0x2958bf[_0x3072('0x3c')];if(!_0x49b588[_0x3072('0x36')][_0x3072('0x59')](_0x3072('0x3d'))){_0x40e1ba[_0x3072('0x21')]=qs[_0x3072('0x21')](_0x49b588[_0x3072('0x36')][_0x3072('0x21')]);_0x40e1ba[_0x3072('0x1f')]=qs[_0x3072('0x1f')](_0x49b588['query'][_0x3072('0x1f')]);}return _0x2b0b23[_0x3072('0x91')](_0x40e1ba);}})[_0x3072('0x27')](function(_0x161d91){if(_0x161d91){return _0x161d91?{'count':_0x3197cc,'rows':_0x161d91}:null;}})['then'](respondWithResult(_0x157382,null))[_0x3072('0x47')](handleError(_0x157382,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 601eea6..440b431 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 _0x6e34=['hasOwnProperty','exports','events','FaxQueue','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e34,0x1e2));var _0x46e3=function(_0x2bb33a,_0x3947d6){_0x2bb33a=_0x2bb33a-0x0;var _0x53aaee=_0x6e34[_0x2bb33a];return _0x53aaee;};'use strict';var EventEmitter=require(_0x46e3('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x46e3('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x46e3('0x2')](0x0);var events={'afterCreate':_0x46e3('0x3'),'afterUpdate':_0x46e3('0x4'),'afterDestroy':_0x46e3('0x5')};function emitEvent(_0x7761d){return function(_0x4d744a,_0x217c88,_0x47b397){FaxQueueEvents['emit'](_0x7761d+':'+_0x4d744a['id'],_0x4d744a);FaxQueueEvents['emit'](_0x7761d,_0x4d744a);_0x47b397(null);};}for(var e in events){if(events[_0x46e3('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x46e3('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x86ae=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','FaxQueue'];(function(_0x461d50,_0x2adb3c){var _0x47547a=function(_0x5b4d58){while(--_0x5b4d58){_0x461d50['push'](_0x461d50['shift']());}};_0x47547a(++_0x2adb3c);}(_0x86ae,0xe7));var _0xe86a=function(_0x50d9d5,_0x363c39){_0x50d9d5=_0x50d9d5-0x0;var _0xc578db=_0x86ae[_0x50d9d5];return _0xc578db;};'use strict';var EventEmitter=require(_0xe86a('0x0'));var FaxQueue=require(_0xe86a('0x1'))['db'][_0xe86a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe86a('0x3')](0x0);var events={'afterCreate':_0xe86a('0x4'),'afterUpdate':_0xe86a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c43cf){return function(_0x3cad83,_0x43ba80,_0x346694){FaxQueueEvents[_0xe86a('0x6')](_0x4c43cf+':'+_0x3cad83['id'],_0x3cad83);FaxQueueEvents[_0xe86a('0x6')](_0x4c43cf,_0x3cad83);_0x346694(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xe86a('0x7')](e,emitEvent(event));}}module[_0xe86a('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index c9ee6f9..77610bd 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 _0xcfd2=['util','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x1f613c,_0x249921){var _0x466955=function(_0x307b7e){while(--_0x307b7e){_0x1f613c['push'](_0x1f613c['shift']());}};_0x466955(++_0x249921);}(_0xcfd2,0xf0));var _0x2cfd=function(_0x4f9023,_0x49df18){_0x4f9023=_0x4f9023-0x0;var _0x2f8b6d=_0xcfd2[_0x4f9023];return _0x2f8b6d;};'use strict';var _=require('lodash');var util=require(_0x2cfd('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2cfd('0x1'));var rp=require(_0x2cfd('0x2'));var fs=require('fs');var path=require(_0x2cfd('0x3'));var rimraf=require(_0x2cfd('0x4'));var config=require('../../config/environment');var attributes=require(_0x2cfd('0x5'));module[_0x2cfd('0x6')]=function(_0x500297,_0x3336aa){return _0x500297[_0x2cfd('0x7')](_0x2cfd('0x8'),attributes,{'tableName':_0x2cfd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18f3=['bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','lodash','util','../../config/logger','api','moment'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x18f3,0x1f3));var _0x318f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x18f3[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x318f('0x0'));var util=require(_0x318f('0x1'));var logger=require(_0x318f('0x2'))(_0x318f('0x3'));var moment=require(_0x318f('0x4'));var BPromise=require(_0x318f('0x5'));var rp=require(_0x318f('0x6'));var fs=require('fs');var path=require(_0x318f('0x7'));var rimraf=require(_0x318f('0x8'));var config=require(_0x318f('0x9'));var attributes=require(_0x318f('0xa'));module['exports']=function(_0xbeef59,_0x17b767){return _0xbeef59[_0x318f('0xb')]('FaxQueue',attributes,{'tableName':'fax_queues','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 5f497fc..4f1278c 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 _0xe507=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x490dbd,_0x34b90f){var _0x521b5b=function(_0x5400f3){while(--_0x5400f3){_0x490dbd['push'](_0x490dbd['shift']());}};_0x521b5b(++_0x34b90f);}(_0xe507,0x1bd));var _0x7e50=function(_0x3c424f,_0x1c61c2){_0x3c424f=_0x3c424f-0x0;var _0x3fee82=_0xe507[_0x3c424f];return _0x3fee82;};'use strict';var _=require(_0x7e50('0x0'));var util=require(_0x7e50('0x1'));var moment=require(_0x7e50('0x2'));var BPromise=require(_0x7e50('0x3'));var rs=require(_0x7e50('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e50('0x5'))['db'];var utils=require(_0x7e50('0x6'));var logger=require(_0x7e50('0x7'))(_0x7e50('0x8'));var config=require(_0x7e50('0x9'));var jayson=require(_0x7e50('0xa'));var client=jayson['client'][_0x7e50('0xb')]({'port':0x232a});config[_0x7e50('0xc')]=_[_0x7e50('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e50('0xe'))(new Redis(config[_0x7e50('0xc')]));require(_0x7e50('0xf'))[_0x7e50('0x10')](socket);function respondWithRpcPromise(_0x5aea8c,_0x24cbbe,_0x57d5e2){return new BPromise(function(_0x5af5e4,_0x406a6d){return client[_0x7e50('0x11')](_0x5aea8c,_0x57d5e2)[_0x7e50('0x12')](function(_0x2527fb){logger[_0x7e50('0x13')](_0x7e50('0x14'),_0x24cbbe,_0x7e50('0x15'));logger[_0x7e50('0x16')](_0x7e50('0x17'),_0x24cbbe,_0x7e50('0x15'),JSON['stringify'](_0x2527fb));if(_0x2527fb[_0x7e50('0x18')]){if(_0x2527fb[_0x7e50('0x18')][_0x7e50('0x19')]===0x1f4){logger[_0x7e50('0x18')](_0x7e50('0x14'),_0x24cbbe,_0x2527fb[_0x7e50('0x18')]['message']);return _0x406a6d(_0x2527fb[_0x7e50('0x18')][_0x7e50('0x1a')]);}logger[_0x7e50('0x18')](_0x7e50('0x14'),_0x24cbbe,_0x2527fb[_0x7e50('0x18')][_0x7e50('0x1a')]);return _0x5af5e4(_0x2527fb[_0x7e50('0x18')]['message']);}else{logger['info'](_0x7e50('0x14'),_0x24cbbe,'request\x20sent');_0x5af5e4(_0x2527fb['result'][_0x7e50('0x1a')]);}})[_0x7e50('0x1b')](function(_0x3750aa){logger[_0x7e50('0x18')](_0x7e50('0x14'),_0x24cbbe,_0x3750aa);_0x406a6d(_0x3750aa);});});}exports[_0x7e50('0x1c')]=function(_0x464c66){var _0x4d0cad=this;return new Promise(function(_0x5e1ead,_0x2176db){return db[_0x7e50('0x1d')]['findAll']({'raw':_0x464c66[_0x7e50('0x1e')]?_0x464c66['options'][_0x7e50('0x1f')]===undefined?!![]:![]:!![],'where':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x20')]||null:null,'attributes':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x21')]||null:null,'limit':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x22')]||null:null,'include':_0x464c66[_0x7e50('0x1e')]?_0x464c66[_0x7e50('0x1e')][_0x7e50('0x23')]?_[_0x7e50('0x24')](_0x464c66[_0x7e50('0x1e')][_0x7e50('0x23')],function(_0x18c74b){return{'model':db[_0x18c74b[_0x7e50('0x25')]],'as':_0x18c74b['as'],'attributes':_0x18c74b[_0x7e50('0x21')],'include':_0x18c74b['include']?_['map'](_0x18c74b[_0x7e50('0x23')],function(_0x4d5d79){return{'model':db[_0x4d5d79[_0x7e50('0x25')]],'as':_0x4d5d79['as'],'attributes':_0x4d5d79[_0x7e50('0x21')],'include':_0x4d5d79['include']?_[_0x7e50('0x24')](_0x4d5d79[_0x7e50('0x23')],function(_0x15534f){return{'model':db[_0x15534f[_0x7e50('0x25')]],'as':_0x15534f['as'],'attributes':_0x15534f[_0x7e50('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e50('0x12')](function(_0x4783ae){logger[_0x7e50('0x13')](_0x7e50('0x1c'),_0x464c66);logger[_0x7e50('0x16')](_0x7e50('0x1c'),_0x464c66,JSON[_0x7e50('0x26')](_0x4783ae));_0x5e1ead(_0x4783ae);})[_0x7e50('0x1b')](function(_0xceb6a7){logger[_0x7e50('0x18')](_0x7e50('0x1c'),_0xceb6a7[_0x7e50('0x1a')],_0x464c66);_0x2176db(_0x4d0cad[_0x7e50('0x18')](0x1f4,_0xceb6a7[_0x7e50('0x1a')]));});});};exports[_0x7e50('0x27')]=function(_0x3ff3c7){var _0x44923c=this;return new Promise(function(_0x5825ec,_0x145442){return db[_0x7e50('0x1d')][_0x7e50('0x28')]({'raw':_0x3ff3c7['options']?_0x3ff3c7[_0x7e50('0x1e')][_0x7e50('0x1f')]===undefined?!![]:![]:!![],'where':_0x3ff3c7[_0x7e50('0x1e')]?_0x3ff3c7[_0x7e50('0x1e')][_0x7e50('0x20')]||null:null,'attributes':_0x3ff3c7[_0x7e50('0x1e')]?_0x3ff3c7['options'][_0x7e50('0x21')]||null:null,'include':_0x3ff3c7[_0x7e50('0x1e')]?_0x3ff3c7['options']['include']?_[_0x7e50('0x24')](_0x3ff3c7['options'][_0x7e50('0x23')],function(_0x5b3d16){return{'model':db[_0x5b3d16['model']],'as':_0x5b3d16['as'],'attributes':_0x5b3d16['attributes'],'include':_0x5b3d16[_0x7e50('0x23')]?_[_0x7e50('0x24')](_0x5b3d16[_0x7e50('0x23')],function(_0x387ae1){return{'model':db[_0x387ae1[_0x7e50('0x25')]],'as':_0x387ae1['as'],'attributes':_0x387ae1[_0x7e50('0x21')],'include':_0x387ae1[_0x7e50('0x23')]?_[_0x7e50('0x24')](_0x387ae1[_0x7e50('0x23')],function(_0x5341d4){return{'model':db[_0x5341d4[_0x7e50('0x25')]],'as':_0x5341d4['as'],'attributes':_0x5341d4[_0x7e50('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e50('0x12')](function(_0x5f3471){logger[_0x7e50('0x13')](_0x7e50('0x27'),_0x3ff3c7);logger[_0x7e50('0x16')](_0x7e50('0x27'),_0x3ff3c7,JSON[_0x7e50('0x26')](_0x5f3471));_0x5825ec(_0x5f3471);})[_0x7e50('0x1b')](function(_0x4bb55d){logger['error'](_0x7e50('0x27'),_0x4bb55d[_0x7e50('0x1a')],_0x3ff3c7);_0x145442(_0x44923c[_0x7e50('0x18')](0x1f4,_0x4bb55d[_0x7e50('0x1a')]));});});}; \ No newline at end of file +var _0x3998=['where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw'];(function(_0x18cda0,_0x45cbe2){var _0x3dd4ef=function(_0x5df037){while(--_0x5df037){_0x18cda0['push'](_0x18cda0['shift']());}};_0x3dd4ef(++_0x45cbe2);}(_0x3998,0x110));var _0x8399=function(_0xf747fb,_0x10bcfb){_0xf747fb=_0xf747fb-0x0;var _0x1c9fad=_0x3998[_0xf747fb];return _0x1c9fad;};'use strict';var _=require(_0x8399('0x0'));var util=require(_0x8399('0x1'));var moment=require(_0x8399('0x2'));var BPromise=require(_0x8399('0x3'));var rs=require(_0x8399('0x4'));var fs=require('fs');var Redis=require(_0x8399('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8399('0x6'));var logger=require(_0x8399('0x7'))(_0x8399('0x8'));var config=require(_0x8399('0x9'));var jayson=require(_0x8399('0xa'));var client=jayson[_0x8399('0xb')][_0x8399('0xc')]({'port':0x232a});config['redis']=_[_0x8399('0xd')](config[_0x8399('0xe')],{'host':_0x8399('0xf'),'port':0x18eb});var socket=require(_0x8399('0x10'))(new Redis(config[_0x8399('0xe')]));require(_0x8399('0x11'))[_0x8399('0x12')](socket);function respondWithRpcPromise(_0x42a48d,_0x2278b1,_0x33c96f){return new BPromise(function(_0x4a4a49,_0x22bf82){return client['request'](_0x42a48d,_0x33c96f)[_0x8399('0x13')](function(_0x38cda5){logger['info'](_0x8399('0x14'),_0x2278b1,_0x8399('0x15'));logger[_0x8399('0x16')](_0x8399('0x17'),_0x2278b1,_0x8399('0x15'),JSON[_0x8399('0x18')](_0x38cda5));if(_0x38cda5[_0x8399('0x19')]){if(_0x38cda5['error'][_0x8399('0x1a')]===0x1f4){logger['error'](_0x8399('0x14'),_0x2278b1,_0x38cda5[_0x8399('0x19')][_0x8399('0x1b')]);return _0x22bf82(_0x38cda5[_0x8399('0x19')][_0x8399('0x1b')]);}logger[_0x8399('0x19')]('FaxQueue,\x20%s,\x20%s',_0x2278b1,_0x38cda5[_0x8399('0x19')]['message']);return _0x4a4a49(_0x38cda5[_0x8399('0x19')]['message']);}else{logger[_0x8399('0x1c')]('FaxQueue,\x20%s,\x20%s',_0x2278b1,'request\x20sent');_0x4a4a49(_0x38cda5[_0x8399('0x1d')][_0x8399('0x1b')]);}})[_0x8399('0x1e')](function(_0x479c65){logger[_0x8399('0x19')](_0x8399('0x14'),_0x2278b1,_0x479c65);_0x22bf82(_0x479c65);});});}exports[_0x8399('0x1f')]=function(_0x2f2dc2){var _0x41f508=this;return new Promise(function(_0x348160,_0x230dee){return db[_0x8399('0x20')][_0x8399('0x21')]({'raw':_0x2f2dc2[_0x8399('0x22')]?_0x2f2dc2[_0x8399('0x22')][_0x8399('0x23')]===undefined?!![]:![]:!![],'where':_0x2f2dc2[_0x8399('0x22')]?_0x2f2dc2[_0x8399('0x22')][_0x8399('0x24')]||null:null,'attributes':_0x2f2dc2[_0x8399('0x22')]?_0x2f2dc2['options'][_0x8399('0x25')]||null:null,'limit':_0x2f2dc2[_0x8399('0x22')]?_0x2f2dc2[_0x8399('0x22')][_0x8399('0x26')]||null:null,'include':_0x2f2dc2['options']?_0x2f2dc2[_0x8399('0x22')][_0x8399('0x27')]?_[_0x8399('0x28')](_0x2f2dc2[_0x8399('0x22')][_0x8399('0x27')],function(_0x451a7d){return{'model':db[_0x451a7d[_0x8399('0x29')]],'as':_0x451a7d['as'],'attributes':_0x451a7d[_0x8399('0x25')],'include':_0x451a7d['include']?_[_0x8399('0x28')](_0x451a7d[_0x8399('0x27')],function(_0x520f59){return{'model':db[_0x520f59[_0x8399('0x29')]],'as':_0x520f59['as'],'attributes':_0x520f59[_0x8399('0x25')],'include':_0x520f59[_0x8399('0x27')]?_[_0x8399('0x28')](_0x520f59['include'],function(_0x4c2c5c){return{'model':db[_0x4c2c5c[_0x8399('0x29')]],'as':_0x4c2c5c['as'],'attributes':_0x4c2c5c[_0x8399('0x25')]};}):[]};}):[]};}):[]:[]})[_0x8399('0x13')](function(_0x50ee03){logger['info'](_0x8399('0x1f'),_0x2f2dc2);logger[_0x8399('0x16')](_0x8399('0x1f'),_0x2f2dc2,JSON['stringify'](_0x50ee03));_0x348160(_0x50ee03);})['catch'](function(_0x34c6b9){logger[_0x8399('0x19')](_0x8399('0x1f'),_0x34c6b9[_0x8399('0x1b')],_0x2f2dc2);_0x230dee(_0x41f508[_0x8399('0x19')](0x1f4,_0x34c6b9['message']));});});};exports[_0x8399('0x2a')]=function(_0x18693c){var _0x2b7f3a=this;return new Promise(function(_0x39369c,_0x8df7bb){return db[_0x8399('0x20')][_0x8399('0x2b')]({'raw':_0x18693c[_0x8399('0x22')]?_0x18693c[_0x8399('0x22')][_0x8399('0x23')]===undefined?!![]:![]:!![],'where':_0x18693c[_0x8399('0x22')]?_0x18693c[_0x8399('0x22')][_0x8399('0x24')]||null:null,'attributes':_0x18693c['options']?_0x18693c[_0x8399('0x22')][_0x8399('0x25')]||null:null,'include':_0x18693c[_0x8399('0x22')]?_0x18693c[_0x8399('0x22')][_0x8399('0x27')]?_['map'](_0x18693c['options'][_0x8399('0x27')],function(_0x55d020){return{'model':db[_0x55d020[_0x8399('0x29')]],'as':_0x55d020['as'],'attributes':_0x55d020[_0x8399('0x25')],'include':_0x55d020[_0x8399('0x27')]?_[_0x8399('0x28')](_0x55d020[_0x8399('0x27')],function(_0x199f3e){return{'model':db[_0x199f3e[_0x8399('0x29')]],'as':_0x199f3e['as'],'attributes':_0x199f3e[_0x8399('0x25')],'include':_0x199f3e[_0x8399('0x27')]?_[_0x8399('0x28')](_0x199f3e['include'],function(_0x1ad3f1){return{'model':db[_0x1ad3f1[_0x8399('0x29')]],'as':_0x1ad3f1['as'],'attributes':_0x1ad3f1[_0x8399('0x25')]};}):[]};}):[]};}):[]:[]})[_0x8399('0x13')](function(_0x5d1bb3){logger[_0x8399('0x1c')](_0x8399('0x2a'),_0x18693c);logger[_0x8399('0x16')]('ShowFaxQueue',_0x18693c,JSON[_0x8399('0x18')](_0x5d1bb3));_0x39369c(_0x5d1bb3);})[_0x8399('0x1e')](function(_0x315c03){logger['error'](_0x8399('0x2a'),_0x315c03[_0x8399('0x1b')],_0x18693c);_0x8df7bb(_0x2b7f3a[_0x8399('0x19')](0x1f4,_0x315c03[_0x8399('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 337019b..9f6fbe0 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 _0x86ae=['update','removeListener','register','faxQueue:','save','remove'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x86ae,0xfa));var _0xe86a=function(_0x2457c0,_0x15fd6b){_0x2457c0=_0x2457c0-0x0;var _0x1354b2=_0x86ae[_0x2457c0];return _0x1354b2;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xe86a('0x0'),_0xe86a('0x1'),_0xe86a('0x2')];function createListener(_0x19ee7c,_0x2af036){return function(_0x463292){_0x2af036['emit'](_0x19ee7c,_0x463292);};}function removeListener(_0x5ea753,_0x20efe3){return function(){FaxQueueEvents[_0xe86a('0x3')](_0x5ea753,_0x20efe3);};}exports[_0xe86a('0x4')]=function(_0xe7da9f){for(var _0x5328ed=0x0,_0x39fe5a=events['length'];_0x5328ed<_0x39fe5a;_0x5328ed++){var _0x1003ba=events[_0x5328ed];var _0x4ef640=createListener(_0xe86a('0x5')+_0x1003ba,_0xe7da9f);FaxQueueEvents['on'](_0x1003ba,_0x4ef640);}}; \ No newline at end of file +var _0x2caf=['removeListener','register','length','faxQueue:','update','emit'];(function(_0x51ab33,_0x71a8a8){var _0x5e1298=function(_0x1bd8cf){while(--_0x1bd8cf){_0x51ab33['push'](_0x51ab33['shift']());}};_0x5e1298(++_0x71a8a8);}(_0x2caf,0x6a));var _0xf2ca=function(_0x4bbc9a,_0x5b46a6){_0x4bbc9a=_0x4bbc9a-0x0;var _0x473a78=_0x2caf[_0x4bbc9a];return _0x473a78;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save','remove',_0xf2ca('0x0')];function createListener(_0x53a64f,_0x3b2612){return function(_0x36e439){_0x3b2612[_0xf2ca('0x1')](_0x53a64f,_0x36e439);};}function removeListener(_0x375e8b,_0x137501){return function(){FaxQueueEvents[_0xf2ca('0x2')](_0x375e8b,_0x137501);};}exports[_0xf2ca('0x3')]=function(_0x51372a){for(var _0x8ce770=0x0,_0x4292b4=events[_0xf2ca('0x4')];_0x8ce770<_0x4292b4;_0x8ce770++){var _0x57e3e8=events[_0x8ce770];var _0x4ea38c=createListener(_0xf2ca('0x5')+_0x57e3e8,_0x51372a);FaxQueueEvents['on'](_0x57e3e8,_0x4ea38c);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index ac8d8e2..43d182d 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 _0xafc4=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','update','delete','destroy','removeTeams','removeAgents'];(function(_0xa3e07c,_0x479916){var _0x4f85e9=function(_0x2e2ac2){while(--_0x2e2ac2){_0xa3e07c['push'](_0xa3e07c['shift']());}};_0x4f85e9(++_0x479916);}(_0xafc4,0x69));var _0x4afc=function(_0x2bf2eb,_0x1aafeb){_0x2bf2eb=_0x2bf2eb-0x0;var _0x660889=_0xafc4[_0x2bf2eb];return _0x660889;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['describe']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0x6')](_0x4afc('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x4afc('0x6')]('/:id/teams',auth[_0x4afc('0x7')](),controller[_0x4afc('0xd')]);router['get'](_0x4afc('0xe'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xf')]);router[_0x4afc('0x10')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x11')]);router[_0x4afc('0x10')](_0x4afc('0x12'),auth['isAuthenticated'](),controller[_0x4afc('0x13')]);router[_0x4afc('0x10')](_0x4afc('0xe'),auth[_0x4afc('0x7')](),controller['addAgents']);router['put'](_0x4afc('0xa'),auth['isAuthenticated'](),controller[_0x4afc('0x14')]);router[_0x4afc('0x15')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0x16')]);router[_0x4afc('0x15')](_0x4afc('0x12'),auth[_0x4afc('0x7')](),controller[_0x4afc('0x17')]);router[_0x4afc('0x15')](_0x4afc('0xe'),auth['isAuthenticated'](),controller[_0x4afc('0x18')]);module[_0x4afc('0x19')]=router; \ No newline at end of file +var _0x4745=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3409e8,_0x12d33c){var _0x52857f=function(_0xe5168a){while(--_0xe5168a){_0x3409e8['push'](_0x3409e8['shift']());}};_0x52857f(++_0x12d33c);}(_0x4745,0x1e7));var _0x5474=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x4745[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var fs_extra=require(_0x5474('0x6'));var auth=require(_0x5474('0x7'));var interaction=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var controller=require(_0x5474('0xa'));router[_0x5474('0xb')]('/',auth['isAuthenticated'](),controller[_0x5474('0xc')]);router[_0x5474('0xb')]('/describe',auth[_0x5474('0xd')](),controller['describe']);router[_0x5474('0xb')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0xf')]);router[_0x5474('0xb')](_0x5474('0x10'),auth[_0x5474('0xd')](),controller[_0x5474('0x11')]);router[_0x5474('0xb')](_0x5474('0x12'),auth[_0x5474('0xd')](),controller['getTeams']);router[_0x5474('0xb')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller[_0x5474('0x14')]);router[_0x5474('0x15')]('/',auth[_0x5474('0xd')](),controller[_0x5474('0x16')]);router[_0x5474('0x15')](_0x5474('0x12'),auth['isAuthenticated'](),controller[_0x5474('0x17')]);router[_0x5474('0x15')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5474('0x18')]);router[_0x5474('0x19')](_0x5474('0xe'),auth['isAuthenticated'](),controller[_0x5474('0x1a')]);router[_0x5474('0x19')]('/:id/teams',auth[_0x5474('0xd')](),controller[_0x5474('0x1b')]);router[_0x5474('0x19')](_0x5474('0x13'),auth[_0x5474('0xd')](),controller['removeAgents']);module[_0x5474('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index e181ae4..9ebbb1b 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 _0xa393=['exports','STRING','DATE','moment'];(function(_0x19d7c6,_0x1b9530){var _0x475431=function(_0x32289d){while(--_0x32289d){_0x19d7c6['push'](_0x19d7c6['shift']());}};_0x475431(++_0x1b9530);}(_0xa393,0x1c3));var _0x3a39=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xa393[_0x11ce46];return _0x368a1e;};'use strict';var moment=require(_0x3a39('0x0'));var Sequelize=require('sequelize');module[_0x3a39('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3a39('0x2')]},'joinAt':{'type':Sequelize[_0x3a39('0x3')]},'leaveAt':{'type':Sequelize[_0x3a39('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3a39('0x3')]},'reason':{'type':Sequelize[_0x3a39('0x2')]}}; \ No newline at end of file +var _0xe2ef=['sequelize','exports','STRING','DATE'];(function(_0xc8a692,_0x579320){var _0x5055d8=function(_0x528459){while(--_0x528459){_0xc8a692['push'](_0xc8a692['shift']());}};_0x5055d8(++_0x579320);}(_0xe2ef,0x194));var _0xfe2e=function(_0x1d2ef8,_0x278b10){_0x1d2ef8=_0x1d2ef8-0x0;var _0x3608e3=_0xe2ef[_0x1d2ef8];return _0x3608e3;};'use strict';var moment=require('moment');var Sequelize=require(_0xfe2e('0x0'));module[_0xfe2e('0x1')]={'uniqueid':{'type':Sequelize[_0xfe2e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfe2e('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfe2e('0x3')]},'acceptAt':{'type':Sequelize[_0xfe2e('0x3')]},'exitAt':{'type':Sequelize[_0xfe2e('0x3')]},'reason':{'type':Sequelize[_0xfe2e('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index d50e0f9..0d0b873 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 _0x80c7=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','fields','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2cd1c9,_0xed80d0){var _0x4ed5df=function(_0xe0f038){while(--_0xe0f038){_0x2cd1c9['push'](_0x2cd1c9['shift']());}};_0x4ed5df(++_0xed80d0);}(_0x80c7,0x8d));var _0x780c=function(_0x11323e,_0x2772d0){_0x11323e=_0x11323e-0x0;var _0x521145=_0x80c7[_0x11323e];return _0x521145;};'use strict';var emlformat=require(_0x780c('0x0'));var rimraf=require(_0x780c('0x1'));var zipdir=require(_0x780c('0x2'));var jsonpatch=require(_0x780c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x780c('0x4'));var Mustache=require('mustache');var util=require(_0x780c('0x5'));var path=require(_0x780c('0x6'));var sox=require(_0x780c('0x7'));var csv=require(_0x780c('0x8'));var ejs=require(_0x780c('0x9'));var fs=require('fs');var fs_extra=require(_0x780c('0xa'));var _=require(_0x780c('0xb'));var squel=require(_0x780c('0xc'));var crypto=require(_0x780c('0xd'));var jsforce=require(_0x780c('0xe'));var deskjs=require(_0x780c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x780c('0x10'));var Papa=require(_0x780c('0x11'));var Redis=require('ioredis');var authService=require(_0x780c('0x12'));var qs=require(_0x780c('0x13'));var as=require(_0x780c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x780c('0x15'))(_0x780c('0x16'));var utils=require(_0x780c('0x17'));var config=require(_0x780c('0x18'));var licenseUtil=require(_0x780c('0x19'));var db=require(_0x780c('0x1a'))['db'];function respondWithStatusCode(_0x2b09af,_0x5a5986){_0x5a5986=_0x5a5986||0xcc;return function(_0x3aaa99){if(_0x3aaa99){return _0x2b09af[_0x780c('0x1b')](_0x5a5986);}return _0x2b09af[_0x780c('0x1c')](_0x5a5986)[_0x780c('0x1d')]();};}function respondWithResult(_0x5576e9,_0x4ea5df){_0x4ea5df=_0x4ea5df||0xc8;return function(_0x244934){if(_0x244934){return _0x5576e9[_0x780c('0x1c')](_0x4ea5df)['json'](_0x244934);}};}function respondWithFilteredResult(_0x5b74fb,_0x2c8c23){return function(_0xccd8c){if(_0xccd8c){var _0x21b69b=typeof _0x2c8c23[_0x780c('0x1e')]===_0x780c('0x1f')&&typeof _0x2c8c23[_0x780c('0x20')]==='undefined';var _0x45258b=_0xccd8c[_0x780c('0x21')];var _0x2127e2=_0x21b69b?0x0:_0x2c8c23[_0x780c('0x1e')];var _0x48e6fe=_0x21b69b?_0xccd8c[_0x780c('0x21')]:_0x2c8c23[_0x780c('0x1e')]+_0x2c8c23[_0x780c('0x20')];var _0x3d5269;if(_0x48e6fe>=_0x45258b){_0x48e6fe=_0x45258b;_0x3d5269=0xc8;}else{_0x3d5269=0xce;}_0x5b74fb['status'](_0x3d5269);return _0x5b74fb[_0x780c('0x22')](_0x780c('0x23'),_0x2127e2+'-'+_0x48e6fe+'/'+_0x45258b)['json'](_0xccd8c);}return null;};}function patchUpdates(_0x4f665d){return function(_0x5cccd3){try{jsonpatch[_0x780c('0x24')](_0x5cccd3,_0x4f665d,!![]);}catch(_0xe4e284){return BPromise[_0x780c('0x25')](_0xe4e284);}return _0x5cccd3[_0x780c('0x26')]();};}function saveUpdates(_0x444905,_0x21e720){return function(_0x2c66c5){if(_0x2c66c5){return _0x2c66c5[_0x780c('0x27')](_0x444905)[_0x780c('0x28')](function(_0x21b68a){return _0x21b68a;});}return null;};}function removeEntity(_0x1d0c8a,_0x55fc81){return function(_0x226f7b){if(_0x226f7b){return _0x226f7b[_0x780c('0x29')]()[_0x780c('0x28')](function(){_0x1d0c8a['status'](0xcc)[_0x780c('0x1d')]();});}};}function handleEntityNotFound(_0x121199,_0x38810b){return function(_0x27e326){if(!_0x27e326){_0x121199[_0x780c('0x1b')](0x194);}return _0x27e326;};}function handleError(_0x41a58b,_0x5d675c){_0x5d675c=_0x5d675c||0x1f4;return function(_0x1cb65e){logger[_0x780c('0x2a')](_0x1cb65e[_0x780c('0x2b')]);if(_0x1cb65e['name']){delete _0x1cb65e[_0x780c('0x2c')];}_0x41a58b[_0x780c('0x1c')](_0x5d675c)[_0x780c('0x2d')](_0x1cb65e);};}exports[_0x780c('0x2e')]=function(_0x26708b,_0x1819bf){var _0x37d6c8={},_0x35b97a={},_0x2a19b1={'count':0x0,'rows':[]};var _0x21f84e=_[_0x780c('0x2f')](db[_0x780c('0x30')][_0x780c('0x31')],function(_0x1216b4){return{'name':_0x1216b4['fieldName'],'type':_0x1216b4[_0x780c('0x32')][_0x780c('0x33')]};});_0x35b97a[_0x780c('0x34')]=_[_0x780c('0x2f')](_0x21f84e,_0x780c('0x2c'));_0x35b97a[_0x780c('0x35')]=_['keys'](_0x26708b[_0x780c('0x35')]);_0x35b97a[_0x780c('0x36')]=_[_0x780c('0x37')](_0x35b97a[_0x780c('0x34')],_0x35b97a['query']);_0x37d6c8['attributes']=_[_0x780c('0x37')](_0x35b97a[_0x780c('0x34')],qs['fields'](_0x26708b['query']['fields']));_0x37d6c8[_0x780c('0x38')]=_0x37d6c8[_0x780c('0x38')][_0x780c('0x39')]?_0x37d6c8['attributes']:_0x35b97a[_0x780c('0x34')];if(!_0x26708b['query']['hasOwnProperty'](_0x780c('0x3a'))){_0x37d6c8[_0x780c('0x20')]=qs[_0x780c('0x20')](_0x26708b[_0x780c('0x35')][_0x780c('0x20')]);_0x37d6c8[_0x780c('0x1e')]=qs['offset'](_0x26708b[_0x780c('0x35')][_0x780c('0x1e')]);}_0x37d6c8['order']=qs['sort'](_0x26708b[_0x780c('0x35')][_0x780c('0x3b')]);_0x37d6c8[_0x780c('0x3c')]=qs[_0x780c('0x36')](_[_0x780c('0x3d')](_0x26708b[_0x780c('0x35')],_0x35b97a[_0x780c('0x36')]),_0x21f84e);if(_0x26708b[_0x780c('0x35')][_0x780c('0x3e')]){_0x37d6c8[_0x780c('0x3c')]=_['merge'](_0x37d6c8[_0x780c('0x3c')],{'$or':_[_0x780c('0x2f')](_0x21f84e,function(_0x4c16b1){if(_0x4c16b1[_0x780c('0x32')]!==_0x780c('0x3f')){var _0x55ab16={};_0x55ab16[_0x4c16b1[_0x780c('0x2c')]]={'$like':'%'+_0x26708b['query'][_0x780c('0x3e')]+'%'};return _0x55ab16;}})});}_0x37d6c8=_[_0x780c('0x40')]({},_0x37d6c8,_0x26708b[_0x780c('0x41')]);var _0x5b2dfb={'where':_0x37d6c8['where']};return db[_0x780c('0x30')][_0x780c('0x21')](_0x5b2dfb)[_0x780c('0x28')](function(_0x71748b){_0x2a19b1[_0x780c('0x21')]=_0x71748b;if(_0x26708b[_0x780c('0x35')][_0x780c('0x42')]){_0x37d6c8[_0x780c('0x43')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x780c('0x44')](_0x37d6c8);})[_0x780c('0x28')](function(_0x5db660){_0x2a19b1[_0x780c('0x45')]=_0x5db660;return _0x2a19b1;})[_0x780c('0x28')](respondWithFilteredResult(_0x1819bf,_0x37d6c8))[_0x780c('0x46')](handleError(_0x1819bf,null));};exports['show']=function(_0x23cba0,_0x14a5d9){var _0x37d547={'raw':!![],'where':{'id':_0x23cba0['params']['id']}},_0x4be864={};_0x4be864[_0x780c('0x34')]=_[_0x780c('0x47')](db[_0x780c('0x30')][_0x780c('0x31')]);_0x4be864[_0x780c('0x35')]=_[_0x780c('0x47')](_0x23cba0[_0x780c('0x35')]);_0x4be864['filters']=_['intersection'](_0x4be864[_0x780c('0x34')],_0x4be864[_0x780c('0x35')]);_0x37d547[_0x780c('0x38')]=_[_0x780c('0x37')](_0x4be864[_0x780c('0x34')],qs[_0x780c('0x48')](_0x23cba0[_0x780c('0x35')][_0x780c('0x48')]));_0x37d547['attributes']=_0x37d547[_0x780c('0x38')][_0x780c('0x39')]?_0x37d547[_0x780c('0x38')]:_0x4be864['model'];if(_0x23cba0['query'][_0x780c('0x42')]){_0x37d547[_0x780c('0x43')]=[{'all':!![]}];}_0x37d547=_[_0x780c('0x40')]({},_0x37d547,_0x23cba0[_0x780c('0x41')]);return db[_0x780c('0x30')]['find'](_0x37d547)[_0x780c('0x28')](handleEntityNotFound(_0x14a5d9,null))[_0x780c('0x28')](respondWithResult(_0x14a5d9,null))['catch'](handleError(_0x14a5d9,null));};exports['create']=function(_0x412f72,_0x59be69){return db['FaxQueueReport']['create'](_0x412f72[_0x780c('0x49')],{})['then'](respondWithResult(_0x59be69,0xc9))[_0x780c('0x46')](handleError(_0x59be69,null));};exports['update']=function(_0x2deec6,_0x4eda4f){if(_0x2deec6[_0x780c('0x49')]['id']){delete _0x2deec6[_0x780c('0x49')]['id'];}return db[_0x780c('0x30')][_0x780c('0x4a')]({'where':{'id':_0x2deec6[_0x780c('0x4b')]['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x4eda4f,null))[_0x780c('0x28')](saveUpdates(_0x2deec6[_0x780c('0x49')],null))['then'](respondWithResult(_0x4eda4f,null))[_0x780c('0x46')](handleError(_0x4eda4f,null));};exports[_0x780c('0x29')]=function(_0x3bae2d,_0x4e780e){return db[_0x780c('0x30')][_0x780c('0x4a')]({'where':{'id':_0x3bae2d['params']['id']}})[_0x780c('0x28')](handleEntityNotFound(_0x4e780e,null))[_0x780c('0x28')](removeEntity(_0x4e780e,null))[_0x780c('0x46')](handleError(_0x4e780e,null));};exports['describe']=function(_0x43f08b,_0x539358){return db[_0x780c('0x30')][_0x780c('0x4c')]()[_0x780c('0x28')](respondWithResult(_0x539358,null))['catch'](handleError(_0x539358,null));}; \ No newline at end of file +var _0xc817=['apply','reject','update','destroy','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','then','includeAll','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x59b27d,_0x5046e3){var _0x3f5a08=function(_0xb61d07){while(--_0xb61d07){_0x59b27d['push'](_0x59b27d['shift']());}};_0x3f5a08(++_0x5046e3);}(_0xc817,0x75));var _0x7c81=function(_0x417b64,_0x4fd6de){_0x417b64=_0x417b64-0x0;var _0x55ae33=_0xc817[_0x417b64];return _0x55ae33;};'use strict';var emlformat=require(_0x7c81('0x0'));var rimraf=require(_0x7c81('0x1'));var zipdir=require(_0x7c81('0x2'));var jsonpatch=require(_0x7c81('0x3'));var rp=require('request-promise');var moment=require(_0x7c81('0x4'));var BPromise=require(_0x7c81('0x5'));var Mustache=require(_0x7c81('0x6'));var util=require(_0x7c81('0x7'));var path=require(_0x7c81('0x8'));var sox=require(_0x7c81('0x9'));var csv=require('to-csv');var ejs=require(_0x7c81('0xa'));var fs=require('fs');var fs_extra=require(_0x7c81('0xb'));var _=require('lodash');var squel=require(_0x7c81('0xc'));var crypto=require(_0x7c81('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7c81('0xe'));var toCsv=require(_0x7c81('0xf'));var querystring=require(_0x7c81('0x10'));var Papa=require(_0x7c81('0x11'));var Redis=require(_0x7c81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7c81('0x13'));var as=require(_0x7c81('0x14'));var hardwareService=require(_0x7c81('0x15'));var logger=require(_0x7c81('0x16'))(_0x7c81('0x17'));var utils=require(_0x7c81('0x18'));var config=require(_0x7c81('0x19'));var licenseUtil=require(_0x7c81('0x1a'));var db=require(_0x7c81('0x1b'))['db'];function respondWithStatusCode(_0x1f7771,_0xe463e){_0xe463e=_0xe463e||0xcc;return function(_0x1f7b5c){if(_0x1f7b5c){return _0x1f7771[_0x7c81('0x1c')](_0xe463e);}return _0x1f7771[_0x7c81('0x1d')](_0xe463e)[_0x7c81('0x1e')]();};}function respondWithResult(_0xebb73,_0x9362c4){_0x9362c4=_0x9362c4||0xc8;return function(_0x1abf26){if(_0x1abf26){return _0xebb73[_0x7c81('0x1d')](_0x9362c4)['json'](_0x1abf26);}};}function respondWithFilteredResult(_0x439b1c,_0x18aefa){return function(_0x2f3de2){if(_0x2f3de2){var _0x1021f8=typeof _0x18aefa[_0x7c81('0x1f')]===_0x7c81('0x20')&&typeof _0x18aefa[_0x7c81('0x21')]===_0x7c81('0x20');var _0x266bb0=_0x2f3de2['count'];var _0x14cce5=_0x1021f8?0x0:_0x18aefa[_0x7c81('0x1f')];var _0xfd62e=_0x1021f8?_0x2f3de2[_0x7c81('0x22')]:_0x18aefa['offset']+_0x18aefa[_0x7c81('0x21')];var _0x2e2b44;if(_0xfd62e>=_0x266bb0){_0xfd62e=_0x266bb0;_0x2e2b44=0xc8;}else{_0x2e2b44=0xce;}_0x439b1c[_0x7c81('0x1d')](_0x2e2b44);return _0x439b1c[_0x7c81('0x23')](_0x7c81('0x24'),_0x14cce5+'-'+_0xfd62e+'/'+_0x266bb0)['json'](_0x2f3de2);}return null;};}function patchUpdates(_0x679b81){return function(_0x1a9cee){try{jsonpatch[_0x7c81('0x25')](_0x1a9cee,_0x679b81,!![]);}catch(_0x35761d){return BPromise[_0x7c81('0x26')](_0x35761d);}return _0x1a9cee['save']();};}function saveUpdates(_0x887753,_0x198390){return function(_0x4704e9){if(_0x4704e9){return _0x4704e9[_0x7c81('0x27')](_0x887753)['then'](function(_0x3bdca5){return _0x3bdca5;});}return null;};}function removeEntity(_0x53bdb2,_0x4ecf3b){return function(_0x53f49c){if(_0x53f49c){return _0x53f49c[_0x7c81('0x28')]()['then'](function(){_0x53bdb2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x349b5c,_0x5e707e){return function(_0x23de92){if(!_0x23de92){_0x349b5c[_0x7c81('0x1c')](0x194);}return _0x23de92;};}function handleError(_0x2e166f,_0x596d69){_0x596d69=_0x596d69||0x1f4;return function(_0xaedec){logger[_0x7c81('0x29')](_0xaedec[_0x7c81('0x2a')]);if(_0xaedec[_0x7c81('0x2b')]){delete _0xaedec[_0x7c81('0x2b')];}_0x2e166f[_0x7c81('0x1d')](_0x596d69)['send'](_0xaedec);};}exports[_0x7c81('0x2c')]=function(_0x5c8206,_0x2089c4){var _0x4f00be={},_0x32c30f={},_0x2b9c72={'count':0x0,'rows':[]};var _0x1bcde9=_['map'](db[_0x7c81('0x2d')][_0x7c81('0x2e')],function(_0x527be1){return{'name':_0x527be1[_0x7c81('0x2f')],'type':_0x527be1['type']['key']};});_0x32c30f[_0x7c81('0x30')]=_[_0x7c81('0x31')](_0x1bcde9,_0x7c81('0x2b'));_0x32c30f[_0x7c81('0x32')]=_[_0x7c81('0x33')](_0x5c8206[_0x7c81('0x32')]);_0x32c30f[_0x7c81('0x34')]=_[_0x7c81('0x35')](_0x32c30f['model'],_0x32c30f[_0x7c81('0x32')]);_0x4f00be[_0x7c81('0x36')]=_['intersection'](_0x32c30f[_0x7c81('0x30')],qs[_0x7c81('0x37')](_0x5c8206[_0x7c81('0x32')]['fields']));_0x4f00be[_0x7c81('0x36')]=_0x4f00be[_0x7c81('0x36')][_0x7c81('0x38')]?_0x4f00be[_0x7c81('0x36')]:_0x32c30f[_0x7c81('0x30')];if(!_0x5c8206[_0x7c81('0x32')][_0x7c81('0x39')](_0x7c81('0x3a'))){_0x4f00be[_0x7c81('0x21')]=qs[_0x7c81('0x21')](_0x5c8206[_0x7c81('0x32')][_0x7c81('0x21')]);_0x4f00be[_0x7c81('0x1f')]=qs['offset'](_0x5c8206[_0x7c81('0x32')][_0x7c81('0x1f')]);}_0x4f00be[_0x7c81('0x3b')]=qs[_0x7c81('0x3c')](_0x5c8206[_0x7c81('0x32')]['sort']);_0x4f00be['where']=qs[_0x7c81('0x34')](_[_0x7c81('0x3d')](_0x5c8206[_0x7c81('0x32')],_0x32c30f[_0x7c81('0x34')]),_0x1bcde9);if(_0x5c8206[_0x7c81('0x32')]['filter']){_0x4f00be[_0x7c81('0x3e')]=_[_0x7c81('0x3f')](_0x4f00be[_0x7c81('0x3e')],{'$or':_['map'](_0x1bcde9,function(_0x2266a4){if(_0x2266a4[_0x7c81('0x40')]!==_0x7c81('0x41')){var _0x529033={};_0x529033[_0x2266a4[_0x7c81('0x2b')]]={'$like':'%'+_0x5c8206[_0x7c81('0x32')]['filter']+'%'};return _0x529033;}})});}_0x4f00be=_[_0x7c81('0x3f')]({},_0x4f00be,_0x5c8206[_0x7c81('0x42')]);var _0x157cb8={'where':_0x4f00be[_0x7c81('0x3e')]};return db['FaxQueueReport'][_0x7c81('0x22')](_0x157cb8)[_0x7c81('0x43')](function(_0x5911cd){_0x2b9c72[_0x7c81('0x22')]=_0x5911cd;if(_0x5c8206[_0x7c81('0x32')][_0x7c81('0x44')]){_0x4f00be['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x7c81('0x45')](_0x4f00be);})['then'](function(_0x44e611){_0x2b9c72[_0x7c81('0x46')]=_0x44e611;return _0x2b9c72;})[_0x7c81('0x43')](respondWithFilteredResult(_0x2089c4,_0x4f00be))[_0x7c81('0x47')](handleError(_0x2089c4,null));};exports['show']=function(_0x10260e,_0x2bf76a){var _0x38eec1={'raw':!![],'where':{'id':_0x10260e[_0x7c81('0x48')]['id']}},_0x341a8c={};_0x341a8c['model']=_[_0x7c81('0x33')](db[_0x7c81('0x2d')][_0x7c81('0x2e')]);_0x341a8c[_0x7c81('0x32')]=_[_0x7c81('0x33')](_0x10260e['query']);_0x341a8c[_0x7c81('0x34')]=_[_0x7c81('0x35')](_0x341a8c[_0x7c81('0x30')],_0x341a8c['query']);_0x38eec1[_0x7c81('0x36')]=_[_0x7c81('0x35')](_0x341a8c['model'],qs['fields'](_0x10260e[_0x7c81('0x32')][_0x7c81('0x37')]));_0x38eec1[_0x7c81('0x36')]=_0x38eec1[_0x7c81('0x36')][_0x7c81('0x38')]?_0x38eec1[_0x7c81('0x36')]:_0x341a8c[_0x7c81('0x30')];if(_0x10260e['query'][_0x7c81('0x44')]){_0x38eec1['include']=[{'all':!![]}];}_0x38eec1=_[_0x7c81('0x3f')]({},_0x38eec1,_0x10260e[_0x7c81('0x42')]);return db[_0x7c81('0x2d')][_0x7c81('0x49')](_0x38eec1)[_0x7c81('0x43')](handleEntityNotFound(_0x2bf76a,null))[_0x7c81('0x43')](respondWithResult(_0x2bf76a,null))[_0x7c81('0x47')](handleError(_0x2bf76a,null));};exports[_0x7c81('0x4a')]=function(_0x3eb27e,_0x1698ef){return db[_0x7c81('0x2d')][_0x7c81('0x4a')](_0x3eb27e[_0x7c81('0x4b')],{})[_0x7c81('0x43')](respondWithResult(_0x1698ef,0xc9))[_0x7c81('0x47')](handleError(_0x1698ef,null));};exports[_0x7c81('0x27')]=function(_0x4b47a2,_0xeb1033){if(_0x4b47a2['body']['id']){delete _0x4b47a2[_0x7c81('0x4b')]['id'];}return db[_0x7c81('0x2d')][_0x7c81('0x49')]({'where':{'id':_0x4b47a2['params']['id']}})['then'](handleEntityNotFound(_0xeb1033,null))[_0x7c81('0x43')](saveUpdates(_0x4b47a2['body'],null))[_0x7c81('0x43')](respondWithResult(_0xeb1033,null))[_0x7c81('0x47')](handleError(_0xeb1033,null));};exports[_0x7c81('0x28')]=function(_0x260d65,_0x208166){return db[_0x7c81('0x2d')][_0x7c81('0x49')]({'where':{'id':_0x260d65['params']['id']}})[_0x7c81('0x43')](handleEntityNotFound(_0x208166,null))[_0x7c81('0x43')](removeEntity(_0x208166,null))['catch'](handleError(_0x208166,null));};exports[_0x7c81('0x4c')]=function(_0x5d38fd,_0x52445d){return db[_0x7c81('0x2d')][_0x7c81('0x4c')]()[_0x7c81('0x43')](respondWithResult(_0x52445d,null))[_0x7c81('0x47')](handleError(_0x52445d,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a2ed135..a103edb 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3ba2d6,_0x4910cb){var _0x6f362a=function(_0x4ac813){while(--_0x4ac813){_0x3ba2d6['push'](_0x3ba2d6['shift']());}};_0x6f362a(++_0x4910cb);}(_0xabce,0x103));var _0xeabc=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xabce[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x1f4b25,_0x362cb6){var _0x18abf9=function(_0x23d648){while(--_0x23d648){_0x1f4b25['push'](_0x1f4b25['shift']());}};_0x18abf9(++_0x362cb6);}(_0x326f,0xd1));var _0xf326=function(_0x436553,_0x2d6991){_0x436553=_0x436553-0x0;var _0x2235ba=_0x326f[_0x436553];return _0x2235ba;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 6a100df..e3bb1cf 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 _0x3788=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','update','where','attributes','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1ce4e0,_0x3b2428){var _0xd1a086=function(_0x23d940){while(--_0x23d940){_0x1ce4e0['push'](_0x1ce4e0['shift']());}};_0xd1a086(++_0x3b2428);}(_0x3788,0xd8));var _0x8378=function(_0x218b67,_0x643e13){_0x218b67=_0x218b67-0x0;var _0x102dd5=_0x3788[_0x218b67];return _0x102dd5;};'use strict';var _=require(_0x8378('0x0'));var util=require(_0x8378('0x1'));var moment=require('moment');var BPromise=require(_0x8378('0x2'));var rs=require(_0x8378('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8378('0x4'))['db'];var utils=require(_0x8378('0x5'));var logger=require(_0x8378('0x6'))(_0x8378('0x7'));var config=require('../../config/environment');var jayson=require(_0x8378('0x8'));var client=jayson[_0x8378('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e3ad5,_0x1cc4f2,_0x2e45bb){return new BPromise(function(_0xaaabfd,_0x2ff46f){return client[_0x8378('0xa')](_0x1e3ad5,_0x2e45bb)[_0x8378('0xb')](function(_0x5df56b){logger[_0x8378('0xc')](_0x8378('0xd'),_0x1cc4f2,_0x8378('0xe'));logger[_0x8378('0xf')](_0x8378('0x10'),_0x1cc4f2,_0x8378('0xe'),JSON[_0x8378('0x11')](_0x5df56b));if(_0x5df56b['error']){if(_0x5df56b[_0x8378('0x12')][_0x8378('0x13')]===0x1f4){logger[_0x8378('0x12')](_0x8378('0xd'),_0x1cc4f2,_0x5df56b['error'][_0x8378('0x14')]);return _0x2ff46f(_0x5df56b['error']['message']);}logger[_0x8378('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x1cc4f2,_0x5df56b[_0x8378('0x12')]['message']);return _0xaaabfd(_0x5df56b[_0x8378('0x12')]['message']);}else{logger[_0x8378('0xc')](_0x8378('0xd'),_0x1cc4f2,_0x8378('0xe'));_0xaaabfd(_0x5df56b[_0x8378('0x15')][_0x8378('0x14')]);}})[_0x8378('0x16')](function(_0x3503a7){logger[_0x8378('0x12')](_0x8378('0xd'),_0x1cc4f2,_0x3503a7);_0x2ff46f(_0x3503a7);});});}exports['CreateFaxQueueReport']=function(_0x3dc960){var _0x54ba01=this;return new Promise(function(_0x156322,_0x26fe4c){return db[_0x8378('0x17')][_0x8378('0x18')](_0x3dc960[_0x8378('0x19')],{'raw':_0x3dc960[_0x8378('0x1a')]?_0x3dc960['options'][_0x8378('0x1b')]===undefined?!![]:![]:!![]})[_0x8378('0xb')](function(_0x37a553){logger[_0x8378('0xc')]('CreateFaxQueueReport',_0x3dc960);logger[_0x8378('0xf')](_0x8378('0x1c'),_0x3dc960,JSON[_0x8378('0x11')](_0x37a553));_0x156322(_0x37a553);})[_0x8378('0x16')](function(_0x52e081){logger[_0x8378('0x12')](_0x8378('0x1c'),_0x52e081[_0x8378('0x14')],_0x3dc960);_0x26fe4c(_0x54ba01['error'](0x1f4,_0x52e081['message']));});});};exports['UpdateFaxQueueReport']=function(_0x33fb8f){var _0x597fc3=this;return new Promise(function(_0xc78b5a,_0x124051){return db[_0x8378('0x17')][_0x8378('0x1d')](_0x33fb8f['body'],{'raw':_0x33fb8f[_0x8378('0x1a')]?_0x33fb8f[_0x8378('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33fb8f[_0x8378('0x1a')]?_0x33fb8f[_0x8378('0x1a')][_0x8378('0x1e')]||null:null,'attributes':_0x33fb8f['options']?_0x33fb8f[_0x8378('0x1a')][_0x8378('0x1f')]||null:null,'limit':_0x33fb8f[_0x8378('0x1a')]?_0x33fb8f[_0x8378('0x1a')]['limit']||null:null})[_0x8378('0xb')](function(_0xc7fbed){logger[_0x8378('0xc')](_0x8378('0x20'),_0x33fb8f);logger[_0x8378('0xf')](_0x8378('0x20'),_0x33fb8f,JSON[_0x8378('0x11')](_0xc7fbed));_0xc78b5a(_0xc7fbed);})[_0x8378('0x16')](function(_0x45d932){logger['error'](_0x8378('0x20'),_0x45d932[_0x8378('0x14')],_0x33fb8f);_0x124051(_0x597fc3[_0x8378('0x12')](0x1f4,_0x45d932[_0x8378('0x14')]));});});}; \ No newline at end of file +var _0x4459=['options','raw','UpdateFaxQueueReport','attributes','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body'];(function(_0x18379e,_0x5be24e){var _0x3c0620=function(_0x1f7c04){while(--_0x1f7c04){_0x18379e['push'](_0x18379e['shift']());}};_0x3c0620(++_0x5be24e);}(_0x4459,0x184));var _0x9445=function(_0x2c7432,_0x2cadba){_0x2c7432=_0x2c7432-0x0;var _0x1943f8=_0x4459[_0x2c7432];return _0x1943f8;};'use strict';var _=require('lodash');var util=require(_0x9445('0x0'));var moment=require(_0x9445('0x1'));var BPromise=require('bluebird');var rs=require(_0x9445('0x2'));var fs=require('fs');var Redis=require(_0x9445('0x3'));var db=require(_0x9445('0x4'))['db'];var utils=require(_0x9445('0x5'));var logger=require(_0x9445('0x6'))(_0x9445('0x7'));var config=require(_0x9445('0x8'));var jayson=require(_0x9445('0x9'));var client=jayson[_0x9445('0xa')][_0x9445('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17ec74,_0x573ca2,_0x59db9e){return new BPromise(function(_0x56f422,_0x58e593){return client[_0x9445('0xc')](_0x17ec74,_0x59db9e)[_0x9445('0xd')](function(_0x344251){logger[_0x9445('0xe')](_0x9445('0xf'),_0x573ca2,_0x9445('0x10'));logger[_0x9445('0x11')](_0x9445('0x12'),_0x573ca2,_0x9445('0x10'),JSON[_0x9445('0x13')](_0x344251));if(_0x344251['error']){if(_0x344251[_0x9445('0x14')][_0x9445('0x15')]===0x1f4){logger['error'](_0x9445('0xf'),_0x573ca2,_0x344251[_0x9445('0x14')][_0x9445('0x16')]);return _0x58e593(_0x344251[_0x9445('0x14')][_0x9445('0x16')]);}logger[_0x9445('0x14')](_0x9445('0xf'),_0x573ca2,_0x344251['error'][_0x9445('0x16')]);return _0x56f422(_0x344251['error'][_0x9445('0x16')]);}else{logger['info'](_0x9445('0xf'),_0x573ca2,_0x9445('0x10'));_0x56f422(_0x344251['result'][_0x9445('0x16')]);}})[_0x9445('0x17')](function(_0x174a83){logger['error'](_0x9445('0xf'),_0x573ca2,_0x174a83);_0x58e593(_0x174a83);});});}exports[_0x9445('0x18')]=function(_0x5bcd5e){var _0x2ea735=this;return new Promise(function(_0x3708cf,_0x1b5e91){return db[_0x9445('0x19')][_0x9445('0x1a')](_0x5bcd5e[_0x9445('0x1b')],{'raw':_0x5bcd5e[_0x9445('0x1c')]?_0x5bcd5e[_0x9445('0x1c')][_0x9445('0x1d')]===undefined?!![]:![]:!![]})[_0x9445('0xd')](function(_0x1e92e9){logger[_0x9445('0xe')](_0x9445('0x18'),_0x5bcd5e);logger[_0x9445('0x11')](_0x9445('0x18'),_0x5bcd5e,JSON[_0x9445('0x13')](_0x1e92e9));_0x3708cf(_0x1e92e9);})['catch'](function(_0x34c637){logger[_0x9445('0x14')](_0x9445('0x18'),_0x34c637[_0x9445('0x16')],_0x5bcd5e);_0x1b5e91(_0x2ea735['error'](0x1f4,_0x34c637[_0x9445('0x16')]));});});};exports[_0x9445('0x1e')]=function(_0x167b00){var _0x3200b1=this;return new Promise(function(_0x54d596,_0x1fcfd){return db['FaxQueueReport']['update'](_0x167b00[_0x9445('0x1b')],{'raw':_0x167b00[_0x9445('0x1c')]?_0x167b00[_0x9445('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x167b00[_0x9445('0x1c')]?_0x167b00[_0x9445('0x1c')]['where']||null:null,'attributes':_0x167b00[_0x9445('0x1c')]?_0x167b00[_0x9445('0x1c')][_0x9445('0x1f')]||null:null,'limit':_0x167b00[_0x9445('0x1c')]?_0x167b00['options']['limit']||null:null})[_0x9445('0xd')](function(_0x58c5e5){logger[_0x9445('0xe')](_0x9445('0x1e'),_0x167b00);logger[_0x9445('0x11')]('UpdateFaxQueueReport',_0x167b00,JSON[_0x9445('0x13')](_0x58c5e5));_0x54d596(_0x58c5e5);})['catch'](function(_0x44101e){logger[_0x9445('0x14')](_0x9445('0x1e'),_0x44101e['message'],_0x167b00);_0x1fcfd(_0x3200b1[_0x9445('0x14')](0x1f4,_0x44101e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 3fe7299..512ca18 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 _0x0291=['express','./faxQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x200fb6,_0x533d95){var _0x38a14c=function(_0x5336d1){while(--_0x5336d1){_0x200fb6['push'](_0x200fb6['shift']());}};_0x38a14c(++_0x533d95);}(_0x0291,0x11d));var _0x1029=function(_0x487e88,_0x57c1ab){_0x487e88=_0x487e88-0x0;var _0x12c276=_0x0291[_0x487e88];return _0x12c276;};'use strict';var multer=require(_0x1029('0x0'));var util=require(_0x1029('0x1'));var path=require(_0x1029('0x2'));var timeout=require('connect-timeout');var express=require(_0x1029('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1029('0x4'));router[_0x1029('0x5')]('/',auth[_0x1029('0x6')](),controller['index']);router['get'](_0x1029('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x1029('0x5')](_0x1029('0x8'),auth[_0x1029('0x6')](),controller[_0x1029('0x9')]);router[_0x1029('0xa')]('/',auth[_0x1029('0x6')](),controller[_0x1029('0xb')]);router['put'](_0x1029('0x8'),auth[_0x1029('0x6')](),controller[_0x1029('0xc')]);router[_0x1029('0xd')]('/:id',auth[_0x1029('0x6')](),controller[_0x1029('0xe')]);module[_0x1029('0xf')]=router; \ No newline at end of file +var _0xa753=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete'];(function(_0x2fad8a,_0x26de69){var _0x494d7d=function(_0x52fe59){while(--_0x52fe59){_0x2fad8a['push'](_0x2fad8a['shift']());}};_0x494d7d(++_0x26de69);}(_0xa753,0xbf));var _0x3a75=function(_0x58ce6d,_0x3f868a){_0x58ce6d=_0x58ce6d-0x0;var _0x115495=_0xa753[_0x58ce6d];return _0x115495;};'use strict';var multer=require(_0x3a75('0x0'));var util=require(_0x3a75('0x1'));var path=require('path');var timeout=require(_0x3a75('0x2'));var express=require(_0x3a75('0x3'));var router=express[_0x3a75('0x4')]();var fs_extra=require(_0x3a75('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a75('0x6'));var controller=require(_0x3a75('0x7'));router[_0x3a75('0x8')]('/',auth[_0x3a75('0x9')](),controller[_0x3a75('0xa')]);router[_0x3a75('0x8')](_0x3a75('0xb'),auth[_0x3a75('0x9')](),controller[_0x3a75('0xc')]);router[_0x3a75('0x8')](_0x3a75('0xd'),auth['isAuthenticated'](),controller[_0x3a75('0xe')]);router[_0x3a75('0xf')]('/',auth[_0x3a75('0x9')](),controller['create']);router[_0x3a75('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a75('0x11')](_0x3a75('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3a75('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4c99740..01d19dc 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x31ee0d,_0x5865b3){var _0x2dc36f=function(_0x208752){while(--_0x208752){_0x31ee0d['push'](_0x31ee0d['shift']());}};_0x2dc36f(++_0x5865b3);}(_0x70e0,0x17b));var _0x070e=function(_0x1c0bca,_0x585b7e){_0x1c0bca=_0x1c0bca-0x0;var _0x21b9f4=_0x70e0[_0x1c0bca];return _0x21b9f4;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xb43b,0x1b2));var _0xbb43=function(_0x411957,_0x506e86){_0x411957=_0x411957-0x0;var _0x593e4e=_0xb43b[_0x411957];return _0x593e4e;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 35b641d..6b0af5f 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 _0x4851=['undefined','limit','count','offset','Content-Range','apply','reject','save','update','error','stack','name','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x116dc4,_0x30994c){var _0x2619f3=function(_0x497152){while(--_0x497152){_0x116dc4['push'](_0x116dc4['shift']());}};_0x2619f3(++_0x30994c);}(_0x4851,0xc2));var _0x1485=function(_0x19f4a4,_0x50396f){_0x19f4a4=_0x19f4a4-0x0;var _0x4c1ca5=_0x4851[_0x19f4a4];return _0x4c1ca5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1485('0x0'));var zipdir=require(_0x1485('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1485('0x2'));var moment=require('moment');var BPromise=require(_0x1485('0x3'));var Mustache=require(_0x1485('0x4'));var util=require(_0x1485('0x5'));var path=require(_0x1485('0x6'));var sox=require(_0x1485('0x7'));var csv=require(_0x1485('0x8'));var ejs=require(_0x1485('0x9'));var fs=require('fs');var fs_extra=require(_0x1485('0xa'));var _=require(_0x1485('0xb'));var squel=require('squel');var crypto=require(_0x1485('0xc'));var jsforce=require(_0x1485('0xd'));var deskjs=require(_0x1485('0xe'));var toCsv=require(_0x1485('0x8'));var querystring=require('querystring');var Papa=require(_0x1485('0xf'));var Redis=require(_0x1485('0x10'));var authService=require(_0x1485('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1485('0x12'));var hardwareService=require(_0x1485('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1485('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1485('0x15'))['db'];function respondWithStatusCode(_0x41abbd,_0x538b12){_0x538b12=_0x538b12||0xcc;return function(_0x124fb6){if(_0x124fb6){return _0x41abbd[_0x1485('0x16')](_0x538b12);}return _0x41abbd[_0x1485('0x17')](_0x538b12)['end']();};}function respondWithResult(_0x523ecd,_0x28eda4){_0x28eda4=_0x28eda4||0xc8;return function(_0x5a30db){if(_0x5a30db){return _0x523ecd[_0x1485('0x17')](_0x28eda4)[_0x1485('0x18')](_0x5a30db);}};}function respondWithFilteredResult(_0x137447,_0x242bad){return function(_0x129586){if(_0x129586){var _0x15d7f5=typeof _0x242bad['offset']===_0x1485('0x19')&&typeof _0x242bad[_0x1485('0x1a')]===_0x1485('0x19');var _0x678855=_0x129586[_0x1485('0x1b')];var _0x449cbf=_0x15d7f5?0x0:_0x242bad[_0x1485('0x1c')];var _0xdf04b7=_0x15d7f5?_0x129586[_0x1485('0x1b')]:_0x242bad[_0x1485('0x1c')]+_0x242bad[_0x1485('0x1a')];var _0xb1e289;if(_0xdf04b7>=_0x678855){_0xdf04b7=_0x678855;_0xb1e289=0xc8;}else{_0xb1e289=0xce;}_0x137447['status'](_0xb1e289);return _0x137447['set'](_0x1485('0x1d'),_0x449cbf+'-'+_0xdf04b7+'/'+_0x678855)['json'](_0x129586);}return null;};}function patchUpdates(_0xf2992c){return function(_0x143a3a){try{jsonpatch[_0x1485('0x1e')](_0x143a3a,_0xf2992c,!![]);}catch(_0x4d9440){return BPromise[_0x1485('0x1f')](_0x4d9440);}return _0x143a3a[_0x1485('0x20')]();};}function saveUpdates(_0x29fcd9,_0x23799b){return function(_0x49f75a){if(_0x49f75a){return _0x49f75a[_0x1485('0x21')](_0x29fcd9)['then'](function(_0x5cee08){return _0x5cee08;});}return null;};}function removeEntity(_0x56638b,_0x3576d5){return function(_0x4c6e3c){if(_0x4c6e3c){return _0x4c6e3c['destroy']()['then'](function(){_0x56638b[_0x1485('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1450f2,_0x268261){return function(_0x49820f){if(!_0x49820f){_0x1450f2[_0x1485('0x16')](0x194);}return _0x49820f;};}function handleError(_0x58d2ad,_0x3cd0fa){_0x3cd0fa=_0x3cd0fa||0x1f4;return function(_0x164c35){logger[_0x1485('0x22')](_0x164c35[_0x1485('0x23')]);if(_0x164c35[_0x1485('0x24')]){delete _0x164c35[_0x1485('0x24')];}_0x58d2ad[_0x1485('0x17')](_0x3cd0fa)['send'](_0x164c35);};}exports['index']=function(_0x46dc54,_0x56b37b){var _0x42bc59={},_0x1ac38f={},_0xf8a2b={'count':0x0,'rows':[]};var _0x24f9a8=_['map'](db[_0x1485('0x25')][_0x1485('0x26')],function(_0x4fd24a){return{'name':_0x4fd24a[_0x1485('0x27')],'type':_0x4fd24a[_0x1485('0x28')][_0x1485('0x29')]};});_0x1ac38f[_0x1485('0x2a')]=_['map'](_0x24f9a8,_0x1485('0x24'));_0x1ac38f[_0x1485('0x2b')]=_[_0x1485('0x2c')](_0x46dc54[_0x1485('0x2b')]);_0x1ac38f[_0x1485('0x2d')]=_[_0x1485('0x2e')](_0x1ac38f[_0x1485('0x2a')],_0x1ac38f[_0x1485('0x2b')]);_0x42bc59[_0x1485('0x2f')]=_[_0x1485('0x2e')](_0x1ac38f[_0x1485('0x2a')],qs[_0x1485('0x30')](_0x46dc54[_0x1485('0x2b')]['fields']));_0x42bc59[_0x1485('0x2f')]=_0x42bc59[_0x1485('0x2f')][_0x1485('0x31')]?_0x42bc59[_0x1485('0x2f')]:_0x1ac38f['model'];if(!_0x46dc54[_0x1485('0x2b')]['hasOwnProperty'](_0x1485('0x32'))){_0x42bc59['limit']=qs[_0x1485('0x1a')](_0x46dc54['query'][_0x1485('0x1a')]);_0x42bc59['offset']=qs['offset'](_0x46dc54[_0x1485('0x2b')][_0x1485('0x1c')]);}_0x42bc59[_0x1485('0x33')]=qs[_0x1485('0x34')](_0x46dc54['query']['sort']);_0x42bc59['where']=qs[_0x1485('0x2d')](_[_0x1485('0x35')](_0x46dc54[_0x1485('0x2b')],_0x1ac38f[_0x1485('0x2d')]),_0x24f9a8);if(_0x46dc54[_0x1485('0x2b')][_0x1485('0x36')]){_0x42bc59[_0x1485('0x37')]=_['merge'](_0x42bc59['where'],{'$or':_[_0x1485('0x38')](_0x24f9a8,function(_0x1181f3){if(_0x1181f3[_0x1485('0x28')]!==_0x1485('0x39')){var _0x5479f0={};_0x5479f0[_0x1181f3[_0x1485('0x24')]]={'$like':'%'+_0x46dc54[_0x1485('0x2b')][_0x1485('0x36')]+'%'};return _0x5479f0;}})});}_0x42bc59=_[_0x1485('0x3a')]({},_0x42bc59,_0x46dc54[_0x1485('0x3b')]);var _0x6b16a4={'where':_0x42bc59[_0x1485('0x37')]};return db[_0x1485('0x25')]['count'](_0x6b16a4)[_0x1485('0x3c')](function(_0x341cf1){_0xf8a2b[_0x1485('0x1b')]=_0x341cf1;if(_0x46dc54[_0x1485('0x2b')][_0x1485('0x3d')]){_0x42bc59['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x1485('0x3e')](_0x42bc59);})[_0x1485('0x3c')](function(_0x4301f1){_0xf8a2b[_0x1485('0x3f')]=_0x4301f1;return _0xf8a2b;})[_0x1485('0x3c')](respondWithFilteredResult(_0x56b37b,_0x42bc59))[_0x1485('0x40')](handleError(_0x56b37b,null));};exports[_0x1485('0x41')]=function(_0x135c6a,_0xa55888){var _0x420eb8={'raw':!![],'where':{'id':_0x135c6a['params']['id']}},_0xa0e138={};_0xa0e138['model']=_[_0x1485('0x2c')](db[_0x1485('0x25')][_0x1485('0x26')]);_0xa0e138['query']=_[_0x1485('0x2c')](_0x135c6a[_0x1485('0x2b')]);_0xa0e138['filters']=_['intersection'](_0xa0e138[_0x1485('0x2a')],_0xa0e138[_0x1485('0x2b')]);_0x420eb8[_0x1485('0x2f')]=_[_0x1485('0x2e')](_0xa0e138[_0x1485('0x2a')],qs[_0x1485('0x30')](_0x135c6a[_0x1485('0x2b')][_0x1485('0x30')]));_0x420eb8[_0x1485('0x2f')]=_0x420eb8[_0x1485('0x2f')][_0x1485('0x31')]?_0x420eb8[_0x1485('0x2f')]:_0xa0e138[_0x1485('0x2a')];if(_0x135c6a[_0x1485('0x2b')]['includeAll']){_0x420eb8[_0x1485('0x42')]=[{'all':!![]}];}_0x420eb8=_[_0x1485('0x3a')]({},_0x420eb8,_0x135c6a[_0x1485('0x3b')]);return db['FaxTransferReport'][_0x1485('0x43')](_0x420eb8)[_0x1485('0x3c')](handleEntityNotFound(_0xa55888,null))[_0x1485('0x3c')](respondWithResult(_0xa55888,null))['catch'](handleError(_0xa55888,null));};exports[_0x1485('0x44')]=function(_0x4cf39f,_0x13c3ad){return db[_0x1485('0x25')]['create'](_0x4cf39f[_0x1485('0x45')],{})[_0x1485('0x3c')](respondWithResult(_0x13c3ad,0xc9))[_0x1485('0x40')](handleError(_0x13c3ad,null));};exports[_0x1485('0x21')]=function(_0x3297d7,_0x46809e){if(_0x3297d7[_0x1485('0x45')]['id']){delete _0x3297d7[_0x1485('0x45')]['id'];}return db['FaxTransferReport'][_0x1485('0x43')]({'where':{'id':_0x3297d7[_0x1485('0x46')]['id']}})[_0x1485('0x3c')](handleEntityNotFound(_0x46809e,null))[_0x1485('0x3c')](saveUpdates(_0x3297d7['body'],null))[_0x1485('0x3c')](respondWithResult(_0x46809e,null))[_0x1485('0x40')](handleError(_0x46809e,null));};exports[_0x1485('0x47')]=function(_0x147c9a,_0x59c7d1){return db['FaxTransferReport']['find']({'where':{'id':_0x147c9a['params']['id']}})['then'](handleEntityNotFound(_0x59c7d1,null))[_0x1485('0x3c')](removeEntity(_0x59c7d1,null))[_0x1485('0x40')](handleError(_0x59c7d1,null));};exports[_0x1485('0x48')]=function(_0x175c13,_0x26b918){return db[_0x1485('0x25')][_0x1485('0x48')]()[_0x1485('0x3c')](respondWithResult(_0x26b918,null))[_0x1485('0x40')](handleError(_0x26b918,null));}; \ No newline at end of file +var _0x76ec=['sort','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','options','find','create','catch','update','body','destroy','describe','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x76ec,0xfa));var _0xc76e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x76ec[_0x20a584];return _0x4b41a8;};'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(_0xc76e('0x0'));var moment=require(_0xc76e('0x1'));var BPromise=require(_0xc76e('0x2'));var Mustache=require(_0xc76e('0x3'));var util=require(_0xc76e('0x4'));var path=require('path');var sox=require(_0xc76e('0x5'));var csv=require(_0xc76e('0x6'));var ejs=require(_0xc76e('0x7'));var fs=require('fs');var fs_extra=require(_0xc76e('0x8'));var _=require(_0xc76e('0x9'));var squel=require(_0xc76e('0xa'));var crypto=require(_0xc76e('0xb'));var jsforce=require(_0xc76e('0xc'));var deskjs=require(_0xc76e('0xd'));var toCsv=require(_0xc76e('0x6'));var querystring=require(_0xc76e('0xe'));var Papa=require(_0xc76e('0xf'));var Redis=require(_0xc76e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc76e('0x11'));var as=require(_0xc76e('0x12'));var hardwareService=require(_0xc76e('0x13'));var logger=require(_0xc76e('0x14'))(_0xc76e('0x15'));var utils=require(_0xc76e('0x16'));var config=require(_0xc76e('0x17'));var licenseUtil=require(_0xc76e('0x18'));var db=require(_0xc76e('0x19'))['db'];function respondWithStatusCode(_0x4502d7,_0x2748f9){_0x2748f9=_0x2748f9||0xcc;return function(_0x19f3d2){if(_0x19f3d2){return _0x4502d7[_0xc76e('0x1a')](_0x2748f9);}return _0x4502d7['status'](_0x2748f9)['end']();};}function respondWithResult(_0x28dcdb,_0x5e4af7){_0x5e4af7=_0x5e4af7||0xc8;return function(_0x2b5f2b){if(_0x2b5f2b){return _0x28dcdb[_0xc76e('0x1b')](_0x5e4af7)[_0xc76e('0x1c')](_0x2b5f2b);}};}function respondWithFilteredResult(_0x3dd33f,_0x14b49e){return function(_0x2385ea){if(_0x2385ea){var _0x3cb950=typeof _0x14b49e[_0xc76e('0x1d')]===_0xc76e('0x1e')&&typeof _0x14b49e['limit']===_0xc76e('0x1e');var _0x56b0c3=_0x2385ea['count'];var _0x4c2e42=_0x3cb950?0x0:_0x14b49e['offset'];var _0x43681a=_0x3cb950?_0x2385ea[_0xc76e('0x1f')]:_0x14b49e[_0xc76e('0x1d')]+_0x14b49e[_0xc76e('0x20')];var _0x512247;if(_0x43681a>=_0x56b0c3){_0x43681a=_0x56b0c3;_0x512247=0xc8;}else{_0x512247=0xce;}_0x3dd33f['status'](_0x512247);return _0x3dd33f[_0xc76e('0x21')](_0xc76e('0x22'),_0x4c2e42+'-'+_0x43681a+'/'+_0x56b0c3)[_0xc76e('0x1c')](_0x2385ea);}return null;};}function patchUpdates(_0x3897d4){return function(_0x20b953){try{jsonpatch[_0xc76e('0x23')](_0x20b953,_0x3897d4,!![]);}catch(_0xfdaf47){return BPromise[_0xc76e('0x24')](_0xfdaf47);}return _0x20b953[_0xc76e('0x25')]();};}function saveUpdates(_0x349d09,_0x675e19){return function(_0x312b0f){if(_0x312b0f){return _0x312b0f['update'](_0x349d09)[_0xc76e('0x26')](function(_0x492e47){return _0x492e47;});}return null;};}function removeEntity(_0x5ac916,_0x5ed0cd){return function(_0x30a6d4){if(_0x30a6d4){return _0x30a6d4['destroy']()[_0xc76e('0x26')](function(){_0x5ac916['status'](0xcc)[_0xc76e('0x27')]();});}};}function handleEntityNotFound(_0x5e9e57,_0x128c20){return function(_0x1625d5){if(!_0x1625d5){_0x5e9e57[_0xc76e('0x1a')](0x194);}return _0x1625d5;};}function handleError(_0x49ea8b,_0xadef19){_0xadef19=_0xadef19||0x1f4;return function(_0x349cfa){logger[_0xc76e('0x28')](_0x349cfa['stack']);if(_0x349cfa[_0xc76e('0x29')]){delete _0x349cfa[_0xc76e('0x29')];}_0x49ea8b['status'](_0xadef19)[_0xc76e('0x2a')](_0x349cfa);};}exports['index']=function(_0x291091,_0x47296a){var _0x29a175={},_0xf84897={},_0x411bd1={'count':0x0,'rows':[]};var _0x372b8d=_[_0xc76e('0x2b')](db[_0xc76e('0x2c')][_0xc76e('0x2d')],function(_0x20c904){return{'name':_0x20c904[_0xc76e('0x2e')],'type':_0x20c904[_0xc76e('0x2f')][_0xc76e('0x30')]};});_0xf84897['model']=_[_0xc76e('0x2b')](_0x372b8d,_0xc76e('0x29'));_0xf84897['query']=_[_0xc76e('0x31')](_0x291091[_0xc76e('0x32')]);_0xf84897[_0xc76e('0x33')]=_[_0xc76e('0x34')](_0xf84897[_0xc76e('0x35')],_0xf84897[_0xc76e('0x32')]);_0x29a175[_0xc76e('0x36')]=_['intersection'](_0xf84897[_0xc76e('0x35')],qs['fields'](_0x291091[_0xc76e('0x32')][_0xc76e('0x37')]));_0x29a175['attributes']=_0x29a175[_0xc76e('0x36')][_0xc76e('0x38')]?_0x29a175[_0xc76e('0x36')]:_0xf84897[_0xc76e('0x35')];if(!_0x291091[_0xc76e('0x32')]['hasOwnProperty'](_0xc76e('0x39'))){_0x29a175['limit']=qs[_0xc76e('0x20')](_0x291091[_0xc76e('0x32')][_0xc76e('0x20')]);_0x29a175[_0xc76e('0x1d')]=qs[_0xc76e('0x1d')](_0x291091[_0xc76e('0x32')][_0xc76e('0x1d')]);}_0x29a175['order']=qs[_0xc76e('0x3a')](_0x291091[_0xc76e('0x32')][_0xc76e('0x3a')]);_0x29a175['where']=qs['filters'](_[_0xc76e('0x3b')](_0x291091['query'],_0xf84897['filters']),_0x372b8d);if(_0x291091[_0xc76e('0x32')][_0xc76e('0x3c')]){_0x29a175[_0xc76e('0x3d')]=_[_0xc76e('0x3e')](_0x29a175['where'],{'$or':_[_0xc76e('0x2b')](_0x372b8d,function(_0x1b0178){if(_0x1b0178[_0xc76e('0x2f')]!=='VIRTUAL'){var _0x3ee43a={};_0x3ee43a[_0x1b0178[_0xc76e('0x29')]]={'$like':'%'+_0x291091[_0xc76e('0x32')][_0xc76e('0x3c')]+'%'};return _0x3ee43a;}})});}_0x29a175=_[_0xc76e('0x3e')]({},_0x29a175,_0x291091['options']);var _0x5e1c17={'where':_0x29a175[_0xc76e('0x3d')]};return db[_0xc76e('0x2c')][_0xc76e('0x1f')](_0x5e1c17)[_0xc76e('0x26')](function(_0xb12d4b){_0x411bd1['count']=_0xb12d4b;if(_0x291091['query'][_0xc76e('0x3f')]){_0x29a175[_0xc76e('0x40')]=[{'all':!![]}];}return db[_0xc76e('0x2c')][_0xc76e('0x41')](_0x29a175);})[_0xc76e('0x26')](function(_0x25168e){_0x411bd1[_0xc76e('0x42')]=_0x25168e;return _0x411bd1;})[_0xc76e('0x26')](respondWithFilteredResult(_0x47296a,_0x29a175))['catch'](handleError(_0x47296a,null));};exports[_0xc76e('0x43')]=function(_0x535b9f,_0x495f81){var _0x7dc2ba={'raw':!![],'where':{'id':_0x535b9f[_0xc76e('0x44')]['id']}},_0x3a0823={};_0x3a0823[_0xc76e('0x35')]=_[_0xc76e('0x31')](db[_0xc76e('0x2c')]['rawAttributes']);_0x3a0823[_0xc76e('0x32')]=_['keys'](_0x535b9f[_0xc76e('0x32')]);_0x3a0823[_0xc76e('0x33')]=_[_0xc76e('0x34')](_0x3a0823[_0xc76e('0x35')],_0x3a0823[_0xc76e('0x32')]);_0x7dc2ba[_0xc76e('0x36')]=_[_0xc76e('0x34')](_0x3a0823[_0xc76e('0x35')],qs[_0xc76e('0x37')](_0x535b9f[_0xc76e('0x32')][_0xc76e('0x37')]));_0x7dc2ba[_0xc76e('0x36')]=_0x7dc2ba[_0xc76e('0x36')][_0xc76e('0x38')]?_0x7dc2ba[_0xc76e('0x36')]:_0x3a0823['model'];if(_0x535b9f[_0xc76e('0x32')][_0xc76e('0x3f')]){_0x7dc2ba[_0xc76e('0x40')]=[{'all':!![]}];}_0x7dc2ba=_[_0xc76e('0x3e')]({},_0x7dc2ba,_0x535b9f[_0xc76e('0x45')]);return db[_0xc76e('0x2c')][_0xc76e('0x46')](_0x7dc2ba)['then'](handleEntityNotFound(_0x495f81,null))[_0xc76e('0x26')](respondWithResult(_0x495f81,null))['catch'](handleError(_0x495f81,null));};exports['create']=function(_0x406422,_0x3b43ad){return db[_0xc76e('0x2c')][_0xc76e('0x47')](_0x406422['body'],{})[_0xc76e('0x26')](respondWithResult(_0x3b43ad,0xc9))[_0xc76e('0x48')](handleError(_0x3b43ad,null));};exports[_0xc76e('0x49')]=function(_0x3dafe2,_0x1ce7cf){if(_0x3dafe2[_0xc76e('0x4a')]['id']){delete _0x3dafe2[_0xc76e('0x4a')]['id'];}return db[_0xc76e('0x2c')]['find']({'where':{'id':_0x3dafe2[_0xc76e('0x44')]['id']}})[_0xc76e('0x26')](handleEntityNotFound(_0x1ce7cf,null))[_0xc76e('0x26')](saveUpdates(_0x3dafe2[_0xc76e('0x4a')],null))['then'](respondWithResult(_0x1ce7cf,null))[_0xc76e('0x48')](handleError(_0x1ce7cf,null));};exports[_0xc76e('0x4b')]=function(_0x3ea203,_0x119e60){return db[_0xc76e('0x2c')]['find']({'where':{'id':_0x3ea203[_0xc76e('0x44')]['id']}})[_0xc76e('0x26')](handleEntityNotFound(_0x119e60,null))[_0xc76e('0x26')](removeEntity(_0x119e60,null))[_0xc76e('0x48')](handleError(_0x119e60,null));};exports[_0xc76e('0x4c')]=function(_0x4d34d4,_0x5e74f9){return db[_0xc76e('0x2c')][_0xc76e('0x4c')]()['then'](respondWithResult(_0x5e74f9,null))[_0xc76e('0x48')](handleError(_0x5e74f9,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 30159b4..b97f02d 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 _0x3611=['../../config/environment','exports','define','report_fax_transfer','lodash','api','request-promise','path','rimraf'];(function(_0x14958f,_0x1e3d9c){var _0x349065=function(_0x5ae625){while(--_0x5ae625){_0x14958f['push'](_0x14958f['shift']());}};_0x349065(++_0x1e3d9c);}(_0x3611,0x136));var _0x1361=function(_0x4a5610,_0x2246d5){_0x4a5610=_0x4a5610-0x0;var _0x47c64f=_0x3611[_0x4a5610];return _0x47c64f;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1361('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1361('0x2'));var fs=require('fs');var path=require(_0x1361('0x3'));var rimraf=require(_0x1361('0x4'));var config=require(_0x1361('0x5'));var attributes=require('./faxTransferReport.attributes');module[_0x1361('0x6')]=function(_0x304832,_0x5aa5dc){return _0x304832[_0x1361('0x7')]('FaxTransferReport',attributes,{'tableName':_0x1361('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd081=['../../config/environment','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5c057e,_0x27e318){var _0xb2504d=function(_0x3d683e){while(--_0x3d683e){_0x5c057e['push'](_0x5c057e['shift']());}};_0xb2504d(++_0x27e318);}(_0xd081,0x13d));var _0x1d08=function(_0x4df8df,_0x2da85e){_0x4df8df=_0x4df8df-0x0;var _0x1e2fdb=_0xd081[_0x4df8df];return _0x1e2fdb;};'use strict';var _=require(_0x1d08('0x0'));var util=require(_0x1d08('0x1'));var logger=require(_0x1d08('0x2'))(_0x1d08('0x3'));var moment=require(_0x1d08('0x4'));var BPromise=require(_0x1d08('0x5'));var rp=require(_0x1d08('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d08('0x7'));var config=require(_0x1d08('0x8'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x3d4d99,_0x515d66){return _0x3d4d99[_0x1d08('0x9')](_0x1d08('0xa'),attributes,{'tableName':_0x1d08('0xb'),'paranoid':![],'indexes':[{'name':_0x1d08('0xc'),'fields':[_0x1d08('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6f57d72..9de6ab1 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 _0xcdc3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdc3,0x70));var _0x3cdc=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xcdc3[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x3cdc('0x0'));var util=require(_0x3cdc('0x1'));var moment=require(_0x3cdc('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cdc('0x3'));var fs=require('fs');var Redis=require(_0x3cdc('0x4'));var db=require(_0x3cdc('0x5'))['db'];var utils=require(_0x3cdc('0x6'));var logger=require(_0x3cdc('0x7'))('rpc');var config=require(_0x3cdc('0x8'));var jayson=require(_0x3cdc('0x9'));var client=jayson[_0x3cdc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d9a37,_0x2175bb,_0x4c74a0){return new BPromise(function(_0x28b8b0,_0x2fac78){return client[_0x3cdc('0xb')](_0x2d9a37,_0x4c74a0)['then'](function(_0x36bb6f){logger['info'](_0x3cdc('0xc'),_0x2175bb,_0x3cdc('0xd'));logger[_0x3cdc('0xe')](_0x3cdc('0xf'),_0x2175bb,_0x3cdc('0xd'),JSON[_0x3cdc('0x10')](_0x36bb6f));if(_0x36bb6f[_0x3cdc('0x11')]){if(_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x12')]===0x1f4){logger[_0x3cdc('0x11')](_0x3cdc('0xc'),_0x2175bb,_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);return _0x2fac78(_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);}logger[_0x3cdc('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x2175bb,_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);return _0x28b8b0(_0x36bb6f[_0x3cdc('0x11')][_0x3cdc('0x13')]);}else{logger[_0x3cdc('0x14')](_0x3cdc('0xc'),_0x2175bb,_0x3cdc('0xd'));_0x28b8b0(_0x36bb6f[_0x3cdc('0x15')][_0x3cdc('0x13')]);}})[_0x3cdc('0x16')](function(_0x386496){logger[_0x3cdc('0x11')](_0x3cdc('0xc'),_0x2175bb,_0x386496);_0x2fac78(_0x386496);});});} \ No newline at end of file +var _0x9981=['request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x25e576,_0x1a89dd){var _0xcedc7=function(_0x2183b7){while(--_0x2183b7){_0x25e576['push'](_0x25e576['shift']());}};_0xcedc7(++_0x1a89dd);}(_0x9981,0x1e8));var _0x1998=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x9981[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1998('0x0'));var BPromise=require('bluebird');var rs=require(_0x1998('0x1'));var fs=require('fs');var Redis=require(_0x1998('0x2'));var db=require(_0x1998('0x3'))['db'];var utils=require(_0x1998('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x1998('0x5'));var jayson=require(_0x1998('0x6'));var client=jayson[_0x1998('0x7')][_0x1998('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e399d,_0x5646b0,_0x5537e1){return new BPromise(function(_0x17a3f0,_0x13b41a){return client['request'](_0x3e399d,_0x5537e1)[_0x1998('0x9')](function(_0x440f97){logger[_0x1998('0xa')](_0x1998('0xb'),_0x5646b0,_0x1998('0xc'));logger['debug'](_0x1998('0xd'),_0x5646b0,_0x1998('0xc'),JSON[_0x1998('0xe')](_0x440f97));if(_0x440f97[_0x1998('0xf')]){if(_0x440f97[_0x1998('0xf')][_0x1998('0x10')]===0x1f4){logger[_0x1998('0xf')](_0x1998('0xb'),_0x5646b0,_0x440f97['error'][_0x1998('0x11')]);return _0x13b41a(_0x440f97[_0x1998('0xf')][_0x1998('0x11')]);}logger['error'](_0x1998('0xb'),_0x5646b0,_0x440f97[_0x1998('0xf')]['message']);return _0x17a3f0(_0x440f97[_0x1998('0xf')][_0x1998('0x11')]);}else{logger[_0x1998('0xa')](_0x1998('0xb'),_0x5646b0,'request\x20sent');_0x17a3f0(_0x440f97[_0x1998('0x12')][_0x1998('0x11')]);}})[_0x1998('0x13')](function(_0x3f0d7d){logger[_0x1998('0xf')](_0x1998('0xb'),_0x5646b0,_0x3f0d7d);_0x13b41a(_0x3f0d7d);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 614a0a1..128ac36 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 _0xb066=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','show','post','put','update','destroy','exports','multer'];(function(_0x13fef7,_0x40e369){var _0x455f14=function(_0x24611a){while(--_0x24611a){_0x13fef7['push'](_0x13fef7['shift']());}};_0x455f14(++_0x40e369);}(_0xb066,0x155));var _0x6b06=function(_0x554155,_0x4469c3){_0x554155=_0x554155-0x0;var _0x188758=_0xb066[_0x554155];return _0x188758;};'use strict';var multer=require(_0x6b06('0x0'));var util=require(_0x6b06('0x1'));var path=require(_0x6b06('0x2'));var timeout=require(_0x6b06('0x3'));var express=require(_0x6b06('0x4'));var router=express[_0x6b06('0x5')]();var fs_extra=require(_0x6b06('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6b06('0x7'));var config=require('../../config/environment');var controller=require(_0x6b06('0x8'));router[_0x6b06('0x9')]('/',auth[_0x6b06('0xa')](),controller['index']);router['get'](_0x6b06('0xb'),auth[_0x6b06('0xa')](),controller['describe']);router[_0x6b06('0x9')]('/:id',auth[_0x6b06('0xa')](),controller[_0x6b06('0xc')]);router[_0x6b06('0xd')]('/',auth[_0x6b06('0xa')](),controller['create']);router[_0x6b06('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6b06('0xf')]);router['delete']('/:id',auth[_0x6b06('0xa')](),controller[_0x6b06('0x10')]);module[_0x6b06('0x11')]=router; \ No newline at end of file +var _0x8cbb=['/describe','/:id','post','create','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index'];(function(_0x5a3a81,_0x5e862f){var _0x59f7fa=function(_0x445a70){while(--_0x445a70){_0x5a3a81['push'](_0x5a3a81['shift']());}};_0x59f7fa(++_0x5e862f);}(_0x8cbb,0x193));var _0xb8cb=function(_0x40f50f,_0x49df69){_0x40f50f=_0x40f50f-0x0;var _0x5e82b8=_0x8cbb[_0x40f50f];return _0x5e82b8;};'use strict';var multer=require(_0xb8cb('0x0'));var util=require(_0xb8cb('0x1'));var path=require('path');var timeout=require(_0xb8cb('0x2'));var express=require(_0xb8cb('0x3'));var router=express[_0xb8cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb8cb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb8cb('0x6'));var controller=require(_0xb8cb('0x7'));router[_0xb8cb('0x8')]('/',auth[_0xb8cb('0x9')](),controller[_0xb8cb('0xa')]);router['get'](_0xb8cb('0xb'),auth[_0xb8cb('0x9')](),controller['describe']);router[_0xb8cb('0x8')](_0xb8cb('0xc'),auth[_0xb8cb('0x9')](),controller['show']);router[_0xb8cb('0xd')]('/',auth['isAuthenticated'](),controller[_0xb8cb('0xe')]);router[_0xb8cb('0xf')](_0xb8cb('0xc'),auth[_0xb8cb('0x9')](),controller[_0xb8cb('0x10')]);router[_0xb8cb('0x11')](_0xb8cb('0xc'),auth[_0xb8cb('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 36c65f7..7171f9b 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 _0x5359=['/:id','update','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put'];(function(_0x13d816,_0x37ca7){var _0x5ab9fe=function(_0x10dd3d){while(--_0x10dd3d){_0x13d816['push'](_0x13d816['shift']());}};_0x5ab9fe(++_0x37ca7);}(_0x5359,0x144));var _0x9535=function(_0x2a9de5,_0xbc4a67){_0x2a9de5=_0x2a9de5-0x0;var _0x12e9d2=_0x5359[_0x2a9de5];return _0x12e9d2;};'use strict';var multer=require(_0x9535('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9535('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9535('0x2'));var auth=require(_0x9535('0x3'));var interaction=require(_0x9535('0x4'));var config=require(_0x9535('0x5'));var controller=require(_0x9535('0x6'));router[_0x9535('0x7')]('/',auth[_0x9535('0x8')](),controller['index']);router['get']('/:id',auth[_0x9535('0x8')](),controller['show']);router[_0x9535('0x7')](_0x9535('0x9'),auth['isAuthenticated'](),controller[_0x9535('0xa')]);router[_0x9535('0x7')](_0x9535('0xb'),auth['isAuthenticated'](),controller[_0x9535('0xc')]);router['post']('/',auth[_0x9535('0x8')](),controller[_0x9535('0xd')]);router[_0x9535('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9535('0xf')](_0x9535('0x10'),auth['isAuthenticated'](),controller[_0x9535('0x11')]);router['delete']('/:id',auth[_0x9535('0x8')](),controller[_0x9535('0x12')]);module[_0x9535('0x13')]=router; \ No newline at end of file +var _0x227d=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put'];(function(_0x12db71,_0x4ac41b){var _0x2dacbd=function(_0x5b94c1){while(--_0x5b94c1){_0x12db71['push'](_0x12db71['shift']());}};_0x2dacbd(++_0x4ac41b);}(_0x227d,0x1ce));var _0xd227=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x227d[_0x1793de];return _0x4f0309;};'use strict';var multer=require(_0xd227('0x0'));var util=require(_0xd227('0x1'));var path=require(_0xd227('0x2'));var timeout=require(_0xd227('0x3'));var express=require('express');var router=express[_0xd227('0x4')]();var fs_extra=require(_0xd227('0x5'));var auth=require(_0xd227('0x6'));var interaction=require(_0xd227('0x7'));var config=require(_0xd227('0x8'));var controller=require('./intDeskAccount.controller');router[_0xd227('0x9')]('/',auth['isAuthenticated'](),controller[_0xd227('0xa')]);router[_0xd227('0x9')](_0xd227('0xb'),auth[_0xd227('0xc')](),controller[_0xd227('0xd')]);router[_0xd227('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd227('0xe')]);router[_0xd227('0x9')](_0xd227('0xf'),auth[_0xd227('0xc')](),controller[_0xd227('0x10')]);router[_0xd227('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd227('0x11')](_0xd227('0x12'),auth[_0xd227('0xc')](),controller[_0xd227('0x13')]);router[_0xd227('0x14')](_0xd227('0xb'),auth[_0xd227('0xc')](),controller['update']);router['delete'](_0xd227('0xb'),auth['isAuthenticated'](),controller[_0xd227('0x15')]);module[_0xd227('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e430e51..ec9fd4f 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 _0x15a7=['basic','ENUM','newTab','sequelize','exports','STRING'];(function(_0x393e26,_0x375503){var _0x55243c=function(_0x24c9f9){while(--_0x24c9f9){_0x393e26['push'](_0x393e26['shift']());}};_0x55243c(++_0x375503);}(_0x15a7,0x1b9));var _0x715a=function(_0x78f9b9,_0x486f81){_0x78f9b9=_0x78f9b9-0x0;var _0x1a6e67=_0x15a7[_0x78f9b9];return _0x1a6e67;};'use strict';var Sequelize=require(_0x715a('0x0'));module[_0x715a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x715a('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x715a('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x715a('0x3')),'defaultValue':_0x715a('0x3')},'password':{'type':Sequelize[_0x715a('0x2')]},'consumerKey':{'type':Sequelize[_0x715a('0x2')]},'consumerSecret':{'type':Sequelize[_0x715a('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x715a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x715a('0x4')]('integrationTab',_0x715a('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x4892=['basic','integrationTab','newTab','sequelize','STRING','ENUM'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4892,0x9f));var _0x2489=function(_0x88e142,_0x483420){_0x88e142=_0x88e142-0x0;var _0x3dfcc6=_0x4892[_0x88e142];return _0x3dfcc6;};'use strict';var Sequelize=require(_0x2489('0x0'));module['exports']={'name':{'type':Sequelize[_0x2489('0x1')]},'description':{'type':Sequelize[_0x2489('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2489('0x1')]},'authType':{'type':Sequelize[_0x2489('0x2')](_0x2489('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x2489('0x1')]},'token':{'type':Sequelize[_0x2489('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2489('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2489('0x2')](_0x2489('0x4'),_0x2489('0x5')),'defaultValue':_0x2489('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index dc57cab..44a2d6d 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 _0xadc0=['save','update','then','destroy','name','send','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','DeskAccount','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','format','application/json','basic','headers','Basic\x20%s','password','toString','base64','concat','_embedded','active','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x25a386,_0x4acd61){var _0x4d3d47=function(_0x2e4efb){while(--_0x2e4efb){_0x25a386['push'](_0x25a386['shift']());}};_0x4d3d47(++_0x4acd61);}(_0xadc0,0x125));var _0x0adc=function(_0x4e9b99,_0x124be9){_0x4e9b99=_0x4e9b99-0x0;var _0x2c63dd=_0xadc0[_0x4e9b99];return _0x2c63dd;};'use strict';var emlformat=require(_0x0adc('0x0'));var rimraf=require(_0x0adc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0adc('0x2'));var rp=require(_0x0adc('0x3'));var moment=require(_0x0adc('0x4'));var BPromise=require(_0x0adc('0x5'));var Mustache=require(_0x0adc('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0adc('0x7'));var csv=require('to-csv');var ejs=require(_0x0adc('0x8'));var fs=require('fs');var fs_extra=require(_0x0adc('0x9'));var _=require(_0x0adc('0xa'));var squel=require(_0x0adc('0xb'));var crypto=require(_0x0adc('0xc'));var jsforce=require(_0x0adc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0adc('0xe'));var querystring=require('querystring');var Papa=require(_0x0adc('0xf'));var Redis=require(_0x0adc('0x10'));var authService=require(_0x0adc('0x11'));var qs=require(_0x0adc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0adc('0x13'));var logger=require(_0x0adc('0x14'))('api');var utils=require(_0x0adc('0x15'));var config=require(_0x0adc('0x16'));var licenseUtil=require(_0x0adc('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0adc('0x18'));function respondWithStatusCode(_0x233dda,_0x3d09eb){_0x3d09eb=_0x3d09eb||0xcc;return function(_0x12c998){if(_0x12c998){return _0x233dda[_0x0adc('0x19')](_0x3d09eb);}return _0x233dda[_0x0adc('0x1a')](_0x3d09eb)['end']();};}function respondWithResult(_0x262448,_0x1a669b){_0x1a669b=_0x1a669b||0xc8;return function(_0xea8097){if(_0xea8097){return _0x262448[_0x0adc('0x1a')](_0x1a669b)[_0x0adc('0x1b')](_0xea8097);}};}function respondWithFilteredResult(_0x383a46,_0x25f780){return function(_0x580dc9){if(_0x580dc9){var _0x425126=typeof _0x25f780['offset']===_0x0adc('0x1c')&&typeof _0x25f780[_0x0adc('0x1d')]===_0x0adc('0x1c');var _0x4f566=_0x580dc9[_0x0adc('0x1e')];var _0x4198f5=_0x425126?0x0:_0x25f780[_0x0adc('0x1f')];var _0x2cfd03=_0x425126?_0x580dc9[_0x0adc('0x1e')]:_0x25f780[_0x0adc('0x1f')]+_0x25f780[_0x0adc('0x1d')];var _0x386bba;if(_0x2cfd03>=_0x4f566){_0x2cfd03=_0x4f566;_0x386bba=0xc8;}else{_0x386bba=0xce;}_0x383a46[_0x0adc('0x1a')](_0x386bba);return _0x383a46['set'](_0x0adc('0x20'),_0x4198f5+'-'+_0x2cfd03+'/'+_0x4f566)['json'](_0x580dc9);}return null;};}function patchUpdates(_0x244360){return function(_0x98318c){try{jsonpatch[_0x0adc('0x21')](_0x98318c,_0x244360,!![]);}catch(_0x4cbded){return BPromise['reject'](_0x4cbded);}return _0x98318c[_0x0adc('0x22')]();};}function saveUpdates(_0x30e75d,_0x47ced2){return function(_0x2d373b){if(_0x2d373b){return _0x2d373b[_0x0adc('0x23')](_0x30e75d)[_0x0adc('0x24')](function(_0xd2113a){return _0xd2113a;});}return null;};}function removeEntity(_0x27a7f3,_0x5e4692){return function(_0x1e0581){if(_0x1e0581){return _0x1e0581[_0x0adc('0x25')]()['then'](function(){_0x27a7f3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x478263,_0x3f0c33){return function(_0x4f4c5a){if(!_0x4f4c5a){_0x478263[_0x0adc('0x19')](0x194);}return _0x4f4c5a;};}function handleError(_0x2715d5,_0x3d74fd){_0x3d74fd=_0x3d74fd||0x1f4;return function(_0x4beb08){logger['error'](_0x4beb08['stack']);if(_0x4beb08[_0x0adc('0x26')]){delete _0x4beb08[_0x0adc('0x26')];}_0x2715d5[_0x0adc('0x1a')](_0x3d74fd)[_0x0adc('0x27')](_0x4beb08);};}exports[_0x0adc('0x28')]=function(_0x1bac44,_0x331689){var _0x41d856={},_0xf74b03={},_0x12fa08={'count':0x0,'rows':[]};var _0x51cdec=_['map'](db['DeskAccount'][_0x0adc('0x29')],function(_0x16e86f){return{'name':_0x16e86f[_0x0adc('0x2a')],'type':_0x16e86f[_0x0adc('0x2b')][_0x0adc('0x2c')]};});_0xf74b03['model']=_['map'](_0x51cdec,_0x0adc('0x26'));_0xf74b03[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x1bac44[_0x0adc('0x2d')]);_0xf74b03[_0x0adc('0x2f')]=_[_0x0adc('0x30')](_0xf74b03['model'],_0xf74b03['query']);_0x41d856['attributes']=_['intersection'](_0xf74b03[_0x0adc('0x31')],qs[_0x0adc('0x32')](_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x32')]));_0x41d856[_0x0adc('0x33')]=_0x41d856[_0x0adc('0x33')][_0x0adc('0x34')]?_0x41d856[_0x0adc('0x33')]:_0xf74b03['model'];if(!_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x35')](_0x0adc('0x36'))){_0x41d856[_0x0adc('0x1d')]=qs[_0x0adc('0x1d')](_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x1d')]);_0x41d856[_0x0adc('0x1f')]=qs[_0x0adc('0x1f')](_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x1f')]);}_0x41d856[_0x0adc('0x37')]=qs[_0x0adc('0x38')](_0x1bac44['query'][_0x0adc('0x38')]);_0x41d856[_0x0adc('0x39')]=qs['filters'](_[_0x0adc('0x3a')](_0x1bac44[_0x0adc('0x2d')],_0xf74b03['filters']),_0x51cdec);if(_0x1bac44['query'][_0x0adc('0x3b')]){_0x41d856[_0x0adc('0x39')]=_[_0x0adc('0x3c')](_0x41d856[_0x0adc('0x39')],{'$or':_[_0x0adc('0x3d')](_0x51cdec,function(_0xe65d38){if(_0xe65d38[_0x0adc('0x2b')]!==_0x0adc('0x3e')){var _0x398a02={};_0x398a02[_0xe65d38[_0x0adc('0x26')]]={'$like':'%'+_0x1bac44[_0x0adc('0x2d')][_0x0adc('0x3b')]+'%'};return _0x398a02;}})});}_0x41d856=_['merge']({},_0x41d856,_0x1bac44['options']);var _0x1f1c69={'where':_0x41d856[_0x0adc('0x39')]};return db['DeskAccount'][_0x0adc('0x1e')](_0x1f1c69)[_0x0adc('0x24')](function(_0x127dec){_0x12fa08[_0x0adc('0x1e')]=_0x127dec;if(_0x1bac44[_0x0adc('0x2d')]['includeAll']){_0x41d856[_0x0adc('0x3f')]=[{'all':!![]}];}return db[_0x0adc('0x40')]['findAll'](_0x41d856);})['then'](function(_0x1476ef){_0x12fa08[_0x0adc('0x41')]=_0x1476ef;return _0x12fa08;})[_0x0adc('0x24')](respondWithFilteredResult(_0x331689,_0x41d856))[_0x0adc('0x42')](handleError(_0x331689,null));};exports[_0x0adc('0x43')]=function(_0x1a2365,_0x3dab35){var _0x27400f={'raw':![],'where':{'id':_0x1a2365[_0x0adc('0x44')]['id']}},_0x97ea4={};_0x97ea4[_0x0adc('0x31')]=_[_0x0adc('0x2e')](db[_0x0adc('0x40')][_0x0adc('0x29')]);_0x97ea4[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x1a2365[_0x0adc('0x2d')]);_0x97ea4[_0x0adc('0x2f')]=_[_0x0adc('0x30')](_0x97ea4['model'],_0x97ea4['query']);_0x27400f[_0x0adc('0x33')]=_[_0x0adc('0x30')](_0x97ea4[_0x0adc('0x31')],qs[_0x0adc('0x32')](_0x1a2365[_0x0adc('0x2d')]['fields']));_0x27400f['attributes']=_0x27400f[_0x0adc('0x33')]['length']?_0x27400f[_0x0adc('0x33')]:_0x97ea4['model'];if(_0x1a2365[_0x0adc('0x2d')]['includeAll']){_0x27400f[_0x0adc('0x3f')]=[{'all':!![]}];}_0x27400f=_[_0x0adc('0x3c')]({},_0x27400f,_0x1a2365[_0x0adc('0x45')]);return db[_0x0adc('0x40')][_0x0adc('0x46')](_0x27400f)['then'](handleEntityNotFound(_0x3dab35,null))[_0x0adc('0x24')](respondWithResult(_0x3dab35,null))[_0x0adc('0x42')](handleError(_0x3dab35,null));};exports[_0x0adc('0x47')]=function(_0x345dc7,_0x17347a){return db[_0x0adc('0x40')]['create'](_0x345dc7[_0x0adc('0x48')],{})[_0x0adc('0x24')](respondWithResult(_0x17347a,0xc9))[_0x0adc('0x42')](handleError(_0x17347a,null));};exports['update']=function(_0x55b9d1,_0x2ed30b){if(_0x55b9d1[_0x0adc('0x48')]['id']){delete _0x55b9d1['body']['id'];}return db[_0x0adc('0x40')][_0x0adc('0x46')]({'where':{'id':_0x55b9d1[_0x0adc('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ed30b,null))[_0x0adc('0x24')](saveUpdates(_0x55b9d1['body'],null))[_0x0adc('0x24')](respondWithResult(_0x2ed30b,null))[_0x0adc('0x42')](handleError(_0x2ed30b,null));};exports[_0x0adc('0x25')]=function(_0x164555,_0x3fc14c){return db[_0x0adc('0x40')][_0x0adc('0x46')]({'where':{'id':_0x164555[_0x0adc('0x44')]['id']}})[_0x0adc('0x24')](handleEntityNotFound(_0x3fc14c,null))[_0x0adc('0x24')](removeEntity(_0x3fc14c,null))[_0x0adc('0x42')](handleError(_0x3fc14c,null));};exports[_0x0adc('0x49')]=function(_0x43e4dd,_0x47083e,_0x41a5b3){var _0x5256c3={};var _0x1da100={};var _0x4c237e;var _0x3ed42d;return db['DeskAccount'][_0x0adc('0x4a')]({'where':{'id':_0x43e4dd['params']['id']}})[_0x0adc('0x24')](handleEntityNotFound(_0x47083e,null))[_0x0adc('0x24')](function(_0x10227d){if(_0x10227d){_0x4c237e=_0x10227d;_0x1da100[_0x0adc('0x31')]=_[_0x0adc('0x2e')](db[_0x0adc('0x4b')][_0x0adc('0x29')]);_0x1da100[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x43e4dd['query']);_0x1da100[_0x0adc('0x2f')]=_[_0x0adc('0x30')](_0x1da100[_0x0adc('0x31')],_0x1da100[_0x0adc('0x2d')]);_0x5256c3[_0x0adc('0x33')]=_[_0x0adc('0x30')](_0x1da100[_0x0adc('0x31')],qs['fields'](_0x43e4dd['query'][_0x0adc('0x32')]));_0x5256c3['attributes']=_0x5256c3['attributes'][_0x0adc('0x34')]?_0x5256c3['attributes']:_0x1da100[_0x0adc('0x31')];_0x5256c3[_0x0adc('0x37')]=qs[_0x0adc('0x38')](_0x43e4dd[_0x0adc('0x2d')][_0x0adc('0x38')]);_0x5256c3['where']=qs[_0x0adc('0x2f')](_['pick'](_0x43e4dd['query'],_0x1da100[_0x0adc('0x2f')]));if(_0x43e4dd['query'][_0x0adc('0x3b')]){_0x5256c3[_0x0adc('0x39')]=_[_0x0adc('0x3c')](_0x5256c3['where'],{'$or':_[_0x0adc('0x3d')](_0x5256c3['attributes'],function(_0x4f888e){var _0x33756c={};_0x33756c[_0x4f888e]={'$like':'%'+_0x43e4dd[_0x0adc('0x2d')][_0x0adc('0x3b')]+'%'};return _0x33756c;})});}_0x5256c3=_[_0x0adc('0x3c')]({},_0x5256c3,_0x43e4dd[_0x0adc('0x45')]);return _0x4c237e[_0x0adc('0x49')](_0x5256c3);}})[_0x0adc('0x24')](function(_0x27619b){if(_0x27619b){_0x3ed42d=_0x27619b[_0x0adc('0x34')];if(!_0x43e4dd['query'][_0x0adc('0x35')](_0x0adc('0x36'))){_0x5256c3[_0x0adc('0x1d')]=qs[_0x0adc('0x1d')](_0x43e4dd['query']['limit']);_0x5256c3[_0x0adc('0x1f')]=qs[_0x0adc('0x1f')](_0x43e4dd[_0x0adc('0x2d')][_0x0adc('0x1f')]);}return _0x4c237e[_0x0adc('0x49')](_0x5256c3);}})[_0x0adc('0x24')](function(_0x2dac70){if(_0x2dac70){return _0x2dac70?{'count':_0x3ed42d,'rows':_0x2dac70}:null;}})['then'](respondWithResult(_0x47083e,null))[_0x0adc('0x42')](handleError(_0x47083e,null));};exports[_0x0adc('0x4c')]=function(_0x4859c7,_0x215847,_0x1323c1){if(_0x4859c7[_0x0adc('0x48')]['id']){delete _0x4859c7['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x4859c7[_0x0adc('0x44')]['id']}})[_0x0adc('0x24')](handleEntityNotFound(_0x215847,null))[_0x0adc('0x24')](function(_0xe7fa9f){if(_0xe7fa9f){_0x4859c7[_0x0adc('0x48')][_0x0adc('0x4d')]=_0xe7fa9f['id'];_0x4859c7[_0x0adc('0x48')][_0x0adc('0x4e')]=integrations[_0x0adc('0x4f')](_0x4859c7[_0x0adc('0x48')]['channel'],_0x4859c7[_0x0adc('0x48')]['type']);_0x4859c7[_0x0adc('0x48')]['Descriptions']=integrations['getDescriptions'](_0x4859c7[_0x0adc('0x48')][_0x0adc('0x50')],_0x4859c7[_0x0adc('0x48')][_0x0adc('0x2b')]);return db[_0x0adc('0x4b')][_0x0adc('0x47')](_0x4859c7[_0x0adc('0x48')],{'include':[{'model':db[_0x0adc('0x51')],'as':_0x0adc('0x4e')},{'model':db[_0x0adc('0x51')],'as':'Descriptions'}]});}return null;})[_0x0adc('0x24')](respondWithResult(_0x215847,null))[_0x0adc('0x42')](handleError(_0x215847,null));};exports[_0x0adc('0x52')]=function(_0x1dfc11,_0x141304,_0x17fdc9){var _0x353823=[{'name':_0x0adc('0x53'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x368120='';return db[_0x0adc('0x40')][_0x0adc('0x4a')]({'where':{'id':_0x1dfc11[_0x0adc('0x44')]['id']},'attributes':['id',_0x0adc('0x54'),_0x0adc('0x55'),_0x0adc('0x56'),'password',_0x0adc('0x57'),_0x0adc('0x58'),_0x0adc('0x59'),_0x0adc('0x5a')]})[_0x0adc('0x24')](handleEntityNotFound(_0x141304,null))[_0x0adc('0x24')](function(_0x48c597){if(_0x48c597){_0x368120=_0x48c597['remoteUri'];var _0x2ecc99=_0x368120['slice'](-0x1);if(_0x2ecc99==='/'){_0x368120=_0x368120[_0x0adc('0x5b')](0x0,_0x368120[_0x0adc('0x5c')](_0x2ecc99));}var _0x5ed466={'method':'GET','uri':util[_0x0adc('0x5d')]('%s/custom_fields',_0x368120),'headers':{'Content-Type':_0x0adc('0x5e'),'Accept':_0x0adc('0x5e')},'json':!![]};if(_0x48c597[_0x0adc('0x55')]===_0x0adc('0x5f')){_0x5ed466[_0x0adc('0x60')]['Authorization']=util[_0x0adc('0x5d')](_0x0adc('0x61'),new Buffer(util[_0x0adc('0x5d')]('%s:%s',_0x48c597['username'],_0x48c597[_0x0adc('0x62')]))[_0x0adc('0x63')](_0x0adc('0x64')));}return rp(_0x5ed466)[_0x0adc('0x24')](function(_0x365655){return _0x353823[_0x0adc('0x65')](_[_0x0adc('0x3d')](_0x365655[_0x0adc('0x66')]['entries'],function(_0x808483){return{'id':_0x808483[_0x0adc('0x26')],'name':_0x808483['name'],'type':_0x808483[_0x0adc('0x2b')],'active':_0x808483[_0x0adc('0x67')],'label':_0x808483['label'],'custom':!![]};}));});}})[_0x0adc('0x24')](function(_0x124a85){return{'count':_0x124a85[_0x0adc('0x34')],'rows':_0x124a85};})[_0x0adc('0x24')](respondWithResult(_0x141304,null))[_0x0adc('0x42')](function(_0x44a9af){var _0x4363e5=_0x1dfc11[_0x0adc('0x2d')][_0x0adc('0x68')]?0x1f4:_0x44a9af['statusCode']||0x1f4;logger[_0x0adc('0x69')](_0x0adc('0x6a'),_0x0adc('0x52'),_0x4363e5,JSON[_0x0adc('0x6b')](_0x44a9af));delete _0x44a9af[_0x0adc('0x26')];if(_0x4363e5===0x191){_0x4363e5=0x190;}_0x141304[_0x0adc('0x1a')](_0x4363e5)[_0x0adc('0x27')](_0x1dfc11[_0x0adc('0x2d')][_0x0adc('0x68')]?{'message':_0x0adc('0x6c'),'statusCode':_0x44a9af['statusCode']}:_0x44a9af);});}; \ No newline at end of file +var _0x2bfc=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','options','create','body','update','find','pick','getConfigurations','findOne','getSubjects','channel','getDescriptions','DeskConfiguration','DeskField','Subjects','Descriptions','getFields','priority','remoteUri','username','password','consumerKey','token','tokenSecret','lastIndexOf','GET','format','authType','basic','headers','Authorization','%s:%s','concat','_embedded','label','error','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','end','stack','name','send','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys'];(function(_0x59f904,_0x1f7075){var _0x98fc40=function(_0x33df50){while(--_0x33df50){_0x59f904['push'](_0x59f904['shift']());}};_0x98fc40(++_0x1f7075);}(_0x2bfc,0x118));var _0xc2bf=function(_0x5bc694,_0x568ae1){_0x5bc694=_0x5bc694-0x0;var _0x22f607=_0x2bfc[_0x5bc694];return _0x22f607;};'use strict';var emlformat=require(_0xc2bf('0x0'));var rimraf=require(_0xc2bf('0x1'));var zipdir=require(_0xc2bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2bf('0x3'));var moment=require(_0xc2bf('0x4'));var BPromise=require(_0xc2bf('0x5'));var Mustache=require(_0xc2bf('0x6'));var util=require(_0xc2bf('0x7'));var path=require(_0xc2bf('0x8'));var sox=require(_0xc2bf('0x9'));var csv=require('to-csv');var ejs=require(_0xc2bf('0xa'));var fs=require('fs');var fs_extra=require(_0xc2bf('0xb'));var _=require('lodash');var squel=require(_0xc2bf('0xc'));var crypto=require(_0xc2bf('0xd'));var jsforce=require(_0xc2bf('0xe'));var deskjs=require(_0xc2bf('0xf'));var toCsv=require(_0xc2bf('0x10'));var querystring=require(_0xc2bf('0x11'));var Papa=require(_0xc2bf('0x12'));var Redis=require('ioredis');var authService=require(_0xc2bf('0x13'));var qs=require(_0xc2bf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc2bf('0x15'));var utils=require('../../config/utils');var config=require(_0xc2bf('0x16'));var licenseUtil=require(_0xc2bf('0x17'));var db=require(_0xc2bf('0x18'))['db'];var integrations=require(_0xc2bf('0x19'));function respondWithStatusCode(_0x301d4c,_0x4a3a56){_0x4a3a56=_0x4a3a56||0xcc;return function(_0x49d0a5){if(_0x49d0a5){return _0x301d4c[_0xc2bf('0x1a')](_0x4a3a56);}return _0x301d4c[_0xc2bf('0x1b')](_0x4a3a56)['end']();};}function respondWithResult(_0x3c9542,_0x253906){_0x253906=_0x253906||0xc8;return function(_0x2410e8){if(_0x2410e8){return _0x3c9542[_0xc2bf('0x1b')](_0x253906)[_0xc2bf('0x1c')](_0x2410e8);}};}function respondWithFilteredResult(_0x1b2e54,_0x4cdae2){return function(_0x1525f3){if(_0x1525f3){var _0xd8e647=typeof _0x4cdae2[_0xc2bf('0x1d')]==='undefined'&&typeof _0x4cdae2[_0xc2bf('0x1e')]===_0xc2bf('0x1f');var _0x1cf683=_0x1525f3['count'];var _0x5d4678=_0xd8e647?0x0:_0x4cdae2[_0xc2bf('0x1d')];var _0x4eee97=_0xd8e647?_0x1525f3[_0xc2bf('0x20')]:_0x4cdae2[_0xc2bf('0x1d')]+_0x4cdae2[_0xc2bf('0x1e')];var _0x16efcc;if(_0x4eee97>=_0x1cf683){_0x4eee97=_0x1cf683;_0x16efcc=0xc8;}else{_0x16efcc=0xce;}_0x1b2e54[_0xc2bf('0x1b')](_0x16efcc);return _0x1b2e54[_0xc2bf('0x21')](_0xc2bf('0x22'),_0x5d4678+'-'+_0x4eee97+'/'+_0x1cf683)[_0xc2bf('0x1c')](_0x1525f3);}return null;};}function patchUpdates(_0x1e94a2){return function(_0x6bc1ce){try{jsonpatch['apply'](_0x6bc1ce,_0x1e94a2,!![]);}catch(_0xfffae2){return BPromise['reject'](_0xfffae2);}return _0x6bc1ce[_0xc2bf('0x23')]();};}function saveUpdates(_0x2e89ad,_0x1a95f5){return function(_0x450db6){if(_0x450db6){return _0x450db6['update'](_0x2e89ad)[_0xc2bf('0x24')](function(_0x154351){return _0x154351;});}return null;};}function removeEntity(_0x5e7625,_0x57d764){return function(_0x1344a3){if(_0x1344a3){return _0x1344a3[_0xc2bf('0x25')]()[_0xc2bf('0x24')](function(){_0x5e7625['status'](0xcc)[_0xc2bf('0x26')]();});}};}function handleEntityNotFound(_0x266540,_0x3476d1){return function(_0x2cb400){if(!_0x2cb400){_0x266540[_0xc2bf('0x1a')](0x194);}return _0x2cb400;};}function handleError(_0x10d252,_0x1e5877){_0x1e5877=_0x1e5877||0x1f4;return function(_0x4a37c8){logger['error'](_0x4a37c8[_0xc2bf('0x27')]);if(_0x4a37c8[_0xc2bf('0x28')]){delete _0x4a37c8[_0xc2bf('0x28')];}_0x10d252['status'](_0x1e5877)[_0xc2bf('0x29')](_0x4a37c8);};}exports['index']=function(_0x3eeb8e,_0x582105){var _0x51c6e1={},_0x2aa3e5={},_0x9d5867={'count':0x0,'rows':[]};var _0x39fc84=_[_0xc2bf('0x2a')](db[_0xc2bf('0x2b')][_0xc2bf('0x2c')],function(_0xc375a4){return{'name':_0xc375a4[_0xc2bf('0x2d')],'type':_0xc375a4['type'][_0xc2bf('0x2e')]};});_0x2aa3e5[_0xc2bf('0x2f')]=_[_0xc2bf('0x2a')](_0x39fc84,'name');_0x2aa3e5[_0xc2bf('0x30')]=_[_0xc2bf('0x31')](_0x3eeb8e['query']);_0x2aa3e5['filters']=_[_0xc2bf('0x32')](_0x2aa3e5[_0xc2bf('0x2f')],_0x2aa3e5['query']);_0x51c6e1[_0xc2bf('0x33')]=_['intersection'](_0x2aa3e5[_0xc2bf('0x2f')],qs[_0xc2bf('0x34')](_0x3eeb8e[_0xc2bf('0x30')][_0xc2bf('0x34')]));_0x51c6e1['attributes']=_0x51c6e1['attributes'][_0xc2bf('0x35')]?_0x51c6e1[_0xc2bf('0x33')]:_0x2aa3e5['model'];if(!_0x3eeb8e[_0xc2bf('0x30')][_0xc2bf('0x36')](_0xc2bf('0x37'))){_0x51c6e1['limit']=qs[_0xc2bf('0x1e')](_0x3eeb8e[_0xc2bf('0x30')]['limit']);_0x51c6e1['offset']=qs[_0xc2bf('0x1d')](_0x3eeb8e[_0xc2bf('0x30')][_0xc2bf('0x1d')]);}_0x51c6e1[_0xc2bf('0x38')]=qs[_0xc2bf('0x39')](_0x3eeb8e[_0xc2bf('0x30')][_0xc2bf('0x39')]);_0x51c6e1[_0xc2bf('0x3a')]=qs[_0xc2bf('0x3b')](_['pick'](_0x3eeb8e['query'],_0x2aa3e5[_0xc2bf('0x3b')]),_0x39fc84);if(_0x3eeb8e['query']['filter']){_0x51c6e1['where']=_[_0xc2bf('0x3c')](_0x51c6e1[_0xc2bf('0x3a')],{'$or':_[_0xc2bf('0x2a')](_0x39fc84,function(_0x309706){if(_0x309706[_0xc2bf('0x3d')]!==_0xc2bf('0x3e')){var _0x35eef9={};_0x35eef9[_0x309706[_0xc2bf('0x28')]]={'$like':'%'+_0x3eeb8e['query'][_0xc2bf('0x3f')]+'%'};return _0x35eef9;}})});}_0x51c6e1=_[_0xc2bf('0x3c')]({},_0x51c6e1,_0x3eeb8e['options']);var _0x441cd1={'where':_0x51c6e1['where']};return db['DeskAccount'][_0xc2bf('0x20')](_0x441cd1)[_0xc2bf('0x24')](function(_0x2286eb){_0x9d5867[_0xc2bf('0x20')]=_0x2286eb;if(_0x3eeb8e[_0xc2bf('0x30')][_0xc2bf('0x40')]){_0x51c6e1['include']=[{'all':!![]}];}return db[_0xc2bf('0x2b')][_0xc2bf('0x41')](_0x51c6e1);})[_0xc2bf('0x24')](function(_0x5f424c){_0x9d5867[_0xc2bf('0x42')]=_0x5f424c;return _0x9d5867;})[_0xc2bf('0x24')](respondWithFilteredResult(_0x582105,_0x51c6e1))[_0xc2bf('0x43')](handleError(_0x582105,null));};exports[_0xc2bf('0x44')]=function(_0x4d0e38,_0xa75a5f){var _0x1ed111={'raw':![],'where':{'id':_0x4d0e38[_0xc2bf('0x45')]['id']}},_0x225d4f={};_0x225d4f[_0xc2bf('0x2f')]=_[_0xc2bf('0x31')](db[_0xc2bf('0x2b')]['rawAttributes']);_0x225d4f[_0xc2bf('0x30')]=_[_0xc2bf('0x31')](_0x4d0e38[_0xc2bf('0x30')]);_0x225d4f['filters']=_[_0xc2bf('0x32')](_0x225d4f[_0xc2bf('0x2f')],_0x225d4f[_0xc2bf('0x30')]);_0x1ed111[_0xc2bf('0x33')]=_['intersection'](_0x225d4f[_0xc2bf('0x2f')],qs['fields'](_0x4d0e38[_0xc2bf('0x30')][_0xc2bf('0x34')]));_0x1ed111['attributes']=_0x1ed111[_0xc2bf('0x33')][_0xc2bf('0x35')]?_0x1ed111[_0xc2bf('0x33')]:_0x225d4f[_0xc2bf('0x2f')];if(_0x4d0e38[_0xc2bf('0x30')][_0xc2bf('0x40')]){_0x1ed111[_0xc2bf('0x46')]=[{'all':!![]}];}_0x1ed111=_['merge']({},_0x1ed111,_0x4d0e38[_0xc2bf('0x47')]);return db[_0xc2bf('0x2b')]['find'](_0x1ed111)[_0xc2bf('0x24')](handleEntityNotFound(_0xa75a5f,null))[_0xc2bf('0x24')](respondWithResult(_0xa75a5f,null))[_0xc2bf('0x43')](handleError(_0xa75a5f,null));};exports[_0xc2bf('0x48')]=function(_0x647ab9,_0x2010cc){return db[_0xc2bf('0x2b')][_0xc2bf('0x48')](_0x647ab9[_0xc2bf('0x49')],{})[_0xc2bf('0x24')](respondWithResult(_0x2010cc,0xc9))[_0xc2bf('0x43')](handleError(_0x2010cc,null));};exports[_0xc2bf('0x4a')]=function(_0x18f258,_0x2fbc1a){if(_0x18f258['body']['id']){delete _0x18f258[_0xc2bf('0x49')]['id'];}return db['DeskAccount'][_0xc2bf('0x4b')]({'where':{'id':_0x18f258['params']['id']}})[_0xc2bf('0x24')](handleEntityNotFound(_0x2fbc1a,null))[_0xc2bf('0x24')](saveUpdates(_0x18f258[_0xc2bf('0x49')],null))[_0xc2bf('0x24')](respondWithResult(_0x2fbc1a,null))[_0xc2bf('0x43')](handleError(_0x2fbc1a,null));};exports[_0xc2bf('0x25')]=function(_0x1ce623,_0x1b40e0){return db[_0xc2bf('0x2b')][_0xc2bf('0x4b')]({'where':{'id':_0x1ce623[_0xc2bf('0x45')]['id']}})[_0xc2bf('0x24')](handleEntityNotFound(_0x1b40e0,null))[_0xc2bf('0x24')](removeEntity(_0x1b40e0,null))[_0xc2bf('0x43')](handleError(_0x1b40e0,null));};exports['getConfigurations']=function(_0x50a814,_0x44a9f7,_0x283a6e){var _0x172a3a={};var _0x44b450={};var _0x4ebf51;var _0x182674;return db[_0xc2bf('0x2b')]['findOne']({'where':{'id':_0x50a814[_0xc2bf('0x45')]['id']}})[_0xc2bf('0x24')](handleEntityNotFound(_0x44a9f7,null))['then'](function(_0x442e0c){if(_0x442e0c){_0x4ebf51=_0x442e0c;_0x44b450[_0xc2bf('0x2f')]=_[_0xc2bf('0x31')](db['DeskConfiguration']['rawAttributes']);_0x44b450[_0xc2bf('0x30')]=_[_0xc2bf('0x31')](_0x50a814[_0xc2bf('0x30')]);_0x44b450[_0xc2bf('0x3b')]=_[_0xc2bf('0x32')](_0x44b450[_0xc2bf('0x2f')],_0x44b450['query']);_0x172a3a[_0xc2bf('0x33')]=_[_0xc2bf('0x32')](_0x44b450[_0xc2bf('0x2f')],qs['fields'](_0x50a814[_0xc2bf('0x30')][_0xc2bf('0x34')]));_0x172a3a[_0xc2bf('0x33')]=_0x172a3a[_0xc2bf('0x33')][_0xc2bf('0x35')]?_0x172a3a['attributes']:_0x44b450[_0xc2bf('0x2f')];_0x172a3a[_0xc2bf('0x38')]=qs[_0xc2bf('0x39')](_0x50a814[_0xc2bf('0x30')]['sort']);_0x172a3a[_0xc2bf('0x3a')]=qs[_0xc2bf('0x3b')](_[_0xc2bf('0x4c')](_0x50a814[_0xc2bf('0x30')],_0x44b450[_0xc2bf('0x3b')]));if(_0x50a814[_0xc2bf('0x30')][_0xc2bf('0x3f')]){_0x172a3a[_0xc2bf('0x3a')]=_['merge'](_0x172a3a[_0xc2bf('0x3a')],{'$or':_[_0xc2bf('0x2a')](_0x172a3a[_0xc2bf('0x33')],function(_0x3b97ec){var _0x3ef371={};_0x3ef371[_0x3b97ec]={'$like':'%'+_0x50a814[_0xc2bf('0x30')][_0xc2bf('0x3f')]+'%'};return _0x3ef371;})});}_0x172a3a=_[_0xc2bf('0x3c')]({},_0x172a3a,_0x50a814[_0xc2bf('0x47')]);return _0x4ebf51[_0xc2bf('0x4d')](_0x172a3a);}})[_0xc2bf('0x24')](function(_0x2e28f1){if(_0x2e28f1){_0x182674=_0x2e28f1[_0xc2bf('0x35')];if(!_0x50a814[_0xc2bf('0x30')]['hasOwnProperty']('nolimit')){_0x172a3a[_0xc2bf('0x1e')]=qs[_0xc2bf('0x1e')](_0x50a814['query'][_0xc2bf('0x1e')]);_0x172a3a[_0xc2bf('0x1d')]=qs['offset'](_0x50a814[_0xc2bf('0x30')][_0xc2bf('0x1d')]);}return _0x4ebf51[_0xc2bf('0x4d')](_0x172a3a);}})[_0xc2bf('0x24')](function(_0x272df6){if(_0x272df6){return _0x272df6?{'count':_0x182674,'rows':_0x272df6}:null;}})[_0xc2bf('0x24')](respondWithResult(_0x44a9f7,null))[_0xc2bf('0x43')](handleError(_0x44a9f7,null));};exports['addConfiguration']=function(_0xbc9a32,_0x3048a4,_0x95d47a){if(_0xbc9a32[_0xc2bf('0x49')]['id']){delete _0xbc9a32[_0xc2bf('0x49')]['id'];}return db[_0xc2bf('0x2b')][_0xc2bf('0x4e')]({'where':{'id':_0xbc9a32[_0xc2bf('0x45')]['id']}})[_0xc2bf('0x24')](handleEntityNotFound(_0x3048a4,null))['then'](function(_0x56769c){if(_0x56769c){_0xbc9a32['body']['AccountId']=_0x56769c['id'];_0xbc9a32[_0xc2bf('0x49')]['Subjects']=integrations[_0xc2bf('0x4f')](_0xbc9a32[_0xc2bf('0x49')][_0xc2bf('0x50')],_0xbc9a32[_0xc2bf('0x49')][_0xc2bf('0x3d')]);_0xbc9a32['body']['Descriptions']=integrations[_0xc2bf('0x51')](_0xbc9a32[_0xc2bf('0x49')][_0xc2bf('0x50')],_0xbc9a32[_0xc2bf('0x49')][_0xc2bf('0x3d')]);return db[_0xc2bf('0x52')]['create'](_0xbc9a32['body'],{'include':[{'model':db[_0xc2bf('0x53')],'as':_0xc2bf('0x54')},{'model':db[_0xc2bf('0x53')],'as':_0xc2bf('0x55')}]});}return null;})[_0xc2bf('0x24')](respondWithResult(_0x3048a4,null))[_0xc2bf('0x43')](handleError(_0x3048a4,null));};exports[_0xc2bf('0x56')]=function(_0x2207ee,_0x2c76a1,_0x458030){var _0x41e182=[{'name':_0xc2bf('0x57'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x386dcc='';return db[_0xc2bf('0x2b')]['findOne']({'where':{'id':_0x2207ee[_0xc2bf('0x45')]['id']},'attributes':['id',_0xc2bf('0x58'),'authType',_0xc2bf('0x59'),_0xc2bf('0x5a'),_0xc2bf('0x5b'),'consumerSecret',_0xc2bf('0x5c'),_0xc2bf('0x5d')]})[_0xc2bf('0x24')](handleEntityNotFound(_0x2c76a1,null))[_0xc2bf('0x24')](function(_0x17f24a){if(_0x17f24a){_0x386dcc=_0x17f24a['remoteUri'];var _0x4a1836=_0x386dcc['slice'](-0x1);if(_0x4a1836==='/'){_0x386dcc=_0x386dcc['substring'](0x0,_0x386dcc[_0xc2bf('0x5e')](_0x4a1836));}var _0x3b4d44={'method':_0xc2bf('0x5f'),'uri':util[_0xc2bf('0x60')]('%s/custom_fields',_0x386dcc),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x17f24a[_0xc2bf('0x61')]===_0xc2bf('0x62')){_0x3b4d44[_0xc2bf('0x63')][_0xc2bf('0x64')]=util[_0xc2bf('0x60')]('Basic\x20%s',new Buffer(util[_0xc2bf('0x60')](_0xc2bf('0x65'),_0x17f24a[_0xc2bf('0x59')],_0x17f24a[_0xc2bf('0x5a')]))['toString']('base64'));}return rp(_0x3b4d44)[_0xc2bf('0x24')](function(_0x55c7fc){return _0x41e182[_0xc2bf('0x66')](_[_0xc2bf('0x2a')](_0x55c7fc[_0xc2bf('0x67')]['entries'],function(_0x229b0d){return{'id':_0x229b0d[_0xc2bf('0x28')],'name':_0x229b0d[_0xc2bf('0x28')],'type':_0x229b0d[_0xc2bf('0x3d')],'active':_0x229b0d['active'],'label':_0x229b0d[_0xc2bf('0x68')],'custom':!![]};}));});}})['then'](function(_0x1e615b){return{'count':_0x1e615b[_0xc2bf('0x35')],'rows':_0x1e615b};})['then'](respondWithResult(_0x2c76a1,null))[_0xc2bf('0x43')](function(_0x1312b3){var _0x2a1608=_0x2207ee['query']['test']?0x1f4:_0x1312b3['statusCode']||0x1f4;logger[_0xc2bf('0x69')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2a1608,JSON[_0xc2bf('0x6a')](_0x1312b3));delete _0x1312b3['name'];if(_0x2a1608===0x191){_0x2a1608=0x190;}_0x2c76a1[_0xc2bf('0x1b')](_0x2a1608)[_0xc2bf('0x29')](_0x2207ee[_0xc2bf('0x30')][_0xc2bf('0x6b')]?{'message':_0xc2bf('0x6c'),'statusCode':_0x1312b3[_0xc2bf('0x6d')]}:_0x1312b3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index cbf6716..ea8ba00 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 _0x95ba=['../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0xaf662b,_0x496ede){var _0x34104e=function(_0x4ebb1b){while(--_0x4ebb1b){_0xaf662b['push'](_0xaf662b['shift']());}};_0x34104e(++_0x496ede);}(_0x95ba,0x1a9));var _0xa95b=function(_0x1790f3,_0x527f3d){_0x1790f3=_0x1790f3-0x0;var _0x386b9d=_0x95ba[_0x1790f3];return _0x386b9d;};'use strict';var _=require(_0xa95b('0x0'));var util=require(_0xa95b('0x1'));var logger=require(_0xa95b('0x2'))(_0xa95b('0x3'));var moment=require('moment');var BPromise=require(_0xa95b('0x4'));var rp=require(_0xa95b('0x5'));var fs=require('fs');var path=require(_0xa95b('0x6'));var rimraf=require(_0xa95b('0x7'));var config=require(_0xa95b('0x8'));var attributes=require(_0xa95b('0x9'));var integrations=require(_0xa95b('0xa'));module[_0xa95b('0xb')]=function(_0x249976,_0x1bf360){return _0x249976[_0xa95b('0xc')](_0xa95b('0xd'),attributes,{'tableName':_0xa95b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6392=['lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','DeskAccount','int_desk_accounts'];(function(_0x28b3f1,_0x1dbe9a){var _0x1f9d4d=function(_0x4379b0){while(--_0x4379b0){_0x28b3f1['push'](_0x28b3f1['shift']());}};_0x1f9d4d(++_0x1dbe9a);}(_0x6392,0x1ce));var _0x2639=function(_0x39dbcb,_0x4f63d7){_0x39dbcb=_0x39dbcb-0x0;var _0x5aadb2=_0x6392[_0x39dbcb];return _0x5aadb2;};'use strict';var _=require(_0x2639('0x0'));var util=require('util');var logger=require(_0x2639('0x1'))(_0x2639('0x2'));var moment=require('moment');var BPromise=require(_0x2639('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2639('0x4'));var rimraf=require(_0x2639('0x5'));var config=require(_0x2639('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x2639('0x7')]=function(_0x4072ef,_0x14afcc){return _0x4072ef[_0x2639('0x8')](_0x2639('0x9'),attributes,{'tableName':_0x2639('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index ea3016b..f1b5b46 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 _0xc75e=['include','map','model','GetDeskAccount','catch','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','DeskAccount','findAll','options','where','attributes','limit'];(function(_0x2ed429,_0x66b75a){var _0x18a52c=function(_0x463aef){while(--_0x463aef){_0x2ed429['push'](_0x2ed429['shift']());}};_0x18a52c(++_0x66b75a);}(_0xc75e,0x17c));var _0xec75=function(_0x1ed99b,_0x2e0fbd){_0x1ed99b=_0x1ed99b-0x0;var _0x1ac199=_0xc75e[_0x1ed99b];return _0x1ac199;};'use strict';var _=require(_0xec75('0x0'));var util=require(_0xec75('0x1'));var moment=require(_0xec75('0x2'));var BPromise=require(_0xec75('0x3'));var rs=require(_0xec75('0x4'));var fs=require('fs');var Redis=require(_0xec75('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec75('0x6'));var logger=require(_0xec75('0x7'))(_0xec75('0x8'));var config=require(_0xec75('0x9'));var jayson=require(_0xec75('0xa'));var client=jayson['client'][_0xec75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f1110,_0xb6d201,_0xf0da77){return new BPromise(function(_0xfadbbc,_0xcf8077){return client['request'](_0x1f1110,_0xf0da77)[_0xec75('0xc')](function(_0x545048){logger[_0xec75('0xd')](_0xec75('0xe'),_0xb6d201,_0xec75('0xf'));logger[_0xec75('0x10')](_0xec75('0x11'),_0xb6d201,_0xec75('0xf'),JSON[_0xec75('0x12')](_0x545048));if(_0x545048['error']){if(_0x545048[_0xec75('0x13')]['code']===0x1f4){logger[_0xec75('0x13')](_0xec75('0xe'),_0xb6d201,_0x545048['error'][_0xec75('0x14')]);return _0xcf8077(_0x545048[_0xec75('0x13')][_0xec75('0x14')]);}logger['error'](_0xec75('0xe'),_0xb6d201,_0x545048[_0xec75('0x13')][_0xec75('0x14')]);return _0xfadbbc(_0x545048[_0xec75('0x13')][_0xec75('0x14')]);}else{logger[_0xec75('0xd')](_0xec75('0xe'),_0xb6d201,_0xec75('0xf'));_0xfadbbc(_0x545048[_0xec75('0x15')][_0xec75('0x14')]);}})['catch'](function(_0x4cfb68){logger[_0xec75('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb6d201,_0x4cfb68);_0xcf8077(_0x4cfb68);});});}exports['GetDeskAccount']=function(_0x3a9916){var _0x20ab84=this;return new Promise(function(_0x33e96e,_0x4f91c7){return db[_0xec75('0x16')][_0xec75('0x17')]({'raw':_0x3a9916[_0xec75('0x18')]?_0x3a9916[_0xec75('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3a9916[_0xec75('0x18')]?_0x3a9916['options'][_0xec75('0x19')]||null:null,'attributes':_0x3a9916[_0xec75('0x18')]?_0x3a9916[_0xec75('0x18')][_0xec75('0x1a')]||null:null,'limit':_0x3a9916[_0xec75('0x18')]?_0x3a9916[_0xec75('0x18')][_0xec75('0x1b')]||null:null,'include':_0x3a9916[_0xec75('0x18')]?_0x3a9916['options'][_0xec75('0x1c')]?_[_0xec75('0x1d')](_0x3a9916[_0xec75('0x18')][_0xec75('0x1c')],function(_0x1a3a21){return{'model':db[_0x1a3a21[_0xec75('0x1e')]],'as':_0x1a3a21['as'],'attributes':_0x1a3a21[_0xec75('0x1a')],'include':_0x1a3a21[_0xec75('0x1c')]?_[_0xec75('0x1d')](_0x1a3a21[_0xec75('0x1c')],function(_0x4e3308){return{'model':db[_0x4e3308[_0xec75('0x1e')]],'as':_0x4e3308['as'],'attributes':_0x4e3308[_0xec75('0x1a')],'include':_0x4e3308[_0xec75('0x1c')]?_[_0xec75('0x1d')](_0x4e3308[_0xec75('0x1c')],function(_0x2c2fe7){return{'model':db[_0x2c2fe7[_0xec75('0x1e')]],'as':_0x2c2fe7['as'],'attributes':_0x2c2fe7[_0xec75('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xec75('0xc')](function(_0x771bc){logger[_0xec75('0xd')](_0xec75('0x1f'),_0x3a9916);logger['debug'](_0xec75('0x1f'),_0x3a9916,JSON[_0xec75('0x12')](_0x771bc));_0x33e96e(_0x771bc);})[_0xec75('0x20')](function(_0x2e73dc){logger['error']('GetDeskAccount',_0x2e73dc[_0xec75('0x14')],_0x3a9916);_0x4f91c7(_0x20ab84[_0xec75('0x13')](0x1f4,_0x2e73dc[_0xec75('0x14')]));});});};exports[_0xec75('0x21')]=function(_0x37eac4){var _0x1ca47c=this;return new Promise(function(_0x307a11,_0x93500a){return db[_0xec75('0x16')]['find']({'raw':_0x37eac4[_0xec75('0x18')]?_0x37eac4['options']['raw']===undefined?!![]:![]:!![],'where':_0x37eac4['options']?_0x37eac4[_0xec75('0x18')][_0xec75('0x19')]||null:null,'attributes':_0x37eac4[_0xec75('0x18')]?_0x37eac4[_0xec75('0x18')][_0xec75('0x1a')]||null:null,'include':_0x37eac4[_0xec75('0x18')]?_0x37eac4['options'][_0xec75('0x1c')]?_['map'](_0x37eac4['options']['include'],function(_0x3285c7){return{'model':db[_0x3285c7['model']],'as':_0x3285c7['as'],'attributes':_0x3285c7['attributes'],'include':_0x3285c7[_0xec75('0x1c')]?_['map'](_0x3285c7[_0xec75('0x1c')],function(_0x5523f4){return{'model':db[_0x5523f4['model']],'as':_0x5523f4['as'],'attributes':_0x5523f4['attributes'],'include':_0x5523f4[_0xec75('0x1c')]?_['map'](_0x5523f4[_0xec75('0x1c')],function(_0x896f5a){return{'model':db[_0x896f5a['model']],'as':_0x896f5a['as'],'attributes':_0x896f5a[_0xec75('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ce1ce){logger[_0xec75('0xd')]('ShowDeskAccount',_0x37eac4);logger['debug']('ShowDeskAccount',_0x37eac4,JSON['stringify'](_0x3ce1ce));_0x307a11(_0x3ce1ce);})['catch'](function(_0x1676dc){logger['error'](_0xec75('0x21'),_0x1676dc[_0xec75('0x14')],_0x37eac4);_0x93500a(_0x1ca47c[_0xec75('0x13')](0x1f4,_0x1676dc['message']));});});}; \ No newline at end of file +var _0x1abd=['request\x20sent','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowDeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x138d2c,_0x2abba6){var _0xacae0d=function(_0x4fcfd2){while(--_0x4fcfd2){_0x138d2c['push'](_0x138d2c['shift']());}};_0xacae0d(++_0x2abba6);}(_0x1abd,0x1bf));var _0xd1ab=function(_0x42b8f5,_0x4b9730){_0x42b8f5=_0x42b8f5-0x0;var _0x31ca50=_0x1abd[_0x42b8f5];return _0x31ca50;};'use strict';var _=require(_0xd1ab('0x0'));var util=require(_0xd1ab('0x1'));var moment=require(_0xd1ab('0x2'));var BPromise=require(_0xd1ab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1ab('0x4'));var db=require(_0xd1ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1ab('0x6'))(_0xd1ab('0x7'));var config=require(_0xd1ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd1ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5321fb,_0x1679a9,_0x170f45){return new BPromise(function(_0x18a5a4,_0x447cd0){return client[_0xd1ab('0xa')](_0x5321fb,_0x170f45)['then'](function(_0x4aa106){logger[_0xd1ab('0xb')](_0xd1ab('0xc'),_0x1679a9,'request\x20sent');logger[_0xd1ab('0xd')](_0xd1ab('0xe'),_0x1679a9,_0xd1ab('0xf'),JSON[_0xd1ab('0x10')](_0x4aa106));if(_0x4aa106[_0xd1ab('0x11')]){if(_0x4aa106[_0xd1ab('0x11')][_0xd1ab('0x12')]===0x1f4){logger[_0xd1ab('0x11')]('DeskAccount,\x20%s,\x20%s',_0x1679a9,_0x4aa106['error'][_0xd1ab('0x13')]);return _0x447cd0(_0x4aa106['error'][_0xd1ab('0x13')]);}logger[_0xd1ab('0x11')](_0xd1ab('0xc'),_0x1679a9,_0x4aa106['error'][_0xd1ab('0x13')]);return _0x18a5a4(_0x4aa106[_0xd1ab('0x11')][_0xd1ab('0x13')]);}else{logger[_0xd1ab('0xb')](_0xd1ab('0xc'),_0x1679a9,_0xd1ab('0xf'));_0x18a5a4(_0x4aa106['result'][_0xd1ab('0x13')]);}})[_0xd1ab('0x14')](function(_0x5972f8){logger[_0xd1ab('0x11')](_0xd1ab('0xc'),_0x1679a9,_0x5972f8);_0x447cd0(_0x5972f8);});});}exports[_0xd1ab('0x15')]=function(_0x23d3d6){var _0x5af82b=this;return new Promise(function(_0x4e46cc,_0x1fcce4){return db[_0xd1ab('0x16')][_0xd1ab('0x17')]({'raw':_0x23d3d6['options']?_0x23d3d6[_0xd1ab('0x18')][_0xd1ab('0x19')]===undefined?!![]:![]:!![],'where':_0x23d3d6['options']?_0x23d3d6[_0xd1ab('0x18')][_0xd1ab('0x1a')]||null:null,'attributes':_0x23d3d6[_0xd1ab('0x18')]?_0x23d3d6[_0xd1ab('0x18')][_0xd1ab('0x1b')]||null:null,'limit':_0x23d3d6['options']?_0x23d3d6[_0xd1ab('0x18')]['limit']||null:null,'include':_0x23d3d6[_0xd1ab('0x18')]?_0x23d3d6[_0xd1ab('0x18')][_0xd1ab('0x1c')]?_[_0xd1ab('0x1d')](_0x23d3d6[_0xd1ab('0x18')]['include'],function(_0xedb6b5){return{'model':db[_0xedb6b5['model']],'as':_0xedb6b5['as'],'attributes':_0xedb6b5[_0xd1ab('0x1b')],'include':_0xedb6b5['include']?_[_0xd1ab('0x1d')](_0xedb6b5['include'],function(_0x35c054){return{'model':db[_0x35c054[_0xd1ab('0x1e')]],'as':_0x35c054['as'],'attributes':_0x35c054[_0xd1ab('0x1b')],'include':_0x35c054[_0xd1ab('0x1c')]?_[_0xd1ab('0x1d')](_0x35c054[_0xd1ab('0x1c')],function(_0x16e82f){return{'model':db[_0x16e82f['model']],'as':_0x16e82f['as'],'attributes':_0x16e82f[_0xd1ab('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3eb814){logger[_0xd1ab('0xb')]('GetDeskAccount',_0x23d3d6);logger[_0xd1ab('0xd')](_0xd1ab('0x15'),_0x23d3d6,JSON[_0xd1ab('0x10')](_0x3eb814));_0x4e46cc(_0x3eb814);})[_0xd1ab('0x14')](function(_0x3ecd87){logger['error'](_0xd1ab('0x15'),_0x3ecd87[_0xd1ab('0x13')],_0x23d3d6);_0x1fcce4(_0x5af82b['error'](0x1f4,_0x3ecd87[_0xd1ab('0x13')]));});});};exports['ShowDeskAccount']=function(_0x2f1ead){var _0x580f63=this;return new Promise(function(_0x5887ab,_0x4898a4){return db[_0xd1ab('0x16')]['find']({'raw':_0x2f1ead[_0xd1ab('0x18')]?_0x2f1ead[_0xd1ab('0x18')][_0xd1ab('0x19')]===undefined?!![]:![]:!![],'where':_0x2f1ead[_0xd1ab('0x18')]?_0x2f1ead[_0xd1ab('0x18')]['where']||null:null,'attributes':_0x2f1ead['options']?_0x2f1ead[_0xd1ab('0x18')][_0xd1ab('0x1b')]||null:null,'include':_0x2f1ead['options']?_0x2f1ead[_0xd1ab('0x18')][_0xd1ab('0x1c')]?_[_0xd1ab('0x1d')](_0x2f1ead[_0xd1ab('0x18')]['include'],function(_0x1a0910){return{'model':db[_0x1a0910[_0xd1ab('0x1e')]],'as':_0x1a0910['as'],'attributes':_0x1a0910[_0xd1ab('0x1b')],'include':_0x1a0910[_0xd1ab('0x1c')]?_[_0xd1ab('0x1d')](_0x1a0910[_0xd1ab('0x1c')],function(_0x43f6ee){return{'model':db[_0x43f6ee[_0xd1ab('0x1e')]],'as':_0x43f6ee['as'],'attributes':_0x43f6ee[_0xd1ab('0x1b')],'include':_0x43f6ee[_0xd1ab('0x1c')]?_['map'](_0x43f6ee[_0xd1ab('0x1c')],function(_0x412c9f){return{'model':db[_0x412c9f[_0xd1ab('0x1e')]],'as':_0x412c9f['as'],'attributes':_0x412c9f[_0xd1ab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd1ab('0x1f')](function(_0x4b735a){logger[_0xd1ab('0xb')](_0xd1ab('0x20'),_0x2f1ead);logger[_0xd1ab('0xd')](_0xd1ab('0x20'),_0x2f1ead,JSON['stringify'](_0x4b735a));_0x5887ab(_0x4b735a);})[_0xd1ab('0x14')](function(_0x536988){logger[_0xd1ab('0x11')](_0xd1ab('0x20'),_0x536988['message'],_0x2f1ead);_0x4898a4(_0x580f63[_0xd1ab('0x11')](0x1f4,_0x536988[_0xd1ab('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5a625d3..8f14086 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d8132,_0x47eca8){var _0x5bf0ca=function(_0x46f66c){while(--_0x46f66c){_0x4d8132['push'](_0x4d8132['shift']());}};_0x5bf0ca(++_0x47eca8);}(_0x008c,0x188));var _0xc008=function(_0x3ffb80,_0x209661){_0x3ffb80=_0x3ffb80-0x0;var _0x3a8a4c=_0x008c[_0x3ffb80];return _0x3a8a4c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x47c902,_0x220fd2){var _0x1ad6a0=function(_0xf9fdb0){while(--_0xf9fdb0){_0x47c902['push'](_0x47c902['shift']());}};_0x1ad6a0(++_0x220fd2);}(_0x55ca,0x126));var _0xa55c=function(_0x2577f7,_0x4e4781){_0x2577f7=_0x2577f7-0x0;var _0x55d372=_0x55ca[_0x2577f7];return _0x55d372;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index aaa95e4..3891832 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 _0xc063=['STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc063,0x6b));var _0x3c06=function(_0x1dee0c,_0x13b016){_0x1dee0c=_0x1dee0c-0x0;var _0x12d97e=_0xc063[_0x1dee0c];return _0x12d97e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3c06('0x0')]}}; \ No newline at end of file +var _0xd6ee=['sequelize','exports','STRING'];(function(_0x367bad,_0x1eea19){var _0x3a99d3=function(_0x403c33){while(--_0x403c33){_0x367bad['push'](_0x367bad['shift']());}};_0x3a99d3(++_0x1eea19);}(_0xd6ee,0xf3));var _0xed6e=function(_0x1a73aa,_0x14decd){_0x1a73aa=_0x1a73aa-0x0;var _0x14b82b=_0xd6ee[_0x1a73aa];return _0x14b82b;};'use strict';var Sequelize=require(_0xed6e('0x0'));module[_0xed6e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xed6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 41b6ad1..b038f27 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 _0x18bd=['destroy','then','end','error','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','keys','length','includeAll','options','find','create','catch','body','params','getFields','DeskField','order','sort','nolimit','findOne','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','reject','update'];(function(_0x3b2bf3,_0x35a6c6){var _0x470b7e=function(_0x3081e){while(--_0x3081e){_0x3b2bf3['push'](_0x3b2bf3['shift']());}};_0x470b7e(++_0x35a6c6);}(_0x18bd,0x7b));var _0xd18b=function(_0xb9ca38,_0x2e9368){_0xb9ca38=_0xb9ca38-0x0;var _0x54663f=_0x18bd[_0xb9ca38];return _0x54663f;};'use strict';var emlformat=require(_0xd18b('0x0'));var rimraf=require(_0xd18b('0x1'));var zipdir=require(_0xd18b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd18b('0x3'));var Mustache=require(_0xd18b('0x4'));var util=require(_0xd18b('0x5'));var path=require(_0xd18b('0x6'));var sox=require('sox');var csv=require(_0xd18b('0x7'));var ejs=require(_0xd18b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd18b('0x9'));var squel=require(_0xd18b('0xa'));var crypto=require(_0xd18b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd18b('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xd18b('0xd'));var hardwareService=require(_0xd18b('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd18b('0xf'));var licenseUtil=require(_0xd18b('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bcf13,_0x418b35){_0x418b35=_0x418b35||0xcc;return function(_0x2ec544){if(_0x2ec544){return _0x3bcf13[_0xd18b('0x11')](_0x418b35);}return _0x3bcf13[_0xd18b('0x12')](_0x418b35)['end']();};}function respondWithResult(_0x577d0c,_0x3967b0){_0x3967b0=_0x3967b0||0xc8;return function(_0xe90964){if(_0xe90964){return _0x577d0c['status'](_0x3967b0)[_0xd18b('0x13')](_0xe90964);}};}function respondWithFilteredResult(_0x2f0dd8,_0x235f6c){return function(_0x2df45f){if(_0x2df45f){var _0x1a5133=typeof _0x235f6c[_0xd18b('0x14')]==='undefined'&&typeof _0x235f6c[_0xd18b('0x15')]===_0xd18b('0x16');var _0x47a8a0=_0x2df45f[_0xd18b('0x17')];var _0x3a83b0=_0x1a5133?0x0:_0x235f6c[_0xd18b('0x14')];var _0x1704bf=_0x1a5133?_0x2df45f[_0xd18b('0x17')]:_0x235f6c[_0xd18b('0x14')]+_0x235f6c[_0xd18b('0x15')];var _0x4c4af3;if(_0x1704bf>=_0x47a8a0){_0x1704bf=_0x47a8a0;_0x4c4af3=0xc8;}else{_0x4c4af3=0xce;}_0x2f0dd8['status'](_0x4c4af3);return _0x2f0dd8[_0xd18b('0x18')]('Content-Range',_0x3a83b0+'-'+_0x1704bf+'/'+_0x47a8a0)[_0xd18b('0x13')](_0x2df45f);}return null;};}function patchUpdates(_0x4f9039){return function(_0x1e17d5){try{jsonpatch['apply'](_0x1e17d5,_0x4f9039,!![]);}catch(_0x269809){return BPromise[_0xd18b('0x19')](_0x269809);}return _0x1e17d5['save']();};}function saveUpdates(_0x270455,_0x289500){return function(_0x4a2567){if(_0x4a2567){return _0x4a2567[_0xd18b('0x1a')](_0x270455)['then'](function(_0x4fbaf8){return _0x4fbaf8;});}return null;};}function removeEntity(_0x27009c,_0xce0de1){return function(_0x25a426){if(_0x25a426){return _0x25a426[_0xd18b('0x1b')]()[_0xd18b('0x1c')](function(){_0x27009c[_0xd18b('0x12')](0xcc)[_0xd18b('0x1d')]();});}};}function handleEntityNotFound(_0x2b870c,_0x1c4ca9){return function(_0xd9471f){if(!_0xd9471f){_0x2b870c[_0xd18b('0x11')](0x194);}return _0xd9471f;};}function handleError(_0x42fd94,_0x2c4b01){_0x2c4b01=_0x2c4b01||0x1f4;return function(_0x3f695e){logger[_0xd18b('0x1e')](_0x3f695e['stack']);if(_0x3f695e[_0xd18b('0x1f')]){delete _0x3f695e[_0xd18b('0x1f')];}_0x42fd94['status'](_0x2c4b01)[_0xd18b('0x20')](_0x3f695e);};}exports[_0xd18b('0x21')]=function(_0x9d386b,_0x34bab6){var _0xc34b0e={},_0x507e7e={},_0x53f11d={'count':0x0,'rows':[]};var _0x32822c=_[_0xd18b('0x22')](db[_0xd18b('0x23')][_0xd18b('0x24')],function(_0x14c5dd){return{'name':_0x14c5dd[_0xd18b('0x25')],'type':_0x14c5dd[_0xd18b('0x26')][_0xd18b('0x27')]};});_0x507e7e[_0xd18b('0x28')]=_[_0xd18b('0x22')](_0x32822c,_0xd18b('0x1f'));_0x507e7e[_0xd18b('0x29')]=_['keys'](_0x9d386b[_0xd18b('0x29')]);_0x507e7e['filters']=_[_0xd18b('0x2a')](_0x507e7e['model'],_0x507e7e[_0xd18b('0x29')]);_0xc34b0e[_0xd18b('0x2b')]=_['intersection'](_0x507e7e[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0x9d386b[_0xd18b('0x29')][_0xd18b('0x2c')]));_0xc34b0e[_0xd18b('0x2b')]=_0xc34b0e[_0xd18b('0x2b')]['length']?_0xc34b0e[_0xd18b('0x2b')]:_0x507e7e['model'];if(!_0x9d386b['query'][_0xd18b('0x2d')]('nolimit')){_0xc34b0e['limit']=qs[_0xd18b('0x15')](_0x9d386b[_0xd18b('0x29')][_0xd18b('0x15')]);_0xc34b0e['offset']=qs['offset'](_0x9d386b[_0xd18b('0x29')][_0xd18b('0x14')]);}_0xc34b0e['order']=qs['sort'](_0x9d386b[_0xd18b('0x29')]['sort']);_0xc34b0e[_0xd18b('0x2e')]=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x9d386b[_0xd18b('0x29')],_0x507e7e['filters']),_0x32822c);if(_0x9d386b[_0xd18b('0x29')][_0xd18b('0x31')]){_0xc34b0e['where']=_[_0xd18b('0x32')](_0xc34b0e['where'],{'$or':_[_0xd18b('0x22')](_0x32822c,function(_0x53baef){if(_0x53baef[_0xd18b('0x26')]!==_0xd18b('0x33')){var _0x2b78b6={};_0x2b78b6[_0x53baef[_0xd18b('0x1f')]]={'$like':'%'+_0x9d386b[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x2b78b6;}})});}_0xc34b0e=_[_0xd18b('0x32')]({},_0xc34b0e,_0x9d386b['options']);var _0x18ac35={'where':_0xc34b0e[_0xd18b('0x2e')]};return db['DeskConfiguration'][_0xd18b('0x17')](_0x18ac35)['then'](function(_0x9f5474){_0x53f11d[_0xd18b('0x17')]=_0x9f5474;if(_0x9d386b[_0xd18b('0x29')]['includeAll']){_0xc34b0e[_0xd18b('0x34')]=[{'all':!![]}];}return db[_0xd18b('0x23')][_0xd18b('0x35')](_0xc34b0e);})[_0xd18b('0x1c')](function(_0x39f307){_0x53f11d[_0xd18b('0x36')]=_0x39f307;return _0x53f11d;})[_0xd18b('0x1c')](respondWithFilteredResult(_0x34bab6,_0xc34b0e))['catch'](handleError(_0x34bab6,null));};exports[_0xd18b('0x37')]=function(_0x5933bf,_0x25494c){var _0x5d8bb7={'raw':![],'where':{'id':_0x5933bf['params']['id']}},_0xf09a44={};_0xf09a44[_0xd18b('0x28')]=_[_0xd18b('0x38')](db[_0xd18b('0x23')][_0xd18b('0x24')]);_0xf09a44[_0xd18b('0x29')]=_['keys'](_0x5933bf['query']);_0xf09a44[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0xf09a44[_0xd18b('0x28')],_0xf09a44[_0xd18b('0x29')]);_0x5d8bb7['attributes']=_['intersection'](_0xf09a44[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0x5933bf[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x5d8bb7[_0xd18b('0x2b')]=_0x5d8bb7[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x5d8bb7[_0xd18b('0x2b')]:_0xf09a44[_0xd18b('0x28')];if(_0x5933bf[_0xd18b('0x29')][_0xd18b('0x3a')]){_0x5d8bb7[_0xd18b('0x34')]=[{'all':!![]}];}_0x5d8bb7=_[_0xd18b('0x32')]({},_0x5d8bb7,_0x5933bf[_0xd18b('0x3b')]);return db['DeskConfiguration'][_0xd18b('0x3c')](_0x5d8bb7)[_0xd18b('0x1c')](handleEntityNotFound(_0x25494c,null))['then'](respondWithResult(_0x25494c,null))['catch'](handleError(_0x25494c,null));};exports['create']=function(_0x261826,_0x480614){return db[_0xd18b('0x23')][_0xd18b('0x3d')](_0x261826['body'],{})[_0xd18b('0x1c')](respondWithResult(_0x480614,0xc9))[_0xd18b('0x3e')](handleError(_0x480614,null));};exports[_0xd18b('0x1a')]=function(_0x4e9da9,_0x2996c5){if(_0x4e9da9['body']['id']){delete _0x4e9da9[_0xd18b('0x3f')]['id'];}return db[_0xd18b('0x23')][_0xd18b('0x3c')]({'where':{'id':_0x4e9da9[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x2996c5,null))[_0xd18b('0x1c')](saveUpdates(_0x4e9da9[_0xd18b('0x3f')],null))[_0xd18b('0x1c')](respondWithResult(_0x2996c5,null))[_0xd18b('0x3e')](handleError(_0x2996c5,null));};exports[_0xd18b('0x1b')]=function(_0x15c428,_0x53eb60){return db['DeskConfiguration'][_0xd18b('0x3c')]({'where':{'id':_0x15c428[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x53eb60,null))[_0xd18b('0x1c')](removeEntity(_0x53eb60,null))[_0xd18b('0x3e')](handleError(_0x53eb60,null));};exports[_0xd18b('0x41')]=function(_0x36932d,_0x289740,_0x31dd7c){var _0x5b66d1={};var _0x750608={};var _0x497449;var _0x5120a7;return db[_0xd18b('0x23')]['findOne']({'where':{'id':_0x36932d['params']['id']}})['then'](handleEntityNotFound(_0x289740,null))['then'](function(_0xb38531){if(_0xb38531){_0x497449=_0xb38531;_0x750608['model']=_['keys'](db[_0xd18b('0x42')][_0xd18b('0x24')]);_0x750608[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0x36932d[_0xd18b('0x29')]);_0x750608[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0x750608['model'],_0x750608['query']);_0x5b66d1[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x750608['model'],qs[_0xd18b('0x2c')](_0x36932d[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x5b66d1['attributes']=_0x5b66d1[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x5b66d1['attributes']:_0x750608[_0xd18b('0x28')];_0x5b66d1[_0xd18b('0x43')]=qs[_0xd18b('0x44')](_0x36932d[_0xd18b('0x29')]['sort']);_0x5b66d1['where']=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x36932d[_0xd18b('0x29')],_0x750608['filters']));if(_0x36932d['query'][_0xd18b('0x31')]){_0x5b66d1[_0xd18b('0x2e')]=_['merge'](_0x5b66d1['where'],{'$or':_['map'](_0x5b66d1[_0xd18b('0x2b')],function(_0x2af025){var _0x4bd947={};_0x4bd947[_0x2af025]={'$like':'%'+_0x36932d[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x4bd947;})});}_0x5b66d1=_[_0xd18b('0x32')]({},_0x5b66d1,_0x36932d[_0xd18b('0x3b')]);return _0x497449[_0xd18b('0x41')](_0x5b66d1);}})['then'](function(_0x476637){if(_0x476637){_0x5120a7=_0x476637['length'];if(!_0x36932d['query'][_0xd18b('0x2d')](_0xd18b('0x45'))){_0x5b66d1[_0xd18b('0x15')]=qs[_0xd18b('0x15')](_0x36932d[_0xd18b('0x29')][_0xd18b('0x15')]);_0x5b66d1[_0xd18b('0x14')]=qs[_0xd18b('0x14')](_0x36932d[_0xd18b('0x29')][_0xd18b('0x14')]);}return _0x497449[_0xd18b('0x41')](_0x5b66d1);}})[_0xd18b('0x1c')](function(_0x3f7b74){if(_0x3f7b74){return _0x3f7b74?{'count':_0x5120a7,'rows':_0x3f7b74}:null;}})['then'](respondWithResult(_0x289740,null))[_0xd18b('0x3e')](handleError(_0x289740,null));};exports['getSubjects']=function(_0x37bada,_0x2b446b,_0x4fe167){var _0x3c55c9={};var _0x29d848={};var _0x308315;var _0x1862b6;return db[_0xd18b('0x23')][_0xd18b('0x46')]({'where':{'id':_0x37bada['params']['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x2b446b,null))[_0xd18b('0x1c')](function(_0x54f5d2){if(_0x54f5d2){_0x308315=_0x54f5d2;_0x29d848['model']=_[_0xd18b('0x38')](db[_0xd18b('0x42')][_0xd18b('0x24')]);_0x29d848[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0x37bada[_0xd18b('0x29')]);_0x29d848[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0x29d848['model'],_0x29d848['query']);_0x3c55c9[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x29d848[_0xd18b('0x28')],qs['fields'](_0x37bada['query'][_0xd18b('0x2c')]));_0x3c55c9['attributes']=_0x3c55c9[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x3c55c9[_0xd18b('0x2b')]:_0x29d848[_0xd18b('0x28')];_0x3c55c9[_0xd18b('0x43')]=qs[_0xd18b('0x44')](_0x37bada[_0xd18b('0x29')][_0xd18b('0x44')]);_0x3c55c9[_0xd18b('0x2e')]=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x37bada[_0xd18b('0x29')],_0x29d848[_0xd18b('0x2f')]));if(_0x37bada[_0xd18b('0x29')][_0xd18b('0x31')]){_0x3c55c9['where']=_['merge'](_0x3c55c9[_0xd18b('0x2e')],{'$or':_[_0xd18b('0x22')](_0x3c55c9[_0xd18b('0x2b')],function(_0x2f5f9c){var _0x49eca0={};_0x49eca0[_0x2f5f9c]={'$like':'%'+_0x37bada['query'][_0xd18b('0x31')]+'%'};return _0x49eca0;})});}_0x3c55c9=_['merge']({},_0x3c55c9,_0x37bada['options']);return _0x308315['getSubjects'](_0x3c55c9);}})['then'](function(_0x34c0da){if(_0x34c0da){_0x1862b6=_0x34c0da[_0xd18b('0x39')];if(!_0x37bada[_0xd18b('0x29')][_0xd18b('0x2d')](_0xd18b('0x45'))){_0x3c55c9['limit']=qs[_0xd18b('0x15')](_0x37bada[_0xd18b('0x29')][_0xd18b('0x15')]);_0x3c55c9[_0xd18b('0x14')]=qs[_0xd18b('0x14')](_0x37bada[_0xd18b('0x29')]['offset']);}return _0x308315['getSubjects'](_0x3c55c9);}})['then'](function(_0x559550){if(_0x559550){return _0x559550?{'count':_0x1862b6,'rows':_0x559550}:null;}})[_0xd18b('0x1c')](respondWithResult(_0x2b446b,null))[_0xd18b('0x3e')](handleError(_0x2b446b,null));};exports['getDescriptions']=function(_0xd8c507,_0x150a9c,_0x2506f4){var _0x1973a={};var _0x158391={};var _0x1a0bb6;var _0x266529;return db['DeskConfiguration'][_0xd18b('0x46')]({'where':{'id':_0xd8c507[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x150a9c,null))[_0xd18b('0x1c')](function(_0x17cb7e){if(_0x17cb7e){_0x1a0bb6=_0x17cb7e;_0x158391[_0xd18b('0x28')]=_[_0xd18b('0x38')](db[_0xd18b('0x42')][_0xd18b('0x24')]);_0x158391[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0xd8c507[_0xd18b('0x29')]);_0x158391['filters']=_[_0xd18b('0x2a')](_0x158391[_0xd18b('0x28')],_0x158391[_0xd18b('0x29')]);_0x1973a[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x158391[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0xd8c507[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x1973a[_0xd18b('0x2b')]=_0x1973a[_0xd18b('0x2b')]['length']?_0x1973a['attributes']:_0x158391[_0xd18b('0x28')];_0x1973a[_0xd18b('0x43')]=qs['sort'](_0xd8c507['query']['sort']);_0x1973a[_0xd18b('0x2e')]=qs[_0xd18b('0x2f')](_['pick'](_0xd8c507[_0xd18b('0x29')],_0x158391[_0xd18b('0x2f')]));if(_0xd8c507[_0xd18b('0x29')][_0xd18b('0x31')]){_0x1973a[_0xd18b('0x2e')]=_[_0xd18b('0x32')](_0x1973a[_0xd18b('0x2e')],{'$or':_['map'](_0x1973a[_0xd18b('0x2b')],function(_0x1a4683){var _0x46d604={};_0x46d604[_0x1a4683]={'$like':'%'+_0xd8c507[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x46d604;})});}_0x1973a=_[_0xd18b('0x32')]({},_0x1973a,_0xd8c507[_0xd18b('0x3b')]);return _0x1a0bb6[_0xd18b('0x47')](_0x1973a);}})[_0xd18b('0x1c')](function(_0x2bcb9){if(_0x2bcb9){_0x266529=_0x2bcb9[_0xd18b('0x39')];if(!_0xd8c507[_0xd18b('0x29')][_0xd18b('0x2d')](_0xd18b('0x45'))){_0x1973a[_0xd18b('0x15')]=qs[_0xd18b('0x15')](_0xd8c507[_0xd18b('0x29')][_0xd18b('0x15')]);_0x1973a[_0xd18b('0x14')]=qs[_0xd18b('0x14')](_0xd8c507['query'][_0xd18b('0x14')]);}return _0x1a0bb6[_0xd18b('0x47')](_0x1973a);}})[_0xd18b('0x1c')](function(_0x232d72){if(_0x232d72){return _0x232d72?{'count':_0x266529,'rows':_0x232d72}:null;}})[_0xd18b('0x1c')](respondWithResult(_0x150a9c,null))[_0xd18b('0x3e')](handleError(_0x150a9c,null));};exports[_0xd18b('0x48')]=function(_0x1cbdda,_0x50f32a,_0x1d4bd8){var _0x3c1802={};var _0x343fae={};var _0x3f0076;var _0xc88e9f;return db[_0xd18b('0x23')][_0xd18b('0x46')]({'where':{'id':_0x1cbdda['params']['id']}})['then'](handleEntityNotFound(_0x50f32a,null))[_0xd18b('0x1c')](function(_0x2bced2){if(_0x2bced2){_0x3f0076=_0x2bced2;_0x343fae['model']=_['keys'](db[_0xd18b('0x49')][_0xd18b('0x24')]);_0x343fae[_0xd18b('0x29')]=_[_0xd18b('0x38')](_0x1cbdda[_0xd18b('0x29')]);_0x343fae[_0xd18b('0x2f')]=_[_0xd18b('0x2a')](_0x343fae[_0xd18b('0x28')],_0x343fae[_0xd18b('0x29')]);_0x3c1802[_0xd18b('0x2b')]=_[_0xd18b('0x2a')](_0x343fae[_0xd18b('0x28')],qs[_0xd18b('0x2c')](_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x2c')]));_0x3c1802['attributes']=_0x3c1802[_0xd18b('0x2b')][_0xd18b('0x39')]?_0x3c1802[_0xd18b('0x2b')]:_0x343fae[_0xd18b('0x28')];_0x3c1802[_0xd18b('0x43')]=qs[_0xd18b('0x44')](_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x44')]);_0x3c1802['where']=qs[_0xd18b('0x2f')](_[_0xd18b('0x30')](_0x1cbdda[_0xd18b('0x29')],_0x343fae['filters']));if(_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x31')]){_0x3c1802[_0xd18b('0x2e')]=_[_0xd18b('0x32')](_0x3c1802[_0xd18b('0x2e')],{'$or':_[_0xd18b('0x22')](_0x3c1802[_0xd18b('0x2b')],function(_0x5e615a){var _0x47821c={};_0x47821c[_0x5e615a]={'$like':'%'+_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x31')]+'%'};return _0x47821c;})});}_0x3c1802=_['merge']({},_0x3c1802,_0x1cbdda['options']);return _0x3f0076[_0xd18b('0x48')](_0x3c1802);}})[_0xd18b('0x1c')](function(_0x38b61a){if(_0x38b61a){_0xc88e9f=_0x38b61a[_0xd18b('0x39')];if(!_0x1cbdda[_0xd18b('0x29')]['hasOwnProperty'](_0xd18b('0x45'))){_0x3c1802[_0xd18b('0x15')]=qs[_0xd18b('0x15')](_0x1cbdda['query'][_0xd18b('0x15')]);_0x3c1802['offset']=qs[_0xd18b('0x14')](_0x1cbdda[_0xd18b('0x29')][_0xd18b('0x14')]);}return _0x3f0076[_0xd18b('0x48')](_0x3c1802);}})[_0xd18b('0x1c')](function(_0x526dea){if(_0x526dea){return _0x526dea?{'count':_0xc88e9f,'rows':_0x526dea}:null;}})[_0xd18b('0x1c')](respondWithResult(_0x50f32a,null))[_0xd18b('0x3e')](handleError(_0x50f32a,null));};exports['setTags']=function(_0x572685,_0x3fa294,_0x5b0d10){if(_0x572685['body']['id']){delete _0x572685[_0xd18b('0x3f')]['id'];}return db['DeskConfiguration'][_0xd18b('0x46')]({'where':{'id':_0x572685[_0xd18b('0x40')]['id']}})[_0xd18b('0x1c')](handleEntityNotFound(_0x3fa294,null))[_0xd18b('0x1c')](function(_0x5e7653){if(_0x5e7653){return _0x5e7653['setTags'](_0x572685[_0xd18b('0x3f')][_0xd18b('0x4a')]||[]);}return null;})[_0xd18b('0x1c')](respondWithResult(_0x3fa294,null))[_0xd18b('0x3e')](handleError(_0x3fa294,null));}; \ No newline at end of file +var _0xedff=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','DeskConfiguration','includeAll','create','body','find','getFields','findOne','DeskField','getSubjects','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x33e7d4,_0xeaa8c9){var _0xd53e51=function(_0x29140d){while(--_0x29140d){_0x33e7d4['push'](_0x33e7d4['shift']());}};_0xd53e51(++_0xeaa8c9);}(_0xedff,0xc0));var _0xfedf=function(_0x44d73a,_0x166640){_0x44d73a=_0x44d73a-0x0;var _0x67492a=_0xedff[_0x44d73a];return _0x67492a;};'use strict';var emlformat=require(_0xfedf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfedf('0x1'));var jsonpatch=require(_0xfedf('0x2'));var rp=require(_0xfedf('0x3'));var moment=require('moment');var BPromise=require(_0xfedf('0x4'));var Mustache=require(_0xfedf('0x5'));var util=require(_0xfedf('0x6'));var path=require(_0xfedf('0x7'));var sox=require(_0xfedf('0x8'));var csv=require(_0xfedf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfedf('0xa'));var squel=require(_0xfedf('0xb'));var crypto=require(_0xfedf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfedf('0xd'));var toCsv=require(_0xfedf('0x9'));var querystring=require(_0xfedf('0xe'));var Papa=require('papaparse');var Redis=require(_0xfedf('0xf'));var authService=require(_0xfedf('0x10'));var qs=require(_0xfedf('0x11'));var as=require(_0xfedf('0x12'));var hardwareService=require(_0xfedf('0x13'));var logger=require(_0xfedf('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfedf('0x15'));var db=require(_0xfedf('0x16'))['db'];function respondWithStatusCode(_0x2f4f8b,_0x2ad6a0){_0x2ad6a0=_0x2ad6a0||0xcc;return function(_0x23b626){if(_0x23b626){return _0x2f4f8b[_0xfedf('0x17')](_0x2ad6a0);}return _0x2f4f8b[_0xfedf('0x18')](_0x2ad6a0)[_0xfedf('0x19')]();};}function respondWithResult(_0x60a4c0,_0x2b974b){_0x2b974b=_0x2b974b||0xc8;return function(_0x722fcf){if(_0x722fcf){return _0x60a4c0[_0xfedf('0x18')](_0x2b974b)['json'](_0x722fcf);}};}function respondWithFilteredResult(_0x1080ef,_0x53b08a){return function(_0x1886be){if(_0x1886be){var _0x40806a=typeof _0x53b08a['offset']===_0xfedf('0x1a')&&typeof _0x53b08a[_0xfedf('0x1b')]===_0xfedf('0x1a');var _0x1edcc2=_0x1886be[_0xfedf('0x1c')];var _0x1b274b=_0x40806a?0x0:_0x53b08a[_0xfedf('0x1d')];var _0x100476=_0x40806a?_0x1886be['count']:_0x53b08a[_0xfedf('0x1d')]+_0x53b08a[_0xfedf('0x1b')];var _0x5924f5;if(_0x100476>=_0x1edcc2){_0x100476=_0x1edcc2;_0x5924f5=0xc8;}else{_0x5924f5=0xce;}_0x1080ef[_0xfedf('0x18')](_0x5924f5);return _0x1080ef[_0xfedf('0x1e')]('Content-Range',_0x1b274b+'-'+_0x100476+'/'+_0x1edcc2)[_0xfedf('0x1f')](_0x1886be);}return null;};}function patchUpdates(_0x2d0236){return function(_0x42585a){try{jsonpatch[_0xfedf('0x20')](_0x42585a,_0x2d0236,!![]);}catch(_0x255d49){return BPromise['reject'](_0x255d49);}return _0x42585a[_0xfedf('0x21')]();};}function saveUpdates(_0x254942,_0x459532){return function(_0x5e6906){if(_0x5e6906){return _0x5e6906[_0xfedf('0x22')](_0x254942)[_0xfedf('0x23')](function(_0x4aee72){return _0x4aee72;});}return null;};}function removeEntity(_0x3cedaa,_0x46b893){return function(_0x1d4f73){if(_0x1d4f73){return _0x1d4f73[_0xfedf('0x24')]()[_0xfedf('0x23')](function(){_0x3cedaa[_0xfedf('0x18')](0xcc)[_0xfedf('0x19')]();});}};}function handleEntityNotFound(_0x11a937,_0x1eaee4){return function(_0x5cc0e5){if(!_0x5cc0e5){_0x11a937[_0xfedf('0x17')](0x194);}return _0x5cc0e5;};}function handleError(_0x1e68e7,_0x1625f1){_0x1625f1=_0x1625f1||0x1f4;return function(_0x36c9a2){logger[_0xfedf('0x25')](_0x36c9a2[_0xfedf('0x26')]);if(_0x36c9a2[_0xfedf('0x27')]){delete _0x36c9a2[_0xfedf('0x27')];}_0x1e68e7[_0xfedf('0x18')](_0x1625f1)[_0xfedf('0x28')](_0x36c9a2);};}exports[_0xfedf('0x29')]=function(_0x537976,_0x3551ff){var _0x3889ed={},_0x38ed0e={},_0x4f7731={'count':0x0,'rows':[]};var _0x4959d5=_['map'](db['DeskConfiguration'][_0xfedf('0x2a')],function(_0x1ea533){return{'name':_0x1ea533['fieldName'],'type':_0x1ea533[_0xfedf('0x2b')][_0xfedf('0x2c')]};});_0x38ed0e[_0xfedf('0x2d')]=_[_0xfedf('0x2e')](_0x4959d5,_0xfedf('0x27'));_0x38ed0e[_0xfedf('0x2f')]=_['keys'](_0x537976[_0xfedf('0x2f')]);_0x38ed0e[_0xfedf('0x30')]=_[_0xfedf('0x31')](_0x38ed0e[_0xfedf('0x2d')],_0x38ed0e[_0xfedf('0x2f')]);_0x3889ed[_0xfedf('0x32')]=_[_0xfedf('0x31')](_0x38ed0e[_0xfedf('0x2d')],qs[_0xfedf('0x33')](_0x537976[_0xfedf('0x2f')][_0xfedf('0x33')]));_0x3889ed[_0xfedf('0x32')]=_0x3889ed['attributes'][_0xfedf('0x34')]?_0x3889ed['attributes']:_0x38ed0e['model'];if(!_0x537976[_0xfedf('0x2f')][_0xfedf('0x35')](_0xfedf('0x36'))){_0x3889ed['limit']=qs[_0xfedf('0x1b')](_0x537976[_0xfedf('0x2f')][_0xfedf('0x1b')]);_0x3889ed[_0xfedf('0x1d')]=qs[_0xfedf('0x1d')](_0x537976[_0xfedf('0x2f')][_0xfedf('0x1d')]);}_0x3889ed[_0xfedf('0x37')]=qs[_0xfedf('0x38')](_0x537976['query'][_0xfedf('0x38')]);_0x3889ed[_0xfedf('0x39')]=qs['filters'](_[_0xfedf('0x3a')](_0x537976[_0xfedf('0x2f')],_0x38ed0e['filters']),_0x4959d5);if(_0x537976[_0xfedf('0x2f')][_0xfedf('0x3b')]){_0x3889ed[_0xfedf('0x39')]=_[_0xfedf('0x3c')](_0x3889ed['where'],{'$or':_[_0xfedf('0x2e')](_0x4959d5,function(_0x2e208f){if(_0x2e208f[_0xfedf('0x2b')]!==_0xfedf('0x3d')){var _0x425182={};_0x425182[_0x2e208f['name']]={'$like':'%'+_0x537976['query'][_0xfedf('0x3b')]+'%'};return _0x425182;}})});}_0x3889ed=_[_0xfedf('0x3c')]({},_0x3889ed,_0x537976[_0xfedf('0x3e')]);var _0x340e3e={'where':_0x3889ed['where']};return db['DeskConfiguration'][_0xfedf('0x1c')](_0x340e3e)[_0xfedf('0x23')](function(_0x496059){_0x4f7731[_0xfedf('0x1c')]=_0x496059;if(_0x537976[_0xfedf('0x2f')]['includeAll']){_0x3889ed[_0xfedf('0x3f')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xfedf('0x40')](_0x3889ed);})[_0xfedf('0x23')](function(_0x247056){_0x4f7731[_0xfedf('0x41')]=_0x247056;return _0x4f7731;})[_0xfedf('0x23')](respondWithFilteredResult(_0x3551ff,_0x3889ed))[_0xfedf('0x42')](handleError(_0x3551ff,null));};exports[_0xfedf('0x43')]=function(_0x543e8f,_0x13f107){var _0x7c1a14={'raw':![],'where':{'id':_0x543e8f[_0xfedf('0x44')]['id']}},_0x38d2cf={};_0x38d2cf[_0xfedf('0x2d')]=_[_0xfedf('0x45')](db[_0xfedf('0x46')]['rawAttributes']);_0x38d2cf['query']=_[_0xfedf('0x45')](_0x543e8f[_0xfedf('0x2f')]);_0x38d2cf[_0xfedf('0x30')]=_[_0xfedf('0x31')](_0x38d2cf[_0xfedf('0x2d')],_0x38d2cf[_0xfedf('0x2f')]);_0x7c1a14[_0xfedf('0x32')]=_[_0xfedf('0x31')](_0x38d2cf[_0xfedf('0x2d')],qs[_0xfedf('0x33')](_0x543e8f[_0xfedf('0x2f')][_0xfedf('0x33')]));_0x7c1a14[_0xfedf('0x32')]=_0x7c1a14[_0xfedf('0x32')][_0xfedf('0x34')]?_0x7c1a14[_0xfedf('0x32')]:_0x38d2cf[_0xfedf('0x2d')];if(_0x543e8f[_0xfedf('0x2f')][_0xfedf('0x47')]){_0x7c1a14['include']=[{'all':!![]}];}_0x7c1a14=_[_0xfedf('0x3c')]({},_0x7c1a14,_0x543e8f['options']);return db[_0xfedf('0x46')]['find'](_0x7c1a14)[_0xfedf('0x23')](handleEntityNotFound(_0x13f107,null))[_0xfedf('0x23')](respondWithResult(_0x13f107,null))[_0xfedf('0x42')](handleError(_0x13f107,null));};exports[_0xfedf('0x48')]=function(_0xd6f7e6,_0x27bfba){return db[_0xfedf('0x46')]['create'](_0xd6f7e6[_0xfedf('0x49')],{})[_0xfedf('0x23')](respondWithResult(_0x27bfba,0xc9))['catch'](handleError(_0x27bfba,null));};exports[_0xfedf('0x22')]=function(_0x48dc6e,_0x2f6498){if(_0x48dc6e[_0xfedf('0x49')]['id']){delete _0x48dc6e[_0xfedf('0x49')]['id'];}return db['DeskConfiguration'][_0xfedf('0x4a')]({'where':{'id':_0x48dc6e[_0xfedf('0x44')]['id']}})[_0xfedf('0x23')](handleEntityNotFound(_0x2f6498,null))[_0xfedf('0x23')](saveUpdates(_0x48dc6e[_0xfedf('0x49')],null))[_0xfedf('0x23')](respondWithResult(_0x2f6498,null))[_0xfedf('0x42')](handleError(_0x2f6498,null));};exports[_0xfedf('0x24')]=function(_0x8b65af,_0x19d31c){return db['DeskConfiguration']['find']({'where':{'id':_0x8b65af[_0xfedf('0x44')]['id']}})[_0xfedf('0x23')](handleEntityNotFound(_0x19d31c,null))[_0xfedf('0x23')](removeEntity(_0x19d31c,null))[_0xfedf('0x42')](handleError(_0x19d31c,null));};exports[_0xfedf('0x4b')]=function(_0x421250,_0x4b31f4,_0x1d1378){var _0x12a232={};var _0x2307cf={};var _0xb21004;var _0x2dc9ff;return db['DeskConfiguration'][_0xfedf('0x4c')]({'where':{'id':_0x421250[_0xfedf('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b31f4,null))[_0xfedf('0x23')](function(_0x2d6be9){if(_0x2d6be9){_0xb21004=_0x2d6be9;_0x2307cf['model']=_['keys'](db[_0xfedf('0x4d')][_0xfedf('0x2a')]);_0x2307cf[_0xfedf('0x2f')]=_[_0xfedf('0x45')](_0x421250[_0xfedf('0x2f')]);_0x2307cf[_0xfedf('0x30')]=_[_0xfedf('0x31')](_0x2307cf[_0xfedf('0x2d')],_0x2307cf[_0xfedf('0x2f')]);_0x12a232[_0xfedf('0x32')]=_[_0xfedf('0x31')](_0x2307cf['model'],qs[_0xfedf('0x33')](_0x421250[_0xfedf('0x2f')][_0xfedf('0x33')]));_0x12a232[_0xfedf('0x32')]=_0x12a232[_0xfedf('0x32')]['length']?_0x12a232[_0xfedf('0x32')]:_0x2307cf[_0xfedf('0x2d')];_0x12a232[_0xfedf('0x37')]=qs[_0xfedf('0x38')](_0x421250[_0xfedf('0x2f')]['sort']);_0x12a232[_0xfedf('0x39')]=qs[_0xfedf('0x30')](_[_0xfedf('0x3a')](_0x421250[_0xfedf('0x2f')],_0x2307cf[_0xfedf('0x30')]));if(_0x421250[_0xfedf('0x2f')][_0xfedf('0x3b')]){_0x12a232[_0xfedf('0x39')]=_[_0xfedf('0x3c')](_0x12a232[_0xfedf('0x39')],{'$or':_[_0xfedf('0x2e')](_0x12a232[_0xfedf('0x32')],function(_0x46c61d){var _0x3c7ce2={};_0x3c7ce2[_0x46c61d]={'$like':'%'+_0x421250[_0xfedf('0x2f')][_0xfedf('0x3b')]+'%'};return _0x3c7ce2;})});}_0x12a232=_[_0xfedf('0x3c')]({},_0x12a232,_0x421250[_0xfedf('0x3e')]);return _0xb21004['getFields'](_0x12a232);}})[_0xfedf('0x23')](function(_0x3f4f3){if(_0x3f4f3){_0x2dc9ff=_0x3f4f3[_0xfedf('0x34')];if(!_0x421250[_0xfedf('0x2f')]['hasOwnProperty'](_0xfedf('0x36'))){_0x12a232[_0xfedf('0x1b')]=qs[_0xfedf('0x1b')](_0x421250[_0xfedf('0x2f')][_0xfedf('0x1b')]);_0x12a232[_0xfedf('0x1d')]=qs[_0xfedf('0x1d')](_0x421250['query']['offset']);}return _0xb21004[_0xfedf('0x4b')](_0x12a232);}})[_0xfedf('0x23')](function(_0x2cfb37){if(_0x2cfb37){return _0x2cfb37?{'count':_0x2dc9ff,'rows':_0x2cfb37}:null;}})[_0xfedf('0x23')](respondWithResult(_0x4b31f4,null))[_0xfedf('0x42')](handleError(_0x4b31f4,null));};exports['getSubjects']=function(_0x2aa42b,_0x50925c,_0x556ecf){var _0xed1068={};var _0x3dfbea={};var _0x353d1d;var _0x103a4d;return db[_0xfedf('0x46')][_0xfedf('0x4c')]({'where':{'id':_0x2aa42b['params']['id']}})[_0xfedf('0x23')](handleEntityNotFound(_0x50925c,null))['then'](function(_0x731194){if(_0x731194){_0x353d1d=_0x731194;_0x3dfbea[_0xfedf('0x2d')]=_[_0xfedf('0x45')](db[_0xfedf('0x4d')][_0xfedf('0x2a')]);_0x3dfbea['query']=_[_0xfedf('0x45')](_0x2aa42b[_0xfedf('0x2f')]);_0x3dfbea[_0xfedf('0x30')]=_[_0xfedf('0x31')](_0x3dfbea[_0xfedf('0x2d')],_0x3dfbea[_0xfedf('0x2f')]);_0xed1068['attributes']=_[_0xfedf('0x31')](_0x3dfbea[_0xfedf('0x2d')],qs[_0xfedf('0x33')](_0x2aa42b[_0xfedf('0x2f')][_0xfedf('0x33')]));_0xed1068[_0xfedf('0x32')]=_0xed1068[_0xfedf('0x32')][_0xfedf('0x34')]?_0xed1068['attributes']:_0x3dfbea[_0xfedf('0x2d')];_0xed1068[_0xfedf('0x37')]=qs[_0xfedf('0x38')](_0x2aa42b[_0xfedf('0x2f')][_0xfedf('0x38')]);_0xed1068[_0xfedf('0x39')]=qs[_0xfedf('0x30')](_[_0xfedf('0x3a')](_0x2aa42b[_0xfedf('0x2f')],_0x3dfbea[_0xfedf('0x30')]));if(_0x2aa42b['query']['filter']){_0xed1068[_0xfedf('0x39')]=_[_0xfedf('0x3c')](_0xed1068[_0xfedf('0x39')],{'$or':_[_0xfedf('0x2e')](_0xed1068['attributes'],function(_0x1859d1){var _0x1049e6={};_0x1049e6[_0x1859d1]={'$like':'%'+_0x2aa42b[_0xfedf('0x2f')][_0xfedf('0x3b')]+'%'};return _0x1049e6;})});}_0xed1068=_['merge']({},_0xed1068,_0x2aa42b[_0xfedf('0x3e')]);return _0x353d1d[_0xfedf('0x4e')](_0xed1068);}})[_0xfedf('0x23')](function(_0x46bef6){if(_0x46bef6){_0x103a4d=_0x46bef6['length'];if(!_0x2aa42b[_0xfedf('0x2f')][_0xfedf('0x35')](_0xfedf('0x36'))){_0xed1068[_0xfedf('0x1b')]=qs['limit'](_0x2aa42b[_0xfedf('0x2f')][_0xfedf('0x1b')]);_0xed1068[_0xfedf('0x1d')]=qs[_0xfedf('0x1d')](_0x2aa42b[_0xfedf('0x2f')][_0xfedf('0x1d')]);}return _0x353d1d[_0xfedf('0x4e')](_0xed1068);}})[_0xfedf('0x23')](function(_0xee0179){if(_0xee0179){return _0xee0179?{'count':_0x103a4d,'rows':_0xee0179}:null;}})[_0xfedf('0x23')](respondWithResult(_0x50925c,null))[_0xfedf('0x42')](handleError(_0x50925c,null));};exports['getDescriptions']=function(_0xdbbf4c,_0x264a9b,_0x8a4d80){var _0x212035={};var _0x22659e={};var _0x569d58;var _0x5b5265;return db[_0xfedf('0x46')][_0xfedf('0x4c')]({'where':{'id':_0xdbbf4c[_0xfedf('0x44')]['id']}})[_0xfedf('0x23')](handleEntityNotFound(_0x264a9b,null))[_0xfedf('0x23')](function(_0x31db84){if(_0x31db84){_0x569d58=_0x31db84;_0x22659e[_0xfedf('0x2d')]=_['keys'](db[_0xfedf('0x4d')][_0xfedf('0x2a')]);_0x22659e[_0xfedf('0x2f')]=_[_0xfedf('0x45')](_0xdbbf4c['query']);_0x22659e['filters']=_[_0xfedf('0x31')](_0x22659e['model'],_0x22659e[_0xfedf('0x2f')]);_0x212035[_0xfedf('0x32')]=_['intersection'](_0x22659e[_0xfedf('0x2d')],qs[_0xfedf('0x33')](_0xdbbf4c[_0xfedf('0x2f')][_0xfedf('0x33')]));_0x212035['attributes']=_0x212035['attributes'][_0xfedf('0x34')]?_0x212035[_0xfedf('0x32')]:_0x22659e['model'];_0x212035[_0xfedf('0x37')]=qs['sort'](_0xdbbf4c['query'][_0xfedf('0x38')]);_0x212035[_0xfedf('0x39')]=qs[_0xfedf('0x30')](_['pick'](_0xdbbf4c[_0xfedf('0x2f')],_0x22659e['filters']));if(_0xdbbf4c[_0xfedf('0x2f')][_0xfedf('0x3b')]){_0x212035['where']=_['merge'](_0x212035[_0xfedf('0x39')],{'$or':_[_0xfedf('0x2e')](_0x212035[_0xfedf('0x32')],function(_0x4a2856){var _0x5a1a86={};_0x5a1a86[_0x4a2856]={'$like':'%'+_0xdbbf4c[_0xfedf('0x2f')][_0xfedf('0x3b')]+'%'};return _0x5a1a86;})});}_0x212035=_[_0xfedf('0x3c')]({},_0x212035,_0xdbbf4c[_0xfedf('0x3e')]);return _0x569d58['getDescriptions'](_0x212035);}})['then'](function(_0x3ad516){if(_0x3ad516){_0x5b5265=_0x3ad516[_0xfedf('0x34')];if(!_0xdbbf4c[_0xfedf('0x2f')][_0xfedf('0x35')](_0xfedf('0x36'))){_0x212035[_0xfedf('0x1b')]=qs[_0xfedf('0x1b')](_0xdbbf4c[_0xfedf('0x2f')]['limit']);_0x212035['offset']=qs['offset'](_0xdbbf4c[_0xfedf('0x2f')]['offset']);}return _0x569d58['getDescriptions'](_0x212035);}})[_0xfedf('0x23')](function(_0x351800){if(_0x351800){return _0x351800?{'count':_0x5b5265,'rows':_0x351800}:null;}})[_0xfedf('0x23')](respondWithResult(_0x264a9b,null))[_0xfedf('0x42')](handleError(_0x264a9b,null));};exports[_0xfedf('0x4f')]=function(_0x4faeef,_0x278bda,_0x2f7adc){var _0x508633={};var _0x332c51={};var _0x5507aa;var _0x27e0c1;return db['DeskConfiguration'][_0xfedf('0x4c')]({'where':{'id':_0x4faeef[_0xfedf('0x44')]['id']}})[_0xfedf('0x23')](handleEntityNotFound(_0x278bda,null))['then'](function(_0x596cfa){if(_0x596cfa){_0x5507aa=_0x596cfa;_0x332c51[_0xfedf('0x2d')]=_['keys'](db[_0xfedf('0x50')][_0xfedf('0x2a')]);_0x332c51[_0xfedf('0x2f')]=_['keys'](_0x4faeef['query']);_0x332c51[_0xfedf('0x30')]=_[_0xfedf('0x31')](_0x332c51[_0xfedf('0x2d')],_0x332c51['query']);_0x508633[_0xfedf('0x32')]=_['intersection'](_0x332c51['model'],qs[_0xfedf('0x33')](_0x4faeef[_0xfedf('0x2f')][_0xfedf('0x33')]));_0x508633[_0xfedf('0x32')]=_0x508633[_0xfedf('0x32')]['length']?_0x508633[_0xfedf('0x32')]:_0x332c51[_0xfedf('0x2d')];_0x508633[_0xfedf('0x37')]=qs[_0xfedf('0x38')](_0x4faeef[_0xfedf('0x2f')][_0xfedf('0x38')]);_0x508633[_0xfedf('0x39')]=qs[_0xfedf('0x30')](_[_0xfedf('0x3a')](_0x4faeef[_0xfedf('0x2f')],_0x332c51[_0xfedf('0x30')]));if(_0x4faeef[_0xfedf('0x2f')][_0xfedf('0x3b')]){_0x508633['where']=_[_0xfedf('0x3c')](_0x508633[_0xfedf('0x39')],{'$or':_['map'](_0x508633[_0xfedf('0x32')],function(_0x262961){var _0x7e48c8={};_0x7e48c8[_0x262961]={'$like':'%'+_0x4faeef[_0xfedf('0x2f')]['filter']+'%'};return _0x7e48c8;})});}_0x508633=_[_0xfedf('0x3c')]({},_0x508633,_0x4faeef[_0xfedf('0x3e')]);return _0x5507aa[_0xfedf('0x4f')](_0x508633);}})[_0xfedf('0x23')](function(_0x34e222){if(_0x34e222){_0x27e0c1=_0x34e222[_0xfedf('0x34')];if(!_0x4faeef[_0xfedf('0x2f')][_0xfedf('0x35')](_0xfedf('0x36'))){_0x508633['limit']=qs[_0xfedf('0x1b')](_0x4faeef[_0xfedf('0x2f')][_0xfedf('0x1b')]);_0x508633[_0xfedf('0x1d')]=qs[_0xfedf('0x1d')](_0x4faeef[_0xfedf('0x2f')][_0xfedf('0x1d')]);}return _0x5507aa[_0xfedf('0x4f')](_0x508633);}})[_0xfedf('0x23')](function(_0x5e56dc){if(_0x5e56dc){return _0x5e56dc?{'count':_0x27e0c1,'rows':_0x5e56dc}:null;}})[_0xfedf('0x23')](respondWithResult(_0x278bda,null))['catch'](handleError(_0x278bda,null));};exports[_0xfedf('0x51')]=function(_0x2b30bd,_0x12a42b,_0x14788){if(_0x2b30bd['body']['id']){delete _0x2b30bd[_0xfedf('0x49')]['id'];}return db[_0xfedf('0x46')][_0xfedf('0x4c')]({'where':{'id':_0x2b30bd['params']['id']}})[_0xfedf('0x23')](handleEntityNotFound(_0x12a42b,null))['then'](function(_0x59b754){if(_0x59b754){return _0x59b754['setTags'](_0x2b30bd[_0xfedf('0x49')]['ids']||[]);}return null;})['then'](respondWithResult(_0x12a42b,null))[_0xfedf('0x42')](handleError(_0x12a42b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index f38ebd9..7aaf459 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 _0xb13b=['rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','path'];(function(_0x31f212,_0x6e94ee){var _0x2ed1f0=function(_0x25ac0e){while(--_0x25ac0e){_0x31f212['push'](_0x31f212['shift']());}};_0x2ed1f0(++_0x6e94ee);}(_0xb13b,0xc7));var _0xbb13=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb13b[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0xbb13('0x0'));var util=require('util');var logger=require(_0xbb13('0x1'))(_0xbb13('0x2'));var moment=require(_0xbb13('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb13('0x4'));var rimraf=require(_0xbb13('0x5'));var config=require(_0xbb13('0x6'));var attributes=require(_0xbb13('0x7'));module[_0xbb13('0x8')]=function(_0x3f1e99,_0x30e699){return _0x3f1e99[_0xbb13('0x9')](_0xbb13('0xa'),attributes,{'tableName':_0xbb13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c9f=['define','int_desk_configurations','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1c9f,0xec));var _0xf1c9=function(_0x537a98,_0x3c2fc4){_0x537a98=_0x537a98-0x0;var _0x2e4964=_0x1c9f[_0x537a98];return _0x2e4964;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf1c9('0x0'))(_0xf1c9('0x1'));var moment=require(_0xf1c9('0x2'));var BPromise=require('bluebird');var rp=require(_0xf1c9('0x3'));var fs=require('fs');var path=require(_0xf1c9('0x4'));var rimraf=require(_0xf1c9('0x5'));var config=require(_0xf1c9('0x6'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x45dce9,_0x989b24){return _0x45dce9[_0xf1c9('0x7')]('DeskConfiguration',attributes,{'tableName':_0xf1c9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 450ad47..8e7e14a 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 _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x3f945f,_0x1ccbd4){var _0x3581a8=function(_0x2479d2){while(--_0x2479d2){_0x3f945f['push'](_0x3f945f['shift']());}};_0x3581a8(++_0x1ccbd4);}(_0x7916,0x128));var _0x6791=function(_0x4fe4d2,_0x7995c4){_0x4fe4d2=_0x4fe4d2-0x0;var _0x56541d=_0x7916[_0x4fe4d2];return _0x56541d;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file +var _0x5eca=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x2177cf,_0x52cbfa){var _0x1cc7ad=function(_0x1c5721){while(--_0x1c5721){_0x2177cf['push'](_0x2177cf['shift']());}};_0x1cc7ad(++_0x52cbfa);}(_0x5eca,0x10e));var _0xa5ec=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5eca[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xa5ec('0x0'));var util=require(_0xa5ec('0x1'));var moment=require(_0xa5ec('0x2'));var BPromise=require(_0xa5ec('0x3'));var rs=require(_0xa5ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa5ec('0x6'));var config=require(_0xa5ec('0x7'));var jayson=require(_0xa5ec('0x8'));var client=jayson[_0xa5ec('0x9')][_0xa5ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cdf5e,_0x127519,_0x5f314e){return new BPromise(function(_0x436828,_0x65aa33){return client['request'](_0x2cdf5e,_0x5f314e)[_0xa5ec('0xb')](function(_0x4e60cc){logger[_0xa5ec('0xc')](_0xa5ec('0xd'),_0x127519,_0xa5ec('0xe'));logger['debug'](_0xa5ec('0xf'),_0x127519,_0xa5ec('0xe'),JSON[_0xa5ec('0x10')](_0x4e60cc));if(_0x4e60cc[_0xa5ec('0x11')]){if(_0x4e60cc[_0xa5ec('0x11')][_0xa5ec('0x12')]===0x1f4){logger[_0xa5ec('0x11')](_0xa5ec('0xd'),_0x127519,_0x4e60cc[_0xa5ec('0x11')][_0xa5ec('0x13')]);return _0x65aa33(_0x4e60cc[_0xa5ec('0x11')][_0xa5ec('0x13')]);}logger[_0xa5ec('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x127519,_0x4e60cc[_0xa5ec('0x11')][_0xa5ec('0x13')]);return _0x436828(_0x4e60cc[_0xa5ec('0x11')][_0xa5ec('0x13')]);}else{logger[_0xa5ec('0xc')](_0xa5ec('0xd'),_0x127519,'request\x20sent');_0x436828(_0x4e60cc[_0xa5ec('0x14')]['message']);}})[_0xa5ec('0x15')](function(_0x35e4a7){logger[_0xa5ec('0x11')](_0xa5ec('0xd'),_0x127519,_0x35e4a7);_0x65aa33(_0x35e4a7);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 876c48b..808f0a6 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 _0x8bca=['./intDeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36d809,_0x36bf6c){var _0x15561d=function(_0x53c0ae){while(--_0x53c0ae){_0x36d809['push'](_0x36d809['shift']());}};_0x15561d(++_0x36bf6c);}(_0x8bca,0x12b));var _0xa8bc=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x8bca[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require(_0xa8bc('0x0'));var util=require(_0xa8bc('0x1'));var path=require(_0xa8bc('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8bc('0x3'));var router=express[_0xa8bc('0x4')]();var fs_extra=require(_0xa8bc('0x5'));var auth=require(_0xa8bc('0x6'));var interaction=require(_0xa8bc('0x7'));var config=require(_0xa8bc('0x8'));var controller=require(_0xa8bc('0x9'));router[_0xa8bc('0xa')]('/',auth[_0xa8bc('0xb')](),controller[_0xa8bc('0xc')]);router[_0xa8bc('0xa')]('/:id',auth[_0xa8bc('0xb')](),controller[_0xa8bc('0xd')]);router[_0xa8bc('0xe')]('/',auth[_0xa8bc('0xb')](),controller[_0xa8bc('0xf')]);router[_0xa8bc('0x10')](_0xa8bc('0x11'),auth[_0xa8bc('0xb')](),controller[_0xa8bc('0x12')]);router[_0xa8bc('0x13')](_0xa8bc('0x11'),auth[_0xa8bc('0xb')](),controller[_0xa8bc('0x14')]);module[_0xa8bc('0x15')]=router; \ No newline at end of file +var _0x83f2=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x56642d,_0x3a04ef){var _0x46c6d7=function(_0x170450){while(--_0x170450){_0x56642d['push'](_0x56642d['shift']());}};_0x46c6d7(++_0x3a04ef);}(_0x83f2,0x87));var _0x283f=function(_0x1a6e4c,_0x560c48){_0x1a6e4c=_0x1a6e4c-0x0;var _0x4bc49e=_0x83f2[_0x1a6e4c];return _0x4bc49e;};'use strict';var multer=require('multer');var util=require(_0x283f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x283f('0x1')]();var fs_extra=require(_0x283f('0x2'));var auth=require(_0x283f('0x3'));var interaction=require(_0x283f('0x4'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x283f('0x5')]('/',auth[_0x283f('0x6')](),controller[_0x283f('0x7')]);router['get'](_0x283f('0x8'),auth[_0x283f('0x6')](),controller[_0x283f('0x9')]);router[_0x283f('0xa')]('/',auth[_0x283f('0x6')](),controller[_0x283f('0xb')]);router[_0x283f('0xc')](_0x283f('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x283f('0xd')]('/:id',auth[_0x283f('0x6')](),controller[_0x283f('0xe')]);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 ca8bf2d..5c2a621 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 _0xeb99=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x43ca39,_0x3f0b5a){var _0x1b0929=function(_0x40cb24){while(--_0x40cb24){_0x43ca39['push'](_0x43ca39['shift']());}};_0x1b0929(++_0x3f0b5a);}(_0xeb99,0x160));var _0x9eb9=function(_0x4b96bd,_0xe341d){_0x4b96bd=_0x4b96bd-0x0;var _0x515ad8=_0xeb99[_0x4b96bd];return _0x515ad8;};'use strict';var Sequelize=require('sequelize');module[_0x9eb9('0x0')]={'type':{'type':Sequelize[_0x9eb9('0x1')](_0x9eb9('0x2'),_0x9eb9('0x3'),_0x9eb9('0x4'),_0x9eb9('0x5'),'picklist'),'defaultValue':_0x9eb9('0x2')},'content':{'type':Sequelize[_0x9eb9('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9eb9('0x1')]('string',_0x9eb9('0x3'),_0x9eb9('0x4'))},'keyContent':{'type':Sequelize[_0x9eb9('0x6')]},'idField':{'type':Sequelize[_0x9eb9('0x6')]},'nameField':{'type':Sequelize[_0x9eb9('0x6')]},'customField':{'type':Sequelize[_0x9eb9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9eb9('0x6')]}}; \ No newline at end of file +var _0xce33=['keyValue','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xce33,0x1c7));var _0x3ce3=function(_0x10f50d,_0x1b200c){_0x10f50d=_0x10f50d-0x0;var _0x24128c=_0xce33[_0x10f50d];return _0x24128c;};'use strict';var Sequelize=require(_0x3ce3('0x0'));module[_0x3ce3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3ce3('0x2'),_0x3ce3('0x3'),'customVariable',_0x3ce3('0x4'),'picklist'),'defaultValue':_0x3ce3('0x2')},'content':{'type':Sequelize[_0x3ce3('0x5')]},'key':{'type':Sequelize[_0x3ce3('0x5')]},'keyType':{'type':Sequelize[_0x3ce3('0x6')](_0x3ce3('0x2'),_0x3ce3('0x3'),_0x3ce3('0x7'))},'keyContent':{'type':Sequelize[_0x3ce3('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3ce3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3ce3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 270e26f..fd2a364 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 _0xea31=['send','index','map','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','DeskField','includeAll','include','findAll','catch','params','keys','length','options','create','update','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name'];(function(_0x1b88a0,_0x16572c){var _0x48d6d4=function(_0x9f231e){while(--_0x9f231e){_0x1b88a0['push'](_0x1b88a0['shift']());}};_0x48d6d4(++_0x16572c);}(_0xea31,0x6b));var _0x1ea3=function(_0x4d7940,_0x400a42){_0x4d7940=_0x4d7940-0x0;var _0x40d7b1=_0xea31[_0x4d7940];return _0x40d7b1;};'use strict';var emlformat=require(_0x1ea3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ea3('0x1'));var jsonpatch=require(_0x1ea3('0x2'));var rp=require(_0x1ea3('0x3'));var moment=require(_0x1ea3('0x4'));var BPromise=require(_0x1ea3('0x5'));var Mustache=require(_0x1ea3('0x6'));var util=require(_0x1ea3('0x7'));var path=require('path');var sox=require(_0x1ea3('0x8'));var csv=require(_0x1ea3('0x9'));var ejs=require(_0x1ea3('0xa'));var fs=require('fs');var fs_extra=require(_0x1ea3('0xb'));var _=require(_0x1ea3('0xc'));var squel=require('squel');var crypto=require(_0x1ea3('0xd'));var jsforce=require(_0x1ea3('0xe'));var deskjs=require(_0x1ea3('0xf'));var toCsv=require(_0x1ea3('0x9'));var querystring=require(_0x1ea3('0x10'));var Papa=require(_0x1ea3('0x11'));var Redis=require('ioredis');var authService=require(_0x1ea3('0x12'));var qs=require(_0x1ea3('0x13'));var as=require(_0x1ea3('0x14'));var hardwareService=require(_0x1ea3('0x15'));var logger=require(_0x1ea3('0x16'))(_0x1ea3('0x17'));var utils=require(_0x1ea3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1ea3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fe537,_0x2fc7f4){_0x2fc7f4=_0x2fc7f4||0xcc;return function(_0x4305d3){if(_0x4305d3){return _0x3fe537['sendStatus'](_0x2fc7f4);}return _0x3fe537[_0x1ea3('0x1a')](_0x2fc7f4)[_0x1ea3('0x1b')]();};}function respondWithResult(_0x2fd1c9,_0x4b0af9){_0x4b0af9=_0x4b0af9||0xc8;return function(_0x1624ee){if(_0x1624ee){return _0x2fd1c9[_0x1ea3('0x1a')](_0x4b0af9)[_0x1ea3('0x1c')](_0x1624ee);}};}function respondWithFilteredResult(_0x3d0e71,_0x319de8){return function(_0x3fe673){if(_0x3fe673){var _0x29ceac=typeof _0x319de8['offset']===_0x1ea3('0x1d')&&typeof _0x319de8[_0x1ea3('0x1e')]===_0x1ea3('0x1d');var _0x2f6e6f=_0x3fe673[_0x1ea3('0x1f')];var _0x541e18=_0x29ceac?0x0:_0x319de8[_0x1ea3('0x20')];var _0x2a8b47=_0x29ceac?_0x3fe673[_0x1ea3('0x1f')]:_0x319de8['offset']+_0x319de8[_0x1ea3('0x1e')];var _0x21364e;if(_0x2a8b47>=_0x2f6e6f){_0x2a8b47=_0x2f6e6f;_0x21364e=0xc8;}else{_0x21364e=0xce;}_0x3d0e71[_0x1ea3('0x1a')](_0x21364e);return _0x3d0e71['set'](_0x1ea3('0x21'),_0x541e18+'-'+_0x2a8b47+'/'+_0x2f6e6f)['json'](_0x3fe673);}return null;};}function patchUpdates(_0x276e4d){return function(_0x405ec0){try{jsonpatch[_0x1ea3('0x22')](_0x405ec0,_0x276e4d,!![]);}catch(_0x5bad21){return BPromise[_0x1ea3('0x23')](_0x5bad21);}return _0x405ec0['save']();};}function saveUpdates(_0x4582af,_0x498455){return function(_0x941a50){if(_0x941a50){return _0x941a50['update'](_0x4582af)[_0x1ea3('0x24')](function(_0x388019){return _0x388019;});}return null;};}function removeEntity(_0x246231,_0x5ad8ff){return function(_0x50703d){if(_0x50703d){return _0x50703d[_0x1ea3('0x25')]()['then'](function(){_0x246231[_0x1ea3('0x1a')](0xcc)[_0x1ea3('0x1b')]();});}};}function handleEntityNotFound(_0x3c42f3,_0x91abee){return function(_0xa2b868){if(!_0xa2b868){_0x3c42f3['sendStatus'](0x194);}return _0xa2b868;};}function handleError(_0x50e511,_0x30cf8d){_0x30cf8d=_0x30cf8d||0x1f4;return function(_0x2edfb4){logger[_0x1ea3('0x26')](_0x2edfb4[_0x1ea3('0x27')]);if(_0x2edfb4[_0x1ea3('0x28')]){delete _0x2edfb4[_0x1ea3('0x28')];}_0x50e511[_0x1ea3('0x1a')](_0x30cf8d)[_0x1ea3('0x29')](_0x2edfb4);};}exports[_0x1ea3('0x2a')]=function(_0x3d9b63,_0x3bc186){var _0x33f5f2={},_0x2c29d7={},_0x1a020e={'count':0x0,'rows':[]};var _0xdbd7e3=_[_0x1ea3('0x2b')](db['DeskField'][_0x1ea3('0x2c')],function(_0x366312){return{'name':_0x366312[_0x1ea3('0x2d')],'type':_0x366312[_0x1ea3('0x2e')][_0x1ea3('0x2f')]};});_0x2c29d7['model']=_['map'](_0xdbd7e3,_0x1ea3('0x28'));_0x2c29d7[_0x1ea3('0x30')]=_['keys'](_0x3d9b63[_0x1ea3('0x30')]);_0x2c29d7[_0x1ea3('0x31')]=_['intersection'](_0x2c29d7['model'],_0x2c29d7[_0x1ea3('0x30')]);_0x33f5f2[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x2c29d7[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x33f5f2[_0x1ea3('0x32')]=_0x33f5f2[_0x1ea3('0x32')]['length']?_0x33f5f2[_0x1ea3('0x32')]:_0x2c29d7[_0x1ea3('0x34')];if(!_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x36')](_0x1ea3('0x37'))){_0x33f5f2[_0x1ea3('0x1e')]=qs[_0x1ea3('0x1e')](_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x1e')]);_0x33f5f2[_0x1ea3('0x20')]=qs['offset'](_0x3d9b63[_0x1ea3('0x30')]['offset']);}_0x33f5f2[_0x1ea3('0x38')]=qs['sort'](_0x3d9b63['query'][_0x1ea3('0x39')]);_0x33f5f2['where']=qs['filters'](_['pick'](_0x3d9b63[_0x1ea3('0x30')],_0x2c29d7[_0x1ea3('0x31')]),_0xdbd7e3);if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]){_0x33f5f2[_0x1ea3('0x3b')]=_['merge'](_0x33f5f2[_0x1ea3('0x3b')],{'$or':_['map'](_0xdbd7e3,function(_0x441442){if(_0x441442[_0x1ea3('0x2e')]!=='VIRTUAL'){var _0x102757={};_0x102757[_0x441442[_0x1ea3('0x28')]]={'$like':'%'+_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3a')]+'%'};return _0x102757;}})});}_0x33f5f2=_[_0x1ea3('0x3c')]({},_0x33f5f2,_0x3d9b63['options']);var _0x12da5a={'where':_0x33f5f2['where']};return db[_0x1ea3('0x3d')][_0x1ea3('0x1f')](_0x12da5a)[_0x1ea3('0x24')](function(_0x47028d){_0x1a020e[_0x1ea3('0x1f')]=_0x47028d;if(_0x3d9b63[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x33f5f2[_0x1ea3('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x1ea3('0x40')](_0x33f5f2);})[_0x1ea3('0x24')](function(_0x2108e8){_0x1a020e['rows']=_0x2108e8;return _0x1a020e;})[_0x1ea3('0x24')](respondWithFilteredResult(_0x3bc186,_0x33f5f2))[_0x1ea3('0x41')](handleError(_0x3bc186,null));};exports['show']=function(_0x15f00a,_0x43c48d){var _0x58ba87={'raw':!![],'where':{'id':_0x15f00a[_0x1ea3('0x42')]['id']}},_0x133f48={};_0x133f48[_0x1ea3('0x34')]=_[_0x1ea3('0x43')](db[_0x1ea3('0x3d')][_0x1ea3('0x2c')]);_0x133f48['query']=_[_0x1ea3('0x43')](_0x15f00a[_0x1ea3('0x30')]);_0x133f48[_0x1ea3('0x31')]=_['intersection'](_0x133f48[_0x1ea3('0x34')],_0x133f48[_0x1ea3('0x30')]);_0x58ba87[_0x1ea3('0x32')]=_[_0x1ea3('0x33')](_0x133f48[_0x1ea3('0x34')],qs[_0x1ea3('0x35')](_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x35')]));_0x58ba87[_0x1ea3('0x32')]=_0x58ba87[_0x1ea3('0x32')][_0x1ea3('0x44')]?_0x58ba87['attributes']:_0x133f48[_0x1ea3('0x34')];if(_0x15f00a[_0x1ea3('0x30')][_0x1ea3('0x3e')]){_0x58ba87[_0x1ea3('0x3f')]=[{'all':!![]}];}_0x58ba87=_['merge']({},_0x58ba87,_0x15f00a[_0x1ea3('0x45')]);return db[_0x1ea3('0x3d')]['find'](_0x58ba87)[_0x1ea3('0x24')](handleEntityNotFound(_0x43c48d,null))[_0x1ea3('0x24')](respondWithResult(_0x43c48d,null))[_0x1ea3('0x41')](handleError(_0x43c48d,null));};exports[_0x1ea3('0x46')]=function(_0x454156,_0x28955f){return db[_0x1ea3('0x3d')]['create'](_0x454156['body'],{})['then'](respondWithResult(_0x28955f,0xc9))[_0x1ea3('0x41')](handleError(_0x28955f,null));};exports[_0x1ea3('0x47')]=function(_0xf69557,_0x2de88d){if(_0xf69557[_0x1ea3('0x48')]['id']){delete _0xf69557['body']['id'];}return db[_0x1ea3('0x3d')]['find']({'where':{'id':_0xf69557[_0x1ea3('0x42')]['id']}})[_0x1ea3('0x24')](handleEntityNotFound(_0x2de88d,null))['then'](saveUpdates(_0xf69557['body'],null))[_0x1ea3('0x24')](respondWithResult(_0x2de88d,null))[_0x1ea3('0x41')](handleError(_0x2de88d,null));};exports[_0x1ea3('0x25')]=function(_0x43f296,_0x4822b2){return db[_0x1ea3('0x3d')][_0x1ea3('0x49')]({'where':{'id':_0x43f296['params']['id']}})['then'](handleEntityNotFound(_0x4822b2,null))[_0x1ea3('0x24')](removeEntity(_0x4822b2,null))['catch'](handleError(_0x4822b2,null));}; \ No newline at end of file +var _0x2a2b=['end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','DeskField','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x428e7e,_0x54cd21){var _0x15b24a=function(_0x3ec83f){while(--_0x3ec83f){_0x428e7e['push'](_0x428e7e['shift']());}};_0x15b24a(++_0x54cd21);}(_0x2a2b,0x1de));var _0xb2a2=function(_0x5b3439,_0x13dd7e){_0x5b3439=_0x5b3439-0x0;var _0x499a6b=_0x2a2b[_0x5b3439];return _0x499a6b;};'use strict';var emlformat=require(_0xb2a2('0x0'));var rimraf=require(_0xb2a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2a2('0x2'));var rp=require(_0xb2a2('0x3'));var moment=require(_0xb2a2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb2a2('0x5'));var sox=require(_0xb2a2('0x6'));var csv=require(_0xb2a2('0x7'));var ejs=require(_0xb2a2('0x8'));var fs=require('fs');var fs_extra=require(_0xb2a2('0x9'));var _=require(_0xb2a2('0xa'));var squel=require(_0xb2a2('0xb'));var crypto=require('crypto');var jsforce=require(_0xb2a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb2a2('0x7'));var querystring=require(_0xb2a2('0xd'));var Papa=require(_0xb2a2('0xe'));var Redis=require(_0xb2a2('0xf'));var authService=require(_0xb2a2('0x10'));var qs=require(_0xb2a2('0x11'));var as=require(_0xb2a2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2a2('0x13'))(_0xb2a2('0x14'));var utils=require(_0xb2a2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb2a2('0x16'));var db=require(_0xb2a2('0x17'))['db'];function respondWithStatusCode(_0x202159,_0x596cee){_0x596cee=_0x596cee||0xcc;return function(_0x52164b){if(_0x52164b){return _0x202159[_0xb2a2('0x18')](_0x596cee);}return _0x202159[_0xb2a2('0x19')](_0x596cee)[_0xb2a2('0x1a')]();};}function respondWithResult(_0x2b79b7,_0x166dd3){_0x166dd3=_0x166dd3||0xc8;return function(_0x32359e){if(_0x32359e){return _0x2b79b7[_0xb2a2('0x19')](_0x166dd3)[_0xb2a2('0x1b')](_0x32359e);}};}function respondWithFilteredResult(_0x49542a,_0x26a932){return function(_0x1785aa){if(_0x1785aa){var _0x36f9e7=typeof _0x26a932[_0xb2a2('0x1c')]===_0xb2a2('0x1d')&&typeof _0x26a932[_0xb2a2('0x1e')]===_0xb2a2('0x1d');var _0x99c6a6=_0x1785aa[_0xb2a2('0x1f')];var _0x2c3496=_0x36f9e7?0x0:_0x26a932[_0xb2a2('0x1c')];var _0x17e8a0=_0x36f9e7?_0x1785aa[_0xb2a2('0x1f')]:_0x26a932[_0xb2a2('0x1c')]+_0x26a932[_0xb2a2('0x1e')];var _0x5855b2;if(_0x17e8a0>=_0x99c6a6){_0x17e8a0=_0x99c6a6;_0x5855b2=0xc8;}else{_0x5855b2=0xce;}_0x49542a['status'](_0x5855b2);return _0x49542a[_0xb2a2('0x20')]('Content-Range',_0x2c3496+'-'+_0x17e8a0+'/'+_0x99c6a6)[_0xb2a2('0x1b')](_0x1785aa);}return null;};}function patchUpdates(_0x44984a){return function(_0x26b22d){try{jsonpatch[_0xb2a2('0x21')](_0x26b22d,_0x44984a,!![]);}catch(_0x5930e3){return BPromise[_0xb2a2('0x22')](_0x5930e3);}return _0x26b22d[_0xb2a2('0x23')]();};}function saveUpdates(_0x409095,_0x296196){return function(_0x40079a){if(_0x40079a){return _0x40079a[_0xb2a2('0x24')](_0x409095)[_0xb2a2('0x25')](function(_0x13b8b6){return _0x13b8b6;});}return null;};}function removeEntity(_0xe052c5,_0xe01b68){return function(_0xd0c5){if(_0xd0c5){return _0xd0c5[_0xb2a2('0x26')]()[_0xb2a2('0x25')](function(){_0xe052c5[_0xb2a2('0x19')](0xcc)[_0xb2a2('0x1a')]();});}};}function handleEntityNotFound(_0x3ff7a4,_0xcde7a4){return function(_0x1b1cec){if(!_0x1b1cec){_0x3ff7a4[_0xb2a2('0x18')](0x194);}return _0x1b1cec;};}function handleError(_0x46e7db,_0x424cfc){_0x424cfc=_0x424cfc||0x1f4;return function(_0x5ea1fc){logger[_0xb2a2('0x27')](_0x5ea1fc[_0xb2a2('0x28')]);if(_0x5ea1fc['name']){delete _0x5ea1fc[_0xb2a2('0x29')];}_0x46e7db[_0xb2a2('0x19')](_0x424cfc)['send'](_0x5ea1fc);};}exports[_0xb2a2('0x2a')]=function(_0x2c71a0,_0x15a820){var _0xe73a4c={},_0x5d5836={},_0x49edf3={'count':0x0,'rows':[]};var _0x45c7b3=_[_0xb2a2('0x2b')](db[_0xb2a2('0x2c')][_0xb2a2('0x2d')],function(_0x33eeaa){return{'name':_0x33eeaa['fieldName'],'type':_0x33eeaa[_0xb2a2('0x2e')]['key']};});_0x5d5836[_0xb2a2('0x2f')]=_[_0xb2a2('0x2b')](_0x45c7b3,'name');_0x5d5836[_0xb2a2('0x30')]=_[_0xb2a2('0x31')](_0x2c71a0['query']);_0x5d5836[_0xb2a2('0x32')]=_[_0xb2a2('0x33')](_0x5d5836[_0xb2a2('0x2f')],_0x5d5836[_0xb2a2('0x30')]);_0xe73a4c['attributes']=_[_0xb2a2('0x33')](_0x5d5836[_0xb2a2('0x2f')],qs[_0xb2a2('0x34')](_0x2c71a0[_0xb2a2('0x30')][_0xb2a2('0x34')]));_0xe73a4c['attributes']=_0xe73a4c[_0xb2a2('0x35')][_0xb2a2('0x36')]?_0xe73a4c[_0xb2a2('0x35')]:_0x5d5836[_0xb2a2('0x2f')];if(!_0x2c71a0[_0xb2a2('0x30')]['hasOwnProperty'](_0xb2a2('0x37'))){_0xe73a4c[_0xb2a2('0x1e')]=qs[_0xb2a2('0x1e')](_0x2c71a0[_0xb2a2('0x30')][_0xb2a2('0x1e')]);_0xe73a4c[_0xb2a2('0x1c')]=qs[_0xb2a2('0x1c')](_0x2c71a0['query']['offset']);}_0xe73a4c[_0xb2a2('0x38')]=qs[_0xb2a2('0x39')](_0x2c71a0[_0xb2a2('0x30')][_0xb2a2('0x39')]);_0xe73a4c[_0xb2a2('0x3a')]=qs[_0xb2a2('0x32')](_[_0xb2a2('0x3b')](_0x2c71a0[_0xb2a2('0x30')],_0x5d5836['filters']),_0x45c7b3);if(_0x2c71a0['query'][_0xb2a2('0x3c')]){_0xe73a4c[_0xb2a2('0x3a')]=_[_0xb2a2('0x3d')](_0xe73a4c['where'],{'$or':_[_0xb2a2('0x2b')](_0x45c7b3,function(_0x164bc8){if(_0x164bc8[_0xb2a2('0x2e')]!==_0xb2a2('0x3e')){var _0x4963d8={};_0x4963d8[_0x164bc8[_0xb2a2('0x29')]]={'$like':'%'+_0x2c71a0[_0xb2a2('0x30')][_0xb2a2('0x3c')]+'%'};return _0x4963d8;}})});}_0xe73a4c=_['merge']({},_0xe73a4c,_0x2c71a0['options']);var _0x2e7c48={'where':_0xe73a4c[_0xb2a2('0x3a')]};return db[_0xb2a2('0x2c')][_0xb2a2('0x1f')](_0x2e7c48)[_0xb2a2('0x25')](function(_0x25680d){_0x49edf3[_0xb2a2('0x1f')]=_0x25680d;if(_0x2c71a0[_0xb2a2('0x30')][_0xb2a2('0x3f')]){_0xe73a4c[_0xb2a2('0x40')]=[{'all':!![]}];}return db[_0xb2a2('0x2c')][_0xb2a2('0x41')](_0xe73a4c);})[_0xb2a2('0x25')](function(_0x897a18){_0x49edf3['rows']=_0x897a18;return _0x49edf3;})['then'](respondWithFilteredResult(_0x15a820,_0xe73a4c))[_0xb2a2('0x42')](handleError(_0x15a820,null));};exports[_0xb2a2('0x43')]=function(_0x33611e,_0x751608){var _0x3330fe={'raw':!![],'where':{'id':_0x33611e[_0xb2a2('0x44')]['id']}},_0x4b5450={};_0x4b5450['model']=_[_0xb2a2('0x31')](db[_0xb2a2('0x2c')][_0xb2a2('0x2d')]);_0x4b5450[_0xb2a2('0x30')]=_[_0xb2a2('0x31')](_0x33611e[_0xb2a2('0x30')]);_0x4b5450[_0xb2a2('0x32')]=_[_0xb2a2('0x33')](_0x4b5450[_0xb2a2('0x2f')],_0x4b5450[_0xb2a2('0x30')]);_0x3330fe['attributes']=_[_0xb2a2('0x33')](_0x4b5450[_0xb2a2('0x2f')],qs[_0xb2a2('0x34')](_0x33611e[_0xb2a2('0x30')][_0xb2a2('0x34')]));_0x3330fe[_0xb2a2('0x35')]=_0x3330fe[_0xb2a2('0x35')][_0xb2a2('0x36')]?_0x3330fe['attributes']:_0x4b5450[_0xb2a2('0x2f')];if(_0x33611e[_0xb2a2('0x30')][_0xb2a2('0x3f')]){_0x3330fe['include']=[{'all':!![]}];}_0x3330fe=_[_0xb2a2('0x3d')]({},_0x3330fe,_0x33611e['options']);return db[_0xb2a2('0x2c')][_0xb2a2('0x45')](_0x3330fe)[_0xb2a2('0x25')](handleEntityNotFound(_0x751608,null))[_0xb2a2('0x25')](respondWithResult(_0x751608,null))[_0xb2a2('0x42')](handleError(_0x751608,null));};exports['create']=function(_0x21a951,_0x2cb72e){return db[_0xb2a2('0x2c')][_0xb2a2('0x46')](_0x21a951[_0xb2a2('0x47')],{})[_0xb2a2('0x25')](respondWithResult(_0x2cb72e,0xc9))[_0xb2a2('0x42')](handleError(_0x2cb72e,null));};exports[_0xb2a2('0x24')]=function(_0x4cb8c8,_0x4eeb60){if(_0x4cb8c8[_0xb2a2('0x47')]['id']){delete _0x4cb8c8[_0xb2a2('0x47')]['id'];}return db[_0xb2a2('0x2c')][_0xb2a2('0x45')]({'where':{'id':_0x4cb8c8[_0xb2a2('0x44')]['id']}})[_0xb2a2('0x25')](handleEntityNotFound(_0x4eeb60,null))['then'](saveUpdates(_0x4cb8c8[_0xb2a2('0x47')],null))['then'](respondWithResult(_0x4eeb60,null))[_0xb2a2('0x42')](handleError(_0x4eeb60,null));};exports[_0xb2a2('0x26')]=function(_0x253ad5,_0xc24f89){return db[_0xb2a2('0x2c')][_0xb2a2('0x45')]({'where':{'id':_0x253ad5[_0xb2a2('0x44')]['id']}})['then'](handleEntityNotFound(_0xc24f89,null))[_0xb2a2('0x25')](removeEntity(_0xc24f89,null))['catch'](handleError(_0xc24f89,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f9b8bae..846ac77 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 _0xf37e=['exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0xf37e,0x6f));var _0xef37=function(_0x9d93fc,_0x28038c){_0x9d93fc=_0x9d93fc-0x0;var _0x33d4bd=_0xf37e[_0x9d93fc];return _0x33d4bd;};'use strict';var _=require(_0xef37('0x0'));var util=require('util');var logger=require(_0xef37('0x1'))(_0xef37('0x2'));var moment=require(_0xef37('0x3'));var BPromise=require(_0xef37('0x4'));var rp=require(_0xef37('0x5'));var fs=require('fs');var path=require(_0xef37('0x6'));var rimraf=require('rimraf');var config=require(_0xef37('0x7'));var attributes=require(_0xef37('0x8'));module[_0xef37('0x9')]=function(_0x592f67,_0x4caa00){return _0x592f67[_0xef37('0xa')](_0xef37('0xb'),attributes,{'tableName':_0xef37('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xef37('0xd'),_0xef37('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6196=['DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6196,0x93));var _0x6619=function(_0x1c839a,_0x29dbe0){_0x1c839a=_0x1c839a-0x0;var _0xcf052a=_0x6196[_0x1c839a];return _0xcf052a;};'use strict';var _=require(_0x6619('0x0'));var util=require(_0x6619('0x1'));var logger=require('../../config/logger')(_0x6619('0x2'));var moment=require(_0x6619('0x3'));var BPromise=require(_0x6619('0x4'));var rp=require(_0x6619('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6619('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x6619('0x7')]=function(_0x501f82,_0x5429eb){return _0x501f82[_0x6619('0x8')](_0x6619('0x9'),attributes,{'tableName':_0x6619('0xa'),'paranoid':![],'indexes':[{'name':_0x6619('0xb'),'fields':['idField',_0x6619('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 162ac4e..da79c03 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 _0x4777=['rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','code','error','message','DeskField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x4777,0x10b));var _0x7477=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x4777[_0x95942];return _0x6d7f81;};'use strict';var _=require(_0x7477('0x0'));var util=require(_0x7477('0x1'));var moment=require(_0x7477('0x2'));var BPromise=require(_0x7477('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7477('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7477('0x5'));var logger=require('../../config/logger')(_0x7477('0x6'));var config=require('../../config/environment');var jayson=require(_0x7477('0x7'));var client=jayson[_0x7477('0x8')][_0x7477('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ba420,_0x49386f,_0x32be45){return new BPromise(function(_0x272963,_0x4ba565){return client[_0x7477('0xa')](_0x1ba420,_0x32be45)[_0x7477('0xb')](function(_0x47369d){logger['info']('DeskField,\x20%s,\x20%s',_0x49386f,_0x7477('0xc'));logger[_0x7477('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x49386f,_0x7477('0xc'),JSON[_0x7477('0xe')](_0x47369d));if(_0x47369d['error']){if(_0x47369d['error'][_0x7477('0xf')]===0x1f4){logger[_0x7477('0x10')]('DeskField,\x20%s,\x20%s',_0x49386f,_0x47369d[_0x7477('0x10')]['message']);return _0x4ba565(_0x47369d[_0x7477('0x10')][_0x7477('0x11')]);}logger[_0x7477('0x10')](_0x7477('0x12'),_0x49386f,_0x47369d[_0x7477('0x10')][_0x7477('0x11')]);return _0x272963(_0x47369d[_0x7477('0x10')][_0x7477('0x11')]);}else{logger['info'](_0x7477('0x12'),_0x49386f,'request\x20sent');_0x272963(_0x47369d[_0x7477('0x13')][_0x7477('0x11')]);}})[_0x7477('0x14')](function(_0x1a3295){logger[_0x7477('0x10')](_0x7477('0x12'),_0x49386f,_0x1a3295);_0x4ba565(_0x1a3295);});});} \ No newline at end of file +var _0x12df=['http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\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','client'];(function(_0x44581d,_0x27bfa2){var _0x21cb2d=function(_0x16ddaf){while(--_0x16ddaf){_0x44581d['push'](_0x44581d['shift']());}};_0x21cb2d(++_0x27bfa2);}(_0x12df,0xc3));var _0xf12d=function(_0x262e69,_0x5388b9){_0x262e69=_0x262e69-0x0;var _0x1601aa=_0x12df[_0x262e69];return _0x1601aa;};'use strict';var _=require(_0xf12d('0x0'));var util=require(_0xf12d('0x1'));var moment=require(_0xf12d('0x2'));var BPromise=require(_0xf12d('0x3'));var rs=require(_0xf12d('0x4'));var fs=require('fs');var Redis=require(_0xf12d('0x5'));var db=require(_0xf12d('0x6'))['db'];var utils=require(_0xf12d('0x7'));var logger=require(_0xf12d('0x8'))(_0xf12d('0x9'));var config=require(_0xf12d('0xa'));var jayson=require(_0xf12d('0xb'));var client=jayson[_0xf12d('0xc')][_0xf12d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1464a1,_0x1a44a1,_0xee0320){return new BPromise(function(_0x40c749,_0x4e51f8){return client[_0xf12d('0xe')](_0x1464a1,_0xee0320)[_0xf12d('0xf')](function(_0x571deb){logger[_0xf12d('0x10')](_0xf12d('0x11'),_0x1a44a1,'request\x20sent');logger[_0xf12d('0x12')](_0xf12d('0x13'),_0x1a44a1,_0xf12d('0x14'),JSON[_0xf12d('0x15')](_0x571deb));if(_0x571deb['error']){if(_0x571deb[_0xf12d('0x16')]['code']===0x1f4){logger[_0xf12d('0x16')](_0xf12d('0x11'),_0x1a44a1,_0x571deb['error'][_0xf12d('0x17')]);return _0x4e51f8(_0x571deb[_0xf12d('0x16')]['message']);}logger['error'](_0xf12d('0x11'),_0x1a44a1,_0x571deb[_0xf12d('0x16')][_0xf12d('0x17')]);return _0x40c749(_0x571deb[_0xf12d('0x16')][_0xf12d('0x17')]);}else{logger['info'](_0xf12d('0x11'),_0x1a44a1,_0xf12d('0x14'));_0x40c749(_0x571deb[_0xf12d('0x18')][_0xf12d('0x17')]);}})[_0xf12d('0x19')](function(_0x37c00a){logger[_0xf12d('0x16')](_0xf12d('0x11'),_0x1a44a1,_0x37c00a);_0x4e51f8(_0x37c00a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a9c4e05..c6d9948 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 _0x1ad7=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','post','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x101f71,_0x4d3daa){var _0x2f7aad=function(_0x2530d8){while(--_0x2530d8){_0x101f71['push'](_0x101f71['shift']());}};_0x2f7aad(++_0x4d3daa);}(_0x1ad7,0x19e));var _0x71ad=function(_0x46e82f,_0x8ff37e){_0x46e82f=_0x46e82f-0x0;var _0x14323c=_0x1ad7[_0x46e82f];return _0x14323c;};'use strict';var multer=require(_0x71ad('0x0'));var util=require(_0x71ad('0x1'));var path=require(_0x71ad('0x2'));var timeout=require(_0x71ad('0x3'));var express=require(_0x71ad('0x4'));var router=express['Router']();var fs_extra=require(_0x71ad('0x5'));var auth=require(_0x71ad('0x6'));var interaction=require(_0x71ad('0x7'));var config=require(_0x71ad('0x8'));var controller=require(_0x71ad('0x9'));router[_0x71ad('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x71ad('0xa')](_0x71ad('0xb'),auth[_0x71ad('0xc')](),controller[_0x71ad('0xd')]);router[_0x71ad('0xa')](_0x71ad('0xe'),auth[_0x71ad('0xc')](),controller[_0x71ad('0xf')]);router[_0x71ad('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x71ad('0x10')]('/',auth[_0x71ad('0xc')](),controller['create']);router['post'](_0x71ad('0xe'),auth['isAuthenticated'](),controller[_0x71ad('0x11')]);router['put'](_0x71ad('0xb'),auth[_0x71ad('0xc')](),controller[_0x71ad('0x12')]);router[_0x71ad('0x13')](_0x71ad('0xb'),auth['isAuthenticated'](),controller[_0x71ad('0x14')]);module[_0x71ad('0x15')]=router; \ No newline at end of file +var _0x79fd=['/:id/fields','post','addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x79fd,0x11c));var _0xd79f=function(_0x17d524,_0x1afd2d){_0x17d524=_0x17d524-0x0;var _0x18c36e=_0x79fd[_0x17d524];return _0x18c36e;};'use strict';var multer=require(_0xd79f('0x0'));var util=require(_0xd79f('0x1'));var path=require('path');var timeout=require(_0xd79f('0x2'));var express=require(_0xd79f('0x3'));var router=express[_0xd79f('0x4')]();var fs_extra=require(_0xd79f('0x5'));var auth=require(_0xd79f('0x6'));var interaction=require(_0xd79f('0x7'));var config=require(_0xd79f('0x8'));var controller=require(_0xd79f('0x9'));router[_0xd79f('0xa')]('/',auth[_0xd79f('0xb')](),controller[_0xd79f('0xc')]);router['get']('/:id',auth[_0xd79f('0xb')](),controller[_0xd79f('0xd')]);router[_0xd79f('0xa')](_0xd79f('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd79f('0xa')](_0xd79f('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xd79f('0x10')]('/',auth[_0xd79f('0xb')](),controller['create']);router['post'](_0xd79f('0xe'),auth[_0xd79f('0xb')](),controller[_0xd79f('0x11')]);router[_0xd79f('0x12')](_0xd79f('0x13'),auth[_0xd79f('0xb')](),controller['update']);router[_0xd79f('0x14')](_0xd79f('0x13'),auth[_0xd79f('0xb')](),controller[_0xd79f('0x15')]);module[_0xd79f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a311e0f..a5778a3 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 _0x294b=['sequelize','STRING','BOOLEAN'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb294('0x0'));module['exports']={'name':{'type':Sequelize[_0xb294('0x1')]},'username':{'type':Sequelize[_0xb294('0x1')]},'password':{'type':Sequelize[_0xb294('0x1')]},'remoteUri':{'type':Sequelize[_0xb294('0x1')]},'tenantId':{'type':Sequelize[_0xb294('0x1')]},'clientId':{'type':Sequelize[_0xb294('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb294('0x1')]},'modernAuthentication':{'type':Sequelize[_0xb294('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xecb2=['sequelize','STRING','BOOLEAN'];(function(_0x3cd0a1,_0x1ee1d5){var _0x59d78a=function(_0x4f7cf9){while(--_0x4f7cf9){_0x3cd0a1['push'](_0x3cd0a1['shift']());}};_0x59d78a(++_0x1ee1d5);}(_0xecb2,0xf6));var _0x2ecb=function(_0x2d22a8,_0x43becb){_0x2d22a8=_0x2d22a8-0x0;var _0x1eec9a=_0xecb2[_0x2d22a8];return _0x1eec9a;};'use strict';var Sequelize=require(_0x2ecb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2ecb('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x2ecb('0x1')]},'clientId':{'type':Sequelize[_0x2ecb('0x1')]},'clientSecret':{'type':Sequelize[_0x2ecb('0x1')]},'serverUrl':{'type':Sequelize[_0x2ecb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2ecb('0x1')]},'modernAuthentication':{'type':Sequelize[_0x2ecb('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index df9e8a3..fd05fd4 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 _0x0fc6=['UserLocalizedLabel','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyyominame','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','modernAuthentication','access_token','data7','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','forEach','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Bearer\x20','OptionSet','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption'];(function(_0x2141e1,_0x523aff){var _0x59db37=function(_0x1ffc7c){while(--_0x1ffc7c){_0x2141e1['push'](_0x2141e1['shift']());}};_0x59db37(++_0x523aff);}(_0x0fc6,0x176));var _0x60fc=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0fc6[_0x42cae2];return _0x5f256f;};'use strict';var rp=require(_0x60fc('0x0'));var util=require(_0x60fc('0x1'));var _=require(_0x60fc('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x60fc('0x3'))(_0x60fc('0x4'));var db=require(_0x60fc('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x322322,_0x4eaa25){_0x4eaa25=_0x4eaa25||0xc8;return function(_0x23c1d7){if(_0x23c1d7){return _0x322322[_0x60fc('0x6')](_0x4eaa25)['json'](_0x23c1d7);}};}function respondWithFilteredResult(_0x3491cc,_0x823732){return function(_0x2b5923){if(_0x2b5923){var _0x1cf074=typeof _0x823732[_0x60fc('0x7')]===_0x60fc('0x8')&&typeof _0x823732[_0x60fc('0x9')]==='undefined';var _0x1de3a6=_0x2b5923[_0x60fc('0xa')];var _0x396740=_0x1cf074?0x0:_0x823732[_0x60fc('0x7')];var _0x5a7536=_0x1cf074?_0x2b5923[_0x60fc('0xa')]:_0x823732[_0x60fc('0x7')]+_0x823732['limit'];var _0x11d555;if(_0x5a7536>=_0x1de3a6){_0x5a7536=_0x1de3a6;_0x11d555=0xc8;}else{_0x11d555=0xce;}_0x3491cc[_0x60fc('0x6')](_0x11d555);return _0x3491cc[_0x60fc('0xb')]('Content-Range',_0x396740+'-'+_0x5a7536+'/'+_0x1de3a6)['json'](_0x2b5923);}return null;};}function saveUpdates(_0xb6d714){return function(_0x2c836a){if(_0x2c836a){return _0x2c836a[_0x60fc('0xc')](_0xb6d714)[_0x60fc('0xd')](function(_0x175070){return _0x175070;});}return null;};}function removeEntity(_0x58ef07){return function(_0x435f22){if(_0x435f22){return _0x435f22[_0x60fc('0xe')]()[_0x60fc('0xd')](function(){_0x58ef07[_0x60fc('0x6')](0xcc)[_0x60fc('0xf')]();});}};}function handleEntityNotFound(_0xc75a8c){return function(_0x4e9bf6){if(!_0x4e9bf6){_0xc75a8c[_0x60fc('0x10')](0x194);}return _0x4e9bf6;};}function handleError(_0x3816e2,_0x522902){_0x522902=_0x522902||0x1f4;return function(_0x4d76c2){logger[_0x60fc('0x11')](_0x4d76c2['stack']);if(_0x4d76c2['name']){delete _0x4d76c2[_0x60fc('0x12')];}_0x3816e2[_0x60fc('0x6')](_0x522902)[_0x60fc('0x13')](_0x4d76c2);};}exports[_0x60fc('0x14')]=function(_0x4f236f,_0x307e51){var _0x25e5e8={},_0x27ab90={},_0x37f09d={'count':0x0,'rows':[]};var _0x4a9b8e=_[_0x60fc('0x15')](db[_0x60fc('0x16')][_0x60fc('0x17')],function(_0x2284b0){return{'name':_0x2284b0[_0x60fc('0x18')],'type':_0x2284b0[_0x60fc('0x19')]['key']};});_0x27ab90['model']=_[_0x60fc('0x15')](_0x4a9b8e,_0x60fc('0x12'));_0x27ab90[_0x60fc('0x1a')]=_[_0x60fc('0x1b')](_0x4f236f[_0x60fc('0x1a')]);_0x27ab90[_0x60fc('0x1c')]=_[_0x60fc('0x1d')](_0x27ab90['model'],_0x27ab90[_0x60fc('0x1a')]);_0x25e5e8[_0x60fc('0x1e')]=_['intersection'](_0x27ab90[_0x60fc('0x1f')],qs[_0x60fc('0x20')](_0x4f236f['query']['fields']));_0x25e5e8[_0x60fc('0x1e')]=_0x25e5e8[_0x60fc('0x1e')][_0x60fc('0x21')]?_0x25e5e8[_0x60fc('0x1e')]:_0x27ab90[_0x60fc('0x1f')];if(!_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x22')]('nolimit')){_0x25e5e8[_0x60fc('0x9')]=qs[_0x60fc('0x9')](_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x9')]);_0x25e5e8[_0x60fc('0x7')]=qs[_0x60fc('0x7')](_0x4f236f[_0x60fc('0x1a')]['offset']);}_0x25e5e8[_0x60fc('0x23')]=qs[_0x60fc('0x24')](_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x24')]);_0x25e5e8['where']=qs[_0x60fc('0x1c')](_['pick'](_0x4f236f[_0x60fc('0x1a')],_0x27ab90['filters']),_0x4a9b8e);if(_0x4f236f['query'][_0x60fc('0x25')]){_0x25e5e8[_0x60fc('0x26')]=_[_0x60fc('0x27')](_0x25e5e8['where'],{'$or':_[_0x60fc('0x15')](_0x4a9b8e,function(_0xdc3bc5){if(_0xdc3bc5[_0x60fc('0x19')]!=='VIRTUAL'){var _0x59dfd1={};_0x59dfd1[_0xdc3bc5[_0x60fc('0x12')]]={'$like':'%'+_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x25')]+'%'};return _0x59dfd1;}})});}_0x25e5e8=_['merge']({},_0x25e5e8,_0x4f236f['options']);var _0x2fc68e={'where':_0x25e5e8[_0x60fc('0x26')]};return db[_0x60fc('0x16')][_0x60fc('0xa')](_0x2fc68e)[_0x60fc('0xd')](function(_0x5d30ab){_0x37f09d[_0x60fc('0xa')]=_0x5d30ab;if(_0x4f236f[_0x60fc('0x1a')][_0x60fc('0x28')]){_0x25e5e8[_0x60fc('0x29')]=[{'all':!![]}];}return db[_0x60fc('0x16')]['findAll'](_0x25e5e8);})[_0x60fc('0xd')](function(_0x3cb6ec){_0x37f09d[_0x60fc('0x2a')]=_0x3cb6ec;return _0x37f09d;})[_0x60fc('0xd')](respondWithFilteredResult(_0x307e51,_0x25e5e8))[_0x60fc('0x2b')](handleError(_0x307e51,null));};exports[_0x60fc('0x2c')]=function(_0x363a02,_0x70f9ce){var _0x43e1f8={'raw':![],'where':{'id':_0x363a02[_0x60fc('0x2d')]['id']}},_0x152e3={};_0x152e3[_0x60fc('0x1f')]=_['keys'](db[_0x60fc('0x16')][_0x60fc('0x17')]);_0x152e3[_0x60fc('0x1a')]=_[_0x60fc('0x1b')](_0x363a02[_0x60fc('0x1a')]);_0x152e3[_0x60fc('0x1c')]=_[_0x60fc('0x1d')](_0x152e3[_0x60fc('0x1f')],_0x152e3[_0x60fc('0x1a')]);_0x43e1f8[_0x60fc('0x1e')]=_[_0x60fc('0x1d')](_0x152e3[_0x60fc('0x1f')],qs['fields'](_0x363a02[_0x60fc('0x1a')][_0x60fc('0x20')]));_0x43e1f8['attributes']=_0x43e1f8[_0x60fc('0x1e')]['length']?_0x43e1f8[_0x60fc('0x1e')]:_0x152e3[_0x60fc('0x1f')];if(_0x363a02[_0x60fc('0x1a')][_0x60fc('0x28')]){_0x43e1f8[_0x60fc('0x29')]=[{'all':!![]}];}_0x43e1f8=_['merge']({},_0x43e1f8,_0x363a02['options']);return db[_0x60fc('0x16')][_0x60fc('0x2e')](_0x43e1f8)[_0x60fc('0xd')](handleEntityNotFound(_0x70f9ce,null))['then'](respondWithResult(_0x70f9ce,null))['catch'](handleError(_0x70f9ce,null));};exports[_0x60fc('0x2f')]=function(_0x45cc96,_0x1693dd){return db['Dynamics365Account'][_0x60fc('0x2f')](_0x45cc96[_0x60fc('0x30')],{})[_0x60fc('0xd')](respondWithResult(_0x1693dd,0xc9))['catch'](handleError(_0x1693dd,null));};exports['update']=function(_0x4aa923,_0x2474de){if(_0x4aa923[_0x60fc('0x30')]['id']){delete _0x4aa923['body']['id'];}return db[_0x60fc('0x16')][_0x60fc('0x2e')]({'where':{'id':_0x4aa923[_0x60fc('0x2d')]['id']}})[_0x60fc('0xd')](handleEntityNotFound(_0x2474de,null))[_0x60fc('0xd')](saveUpdates(_0x4aa923[_0x60fc('0x30')],null))[_0x60fc('0xd')](respondWithResult(_0x2474de,null))[_0x60fc('0x2b')](handleError(_0x2474de,null));};exports[_0x60fc('0xe')]=function(_0x8b8f6a,_0x524e17){return db[_0x60fc('0x16')]['find']({'where':{'id':_0x8b8f6a[_0x60fc('0x2d')]['id']}})['then'](handleEntityNotFound(_0x524e17,null))[_0x60fc('0xd')](removeEntity(_0x524e17,null))[_0x60fc('0x2b')](handleError(_0x524e17,null));};exports[_0x60fc('0x31')]=function(_0x24ec45,_0x58af1d){var _0x1dd032={};var _0x5b6a9c={};var _0xeee94d;var _0x5becaf;return db[_0x60fc('0x16')][_0x60fc('0x32')]({'where':{'id':_0x24ec45['params']['id']}})['then'](handleEntityNotFound(_0x58af1d,null))[_0x60fc('0xd')](function(_0x4669e3){if(_0x4669e3){_0xeee94d=_0x4669e3;_0x5b6a9c['model']=_[_0x60fc('0x1b')](db[_0x60fc('0x33')][_0x60fc('0x17')]);_0x5b6a9c[_0x60fc('0x1a')]=_[_0x60fc('0x1b')](_0x24ec45[_0x60fc('0x1a')]);_0x5b6a9c[_0x60fc('0x1c')]=_['intersection'](_0x5b6a9c[_0x60fc('0x1f')],_0x5b6a9c[_0x60fc('0x1a')]);_0x1dd032[_0x60fc('0x1e')]=_[_0x60fc('0x1d')](_0x5b6a9c[_0x60fc('0x1f')],qs[_0x60fc('0x20')](_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x20')]));_0x1dd032[_0x60fc('0x1e')]=_0x1dd032[_0x60fc('0x1e')][_0x60fc('0x21')]?_0x1dd032[_0x60fc('0x1e')]:_0x5b6a9c['model'];_0x1dd032['order']=qs[_0x60fc('0x24')](_0x24ec45['query'][_0x60fc('0x24')]);_0x1dd032[_0x60fc('0x26')]=qs['filters'](_['pick'](_0x24ec45[_0x60fc('0x1a')],_0x5b6a9c['filters']));if(_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x25')]){_0x1dd032[_0x60fc('0x26')]=_[_0x60fc('0x27')](_0x1dd032[_0x60fc('0x26')],{'$or':_[_0x60fc('0x15')](_0x1dd032['attributes'],function(_0x16c692){var _0x8fbd06={};_0x8fbd06[_0x16c692]={'$like':'%'+_0x24ec45['query'][_0x60fc('0x25')]+'%'};return _0x8fbd06;})});}_0x1dd032=_['merge']({},_0x1dd032,_0x24ec45['options']);return _0xeee94d[_0x60fc('0x31')](_0x1dd032);}})[_0x60fc('0xd')](function(_0x1f59fa){if(_0x1f59fa){_0x5becaf=_0x1f59fa['length'];if(!_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x22')]('nolimit')){_0x1dd032[_0x60fc('0x9')]=qs['limit'](_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x9')]);_0x1dd032[_0x60fc('0x7')]=qs[_0x60fc('0x7')](_0x24ec45[_0x60fc('0x1a')][_0x60fc('0x7')]);}return _0xeee94d[_0x60fc('0x31')](_0x1dd032);}})[_0x60fc('0xd')](function(_0xdcf72a){if(_0xdcf72a){return _0xdcf72a?{'count':_0x5becaf,'rows':_0xdcf72a}:null;}})[_0x60fc('0xd')](respondWithResult(_0x58af1d,null))[_0x60fc('0x2b')](handleError(_0x58af1d,null));};exports[_0x60fc('0x34')]=function(_0x56cba8,_0xed6430){if(_0x56cba8[_0x60fc('0x30')]['id']){delete _0x56cba8['body']['id'];}return db[_0x60fc('0x16')][_0x60fc('0x32')]({'where':{'id':_0x56cba8[_0x60fc('0x2d')]['id']}})[_0x60fc('0xd')](handleEntityNotFound(_0xed6430,null))['then'](function(_0x2323f0){if(_0x2323f0){_0x56cba8[_0x60fc('0x30')][_0x60fc('0x35')]=_0x2323f0['id'];_0x56cba8[_0x60fc('0x30')][_0x60fc('0x36')]=integrations[_0x60fc('0x37')](_0x56cba8[_0x60fc('0x30')][_0x60fc('0x38')],_0x56cba8[_0x60fc('0x30')][_0x60fc('0x19')]);_0x56cba8[_0x60fc('0x30')]['Descriptions']=integrations[_0x60fc('0x39')](_0x56cba8[_0x60fc('0x30')][_0x60fc('0x38')],_0x56cba8['body']['type']);return db[_0x60fc('0x33')][_0x60fc('0x2f')](_0x56cba8[_0x60fc('0x30')],{'include':[{'model':db[_0x60fc('0x3a')],'as':_0x60fc('0x36')},{'model':db[_0x60fc('0x3a')],'as':_0x60fc('0x3b')}]});}return null;})[_0x60fc('0xd')](respondWithResult(_0xed6430,null))['catch'](handleError(_0xed6430,null));};function sanitizeRemoteUri(_0x2da367){var _0x190694=_0x2da367[_0x60fc('0x3c')](-0x1);if(_0x190694==='/')return _0x2da367[_0x60fc('0x3d')](0x0,_0x2da367[_0x60fc('0x3e')](_0x190694));return _0x2da367;}function getWebApiUrl(_0x22ac78){return util[_0x60fc('0x3f')](_0x60fc('0x40'),_0x22ac78);}exports[_0x60fc('0x41')]=function(_0x89db9c,_0x3389d0){var _0x247dac=_0x89db9c[_0x60fc('0x1a')][_0x60fc('0x42')];var _0x3af3ea=_0x247dac===_0x60fc('0x43')?_0x60fc('0x44'):_0x60fc('0x45');var _0x5a24fa='';var _0x3c9492='';var _0x22292f='';var _0x405c9b='';var _0x258afe='';var _0x5a2a01='';var _0x197687='';var _0x146423='';var _0x381fee=['title',_0x60fc('0x46'),'customerid',_0x60fc('0x47'),_0x60fc('0x48'),'subject',_0x60fc('0x49'),_0x60fc('0x4a'),_0x60fc('0x4b'),_0x60fc('0x4c')];var _0x145986=[_0x60fc('0x4d'),_0x60fc('0x4e'),_0x60fc('0x4f'),_0x60fc('0x50'),_0x60fc('0x51'),_0x60fc('0x52'),'contractdetailidname',_0x60fc('0x53'),_0x60fc('0x54'),'createdbyexternalpartyyominame',_0x60fc('0x55'),'createdbyyominame',_0x60fc('0x56'),'createdonbehalfbyname',_0x60fc('0x57'),'customeridname','customeridtype',_0x60fc('0x58'),'emailaddress',_0x60fc('0x59'),_0x60fc('0x5a'),_0x60fc('0x5b'),_0x60fc('0x5c'),_0x60fc('0x5d'),_0x60fc('0x5e'),_0x60fc('0x5f'),_0x60fc('0x60'),_0x60fc('0x61'),_0x60fc('0x62'),_0x60fc('0x63'),_0x60fc('0x64'),_0x60fc('0x65'),_0x60fc('0x66'),'modifiedbyname',_0x60fc('0x67'),_0x60fc('0x68'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x60fc('0x69'),_0x60fc('0x6a'),_0x60fc('0x6b'),_0x60fc('0x6c'),'overriddencreatedon','owneridname','owneridtype',_0x60fc('0x6d'),_0x60fc('0x6e'),_0x60fc('0x6f'),_0x60fc('0x70'),'prioritycodename','productidname','productserialnumber',_0x60fc('0x71'),_0x60fc('0x72'),_0x60fc('0x73'),_0x60fc('0x74'),_0x60fc('0x75'),'sentimentvalue','slainvokedidname',_0x60fc('0x76'),'socialprofileidname','statecode','statuscode','subjectidname',_0x60fc('0x77'),_0x60fc('0x78'),_0x60fc('0x79'),_0x60fc('0x7a'),_0x60fc('0x7b'),_0x60fc('0x7c')];var _0x17926f=_0x381fee[_0x60fc('0x7d')](_0x145986);return db[_0x60fc('0x16')][_0x60fc('0x32')]({'where':{'id':_0x89db9c['params']['id']},'attributes':['id',_0x60fc('0x7e'),'password',_0x60fc('0x7f'),_0x60fc('0x80'),_0x60fc('0x81'),_0x60fc('0x82'),'modernAuthentication'],'include':[{'model':db[_0x60fc('0x83')],'as':_0x60fc('0x83'),'attributes':['id',_0x60fc('0x84'),'data7']}]})[_0x60fc('0xd')](handleEntityNotFound(_0x3389d0,null))[_0x60fc('0xd')](function(_0x3e25fd){if(_0x3e25fd){if(_0x3e25fd[_0x60fc('0x85')]){_0x3e25fd[_0x60fc('0x86')]=_0x3e25fd['CloudProvider'][_0x60fc('0x84')];_0x146423=sanitizeRemoteUri(_0x3e25fd[_0x60fc('0x83')][_0x60fc('0x87')]);_0x197687=getWebApiUrl(_0x146423);return _0x3e25fd;}_0x146423=sanitizeRemoteUri(_0x3e25fd[_0x60fc('0x7f')]);_0x197687=getWebApiUrl(_0x146423);var _0x5a6ed4={'method':_0x60fc('0x88'),'uri':_0x60fc('0x89')+_0x3e25fd[_0x60fc('0x80')]+_0x60fc('0x8a'),'form':{'client_id':_0x3e25fd['clientId'],'resource':_0x146423,'username':_0x3e25fd['username'],'password':_0x3e25fd['password'],'grant_type':'password','client_secret':_0x3e25fd[_0x60fc('0x82')]},'json':!![]};return rp(_0x5a6ed4);}})[_0x60fc('0xd')](function(_0x49342a){_0x5a2a01=_0x49342a[_0x60fc('0x86')];var _0x1a68fd={'method':_0x60fc('0x8b'),'uri':encodeURI(_0x197687+_0x60fc('0x8c')+_0x3af3ea+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5a2a01,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1a68fd);})[_0x60fc('0xd')](function(_0x1f5740){var _0x89c4ed=_0x1f5740[_0x60fc('0x8d')][0x0];var _0x15fa99=_0x89c4ed['MetadataId'];var _0x18fee4={'method':_0x60fc('0x8b'),'uri':_0x197687+_0x60fc('0x8e')+_0x15fa99+_0x60fc('0x8f'),'headers':{'Authorization':'Bearer\x20'+_0x5a2a01,'If-None-Match':null,'OData-Version':_0x60fc('0x90')},'json':!![]};return rp(_0x18fee4);})['then'](function(_0x4669cb){_0x5a24fa=_0x4669cb;_0x3c9492=_0x5a24fa['Attributes'];_0x3c9492=_[_0x60fc('0x91')](_0x3c9492,function(_0x29c16a){return!_0x17926f[_0x60fc('0x92')](_0x29c16a[_0x60fc('0x93')]);});var _0x558069=[];var _0x12eb0c=[];_0x3c9492['forEach'](function(_0x5b2313){if(_0x5b2313[_0x60fc('0x94')]){var _0x1fc26d=_0x5b2313[_0x60fc('0x94')][_0x60fc('0x3d')](_0x5b2313[_0x60fc('0x94')][_0x60fc('0x3e')]('.')+0x1);if(_0x1fc26d===_0x60fc('0x95')){_0x558069[_0x60fc('0x96')](getSelectList(_0x197687,_0x247dac,_0x12eb0c,_0x5a24fa[_0x60fc('0x97')],_0x5b2313[_0x60fc('0x97')],_0x5a2a01));}}});return Promise['all'](_0x558069);})[_0x60fc('0xd')](function(_0x48cb52){_0x22292f=_0x48cb52[0x0];var _0x55f150=[];var _0x4a71bc=[];_0x3c9492[_0x60fc('0x98')](function(_0xe429b7){if(!_['isNil'](_0xe429b7[_0x60fc('0x94')])){var _0x3c9973=_0xe429b7[_0x60fc('0x94')]['substring'](_0xe429b7['@odata.type'][_0x60fc('0x3e')]('.')+0x1);if(_0x3c9973===_0x60fc('0x99')){_0x55f150[_0x60fc('0x96')](getBooleanList(_0x197687,_0x247dac,_0x4a71bc,_0x5a24fa['MetadataId'],_0xe429b7['MetadataId'],_0x5a2a01));}}});return Promise['all'](_0x55f150);})[_0x60fc('0xd')](function(_0x33d9fb){_0x405c9b=_0x33d9fb[0x0];var _0x1d9c5b=[];var _0x2ce374=[];_0x3c9492[_0x60fc('0x98')](function(_0x224e9c){if(_0x224e9c[_0x60fc('0x94')]){var _0x563d70=_0x224e9c[_0x60fc('0x94')][_0x60fc('0x3d')](_0x224e9c[_0x60fc('0x94')][_0x60fc('0x3e')]('.')+0x1);if(_0x563d70===_0x60fc('0x9a')||_0x563d70===_0x60fc('0x9b')||_0x563d70===_0x60fc('0x9c')||_0x563d70===_0x60fc('0x9d')||_0x563d70===_0x60fc('0x9e')||_0x563d70===_0x60fc('0x9f')||_0x563d70===_0x60fc('0xa0')||_0x563d70===_0x60fc('0xa1')||_0x563d70===_0x60fc('0xa2')||_0x563d70===_0x60fc('0xa3')){_0x1d9c5b[_0x60fc('0x96')](getInputList(_0x197687,_0x247dac,_0x563d70,_0x2ce374,_0x5a24fa[_0x60fc('0x97')],_0x224e9c[_0x60fc('0x97')],_0x5a2a01));}}});return Promise[_0x60fc('0xa4')](_0x1d9c5b);})['then'](function(_0x33e084){_0x258afe=_0x33e084[0x0];var _0x1e5738=_0x22292f[_0x60fc('0x7d')](_0x405c9b)[_0x60fc('0x7d')](_0x258afe);var _0xe0e255={'count':_0x1e5738[_0x60fc('0x21')],'rows':_0x1e5738};return _0xe0e255;})[_0x60fc('0xd')](respondWithResult(_0x3389d0,null))[_0x60fc('0x2b')](function(_0x396e18){var _0x19a4b3=_0x89db9c[_0x60fc('0x1a')][_0x60fc('0xa5')]?0x1f4:_0x396e18[_0x60fc('0xa6')]||0x1f4;logger[_0x60fc('0x11')](_0x396e18['stack']);delete _0x396e18[_0x60fc('0x12')];if(_0x19a4b3===0x191){_0x19a4b3=0x190;}_0x3389d0[_0x60fc('0x6')](_0x19a4b3)['send'](_0x89db9c[_0x60fc('0x1a')]['test']?{'message':_0x60fc('0xa7'),'statusCode':_0x396e18[_0x60fc('0xa6')]}:_0x396e18);});};function getSelectList(_0x56afb2,_0x5c7b05,_0x5444f1,_0x5015e5,_0x1d1651,_0x55096b){var _0x2361a9={'method':_0x60fc('0x8b'),'uri':_0x56afb2+_0x60fc('0x8e')+_0x5015e5+_0x60fc('0xa8')+_0x1d1651+_0x60fc('0xa9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x60fc('0xaa')+_0x55096b,'If-None-Match':null,'OData-Version':_0x60fc('0x90')},'json':!![]};return rp(_0x2361a9)[_0x60fc('0xd')](function(_0x5ce310){var _0x34cf67=[];var _0x2a2356=_0x5ce310[_0x60fc('0xab')][_0x60fc('0xac')];_0x2a2356['forEach'](function(_0x5361c9){_0x34cf67[_0x60fc('0x96')]({'name':_0x5361c9[_0x60fc('0xad')]['UserLocalizedLabel'][_0x60fc('0xad')],'value':String(_0x5361c9[_0x60fc('0xae')])});});var _0x4394d0={'id':_0x5c7b05+'_'+_0x5ce310[_0x60fc('0x93')],'name':_0x5ce310[_0x60fc('0xaf')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x34cf67};_0x5444f1[_0x60fc('0x96')](_0x4394d0);return _0x5444f1;});}function getBooleanList(_0x1775e6,_0x3b2a2c,_0x21074f,_0x300e39,_0x3ea096,_0x3897e2){var _0x2dbd0d={'method':_0x60fc('0x8b'),'uri':_0x1775e6+'EntityDefinitions('+_0x300e39+_0x60fc('0xa8')+_0x3ea096+_0x60fc('0xb0'),'headers':{'Authorization':_0x60fc('0xaa')+_0x3897e2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2dbd0d)['then'](function(_0x639680){var _0x58d11c=[];_0x58d11c[_0x60fc('0x96')]({'name':_0x639680['OptionSet'][_0x60fc('0xb1')][_0x60fc('0xad')][_0x60fc('0xb2')]['Label'],'value':_0x60fc('0xb3')},{'name':_0x639680['OptionSet'][_0x60fc('0xb4')][_0x60fc('0xad')][_0x60fc('0xb2')][_0x60fc('0xad')],'value':_0x60fc('0xb5')});var _0x578f91={'id':_0x3b2a2c+'_'+_0x639680[_0x60fc('0x93')],'name':_0x639680[_0x60fc('0xaf')][_0x60fc('0xb2')][_0x60fc('0xad')],'custom':![],'options':_0x58d11c};_0x21074f['push'](_0x578f91);return _0x21074f;});}function getInputList(_0x3cac52,_0x57a016,_0x34021d,_0x254df6,_0x2b2d57,_0x2d910a,_0x1e6520){var _0x89a297={'method':_0x60fc('0x8b'),'uri':_0x3cac52+'EntityDefinitions('+_0x2b2d57+_0x60fc('0xa8')+_0x2d910a+_0x60fc('0xb6')+_0x34021d+_0x60fc('0xb7'),'headers':{'Authorization':'Bearer\x20'+_0x1e6520,'If-None-Match':null,'OData-Version':_0x60fc('0x90')},'json':!![]};return rp(_0x89a297)[_0x60fc('0xd')](function(_0x4ad9f1){var _0x2f947c={'id':_0x57a016+'_'+_0x4ad9f1['LogicalName'],'name':_0x4ad9f1[_0x60fc('0xaf')][_0x60fc('0xb2')]?_0x4ad9f1[_0x60fc('0xaf')][_0x60fc('0xb2')][_0x60fc('0xad')]:_0x4ad9f1[_0x60fc('0x93')],'custom':![],'options':[]};_0x254df6[_0x60fc('0x96')](_0x2f947c);return _0x254df6;});} \ No newline at end of file +var _0x3b23=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','merge','where','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','substring','lastIndexOf','Incident','description','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','importsequencenumber','masteridname','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','onholdtime','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','GET','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','forEach','BooleanAttributeMetadata','all','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','UserLocalizedLabel','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','EntityDefinitions(',')/Microsoft.Dynamics.CRM.','util','lodash','../../components/parsers/qs','../../config/logger','json','offset','limit','undefined','count','status','set','Content-Range','then','destroy','sendStatus','error','name','send','index','map','Dynamics365Account','type','model','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b23,0x8d));var _0x33b2=function(_0x37b74f,_0x260fce){_0x37b74f=_0x37b74f-0x0;var _0x35f223=_0x3b23[_0x37b74f];return _0x35f223;};'use strict';var rp=require('request-promise');var util=require(_0x33b2('0x0'));var _=require(_0x33b2('0x1'));var qs=require(_0x33b2('0x2'));var logger=require(_0x33b2('0x3'))('api');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x30db67,_0x94da31){_0x94da31=_0x94da31||0xc8;return function(_0x15efb1){if(_0x15efb1){return _0x30db67['status'](_0x94da31)[_0x33b2('0x4')](_0x15efb1);}};}function respondWithFilteredResult(_0x4b3cdd,_0x509eaf){return function(_0x4dd73c){if(_0x4dd73c){var _0x383587=typeof _0x509eaf[_0x33b2('0x5')]==='undefined'&&typeof _0x509eaf[_0x33b2('0x6')]===_0x33b2('0x7');var _0x1712ab=_0x4dd73c[_0x33b2('0x8')];var _0x9ad26d=_0x383587?0x0:_0x509eaf[_0x33b2('0x5')];var _0x41aa47=_0x383587?_0x4dd73c[_0x33b2('0x8')]:_0x509eaf['offset']+_0x509eaf[_0x33b2('0x6')];var _0x1439c2;if(_0x41aa47>=_0x1712ab){_0x41aa47=_0x1712ab;_0x1439c2=0xc8;}else{_0x1439c2=0xce;}_0x4b3cdd[_0x33b2('0x9')](_0x1439c2);return _0x4b3cdd[_0x33b2('0xa')](_0x33b2('0xb'),_0x9ad26d+'-'+_0x41aa47+'/'+_0x1712ab)[_0x33b2('0x4')](_0x4dd73c);}return null;};}function saveUpdates(_0x395717){return function(_0x37fc0c){if(_0x37fc0c){return _0x37fc0c['update'](_0x395717)[_0x33b2('0xc')](function(_0x3f1717){return _0x3f1717;});}return null;};}function removeEntity(_0x9463b){return function(_0x244dfe){if(_0x244dfe){return _0x244dfe[_0x33b2('0xd')]()[_0x33b2('0xc')](function(){_0x9463b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0b95){return function(_0x3f8072){if(!_0x3f8072){_0x1c0b95[_0x33b2('0xe')](0x194);}return _0x3f8072;};}function handleError(_0x4acf43,_0x2ae968){_0x2ae968=_0x2ae968||0x1f4;return function(_0x18738c){logger[_0x33b2('0xf')](_0x18738c['stack']);if(_0x18738c[_0x33b2('0x10')]){delete _0x18738c[_0x33b2('0x10')];}_0x4acf43[_0x33b2('0x9')](_0x2ae968)[_0x33b2('0x11')](_0x18738c);};}exports[_0x33b2('0x12')]=function(_0x23a27b,_0x51ec79){var _0x6fa122={},_0x2c5ecc={},_0x17e94b={'count':0x0,'rows':[]};var _0x4a1964=_[_0x33b2('0x13')](db[_0x33b2('0x14')]['rawAttributes'],function(_0x323492){return{'name':_0x323492['fieldName'],'type':_0x323492[_0x33b2('0x15')]['key']};});_0x2c5ecc[_0x33b2('0x16')]=_[_0x33b2('0x13')](_0x4a1964,'name');_0x2c5ecc[_0x33b2('0x17')]=_[_0x33b2('0x18')](_0x23a27b[_0x33b2('0x17')]);_0x2c5ecc[_0x33b2('0x19')]=_[_0x33b2('0x1a')](_0x2c5ecc[_0x33b2('0x16')],_0x2c5ecc[_0x33b2('0x17')]);_0x6fa122[_0x33b2('0x1b')]=_[_0x33b2('0x1a')](_0x2c5ecc[_0x33b2('0x16')],qs[_0x33b2('0x1c')](_0x23a27b[_0x33b2('0x17')][_0x33b2('0x1c')]));_0x6fa122['attributes']=_0x6fa122[_0x33b2('0x1b')][_0x33b2('0x1d')]?_0x6fa122['attributes']:_0x2c5ecc[_0x33b2('0x16')];if(!_0x23a27b['query'][_0x33b2('0x1e')](_0x33b2('0x1f'))){_0x6fa122[_0x33b2('0x6')]=qs[_0x33b2('0x6')](_0x23a27b[_0x33b2('0x17')][_0x33b2('0x6')]);_0x6fa122[_0x33b2('0x5')]=qs[_0x33b2('0x5')](_0x23a27b[_0x33b2('0x17')]['offset']);}_0x6fa122[_0x33b2('0x20')]=qs['sort'](_0x23a27b[_0x33b2('0x17')]['sort']);_0x6fa122['where']=qs[_0x33b2('0x19')](_['pick'](_0x23a27b[_0x33b2('0x17')],_0x2c5ecc[_0x33b2('0x19')]),_0x4a1964);if(_0x23a27b['query'][_0x33b2('0x21')]){_0x6fa122['where']=_[_0x33b2('0x22')](_0x6fa122[_0x33b2('0x23')],{'$or':_[_0x33b2('0x13')](_0x4a1964,function(_0x1f97b3){if(_0x1f97b3[_0x33b2('0x15')]!=='VIRTUAL'){var _0x34b104={};_0x34b104[_0x1f97b3[_0x33b2('0x10')]]={'$like':'%'+_0x23a27b[_0x33b2('0x17')][_0x33b2('0x21')]+'%'};return _0x34b104;}})});}_0x6fa122=_[_0x33b2('0x22')]({},_0x6fa122,_0x23a27b[_0x33b2('0x24')]);var _0x2225b6={'where':_0x6fa122['where']};return db[_0x33b2('0x14')][_0x33b2('0x8')](_0x2225b6)[_0x33b2('0xc')](function(_0x513f12){_0x17e94b[_0x33b2('0x8')]=_0x513f12;if(_0x23a27b['query'][_0x33b2('0x25')]){_0x6fa122['include']=[{'all':!![]}];}return db[_0x33b2('0x14')]['findAll'](_0x6fa122);})[_0x33b2('0xc')](function(_0x1b1b15){_0x17e94b[_0x33b2('0x26')]=_0x1b1b15;return _0x17e94b;})['then'](respondWithFilteredResult(_0x51ec79,_0x6fa122))[_0x33b2('0x27')](handleError(_0x51ec79,null));};exports[_0x33b2('0x28')]=function(_0x2a3243,_0x27edb6){var _0x13d1fd={'raw':![],'where':{'id':_0x2a3243[_0x33b2('0x29')]['id']}},_0x14b6a4={};_0x14b6a4[_0x33b2('0x16')]=_[_0x33b2('0x18')](db[_0x33b2('0x14')][_0x33b2('0x2a')]);_0x14b6a4[_0x33b2('0x17')]=_[_0x33b2('0x18')](_0x2a3243[_0x33b2('0x17')]);_0x14b6a4[_0x33b2('0x19')]=_[_0x33b2('0x1a')](_0x14b6a4[_0x33b2('0x16')],_0x14b6a4[_0x33b2('0x17')]);_0x13d1fd[_0x33b2('0x1b')]=_[_0x33b2('0x1a')](_0x14b6a4[_0x33b2('0x16')],qs[_0x33b2('0x1c')](_0x2a3243[_0x33b2('0x17')]['fields']));_0x13d1fd[_0x33b2('0x1b')]=_0x13d1fd[_0x33b2('0x1b')]['length']?_0x13d1fd[_0x33b2('0x1b')]:_0x14b6a4[_0x33b2('0x16')];if(_0x2a3243['query'][_0x33b2('0x25')]){_0x13d1fd[_0x33b2('0x2b')]=[{'all':!![]}];}_0x13d1fd=_['merge']({},_0x13d1fd,_0x2a3243[_0x33b2('0x24')]);return db[_0x33b2('0x14')][_0x33b2('0x2c')](_0x13d1fd)[_0x33b2('0xc')](handleEntityNotFound(_0x27edb6,null))[_0x33b2('0xc')](respondWithResult(_0x27edb6,null))[_0x33b2('0x27')](handleError(_0x27edb6,null));};exports[_0x33b2('0x2d')]=function(_0x5397cd,_0x111592){return db[_0x33b2('0x14')][_0x33b2('0x2d')](_0x5397cd[_0x33b2('0x2e')],{})[_0x33b2('0xc')](respondWithResult(_0x111592,0xc9))[_0x33b2('0x27')](handleError(_0x111592,null));};exports[_0x33b2('0x2f')]=function(_0x26cdce,_0x765469){if(_0x26cdce[_0x33b2('0x2e')]['id']){delete _0x26cdce[_0x33b2('0x2e')]['id'];}return db[_0x33b2('0x14')][_0x33b2('0x2c')]({'where':{'id':_0x26cdce['params']['id']}})[_0x33b2('0xc')](handleEntityNotFound(_0x765469,null))[_0x33b2('0xc')](saveUpdates(_0x26cdce['body'],null))['then'](respondWithResult(_0x765469,null))[_0x33b2('0x27')](handleError(_0x765469,null));};exports[_0x33b2('0xd')]=function(_0x32ba01,_0x457331){return db[_0x33b2('0x14')]['find']({'where':{'id':_0x32ba01['params']['id']}})[_0x33b2('0xc')](handleEntityNotFound(_0x457331,null))[_0x33b2('0xc')](removeEntity(_0x457331,null))[_0x33b2('0x27')](handleError(_0x457331,null));};exports[_0x33b2('0x30')]=function(_0x3f0e03,_0xa7552e){var _0x38324a={};var _0x55b1fb={};var _0x5aef51;var _0x48d595;return db[_0x33b2('0x14')][_0x33b2('0x31')]({'where':{'id':_0x3f0e03[_0x33b2('0x29')]['id']}})[_0x33b2('0xc')](handleEntityNotFound(_0xa7552e,null))[_0x33b2('0xc')](function(_0x316258){if(_0x316258){_0x5aef51=_0x316258;_0x55b1fb[_0x33b2('0x16')]=_['keys'](db['Dynamics365Configuration'][_0x33b2('0x2a')]);_0x55b1fb['query']=_[_0x33b2('0x18')](_0x3f0e03[_0x33b2('0x17')]);_0x55b1fb[_0x33b2('0x19')]=_['intersection'](_0x55b1fb['model'],_0x55b1fb[_0x33b2('0x17')]);_0x38324a[_0x33b2('0x1b')]=_[_0x33b2('0x1a')](_0x55b1fb[_0x33b2('0x16')],qs[_0x33b2('0x1c')](_0x3f0e03[_0x33b2('0x17')][_0x33b2('0x1c')]));_0x38324a[_0x33b2('0x1b')]=_0x38324a[_0x33b2('0x1b')][_0x33b2('0x1d')]?_0x38324a[_0x33b2('0x1b')]:_0x55b1fb[_0x33b2('0x16')];_0x38324a[_0x33b2('0x20')]=qs['sort'](_0x3f0e03[_0x33b2('0x17')]['sort']);_0x38324a[_0x33b2('0x23')]=qs[_0x33b2('0x19')](_[_0x33b2('0x32')](_0x3f0e03[_0x33b2('0x17')],_0x55b1fb['filters']));if(_0x3f0e03['query'][_0x33b2('0x21')]){_0x38324a['where']=_[_0x33b2('0x22')](_0x38324a[_0x33b2('0x23')],{'$or':_[_0x33b2('0x13')](_0x38324a['attributes'],function(_0x5bb220){var _0x4499ef={};_0x4499ef[_0x5bb220]={'$like':'%'+_0x3f0e03['query']['filter']+'%'};return _0x4499ef;})});}_0x38324a=_[_0x33b2('0x22')]({},_0x38324a,_0x3f0e03['options']);return _0x5aef51[_0x33b2('0x30')](_0x38324a);}})[_0x33b2('0xc')](function(_0x9796dc){if(_0x9796dc){_0x48d595=_0x9796dc['length'];if(!_0x3f0e03[_0x33b2('0x17')][_0x33b2('0x1e')](_0x33b2('0x1f'))){_0x38324a[_0x33b2('0x6')]=qs[_0x33b2('0x6')](_0x3f0e03['query'][_0x33b2('0x6')]);_0x38324a[_0x33b2('0x5')]=qs[_0x33b2('0x5')](_0x3f0e03[_0x33b2('0x17')][_0x33b2('0x5')]);}return _0x5aef51[_0x33b2('0x30')](_0x38324a);}})[_0x33b2('0xc')](function(_0x457c18){if(_0x457c18){return _0x457c18?{'count':_0x48d595,'rows':_0x457c18}:null;}})[_0x33b2('0xc')](respondWithResult(_0xa7552e,null))['catch'](handleError(_0xa7552e,null));};exports[_0x33b2('0x33')]=function(_0x3b992b,_0x2fbef7){if(_0x3b992b['body']['id']){delete _0x3b992b[_0x33b2('0x2e')]['id'];}return db[_0x33b2('0x14')][_0x33b2('0x31')]({'where':{'id':_0x3b992b[_0x33b2('0x29')]['id']}})['then'](handleEntityNotFound(_0x2fbef7,null))[_0x33b2('0xc')](function(_0x235dca){if(_0x235dca){_0x3b992b[_0x33b2('0x2e')][_0x33b2('0x34')]=_0x235dca['id'];_0x3b992b[_0x33b2('0x2e')][_0x33b2('0x35')]=integrations['getSubjects'](_0x3b992b[_0x33b2('0x2e')][_0x33b2('0x36')],_0x3b992b[_0x33b2('0x2e')]['type']);_0x3b992b[_0x33b2('0x2e')][_0x33b2('0x37')]=integrations[_0x33b2('0x38')](_0x3b992b[_0x33b2('0x2e')][_0x33b2('0x36')],_0x3b992b[_0x33b2('0x2e')][_0x33b2('0x15')]);return db[_0x33b2('0x39')]['create'](_0x3b992b['body'],{'include':[{'model':db[_0x33b2('0x3a')],'as':_0x33b2('0x35')},{'model':db[_0x33b2('0x3a')],'as':_0x33b2('0x37')}]});}return null;})[_0x33b2('0xc')](respondWithResult(_0x2fbef7,null))[_0x33b2('0x27')](handleError(_0x2fbef7,null));};function sanitizeRemoteUri(_0x50b972){var _0x34fcbd=_0x50b972['slice'](-0x1);if(_0x34fcbd==='/')return _0x50b972[_0x33b2('0x3b')](0x0,_0x50b972[_0x33b2('0x3c')](_0x34fcbd));return _0x50b972;}function getWebApiUrl(_0xc138de){return util['format']('%s/api/data/v9.0/',_0xc138de);}exports['getFields']=function(_0x2802b5,_0x1e6b5e){var _0x1d70ba=_0x2802b5['query']['ticketType'];var _0x90d394=_0x1d70ba==='incident'?_0x33b2('0x3d'):'PhoneCall';var _0x52b696='';var _0x281599='';var _0x5c1d61='';var _0x407268='';var _0x3b816f='';var _0x34e6c2='';var _0x3d9f1c='';var _0x19ce70='';var _0x6c65b8=['title',_0x33b2('0x3e'),'customerid',_0x33b2('0x3f'),_0x33b2('0x40'),'subject',_0x33b2('0x41'),_0x33b2('0x42'),_0x33b2('0x43'),'phonecall_activity_parties'];var _0x3e9cd5=['accountidname',_0x33b2('0x44'),_0x33b2('0x45'),'billedserviceunits',_0x33b2('0x46'),_0x33b2('0x47'),_0x33b2('0x48'),_0x33b2('0x49'),_0x33b2('0x4a'),_0x33b2('0x4b'),_0x33b2('0x4c'),_0x33b2('0x4d'),_0x33b2('0x4e'),_0x33b2('0x4f'),'createdonbehalfbyyominame','customeridname',_0x33b2('0x50'),'customeridyominame',_0x33b2('0x51'),_0x33b2('0x52'),_0x33b2('0x53'),_0x33b2('0x54'),'escalatedon',_0x33b2('0x55'),'firstresponsebykpiidname','followupby',_0x33b2('0x56'),'influencescore','kbarticleidname','lastonholdtime',_0x33b2('0x57'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x33b2('0x58'),'modifiedbyyominame',_0x33b2('0x59'),_0x33b2('0x5a'),_0x33b2('0x5b'),'msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents',_0x33b2('0x5c'),'overriddencreatedon','owneridname','owneridtype',_0x33b2('0x5d'),_0x33b2('0x5e'),'primarycontactidname',_0x33b2('0x5f'),_0x33b2('0x60'),_0x33b2('0x61'),'productserialnumber',_0x33b2('0x62'),_0x33b2('0x63'),_0x33b2('0x64'),_0x33b2('0x65'),_0x33b2('0x66'),_0x33b2('0x67'),_0x33b2('0x68'),'slaname','socialprofileidname',_0x33b2('0x69'),_0x33b2('0x6a'),_0x33b2('0x6b'),_0x33b2('0x6c'),_0x33b2('0x6d'),_0x33b2('0x6e'),_0x33b2('0x6f'),_0x33b2('0x70'),_0x33b2('0x71')];var _0x5a322d=_0x6c65b8[_0x33b2('0x72')](_0x3e9cd5);return db[_0x33b2('0x14')]['findOne']({'where':{'id':_0x2802b5[_0x33b2('0x29')]['id']},'attributes':['id',_0x33b2('0x73'),_0x33b2('0x74'),_0x33b2('0x75'),'tenantId',_0x33b2('0x76'),_0x33b2('0x77'),_0x33b2('0x78')],'include':[{'model':db[_0x33b2('0x79')],'as':_0x33b2('0x79'),'attributes':['id',_0x33b2('0x7a'),_0x33b2('0x7b')]}]})[_0x33b2('0xc')](handleEntityNotFound(_0x1e6b5e,null))['then'](function(_0x46d198){if(_0x46d198){if(_0x46d198['modernAuthentication']){_0x46d198['access_token']=_0x46d198[_0x33b2('0x79')][_0x33b2('0x7a')];_0x19ce70=sanitizeRemoteUri(_0x46d198['CloudProvider']['data7']);_0x3d9f1c=getWebApiUrl(_0x19ce70);return _0x46d198;}_0x19ce70=sanitizeRemoteUri(_0x46d198[_0x33b2('0x75')]);_0x3d9f1c=getWebApiUrl(_0x19ce70);var _0x55bf4b={'method':_0x33b2('0x7c'),'uri':_0x33b2('0x7d')+_0x46d198[_0x33b2('0x7e')]+_0x33b2('0x7f'),'form':{'client_id':_0x46d198['clientId'],'resource':_0x19ce70,'username':_0x46d198['username'],'password':_0x46d198[_0x33b2('0x74')],'grant_type':_0x33b2('0x74'),'client_secret':_0x46d198[_0x33b2('0x77')]},'json':!![]};return rp(_0x55bf4b);}})['then'](function(_0x528bc0){_0x34e6c2=_0x528bc0[_0x33b2('0x80')];var _0x3b295f={'method':'GET','uri':encodeURI(_0x3d9f1c+_0x33b2('0x81')+_0x90d394+'\x27'),'headers':{'Authorization':_0x33b2('0x82')+_0x34e6c2,'If-None-Match':null,'OData-Version':_0x33b2('0x83')},'json':!![]};return rp(_0x3b295f);})['then'](function(_0x4d651b){var _0x3099ef=_0x4d651b['value'][0x0];var _0x5ebe7e=_0x3099ef['MetadataId'];var _0x11a691={'method':_0x33b2('0x84'),'uri':_0x3d9f1c+'EntityDefinitions('+_0x5ebe7e+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x34e6c2,'If-None-Match':null,'OData-Version':_0x33b2('0x83')},'json':!![]};return rp(_0x11a691);})[_0x33b2('0xc')](function(_0x5eb9c5){_0x52b696=_0x5eb9c5;_0x281599=_0x52b696['Attributes'];_0x281599=_[_0x33b2('0x85')](_0x281599,function(_0x54de73){return!_0x5a322d[_0x33b2('0x86')](_0x54de73[_0x33b2('0x87')]);});var _0x3956b2=[];var _0x2a1ab7=[];_0x281599['forEach'](function(_0x17ee3d){if(_0x17ee3d[_0x33b2('0x88')]){var _0x5e9a31=_0x17ee3d[_0x33b2('0x88')][_0x33b2('0x3b')](_0x17ee3d[_0x33b2('0x88')]['lastIndexOf']('.')+0x1);if(_0x5e9a31===_0x33b2('0x89')){_0x3956b2[_0x33b2('0x8a')](getSelectList(_0x3d9f1c,_0x1d70ba,_0x2a1ab7,_0x52b696[_0x33b2('0x8b')],_0x17ee3d[_0x33b2('0x8b')],_0x34e6c2));}}});return Promise['all'](_0x3956b2);})[_0x33b2('0xc')](function(_0x11c8a0){_0x5c1d61=_0x11c8a0[0x0];var _0x2d32f4=[];var _0x5db10b=[];_0x281599[_0x33b2('0x8c')](function(_0xc14c9){if(!_['isNil'](_0xc14c9[_0x33b2('0x88')])){var _0x27fefc=_0xc14c9[_0x33b2('0x88')]['substring'](_0xc14c9[_0x33b2('0x88')]['lastIndexOf']('.')+0x1);if(_0x27fefc===_0x33b2('0x8d')){_0x2d32f4[_0x33b2('0x8a')](getBooleanList(_0x3d9f1c,_0x1d70ba,_0x5db10b,_0x52b696[_0x33b2('0x8b')],_0xc14c9[_0x33b2('0x8b')],_0x34e6c2));}}});return Promise[_0x33b2('0x8e')](_0x2d32f4);})['then'](function(_0x4d2641){_0x407268=_0x4d2641[0x0];var _0x34d502=[];var _0x2f8916=[];_0x281599[_0x33b2('0x8c')](function(_0x178552){if(_0x178552[_0x33b2('0x88')]){var _0x989f83=_0x178552[_0x33b2('0x88')][_0x33b2('0x3b')](_0x178552[_0x33b2('0x88')][_0x33b2('0x3c')]('.')+0x1);if(_0x989f83==='StringAttributeMetadata'||_0x989f83==='DoubleAttributeMetadata'||_0x989f83===_0x33b2('0x8f')||_0x989f83==='IntegerAttributeMetadata'||_0x989f83===_0x33b2('0x90')||_0x989f83===_0x33b2('0x91')||_0x989f83==='StatusAttributeMetadata'||_0x989f83===_0x33b2('0x92')||_0x989f83===_0x33b2('0x93')||_0x989f83===_0x33b2('0x94')){_0x34d502[_0x33b2('0x8a')](getInputList(_0x3d9f1c,_0x1d70ba,_0x989f83,_0x2f8916,_0x52b696[_0x33b2('0x8b')],_0x178552[_0x33b2('0x8b')],_0x34e6c2));}}});return Promise[_0x33b2('0x8e')](_0x34d502);})[_0x33b2('0xc')](function(_0x200d77){_0x3b816f=_0x200d77[0x0];var _0x33384b=_0x5c1d61['concat'](_0x407268)['concat'](_0x3b816f);var _0x4bb6f3={'count':_0x33384b['length'],'rows':_0x33384b};return _0x4bb6f3;})[_0x33b2('0xc')](respondWithResult(_0x1e6b5e,null))[_0x33b2('0x27')](function(_0x30637b){var _0x7532a3=_0x2802b5[_0x33b2('0x17')][_0x33b2('0x95')]?0x1f4:_0x30637b['statusCode']||0x1f4;logger[_0x33b2('0xf')](_0x30637b['stack']);delete _0x30637b['name'];if(_0x7532a3===0x191){_0x7532a3=0x190;}_0x1e6b5e[_0x33b2('0x9')](_0x7532a3)[_0x33b2('0x11')](_0x2802b5[_0x33b2('0x17')][_0x33b2('0x95')]?{'message':_0x33b2('0x96'),'statusCode':_0x30637b['statusCode']}:_0x30637b);});};function getSelectList(_0x8e6471,_0x12fa16,_0x3a8042,_0x2bd7ac,_0x348c9b,_0x3c1296){var _0x1f1412={'method':_0x33b2('0x84'),'uri':_0x8e6471+'EntityDefinitions('+_0x2bd7ac+_0x33b2('0x97')+_0x348c9b+_0x33b2('0x98')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x33b2('0x82')+_0x3c1296,'If-None-Match':null,'OData-Version':_0x33b2('0x83')},'json':!![]};return rp(_0x1f1412)[_0x33b2('0xc')](function(_0x131f67){var _0x3d7019=[];var _0x14dff1=_0x131f67[_0x33b2('0x99')][_0x33b2('0x9a')];_0x14dff1[_0x33b2('0x8c')](function(_0x233bc6){_0x3d7019[_0x33b2('0x8a')]({'name':_0x233bc6['Label'][_0x33b2('0x9b')][_0x33b2('0x9c')],'value':String(_0x233bc6['Value'])});});var _0x1a0915={'id':_0x12fa16+'_'+_0x131f67['LogicalName'],'name':_0x131f67[_0x33b2('0x9d')][_0x33b2('0x9b')][_0x33b2('0x9c')],'custom':![],'options':_0x3d7019};_0x3a8042[_0x33b2('0x8a')](_0x1a0915);return _0x3a8042;});}function getBooleanList(_0x55871b,_0x16d749,_0x55f8e3,_0x491f1b,_0x3ef347,_0x39e999){var _0x278d0e={'method':'GET','uri':_0x55871b+'EntityDefinitions('+_0x491f1b+')/Attributes('+_0x3ef347+_0x33b2('0x9e'),'headers':{'Authorization':_0x33b2('0x82')+_0x39e999,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x278d0e)[_0x33b2('0xc')](function(_0x31eb6f){var _0x4613a4=[];_0x4613a4['push']({'name':_0x31eb6f[_0x33b2('0x99')][_0x33b2('0x9f')][_0x33b2('0x9c')][_0x33b2('0x9b')][_0x33b2('0x9c')],'value':_0x33b2('0xa0')},{'name':_0x31eb6f[_0x33b2('0x99')][_0x33b2('0xa1')]['Label']['UserLocalizedLabel'][_0x33b2('0x9c')],'value':_0x33b2('0xa2')});var _0x56a83c={'id':_0x16d749+'_'+_0x31eb6f[_0x33b2('0x87')],'name':_0x31eb6f[_0x33b2('0x9d')]['UserLocalizedLabel'][_0x33b2('0x9c')],'custom':![],'options':_0x4613a4};_0x55f8e3['push'](_0x56a83c);return _0x55f8e3;});}function getInputList(_0x321588,_0x1c4529,_0x4d7365,_0x3ff748,_0x720610,_0x45b4f3,_0x1d4694){var _0x393f02={'method':_0x33b2('0x84'),'uri':_0x321588+_0x33b2('0xa3')+_0x720610+_0x33b2('0x97')+_0x45b4f3+_0x33b2('0xa4')+_0x4d7365+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x33b2('0x82')+_0x1d4694,'If-None-Match':null,'OData-Version':_0x33b2('0x83')},'json':!![]};return rp(_0x393f02)[_0x33b2('0xc')](function(_0x4d7674){var _0x27c931={'id':_0x1c4529+'_'+_0x4d7674[_0x33b2('0x87')],'name':_0x4d7674['DisplayName'][_0x33b2('0x9b')]?_0x4d7674['DisplayName']['UserLocalizedLabel'][_0x33b2('0x9c')]:_0x4d7674[_0x33b2('0x87')],'custom':![],'options':[]};_0x3ff748['push'](_0x27c931);return _0x3ff748;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 1be224b..53c8846 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x42da3c,_0x52ed26){var _0x3006af=function(_0x1ebabf){while(--_0x1ebabf){_0x42da3c['push'](_0x42da3c['shift']());}};_0x3006af(++_0x52ed26);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x47c309,_0x2314b6){var _0x9a76c=function(_0x119eb1){while(--_0x119eb1){_0x47c309['push'](_0x47c309['shift']());}};_0x9a76c(++_0x2314b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('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 0a24b6b..ad0c01c 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 _0xf40f=['stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','map','include','model','attributes','then','debug','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x5ebda9,_0x2badfe){var _0x3a99ee=function(_0x1354a5){while(--_0x1354a5){_0x5ebda9['push'](_0x5ebda9['shift']());}};_0x3a99ee(++_0x2badfe);}(_0xf40f,0x124));var _0xff40=function(_0x32672c,_0x13eca8){_0x32672c=_0x32672c-0x0;var _0x5e2a97=_0xf40f[_0x32672c];return _0x5e2a97;};'use strict';var _=require(_0xff40('0x0'));var util=require(_0xff40('0x1'));var moment=require(_0xff40('0x2'));var BPromise=require(_0xff40('0x3'));var rs=require(_0xff40('0x4'));var fs=require('fs');var Redis=require(_0xff40('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xff40('0x6'));var jayson=require(_0xff40('0x7'));var client=jayson[_0xff40('0x8')][_0xff40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4513a0,_0x1240f0,_0x30131a){return new BPromise(function(_0x19016c,_0x116598){return client[_0xff40('0xa')](_0x4513a0,_0x30131a)['then'](function(_0x643b9f){logger[_0xff40('0xb')]('Dynamics365Account,\x20%s,\x20%s',_0x1240f0,_0xff40('0xc'));logger['debug'](_0xff40('0xd'),_0x1240f0,'request\x20sent',JSON[_0xff40('0xe')](_0x643b9f));if(_0x643b9f[_0xff40('0xf')]){if(_0x643b9f[_0xff40('0xf')][_0xff40('0x10')]===0x1f4){logger['error'](_0xff40('0x11'),_0x1240f0,_0x643b9f[_0xff40('0xf')][_0xff40('0x12')]);return _0x116598(_0x643b9f['error']['message']);}logger[_0xff40('0xf')](_0xff40('0x11'),_0x1240f0,_0x643b9f[_0xff40('0xf')][_0xff40('0x12')]);return _0x19016c(_0x643b9f[_0xff40('0xf')][_0xff40('0x12')]);}else{logger[_0xff40('0xb')](_0xff40('0x11'),_0x1240f0,_0xff40('0xc'));_0x19016c(_0x643b9f['result'][_0xff40('0x12')]);}})[_0xff40('0x13')](function(_0x27ae2c){logger[_0xff40('0xf')](_0xff40('0x11'),_0x1240f0,_0x27ae2c);_0x116598(_0x27ae2c);});});}exports[_0xff40('0x14')]=function(_0x4f3098){var _0x37c119=this;return new Promise(function(_0xcd0ada,_0x2654d5){return db[_0xff40('0x15')][_0xff40('0x16')]({'raw':_0x4f3098[_0xff40('0x17')]?_0x4f3098[_0xff40('0x17')][_0xff40('0x18')]===undefined?!![]:![]:!![],'where':_0x4f3098[_0xff40('0x17')]?_0x4f3098[_0xff40('0x17')][_0xff40('0x19')]||null:null,'attributes':_0x4f3098['options']?_0x4f3098[_0xff40('0x17')]['attributes']||null:null,'limit':_0x4f3098[_0xff40('0x17')]?_0x4f3098['options']['limit']||null:null,'include':_0x4f3098[_0xff40('0x17')]?_0x4f3098[_0xff40('0x17')]['include']?_[_0xff40('0x1a')](_0x4f3098[_0xff40('0x17')][_0xff40('0x1b')],function(_0x17dccd){return{'model':db[_0x17dccd[_0xff40('0x1c')]],'as':_0x17dccd['as'],'attributes':_0x17dccd[_0xff40('0x1d')],'include':_0x17dccd['include']?_['map'](_0x17dccd['include'],function(_0x151902){return{'model':db[_0x151902['model']],'as':_0x151902['as'],'attributes':_0x151902['attributes'],'include':_0x151902['include']?_[_0xff40('0x1a')](_0x151902[_0xff40('0x1b')],function(_0xfad76a){return{'model':db[_0xfad76a[_0xff40('0x1c')]],'as':_0xfad76a['as'],'attributes':_0xfad76a['attributes']};}):[]};}):[]};}):[]:[]})[_0xff40('0x1e')](function(_0x3a3726){logger[_0xff40('0xb')](_0xff40('0x14'),_0x4f3098);logger[_0xff40('0x1f')]('GetDynamics365Account',_0x4f3098,JSON[_0xff40('0xe')](_0x3a3726));_0xcd0ada(_0x3a3726);})[_0xff40('0x13')](function(_0x37df6c){logger[_0xff40('0xf')]('GetDynamics365Account',_0x37df6c[_0xff40('0x12')],_0x4f3098);_0x2654d5(_0x37c119[_0xff40('0xf')](0x1f4,_0x37df6c['message']));});});};exports[_0xff40('0x20')]=function(_0x103c56){var _0x4372bc=this;return new Promise(function(_0xb8ad7c,_0x3aba3e){return db['Dynamics365Account'][_0xff40('0x21')]({'raw':_0x103c56[_0xff40('0x17')]?_0x103c56[_0xff40('0x17')][_0xff40('0x18')]===undefined?!![]:![]:!![],'where':_0x103c56['options']?_0x103c56[_0xff40('0x17')][_0xff40('0x19')]||null:null,'attributes':_0x103c56[_0xff40('0x17')]?_0x103c56[_0xff40('0x17')][_0xff40('0x1d')]||null:null,'include':_0x103c56[_0xff40('0x17')]?_0x103c56[_0xff40('0x17')][_0xff40('0x1b')]?_[_0xff40('0x1a')](_0x103c56['options'][_0xff40('0x1b')],function(_0x3918c9){return{'model':db[_0x3918c9[_0xff40('0x1c')]],'as':_0x3918c9['as'],'attributes':_0x3918c9[_0xff40('0x1d')],'include':_0x3918c9['include']?_[_0xff40('0x1a')](_0x3918c9[_0xff40('0x1b')],function(_0x132ae0){return{'model':db[_0x132ae0[_0xff40('0x1c')]],'as':_0x132ae0['as'],'attributes':_0x132ae0['attributes'],'include':_0x132ae0[_0xff40('0x1b')]?_[_0xff40('0x1a')](_0x132ae0[_0xff40('0x1b')],function(_0x1ee7e8){return{'model':db[_0x1ee7e8[_0xff40('0x1c')]],'as':_0x1ee7e8['as'],'attributes':_0x1ee7e8[_0xff40('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xff40('0x1e')](function(_0x568675){logger[_0xff40('0xb')](_0xff40('0x20'),_0x103c56);logger['debug'](_0xff40('0x20'),_0x103c56,JSON[_0xff40('0xe')](_0x568675));_0xb8ad7c(_0x568675);})[_0xff40('0x13')](function(_0x2b0700){logger[_0xff40('0xf')](_0xff40('0x20'),_0x2b0700[_0xff40('0x12')],_0x103c56);_0x3aba3e(_0x4372bc[_0xff40('0xf')](0x1f4,_0x2b0700['message']));});});}; \ No newline at end of file +var _0x4469=['ShowDynamics365Account','find','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','Dynamics365Account','findAll','options','raw','limit','map','include','model','attributes','catch','GetDynamics365Account'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4469,0x16c));var _0x9446=function(_0x45df0e,_0x4c1b8f){_0x45df0e=_0x45df0e-0x0;var _0x122c0b=_0x4469[_0x45df0e];return _0x122c0b;};'use strict';var _=require(_0x9446('0x0'));var util=require(_0x9446('0x1'));var moment=require(_0x9446('0x2'));var BPromise=require(_0x9446('0x3'));var rs=require(_0x9446('0x4'));var fs=require('fs');var Redis=require(_0x9446('0x5'));var db=require(_0x9446('0x6'))['db'];var utils=require(_0x9446('0x7'));var logger=require(_0x9446('0x8'))('rpc');var config=require(_0x9446('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9446('0xa')][_0x9446('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e7c97,_0x123aa6,_0x45e208){return new BPromise(function(_0x3599b0,_0x46b954){return client[_0x9446('0xc')](_0x5e7c97,_0x45e208)['then'](function(_0x58d54a){logger['info'](_0x9446('0xd'),_0x123aa6,_0x9446('0xe'));logger[_0x9446('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x123aa6,'request\x20sent',JSON[_0x9446('0x10')](_0x58d54a));if(_0x58d54a[_0x9446('0x11')]){if(_0x58d54a[_0x9446('0x11')][_0x9446('0x12')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x123aa6,_0x58d54a[_0x9446('0x11')][_0x9446('0x13')]);return _0x46b954(_0x58d54a[_0x9446('0x11')][_0x9446('0x13')]);}logger['error'](_0x9446('0xd'),_0x123aa6,_0x58d54a[_0x9446('0x11')][_0x9446('0x13')]);return _0x3599b0(_0x58d54a[_0x9446('0x11')]['message']);}else{logger[_0x9446('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x123aa6,_0x9446('0xe'));_0x3599b0(_0x58d54a['result']['message']);}})['catch'](function(_0x23b89e){logger[_0x9446('0x11')](_0x9446('0xd'),_0x123aa6,_0x23b89e);_0x46b954(_0x23b89e);});});}exports['GetDynamics365Account']=function(_0x386207){var _0x3d766a=this;return new Promise(function(_0x158d4b,_0x482eba){return db[_0x9446('0x15')][_0x9446('0x16')]({'raw':_0x386207[_0x9446('0x17')]?_0x386207[_0x9446('0x17')][_0x9446('0x18')]===undefined?!![]:![]:!![],'where':_0x386207[_0x9446('0x17')]?_0x386207['options']['where']||null:null,'attributes':_0x386207['options']?_0x386207[_0x9446('0x17')]['attributes']||null:null,'limit':_0x386207[_0x9446('0x17')]?_0x386207['options'][_0x9446('0x19')]||null:null,'include':_0x386207[_0x9446('0x17')]?_0x386207[_0x9446('0x17')]['include']?_[_0x9446('0x1a')](_0x386207[_0x9446('0x17')][_0x9446('0x1b')],function(_0x1a53db){return{'model':db[_0x1a53db[_0x9446('0x1c')]],'as':_0x1a53db['as'],'attributes':_0x1a53db[_0x9446('0x1d')],'include':_0x1a53db[_0x9446('0x1b')]?_[_0x9446('0x1a')](_0x1a53db['include'],function(_0x3f7c0d){return{'model':db[_0x3f7c0d[_0x9446('0x1c')]],'as':_0x3f7c0d['as'],'attributes':_0x3f7c0d[_0x9446('0x1d')],'include':_0x3f7c0d[_0x9446('0x1b')]?_[_0x9446('0x1a')](_0x3f7c0d[_0x9446('0x1b')],function(_0x287951){return{'model':db[_0x287951[_0x9446('0x1c')]],'as':_0x287951['as'],'attributes':_0x287951['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x478f05){logger['info']('GetDynamics365Account',_0x386207);logger[_0x9446('0xf')]('GetDynamics365Account',_0x386207,JSON[_0x9446('0x10')](_0x478f05));_0x158d4b(_0x478f05);})[_0x9446('0x1e')](function(_0x19acaa){logger['error'](_0x9446('0x1f'),_0x19acaa[_0x9446('0x13')],_0x386207);_0x482eba(_0x3d766a[_0x9446('0x11')](0x1f4,_0x19acaa[_0x9446('0x13')]));});});};exports[_0x9446('0x20')]=function(_0x5d390d){var _0x59a8e0=this;return new Promise(function(_0x3f7148,_0xcfdbe6){return db[_0x9446('0x15')][_0x9446('0x21')]({'raw':_0x5d390d[_0x9446('0x17')]?_0x5d390d[_0x9446('0x17')][_0x9446('0x18')]===undefined?!![]:![]:!![],'where':_0x5d390d['options']?_0x5d390d['options'][_0x9446('0x22')]||null:null,'attributes':_0x5d390d[_0x9446('0x17')]?_0x5d390d['options']['attributes']||null:null,'include':_0x5d390d[_0x9446('0x17')]?_0x5d390d[_0x9446('0x17')][_0x9446('0x1b')]?_[_0x9446('0x1a')](_0x5d390d[_0x9446('0x17')][_0x9446('0x1b')],function(_0x5a31b6){return{'model':db[_0x5a31b6['model']],'as':_0x5a31b6['as'],'attributes':_0x5a31b6[_0x9446('0x1d')],'include':_0x5a31b6[_0x9446('0x1b')]?_[_0x9446('0x1a')](_0x5a31b6['include'],function(_0x51e8ef){return{'model':db[_0x51e8ef[_0x9446('0x1c')]],'as':_0x51e8ef['as'],'attributes':_0x51e8ef[_0x9446('0x1d')],'include':_0x51e8ef[_0x9446('0x1b')]?_['map'](_0x51e8ef['include'],function(_0x26968c){return{'model':db[_0x26968c[_0x9446('0x1c')]],'as':_0x26968c['as'],'attributes':_0x26968c['attributes']};}):[]};}):[]};}):[]:[]})[_0x9446('0x23')](function(_0x5021ab){logger[_0x9446('0x14')](_0x9446('0x20'),_0x5d390d);logger[_0x9446('0xf')](_0x9446('0x20'),_0x5d390d,JSON[_0x9446('0x10')](_0x5021ab));_0x3f7148(_0x5021ab);})[_0x9446('0x1e')](function(_0x1638f2){logger[_0x9446('0x11')](_0x9446('0x20'),_0x1638f2[_0x9446('0x13')],_0x5d390d);_0xcfdbe6(_0x59a8e0[_0x9446('0x11')](0x1f4,_0x1638f2[_0x9446('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c306c00..4b8c881 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 _0x56e7=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xf2a3bf,_0x30b52d){var _0x1d5527=function(_0x3e10d6){while(--_0x3e10d6){_0xf2a3bf['push'](_0xf2a3bf['shift']());}};_0x1d5527(++_0x30b52d);}(_0x56e7,0x93));var _0x756e=function(_0x1b9558,_0x245efa){_0x1b9558=_0x1b9558-0x0;var _0x15f33d=_0x56e7[_0x1b9558];return _0x15f33d;};'use strict';var multer=require(_0x756e('0x0'));var util=require(_0x756e('0x1'));var path=require(_0x756e('0x2'));var timeout=require(_0x756e('0x3'));var express=require(_0x756e('0x4'));var router=express[_0x756e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x756e('0x6'));var interaction=require(_0x756e('0x7'));var config=require(_0x756e('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x756e('0x9')]('/',auth[_0x756e('0xa')](),controller['index']);router['get'](_0x756e('0xb'),auth[_0x756e('0xa')](),controller['show']);router['get']('/:id/fields',auth[_0x756e('0xa')](),controller[_0x756e('0xc')]);router[_0x756e('0x9')](_0x756e('0xd'),auth[_0x756e('0xa')](),controller['getSubjects']);router[_0x756e('0x9')]('/:id/descriptions',auth[_0x756e('0xa')](),controller[_0x756e('0xe')]);router[_0x756e('0xf')]('/',auth['isAuthenticated'](),controller[_0x756e('0x10')]);router[_0x756e('0x11')](_0x756e('0xb'),auth['isAuthenticated'](),controller[_0x756e('0x12')]);router[_0x756e('0x13')](_0x756e('0xb'),auth[_0x756e('0xa')](),controller[_0x756e('0x14')]);module[_0x756e('0x15')]=router; \ No newline at end of file +var _0x4390=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x4390,0x88));var _0x0439=function(_0x253ae6,_0xc0f0f9){_0x253ae6=_0x253ae6-0x0;var _0x13157a=_0x4390[_0x253ae6];return _0x13157a;};'use strict';var multer=require(_0x0439('0x0'));var util=require(_0x0439('0x1'));var path=require(_0x0439('0x2'));var timeout=require(_0x0439('0x3'));var express=require(_0x0439('0x4'));var router=express[_0x0439('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0439('0x6'));var controller=require(_0x0439('0x7'));router[_0x0439('0x8')]('/',auth[_0x0439('0x9')](),controller['index']);router[_0x0439('0x8')](_0x0439('0xa'),auth[_0x0439('0x9')](),controller['show']);router[_0x0439('0x8')](_0x0439('0xb'),auth[_0x0439('0x9')](),controller[_0x0439('0xc')]);router[_0x0439('0x8')](_0x0439('0xd'),auth[_0x0439('0x9')](),controller[_0x0439('0xe')]);router[_0x0439('0x8')](_0x0439('0xf'),auth['isAuthenticated'](),controller[_0x0439('0x10')]);router[_0x0439('0x11')]('/',auth[_0x0439('0x9')](),controller['create']);router['put'](_0x0439('0xa'),auth[_0x0439('0x9')](),controller[_0x0439('0x12')]);router[_0x0439('0x13')](_0x0439('0xa'),auth[_0x0439('0x9')](),controller[_0x0439('0x14')]);module[_0x0439('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 404a532..5e49ac4 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 _0x1743=['contact','BOOLEAN','sequelize','exports','STRING','ENUM','incident','phonecall','nothing'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x1743,0xbf));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3174('0x0'));module[_0x3174('0x1')]={'name':{'type':Sequelize[_0x3174('0x2')]},'description':{'type':Sequelize[_0x3174('0x2')]},'ticketType':{'type':Sequelize[_0x3174('0x3')](_0x3174('0x4'),_0x3174('0x5')),'defaultValue':_0x3174('0x4')},'moduleCreate':{'type':Sequelize[_0x3174('0x3')]('contact',_0x3174('0x6')),'defaultValue':_0x3174('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x3174('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3174('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3173=['sequelize','exports','STRING','incident','phonecall','ENUM','BOOLEAN'];(function(_0x1c2223,_0x4ecdec){var _0x18c53a=function(_0x284394){while(--_0x284394){_0x1c2223['push'](_0x1c2223['shift']());}};_0x18c53a(++_0x4ecdec);}(_0x3173,0x1b2));var _0x3317=function(_0x374a6a,_0x39a96d){_0x374a6a=_0x374a6a-0x0;var _0x35bf5d=_0x3173[_0x374a6a];return _0x35bf5d;};'use strict';var Sequelize=require(_0x3317('0x0'));module[_0x3317('0x1')]={'name':{'type':Sequelize[_0x3317('0x2')]},'description':{'type':Sequelize[_0x3317('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x3317('0x3'),_0x3317('0x4')),'defaultValue':_0x3317('0x3')},'moduleCreate':{'type':Sequelize[_0x3317('0x5')]('contact','nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x3317('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x3317('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e30c9b1..72886de 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 _0xfba3=['../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Dynamics365Configuration','include','findAll','rows','show','params','includeAll','find','catch','create','body','Dynamics365Field','getFields','getDescriptions','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x254094,_0x16a405){var _0x322a4b=function(_0x216aba){while(--_0x216aba){_0x254094['push'](_0x254094['shift']());}};_0x322a4b(++_0x16a405);}(_0xfba3,0x82));var _0x3fba=function(_0x2422f1,_0x1c6afd){_0x2422f1=_0x2422f1-0x0;var _0x40a692=_0xfba3[_0x2422f1];return _0x40a692;};'use strict';var emlformat=require(_0x3fba('0x0'));var rimraf=require(_0x3fba('0x1'));var zipdir=require(_0x3fba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fba('0x3'));var moment=require(_0x3fba('0x4'));var BPromise=require(_0x3fba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3fba('0x6'));var csv=require(_0x3fba('0x7'));var ejs=require(_0x3fba('0x8'));var fs=require('fs');var fs_extra=require(_0x3fba('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3fba('0xa'));var jsforce=require(_0x3fba('0xb'));var deskjs=require(_0x3fba('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3fba('0xd'));var Papa=require(_0x3fba('0xe'));var Redis=require('ioredis');var authService=require(_0x3fba('0xf'));var qs=require(_0x3fba('0x10'));var as=require(_0x3fba('0x11'));var hardwareService=require(_0x3fba('0x12'));var logger=require(_0x3fba('0x13'))(_0x3fba('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3fba('0x15'))['db'];function respondWithStatusCode(_0x44989b,_0x4dcd0a){_0x4dcd0a=_0x4dcd0a||0xcc;return function(_0x3569cb){if(_0x3569cb){return _0x44989b['sendStatus'](_0x4dcd0a);}return _0x44989b['status'](_0x4dcd0a)[_0x3fba('0x16')]();};}function respondWithResult(_0x54d3f1,_0x11702c){_0x11702c=_0x11702c||0xc8;return function(_0x7ac65d){if(_0x7ac65d){return _0x54d3f1[_0x3fba('0x17')](_0x11702c)['json'](_0x7ac65d);}};}function respondWithFilteredResult(_0xe8737f,_0x5d5eb5){return function(_0x5e259a){if(_0x5e259a){var _0xd9bcdf=typeof _0x5d5eb5[_0x3fba('0x18')]===_0x3fba('0x19')&&typeof _0x5d5eb5[_0x3fba('0x1a')]===_0x3fba('0x19');var _0x78af54=_0x5e259a[_0x3fba('0x1b')];var _0x6f3aa9=_0xd9bcdf?0x0:_0x5d5eb5[_0x3fba('0x18')];var _0x20c0c8=_0xd9bcdf?_0x5e259a[_0x3fba('0x1b')]:_0x5d5eb5[_0x3fba('0x18')]+_0x5d5eb5[_0x3fba('0x1a')];var _0x2940fa;if(_0x20c0c8>=_0x78af54){_0x20c0c8=_0x78af54;_0x2940fa=0xc8;}else{_0x2940fa=0xce;}_0xe8737f[_0x3fba('0x17')](_0x2940fa);return _0xe8737f['set'](_0x3fba('0x1c'),_0x6f3aa9+'-'+_0x20c0c8+'/'+_0x78af54)[_0x3fba('0x1d')](_0x5e259a);}return null;};}function patchUpdates(_0x33400a){return function(_0x51d39f){try{jsonpatch['apply'](_0x51d39f,_0x33400a,!![]);}catch(_0x54c4a2){return BPromise['reject'](_0x54c4a2);}return _0x51d39f['save']();};}function saveUpdates(_0x2a36c2,_0x5b1659){return function(_0x10d930){if(_0x10d930){return _0x10d930[_0x3fba('0x1e')](_0x2a36c2)[_0x3fba('0x1f')](function(_0x3988ba){return _0x3988ba;});}return null;};}function removeEntity(_0x505726,_0x5dd8a9){return function(_0x341b34){if(_0x341b34){return _0x341b34['destroy']()[_0x3fba('0x1f')](function(){_0x505726[_0x3fba('0x17')](0xcc)[_0x3fba('0x16')]();});}};}function handleEntityNotFound(_0x10b7c8,_0xddc95c){return function(_0x4ea543){if(!_0x4ea543){_0x10b7c8['sendStatus'](0x194);}return _0x4ea543;};}function handleError(_0x573ff1,_0x9f99e6){_0x9f99e6=_0x9f99e6||0x1f4;return function(_0x321a7d){logger[_0x3fba('0x20')](_0x321a7d[_0x3fba('0x21')]);if(_0x321a7d[_0x3fba('0x22')]){delete _0x321a7d[_0x3fba('0x22')];}_0x573ff1[_0x3fba('0x17')](_0x9f99e6)['send'](_0x321a7d);};}exports[_0x3fba('0x23')]=function(_0x530484,_0x395580){var _0x1925f1={},_0x49dba4={},_0x4b9c07={'count':0x0,'rows':[]};var _0x5b7496=_[_0x3fba('0x24')](db['Dynamics365Configuration'][_0x3fba('0x25')],function(_0x53b6c7){return{'name':_0x53b6c7[_0x3fba('0x26')],'type':_0x53b6c7['type'][_0x3fba('0x27')]};});_0x49dba4[_0x3fba('0x28')]=_['map'](_0x5b7496,_0x3fba('0x22'));_0x49dba4[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x530484[_0x3fba('0x29')]);_0x49dba4['filters']=_['intersection'](_0x49dba4[_0x3fba('0x28')],_0x49dba4[_0x3fba('0x29')]);_0x1925f1['attributes']=_[_0x3fba('0x2b')](_0x49dba4[_0x3fba('0x28')],qs['fields'](_0x530484[_0x3fba('0x29')][_0x3fba('0x2c')]));_0x1925f1[_0x3fba('0x2d')]=_0x1925f1[_0x3fba('0x2d')][_0x3fba('0x2e')]?_0x1925f1['attributes']:_0x49dba4[_0x3fba('0x28')];if(!_0x530484[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x1925f1[_0x3fba('0x1a')]=qs[_0x3fba('0x1a')](_0x530484[_0x3fba('0x29')][_0x3fba('0x1a')]);_0x1925f1[_0x3fba('0x18')]=qs[_0x3fba('0x18')](_0x530484[_0x3fba('0x29')][_0x3fba('0x18')]);}_0x1925f1[_0x3fba('0x31')]=qs[_0x3fba('0x32')](_0x530484[_0x3fba('0x29')][_0x3fba('0x32')]);_0x1925f1[_0x3fba('0x33')]=qs[_0x3fba('0x34')](_[_0x3fba('0x35')](_0x530484[_0x3fba('0x29')],_0x49dba4[_0x3fba('0x34')]),_0x5b7496);if(_0x530484['query'][_0x3fba('0x36')]){_0x1925f1[_0x3fba('0x33')]=_[_0x3fba('0x37')](_0x1925f1['where'],{'$or':_['map'](_0x5b7496,function(_0x1d8434){if(_0x1d8434[_0x3fba('0x38')]!==_0x3fba('0x39')){var _0x4f571e={};_0x4f571e[_0x1d8434[_0x3fba('0x22')]]={'$like':'%'+_0x530484[_0x3fba('0x29')][_0x3fba('0x36')]+'%'};return _0x4f571e;}})});}_0x1925f1=_['merge']({},_0x1925f1,_0x530484[_0x3fba('0x3a')]);var _0x537770={'where':_0x1925f1[_0x3fba('0x33')]};return db[_0x3fba('0x3b')]['count'](_0x537770)[_0x3fba('0x1f')](function(_0x21cda7){_0x4b9c07['count']=_0x21cda7;if(_0x530484['query']['includeAll']){_0x1925f1[_0x3fba('0x3c')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3fba('0x3d')](_0x1925f1);})['then'](function(_0x1984d5){_0x4b9c07[_0x3fba('0x3e')]=_0x1984d5;return _0x4b9c07;})[_0x3fba('0x1f')](respondWithFilteredResult(_0x395580,_0x1925f1))['catch'](handleError(_0x395580,null));};exports[_0x3fba('0x3f')]=function(_0x1757d5,_0x1013f5){var _0x43a8bd={'raw':![],'where':{'id':_0x1757d5[_0x3fba('0x40')]['id']}},_0x44aa8b={};_0x44aa8b[_0x3fba('0x28')]=_['keys'](db[_0x3fba('0x3b')][_0x3fba('0x25')]);_0x44aa8b[_0x3fba('0x29')]=_['keys'](_0x1757d5['query']);_0x44aa8b[_0x3fba('0x34')]=_[_0x3fba('0x2b')](_0x44aa8b['model'],_0x44aa8b['query']);_0x43a8bd[_0x3fba('0x2d')]=_[_0x3fba('0x2b')](_0x44aa8b[_0x3fba('0x28')],qs['fields'](_0x1757d5['query']['fields']));_0x43a8bd[_0x3fba('0x2d')]=_0x43a8bd[_0x3fba('0x2d')]['length']?_0x43a8bd[_0x3fba('0x2d')]:_0x44aa8b[_0x3fba('0x28')];if(_0x1757d5[_0x3fba('0x29')][_0x3fba('0x41')]){_0x43a8bd['include']=[{'all':!![]}];}_0x43a8bd=_[_0x3fba('0x37')]({},_0x43a8bd,_0x1757d5['options']);return db['Dynamics365Configuration'][_0x3fba('0x42')](_0x43a8bd)[_0x3fba('0x1f')](handleEntityNotFound(_0x1013f5,null))[_0x3fba('0x1f')](respondWithResult(_0x1013f5,null))[_0x3fba('0x43')](handleError(_0x1013f5,null));};exports[_0x3fba('0x44')]=function(_0x915180,_0x585879){return db['Dynamics365Configuration'][_0x3fba('0x44')](_0x915180[_0x3fba('0x45')],{})[_0x3fba('0x1f')](respondWithResult(_0x585879,0xc9))['catch'](handleError(_0x585879,null));};exports['update']=function(_0x270a0a,_0x450edb){if(_0x270a0a[_0x3fba('0x45')]['id']){delete _0x270a0a[_0x3fba('0x45')]['id'];}return db[_0x3fba('0x3b')][_0x3fba('0x42')]({'where':{'id':_0x270a0a[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0x450edb,null))[_0x3fba('0x1f')](saveUpdates(_0x270a0a[_0x3fba('0x45')],null))[_0x3fba('0x1f')](respondWithResult(_0x450edb,null))[_0x3fba('0x43')](handleError(_0x450edb,null));};exports['destroy']=function(_0x28ddaa,_0x55e1aa){return db[_0x3fba('0x3b')][_0x3fba('0x42')]({'where':{'id':_0x28ddaa[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0x55e1aa,null))[_0x3fba('0x1f')](removeEntity(_0x55e1aa,null))[_0x3fba('0x43')](handleError(_0x55e1aa,null));};exports['getFields']=function(_0x560009,_0xd6269a,_0x5cacdd){var _0x5d75c9={};var _0xbe7e7e={};var _0x34aa06;var _0x530566;return db[_0x3fba('0x3b')]['findOne']({'where':{'id':_0x560009[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0xd6269a,null))['then'](function(_0x10ffc0){if(_0x10ffc0){_0x34aa06=_0x10ffc0;_0xbe7e7e[_0x3fba('0x28')]=_[_0x3fba('0x2a')](db[_0x3fba('0x46')][_0x3fba('0x25')]);_0xbe7e7e[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x560009[_0x3fba('0x29')]);_0xbe7e7e[_0x3fba('0x34')]=_[_0x3fba('0x2b')](_0xbe7e7e[_0x3fba('0x28')],_0xbe7e7e[_0x3fba('0x29')]);_0x5d75c9['attributes']=_[_0x3fba('0x2b')](_0xbe7e7e['model'],qs[_0x3fba('0x2c')](_0x560009[_0x3fba('0x29')]['fields']));_0x5d75c9[_0x3fba('0x2d')]=_0x5d75c9['attributes'][_0x3fba('0x2e')]?_0x5d75c9['attributes']:_0xbe7e7e['model'];_0x5d75c9['order']=qs[_0x3fba('0x32')](_0x560009[_0x3fba('0x29')][_0x3fba('0x32')]);_0x5d75c9[_0x3fba('0x33')]=qs[_0x3fba('0x34')](_[_0x3fba('0x35')](_0x560009['query'],_0xbe7e7e[_0x3fba('0x34')]));if(_0x560009['query'][_0x3fba('0x36')]){_0x5d75c9[_0x3fba('0x33')]=_[_0x3fba('0x37')](_0x5d75c9[_0x3fba('0x33')],{'$or':_[_0x3fba('0x24')](_0x5d75c9['attributes'],function(_0x4d663e){var _0x37ec7e={};_0x37ec7e[_0x4d663e]={'$like':'%'+_0x560009[_0x3fba('0x29')][_0x3fba('0x36')]+'%'};return _0x37ec7e;})});}_0x5d75c9=_[_0x3fba('0x37')]({},_0x5d75c9,_0x560009['options']);return _0x34aa06[_0x3fba('0x47')](_0x5d75c9);}})['then'](function(_0x4f93c8){if(_0x4f93c8){_0x530566=_0x4f93c8[_0x3fba('0x2e')];if(!_0x560009[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x5d75c9[_0x3fba('0x1a')]=qs[_0x3fba('0x1a')](_0x560009[_0x3fba('0x29')][_0x3fba('0x1a')]);_0x5d75c9['offset']=qs[_0x3fba('0x18')](_0x560009[_0x3fba('0x29')][_0x3fba('0x18')]);}return _0x34aa06[_0x3fba('0x47')](_0x5d75c9);}})[_0x3fba('0x1f')](function(_0x309687){if(_0x309687){return _0x309687?{'count':_0x530566,'rows':_0x309687}:null;}})[_0x3fba('0x1f')](respondWithResult(_0xd6269a,null))['catch'](handleError(_0xd6269a,null));};exports['getSubjects']=function(_0x2763b6,_0xe2eac,_0x444e64){var _0x11d9ed={};var _0x89a403={};var _0xcd32bf;var _0x4efbe4;return db[_0x3fba('0x3b')]['findOne']({'where':{'id':_0x2763b6['params']['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0xe2eac,null))[_0x3fba('0x1f')](function(_0xc6bb0d){if(_0xc6bb0d){_0xcd32bf=_0xc6bb0d;_0x89a403[_0x3fba('0x28')]=_[_0x3fba('0x2a')](db[_0x3fba('0x46')][_0x3fba('0x25')]);_0x89a403[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x2763b6['query']);_0x89a403['filters']=_[_0x3fba('0x2b')](_0x89a403[_0x3fba('0x28')],_0x89a403[_0x3fba('0x29')]);_0x11d9ed['attributes']=_['intersection'](_0x89a403[_0x3fba('0x28')],qs[_0x3fba('0x2c')](_0x2763b6[_0x3fba('0x29')]['fields']));_0x11d9ed[_0x3fba('0x2d')]=_0x11d9ed['attributes']['length']?_0x11d9ed['attributes']:_0x89a403[_0x3fba('0x28')];_0x11d9ed[_0x3fba('0x31')]=qs[_0x3fba('0x32')](_0x2763b6[_0x3fba('0x29')][_0x3fba('0x32')]);_0x11d9ed['where']=qs[_0x3fba('0x34')](_[_0x3fba('0x35')](_0x2763b6[_0x3fba('0x29')],_0x89a403['filters']));if(_0x2763b6[_0x3fba('0x29')][_0x3fba('0x36')]){_0x11d9ed['where']=_[_0x3fba('0x37')](_0x11d9ed['where'],{'$or':_[_0x3fba('0x24')](_0x11d9ed[_0x3fba('0x2d')],function(_0x23746d){var _0x30e9b5={};_0x30e9b5[_0x23746d]={'$like':'%'+_0x2763b6[_0x3fba('0x29')][_0x3fba('0x36')]+'%'};return _0x30e9b5;})});}_0x11d9ed=_['merge']({},_0x11d9ed,_0x2763b6[_0x3fba('0x3a')]);return _0xcd32bf['getSubjects'](_0x11d9ed);}})['then'](function(_0x45121d){if(_0x45121d){_0x4efbe4=_0x45121d[_0x3fba('0x2e')];if(!_0x2763b6[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x11d9ed['limit']=qs['limit'](_0x2763b6['query'][_0x3fba('0x1a')]);_0x11d9ed[_0x3fba('0x18')]=qs['offset'](_0x2763b6[_0x3fba('0x29')]['offset']);}return _0xcd32bf['getSubjects'](_0x11d9ed);}})[_0x3fba('0x1f')](function(_0x13d1f1){if(_0x13d1f1){return _0x13d1f1?{'count':_0x4efbe4,'rows':_0x13d1f1}:null;}})[_0x3fba('0x1f')](respondWithResult(_0xe2eac,null))[_0x3fba('0x43')](handleError(_0xe2eac,null));};exports[_0x3fba('0x48')]=function(_0x4b1c3f,_0x4af0cd,_0x28a9d3){var _0x423c9a={};var _0x17d60d={};var _0x54f380;var _0x3c08a9;return db[_0x3fba('0x3b')][_0x3fba('0x49')]({'where':{'id':_0x4b1c3f[_0x3fba('0x40')]['id']}})[_0x3fba('0x1f')](handleEntityNotFound(_0x4af0cd,null))[_0x3fba('0x1f')](function(_0x5ebce1){if(_0x5ebce1){_0x54f380=_0x5ebce1;_0x17d60d[_0x3fba('0x28')]=_[_0x3fba('0x2a')](db[_0x3fba('0x46')][_0x3fba('0x25')]);_0x17d60d[_0x3fba('0x29')]=_[_0x3fba('0x2a')](_0x4b1c3f['query']);_0x17d60d[_0x3fba('0x34')]=_[_0x3fba('0x2b')](_0x17d60d[_0x3fba('0x28')],_0x17d60d[_0x3fba('0x29')]);_0x423c9a[_0x3fba('0x2d')]=_[_0x3fba('0x2b')](_0x17d60d[_0x3fba('0x28')],qs[_0x3fba('0x2c')](_0x4b1c3f[_0x3fba('0x29')]['fields']));_0x423c9a['attributes']=_0x423c9a[_0x3fba('0x2d')][_0x3fba('0x2e')]?_0x423c9a[_0x3fba('0x2d')]:_0x17d60d[_0x3fba('0x28')];_0x423c9a[_0x3fba('0x31')]=qs[_0x3fba('0x32')](_0x4b1c3f[_0x3fba('0x29')]['sort']);_0x423c9a[_0x3fba('0x33')]=qs[_0x3fba('0x34')](_['pick'](_0x4b1c3f[_0x3fba('0x29')],_0x17d60d['filters']));if(_0x4b1c3f[_0x3fba('0x29')][_0x3fba('0x36')]){_0x423c9a[_0x3fba('0x33')]=_[_0x3fba('0x37')](_0x423c9a[_0x3fba('0x33')],{'$or':_['map'](_0x423c9a[_0x3fba('0x2d')],function(_0x3abb0f){var _0x40f608={};_0x40f608[_0x3abb0f]={'$like':'%'+_0x4b1c3f[_0x3fba('0x29')]['filter']+'%'};return _0x40f608;})});}_0x423c9a=_['merge']({},_0x423c9a,_0x4b1c3f[_0x3fba('0x3a')]);return _0x54f380['getDescriptions'](_0x423c9a);}})[_0x3fba('0x1f')](function(_0x505883){if(_0x505883){_0x3c08a9=_0x505883[_0x3fba('0x2e')];if(!_0x4b1c3f[_0x3fba('0x29')][_0x3fba('0x2f')](_0x3fba('0x30'))){_0x423c9a[_0x3fba('0x1a')]=qs[_0x3fba('0x1a')](_0x4b1c3f[_0x3fba('0x29')][_0x3fba('0x1a')]);_0x423c9a['offset']=qs[_0x3fba('0x18')](_0x4b1c3f[_0x3fba('0x29')]['offset']);}return _0x54f380[_0x3fba('0x48')](_0x423c9a);}})[_0x3fba('0x1f')](function(_0x5298cf){if(_0x5298cf){return _0x5298cf?{'count':_0x3c08a9,'rows':_0x5298cf}:null;}})[_0x3fba('0x1f')](respondWithResult(_0x4af0cd,null))[_0x3fba('0x43')](handleError(_0x4af0cd,null));}; \ No newline at end of file +var _0xc2a7=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','sendStatus','error','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','options','includeAll','Dynamics365Configuration','findAll','rows','catch','show','keys','include','find','create','body','params','findOne','Dynamics365Field','order','pick','filter','hasOwnProperty','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2a7,0x192));var _0x7c2a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc2a7[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x7c2a('0x0'));var rimraf=require(_0x7c2a('0x1'));var zipdir=require(_0x7c2a('0x2'));var jsonpatch=require(_0x7c2a('0x3'));var rp=require(_0x7c2a('0x4'));var moment=require(_0x7c2a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7c2a('0x6'));var util=require(_0x7c2a('0x7'));var path=require(_0x7c2a('0x8'));var sox=require(_0x7c2a('0x9'));var csv=require(_0x7c2a('0xa'));var ejs=require(_0x7c2a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c2a('0xc'));var squel=require(_0x7c2a('0xd'));var crypto=require(_0x7c2a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7c2a('0xf'));var toCsv=require(_0x7c2a('0xa'));var querystring=require('querystring');var Papa=require(_0x7c2a('0x10'));var Redis=require(_0x7c2a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7c2a('0x12'));var as=require(_0x7c2a('0x13'));var hardwareService=require(_0x7c2a('0x14'));var logger=require('../../config/logger')(_0x7c2a('0x15'));var utils=require('../../config/utils');var config=require(_0x7c2a('0x16'));var licenseUtil=require(_0x7c2a('0x17'));var db=require(_0x7c2a('0x18'))['db'];function respondWithStatusCode(_0x28ec0f,_0xab5d1e){_0xab5d1e=_0xab5d1e||0xcc;return function(_0x5d00d0){if(_0x5d00d0){return _0x28ec0f['sendStatus'](_0xab5d1e);}return _0x28ec0f['status'](_0xab5d1e)[_0x7c2a('0x19')]();};}function respondWithResult(_0x637205,_0x4532cd){_0x4532cd=_0x4532cd||0xc8;return function(_0x32033f){if(_0x32033f){return _0x637205[_0x7c2a('0x1a')](_0x4532cd)['json'](_0x32033f);}};}function respondWithFilteredResult(_0x435b74,_0x11734e){return function(_0x51f5b8){if(_0x51f5b8){var _0x484859=typeof _0x11734e[_0x7c2a('0x1b')]===_0x7c2a('0x1c')&&typeof _0x11734e[_0x7c2a('0x1d')]==='undefined';var _0x41d86f=_0x51f5b8[_0x7c2a('0x1e')];var _0x57de8f=_0x484859?0x0:_0x11734e[_0x7c2a('0x1b')];var _0x690180=_0x484859?_0x51f5b8[_0x7c2a('0x1e')]:_0x11734e['offset']+_0x11734e[_0x7c2a('0x1d')];var _0x205811;if(_0x690180>=_0x41d86f){_0x690180=_0x41d86f;_0x205811=0xc8;}else{_0x205811=0xce;}_0x435b74[_0x7c2a('0x1a')](_0x205811);return _0x435b74[_0x7c2a('0x1f')](_0x7c2a('0x20'),_0x57de8f+'-'+_0x690180+'/'+_0x41d86f)[_0x7c2a('0x21')](_0x51f5b8);}return null;};}function patchUpdates(_0x3475c9){return function(_0x58b2d0){try{jsonpatch[_0x7c2a('0x22')](_0x58b2d0,_0x3475c9,!![]);}catch(_0x488e88){return BPromise[_0x7c2a('0x23')](_0x488e88);}return _0x58b2d0['save']();};}function saveUpdates(_0x39b857,_0x49d2bd){return function(_0x29a9f8){if(_0x29a9f8){return _0x29a9f8[_0x7c2a('0x24')](_0x39b857)['then'](function(_0x91dc90){return _0x91dc90;});}return null;};}function removeEntity(_0x244ff2,_0x34c6b8){return function(_0x37b1be){if(_0x37b1be){return _0x37b1be[_0x7c2a('0x25')]()[_0x7c2a('0x26')](function(){_0x244ff2[_0x7c2a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b8e32,_0x521167){return function(_0x335d5e){if(!_0x335d5e){_0x4b8e32[_0x7c2a('0x27')](0x194);}return _0x335d5e;};}function handleError(_0x442f55,_0x38d041){_0x38d041=_0x38d041||0x1f4;return function(_0x41e8c8){logger[_0x7c2a('0x28')](_0x41e8c8['stack']);if(_0x41e8c8[_0x7c2a('0x29')]){delete _0x41e8c8[_0x7c2a('0x29')];}_0x442f55[_0x7c2a('0x1a')](_0x38d041)['send'](_0x41e8c8);};}exports[_0x7c2a('0x2a')]=function(_0x4e3974,_0x22f421){var _0xa7612e={},_0x35ecf0={},_0x2867d3={'count':0x0,'rows':[]};var _0x13d21c=_[_0x7c2a('0x2b')](db['Dynamics365Configuration'][_0x7c2a('0x2c')],function(_0x19a2a5){return{'name':_0x19a2a5[_0x7c2a('0x2d')],'type':_0x19a2a5[_0x7c2a('0x2e')]['key']};});_0x35ecf0[_0x7c2a('0x2f')]=_[_0x7c2a('0x2b')](_0x13d21c,'name');_0x35ecf0[_0x7c2a('0x30')]=_['keys'](_0x4e3974[_0x7c2a('0x30')]);_0x35ecf0[_0x7c2a('0x31')]=_[_0x7c2a('0x32')](_0x35ecf0[_0x7c2a('0x2f')],_0x35ecf0[_0x7c2a('0x30')]);_0xa7612e[_0x7c2a('0x33')]=_[_0x7c2a('0x32')](_0x35ecf0[_0x7c2a('0x2f')],qs[_0x7c2a('0x34')](_0x4e3974[_0x7c2a('0x30')][_0x7c2a('0x34')]));_0xa7612e['attributes']=_0xa7612e[_0x7c2a('0x33')][_0x7c2a('0x35')]?_0xa7612e['attributes']:_0x35ecf0[_0x7c2a('0x2f')];if(!_0x4e3974[_0x7c2a('0x30')]['hasOwnProperty'](_0x7c2a('0x36'))){_0xa7612e[_0x7c2a('0x1d')]=qs[_0x7c2a('0x1d')](_0x4e3974['query']['limit']);_0xa7612e[_0x7c2a('0x1b')]=qs[_0x7c2a('0x1b')](_0x4e3974['query']['offset']);}_0xa7612e['order']=qs[_0x7c2a('0x37')](_0x4e3974[_0x7c2a('0x30')][_0x7c2a('0x37')]);_0xa7612e[_0x7c2a('0x38')]=qs[_0x7c2a('0x31')](_['pick'](_0x4e3974[_0x7c2a('0x30')],_0x35ecf0[_0x7c2a('0x31')]),_0x13d21c);if(_0x4e3974[_0x7c2a('0x30')]['filter']){_0xa7612e['where']=_[_0x7c2a('0x39')](_0xa7612e[_0x7c2a('0x38')],{'$or':_[_0x7c2a('0x2b')](_0x13d21c,function(_0x51924a){if(_0x51924a[_0x7c2a('0x2e')]!==_0x7c2a('0x3a')){var _0x3ac228={};_0x3ac228[_0x51924a[_0x7c2a('0x29')]]={'$like':'%'+_0x4e3974['query']['filter']+'%'};return _0x3ac228;}})});}_0xa7612e=_[_0x7c2a('0x39')]({},_0xa7612e,_0x4e3974[_0x7c2a('0x3b')]);var _0x46919e={'where':_0xa7612e['where']};return db['Dynamics365Configuration']['count'](_0x46919e)[_0x7c2a('0x26')](function(_0x532064){_0x2867d3[_0x7c2a('0x1e')]=_0x532064;if(_0x4e3974[_0x7c2a('0x30')][_0x7c2a('0x3c')]){_0xa7612e['include']=[{'all':!![]}];}return db[_0x7c2a('0x3d')][_0x7c2a('0x3e')](_0xa7612e);})[_0x7c2a('0x26')](function(_0x10d953){_0x2867d3[_0x7c2a('0x3f')]=_0x10d953;return _0x2867d3;})[_0x7c2a('0x26')](respondWithFilteredResult(_0x22f421,_0xa7612e))[_0x7c2a('0x40')](handleError(_0x22f421,null));};exports[_0x7c2a('0x41')]=function(_0x20f81e,_0xa4d584){var _0x30343d={'raw':![],'where':{'id':_0x20f81e['params']['id']}},_0x10a851={};_0x10a851['model']=_[_0x7c2a('0x42')](db[_0x7c2a('0x3d')]['rawAttributes']);_0x10a851[_0x7c2a('0x30')]=_[_0x7c2a('0x42')](_0x20f81e['query']);_0x10a851['filters']=_[_0x7c2a('0x32')](_0x10a851[_0x7c2a('0x2f')],_0x10a851['query']);_0x30343d['attributes']=_[_0x7c2a('0x32')](_0x10a851[_0x7c2a('0x2f')],qs[_0x7c2a('0x34')](_0x20f81e[_0x7c2a('0x30')][_0x7c2a('0x34')]));_0x30343d[_0x7c2a('0x33')]=_0x30343d[_0x7c2a('0x33')][_0x7c2a('0x35')]?_0x30343d['attributes']:_0x10a851[_0x7c2a('0x2f')];if(_0x20f81e['query'][_0x7c2a('0x3c')]){_0x30343d[_0x7c2a('0x43')]=[{'all':!![]}];}_0x30343d=_[_0x7c2a('0x39')]({},_0x30343d,_0x20f81e[_0x7c2a('0x3b')]);return db[_0x7c2a('0x3d')][_0x7c2a('0x44')](_0x30343d)[_0x7c2a('0x26')](handleEntityNotFound(_0xa4d584,null))[_0x7c2a('0x26')](respondWithResult(_0xa4d584,null))['catch'](handleError(_0xa4d584,null));};exports['create']=function(_0x2952e4,_0x4fae0b){return db[_0x7c2a('0x3d')][_0x7c2a('0x45')](_0x2952e4['body'],{})[_0x7c2a('0x26')](respondWithResult(_0x4fae0b,0xc9))[_0x7c2a('0x40')](handleError(_0x4fae0b,null));};exports[_0x7c2a('0x24')]=function(_0x5cc987,_0x47654b){if(_0x5cc987[_0x7c2a('0x46')]['id']){delete _0x5cc987[_0x7c2a('0x46')]['id'];}return db[_0x7c2a('0x3d')][_0x7c2a('0x44')]({'where':{'id':_0x5cc987[_0x7c2a('0x47')]['id']}})['then'](handleEntityNotFound(_0x47654b,null))[_0x7c2a('0x26')](saveUpdates(_0x5cc987[_0x7c2a('0x46')],null))[_0x7c2a('0x26')](respondWithResult(_0x47654b,null))[_0x7c2a('0x40')](handleError(_0x47654b,null));};exports['destroy']=function(_0x3a0850,_0x95bf54){return db['Dynamics365Configuration'][_0x7c2a('0x44')]({'where':{'id':_0x3a0850['params']['id']}})[_0x7c2a('0x26')](handleEntityNotFound(_0x95bf54,null))[_0x7c2a('0x26')](removeEntity(_0x95bf54,null))[_0x7c2a('0x40')](handleError(_0x95bf54,null));};exports['getFields']=function(_0x2fd9e0,_0x59e8be,_0x2b4461){var _0x7aed67={};var _0x4a50b1={};var _0x478b94;var _0xa0e57e;return db['Dynamics365Configuration'][_0x7c2a('0x48')]({'where':{'id':_0x2fd9e0['params']['id']}})[_0x7c2a('0x26')](handleEntityNotFound(_0x59e8be,null))[_0x7c2a('0x26')](function(_0x2290c4){if(_0x2290c4){_0x478b94=_0x2290c4;_0x4a50b1['model']=_[_0x7c2a('0x42')](db[_0x7c2a('0x49')][_0x7c2a('0x2c')]);_0x4a50b1[_0x7c2a('0x30')]=_['keys'](_0x2fd9e0[_0x7c2a('0x30')]);_0x4a50b1['filters']=_['intersection'](_0x4a50b1[_0x7c2a('0x2f')],_0x4a50b1['query']);_0x7aed67[_0x7c2a('0x33')]=_['intersection'](_0x4a50b1[_0x7c2a('0x2f')],qs['fields'](_0x2fd9e0[_0x7c2a('0x30')][_0x7c2a('0x34')]));_0x7aed67[_0x7c2a('0x33')]=_0x7aed67[_0x7c2a('0x33')][_0x7c2a('0x35')]?_0x7aed67[_0x7c2a('0x33')]:_0x4a50b1[_0x7c2a('0x2f')];_0x7aed67[_0x7c2a('0x4a')]=qs[_0x7c2a('0x37')](_0x2fd9e0[_0x7c2a('0x30')][_0x7c2a('0x37')]);_0x7aed67[_0x7c2a('0x38')]=qs['filters'](_[_0x7c2a('0x4b')](_0x2fd9e0[_0x7c2a('0x30')],_0x4a50b1[_0x7c2a('0x31')]));if(_0x2fd9e0[_0x7c2a('0x30')][_0x7c2a('0x4c')]){_0x7aed67[_0x7c2a('0x38')]=_[_0x7c2a('0x39')](_0x7aed67[_0x7c2a('0x38')],{'$or':_[_0x7c2a('0x2b')](_0x7aed67[_0x7c2a('0x33')],function(_0x2f5671){var _0x1922e8={};_0x1922e8[_0x2f5671]={'$like':'%'+_0x2fd9e0[_0x7c2a('0x30')][_0x7c2a('0x4c')]+'%'};return _0x1922e8;})});}_0x7aed67=_[_0x7c2a('0x39')]({},_0x7aed67,_0x2fd9e0['options']);return _0x478b94['getFields'](_0x7aed67);}})[_0x7c2a('0x26')](function(_0x2d9ea6){if(_0x2d9ea6){_0xa0e57e=_0x2d9ea6[_0x7c2a('0x35')];if(!_0x2fd9e0[_0x7c2a('0x30')][_0x7c2a('0x4d')](_0x7c2a('0x36'))){_0x7aed67['limit']=qs[_0x7c2a('0x1d')](_0x2fd9e0[_0x7c2a('0x30')][_0x7c2a('0x1d')]);_0x7aed67[_0x7c2a('0x1b')]=qs[_0x7c2a('0x1b')](_0x2fd9e0['query'][_0x7c2a('0x1b')]);}return _0x478b94[_0x7c2a('0x4e')](_0x7aed67);}})['then'](function(_0x47bdf2){if(_0x47bdf2){return _0x47bdf2?{'count':_0xa0e57e,'rows':_0x47bdf2}:null;}})[_0x7c2a('0x26')](respondWithResult(_0x59e8be,null))['catch'](handleError(_0x59e8be,null));};exports[_0x7c2a('0x4f')]=function(_0x5b713b,_0x304b76,_0xa7682e){var _0x312d47={};var _0x7e3dcf={};var _0x2dbead;var _0x5f0e75;return db['Dynamics365Configuration'][_0x7c2a('0x48')]({'where':{'id':_0x5b713b[_0x7c2a('0x47')]['id']}})[_0x7c2a('0x26')](handleEntityNotFound(_0x304b76,null))['then'](function(_0x3b55df){if(_0x3b55df){_0x2dbead=_0x3b55df;_0x7e3dcf['model']=_[_0x7c2a('0x42')](db['Dynamics365Field'][_0x7c2a('0x2c')]);_0x7e3dcf['query']=_['keys'](_0x5b713b['query']);_0x7e3dcf[_0x7c2a('0x31')]=_['intersection'](_0x7e3dcf['model'],_0x7e3dcf[_0x7c2a('0x30')]);_0x312d47['attributes']=_['intersection'](_0x7e3dcf['model'],qs[_0x7c2a('0x34')](_0x5b713b[_0x7c2a('0x30')][_0x7c2a('0x34')]));_0x312d47['attributes']=_0x312d47['attributes']['length']?_0x312d47[_0x7c2a('0x33')]:_0x7e3dcf[_0x7c2a('0x2f')];_0x312d47[_0x7c2a('0x4a')]=qs['sort'](_0x5b713b[_0x7c2a('0x30')][_0x7c2a('0x37')]);_0x312d47[_0x7c2a('0x38')]=qs['filters'](_[_0x7c2a('0x4b')](_0x5b713b[_0x7c2a('0x30')],_0x7e3dcf[_0x7c2a('0x31')]));if(_0x5b713b[_0x7c2a('0x30')]['filter']){_0x312d47[_0x7c2a('0x38')]=_['merge'](_0x312d47['where'],{'$or':_[_0x7c2a('0x2b')](_0x312d47[_0x7c2a('0x33')],function(_0xb44a1d){var _0x34465a={};_0x34465a[_0xb44a1d]={'$like':'%'+_0x5b713b[_0x7c2a('0x30')][_0x7c2a('0x4c')]+'%'};return _0x34465a;})});}_0x312d47=_['merge']({},_0x312d47,_0x5b713b[_0x7c2a('0x3b')]);return _0x2dbead[_0x7c2a('0x4f')](_0x312d47);}})[_0x7c2a('0x26')](function(_0x5f4373){if(_0x5f4373){_0x5f0e75=_0x5f4373[_0x7c2a('0x35')];if(!_0x5b713b[_0x7c2a('0x30')][_0x7c2a('0x4d')](_0x7c2a('0x36'))){_0x312d47['limit']=qs[_0x7c2a('0x1d')](_0x5b713b['query'][_0x7c2a('0x1d')]);_0x312d47[_0x7c2a('0x1b')]=qs['offset'](_0x5b713b['query'][_0x7c2a('0x1b')]);}return _0x2dbead[_0x7c2a('0x4f')](_0x312d47);}})[_0x7c2a('0x26')](function(_0x28b7e3){if(_0x28b7e3){return _0x28b7e3?{'count':_0x5f0e75,'rows':_0x28b7e3}:null;}})[_0x7c2a('0x26')](respondWithResult(_0x304b76,null))[_0x7c2a('0x40')](handleError(_0x304b76,null));};exports[_0x7c2a('0x50')]=function(_0xff5741,_0xae9e4c,_0x1ceb7c){var _0x89f67d={};var _0x4e4190={};var _0x1d9fbc;var _0x39f1fd;return db[_0x7c2a('0x3d')][_0x7c2a('0x48')]({'where':{'id':_0xff5741[_0x7c2a('0x47')]['id']}})['then'](handleEntityNotFound(_0xae9e4c,null))[_0x7c2a('0x26')](function(_0x3ad768){if(_0x3ad768){_0x1d9fbc=_0x3ad768;_0x4e4190[_0x7c2a('0x2f')]=_[_0x7c2a('0x42')](db['Dynamics365Field'][_0x7c2a('0x2c')]);_0x4e4190['query']=_['keys'](_0xff5741['query']);_0x4e4190[_0x7c2a('0x31')]=_[_0x7c2a('0x32')](_0x4e4190[_0x7c2a('0x2f')],_0x4e4190[_0x7c2a('0x30')]);_0x89f67d[_0x7c2a('0x33')]=_[_0x7c2a('0x32')](_0x4e4190[_0x7c2a('0x2f')],qs['fields'](_0xff5741[_0x7c2a('0x30')][_0x7c2a('0x34')]));_0x89f67d[_0x7c2a('0x33')]=_0x89f67d[_0x7c2a('0x33')]['length']?_0x89f67d[_0x7c2a('0x33')]:_0x4e4190['model'];_0x89f67d[_0x7c2a('0x4a')]=qs['sort'](_0xff5741[_0x7c2a('0x30')][_0x7c2a('0x37')]);_0x89f67d[_0x7c2a('0x38')]=qs[_0x7c2a('0x31')](_[_0x7c2a('0x4b')](_0xff5741[_0x7c2a('0x30')],_0x4e4190['filters']));if(_0xff5741[_0x7c2a('0x30')][_0x7c2a('0x4c')]){_0x89f67d[_0x7c2a('0x38')]=_['merge'](_0x89f67d[_0x7c2a('0x38')],{'$or':_[_0x7c2a('0x2b')](_0x89f67d['attributes'],function(_0x39e403){var _0x286d3d={};_0x286d3d[_0x39e403]={'$like':'%'+_0xff5741['query'][_0x7c2a('0x4c')]+'%'};return _0x286d3d;})});}_0x89f67d=_[_0x7c2a('0x39')]({},_0x89f67d,_0xff5741['options']);return _0x1d9fbc[_0x7c2a('0x50')](_0x89f67d);}})[_0x7c2a('0x26')](function(_0x182c00){if(_0x182c00){_0x39f1fd=_0x182c00[_0x7c2a('0x35')];if(!_0xff5741['query'][_0x7c2a('0x4d')](_0x7c2a('0x36'))){_0x89f67d[_0x7c2a('0x1d')]=qs[_0x7c2a('0x1d')](_0xff5741['query'][_0x7c2a('0x1d')]);_0x89f67d[_0x7c2a('0x1b')]=qs[_0x7c2a('0x1b')](_0xff5741[_0x7c2a('0x30')]['offset']);}return _0x1d9fbc[_0x7c2a('0x50')](_0x89f67d);}})[_0x7c2a('0x26')](function(_0x36a73a){if(_0x36a73a){return _0x36a73a?{'count':_0x39f1fd,'rows':_0x36a73a}:null;}})[_0x7c2a('0x26')](respondWithResult(_0xae9e4c,null))[_0x7c2a('0x40')](handleError(_0xae9e4c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index bbe5a24..5b8921c 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x3424e0,_0x46a3c5){var _0x129368=function(_0x3d2403){while(--_0x3d2403){_0x3424e0['push'](_0x3424e0['shift']());}};_0x129368(++_0x46a3c5);}(_0x84ab,0x12f));var _0xb84a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x84ab[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x41f252,_0x36bc6e){var _0x2c08e4=function(_0x8f9990){while(--_0x8f9990){_0x41f252['push'](_0x41f252['shift']());}};_0x2c08e4(++_0x36bc6e);}(_0x70e0,0x17b));var _0x070e=function(_0xa3ed31,_0x40bfee){_0xa3ed31=_0xa3ed31-0x0;var _0x4636b8=_0x70e0[_0xa3ed31];return _0x4636b8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'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 8b2f4b0..696edc4 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 _0x0e5e=['request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x0e5e,0x136));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe0e5('0x0'));var util=require(_0xe0e5('0x1'));var moment=require(_0xe0e5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0e5('0x3'));var db=require(_0xe0e5('0x4'))['db'];var utils=require(_0xe0e5('0x5'));var logger=require(_0xe0e5('0x6'))(_0xe0e5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe0e5('0x8')][_0xe0e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23fba8,_0xcd7ba5,_0x55edec){return new BPromise(function(_0x5e9666,_0x57b4bf){return client[_0xe0e5('0xa')](_0x23fba8,_0x55edec)[_0xe0e5('0xb')](function(_0x5b9728){logger['info'](_0xe0e5('0xc'),_0xcd7ba5,_0xe0e5('0xd'));logger['debug'](_0xe0e5('0xe'),_0xcd7ba5,_0xe0e5('0xd'),JSON['stringify'](_0x5b9728));if(_0x5b9728[_0xe0e5('0xf')]){if(_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x10')]===0x1f4){logger[_0xe0e5('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0xcd7ba5,_0x5b9728['error'][_0xe0e5('0x11')]);return _0x57b4bf(_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x11')]);}logger[_0xe0e5('0xf')](_0xe0e5('0xc'),_0xcd7ba5,_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x11')]);return _0x5e9666(_0x5b9728[_0xe0e5('0xf')][_0xe0e5('0x11')]);}else{logger[_0xe0e5('0x12')](_0xe0e5('0xc'),_0xcd7ba5,_0xe0e5('0xd'));_0x5e9666(_0x5b9728['result']['message']);}})[_0xe0e5('0x13')](function(_0x35f5bb){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xcd7ba5,_0x35f5bb);_0x57b4bf(_0x35f5bb);});});} \ No newline at end of file +var _0xfe26=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2efe4f,_0x35b3d9){var _0x251e7e=function(_0x56be52){while(--_0x56be52){_0x2efe4f['push'](_0x2efe4f['shift']());}};_0x251e7e(++_0x35b3d9);}(_0xfe26,0x65));var _0x6fe2=function(_0x215718,_0x1762f3){_0x215718=_0x215718-0x0;var _0x379fa1=_0xfe26[_0x215718];return _0x379fa1;};'use strict';var _=require(_0x6fe2('0x0'));var util=require('util');var moment=require(_0x6fe2('0x1'));var BPromise=require(_0x6fe2('0x2'));var rs=require(_0x6fe2('0x3'));var fs=require('fs');var Redis=require(_0x6fe2('0x4'));var db=require(_0x6fe2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fe2('0x6'))(_0x6fe2('0x7'));var config=require(_0x6fe2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6fe2('0x9')][_0x6fe2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a99b0,_0x3a30bb,_0x59baba){return new BPromise(function(_0x18370f,_0x39e83e){return client[_0x6fe2('0xb')](_0x4a99b0,_0x59baba)[_0x6fe2('0xc')](function(_0x2f37c6){logger[_0x6fe2('0xd')](_0x6fe2('0xe'),_0x3a30bb,_0x6fe2('0xf'));logger[_0x6fe2('0x10')](_0x6fe2('0x11'),_0x3a30bb,_0x6fe2('0xf'),JSON[_0x6fe2('0x12')](_0x2f37c6));if(_0x2f37c6[_0x6fe2('0x13')]){if(_0x2f37c6['error'][_0x6fe2('0x14')]===0x1f4){logger['error'](_0x6fe2('0xe'),_0x3a30bb,_0x2f37c6['error'][_0x6fe2('0x15')]);return _0x39e83e(_0x2f37c6[_0x6fe2('0x13')]['message']);}logger[_0x6fe2('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3a30bb,_0x2f37c6[_0x6fe2('0x13')]['message']);return _0x18370f(_0x2f37c6[_0x6fe2('0x13')]['message']);}else{logger[_0x6fe2('0xd')](_0x6fe2('0xe'),_0x3a30bb,'request\x20sent');_0x18370f(_0x2f37c6[_0x6fe2('0x16')][_0x6fe2('0x15')]);}})['catch'](function(_0xba477f){logger[_0x6fe2('0x13')](_0x6fe2('0xe'),_0x3a30bb,_0xba477f);_0x39e83e(_0xba477f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index cc9279f..dec5216 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 _0xfd4e=['isAuthenticated','/:id','post','create','put','delete','destroy','multer','path','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get'];(function(_0x29ef06,_0x3e54b7){var _0x57bd49=function(_0x21e644){while(--_0x21e644){_0x29ef06['push'](_0x29ef06['shift']());}};_0x57bd49(++_0x3e54b7);}(_0xfd4e,0xbd));var _0xefd4=function(_0x3ea868,_0x247a31){_0x3ea868=_0x3ea868-0x0;var _0x5d1977=_0xfd4e[_0x3ea868];return _0x5d1977;};'use strict';var multer=require(_0xefd4('0x0'));var util=require('util');var path=require(_0xefd4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xefd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xefd4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xefd4('0x4'));var controller=require(_0xefd4('0x5'));router[_0xefd4('0x6')]('/',auth[_0xefd4('0x7')](),controller['index']);router['get'](_0xefd4('0x8'),auth[_0xefd4('0x7')](),controller['show']);router[_0xefd4('0x9')]('/',auth[_0xefd4('0x7')](),controller[_0xefd4('0xa')]);router[_0xefd4('0xb')](_0xefd4('0x8'),auth[_0xefd4('0x7')](),controller['update']);router[_0xefd4('0xc')](_0xefd4('0x8'),auth[_0xefd4('0x7')](),controller[_0xefd4('0xd')]);module['exports']=router; \ No newline at end of file +var _0x52dd=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','create','put','update','destroy','exports','multer'];(function(_0x2ccd99,_0x389d70){var _0x4b3a61=function(_0x28ac8f){while(--_0x28ac8f){_0x2ccd99['push'](_0x2ccd99['shift']());}};_0x4b3a61(++_0x389d70);}(_0x52dd,0x87));var _0xd52d=function(_0x5173b4,_0x50ad05){_0x5173b4=_0x5173b4-0x0;var _0x2a91c6=_0x52dd[_0x5173b4];return _0x2a91c6;};'use strict';var multer=require(_0xd52d('0x0'));var util=require(_0xd52d('0x1'));var path=require('path');var timeout=require(_0xd52d('0x2'));var express=require(_0xd52d('0x3'));var router=express[_0xd52d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd52d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd52d('0x6'));var controller=require(_0xd52d('0x7'));router['get']('/',auth[_0xd52d('0x8')](),controller[_0xd52d('0x9')]);router[_0xd52d('0xa')](_0xd52d('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd52d('0x8')](),controller[_0xd52d('0xc')]);router[_0xd52d('0xd')](_0xd52d('0xb'),auth[_0xd52d('0x8')](),controller[_0xd52d('0xe')]);router['delete'](_0xd52d('0xb'),auth['isAuthenticated'](),controller[_0xd52d('0xf')]);module[_0xd52d('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 7e84b79..c6e6424 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 _0xfe3e=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports','ENUM','variable'];(function(_0x4604f0,_0x34d0a7){var _0x3f39f5=function(_0x11060b){while(--_0x11060b){_0x4604f0['push'](_0x4604f0['shift']());}};_0x3f39f5(++_0x34d0a7);}(_0xfe3e,0xd5));var _0xefe3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfe3e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xefe3('0x0')]={'type':{'type':Sequelize[_0xefe3('0x1')]('string',_0xefe3('0x2'),_0xefe3('0x3'),_0xefe3('0x4'),_0xefe3('0x5')),'defaultValue':_0xefe3('0x6')},'content':{'type':Sequelize[_0xefe3('0x7')]},'key':{'type':Sequelize[_0xefe3('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xefe3('0x6'),_0xefe3('0x2'),_0xefe3('0x3'))},'keyContent':{'type':Sequelize[_0xefe3('0x7')]},'idField':{'type':Sequelize[_0xefe3('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xefe3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x044c=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x044c,0xd8));var _0xc044=function(_0x2f3ccc,_0x4ce1be){_0x2f3ccc=_0x2f3ccc-0x0;var _0x233521=_0x044c[_0x2f3ccc];return _0x233521;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc044('0x0')](_0xc044('0x1'),_0xc044('0x2'),_0xc044('0x3'),_0xc044('0x4'),_0xc044('0x5')),'defaultValue':_0xc044('0x1')},'content':{'type':Sequelize[_0xc044('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc044('0x0')](_0xc044('0x1'),_0xc044('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc044('0x6')]},'idField':{'type':Sequelize[_0xc044('0x6')]},'nameField':{'type':Sequelize[_0xc044('0x6')]},'customField':{'type':Sequelize[_0xc044('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc044('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index a095eb3..d861a8c 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 _0xebfe=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xebfe,0x139));var _0xeebf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xebfe[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xeebf('0x0'));var rimraf=require(_0xeebf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeebf('0x2'));var rp=require(_0xeebf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeebf('0x4'));var util=require(_0xeebf('0x5'));var path=require(_0xeebf('0x6'));var sox=require(_0xeebf('0x7'));var csv=require(_0xeebf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeebf('0x9'));var _=require('lodash');var squel=require(_0xeebf('0xa'));var crypto=require(_0xeebf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeebf('0x8'));var querystring=require(_0xeebf('0xc'));var Papa=require(_0xeebf('0xd'));var Redis=require(_0xeebf('0xe'));var authService=require(_0xeebf('0xf'));var qs=require(_0xeebf('0x10'));var as=require(_0xeebf('0x11'));var hardwareService=require(_0xeebf('0x12'));var logger=require(_0xeebf('0x13'))(_0xeebf('0x14'));var utils=require('../../config/utils');var config=require(_0xeebf('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26b27f,_0x1504fe){_0x1504fe=_0x1504fe||0xcc;return function(_0x3b7037){if(_0x3b7037){return _0x26b27f[_0xeebf('0x16')](_0x1504fe);}return _0x26b27f[_0xeebf('0x17')](_0x1504fe)[_0xeebf('0x18')]();};}function respondWithResult(_0x4ccbfc,_0x208f7c){_0x208f7c=_0x208f7c||0xc8;return function(_0x272e45){if(_0x272e45){return _0x4ccbfc[_0xeebf('0x17')](_0x208f7c)[_0xeebf('0x19')](_0x272e45);}};}function respondWithFilteredResult(_0x1f3d6c,_0x39b8b7){return function(_0x4340cb){if(_0x4340cb){var _0x41959d=typeof _0x39b8b7[_0xeebf('0x1a')]===_0xeebf('0x1b')&&typeof _0x39b8b7[_0xeebf('0x1c')]===_0xeebf('0x1b');var _0x8c1b83=_0x4340cb['count'];var _0x369673=_0x41959d?0x0:_0x39b8b7[_0xeebf('0x1a')];var _0x28f893=_0x41959d?_0x4340cb[_0xeebf('0x1d')]:_0x39b8b7['offset']+_0x39b8b7[_0xeebf('0x1c')];var _0x39b653;if(_0x28f893>=_0x8c1b83){_0x28f893=_0x8c1b83;_0x39b653=0xc8;}else{_0x39b653=0xce;}_0x1f3d6c[_0xeebf('0x17')](_0x39b653);return _0x1f3d6c[_0xeebf('0x1e')](_0xeebf('0x1f'),_0x369673+'-'+_0x28f893+'/'+_0x8c1b83)[_0xeebf('0x19')](_0x4340cb);}return null;};}function patchUpdates(_0x3c4125){return function(_0x5b2711){try{jsonpatch[_0xeebf('0x20')](_0x5b2711,_0x3c4125,!![]);}catch(_0x25a604){return BPromise[_0xeebf('0x21')](_0x25a604);}return _0x5b2711[_0xeebf('0x22')]();};}function saveUpdates(_0x64c2f9,_0x866a6c){return function(_0x57a744){if(_0x57a744){return _0x57a744[_0xeebf('0x23')](_0x64c2f9)[_0xeebf('0x24')](function(_0x1b8bc9){return _0x1b8bc9;});}return null;};}function removeEntity(_0x4e896d,_0x3c9b01){return function(_0x53e45e){if(_0x53e45e){return _0x53e45e['destroy']()['then'](function(){_0x4e896d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ea89c,_0x4bd622){return function(_0x464aa6){if(!_0x464aa6){_0x4ea89c[_0xeebf('0x16')](0x194);}return _0x464aa6;};}function handleError(_0x24285f,_0x26a7b6){_0x26a7b6=_0x26a7b6||0x1f4;return function(_0x4a312c){logger[_0xeebf('0x25')](_0x4a312c['stack']);if(_0x4a312c[_0xeebf('0x26')]){delete _0x4a312c[_0xeebf('0x26')];}_0x24285f['status'](_0x26a7b6)[_0xeebf('0x27')](_0x4a312c);};}exports[_0xeebf('0x28')]=function(_0x2a27cf,_0x5aa34b){var _0x5665e7={},_0x55d13d={},_0x3ff4cd={'count':0x0,'rows':[]};var _0x101359=_[_0xeebf('0x29')](db[_0xeebf('0x2a')][_0xeebf('0x2b')],function(_0x3215a4){return{'name':_0x3215a4[_0xeebf('0x2c')],'type':_0x3215a4['type'][_0xeebf('0x2d')]};});_0x55d13d[_0xeebf('0x2e')]=_['map'](_0x101359,_0xeebf('0x26'));_0x55d13d[_0xeebf('0x2f')]=_[_0xeebf('0x30')](_0x2a27cf['query']);_0x55d13d[_0xeebf('0x31')]=_[_0xeebf('0x32')](_0x55d13d[_0xeebf('0x2e')],_0x55d13d['query']);_0x5665e7[_0xeebf('0x33')]=_[_0xeebf('0x32')](_0x55d13d[_0xeebf('0x2e')],qs[_0xeebf('0x34')](_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x34')]));_0x5665e7['attributes']=_0x5665e7['attributes'][_0xeebf('0x35')]?_0x5665e7[_0xeebf('0x33')]:_0x55d13d[_0xeebf('0x2e')];if(!_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x36')](_0xeebf('0x37'))){_0x5665e7[_0xeebf('0x1c')]=qs[_0xeebf('0x1c')](_0x2a27cf[_0xeebf('0x2f')]['limit']);_0x5665e7[_0xeebf('0x1a')]=qs[_0xeebf('0x1a')](_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x1a')]);}_0x5665e7[_0xeebf('0x38')]=qs[_0xeebf('0x39')](_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x39')]);_0x5665e7['where']=qs[_0xeebf('0x31')](_[_0xeebf('0x3a')](_0x2a27cf['query'],_0x55d13d[_0xeebf('0x31')]),_0x101359);if(_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x3b')]){_0x5665e7[_0xeebf('0x3c')]=_[_0xeebf('0x3d')](_0x5665e7[_0xeebf('0x3c')],{'$or':_['map'](_0x101359,function(_0x520dfc){if(_0x520dfc[_0xeebf('0x3e')]!==_0xeebf('0x3f')){var _0x308cfc={};_0x308cfc[_0x520dfc['name']]={'$like':'%'+_0x2a27cf[_0xeebf('0x2f')][_0xeebf('0x3b')]+'%'};return _0x308cfc;}})});}_0x5665e7=_[_0xeebf('0x3d')]({},_0x5665e7,_0x2a27cf['options']);var _0x2203e5={'where':_0x5665e7[_0xeebf('0x3c')]};return db['Dynamics365Field'][_0xeebf('0x1d')](_0x2203e5)[_0xeebf('0x24')](function(_0x3eb286){_0x3ff4cd[_0xeebf('0x1d')]=_0x3eb286;if(_0x2a27cf['query'][_0xeebf('0x40')]){_0x5665e7[_0xeebf('0x41')]=[{'all':!![]}];}return db[_0xeebf('0x2a')][_0xeebf('0x42')](_0x5665e7);})[_0xeebf('0x24')](function(_0x36b818){_0x3ff4cd[_0xeebf('0x43')]=_0x36b818;return _0x3ff4cd;})[_0xeebf('0x24')](respondWithFilteredResult(_0x5aa34b,_0x5665e7))[_0xeebf('0x44')](handleError(_0x5aa34b,null));};exports['show']=function(_0x50acc2,_0x3f7e42){var _0x560fa6={'raw':!![],'where':{'id':_0x50acc2[_0xeebf('0x45')]['id']}},_0x3faf5c={};_0x3faf5c['model']=_[_0xeebf('0x30')](db[_0xeebf('0x2a')][_0xeebf('0x2b')]);_0x3faf5c[_0xeebf('0x2f')]=_[_0xeebf('0x30')](_0x50acc2[_0xeebf('0x2f')]);_0x3faf5c[_0xeebf('0x31')]=_[_0xeebf('0x32')](_0x3faf5c['model'],_0x3faf5c[_0xeebf('0x2f')]);_0x560fa6[_0xeebf('0x33')]=_['intersection'](_0x3faf5c['model'],qs['fields'](_0x50acc2[_0xeebf('0x2f')]['fields']));_0x560fa6[_0xeebf('0x33')]=_0x560fa6[_0xeebf('0x33')][_0xeebf('0x35')]?_0x560fa6[_0xeebf('0x33')]:_0x3faf5c['model'];if(_0x50acc2[_0xeebf('0x2f')][_0xeebf('0x40')]){_0x560fa6[_0xeebf('0x41')]=[{'all':!![]}];}_0x560fa6=_[_0xeebf('0x3d')]({},_0x560fa6,_0x50acc2['options']);return db[_0xeebf('0x2a')][_0xeebf('0x46')](_0x560fa6)[_0xeebf('0x24')](handleEntityNotFound(_0x3f7e42,null))['then'](respondWithResult(_0x3f7e42,null))[_0xeebf('0x44')](handleError(_0x3f7e42,null));};exports[_0xeebf('0x47')]=function(_0x8610aa,_0x4ec017){return db[_0xeebf('0x2a')][_0xeebf('0x47')](_0x8610aa[_0xeebf('0x48')],{})[_0xeebf('0x24')](respondWithResult(_0x4ec017,0xc9))[_0xeebf('0x44')](handleError(_0x4ec017,null));};exports[_0xeebf('0x23')]=function(_0x495530,_0x4e54c8){if(_0x495530[_0xeebf('0x48')]['id']){delete _0x495530[_0xeebf('0x48')]['id'];}return db[_0xeebf('0x2a')][_0xeebf('0x46')]({'where':{'id':_0x495530[_0xeebf('0x45')]['id']}})[_0xeebf('0x24')](handleEntityNotFound(_0x4e54c8,null))['then'](saveUpdates(_0x495530[_0xeebf('0x48')],null))[_0xeebf('0x24')](respondWithResult(_0x4e54c8,null))[_0xeebf('0x44')](handleError(_0x4e54c8,null));};exports['destroy']=function(_0x1e0f87,_0x52b98c){return db[_0xeebf('0x2a')][_0xeebf('0x46')]({'where':{'id':_0x1e0f87['params']['id']}})[_0xeebf('0x24')](handleEntityNotFound(_0x52b98c,null))[_0xeebf('0x24')](removeEntity(_0x52b98c,null))[_0xeebf('0x44')](handleError(_0x52b98c,null));}; \ No newline at end of file +var _0xdb34=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','moment','mustache','util','to-csv','lodash','squel','crypto'];(function(_0x3dda0f,_0x5b9902){var _0x1b0488=function(_0x267031){while(--_0x267031){_0x3dda0f['push'](_0x3dda0f['shift']());}};_0x1b0488(++_0x5b9902);}(_0xdb34,0xcc));var _0x4db3=function(_0x503a3b,_0x3cc71a){_0x503a3b=_0x503a3b-0x0;var _0x5cefe3=_0xdb34[_0x503a3b];return _0x5cefe3;};'use strict';var emlformat=require(_0x4db3('0x0'));var rimraf=require(_0x4db3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4db3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4db3('0x3'));var util=require(_0x4db3('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4db3('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4db3('0x6'));var squel=require(_0x4db3('0x7'));var crypto=require(_0x4db3('0x8'));var jsforce=require(_0x4db3('0x9'));var deskjs=require(_0x4db3('0xa'));var toCsv=require(_0x4db3('0x5'));var querystring=require('querystring');var Papa=require(_0x4db3('0xb'));var Redis=require(_0x4db3('0xc'));var authService=require(_0x4db3('0xd'));var qs=require(_0x4db3('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4db3('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x4db3('0x10'));var config=require(_0x4db3('0x11'));var licenseUtil=require(_0x4db3('0x12'));var db=require(_0x4db3('0x13'))['db'];function respondWithStatusCode(_0x190140,_0x3ec86e){_0x3ec86e=_0x3ec86e||0xcc;return function(_0x2e8c43){if(_0x2e8c43){return _0x190140[_0x4db3('0x14')](_0x3ec86e);}return _0x190140['status'](_0x3ec86e)[_0x4db3('0x15')]();};}function respondWithResult(_0x6b03f7,_0xa2dce4){_0xa2dce4=_0xa2dce4||0xc8;return function(_0x296f8b){if(_0x296f8b){return _0x6b03f7[_0x4db3('0x16')](_0xa2dce4)[_0x4db3('0x17')](_0x296f8b);}};}function respondWithFilteredResult(_0x1acbd4,_0x2d8f18){return function(_0x1de45e){if(_0x1de45e){var _0x10e4af=typeof _0x2d8f18['offset']===_0x4db3('0x18')&&typeof _0x2d8f18[_0x4db3('0x19')]===_0x4db3('0x18');var _0x2ed288=_0x1de45e[_0x4db3('0x1a')];var _0x4c2d06=_0x10e4af?0x0:_0x2d8f18['offset'];var _0x1849f7=_0x10e4af?_0x1de45e[_0x4db3('0x1a')]:_0x2d8f18[_0x4db3('0x1b')]+_0x2d8f18[_0x4db3('0x19')];var _0x3a7b6c;if(_0x1849f7>=_0x2ed288){_0x1849f7=_0x2ed288;_0x3a7b6c=0xc8;}else{_0x3a7b6c=0xce;}_0x1acbd4[_0x4db3('0x16')](_0x3a7b6c);return _0x1acbd4[_0x4db3('0x1c')](_0x4db3('0x1d'),_0x4c2d06+'-'+_0x1849f7+'/'+_0x2ed288)['json'](_0x1de45e);}return null;};}function patchUpdates(_0x530746){return function(_0x2ff9f7){try{jsonpatch[_0x4db3('0x1e')](_0x2ff9f7,_0x530746,!![]);}catch(_0x30ce12){return BPromise[_0x4db3('0x1f')](_0x30ce12);}return _0x2ff9f7[_0x4db3('0x20')]();};}function saveUpdates(_0x1f2dca,_0x293fed){return function(_0x284611){if(_0x284611){return _0x284611[_0x4db3('0x21')](_0x1f2dca)[_0x4db3('0x22')](function(_0x126735){return _0x126735;});}return null;};}function removeEntity(_0xe6c91a,_0x22cefa){return function(_0x2149aa){if(_0x2149aa){return _0x2149aa[_0x4db3('0x23')]()[_0x4db3('0x22')](function(){_0xe6c91a[_0x4db3('0x16')](0xcc)[_0x4db3('0x15')]();});}};}function handleEntityNotFound(_0x4caa54,_0x2a5e20){return function(_0x2718b9){if(!_0x2718b9){_0x4caa54[_0x4db3('0x14')](0x194);}return _0x2718b9;};}function handleError(_0x3be6c9,_0x184284){_0x184284=_0x184284||0x1f4;return function(_0xa588af){logger[_0x4db3('0x24')](_0xa588af['stack']);if(_0xa588af[_0x4db3('0x25')]){delete _0xa588af[_0x4db3('0x25')];}_0x3be6c9[_0x4db3('0x16')](_0x184284)[_0x4db3('0x26')](_0xa588af);};}exports[_0x4db3('0x27')]=function(_0x35ad09,_0x3e1c4c){var _0x3d581a={},_0x1f582c={},_0x319381={'count':0x0,'rows':[]};var _0x4e4212=_['map'](db[_0x4db3('0x28')][_0x4db3('0x29')],function(_0x30d348){return{'name':_0x30d348[_0x4db3('0x2a')],'type':_0x30d348[_0x4db3('0x2b')][_0x4db3('0x2c')]};});_0x1f582c[_0x4db3('0x2d')]=_['map'](_0x4e4212,'name');_0x1f582c['query']=_[_0x4db3('0x2e')](_0x35ad09[_0x4db3('0x2f')]);_0x1f582c[_0x4db3('0x30')]=_[_0x4db3('0x31')](_0x1f582c[_0x4db3('0x2d')],_0x1f582c[_0x4db3('0x2f')]);_0x3d581a[_0x4db3('0x32')]=_['intersection'](_0x1f582c['model'],qs[_0x4db3('0x33')](_0x35ad09['query'][_0x4db3('0x33')]));_0x3d581a[_0x4db3('0x32')]=_0x3d581a[_0x4db3('0x32')][_0x4db3('0x34')]?_0x3d581a[_0x4db3('0x32')]:_0x1f582c[_0x4db3('0x2d')];if(!_0x35ad09[_0x4db3('0x2f')]['hasOwnProperty'](_0x4db3('0x35'))){_0x3d581a['limit']=qs['limit'](_0x35ad09['query'][_0x4db3('0x19')]);_0x3d581a['offset']=qs['offset'](_0x35ad09['query'][_0x4db3('0x1b')]);}_0x3d581a[_0x4db3('0x36')]=qs['sort'](_0x35ad09[_0x4db3('0x2f')]['sort']);_0x3d581a[_0x4db3('0x37')]=qs[_0x4db3('0x30')](_['pick'](_0x35ad09['query'],_0x1f582c[_0x4db3('0x30')]),_0x4e4212);if(_0x35ad09['query'][_0x4db3('0x38')]){_0x3d581a[_0x4db3('0x37')]=_[_0x4db3('0x39')](_0x3d581a[_0x4db3('0x37')],{'$or':_[_0x4db3('0x3a')](_0x4e4212,function(_0x5e341e){if(_0x5e341e[_0x4db3('0x2b')]!==_0x4db3('0x3b')){var _0x2d665c={};_0x2d665c[_0x5e341e[_0x4db3('0x25')]]={'$like':'%'+_0x35ad09[_0x4db3('0x2f')][_0x4db3('0x38')]+'%'};return _0x2d665c;}})});}_0x3d581a=_[_0x4db3('0x39')]({},_0x3d581a,_0x35ad09[_0x4db3('0x3c')]);var _0x2b268c={'where':_0x3d581a[_0x4db3('0x37')]};return db[_0x4db3('0x28')][_0x4db3('0x1a')](_0x2b268c)[_0x4db3('0x22')](function(_0xff7e4){_0x319381[_0x4db3('0x1a')]=_0xff7e4;if(_0x35ad09[_0x4db3('0x2f')][_0x4db3('0x3d')]){_0x3d581a[_0x4db3('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x4db3('0x3f')](_0x3d581a);})['then'](function(_0xf18b96){_0x319381[_0x4db3('0x40')]=_0xf18b96;return _0x319381;})[_0x4db3('0x22')](respondWithFilteredResult(_0x3e1c4c,_0x3d581a))[_0x4db3('0x41')](handleError(_0x3e1c4c,null));};exports[_0x4db3('0x42')]=function(_0x6bba03,_0xa0382d){var _0x3d08ea={'raw':!![],'where':{'id':_0x6bba03[_0x4db3('0x43')]['id']}},_0x5453eb={};_0x5453eb[_0x4db3('0x2d')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x5453eb[_0x4db3('0x2f')]=_[_0x4db3('0x2e')](_0x6bba03[_0x4db3('0x2f')]);_0x5453eb[_0x4db3('0x30')]=_['intersection'](_0x5453eb[_0x4db3('0x2d')],_0x5453eb[_0x4db3('0x2f')]);_0x3d08ea[_0x4db3('0x32')]=_[_0x4db3('0x31')](_0x5453eb[_0x4db3('0x2d')],qs[_0x4db3('0x33')](_0x6bba03[_0x4db3('0x2f')]['fields']));_0x3d08ea[_0x4db3('0x32')]=_0x3d08ea[_0x4db3('0x32')][_0x4db3('0x34')]?_0x3d08ea[_0x4db3('0x32')]:_0x5453eb[_0x4db3('0x2d')];if(_0x6bba03[_0x4db3('0x2f')]['includeAll']){_0x3d08ea['include']=[{'all':!![]}];}_0x3d08ea=_[_0x4db3('0x39')]({},_0x3d08ea,_0x6bba03['options']);return db[_0x4db3('0x28')][_0x4db3('0x44')](_0x3d08ea)[_0x4db3('0x22')](handleEntityNotFound(_0xa0382d,null))[_0x4db3('0x22')](respondWithResult(_0xa0382d,null))[_0x4db3('0x41')](handleError(_0xa0382d,null));};exports[_0x4db3('0x45')]=function(_0x315493,_0x6c5824){return db[_0x4db3('0x28')][_0x4db3('0x45')](_0x315493[_0x4db3('0x46')],{})[_0x4db3('0x22')](respondWithResult(_0x6c5824,0xc9))['catch'](handleError(_0x6c5824,null));};exports[_0x4db3('0x21')]=function(_0x53bd87,_0xd2a9db){if(_0x53bd87[_0x4db3('0x46')]['id']){delete _0x53bd87[_0x4db3('0x46')]['id'];}return db[_0x4db3('0x28')][_0x4db3('0x44')]({'where':{'id':_0x53bd87[_0x4db3('0x43')]['id']}})['then'](handleEntityNotFound(_0xd2a9db,null))[_0x4db3('0x22')](saveUpdates(_0x53bd87['body'],null))['then'](respondWithResult(_0xd2a9db,null))[_0x4db3('0x41')](handleError(_0xd2a9db,null));};exports[_0x4db3('0x23')]=function(_0x5a3058,_0x445edf){return db[_0x4db3('0x28')][_0x4db3('0x44')]({'where':{'id':_0x5a3058['params']['id']}})[_0x4db3('0x22')](handleEntityNotFound(_0x445edf,null))[_0x4db3('0x22')](removeEntity(_0x445edf,null))['catch'](handleError(_0x445edf,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a4df514..fe553d7 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 _0xbb3b=['moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbb3b,0x1ab));var _0xbbb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb3b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbbb3('0x0'))(_0xbbb3('0x1'));var moment=require(_0xbbb3('0x2'));var BPromise=require(_0xbbb3('0x3'));var rp=require(_0xbbb3('0x4'));var fs=require('fs');var path=require(_0xbbb3('0x5'));var rimraf=require('rimraf');var config=require(_0xbbb3('0x6'));var attributes=require(_0xbbb3('0x7'));module[_0xbbb3('0x8')]=function(_0x2be37a,_0x4d9f8c){return _0x2be37a['define'](_0xbbb3('0x9'),attributes,{'tableName':_0xbbb3('0xa'),'paranoid':![],'indexes':[{'name':_0xbbb3('0xb'),'fields':['idField',_0xbbb3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe191=['request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','../../config/logger','api'];(function(_0x1202a6,_0x29b04e){var _0x31dc2a=function(_0x9f5c31){while(--_0x9f5c31){_0x1202a6['push'](_0x1202a6['shift']());}};_0x31dc2a(++_0x29b04e);}(_0xe191,0x169));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e19('0x0'));var util=require('util');var logger=require(_0x1e19('0x1'))(_0x1e19('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e19('0x3'));var fs=require('fs');var path=require(_0x1e19('0x4'));var rimraf=require(_0x1e19('0x5'));var config=require(_0x1e19('0x6'));var attributes=require(_0x1e19('0x7'));module[_0x1e19('0x8')]=function(_0x31308f,_0x3a8758){return _0x31308f[_0x1e19('0x9')](_0x1e19('0xa'),attributes,{'tableName':_0x1e19('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x1e19('0xc'),_0x1e19('0xd')],'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 9d1b632..fad8153 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 _0x0803=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x43235e,_0x4c3638){var _0x46f122=function(_0x35acbe){while(--_0x35acbe){_0x43235e['push'](_0x43235e['shift']());}};_0x46f122(++_0x4c3638);}(_0x0803,0x174));var _0x3080=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0803[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3080('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3080('0x1'));var rs=require(_0x3080('0x2'));var fs=require('fs');var Redis=require(_0x3080('0x3'));var db=require(_0x3080('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3080('0x5'))('rpc');var config=require(_0x3080('0x6'));var jayson=require(_0x3080('0x7'));var client=jayson[_0x3080('0x8')][_0x3080('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xecb351,_0x778ee1,_0x5e5a67){return new BPromise(function(_0x246225,_0x29199f){return client[_0x3080('0xa')](_0xecb351,_0x5e5a67)[_0x3080('0xb')](function(_0x2cb99d){logger[_0x3080('0xc')](_0x3080('0xd'),_0x778ee1,_0x3080('0xe'));logger[_0x3080('0xf')](_0x3080('0x10'),_0x778ee1,'request\x20sent',JSON[_0x3080('0x11')](_0x2cb99d));if(_0x2cb99d[_0x3080('0x12')]){if(_0x2cb99d[_0x3080('0x12')][_0x3080('0x13')]===0x1f4){logger[_0x3080('0x12')](_0x3080('0xd'),_0x778ee1,_0x2cb99d['error']['message']);return _0x29199f(_0x2cb99d[_0x3080('0x12')][_0x3080('0x14')]);}logger[_0x3080('0x12')](_0x3080('0xd'),_0x778ee1,_0x2cb99d[_0x3080('0x12')][_0x3080('0x14')]);return _0x246225(_0x2cb99d[_0x3080('0x12')][_0x3080('0x14')]);}else{logger[_0x3080('0xc')](_0x3080('0xd'),_0x778ee1,_0x3080('0xe'));_0x246225(_0x2cb99d['result'][_0x3080('0x14')]);}})['catch'](function(_0x55f83a){logger[_0x3080('0x12')](_0x3080('0xd'),_0x778ee1,_0x55f83a);_0x29199f(_0x55f83a);});});} \ No newline at end of file +var _0xafc9=['Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info'];(function(_0x1b8f5a,_0x57c154){var _0x594189=function(_0x15b277){while(--_0x15b277){_0x1b8f5a['push'](_0x1b8f5a['shift']());}};_0x594189(++_0x57c154);}(_0xafc9,0x15c));var _0x9afc=function(_0x358b37,_0x2c739a){_0x358b37=_0x358b37-0x0;var _0x50a34f=_0xafc9[_0x358b37];return _0x50a34f;};'use strict';var _=require(_0x9afc('0x0'));var util=require(_0x9afc('0x1'));var moment=require(_0x9afc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9afc('0x3'));var db=require(_0x9afc('0x4'))['db'];var utils=require(_0x9afc('0x5'));var logger=require('../../config/logger')(_0x9afc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9afc('0x7')][_0x9afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x327699,_0x504066,_0x2d5f7c){return new BPromise(function(_0x2d1674,_0x3a0999){return client[_0x9afc('0x9')](_0x327699,_0x2d5f7c)[_0x9afc('0xa')](function(_0x5cc1d4){logger[_0x9afc('0xb')](_0x9afc('0xc'),_0x504066,_0x9afc('0xd'));logger[_0x9afc('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x504066,_0x9afc('0xd'),JSON['stringify'](_0x5cc1d4));if(_0x5cc1d4[_0x9afc('0xf')]){if(_0x5cc1d4[_0x9afc('0xf')][_0x9afc('0x10')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x504066,_0x5cc1d4[_0x9afc('0xf')][_0x9afc('0x11')]);return _0x3a0999(_0x5cc1d4[_0x9afc('0xf')]['message']);}logger[_0x9afc('0xf')](_0x9afc('0xc'),_0x504066,_0x5cc1d4['error']['message']);return _0x2d1674(_0x5cc1d4[_0x9afc('0xf')][_0x9afc('0x11')]);}else{logger['info'](_0x9afc('0xc'),_0x504066,'request\x20sent');_0x2d1674(_0x5cc1d4[_0x9afc('0x12')][_0x9afc('0x11')]);}})[_0x9afc('0x13')](function(_0x1ae9f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x504066,_0x1ae9f4);_0x3a0999(_0x1ae9f4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index bcb60ba..0282077 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 _0xd0fb=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','show','getConfigurations','/:id/fields','isAuthenticated','getFields','create','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer'];(function(_0xc26a48,_0x42ff7f){var _0x495bc0=function(_0x549479){while(--_0x549479){_0xc26a48['push'](_0xc26a48['shift']());}};_0x495bc0(++_0x42ff7f);}(_0xd0fb,0x197));var _0xbd0f=function(_0x26a468,_0x2ed644){_0x26a468=_0x26a468-0x0;var _0x41fe3a=_0xd0fb[_0x26a468];return _0x41fe3a;};'use strict';var multer=require(_0xbd0f('0x0'));var util=require(_0xbd0f('0x1'));var path=require('path');var timeout=require(_0xbd0f('0x2'));var express=require('express');var router=express[_0xbd0f('0x3')]();var fs_extra=require(_0xbd0f('0x4'));var auth=require(_0xbd0f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd0f('0x6'));var controller=require(_0xbd0f('0x7'));router[_0xbd0f('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd0f('0x9')]);router[_0xbd0f('0x8')](_0xbd0f('0xa'),auth['isAuthenticated'](),controller[_0xbd0f('0xb')]);router[_0xbd0f('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xbd0f('0xc')]);router['get'](_0xbd0f('0xd'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd0f('0x10')]);router[_0xbd0f('0x11')](_0xbd0f('0x12'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0x13')]);router['put'](_0xbd0f('0xa'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0x14')]);router[_0xbd0f('0x15')](_0xbd0f('0xa'),auth[_0xbd0f('0xe')](),controller[_0xbd0f('0x16')]);module[_0xbd0f('0x17')]=router; \ No newline at end of file +var _0xc225=['post','addConfiguration','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create'];(function(_0x37257d,_0x3c7667){var _0x4e8a23=function(_0x173209){while(--_0x173209){_0x37257d['push'](_0x37257d['shift']());}};_0x4e8a23(++_0x3c7667);}(_0xc225,0x1e8));var _0x5c22=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc225[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x5c22('0x0'));var path=require('path');var timeout=require(_0x5c22('0x1'));var express=require(_0x5c22('0x2'));var router=express[_0x5c22('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c22('0x4'));var interaction=require(_0x5c22('0x5'));var config=require('../../config/environment');var controller=require(_0x5c22('0x6'));router[_0x5c22('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5c22('0x7')](_0x5c22('0x8'),auth[_0x5c22('0x9')](),controller[_0x5c22('0xa')]);router['get'](_0x5c22('0xb'),auth['isAuthenticated'](),controller[_0x5c22('0xc')]);router[_0x5c22('0x7')](_0x5c22('0xd'),auth[_0x5c22('0x9')](),controller[_0x5c22('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5c22('0xf')]);router[_0x5c22('0x10')]('/:id/configurations',auth[_0x5c22('0x9')](),controller[_0x5c22('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5c22('0x12')]);router[_0x5c22('0x13')](_0x5c22('0x8'),auth[_0x5c22('0x9')](),controller[_0x5c22('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 758eb9b..733835b 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 _0x4213=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1d0c51,_0x33853d){var _0x1c621c=function(_0x1da902){while(--_0x1da902){_0x1d0c51['push'](_0x1d0c51['shift']());}};_0x1c621c(++_0x33853d);}(_0x4213,0x77));var _0x3421=function(_0x2d8cc8,_0x344af8){_0x2d8cc8=_0x2d8cc8-0x0;var _0x688977=_0x4213[_0x2d8cc8];return _0x688977;};'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 +var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x5c0b75,_0x2c3407){var _0x5e45f2=function(_0xab1d98){while(--_0xab1d98){_0x5c0b75['push'](_0x5c0b75['shift']());}};_0x5e45f2(++_0x2c3407);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x57bea6,_0x91fbff){_0x57bea6=_0x57bea6-0x0;var _0x54b4e2=_0x4e2e[_0x57bea6];return _0x54b4e2;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index abea8a6..738ab51 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 _0xae7b=['Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','length','options','find','create','body','FreshdeskConfiguration','order','filter','getConfigurations','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshdeskField','remoteUri','apiKey','slice','GET','format','%s/%s','api/v2/ticket_fields','toString','base64','subject','agent','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set'];(function(_0x28ee9c,_0x1ae563){var _0x36f796=function(_0x4b9d9a){while(--_0x4b9d9a){_0x28ee9c['push'](_0x28ee9c['shift']());}};_0x36f796(++_0x1ae563);}(_0xae7b,0xbe));var _0xbae7=function(_0x3a9690,_0x5e06e8){_0x3a9690=_0x3a9690-0x0;var _0x146bef=_0xae7b[_0x3a9690];return _0x146bef;};'use strict';var emlformat=require(_0xbae7('0x0'));var rimraf=require(_0xbae7('0x1'));var zipdir=require(_0xbae7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var Mustache=require(_0xbae7('0x5'));var util=require(_0xbae7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae7('0x7'));var ejs=require(_0xbae7('0x8'));var fs=require('fs');var fs_extra=require(_0xbae7('0x9'));var _=require('lodash');var squel=require(_0xbae7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbae7('0xb'));var deskjs=require(_0xbae7('0xc'));var toCsv=require(_0xbae7('0x7'));var querystring=require('querystring');var Papa=require(_0xbae7('0xd'));var Redis=require('ioredis');var authService=require(_0xbae7('0xe'));var qs=require(_0xbae7('0xf'));var as=require(_0xbae7('0x10'));var hardwareService=require(_0xbae7('0x11'));var logger=require('../../config/logger')(_0xbae7('0x12'));var utils=require(_0xbae7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae7('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbae7('0x15'));function respondWithStatusCode(_0x4090a1,_0x5b1abe){_0x5b1abe=_0x5b1abe||0xcc;return function(_0x4800d4){if(_0x4800d4){return _0x4090a1[_0xbae7('0x16')](_0x5b1abe);}return _0x4090a1[_0xbae7('0x17')](_0x5b1abe)[_0xbae7('0x18')]();};}function respondWithResult(_0x25d1a,_0x4cc0a9){_0x4cc0a9=_0x4cc0a9||0xc8;return function(_0x31f6e5){if(_0x31f6e5){return _0x25d1a['status'](_0x4cc0a9)['json'](_0x31f6e5);}};}function respondWithFilteredResult(_0x249669,_0xb272c4){return function(_0x1b9ee1){if(_0x1b9ee1){var _0x181512=typeof _0xb272c4[_0xbae7('0x19')]===_0xbae7('0x1a')&&typeof _0xb272c4['limit']===_0xbae7('0x1a');var _0x450c85=_0x1b9ee1[_0xbae7('0x1b')];var _0x2cb970=_0x181512?0x0:_0xb272c4[_0xbae7('0x19')];var _0x4fddf6=_0x181512?_0x1b9ee1['count']:_0xb272c4['offset']+_0xb272c4[_0xbae7('0x1c')];var _0x16d4f3;if(_0x4fddf6>=_0x450c85){_0x4fddf6=_0x450c85;_0x16d4f3=0xc8;}else{_0x16d4f3=0xce;}_0x249669[_0xbae7('0x17')](_0x16d4f3);return _0x249669[_0xbae7('0x1d')](_0xbae7('0x1e'),_0x2cb970+'-'+_0x4fddf6+'/'+_0x450c85)['json'](_0x1b9ee1);}return null;};}function patchUpdates(_0xd87dc2){return function(_0x100866){try{jsonpatch[_0xbae7('0x1f')](_0x100866,_0xd87dc2,!![]);}catch(_0x169bfb){return BPromise[_0xbae7('0x20')](_0x169bfb);}return _0x100866[_0xbae7('0x21')]();};}function saveUpdates(_0x32d772,_0x3e4569){return function(_0x361271){if(_0x361271){return _0x361271[_0xbae7('0x22')](_0x32d772)[_0xbae7('0x23')](function(_0x384ea6){return _0x384ea6;});}return null;};}function removeEntity(_0x32f8eb,_0x5c0245){return function(_0x4c09ae){if(_0x4c09ae){return _0x4c09ae[_0xbae7('0x24')]()[_0xbae7('0x23')](function(){_0x32f8eb[_0xbae7('0x17')](0xcc)[_0xbae7('0x18')]();});}};}function handleEntityNotFound(_0x61170a,_0x3e003d){return function(_0x410360){if(!_0x410360){_0x61170a[_0xbae7('0x16')](0x194);}return _0x410360;};}function handleError(_0x1399bc,_0x3e104e){_0x3e104e=_0x3e104e||0x1f4;return function(_0x3df1f1){logger[_0xbae7('0x25')](_0x3df1f1['stack']);if(_0x3df1f1['name']){delete _0x3df1f1['name'];}_0x1399bc[_0xbae7('0x17')](_0x3e104e)[_0xbae7('0x26')](_0x3df1f1);};}exports[_0xbae7('0x27')]=function(_0x12dd23,_0x12797a){var _0x2d8202={},_0x47e12b={},_0x5d702f={'count':0x0,'rows':[]};var _0x41d4fa=_[_0xbae7('0x28')](db[_0xbae7('0x29')][_0xbae7('0x2a')],function(_0xcee3dd){return{'name':_0xcee3dd[_0xbae7('0x2b')],'type':_0xcee3dd['type'][_0xbae7('0x2c')]};});_0x47e12b[_0xbae7('0x2d')]=_[_0xbae7('0x28')](_0x41d4fa,_0xbae7('0x2e'));_0x47e12b[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x12dd23[_0xbae7('0x2f')]);_0x47e12b[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x47e12b[_0xbae7('0x2d')],_0x47e12b[_0xbae7('0x2f')]);_0x2d8202[_0xbae7('0x33')]=_['intersection'](_0x47e12b[_0xbae7('0x2d')],qs[_0xbae7('0x34')](_0x12dd23[_0xbae7('0x2f')]['fields']));_0x2d8202[_0xbae7('0x33')]=_0x2d8202[_0xbae7('0x33')]['length']?_0x2d8202[_0xbae7('0x33')]:_0x47e12b[_0xbae7('0x2d')];if(!_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x35')](_0xbae7('0x36'))){_0x2d8202[_0xbae7('0x1c')]=qs[_0xbae7('0x1c')](_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x1c')]);_0x2d8202['offset']=qs['offset'](_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x19')]);}_0x2d8202['order']=qs[_0xbae7('0x37')](_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x37')]);_0x2d8202[_0xbae7('0x38')]=qs[_0xbae7('0x31')](_[_0xbae7('0x39')](_0x12dd23[_0xbae7('0x2f')],_0x47e12b[_0xbae7('0x31')]),_0x41d4fa);if(_0x12dd23['query']['filter']){_0x2d8202[_0xbae7('0x38')]=_['merge'](_0x2d8202[_0xbae7('0x38')],{'$or':_['map'](_0x41d4fa,function(_0xaf175){if(_0xaf175[_0xbae7('0x3a')]!==_0xbae7('0x3b')){var _0x3fc2c4={};_0x3fc2c4[_0xaf175[_0xbae7('0x2e')]]={'$like':'%'+_0x12dd23[_0xbae7('0x2f')]['filter']+'%'};return _0x3fc2c4;}})});}_0x2d8202=_[_0xbae7('0x3c')]({},_0x2d8202,_0x12dd23['options']);var _0x525772={'where':_0x2d8202[_0xbae7('0x38')]};return db[_0xbae7('0x29')][_0xbae7('0x1b')](_0x525772)[_0xbae7('0x23')](function(_0x32592c){_0x5d702f['count']=_0x32592c;if(_0x12dd23[_0xbae7('0x2f')][_0xbae7('0x3d')]){_0x2d8202[_0xbae7('0x3e')]=[{'all':!![]}];}return db[_0xbae7('0x29')][_0xbae7('0x3f')](_0x2d8202);})['then'](function(_0x2f8193){_0x5d702f['rows']=_0x2f8193;return _0x5d702f;})[_0xbae7('0x23')](respondWithFilteredResult(_0x12797a,_0x2d8202))[_0xbae7('0x40')](handleError(_0x12797a,null));};exports[_0xbae7('0x41')]=function(_0x472686,_0x1895ef){var _0x57f345={'raw':![],'where':{'id':_0x472686[_0xbae7('0x42')]['id']}},_0x41b647={};_0x41b647[_0xbae7('0x2d')]=_[_0xbae7('0x30')](db[_0xbae7('0x29')][_0xbae7('0x2a')]);_0x41b647[_0xbae7('0x2f')]=_['keys'](_0x472686[_0xbae7('0x2f')]);_0x41b647[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x41b647[_0xbae7('0x2d')],_0x41b647[_0xbae7('0x2f')]);_0x57f345[_0xbae7('0x33')]=_['intersection'](_0x41b647['model'],qs[_0xbae7('0x34')](_0x472686[_0xbae7('0x2f')]['fields']));_0x57f345[_0xbae7('0x33')]=_0x57f345[_0xbae7('0x33')][_0xbae7('0x43')]?_0x57f345[_0xbae7('0x33')]:_0x41b647[_0xbae7('0x2d')];if(_0x472686['query'][_0xbae7('0x3d')]){_0x57f345[_0xbae7('0x3e')]=[{'all':!![]}];}_0x57f345=_[_0xbae7('0x3c')]({},_0x57f345,_0x472686[_0xbae7('0x44')]);return db['FreshdeskAccount'][_0xbae7('0x45')](_0x57f345)[_0xbae7('0x23')](handleEntityNotFound(_0x1895ef,null))[_0xbae7('0x23')](respondWithResult(_0x1895ef,null))[_0xbae7('0x40')](handleError(_0x1895ef,null));};exports['create']=function(_0x11722e,_0x325de4){return db[_0xbae7('0x29')][_0xbae7('0x46')](_0x11722e['body'],{})[_0xbae7('0x23')](respondWithResult(_0x325de4,0xc9))[_0xbae7('0x40')](handleError(_0x325de4,null));};exports[_0xbae7('0x22')]=function(_0x363b7b,_0x30b469){if(_0x363b7b['body']['id']){delete _0x363b7b['body']['id'];}return db['FreshdeskAccount'][_0xbae7('0x45')]({'where':{'id':_0x363b7b[_0xbae7('0x42')]['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x30b469,null))[_0xbae7('0x23')](saveUpdates(_0x363b7b[_0xbae7('0x47')],null))['then'](respondWithResult(_0x30b469,null))['catch'](handleError(_0x30b469,null));};exports[_0xbae7('0x24')]=function(_0x46f0a9,_0x45a4c7){return db['FreshdeskAccount'][_0xbae7('0x45')]({'where':{'id':_0x46f0a9[_0xbae7('0x42')]['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x45a4c7,null))[_0xbae7('0x23')](removeEntity(_0x45a4c7,null))[_0xbae7('0x40')](handleError(_0x45a4c7,null));};exports['getConfigurations']=function(_0x2ccd2c,_0x59ac8a,_0x26e0e6){var _0x35b301={};var _0x472a20={};var _0x891e31;var _0x384fbc;return db[_0xbae7('0x29')]['findOne']({'where':{'id':_0x2ccd2c[_0xbae7('0x42')]['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x59ac8a,null))['then'](function(_0x4cbcda){if(_0x4cbcda){_0x891e31=_0x4cbcda;_0x472a20['model']=_['keys'](db[_0xbae7('0x48')][_0xbae7('0x2a')]);_0x472a20[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x2ccd2c[_0xbae7('0x2f')]);_0x472a20[_0xbae7('0x31')]=_['intersection'](_0x472a20[_0xbae7('0x2d')],_0x472a20[_0xbae7('0x2f')]);_0x35b301[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x472a20['model'],qs[_0xbae7('0x34')](_0x2ccd2c[_0xbae7('0x2f')]['fields']));_0x35b301[_0xbae7('0x33')]=_0x35b301[_0xbae7('0x33')]['length']?_0x35b301['attributes']:_0x472a20[_0xbae7('0x2d')];_0x35b301[_0xbae7('0x49')]=qs[_0xbae7('0x37')](_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x37')]);_0x35b301[_0xbae7('0x38')]=qs[_0xbae7('0x31')](_[_0xbae7('0x39')](_0x2ccd2c[_0xbae7('0x2f')],_0x472a20[_0xbae7('0x31')]));if(_0x2ccd2c['query'][_0xbae7('0x4a')]){_0x35b301[_0xbae7('0x38')]=_[_0xbae7('0x3c')](_0x35b301[_0xbae7('0x38')],{'$or':_[_0xbae7('0x28')](_0x35b301[_0xbae7('0x33')],function(_0x52a2b4){var _0x315f2c={};_0x315f2c[_0x52a2b4]={'$like':'%'+_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x4a')]+'%'};return _0x315f2c;})});}_0x35b301=_[_0xbae7('0x3c')]({},_0x35b301,_0x2ccd2c['options']);return _0x891e31[_0xbae7('0x4b')](_0x35b301);}})['then'](function(_0x35b02c){if(_0x35b02c){_0x384fbc=_0x35b02c[_0xbae7('0x43')];if(!_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x35')](_0xbae7('0x36'))){_0x35b301['limit']=qs[_0xbae7('0x1c')](_0x2ccd2c[_0xbae7('0x2f')][_0xbae7('0x1c')]);_0x35b301['offset']=qs['offset'](_0x2ccd2c['query']['offset']);}return _0x891e31[_0xbae7('0x4b')](_0x35b301);}})['then'](function(_0x2ac856){if(_0x2ac856){return _0x2ac856?{'count':_0x384fbc,'rows':_0x2ac856}:null;}})[_0xbae7('0x23')](respondWithResult(_0x59ac8a,null))[_0xbae7('0x40')](handleError(_0x59ac8a,null));};exports[_0xbae7('0x4c')]=function(_0x54e404,_0x39e0af,_0x18a369){if(_0x54e404[_0xbae7('0x47')]['id']){delete _0x54e404[_0xbae7('0x47')]['id'];}return db[_0xbae7('0x29')][_0xbae7('0x4d')]({'where':{'id':_0x54e404['params']['id']}})[_0xbae7('0x23')](handleEntityNotFound(_0x39e0af,null))[_0xbae7('0x23')](function(_0x12d49c){if(_0x12d49c){_0x54e404[_0xbae7('0x47')]['AccountId']=_0x12d49c['id'];_0x54e404['body']['Subjects']=integrations[_0xbae7('0x4e')](_0x54e404[_0xbae7('0x47')][_0xbae7('0x4f')],_0x54e404[_0xbae7('0x47')][_0xbae7('0x3a')]);_0x54e404['body'][_0xbae7('0x50')]=integrations[_0xbae7('0x51')](_0x54e404['body'][_0xbae7('0x4f')],_0x54e404[_0xbae7('0x47')][_0xbae7('0x3a')]);return db[_0xbae7('0x48')]['create'](_0x54e404['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xbae7('0x52')},{'model':db[_0xbae7('0x53')],'as':_0xbae7('0x50')}]});}return null;})[_0xbae7('0x23')](respondWithResult(_0x39e0af,null))[_0xbae7('0x40')](handleError(_0x39e0af,null));};exports['getFields']=function(_0x200676,_0x2b726c,_0x288e01){var _0x3e7a7b='';return db[_0xbae7('0x29')][_0xbae7('0x4d')]({'where':{'id':_0x200676['params']['id']},'attributes':['id',_0xbae7('0x54'),_0xbae7('0x55')]})['then'](handleEntityNotFound(_0x2b726c,null))['then'](function(_0x298276){if(_0x298276){_0x3e7a7b=_0x298276[_0xbae7('0x54')];var _0x12adbd=_0x3e7a7b[_0xbae7('0x56')](-0x1);if(_0x12adbd==='/'){_0x3e7a7b=_0x3e7a7b['substring'](0x0,_0x3e7a7b['lastIndexOf'](_0x12adbd));}return rp({'method':_0xbae7('0x57'),'uri':util[_0xbae7('0x58')](_0xbae7('0x59'),_0x3e7a7b,_0xbae7('0x5a')),'headers':{'Authorization':util[_0xbae7('0x58')]('Basic\x20%s',new Buffer(util[_0xbae7('0x58')]('%s:X',_0x298276[_0xbae7('0x55')]))[_0xbae7('0x5b')](_0xbae7('0x5c')))},'json':!![]});}})[_0xbae7('0x23')](function(_0x1103d1){if(_0x1103d1){var _0x12d35a=['requester',_0xbae7('0x5d'),_0xbae7('0x5e'),'description','status','priority',_0xbae7('0x5f'),'source','ticket_type',_0xbae7('0x5f'),_0xbae7('0x60')];_[_0xbae7('0x61')](_0x1103d1,function(_0xc6eefe){return _0x12d35a[_0xbae7('0x62')](_0xc6eefe[_0xbae7('0x2e')])||!_0xc6eefe[_0xbae7('0x63')]&&_0xc6eefe[_0xbae7('0x3a')]!==_0xbae7('0x64')&&_0xc6eefe[_0xbae7('0x3a')]!==_0xbae7('0x65');});return{'count':_0x1103d1['length'],'rows':_[_0xbae7('0x28')](_0x1103d1,function(_0x18dd24){return{'id':_0x18dd24[_0xbae7('0x2e')],'name':_0x18dd24[_0xbae7('0x66')],'custom':!_0x18dd24[_0xbae7('0x63')],'options':_0x18dd24['choices']?_[_0xbae7('0x28')](_0x18dd24[_0xbae7('0x67')],function(_0x2f5188){return{'name':_[_0xbae7('0x68')](_0x2f5188),'value':_0x2f5188};}):[]};})};}})[_0xbae7('0x23')](respondWithResult(_0x2b726c,null))['catch'](function(_0x20d4e6){var _0x2d46e5=_0x200676[_0xbae7('0x2f')]['test']?0x1f4:_0x20d4e6[_0xbae7('0x69')]||0x1f4;logger[_0xbae7('0x25')](_0xbae7('0x6a'),_0xbae7('0x6b'),_0x2d46e5,JSON['stringify'](_0x20d4e6));delete _0x20d4e6[_0xbae7('0x2e')];if(_0x2d46e5===0x191){_0x2d46e5=0x190;}_0x2b726c[_0xbae7('0x17')](_0x2d46e5)[_0xbae7('0x26')](_0x200676['query'][_0xbae7('0x6c')]?{'message':_0xbae7('0x6d'),'statusCode':_0x20d4e6[_0xbae7('0x69')]}:_0x20d4e6);});}; \ No newline at end of file +var _0x6c4b=['format','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x6c4b,0x93));var _0xb6c4=function(_0x3102af,_0x137b65){_0x3102af=_0x3102af-0x0;var _0x3c208c=_0x6c4b[_0x3102af];return _0x3c208c;};'use strict';var emlformat=require(_0xb6c4('0x0'));var rimraf=require(_0xb6c4('0x1'));var zipdir=require(_0xb6c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6c4('0x3'));var moment=require(_0xb6c4('0x4'));var BPromise=require(_0xb6c4('0x5'));var Mustache=require(_0xb6c4('0x6'));var util=require(_0xb6c4('0x7'));var path=require(_0xb6c4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb6c4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb6c4('0xa'));var squel=require(_0xb6c4('0xb'));var crypto=require('crypto');var jsforce=require(_0xb6c4('0xc'));var deskjs=require(_0xb6c4('0xd'));var toCsv=require(_0xb6c4('0xe'));var querystring=require(_0xb6c4('0xf'));var Papa=require(_0xb6c4('0x10'));var Redis=require(_0xb6c4('0x11'));var authService=require(_0xb6c4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb6c4('0x13'));var hardwareService=require(_0xb6c4('0x14'));var logger=require(_0xb6c4('0x15'))(_0xb6c4('0x16'));var utils=require('../../config/utils');var config=require(_0xb6c4('0x17'));var licenseUtil=require(_0xb6c4('0x18'));var db=require(_0xb6c4('0x19'))['db'];var integrations=require(_0xb6c4('0x1a'));function respondWithStatusCode(_0x465416,_0x1d4e87){_0x1d4e87=_0x1d4e87||0xcc;return function(_0x185304){if(_0x185304){return _0x465416[_0xb6c4('0x1b')](_0x1d4e87);}return _0x465416['status'](_0x1d4e87)['end']();};}function respondWithResult(_0xdfd12b,_0x48e451){_0x48e451=_0x48e451||0xc8;return function(_0x8da84){if(_0x8da84){return _0xdfd12b[_0xb6c4('0x1c')](_0x48e451)[_0xb6c4('0x1d')](_0x8da84);}};}function respondWithFilteredResult(_0x5edd5c,_0x5c3d5e){return function(_0x1566a8){if(_0x1566a8){var _0xd9de6d=typeof _0x5c3d5e['offset']===_0xb6c4('0x1e')&&typeof _0x5c3d5e[_0xb6c4('0x1f')]===_0xb6c4('0x1e');var _0x2ab682=_0x1566a8[_0xb6c4('0x20')];var _0x1002cc=_0xd9de6d?0x0:_0x5c3d5e[_0xb6c4('0x21')];var _0x55eb35=_0xd9de6d?_0x1566a8['count']:_0x5c3d5e[_0xb6c4('0x21')]+_0x5c3d5e[_0xb6c4('0x1f')];var _0x1a7076;if(_0x55eb35>=_0x2ab682){_0x55eb35=_0x2ab682;_0x1a7076=0xc8;}else{_0x1a7076=0xce;}_0x5edd5c[_0xb6c4('0x1c')](_0x1a7076);return _0x5edd5c[_0xb6c4('0x22')](_0xb6c4('0x23'),_0x1002cc+'-'+_0x55eb35+'/'+_0x2ab682)['json'](_0x1566a8);}return null;};}function patchUpdates(_0x49c1b5){return function(_0x1d6495){try{jsonpatch[_0xb6c4('0x24')](_0x1d6495,_0x49c1b5,!![]);}catch(_0x95a9d){return BPromise[_0xb6c4('0x25')](_0x95a9d);}return _0x1d6495[_0xb6c4('0x26')]();};}function saveUpdates(_0x8f4a6f,_0x30071b){return function(_0x2cea6f){if(_0x2cea6f){return _0x2cea6f[_0xb6c4('0x27')](_0x8f4a6f)[_0xb6c4('0x28')](function(_0x5f6b5){return _0x5f6b5;});}return null;};}function removeEntity(_0x17e9c9,_0x3341aa){return function(_0x5da94d){if(_0x5da94d){return _0x5da94d[_0xb6c4('0x29')]()[_0xb6c4('0x28')](function(){_0x17e9c9[_0xb6c4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33df4e,_0x435622){return function(_0x2db07a){if(!_0x2db07a){_0x33df4e[_0xb6c4('0x1b')](0x194);}return _0x2db07a;};}function handleError(_0x30fa6f,_0x58607d){_0x58607d=_0x58607d||0x1f4;return function(_0x1f822e){logger[_0xb6c4('0x2a')](_0x1f822e[_0xb6c4('0x2b')]);if(_0x1f822e[_0xb6c4('0x2c')]){delete _0x1f822e['name'];}_0x30fa6f[_0xb6c4('0x1c')](_0x58607d)['send'](_0x1f822e);};}exports[_0xb6c4('0x2d')]=function(_0x58e7e8,_0xe0e62e){var _0x1335b9={},_0x38fbd0={},_0x194734={'count':0x0,'rows':[]};var _0x324656=_[_0xb6c4('0x2e')](db[_0xb6c4('0x2f')][_0xb6c4('0x30')],function(_0x2bbe57){return{'name':_0x2bbe57[_0xb6c4('0x31')],'type':_0x2bbe57[_0xb6c4('0x32')][_0xb6c4('0x33')]};});_0x38fbd0['model']=_['map'](_0x324656,_0xb6c4('0x2c'));_0x38fbd0[_0xb6c4('0x34')]=_[_0xb6c4('0x35')](_0x58e7e8['query']);_0x38fbd0['filters']=_[_0xb6c4('0x36')](_0x38fbd0[_0xb6c4('0x37')],_0x38fbd0[_0xb6c4('0x34')]);_0x1335b9[_0xb6c4('0x38')]=_[_0xb6c4('0x36')](_0x38fbd0[_0xb6c4('0x37')],qs[_0xb6c4('0x39')](_0x58e7e8[_0xb6c4('0x34')][_0xb6c4('0x39')]));_0x1335b9['attributes']=_0x1335b9[_0xb6c4('0x38')][_0xb6c4('0x3a')]?_0x1335b9[_0xb6c4('0x38')]:_0x38fbd0[_0xb6c4('0x37')];if(!_0x58e7e8[_0xb6c4('0x34')][_0xb6c4('0x3b')](_0xb6c4('0x3c'))){_0x1335b9[_0xb6c4('0x1f')]=qs[_0xb6c4('0x1f')](_0x58e7e8[_0xb6c4('0x34')][_0xb6c4('0x1f')]);_0x1335b9[_0xb6c4('0x21')]=qs[_0xb6c4('0x21')](_0x58e7e8['query']['offset']);}_0x1335b9[_0xb6c4('0x3d')]=qs['sort'](_0x58e7e8[_0xb6c4('0x34')][_0xb6c4('0x3e')]);_0x1335b9[_0xb6c4('0x3f')]=qs[_0xb6c4('0x40')](_[_0xb6c4('0x41')](_0x58e7e8['query'],_0x38fbd0[_0xb6c4('0x40')]),_0x324656);if(_0x58e7e8[_0xb6c4('0x34')][_0xb6c4('0x42')]){_0x1335b9[_0xb6c4('0x3f')]=_[_0xb6c4('0x43')](_0x1335b9[_0xb6c4('0x3f')],{'$or':_[_0xb6c4('0x2e')](_0x324656,function(_0x59f73f){if(_0x59f73f[_0xb6c4('0x32')]!==_0xb6c4('0x44')){var _0x33b69d={};_0x33b69d[_0x59f73f[_0xb6c4('0x2c')]]={'$like':'%'+_0x58e7e8[_0xb6c4('0x34')]['filter']+'%'};return _0x33b69d;}})});}_0x1335b9=_[_0xb6c4('0x43')]({},_0x1335b9,_0x58e7e8[_0xb6c4('0x45')]);var _0xc50fdf={'where':_0x1335b9['where']};return db[_0xb6c4('0x2f')][_0xb6c4('0x20')](_0xc50fdf)[_0xb6c4('0x28')](function(_0x43b7c0){_0x194734[_0xb6c4('0x20')]=_0x43b7c0;if(_0x58e7e8[_0xb6c4('0x34')][_0xb6c4('0x46')]){_0x1335b9['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0xb6c4('0x47')](_0x1335b9);})[_0xb6c4('0x28')](function(_0x1ed762){_0x194734[_0xb6c4('0x48')]=_0x1ed762;return _0x194734;})[_0xb6c4('0x28')](respondWithFilteredResult(_0xe0e62e,_0x1335b9))[_0xb6c4('0x49')](handleError(_0xe0e62e,null));};exports[_0xb6c4('0x4a')]=function(_0x20ae74,_0xa7b854){var _0x43f5c7={'raw':![],'where':{'id':_0x20ae74[_0xb6c4('0x4b')]['id']}},_0x428b57={};_0x428b57[_0xb6c4('0x37')]=_['keys'](db[_0xb6c4('0x2f')][_0xb6c4('0x30')]);_0x428b57['query']=_['keys'](_0x20ae74['query']);_0x428b57[_0xb6c4('0x40')]=_[_0xb6c4('0x36')](_0x428b57['model'],_0x428b57[_0xb6c4('0x34')]);_0x43f5c7[_0xb6c4('0x38')]=_['intersection'](_0x428b57[_0xb6c4('0x37')],qs[_0xb6c4('0x39')](_0x20ae74[_0xb6c4('0x34')][_0xb6c4('0x39')]));_0x43f5c7[_0xb6c4('0x38')]=_0x43f5c7[_0xb6c4('0x38')]['length']?_0x43f5c7[_0xb6c4('0x38')]:_0x428b57[_0xb6c4('0x37')];if(_0x20ae74['query'][_0xb6c4('0x46')]){_0x43f5c7[_0xb6c4('0x4c')]=[{'all':!![]}];}_0x43f5c7=_[_0xb6c4('0x43')]({},_0x43f5c7,_0x20ae74['options']);return db[_0xb6c4('0x2f')][_0xb6c4('0x4d')](_0x43f5c7)[_0xb6c4('0x28')](handleEntityNotFound(_0xa7b854,null))[_0xb6c4('0x28')](respondWithResult(_0xa7b854,null))[_0xb6c4('0x49')](handleError(_0xa7b854,null));};exports['create']=function(_0x679490,_0x297a57){return db[_0xb6c4('0x2f')][_0xb6c4('0x4e')](_0x679490[_0xb6c4('0x4f')],{})['then'](respondWithResult(_0x297a57,0xc9))[_0xb6c4('0x49')](handleError(_0x297a57,null));};exports[_0xb6c4('0x27')]=function(_0x317785,_0x10e8fd){if(_0x317785[_0xb6c4('0x4f')]['id']){delete _0x317785[_0xb6c4('0x4f')]['id'];}return db['FreshdeskAccount'][_0xb6c4('0x4d')]({'where':{'id':_0x317785['params']['id']}})[_0xb6c4('0x28')](handleEntityNotFound(_0x10e8fd,null))[_0xb6c4('0x28')](saveUpdates(_0x317785[_0xb6c4('0x4f')],null))[_0xb6c4('0x28')](respondWithResult(_0x10e8fd,null))[_0xb6c4('0x49')](handleError(_0x10e8fd,null));};exports[_0xb6c4('0x29')]=function(_0x3ab488,_0x5d762d){return db[_0xb6c4('0x2f')]['find']({'where':{'id':_0x3ab488[_0xb6c4('0x4b')]['id']}})[_0xb6c4('0x28')](handleEntityNotFound(_0x5d762d,null))['then'](removeEntity(_0x5d762d,null))[_0xb6c4('0x49')](handleError(_0x5d762d,null));};exports[_0xb6c4('0x50')]=function(_0x563272,_0x35edb3,_0x1ffe1b){var _0x37dc6f={};var _0x2cf3c8={};var _0xd3beae;var _0xd8a683;return db[_0xb6c4('0x2f')]['findOne']({'where':{'id':_0x563272['params']['id']}})['then'](handleEntityNotFound(_0x35edb3,null))['then'](function(_0x2d4f29){if(_0x2d4f29){_0xd3beae=_0x2d4f29;_0x2cf3c8[_0xb6c4('0x37')]=_[_0xb6c4('0x35')](db[_0xb6c4('0x51')][_0xb6c4('0x30')]);_0x2cf3c8['query']=_['keys'](_0x563272['query']);_0x2cf3c8['filters']=_[_0xb6c4('0x36')](_0x2cf3c8['model'],_0x2cf3c8[_0xb6c4('0x34')]);_0x37dc6f[_0xb6c4('0x38')]=_[_0xb6c4('0x36')](_0x2cf3c8['model'],qs[_0xb6c4('0x39')](_0x563272[_0xb6c4('0x34')][_0xb6c4('0x39')]));_0x37dc6f['attributes']=_0x37dc6f['attributes'][_0xb6c4('0x3a')]?_0x37dc6f[_0xb6c4('0x38')]:_0x2cf3c8['model'];_0x37dc6f[_0xb6c4('0x3d')]=qs[_0xb6c4('0x3e')](_0x563272[_0xb6c4('0x34')][_0xb6c4('0x3e')]);_0x37dc6f[_0xb6c4('0x3f')]=qs['filters'](_['pick'](_0x563272[_0xb6c4('0x34')],_0x2cf3c8['filters']));if(_0x563272[_0xb6c4('0x34')][_0xb6c4('0x42')]){_0x37dc6f['where']=_[_0xb6c4('0x43')](_0x37dc6f[_0xb6c4('0x3f')],{'$or':_[_0xb6c4('0x2e')](_0x37dc6f[_0xb6c4('0x38')],function(_0x326a96){var _0x1c26fc={};_0x1c26fc[_0x326a96]={'$like':'%'+_0x563272[_0xb6c4('0x34')][_0xb6c4('0x42')]+'%'};return _0x1c26fc;})});}_0x37dc6f=_[_0xb6c4('0x43')]({},_0x37dc6f,_0x563272['options']);return _0xd3beae[_0xb6c4('0x50')](_0x37dc6f);}})['then'](function(_0x3c8911){if(_0x3c8911){_0xd8a683=_0x3c8911[_0xb6c4('0x3a')];if(!_0x563272[_0xb6c4('0x34')][_0xb6c4('0x3b')](_0xb6c4('0x3c'))){_0x37dc6f[_0xb6c4('0x1f')]=qs[_0xb6c4('0x1f')](_0x563272[_0xb6c4('0x34')]['limit']);_0x37dc6f[_0xb6c4('0x21')]=qs[_0xb6c4('0x21')](_0x563272[_0xb6c4('0x34')][_0xb6c4('0x21')]);}return _0xd3beae[_0xb6c4('0x50')](_0x37dc6f);}})[_0xb6c4('0x28')](function(_0x4557ea){if(_0x4557ea){return _0x4557ea?{'count':_0xd8a683,'rows':_0x4557ea}:null;}})[_0xb6c4('0x28')](respondWithResult(_0x35edb3,null))[_0xb6c4('0x49')](handleError(_0x35edb3,null));};exports[_0xb6c4('0x52')]=function(_0x5d7385,_0x451cfc,_0x557656){if(_0x5d7385['body']['id']){delete _0x5d7385[_0xb6c4('0x4f')]['id'];}return db[_0xb6c4('0x2f')][_0xb6c4('0x53')]({'where':{'id':_0x5d7385[_0xb6c4('0x4b')]['id']}})[_0xb6c4('0x28')](handleEntityNotFound(_0x451cfc,null))[_0xb6c4('0x28')](function(_0x3b7afb){if(_0x3b7afb){_0x5d7385[_0xb6c4('0x4f')][_0xb6c4('0x54')]=_0x3b7afb['id'];_0x5d7385['body'][_0xb6c4('0x55')]=integrations[_0xb6c4('0x56')](_0x5d7385[_0xb6c4('0x4f')][_0xb6c4('0x57')],_0x5d7385[_0xb6c4('0x4f')][_0xb6c4('0x32')]);_0x5d7385['body']['Descriptions']=integrations[_0xb6c4('0x58')](_0x5d7385[_0xb6c4('0x4f')][_0xb6c4('0x57')],_0x5d7385[_0xb6c4('0x4f')][_0xb6c4('0x32')]);return db[_0xb6c4('0x51')][_0xb6c4('0x4e')](_0x5d7385['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xb6c4('0x55')},{'model':db[_0xb6c4('0x59')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x451cfc,null))[_0xb6c4('0x49')](handleError(_0x451cfc,null));};exports[_0xb6c4('0x5a')]=function(_0x2deccf,_0x2e0eb6,_0x36fcd9){var _0x1f88b4='';return db[_0xb6c4('0x2f')][_0xb6c4('0x53')]({'where':{'id':_0x2deccf[_0xb6c4('0x4b')]['id']},'attributes':['id',_0xb6c4('0x5b'),_0xb6c4('0x5c')]})[_0xb6c4('0x28')](handleEntityNotFound(_0x2e0eb6,null))[_0xb6c4('0x28')](function(_0x15b60b){if(_0x15b60b){_0x1f88b4=_0x15b60b[_0xb6c4('0x5b')];var _0x1ab46a=_0x1f88b4[_0xb6c4('0x5d')](-0x1);if(_0x1ab46a==='/'){_0x1f88b4=_0x1f88b4[_0xb6c4('0x5e')](0x0,_0x1f88b4[_0xb6c4('0x5f')](_0x1ab46a));}return rp({'method':_0xb6c4('0x60'),'uri':util['format'](_0xb6c4('0x61'),_0x1f88b4,_0xb6c4('0x62')),'headers':{'Authorization':util[_0xb6c4('0x63')](_0xb6c4('0x64'),new Buffer(util['format'](_0xb6c4('0x65'),_0x15b60b['apiKey']))[_0xb6c4('0x66')](_0xb6c4('0x67')))},'json':!![]});}})[_0xb6c4('0x28')](function(_0x574225){if(_0x574225){var _0x453d82=[_0xb6c4('0x68'),_0xb6c4('0x69'),_0xb6c4('0x6a'),_0xb6c4('0x6b'),'status',_0xb6c4('0x6c'),_0xb6c4('0x6d'),_0xb6c4('0x6e'),_0xb6c4('0x6f'),'group','company'];_[_0xb6c4('0x70')](_0x574225,function(_0x496cc9){return _0x453d82[_0xb6c4('0x71')](_0x496cc9['name'])||!_0x496cc9[_0xb6c4('0x72')]&&_0x496cc9[_0xb6c4('0x32')]!==_0xb6c4('0x73')&&_0x496cc9['type']!=='custom_dropdown';});return{'count':_0x574225[_0xb6c4('0x3a')],'rows':_['map'](_0x574225,function(_0x4ca9ef){return{'id':_0x4ca9ef[_0xb6c4('0x2c')],'name':_0x4ca9ef[_0xb6c4('0x74')],'custom':!_0x4ca9ef['default'],'options':_0x4ca9ef[_0xb6c4('0x75')]?_[_0xb6c4('0x2e')](_0x4ca9ef[_0xb6c4('0x75')],function(_0x13a050){return{'name':_[_0xb6c4('0x76')](_0x13a050),'value':_0x13a050};}):[]};})};}})[_0xb6c4('0x28')](respondWithResult(_0x2e0eb6,null))[_0xb6c4('0x49')](function(_0x85e926){var _0x4b817e=_0x2deccf['query'][_0xb6c4('0x77')]?0x1f4:_0x85e926[_0xb6c4('0x78')]||0x1f4;logger[_0xb6c4('0x2a')](_0xb6c4('0x79'),_0xb6c4('0x5a'),_0x4b817e,JSON[_0xb6c4('0x7a')](_0x85e926));delete _0x85e926[_0xb6c4('0x2c')];if(_0x4b817e===0x191){_0x4b817e=0x190;}_0x2e0eb6[_0xb6c4('0x1c')](_0x4b817e)['send'](_0x2deccf[_0xb6c4('0x34')][_0xb6c4('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x85e926[_0xb6c4('0x78')]}:_0x85e926);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f4daee5..6e82c0e 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 _0x0c0d=['api','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','util','../../config/logger'];(function(_0x14c240,_0x1d23fc){var _0x518d01=function(_0x4256b0){while(--_0x4256b0){_0x14c240['push'](_0x14c240['shift']());}};_0x518d01(++_0x1d23fc);}(_0x0c0d,0x196));var _0xd0c0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0c0d[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xd0c0('0x0'));var logger=require(_0xd0c0('0x1'))(_0xd0c0('0x2'));var moment=require('moment');var BPromise=require(_0xd0c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0c0('0x4'));var rimraf=require(_0xd0c0('0x5'));var config=require(_0xd0c0('0x6'));var attributes=require(_0xd0c0('0x7'));var integrations=require(_0xd0c0('0x8'));module[_0xd0c0('0x9')]=function(_0x59b57b,_0x1ea8ff){return _0x59b57b[_0xd0c0('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xd0c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe17d=['exports','FreshdeskAccount','int_freshdesk_accounts','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x13fc30,_0x461628){var _0x40465a=function(_0x13c8dd){while(--_0x13c8dd){_0x13fc30['push'](_0x13fc30['shift']());}};_0x40465a(++_0x461628);}(_0xe17d,0xe7));var _0xde17=function(_0x6650f8,_0x3c860e){_0x6650f8=_0x6650f8-0x0;var _0x474a83=_0xe17d[_0x6650f8];return _0x474a83;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde17('0x0'))(_0xde17('0x1'));var moment=require(_0xde17('0x2'));var BPromise=require(_0xde17('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde17('0x4'));var rimraf=require(_0xde17('0x5'));var config=require(_0xde17('0x6'));var attributes=require(_0xde17('0x7'));var integrations=require(_0xde17('0x8'));module[_0xde17('0x9')]=function(_0x56c860,_0x36011f){return _0x56c860['define'](_0xde17('0xa'),attributes,{'tableName':_0xde17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index dd80e1a..8041d96 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 _0x8649=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','include','model','map','catch','ShowFreshdeskAccount','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x2808db,_0x36541a){var _0x1b10fb=function(_0x1fca3c){while(--_0x1fca3c){_0x2808db['push'](_0x2808db['shift']());}};_0x1b10fb(++_0x36541a);}(_0x8649,0x7a));var _0x9864=function(_0x122785,_0x28beb5){_0x122785=_0x122785-0x0;var _0x3f1813=_0x8649[_0x122785];return _0x3f1813;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9864('0x0'));var BPromise=require(_0x9864('0x1'));var rs=require(_0x9864('0x2'));var fs=require('fs');var Redis=require(_0x9864('0x3'));var db=require(_0x9864('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9864('0x5'))('rpc');var config=require(_0x9864('0x6'));var jayson=require(_0x9864('0x7'));var client=jayson[_0x9864('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2438a5,_0x3a1873,_0x46b7d4){return new BPromise(function(_0x54c95c,_0x4b1307){return client['request'](_0x2438a5,_0x46b7d4)[_0x9864('0x9')](function(_0x40479b){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x3a1873,_0x9864('0xa'));logger[_0x9864('0xb')](_0x9864('0xc'),_0x3a1873,_0x9864('0xa'),JSON[_0x9864('0xd')](_0x40479b));if(_0x40479b['error']){if(_0x40479b[_0x9864('0xe')][_0x9864('0xf')]===0x1f4){logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x40479b['error']['message']);return _0x4b1307(_0x40479b[_0x9864('0xe')][_0x9864('0x11')]);}logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x40479b['error'][_0x9864('0x11')]);return _0x54c95c(_0x40479b[_0x9864('0xe')][_0x9864('0x11')]);}else{logger[_0x9864('0x12')](_0x9864('0x10'),_0x3a1873,'request\x20sent');_0x54c95c(_0x40479b[_0x9864('0x13')]['message']);}})['catch'](function(_0x4d1fc7){logger[_0x9864('0xe')](_0x9864('0x10'),_0x3a1873,_0x4d1fc7);_0x4b1307(_0x4d1fc7);});});}exports[_0x9864('0x14')]=function(_0x41e162){var _0x1e9326=this;return new Promise(function(_0x490103,_0x30c40c){return db[_0x9864('0x15')][_0x9864('0x16')]({'raw':_0x41e162[_0x9864('0x17')]?_0x41e162[_0x9864('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x41e162['options']?_0x41e162['options'][_0x9864('0x18')]||null:null,'attributes':_0x41e162[_0x9864('0x17')]?_0x41e162[_0x9864('0x17')][_0x9864('0x19')]||null:null,'limit':_0x41e162['options']?_0x41e162['options']['limit']||null:null,'include':_0x41e162[_0x9864('0x17')]?_0x41e162[_0x9864('0x17')]['include']?_['map'](_0x41e162[_0x9864('0x17')][_0x9864('0x1a')],function(_0x41805a){return{'model':db[_0x41805a[_0x9864('0x1b')]],'as':_0x41805a['as'],'attributes':_0x41805a[_0x9864('0x19')],'include':_0x41805a[_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x41805a[_0x9864('0x1a')],function(_0xc149ce){return{'model':db[_0xc149ce[_0x9864('0x1b')]],'as':_0xc149ce['as'],'attributes':_0xc149ce[_0x9864('0x19')],'include':_0xc149ce[_0x9864('0x1a')]?_['map'](_0xc149ce[_0x9864('0x1a')],function(_0x5d4cc6){return{'model':db[_0x5d4cc6[_0x9864('0x1b')]],'as':_0x5d4cc6['as'],'attributes':_0x5d4cc6['attributes']};}):[]};}):[]};}):[]:[]})[_0x9864('0x9')](function(_0x4bac80){logger[_0x9864('0x12')](_0x9864('0x14'),_0x41e162);logger['debug'](_0x9864('0x14'),_0x41e162,JSON[_0x9864('0xd')](_0x4bac80));_0x490103(_0x4bac80);})[_0x9864('0x1d')](function(_0x543ec4){logger[_0x9864('0xe')]('GetFreshdeskAccount',_0x543ec4['message'],_0x41e162);_0x30c40c(_0x1e9326[_0x9864('0xe')](0x1f4,_0x543ec4[_0x9864('0x11')]));});});};exports[_0x9864('0x1e')]=function(_0x1adf21){var _0x54abb3=this;return new Promise(function(_0x253213,_0x3eb64a){return db[_0x9864('0x15')][_0x9864('0x1f')]({'raw':_0x1adf21[_0x9864('0x17')]?_0x1adf21[_0x9864('0x17')][_0x9864('0x20')]===undefined?!![]:![]:!![],'where':_0x1adf21['options']?_0x1adf21[_0x9864('0x17')][_0x9864('0x18')]||null:null,'attributes':_0x1adf21['options']?_0x1adf21['options'][_0x9864('0x19')]||null:null,'include':_0x1adf21[_0x9864('0x17')]?_0x1adf21['options'][_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x1adf21[_0x9864('0x17')][_0x9864('0x1a')],function(_0x2c41ee){return{'model':db[_0x2c41ee[_0x9864('0x1b')]],'as':_0x2c41ee['as'],'attributes':_0x2c41ee[_0x9864('0x19')],'include':_0x2c41ee[_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x2c41ee[_0x9864('0x1a')],function(_0x4a1303){return{'model':db[_0x4a1303[_0x9864('0x1b')]],'as':_0x4a1303['as'],'attributes':_0x4a1303[_0x9864('0x19')],'include':_0x4a1303[_0x9864('0x1a')]?_[_0x9864('0x1c')](_0x4a1303[_0x9864('0x1a')],function(_0x489cbc){return{'model':db[_0x489cbc['model']],'as':_0x489cbc['as'],'attributes':_0x489cbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x9864('0x9')](function(_0x58018e){logger[_0x9864('0x12')](_0x9864('0x1e'),_0x1adf21);logger['debug'](_0x9864('0x1e'),_0x1adf21,JSON[_0x9864('0xd')](_0x58018e));_0x253213(_0x58018e);})[_0x9864('0x1d')](function(_0x4bfeae){logger[_0x9864('0xe')](_0x9864('0x1e'),_0x4bfeae[_0x9864('0x11')],_0x1adf21);_0x3eb64a(_0x54abb3[_0x9864('0xe')](0x1f4,_0x4bfeae[_0x9864('0x11')]));});});}; \ No newline at end of file +var _0x8d29=['findAll','options','raw','attributes','limit','include','model','map','catch','ShowFreshdeskAccount','find','where','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','GetFreshdeskAccount','FreshdeskAccount'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x8d29,0x156));var _0x98d2=function(_0xc310e2,_0x6a3920){_0xc310e2=_0xc310e2-0x0;var _0x42631a=_0x8d29[_0xc310e2];return _0x42631a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x98d2('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x98d2('0x1'));var logger=require(_0x98d2('0x2'))('rpc');var config=require(_0x98d2('0x3'));var jayson=require(_0x98d2('0x4'));var client=jayson[_0x98d2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320dd6,_0x162c71,_0x417cd3){return new BPromise(function(_0x54b388,_0x14dc8e){return client['request'](_0x320dd6,_0x417cd3)[_0x98d2('0x6')](function(_0x565ce5){logger[_0x98d2('0x7')]('FreshdeskAccount,\x20%s,\x20%s',_0x162c71,_0x98d2('0x8'));logger[_0x98d2('0x9')](_0x98d2('0xa'),_0x162c71,'request\x20sent',JSON[_0x98d2('0xb')](_0x565ce5));if(_0x565ce5[_0x98d2('0xc')]){if(_0x565ce5[_0x98d2('0xc')][_0x98d2('0xd')]===0x1f4){logger[_0x98d2('0xc')](_0x98d2('0xe'),_0x162c71,_0x565ce5[_0x98d2('0xc')]['message']);return _0x14dc8e(_0x565ce5[_0x98d2('0xc')][_0x98d2('0xf')]);}logger[_0x98d2('0xc')](_0x98d2('0xe'),_0x162c71,_0x565ce5[_0x98d2('0xc')]['message']);return _0x54b388(_0x565ce5['error'][_0x98d2('0xf')]);}else{logger[_0x98d2('0x7')](_0x98d2('0xe'),_0x162c71,_0x98d2('0x8'));_0x54b388(_0x565ce5['result'][_0x98d2('0xf')]);}})['catch'](function(_0x398073){logger['error'](_0x98d2('0xe'),_0x162c71,_0x398073);_0x14dc8e(_0x398073);});});}exports[_0x98d2('0x10')]=function(_0xa4b990){var _0x5c017c=this;return new Promise(function(_0x579bf8,_0x52362c){return db[_0x98d2('0x11')][_0x98d2('0x12')]({'raw':_0xa4b990[_0x98d2('0x13')]?_0xa4b990[_0x98d2('0x13')][_0x98d2('0x14')]===undefined?!![]:![]:!![],'where':_0xa4b990['options']?_0xa4b990[_0x98d2('0x13')]['where']||null:null,'attributes':_0xa4b990[_0x98d2('0x13')]?_0xa4b990['options'][_0x98d2('0x15')]||null:null,'limit':_0xa4b990[_0x98d2('0x13')]?_0xa4b990[_0x98d2('0x13')][_0x98d2('0x16')]||null:null,'include':_0xa4b990[_0x98d2('0x13')]?_0xa4b990['options'][_0x98d2('0x17')]?_['map'](_0xa4b990[_0x98d2('0x13')][_0x98d2('0x17')],function(_0x15942b){return{'model':db[_0x15942b[_0x98d2('0x18')]],'as':_0x15942b['as'],'attributes':_0x15942b['attributes'],'include':_0x15942b['include']?_['map'](_0x15942b[_0x98d2('0x17')],function(_0x493b4b){return{'model':db[_0x493b4b[_0x98d2('0x18')]],'as':_0x493b4b['as'],'attributes':_0x493b4b[_0x98d2('0x15')],'include':_0x493b4b[_0x98d2('0x17')]?_[_0x98d2('0x19')](_0x493b4b[_0x98d2('0x17')],function(_0x2fbdfc){return{'model':db[_0x2fbdfc[_0x98d2('0x18')]],'as':_0x2fbdfc['as'],'attributes':_0x2fbdfc[_0x98d2('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29b018){logger[_0x98d2('0x7')](_0x98d2('0x10'),_0xa4b990);logger[_0x98d2('0x9')]('GetFreshdeskAccount',_0xa4b990,JSON[_0x98d2('0xb')](_0x29b018));_0x579bf8(_0x29b018);})[_0x98d2('0x1a')](function(_0x16b91c){logger[_0x98d2('0xc')](_0x98d2('0x10'),_0x16b91c[_0x98d2('0xf')],_0xa4b990);_0x52362c(_0x5c017c[_0x98d2('0xc')](0x1f4,_0x16b91c[_0x98d2('0xf')]));});});};exports[_0x98d2('0x1b')]=function(_0x1ea2b3){var _0x22c876=this;return new Promise(function(_0x2b6dbc,_0xed62e0){return db[_0x98d2('0x11')][_0x98d2('0x1c')]({'raw':_0x1ea2b3[_0x98d2('0x13')]?_0x1ea2b3[_0x98d2('0x13')][_0x98d2('0x14')]===undefined?!![]:![]:!![],'where':_0x1ea2b3[_0x98d2('0x13')]?_0x1ea2b3[_0x98d2('0x13')][_0x98d2('0x1d')]||null:null,'attributes':_0x1ea2b3['options']?_0x1ea2b3[_0x98d2('0x13')][_0x98d2('0x15')]||null:null,'include':_0x1ea2b3['options']?_0x1ea2b3['options']['include']?_[_0x98d2('0x19')](_0x1ea2b3[_0x98d2('0x13')][_0x98d2('0x17')],function(_0x1842ab){return{'model':db[_0x1842ab['model']],'as':_0x1842ab['as'],'attributes':_0x1842ab['attributes'],'include':_0x1842ab[_0x98d2('0x17')]?_[_0x98d2('0x19')](_0x1842ab[_0x98d2('0x17')],function(_0x1258fb){return{'model':db[_0x1258fb['model']],'as':_0x1258fb['as'],'attributes':_0x1258fb[_0x98d2('0x15')],'include':_0x1258fb[_0x98d2('0x17')]?_['map'](_0x1258fb[_0x98d2('0x17')],function(_0x43a7fd){return{'model':db[_0x43a7fd[_0x98d2('0x18')]],'as':_0x43a7fd['as'],'attributes':_0x43a7fd[_0x98d2('0x15')]};}):[]};}):[]};}):[]:[]})[_0x98d2('0x6')](function(_0x4fa716){logger[_0x98d2('0x7')]('ShowFreshdeskAccount',_0x1ea2b3);logger[_0x98d2('0x9')](_0x98d2('0x1b'),_0x1ea2b3,JSON[_0x98d2('0xb')](_0x4fa716));_0x2b6dbc(_0x4fa716);})[_0x98d2('0x1a')](function(_0x29cfd6){logger['error'](_0x98d2('0x1b'),_0x29cfd6[_0x98d2('0xf')],_0x1ea2b3);_0xed62e0(_0x22c876[_0x98d2('0xc')](0x1f4,_0x29cfd6[_0x98d2('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 20549b6..f10b59c 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 _0x2e9f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','util','path'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0x2e9f,0xf8));var _0xf2e9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x2e9f[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require(_0xf2e9('0x0'));var path=require(_0xf2e9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2e9('0x2')]();var fs_extra=require(_0xf2e9('0x3'));var auth=require(_0xf2e9('0x4'));var interaction=require(_0xf2e9('0x5'));var config=require('../../config/environment');var controller=require(_0xf2e9('0x6'));router[_0xf2e9('0x7')]('/',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x9')]);router[_0xf2e9('0x7')](_0xf2e9('0xa'),auth[_0xf2e9('0x8')](),controller[_0xf2e9('0xb')]);router[_0xf2e9('0x7')](_0xf2e9('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf2e9('0x7')](_0xf2e9('0xd'),auth[_0xf2e9('0x8')](),controller[_0xf2e9('0xe')]);router[_0xf2e9('0x7')](_0xf2e9('0xf'),auth[_0xf2e9('0x8')](),controller['getDescriptions']);router[_0xf2e9('0x7')](_0xf2e9('0x10'),auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x11')]);router[_0xf2e9('0x12')]('/',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x13')]);router[_0xf2e9('0x12')]('/:id/tags',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x14')]);router[_0xf2e9('0x15')]('/:id',auth[_0xf2e9('0x8')](),controller[_0xf2e9('0x16')]);router[_0xf2e9('0x17')]('/:id',auth[_0xf2e9('0x8')](),controller['destroy']);module[_0xf2e9('0x18')]=router; \ No newline at end of file +var _0x1423=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3adc12,_0x404172){var _0x2cfb88=function(_0x4617c1){while(--_0x4617c1){_0x3adc12['push'](_0x3adc12['shift']());}};_0x2cfb88(++_0x404172);}(_0x1423,0x14a));var _0x3142=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1423[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3142('0x0'));var util=require('util');var path=require(_0x3142('0x1'));var timeout=require(_0x3142('0x2'));var express=require(_0x3142('0x3'));var router=express[_0x3142('0x4')]();var fs_extra=require(_0x3142('0x5'));var auth=require(_0x3142('0x6'));var interaction=require(_0x3142('0x7'));var config=require(_0x3142('0x8'));var controller=require(_0x3142('0x9'));router[_0x3142('0xa')]('/',auth[_0x3142('0xb')](),controller[_0x3142('0xc')]);router[_0x3142('0xa')](_0x3142('0xd'),auth[_0x3142('0xb')](),controller[_0x3142('0xe')]);router[_0x3142('0xa')](_0x3142('0xf'),auth['isAuthenticated'](),controller[_0x3142('0x10')]);router['get'](_0x3142('0x11'),auth[_0x3142('0xb')](),controller[_0x3142('0x12')]);router[_0x3142('0xa')](_0x3142('0x13'),auth[_0x3142('0xb')](),controller[_0x3142('0x14')]);router[_0x3142('0xa')](_0x3142('0x15'),auth[_0x3142('0xb')](),controller[_0x3142('0x16')]);router[_0x3142('0x17')]('/',auth[_0x3142('0xb')](),controller['create']);router['post'](_0x3142('0x15'),auth[_0x3142('0xb')](),controller['setTags']);router[_0x3142('0x18')](_0x3142('0xd'),auth[_0x3142('0xb')](),controller['update']);router[_0x3142('0x19')](_0x3142('0xd'),auth[_0x3142('0xb')](),controller[_0x3142('0x1a')]);module[_0x3142('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index e0adcee..d22ff00 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 _0x56f0=['sequelize','exports','STRING'];(function(_0x40a4d6,_0x23d696){var _0x45b62a=function(_0x3268d6){while(--_0x3268d6){_0x40a4d6['push'](_0x40a4d6['shift']());}};_0x45b62a(++_0x23d696);}(_0x56f0,0x114));var _0x056f=function(_0x3158d2,_0x277d23){_0x3158d2=_0x3158d2-0x0;var _0x57c15a=_0x56f0[_0x3158d2];return _0x57c15a;};'use strict';var Sequelize=require(_0x056f('0x0'));module[_0x056f('0x1')]={'name':{'type':Sequelize[_0x056f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x24a8=['STRING','sequelize','exports'];(function(_0x58834b,_0x42e911){var _0x112e21=function(_0x2d7a48){while(--_0x2d7a48){_0x58834b['push'](_0x58834b['shift']());}};_0x112e21(++_0x42e911);}(_0x24a8,0xcd));var _0x824a=function(_0x315c62,_0x3a88de){_0x315c62=_0x315c62-0x0;var _0x29fe90=_0x24a8[_0x315c62];return _0x29fe90;};'use strict';var Sequelize=require(_0x824a('0x0'));module[_0x824a('0x1')]={'name':{'type':Sequelize[_0x824a('0x2')]},'description':{'type':Sequelize[_0x824a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 2035015..448b5d7 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 _0x4b1a=['../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','reject','save','update','then','destroy','error','name','FreshdeskConfiguration','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','params','findOne','FreshdeskField','offset','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5a58ad,_0x4eda9f){var _0x5e7811=function(_0x32fae9){while(--_0x32fae9){_0x5a58ad['push'](_0x5a58ad['shift']());}};_0x5e7811(++_0x4eda9f);}(_0x4b1a,0x183));var _0xa4b1=function(_0x285e60,_0x2fa315){_0x285e60=_0x285e60-0x0;var _0x5a3fc4=_0x4b1a[_0x285e60];return _0x5a3fc4;};'use strict';var emlformat=require(_0xa4b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4b1('0x1'));var jsonpatch=require(_0xa4b1('0x2'));var rp=require(_0xa4b1('0x3'));var moment=require(_0xa4b1('0x4'));var BPromise=require(_0xa4b1('0x5'));var Mustache=require(_0xa4b1('0x6'));var util=require(_0xa4b1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa4b1('0x8'));var ejs=require(_0xa4b1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4b1('0xa'));var squel=require(_0xa4b1('0xb'));var crypto=require('crypto');var jsforce=require(_0xa4b1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa4b1('0xd'));var Papa=require(_0xa4b1('0xe'));var Redis=require(_0xa4b1('0xf'));var authService=require(_0xa4b1('0x10'));var qs=require(_0xa4b1('0x11'));var as=require(_0xa4b1('0x12'));var hardwareService=require(_0xa4b1('0x13'));var logger=require(_0xa4b1('0x14'))(_0xa4b1('0x15'));var utils=require(_0xa4b1('0x16'));var config=require(_0xa4b1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4b1('0x18'))['db'];function respondWithStatusCode(_0x3a539f,_0x232ac6){_0x232ac6=_0x232ac6||0xcc;return function(_0x3baf99){if(_0x3baf99){return _0x3a539f[_0xa4b1('0x19')](_0x232ac6);}return _0x3a539f[_0xa4b1('0x1a')](_0x232ac6)[_0xa4b1('0x1b')]();};}function respondWithResult(_0x4978cb,_0x31f95a){_0x31f95a=_0x31f95a||0xc8;return function(_0x502f63){if(_0x502f63){return _0x4978cb[_0xa4b1('0x1a')](_0x31f95a)[_0xa4b1('0x1c')](_0x502f63);}};}function respondWithFilteredResult(_0x567bfe,_0x2fb36a){return function(_0xa9ab14){if(_0xa9ab14){var _0x2e72a2=typeof _0x2fb36a['offset']===_0xa4b1('0x1d')&&typeof _0x2fb36a[_0xa4b1('0x1e')]===_0xa4b1('0x1d');var _0xba5601=_0xa9ab14[_0xa4b1('0x1f')];var _0x127b4e=_0x2e72a2?0x0:_0x2fb36a['offset'];var _0x514e39=_0x2e72a2?_0xa9ab14['count']:_0x2fb36a['offset']+_0x2fb36a[_0xa4b1('0x1e')];var _0x3c5d5e;if(_0x514e39>=_0xba5601){_0x514e39=_0xba5601;_0x3c5d5e=0xc8;}else{_0x3c5d5e=0xce;}_0x567bfe[_0xa4b1('0x1a')](_0x3c5d5e);return _0x567bfe[_0xa4b1('0x20')]('Content-Range',_0x127b4e+'-'+_0x514e39+'/'+_0xba5601)[_0xa4b1('0x1c')](_0xa9ab14);}return null;};}function patchUpdates(_0x271ef1){return function(_0x5d5bbe){try{jsonpatch['apply'](_0x5d5bbe,_0x271ef1,!![]);}catch(_0x145c08){return BPromise[_0xa4b1('0x21')](_0x145c08);}return _0x5d5bbe[_0xa4b1('0x22')]();};}function saveUpdates(_0x47bd81,_0x177d2c){return function(_0x4f2c9c){if(_0x4f2c9c){return _0x4f2c9c[_0xa4b1('0x23')](_0x47bd81)[_0xa4b1('0x24')](function(_0x56d17c){return _0x56d17c;});}return null;};}function removeEntity(_0x24b0f3,_0x45e5a1){return function(_0x366dba){if(_0x366dba){return _0x366dba[_0xa4b1('0x25')]()[_0xa4b1('0x24')](function(){_0x24b0f3['status'](0xcc)[_0xa4b1('0x1b')]();});}};}function handleEntityNotFound(_0xd4986f,_0x3ed7fe){return function(_0x24c877){if(!_0x24c877){_0xd4986f[_0xa4b1('0x19')](0x194);}return _0x24c877;};}function handleError(_0xafda14,_0x2120ae){_0x2120ae=_0x2120ae||0x1f4;return function(_0x4031ec){logger[_0xa4b1('0x26')](_0x4031ec['stack']);if(_0x4031ec[_0xa4b1('0x27')]){delete _0x4031ec[_0xa4b1('0x27')];}_0xafda14['status'](_0x2120ae)['send'](_0x4031ec);};}exports['index']=function(_0x45778d,_0x2160be){var _0x2ac1d1={},_0x44cd03={},_0x2306d4={'count':0x0,'rows':[]};var _0x326daf=_['map'](db[_0xa4b1('0x28')]['rawAttributes'],function(_0x287422){return{'name':_0x287422[_0xa4b1('0x29')],'type':_0x287422[_0xa4b1('0x2a')][_0xa4b1('0x2b')]};});_0x44cd03[_0xa4b1('0x2c')]=_[_0xa4b1('0x2d')](_0x326daf,_0xa4b1('0x27'));_0x44cd03[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x45778d[_0xa4b1('0x2e')]);_0x44cd03[_0xa4b1('0x30')]=_['intersection'](_0x44cd03[_0xa4b1('0x2c')],_0x44cd03['query']);_0x2ac1d1[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0x44cd03['model'],qs[_0xa4b1('0x33')](_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x33')]));_0x2ac1d1[_0xa4b1('0x31')]=_0x2ac1d1[_0xa4b1('0x31')]['length']?_0x2ac1d1[_0xa4b1('0x31')]:_0x44cd03['model'];if(!_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x34')](_0xa4b1('0x35'))){_0x2ac1d1[_0xa4b1('0x1e')]=qs['limit'](_0x45778d['query']['limit']);_0x2ac1d1['offset']=qs['offset'](_0x45778d[_0xa4b1('0x2e')]['offset']);}_0x2ac1d1[_0xa4b1('0x36')]=qs['sort'](_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x2ac1d1['where']=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x45778d[_0xa4b1('0x2e')],_0x44cd03[_0xa4b1('0x30')]),_0x326daf);if(_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x39')]){_0x2ac1d1[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x2ac1d1[_0xa4b1('0x3a')],{'$or':_['map'](_0x326daf,function(_0x39ecd7){if(_0x39ecd7[_0xa4b1('0x2a')]!==_0xa4b1('0x3c')){var _0x2c5201={};_0x2c5201[_0x39ecd7[_0xa4b1('0x27')]]={'$like':'%'+_0x45778d['query']['filter']+'%'};return _0x2c5201;}})});}_0x2ac1d1=_[_0xa4b1('0x3b')]({},_0x2ac1d1,_0x45778d[_0xa4b1('0x3d')]);var _0x20f625={'where':_0x2ac1d1[_0xa4b1('0x3a')]};return db[_0xa4b1('0x28')][_0xa4b1('0x1f')](_0x20f625)[_0xa4b1('0x24')](function(_0x9468a){_0x2306d4[_0xa4b1('0x1f')]=_0x9468a;if(_0x45778d[_0xa4b1('0x2e')][_0xa4b1('0x3e')]){_0x2ac1d1[_0xa4b1('0x3f')]=[{'all':!![]}];}return db[_0xa4b1('0x28')][_0xa4b1('0x40')](_0x2ac1d1);})['then'](function(_0xfe28a4){_0x2306d4[_0xa4b1('0x41')]=_0xfe28a4;return _0x2306d4;})[_0xa4b1('0x24')](respondWithFilteredResult(_0x2160be,_0x2ac1d1))[_0xa4b1('0x42')](handleError(_0x2160be,null));};exports['show']=function(_0x5de72,_0x167d68){var _0x1a3c66={'raw':![],'where':{'id':_0x5de72['params']['id']}},_0xb5082a={};_0xb5082a[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db[_0xa4b1('0x28')][_0xa4b1('0x43')]);_0xb5082a[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x5de72[_0xa4b1('0x2e')]);_0xb5082a[_0xa4b1('0x30')]=_[_0xa4b1('0x32')](_0xb5082a[_0xa4b1('0x2c')],_0xb5082a[_0xa4b1('0x2e')]);_0x1a3c66[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0xb5082a[_0xa4b1('0x2c')],qs[_0xa4b1('0x33')](_0x5de72['query'][_0xa4b1('0x33')]));_0x1a3c66['attributes']=_0x1a3c66[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x1a3c66[_0xa4b1('0x31')]:_0xb5082a[_0xa4b1('0x2c')];if(_0x5de72[_0xa4b1('0x2e')]['includeAll']){_0x1a3c66['include']=[{'all':!![]}];}_0x1a3c66=_['merge']({},_0x1a3c66,_0x5de72[_0xa4b1('0x3d')]);return db[_0xa4b1('0x28')][_0xa4b1('0x45')](_0x1a3c66)[_0xa4b1('0x24')](handleEntityNotFound(_0x167d68,null))[_0xa4b1('0x24')](respondWithResult(_0x167d68,null))['catch'](handleError(_0x167d68,null));};exports['create']=function(_0x118f44,_0x55244e){return db[_0xa4b1('0x28')][_0xa4b1('0x46')](_0x118f44['body'],{})[_0xa4b1('0x24')](respondWithResult(_0x55244e,0xc9))['catch'](handleError(_0x55244e,null));};exports[_0xa4b1('0x23')]=function(_0x145b2a,_0x5da8b7){if(_0x145b2a[_0xa4b1('0x47')]['id']){delete _0x145b2a['body']['id'];}return db[_0xa4b1('0x28')]['find']({'where':{'id':_0x145b2a[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x5da8b7,null))[_0xa4b1('0x24')](saveUpdates(_0x145b2a[_0xa4b1('0x47')],null))[_0xa4b1('0x24')](respondWithResult(_0x5da8b7,null))['catch'](handleError(_0x5da8b7,null));};exports['destroy']=function(_0x3e7e57,_0x3b5848){return db[_0xa4b1('0x28')][_0xa4b1('0x45')]({'where':{'id':_0x3e7e57[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b5848,null))[_0xa4b1('0x24')](removeEntity(_0x3b5848,null))[_0xa4b1('0x42')](handleError(_0x3b5848,null));};exports['getFields']=function(_0x3e0b83,_0x58054a,_0x403c52){var _0x1b078d={};var _0x20b47e={};var _0x24bb67;var _0x3f1ab4;return db[_0xa4b1('0x28')][_0xa4b1('0x49')]({'where':{'id':_0x3e0b83[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x58054a,null))[_0xa4b1('0x24')](function(_0x3e483a){if(_0x3e483a){_0x24bb67=_0x3e483a;_0x20b47e[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db[_0xa4b1('0x4a')]['rawAttributes']);_0x20b47e[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x3e0b83[_0xa4b1('0x2e')]);_0x20b47e[_0xa4b1('0x30')]=_['intersection'](_0x20b47e[_0xa4b1('0x2c')],_0x20b47e[_0xa4b1('0x2e')]);_0x1b078d['attributes']=_[_0xa4b1('0x32')](_0x20b47e[_0xa4b1('0x2c')],qs['fields'](_0x3e0b83['query']['fields']));_0x1b078d[_0xa4b1('0x31')]=_0x1b078d[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x1b078d[_0xa4b1('0x31')]:_0x20b47e['model'];_0x1b078d[_0xa4b1('0x36')]=qs[_0xa4b1('0x37')](_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x1b078d[_0xa4b1('0x3a')]=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x3e0b83[_0xa4b1('0x2e')],_0x20b47e['filters']));if(_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x39')]){_0x1b078d[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x1b078d[_0xa4b1('0x3a')],{'$or':_[_0xa4b1('0x2d')](_0x1b078d[_0xa4b1('0x31')],function(_0x44dae5){var _0xaed262={};_0xaed262[_0x44dae5]={'$like':'%'+_0x3e0b83['query'][_0xa4b1('0x39')]+'%'};return _0xaed262;})});}_0x1b078d=_['merge']({},_0x1b078d,_0x3e0b83[_0xa4b1('0x3d')]);return _0x24bb67['getFields'](_0x1b078d);}})['then'](function(_0x6f2862){if(_0x6f2862){_0x3f1ab4=_0x6f2862['length'];if(!_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x34')]('nolimit')){_0x1b078d[_0xa4b1('0x1e')]=qs[_0xa4b1('0x1e')](_0x3e0b83[_0xa4b1('0x2e')][_0xa4b1('0x1e')]);_0x1b078d[_0xa4b1('0x4b')]=qs[_0xa4b1('0x4b')](_0x3e0b83[_0xa4b1('0x2e')]['offset']);}return _0x24bb67[_0xa4b1('0x4c')](_0x1b078d);}})[_0xa4b1('0x24')](function(_0x9d4a36){if(_0x9d4a36){return _0x9d4a36?{'count':_0x3f1ab4,'rows':_0x9d4a36}:null;}})[_0xa4b1('0x24')](respondWithResult(_0x58054a,null))[_0xa4b1('0x42')](handleError(_0x58054a,null));};exports[_0xa4b1('0x4d')]=function(_0x5515a6,_0x5a2417,_0x4772af){var _0x211822={};var _0x1a2ccf={};var _0x12f4ee;var _0x2f59d2;return db['FreshdeskConfiguration'][_0xa4b1('0x49')]({'where':{'id':_0x5515a6[_0xa4b1('0x48')]['id']}})[_0xa4b1('0x24')](handleEntityNotFound(_0x5a2417,null))[_0xa4b1('0x24')](function(_0x51b6a4){if(_0x51b6a4){_0x12f4ee=_0x51b6a4;_0x1a2ccf[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db['FreshdeskField'][_0xa4b1('0x43')]);_0x1a2ccf[_0xa4b1('0x2e')]=_[_0xa4b1('0x2f')](_0x5515a6[_0xa4b1('0x2e')]);_0x1a2ccf[_0xa4b1('0x30')]=_[_0xa4b1('0x32')](_0x1a2ccf[_0xa4b1('0x2c')],_0x1a2ccf[_0xa4b1('0x2e')]);_0x211822[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0x1a2ccf[_0xa4b1('0x2c')],qs['fields'](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x33')]));_0x211822[_0xa4b1('0x31')]=_0x211822[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x211822['attributes']:_0x1a2ccf['model'];_0x211822[_0xa4b1('0x36')]=qs[_0xa4b1('0x37')](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x211822['where']=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x5515a6[_0xa4b1('0x2e')],_0x1a2ccf[_0xa4b1('0x30')]));if(_0x5515a6[_0xa4b1('0x2e')]['filter']){_0x211822[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x211822[_0xa4b1('0x3a')],{'$or':_[_0xa4b1('0x2d')](_0x211822['attributes'],function(_0x27362a){var _0x385b60={};_0x385b60[_0x27362a]={'$like':'%'+_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x39')]+'%'};return _0x385b60;})});}_0x211822=_[_0xa4b1('0x3b')]({},_0x211822,_0x5515a6[_0xa4b1('0x3d')]);return _0x12f4ee[_0xa4b1('0x4d')](_0x211822);}})[_0xa4b1('0x24')](function(_0x32e9f9){if(_0x32e9f9){_0x2f59d2=_0x32e9f9[_0xa4b1('0x44')];if(!_0x5515a6['query'][_0xa4b1('0x34')](_0xa4b1('0x35'))){_0x211822[_0xa4b1('0x1e')]=qs[_0xa4b1('0x1e')](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x1e')]);_0x211822['offset']=qs[_0xa4b1('0x4b')](_0x5515a6[_0xa4b1('0x2e')][_0xa4b1('0x4b')]);}return _0x12f4ee[_0xa4b1('0x4d')](_0x211822);}})['then'](function(_0x4319da){if(_0x4319da){return _0x4319da?{'count':_0x2f59d2,'rows':_0x4319da}:null;}})[_0xa4b1('0x24')](respondWithResult(_0x5a2417,null))['catch'](handleError(_0x5a2417,null));};exports[_0xa4b1('0x4e')]=function(_0x57c6ce,_0x368167,_0x435fbb){var _0x86a38c={};var _0x317143={};var _0x54ecae;var _0x42b4ea;return db['FreshdeskConfiguration'][_0xa4b1('0x49')]({'where':{'id':_0x57c6ce[_0xa4b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x368167,null))['then'](function(_0x1b5c02){if(_0x1b5c02){_0x54ecae=_0x1b5c02;_0x317143['model']=_['keys'](db[_0xa4b1('0x4a')][_0xa4b1('0x43')]);_0x317143[_0xa4b1('0x2e')]=_['keys'](_0x57c6ce[_0xa4b1('0x2e')]);_0x317143[_0xa4b1('0x30')]=_['intersection'](_0x317143['model'],_0x317143[_0xa4b1('0x2e')]);_0x86a38c[_0xa4b1('0x31')]=_[_0xa4b1('0x32')](_0x317143[_0xa4b1('0x2c')],qs[_0xa4b1('0x33')](_0x57c6ce[_0xa4b1('0x2e')][_0xa4b1('0x33')]));_0x86a38c[_0xa4b1('0x31')]=_0x86a38c['attributes'][_0xa4b1('0x44')]?_0x86a38c[_0xa4b1('0x31')]:_0x317143[_0xa4b1('0x2c')];_0x86a38c['order']=qs[_0xa4b1('0x37')](_0x57c6ce[_0xa4b1('0x2e')][_0xa4b1('0x37')]);_0x86a38c[_0xa4b1('0x3a')]=qs['filters'](_[_0xa4b1('0x38')](_0x57c6ce[_0xa4b1('0x2e')],_0x317143[_0xa4b1('0x30')]));if(_0x57c6ce['query'][_0xa4b1('0x39')]){_0x86a38c[_0xa4b1('0x3a')]=_[_0xa4b1('0x3b')](_0x86a38c[_0xa4b1('0x3a')],{'$or':_['map'](_0x86a38c[_0xa4b1('0x31')],function(_0x5bca16){var _0x23136e={};_0x23136e[_0x5bca16]={'$like':'%'+_0x57c6ce[_0xa4b1('0x2e')][_0xa4b1('0x39')]+'%'};return _0x23136e;})});}_0x86a38c=_[_0xa4b1('0x3b')]({},_0x86a38c,_0x57c6ce[_0xa4b1('0x3d')]);return _0x54ecae[_0xa4b1('0x4e')](_0x86a38c);}})[_0xa4b1('0x24')](function(_0x6a50db){if(_0x6a50db){_0x42b4ea=_0x6a50db['length'];if(!_0x57c6ce['query'][_0xa4b1('0x34')](_0xa4b1('0x35'))){_0x86a38c[_0xa4b1('0x1e')]=qs[_0xa4b1('0x1e')](_0x57c6ce['query'][_0xa4b1('0x1e')]);_0x86a38c[_0xa4b1('0x4b')]=qs[_0xa4b1('0x4b')](_0x57c6ce[_0xa4b1('0x2e')]['offset']);}return _0x54ecae[_0xa4b1('0x4e')](_0x86a38c);}})[_0xa4b1('0x24')](function(_0xc5a262){if(_0xc5a262){return _0xc5a262?{'count':_0x42b4ea,'rows':_0xc5a262}:null;}})['then'](respondWithResult(_0x368167,null))[_0xa4b1('0x42')](handleError(_0x368167,null));};exports[_0xa4b1('0x4f')]=function(_0x4e7c84,_0x285f81,_0x297ad2){var _0x1fae37={};var _0xc1ceca={};var _0x263e3;var _0x3121e6;return db[_0xa4b1('0x28')][_0xa4b1('0x49')]({'where':{'id':_0x4e7c84['params']['id']}})[_0xa4b1('0x24')](handleEntityNotFound(_0x285f81,null))[_0xa4b1('0x24')](function(_0x59b607){if(_0x59b607){_0x263e3=_0x59b607;_0xc1ceca[_0xa4b1('0x2c')]=_[_0xa4b1('0x2f')](db[_0xa4b1('0x50')][_0xa4b1('0x43')]);_0xc1ceca[_0xa4b1('0x2e')]=_['keys'](_0x4e7c84[_0xa4b1('0x2e')]);_0xc1ceca[_0xa4b1('0x30')]=_['intersection'](_0xc1ceca[_0xa4b1('0x2c')],_0xc1ceca[_0xa4b1('0x2e')]);_0x1fae37[_0xa4b1('0x31')]=_['intersection'](_0xc1ceca[_0xa4b1('0x2c')],qs[_0xa4b1('0x33')](_0x4e7c84['query'][_0xa4b1('0x33')]));_0x1fae37[_0xa4b1('0x31')]=_0x1fae37[_0xa4b1('0x31')][_0xa4b1('0x44')]?_0x1fae37[_0xa4b1('0x31')]:_0xc1ceca['model'];_0x1fae37['order']=qs[_0xa4b1('0x37')](_0x4e7c84[_0xa4b1('0x2e')]['sort']);_0x1fae37[_0xa4b1('0x3a')]=qs[_0xa4b1('0x30')](_[_0xa4b1('0x38')](_0x4e7c84[_0xa4b1('0x2e')],_0xc1ceca['filters']));if(_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x39')]){_0x1fae37['where']=_[_0xa4b1('0x3b')](_0x1fae37[_0xa4b1('0x3a')],{'$or':_[_0xa4b1('0x2d')](_0x1fae37[_0xa4b1('0x31')],function(_0x45ac2d){var _0x2ff306={};_0x2ff306[_0x45ac2d]={'$like':'%'+_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x39')]+'%'};return _0x2ff306;})});}_0x1fae37=_['merge']({},_0x1fae37,_0x4e7c84[_0xa4b1('0x3d')]);return _0x263e3[_0xa4b1('0x4f')](_0x1fae37);}})[_0xa4b1('0x24')](function(_0x51d661){if(_0x51d661){_0x3121e6=_0x51d661[_0xa4b1('0x44')];if(!_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x34')]('nolimit')){_0x1fae37[_0xa4b1('0x1e')]=qs['limit'](_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x1e')]);_0x1fae37[_0xa4b1('0x4b')]=qs[_0xa4b1('0x4b')](_0x4e7c84[_0xa4b1('0x2e')][_0xa4b1('0x4b')]);}return _0x263e3[_0xa4b1('0x4f')](_0x1fae37);}})[_0xa4b1('0x24')](function(_0x5cd3f4){if(_0x5cd3f4){return _0x5cd3f4?{'count':_0x3121e6,'rows':_0x5cd3f4}:null;}})['then'](respondWithResult(_0x285f81,null))[_0xa4b1('0x42')](handleError(_0x285f81,null));};exports['setTags']=function(_0x3951c0,_0x21ef75,_0x358c8a){if(_0x3951c0[_0xa4b1('0x47')]['id']){delete _0x3951c0[_0xa4b1('0x47')]['id'];}return db[_0xa4b1('0x28')][_0xa4b1('0x49')]({'where':{'id':_0x3951c0['params']['id']}})[_0xa4b1('0x24')](handleEntityNotFound(_0x21ef75,null))[_0xa4b1('0x24')](function(_0x50c03b){if(_0x50c03b){return _0x50c03b[_0xa4b1('0x51')](_0x3951c0[_0xa4b1('0x47')]['ids']||[]);}return null;})[_0xa4b1('0x24')](respondWithResult(_0x21ef75,null))[_0xa4b1('0x42')](handleError(_0x21ef75,null));}; \ No newline at end of file +var _0x1df0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','include','findAll','rows','catch','includeAll','create','body','find','params','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','pick','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1df0,0x19c));var _0x01df=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x1df0[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x01df('0x0'));var rimraf=require(_0x01df('0x1'));var zipdir=require(_0x01df('0x2'));var jsonpatch=require(_0x01df('0x3'));var rp=require(_0x01df('0x4'));var moment=require(_0x01df('0x5'));var BPromise=require(_0x01df('0x6'));var Mustache=require(_0x01df('0x7'));var util=require(_0x01df('0x8'));var path=require(_0x01df('0x9'));var sox=require(_0x01df('0xa'));var csv=require(_0x01df('0xb'));var ejs=require(_0x01df('0xc'));var fs=require('fs');var fs_extra=require(_0x01df('0xd'));var _=require('lodash');var squel=require(_0x01df('0xe'));var crypto=require(_0x01df('0xf'));var jsforce=require(_0x01df('0x10'));var deskjs=require(_0x01df('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x01df('0x12'));var Redis=require(_0x01df('0x13'));var authService=require(_0x01df('0x14'));var qs=require(_0x01df('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01df('0x16'));var logger=require(_0x01df('0x17'))(_0x01df('0x18'));var utils=require(_0x01df('0x19'));var config=require(_0x01df('0x1a'));var licenseUtil=require(_0x01df('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43b757,_0x20f668){_0x20f668=_0x20f668||0xcc;return function(_0x4f7f76){if(_0x4f7f76){return _0x43b757[_0x01df('0x1c')](_0x20f668);}return _0x43b757[_0x01df('0x1d')](_0x20f668)[_0x01df('0x1e')]();};}function respondWithResult(_0x3e9726,_0x45cce4){_0x45cce4=_0x45cce4||0xc8;return function(_0x6874b5){if(_0x6874b5){return _0x3e9726[_0x01df('0x1d')](_0x45cce4)[_0x01df('0x1f')](_0x6874b5);}};}function respondWithFilteredResult(_0x5ab5d0,_0x3ba29b){return function(_0x5926e1){if(_0x5926e1){var _0x28366d=typeof _0x3ba29b[_0x01df('0x20')]===_0x01df('0x21')&&typeof _0x3ba29b[_0x01df('0x22')]===_0x01df('0x21');var _0x3c0fd0=_0x5926e1['count'];var _0x16e31f=_0x28366d?0x0:_0x3ba29b[_0x01df('0x20')];var _0x4d0fb8=_0x28366d?_0x5926e1['count']:_0x3ba29b[_0x01df('0x20')]+_0x3ba29b['limit'];var _0x5744ff;if(_0x4d0fb8>=_0x3c0fd0){_0x4d0fb8=_0x3c0fd0;_0x5744ff=0xc8;}else{_0x5744ff=0xce;}_0x5ab5d0[_0x01df('0x1d')](_0x5744ff);return _0x5ab5d0[_0x01df('0x23')](_0x01df('0x24'),_0x16e31f+'-'+_0x4d0fb8+'/'+_0x3c0fd0)[_0x01df('0x1f')](_0x5926e1);}return null;};}function patchUpdates(_0x2704e3){return function(_0x4e9093){try{jsonpatch['apply'](_0x4e9093,_0x2704e3,!![]);}catch(_0x16c430){return BPromise['reject'](_0x16c430);}return _0x4e9093[_0x01df('0x25')]();};}function saveUpdates(_0x236566,_0x3e5178){return function(_0x62be9){if(_0x62be9){return _0x62be9[_0x01df('0x26')](_0x236566)[_0x01df('0x27')](function(_0x183dcc){return _0x183dcc;});}return null;};}function removeEntity(_0x3ea498,_0x1845d9){return function(_0x4f0762){if(_0x4f0762){return _0x4f0762[_0x01df('0x28')]()[_0x01df('0x27')](function(){_0x3ea498[_0x01df('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27e7b5,_0x30b9b6){return function(_0x5324bb){if(!_0x5324bb){_0x27e7b5[_0x01df('0x1c')](0x194);}return _0x5324bb;};}function handleError(_0x581381,_0x1d2cfb){_0x1d2cfb=_0x1d2cfb||0x1f4;return function(_0x12775a){logger[_0x01df('0x29')](_0x12775a[_0x01df('0x2a')]);if(_0x12775a[_0x01df('0x2b')]){delete _0x12775a[_0x01df('0x2b')];}_0x581381[_0x01df('0x1d')](_0x1d2cfb)['send'](_0x12775a);};}exports[_0x01df('0x2c')]=function(_0x265492,_0x41caac){var _0x5a24ea={},_0x447f85={},_0x152b43={'count':0x0,'rows':[]};var _0x183a08=_[_0x01df('0x2d')](db[_0x01df('0x2e')][_0x01df('0x2f')],function(_0x1c344d){return{'name':_0x1c344d[_0x01df('0x30')],'type':_0x1c344d[_0x01df('0x31')]['key']};});_0x447f85['model']=_[_0x01df('0x2d')](_0x183a08,'name');_0x447f85[_0x01df('0x32')]=_[_0x01df('0x33')](_0x265492[_0x01df('0x32')]);_0x447f85[_0x01df('0x34')]=_[_0x01df('0x35')](_0x447f85[_0x01df('0x36')],_0x447f85[_0x01df('0x32')]);_0x5a24ea[_0x01df('0x37')]=_[_0x01df('0x35')](_0x447f85[_0x01df('0x36')],qs[_0x01df('0x38')](_0x265492[_0x01df('0x32')][_0x01df('0x38')]));_0x5a24ea[_0x01df('0x37')]=_0x5a24ea[_0x01df('0x37')][_0x01df('0x39')]?_0x5a24ea[_0x01df('0x37')]:_0x447f85[_0x01df('0x36')];if(!_0x265492[_0x01df('0x32')][_0x01df('0x3a')](_0x01df('0x3b'))){_0x5a24ea[_0x01df('0x22')]=qs[_0x01df('0x22')](_0x265492[_0x01df('0x32')][_0x01df('0x22')]);_0x5a24ea[_0x01df('0x20')]=qs[_0x01df('0x20')](_0x265492['query'][_0x01df('0x20')]);}_0x5a24ea[_0x01df('0x3c')]=qs[_0x01df('0x3d')](_0x265492[_0x01df('0x32')]['sort']);_0x5a24ea[_0x01df('0x3e')]=qs[_0x01df('0x34')](_['pick'](_0x265492[_0x01df('0x32')],_0x447f85[_0x01df('0x34')]),_0x183a08);if(_0x265492[_0x01df('0x32')][_0x01df('0x3f')]){_0x5a24ea['where']=_[_0x01df('0x40')](_0x5a24ea[_0x01df('0x3e')],{'$or':_[_0x01df('0x2d')](_0x183a08,function(_0x4ff769){if(_0x4ff769[_0x01df('0x31')]!=='VIRTUAL'){var _0x3ab1b3={};_0x3ab1b3[_0x4ff769[_0x01df('0x2b')]]={'$like':'%'+_0x265492[_0x01df('0x32')][_0x01df('0x3f')]+'%'};return _0x3ab1b3;}})});}_0x5a24ea=_[_0x01df('0x40')]({},_0x5a24ea,_0x265492[_0x01df('0x41')]);var _0x231670={'where':_0x5a24ea['where']};return db[_0x01df('0x2e')][_0x01df('0x42')](_0x231670)['then'](function(_0x4f24c6){_0x152b43[_0x01df('0x42')]=_0x4f24c6;if(_0x265492[_0x01df('0x32')]['includeAll']){_0x5a24ea[_0x01df('0x43')]=[{'all':!![]}];}return db[_0x01df('0x2e')][_0x01df('0x44')](_0x5a24ea);})['then'](function(_0x40660a){_0x152b43[_0x01df('0x45')]=_0x40660a;return _0x152b43;})['then'](respondWithFilteredResult(_0x41caac,_0x5a24ea))[_0x01df('0x46')](handleError(_0x41caac,null));};exports['show']=function(_0x160a0f,_0x17f2e3){var _0x54796b={'raw':![],'where':{'id':_0x160a0f['params']['id']}},_0x6518a6={};_0x6518a6[_0x01df('0x36')]=_[_0x01df('0x33')](db['FreshdeskConfiguration'][_0x01df('0x2f')]);_0x6518a6[_0x01df('0x32')]=_[_0x01df('0x33')](_0x160a0f[_0x01df('0x32')]);_0x6518a6['filters']=_[_0x01df('0x35')](_0x6518a6[_0x01df('0x36')],_0x6518a6[_0x01df('0x32')]);_0x54796b['attributes']=_[_0x01df('0x35')](_0x6518a6[_0x01df('0x36')],qs['fields'](_0x160a0f['query'][_0x01df('0x38')]));_0x54796b['attributes']=_0x54796b[_0x01df('0x37')][_0x01df('0x39')]?_0x54796b['attributes']:_0x6518a6['model'];if(_0x160a0f[_0x01df('0x32')][_0x01df('0x47')]){_0x54796b[_0x01df('0x43')]=[{'all':!![]}];}_0x54796b=_[_0x01df('0x40')]({},_0x54796b,_0x160a0f[_0x01df('0x41')]);return db[_0x01df('0x2e')]['find'](_0x54796b)[_0x01df('0x27')](handleEntityNotFound(_0x17f2e3,null))[_0x01df('0x27')](respondWithResult(_0x17f2e3,null))[_0x01df('0x46')](handleError(_0x17f2e3,null));};exports[_0x01df('0x48')]=function(_0xfe0fb0,_0x19d996){return db[_0x01df('0x2e')][_0x01df('0x48')](_0xfe0fb0['body'],{})[_0x01df('0x27')](respondWithResult(_0x19d996,0xc9))[_0x01df('0x46')](handleError(_0x19d996,null));};exports[_0x01df('0x26')]=function(_0x480d8d,_0x32ed3b){if(_0x480d8d[_0x01df('0x49')]['id']){delete _0x480d8d['body']['id'];}return db[_0x01df('0x2e')][_0x01df('0x4a')]({'where':{'id':_0x480d8d['params']['id']}})[_0x01df('0x27')](handleEntityNotFound(_0x32ed3b,null))[_0x01df('0x27')](saveUpdates(_0x480d8d[_0x01df('0x49')],null))[_0x01df('0x27')](respondWithResult(_0x32ed3b,null))[_0x01df('0x46')](handleError(_0x32ed3b,null));};exports[_0x01df('0x28')]=function(_0x2d8d3c,_0x4386f0){return db[_0x01df('0x2e')][_0x01df('0x4a')]({'where':{'id':_0x2d8d3c[_0x01df('0x4b')]['id']}})[_0x01df('0x27')](handleEntityNotFound(_0x4386f0,null))[_0x01df('0x27')](removeEntity(_0x4386f0,null))[_0x01df('0x46')](handleError(_0x4386f0,null));};exports[_0x01df('0x4c')]=function(_0x3574b7,_0x3a56ad,_0x16111c){var _0x2f1259={};var _0x1d760a={};var _0x17ef63;var _0x3266a8;return db['FreshdeskConfiguration'][_0x01df('0x4d')]({'where':{'id':_0x3574b7[_0x01df('0x4b')]['id']}})[_0x01df('0x27')](handleEntityNotFound(_0x3a56ad,null))[_0x01df('0x27')](function(_0x97b4f1){if(_0x97b4f1){_0x17ef63=_0x97b4f1;_0x1d760a[_0x01df('0x36')]=_[_0x01df('0x33')](db[_0x01df('0x4e')]['rawAttributes']);_0x1d760a['query']=_[_0x01df('0x33')](_0x3574b7[_0x01df('0x32')]);_0x1d760a[_0x01df('0x34')]=_['intersection'](_0x1d760a[_0x01df('0x36')],_0x1d760a['query']);_0x2f1259['attributes']=_[_0x01df('0x35')](_0x1d760a[_0x01df('0x36')],qs['fields'](_0x3574b7[_0x01df('0x32')][_0x01df('0x38')]));_0x2f1259[_0x01df('0x37')]=_0x2f1259['attributes'][_0x01df('0x39')]?_0x2f1259[_0x01df('0x37')]:_0x1d760a[_0x01df('0x36')];_0x2f1259['order']=qs['sort'](_0x3574b7[_0x01df('0x32')][_0x01df('0x3d')]);_0x2f1259[_0x01df('0x3e')]=qs[_0x01df('0x34')](_['pick'](_0x3574b7[_0x01df('0x32')],_0x1d760a['filters']));if(_0x3574b7[_0x01df('0x32')][_0x01df('0x3f')]){_0x2f1259[_0x01df('0x3e')]=_[_0x01df('0x40')](_0x2f1259[_0x01df('0x3e')],{'$or':_[_0x01df('0x2d')](_0x2f1259[_0x01df('0x37')],function(_0x139621){var _0x7fa0cd={};_0x7fa0cd[_0x139621]={'$like':'%'+_0x3574b7[_0x01df('0x32')][_0x01df('0x3f')]+'%'};return _0x7fa0cd;})});}_0x2f1259=_['merge']({},_0x2f1259,_0x3574b7[_0x01df('0x41')]);return _0x17ef63[_0x01df('0x4c')](_0x2f1259);}})[_0x01df('0x27')](function(_0x48cae5){if(_0x48cae5){_0x3266a8=_0x48cae5[_0x01df('0x39')];if(!_0x3574b7[_0x01df('0x32')]['hasOwnProperty'](_0x01df('0x3b'))){_0x2f1259[_0x01df('0x22')]=qs[_0x01df('0x22')](_0x3574b7[_0x01df('0x32')]['limit']);_0x2f1259[_0x01df('0x20')]=qs[_0x01df('0x20')](_0x3574b7[_0x01df('0x32')][_0x01df('0x20')]);}return _0x17ef63['getFields'](_0x2f1259);}})[_0x01df('0x27')](function(_0x4384b1){if(_0x4384b1){return _0x4384b1?{'count':_0x3266a8,'rows':_0x4384b1}:null;}})[_0x01df('0x27')](respondWithResult(_0x3a56ad,null))[_0x01df('0x46')](handleError(_0x3a56ad,null));};exports[_0x01df('0x4f')]=function(_0xb37ea6,_0xc95574,_0x2fab38){var _0x177c60={};var _0x58413e={};var _0x80838;var _0x389aa6;return db['FreshdeskConfiguration'][_0x01df('0x4d')]({'where':{'id':_0xb37ea6[_0x01df('0x4b')]['id']}})[_0x01df('0x27')](handleEntityNotFound(_0xc95574,null))[_0x01df('0x27')](function(_0x958d2d){if(_0x958d2d){_0x80838=_0x958d2d;_0x58413e[_0x01df('0x36')]=_[_0x01df('0x33')](db[_0x01df('0x4e')][_0x01df('0x2f')]);_0x58413e[_0x01df('0x32')]=_[_0x01df('0x33')](_0xb37ea6[_0x01df('0x32')]);_0x58413e[_0x01df('0x34')]=_[_0x01df('0x35')](_0x58413e[_0x01df('0x36')],_0x58413e['query']);_0x177c60[_0x01df('0x37')]=_[_0x01df('0x35')](_0x58413e['model'],qs['fields'](_0xb37ea6[_0x01df('0x32')][_0x01df('0x38')]));_0x177c60[_0x01df('0x37')]=_0x177c60[_0x01df('0x37')][_0x01df('0x39')]?_0x177c60[_0x01df('0x37')]:_0x58413e[_0x01df('0x36')];_0x177c60[_0x01df('0x3c')]=qs['sort'](_0xb37ea6['query'][_0x01df('0x3d')]);_0x177c60[_0x01df('0x3e')]=qs[_0x01df('0x34')](_['pick'](_0xb37ea6[_0x01df('0x32')],_0x58413e[_0x01df('0x34')]));if(_0xb37ea6['query'][_0x01df('0x3f')]){_0x177c60[_0x01df('0x3e')]=_[_0x01df('0x40')](_0x177c60[_0x01df('0x3e')],{'$or':_[_0x01df('0x2d')](_0x177c60[_0x01df('0x37')],function(_0x16995f){var _0x42486c={};_0x42486c[_0x16995f]={'$like':'%'+_0xb37ea6['query'][_0x01df('0x3f')]+'%'};return _0x42486c;})});}_0x177c60=_['merge']({},_0x177c60,_0xb37ea6[_0x01df('0x41')]);return _0x80838[_0x01df('0x4f')](_0x177c60);}})[_0x01df('0x27')](function(_0x1bbf69){if(_0x1bbf69){_0x389aa6=_0x1bbf69[_0x01df('0x39')];if(!_0xb37ea6[_0x01df('0x32')]['hasOwnProperty'](_0x01df('0x3b'))){_0x177c60[_0x01df('0x22')]=qs[_0x01df('0x22')](_0xb37ea6['query'][_0x01df('0x22')]);_0x177c60[_0x01df('0x20')]=qs[_0x01df('0x20')](_0xb37ea6[_0x01df('0x32')][_0x01df('0x20')]);}return _0x80838[_0x01df('0x4f')](_0x177c60);}})['then'](function(_0x3a84fc){if(_0x3a84fc){return _0x3a84fc?{'count':_0x389aa6,'rows':_0x3a84fc}:null;}})[_0x01df('0x27')](respondWithResult(_0xc95574,null))[_0x01df('0x46')](handleError(_0xc95574,null));};exports[_0x01df('0x50')]=function(_0x138808,_0x5189f2,_0x376d3d){var _0x1193be={};var _0x50719b={};var _0x4a9988;var _0x28d70f;return db[_0x01df('0x2e')][_0x01df('0x4d')]({'where':{'id':_0x138808['params']['id']}})[_0x01df('0x27')](handleEntityNotFound(_0x5189f2,null))[_0x01df('0x27')](function(_0x4126e5){if(_0x4126e5){_0x4a9988=_0x4126e5;_0x50719b[_0x01df('0x36')]=_[_0x01df('0x33')](db['FreshdeskField'][_0x01df('0x2f')]);_0x50719b['query']=_[_0x01df('0x33')](_0x138808[_0x01df('0x32')]);_0x50719b['filters']=_['intersection'](_0x50719b[_0x01df('0x36')],_0x50719b[_0x01df('0x32')]);_0x1193be['attributes']=_[_0x01df('0x35')](_0x50719b['model'],qs[_0x01df('0x38')](_0x138808[_0x01df('0x32')][_0x01df('0x38')]));_0x1193be[_0x01df('0x37')]=_0x1193be[_0x01df('0x37')][_0x01df('0x39')]?_0x1193be['attributes']:_0x50719b[_0x01df('0x36')];_0x1193be[_0x01df('0x3c')]=qs[_0x01df('0x3d')](_0x138808['query'][_0x01df('0x3d')]);_0x1193be['where']=qs[_0x01df('0x34')](_[_0x01df('0x51')](_0x138808[_0x01df('0x32')],_0x50719b['filters']));if(_0x138808[_0x01df('0x32')][_0x01df('0x3f')]){_0x1193be[_0x01df('0x3e')]=_[_0x01df('0x40')](_0x1193be[_0x01df('0x3e')],{'$or':_[_0x01df('0x2d')](_0x1193be[_0x01df('0x37')],function(_0x386a74){var _0x2c1e5e={};_0x2c1e5e[_0x386a74]={'$like':'%'+_0x138808[_0x01df('0x32')][_0x01df('0x3f')]+'%'};return _0x2c1e5e;})});}_0x1193be=_['merge']({},_0x1193be,_0x138808[_0x01df('0x41')]);return _0x4a9988[_0x01df('0x50')](_0x1193be);}})[_0x01df('0x27')](function(_0x132900){if(_0x132900){_0x28d70f=_0x132900[_0x01df('0x39')];if(!_0x138808[_0x01df('0x32')][_0x01df('0x3a')]('nolimit')){_0x1193be[_0x01df('0x22')]=qs[_0x01df('0x22')](_0x138808['query'][_0x01df('0x22')]);_0x1193be[_0x01df('0x20')]=qs[_0x01df('0x20')](_0x138808[_0x01df('0x32')]['offset']);}return _0x4a9988['getDescriptions'](_0x1193be);}})[_0x01df('0x27')](function(_0x26b870){if(_0x26b870){return _0x26b870?{'count':_0x28d70f,'rows':_0x26b870}:null;}})[_0x01df('0x27')](respondWithResult(_0x5189f2,null))[_0x01df('0x46')](handleError(_0x5189f2,null));};exports[_0x01df('0x52')]=function(_0x5cb7d3,_0x57622f,_0x279482){var _0x2c24b3={};var _0x557bed={};var _0x441dc4;var _0x67d082;return db[_0x01df('0x2e')][_0x01df('0x4d')]({'where':{'id':_0x5cb7d3[_0x01df('0x4b')]['id']}})[_0x01df('0x27')](handleEntityNotFound(_0x57622f,null))[_0x01df('0x27')](function(_0x2f13e5){if(_0x2f13e5){_0x441dc4=_0x2f13e5;_0x557bed[_0x01df('0x36')]=_[_0x01df('0x33')](db[_0x01df('0x53')][_0x01df('0x2f')]);_0x557bed[_0x01df('0x32')]=_[_0x01df('0x33')](_0x5cb7d3[_0x01df('0x32')]);_0x557bed[_0x01df('0x34')]=_[_0x01df('0x35')](_0x557bed['model'],_0x557bed['query']);_0x2c24b3[_0x01df('0x37')]=_[_0x01df('0x35')](_0x557bed[_0x01df('0x36')],qs[_0x01df('0x38')](_0x5cb7d3[_0x01df('0x32')]['fields']));_0x2c24b3['attributes']=_0x2c24b3[_0x01df('0x37')][_0x01df('0x39')]?_0x2c24b3[_0x01df('0x37')]:_0x557bed['model'];_0x2c24b3[_0x01df('0x3c')]=qs[_0x01df('0x3d')](_0x5cb7d3[_0x01df('0x32')]['sort']);_0x2c24b3[_0x01df('0x3e')]=qs['filters'](_[_0x01df('0x51')](_0x5cb7d3[_0x01df('0x32')],_0x557bed[_0x01df('0x34')]));if(_0x5cb7d3['query'][_0x01df('0x3f')]){_0x2c24b3[_0x01df('0x3e')]=_['merge'](_0x2c24b3[_0x01df('0x3e')],{'$or':_[_0x01df('0x2d')](_0x2c24b3[_0x01df('0x37')],function(_0x565d3c){var _0x3f0544={};_0x3f0544[_0x565d3c]={'$like':'%'+_0x5cb7d3[_0x01df('0x32')][_0x01df('0x3f')]+'%'};return _0x3f0544;})});}_0x2c24b3=_['merge']({},_0x2c24b3,_0x5cb7d3[_0x01df('0x41')]);return _0x441dc4[_0x01df('0x52')](_0x2c24b3);}})[_0x01df('0x27')](function(_0x369f35){if(_0x369f35){_0x67d082=_0x369f35[_0x01df('0x39')];if(!_0x5cb7d3[_0x01df('0x32')][_0x01df('0x3a')](_0x01df('0x3b'))){_0x2c24b3[_0x01df('0x22')]=qs['limit'](_0x5cb7d3[_0x01df('0x32')][_0x01df('0x22')]);_0x2c24b3[_0x01df('0x20')]=qs[_0x01df('0x20')](_0x5cb7d3[_0x01df('0x32')]['offset']);}return _0x441dc4[_0x01df('0x52')](_0x2c24b3);}})[_0x01df('0x27')](function(_0x136c7f){if(_0x136c7f){return _0x136c7f?{'count':_0x67d082,'rows':_0x136c7f}:null;}})[_0x01df('0x27')](respondWithResult(_0x57622f,null))[_0x01df('0x46')](handleError(_0x57622f,null));};exports[_0x01df('0x54')]=function(_0x5c7344,_0x5391ec,_0x5c6a49){if(_0x5c7344[_0x01df('0x49')]['id']){delete _0x5c7344['body']['id'];}return db[_0x01df('0x2e')][_0x01df('0x4d')]({'where':{'id':_0x5c7344['params']['id']}})['then'](handleEntityNotFound(_0x5391ec,null))['then'](function(_0x114940){if(_0x114940){return _0x114940['setTags'](_0x5c7344[_0x01df('0x49')][_0x01df('0x55')]||[]);}return null;})[_0x01df('0x27')](respondWithResult(_0x5391ec,null))[_0x01df('0x46')](handleError(_0x5391ec,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index e156241..d2722bb 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 _0xd552=['int_freshdesk_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x1f8536,_0x56bbe6){var _0x5f1873=function(_0x4c7cda){while(--_0x4c7cda){_0x1f8536['push'](_0x1f8536['shift']());}};_0x5f1873(++_0x56bbe6);}(_0xd552,0xb7));var _0x2d55=function(_0x55a4fe,_0x4ccc18){_0x55a4fe=_0x55a4fe-0x0;var _0x1890cf=_0xd552[_0x55a4fe];return _0x1890cf;};'use strict';var _=require('lodash');var util=require(_0x2d55('0x0'));var logger=require(_0x2d55('0x1'))(_0x2d55('0x2'));var moment=require(_0x2d55('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d55('0x4'));var fs=require('fs');var path=require(_0x2d55('0x5'));var rimraf=require(_0x2d55('0x6'));var config=require(_0x2d55('0x7'));var attributes=require(_0x2d55('0x8'));module[_0x2d55('0x9')]=function(_0x569306,_0x33fb1e){return _0x569306[_0x2d55('0xa')](_0x2d55('0xb'),attributes,{'tableName':_0x2d55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8578=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4737aa,_0x266f4b){var _0x275ab2=function(_0x2d4454){while(--_0x2d4454){_0x4737aa['push'](_0x4737aa['shift']());}};_0x275ab2(++_0x266f4b);}(_0x8578,0x1b7));var _0x8857=function(_0x29b3fe,_0x3593e7){_0x29b3fe=_0x29b3fe-0x0;var _0x57d976=_0x8578[_0x29b3fe];return _0x57d976;};'use strict';var _=require('lodash');var util=require(_0x8857('0x0'));var logger=require(_0x8857('0x1'))(_0x8857('0x2'));var moment=require(_0x8857('0x3'));var BPromise=require(_0x8857('0x4'));var rp=require(_0x8857('0x5'));var fs=require('fs');var path=require(_0x8857('0x6'));var rimraf=require(_0x8857('0x7'));var config=require(_0x8857('0x8'));var attributes=require(_0x8857('0x9'));module[_0x8857('0xa')]=function(_0x1f60d5,_0x18127a){return _0x1f60d5[_0x8857('0xb')](_0x8857('0xc'),attributes,{'tableName':_0x8857('0xd'),'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 66754e8..7486a75 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 _0xd740=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x13f6bb,_0x1d625f){var _0x413673=function(_0x6dacf6){while(--_0x6dacf6){_0x13f6bb['push'](_0x13f6bb['shift']());}};_0x413673(++_0x1d625f);}(_0xd740,0x1f0));var _0x0d74=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xd740[_0x41582d];return _0x59c504;};'use strict';var _=require(_0x0d74('0x0'));var util=require(_0x0d74('0x1'));var moment=require(_0x0d74('0x2'));var BPromise=require(_0x0d74('0x3'));var rs=require(_0x0d74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d74('0x6'))(_0x0d74('0x7'));var config=require(_0x0d74('0x8'));var jayson=require(_0x0d74('0x9'));var client=jayson[_0x0d74('0xa')][_0x0d74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48b377,_0x3df505,_0x22b2eb){return new BPromise(function(_0x4a6597,_0x379564){return client[_0x0d74('0xc')](_0x48b377,_0x22b2eb)['then'](function(_0x56d910){logger[_0x0d74('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3df505,_0x0d74('0xe'));logger[_0x0d74('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3df505,_0x0d74('0xe'),JSON['stringify'](_0x56d910));if(_0x56d910[_0x0d74('0x10')]){if(_0x56d910[_0x0d74('0x10')]['code']===0x1f4){logger[_0x0d74('0x10')](_0x0d74('0x11'),_0x3df505,_0x56d910['error'][_0x0d74('0x12')]);return _0x379564(_0x56d910[_0x0d74('0x10')][_0x0d74('0x12')]);}logger[_0x0d74('0x10')](_0x0d74('0x11'),_0x3df505,_0x56d910[_0x0d74('0x10')]['message']);return _0x4a6597(_0x56d910[_0x0d74('0x10')][_0x0d74('0x12')]);}else{logger[_0x0d74('0xd')](_0x0d74('0x11'),_0x3df505,'request\x20sent');_0x4a6597(_0x56d910['result']['message']);}})[_0x0d74('0x13')](function(_0xf3bc7c){logger[_0x0d74('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3df505,_0xf3bc7c);_0x379564(_0xf3bc7c);});});} \ No newline at end of file +var _0x471a=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x12f587,_0x3d5be8){var _0x13f5e6=function(_0x5ccf6e){while(--_0x5ccf6e){_0x12f587['push'](_0x12f587['shift']());}};_0x13f5e6(++_0x3d5be8);}(_0x471a,0xcc));var _0xa471=function(_0x47185c,_0x2c1d34){_0x47185c=_0x47185c-0x0;var _0x25a495=_0x471a[_0x47185c];return _0x25a495;};'use strict';var _=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var moment=require('moment');var BPromise=require(_0xa471('0x2'));var rs=require(_0xa471('0x3'));var fs=require('fs');var Redis=require(_0xa471('0x4'));var db=require(_0xa471('0x5'))['db'];var utils=require(_0xa471('0x6'));var logger=require(_0xa471('0x7'))(_0xa471('0x8'));var config=require(_0xa471('0x9'));var jayson=require(_0xa471('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48ba4b,_0x46d66b,_0x3f3caf){return new BPromise(function(_0x341a9a,_0x2f111b){return client[_0xa471('0xb')](_0x48ba4b,_0x3f3caf)['then'](function(_0x1c301f){logger[_0xa471('0xc')](_0xa471('0xd'),_0x46d66b,_0xa471('0xe'));logger[_0xa471('0xf')](_0xa471('0x10'),_0x46d66b,_0xa471('0xe'),JSON['stringify'](_0x1c301f));if(_0x1c301f['error']){if(_0x1c301f['error']['code']===0x1f4){logger[_0xa471('0x11')](_0xa471('0xd'),_0x46d66b,_0x1c301f[_0xa471('0x11')]['message']);return _0x2f111b(_0x1c301f[_0xa471('0x11')]['message']);}logger[_0xa471('0x11')](_0xa471('0xd'),_0x46d66b,_0x1c301f[_0xa471('0x11')][_0xa471('0x12')]);return _0x341a9a(_0x1c301f['error']['message']);}else{logger[_0xa471('0xc')](_0xa471('0xd'),_0x46d66b,'request\x20sent');_0x341a9a(_0x1c301f[_0xa471('0x13')]['message']);}})['catch'](function(_0x306248){logger['error'](_0xa471('0xd'),_0x46d66b,_0x306248);_0x2f111b(_0x306248);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index b124f8b..a5c851e 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 _0x8569=['get','/:id','post','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index'];(function(_0x321a51,_0x5305cb){var _0x5365d9=function(_0x21c4c2){while(--_0x21c4c2){_0x321a51['push'](_0x321a51['shift']());}};_0x5365d9(++_0x5305cb);}(_0x8569,0x15b));var _0x9856=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x8569[_0x4d40dd];return _0x1c51f2;};'use strict';var multer=require(_0x9856('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9856('0x1'));var express=require(_0x9856('0x2'));var router=express[_0x9856('0x3')]();var fs_extra=require(_0x9856('0x4'));var auth=require(_0x9856('0x5'));var interaction=require(_0x9856('0x6'));var config=require('../../config/environment');var controller=require(_0x9856('0x7'));router['get']('/',auth[_0x9856('0x8')](),controller[_0x9856('0x9')]);router[_0x9856('0xa')](_0x9856('0xb'),auth[_0x9856('0x8')](),controller['show']);router[_0x9856('0xc')]('/',auth[_0x9856('0x8')](),controller[_0x9856('0xd')]);router['put'](_0x9856('0xb'),auth['isAuthenticated'](),controller[_0x9856('0xe')]);router[_0x9856('0xf')](_0x9856('0xb'),auth[_0x9856('0x8')](),controller[_0x9856('0x10')]);module['exports']=router; \ No newline at end of file +var _0x033d=['../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3b1de2,_0x34b544){var _0x197732=function(_0x354061){while(--_0x354061){_0x3b1de2['push'](_0x3b1de2['shift']());}};_0x197732(++_0x34b544);}(_0x033d,0x171));var _0xd033=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x033d[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xd033('0x0'));var util=require(_0xd033('0x1'));var path=require(_0xd033('0x2'));var timeout=require(_0xd033('0x3'));var express=require(_0xd033('0x4'));var router=express[_0xd033('0x5')]();var fs_extra=require(_0xd033('0x6'));var auth=require(_0xd033('0x7'));var interaction=require(_0xd033('0x8'));var config=require(_0xd033('0x9'));var controller=require(_0xd033('0xa'));router[_0xd033('0xb')]('/',auth[_0xd033('0xc')](),controller[_0xd033('0xd')]);router[_0xd033('0xb')](_0xd033('0xe'),auth['isAuthenticated'](),controller[_0xd033('0xf')]);router[_0xd033('0x10')]('/',auth[_0xd033('0xc')](),controller[_0xd033('0x11')]);router[_0xd033('0x12')](_0xd033('0xe'),auth[_0xd033('0xc')](),controller['update']);router[_0xd033('0x13')](_0xd033('0xe'),auth[_0xd033('0xc')](),controller[_0xd033('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index b6d9efa..3ce736e 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 _0x80ad=['ENUM','variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports'];(function(_0x1ea02b,_0x1de0e3){var _0x1df7a1=function(_0x1bf718){while(--_0x1bf718){_0x1ea02b['push'](_0x1ea02b['shift']());}};_0x1df7a1(++_0x1de0e3);}(_0x80ad,0x120));var _0xd80a=function(_0x374ff6,_0x30546f){_0x374ff6=_0x374ff6-0x0;var _0x58203b=_0x80ad[_0x374ff6];return _0x58203b;};'use strict';var Sequelize=require(_0xd80a('0x0'));module[_0xd80a('0x1')]={'type':{'type':Sequelize[_0xd80a('0x2')]('string',_0xd80a('0x3'),_0xd80a('0x4'),_0xd80a('0x5'),_0xd80a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd80a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd80a('0x2')](_0xd80a('0x8'),_0xd80a('0x3'),_0xd80a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd80a('0x7')]},'customField':{'type':Sequelize[_0xd80a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd80a('0x7')]}}; \ No newline at end of file +var _0xac61=['exports','variable','keyValue','string','STRING','ENUM','customVariable','BOOLEAN','sequelize'];(function(_0xade3f1,_0x1fc65e){var _0x53afef=function(_0x54bd94){while(--_0x54bd94){_0xade3f1['push'](_0xade3f1['shift']());}};_0x53afef(++_0x1fc65e);}(_0xac61,0x1ee));var _0x1ac6=function(_0x176ab9,_0x477eae){_0x176ab9=_0x176ab9-0x0;var _0x1854db=_0xac61[_0x176ab9];return _0x1854db;};'use strict';var Sequelize=require(_0x1ac6('0x0'));module[_0x1ac6('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x1ac6('0x2'),'customVariable',_0x1ac6('0x3'),'picklist'),'defaultValue':_0x1ac6('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1ac6('0x5')]},'keyType':{'type':Sequelize[_0x1ac6('0x6')](_0x1ac6('0x4'),'variable',_0x1ac6('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1ac6('0x5')]},'nameField':{'type':Sequelize[_0x1ac6('0x5')]},'customField':{'type':Sequelize[_0x1ac6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 47df9b4..c59a1fc 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 _0xad95=['offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','FreshdeskField','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0xad95,0x70));var _0x5ad9=function(_0x59309b,_0x29e43a){_0x59309b=_0x59309b-0x0;var _0x5c1f6d=_0xad95[_0x59309b];return _0x5c1f6d;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){_0x5b816d[_0x5ad9('0x14')](0xcc)[_0x5ad9('0x20')]();});}};}function handleEntityNotFound(_0x1252e6,_0x36da5f){return function(_0x11d919){if(!_0x11d919){_0x1252e6['sendStatus'](0x194);}return _0x11d919;};}function handleError(_0x54e9dd,_0xe6540f){_0xe6540f=_0xe6540f||0x1f4;return function(_0x4f3889){logger[_0x5ad9('0x21')](_0x4f3889['stack']);if(_0x4f3889[_0x5ad9('0x22')]){delete _0x4f3889['name'];}_0x54e9dd['status'](_0xe6540f)[_0x5ad9('0x23')](_0x4f3889);};}exports[_0x5ad9('0x24')]=function(_0x49b3df,_0x509d41){var _0x3942fa={},_0x129804={},_0x1b6faf={'count':0x0,'rows':[]};var _0x2ad078=_[_0x5ad9('0x25')](db[_0x5ad9('0x26')]['rawAttributes'],function(_0x132ec6){return{'name':_0x132ec6[_0x5ad9('0x27')],'type':_0x132ec6[_0x5ad9('0x28')][_0x5ad9('0x29')]};});_0x129804['model']=_['map'](_0x2ad078,_0x5ad9('0x22'));_0x129804[_0x5ad9('0x2a')]=_['keys'](_0x49b3df['query']);_0x129804['filters']=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],_0x129804['query']);_0x3942fa[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],qs[_0x5ad9('0x2e')](_0x49b3df['query']['fields']));_0x3942fa[_0x5ad9('0x2d')]=_0x3942fa[_0x5ad9('0x2d')][_0x5ad9('0x2f')]?_0x3942fa[_0x5ad9('0x2d')]:_0x129804[_0x5ad9('0x2c')];if(!_0x49b3df['query'][_0x5ad9('0x30')](_0x5ad9('0x31'))){_0x3942fa[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x18')]);_0x3942fa['offset']=qs[_0x5ad9('0x16')](_0x49b3df[_0x5ad9('0x2a')]['offset']);}_0x3942fa[_0x5ad9('0x32')]=qs[_0x5ad9('0x33')](_0x49b3df['query'][_0x5ad9('0x33')]);_0x3942fa[_0x5ad9('0x34')]=qs[_0x5ad9('0x35')](_['pick'](_0x49b3df[_0x5ad9('0x2a')],_0x129804[_0x5ad9('0x35')]),_0x2ad078);if(_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x36')]){_0x3942fa['where']=_[_0x5ad9('0x37')](_0x3942fa[_0x5ad9('0x34')],{'$or':_[_0x5ad9('0x25')](_0x2ad078,function(_0x143700){if(_0x143700[_0x5ad9('0x28')]!==_0x5ad9('0x38')){var _0x1f0c06={};_0x1f0c06[_0x143700[_0x5ad9('0x22')]]={'$like':'%'+_0x49b3df[_0x5ad9('0x2a')]['filter']+'%'};return _0x1f0c06;}})});}_0x3942fa=_[_0x5ad9('0x37')]({},_0x3942fa,_0x49b3df[_0x5ad9('0x39')]);var _0x41d733={'where':_0x3942fa[_0x5ad9('0x34')]};return db[_0x5ad9('0x26')]['count'](_0x41d733)[_0x5ad9('0x1f')](function(_0xbbfaa0){_0x1b6faf[_0x5ad9('0x19')]=_0xbbfaa0;if(_0x49b3df['query'][_0x5ad9('0x3a')]){_0x3942fa[_0x5ad9('0x3b')]=[{'all':!![]}];}return db[_0x5ad9('0x26')]['findAll'](_0x3942fa);})[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x1b6faf['rows']=_0x5cfe5b;return _0x1b6faf;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x509d41,_0x3942fa))[_0x5ad9('0x3c')](handleError(_0x509d41,null));};exports[_0x5ad9('0x3d')]=function(_0x24f377,_0x5b8608){var _0x526fda={'raw':!![],'where':{'id':_0x24f377['params']['id']}},_0x552c39={};_0x552c39[_0x5ad9('0x2c')]=_['keys'](db[_0x5ad9('0x26')]['rawAttributes']);_0x552c39[_0x5ad9('0x2a')]=_[_0x5ad9('0x3e')](_0x24f377[_0x5ad9('0x2a')]);_0x552c39[_0x5ad9('0x35')]=_[_0x5ad9('0x2b')](_0x552c39[_0x5ad9('0x2c')],_0x552c39[_0x5ad9('0x2a')]);_0x526fda[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x552c39['model'],qs[_0x5ad9('0x2e')](_0x24f377[_0x5ad9('0x2a')][_0x5ad9('0x2e')]));_0x526fda[_0x5ad9('0x2d')]=_0x526fda[_0x5ad9('0x2d')]['length']?_0x526fda[_0x5ad9('0x2d')]:_0x552c39['model'];if(_0x24f377['query']['includeAll']){_0x526fda[_0x5ad9('0x3b')]=[{'all':!![]}];}_0x526fda=_[_0x5ad9('0x37')]({},_0x526fda,_0x24f377[_0x5ad9('0x39')]);return db['FreshdeskField'][_0x5ad9('0x3f')](_0x526fda)[_0x5ad9('0x1f')](handleEntityNotFound(_0x5b8608,null))[_0x5ad9('0x1f')](respondWithResult(_0x5b8608,null))[_0x5ad9('0x3c')](handleError(_0x5b8608,null));};exports['create']=function(_0x126086,_0x420677){return db[_0x5ad9('0x26')][_0x5ad9('0x40')](_0x126086['body'],{})[_0x5ad9('0x1f')](respondWithResult(_0x420677,0xc9))[_0x5ad9('0x3c')](handleError(_0x420677,null));};exports[_0x5ad9('0x1d')]=function(_0x1e03f,_0x479bbc){if(_0x1e03f[_0x5ad9('0x41')]['id']){delete _0x1e03f[_0x5ad9('0x41')]['id'];}return db['FreshdeskField'][_0x5ad9('0x3f')]({'where':{'id':_0x1e03f['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x479bbc,null))[_0x5ad9('0x1f')](saveUpdates(_0x1e03f[_0x5ad9('0x41')],null))[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,null))[_0x5ad9('0x3c')](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1e')]=function(_0xa0f426,_0x2c3945){return db[_0x5ad9('0x26')][_0x5ad9('0x3f')]({'where':{'id':_0xa0f426[_0x5ad9('0x42')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x2c3945,null))[_0x5ad9('0x1f')](removeEntity(_0x2c3945,null))[_0x5ad9('0x3c')](handleError(_0x2c3945,null));}; \ No newline at end of file +var _0xec56=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','query','filters','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','intersection','include','find','catch','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x300876,_0x12540c){var _0x4685fe=function(_0x850dc){while(--_0x850dc){_0x300876['push'](_0x300876['shift']());}};_0x4685fe(++_0x12540c);}(_0xec56,0x1bd));var _0x6ec5=function(_0x5f48f9,_0x190911){_0x5f48f9=_0x5f48f9-0x0;var _0x4fb087=_0xec56[_0x5f48f9];return _0x4fb087;};'use strict';var emlformat=require(_0x6ec5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ec5('0x1'));var rp=require(_0x6ec5('0x2'));var moment=require(_0x6ec5('0x3'));var BPromise=require(_0x6ec5('0x4'));var Mustache=require(_0x6ec5('0x5'));var util=require(_0x6ec5('0x6'));var path=require(_0x6ec5('0x7'));var sox=require(_0x6ec5('0x8'));var csv=require(_0x6ec5('0x9'));var ejs=require(_0x6ec5('0xa'));var fs=require('fs');var fs_extra=require(_0x6ec5('0xb'));var _=require(_0x6ec5('0xc'));var squel=require(_0x6ec5('0xd'));var crypto=require(_0x6ec5('0xe'));var jsforce=require(_0x6ec5('0xf'));var deskjs=require(_0x6ec5('0x10'));var toCsv=require(_0x6ec5('0x9'));var querystring=require(_0x6ec5('0x11'));var Papa=require(_0x6ec5('0x12'));var Redis=require('ioredis');var authService=require(_0x6ec5('0x13'));var qs=require(_0x6ec5('0x14'));var as=require(_0x6ec5('0x15'));var hardwareService=require(_0x6ec5('0x16'));var logger=require(_0x6ec5('0x17'))(_0x6ec5('0x18'));var utils=require(_0x6ec5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6ec5('0x1a'));var db=require(_0x6ec5('0x1b'))['db'];function respondWithStatusCode(_0x2b1f61,_0xb04ab6){_0xb04ab6=_0xb04ab6||0xcc;return function(_0x135aaf){if(_0x135aaf){return _0x2b1f61[_0x6ec5('0x1c')](_0xb04ab6);}return _0x2b1f61[_0x6ec5('0x1d')](_0xb04ab6)[_0x6ec5('0x1e')]();};}function respondWithResult(_0x5166ad,_0x3ed07a){_0x3ed07a=_0x3ed07a||0xc8;return function(_0x4d1510){if(_0x4d1510){return _0x5166ad[_0x6ec5('0x1d')](_0x3ed07a)[_0x6ec5('0x1f')](_0x4d1510);}};}function respondWithFilteredResult(_0x4a4e3c,_0x9fc0e7){return function(_0xdc0b10){if(_0xdc0b10){var _0x4d09fe=typeof _0x9fc0e7[_0x6ec5('0x20')]===_0x6ec5('0x21')&&typeof _0x9fc0e7[_0x6ec5('0x22')]===_0x6ec5('0x21');var _0x23b3e3=_0xdc0b10[_0x6ec5('0x23')];var _0x1dbee9=_0x4d09fe?0x0:_0x9fc0e7[_0x6ec5('0x20')];var _0x2608c0=_0x4d09fe?_0xdc0b10[_0x6ec5('0x23')]:_0x9fc0e7[_0x6ec5('0x20')]+_0x9fc0e7[_0x6ec5('0x22')];var _0x437f0f;if(_0x2608c0>=_0x23b3e3){_0x2608c0=_0x23b3e3;_0x437f0f=0xc8;}else{_0x437f0f=0xce;}_0x4a4e3c[_0x6ec5('0x1d')](_0x437f0f);return _0x4a4e3c[_0x6ec5('0x24')](_0x6ec5('0x25'),_0x1dbee9+'-'+_0x2608c0+'/'+_0x23b3e3)[_0x6ec5('0x1f')](_0xdc0b10);}return null;};}function patchUpdates(_0x4abd5d){return function(_0x272532){try{jsonpatch[_0x6ec5('0x26')](_0x272532,_0x4abd5d,!![]);}catch(_0xd045b){return BPromise[_0x6ec5('0x27')](_0xd045b);}return _0x272532[_0x6ec5('0x28')]();};}function saveUpdates(_0x38a821,_0x18243f){return function(_0x48733b){if(_0x48733b){return _0x48733b[_0x6ec5('0x29')](_0x38a821)[_0x6ec5('0x2a')](function(_0x358d18){return _0x358d18;});}return null;};}function removeEntity(_0x1560c6,_0x57060c){return function(_0x27f631){if(_0x27f631){return _0x27f631[_0x6ec5('0x2b')]()['then'](function(){_0x1560c6[_0x6ec5('0x1d')](0xcc)[_0x6ec5('0x1e')]();});}};}function handleEntityNotFound(_0xb4d269,_0x5078e8){return function(_0x1b779a){if(!_0x1b779a){_0xb4d269[_0x6ec5('0x1c')](0x194);}return _0x1b779a;};}function handleError(_0x197ea8,_0x462488){_0x462488=_0x462488||0x1f4;return function(_0x425fac){logger['error'](_0x425fac[_0x6ec5('0x2c')]);if(_0x425fac[_0x6ec5('0x2d')]){delete _0x425fac['name'];}_0x197ea8[_0x6ec5('0x1d')](_0x462488)[_0x6ec5('0x2e')](_0x425fac);};}exports['index']=function(_0x3d36cb,_0x3229db){var _0x3bbf16={},_0xa227ff={},_0x116659={'count':0x0,'rows':[]};var _0x5a30ba=_[_0x6ec5('0x2f')](db[_0x6ec5('0x30')][_0x6ec5('0x31')],function(_0x174164){return{'name':_0x174164[_0x6ec5('0x32')],'type':_0x174164[_0x6ec5('0x33')][_0x6ec5('0x34')]};});_0xa227ff['model']=_[_0x6ec5('0x2f')](_0x5a30ba,'name');_0xa227ff[_0x6ec5('0x35')]=_['keys'](_0x3d36cb[_0x6ec5('0x35')]);_0xa227ff[_0x6ec5('0x36')]=_['intersection'](_0xa227ff['model'],_0xa227ff[_0x6ec5('0x35')]);_0x3bbf16[_0x6ec5('0x37')]=_['intersection'](_0xa227ff[_0x6ec5('0x38')],qs[_0x6ec5('0x39')](_0x3d36cb['query'][_0x6ec5('0x39')]));_0x3bbf16[_0x6ec5('0x37')]=_0x3bbf16[_0x6ec5('0x37')][_0x6ec5('0x3a')]?_0x3bbf16[_0x6ec5('0x37')]:_0xa227ff[_0x6ec5('0x38')];if(!_0x3d36cb[_0x6ec5('0x35')][_0x6ec5('0x3b')]('nolimit')){_0x3bbf16[_0x6ec5('0x22')]=qs['limit'](_0x3d36cb[_0x6ec5('0x35')][_0x6ec5('0x22')]);_0x3bbf16[_0x6ec5('0x20')]=qs[_0x6ec5('0x20')](_0x3d36cb[_0x6ec5('0x35')][_0x6ec5('0x20')]);}_0x3bbf16[_0x6ec5('0x3c')]=qs[_0x6ec5('0x3d')](_0x3d36cb[_0x6ec5('0x35')][_0x6ec5('0x3d')]);_0x3bbf16[_0x6ec5('0x3e')]=qs['filters'](_['pick'](_0x3d36cb[_0x6ec5('0x35')],_0xa227ff['filters']),_0x5a30ba);if(_0x3d36cb[_0x6ec5('0x35')][_0x6ec5('0x3f')]){_0x3bbf16[_0x6ec5('0x3e')]=_[_0x6ec5('0x40')](_0x3bbf16[_0x6ec5('0x3e')],{'$or':_[_0x6ec5('0x2f')](_0x5a30ba,function(_0x2fa588){if(_0x2fa588['type']!==_0x6ec5('0x41')){var _0xc79bb3={};_0xc79bb3[_0x2fa588[_0x6ec5('0x2d')]]={'$like':'%'+_0x3d36cb[_0x6ec5('0x35')][_0x6ec5('0x3f')]+'%'};return _0xc79bb3;}})});}_0x3bbf16=_[_0x6ec5('0x40')]({},_0x3bbf16,_0x3d36cb[_0x6ec5('0x42')]);var _0x4354e4={'where':_0x3bbf16[_0x6ec5('0x3e')]};return db['FreshdeskField'][_0x6ec5('0x23')](_0x4354e4)['then'](function(_0x19ac12){_0x116659['count']=_0x19ac12;if(_0x3d36cb[_0x6ec5('0x35')][_0x6ec5('0x43')]){_0x3bbf16['include']=[{'all':!![]}];}return db[_0x6ec5('0x30')][_0x6ec5('0x44')](_0x3bbf16);})[_0x6ec5('0x2a')](function(_0x48c019){_0x116659[_0x6ec5('0x45')]=_0x48c019;return _0x116659;})[_0x6ec5('0x2a')](respondWithFilteredResult(_0x3229db,_0x3bbf16))['catch'](handleError(_0x3229db,null));};exports[_0x6ec5('0x46')]=function(_0x19055e,_0x22e6a2){var _0xb8324={'raw':!![],'where':{'id':_0x19055e[_0x6ec5('0x47')]['id']}},_0x43d858={};_0x43d858[_0x6ec5('0x38')]=_[_0x6ec5('0x48')](db[_0x6ec5('0x30')][_0x6ec5('0x31')]);_0x43d858[_0x6ec5('0x35')]=_['keys'](_0x19055e[_0x6ec5('0x35')]);_0x43d858[_0x6ec5('0x36')]=_[_0x6ec5('0x49')](_0x43d858[_0x6ec5('0x38')],_0x43d858['query']);_0xb8324[_0x6ec5('0x37')]=_[_0x6ec5('0x49')](_0x43d858['model'],qs[_0x6ec5('0x39')](_0x19055e['query'][_0x6ec5('0x39')]));_0xb8324[_0x6ec5('0x37')]=_0xb8324[_0x6ec5('0x37')][_0x6ec5('0x3a')]?_0xb8324['attributes']:_0x43d858['model'];if(_0x19055e[_0x6ec5('0x35')]['includeAll']){_0xb8324[_0x6ec5('0x4a')]=[{'all':!![]}];}_0xb8324=_[_0x6ec5('0x40')]({},_0xb8324,_0x19055e[_0x6ec5('0x42')]);return db[_0x6ec5('0x30')][_0x6ec5('0x4b')](_0xb8324)['then'](handleEntityNotFound(_0x22e6a2,null))['then'](respondWithResult(_0x22e6a2,null))[_0x6ec5('0x4c')](handleError(_0x22e6a2,null));};exports[_0x6ec5('0x4d')]=function(_0x5c3aa9,_0x45972a){return db[_0x6ec5('0x30')][_0x6ec5('0x4d')](_0x5c3aa9[_0x6ec5('0x4e')],{})[_0x6ec5('0x2a')](respondWithResult(_0x45972a,0xc9))[_0x6ec5('0x4c')](handleError(_0x45972a,null));};exports[_0x6ec5('0x29')]=function(_0xd265c,_0x1c5e2f){if(_0xd265c[_0x6ec5('0x4e')]['id']){delete _0xd265c[_0x6ec5('0x4e')]['id'];}return db['FreshdeskField'][_0x6ec5('0x4b')]({'where':{'id':_0xd265c['params']['id']}})[_0x6ec5('0x2a')](handleEntityNotFound(_0x1c5e2f,null))[_0x6ec5('0x2a')](saveUpdates(_0xd265c['body'],null))[_0x6ec5('0x2a')](respondWithResult(_0x1c5e2f,null))[_0x6ec5('0x4c')](handleError(_0x1c5e2f,null));};exports['destroy']=function(_0x23a64d,_0x21a910){return db['FreshdeskField']['find']({'where':{'id':_0x23a64d[_0x6ec5('0x47')]['id']}})['then'](handleEntityNotFound(_0x21a910,null))['then'](removeEntity(_0x21a910,null))[_0x6ec5('0x4c')](handleError(_0x21a910,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index dc1b6ec..efc0ff3 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 _0xe43d=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','idField','../../config/logger','api','moment'];(function(_0x48bd02,_0x46cfbe){var _0x44f7e0=function(_0x4fb8a3){while(--_0x4fb8a3){_0x48bd02['push'](_0x48bd02['shift']());}};_0x44f7e0(++_0x46cfbe);}(_0xe43d,0x75));var _0xde43=function(_0x1602fd,_0x847115){_0x1602fd=_0x1602fd-0x0;var _0x1eaf42=_0xe43d[_0x1602fd];return _0x1eaf42;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde43('0x0'))(_0xde43('0x1'));var moment=require(_0xde43('0x2'));var BPromise=require(_0xde43('0x3'));var rp=require(_0xde43('0x4'));var fs=require('fs');var path=require(_0xde43('0x5'));var rimraf=require(_0xde43('0x6'));var config=require(_0xde43('0x7'));var attributes=require(_0xde43('0x8'));module['exports']=function(_0x4dce9d,_0x5b21e6){return _0x4dce9d[_0xde43('0x9')](_0xde43('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xde43('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x894c=['request-promise','path','../../config/environment','define','FieldId','util','moment'];(function(_0x398140,_0x55b247){var _0x39f02f=function(_0x51b5c3){while(--_0x51b5c3){_0x398140['push'](_0x398140['shift']());}};_0x39f02f(++_0x55b247);}(_0x894c,0x98));var _0xc894=function(_0x196767,_0x3e887a){_0x196767=_0x196767-0x0;var _0x56ccdf=_0x894c[_0x196767];return _0x56ccdf;};'use strict';var _=require('lodash');var util=require(_0xc894('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc894('0x1'));var BPromise=require('bluebird');var rp=require(_0xc894('0x2'));var fs=require('fs');var path=require(_0xc894('0x3'));var rimraf=require('rimraf');var config=require(_0xc894('0x4'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0xbca199,_0x6f3adc){return _0xbca199[_0xc894('0x5')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xc894('0x6')],'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 0207a0e..3c97264 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 _0xbedd=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xbedd,0x126));var _0xdbed=function(_0x4c4a8b,_0x402020){_0x4c4a8b=_0x4c4a8b-0x0;var _0x20fa14=_0xbedd[_0x4c4a8b];return _0x20fa14;};'use strict';var _=require(_0xdbed('0x0'));var util=require(_0xdbed('0x1'));var moment=require(_0xdbed('0x2'));var BPromise=require(_0xdbed('0x3'));var rs=require(_0xdbed('0x4'));var fs=require('fs');var Redis=require(_0xdbed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbed('0x6'));var logger=require('../../config/logger')(_0xdbed('0x7'));var config=require(_0xdbed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdbed('0x9')][_0xdbed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x579f76,_0x4dd47d,_0x372278){return new BPromise(function(_0x302b8b,_0x47e797){return client[_0xdbed('0xb')](_0x579f76,_0x372278)['then'](function(_0x3df3d7){logger[_0xdbed('0xc')](_0xdbed('0xd'),_0x4dd47d,'request\x20sent');logger[_0xdbed('0xe')](_0xdbed('0xf'),_0x4dd47d,_0xdbed('0x10'),JSON[_0xdbed('0x11')](_0x3df3d7));if(_0x3df3d7['error']){if(_0x3df3d7[_0xdbed('0x12')][_0xdbed('0x13')]===0x1f4){logger[_0xdbed('0x12')](_0xdbed('0xd'),_0x4dd47d,_0x3df3d7['error'][_0xdbed('0x14')]);return _0x47e797(_0x3df3d7[_0xdbed('0x12')]['message']);}logger[_0xdbed('0x12')](_0xdbed('0xd'),_0x4dd47d,_0x3df3d7[_0xdbed('0x12')][_0xdbed('0x14')]);return _0x302b8b(_0x3df3d7[_0xdbed('0x12')]['message']);}else{logger[_0xdbed('0xc')](_0xdbed('0xd'),_0x4dd47d,'request\x20sent');_0x302b8b(_0x3df3d7[_0xdbed('0x15')][_0xdbed('0x14')]);}})['catch'](function(_0x28759b){logger['error'](_0xdbed('0xd'),_0x4dd47d,_0x28759b);_0x47e797(_0x28759b);});});} \ No newline at end of file +var _0xe51a=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5d6f4a,_0x1d7242){var _0x6ee1a=function(_0x22c29c){while(--_0x22c29c){_0x5d6f4a['push'](_0x5d6f4a['shift']());}};_0x6ee1a(++_0x1d7242);}(_0xe51a,0x76));var _0xae51=function(_0x47318d,_0x54dba5){_0x47318d=_0x47318d-0x0;var _0x3eea38=_0xe51a[_0x47318d];return _0x3eea38;};'use strict';var _=require(_0xae51('0x0'));var util=require(_0xae51('0x1'));var moment=require(_0xae51('0x2'));var BPromise=require(_0xae51('0x3'));var rs=require(_0xae51('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae51('0x5'));var config=require(_0xae51('0x6'));var jayson=require(_0xae51('0x7'));var client=jayson[_0xae51('0x8')][_0xae51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42746d,_0x158933,_0x1c4e83){return new BPromise(function(_0x1ea9ca,_0x10b538){return client[_0xae51('0xa')](_0x42746d,_0x1c4e83)['then'](function(_0x230678){logger[_0xae51('0xb')](_0xae51('0xc'),_0x158933,_0xae51('0xd'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x158933,'request\x20sent',JSON[_0xae51('0xe')](_0x230678));if(_0x230678[_0xae51('0xf')]){if(_0x230678['error']['code']===0x1f4){logger['error'](_0xae51('0xc'),_0x158933,_0x230678[_0xae51('0xf')][_0xae51('0x10')]);return _0x10b538(_0x230678[_0xae51('0xf')][_0xae51('0x10')]);}logger[_0xae51('0xf')](_0xae51('0xc'),_0x158933,_0x230678[_0xae51('0xf')][_0xae51('0x10')]);return _0x1ea9ca(_0x230678[_0xae51('0xf')][_0xae51('0x10')]);}else{logger[_0xae51('0xb')](_0xae51('0xc'),_0x158933,_0xae51('0xd'));_0x1ea9ca(_0x230678[_0xae51('0x11')][_0xae51('0x10')]);}})[_0xae51('0x12')](function(_0x227ef2){logger[_0xae51('0xf')](_0xae51('0xc'),_0x158933,_0x227ef2);_0x10b538(_0x227ef2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 53f9916..0faf653 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 _0x1c7c=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x52d4ee,_0x64e207){var _0x51d053=function(_0x32b659){while(--_0x32b659){_0x52d4ee['push'](_0x52d4ee['shift']());}};_0x51d053(++_0x64e207);}(_0x1c7c,0x164));var _0xc1c7=function(_0x59fbd9,_0x1a4e48){_0x59fbd9=_0x59fbd9-0x0;var _0x12f3df=_0x1c7c[_0x59fbd9];return _0x12f3df;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1c7('0x5'));var interaction=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var controller=require(_0xc1c7('0x8'));router[_0xc1c7('0x9')]('/',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xb')]);router[_0xc1c7('0x9')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xd')]);router[_0xc1c7('0x9')](_0xc1c7('0xe'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xf')]);router[_0xc1c7('0x9')](_0xc1c7('0x10'),auth['isAuthenticated'](),controller[_0xc1c7('0x11')]);router[_0xc1c7('0x12')]('/',auth['isAuthenticated'](),controller[_0xc1c7('0x13')]);router[_0xc1c7('0x12')](_0xc1c7('0xe'),auth['isAuthenticated'](),controller[_0xc1c7('0x14')]);router[_0xc1c7('0x15')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x16')]);router[_0xc1c7('0x17')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x18')]);module[_0xc1c7('0x19')]=router; \ No newline at end of file +var _0x80ed=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','destroy','exports','multer','path'];(function(_0x88c582,_0x413a87){var _0x53e51d=function(_0xf2086b){while(--_0xf2086b){_0x88c582['push'](_0x88c582['shift']());}};_0x53e51d(++_0x413a87);}(_0x80ed,0x11c));var _0xd80e=function(_0x1144d1,_0x4d7719){_0x1144d1=_0x1144d1-0x0;var _0x38292b=_0x80ed[_0x1144d1];return _0x38292b;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0x8')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0x8')](_0xd80e('0xf'),auth[_0xd80e('0x9')](),controller['getFields']);router[_0xd80e('0x10')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);router[_0xd80e('0x10')](_0xd80e('0xd'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x12')]);router[_0xd80e('0x13')](_0xd80e('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd80e('0x9')](),controller[_0xd80e('0x14')]);module[_0xd80e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 3067f3c..54226f1 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 _0x32f4=['sequelize','exports','STRING','username','remoteUri'];(function(_0x1306f3,_0x1da761){var _0xc1c7bf=function(_0x1ca08e){while(--_0x1ca08e){_0x1306f3['push'](_0x1306f3['shift']());}};_0xc1c7bf(++_0x1da761);}(_0x32f4,0x154));var _0x432f=function(_0x104699,_0x231d25){_0x104699=_0x104699-0x0;var _0x515a00=_0x32f4[_0x104699];return _0x515a00;};'use strict';var Sequelize=require(_0x432f('0x0'));module[_0x432f('0x1')]={'name':{'type':Sequelize[_0x432f('0x2')]},'description':{'type':Sequelize[_0x432f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x432f('0x3')},'apiKey':{'type':Sequelize[_0x432f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x432f('0x4')},'serverUrl':{'type':Sequelize[_0x432f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8f4c=['sequelize','exports','STRING','username','remoteUri'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8f4c,0x113));var _0xc8f4=function(_0x51b764,_0x527497){_0x51b764=_0x51b764-0x0;var _0x1d9607=_0x8f4c[_0x51b764];return _0x1d9607;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')]},'description':{'type':Sequelize[_0xc8f4('0x2')]},'username':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x4')},'serverUrl':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 315ad87..322f518 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 _0x3b65=['count','set','Content-Range','apply','save','then','error','stack','name','send','map','FreshsalesAccount','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','getConfigurations','order','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','test','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','util','lodash','squel','crypto','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','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit'];(function(_0x110c22,_0x4be638){var _0x121869=function(_0x2a7468){while(--_0x2a7468){_0x110c22['push'](_0x110c22['shift']());}};_0x121869(++_0x4be638);}(_0x3b65,0x163));var _0x53b6=function(_0x13161b,_0x498638){_0x13161b=_0x13161b-0x0;var _0x396bd1=_0x3b65[_0x13161b];return _0x396bd1;};'use strict';var emlformat=require(_0x53b6('0x0'));var rimraf=require(_0x53b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53b6('0x2'));var rp=require(_0x53b6('0x3'));var moment=require(_0x53b6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x53b6('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53b6('0x6'));var squel=require(_0x53b6('0x7'));var crypto=require(_0x53b6('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x53b6('0x9'));var toCsv=require(_0x53b6('0xa'));var querystring=require(_0x53b6('0xb'));var Papa=require(_0x53b6('0xc'));var Redis=require(_0x53b6('0xd'));var authService=require(_0x53b6('0xe'));var qs=require(_0x53b6('0xf'));var as=require(_0x53b6('0x10'));var hardwareService=require(_0x53b6('0x11'));var logger=require(_0x53b6('0x12'))(_0x53b6('0x13'));var utils=require(_0x53b6('0x14'));var config=require(_0x53b6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x53b6('0x16'))['db'];var integrations=require(_0x53b6('0x17'));function respondWithStatusCode(_0x313e19,_0x5a4f48){_0x5a4f48=_0x5a4f48||0xcc;return function(_0xea208a){if(_0xea208a){return _0x313e19['sendStatus'](_0x5a4f48);}return _0x313e19[_0x53b6('0x18')](_0x5a4f48)[_0x53b6('0x19')]();};}function respondWithResult(_0x4ecec9,_0x424e50){_0x424e50=_0x424e50||0xc8;return function(_0x28b453){if(_0x28b453){return _0x4ecec9[_0x53b6('0x18')](_0x424e50)[_0x53b6('0x1a')](_0x28b453);}};}function respondWithFilteredResult(_0xef9dd0,_0x4351eb){return function(_0x21fec3){if(_0x21fec3){var _0x1028c0=typeof _0x4351eb[_0x53b6('0x1b')]==='undefined'&&typeof _0x4351eb[_0x53b6('0x1c')]==='undefined';var _0x3be130=_0x21fec3[_0x53b6('0x1d')];var _0x5abad4=_0x1028c0?0x0:_0x4351eb[_0x53b6('0x1b')];var _0x58e719=_0x1028c0?_0x21fec3[_0x53b6('0x1d')]:_0x4351eb[_0x53b6('0x1b')]+_0x4351eb[_0x53b6('0x1c')];var _0x215773;if(_0x58e719>=_0x3be130){_0x58e719=_0x3be130;_0x215773=0xc8;}else{_0x215773=0xce;}_0xef9dd0['status'](_0x215773);return _0xef9dd0[_0x53b6('0x1e')](_0x53b6('0x1f'),_0x5abad4+'-'+_0x58e719+'/'+_0x3be130)[_0x53b6('0x1a')](_0x21fec3);}return null;};}function patchUpdates(_0x4feea4){return function(_0x5cf60e){try{jsonpatch[_0x53b6('0x20')](_0x5cf60e,_0x4feea4,!![]);}catch(_0x1e5549){return BPromise['reject'](_0x1e5549);}return _0x5cf60e[_0x53b6('0x21')]();};}function saveUpdates(_0x1e3bc8,_0xe61609){return function(_0x437d69){if(_0x437d69){return _0x437d69['update'](_0x1e3bc8)['then'](function(_0x15213c){return _0x15213c;});}return null;};}function removeEntity(_0x220060,_0x26f204){return function(_0x2ad13a){if(_0x2ad13a){return _0x2ad13a['destroy']()[_0x53b6('0x22')](function(){_0x220060[_0x53b6('0x18')](0xcc)[_0x53b6('0x19')]();});}};}function handleEntityNotFound(_0x3be9a8,_0x451430){return function(_0x5c43cd){if(!_0x5c43cd){_0x3be9a8['sendStatus'](0x194);}return _0x5c43cd;};}function handleError(_0x322c58,_0x49f117){_0x49f117=_0x49f117||0x1f4;return function(_0x491a69){logger[_0x53b6('0x23')](_0x491a69[_0x53b6('0x24')]);if(_0x491a69[_0x53b6('0x25')]){delete _0x491a69[_0x53b6('0x25')];}_0x322c58[_0x53b6('0x18')](_0x49f117)[_0x53b6('0x26')](_0x491a69);};}exports['index']=function(_0xa89094,_0x227d00){var _0x405bc4={},_0x49c610={},_0x89286f={'count':0x0,'rows':[]};var _0x572cbd=_[_0x53b6('0x27')](db[_0x53b6('0x28')][_0x53b6('0x29')],function(_0x4b191b){return{'name':_0x4b191b['fieldName'],'type':_0x4b191b[_0x53b6('0x2a')]['key']};});_0x49c610[_0x53b6('0x2b')]=_[_0x53b6('0x27')](_0x572cbd,'name');_0x49c610[_0x53b6('0x2c')]=_[_0x53b6('0x2d')](_0xa89094[_0x53b6('0x2c')]);_0x49c610['filters']=_['intersection'](_0x49c610['model'],_0x49c610['query']);_0x405bc4[_0x53b6('0x2e')]=_[_0x53b6('0x2f')](_0x49c610[_0x53b6('0x2b')],qs['fields'](_0xa89094[_0x53b6('0x2c')][_0x53b6('0x30')]));_0x405bc4[_0x53b6('0x2e')]=_0x405bc4[_0x53b6('0x2e')][_0x53b6('0x31')]?_0x405bc4[_0x53b6('0x2e')]:_0x49c610[_0x53b6('0x2b')];if(!_0xa89094['query']['hasOwnProperty'](_0x53b6('0x32'))){_0x405bc4[_0x53b6('0x1c')]=qs[_0x53b6('0x1c')](_0xa89094[_0x53b6('0x2c')]['limit']);_0x405bc4[_0x53b6('0x1b')]=qs['offset'](_0xa89094[_0x53b6('0x2c')][_0x53b6('0x1b')]);}_0x405bc4['order']=qs[_0x53b6('0x33')](_0xa89094[_0x53b6('0x2c')][_0x53b6('0x33')]);_0x405bc4[_0x53b6('0x34')]=qs[_0x53b6('0x35')](_[_0x53b6('0x36')](_0xa89094['query'],_0x49c610[_0x53b6('0x35')]),_0x572cbd);if(_0xa89094[_0x53b6('0x2c')][_0x53b6('0x37')]){_0x405bc4[_0x53b6('0x34')]=_['merge'](_0x405bc4[_0x53b6('0x34')],{'$or':_[_0x53b6('0x27')](_0x572cbd,function(_0x444170){if(_0x444170['type']!==_0x53b6('0x38')){var _0x146412={};_0x146412[_0x444170[_0x53b6('0x25')]]={'$like':'%'+_0xa89094[_0x53b6('0x2c')]['filter']+'%'};return _0x146412;}})});}_0x405bc4=_[_0x53b6('0x39')]({},_0x405bc4,_0xa89094[_0x53b6('0x3a')]);var _0x5b526b={'where':_0x405bc4[_0x53b6('0x34')]};return db['FreshsalesAccount'][_0x53b6('0x1d')](_0x5b526b)[_0x53b6('0x22')](function(_0x14e516){_0x89286f['count']=_0x14e516;if(_0xa89094['query'][_0x53b6('0x3b')]){_0x405bc4[_0x53b6('0x3c')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x53b6('0x3d')](_0x405bc4);})[_0x53b6('0x22')](function(_0x1d5150){_0x89286f[_0x53b6('0x3e')]=_0x1d5150;return _0x89286f;})['then'](respondWithFilteredResult(_0x227d00,_0x405bc4))[_0x53b6('0x3f')](handleError(_0x227d00,null));};exports['show']=function(_0x4822f1,_0x1e57a7){var _0xc40c5e={'raw':![],'where':{'id':_0x4822f1[_0x53b6('0x40')]['id']}},_0x33edc6={};_0x33edc6[_0x53b6('0x2b')]=_[_0x53b6('0x2d')](db[_0x53b6('0x28')][_0x53b6('0x29')]);_0x33edc6[_0x53b6('0x2c')]=_['keys'](_0x4822f1[_0x53b6('0x2c')]);_0x33edc6[_0x53b6('0x35')]=_['intersection'](_0x33edc6[_0x53b6('0x2b')],_0x33edc6[_0x53b6('0x2c')]);_0xc40c5e['attributes']=_[_0x53b6('0x2f')](_0x33edc6[_0x53b6('0x2b')],qs[_0x53b6('0x30')](_0x4822f1['query']['fields']));_0xc40c5e[_0x53b6('0x2e')]=_0xc40c5e[_0x53b6('0x2e')][_0x53b6('0x31')]?_0xc40c5e[_0x53b6('0x2e')]:_0x33edc6[_0x53b6('0x2b')];if(_0x4822f1[_0x53b6('0x2c')][_0x53b6('0x3b')]){_0xc40c5e[_0x53b6('0x3c')]=[{'all':!![]}];}_0xc40c5e=_[_0x53b6('0x39')]({},_0xc40c5e,_0x4822f1['options']);return db['FreshsalesAccount'][_0x53b6('0x41')](_0xc40c5e)[_0x53b6('0x22')](handleEntityNotFound(_0x1e57a7,null))[_0x53b6('0x22')](respondWithResult(_0x1e57a7,null))[_0x53b6('0x3f')](handleError(_0x1e57a7,null));};exports[_0x53b6('0x42')]=function(_0x26a796,_0xa3704f){return db[_0x53b6('0x28')][_0x53b6('0x42')](_0x26a796[_0x53b6('0x43')],{})[_0x53b6('0x22')](respondWithResult(_0xa3704f,0xc9))[_0x53b6('0x3f')](handleError(_0xa3704f,null));};exports[_0x53b6('0x44')]=function(_0x478fe3,_0x2d636f){if(_0x478fe3[_0x53b6('0x43')]['id']){delete _0x478fe3[_0x53b6('0x43')]['id'];}return db[_0x53b6('0x28')][_0x53b6('0x41')]({'where':{'id':_0x478fe3[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0x2d636f,null))[_0x53b6('0x22')](saveUpdates(_0x478fe3[_0x53b6('0x43')],null))[_0x53b6('0x22')](respondWithResult(_0x2d636f,null))['catch'](handleError(_0x2d636f,null));};exports[_0x53b6('0x45')]=function(_0x4f4e11,_0x1f1f4c){return db[_0x53b6('0x28')][_0x53b6('0x41')]({'where':{'id':_0x4f4e11[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0x1f1f4c,null))[_0x53b6('0x22')](removeEntity(_0x1f1f4c,null))['catch'](handleError(_0x1f1f4c,null));};exports[_0x53b6('0x46')]=function(_0x5c0a89,_0x3a6d83,_0x9157f2){var _0x1f06c1={};var _0x2c7900={};var _0x44969d;var _0x28657b;return db[_0x53b6('0x28')]['findOne']({'where':{'id':_0x5c0a89[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0x3a6d83,null))['then'](function(_0x39b76b){if(_0x39b76b){_0x44969d=_0x39b76b;_0x2c7900['model']=_[_0x53b6('0x2d')](db['FreshsalesConfiguration'][_0x53b6('0x29')]);_0x2c7900[_0x53b6('0x2c')]=_[_0x53b6('0x2d')](_0x5c0a89[_0x53b6('0x2c')]);_0x2c7900[_0x53b6('0x35')]=_['intersection'](_0x2c7900[_0x53b6('0x2b')],_0x2c7900[_0x53b6('0x2c')]);_0x1f06c1[_0x53b6('0x2e')]=_[_0x53b6('0x2f')](_0x2c7900[_0x53b6('0x2b')],qs[_0x53b6('0x30')](_0x5c0a89[_0x53b6('0x2c')][_0x53b6('0x30')]));_0x1f06c1[_0x53b6('0x2e')]=_0x1f06c1['attributes']['length']?_0x1f06c1['attributes']:_0x2c7900[_0x53b6('0x2b')];_0x1f06c1[_0x53b6('0x47')]=qs[_0x53b6('0x33')](_0x5c0a89[_0x53b6('0x2c')]['sort']);_0x1f06c1['where']=qs[_0x53b6('0x35')](_[_0x53b6('0x36')](_0x5c0a89['query'],_0x2c7900['filters']));if(_0x5c0a89[_0x53b6('0x2c')][_0x53b6('0x37')]){_0x1f06c1[_0x53b6('0x34')]=_[_0x53b6('0x39')](_0x1f06c1[_0x53b6('0x34')],{'$or':_['map'](_0x1f06c1[_0x53b6('0x2e')],function(_0x4c0e75){var _0x112fe7={};_0x112fe7[_0x4c0e75]={'$like':'%'+_0x5c0a89['query']['filter']+'%'};return _0x112fe7;})});}_0x1f06c1=_['merge']({},_0x1f06c1,_0x5c0a89[_0x53b6('0x3a')]);return _0x44969d[_0x53b6('0x46')](_0x1f06c1);}})[_0x53b6('0x22')](function(_0x2004f2){if(_0x2004f2){_0x28657b=_0x2004f2['length'];if(!_0x5c0a89[_0x53b6('0x2c')][_0x53b6('0x48')]('nolimit')){_0x1f06c1[_0x53b6('0x1c')]=qs['limit'](_0x5c0a89['query']['limit']);_0x1f06c1[_0x53b6('0x1b')]=qs['offset'](_0x5c0a89[_0x53b6('0x2c')]['offset']);}return _0x44969d[_0x53b6('0x46')](_0x1f06c1);}})['then'](function(_0x22e9b7){if(_0x22e9b7){return _0x22e9b7?{'count':_0x28657b,'rows':_0x22e9b7}:null;}})[_0x53b6('0x22')](respondWithResult(_0x3a6d83,null))[_0x53b6('0x3f')](handleError(_0x3a6d83,null));};exports[_0x53b6('0x49')]=function(_0x432b59,_0xa8f171,_0x10e683){if(_0x432b59[_0x53b6('0x43')]['id']){delete _0x432b59[_0x53b6('0x43')]['id'];}return db['FreshsalesAccount'][_0x53b6('0x4a')]({'where':{'id':_0x432b59[_0x53b6('0x40')]['id']}})[_0x53b6('0x22')](handleEntityNotFound(_0xa8f171,null))['then'](function(_0x9656e5){if(_0x9656e5){_0x432b59[_0x53b6('0x43')][_0x53b6('0x4b')]=_0x9656e5['id'];_0x432b59[_0x53b6('0x43')][_0x53b6('0x4c')]=integrations['getSubjects'](_0x432b59[_0x53b6('0x43')][_0x53b6('0x4d')],_0x432b59['body'][_0x53b6('0x2a')]);_0x432b59[_0x53b6('0x43')][_0x53b6('0x4e')]=integrations[_0x53b6('0x4f')](_0x432b59['body'][_0x53b6('0x4d')],_0x432b59[_0x53b6('0x43')][_0x53b6('0x2a')]);return db[_0x53b6('0x50')][_0x53b6('0x42')](_0x432b59[_0x53b6('0x43')],{'include':[{'model':db[_0x53b6('0x51')],'as':'Subjects'},{'model':db[_0x53b6('0x51')],'as':'Descriptions'}]});}return null;})[_0x53b6('0x22')](respondWithResult(_0xa8f171,null))[_0x53b6('0x3f')](handleError(_0xa8f171,null));};exports[_0x53b6('0x52')]=function(_0x44bcfc,_0x1ec95e,_0x5d068d){var _0x10fec6='';var _0x19bb3b='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x44bcfc[_0x53b6('0x40')]['id']},'attributes':['id',_0x53b6('0x53'),_0x53b6('0x54'),_0x53b6('0x55')]})[_0x53b6('0x22')](handleEntityNotFound(_0x1ec95e,null))[_0x53b6('0x22')](function(_0x31e5e0){if(_0x31e5e0){_0x19bb3b=_0x31e5e0[_0x53b6('0x53')];_0x10fec6=_0x31e5e0[_0x53b6('0x54')];var _0x16b9fc=_0x31e5e0[_0x53b6('0x54')][_0x53b6('0x56')](-0x1);if(_0x16b9fc==='/'){_0x10fec6=_0x10fec6[_0x53b6('0x57')](0x0,_0x10fec6[_0x53b6('0x58')](_0x16b9fc));}return rp({'method':_0x53b6('0x59'),'uri':util[_0x53b6('0x5a')](_0x53b6('0x5b'),_0x10fec6,_0x53b6('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x31e5e0['apiKey']},'json':!![]});}})[_0x53b6('0x22')](function(_0x412ee6){if(_0x412ee6){var _0x367cf8=_0x412ee6['users'];var _0x262b80=![];var _0x235864=null;for(_0x235864=0x0;_0x235864<_0x367cf8[_0x53b6('0x31')];_0x235864++){if(_0x367cf8[_0x235864][_0x53b6('0x5d')]===_0x19bb3b){_0x262b80=!![];}}if(_0x262b80){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x53b6('0x22')](respondWithResult(_0x1ec95e,null))[_0x53b6('0x3f')](function(_0x77fba5){var _0x136e82=_0x44bcfc[_0x53b6('0x2c')][_0x53b6('0x5e')]?0x1f4:_0x77fba5['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x53b6('0x52'),_0x136e82,JSON['stringify'](_0x77fba5));delete _0x77fba5[_0x53b6('0x25')];if(_0x136e82===0x191){_0x136e82=0x190;}_0x1ec95e['status'](_0x136e82)['send'](_0x44bcfc['query'][_0x53b6('0x5e')]?{'message':'Wrong\x20credentials','statusCode':_0x77fba5[_0x53b6('0x5f')]}:_0x77fba5);});}; \ No newline at end of file +var _0xd780=['remoteUri','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','error','name','send','index','map','FreshsalesAccount','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','create','body','find','destroy','getConfigurations','params','FreshsalesConfiguration','order','addConfiguration','AccountId','getSubjects','channel','getDescriptions','Subjects','FreshsalesField','Descriptions','getFields','findOne','username','apiKey'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xd780,0x7a));var _0x0d78=function(_0x2c86d8,_0x80283c){_0x2c86d8=_0x2c86d8-0x0;var _0x3ba83c=_0xd780[_0x2c86d8];return _0x3ba83c;};'use strict';var emlformat=require(_0x0d78('0x0'));var rimraf=require(_0x0d78('0x1'));var zipdir=require(_0x0d78('0x2'));var jsonpatch=require(_0x0d78('0x3'));var rp=require('request-promise');var moment=require(_0x0d78('0x4'));var BPromise=require(_0x0d78('0x5'));var Mustache=require(_0x0d78('0x6'));var util=require(_0x0d78('0x7'));var path=require(_0x0d78('0x8'));var sox=require(_0x0d78('0x9'));var csv=require(_0x0d78('0xa'));var ejs=require(_0x0d78('0xb'));var fs=require('fs');var fs_extra=require(_0x0d78('0xc'));var _=require(_0x0d78('0xd'));var squel=require(_0x0d78('0xe'));var crypto=require(_0x0d78('0xf'));var jsforce=require(_0x0d78('0x10'));var deskjs=require(_0x0d78('0x11'));var toCsv=require(_0x0d78('0xa'));var querystring=require(_0x0d78('0x12'));var Papa=require(_0x0d78('0x13'));var Redis=require(_0x0d78('0x14'));var authService=require(_0x0d78('0x15'));var qs=require(_0x0d78('0x16'));var as=require(_0x0d78('0x17'));var hardwareService=require(_0x0d78('0x18'));var logger=require('../../config/logger')(_0x0d78('0x19'));var utils=require(_0x0d78('0x1a'));var config=require(_0x0d78('0x1b'));var licenseUtil=require(_0x0d78('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0d78('0x1d'));function respondWithStatusCode(_0x4a643,_0xc99d1b){_0xc99d1b=_0xc99d1b||0xcc;return function(_0x26f5ff){if(_0x26f5ff){return _0x4a643[_0x0d78('0x1e')](_0xc99d1b);}return _0x4a643['status'](_0xc99d1b)[_0x0d78('0x1f')]();};}function respondWithResult(_0x166e44,_0x554c2f){_0x554c2f=_0x554c2f||0xc8;return function(_0x5302f0){if(_0x5302f0){return _0x166e44['status'](_0x554c2f)[_0x0d78('0x20')](_0x5302f0);}};}function respondWithFilteredResult(_0x1b9df2,_0x1ee347){return function(_0xf529a5){if(_0xf529a5){var _0x1ef83d=typeof _0x1ee347[_0x0d78('0x21')]===_0x0d78('0x22')&&typeof _0x1ee347[_0x0d78('0x23')]===_0x0d78('0x22');var _0x40da73=_0xf529a5[_0x0d78('0x24')];var _0x12801e=_0x1ef83d?0x0:_0x1ee347['offset'];var _0x7e600=_0x1ef83d?_0xf529a5[_0x0d78('0x24')]:_0x1ee347[_0x0d78('0x21')]+_0x1ee347[_0x0d78('0x23')];var _0x52dba3;if(_0x7e600>=_0x40da73){_0x7e600=_0x40da73;_0x52dba3=0xc8;}else{_0x52dba3=0xce;}_0x1b9df2[_0x0d78('0x25')](_0x52dba3);return _0x1b9df2[_0x0d78('0x26')](_0x0d78('0x27'),_0x12801e+'-'+_0x7e600+'/'+_0x40da73)['json'](_0xf529a5);}return null;};}function patchUpdates(_0x1df1c4){return function(_0x5e6e89){try{jsonpatch[_0x0d78('0x28')](_0x5e6e89,_0x1df1c4,!![]);}catch(_0x8e11d7){return BPromise[_0x0d78('0x29')](_0x8e11d7);}return _0x5e6e89[_0x0d78('0x2a')]();};}function saveUpdates(_0x150e30,_0x15c798){return function(_0x40927a){if(_0x40927a){return _0x40927a['update'](_0x150e30)[_0x0d78('0x2b')](function(_0x1006e0){return _0x1006e0;});}return null;};}function removeEntity(_0x529a0d,_0x42f479){return function(_0x165074){if(_0x165074){return _0x165074['destroy']()['then'](function(){_0x529a0d[_0x0d78('0x25')](0xcc)[_0x0d78('0x1f')]();});}};}function handleEntityNotFound(_0x1a354a,_0x54e398){return function(_0x3fd6c8){if(!_0x3fd6c8){_0x1a354a[_0x0d78('0x1e')](0x194);}return _0x3fd6c8;};}function handleError(_0x2f7e44,_0x1a9247){_0x1a9247=_0x1a9247||0x1f4;return function(_0x566946){logger[_0x0d78('0x2c')](_0x566946['stack']);if(_0x566946[_0x0d78('0x2d')]){delete _0x566946['name'];}_0x2f7e44[_0x0d78('0x25')](_0x1a9247)[_0x0d78('0x2e')](_0x566946);};}exports[_0x0d78('0x2f')]=function(_0x41d646,_0x576885){var _0x12ff42={},_0x3c3175={},_0x2d5870={'count':0x0,'rows':[]};var _0x2b1615=_[_0x0d78('0x30')](db[_0x0d78('0x31')][_0x0d78('0x32')],function(_0x195f86){return{'name':_0x195f86['fieldName'],'type':_0x195f86['type'][_0x0d78('0x33')]};});_0x3c3175[_0x0d78('0x34')]=_['map'](_0x2b1615,_0x0d78('0x2d'));_0x3c3175[_0x0d78('0x35')]=_[_0x0d78('0x36')](_0x41d646[_0x0d78('0x35')]);_0x3c3175[_0x0d78('0x37')]=_['intersection'](_0x3c3175['model'],_0x3c3175[_0x0d78('0x35')]);_0x12ff42[_0x0d78('0x38')]=_[_0x0d78('0x39')](_0x3c3175[_0x0d78('0x34')],qs[_0x0d78('0x3a')](_0x41d646[_0x0d78('0x35')][_0x0d78('0x3a')]));_0x12ff42[_0x0d78('0x38')]=_0x12ff42[_0x0d78('0x38')][_0x0d78('0x3b')]?_0x12ff42[_0x0d78('0x38')]:_0x3c3175[_0x0d78('0x34')];if(!_0x41d646[_0x0d78('0x35')][_0x0d78('0x3c')](_0x0d78('0x3d'))){_0x12ff42[_0x0d78('0x23')]=qs[_0x0d78('0x23')](_0x41d646['query'][_0x0d78('0x23')]);_0x12ff42[_0x0d78('0x21')]=qs[_0x0d78('0x21')](_0x41d646['query'][_0x0d78('0x21')]);}_0x12ff42['order']=qs['sort'](_0x41d646[_0x0d78('0x35')][_0x0d78('0x3e')]);_0x12ff42[_0x0d78('0x3f')]=qs[_0x0d78('0x37')](_[_0x0d78('0x40')](_0x41d646[_0x0d78('0x35')],_0x3c3175[_0x0d78('0x37')]),_0x2b1615);if(_0x41d646[_0x0d78('0x35')][_0x0d78('0x41')]){_0x12ff42[_0x0d78('0x3f')]=_[_0x0d78('0x42')](_0x12ff42['where'],{'$or':_[_0x0d78('0x30')](_0x2b1615,function(_0x20a0a1){if(_0x20a0a1[_0x0d78('0x43')]!==_0x0d78('0x44')){var _0x24e679={};_0x24e679[_0x20a0a1['name']]={'$like':'%'+_0x41d646['query'][_0x0d78('0x41')]+'%'};return _0x24e679;}})});}_0x12ff42=_[_0x0d78('0x42')]({},_0x12ff42,_0x41d646[_0x0d78('0x45')]);var _0x46c55a={'where':_0x12ff42[_0x0d78('0x3f')]};return db['FreshsalesAccount'][_0x0d78('0x24')](_0x46c55a)[_0x0d78('0x2b')](function(_0x324dc3){_0x2d5870[_0x0d78('0x24')]=_0x324dc3;if(_0x41d646[_0x0d78('0x35')][_0x0d78('0x46')]){_0x12ff42[_0x0d78('0x47')]=[{'all':!![]}];}return db[_0x0d78('0x31')][_0x0d78('0x48')](_0x12ff42);})[_0x0d78('0x2b')](function(_0x16bac8){_0x2d5870['rows']=_0x16bac8;return _0x2d5870;})[_0x0d78('0x2b')](respondWithFilteredResult(_0x576885,_0x12ff42))[_0x0d78('0x49')](handleError(_0x576885,null));};exports['show']=function(_0x47afef,_0x8016b6){var _0xb19db={'raw':![],'where':{'id':_0x47afef['params']['id']}},_0x13aac4={};_0x13aac4[_0x0d78('0x34')]=_[_0x0d78('0x36')](db[_0x0d78('0x31')][_0x0d78('0x32')]);_0x13aac4[_0x0d78('0x35')]=_['keys'](_0x47afef[_0x0d78('0x35')]);_0x13aac4[_0x0d78('0x37')]=_[_0x0d78('0x39')](_0x13aac4['model'],_0x13aac4[_0x0d78('0x35')]);_0xb19db['attributes']=_['intersection'](_0x13aac4['model'],qs[_0x0d78('0x3a')](_0x47afef[_0x0d78('0x35')]['fields']));_0xb19db[_0x0d78('0x38')]=_0xb19db['attributes'][_0x0d78('0x3b')]?_0xb19db['attributes']:_0x13aac4[_0x0d78('0x34')];if(_0x47afef[_0x0d78('0x35')][_0x0d78('0x46')]){_0xb19db[_0x0d78('0x47')]=[{'all':!![]}];}_0xb19db=_[_0x0d78('0x42')]({},_0xb19db,_0x47afef['options']);return db[_0x0d78('0x31')]['find'](_0xb19db)[_0x0d78('0x2b')](handleEntityNotFound(_0x8016b6,null))['then'](respondWithResult(_0x8016b6,null))['catch'](handleError(_0x8016b6,null));};exports[_0x0d78('0x4a')]=function(_0x2189c5,_0x179cae){return db[_0x0d78('0x31')][_0x0d78('0x4a')](_0x2189c5[_0x0d78('0x4b')],{})['then'](respondWithResult(_0x179cae,0xc9))['catch'](handleError(_0x179cae,null));};exports['update']=function(_0x4f7497,_0x471e57){if(_0x4f7497['body']['id']){delete _0x4f7497[_0x0d78('0x4b')]['id'];}return db['FreshsalesAccount'][_0x0d78('0x4c')]({'where':{'id':_0x4f7497['params']['id']}})[_0x0d78('0x2b')](handleEntityNotFound(_0x471e57,null))[_0x0d78('0x2b')](saveUpdates(_0x4f7497[_0x0d78('0x4b')],null))[_0x0d78('0x2b')](respondWithResult(_0x471e57,null))[_0x0d78('0x49')](handleError(_0x471e57,null));};exports[_0x0d78('0x4d')]=function(_0x267c4f,_0x448c87){return db[_0x0d78('0x31')][_0x0d78('0x4c')]({'where':{'id':_0x267c4f['params']['id']}})[_0x0d78('0x2b')](handleEntityNotFound(_0x448c87,null))['then'](removeEntity(_0x448c87,null))['catch'](handleError(_0x448c87,null));};exports[_0x0d78('0x4e')]=function(_0x3fb795,_0x26a21b,_0x5fa36b){var _0x52f533={};var _0x9886b9={};var _0x47f0c9;var _0x101238;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x3fb795[_0x0d78('0x4f')]['id']}})[_0x0d78('0x2b')](handleEntityNotFound(_0x26a21b,null))['then'](function(_0x4affbc){if(_0x4affbc){_0x47f0c9=_0x4affbc;_0x9886b9['model']=_[_0x0d78('0x36')](db[_0x0d78('0x50')]['rawAttributes']);_0x9886b9[_0x0d78('0x35')]=_[_0x0d78('0x36')](_0x3fb795[_0x0d78('0x35')]);_0x9886b9['filters']=_['intersection'](_0x9886b9['model'],_0x9886b9[_0x0d78('0x35')]);_0x52f533[_0x0d78('0x38')]=_[_0x0d78('0x39')](_0x9886b9[_0x0d78('0x34')],qs['fields'](_0x3fb795[_0x0d78('0x35')][_0x0d78('0x3a')]));_0x52f533[_0x0d78('0x38')]=_0x52f533['attributes'][_0x0d78('0x3b')]?_0x52f533[_0x0d78('0x38')]:_0x9886b9[_0x0d78('0x34')];_0x52f533[_0x0d78('0x51')]=qs[_0x0d78('0x3e')](_0x3fb795['query'][_0x0d78('0x3e')]);_0x52f533['where']=qs['filters'](_['pick'](_0x3fb795[_0x0d78('0x35')],_0x9886b9[_0x0d78('0x37')]));if(_0x3fb795[_0x0d78('0x35')][_0x0d78('0x41')]){_0x52f533['where']=_[_0x0d78('0x42')](_0x52f533[_0x0d78('0x3f')],{'$or':_['map'](_0x52f533[_0x0d78('0x38')],function(_0x35c55e){var _0x12067a={};_0x12067a[_0x35c55e]={'$like':'%'+_0x3fb795[_0x0d78('0x35')][_0x0d78('0x41')]+'%'};return _0x12067a;})});}_0x52f533=_[_0x0d78('0x42')]({},_0x52f533,_0x3fb795[_0x0d78('0x45')]);return _0x47f0c9[_0x0d78('0x4e')](_0x52f533);}})['then'](function(_0x4da606){if(_0x4da606){_0x101238=_0x4da606[_0x0d78('0x3b')];if(!_0x3fb795[_0x0d78('0x35')]['hasOwnProperty']('nolimit')){_0x52f533['limit']=qs[_0x0d78('0x23')](_0x3fb795[_0x0d78('0x35')]['limit']);_0x52f533['offset']=qs[_0x0d78('0x21')](_0x3fb795[_0x0d78('0x35')][_0x0d78('0x21')]);}return _0x47f0c9[_0x0d78('0x4e')](_0x52f533);}})['then'](function(_0x2afdbd){if(_0x2afdbd){return _0x2afdbd?{'count':_0x101238,'rows':_0x2afdbd}:null;}})[_0x0d78('0x2b')](respondWithResult(_0x26a21b,null))[_0x0d78('0x49')](handleError(_0x26a21b,null));};exports[_0x0d78('0x52')]=function(_0x4eac22,_0x43b777,_0x1b26d2){if(_0x4eac22[_0x0d78('0x4b')]['id']){delete _0x4eac22[_0x0d78('0x4b')]['id'];}return db[_0x0d78('0x31')]['findOne']({'where':{'id':_0x4eac22[_0x0d78('0x4f')]['id']}})[_0x0d78('0x2b')](handleEntityNotFound(_0x43b777,null))[_0x0d78('0x2b')](function(_0x12cd70){if(_0x12cd70){_0x4eac22[_0x0d78('0x4b')][_0x0d78('0x53')]=_0x12cd70['id'];_0x4eac22[_0x0d78('0x4b')]['Subjects']=integrations[_0x0d78('0x54')](_0x4eac22['body'][_0x0d78('0x55')],_0x4eac22[_0x0d78('0x4b')]['type']);_0x4eac22['body']['Descriptions']=integrations[_0x0d78('0x56')](_0x4eac22[_0x0d78('0x4b')][_0x0d78('0x55')],_0x4eac22[_0x0d78('0x4b')]['type']);return db[_0x0d78('0x50')][_0x0d78('0x4a')](_0x4eac22[_0x0d78('0x4b')],{'include':[{'model':db['FreshsalesField'],'as':_0x0d78('0x57')},{'model':db[_0x0d78('0x58')],'as':_0x0d78('0x59')}]});}return null;})[_0x0d78('0x2b')](respondWithResult(_0x43b777,null))['catch'](handleError(_0x43b777,null));};exports[_0x0d78('0x5a')]=function(_0x4a3a67,_0xc30f48,_0x2aee3e){var _0x2b746c='';var _0x59ea17='';return db['FreshsalesAccount'][_0x0d78('0x5b')]({'where':{'id':_0x4a3a67[_0x0d78('0x4f')]['id']},'attributes':['id',_0x0d78('0x5c'),'remoteUri',_0x0d78('0x5d')]})[_0x0d78('0x2b')](handleEntityNotFound(_0xc30f48,null))[_0x0d78('0x2b')](function(_0x201d15){if(_0x201d15){_0x59ea17=_0x201d15['username'];_0x2b746c=_0x201d15[_0x0d78('0x5e')];var _0x482d5c=_0x201d15[_0x0d78('0x5e')][_0x0d78('0x5f')](-0x1);if(_0x482d5c==='/'){_0x2b746c=_0x2b746c[_0x0d78('0x60')](0x0,_0x2b746c[_0x0d78('0x61')](_0x482d5c));}return rp({'method':'GET','uri':util[_0x0d78('0x62')](_0x0d78('0x63'),_0x2b746c,_0x0d78('0x64')),'headers':{'Authorization':_0x0d78('0x65')+_0x201d15[_0x0d78('0x5d')]},'json':!![]});}})[_0x0d78('0x2b')](function(_0x5953b9){if(_0x5953b9){var _0x1a3228=_0x5953b9['users'];var _0x40897e=![];var _0x3f22fc=null;for(_0x3f22fc=0x0;_0x3f22fc<_0x1a3228['length'];_0x3f22fc++){if(_0x1a3228[_0x3f22fc]['email']===_0x59ea17){_0x40897e=!![];}}if(_0x40897e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0d78('0x66')});}}})['then'](respondWithResult(_0xc30f48,null))[_0x0d78('0x49')](function(_0x3eef43){var _0xfe3e3c=_0x4a3a67[_0x0d78('0x35')]['test']?0x1f4:_0x3eef43[_0x0d78('0x67')]||0x1f4;logger['error'](_0x0d78('0x68'),_0x0d78('0x5a'),_0xfe3e3c,JSON[_0x0d78('0x69')](_0x3eef43));delete _0x3eef43[_0x0d78('0x2d')];if(_0xfe3e3c===0x191){_0xfe3e3c=0x190;}_0xc30f48['status'](_0xfe3e3c)['send'](_0x4a3a67[_0x0d78('0x35')][_0x0d78('0x6a')]?{'message':_0x0d78('0x6b'),'statusCode':_0x3eef43['statusCode']}:_0x3eef43);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 497209c..3df6c3d 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 _0xf2e3=['int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount'];(function(_0x98c3f,_0x551153){var _0xecff7d=function(_0x3f862b){while(--_0x3f862b){_0x98c3f['push'](_0x98c3f['shift']());}};_0xecff7d(++_0x551153);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf2e3[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x3f2e('0xa')]=function(_0xdd6b3e,_0x3c0864){return _0xdd6b3e[_0x3f2e('0xb')](_0x3f2e('0xc'),attributes,{'tableName':_0x3f2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a07=['moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x433f7d,_0x1dca19){var _0x5d2972=function(_0x39d7d4){while(--_0x39d7d4){_0x433f7d['push'](_0x433f7d['shift']());}};_0x5d2972(++_0x1dca19);}(_0x2a07,0x74));var _0x72a0=function(_0x549a09,_0x2fe584){_0x549a09=_0x549a09-0x0;var _0x3ef978=_0x2a07[_0x549a09];return _0x3ef978;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));var integrations=require(_0x72a0('0xa'));module[_0x72a0('0xb')]=function(_0x20dab9,_0x193e3b){return _0x20dab9[_0x72a0('0xc')](_0x72a0('0xd'),attributes,{'tableName':_0x72a0('0xe'),'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 7555e7c..d15edc5 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 _0x627e=['request','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','raw','options','where','map','model','attributes','include','then','debug','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0x627e,0x14a));var _0xe627=function(_0x424687,_0x1c8baf){_0x424687=_0x424687-0x0;var _0x288f96=_0x627e[_0x424687];return _0x288f96;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});}exports[_0xe627('0x14')]=function(_0x56559b){var _0x2fe46a=this;return new Promise(function(_0x538b22,_0x24fddd){return db['FreshsalesAccount'][_0xe627('0x15')]({'raw':_0x56559b['options']?_0x56559b['options'][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x56559b['options']?_0x56559b[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x56559b['options']?_0x56559b['options']['attributes']||null:null,'limit':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['limit']||null:null,'include':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['include']?_[_0xe627('0x19')](_0x56559b[_0xe627('0x17')]['include'],function(_0x42f3d1){return{'model':db[_0x42f3d1[_0xe627('0x1a')]],'as':_0x42f3d1['as'],'attributes':_0x42f3d1[_0xe627('0x1b')],'include':_0x42f3d1['include']?_[_0xe627('0x19')](_0x42f3d1[_0xe627('0x1c')],function(_0x1a5081){return{'model':db[_0x1a5081[_0xe627('0x1a')]],'as':_0x1a5081['as'],'attributes':_0x1a5081['attributes'],'include':_0x1a5081[_0xe627('0x1c')]?_[_0xe627('0x19')](_0x1a5081[_0xe627('0x1c')],function(_0x29eb8e){return{'model':db[_0x29eb8e[_0xe627('0x1a')]],'as':_0x29eb8e['as'],'attributes':_0x29eb8e[_0xe627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x44c9f7){logger[_0xe627('0xb')]('GetFreshsalesAccount',_0x56559b);logger[_0xe627('0x1e')]('GetFreshsalesAccount',_0x56559b,JSON['stringify'](_0x44c9f7));_0x538b22(_0x44c9f7);})[_0xe627('0x13')](function(_0xdf63c8){logger['error'](_0xe627('0x14'),_0xdf63c8['message'],_0x56559b);_0x24fddd(_0x2fe46a[_0xe627('0x10')](0x1f4,_0xdf63c8['message']));});});};exports[_0xe627('0x1f')]=function(_0x26833a){var _0x5d8992=this;return new Promise(function(_0x33e9dd,_0x4f92c9){return db[_0xe627('0x20')][_0xe627('0x21')]({'raw':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x1b')]||null:null,'include':_0x26833a['options']?_0x26833a['options'][_0xe627('0x1c')]?_['map'](_0x26833a[_0xe627('0x17')]['include'],function(_0x56d1d7){return{'model':db[_0x56d1d7[_0xe627('0x1a')]],'as':_0x56d1d7['as'],'attributes':_0x56d1d7['attributes'],'include':_0x56d1d7['include']?_[_0xe627('0x19')](_0x56d1d7[_0xe627('0x1c')],function(_0x55f001){return{'model':db[_0x55f001['model']],'as':_0x55f001['as'],'attributes':_0x55f001['attributes'],'include':_0x55f001['include']?_[_0xe627('0x19')](_0x55f001['include'],function(_0x39338c){return{'model':db[_0x39338c[_0xe627('0x1a')]],'as':_0x39338c['as'],'attributes':_0x39338c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x35a303){logger['info'](_0xe627('0x1f'),_0x26833a);logger[_0xe627('0x1e')](_0xe627('0x1f'),_0x26833a,JSON[_0xe627('0xf')](_0x35a303));_0x33e9dd(_0x35a303);})[_0xe627('0x13')](function(_0x28fd59){logger['error'](_0xe627('0x1f'),_0x28fd59['message'],_0x26833a);_0x4f92c9(_0x5d8992[_0xe627('0x10')](0x1f4,_0x28fd59['message']));});});}; \ No newline at end of file +var _0x7b84=['FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','where','attributes','limit','map','model','include','GetFreshsalesAccount','ShowFreshsalesAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x7b84,0x17c));var _0x47b8=function(_0x58a55b,_0x40e707){_0x58a55b=_0x58a55b-0x0;var _0x414a09=_0x7b84[_0x58a55b];return _0x414a09;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('FreshsalesAccount,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['GetFreshsalesAccount']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['FreshsalesAccount']['findAll']({'raw':_0x4f7317['options']?_0x4f7317[_0x47b8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1b')]||null:null,'attributes':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1c')]||null:null,'limit':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1d')]||null:null,'include':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')]['include']?_[_0x47b8('0x1e')](_0x4f7317[_0x47b8('0x1a')]['include'],function(_0x22e7dd){return{'model':db[_0x22e7dd[_0x47b8('0x1f')]],'as':_0x22e7dd['as'],'attributes':_0x22e7dd[_0x47b8('0x1c')],'include':_0x22e7dd[_0x47b8('0x20')]?_['map'](_0x22e7dd[_0x47b8('0x20')],function(_0x332c23){return{'model':db[_0x332c23[_0x47b8('0x1f')]],'as':_0x332c23['as'],'attributes':_0x332c23[_0x47b8('0x1c')],'include':_0x332c23[_0x47b8('0x20')]?_[_0x47b8('0x1e')](_0x332c23[_0x47b8('0x20')],function(_0x568c1e){return{'model':db[_0x568c1e[_0x47b8('0x1f')]],'as':_0x568c1e['as'],'attributes':_0x568c1e[_0x47b8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x195a66){logger[_0x47b8('0xf')](_0x47b8('0x21'),_0x4f7317);logger[_0x47b8('0x12')]('GetFreshsalesAccount',_0x4f7317,JSON[_0x47b8('0x14')](_0x195a66));_0x36faf1(_0x195a66);})['catch'](function(_0x2c89fc){logger[_0x47b8('0x15')](_0x47b8('0x21'),_0x2c89fc[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195['error'](0x1f4,_0x2c89fc[_0x47b8('0x17')]));});});};exports[_0x47b8('0x22')]=function(_0x402e7c){var _0x1b6c0a=this;return new Promise(function(_0x132f37,_0x197cb5){return db['FreshsalesAccount']['find']({'raw':_0x402e7c['options']?_0x402e7c[_0x47b8('0x1a')][_0x47b8('0x23')]===undefined?!![]:![]:!![],'where':_0x402e7c[_0x47b8('0x1a')]?_0x402e7c['options']['where']||null:null,'attributes':_0x402e7c['options']?_0x402e7c['options'][_0x47b8('0x1c')]||null:null,'include':_0x402e7c[_0x47b8('0x1a')]?_0x402e7c[_0x47b8('0x1a')][_0x47b8('0x20')]?_[_0x47b8('0x1e')](_0x402e7c[_0x47b8('0x1a')][_0x47b8('0x20')],function(_0x460dcc){return{'model':db[_0x460dcc[_0x47b8('0x1f')]],'as':_0x460dcc['as'],'attributes':_0x460dcc['attributes'],'include':_0x460dcc['include']?_[_0x47b8('0x1e')](_0x460dcc[_0x47b8('0x20')],function(_0x531dd2){return{'model':db[_0x531dd2['model']],'as':_0x531dd2['as'],'attributes':_0x531dd2[_0x47b8('0x1c')],'include':_0x531dd2[_0x47b8('0x20')]?_[_0x47b8('0x1e')](_0x531dd2['include'],function(_0x240ab6){return{'model':db[_0x240ab6[_0x47b8('0x1f')]],'as':_0x240ab6['as'],'attributes':_0x240ab6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f1892){logger['info'](_0x47b8('0x22'),_0x402e7c);logger[_0x47b8('0x12')](_0x47b8('0x22'),_0x402e7c,JSON[_0x47b8('0x14')](_0x4f1892));_0x132f37(_0x4f1892);})[_0x47b8('0x19')](function(_0x3c24c1){logger['error']('ShowFreshsalesAccount',_0x3c24c1[_0x47b8('0x17')],_0x402e7c);_0x197cb5(_0x1b6c0a[_0x47b8('0x15')](0x1f4,_0x3c24c1[_0x47b8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index db761c4..71f11d2 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 _0x24ed=['isAuthenticated','/:id','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get'];(function(_0x4c2583,_0x525ae8){var _0x2f9315=function(_0x226ddd){while(--_0x226ddd){_0x4c2583['push'](_0x4c2583['shift']());}};_0x2f9315(++_0x525ae8);}(_0x24ed,0x7d));var _0xd24e=function(_0x1fc22e,_0x279f42){_0x1fc22e=_0x1fc22e-0x0;var _0x40f369=_0x24ed[_0x1fc22e];return _0x40f369;};'use strict';var multer=require(_0xd24e('0x0'));var util=require(_0xd24e('0x1'));var path=require('path');var timeout=require(_0xd24e('0x2'));var express=require(_0xd24e('0x3'));var router=express['Router']();var fs_extra=require(_0xd24e('0x4'));var auth=require(_0xd24e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd24e('0x6'));router[_0xd24e('0x7')]('/',auth[_0xd24e('0x8')](),controller['index']);router['get'](_0xd24e('0x9'),auth[_0xd24e('0x8')](),controller['show']);router[_0xd24e('0x7')](_0xd24e('0xa'),auth[_0xd24e('0x8')](),controller['getSubjects']);router[_0xd24e('0x7')](_0xd24e('0xb'),auth[_0xd24e('0x8')](),controller[_0xd24e('0xc')]);router['get']('/:id/fields',auth[_0xd24e('0x8')](),controller[_0xd24e('0xd')]);router[_0xd24e('0xe')]('/',auth['isAuthenticated'](),controller[_0xd24e('0xf')]);router[_0xd24e('0x10')](_0xd24e('0x9'),auth[_0xd24e('0x8')](),controller[_0xd24e('0x11')]);router[_0xd24e('0x12')](_0xd24e('0x9'),auth[_0xd24e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7c7c=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c7c,0x8b));var _0xc7c7=function(_0x195a2c,_0x3f9bb8){_0x195a2c=_0x195a2c-0x0;var _0x6629b6=_0x7c7c[_0x195a2c];return _0x6629b6;};'use strict';var multer=require('multer');var util=require(_0xc7c7('0x0'));var path=require(_0xc7c7('0x1'));var timeout=require(_0xc7c7('0x2'));var express=require(_0xc7c7('0x3'));var router=express[_0xc7c7('0x4')]();var fs_extra=require(_0xc7c7('0x5'));var auth=require(_0xc7c7('0x6'));var interaction=require(_0xc7c7('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xc7c7('0x8')](),controller['index']);router[_0xc7c7('0x9')](_0xc7c7('0xa'),auth[_0xc7c7('0x8')](),controller[_0xc7c7('0xb')]);router[_0xc7c7('0x9')](_0xc7c7('0xc'),auth[_0xc7c7('0x8')](),controller['getSubjects']);router[_0xc7c7('0x9')](_0xc7c7('0xd'),auth[_0xc7c7('0x8')](),controller[_0xc7c7('0xe')]);router[_0xc7c7('0x9')](_0xc7c7('0xf'),auth[_0xc7c7('0x8')](),controller['getFields']);router[_0xc7c7('0x10')]('/',auth[_0xc7c7('0x8')](),controller[_0xc7c7('0x11')]);router[_0xc7c7('0x12')](_0xc7c7('0xa'),auth['isAuthenticated'](),controller[_0xc7c7('0x13')]);router[_0xc7c7('0x14')](_0xc7c7('0xa'),auth[_0xc7c7('0x8')](),controller[_0xc7c7('0x15')]);module[_0xc7c7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index a03edff..7b27c39 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 _0x8181=['STRING'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8181,0x195));var _0x1818=function(_0x54899d,_0x548b25){_0x54899d=_0x54899d-0x0;var _0xc5d0e=_0x8181[_0x54899d];return _0xc5d0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1818('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac70=['STRING','exports'];(function(_0x5047cb,_0x41cf2d){var _0x13a46c=function(_0x3bf308){while(--_0x3bf308){_0x5047cb['push'](_0x5047cb['shift']());}};_0x13a46c(++_0x41cf2d);}(_0xac70,0x6b));var _0x0ac7=function(_0x524cb3,_0x2d702a){_0x524cb3=_0x524cb3-0x0;var _0x288975=_0xac70[_0x524cb3];return _0x288975;};'use strict';var Sequelize=require('sequelize');module[_0x0ac7('0x0')]={'name':{'type':Sequelize[_0x0ac7('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 8e6a0c9..24f0b9e 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 _0x262a=['jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','FreshsalesConfiguration','rawAttributes','model','map','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','fields','include','find','create','body','getSubjects','findOne','nolimit','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto'];(function(_0x5aec8d,_0x466086){var _0x51e3b3=function(_0x4686f3){while(--_0x4686f3){_0x5aec8d['push'](_0x5aec8d['shift']());}};_0x51e3b3(++_0x466086);}(_0x262a,0x178));var _0xa262=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0x262a[_0x4cf8d4];return _0x2c1beb;};'use strict';var emlformat=require(_0xa262('0x0'));var rimraf=require(_0xa262('0x1'));var zipdir=require(_0xa262('0x2'));var jsonpatch=require(_0xa262('0x3'));var rp=require(_0xa262('0x4'));var moment=require(_0xa262('0x5'));var BPromise=require(_0xa262('0x6'));var Mustache=require(_0xa262('0x7'));var util=require(_0xa262('0x8'));var path=require(_0xa262('0x9'));var sox=require(_0xa262('0xa'));var csv=require(_0xa262('0xb'));var ejs=require(_0xa262('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa262('0xd'));var jsforce=require(_0xa262('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa262('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa262('0xf'));var authService=require(_0xa262('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa262('0x11'));var hardwareService=require(_0xa262('0x12'));var logger=require(_0xa262('0x13'))('api');var utils=require(_0xa262('0x14'));var config=require(_0xa262('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa262('0x16'))['db'];function respondWithStatusCode(_0x3eb8b5,_0x497bdf){_0x497bdf=_0x497bdf||0xcc;return function(_0x3a4cf9){if(_0x3a4cf9){return _0x3eb8b5[_0xa262('0x17')](_0x497bdf);}return _0x3eb8b5[_0xa262('0x18')](_0x497bdf)[_0xa262('0x19')]();};}function respondWithResult(_0x4adf28,_0x2a841d){_0x2a841d=_0x2a841d||0xc8;return function(_0x1efbf2){if(_0x1efbf2){return _0x4adf28['status'](_0x2a841d)['json'](_0x1efbf2);}};}function respondWithFilteredResult(_0x327069,_0x31d62a){return function(_0x4ec5a9){if(_0x4ec5a9){var _0x8b71de=typeof _0x31d62a['offset']===_0xa262('0x1a')&&typeof _0x31d62a[_0xa262('0x1b')]==='undefined';var _0x55313b=_0x4ec5a9[_0xa262('0x1c')];var _0xb6fe97=_0x8b71de?0x0:_0x31d62a['offset'];var _0x36f7f0=_0x8b71de?_0x4ec5a9['count']:_0x31d62a[_0xa262('0x1d')]+_0x31d62a['limit'];var _0x5d5295;if(_0x36f7f0>=_0x55313b){_0x36f7f0=_0x55313b;_0x5d5295=0xc8;}else{_0x5d5295=0xce;}_0x327069[_0xa262('0x18')](_0x5d5295);return _0x327069[_0xa262('0x1e')](_0xa262('0x1f'),_0xb6fe97+'-'+_0x36f7f0+'/'+_0x55313b)[_0xa262('0x20')](_0x4ec5a9);}return null;};}function patchUpdates(_0x222ba3){return function(_0x127301){try{jsonpatch[_0xa262('0x21')](_0x127301,_0x222ba3,!![]);}catch(_0x287b01){return BPromise[_0xa262('0x22')](_0x287b01);}return _0x127301[_0xa262('0x23')]();};}function saveUpdates(_0x58dc2c,_0x16ddcd){return function(_0x47a346){if(_0x47a346){return _0x47a346[_0xa262('0x24')](_0x58dc2c)[_0xa262('0x25')](function(_0x24e2c7){return _0x24e2c7;});}return null;};}function removeEntity(_0x31f497,_0x2c3c62){return function(_0x5cee88){if(_0x5cee88){return _0x5cee88[_0xa262('0x26')]()['then'](function(){_0x31f497[_0xa262('0x18')](0xcc)[_0xa262('0x19')]();});}};}function handleEntityNotFound(_0x182305,_0xe49df8){return function(_0x1e4abf){if(!_0x1e4abf){_0x182305[_0xa262('0x17')](0x194);}return _0x1e4abf;};}function handleError(_0x38aa8f,_0x5c92d4){_0x5c92d4=_0x5c92d4||0x1f4;return function(_0x7fd8c6){logger['error'](_0x7fd8c6[_0xa262('0x27')]);if(_0x7fd8c6[_0xa262('0x28')]){delete _0x7fd8c6[_0xa262('0x28')];}_0x38aa8f[_0xa262('0x18')](_0x5c92d4)[_0xa262('0x29')](_0x7fd8c6);};}exports['index']=function(_0x5f2412,_0x2bbf5f){var _0x1e6147={},_0x343b29={},_0x1ddaf4={'count':0x0,'rows':[]};var _0x1bda70=_['map'](db[_0xa262('0x2a')][_0xa262('0x2b')],function(_0x4cfacc){return{'name':_0x4cfacc['fieldName'],'type':_0x4cfacc['type']['key']};});_0x343b29[_0xa262('0x2c')]=_[_0xa262('0x2d')](_0x1bda70,_0xa262('0x28'));_0x343b29[_0xa262('0x2e')]=_['keys'](_0x5f2412[_0xa262('0x2e')]);_0x343b29[_0xa262('0x2f')]=_[_0xa262('0x30')](_0x343b29[_0xa262('0x2c')],_0x343b29[_0xa262('0x2e')]);_0x1e6147[_0xa262('0x31')]=_[_0xa262('0x30')](_0x343b29[_0xa262('0x2c')],qs['fields'](_0x5f2412['query']['fields']));_0x1e6147['attributes']=_0x1e6147[_0xa262('0x31')][_0xa262('0x32')]?_0x1e6147[_0xa262('0x31')]:_0x343b29[_0xa262('0x2c')];if(!_0x5f2412['query'][_0xa262('0x33')]('nolimit')){_0x1e6147[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0x5f2412[_0xa262('0x2e')]['limit']);_0x1e6147[_0xa262('0x1d')]=qs[_0xa262('0x1d')](_0x5f2412[_0xa262('0x2e')]['offset']);}_0x1e6147[_0xa262('0x34')]=qs[_0xa262('0x35')](_0x5f2412['query'][_0xa262('0x35')]);_0x1e6147[_0xa262('0x36')]=qs[_0xa262('0x2f')](_[_0xa262('0x37')](_0x5f2412[_0xa262('0x2e')],_0x343b29[_0xa262('0x2f')]),_0x1bda70);if(_0x5f2412[_0xa262('0x2e')][_0xa262('0x38')]){_0x1e6147['where']=_[_0xa262('0x39')](_0x1e6147[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x1bda70,function(_0x118cf2){if(_0x118cf2[_0xa262('0x3a')]!==_0xa262('0x3b')){var _0x15dc53={};_0x15dc53[_0x118cf2[_0xa262('0x28')]]={'$like':'%'+_0x5f2412[_0xa262('0x2e')][_0xa262('0x38')]+'%'};return _0x15dc53;}})});}_0x1e6147=_[_0xa262('0x39')]({},_0x1e6147,_0x5f2412[_0xa262('0x3c')]);var _0x5f1283={'where':_0x1e6147['where']};return db[_0xa262('0x2a')][_0xa262('0x1c')](_0x5f1283)[_0xa262('0x25')](function(_0x1843c3){_0x1ddaf4[_0xa262('0x1c')]=_0x1843c3;if(_0x5f2412[_0xa262('0x2e')][_0xa262('0x3d')]){_0x1e6147['include']=[{'all':!![]}];}return db[_0xa262('0x2a')][_0xa262('0x3e')](_0x1e6147);})['then'](function(_0x32cc4f){_0x1ddaf4['rows']=_0x32cc4f;return _0x1ddaf4;})['then'](respondWithFilteredResult(_0x2bbf5f,_0x1e6147))[_0xa262('0x3f')](handleError(_0x2bbf5f,null));};exports[_0xa262('0x40')]=function(_0x1e911e,_0x2c4b81){var _0x2f64ca={'raw':![],'where':{'id':_0x1e911e[_0xa262('0x41')]['id']}},_0x37e643={};_0x37e643['model']=_[_0xa262('0x42')](db['FreshsalesConfiguration'][_0xa262('0x2b')]);_0x37e643[_0xa262('0x2e')]=_['keys'](_0x1e911e[_0xa262('0x2e')]);_0x37e643['filters']=_[_0xa262('0x30')](_0x37e643[_0xa262('0x2c')],_0x37e643[_0xa262('0x2e')]);_0x2f64ca[_0xa262('0x31')]=_[_0xa262('0x30')](_0x37e643[_0xa262('0x2c')],qs[_0xa262('0x43')](_0x1e911e[_0xa262('0x2e')][_0xa262('0x43')]));_0x2f64ca[_0xa262('0x31')]=_0x2f64ca['attributes'][_0xa262('0x32')]?_0x2f64ca[_0xa262('0x31')]:_0x37e643[_0xa262('0x2c')];if(_0x1e911e[_0xa262('0x2e')][_0xa262('0x3d')]){_0x2f64ca[_0xa262('0x44')]=[{'all':!![]}];}_0x2f64ca=_[_0xa262('0x39')]({},_0x2f64ca,_0x1e911e[_0xa262('0x3c')]);return db['FreshsalesConfiguration'][_0xa262('0x45')](_0x2f64ca)[_0xa262('0x25')](handleEntityNotFound(_0x2c4b81,null))[_0xa262('0x25')](respondWithResult(_0x2c4b81,null))[_0xa262('0x3f')](handleError(_0x2c4b81,null));};exports[_0xa262('0x46')]=function(_0x987690,_0x1749be){return db[_0xa262('0x2a')][_0xa262('0x46')](_0x987690[_0xa262('0x47')],{})['then'](respondWithResult(_0x1749be,0xc9))[_0xa262('0x3f')](handleError(_0x1749be,null));};exports[_0xa262('0x24')]=function(_0x17bda8,_0x807c82){if(_0x17bda8['body']['id']){delete _0x17bda8[_0xa262('0x47')]['id'];}return db[_0xa262('0x2a')][_0xa262('0x45')]({'where':{'id':_0x17bda8[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x807c82,null))[_0xa262('0x25')](saveUpdates(_0x17bda8[_0xa262('0x47')],null))[_0xa262('0x25')](respondWithResult(_0x807c82,null))[_0xa262('0x3f')](handleError(_0x807c82,null));};exports[_0xa262('0x26')]=function(_0x52ccad,_0x333aab){return db[_0xa262('0x2a')][_0xa262('0x45')]({'where':{'id':_0x52ccad[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x333aab,null))[_0xa262('0x25')](removeEntity(_0x333aab,null))['catch'](handleError(_0x333aab,null));};exports[_0xa262('0x48')]=function(_0x1fc8d3,_0x428022,_0x1dfec0){var _0x2c463c={};var _0x5297fd={};var _0x4798e8;var _0x466b3b;return db[_0xa262('0x2a')][_0xa262('0x49')]({'where':{'id':_0x1fc8d3[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x428022,null))[_0xa262('0x25')](function(_0x128448){if(_0x128448){_0x4798e8=_0x128448;_0x5297fd['model']=_[_0xa262('0x42')](db['FreshsalesField']['rawAttributes']);_0x5297fd['query']=_[_0xa262('0x42')](_0x1fc8d3[_0xa262('0x2e')]);_0x5297fd[_0xa262('0x2f')]=_[_0xa262('0x30')](_0x5297fd[_0xa262('0x2c')],_0x5297fd['query']);_0x2c463c['attributes']=_[_0xa262('0x30')](_0x5297fd[_0xa262('0x2c')],qs[_0xa262('0x43')](_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x43')]));_0x2c463c[_0xa262('0x31')]=_0x2c463c[_0xa262('0x31')][_0xa262('0x32')]?_0x2c463c['attributes']:_0x5297fd['model'];_0x2c463c[_0xa262('0x34')]=qs[_0xa262('0x35')](_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x35')]);_0x2c463c[_0xa262('0x36')]=qs['filters'](_[_0xa262('0x37')](_0x1fc8d3[_0xa262('0x2e')],_0x5297fd['filters']));if(_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x38')]){_0x2c463c[_0xa262('0x36')]=_[_0xa262('0x39')](_0x2c463c[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x2c463c[_0xa262('0x31')],function(_0x2ea4e0){var _0x415175={};_0x415175[_0x2ea4e0]={'$like':'%'+_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x38')]+'%'};return _0x415175;})});}_0x2c463c=_[_0xa262('0x39')]({},_0x2c463c,_0x1fc8d3[_0xa262('0x3c')]);return _0x4798e8[_0xa262('0x48')](_0x2c463c);}})['then'](function(_0x4e4260){if(_0x4e4260){_0x466b3b=_0x4e4260[_0xa262('0x32')];if(!_0x1fc8d3['query'][_0xa262('0x33')](_0xa262('0x4a'))){_0x2c463c[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0x1fc8d3['query'][_0xa262('0x1b')]);_0x2c463c['offset']=qs[_0xa262('0x1d')](_0x1fc8d3[_0xa262('0x2e')][_0xa262('0x1d')]);}return _0x4798e8['getSubjects'](_0x2c463c);}})['then'](function(_0x1c2e81){if(_0x1c2e81){return _0x1c2e81?{'count':_0x466b3b,'rows':_0x1c2e81}:null;}})['then'](respondWithResult(_0x428022,null))[_0xa262('0x3f')](handleError(_0x428022,null));};exports[_0xa262('0x4b')]=function(_0xafda7c,_0x59d407,_0x3bece4){var _0x4e110e={};var _0x19111b={};var _0x468eab;var _0x5c055b;return db[_0xa262('0x2a')][_0xa262('0x49')]({'where':{'id':_0xafda7c[_0xa262('0x41')]['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x59d407,null))['then'](function(_0x5220f2){if(_0x5220f2){_0x468eab=_0x5220f2;_0x19111b[_0xa262('0x2c')]=_[_0xa262('0x42')](db[_0xa262('0x4c')]['rawAttributes']);_0x19111b[_0xa262('0x2e')]=_['keys'](_0xafda7c[_0xa262('0x2e')]);_0x19111b['filters']=_[_0xa262('0x30')](_0x19111b[_0xa262('0x2c')],_0x19111b[_0xa262('0x2e')]);_0x4e110e['attributes']=_['intersection'](_0x19111b[_0xa262('0x2c')],qs['fields'](_0xafda7c[_0xa262('0x2e')][_0xa262('0x43')]));_0x4e110e[_0xa262('0x31')]=_0x4e110e[_0xa262('0x31')][_0xa262('0x32')]?_0x4e110e[_0xa262('0x31')]:_0x19111b['model'];_0x4e110e[_0xa262('0x34')]=qs[_0xa262('0x35')](_0xafda7c[_0xa262('0x2e')]['sort']);_0x4e110e['where']=qs[_0xa262('0x2f')](_[_0xa262('0x37')](_0xafda7c[_0xa262('0x2e')],_0x19111b[_0xa262('0x2f')]));if(_0xafda7c[_0xa262('0x2e')][_0xa262('0x38')]){_0x4e110e[_0xa262('0x36')]=_[_0xa262('0x39')](_0x4e110e[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x4e110e[_0xa262('0x31')],function(_0x4959ab){var _0x2f72d9={};_0x2f72d9[_0x4959ab]={'$like':'%'+_0xafda7c['query'][_0xa262('0x38')]+'%'};return _0x2f72d9;})});}_0x4e110e=_[_0xa262('0x39')]({},_0x4e110e,_0xafda7c[_0xa262('0x3c')]);return _0x468eab[_0xa262('0x4b')](_0x4e110e);}})['then'](function(_0xcb30aa){if(_0xcb30aa){_0x5c055b=_0xcb30aa[_0xa262('0x32')];if(!_0xafda7c['query'][_0xa262('0x33')](_0xa262('0x4a'))){_0x4e110e[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0xafda7c[_0xa262('0x2e')][_0xa262('0x1b')]);_0x4e110e[_0xa262('0x1d')]=qs['offset'](_0xafda7c[_0xa262('0x2e')]['offset']);}return _0x468eab[_0xa262('0x4b')](_0x4e110e);}})[_0xa262('0x25')](function(_0x571f5e){if(_0x571f5e){return _0x571f5e?{'count':_0x5c055b,'rows':_0x571f5e}:null;}})[_0xa262('0x25')](respondWithResult(_0x59d407,null))[_0xa262('0x3f')](handleError(_0x59d407,null));};exports[_0xa262('0x4d')]=function(_0x2917d8,_0x3e9ae7,_0x83e4bd){var _0x3d5d0c={};var _0x156534={};var _0xb610a7;var _0x2bdff8;return db[_0xa262('0x2a')][_0xa262('0x49')]({'where':{'id':_0x2917d8['params']['id']}})[_0xa262('0x25')](handleEntityNotFound(_0x3e9ae7,null))[_0xa262('0x25')](function(_0x5f0db6){if(_0x5f0db6){_0xb610a7=_0x5f0db6;_0x156534[_0xa262('0x2c')]=_[_0xa262('0x42')](db[_0xa262('0x4c')][_0xa262('0x2b')]);_0x156534[_0xa262('0x2e')]=_[_0xa262('0x42')](_0x2917d8['query']);_0x156534[_0xa262('0x2f')]=_[_0xa262('0x30')](_0x156534[_0xa262('0x2c')],_0x156534['query']);_0x3d5d0c[_0xa262('0x31')]=_[_0xa262('0x30')](_0x156534[_0xa262('0x2c')],qs[_0xa262('0x43')](_0x2917d8[_0xa262('0x2e')]['fields']));_0x3d5d0c[_0xa262('0x31')]=_0x3d5d0c[_0xa262('0x31')]['length']?_0x3d5d0c[_0xa262('0x31')]:_0x156534['model'];_0x3d5d0c['order']=qs['sort'](_0x2917d8['query'][_0xa262('0x35')]);_0x3d5d0c[_0xa262('0x36')]=qs[_0xa262('0x2f')](_['pick'](_0x2917d8['query'],_0x156534['filters']));if(_0x2917d8[_0xa262('0x2e')][_0xa262('0x38')]){_0x3d5d0c[_0xa262('0x36')]=_['merge'](_0x3d5d0c[_0xa262('0x36')],{'$or':_[_0xa262('0x2d')](_0x3d5d0c[_0xa262('0x31')],function(_0x344def){var _0x1c0d09={};_0x1c0d09[_0x344def]={'$like':'%'+_0x2917d8[_0xa262('0x2e')]['filter']+'%'};return _0x1c0d09;})});}_0x3d5d0c=_[_0xa262('0x39')]({},_0x3d5d0c,_0x2917d8[_0xa262('0x3c')]);return _0xb610a7[_0xa262('0x4d')](_0x3d5d0c);}})[_0xa262('0x25')](function(_0x3226f7){if(_0x3226f7){_0x2bdff8=_0x3226f7['length'];if(!_0x2917d8[_0xa262('0x2e')][_0xa262('0x33')](_0xa262('0x4a'))){_0x3d5d0c[_0xa262('0x1b')]=qs[_0xa262('0x1b')](_0x2917d8['query'][_0xa262('0x1b')]);_0x3d5d0c['offset']=qs[_0xa262('0x1d')](_0x2917d8[_0xa262('0x2e')][_0xa262('0x1d')]);}return _0xb610a7['getFields'](_0x3d5d0c);}})[_0xa262('0x25')](function(_0x3679a6){if(_0x3679a6){return _0x3679a6?{'count':_0x2bdff8,'rows':_0x3679a6}:null;}})[_0xa262('0x25')](respondWithResult(_0x3e9ae7,null))[_0xa262('0x3f')](handleError(_0x3e9ae7,null));}; \ No newline at end of file +var _0x5647=['findAll','catch','show','params','length','find','create','body','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','FreshsalesConfiguration','includeAll','include'];(function(_0x450c7f,_0x5e2846){var _0x160143=function(_0xf3d97d){while(--_0xf3d97d){_0x450c7f['push'](_0x450c7f['shift']());}};_0x160143(++_0x5e2846);}(_0x5647,0xf8));var _0x7564=function(_0x32d1a6,_0x19d972){_0x32d1a6=_0x32d1a6-0x0;var _0x54e692=_0x5647[_0x32d1a6];return _0x54e692;};'use strict';var emlformat=require(_0x7564('0x0'));var rimraf=require(_0x7564('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7564('0x2'));var moment=require(_0x7564('0x3'));var BPromise=require(_0x7564('0x4'));var Mustache=require(_0x7564('0x5'));var util=require(_0x7564('0x6'));var path=require('path');var sox=require(_0x7564('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7564('0x8'));var squel=require(_0x7564('0x9'));var crypto=require(_0x7564('0xa'));var jsforce=require(_0x7564('0xb'));var deskjs=require(_0x7564('0xc'));var toCsv=require(_0x7564('0xd'));var querystring=require(_0x7564('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7564('0xf'));var qs=require(_0x7564('0x10'));var as=require(_0x7564('0x11'));var hardwareService=require(_0x7564('0x12'));var logger=require('../../config/logger')(_0x7564('0x13'));var utils=require(_0x7564('0x14'));var config=require(_0x7564('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bf4a4,_0x9b57d9){_0x9b57d9=_0x9b57d9||0xcc;return function(_0x1de694){if(_0x1de694){return _0x3bf4a4['sendStatus'](_0x9b57d9);}return _0x3bf4a4[_0x7564('0x16')](_0x9b57d9)[_0x7564('0x17')]();};}function respondWithResult(_0x7bec7b,_0x4081f5){_0x4081f5=_0x4081f5||0xc8;return function(_0x35c85f){if(_0x35c85f){return _0x7bec7b[_0x7564('0x16')](_0x4081f5)[_0x7564('0x18')](_0x35c85f);}};}function respondWithFilteredResult(_0x4ada86,_0x504e7a){return function(_0x5bc1d8){if(_0x5bc1d8){var _0x37f807=typeof _0x504e7a[_0x7564('0x19')]==='undefined'&&typeof _0x504e7a['limit']===_0x7564('0x1a');var _0x47c5b2=_0x5bc1d8[_0x7564('0x1b')];var _0x20cc2a=_0x37f807?0x0:_0x504e7a[_0x7564('0x19')];var _0x5c206f=_0x37f807?_0x5bc1d8[_0x7564('0x1b')]:_0x504e7a['offset']+_0x504e7a[_0x7564('0x1c')];var _0x563bd0;if(_0x5c206f>=_0x47c5b2){_0x5c206f=_0x47c5b2;_0x563bd0=0xc8;}else{_0x563bd0=0xce;}_0x4ada86['status'](_0x563bd0);return _0x4ada86[_0x7564('0x1d')]('Content-Range',_0x20cc2a+'-'+_0x5c206f+'/'+_0x47c5b2)[_0x7564('0x18')](_0x5bc1d8);}return null;};}function patchUpdates(_0x211f4d){return function(_0x45af42){try{jsonpatch['apply'](_0x45af42,_0x211f4d,!![]);}catch(_0x4db444){return BPromise[_0x7564('0x1e')](_0x4db444);}return _0x45af42[_0x7564('0x1f')]();};}function saveUpdates(_0x5f5b08,_0x80d80f){return function(_0x5c8d27){if(_0x5c8d27){return _0x5c8d27[_0x7564('0x20')](_0x5f5b08)[_0x7564('0x21')](function(_0x4bd575){return _0x4bd575;});}return null;};}function removeEntity(_0x28492b,_0x1396e8){return function(_0x19d1a4){if(_0x19d1a4){return _0x19d1a4[_0x7564('0x22')]()[_0x7564('0x21')](function(){_0x28492b[_0x7564('0x16')](0xcc)[_0x7564('0x17')]();});}};}function handleEntityNotFound(_0x22baeb,_0x5c1a54){return function(_0x57d17d){if(!_0x57d17d){_0x22baeb[_0x7564('0x23')](0x194);}return _0x57d17d;};}function handleError(_0x304807,_0x4c3c8d){_0x4c3c8d=_0x4c3c8d||0x1f4;return function(_0x1e30b8){logger[_0x7564('0x24')](_0x1e30b8[_0x7564('0x25')]);if(_0x1e30b8['name']){delete _0x1e30b8[_0x7564('0x26')];}_0x304807[_0x7564('0x16')](_0x4c3c8d)['send'](_0x1e30b8);};}exports[_0x7564('0x27')]=function(_0x43e86b,_0x1137c5){var _0x4d6bf3={},_0x3cb98b={},_0x21c0a1={'count':0x0,'rows':[]};var _0x4f94ac=_[_0x7564('0x28')](db['FreshsalesConfiguration'][_0x7564('0x29')],function(_0x462dd5){return{'name':_0x462dd5[_0x7564('0x2a')],'type':_0x462dd5[_0x7564('0x2b')][_0x7564('0x2c')]};});_0x3cb98b[_0x7564('0x2d')]=_[_0x7564('0x28')](_0x4f94ac,_0x7564('0x26'));_0x3cb98b[_0x7564('0x2e')]=_[_0x7564('0x2f')](_0x43e86b['query']);_0x3cb98b[_0x7564('0x30')]=_[_0x7564('0x31')](_0x3cb98b[_0x7564('0x2d')],_0x3cb98b[_0x7564('0x2e')]);_0x4d6bf3[_0x7564('0x32')]=_[_0x7564('0x31')](_0x3cb98b[_0x7564('0x2d')],qs[_0x7564('0x33')](_0x43e86b[_0x7564('0x2e')][_0x7564('0x33')]));_0x4d6bf3['attributes']=_0x4d6bf3[_0x7564('0x32')]['length']?_0x4d6bf3[_0x7564('0x32')]:_0x3cb98b[_0x7564('0x2d')];if(!_0x43e86b[_0x7564('0x2e')][_0x7564('0x34')](_0x7564('0x35'))){_0x4d6bf3[_0x7564('0x1c')]=qs[_0x7564('0x1c')](_0x43e86b[_0x7564('0x2e')][_0x7564('0x1c')]);_0x4d6bf3[_0x7564('0x19')]=qs[_0x7564('0x19')](_0x43e86b[_0x7564('0x2e')]['offset']);}_0x4d6bf3[_0x7564('0x36')]=qs[_0x7564('0x37')](_0x43e86b[_0x7564('0x2e')][_0x7564('0x37')]);_0x4d6bf3[_0x7564('0x38')]=qs['filters'](_['pick'](_0x43e86b[_0x7564('0x2e')],_0x3cb98b[_0x7564('0x30')]),_0x4f94ac);if(_0x43e86b[_0x7564('0x2e')]['filter']){_0x4d6bf3[_0x7564('0x38')]=_['merge'](_0x4d6bf3['where'],{'$or':_[_0x7564('0x28')](_0x4f94ac,function(_0x47742a){if(_0x47742a[_0x7564('0x2b')]!==_0x7564('0x39')){var _0x5a5f57={};_0x5a5f57[_0x47742a[_0x7564('0x26')]]={'$like':'%'+_0x43e86b['query'][_0x7564('0x3a')]+'%'};return _0x5a5f57;}})});}_0x4d6bf3=_[_0x7564('0x3b')]({},_0x4d6bf3,_0x43e86b[_0x7564('0x3c')]);var _0x51fb6b={'where':_0x4d6bf3['where']};return db[_0x7564('0x3d')][_0x7564('0x1b')](_0x51fb6b)['then'](function(_0x70525c){_0x21c0a1[_0x7564('0x1b')]=_0x70525c;if(_0x43e86b[_0x7564('0x2e')][_0x7564('0x3e')]){_0x4d6bf3[_0x7564('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x7564('0x40')](_0x4d6bf3);})['then'](function(_0xffa6c){_0x21c0a1['rows']=_0xffa6c;return _0x21c0a1;})['then'](respondWithFilteredResult(_0x1137c5,_0x4d6bf3))[_0x7564('0x41')](handleError(_0x1137c5,null));};exports[_0x7564('0x42')]=function(_0x3e4d6e,_0x542191){var _0x5ac069={'raw':![],'where':{'id':_0x3e4d6e[_0x7564('0x43')]['id']}},_0x1a0ab0={};_0x1a0ab0[_0x7564('0x2d')]=_[_0x7564('0x2f')](db[_0x7564('0x3d')][_0x7564('0x29')]);_0x1a0ab0[_0x7564('0x2e')]=_['keys'](_0x3e4d6e['query']);_0x1a0ab0[_0x7564('0x30')]=_[_0x7564('0x31')](_0x1a0ab0['model'],_0x1a0ab0[_0x7564('0x2e')]);_0x5ac069[_0x7564('0x32')]=_[_0x7564('0x31')](_0x1a0ab0['model'],qs[_0x7564('0x33')](_0x3e4d6e['query'][_0x7564('0x33')]));_0x5ac069[_0x7564('0x32')]=_0x5ac069['attributes'][_0x7564('0x44')]?_0x5ac069[_0x7564('0x32')]:_0x1a0ab0[_0x7564('0x2d')];if(_0x3e4d6e['query']['includeAll']){_0x5ac069[_0x7564('0x3f')]=[{'all':!![]}];}_0x5ac069=_[_0x7564('0x3b')]({},_0x5ac069,_0x3e4d6e[_0x7564('0x3c')]);return db['FreshsalesConfiguration'][_0x7564('0x45')](_0x5ac069)['then'](handleEntityNotFound(_0x542191,null))[_0x7564('0x21')](respondWithResult(_0x542191,null))[_0x7564('0x41')](handleError(_0x542191,null));};exports[_0x7564('0x46')]=function(_0x3427f2,_0x5d7f48){return db[_0x7564('0x3d')]['create'](_0x3427f2[_0x7564('0x47')],{})[_0x7564('0x21')](respondWithResult(_0x5d7f48,0xc9))[_0x7564('0x41')](handleError(_0x5d7f48,null));};exports[_0x7564('0x20')]=function(_0x3f80f0,_0x52d27a){if(_0x3f80f0['body']['id']){delete _0x3f80f0[_0x7564('0x47')]['id'];}return db[_0x7564('0x3d')][_0x7564('0x45')]({'where':{'id':_0x3f80f0['params']['id']}})['then'](handleEntityNotFound(_0x52d27a,null))[_0x7564('0x21')](saveUpdates(_0x3f80f0[_0x7564('0x47')],null))[_0x7564('0x21')](respondWithResult(_0x52d27a,null))[_0x7564('0x41')](handleError(_0x52d27a,null));};exports['destroy']=function(_0x3df222,_0x10c6c7){return db[_0x7564('0x3d')][_0x7564('0x45')]({'where':{'id':_0x3df222['params']['id']}})[_0x7564('0x21')](handleEntityNotFound(_0x10c6c7,null))[_0x7564('0x21')](removeEntity(_0x10c6c7,null))[_0x7564('0x41')](handleError(_0x10c6c7,null));};exports[_0x7564('0x48')]=function(_0x504d81,_0x3b4ea6,_0x3d62a5){var _0xdfc5fd={};var _0x4fa411={};var _0x3f6aaf;var _0x120564;return db[_0x7564('0x3d')][_0x7564('0x49')]({'where':{'id':_0x504d81['params']['id']}})[_0x7564('0x21')](handleEntityNotFound(_0x3b4ea6,null))[_0x7564('0x21')](function(_0x362f00){if(_0x362f00){_0x3f6aaf=_0x362f00;_0x4fa411[_0x7564('0x2d')]=_[_0x7564('0x2f')](db[_0x7564('0x4a')][_0x7564('0x29')]);_0x4fa411[_0x7564('0x2e')]=_['keys'](_0x504d81[_0x7564('0x2e')]);_0x4fa411[_0x7564('0x30')]=_[_0x7564('0x31')](_0x4fa411[_0x7564('0x2d')],_0x4fa411[_0x7564('0x2e')]);_0xdfc5fd[_0x7564('0x32')]=_[_0x7564('0x31')](_0x4fa411[_0x7564('0x2d')],qs[_0x7564('0x33')](_0x504d81['query'][_0x7564('0x33')]));_0xdfc5fd['attributes']=_0xdfc5fd[_0x7564('0x32')][_0x7564('0x44')]?_0xdfc5fd[_0x7564('0x32')]:_0x4fa411[_0x7564('0x2d')];_0xdfc5fd[_0x7564('0x36')]=qs[_0x7564('0x37')](_0x504d81[_0x7564('0x2e')][_0x7564('0x37')]);_0xdfc5fd[_0x7564('0x38')]=qs[_0x7564('0x30')](_[_0x7564('0x4b')](_0x504d81['query'],_0x4fa411['filters']));if(_0x504d81[_0x7564('0x2e')]['filter']){_0xdfc5fd['where']=_[_0x7564('0x3b')](_0xdfc5fd[_0x7564('0x38')],{'$or':_[_0x7564('0x28')](_0xdfc5fd[_0x7564('0x32')],function(_0x180c82){var _0x1f2d40={};_0x1f2d40[_0x180c82]={'$like':'%'+_0x504d81[_0x7564('0x2e')][_0x7564('0x3a')]+'%'};return _0x1f2d40;})});}_0xdfc5fd=_[_0x7564('0x3b')]({},_0xdfc5fd,_0x504d81[_0x7564('0x3c')]);return _0x3f6aaf[_0x7564('0x48')](_0xdfc5fd);}})[_0x7564('0x21')](function(_0x376405){if(_0x376405){_0x120564=_0x376405[_0x7564('0x44')];if(!_0x504d81[_0x7564('0x2e')]['hasOwnProperty'](_0x7564('0x35'))){_0xdfc5fd[_0x7564('0x1c')]=qs['limit'](_0x504d81['query'][_0x7564('0x1c')]);_0xdfc5fd[_0x7564('0x19')]=qs[_0x7564('0x19')](_0x504d81[_0x7564('0x2e')][_0x7564('0x19')]);}return _0x3f6aaf[_0x7564('0x48')](_0xdfc5fd);}})['then'](function(_0x4cc1fa){if(_0x4cc1fa){return _0x4cc1fa?{'count':_0x120564,'rows':_0x4cc1fa}:null;}})[_0x7564('0x21')](respondWithResult(_0x3b4ea6,null))['catch'](handleError(_0x3b4ea6,null));};exports[_0x7564('0x4c')]=function(_0x5070ae,_0x55c4cd,_0x3ca79d){var _0x15c4bf={};var _0x3f8542={};var _0x210a49;var _0x1be0f0;return db[_0x7564('0x3d')][_0x7564('0x49')]({'where':{'id':_0x5070ae[_0x7564('0x43')]['id']}})[_0x7564('0x21')](handleEntityNotFound(_0x55c4cd,null))['then'](function(_0x53f643){if(_0x53f643){_0x210a49=_0x53f643;_0x3f8542['model']=_[_0x7564('0x2f')](db[_0x7564('0x4a')]['rawAttributes']);_0x3f8542['query']=_['keys'](_0x5070ae['query']);_0x3f8542['filters']=_['intersection'](_0x3f8542[_0x7564('0x2d')],_0x3f8542[_0x7564('0x2e')]);_0x15c4bf[_0x7564('0x32')]=_[_0x7564('0x31')](_0x3f8542[_0x7564('0x2d')],qs[_0x7564('0x33')](_0x5070ae['query'][_0x7564('0x33')]));_0x15c4bf[_0x7564('0x32')]=_0x15c4bf['attributes']['length']?_0x15c4bf['attributes']:_0x3f8542['model'];_0x15c4bf[_0x7564('0x36')]=qs[_0x7564('0x37')](_0x5070ae[_0x7564('0x2e')][_0x7564('0x37')]);_0x15c4bf[_0x7564('0x38')]=qs[_0x7564('0x30')](_[_0x7564('0x4b')](_0x5070ae[_0x7564('0x2e')],_0x3f8542[_0x7564('0x30')]));if(_0x5070ae[_0x7564('0x2e')][_0x7564('0x3a')]){_0x15c4bf[_0x7564('0x38')]=_['merge'](_0x15c4bf['where'],{'$or':_[_0x7564('0x28')](_0x15c4bf[_0x7564('0x32')],function(_0x2c1ab3){var _0x1dcb06={};_0x1dcb06[_0x2c1ab3]={'$like':'%'+_0x5070ae[_0x7564('0x2e')]['filter']+'%'};return _0x1dcb06;})});}_0x15c4bf=_[_0x7564('0x3b')]({},_0x15c4bf,_0x5070ae[_0x7564('0x3c')]);return _0x210a49[_0x7564('0x4c')](_0x15c4bf);}})['then'](function(_0x1cd3f2){if(_0x1cd3f2){_0x1be0f0=_0x1cd3f2[_0x7564('0x44')];if(!_0x5070ae[_0x7564('0x2e')]['hasOwnProperty'](_0x7564('0x35'))){_0x15c4bf[_0x7564('0x1c')]=qs[_0x7564('0x1c')](_0x5070ae['query'][_0x7564('0x1c')]);_0x15c4bf[_0x7564('0x19')]=qs[_0x7564('0x19')](_0x5070ae['query'][_0x7564('0x19')]);}return _0x210a49[_0x7564('0x4c')](_0x15c4bf);}})[_0x7564('0x21')](function(_0x373c13){if(_0x373c13){return _0x373c13?{'count':_0x1be0f0,'rows':_0x373c13}:null;}})['then'](respondWithResult(_0x55c4cd,null))['catch'](handleError(_0x55c4cd,null));};exports[_0x7564('0x4d')]=function(_0xf372aa,_0x2ac61a,_0x29804c){var _0xb3607d={};var _0x4eeb03={};var _0x450b54;var _0x485b03;return db['FreshsalesConfiguration'][_0x7564('0x49')]({'where':{'id':_0xf372aa['params']['id']}})[_0x7564('0x21')](handleEntityNotFound(_0x2ac61a,null))[_0x7564('0x21')](function(_0x3531ca){if(_0x3531ca){_0x450b54=_0x3531ca;_0x4eeb03[_0x7564('0x2d')]=_['keys'](db[_0x7564('0x4a')][_0x7564('0x29')]);_0x4eeb03['query']=_[_0x7564('0x2f')](_0xf372aa['query']);_0x4eeb03['filters']=_[_0x7564('0x31')](_0x4eeb03[_0x7564('0x2d')],_0x4eeb03['query']);_0xb3607d[_0x7564('0x32')]=_[_0x7564('0x31')](_0x4eeb03[_0x7564('0x2d')],qs[_0x7564('0x33')](_0xf372aa[_0x7564('0x2e')]['fields']));_0xb3607d[_0x7564('0x32')]=_0xb3607d['attributes'][_0x7564('0x44')]?_0xb3607d[_0x7564('0x32')]:_0x4eeb03[_0x7564('0x2d')];_0xb3607d[_0x7564('0x36')]=qs[_0x7564('0x37')](_0xf372aa[_0x7564('0x2e')][_0x7564('0x37')]);_0xb3607d['where']=qs[_0x7564('0x30')](_[_0x7564('0x4b')](_0xf372aa[_0x7564('0x2e')],_0x4eeb03[_0x7564('0x30')]));if(_0xf372aa[_0x7564('0x2e')][_0x7564('0x3a')]){_0xb3607d[_0x7564('0x38')]=_[_0x7564('0x3b')](_0xb3607d[_0x7564('0x38')],{'$or':_[_0x7564('0x28')](_0xb3607d[_0x7564('0x32')],function(_0x5595b7){var _0x5cb95c={};_0x5cb95c[_0x5595b7]={'$like':'%'+_0xf372aa[_0x7564('0x2e')]['filter']+'%'};return _0x5cb95c;})});}_0xb3607d=_[_0x7564('0x3b')]({},_0xb3607d,_0xf372aa['options']);return _0x450b54[_0x7564('0x4d')](_0xb3607d);}})[_0x7564('0x21')](function(_0x3c49e5){if(_0x3c49e5){_0x485b03=_0x3c49e5[_0x7564('0x44')];if(!_0xf372aa['query'][_0x7564('0x34')](_0x7564('0x35'))){_0xb3607d[_0x7564('0x1c')]=qs[_0x7564('0x1c')](_0xf372aa[_0x7564('0x2e')][_0x7564('0x1c')]);_0xb3607d[_0x7564('0x19')]=qs[_0x7564('0x19')](_0xf372aa[_0x7564('0x2e')][_0x7564('0x19')]);}return _0x450b54[_0x7564('0x4d')](_0xb3607d);}})[_0x7564('0x21')](function(_0x3ebed3){if(_0x3ebed3){return _0x3ebed3?{'count':_0x485b03,'rows':_0x3ebed3}:null;}})[_0x7564('0x21')](respondWithResult(_0x2ac61a,null))[_0x7564('0x41')](handleError(_0x2ac61a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e2077c2..6c32d22 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 _0x01ff=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x507222,_0x3cebc6){var _0x3edbca=function(_0x1f6558){while(--_0x1f6558){_0x507222['push'](_0x507222['shift']());}};_0x3edbca(++_0x3cebc6);}(_0x01ff,0x176));var _0xf01f=function(_0x40a58f,_0xd17f13){_0x40a58f=_0x40a58f-0x0;var _0x596928=_0x01ff[_0x40a58f];return _0x596928;};'use strict';var _=require(_0xf01f('0x0'));var util=require(_0xf01f('0x1'));var logger=require(_0xf01f('0x2'))(_0xf01f('0x3'));var moment=require(_0xf01f('0x4'));var BPromise=require(_0xf01f('0x5'));var rp=require(_0xf01f('0x6'));var fs=require('fs');var path=require(_0xf01f('0x7'));var rimraf=require(_0xf01f('0x8'));var config=require(_0xf01f('0x9'));var attributes=require(_0xf01f('0xa'));module[_0xf01f('0xb')]=function(_0xf9ddbe,_0x316b48){return _0xf9ddbe[_0xf01f('0xc')](_0xf01f('0xd'),attributes,{'tableName':_0xf01f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc30d=['api','rimraf','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','util'];(function(_0x25242b,_0xe3f463){var _0xdd6876=function(_0x18335d){while(--_0x18335d){_0x25242b['push'](_0x25242b['shift']());}};_0xdd6876(++_0xe3f463);}(_0xc30d,0xd8));var _0xdc30=function(_0x20e51b,_0x3e9eb6){_0x20e51b=_0x20e51b-0x0;var _0x4e12a8=_0xc30d[_0x20e51b];return _0x4e12a8;};'use strict';var _=require('lodash');var util=require(_0xdc30('0x0'));var logger=require('../../config/logger')(_0xdc30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdc30('0x2'));var config=require('../../config/environment');var attributes=require(_0xdc30('0x3'));module[_0xdc30('0x4')]=function(_0x2d2da4,_0x165f44){return _0x2d2da4['define'](_0xdc30('0x5'),attributes,{'tableName':_0xdc30('0x6'),'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 2d09421..f8d8b9a 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 _0x59fa=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x59fa,0x74));var _0xa59f=function(_0x1d0cc0,_0x4091f2){_0x1d0cc0=_0x1d0cc0-0x0;var _0xa3fd94=_0x59fa[_0x1d0cc0];return _0xa3fd94;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa59f('0x0'));var rs=require(_0xa59f('0x1'));var fs=require('fs');var Redis=require(_0xa59f('0x2'));var db=require(_0xa59f('0x3'))['db'];var utils=require(_0xa59f('0x4'));var logger=require(_0xa59f('0x5'))(_0xa59f('0x6'));var config=require('../../config/environment');var jayson=require(_0xa59f('0x7'));var client=jayson[_0xa59f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37e7e9,_0x239c51,_0x6647f8){return new BPromise(function(_0x276c24,_0x307b4f){return client[_0xa59f('0x9')](_0x37e7e9,_0x6647f8)['then'](function(_0x3122e6){logger[_0xa59f('0xa')](_0xa59f('0xb'),_0x239c51,'request\x20sent');logger[_0xa59f('0xc')](_0xa59f('0xd'),_0x239c51,_0xa59f('0xe'),JSON['stringify'](_0x3122e6));if(_0x3122e6['error']){if(_0x3122e6[_0xa59f('0xf')][_0xa59f('0x10')]===0x1f4){logger[_0xa59f('0xf')](_0xa59f('0xb'),_0x239c51,_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);return _0x307b4f(_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);}logger[_0xa59f('0xf')](_0xa59f('0xb'),_0x239c51,_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);return _0x276c24(_0x3122e6[_0xa59f('0xf')][_0xa59f('0x11')]);}else{logger['info'](_0xa59f('0xb'),_0x239c51,_0xa59f('0xe'));_0x276c24(_0x3122e6[_0xa59f('0x12')][_0xa59f('0x11')]);}})[_0xa59f('0x13')](function(_0x5db3fe){logger[_0xa59f('0xf')](_0xa59f('0xb'),_0x239c51,_0x5db3fe);_0x307b4f(_0x5db3fe);});});} \ No newline at end of file +var _0x2865=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info'];(function(_0xd2b809,_0x5efcb5){var _0x388d37=function(_0x3397c6){while(--_0x3397c6){_0xd2b809['push'](_0xd2b809['shift']());}};_0x388d37(++_0x5efcb5);}(_0x2865,0x1d5));var _0x5286=function(_0x2cd8ec,_0x5f2f9c){_0x2cd8ec=_0x2cd8ec-0x0;var _0x370f68=_0x2865[_0x2cd8ec];return _0x370f68;};'use strict';var _=require(_0x5286('0x0'));var util=require(_0x5286('0x1'));var moment=require(_0x5286('0x2'));var BPromise=require(_0x5286('0x3'));var rs=require(_0x5286('0x4'));var fs=require('fs');var Redis=require(_0x5286('0x5'));var db=require(_0x5286('0x6'))['db'];var utils=require(_0x5286('0x7'));var logger=require(_0x5286('0x8'))(_0x5286('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5286('0xa')][_0x5286('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x597812,_0x368628,_0x1cb9ee){return new BPromise(function(_0x2ff48b,_0xdd662a){return client[_0x5286('0xc')](_0x597812,_0x1cb9ee)['then'](function(_0x569670){logger[_0x5286('0xd')](_0x5286('0xe'),_0x368628,_0x5286('0xf'));logger[_0x5286('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x368628,_0x5286('0xf'),JSON[_0x5286('0x11')](_0x569670));if(_0x569670[_0x5286('0x12')]){if(_0x569670[_0x5286('0x12')][_0x5286('0x13')]===0x1f4){logger[_0x5286('0x12')](_0x5286('0xe'),_0x368628,_0x569670['error']['message']);return _0xdd662a(_0x569670['error'][_0x5286('0x14')]);}logger['error'](_0x5286('0xe'),_0x368628,_0x569670[_0x5286('0x12')][_0x5286('0x14')]);return _0x2ff48b(_0x569670[_0x5286('0x12')][_0x5286('0x14')]);}else{logger[_0x5286('0xd')](_0x5286('0xe'),_0x368628,_0x5286('0xf'));_0x2ff48b(_0x569670[_0x5286('0x15')][_0x5286('0x14')]);}})[_0x5286('0x16')](function(_0xac3624){logger[_0x5286('0x12')](_0x5286('0xe'),_0x368628,_0xac3624);_0xdd662a(_0xac3624);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ebc75c3..bcc737c 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 _0xbbb8=['/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','create','put'];(function(_0x33824d,_0x5b5148){var _0xf3d06b=function(_0x19b333){while(--_0x19b333){_0x33824d['push'](_0x33824d['shift']());}};_0xf3d06b(++_0x5b5148);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x128b37,_0x2f8599){_0x128b37=_0x128b37-0x0;var _0x4d11d6=_0xbbb8[_0x128b37];return _0x4d11d6;};'use strict';var multer=require(_0x8bbb('0x0'));var util=require(_0x8bbb('0x1'));var path=require('path');var timeout=require(_0x8bbb('0x2'));var express=require(_0x8bbb('0x3'));var router=express['Router']();var fs_extra=require(_0x8bbb('0x4'));var auth=require(_0x8bbb('0x5'));var interaction=require(_0x8bbb('0x6'));var config=require(_0x8bbb('0x7'));var controller=require(_0x8bbb('0x8'));router[_0x8bbb('0x9')]('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xb')]);router[_0x8bbb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8bbb('0xc')]('/',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0xd')]);router[_0x8bbb('0xe')](_0x8bbb('0xf'),auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x10')]);router[_0x8bbb('0x11')]('/:id',auth[_0x8bbb('0xa')](),controller[_0x8bbb('0x12')]);module[_0x8bbb('0x13')]=router; \ No newline at end of file +var _0x49e9=['util','connect-timeout','express','Router','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x5111e8,_0x1a8bbd){var _0x42d532=function(_0x3cc677){while(--_0x3cc677){_0x5111e8['push'](_0x5111e8['shift']());}};_0x42d532(++_0x1a8bbd);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var path=require('path');var timeout=require(_0x949e('0x2'));var express=require(_0x949e('0x3'));var router=express[_0x949e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x949e('0x5'));var config=require('../../config/environment');var controller=require(_0x949e('0x6'));router[_0x949e('0x7')]('/',auth[_0x949e('0x8')](),controller['index']);router[_0x949e('0x7')](_0x949e('0x9'),auth[_0x949e('0x8')](),controller[_0x949e('0xa')]);router[_0x949e('0xb')]('/',auth[_0x949e('0x8')](),controller[_0x949e('0xc')]);router['put'](_0x949e('0x9'),auth['isAuthenticated'](),controller[_0x949e('0xd')]);router[_0x949e('0xe')](_0x949e('0x9'),auth['isAuthenticated'](),controller[_0x949e('0xf')]);module[_0x949e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 3cacff0..cf55ba0 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 _0xab1c=['exports','ENUM','variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize'];(function(_0x58e92d,_0x1181bd){var _0x45d179=function(_0xf162a4){while(--_0xf162a4){_0x58e92d['push'](_0x58e92d['shift']());}};_0x45d179(++_0x1181bd);}(_0xab1c,0x104));var _0xcab1=function(_0x227e83,_0x217eb5){_0x227e83=_0x227e83-0x0;var _0x575c66=_0xab1c[_0x227e83];return _0x575c66;};'use strict';var Sequelize=require(_0xcab1('0x0'));module[_0xcab1('0x1')]={'type':{'type':Sequelize[_0xcab1('0x2')]('string',_0xcab1('0x3'),_0xcab1('0x4'),_0xcab1('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xcab1('0x6')]},'key':{'type':Sequelize[_0xcab1('0x6')]},'keyType':{'type':Sequelize[_0xcab1('0x2')](_0xcab1('0x7'),_0xcab1('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xcab1('0x6')]},'idField':{'type':Sequelize[_0xcab1('0x6')]},'nameField':{'type':Sequelize[_0xcab1('0x6')]},'customField':{'type':Sequelize[_0xcab1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcab1('0x6')]}}; \ No newline at end of file +var _0xe165=['sequelize','exports','ENUM','string','variable','picklist','STRING','customVariable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe165,0x148));var _0x5e16=function(_0xc9d833,_0x259d69){_0xc9d833=_0xc9d833-0x0;var _0x24c2e3=_0xe165[_0xc9d833];return _0x24c2e3;};'use strict';var Sequelize=require(_0x5e16('0x0'));module[_0x5e16('0x1')]={'type':{'type':Sequelize[_0x5e16('0x2')](_0x5e16('0x3'),_0x5e16('0x4'),'customVariable','keyValue',_0x5e16('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5e16('0x6')]},'key':{'type':Sequelize[_0x5e16('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x5e16('0x4'),_0x5e16('0x7'))},'keyContent':{'type':Sequelize[_0x5e16('0x6')]},'idField':{'type':Sequelize[_0x5e16('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 7269e61..6bebfb6 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 _0x903d=['reject','save','then','destroy','sendStatus','error','name','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply'];(function(_0x34a6e9,_0x25cabe){var _0x11015c=function(_0x5c2ced){while(--_0x5c2ced){_0x34a6e9['push'](_0x34a6e9['shift']());}};_0x11015c(++_0x25cabe);}(_0x903d,0xba));var _0xd903=function(_0x2ab2ed,_0x1fd241){_0x2ab2ed=_0x2ab2ed-0x0;var _0x24d4d1=_0x903d[_0x2ab2ed];return _0x24d4d1;};'use strict';var emlformat=require(_0xd903('0x0'));var rimraf=require(_0xd903('0x1'));var zipdir=require(_0xd903('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd903('0x3'));var moment=require('moment');var BPromise=require(_0xd903('0x4'));var Mustache=require(_0xd903('0x5'));var util=require(_0xd903('0x6'));var path=require(_0xd903('0x7'));var sox=require('sox');var csv=require(_0xd903('0x8'));var ejs=require(_0xd903('0x9'));var fs=require('fs');var fs_extra=require(_0xd903('0xa'));var _=require(_0xd903('0xb'));var squel=require(_0xd903('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd903('0x8'));var querystring=require(_0xd903('0xd'));var Papa=require('papaparse');var Redis=require(_0xd903('0xe'));var authService=require(_0xd903('0xf'));var qs=require(_0xd903('0x10'));var as=require(_0xd903('0x11'));var hardwareService=require(_0xd903('0x12'));var logger=require(_0xd903('0x13'))(_0xd903('0x14'));var utils=require(_0xd903('0x15'));var config=require(_0xd903('0x16'));var licenseUtil=require(_0xd903('0x17'));var db=require(_0xd903('0x18'))['db'];function respondWithStatusCode(_0x382277,_0x1d18da){_0x1d18da=_0x1d18da||0xcc;return function(_0x34d5c1){if(_0x34d5c1){return _0x382277['sendStatus'](_0x1d18da);}return _0x382277[_0xd903('0x19')](_0x1d18da)[_0xd903('0x1a')]();};}function respondWithResult(_0x2a653a,_0x17804e){_0x17804e=_0x17804e||0xc8;return function(_0x43685a){if(_0x43685a){return _0x2a653a['status'](_0x17804e)[_0xd903('0x1b')](_0x43685a);}};}function respondWithFilteredResult(_0x998801,_0x277e23){return function(_0x87abad){if(_0x87abad){var _0x10dfe3=typeof _0x277e23[_0xd903('0x1c')]==='undefined'&&typeof _0x277e23[_0xd903('0x1d')]===_0xd903('0x1e');var _0x5d5202=_0x87abad[_0xd903('0x1f')];var _0x2cecfe=_0x10dfe3?0x0:_0x277e23[_0xd903('0x1c')];var _0x466e27=_0x10dfe3?_0x87abad[_0xd903('0x1f')]:_0x277e23['offset']+_0x277e23['limit'];var _0x15f35d;if(_0x466e27>=_0x5d5202){_0x466e27=_0x5d5202;_0x15f35d=0xc8;}else{_0x15f35d=0xce;}_0x998801[_0xd903('0x19')](_0x15f35d);return _0x998801['set']('Content-Range',_0x2cecfe+'-'+_0x466e27+'/'+_0x5d5202)[_0xd903('0x1b')](_0x87abad);}return null;};}function patchUpdates(_0x2807fd){return function(_0x50c238){try{jsonpatch[_0xd903('0x20')](_0x50c238,_0x2807fd,!![]);}catch(_0x3e53ed){return BPromise[_0xd903('0x21')](_0x3e53ed);}return _0x50c238[_0xd903('0x22')]();};}function saveUpdates(_0x197498,_0x5bb35e){return function(_0xf94177){if(_0xf94177){return _0xf94177['update'](_0x197498)[_0xd903('0x23')](function(_0x18a065){return _0x18a065;});}return null;};}function removeEntity(_0x16b37c,_0x222239){return function(_0x151936){if(_0x151936){return _0x151936[_0xd903('0x24')]()['then'](function(){_0x16b37c[_0xd903('0x19')](0xcc)[_0xd903('0x1a')]();});}};}function handleEntityNotFound(_0x44055f,_0x4e3468){return function(_0x45a278){if(!_0x45a278){_0x44055f[_0xd903('0x25')](0x194);}return _0x45a278;};}function handleError(_0x27e126,_0x4c6635){_0x4c6635=_0x4c6635||0x1f4;return function(_0x3e23d0){logger[_0xd903('0x26')](_0x3e23d0['stack']);if(_0x3e23d0[_0xd903('0x27')]){delete _0x3e23d0['name'];}_0x27e126[_0xd903('0x19')](_0x4c6635)['send'](_0x3e23d0);};}exports['index']=function(_0x4c0d42,_0x21bbfd){var _0x4b5a97={},_0x3cf74c={},_0x1f528f={'count':0x0,'rows':[]};var _0x1194ba=_[_0xd903('0x28')](db[_0xd903('0x29')][_0xd903('0x2a')],function(_0x23cb02){return{'name':_0x23cb02[_0xd903('0x2b')],'type':_0x23cb02[_0xd903('0x2c')]['key']};});_0x3cf74c[_0xd903('0x2d')]=_[_0xd903('0x28')](_0x1194ba,_0xd903('0x27'));_0x3cf74c[_0xd903('0x2e')]=_[_0xd903('0x2f')](_0x4c0d42['query']);_0x3cf74c[_0xd903('0x30')]=_[_0xd903('0x31')](_0x3cf74c['model'],_0x3cf74c[_0xd903('0x2e')]);_0x4b5a97[_0xd903('0x32')]=_[_0xd903('0x31')](_0x3cf74c['model'],qs['fields'](_0x4c0d42[_0xd903('0x2e')][_0xd903('0x33')]));_0x4b5a97[_0xd903('0x32')]=_0x4b5a97[_0xd903('0x32')][_0xd903('0x34')]?_0x4b5a97[_0xd903('0x32')]:_0x3cf74c[_0xd903('0x2d')];if(!_0x4c0d42[_0xd903('0x2e')][_0xd903('0x35')]('nolimit')){_0x4b5a97['limit']=qs[_0xd903('0x1d')](_0x4c0d42[_0xd903('0x2e')]['limit']);_0x4b5a97['offset']=qs[_0xd903('0x1c')](_0x4c0d42[_0xd903('0x2e')][_0xd903('0x1c')]);}_0x4b5a97[_0xd903('0x36')]=qs[_0xd903('0x37')](_0x4c0d42['query'][_0xd903('0x37')]);_0x4b5a97[_0xd903('0x38')]=qs[_0xd903('0x30')](_[_0xd903('0x39')](_0x4c0d42['query'],_0x3cf74c['filters']),_0x1194ba);if(_0x4c0d42[_0xd903('0x2e')][_0xd903('0x3a')]){_0x4b5a97[_0xd903('0x38')]=_[_0xd903('0x3b')](_0x4b5a97[_0xd903('0x38')],{'$or':_[_0xd903('0x28')](_0x1194ba,function(_0x1fcb4a){if(_0x1fcb4a['type']!==_0xd903('0x3c')){var _0x2f18fd={};_0x2f18fd[_0x1fcb4a[_0xd903('0x27')]]={'$like':'%'+_0x4c0d42[_0xd903('0x2e')]['filter']+'%'};return _0x2f18fd;}})});}_0x4b5a97=_[_0xd903('0x3b')]({},_0x4b5a97,_0x4c0d42[_0xd903('0x3d')]);var _0x13aeb4={'where':_0x4b5a97['where']};return db['FreshsalesField']['count'](_0x13aeb4)['then'](function(_0x539f6c){_0x1f528f[_0xd903('0x1f')]=_0x539f6c;if(_0x4c0d42[_0xd903('0x2e')][_0xd903('0x3e')]){_0x4b5a97['include']=[{'all':!![]}];}return db[_0xd903('0x29')][_0xd903('0x3f')](_0x4b5a97);})[_0xd903('0x23')](function(_0x27a0dd){_0x1f528f[_0xd903('0x40')]=_0x27a0dd;return _0x1f528f;})[_0xd903('0x23')](respondWithFilteredResult(_0x21bbfd,_0x4b5a97))['catch'](handleError(_0x21bbfd,null));};exports[_0xd903('0x41')]=function(_0x46d928,_0x285bac){var _0x2c6dff={'raw':!![],'where':{'id':_0x46d928[_0xd903('0x42')]['id']}},_0x42cde4={};_0x42cde4[_0xd903('0x2d')]=_[_0xd903('0x2f')](db[_0xd903('0x29')]['rawAttributes']);_0x42cde4['query']=_[_0xd903('0x2f')](_0x46d928[_0xd903('0x2e')]);_0x42cde4[_0xd903('0x30')]=_[_0xd903('0x31')](_0x42cde4[_0xd903('0x2d')],_0x42cde4[_0xd903('0x2e')]);_0x2c6dff[_0xd903('0x32')]=_[_0xd903('0x31')](_0x42cde4[_0xd903('0x2d')],qs[_0xd903('0x33')](_0x46d928[_0xd903('0x2e')][_0xd903('0x33')]));_0x2c6dff[_0xd903('0x32')]=_0x2c6dff[_0xd903('0x32')][_0xd903('0x34')]?_0x2c6dff[_0xd903('0x32')]:_0x42cde4['model'];if(_0x46d928[_0xd903('0x2e')][_0xd903('0x3e')]){_0x2c6dff[_0xd903('0x43')]=[{'all':!![]}];}_0x2c6dff=_[_0xd903('0x3b')]({},_0x2c6dff,_0x46d928['options']);return db[_0xd903('0x29')][_0xd903('0x44')](_0x2c6dff)['then'](handleEntityNotFound(_0x285bac,null))['then'](respondWithResult(_0x285bac,null))[_0xd903('0x45')](handleError(_0x285bac,null));};exports[_0xd903('0x46')]=function(_0x1b16d0,_0x17373a){return db[_0xd903('0x29')]['create'](_0x1b16d0[_0xd903('0x47')],{})['then'](respondWithResult(_0x17373a,0xc9))['catch'](handleError(_0x17373a,null));};exports[_0xd903('0x48')]=function(_0x3458c7,_0x402ee4){if(_0x3458c7[_0xd903('0x47')]['id']){delete _0x3458c7[_0xd903('0x47')]['id'];}return db[_0xd903('0x29')]['find']({'where':{'id':_0x3458c7[_0xd903('0x42')]['id']}})[_0xd903('0x23')](handleEntityNotFound(_0x402ee4,null))[_0xd903('0x23')](saveUpdates(_0x3458c7[_0xd903('0x47')],null))[_0xd903('0x23')](respondWithResult(_0x402ee4,null))['catch'](handleError(_0x402ee4,null));};exports[_0xd903('0x24')]=function(_0x3ccd8f,_0x4ec309){return db[_0xd903('0x29')]['find']({'where':{'id':_0x3ccd8f[_0xd903('0x42')]['id']}})[_0xd903('0x23')](handleEntityNotFound(_0x4ec309,null))[_0xd903('0x23')](removeEntity(_0x4ec309,null))[_0xd903('0x45')](handleError(_0x4ec309,null));}; \ No newline at end of file +var _0x06ac=['show','params','length','create','body','find','zip-dir','fast-json-patch','bluebird','mustache','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','status','end','json','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4619a7,_0x4239cd){var _0x46afbb=function(_0x4a46b7){while(--_0x4a46b7){_0x4619a7['push'](_0x4619a7['shift']());}};_0x46afbb(++_0x4239cd);}(_0x06ac,0x17d));var _0xc06a=function(_0x3a781b,_0x19f452){_0x3a781b=_0x3a781b-0x0;var _0x3a7770=_0x06ac[_0x3a781b];return _0x3a7770;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc06a('0x0'));var jsonpatch=require(_0xc06a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc06a('0x2'));var Mustache=require(_0xc06a('0x3'));var util=require('util');var path=require(_0xc06a('0x4'));var sox=require(_0xc06a('0x5'));var csv=require(_0xc06a('0x6'));var ejs=require(_0xc06a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc06a('0x8'));var squel=require(_0xc06a('0x9'));var crypto=require(_0xc06a('0xa'));var jsforce=require(_0xc06a('0xb'));var deskjs=require(_0xc06a('0xc'));var toCsv=require(_0xc06a('0x6'));var querystring=require(_0xc06a('0xd'));var Papa=require(_0xc06a('0xe'));var Redis=require(_0xc06a('0xf'));var authService=require(_0xc06a('0x10'));var qs=require(_0xc06a('0x11'));var as=require(_0xc06a('0x12'));var hardwareService=require(_0xc06a('0x13'));var logger=require(_0xc06a('0x14'))(_0xc06a('0x15'));var utils=require(_0xc06a('0x16'));var config=require(_0xc06a('0x17'));var licenseUtil=require(_0xc06a('0x18'));var db=require(_0xc06a('0x19'))['db'];function respondWithStatusCode(_0x8c5b9,_0x705a84){_0x705a84=_0x705a84||0xcc;return function(_0x32fd54){if(_0x32fd54){return _0x8c5b9['sendStatus'](_0x705a84);}return _0x8c5b9[_0xc06a('0x1a')](_0x705a84)[_0xc06a('0x1b')]();};}function respondWithResult(_0x4539f1,_0x9d822c){_0x9d822c=_0x9d822c||0xc8;return function(_0x310976){if(_0x310976){return _0x4539f1[_0xc06a('0x1a')](_0x9d822c)[_0xc06a('0x1c')](_0x310976);}};}function respondWithFilteredResult(_0x2fa6ca,_0x1ee5ba){return function(_0x17c776){if(_0x17c776){var _0x582135=typeof _0x1ee5ba['offset']===_0xc06a('0x1d')&&typeof _0x1ee5ba[_0xc06a('0x1e')]===_0xc06a('0x1d');var _0x449ccc=_0x17c776[_0xc06a('0x1f')];var _0x4834b0=_0x582135?0x0:_0x1ee5ba['offset'];var _0x50a7e6=_0x582135?_0x17c776[_0xc06a('0x1f')]:_0x1ee5ba['offset']+_0x1ee5ba[_0xc06a('0x1e')];var _0xfdb9b;if(_0x50a7e6>=_0x449ccc){_0x50a7e6=_0x449ccc;_0xfdb9b=0xc8;}else{_0xfdb9b=0xce;}_0x2fa6ca[_0xc06a('0x1a')](_0xfdb9b);return _0x2fa6ca[_0xc06a('0x20')](_0xc06a('0x21'),_0x4834b0+'-'+_0x50a7e6+'/'+_0x449ccc)[_0xc06a('0x1c')](_0x17c776);}return null;};}function patchUpdates(_0x19ad99){return function(_0x5264d2){try{jsonpatch['apply'](_0x5264d2,_0x19ad99,!![]);}catch(_0x334528){return BPromise['reject'](_0x334528);}return _0x5264d2['save']();};}function saveUpdates(_0x1f6d97,_0x5415c5){return function(_0x2668a){if(_0x2668a){return _0x2668a[_0xc06a('0x22')](_0x1f6d97)[_0xc06a('0x23')](function(_0x14ba92){return _0x14ba92;});}return null;};}function removeEntity(_0x1fec39,_0x349ccb){return function(_0x135646){if(_0x135646){return _0x135646[_0xc06a('0x24')]()[_0xc06a('0x23')](function(){_0x1fec39[_0xc06a('0x1a')](0xcc)[_0xc06a('0x1b')]();});}};}function handleEntityNotFound(_0x2030ef,_0x3d9557){return function(_0x5d77b9){if(!_0x5d77b9){_0x2030ef[_0xc06a('0x25')](0x194);}return _0x5d77b9;};}function handleError(_0x487dde,_0x4f09df){_0x4f09df=_0x4f09df||0x1f4;return function(_0x3c23c4){logger['error'](_0x3c23c4[_0xc06a('0x26')]);if(_0x3c23c4['name']){delete _0x3c23c4[_0xc06a('0x27')];}_0x487dde['status'](_0x4f09df)[_0xc06a('0x28')](_0x3c23c4);};}exports[_0xc06a('0x29')]=function(_0x38997b,_0x2f5c32){var _0xa554de={},_0x344991={},_0x58f3d3={'count':0x0,'rows':[]};var _0xafe8fd=_['map'](db[_0xc06a('0x2a')][_0xc06a('0x2b')],function(_0x4b53b1){return{'name':_0x4b53b1[_0xc06a('0x2c')],'type':_0x4b53b1[_0xc06a('0x2d')][_0xc06a('0x2e')]};});_0x344991['model']=_[_0xc06a('0x2f')](_0xafe8fd,_0xc06a('0x27'));_0x344991[_0xc06a('0x30')]=_[_0xc06a('0x31')](_0x38997b[_0xc06a('0x30')]);_0x344991[_0xc06a('0x32')]=_['intersection'](_0x344991[_0xc06a('0x33')],_0x344991[_0xc06a('0x30')]);_0xa554de[_0xc06a('0x34')]=_[_0xc06a('0x35')](_0x344991[_0xc06a('0x33')],qs[_0xc06a('0x36')](_0x38997b[_0xc06a('0x30')][_0xc06a('0x36')]));_0xa554de[_0xc06a('0x34')]=_0xa554de[_0xc06a('0x34')]['length']?_0xa554de[_0xc06a('0x34')]:_0x344991[_0xc06a('0x33')];if(!_0x38997b[_0xc06a('0x30')][_0xc06a('0x37')]('nolimit')){_0xa554de['limit']=qs[_0xc06a('0x1e')](_0x38997b[_0xc06a('0x30')]['limit']);_0xa554de['offset']=qs[_0xc06a('0x38')](_0x38997b[_0xc06a('0x30')][_0xc06a('0x38')]);}_0xa554de[_0xc06a('0x39')]=qs[_0xc06a('0x3a')](_0x38997b['query'][_0xc06a('0x3a')]);_0xa554de[_0xc06a('0x3b')]=qs[_0xc06a('0x32')](_[_0xc06a('0x3c')](_0x38997b[_0xc06a('0x30')],_0x344991[_0xc06a('0x32')]),_0xafe8fd);if(_0x38997b[_0xc06a('0x30')][_0xc06a('0x3d')]){_0xa554de[_0xc06a('0x3b')]=_[_0xc06a('0x3e')](_0xa554de[_0xc06a('0x3b')],{'$or':_['map'](_0xafe8fd,function(_0xdf13eb){if(_0xdf13eb['type']!==_0xc06a('0x3f')){var _0x2f8d42={};_0x2f8d42[_0xdf13eb[_0xc06a('0x27')]]={'$like':'%'+_0x38997b['query'][_0xc06a('0x3d')]+'%'};return _0x2f8d42;}})});}_0xa554de=_[_0xc06a('0x3e')]({},_0xa554de,_0x38997b[_0xc06a('0x40')]);var _0x85e7f={'where':_0xa554de[_0xc06a('0x3b')]};return db[_0xc06a('0x2a')][_0xc06a('0x1f')](_0x85e7f)[_0xc06a('0x23')](function(_0x392a75){_0x58f3d3[_0xc06a('0x1f')]=_0x392a75;if(_0x38997b[_0xc06a('0x30')][_0xc06a('0x41')]){_0xa554de[_0xc06a('0x42')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0xa554de);})['then'](function(_0x7b3bef){_0x58f3d3[_0xc06a('0x43')]=_0x7b3bef;return _0x58f3d3;})[_0xc06a('0x23')](respondWithFilteredResult(_0x2f5c32,_0xa554de))[_0xc06a('0x44')](handleError(_0x2f5c32,null));};exports[_0xc06a('0x45')]=function(_0x39c62c,_0x298eb5){var _0x4af8a4={'raw':!![],'where':{'id':_0x39c62c[_0xc06a('0x46')]['id']}},_0xb6574={};_0xb6574[_0xc06a('0x33')]=_['keys'](db[_0xc06a('0x2a')]['rawAttributes']);_0xb6574[_0xc06a('0x30')]=_[_0xc06a('0x31')](_0x39c62c[_0xc06a('0x30')]);_0xb6574[_0xc06a('0x32')]=_[_0xc06a('0x35')](_0xb6574[_0xc06a('0x33')],_0xb6574[_0xc06a('0x30')]);_0x4af8a4[_0xc06a('0x34')]=_[_0xc06a('0x35')](_0xb6574['model'],qs[_0xc06a('0x36')](_0x39c62c[_0xc06a('0x30')][_0xc06a('0x36')]));_0x4af8a4[_0xc06a('0x34')]=_0x4af8a4[_0xc06a('0x34')][_0xc06a('0x47')]?_0x4af8a4[_0xc06a('0x34')]:_0xb6574['model'];if(_0x39c62c['query'][_0xc06a('0x41')]){_0x4af8a4['include']=[{'all':!![]}];}_0x4af8a4=_['merge']({},_0x4af8a4,_0x39c62c[_0xc06a('0x40')]);return db[_0xc06a('0x2a')]['find'](_0x4af8a4)[_0xc06a('0x23')](handleEntityNotFound(_0x298eb5,null))['then'](respondWithResult(_0x298eb5,null))['catch'](handleError(_0x298eb5,null));};exports[_0xc06a('0x48')]=function(_0x174f9e,_0x35bafb){return db[_0xc06a('0x2a')][_0xc06a('0x48')](_0x174f9e[_0xc06a('0x49')],{})['then'](respondWithResult(_0x35bafb,0xc9))[_0xc06a('0x44')](handleError(_0x35bafb,null));};exports[_0xc06a('0x22')]=function(_0x253c01,_0x385429){if(_0x253c01['body']['id']){delete _0x253c01[_0xc06a('0x49')]['id'];}return db[_0xc06a('0x2a')][_0xc06a('0x4a')]({'where':{'id':_0x253c01['params']['id']}})[_0xc06a('0x23')](handleEntityNotFound(_0x385429,null))[_0xc06a('0x23')](saveUpdates(_0x253c01['body'],null))[_0xc06a('0x23')](respondWithResult(_0x385429,null))[_0xc06a('0x44')](handleError(_0x385429,null));};exports['destroy']=function(_0x24b50e,_0x518582){return db[_0xc06a('0x2a')][_0xc06a('0x4a')]({'where':{'id':_0x24b50e[_0xc06a('0x46')]['id']}})[_0xc06a('0x23')](handleEntityNotFound(_0x518582,null))[_0xc06a('0x23')](removeEntity(_0x518582,null))[_0xc06a('0x44')](handleError(_0x518582,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 01cc841..b8b9e3b 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 _0xdec3=['moment','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','../../config/logger','api'];(function(_0x3c59b5,_0x40975c){var _0x40a8a1=function(_0x2c38c8){while(--_0x2c38c8){_0x3c59b5['push'](_0x3c59b5['shift']());}};_0x40a8a1(++_0x40975c);}(_0xdec3,0x89));var _0x3dec=function(_0xbddf5d,_0x442a60){_0xbddf5d=_0xbddf5d-0x0;var _0x227959=_0xdec3[_0xbddf5d];return _0x227959;};'use strict';var _=require(_0x3dec('0x0'));var util=require('util');var logger=require(_0x3dec('0x1'))(_0x3dec('0x2'));var moment=require(_0x3dec('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dec('0x4'));var fs=require('fs');var path=require(_0x3dec('0x5'));var rimraf=require(_0x3dec('0x6'));var config=require(_0x3dec('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x3dec('0x8')]=function(_0x2894eb,_0x347c06){return _0x2894eb[_0x3dec('0x9')](_0x3dec('0xa'),attributes,{'tableName':_0x3dec('0xb'),'paranoid':![],'indexes':[{'name':_0x3dec('0xc'),'fields':['idField',_0x3dec('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa057=['define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','./intFreshsalesField.attributes'];(function(_0x209302,_0x5826ac){var _0x1df8e9=function(_0x16ae49){while(--_0x16ae49){_0x209302['push'](_0x209302['shift']());}};_0x1df8e9(++_0x5826ac);}(_0xa057,0x123));var _0x7a05=function(_0x311364,_0x2a73eb){_0x311364=_0x311364-0x0;var _0x45c61c=_0xa057[_0x311364];return _0x45c61c;};'use strict';var _=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var logger=require('../../config/logger')(_0x7a05('0x2'));var moment=require(_0x7a05('0x3'));var BPromise=require(_0x7a05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a05('0x5'));var rimraf=require(_0x7a05('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a05('0x7'));module['exports']=function(_0x599a35,_0x1f3b61){return _0x599a35[_0x7a05('0x8')](_0x7a05('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x7a05('0xa'),'fields':[_0x7a05('0xb'),_0x7a05('0xc')],'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 83cce6f..8f60a95 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 _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x33aa8c,_0x156a5a){var _0x4d8f8=function(_0x5291c4){while(--_0x5291c4){_0x33aa8c['push'](_0x33aa8c['shift']());}};_0x4d8f8(++_0x156a5a);}(_0x5496,0x175));var _0x6549=function(_0x1169f5,_0x3794b8){_0x1169f5=_0x1169f5-0x0;var _0x4e9153=_0x5496[_0x1169f5];return _0x4e9153;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});} \ No newline at end of file +var _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x44f8bf,_0x372ed7){var _0x381866=function(_0x49c472){while(--_0x49c472){_0x44f8bf['push'](_0x44f8bf['shift']());}};_0x381866(++_0x372ed7);}(_0xeff8,0x186));var _0x8eff=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xeff8[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b2e05ff..ebc15da 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4eb657,_0x2e9d9e){var _0x48cbbb=function(_0x3a4688){while(--_0x3a4688){_0x4eb657['push'](_0x4eb657['shift']());}};_0x48cbbb(++_0x2e9d9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _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(_0x19b082,_0x4749a9){var _0x34bb24=function(_0x4405b5){while(--_0x4405b5){_0x19b082['push'](_0x19b082['shift']());}};_0x34bb24(++_0x4749a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 e2cad23..266af37 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 _0x7510=['newTab','exports','STRING','username'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x7510,0xa9));var _0x0751=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7510[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0751('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0751('0x1')]},'username':{'type':Sequelize[_0x0751('0x1')],'unique':_0x0751('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0751('0x1')]},'clientId':{'type':Sequelize[_0x0751('0x1')]},'clientSecret':{'type':Sequelize[_0x0751('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x0751('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xd664=['STRING','ENUM','newTab','integrationTab','sequelize','exports','username'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd664,0xa5));var _0x4d66=function(_0x17088c,_0x526388){_0x17088c=_0x17088c-0x0;var _0x9fb2dc=_0xd664[_0x17088c];return _0x9fb2dc;};'use strict';var Sequelize=require(_0x4d66('0x0'));module[_0x4d66('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x4d66('0x2')},'remoteUri':{'type':Sequelize[_0x4d66('0x3')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x4d66('0x3')]},'clientSecret':{'type':Sequelize[_0x4d66('0x3')]},'securityToken':{'type':Sequelize[_0x4d66('0x3')]},'serverUrl':{'type':Sequelize[_0x4d66('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4d66('0x4')]('integrationTab',_0x4d66('0x5')),'defaultValue':_0x4d66('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 1d723ab..52f2df7 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 _0xaed1=['then','destroy','sendStatus','error','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','AccountId','getSubjects','channel','SalesforceField','Subjects','Descriptions','remoteUri','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','clientId','login','concat','isNil','ticketType','describe','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','test','statusCode','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaed1,0xd1));var _0x1aed=function(_0x36c3c7,_0x52f866){_0x36c3c7=_0x36c3c7-0x0;var _0x52bc17=_0xaed1[_0x36c3c7];return _0x52bc17;};'use strict';var emlformat=require(_0x1aed('0x0'));var rimraf=require(_0x1aed('0x1'));var zipdir=require(_0x1aed('0x2'));var jsonpatch=require(_0x1aed('0x3'));var rp=require(_0x1aed('0x4'));var moment=require('moment');var BPromise=require(_0x1aed('0x5'));var Mustache=require(_0x1aed('0x6'));var util=require('util');var path=require(_0x1aed('0x7'));var sox=require('sox');var csv=require(_0x1aed('0x8'));var ejs=require(_0x1aed('0x9'));var fs=require('fs');var fs_extra=require(_0x1aed('0xa'));var _=require(_0x1aed('0xb'));var squel=require(_0x1aed('0xc'));var crypto=require(_0x1aed('0xd'));var jsforce=require(_0x1aed('0xe'));var deskjs=require(_0x1aed('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1aed('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1aed('0x11'));var qs=require(_0x1aed('0x12'));var as=require(_0x1aed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1aed('0x14'))(_0x1aed('0x15'));var utils=require(_0x1aed('0x16'));var config=require(_0x1aed('0x17'));var licenseUtil=require(_0x1aed('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1aed('0x19'));function respondWithStatusCode(_0x115873,_0x1927de){_0x1927de=_0x1927de||0xcc;return function(_0x46011a){if(_0x46011a){return _0x115873['sendStatus'](_0x1927de);}return _0x115873[_0x1aed('0x1a')](_0x1927de)[_0x1aed('0x1b')]();};}function respondWithResult(_0x3b9e58,_0x8277c0){_0x8277c0=_0x8277c0||0xc8;return function(_0x5b4e54){if(_0x5b4e54){return _0x3b9e58[_0x1aed('0x1a')](_0x8277c0)[_0x1aed('0x1c')](_0x5b4e54);}};}function respondWithFilteredResult(_0x43fcb3,_0x2fe002){return function(_0x518ff4){if(_0x518ff4){var _0xeb0699=typeof _0x2fe002[_0x1aed('0x1d')]===_0x1aed('0x1e')&&typeof _0x2fe002[_0x1aed('0x1f')]===_0x1aed('0x1e');var _0x591c35=_0x518ff4[_0x1aed('0x20')];var _0x3f8980=_0xeb0699?0x0:_0x2fe002[_0x1aed('0x1d')];var _0x8d567d=_0xeb0699?_0x518ff4[_0x1aed('0x20')]:_0x2fe002[_0x1aed('0x1d')]+_0x2fe002[_0x1aed('0x1f')];var _0x379e47;if(_0x8d567d>=_0x591c35){_0x8d567d=_0x591c35;_0x379e47=0xc8;}else{_0x379e47=0xce;}_0x43fcb3[_0x1aed('0x1a')](_0x379e47);return _0x43fcb3[_0x1aed('0x21')](_0x1aed('0x22'),_0x3f8980+'-'+_0x8d567d+'/'+_0x591c35)[_0x1aed('0x1c')](_0x518ff4);}return null;};}function patchUpdates(_0x27ab10){return function(_0x411b8f){try{jsonpatch[_0x1aed('0x23')](_0x411b8f,_0x27ab10,!![]);}catch(_0x44577b){return BPromise[_0x1aed('0x24')](_0x44577b);}return _0x411b8f['save']();};}function saveUpdates(_0x29b3ff,_0x3fbda0){return function(_0x596f52){if(_0x596f52){return _0x596f52['update'](_0x29b3ff)[_0x1aed('0x25')](function(_0x2895e6){return _0x2895e6;});}return null;};}function removeEntity(_0x5e39a2,_0x3eb96b){return function(_0x201247){if(_0x201247){return _0x201247[_0x1aed('0x26')]()[_0x1aed('0x25')](function(){_0x5e39a2[_0x1aed('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd400c3,_0x50666f){return function(_0x5b763d){if(!_0x5b763d){_0xd400c3[_0x1aed('0x27')](0x194);}return _0x5b763d;};}function handleError(_0x4fd5ca,_0x1617d9){_0x1617d9=_0x1617d9||0x1f4;return function(_0x2fe137){logger[_0x1aed('0x28')](_0x2fe137['stack']);if(_0x2fe137[_0x1aed('0x29')]){delete _0x2fe137[_0x1aed('0x29')];}_0x4fd5ca[_0x1aed('0x1a')](_0x1617d9)['send'](_0x2fe137);};}exports[_0x1aed('0x2a')]=function(_0x27556b,_0x5056c8){var _0x1e6927={},_0x34afd1={},_0x2a6eeb={'count':0x0,'rows':[]};var _0x4126ee=_[_0x1aed('0x2b')](db[_0x1aed('0x2c')][_0x1aed('0x2d')],function(_0x3496ce){return{'name':_0x3496ce[_0x1aed('0x2e')],'type':_0x3496ce[_0x1aed('0x2f')][_0x1aed('0x30')]};});_0x34afd1[_0x1aed('0x31')]=_[_0x1aed('0x2b')](_0x4126ee,_0x1aed('0x29'));_0x34afd1['query']=_[_0x1aed('0x32')](_0x27556b['query']);_0x34afd1[_0x1aed('0x33')]=_['intersection'](_0x34afd1['model'],_0x34afd1[_0x1aed('0x34')]);_0x1e6927[_0x1aed('0x35')]=_['intersection'](_0x34afd1['model'],qs[_0x1aed('0x36')](_0x27556b[_0x1aed('0x34')][_0x1aed('0x36')]));_0x1e6927[_0x1aed('0x35')]=_0x1e6927[_0x1aed('0x35')][_0x1aed('0x37')]?_0x1e6927[_0x1aed('0x35')]:_0x34afd1[_0x1aed('0x31')];if(!_0x27556b[_0x1aed('0x34')][_0x1aed('0x38')](_0x1aed('0x39'))){_0x1e6927[_0x1aed('0x1f')]=qs[_0x1aed('0x1f')](_0x27556b[_0x1aed('0x34')][_0x1aed('0x1f')]);_0x1e6927['offset']=qs['offset'](_0x27556b['query'][_0x1aed('0x1d')]);}_0x1e6927[_0x1aed('0x3a')]=qs[_0x1aed('0x3b')](_0x27556b[_0x1aed('0x34')]['sort']);_0x1e6927[_0x1aed('0x3c')]=qs[_0x1aed('0x33')](_['pick'](_0x27556b['query'],_0x34afd1[_0x1aed('0x33')]),_0x4126ee);if(_0x27556b[_0x1aed('0x34')][_0x1aed('0x3d')]){_0x1e6927['where']=_[_0x1aed('0x3e')](_0x1e6927['where'],{'$or':_[_0x1aed('0x2b')](_0x4126ee,function(_0x391c7e){if(_0x391c7e[_0x1aed('0x2f')]!=='VIRTUAL'){var _0x22d67e={};_0x22d67e[_0x391c7e['name']]={'$like':'%'+_0x27556b['query'][_0x1aed('0x3d')]+'%'};return _0x22d67e;}})});}_0x1e6927=_[_0x1aed('0x3e')]({},_0x1e6927,_0x27556b[_0x1aed('0x3f')]);var _0x2593c3={'where':_0x1e6927['where']};return db[_0x1aed('0x2c')][_0x1aed('0x20')](_0x2593c3)['then'](function(_0x3595f3){_0x2a6eeb[_0x1aed('0x20')]=_0x3595f3;if(_0x27556b['query']['includeAll']){_0x1e6927[_0x1aed('0x40')]=[{'all':!![]}];}return db[_0x1aed('0x2c')][_0x1aed('0x41')](_0x1e6927);})['then'](function(_0x2d3924){_0x2a6eeb[_0x1aed('0x42')]=_0x2d3924;return _0x2a6eeb;})['then'](respondWithFilteredResult(_0x5056c8,_0x1e6927))[_0x1aed('0x43')](handleError(_0x5056c8,null));};exports[_0x1aed('0x44')]=function(_0x34a9cf,_0x9759ab){var _0x34532e={'raw':![],'where':{'id':_0x34a9cf[_0x1aed('0x45')]['id']}},_0x33374f={};_0x33374f['model']=_[_0x1aed('0x32')](db[_0x1aed('0x2c')]['rawAttributes']);_0x33374f[_0x1aed('0x34')]=_[_0x1aed('0x32')](_0x34a9cf[_0x1aed('0x34')]);_0x33374f[_0x1aed('0x33')]=_['intersection'](_0x33374f[_0x1aed('0x31')],_0x33374f[_0x1aed('0x34')]);_0x34532e['attributes']=_[_0x1aed('0x46')](_0x33374f[_0x1aed('0x31')],qs[_0x1aed('0x36')](_0x34a9cf[_0x1aed('0x34')][_0x1aed('0x36')]));_0x34532e[_0x1aed('0x35')]=_0x34532e['attributes'][_0x1aed('0x37')]?_0x34532e[_0x1aed('0x35')]:_0x33374f['model'];if(_0x34a9cf['query'][_0x1aed('0x47')]){_0x34532e[_0x1aed('0x40')]=[{'all':!![]}];}_0x34532e=_[_0x1aed('0x3e')]({},_0x34532e,_0x34a9cf[_0x1aed('0x3f')]);return db['SalesforceAccount'][_0x1aed('0x48')](_0x34532e)[_0x1aed('0x25')](handleEntityNotFound(_0x9759ab,null))[_0x1aed('0x25')](respondWithResult(_0x9759ab,null))['catch'](handleError(_0x9759ab,null));};exports[_0x1aed('0x49')]=function(_0x26c32b,_0x334d59){return db[_0x1aed('0x2c')]['create'](_0x26c32b[_0x1aed('0x4a')],{})['then'](respondWithResult(_0x334d59,0xc9))[_0x1aed('0x43')](handleError(_0x334d59,null));};exports['update']=function(_0x1dec61,_0x5184ba){if(_0x1dec61[_0x1aed('0x4a')]['id']){delete _0x1dec61['body']['id'];}return db[_0x1aed('0x2c')]['find']({'where':{'id':_0x1dec61[_0x1aed('0x45')]['id']}})[_0x1aed('0x25')](handleEntityNotFound(_0x5184ba,null))[_0x1aed('0x25')](saveUpdates(_0x1dec61['body'],null))[_0x1aed('0x25')](respondWithResult(_0x5184ba,null))[_0x1aed('0x43')](handleError(_0x5184ba,null));};exports['destroy']=function(_0x239cf8,_0x8458f7){return db['SalesforceAccount'][_0x1aed('0x48')]({'where':{'id':_0x239cf8['params']['id']}})['then'](handleEntityNotFound(_0x8458f7,null))[_0x1aed('0x25')](removeEntity(_0x8458f7,null))[_0x1aed('0x43')](handleError(_0x8458f7,null));};exports[_0x1aed('0x4b')]=function(_0x1411fe,_0x13e10b,_0x1322b3){var _0x2622d0={};var _0x2ebc5f={};var _0xf35b03;var _0x2558a2;return db[_0x1aed('0x2c')][_0x1aed('0x4c')]({'where':{'id':_0x1411fe[_0x1aed('0x45')]['id']}})['then'](handleEntityNotFound(_0x13e10b,null))['then'](function(_0x21a4ba){if(_0x21a4ba){_0xf35b03=_0x21a4ba;_0x2ebc5f['model']=_[_0x1aed('0x32')](db[_0x1aed('0x4d')][_0x1aed('0x2d')]);_0x2ebc5f[_0x1aed('0x34')]=_[_0x1aed('0x32')](_0x1411fe[_0x1aed('0x34')]);_0x2ebc5f['filters']=_['intersection'](_0x2ebc5f[_0x1aed('0x31')],_0x2ebc5f[_0x1aed('0x34')]);_0x2622d0['attributes']=_[_0x1aed('0x46')](_0x2ebc5f[_0x1aed('0x31')],qs[_0x1aed('0x36')](_0x1411fe['query']['fields']));_0x2622d0[_0x1aed('0x35')]=_0x2622d0[_0x1aed('0x35')][_0x1aed('0x37')]?_0x2622d0[_0x1aed('0x35')]:_0x2ebc5f[_0x1aed('0x31')];_0x2622d0['order']=qs[_0x1aed('0x3b')](_0x1411fe[_0x1aed('0x34')][_0x1aed('0x3b')]);_0x2622d0[_0x1aed('0x3c')]=qs[_0x1aed('0x33')](_[_0x1aed('0x4e')](_0x1411fe[_0x1aed('0x34')],_0x2ebc5f[_0x1aed('0x33')]));if(_0x1411fe[_0x1aed('0x34')][_0x1aed('0x3d')]){_0x2622d0[_0x1aed('0x3c')]=_[_0x1aed('0x3e')](_0x2622d0['where'],{'$or':_['map'](_0x2622d0[_0x1aed('0x35')],function(_0x139803){var _0x342064={};_0x342064[_0x139803]={'$like':'%'+_0x1411fe[_0x1aed('0x34')][_0x1aed('0x3d')]+'%'};return _0x342064;})});}_0x2622d0=_[_0x1aed('0x3e')]({},_0x2622d0,_0x1411fe[_0x1aed('0x3f')]);return _0xf35b03[_0x1aed('0x4b')](_0x2622d0);}})[_0x1aed('0x25')](function(_0x347916){if(_0x347916){_0x2558a2=_0x347916[_0x1aed('0x37')];if(!_0x1411fe[_0x1aed('0x34')][_0x1aed('0x38')](_0x1aed('0x39'))){_0x2622d0[_0x1aed('0x1f')]=qs['limit'](_0x1411fe[_0x1aed('0x34')][_0x1aed('0x1f')]);_0x2622d0[_0x1aed('0x1d')]=qs[_0x1aed('0x1d')](_0x1411fe[_0x1aed('0x34')][_0x1aed('0x1d')]);}return _0xf35b03[_0x1aed('0x4b')](_0x2622d0);}})[_0x1aed('0x25')](function(_0x159b4b){if(_0x159b4b){return _0x159b4b?{'count':_0x2558a2,'rows':_0x159b4b}:null;}})[_0x1aed('0x25')](respondWithResult(_0x13e10b,null))[_0x1aed('0x43')](handleError(_0x13e10b,null));};exports[_0x1aed('0x4f')]=function(_0x38e05c,_0x522630,_0x106f69){if(_0x38e05c[_0x1aed('0x4a')]['id']){delete _0x38e05c[_0x1aed('0x4a')]['id'];}return db[_0x1aed('0x2c')]['findOne']({'where':{'id':_0x38e05c[_0x1aed('0x45')]['id']}})[_0x1aed('0x25')](handleEntityNotFound(_0x522630,null))[_0x1aed('0x25')](function(_0x10b3de){if(_0x10b3de){_0x38e05c[_0x1aed('0x4a')][_0x1aed('0x50')]=_0x10b3de['id'];_0x38e05c[_0x1aed('0x4a')]['Subjects']=integrations[_0x1aed('0x51')](_0x38e05c['body'][_0x1aed('0x52')],_0x38e05c['body'][_0x1aed('0x2f')]);_0x38e05c[_0x1aed('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x38e05c['body'][_0x1aed('0x52')],_0x38e05c['body'][_0x1aed('0x2f')]);return db['SalesforceConfiguration']['create'](_0x38e05c[_0x1aed('0x4a')],{'include':[{'model':db[_0x1aed('0x53')],'as':_0x1aed('0x54')},{'model':db[_0x1aed('0x53')],'as':_0x1aed('0x55')}]});}return null;})[_0x1aed('0x25')](respondWithResult(_0x522630,null))['catch'](handleError(_0x522630,null));};exports['getFields']=function(_0x2f3e5d,_0x43f985,_0x3588a1){var _0x1c9a92;var _0x2ef6f2='';var _0x2360c3='Task';return db['SalesforceAccount']['findOne']({'where':{'id':_0x2f3e5d[_0x1aed('0x45')]['id']},'attributes':['id',_0x1aed('0x56'),'clientId',_0x1aed('0x57'),_0x1aed('0x58'),_0x1aed('0x59'),_0x1aed('0x5a')]})[_0x1aed('0x25')](handleEntityNotFound(_0x43f985,null))['then'](function(_0x2036e8){if(_0x2036e8){_0x2ef6f2=_0x2036e8[_0x1aed('0x56')];var _0x2fcf87=_0x2ef6f2[_0x1aed('0x5b')](-0x1);if(_0x2fcf87==='/'){_0x2ef6f2=_0x2ef6f2['substring'](0x0,_0x2ef6f2[_0x1aed('0x5c')](_0x2fcf87));}_0x1c9a92=new jsforce[(_0x1aed('0x5d'))]({'oauth2':{'loginUrl':_0x2ef6f2,'clientId':_0x2036e8[_0x1aed('0x5e')],'clientSecret':_0x2036e8['clientSecret']}});return _0x1c9a92[_0x1aed('0x5f')](_0x2036e8[_0x1aed('0x58')],_0x2036e8[_0x1aed('0x59')][_0x1aed('0x60')](_0x2036e8[_0x1aed('0x5a')]));}})[_0x1aed('0x25')](function(_0x38b34){if(_0x38b34){if(!_[_0x1aed('0x61')](_0x2f3e5d[_0x1aed('0x34')][_0x1aed('0x62')])){_0x2360c3=_0x2f3e5d['query']['ticketType'];}return _0x1c9a92['sobject'](_0x2360c3)[_0x1aed('0x63')]();}})[_0x1aed('0x25')](function(_0x332eb6){var _0x1e3ee7=['OwnerId','ActivityDate',_0x1aed('0x64'),_0x1aed('0x65'),_0x1aed('0x66'),_0x1aed('0x67')];var _0x5a0d7=[_0x1aed('0x68'),_0x1aed('0x69'),_0x1aed('0x6a'),_0x1aed('0x6b'),_0x1aed('0x6c'),_0x1aed('0x6d'),_0x1aed('0x6e')];if(_0x332eb6){_[_0x1aed('0x6f')](_0x332eb6[_0x1aed('0x36')],function(_0x4409a6){return _0x1e3ee7['includes'](_0x4409a6[_0x1aed('0x29')])||!_0x5a0d7[_0x1aed('0x70')](_0x4409a6['type']);});return{'count':_0x332eb6[_0x1aed('0x36')][_0x1aed('0x37')],'rows':_['map'](_0x332eb6[_0x1aed('0x36')],function(_0x3381d6){return{'id':_0x3381d6[_0x1aed('0x29')],'name':_0x3381d6[_0x1aed('0x71')],'custom':_0x3381d6[_0x1aed('0x72')],'options':_0x3381d6[_0x1aed('0x73')][_0x1aed('0x37')]>0x0?_[_0x1aed('0x2b')](_0x3381d6[_0x1aed('0x73')],function(_0x1a8bdf){return{'name':_0x1a8bdf[_0x1aed('0x71')],'value':_0x1a8bdf[_0x1aed('0x74')]};}):_0x3381d6[_0x1aed('0x2f')]==_0x1aed('0x6b')?[{'name':_0x1aed('0x75'),'value':'true'},{'name':'False','value':'false'}]:[]};})};}})[_0x1aed('0x25')](respondWithResult(_0x43f985,null))['catch'](function(_0x5a240d){var _0x3e22c3=_0x2f3e5d[_0x1aed('0x34')][_0x1aed('0x76')]?0x1f4:_0x5a240d[_0x1aed('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x1aed('0x78'),_0x3e22c3,JSON['stringify'](_0x5a240d));delete _0x5a240d[_0x1aed('0x29')];if(_0x3e22c3===0x191){_0x3e22c3=0x190;}_0x43f985[_0x1aed('0x1a')](_0x3e22c3)[_0x1aed('0x79')](_0x2f3e5d[_0x1aed('0x34')][_0x1aed('0x76')]?{'message':_0x1aed('0x7a'),'statusCode':_0x5a240d[_0x1aed('0x77')]}:_0x5a240d);});}; \ No newline at end of file +var _0x11fa=['phone','remove','includes','label','custom','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','update','then','error','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','SalesforceAccount','include','findAll','catch','show','params','create','body','find','findOne','SalesforceConfiguration','order','pick','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','login','isNil','ticketType','sobject','OwnerId','ActivityDate','IsRecurrence','Subject','string','int','picklist','textarea'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x11fa,0x164));var _0xa11f=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x11fa[_0x22b68a];return _0x1ac67a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa11f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa11f('0x1'));var util=require('util');var path=require(_0xa11f('0x2'));var sox=require('sox');var csv=require(_0xa11f('0x3'));var ejs=require(_0xa11f('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa11f('0x5'));var squel=require(_0xa11f('0x6'));var crypto=require(_0xa11f('0x7'));var jsforce=require(_0xa11f('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa11f('0x9'));var Papa=require(_0xa11f('0xa'));var Redis=require('ioredis');var authService=require(_0xa11f('0xb'));var qs=require(_0xa11f('0xc'));var as=require(_0xa11f('0xd'));var hardwareService=require(_0xa11f('0xe'));var logger=require('../../config/logger')(_0xa11f('0xf'));var utils=require('../../config/utils');var config=require(_0xa11f('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa11f('0x11'));function respondWithStatusCode(_0xbe4b5c,_0x45e45e){_0x45e45e=_0x45e45e||0xcc;return function(_0x573e84){if(_0x573e84){return _0xbe4b5c[_0xa11f('0x12')](_0x45e45e);}return _0xbe4b5c['status'](_0x45e45e)[_0xa11f('0x13')]();};}function respondWithResult(_0x51d94c,_0x130563){_0x130563=_0x130563||0xc8;return function(_0x4824a1){if(_0x4824a1){return _0x51d94c['status'](_0x130563)[_0xa11f('0x14')](_0x4824a1);}};}function respondWithFilteredResult(_0x1f7680,_0x20c4e3){return function(_0x1792d6){if(_0x1792d6){var _0x5e314f=typeof _0x20c4e3[_0xa11f('0x15')]===_0xa11f('0x16')&&typeof _0x20c4e3[_0xa11f('0x17')]===_0xa11f('0x16');var _0x4648bd=_0x1792d6['count'];var _0x2ce62e=_0x5e314f?0x0:_0x20c4e3[_0xa11f('0x15')];var _0x1f5769=_0x5e314f?_0x1792d6[_0xa11f('0x18')]:_0x20c4e3[_0xa11f('0x15')]+_0x20c4e3[_0xa11f('0x17')];var _0x5606bb;if(_0x1f5769>=_0x4648bd){_0x1f5769=_0x4648bd;_0x5606bb=0xc8;}else{_0x5606bb=0xce;}_0x1f7680[_0xa11f('0x19')](_0x5606bb);return _0x1f7680['set'](_0xa11f('0x1a'),_0x2ce62e+'-'+_0x1f5769+'/'+_0x4648bd)[_0xa11f('0x14')](_0x1792d6);}return null;};}function patchUpdates(_0xfe45c6){return function(_0x51b326){try{jsonpatch[_0xa11f('0x1b')](_0x51b326,_0xfe45c6,!![]);}catch(_0x4b9873){return BPromise['reject'](_0x4b9873);}return _0x51b326['save']();};}function saveUpdates(_0x5f5dcd,_0xf130b2){return function(_0xc1a750){if(_0xc1a750){return _0xc1a750[_0xa11f('0x1c')](_0x5f5dcd)[_0xa11f('0x1d')](function(_0x9db8c5){return _0x9db8c5;});}return null;};}function removeEntity(_0xc8721d,_0x1c9f9d){return function(_0x2756fb){if(_0x2756fb){return _0x2756fb['destroy']()[_0xa11f('0x1d')](function(){_0xc8721d[_0xa11f('0x19')](0xcc)[_0xa11f('0x13')]();});}};}function handleEntityNotFound(_0x37c9e0,_0x25b4b0){return function(_0x2e3c39){if(!_0x2e3c39){_0x37c9e0['sendStatus'](0x194);}return _0x2e3c39;};}function handleError(_0x24bb7a,_0xe2b735){_0xe2b735=_0xe2b735||0x1f4;return function(_0x5ec817){logger[_0xa11f('0x1e')](_0x5ec817['stack']);if(_0x5ec817[_0xa11f('0x1f')]){delete _0x5ec817[_0xa11f('0x1f')];}_0x24bb7a[_0xa11f('0x19')](_0xe2b735)[_0xa11f('0x20')](_0x5ec817);};}exports['index']=function(_0x4837c5,_0x18be99){var _0x156bfe={},_0x473a56={},_0x238702={'count':0x0,'rows':[]};var _0x243a6f=_[_0xa11f('0x21')](db['SalesforceAccount'][_0xa11f('0x22')],function(_0x55f57b){return{'name':_0x55f57b[_0xa11f('0x23')],'type':_0x55f57b[_0xa11f('0x24')][_0xa11f('0x25')]};});_0x473a56[_0xa11f('0x26')]=_[_0xa11f('0x21')](_0x243a6f,'name');_0x473a56['query']=_[_0xa11f('0x27')](_0x4837c5[_0xa11f('0x28')]);_0x473a56['filters']=_[_0xa11f('0x29')](_0x473a56[_0xa11f('0x26')],_0x473a56['query']);_0x156bfe[_0xa11f('0x2a')]=_[_0xa11f('0x29')](_0x473a56[_0xa11f('0x26')],qs[_0xa11f('0x2b')](_0x4837c5[_0xa11f('0x28')][_0xa11f('0x2b')]));_0x156bfe[_0xa11f('0x2a')]=_0x156bfe['attributes'][_0xa11f('0x2c')]?_0x156bfe[_0xa11f('0x2a')]:_0x473a56[_0xa11f('0x26')];if(!_0x4837c5[_0xa11f('0x28')][_0xa11f('0x2d')](_0xa11f('0x2e'))){_0x156bfe[_0xa11f('0x17')]=qs[_0xa11f('0x17')](_0x4837c5[_0xa11f('0x28')][_0xa11f('0x17')]);_0x156bfe[_0xa11f('0x15')]=qs[_0xa11f('0x15')](_0x4837c5['query'][_0xa11f('0x15')]);}_0x156bfe['order']=qs[_0xa11f('0x2f')](_0x4837c5[_0xa11f('0x28')][_0xa11f('0x2f')]);_0x156bfe[_0xa11f('0x30')]=qs['filters'](_['pick'](_0x4837c5[_0xa11f('0x28')],_0x473a56[_0xa11f('0x31')]),_0x243a6f);if(_0x4837c5[_0xa11f('0x28')][_0xa11f('0x32')]){_0x156bfe[_0xa11f('0x30')]=_['merge'](_0x156bfe['where'],{'$or':_['map'](_0x243a6f,function(_0x507d31){if(_0x507d31[_0xa11f('0x24')]!==_0xa11f('0x33')){var _0x4859c4={};_0x4859c4[_0x507d31['name']]={'$like':'%'+_0x4837c5[_0xa11f('0x28')][_0xa11f('0x32')]+'%'};return _0x4859c4;}})});}_0x156bfe=_[_0xa11f('0x34')]({},_0x156bfe,_0x4837c5[_0xa11f('0x35')]);var _0x35dad6={'where':_0x156bfe[_0xa11f('0x30')]};return db[_0xa11f('0x36')]['count'](_0x35dad6)[_0xa11f('0x1d')](function(_0x3fb479){_0x238702[_0xa11f('0x18')]=_0x3fb479;if(_0x4837c5[_0xa11f('0x28')]['includeAll']){_0x156bfe[_0xa11f('0x37')]=[{'all':!![]}];}return db[_0xa11f('0x36')][_0xa11f('0x38')](_0x156bfe);})[_0xa11f('0x1d')](function(_0xe8b273){_0x238702['rows']=_0xe8b273;return _0x238702;})['then'](respondWithFilteredResult(_0x18be99,_0x156bfe))[_0xa11f('0x39')](handleError(_0x18be99,null));};exports[_0xa11f('0x3a')]=function(_0x408adc,_0x4f3af8){var _0x289adc={'raw':![],'where':{'id':_0x408adc[_0xa11f('0x3b')]['id']}},_0x354630={};_0x354630[_0xa11f('0x26')]=_['keys'](db[_0xa11f('0x36')][_0xa11f('0x22')]);_0x354630[_0xa11f('0x28')]=_[_0xa11f('0x27')](_0x408adc[_0xa11f('0x28')]);_0x354630[_0xa11f('0x31')]=_[_0xa11f('0x29')](_0x354630['model'],_0x354630[_0xa11f('0x28')]);_0x289adc[_0xa11f('0x2a')]=_[_0xa11f('0x29')](_0x354630[_0xa11f('0x26')],qs[_0xa11f('0x2b')](_0x408adc[_0xa11f('0x28')][_0xa11f('0x2b')]));_0x289adc[_0xa11f('0x2a')]=_0x289adc[_0xa11f('0x2a')][_0xa11f('0x2c')]?_0x289adc[_0xa11f('0x2a')]:_0x354630[_0xa11f('0x26')];if(_0x408adc['query']['includeAll']){_0x289adc[_0xa11f('0x37')]=[{'all':!![]}];}_0x289adc=_[_0xa11f('0x34')]({},_0x289adc,_0x408adc['options']);return db[_0xa11f('0x36')]['find'](_0x289adc)[_0xa11f('0x1d')](handleEntityNotFound(_0x4f3af8,null))['then'](respondWithResult(_0x4f3af8,null))[_0xa11f('0x39')](handleError(_0x4f3af8,null));};exports[_0xa11f('0x3c')]=function(_0x33aba6,_0x2770a7){return db[_0xa11f('0x36')][_0xa11f('0x3c')](_0x33aba6['body'],{})['then'](respondWithResult(_0x2770a7,0xc9))[_0xa11f('0x39')](handleError(_0x2770a7,null));};exports['update']=function(_0x5cbc53,_0x1d2387){if(_0x5cbc53['body']['id']){delete _0x5cbc53[_0xa11f('0x3d')]['id'];}return db['SalesforceAccount'][_0xa11f('0x3e')]({'where':{'id':_0x5cbc53[_0xa11f('0x3b')]['id']}})[_0xa11f('0x1d')](handleEntityNotFound(_0x1d2387,null))[_0xa11f('0x1d')](saveUpdates(_0x5cbc53['body'],null))[_0xa11f('0x1d')](respondWithResult(_0x1d2387,null))[_0xa11f('0x39')](handleError(_0x1d2387,null));};exports['destroy']=function(_0x34afb6,_0x4097af){return db[_0xa11f('0x36')][_0xa11f('0x3e')]({'where':{'id':_0x34afb6[_0xa11f('0x3b')]['id']}})[_0xa11f('0x1d')](handleEntityNotFound(_0x4097af,null))[_0xa11f('0x1d')](removeEntity(_0x4097af,null))[_0xa11f('0x39')](handleError(_0x4097af,null));};exports['getConfigurations']=function(_0x4ab2a9,_0x5ab31b,_0x1899a9){var _0x2c9d56={};var _0x21c28c={};var _0x459754;var _0x34fc85;return db['SalesforceAccount'][_0xa11f('0x3f')]({'where':{'id':_0x4ab2a9[_0xa11f('0x3b')]['id']}})[_0xa11f('0x1d')](handleEntityNotFound(_0x5ab31b,null))[_0xa11f('0x1d')](function(_0x106429){if(_0x106429){_0x459754=_0x106429;_0x21c28c[_0xa11f('0x26')]=_[_0xa11f('0x27')](db[_0xa11f('0x40')][_0xa11f('0x22')]);_0x21c28c[_0xa11f('0x28')]=_['keys'](_0x4ab2a9[_0xa11f('0x28')]);_0x21c28c[_0xa11f('0x31')]=_[_0xa11f('0x29')](_0x21c28c['model'],_0x21c28c[_0xa11f('0x28')]);_0x2c9d56[_0xa11f('0x2a')]=_[_0xa11f('0x29')](_0x21c28c['model'],qs[_0xa11f('0x2b')](_0x4ab2a9[_0xa11f('0x28')]['fields']));_0x2c9d56[_0xa11f('0x2a')]=_0x2c9d56[_0xa11f('0x2a')]['length']?_0x2c9d56[_0xa11f('0x2a')]:_0x21c28c[_0xa11f('0x26')];_0x2c9d56[_0xa11f('0x41')]=qs[_0xa11f('0x2f')](_0x4ab2a9[_0xa11f('0x28')][_0xa11f('0x2f')]);_0x2c9d56[_0xa11f('0x30')]=qs['filters'](_[_0xa11f('0x42')](_0x4ab2a9['query'],_0x21c28c[_0xa11f('0x31')]));if(_0x4ab2a9['query'][_0xa11f('0x32')]){_0x2c9d56['where']=_[_0xa11f('0x34')](_0x2c9d56[_0xa11f('0x30')],{'$or':_['map'](_0x2c9d56['attributes'],function(_0x2f8b5c){var _0x483743={};_0x483743[_0x2f8b5c]={'$like':'%'+_0x4ab2a9[_0xa11f('0x28')][_0xa11f('0x32')]+'%'};return _0x483743;})});}_0x2c9d56=_[_0xa11f('0x34')]({},_0x2c9d56,_0x4ab2a9[_0xa11f('0x35')]);return _0x459754[_0xa11f('0x43')](_0x2c9d56);}})[_0xa11f('0x1d')](function(_0x245951){if(_0x245951){_0x34fc85=_0x245951[_0xa11f('0x2c')];if(!_0x4ab2a9[_0xa11f('0x28')][_0xa11f('0x2d')](_0xa11f('0x2e'))){_0x2c9d56[_0xa11f('0x17')]=qs[_0xa11f('0x17')](_0x4ab2a9[_0xa11f('0x28')][_0xa11f('0x17')]);_0x2c9d56['offset']=qs['offset'](_0x4ab2a9[_0xa11f('0x28')][_0xa11f('0x15')]);}return _0x459754[_0xa11f('0x43')](_0x2c9d56);}})[_0xa11f('0x1d')](function(_0x3b39d1){if(_0x3b39d1){return _0x3b39d1?{'count':_0x34fc85,'rows':_0x3b39d1}:null;}})[_0xa11f('0x1d')](respondWithResult(_0x5ab31b,null))[_0xa11f('0x39')](handleError(_0x5ab31b,null));};exports['addConfiguration']=function(_0x2fbbd7,_0x2e87cd,_0x1ef01c){if(_0x2fbbd7[_0xa11f('0x3d')]['id']){delete _0x2fbbd7['body']['id'];}return db[_0xa11f('0x36')][_0xa11f('0x3f')]({'where':{'id':_0x2fbbd7[_0xa11f('0x3b')]['id']}})[_0xa11f('0x1d')](handleEntityNotFound(_0x2e87cd,null))[_0xa11f('0x1d')](function(_0x215f10){if(_0x215f10){_0x2fbbd7[_0xa11f('0x3d')]['AccountId']=_0x215f10['id'];_0x2fbbd7[_0xa11f('0x3d')][_0xa11f('0x44')]=integrations[_0xa11f('0x45')](_0x2fbbd7['body'][_0xa11f('0x46')],_0x2fbbd7[_0xa11f('0x3d')][_0xa11f('0x24')]);_0x2fbbd7[_0xa11f('0x3d')][_0xa11f('0x47')]=integrations[_0xa11f('0x48')](_0x2fbbd7[_0xa11f('0x3d')][_0xa11f('0x46')],_0x2fbbd7[_0xa11f('0x3d')][_0xa11f('0x24')]);return db[_0xa11f('0x40')][_0xa11f('0x3c')](_0x2fbbd7[_0xa11f('0x3d')],{'include':[{'model':db[_0xa11f('0x49')],'as':_0xa11f('0x44')},{'model':db[_0xa11f('0x49')],'as':_0xa11f('0x47')}]});}return null;})[_0xa11f('0x1d')](respondWithResult(_0x2e87cd,null))[_0xa11f('0x39')](handleError(_0x2e87cd,null));};exports[_0xa11f('0x4a')]=function(_0x1ea800,_0x4e4e7e,_0x834f53){var _0x29c36f;var _0x3b951a='';var _0x3a73e3=_0xa11f('0x4b');return db[_0xa11f('0x36')]['findOne']({'where':{'id':_0x1ea800['params']['id']},'attributes':['id',_0xa11f('0x4c'),_0xa11f('0x4d'),_0xa11f('0x4e'),_0xa11f('0x4f'),_0xa11f('0x50'),_0xa11f('0x51')]})[_0xa11f('0x1d')](handleEntityNotFound(_0x4e4e7e,null))[_0xa11f('0x1d')](function(_0x3a950b){if(_0x3a950b){_0x3b951a=_0x3a950b[_0xa11f('0x4c')];var _0x4f2704=_0x3b951a[_0xa11f('0x52')](-0x1);if(_0x4f2704==='/'){_0x3b951a=_0x3b951a[_0xa11f('0x53')](0x0,_0x3b951a['lastIndexOf'](_0x4f2704));}_0x29c36f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3b951a,'clientId':_0x3a950b[_0xa11f('0x4d')],'clientSecret':_0x3a950b['clientSecret']}});return _0x29c36f[_0xa11f('0x54')](_0x3a950b[_0xa11f('0x4f')],_0x3a950b[_0xa11f('0x50')]['concat'](_0x3a950b['securityToken']));}})[_0xa11f('0x1d')](function(_0x24fd18){if(_0x24fd18){if(!_[_0xa11f('0x55')](_0x1ea800['query']['ticketType'])){_0x3a73e3=_0x1ea800[_0xa11f('0x28')][_0xa11f('0x56')];}return _0x29c36f[_0xa11f('0x57')](_0x3a73e3)['describe']();}})[_0xa11f('0x1d')](function(_0x20c233){var _0x2b6301=[_0xa11f('0x58'),_0xa11f('0x59'),'IsReminderSet',_0xa11f('0x5a'),_0xa11f('0x5b'),'Description'];var _0x5b6ba7=[_0xa11f('0x5c'),_0xa11f('0x5d'),_0xa11f('0x5e'),'boolean','email',_0xa11f('0x5f'),_0xa11f('0x60')];if(_0x20c233){_[_0xa11f('0x61')](_0x20c233['fields'],function(_0x56f48b){return _0x2b6301[_0xa11f('0x62')](_0x56f48b['name'])||!_0x5b6ba7[_0xa11f('0x62')](_0x56f48b[_0xa11f('0x24')]);});return{'count':_0x20c233[_0xa11f('0x2b')][_0xa11f('0x2c')],'rows':_[_0xa11f('0x21')](_0x20c233[_0xa11f('0x2b')],function(_0x42a81b){return{'id':_0x42a81b[_0xa11f('0x1f')],'name':_0x42a81b[_0xa11f('0x63')],'custom':_0x42a81b[_0xa11f('0x64')],'options':_0x42a81b[_0xa11f('0x65')]['length']>0x0?_[_0xa11f('0x21')](_0x42a81b[_0xa11f('0x65')],function(_0x11a1e9){return{'name':_0x11a1e9[_0xa11f('0x63')],'value':_0x11a1e9[_0xa11f('0x66')]};}):_0x42a81b[_0xa11f('0x24')]==_0xa11f('0x67')?[{'name':_0xa11f('0x68'),'value':_0xa11f('0x69')},{'name':_0xa11f('0x6a'),'value':_0xa11f('0x6b')}]:[]};})};}})[_0xa11f('0x1d')](respondWithResult(_0x4e4e7e,null))[_0xa11f('0x39')](function(_0x3ad8ee){var _0x361848=_0x1ea800[_0xa11f('0x28')][_0xa11f('0x6c')]?0x1f4:_0x3ad8ee[_0xa11f('0x6d')]||0x1f4;logger[_0xa11f('0x1e')](_0xa11f('0x6e'),'getFields',_0x361848,JSON[_0xa11f('0x6f')](_0x3ad8ee));delete _0x3ad8ee[_0xa11f('0x1f')];if(_0x361848===0x191){_0x361848=0x190;}_0x4e4e7e[_0xa11f('0x19')](_0x361848)[_0xa11f('0x20')](_0x1ea800[_0xa11f('0x28')]['test']?{'message':_0xa11f('0x70'),'statusCode':_0x3ad8ee[_0xa11f('0x6d')]}:_0x3ad8ee);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6011007..a26ad89 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 _0x6ce9=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b723b,_0x3859a1){var _0x2a4794=function(_0x5d6b41){while(--_0x5d6b41){_0x4b723b['push'](_0x4b723b['shift']());}};_0x2a4794(++_0x3859a1);}(_0x6ce9,0xe1));var _0x96ce=function(_0x12d8f3,_0x9a76ee){_0x12d8f3=_0x12d8f3-0x0;var _0x2d423b=_0x6ce9[_0x12d8f3];return _0x2d423b;};'use strict';var _=require(_0x96ce('0x0'));var util=require(_0x96ce('0x1'));var logger=require(_0x96ce('0x2'))(_0x96ce('0x3'));var moment=require(_0x96ce('0x4'));var BPromise=require(_0x96ce('0x5'));var rp=require(_0x96ce('0x6'));var fs=require('fs');var path=require(_0x96ce('0x7'));var rimraf=require(_0x96ce('0x8'));var config=require('../../config/environment');var attributes=require(_0x96ce('0x9'));var integrations=require(_0x96ce('0xa'));module[_0x96ce('0xb')]=function(_0x3512c6,_0x4ea248){return _0x3512c6['define']('SalesforceAccount',attributes,{'tableName':_0x96ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc230=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x1ea877,_0x433a0b){var _0x50ae38=function(_0x639e73){while(--_0x639e73){_0x1ea877['push'](_0x1ea877['shift']());}};_0x50ae38(++_0x433a0b);}(_0xc230,0x75));var _0x0c23=function(_0x5d21c5,_0x50ea91){_0x5d21c5=_0x5d21c5-0x0;var _0x12aed2=_0xc230[_0x5d21c5];return _0x12aed2;};'use strict';var _=require(_0x0c23('0x0'));var util=require(_0x0c23('0x1'));var logger=require(_0x0c23('0x2'))(_0x0c23('0x3'));var moment=require(_0x0c23('0x4'));var BPromise=require(_0x0c23('0x5'));var rp=require(_0x0c23('0x6'));var fs=require('fs');var path=require(_0x0c23('0x7'));var rimraf=require(_0x0c23('0x8'));var config=require(_0x0c23('0x9'));var attributes=require(_0x0c23('0xa'));var integrations=require(_0x0c23('0xb'));module[_0x0c23('0xc')]=function(_0x25769f,_0x3bb826){return _0x25769f[_0x0c23('0xd')]('SalesforceAccount',attributes,{'tableName':_0x0c23('0xe'),'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 0d19a9f..564f583 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 _0xf23e=['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','SalesforceAccount','findAll','options','raw','where','limit','map','model','attributes','include','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x83b5a0,_0x44f31f){var _0x445f43=function(_0x211b34){while(--_0x211b34){_0x83b5a0['push'](_0x83b5a0['shift']());}};_0x445f43(++_0x44f31f);}(_0xf23e,0xd2));var _0xef23=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xf23e[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0xef23('0x0'));var util=require(_0xef23('0x1'));var moment=require('moment');var BPromise=require(_0xef23('0x2'));var rs=require(_0xef23('0x3'));var fs=require('fs');var Redis=require(_0xef23('0x4'));var db=require(_0xef23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef23('0x6'));var config=require(_0xef23('0x7'));var jayson=require(_0xef23('0x8'));var client=jayson[_0xef23('0x9')][_0xef23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d648,_0x4c785d,_0x562f97){return new BPromise(function(_0x24d9b5,_0x482acb){return client[_0xef23('0xb')](_0x30d648,_0x562f97)[_0xef23('0xc')](function(_0x459af1){logger[_0xef23('0xd')](_0xef23('0xe'),_0x4c785d,_0xef23('0xf'));logger[_0xef23('0x10')](_0xef23('0x11'),_0x4c785d,'request\x20sent',JSON[_0xef23('0x12')](_0x459af1));if(_0x459af1[_0xef23('0x13')]){if(_0x459af1['error'][_0xef23('0x14')]===0x1f4){logger[_0xef23('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4c785d,_0x459af1[_0xef23('0x13')]['message']);return _0x482acb(_0x459af1['error']['message']);}logger[_0xef23('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4c785d,_0x459af1[_0xef23('0x13')][_0xef23('0x15')]);return _0x24d9b5(_0x459af1[_0xef23('0x13')][_0xef23('0x15')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4c785d,'request\x20sent');_0x24d9b5(_0x459af1[_0xef23('0x16')][_0xef23('0x15')]);}})[_0xef23('0x17')](function(_0x12ca40){logger[_0xef23('0x13')](_0xef23('0xe'),_0x4c785d,_0x12ca40);_0x482acb(_0x12ca40);});});}exports[_0xef23('0x18')]=function(_0x2fe584){var _0x13f67f=this;return new Promise(function(_0x2d9fd8,_0x303391){return db[_0xef23('0x19')][_0xef23('0x1a')]({'raw':_0x2fe584['options']?_0x2fe584[_0xef23('0x1b')][_0xef23('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')][_0xef23('0x1d')]||null:null,'attributes':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')]['attributes']||null:null,'limit':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')][_0xef23('0x1e')]||null:null,'include':_0x2fe584[_0xef23('0x1b')]?_0x2fe584[_0xef23('0x1b')]['include']?_[_0xef23('0x1f')](_0x2fe584[_0xef23('0x1b')]['include'],function(_0x3fff6c){return{'model':db[_0x3fff6c[_0xef23('0x20')]],'as':_0x3fff6c['as'],'attributes':_0x3fff6c[_0xef23('0x21')],'include':_0x3fff6c['include']?_[_0xef23('0x1f')](_0x3fff6c[_0xef23('0x22')],function(_0x2ecbc8){return{'model':db[_0x2ecbc8[_0xef23('0x20')]],'as':_0x2ecbc8['as'],'attributes':_0x2ecbc8['attributes'],'include':_0x2ecbc8[_0xef23('0x22')]?_[_0xef23('0x1f')](_0x2ecbc8[_0xef23('0x22')],function(_0x42fc3a){return{'model':db[_0x42fc3a[_0xef23('0x20')]],'as':_0x42fc3a['as'],'attributes':_0x42fc3a[_0xef23('0x21')]};}):[]};}):[]};}):[]:[]})[_0xef23('0xc')](function(_0x3f5af2){logger[_0xef23('0xd')]('GetSalesforceAccount',_0x2fe584);logger[_0xef23('0x10')](_0xef23('0x18'),_0x2fe584,JSON[_0xef23('0x12')](_0x3f5af2));_0x2d9fd8(_0x3f5af2);})[_0xef23('0x17')](function(_0x3d94d2){logger[_0xef23('0x13')](_0xef23('0x18'),_0x3d94d2[_0xef23('0x15')],_0x2fe584);_0x303391(_0x13f67f[_0xef23('0x13')](0x1f4,_0x3d94d2[_0xef23('0x15')]));});});};exports['ShowSalesforceAccount']=function(_0x1da93a){var _0x1b3074=this;return new Promise(function(_0x3f9f84,_0x4ef74f){return db[_0xef23('0x19')]['find']({'raw':_0x1da93a[_0xef23('0x1b')]?_0x1da93a['options'][_0xef23('0x1c')]===undefined?!![]:![]:!![],'where':_0x1da93a[_0xef23('0x1b')]?_0x1da93a[_0xef23('0x1b')][_0xef23('0x1d')]||null:null,'attributes':_0x1da93a[_0xef23('0x1b')]?_0x1da93a['options'][_0xef23('0x21')]||null:null,'include':_0x1da93a[_0xef23('0x1b')]?_0x1da93a['options']['include']?_[_0xef23('0x1f')](_0x1da93a[_0xef23('0x1b')][_0xef23('0x22')],function(_0x3f744e){return{'model':db[_0x3f744e[_0xef23('0x20')]],'as':_0x3f744e['as'],'attributes':_0x3f744e['attributes'],'include':_0x3f744e[_0xef23('0x22')]?_[_0xef23('0x1f')](_0x3f744e[_0xef23('0x22')],function(_0x495ca8){return{'model':db[_0x495ca8['model']],'as':_0x495ca8['as'],'attributes':_0x495ca8[_0xef23('0x21')],'include':_0x495ca8[_0xef23('0x22')]?_[_0xef23('0x1f')](_0x495ca8[_0xef23('0x22')],function(_0x76bb9e){return{'model':db[_0x76bb9e['model']],'as':_0x76bb9e['as'],'attributes':_0x76bb9e[_0xef23('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd7b81a){logger[_0xef23('0xd')](_0xef23('0x23'),_0x1da93a);logger['debug'](_0xef23('0x23'),_0x1da93a,JSON[_0xef23('0x12')](_0xd7b81a));_0x3f9f84(_0xd7b81a);})[_0xef23('0x17')](function(_0x59a9a7){logger['error'](_0xef23('0x23'),_0x59a9a7['message'],_0x1da93a);_0x4ef74f(_0x1b3074['error'](0x1f4,_0x59a9a7[_0xef23('0x15')]));});});}; \ No newline at end of file +var _0x43b1=['findAll','options','raw','where','attributes','limit','include','model','map','debug','GetSalesforceAccount','stringify','catch','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','error','message','result','SalesforceAccount'];(function(_0x2721bf,_0x3d36e0){var _0x3e4133=function(_0x4f9846){while(--_0x4f9846){_0x2721bf['push'](_0x2721bf['shift']());}};_0x3e4133(++_0x3d36e0);}(_0x43b1,0xb3));var _0x143b=function(_0x4e614d,_0x1b1973){_0x4e614d=_0x4e614d-0x0;var _0xf046f1=_0x43b1[_0x4e614d];return _0xf046f1;};'use strict';var _=require(_0x143b('0x0'));var util=require(_0x143b('0x1'));var moment=require(_0x143b('0x2'));var BPromise=require(_0x143b('0x3'));var rs=require(_0x143b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x143b('0x5'));var logger=require(_0x143b('0x6'))(_0x143b('0x7'));var config=require(_0x143b('0x8'));var jayson=require(_0x143b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2efe83,_0x57901e,_0xbdd6c8){return new BPromise(function(_0x161bc3,_0x40fa40){return client[_0x143b('0xa')](_0x2efe83,_0xbdd6c8)[_0x143b('0xb')](function(_0x1c5ecd){logger[_0x143b('0xc')](_0x143b('0xd'),_0x57901e,_0x143b('0xe'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x57901e,_0x143b('0xe'),JSON['stringify'](_0x1c5ecd));if(_0x1c5ecd['error']){if(_0x1c5ecd[_0x143b('0xf')]['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x57901e,_0x1c5ecd[_0x143b('0xf')][_0x143b('0x10')]);return _0x40fa40(_0x1c5ecd[_0x143b('0xf')][_0x143b('0x10')]);}logger['error'](_0x143b('0xd'),_0x57901e,_0x1c5ecd[_0x143b('0xf')][_0x143b('0x10')]);return _0x161bc3(_0x1c5ecd[_0x143b('0xf')][_0x143b('0x10')]);}else{logger[_0x143b('0xc')](_0x143b('0xd'),_0x57901e,'request\x20sent');_0x161bc3(_0x1c5ecd[_0x143b('0x11')][_0x143b('0x10')]);}})['catch'](function(_0x2ab1e1){logger[_0x143b('0xf')](_0x143b('0xd'),_0x57901e,_0x2ab1e1);_0x40fa40(_0x2ab1e1);});});}exports['GetSalesforceAccount']=function(_0x5e4493){var _0x483004=this;return new Promise(function(_0x11e662,_0xdc8d1b){return db[_0x143b('0x12')][_0x143b('0x13')]({'raw':_0x5e4493[_0x143b('0x14')]?_0x5e4493[_0x143b('0x14')][_0x143b('0x15')]===undefined?!![]:![]:!![],'where':_0x5e4493[_0x143b('0x14')]?_0x5e4493[_0x143b('0x14')][_0x143b('0x16')]||null:null,'attributes':_0x5e4493[_0x143b('0x14')]?_0x5e4493[_0x143b('0x14')][_0x143b('0x17')]||null:null,'limit':_0x5e4493[_0x143b('0x14')]?_0x5e4493[_0x143b('0x14')][_0x143b('0x18')]||null:null,'include':_0x5e4493['options']?_0x5e4493[_0x143b('0x14')][_0x143b('0x19')]?_['map'](_0x5e4493[_0x143b('0x14')][_0x143b('0x19')],function(_0x1ac0c0){return{'model':db[_0x1ac0c0[_0x143b('0x1a')]],'as':_0x1ac0c0['as'],'attributes':_0x1ac0c0[_0x143b('0x17')],'include':_0x1ac0c0[_0x143b('0x19')]?_['map'](_0x1ac0c0[_0x143b('0x19')],function(_0xe4e31){return{'model':db[_0xe4e31['model']],'as':_0xe4e31['as'],'attributes':_0xe4e31[_0x143b('0x17')],'include':_0xe4e31[_0x143b('0x19')]?_[_0x143b('0x1b')](_0xe4e31['include'],function(_0x1424cc){return{'model':db[_0x1424cc[_0x143b('0x1a')]],'as':_0x1424cc['as'],'attributes':_0x1424cc[_0x143b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x143b('0xb')](function(_0x2a0f1a){logger['info']('GetSalesforceAccount',_0x5e4493);logger[_0x143b('0x1c')](_0x143b('0x1d'),_0x5e4493,JSON[_0x143b('0x1e')](_0x2a0f1a));_0x11e662(_0x2a0f1a);})[_0x143b('0x1f')](function(_0x365294){logger[_0x143b('0xf')](_0x143b('0x1d'),_0x365294[_0x143b('0x10')],_0x5e4493);_0xdc8d1b(_0x483004[_0x143b('0xf')](0x1f4,_0x365294['message']));});});};exports[_0x143b('0x20')]=function(_0xe88fff){var _0x23be76=this;return new Promise(function(_0x185f80,_0x54eee0){return db[_0x143b('0x12')]['find']({'raw':_0xe88fff[_0x143b('0x14')]?_0xe88fff[_0x143b('0x14')][_0x143b('0x15')]===undefined?!![]:![]:!![],'where':_0xe88fff[_0x143b('0x14')]?_0xe88fff[_0x143b('0x14')][_0x143b('0x16')]||null:null,'attributes':_0xe88fff[_0x143b('0x14')]?_0xe88fff[_0x143b('0x14')][_0x143b('0x17')]||null:null,'include':_0xe88fff[_0x143b('0x14')]?_0xe88fff[_0x143b('0x14')][_0x143b('0x19')]?_[_0x143b('0x1b')](_0xe88fff['options']['include'],function(_0x7455a6){return{'model':db[_0x7455a6[_0x143b('0x1a')]],'as':_0x7455a6['as'],'attributes':_0x7455a6['attributes'],'include':_0x7455a6[_0x143b('0x19')]?_[_0x143b('0x1b')](_0x7455a6[_0x143b('0x19')],function(_0x4c07c8){return{'model':db[_0x4c07c8[_0x143b('0x1a')]],'as':_0x4c07c8['as'],'attributes':_0x4c07c8[_0x143b('0x17')],'include':_0x4c07c8[_0x143b('0x19')]?_[_0x143b('0x1b')](_0x4c07c8[_0x143b('0x19')],function(_0x2e0470){return{'model':db[_0x2e0470[_0x143b('0x1a')]],'as':_0x2e0470['as'],'attributes':_0x2e0470[_0x143b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x143b('0xb')](function(_0x2c1b69){logger[_0x143b('0xc')](_0x143b('0x20'),_0xe88fff);logger[_0x143b('0x1c')](_0x143b('0x20'),_0xe88fff,JSON[_0x143b('0x1e')](_0x2c1b69));_0x185f80(_0x2c1b69);})['catch'](function(_0x2c676e){logger['error']('ShowSalesforceAccount',_0x2c676e['message'],_0xe88fff);_0x54eee0(_0x23be76[_0x143b('0xf')](0x1f4,_0x2c676e['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 929bf62..a48e28b 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x475ce3,_0x432979){var _0x29580e=function(_0xb34c59){while(--_0xb34c59){_0x475ce3['push'](_0x475ce3['shift']());}};_0x29580e(++_0x432979);}(_0x7a54,0x106));var _0x47a5=function(_0x592f72,_0xcec8d5){_0x592f72=_0x592f72-0x0;var _0x2e7610=_0x7a54[_0x592f72];return _0x2e7610;};'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('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x2e2685,_0x5e17c4){var _0x1854ec=function(_0x60abca){while(--_0x60abca){_0x2e2685['push'](_0x2e2685['shift']());}};_0x1854ec(++_0x5e17c4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index fb0b720..d38a6ec 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 _0x367f=['lead','account_contact_lead','account','nothing','STRING','sequelize','exports','Case','Task','ENUM','contact_lead','contact'];(function(_0x8ff472,_0x41c1e7){var _0x3ab9b3=function(_0x5b4d46){while(--_0x5b4d46){_0x8ff472['push'](_0x8ff472['shift']());}};_0x3ab9b3(++_0x41c1e7);}(_0x367f,0x179));var _0xf367=function(_0x42228c,_0x21f77d){_0x42228c=_0x42228c-0x0;var _0x450787=_0x367f[_0x42228c];return _0x450787;};'use strict';var Sequelize=require(_0xf367('0x0'));module[_0xf367('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM']('Task',_0xf367('0x2')),'defaultValue':_0xf367('0x3')},'moduleSearch':{'type':Sequelize[_0xf367('0x4')](_0xf367('0x5'),_0xf367('0x6'),_0xf367('0x7'),_0xf367('0x8'),_0xf367('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xf367('0x4')](_0xf367('0xa'),'contact',_0xf367('0x7'),_0xf367('0x9')),'defaultValue':_0xf367('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xf367('0xb')]},'additionalSearchContact':{'type':Sequelize[_0xf367('0xb')]},'additionalSearchLead':{'type':Sequelize[_0xf367('0xb')]}}; \ No newline at end of file +var _0x9f98=['account_contact_lead','account','nothing','contact','sequelize','exports','STRING','Task','Case','ENUM','contact_lead','lead'];(function(_0x2fbd2b,_0x17c378){var _0x1fa4d0=function(_0x27552c){while(--_0x27552c){_0x2fbd2b['push'](_0x2fbd2b['shift']());}};_0x1fa4d0(++_0x17c378);}(_0x9f98,0xac));var _0x89f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9f98[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x89f9('0x0'));module[_0x89f9('0x1')]={'name':{'type':Sequelize[_0x89f9('0x2')]},'description':{'type':Sequelize[_0x89f9('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x89f9('0x3'),_0x89f9('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x89f9('0x5')](_0x89f9('0x6'),'contact',_0x89f9('0x7'),_0x89f9('0x8'),_0x89f9('0x9')),'defaultValue':_0x89f9('0x6')},'moduleCreate':{'type':Sequelize[_0x89f9('0x5')](_0x89f9('0xa'),_0x89f9('0xb'),'lead','account'),'defaultValue':_0x89f9('0x7')},'leadId':{'type':Sequelize[_0x89f9('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x89f9('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x89f9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 362cea2..4c555d0 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 _0x5c71=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','length','create','body','find','getFields','findOne','SalesforceField','rawAttributes','order','getSubjects','nolimit','getDescriptions','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'];(function(_0x577d4c,_0x589a5d){var _0x402a3b=function(_0x38d426){while(--_0x38d426){_0x577d4c['push'](_0x577d4c['shift']());}};_0x402a3b(++_0x589a5d);}(_0x5c71,0x1e5));var _0x15c7=function(_0x5307d8,_0x3112a9){_0x5307d8=_0x5307d8-0x0;var _0x547d68=_0x5c71[_0x5307d8];return _0x547d68;};'use strict';var emlformat=require(_0x15c7('0x0'));var rimraf=require(_0x15c7('0x1'));var zipdir=require(_0x15c7('0x2'));var jsonpatch=require(_0x15c7('0x3'));var rp=require(_0x15c7('0x4'));var moment=require(_0x15c7('0x5'));var BPromise=require(_0x15c7('0x6'));var Mustache=require(_0x15c7('0x7'));var util=require(_0x15c7('0x8'));var path=require(_0x15c7('0x9'));var sox=require(_0x15c7('0xa'));var csv=require(_0x15c7('0xb'));var ejs=require(_0x15c7('0xc'));var fs=require('fs');var fs_extra=require(_0x15c7('0xd'));var _=require(_0x15c7('0xe'));var squel=require(_0x15c7('0xf'));var crypto=require('crypto');var jsforce=require(_0x15c7('0x10'));var deskjs=require(_0x15c7('0x11'));var toCsv=require(_0x15c7('0xb'));var querystring=require(_0x15c7('0x12'));var Papa=require('papaparse');var Redis=require(_0x15c7('0x13'));var authService=require(_0x15c7('0x14'));var qs=require(_0x15c7('0x15'));var as=require(_0x15c7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15c7('0x17'))(_0x15c7('0x18'));var utils=require(_0x15c7('0x19'));var config=require(_0x15c7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x15c7('0x1b'))['db'];function respondWithStatusCode(_0xed3a3,_0x5bb4cb){_0x5bb4cb=_0x5bb4cb||0xcc;return function(_0x38e057){if(_0x38e057){return _0xed3a3[_0x15c7('0x1c')](_0x5bb4cb);}return _0xed3a3[_0x15c7('0x1d')](_0x5bb4cb)['end']();};}function respondWithResult(_0x1410ca,_0x438ba7){_0x438ba7=_0x438ba7||0xc8;return function(_0x51d81c){if(_0x51d81c){return _0x1410ca[_0x15c7('0x1d')](_0x438ba7)['json'](_0x51d81c);}};}function respondWithFilteredResult(_0x274f3a,_0x1363b6){return function(_0x51c250){if(_0x51c250){var _0x739632=typeof _0x1363b6[_0x15c7('0x1e')]===_0x15c7('0x1f')&&typeof _0x1363b6[_0x15c7('0x20')]===_0x15c7('0x1f');var _0x507674=_0x51c250[_0x15c7('0x21')];var _0x3eff9d=_0x739632?0x0:_0x1363b6['offset'];var _0xa342b9=_0x739632?_0x51c250['count']:_0x1363b6[_0x15c7('0x1e')]+_0x1363b6[_0x15c7('0x20')];var _0x56b75a;if(_0xa342b9>=_0x507674){_0xa342b9=_0x507674;_0x56b75a=0xc8;}else{_0x56b75a=0xce;}_0x274f3a[_0x15c7('0x1d')](_0x56b75a);return _0x274f3a['set']('Content-Range',_0x3eff9d+'-'+_0xa342b9+'/'+_0x507674)[_0x15c7('0x22')](_0x51c250);}return null;};}function patchUpdates(_0xe1833d){return function(_0x449c28){try{jsonpatch[_0x15c7('0x23')](_0x449c28,_0xe1833d,!![]);}catch(_0x37bf16){return BPromise['reject'](_0x37bf16);}return _0x449c28[_0x15c7('0x24')]();};}function saveUpdates(_0x50eff7,_0x3c9d98){return function(_0x535c8d){if(_0x535c8d){return _0x535c8d[_0x15c7('0x25')](_0x50eff7)[_0x15c7('0x26')](function(_0x1b8615){return _0x1b8615;});}return null;};}function removeEntity(_0x1cb7d5,_0x179d32){return function(_0x4ac413){if(_0x4ac413){return _0x4ac413[_0x15c7('0x27')]()['then'](function(){_0x1cb7d5[_0x15c7('0x1d')](0xcc)[_0x15c7('0x28')]();});}};}function handleEntityNotFound(_0x2be6dc,_0x961846){return function(_0x4ea401){if(!_0x4ea401){_0x2be6dc['sendStatus'](0x194);}return _0x4ea401;};}function handleError(_0x289725,_0x5dd040){_0x5dd040=_0x5dd040||0x1f4;return function(_0x43e30e){logger[_0x15c7('0x29')](_0x43e30e[_0x15c7('0x2a')]);if(_0x43e30e[_0x15c7('0x2b')]){delete _0x43e30e[_0x15c7('0x2b')];}_0x289725[_0x15c7('0x1d')](_0x5dd040)[_0x15c7('0x2c')](_0x43e30e);};}exports[_0x15c7('0x2d')]=function(_0x5b8385,_0x386e5d){var _0xe61b73={},_0x2eebae={},_0x3d0e3d={'count':0x0,'rows':[]};var _0x334763=_[_0x15c7('0x2e')](db[_0x15c7('0x2f')]['rawAttributes'],function(_0x9fc78a){return{'name':_0x9fc78a[_0x15c7('0x30')],'type':_0x9fc78a[_0x15c7('0x31')][_0x15c7('0x32')]};});_0x2eebae[_0x15c7('0x33')]=_[_0x15c7('0x2e')](_0x334763,_0x15c7('0x2b'));_0x2eebae[_0x15c7('0x34')]=_[_0x15c7('0x35')](_0x5b8385[_0x15c7('0x34')]);_0x2eebae[_0x15c7('0x36')]=_['intersection'](_0x2eebae[_0x15c7('0x33')],_0x2eebae[_0x15c7('0x34')]);_0xe61b73['attributes']=_['intersection'](_0x2eebae['model'],qs[_0x15c7('0x37')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x37')]));_0xe61b73[_0x15c7('0x38')]=_0xe61b73[_0x15c7('0x38')]['length']?_0xe61b73[_0x15c7('0x38')]:_0x2eebae[_0x15c7('0x33')];if(!_0x5b8385[_0x15c7('0x34')][_0x15c7('0x39')]('nolimit')){_0xe61b73[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x20')]);_0xe61b73[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x1e')]);}_0xe61b73['order']=qs[_0x15c7('0x3a')](_0x5b8385[_0x15c7('0x34')][_0x15c7('0x3a')]);_0xe61b73[_0x15c7('0x3b')]=qs[_0x15c7('0x36')](_[_0x15c7('0x3c')](_0x5b8385[_0x15c7('0x34')],_0x2eebae[_0x15c7('0x36')]),_0x334763);if(_0x5b8385[_0x15c7('0x34')][_0x15c7('0x3d')]){_0xe61b73[_0x15c7('0x3b')]=_[_0x15c7('0x3e')](_0xe61b73[_0x15c7('0x3b')],{'$or':_[_0x15c7('0x2e')](_0x334763,function(_0x42ba47){if(_0x42ba47['type']!==_0x15c7('0x3f')){var _0x441aa1={};_0x441aa1[_0x42ba47[_0x15c7('0x2b')]]={'$like':'%'+_0x5b8385[_0x15c7('0x34')][_0x15c7('0x3d')]+'%'};return _0x441aa1;}})});}_0xe61b73=_[_0x15c7('0x3e')]({},_0xe61b73,_0x5b8385[_0x15c7('0x40')]);var _0x2b59c9={'where':_0xe61b73['where']};return db[_0x15c7('0x2f')][_0x15c7('0x21')](_0x2b59c9)[_0x15c7('0x26')](function(_0x4b4ef0){_0x3d0e3d['count']=_0x4b4ef0;if(_0x5b8385[_0x15c7('0x34')]['includeAll']){_0xe61b73[_0x15c7('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x15c7('0x42')](_0xe61b73);})['then'](function(_0x3a9dfb){_0x3d0e3d[_0x15c7('0x43')]=_0x3a9dfb;return _0x3d0e3d;})[_0x15c7('0x26')](respondWithFilteredResult(_0x386e5d,_0xe61b73))[_0x15c7('0x44')](handleError(_0x386e5d,null));};exports[_0x15c7('0x45')]=function(_0x32cbd1,_0x205a58){var _0x445ec6={'raw':![],'where':{'id':_0x32cbd1[_0x15c7('0x46')]['id']}},_0x6665dc={};_0x6665dc[_0x15c7('0x33')]=_['keys'](db[_0x15c7('0x2f')]['rawAttributes']);_0x6665dc['query']=_['keys'](_0x32cbd1[_0x15c7('0x34')]);_0x6665dc[_0x15c7('0x36')]=_[_0x15c7('0x47')](_0x6665dc[_0x15c7('0x33')],_0x6665dc[_0x15c7('0x34')]);_0x445ec6[_0x15c7('0x38')]=_[_0x15c7('0x47')](_0x6665dc[_0x15c7('0x33')],qs['fields'](_0x32cbd1[_0x15c7('0x34')][_0x15c7('0x37')]));_0x445ec6[_0x15c7('0x38')]=_0x445ec6[_0x15c7('0x38')][_0x15c7('0x48')]?_0x445ec6[_0x15c7('0x38')]:_0x6665dc[_0x15c7('0x33')];if(_0x32cbd1[_0x15c7('0x34')]['includeAll']){_0x445ec6[_0x15c7('0x41')]=[{'all':!![]}];}_0x445ec6=_[_0x15c7('0x3e')]({},_0x445ec6,_0x32cbd1['options']);return db['SalesforceConfiguration']['find'](_0x445ec6)['then'](handleEntityNotFound(_0x205a58,null))[_0x15c7('0x26')](respondWithResult(_0x205a58,null))[_0x15c7('0x44')](handleError(_0x205a58,null));};exports[_0x15c7('0x49')]=function(_0x1d329b,_0x2eff2f){return db[_0x15c7('0x2f')][_0x15c7('0x49')](_0x1d329b[_0x15c7('0x4a')],{})[_0x15c7('0x26')](respondWithResult(_0x2eff2f,0xc9))[_0x15c7('0x44')](handleError(_0x2eff2f,null));};exports['update']=function(_0x5e8e26,_0x432818){if(_0x5e8e26[_0x15c7('0x4a')]['id']){delete _0x5e8e26[_0x15c7('0x4a')]['id'];}return db[_0x15c7('0x2f')]['find']({'where':{'id':_0x5e8e26[_0x15c7('0x46')]['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x432818,null))['then'](saveUpdates(_0x5e8e26[_0x15c7('0x4a')],null))['then'](respondWithResult(_0x432818,null))[_0x15c7('0x44')](handleError(_0x432818,null));};exports[_0x15c7('0x27')]=function(_0x128eec,_0x4d14fa){return db['SalesforceConfiguration'][_0x15c7('0x4b')]({'where':{'id':_0x128eec[_0x15c7('0x46')]['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x4d14fa,null))[_0x15c7('0x26')](removeEntity(_0x4d14fa,null))[_0x15c7('0x44')](handleError(_0x4d14fa,null));};exports[_0x15c7('0x4c')]=function(_0x12e904,_0x1dfb4d,_0xdda39c){var _0x30a9d4={};var _0x1e6bea={};var _0x32752a;var _0x5f0762;return db['SalesforceConfiguration'][_0x15c7('0x4d')]({'where':{'id':_0x12e904['params']['id']}})['then'](handleEntityNotFound(_0x1dfb4d,null))[_0x15c7('0x26')](function(_0x6e8142){if(_0x6e8142){_0x32752a=_0x6e8142;_0x1e6bea[_0x15c7('0x33')]=_[_0x15c7('0x35')](db[_0x15c7('0x4e')][_0x15c7('0x4f')]);_0x1e6bea['query']=_[_0x15c7('0x35')](_0x12e904[_0x15c7('0x34')]);_0x1e6bea[_0x15c7('0x36')]=_[_0x15c7('0x47')](_0x1e6bea[_0x15c7('0x33')],_0x1e6bea[_0x15c7('0x34')]);_0x30a9d4['attributes']=_[_0x15c7('0x47')](_0x1e6bea[_0x15c7('0x33')],qs[_0x15c7('0x37')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x37')]));_0x30a9d4['attributes']=_0x30a9d4['attributes']['length']?_0x30a9d4['attributes']:_0x1e6bea['model'];_0x30a9d4[_0x15c7('0x50')]=qs[_0x15c7('0x3a')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x3a')]);_0x30a9d4[_0x15c7('0x3b')]=qs[_0x15c7('0x36')](_[_0x15c7('0x3c')](_0x12e904[_0x15c7('0x34')],_0x1e6bea[_0x15c7('0x36')]));if(_0x12e904['query']['filter']){_0x30a9d4[_0x15c7('0x3b')]=_[_0x15c7('0x3e')](_0x30a9d4['where'],{'$or':_[_0x15c7('0x2e')](_0x30a9d4['attributes'],function(_0x177f33){var _0x2bec28={};_0x2bec28[_0x177f33]={'$like':'%'+_0x12e904[_0x15c7('0x34')][_0x15c7('0x3d')]+'%'};return _0x2bec28;})});}_0x30a9d4=_['merge']({},_0x30a9d4,_0x12e904[_0x15c7('0x40')]);return _0x32752a[_0x15c7('0x4c')](_0x30a9d4);}})[_0x15c7('0x26')](function(_0x148b03){if(_0x148b03){_0x5f0762=_0x148b03[_0x15c7('0x48')];if(!_0x12e904[_0x15c7('0x34')][_0x15c7('0x39')]('nolimit')){_0x30a9d4[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x20')]);_0x30a9d4[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x12e904[_0x15c7('0x34')][_0x15c7('0x1e')]);}return _0x32752a[_0x15c7('0x4c')](_0x30a9d4);}})[_0x15c7('0x26')](function(_0x1a4b87){if(_0x1a4b87){return _0x1a4b87?{'count':_0x5f0762,'rows':_0x1a4b87}:null;}})[_0x15c7('0x26')](respondWithResult(_0x1dfb4d,null))[_0x15c7('0x44')](handleError(_0x1dfb4d,null));};exports[_0x15c7('0x51')]=function(_0x4c42d4,_0x2608c8,_0x6c08d3){var _0x5b7ff1={};var _0x140ae6={};var _0x4810be;var _0x1b634b;return db[_0x15c7('0x2f')][_0x15c7('0x4d')]({'where':{'id':_0x4c42d4['params']['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x2608c8,null))[_0x15c7('0x26')](function(_0x5eee5c){if(_0x5eee5c){_0x4810be=_0x5eee5c;_0x140ae6[_0x15c7('0x33')]=_[_0x15c7('0x35')](db['SalesforceField'][_0x15c7('0x4f')]);_0x140ae6['query']=_[_0x15c7('0x35')](_0x4c42d4[_0x15c7('0x34')]);_0x140ae6['filters']=_[_0x15c7('0x47')](_0x140ae6[_0x15c7('0x33')],_0x140ae6[_0x15c7('0x34')]);_0x5b7ff1[_0x15c7('0x38')]=_['intersection'](_0x140ae6[_0x15c7('0x33')],qs[_0x15c7('0x37')](_0x4c42d4[_0x15c7('0x34')][_0x15c7('0x37')]));_0x5b7ff1[_0x15c7('0x38')]=_0x5b7ff1[_0x15c7('0x38')][_0x15c7('0x48')]?_0x5b7ff1[_0x15c7('0x38')]:_0x140ae6[_0x15c7('0x33')];_0x5b7ff1[_0x15c7('0x50')]=qs[_0x15c7('0x3a')](_0x4c42d4[_0x15c7('0x34')][_0x15c7('0x3a')]);_0x5b7ff1[_0x15c7('0x3b')]=qs['filters'](_[_0x15c7('0x3c')](_0x4c42d4[_0x15c7('0x34')],_0x140ae6[_0x15c7('0x36')]));if(_0x4c42d4[_0x15c7('0x34')][_0x15c7('0x3d')]){_0x5b7ff1[_0x15c7('0x3b')]=_[_0x15c7('0x3e')](_0x5b7ff1[_0x15c7('0x3b')],{'$or':_[_0x15c7('0x2e')](_0x5b7ff1[_0x15c7('0x38')],function(_0x44d011){var _0x4ec1e4={};_0x4ec1e4[_0x44d011]={'$like':'%'+_0x4c42d4[_0x15c7('0x34')]['filter']+'%'};return _0x4ec1e4;})});}_0x5b7ff1=_['merge']({},_0x5b7ff1,_0x4c42d4[_0x15c7('0x40')]);return _0x4810be['getSubjects'](_0x5b7ff1);}})[_0x15c7('0x26')](function(_0x23c83f){if(_0x23c83f){_0x1b634b=_0x23c83f[_0x15c7('0x48')];if(!_0x4c42d4['query']['hasOwnProperty'](_0x15c7('0x52'))){_0x5b7ff1[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x4c42d4['query'][_0x15c7('0x20')]);_0x5b7ff1[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x4c42d4['query'][_0x15c7('0x1e')]);}return _0x4810be[_0x15c7('0x51')](_0x5b7ff1);}})['then'](function(_0x70c19d){if(_0x70c19d){return _0x70c19d?{'count':_0x1b634b,'rows':_0x70c19d}:null;}})[_0x15c7('0x26')](respondWithResult(_0x2608c8,null))[_0x15c7('0x44')](handleError(_0x2608c8,null));};exports['getDescriptions']=function(_0x4d8212,_0x3490ca,_0x1e9bee){var _0x36627a={};var _0x2aad98={};var _0x11799a;var _0x9ec094;return db[_0x15c7('0x2f')]['findOne']({'where':{'id':_0x4d8212[_0x15c7('0x46')]['id']}})[_0x15c7('0x26')](handleEntityNotFound(_0x3490ca,null))[_0x15c7('0x26')](function(_0xfc81cd){if(_0xfc81cd){_0x11799a=_0xfc81cd;_0x2aad98['model']=_[_0x15c7('0x35')](db[_0x15c7('0x4e')][_0x15c7('0x4f')]);_0x2aad98[_0x15c7('0x34')]=_[_0x15c7('0x35')](_0x4d8212['query']);_0x2aad98[_0x15c7('0x36')]=_['intersection'](_0x2aad98[_0x15c7('0x33')],_0x2aad98[_0x15c7('0x34')]);_0x36627a[_0x15c7('0x38')]=_[_0x15c7('0x47')](_0x2aad98[_0x15c7('0x33')],qs[_0x15c7('0x37')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x37')]));_0x36627a[_0x15c7('0x38')]=_0x36627a[_0x15c7('0x38')]['length']?_0x36627a[_0x15c7('0x38')]:_0x2aad98[_0x15c7('0x33')];_0x36627a[_0x15c7('0x50')]=qs[_0x15c7('0x3a')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x3a')]);_0x36627a[_0x15c7('0x3b')]=qs[_0x15c7('0x36')](_['pick'](_0x4d8212['query'],_0x2aad98['filters']));if(_0x4d8212[_0x15c7('0x34')][_0x15c7('0x3d')]){_0x36627a['where']=_[_0x15c7('0x3e')](_0x36627a[_0x15c7('0x3b')],{'$or':_['map'](_0x36627a[_0x15c7('0x38')],function(_0x23bfcd){var _0x47a27b={};_0x47a27b[_0x23bfcd]={'$like':'%'+_0x4d8212[_0x15c7('0x34')]['filter']+'%'};return _0x47a27b;})});}_0x36627a=_[_0x15c7('0x3e')]({},_0x36627a,_0x4d8212['options']);return _0x11799a[_0x15c7('0x53')](_0x36627a);}})[_0x15c7('0x26')](function(_0x1d3139){if(_0x1d3139){_0x9ec094=_0x1d3139['length'];if(!_0x4d8212[_0x15c7('0x34')][_0x15c7('0x39')](_0x15c7('0x52'))){_0x36627a[_0x15c7('0x20')]=qs[_0x15c7('0x20')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x20')]);_0x36627a[_0x15c7('0x1e')]=qs[_0x15c7('0x1e')](_0x4d8212[_0x15c7('0x34')][_0x15c7('0x1e')]);}return _0x11799a[_0x15c7('0x53')](_0x36627a);}})[_0x15c7('0x26')](function(_0x28d390){if(_0x28d390){return _0x28d390?{'count':_0x9ec094,'rows':_0x28d390}:null;}})[_0x15c7('0x26')](respondWithResult(_0x3490ca,null))['catch'](handleError(_0x3490ca,null));}; \ No newline at end of file +var _0x0447=['SalesforceField','rawAttributes','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../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','apply','reject','update','then','error','name','send','index','map','SalesforceConfiguration','fieldName','type','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','getFields'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0x0447,0x141));var _0x7044=function(_0x2c0931,_0x503573){_0x2c0931=_0x2c0931-0x0;var _0x3d781f=_0x0447[_0x2c0931];return _0x3d781f;};'use strict';var emlformat=require(_0x7044('0x0'));var rimraf=require(_0x7044('0x1'));var zipdir=require(_0x7044('0x2'));var jsonpatch=require(_0x7044('0x3'));var rp=require(_0x7044('0x4'));var moment=require(_0x7044('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7044('0x6'));var util=require(_0x7044('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7044('0x8'));var ejs=require(_0x7044('0x9'));var fs=require('fs');var fs_extra=require(_0x7044('0xa'));var _=require('lodash');var squel=require(_0x7044('0xb'));var crypto=require(_0x7044('0xc'));var jsforce=require(_0x7044('0xd'));var deskjs=require(_0x7044('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7044('0xf'));var Redis=require('ioredis');var authService=require(_0x7044('0x10'));var qs=require(_0x7044('0x11'));var as=require(_0x7044('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7044('0x13'))(_0x7044('0x14'));var utils=require(_0x7044('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7044('0x16'));var db=require(_0x7044('0x17'))['db'];function respondWithStatusCode(_0x4f1c80,_0x553b49){_0x553b49=_0x553b49||0xcc;return function(_0x229a8b){if(_0x229a8b){return _0x4f1c80[_0x7044('0x18')](_0x553b49);}return _0x4f1c80[_0x7044('0x19')](_0x553b49)[_0x7044('0x1a')]();};}function respondWithResult(_0x56826d,_0x2b3b7c){_0x2b3b7c=_0x2b3b7c||0xc8;return function(_0x59e230){if(_0x59e230){return _0x56826d['status'](_0x2b3b7c)[_0x7044('0x1b')](_0x59e230);}};}function respondWithFilteredResult(_0x493e05,_0x33b816){return function(_0xc68395){if(_0xc68395){var _0x13c8a2=typeof _0x33b816[_0x7044('0x1c')]===_0x7044('0x1d')&&typeof _0x33b816[_0x7044('0x1e')]===_0x7044('0x1d');var _0x119f09=_0xc68395[_0x7044('0x1f')];var _0x338df4=_0x13c8a2?0x0:_0x33b816[_0x7044('0x1c')];var _0x2ca24b=_0x13c8a2?_0xc68395[_0x7044('0x1f')]:_0x33b816['offset']+_0x33b816[_0x7044('0x1e')];var _0x1da3b1;if(_0x2ca24b>=_0x119f09){_0x2ca24b=_0x119f09;_0x1da3b1=0xc8;}else{_0x1da3b1=0xce;}_0x493e05[_0x7044('0x19')](_0x1da3b1);return _0x493e05[_0x7044('0x20')]('Content-Range',_0x338df4+'-'+_0x2ca24b+'/'+_0x119f09)['json'](_0xc68395);}return null;};}function patchUpdates(_0x324945){return function(_0x2d7406){try{jsonpatch[_0x7044('0x21')](_0x2d7406,_0x324945,!![]);}catch(_0x583041){return BPromise[_0x7044('0x22')](_0x583041);}return _0x2d7406['save']();};}function saveUpdates(_0x6a0d35,_0x50937d){return function(_0x217c89){if(_0x217c89){return _0x217c89[_0x7044('0x23')](_0x6a0d35)[_0x7044('0x24')](function(_0x3efbdb){return _0x3efbdb;});}return null;};}function removeEntity(_0x2e4b6f,_0x18e668){return function(_0x224e43){if(_0x224e43){return _0x224e43['destroy']()[_0x7044('0x24')](function(){_0x2e4b6f[_0x7044('0x19')](0xcc)[_0x7044('0x1a')]();});}};}function handleEntityNotFound(_0x2f5875,_0x7f9675){return function(_0x2ecfad){if(!_0x2ecfad){_0x2f5875['sendStatus'](0x194);}return _0x2ecfad;};}function handleError(_0x4c163d,_0x37dfa4){_0x37dfa4=_0x37dfa4||0x1f4;return function(_0x2c554a){logger[_0x7044('0x25')](_0x2c554a['stack']);if(_0x2c554a[_0x7044('0x26')]){delete _0x2c554a[_0x7044('0x26')];}_0x4c163d[_0x7044('0x19')](_0x37dfa4)[_0x7044('0x27')](_0x2c554a);};}exports[_0x7044('0x28')]=function(_0xcd5e0e,_0x3b05a8){var _0x399799={},_0x97cdd8={},_0x318b5f={'count':0x0,'rows':[]};var _0x5eb6d7=_[_0x7044('0x29')](db[_0x7044('0x2a')]['rawAttributes'],function(_0x2d5cd7){return{'name':_0x2d5cd7[_0x7044('0x2b')],'type':_0x2d5cd7[_0x7044('0x2c')]['key']};});_0x97cdd8['model']=_[_0x7044('0x29')](_0x5eb6d7,_0x7044('0x26'));_0x97cdd8[_0x7044('0x2d')]=_[_0x7044('0x2e')](_0xcd5e0e[_0x7044('0x2d')]);_0x97cdd8['filters']=_[_0x7044('0x2f')](_0x97cdd8['model'],_0x97cdd8[_0x7044('0x2d')]);_0x399799[_0x7044('0x30')]=_[_0x7044('0x2f')](_0x97cdd8['model'],qs[_0x7044('0x31')](_0xcd5e0e['query']['fields']));_0x399799[_0x7044('0x30')]=_0x399799[_0x7044('0x30')][_0x7044('0x32')]?_0x399799[_0x7044('0x30')]:_0x97cdd8[_0x7044('0x33')];if(!_0xcd5e0e[_0x7044('0x2d')][_0x7044('0x34')](_0x7044('0x35'))){_0x399799[_0x7044('0x1e')]=qs['limit'](_0xcd5e0e[_0x7044('0x2d')]['limit']);_0x399799[_0x7044('0x1c')]=qs[_0x7044('0x1c')](_0xcd5e0e[_0x7044('0x2d')][_0x7044('0x1c')]);}_0x399799[_0x7044('0x36')]=qs[_0x7044('0x37')](_0xcd5e0e['query'][_0x7044('0x37')]);_0x399799[_0x7044('0x38')]=qs[_0x7044('0x39')](_[_0x7044('0x3a')](_0xcd5e0e[_0x7044('0x2d')],_0x97cdd8[_0x7044('0x39')]),_0x5eb6d7);if(_0xcd5e0e['query']['filter']){_0x399799[_0x7044('0x38')]=_[_0x7044('0x3b')](_0x399799['where'],{'$or':_['map'](_0x5eb6d7,function(_0x186c1f){if(_0x186c1f[_0x7044('0x2c')]!==_0x7044('0x3c')){var _0x5224b9={};_0x5224b9[_0x186c1f['name']]={'$like':'%'+_0xcd5e0e[_0x7044('0x2d')][_0x7044('0x3d')]+'%'};return _0x5224b9;}})});}_0x399799=_[_0x7044('0x3b')]({},_0x399799,_0xcd5e0e[_0x7044('0x3e')]);var _0x5c965e={'where':_0x399799[_0x7044('0x38')]};return db['SalesforceConfiguration'][_0x7044('0x1f')](_0x5c965e)[_0x7044('0x24')](function(_0x7bdbb1){_0x318b5f['count']=_0x7bdbb1;if(_0xcd5e0e[_0x7044('0x2d')]['includeAll']){_0x399799[_0x7044('0x3f')]=[{'all':!![]}];}return db[_0x7044('0x2a')][_0x7044('0x40')](_0x399799);})['then'](function(_0x2b89aa){_0x318b5f[_0x7044('0x41')]=_0x2b89aa;return _0x318b5f;})[_0x7044('0x24')](respondWithFilteredResult(_0x3b05a8,_0x399799))[_0x7044('0x42')](handleError(_0x3b05a8,null));};exports['show']=function(_0x5f2d13,_0x117b97){var _0x112105={'raw':![],'where':{'id':_0x5f2d13[_0x7044('0x43')]['id']}},_0x125f6d={};_0x125f6d[_0x7044('0x33')]=_[_0x7044('0x2e')](db[_0x7044('0x2a')]['rawAttributes']);_0x125f6d[_0x7044('0x2d')]=_[_0x7044('0x2e')](_0x5f2d13[_0x7044('0x2d')]);_0x125f6d[_0x7044('0x39')]=_[_0x7044('0x2f')](_0x125f6d['model'],_0x125f6d[_0x7044('0x2d')]);_0x112105[_0x7044('0x30')]=_[_0x7044('0x2f')](_0x125f6d[_0x7044('0x33')],qs[_0x7044('0x31')](_0x5f2d13[_0x7044('0x2d')]['fields']));_0x112105['attributes']=_0x112105['attributes'][_0x7044('0x32')]?_0x112105[_0x7044('0x30')]:_0x125f6d[_0x7044('0x33')];if(_0x5f2d13[_0x7044('0x2d')][_0x7044('0x44')]){_0x112105[_0x7044('0x3f')]=[{'all':!![]}];}_0x112105=_[_0x7044('0x3b')]({},_0x112105,_0x5f2d13[_0x7044('0x3e')]);return db[_0x7044('0x2a')][_0x7044('0x45')](_0x112105)[_0x7044('0x24')](handleEntityNotFound(_0x117b97,null))[_0x7044('0x24')](respondWithResult(_0x117b97,null))[_0x7044('0x42')](handleError(_0x117b97,null));};exports[_0x7044('0x46')]=function(_0xdd0de5,_0x3d6776){return db[_0x7044('0x2a')]['create'](_0xdd0de5[_0x7044('0x47')],{})[_0x7044('0x24')](respondWithResult(_0x3d6776,0xc9))[_0x7044('0x42')](handleError(_0x3d6776,null));};exports['update']=function(_0xe7af2d,_0x40309e){if(_0xe7af2d[_0x7044('0x47')]['id']){delete _0xe7af2d[_0x7044('0x47')]['id'];}return db['SalesforceConfiguration'][_0x7044('0x45')]({'where':{'id':_0xe7af2d[_0x7044('0x43')]['id']}})[_0x7044('0x24')](handleEntityNotFound(_0x40309e,null))[_0x7044('0x24')](saveUpdates(_0xe7af2d[_0x7044('0x47')],null))['then'](respondWithResult(_0x40309e,null))[_0x7044('0x42')](handleError(_0x40309e,null));};exports[_0x7044('0x48')]=function(_0x4f2818,_0x3a9b03){return db['SalesforceConfiguration'][_0x7044('0x45')]({'where':{'id':_0x4f2818[_0x7044('0x43')]['id']}})[_0x7044('0x24')](handleEntityNotFound(_0x3a9b03,null))[_0x7044('0x24')](removeEntity(_0x3a9b03,null))[_0x7044('0x42')](handleError(_0x3a9b03,null));};exports[_0x7044('0x49')]=function(_0x5a13e1,_0x4aab88,_0x374f02){var _0x10ddfd={};var _0x30e90b={};var _0x386a18;var _0x144310;return db[_0x7044('0x2a')]['findOne']({'where':{'id':_0x5a13e1[_0x7044('0x43')]['id']}})[_0x7044('0x24')](handleEntityNotFound(_0x4aab88,null))['then'](function(_0x12a8f3){if(_0x12a8f3){_0x386a18=_0x12a8f3;_0x30e90b[_0x7044('0x33')]=_[_0x7044('0x2e')](db[_0x7044('0x4a')][_0x7044('0x4b')]);_0x30e90b['query']=_[_0x7044('0x2e')](_0x5a13e1[_0x7044('0x2d')]);_0x30e90b['filters']=_[_0x7044('0x2f')](_0x30e90b[_0x7044('0x33')],_0x30e90b[_0x7044('0x2d')]);_0x10ddfd['attributes']=_[_0x7044('0x2f')](_0x30e90b[_0x7044('0x33')],qs[_0x7044('0x31')](_0x5a13e1['query'][_0x7044('0x31')]));_0x10ddfd['attributes']=_0x10ddfd[_0x7044('0x30')][_0x7044('0x32')]?_0x10ddfd[_0x7044('0x30')]:_0x30e90b[_0x7044('0x33')];_0x10ddfd[_0x7044('0x36')]=qs['sort'](_0x5a13e1['query']['sort']);_0x10ddfd[_0x7044('0x38')]=qs[_0x7044('0x39')](_['pick'](_0x5a13e1[_0x7044('0x2d')],_0x30e90b[_0x7044('0x39')]));if(_0x5a13e1['query'][_0x7044('0x3d')]){_0x10ddfd[_0x7044('0x38')]=_[_0x7044('0x3b')](_0x10ddfd[_0x7044('0x38')],{'$or':_[_0x7044('0x29')](_0x10ddfd[_0x7044('0x30')],function(_0x2fdb80){var _0x46f743={};_0x46f743[_0x2fdb80]={'$like':'%'+_0x5a13e1[_0x7044('0x2d')][_0x7044('0x3d')]+'%'};return _0x46f743;})});}_0x10ddfd=_[_0x7044('0x3b')]({},_0x10ddfd,_0x5a13e1[_0x7044('0x3e')]);return _0x386a18[_0x7044('0x49')](_0x10ddfd);}})['then'](function(_0x191d3c){if(_0x191d3c){_0x144310=_0x191d3c['length'];if(!_0x5a13e1[_0x7044('0x2d')][_0x7044('0x34')]('nolimit')){_0x10ddfd[_0x7044('0x1e')]=qs[_0x7044('0x1e')](_0x5a13e1[_0x7044('0x2d')][_0x7044('0x1e')]);_0x10ddfd[_0x7044('0x1c')]=qs[_0x7044('0x1c')](_0x5a13e1['query'][_0x7044('0x1c')]);}return _0x386a18[_0x7044('0x49')](_0x10ddfd);}})['then'](function(_0x4e550a){if(_0x4e550a){return _0x4e550a?{'count':_0x144310,'rows':_0x4e550a}:null;}})[_0x7044('0x24')](respondWithResult(_0x4aab88,null))[_0x7044('0x42')](handleError(_0x4aab88,null));};exports[_0x7044('0x4c')]=function(_0x4a1da2,_0x527229,_0x56a6ad){var _0x46b0a7={};var _0x1ab6a3={};var _0x385aa8;var _0x49074f;return db[_0x7044('0x2a')][_0x7044('0x4d')]({'where':{'id':_0x4a1da2[_0x7044('0x43')]['id']}})[_0x7044('0x24')](handleEntityNotFound(_0x527229,null))['then'](function(_0x2d7a64){if(_0x2d7a64){_0x385aa8=_0x2d7a64;_0x1ab6a3[_0x7044('0x33')]=_[_0x7044('0x2e')](db['SalesforceField'][_0x7044('0x4b')]);_0x1ab6a3[_0x7044('0x2d')]=_['keys'](_0x4a1da2[_0x7044('0x2d')]);_0x1ab6a3[_0x7044('0x39')]=_['intersection'](_0x1ab6a3[_0x7044('0x33')],_0x1ab6a3['query']);_0x46b0a7[_0x7044('0x30')]=_['intersection'](_0x1ab6a3[_0x7044('0x33')],qs['fields'](_0x4a1da2[_0x7044('0x2d')]['fields']));_0x46b0a7[_0x7044('0x30')]=_0x46b0a7[_0x7044('0x30')][_0x7044('0x32')]?_0x46b0a7[_0x7044('0x30')]:_0x1ab6a3[_0x7044('0x33')];_0x46b0a7[_0x7044('0x36')]=qs[_0x7044('0x37')](_0x4a1da2[_0x7044('0x2d')][_0x7044('0x37')]);_0x46b0a7[_0x7044('0x38')]=qs['filters'](_[_0x7044('0x3a')](_0x4a1da2['query'],_0x1ab6a3['filters']));if(_0x4a1da2[_0x7044('0x2d')]['filter']){_0x46b0a7[_0x7044('0x38')]=_[_0x7044('0x3b')](_0x46b0a7['where'],{'$or':_[_0x7044('0x29')](_0x46b0a7[_0x7044('0x30')],function(_0x54c8c7){var _0x10f5bd={};_0x10f5bd[_0x54c8c7]={'$like':'%'+_0x4a1da2[_0x7044('0x2d')]['filter']+'%'};return _0x10f5bd;})});}_0x46b0a7=_[_0x7044('0x3b')]({},_0x46b0a7,_0x4a1da2['options']);return _0x385aa8['getSubjects'](_0x46b0a7);}})[_0x7044('0x24')](function(_0x319902){if(_0x319902){_0x49074f=_0x319902[_0x7044('0x32')];if(!_0x4a1da2['query'][_0x7044('0x34')]('nolimit')){_0x46b0a7[_0x7044('0x1e')]=qs[_0x7044('0x1e')](_0x4a1da2[_0x7044('0x2d')][_0x7044('0x1e')]);_0x46b0a7['offset']=qs[_0x7044('0x1c')](_0x4a1da2[_0x7044('0x2d')][_0x7044('0x1c')]);}return _0x385aa8[_0x7044('0x4c')](_0x46b0a7);}})[_0x7044('0x24')](function(_0x43bdae){if(_0x43bdae){return _0x43bdae?{'count':_0x49074f,'rows':_0x43bdae}:null;}})['then'](respondWithResult(_0x527229,null))[_0x7044('0x42')](handleError(_0x527229,null));};exports['getDescriptions']=function(_0x5901b0,_0x177695,_0x4dd866){var _0x40f909={};var _0x2dc828={};var _0x1e8a1d;var _0x3ad2ca;return db[_0x7044('0x2a')][_0x7044('0x4d')]({'where':{'id':_0x5901b0[_0x7044('0x43')]['id']}})[_0x7044('0x24')](handleEntityNotFound(_0x177695,null))[_0x7044('0x24')](function(_0x2119aa){if(_0x2119aa){_0x1e8a1d=_0x2119aa;_0x2dc828[_0x7044('0x33')]=_[_0x7044('0x2e')](db['SalesforceField'][_0x7044('0x4b')]);_0x2dc828['query']=_[_0x7044('0x2e')](_0x5901b0['query']);_0x2dc828['filters']=_[_0x7044('0x2f')](_0x2dc828[_0x7044('0x33')],_0x2dc828['query']);_0x40f909['attributes']=_[_0x7044('0x2f')](_0x2dc828[_0x7044('0x33')],qs['fields'](_0x5901b0[_0x7044('0x2d')][_0x7044('0x31')]));_0x40f909[_0x7044('0x30')]=_0x40f909['attributes'][_0x7044('0x32')]?_0x40f909['attributes']:_0x2dc828[_0x7044('0x33')];_0x40f909[_0x7044('0x36')]=qs[_0x7044('0x37')](_0x5901b0[_0x7044('0x2d')][_0x7044('0x37')]);_0x40f909[_0x7044('0x38')]=qs[_0x7044('0x39')](_['pick'](_0x5901b0[_0x7044('0x2d')],_0x2dc828[_0x7044('0x39')]));if(_0x5901b0[_0x7044('0x2d')][_0x7044('0x3d')]){_0x40f909['where']=_['merge'](_0x40f909[_0x7044('0x38')],{'$or':_[_0x7044('0x29')](_0x40f909[_0x7044('0x30')],function(_0xad0d48){var _0x48ca88={};_0x48ca88[_0xad0d48]={'$like':'%'+_0x5901b0[_0x7044('0x2d')]['filter']+'%'};return _0x48ca88;})});}_0x40f909=_[_0x7044('0x3b')]({},_0x40f909,_0x5901b0[_0x7044('0x3e')]);return _0x1e8a1d[_0x7044('0x4e')](_0x40f909);}})[_0x7044('0x24')](function(_0x2cf194){if(_0x2cf194){_0x3ad2ca=_0x2cf194[_0x7044('0x32')];if(!_0x5901b0[_0x7044('0x2d')][_0x7044('0x34')](_0x7044('0x35'))){_0x40f909[_0x7044('0x1e')]=qs[_0x7044('0x1e')](_0x5901b0[_0x7044('0x2d')]['limit']);_0x40f909[_0x7044('0x1c')]=qs[_0x7044('0x1c')](_0x5901b0[_0x7044('0x2d')][_0x7044('0x1c')]);}return _0x1e8a1d[_0x7044('0x4e')](_0x40f909);}})[_0x7044('0x24')](function(_0x1e95c2){if(_0x1e95c2){return _0x1e95c2?{'count':_0x3ad2ca,'rows':_0x1e95c2}:null;}})['then'](respondWithResult(_0x177695,null))[_0x7044('0x42')](handleError(_0x177695,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3026e96..53ebe56 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 _0xb369=['util','../../config/logger','moment','request-promise','path','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb369,0x10d));var _0x9b36=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb369[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9b36('0x0'));var util=require(_0x9b36('0x1'));var logger=require(_0x9b36('0x2'))('api');var moment=require(_0x9b36('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b36('0x4'));var fs=require('fs');var path=require(_0x9b36('0x5'));var rimraf=require('rimraf');var config=require(_0x9b36('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x31665d,_0x520226){return _0x31665d[_0x9b36('0x7')](_0x9b36('0x8'),attributes,{'tableName':_0x9b36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4ab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa4ab,0x9c));var _0xba4a=function(_0x450eae,_0x2ad04d){_0x450eae=_0x450eae-0x0;var _0x2379d3=_0xa4ab[_0x450eae];return _0x2379d3;};'use strict';var _=require(_0xba4a('0x0'));var util=require(_0xba4a('0x1'));var logger=require(_0xba4a('0x2'))(_0xba4a('0x3'));var moment=require(_0xba4a('0x4'));var BPromise=require(_0xba4a('0x5'));var rp=require(_0xba4a('0x6'));var fs=require('fs');var path=require(_0xba4a('0x7'));var rimraf=require(_0xba4a('0x8'));var config=require(_0xba4a('0x9'));var attributes=require(_0xba4a('0xa'));module['exports']=function(_0x3cf46b,_0x55a528){return _0x3cf46b['define'](_0xba4a('0xb'),attributes,{'tableName':_0xba4a('0xc'),'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 05815f0..f9c4346 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 _0xb138=['debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0xb138,0xec));var _0x8b13=function(_0xc4531,_0x554edd){_0xc4531=_0xc4531-0x0;var _0x44897d=_0xb138[_0xc4531];return _0x44897d;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var BPromise=require(_0x8b13('0x3'));var rs=require(_0x8b13('0x4'));var fs=require('fs');var Redis=require(_0x8b13('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b13('0x6'));var logger=require(_0x8b13('0x7'))(_0x8b13('0x8'));var config=require(_0x8b13('0x9'));var jayson=require(_0x8b13('0xa'));var client=jayson[_0x8b13('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996a2,_0x2ad730,_0x379778){return new BPromise(function(_0x3a24cb,_0x2002b2){return client[_0x8b13('0xc')](_0x5996a2,_0x379778)[_0x8b13('0xd')](function(_0x450618){logger[_0x8b13('0xe')](_0x8b13('0xf'),_0x2ad730,_0x8b13('0x10'));logger[_0x8b13('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2ad730,'request\x20sent',JSON[_0x8b13('0x12')](_0x450618));if(_0x450618['error']){if(_0x450618[_0x8b13('0x13')][_0x8b13('0x14')]===0x1f4){logger[_0x8b13('0x13')](_0x8b13('0xf'),_0x2ad730,_0x450618[_0x8b13('0x13')]['message']);return _0x2002b2(_0x450618[_0x8b13('0x13')][_0x8b13('0x15')]);}logger[_0x8b13('0x13')](_0x8b13('0xf'),_0x2ad730,_0x450618[_0x8b13('0x13')][_0x8b13('0x15')]);return _0x3a24cb(_0x450618[_0x8b13('0x13')][_0x8b13('0x15')]);}else{logger[_0x8b13('0xe')](_0x8b13('0xf'),_0x2ad730,_0x8b13('0x10'));_0x3a24cb(_0x450618[_0x8b13('0x16')][_0x8b13('0x15')]);}})['catch'](function(_0x1755f6){logger[_0x8b13('0x13')](_0x8b13('0xf'),_0x2ad730,_0x1755f6);_0x2002b2(_0x1755f6);});});} \ No newline at end of file +var _0x1ba9=['message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x10717a,_0x6526cf){var _0x429d3c=function(_0x47cda0){while(--_0x47cda0){_0x10717a['push'](_0x10717a['shift']());}};_0x429d3c(++_0x6526cf);}(_0x1ba9,0x161));var _0x91ba=function(_0x159459,_0x58ee4b){_0x159459=_0x159459-0x0;var _0x18c058=_0x1ba9[_0x159459];return _0x18c058;};'use strict';var _=require('lodash');var util=require(_0x91ba('0x0'));var moment=require(_0x91ba('0x1'));var BPromise=require(_0x91ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91ba('0x3'));var db=require(_0x91ba('0x4'))['db'];var utils=require(_0x91ba('0x5'));var logger=require(_0x91ba('0x6'))(_0x91ba('0x7'));var config=require(_0x91ba('0x8'));var jayson=require(_0x91ba('0x9'));var client=jayson[_0x91ba('0xa')][_0x91ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34ec19,_0xfd19c8,_0x5987fa){return new BPromise(function(_0xdd507d,_0xb955c7){return client[_0x91ba('0xc')](_0x34ec19,_0x5987fa)[_0x91ba('0xd')](function(_0x37c07a){logger[_0x91ba('0xe')](_0x91ba('0xf'),_0xfd19c8,'request\x20sent');logger[_0x91ba('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xfd19c8,_0x91ba('0x11'),JSON[_0x91ba('0x12')](_0x37c07a));if(_0x37c07a[_0x91ba('0x13')]){if(_0x37c07a[_0x91ba('0x13')][_0x91ba('0x14')]===0x1f4){logger[_0x91ba('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0xfd19c8,_0x37c07a[_0x91ba('0x13')][_0x91ba('0x15')]);return _0xb955c7(_0x37c07a[_0x91ba('0x13')][_0x91ba('0x15')]);}logger[_0x91ba('0x13')](_0x91ba('0xf'),_0xfd19c8,_0x37c07a[_0x91ba('0x13')][_0x91ba('0x15')]);return _0xdd507d(_0x37c07a[_0x91ba('0x13')]['message']);}else{logger[_0x91ba('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0xfd19c8,'request\x20sent');_0xdd507d(_0x37c07a['result']['message']);}})['catch'](function(_0x449957){logger[_0x91ba('0x13')](_0x91ba('0xf'),_0xfd19c8,_0x449957);_0xb955c7(_0x449957);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7ac9675..4d21a5a 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 _0xb1ec=['post','create','put','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0xb1ec,0x148));var _0xcb1e=function(_0x57c78b,_0x66c039){_0x57c78b=_0x57c78b-0x0;var _0x5edb6e=_0xb1ec[_0x57c78b];return _0x5edb6e;};'use strict';var multer=require(_0xcb1e('0x0'));var util=require(_0xcb1e('0x1'));var path=require(_0xcb1e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcb1e('0x3')]();var fs_extra=require(_0xcb1e('0x4'));var auth=require(_0xcb1e('0x5'));var interaction=require(_0xcb1e('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0xcb1e('0x7')](),controller[_0xcb1e('0x8')]);router[_0xcb1e('0x9')](_0xcb1e('0xa'),auth[_0xcb1e('0x7')](),controller[_0xcb1e('0xb')]);router[_0xcb1e('0xc')]('/',auth['isAuthenticated'](),controller[_0xcb1e('0xd')]);router[_0xcb1e('0xe')](_0xcb1e('0xa'),auth[_0xcb1e('0x7')](),controller['update']);router[_0xcb1e('0xf')]('/:id',auth[_0xcb1e('0x7')](),controller['destroy']);module[_0xcb1e('0x10')]=router; \ No newline at end of file +var _0x5ab9=['put','isAuthenticated','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ab9,0x114));var _0x95ab=function(_0x387b44,_0x3ad1ba){_0x387b44=_0x387b44-0x0;var _0x55ff2d=_0x5ab9[_0x387b44];return _0x55ff2d;};'use strict';var multer=require(_0x95ab('0x0'));var util=require('util');var path=require(_0x95ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x95ab('0x2'));var router=express[_0x95ab('0x3')]();var fs_extra=require(_0x95ab('0x4'));var auth=require(_0x95ab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x95ab('0x6'));var controller=require('./intSalesforceField.controller');router[_0x95ab('0x7')]('/',auth['isAuthenticated'](),controller[_0x95ab('0x8')]);router[_0x95ab('0x7')](_0x95ab('0x9'),auth['isAuthenticated'](),controller[_0x95ab('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x95ab('0xb')]);router[_0x95ab('0xc')]('/:id',auth[_0x95ab('0xd')](),controller['update']);router[_0x95ab('0xe')](_0x95ab('0x9'),auth['isAuthenticated'](),controller[_0x95ab('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index ea63bb3..79b9f36 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 _0xe514=['STRING','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x1bb653,_0x19a60e){var _0x5a110a=function(_0x38043f){while(--_0x38043f){_0x1bb653['push'](_0x1bb653['shift']());}};_0x5a110a(++_0x19a60e);}(_0xe514,0x189));var _0x4e51=function(_0x57cd1a,_0x535e99){_0x57cd1a=_0x57cd1a-0x0;var _0x10e5db=_0xe514[_0x57cd1a];return _0x10e5db;};'use strict';var Sequelize=require('sequelize');module[_0x4e51('0x0')]={'type':{'type':Sequelize[_0x4e51('0x1')](_0x4e51('0x2'),_0x4e51('0x3'),_0x4e51('0x4'),_0x4e51('0x5'),_0x4e51('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4e51('0x7')]},'key':{'type':Sequelize[_0x4e51('0x7')]},'keyType':{'type':Sequelize[_0x4e51('0x1')](_0x4e51('0x2'),'variable',_0x4e51('0x4'))},'keyContent':{'type':Sequelize[_0x4e51('0x7')]},'idField':{'type':Sequelize[_0x4e51('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdc10=['string','customVariable','keyValue','picklist','STRING','variable','exports','ENUM'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xdc10,0x6e));var _0x0dc1=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xdc10[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require('sequelize');module[_0x0dc1('0x0')]={'type':{'type':Sequelize[_0x0dc1('0x1')](_0x0dc1('0x2'),'variable',_0x0dc1('0x3'),_0x0dc1('0x4'),_0x0dc1('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0dc1('0x6')]},'keyType':{'type':Sequelize[_0x0dc1('0x1')]('string',_0x0dc1('0x7'),_0x0dc1('0x3'))},'keyContent':{'type':Sequelize[_0x0dc1('0x6')]},'idField':{'type':Sequelize[_0x0dc1('0x6')]},'variableName':{'type':Sequelize[_0x0dc1('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9309b5f..9da1c20 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 _0xe2d4=['ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0xe2d4,0x1b9));var _0x4e2d=function(_0x23cb64,_0x1360f8){_0x23cb64=_0x23cb64-0x0;var _0x122d12=_0xe2d4[_0x23cb64];return _0x122d12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e2d('0x0'));var zipdir=require(_0x4e2d('0x1'));var jsonpatch=require(_0x4e2d('0x2'));var rp=require(_0x4e2d('0x3'));var moment=require('moment');var BPromise=require(_0x4e2d('0x4'));var Mustache=require(_0x4e2d('0x5'));var util=require(_0x4e2d('0x6'));var path=require(_0x4e2d('0x7'));var sox=require('sox');var csv=require(_0x4e2d('0x8'));var ejs=require(_0x4e2d('0x9'));var fs=require('fs');var fs_extra=require(_0x4e2d('0xa'));var _=require(_0x4e2d('0xb'));var squel=require(_0x4e2d('0xc'));var crypto=require('crypto');var jsforce=require(_0x4e2d('0xd'));var deskjs=require(_0x4e2d('0xe'));var toCsv=require(_0x4e2d('0x8'));var querystring=require('querystring');var Papa=require(_0x4e2d('0xf'));var Redis=require('ioredis');var authService=require(_0x4e2d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4e2d('0x11'));var hardwareService=require(_0x4e2d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x4e2d('0x13'));var config=require(_0x4e2d('0x14'));var licenseUtil=require(_0x4e2d('0x15'));var db=require(_0x4e2d('0x16'))['db'];function respondWithStatusCode(_0x2775a5,_0x71ed32){_0x71ed32=_0x71ed32||0xcc;return function(_0x5f49b6){if(_0x5f49b6){return _0x2775a5[_0x4e2d('0x17')](_0x71ed32);}return _0x2775a5[_0x4e2d('0x18')](_0x71ed32)['end']();};}function respondWithResult(_0x507afa,_0xd84f83){_0xd84f83=_0xd84f83||0xc8;return function(_0x35e95d){if(_0x35e95d){return _0x507afa[_0x4e2d('0x18')](_0xd84f83)['json'](_0x35e95d);}};}function respondWithFilteredResult(_0x207b38,_0x5e8293){return function(_0x3e1e81){if(_0x3e1e81){var _0x1cbe7c=typeof _0x5e8293['offset']===_0x4e2d('0x19')&&typeof _0x5e8293[_0x4e2d('0x1a')]===_0x4e2d('0x19');var _0x779bbe=_0x3e1e81[_0x4e2d('0x1b')];var _0x27fbf7=_0x1cbe7c?0x0:_0x5e8293[_0x4e2d('0x1c')];var _0x2e0611=_0x1cbe7c?_0x3e1e81['count']:_0x5e8293[_0x4e2d('0x1c')]+_0x5e8293[_0x4e2d('0x1a')];var _0xa8306f;if(_0x2e0611>=_0x779bbe){_0x2e0611=_0x779bbe;_0xa8306f=0xc8;}else{_0xa8306f=0xce;}_0x207b38['status'](_0xa8306f);return _0x207b38[_0x4e2d('0x1d')](_0x4e2d('0x1e'),_0x27fbf7+'-'+_0x2e0611+'/'+_0x779bbe)[_0x4e2d('0x1f')](_0x3e1e81);}return null;};}function patchUpdates(_0x276428){return function(_0x3c0a82){try{jsonpatch[_0x4e2d('0x20')](_0x3c0a82,_0x276428,!![]);}catch(_0xa4ff9a){return BPromise[_0x4e2d('0x21')](_0xa4ff9a);}return _0x3c0a82[_0x4e2d('0x22')]();};}function saveUpdates(_0x44115b,_0x206ca2){return function(_0x5d8caf){if(_0x5d8caf){return _0x5d8caf[_0x4e2d('0x23')](_0x44115b)[_0x4e2d('0x24')](function(_0x2a034c){return _0x2a034c;});}return null;};}function removeEntity(_0xba3ccc,_0x569e52){return function(_0x580508){if(_0x580508){return _0x580508['destroy']()[_0x4e2d('0x24')](function(){_0xba3ccc[_0x4e2d('0x18')](0xcc)[_0x4e2d('0x25')]();});}};}function handleEntityNotFound(_0x56100e,_0x395e67){return function(_0x313635){if(!_0x313635){_0x56100e[_0x4e2d('0x17')](0x194);}return _0x313635;};}function handleError(_0x2f71b7,_0x323df5){_0x323df5=_0x323df5||0x1f4;return function(_0x474975){logger[_0x4e2d('0x26')](_0x474975['stack']);if(_0x474975[_0x4e2d('0x27')]){delete _0x474975[_0x4e2d('0x27')];}_0x2f71b7['status'](_0x323df5)[_0x4e2d('0x28')](_0x474975);};}exports['index']=function(_0x5e814d,_0x2c54e5){var _0x2204e3={},_0x26df95={},_0x328339={'count':0x0,'rows':[]};var _0x29da6e=_[_0x4e2d('0x29')](db[_0x4e2d('0x2a')]['rawAttributes'],function(_0x2ea376){return{'name':_0x2ea376[_0x4e2d('0x2b')],'type':_0x2ea376[_0x4e2d('0x2c')][_0x4e2d('0x2d')]};});_0x26df95[_0x4e2d('0x2e')]=_[_0x4e2d('0x29')](_0x29da6e,_0x4e2d('0x27'));_0x26df95[_0x4e2d('0x2f')]=_[_0x4e2d('0x30')](_0x5e814d[_0x4e2d('0x2f')]);_0x26df95[_0x4e2d('0x31')]=_[_0x4e2d('0x32')](_0x26df95[_0x4e2d('0x2e')],_0x26df95['query']);_0x2204e3[_0x4e2d('0x33')]=_[_0x4e2d('0x32')](_0x26df95[_0x4e2d('0x2e')],qs['fields'](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x34')]));_0x2204e3[_0x4e2d('0x33')]=_0x2204e3[_0x4e2d('0x33')][_0x4e2d('0x35')]?_0x2204e3[_0x4e2d('0x33')]:_0x26df95[_0x4e2d('0x2e')];if(!_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x36')](_0x4e2d('0x37'))){_0x2204e3[_0x4e2d('0x1a')]=qs[_0x4e2d('0x1a')](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x1a')]);_0x2204e3[_0x4e2d('0x1c')]=qs[_0x4e2d('0x1c')](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x1c')]);}_0x2204e3[_0x4e2d('0x38')]=qs['sort'](_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x39')]);_0x2204e3['where']=qs[_0x4e2d('0x31')](_[_0x4e2d('0x3a')](_0x5e814d[_0x4e2d('0x2f')],_0x26df95[_0x4e2d('0x31')]),_0x29da6e);if(_0x5e814d[_0x4e2d('0x2f')]['filter']){_0x2204e3[_0x4e2d('0x3b')]=_['merge'](_0x2204e3[_0x4e2d('0x3b')],{'$or':_['map'](_0x29da6e,function(_0xe901b4){if(_0xe901b4[_0x4e2d('0x2c')]!==_0x4e2d('0x3c')){var _0x162365={};_0x162365[_0xe901b4['name']]={'$like':'%'+_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x3d')]+'%'};return _0x162365;}})});}_0x2204e3=_[_0x4e2d('0x3e')]({},_0x2204e3,_0x5e814d[_0x4e2d('0x3f')]);var _0x11003c={'where':_0x2204e3[_0x4e2d('0x3b')]};return db[_0x4e2d('0x2a')]['count'](_0x11003c)[_0x4e2d('0x24')](function(_0x4a1b9e){_0x328339['count']=_0x4a1b9e;if(_0x5e814d[_0x4e2d('0x2f')][_0x4e2d('0x40')]){_0x2204e3[_0x4e2d('0x41')]=[{'all':!![]}];}return db[_0x4e2d('0x2a')][_0x4e2d('0x42')](_0x2204e3);})[_0x4e2d('0x24')](function(_0x588c9d){_0x328339[_0x4e2d('0x43')]=_0x588c9d;return _0x328339;})[_0x4e2d('0x24')](respondWithFilteredResult(_0x2c54e5,_0x2204e3))[_0x4e2d('0x44')](handleError(_0x2c54e5,null));};exports['show']=function(_0x816dd2,_0x2dd5a0){var _0x5d4c1f={'raw':!![],'where':{'id':_0x816dd2[_0x4e2d('0x45')]['id']}},_0x33ba35={};_0x33ba35['model']=_[_0x4e2d('0x30')](db['SalesforceField'][_0x4e2d('0x46')]);_0x33ba35[_0x4e2d('0x2f')]=_['keys'](_0x816dd2[_0x4e2d('0x2f')]);_0x33ba35[_0x4e2d('0x31')]=_[_0x4e2d('0x32')](_0x33ba35[_0x4e2d('0x2e')],_0x33ba35[_0x4e2d('0x2f')]);_0x5d4c1f[_0x4e2d('0x33')]=_[_0x4e2d('0x32')](_0x33ba35['model'],qs[_0x4e2d('0x34')](_0x816dd2[_0x4e2d('0x2f')][_0x4e2d('0x34')]));_0x5d4c1f[_0x4e2d('0x33')]=_0x5d4c1f[_0x4e2d('0x33')][_0x4e2d('0x35')]?_0x5d4c1f[_0x4e2d('0x33')]:_0x33ba35[_0x4e2d('0x2e')];if(_0x816dd2[_0x4e2d('0x2f')][_0x4e2d('0x40')]){_0x5d4c1f[_0x4e2d('0x41')]=[{'all':!![]}];}_0x5d4c1f=_[_0x4e2d('0x3e')]({},_0x5d4c1f,_0x816dd2['options']);return db[_0x4e2d('0x2a')][_0x4e2d('0x47')](_0x5d4c1f)['then'](handleEntityNotFound(_0x2dd5a0,null))[_0x4e2d('0x24')](respondWithResult(_0x2dd5a0,null))[_0x4e2d('0x44')](handleError(_0x2dd5a0,null));};exports[_0x4e2d('0x48')]=function(_0x4d365c,_0x5b6522){return db['SalesforceField'][_0x4e2d('0x48')](_0x4d365c[_0x4e2d('0x49')],{})[_0x4e2d('0x24')](respondWithResult(_0x5b6522,0xc9))[_0x4e2d('0x44')](handleError(_0x5b6522,null));};exports[_0x4e2d('0x23')]=function(_0x5d54af,_0x27cba3){if(_0x5d54af[_0x4e2d('0x49')]['id']){delete _0x5d54af['body']['id'];}return db[_0x4e2d('0x2a')][_0x4e2d('0x47')]({'where':{'id':_0x5d54af[_0x4e2d('0x45')]['id']}})[_0x4e2d('0x24')](handleEntityNotFound(_0x27cba3,null))[_0x4e2d('0x24')](saveUpdates(_0x5d54af[_0x4e2d('0x49')],null))[_0x4e2d('0x24')](respondWithResult(_0x27cba3,null))[_0x4e2d('0x44')](handleError(_0x27cba3,null));};exports[_0x4e2d('0x4a')]=function(_0x1d5b6f,_0x29fe8c){return db[_0x4e2d('0x2a')]['find']({'where':{'id':_0x1d5b6f[_0x4e2d('0x45')]['id']}})[_0x4e2d('0x24')](handleEntityNotFound(_0x29fe8c,null))[_0x4e2d('0x24')](removeEntity(_0x29fe8c,null))['catch'](handleError(_0x29fe8c,null));}; \ No newline at end of file +var _0x0c20=['offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','SalesforceField','fieldName','key','model','map','query','keys','attributes','intersection','fields','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x1b461e,_0x16b33b){var _0x275199=function(_0x54d5f2){while(--_0x54d5f2){_0x1b461e['push'](_0x1b461e['shift']());}};_0x275199(++_0x16b33b);}(_0x0c20,0x14e));var _0x00c2=function(_0x4bb2c1,_0x117fa8){_0x4bb2c1=_0x4bb2c1-0x0;var _0x45c762=_0x0c20[_0x4bb2c1];return _0x45c762;};'use strict';var emlformat=require(_0x00c2('0x0'));var rimraf=require(_0x00c2('0x1'));var zipdir=require(_0x00c2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00c2('0x3'));var moment=require('moment');var BPromise=require(_0x00c2('0x4'));var Mustache=require(_0x00c2('0x5'));var util=require(_0x00c2('0x6'));var path=require(_0x00c2('0x7'));var sox=require('sox');var csv=require(_0x00c2('0x8'));var ejs=require(_0x00c2('0x9'));var fs=require('fs');var fs_extra=require(_0x00c2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x00c2('0xb'));var jsforce=require(_0x00c2('0xc'));var deskjs=require(_0x00c2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x00c2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00c2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x00c2('0x10'));var hardwareService=require(_0x00c2('0x11'));var logger=require('../../config/logger')(_0x00c2('0x12'));var utils=require(_0x00c2('0x13'));var config=require(_0x00c2('0x14'));var licenseUtil=require(_0x00c2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49b6aa,_0x1585f9){_0x1585f9=_0x1585f9||0xcc;return function(_0x1f0cd5){if(_0x1f0cd5){return _0x49b6aa[_0x00c2('0x16')](_0x1585f9);}return _0x49b6aa[_0x00c2('0x17')](_0x1585f9)[_0x00c2('0x18')]();};}function respondWithResult(_0x46d5a6,_0x419765){_0x419765=_0x419765||0xc8;return function(_0x6ed086){if(_0x6ed086){return _0x46d5a6['status'](_0x419765)[_0x00c2('0x19')](_0x6ed086);}};}function respondWithFilteredResult(_0x371322,_0x37b431){return function(_0x5cd1c3){if(_0x5cd1c3){var _0x4bc2bd=typeof _0x37b431[_0x00c2('0x1a')]==='undefined'&&typeof _0x37b431[_0x00c2('0x1b')]===_0x00c2('0x1c');var _0x276cf0=_0x5cd1c3[_0x00c2('0x1d')];var _0x510d8c=_0x4bc2bd?0x0:_0x37b431[_0x00c2('0x1a')];var _0x1f144d=_0x4bc2bd?_0x5cd1c3[_0x00c2('0x1d')]:_0x37b431[_0x00c2('0x1a')]+_0x37b431[_0x00c2('0x1b')];var _0x179ec1;if(_0x1f144d>=_0x276cf0){_0x1f144d=_0x276cf0;_0x179ec1=0xc8;}else{_0x179ec1=0xce;}_0x371322[_0x00c2('0x17')](_0x179ec1);return _0x371322[_0x00c2('0x1e')](_0x00c2('0x1f'),_0x510d8c+'-'+_0x1f144d+'/'+_0x276cf0)['json'](_0x5cd1c3);}return null;};}function patchUpdates(_0x27cb4c){return function(_0x22608e){try{jsonpatch['apply'](_0x22608e,_0x27cb4c,!![]);}catch(_0x46f4a5){return BPromise[_0x00c2('0x20')](_0x46f4a5);}return _0x22608e[_0x00c2('0x21')]();};}function saveUpdates(_0x5ee268,_0x2f6e1d){return function(_0x125142){if(_0x125142){return _0x125142[_0x00c2('0x22')](_0x5ee268)[_0x00c2('0x23')](function(_0x247c8c){return _0x247c8c;});}return null;};}function removeEntity(_0x4f21d2,_0x67f74a){return function(_0x1f26b0){if(_0x1f26b0){return _0x1f26b0[_0x00c2('0x24')]()[_0x00c2('0x23')](function(){_0x4f21d2[_0x00c2('0x17')](0xcc)[_0x00c2('0x18')]();});}};}function handleEntityNotFound(_0x280568,_0x36647c){return function(_0x4fb4d1){if(!_0x4fb4d1){_0x280568['sendStatus'](0x194);}return _0x4fb4d1;};}function handleError(_0x1519ec,_0x4f7e75){_0x4f7e75=_0x4f7e75||0x1f4;return function(_0x4bafb5){logger[_0x00c2('0x25')](_0x4bafb5[_0x00c2('0x26')]);if(_0x4bafb5[_0x00c2('0x27')]){delete _0x4bafb5['name'];}_0x1519ec[_0x00c2('0x17')](_0x4f7e75)['send'](_0x4bafb5);};}exports[_0x00c2('0x28')]=function(_0x8c285,_0x44550e){var _0x20a864={},_0x14945d={},_0x1c1068={'count':0x0,'rows':[]};var _0x394de3=_['map'](db[_0x00c2('0x29')]['rawAttributes'],function(_0x53fbcb){return{'name':_0x53fbcb[_0x00c2('0x2a')],'type':_0x53fbcb['type'][_0x00c2('0x2b')]};});_0x14945d[_0x00c2('0x2c')]=_[_0x00c2('0x2d')](_0x394de3,_0x00c2('0x27'));_0x14945d[_0x00c2('0x2e')]=_[_0x00c2('0x2f')](_0x8c285[_0x00c2('0x2e')]);_0x14945d['filters']=_['intersection'](_0x14945d[_0x00c2('0x2c')],_0x14945d['query']);_0x20a864[_0x00c2('0x30')]=_[_0x00c2('0x31')](_0x14945d['model'],qs[_0x00c2('0x32')](_0x8c285[_0x00c2('0x2e')][_0x00c2('0x32')]));_0x20a864[_0x00c2('0x30')]=_0x20a864[_0x00c2('0x30')]['length']?_0x20a864[_0x00c2('0x30')]:_0x14945d['model'];if(!_0x8c285[_0x00c2('0x2e')]['hasOwnProperty']('nolimit')){_0x20a864['limit']=qs[_0x00c2('0x1b')](_0x8c285['query'][_0x00c2('0x1b')]);_0x20a864[_0x00c2('0x1a')]=qs['offset'](_0x8c285[_0x00c2('0x2e')][_0x00c2('0x1a')]);}_0x20a864[_0x00c2('0x33')]=qs[_0x00c2('0x34')](_0x8c285['query']['sort']);_0x20a864['where']=qs[_0x00c2('0x35')](_[_0x00c2('0x36')](_0x8c285[_0x00c2('0x2e')],_0x14945d[_0x00c2('0x35')]),_0x394de3);if(_0x8c285[_0x00c2('0x2e')][_0x00c2('0x37')]){_0x20a864[_0x00c2('0x38')]=_[_0x00c2('0x39')](_0x20a864[_0x00c2('0x38')],{'$or':_[_0x00c2('0x2d')](_0x394de3,function(_0x42b983){if(_0x42b983[_0x00c2('0x3a')]!==_0x00c2('0x3b')){var _0x20cf01={};_0x20cf01[_0x42b983[_0x00c2('0x27')]]={'$like':'%'+_0x8c285[_0x00c2('0x2e')][_0x00c2('0x37')]+'%'};return _0x20cf01;}})});}_0x20a864=_[_0x00c2('0x39')]({},_0x20a864,_0x8c285[_0x00c2('0x3c')]);var _0x4122da={'where':_0x20a864[_0x00c2('0x38')]};return db[_0x00c2('0x29')][_0x00c2('0x1d')](_0x4122da)['then'](function(_0x370061){_0x1c1068[_0x00c2('0x1d')]=_0x370061;if(_0x8c285[_0x00c2('0x2e')][_0x00c2('0x3d')]){_0x20a864[_0x00c2('0x3e')]=[{'all':!![]}];}return db[_0x00c2('0x29')]['findAll'](_0x20a864);})[_0x00c2('0x23')](function(_0x267a4a){_0x1c1068[_0x00c2('0x3f')]=_0x267a4a;return _0x1c1068;})[_0x00c2('0x23')](respondWithFilteredResult(_0x44550e,_0x20a864))[_0x00c2('0x40')](handleError(_0x44550e,null));};exports[_0x00c2('0x41')]=function(_0x246529,_0x1a5f0a){var _0x20bc3a={'raw':!![],'where':{'id':_0x246529[_0x00c2('0x42')]['id']}},_0x53647d={};_0x53647d[_0x00c2('0x2c')]=_['keys'](db[_0x00c2('0x29')][_0x00c2('0x43')]);_0x53647d['query']=_[_0x00c2('0x2f')](_0x246529['query']);_0x53647d[_0x00c2('0x35')]=_[_0x00c2('0x31')](_0x53647d['model'],_0x53647d[_0x00c2('0x2e')]);_0x20bc3a[_0x00c2('0x30')]=_[_0x00c2('0x31')](_0x53647d[_0x00c2('0x2c')],qs[_0x00c2('0x32')](_0x246529['query'][_0x00c2('0x32')]));_0x20bc3a[_0x00c2('0x30')]=_0x20bc3a[_0x00c2('0x30')][_0x00c2('0x44')]?_0x20bc3a[_0x00c2('0x30')]:_0x53647d[_0x00c2('0x2c')];if(_0x246529['query']['includeAll']){_0x20bc3a[_0x00c2('0x3e')]=[{'all':!![]}];}_0x20bc3a=_[_0x00c2('0x39')]({},_0x20bc3a,_0x246529[_0x00c2('0x3c')]);return db[_0x00c2('0x29')][_0x00c2('0x45')](_0x20bc3a)[_0x00c2('0x23')](handleEntityNotFound(_0x1a5f0a,null))[_0x00c2('0x23')](respondWithResult(_0x1a5f0a,null))['catch'](handleError(_0x1a5f0a,null));};exports[_0x00c2('0x46')]=function(_0x1aea3,_0x4c92bb){return db[_0x00c2('0x29')][_0x00c2('0x46')](_0x1aea3[_0x00c2('0x47')],{})[_0x00c2('0x23')](respondWithResult(_0x4c92bb,0xc9))['catch'](handleError(_0x4c92bb,null));};exports[_0x00c2('0x22')]=function(_0x1f83cf,_0x458008){if(_0x1f83cf[_0x00c2('0x47')]['id']){delete _0x1f83cf[_0x00c2('0x47')]['id'];}return db[_0x00c2('0x29')][_0x00c2('0x45')]({'where':{'id':_0x1f83cf[_0x00c2('0x42')]['id']}})[_0x00c2('0x23')](handleEntityNotFound(_0x458008,null))[_0x00c2('0x23')](saveUpdates(_0x1f83cf[_0x00c2('0x47')],null))[_0x00c2('0x23')](respondWithResult(_0x458008,null))[_0x00c2('0x40')](handleError(_0x458008,null));};exports[_0x00c2('0x24')]=function(_0x234e04,_0x73e4ca){return db[_0x00c2('0x29')][_0x00c2('0x45')]({'where':{'id':_0x234e04['params']['id']}})[_0x00c2('0x23')](handleEntityNotFound(_0x73e4ca,null))[_0x00c2('0x23')](removeEntity(_0x73e4ca,null))[_0x00c2('0x40')](handleError(_0x73e4ca,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 825d23f..d47fd17 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 _0xaf92=['request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment'];(function(_0x2d2ca7,_0x205ac1){var _0x1ad59d=function(_0x168a38){while(--_0x168a38){_0x2d2ca7['push'](_0x2d2ca7['shift']());}};_0x1ad59d(++_0x205ac1);}(_0xaf92,0x177));var _0x2af9=function(_0x580831,_0x2e293d){_0x580831=_0x580831-0x0;var _0x14c21a=_0xaf92[_0x580831];return _0x14c21a;};'use strict';var _=require(_0x2af9('0x0'));var util=require(_0x2af9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2af9('0x2'));var BPromise=require('bluebird');var rp=require(_0x2af9('0x3'));var fs=require('fs');var path=require(_0x2af9('0x4'));var rimraf=require(_0x2af9('0x5'));var config=require(_0x2af9('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x2af9('0x7')]=function(_0x5c3108,_0x188cb7){return _0x5c3108[_0x2af9('0x8')](_0x2af9('0x9'),attributes,{'tableName':_0x2af9('0xa'),'paranoid':![],'indexes':[{'name':_0x2af9('0xb'),'fields':[_0x2af9('0xc'),_0x2af9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0401=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','SalesforceField','salesforce_unique_index'];(function(_0x4cf61b,_0x3fe192){var _0x3d15f3=function(_0x44fe18){while(--_0x44fe18){_0x4cf61b['push'](_0x4cf61b['shift']());}};_0x3d15f3(++_0x3fe192);}(_0x0401,0x113));var _0x1040=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0401[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x1040('0x0'));var util=require(_0x1040('0x1'));var logger=require(_0x1040('0x2'))(_0x1040('0x3'));var moment=require(_0x1040('0x4'));var BPromise=require(_0x1040('0x5'));var rp=require(_0x1040('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1040('0x7'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x546614,_0x1789d3){return _0x546614[_0x1040('0x8')](_0x1040('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x1040('0xa'),'fields':[_0x1040('0xb'),_0x1040('0xc')],'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 0df7a3e..e763a29 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 _0x3093=['../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x386b03,_0x5d0000){var _0xd3d524=function(_0x474754){while(--_0x474754){_0x386b03['push'](_0x386b03['shift']());}};_0xd3d524(++_0x5d0000);}(_0x3093,0x83));var _0x3309=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x3093[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x3309('0x0'));var util=require('util');var moment=require(_0x3309('0x1'));var BPromise=require(_0x3309('0x2'));var rs=require(_0x3309('0x3'));var fs=require('fs');var Redis=require(_0x3309('0x4'));var db=require(_0x3309('0x5'))['db'];var utils=require(_0x3309('0x6'));var logger=require(_0x3309('0x7'))(_0x3309('0x8'));var config=require('../../config/environment');var jayson=require(_0x3309('0x9'));var client=jayson[_0x3309('0xa')][_0x3309('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d5d34,_0x1ed25c,_0x476c99){return new BPromise(function(_0x4e8099,_0x44a446){return client['request'](_0x5d5d34,_0x476c99)[_0x3309('0xc')](function(_0x57ba01){logger[_0x3309('0xd')](_0x3309('0xe'),_0x1ed25c,'request\x20sent');logger[_0x3309('0xf')](_0x3309('0x10'),_0x1ed25c,'request\x20sent',JSON[_0x3309('0x11')](_0x57ba01));if(_0x57ba01[_0x3309('0x12')]){if(_0x57ba01[_0x3309('0x12')][_0x3309('0x13')]===0x1f4){logger['error'](_0x3309('0xe'),_0x1ed25c,_0x57ba01[_0x3309('0x12')][_0x3309('0x14')]);return _0x44a446(_0x57ba01['error'][_0x3309('0x14')]);}logger[_0x3309('0x12')](_0x3309('0xe'),_0x1ed25c,_0x57ba01[_0x3309('0x12')][_0x3309('0x14')]);return _0x4e8099(_0x57ba01[_0x3309('0x12')][_0x3309('0x14')]);}else{logger[_0x3309('0xd')]('SalesforceField,\x20%s,\x20%s',_0x1ed25c,'request\x20sent');_0x4e8099(_0x57ba01[_0x3309('0x15')][_0x3309('0x14')]);}})[_0x3309('0x16')](function(_0x2e8d66){logger[_0x3309('0x12')](_0x3309('0xe'),_0x1ed25c,_0x2e8d66);_0x44a446(_0x2e8d66);});});} \ No newline at end of file +var _0x66cf=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','lodash'];(function(_0xc68650,_0x258343){var _0x57bd40=function(_0x8d9e8c){while(--_0x8d9e8c){_0xc68650['push'](_0xc68650['shift']());}};_0x57bd40(++_0x258343);}(_0x66cf,0x1b8));var _0xf66c=function(_0x5ee41e,_0xc3144e){_0x5ee41e=_0x5ee41e-0x0;var _0x31a2dd=_0x66cf[_0x5ee41e];return _0x31a2dd;};'use strict';var _=require(_0xf66c('0x0'));var util=require(_0xf66c('0x1'));var moment=require(_0xf66c('0x2'));var BPromise=require(_0xf66c('0x3'));var rs=require(_0xf66c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf66c('0x5'))['db'];var utils=require(_0xf66c('0x6'));var logger=require('../../config/logger')(_0xf66c('0x7'));var config=require(_0xf66c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf66c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27c40a,_0x46e009,_0x5f13c8){return new BPromise(function(_0x4998a3,_0x5706f8){return client[_0xf66c('0xa')](_0x27c40a,_0x5f13c8)[_0xf66c('0xb')](function(_0x5c316c){logger['info'](_0xf66c('0xc'),_0x46e009,_0xf66c('0xd'));logger[_0xf66c('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x46e009,'request\x20sent',JSON['stringify'](_0x5c316c));if(_0x5c316c['error']){if(_0x5c316c['error'][_0xf66c('0xf')]===0x1f4){logger[_0xf66c('0x10')](_0xf66c('0xc'),_0x46e009,_0x5c316c[_0xf66c('0x10')]['message']);return _0x5706f8(_0x5c316c[_0xf66c('0x10')][_0xf66c('0x11')]);}logger['error'](_0xf66c('0xc'),_0x46e009,_0x5c316c[_0xf66c('0x10')]['message']);return _0x4998a3(_0x5c316c['error'][_0xf66c('0x11')]);}else{logger[_0xf66c('0x12')](_0xf66c('0xc'),_0x46e009,'request\x20sent');_0x4998a3(_0x5c316c[_0xf66c('0x13')][_0xf66c('0x11')]);}})[_0xf66c('0x14')](function(_0x23f5c5){logger[_0xf66c('0x10')]('SalesforceField,\x20%s,\x20%s',_0x46e009,_0x23f5c5);_0x5706f8(_0x23f5c5);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f395a33..7026d70 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 _0x106b=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy'];(function(_0x44a38e,_0x1aa124){var _0x5ec328=function(_0x2cbd53){while(--_0x2cbd53){_0x44a38e['push'](_0x44a38e['shift']());}};_0x5ec328(++_0x1aa124);}(_0x106b,0xa2));var _0xb106=function(_0x53199f,_0x1dac3a){_0x53199f=_0x53199f-0x0;var _0x1f9609=_0x106b[_0x53199f];return _0x1f9609;};'use strict';var multer=require(_0xb106('0x0'));var util=require(_0xb106('0x1'));var path=require(_0xb106('0x2'));var timeout=require(_0xb106('0x3'));var express=require(_0xb106('0x4'));var router=express[_0xb106('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb106('0x6'));var interaction=require(_0xb106('0x7'));var config=require(_0xb106('0x8'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0xb106('0x9')](),controller['index']);router[_0xb106('0xa')](_0xb106('0xb'),auth[_0xb106('0x9')](),controller[_0xb106('0xc')]);router[_0xb106('0xa')](_0xb106('0xd'),auth['isAuthenticated'](),controller[_0xb106('0xe')]);router[_0xb106('0xa')](_0xb106('0xf'),auth[_0xb106('0x9')](),controller[_0xb106('0x10')]);router[_0xb106('0x11')]('/',auth[_0xb106('0x9')](),controller['create']);router[_0xb106('0x11')](_0xb106('0xd'),auth[_0xb106('0x9')](),controller[_0xb106('0x12')]);router[_0xb106('0x13')](_0xb106('0xb'),auth[_0xb106('0x9')](),controller['update']);router[_0xb106('0x14')]('/:id',auth[_0xb106('0x9')](),controller[_0xb106('0x15')]);module[_0xb106('0x16')]=router; \ No newline at end of file +var _0x81dc=['post','create','/:id/configurations','addConfiguration','update','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields'];(function(_0x18a577,_0x25560c){var _0x1cb0c7=function(_0x195eeb){while(--_0x195eeb){_0x18a577['push'](_0x18a577['shift']());}};_0x1cb0c7(++_0x25560c);}(_0x81dc,0x1e9));var _0xc81d=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0x81dc[_0x5f382f];return _0x3bb11b;};'use strict';var multer=require('multer');var util=require(_0xc81d('0x0'));var path=require(_0xc81d('0x1'));var timeout=require(_0xc81d('0x2'));var express=require(_0xc81d('0x3'));var router=express[_0xc81d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc81d('0x5'));var config=require(_0xc81d('0x6'));var controller=require('./intServicenowAccount.controller');router[_0xc81d('0x7')]('/',auth['isAuthenticated'](),controller[_0xc81d('0x8')]);router['get'](_0xc81d('0x9'),auth[_0xc81d('0xa')](),controller[_0xc81d('0xb')]);router[_0xc81d('0x7')]('/:id/configurations',auth[_0xc81d('0xa')](),controller[_0xc81d('0xc')]);router[_0xc81d('0x7')](_0xc81d('0xd'),auth[_0xc81d('0xa')](),controller[_0xc81d('0xe')]);router[_0xc81d('0xf')]('/',auth[_0xc81d('0xa')](),controller[_0xc81d('0x10')]);router['post'](_0xc81d('0x11'),auth[_0xc81d('0xa')](),controller[_0xc81d('0x12')]);router['put'](_0xc81d('0x9'),auth['isAuthenticated'](),controller[_0xc81d('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc81d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 65c7f11..83db69a 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 _0x39a2=['STRING','username','remoteUri','exports'];(function(_0x10bfb9,_0x4adc36){var _0x244678=function(_0x5bcfe0){while(--_0x5bcfe0){_0x10bfb9['push'](_0x10bfb9['shift']());}};_0x244678(++_0x4adc36);}(_0x39a2,0xc3));var _0x239a=function(_0x4a9fb7,_0x4cbfd7){_0x4a9fb7=_0x4a9fb7-0x0;var _0x40b90e=_0x39a2[_0x4a9fb7];return _0x40b90e;};'use strict';var Sequelize=require('sequelize');module[_0x239a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x239a('0x1')]},'username':{'type':Sequelize[_0x239a('0x1')],'unique':_0x239a('0x2')},'password':{'type':Sequelize[_0x239a('0x1')]},'email':{'type':Sequelize[_0x239a('0x1')]},'remoteUri':{'type':Sequelize[_0x239a('0x1')],'unique':_0x239a('0x3')},'serverUrl':{'type':Sequelize[_0x239a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3e44=['username','remoteUri','sequelize','exports','STRING'];(function(_0x37d918,_0x1c64ae){var _0x218d93=function(_0x556863){while(--_0x556863){_0x37d918['push'](_0x37d918['shift']());}};_0x218d93(++_0x1c64ae);}(_0x3e44,0x174));var _0x43e4=function(_0x9e7ff2,_0x3d769d){_0x9e7ff2=_0x9e7ff2-0x0;var _0x45766c=_0x3e44[_0x9e7ff2];return _0x45766c;};'use strict';var Sequelize=require(_0x43e4('0x0'));module[_0x43e4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x43e4('0x2')],'unique':_0x43e4('0x3')},'password':{'type':Sequelize[_0x43e4('0x2')]},'email':{'type':Sequelize[_0x43e4('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x43e4('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 740ce60..42dbcf1 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 _0x0210=['assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','error','stack','Wrong\x20credentials','boolean','True','true','False','false','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','name','index','rawAttributes','fieldName','type','key','query','keys','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','ServicenowAccount','include','findAll','intersection','includeAll','catch','create','body','params','destroy','findOne','ServicenowConfiguration','pick','map','getConfigurations','addConfiguration','getSubjects','channel','Descriptions','Subjects','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','sys_id','reopened_by','urgency','problem_id','reassignment_count','severity','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','upon_approval','location','username','password','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects'];(function(_0x2d9c3e,_0x59d297){var _0x2455e1=function(_0x17b53e){while(--_0x17b53e){_0x2d9c3e['push'](_0x2d9c3e['shift']());}};_0x2455e1(++_0x59d297);}(_0x0210,0xc6));var _0x0021=function(_0x47ac81,_0x2efcbc){_0x47ac81=_0x47ac81-0x0;var _0x4bfc1a=_0x0210[_0x47ac81];return _0x4bfc1a;};'use strict';var emlformat=require(_0x0021('0x0'));var rimraf=require(_0x0021('0x1'));var zipdir=require(_0x0021('0x2'));var jsonpatch=require(_0x0021('0x3'));var rp=require(_0x0021('0x4'));var moment=require(_0x0021('0x5'));var BPromise=require(_0x0021('0x6'));var Mustache=require(_0x0021('0x7'));var util=require(_0x0021('0x8'));var path=require('path');var sox=require(_0x0021('0x9'));var csv=require(_0x0021('0xa'));var ejs=require(_0x0021('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0021('0xc'));var squel=require(_0x0021('0xd'));var crypto=require('crypto');var jsforce=require(_0x0021('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0021('0xf'));var qs=require(_0x0021('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0021('0x11'));var logger=require('../../config/logger')(_0x0021('0x12'));var utils=require(_0x0021('0x13'));var config=require(_0x0021('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0021('0x15'))['db'];var integrations=require(_0x0021('0x16'));function respondWithStatusCode(_0x5f3130,_0x2c7661){_0x2c7661=_0x2c7661||0xcc;return function(_0x47b195){if(_0x47b195){return _0x5f3130[_0x0021('0x17')](_0x2c7661);}return _0x5f3130[_0x0021('0x18')](_0x2c7661)[_0x0021('0x19')]();};}function respondWithResult(_0x56b552,_0x3c0e5f){_0x3c0e5f=_0x3c0e5f||0xc8;return function(_0x41f1d6){if(_0x41f1d6){return _0x56b552[_0x0021('0x18')](_0x3c0e5f)[_0x0021('0x1a')](_0x41f1d6);}};}function respondWithFilteredResult(_0x3e6b4e,_0x430f70){return function(_0x2c2122){if(_0x2c2122){var _0x1299ca=typeof _0x430f70[_0x0021('0x1b')]==='undefined'&&typeof _0x430f70[_0x0021('0x1c')]===_0x0021('0x1d');var _0x244061=_0x2c2122[_0x0021('0x1e')];var _0x10ac78=_0x1299ca?0x0:_0x430f70[_0x0021('0x1b')];var _0x280f14=_0x1299ca?_0x2c2122[_0x0021('0x1e')]:_0x430f70[_0x0021('0x1b')]+_0x430f70['limit'];var _0x3997e3;if(_0x280f14>=_0x244061){_0x280f14=_0x244061;_0x3997e3=0xc8;}else{_0x3997e3=0xce;}_0x3e6b4e[_0x0021('0x18')](_0x3997e3);return _0x3e6b4e[_0x0021('0x1f')](_0x0021('0x20'),_0x10ac78+'-'+_0x280f14+'/'+_0x244061)[_0x0021('0x1a')](_0x2c2122);}return null;};}function patchUpdates(_0x134f45){return function(_0x240e00){try{jsonpatch[_0x0021('0x21')](_0x240e00,_0x134f45,!![]);}catch(_0x6685ca){return BPromise[_0x0021('0x22')](_0x6685ca);}return _0x240e00[_0x0021('0x23')]();};}function saveUpdates(_0x5c3d3c,_0x597dbb){return function(_0x5f26ac){if(_0x5f26ac){return _0x5f26ac[_0x0021('0x24')](_0x5c3d3c)[_0x0021('0x25')](function(_0xf4e5d7){return _0xf4e5d7;});}return null;};}function removeEntity(_0x3bcdf7,_0x1adaa6){return function(_0xb90f97){if(_0xb90f97){return _0xb90f97['destroy']()[_0x0021('0x25')](function(){_0x3bcdf7[_0x0021('0x18')](0xcc)[_0x0021('0x19')]();});}};}function handleEntityNotFound(_0x3aa141,_0xb81256){return function(_0x442c65){if(!_0x442c65){_0x3aa141['sendStatus'](0x194);}return _0x442c65;};}function handleError(_0x2b3e04,_0x11373d){_0x11373d=_0x11373d||0x1f4;return function(_0x38d515){logger['error'](_0x38d515['stack']);if(_0x38d515[_0x0021('0x26')]){delete _0x38d515['name'];}_0x2b3e04[_0x0021('0x18')](_0x11373d)['send'](_0x38d515);};}exports[_0x0021('0x27')]=function(_0x33880a,_0x21e306){var _0x214bdd={},_0x1d5e0c={},_0xd835a2={'count':0x0,'rows':[]};var _0x462476=_['map'](db['ServicenowAccount'][_0x0021('0x28')],function(_0x497b90){return{'name':_0x497b90[_0x0021('0x29')],'type':_0x497b90[_0x0021('0x2a')][_0x0021('0x2b')]};});_0x1d5e0c['model']=_['map'](_0x462476,_0x0021('0x26'));_0x1d5e0c[_0x0021('0x2c')]=_[_0x0021('0x2d')](_0x33880a[_0x0021('0x2c')]);_0x1d5e0c[_0x0021('0x2e')]=_['intersection'](_0x1d5e0c['model'],_0x1d5e0c['query']);_0x214bdd[_0x0021('0x2f')]=_['intersection'](_0x1d5e0c[_0x0021('0x30')],qs[_0x0021('0x31')](_0x33880a[_0x0021('0x2c')][_0x0021('0x31')]));_0x214bdd[_0x0021('0x2f')]=_0x214bdd[_0x0021('0x2f')][_0x0021('0x32')]?_0x214bdd['attributes']:_0x1d5e0c['model'];if(!_0x33880a[_0x0021('0x2c')][_0x0021('0x33')](_0x0021('0x34'))){_0x214bdd[_0x0021('0x1c')]=qs['limit'](_0x33880a[_0x0021('0x2c')][_0x0021('0x1c')]);_0x214bdd[_0x0021('0x1b')]=qs[_0x0021('0x1b')](_0x33880a[_0x0021('0x2c')][_0x0021('0x1b')]);}_0x214bdd[_0x0021('0x35')]=qs[_0x0021('0x36')](_0x33880a[_0x0021('0x2c')][_0x0021('0x36')]);_0x214bdd['where']=qs[_0x0021('0x2e')](_['pick'](_0x33880a[_0x0021('0x2c')],_0x1d5e0c[_0x0021('0x2e')]),_0x462476);if(_0x33880a[_0x0021('0x2c')][_0x0021('0x37')]){_0x214bdd[_0x0021('0x38')]=_[_0x0021('0x39')](_0x214bdd['where'],{'$or':_['map'](_0x462476,function(_0x409a2f){if(_0x409a2f[_0x0021('0x2a')]!=='VIRTUAL'){var _0x1447f9={};_0x1447f9[_0x409a2f[_0x0021('0x26')]]={'$like':'%'+_0x33880a['query'][_0x0021('0x37')]+'%'};return _0x1447f9;}})});}_0x214bdd=_[_0x0021('0x39')]({},_0x214bdd,_0x33880a[_0x0021('0x3a')]);var _0x1dc058={'where':_0x214bdd[_0x0021('0x38')]};return db[_0x0021('0x3b')][_0x0021('0x1e')](_0x1dc058)['then'](function(_0x4d4bf1){_0xd835a2[_0x0021('0x1e')]=_0x4d4bf1;if(_0x33880a['query']['includeAll']){_0x214bdd[_0x0021('0x3c')]=[{'all':!![]}];}return db[_0x0021('0x3b')][_0x0021('0x3d')](_0x214bdd);})[_0x0021('0x25')](function(_0x1f1f3a){_0xd835a2['rows']=_0x1f1f3a;return _0xd835a2;})[_0x0021('0x25')](respondWithFilteredResult(_0x21e306,_0x214bdd))['catch'](handleError(_0x21e306,null));};exports['show']=function(_0x511616,_0x1a7f49){var _0xf9f716={'raw':![],'where':{'id':_0x511616['params']['id']}},_0x3e4a07={};_0x3e4a07[_0x0021('0x30')]=_[_0x0021('0x2d')](db[_0x0021('0x3b')]['rawAttributes']);_0x3e4a07[_0x0021('0x2c')]=_[_0x0021('0x2d')](_0x511616[_0x0021('0x2c')]);_0x3e4a07[_0x0021('0x2e')]=_['intersection'](_0x3e4a07[_0x0021('0x30')],_0x3e4a07[_0x0021('0x2c')]);_0xf9f716[_0x0021('0x2f')]=_[_0x0021('0x3e')](_0x3e4a07[_0x0021('0x30')],qs[_0x0021('0x31')](_0x511616[_0x0021('0x2c')][_0x0021('0x31')]));_0xf9f716[_0x0021('0x2f')]=_0xf9f716[_0x0021('0x2f')]['length']?_0xf9f716[_0x0021('0x2f')]:_0x3e4a07[_0x0021('0x30')];if(_0x511616[_0x0021('0x2c')][_0x0021('0x3f')]){_0xf9f716[_0x0021('0x3c')]=[{'all':!![]}];}_0xf9f716=_[_0x0021('0x39')]({},_0xf9f716,_0x511616['options']);return db[_0x0021('0x3b')]['find'](_0xf9f716)[_0x0021('0x25')](handleEntityNotFound(_0x1a7f49,null))[_0x0021('0x25')](respondWithResult(_0x1a7f49,null))[_0x0021('0x40')](handleError(_0x1a7f49,null));};exports[_0x0021('0x41')]=function(_0x2c9e0c,_0x21c286){return db['ServicenowAccount'][_0x0021('0x41')](_0x2c9e0c[_0x0021('0x42')],{})['then'](respondWithResult(_0x21c286,0xc9))['catch'](handleError(_0x21c286,null));};exports[_0x0021('0x24')]=function(_0xf6dc0a,_0x56450f){if(_0xf6dc0a['body']['id']){delete _0xf6dc0a[_0x0021('0x42')]['id'];}return db[_0x0021('0x3b')]['find']({'where':{'id':_0xf6dc0a[_0x0021('0x43')]['id']}})['then'](handleEntityNotFound(_0x56450f,null))[_0x0021('0x25')](saveUpdates(_0xf6dc0a['body'],null))[_0x0021('0x25')](respondWithResult(_0x56450f,null))[_0x0021('0x40')](handleError(_0x56450f,null));};exports[_0x0021('0x44')]=function(_0xc2b36b,_0x54dc8f){return db[_0x0021('0x3b')]['find']({'where':{'id':_0xc2b36b[_0x0021('0x43')]['id']}})['then'](handleEntityNotFound(_0x54dc8f,null))['then'](removeEntity(_0x54dc8f,null))[_0x0021('0x40')](handleError(_0x54dc8f,null));};exports['getConfigurations']=function(_0x236ca9,_0x55190f,_0x2447e2){var _0x42fa7d={};var _0x3771f3={};var _0x4f597c;var _0x3bb0d1;return db[_0x0021('0x3b')][_0x0021('0x45')]({'where':{'id':_0x236ca9[_0x0021('0x43')]['id']}})[_0x0021('0x25')](handleEntityNotFound(_0x55190f,null))[_0x0021('0x25')](function(_0x556be4){if(_0x556be4){_0x4f597c=_0x556be4;_0x3771f3[_0x0021('0x30')]=_[_0x0021('0x2d')](db[_0x0021('0x46')]['rawAttributes']);_0x3771f3['query']=_[_0x0021('0x2d')](_0x236ca9[_0x0021('0x2c')]);_0x3771f3[_0x0021('0x2e')]=_[_0x0021('0x3e')](_0x3771f3[_0x0021('0x30')],_0x3771f3[_0x0021('0x2c')]);_0x42fa7d[_0x0021('0x2f')]=_[_0x0021('0x3e')](_0x3771f3[_0x0021('0x30')],qs[_0x0021('0x31')](_0x236ca9[_0x0021('0x2c')]['fields']));_0x42fa7d[_0x0021('0x2f')]=_0x42fa7d[_0x0021('0x2f')][_0x0021('0x32')]?_0x42fa7d[_0x0021('0x2f')]:_0x3771f3['model'];_0x42fa7d[_0x0021('0x35')]=qs[_0x0021('0x36')](_0x236ca9['query'][_0x0021('0x36')]);_0x42fa7d['where']=qs[_0x0021('0x2e')](_[_0x0021('0x47')](_0x236ca9[_0x0021('0x2c')],_0x3771f3[_0x0021('0x2e')]));if(_0x236ca9[_0x0021('0x2c')][_0x0021('0x37')]){_0x42fa7d[_0x0021('0x38')]=_[_0x0021('0x39')](_0x42fa7d['where'],{'$or':_[_0x0021('0x48')](_0x42fa7d[_0x0021('0x2f')],function(_0x39aacc){var _0x41e925={};_0x41e925[_0x39aacc]={'$like':'%'+_0x236ca9[_0x0021('0x2c')][_0x0021('0x37')]+'%'};return _0x41e925;})});}_0x42fa7d=_['merge']({},_0x42fa7d,_0x236ca9[_0x0021('0x3a')]);return _0x4f597c[_0x0021('0x49')](_0x42fa7d);}})[_0x0021('0x25')](function(_0x11891a){if(_0x11891a){_0x3bb0d1=_0x11891a['length'];if(!_0x236ca9[_0x0021('0x2c')][_0x0021('0x33')](_0x0021('0x34'))){_0x42fa7d[_0x0021('0x1c')]=qs[_0x0021('0x1c')](_0x236ca9[_0x0021('0x2c')][_0x0021('0x1c')]);_0x42fa7d['offset']=qs[_0x0021('0x1b')](_0x236ca9[_0x0021('0x2c')][_0x0021('0x1b')]);}return _0x4f597c[_0x0021('0x49')](_0x42fa7d);}})['then'](function(_0x2aa777){if(_0x2aa777){return _0x2aa777?{'count':_0x3bb0d1,'rows':_0x2aa777}:null;}})[_0x0021('0x25')](respondWithResult(_0x55190f,null))['catch'](handleError(_0x55190f,null));};exports[_0x0021('0x4a')]=function(_0x937924,_0x1ba011,_0x225113){if(_0x937924[_0x0021('0x42')]['id']){delete _0x937924[_0x0021('0x42')]['id'];}return db[_0x0021('0x3b')][_0x0021('0x45')]({'where':{'id':_0x937924[_0x0021('0x43')]['id']}})[_0x0021('0x25')](handleEntityNotFound(_0x1ba011,null))[_0x0021('0x25')](function(_0x5ca52a){if(_0x5ca52a){_0x937924[_0x0021('0x42')]['AccountId']=_0x5ca52a['id'];_0x937924[_0x0021('0x42')]['Subjects']=integrations[_0x0021('0x4b')](_0x937924['body'][_0x0021('0x4c')],_0x937924[_0x0021('0x42')][_0x0021('0x2a')]);_0x937924[_0x0021('0x42')][_0x0021('0x4d')]=integrations['getDescriptions'](_0x937924[_0x0021('0x42')][_0x0021('0x4c')],_0x937924[_0x0021('0x42')][_0x0021('0x2a')]);return db[_0x0021('0x46')][_0x0021('0x41')](_0x937924[_0x0021('0x42')],{'include':[{'model':db['ServicenowField'],'as':_0x0021('0x4e')},{'model':db[_0x0021('0x4f')],'as':_0x0021('0x4d')}]});}return null;})[_0x0021('0x25')](respondWithResult(_0x1ba011,null))[_0x0021('0x40')](handleError(_0x1ba011,null));};exports[_0x0021('0x50')]=function(_0xd23047,_0x50d34f,_0x4810d6){var _0x1bd68a=[_0x0021('0x51'),_0x0021('0x52'),_0x0021('0x53'),_0x0021('0x54'),_0x0021('0x55'),_0x0021('0x56'),_0x0021('0x57'),'severity',_0x0021('0x58')];var _0x47e2b6=[_0x0021('0x59'),_0x0021('0x51'),_0x0021('0x5a'),'watch_list',_0x0021('0x5b'),_0x0021('0x5c'),_0x0021('0x5d'),'hold_reason','approval_history',_0x0021('0x5e'),_0x0021('0x5f'),_0x0021('0x60'),'opened_by','user_input',_0x0021('0x61'),_0x0021('0x62'),_0x0021('0x63'),'sys_created_by','knowledge',_0x0021('0x35'),_0x0021('0x64'),_0x0021('0x65'),_0x0021('0x66'),_0x0021('0x67'),_0x0021('0x68'),_0x0021('0x69'),_0x0021('0x6a'),_0x0021('0x6b'),_0x0021('0x6c'),_0x0021('0x6d'),'rfc',_0x0021('0x6e'),_0x0021('0x6f'),_0x0021('0x70'),_0x0021('0x71'),_0x0021('0x72'),'work_end',_0x0021('0x73'),_0x0021('0x74'),_0x0021('0x75'),'approval_set',_0x0021('0x54'),'work_notes','short_description',_0x0021('0x55'),_0x0021('0x76'),_0x0021('0x77'),_0x0021('0x78'),_0x0021('0x79'),'business_stc',_0x0021('0x7a'),_0x0021('0x7b'),_0x0021('0x7c'),'notify',_0x0021('0x7d'),'close_notes',_0x0021('0x7e'),_0x0021('0x7f'),'parent_incident',_0x0021('0x80'),'contact_type',_0x0021('0x81'),_0x0021('0x57'),_0x0021('0x82'),_0x0021('0x83'),'company',_0x0021('0x84'),'activity_due','assigned_to',_0x0021('0x85'),_0x0021('0x86'),_0x0021('0x87'),'approval',_0x0021('0x88'),_0x0021('0x89'),_0x0021('0x8a'),'reopen_count',_0x0021('0x8b'),'escalation',_0x0021('0x8c'),'correlation_id',_0x0021('0x8d'),'category'];var _0x1f08b2='';var _0x2e072b='';var _0x234d18=[];var _0x42f9d6='';var _0x48a81d='';var _0x57d342=[];var _0x4145bd='';var _0x500338='';var _0x55d109={};var _0x25c85d='';return db['ServicenowAccount'][_0x0021('0x45')]({'where':{'id':_0xd23047[_0x0021('0x43')]['id']},'attributes':['id',_0x0021('0x8e'),_0x0021('0x8f'),'email',_0x0021('0x90'),_0x0021('0x91')]})[_0x0021('0x25')](handleEntityNotFound(_0x50d34f,null))[_0x0021('0x25')](function(_0x3a3a1e){if(_0x3a3a1e){_0x25c85d=_0x3a3a1e['remoteUri'];var _0x1b779d=_0x25c85d[_0x0021('0x92')](-0x1);if(_0x1b779d==='/'){_0x25c85d=_0x25c85d['substring'](0x0,_0x25c85d[_0x0021('0x93')](_0x1b779d));}_0x500338=util[_0x0021('0x94')](_0x0021('0x95'),_0x25c85d);_0x4145bd=util['format'](_0x0021('0x96'),_0x25c85d);_0x55d109={'user':_0x3a3a1e[_0x0021('0x8e')],'pass':_0x3a3a1e['password']};var _0x4ba21a={'method':_0x0021('0x97'),'uri':_0x500338+_0x0021('0x98'),'auth':_0x55d109,'json':!![]};return rp(_0x4ba21a);}})['then'](function(_0x3812c0){if(_0x3812c0[_0x0021('0x99')]['length']>0x0){_0x1f08b2=_0x3812c0[_0x0021('0x99')];}console[_0x0021('0x9a')](_0x0021('0x9b'),_0x1f08b2);_0x57d342=[];_0x2e072b=Object[_0x0021('0x9c')]([],_0x1f08b2);_[_0x0021('0x9d')](_0x2e072b,function(_0x3afffd){return!_0x1bd68a[_0x0021('0x9e')](_0x3afffd[_0x0021('0x26')]);});_0x2e072b[_0x0021('0x9f')](function(_0x2a3d99){var _0x16c9d2=createFieldObject(_0x4145bd,_0x55d109,_0x2a3d99[_0x0021('0xa0')],_0x2a3d99[_0x0021('0x26')],_0x2a3d99[_0x0021('0xa1')],![]);_0x57d342[_0x0021('0xa2')](_0x16c9d2);});return Promise[_0x0021('0xa3')](_0x57d342);})['then'](function(_0x4e23d9){_0x234d18=_0x4e23d9;_0x42f9d6=Object['assign']([],_0x1f08b2);console[_0x0021('0x9a')]('TCL:\x20_object',_0x1f08b2);_['remove'](_0x42f9d6,function(_0x2b7963){return _0x47e2b6[_0x0021('0x9e')](_0x2b7963['name']);});console[_0x0021('0x9a')](_0x0021('0xa4'),_0x42f9d6);_0x57d342=[];_0x42f9d6[_0x0021('0x9f')](function(_0x44b0f4){var _0x5cfbc7=createFieldObject(_0x4145bd,_0x55d109,_0x44b0f4[_0x0021('0xa0')],_0x44b0f4['name'],_0x44b0f4['label'],!![]);_0x57d342[_0x0021('0xa2')](_0x5cfbc7);});return Promise[_0x0021('0xa3')](_0x57d342);})[_0x0021('0x25')](function(_0x18a301){_0x48a81d=_0x18a301;var _0x1255cb=_0x234d18['concat'](_0x48a81d);return{'count':_0x1255cb['length'],'rows':_0x1255cb};})[_0x0021('0x25')](respondWithResult(_0x50d34f,null))[_0x0021('0x40')](function(_0xbcf6e4){console['log'](_0x0021('0xa5')+_0xbcf6e4);var _0x363cff=_0xd23047[_0x0021('0x2c')][_0x0021('0xa6')]?0x1f4:_0xbcf6e4[_0x0021('0xa7')]||0x1f4;logger[_0x0021('0xa8')](_0xbcf6e4[_0x0021('0xa9')]);delete _0xbcf6e4[_0x0021('0x26')];if(_0x363cff===0x191){_0x363cff=0x190;}_0x50d34f[_0x0021('0x18')](_0x363cff)['send'](_0xd23047[_0x0021('0x2c')][_0x0021('0xa6')]?{'message':_0x0021('0xaa'),'statusCode':_0xbcf6e4[_0x0021('0xa7')]}:_0xbcf6e4);});};function createFieldObject(_0x1c7e39,_0x21ef62,_0x5af87a,_0x19fbf1,_0x45e4c8,_0x515e16){return new Promise(function(_0x492cb3,_0x2c09c6){var _0x2cf864={'id':_0x19fbf1,'name':_0x45e4c8,'custom':_0x515e16};if(_0x5af87a===_0x0021('0xab')){_0x2cf864[_0x0021('0x3a')]=[{'name':_0x0021('0xac'),'value':_0x0021('0xad')},{'name':_0x0021('0xae'),'value':_0x0021('0xaf')}];_0x492cb3(_0x2cf864);}else{var _0x3fda43={'method':_0x0021('0x97'),'uri':_0x1c7e39+'sys_choice?sysparm_query=name=incident^element='+_0x19fbf1,'auth':_0x21ef62,'json':!![]};return rp(_0x3fda43)[_0x0021('0x25')](function(_0x51bf8a){var _0xd55804=[];if(_0x51bf8a[_0x0021('0x99')]['length']>0x0){_0x51bf8a['result'][_0x0021('0x9f')](function(_0x5557a6){if(_0x5557a6[_0x0021('0xb0')]===_0x0021('0xaf')){var _0x430b91={'name':_0x5557a6[_0x0021('0xa1')],'value':_0x5557a6['value']};_0xd55804[_0x0021('0xa2')](_0x430b91);}});}_0x2cf864[_0x0021('0x3a')]=_0xd55804;if(_0x2cf864[_0x0021('0x3a')]['length']>0x0){_0x492cb3(_0x2cf864);}else{if(_0x515e16==![]){_0x492cb3();}else{_0x492cb3(_0x2cf864);}}});}});} \ No newline at end of file +var _0xcb8e=['findOne','ServicenowConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','made_sla','knowledge','subcategory','notify','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','impact','active','work_notes_list','business_service','priority','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','ServiceNow\x20error:\x20','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','rows','catch','include','options','create','body','find','params'];(function(_0x47da89,_0x280bbb){var _0x453dfc=function(_0x461ce7){while(--_0x461ce7){_0x47da89['push'](_0x47da89['shift']());}};_0x453dfc(++_0x280bbb);}(_0xcb8e,0x125));var _0xecb8=function(_0x28d13e,_0x176c4d){_0x28d13e=_0x28d13e-0x0;var _0x950800=_0xcb8e[_0x28d13e];return _0x950800;};'use strict';var emlformat=require(_0xecb8('0x0'));var rimraf=require(_0xecb8('0x1'));var zipdir=require(_0xecb8('0x2'));var jsonpatch=require(_0xecb8('0x3'));var rp=require('request-promise');var moment=require(_0xecb8('0x4'));var BPromise=require(_0xecb8('0x5'));var Mustache=require(_0xecb8('0x6'));var util=require(_0xecb8('0x7'));var path=require(_0xecb8('0x8'));var sox=require(_0xecb8('0x9'));var csv=require(_0xecb8('0xa'));var ejs=require(_0xecb8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecb8('0xc'));var squel=require(_0xecb8('0xd'));var crypto=require(_0xecb8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xecb8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xecb8('0xf'));var authService=require(_0xecb8('0x10'));var qs=require(_0xecb8('0x11'));var as=require(_0xecb8('0x12'));var hardwareService=require(_0xecb8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xecb8('0x14'));var config=require(_0xecb8('0x15'));var licenseUtil=require(_0xecb8('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3aeda4,_0x4a2d76){_0x4a2d76=_0x4a2d76||0xcc;return function(_0x5599a5){if(_0x5599a5){return _0x3aeda4['sendStatus'](_0x4a2d76);}return _0x3aeda4[_0xecb8('0x17')](_0x4a2d76)[_0xecb8('0x18')]();};}function respondWithResult(_0x58897b,_0x56825c){_0x56825c=_0x56825c||0xc8;return function(_0x330b70){if(_0x330b70){return _0x58897b['status'](_0x56825c)['json'](_0x330b70);}};}function respondWithFilteredResult(_0x3bfd19,_0x28af60){return function(_0xf879ec){if(_0xf879ec){var _0x3f5189=typeof _0x28af60['offset']===_0xecb8('0x19')&&typeof _0x28af60['limit']==='undefined';var _0x3a8b20=_0xf879ec[_0xecb8('0x1a')];var _0x1cc3e4=_0x3f5189?0x0:_0x28af60['offset'];var _0x165aca=_0x3f5189?_0xf879ec[_0xecb8('0x1a')]:_0x28af60[_0xecb8('0x1b')]+_0x28af60[_0xecb8('0x1c')];var _0x131032;if(_0x165aca>=_0x3a8b20){_0x165aca=_0x3a8b20;_0x131032=0xc8;}else{_0x131032=0xce;}_0x3bfd19['status'](_0x131032);return _0x3bfd19[_0xecb8('0x1d')](_0xecb8('0x1e'),_0x1cc3e4+'-'+_0x165aca+'/'+_0x3a8b20)[_0xecb8('0x1f')](_0xf879ec);}return null;};}function patchUpdates(_0x524b70){return function(_0x424a12){try{jsonpatch[_0xecb8('0x20')](_0x424a12,_0x524b70,!![]);}catch(_0x293f25){return BPromise[_0xecb8('0x21')](_0x293f25);}return _0x424a12[_0xecb8('0x22')]();};}function saveUpdates(_0x1db595,_0x5349f4){return function(_0xb74f2f){if(_0xb74f2f){return _0xb74f2f[_0xecb8('0x23')](_0x1db595)['then'](function(_0x28b8b7){return _0x28b8b7;});}return null;};}function removeEntity(_0x1a58d1,_0x3a97c7){return function(_0x40fcd8){if(_0x40fcd8){return _0x40fcd8[_0xecb8('0x24')]()[_0xecb8('0x25')](function(){_0x1a58d1[_0xecb8('0x17')](0xcc)[_0xecb8('0x18')]();});}};}function handleEntityNotFound(_0x449cde,_0x554dcf){return function(_0x570733){if(!_0x570733){_0x449cde[_0xecb8('0x26')](0x194);}return _0x570733;};}function handleError(_0x43704d,_0x1208ab){_0x1208ab=_0x1208ab||0x1f4;return function(_0x2190c9){logger[_0xecb8('0x27')](_0x2190c9[_0xecb8('0x28')]);if(_0x2190c9[_0xecb8('0x29')]){delete _0x2190c9[_0xecb8('0x29')];}_0x43704d['status'](_0x1208ab)[_0xecb8('0x2a')](_0x2190c9);};}exports['index']=function(_0x33db9a,_0x2cb6fe){var _0x4f71a6={},_0x42ab79={},_0xbc350e={'count':0x0,'rows':[]};var _0xe431f8=_['map'](db[_0xecb8('0x2b')][_0xecb8('0x2c')],function(_0x681035){return{'name':_0x681035[_0xecb8('0x2d')],'type':_0x681035[_0xecb8('0x2e')]['key']};});_0x42ab79[_0xecb8('0x2f')]=_[_0xecb8('0x30')](_0xe431f8,_0xecb8('0x29'));_0x42ab79[_0xecb8('0x31')]=_[_0xecb8('0x32')](_0x33db9a[_0xecb8('0x31')]);_0x42ab79[_0xecb8('0x33')]=_[_0xecb8('0x34')](_0x42ab79[_0xecb8('0x2f')],_0x42ab79['query']);_0x4f71a6[_0xecb8('0x35')]=_[_0xecb8('0x34')](_0x42ab79['model'],qs['fields'](_0x33db9a['query'][_0xecb8('0x36')]));_0x4f71a6[_0xecb8('0x35')]=_0x4f71a6['attributes'][_0xecb8('0x37')]?_0x4f71a6[_0xecb8('0x35')]:_0x42ab79[_0xecb8('0x2f')];if(!_0x33db9a[_0xecb8('0x31')]['hasOwnProperty'](_0xecb8('0x38'))){_0x4f71a6[_0xecb8('0x1c')]=qs[_0xecb8('0x1c')](_0x33db9a['query']['limit']);_0x4f71a6[_0xecb8('0x1b')]=qs[_0xecb8('0x1b')](_0x33db9a[_0xecb8('0x31')][_0xecb8('0x1b')]);}_0x4f71a6[_0xecb8('0x39')]=qs[_0xecb8('0x3a')](_0x33db9a[_0xecb8('0x31')]['sort']);_0x4f71a6['where']=qs[_0xecb8('0x33')](_[_0xecb8('0x3b')](_0x33db9a[_0xecb8('0x31')],_0x42ab79['filters']),_0xe431f8);if(_0x33db9a['query'][_0xecb8('0x3c')]){_0x4f71a6[_0xecb8('0x3d')]=_[_0xecb8('0x3e')](_0x4f71a6[_0xecb8('0x3d')],{'$or':_[_0xecb8('0x30')](_0xe431f8,function(_0xb34781){if(_0xb34781[_0xecb8('0x2e')]!=='VIRTUAL'){var _0x1dca8d={};_0x1dca8d[_0xb34781['name']]={'$like':'%'+_0x33db9a[_0xecb8('0x31')]['filter']+'%'};return _0x1dca8d;}})});}_0x4f71a6=_[_0xecb8('0x3e')]({},_0x4f71a6,_0x33db9a['options']);var _0x56fea7={'where':_0x4f71a6[_0xecb8('0x3d')]};return db[_0xecb8('0x2b')]['count'](_0x56fea7)[_0xecb8('0x25')](function(_0x51ec1a){_0xbc350e[_0xecb8('0x1a')]=_0x51ec1a;if(_0x33db9a[_0xecb8('0x31')]['includeAll']){_0x4f71a6['include']=[{'all':!![]}];}return db[_0xecb8('0x2b')]['findAll'](_0x4f71a6);})[_0xecb8('0x25')](function(_0x293895){_0xbc350e[_0xecb8('0x3f')]=_0x293895;return _0xbc350e;})['then'](respondWithFilteredResult(_0x2cb6fe,_0x4f71a6))[_0xecb8('0x40')](handleError(_0x2cb6fe,null));};exports['show']=function(_0x43deab,_0x1667c3){var _0x4acfae={'raw':![],'where':{'id':_0x43deab['params']['id']}},_0x44ef3b={};_0x44ef3b[_0xecb8('0x2f')]=_['keys'](db[_0xecb8('0x2b')]['rawAttributes']);_0x44ef3b['query']=_[_0xecb8('0x32')](_0x43deab[_0xecb8('0x31')]);_0x44ef3b[_0xecb8('0x33')]=_['intersection'](_0x44ef3b[_0xecb8('0x2f')],_0x44ef3b[_0xecb8('0x31')]);_0x4acfae[_0xecb8('0x35')]=_[_0xecb8('0x34')](_0x44ef3b['model'],qs['fields'](_0x43deab[_0xecb8('0x31')]['fields']));_0x4acfae[_0xecb8('0x35')]=_0x4acfae[_0xecb8('0x35')][_0xecb8('0x37')]?_0x4acfae[_0xecb8('0x35')]:_0x44ef3b[_0xecb8('0x2f')];if(_0x43deab['query']['includeAll']){_0x4acfae[_0xecb8('0x41')]=[{'all':!![]}];}_0x4acfae=_['merge']({},_0x4acfae,_0x43deab[_0xecb8('0x42')]);return db[_0xecb8('0x2b')]['find'](_0x4acfae)[_0xecb8('0x25')](handleEntityNotFound(_0x1667c3,null))[_0xecb8('0x25')](respondWithResult(_0x1667c3,null))['catch'](handleError(_0x1667c3,null));};exports[_0xecb8('0x43')]=function(_0x23a77c,_0xa40dbb){return db['ServicenowAccount'][_0xecb8('0x43')](_0x23a77c[_0xecb8('0x44')],{})['then'](respondWithResult(_0xa40dbb,0xc9))[_0xecb8('0x40')](handleError(_0xa40dbb,null));};exports['update']=function(_0x59f90b,_0x5be5b6){if(_0x59f90b[_0xecb8('0x44')]['id']){delete _0x59f90b[_0xecb8('0x44')]['id'];}return db['ServicenowAccount'][_0xecb8('0x45')]({'where':{'id':_0x59f90b['params']['id']}})['then'](handleEntityNotFound(_0x5be5b6,null))[_0xecb8('0x25')](saveUpdates(_0x59f90b[_0xecb8('0x44')],null))[_0xecb8('0x25')](respondWithResult(_0x5be5b6,null))[_0xecb8('0x40')](handleError(_0x5be5b6,null));};exports['destroy']=function(_0x587498,_0x54bd7e){return db[_0xecb8('0x2b')][_0xecb8('0x45')]({'where':{'id':_0x587498[_0xecb8('0x46')]['id']}})[_0xecb8('0x25')](handleEntityNotFound(_0x54bd7e,null))[_0xecb8('0x25')](removeEntity(_0x54bd7e,null))[_0xecb8('0x40')](handleError(_0x54bd7e,null));};exports['getConfigurations']=function(_0x6f8278,_0x3063a0,_0x2c36b3){var _0x62a7df={};var _0x88b6fb={};var _0x266450;var _0x441c71;return db[_0xecb8('0x2b')][_0xecb8('0x47')]({'where':{'id':_0x6f8278[_0xecb8('0x46')]['id']}})['then'](handleEntityNotFound(_0x3063a0,null))['then'](function(_0x4dc92a){if(_0x4dc92a){_0x266450=_0x4dc92a;_0x88b6fb[_0xecb8('0x2f')]=_['keys'](db[_0xecb8('0x48')][_0xecb8('0x2c')]);_0x88b6fb[_0xecb8('0x31')]=_['keys'](_0x6f8278[_0xecb8('0x31')]);_0x88b6fb[_0xecb8('0x33')]=_[_0xecb8('0x34')](_0x88b6fb[_0xecb8('0x2f')],_0x88b6fb['query']);_0x62a7df[_0xecb8('0x35')]=_[_0xecb8('0x34')](_0x88b6fb[_0xecb8('0x2f')],qs[_0xecb8('0x36')](_0x6f8278[_0xecb8('0x31')]['fields']));_0x62a7df['attributes']=_0x62a7df[_0xecb8('0x35')][_0xecb8('0x37')]?_0x62a7df[_0xecb8('0x35')]:_0x88b6fb['model'];_0x62a7df['order']=qs[_0xecb8('0x3a')](_0x6f8278[_0xecb8('0x31')][_0xecb8('0x3a')]);_0x62a7df[_0xecb8('0x3d')]=qs[_0xecb8('0x33')](_[_0xecb8('0x3b')](_0x6f8278[_0xecb8('0x31')],_0x88b6fb[_0xecb8('0x33')]));if(_0x6f8278[_0xecb8('0x31')]['filter']){_0x62a7df[_0xecb8('0x3d')]=_[_0xecb8('0x3e')](_0x62a7df['where'],{'$or':_[_0xecb8('0x30')](_0x62a7df[_0xecb8('0x35')],function(_0x358439){var _0x2b9012={};_0x2b9012[_0x358439]={'$like':'%'+_0x6f8278[_0xecb8('0x31')][_0xecb8('0x3c')]+'%'};return _0x2b9012;})});}_0x62a7df=_[_0xecb8('0x3e')]({},_0x62a7df,_0x6f8278[_0xecb8('0x42')]);return _0x266450[_0xecb8('0x49')](_0x62a7df);}})[_0xecb8('0x25')](function(_0x22a50b){if(_0x22a50b){_0x441c71=_0x22a50b[_0xecb8('0x37')];if(!_0x6f8278['query'][_0xecb8('0x4a')](_0xecb8('0x38'))){_0x62a7df[_0xecb8('0x1c')]=qs['limit'](_0x6f8278[_0xecb8('0x31')]['limit']);_0x62a7df[_0xecb8('0x1b')]=qs[_0xecb8('0x1b')](_0x6f8278[_0xecb8('0x31')][_0xecb8('0x1b')]);}return _0x266450['getConfigurations'](_0x62a7df);}})[_0xecb8('0x25')](function(_0x5189d5){if(_0x5189d5){return _0x5189d5?{'count':_0x441c71,'rows':_0x5189d5}:null;}})[_0xecb8('0x25')](respondWithResult(_0x3063a0,null))['catch'](handleError(_0x3063a0,null));};exports[_0xecb8('0x4b')]=function(_0x3ba763,_0xdd1402,_0x57d152){if(_0x3ba763[_0xecb8('0x44')]['id']){delete _0x3ba763['body']['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3ba763[_0xecb8('0x46')]['id']}})[_0xecb8('0x25')](handleEntityNotFound(_0xdd1402,null))[_0xecb8('0x25')](function(_0x3df72e){if(_0x3df72e){_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4c')]=_0x3df72e['id'];_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4d')]=integrations[_0xecb8('0x4e')](_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4f')],_0x3ba763[_0xecb8('0x44')]['type']);_0x3ba763[_0xecb8('0x44')]['Descriptions']=integrations['getDescriptions'](_0x3ba763[_0xecb8('0x44')][_0xecb8('0x4f')],_0x3ba763[_0xecb8('0x44')][_0xecb8('0x2e')]);return db['ServicenowConfiguration']['create'](_0x3ba763[_0xecb8('0x44')],{'include':[{'model':db[_0xecb8('0x50')],'as':_0xecb8('0x4d')},{'model':db[_0xecb8('0x50')],'as':'Descriptions'}]});}return null;})[_0xecb8('0x25')](respondWithResult(_0xdd1402,null))[_0xecb8('0x40')](handleError(_0xdd1402,null));};exports['getFields']=function(_0x40b4cd,_0x48be6e,_0x3e2648){var _0x5969a3=[_0xecb8('0x51'),'hold_reason',_0xecb8('0x52'),_0xecb8('0x53'),'close_code',_0xecb8('0x54'),_0xecb8('0x55'),_0xecb8('0x56'),'category'];var _0x4854d5=[_0xecb8('0x57'),'made_sla',_0xecb8('0x58'),_0xecb8('0x59'),_0xecb8('0x5a'),_0xecb8('0x5b'),_0xecb8('0x5c'),'hold_reason',_0xecb8('0x5d'),_0xecb8('0x5e'),'resolved_by',_0xecb8('0x5f'),_0xecb8('0x60'),_0xecb8('0x61'),'sys_created_on',_0xecb8('0x62'),_0xecb8('0x63'),_0xecb8('0x64'),_0xecb8('0x52'),_0xecb8('0x39'),_0xecb8('0x65'),_0xecb8('0x66'),'cmdb_ci','delivery_plan',_0xecb8('0x67'),_0xecb8('0x68'),_0xecb8('0x69'),_0xecb8('0x6a'),_0xecb8('0x6b'),'sys_domain_path','rfc','time_worked',_0xecb8('0x6c'),_0xecb8('0x6d'),'business_duration',_0xecb8('0x6e'),_0xecb8('0x6f'),_0xecb8('0x70'),_0xecb8('0x71'),_0xecb8('0x72'),'approval_set',_0xecb8('0x53'),_0xecb8('0x73'),_0xecb8('0x74'),_0xecb8('0x75'),_0xecb8('0x76'),_0xecb8('0x77'),_0xecb8('0x78'),_0xecb8('0x79'),_0xecb8('0x7a'),_0xecb8('0x7b'),'description',_0xecb8('0x7c'),_0xecb8('0x54'),_0xecb8('0x7d'),_0xecb8('0x7e'),_0xecb8('0x7f'),'follow_up','parent_incident',_0xecb8('0x80'),_0xecb8('0x81'),_0xecb8('0x82'),_0xecb8('0x55'),_0xecb8('0x83'),_0xecb8('0x84'),_0xecb8('0x85'),_0xecb8('0x86'),'activity_due',_0xecb8('0x87'),'severity',_0xecb8('0x88'),'sla_due',_0xecb8('0x89'),_0xecb8('0x8a'),_0xecb8('0x8b'),_0xecb8('0x8c'),_0xecb8('0x8d'),_0xecb8('0x8e'),'escalation',_0xecb8('0x8f'),_0xecb8('0x90'),_0xecb8('0x91'),'category'];var _0xeceeb4='';var _0x4e5a2a='';var _0x40ae9d=[];var _0x283f96='';var _0x423e3f='';var _0x45de77=[];var _0x2f0fb0='';var _0x43f8da='';var _0x17121f={};var _0x5a8677='';return db['ServicenowAccount'][_0xecb8('0x47')]({'where':{'id':_0x40b4cd[_0xecb8('0x46')]['id']},'attributes':['id',_0xecb8('0x92'),_0xecb8('0x93'),_0xecb8('0x94'),_0xecb8('0x95'),_0xecb8('0x96')]})[_0xecb8('0x25')](handleEntityNotFound(_0x48be6e,null))[_0xecb8('0x25')](function(_0x51db2d){if(_0x51db2d){_0x5a8677=_0x51db2d['remoteUri'];var _0x35176c=_0x5a8677[_0xecb8('0x97')](-0x1);if(_0x35176c==='/'){_0x5a8677=_0x5a8677[_0xecb8('0x98')](0x0,_0x5a8677[_0xecb8('0x99')](_0x35176c));}_0x43f8da=util[_0xecb8('0x9a')](_0xecb8('0x9b'),_0x5a8677);_0x2f0fb0=util[_0xecb8('0x9a')](_0xecb8('0x9c'),_0x5a8677);_0x17121f={'user':_0x51db2d[_0xecb8('0x92')],'pass':_0x51db2d[_0xecb8('0x93')]};var _0x3579b0={'method':_0xecb8('0x9d'),'uri':_0x43f8da+_0xecb8('0x9e'),'auth':_0x17121f,'json':!![]};return rp(_0x3579b0);}})[_0xecb8('0x25')](function(_0x46addb){if(_0x46addb[_0xecb8('0x9f')][_0xecb8('0x37')]>0x0){_0xeceeb4=_0x46addb['result'];}console[_0xecb8('0xa0')](_0xecb8('0xa1'),_0xeceeb4);_0x45de77=[];_0x4e5a2a=Object[_0xecb8('0xa2')]([],_0xeceeb4);_[_0xecb8('0xa3')](_0x4e5a2a,function(_0x196294){return!_0x5969a3['includes'](_0x196294[_0xecb8('0x29')]);});_0x4e5a2a[_0xecb8('0xa4')](function(_0x2bb132){var _0x382c37=createFieldObject(_0x2f0fb0,_0x17121f,_0x2bb132[_0xecb8('0xa5')],_0x2bb132[_0xecb8('0x29')],_0x2bb132[_0xecb8('0xa6')],![]);_0x45de77[_0xecb8('0xa7')](_0x382c37);});return Promise[_0xecb8('0xa8')](_0x45de77);})[_0xecb8('0x25')](function(_0x4767dc){_0x40ae9d=_0x4767dc;_0x283f96=Object[_0xecb8('0xa2')]([],_0xeceeb4);console[_0xecb8('0xa0')](_0xecb8('0xa9'),_0xeceeb4);_['remove'](_0x283f96,function(_0x3ffc59){return _0x4854d5[_0xecb8('0xaa')](_0x3ffc59['name']);});console[_0xecb8('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x283f96);_0x45de77=[];_0x283f96[_0xecb8('0xa4')](function(_0x400047){var _0xc25104=createFieldObject(_0x2f0fb0,_0x17121f,_0x400047[_0xecb8('0xa5')],_0x400047[_0xecb8('0x29')],_0x400047[_0xecb8('0xa6')],!![]);_0x45de77[_0xecb8('0xa7')](_0xc25104);});return Promise[_0xecb8('0xa8')](_0x45de77);})[_0xecb8('0x25')](function(_0x364645){_0x423e3f=_0x364645;var _0x450a0a=_0x40ae9d['concat'](_0x423e3f);return{'count':_0x450a0a['length'],'rows':_0x450a0a};})[_0xecb8('0x25')](respondWithResult(_0x48be6e,null))['catch'](function(_0x3ddac0){console[_0xecb8('0xa0')](_0xecb8('0xab')+_0x3ddac0);var _0x5123ef=_0x40b4cd['query'][_0xecb8('0xac')]?0x1f4:_0x3ddac0['statusCode']||0x1f4;logger[_0xecb8('0x27')](_0x3ddac0[_0xecb8('0x28')]);delete _0x3ddac0[_0xecb8('0x29')];if(_0x5123ef===0x191){_0x5123ef=0x190;}_0x48be6e[_0xecb8('0x17')](_0x5123ef)[_0xecb8('0x2a')](_0x40b4cd[_0xecb8('0x31')][_0xecb8('0xac')]?{'message':_0xecb8('0xad'),'statusCode':_0x3ddac0['statusCode']}:_0x3ddac0);});};function createFieldObject(_0x10fe81,_0x22eb8e,_0x3d46d0,_0x3af48a,_0x509378,_0x1b8b77){return new Promise(function(_0x3034df,_0x573dac){var _0xab88c0={'id':_0x3af48a,'name':_0x509378,'custom':_0x1b8b77};if(_0x3d46d0===_0xecb8('0xae')){_0xab88c0[_0xecb8('0x42')]=[{'name':_0xecb8('0xaf'),'value':_0xecb8('0xb0')},{'name':_0xecb8('0xb1'),'value':_0xecb8('0xb2')}];_0x3034df(_0xab88c0);}else{var _0x3b9de7={'method':_0xecb8('0x9d'),'uri':_0x10fe81+_0xecb8('0xb3')+_0x3af48a,'auth':_0x22eb8e,'json':!![]};return rp(_0x3b9de7)[_0xecb8('0x25')](function(_0x42e50b){var _0x4879b9=[];if(_0x42e50b[_0xecb8('0x9f')]['length']>0x0){_0x42e50b['result'][_0xecb8('0xa4')](function(_0x371cba){if(_0x371cba[_0xecb8('0xb4')]===_0xecb8('0xb2')){var _0x4a5012={'name':_0x371cba[_0xecb8('0xa6')],'value':_0x371cba[_0xecb8('0xb5')]};_0x4879b9[_0xecb8('0xa7')](_0x4a5012);}});}_0xab88c0['options']=_0x4879b9;if(_0xab88c0['options'][_0xecb8('0x37')]>0x0){_0x3034df(_0xab88c0);}else{if(_0x1b8b77==![]){_0x3034df();}else{_0x3034df(_0xab88c0);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 55a2f95..323a95d 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 _0x4975=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18a5a5,_0x4469b7){var _0x112c7f=function(_0x33aa64){while(--_0x33aa64){_0x18a5a5['push'](_0x18a5a5['shift']());}};_0x112c7f(++_0x4469b7);}(_0x4975,0x86));var _0x5497=function(_0x4b754,_0x4251ed){_0x4b754=_0x4b754-0x0;var _0x472907=_0x4975[_0x4b754];return _0x472907;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));var integrations=require(_0x5497('0xa'));module['exports']=function(_0x37e48d,_0x4f563d){return _0x37e48d[_0x5497('0xb')](_0x5497('0xc'),attributes,{'tableName':_0x5497('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3f0f34,_0x99e9ca){var _0x1ce695=function(_0x50367e){while(--_0x50367e){_0x3f0f34['push'](_0x3f0f34['shift']());}};_0x1ce695(++_0x99e9ca);}(_0x687b,0x14a));var _0xb687=function(_0x3174d2,_0x4dbb8a){_0x3174d2=_0x3174d2-0x0;var _0x28519a=_0x687b[_0x3174d2];return _0x28519a;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'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 88f8d7f..c5e5f56 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 _0x2020=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','catch','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2020,0xf7));var _0x0202=function(_0x861832,_0x57631d){_0x861832=_0x861832-0x0;var _0x36e6d2=_0x2020[_0x861832];return _0x36e6d2;};'use strict';var _=require('lodash');var util=require(_0x0202('0x0'));var moment=require(_0x0202('0x1'));var BPromise=require(_0x0202('0x2'));var rs=require(_0x0202('0x3'));var fs=require('fs');var Redis=require(_0x0202('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0202('0x5'));var logger=require(_0x0202('0x6'))(_0x0202('0x7'));var config=require(_0x0202('0x8'));var jayson=require(_0x0202('0x9'));var client=jayson[_0x0202('0xa')][_0x0202('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dca39,_0xf80c04,_0x4872a1){return new BPromise(function(_0x2a7ab9,_0x253918){return client[_0x0202('0xc')](_0x1dca39,_0x4872a1)[_0x0202('0xd')](function(_0x55b911){logger[_0x0202('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0xf80c04,_0x0202('0xf'));logger[_0x0202('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xf80c04,_0x0202('0xf'),JSON[_0x0202('0x11')](_0x55b911));if(_0x55b911[_0x0202('0x12')]){if(_0x55b911[_0x0202('0x12')][_0x0202('0x13')]===0x1f4){logger[_0x0202('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0xf80c04,_0x55b911[_0x0202('0x12')][_0x0202('0x14')]);return _0x253918(_0x55b911['error'][_0x0202('0x14')]);}logger[_0x0202('0x12')](_0x0202('0x15'),_0xf80c04,_0x55b911['error']['message']);return _0x2a7ab9(_0x55b911[_0x0202('0x12')][_0x0202('0x14')]);}else{logger['info'](_0x0202('0x15'),_0xf80c04,_0x0202('0xf'));_0x2a7ab9(_0x55b911['result']['message']);}})['catch'](function(_0xa3b9f6){logger[_0x0202('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0xf80c04,_0xa3b9f6);_0x253918(_0xa3b9f6);});});}exports['GetServicenowAccount']=function(_0xc3ca3e){var _0x3b10da=this;return new Promise(function(_0x101c1e,_0x5c6122){return db[_0x0202('0x16')][_0x0202('0x17')]({'raw':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x19')]===undefined?!![]:![]:!![],'where':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1a')]||null:null,'attributes':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e['options'][_0x0202('0x1b')]||null:null,'limit':_0xc3ca3e['options']?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1c')]||null:null,'include':_0xc3ca3e[_0x0202('0x18')]?_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1d')]?_[_0x0202('0x1e')](_0xc3ca3e[_0x0202('0x18')][_0x0202('0x1d')],function(_0x1163ad){return{'model':db[_0x1163ad['model']],'as':_0x1163ad['as'],'attributes':_0x1163ad[_0x0202('0x1b')],'include':_0x1163ad[_0x0202('0x1d')]?_[_0x0202('0x1e')](_0x1163ad[_0x0202('0x1d')],function(_0x2ea184){return{'model':db[_0x2ea184['model']],'as':_0x2ea184['as'],'attributes':_0x2ea184[_0x0202('0x1b')],'include':_0x2ea184['include']?_['map'](_0x2ea184['include'],function(_0x3a70e5){return{'model':db[_0x3a70e5[_0x0202('0x1f')]],'as':_0x3a70e5['as'],'attributes':_0x3a70e5[_0x0202('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0202('0xd')](function(_0x5335d7){logger[_0x0202('0xe')](_0x0202('0x20'),_0xc3ca3e);logger[_0x0202('0x10')]('GetServicenowAccount',_0xc3ca3e,JSON[_0x0202('0x11')](_0x5335d7));_0x101c1e(_0x5335d7);})[_0x0202('0x21')](function(_0x390caa){logger['error'](_0x0202('0x20'),_0x390caa[_0x0202('0x14')],_0xc3ca3e);_0x5c6122(_0x3b10da[_0x0202('0x12')](0x1f4,_0x390caa[_0x0202('0x14')]));});});};exports[_0x0202('0x22')]=function(_0x4d2b3b){var _0x22fd20=this;return new Promise(function(_0x17b2e6,_0x534296){return db[_0x0202('0x16')][_0x0202('0x23')]({'raw':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b[_0x0202('0x18')][_0x0202('0x19')]===undefined?!![]:![]:!![],'where':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b[_0x0202('0x18')]['where']||null:null,'attributes':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b[_0x0202('0x18')]['attributes']||null:null,'include':_0x4d2b3b[_0x0202('0x18')]?_0x4d2b3b['options'][_0x0202('0x1d')]?_['map'](_0x4d2b3b[_0x0202('0x18')][_0x0202('0x1d')],function(_0x2cdb07){return{'model':db[_0x2cdb07[_0x0202('0x1f')]],'as':_0x2cdb07['as'],'attributes':_0x2cdb07[_0x0202('0x1b')],'include':_0x2cdb07[_0x0202('0x1d')]?_[_0x0202('0x1e')](_0x2cdb07[_0x0202('0x1d')],function(_0x21a7dc){return{'model':db[_0x21a7dc[_0x0202('0x1f')]],'as':_0x21a7dc['as'],'attributes':_0x21a7dc[_0x0202('0x1b')],'include':_0x21a7dc[_0x0202('0x1d')]?_[_0x0202('0x1e')](_0x21a7dc[_0x0202('0x1d')],function(_0x32c390){return{'model':db[_0x32c390[_0x0202('0x1f')]],'as':_0x32c390['as'],'attributes':_0x32c390['attributes']};}):[]};}):[]};}):[]:[]})[_0x0202('0xd')](function(_0x4cde9e){logger[_0x0202('0xe')]('ShowServicenowAccount',_0x4d2b3b);logger['debug']('ShowServicenowAccount',_0x4d2b3b,JSON['stringify'](_0x4cde9e));_0x17b2e6(_0x4cde9e);})[_0x0202('0x21')](function(_0x734d71){logger[_0x0202('0x12')](_0x0202('0x22'),_0x734d71[_0x0202('0x14')],_0x4d2b3b);_0x534296(_0x22fd20['error'](0x1f4,_0x734d71[_0x0202('0x14')]));});});}; \ No newline at end of file +var _0x3d4e=['http','request','then','debug','code','error','ServicenowAccount,\x20%s,\x20%s','message','info','request\x20sent','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','model','stringify','ShowServicenowAccount','find','raw','map','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xc80883,_0x1dfeed){var _0x41e940=function(_0x42dd0c){while(--_0x42dd0c){_0xc80883['push'](_0xc80883['shift']());}};_0x41e940(++_0x1dfeed);}(_0x3d4e,0xa5));var _0xe3d4=function(_0x138ebc,_0x144347){_0x138ebc=_0x138ebc-0x0;var _0x125e1a=_0x3d4e[_0x138ebc];return _0x125e1a;};'use strict';var _=require(_0xe3d4('0x0'));var util=require(_0xe3d4('0x1'));var moment=require('moment');var BPromise=require(_0xe3d4('0x2'));var rs=require(_0xe3d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3d4('0x4'))['db'];var utils=require(_0xe3d4('0x5'));var logger=require(_0xe3d4('0x6'))('rpc');var config=require(_0xe3d4('0x7'));var jayson=require(_0xe3d4('0x8'));var client=jayson[_0xe3d4('0x9')][_0xe3d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x414ccd,_0xfba5d6,_0x2e532f){return new BPromise(function(_0x313258,_0x165063){return client[_0xe3d4('0xb')](_0x414ccd,_0x2e532f)[_0xe3d4('0xc')](function(_0xc9c100){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0xfba5d6,'request\x20sent');logger[_0xe3d4('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xfba5d6,'request\x20sent',JSON['stringify'](_0xc9c100));if(_0xc9c100['error']){if(_0xc9c100['error'][_0xe3d4('0xe')]===0x1f4){logger[_0xe3d4('0xf')](_0xe3d4('0x10'),_0xfba5d6,_0xc9c100[_0xe3d4('0xf')]['message']);return _0x165063(_0xc9c100[_0xe3d4('0xf')][_0xe3d4('0x11')]);}logger[_0xe3d4('0xf')](_0xe3d4('0x10'),_0xfba5d6,_0xc9c100['error']['message']);return _0x313258(_0xc9c100[_0xe3d4('0xf')][_0xe3d4('0x11')]);}else{logger[_0xe3d4('0x12')](_0xe3d4('0x10'),_0xfba5d6,_0xe3d4('0x13'));_0x313258(_0xc9c100[_0xe3d4('0x14')][_0xe3d4('0x11')]);}})['catch'](function(_0x2b4bf9){logger['error'](_0xe3d4('0x10'),_0xfba5d6,_0x2b4bf9);_0x165063(_0x2b4bf9);});});}exports[_0xe3d4('0x15')]=function(_0xbf7606){var _0x3aa1ba=this;return new Promise(function(_0x494cab,_0x346ca0){return db[_0xe3d4('0x16')][_0xe3d4('0x17')]({'raw':_0xbf7606[_0xe3d4('0x18')]?_0xbf7606[_0xe3d4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xbf7606[_0xe3d4('0x18')]?_0xbf7606[_0xe3d4('0x18')][_0xe3d4('0x19')]||null:null,'attributes':_0xbf7606[_0xe3d4('0x18')]?_0xbf7606[_0xe3d4('0x18')][_0xe3d4('0x1a')]||null:null,'limit':_0xbf7606['options']?_0xbf7606[_0xe3d4('0x18')][_0xe3d4('0x1b')]||null:null,'include':_0xbf7606[_0xe3d4('0x18')]?_0xbf7606[_0xe3d4('0x18')][_0xe3d4('0x1c')]?_['map'](_0xbf7606[_0xe3d4('0x18')][_0xe3d4('0x1c')],function(_0x3f74c2){return{'model':db[_0x3f74c2[_0xe3d4('0x1d')]],'as':_0x3f74c2['as'],'attributes':_0x3f74c2['attributes'],'include':_0x3f74c2[_0xe3d4('0x1c')]?_['map'](_0x3f74c2['include'],function(_0x331030){return{'model':db[_0x331030[_0xe3d4('0x1d')]],'as':_0x331030['as'],'attributes':_0x331030[_0xe3d4('0x1a')],'include':_0x331030[_0xe3d4('0x1c')]?_['map'](_0x331030['include'],function(_0x434099){return{'model':db[_0x434099['model']],'as':_0x434099['as'],'attributes':_0x434099['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3d4('0xc')](function(_0x138c26){logger[_0xe3d4('0x12')](_0xe3d4('0x15'),_0xbf7606);logger[_0xe3d4('0xd')](_0xe3d4('0x15'),_0xbf7606,JSON[_0xe3d4('0x1e')](_0x138c26));_0x494cab(_0x138c26);})['catch'](function(_0x2f8225){logger['error'](_0xe3d4('0x15'),_0x2f8225[_0xe3d4('0x11')],_0xbf7606);_0x346ca0(_0x3aa1ba[_0xe3d4('0xf')](0x1f4,_0x2f8225[_0xe3d4('0x11')]));});});};exports[_0xe3d4('0x1f')]=function(_0x24f576){var _0x5f2d27=this;return new Promise(function(_0x41043d,_0x508ebc){return db['ServicenowAccount'][_0xe3d4('0x20')]({'raw':_0x24f576[_0xe3d4('0x18')]?_0x24f576[_0xe3d4('0x18')][_0xe3d4('0x21')]===undefined?!![]:![]:!![],'where':_0x24f576[_0xe3d4('0x18')]?_0x24f576[_0xe3d4('0x18')][_0xe3d4('0x19')]||null:null,'attributes':_0x24f576[_0xe3d4('0x18')]?_0x24f576[_0xe3d4('0x18')][_0xe3d4('0x1a')]||null:null,'include':_0x24f576[_0xe3d4('0x18')]?_0x24f576[_0xe3d4('0x18')][_0xe3d4('0x1c')]?_[_0xe3d4('0x22')](_0x24f576['options'][_0xe3d4('0x1c')],function(_0xd4272d){return{'model':db[_0xd4272d['model']],'as':_0xd4272d['as'],'attributes':_0xd4272d['attributes'],'include':_0xd4272d['include']?_[_0xe3d4('0x22')](_0xd4272d[_0xe3d4('0x1c')],function(_0x4a806b){return{'model':db[_0x4a806b['model']],'as':_0x4a806b['as'],'attributes':_0x4a806b['attributes'],'include':_0x4a806b['include']?_['map'](_0x4a806b[_0xe3d4('0x1c')],function(_0x19f506){return{'model':db[_0x19f506[_0xe3d4('0x1d')]],'as':_0x19f506['as'],'attributes':_0x19f506['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3d4('0xc')](function(_0x5bc64c){logger[_0xe3d4('0x12')](_0xe3d4('0x1f'),_0x24f576);logger[_0xe3d4('0xd')](_0xe3d4('0x1f'),_0x24f576,JSON[_0xe3d4('0x1e')](_0x5bc64c));_0x41043d(_0x5bc64c);})['catch'](function(_0x45f2fd){logger[_0xe3d4('0xf')]('ShowServicenowAccount',_0x45f2fd['message'],_0x24f576);_0x508ebc(_0x5f2d27[_0xe3d4('0xf')](0x1f4,_0x45f2fd[_0xe3d4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 6ccce21..444d4b6 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 _0x5ba7=['get','isAuthenticated','index','/:id','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x5477eb,_0x2b938a){var _0xcf34bc=function(_0x224624){while(--_0x224624){_0x5477eb['push'](_0x5477eb['shift']());}};_0xcf34bc(++_0x2b938a);}(_0x5ba7,0xe9));var _0x75ba=function(_0x473e68,_0x2a0711){_0x473e68=_0x473e68-0x0;var _0x7908e4=_0x5ba7[_0x473e68];return _0x7908e4;};'use strict';var multer=require(_0x75ba('0x0'));var util=require(_0x75ba('0x1'));var path=require(_0x75ba('0x2'));var timeout=require(_0x75ba('0x3'));var express=require(_0x75ba('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x75ba('0x5'));var interaction=require(_0x75ba('0x6'));var config=require(_0x75ba('0x7'));var controller=require(_0x75ba('0x8'));router[_0x75ba('0x9')]('/',auth[_0x75ba('0xa')](),controller[_0x75ba('0xb')]);router[_0x75ba('0x9')](_0x75ba('0xc'),auth[_0x75ba('0xa')](),controller['show']);router[_0x75ba('0x9')]('/:id/fields',auth[_0x75ba('0xa')](),controller['getFields']);router[_0x75ba('0x9')]('/:id/subjects',auth[_0x75ba('0xa')](),controller['getSubjects']);router[_0x75ba('0x9')](_0x75ba('0xd'),auth[_0x75ba('0xa')](),controller[_0x75ba('0xe')]);router[_0x75ba('0xf')]('/',auth['isAuthenticated'](),controller[_0x75ba('0x10')]);router[_0x75ba('0x11')](_0x75ba('0xc'),auth[_0x75ba('0xa')](),controller[_0x75ba('0x12')]);router[_0x75ba('0x13')](_0x75ba('0xc'),auth[_0x75ba('0xa')](),controller[_0x75ba('0x14')]);module[_0x75ba('0x15')]=router; \ No newline at end of file +var _0xb9cc=['../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4ab021,_0x2c7cc0){var _0x5aabfb=function(_0x476713){while(--_0x476713){_0x4ab021['push'](_0x4ab021['shift']());}};_0x5aabfb(++_0x2c7cc0);}(_0xb9cc,0x13c));var _0xcb9c=function(_0x256e0b,_0x49e1c1){_0x256e0b=_0x256e0b-0x0;var _0x2e9637=_0xb9cc[_0x256e0b];return _0x2e9637;};'use strict';var multer=require(_0xcb9c('0x0'));var util=require(_0xcb9c('0x1'));var path=require(_0xcb9c('0x2'));var timeout=require(_0xcb9c('0x3'));var express=require(_0xcb9c('0x4'));var router=express[_0xcb9c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcb9c('0x6'));var interaction=require(_0xcb9c('0x7'));var config=require('../../config/environment');var controller=require(_0xcb9c('0x8'));router[_0xcb9c('0x9')]('/',auth[_0xcb9c('0xa')](),controller[_0xcb9c('0xb')]);router[_0xcb9c('0x9')](_0xcb9c('0xc'),auth[_0xcb9c('0xa')](),controller[_0xcb9c('0xd')]);router['get'](_0xcb9c('0xe'),auth[_0xcb9c('0xa')](),controller[_0xcb9c('0xf')]);router['get'](_0xcb9c('0x10'),auth[_0xcb9c('0xa')](),controller['getSubjects']);router[_0xcb9c('0x9')]('/:id/descriptions',auth[_0xcb9c('0xa')](),controller['getDescriptions']);router[_0xcb9c('0x11')]('/',auth[_0xcb9c('0xa')](),controller[_0xcb9c('0x12')]);router[_0xcb9c('0x13')](_0xcb9c('0xc'),auth[_0xcb9c('0xa')](),controller[_0xcb9c('0x14')]);router[_0xcb9c('0x15')](_0xcb9c('0xc'),auth[_0xcb9c('0xa')](),controller['destroy']);module[_0xcb9c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 4473304..fb62954 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 _0xc046=['sequelize','exports','STRING'];(function(_0x2ada6a,_0x49cece){var _0x42b8fa=function(_0x503f4f){while(--_0x503f4f){_0x2ada6a['push'](_0x2ada6a['shift']());}};_0x42b8fa(++_0x49cece);}(_0xc046,0x1e9));var _0x6c04=function(_0x150491,_0x40ff70){_0x150491=_0x150491-0x0;var _0x2ecefe=_0xc046[_0x150491];return _0x2ecefe;};'use strict';var Sequelize=require(_0x6c04('0x0'));module[_0x6c04('0x1')]={'name':{'type':Sequelize[_0x6c04('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb447=['exports','STRING','sequelize'];(function(_0x562faf,_0x102bcc){var _0x22c1f6=function(_0x2cd3b8){while(--_0x2cd3b8){_0x562faf['push'](_0x562faf['shift']());}};_0x22c1f6(++_0x102bcc);}(_0xb447,0x1a6));var _0x7b44=function(_0x590800,_0x2edaa4){_0x590800=_0x590800-0x0;var _0x386dd9=_0xb447[_0x590800];return _0x386dd9;};'use strict';var Sequelize=require(_0x7b44('0x0'));module[_0x7b44('0x1')]={'name':{'type':Sequelize[_0x7b44('0x2')]},'description':{'type':Sequelize[_0x7b44('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index db7d736..a3d855e 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 _0xe09f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','params','ServicenowConfiguration','includeAll','find','create','body','getFields','ServicenowField','filter','hasOwnProperty','findOne','order','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xbedbaa,_0x39d1e5){var _0x3eb1a2=function(_0xe3e1fb){while(--_0xe3e1fb){_0xbedbaa['push'](_0xbedbaa['shift']());}};_0x3eb1a2(++_0x39d1e5);}(_0xe09f,0x129));var _0xfe09=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe09f[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xfe09('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfe09('0x1'));var rp=require(_0xfe09('0x2'));var moment=require(_0xfe09('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfe09('0x4'));var util=require('util');var path=require(_0xfe09('0x5'));var sox=require(_0xfe09('0x6'));var csv=require(_0xfe09('0x7'));var ejs=require(_0xfe09('0x8'));var fs=require('fs');var fs_extra=require(_0xfe09('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfe09('0xa'));var jsforce=require(_0xfe09('0xb'));var deskjs=require(_0xfe09('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfe09('0xd'));var Papa=require(_0xfe09('0xe'));var Redis=require('ioredis');var authService=require(_0xfe09('0xf'));var qs=require(_0xfe09('0x10'));var as=require(_0xfe09('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe09('0x12'))(_0xfe09('0x13'));var utils=require('../../config/utils');var config=require(_0xfe09('0x14'));var licenseUtil=require(_0xfe09('0x15'));var db=require(_0xfe09('0x16'))['db'];function respondWithStatusCode(_0x586d7a,_0x319598){_0x319598=_0x319598||0xcc;return function(_0x36df30){if(_0x36df30){return _0x586d7a[_0xfe09('0x17')](_0x319598);}return _0x586d7a[_0xfe09('0x18')](_0x319598)['end']();};}function respondWithResult(_0x3c4b1b,_0x187a03){_0x187a03=_0x187a03||0xc8;return function(_0x5e1792){if(_0x5e1792){return _0x3c4b1b[_0xfe09('0x18')](_0x187a03)[_0xfe09('0x19')](_0x5e1792);}};}function respondWithFilteredResult(_0x483769,_0x469f4f){return function(_0x1c9dc2){if(_0x1c9dc2){var _0x9e3f62=typeof _0x469f4f[_0xfe09('0x1a')]===_0xfe09('0x1b')&&typeof _0x469f4f['limit']===_0xfe09('0x1b');var _0x94ee65=_0x1c9dc2['count'];var _0x443a79=_0x9e3f62?0x0:_0x469f4f[_0xfe09('0x1a')];var _0x2c8047=_0x9e3f62?_0x1c9dc2[_0xfe09('0x1c')]:_0x469f4f[_0xfe09('0x1a')]+_0x469f4f[_0xfe09('0x1d')];var _0x562676;if(_0x2c8047>=_0x94ee65){_0x2c8047=_0x94ee65;_0x562676=0xc8;}else{_0x562676=0xce;}_0x483769[_0xfe09('0x18')](_0x562676);return _0x483769[_0xfe09('0x1e')](_0xfe09('0x1f'),_0x443a79+'-'+_0x2c8047+'/'+_0x94ee65)[_0xfe09('0x19')](_0x1c9dc2);}return null;};}function patchUpdates(_0x289599){return function(_0x1c1746){try{jsonpatch[_0xfe09('0x20')](_0x1c1746,_0x289599,!![]);}catch(_0x3ef1c4){return BPromise['reject'](_0x3ef1c4);}return _0x1c1746[_0xfe09('0x21')]();};}function saveUpdates(_0x3bc115,_0x1246f7){return function(_0x783331){if(_0x783331){return _0x783331[_0xfe09('0x22')](_0x3bc115)[_0xfe09('0x23')](function(_0x516c27){return _0x516c27;});}return null;};}function removeEntity(_0x29d684,_0x2cd205){return function(_0x2de70c){if(_0x2de70c){return _0x2de70c['destroy']()['then'](function(){_0x29d684[_0xfe09('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b14b8,_0x123ecb){return function(_0x175071){if(!_0x175071){_0x3b14b8[_0xfe09('0x17')](0x194);}return _0x175071;};}function handleError(_0x7157e,_0x5e04dd){_0x5e04dd=_0x5e04dd||0x1f4;return function(_0x296056){logger[_0xfe09('0x24')](_0x296056[_0xfe09('0x25')]);if(_0x296056['name']){delete _0x296056[_0xfe09('0x26')];}_0x7157e[_0xfe09('0x18')](_0x5e04dd)[_0xfe09('0x27')](_0x296056);};}exports['index']=function(_0x39dcc3,_0xa46a0e){var _0x669fd={},_0x2f9278={},_0x4528a8={'count':0x0,'rows':[]};var _0x31d86e=_[_0xfe09('0x28')](db['ServicenowConfiguration'][_0xfe09('0x29')],function(_0x4d54fe){return{'name':_0x4d54fe[_0xfe09('0x2a')],'type':_0x4d54fe[_0xfe09('0x2b')][_0xfe09('0x2c')]};});_0x2f9278[_0xfe09('0x2d')]=_['map'](_0x31d86e,'name');_0x2f9278[_0xfe09('0x2e')]=_[_0xfe09('0x2f')](_0x39dcc3[_0xfe09('0x2e')]);_0x2f9278[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x2f9278[_0xfe09('0x2d')],_0x2f9278[_0xfe09('0x2e')]);_0x669fd['attributes']=_['intersection'](_0x2f9278[_0xfe09('0x2d')],qs['fields'](_0x39dcc3[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x669fd[_0xfe09('0x33')]=_0x669fd[_0xfe09('0x33')][_0xfe09('0x34')]?_0x669fd[_0xfe09('0x33')]:_0x2f9278[_0xfe09('0x2d')];if(!_0x39dcc3[_0xfe09('0x2e')]['hasOwnProperty'](_0xfe09('0x35'))){_0x669fd[_0xfe09('0x1d')]=qs['limit'](_0x39dcc3['query']['limit']);_0x669fd[_0xfe09('0x1a')]=qs['offset'](_0x39dcc3[_0xfe09('0x2e')][_0xfe09('0x1a')]);}_0x669fd['order']=qs['sort'](_0x39dcc3['query'][_0xfe09('0x36')]);_0x669fd[_0xfe09('0x37')]=qs['filters'](_[_0xfe09('0x38')](_0x39dcc3['query'],_0x2f9278['filters']),_0x31d86e);if(_0x39dcc3['query']['filter']){_0x669fd['where']=_['merge'](_0x669fd['where'],{'$or':_[_0xfe09('0x28')](_0x31d86e,function(_0x453ed5){if(_0x453ed5[_0xfe09('0x2b')]!==_0xfe09('0x39')){var _0x51cf65={};_0x51cf65[_0x453ed5[_0xfe09('0x26')]]={'$like':'%'+_0x39dcc3[_0xfe09('0x2e')]['filter']+'%'};return _0x51cf65;}})});}_0x669fd=_[_0xfe09('0x3a')]({},_0x669fd,_0x39dcc3[_0xfe09('0x3b')]);var _0x3501a1={'where':_0x669fd[_0xfe09('0x37')]};return db['ServicenowConfiguration'][_0xfe09('0x1c')](_0x3501a1)[_0xfe09('0x23')](function(_0x2ab79e){_0x4528a8[_0xfe09('0x1c')]=_0x2ab79e;if(_0x39dcc3[_0xfe09('0x2e')]['includeAll']){_0x669fd[_0xfe09('0x3c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xfe09('0x3d')](_0x669fd);})['then'](function(_0x4d4ff3){_0x4528a8[_0xfe09('0x3e')]=_0x4d4ff3;return _0x4528a8;})[_0xfe09('0x23')](respondWithFilteredResult(_0xa46a0e,_0x669fd))[_0xfe09('0x3f')](handleError(_0xa46a0e,null));};exports['show']=function(_0x1fca86,_0x20bbaa){var _0x5f5bea={'raw':![],'where':{'id':_0x1fca86[_0xfe09('0x40')]['id']}},_0x565b7d={};_0x565b7d['model']=_[_0xfe09('0x2f')](db[_0xfe09('0x41')]['rawAttributes']);_0x565b7d[_0xfe09('0x2e')]=_['keys'](_0x1fca86[_0xfe09('0x2e')]);_0x565b7d[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x565b7d['model'],_0x565b7d[_0xfe09('0x2e')]);_0x5f5bea[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x565b7d['model'],qs[_0xfe09('0x32')](_0x1fca86[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x5f5bea[_0xfe09('0x33')]=_0x5f5bea['attributes']['length']?_0x5f5bea[_0xfe09('0x33')]:_0x565b7d[_0xfe09('0x2d')];if(_0x1fca86[_0xfe09('0x2e')][_0xfe09('0x42')]){_0x5f5bea[_0xfe09('0x3c')]=[{'all':!![]}];}_0x5f5bea=_[_0xfe09('0x3a')]({},_0x5f5bea,_0x1fca86[_0xfe09('0x3b')]);return db['ServicenowConfiguration'][_0xfe09('0x43')](_0x5f5bea)['then'](handleEntityNotFound(_0x20bbaa,null))[_0xfe09('0x23')](respondWithResult(_0x20bbaa,null))[_0xfe09('0x3f')](handleError(_0x20bbaa,null));};exports[_0xfe09('0x44')]=function(_0x48eed0,_0x46ca76){return db['ServicenowConfiguration'][_0xfe09('0x44')](_0x48eed0[_0xfe09('0x45')],{})[_0xfe09('0x23')](respondWithResult(_0x46ca76,0xc9))['catch'](handleError(_0x46ca76,null));};exports[_0xfe09('0x22')]=function(_0x31e390,_0x5099e5){if(_0x31e390[_0xfe09('0x45')]['id']){delete _0x31e390[_0xfe09('0x45')]['id'];}return db[_0xfe09('0x41')][_0xfe09('0x43')]({'where':{'id':_0x31e390[_0xfe09('0x40')]['id']}})[_0xfe09('0x23')](handleEntityNotFound(_0x5099e5,null))['then'](saveUpdates(_0x31e390[_0xfe09('0x45')],null))[_0xfe09('0x23')](respondWithResult(_0x5099e5,null))[_0xfe09('0x3f')](handleError(_0x5099e5,null));};exports['destroy']=function(_0x3f296a,_0x1c8633){return db[_0xfe09('0x41')][_0xfe09('0x43')]({'where':{'id':_0x3f296a['params']['id']}})['then'](handleEntityNotFound(_0x1c8633,null))['then'](removeEntity(_0x1c8633,null))[_0xfe09('0x3f')](handleError(_0x1c8633,null));};exports[_0xfe09('0x46')]=function(_0x1e769d,_0x45ce40,_0x3119b5){var _0x3c9a2f={};var _0x1423ec={};var _0x321b91;var _0x416ab1;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1e769d['params']['id']}})['then'](handleEntityNotFound(_0x45ce40,null))[_0xfe09('0x23')](function(_0x362f2b){if(_0x362f2b){_0x321b91=_0x362f2b;_0x1423ec[_0xfe09('0x2d')]=_[_0xfe09('0x2f')](db[_0xfe09('0x47')][_0xfe09('0x29')]);_0x1423ec['query']=_['keys'](_0x1e769d[_0xfe09('0x2e')]);_0x1423ec[_0xfe09('0x30')]=_['intersection'](_0x1423ec[_0xfe09('0x2d')],_0x1423ec[_0xfe09('0x2e')]);_0x3c9a2f[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x1423ec['model'],qs[_0xfe09('0x32')](_0x1e769d[_0xfe09('0x2e')]['fields']));_0x3c9a2f['attributes']=_0x3c9a2f['attributes'][_0xfe09('0x34')]?_0x3c9a2f['attributes']:_0x1423ec[_0xfe09('0x2d')];_0x3c9a2f['order']=qs[_0xfe09('0x36')](_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x36')]);_0x3c9a2f[_0xfe09('0x37')]=qs[_0xfe09('0x30')](_[_0xfe09('0x38')](_0x1e769d[_0xfe09('0x2e')],_0x1423ec[_0xfe09('0x30')]));if(_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x48')]){_0x3c9a2f[_0xfe09('0x37')]=_[_0xfe09('0x3a')](_0x3c9a2f[_0xfe09('0x37')],{'$or':_[_0xfe09('0x28')](_0x3c9a2f[_0xfe09('0x33')],function(_0x3538b5){var _0x5c971b={};_0x5c971b[_0x3538b5]={'$like':'%'+_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x48')]+'%'};return _0x5c971b;})});}_0x3c9a2f=_[_0xfe09('0x3a')]({},_0x3c9a2f,_0x1e769d['options']);return _0x321b91[_0xfe09('0x46')](_0x3c9a2f);}})[_0xfe09('0x23')](function(_0x49850c){if(_0x49850c){_0x416ab1=_0x49850c['length'];if(!_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x49')]('nolimit')){_0x3c9a2f[_0xfe09('0x1d')]=qs[_0xfe09('0x1d')](_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x1d')]);_0x3c9a2f[_0xfe09('0x1a')]=qs[_0xfe09('0x1a')](_0x1e769d[_0xfe09('0x2e')][_0xfe09('0x1a')]);}return _0x321b91[_0xfe09('0x46')](_0x3c9a2f);}})[_0xfe09('0x23')](function(_0x275b87){if(_0x275b87){return _0x275b87?{'count':_0x416ab1,'rows':_0x275b87}:null;}})[_0xfe09('0x23')](respondWithResult(_0x45ce40,null))[_0xfe09('0x3f')](handleError(_0x45ce40,null));};exports['getSubjects']=function(_0x58eeca,_0xabbc41,_0x558962){var _0x2e1a6e={};var _0x14e54c={};var _0x227a1f;var _0x5c1b85;return db[_0xfe09('0x41')][_0xfe09('0x4a')]({'where':{'id':_0x58eeca[_0xfe09('0x40')]['id']}})[_0xfe09('0x23')](handleEntityNotFound(_0xabbc41,null))[_0xfe09('0x23')](function(_0x59677d){if(_0x59677d){_0x227a1f=_0x59677d;_0x14e54c[_0xfe09('0x2d')]=_[_0xfe09('0x2f')](db[_0xfe09('0x47')][_0xfe09('0x29')]);_0x14e54c['query']=_[_0xfe09('0x2f')](_0x58eeca[_0xfe09('0x2e')]);_0x14e54c[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x14e54c[_0xfe09('0x2d')],_0x14e54c[_0xfe09('0x2e')]);_0x2e1a6e[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x14e54c[_0xfe09('0x2d')],qs['fields'](_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x2e1a6e[_0xfe09('0x33')]=_0x2e1a6e[_0xfe09('0x33')][_0xfe09('0x34')]?_0x2e1a6e['attributes']:_0x14e54c[_0xfe09('0x2d')];_0x2e1a6e[_0xfe09('0x4b')]=qs['sort'](_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x36')]);_0x2e1a6e['where']=qs['filters'](_['pick'](_0x58eeca[_0xfe09('0x2e')],_0x14e54c[_0xfe09('0x30')]));if(_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x48')]){_0x2e1a6e[_0xfe09('0x37')]=_[_0xfe09('0x3a')](_0x2e1a6e['where'],{'$or':_[_0xfe09('0x28')](_0x2e1a6e['attributes'],function(_0x1ce156){var _0x28969b={};_0x28969b[_0x1ce156]={'$like':'%'+_0x58eeca['query']['filter']+'%'};return _0x28969b;})});}_0x2e1a6e=_[_0xfe09('0x3a')]({},_0x2e1a6e,_0x58eeca[_0xfe09('0x3b')]);return _0x227a1f[_0xfe09('0x4c')](_0x2e1a6e);}})[_0xfe09('0x23')](function(_0x175cc0){if(_0x175cc0){_0x5c1b85=_0x175cc0[_0xfe09('0x34')];if(!_0x58eeca[_0xfe09('0x2e')]['hasOwnProperty'](_0xfe09('0x35'))){_0x2e1a6e[_0xfe09('0x1d')]=qs[_0xfe09('0x1d')](_0x58eeca[_0xfe09('0x2e')]['limit']);_0x2e1a6e[_0xfe09('0x1a')]=qs[_0xfe09('0x1a')](_0x58eeca[_0xfe09('0x2e')][_0xfe09('0x1a')]);}return _0x227a1f[_0xfe09('0x4c')](_0x2e1a6e);}})[_0xfe09('0x23')](function(_0x7d4bef){if(_0x7d4bef){return _0x7d4bef?{'count':_0x5c1b85,'rows':_0x7d4bef}:null;}})[_0xfe09('0x23')](respondWithResult(_0xabbc41,null))['catch'](handleError(_0xabbc41,null));};exports[_0xfe09('0x4d')]=function(_0xb631dc,_0x527023,_0xed67f2){var _0x13d53e={};var _0x102dc3={};var _0x1917a5;var _0x3b4256;return db[_0xfe09('0x41')][_0xfe09('0x4a')]({'where':{'id':_0xb631dc['params']['id']}})['then'](handleEntityNotFound(_0x527023,null))[_0xfe09('0x23')](function(_0x1b09a2){if(_0x1b09a2){_0x1917a5=_0x1b09a2;_0x102dc3['model']=_[_0xfe09('0x2f')](db[_0xfe09('0x47')]['rawAttributes']);_0x102dc3[_0xfe09('0x2e')]=_[_0xfe09('0x2f')](_0xb631dc[_0xfe09('0x2e')]);_0x102dc3[_0xfe09('0x30')]=_[_0xfe09('0x31')](_0x102dc3[_0xfe09('0x2d')],_0x102dc3['query']);_0x13d53e[_0xfe09('0x33')]=_[_0xfe09('0x31')](_0x102dc3[_0xfe09('0x2d')],qs[_0xfe09('0x32')](_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x32')]));_0x13d53e[_0xfe09('0x33')]=_0x13d53e['attributes'][_0xfe09('0x34')]?_0x13d53e[_0xfe09('0x33')]:_0x102dc3['model'];_0x13d53e[_0xfe09('0x4b')]=qs[_0xfe09('0x36')](_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x36')]);_0x13d53e[_0xfe09('0x37')]=qs[_0xfe09('0x30')](_[_0xfe09('0x38')](_0xb631dc[_0xfe09('0x2e')],_0x102dc3[_0xfe09('0x30')]));if(_0xb631dc['query'][_0xfe09('0x48')]){_0x13d53e[_0xfe09('0x37')]=_[_0xfe09('0x3a')](_0x13d53e['where'],{'$or':_[_0xfe09('0x28')](_0x13d53e[_0xfe09('0x33')],function(_0x436dab){var _0x1c7db4={};_0x1c7db4[_0x436dab]={'$like':'%'+_0xb631dc['query'][_0xfe09('0x48')]+'%'};return _0x1c7db4;})});}_0x13d53e=_['merge']({},_0x13d53e,_0xb631dc[_0xfe09('0x3b')]);return _0x1917a5[_0xfe09('0x4d')](_0x13d53e);}})[_0xfe09('0x23')](function(_0xa0943c){if(_0xa0943c){_0x3b4256=_0xa0943c[_0xfe09('0x34')];if(!_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x49')](_0xfe09('0x35'))){_0x13d53e[_0xfe09('0x1d')]=qs[_0xfe09('0x1d')](_0xb631dc[_0xfe09('0x2e')][_0xfe09('0x1d')]);_0x13d53e[_0xfe09('0x1a')]=qs[_0xfe09('0x1a')](_0xb631dc['query'][_0xfe09('0x1a')]);}return _0x1917a5[_0xfe09('0x4d')](_0x13d53e);}})[_0xfe09('0x23')](function(_0x3d5c3e){if(_0x3d5c3e){return _0x3d5c3e?{'count':_0x3b4256,'rows':_0x3d5c3e}:null;}})['then'](respondWithResult(_0x527023,null))['catch'](handleError(_0x527023,null));}; \ No newline at end of file +var _0xf453=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','limit','set','json','reject','save','update','then','end','sendStatus','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','sort','filters','filter','where','merge','type','VIRTUAL','options','count','findAll','rows','catch','params','include','create','body','find','destroy','getFields','pick','nolimit','getSubjects','ServicenowField','getDescriptions','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xf453,0xda));var _0x3f45=function(_0x27f973,_0x58596f){_0x27f973=_0x27f973-0x0;var _0x255e5d=_0xf453[_0x27f973];return _0x255e5d;};'use strict';var emlformat=require(_0x3f45('0x0'));var rimraf=require(_0x3f45('0x1'));var zipdir=require(_0x3f45('0x2'));var jsonpatch=require(_0x3f45('0x3'));var rp=require(_0x3f45('0x4'));var moment=require(_0x3f45('0x5'));var BPromise=require(_0x3f45('0x6'));var Mustache=require(_0x3f45('0x7'));var util=require('util');var path=require(_0x3f45('0x8'));var sox=require(_0x3f45('0x9'));var csv=require(_0x3f45('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f45('0xb'));var _=require('lodash');var squel=require(_0x3f45('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f45('0xd'));var deskjs=require(_0x3f45('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f45('0xf'));var Redis=require(_0x3f45('0x10'));var authService=require(_0x3f45('0x11'));var qs=require(_0x3f45('0x12'));var as=require(_0x3f45('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3f45('0x14'));var utils=require(_0x3f45('0x15'));var config=require(_0x3f45('0x16'));var licenseUtil=require(_0x3f45('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18296b,_0x57172b){_0x57172b=_0x57172b||0xcc;return function(_0x1e15d4){if(_0x1e15d4){return _0x18296b['sendStatus'](_0x57172b);}return _0x18296b[_0x3f45('0x18')](_0x57172b)['end']();};}function respondWithResult(_0x5e9151,_0x405ecd){_0x405ecd=_0x405ecd||0xc8;return function(_0x3634fd){if(_0x3634fd){return _0x5e9151[_0x3f45('0x18')](_0x405ecd)['json'](_0x3634fd);}};}function respondWithFilteredResult(_0x571ff2,_0x2e8d28){return function(_0x42e823){if(_0x42e823){var _0x3fe138=typeof _0x2e8d28[_0x3f45('0x19')]==='undefined'&&typeof _0x2e8d28['limit']==='undefined';var _0x32c3d2=_0x42e823['count'];var _0x17e978=_0x3fe138?0x0:_0x2e8d28[_0x3f45('0x19')];var _0x24521b=_0x3fe138?_0x42e823['count']:_0x2e8d28[_0x3f45('0x19')]+_0x2e8d28[_0x3f45('0x1a')];var _0x88b366;if(_0x24521b>=_0x32c3d2){_0x24521b=_0x32c3d2;_0x88b366=0xc8;}else{_0x88b366=0xce;}_0x571ff2[_0x3f45('0x18')](_0x88b366);return _0x571ff2[_0x3f45('0x1b')]('Content-Range',_0x17e978+'-'+_0x24521b+'/'+_0x32c3d2)[_0x3f45('0x1c')](_0x42e823);}return null;};}function patchUpdates(_0x265705){return function(_0x563864){try{jsonpatch['apply'](_0x563864,_0x265705,!![]);}catch(_0x388164){return BPromise[_0x3f45('0x1d')](_0x388164);}return _0x563864[_0x3f45('0x1e')]();};}function saveUpdates(_0x213d23,_0x3b5255){return function(_0x495714){if(_0x495714){return _0x495714[_0x3f45('0x1f')](_0x213d23)[_0x3f45('0x20')](function(_0x199c2a){return _0x199c2a;});}return null;};}function removeEntity(_0x1c6585,_0x1cef58){return function(_0x11a4b1){if(_0x11a4b1){return _0x11a4b1['destroy']()['then'](function(){_0x1c6585[_0x3f45('0x18')](0xcc)[_0x3f45('0x21')]();});}};}function handleEntityNotFound(_0x56031e,_0x4e410f){return function(_0x319fd7){if(!_0x319fd7){_0x56031e[_0x3f45('0x22')](0x194);}return _0x319fd7;};}function handleError(_0x4481f3,_0x3d77a3){_0x3d77a3=_0x3d77a3||0x1f4;return function(_0x35fd99){logger[_0x3f45('0x23')](_0x35fd99[_0x3f45('0x24')]);if(_0x35fd99[_0x3f45('0x25')]){delete _0x35fd99[_0x3f45('0x25')];}_0x4481f3['status'](_0x3d77a3)[_0x3f45('0x26')](_0x35fd99);};}exports[_0x3f45('0x27')]=function(_0x31295a,_0x35dc4b){var _0x473b07={},_0x58a435={},_0x3664b8={'count':0x0,'rows':[]};var _0x2ee80f=_['map'](db[_0x3f45('0x28')][_0x3f45('0x29')],function(_0x3ad446){return{'name':_0x3ad446[_0x3f45('0x2a')],'type':_0x3ad446['type'][_0x3f45('0x2b')]};});_0x58a435['model']=_[_0x3f45('0x2c')](_0x2ee80f,_0x3f45('0x25'));_0x58a435[_0x3f45('0x2d')]=_[_0x3f45('0x2e')](_0x31295a[_0x3f45('0x2d')]);_0x58a435['filters']=_[_0x3f45('0x2f')](_0x58a435[_0x3f45('0x30')],_0x58a435[_0x3f45('0x2d')]);_0x473b07['attributes']=_['intersection'](_0x58a435[_0x3f45('0x30')],qs[_0x3f45('0x31')](_0x31295a[_0x3f45('0x2d')][_0x3f45('0x31')]));_0x473b07[_0x3f45('0x32')]=_0x473b07[_0x3f45('0x32')][_0x3f45('0x33')]?_0x473b07[_0x3f45('0x32')]:_0x58a435[_0x3f45('0x30')];if(!_0x31295a[_0x3f45('0x2d')][_0x3f45('0x34')]('nolimit')){_0x473b07[_0x3f45('0x1a')]=qs['limit'](_0x31295a['query'][_0x3f45('0x1a')]);_0x473b07[_0x3f45('0x19')]=qs['offset'](_0x31295a[_0x3f45('0x2d')][_0x3f45('0x19')]);}_0x473b07['order']=qs[_0x3f45('0x35')](_0x31295a['query'][_0x3f45('0x35')]);_0x473b07['where']=qs[_0x3f45('0x36')](_['pick'](_0x31295a[_0x3f45('0x2d')],_0x58a435[_0x3f45('0x36')]),_0x2ee80f);if(_0x31295a[_0x3f45('0x2d')][_0x3f45('0x37')]){_0x473b07[_0x3f45('0x38')]=_[_0x3f45('0x39')](_0x473b07[_0x3f45('0x38')],{'$or':_[_0x3f45('0x2c')](_0x2ee80f,function(_0x503068){if(_0x503068[_0x3f45('0x3a')]!==_0x3f45('0x3b')){var _0x268d32={};_0x268d32[_0x503068[_0x3f45('0x25')]]={'$like':'%'+_0x31295a[_0x3f45('0x2d')][_0x3f45('0x37')]+'%'};return _0x268d32;}})});}_0x473b07=_['merge']({},_0x473b07,_0x31295a[_0x3f45('0x3c')]);var _0x4efd4d={'where':_0x473b07['where']};return db[_0x3f45('0x28')][_0x3f45('0x3d')](_0x4efd4d)[_0x3f45('0x20')](function(_0xa3b854){_0x3664b8[_0x3f45('0x3d')]=_0xa3b854;if(_0x31295a[_0x3f45('0x2d')]['includeAll']){_0x473b07['include']=[{'all':!![]}];}return db[_0x3f45('0x28')][_0x3f45('0x3e')](_0x473b07);})[_0x3f45('0x20')](function(_0x543bd7){_0x3664b8[_0x3f45('0x3f')]=_0x543bd7;return _0x3664b8;})[_0x3f45('0x20')](respondWithFilteredResult(_0x35dc4b,_0x473b07))[_0x3f45('0x40')](handleError(_0x35dc4b,null));};exports['show']=function(_0x38bf88,_0x1679d0){var _0x46aea0={'raw':![],'where':{'id':_0x38bf88[_0x3f45('0x41')]['id']}},_0x314a64={};_0x314a64['model']=_['keys'](db['ServicenowConfiguration'][_0x3f45('0x29')]);_0x314a64[_0x3f45('0x2d')]=_[_0x3f45('0x2e')](_0x38bf88[_0x3f45('0x2d')]);_0x314a64[_0x3f45('0x36')]=_[_0x3f45('0x2f')](_0x314a64[_0x3f45('0x30')],_0x314a64['query']);_0x46aea0['attributes']=_[_0x3f45('0x2f')](_0x314a64[_0x3f45('0x30')],qs[_0x3f45('0x31')](_0x38bf88['query'][_0x3f45('0x31')]));_0x46aea0[_0x3f45('0x32')]=_0x46aea0[_0x3f45('0x32')][_0x3f45('0x33')]?_0x46aea0['attributes']:_0x314a64['model'];if(_0x38bf88[_0x3f45('0x2d')]['includeAll']){_0x46aea0[_0x3f45('0x42')]=[{'all':!![]}];}_0x46aea0=_[_0x3f45('0x39')]({},_0x46aea0,_0x38bf88[_0x3f45('0x3c')]);return db[_0x3f45('0x28')]['find'](_0x46aea0)[_0x3f45('0x20')](handleEntityNotFound(_0x1679d0,null))[_0x3f45('0x20')](respondWithResult(_0x1679d0,null))[_0x3f45('0x40')](handleError(_0x1679d0,null));};exports[_0x3f45('0x43')]=function(_0x5cbac8,_0x1874fd){return db[_0x3f45('0x28')][_0x3f45('0x43')](_0x5cbac8['body'],{})[_0x3f45('0x20')](respondWithResult(_0x1874fd,0xc9))[_0x3f45('0x40')](handleError(_0x1874fd,null));};exports[_0x3f45('0x1f')]=function(_0x17b426,_0x2eae52){if(_0x17b426[_0x3f45('0x44')]['id']){delete _0x17b426[_0x3f45('0x44')]['id'];}return db[_0x3f45('0x28')][_0x3f45('0x45')]({'where':{'id':_0x17b426['params']['id']}})['then'](handleEntityNotFound(_0x2eae52,null))['then'](saveUpdates(_0x17b426[_0x3f45('0x44')],null))[_0x3f45('0x20')](respondWithResult(_0x2eae52,null))[_0x3f45('0x40')](handleError(_0x2eae52,null));};exports[_0x3f45('0x46')]=function(_0x36ccfe,_0x56ddb8){return db[_0x3f45('0x28')][_0x3f45('0x45')]({'where':{'id':_0x36ccfe['params']['id']}})['then'](handleEntityNotFound(_0x56ddb8,null))[_0x3f45('0x20')](removeEntity(_0x56ddb8,null))[_0x3f45('0x40')](handleError(_0x56ddb8,null));};exports[_0x3f45('0x47')]=function(_0x3b9c6c,_0x1d2b68,_0x44f16a){var _0x4f6574={};var _0x5494c4={};var _0x15a154;var _0x38c497;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3b9c6c['params']['id']}})[_0x3f45('0x20')](handleEntityNotFound(_0x1d2b68,null))[_0x3f45('0x20')](function(_0x29cc53){if(_0x29cc53){_0x15a154=_0x29cc53;_0x5494c4['model']=_['keys'](db['ServicenowField'][_0x3f45('0x29')]);_0x5494c4[_0x3f45('0x2d')]=_[_0x3f45('0x2e')](_0x3b9c6c[_0x3f45('0x2d')]);_0x5494c4['filters']=_['intersection'](_0x5494c4['model'],_0x5494c4[_0x3f45('0x2d')]);_0x4f6574[_0x3f45('0x32')]=_[_0x3f45('0x2f')](_0x5494c4[_0x3f45('0x30')],qs[_0x3f45('0x31')](_0x3b9c6c[_0x3f45('0x2d')]['fields']));_0x4f6574[_0x3f45('0x32')]=_0x4f6574[_0x3f45('0x32')][_0x3f45('0x33')]?_0x4f6574['attributes']:_0x5494c4[_0x3f45('0x30')];_0x4f6574['order']=qs[_0x3f45('0x35')](_0x3b9c6c[_0x3f45('0x2d')][_0x3f45('0x35')]);_0x4f6574['where']=qs['filters'](_[_0x3f45('0x48')](_0x3b9c6c[_0x3f45('0x2d')],_0x5494c4[_0x3f45('0x36')]));if(_0x3b9c6c[_0x3f45('0x2d')][_0x3f45('0x37')]){_0x4f6574['where']=_[_0x3f45('0x39')](_0x4f6574[_0x3f45('0x38')],{'$or':_[_0x3f45('0x2c')](_0x4f6574['attributes'],function(_0x5cf974){var _0x2e77f2={};_0x2e77f2[_0x5cf974]={'$like':'%'+_0x3b9c6c[_0x3f45('0x2d')][_0x3f45('0x37')]+'%'};return _0x2e77f2;})});}_0x4f6574=_['merge']({},_0x4f6574,_0x3b9c6c[_0x3f45('0x3c')]);return _0x15a154[_0x3f45('0x47')](_0x4f6574);}})[_0x3f45('0x20')](function(_0x2698ed){if(_0x2698ed){_0x38c497=_0x2698ed[_0x3f45('0x33')];if(!_0x3b9c6c[_0x3f45('0x2d')][_0x3f45('0x34')](_0x3f45('0x49'))){_0x4f6574['limit']=qs[_0x3f45('0x1a')](_0x3b9c6c['query']['limit']);_0x4f6574['offset']=qs['offset'](_0x3b9c6c[_0x3f45('0x2d')]['offset']);}return _0x15a154[_0x3f45('0x47')](_0x4f6574);}})[_0x3f45('0x20')](function(_0x488bc4){if(_0x488bc4){return _0x488bc4?{'count':_0x38c497,'rows':_0x488bc4}:null;}})[_0x3f45('0x20')](respondWithResult(_0x1d2b68,null))[_0x3f45('0x40')](handleError(_0x1d2b68,null));};exports[_0x3f45('0x4a')]=function(_0x7877b4,_0x320d77,_0x2b2b11){var _0x359693={};var _0xd865a8={};var _0x4158e9;var _0x333245;return db[_0x3f45('0x28')]['findOne']({'where':{'id':_0x7877b4[_0x3f45('0x41')]['id']}})[_0x3f45('0x20')](handleEntityNotFound(_0x320d77,null))[_0x3f45('0x20')](function(_0x3c0043){if(_0x3c0043){_0x4158e9=_0x3c0043;_0xd865a8[_0x3f45('0x30')]=_[_0x3f45('0x2e')](db[_0x3f45('0x4b')][_0x3f45('0x29')]);_0xd865a8[_0x3f45('0x2d')]=_['keys'](_0x7877b4[_0x3f45('0x2d')]);_0xd865a8[_0x3f45('0x36')]=_[_0x3f45('0x2f')](_0xd865a8['model'],_0xd865a8[_0x3f45('0x2d')]);_0x359693[_0x3f45('0x32')]=_[_0x3f45('0x2f')](_0xd865a8['model'],qs['fields'](_0x7877b4['query'][_0x3f45('0x31')]));_0x359693[_0x3f45('0x32')]=_0x359693[_0x3f45('0x32')][_0x3f45('0x33')]?_0x359693[_0x3f45('0x32')]:_0xd865a8[_0x3f45('0x30')];_0x359693['order']=qs[_0x3f45('0x35')](_0x7877b4[_0x3f45('0x2d')][_0x3f45('0x35')]);_0x359693['where']=qs[_0x3f45('0x36')](_[_0x3f45('0x48')](_0x7877b4[_0x3f45('0x2d')],_0xd865a8[_0x3f45('0x36')]));if(_0x7877b4['query'][_0x3f45('0x37')]){_0x359693['where']=_['merge'](_0x359693[_0x3f45('0x38')],{'$or':_[_0x3f45('0x2c')](_0x359693[_0x3f45('0x32')],function(_0x531541){var _0x5965ca={};_0x5965ca[_0x531541]={'$like':'%'+_0x7877b4[_0x3f45('0x2d')][_0x3f45('0x37')]+'%'};return _0x5965ca;})});}_0x359693=_[_0x3f45('0x39')]({},_0x359693,_0x7877b4[_0x3f45('0x3c')]);return _0x4158e9[_0x3f45('0x4a')](_0x359693);}})[_0x3f45('0x20')](function(_0x5d6f1a){if(_0x5d6f1a){_0x333245=_0x5d6f1a[_0x3f45('0x33')];if(!_0x7877b4[_0x3f45('0x2d')]['hasOwnProperty'](_0x3f45('0x49'))){_0x359693[_0x3f45('0x1a')]=qs['limit'](_0x7877b4['query'][_0x3f45('0x1a')]);_0x359693['offset']=qs[_0x3f45('0x19')](_0x7877b4[_0x3f45('0x2d')][_0x3f45('0x19')]);}return _0x4158e9[_0x3f45('0x4a')](_0x359693);}})['then'](function(_0x57d14a){if(_0x57d14a){return _0x57d14a?{'count':_0x333245,'rows':_0x57d14a}:null;}})[_0x3f45('0x20')](respondWithResult(_0x320d77,null))[_0x3f45('0x40')](handleError(_0x320d77,null));};exports[_0x3f45('0x4c')]=function(_0x2cb15e,_0x270dd2,_0x3236e4){var _0x5713d8={};var _0x581344={};var _0x5b4400;var _0x34e169;return db['ServicenowConfiguration'][_0x3f45('0x4d')]({'where':{'id':_0x2cb15e['params']['id']}})['then'](handleEntityNotFound(_0x270dd2,null))[_0x3f45('0x20')](function(_0x29b6b8){if(_0x29b6b8){_0x5b4400=_0x29b6b8;_0x581344[_0x3f45('0x30')]=_['keys'](db[_0x3f45('0x4b')][_0x3f45('0x29')]);_0x581344[_0x3f45('0x2d')]=_['keys'](_0x2cb15e['query']);_0x581344['filters']=_[_0x3f45('0x2f')](_0x581344[_0x3f45('0x30')],_0x581344[_0x3f45('0x2d')]);_0x5713d8[_0x3f45('0x32')]=_[_0x3f45('0x2f')](_0x581344['model'],qs[_0x3f45('0x31')](_0x2cb15e[_0x3f45('0x2d')][_0x3f45('0x31')]));_0x5713d8[_0x3f45('0x32')]=_0x5713d8['attributes'][_0x3f45('0x33')]?_0x5713d8['attributes']:_0x581344[_0x3f45('0x30')];_0x5713d8[_0x3f45('0x4e')]=qs[_0x3f45('0x35')](_0x2cb15e[_0x3f45('0x2d')][_0x3f45('0x35')]);_0x5713d8[_0x3f45('0x38')]=qs[_0x3f45('0x36')](_['pick'](_0x2cb15e[_0x3f45('0x2d')],_0x581344[_0x3f45('0x36')]));if(_0x2cb15e[_0x3f45('0x2d')][_0x3f45('0x37')]){_0x5713d8['where']=_[_0x3f45('0x39')](_0x5713d8[_0x3f45('0x38')],{'$or':_[_0x3f45('0x2c')](_0x5713d8['attributes'],function(_0x1c4194){var _0x1be433={};_0x1be433[_0x1c4194]={'$like':'%'+_0x2cb15e[_0x3f45('0x2d')][_0x3f45('0x37')]+'%'};return _0x1be433;})});}_0x5713d8=_['merge']({},_0x5713d8,_0x2cb15e[_0x3f45('0x3c')]);return _0x5b4400[_0x3f45('0x4c')](_0x5713d8);}})['then'](function(_0x186275){if(_0x186275){_0x34e169=_0x186275[_0x3f45('0x33')];if(!_0x2cb15e[_0x3f45('0x2d')][_0x3f45('0x34')](_0x3f45('0x49'))){_0x5713d8[_0x3f45('0x1a')]=qs[_0x3f45('0x1a')](_0x2cb15e[_0x3f45('0x2d')][_0x3f45('0x1a')]);_0x5713d8[_0x3f45('0x19')]=qs['offset'](_0x2cb15e['query'][_0x3f45('0x19')]);}return _0x5b4400['getDescriptions'](_0x5713d8);}})[_0x3f45('0x20')](function(_0x346932){if(_0x346932){return _0x346932?{'count':_0x34e169,'rows':_0x346932}:null;}})[_0x3f45('0x20')](respondWithResult(_0x270dd2,null))['catch'](handleError(_0x270dd2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 76d387b..ea0b270 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 _0xab40=['rimraf','../../config/environment','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','bluebird','request-promise','path'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0xab40,0xcd));var _0x0ab4=function(_0x30cae1,_0x451b0a){_0x30cae1=_0x30cae1-0x0;var _0x437450=_0xab40[_0x30cae1];return _0x437450;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0ab4('0x2'));var rp=require(_0x0ab4('0x3'));var fs=require('fs');var path=require(_0x0ab4('0x4'));var rimraf=require(_0x0ab4('0x5'));var config=require(_0x0ab4('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x28b17a,_0x4ba9d2){return _0x28b17a[_0x0ab4('0x7')](_0x0ab4('0x8'),attributes,{'tableName':_0x0ab4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe34f=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe34f,0xbc));var _0xfe34=function(_0x168245,_0x3c10b3){_0x168245=_0x168245-0x0;var _0x105c52=_0xe34f[_0x168245];return _0x105c52;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfe34('0x0'));var BPromise=require(_0xfe34('0x1'));var rp=require(_0xfe34('0x2'));var fs=require('fs');var path=require(_0xfe34('0x3'));var rimraf=require(_0xfe34('0x4'));var config=require(_0xfe34('0x5'));var attributes=require(_0xfe34('0x6'));module['exports']=function(_0x1a3c2b,_0x24e8cb){return _0x1a3c2b[_0xfe34('0x7')](_0xfe34('0x8'),attributes,{'tableName':_0xfe34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 7f8ffad..9d5ff53 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 _0x9797=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x346df1,_0x10fe5d){var _0xba7da6=function(_0x2a75c6){while(--_0x2a75c6){_0x346df1['push'](_0x346df1['shift']());}};_0xba7da6(++_0x10fe5d);}(_0x9797,0x1c9));var _0x7979=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0x9797[_0x3ae96c];return _0x1b0c90;};'use strict';var _=require(_0x7979('0x0'));var util=require(_0x7979('0x1'));var moment=require(_0x7979('0x2'));var BPromise=require('bluebird');var rs=require(_0x7979('0x3'));var fs=require('fs');var Redis=require(_0x7979('0x4'));var db=require(_0x7979('0x5'))['db'];var utils=require(_0x7979('0x6'));var logger=require(_0x7979('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7979('0x8'));var client=jayson[_0x7979('0x9')][_0x7979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20c280,_0x48ac8e,_0x8dbe35){return new BPromise(function(_0x391f8a,_0xf8c40){return client[_0x7979('0xb')](_0x20c280,_0x8dbe35)[_0x7979('0xc')](function(_0x530d18){logger['info'](_0x7979('0xd'),_0x48ac8e,_0x7979('0xe'));logger[_0x7979('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x48ac8e,'request\x20sent',JSON[_0x7979('0x10')](_0x530d18));if(_0x530d18[_0x7979('0x11')]){if(_0x530d18[_0x7979('0x11')][_0x7979('0x12')]===0x1f4){logger[_0x7979('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x48ac8e,_0x530d18['error'][_0x7979('0x13')]);return _0xf8c40(_0x530d18['error']['message']);}logger[_0x7979('0x11')](_0x7979('0xd'),_0x48ac8e,_0x530d18[_0x7979('0x11')]['message']);return _0x391f8a(_0x530d18[_0x7979('0x11')][_0x7979('0x13')]);}else{logger[_0x7979('0x14')](_0x7979('0xd'),_0x48ac8e,'request\x20sent');_0x391f8a(_0x530d18[_0x7979('0x15')][_0x7979('0x13')]);}})[_0x7979('0x16')](function(_0x27f44a){logger[_0x7979('0x11')](_0x7979('0xd'),_0x48ac8e,_0x27f44a);_0xf8c40(_0x27f44a);});});} \ No newline at end of file +var _0xd85c=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','request','info'];(function(_0xf90544,_0x211f7a){var _0x22b0ed=function(_0x1f805e){while(--_0x1f805e){_0xf90544['push'](_0xf90544['shift']());}};_0x22b0ed(++_0x211f7a);}(_0xd85c,0x15f));var _0xcd85=function(_0x230471,_0x10441f){_0x230471=_0x230471-0x0;var _0x5dd908=_0xd85c[_0x230471];return _0x5dd908;};'use strict';var _=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var moment=require('moment');var BPromise=require(_0xcd85('0x2'));var rs=require(_0xcd85('0x3'));var fs=require('fs');var Redis=require(_0xcd85('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd85('0x5'));var logger=require('../../config/logger')(_0xcd85('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33772b,_0x19d8ab,_0x5ea014){return new BPromise(function(_0x26acb9,_0x565039){return client[_0xcd85('0x7')](_0x33772b,_0x5ea014)['then'](function(_0xda6c0e){logger[_0xcd85('0x8')](_0xcd85('0x9'),_0x19d8ab,_0xcd85('0xa'));logger[_0xcd85('0xb')](_0xcd85('0xc'),_0x19d8ab,'request\x20sent',JSON[_0xcd85('0xd')](_0xda6c0e));if(_0xda6c0e['error']){if(_0xda6c0e[_0xcd85('0xe')][_0xcd85('0xf')]===0x1f4){logger[_0xcd85('0xe')](_0xcd85('0x9'),_0x19d8ab,_0xda6c0e[_0xcd85('0xe')]['message']);return _0x565039(_0xda6c0e[_0xcd85('0xe')]['message']);}logger[_0xcd85('0xe')](_0xcd85('0x9'),_0x19d8ab,_0xda6c0e[_0xcd85('0xe')]['message']);return _0x26acb9(_0xda6c0e[_0xcd85('0xe')][_0xcd85('0x10')]);}else{logger[_0xcd85('0x8')](_0xcd85('0x9'),_0x19d8ab,'request\x20sent');_0x26acb9(_0xda6c0e[_0xcd85('0x11')][_0xcd85('0x10')]);}})['catch'](function(_0x59bf62){logger[_0xcd85('0xe')](_0xcd85('0x9'),_0x19d8ab,_0x59bf62);_0x565039(_0x59bf62);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 40e4f2e..1be0a5b 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 _0x5555=['../../config/environment','get','index','/:id','isAuthenticated','post','create','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x20cbae,_0x5932c4){var _0x2c8137=function(_0x3bd714){while(--_0x3bd714){_0x20cbae['push'](_0x20cbae['shift']());}};_0x2c8137(++_0x5932c4);}(_0x5555,0x169));var _0x5555=function(_0x4ee3a4,_0x1b06c9){_0x4ee3a4=_0x4ee3a4-0x0;var _0x11e3ec=_0x5555[_0x4ee3a4];return _0x11e3ec;};'use strict';var multer=require(_0x5555('0x0'));var util=require(_0x5555('0x1'));var path=require(_0x5555('0x2'));var timeout=require(_0x5555('0x3'));var express=require(_0x5555('0x4'));var router=express[_0x5555('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5555('0x6'));var config=require(_0x5555('0x7'));var controller=require('./intServicenowField.controller');router[_0x5555('0x8')]('/',auth['isAuthenticated'](),controller[_0x5555('0x9')]);router[_0x5555('0x8')](_0x5555('0xa'),auth[_0x5555('0xb')](),controller['show']);router[_0x5555('0xc')]('/',auth[_0x5555('0xb')](),controller[_0x5555('0xd')]);router['put'](_0x5555('0xa'),auth[_0x5555('0xb')](),controller[_0x5555('0xe')]);router['delete'](_0x5555('0xa'),auth['isAuthenticated'](),controller[_0x5555('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3ad1=['show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id'];(function(_0x1a2e77,_0x2e376e){var _0x52507a=function(_0x415388){while(--_0x415388){_0x1a2e77['push'](_0x1a2e77['shift']());}};_0x52507a(++_0x2e376e);}(_0x3ad1,0x196));var _0x13ad=function(_0x315026,_0x49d03d){_0x315026=_0x315026-0x0;var _0x8b2837=_0x3ad1[_0x315026];return _0x8b2837;};'use strict';var multer=require(_0x13ad('0x0'));var util=require(_0x13ad('0x1'));var path=require('path');var timeout=require(_0x13ad('0x2'));var express=require('express');var router=express[_0x13ad('0x3')]();var fs_extra=require(_0x13ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x13ad('0x5'));var config=require(_0x13ad('0x6'));var controller=require(_0x13ad('0x7'));router[_0x13ad('0x8')]('/',auth[_0x13ad('0x9')](),controller[_0x13ad('0xa')]);router['get'](_0x13ad('0xb'),auth[_0x13ad('0x9')](),controller[_0x13ad('0xc')]);router[_0x13ad('0xd')]('/',auth[_0x13ad('0x9')](),controller[_0x13ad('0xe')]);router['put'](_0x13ad('0xb'),auth[_0x13ad('0x9')](),controller[_0x13ad('0xf')]);router[_0x13ad('0x10')](_0x13ad('0xb'),auth['isAuthenticated'](),controller[_0x13ad('0x11')]);module[_0x13ad('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 2bee6a0..b3ad836 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 _0xf2ea=['exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0xf2ea,0x1ce));var _0xaf2e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf2ea[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require('sequelize');module[_0xaf2e('0x0')]={'type':{'type':Sequelize[_0xaf2e('0x1')](_0xaf2e('0x2'),_0xaf2e('0x3'),'customVariable',_0xaf2e('0x4'),'picklist'),'defaultValue':_0xaf2e('0x2')},'content':{'type':Sequelize[_0xaf2e('0x5')]},'key':{'type':Sequelize[_0xaf2e('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xaf2e('0x6'))},'keyContent':{'type':Sequelize[_0xaf2e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaf2e('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf2e('0x5')]}}; \ No newline at end of file +var _0x0593=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x595bda,_0x40136e){var _0x145365=function(_0xa9a452){while(--_0xa9a452){_0x595bda['push'](_0x595bda['shift']());}};_0x145365(++_0x40136e);}(_0x0593,0x1b4));var _0x3059=function(_0x5698aa,_0x191767){_0x5698aa=_0x5698aa-0x0;var _0x5bffad=_0x0593[_0x5698aa];return _0x5bffad;};'use strict';var Sequelize=require(_0x3059('0x0'));module[_0x3059('0x1')]={'type':{'type':Sequelize[_0x3059('0x2')](_0x3059('0x3'),'variable',_0x3059('0x4'),_0x3059('0x5'),_0x3059('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3059('0x7')]},'keyType':{'type':Sequelize[_0x3059('0x2')](_0x3059('0x3'),_0x3059('0x8'),_0x3059('0x4'))},'keyContent':{'type':Sequelize[_0x3059('0x7')]},'idField':{'type':Sequelize[_0x3059('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3059('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3059('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index d4f9e2b..0f9895e 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 _0x1b10=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','length','include','options','find','catch','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x1b10,0x17f));var _0x01b1=function(_0x56383e,_0x291bf4){_0x56383e=_0x56383e-0x0;var _0x551adf=_0x1b10[_0x56383e];return _0x551adf;};'use strict';var emlformat=require(_0x01b1('0x0'));var rimraf=require(_0x01b1('0x1'));var zipdir=require(_0x01b1('0x2'));var jsonpatch=require(_0x01b1('0x3'));var rp=require(_0x01b1('0x4'));var moment=require(_0x01b1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x01b1('0x6'));var util=require(_0x01b1('0x7'));var path=require(_0x01b1('0x8'));var sox=require(_0x01b1('0x9'));var csv=require(_0x01b1('0xa'));var ejs=require(_0x01b1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01b1('0xc'));var squel=require(_0x01b1('0xd'));var crypto=require(_0x01b1('0xe'));var jsforce=require(_0x01b1('0xf'));var deskjs=require(_0x01b1('0x10'));var toCsv=require(_0x01b1('0xa'));var querystring=require(_0x01b1('0x11'));var Papa=require(_0x01b1('0x12'));var Redis=require(_0x01b1('0x13'));var authService=require(_0x01b1('0x14'));var qs=require(_0x01b1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01b1('0x16'));var logger=require(_0x01b1('0x17'))('api');var utils=require(_0x01b1('0x18'));var config=require(_0x01b1('0x19'));var licenseUtil=require(_0x01b1('0x1a'));var db=require(_0x01b1('0x1b'))['db'];function respondWithStatusCode(_0x5e5c1f,_0x5d78d3){_0x5d78d3=_0x5d78d3||0xcc;return function(_0x1cfa00){if(_0x1cfa00){return _0x5e5c1f[_0x01b1('0x1c')](_0x5d78d3);}return _0x5e5c1f[_0x01b1('0x1d')](_0x5d78d3)['end']();};}function respondWithResult(_0x1fb97b,_0x52d1ee){_0x52d1ee=_0x52d1ee||0xc8;return function(_0x34b415){if(_0x34b415){return _0x1fb97b['status'](_0x52d1ee)[_0x01b1('0x1e')](_0x34b415);}};}function respondWithFilteredResult(_0xa34438,_0x1065ed){return function(_0x354158){if(_0x354158){var _0x1e920c=typeof _0x1065ed[_0x01b1('0x1f')]===_0x01b1('0x20')&&typeof _0x1065ed[_0x01b1('0x21')]===_0x01b1('0x20');var _0xb52503=_0x354158[_0x01b1('0x22')];var _0x2396ba=_0x1e920c?0x0:_0x1065ed['offset'];var _0x21701b=_0x1e920c?_0x354158[_0x01b1('0x22')]:_0x1065ed[_0x01b1('0x1f')]+_0x1065ed[_0x01b1('0x21')];var _0x16b9fc;if(_0x21701b>=_0xb52503){_0x21701b=_0xb52503;_0x16b9fc=0xc8;}else{_0x16b9fc=0xce;}_0xa34438[_0x01b1('0x1d')](_0x16b9fc);return _0xa34438[_0x01b1('0x23')]('Content-Range',_0x2396ba+'-'+_0x21701b+'/'+_0xb52503)[_0x01b1('0x1e')](_0x354158);}return null;};}function patchUpdates(_0x41767b){return function(_0x3b2c09){try{jsonpatch[_0x01b1('0x24')](_0x3b2c09,_0x41767b,!![]);}catch(_0xc929a3){return BPromise[_0x01b1('0x25')](_0xc929a3);}return _0x3b2c09[_0x01b1('0x26')]();};}function saveUpdates(_0x2831f6,_0x2eec3c){return function(_0x20eae1){if(_0x20eae1){return _0x20eae1['update'](_0x2831f6)['then'](function(_0x30c0ac){return _0x30c0ac;});}return null;};}function removeEntity(_0x279f5c,_0x20192a){return function(_0x59bd6f){if(_0x59bd6f){return _0x59bd6f[_0x01b1('0x27')]()[_0x01b1('0x28')](function(){_0x279f5c['status'](0xcc)[_0x01b1('0x29')]();});}};}function handleEntityNotFound(_0x596436,_0x272f66){return function(_0x5826b0){if(!_0x5826b0){_0x596436[_0x01b1('0x1c')](0x194);}return _0x5826b0;};}function handleError(_0x5e0dab,_0x94c75d){_0x94c75d=_0x94c75d||0x1f4;return function(_0xf067f3){logger[_0x01b1('0x2a')](_0xf067f3[_0x01b1('0x2b')]);if(_0xf067f3[_0x01b1('0x2c')]){delete _0xf067f3['name'];}_0x5e0dab[_0x01b1('0x1d')](_0x94c75d)[_0x01b1('0x2d')](_0xf067f3);};}exports[_0x01b1('0x2e')]=function(_0x23fe1d,_0x499324){var _0x5cc7f5={},_0x419792={},_0x40fd4c={'count':0x0,'rows':[]};var _0x3dc730=_[_0x01b1('0x2f')](db[_0x01b1('0x30')][_0x01b1('0x31')],function(_0x352774){return{'name':_0x352774[_0x01b1('0x32')],'type':_0x352774[_0x01b1('0x33')][_0x01b1('0x34')]};});_0x419792[_0x01b1('0x35')]=_[_0x01b1('0x2f')](_0x3dc730,_0x01b1('0x2c'));_0x419792[_0x01b1('0x36')]=_[_0x01b1('0x37')](_0x23fe1d[_0x01b1('0x36')]);_0x419792[_0x01b1('0x38')]=_[_0x01b1('0x39')](_0x419792['model'],_0x419792[_0x01b1('0x36')]);_0x5cc7f5[_0x01b1('0x3a')]=_[_0x01b1('0x39')](_0x419792['model'],qs[_0x01b1('0x3b')](_0x23fe1d[_0x01b1('0x36')][_0x01b1('0x3b')]));_0x5cc7f5['attributes']=_0x5cc7f5[_0x01b1('0x3a')]['length']?_0x5cc7f5[_0x01b1('0x3a')]:_0x419792[_0x01b1('0x35')];if(!_0x23fe1d[_0x01b1('0x36')]['hasOwnProperty'](_0x01b1('0x3c'))){_0x5cc7f5[_0x01b1('0x21')]=qs['limit'](_0x23fe1d['query'][_0x01b1('0x21')]);_0x5cc7f5[_0x01b1('0x1f')]=qs['offset'](_0x23fe1d['query']['offset']);}_0x5cc7f5[_0x01b1('0x3d')]=qs[_0x01b1('0x3e')](_0x23fe1d[_0x01b1('0x36')]['sort']);_0x5cc7f5[_0x01b1('0x3f')]=qs[_0x01b1('0x38')](_[_0x01b1('0x40')](_0x23fe1d[_0x01b1('0x36')],_0x419792['filters']),_0x3dc730);if(_0x23fe1d['query'][_0x01b1('0x41')]){_0x5cc7f5['where']=_[_0x01b1('0x42')](_0x5cc7f5['where'],{'$or':_[_0x01b1('0x2f')](_0x3dc730,function(_0x236f23){if(_0x236f23['type']!==_0x01b1('0x43')){var _0x443e77={};_0x443e77[_0x236f23[_0x01b1('0x2c')]]={'$like':'%'+_0x23fe1d[_0x01b1('0x36')][_0x01b1('0x41')]+'%'};return _0x443e77;}})});}_0x5cc7f5=_[_0x01b1('0x42')]({},_0x5cc7f5,_0x23fe1d['options']);var _0x4c6690={'where':_0x5cc7f5[_0x01b1('0x3f')]};return db['ServicenowField'][_0x01b1('0x22')](_0x4c6690)[_0x01b1('0x28')](function(_0x386731){_0x40fd4c['count']=_0x386731;if(_0x23fe1d[_0x01b1('0x36')][_0x01b1('0x44')]){_0x5cc7f5['include']=[{'all':!![]}];}return db[_0x01b1('0x30')][_0x01b1('0x45')](_0x5cc7f5);})[_0x01b1('0x28')](function(_0x12990e){_0x40fd4c['rows']=_0x12990e;return _0x40fd4c;})[_0x01b1('0x28')](respondWithFilteredResult(_0x499324,_0x5cc7f5))['catch'](handleError(_0x499324,null));};exports[_0x01b1('0x46')]=function(_0x475ae4,_0x1f6290){var _0x1547ad={'raw':!![],'where':{'id':_0x475ae4[_0x01b1('0x47')]['id']}},_0x74f92c={};_0x74f92c[_0x01b1('0x35')]=_[_0x01b1('0x37')](db[_0x01b1('0x30')][_0x01b1('0x31')]);_0x74f92c['query']=_['keys'](_0x475ae4[_0x01b1('0x36')]);_0x74f92c[_0x01b1('0x38')]=_[_0x01b1('0x39')](_0x74f92c[_0x01b1('0x35')],_0x74f92c['query']);_0x1547ad[_0x01b1('0x3a')]=_[_0x01b1('0x39')](_0x74f92c[_0x01b1('0x35')],qs[_0x01b1('0x3b')](_0x475ae4[_0x01b1('0x36')]['fields']));_0x1547ad[_0x01b1('0x3a')]=_0x1547ad['attributes'][_0x01b1('0x48')]?_0x1547ad[_0x01b1('0x3a')]:_0x74f92c[_0x01b1('0x35')];if(_0x475ae4['query'][_0x01b1('0x44')]){_0x1547ad[_0x01b1('0x49')]=[{'all':!![]}];}_0x1547ad=_[_0x01b1('0x42')]({},_0x1547ad,_0x475ae4[_0x01b1('0x4a')]);return db[_0x01b1('0x30')][_0x01b1('0x4b')](_0x1547ad)[_0x01b1('0x28')](handleEntityNotFound(_0x1f6290,null))['then'](respondWithResult(_0x1f6290,null))[_0x01b1('0x4c')](handleError(_0x1f6290,null));};exports[_0x01b1('0x4d')]=function(_0x25ffb0,_0x43100f){return db[_0x01b1('0x30')][_0x01b1('0x4d')](_0x25ffb0['body'],{})[_0x01b1('0x28')](respondWithResult(_0x43100f,0xc9))[_0x01b1('0x4c')](handleError(_0x43100f,null));};exports[_0x01b1('0x4e')]=function(_0x1af593,_0x1d9911){if(_0x1af593[_0x01b1('0x4f')]['id']){delete _0x1af593[_0x01b1('0x4f')]['id'];}return db[_0x01b1('0x30')][_0x01b1('0x4b')]({'where':{'id':_0x1af593[_0x01b1('0x47')]['id']}})[_0x01b1('0x28')](handleEntityNotFound(_0x1d9911,null))['then'](saveUpdates(_0x1af593[_0x01b1('0x4f')],null))['then'](respondWithResult(_0x1d9911,null))['catch'](handleError(_0x1d9911,null));};exports[_0x01b1('0x27')]=function(_0x1ce56a,_0x5ca701){return db[_0x01b1('0x30')][_0x01b1('0x4b')]({'where':{'id':_0x1ce56a[_0x01b1('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ca701,null))[_0x01b1('0x28')](removeEntity(_0x5ca701,null))[_0x01b1('0x4c')](handleError(_0x5ca701,null));}; \ No newline at end of file +var _0x5b5f=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','create','body','find'];(function(_0x5b34a7,_0x3f1c19){var _0x136c49=function(_0xa77a47){while(--_0xa77a47){_0x5b34a7['push'](_0x5b34a7['shift']());}};_0x136c49(++_0x3f1c19);}(_0x5b5f,0x1c2));var _0xf5b5=function(_0x57163b,_0x41db5f){_0x57163b=_0x57163b-0x0;var _0x13c1ea=_0x5b5f[_0x57163b];return _0x13c1ea;};'use strict';var emlformat=require(_0xf5b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5b5('0x1'));var jsonpatch=require(_0xf5b5('0x2'));var rp=require(_0xf5b5('0x3'));var moment=require('moment');var BPromise=require(_0xf5b5('0x4'));var Mustache=require('mustache');var util=require(_0xf5b5('0x5'));var path=require(_0xf5b5('0x6'));var sox=require(_0xf5b5('0x7'));var csv=require(_0xf5b5('0x8'));var ejs=require(_0xf5b5('0x9'));var fs=require('fs');var fs_extra=require(_0xf5b5('0xa'));var _=require(_0xf5b5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf5b5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf5b5('0x8'));var querystring=require(_0xf5b5('0xd'));var Papa=require(_0xf5b5('0xe'));var Redis=require(_0xf5b5('0xf'));var authService=require(_0xf5b5('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5b5('0x11'))(_0xf5b5('0x12'));var utils=require(_0xf5b5('0x13'));var config=require(_0xf5b5('0x14'));var licenseUtil=require(_0xf5b5('0x15'));var db=require(_0xf5b5('0x16'))['db'];function respondWithStatusCode(_0x1ca48d,_0x26b756){_0x26b756=_0x26b756||0xcc;return function(_0x28dc84){if(_0x28dc84){return _0x1ca48d[_0xf5b5('0x17')](_0x26b756);}return _0x1ca48d[_0xf5b5('0x18')](_0x26b756)['end']();};}function respondWithResult(_0x2eb737,_0x4588dd){_0x4588dd=_0x4588dd||0xc8;return function(_0x172be3){if(_0x172be3){return _0x2eb737[_0xf5b5('0x18')](_0x4588dd)[_0xf5b5('0x19')](_0x172be3);}};}function respondWithFilteredResult(_0x396c6c,_0x56b9f0){return function(_0x41c8cc){if(_0x41c8cc){var _0x349f32=typeof _0x56b9f0[_0xf5b5('0x1a')]==='undefined'&&typeof _0x56b9f0['limit']===_0xf5b5('0x1b');var _0x431681=_0x41c8cc[_0xf5b5('0x1c')];var _0x1487fb=_0x349f32?0x0:_0x56b9f0[_0xf5b5('0x1a')];var _0x362f04=_0x349f32?_0x41c8cc[_0xf5b5('0x1c')]:_0x56b9f0[_0xf5b5('0x1a')]+_0x56b9f0[_0xf5b5('0x1d')];var _0x20ff18;if(_0x362f04>=_0x431681){_0x362f04=_0x431681;_0x20ff18=0xc8;}else{_0x20ff18=0xce;}_0x396c6c['status'](_0x20ff18);return _0x396c6c[_0xf5b5('0x1e')](_0xf5b5('0x1f'),_0x1487fb+'-'+_0x362f04+'/'+_0x431681)[_0xf5b5('0x19')](_0x41c8cc);}return null;};}function patchUpdates(_0x4a3d1f){return function(_0x3b4eab){try{jsonpatch[_0xf5b5('0x20')](_0x3b4eab,_0x4a3d1f,!![]);}catch(_0x1be063){return BPromise['reject'](_0x1be063);}return _0x3b4eab[_0xf5b5('0x21')]();};}function saveUpdates(_0x1b48f0,_0x456703){return function(_0x42614f){if(_0x42614f){return _0x42614f[_0xf5b5('0x22')](_0x1b48f0)[_0xf5b5('0x23')](function(_0x2ee67f){return _0x2ee67f;});}return null;};}function removeEntity(_0x57330e,_0x51b7e7){return function(_0x241b44){if(_0x241b44){return _0x241b44[_0xf5b5('0x24')]()[_0xf5b5('0x23')](function(){_0x57330e[_0xf5b5('0x18')](0xcc)[_0xf5b5('0x25')]();});}};}function handleEntityNotFound(_0x5868bc,_0x273342){return function(_0x5c60ab){if(!_0x5c60ab){_0x5868bc[_0xf5b5('0x17')](0x194);}return _0x5c60ab;};}function handleError(_0x57ae15,_0x3f8e8d){_0x3f8e8d=_0x3f8e8d||0x1f4;return function(_0x31529a){logger[_0xf5b5('0x26')](_0x31529a[_0xf5b5('0x27')]);if(_0x31529a[_0xf5b5('0x28')]){delete _0x31529a[_0xf5b5('0x28')];}_0x57ae15[_0xf5b5('0x18')](_0x3f8e8d)[_0xf5b5('0x29')](_0x31529a);};}exports['index']=function(_0x257910,_0x510555){var _0x4b7bd7={},_0x329fb8={},_0x53fa22={'count':0x0,'rows':[]};var _0x567a98=_[_0xf5b5('0x2a')](db[_0xf5b5('0x2b')][_0xf5b5('0x2c')],function(_0x4e923f){return{'name':_0x4e923f[_0xf5b5('0x2d')],'type':_0x4e923f[_0xf5b5('0x2e')][_0xf5b5('0x2f')]};});_0x329fb8[_0xf5b5('0x30')]=_[_0xf5b5('0x2a')](_0x567a98,'name');_0x329fb8[_0xf5b5('0x31')]=_['keys'](_0x257910[_0xf5b5('0x31')]);_0x329fb8['filters']=_[_0xf5b5('0x32')](_0x329fb8['model'],_0x329fb8[_0xf5b5('0x31')]);_0x4b7bd7[_0xf5b5('0x33')]=_['intersection'](_0x329fb8[_0xf5b5('0x30')],qs[_0xf5b5('0x34')](_0x257910[_0xf5b5('0x31')]['fields']));_0x4b7bd7[_0xf5b5('0x33')]=_0x4b7bd7[_0xf5b5('0x33')][_0xf5b5('0x35')]?_0x4b7bd7[_0xf5b5('0x33')]:_0x329fb8[_0xf5b5('0x30')];if(!_0x257910['query'][_0xf5b5('0x36')](_0xf5b5('0x37'))){_0x4b7bd7[_0xf5b5('0x1d')]=qs[_0xf5b5('0x1d')](_0x257910[_0xf5b5('0x31')][_0xf5b5('0x1d')]);_0x4b7bd7[_0xf5b5('0x1a')]=qs[_0xf5b5('0x1a')](_0x257910['query'][_0xf5b5('0x1a')]);}_0x4b7bd7[_0xf5b5('0x38')]=qs[_0xf5b5('0x39')](_0x257910[_0xf5b5('0x31')][_0xf5b5('0x39')]);_0x4b7bd7['where']=qs['filters'](_[_0xf5b5('0x3a')](_0x257910['query'],_0x329fb8[_0xf5b5('0x3b')]),_0x567a98);if(_0x257910[_0xf5b5('0x31')][_0xf5b5('0x3c')]){_0x4b7bd7[_0xf5b5('0x3d')]=_[_0xf5b5('0x3e')](_0x4b7bd7[_0xf5b5('0x3d')],{'$or':_[_0xf5b5('0x2a')](_0x567a98,function(_0x3429d1){if(_0x3429d1[_0xf5b5('0x2e')]!==_0xf5b5('0x3f')){var _0x4536ea={};_0x4536ea[_0x3429d1['name']]={'$like':'%'+_0x257910['query'][_0xf5b5('0x3c')]+'%'};return _0x4536ea;}})});}_0x4b7bd7=_[_0xf5b5('0x3e')]({},_0x4b7bd7,_0x257910['options']);var _0x27ce36={'where':_0x4b7bd7['where']};return db[_0xf5b5('0x2b')][_0xf5b5('0x1c')](_0x27ce36)[_0xf5b5('0x23')](function(_0x3a6470){_0x53fa22[_0xf5b5('0x1c')]=_0x3a6470;if(_0x257910[_0xf5b5('0x31')][_0xf5b5('0x40')]){_0x4b7bd7[_0xf5b5('0x41')]=[{'all':!![]}];}return db[_0xf5b5('0x2b')][_0xf5b5('0x42')](_0x4b7bd7);})[_0xf5b5('0x23')](function(_0x303a3a){_0x53fa22['rows']=_0x303a3a;return _0x53fa22;})[_0xf5b5('0x23')](respondWithFilteredResult(_0x510555,_0x4b7bd7))[_0xf5b5('0x43')](handleError(_0x510555,null));};exports[_0xf5b5('0x44')]=function(_0x5cd681,_0x453164){var _0x16d153={'raw':!![],'where':{'id':_0x5cd681[_0xf5b5('0x45')]['id']}},_0x1d4d3d={};_0x1d4d3d['model']=_[_0xf5b5('0x46')](db['ServicenowField'][_0xf5b5('0x2c')]);_0x1d4d3d[_0xf5b5('0x31')]=_[_0xf5b5('0x46')](_0x5cd681[_0xf5b5('0x31')]);_0x1d4d3d['filters']=_[_0xf5b5('0x32')](_0x1d4d3d[_0xf5b5('0x30')],_0x1d4d3d['query']);_0x16d153[_0xf5b5('0x33')]=_[_0xf5b5('0x32')](_0x1d4d3d['model'],qs['fields'](_0x5cd681[_0xf5b5('0x31')][_0xf5b5('0x34')]));_0x16d153[_0xf5b5('0x33')]=_0x16d153[_0xf5b5('0x33')]['length']?_0x16d153[_0xf5b5('0x33')]:_0x1d4d3d[_0xf5b5('0x30')];if(_0x5cd681[_0xf5b5('0x31')][_0xf5b5('0x40')]){_0x16d153[_0xf5b5('0x41')]=[{'all':!![]}];}_0x16d153=_[_0xf5b5('0x3e')]({},_0x16d153,_0x5cd681[_0xf5b5('0x47')]);return db[_0xf5b5('0x2b')]['find'](_0x16d153)['then'](handleEntityNotFound(_0x453164,null))[_0xf5b5('0x23')](respondWithResult(_0x453164,null))[_0xf5b5('0x43')](handleError(_0x453164,null));};exports['create']=function(_0x2c7791,_0xfcf16e){return db[_0xf5b5('0x2b')][_0xf5b5('0x48')](_0x2c7791[_0xf5b5('0x49')],{})['then'](respondWithResult(_0xfcf16e,0xc9))[_0xf5b5('0x43')](handleError(_0xfcf16e,null));};exports[_0xf5b5('0x22')]=function(_0x414fce,_0x51c401){if(_0x414fce[_0xf5b5('0x49')]['id']){delete _0x414fce[_0xf5b5('0x49')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x414fce[_0xf5b5('0x45')]['id']}})[_0xf5b5('0x23')](handleEntityNotFound(_0x51c401,null))['then'](saveUpdates(_0x414fce[_0xf5b5('0x49')],null))[_0xf5b5('0x23')](respondWithResult(_0x51c401,null))['catch'](handleError(_0x51c401,null));};exports[_0xf5b5('0x24')]=function(_0x16db96,_0x32a079){return db['ServicenowField'][_0xf5b5('0x4a')]({'where':{'id':_0x16db96['params']['id']}})[_0xf5b5('0x23')](handleEntityNotFound(_0x32a079,null))[_0xf5b5('0x23')](removeEntity(_0x32a079,null))['catch'](handleError(_0x32a079,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 82875b1..a385055 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 _0xd5b5=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ServicenowField','int_servicenow_fields','idField','FieldId'];(function(_0x568e7c,_0x5ea152){var _0x4682a7=function(_0x868695){while(--_0x868695){_0x568e7c['push'](_0x568e7c['shift']());}};_0x4682a7(++_0x5ea152);}(_0xd5b5,0xe0));var _0x5d5b=function(_0x38832d,_0x247f6a){_0x38832d=_0x38832d-0x0;var _0x325bb1=_0xd5b5[_0x38832d];return _0x325bb1;};'use strict';var _=require(_0x5d5b('0x0'));var util=require(_0x5d5b('0x1'));var logger=require(_0x5d5b('0x2'))('api');var moment=require(_0x5d5b('0x3'));var BPromise=require(_0x5d5b('0x4'));var rp=require(_0x5d5b('0x5'));var fs=require('fs');var path=require(_0x5d5b('0x6'));var rimraf=require(_0x5d5b('0x7'));var config=require(_0x5d5b('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x241306,_0x68f7ff){return _0x241306[_0x5d5b('0x9')](_0x5d5b('0xa'),attributes,{'tableName':_0x5d5b('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5d5b('0xc'),_0x5d5b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b17=['../../config/logger','api','path','rimraf','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x2b17,0xca));var _0x72b1=function(_0x19b22c,_0x543361){_0x19b22c=_0x19b22c-0x0;var _0x2fa752=_0x2b17[_0x19b22c];return _0x2fa752;};'use strict';var _=require(_0x72b1('0x0'));var util=require(_0x72b1('0x1'));var logger=require(_0x72b1('0x2'))(_0x72b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x72b1('0x4'));var rimraf=require(_0x72b1('0x5'));var config=require('../../config/environment');var attributes=require(_0x72b1('0x6'));module['exports']=function(_0xdaa09c,_0x57d005){return _0xdaa09c[_0x72b1('0x7')](_0x72b1('0x8'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x72b1('0x9'),'fields':[_0x72b1('0xa'),_0x72b1('0xb')],'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 62cc59c..d985cf4 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 _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(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0xaa88,0x137));var _0x8aa8=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0xaa88[_0x3c6b7d];return _0x1d3ed2;};'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 +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x945416,_0x9cf65e){var _0x322c73=function(_0x11d460){while(--_0x11d460){_0x945416['push'](_0x945416['shift']());}};_0x322c73(++_0x9cf65e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xcb91[_0x2bfe52];return _0x1cf649;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 102df49..f0e5264 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(_0x15c85f,_0x2346f2){var _0x1aa20a=function(_0x2f26e2){while(--_0x2f26e2){_0x15c85f['push'](_0x15c85f['shift']());}};_0x1aa20a(++_0x2346f2);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x3450bf,_0x3db54f){var _0x4f1e01=function(_0x232168){while(--_0x232168){_0x3450bf['push'](_0x3450bf['shift']());}};_0x4f1e01(++_0x3db54f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 7de30af..f7c3705 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(_0x4f06e2,_0x21dfc3){var _0x5b8e72=function(_0x3dc187){while(--_0x3dc187){_0x4f06e2['push'](_0x4f06e2['shift']());}};_0x5b8e72(++_0x21dfc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x1daeba,_0x569f36){var _0x202331=function(_0x1362b6){while(--_0x1362b6){_0x1daeba['push'](_0x1daeba['shift']());}};_0x202331(++_0x569f36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 279b207..c8d0d54 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 _0x1dbb=['map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','filters','pick','filter','where','VIRTUAL','merge','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','body','update','SugarcrmConfiguration','sort','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','label','endsWith','value','test','statusCode','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','error','stack','name'];(function(_0x35a3e2,_0x12afc8){var _0x35fe0f=function(_0x2dd731){while(--_0x2dd731){_0x35a3e2['push'](_0x35a3e2['shift']());}};_0x35fe0f(++_0x12afc8);}(_0x1dbb,0x135));var _0xb1db=function(_0x3b9512,_0x20ab2e){_0x3b9512=_0x3b9512-0x0;var _0x29e098=_0x1dbb[_0x3b9512];return _0x29e098;};'use strict';var emlformat=require(_0xb1db('0x0'));var rimraf=require(_0xb1db('0x1'));var zipdir=require(_0xb1db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb1db('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb1db('0x4'));var util=require(_0xb1db('0x5'));var path=require('path');var sox=require(_0xb1db('0x6'));var csv=require(_0xb1db('0x7'));var ejs=require(_0xb1db('0x8'));var fs=require('fs');var fs_extra=require(_0xb1db('0x9'));var _=require(_0xb1db('0xa'));var squel=require(_0xb1db('0xb'));var crypto=require(_0xb1db('0xc'));var jsforce=require(_0xb1db('0xd'));var deskjs=require(_0xb1db('0xe'));var toCsv=require(_0xb1db('0x7'));var querystring=require('querystring');var Papa=require(_0xb1db('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb1db('0x10'));var hardwareService=require(_0xb1db('0x11'));var logger=require('../../config/logger')(_0xb1db('0x12'));var utils=require(_0xb1db('0x13'));var config=require(_0xb1db('0x14'));var licenseUtil=require(_0xb1db('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb1db('0x16'));function respondWithStatusCode(_0x5b94a7,_0x152ff3){_0x152ff3=_0x152ff3||0xcc;return function(_0x48c67b){if(_0x48c67b){return _0x5b94a7[_0xb1db('0x17')](_0x152ff3);}return _0x5b94a7['status'](_0x152ff3)[_0xb1db('0x18')]();};}function respondWithResult(_0x2613e4,_0x141636){_0x141636=_0x141636||0xc8;return function(_0x25db90){if(_0x25db90){return _0x2613e4[_0xb1db('0x19')](_0x141636)['json'](_0x25db90);}};}function respondWithFilteredResult(_0x2679b9,_0xfe7b36){return function(_0x15a996){if(_0x15a996){var _0x298fde=typeof _0xfe7b36[_0xb1db('0x1a')]===_0xb1db('0x1b')&&typeof _0xfe7b36[_0xb1db('0x1c')]===_0xb1db('0x1b');var _0x717a3c=_0x15a996[_0xb1db('0x1d')];var _0x101b46=_0x298fde?0x0:_0xfe7b36[_0xb1db('0x1a')];var _0x5540d9=_0x298fde?_0x15a996[_0xb1db('0x1d')]:_0xfe7b36['offset']+_0xfe7b36[_0xb1db('0x1c')];var _0x58dcc3;if(_0x5540d9>=_0x717a3c){_0x5540d9=_0x717a3c;_0x58dcc3=0xc8;}else{_0x58dcc3=0xce;}_0x2679b9['status'](_0x58dcc3);return _0x2679b9['set'](_0xb1db('0x1e'),_0x101b46+'-'+_0x5540d9+'/'+_0x717a3c)[_0xb1db('0x1f')](_0x15a996);}return null;};}function patchUpdates(_0x52f3fc){return function(_0x273bf7){try{jsonpatch['apply'](_0x273bf7,_0x52f3fc,!![]);}catch(_0x1a18ee){return BPromise[_0xb1db('0x20')](_0x1a18ee);}return _0x273bf7[_0xb1db('0x21')]();};}function saveUpdates(_0x2a6328,_0x84895e){return function(_0xfa5ab6){if(_0xfa5ab6){return _0xfa5ab6['update'](_0x2a6328)[_0xb1db('0x22')](function(_0x2c7fa0){return _0x2c7fa0;});}return null;};}function removeEntity(_0x2943a7,_0x4d9d4a){return function(_0x49b74b){if(_0x49b74b){return _0x49b74b[_0xb1db('0x23')]()[_0xb1db('0x22')](function(){_0x2943a7[_0xb1db('0x19')](0xcc)[_0xb1db('0x18')]();});}};}function handleEntityNotFound(_0x4c558f,_0x36e449){return function(_0x11a80c){if(!_0x11a80c){_0x4c558f['sendStatus'](0x194);}return _0x11a80c;};}function handleError(_0x40f07d,_0x2fc708){_0x2fc708=_0x2fc708||0x1f4;return function(_0x50cc9a){logger[_0xb1db('0x24')](_0x50cc9a[_0xb1db('0x25')]);if(_0x50cc9a[_0xb1db('0x26')]){delete _0x50cc9a[_0xb1db('0x26')];}_0x40f07d[_0xb1db('0x19')](_0x2fc708)['send'](_0x50cc9a);};}exports['index']=function(_0x1c63a7,_0x15b813){var _0x250ce1={},_0x570ab7={},_0xe34d06={'count':0x0,'rows':[]};var _0x1c6a87=_[_0xb1db('0x27')](db['SugarcrmAccount'][_0xb1db('0x28')],function(_0x31d6c7){return{'name':_0x31d6c7[_0xb1db('0x29')],'type':_0x31d6c7[_0xb1db('0x2a')][_0xb1db('0x2b')]};});_0x570ab7[_0xb1db('0x2c')]=_[_0xb1db('0x27')](_0x1c6a87,_0xb1db('0x26'));_0x570ab7[_0xb1db('0x2d')]=_['keys'](_0x1c63a7[_0xb1db('0x2d')]);_0x570ab7['filters']=_[_0xb1db('0x2e')](_0x570ab7[_0xb1db('0x2c')],_0x570ab7[_0xb1db('0x2d')]);_0x250ce1[_0xb1db('0x2f')]=_[_0xb1db('0x2e')](_0x570ab7[_0xb1db('0x2c')],qs[_0xb1db('0x30')](_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x30')]));_0x250ce1[_0xb1db('0x2f')]=_0x250ce1[_0xb1db('0x2f')][_0xb1db('0x31')]?_0x250ce1['attributes']:_0x570ab7[_0xb1db('0x2c')];if(!_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x32')]('nolimit')){_0x250ce1[_0xb1db('0x1c')]=qs[_0xb1db('0x1c')](_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x1c')]);_0x250ce1[_0xb1db('0x1a')]=qs[_0xb1db('0x1a')](_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x1a')]);}_0x250ce1[_0xb1db('0x33')]=qs['sort'](_0x1c63a7[_0xb1db('0x2d')]['sort']);_0x250ce1['where']=qs[_0xb1db('0x34')](_[_0xb1db('0x35')](_0x1c63a7[_0xb1db('0x2d')],_0x570ab7[_0xb1db('0x34')]),_0x1c6a87);if(_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x36')]){_0x250ce1[_0xb1db('0x37')]=_['merge'](_0x250ce1[_0xb1db('0x37')],{'$or':_['map'](_0x1c6a87,function(_0x47c5b0){if(_0x47c5b0['type']!==_0xb1db('0x38')){var _0x4787a7={};_0x4787a7[_0x47c5b0[_0xb1db('0x26')]]={'$like':'%'+_0x1c63a7[_0xb1db('0x2d')][_0xb1db('0x36')]+'%'};return _0x4787a7;}})});}_0x250ce1=_[_0xb1db('0x39')]({},_0x250ce1,_0x1c63a7[_0xb1db('0x3a')]);var _0x5f083d={'where':_0x250ce1[_0xb1db('0x37')]};return db[_0xb1db('0x3b')][_0xb1db('0x1d')](_0x5f083d)[_0xb1db('0x22')](function(_0x236a81){_0xe34d06[_0xb1db('0x1d')]=_0x236a81;if(_0x1c63a7['query'][_0xb1db('0x3c')]){_0x250ce1[_0xb1db('0x3d')]=[{'all':!![]}];}return db[_0xb1db('0x3b')][_0xb1db('0x3e')](_0x250ce1);})[_0xb1db('0x22')](function(_0x325ac8){_0xe34d06[_0xb1db('0x3f')]=_0x325ac8;return _0xe34d06;})['then'](respondWithFilteredResult(_0x15b813,_0x250ce1))[_0xb1db('0x40')](handleError(_0x15b813,null));};exports[_0xb1db('0x41')]=function(_0x1c4885,_0x91e305){var _0x56b477={'raw':![],'where':{'id':_0x1c4885[_0xb1db('0x42')]['id']}},_0x2eea82={};_0x2eea82[_0xb1db('0x2c')]=_[_0xb1db('0x43')](db['SugarcrmAccount'][_0xb1db('0x28')]);_0x2eea82['query']=_[_0xb1db('0x43')](_0x1c4885[_0xb1db('0x2d')]);_0x2eea82[_0xb1db('0x34')]=_[_0xb1db('0x2e')](_0x2eea82[_0xb1db('0x2c')],_0x2eea82[_0xb1db('0x2d')]);_0x56b477[_0xb1db('0x2f')]=_[_0xb1db('0x2e')](_0x2eea82[_0xb1db('0x2c')],qs[_0xb1db('0x30')](_0x1c4885[_0xb1db('0x2d')][_0xb1db('0x30')]));_0x56b477['attributes']=_0x56b477[_0xb1db('0x2f')]['length']?_0x56b477[_0xb1db('0x2f')]:_0x2eea82['model'];if(_0x1c4885[_0xb1db('0x2d')][_0xb1db('0x3c')]){_0x56b477[_0xb1db('0x3d')]=[{'all':!![]}];}_0x56b477=_[_0xb1db('0x39')]({},_0x56b477,_0x1c4885[_0xb1db('0x3a')]);return db[_0xb1db('0x3b')][_0xb1db('0x44')](_0x56b477)['then'](handleEntityNotFound(_0x91e305,null))['then'](respondWithResult(_0x91e305,null))['catch'](handleError(_0x91e305,null));};exports['create']=function(_0x5739e8,_0x3e845a){return db[_0xb1db('0x3b')]['create'](_0x5739e8[_0xb1db('0x45')],{})[_0xb1db('0x22')](respondWithResult(_0x3e845a,0xc9))[_0xb1db('0x40')](handleError(_0x3e845a,null));};exports[_0xb1db('0x46')]=function(_0x3a18f0,_0xb99d86){if(_0x3a18f0[_0xb1db('0x45')]['id']){delete _0x3a18f0[_0xb1db('0x45')]['id'];}return db[_0xb1db('0x3b')][_0xb1db('0x44')]({'where':{'id':_0x3a18f0[_0xb1db('0x42')]['id']}})['then'](handleEntityNotFound(_0xb99d86,null))[_0xb1db('0x22')](saveUpdates(_0x3a18f0[_0xb1db('0x45')],null))[_0xb1db('0x22')](respondWithResult(_0xb99d86,null))['catch'](handleError(_0xb99d86,null));};exports['destroy']=function(_0xc4e28c,_0x5f26ce){return db['SugarcrmAccount']['find']({'where':{'id':_0xc4e28c['params']['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0x5f26ce,null))[_0xb1db('0x22')](removeEntity(_0x5f26ce,null))[_0xb1db('0x40')](handleError(_0x5f26ce,null));};exports['getConfigurations']=function(_0x1bc41a,_0x457a2c,_0x3c9f1c){var _0x22d931={};var _0x58abac={};var _0x52469a;var _0x7977cf;return db[_0xb1db('0x3b')]['findOne']({'where':{'id':_0x1bc41a[_0xb1db('0x42')]['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0x457a2c,null))[_0xb1db('0x22')](function(_0x5c9aae){if(_0x5c9aae){_0x52469a=_0x5c9aae;_0x58abac[_0xb1db('0x2c')]=_['keys'](db[_0xb1db('0x47')][_0xb1db('0x28')]);_0x58abac[_0xb1db('0x2d')]=_['keys'](_0x1bc41a['query']);_0x58abac[_0xb1db('0x34')]=_['intersection'](_0x58abac[_0xb1db('0x2c')],_0x58abac[_0xb1db('0x2d')]);_0x22d931[_0xb1db('0x2f')]=_[_0xb1db('0x2e')](_0x58abac['model'],qs['fields'](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x30')]));_0x22d931[_0xb1db('0x2f')]=_0x22d931['attributes'][_0xb1db('0x31')]?_0x22d931['attributes']:_0x58abac[_0xb1db('0x2c')];_0x22d931['order']=qs[_0xb1db('0x48')](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x48')]);_0x22d931[_0xb1db('0x37')]=qs[_0xb1db('0x34')](_['pick'](_0x1bc41a[_0xb1db('0x2d')],_0x58abac[_0xb1db('0x34')]));if(_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x36')]){_0x22d931[_0xb1db('0x37')]=_[_0xb1db('0x39')](_0x22d931['where'],{'$or':_[_0xb1db('0x27')](_0x22d931['attributes'],function(_0x547ab5){var _0x4b5585={};_0x4b5585[_0x547ab5]={'$like':'%'+_0x1bc41a[_0xb1db('0x2d')]['filter']+'%'};return _0x4b5585;})});}_0x22d931=_[_0xb1db('0x39')]({},_0x22d931,_0x1bc41a[_0xb1db('0x3a')]);return _0x52469a[_0xb1db('0x49')](_0x22d931);}})[_0xb1db('0x22')](function(_0x1495d8){if(_0x1495d8){_0x7977cf=_0x1495d8[_0xb1db('0x31')];if(!_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x32')]('nolimit')){_0x22d931[_0xb1db('0x1c')]=qs[_0xb1db('0x1c')](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x1c')]);_0x22d931[_0xb1db('0x1a')]=qs[_0xb1db('0x1a')](_0x1bc41a[_0xb1db('0x2d')][_0xb1db('0x1a')]);}return _0x52469a[_0xb1db('0x49')](_0x22d931);}})[_0xb1db('0x22')](function(_0x5c3437){if(_0x5c3437){return _0x5c3437?{'count':_0x7977cf,'rows':_0x5c3437}:null;}})[_0xb1db('0x22')](respondWithResult(_0x457a2c,null))[_0xb1db('0x40')](handleError(_0x457a2c,null));};exports[_0xb1db('0x4a')]=function(_0x4b38a7,_0x4b8742,_0x3e072a){if(_0x4b38a7[_0xb1db('0x45')]['id']){delete _0x4b38a7[_0xb1db('0x45')]['id'];}return db[_0xb1db('0x3b')][_0xb1db('0x4b')]({'where':{'id':_0x4b38a7[_0xb1db('0x42')]['id']}})[_0xb1db('0x22')](handleEntityNotFound(_0x4b8742,null))[_0xb1db('0x22')](function(_0x4a4a70){if(_0x4a4a70){_0x4b38a7['body'][_0xb1db('0x4c')]=_0x4a4a70['id'];_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x4d')]=integrations[_0xb1db('0x4e')](_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x4f')],_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x2a')]);_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x50')]=integrations[_0xb1db('0x51')](_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x4f')],_0x4b38a7[_0xb1db('0x45')][_0xb1db('0x2a')]);return db[_0xb1db('0x47')]['create'](_0x4b38a7[_0xb1db('0x45')],{'include':[{'model':db['SugarcrmField'],'as':_0xb1db('0x4d')},{'model':db[_0xb1db('0x52')],'as':'Descriptions'}]});}return null;})[_0xb1db('0x22')](respondWithResult(_0x4b8742,null))['catch'](handleError(_0x4b8742,null));};exports[_0xb1db('0x53')]=function(_0x433187,_0x4dc954,_0x565bb5){var _0x5e7839='';var _0x1b9ae0=['id',_0xb1db('0x26'),'assigned_user_id',_0xb1db('0x54'),_0xb1db('0x55'),_0xb1db('0x56'),_0xb1db('0x57'),_0xb1db('0x58'),_0xb1db('0x59'),_0xb1db('0x5a'),'parent_name','direction'];return db[_0xb1db('0x3b')][_0xb1db('0x4b')]({'where':{'id':_0x433187['params']['id']},'attributes':['id',_0xb1db('0x5b'),_0xb1db('0x5c'),_0xb1db('0x5d')]})[_0xb1db('0x22')](handleEntityNotFound(_0x4dc954,null))[_0xb1db('0x22')](function(_0x598951){if(_0x598951){_0x5e7839=_0x598951[_0xb1db('0x5d')];var _0x199d07=_0x5e7839[_0xb1db('0x5e')](-0x1);if(_0x199d07==='/'){_0x5e7839=_0x5e7839['substring'](0x0,_0x5e7839[_0xb1db('0x5f')](_0x199d07));}return rp({'method':_0xb1db('0x60'),'uri':util[_0xb1db('0x61')](_0xb1db('0x62'),_0x5e7839,_0xb1db('0x63')),'json':!![],'form':{'method':_0xb1db('0x64'),'input_type':_0xb1db('0x65'),'response_type':_0xb1db('0x65'),'rest_data':JSON[_0xb1db('0x66')]({'user_auth':{'user_name':_0x598951[_0xb1db('0x5b')],'password':_0x598951[_0xb1db('0x5c')],'encryption':'PLAIN'},'application':_0xb1db('0x67')})}});}})[_0xb1db('0x22')](function(_0x4f4f90){if(_0x4f4f90&&_0x4f4f90[_0xb1db('0x26')]!==_0xb1db('0x68')&&_0x4f4f90['name']!==_0xb1db('0x69')){return rp({'method':_0xb1db('0x60'),'uri':util['format'](_0xb1db('0x62'),_0x5e7839,_0xb1db('0x63')),'json':!![],'form':{'method':_0xb1db('0x6a'),'input_type':_0xb1db('0x65'),'response_type':_0xb1db('0x65'),'rest_data':JSON[_0xb1db('0x66')]({'session':_0x4f4f90['id'],'module_name':_0xb1db('0x6b')})}})[_0xb1db('0x22')](function(_0x1896d9){if(_0x1896d9){var _0x2b09b9=_[_0xb1db('0x6c')](_0x1896d9['module_fields']);_['remove'](_0x2b09b9,function(_0x30b009){return _0x1b9ae0['includes'](_0x30b009[_0xb1db('0x26')]);});return{'count':_0x2b09b9['length'],'rows':_[_0xb1db('0x27')](_0x2b09b9,function(_0x13bbda){return{'id':_0x13bbda[_0xb1db('0x26')],'name':_0x13bbda[_0xb1db('0x6d')],'custom':_[_0xb1db('0x6e')](_0x13bbda['name'],'_c')?!![]:![],'options':_0x13bbda[_0xb1db('0x3a')]?_[_0xb1db('0x27')](_[_0xb1db('0x6c')](_0x13bbda[_0xb1db('0x3a')]),function(_0x2733ee){return{'name':_0x2733ee[_0xb1db('0x6f')],'value':_0x2733ee['name']};}):[]};})};}})[_0xb1db('0x22')](respondWithResult(_0x4dc954,null))[_0xb1db('0x40')](function(_0x4789fe){var _0x588fb4=_0x433187[_0xb1db('0x2d')][_0xb1db('0x70')]?0x1f4:_0x4789fe[_0xb1db('0x71')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb1db('0x53'),_0x588fb4,JSON['stringify'](_0x4789fe));delete _0x4789fe[_0xb1db('0x26')];if(_0x588fb4===0x191){_0x588fb4=0x190;}_0x4dc954[_0xb1db('0x19')](_0x588fb4)[_0xb1db('0x72')](_0x433187['query'][_0xb1db('0x70')]?{'message':_0xb1db('0x73'),'statusCode':_0x4789fe[_0xb1db('0x71')]}:_0x4789fe);});}else{var _0x4c889a=0x1f4;_0x4dc954[_0xb1db('0x19')](_0x4c889a)[_0xb1db('0x72')]({'message':_0xb1db('0x73'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x9601=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmAccount','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','rawAttributes','find','create','body','catch','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','direction','password','remoteUri','slice','substring','POST','format','/service/v4_1/rest.php','login','JSON','PLAIN','Password\x20Expired','%s%s','stringify','Calls','values','remove','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x3ed4c9,_0x335faf){var _0xb7e48f=function(_0x359a45){while(--_0x359a45){_0x3ed4c9['push'](_0x3ed4c9['shift']());}};_0xb7e48f(++_0x335faf);}(_0x9601,0xdb));var _0x1960=function(_0x59067f,_0x2a9104){_0x59067f=_0x59067f-0x0;var _0x3d99b=_0x9601[_0x59067f];return _0x3d99b;};'use strict';var emlformat=require(_0x1960('0x0'));var rimraf=require(_0x1960('0x1'));var zipdir=require(_0x1960('0x2'));var jsonpatch=require(_0x1960('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1960('0x4'));var Mustache=require(_0x1960('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1960('0x6'));var ejs=require(_0x1960('0x7'));var fs=require('fs');var fs_extra=require(_0x1960('0x8'));var _=require('lodash');var squel=require(_0x1960('0x9'));var crypto=require(_0x1960('0xa'));var jsforce=require(_0x1960('0xb'));var deskjs=require(_0x1960('0xc'));var toCsv=require(_0x1960('0x6'));var querystring=require(_0x1960('0xd'));var Papa=require(_0x1960('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1960('0xf'));var as=require(_0x1960('0x10'));var hardwareService=require(_0x1960('0x11'));var logger=require(_0x1960('0x12'))(_0x1960('0x13'));var utils=require(_0x1960('0x14'));var config=require(_0x1960('0x15'));var licenseUtil=require(_0x1960('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x954fd0,_0x1c7dc2){_0x1c7dc2=_0x1c7dc2||0xcc;return function(_0x4d0e74){if(_0x4d0e74){return _0x954fd0[_0x1960('0x17')](_0x1c7dc2);}return _0x954fd0[_0x1960('0x18')](_0x1c7dc2)[_0x1960('0x19')]();};}function respondWithResult(_0x17c789,_0x6cdf4f){_0x6cdf4f=_0x6cdf4f||0xc8;return function(_0x3cdec4){if(_0x3cdec4){return _0x17c789[_0x1960('0x18')](_0x6cdf4f)[_0x1960('0x1a')](_0x3cdec4);}};}function respondWithFilteredResult(_0x95c022,_0x4d879f){return function(_0x38cd74){if(_0x38cd74){var _0x505418=typeof _0x4d879f[_0x1960('0x1b')]===_0x1960('0x1c')&&typeof _0x4d879f[_0x1960('0x1d')]===_0x1960('0x1c');var _0x4ebe89=_0x38cd74[_0x1960('0x1e')];var _0x556515=_0x505418?0x0:_0x4d879f[_0x1960('0x1b')];var _0xb1edaf=_0x505418?_0x38cd74['count']:_0x4d879f[_0x1960('0x1b')]+_0x4d879f[_0x1960('0x1d')];var _0x11e12a;if(_0xb1edaf>=_0x4ebe89){_0xb1edaf=_0x4ebe89;_0x11e12a=0xc8;}else{_0x11e12a=0xce;}_0x95c022[_0x1960('0x18')](_0x11e12a);return _0x95c022['set'](_0x1960('0x1f'),_0x556515+'-'+_0xb1edaf+'/'+_0x4ebe89)[_0x1960('0x1a')](_0x38cd74);}return null;};}function patchUpdates(_0xe6de9){return function(_0x436685){try{jsonpatch['apply'](_0x436685,_0xe6de9,!![]);}catch(_0x194fe5){return BPromise[_0x1960('0x20')](_0x194fe5);}return _0x436685[_0x1960('0x21')]();};}function saveUpdates(_0x31d039,_0x103958){return function(_0x59f1b9){if(_0x59f1b9){return _0x59f1b9[_0x1960('0x22')](_0x31d039)[_0x1960('0x23')](function(_0xb24216){return _0xb24216;});}return null;};}function removeEntity(_0x4dfcac,_0x200ad2){return function(_0x37827c){if(_0x37827c){return _0x37827c[_0x1960('0x24')]()[_0x1960('0x23')](function(){_0x4dfcac[_0x1960('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45371a,_0x48597c){return function(_0x1dd2b6){if(!_0x1dd2b6){_0x45371a[_0x1960('0x17')](0x194);}return _0x1dd2b6;};}function handleError(_0x1aa7cf,_0x23a78b){_0x23a78b=_0x23a78b||0x1f4;return function(_0x37ace3){logger[_0x1960('0x25')](_0x37ace3[_0x1960('0x26')]);if(_0x37ace3[_0x1960('0x27')]){delete _0x37ace3[_0x1960('0x27')];}_0x1aa7cf[_0x1960('0x18')](_0x23a78b)[_0x1960('0x28')](_0x37ace3);};}exports[_0x1960('0x29')]=function(_0x4976bb,_0x553319){var _0x282f54={},_0xb8dab5={},_0x522c62={'count':0x0,'rows':[]};var _0x21921e=_['map'](db[_0x1960('0x2a')]['rawAttributes'],function(_0xe8890b){return{'name':_0xe8890b[_0x1960('0x2b')],'type':_0xe8890b[_0x1960('0x2c')][_0x1960('0x2d')]};});_0xb8dab5[_0x1960('0x2e')]=_[_0x1960('0x2f')](_0x21921e,'name');_0xb8dab5['query']=_[_0x1960('0x30')](_0x4976bb[_0x1960('0x31')]);_0xb8dab5[_0x1960('0x32')]=_['intersection'](_0xb8dab5['model'],_0xb8dab5[_0x1960('0x31')]);_0x282f54[_0x1960('0x33')]=_[_0x1960('0x34')](_0xb8dab5['model'],qs[_0x1960('0x35')](_0x4976bb[_0x1960('0x31')]['fields']));_0x282f54['attributes']=_0x282f54['attributes'][_0x1960('0x36')]?_0x282f54[_0x1960('0x33')]:_0xb8dab5[_0x1960('0x2e')];if(!_0x4976bb[_0x1960('0x31')][_0x1960('0x37')](_0x1960('0x38'))){_0x282f54['limit']=qs[_0x1960('0x1d')](_0x4976bb[_0x1960('0x31')][_0x1960('0x1d')]);_0x282f54[_0x1960('0x1b')]=qs[_0x1960('0x1b')](_0x4976bb[_0x1960('0x31')][_0x1960('0x1b')]);}_0x282f54['order']=qs[_0x1960('0x39')](_0x4976bb[_0x1960('0x31')]['sort']);_0x282f54[_0x1960('0x3a')]=qs[_0x1960('0x32')](_['pick'](_0x4976bb['query'],_0xb8dab5['filters']),_0x21921e);if(_0x4976bb[_0x1960('0x31')]['filter']){_0x282f54[_0x1960('0x3a')]=_[_0x1960('0x3b')](_0x282f54[_0x1960('0x3a')],{'$or':_[_0x1960('0x2f')](_0x21921e,function(_0x28f397){if(_0x28f397[_0x1960('0x2c')]!==_0x1960('0x3c')){var _0x1a6e96={};_0x1a6e96[_0x28f397[_0x1960('0x27')]]={'$like':'%'+_0x4976bb[_0x1960('0x31')][_0x1960('0x3d')]+'%'};return _0x1a6e96;}})});}_0x282f54=_[_0x1960('0x3b')]({},_0x282f54,_0x4976bb[_0x1960('0x3e')]);var _0xde8bc5={'where':_0x282f54[_0x1960('0x3a')]};return db[_0x1960('0x2a')][_0x1960('0x1e')](_0xde8bc5)[_0x1960('0x23')](function(_0x3a72ef){_0x522c62['count']=_0x3a72ef;if(_0x4976bb[_0x1960('0x31')][_0x1960('0x3f')]){_0x282f54[_0x1960('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x282f54);})['then'](function(_0x3d5ef6){_0x522c62[_0x1960('0x41')]=_0x3d5ef6;return _0x522c62;})[_0x1960('0x23')](respondWithFilteredResult(_0x553319,_0x282f54))['catch'](handleError(_0x553319,null));};exports[_0x1960('0x42')]=function(_0x5015fb,_0x4deb41){var _0x2b8e7e={'raw':![],'where':{'id':_0x5015fb['params']['id']}},_0x5f435b={};_0x5f435b[_0x1960('0x2e')]=_[_0x1960('0x30')](db[_0x1960('0x2a')][_0x1960('0x43')]);_0x5f435b[_0x1960('0x31')]=_[_0x1960('0x30')](_0x5015fb[_0x1960('0x31')]);_0x5f435b[_0x1960('0x32')]=_[_0x1960('0x34')](_0x5f435b['model'],_0x5f435b[_0x1960('0x31')]);_0x2b8e7e[_0x1960('0x33')]=_[_0x1960('0x34')](_0x5f435b[_0x1960('0x2e')],qs[_0x1960('0x35')](_0x5015fb[_0x1960('0x31')][_0x1960('0x35')]));_0x2b8e7e[_0x1960('0x33')]=_0x2b8e7e['attributes'][_0x1960('0x36')]?_0x2b8e7e[_0x1960('0x33')]:_0x5f435b['model'];if(_0x5015fb[_0x1960('0x31')]['includeAll']){_0x2b8e7e[_0x1960('0x40')]=[{'all':!![]}];}_0x2b8e7e=_[_0x1960('0x3b')]({},_0x2b8e7e,_0x5015fb[_0x1960('0x3e')]);return db[_0x1960('0x2a')][_0x1960('0x44')](_0x2b8e7e)['then'](handleEntityNotFound(_0x4deb41,null))[_0x1960('0x23')](respondWithResult(_0x4deb41,null))['catch'](handleError(_0x4deb41,null));};exports[_0x1960('0x45')]=function(_0x6550b6,_0x543568){return db[_0x1960('0x2a')]['create'](_0x6550b6[_0x1960('0x46')],{})[_0x1960('0x23')](respondWithResult(_0x543568,0xc9))[_0x1960('0x47')](handleError(_0x543568,null));};exports[_0x1960('0x22')]=function(_0x239553,_0x4f723f){if(_0x239553[_0x1960('0x46')]['id']){delete _0x239553[_0x1960('0x46')]['id'];}return db['SugarcrmAccount'][_0x1960('0x44')]({'where':{'id':_0x239553[_0x1960('0x48')]['id']}})[_0x1960('0x23')](handleEntityNotFound(_0x4f723f,null))[_0x1960('0x23')](saveUpdates(_0x239553['body'],null))[_0x1960('0x23')](respondWithResult(_0x4f723f,null))[_0x1960('0x47')](handleError(_0x4f723f,null));};exports[_0x1960('0x24')]=function(_0x431089,_0x124a05){return db[_0x1960('0x2a')][_0x1960('0x44')]({'where':{'id':_0x431089[_0x1960('0x48')]['id']}})[_0x1960('0x23')](handleEntityNotFound(_0x124a05,null))[_0x1960('0x23')](removeEntity(_0x124a05,null))[_0x1960('0x47')](handleError(_0x124a05,null));};exports[_0x1960('0x49')]=function(_0x259548,_0xdfe121,_0x2659e3){var _0x31117a={};var _0x501e85={};var _0x1310d8;var _0x28a7bd;return db[_0x1960('0x2a')][_0x1960('0x4a')]({'where':{'id':_0x259548[_0x1960('0x48')]['id']}})['then'](handleEntityNotFound(_0xdfe121,null))[_0x1960('0x23')](function(_0xbfc775){if(_0xbfc775){_0x1310d8=_0xbfc775;_0x501e85[_0x1960('0x2e')]=_[_0x1960('0x30')](db[_0x1960('0x4b')][_0x1960('0x43')]);_0x501e85[_0x1960('0x31')]=_[_0x1960('0x30')](_0x259548[_0x1960('0x31')]);_0x501e85[_0x1960('0x32')]=_['intersection'](_0x501e85[_0x1960('0x2e')],_0x501e85[_0x1960('0x31')]);_0x31117a[_0x1960('0x33')]=_[_0x1960('0x34')](_0x501e85['model'],qs[_0x1960('0x35')](_0x259548['query'][_0x1960('0x35')]));_0x31117a['attributes']=_0x31117a[_0x1960('0x33')][_0x1960('0x36')]?_0x31117a[_0x1960('0x33')]:_0x501e85['model'];_0x31117a['order']=qs[_0x1960('0x39')](_0x259548[_0x1960('0x31')]['sort']);_0x31117a['where']=qs[_0x1960('0x32')](_['pick'](_0x259548[_0x1960('0x31')],_0x501e85[_0x1960('0x32')]));if(_0x259548[_0x1960('0x31')][_0x1960('0x3d')]){_0x31117a['where']=_['merge'](_0x31117a[_0x1960('0x3a')],{'$or':_['map'](_0x31117a['attributes'],function(_0x308d8e){var _0x1bcfa7={};_0x1bcfa7[_0x308d8e]={'$like':'%'+_0x259548[_0x1960('0x31')][_0x1960('0x3d')]+'%'};return _0x1bcfa7;})});}_0x31117a=_[_0x1960('0x3b')]({},_0x31117a,_0x259548[_0x1960('0x3e')]);return _0x1310d8[_0x1960('0x49')](_0x31117a);}})[_0x1960('0x23')](function(_0x18d1bd){if(_0x18d1bd){_0x28a7bd=_0x18d1bd[_0x1960('0x36')];if(!_0x259548[_0x1960('0x31')][_0x1960('0x37')](_0x1960('0x38'))){_0x31117a[_0x1960('0x1d')]=qs[_0x1960('0x1d')](_0x259548[_0x1960('0x31')]['limit']);_0x31117a[_0x1960('0x1b')]=qs['offset'](_0x259548['query'][_0x1960('0x1b')]);}return _0x1310d8['getConfigurations'](_0x31117a);}})[_0x1960('0x23')](function(_0x5ba3be){if(_0x5ba3be){return _0x5ba3be?{'count':_0x28a7bd,'rows':_0x5ba3be}:null;}})[_0x1960('0x23')](respondWithResult(_0xdfe121,null))['catch'](handleError(_0xdfe121,null));};exports[_0x1960('0x4c')]=function(_0x57bea0,_0xd6c52,_0x118e1f){if(_0x57bea0[_0x1960('0x46')]['id']){delete _0x57bea0[_0x1960('0x46')]['id'];}return db[_0x1960('0x2a')]['findOne']({'where':{'id':_0x57bea0['params']['id']}})[_0x1960('0x23')](handleEntityNotFound(_0xd6c52,null))['then'](function(_0x53e9ed){if(_0x53e9ed){_0x57bea0['body'][_0x1960('0x4d')]=_0x53e9ed['id'];_0x57bea0[_0x1960('0x46')][_0x1960('0x4e')]=integrations[_0x1960('0x4f')](_0x57bea0[_0x1960('0x46')][_0x1960('0x50')],_0x57bea0['body']['type']);_0x57bea0[_0x1960('0x46')][_0x1960('0x51')]=integrations[_0x1960('0x52')](_0x57bea0[_0x1960('0x46')][_0x1960('0x50')],_0x57bea0[_0x1960('0x46')][_0x1960('0x2c')]);return db[_0x1960('0x4b')][_0x1960('0x45')](_0x57bea0[_0x1960('0x46')],{'include':[{'model':db[_0x1960('0x53')],'as':_0x1960('0x4e')},{'model':db[_0x1960('0x53')],'as':_0x1960('0x51')}]});}return null;})[_0x1960('0x23')](respondWithResult(_0xd6c52,null))[_0x1960('0x47')](handleError(_0xd6c52,null));};exports[_0x1960('0x54')]=function(_0x782846,_0x38d7a6,_0x579153){var _0x40b0f3='';var _0x3c3ff2=['id',_0x1960('0x27'),_0x1960('0x55'),_0x1960('0x56'),_0x1960('0x57'),_0x1960('0x58'),_0x1960('0x59'),'duration_minutes',_0x1960('0x5a'),_0x1960('0x5b'),'parent_name',_0x1960('0x5c')];return db['SugarcrmAccount'][_0x1960('0x4a')]({'where':{'id':_0x782846[_0x1960('0x48')]['id']},'attributes':['id','username',_0x1960('0x5d'),_0x1960('0x5e')]})[_0x1960('0x23')](handleEntityNotFound(_0x38d7a6,null))[_0x1960('0x23')](function(_0xd200f){if(_0xd200f){_0x40b0f3=_0xd200f[_0x1960('0x5e')];var _0x40f07f=_0x40b0f3[_0x1960('0x5f')](-0x1);if(_0x40f07f==='/'){_0x40b0f3=_0x40b0f3[_0x1960('0x60')](0x0,_0x40b0f3['lastIndexOf'](_0x40f07f));}return rp({'method':_0x1960('0x61'),'uri':util[_0x1960('0x62')]('%s%s',_0x40b0f3,_0x1960('0x63')),'json':!![],'form':{'method':_0x1960('0x64'),'input_type':_0x1960('0x65'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0xd200f['username'],'password':_0xd200f['password'],'encryption':_0x1960('0x66')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x19cf4e){if(_0x19cf4e&&_0x19cf4e[_0x1960('0x27')]!=='Invalid\x20Login'&&_0x19cf4e[_0x1960('0x27')]!==_0x1960('0x67')){return rp({'method':_0x1960('0x61'),'uri':util[_0x1960('0x62')](_0x1960('0x68'),_0x40b0f3,_0x1960('0x63')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x1960('0x65'),'response_type':_0x1960('0x65'),'rest_data':JSON[_0x1960('0x69')]({'session':_0x19cf4e['id'],'module_name':_0x1960('0x6a')})}})[_0x1960('0x23')](function(_0x46721e){if(_0x46721e){var _0x1d21c3=_[_0x1960('0x6b')](_0x46721e['module_fields']);_[_0x1960('0x6c')](_0x1d21c3,function(_0x31bf6d){return _0x3c3ff2[_0x1960('0x6d')](_0x31bf6d[_0x1960('0x27')]);});return{'count':_0x1d21c3['length'],'rows':_[_0x1960('0x2f')](_0x1d21c3,function(_0x5e47cb){return{'id':_0x5e47cb[_0x1960('0x27')],'name':_0x5e47cb['label'],'custom':_[_0x1960('0x6e')](_0x5e47cb[_0x1960('0x27')],'_c')?!![]:![],'options':_0x5e47cb[_0x1960('0x3e')]?_[_0x1960('0x2f')](_['values'](_0x5e47cb['options']),function(_0x18a0f4){return{'name':_0x18a0f4[_0x1960('0x6f')],'value':_0x18a0f4['name']};}):[]};})};}})[_0x1960('0x23')](respondWithResult(_0x38d7a6,null))['catch'](function(_0x4f9be4){var _0x550016=_0x782846['query'][_0x1960('0x70')]?0x1f4:_0x4f9be4['statusCode']||0x1f4;logger[_0x1960('0x25')](_0x1960('0x71'),_0x1960('0x54'),_0x550016,JSON[_0x1960('0x69')](_0x4f9be4));delete _0x4f9be4[_0x1960('0x27')];if(_0x550016===0x191){_0x550016=0x190;}_0x38d7a6[_0x1960('0x18')](_0x550016)[_0x1960('0x28')](_0x782846[_0x1960('0x31')][_0x1960('0x70')]?{'message':_0x1960('0x72'),'statusCode':_0x4f9be4[_0x1960('0x73')]}:_0x4f9be4);});}else{var _0xab543b=0x1f4;_0x38d7a6[_0x1960('0x18')](_0xab543b)[_0x1960('0x28')]({'message':_0x1960('0x72'),'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 ae49251..4364a04 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 _0xef35=['moment','bluebird','../../config/environment','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger'];(function(_0x11ee99,_0xa743ed){var _0x469072=function(_0xdaef8){while(--_0xdaef8){_0x11ee99['push'](_0x11ee99['shift']());}};_0x469072(++_0xa743ed);}(_0xef35,0xa8));var _0x5ef3=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xef35[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x5ef3('0x0'));var util=require(_0x5ef3('0x1'));var logger=require(_0x5ef3('0x2'))('api');var moment=require(_0x5ef3('0x3'));var BPromise=require(_0x5ef3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ef3('0x5'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x5ef3('0x6'));module[_0x5ef3('0x7')]=function(_0xffaa70,_0x4b3014){return _0xffaa70[_0x5ef3('0x8')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47d6=['../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x2f543d,_0x33d2a6){var _0x11e844=function(_0x29880a){while(--_0x29880a){_0x2f543d['push'](_0x2f543d['shift']());}};_0x11e844(++_0x33d2a6);}(_0x47d6,0x13f));var _0x647d=function(_0x3dc0d3,_0x5750c3){_0x3dc0d3=_0x3dc0d3-0x0;var _0x5954c0=_0x47d6[_0x3dc0d3];return _0x5954c0;};'use strict';var _=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var logger=require(_0x647d('0x2'))(_0x647d('0x3'));var moment=require(_0x647d('0x4'));var BPromise=require(_0x647d('0x5'));var rp=require(_0x647d('0x6'));var fs=require('fs');var path=require(_0x647d('0x7'));var rimraf=require(_0x647d('0x8'));var config=require(_0x647d('0x9'));var attributes=require(_0x647d('0xa'));var integrations=require(_0x647d('0xb'));module[_0x647d('0xc')]=function(_0x8ffe2b,_0x1db1db){return _0x8ffe2b[_0x647d('0xd')]('SugarcrmAccount',attributes,{'tableName':_0x647d('0xe'),'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 2ea076d..abc342c 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 _0xce11=['raw','where','attributes','limit','include','map','model','stringify','ShowSugarcrmAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x139089,_0x4339ce){var _0x5a724d=function(_0x4371b4){while(--_0x4371b4){_0x139089['push'](_0x139089['shift']());}};_0x5a724d(++_0x4339ce);}(_0xce11,0x73));var _0x1ce1=function(_0x3d462b,_0x64d0c2){_0x3d462b=_0x3d462b-0x0;var _0x29546a=_0xce11[_0x3d462b];return _0x29546a;};'use strict';var _=require(_0x1ce1('0x0'));var util=require('util');var moment=require(_0x1ce1('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ce1('0x2'));var fs=require('fs');var Redis=require(_0x1ce1('0x3'));var db=require(_0x1ce1('0x4'))['db'];var utils=require(_0x1ce1('0x5'));var logger=require(_0x1ce1('0x6'))(_0x1ce1('0x7'));var config=require(_0x1ce1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ce1('0x9')][_0x1ce1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eb9d1,_0x245c8d,_0x32d48a){return new BPromise(function(_0x5bf803,_0x108ab0){return client[_0x1ce1('0xb')](_0x2eb9d1,_0x32d48a)[_0x1ce1('0xc')](function(_0x3660f6){logger[_0x1ce1('0xd')](_0x1ce1('0xe'),_0x245c8d,_0x1ce1('0xf'));logger[_0x1ce1('0x10')](_0x1ce1('0x11'),_0x245c8d,_0x1ce1('0xf'),JSON['stringify'](_0x3660f6));if(_0x3660f6[_0x1ce1('0x12')]){if(_0x3660f6['error']['code']===0x1f4){logger['error'](_0x1ce1('0xe'),_0x245c8d,_0x3660f6[_0x1ce1('0x12')][_0x1ce1('0x13')]);return _0x108ab0(_0x3660f6[_0x1ce1('0x12')][_0x1ce1('0x13')]);}logger[_0x1ce1('0x12')](_0x1ce1('0xe'),_0x245c8d,_0x3660f6[_0x1ce1('0x12')][_0x1ce1('0x13')]);return _0x5bf803(_0x3660f6[_0x1ce1('0x12')]['message']);}else{logger[_0x1ce1('0xd')](_0x1ce1('0xe'),_0x245c8d,_0x1ce1('0xf'));_0x5bf803(_0x3660f6['result']['message']);}})[_0x1ce1('0x14')](function(_0x20f305){logger[_0x1ce1('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x245c8d,_0x20f305);_0x108ab0(_0x20f305);});});}exports[_0x1ce1('0x15')]=function(_0x5a5897){var _0x112701=this;return new Promise(function(_0x3ac57d,_0x2bffac){return db[_0x1ce1('0x16')][_0x1ce1('0x17')]({'raw':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897[_0x1ce1('0x18')][_0x1ce1('0x19')]===undefined?!![]:![]:!![],'where':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897['options'][_0x1ce1('0x1a')]||null:null,'attributes':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897[_0x1ce1('0x18')][_0x1ce1('0x1b')]||null:null,'limit':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897[_0x1ce1('0x18')][_0x1ce1('0x1c')]||null:null,'include':_0x5a5897[_0x1ce1('0x18')]?_0x5a5897['options'][_0x1ce1('0x1d')]?_[_0x1ce1('0x1e')](_0x5a5897[_0x1ce1('0x18')]['include'],function(_0x45bcbb){return{'model':db[_0x45bcbb[_0x1ce1('0x1f')]],'as':_0x45bcbb['as'],'attributes':_0x45bcbb[_0x1ce1('0x1b')],'include':_0x45bcbb[_0x1ce1('0x1d')]?_['map'](_0x45bcbb[_0x1ce1('0x1d')],function(_0x4c22e8){return{'model':db[_0x4c22e8[_0x1ce1('0x1f')]],'as':_0x4c22e8['as'],'attributes':_0x4c22e8[_0x1ce1('0x1b')],'include':_0x4c22e8['include']?_['map'](_0x4c22e8[_0x1ce1('0x1d')],function(_0x13c18d){return{'model':db[_0x13c18d[_0x1ce1('0x1f')]],'as':_0x13c18d['as'],'attributes':_0x13c18d[_0x1ce1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1ce1('0xc')](function(_0x735916){logger['info'](_0x1ce1('0x15'),_0x5a5897);logger[_0x1ce1('0x10')](_0x1ce1('0x15'),_0x5a5897,JSON[_0x1ce1('0x20')](_0x735916));_0x3ac57d(_0x735916);})[_0x1ce1('0x14')](function(_0x2289dd){logger['error'](_0x1ce1('0x15'),_0x2289dd[_0x1ce1('0x13')],_0x5a5897);_0x2bffac(_0x112701[_0x1ce1('0x12')](0x1f4,_0x2289dd[_0x1ce1('0x13')]));});});};exports[_0x1ce1('0x21')]=function(_0x4f1fa5){var _0xa1a993=this;return new Promise(function(_0x11e9e3,_0x4cdaf6){return db['SugarcrmAccount'][_0x1ce1('0x22')]({'raw':_0x4f1fa5['options']?_0x4f1fa5[_0x1ce1('0x18')][_0x1ce1('0x19')]===undefined?!![]:![]:!![],'where':_0x4f1fa5[_0x1ce1('0x18')]?_0x4f1fa5['options'][_0x1ce1('0x1a')]||null:null,'attributes':_0x4f1fa5[_0x1ce1('0x18')]?_0x4f1fa5[_0x1ce1('0x18')][_0x1ce1('0x1b')]||null:null,'include':_0x4f1fa5['options']?_0x4f1fa5[_0x1ce1('0x18')]['include']?_[_0x1ce1('0x1e')](_0x4f1fa5['options'][_0x1ce1('0x1d')],function(_0x56a52e){return{'model':db[_0x56a52e[_0x1ce1('0x1f')]],'as':_0x56a52e['as'],'attributes':_0x56a52e[_0x1ce1('0x1b')],'include':_0x56a52e[_0x1ce1('0x1d')]?_[_0x1ce1('0x1e')](_0x56a52e[_0x1ce1('0x1d')],function(_0x1ac916){return{'model':db[_0x1ac916[_0x1ce1('0x1f')]],'as':_0x1ac916['as'],'attributes':_0x1ac916[_0x1ce1('0x1b')],'include':_0x1ac916[_0x1ce1('0x1d')]?_[_0x1ce1('0x1e')](_0x1ac916[_0x1ce1('0x1d')],function(_0x497226){return{'model':db[_0x497226[_0x1ce1('0x1f')]],'as':_0x497226['as'],'attributes':_0x497226['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ce1('0xc')](function(_0x5f0ad6){logger['info'](_0x1ce1('0x21'),_0x4f1fa5);logger[_0x1ce1('0x10')](_0x1ce1('0x21'),_0x4f1fa5,JSON['stringify'](_0x5f0ad6));_0x11e9e3(_0x5f0ad6);})['catch'](function(_0xddf5c6){logger['error'](_0x1ce1('0x21'),_0xddf5c6['message'],_0x4f1fa5);_0x4cdaf6(_0xa1a993['error'](0x1f4,_0xddf5c6[_0x1ce1('0x13')]));});});}; \ No newline at end of file +var _0x072b=['map','stringify','ShowSugarcrmAccount','raw','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','SugarcrmAccount','findAll','options','attributes','limit','include','model'];(function(_0x2c24de,_0x1ce122){var _0x4d32f3=function(_0x288c4a){while(--_0x288c4a){_0x2c24de['push'](_0x2c24de['shift']());}};_0x4d32f3(++_0x1ce122);}(_0x072b,0x116));var _0xb072=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x072b[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0xb072('0x0'));var util=require(_0xb072('0x1'));var moment=require(_0xb072('0x2'));var BPromise=require(_0xb072('0x3'));var rs=require(_0xb072('0x4'));var fs=require('fs');var Redis=require(_0xb072('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb072('0x6'));var logger=require(_0xb072('0x7'))(_0xb072('0x8'));var config=require(_0xb072('0x9'));var jayson=require(_0xb072('0xa'));var client=jayson[_0xb072('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32b637,_0x30b0c4,_0x2efa74){return new BPromise(function(_0x59ca88,_0x28c0d3){return client['request'](_0x32b637,_0x2efa74)['then'](function(_0x3812f6){logger[_0xb072('0xc')](_0xb072('0xd'),_0x30b0c4,'request\x20sent');logger[_0xb072('0xe')](_0xb072('0xf'),_0x30b0c4,_0xb072('0x10'),JSON['stringify'](_0x3812f6));if(_0x3812f6[_0xb072('0x11')]){if(_0x3812f6[_0xb072('0x11')]['code']===0x1f4){logger[_0xb072('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x30b0c4,_0x3812f6[_0xb072('0x11')]['message']);return _0x28c0d3(_0x3812f6['error'][_0xb072('0x12')]);}logger[_0xb072('0x11')](_0xb072('0xd'),_0x30b0c4,_0x3812f6[_0xb072('0x11')]['message']);return _0x59ca88(_0x3812f6[_0xb072('0x11')][_0xb072('0x12')]);}else{logger[_0xb072('0xc')](_0xb072('0xd'),_0x30b0c4,_0xb072('0x10'));_0x59ca88(_0x3812f6[_0xb072('0x13')][_0xb072('0x12')]);}})[_0xb072('0x14')](function(_0x4b8c1a){logger[_0xb072('0x11')](_0xb072('0xd'),_0x30b0c4,_0x4b8c1a);_0x28c0d3(_0x4b8c1a);});});}exports['GetSugarcrmAccount']=function(_0x2db23f){var _0x40a1b4=this;return new Promise(function(_0x398ee3,_0x32f2be){return db[_0xb072('0x15')][_0xb072('0x16')]({'raw':_0x2db23f['options']?_0x2db23f[_0xb072('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2db23f[_0xb072('0x17')]?_0x2db23f[_0xb072('0x17')]['where']||null:null,'attributes':_0x2db23f[_0xb072('0x17')]?_0x2db23f[_0xb072('0x17')][_0xb072('0x18')]||null:null,'limit':_0x2db23f[_0xb072('0x17')]?_0x2db23f[_0xb072('0x17')][_0xb072('0x19')]||null:null,'include':_0x2db23f[_0xb072('0x17')]?_0x2db23f[_0xb072('0x17')][_0xb072('0x1a')]?_['map'](_0x2db23f[_0xb072('0x17')][_0xb072('0x1a')],function(_0x1bbe06){return{'model':db[_0x1bbe06[_0xb072('0x1b')]],'as':_0x1bbe06['as'],'attributes':_0x1bbe06[_0xb072('0x18')],'include':_0x1bbe06[_0xb072('0x1a')]?_[_0xb072('0x1c')](_0x1bbe06[_0xb072('0x1a')],function(_0x34d4fa){return{'model':db[_0x34d4fa[_0xb072('0x1b')]],'as':_0x34d4fa['as'],'attributes':_0x34d4fa[_0xb072('0x18')],'include':_0x34d4fa[_0xb072('0x1a')]?_[_0xb072('0x1c')](_0x34d4fa[_0xb072('0x1a')],function(_0x51ec57){return{'model':db[_0x51ec57[_0xb072('0x1b')]],'as':_0x51ec57['as'],'attributes':_0x51ec57[_0xb072('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21bc4e){logger[_0xb072('0xc')]('GetSugarcrmAccount',_0x2db23f);logger[_0xb072('0xe')]('GetSugarcrmAccount',_0x2db23f,JSON[_0xb072('0x1d')](_0x21bc4e));_0x398ee3(_0x21bc4e);})['catch'](function(_0x3fd621){logger[_0xb072('0x11')]('GetSugarcrmAccount',_0x3fd621['message'],_0x2db23f);_0x32f2be(_0x40a1b4[_0xb072('0x11')](0x1f4,_0x3fd621[_0xb072('0x12')]));});});};exports[_0xb072('0x1e')]=function(_0x311e36){var _0x5ccea5=this;return new Promise(function(_0x19b318,_0x2c22d3){return db[_0xb072('0x15')]['find']({'raw':_0x311e36[_0xb072('0x17')]?_0x311e36[_0xb072('0x17')][_0xb072('0x1f')]===undefined?!![]:![]:!![],'where':_0x311e36[_0xb072('0x17')]?_0x311e36[_0xb072('0x17')][_0xb072('0x20')]||null:null,'attributes':_0x311e36[_0xb072('0x17')]?_0x311e36[_0xb072('0x17')][_0xb072('0x18')]||null:null,'include':_0x311e36[_0xb072('0x17')]?_0x311e36['options'][_0xb072('0x1a')]?_['map'](_0x311e36[_0xb072('0x17')][_0xb072('0x1a')],function(_0xc38bba){return{'model':db[_0xc38bba['model']],'as':_0xc38bba['as'],'attributes':_0xc38bba[_0xb072('0x18')],'include':_0xc38bba[_0xb072('0x1a')]?_['map'](_0xc38bba['include'],function(_0x5f58eb){return{'model':db[_0x5f58eb['model']],'as':_0x5f58eb['as'],'attributes':_0x5f58eb[_0xb072('0x18')],'include':_0x5f58eb[_0xb072('0x1a')]?_[_0xb072('0x1c')](_0x5f58eb[_0xb072('0x1a')],function(_0x2e5813){return{'model':db[_0x2e5813[_0xb072('0x1b')]],'as':_0x2e5813['as'],'attributes':_0x2e5813[_0xb072('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb072('0x21')](function(_0x56e13c){logger[_0xb072('0xc')](_0xb072('0x1e'),_0x311e36);logger[_0xb072('0xe')](_0xb072('0x1e'),_0x311e36,JSON[_0xb072('0x1d')](_0x56e13c));_0x19b318(_0x56e13c);})[_0xb072('0x14')](function(_0x595738){logger[_0xb072('0x11')](_0xb072('0x1e'),_0x595738[_0xb072('0x12')],_0x311e36);_0x2c22d3(_0x5ccea5['error'](0x1f4,_0x595738[_0xb072('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 5271caf..578ebbc 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 _0x52cd=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','destroy','exports'];(function(_0x40372f,_0x54574a){var _0x5cc1b8=function(_0x3a1c0c){while(--_0x3a1c0c){_0x40372f['push'](_0x40372f['shift']());}};_0x5cc1b8(++_0x54574a);}(_0x52cd,0x1e0));var _0xd52c=function(_0xdad321,_0x43f77b){_0xdad321=_0xdad321-0x0;var _0x559d84=_0x52cd[_0xdad321];return _0x559d84;};'use strict';var multer=require('multer');var util=require(_0xd52c('0x0'));var path=require(_0xd52c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd52c('0x2')]();var fs_extra=require(_0xd52c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd52c('0x4'));var config=require(_0xd52c('0x5'));var controller=require(_0xd52c('0x6'));router[_0xd52c('0x7')]('/',auth['isAuthenticated'](),controller[_0xd52c('0x8')]);router['get'](_0xd52c('0x9'),auth[_0xd52c('0xa')](),controller['show']);router[_0xd52c('0x7')](_0xd52c('0xb'),auth[_0xd52c('0xa')](),controller['getFields']);router[_0xd52c('0x7')](_0xd52c('0xc'),auth[_0xd52c('0xa')](),controller[_0xd52c('0xd')]);router[_0xd52c('0x7')](_0xd52c('0xe'),auth[_0xd52c('0xa')](),controller[_0xd52c('0xf')]);router[_0xd52c('0x10')]('/',auth[_0xd52c('0xa')](),controller[_0xd52c('0x11')]);router['put'](_0xd52c('0x9'),auth[_0xd52c('0xa')](),controller['update']);router['delete'](_0xd52c('0x9'),auth['isAuthenticated'](),controller[_0xd52c('0x12')]);module[_0xd52c('0x13')]=router; \ No newline at end of file +var _0x10b8=['/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x10b8,0x17c));var _0x810b=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x10b8[_0x4b73a2];return _0x383c66;};'use strict';var multer=require(_0x810b('0x0'));var util=require(_0x810b('0x1'));var path=require(_0x810b('0x2'));var timeout=require(_0x810b('0x3'));var express=require(_0x810b('0x4'));var router=express[_0x810b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x810b('0x6'));var interaction=require(_0x810b('0x7'));var config=require(_0x810b('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x810b('0x9')]('/',auth[_0x810b('0xa')](),controller['index']);router[_0x810b('0x9')]('/:id',auth[_0x810b('0xa')](),controller['show']);router[_0x810b('0x9')](_0x810b('0xb'),auth[_0x810b('0xa')](),controller['getFields']);router['get'](_0x810b('0xc'),auth[_0x810b('0xa')](),controller[_0x810b('0xd')]);router[_0x810b('0x9')](_0x810b('0xe'),auth[_0x810b('0xa')](),controller[_0x810b('0xf')]);router[_0x810b('0x10')]('/',auth[_0x810b('0xa')](),controller[_0x810b('0x11')]);router[_0x810b('0x12')](_0x810b('0x13'),auth[_0x810b('0xa')](),controller[_0x810b('0x14')]);router[_0x810b('0x15')](_0x810b('0x13'),auth[_0x810b('0xa')](),controller[_0x810b('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 903d9ce..df16132 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58a0=['sequelize','exports','STRING'];(function(_0xbc5d3f,_0x4fd0b7){var _0x75de9f=function(_0xbe7e0d){while(--_0xbe7e0d){_0xbc5d3f['push'](_0xbc5d3f['shift']());}};_0x75de9f(++_0x4fd0b7);}(_0x58a0,0x18c));var _0x058a=function(_0x1d4c33,_0x30274f){_0x1d4c33=_0x1d4c33-0x0;var _0x3abfa2=_0x58a0[_0x1d4c33];return _0x3abfa2;};'use strict';var Sequelize=require(_0x058a('0x0'));module[_0x058a('0x1')]={'name':{'type':Sequelize[_0x058a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xadbf=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadbf,0xd0));var _0xfadb=function(_0x545aeb,_0x52b85d){_0x545aeb=_0x545aeb-0x0;var _0x5807c8=_0xadbf[_0x545aeb];return _0x5807c8;};'use strict';var Sequelize=require(_0xfadb('0x0'));module[_0xfadb('0x1')]={'name':{'type':Sequelize[_0xfadb('0x2')]},'description':{'type':Sequelize[_0xfadb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 1bcd9d6..507d09b 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 _0xcc7a=['pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','getFields','findOne','SugarcrmField','options','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x119ef2,_0x46d595){var _0x90a833=function(_0x8ca83){while(--_0x8ca83){_0x119ef2['push'](_0x119ef2['shift']());}};_0x90a833(++_0x46d595);}(_0xcc7a,0x67));var _0xacc7=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xcc7a[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0xacc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xacc7('0x1'));var jsonpatch=require(_0xacc7('0x2'));var rp=require(_0xacc7('0x3'));var moment=require(_0xacc7('0x4'));var BPromise=require(_0xacc7('0x5'));var Mustache=require(_0xacc7('0x6'));var util=require(_0xacc7('0x7'));var path=require(_0xacc7('0x8'));var sox=require(_0xacc7('0x9'));var csv=require(_0xacc7('0xa'));var ejs=require(_0xacc7('0xb'));var fs=require('fs');var fs_extra=require(_0xacc7('0xc'));var _=require(_0xacc7('0xd'));var squel=require(_0xacc7('0xe'));var crypto=require(_0xacc7('0xf'));var jsforce=require(_0xacc7('0x10'));var deskjs=require(_0xacc7('0x11'));var toCsv=require('to-csv');var querystring=require(_0xacc7('0x12'));var Papa=require(_0xacc7('0x13'));var Redis=require(_0xacc7('0x14'));var authService=require(_0xacc7('0x15'));var qs=require(_0xacc7('0x16'));var as=require(_0xacc7('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xacc7('0x18'));var utils=require('../../config/utils');var config=require(_0xacc7('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef527,_0x1b8fb2){_0x1b8fb2=_0x1b8fb2||0xcc;return function(_0x158bc8){if(_0x158bc8){return _0x1ef527[_0xacc7('0x1a')](_0x1b8fb2);}return _0x1ef527[_0xacc7('0x1b')](_0x1b8fb2)[_0xacc7('0x1c')]();};}function respondWithResult(_0x5f4baa,_0x3351ad){_0x3351ad=_0x3351ad||0xc8;return function(_0x55f9a0){if(_0x55f9a0){return _0x5f4baa[_0xacc7('0x1b')](_0x3351ad)['json'](_0x55f9a0);}};}function respondWithFilteredResult(_0x521cf2,_0x3b2461){return function(_0x4c0ebd){if(_0x4c0ebd){var _0x1afbb2=typeof _0x3b2461[_0xacc7('0x1d')]===_0xacc7('0x1e')&&typeof _0x3b2461[_0xacc7('0x1f')]==='undefined';var _0x1e8434=_0x4c0ebd[_0xacc7('0x20')];var _0x371677=_0x1afbb2?0x0:_0x3b2461[_0xacc7('0x1d')];var _0x573428=_0x1afbb2?_0x4c0ebd['count']:_0x3b2461['offset']+_0x3b2461[_0xacc7('0x1f')];var _0x24cb11;if(_0x573428>=_0x1e8434){_0x573428=_0x1e8434;_0x24cb11=0xc8;}else{_0x24cb11=0xce;}_0x521cf2[_0xacc7('0x1b')](_0x24cb11);return _0x521cf2[_0xacc7('0x21')](_0xacc7('0x22'),_0x371677+'-'+_0x573428+'/'+_0x1e8434)[_0xacc7('0x23')](_0x4c0ebd);}return null;};}function patchUpdates(_0x46e7fc){return function(_0x1379ba){try{jsonpatch['apply'](_0x1379ba,_0x46e7fc,!![]);}catch(_0x44bdc4){return BPromise[_0xacc7('0x24')](_0x44bdc4);}return _0x1379ba[_0xacc7('0x25')]();};}function saveUpdates(_0x39f1de,_0x2b3276){return function(_0x9d3867){if(_0x9d3867){return _0x9d3867[_0xacc7('0x26')](_0x39f1de)[_0xacc7('0x27')](function(_0x1b82a0){return _0x1b82a0;});}return null;};}function removeEntity(_0x3723c0,_0x20ee48){return function(_0x51425d){if(_0x51425d){return _0x51425d['destroy']()[_0xacc7('0x27')](function(){_0x3723c0[_0xacc7('0x1b')](0xcc)[_0xacc7('0x1c')]();});}};}function handleEntityNotFound(_0xea0218,_0x54627a){return function(_0x31e47d){if(!_0x31e47d){_0xea0218[_0xacc7('0x1a')](0x194);}return _0x31e47d;};}function handleError(_0x403327,_0x247f2c){_0x247f2c=_0x247f2c||0x1f4;return function(_0x406c21){logger[_0xacc7('0x28')](_0x406c21[_0xacc7('0x29')]);if(_0x406c21[_0xacc7('0x2a')]){delete _0x406c21[_0xacc7('0x2a')];}_0x403327[_0xacc7('0x1b')](_0x247f2c)[_0xacc7('0x2b')](_0x406c21);};}exports[_0xacc7('0x2c')]=function(_0x3e5a22,_0x21fc6b){var _0x1f8fdc={},_0xe2072b={},_0x3d6eeb={'count':0x0,'rows':[]};var _0x2aa9cd=_['map'](db[_0xacc7('0x2d')][_0xacc7('0x2e')],function(_0x1213c5){return{'name':_0x1213c5[_0xacc7('0x2f')],'type':_0x1213c5['type'][_0xacc7('0x30')]};});_0xe2072b['model']=_[_0xacc7('0x31')](_0x2aa9cd,'name');_0xe2072b[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0x3e5a22[_0xacc7('0x32')]);_0xe2072b[_0xacc7('0x34')]=_['intersection'](_0xe2072b[_0xacc7('0x35')],_0xe2072b[_0xacc7('0x32')]);_0x1f8fdc[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0xe2072b[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x38')]));_0x1f8fdc[_0xacc7('0x36')]=_0x1f8fdc[_0xacc7('0x36')][_0xacc7('0x39')]?_0x1f8fdc[_0xacc7('0x36')]:_0xe2072b[_0xacc7('0x35')];if(!_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x3a')](_0xacc7('0x3b'))){_0x1f8fdc[_0xacc7('0x1f')]=qs[_0xacc7('0x1f')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x1f')]);_0x1f8fdc[_0xacc7('0x1d')]=qs[_0xacc7('0x1d')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x1d')]);}_0x1f8fdc[_0xacc7('0x3c')]=qs[_0xacc7('0x3d')](_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x3d')]);_0x1f8fdc[_0xacc7('0x3e')]=qs['filters'](_[_0xacc7('0x3f')](_0x3e5a22[_0xacc7('0x32')],_0xe2072b[_0xacc7('0x34')]),_0x2aa9cd);if(_0x3e5a22['query'][_0xacc7('0x40')]){_0x1f8fdc[_0xacc7('0x3e')]=_[_0xacc7('0x41')](_0x1f8fdc[_0xacc7('0x3e')],{'$or':_['map'](_0x2aa9cd,function(_0x1b0f4){if(_0x1b0f4[_0xacc7('0x42')]!=='VIRTUAL'){var _0xccd48d={};_0xccd48d[_0x1b0f4[_0xacc7('0x2a')]]={'$like':'%'+_0x3e5a22['query'][_0xacc7('0x40')]+'%'};return _0xccd48d;}})});}_0x1f8fdc=_[_0xacc7('0x41')]({},_0x1f8fdc,_0x3e5a22['options']);var _0x92408b={'where':_0x1f8fdc[_0xacc7('0x3e')]};return db[_0xacc7('0x2d')][_0xacc7('0x20')](_0x92408b)['then'](function(_0x3b6b9f){_0x3d6eeb[_0xacc7('0x20')]=_0x3b6b9f;if(_0x3e5a22[_0xacc7('0x32')][_0xacc7('0x43')]){_0x1f8fdc[_0xacc7('0x44')]=[{'all':!![]}];}return db[_0xacc7('0x2d')][_0xacc7('0x45')](_0x1f8fdc);})[_0xacc7('0x27')](function(_0x503fd5){_0x3d6eeb[_0xacc7('0x46')]=_0x503fd5;return _0x3d6eeb;})[_0xacc7('0x27')](respondWithFilteredResult(_0x21fc6b,_0x1f8fdc))[_0xacc7('0x47')](handleError(_0x21fc6b,null));};exports[_0xacc7('0x48')]=function(_0x3af478,_0x1a3e0f){var _0x4479dd={'raw':![],'where':{'id':_0x3af478[_0xacc7('0x49')]['id']}},_0x130231={};_0x130231[_0xacc7('0x35')]=_['keys'](db['SugarcrmConfiguration']['rawAttributes']);_0x130231[_0xacc7('0x32')]=_['keys'](_0x3af478['query']);_0x130231[_0xacc7('0x34')]=_[_0xacc7('0x37')](_0x130231['model'],_0x130231[_0xacc7('0x32')]);_0x4479dd[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0x130231[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x3af478[_0xacc7('0x32')][_0xacc7('0x38')]));_0x4479dd[_0xacc7('0x36')]=_0x4479dd['attributes'][_0xacc7('0x39')]?_0x4479dd[_0xacc7('0x36')]:_0x130231[_0xacc7('0x35')];if(_0x3af478[_0xacc7('0x32')][_0xacc7('0x43')]){_0x4479dd[_0xacc7('0x44')]=[{'all':!![]}];}_0x4479dd=_['merge']({},_0x4479dd,_0x3af478['options']);return db[_0xacc7('0x2d')][_0xacc7('0x4a')](_0x4479dd)['then'](handleEntityNotFound(_0x1a3e0f,null))[_0xacc7('0x27')](respondWithResult(_0x1a3e0f,null))[_0xacc7('0x47')](handleError(_0x1a3e0f,null));};exports['create']=function(_0x50d672,_0x34fcac){return db[_0xacc7('0x2d')]['create'](_0x50d672[_0xacc7('0x4b')],{})['then'](respondWithResult(_0x34fcac,0xc9))[_0xacc7('0x47')](handleError(_0x34fcac,null));};exports[_0xacc7('0x26')]=function(_0x899b26,_0x25795a){if(_0x899b26[_0xacc7('0x4b')]['id']){delete _0x899b26[_0xacc7('0x4b')]['id'];}return db[_0xacc7('0x2d')][_0xacc7('0x4a')]({'where':{'id':_0x899b26[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0x25795a,null))[_0xacc7('0x27')](saveUpdates(_0x899b26[_0xacc7('0x4b')],null))['then'](respondWithResult(_0x25795a,null))[_0xacc7('0x47')](handleError(_0x25795a,null));};exports[_0xacc7('0x4c')]=function(_0x443675,_0x5bc079){return db[_0xacc7('0x2d')][_0xacc7('0x4a')]({'where':{'id':_0x443675[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0x5bc079,null))['then'](removeEntity(_0x5bc079,null))[_0xacc7('0x47')](handleError(_0x5bc079,null));};exports[_0xacc7('0x4d')]=function(_0xb2dff9,_0xc3b6f7,_0x29c913){var _0x57ddad={};var _0x3c1be0={};var _0x359799;var _0x556022;return db[_0xacc7('0x2d')][_0xacc7('0x4e')]({'where':{'id':_0xb2dff9[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0xc3b6f7,null))[_0xacc7('0x27')](function(_0x4219e1){if(_0x4219e1){_0x359799=_0x4219e1;_0x3c1be0[_0xacc7('0x35')]=_[_0xacc7('0x33')](db[_0xacc7('0x4f')][_0xacc7('0x2e')]);_0x3c1be0[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0xb2dff9[_0xacc7('0x32')]);_0x3c1be0[_0xacc7('0x34')]=_[_0xacc7('0x37')](_0x3c1be0[_0xacc7('0x35')],_0x3c1be0[_0xacc7('0x32')]);_0x57ddad[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0x3c1be0['model'],qs['fields'](_0xb2dff9[_0xacc7('0x32')][_0xacc7('0x38')]));_0x57ddad[_0xacc7('0x36')]=_0x57ddad[_0xacc7('0x36')][_0xacc7('0x39')]?_0x57ddad[_0xacc7('0x36')]:_0x3c1be0[_0xacc7('0x35')];_0x57ddad[_0xacc7('0x3c')]=qs['sort'](_0xb2dff9['query'][_0xacc7('0x3d')]);_0x57ddad[_0xacc7('0x3e')]=qs[_0xacc7('0x34')](_[_0xacc7('0x3f')](_0xb2dff9[_0xacc7('0x32')],_0x3c1be0['filters']));if(_0xb2dff9['query'][_0xacc7('0x40')]){_0x57ddad[_0xacc7('0x3e')]=_[_0xacc7('0x41')](_0x57ddad['where'],{'$or':_[_0xacc7('0x31')](_0x57ddad['attributes'],function(_0x48ac9d){var _0x289626={};_0x289626[_0x48ac9d]={'$like':'%'+_0xb2dff9['query'][_0xacc7('0x40')]+'%'};return _0x289626;})});}_0x57ddad=_[_0xacc7('0x41')]({},_0x57ddad,_0xb2dff9[_0xacc7('0x50')]);return _0x359799['getFields'](_0x57ddad);}})[_0xacc7('0x27')](function(_0xb83c6f){if(_0xb83c6f){_0x556022=_0xb83c6f[_0xacc7('0x39')];if(!_0xb2dff9['query'][_0xacc7('0x3a')](_0xacc7('0x3b'))){_0x57ddad[_0xacc7('0x1f')]=qs[_0xacc7('0x1f')](_0xb2dff9[_0xacc7('0x32')][_0xacc7('0x1f')]);_0x57ddad[_0xacc7('0x1d')]=qs[_0xacc7('0x1d')](_0xb2dff9[_0xacc7('0x32')][_0xacc7('0x1d')]);}return _0x359799[_0xacc7('0x4d')](_0x57ddad);}})[_0xacc7('0x27')](function(_0x3fe0f5){if(_0x3fe0f5){return _0x3fe0f5?{'count':_0x556022,'rows':_0x3fe0f5}:null;}})['then'](respondWithResult(_0xc3b6f7,null))[_0xacc7('0x47')](handleError(_0xc3b6f7,null));};exports['getSubjects']=function(_0x33bcf8,_0xb68854,_0x689fae){var _0x1952e3={};var _0x58dfb4={};var _0x5edcca;var _0x5694ba;return db[_0xacc7('0x2d')][_0xacc7('0x4e')]({'where':{'id':_0x33bcf8[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0xb68854,null))[_0xacc7('0x27')](function(_0x23ce40){if(_0x23ce40){_0x5edcca=_0x23ce40;_0x58dfb4[_0xacc7('0x35')]=_[_0xacc7('0x33')](db['SugarcrmField'][_0xacc7('0x2e')]);_0x58dfb4[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0x33bcf8['query']);_0x58dfb4[_0xacc7('0x34')]=_[_0xacc7('0x37')](_0x58dfb4[_0xacc7('0x35')],_0x58dfb4[_0xacc7('0x32')]);_0x1952e3['attributes']=_[_0xacc7('0x37')](_0x58dfb4[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x33bcf8['query']['fields']));_0x1952e3[_0xacc7('0x36')]=_0x1952e3[_0xacc7('0x36')]['length']?_0x1952e3['attributes']:_0x58dfb4['model'];_0x1952e3[_0xacc7('0x3c')]=qs[_0xacc7('0x3d')](_0x33bcf8['query'][_0xacc7('0x3d')]);_0x1952e3[_0xacc7('0x3e')]=qs['filters'](_[_0xacc7('0x3f')](_0x33bcf8[_0xacc7('0x32')],_0x58dfb4[_0xacc7('0x34')]));if(_0x33bcf8[_0xacc7('0x32')]['filter']){_0x1952e3[_0xacc7('0x3e')]=_[_0xacc7('0x41')](_0x1952e3['where'],{'$or':_[_0xacc7('0x31')](_0x1952e3['attributes'],function(_0x44af6c){var _0x5a13bb={};_0x5a13bb[_0x44af6c]={'$like':'%'+_0x33bcf8[_0xacc7('0x32')]['filter']+'%'};return _0x5a13bb;})});}_0x1952e3=_[_0xacc7('0x41')]({},_0x1952e3,_0x33bcf8[_0xacc7('0x50')]);return _0x5edcca['getSubjects'](_0x1952e3);}})[_0xacc7('0x27')](function(_0x3faa14){if(_0x3faa14){_0x5694ba=_0x3faa14[_0xacc7('0x39')];if(!_0x33bcf8[_0xacc7('0x32')][_0xacc7('0x3a')]('nolimit')){_0x1952e3['limit']=qs['limit'](_0x33bcf8['query']['limit']);_0x1952e3[_0xacc7('0x1d')]=qs['offset'](_0x33bcf8[_0xacc7('0x32')][_0xacc7('0x1d')]);}return _0x5edcca[_0xacc7('0x51')](_0x1952e3);}})['then'](function(_0x4420a1){if(_0x4420a1){return _0x4420a1?{'count':_0x5694ba,'rows':_0x4420a1}:null;}})['then'](respondWithResult(_0xb68854,null))[_0xacc7('0x47')](handleError(_0xb68854,null));};exports[_0xacc7('0x52')]=function(_0x28d4da,_0x4a74df,_0x444057){var _0x28db30={};var _0x2edd43={};var _0x5ab30e;var _0x581bea;return db['SugarcrmConfiguration'][_0xacc7('0x4e')]({'where':{'id':_0x28d4da[_0xacc7('0x49')]['id']}})[_0xacc7('0x27')](handleEntityNotFound(_0x4a74df,null))[_0xacc7('0x27')](function(_0x36f983){if(_0x36f983){_0x5ab30e=_0x36f983;_0x2edd43[_0xacc7('0x35')]=_[_0xacc7('0x33')](db[_0xacc7('0x4f')][_0xacc7('0x2e')]);_0x2edd43[_0xacc7('0x32')]=_[_0xacc7('0x33')](_0x28d4da[_0xacc7('0x32')]);_0x2edd43[_0xacc7('0x34')]=_['intersection'](_0x2edd43[_0xacc7('0x35')],_0x2edd43[_0xacc7('0x32')]);_0x28db30[_0xacc7('0x36')]=_[_0xacc7('0x37')](_0x2edd43[_0xacc7('0x35')],qs[_0xacc7('0x38')](_0x28d4da[_0xacc7('0x32')][_0xacc7('0x38')]));_0x28db30[_0xacc7('0x36')]=_0x28db30[_0xacc7('0x36')][_0xacc7('0x39')]?_0x28db30[_0xacc7('0x36')]:_0x2edd43['model'];_0x28db30[_0xacc7('0x3c')]=qs['sort'](_0x28d4da[_0xacc7('0x32')][_0xacc7('0x3d')]);_0x28db30['where']=qs[_0xacc7('0x34')](_[_0xacc7('0x3f')](_0x28d4da[_0xacc7('0x32')],_0x2edd43['filters']));if(_0x28d4da[_0xacc7('0x32')][_0xacc7('0x40')]){_0x28db30[_0xacc7('0x3e')]=_['merge'](_0x28db30[_0xacc7('0x3e')],{'$or':_[_0xacc7('0x31')](_0x28db30['attributes'],function(_0x2f6358){var _0x57dcaf={};_0x57dcaf[_0x2f6358]={'$like':'%'+_0x28d4da[_0xacc7('0x32')][_0xacc7('0x40')]+'%'};return _0x57dcaf;})});}_0x28db30=_['merge']({},_0x28db30,_0x28d4da['options']);return _0x5ab30e[_0xacc7('0x52')](_0x28db30);}})[_0xacc7('0x27')](function(_0x4b4191){if(_0x4b4191){_0x581bea=_0x4b4191[_0xacc7('0x39')];if(!_0x28d4da[_0xacc7('0x32')]['hasOwnProperty'](_0xacc7('0x3b'))){_0x28db30[_0xacc7('0x1f')]=qs['limit'](_0x28d4da[_0xacc7('0x32')]['limit']);_0x28db30[_0xacc7('0x1d')]=qs[_0xacc7('0x1d')](_0x28d4da['query'][_0xacc7('0x1d')]);}return _0x5ab30e[_0xacc7('0x52')](_0x28db30);}})[_0xacc7('0x27')](function(_0x26dc73){if(_0x26dc73){return _0x26dc73?{'count':_0x581bea,'rows':_0x26dc73}:null;}})[_0xacc7('0x27')](respondWithResult(_0x4a74df,null))['catch'](handleError(_0x4a74df,null));}; \ No newline at end of file +var _0xa646=['where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','SugarcrmField','map','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4131c2,_0x26ccce){var _0x1ca43f=function(_0x1dc3e7){while(--_0x1dc3e7){_0x4131c2['push'](_0x4131c2['shift']());}};_0x1ca43f(++_0x26ccce);}(_0xa646,0x65));var _0x6a64=function(_0x39a79c,_0xb997ae){_0x39a79c=_0x39a79c-0x0;var _0x4d122a=_0xa646[_0x39a79c];return _0x4d122a;};'use strict';var emlformat=require(_0x6a64('0x0'));var rimraf=require(_0x6a64('0x1'));var zipdir=require(_0x6a64('0x2'));var jsonpatch=require(_0x6a64('0x3'));var rp=require(_0x6a64('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a64('0x5'));var util=require(_0x6a64('0x6'));var path=require(_0x6a64('0x7'));var sox=require(_0x6a64('0x8'));var csv=require(_0x6a64('0x9'));var ejs=require(_0x6a64('0xa'));var fs=require('fs');var fs_extra=require(_0x6a64('0xb'));var _=require(_0x6a64('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6a64('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6a64('0x9'));var querystring=require(_0x6a64('0xe'));var Papa=require(_0x6a64('0xf'));var Redis=require(_0x6a64('0x10'));var authService=require(_0x6a64('0x11'));var qs=require(_0x6a64('0x12'));var as=require(_0x6a64('0x13'));var hardwareService=require(_0x6a64('0x14'));var logger=require('../../config/logger')(_0x6a64('0x15'));var utils=require(_0x6a64('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d5245,_0x3a8a96){_0x3a8a96=_0x3a8a96||0xcc;return function(_0x544e36){if(_0x544e36){return _0x2d5245[_0x6a64('0x17')](_0x3a8a96);}return _0x2d5245[_0x6a64('0x18')](_0x3a8a96)[_0x6a64('0x19')]();};}function respondWithResult(_0x1d8619,_0x22da9b){_0x22da9b=_0x22da9b||0xc8;return function(_0x5e1306){if(_0x5e1306){return _0x1d8619[_0x6a64('0x18')](_0x22da9b)['json'](_0x5e1306);}};}function respondWithFilteredResult(_0x40400c,_0x204906){return function(_0x30812f){if(_0x30812f){var _0x390eec=typeof _0x204906[_0x6a64('0x1a')]===_0x6a64('0x1b')&&typeof _0x204906[_0x6a64('0x1c')]===_0x6a64('0x1b');var _0x55b402=_0x30812f[_0x6a64('0x1d')];var _0x30ffc5=_0x390eec?0x0:_0x204906[_0x6a64('0x1a')];var _0x176bb1=_0x390eec?_0x30812f[_0x6a64('0x1d')]:_0x204906[_0x6a64('0x1a')]+_0x204906[_0x6a64('0x1c')];var _0x3d6948;if(_0x176bb1>=_0x55b402){_0x176bb1=_0x55b402;_0x3d6948=0xc8;}else{_0x3d6948=0xce;}_0x40400c[_0x6a64('0x18')](_0x3d6948);return _0x40400c[_0x6a64('0x1e')](_0x6a64('0x1f'),_0x30ffc5+'-'+_0x176bb1+'/'+_0x55b402)[_0x6a64('0x20')](_0x30812f);}return null;};}function patchUpdates(_0x4d436a){return function(_0x239d56){try{jsonpatch[_0x6a64('0x21')](_0x239d56,_0x4d436a,!![]);}catch(_0xeb934f){return BPromise[_0x6a64('0x22')](_0xeb934f);}return _0x239d56[_0x6a64('0x23')]();};}function saveUpdates(_0x2b357a,_0x45a28c){return function(_0x92a6df){if(_0x92a6df){return _0x92a6df['update'](_0x2b357a)[_0x6a64('0x24')](function(_0x256423){return _0x256423;});}return null;};}function removeEntity(_0x1da20b,_0x5c43a0){return function(_0x467e05){if(_0x467e05){return _0x467e05[_0x6a64('0x25')]()['then'](function(){_0x1da20b[_0x6a64('0x18')](0xcc)[_0x6a64('0x19')]();});}};}function handleEntityNotFound(_0x2916c8,_0x12ca4d){return function(_0x3b0f5f){if(!_0x3b0f5f){_0x2916c8[_0x6a64('0x17')](0x194);}return _0x3b0f5f;};}function handleError(_0x46b849,_0x2fcf26){_0x2fcf26=_0x2fcf26||0x1f4;return function(_0x136d97){logger[_0x6a64('0x26')](_0x136d97[_0x6a64('0x27')]);if(_0x136d97[_0x6a64('0x28')]){delete _0x136d97[_0x6a64('0x28')];}_0x46b849['status'](_0x2fcf26)[_0x6a64('0x29')](_0x136d97);};}exports[_0x6a64('0x2a')]=function(_0x228d1a,_0x340292){var _0x4f47ae={},_0x448d80={},_0x4df0b5={'count':0x0,'rows':[]};var _0xb7db5e=_['map'](db['SugarcrmConfiguration'][_0x6a64('0x2b')],function(_0x220f54){return{'name':_0x220f54['fieldName'],'type':_0x220f54['type'][_0x6a64('0x2c')]};});_0x448d80[_0x6a64('0x2d')]=_['map'](_0xb7db5e,_0x6a64('0x28'));_0x448d80[_0x6a64('0x2e')]=_[_0x6a64('0x2f')](_0x228d1a[_0x6a64('0x2e')]);_0x448d80[_0x6a64('0x30')]=_[_0x6a64('0x31')](_0x448d80[_0x6a64('0x2d')],_0x448d80['query']);_0x4f47ae[_0x6a64('0x32')]=_['intersection'](_0x448d80[_0x6a64('0x2d')],qs[_0x6a64('0x33')](_0x228d1a[_0x6a64('0x2e')]['fields']));_0x4f47ae['attributes']=_0x4f47ae[_0x6a64('0x32')][_0x6a64('0x34')]?_0x4f47ae[_0x6a64('0x32')]:_0x448d80[_0x6a64('0x2d')];if(!_0x228d1a[_0x6a64('0x2e')][_0x6a64('0x35')](_0x6a64('0x36'))){_0x4f47ae[_0x6a64('0x1c')]=qs[_0x6a64('0x1c')](_0x228d1a['query']['limit']);_0x4f47ae[_0x6a64('0x1a')]=qs[_0x6a64('0x1a')](_0x228d1a[_0x6a64('0x2e')][_0x6a64('0x1a')]);}_0x4f47ae[_0x6a64('0x37')]=qs[_0x6a64('0x38')](_0x228d1a[_0x6a64('0x2e')][_0x6a64('0x38')]);_0x4f47ae[_0x6a64('0x39')]=qs[_0x6a64('0x30')](_[_0x6a64('0x3a')](_0x228d1a[_0x6a64('0x2e')],_0x448d80[_0x6a64('0x30')]),_0xb7db5e);if(_0x228d1a[_0x6a64('0x2e')][_0x6a64('0x3b')]){_0x4f47ae['where']=_[_0x6a64('0x3c')](_0x4f47ae[_0x6a64('0x39')],{'$or':_['map'](_0xb7db5e,function(_0x748a1b){if(_0x748a1b['type']!==_0x6a64('0x3d')){var _0xb31839={};_0xb31839[_0x748a1b[_0x6a64('0x28')]]={'$like':'%'+_0x228d1a[_0x6a64('0x2e')][_0x6a64('0x3b')]+'%'};return _0xb31839;}})});}_0x4f47ae=_[_0x6a64('0x3c')]({},_0x4f47ae,_0x228d1a[_0x6a64('0x3e')]);var _0x321c10={'where':_0x4f47ae['where']};return db[_0x6a64('0x3f')]['count'](_0x321c10)[_0x6a64('0x24')](function(_0x45dd19){_0x4df0b5[_0x6a64('0x1d')]=_0x45dd19;if(_0x228d1a['query'][_0x6a64('0x40')]){_0x4f47ae[_0x6a64('0x41')]=[{'all':!![]}];}return db[_0x6a64('0x3f')][_0x6a64('0x42')](_0x4f47ae);})[_0x6a64('0x24')](function(_0x1fce24){_0x4df0b5[_0x6a64('0x43')]=_0x1fce24;return _0x4df0b5;})[_0x6a64('0x24')](respondWithFilteredResult(_0x340292,_0x4f47ae))[_0x6a64('0x44')](handleError(_0x340292,null));};exports['show']=function(_0x5d1903,_0x44d4f6){var _0x4a4431={'raw':![],'where':{'id':_0x5d1903[_0x6a64('0x45')]['id']}},_0x460a6c={};_0x460a6c[_0x6a64('0x2d')]=_['keys'](db['SugarcrmConfiguration'][_0x6a64('0x2b')]);_0x460a6c['query']=_[_0x6a64('0x2f')](_0x5d1903[_0x6a64('0x2e')]);_0x460a6c[_0x6a64('0x30')]=_['intersection'](_0x460a6c[_0x6a64('0x2d')],_0x460a6c['query']);_0x4a4431[_0x6a64('0x32')]=_['intersection'](_0x460a6c[_0x6a64('0x2d')],qs['fields'](_0x5d1903[_0x6a64('0x2e')][_0x6a64('0x33')]));_0x4a4431[_0x6a64('0x32')]=_0x4a4431['attributes']['length']?_0x4a4431[_0x6a64('0x32')]:_0x460a6c[_0x6a64('0x2d')];if(_0x5d1903[_0x6a64('0x2e')]['includeAll']){_0x4a4431[_0x6a64('0x41')]=[{'all':!![]}];}_0x4a4431=_[_0x6a64('0x3c')]({},_0x4a4431,_0x5d1903[_0x6a64('0x3e')]);return db[_0x6a64('0x3f')][_0x6a64('0x46')](_0x4a4431)['then'](handleEntityNotFound(_0x44d4f6,null))[_0x6a64('0x24')](respondWithResult(_0x44d4f6,null))[_0x6a64('0x44')](handleError(_0x44d4f6,null));};exports[_0x6a64('0x47')]=function(_0x47bf30,_0x2c7218){return db[_0x6a64('0x3f')]['create'](_0x47bf30[_0x6a64('0x48')],{})[_0x6a64('0x24')](respondWithResult(_0x2c7218,0xc9))[_0x6a64('0x44')](handleError(_0x2c7218,null));};exports['update']=function(_0x44f56a,_0x1f56e2){if(_0x44f56a['body']['id']){delete _0x44f56a[_0x6a64('0x48')]['id'];}return db[_0x6a64('0x3f')]['find']({'where':{'id':_0x44f56a[_0x6a64('0x45')]['id']}})[_0x6a64('0x24')](handleEntityNotFound(_0x1f56e2,null))[_0x6a64('0x24')](saveUpdates(_0x44f56a[_0x6a64('0x48')],null))[_0x6a64('0x24')](respondWithResult(_0x1f56e2,null))['catch'](handleError(_0x1f56e2,null));};exports[_0x6a64('0x25')]=function(_0x573f29,_0x16c6b7){return db[_0x6a64('0x3f')][_0x6a64('0x46')]({'where':{'id':_0x573f29[_0x6a64('0x45')]['id']}})[_0x6a64('0x24')](handleEntityNotFound(_0x16c6b7,null))['then'](removeEntity(_0x16c6b7,null))[_0x6a64('0x44')](handleError(_0x16c6b7,null));};exports[_0x6a64('0x49')]=function(_0x1d2581,_0x44ae30,_0x38a8b3){var _0x1e87e7={};var _0x519f37={};var _0x1babc9;var _0x3f13fa;return db[_0x6a64('0x3f')][_0x6a64('0x4a')]({'where':{'id':_0x1d2581[_0x6a64('0x45')]['id']}})[_0x6a64('0x24')](handleEntityNotFound(_0x44ae30,null))[_0x6a64('0x24')](function(_0x2e3f6a){if(_0x2e3f6a){_0x1babc9=_0x2e3f6a;_0x519f37[_0x6a64('0x2d')]=_[_0x6a64('0x2f')](db[_0x6a64('0x4b')][_0x6a64('0x2b')]);_0x519f37[_0x6a64('0x2e')]=_[_0x6a64('0x2f')](_0x1d2581[_0x6a64('0x2e')]);_0x519f37[_0x6a64('0x30')]=_[_0x6a64('0x31')](_0x519f37[_0x6a64('0x2d')],_0x519f37[_0x6a64('0x2e')]);_0x1e87e7['attributes']=_[_0x6a64('0x31')](_0x519f37[_0x6a64('0x2d')],qs[_0x6a64('0x33')](_0x1d2581[_0x6a64('0x2e')][_0x6a64('0x33')]));_0x1e87e7[_0x6a64('0x32')]=_0x1e87e7['attributes'][_0x6a64('0x34')]?_0x1e87e7[_0x6a64('0x32')]:_0x519f37['model'];_0x1e87e7[_0x6a64('0x37')]=qs[_0x6a64('0x38')](_0x1d2581[_0x6a64('0x2e')][_0x6a64('0x38')]);_0x1e87e7[_0x6a64('0x39')]=qs[_0x6a64('0x30')](_[_0x6a64('0x3a')](_0x1d2581[_0x6a64('0x2e')],_0x519f37['filters']));if(_0x1d2581[_0x6a64('0x2e')][_0x6a64('0x3b')]){_0x1e87e7[_0x6a64('0x39')]=_[_0x6a64('0x3c')](_0x1e87e7[_0x6a64('0x39')],{'$or':_[_0x6a64('0x4c')](_0x1e87e7['attributes'],function(_0x3fcff1){var _0x36de7a={};_0x36de7a[_0x3fcff1]={'$like':'%'+_0x1d2581['query'][_0x6a64('0x3b')]+'%'};return _0x36de7a;})});}_0x1e87e7=_[_0x6a64('0x3c')]({},_0x1e87e7,_0x1d2581[_0x6a64('0x3e')]);return _0x1babc9[_0x6a64('0x49')](_0x1e87e7);}})[_0x6a64('0x24')](function(_0x5a1f43){if(_0x5a1f43){_0x3f13fa=_0x5a1f43[_0x6a64('0x34')];if(!_0x1d2581[_0x6a64('0x2e')]['hasOwnProperty'](_0x6a64('0x36'))){_0x1e87e7[_0x6a64('0x1c')]=qs['limit'](_0x1d2581[_0x6a64('0x2e')]['limit']);_0x1e87e7[_0x6a64('0x1a')]=qs[_0x6a64('0x1a')](_0x1d2581[_0x6a64('0x2e')][_0x6a64('0x1a')]);}return _0x1babc9[_0x6a64('0x49')](_0x1e87e7);}})[_0x6a64('0x24')](function(_0x43dce2){if(_0x43dce2){return _0x43dce2?{'count':_0x3f13fa,'rows':_0x43dce2}:null;}})[_0x6a64('0x24')](respondWithResult(_0x44ae30,null))['catch'](handleError(_0x44ae30,null));};exports['getSubjects']=function(_0x5c64fc,_0x41c0da,_0x1a05ff){var _0x48b7bb={};var _0x456b3e={};var _0x58c8b7;var _0x3da3ce;return db[_0x6a64('0x3f')]['findOne']({'where':{'id':_0x5c64fc['params']['id']}})[_0x6a64('0x24')](handleEntityNotFound(_0x41c0da,null))[_0x6a64('0x24')](function(_0x3cec1f){if(_0x3cec1f){_0x58c8b7=_0x3cec1f;_0x456b3e[_0x6a64('0x2d')]=_[_0x6a64('0x2f')](db['SugarcrmField']['rawAttributes']);_0x456b3e['query']=_[_0x6a64('0x2f')](_0x5c64fc[_0x6a64('0x2e')]);_0x456b3e['filters']=_['intersection'](_0x456b3e[_0x6a64('0x2d')],_0x456b3e[_0x6a64('0x2e')]);_0x48b7bb[_0x6a64('0x32')]=_[_0x6a64('0x31')](_0x456b3e[_0x6a64('0x2d')],qs[_0x6a64('0x33')](_0x5c64fc[_0x6a64('0x2e')][_0x6a64('0x33')]));_0x48b7bb[_0x6a64('0x32')]=_0x48b7bb[_0x6a64('0x32')][_0x6a64('0x34')]?_0x48b7bb[_0x6a64('0x32')]:_0x456b3e[_0x6a64('0x2d')];_0x48b7bb['order']=qs['sort'](_0x5c64fc[_0x6a64('0x2e')]['sort']);_0x48b7bb[_0x6a64('0x39')]=qs['filters'](_['pick'](_0x5c64fc[_0x6a64('0x2e')],_0x456b3e[_0x6a64('0x30')]));if(_0x5c64fc[_0x6a64('0x2e')][_0x6a64('0x3b')]){_0x48b7bb[_0x6a64('0x39')]=_[_0x6a64('0x3c')](_0x48b7bb['where'],{'$or':_[_0x6a64('0x4c')](_0x48b7bb[_0x6a64('0x32')],function(_0x4c57e5){var _0x20e3c8={};_0x20e3c8[_0x4c57e5]={'$like':'%'+_0x5c64fc[_0x6a64('0x2e')][_0x6a64('0x3b')]+'%'};return _0x20e3c8;})});}_0x48b7bb=_[_0x6a64('0x3c')]({},_0x48b7bb,_0x5c64fc['options']);return _0x58c8b7[_0x6a64('0x4d')](_0x48b7bb);}})[_0x6a64('0x24')](function(_0x1d4ca2){if(_0x1d4ca2){_0x3da3ce=_0x1d4ca2[_0x6a64('0x34')];if(!_0x5c64fc[_0x6a64('0x2e')][_0x6a64('0x35')](_0x6a64('0x36'))){_0x48b7bb[_0x6a64('0x1c')]=qs[_0x6a64('0x1c')](_0x5c64fc['query'][_0x6a64('0x1c')]);_0x48b7bb['offset']=qs[_0x6a64('0x1a')](_0x5c64fc[_0x6a64('0x2e')][_0x6a64('0x1a')]);}return _0x58c8b7[_0x6a64('0x4d')](_0x48b7bb);}})['then'](function(_0x14cb46){if(_0x14cb46){return _0x14cb46?{'count':_0x3da3ce,'rows':_0x14cb46}:null;}})['then'](respondWithResult(_0x41c0da,null))[_0x6a64('0x44')](handleError(_0x41c0da,null));};exports[_0x6a64('0x4e')]=function(_0x2a66cc,_0x123930,_0x539e18){var _0x4c9361={};var _0x18e853={};var _0x2a5e64;var _0x3bca06;return db['SugarcrmConfiguration'][_0x6a64('0x4a')]({'where':{'id':_0x2a66cc[_0x6a64('0x45')]['id']}})[_0x6a64('0x24')](handleEntityNotFound(_0x123930,null))[_0x6a64('0x24')](function(_0x59adfd){if(_0x59adfd){_0x2a5e64=_0x59adfd;_0x18e853[_0x6a64('0x2d')]=_[_0x6a64('0x2f')](db[_0x6a64('0x4b')][_0x6a64('0x2b')]);_0x18e853['query']=_[_0x6a64('0x2f')](_0x2a66cc[_0x6a64('0x2e')]);_0x18e853[_0x6a64('0x30')]=_['intersection'](_0x18e853[_0x6a64('0x2d')],_0x18e853[_0x6a64('0x2e')]);_0x4c9361[_0x6a64('0x32')]=_[_0x6a64('0x31')](_0x18e853[_0x6a64('0x2d')],qs[_0x6a64('0x33')](_0x2a66cc[_0x6a64('0x2e')][_0x6a64('0x33')]));_0x4c9361[_0x6a64('0x32')]=_0x4c9361[_0x6a64('0x32')][_0x6a64('0x34')]?_0x4c9361[_0x6a64('0x32')]:_0x18e853[_0x6a64('0x2d')];_0x4c9361[_0x6a64('0x37')]=qs[_0x6a64('0x38')](_0x2a66cc['query'][_0x6a64('0x38')]);_0x4c9361[_0x6a64('0x39')]=qs[_0x6a64('0x30')](_[_0x6a64('0x3a')](_0x2a66cc[_0x6a64('0x2e')],_0x18e853['filters']));if(_0x2a66cc['query'][_0x6a64('0x3b')]){_0x4c9361[_0x6a64('0x39')]=_[_0x6a64('0x3c')](_0x4c9361[_0x6a64('0x39')],{'$or':_[_0x6a64('0x4c')](_0x4c9361[_0x6a64('0x32')],function(_0x4090d9){var _0x58cc1a={};_0x58cc1a[_0x4090d9]={'$like':'%'+_0x2a66cc[_0x6a64('0x2e')][_0x6a64('0x3b')]+'%'};return _0x58cc1a;})});}_0x4c9361=_[_0x6a64('0x3c')]({},_0x4c9361,_0x2a66cc[_0x6a64('0x3e')]);return _0x2a5e64[_0x6a64('0x4e')](_0x4c9361);}})[_0x6a64('0x24')](function(_0xfc56d4){if(_0xfc56d4){_0x3bca06=_0xfc56d4[_0x6a64('0x34')];if(!_0x2a66cc[_0x6a64('0x2e')]['hasOwnProperty'](_0x6a64('0x36'))){_0x4c9361[_0x6a64('0x1c')]=qs[_0x6a64('0x1c')](_0x2a66cc[_0x6a64('0x2e')][_0x6a64('0x1c')]);_0x4c9361[_0x6a64('0x1a')]=qs[_0x6a64('0x1a')](_0x2a66cc[_0x6a64('0x2e')][_0x6a64('0x1a')]);}return _0x2a5e64[_0x6a64('0x4e')](_0x4c9361);}})[_0x6a64('0x24')](function(_0x377c9f){if(_0x377c9f){return _0x377c9f?{'count':_0x3bca06,'rows':_0x377c9f}:null;}})[_0x6a64('0x24')](respondWithResult(_0x123930,null))[_0x6a64('0x44')](handleError(_0x123930,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e3f6724..6157595 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 _0xbb55=['bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','lodash','util','moment'];(function(_0x3f8764,_0x4170d3){var _0x38b02e=function(_0x529a1a){while(--_0x529a1a){_0x3f8764['push'](_0x3f8764['shift']());}};_0x38b02e(++_0x4170d3);}(_0xbb55,0xc5));var _0x5bb5=function(_0xa81e31,_0x4944e8){_0xa81e31=_0xa81e31-0x0;var _0x10edcf=_0xbb55[_0xa81e31];return _0x10edcf;};'use strict';var _=require(_0x5bb5('0x0'));var util=require(_0x5bb5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5bb5('0x2'));var BPromise=require(_0x5bb5('0x3'));var rp=require(_0x5bb5('0x4'));var fs=require('fs');var path=require(_0x5bb5('0x5'));var rimraf=require('rimraf');var config=require(_0x5bb5('0x6'));var attributes=require(_0x5bb5('0x7'));module['exports']=function(_0x144177,_0x56ab27){return _0x144177[_0x5bb5('0x8')](_0x5bb5('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee6c=['moment','bluebird','request-promise','path','rimraf','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0xa3ac3b,_0x5ea8b4){var _0x7213d5=function(_0x5a0582){while(--_0x5a0582){_0xa3ac3b['push'](_0xa3ac3b['shift']());}};_0x7213d5(++_0x5ea8b4);}(_0xee6c,0x1a1));var _0xcee6=function(_0x1b3784,_0x6d5f8c){_0x1b3784=_0x1b3784-0x0;var _0x504e92=_0xee6c[_0x1b3784];return _0x504e92;};'use strict';var _=require(_0xcee6('0x0'));var util=require(_0xcee6('0x1'));var logger=require(_0xcee6('0x2'))('api');var moment=require(_0xcee6('0x3'));var BPromise=require(_0xcee6('0x4'));var rp=require(_0xcee6('0x5'));var fs=require('fs');var path=require(_0xcee6('0x6'));var rimraf=require(_0xcee6('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xcee6('0x8')]=function(_0xbc8961,_0x426cb0){return _0xbc8961[_0xcee6('0x9')](_0xcee6('0xa'),attributes,{'tableName':_0xcee6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 3b9da45..f7f8d42 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 _0x9d62=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3579a4,_0x469453){var _0x31367b=function(_0x427f0e){while(--_0x427f0e){_0x3579a4['push'](_0x3579a4['shift']());}};_0x31367b(++_0x469453);}(_0x9d62,0xf2));var _0x29d6=function(_0x48e877,_0x1e3583){_0x48e877=_0x48e877-0x0;var _0x25ac13=_0x9d62[_0x48e877];return _0x25ac13;};'use strict';var _=require(_0x29d6('0x0'));var util=require(_0x29d6('0x1'));var moment=require(_0x29d6('0x2'));var BPromise=require(_0x29d6('0x3'));var rs=require(_0x29d6('0x4'));var fs=require('fs');var Redis=require(_0x29d6('0x5'));var db=require(_0x29d6('0x6'))['db'];var utils=require(_0x29d6('0x7'));var logger=require(_0x29d6('0x8'))('rpc');var config=require(_0x29d6('0x9'));var jayson=require(_0x29d6('0xa'));var client=jayson['client'][_0x29d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219c98,_0x396913,_0x1f5422){return new BPromise(function(_0x5bf845,_0xd0d2df){return client['request'](_0x219c98,_0x1f5422)[_0x29d6('0xc')](function(_0x339820){logger[_0x29d6('0xd')](_0x29d6('0xe'),_0x396913,'request\x20sent');logger[_0x29d6('0xf')](_0x29d6('0x10'),_0x396913,_0x29d6('0x11'),JSON[_0x29d6('0x12')](_0x339820));if(_0x339820[_0x29d6('0x13')]){if(_0x339820[_0x29d6('0x13')][_0x29d6('0x14')]===0x1f4){logger[_0x29d6('0x13')](_0x29d6('0xe'),_0x396913,_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);return _0xd0d2df(_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);}logger[_0x29d6('0x13')](_0x29d6('0xe'),_0x396913,_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);return _0x5bf845(_0x339820[_0x29d6('0x13')][_0x29d6('0x15')]);}else{logger[_0x29d6('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x396913,_0x29d6('0x11'));_0x5bf845(_0x339820['result']['message']);}})['catch'](function(_0x1366fd){logger[_0x29d6('0x13')](_0x29d6('0xe'),_0x396913,_0x1366fd);_0xd0d2df(_0x1366fd);});});} \ No newline at end of file +var _0x9399=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird'];(function(_0x2a7615,_0xa23308){var _0x180173=function(_0x35ec3a){while(--_0x35ec3a){_0x2a7615['push'](_0x2a7615['shift']());}};_0x180173(++_0xa23308);}(_0x9399,0x161));var _0x9939=function(_0x1fcdbb,_0x4167bd){_0x1fcdbb=_0x1fcdbb-0x0;var _0x4d46bb=_0x9399[_0x1fcdbb];return _0x4d46bb;};'use strict';var _=require(_0x9939('0x0'));var util=require(_0x9939('0x1'));var moment=require(_0x9939('0x2'));var BPromise=require(_0x9939('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9939('0x4'));var db=require(_0x9939('0x5'))['db'];var utils=require(_0x9939('0x6'));var logger=require(_0x9939('0x7'))(_0x9939('0x8'));var config=require(_0x9939('0x9'));var jayson=require(_0x9939('0xa'));var client=jayson[_0x9939('0xb')][_0x9939('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1505d2,_0x5e40d5,_0x138ea8){return new BPromise(function(_0x5977ee,_0x37df05){return client['request'](_0x1505d2,_0x138ea8)['then'](function(_0x4695d3){logger[_0x9939('0xd')](_0x9939('0xe'),_0x5e40d5,_0x9939('0xf'));logger[_0x9939('0x10')](_0x9939('0x11'),_0x5e40d5,_0x9939('0xf'),JSON['stringify'](_0x4695d3));if(_0x4695d3[_0x9939('0x12')]){if(_0x4695d3[_0x9939('0x12')][_0x9939('0x13')]===0x1f4){logger[_0x9939('0x12')](_0x9939('0xe'),_0x5e40d5,_0x4695d3[_0x9939('0x12')]['message']);return _0x37df05(_0x4695d3[_0x9939('0x12')][_0x9939('0x14')]);}logger['error'](_0x9939('0xe'),_0x5e40d5,_0x4695d3[_0x9939('0x12')][_0x9939('0x14')]);return _0x5977ee(_0x4695d3[_0x9939('0x12')][_0x9939('0x14')]);}else{logger[_0x9939('0xd')](_0x9939('0xe'),_0x5e40d5,_0x9939('0xf'));_0x5977ee(_0x4695d3['result']['message']);}})['catch'](function(_0x4345a3){logger[_0x9939('0x12')](_0x9939('0xe'),_0x5e40d5,_0x4345a3);_0x37df05(_0x4345a3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 1c9c8d1..67b3663 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 _0x28fa=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get','/:id'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x28fa,0x93));var _0xa28f=function(_0x19215c,_0x250cd9){_0x19215c=_0x19215c-0x0;var _0x129a4d=_0x28fa[_0x19215c];return _0x129a4d;};'use strict';var multer=require(_0xa28f('0x0'));var util=require(_0xa28f('0x1'));var path=require(_0xa28f('0x2'));var timeout=require(_0xa28f('0x3'));var express=require(_0xa28f('0x4'));var router=express['Router']();var fs_extra=require(_0xa28f('0x5'));var auth=require(_0xa28f('0x6'));var interaction=require(_0xa28f('0x7'));var config=require(_0xa28f('0x8'));var controller=require(_0xa28f('0x9'));router['get']('/',auth[_0xa28f('0xa')](),controller['index']);router[_0xa28f('0xb')](_0xa28f('0xc'),auth[_0xa28f('0xa')](),controller['show']);router[_0xa28f('0xd')]('/',auth[_0xa28f('0xa')](),controller[_0xa28f('0xe')]);router[_0xa28f('0xf')](_0xa28f('0xc'),auth[_0xa28f('0xa')](),controller[_0xa28f('0x10')]);router[_0xa28f('0x11')](_0xa28f('0xc'),auth[_0xa28f('0xa')](),controller[_0xa28f('0x12')]);module[_0xa28f('0x13')]=router; \ No newline at end of file +var _0x12b0=['../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','Router','../../components/interaction/service'];(function(_0x4c5a06,_0x45e1c8){var _0x161d6f=function(_0x4ea9c3){while(--_0x4ea9c3){_0x4c5a06['push'](_0x4c5a06['shift']());}};_0x161d6f(++_0x45e1c8);}(_0x12b0,0x194));var _0x012b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x12b0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x012b('0x0'));var path=require('path');var timeout=require(_0x012b('0x1'));var express=require('express');var router=express[_0x012b('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x012b('0x3'));var config=require(_0x012b('0x4'));var controller=require(_0x012b('0x5'));router['get']('/',auth[_0x012b('0x6')](),controller[_0x012b('0x7')]);router[_0x012b('0x8')](_0x012b('0x9'),auth[_0x012b('0x6')](),controller[_0x012b('0xa')]);router[_0x012b('0xb')]('/',auth[_0x012b('0x6')](),controller[_0x012b('0xc')]);router[_0x012b('0xd')](_0x012b('0x9'),auth['isAuthenticated'](),controller[_0x012b('0xe')]);router[_0x012b('0xf')](_0x012b('0x9'),auth['isAuthenticated'](),controller[_0x012b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index c889c7e..f9c7c42 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 _0x9b0f=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x540133,_0x41783f){var _0x26b6e9=function(_0x10ebe3){while(--_0x10ebe3){_0x540133['push'](_0x540133['shift']());}};_0x26b6e9(++_0x41783f);}(_0x9b0f,0x16e));var _0xf9b0=function(_0x4052f0,_0x3fefee){_0x4052f0=_0x4052f0-0x0;var _0x4469ea=_0x9b0f[_0x4052f0];return _0x4469ea;};'use strict';var Sequelize=require('sequelize');module[_0xf9b0('0x0')]={'type':{'type':Sequelize[_0xf9b0('0x1')](_0xf9b0('0x2'),_0xf9b0('0x3'),_0xf9b0('0x4'),_0xf9b0('0x5'),_0xf9b0('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf9b0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf9b0('0x2'),_0xf9b0('0x3'),_0xf9b0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf9b0('0x7')]},'nameField':{'type':Sequelize[_0xf9b0('0x7')]},'customField':{'type':Sequelize[_0xf9b0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf9b0('0x7')]}}; \ No newline at end of file +var _0x48f4=['variable','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x41c7bf,_0x1bdb40){var _0x5754f1=function(_0x50aca7){while(--_0x50aca7){_0x41c7bf['push'](_0x41c7bf['shift']());}};_0x5754f1(++_0x1bdb40);}(_0x48f4,0x14e));var _0x448f=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x48f4[_0x53b53e];return _0xbb6179;};'use strict';var Sequelize=require(_0x448f('0x0'));module[_0x448f('0x1')]={'type':{'type':Sequelize[_0x448f('0x2')](_0x448f('0x3'),'variable',_0x448f('0x4'),_0x448f('0x5'),_0x448f('0x6')),'defaultValue':_0x448f('0x3')},'content':{'type':Sequelize[_0x448f('0x7')]},'key':{'type':Sequelize[_0x448f('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x448f('0x3'),_0x448f('0x8'),_0x448f('0x4'))},'keyContent':{'type':Sequelize[_0x448f('0x7')]},'idField':{'type':Sequelize[_0x448f('0x7')]},'nameField':{'type':Sequelize[_0x448f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x448f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 437a459..f9b9ec0 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 _0x4d85=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','SugarcrmField','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','find','create','body','params','destroy','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0xf9282e,_0x4c5fc5){var _0x4f4e34=function(_0x31418c){while(--_0x31418c){_0xf9282e['push'](_0xf9282e['shift']());}};_0x4f4e34(++_0x4c5fc5);}(_0x4d85,0x1af));var _0x54d8=function(_0x59f1e6,_0xda13c5){_0x59f1e6=_0x59f1e6-0x0;var _0x2aada5=_0x4d85[_0x59f1e6];return _0x2aada5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x54d8('0x0'));var jsonpatch=require(_0x54d8('0x1'));var rp=require('request-promise');var moment=require(_0x54d8('0x2'));var BPromise=require(_0x54d8('0x3'));var Mustache=require(_0x54d8('0x4'));var util=require(_0x54d8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x54d8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54d8('0x7'));var _=require(_0x54d8('0x8'));var squel=require(_0x54d8('0x9'));var crypto=require(_0x54d8('0xa'));var jsforce=require(_0x54d8('0xb'));var deskjs=require(_0x54d8('0xc'));var toCsv=require(_0x54d8('0x6'));var querystring=require('querystring');var Papa=require(_0x54d8('0xd'));var Redis=require(_0x54d8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x54d8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54d8('0x10'));var logger=require(_0x54d8('0x11'))(_0x54d8('0x12'));var utils=require(_0x54d8('0x13'));var config=require(_0x54d8('0x14'));var licenseUtil=require(_0x54d8('0x15'));var db=require(_0x54d8('0x16'))['db'];function respondWithStatusCode(_0x41a3b8,_0x33c6b4){_0x33c6b4=_0x33c6b4||0xcc;return function(_0x2b023c){if(_0x2b023c){return _0x41a3b8[_0x54d8('0x17')](_0x33c6b4);}return _0x41a3b8['status'](_0x33c6b4)[_0x54d8('0x18')]();};}function respondWithResult(_0x69f33d,_0x43c3b2){_0x43c3b2=_0x43c3b2||0xc8;return function(_0x3ef839){if(_0x3ef839){return _0x69f33d[_0x54d8('0x19')](_0x43c3b2)[_0x54d8('0x1a')](_0x3ef839);}};}function respondWithFilteredResult(_0x3c690d,_0x1c5c25){return function(_0x46846a){if(_0x46846a){var _0x59498e=typeof _0x1c5c25[_0x54d8('0x1b')]===_0x54d8('0x1c')&&typeof _0x1c5c25[_0x54d8('0x1d')]===_0x54d8('0x1c');var _0x537412=_0x46846a[_0x54d8('0x1e')];var _0x39633f=_0x59498e?0x0:_0x1c5c25['offset'];var _0x216619=_0x59498e?_0x46846a[_0x54d8('0x1e')]:_0x1c5c25['offset']+_0x1c5c25[_0x54d8('0x1d')];var _0x5231c8;if(_0x216619>=_0x537412){_0x216619=_0x537412;_0x5231c8=0xc8;}else{_0x5231c8=0xce;}_0x3c690d[_0x54d8('0x19')](_0x5231c8);return _0x3c690d[_0x54d8('0x1f')](_0x54d8('0x20'),_0x39633f+'-'+_0x216619+'/'+_0x537412)[_0x54d8('0x1a')](_0x46846a);}return null;};}function patchUpdates(_0x27982d){return function(_0xe48576){try{jsonpatch[_0x54d8('0x21')](_0xe48576,_0x27982d,!![]);}catch(_0x252b06){return BPromise[_0x54d8('0x22')](_0x252b06);}return _0xe48576[_0x54d8('0x23')]();};}function saveUpdates(_0x41f67f,_0xc9351a){return function(_0x24666d){if(_0x24666d){return _0x24666d[_0x54d8('0x24')](_0x41f67f)[_0x54d8('0x25')](function(_0x39c40e){return _0x39c40e;});}return null;};}function removeEntity(_0x25b0b8,_0x59e32b){return function(_0x21dc8b){if(_0x21dc8b){return _0x21dc8b['destroy']()[_0x54d8('0x25')](function(){_0x25b0b8[_0x54d8('0x19')](0xcc)[_0x54d8('0x18')]();});}};}function handleEntityNotFound(_0x147eab,_0x43f68a){return function(_0x57cd64){if(!_0x57cd64){_0x147eab[_0x54d8('0x17')](0x194);}return _0x57cd64;};}function handleError(_0x2471e5,_0x66094c){_0x66094c=_0x66094c||0x1f4;return function(_0x1bd3e7){logger['error'](_0x1bd3e7[_0x54d8('0x26')]);if(_0x1bd3e7[_0x54d8('0x27')]){delete _0x1bd3e7[_0x54d8('0x27')];}_0x2471e5[_0x54d8('0x19')](_0x66094c)[_0x54d8('0x28')](_0x1bd3e7);};}exports[_0x54d8('0x29')]=function(_0x3858e4,_0x114e3a){var _0x53e67e={},_0x53bf98={},_0x49f5b9={'count':0x0,'rows':[]};var _0x4d66dc=_['map'](db[_0x54d8('0x2a')]['rawAttributes'],function(_0x13efdb){return{'name':_0x13efdb[_0x54d8('0x2b')],'type':_0x13efdb[_0x54d8('0x2c')]['key']};});_0x53bf98[_0x54d8('0x2d')]=_['map'](_0x4d66dc,'name');_0x53bf98[_0x54d8('0x2e')]=_['keys'](_0x3858e4[_0x54d8('0x2e')]);_0x53bf98[_0x54d8('0x2f')]=_['intersection'](_0x53bf98['model'],_0x53bf98[_0x54d8('0x2e')]);_0x53e67e[_0x54d8('0x30')]=_['intersection'](_0x53bf98[_0x54d8('0x2d')],qs[_0x54d8('0x31')](_0x3858e4[_0x54d8('0x2e')][_0x54d8('0x31')]));_0x53e67e[_0x54d8('0x30')]=_0x53e67e[_0x54d8('0x30')][_0x54d8('0x32')]?_0x53e67e[_0x54d8('0x30')]:_0x53bf98[_0x54d8('0x2d')];if(!_0x3858e4[_0x54d8('0x2e')][_0x54d8('0x33')](_0x54d8('0x34'))){_0x53e67e[_0x54d8('0x1d')]=qs[_0x54d8('0x1d')](_0x3858e4[_0x54d8('0x2e')][_0x54d8('0x1d')]);_0x53e67e['offset']=qs[_0x54d8('0x1b')](_0x3858e4[_0x54d8('0x2e')]['offset']);}_0x53e67e[_0x54d8('0x35')]=qs[_0x54d8('0x36')](_0x3858e4['query'][_0x54d8('0x36')]);_0x53e67e[_0x54d8('0x37')]=qs[_0x54d8('0x2f')](_[_0x54d8('0x38')](_0x3858e4['query'],_0x53bf98['filters']),_0x4d66dc);if(_0x3858e4['query'][_0x54d8('0x39')]){_0x53e67e[_0x54d8('0x37')]=_[_0x54d8('0x3a')](_0x53e67e[_0x54d8('0x37')],{'$or':_[_0x54d8('0x3b')](_0x4d66dc,function(_0x57fe30){if(_0x57fe30[_0x54d8('0x2c')]!==_0x54d8('0x3c')){var _0x825478={};_0x825478[_0x57fe30['name']]={'$like':'%'+_0x3858e4[_0x54d8('0x2e')]['filter']+'%'};return _0x825478;}})});}_0x53e67e=_[_0x54d8('0x3a')]({},_0x53e67e,_0x3858e4[_0x54d8('0x3d')]);var _0x29827b={'where':_0x53e67e['where']};return db[_0x54d8('0x2a')]['count'](_0x29827b)['then'](function(_0xa29148){_0x49f5b9['count']=_0xa29148;if(_0x3858e4['query'][_0x54d8('0x3e')]){_0x53e67e[_0x54d8('0x3f')]=[{'all':!![]}];}return db[_0x54d8('0x2a')][_0x54d8('0x40')](_0x53e67e);})[_0x54d8('0x25')](function(_0x4ad401){_0x49f5b9[_0x54d8('0x41')]=_0x4ad401;return _0x49f5b9;})[_0x54d8('0x25')](respondWithFilteredResult(_0x114e3a,_0x53e67e))[_0x54d8('0x42')](handleError(_0x114e3a,null));};exports[_0x54d8('0x43')]=function(_0x15fddc,_0x57f8f4){var _0x101160={'raw':!![],'where':{'id':_0x15fddc['params']['id']}},_0x14657b={};_0x14657b[_0x54d8('0x2d')]=_['keys'](db[_0x54d8('0x2a')][_0x54d8('0x44')]);_0x14657b[_0x54d8('0x2e')]=_['keys'](_0x15fddc[_0x54d8('0x2e')]);_0x14657b[_0x54d8('0x2f')]=_[_0x54d8('0x45')](_0x14657b[_0x54d8('0x2d')],_0x14657b['query']);_0x101160[_0x54d8('0x30')]=_['intersection'](_0x14657b[_0x54d8('0x2d')],qs[_0x54d8('0x31')](_0x15fddc[_0x54d8('0x2e')][_0x54d8('0x31')]));_0x101160[_0x54d8('0x30')]=_0x101160[_0x54d8('0x30')]['length']?_0x101160[_0x54d8('0x30')]:_0x14657b['model'];if(_0x15fddc['query'][_0x54d8('0x3e')]){_0x101160[_0x54d8('0x3f')]=[{'all':!![]}];}_0x101160=_[_0x54d8('0x3a')]({},_0x101160,_0x15fddc[_0x54d8('0x3d')]);return db[_0x54d8('0x2a')][_0x54d8('0x46')](_0x101160)['then'](handleEntityNotFound(_0x57f8f4,null))[_0x54d8('0x25')](respondWithResult(_0x57f8f4,null))[_0x54d8('0x42')](handleError(_0x57f8f4,null));};exports[_0x54d8('0x47')]=function(_0x5a0786,_0x442790){return db[_0x54d8('0x2a')][_0x54d8('0x47')](_0x5a0786[_0x54d8('0x48')],{})[_0x54d8('0x25')](respondWithResult(_0x442790,0xc9))[_0x54d8('0x42')](handleError(_0x442790,null));};exports[_0x54d8('0x24')]=function(_0x2b2e81,_0x19fabe){if(_0x2b2e81[_0x54d8('0x48')]['id']){delete _0x2b2e81[_0x54d8('0x48')]['id'];}return db['SugarcrmField'][_0x54d8('0x46')]({'where':{'id':_0x2b2e81[_0x54d8('0x49')]['id']}})[_0x54d8('0x25')](handleEntityNotFound(_0x19fabe,null))[_0x54d8('0x25')](saveUpdates(_0x2b2e81[_0x54d8('0x48')],null))[_0x54d8('0x25')](respondWithResult(_0x19fabe,null))[_0x54d8('0x42')](handleError(_0x19fabe,null));};exports[_0x54d8('0x4a')]=function(_0x49b70e,_0x5d245a){return db[_0x54d8('0x2a')]['find']({'where':{'id':_0x49b70e['params']['id']}})['then'](handleEntityNotFound(_0x5d245a,null))['then'](removeEntity(_0x5d245a,null))[_0x54d8('0x42')](handleError(_0x5d245a,null));}; \ No newline at end of file +var _0x066e=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','update','body','eml-format','rimraf','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse'];(function(_0xe65d27,_0x2d928a){var _0x215653=function(_0x26aff9){while(--_0x26aff9){_0xe65d27['push'](_0xe65d27['shift']());}};_0x215653(++_0x2d928a);}(_0x066e,0x1b6));var _0xe066=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x066e[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0xe066('0x0'));var rimraf=require(_0xe066('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(_0xe066('0x2'));var util=require('util');var path=require(_0xe066('0x3'));var sox=require(_0xe066('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe066('0x5'));var _=require(_0xe066('0x6'));var squel=require(_0xe066('0x7'));var crypto=require('crypto');var jsforce=require(_0xe066('0x8'));var deskjs=require(_0xe066('0x9'));var toCsv=require(_0xe066('0xa'));var querystring=require('querystring');var Papa=require(_0xe066('0xb'));var Redis=require(_0xe066('0xc'));var authService=require(_0xe066('0xd'));var qs=require(_0xe066('0xe'));var as=require(_0xe066('0xf'));var hardwareService=require(_0xe066('0x10'));var logger=require(_0xe066('0x11'))(_0xe066('0x12'));var utils=require(_0xe066('0x13'));var config=require(_0xe066('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe066('0x15'))['db'];function respondWithStatusCode(_0x200787,_0x48ed8f){_0x48ed8f=_0x48ed8f||0xcc;return function(_0x103197){if(_0x103197){return _0x200787['sendStatus'](_0x48ed8f);}return _0x200787[_0xe066('0x16')](_0x48ed8f)['end']();};}function respondWithResult(_0xcbf4d6,_0x2841d0){_0x2841d0=_0x2841d0||0xc8;return function(_0x1dcbcd){if(_0x1dcbcd){return _0xcbf4d6['status'](_0x2841d0)[_0xe066('0x17')](_0x1dcbcd);}};}function respondWithFilteredResult(_0x205a90,_0x2bd33f){return function(_0x56fc29){if(_0x56fc29){var _0x11a592=typeof _0x2bd33f[_0xe066('0x18')]===_0xe066('0x19')&&typeof _0x2bd33f[_0xe066('0x1a')]==='undefined';var _0x5afbc5=_0x56fc29[_0xe066('0x1b')];var _0x1dba08=_0x11a592?0x0:_0x2bd33f[_0xe066('0x18')];var _0x5b66d6=_0x11a592?_0x56fc29[_0xe066('0x1b')]:_0x2bd33f[_0xe066('0x18')]+_0x2bd33f[_0xe066('0x1a')];var _0x2ceac3;if(_0x5b66d6>=_0x5afbc5){_0x5b66d6=_0x5afbc5;_0x2ceac3=0xc8;}else{_0x2ceac3=0xce;}_0x205a90[_0xe066('0x16')](_0x2ceac3);return _0x205a90['set'](_0xe066('0x1c'),_0x1dba08+'-'+_0x5b66d6+'/'+_0x5afbc5)['json'](_0x56fc29);}return null;};}function patchUpdates(_0x4b20e6){return function(_0x1cb72c){try{jsonpatch[_0xe066('0x1d')](_0x1cb72c,_0x4b20e6,!![]);}catch(_0x3fe5e5){return BPromise[_0xe066('0x1e')](_0x3fe5e5);}return _0x1cb72c[_0xe066('0x1f')]();};}function saveUpdates(_0x42b24a,_0x26be33){return function(_0x25769b){if(_0x25769b){return _0x25769b['update'](_0x42b24a)[_0xe066('0x20')](function(_0x359cf4){return _0x359cf4;});}return null;};}function removeEntity(_0x13235f,_0xd6584){return function(_0x2da470){if(_0x2da470){return _0x2da470[_0xe066('0x21')]()[_0xe066('0x20')](function(){_0x13235f[_0xe066('0x16')](0xcc)[_0xe066('0x22')]();});}};}function handleEntityNotFound(_0x3a7127,_0x38c9ed){return function(_0x4744ba){if(!_0x4744ba){_0x3a7127[_0xe066('0x23')](0x194);}return _0x4744ba;};}function handleError(_0xf2ea76,_0x59eb4e){_0x59eb4e=_0x59eb4e||0x1f4;return function(_0x38a035){logger[_0xe066('0x24')](_0x38a035[_0xe066('0x25')]);if(_0x38a035[_0xe066('0x26')]){delete _0x38a035['name'];}_0xf2ea76['status'](_0x59eb4e)[_0xe066('0x27')](_0x38a035);};}exports[_0xe066('0x28')]=function(_0x4e8cf7,_0x4b6e88){var _0x5d260a={},_0x3b24ec={},_0x2eb225={'count':0x0,'rows':[]};var _0x32f54d=_[_0xe066('0x29')](db[_0xe066('0x2a')][_0xe066('0x2b')],function(_0x5704e1){return{'name':_0x5704e1[_0xe066('0x2c')],'type':_0x5704e1[_0xe066('0x2d')][_0xe066('0x2e')]};});_0x3b24ec[_0xe066('0x2f')]=_[_0xe066('0x29')](_0x32f54d,_0xe066('0x26'));_0x3b24ec[_0xe066('0x30')]=_['keys'](_0x4e8cf7[_0xe066('0x30')]);_0x3b24ec[_0xe066('0x31')]=_[_0xe066('0x32')](_0x3b24ec[_0xe066('0x2f')],_0x3b24ec[_0xe066('0x30')]);_0x5d260a['attributes']=_[_0xe066('0x32')](_0x3b24ec['model'],qs[_0xe066('0x33')](_0x4e8cf7[_0xe066('0x30')]['fields']));_0x5d260a[_0xe066('0x34')]=_0x5d260a[_0xe066('0x34')][_0xe066('0x35')]?_0x5d260a[_0xe066('0x34')]:_0x3b24ec[_0xe066('0x2f')];if(!_0x4e8cf7[_0xe066('0x30')][_0xe066('0x36')]('nolimit')){_0x5d260a[_0xe066('0x1a')]=qs[_0xe066('0x1a')](_0x4e8cf7[_0xe066('0x30')][_0xe066('0x1a')]);_0x5d260a[_0xe066('0x18')]=qs[_0xe066('0x18')](_0x4e8cf7[_0xe066('0x30')][_0xe066('0x18')]);}_0x5d260a[_0xe066('0x37')]=qs['sort'](_0x4e8cf7[_0xe066('0x30')][_0xe066('0x38')]);_0x5d260a[_0xe066('0x39')]=qs[_0xe066('0x31')](_[_0xe066('0x3a')](_0x4e8cf7[_0xe066('0x30')],_0x3b24ec[_0xe066('0x31')]),_0x32f54d);if(_0x4e8cf7[_0xe066('0x30')][_0xe066('0x3b')]){_0x5d260a[_0xe066('0x39')]=_['merge'](_0x5d260a[_0xe066('0x39')],{'$or':_[_0xe066('0x29')](_0x32f54d,function(_0x45d342){if(_0x45d342[_0xe066('0x2d')]!==_0xe066('0x3c')){var _0x3fc6c1={};_0x3fc6c1[_0x45d342[_0xe066('0x26')]]={'$like':'%'+_0x4e8cf7[_0xe066('0x30')]['filter']+'%'};return _0x3fc6c1;}})});}_0x5d260a=_['merge']({},_0x5d260a,_0x4e8cf7[_0xe066('0x3d')]);var _0x520b6b={'where':_0x5d260a['where']};return db[_0xe066('0x2a')][_0xe066('0x1b')](_0x520b6b)[_0xe066('0x20')](function(_0x2b6d0c){_0x2eb225['count']=_0x2b6d0c;if(_0x4e8cf7['query'][_0xe066('0x3e')]){_0x5d260a[_0xe066('0x3f')]=[{'all':!![]}];}return db[_0xe066('0x2a')][_0xe066('0x40')](_0x5d260a);})[_0xe066('0x20')](function(_0xfa9b31){_0x2eb225[_0xe066('0x41')]=_0xfa9b31;return _0x2eb225;})['then'](respondWithFilteredResult(_0x4b6e88,_0x5d260a))[_0xe066('0x42')](handleError(_0x4b6e88,null));};exports[_0xe066('0x43')]=function(_0x5d7fd2,_0x519745){var _0x10e25f={'raw':!![],'where':{'id':_0x5d7fd2[_0xe066('0x44')]['id']}},_0x270570={};_0x270570['model']=_[_0xe066('0x45')](db[_0xe066('0x2a')][_0xe066('0x2b')]);_0x270570[_0xe066('0x30')]=_[_0xe066('0x45')](_0x5d7fd2[_0xe066('0x30')]);_0x270570[_0xe066('0x31')]=_['intersection'](_0x270570['model'],_0x270570[_0xe066('0x30')]);_0x10e25f[_0xe066('0x34')]=_[_0xe066('0x32')](_0x270570[_0xe066('0x2f')],qs[_0xe066('0x33')](_0x5d7fd2['query'][_0xe066('0x33')]));_0x10e25f[_0xe066('0x34')]=_0x10e25f[_0xe066('0x34')][_0xe066('0x35')]?_0x10e25f[_0xe066('0x34')]:_0x270570['model'];if(_0x5d7fd2['query'][_0xe066('0x3e')]){_0x10e25f[_0xe066('0x3f')]=[{'all':!![]}];}_0x10e25f=_[_0xe066('0x46')]({},_0x10e25f,_0x5d7fd2[_0xe066('0x3d')]);return db[_0xe066('0x2a')][_0xe066('0x47')](_0x10e25f)[_0xe066('0x20')](handleEntityNotFound(_0x519745,null))['then'](respondWithResult(_0x519745,null))[_0xe066('0x42')](handleError(_0x519745,null));};exports[_0xe066('0x48')]=function(_0x2e6c43,_0x3b2b94){return db['SugarcrmField'][_0xe066('0x48')](_0x2e6c43['body'],{})[_0xe066('0x20')](respondWithResult(_0x3b2b94,0xc9))[_0xe066('0x42')](handleError(_0x3b2b94,null));};exports[_0xe066('0x49')]=function(_0xf877a3,_0x115edf){if(_0xf877a3[_0xe066('0x4a')]['id']){delete _0xf877a3[_0xe066('0x4a')]['id'];}return db['SugarcrmField'][_0xe066('0x47')]({'where':{'id':_0xf877a3[_0xe066('0x44')]['id']}})[_0xe066('0x20')](handleEntityNotFound(_0x115edf,null))[_0xe066('0x20')](saveUpdates(_0xf877a3[_0xe066('0x4a')],null))[_0xe066('0x20')](respondWithResult(_0x115edf,null))[_0xe066('0x42')](handleError(_0x115edf,null));};exports[_0xe066('0x21')]=function(_0x1fa77e,_0x468cb0){return db[_0xe066('0x2a')]['find']({'where':{'id':_0x1fa77e[_0xe066('0x44')]['id']}})[_0xe066('0x20')](handleEntityNotFound(_0x468cb0,null))['then'](removeEntity(_0x468cb0,null))[_0xe066('0x42')](handleError(_0x468cb0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0156474..47a62f7 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 _0x238c=['int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x1a5941,_0x8ff9c1){var _0x516dbc=function(_0x28b276){while(--_0x28b276){_0x1a5941['push'](_0x1a5941['shift']());}};_0x516dbc(++_0x8ff9c1);}(_0x238c,0x15d));var _0xc238=function(_0x1e235e,_0x994b77){_0x1e235e=_0x1e235e-0x0;var _0x1e8e94=_0x238c[_0x1e235e];return _0x1e8e94;};'use strict';var _=require(_0xc238('0x0'));var util=require(_0xc238('0x1'));var logger=require(_0xc238('0x2'))(_0xc238('0x3'));var moment=require(_0xc238('0x4'));var BPromise=require('bluebird');var rp=require(_0xc238('0x5'));var fs=require('fs');var path=require(_0xc238('0x6'));var rimraf=require(_0xc238('0x7'));var config=require(_0xc238('0x8'));var attributes=require(_0xc238('0x9'));module[_0xc238('0xa')]=function(_0x3a8ccf,_0xb4f9da){return _0x3a8ccf['define']('SugarcrmField',attributes,{'tableName':_0xc238('0xb'),'paranoid':![],'indexes':[{'name':_0xc238('0xc'),'fields':[_0xc238('0xd'),_0xc238('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9dc0=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9dc0,0x19e));var _0x09dc=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0x9dc0[_0x580d0e];return _0xb51111;};'use strict';var _=require(_0x09dc('0x0'));var util=require(_0x09dc('0x1'));var logger=require(_0x09dc('0x2'))(_0x09dc('0x3'));var moment=require('moment');var BPromise=require(_0x09dc('0x4'));var rp=require(_0x09dc('0x5'));var fs=require('fs');var path=require(_0x09dc('0x6'));var rimraf=require('rimraf');var config=require(_0x09dc('0x7'));var attributes=require(_0x09dc('0x8'));module[_0x09dc('0x9')]=function(_0x583eb3,_0x3173bc){return _0x583eb3[_0x09dc('0xa')](_0x09dc('0xb'),attributes,{'tableName':_0x09dc('0xc'),'paranoid':![],'indexes':[{'name':_0x09dc('0xd'),'fields':[_0x09dc('0xe'),_0x09dc('0xf')],'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 7c8b660..b16a743 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 _0x5eac=['http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5eac,0x15f));var _0xc5ea=function(_0x365802,_0x47d9e8){_0x365802=_0x365802-0x0;var _0x6db0bc=_0x5eac[_0x365802];return _0x6db0bc;};'use strict';var _=require('lodash');var util=require(_0xc5ea('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5ea('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc5ea('0x2'))(_0xc5ea('0x3'));var config=require(_0xc5ea('0x4'));var jayson=require(_0xc5ea('0x5'));var client=jayson['client'][_0xc5ea('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1d4cde,_0x53baf1,_0x4372c5){return new BPromise(function(_0x294941,_0x161145){return client[_0xc5ea('0x7')](_0x1d4cde,_0x4372c5)['then'](function(_0x1936d5){logger[_0xc5ea('0x8')](_0xc5ea('0x9'),_0x53baf1,_0xc5ea('0xa'));logger[_0xc5ea('0xb')](_0xc5ea('0xc'),_0x53baf1,'request\x20sent',JSON['stringify'](_0x1936d5));if(_0x1936d5[_0xc5ea('0xd')]){if(_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xe')]===0x1f4){logger[_0xc5ea('0xd')](_0xc5ea('0x9'),_0x53baf1,_0x1936d5['error'][_0xc5ea('0xf')]);return _0x161145(_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xf')]);}logger[_0xc5ea('0xd')](_0xc5ea('0x9'),_0x53baf1,_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xf')]);return _0x294941(_0x1936d5[_0xc5ea('0xd')][_0xc5ea('0xf')]);}else{logger[_0xc5ea('0x8')](_0xc5ea('0x9'),_0x53baf1,'request\x20sent');_0x294941(_0x1936d5[_0xc5ea('0x10')][_0xc5ea('0xf')]);}})['catch'](function(_0x2ec766){logger[_0xc5ea('0xd')](_0xc5ea('0x9'),_0x53baf1,_0x2ec766);_0x161145(_0x2ec766);});});} \ No newline at end of file +var _0xcb2e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x49b71e,_0x5cbe50){var _0x2a9e89=function(_0x221db8){while(--_0x221db8){_0x49b71e['push'](_0x49b71e['shift']());}};_0x2a9e89(++_0x5cbe50);}(_0xcb2e,0x99));var _0xecb2=function(_0x42228c,_0x2dc0e6){_0x42228c=_0x42228c-0x0;var _0x4616a5=_0xcb2e[_0x42228c];return _0x4616a5;};'use strict';var _=require(_0xecb2('0x0'));var util=require('util');var moment=require(_0xecb2('0x1'));var BPromise=require(_0xecb2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecb2('0x3'));var db=require(_0xecb2('0x4'))['db'];var utils=require(_0xecb2('0x5'));var logger=require(_0xecb2('0x6'))(_0xecb2('0x7'));var config=require(_0xecb2('0x8'));var jayson=require(_0xecb2('0x9'));var client=jayson['client'][_0xecb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x397f40,_0x560e6f,_0x4750fc){return new BPromise(function(_0x9e40c7,_0x4327b7){return client['request'](_0x397f40,_0x4750fc)[_0xecb2('0xb')](function(_0x10d48b){logger[_0xecb2('0xc')](_0xecb2('0xd'),_0x560e6f,_0xecb2('0xe'));logger['debug'](_0xecb2('0xf'),_0x560e6f,'request\x20sent',JSON[_0xecb2('0x10')](_0x10d48b));if(_0x10d48b[_0xecb2('0x11')]){if(_0x10d48b[_0xecb2('0x11')][_0xecb2('0x12')]===0x1f4){logger[_0xecb2('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x560e6f,_0x10d48b[_0xecb2('0x11')]['message']);return _0x4327b7(_0x10d48b[_0xecb2('0x11')]['message']);}logger['error'](_0xecb2('0xd'),_0x560e6f,_0x10d48b['error'][_0xecb2('0x13')]);return _0x9e40c7(_0x10d48b[_0xecb2('0x11')]['message']);}else{logger['info'](_0xecb2('0xd'),_0x560e6f,_0xecb2('0xe'));_0x9e40c7(_0x10d48b[_0xecb2('0x14')][_0xecb2('0x13')]);}})['catch'](function(_0x2c65b7){logger[_0xecb2('0x11')](_0xecb2('0xd'),_0x560e6f,_0x2c65b7);_0x4327b7(_0x2c65b7);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a62b1e2..a69cb14 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 _0x4a5a=['update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','show','/:id/fields','getFields','create','post'];(function(_0x57b692,_0x51f860){var _0x512276=function(_0xc34267){while(--_0xc34267){_0x57b692['push'](_0x57b692['shift']());}};_0x512276(++_0x51f860);}(_0x4a5a,0x6e));var _0xa4a5=function(_0x19dc45,_0x5bb835){_0x19dc45=_0x19dc45-0x0;var _0x221b31=_0x4a5a[_0x19dc45];return _0x221b31;};'use strict';var multer=require(_0xa4a5('0x0'));var util=require('util');var path=require(_0xa4a5('0x1'));var timeout=require(_0xa4a5('0x2'));var express=require(_0xa4a5('0x3'));var router=express['Router']();var fs_extra=require(_0xa4a5('0x4'));var auth=require(_0xa4a5('0x5'));var interaction=require(_0xa4a5('0x6'));var config=require(_0xa4a5('0x7'));var controller=require(_0xa4a5('0x8'));router[_0xa4a5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa4a5('0x9')]('/:id',auth[_0xa4a5('0xa')](),controller[_0xa4a5('0xb')]);router[_0xa4a5('0x9')]('/:id/configurations',auth[_0xa4a5('0xa')](),controller['getConfigurations']);router[_0xa4a5('0x9')](_0xa4a5('0xc'),auth[_0xa4a5('0xa')](),controller[_0xa4a5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa4a5('0xe')]);router[_0xa4a5('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xa4a5('0xa')](),controller[_0xa4a5('0x10')]);router[_0xa4a5('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3738=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','put','update','delete'];(function(_0x5d02af,_0x450394){var _0x3abca8=function(_0x496154){while(--_0x496154){_0x5d02af['push'](_0x5d02af['shift']());}};_0x3abca8(++_0x450394);}(_0x3738,0x1e5));var _0x8373=function(_0x320cb3,_0x49c0cf){_0x320cb3=_0x320cb3-0x0;var _0x899c86=_0x3738[_0x320cb3];return _0x899c86;};'use strict';var multer=require('multer');var util=require(_0x8373('0x0'));var path=require(_0x8373('0x1'));var timeout=require(_0x8373('0x2'));var express=require(_0x8373('0x3'));var router=express[_0x8373('0x4')]();var fs_extra=require(_0x8373('0x5'));var auth=require(_0x8373('0x6'));var interaction=require(_0x8373('0x7'));var config=require(_0x8373('0x8'));var controller=require(_0x8373('0x9'));router[_0x8373('0xa')]('/',auth[_0x8373('0xb')](),controller['index']);router[_0x8373('0xa')](_0x8373('0xc'),auth[_0x8373('0xb')](),controller[_0x8373('0xd')]);router[_0x8373('0xa')]('/:id/configurations',auth[_0x8373('0xb')](),controller[_0x8373('0xe')]);router[_0x8373('0xa')](_0x8373('0xf'),auth[_0x8373('0xb')](),controller[_0x8373('0x10')]);router[_0x8373('0x11')]('/',auth[_0x8373('0xb')](),controller['create']);router[_0x8373('0x11')]('/:id/configurations',auth[_0x8373('0xb')](),controller['addConfiguration']);router[_0x8373('0x12')](_0x8373('0xc'),auth['isAuthenticated'](),controller[_0x8373('0x13')]);router[_0x8373('0x14')](_0x8373('0xc'),auth[_0x8373('0xb')](),controller['destroy']);module[_0x8373('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 0f95277..d41913e 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 _0xd37c=['STRING','sequelize','exports'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xd37c,0xd9));var _0xcd37=function(_0xb8e5aa,_0x5d1a94){_0xb8e5aa=_0xb8e5aa-0x0;var _0x38fee2=_0xd37c[_0xb8e5aa];return _0x38fee2;};'use strict';var Sequelize=require(_0xcd37('0x0'));module[_0xcd37('0x1')]={'name':{'type':Sequelize[_0xcd37('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcd37('0x2')]},'username':{'type':Sequelize[_0xcd37('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xcd37('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xcd37('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x183b=['exports','STRING','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x183b,0x149));var _0xb183=function(_0x206053,_0x4b659e){_0x206053=_0x206053-0x0;var _0x5e7e57=_0x183b[_0x206053];return _0x5e7e57;};'use strict';var Sequelize=require(_0xb183('0x0'));module[_0xb183('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb183('0x2')]},'username':{'type':Sequelize[_0xb183('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb183('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xb183('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 24eb941..5f291dc 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 _0x736f=['statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','type','VIRTUAL','filter','merge','options','include','findAll','catch','show','keys','find','create','body','params','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','username','remoteUri','accessKey','substring','lastIndexOf','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','reference','remove','includes','editable','false','label','startsWith','cf_','picklistValues','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x736f,0xed));var _0xf736=function(_0xfae941,_0x31dc68){_0xfae941=_0xfae941-0x0;var _0xd21834=_0x736f[_0xfae941];return _0xd21834;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf736('0x0'));var jsonpatch=require(_0xf736('0x1'));var rp=require(_0xf736('0x2'));var moment=require(_0xf736('0x3'));var BPromise=require(_0xf736('0x4'));var Mustache=require('mustache');var util=require(_0xf736('0x5'));var path=require(_0xf736('0x6'));var sox=require(_0xf736('0x7'));var csv=require('to-csv');var ejs=require(_0xf736('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf736('0x9'));var squel=require('squel');var crypto=require(_0xf736('0xa'));var jsforce=require(_0xf736('0xb'));var deskjs=require(_0xf736('0xc'));var toCsv=require(_0xf736('0xd'));var querystring=require('querystring');var Papa=require(_0xf736('0xe'));var Redis=require(_0xf736('0xf'));var authService=require(_0xf736('0x10'));var qs=require(_0xf736('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf736('0x12'));var logger=require(_0xf736('0x13'))(_0xf736('0x14'));var utils=require(_0xf736('0x15'));var config=require(_0xf736('0x16'));var licenseUtil=require(_0xf736('0x17'));var db=require(_0xf736('0x18'))['db'];var integrations=require(_0xf736('0x19'));function respondWithStatusCode(_0x4e3dd4,_0x435079){_0x435079=_0x435079||0xcc;return function(_0x4ed611){if(_0x4ed611){return _0x4e3dd4['sendStatus'](_0x435079);}return _0x4e3dd4['status'](_0x435079)[_0xf736('0x1a')]();};}function respondWithResult(_0x5324d8,_0x45b252){_0x45b252=_0x45b252||0xc8;return function(_0x2e2dce){if(_0x2e2dce){return _0x5324d8['status'](_0x45b252)[_0xf736('0x1b')](_0x2e2dce);}};}function respondWithFilteredResult(_0x3b422e,_0x646c02){return function(_0x309105){if(_0x309105){var _0x32d215=typeof _0x646c02[_0xf736('0x1c')]===_0xf736('0x1d')&&typeof _0x646c02['limit']===_0xf736('0x1d');var _0x44358d=_0x309105[_0xf736('0x1e')];var _0x16fc91=_0x32d215?0x0:_0x646c02[_0xf736('0x1c')];var _0x409558=_0x32d215?_0x309105['count']:_0x646c02[_0xf736('0x1c')]+_0x646c02[_0xf736('0x1f')];var _0x588db4;if(_0x409558>=_0x44358d){_0x409558=_0x44358d;_0x588db4=0xc8;}else{_0x588db4=0xce;}_0x3b422e[_0xf736('0x20')](_0x588db4);return _0x3b422e[_0xf736('0x21')](_0xf736('0x22'),_0x16fc91+'-'+_0x409558+'/'+_0x44358d)[_0xf736('0x1b')](_0x309105);}return null;};}function patchUpdates(_0x24698a){return function(_0x5dea4e){try{jsonpatch[_0xf736('0x23')](_0x5dea4e,_0x24698a,!![]);}catch(_0x35d82c){return BPromise[_0xf736('0x24')](_0x35d82c);}return _0x5dea4e[_0xf736('0x25')]();};}function saveUpdates(_0x2348d2,_0x30a2d8){return function(_0x405a62){if(_0x405a62){return _0x405a62[_0xf736('0x26')](_0x2348d2)[_0xf736('0x27')](function(_0x4f997f){return _0x4f997f;});}return null;};}function removeEntity(_0xc78285,_0x281672){return function(_0x120e9e){if(_0x120e9e){return _0x120e9e[_0xf736('0x28')]()[_0xf736('0x27')](function(){_0xc78285[_0xf736('0x20')](0xcc)[_0xf736('0x1a')]();});}};}function handleEntityNotFound(_0xbff798,_0x293c40){return function(_0x2d5ffa){if(!_0x2d5ffa){_0xbff798['sendStatus'](0x194);}return _0x2d5ffa;};}function handleError(_0x12883f,_0x513971){_0x513971=_0x513971||0x1f4;return function(_0x211f20){logger[_0xf736('0x29')](_0x211f20[_0xf736('0x2a')]);if(_0x211f20[_0xf736('0x2b')]){delete _0x211f20[_0xf736('0x2b')];}_0x12883f[_0xf736('0x20')](_0x513971)[_0xf736('0x2c')](_0x211f20);};}exports[_0xf736('0x2d')]=function(_0x3decb9,_0x2cb04c){var _0xd576a0={},_0x41de95={},_0x7fe9d1={'count':0x0,'rows':[]};var _0x2c72c9=_[_0xf736('0x2e')](db[_0xf736('0x2f')][_0xf736('0x30')],function(_0x2ff7eb){return{'name':_0x2ff7eb[_0xf736('0x31')],'type':_0x2ff7eb['type'][_0xf736('0x32')]};});_0x41de95[_0xf736('0x33')]=_[_0xf736('0x2e')](_0x2c72c9,'name');_0x41de95[_0xf736('0x34')]=_['keys'](_0x3decb9[_0xf736('0x34')]);_0x41de95['filters']=_[_0xf736('0x35')](_0x41de95[_0xf736('0x33')],_0x41de95[_0xf736('0x34')]);_0xd576a0['attributes']=_[_0xf736('0x35')](_0x41de95[_0xf736('0x33')],qs[_0xf736('0x36')](_0x3decb9[_0xf736('0x34')]['fields']));_0xd576a0[_0xf736('0x37')]=_0xd576a0[_0xf736('0x37')][_0xf736('0x38')]?_0xd576a0[_0xf736('0x37')]:_0x41de95['model'];if(!_0x3decb9[_0xf736('0x34')][_0xf736('0x39')](_0xf736('0x3a'))){_0xd576a0[_0xf736('0x1f')]=qs[_0xf736('0x1f')](_0x3decb9[_0xf736('0x34')]['limit']);_0xd576a0['offset']=qs['offset'](_0x3decb9['query'][_0xf736('0x1c')]);}_0xd576a0[_0xf736('0x3b')]=qs[_0xf736('0x3c')](_0x3decb9[_0xf736('0x34')][_0xf736('0x3c')]);_0xd576a0[_0xf736('0x3d')]=qs['filters'](_[_0xf736('0x3e')](_0x3decb9[_0xf736('0x34')],_0x41de95[_0xf736('0x3f')]),_0x2c72c9);if(_0x3decb9[_0xf736('0x34')]['filter']){_0xd576a0['where']=_['merge'](_0xd576a0[_0xf736('0x3d')],{'$or':_[_0xf736('0x2e')](_0x2c72c9,function(_0x215fe3){if(_0x215fe3[_0xf736('0x40')]!==_0xf736('0x41')){var _0x3f536d={};_0x3f536d[_0x215fe3[_0xf736('0x2b')]]={'$like':'%'+_0x3decb9[_0xf736('0x34')][_0xf736('0x42')]+'%'};return _0x3f536d;}})});}_0xd576a0=_[_0xf736('0x43')]({},_0xd576a0,_0x3decb9[_0xf736('0x44')]);var _0x357b84={'where':_0xd576a0[_0xf736('0x3d')]};return db[_0xf736('0x2f')]['count'](_0x357b84)[_0xf736('0x27')](function(_0x1025cb){_0x7fe9d1[_0xf736('0x1e')]=_0x1025cb;if(_0x3decb9[_0xf736('0x34')]['includeAll']){_0xd576a0[_0xf736('0x45')]=[{'all':!![]}];}return db[_0xf736('0x2f')][_0xf736('0x46')](_0xd576a0);})[_0xf736('0x27')](function(_0x1bf2ba){_0x7fe9d1['rows']=_0x1bf2ba;return _0x7fe9d1;})[_0xf736('0x27')](respondWithFilteredResult(_0x2cb04c,_0xd576a0))[_0xf736('0x47')](handleError(_0x2cb04c,null));};exports[_0xf736('0x48')]=function(_0xa0d33f,_0x537577){var _0x50b357={'raw':![],'where':{'id':_0xa0d33f['params']['id']}},_0x1ca05f={};_0x1ca05f[_0xf736('0x33')]=_[_0xf736('0x49')](db[_0xf736('0x2f')][_0xf736('0x30')]);_0x1ca05f[_0xf736('0x34')]=_[_0xf736('0x49')](_0xa0d33f['query']);_0x1ca05f[_0xf736('0x3f')]=_[_0xf736('0x35')](_0x1ca05f[_0xf736('0x33')],_0x1ca05f[_0xf736('0x34')]);_0x50b357[_0xf736('0x37')]=_[_0xf736('0x35')](_0x1ca05f['model'],qs[_0xf736('0x36')](_0xa0d33f[_0xf736('0x34')]['fields']));_0x50b357[_0xf736('0x37')]=_0x50b357[_0xf736('0x37')][_0xf736('0x38')]?_0x50b357[_0xf736('0x37')]:_0x1ca05f[_0xf736('0x33')];if(_0xa0d33f[_0xf736('0x34')]['includeAll']){_0x50b357[_0xf736('0x45')]=[{'all':!![]}];}_0x50b357=_['merge']({},_0x50b357,_0xa0d33f['options']);return db[_0xf736('0x2f')][_0xf736('0x4a')](_0x50b357)[_0xf736('0x27')](handleEntityNotFound(_0x537577,null))[_0xf736('0x27')](respondWithResult(_0x537577,null))[_0xf736('0x47')](handleError(_0x537577,null));};exports[_0xf736('0x4b')]=function(_0x38e8e4,_0x19cf8f){return db['VtigerAccount'][_0xf736('0x4b')](_0x38e8e4[_0xf736('0x4c')],{})[_0xf736('0x27')](respondWithResult(_0x19cf8f,0xc9))[_0xf736('0x47')](handleError(_0x19cf8f,null));};exports[_0xf736('0x26')]=function(_0x382f52,_0x1ab3b3){if(_0x382f52['body']['id']){delete _0x382f52[_0xf736('0x4c')]['id'];}return db[_0xf736('0x2f')]['find']({'where':{'id':_0x382f52[_0xf736('0x4d')]['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x1ab3b3,null))[_0xf736('0x27')](saveUpdates(_0x382f52[_0xf736('0x4c')],null))[_0xf736('0x27')](respondWithResult(_0x1ab3b3,null))[_0xf736('0x47')](handleError(_0x1ab3b3,null));};exports[_0xf736('0x28')]=function(_0x5627cc,_0x196b55){return db['VtigerAccount'][_0xf736('0x4a')]({'where':{'id':_0x5627cc['params']['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x196b55,null))['then'](removeEntity(_0x196b55,null))[_0xf736('0x47')](handleError(_0x196b55,null));};exports['getConfigurations']=function(_0x3f70ae,_0x568223,_0x41ebc8){var _0x357aa0={};var _0x52a63e={};var _0x42a58f;var _0x46ace5;return db[_0xf736('0x2f')][_0xf736('0x4e')]({'where':{'id':_0x3f70ae[_0xf736('0x4d')]['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x568223,null))['then'](function(_0x4b6bff){if(_0x4b6bff){_0x42a58f=_0x4b6bff;_0x52a63e[_0xf736('0x33')]=_[_0xf736('0x49')](db[_0xf736('0x4f')][_0xf736('0x30')]);_0x52a63e[_0xf736('0x34')]=_[_0xf736('0x49')](_0x3f70ae[_0xf736('0x34')]);_0x52a63e[_0xf736('0x3f')]=_[_0xf736('0x35')](_0x52a63e[_0xf736('0x33')],_0x52a63e['query']);_0x357aa0[_0xf736('0x37')]=_[_0xf736('0x35')](_0x52a63e[_0xf736('0x33')],qs[_0xf736('0x36')](_0x3f70ae[_0xf736('0x34')][_0xf736('0x36')]));_0x357aa0[_0xf736('0x37')]=_0x357aa0[_0xf736('0x37')][_0xf736('0x38')]?_0x357aa0[_0xf736('0x37')]:_0x52a63e[_0xf736('0x33')];_0x357aa0[_0xf736('0x3b')]=qs[_0xf736('0x3c')](_0x3f70ae[_0xf736('0x34')][_0xf736('0x3c')]);_0x357aa0[_0xf736('0x3d')]=qs[_0xf736('0x3f')](_[_0xf736('0x3e')](_0x3f70ae[_0xf736('0x34')],_0x52a63e['filters']));if(_0x3f70ae[_0xf736('0x34')][_0xf736('0x42')]){_0x357aa0[_0xf736('0x3d')]=_[_0xf736('0x43')](_0x357aa0[_0xf736('0x3d')],{'$or':_[_0xf736('0x2e')](_0x357aa0['attributes'],function(_0x31c692){var _0x9b3fad={};_0x9b3fad[_0x31c692]={'$like':'%'+_0x3f70ae[_0xf736('0x34')][_0xf736('0x42')]+'%'};return _0x9b3fad;})});}_0x357aa0=_[_0xf736('0x43')]({},_0x357aa0,_0x3f70ae[_0xf736('0x44')]);return _0x42a58f[_0xf736('0x50')](_0x357aa0);}})[_0xf736('0x27')](function(_0x4c1e1f){if(_0x4c1e1f){_0x46ace5=_0x4c1e1f['length'];if(!_0x3f70ae[_0xf736('0x34')][_0xf736('0x39')](_0xf736('0x3a'))){_0x357aa0['limit']=qs[_0xf736('0x1f')](_0x3f70ae['query'][_0xf736('0x1f')]);_0x357aa0[_0xf736('0x1c')]=qs['offset'](_0x3f70ae[_0xf736('0x34')][_0xf736('0x1c')]);}return _0x42a58f[_0xf736('0x50')](_0x357aa0);}})[_0xf736('0x27')](function(_0x2647bb){if(_0x2647bb){return _0x2647bb?{'count':_0x46ace5,'rows':_0x2647bb}:null;}})[_0xf736('0x27')](respondWithResult(_0x568223,null))[_0xf736('0x47')](handleError(_0x568223,null));};exports[_0xf736('0x51')]=function(_0x52779e,_0x11d0cd,_0x1fb1ce){if(_0x52779e[_0xf736('0x4c')]['id']){delete _0x52779e[_0xf736('0x4c')]['id'];}return db[_0xf736('0x2f')][_0xf736('0x4e')]({'where':{'id':_0x52779e[_0xf736('0x4d')]['id']}})[_0xf736('0x27')](handleEntityNotFound(_0x11d0cd,null))[_0xf736('0x27')](function(_0x27bb2a){if(_0x27bb2a){_0x52779e[_0xf736('0x4c')][_0xf736('0x52')]=_0x27bb2a['id'];_0x52779e['body'][_0xf736('0x53')]=integrations[_0xf736('0x54')](_0x52779e[_0xf736('0x4c')][_0xf736('0x55')],_0x52779e[_0xf736('0x4c')]['type']);_0x52779e[_0xf736('0x4c')][_0xf736('0x56')]=integrations[_0xf736('0x57')](_0x52779e[_0xf736('0x4c')]['channel'],_0x52779e[_0xf736('0x4c')][_0xf736('0x40')]);return db[_0xf736('0x4f')][_0xf736('0x4b')](_0x52779e['body'],{'include':[{'model':db['VtigerField'],'as':_0xf736('0x53')},{'model':db[_0xf736('0x58')],'as':_0xf736('0x56')}]});}return null;})[_0xf736('0x27')](respondWithResult(_0x11d0cd,null))['catch'](handleError(_0x11d0cd,null));};var md5=require('md5');exports[_0xf736('0x59')]=function(_0x74ce67,_0x1d6b93,_0x32b7af){var _0x39d405=null;var _0x2bbec1=null;var _0xe27a20=null;var _0x55d2ca=null;var _0x3d78a1='';return db[_0xf736('0x2f')][_0xf736('0x4e')]({'where':{'id':_0x74ce67['params']['id']},'attributes':['id','name',_0xf736('0x5a'),'description','moduleName',_0xf736('0x5b'),'serverUrl','accessKey']})[_0xf736('0x27')](handleEntityNotFound(_0x1d6b93,null))[_0xf736('0x27')](function(_0x89963d){if(_0x89963d){_0x39d405=_0x89963d[_0xf736('0x5a')];_0x2bbec1=_0x89963d[_0xf736('0x5c')];_0xe27a20=_0x89963d['moduleName'];_0x3d78a1=_0x89963d[_0xf736('0x5b')];var _0x3cdfa9=_0x3d78a1['slice'](-0x1);if(_0x3cdfa9==='/'){_0x3d78a1=_0x3d78a1[_0xf736('0x5d')](0x0,_0x3d78a1[_0xf736('0x5e')](_0x3cdfa9));}_0x55d2ca=util['format']('%s/webservice.php',_0x3d78a1);var _0x467df0={'method':_0xf736('0x5f'),'uri':_0x55d2ca,'qs':{'operation':_0xf736('0x60'),'username':_0x89963d[_0xf736('0x5a')]},'json':!![]};return rp(_0x467df0);}})['then'](function(_0x3b85ae){if(_0x3b85ae[_0xf736('0x61')]){var _0xa36fc4={'method':_0xf736('0x62'),'uri':_0x55d2ca,'form':{'operation':_0xf736('0x63'),'username':_0x39d405,'accessKey':md5(_0x3b85ae[_0xf736('0x64')][_0xf736('0x65')]+_0x2bbec1)},'json':!![]};return rp(_0xa36fc4);}})[_0xf736('0x27')](function(_0x2d5b01){if(_0x2d5b01[_0xf736('0x61')]){var _0x52fee5={'method':_0xf736('0x5f'),'uri':_0x55d2ca,'qs':{'operation':_0xf736('0x66'),'username':_0x39d405,'sessionName':_0x2d5b01['result']['sessionName'],'elementType':_0xe27a20},'json':!![]};return rp(_0x52fee5);}})['then'](function(_0x3ce212){if(_0x3ce212[_0xf736('0x61')]){var _0xaf0ab6=[_0xf736('0x67'),_0xf736('0x68'),'owner'];_[_0xf736('0x69')](_0x3ce212[_0xf736('0x64')][_0xf736('0x36')],function(_0x14d93a){return _0xaf0ab6[_0xf736('0x6a')](_0x14d93a[_0xf736('0x40')][_0xf736('0x2b')]);});_[_0xf736('0x69')](_0x3ce212[_0xf736('0x64')]['fields'],function(_0x16ebc6){return _0x16ebc6[_0xf736('0x6b')]===_0xf736('0x6c');});return{'count':_0x3ce212['result'][_0xf736('0x36')][_0xf736('0x38')],'rows':_[_0xf736('0x2e')](_0x3ce212[_0xf736('0x64')][_0xf736('0x36')],function(_0x472ff1){return{'id':_0x472ff1[_0xf736('0x2b')],'name':_0x472ff1[_0xf736('0x6d')],'custom':_[_0xf736('0x6e')](_0x472ff1[_0xf736('0x2b')],_0xf736('0x6f'))?!![]:![],'options':_0x472ff1[_0xf736('0x40')][_0xf736('0x2b')]==='picklist'&&_0x472ff1[_0xf736('0x40')][_0xf736('0x70')][_0xf736('0x38')]>0x0?_['map'](_0x472ff1[_0xf736('0x40')][_0xf736('0x70')],function(_0x2672ef){return{'name':_0x2672ef[_0xf736('0x6d')],'value':_0x2672ef['value']};}):[]};})};}})[_0xf736('0x27')](respondWithResult(_0x1d6b93,null))[_0xf736('0x47')](function(_0x55b49d){console['log']('vTiger\x20error:\x20'+_0x55b49d);var _0xd19e53=_0x74ce67['query'][_0xf736('0x71')]?0x1f4:_0x55b49d['statusCode']||0x1f4;logger[_0xf736('0x29')](_0xf736('0x72'),_0xf736('0x59'),_0xd19e53,JSON[_0xf736('0x73')](_0x55b49d));delete _0x55b49d[_0xf736('0x2b')];if(_0xd19e53===0x191){_0xd19e53=0x190;}_0x1d6b93[_0xf736('0x20')](_0xd19e53)[_0xf736('0x2c')](_0x74ce67['query'][_0xf736('0x71')]?{'message':_0xf736('0x74'),'statusCode':_0x55b49d[_0xf736('0x75')]}:_0x55b49d);});}; \ No newline at end of file +var _0x63c1=['../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','name','index','VtigerAccount','fieldName','model','map','query','keys','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','params','destroy','findOne','length','order','hasOwnProperty','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','describe','sessionName','autogenerated','owner','includes','editable','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields','send','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment'];(function(_0x54fe8e,_0x367724){var _0x179a00=function(_0x52a2b0){while(--_0x52a2b0){_0x54fe8e['push'](_0x54fe8e['shift']());}};_0x179a00(++_0x367724);}(_0x63c1,0xce));var _0x163c=function(_0x3ff51b,_0x494576){_0x3ff51b=_0x3ff51b-0x0;var _0x15f044=_0x63c1[_0x3ff51b];return _0x15f044;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x163c('0x0'));var zipdir=require(_0x163c('0x1'));var jsonpatch=require(_0x163c('0x2'));var rp=require(_0x163c('0x3'));var moment=require('moment');var BPromise=require(_0x163c('0x4'));var Mustache=require(_0x163c('0x5'));var util=require(_0x163c('0x6'));var path=require(_0x163c('0x7'));var sox=require('sox');var csv=require(_0x163c('0x8'));var ejs=require(_0x163c('0x9'));var fs=require('fs');var fs_extra=require(_0x163c('0xa'));var _=require(_0x163c('0xb'));var squel=require(_0x163c('0xc'));var crypto=require(_0x163c('0xd'));var jsforce=require(_0x163c('0xe'));var deskjs=require(_0x163c('0xf'));var toCsv=require(_0x163c('0x8'));var querystring=require('querystring');var Papa=require(_0x163c('0x10'));var Redis=require(_0x163c('0x11'));var authService=require(_0x163c('0x12'));var qs=require(_0x163c('0x13'));var as=require(_0x163c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x163c('0x15'));var utils=require(_0x163c('0x16'));var config=require(_0x163c('0x17'));var licenseUtil=require(_0x163c('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2443cb,_0x320d3f){_0x320d3f=_0x320d3f||0xcc;return function(_0x4e95f6){if(_0x4e95f6){return _0x2443cb[_0x163c('0x19')](_0x320d3f);}return _0x2443cb[_0x163c('0x1a')](_0x320d3f)[_0x163c('0x1b')]();};}function respondWithResult(_0x513b07,_0x421d7f){_0x421d7f=_0x421d7f||0xc8;return function(_0x602870){if(_0x602870){return _0x513b07['status'](_0x421d7f)[_0x163c('0x1c')](_0x602870);}};}function respondWithFilteredResult(_0x3ebe7d,_0x3a2cf3){return function(_0x22d83f){if(_0x22d83f){var _0x57f2b3=typeof _0x3a2cf3[_0x163c('0x1d')]==='undefined'&&typeof _0x3a2cf3['limit']===_0x163c('0x1e');var _0x366c4b=_0x22d83f[_0x163c('0x1f')];var _0x325a52=_0x57f2b3?0x0:_0x3a2cf3[_0x163c('0x1d')];var _0x4da56=_0x57f2b3?_0x22d83f[_0x163c('0x1f')]:_0x3a2cf3[_0x163c('0x1d')]+_0x3a2cf3['limit'];var _0x6db55d;if(_0x4da56>=_0x366c4b){_0x4da56=_0x366c4b;_0x6db55d=0xc8;}else{_0x6db55d=0xce;}_0x3ebe7d[_0x163c('0x1a')](_0x6db55d);return _0x3ebe7d[_0x163c('0x20')](_0x163c('0x21'),_0x325a52+'-'+_0x4da56+'/'+_0x366c4b)['json'](_0x22d83f);}return null;};}function patchUpdates(_0x11ceb7){return function(_0x5e4963){try{jsonpatch[_0x163c('0x22')](_0x5e4963,_0x11ceb7,!![]);}catch(_0x547ad5){return BPromise['reject'](_0x547ad5);}return _0x5e4963['save']();};}function saveUpdates(_0x8a05e0,_0x39e87a){return function(_0x3ce036){if(_0x3ce036){return _0x3ce036[_0x163c('0x23')](_0x8a05e0)['then'](function(_0x20b048){return _0x20b048;});}return null;};}function removeEntity(_0x14b0d4,_0x231431){return function(_0xf3d8b6){if(_0xf3d8b6){return _0xf3d8b6['destroy']()[_0x163c('0x24')](function(){_0x14b0d4[_0x163c('0x1a')](0xcc)[_0x163c('0x1b')]();});}};}function handleEntityNotFound(_0x19423d,_0x59ca1b){return function(_0x2dd559){if(!_0x2dd559){_0x19423d[_0x163c('0x19')](0x194);}return _0x2dd559;};}function handleError(_0x1f0653,_0x152705){_0x152705=_0x152705||0x1f4;return function(_0x523bd0){logger['error'](_0x523bd0['stack']);if(_0x523bd0[_0x163c('0x25')]){delete _0x523bd0[_0x163c('0x25')];}_0x1f0653[_0x163c('0x1a')](_0x152705)['send'](_0x523bd0);};}exports[_0x163c('0x26')]=function(_0x45de26,_0x4d9d08){var _0x13eb57={},_0x15ff83={},_0x4f8f95={'count':0x0,'rows':[]};var _0x1c8050=_['map'](db[_0x163c('0x27')]['rawAttributes'],function(_0x408ded){return{'name':_0x408ded[_0x163c('0x28')],'type':_0x408ded['type']['key']};});_0x15ff83[_0x163c('0x29')]=_[_0x163c('0x2a')](_0x1c8050,_0x163c('0x25'));_0x15ff83[_0x163c('0x2b')]=_[_0x163c('0x2c')](_0x45de26[_0x163c('0x2b')]);_0x15ff83['filters']=_[_0x163c('0x2d')](_0x15ff83[_0x163c('0x29')],_0x15ff83[_0x163c('0x2b')]);_0x13eb57[_0x163c('0x2e')]=_['intersection'](_0x15ff83[_0x163c('0x29')],qs[_0x163c('0x2f')](_0x45de26['query'][_0x163c('0x2f')]));_0x13eb57[_0x163c('0x2e')]=_0x13eb57[_0x163c('0x2e')]['length']?_0x13eb57['attributes']:_0x15ff83[_0x163c('0x29')];if(!_0x45de26[_0x163c('0x2b')]['hasOwnProperty'](_0x163c('0x30'))){_0x13eb57[_0x163c('0x31')]=qs[_0x163c('0x31')](_0x45de26['query'][_0x163c('0x31')]);_0x13eb57['offset']=qs['offset'](_0x45de26[_0x163c('0x2b')][_0x163c('0x1d')]);}_0x13eb57['order']=qs[_0x163c('0x32')](_0x45de26[_0x163c('0x2b')][_0x163c('0x32')]);_0x13eb57[_0x163c('0x33')]=qs[_0x163c('0x34')](_[_0x163c('0x35')](_0x45de26[_0x163c('0x2b')],_0x15ff83[_0x163c('0x34')]),_0x1c8050);if(_0x45de26[_0x163c('0x2b')]['filter']){_0x13eb57[_0x163c('0x33')]=_[_0x163c('0x36')](_0x13eb57[_0x163c('0x33')],{'$or':_[_0x163c('0x2a')](_0x1c8050,function(_0xc7876e){if(_0xc7876e[_0x163c('0x37')]!==_0x163c('0x38')){var _0x490a2e={};_0x490a2e[_0xc7876e[_0x163c('0x25')]]={'$like':'%'+_0x45de26['query']['filter']+'%'};return _0x490a2e;}})});}_0x13eb57=_[_0x163c('0x36')]({},_0x13eb57,_0x45de26[_0x163c('0x39')]);var _0xff17d0={'where':_0x13eb57[_0x163c('0x33')]};return db[_0x163c('0x27')][_0x163c('0x1f')](_0xff17d0)['then'](function(_0x51a7b3){_0x4f8f95['count']=_0x51a7b3;if(_0x45de26[_0x163c('0x2b')]['includeAll']){_0x13eb57[_0x163c('0x3a')]=[{'all':!![]}];}return db[_0x163c('0x27')][_0x163c('0x3b')](_0x13eb57);})[_0x163c('0x24')](function(_0x4498ef){_0x4f8f95[_0x163c('0x3c')]=_0x4498ef;return _0x4f8f95;})['then'](respondWithFilteredResult(_0x4d9d08,_0x13eb57))[_0x163c('0x3d')](handleError(_0x4d9d08,null));};exports[_0x163c('0x3e')]=function(_0x533a5f,_0x16acfc){var _0x25f2a1={'raw':![],'where':{'id':_0x533a5f['params']['id']}},_0x236939={};_0x236939[_0x163c('0x29')]=_['keys'](db['VtigerAccount'][_0x163c('0x3f')]);_0x236939[_0x163c('0x2b')]=_[_0x163c('0x2c')](_0x533a5f['query']);_0x236939[_0x163c('0x34')]=_['intersection'](_0x236939[_0x163c('0x29')],_0x236939[_0x163c('0x2b')]);_0x25f2a1[_0x163c('0x2e')]=_[_0x163c('0x2d')](_0x236939[_0x163c('0x29')],qs[_0x163c('0x2f')](_0x533a5f[_0x163c('0x2b')][_0x163c('0x2f')]));_0x25f2a1[_0x163c('0x2e')]=_0x25f2a1[_0x163c('0x2e')]['length']?_0x25f2a1[_0x163c('0x2e')]:_0x236939['model'];if(_0x533a5f['query'][_0x163c('0x40')]){_0x25f2a1[_0x163c('0x3a')]=[{'all':!![]}];}_0x25f2a1=_[_0x163c('0x36')]({},_0x25f2a1,_0x533a5f[_0x163c('0x39')]);return db[_0x163c('0x27')][_0x163c('0x41')](_0x25f2a1)[_0x163c('0x24')](handleEntityNotFound(_0x16acfc,null))[_0x163c('0x24')](respondWithResult(_0x16acfc,null))[_0x163c('0x3d')](handleError(_0x16acfc,null));};exports[_0x163c('0x42')]=function(_0x3f9f32,_0x552c1d){return db['VtigerAccount'][_0x163c('0x42')](_0x3f9f32['body'],{})[_0x163c('0x24')](respondWithResult(_0x552c1d,0xc9))[_0x163c('0x3d')](handleError(_0x552c1d,null));};exports[_0x163c('0x23')]=function(_0x3d51f6,_0x419aa5){if(_0x3d51f6[_0x163c('0x43')]['id']){delete _0x3d51f6[_0x163c('0x43')]['id'];}return db[_0x163c('0x27')][_0x163c('0x41')]({'where':{'id':_0x3d51f6[_0x163c('0x44')]['id']}})[_0x163c('0x24')](handleEntityNotFound(_0x419aa5,null))[_0x163c('0x24')](saveUpdates(_0x3d51f6[_0x163c('0x43')],null))[_0x163c('0x24')](respondWithResult(_0x419aa5,null))[_0x163c('0x3d')](handleError(_0x419aa5,null));};exports[_0x163c('0x45')]=function(_0x4ea686,_0x3a82dd){return db[_0x163c('0x27')][_0x163c('0x41')]({'where':{'id':_0x4ea686[_0x163c('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a82dd,null))[_0x163c('0x24')](removeEntity(_0x3a82dd,null))[_0x163c('0x3d')](handleError(_0x3a82dd,null));};exports['getConfigurations']=function(_0xf9e68c,_0x25c90f,_0x1d95e5){var _0x440dc3={};var _0x36f5e0={};var _0x4117c8;var _0xa81bbd;return db['VtigerAccount'][_0x163c('0x46')]({'where':{'id':_0xf9e68c[_0x163c('0x44')]['id']}})[_0x163c('0x24')](handleEntityNotFound(_0x25c90f,null))[_0x163c('0x24')](function(_0x491f1f){if(_0x491f1f){_0x4117c8=_0x491f1f;_0x36f5e0[_0x163c('0x29')]=_[_0x163c('0x2c')](db['VtigerConfiguration'][_0x163c('0x3f')]);_0x36f5e0[_0x163c('0x2b')]=_[_0x163c('0x2c')](_0xf9e68c[_0x163c('0x2b')]);_0x36f5e0[_0x163c('0x34')]=_[_0x163c('0x2d')](_0x36f5e0[_0x163c('0x29')],_0x36f5e0[_0x163c('0x2b')]);_0x440dc3[_0x163c('0x2e')]=_[_0x163c('0x2d')](_0x36f5e0[_0x163c('0x29')],qs['fields'](_0xf9e68c[_0x163c('0x2b')][_0x163c('0x2f')]));_0x440dc3[_0x163c('0x2e')]=_0x440dc3[_0x163c('0x2e')][_0x163c('0x47')]?_0x440dc3['attributes']:_0x36f5e0[_0x163c('0x29')];_0x440dc3[_0x163c('0x48')]=qs[_0x163c('0x32')](_0xf9e68c[_0x163c('0x2b')][_0x163c('0x32')]);_0x440dc3['where']=qs[_0x163c('0x34')](_['pick'](_0xf9e68c['query'],_0x36f5e0[_0x163c('0x34')]));if(_0xf9e68c[_0x163c('0x2b')]['filter']){_0x440dc3['where']=_[_0x163c('0x36')](_0x440dc3[_0x163c('0x33')],{'$or':_[_0x163c('0x2a')](_0x440dc3['attributes'],function(_0x15aed3){var _0x48cf88={};_0x48cf88[_0x15aed3]={'$like':'%'+_0xf9e68c[_0x163c('0x2b')]['filter']+'%'};return _0x48cf88;})});}_0x440dc3=_[_0x163c('0x36')]({},_0x440dc3,_0xf9e68c[_0x163c('0x39')]);return _0x4117c8['getConfigurations'](_0x440dc3);}})[_0x163c('0x24')](function(_0x40fb6d){if(_0x40fb6d){_0xa81bbd=_0x40fb6d[_0x163c('0x47')];if(!_0xf9e68c[_0x163c('0x2b')][_0x163c('0x49')](_0x163c('0x30'))){_0x440dc3[_0x163c('0x31')]=qs['limit'](_0xf9e68c['query']['limit']);_0x440dc3[_0x163c('0x1d')]=qs[_0x163c('0x1d')](_0xf9e68c['query'][_0x163c('0x1d')]);}return _0x4117c8[_0x163c('0x4a')](_0x440dc3);}})['then'](function(_0x3c704e){if(_0x3c704e){return _0x3c704e?{'count':_0xa81bbd,'rows':_0x3c704e}:null;}})[_0x163c('0x24')](respondWithResult(_0x25c90f,null))['catch'](handleError(_0x25c90f,null));};exports['addConfiguration']=function(_0x18b096,_0x2b949c,_0xdd3074){if(_0x18b096[_0x163c('0x43')]['id']){delete _0x18b096['body']['id'];}return db[_0x163c('0x27')][_0x163c('0x46')]({'where':{'id':_0x18b096[_0x163c('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b949c,null))['then'](function(_0xe5195b){if(_0xe5195b){_0x18b096['body'][_0x163c('0x4b')]=_0xe5195b['id'];_0x18b096[_0x163c('0x43')][_0x163c('0x4c')]=integrations[_0x163c('0x4d')](_0x18b096[_0x163c('0x43')][_0x163c('0x4e')],_0x18b096[_0x163c('0x43')][_0x163c('0x37')]);_0x18b096[_0x163c('0x43')][_0x163c('0x4f')]=integrations[_0x163c('0x50')](_0x18b096[_0x163c('0x43')]['channel'],_0x18b096[_0x163c('0x43')][_0x163c('0x37')]);return db['VtigerConfiguration'][_0x163c('0x42')](_0x18b096[_0x163c('0x43')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x163c('0x51')],'as':_0x163c('0x4f')}]});}return null;})['then'](respondWithResult(_0x2b949c,null))['catch'](handleError(_0x2b949c,null));};var md5=require('md5');exports['getFields']=function(_0x1cd6e4,_0x152066,_0x52d1bd){var _0x71838c=null;var _0x252b1f=null;var _0xbc69ff=null;var _0x1eac6a=null;var _0x23ebc0='';return db[_0x163c('0x27')][_0x163c('0x46')]({'where':{'id':_0x1cd6e4[_0x163c('0x44')]['id']},'attributes':['id','name',_0x163c('0x52'),_0x163c('0x53'),_0x163c('0x54'),_0x163c('0x55'),_0x163c('0x56'),_0x163c('0x57')]})[_0x163c('0x24')](handleEntityNotFound(_0x152066,null))['then'](function(_0x17b417){if(_0x17b417){_0x71838c=_0x17b417[_0x163c('0x52')];_0x252b1f=_0x17b417[_0x163c('0x57')];_0xbc69ff=_0x17b417[_0x163c('0x54')];_0x23ebc0=_0x17b417[_0x163c('0x55')];var _0x15cc82=_0x23ebc0['slice'](-0x1);if(_0x15cc82==='/'){_0x23ebc0=_0x23ebc0[_0x163c('0x58')](0x0,_0x23ebc0[_0x163c('0x59')](_0x15cc82));}_0x1eac6a=util[_0x163c('0x5a')](_0x163c('0x5b'),_0x23ebc0);var _0x1bbac6={'method':_0x163c('0x5c'),'uri':_0x1eac6a,'qs':{'operation':_0x163c('0x5d'),'username':_0x17b417[_0x163c('0x52')]},'json':!![]};return rp(_0x1bbac6);}})[_0x163c('0x24')](function(_0x2014ee){if(_0x2014ee[_0x163c('0x5e')]){var _0xeb6fac={'method':_0x163c('0x5f'),'uri':_0x1eac6a,'form':{'operation':_0x163c('0x60'),'username':_0x71838c,'accessKey':md5(_0x2014ee[_0x163c('0x61')]['token']+_0x252b1f)},'json':!![]};return rp(_0xeb6fac);}})[_0x163c('0x24')](function(_0x526131){if(_0x526131[_0x163c('0x5e')]){var _0x36f37e={'method':'GET','uri':_0x1eac6a,'qs':{'operation':_0x163c('0x62'),'username':_0x71838c,'sessionName':_0x526131['result'][_0x163c('0x63')],'elementType':_0xbc69ff},'json':!![]};return rp(_0x36f37e);}})['then'](function(_0x5cc360){if(_0x5cc360[_0x163c('0x5e')]){var _0x2ca344=[_0x163c('0x64'),'reference',_0x163c('0x65')];_['remove'](_0x5cc360['result'][_0x163c('0x2f')],function(_0x116406){return _0x2ca344[_0x163c('0x66')](_0x116406[_0x163c('0x37')][_0x163c('0x25')]);});_['remove'](_0x5cc360['result'][_0x163c('0x2f')],function(_0x5e3e47){return _0x5e3e47[_0x163c('0x67')]==='false';});return{'count':_0x5cc360['result'][_0x163c('0x2f')][_0x163c('0x47')],'rows':_[_0x163c('0x2a')](_0x5cc360[_0x163c('0x61')][_0x163c('0x2f')],function(_0x34eb52){return{'id':_0x34eb52[_0x163c('0x25')],'name':_0x34eb52[_0x163c('0x68')],'custom':_[_0x163c('0x69')](_0x34eb52['name'],'cf_')?!![]:![],'options':_0x34eb52[_0x163c('0x37')]['name']===_0x163c('0x6a')&&_0x34eb52['type']['picklistValues'][_0x163c('0x47')]>0x0?_[_0x163c('0x2a')](_0x34eb52[_0x163c('0x37')][_0x163c('0x6b')],function(_0x4be650){return{'name':_0x4be650['label'],'value':_0x4be650[_0x163c('0x6c')]};}):[]};})};}})[_0x163c('0x24')](respondWithResult(_0x152066,null))[_0x163c('0x3d')](function(_0x441609){console[_0x163c('0x6d')](_0x163c('0x6e')+_0x441609);var _0x5ceb1d=_0x1cd6e4[_0x163c('0x2b')][_0x163c('0x6f')]?0x1f4:_0x441609['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x163c('0x70'),_0x5ceb1d,JSON['stringify'](_0x441609));delete _0x441609['name'];if(_0x5ceb1d===0x191){_0x5ceb1d=0x190;}_0x152066[_0x163c('0x1a')](_0x5ceb1d)[_0x163c('0x71')](_0x1cd6e4[_0x163c('0x2b')][_0x163c('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x441609[_0x163c('0x72')]}:_0x441609);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 8c4e4e4..d014cc9 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 _0xec63=['util','../../config/logger','api','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x193d9d,_0x40f3cd){var _0x287179=function(_0x682f90){while(--_0x682f90){_0x193d9d['push'](_0x193d9d['shift']());}};_0x287179(++_0x40f3cd);}(_0xec63,0x174));var _0x3ec6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec63[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3ec6('0x0'));var logger=require(_0x3ec6('0x1'))(_0x3ec6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3ec6('0x3'));var fs=require('fs');var path=require(_0x3ec6('0x4'));var rimraf=require(_0x3ec6('0x5'));var config=require('../../config/environment');var attributes=require(_0x3ec6('0x6'));var integrations=require(_0x3ec6('0x7'));module[_0x3ec6('0x8')]=function(_0x17e4bc,_0x2bfd05){return _0x17e4bc[_0x3ec6('0x9')](_0x3ec6('0xa'),attributes,{'tableName':_0x3ec6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79b9=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','../../config/logger','moment'];(function(_0x6d9928,_0x9564cf){var _0x5f173c=function(_0x4d9bfe){while(--_0x4d9bfe){_0x6d9928['push'](_0x6d9928['shift']());}};_0x5f173c(++_0x9564cf);}(_0x79b9,0x11b));var _0x979b=function(_0x2859f0,_0xb9b291){_0x2859f0=_0x2859f0-0x0;var _0x3a4f66=_0x79b9[_0x2859f0];return _0x3a4f66;};'use strict';var _=require(_0x979b('0x0'));var util=require('util');var logger=require(_0x979b('0x1'))('api');var moment=require(_0x979b('0x2'));var BPromise=require(_0x979b('0x3'));var rp=require(_0x979b('0x4'));var fs=require('fs');var path=require(_0x979b('0x5'));var rimraf=require(_0x979b('0x6'));var config=require(_0x979b('0x7'));var attributes=require(_0x979b('0x8'));var integrations=require(_0x979b('0x9'));module[_0x979b('0xa')]=function(_0x6ca285,_0x17a54a){return _0x6ca285[_0x979b('0xb')]('VtigerAccount',attributes,{'tableName':_0x979b('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 0ff63da..2c27882 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 _0x750a=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','options','raw','attributes','limit','model','include','map','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','where'];(function(_0x1f337f,_0x279740){var _0x30e5d9=function(_0x570792){while(--_0x570792){_0x1f337f['push'](_0x1f337f['shift']());}};_0x30e5d9(++_0x279740);}(_0x750a,0x140));var _0xa750=function(_0x15df8b,_0xbfffaa){_0x15df8b=_0x15df8b-0x0;var _0x34b845=_0x750a[_0x15df8b];return _0x34b845;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['GetVtigerAccount']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['VtigerAccount']['findAll']({'raw':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['where']||null:null,'attributes':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x17')]||null:null,'limit':_0x433dbd['options']?_0x433dbd['options'][_0xa750('0x18')]||null:null,'include':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['include']?_['map'](_0x433dbd['options']['include'],function(_0x15d72f){return{'model':db[_0x15d72f[_0xa750('0x19')]],'as':_0x15d72f['as'],'attributes':_0x15d72f[_0xa750('0x17')],'include':_0x15d72f[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x15d72f[_0xa750('0x1a')],function(_0x3001bc){return{'model':db[_0x3001bc[_0xa750('0x19')]],'as':_0x3001bc['as'],'attributes':_0x3001bc[_0xa750('0x17')],'include':_0x3001bc[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x3001bc[_0xa750('0x1a')],function(_0x31ea63){return{'model':db[_0x31ea63[_0xa750('0x19')]],'as':_0x31ea63['as'],'attributes':_0x31ea63[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3923){logger[_0xa750('0xc')](_0xa750('0x1c'),_0x433dbd);logger['debug'](_0xa750('0x1c'),_0x433dbd,JSON[_0xa750('0xf')](_0x3d3923));_0x4f1faa(_0x3d3923);})[_0xa750('0x14')](function(_0x1223d2){logger['error'](_0xa750('0x1c'),_0x1223d2[_0xa750('0x13')],_0x433dbd);_0x36dcca(_0x1bde87[_0xa750('0x10')](0x1f4,_0x1223d2[_0xa750('0x13')]));});});};exports[_0xa750('0x1d')]=function(_0x59ab33){var _0x46cc11=this;return new Promise(function(_0x4c2c9e,_0x2d0e93){return db[_0xa750('0x1e')]['find']({'raw':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x1f')]||null:null,'attributes':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')]['attributes']||null:null,'include':_0x59ab33[_0xa750('0x15')]?_0x59ab33['options'][_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x59ab33[_0xa750('0x15')][_0xa750('0x1a')],function(_0x556fde){return{'model':db[_0x556fde[_0xa750('0x19')]],'as':_0x556fde['as'],'attributes':_0x556fde[_0xa750('0x17')],'include':_0x556fde['include']?_[_0xa750('0x1b')](_0x556fde[_0xa750('0x1a')],function(_0x280b87){return{'model':db[_0x280b87[_0xa750('0x19')]],'as':_0x280b87['as'],'attributes':_0x280b87['attributes'],'include':_0x280b87[_0xa750('0x1a')]?_['map'](_0x280b87['include'],function(_0x4e59f3){return{'model':db[_0x4e59f3[_0xa750('0x19')]],'as':_0x4e59f3['as'],'attributes':_0x4e59f3[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470089){logger[_0xa750('0xc')](_0xa750('0x1d'),_0x59ab33);logger['debug'](_0xa750('0x1d'),_0x59ab33,JSON[_0xa750('0xf')](_0x470089));_0x4c2c9e(_0x470089);})[_0xa750('0x14')](function(_0x5d402a){logger[_0xa750('0x10')](_0xa750('0x1d'),_0x5d402a[_0xa750('0x13')],_0x59ab33);_0x2d0e93(_0x46cc11['error'](0x1f4,_0x5d402a[_0xa750('0x13')]));});});}; \ No newline at end of file +var _0xe5b5=['GetVtigerAccount','VtigerAccount','options','where','attributes','include','map','model','debug','ShowVtigerAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x59f670,_0x2a34aa){var _0x4ad264=function(_0x4a8709){while(--_0x4a8709){_0x59f670['push'](_0x59f670['shift']());}};_0x4ad264(++_0x2a34aa);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xe5b5[_0x3207aa];return _0x51758f;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x545eb3,_0x29db2c,_0xe089b1){return new BPromise(function(_0xcbd478,_0x258414){return client[_0x5e5b('0xe')](_0x545eb3,_0xe089b1)[_0x5e5b('0xf')](function(_0x3a37db){logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5e5b('0x11'));logger['debug'](_0x5e5b('0x12'),_0x29db2c,_0x5e5b('0x11'),JSON[_0x5e5b('0x13')](_0x3a37db));if(_0x3a37db[_0x5e5b('0x14')]){if(_0x3a37db['error']['code']===0x1f4){logger['error'](_0x5e5b('0x15'),_0x29db2c,_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);return _0x258414(_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);}logger[_0x5e5b('0x14')](_0x5e5b('0x15'),_0x29db2c,_0x3a37db['error'][_0x5e5b('0x16')]);return _0xcbd478(_0x3a37db[_0x5e5b('0x14')]['message']);}else{logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,'request\x20sent');_0xcbd478(_0x3a37db[_0x5e5b('0x17')][_0x5e5b('0x16')]);}})[_0x5e5b('0x18')](function(_0x5c7148){logger[_0x5e5b('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5c7148);_0x258414(_0x5c7148);});});}exports[_0x5e5b('0x19')]=function(_0x45a091){var _0x4c5f9a=this;return new Promise(function(_0xe5aa6b,_0x1560e1){return db[_0x5e5b('0x1a')]['findAll']({'raw':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1c')]||null:null,'attributes':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1d')]||null:null,'limit':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['limit']||null:null,'include':_0x45a091['options']?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x28cd95){return{'model':db[_0x28cd95[_0x5e5b('0x20')]],'as':_0x28cd95['as'],'attributes':_0x28cd95[_0x5e5b('0x1d')],'include':_0x28cd95[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x28cd95[_0x5e5b('0x1e')],function(_0x4da321){return{'model':db[_0x4da321[_0x5e5b('0x20')]],'as':_0x4da321['as'],'attributes':_0x4da321[_0x5e5b('0x1d')],'include':_0x4da321[_0x5e5b('0x1e')]?_['map'](_0x4da321[_0x5e5b('0x1e')],function(_0xdb2863){return{'model':db[_0xdb2863['model']],'as':_0xdb2863['as'],'attributes':_0xdb2863[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x39ce16){logger[_0x5e5b('0x10')](_0x5e5b('0x19'),_0x45a091);logger[_0x5e5b('0x21')](_0x5e5b('0x19'),_0x45a091,JSON[_0x5e5b('0x13')](_0x39ce16));_0xe5aa6b(_0x39ce16);})[_0x5e5b('0x18')](function(_0x42da3b){logger[_0x5e5b('0x14')](_0x5e5b('0x19'),_0x42da3b['message'],_0x45a091);_0x1560e1(_0x4c5f9a['error'](0x1f4,_0x42da3b[_0x5e5b('0x16')]));});});};exports[_0x5e5b('0x22')]=function(_0xb68419){var _0x3dcdab=this;return new Promise(function(_0x12f1ee,_0x4b9be8){return db[_0x5e5b('0x1a')]['find']({'raw':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x23')]===undefined?!![]:![]:!![],'where':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1c')]||null:null,'attributes':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1d')]||null:null,'include':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x317451){return{'model':db[_0x317451['model']],'as':_0x317451['as'],'attributes':_0x317451[_0x5e5b('0x1d')],'include':_0x317451[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x317451[_0x5e5b('0x1e')],function(_0x7da7a5){return{'model':db[_0x7da7a5[_0x5e5b('0x20')]],'as':_0x7da7a5['as'],'attributes':_0x7da7a5['attributes'],'include':_0x7da7a5['include']?_[_0x5e5b('0x1f')](_0x7da7a5[_0x5e5b('0x1e')],function(_0x8ec651){return{'model':db[_0x8ec651['model']],'as':_0x8ec651['as'],'attributes':_0x8ec651[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x18f5ba){logger[_0x5e5b('0x10')]('ShowVtigerAccount',_0xb68419);logger[_0x5e5b('0x21')](_0x5e5b('0x22'),_0xb68419,JSON['stringify'](_0x18f5ba));_0x12f1ee(_0x18f5ba);})['catch'](function(_0xe9c586){logger[_0x5e5b('0x14')](_0x5e5b('0x22'),_0xe9c586['message'],_0xb68419);_0x4b9be8(_0x3dcdab[_0x5e5b('0x14')](0x1f4,_0xe9c586['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index fa0b7c8..83cac82 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 _0x549c=['getSubjects','getDescriptions','put','/:id','update','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','isAuthenticated','show','getFields','/:id/subjects'];(function(_0x34f9b1,_0x3bcc25){var _0x2e4c47=function(_0x39f379){while(--_0x39f379){_0x34f9b1['push'](_0x34f9b1['shift']());}};_0x2e4c47(++_0x3bcc25);}(_0x549c,0x1bb));var _0xc549=function(_0x3fde68,_0x2d6748){_0x3fde68=_0x3fde68-0x0;var _0x5df613=_0x549c[_0x3fde68];return _0x5df613;};'use strict';var multer=require(_0xc549('0x0'));var util=require(_0xc549('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc549('0x2'));var router=express['Router']();var fs_extra=require(_0xc549('0x3'));var auth=require(_0xc549('0x4'));var interaction=require(_0xc549('0x5'));var config=require('../../config/environment');var controller=require(_0xc549('0x6'));router[_0xc549('0x7')]('/',auth['isAuthenticated'](),controller[_0xc549('0x8')]);router['get']('/:id',auth[_0xc549('0x9')](),controller[_0xc549('0xa')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xc549('0xb')]);router[_0xc549('0x7')](_0xc549('0xc'),auth['isAuthenticated'](),controller[_0xc549('0xd')]);router['get']('/:id/descriptions',auth[_0xc549('0x9')](),controller[_0xc549('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc549('0xf')](_0xc549('0x10'),auth['isAuthenticated'](),controller[_0xc549('0x11')]);router['delete'](_0xc549('0x10'),auth[_0xc549('0x9')](),controller[_0xc549('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9af8=['../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','show','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9af8,0x10c));var _0x89af=function(_0x459a19,_0xa264ab){_0x459a19=_0x459a19-0x0;var _0x5e03b8=_0x9af8[_0x459a19];return _0x5e03b8;};'use strict';var multer=require(_0x89af('0x0'));var util=require(_0x89af('0x1'));var path=require(_0x89af('0x2'));var timeout=require(_0x89af('0x3'));var express=require(_0x89af('0x4'));var router=express[_0x89af('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x89af('0x6'));var interaction=require(_0x89af('0x7'));var config=require(_0x89af('0x8'));var controller=require(_0x89af('0x9'));router['get']('/',auth[_0x89af('0xa')](),controller[_0x89af('0xb')]);router[_0x89af('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x89af('0xd')]);router[_0x89af('0xc')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0x89af('0xa')](),controller[_0x89af('0xe')]);router[_0x89af('0xc')](_0x89af('0xf'),auth[_0x89af('0xa')](),controller[_0x89af('0x10')]);router[_0x89af('0x11')]('/',auth[_0x89af('0xa')](),controller[_0x89af('0x12')]);router['put'](_0x89af('0x13'),auth[_0x89af('0xa')](),controller['update']);router[_0x89af('0x14')]('/:id',auth[_0x89af('0xa')](),controller[_0x89af('0x15')]);module[_0x89af('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8133f3b..83ce31c 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 _0x9b55=['sequelize','exports','STRING'];(function(_0x14154e,_0x8e1b31){var _0x60644f=function(_0x210b65){while(--_0x210b65){_0x14154e['push'](_0x14154e['shift']());}};_0x60644f(++_0x8e1b31);}(_0x9b55,0xe1));var _0x59b5=function(_0x39243a,_0x2921a8){_0x39243a=_0x39243a-0x0;var _0x2ab899=_0x9b55[_0x39243a];return _0x2ab899;};'use strict';var Sequelize=require(_0x59b5('0x0'));module[_0x59b5('0x1')]={'name':{'type':Sequelize[_0x59b5('0x2')]},'description':{'type':Sequelize[_0x59b5('0x2')]}}; \ No newline at end of file +var _0x8923=['STRING','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8923,0x127));var _0x3892=function(_0xd01ce0,_0x21d84a){_0xd01ce0=_0xd01ce0-0x0;var _0x244436=_0x8923[_0xd01ce0];return _0x244436;};'use strict';var Sequelize=require(_0x3892('0x0'));module[_0x3892('0x1')]={'name':{'type':Sequelize[_0x3892('0x2')]},'description':{'type':Sequelize[_0x3892('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 96904e4..17fba59 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 _0xb2be=['sort','where','pick','filters','filter','merge','VIRTUAL','count','rows','catch','show','params','length','includeAll','include','options','find','create','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','set','apply','reject','save','update','then','end','error','stack','name','index','VtigerConfiguration','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xb2be,0xb2));var _0xeb2b=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0xb2be[_0x5418ad];return _0x2cae56;};'use strict';var emlformat=require(_0xeb2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb2b('0x1'));var jsonpatch=require(_0xeb2b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb2b('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeb2b('0x4'));var sox=require(_0xeb2b('0x5'));var csv=require(_0xeb2b('0x6'));var ejs=require(_0xeb2b('0x7'));var fs=require('fs');var fs_extra=require(_0xeb2b('0x8'));var _=require(_0xeb2b('0x9'));var squel=require('squel');var crypto=require(_0xeb2b('0xa'));var jsforce=require(_0xeb2b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeb2b('0x6'));var querystring=require(_0xeb2b('0xc'));var Papa=require(_0xeb2b('0xd'));var Redis=require(_0xeb2b('0xe'));var authService=require(_0xeb2b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeb2b('0x10'));var hardwareService=require(_0xeb2b('0x11'));var logger=require(_0xeb2b('0x12'))(_0xeb2b('0x13'));var utils=require(_0xeb2b('0x14'));var config=require(_0xeb2b('0x15'));var licenseUtil=require(_0xeb2b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c7bf6,_0xc22752){_0xc22752=_0xc22752||0xcc;return function(_0x4490fd){if(_0x4490fd){return _0x5c7bf6[_0xeb2b('0x17')](_0xc22752);}return _0x5c7bf6['status'](_0xc22752)['end']();};}function respondWithResult(_0xc943b4,_0x21fbe9){_0x21fbe9=_0x21fbe9||0xc8;return function(_0x4bc4ea){if(_0x4bc4ea){return _0xc943b4[_0xeb2b('0x18')](_0x21fbe9)[_0xeb2b('0x19')](_0x4bc4ea);}};}function respondWithFilteredResult(_0xe4a36d,_0x121641){return function(_0x20b9e9){if(_0x20b9e9){var _0x3e2ea1=typeof _0x121641[_0xeb2b('0x1a')]==='undefined'&&typeof _0x121641[_0xeb2b('0x1b')]===_0xeb2b('0x1c');var _0x4e2a26=_0x20b9e9['count'];var _0x8b7abd=_0x3e2ea1?0x0:_0x121641[_0xeb2b('0x1a')];var _0x19e47f=_0x3e2ea1?_0x20b9e9['count']:_0x121641[_0xeb2b('0x1a')]+_0x121641[_0xeb2b('0x1b')];var _0x2523ea;if(_0x19e47f>=_0x4e2a26){_0x19e47f=_0x4e2a26;_0x2523ea=0xc8;}else{_0x2523ea=0xce;}_0xe4a36d[_0xeb2b('0x18')](_0x2523ea);return _0xe4a36d[_0xeb2b('0x1d')]('Content-Range',_0x8b7abd+'-'+_0x19e47f+'/'+_0x4e2a26)['json'](_0x20b9e9);}return null;};}function patchUpdates(_0x122148){return function(_0x6dbdb4){try{jsonpatch[_0xeb2b('0x1e')](_0x6dbdb4,_0x122148,!![]);}catch(_0x5b8c70){return BPromise[_0xeb2b('0x1f')](_0x5b8c70);}return _0x6dbdb4[_0xeb2b('0x20')]();};}function saveUpdates(_0x4d0851,_0x55aa9c){return function(_0x2309d9){if(_0x2309d9){return _0x2309d9[_0xeb2b('0x21')](_0x4d0851)[_0xeb2b('0x22')](function(_0x2099f3){return _0x2099f3;});}return null;};}function removeEntity(_0x413a77,_0x5c95de){return function(_0x3e76ed){if(_0x3e76ed){return _0x3e76ed['destroy']()[_0xeb2b('0x22')](function(){_0x413a77[_0xeb2b('0x18')](0xcc)[_0xeb2b('0x23')]();});}};}function handleEntityNotFound(_0x44f273,_0x4ade1d){return function(_0x1b203c){if(!_0x1b203c){_0x44f273[_0xeb2b('0x17')](0x194);}return _0x1b203c;};}function handleError(_0x5c60e4,_0x5542d2){_0x5542d2=_0x5542d2||0x1f4;return function(_0x2f898e){logger[_0xeb2b('0x24')](_0x2f898e[_0xeb2b('0x25')]);if(_0x2f898e[_0xeb2b('0x26')]){delete _0x2f898e[_0xeb2b('0x26')];}_0x5c60e4[_0xeb2b('0x18')](_0x5542d2)['send'](_0x2f898e);};}exports[_0xeb2b('0x27')]=function(_0x1401f4,_0xe6fb7f){var _0x1ea5c7={},_0x15f002={},_0x16cd11={'count':0x0,'rows':[]};var _0x233011=_['map'](db[_0xeb2b('0x28')][_0xeb2b('0x29')],function(_0xec442e){return{'name':_0xec442e['fieldName'],'type':_0xec442e[_0xeb2b('0x2a')]['key']};});_0x15f002[_0xeb2b('0x2b')]=_[_0xeb2b('0x2c')](_0x233011,'name');_0x15f002[_0xeb2b('0x2d')]=_[_0xeb2b('0x2e')](_0x1401f4[_0xeb2b('0x2d')]);_0x15f002['filters']=_[_0xeb2b('0x2f')](_0x15f002[_0xeb2b('0x2b')],_0x15f002[_0xeb2b('0x2d')]);_0x1ea5c7[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x15f002[_0xeb2b('0x2b')],qs[_0xeb2b('0x31')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x31')]));_0x1ea5c7[_0xeb2b('0x30')]=_0x1ea5c7[_0xeb2b('0x30')]['length']?_0x1ea5c7['attributes']:_0x15f002[_0xeb2b('0x2b')];if(!_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x32')](_0xeb2b('0x33'))){_0x1ea5c7['limit']=qs[_0xeb2b('0x1b')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x1ea5c7['offset']=qs[_0xeb2b('0x1a')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x1a')]);}_0x1ea5c7[_0xeb2b('0x34')]=qs[_0xeb2b('0x35')](_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x35')]);_0x1ea5c7[_0xeb2b('0x36')]=qs['filters'](_[_0xeb2b('0x37')](_0x1401f4[_0xeb2b('0x2d')],_0x15f002[_0xeb2b('0x38')]),_0x233011);if(_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x39')]){_0x1ea5c7[_0xeb2b('0x36')]=_[_0xeb2b('0x3a')](_0x1ea5c7['where'],{'$or':_[_0xeb2b('0x2c')](_0x233011,function(_0x2a3466){if(_0x2a3466[_0xeb2b('0x2a')]!==_0xeb2b('0x3b')){var _0x4ac3d2={};_0x4ac3d2[_0x2a3466[_0xeb2b('0x26')]]={'$like':'%'+_0x1401f4[_0xeb2b('0x2d')][_0xeb2b('0x39')]+'%'};return _0x4ac3d2;}})});}_0x1ea5c7=_[_0xeb2b('0x3a')]({},_0x1ea5c7,_0x1401f4['options']);var _0x1de67c={'where':_0x1ea5c7[_0xeb2b('0x36')]};return db['VtigerConfiguration'][_0xeb2b('0x3c')](_0x1de67c)['then'](function(_0x3012de){_0x16cd11[_0xeb2b('0x3c')]=_0x3012de;if(_0x1401f4[_0xeb2b('0x2d')]['includeAll']){_0x1ea5c7['include']=[{'all':!![]}];}return db[_0xeb2b('0x28')]['findAll'](_0x1ea5c7);})[_0xeb2b('0x22')](function(_0x31f8cb){_0x16cd11[_0xeb2b('0x3d')]=_0x31f8cb;return _0x16cd11;})[_0xeb2b('0x22')](respondWithFilteredResult(_0xe6fb7f,_0x1ea5c7))[_0xeb2b('0x3e')](handleError(_0xe6fb7f,null));};exports[_0xeb2b('0x3f')]=function(_0xee6223,_0x554623){var _0x61257={'raw':![],'where':{'id':_0xee6223[_0xeb2b('0x40')]['id']}},_0x310af8={};_0x310af8[_0xeb2b('0x2b')]=_[_0xeb2b('0x2e')](db['VtigerConfiguration'][_0xeb2b('0x29')]);_0x310af8[_0xeb2b('0x2d')]=_['keys'](_0xee6223['query']);_0x310af8['filters']=_[_0xeb2b('0x2f')](_0x310af8[_0xeb2b('0x2b')],_0x310af8[_0xeb2b('0x2d')]);_0x61257[_0xeb2b('0x30')]=_['intersection'](_0x310af8['model'],qs[_0xeb2b('0x31')](_0xee6223[_0xeb2b('0x2d')][_0xeb2b('0x31')]));_0x61257[_0xeb2b('0x30')]=_0x61257['attributes'][_0xeb2b('0x41')]?_0x61257['attributes']:_0x310af8[_0xeb2b('0x2b')];if(_0xee6223[_0xeb2b('0x2d')][_0xeb2b('0x42')]){_0x61257[_0xeb2b('0x43')]=[{'all':!![]}];}_0x61257=_[_0xeb2b('0x3a')]({},_0x61257,_0xee6223[_0xeb2b('0x44')]);return db[_0xeb2b('0x28')][_0xeb2b('0x45')](_0x61257)['then'](handleEntityNotFound(_0x554623,null))['then'](respondWithResult(_0x554623,null))[_0xeb2b('0x3e')](handleError(_0x554623,null));};exports[_0xeb2b('0x46')]=function(_0x1ce200,_0x5ba9ab){return db[_0xeb2b('0x28')]['create'](_0x1ce200['body'],{})[_0xeb2b('0x22')](respondWithResult(_0x5ba9ab,0xc9))[_0xeb2b('0x3e')](handleError(_0x5ba9ab,null));};exports[_0xeb2b('0x21')]=function(_0x52bbe9,_0x48b0e0){if(_0x52bbe9['body']['id']){delete _0x52bbe9['body']['id'];}return db[_0xeb2b('0x28')][_0xeb2b('0x45')]({'where':{'id':_0x52bbe9['params']['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x48b0e0,null))[_0xeb2b('0x22')](saveUpdates(_0x52bbe9['body'],null))[_0xeb2b('0x22')](respondWithResult(_0x48b0e0,null))[_0xeb2b('0x3e')](handleError(_0x48b0e0,null));};exports[_0xeb2b('0x47')]=function(_0x2473fe,_0x1485f8){return db[_0xeb2b('0x28')][_0xeb2b('0x45')]({'where':{'id':_0x2473fe[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x1485f8,null))[_0xeb2b('0x22')](removeEntity(_0x1485f8,null))['catch'](handleError(_0x1485f8,null));};exports[_0xeb2b('0x48')]=function(_0xee04d1,_0x1bbcdb,_0x88fece){var _0x519808={};var _0x441eee={};var _0x4c4720;var _0x2a102b;return db[_0xeb2b('0x28')][_0xeb2b('0x49')]({'where':{'id':_0xee04d1[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x1bbcdb,null))[_0xeb2b('0x22')](function(_0x27d08c){if(_0x27d08c){_0x4c4720=_0x27d08c;_0x441eee[_0xeb2b('0x2b')]=_['keys'](db['VtigerField'][_0xeb2b('0x29')]);_0x441eee[_0xeb2b('0x2d')]=_[_0xeb2b('0x2e')](_0xee04d1['query']);_0x441eee['filters']=_[_0xeb2b('0x2f')](_0x441eee[_0xeb2b('0x2b')],_0x441eee[_0xeb2b('0x2d')]);_0x519808[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x441eee['model'],qs[_0xeb2b('0x31')](_0xee04d1['query'][_0xeb2b('0x31')]));_0x519808[_0xeb2b('0x30')]=_0x519808[_0xeb2b('0x30')][_0xeb2b('0x41')]?_0x519808[_0xeb2b('0x30')]:_0x441eee[_0xeb2b('0x2b')];_0x519808[_0xeb2b('0x34')]=qs[_0xeb2b('0x35')](_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x35')]);_0x519808[_0xeb2b('0x36')]=qs[_0xeb2b('0x38')](_[_0xeb2b('0x37')](_0xee04d1[_0xeb2b('0x2d')],_0x441eee[_0xeb2b('0x38')]));if(_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x39')]){_0x519808['where']=_['merge'](_0x519808['where'],{'$or':_['map'](_0x519808[_0xeb2b('0x30')],function(_0x31dea4){var _0xde935e={};_0xde935e[_0x31dea4]={'$like':'%'+_0xee04d1['query'][_0xeb2b('0x39')]+'%'};return _0xde935e;})});}_0x519808=_['merge']({},_0x519808,_0xee04d1[_0xeb2b('0x44')]);return _0x4c4720[_0xeb2b('0x48')](_0x519808);}})[_0xeb2b('0x22')](function(_0x1fbc7f){if(_0x1fbc7f){_0x2a102b=_0x1fbc7f[_0xeb2b('0x41')];if(!_0xee04d1['query']['hasOwnProperty'](_0xeb2b('0x33'))){_0x519808[_0xeb2b('0x1b')]=qs['limit'](_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x519808[_0xeb2b('0x1a')]=qs[_0xeb2b('0x1a')](_0xee04d1[_0xeb2b('0x2d')][_0xeb2b('0x1a')]);}return _0x4c4720[_0xeb2b('0x48')](_0x519808);}})[_0xeb2b('0x22')](function(_0x4e5253){if(_0x4e5253){return _0x4e5253?{'count':_0x2a102b,'rows':_0x4e5253}:null;}})[_0xeb2b('0x22')](respondWithResult(_0x1bbcdb,null))[_0xeb2b('0x3e')](handleError(_0x1bbcdb,null));};exports['getSubjects']=function(_0x30671c,_0x9aa498,_0x2e0197){var _0x32c598={};var _0x5386b2={};var _0x6b42a2;var _0x36807d;return db[_0xeb2b('0x28')][_0xeb2b('0x49')]({'where':{'id':_0x30671c[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x9aa498,null))[_0xeb2b('0x22')](function(_0x3f161d){if(_0x3f161d){_0x6b42a2=_0x3f161d;_0x5386b2[_0xeb2b('0x2b')]=_['keys'](db[_0xeb2b('0x4a')]['rawAttributes']);_0x5386b2['query']=_['keys'](_0x30671c[_0xeb2b('0x2d')]);_0x5386b2[_0xeb2b('0x38')]=_[_0xeb2b('0x2f')](_0x5386b2['model'],_0x5386b2[_0xeb2b('0x2d')]);_0x32c598[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x5386b2[_0xeb2b('0x2b')],qs[_0xeb2b('0x31')](_0x30671c['query'][_0xeb2b('0x31')]));_0x32c598['attributes']=_0x32c598[_0xeb2b('0x30')][_0xeb2b('0x41')]?_0x32c598['attributes']:_0x5386b2[_0xeb2b('0x2b')];_0x32c598[_0xeb2b('0x34')]=qs[_0xeb2b('0x35')](_0x30671c[_0xeb2b('0x2d')]['sort']);_0x32c598['where']=qs[_0xeb2b('0x38')](_[_0xeb2b('0x37')](_0x30671c[_0xeb2b('0x2d')],_0x5386b2[_0xeb2b('0x38')]));if(_0x30671c[_0xeb2b('0x2d')]['filter']){_0x32c598[_0xeb2b('0x36')]=_[_0xeb2b('0x3a')](_0x32c598['where'],{'$or':_[_0xeb2b('0x2c')](_0x32c598[_0xeb2b('0x30')],function(_0x4924f6){var _0x48389b={};_0x48389b[_0x4924f6]={'$like':'%'+_0x30671c[_0xeb2b('0x2d')][_0xeb2b('0x39')]+'%'};return _0x48389b;})});}_0x32c598=_[_0xeb2b('0x3a')]({},_0x32c598,_0x30671c['options']);return _0x6b42a2[_0xeb2b('0x4b')](_0x32c598);}})[_0xeb2b('0x22')](function(_0x3ce276){if(_0x3ce276){_0x36807d=_0x3ce276[_0xeb2b('0x41')];if(!_0x30671c['query']['hasOwnProperty']('nolimit')){_0x32c598[_0xeb2b('0x1b')]=qs['limit'](_0x30671c[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x32c598[_0xeb2b('0x1a')]=qs[_0xeb2b('0x1a')](_0x30671c[_0xeb2b('0x2d')]['offset']);}return _0x6b42a2[_0xeb2b('0x4b')](_0x32c598);}})[_0xeb2b('0x22')](function(_0x21a6a3){if(_0x21a6a3){return _0x21a6a3?{'count':_0x36807d,'rows':_0x21a6a3}:null;}})['then'](respondWithResult(_0x9aa498,null))[_0xeb2b('0x3e')](handleError(_0x9aa498,null));};exports[_0xeb2b('0x4c')]=function(_0x5b30a1,_0x5ec338,_0x32a595){var _0x2e335e={};var _0x20c396={};var _0x266a26;var _0x3a6f5d;return db['VtigerConfiguration'][_0xeb2b('0x49')]({'where':{'id':_0x5b30a1[_0xeb2b('0x40')]['id']}})[_0xeb2b('0x22')](handleEntityNotFound(_0x5ec338,null))[_0xeb2b('0x22')](function(_0x10da8c){if(_0x10da8c){_0x266a26=_0x10da8c;_0x20c396[_0xeb2b('0x2b')]=_['keys'](db[_0xeb2b('0x4a')]['rawAttributes']);_0x20c396[_0xeb2b('0x2d')]=_[_0xeb2b('0x2e')](_0x5b30a1['query']);_0x20c396[_0xeb2b('0x38')]=_[_0xeb2b('0x2f')](_0x20c396[_0xeb2b('0x2b')],_0x20c396[_0xeb2b('0x2d')]);_0x2e335e[_0xeb2b('0x30')]=_[_0xeb2b('0x2f')](_0x20c396['model'],qs[_0xeb2b('0x31')](_0x5b30a1[_0xeb2b('0x2d')]['fields']));_0x2e335e[_0xeb2b('0x30')]=_0x2e335e[_0xeb2b('0x30')][_0xeb2b('0x41')]?_0x2e335e['attributes']:_0x20c396[_0xeb2b('0x2b')];_0x2e335e['order']=qs['sort'](_0x5b30a1[_0xeb2b('0x2d')][_0xeb2b('0x35')]);_0x2e335e[_0xeb2b('0x36')]=qs[_0xeb2b('0x38')](_['pick'](_0x5b30a1['query'],_0x20c396[_0xeb2b('0x38')]));if(_0x5b30a1['query'][_0xeb2b('0x39')]){_0x2e335e['where']=_[_0xeb2b('0x3a')](_0x2e335e[_0xeb2b('0x36')],{'$or':_['map'](_0x2e335e[_0xeb2b('0x30')],function(_0x468c59){var _0x363044={};_0x363044[_0x468c59]={'$like':'%'+_0x5b30a1[_0xeb2b('0x2d')]['filter']+'%'};return _0x363044;})});}_0x2e335e=_[_0xeb2b('0x3a')]({},_0x2e335e,_0x5b30a1[_0xeb2b('0x44')]);return _0x266a26[_0xeb2b('0x4c')](_0x2e335e);}})[_0xeb2b('0x22')](function(_0x4bb3aa){if(_0x4bb3aa){_0x3a6f5d=_0x4bb3aa[_0xeb2b('0x41')];if(!_0x5b30a1[_0xeb2b('0x2d')]['hasOwnProperty']('nolimit')){_0x2e335e[_0xeb2b('0x1b')]=qs['limit'](_0x5b30a1[_0xeb2b('0x2d')][_0xeb2b('0x1b')]);_0x2e335e[_0xeb2b('0x1a')]=qs[_0xeb2b('0x1a')](_0x5b30a1[_0xeb2b('0x2d')][_0xeb2b('0x1a')]);}return _0x266a26[_0xeb2b('0x4c')](_0x2e335e);}})['then'](function(_0x3a518a){if(_0x3a518a){return _0x3a518a?{'count':_0x3a6f5d,'rows':_0x3a518a}:null;}})[_0xeb2b('0x22')](respondWithResult(_0x5ec338,null))[_0xeb2b('0x3e')](handleError(_0x5ec338,null));}; \ No newline at end of file +var _0xe39c=['VtigerField','getDescriptions','eml-format','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','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','length','find','create','body','getFields','findOne','options','hasOwnProperty','getSubjects'];(function(_0x296db4,_0x3244dc){var _0x44e41c=function(_0x3c2119){while(--_0x3c2119){_0x296db4['push'](_0x296db4['shift']());}};_0x44e41c(++_0x3244dc);}(_0xe39c,0x14a));var _0xce39=function(_0x1f1222,_0x2a4de8){_0x1f1222=_0x1f1222-0x0;var _0x37ade0=_0xe39c[_0x1f1222];return _0x37ade0;};'use strict';var emlformat=require(_0xce39('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xce39('0x1'));var rp=require(_0xce39('0x2'));var moment=require(_0xce39('0x3'));var BPromise=require(_0xce39('0x4'));var Mustache=require(_0xce39('0x5'));var util=require(_0xce39('0x6'));var path=require(_0xce39('0x7'));var sox=require(_0xce39('0x8'));var csv=require(_0xce39('0x9'));var ejs=require(_0xce39('0xa'));var fs=require('fs');var fs_extra=require(_0xce39('0xb'));var _=require(_0xce39('0xc'));var squel=require(_0xce39('0xd'));var crypto=require('crypto');var jsforce=require(_0xce39('0xe'));var deskjs=require(_0xce39('0xf'));var toCsv=require(_0xce39('0x9'));var querystring=require('querystring');var Papa=require(_0xce39('0x10'));var Redis=require(_0xce39('0x11'));var authService=require(_0xce39('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xce39('0x13'));var hardwareService=require(_0xce39('0x14'));var logger=require('../../config/logger')(_0xce39('0x15'));var utils=require(_0xce39('0x16'));var config=require(_0xce39('0x17'));var licenseUtil=require(_0xce39('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4caf51,_0x1ff2e4){_0x1ff2e4=_0x1ff2e4||0xcc;return function(_0x4cd43a){if(_0x4cd43a){return _0x4caf51[_0xce39('0x19')](_0x1ff2e4);}return _0x4caf51[_0xce39('0x1a')](_0x1ff2e4)[_0xce39('0x1b')]();};}function respondWithResult(_0x567617,_0x537a64){_0x537a64=_0x537a64||0xc8;return function(_0x4342c6){if(_0x4342c6){return _0x567617[_0xce39('0x1a')](_0x537a64)[_0xce39('0x1c')](_0x4342c6);}};}function respondWithFilteredResult(_0x486b01,_0x1f1b5b){return function(_0x3a5572){if(_0x3a5572){var _0x281362=typeof _0x1f1b5b['offset']===_0xce39('0x1d')&&typeof _0x1f1b5b[_0xce39('0x1e')]===_0xce39('0x1d');var _0x529a71=_0x3a5572[_0xce39('0x1f')];var _0x31de58=_0x281362?0x0:_0x1f1b5b['offset'];var _0x42e280=_0x281362?_0x3a5572['count']:_0x1f1b5b[_0xce39('0x20')]+_0x1f1b5b[_0xce39('0x1e')];var _0x3d9935;if(_0x42e280>=_0x529a71){_0x42e280=_0x529a71;_0x3d9935=0xc8;}else{_0x3d9935=0xce;}_0x486b01[_0xce39('0x1a')](_0x3d9935);return _0x486b01[_0xce39('0x21')]('Content-Range',_0x31de58+'-'+_0x42e280+'/'+_0x529a71)[_0xce39('0x1c')](_0x3a5572);}return null;};}function patchUpdates(_0x45d657){return function(_0x36a736){try{jsonpatch[_0xce39('0x22')](_0x36a736,_0x45d657,!![]);}catch(_0x5c6045){return BPromise[_0xce39('0x23')](_0x5c6045);}return _0x36a736[_0xce39('0x24')]();};}function saveUpdates(_0x1e12e9,_0xd1f528){return function(_0x20d61a){if(_0x20d61a){return _0x20d61a[_0xce39('0x25')](_0x1e12e9)[_0xce39('0x26')](function(_0x47ea91){return _0x47ea91;});}return null;};}function removeEntity(_0x1f1bce,_0x6009cb){return function(_0xc8a4c4){if(_0xc8a4c4){return _0xc8a4c4[_0xce39('0x27')]()[_0xce39('0x26')](function(){_0x1f1bce[_0xce39('0x1a')](0xcc)[_0xce39('0x1b')]();});}};}function handleEntityNotFound(_0x10b1e9,_0x435b11){return function(_0x16d6d4){if(!_0x16d6d4){_0x10b1e9['sendStatus'](0x194);}return _0x16d6d4;};}function handleError(_0x2455aa,_0x201f3e){_0x201f3e=_0x201f3e||0x1f4;return function(_0x21fa19){logger[_0xce39('0x28')](_0x21fa19[_0xce39('0x29')]);if(_0x21fa19[_0xce39('0x2a')]){delete _0x21fa19[_0xce39('0x2a')];}_0x2455aa[_0xce39('0x1a')](_0x201f3e)[_0xce39('0x2b')](_0x21fa19);};}exports[_0xce39('0x2c')]=function(_0xc504ef,_0x419abf){var _0x1848db={},_0x17343b={},_0x22a791={'count':0x0,'rows':[]};var _0x10d475=_[_0xce39('0x2d')](db[_0xce39('0x2e')][_0xce39('0x2f')],function(_0x5ca555){return{'name':_0x5ca555[_0xce39('0x30')],'type':_0x5ca555['type'][_0xce39('0x31')]};});_0x17343b['model']=_[_0xce39('0x2d')](_0x10d475,_0xce39('0x2a'));_0x17343b[_0xce39('0x32')]=_[_0xce39('0x33')](_0xc504ef['query']);_0x17343b[_0xce39('0x34')]=_['intersection'](_0x17343b[_0xce39('0x35')],_0x17343b['query']);_0x1848db['attributes']=_[_0xce39('0x36')](_0x17343b['model'],qs['fields'](_0xc504ef[_0xce39('0x32')][_0xce39('0x37')]));_0x1848db[_0xce39('0x38')]=_0x1848db[_0xce39('0x38')]['length']?_0x1848db[_0xce39('0x38')]:_0x17343b[_0xce39('0x35')];if(!_0xc504ef['query']['hasOwnProperty'](_0xce39('0x39'))){_0x1848db[_0xce39('0x1e')]=qs[_0xce39('0x1e')](_0xc504ef[_0xce39('0x32')]['limit']);_0x1848db[_0xce39('0x20')]=qs['offset'](_0xc504ef['query'][_0xce39('0x20')]);}_0x1848db[_0xce39('0x3a')]=qs[_0xce39('0x3b')](_0xc504ef[_0xce39('0x32')][_0xce39('0x3b')]);_0x1848db[_0xce39('0x3c')]=qs[_0xce39('0x34')](_[_0xce39('0x3d')](_0xc504ef[_0xce39('0x32')],_0x17343b[_0xce39('0x34')]),_0x10d475);if(_0xc504ef['query'][_0xce39('0x3e')]){_0x1848db[_0xce39('0x3c')]=_['merge'](_0x1848db[_0xce39('0x3c')],{'$or':_[_0xce39('0x2d')](_0x10d475,function(_0x5e6757){if(_0x5e6757['type']!==_0xce39('0x3f')){var _0x3a190e={};_0x3a190e[_0x5e6757[_0xce39('0x2a')]]={'$like':'%'+_0xc504ef[_0xce39('0x32')][_0xce39('0x3e')]+'%'};return _0x3a190e;}})});}_0x1848db=_[_0xce39('0x40')]({},_0x1848db,_0xc504ef['options']);var _0x4c3288={'where':_0x1848db['where']};return db[_0xce39('0x2e')][_0xce39('0x1f')](_0x4c3288)[_0xce39('0x26')](function(_0x3d9a5d){_0x22a791['count']=_0x3d9a5d;if(_0xc504ef[_0xce39('0x32')][_0xce39('0x41')]){_0x1848db[_0xce39('0x42')]=[{'all':!![]}];}return db[_0xce39('0x2e')][_0xce39('0x43')](_0x1848db);})['then'](function(_0x1ba9f2){_0x22a791[_0xce39('0x44')]=_0x1ba9f2;return _0x22a791;})[_0xce39('0x26')](respondWithFilteredResult(_0x419abf,_0x1848db))[_0xce39('0x45')](handleError(_0x419abf,null));};exports['show']=function(_0x3a6457,_0x559fea){var _0x295826={'raw':![],'where':{'id':_0x3a6457[_0xce39('0x46')]['id']}},_0x3c1e04={};_0x3c1e04[_0xce39('0x35')]=_['keys'](db[_0xce39('0x2e')][_0xce39('0x2f')]);_0x3c1e04[_0xce39('0x32')]=_[_0xce39('0x33')](_0x3a6457[_0xce39('0x32')]);_0x3c1e04['filters']=_[_0xce39('0x36')](_0x3c1e04[_0xce39('0x35')],_0x3c1e04['query']);_0x295826[_0xce39('0x38')]=_[_0xce39('0x36')](_0x3c1e04[_0xce39('0x35')],qs[_0xce39('0x37')](_0x3a6457[_0xce39('0x32')]['fields']));_0x295826[_0xce39('0x38')]=_0x295826[_0xce39('0x38')][_0xce39('0x47')]?_0x295826[_0xce39('0x38')]:_0x3c1e04[_0xce39('0x35')];if(_0x3a6457[_0xce39('0x32')][_0xce39('0x41')]){_0x295826['include']=[{'all':!![]}];}_0x295826=_['merge']({},_0x295826,_0x3a6457['options']);return db[_0xce39('0x2e')][_0xce39('0x48')](_0x295826)[_0xce39('0x26')](handleEntityNotFound(_0x559fea,null))[_0xce39('0x26')](respondWithResult(_0x559fea,null))[_0xce39('0x45')](handleError(_0x559fea,null));};exports[_0xce39('0x49')]=function(_0x483eaa,_0x497317){return db['VtigerConfiguration'][_0xce39('0x49')](_0x483eaa['body'],{})[_0xce39('0x26')](respondWithResult(_0x497317,0xc9))[_0xce39('0x45')](handleError(_0x497317,null));};exports[_0xce39('0x25')]=function(_0x424798,_0x4b2cb2){if(_0x424798['body']['id']){delete _0x424798['body']['id'];}return db[_0xce39('0x2e')][_0xce39('0x48')]({'where':{'id':_0x424798[_0xce39('0x46')]['id']}})[_0xce39('0x26')](handleEntityNotFound(_0x4b2cb2,null))[_0xce39('0x26')](saveUpdates(_0x424798[_0xce39('0x4a')],null))[_0xce39('0x26')](respondWithResult(_0x4b2cb2,null))[_0xce39('0x45')](handleError(_0x4b2cb2,null));};exports[_0xce39('0x27')]=function(_0x18e8af,_0x7c4bdc){return db[_0xce39('0x2e')][_0xce39('0x48')]({'where':{'id':_0x18e8af[_0xce39('0x46')]['id']}})[_0xce39('0x26')](handleEntityNotFound(_0x7c4bdc,null))['then'](removeEntity(_0x7c4bdc,null))[_0xce39('0x45')](handleError(_0x7c4bdc,null));};exports[_0xce39('0x4b')]=function(_0x2fa7e9,_0x4b9f18,_0x580298){var _0xb3cbf9={};var _0x1aa70e={};var _0x4a877a;var _0x3cefc4;return db[_0xce39('0x2e')][_0xce39('0x4c')]({'where':{'id':_0x2fa7e9[_0xce39('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b9f18,null))[_0xce39('0x26')](function(_0x421eee){if(_0x421eee){_0x4a877a=_0x421eee;_0x1aa70e[_0xce39('0x35')]=_['keys'](db['VtigerField']['rawAttributes']);_0x1aa70e[_0xce39('0x32')]=_['keys'](_0x2fa7e9[_0xce39('0x32')]);_0x1aa70e[_0xce39('0x34')]=_[_0xce39('0x36')](_0x1aa70e[_0xce39('0x35')],_0x1aa70e['query']);_0xb3cbf9[_0xce39('0x38')]=_[_0xce39('0x36')](_0x1aa70e[_0xce39('0x35')],qs[_0xce39('0x37')](_0x2fa7e9[_0xce39('0x32')][_0xce39('0x37')]));_0xb3cbf9[_0xce39('0x38')]=_0xb3cbf9['attributes'][_0xce39('0x47')]?_0xb3cbf9['attributes']:_0x1aa70e['model'];_0xb3cbf9[_0xce39('0x3a')]=qs[_0xce39('0x3b')](_0x2fa7e9[_0xce39('0x32')][_0xce39('0x3b')]);_0xb3cbf9[_0xce39('0x3c')]=qs[_0xce39('0x34')](_['pick'](_0x2fa7e9['query'],_0x1aa70e[_0xce39('0x34')]));if(_0x2fa7e9[_0xce39('0x32')][_0xce39('0x3e')]){_0xb3cbf9['where']=_[_0xce39('0x40')](_0xb3cbf9[_0xce39('0x3c')],{'$or':_[_0xce39('0x2d')](_0xb3cbf9[_0xce39('0x38')],function(_0x31b51c){var _0x242910={};_0x242910[_0x31b51c]={'$like':'%'+_0x2fa7e9[_0xce39('0x32')][_0xce39('0x3e')]+'%'};return _0x242910;})});}_0xb3cbf9=_[_0xce39('0x40')]({},_0xb3cbf9,_0x2fa7e9[_0xce39('0x4d')]);return _0x4a877a[_0xce39('0x4b')](_0xb3cbf9);}})[_0xce39('0x26')](function(_0x3f3738){if(_0x3f3738){_0x3cefc4=_0x3f3738[_0xce39('0x47')];if(!_0x2fa7e9[_0xce39('0x32')][_0xce39('0x4e')](_0xce39('0x39'))){_0xb3cbf9[_0xce39('0x1e')]=qs[_0xce39('0x1e')](_0x2fa7e9[_0xce39('0x32')][_0xce39('0x1e')]);_0xb3cbf9[_0xce39('0x20')]=qs[_0xce39('0x20')](_0x2fa7e9[_0xce39('0x32')]['offset']);}return _0x4a877a[_0xce39('0x4b')](_0xb3cbf9);}})[_0xce39('0x26')](function(_0x57ed34){if(_0x57ed34){return _0x57ed34?{'count':_0x3cefc4,'rows':_0x57ed34}:null;}})[_0xce39('0x26')](respondWithResult(_0x4b9f18,null))[_0xce39('0x45')](handleError(_0x4b9f18,null));};exports[_0xce39('0x4f')]=function(_0x535b75,_0xcda15a,_0x39ad0e){var _0x258efa={};var _0x528114={};var _0x574dd0;var _0x564ee3;return db[_0xce39('0x2e')]['findOne']({'where':{'id':_0x535b75['params']['id']}})[_0xce39('0x26')](handleEntityNotFound(_0xcda15a,null))[_0xce39('0x26')](function(_0x3dd924){if(_0x3dd924){_0x574dd0=_0x3dd924;_0x528114[_0xce39('0x35')]=_[_0xce39('0x33')](db[_0xce39('0x50')]['rawAttributes']);_0x528114[_0xce39('0x32')]=_[_0xce39('0x33')](_0x535b75[_0xce39('0x32')]);_0x528114[_0xce39('0x34')]=_[_0xce39('0x36')](_0x528114[_0xce39('0x35')],_0x528114[_0xce39('0x32')]);_0x258efa[_0xce39('0x38')]=_[_0xce39('0x36')](_0x528114[_0xce39('0x35')],qs[_0xce39('0x37')](_0x535b75[_0xce39('0x32')][_0xce39('0x37')]));_0x258efa['attributes']=_0x258efa['attributes'][_0xce39('0x47')]?_0x258efa[_0xce39('0x38')]:_0x528114[_0xce39('0x35')];_0x258efa[_0xce39('0x3a')]=qs[_0xce39('0x3b')](_0x535b75[_0xce39('0x32')][_0xce39('0x3b')]);_0x258efa['where']=qs[_0xce39('0x34')](_[_0xce39('0x3d')](_0x535b75[_0xce39('0x32')],_0x528114[_0xce39('0x34')]));if(_0x535b75[_0xce39('0x32')][_0xce39('0x3e')]){_0x258efa[_0xce39('0x3c')]=_[_0xce39('0x40')](_0x258efa['where'],{'$or':_[_0xce39('0x2d')](_0x258efa[_0xce39('0x38')],function(_0x1bf458){var _0x3516e6={};_0x3516e6[_0x1bf458]={'$like':'%'+_0x535b75[_0xce39('0x32')]['filter']+'%'};return _0x3516e6;})});}_0x258efa=_['merge']({},_0x258efa,_0x535b75[_0xce39('0x4d')]);return _0x574dd0[_0xce39('0x4f')](_0x258efa);}})[_0xce39('0x26')](function(_0x3f6502){if(_0x3f6502){_0x564ee3=_0x3f6502[_0xce39('0x47')];if(!_0x535b75[_0xce39('0x32')][_0xce39('0x4e')](_0xce39('0x39'))){_0x258efa[_0xce39('0x1e')]=qs[_0xce39('0x1e')](_0x535b75[_0xce39('0x32')]['limit']);_0x258efa[_0xce39('0x20')]=qs[_0xce39('0x20')](_0x535b75[_0xce39('0x32')][_0xce39('0x20')]);}return _0x574dd0[_0xce39('0x4f')](_0x258efa);}})['then'](function(_0x57a516){if(_0x57a516){return _0x57a516?{'count':_0x564ee3,'rows':_0x57a516}:null;}})['then'](respondWithResult(_0xcda15a,null))[_0xce39('0x45')](handleError(_0xcda15a,null));};exports['getDescriptions']=function(_0x14d235,_0x3a916b,_0x43e1d6){var _0x202253={};var _0x146bfa={};var _0x2addd8;var _0x2e980a;return db['VtigerConfiguration'][_0xce39('0x4c')]({'where':{'id':_0x14d235[_0xce39('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a916b,null))[_0xce39('0x26')](function(_0x18df2e){if(_0x18df2e){_0x2addd8=_0x18df2e;_0x146bfa[_0xce39('0x35')]=_[_0xce39('0x33')](db[_0xce39('0x50')][_0xce39('0x2f')]);_0x146bfa['query']=_[_0xce39('0x33')](_0x14d235[_0xce39('0x32')]);_0x146bfa[_0xce39('0x34')]=_[_0xce39('0x36')](_0x146bfa[_0xce39('0x35')],_0x146bfa[_0xce39('0x32')]);_0x202253[_0xce39('0x38')]=_[_0xce39('0x36')](_0x146bfa[_0xce39('0x35')],qs[_0xce39('0x37')](_0x14d235[_0xce39('0x32')][_0xce39('0x37')]));_0x202253['attributes']=_0x202253[_0xce39('0x38')][_0xce39('0x47')]?_0x202253[_0xce39('0x38')]:_0x146bfa[_0xce39('0x35')];_0x202253[_0xce39('0x3a')]=qs['sort'](_0x14d235['query'][_0xce39('0x3b')]);_0x202253['where']=qs[_0xce39('0x34')](_[_0xce39('0x3d')](_0x14d235['query'],_0x146bfa['filters']));if(_0x14d235['query']['filter']){_0x202253[_0xce39('0x3c')]=_['merge'](_0x202253[_0xce39('0x3c')],{'$or':_[_0xce39('0x2d')](_0x202253[_0xce39('0x38')],function(_0x3e9840){var _0x2ba722={};_0x2ba722[_0x3e9840]={'$like':'%'+_0x14d235['query'][_0xce39('0x3e')]+'%'};return _0x2ba722;})});}_0x202253=_['merge']({},_0x202253,_0x14d235['options']);return _0x2addd8[_0xce39('0x51')](_0x202253);}})[_0xce39('0x26')](function(_0x349d7f){if(_0x349d7f){_0x2e980a=_0x349d7f[_0xce39('0x47')];if(!_0x14d235[_0xce39('0x32')]['hasOwnProperty'](_0xce39('0x39'))){_0x202253['limit']=qs[_0xce39('0x1e')](_0x14d235['query'][_0xce39('0x1e')]);_0x202253['offset']=qs[_0xce39('0x20')](_0x14d235[_0xce39('0x32')][_0xce39('0x20')]);}return _0x2addd8[_0xce39('0x51')](_0x202253);}})['then'](function(_0x1f5ad0){if(_0x1f5ad0){return _0x1f5ad0?{'count':_0x2e980a,'rows':_0x1f5ad0}:null;}})[_0xce39('0x26')](respondWithResult(_0x3a916b,null))[_0xce39('0x45')](handleError(_0x3a916b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 33dd8ae..334dcc7 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 _0xdd01=['api','moment','bluebird','request-promise','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x41467a,_0x5e511f){var _0x5652b9=function(_0x9c1ba3){while(--_0x9c1ba3){_0x41467a['push'](_0x41467a['shift']());}};_0x5652b9(++_0x5e511f);}(_0xdd01,0x15a));var _0x1dd0=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xdd01[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require('lodash');var util=require(_0x1dd0('0x0'));var logger=require(_0x1dd0('0x1'))(_0x1dd0('0x2'));var moment=require(_0x1dd0('0x3'));var BPromise=require(_0x1dd0('0x4'));var rp=require(_0x1dd0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dd0('0x6'));var config=require('../../config/environment');var attributes=require(_0x1dd0('0x7'));module[_0x1dd0('0x8')]=function(_0x4f378c,_0x1e6d14){return _0x4f378c[_0x1dd0('0x9')](_0x1dd0('0xa'),attributes,{'tableName':_0x1dd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8aa=['moment','request-promise','rimraf','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','api'];(function(_0x51ff4e,_0x9d52a2){var _0x47ed0d=function(_0x2298b6){while(--_0x2298b6){_0x51ff4e['push'](_0x51ff4e['shift']());}};_0x47ed0d(++_0x9d52a2);}(_0xe8aa,0x16f));var _0xae8a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe8aa[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xae8a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xae8a('0x1'));var moment=require(_0xae8a('0x2'));var BPromise=require('bluebird');var rp=require(_0xae8a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae8a('0x4'));var config=require('../../config/environment');var attributes=require(_0xae8a('0x5'));module[_0xae8a('0x6')]=function(_0x4ffc21,_0x2142d5){return _0x4ffc21[_0xae8a('0x7')]('VtigerConfiguration',attributes,{'tableName':_0xae8a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 6789e8d..6fc2921 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 _0xfe06=['stringify','error','code','message','catch','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe06,0x155));var _0x6fe0=function(_0x52fc5f,_0x1d36ed){_0x52fc5f=_0x52fc5f-0x0;var _0x51cce0=_0xfe06[_0x52fc5f];return _0x51cce0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6fe0('0x0'));var rs=require(_0x6fe0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6fe0('0x2'));var logger=require(_0x6fe0('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6fe0('0x4'));var client=jayson[_0x6fe0('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4266fa,_0x34643f,_0x3ab9e9){return new BPromise(function(_0x3395f8,_0x2f0da3){return client[_0x6fe0('0x6')](_0x4266fa,_0x3ab9e9)['then'](function(_0x1bb192){logger[_0x6fe0('0x7')](_0x6fe0('0x8'),_0x34643f,_0x6fe0('0x9'));logger[_0x6fe0('0xa')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x34643f,_0x6fe0('0x9'),JSON[_0x6fe0('0xb')](_0x1bb192));if(_0x1bb192['error']){if(_0x1bb192[_0x6fe0('0xc')][_0x6fe0('0xd')]===0x1f4){logger[_0x6fe0('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x34643f,_0x1bb192[_0x6fe0('0xc')]['message']);return _0x2f0da3(_0x1bb192[_0x6fe0('0xc')][_0x6fe0('0xe')]);}logger['error'](_0x6fe0('0x8'),_0x34643f,_0x1bb192['error'][_0x6fe0('0xe')]);return _0x3395f8(_0x1bb192['error'][_0x6fe0('0xe')]);}else{logger[_0x6fe0('0x7')](_0x6fe0('0x8'),_0x34643f,_0x6fe0('0x9'));_0x3395f8(_0x1bb192['result'][_0x6fe0('0xe')]);}})[_0x6fe0('0xf')](function(_0x1eefdb){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x34643f,_0x1eefdb);_0x2f0da3(_0x1eefdb);});});} \ No newline at end of file +var _0x2370=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','bluebird'];(function(_0x3ee5cd,_0x3023f6){var _0x593fa4=function(_0x266f68){while(--_0x266f68){_0x3ee5cd['push'](_0x3ee5cd['shift']());}};_0x593fa4(++_0x3023f6);}(_0x2370,0xb3));var _0x0237=function(_0x435850,_0x32aa47){_0x435850=_0x435850-0x0;var _0x5453e4=_0x2370[_0x435850];return _0x5453e4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0237('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0237('0x1'));var db=require(_0x0237('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0237('0x3'))(_0x0237('0x4'));var config=require(_0x0237('0x5'));var jayson=require(_0x0237('0x6'));var client=jayson[_0x0237('0x7')][_0x0237('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e1823,_0x1a2168,_0x2744c6){return new BPromise(function(_0x5bf6e0,_0x109f5e){return client[_0x0237('0x9')](_0x2e1823,_0x2744c6)[_0x0237('0xa')](function(_0x2aab80){logger['info'](_0x0237('0xb'),_0x1a2168,_0x0237('0xc'));logger[_0x0237('0xd')](_0x0237('0xe'),_0x1a2168,_0x0237('0xc'),JSON['stringify'](_0x2aab80));if(_0x2aab80[_0x0237('0xf')]){if(_0x2aab80[_0x0237('0xf')]['code']===0x1f4){logger[_0x0237('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x1a2168,_0x2aab80[_0x0237('0xf')][_0x0237('0x10')]);return _0x109f5e(_0x2aab80['error']['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1a2168,_0x2aab80[_0x0237('0xf')][_0x0237('0x10')]);return _0x5bf6e0(_0x2aab80[_0x0237('0xf')][_0x0237('0x10')]);}else{logger[_0x0237('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x1a2168,_0x0237('0xc'));_0x5bf6e0(_0x2aab80[_0x0237('0x12')][_0x0237('0x10')]);}})[_0x0237('0x13')](function(_0x30a756){logger[_0x0237('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x1a2168,_0x30a756);_0x109f5e(_0x30a756);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 6366089..9da0abd 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 _0x1ad2=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x1ad2,0x90));var _0x21ad=function(_0x40bb0f,_0x51fd57){_0x40bb0f=_0x40bb0f-0x0;var _0x2557a6=_0x1ad2[_0x40bb0f];return _0x2557a6;};'use strict';var multer=require(_0x21ad('0x0'));var util=require(_0x21ad('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x21ad('0x2'));var router=express[_0x21ad('0x3')]();var fs_extra=require(_0x21ad('0x4'));var auth=require(_0x21ad('0x5'));var interaction=require(_0x21ad('0x6'));var config=require('../../config/environment');var controller=require(_0x21ad('0x7'));router[_0x21ad('0x8')]('/',auth[_0x21ad('0x9')](),controller[_0x21ad('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x21ad('0xb')]);router[_0x21ad('0xc')]('/',auth[_0x21ad('0x9')](),controller[_0x21ad('0xd')]);router[_0x21ad('0xe')](_0x21ad('0xf'),auth[_0x21ad('0x9')](),controller['update']);router[_0x21ad('0x10')](_0x21ad('0xf'),auth['isAuthenticated'](),controller[_0x21ad('0x11')]);module['exports']=router; \ No newline at end of file +var _0xdf35=['update','delete','/:id','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','show','post','create'];(function(_0x4f6811,_0x1b55b8){var _0x1cb1e6=function(_0x3838fb){while(--_0x3838fb){_0x4f6811['push'](_0x4f6811['shift']());}};_0x1cb1e6(++_0x1b55b8);}(_0xdf35,0x75));var _0x5df3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xdf35[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5df3('0x0'));var express=require(_0x5df3('0x1'));var router=express['Router']();var fs_extra=require(_0x5df3('0x2'));var auth=require(_0x5df3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5df3('0x4'));var controller=require(_0x5df3('0x5'));router[_0x5df3('0x6')]('/',auth[_0x5df3('0x7')](),controller['index']);router[_0x5df3('0x6')]('/:id',auth[_0x5df3('0x7')](),controller[_0x5df3('0x8')]);router[_0x5df3('0x9')]('/',auth[_0x5df3('0x7')](),controller[_0x5df3('0xa')]);router['put']('/:id',auth[_0x5df3('0x7')](),controller[_0x5df3('0xb')]);router[_0x5df3('0xc')](_0x5df3('0xd'),auth[_0x5df3('0x7')](),controller[_0x5df3('0xe')]);module[_0x5df3('0xf')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 92ac65c..6ec2021 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 _0x43d5=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x5f1dc5,_0x101c9d){var _0x5b1d8f=function(_0x55465f){while(--_0x55465f){_0x5f1dc5['push'](_0x5f1dc5['shift']());}};_0x5b1d8f(++_0x101c9d);}(_0x43d5,0xec));var _0x543d=function(_0x2263d6,_0x23ef72){_0x2263d6=_0x2263d6-0x0;var _0x392795=_0x43d5[_0x2263d6];return _0x392795;};'use strict';var Sequelize=require(_0x543d('0x0'));module['exports']={'type':{'type':Sequelize[_0x543d('0x1')](_0x543d('0x2'),_0x543d('0x3'),_0x543d('0x4'),_0x543d('0x5'),_0x543d('0x6')),'defaultValue':_0x543d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x543d('0x7')]},'keyType':{'type':Sequelize[_0x543d('0x1')](_0x543d('0x2'),_0x543d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x543d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x543d('0x7')]},'customField':{'type':Sequelize[_0x543d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x543d('0x7')]}}; \ No newline at end of file +var _0xc478=['keyValue','picklist','STRING','variable','BOOLEAN','ENUM','string','customVariable'];(function(_0x323025,_0x339fc8){var _0x254931=function(_0xaf1279){while(--_0xaf1279){_0x323025['push'](_0x323025['shift']());}};_0x254931(++_0x339fc8);}(_0xc478,0x105));var _0x8c47=function(_0x177db2,_0xd1f204){_0x177db2=_0x177db2-0x0;var _0x200189=_0xc478[_0x177db2];return _0x200189;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8c47('0x0')](_0x8c47('0x1'),'variable',_0x8c47('0x2'),_0x8c47('0x3'),_0x8c47('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8c47('0x5')]},'key':{'type':Sequelize[_0x8c47('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x8c47('0x1'),_0x8c47('0x6'),_0x8c47('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8c47('0x5')]},'nameField':{'type':Sequelize[_0x8c47('0x5')]},'customField':{'type':Sequelize[_0x8c47('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c47('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 59d2b33..079082e 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 _0xe765=['model','hasOwnProperty','nolimit','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','map','VtigerField','fieldName','query','filters','intersection','fields','attributes','length'];(function(_0x30b09f,_0x13a909){var _0x421fa2=function(_0x2da770){while(--_0x2da770){_0x30b09f['push'](_0x30b09f['shift']());}};_0x421fa2(++_0x13a909);}(_0xe765,0x12e));var _0x5e76=function(_0x4192be,_0x477983){_0x4192be=_0x4192be-0x0;var _0x4fb1fb=_0xe765[_0x4192be];return _0x4fb1fb;};'use strict';var emlformat=require(_0x5e76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e76('0x1'));var jsonpatch=require(_0x5e76('0x2'));var rp=require(_0x5e76('0x3'));var moment=require(_0x5e76('0x4'));var BPromise=require(_0x5e76('0x5'));var Mustache=require(_0x5e76('0x6'));var util=require(_0x5e76('0x7'));var path=require(_0x5e76('0x8'));var sox=require(_0x5e76('0x9'));var csv=require(_0x5e76('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e76('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e76('0xc'));var toCsv=require(_0x5e76('0xa'));var querystring=require(_0x5e76('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5e76('0xe'));var qs=require(_0x5e76('0xf'));var as=require(_0x5e76('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e76('0x11'))(_0x5e76('0x12'));var utils=require(_0x5e76('0x13'));var config=require(_0x5e76('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c636e,_0x9ffadb){_0x9ffadb=_0x9ffadb||0xcc;return function(_0x436386){if(_0x436386){return _0x2c636e[_0x5e76('0x15')](_0x9ffadb);}return _0x2c636e[_0x5e76('0x16')](_0x9ffadb)[_0x5e76('0x17')]();};}function respondWithResult(_0x406f9a,_0x5430f5){_0x5430f5=_0x5430f5||0xc8;return function(_0x141f51){if(_0x141f51){return _0x406f9a[_0x5e76('0x16')](_0x5430f5)[_0x5e76('0x18')](_0x141f51);}};}function respondWithFilteredResult(_0x2b609b,_0x6728bc){return function(_0x4f1ee3){if(_0x4f1ee3){var _0x2f4f63=typeof _0x6728bc[_0x5e76('0x19')]===_0x5e76('0x1a')&&typeof _0x6728bc['limit']===_0x5e76('0x1a');var _0x24a7fa=_0x4f1ee3[_0x5e76('0x1b')];var _0x3ef38e=_0x2f4f63?0x0:_0x6728bc['offset'];var _0xdc22a8=_0x2f4f63?_0x4f1ee3[_0x5e76('0x1b')]:_0x6728bc['offset']+_0x6728bc[_0x5e76('0x1c')];var _0x5d89c1;if(_0xdc22a8>=_0x24a7fa){_0xdc22a8=_0x24a7fa;_0x5d89c1=0xc8;}else{_0x5d89c1=0xce;}_0x2b609b['status'](_0x5d89c1);return _0x2b609b[_0x5e76('0x1d')]('Content-Range',_0x3ef38e+'-'+_0xdc22a8+'/'+_0x24a7fa)[_0x5e76('0x18')](_0x4f1ee3);}return null;};}function patchUpdates(_0x5aceb8){return function(_0x1ed0bc){try{jsonpatch['apply'](_0x1ed0bc,_0x5aceb8,!![]);}catch(_0xbb49ed){return BPromise[_0x5e76('0x1e')](_0xbb49ed);}return _0x1ed0bc[_0x5e76('0x1f')]();};}function saveUpdates(_0x4ee72b,_0x15fa4e){return function(_0x1541de){if(_0x1541de){return _0x1541de[_0x5e76('0x20')](_0x4ee72b)['then'](function(_0x27e4cb){return _0x27e4cb;});}return null;};}function removeEntity(_0xc3deee,_0x5f3ac4){return function(_0xdfb355){if(_0xdfb355){return _0xdfb355[_0x5e76('0x21')]()[_0x5e76('0x22')](function(){_0xc3deee[_0x5e76('0x16')](0xcc)[_0x5e76('0x17')]();});}};}function handleEntityNotFound(_0x2a7ebd,_0x497377){return function(_0x3e45cd){if(!_0x3e45cd){_0x2a7ebd['sendStatus'](0x194);}return _0x3e45cd;};}function handleError(_0x2df37b,_0x4afb4a){_0x4afb4a=_0x4afb4a||0x1f4;return function(_0x2ec87d){logger[_0x5e76('0x23')](_0x2ec87d[_0x5e76('0x24')]);if(_0x2ec87d[_0x5e76('0x25')]){delete _0x2ec87d['name'];}_0x2df37b[_0x5e76('0x16')](_0x4afb4a)[_0x5e76('0x26')](_0x2ec87d);};}exports['index']=function(_0x2b0345,_0x575715){var _0x1e6b36={},_0x160239={},_0x23a2a5={'count':0x0,'rows':[]};var _0x4c2e4c=_[_0x5e76('0x27')](db[_0x5e76('0x28')]['rawAttributes'],function(_0x1c8db6){return{'name':_0x1c8db6[_0x5e76('0x29')],'type':_0x1c8db6['type']['key']};});_0x160239['model']=_[_0x5e76('0x27')](_0x4c2e4c,_0x5e76('0x25'));_0x160239[_0x5e76('0x2a')]=_['keys'](_0x2b0345[_0x5e76('0x2a')]);_0x160239[_0x5e76('0x2b')]=_[_0x5e76('0x2c')](_0x160239['model'],_0x160239[_0x5e76('0x2a')]);_0x1e6b36['attributes']=_[_0x5e76('0x2c')](_0x160239['model'],qs[_0x5e76('0x2d')](_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x2d')]));_0x1e6b36['attributes']=_0x1e6b36[_0x5e76('0x2e')][_0x5e76('0x2f')]?_0x1e6b36[_0x5e76('0x2e')]:_0x160239[_0x5e76('0x30')];if(!_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x31')](_0x5e76('0x32'))){_0x1e6b36['limit']=qs['limit'](_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x1c')]);_0x1e6b36[_0x5e76('0x19')]=qs['offset'](_0x2b0345[_0x5e76('0x2a')]['offset']);}_0x1e6b36['order']=qs['sort'](_0x2b0345[_0x5e76('0x2a')]['sort']);_0x1e6b36[_0x5e76('0x33')]=qs['filters'](_[_0x5e76('0x34')](_0x2b0345['query'],_0x160239[_0x5e76('0x2b')]),_0x4c2e4c);if(_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x35')]){_0x1e6b36['where']=_['merge'](_0x1e6b36[_0x5e76('0x33')],{'$or':_[_0x5e76('0x27')](_0x4c2e4c,function(_0x46ca62){if(_0x46ca62[_0x5e76('0x36')]!==_0x5e76('0x37')){var _0x428881={};_0x428881[_0x46ca62['name']]={'$like':'%'+_0x2b0345[_0x5e76('0x2a')][_0x5e76('0x35')]+'%'};return _0x428881;}})});}_0x1e6b36=_[_0x5e76('0x38')]({},_0x1e6b36,_0x2b0345[_0x5e76('0x39')]);var _0x5254ac={'where':_0x1e6b36[_0x5e76('0x33')]};return db[_0x5e76('0x28')]['count'](_0x5254ac)[_0x5e76('0x22')](function(_0x2f3a1b){_0x23a2a5[_0x5e76('0x1b')]=_0x2f3a1b;if(_0x2b0345[_0x5e76('0x2a')]['includeAll']){_0x1e6b36[_0x5e76('0x3a')]=[{'all':!![]}];}return db[_0x5e76('0x28')][_0x5e76('0x3b')](_0x1e6b36);})[_0x5e76('0x22')](function(_0x5129b0){_0x23a2a5[_0x5e76('0x3c')]=_0x5129b0;return _0x23a2a5;})[_0x5e76('0x22')](respondWithFilteredResult(_0x575715,_0x1e6b36))[_0x5e76('0x3d')](handleError(_0x575715,null));};exports[_0x5e76('0x3e')]=function(_0x30e28c,_0x4bc410){var _0x3b44ce={'raw':!![],'where':{'id':_0x30e28c['params']['id']}},_0x17e2bd={};_0x17e2bd[_0x5e76('0x30')]=_[_0x5e76('0x3f')](db[_0x5e76('0x28')][_0x5e76('0x40')]);_0x17e2bd[_0x5e76('0x2a')]=_[_0x5e76('0x3f')](_0x30e28c[_0x5e76('0x2a')]);_0x17e2bd[_0x5e76('0x2b')]=_[_0x5e76('0x2c')](_0x17e2bd[_0x5e76('0x30')],_0x17e2bd['query']);_0x3b44ce[_0x5e76('0x2e')]=_[_0x5e76('0x2c')](_0x17e2bd[_0x5e76('0x30')],qs[_0x5e76('0x2d')](_0x30e28c[_0x5e76('0x2a')][_0x5e76('0x2d')]));_0x3b44ce['attributes']=_0x3b44ce['attributes'][_0x5e76('0x2f')]?_0x3b44ce['attributes']:_0x17e2bd['model'];if(_0x30e28c[_0x5e76('0x2a')][_0x5e76('0x41')]){_0x3b44ce[_0x5e76('0x3a')]=[{'all':!![]}];}_0x3b44ce=_['merge']({},_0x3b44ce,_0x30e28c['options']);return db[_0x5e76('0x28')][_0x5e76('0x42')](_0x3b44ce)[_0x5e76('0x22')](handleEntityNotFound(_0x4bc410,null))[_0x5e76('0x22')](respondWithResult(_0x4bc410,null))[_0x5e76('0x3d')](handleError(_0x4bc410,null));};exports[_0x5e76('0x43')]=function(_0x3d8598,_0xdca54f){return db[_0x5e76('0x28')][_0x5e76('0x43')](_0x3d8598[_0x5e76('0x44')],{})[_0x5e76('0x22')](respondWithResult(_0xdca54f,0xc9))[_0x5e76('0x3d')](handleError(_0xdca54f,null));};exports['update']=function(_0x5e7ada,_0x1489d7){if(_0x5e7ada[_0x5e76('0x44')]['id']){delete _0x5e7ada[_0x5e76('0x44')]['id'];}return db[_0x5e76('0x28')][_0x5e76('0x42')]({'where':{'id':_0x5e7ada[_0x5e76('0x45')]['id']}})[_0x5e76('0x22')](handleEntityNotFound(_0x1489d7,null))[_0x5e76('0x22')](saveUpdates(_0x5e7ada['body'],null))[_0x5e76('0x22')](respondWithResult(_0x1489d7,null))['catch'](handleError(_0x1489d7,null));};exports[_0x5e76('0x21')]=function(_0x55365c,_0x233ab5){return db['VtigerField']['find']({'where':{'id':_0x55365c['params']['id']}})[_0x5e76('0x22')](handleEntityNotFound(_0x233ab5,null))[_0x5e76('0x22')](removeEntity(_0x233ab5,null))['catch'](handleError(_0x233ab5,null));}; \ No newline at end of file +var _0xc439=['desk.js','querystring','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','VtigerField','includeAll','include','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x47ae01,_0x2dd0b0){var _0x15b3b7=function(_0x540ebc){while(--_0x540ebc){_0x47ae01['push'](_0x47ae01['shift']());}};_0x15b3b7(++_0x2dd0b0);}(_0xc439,0x81));var _0x9c43=function(_0x110faa,_0x26fe69){_0x110faa=_0x110faa-0x0;var _0x4b8e3c=_0xc439[_0x110faa];return _0x4b8e3c;};'use strict';var emlformat=require(_0x9c43('0x0'));var rimraf=require(_0x9c43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c43('0x2'));var rp=require('request-promise');var moment=require(_0x9c43('0x3'));var BPromise=require(_0x9c43('0x4'));var Mustache=require(_0x9c43('0x5'));var util=require(_0x9c43('0x6'));var path=require(_0x9c43('0x7'));var sox=require('sox');var csv=require(_0x9c43('0x8'));var ejs=require(_0x9c43('0x9'));var fs=require('fs');var fs_extra=require(_0x9c43('0xa'));var _=require(_0x9c43('0xb'));var squel=require(_0x9c43('0xc'));var crypto=require(_0x9c43('0xd'));var jsforce=require(_0x9c43('0xe'));var deskjs=require(_0x9c43('0xf'));var toCsv=require(_0x9c43('0x8'));var querystring=require(_0x9c43('0x10'));var Papa=require('papaparse');var Redis=require(_0x9c43('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9c43('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9c43('0x13'));var config=require(_0x9c43('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c43('0x15'))['db'];function respondWithStatusCode(_0x22539e,_0x20ad28){_0x20ad28=_0x20ad28||0xcc;return function(_0x24733f){if(_0x24733f){return _0x22539e[_0x9c43('0x16')](_0x20ad28);}return _0x22539e[_0x9c43('0x17')](_0x20ad28)['end']();};}function respondWithResult(_0x1e87f8,_0x35cae0){_0x35cae0=_0x35cae0||0xc8;return function(_0x2df3e3){if(_0x2df3e3){return _0x1e87f8[_0x9c43('0x17')](_0x35cae0)[_0x9c43('0x18')](_0x2df3e3);}};}function respondWithFilteredResult(_0x598366,_0x64e69c){return function(_0x57e558){if(_0x57e558){var _0x3f39c7=typeof _0x64e69c[_0x9c43('0x19')]==='undefined'&&typeof _0x64e69c[_0x9c43('0x1a')]===_0x9c43('0x1b');var _0xe4879d=_0x57e558[_0x9c43('0x1c')];var _0x378945=_0x3f39c7?0x0:_0x64e69c[_0x9c43('0x19')];var _0x4c46da=_0x3f39c7?_0x57e558[_0x9c43('0x1c')]:_0x64e69c[_0x9c43('0x19')]+_0x64e69c[_0x9c43('0x1a')];var _0x364797;if(_0x4c46da>=_0xe4879d){_0x4c46da=_0xe4879d;_0x364797=0xc8;}else{_0x364797=0xce;}_0x598366['status'](_0x364797);return _0x598366['set'](_0x9c43('0x1d'),_0x378945+'-'+_0x4c46da+'/'+_0xe4879d)[_0x9c43('0x18')](_0x57e558);}return null;};}function patchUpdates(_0x2352eb){return function(_0x32861f){try{jsonpatch[_0x9c43('0x1e')](_0x32861f,_0x2352eb,!![]);}catch(_0x40e368){return BPromise[_0x9c43('0x1f')](_0x40e368);}return _0x32861f[_0x9c43('0x20')]();};}function saveUpdates(_0x56522f,_0x4ada44){return function(_0x4a2166){if(_0x4a2166){return _0x4a2166[_0x9c43('0x21')](_0x56522f)[_0x9c43('0x22')](function(_0x696c8a){return _0x696c8a;});}return null;};}function removeEntity(_0xbbd1bb,_0x2a15c6){return function(_0x29c347){if(_0x29c347){return _0x29c347[_0x9c43('0x23')]()[_0x9c43('0x22')](function(){_0xbbd1bb[_0x9c43('0x17')](0xcc)[_0x9c43('0x24')]();});}};}function handleEntityNotFound(_0x78db10,_0x238075){return function(_0x17ed07){if(!_0x17ed07){_0x78db10[_0x9c43('0x16')](0x194);}return _0x17ed07;};}function handleError(_0x355c65,_0x347c8d){_0x347c8d=_0x347c8d||0x1f4;return function(_0x264f13){logger[_0x9c43('0x25')](_0x264f13[_0x9c43('0x26')]);if(_0x264f13['name']){delete _0x264f13[_0x9c43('0x27')];}_0x355c65[_0x9c43('0x17')](_0x347c8d)[_0x9c43('0x28')](_0x264f13);};}exports['index']=function(_0x2ed0bb,_0x220c29){var _0x35950c={},_0x393362={},_0xd6b134={'count':0x0,'rows':[]};var _0x401055=_[_0x9c43('0x29')](db['VtigerField'][_0x9c43('0x2a')],function(_0x1d8c2a){return{'name':_0x1d8c2a[_0x9c43('0x2b')],'type':_0x1d8c2a[_0x9c43('0x2c')][_0x9c43('0x2d')]};});_0x393362['model']=_[_0x9c43('0x29')](_0x401055,'name');_0x393362['query']=_[_0x9c43('0x2e')](_0x2ed0bb[_0x9c43('0x2f')]);_0x393362[_0x9c43('0x30')]=_[_0x9c43('0x31')](_0x393362[_0x9c43('0x32')],_0x393362['query']);_0x35950c[_0x9c43('0x33')]=_[_0x9c43('0x31')](_0x393362['model'],qs[_0x9c43('0x34')](_0x2ed0bb[_0x9c43('0x2f')][_0x9c43('0x34')]));_0x35950c[_0x9c43('0x33')]=_0x35950c[_0x9c43('0x33')][_0x9c43('0x35')]?_0x35950c[_0x9c43('0x33')]:_0x393362['model'];if(!_0x2ed0bb[_0x9c43('0x2f')][_0x9c43('0x36')](_0x9c43('0x37'))){_0x35950c['limit']=qs[_0x9c43('0x1a')](_0x2ed0bb[_0x9c43('0x2f')]['limit']);_0x35950c[_0x9c43('0x19')]=qs[_0x9c43('0x19')](_0x2ed0bb[_0x9c43('0x2f')][_0x9c43('0x19')]);}_0x35950c[_0x9c43('0x38')]=qs['sort'](_0x2ed0bb[_0x9c43('0x2f')][_0x9c43('0x39')]);_0x35950c[_0x9c43('0x3a')]=qs['filters'](_['pick'](_0x2ed0bb[_0x9c43('0x2f')],_0x393362[_0x9c43('0x30')]),_0x401055);if(_0x2ed0bb[_0x9c43('0x2f')][_0x9c43('0x3b')]){_0x35950c[_0x9c43('0x3a')]=_['merge'](_0x35950c[_0x9c43('0x3a')],{'$or':_[_0x9c43('0x29')](_0x401055,function(_0x4983a1){if(_0x4983a1[_0x9c43('0x2c')]!=='VIRTUAL'){var _0x1bb4d9={};_0x1bb4d9[_0x4983a1[_0x9c43('0x27')]]={'$like':'%'+_0x2ed0bb['query']['filter']+'%'};return _0x1bb4d9;}})});}_0x35950c=_[_0x9c43('0x3c')]({},_0x35950c,_0x2ed0bb[_0x9c43('0x3d')]);var _0x56c3a2={'where':_0x35950c[_0x9c43('0x3a')]};return db[_0x9c43('0x3e')][_0x9c43('0x1c')](_0x56c3a2)[_0x9c43('0x22')](function(_0x364c7a){_0xd6b134['count']=_0x364c7a;if(_0x2ed0bb[_0x9c43('0x2f')][_0x9c43('0x3f')]){_0x35950c[_0x9c43('0x40')]=[{'all':!![]}];}return db[_0x9c43('0x3e')]['findAll'](_0x35950c);})['then'](function(_0x1cf0a5){_0xd6b134[_0x9c43('0x41')]=_0x1cf0a5;return _0xd6b134;})[_0x9c43('0x22')](respondWithFilteredResult(_0x220c29,_0x35950c))[_0x9c43('0x42')](handleError(_0x220c29,null));};exports[_0x9c43('0x43')]=function(_0x10817a,_0x577094){var _0xf5bd46={'raw':!![],'where':{'id':_0x10817a[_0x9c43('0x44')]['id']}},_0x5ccfdf={};_0x5ccfdf[_0x9c43('0x32')]=_[_0x9c43('0x2e')](db[_0x9c43('0x3e')][_0x9c43('0x2a')]);_0x5ccfdf['query']=_['keys'](_0x10817a[_0x9c43('0x2f')]);_0x5ccfdf[_0x9c43('0x30')]=_['intersection'](_0x5ccfdf['model'],_0x5ccfdf[_0x9c43('0x2f')]);_0xf5bd46['attributes']=_['intersection'](_0x5ccfdf[_0x9c43('0x32')],qs[_0x9c43('0x34')](_0x10817a[_0x9c43('0x2f')][_0x9c43('0x34')]));_0xf5bd46[_0x9c43('0x33')]=_0xf5bd46[_0x9c43('0x33')][_0x9c43('0x35')]?_0xf5bd46[_0x9c43('0x33')]:_0x5ccfdf[_0x9c43('0x32')];if(_0x10817a['query'][_0x9c43('0x3f')]){_0xf5bd46['include']=[{'all':!![]}];}_0xf5bd46=_[_0x9c43('0x3c')]({},_0xf5bd46,_0x10817a[_0x9c43('0x3d')]);return db['VtigerField']['find'](_0xf5bd46)[_0x9c43('0x22')](handleEntityNotFound(_0x577094,null))[_0x9c43('0x22')](respondWithResult(_0x577094,null))[_0x9c43('0x42')](handleError(_0x577094,null));};exports[_0x9c43('0x45')]=function(_0x466ee6,_0x192e9f){return db[_0x9c43('0x3e')][_0x9c43('0x45')](_0x466ee6[_0x9c43('0x46')],{})[_0x9c43('0x22')](respondWithResult(_0x192e9f,0xc9))[_0x9c43('0x42')](handleError(_0x192e9f,null));};exports[_0x9c43('0x21')]=function(_0x44923b,_0x1614f3){if(_0x44923b[_0x9c43('0x46')]['id']){delete _0x44923b[_0x9c43('0x46')]['id'];}return db[_0x9c43('0x3e')][_0x9c43('0x47')]({'where':{'id':_0x44923b['params']['id']}})['then'](handleEntityNotFound(_0x1614f3,null))['then'](saveUpdates(_0x44923b[_0x9c43('0x46')],null))['then'](respondWithResult(_0x1614f3,null))[_0x9c43('0x42')](handleError(_0x1614f3,null));};exports[_0x9c43('0x23')]=function(_0x13b272,_0x3b63aa){return db[_0x9c43('0x3e')][_0x9c43('0x47')]({'where':{'id':_0x13b272[_0x9c43('0x44')]['id']}})[_0x9c43('0x22')](handleEntityNotFound(_0x3b63aa,null))[_0x9c43('0x22')](removeEntity(_0x3b63aa,null))[_0x9c43('0x42')](handleError(_0x3b63aa,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 80839aa..abcd15e 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 _0x8579=['rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','api','bluebird','request-promise','path'];(function(_0x386481,_0x4a204b){var _0x5decfb=function(_0x3fb98a){while(--_0x3fb98a){_0x386481['push'](_0x386481['shift']());}};_0x5decfb(++_0x4a204b);}(_0x8579,0x167));var _0x9857=function(_0xfd793f,_0x4c8080){_0xfd793f=_0xfd793f-0x0;var _0x1d316b=_0x8579[_0xfd793f];return _0x1d316b;};'use strict';var _=require(_0x9857('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9857('0x1'));var moment=require('moment');var BPromise=require(_0x9857('0x2'));var rp=require(_0x9857('0x3'));var fs=require('fs');var path=require(_0x9857('0x4'));var rimraf=require(_0x9857('0x5'));var config=require(_0x9857('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x9857('0x7')]=function(_0x270e78,_0x1b8288){return _0x270e78[_0x9857('0x8')](_0x9857('0x9'),attributes,{'tableName':_0x9857('0xa'),'paranoid':![],'indexes':[{'name':_0x9857('0xb'),'fields':[_0x9857('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d0a=['int_vtiger_fields','vtiger_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x2d0a,0x10c));var _0xa2d0=function(_0x5f0e7c,_0x2e2212){_0x5f0e7c=_0x5f0e7c-0x0;var _0x350d04=_0x2d0a[_0x5f0e7c];return _0x350d04;};'use strict';var _=require(_0xa2d0('0x0'));var util=require(_0xa2d0('0x1'));var logger=require(_0xa2d0('0x2'))(_0xa2d0('0x3'));var moment=require(_0xa2d0('0x4'));var BPromise=require(_0xa2d0('0x5'));var rp=require(_0xa2d0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2d0('0x7'));var config=require(_0xa2d0('0x8'));var attributes=require(_0xa2d0('0x9'));module['exports']=function(_0x39dc55,_0x2e67e5){return _0x39dc55[_0xa2d0('0xa')](_0xa2d0('0xb'),attributes,{'tableName':_0xa2d0('0xc'),'paranoid':![],'indexes':[{'name':_0xa2d0('0xd'),'fields':['idField','FieldId'],'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 d9030dd..6083eb9 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 _0x7fbb=['then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7fbb,0xe7));var _0xb7fb=function(_0x27dfc0,_0x967d19){_0x27dfc0=_0x27dfc0-0x0;var _0x222b1f=_0x7fbb[_0x27dfc0];return _0x222b1f;};'use strict';var _=require(_0xb7fb('0x0'));var util=require(_0xb7fb('0x1'));var moment=require(_0xb7fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xb7fb('0x3'));var fs=require('fs');var Redis=require(_0xb7fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7fb('0x5'));var logger=require('../../config/logger')(_0xb7fb('0x6'));var config=require(_0xb7fb('0x7'));var jayson=require(_0xb7fb('0x8'));var client=jayson[_0xb7fb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15430b,_0x12c4bf,_0x3b9594){return new BPromise(function(_0x49a7e3,_0x3a0098){return client[_0xb7fb('0xa')](_0x15430b,_0x3b9594)[_0xb7fb('0xb')](function(_0xc8982b){logger[_0xb7fb('0xc')](_0xb7fb('0xd'),_0x12c4bf,_0xb7fb('0xe'));logger[_0xb7fb('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x12c4bf,_0xb7fb('0xe'),JSON[_0xb7fb('0x10')](_0xc8982b));if(_0xc8982b[_0xb7fb('0x11')]){if(_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x12')]===0x1f4){logger[_0xb7fb('0x11')](_0xb7fb('0xd'),_0x12c4bf,_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);return _0x3a0098(_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);}logger['error'](_0xb7fb('0xd'),_0x12c4bf,_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);return _0x49a7e3(_0xc8982b[_0xb7fb('0x11')][_0xb7fb('0x13')]);}else{logger[_0xb7fb('0xc')](_0xb7fb('0xd'),_0x12c4bf,_0xb7fb('0xe'));_0x49a7e3(_0xc8982b[_0xb7fb('0x14')][_0xb7fb('0x13')]);}})[_0xb7fb('0x15')](function(_0x137fde){logger[_0xb7fb('0x11')](_0xb7fb('0xd'),_0x12c4bf,_0x137fde);_0x3a0098(_0x137fde);});});} \ No newline at end of file +var _0x4d1b=['VtigerField,\x20%s,\x20%s,\x20%s','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0xc4b7e0,_0x32994a){var _0x35a5e6=function(_0x1ccaee){while(--_0x1ccaee){_0xc4b7e0['push'](_0xc4b7e0['shift']());}};_0x35a5e6(++_0x32994a);}(_0x4d1b,0x196));var _0xb4d1=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x4d1b[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var moment=require('moment');var BPromise=require(_0xb4d1('0x2'));var rs=require(_0xb4d1('0x3'));var fs=require('fs');var Redis=require(_0xb4d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb4d1('0x6'));var jayson=require(_0xb4d1('0x7'));var client=jayson[_0xb4d1('0x8')][_0xb4d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2506a8,_0x20081c,_0x440c16){return new BPromise(function(_0x5d01f1,_0x209a56){return client[_0xb4d1('0xa')](_0x2506a8,_0x440c16)['then'](function(_0x12aae4){logger[_0xb4d1('0xb')]('VtigerField,\x20%s,\x20%s',_0x20081c,_0xb4d1('0xc'));logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x20081c,'request\x20sent',JSON['stringify'](_0x12aae4));if(_0x12aae4['error']){if(_0x12aae4[_0xb4d1('0xf')][_0xb4d1('0x10')]===0x1f4){logger[_0xb4d1('0xf')](_0xb4d1('0x11'),_0x20081c,_0x12aae4[_0xb4d1('0xf')]['message']);return _0x209a56(_0x12aae4['error'][_0xb4d1('0x12')]);}logger[_0xb4d1('0xf')](_0xb4d1('0x11'),_0x20081c,_0x12aae4[_0xb4d1('0xf')][_0xb4d1('0x12')]);return _0x5d01f1(_0x12aae4[_0xb4d1('0xf')][_0xb4d1('0x12')]);}else{logger[_0xb4d1('0xb')]('VtigerField,\x20%s,\x20%s',_0x20081c,_0xb4d1('0xc'));_0x5d01f1(_0x12aae4['result'][_0xb4d1('0x12')]);}})[_0xb4d1('0x13')](function(_0x5710e3){logger['error']('VtigerField,\x20%s,\x20%s',_0x20081c,_0x5710e3);_0x209a56(_0x5710e3);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 8afb4b0..d1e44f2 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 _0x778e=['./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x39e047,_0x321d1e){var _0x442417=function(_0x15a12c){while(--_0x15a12c){_0x39e047['push'](_0x39e047['shift']());}};_0x442417(++_0x321d1e);}(_0x778e,0x124));var _0xe778=function(_0x12d1dc,_0x1c2af3){_0x12d1dc=_0x12d1dc-0x0;var _0x325cd0=_0x778e[_0x12d1dc];return _0x325cd0;};'use strict';var multer=require(_0xe778('0x0'));var util=require(_0xe778('0x1'));var path=require('path');var timeout=require(_0xe778('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe778('0x3'));var auth=require(_0xe778('0x4'));var interaction=require(_0xe778('0x5'));var config=require(_0xe778('0x6'));var controller=require(_0xe778('0x7'));router[_0xe778('0x8')]('/',auth[_0xe778('0x9')](),controller[_0xe778('0xa')]);router[_0xe778('0x8')](_0xe778('0xb'),auth[_0xe778('0x9')](),controller[_0xe778('0xc')]);router[_0xe778('0x8')](_0xe778('0xd'),auth[_0xe778('0x9')](),controller[_0xe778('0xe')]);router['get'](_0xe778('0xf'),auth[_0xe778('0x9')](),controller[_0xe778('0x10')]);router[_0xe778('0x11')]('/',auth['isAuthenticated'](),controller[_0xe778('0x12')]);router[_0xe778('0x11')](_0xe778('0xd'),auth[_0xe778('0x9')](),controller['addConfiguration']);router[_0xe778('0x13')](_0xe778('0xb'),auth['isAuthenticated'](),controller[_0xe778('0x14')]);router['delete'](_0xe778('0xb'),auth[_0xe778('0x9')](),controller[_0xe778('0x15')]);module[_0xe778('0x16')]=router; \ No newline at end of file +var _0x8073=['/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index'];(function(_0x911254,_0x38ae33){var _0x1e8104=function(_0x370041){while(--_0x370041){_0x911254['push'](_0x911254['shift']());}};_0x1e8104(++_0x38ae33);}(_0x8073,0x68));var _0x3807=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x8073[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3807('0x0'));var express=require(_0x3807('0x1'));var router=express[_0x3807('0x2')]();var fs_extra=require(_0x3807('0x3'));var auth=require(_0x3807('0x4'));var interaction=require(_0x3807('0x5'));var config=require(_0x3807('0x6'));var controller=require(_0x3807('0x7'));router[_0x3807('0x8')]('/',auth[_0x3807('0x9')](),controller[_0x3807('0xa')]);router[_0x3807('0x8')](_0x3807('0xb'),auth['isAuthenticated'](),controller[_0x3807('0xc')]);router[_0x3807('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3807('0xd')]);router[_0x3807('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3807('0xe')]);router[_0x3807('0xf')]('/',auth['isAuthenticated'](),controller[_0x3807('0x10')]);router[_0x3807('0xf')](_0x3807('0x11'),auth[_0x3807('0x9')](),controller['addConfiguration']);router[_0x3807('0x12')](_0x3807('0xb'),auth[_0x3807('0x9')](),controller[_0x3807('0x13')]);router[_0x3807('0x14')](_0x3807('0xb'),auth[_0x3807('0x9')](),controller[_0x3807('0x15')]);module[_0x3807('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 57d1bb0..6667d0a 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 _0x9666=['sequelize','exports','STRING','username','ENUM','password','token','newTab','integrationTab'];(function(_0x551749,_0x194bfb){var _0x4c9055=function(_0x58697b){while(--_0x58697b){_0x551749['push'](_0x551749['shift']());}};_0x4c9055(++_0x194bfb);}(_0x9666,0x17a));var _0x6966=function(_0x5b4992,_0x3df39d){_0x5b4992=_0x5b4992-0x0;var _0x48aace=_0x9666[_0x5b4992];return _0x48aace;};'use strict';var Sequelize=require(_0x6966('0x0'));module[_0x6966('0x1')]={'name':{'type':Sequelize[_0x6966('0x2')]},'description':{'type':Sequelize[_0x6966('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6966('0x3')},'password':{'type':Sequelize[_0x6966('0x2')]},'token':{'type':Sequelize[_0x6966('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x6966('0x4')](_0x6966('0x5'),_0x6966('0x6')),'defaultValue':_0x6966('0x5')},'serverUrl':{'type':Sequelize[_0x6966('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6966('0x4')]('integrationTab',_0x6966('0x7')),'defaultValue':_0x6966('0x8')}}; \ No newline at end of file +var _0x363e=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x56b9e6,_0x31c49d){var _0x3c9710=function(_0x122359){while(--_0x122359){_0x56b9e6['push'](_0x56b9e6['shift']());}};_0x3c9710(++_0x31c49d);}(_0x363e,0x179));var _0xe363=function(_0x1e8433,_0x4f2b72){_0x1e8433=_0x1e8433-0x0;var _0x4c4564=_0x363e[_0x1e8433];return _0x4c4564;};'use strict';var Sequelize=require(_0xe363('0x0'));module[_0xe363('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe363('0x2')]},'username':{'type':Sequelize[_0xe363('0x2')],'unique':_0xe363('0x3')},'password':{'type':Sequelize[_0xe363('0x2')]},'token':{'type':Sequelize[_0xe363('0x2')]},'remoteUri':{'type':Sequelize[_0xe363('0x2')],'unique':_0xe363('0x4')},'authType':{'type':Sequelize[_0xe363('0x5')](_0xe363('0x6'),_0xe363('0x7')),'defaultValue':_0xe363('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe363('0x5')](_0xe363('0x8'),_0xe363('0x9')),'defaultValue':_0xe363('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 2b9e89c..013f28e 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 _0x44a3=['save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x44a3,0x1a9));var _0x344a=function(_0x12954a,_0x304691){_0x12954a=_0x12954a-0x0;var _0x5ccde2=_0x44a3[_0x12954a];return _0x5ccde2;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4a69ea,_0x304b70){_0x304b70=_0x304b70||0xcc;return function(_0x2ad7eb){if(_0x2ad7eb){return _0x4a69ea[_0x344a('0x17')](_0x304b70);}return _0x4a69ea[_0x344a('0x18')](_0x304b70)[_0x344a('0x19')]();};}function respondWithResult(_0x133ad4,_0x4ee562){_0x4ee562=_0x4ee562||0xc8;return function(_0x4032d7){if(_0x4032d7){return _0x133ad4[_0x344a('0x18')](_0x4ee562)[_0x344a('0x1a')](_0x4032d7);}};}function respondWithFilteredResult(_0x6e1639,_0x58c8cd){return function(_0x54a643){if(_0x54a643){var _0x3609ce=typeof _0x58c8cd[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x58c8cd[_0x344a('0x1d')]==='undefined';var _0x397de6=_0x54a643[_0x344a('0x1e')];var _0x49b55f=_0x3609ce?0x0:_0x58c8cd[_0x344a('0x1b')];var _0x274016=_0x3609ce?_0x54a643[_0x344a('0x1e')]:_0x58c8cd[_0x344a('0x1b')]+_0x58c8cd[_0x344a('0x1d')];var _0x43fa0f;if(_0x274016>=_0x397de6){_0x274016=_0x397de6;_0x43fa0f=0xc8;}else{_0x43fa0f=0xce;}_0x6e1639[_0x344a('0x18')](_0x43fa0f);return _0x6e1639[_0x344a('0x1f')](_0x344a('0x20'),_0x49b55f+'-'+_0x274016+'/'+_0x397de6)[_0x344a('0x1a')](_0x54a643);}return null;};}function patchUpdates(_0x4b3552){return function(_0x16c0fe){try{jsonpatch[_0x344a('0x21')](_0x16c0fe,_0x4b3552,!![]);}catch(_0xe0bdd4){return BPromise[_0x344a('0x22')](_0xe0bdd4);}return _0x16c0fe[_0x344a('0x23')]();};}function saveUpdates(_0x80ae12,_0x185303){return function(_0x976bcf){if(_0x976bcf){return _0x976bcf[_0x344a('0x24')](_0x80ae12)[_0x344a('0x25')](function(_0x90070c){return _0x90070c;});}return null;};}function removeEntity(_0x3b2ab9,_0x5ce9da){return function(_0x266fce){if(_0x266fce){return _0x266fce['destroy']()[_0x344a('0x25')](function(){_0x3b2ab9['status'](0xcc)[_0x344a('0x19')]();});}};}function handleEntityNotFound(_0x484f97,_0x36c920){return function(_0x8bf0b0){if(!_0x8bf0b0){_0x484f97[_0x344a('0x17')](0x194);}return _0x8bf0b0;};}function handleError(_0x16d404,_0x26f059){_0x26f059=_0x26f059||0x1f4;return function(_0x28749b){logger[_0x344a('0x26')](_0x28749b[_0x344a('0x27')]);if(_0x28749b['name']){delete _0x28749b[_0x344a('0x28')];}_0x16d404[_0x344a('0x18')](_0x26f059)[_0x344a('0x29')](_0x28749b);};}exports[_0x344a('0x2a')]=function(_0x14bd54,_0x2d72c9){var _0x5b877d={},_0x3d25fe={},_0x49bbf8={'count':0x0,'rows':[]};var _0x593cf6=_[_0x344a('0x2b')](db[_0x344a('0x2c')][_0x344a('0x2d')],function(_0x4803db){return{'name':_0x4803db['fieldName'],'type':_0x4803db['type'][_0x344a('0x2e')]};});_0x3d25fe[_0x344a('0x2f')]=_[_0x344a('0x2b')](_0x593cf6,'name');_0x3d25fe[_0x344a('0x30')]=_[_0x344a('0x31')](_0x14bd54[_0x344a('0x30')]);_0x3d25fe[_0x344a('0x32')]=_[_0x344a('0x33')](_0x3d25fe[_0x344a('0x2f')],_0x3d25fe[_0x344a('0x30')]);_0x5b877d['attributes']=_[_0x344a('0x33')](_0x3d25fe['model'],qs['fields'](_0x14bd54['query'][_0x344a('0x34')]));_0x5b877d[_0x344a('0x35')]=_0x5b877d[_0x344a('0x35')][_0x344a('0x36')]?_0x5b877d[_0x344a('0x35')]:_0x3d25fe[_0x344a('0x2f')];if(!_0x14bd54['query'][_0x344a('0x37')](_0x344a('0x38'))){_0x5b877d[_0x344a('0x1d')]=qs['limit'](_0x14bd54[_0x344a('0x30')][_0x344a('0x1d')]);_0x5b877d[_0x344a('0x1b')]=qs[_0x344a('0x1b')](_0x14bd54[_0x344a('0x30')]['offset']);}_0x5b877d[_0x344a('0x39')]=qs[_0x344a('0x3a')](_0x14bd54[_0x344a('0x30')][_0x344a('0x3a')]);_0x5b877d[_0x344a('0x3b')]=qs['filters'](_[_0x344a('0x3c')](_0x14bd54[_0x344a('0x30')],_0x3d25fe[_0x344a('0x32')]),_0x593cf6);if(_0x14bd54[_0x344a('0x30')][_0x344a('0x3d')]){_0x5b877d['where']=_[_0x344a('0x3e')](_0x5b877d[_0x344a('0x3b')],{'$or':_[_0x344a('0x2b')](_0x593cf6,function(_0x3356fb){if(_0x3356fb[_0x344a('0x3f')]!==_0x344a('0x40')){var _0x335a0a={};_0x335a0a[_0x3356fb[_0x344a('0x28')]]={'$like':'%'+_0x14bd54['query'][_0x344a('0x3d')]+'%'};return _0x335a0a;}})});}_0x5b877d=_[_0x344a('0x3e')]({},_0x5b877d,_0x14bd54[_0x344a('0x41')]);var _0x28bad9={'where':_0x5b877d[_0x344a('0x3b')]};return db['ZendeskAccount'][_0x344a('0x1e')](_0x28bad9)[_0x344a('0x25')](function(_0x7a33d7){_0x49bbf8[_0x344a('0x1e')]=_0x7a33d7;if(_0x14bd54[_0x344a('0x30')][_0x344a('0x42')]){_0x5b877d[_0x344a('0x43')]=[{'all':!![]}];}return db[_0x344a('0x2c')][_0x344a('0x44')](_0x5b877d);})['then'](function(_0x115a9c){_0x49bbf8[_0x344a('0x45')]=_0x115a9c;return _0x49bbf8;})[_0x344a('0x25')](respondWithFilteredResult(_0x2d72c9,_0x5b877d))[_0x344a('0x46')](handleError(_0x2d72c9,null));};exports['show']=function(_0x32bfa6,_0x3069ca){var _0x2b0ee9={'raw':![],'where':{'id':_0x32bfa6[_0x344a('0x47')]['id']}},_0x41f25b={};_0x41f25b[_0x344a('0x2f')]=_[_0x344a('0x31')](db[_0x344a('0x2c')][_0x344a('0x2d')]);_0x41f25b[_0x344a('0x30')]=_[_0x344a('0x31')](_0x32bfa6['query']);_0x41f25b[_0x344a('0x32')]=_[_0x344a('0x33')](_0x41f25b['model'],_0x41f25b[_0x344a('0x30')]);_0x2b0ee9[_0x344a('0x35')]=_['intersection'](_0x41f25b[_0x344a('0x2f')],qs[_0x344a('0x34')](_0x32bfa6['query'][_0x344a('0x34')]));_0x2b0ee9[_0x344a('0x35')]=_0x2b0ee9[_0x344a('0x35')]['length']?_0x2b0ee9[_0x344a('0x35')]:_0x41f25b['model'];if(_0x32bfa6[_0x344a('0x30')][_0x344a('0x42')]){_0x2b0ee9[_0x344a('0x43')]=[{'all':!![]}];}_0x2b0ee9=_[_0x344a('0x3e')]({},_0x2b0ee9,_0x32bfa6['options']);return db['ZendeskAccount'][_0x344a('0x48')](_0x2b0ee9)[_0x344a('0x25')](handleEntityNotFound(_0x3069ca,null))[_0x344a('0x25')](respondWithResult(_0x3069ca,null))[_0x344a('0x46')](handleError(_0x3069ca,null));};exports[_0x344a('0x49')]=function(_0xa3c8f0,_0x44962b){return db[_0x344a('0x2c')][_0x344a('0x49')](_0xa3c8f0[_0x344a('0x4a')],{})['then'](respondWithResult(_0x44962b,0xc9))[_0x344a('0x46')](handleError(_0x44962b,null));};exports[_0x344a('0x24')]=function(_0x6fad37,_0xbad7ca){if(_0x6fad37['body']['id']){delete _0x6fad37[_0x344a('0x4a')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x6fad37[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0xbad7ca,null))['then'](saveUpdates(_0x6fad37[_0x344a('0x4a')],null))[_0x344a('0x25')](respondWithResult(_0xbad7ca,null))[_0x344a('0x46')](handleError(_0xbad7ca,null));};exports[_0x344a('0x4b')]=function(_0x51e411,_0x225fce){return db[_0x344a('0x2c')][_0x344a('0x48')]({'where':{'id':_0x51e411[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x225fce,null))[_0x344a('0x25')](removeEntity(_0x225fce,null))[_0x344a('0x46')](handleError(_0x225fce,null));};exports[_0x344a('0x4c')]=function(_0x292357,_0x1911d0,_0x5e0885){var _0x15928a={};var _0x47ce9c={};var _0x1b7f6c;var _0xb744c6;return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x292357[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x1911d0,null))[_0x344a('0x25')](function(_0x14921e){if(_0x14921e){_0x1b7f6c=_0x14921e;_0x47ce9c[_0x344a('0x2f')]=_[_0x344a('0x31')](db[_0x344a('0x4d')][_0x344a('0x2d')]);_0x47ce9c[_0x344a('0x30')]=_['keys'](_0x292357[_0x344a('0x30')]);_0x47ce9c[_0x344a('0x32')]=_[_0x344a('0x33')](_0x47ce9c[_0x344a('0x2f')],_0x47ce9c[_0x344a('0x30')]);_0x15928a['attributes']=_[_0x344a('0x33')](_0x47ce9c[_0x344a('0x2f')],qs[_0x344a('0x34')](_0x292357[_0x344a('0x30')]['fields']));_0x15928a[_0x344a('0x35')]=_0x15928a[_0x344a('0x35')]['length']?_0x15928a[_0x344a('0x35')]:_0x47ce9c[_0x344a('0x2f')];_0x15928a[_0x344a('0x39')]=qs[_0x344a('0x3a')](_0x292357[_0x344a('0x30')][_0x344a('0x3a')]);_0x15928a[_0x344a('0x3b')]=qs['filters'](_['pick'](_0x292357['query'],_0x47ce9c[_0x344a('0x32')]));if(_0x292357[_0x344a('0x30')][_0x344a('0x3d')]){_0x15928a[_0x344a('0x3b')]=_['merge'](_0x15928a[_0x344a('0x3b')],{'$or':_['map'](_0x15928a['attributes'],function(_0x57241e){var _0x56b562={};_0x56b562[_0x57241e]={'$like':'%'+_0x292357[_0x344a('0x30')][_0x344a('0x3d')]+'%'};return _0x56b562;})});}_0x15928a=_[_0x344a('0x3e')]({},_0x15928a,_0x292357[_0x344a('0x41')]);return _0x1b7f6c['getConfigurations'](_0x15928a);}})['then'](function(_0x56e76e){if(_0x56e76e){_0xb744c6=_0x56e76e[_0x344a('0x36')];if(!_0x292357[_0x344a('0x30')][_0x344a('0x37')](_0x344a('0x38'))){_0x15928a[_0x344a('0x1d')]=qs['limit'](_0x292357[_0x344a('0x30')][_0x344a('0x1d')]);_0x15928a[_0x344a('0x1b')]=qs['offset'](_0x292357[_0x344a('0x30')]['offset']);}return _0x1b7f6c['getConfigurations'](_0x15928a);}})[_0x344a('0x25')](function(_0x532bcf){if(_0x532bcf){return _0x532bcf?{'count':_0xb744c6,'rows':_0x532bcf}:null;}})['then'](respondWithResult(_0x1911d0,null))[_0x344a('0x46')](handleError(_0x1911d0,null));};exports[_0x344a('0x4e')]=function(_0x4f2e35,_0x1bf894,_0x5808f2){if(_0x4f2e35[_0x344a('0x4a')]['id']){delete _0x4f2e35[_0x344a('0x4a')]['id'];}return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x4f2e35['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x1bf894,null))[_0x344a('0x25')](function(_0xb4ddd7){if(_0xb4ddd7){_0x4f2e35[_0x344a('0x4a')]['AccountId']=_0xb4ddd7['id'];_0x4f2e35['body'][_0x344a('0x4f')]=integrations[_0x344a('0x50')](_0x4f2e35[_0x344a('0x4a')]['channel'],_0x4f2e35[_0x344a('0x4a')][_0x344a('0x3f')]);_0x4f2e35['body'][_0x344a('0x51')]=integrations['getDescriptions'](_0x4f2e35[_0x344a('0x4a')]['channel'],_0x4f2e35['body']['type']);return db[_0x344a('0x4d')][_0x344a('0x49')](_0x4f2e35[_0x344a('0x4a')],{'include':[{'model':db[_0x344a('0x52')],'as':_0x344a('0x4f')},{'model':db[_0x344a('0x52')],'as':'Descriptions'}]});}return null;})[_0x344a('0x25')](respondWithResult(_0x1bf894,null))[_0x344a('0x46')](handleError(_0x1bf894,null));};exports[_0x344a('0x53')]=function(_0x1c4284,_0x26688e,_0x523774){var _0x23a761='';return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x1c4284[_0x344a('0x47')]['id']},'attributes':['id',_0x344a('0x54'),_0x344a('0x55'),_0x344a('0x56'),'authType',_0x344a('0x57')]})[_0x344a('0x25')](handleEntityNotFound(_0x26688e,null))[_0x344a('0x25')](function(_0x42e1c0){if(_0x42e1c0){_0x23a761=_0x42e1c0[_0x344a('0x57')];var _0x421a09=_0x23a761[_0x344a('0x58')](-0x1);if(_0x421a09==='/'){_0x23a761=_0x23a761[_0x344a('0x59')](0x0,_0x23a761['lastIndexOf'](_0x421a09));}var _0x33113e={'method':_0x344a('0x5a'),'uri':util[_0x344a('0x5b')](_0x344a('0x5c'),_0x23a761,_0x344a('0x5d')),'json':!![]};switch(_0x42e1c0[_0x344a('0x5e')]){case _0x344a('0x55'):_0x33113e[_0x344a('0x5f')]={'Authorization':util['format'](_0x344a('0x60'),new Buffer(util[_0x344a('0x5b')](_0x344a('0x61'),_0x42e1c0[_0x344a('0x54')],_0x42e1c0['password']))[_0x344a('0x62')](_0x344a('0x63')))};break;case _0x344a('0x56'):_0x33113e[_0x344a('0x5f')]={'Authorization':util[_0x344a('0x5b')](_0x344a('0x60'),new Buffer(util[_0x344a('0x5b')](_0x344a('0x64'),_0x42e1c0['username'],_0x42e1c0[_0x344a('0x56')]))[_0x344a('0x62')](_0x344a('0x63')))};break;default:throw new db[(_0x344a('0x65'))]['ValidationError'](_0x344a('0x66'));}return rp(_0x33113e);}})[_0x344a('0x25')](function(_0x1d0025){if(_0x1d0025){var _0x2ff11d=[_0x344a('0x67'),_0x344a('0x68'),'group',_0x344a('0x69')];_[_0x344a('0x6a')](_0x1d0025[_0x344a('0x5d')],function(_0x5584d5){return _0x2ff11d[_0x344a('0x6b')](_0x5584d5[_0x344a('0x3f')]);});return{'count':_0x1d0025[_0x344a('0x5d')][_0x344a('0x36')],'rows':_[_0x344a('0x2b')](_0x1d0025['ticket_fields'],function(_0x15aadb){return{'id':_0x15aadb['id'],'name':_0x15aadb[_0x344a('0x6c')]>0x7?_0x15aadb[_0x344a('0x6d')]:_0x15aadb['type'],'custom':_0x15aadb[_0x344a('0x6c')]>0x7?!![]:![],'options':_0x15aadb['system_field_options']?_0x15aadb['system_field_options']:_0x15aadb[_0x344a('0x6e')]?_0x15aadb[_0x344a('0x6e')]:[]};})};}})[_0x344a('0x25')](respondWithResult(_0x26688e,null))[_0x344a('0x46')](function(_0x375c34){var _0x5e8df4=_0x1c4284[_0x344a('0x30')][_0x344a('0x6f')]?0x1f4:_0x375c34['statusCode']||0x1f4;logger[_0x344a('0x26')](_0x344a('0x70'),'getFields',_0x5e8df4,JSON['stringify'](_0x375c34));delete _0x375c34[_0x344a('0x28')];if(_0x5e8df4===0x191){_0x5e8df4=0x190;}_0x26688e[_0x344a('0x18')](_0x5e8df4)[_0x344a('0x29')](_0x1c4284[_0x344a('0x30')]['test']?{'message':_0x344a('0x71'),'statusCode':_0x375c34[_0x344a('0x72')]}:_0x375c34);});}; \ No newline at end of file +var _0xbfcc=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','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','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZendeskAccount','count','include','findAll','rows','then','catch','show','params','includeAll','find','create','body','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','Basic\x20%s','format','%s:%s','password','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','includes'];(function(_0xfb02c9,_0x43c274){var _0x9afb71=function(_0x56dff0){while(--_0x56dff0){_0xfb02c9['push'](_0xfb02c9['shift']());}};_0x9afb71(++_0x43c274);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xbfcc[_0x355ce8];return _0x1db8b8;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3bfd05,_0x86f67c){_0x86f67c=_0x86f67c||0xcc;return function(_0x80d08d){if(_0x80d08d){return _0x3bfd05['sendStatus'](_0x86f67c);}return _0x3bfd05[_0xcbfc('0x16')](_0x86f67c)[_0xcbfc('0x17')]();};}function respondWithResult(_0x2f2bdd,_0x45a5cc){_0x45a5cc=_0x45a5cc||0xc8;return function(_0x16b659){if(_0x16b659){return _0x2f2bdd['status'](_0x45a5cc)[_0xcbfc('0x18')](_0x16b659);}};}function respondWithFilteredResult(_0x1963de,_0x1ec8c4){return function(_0x4317e4){if(_0x4317e4){var _0x50c6b6=typeof _0x1ec8c4['offset']===_0xcbfc('0x19')&&typeof _0x1ec8c4[_0xcbfc('0x1a')]===_0xcbfc('0x19');var _0x4d6946=_0x4317e4['count'];var _0x33f731=_0x50c6b6?0x0:_0x1ec8c4[_0xcbfc('0x1b')];var _0x344510=_0x50c6b6?_0x4317e4['count']:_0x1ec8c4[_0xcbfc('0x1b')]+_0x1ec8c4['limit'];var _0x28f7fb;if(_0x344510>=_0x4d6946){_0x344510=_0x4d6946;_0x28f7fb=0xc8;}else{_0x28f7fb=0xce;}_0x1963de[_0xcbfc('0x16')](_0x28f7fb);return _0x1963de[_0xcbfc('0x1c')](_0xcbfc('0x1d'),_0x33f731+'-'+_0x344510+'/'+_0x4d6946)[_0xcbfc('0x18')](_0x4317e4);}return null;};}function patchUpdates(_0x2653b1){return function(_0x5f09b0){try{jsonpatch[_0xcbfc('0x1e')](_0x5f09b0,_0x2653b1,!![]);}catch(_0x37ec3e){return BPromise['reject'](_0x37ec3e);}return _0x5f09b0[_0xcbfc('0x1f')]();};}function saveUpdates(_0x5a449b,_0x4cc8b3){return function(_0x4e2427){if(_0x4e2427){return _0x4e2427[_0xcbfc('0x20')](_0x5a449b)['then'](function(_0x4a1915){return _0x4a1915;});}return null;};}function removeEntity(_0x1b3e42,_0x34cffa){return function(_0x3ceeff){if(_0x3ceeff){return _0x3ceeff[_0xcbfc('0x21')]()['then'](function(){_0x1b3e42[_0xcbfc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x280b78,_0x75bca0){return function(_0x53951a){if(!_0x53951a){_0x280b78[_0xcbfc('0x22')](0x194);}return _0x53951a;};}function handleError(_0x3b73a3,_0x4ab48e){_0x4ab48e=_0x4ab48e||0x1f4;return function(_0x1b2c01){logger[_0xcbfc('0x23')](_0x1b2c01[_0xcbfc('0x24')]);if(_0x1b2c01[_0xcbfc('0x25')]){delete _0x1b2c01['name'];}_0x3b73a3[_0xcbfc('0x16')](_0x4ab48e)[_0xcbfc('0x26')](_0x1b2c01);};}exports['index']=function(_0x1f6a14,_0x26463f){var _0x7cbdfa={},_0x388d41={},_0x2b4286={'count':0x0,'rows':[]};var _0x19d2e=_[_0xcbfc('0x27')](db['ZendeskAccount'][_0xcbfc('0x28')],function(_0x433300){return{'name':_0x433300[_0xcbfc('0x29')],'type':_0x433300[_0xcbfc('0x2a')]['key']};});_0x388d41[_0xcbfc('0x2b')]=_[_0xcbfc('0x27')](_0x19d2e,_0xcbfc('0x25'));_0x388d41[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x1f6a14[_0xcbfc('0x2c')]);_0x388d41[_0xcbfc('0x2e')]=_['intersection'](_0x388d41[_0xcbfc('0x2b')],_0x388d41[_0xcbfc('0x2c')]);_0x7cbdfa['attributes']=_[_0xcbfc('0x2f')](_0x388d41[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x1f6a14['query']['fields']));_0x7cbdfa['attributes']=_0x7cbdfa[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x7cbdfa[_0xcbfc('0x31')]:_0x388d41[_0xcbfc('0x2b')];if(!_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x33')](_0xcbfc('0x34'))){_0x7cbdfa[_0xcbfc('0x1a')]=qs['limit'](_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x1a')]);_0x7cbdfa['offset']=qs[_0xcbfc('0x1b')](_0x1f6a14['query'][_0xcbfc('0x1b')]);}_0x7cbdfa[_0xcbfc('0x35')]=qs[_0xcbfc('0x36')](_0x1f6a14['query'][_0xcbfc('0x36')]);_0x7cbdfa['where']=qs['filters'](_[_0xcbfc('0x37')](_0x1f6a14[_0xcbfc('0x2c')],_0x388d41[_0xcbfc('0x2e')]),_0x19d2e);if(_0x1f6a14[_0xcbfc('0x2c')][_0xcbfc('0x38')]){_0x7cbdfa[_0xcbfc('0x39')]=_[_0xcbfc('0x3a')](_0x7cbdfa[_0xcbfc('0x39')],{'$or':_['map'](_0x19d2e,function(_0x15fb08){if(_0x15fb08['type']!==_0xcbfc('0x3b')){var _0x44064d={};_0x44064d[_0x15fb08[_0xcbfc('0x25')]]={'$like':'%'+_0x1f6a14[_0xcbfc('0x2c')]['filter']+'%'};return _0x44064d;}})});}_0x7cbdfa=_['merge']({},_0x7cbdfa,_0x1f6a14[_0xcbfc('0x3c')]);var _0x1c678b={'where':_0x7cbdfa[_0xcbfc('0x39')]};return db[_0xcbfc('0x3d')][_0xcbfc('0x3e')](_0x1c678b)['then'](function(_0x1901b4){_0x2b4286[_0xcbfc('0x3e')]=_0x1901b4;if(_0x1f6a14[_0xcbfc('0x2c')]['includeAll']){_0x7cbdfa[_0xcbfc('0x3f')]=[{'all':!![]}];}return db[_0xcbfc('0x3d')][_0xcbfc('0x40')](_0x7cbdfa);})['then'](function(_0x28266c){_0x2b4286[_0xcbfc('0x41')]=_0x28266c;return _0x2b4286;})[_0xcbfc('0x42')](respondWithFilteredResult(_0x26463f,_0x7cbdfa))[_0xcbfc('0x43')](handleError(_0x26463f,null));};exports[_0xcbfc('0x44')]=function(_0x28447a,_0x1e14bb){var _0x561544={'raw':![],'where':{'id':_0x28447a[_0xcbfc('0x45')]['id']}},_0x2de7fe={};_0x2de7fe['model']=_[_0xcbfc('0x2d')](db[_0xcbfc('0x3d')][_0xcbfc('0x28')]);_0x2de7fe[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x28447a[_0xcbfc('0x2c')]);_0x2de7fe[_0xcbfc('0x2e')]=_[_0xcbfc('0x2f')](_0x2de7fe['model'],_0x2de7fe[_0xcbfc('0x2c')]);_0x561544[_0xcbfc('0x31')]=_[_0xcbfc('0x2f')](_0x2de7fe[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x28447a[_0xcbfc('0x2c')][_0xcbfc('0x30')]));_0x561544['attributes']=_0x561544[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x561544['attributes']:_0x2de7fe[_0xcbfc('0x2b')];if(_0x28447a[_0xcbfc('0x2c')][_0xcbfc('0x46')]){_0x561544['include']=[{'all':!![]}];}_0x561544=_[_0xcbfc('0x3a')]({},_0x561544,_0x28447a[_0xcbfc('0x3c')]);return db[_0xcbfc('0x3d')][_0xcbfc('0x47')](_0x561544)[_0xcbfc('0x42')](handleEntityNotFound(_0x1e14bb,null))[_0xcbfc('0x42')](respondWithResult(_0x1e14bb,null))[_0xcbfc('0x43')](handleError(_0x1e14bb,null));};exports['create']=function(_0x5a87b6,_0x237f30){return db[_0xcbfc('0x3d')][_0xcbfc('0x48')](_0x5a87b6[_0xcbfc('0x49')],{})['then'](respondWithResult(_0x237f30,0xc9))['catch'](handleError(_0x237f30,null));};exports[_0xcbfc('0x20')]=function(_0xe5c5ef,_0x12340f){if(_0xe5c5ef['body']['id']){delete _0xe5c5ef[_0xcbfc('0x49')]['id'];}return db[_0xcbfc('0x3d')][_0xcbfc('0x47')]({'where':{'id':_0xe5c5ef['params']['id']}})[_0xcbfc('0x42')](handleEntityNotFound(_0x12340f,null))[_0xcbfc('0x42')](saveUpdates(_0xe5c5ef[_0xcbfc('0x49')],null))[_0xcbfc('0x42')](respondWithResult(_0x12340f,null))[_0xcbfc('0x43')](handleError(_0x12340f,null));};exports[_0xcbfc('0x21')]=function(_0x222b58,_0x374998){return db[_0xcbfc('0x3d')][_0xcbfc('0x47')]({'where':{'id':_0x222b58['params']['id']}})[_0xcbfc('0x42')](handleEntityNotFound(_0x374998,null))[_0xcbfc('0x42')](removeEntity(_0x374998,null))[_0xcbfc('0x43')](handleError(_0x374998,null));};exports['getConfigurations']=function(_0x28ae7f,_0x1a89c1,_0x4b7038){var _0x54de8={};var _0x5ce8e3={};var _0x38db76;var _0x25e48d;return db['ZendeskAccount'][_0xcbfc('0x4a')]({'where':{'id':_0x28ae7f[_0xcbfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a89c1,null))[_0xcbfc('0x42')](function(_0x34db13){if(_0x34db13){_0x38db76=_0x34db13;_0x5ce8e3[_0xcbfc('0x2b')]=_[_0xcbfc('0x2d')](db[_0xcbfc('0x4b')][_0xcbfc('0x28')]);_0x5ce8e3[_0xcbfc('0x2c')]=_[_0xcbfc('0x2d')](_0x28ae7f[_0xcbfc('0x2c')]);_0x5ce8e3[_0xcbfc('0x2e')]=_['intersection'](_0x5ce8e3[_0xcbfc('0x2b')],_0x5ce8e3['query']);_0x54de8['attributes']=_['intersection'](_0x5ce8e3[_0xcbfc('0x2b')],qs[_0xcbfc('0x30')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x30')]));_0x54de8[_0xcbfc('0x31')]=_0x54de8[_0xcbfc('0x31')][_0xcbfc('0x32')]?_0x54de8[_0xcbfc('0x31')]:_0x5ce8e3['model'];_0x54de8[_0xcbfc('0x35')]=qs[_0xcbfc('0x36')](_0x28ae7f[_0xcbfc('0x2c')]['sort']);_0x54de8[_0xcbfc('0x39')]=qs[_0xcbfc('0x2e')](_[_0xcbfc('0x37')](_0x28ae7f[_0xcbfc('0x2c')],_0x5ce8e3[_0xcbfc('0x2e')]));if(_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x38')]){_0x54de8['where']=_[_0xcbfc('0x3a')](_0x54de8['where'],{'$or':_[_0xcbfc('0x27')](_0x54de8[_0xcbfc('0x31')],function(_0x5de047){var _0x2c6b23={};_0x2c6b23[_0x5de047]={'$like':'%'+_0x28ae7f['query'][_0xcbfc('0x38')]+'%'};return _0x2c6b23;})});}_0x54de8=_[_0xcbfc('0x3a')]({},_0x54de8,_0x28ae7f[_0xcbfc('0x3c')]);return _0x38db76[_0xcbfc('0x4c')](_0x54de8);}})[_0xcbfc('0x42')](function(_0x1b2b24){if(_0x1b2b24){_0x25e48d=_0x1b2b24['length'];if(!_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x33')]('nolimit')){_0x54de8[_0xcbfc('0x1a')]=qs[_0xcbfc('0x1a')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x1a')]);_0x54de8[_0xcbfc('0x1b')]=qs[_0xcbfc('0x1b')](_0x28ae7f[_0xcbfc('0x2c')][_0xcbfc('0x1b')]);}return _0x38db76['getConfigurations'](_0x54de8);}})[_0xcbfc('0x42')](function(_0x3f01da){if(_0x3f01da){return _0x3f01da?{'count':_0x25e48d,'rows':_0x3f01da}:null;}})[_0xcbfc('0x42')](respondWithResult(_0x1a89c1,null))[_0xcbfc('0x43')](handleError(_0x1a89c1,null));};exports[_0xcbfc('0x4d')]=function(_0x2fb0c2,_0x209d61,_0x380539){if(_0x2fb0c2[_0xcbfc('0x49')]['id']){delete _0x2fb0c2[_0xcbfc('0x49')]['id'];}return db['ZendeskAccount'][_0xcbfc('0x4a')]({'where':{'id':_0x2fb0c2[_0xcbfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x209d61,null))[_0xcbfc('0x42')](function(_0x510a43){if(_0x510a43){_0x2fb0c2['body'][_0xcbfc('0x4e')]=_0x510a43['id'];_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x4f')]=integrations[_0xcbfc('0x50')](_0x2fb0c2[_0xcbfc('0x49')]['channel'],_0x2fb0c2['body'][_0xcbfc('0x2a')]);_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x51')]=integrations[_0xcbfc('0x52')](_0x2fb0c2[_0xcbfc('0x49')]['channel'],_0x2fb0c2[_0xcbfc('0x49')][_0xcbfc('0x2a')]);return db[_0xcbfc('0x4b')]['create'](_0x2fb0c2['body'],{'include':[{'model':db['ZendeskField'],'as':_0xcbfc('0x4f')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0xcbfc('0x42')](respondWithResult(_0x209d61,null))['catch'](handleError(_0x209d61,null));};exports[_0xcbfc('0x53')]=function(_0x34e671,_0xed28ff,_0x461e5b){var _0x16d91a='';return db[_0xcbfc('0x3d')][_0xcbfc('0x4a')]({'where':{'id':_0x34e671[_0xcbfc('0x45')]['id']},'attributes':['id',_0xcbfc('0x54'),'password',_0xcbfc('0x55'),_0xcbfc('0x56'),_0xcbfc('0x57')]})['then'](handleEntityNotFound(_0xed28ff,null))[_0xcbfc('0x42')](function(_0x1640e9){if(_0x1640e9){_0x16d91a=_0x1640e9[_0xcbfc('0x57')];var _0x318346=_0x16d91a[_0xcbfc('0x58')](-0x1);if(_0x318346==='/'){_0x16d91a=_0x16d91a[_0xcbfc('0x59')](0x0,_0x16d91a[_0xcbfc('0x5a')](_0x318346));}var _0x562380={'method':_0xcbfc('0x5b'),'uri':util['format'](_0xcbfc('0x5c'),_0x16d91a,_0xcbfc('0x5d')),'json':!![]};switch(_0x1640e9[_0xcbfc('0x56')]){case'password':_0x562380[_0xcbfc('0x5e')]={'Authorization':util['format'](_0xcbfc('0x5f'),new Buffer(util[_0xcbfc('0x60')](_0xcbfc('0x61'),_0x1640e9[_0xcbfc('0x54')],_0x1640e9[_0xcbfc('0x62')]))[_0xcbfc('0x63')](_0xcbfc('0x64')))};break;case'token':_0x562380[_0xcbfc('0x5e')]={'Authorization':util[_0xcbfc('0x60')](_0xcbfc('0x5f'),new Buffer(util['format'](_0xcbfc('0x65'),_0x1640e9['username'],_0x1640e9[_0xcbfc('0x55')]))[_0xcbfc('0x63')](_0xcbfc('0x64')))};break;default:throw new db['Sequelize'][(_0xcbfc('0x66'))](_0xcbfc('0x67'));}return rp(_0x562380);}})['then'](function(_0xb3378d){if(_0xb3378d){var _0x58be73=[_0xcbfc('0x68'),'description',_0xcbfc('0x69'),_0xcbfc('0x6a')];_['remove'](_0xb3378d[_0xcbfc('0x5d')],function(_0x4cf2e1){return _0x58be73[_0xcbfc('0x6b')](_0x4cf2e1[_0xcbfc('0x2a')]);});return{'count':_0xb3378d[_0xcbfc('0x5d')][_0xcbfc('0x32')],'rows':_['map'](_0xb3378d[_0xcbfc('0x5d')],function(_0x4c1e0a){return{'id':_0x4c1e0a['id'],'name':_0x4c1e0a[_0xcbfc('0x6c')]>0x7?_0x4c1e0a[_0xcbfc('0x6d')]:_0x4c1e0a[_0xcbfc('0x2a')],'custom':_0x4c1e0a[_0xcbfc('0x6c')]>0x7?!![]:![],'options':_0x4c1e0a[_0xcbfc('0x6e')]?_0x4c1e0a[_0xcbfc('0x6e')]:_0x4c1e0a[_0xcbfc('0x6f')]?_0x4c1e0a[_0xcbfc('0x6f')]:[]};})};}})[_0xcbfc('0x42')](respondWithResult(_0xed28ff,null))[_0xcbfc('0x43')](function(_0x3a3b24){var _0x297513=_0x34e671[_0xcbfc('0x2c')][_0xcbfc('0x70')]?0x1f4:_0x3a3b24[_0xcbfc('0x71')]||0x1f4;logger[_0xcbfc('0x23')](_0xcbfc('0x72'),'getFields',_0x297513,JSON[_0xcbfc('0x73')](_0x3a3b24));delete _0x3a3b24['name'];if(_0x297513===0x191){_0x297513=0x190;}_0xed28ff[_0xcbfc('0x16')](_0x297513)['send'](_0x34e671[_0xcbfc('0x2c')][_0xcbfc('0x70')]?{'message':_0xcbfc('0x74'),'statusCode':_0x3a3b24[_0xcbfc('0x71')]}:_0x3a3b24);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b9537cd..92c3e81 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 _0x0983=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1447c3,_0x56ee5d){var _0x36a5cd=function(_0x2a7c78){while(--_0x2a7c78){_0x1447c3['push'](_0x1447c3['shift']());}};_0x36a5cd(++_0x56ee5d);}(_0x0983,0xac));var _0x3098=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0983[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x3098('0x0'));var util=require(_0x3098('0x1'));var logger=require(_0x3098('0x2'))(_0x3098('0x3'));var moment=require(_0x3098('0x4'));var BPromise=require('bluebird');var rp=require(_0x3098('0x5'));var fs=require('fs');var path=require(_0x3098('0x6'));var rimraf=require(_0x3098('0x7'));var config=require('../../config/environment');var attributes=require(_0x3098('0x8'));var integrations=require(_0x3098('0x9'));module[_0x3098('0xa')]=function(_0x4535d5,_0x4417a6){return _0x4535d5[_0x3098('0xb')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78c7=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','ZendeskAccount','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x78c7,0x14c));var _0x778c=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x78c7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require(_0x778c('0x0'));var logger=require(_0x778c('0x1'))(_0x778c('0x2'));var moment=require(_0x778c('0x3'));var BPromise=require(_0x778c('0x4'));var rp=require(_0x778c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x778c('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x778c('0x7'));module['exports']=function(_0x551539,_0x25cc3c){return _0x551539['define'](_0x778c('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 3ad27da..89356e3 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 _0x473a=['limit','include','model','map','then','ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','bluebird','ioredis','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','catch','GetZendeskAccount','options','raw','where','attributes'];(function(_0x5a2404,_0x6b350d){var _0x346d09=function(_0x132061){while(--_0x132061){_0x5a2404['push'](_0x5a2404['shift']());}};_0x346d09(++_0x6b350d);}(_0x473a,0x173));var _0xa473=function(_0x59094c,_0x2e9005){_0x59094c=_0x59094c-0x0;var _0x40742f=_0x473a[_0x59094c];return _0x40742f;};'use strict';var _=require(_0xa473('0x0'));var util=require(_0xa473('0x1'));var moment=require(_0xa473('0x2'));var BPromise=require(_0xa473('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa473('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa473('0x5'));var client=jayson[_0xa473('0x6')][_0xa473('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x299a2e,_0x312952,_0x2e5de8){return new BPromise(function(_0x34192a,_0x3882ff){return client[_0xa473('0x8')](_0x299a2e,_0x2e5de8)['then'](function(_0x477d37){logger[_0xa473('0x9')](_0xa473('0xa'),_0x312952,_0xa473('0xb'));logger[_0xa473('0xc')](_0xa473('0xd'),_0x312952,_0xa473('0xb'),JSON[_0xa473('0xe')](_0x477d37));if(_0x477d37[_0xa473('0xf')]){if(_0x477d37['error'][_0xa473('0x10')]===0x1f4){logger[_0xa473('0xf')](_0xa473('0xa'),_0x312952,_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);return _0x3882ff(_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);}logger[_0xa473('0xf')](_0xa473('0xa'),_0x312952,_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);return _0x34192a(_0x477d37[_0xa473('0xf')][_0xa473('0x11')]);}else{logger[_0xa473('0x9')](_0xa473('0xa'),_0x312952,'request\x20sent');_0x34192a(_0x477d37[_0xa473('0x12')][_0xa473('0x11')]);}})[_0xa473('0x13')](function(_0x356881){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x312952,_0x356881);_0x3882ff(_0x356881);});});}exports[_0xa473('0x14')]=function(_0x25be68){var _0x1c9f26=this;return new Promise(function(_0x420754,_0x2ab2a3){return db['ZendeskAccount']['findAll']({'raw':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x16')]===undefined?!![]:![]:!![],'where':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x17')]||null:null,'attributes':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x18')]||null:null,'limit':_0x25be68['options']?_0x25be68[_0xa473('0x15')][_0xa473('0x19')]||null:null,'include':_0x25be68[_0xa473('0x15')]?_0x25be68[_0xa473('0x15')][_0xa473('0x1a')]?_['map'](_0x25be68['options'][_0xa473('0x1a')],function(_0x39a19b){return{'model':db[_0x39a19b[_0xa473('0x1b')]],'as':_0x39a19b['as'],'attributes':_0x39a19b['attributes'],'include':_0x39a19b[_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x39a19b[_0xa473('0x1a')],function(_0x36cf4a){return{'model':db[_0x36cf4a[_0xa473('0x1b')]],'as':_0x36cf4a['as'],'attributes':_0x36cf4a[_0xa473('0x18')],'include':_0x36cf4a['include']?_[_0xa473('0x1c')](_0x36cf4a[_0xa473('0x1a')],function(_0x39a089){return{'model':db[_0x39a089['model']],'as':_0x39a089['as'],'attributes':_0x39a089[_0xa473('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa473('0x1d')](function(_0x5258c6){logger['info'](_0xa473('0x14'),_0x25be68);logger[_0xa473('0xc')](_0xa473('0x14'),_0x25be68,JSON[_0xa473('0xe')](_0x5258c6));_0x420754(_0x5258c6);})[_0xa473('0x13')](function(_0x1657bf){logger[_0xa473('0xf')](_0xa473('0x14'),_0x1657bf[_0xa473('0x11')],_0x25be68);_0x2ab2a3(_0x1c9f26[_0xa473('0xf')](0x1f4,_0x1657bf[_0xa473('0x11')]));});});};exports[_0xa473('0x1e')]=function(_0x29f470){var _0x5610a2=this;return new Promise(function(_0x55f365,_0x1b894b){return db[_0xa473('0x1f')][_0xa473('0x20')]({'raw':_0x29f470[_0xa473('0x15')]?_0x29f470[_0xa473('0x15')][_0xa473('0x16')]===undefined?!![]:![]:!![],'where':_0x29f470[_0xa473('0x15')]?_0x29f470[_0xa473('0x15')][_0xa473('0x17')]||null:null,'attributes':_0x29f470[_0xa473('0x15')]?_0x29f470['options'][_0xa473('0x18')]||null:null,'include':_0x29f470[_0xa473('0x15')]?_0x29f470['options'][_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x29f470[_0xa473('0x15')][_0xa473('0x1a')],function(_0x3298c6){return{'model':db[_0x3298c6['model']],'as':_0x3298c6['as'],'attributes':_0x3298c6['attributes'],'include':_0x3298c6[_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x3298c6[_0xa473('0x1a')],function(_0x597aca){return{'model':db[_0x597aca['model']],'as':_0x597aca['as'],'attributes':_0x597aca[_0xa473('0x18')],'include':_0x597aca[_0xa473('0x1a')]?_[_0xa473('0x1c')](_0x597aca[_0xa473('0x1a')],function(_0x13207d){return{'model':db[_0x13207d['model']],'as':_0x13207d['as'],'attributes':_0x13207d[_0xa473('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa473('0x1d')](function(_0x586ad0){logger['info'](_0xa473('0x1e'),_0x29f470);logger['debug'](_0xa473('0x1e'),_0x29f470,JSON[_0xa473('0xe')](_0x586ad0));_0x55f365(_0x586ad0);})[_0xa473('0x13')](function(_0x438166){logger[_0xa473('0xf')](_0xa473('0x1e'),_0x438166[_0xa473('0x11')],_0x29f470);_0x1b894b(_0x5610a2['error'](0x1f4,_0x438166[_0xa473('0x11')]));});});}; \ No newline at end of file +var _0x5231=['options','raw','where','attributes','limit','map','include','model','debug','ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','findAll'];(function(_0x2259c0,_0x52a897){var _0x5a771d=function(_0x102565){while(--_0x102565){_0x2259c0['push'](_0x2259c0['shift']());}};_0x5a771d(++_0x52a897);}(_0x5231,0x114));var _0x1523=function(_0x4e5c37,_0x170d7b){_0x4e5c37=_0x4e5c37-0x0;var _0x2a80d1=_0x5231[_0x4e5c37];return _0x2a80d1;};'use strict';var _=require(_0x1523('0x0'));var util=require(_0x1523('0x1'));var moment=require(_0x1523('0x2'));var BPromise=require(_0x1523('0x3'));var rs=require(_0x1523('0x4'));var fs=require('fs');var Redis=require(_0x1523('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1523('0x6'))(_0x1523('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1523('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d2661,_0x5eb0fb,_0x17f503){return new BPromise(function(_0x55d0fc,_0x1bb00f){return client[_0x1523('0x9')](_0x3d2661,_0x17f503)[_0x1523('0xa')](function(_0x5a3cdd){logger[_0x1523('0xb')](_0x1523('0xc'),_0x5eb0fb,_0x1523('0xd'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x5eb0fb,_0x1523('0xd'),JSON[_0x1523('0xe')](_0x5a3cdd));if(_0x5a3cdd['error']){if(_0x5a3cdd[_0x1523('0xf')][_0x1523('0x10')]===0x1f4){logger[_0x1523('0xf')](_0x1523('0xc'),_0x5eb0fb,_0x5a3cdd[_0x1523('0xf')][_0x1523('0x11')]);return _0x1bb00f(_0x5a3cdd[_0x1523('0xf')][_0x1523('0x11')]);}logger[_0x1523('0xf')](_0x1523('0xc'),_0x5eb0fb,_0x5a3cdd[_0x1523('0xf')]['message']);return _0x55d0fc(_0x5a3cdd[_0x1523('0xf')][_0x1523('0x11')]);}else{logger[_0x1523('0xb')](_0x1523('0xc'),_0x5eb0fb,_0x1523('0xd'));_0x55d0fc(_0x5a3cdd['result'][_0x1523('0x11')]);}})[_0x1523('0x12')](function(_0xc7c6f1){logger[_0x1523('0xf')](_0x1523('0xc'),_0x5eb0fb,_0xc7c6f1);_0x1bb00f(_0xc7c6f1);});});}exports[_0x1523('0x13')]=function(_0x5432f1){var _0x4b48a0=this;return new Promise(function(_0x31a5d1,_0x2d14b7){return db['ZendeskAccount'][_0x1523('0x14')]({'raw':_0x5432f1[_0x1523('0x15')]?_0x5432f1[_0x1523('0x15')][_0x1523('0x16')]===undefined?!![]:![]:!![],'where':_0x5432f1[_0x1523('0x15')]?_0x5432f1[_0x1523('0x15')][_0x1523('0x17')]||null:null,'attributes':_0x5432f1['options']?_0x5432f1[_0x1523('0x15')][_0x1523('0x18')]||null:null,'limit':_0x5432f1['options']?_0x5432f1[_0x1523('0x15')][_0x1523('0x19')]||null:null,'include':_0x5432f1[_0x1523('0x15')]?_0x5432f1[_0x1523('0x15')]['include']?_[_0x1523('0x1a')](_0x5432f1[_0x1523('0x15')][_0x1523('0x1b')],function(_0x4921f3){return{'model':db[_0x4921f3[_0x1523('0x1c')]],'as':_0x4921f3['as'],'attributes':_0x4921f3['attributes'],'include':_0x4921f3[_0x1523('0x1b')]?_[_0x1523('0x1a')](_0x4921f3['include'],function(_0x28ee96){return{'model':db[_0x28ee96['model']],'as':_0x28ee96['as'],'attributes':_0x28ee96[_0x1523('0x18')],'include':_0x28ee96[_0x1523('0x1b')]?_[_0x1523('0x1a')](_0x28ee96[_0x1523('0x1b')],function(_0x61b9ba){return{'model':db[_0x61b9ba[_0x1523('0x1c')]],'as':_0x61b9ba['as'],'attributes':_0x61b9ba['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x455afa){logger['info']('GetZendeskAccount',_0x5432f1);logger[_0x1523('0x1d')](_0x1523('0x13'),_0x5432f1,JSON['stringify'](_0x455afa));_0x31a5d1(_0x455afa);})['catch'](function(_0xecf83a){logger['error'](_0x1523('0x13'),_0xecf83a[_0x1523('0x11')],_0x5432f1);_0x2d14b7(_0x4b48a0[_0x1523('0xf')](0x1f4,_0xecf83a[_0x1523('0x11')]));});});};exports[_0x1523('0x1e')]=function(_0x3b25d4){var _0x423782=this;return new Promise(function(_0x4f6405,_0x239186){return db[_0x1523('0x1f')][_0x1523('0x20')]({'raw':_0x3b25d4[_0x1523('0x15')]?_0x3b25d4[_0x1523('0x15')][_0x1523('0x16')]===undefined?!![]:![]:!![],'where':_0x3b25d4[_0x1523('0x15')]?_0x3b25d4['options'][_0x1523('0x17')]||null:null,'attributes':_0x3b25d4[_0x1523('0x15')]?_0x3b25d4[_0x1523('0x15')][_0x1523('0x18')]||null:null,'include':_0x3b25d4[_0x1523('0x15')]?_0x3b25d4['options'][_0x1523('0x1b')]?_[_0x1523('0x1a')](_0x3b25d4['options'][_0x1523('0x1b')],function(_0x5d07d1){return{'model':db[_0x5d07d1[_0x1523('0x1c')]],'as':_0x5d07d1['as'],'attributes':_0x5d07d1['attributes'],'include':_0x5d07d1[_0x1523('0x1b')]?_[_0x1523('0x1a')](_0x5d07d1[_0x1523('0x1b')],function(_0x1eb00b){return{'model':db[_0x1eb00b[_0x1523('0x1c')]],'as':_0x1eb00b['as'],'attributes':_0x1eb00b[_0x1523('0x18')],'include':_0x1eb00b[_0x1523('0x1b')]?_[_0x1523('0x1a')](_0x1eb00b[_0x1523('0x1b')],function(_0x4ce09e){return{'model':db[_0x4ce09e[_0x1523('0x1c')]],'as':_0x4ce09e['as'],'attributes':_0x4ce09e[_0x1523('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1523('0xa')](function(_0x4e8967){logger[_0x1523('0xb')]('ShowZendeskAccount',_0x3b25d4);logger[_0x1523('0x1d')](_0x1523('0x1e'),_0x3b25d4,JSON[_0x1523('0xe')](_0x4e8967));_0x4f6405(_0x4e8967);})[_0x1523('0x12')](function(_0x47ba3e){logger[_0x1523('0xf')](_0x1523('0x1e'),_0x47ba3e[_0x1523('0x11')],_0x3b25d4);_0x239186(_0x423782[_0x1523('0xf')](0x1f4,_0x47ba3e[_0x1523('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2b87108..053a246 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(_0x150345,_0x3900ce){var _0x542721=function(_0xb8e2a9){while(--_0xb8e2a9){_0x150345['push'](_0x150345['shift']());}};_0x542721(++_0x3900ce);}(_0x750a,0x140));var _0xa750=function(_0x3547f5,_0x594b3c){_0x3547f5=_0x3547f5-0x0;var _0x24107c=_0x750a[_0x3547f5];return _0x24107c;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x4cbe17,_0x300320){var _0x3070ef=function(_0xce193c){while(--_0xce193c){_0x4cbe17['push'](_0x4cbe17['shift']());}};_0x3070ef(++_0x300320);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 96f2ee9..16021c0 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 _0xbc23=['STRING','sequelize','exports'];(function(_0x39ae3f,_0x221a90){var _0x1a320a=function(_0x22b3d3){while(--_0x22b3d3){_0x39ae3f['push'](_0x39ae3f['shift']());}};_0x1a320a(++_0x221a90);}(_0xbc23,0xeb));var _0x3bc2=function(_0x5764ce,_0xeebd){_0x5764ce=_0x5764ce-0x0;var _0x396561=_0xbc23[_0x5764ce];return _0x396561;};'use strict';var Sequelize=require(_0x3bc2('0x0'));module[_0x3bc2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3bc2('0x2')]}}; \ No newline at end of file +var _0x4ee0=['STRING','exports'];(function(_0x57a81a,_0x30bf7e){var _0x89b1bb=function(_0x47c2d5){while(--_0x47c2d5){_0x57a81a['push'](_0x57a81a['shift']());}};_0x89b1bb(++_0x30bf7e);}(_0x4ee0,0xcf));var _0x04ee=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4ee0[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module[_0x04ee('0x0')]={'name':{'type':Sequelize[_0x04ee('0x1')]},'description':{'type':Sequelize[_0x04ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 6b781de..06fd730 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 _0x3ca5=['keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ZendeskConfiguration','includeAll','include','findAll','catch','params','find','create','body','findOne','ZendeskField','hasOwnProperty','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query'];(function(_0x123ac9,_0x280c3a){var _0x3cc049=function(_0x3ca601){while(--_0x3ca601){_0x123ac9['push'](_0x123ac9['shift']());}};_0x3cc049(++_0x280c3a);}(_0x3ca5,0x127));var _0x53ca=function(_0x1ae06f,_0x5c74dd){_0x1ae06f=_0x1ae06f-0x0;var _0x4adf01=_0x3ca5[_0x1ae06f];return _0x4adf01;};'use strict';var emlformat=require(_0x53ca('0x0'));var rimraf=require(_0x53ca('0x1'));var zipdir=require(_0x53ca('0x2'));var jsonpatch=require(_0x53ca('0x3'));var rp=require('request-promise');var moment=require(_0x53ca('0x4'));var BPromise=require(_0x53ca('0x5'));var Mustache=require(_0x53ca('0x6'));var util=require(_0x53ca('0x7'));var path=require(_0x53ca('0x8'));var sox=require(_0x53ca('0x9'));var csv=require('to-csv');var ejs=require(_0x53ca('0xa'));var fs=require('fs');var fs_extra=require(_0x53ca('0xb'));var _=require(_0x53ca('0xc'));var squel=require(_0x53ca('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53ca('0xe'));var toCsv=require('to-csv');var querystring=require(_0x53ca('0xf'));var Papa=require(_0x53ca('0x10'));var Redis=require('ioredis');var authService=require(_0x53ca('0x11'));var qs=require(_0x53ca('0x12'));var as=require(_0x53ca('0x13'));var hardwareService=require(_0x53ca('0x14'));var logger=require(_0x53ca('0x15'))(_0x53ca('0x16'));var utils=require(_0x53ca('0x17'));var config=require(_0x53ca('0x18'));var licenseUtil=require(_0x53ca('0x19'));var db=require(_0x53ca('0x1a'))['db'];function respondWithStatusCode(_0x68d9fd,_0xf413ca){_0xf413ca=_0xf413ca||0xcc;return function(_0x46dd0b){if(_0x46dd0b){return _0x68d9fd[_0x53ca('0x1b')](_0xf413ca);}return _0x68d9fd['status'](_0xf413ca)[_0x53ca('0x1c')]();};}function respondWithResult(_0x572728,_0x35aaed){_0x35aaed=_0x35aaed||0xc8;return function(_0x1dba72){if(_0x1dba72){return _0x572728[_0x53ca('0x1d')](_0x35aaed)['json'](_0x1dba72);}};}function respondWithFilteredResult(_0x2e1688,_0x469836){return function(_0x4bb63d){if(_0x4bb63d){var _0x2d7377=typeof _0x469836[_0x53ca('0x1e')]===_0x53ca('0x1f')&&typeof _0x469836[_0x53ca('0x20')]===_0x53ca('0x1f');var _0x3ca2a0=_0x4bb63d[_0x53ca('0x21')];var _0x10f3ce=_0x2d7377?0x0:_0x469836[_0x53ca('0x1e')];var _0x35127d=_0x2d7377?_0x4bb63d[_0x53ca('0x21')]:_0x469836['offset']+_0x469836[_0x53ca('0x20')];var _0x4178df;if(_0x35127d>=_0x3ca2a0){_0x35127d=_0x3ca2a0;_0x4178df=0xc8;}else{_0x4178df=0xce;}_0x2e1688['status'](_0x4178df);return _0x2e1688[_0x53ca('0x22')](_0x53ca('0x23'),_0x10f3ce+'-'+_0x35127d+'/'+_0x3ca2a0)[_0x53ca('0x24')](_0x4bb63d);}return null;};}function patchUpdates(_0x269e79){return function(_0x296543){try{jsonpatch[_0x53ca('0x25')](_0x296543,_0x269e79,!![]);}catch(_0x30a979){return BPromise[_0x53ca('0x26')](_0x30a979);}return _0x296543[_0x53ca('0x27')]();};}function saveUpdates(_0x2e9408,_0x4051be){return function(_0x41b657){if(_0x41b657){return _0x41b657[_0x53ca('0x28')](_0x2e9408)[_0x53ca('0x29')](function(_0x5457f3){return _0x5457f3;});}return null;};}function removeEntity(_0x523a29,_0x4a2012){return function(_0x4be650){if(_0x4be650){return _0x4be650[_0x53ca('0x2a')]()[_0x53ca('0x29')](function(){_0x523a29[_0x53ca('0x1d')](0xcc)[_0x53ca('0x1c')]();});}};}function handleEntityNotFound(_0x358fa4,_0x112086){return function(_0x5de0b3){if(!_0x5de0b3){_0x358fa4['sendStatus'](0x194);}return _0x5de0b3;};}function handleError(_0x331a15,_0x4ed261){_0x4ed261=_0x4ed261||0x1f4;return function(_0xaee574){logger[_0x53ca('0x2b')](_0xaee574['stack']);if(_0xaee574['name']){delete _0xaee574[_0x53ca('0x2c')];}_0x331a15[_0x53ca('0x1d')](_0x4ed261)[_0x53ca('0x2d')](_0xaee574);};}exports[_0x53ca('0x2e')]=function(_0x1baffd,_0x442cf4){var _0x13f5c4={},_0x5dca88={},_0x2e1592={'count':0x0,'rows':[]};var _0x39106c=_[_0x53ca('0x2f')](db['ZendeskConfiguration'][_0x53ca('0x30')],function(_0x4f444c){return{'name':_0x4f444c['fieldName'],'type':_0x4f444c[_0x53ca('0x31')][_0x53ca('0x32')]};});_0x5dca88[_0x53ca('0x33')]=_['map'](_0x39106c,_0x53ca('0x2c'));_0x5dca88[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x1baffd[_0x53ca('0x34')]);_0x5dca88['filters']=_[_0x53ca('0x36')](_0x5dca88[_0x53ca('0x33')],_0x5dca88[_0x53ca('0x34')]);_0x13f5c4[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x5dca88[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x1baffd[_0x53ca('0x34')]['fields']));_0x13f5c4[_0x53ca('0x37')]=_0x13f5c4['attributes'][_0x53ca('0x39')]?_0x13f5c4[_0x53ca('0x37')]:_0x5dca88[_0x53ca('0x33')];if(!_0x1baffd[_0x53ca('0x34')]['hasOwnProperty'](_0x53ca('0x3a'))){_0x13f5c4[_0x53ca('0x20')]=qs[_0x53ca('0x20')](_0x1baffd[_0x53ca('0x34')]['limit']);_0x13f5c4[_0x53ca('0x1e')]=qs['offset'](_0x1baffd[_0x53ca('0x34')][_0x53ca('0x1e')]);}_0x13f5c4[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0x1baffd[_0x53ca('0x34')]['sort']);_0x13f5c4[_0x53ca('0x3d')]=qs[_0x53ca('0x3e')](_[_0x53ca('0x3f')](_0x1baffd[_0x53ca('0x34')],_0x5dca88[_0x53ca('0x3e')]),_0x39106c);if(_0x1baffd[_0x53ca('0x34')][_0x53ca('0x40')]){_0x13f5c4['where']=_['merge'](_0x13f5c4[_0x53ca('0x3d')],{'$or':_['map'](_0x39106c,function(_0x4552da){if(_0x4552da['type']!==_0x53ca('0x41')){var _0x5cddd8={};_0x5cddd8[_0x4552da[_0x53ca('0x2c')]]={'$like':'%'+_0x1baffd[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x5cddd8;}})});}_0x13f5c4=_[_0x53ca('0x42')]({},_0x13f5c4,_0x1baffd[_0x53ca('0x43')]);var _0x4010ef={'where':_0x13f5c4['where']};return db[_0x53ca('0x44')]['count'](_0x4010ef)['then'](function(_0x54e5af){_0x2e1592[_0x53ca('0x21')]=_0x54e5af;if(_0x1baffd[_0x53ca('0x34')][_0x53ca('0x45')]){_0x13f5c4[_0x53ca('0x46')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x53ca('0x47')](_0x13f5c4);})[_0x53ca('0x29')](function(_0x4c1e05){_0x2e1592['rows']=_0x4c1e05;return _0x2e1592;})[_0x53ca('0x29')](respondWithFilteredResult(_0x442cf4,_0x13f5c4))[_0x53ca('0x48')](handleError(_0x442cf4,null));};exports['show']=function(_0x24d945,_0x3f2469){var _0x5644a2={'raw':![],'where':{'id':_0x24d945[_0x53ca('0x49')]['id']}},_0x572af9={};_0x572af9[_0x53ca('0x33')]=_[_0x53ca('0x35')](db['ZendeskConfiguration'][_0x53ca('0x30')]);_0x572af9[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x24d945[_0x53ca('0x34')]);_0x572af9[_0x53ca('0x3e')]=_[_0x53ca('0x36')](_0x572af9[_0x53ca('0x33')],_0x572af9['query']);_0x5644a2['attributes']=_['intersection'](_0x572af9[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x24d945[_0x53ca('0x34')][_0x53ca('0x38')]));_0x5644a2[_0x53ca('0x37')]=_0x5644a2[_0x53ca('0x37')][_0x53ca('0x39')]?_0x5644a2['attributes']:_0x572af9[_0x53ca('0x33')];if(_0x24d945[_0x53ca('0x34')]['includeAll']){_0x5644a2['include']=[{'all':!![]}];}_0x5644a2=_[_0x53ca('0x42')]({},_0x5644a2,_0x24d945[_0x53ca('0x43')]);return db['ZendeskConfiguration'][_0x53ca('0x4a')](_0x5644a2)['then'](handleEntityNotFound(_0x3f2469,null))[_0x53ca('0x29')](respondWithResult(_0x3f2469,null))[_0x53ca('0x48')](handleError(_0x3f2469,null));};exports[_0x53ca('0x4b')]=function(_0xb1941e,_0x52c195){return db['ZendeskConfiguration'][_0x53ca('0x4b')](_0xb1941e['body'],{})['then'](respondWithResult(_0x52c195,0xc9))['catch'](handleError(_0x52c195,null));};exports[_0x53ca('0x28')]=function(_0x203741,_0x255099){if(_0x203741[_0x53ca('0x4c')]['id']){delete _0x203741[_0x53ca('0x4c')]['id'];}return db[_0x53ca('0x44')][_0x53ca('0x4a')]({'where':{'id':_0x203741[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x255099,null))['then'](saveUpdates(_0x203741[_0x53ca('0x4c')],null))['then'](respondWithResult(_0x255099,null))[_0x53ca('0x48')](handleError(_0x255099,null));};exports[_0x53ca('0x2a')]=function(_0x17c35a,_0x4151ab){return db[_0x53ca('0x44')][_0x53ca('0x4a')]({'where':{'id':_0x17c35a['params']['id']}})['then'](handleEntityNotFound(_0x4151ab,null))[_0x53ca('0x29')](removeEntity(_0x4151ab,null))['catch'](handleError(_0x4151ab,null));};exports['getFields']=function(_0x11207d,_0x444dc5,_0x5230cb){var _0x53b1a4={};var _0x29026a={};var _0x38a132;var _0x29aa48;return db['ZendeskConfiguration'][_0x53ca('0x4d')]({'where':{'id':_0x11207d[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x444dc5,null))['then'](function(_0x5a4b0b){if(_0x5a4b0b){_0x38a132=_0x5a4b0b;_0x29026a[_0x53ca('0x33')]=_[_0x53ca('0x35')](db[_0x53ca('0x4e')][_0x53ca('0x30')]);_0x29026a[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x11207d[_0x53ca('0x34')]);_0x29026a[_0x53ca('0x3e')]=_['intersection'](_0x29026a[_0x53ca('0x33')],_0x29026a[_0x53ca('0x34')]);_0x53b1a4[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x29026a[_0x53ca('0x33')],qs['fields'](_0x11207d['query'][_0x53ca('0x38')]));_0x53b1a4[_0x53ca('0x37')]=_0x53b1a4['attributes'][_0x53ca('0x39')]?_0x53b1a4[_0x53ca('0x37')]:_0x29026a[_0x53ca('0x33')];_0x53b1a4[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0x11207d['query'][_0x53ca('0x3c')]);_0x53b1a4['where']=qs['filters'](_['pick'](_0x11207d[_0x53ca('0x34')],_0x29026a[_0x53ca('0x3e')]));if(_0x11207d['query'][_0x53ca('0x40')]){_0x53b1a4[_0x53ca('0x3d')]=_[_0x53ca('0x42')](_0x53b1a4[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x53b1a4[_0x53ca('0x37')],function(_0x437c23){var _0x5853c1={};_0x5853c1[_0x437c23]={'$like':'%'+_0x11207d[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x5853c1;})});}_0x53b1a4=_[_0x53ca('0x42')]({},_0x53b1a4,_0x11207d[_0x53ca('0x43')]);return _0x38a132['getFields'](_0x53b1a4);}})['then'](function(_0x162bf6){if(_0x162bf6){_0x29aa48=_0x162bf6[_0x53ca('0x39')];if(!_0x11207d['query'][_0x53ca('0x4f')]('nolimit')){_0x53b1a4[_0x53ca('0x20')]=qs['limit'](_0x11207d['query'][_0x53ca('0x20')]);_0x53b1a4[_0x53ca('0x1e')]=qs[_0x53ca('0x1e')](_0x11207d['query'][_0x53ca('0x1e')]);}return _0x38a132[_0x53ca('0x50')](_0x53b1a4);}})[_0x53ca('0x29')](function(_0x1cf981){if(_0x1cf981){return _0x1cf981?{'count':_0x29aa48,'rows':_0x1cf981}:null;}})[_0x53ca('0x29')](respondWithResult(_0x444dc5,null))['catch'](handleError(_0x444dc5,null));};exports['getSubjects']=function(_0xa763da,_0x360fc1,_0x4043ee){var _0x15a3ce={};var _0x1055f1={};var _0x45457d;var _0x3b9893;return db[_0x53ca('0x44')]['findOne']({'where':{'id':_0xa763da['params']['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x360fc1,null))[_0x53ca('0x29')](function(_0x2adb26){if(_0x2adb26){_0x45457d=_0x2adb26;_0x1055f1['model']=_[_0x53ca('0x35')](db['ZendeskField'][_0x53ca('0x30')]);_0x1055f1[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0xa763da[_0x53ca('0x34')]);_0x1055f1['filters']=_[_0x53ca('0x36')](_0x1055f1[_0x53ca('0x33')],_0x1055f1[_0x53ca('0x34')]);_0x15a3ce[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x1055f1[_0x53ca('0x33')],qs['fields'](_0xa763da[_0x53ca('0x34')][_0x53ca('0x38')]));_0x15a3ce['attributes']=_0x15a3ce['attributes'][_0x53ca('0x39')]?_0x15a3ce['attributes']:_0x1055f1[_0x53ca('0x33')];_0x15a3ce[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0xa763da['query'][_0x53ca('0x3c')]);_0x15a3ce['where']=qs[_0x53ca('0x3e')](_['pick'](_0xa763da[_0x53ca('0x34')],_0x1055f1['filters']));if(_0xa763da[_0x53ca('0x34')][_0x53ca('0x40')]){_0x15a3ce[_0x53ca('0x3d')]=_[_0x53ca('0x42')](_0x15a3ce[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x15a3ce['attributes'],function(_0x31b900){var _0x2e36ea={};_0x2e36ea[_0x31b900]={'$like':'%'+_0xa763da[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x2e36ea;})});}_0x15a3ce=_[_0x53ca('0x42')]({},_0x15a3ce,_0xa763da[_0x53ca('0x43')]);return _0x45457d[_0x53ca('0x51')](_0x15a3ce);}})['then'](function(_0x37083e){if(_0x37083e){_0x3b9893=_0x37083e[_0x53ca('0x39')];if(!_0xa763da['query'][_0x53ca('0x4f')](_0x53ca('0x3a'))){_0x15a3ce[_0x53ca('0x20')]=qs[_0x53ca('0x20')](_0xa763da['query'][_0x53ca('0x20')]);_0x15a3ce[_0x53ca('0x1e')]=qs['offset'](_0xa763da[_0x53ca('0x34')][_0x53ca('0x1e')]);}return _0x45457d[_0x53ca('0x51')](_0x15a3ce);}})[_0x53ca('0x29')](function(_0x18ab62){if(_0x18ab62){return _0x18ab62?{'count':_0x3b9893,'rows':_0x18ab62}:null;}})['then'](respondWithResult(_0x360fc1,null))[_0x53ca('0x48')](handleError(_0x360fc1,null));};exports['getDescriptions']=function(_0x259965,_0x7121fa,_0x4d9304){var _0x2a0a0f={};var _0x7faca8={};var _0x3270cc;var _0x137bde;return db[_0x53ca('0x44')][_0x53ca('0x4d')]({'where':{'id':_0x259965['params']['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x7121fa,null))[_0x53ca('0x29')](function(_0x178fa3){if(_0x178fa3){_0x3270cc=_0x178fa3;_0x7faca8['model']=_[_0x53ca('0x35')](db[_0x53ca('0x4e')][_0x53ca('0x30')]);_0x7faca8['query']=_[_0x53ca('0x35')](_0x259965[_0x53ca('0x34')]);_0x7faca8[_0x53ca('0x3e')]=_[_0x53ca('0x36')](_0x7faca8[_0x53ca('0x33')],_0x7faca8['query']);_0x2a0a0f[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x7faca8[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x259965[_0x53ca('0x34')][_0x53ca('0x38')]));_0x2a0a0f[_0x53ca('0x37')]=_0x2a0a0f['attributes']['length']?_0x2a0a0f[_0x53ca('0x37')]:_0x7faca8[_0x53ca('0x33')];_0x2a0a0f[_0x53ca('0x3b')]=qs[_0x53ca('0x3c')](_0x259965['query']['sort']);_0x2a0a0f['where']=qs[_0x53ca('0x3e')](_[_0x53ca('0x3f')](_0x259965[_0x53ca('0x34')],_0x7faca8[_0x53ca('0x3e')]));if(_0x259965[_0x53ca('0x34')][_0x53ca('0x40')]){_0x2a0a0f[_0x53ca('0x3d')]=_['merge'](_0x2a0a0f[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x2a0a0f[_0x53ca('0x37')],function(_0x4eb6a3){var _0x1def46={};_0x1def46[_0x4eb6a3]={'$like':'%'+_0x259965[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x1def46;})});}_0x2a0a0f=_['merge']({},_0x2a0a0f,_0x259965[_0x53ca('0x43')]);return _0x3270cc[_0x53ca('0x52')](_0x2a0a0f);}})[_0x53ca('0x29')](function(_0x2c5da8){if(_0x2c5da8){_0x137bde=_0x2c5da8[_0x53ca('0x39')];if(!_0x259965['query'][_0x53ca('0x4f')]('nolimit')){_0x2a0a0f['limit']=qs[_0x53ca('0x20')](_0x259965[_0x53ca('0x34')]['limit']);_0x2a0a0f['offset']=qs[_0x53ca('0x1e')](_0x259965['query']['offset']);}return _0x3270cc[_0x53ca('0x52')](_0x2a0a0f);}})[_0x53ca('0x29')](function(_0x562285){if(_0x562285){return _0x562285?{'count':_0x137bde,'rows':_0x562285}:null;}})[_0x53ca('0x29')](respondWithResult(_0x7121fa,null))[_0x53ca('0x48')](handleError(_0x7121fa,null));};exports[_0x53ca('0x53')]=function(_0x29edae,_0xaad553,_0x28945a){var _0x4a1506={};var _0x3ea37e={};var _0x24bfdb;var _0x2a1e3b;return db[_0x53ca('0x44')][_0x53ca('0x4d')]({'where':{'id':_0x29edae[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0xaad553,null))['then'](function(_0x529ae5){if(_0x529ae5){_0x24bfdb=_0x529ae5;_0x3ea37e[_0x53ca('0x33')]=_[_0x53ca('0x35')](db[_0x53ca('0x54')][_0x53ca('0x30')]);_0x3ea37e[_0x53ca('0x34')]=_[_0x53ca('0x35')](_0x29edae[_0x53ca('0x34')]);_0x3ea37e[_0x53ca('0x3e')]=_[_0x53ca('0x36')](_0x3ea37e['model'],_0x3ea37e[_0x53ca('0x34')]);_0x4a1506[_0x53ca('0x37')]=_[_0x53ca('0x36')](_0x3ea37e[_0x53ca('0x33')],qs[_0x53ca('0x38')](_0x29edae[_0x53ca('0x34')][_0x53ca('0x38')]));_0x4a1506['attributes']=_0x4a1506['attributes']['length']?_0x4a1506[_0x53ca('0x37')]:_0x3ea37e[_0x53ca('0x33')];_0x4a1506[_0x53ca('0x3b')]=qs['sort'](_0x29edae['query'][_0x53ca('0x3c')]);_0x4a1506['where']=qs[_0x53ca('0x3e')](_[_0x53ca('0x3f')](_0x29edae[_0x53ca('0x34')],_0x3ea37e['filters']));if(_0x29edae[_0x53ca('0x34')][_0x53ca('0x40')]){_0x4a1506['where']=_[_0x53ca('0x42')](_0x4a1506[_0x53ca('0x3d')],{'$or':_[_0x53ca('0x2f')](_0x4a1506[_0x53ca('0x37')],function(_0x16c0da){var _0x1d631f={};_0x1d631f[_0x16c0da]={'$like':'%'+_0x29edae[_0x53ca('0x34')][_0x53ca('0x40')]+'%'};return _0x1d631f;})});}_0x4a1506=_[_0x53ca('0x42')]({},_0x4a1506,_0x29edae['options']);return _0x24bfdb[_0x53ca('0x53')](_0x4a1506);}})[_0x53ca('0x29')](function(_0x2c5eee){if(_0x2c5eee){_0x2a1e3b=_0x2c5eee['length'];if(!_0x29edae[_0x53ca('0x34')][_0x53ca('0x4f')](_0x53ca('0x3a'))){_0x4a1506[_0x53ca('0x20')]=qs[_0x53ca('0x20')](_0x29edae[_0x53ca('0x34')][_0x53ca('0x20')]);_0x4a1506[_0x53ca('0x1e')]=qs[_0x53ca('0x1e')](_0x29edae[_0x53ca('0x34')][_0x53ca('0x1e')]);}return _0x24bfdb[_0x53ca('0x53')](_0x4a1506);}})[_0x53ca('0x29')](function(_0x35c706){if(_0x35c706){return _0x35c706?{'count':_0x2a1e3b,'rows':_0x35c706}:null;}})[_0x53ca('0x29')](respondWithResult(_0xaad553,null))[_0x53ca('0x48')](handleError(_0xaad553,null));};exports['setTags']=function(_0x83d968,_0x32d90a,_0x52fae3){if(_0x83d968['body']['id']){delete _0x83d968[_0x53ca('0x4c')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x83d968[_0x53ca('0x49')]['id']}})[_0x53ca('0x29')](handleEntityNotFound(_0x32d90a,null))[_0x53ca('0x29')](function(_0x5f3d77){if(_0x5f3d77){return _0x5f3d77[_0x53ca('0x55')](_0x83d968[_0x53ca('0x4c')][_0x53ca('0x56')]||[]);}return null;})[_0x53ca('0x29')](respondWithResult(_0x32d90a,null))[_0x53ca('0x48')](handleError(_0x32d90a,null));}; \ No newline at end of file +var _0x4754=['ZendeskField','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','findOne'];(function(_0x1aac89,_0xd5c191){var _0x1d007a=function(_0x2b8b0c){while(--_0x2b8b0c){_0x1aac89['push'](_0x1aac89['shift']());}};_0x1d007a(++_0xd5c191);}(_0x4754,0xb1));var _0x4475=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4754[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4475('0x0'));var rimraf=require(_0x4475('0x1'));var zipdir=require(_0x4475('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4475('0x3'));var BPromise=require(_0x4475('0x4'));var Mustache=require(_0x4475('0x5'));var util=require(_0x4475('0x6'));var path=require(_0x4475('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4475('0x8'));var fs=require('fs');var fs_extra=require(_0x4475('0x9'));var _=require(_0x4475('0xa'));var squel=require(_0x4475('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4475('0xc'));var querystring=require(_0x4475('0xd'));var Papa=require('papaparse');var Redis=require(_0x4475('0xe'));var authService=require(_0x4475('0xf'));var qs=require(_0x4475('0x10'));var as=require(_0x4475('0x11'));var hardwareService=require(_0x4475('0x12'));var logger=require(_0x4475('0x13'))(_0x4475('0x14'));var utils=require(_0x4475('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4475('0x16'))['db'];function respondWithStatusCode(_0x57cb15,_0x17fc4d){_0x17fc4d=_0x17fc4d||0xcc;return function(_0x45d9a9){if(_0x45d9a9){return _0x57cb15[_0x4475('0x17')](_0x17fc4d);}return _0x57cb15[_0x4475('0x18')](_0x17fc4d)[_0x4475('0x19')]();};}function respondWithResult(_0x90e78a,_0x882508){_0x882508=_0x882508||0xc8;return function(_0x2f0ff0){if(_0x2f0ff0){return _0x90e78a[_0x4475('0x18')](_0x882508)[_0x4475('0x1a')](_0x2f0ff0);}};}function respondWithFilteredResult(_0x50c703,_0x28bdc8){return function(_0x54cecb){if(_0x54cecb){var _0x2e9927=typeof _0x28bdc8[_0x4475('0x1b')]===_0x4475('0x1c')&&typeof _0x28bdc8[_0x4475('0x1d')]===_0x4475('0x1c');var _0xe8e7cf=_0x54cecb[_0x4475('0x1e')];var _0x4ce764=_0x2e9927?0x0:_0x28bdc8[_0x4475('0x1b')];var _0x51a50a=_0x2e9927?_0x54cecb[_0x4475('0x1e')]:_0x28bdc8[_0x4475('0x1b')]+_0x28bdc8[_0x4475('0x1d')];var _0x8d56ed;if(_0x51a50a>=_0xe8e7cf){_0x51a50a=_0xe8e7cf;_0x8d56ed=0xc8;}else{_0x8d56ed=0xce;}_0x50c703[_0x4475('0x18')](_0x8d56ed);return _0x50c703[_0x4475('0x1f')](_0x4475('0x20'),_0x4ce764+'-'+_0x51a50a+'/'+_0xe8e7cf)[_0x4475('0x1a')](_0x54cecb);}return null;};}function patchUpdates(_0x1b143c){return function(_0x55c285){try{jsonpatch[_0x4475('0x21')](_0x55c285,_0x1b143c,!![]);}catch(_0x196733){return BPromise[_0x4475('0x22')](_0x196733);}return _0x55c285[_0x4475('0x23')]();};}function saveUpdates(_0x2ebe81,_0x2f8063){return function(_0x25eebb){if(_0x25eebb){return _0x25eebb[_0x4475('0x24')](_0x2ebe81)[_0x4475('0x25')](function(_0x5b3e87){return _0x5b3e87;});}return null;};}function removeEntity(_0x1649eb,_0x2cd3b2){return function(_0x42aae2){if(_0x42aae2){return _0x42aae2[_0x4475('0x26')]()[_0x4475('0x25')](function(){_0x1649eb[_0x4475('0x18')](0xcc)[_0x4475('0x19')]();});}};}function handleEntityNotFound(_0x92149e,_0x1f16b6){return function(_0x796f79){if(!_0x796f79){_0x92149e[_0x4475('0x17')](0x194);}return _0x796f79;};}function handleError(_0x22f071,_0x21c837){_0x21c837=_0x21c837||0x1f4;return function(_0x5be670){logger[_0x4475('0x27')](_0x5be670['stack']);if(_0x5be670[_0x4475('0x28')]){delete _0x5be670[_0x4475('0x28')];}_0x22f071[_0x4475('0x18')](_0x21c837)[_0x4475('0x29')](_0x5be670);};}exports[_0x4475('0x2a')]=function(_0x345e92,_0x5c322f){var _0x4a76a6={},_0x16b095={},_0x3dd341={'count':0x0,'rows':[]};var _0x197bc8=_[_0x4475('0x2b')](db[_0x4475('0x2c')][_0x4475('0x2d')],function(_0x3a8445){return{'name':_0x3a8445[_0x4475('0x2e')],'type':_0x3a8445['type']['key']};});_0x16b095[_0x4475('0x2f')]=_[_0x4475('0x2b')](_0x197bc8,_0x4475('0x28'));_0x16b095['query']=_['keys'](_0x345e92[_0x4475('0x30')]);_0x16b095[_0x4475('0x31')]=_[_0x4475('0x32')](_0x16b095['model'],_0x16b095[_0x4475('0x30')]);_0x4a76a6['attributes']=_[_0x4475('0x32')](_0x16b095['model'],qs['fields'](_0x345e92[_0x4475('0x30')][_0x4475('0x33')]));_0x4a76a6[_0x4475('0x34')]=_0x4a76a6[_0x4475('0x34')]['length']?_0x4a76a6[_0x4475('0x34')]:_0x16b095[_0x4475('0x2f')];if(!_0x345e92[_0x4475('0x30')][_0x4475('0x35')](_0x4475('0x36'))){_0x4a76a6['limit']=qs['limit'](_0x345e92['query'][_0x4475('0x1d')]);_0x4a76a6[_0x4475('0x1b')]=qs['offset'](_0x345e92[_0x4475('0x30')][_0x4475('0x1b')]);}_0x4a76a6['order']=qs['sort'](_0x345e92[_0x4475('0x30')][_0x4475('0x37')]);_0x4a76a6['where']=qs[_0x4475('0x31')](_[_0x4475('0x38')](_0x345e92[_0x4475('0x30')],_0x16b095['filters']),_0x197bc8);if(_0x345e92[_0x4475('0x30')][_0x4475('0x39')]){_0x4a76a6[_0x4475('0x3a')]=_[_0x4475('0x3b')](_0x4a76a6[_0x4475('0x3a')],{'$or':_[_0x4475('0x2b')](_0x197bc8,function(_0x43a027){if(_0x43a027['type']!==_0x4475('0x3c')){var _0x83fefc={};_0x83fefc[_0x43a027[_0x4475('0x28')]]={'$like':'%'+_0x345e92[_0x4475('0x30')][_0x4475('0x39')]+'%'};return _0x83fefc;}})});}_0x4a76a6=_['merge']({},_0x4a76a6,_0x345e92[_0x4475('0x3d')]);var _0x3aa920={'where':_0x4a76a6[_0x4475('0x3a')]};return db[_0x4475('0x2c')]['count'](_0x3aa920)[_0x4475('0x25')](function(_0x26eaeb){_0x3dd341[_0x4475('0x1e')]=_0x26eaeb;if(_0x345e92[_0x4475('0x30')][_0x4475('0x3e')]){_0x4a76a6[_0x4475('0x3f')]=[{'all':!![]}];}return db[_0x4475('0x2c')][_0x4475('0x40')](_0x4a76a6);})['then'](function(_0x33f2b6){_0x3dd341[_0x4475('0x41')]=_0x33f2b6;return _0x3dd341;})['then'](respondWithFilteredResult(_0x5c322f,_0x4a76a6))['catch'](handleError(_0x5c322f,null));};exports[_0x4475('0x42')]=function(_0x34801f,_0x22fafc){var _0xb726f7={'raw':![],'where':{'id':_0x34801f[_0x4475('0x43')]['id']}},_0x14edad={};_0x14edad[_0x4475('0x2f')]=_['keys'](db[_0x4475('0x2c')][_0x4475('0x2d')]);_0x14edad['query']=_[_0x4475('0x44')](_0x34801f[_0x4475('0x30')]);_0x14edad[_0x4475('0x31')]=_[_0x4475('0x32')](_0x14edad[_0x4475('0x2f')],_0x14edad['query']);_0xb726f7[_0x4475('0x34')]=_[_0x4475('0x32')](_0x14edad[_0x4475('0x2f')],qs[_0x4475('0x33')](_0x34801f[_0x4475('0x30')][_0x4475('0x33')]));_0xb726f7[_0x4475('0x34')]=_0xb726f7['attributes'][_0x4475('0x45')]?_0xb726f7[_0x4475('0x34')]:_0x14edad[_0x4475('0x2f')];if(_0x34801f['query']['includeAll']){_0xb726f7[_0x4475('0x3f')]=[{'all':!![]}];}_0xb726f7=_['merge']({},_0xb726f7,_0x34801f[_0x4475('0x3d')]);return db[_0x4475('0x2c')][_0x4475('0x46')](_0xb726f7)[_0x4475('0x25')](handleEntityNotFound(_0x22fafc,null))[_0x4475('0x25')](respondWithResult(_0x22fafc,null))[_0x4475('0x47')](handleError(_0x22fafc,null));};exports[_0x4475('0x48')]=function(_0x275e5e,_0x6cdf5c){return db[_0x4475('0x2c')][_0x4475('0x48')](_0x275e5e[_0x4475('0x49')],{})['then'](respondWithResult(_0x6cdf5c,0xc9))[_0x4475('0x47')](handleError(_0x6cdf5c,null));};exports[_0x4475('0x24')]=function(_0x1cad11,_0x3d985a){if(_0x1cad11['body']['id']){delete _0x1cad11['body']['id'];}return db[_0x4475('0x2c')][_0x4475('0x46')]({'where':{'id':_0x1cad11[_0x4475('0x43')]['id']}})['then'](handleEntityNotFound(_0x3d985a,null))['then'](saveUpdates(_0x1cad11[_0x4475('0x49')],null))[_0x4475('0x25')](respondWithResult(_0x3d985a,null))['catch'](handleError(_0x3d985a,null));};exports[_0x4475('0x26')]=function(_0x4093da,_0x2de296){return db[_0x4475('0x2c')][_0x4475('0x46')]({'where':{'id':_0x4093da[_0x4475('0x43')]['id']}})['then'](handleEntityNotFound(_0x2de296,null))[_0x4475('0x25')](removeEntity(_0x2de296,null))[_0x4475('0x47')](handleError(_0x2de296,null));};exports['getFields']=function(_0x4378a9,_0x32e977,_0x50e4b7){var _0x4e30d2={};var _0x258cfc={};var _0xfca013;var _0x19cc29;return db[_0x4475('0x2c')][_0x4475('0x4a')]({'where':{'id':_0x4378a9[_0x4475('0x43')]['id']}})['then'](handleEntityNotFound(_0x32e977,null))['then'](function(_0xc8e387){if(_0xc8e387){_0xfca013=_0xc8e387;_0x258cfc['model']=_['keys'](db[_0x4475('0x4b')][_0x4475('0x2d')]);_0x258cfc['query']=_['keys'](_0x4378a9[_0x4475('0x30')]);_0x258cfc['filters']=_[_0x4475('0x32')](_0x258cfc[_0x4475('0x2f')],_0x258cfc[_0x4475('0x30')]);_0x4e30d2[_0x4475('0x34')]=_[_0x4475('0x32')](_0x258cfc[_0x4475('0x2f')],qs[_0x4475('0x33')](_0x4378a9[_0x4475('0x30')]['fields']));_0x4e30d2[_0x4475('0x34')]=_0x4e30d2[_0x4475('0x34')][_0x4475('0x45')]?_0x4e30d2[_0x4475('0x34')]:_0x258cfc[_0x4475('0x2f')];_0x4e30d2[_0x4475('0x4c')]=qs[_0x4475('0x37')](_0x4378a9['query'][_0x4475('0x37')]);_0x4e30d2[_0x4475('0x3a')]=qs[_0x4475('0x31')](_[_0x4475('0x38')](_0x4378a9[_0x4475('0x30')],_0x258cfc[_0x4475('0x31')]));if(_0x4378a9[_0x4475('0x30')][_0x4475('0x39')]){_0x4e30d2[_0x4475('0x3a')]=_[_0x4475('0x3b')](_0x4e30d2[_0x4475('0x3a')],{'$or':_[_0x4475('0x2b')](_0x4e30d2['attributes'],function(_0x3c6b3d){var _0x51b494={};_0x51b494[_0x3c6b3d]={'$like':'%'+_0x4378a9[_0x4475('0x30')][_0x4475('0x39')]+'%'};return _0x51b494;})});}_0x4e30d2=_[_0x4475('0x3b')]({},_0x4e30d2,_0x4378a9['options']);return _0xfca013['getFields'](_0x4e30d2);}})[_0x4475('0x25')](function(_0x5a856e){if(_0x5a856e){_0x19cc29=_0x5a856e[_0x4475('0x45')];if(!_0x4378a9[_0x4475('0x30')]['hasOwnProperty'](_0x4475('0x36'))){_0x4e30d2[_0x4475('0x1d')]=qs['limit'](_0x4378a9[_0x4475('0x30')]['limit']);_0x4e30d2[_0x4475('0x1b')]=qs[_0x4475('0x1b')](_0x4378a9[_0x4475('0x30')]['offset']);}return _0xfca013[_0x4475('0x4d')](_0x4e30d2);}})[_0x4475('0x25')](function(_0x5d184f){if(_0x5d184f){return _0x5d184f?{'count':_0x19cc29,'rows':_0x5d184f}:null;}})[_0x4475('0x25')](respondWithResult(_0x32e977,null))['catch'](handleError(_0x32e977,null));};exports[_0x4475('0x4e')]=function(_0x1d66b6,_0x5e3645,_0x14539b){var _0x2830aa={};var _0x428fac={};var _0x37597b;var _0x3ff7e2;return db[_0x4475('0x2c')][_0x4475('0x4a')]({'where':{'id':_0x1d66b6[_0x4475('0x43')]['id']}})[_0x4475('0x25')](handleEntityNotFound(_0x5e3645,null))[_0x4475('0x25')](function(_0x3711d5){if(_0x3711d5){_0x37597b=_0x3711d5;_0x428fac[_0x4475('0x2f')]=_[_0x4475('0x44')](db[_0x4475('0x4b')][_0x4475('0x2d')]);_0x428fac[_0x4475('0x30')]=_[_0x4475('0x44')](_0x1d66b6[_0x4475('0x30')]);_0x428fac[_0x4475('0x31')]=_[_0x4475('0x32')](_0x428fac[_0x4475('0x2f')],_0x428fac[_0x4475('0x30')]);_0x2830aa['attributes']=_[_0x4475('0x32')](_0x428fac[_0x4475('0x2f')],qs['fields'](_0x1d66b6[_0x4475('0x30')][_0x4475('0x33')]));_0x2830aa[_0x4475('0x34')]=_0x2830aa['attributes'][_0x4475('0x45')]?_0x2830aa['attributes']:_0x428fac[_0x4475('0x2f')];_0x2830aa['order']=qs[_0x4475('0x37')](_0x1d66b6['query'][_0x4475('0x37')]);_0x2830aa[_0x4475('0x3a')]=qs[_0x4475('0x31')](_[_0x4475('0x38')](_0x1d66b6['query'],_0x428fac[_0x4475('0x31')]));if(_0x1d66b6['query']['filter']){_0x2830aa[_0x4475('0x3a')]=_[_0x4475('0x3b')](_0x2830aa[_0x4475('0x3a')],{'$or':_['map'](_0x2830aa[_0x4475('0x34')],function(_0x586253){var _0x445bb6={};_0x445bb6[_0x586253]={'$like':'%'+_0x1d66b6[_0x4475('0x30')][_0x4475('0x39')]+'%'};return _0x445bb6;})});}_0x2830aa=_['merge']({},_0x2830aa,_0x1d66b6[_0x4475('0x3d')]);return _0x37597b[_0x4475('0x4e')](_0x2830aa);}})[_0x4475('0x25')](function(_0x2bdd49){if(_0x2bdd49){_0x3ff7e2=_0x2bdd49[_0x4475('0x45')];if(!_0x1d66b6[_0x4475('0x30')][_0x4475('0x35')](_0x4475('0x36'))){_0x2830aa[_0x4475('0x1d')]=qs[_0x4475('0x1d')](_0x1d66b6['query'][_0x4475('0x1d')]);_0x2830aa[_0x4475('0x1b')]=qs[_0x4475('0x1b')](_0x1d66b6[_0x4475('0x30')][_0x4475('0x1b')]);}return _0x37597b[_0x4475('0x4e')](_0x2830aa);}})[_0x4475('0x25')](function(_0x455af5){if(_0x455af5){return _0x455af5?{'count':_0x3ff7e2,'rows':_0x455af5}:null;}})[_0x4475('0x25')](respondWithResult(_0x5e3645,null))['catch'](handleError(_0x5e3645,null));};exports['getDescriptions']=function(_0x217f99,_0x8febfc,_0x444495){var _0x4e913c={};var _0x464bb5={};var _0x2dfe3c;var _0x438762;return db[_0x4475('0x2c')][_0x4475('0x4a')]({'where':{'id':_0x217f99[_0x4475('0x43')]['id']}})[_0x4475('0x25')](handleEntityNotFound(_0x8febfc,null))[_0x4475('0x25')](function(_0x12a599){if(_0x12a599){_0x2dfe3c=_0x12a599;_0x464bb5[_0x4475('0x2f')]=_[_0x4475('0x44')](db[_0x4475('0x4b')][_0x4475('0x2d')]);_0x464bb5['query']=_['keys'](_0x217f99[_0x4475('0x30')]);_0x464bb5[_0x4475('0x31')]=_['intersection'](_0x464bb5[_0x4475('0x2f')],_0x464bb5['query']);_0x4e913c[_0x4475('0x34')]=_[_0x4475('0x32')](_0x464bb5[_0x4475('0x2f')],qs[_0x4475('0x33')](_0x217f99[_0x4475('0x30')][_0x4475('0x33')]));_0x4e913c[_0x4475('0x34')]=_0x4e913c[_0x4475('0x34')][_0x4475('0x45')]?_0x4e913c[_0x4475('0x34')]:_0x464bb5[_0x4475('0x2f')];_0x4e913c['order']=qs['sort'](_0x217f99['query'][_0x4475('0x37')]);_0x4e913c[_0x4475('0x3a')]=qs[_0x4475('0x31')](_[_0x4475('0x38')](_0x217f99[_0x4475('0x30')],_0x464bb5[_0x4475('0x31')]));if(_0x217f99[_0x4475('0x30')]['filter']){_0x4e913c[_0x4475('0x3a')]=_['merge'](_0x4e913c['where'],{'$or':_[_0x4475('0x2b')](_0x4e913c[_0x4475('0x34')],function(_0x26f6c4){var _0x4ecc97={};_0x4ecc97[_0x26f6c4]={'$like':'%'+_0x217f99[_0x4475('0x30')][_0x4475('0x39')]+'%'};return _0x4ecc97;})});}_0x4e913c=_[_0x4475('0x3b')]({},_0x4e913c,_0x217f99[_0x4475('0x3d')]);return _0x2dfe3c[_0x4475('0x4f')](_0x4e913c);}})[_0x4475('0x25')](function(_0x23820e){if(_0x23820e){_0x438762=_0x23820e['length'];if(!_0x217f99[_0x4475('0x30')][_0x4475('0x35')](_0x4475('0x36'))){_0x4e913c[_0x4475('0x1d')]=qs[_0x4475('0x1d')](_0x217f99[_0x4475('0x30')][_0x4475('0x1d')]);_0x4e913c[_0x4475('0x1b')]=qs[_0x4475('0x1b')](_0x217f99[_0x4475('0x30')]['offset']);}return _0x2dfe3c[_0x4475('0x4f')](_0x4e913c);}})[_0x4475('0x25')](function(_0x49da93){if(_0x49da93){return _0x49da93?{'count':_0x438762,'rows':_0x49da93}:null;}})[_0x4475('0x25')](respondWithResult(_0x8febfc,null))[_0x4475('0x47')](handleError(_0x8febfc,null));};exports[_0x4475('0x50')]=function(_0x339b93,_0x22d296,_0x31ed94){var _0x29567d={};var _0x46580a={};var _0x1889f8;var _0x4f6f94;return db[_0x4475('0x2c')][_0x4475('0x4a')]({'where':{'id':_0x339b93[_0x4475('0x43')]['id']}})[_0x4475('0x25')](handleEntityNotFound(_0x22d296,null))['then'](function(_0x3ec188){if(_0x3ec188){_0x1889f8=_0x3ec188;_0x46580a[_0x4475('0x2f')]=_['keys'](db[_0x4475('0x51')][_0x4475('0x2d')]);_0x46580a[_0x4475('0x30')]=_[_0x4475('0x44')](_0x339b93[_0x4475('0x30')]);_0x46580a[_0x4475('0x31')]=_[_0x4475('0x32')](_0x46580a[_0x4475('0x2f')],_0x46580a[_0x4475('0x30')]);_0x29567d[_0x4475('0x34')]=_[_0x4475('0x32')](_0x46580a['model'],qs['fields'](_0x339b93[_0x4475('0x30')]['fields']));_0x29567d[_0x4475('0x34')]=_0x29567d[_0x4475('0x34')][_0x4475('0x45')]?_0x29567d['attributes']:_0x46580a[_0x4475('0x2f')];_0x29567d[_0x4475('0x4c')]=qs['sort'](_0x339b93[_0x4475('0x30')][_0x4475('0x37')]);_0x29567d['where']=qs['filters'](_[_0x4475('0x38')](_0x339b93[_0x4475('0x30')],_0x46580a[_0x4475('0x31')]));if(_0x339b93[_0x4475('0x30')][_0x4475('0x39')]){_0x29567d[_0x4475('0x3a')]=_[_0x4475('0x3b')](_0x29567d['where'],{'$or':_[_0x4475('0x2b')](_0x29567d[_0x4475('0x34')],function(_0x446a74){var _0x518e8f={};_0x518e8f[_0x446a74]={'$like':'%'+_0x339b93['query'][_0x4475('0x39')]+'%'};return _0x518e8f;})});}_0x29567d=_[_0x4475('0x3b')]({},_0x29567d,_0x339b93[_0x4475('0x3d')]);return _0x1889f8['getTags'](_0x29567d);}})[_0x4475('0x25')](function(_0x236174){if(_0x236174){_0x4f6f94=_0x236174[_0x4475('0x45')];if(!_0x339b93[_0x4475('0x30')][_0x4475('0x35')](_0x4475('0x36'))){_0x29567d[_0x4475('0x1d')]=qs[_0x4475('0x1d')](_0x339b93['query'][_0x4475('0x1d')]);_0x29567d[_0x4475('0x1b')]=qs[_0x4475('0x1b')](_0x339b93['query'][_0x4475('0x1b')]);}return _0x1889f8[_0x4475('0x50')](_0x29567d);}})[_0x4475('0x25')](function(_0xf83743){if(_0xf83743){return _0xf83743?{'count':_0x4f6f94,'rows':_0xf83743}:null;}})[_0x4475('0x25')](respondWithResult(_0x22d296,null))[_0x4475('0x47')](handleError(_0x22d296,null));};exports[_0x4475('0x52')]=function(_0x42133b,_0x6fcc56,_0x532029){if(_0x42133b[_0x4475('0x49')]['id']){delete _0x42133b['body']['id'];}return db[_0x4475('0x2c')]['findOne']({'where':{'id':_0x42133b[_0x4475('0x43')]['id']}})[_0x4475('0x25')](handleEntityNotFound(_0x6fcc56,null))['then'](function(_0x35545a){if(_0x35545a){return _0x35545a['setTags'](_0x42133b[_0x4475('0x49')][_0x4475('0x53')]||[]);}return null;})[_0x4475('0x25')](respondWithResult(_0x6fcc56,null))[_0x4475('0x47')](handleError(_0x6fcc56,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index a147215..a4fe67c 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 _0xa571=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x30dd30,_0x2cb7c4){var _0x32d524=function(_0x298984){while(--_0x298984){_0x30dd30['push'](_0x30dd30['shift']());}};_0x32d524(++_0x2cb7c4);}(_0xa571,0x107));var _0x1a57=function(_0x559378,_0x3ae562){_0x559378=_0x559378-0x0;var _0x34eab2=_0xa571[_0x559378];return _0x34eab2;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3423=['ZendeskConfiguration','int_zendesk_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define'];(function(_0xd36a0,_0x2ab294){var _0x37d3f6=function(_0x44b8a2){while(--_0x44b8a2){_0xd36a0['push'](_0xd36a0['shift']());}};_0x37d3f6(++_0x2ab294);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'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 ea68181..fc0901d 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 _0x9f2c=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x38e87f,_0x590e6f){var _0x4084a7=function(_0x1fe1f6){while(--_0x1fe1f6){_0x38e87f['push'](_0x38e87f['shift']());}};_0x4084a7(++_0x590e6f);}(_0x9f2c,0x1e4));var _0xc9f2=function(_0xd0a290,_0x55cb33){_0xd0a290=_0xd0a290-0x0;var _0x377b3d=_0x9f2c[_0xd0a290];return _0x377b3d;};'use strict';var _=require(_0xc9f2('0x0'));var util=require('util');var moment=require(_0xc9f2('0x1'));var BPromise=require(_0xc9f2('0x2'));var rs=require(_0xc9f2('0x3'));var fs=require('fs');var Redis=require(_0xc9f2('0x4'));var db=require(_0xc9f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9f2('0x6'))(_0xc9f2('0x7'));var config=require(_0xc9f2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc9f2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28b593,_0x423edf,_0x44c01c){return new BPromise(function(_0x4e25f7,_0x3b2e4a){return client[_0xc9f2('0xa')](_0x28b593,_0x44c01c)[_0xc9f2('0xb')](function(_0x3874e6){logger[_0xc9f2('0xc')](_0xc9f2('0xd'),_0x423edf,'request\x20sent');logger[_0xc9f2('0xe')](_0xc9f2('0xf'),_0x423edf,_0xc9f2('0x10'),JSON[_0xc9f2('0x11')](_0x3874e6));if(_0x3874e6[_0xc9f2('0x12')]){if(_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x13')]===0x1f4){logger[_0xc9f2('0x12')](_0xc9f2('0xd'),_0x423edf,_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);return _0x3b2e4a(_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);}logger['error'](_0xc9f2('0xd'),_0x423edf,_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);return _0x4e25f7(_0x3874e6[_0xc9f2('0x12')][_0xc9f2('0x14')]);}else{logger[_0xc9f2('0xc')](_0xc9f2('0xd'),_0x423edf,'request\x20sent');_0x4e25f7(_0x3874e6[_0xc9f2('0x15')][_0xc9f2('0x14')]);}})[_0xc9f2('0x16')](function(_0xf6a1c9){logger[_0xc9f2('0x12')](_0xc9f2('0xd'),_0x423edf,_0xf6a1c9);_0x3b2e4a(_0xf6a1c9);});});} \ No newline at end of file +var _0x3b13=['request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x206aae,_0x30525a){var _0x32222b=function(_0x56f813){while(--_0x56f813){_0x206aae['push'](_0x206aae['shift']());}};_0x32222b(++_0x30525a);}(_0x3b13,0x1e7));var _0x33b1=function(_0x23439c,_0x5baf43){_0x23439c=_0x23439c-0x0;var _0x5f0922=_0x3b13[_0x23439c];return _0x5f0922;};'use strict';var _=require('lodash');var util=require(_0x33b1('0x0'));var moment=require(_0x33b1('0x1'));var BPromise=require(_0x33b1('0x2'));var rs=require(_0x33b1('0x3'));var fs=require('fs');var Redis=require(_0x33b1('0x4'));var db=require(_0x33b1('0x5'))['db'];var utils=require(_0x33b1('0x6'));var logger=require(_0x33b1('0x7'))(_0x33b1('0x8'));var config=require(_0x33b1('0x9'));var jayson=require(_0x33b1('0xa'));var client=jayson[_0x33b1('0xb')][_0x33b1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ff161,_0x23c1ad,_0x15b103){return new BPromise(function(_0x4f342b,_0x48abd6){return client[_0x33b1('0xd')](_0x4ff161,_0x15b103)[_0x33b1('0xe')](function(_0xf9641c){logger[_0x33b1('0xf')](_0x33b1('0x10'),_0x23c1ad,_0x33b1('0x11'));logger['debug'](_0x33b1('0x12'),_0x23c1ad,'request\x20sent',JSON[_0x33b1('0x13')](_0xf9641c));if(_0xf9641c[_0x33b1('0x14')]){if(_0xf9641c[_0x33b1('0x14')][_0x33b1('0x15')]===0x1f4){logger[_0x33b1('0x14')](_0x33b1('0x10'),_0x23c1ad,_0xf9641c['error'][_0x33b1('0x16')]);return _0x48abd6(_0xf9641c[_0x33b1('0x14')][_0x33b1('0x16')]);}logger[_0x33b1('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x23c1ad,_0xf9641c[_0x33b1('0x14')][_0x33b1('0x16')]);return _0x4f342b(_0xf9641c[_0x33b1('0x14')][_0x33b1('0x16')]);}else{logger[_0x33b1('0xf')](_0x33b1('0x10'),_0x23c1ad,_0x33b1('0x11'));_0x4f342b(_0xf9641c[_0x33b1('0x17')][_0x33b1('0x16')]);}})[_0x33b1('0x18')](function(_0x529f4a){logger[_0x33b1('0x14')](_0x33b1('0x10'),_0x23c1ad,_0x529f4a);_0x48abd6(_0x529f4a);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2c9f992..9d3d7b0 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 _0xba50=['post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intZendeskField.controller','index','get','/:id','isAuthenticated','show'];(function(_0x3eab43,_0x1bd704){var _0x2d373c=function(_0x106dc4){while(--_0x106dc4){_0x3eab43['push'](_0x3eab43['shift']());}};_0x2d373c(++_0x1bd704);}(_0xba50,0x1a3));var _0x0ba5=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0xba50[_0x2803ab];return _0x3d6e8e;};'use strict';var multer=require(_0x0ba5('0x0'));var util=require(_0x0ba5('0x1'));var path=require(_0x0ba5('0x2'));var timeout=require(_0x0ba5('0x3'));var express=require(_0x0ba5('0x4'));var router=express[_0x0ba5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ba5('0x6'));var config=require('../../config/environment');var controller=require(_0x0ba5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0ba5('0x8')]);router[_0x0ba5('0x9')](_0x0ba5('0xa'),auth[_0x0ba5('0xb')](),controller[_0x0ba5('0xc')]);router[_0x0ba5('0xd')]('/',auth[_0x0ba5('0xb')](),controller['create']);router[_0x0ba5('0xe')]('/:id',auth[_0x0ba5('0xb')](),controller[_0x0ba5('0xf')]);router[_0x0ba5('0x10')]('/:id',auth[_0x0ba5('0xb')](),controller[_0x0ba5('0x11')]);module['exports']=router; \ No newline at end of file +var _0x022d=['destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','update','delete'];(function(_0x129e94,_0x39331b){var _0xdb339f=function(_0xb89a15){while(--_0xb89a15){_0x129e94['push'](_0x129e94['shift']());}};_0xdb339f(++_0x39331b);}(_0x022d,0x158));var _0xd022=function(_0x3a89e0,_0x19f580){_0x3a89e0=_0x3a89e0-0x0;var _0x297b14=_0x022d[_0x3a89e0];return _0x297b14;};'use strict';var multer=require(_0xd022('0x0'));var util=require(_0xd022('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd022('0x2'));var router=express[_0xd022('0x3')]();var fs_extra=require(_0xd022('0x4'));var auth=require(_0xd022('0x5'));var interaction=require(_0xd022('0x6'));var config=require(_0xd022('0x7'));var controller=require('./intZendeskField.controller');router[_0xd022('0x8')]('/',auth[_0xd022('0x9')](),controller[_0xd022('0xa')]);router['get'](_0xd022('0xb'),auth[_0xd022('0x9')](),controller['show']);router['post']('/',auth[_0xd022('0x9')](),controller[_0xd022('0xc')]);router[_0xd022('0xd')]('/:id',auth[_0xd022('0x9')](),controller[_0xd022('0xe')]);router[_0xd022('0xf')](_0xd022('0xb'),auth[_0xd022('0x9')](),controller[_0xd022('0x10')]);module[_0xd022('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index f76b3ca..c855666 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 _0xa340=['STRING','ENUM','string','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x1a21db,_0x9489fb){var _0x13ea9b=function(_0xb91444){while(--_0xb91444){_0x1a21db['push'](_0x1a21db['shift']());}};_0x13ea9b(++_0x9489fb);}(_0xa340,0x114));var _0x0a34=function(_0x2afcd3,_0x17db28){_0x2afcd3=_0x2afcd3-0x0;var _0x28d21a=_0xa340[_0x2afcd3];return _0x28d21a;};'use strict';var Sequelize=require(_0x0a34('0x0'));module[_0x0a34('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x0a34('0x2'),_0x0a34('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0a34('0x4')]},'keyType':{'type':Sequelize[_0x0a34('0x5')](_0x0a34('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0a34('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8797=['string','variable','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports'];(function(_0xf96ca7,_0x448dc2){var _0x120685=function(_0x31ea28){while(--_0x31ea28){_0xf96ca7['push'](_0xf96ca7['shift']());}};_0x120685(++_0x448dc2);}(_0x8797,0xa0));var _0x7879=function(_0x160110,_0x4606c5){_0x160110=_0x160110-0x0;var _0x4c1ac9=_0x8797[_0x160110];return _0x4c1ac9;};'use strict';var Sequelize=require(_0x7879('0x0'));module[_0x7879('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7879('0x2'),_0x7879('0x3'),'customVariable','keyValue',_0x7879('0x4')),'defaultValue':_0x7879('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7879('0x5')]},'keyType':{'type':Sequelize[_0x7879('0x6')]('string','variable',_0x7879('0x7'))},'keyContent':{'type':Sequelize[_0x7879('0x5')]},'idField':{'type':Sequelize[_0x7879('0x5')]},'nameField':{'type':Sequelize[_0x7879('0x5')]},'customField':{'type':Sequelize[_0x7879('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 8fdc74d..8302e77 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 _0xbf2a=['moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','fast-json-patch','request-promise'];(function(_0x2d3d0d,_0x67ac82){var _0xca35b6=function(_0x483979){while(--_0x483979){_0x2d3d0d['push'](_0x2d3d0d['shift']());}};_0xca35b6(++_0x67ac82);}(_0xbf2a,0x165));var _0xabf2=function(_0xc905bf,_0x3fb45d){_0xc905bf=_0xc905bf-0x0;var _0x3ffd14=_0xbf2a[_0xc905bf];return _0x3ffd14;};'use strict';var emlformat=require(_0xabf2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xabf2('0x1'));var rp=require(_0xabf2('0x2'));var moment=require(_0xabf2('0x3'));var BPromise=require(_0xabf2('0x4'));var Mustache=require(_0xabf2('0x5'));var util=require(_0xabf2('0x6'));var path=require('path');var sox=require(_0xabf2('0x7'));var csv=require(_0xabf2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabf2('0x9'));var squel=require('squel');var crypto=require(_0xabf2('0xa'));var jsforce=require(_0xabf2('0xb'));var deskjs=require(_0xabf2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xabf2('0xd'));var Redis=require(_0xabf2('0xe'));var authService=require(_0xabf2('0xf'));var qs=require(_0xabf2('0x10'));var as=require(_0xabf2('0x11'));var hardwareService=require(_0xabf2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xabf2('0x13'));var config=require(_0xabf2('0x14'));var licenseUtil=require(_0xabf2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x63964a,_0x2e54d9){_0x2e54d9=_0x2e54d9||0xcc;return function(_0x8aa3d8){if(_0x8aa3d8){return _0x63964a['sendStatus'](_0x2e54d9);}return _0x63964a[_0xabf2('0x16')](_0x2e54d9)[_0xabf2('0x17')]();};}function respondWithResult(_0xea348e,_0x3b16f4){_0x3b16f4=_0x3b16f4||0xc8;return function(_0x4aa1c2){if(_0x4aa1c2){return _0xea348e[_0xabf2('0x16')](_0x3b16f4)['json'](_0x4aa1c2);}};}function respondWithFilteredResult(_0x425a36,_0x3fbff0){return function(_0x1b9f54){if(_0x1b9f54){var _0x11e650=typeof _0x3fbff0[_0xabf2('0x18')]===_0xabf2('0x19')&&typeof _0x3fbff0[_0xabf2('0x1a')]===_0xabf2('0x19');var _0x209dd3=_0x1b9f54[_0xabf2('0x1b')];var _0x30eeab=_0x11e650?0x0:_0x3fbff0[_0xabf2('0x18')];var _0x4933e8=_0x11e650?_0x1b9f54[_0xabf2('0x1b')]:_0x3fbff0[_0xabf2('0x18')]+_0x3fbff0[_0xabf2('0x1a')];var _0x3a89ab;if(_0x4933e8>=_0x209dd3){_0x4933e8=_0x209dd3;_0x3a89ab=0xc8;}else{_0x3a89ab=0xce;}_0x425a36[_0xabf2('0x16')](_0x3a89ab);return _0x425a36['set'](_0xabf2('0x1c'),_0x30eeab+'-'+_0x4933e8+'/'+_0x209dd3)[_0xabf2('0x1d')](_0x1b9f54);}return null;};}function patchUpdates(_0x533e1a){return function(_0x2eee0f){try{jsonpatch[_0xabf2('0x1e')](_0x2eee0f,_0x533e1a,!![]);}catch(_0xabb431){return BPromise[_0xabf2('0x1f')](_0xabb431);}return _0x2eee0f[_0xabf2('0x20')]();};}function saveUpdates(_0x12984a,_0x4f1012){return function(_0x212ad7){if(_0x212ad7){return _0x212ad7[_0xabf2('0x21')](_0x12984a)[_0xabf2('0x22')](function(_0x391099){return _0x391099;});}return null;};}function removeEntity(_0x2f7ffa,_0x252f3e){return function(_0x54a033){if(_0x54a033){return _0x54a033[_0xabf2('0x23')]()[_0xabf2('0x22')](function(){_0x2f7ffa[_0xabf2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309466,_0x2016e6){return function(_0x16994f){if(!_0x16994f){_0x309466['sendStatus'](0x194);}return _0x16994f;};}function handleError(_0x567c14,_0x25e173){_0x25e173=_0x25e173||0x1f4;return function(_0x4eed34){logger['error'](_0x4eed34[_0xabf2('0x24')]);if(_0x4eed34['name']){delete _0x4eed34[_0xabf2('0x25')];}_0x567c14[_0xabf2('0x16')](_0x25e173)[_0xabf2('0x26')](_0x4eed34);};}exports[_0xabf2('0x27')]=function(_0x345f92,_0x53fa8d){var _0x48ba8f={},_0x7dc999={},_0x2038bb={'count':0x0,'rows':[]};var _0x56bda7=_[_0xabf2('0x28')](db[_0xabf2('0x29')][_0xabf2('0x2a')],function(_0x40d577){return{'name':_0x40d577[_0xabf2('0x2b')],'type':_0x40d577[_0xabf2('0x2c')]['key']};});_0x7dc999['model']=_[_0xabf2('0x28')](_0x56bda7,_0xabf2('0x25'));_0x7dc999['query']=_[_0xabf2('0x2d')](_0x345f92[_0xabf2('0x2e')]);_0x7dc999['filters']=_[_0xabf2('0x2f')](_0x7dc999[_0xabf2('0x30')],_0x7dc999[_0xabf2('0x2e')]);_0x48ba8f[_0xabf2('0x31')]=_['intersection'](_0x7dc999[_0xabf2('0x30')],qs[_0xabf2('0x32')](_0x345f92[_0xabf2('0x2e')][_0xabf2('0x32')]));_0x48ba8f[_0xabf2('0x31')]=_0x48ba8f[_0xabf2('0x31')][_0xabf2('0x33')]?_0x48ba8f[_0xabf2('0x31')]:_0x7dc999[_0xabf2('0x30')];if(!_0x345f92[_0xabf2('0x2e')][_0xabf2('0x34')](_0xabf2('0x35'))){_0x48ba8f[_0xabf2('0x1a')]=qs[_0xabf2('0x1a')](_0x345f92[_0xabf2('0x2e')]['limit']);_0x48ba8f['offset']=qs[_0xabf2('0x18')](_0x345f92[_0xabf2('0x2e')][_0xabf2('0x18')]);}_0x48ba8f[_0xabf2('0x36')]=qs['sort'](_0x345f92[_0xabf2('0x2e')][_0xabf2('0x37')]);_0x48ba8f[_0xabf2('0x38')]=qs[_0xabf2('0x39')](_['pick'](_0x345f92[_0xabf2('0x2e')],_0x7dc999[_0xabf2('0x39')]),_0x56bda7);if(_0x345f92[_0xabf2('0x2e')][_0xabf2('0x3a')]){_0x48ba8f[_0xabf2('0x38')]=_[_0xabf2('0x3b')](_0x48ba8f[_0xabf2('0x38')],{'$or':_['map'](_0x56bda7,function(_0x210585){if(_0x210585[_0xabf2('0x2c')]!==_0xabf2('0x3c')){var _0x467b87={};_0x467b87[_0x210585[_0xabf2('0x25')]]={'$like':'%'+_0x345f92[_0xabf2('0x2e')][_0xabf2('0x3a')]+'%'};return _0x467b87;}})});}_0x48ba8f=_[_0xabf2('0x3b')]({},_0x48ba8f,_0x345f92[_0xabf2('0x3d')]);var _0x92c259={'where':_0x48ba8f[_0xabf2('0x38')]};return db[_0xabf2('0x29')][_0xabf2('0x1b')](_0x92c259)[_0xabf2('0x22')](function(_0x543e68){_0x2038bb[_0xabf2('0x1b')]=_0x543e68;if(_0x345f92['query'][_0xabf2('0x3e')]){_0x48ba8f[_0xabf2('0x3f')]=[{'all':!![]}];}return db['ZendeskField'][_0xabf2('0x40')](_0x48ba8f);})[_0xabf2('0x22')](function(_0x2e483f){_0x2038bb[_0xabf2('0x41')]=_0x2e483f;return _0x2038bb;})['then'](respondWithFilteredResult(_0x53fa8d,_0x48ba8f))['catch'](handleError(_0x53fa8d,null));};exports[_0xabf2('0x42')]=function(_0x32f226,_0x3c84ec){var _0x54b705={'raw':!![],'where':{'id':_0x32f226[_0xabf2('0x43')]['id']}},_0x30f92b={};_0x30f92b[_0xabf2('0x30')]=_['keys'](db[_0xabf2('0x29')][_0xabf2('0x2a')]);_0x30f92b[_0xabf2('0x2e')]=_['keys'](_0x32f226[_0xabf2('0x2e')]);_0x30f92b[_0xabf2('0x39')]=_['intersection'](_0x30f92b[_0xabf2('0x30')],_0x30f92b['query']);_0x54b705[_0xabf2('0x31')]=_[_0xabf2('0x2f')](_0x30f92b['model'],qs['fields'](_0x32f226[_0xabf2('0x2e')][_0xabf2('0x32')]));_0x54b705[_0xabf2('0x31')]=_0x54b705[_0xabf2('0x31')][_0xabf2('0x33')]?_0x54b705[_0xabf2('0x31')]:_0x30f92b[_0xabf2('0x30')];if(_0x32f226[_0xabf2('0x2e')]['includeAll']){_0x54b705['include']=[{'all':!![]}];}_0x54b705=_[_0xabf2('0x3b')]({},_0x54b705,_0x32f226[_0xabf2('0x3d')]);return db[_0xabf2('0x29')][_0xabf2('0x44')](_0x54b705)[_0xabf2('0x22')](handleEntityNotFound(_0x3c84ec,null))[_0xabf2('0x22')](respondWithResult(_0x3c84ec,null))[_0xabf2('0x45')](handleError(_0x3c84ec,null));};exports['create']=function(_0x46c3e5,_0x42978f){return db[_0xabf2('0x29')][_0xabf2('0x46')](_0x46c3e5['body'],{})['then'](respondWithResult(_0x42978f,0xc9))['catch'](handleError(_0x42978f,null));};exports['update']=function(_0x58a446,_0x5f2666){if(_0x58a446[_0xabf2('0x47')]['id']){delete _0x58a446[_0xabf2('0x47')]['id'];}return db['ZendeskField'][_0xabf2('0x44')]({'where':{'id':_0x58a446[_0xabf2('0x43')]['id']}})[_0xabf2('0x22')](handleEntityNotFound(_0x5f2666,null))['then'](saveUpdates(_0x58a446[_0xabf2('0x47')],null))[_0xabf2('0x22')](respondWithResult(_0x5f2666,null))[_0xabf2('0x45')](handleError(_0x5f2666,null));};exports[_0xabf2('0x23')]=function(_0x2f9a58,_0x288990){return db[_0xabf2('0x29')][_0xabf2('0x44')]({'where':{'id':_0x2f9a58[_0xabf2('0x43')]['id']}})[_0xabf2('0x22')](handleEntityNotFound(_0x288990,null))['then'](removeEntity(_0x288990,null))['catch'](handleError(_0x288990,null));}; \ No newline at end of file +var _0x2dcd=['type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','include','create','body','find','params','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName'];(function(_0x12ee2c,_0x573ba4){var _0x1b50e7=function(_0x5c13e2){while(--_0x5c13e2){_0x12ee2c['push'](_0x12ee2c['shift']());}};_0x1b50e7(++_0x573ba4);}(_0x2dcd,0xe5));var _0xd2dc=function(_0x4a04de,_0x2e342c){_0x4a04de=_0x4a04de-0x0;var _0xbbe018=_0x2dcd[_0x4a04de];return _0xbbe018;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd2dc('0x0'));var jsonpatch=require(_0xd2dc('0x1'));var rp=require(_0xd2dc('0x2'));var moment=require(_0xd2dc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd2dc('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd2dc('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd2dc('0x6'));var squel=require(_0xd2dc('0x7'));var crypto=require(_0xd2dc('0x8'));var jsforce=require(_0xd2dc('0x9'));var deskjs=require(_0xd2dc('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd2dc('0xb'));var Papa=require('papaparse');var Redis=require(_0xd2dc('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd2dc('0xd'));var as=require(_0xd2dc('0xe'));var hardwareService=require(_0xd2dc('0xf'));var logger=require('../../config/logger')(_0xd2dc('0x10'));var utils=require(_0xd2dc('0x11'));var config=require(_0xd2dc('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd2dc('0x13'))['db'];function respondWithStatusCode(_0x39bf65,_0x44e689){_0x44e689=_0x44e689||0xcc;return function(_0x5e0e10){if(_0x5e0e10){return _0x39bf65['sendStatus'](_0x44e689);}return _0x39bf65[_0xd2dc('0x14')](_0x44e689)[_0xd2dc('0x15')]();};}function respondWithResult(_0x4073d4,_0x5886b0){_0x5886b0=_0x5886b0||0xc8;return function(_0x5307e6){if(_0x5307e6){return _0x4073d4['status'](_0x5886b0)[_0xd2dc('0x16')](_0x5307e6);}};}function respondWithFilteredResult(_0x39cee2,_0x3731c5){return function(_0x12dadc){if(_0x12dadc){var _0x1c084a=typeof _0x3731c5['offset']===_0xd2dc('0x17')&&typeof _0x3731c5[_0xd2dc('0x18')]===_0xd2dc('0x17');var _0xd34965=_0x12dadc[_0xd2dc('0x19')];var _0x2b52bb=_0x1c084a?0x0:_0x3731c5['offset'];var _0xa02f97=_0x1c084a?_0x12dadc[_0xd2dc('0x19')]:_0x3731c5[_0xd2dc('0x1a')]+_0x3731c5[_0xd2dc('0x18')];var _0x337b95;if(_0xa02f97>=_0xd34965){_0xa02f97=_0xd34965;_0x337b95=0xc8;}else{_0x337b95=0xce;}_0x39cee2['status'](_0x337b95);return _0x39cee2[_0xd2dc('0x1b')](_0xd2dc('0x1c'),_0x2b52bb+'-'+_0xa02f97+'/'+_0xd34965)[_0xd2dc('0x16')](_0x12dadc);}return null;};}function patchUpdates(_0x34c73a){return function(_0x3af8c2){try{jsonpatch[_0xd2dc('0x1d')](_0x3af8c2,_0x34c73a,!![]);}catch(_0x3ed677){return BPromise[_0xd2dc('0x1e')](_0x3ed677);}return _0x3af8c2[_0xd2dc('0x1f')]();};}function saveUpdates(_0x3e8779,_0x418497){return function(_0x4d8a37){if(_0x4d8a37){return _0x4d8a37[_0xd2dc('0x20')](_0x3e8779)[_0xd2dc('0x21')](function(_0x4fd9a9){return _0x4fd9a9;});}return null;};}function removeEntity(_0x338970,_0x55b946){return function(_0x1dd95c){if(_0x1dd95c){return _0x1dd95c[_0xd2dc('0x22')]()['then'](function(){_0x338970[_0xd2dc('0x14')](0xcc)[_0xd2dc('0x15')]();});}};}function handleEntityNotFound(_0x244b5a,_0x5c1d33){return function(_0x10147f){if(!_0x10147f){_0x244b5a['sendStatus'](0x194);}return _0x10147f;};}function handleError(_0x23f008,_0x370c25){_0x370c25=_0x370c25||0x1f4;return function(_0x482f5e){logger['error'](_0x482f5e[_0xd2dc('0x23')]);if(_0x482f5e[_0xd2dc('0x24')]){delete _0x482f5e[_0xd2dc('0x24')];}_0x23f008['status'](_0x370c25)[_0xd2dc('0x25')](_0x482f5e);};}exports[_0xd2dc('0x26')]=function(_0x407956,_0x38a4be){var _0x20f4e9={},_0x2f2c02={},_0x10ecfa={'count':0x0,'rows':[]};var _0xa0b4ac=_[_0xd2dc('0x27')](db[_0xd2dc('0x28')][_0xd2dc('0x29')],function(_0x44ef95){return{'name':_0x44ef95[_0xd2dc('0x2a')],'type':_0x44ef95[_0xd2dc('0x2b')][_0xd2dc('0x2c')]};});_0x2f2c02[_0xd2dc('0x2d')]=_[_0xd2dc('0x27')](_0xa0b4ac,_0xd2dc('0x24'));_0x2f2c02[_0xd2dc('0x2e')]=_[_0xd2dc('0x2f')](_0x407956[_0xd2dc('0x2e')]);_0x2f2c02[_0xd2dc('0x30')]=_[_0xd2dc('0x31')](_0x2f2c02['model'],_0x2f2c02[_0xd2dc('0x2e')]);_0x20f4e9[_0xd2dc('0x32')]=_[_0xd2dc('0x31')](_0x2f2c02[_0xd2dc('0x2d')],qs[_0xd2dc('0x33')](_0x407956[_0xd2dc('0x2e')]['fields']));_0x20f4e9[_0xd2dc('0x32')]=_0x20f4e9['attributes']['length']?_0x20f4e9[_0xd2dc('0x32')]:_0x2f2c02[_0xd2dc('0x2d')];if(!_0x407956[_0xd2dc('0x2e')]['hasOwnProperty']('nolimit')){_0x20f4e9[_0xd2dc('0x18')]=qs[_0xd2dc('0x18')](_0x407956[_0xd2dc('0x2e')]['limit']);_0x20f4e9['offset']=qs[_0xd2dc('0x1a')](_0x407956[_0xd2dc('0x2e')][_0xd2dc('0x1a')]);}_0x20f4e9[_0xd2dc('0x34')]=qs[_0xd2dc('0x35')](_0x407956[_0xd2dc('0x2e')]['sort']);_0x20f4e9[_0xd2dc('0x36')]=qs[_0xd2dc('0x30')](_[_0xd2dc('0x37')](_0x407956[_0xd2dc('0x2e')],_0x2f2c02[_0xd2dc('0x30')]),_0xa0b4ac);if(_0x407956[_0xd2dc('0x2e')][_0xd2dc('0x38')]){_0x20f4e9[_0xd2dc('0x36')]=_[_0xd2dc('0x39')](_0x20f4e9[_0xd2dc('0x36')],{'$or':_[_0xd2dc('0x27')](_0xa0b4ac,function(_0x1741e9){if(_0x1741e9[_0xd2dc('0x2b')]!==_0xd2dc('0x3a')){var _0x711cdf={};_0x711cdf[_0x1741e9['name']]={'$like':'%'+_0x407956['query']['filter']+'%'};return _0x711cdf;}})});}_0x20f4e9=_[_0xd2dc('0x39')]({},_0x20f4e9,_0x407956[_0xd2dc('0x3b')]);var _0x3fd9dc={'where':_0x20f4e9['where']};return db[_0xd2dc('0x28')]['count'](_0x3fd9dc)[_0xd2dc('0x21')](function(_0x5089de){_0x10ecfa[_0xd2dc('0x19')]=_0x5089de;if(_0x407956['query'][_0xd2dc('0x3c')]){_0x20f4e9['include']=[{'all':!![]}];}return db[_0xd2dc('0x28')][_0xd2dc('0x3d')](_0x20f4e9);})[_0xd2dc('0x21')](function(_0x49406d){_0x10ecfa['rows']=_0x49406d;return _0x10ecfa;})[_0xd2dc('0x21')](respondWithFilteredResult(_0x38a4be,_0x20f4e9))[_0xd2dc('0x3e')](handleError(_0x38a4be,null));};exports['show']=function(_0x3fb7f2,_0x380bb4){var _0x358e84={'raw':!![],'where':{'id':_0x3fb7f2['params']['id']}},_0x299ee3={};_0x299ee3[_0xd2dc('0x2d')]=_[_0xd2dc('0x2f')](db['ZendeskField'][_0xd2dc('0x29')]);_0x299ee3[_0xd2dc('0x2e')]=_[_0xd2dc('0x2f')](_0x3fb7f2[_0xd2dc('0x2e')]);_0x299ee3[_0xd2dc('0x30')]=_[_0xd2dc('0x31')](_0x299ee3[_0xd2dc('0x2d')],_0x299ee3[_0xd2dc('0x2e')]);_0x358e84['attributes']=_['intersection'](_0x299ee3[_0xd2dc('0x2d')],qs['fields'](_0x3fb7f2['query']['fields']));_0x358e84[_0xd2dc('0x32')]=_0x358e84[_0xd2dc('0x32')]['length']?_0x358e84[_0xd2dc('0x32')]:_0x299ee3[_0xd2dc('0x2d')];if(_0x3fb7f2['query'][_0xd2dc('0x3c')]){_0x358e84[_0xd2dc('0x3f')]=[{'all':!![]}];}_0x358e84=_['merge']({},_0x358e84,_0x3fb7f2[_0xd2dc('0x3b')]);return db['ZendeskField']['find'](_0x358e84)[_0xd2dc('0x21')](handleEntityNotFound(_0x380bb4,null))['then'](respondWithResult(_0x380bb4,null))['catch'](handleError(_0x380bb4,null));};exports[_0xd2dc('0x40')]=function(_0x201cf8,_0x574fb1){return db[_0xd2dc('0x28')][_0xd2dc('0x40')](_0x201cf8[_0xd2dc('0x41')],{})['then'](respondWithResult(_0x574fb1,0xc9))[_0xd2dc('0x3e')](handleError(_0x574fb1,null));};exports[_0xd2dc('0x20')]=function(_0x2092ed,_0x9734a5){if(_0x2092ed['body']['id']){delete _0x2092ed[_0xd2dc('0x41')]['id'];}return db[_0xd2dc('0x28')][_0xd2dc('0x42')]({'where':{'id':_0x2092ed[_0xd2dc('0x43')]['id']}})[_0xd2dc('0x21')](handleEntityNotFound(_0x9734a5,null))[_0xd2dc('0x21')](saveUpdates(_0x2092ed[_0xd2dc('0x41')],null))['then'](respondWithResult(_0x9734a5,null))[_0xd2dc('0x3e')](handleError(_0x9734a5,null));};exports['destroy']=function(_0x39f9b5,_0x5ba561){return db['ZendeskField'][_0xd2dc('0x42')]({'where':{'id':_0x39f9b5[_0xd2dc('0x43')]['id']}})[_0xd2dc('0x21')](handleEntityNotFound(_0x5ba561,null))[_0xd2dc('0x21')](removeEntity(_0x5ba561,null))['catch'](handleError(_0x5ba561,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 9002ff7..aa9d0c2 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 _0x22ac=['request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x22ac,0x11b));var _0xc22a=function(_0x202438,_0x21f696){_0x202438=_0x202438-0x0;var _0x43a7f1=_0x22ac[_0x202438];return _0x43a7f1;};'use strict';var _=require(_0xc22a('0x0'));var util=require('util');var logger=require(_0xc22a('0x1'))('api');var moment=require(_0xc22a('0x2'));var BPromise=require('bluebird');var rp=require(_0xc22a('0x3'));var fs=require('fs');var path=require(_0xc22a('0x4'));var rimraf=require('rimraf');var config=require(_0xc22a('0x5'));var attributes=require(_0xc22a('0x6'));module[_0xc22a('0x7')]=function(_0x599b47,_0x3e24b1){return _0x599b47[_0xc22a('0x8')]('ZendeskField',attributes,{'tableName':_0xc22a('0x9'),'paranoid':![],'indexes':[{'name':_0xc22a('0xa'),'fields':[_0xc22a('0xb'),_0xc22a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe552=['request-promise','rimraf','./intZendeskField.attributes','exports','define','int_zendesk_fields','FieldId','lodash','util','../../config/logger','api'];(function(_0x130b05,_0xbaa2ce){var _0x387c55=function(_0x50a83b){while(--_0x50a83b){_0x130b05['push'](_0x130b05['shift']());}};_0x387c55(++_0xbaa2ce);}(_0xe552,0x11a));var _0x2e55=function(_0x5fc42c,_0x42ff9a){_0x5fc42c=_0x5fc42c-0x0;var _0x3b791a=_0xe552[_0x5fc42c];return _0x3b791a;};'use strict';var _=require(_0x2e55('0x0'));var util=require(_0x2e55('0x1'));var logger=require(_0x2e55('0x2'))(_0x2e55('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e55('0x5'));var config=require('../../config/environment');var attributes=require(_0x2e55('0x6'));module[_0x2e55('0x7')]=function(_0x46e85f,_0x55d6de){return _0x46e85f[_0x2e55('0x8')]('ZendeskField',attributes,{'tableName':_0x2e55('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x2e55('0xa')],'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 e9067ba..d793739 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 _0xbb20=['ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x3940f7,_0x5e5fef){var _0x572de1=function(_0x3a3848){while(--_0x3a3848){_0x3940f7['push'](_0x3940f7['shift']());}};_0x572de1(++_0x5e5fef);}(_0xbb20,0x8d));var _0x0bb2=function(_0xbf4237,_0x562717){_0xbf4237=_0xbf4237-0x0;var _0x24b797=_0xbb20[_0xbf4237];return _0x24b797;};'use strict';var _=require(_0x0bb2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bb2('0x1'));var db=require(_0x0bb2('0x2'))['db'];var utils=require(_0x0bb2('0x3'));var logger=require(_0x0bb2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0bb2('0x5'));var client=jayson[_0x0bb2('0x6')][_0x0bb2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x539cac,_0x3004a4,_0x1465cb){return new BPromise(function(_0x408155,_0x150016){return client[_0x0bb2('0x8')](_0x539cac,_0x1465cb)[_0x0bb2('0x9')](function(_0x3c6250){logger['info'](_0x0bb2('0xa'),_0x3004a4,_0x0bb2('0xb'));logger['debug'](_0x0bb2('0xc'),_0x3004a4,_0x0bb2('0xb'),JSON[_0x0bb2('0xd')](_0x3c6250));if(_0x3c6250[_0x0bb2('0xe')]){if(_0x3c6250['error']['code']===0x1f4){logger[_0x0bb2('0xe')](_0x0bb2('0xa'),_0x3004a4,_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);return _0x150016(_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);}logger[_0x0bb2('0xe')](_0x0bb2('0xa'),_0x3004a4,_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);return _0x408155(_0x3c6250[_0x0bb2('0xe')][_0x0bb2('0xf')]);}else{logger['info'](_0x0bb2('0xa'),_0x3004a4,'request\x20sent');_0x408155(_0x3c6250[_0x0bb2('0x10')][_0x0bb2('0xf')]);}})['catch'](function(_0x5baace){logger[_0x0bb2('0xe')](_0x0bb2('0xa'),_0x3004a4,_0x5baace);_0x150016(_0x5baace);});});} \ No newline at end of file +var _0xd0b9=['util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x57930d,_0x4f6d25){var _0x263be8=function(_0x72f937){while(--_0x72f937){_0x57930d['push'](_0x57930d['shift']());}};_0x263be8(++_0x4f6d25);}(_0xd0b9,0x19d));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d0b('0x0'));var util=require(_0x9d0b('0x1'));var moment=require(_0x9d0b('0x2'));var BPromise=require(_0x9d0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9d0b('0x4'))(_0x9d0b('0x5'));var config=require(_0x9d0b('0x6'));var jayson=require(_0x9d0b('0x7'));var client=jayson[_0x9d0b('0x8')][_0x9d0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451cce,_0x3d31b4,_0x3117f4){return new BPromise(function(_0x57bd68,_0x1ddd24){return client[_0x9d0b('0xa')](_0x451cce,_0x3117f4)[_0x9d0b('0xb')](function(_0x398223){logger[_0x9d0b('0xc')](_0x9d0b('0xd'),_0x3d31b4,_0x9d0b('0xe'));logger[_0x9d0b('0xf')](_0x9d0b('0x10'),_0x3d31b4,_0x9d0b('0xe'),JSON[_0x9d0b('0x11')](_0x398223));if(_0x398223['error']){if(_0x398223['error'][_0x9d0b('0x12')]===0x1f4){logger[_0x9d0b('0x13')]('ZendeskField,\x20%s,\x20%s',_0x3d31b4,_0x398223[_0x9d0b('0x13')][_0x9d0b('0x14')]);return _0x1ddd24(_0x398223[_0x9d0b('0x13')]['message']);}logger['error'](_0x9d0b('0xd'),_0x3d31b4,_0x398223['error']['message']);return _0x57bd68(_0x398223[_0x9d0b('0x13')]['message']);}else{logger[_0x9d0b('0xc')](_0x9d0b('0xd'),_0x3d31b4,_0x9d0b('0xe'));_0x57bd68(_0x398223[_0x9d0b('0x15')][_0x9d0b('0x14')]);}})[_0x9d0b('0x16')](function(_0x3a4fc4){logger[_0x9d0b('0x13')](_0x9d0b('0xd'),_0x3d31b4,_0x3a4fc4);_0x1ddd24(_0x3a4fc4);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ab7adc8..f78f610 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 _0xb2f6=['/:id/fields','getFields','create','post','addConfiguration','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x93c5d9,_0x398c9f){var _0x372e18=function(_0x8ccfaf){while(--_0x8ccfaf){_0x93c5d9['push'](_0x93c5d9['shift']());}};_0x372e18(++_0x398c9f);}(_0xb2f6,0x179));var _0x6b2f=function(_0x14397d,_0x4186f5){_0x14397d=_0x14397d-0x0;var _0xaad232=_0xb2f6[_0x14397d];return _0xaad232;};'use strict';var multer=require(_0x6b2f('0x0'));var util=require('util');var path=require(_0x6b2f('0x1'));var timeout=require(_0x6b2f('0x2'));var express=require(_0x6b2f('0x3'));var router=express['Router']();var fs_extra=require(_0x6b2f('0x4'));var auth=require(_0x6b2f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b2f('0x6'));router[_0x6b2f('0x7')]('/',auth[_0x6b2f('0x8')](),controller[_0x6b2f('0x9')]);router['get'](_0x6b2f('0xa'),auth[_0x6b2f('0x8')](),controller[_0x6b2f('0xb')]);router[_0x6b2f('0x7')](_0x6b2f('0xc'),auth[_0x6b2f('0x8')](),controller[_0x6b2f('0xd')]);router['get'](_0x6b2f('0xe'),auth[_0x6b2f('0x8')](),controller[_0x6b2f('0xf')]);router['post']('/',auth[_0x6b2f('0x8')](),controller[_0x6b2f('0x10')]);router[_0x6b2f('0x11')]('/:id/configurations',auth[_0x6b2f('0x8')](),controller[_0x6b2f('0x12')]);router[_0x6b2f('0x13')](_0x6b2f('0xa'),auth['isAuthenticated'](),controller[_0x6b2f('0x14')]);router[_0x6b2f('0x15')]('/:id',auth[_0x6b2f('0x8')](),controller['destroy']);module[_0x6b2f('0x16')]=router; \ No newline at end of file +var _0xddf3=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer'];(function(_0x312d2f,_0x4ba8b1){var _0x48204d=function(_0x2fe228){while(--_0x2fe228){_0x312d2f['push'](_0x312d2f['shift']());}};_0x48204d(++_0x4ba8b1);}(_0xddf3,0x107));var _0x3ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ddf('0x0'));var util=require(_0x3ddf('0x1'));var path=require(_0x3ddf('0x2'));var timeout=require(_0x3ddf('0x3'));var express=require(_0x3ddf('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ddf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3ddf('0x6'));var controller=require(_0x3ddf('0x7'));router['get']('/',auth[_0x3ddf('0x8')](),controller[_0x3ddf('0x9')]);router[_0x3ddf('0xa')]('/:id',auth[_0x3ddf('0x8')](),controller[_0x3ddf('0xb')]);router[_0x3ddf('0xa')](_0x3ddf('0xc'),auth[_0x3ddf('0x8')](),controller[_0x3ddf('0xd')]);router[_0x3ddf('0xa')]('/:id/fields',auth[_0x3ddf('0x8')](),controller['getFields']);router[_0x3ddf('0xe')]('/',auth[_0x3ddf('0x8')](),controller['create']);router[_0x3ddf('0xe')](_0x3ddf('0xc'),auth[_0x3ddf('0x8')](),controller[_0x3ddf('0xf')]);router[_0x3ddf('0x10')](_0x3ddf('0x11'),auth[_0x3ddf('0x8')](),controller[_0x3ddf('0x12')]);router[_0x3ddf('0x13')]('/:id',auth[_0x3ddf('0x8')](),controller[_0x3ddf('0x14')]);module[_0x3ddf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index e9965a1..5a36ac1 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41bb=['exports','STRING','sequelize'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x41bb,0xc5));var _0xb41b=function(_0x5f343f,_0x157119){_0x5f343f=_0x5f343f-0x0;var _0x509d92=_0x41bb[_0x5f343f];return _0x509d92;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file +var _0xd64b=['STRING','sequelize'];(function(_0x8d6c64,_0x29e210){var _0x27d9f0=function(_0x1041bd){while(--_0x1041bd){_0x8d6c64['push'](_0x8d6c64['shift']());}};_0x27d9f0(++_0x29e210);}(_0xd64b,0xc1));var _0xbd64=function(_0x10d52b,_0xc6a4f1){_0x10d52b=_0x10d52b-0x0;var _0x2bf44a=_0xd64b[_0x10d52b];return _0x2bf44a;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 59f69ad..95d9eaf 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 _0x2227=['getFields','stringify','send','test','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','catch','show','find','create','body','ZohoConfiguration','order','getConfigurations','addConfiguration','findOne','params','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','host','serverUrl','code','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','error','message','Description','Call_Result','Call_Start_Time','includes','push','display_label','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x36fafd,_0x5bfa3a){var _0x150b3b=function(_0xf2052d){while(--_0xf2052d){_0x36fafd['push'](_0x36fafd['shift']());}};_0x150b3b(++_0x5bfa3a);}(_0x2227,0x18c));var _0x7222=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x2227[_0x29e3b6];return _0x55d4b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7222('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7222('0x1'));var rp=require(_0x7222('0x2'));var moment=require(_0x7222('0x3'));var BPromise=require(_0x7222('0x4'));var Mustache=require(_0x7222('0x5'));var util=require(_0x7222('0x6'));var path=require(_0x7222('0x7'));var sox=require(_0x7222('0x8'));var csv=require('to-csv');var ejs=require(_0x7222('0x9'));var fs=require('fs');var fs_extra=require(_0x7222('0xa'));var _=require('lodash');var squel=require(_0x7222('0xb'));var crypto=require(_0x7222('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7222('0xd'));var toCsv=require(_0x7222('0xe'));var querystring=require(_0x7222('0xf'));var Papa=require(_0x7222('0x10'));var Redis=require(_0x7222('0x11'));var authService=require(_0x7222('0x12'));var qs=require(_0x7222('0x13'));var as=require(_0x7222('0x14'));var hardwareService=require(_0x7222('0x15'));var logger=require(_0x7222('0x16'))(_0x7222('0x17'));var utils=require(_0x7222('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7222('0x19'));var db=require(_0x7222('0x1a'))['db'];var integrations=require(_0x7222('0x1b'));function respondWithStatusCode(_0x327803,_0x26ebfc){_0x26ebfc=_0x26ebfc||0xcc;return function(_0x207ac6){if(_0x207ac6){return _0x327803[_0x7222('0x1c')](_0x26ebfc);}return _0x327803[_0x7222('0x1d')](_0x26ebfc)[_0x7222('0x1e')]();};}function respondWithResult(_0x1668cc,_0x5ad45f){_0x5ad45f=_0x5ad45f||0xc8;return function(_0x1dfa11){if(_0x1dfa11){return _0x1668cc['status'](_0x5ad45f)['json'](_0x1dfa11);}};}function respondWithFilteredResult(_0x5d13ac,_0x46ea17){return function(_0x10181e){if(_0x10181e){var _0x104207=typeof _0x46ea17[_0x7222('0x1f')]===_0x7222('0x20')&&typeof _0x46ea17[_0x7222('0x21')]===_0x7222('0x20');var _0x3c5fab=_0x10181e[_0x7222('0x22')];var _0x547d00=_0x104207?0x0:_0x46ea17['offset'];var _0x5769b2=_0x104207?_0x10181e[_0x7222('0x22')]:_0x46ea17[_0x7222('0x1f')]+_0x46ea17['limit'];var _0x18fb65;if(_0x5769b2>=_0x3c5fab){_0x5769b2=_0x3c5fab;_0x18fb65=0xc8;}else{_0x18fb65=0xce;}_0x5d13ac['status'](_0x18fb65);return _0x5d13ac[_0x7222('0x23')](_0x7222('0x24'),_0x547d00+'-'+_0x5769b2+'/'+_0x3c5fab)[_0x7222('0x25')](_0x10181e);}return null;};}function patchUpdates(_0x351b95){return function(_0x6ec01c){try{jsonpatch[_0x7222('0x26')](_0x6ec01c,_0x351b95,!![]);}catch(_0x5e5365){return BPromise[_0x7222('0x27')](_0x5e5365);}return _0x6ec01c[_0x7222('0x28')]();};}function saveUpdates(_0xee6d87,_0x1b7d24){return function(_0x31f7f9){if(_0x31f7f9){return _0x31f7f9[_0x7222('0x29')](_0xee6d87)[_0x7222('0x2a')](function(_0x9da5e0){return _0x9da5e0;});}return null;};}function removeEntity(_0x53cac4,_0x138982){return function(_0x31db59){if(_0x31db59){return _0x31db59[_0x7222('0x2b')]()[_0x7222('0x2a')](function(){_0x53cac4[_0x7222('0x1d')](0xcc)[_0x7222('0x1e')]();});}};}function handleEntityNotFound(_0x1c191b,_0x2d0791){return function(_0x28a5d1){if(!_0x28a5d1){_0x1c191b[_0x7222('0x1c')](0x194);}return _0x28a5d1;};}function handleError(_0x2ea2d2,_0x4a9d2f){_0x4a9d2f=_0x4a9d2f||0x1f4;return function(_0x5b4136){logger['error'](_0x5b4136['stack']);if(_0x5b4136[_0x7222('0x2c')]){delete _0x5b4136['name'];}_0x2ea2d2[_0x7222('0x1d')](_0x4a9d2f)['send'](_0x5b4136);};}exports['index']=function(_0xa6666a,_0x1d401c){var _0x3e7a32={},_0x56f80c={},_0x1fd908={'count':0x0,'rows':[]};var _0x18342b=_[_0x7222('0x2d')](db['ZohoAccount'][_0x7222('0x2e')],function(_0x435cc9){return{'name':_0x435cc9[_0x7222('0x2f')],'type':_0x435cc9['type'][_0x7222('0x30')]};});_0x56f80c[_0x7222('0x31')]=_['map'](_0x18342b,'name');_0x56f80c[_0x7222('0x32')]=_[_0x7222('0x33')](_0xa6666a['query']);_0x56f80c['filters']=_['intersection'](_0x56f80c['model'],_0x56f80c[_0x7222('0x32')]);_0x3e7a32[_0x7222('0x34')]=_[_0x7222('0x35')](_0x56f80c[_0x7222('0x31')],qs[_0x7222('0x36')](_0xa6666a[_0x7222('0x32')]['fields']));_0x3e7a32['attributes']=_0x3e7a32['attributes'][_0x7222('0x37')]?_0x3e7a32[_0x7222('0x34')]:_0x56f80c[_0x7222('0x31')];if(!_0xa6666a[_0x7222('0x32')][_0x7222('0x38')](_0x7222('0x39'))){_0x3e7a32[_0x7222('0x21')]=qs[_0x7222('0x21')](_0xa6666a['query']['limit']);_0x3e7a32[_0x7222('0x1f')]=qs['offset'](_0xa6666a[_0x7222('0x32')][_0x7222('0x1f')]);}_0x3e7a32['order']=qs[_0x7222('0x3a')](_0xa6666a['query'][_0x7222('0x3a')]);_0x3e7a32[_0x7222('0x3b')]=qs[_0x7222('0x3c')](_[_0x7222('0x3d')](_0xa6666a[_0x7222('0x32')],_0x56f80c['filters']),_0x18342b);if(_0xa6666a[_0x7222('0x32')][_0x7222('0x3e')]){_0x3e7a32['where']=_[_0x7222('0x3f')](_0x3e7a32['where'],{'$or':_[_0x7222('0x2d')](_0x18342b,function(_0x5d4735){if(_0x5d4735[_0x7222('0x40')]!==_0x7222('0x41')){var _0x5e2916={};_0x5e2916[_0x5d4735[_0x7222('0x2c')]]={'$like':'%'+_0xa6666a[_0x7222('0x32')]['filter']+'%'};return _0x5e2916;}})});}_0x3e7a32=_['merge']({},_0x3e7a32,_0xa6666a[_0x7222('0x42')]);var _0x55bdfe={'where':_0x3e7a32[_0x7222('0x3b')]};return db[_0x7222('0x43')][_0x7222('0x22')](_0x55bdfe)[_0x7222('0x2a')](function(_0x444052){_0x1fd908[_0x7222('0x22')]=_0x444052;if(_0xa6666a[_0x7222('0x32')][_0x7222('0x44')]){_0x3e7a32[_0x7222('0x45')]=[{'all':!![]}];}return db[_0x7222('0x43')][_0x7222('0x46')](_0x3e7a32);})[_0x7222('0x2a')](function(_0x40e9c2){_0x1fd908[_0x7222('0x47')]=_0x40e9c2;return _0x1fd908;})[_0x7222('0x2a')](respondWithFilteredResult(_0x1d401c,_0x3e7a32))[_0x7222('0x48')](handleError(_0x1d401c,null));};exports[_0x7222('0x49')]=function(_0xc16849,_0x11304c){var _0x2fb96d={'raw':![],'where':{'id':_0xc16849['params']['id']}},_0x2a7ea2={};_0x2a7ea2[_0x7222('0x31')]=_[_0x7222('0x33')](db[_0x7222('0x43')][_0x7222('0x2e')]);_0x2a7ea2[_0x7222('0x32')]=_[_0x7222('0x33')](_0xc16849[_0x7222('0x32')]);_0x2a7ea2['filters']=_[_0x7222('0x35')](_0x2a7ea2[_0x7222('0x31')],_0x2a7ea2[_0x7222('0x32')]);_0x2fb96d['attributes']=_[_0x7222('0x35')](_0x2a7ea2[_0x7222('0x31')],qs[_0x7222('0x36')](_0xc16849[_0x7222('0x32')][_0x7222('0x36')]));_0x2fb96d[_0x7222('0x34')]=_0x2fb96d[_0x7222('0x34')][_0x7222('0x37')]?_0x2fb96d[_0x7222('0x34')]:_0x2a7ea2['model'];if(_0xc16849[_0x7222('0x32')][_0x7222('0x44')]){_0x2fb96d[_0x7222('0x45')]=[{'all':!![]}];}_0x2fb96d=_['merge']({},_0x2fb96d,_0xc16849['options']);return db['ZohoAccount'][_0x7222('0x4a')](_0x2fb96d)['then'](handleEntityNotFound(_0x11304c,null))['then'](respondWithResult(_0x11304c,null))['catch'](handleError(_0x11304c,null));};exports['create']=function(_0x2bebb6,_0x440430){return db['ZohoAccount'][_0x7222('0x4b')](_0x2bebb6['body'],{})[_0x7222('0x2a')](respondWithResult(_0x440430,0xc9))['catch'](handleError(_0x440430,null));};exports[_0x7222('0x29')]=function(_0x5821aa,_0x229439){if(_0x5821aa[_0x7222('0x4c')]['id']){delete _0x5821aa['body']['id'];}return db[_0x7222('0x43')][_0x7222('0x4a')]({'where':{'id':_0x5821aa['params']['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x229439,null))['then'](saveUpdates(_0x5821aa[_0x7222('0x4c')],null))[_0x7222('0x2a')](respondWithResult(_0x229439,null))[_0x7222('0x48')](handleError(_0x229439,null));};exports[_0x7222('0x2b')]=function(_0x4777fd,_0x462fcc){return db[_0x7222('0x43')][_0x7222('0x4a')]({'where':{'id':_0x4777fd['params']['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x462fcc,null))[_0x7222('0x2a')](removeEntity(_0x462fcc,null))[_0x7222('0x48')](handleError(_0x462fcc,null));};exports['getConfigurations']=function(_0x670a28,_0x4444ff,_0x13acfa){var _0x1a914e={};var _0x5bf7f0={};var _0x1da13d;var _0x3bb8b0;return db['ZohoAccount']['findOne']({'where':{'id':_0x670a28['params']['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x4444ff,null))['then'](function(_0x2d4524){if(_0x2d4524){_0x1da13d=_0x2d4524;_0x5bf7f0['model']=_[_0x7222('0x33')](db[_0x7222('0x4d')]['rawAttributes']);_0x5bf7f0['query']=_[_0x7222('0x33')](_0x670a28[_0x7222('0x32')]);_0x5bf7f0[_0x7222('0x3c')]=_[_0x7222('0x35')](_0x5bf7f0[_0x7222('0x31')],_0x5bf7f0['query']);_0x1a914e['attributes']=_[_0x7222('0x35')](_0x5bf7f0[_0x7222('0x31')],qs[_0x7222('0x36')](_0x670a28[_0x7222('0x32')][_0x7222('0x36')]));_0x1a914e['attributes']=_0x1a914e[_0x7222('0x34')]['length']?_0x1a914e[_0x7222('0x34')]:_0x5bf7f0['model'];_0x1a914e[_0x7222('0x4e')]=qs[_0x7222('0x3a')](_0x670a28[_0x7222('0x32')]['sort']);_0x1a914e[_0x7222('0x3b')]=qs[_0x7222('0x3c')](_[_0x7222('0x3d')](_0x670a28['query'],_0x5bf7f0[_0x7222('0x3c')]));if(_0x670a28[_0x7222('0x32')][_0x7222('0x3e')]){_0x1a914e[_0x7222('0x3b')]=_[_0x7222('0x3f')](_0x1a914e[_0x7222('0x3b')],{'$or':_[_0x7222('0x2d')](_0x1a914e[_0x7222('0x34')],function(_0x33567c){var _0x3dc138={};_0x3dc138[_0x33567c]={'$like':'%'+_0x670a28[_0x7222('0x32')][_0x7222('0x3e')]+'%'};return _0x3dc138;})});}_0x1a914e=_[_0x7222('0x3f')]({},_0x1a914e,_0x670a28[_0x7222('0x42')]);return _0x1da13d[_0x7222('0x4f')](_0x1a914e);}})['then'](function(_0x47a260){if(_0x47a260){_0x3bb8b0=_0x47a260[_0x7222('0x37')];if(!_0x670a28[_0x7222('0x32')][_0x7222('0x38')]('nolimit')){_0x1a914e[_0x7222('0x21')]=qs[_0x7222('0x21')](_0x670a28[_0x7222('0x32')][_0x7222('0x21')]);_0x1a914e[_0x7222('0x1f')]=qs[_0x7222('0x1f')](_0x670a28[_0x7222('0x32')][_0x7222('0x1f')]);}return _0x1da13d['getConfigurations'](_0x1a914e);}})['then'](function(_0x3f5d02){if(_0x3f5d02){return _0x3f5d02?{'count':_0x3bb8b0,'rows':_0x3f5d02}:null;}})[_0x7222('0x2a')](respondWithResult(_0x4444ff,null))[_0x7222('0x48')](handleError(_0x4444ff,null));};exports[_0x7222('0x50')]=function(_0x206b54,_0x35bd9b,_0x1a9860){if(_0x206b54['body']['id']){delete _0x206b54[_0x7222('0x4c')]['id'];}return db[_0x7222('0x43')][_0x7222('0x51')]({'where':{'id':_0x206b54[_0x7222('0x52')]['id']}})[_0x7222('0x2a')](handleEntityNotFound(_0x35bd9b,null))[_0x7222('0x2a')](function(_0x3cf2eb){if(_0x3cf2eb){_0x206b54[_0x7222('0x4c')][_0x7222('0x53')]=_0x3cf2eb['id'];_0x206b54[_0x7222('0x4c')][_0x7222('0x54')]=integrations['getSubjects'](_0x206b54['body']['channel'],_0x206b54[_0x7222('0x4c')][_0x7222('0x40')]);_0x206b54[_0x7222('0x4c')][_0x7222('0x55')]=integrations[_0x7222('0x56')](_0x206b54[_0x7222('0x4c')][_0x7222('0x57')],_0x206b54['body'][_0x7222('0x40')]);return db[_0x7222('0x4d')][_0x7222('0x4b')](_0x206b54[_0x7222('0x4c')],{'include':[{'model':db[_0x7222('0x58')],'as':_0x7222('0x54')},{'model':db[_0x7222('0x58')],'as':_0x7222('0x55')}]});}return null;})[_0x7222('0x2a')](respondWithResult(_0x35bd9b,null))['catch'](handleError(_0x35bd9b,null));};function getAccessToken(_0x28db60){return new Promise(function(_0x135a47,_0x5f8451){var _0x258bab;switch(_0x28db60[_0x7222('0x59')]){case'US':_0x258bab=_0x7222('0x5a');break;case'AU':_0x258bab=_0x7222('0x5b');break;case'EU':_0x258bab=_0x7222('0x5c');break;case'IN':_0x258bab='https://accounts.zoho.in';break;case'CN':_0x258bab=_0x7222('0x5d');break;default:_0x258bab='https://accounts.zoho.eu';break;}var _0xef364e={'method':_0x7222('0x5e'),'uri':_0x258bab+'/oauth/v2/token','qs':{'refresh_token':_0x28db60[_0x7222('0x5f')],'client_id':_0x28db60[_0x7222('0x60')],'client_secret':_0x28db60[_0x7222('0x61')],'grant_type':_0x7222('0x62')},'json':!![]};return rp(_0xef364e)['then'](function(_0x49b14c){if(_0x49b14c[_0x7222('0x63')]){_0x135a47(_0x49b14c[_0x7222('0x63')]);}else{_0x5f8451('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x7222('0x48')](function(_0x187229){_0x5f8451(_0x187229);});});}exports['getFields']=function(_0xd0b9ad,_0x16b19e,_0xad000a){var _0x54023a,_0x247036,_0xb270f9,_0x47afcb,_0x5b01d9;return db[_0x7222('0x43')]['findOne']({'where':{'id':_0xd0b9ad[_0x7222('0x52')]['id']},'attributes':['id',_0x7222('0x64'),_0x7222('0x59'),_0x7222('0x60'),_0x7222('0x61'),_0x7222('0x65'),_0x7222('0x66'),'refreshToken']})['then'](handleEntityNotFound(_0x16b19e,null))[_0x7222('0x2a')](function(_0x1a0b6e){_0x5b01d9=_0x1a0b6e;_0x54023a=_0x5b01d9['host'];_0x247036=_0x54023a==='zoho.eu'?'eu':_0x7222('0x67');_0xb270f9=_0x5b01d9[_0x7222('0x65')];var _0x5531ed=_0xb270f9[_0x7222('0x68')](-0x1);if(_0x5531ed==='/'||_0x5531ed==='\x5c'||_0x5531ed===':'){_0xb270f9=_0xb270f9[_0x7222('0x69')](0x0,_0xb270f9['lastIndexOf'](_0x5531ed));}if(!_0x5b01d9[_0x7222('0x5f')]){throw new Error(_0x7222('0x6a'));}return getAccessToken(_0x5b01d9);})['then'](function(_0x361d53){if(_0x361d53){return rp({'method':'GET','uri':util[_0x7222('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x247036),'qs':{'module':_0x7222('0x6c')},'headers':{'Authorization':_0x7222('0x6d')+_0x361d53},'json':!![]});}})[_0x7222('0x2a')](function(_0x256945){if(_0x256945){if(_0x256945[_0x7222('0x6e')]&&_0x256945[_0x7222('0x6e')]['error']){throw new Error(_0x256945[_0x7222('0x6e')][_0x7222('0x6f')][_0x7222('0x70')]);}var _0x2ef3c5=[];var _0x5d9750=[];var _0xec8883=['Owner','Subject',_0x7222('0x71'),'WhoId','Call_Duration',_0x7222('0x72'),_0x7222('0x73'),'Call_Type'];_0x5d9750=_['remove'](_0x256945[_0x7222('0x36')],function(_0x3babca){return _0xec8883[_0x7222('0x74')](_0x3babca['api_name']);});for(var _0x481485=0x0;_0x481485<_0x5d9750[_0x7222('0x37')];_0x481485++){if(_0x5d9750[_0x481485]['system_mandatory']===![]){_0x2ef3c5[_0x7222('0x75')]({'id':_0x5d9750[_0x481485]['id'],'name':_0x5d9750[_0x481485][_0x7222('0x76')],'custom':_0x5d9750[_0x481485][_0x7222('0x77')],'options':_0x5d9750[_0x481485][_0x7222('0x78')]===_0x7222('0x79')&&_0x5d9750[_0x481485]['pick_list_values'][_0x7222('0x37')]>-0x1?_[_0x7222('0x2d')](_0x5d9750[_0x481485][_0x7222('0x7a')],function(_0x4c02f2){return{'name':_0x4c02f2,'value':_0x4c02f2};}):[]});}}return{'count':_0x2ef3c5['length'],'rows':_0x2ef3c5};}else{return{'count':0x0,'rows':[]};}})[_0x7222('0x2a')](respondWithResult(_0x16b19e,null))[_0x7222('0x48')](function(_0x313202){var _0x7b0f12=_0xd0b9ad[_0x7222('0x32')]['test']?0x1f4:_0x313202['statusCode']||0x1f4;logger[_0x7222('0x6f')](_0x7222('0x7b'),_0x7222('0x7c'),_0x7b0f12,JSON[_0x7222('0x7d')](_0x313202));delete _0x313202['name'];if(_0x7b0f12===0x191){_0x7b0f12=0x190;}_0x16b19e[_0x7222('0x1d')](_0x7b0f12)[_0x7222('0x7e')](_0xd0b9ad[_0x7222('0x32')][_0x7222('0x7f')]?{'message':_0x7222('0x80'),'statusCode':_0x313202[_0x7222('0x81')]}:_0x313202);});}; \ No newline at end of file +var _0xcef2=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoConfiguration','ZohoField','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','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','findOne','host','serverUrl','code','refreshToken','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','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','api_name','system_mandatory','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query'];(function(_0x218c0c,_0x2b21e3){var _0xf0347d=function(_0xb3b51c){while(--_0xb3b51c){_0x218c0c['push'](_0x218c0c['shift']());}};_0xf0347d(++_0x2b21e3);}(_0xcef2,0x153));var _0x2cef=function(_0x59bee2,_0xab2f75){_0x59bee2=_0x59bee2-0x0;var _0x445c80=_0xcef2[_0x59bee2];return _0x445c80;};'use strict';var emlformat=require(_0x2cef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cef('0x1'));var jsonpatch=require(_0x2cef('0x2'));var rp=require(_0x2cef('0x3'));var moment=require(_0x2cef('0x4'));var BPromise=require(_0x2cef('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2cef('0x6'));var sox=require(_0x2cef('0x7'));var csv=require(_0x2cef('0x8'));var ejs=require(_0x2cef('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cef('0xa'));var squel=require('squel');var crypto=require(_0x2cef('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2cef('0xc'));var toCsv=require(_0x2cef('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2cef('0xd'));var authService=require(_0x2cef('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2cef('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cef('0x10'))(_0x2cef('0x11'));var utils=require(_0x2cef('0x12'));var config=require(_0x2cef('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2cef('0x14'))['db'];var integrations=require(_0x2cef('0x15'));function respondWithStatusCode(_0x5b8c9e,_0x3aaee6){_0x3aaee6=_0x3aaee6||0xcc;return function(_0x158c43){if(_0x158c43){return _0x5b8c9e[_0x2cef('0x16')](_0x3aaee6);}return _0x5b8c9e[_0x2cef('0x17')](_0x3aaee6)[_0x2cef('0x18')]();};}function respondWithResult(_0x25b9e3,_0x50ce26){_0x50ce26=_0x50ce26||0xc8;return function(_0x29ea6b){if(_0x29ea6b){return _0x25b9e3[_0x2cef('0x17')](_0x50ce26)[_0x2cef('0x19')](_0x29ea6b);}};}function respondWithFilteredResult(_0x455592,_0x553b3e){return function(_0x3f78d9){if(_0x3f78d9){var _0x46676b=typeof _0x553b3e['offset']===_0x2cef('0x1a')&&typeof _0x553b3e[_0x2cef('0x1b')]===_0x2cef('0x1a');var _0x1d3fe7=_0x3f78d9[_0x2cef('0x1c')];var _0x22dc51=_0x46676b?0x0:_0x553b3e['offset'];var _0x1a4c20=_0x46676b?_0x3f78d9[_0x2cef('0x1c')]:_0x553b3e['offset']+_0x553b3e['limit'];var _0x5bb595;if(_0x1a4c20>=_0x1d3fe7){_0x1a4c20=_0x1d3fe7;_0x5bb595=0xc8;}else{_0x5bb595=0xce;}_0x455592['status'](_0x5bb595);return _0x455592[_0x2cef('0x1d')](_0x2cef('0x1e'),_0x22dc51+'-'+_0x1a4c20+'/'+_0x1d3fe7)[_0x2cef('0x19')](_0x3f78d9);}return null;};}function patchUpdates(_0x1442c4){return function(_0x1ed28f){try{jsonpatch[_0x2cef('0x1f')](_0x1ed28f,_0x1442c4,!![]);}catch(_0x30c288){return BPromise['reject'](_0x30c288);}return _0x1ed28f[_0x2cef('0x20')]();};}function saveUpdates(_0x2e5c6a,_0x11d596){return function(_0x2bf26f){if(_0x2bf26f){return _0x2bf26f[_0x2cef('0x21')](_0x2e5c6a)[_0x2cef('0x22')](function(_0xf214f0){return _0xf214f0;});}return null;};}function removeEntity(_0x2f51c1,_0xcb020c){return function(_0x55ff5c){if(_0x55ff5c){return _0x55ff5c['destroy']()['then'](function(){_0x2f51c1[_0x2cef('0x17')](0xcc)[_0x2cef('0x18')]();});}};}function handleEntityNotFound(_0x2c43dd,_0x4ff8b4){return function(_0x4ea28e){if(!_0x4ea28e){_0x2c43dd[_0x2cef('0x16')](0x194);}return _0x4ea28e;};}function handleError(_0x4068e9,_0x2f6a25){_0x2f6a25=_0x2f6a25||0x1f4;return function(_0x226b9e){logger[_0x2cef('0x23')](_0x226b9e['stack']);if(_0x226b9e['name']){delete _0x226b9e[_0x2cef('0x24')];}_0x4068e9['status'](_0x2f6a25)['send'](_0x226b9e);};}exports[_0x2cef('0x25')]=function(_0xab4949,_0x508227){var _0x482099={},_0x2f67d4={},_0x20020d={'count':0x0,'rows':[]};var _0x4f90ec=_[_0x2cef('0x26')](db[_0x2cef('0x27')][_0x2cef('0x28')],function(_0x5ee873){return{'name':_0x5ee873[_0x2cef('0x29')],'type':_0x5ee873['type'][_0x2cef('0x2a')]};});_0x2f67d4[_0x2cef('0x2b')]=_[_0x2cef('0x26')](_0x4f90ec,_0x2cef('0x24'));_0x2f67d4[_0x2cef('0x2c')]=_[_0x2cef('0x2d')](_0xab4949['query']);_0x2f67d4[_0x2cef('0x2e')]=_[_0x2cef('0x2f')](_0x2f67d4[_0x2cef('0x2b')],_0x2f67d4['query']);_0x482099[_0x2cef('0x30')]=_[_0x2cef('0x2f')](_0x2f67d4['model'],qs[_0x2cef('0x31')](_0xab4949['query'][_0x2cef('0x31')]));_0x482099[_0x2cef('0x30')]=_0x482099[_0x2cef('0x30')][_0x2cef('0x32')]?_0x482099[_0x2cef('0x30')]:_0x2f67d4[_0x2cef('0x2b')];if(!_0xab4949[_0x2cef('0x2c')][_0x2cef('0x33')](_0x2cef('0x34'))){_0x482099[_0x2cef('0x1b')]=qs['limit'](_0xab4949[_0x2cef('0x2c')][_0x2cef('0x1b')]);_0x482099[_0x2cef('0x35')]=qs[_0x2cef('0x35')](_0xab4949[_0x2cef('0x2c')][_0x2cef('0x35')]);}_0x482099[_0x2cef('0x36')]=qs[_0x2cef('0x37')](_0xab4949['query'][_0x2cef('0x37')]);_0x482099[_0x2cef('0x38')]=qs[_0x2cef('0x2e')](_[_0x2cef('0x39')](_0xab4949['query'],_0x2f67d4['filters']),_0x4f90ec);if(_0xab4949[_0x2cef('0x2c')]['filter']){_0x482099[_0x2cef('0x38')]=_[_0x2cef('0x3a')](_0x482099[_0x2cef('0x38')],{'$or':_[_0x2cef('0x26')](_0x4f90ec,function(_0x5f503c){if(_0x5f503c[_0x2cef('0x3b')]!==_0x2cef('0x3c')){var _0x57cb4a={};_0x57cb4a[_0x5f503c[_0x2cef('0x24')]]={'$like':'%'+_0xab4949[_0x2cef('0x2c')][_0x2cef('0x3d')]+'%'};return _0x57cb4a;}})});}_0x482099=_['merge']({},_0x482099,_0xab4949[_0x2cef('0x3e')]);var _0x3df015={'where':_0x482099['where']};return db[_0x2cef('0x27')][_0x2cef('0x1c')](_0x3df015)[_0x2cef('0x22')](function(_0x2f8cd4){_0x20020d[_0x2cef('0x1c')]=_0x2f8cd4;if(_0xab4949[_0x2cef('0x2c')][_0x2cef('0x3f')]){_0x482099['include']=[{'all':!![]}];}return db[_0x2cef('0x27')]['findAll'](_0x482099);})[_0x2cef('0x22')](function(_0x34fcb4){_0x20020d[_0x2cef('0x40')]=_0x34fcb4;return _0x20020d;})[_0x2cef('0x22')](respondWithFilteredResult(_0x508227,_0x482099))[_0x2cef('0x41')](handleError(_0x508227,null));};exports[_0x2cef('0x42')]=function(_0x28679b,_0x1a50ad){var _0x26c620={'raw':![],'where':{'id':_0x28679b[_0x2cef('0x43')]['id']}},_0x7b794c={};_0x7b794c[_0x2cef('0x2b')]=_[_0x2cef('0x2d')](db[_0x2cef('0x27')][_0x2cef('0x28')]);_0x7b794c['query']=_[_0x2cef('0x2d')](_0x28679b[_0x2cef('0x2c')]);_0x7b794c[_0x2cef('0x2e')]=_[_0x2cef('0x2f')](_0x7b794c[_0x2cef('0x2b')],_0x7b794c[_0x2cef('0x2c')]);_0x26c620[_0x2cef('0x30')]=_[_0x2cef('0x2f')](_0x7b794c[_0x2cef('0x2b')],qs[_0x2cef('0x31')](_0x28679b[_0x2cef('0x2c')][_0x2cef('0x31')]));_0x26c620[_0x2cef('0x30')]=_0x26c620[_0x2cef('0x30')][_0x2cef('0x32')]?_0x26c620[_0x2cef('0x30')]:_0x7b794c[_0x2cef('0x2b')];if(_0x28679b[_0x2cef('0x2c')][_0x2cef('0x3f')]){_0x26c620[_0x2cef('0x44')]=[{'all':!![]}];}_0x26c620=_[_0x2cef('0x3a')]({},_0x26c620,_0x28679b['options']);return db[_0x2cef('0x27')][_0x2cef('0x45')](_0x26c620)[_0x2cef('0x22')](handleEntityNotFound(_0x1a50ad,null))[_0x2cef('0x22')](respondWithResult(_0x1a50ad,null))[_0x2cef('0x41')](handleError(_0x1a50ad,null));};exports[_0x2cef('0x46')]=function(_0x121456,_0x1417bb){return db[_0x2cef('0x27')][_0x2cef('0x46')](_0x121456['body'],{})[_0x2cef('0x22')](respondWithResult(_0x1417bb,0xc9))[_0x2cef('0x41')](handleError(_0x1417bb,null));};exports['update']=function(_0x33082b,_0x40164c){if(_0x33082b[_0x2cef('0x47')]['id']){delete _0x33082b['body']['id'];}return db[_0x2cef('0x27')][_0x2cef('0x45')]({'where':{'id':_0x33082b[_0x2cef('0x43')]['id']}})['then'](handleEntityNotFound(_0x40164c,null))['then'](saveUpdates(_0x33082b[_0x2cef('0x47')],null))[_0x2cef('0x22')](respondWithResult(_0x40164c,null))[_0x2cef('0x41')](handleError(_0x40164c,null));};exports[_0x2cef('0x48')]=function(_0x3df1eb,_0x32621b){return db['ZohoAccount'][_0x2cef('0x45')]({'where':{'id':_0x3df1eb[_0x2cef('0x43')]['id']}})[_0x2cef('0x22')](handleEntityNotFound(_0x32621b,null))[_0x2cef('0x22')](removeEntity(_0x32621b,null))['catch'](handleError(_0x32621b,null));};exports['getConfigurations']=function(_0x2b2fe7,_0x2cbd1e,_0x53b1eb){var _0x138213={};var _0x100b13={};var _0x343e0c;var _0x57c737;return db[_0x2cef('0x27')]['findOne']({'where':{'id':_0x2b2fe7['params']['id']}})[_0x2cef('0x22')](handleEntityNotFound(_0x2cbd1e,null))['then'](function(_0x42aa0c){if(_0x42aa0c){_0x343e0c=_0x42aa0c;_0x100b13[_0x2cef('0x2b')]=_[_0x2cef('0x2d')](db['ZohoConfiguration'][_0x2cef('0x28')]);_0x100b13[_0x2cef('0x2c')]=_[_0x2cef('0x2d')](_0x2b2fe7[_0x2cef('0x2c')]);_0x100b13[_0x2cef('0x2e')]=_['intersection'](_0x100b13['model'],_0x100b13['query']);_0x138213['attributes']=_[_0x2cef('0x2f')](_0x100b13[_0x2cef('0x2b')],qs[_0x2cef('0x31')](_0x2b2fe7['query']['fields']));_0x138213[_0x2cef('0x30')]=_0x138213[_0x2cef('0x30')]['length']?_0x138213[_0x2cef('0x30')]:_0x100b13[_0x2cef('0x2b')];_0x138213['order']=qs['sort'](_0x2b2fe7[_0x2cef('0x2c')]['sort']);_0x138213[_0x2cef('0x38')]=qs[_0x2cef('0x2e')](_[_0x2cef('0x39')](_0x2b2fe7[_0x2cef('0x2c')],_0x100b13[_0x2cef('0x2e')]));if(_0x2b2fe7['query'][_0x2cef('0x3d')]){_0x138213[_0x2cef('0x38')]=_['merge'](_0x138213['where'],{'$or':_['map'](_0x138213[_0x2cef('0x30')],function(_0x40922a){var _0x2305bf={};_0x2305bf[_0x40922a]={'$like':'%'+_0x2b2fe7[_0x2cef('0x2c')][_0x2cef('0x3d')]+'%'};return _0x2305bf;})});}_0x138213=_[_0x2cef('0x3a')]({},_0x138213,_0x2b2fe7[_0x2cef('0x3e')]);return _0x343e0c[_0x2cef('0x49')](_0x138213);}})[_0x2cef('0x22')](function(_0x1f2d44){if(_0x1f2d44){_0x57c737=_0x1f2d44['length'];if(!_0x2b2fe7[_0x2cef('0x2c')][_0x2cef('0x33')](_0x2cef('0x34'))){_0x138213[_0x2cef('0x1b')]=qs[_0x2cef('0x1b')](_0x2b2fe7[_0x2cef('0x2c')][_0x2cef('0x1b')]);_0x138213['offset']=qs[_0x2cef('0x35')](_0x2b2fe7[_0x2cef('0x2c')][_0x2cef('0x35')]);}return _0x343e0c['getConfigurations'](_0x138213);}})['then'](function(_0x1d87c9){if(_0x1d87c9){return _0x1d87c9?{'count':_0x57c737,'rows':_0x1d87c9}:null;}})['then'](respondWithResult(_0x2cbd1e,null))[_0x2cef('0x41')](handleError(_0x2cbd1e,null));};exports[_0x2cef('0x4a')]=function(_0x4a6e15,_0x2fb66f,_0x2bb286){if(_0x4a6e15['body']['id']){delete _0x4a6e15[_0x2cef('0x47')]['id'];}return db[_0x2cef('0x27')]['findOne']({'where':{'id':_0x4a6e15[_0x2cef('0x43')]['id']}})[_0x2cef('0x22')](handleEntityNotFound(_0x2fb66f,null))['then'](function(_0x1aa5d2){if(_0x1aa5d2){_0x4a6e15[_0x2cef('0x47')][_0x2cef('0x4b')]=_0x1aa5d2['id'];_0x4a6e15[_0x2cef('0x47')][_0x2cef('0x4c')]=integrations[_0x2cef('0x4d')](_0x4a6e15[_0x2cef('0x47')][_0x2cef('0x4e')],_0x4a6e15[_0x2cef('0x47')][_0x2cef('0x3b')]);_0x4a6e15[_0x2cef('0x47')][_0x2cef('0x4f')]=integrations['getDescriptions'](_0x4a6e15[_0x2cef('0x47')][_0x2cef('0x4e')],_0x4a6e15[_0x2cef('0x47')][_0x2cef('0x3b')]);return db[_0x2cef('0x50')][_0x2cef('0x46')](_0x4a6e15[_0x2cef('0x47')],{'include':[{'model':db[_0x2cef('0x51')],'as':_0x2cef('0x4c')},{'model':db['ZohoField'],'as':_0x2cef('0x4f')}]});}return null;})[_0x2cef('0x22')](respondWithResult(_0x2fb66f,null))[_0x2cef('0x41')](handleError(_0x2fb66f,null));};function getAccessToken(_0x3b5837){return new Promise(function(_0x442adf,_0x1c1d12){var _0x5c86fe;switch(_0x3b5837[_0x2cef('0x52')]){case'US':_0x5c86fe=_0x2cef('0x53');break;case'AU':_0x5c86fe=_0x2cef('0x54');break;case'EU':_0x5c86fe='https://accounts.zoho.eu';break;case'IN':_0x5c86fe=_0x2cef('0x55');break;case'CN':_0x5c86fe=_0x2cef('0x56');break;default:_0x5c86fe=_0x2cef('0x57');break;}var _0x1ff983={'method':'POST','uri':_0x5c86fe+_0x2cef('0x58'),'qs':{'refresh_token':_0x3b5837['refreshToken'],'client_id':_0x3b5837[_0x2cef('0x59')],'client_secret':_0x3b5837[_0x2cef('0x5a')],'grant_type':_0x2cef('0x5b')},'json':!![]};return rp(_0x1ff983)[_0x2cef('0x22')](function(_0x2a1bb3){if(_0x2a1bb3[_0x2cef('0x5c')]){_0x442adf(_0x2a1bb3[_0x2cef('0x5c')]);}else{_0x1c1d12(_0x2cef('0x5d'));}})['catch'](function(_0x17aec7){_0x1c1d12(_0x17aec7);});});}exports[_0x2cef('0x5e')]=function(_0x37ad8d,_0x1ce97a,_0x1a03ae){var _0x4e2b0e,_0x31c751,_0x8d5dd9,_0x36446e,_0x17852b;return db[_0x2cef('0x27')][_0x2cef('0x5f')]({'where':{'id':_0x37ad8d['params']['id']},'attributes':['id',_0x2cef('0x60'),_0x2cef('0x52'),_0x2cef('0x59'),_0x2cef('0x5a'),_0x2cef('0x61'),_0x2cef('0x62'),_0x2cef('0x63')]})[_0x2cef('0x22')](handleEntityNotFound(_0x1ce97a,null))['then'](function(_0x453a79){_0x17852b=_0x453a79;_0x4e2b0e=_0x17852b[_0x2cef('0x60')];_0x31c751=_0x4e2b0e==='zoho.eu'?'eu':'com';_0x8d5dd9=_0x17852b[_0x2cef('0x61')];var _0x3328d8=_0x8d5dd9[_0x2cef('0x64')](-0x1);if(_0x3328d8==='/'||_0x3328d8==='\x5c'||_0x3328d8===':'){_0x8d5dd9=_0x8d5dd9[_0x2cef('0x65')](0x0,_0x8d5dd9[_0x2cef('0x66')](_0x3328d8));}if(!_0x17852b[_0x2cef('0x63')]){throw new Error(_0x2cef('0x67'));}return getAccessToken(_0x17852b);})['then'](function(_0x398238){if(_0x398238){return rp({'method':'GET','uri':util['format'](_0x2cef('0x68'),_0x31c751),'qs':{'module':_0x2cef('0x69')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x398238},'json':!![]});}})[_0x2cef('0x22')](function(_0x7b5a73){if(_0x7b5a73){if(_0x7b5a73[_0x2cef('0x6a')]&&_0x7b5a73['response'][_0x2cef('0x23')]){throw new Error(_0x7b5a73[_0x2cef('0x6a')][_0x2cef('0x23')][_0x2cef('0x6b')]);}var _0x30d954=[];var _0x1d6bb1=[];var _0x413906=[_0x2cef('0x6c'),_0x2cef('0x6d'),_0x2cef('0x6e'),_0x2cef('0x6f'),_0x2cef('0x70'),_0x2cef('0x71'),_0x2cef('0x72'),_0x2cef('0x73')];_0x1d6bb1=_[_0x2cef('0x74')](_0x7b5a73[_0x2cef('0x31')],function(_0x6ddfc0){return _0x413906[_0x2cef('0x75')](_0x6ddfc0[_0x2cef('0x76')]);});for(var _0x5118ed=0x0;_0x5118ed<_0x1d6bb1['length'];_0x5118ed++){if(_0x1d6bb1[_0x5118ed][_0x2cef('0x77')]===![]){_0x30d954['push']({'id':_0x1d6bb1[_0x5118ed]['id'],'name':_0x1d6bb1[_0x5118ed][_0x2cef('0x78')],'custom':_0x1d6bb1[_0x5118ed][_0x2cef('0x79')],'options':_0x1d6bb1[_0x5118ed][_0x2cef('0x7a')]==='picklist'&&_0x1d6bb1[_0x5118ed][_0x2cef('0x7b')][_0x2cef('0x32')]>-0x1?_[_0x2cef('0x26')](_0x1d6bb1[_0x5118ed]['pick_list_values'],function(_0x1d4211){return{'name':_0x1d4211,'value':_0x1d4211};}):[]});}}return{'count':_0x30d954['length'],'rows':_0x30d954};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x1ce97a,null))[_0x2cef('0x41')](function(_0x168b4f){var _0xf28236=_0x37ad8d[_0x2cef('0x2c')][_0x2cef('0x7c')]?0x1f4:_0x168b4f[_0x2cef('0x7d')]||0x1f4;logger['error'](_0x2cef('0x7e'),_0x2cef('0x5e'),_0xf28236,JSON[_0x2cef('0x7f')](_0x168b4f));delete _0x168b4f[_0x2cef('0x24')];if(_0xf28236===0x191){_0xf28236=0x190;}_0x1ce97a[_0x2cef('0x17')](_0xf28236)['send'](_0x37ad8d[_0x2cef('0x2c')][_0x2cef('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x168b4f['statusCode']}:_0x168b4f);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f95485f..540539e 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 _0xcb68=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.com.au','application/x-www-form-urlencoded','then','refreshToken','format','lodash','util'];(function(_0x40895,_0x31a64e){var _0x116ad7=function(_0x4a9537){while(--_0x4a9537){_0x40895['push'](_0x40895['shift']());}};_0x116ad7(++_0x31a64e);}(_0xcb68,0x1c0));var _0x8cb6=function(_0x1f41e7,_0x220791){_0x1f41e7=_0x1f41e7-0x0;var _0xa471ca=_0xcb68[_0x1f41e7];return _0xa471ca;};'use strict';var _=require(_0x8cb6('0x0'));var util=require(_0x8cb6('0x1'));var logger=require(_0x8cb6('0x2'))(_0x8cb6('0x3'));var moment=require(_0x8cb6('0x4'));var BPromise=require('bluebird');var rp=require(_0x8cb6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cb6('0x6'));var config=require(_0x8cb6('0x7'));var attributes=require(_0x8cb6('0x8'));var integrations=require(_0x8cb6('0x9'));module[_0x8cb6('0xa')]=function(_0x2e4a23,_0x41c5ad){return _0x2e4a23[_0x8cb6('0xb')](_0x8cb6('0xc'),attributes,{'tableName':_0x8cb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d2bac,_0x22d351,_0x45ba8f){if(_0x3d2bac[_0x8cb6('0xe')](_0x8cb6('0xf'))||_0x3d2bac['changed'](_0x8cb6('0x10'))||_0x3d2bac[_0x8cb6('0xe')](_0x8cb6('0x11'))||_0x3d2bac[_0x8cb6('0xe')]('clientSecret')||_0x3d2bac[_0x8cb6('0xe')](_0x8cb6('0x12'))||_0x3d2bac['changed'](_0x8cb6('0x13'))){var _0xc82884,_0x1314b6;_0xc82884=_0x3d2bac[_0x8cb6('0x10')];var _0x506dbe=_0xc82884[_0x8cb6('0x14')](-0x1);if(_0x506dbe==='/'||_0x506dbe==='\x5c'||_0x506dbe===':'){_0xc82884=_0xc82884['substring'](0x0,_0xc82884[_0x8cb6('0x15')](_0x506dbe));}switch(_0x3d2bac['zone']){case'US':_0x1314b6=_0x8cb6('0x16');break;case'AU':_0x1314b6='https://accounts.zoho.com.au';break;case'IN':_0x1314b6=_0x8cb6('0x17');break;case'CN':_0x1314b6=_0x8cb6('0x18');break;default:_0x1314b6=_0x8cb6('0x19');break;}var _0x275754={'method':_0x8cb6('0x1a'),'uri':_0x1314b6+_0x8cb6('0x1b'),'form':{'grant_type':_0x8cb6('0x1c'),'client_id':_0x3d2bac[_0x8cb6('0x11')],'client_secret':_0x3d2bac[_0x8cb6('0x1d')],'redirect_uri':_0x3d2bac[_0x8cb6('0x10')],'code':_0x3d2bac[_0x8cb6('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x275754)['then'](function(_0x263bea){var _0x4b4346=JSON[_0x8cb6('0x1e')](_0x263bea);if(_0x4b4346[_0x8cb6('0x1f')]){_0x3d2bac['refreshToken']=_0x4b4346[_0x8cb6('0x1f')];logger[_0x8cb6('0x20')](util['format'](_0x8cb6('0x21'),_0x3d2bac[_0x8cb6('0x22')],_0x3d2bac['id']));}else{logger[_0x8cb6('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3d2bac[_0x8cb6('0x22')],_0x3d2bac['id']),util[_0x8cb6('0x24')](_0x4b4346,{'showHidden':![],'depth':null}));}return _0x45ba8f(null,_0x22d351);})[_0x8cb6('0x25')](function(_0x57e651){logger[_0x8cb6('0x23')](util['format'](_0x8cb6('0x26'),_0x3d2bac[_0x8cb6('0x22')],_0x3d2bac['id']),util[_0x8cb6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x45ba8f(_0x57e651);});}else{return _0x45ba8f(null,_0x22d351);}},'beforeUpdate':function(_0x597525,_0x4257e7,_0xcd1e7b){if(_0x597525['changed'](_0x8cb6('0xf'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x10'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x11'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x1d'))||_0x597525['changed'](_0x8cb6('0x12'))||_0x597525[_0x8cb6('0xe')](_0x8cb6('0x13'))){var _0x5d69c9,_0x42db93;_0x5d69c9=_0x597525[_0x8cb6('0x10')];var _0x5508f6=_0x5d69c9[_0x8cb6('0x14')](-0x1);if(_0x5508f6==='/'||_0x5508f6==='\x5c'||_0x5508f6===':'){_0x5d69c9=_0x5d69c9[_0x8cb6('0x27')](0x0,_0x5d69c9[_0x8cb6('0x15')](_0x5508f6));}switch(_0x597525['zone']){case'US':_0x42db93=_0x8cb6('0x16');break;case'AU':_0x42db93=_0x8cb6('0x28');break;case'IN':_0x42db93='https://accounts.zoho.in';break;case'CN':_0x42db93='https://accounts.zoho.com.cn';break;default:_0x42db93=_0x8cb6('0x19');break;}var _0xcf76a3={'method':'POST','uri':_0x42db93+_0x8cb6('0x1b'),'form':{'grant_type':_0x8cb6('0x1c'),'client_id':_0x597525[_0x8cb6('0x11')],'client_secret':_0x597525['clientSecret'],'redirect_uri':_0x597525['serverUrl'],'code':_0x597525[_0x8cb6('0x12')]},'headers':{'Content-Type':_0x8cb6('0x29')}};return rp(_0xcf76a3)[_0x8cb6('0x2a')](function(_0x7b679c){var _0x4dcf3f=JSON[_0x8cb6('0x1e')](_0x7b679c);if(_0x4dcf3f[_0x8cb6('0x1f')]){_0x597525[_0x8cb6('0x2b')]=_0x4dcf3f[_0x8cb6('0x1f')];logger[_0x8cb6('0x20')](util[_0x8cb6('0x2c')](_0x8cb6('0x21'),_0x597525['name'],_0x597525['id']));}else{logger[_0x8cb6('0x23')](util[_0x8cb6('0x2c')](_0x8cb6('0x26'),_0x597525['name'],_0x597525['id']),util[_0x8cb6('0x24')](_0x4dcf3f,{'showHidden':![],'depth':null}));}return _0xcd1e7b(null,_0x4257e7);})[_0x8cb6('0x25')](function(_0x30f752){logger['error'](util[_0x8cb6('0x2c')](_0x8cb6('0x26'),_0x597525[_0x8cb6('0x22')],_0x597525['id']),util[_0x8cb6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0xcd1e7b(_0x30f752);});}else{return _0xcd1e7b(null,_0x4257e7);}}}});}; \ No newline at end of file +var _0xf63a=['request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.eu','error','util','../../config/logger','moment'];(function(_0x4a5ff5,_0x4ee65b){var _0x5c464f=function(_0xadcc79){while(--_0xadcc79){_0x4a5ff5['push'](_0x4a5ff5['shift']());}};_0x5c464f(++_0x4ee65b);}(_0xf63a,0x9d));var _0xaf63=function(_0x56f55b,_0x1c02aa){_0x56f55b=_0x56f55b-0x0;var _0x232941=_0xf63a[_0x56f55b];return _0x232941;};'use strict';var _=require('lodash');var util=require(_0xaf63('0x0'));var logger=require(_0xaf63('0x1'))('api');var moment=require(_0xaf63('0x2'));var BPromise=require('bluebird');var rp=require(_0xaf63('0x3'));var fs=require('fs');var path=require(_0xaf63('0x4'));var rimraf=require(_0xaf63('0x5'));var config=require(_0xaf63('0x6'));var attributes=require(_0xaf63('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xfea527,_0x37f748){return _0xfea527['define'](_0xaf63('0x8'),attributes,{'tableName':_0xaf63('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a1ac4,_0x1bd87f,_0x46d2d4){if(_0x5a1ac4['changed'](_0xaf63('0xa'))||_0x5a1ac4[_0xaf63('0xb')](_0xaf63('0xc'))||_0x5a1ac4[_0xaf63('0xb')](_0xaf63('0xd'))||_0x5a1ac4[_0xaf63('0xb')](_0xaf63('0xe'))||_0x5a1ac4['changed']('code')||_0x5a1ac4['changed'](_0xaf63('0xf'))){var _0x272233,_0x22e002;_0x272233=_0x5a1ac4[_0xaf63('0xc')];var _0x9328ef=_0x272233[_0xaf63('0x10')](-0x1);if(_0x9328ef==='/'||_0x9328ef==='\x5c'||_0x9328ef===':'){_0x272233=_0x272233[_0xaf63('0x11')](0x0,_0x272233[_0xaf63('0x12')](_0x9328ef));}switch(_0x5a1ac4[_0xaf63('0xa')]){case'US':_0x22e002=_0xaf63('0x13');break;case'AU':_0x22e002=_0xaf63('0x14');break;case'IN':_0x22e002=_0xaf63('0x15');break;case'CN':_0x22e002=_0xaf63('0x16');break;default:_0x22e002='https://accounts.zoho.eu';break;}var _0x207ab9={'method':_0xaf63('0x17'),'uri':_0x22e002+_0xaf63('0x18'),'form':{'grant_type':_0xaf63('0x19'),'client_id':_0x5a1ac4[_0xaf63('0xd')],'client_secret':_0x5a1ac4[_0xaf63('0xe')],'redirect_uri':_0x5a1ac4[_0xaf63('0xc')],'code':_0x5a1ac4[_0xaf63('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x207ab9)[_0xaf63('0x1b')](function(_0x50a220){var _0x59c873=JSON[_0xaf63('0x1c')](_0x50a220);if(_0x59c873[_0xaf63('0x1d')]){_0x5a1ac4[_0xaf63('0x1e')]=_0x59c873[_0xaf63('0x1d')];logger[_0xaf63('0x1f')](util[_0xaf63('0x20')](_0xaf63('0x21'),_0x5a1ac4[_0xaf63('0x22')],_0x5a1ac4['id']));}else{logger['error'](util[_0xaf63('0x20')](_0xaf63('0x23'),_0x5a1ac4[_0xaf63('0x22')],_0x5a1ac4['id']),util[_0xaf63('0x24')](_0x59c873,{'showHidden':![],'depth':null}));}return _0x46d2d4(null,_0x1bd87f);})[_0xaf63('0x25')](function(_0x2fcc73){logger['error'](util[_0xaf63('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5a1ac4[_0xaf63('0x22')],_0x5a1ac4['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x46d2d4(_0x2fcc73);});}else{return _0x46d2d4(null,_0x1bd87f);}},'beforeUpdate':function(_0x1be244,_0xc909b0,_0x4dcdf9){if(_0x1be244[_0xaf63('0xb')]('zone')||_0x1be244[_0xaf63('0xb')](_0xaf63('0xc'))||_0x1be244[_0xaf63('0xb')]('clientId')||_0x1be244[_0xaf63('0xb')](_0xaf63('0xe'))||_0x1be244[_0xaf63('0xb')](_0xaf63('0x1a'))||_0x1be244[_0xaf63('0xb')](_0xaf63('0xf'))){var _0x9f675a,_0x5db2c8;_0x9f675a=_0x1be244[_0xaf63('0xc')];var _0x5334c2=_0x9f675a[_0xaf63('0x10')](-0x1);if(_0x5334c2==='/'||_0x5334c2==='\x5c'||_0x5334c2===':'){_0x9f675a=_0x9f675a[_0xaf63('0x11')](0x0,_0x9f675a[_0xaf63('0x12')](_0x5334c2));}switch(_0x1be244['zone']){case'US':_0x5db2c8=_0xaf63('0x13');break;case'AU':_0x5db2c8=_0xaf63('0x14');break;case'IN':_0x5db2c8=_0xaf63('0x15');break;case'CN':_0x5db2c8=_0xaf63('0x16');break;default:_0x5db2c8=_0xaf63('0x26');break;}var _0x39c9f5={'method':_0xaf63('0x17'),'uri':_0x5db2c8+_0xaf63('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x1be244['clientId'],'client_secret':_0x1be244[_0xaf63('0xe')],'redirect_uri':_0x1be244[_0xaf63('0xc')],'code':_0x1be244[_0xaf63('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x39c9f5)['then'](function(_0x32ba55){var _0x3fe281=JSON[_0xaf63('0x1c')](_0x32ba55);if(_0x3fe281[_0xaf63('0x1d')]){_0x1be244[_0xaf63('0x1e')]=_0x3fe281['refresh_token'];logger[_0xaf63('0x1f')](util[_0xaf63('0x20')](_0xaf63('0x21'),_0x1be244[_0xaf63('0x22')],_0x1be244['id']));}else{logger[_0xaf63('0x27')](util[_0xaf63('0x20')](_0xaf63('0x23'),_0x1be244[_0xaf63('0x22')],_0x1be244['id']),util[_0xaf63('0x24')](_0x3fe281,{'showHidden':![],'depth':null}));}return _0x4dcdf9(null,_0xc909b0);})[_0xaf63('0x25')](function(_0xa77637){logger[_0xaf63('0x27')](util[_0xaf63('0x20')](_0xaf63('0x23'),_0x1be244[_0xaf63('0x22')],_0x1be244['id']),util[_0xaf63('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x4dcdf9(_0xa77637);});}else{return _0x4dcdf9(null,_0xc909b0);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 09a4722..4c7e811 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 _0x7bd0=['limit','include','model','map','GetZohoAccount','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ZohoAccount','findAll','options','raw','where','attributes'];(function(_0x16952e,_0x2d2c9e){var _0x1664fc=function(_0x83225e){while(--_0x83225e){_0x16952e['push'](_0x16952e['shift']());}};_0x1664fc(++_0x2d2c9e);}(_0x7bd0,0x111));var _0x07bd=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0x7bd0[_0x546aaf];return _0x1cbf6d;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('ZohoAccount,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['GetZohoAccount']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')]({'raw':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1d')]||null:null,'attributes':_0x3f9f0b['options']?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1f')]||null:null,'include':_0x3f9f0b['options']?_0x3f9f0b['options'][_0x07bd('0x20')]?_['map'](_0x3f9f0b[_0x07bd('0x1b')]['include'],function(_0x50bd12){return{'model':db[_0x50bd12[_0x07bd('0x21')]],'as':_0x50bd12['as'],'attributes':_0x50bd12[_0x07bd('0x1e')],'include':_0x50bd12[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x50bd12[_0x07bd('0x20')],function(_0x43cbc8){return{'model':db[_0x43cbc8['model']],'as':_0x43cbc8['as'],'attributes':_0x43cbc8[_0x07bd('0x1e')],'include':_0x43cbc8[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x43cbc8[_0x07bd('0x20')],function(_0x12ce26){return{'model':db[_0x12ce26[_0x07bd('0x21')]],'as':_0x12ce26['as'],'attributes':_0x12ce26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5184dc){logger[_0x07bd('0x17')](_0x07bd('0x23'),_0x3f9f0b);logger[_0x07bd('0x11')]('GetZohoAccount',_0x3f9f0b,JSON[_0x07bd('0x13')](_0x5184dc));_0x4948f4(_0x5184dc);})[_0x07bd('0x18')](function(_0x253dc0){logger[_0x07bd('0x14')](_0x07bd('0x23'),_0x253dc0[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0x253dc0[_0x07bd('0x16')]));});});};exports[_0x07bd('0x24')]=function(_0x4182b9){var _0x321200=this;return new Promise(function(_0x1b6cc,_0x314bda){return db[_0x07bd('0x19')][_0x07bd('0x25')]({'raw':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')]['where']||null:null,'attributes':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'include':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x20')],function(_0x5f29c5){return{'model':db[_0x5f29c5[_0x07bd('0x21')]],'as':_0x5f29c5['as'],'attributes':_0x5f29c5[_0x07bd('0x1e')],'include':_0x5f29c5[_0x07bd('0x20')]?_['map'](_0x5f29c5[_0x07bd('0x20')],function(_0x31c381){return{'model':db[_0x31c381['model']],'as':_0x31c381['as'],'attributes':_0x31c381[_0x07bd('0x1e')],'include':_0x31c381[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x31c381[_0x07bd('0x20')],function(_0x5cde8d){return{'model':db[_0x5cde8d['model']],'as':_0x5cde8d['as'],'attributes':_0x5cde8d[_0x07bd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c2878){logger[_0x07bd('0x17')](_0x07bd('0x24'),_0x4182b9);logger[_0x07bd('0x11')](_0x07bd('0x24'),_0x4182b9,JSON[_0x07bd('0x13')](_0x3c2878));_0x1b6cc(_0x3c2878);})[_0x07bd('0x18')](function(_0x333ac2){logger[_0x07bd('0x14')](_0x07bd('0x24'),_0x333ac2[_0x07bd('0x16')],_0x4182b9);_0x314bda(_0x321200[_0x07bd('0x14')](0x1f4,_0x333ac2[_0x07bd('0x16')]));});});}; \ No newline at end of file +var _0xd824=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowZohoAccount','find','lodash','util','randomstring','ioredis'];(function(_0x3e338e,_0xd2b150){var _0x22b6c7=function(_0x35389f){while(--_0x35389f){_0x3e338e['push'](_0x3e338e['shift']());}};_0x22b6c7(++_0xd2b150);}(_0xd824,0xc2));var _0x4d82=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd824[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')]({'raw':_0x258c59[_0x4d82('0x15')]?_0x258c59[_0x4d82('0x15')][_0x4d82('0x16')]===undefined?!![]:![]:!![],'where':_0x258c59[_0x4d82('0x15')]?_0x258c59[_0x4d82('0x15')][_0x4d82('0x17')]||null:null,'attributes':_0x258c59[_0x4d82('0x15')]?_0x258c59[_0x4d82('0x15')][_0x4d82('0x18')]||null:null,'limit':_0x258c59['options']?_0x258c59[_0x4d82('0x15')][_0x4d82('0x19')]||null:null,'include':_0x258c59['options']?_0x258c59[_0x4d82('0x15')][_0x4d82('0x1a')]?_[_0x4d82('0x1b')](_0x258c59[_0x4d82('0x15')][_0x4d82('0x1a')],function(_0x15f5d1){return{'model':db[_0x15f5d1[_0x4d82('0x1c')]],'as':_0x15f5d1['as'],'attributes':_0x15f5d1[_0x4d82('0x18')],'include':_0x15f5d1[_0x4d82('0x1a')]?_[_0x4d82('0x1b')](_0x15f5d1[_0x4d82('0x1a')],function(_0x395efc){return{'model':db[_0x395efc[_0x4d82('0x1c')]],'as':_0x395efc['as'],'attributes':_0x395efc[_0x4d82('0x18')],'include':_0x395efc[_0x4d82('0x1a')]?_['map'](_0x395efc['include'],function(_0x3dcb0f){return{'model':db[_0x3dcb0f[_0x4d82('0x1c')]],'as':_0x3dcb0f['as'],'attributes':_0x3dcb0f[_0x4d82('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4d82('0x1d')](function(_0x5cbd7e){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x1e')](_0x4d82('0x12'),_0x258c59,JSON['stringify'](_0x5cbd7e));_0x2f2127(_0x5cbd7e);})[_0x4d82('0x11')](function(_0x4a7444){logger['error']('GetZohoAccount',_0x4a7444['message'],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x4a7444[_0x4d82('0x10')]));});});};exports[_0x4d82('0x1f')]=function(_0x52e320){var _0x713c56=this;return new Promise(function(_0x37cdc4,_0x5cf3e6){return db['ZohoAccount'][_0x4d82('0x20')]({'raw':_0x52e320[_0x4d82('0x15')]?_0x52e320[_0x4d82('0x15')][_0x4d82('0x16')]===undefined?!![]:![]:!![],'where':_0x52e320['options']?_0x52e320[_0x4d82('0x15')]['where']||null:null,'attributes':_0x52e320[_0x4d82('0x15')]?_0x52e320[_0x4d82('0x15')]['attributes']||null:null,'include':_0x52e320['options']?_0x52e320[_0x4d82('0x15')][_0x4d82('0x1a')]?_[_0x4d82('0x1b')](_0x52e320[_0x4d82('0x15')][_0x4d82('0x1a')],function(_0x420b28){return{'model':db[_0x420b28[_0x4d82('0x1c')]],'as':_0x420b28['as'],'attributes':_0x420b28[_0x4d82('0x18')],'include':_0x420b28[_0x4d82('0x1a')]?_[_0x4d82('0x1b')](_0x420b28['include'],function(_0x382f43){return{'model':db[_0x382f43[_0x4d82('0x1c')]],'as':_0x382f43['as'],'attributes':_0x382f43[_0x4d82('0x18')],'include':_0x382f43['include']?_[_0x4d82('0x1b')](_0x382f43[_0x4d82('0x1a')],function(_0x57826a){return{'model':db[_0x57826a[_0x4d82('0x1c')]],'as':_0x57826a['as'],'attributes':_0x57826a[_0x4d82('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4d82('0x1d')](function(_0x5d0296){logger[_0x4d82('0xa')](_0x4d82('0x1f'),_0x52e320);logger['debug'](_0x4d82('0x1f'),_0x52e320,JSON['stringify'](_0x5d0296));_0x37cdc4(_0x5d0296);})[_0x4d82('0x11')](function(_0x2c21c9){logger['error'](_0x4d82('0x1f'),_0x2c21c9['message'],_0x52e320);_0x5cf3e6(_0x713c56[_0x4d82('0xf')](0x1f4,_0x2c21c9['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ba7d938..f67c354 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 _0x0fd5=['getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x0fd5,0xa3));var _0x50fd=function(_0x231ff6,_0x556e5b){_0x231ff6=_0x231ff6-0x0;var _0x4bc59b=_0x0fd5[_0x231ff6];return _0x4bc59b;};'use strict';var multer=require(_0x50fd('0x0'));var util=require(_0x50fd('0x1'));var path=require(_0x50fd('0x2'));var timeout=require(_0x50fd('0x3'));var express=require(_0x50fd('0x4'));var router=express[_0x50fd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x50fd('0x6'));var interaction=require(_0x50fd('0x7'));var config=require(_0x50fd('0x8'));var controller=require(_0x50fd('0x9'));router['get']('/',auth[_0x50fd('0xa')](),controller[_0x50fd('0xb')]);router[_0x50fd('0xc')](_0x50fd('0xd'),auth[_0x50fd('0xa')](),controller[_0x50fd('0xe')]);router[_0x50fd('0xc')]('/:id/fields',auth['isAuthenticated'](),controller[_0x50fd('0xf')]);router[_0x50fd('0xc')](_0x50fd('0x10'),auth['isAuthenticated'](),controller[_0x50fd('0x11')]);router[_0x50fd('0xc')](_0x50fd('0x12'),auth[_0x50fd('0xa')](),controller[_0x50fd('0x13')]);router['post']('/',auth[_0x50fd('0xa')](),controller[_0x50fd('0x14')]);router[_0x50fd('0x15')](_0x50fd('0xd'),auth[_0x50fd('0xa')](),controller[_0x50fd('0x16')]);router[_0x50fd('0x17')](_0x50fd('0xd'),auth[_0x50fd('0xa')](),controller[_0x50fd('0x18')]);module[_0x50fd('0x19')]=router; \ No newline at end of file +var _0x7d39=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','/:id','destroy','exports'];(function(_0x269fba,_0xa68777){var _0x1eeb74=function(_0x14e7d1){while(--_0x14e7d1){_0x269fba['push'](_0x269fba['shift']());}};_0x1eeb74(++_0xa68777);}(_0x7d39,0x19e));var _0x97d3=function(_0x72430a,_0x54529b){_0x72430a=_0x72430a-0x0;var _0x4bd374=_0x7d39[_0x72430a];return _0x4bd374;};'use strict';var multer=require('multer');var util=require(_0x97d3('0x0'));var path=require(_0x97d3('0x1'));var timeout=require(_0x97d3('0x2'));var express=require(_0x97d3('0x3'));var router=express['Router']();var fs_extra=require(_0x97d3('0x4'));var auth=require(_0x97d3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x97d3('0x6'));var controller=require(_0x97d3('0x7'));router['get']('/',auth[_0x97d3('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x97d3('0x9')]);router[_0x97d3('0xa')](_0x97d3('0xb'),auth[_0x97d3('0x8')](),controller[_0x97d3('0xc')]);router[_0x97d3('0xa')](_0x97d3('0xd'),auth[_0x97d3('0x8')](),controller[_0x97d3('0xe')]);router[_0x97d3('0xa')](_0x97d3('0xf'),auth[_0x97d3('0x8')](),controller[_0x97d3('0x10')]);router[_0x97d3('0x11')]('/',auth[_0x97d3('0x8')](),controller[_0x97d3('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x97d3('0x13')]);router['delete'](_0x97d3('0x14'),auth[_0x97d3('0x8')](),controller[_0x97d3('0x15')]);module[_0x97d3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 928c877..462b4c4 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 _0xe468=['lead','nothing','contact_lead','contact','STRING','sequelize','exports','ENUM'];(function(_0x4d5f48,_0xd287f){var _0x5c8349=function(_0x10fd4d){while(--_0x10fd4d){_0x4d5f48['push'](_0x4d5f48['shift']());}};_0x5c8349(++_0xd287f);}(_0xe468,0x18d));var _0x8e46=function(_0x2a1b4d,_0x461603){_0x2a1b4d=_0x2a1b4d-0x0;var _0x2defa4=_0xe468[_0x2a1b4d];return _0x2defa4;};'use strict';var Sequelize=require(_0x8e46('0x0'));module[_0x8e46('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x8e46('0x2')](_0x8e46('0x3'),'contact',_0x8e46('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x8e46('0x2')](_0x8e46('0x5'),_0x8e46('0x6'),_0x8e46('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x8e46('0x7')]}}; \ No newline at end of file +var _0x744b=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports','STRING'];(function(_0x16d606,_0x247af2){var _0x51a0da=function(_0x15b548){while(--_0x15b548){_0x16d606['push'](_0x16d606['shift']());}};_0x51a0da(++_0x247af2);}(_0x744b,0xed));var _0xb744=function(_0x1dc82c,_0x4f43eb){_0x1dc82c=_0x1dc82c-0x0;var _0x39b34a=_0x744b[_0x1dc82c];return _0x39b34a;};'use strict';var Sequelize=require(_0xb744('0x0'));module[_0xb744('0x1')]={'name':{'type':Sequelize[_0xb744('0x2')]},'moduleCreate':{'type':Sequelize[_0xb744('0x3')](_0xb744('0x4'),_0xb744('0x5'),_0xb744('0x6')),'defaultValue':_0xb744('0x4')},'moduleSearch':{'type':Sequelize[_0xb744('0x3')](_0xb744('0x7'),_0xb744('0x5'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xb744('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 96d07b9..14ac579 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 _0x34d2=['findAll','catch','show','params','length','find','create','body','update','getFields','ZohoField','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x276fb5,_0x207823){var _0x582b0e=function(_0x35b68f){while(--_0x35b68f){_0x276fb5['push'](_0x276fb5['shift']());}};_0x582b0e(++_0x207823);}(_0x34d2,0x152));var _0x234d=function(_0x20495b,_0x3ac496){_0x20495b=_0x20495b-0x0;var _0x26df89=_0x34d2[_0x20495b];return _0x26df89;};'use strict';var emlformat=require(_0x234d('0x0'));var rimraf=require(_0x234d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x234d('0x2'));var rp=require(_0x234d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x234d('0x4'));var util=require(_0x234d('0x5'));var path=require('path');var sox=require(_0x234d('0x6'));var csv=require(_0x234d('0x7'));var ejs=require(_0x234d('0x8'));var fs=require('fs');var fs_extra=require(_0x234d('0x9'));var _=require(_0x234d('0xa'));var squel=require(_0x234d('0xb'));var crypto=require(_0x234d('0xc'));var jsforce=require(_0x234d('0xd'));var deskjs=require(_0x234d('0xe'));var toCsv=require(_0x234d('0x7'));var querystring=require(_0x234d('0xf'));var Papa=require('papaparse');var Redis=require(_0x234d('0x10'));var authService=require(_0x234d('0x11'));var qs=require(_0x234d('0x12'));var as=require(_0x234d('0x13'));var hardwareService=require(_0x234d('0x14'));var logger=require('../../config/logger')(_0x234d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x234d('0x16'));var db=require(_0x234d('0x17'))['db'];function respondWithStatusCode(_0x28880c,_0x1786e7){_0x1786e7=_0x1786e7||0xcc;return function(_0x16185b){if(_0x16185b){return _0x28880c['sendStatus'](_0x1786e7);}return _0x28880c[_0x234d('0x18')](_0x1786e7)[_0x234d('0x19')]();};}function respondWithResult(_0x590134,_0x4d8ec6){_0x4d8ec6=_0x4d8ec6||0xc8;return function(_0x130d6a){if(_0x130d6a){return _0x590134[_0x234d('0x18')](_0x4d8ec6)[_0x234d('0x1a')](_0x130d6a);}};}function respondWithFilteredResult(_0x1ce35f,_0x2eb1fe){return function(_0x2906b9){if(_0x2906b9){var _0x4817a5=typeof _0x2eb1fe[_0x234d('0x1b')]===_0x234d('0x1c')&&typeof _0x2eb1fe[_0x234d('0x1d')]===_0x234d('0x1c');var _0x44c324=_0x2906b9[_0x234d('0x1e')];var _0x319332=_0x4817a5?0x0:_0x2eb1fe[_0x234d('0x1b')];var _0x202299=_0x4817a5?_0x2906b9[_0x234d('0x1e')]:_0x2eb1fe[_0x234d('0x1b')]+_0x2eb1fe[_0x234d('0x1d')];var _0x1d9e43;if(_0x202299>=_0x44c324){_0x202299=_0x44c324;_0x1d9e43=0xc8;}else{_0x1d9e43=0xce;}_0x1ce35f['status'](_0x1d9e43);return _0x1ce35f[_0x234d('0x1f')](_0x234d('0x20'),_0x319332+'-'+_0x202299+'/'+_0x44c324)[_0x234d('0x1a')](_0x2906b9);}return null;};}function patchUpdates(_0x4f737b){return function(_0x1f5561){try{jsonpatch[_0x234d('0x21')](_0x1f5561,_0x4f737b,!![]);}catch(_0x149e20){return BPromise['reject'](_0x149e20);}return _0x1f5561[_0x234d('0x22')]();};}function saveUpdates(_0x4001aa,_0xf2efd3){return function(_0x269657){if(_0x269657){return _0x269657['update'](_0x4001aa)[_0x234d('0x23')](function(_0x4b1f36){return _0x4b1f36;});}return null;};}function removeEntity(_0x5890c8,_0xae30f9){return function(_0x479eb3){if(_0x479eb3){return _0x479eb3[_0x234d('0x24')]()[_0x234d('0x23')](function(){_0x5890c8[_0x234d('0x18')](0xcc)[_0x234d('0x19')]();});}};}function handleEntityNotFound(_0x345daf,_0x1877fb){return function(_0x1cb687){if(!_0x1cb687){_0x345daf[_0x234d('0x25')](0x194);}return _0x1cb687;};}function handleError(_0x3b6b52,_0x412e91){_0x412e91=_0x412e91||0x1f4;return function(_0x2b8233){logger[_0x234d('0x26')](_0x2b8233[_0x234d('0x27')]);if(_0x2b8233[_0x234d('0x28')]){delete _0x2b8233[_0x234d('0x28')];}_0x3b6b52[_0x234d('0x18')](_0x412e91)[_0x234d('0x29')](_0x2b8233);};}exports[_0x234d('0x2a')]=function(_0x8596e4,_0x580f03){var _0x3387c3={},_0x3a72dc={},_0x1cabd7={'count':0x0,'rows':[]};var _0x63c811=_[_0x234d('0x2b')](db[_0x234d('0x2c')][_0x234d('0x2d')],function(_0x40b61b){return{'name':_0x40b61b['fieldName'],'type':_0x40b61b[_0x234d('0x2e')][_0x234d('0x2f')]};});_0x3a72dc[_0x234d('0x30')]=_[_0x234d('0x2b')](_0x63c811,'name');_0x3a72dc[_0x234d('0x31')]=_[_0x234d('0x32')](_0x8596e4[_0x234d('0x31')]);_0x3a72dc[_0x234d('0x33')]=_[_0x234d('0x34')](_0x3a72dc[_0x234d('0x30')],_0x3a72dc['query']);_0x3387c3[_0x234d('0x35')]=_['intersection'](_0x3a72dc['model'],qs[_0x234d('0x36')](_0x8596e4[_0x234d('0x31')][_0x234d('0x36')]));_0x3387c3[_0x234d('0x35')]=_0x3387c3[_0x234d('0x35')]['length']?_0x3387c3['attributes']:_0x3a72dc[_0x234d('0x30')];if(!_0x8596e4[_0x234d('0x31')][_0x234d('0x37')](_0x234d('0x38'))){_0x3387c3[_0x234d('0x1d')]=qs[_0x234d('0x1d')](_0x8596e4[_0x234d('0x31')][_0x234d('0x1d')]);_0x3387c3[_0x234d('0x1b')]=qs[_0x234d('0x1b')](_0x8596e4[_0x234d('0x31')][_0x234d('0x1b')]);}_0x3387c3[_0x234d('0x39')]=qs[_0x234d('0x3a')](_0x8596e4[_0x234d('0x31')]['sort']);_0x3387c3[_0x234d('0x3b')]=qs['filters'](_[_0x234d('0x3c')](_0x8596e4[_0x234d('0x31')],_0x3a72dc[_0x234d('0x33')]),_0x63c811);if(_0x8596e4[_0x234d('0x31')][_0x234d('0x3d')]){_0x3387c3[_0x234d('0x3b')]=_[_0x234d('0x3e')](_0x3387c3[_0x234d('0x3b')],{'$or':_['map'](_0x63c811,function(_0x1941e7){if(_0x1941e7['type']!==_0x234d('0x3f')){var _0x332a9a={};_0x332a9a[_0x1941e7['name']]={'$like':'%'+_0x8596e4['query'][_0x234d('0x3d')]+'%'};return _0x332a9a;}})});}_0x3387c3=_[_0x234d('0x3e')]({},_0x3387c3,_0x8596e4[_0x234d('0x40')]);var _0x5c6ebb={'where':_0x3387c3[_0x234d('0x3b')]};return db[_0x234d('0x2c')]['count'](_0x5c6ebb)['then'](function(_0x5914bb){_0x1cabd7[_0x234d('0x1e')]=_0x5914bb;if(_0x8596e4[_0x234d('0x31')][_0x234d('0x41')]){_0x3387c3[_0x234d('0x42')]=[{'all':!![]}];}return db[_0x234d('0x2c')][_0x234d('0x43')](_0x3387c3);})['then'](function(_0x41259a){_0x1cabd7['rows']=_0x41259a;return _0x1cabd7;})[_0x234d('0x23')](respondWithFilteredResult(_0x580f03,_0x3387c3))[_0x234d('0x44')](handleError(_0x580f03,null));};exports[_0x234d('0x45')]=function(_0xa3f24f,_0x3b95eb){var _0x3adee3={'raw':![],'where':{'id':_0xa3f24f[_0x234d('0x46')]['id']}},_0x5a7d8e={};_0x5a7d8e[_0x234d('0x30')]=_[_0x234d('0x32')](db[_0x234d('0x2c')][_0x234d('0x2d')]);_0x5a7d8e[_0x234d('0x31')]=_['keys'](_0xa3f24f[_0x234d('0x31')]);_0x5a7d8e[_0x234d('0x33')]=_[_0x234d('0x34')](_0x5a7d8e['model'],_0x5a7d8e['query']);_0x3adee3[_0x234d('0x35')]=_[_0x234d('0x34')](_0x5a7d8e[_0x234d('0x30')],qs['fields'](_0xa3f24f[_0x234d('0x31')][_0x234d('0x36')]));_0x3adee3[_0x234d('0x35')]=_0x3adee3[_0x234d('0x35')][_0x234d('0x47')]?_0x3adee3[_0x234d('0x35')]:_0x5a7d8e[_0x234d('0x30')];if(_0xa3f24f[_0x234d('0x31')]['includeAll']){_0x3adee3[_0x234d('0x42')]=[{'all':!![]}];}_0x3adee3=_[_0x234d('0x3e')]({},_0x3adee3,_0xa3f24f['options']);return db['ZohoConfiguration'][_0x234d('0x48')](_0x3adee3)[_0x234d('0x23')](handleEntityNotFound(_0x3b95eb,null))[_0x234d('0x23')](respondWithResult(_0x3b95eb,null))[_0x234d('0x44')](handleError(_0x3b95eb,null));};exports['create']=function(_0x1be0c3,_0x1643c5){return db[_0x234d('0x2c')][_0x234d('0x49')](_0x1be0c3[_0x234d('0x4a')],{})[_0x234d('0x23')](respondWithResult(_0x1643c5,0xc9))['catch'](handleError(_0x1643c5,null));};exports[_0x234d('0x4b')]=function(_0x590259,_0xefe78a){if(_0x590259[_0x234d('0x4a')]['id']){delete _0x590259[_0x234d('0x4a')]['id'];}return db[_0x234d('0x2c')]['find']({'where':{'id':_0x590259[_0x234d('0x46')]['id']}})['then'](handleEntityNotFound(_0xefe78a,null))[_0x234d('0x23')](saveUpdates(_0x590259['body'],null))[_0x234d('0x23')](respondWithResult(_0xefe78a,null))[_0x234d('0x44')](handleError(_0xefe78a,null));};exports[_0x234d('0x24')]=function(_0x2b0dd3,_0x54e9c2){return db[_0x234d('0x2c')][_0x234d('0x48')]({'where':{'id':_0x2b0dd3[_0x234d('0x46')]['id']}})[_0x234d('0x23')](handleEntityNotFound(_0x54e9c2,null))[_0x234d('0x23')](removeEntity(_0x54e9c2,null))[_0x234d('0x44')](handleError(_0x54e9c2,null));};exports[_0x234d('0x4c')]=function(_0x245bb7,_0x2b2abd,_0x520273){var _0x52993c={};var _0x1e59b9={};var _0x5f3683;var _0x1c740b;return db[_0x234d('0x2c')]['findOne']({'where':{'id':_0x245bb7[_0x234d('0x46')]['id']}})[_0x234d('0x23')](handleEntityNotFound(_0x2b2abd,null))[_0x234d('0x23')](function(_0x4ce57f){if(_0x4ce57f){_0x5f3683=_0x4ce57f;_0x1e59b9['model']=_['keys'](db[_0x234d('0x4d')][_0x234d('0x2d')]);_0x1e59b9['query']=_['keys'](_0x245bb7[_0x234d('0x31')]);_0x1e59b9[_0x234d('0x33')]=_[_0x234d('0x34')](_0x1e59b9[_0x234d('0x30')],_0x1e59b9[_0x234d('0x31')]);_0x52993c[_0x234d('0x35')]=_[_0x234d('0x34')](_0x1e59b9[_0x234d('0x30')],qs[_0x234d('0x36')](_0x245bb7[_0x234d('0x31')][_0x234d('0x36')]));_0x52993c[_0x234d('0x35')]=_0x52993c[_0x234d('0x35')][_0x234d('0x47')]?_0x52993c['attributes']:_0x1e59b9[_0x234d('0x30')];_0x52993c['order']=qs[_0x234d('0x3a')](_0x245bb7['query'][_0x234d('0x3a')]);_0x52993c[_0x234d('0x3b')]=qs[_0x234d('0x33')](_[_0x234d('0x3c')](_0x245bb7[_0x234d('0x31')],_0x1e59b9[_0x234d('0x33')]));if(_0x245bb7['query']['filter']){_0x52993c['where']=_[_0x234d('0x3e')](_0x52993c[_0x234d('0x3b')],{'$or':_[_0x234d('0x2b')](_0x52993c['attributes'],function(_0x50bfeb){var _0x15bc2b={};_0x15bc2b[_0x50bfeb]={'$like':'%'+_0x245bb7['query'][_0x234d('0x3d')]+'%'};return _0x15bc2b;})});}_0x52993c=_[_0x234d('0x3e')]({},_0x52993c,_0x245bb7[_0x234d('0x40')]);return _0x5f3683['getFields'](_0x52993c);}})[_0x234d('0x23')](function(_0x17214c){if(_0x17214c){_0x1c740b=_0x17214c[_0x234d('0x47')];if(!_0x245bb7[_0x234d('0x31')]['hasOwnProperty'](_0x234d('0x38'))){_0x52993c[_0x234d('0x1d')]=qs['limit'](_0x245bb7[_0x234d('0x31')][_0x234d('0x1d')]);_0x52993c['offset']=qs['offset'](_0x245bb7[_0x234d('0x31')][_0x234d('0x1b')]);}return _0x5f3683[_0x234d('0x4c')](_0x52993c);}})['then'](function(_0x19f7d4){if(_0x19f7d4){return _0x19f7d4?{'count':_0x1c740b,'rows':_0x19f7d4}:null;}})[_0x234d('0x23')](respondWithResult(_0x2b2abd,null))[_0x234d('0x44')](handleError(_0x2b2abd,null));};exports[_0x234d('0x4e')]=function(_0x528eee,_0x21bc59,_0x291dab){var _0x248e9b={};var _0x14eb03={};var _0x328743;var _0x303bff;return db['ZohoConfiguration'][_0x234d('0x4f')]({'where':{'id':_0x528eee[_0x234d('0x46')]['id']}})['then'](handleEntityNotFound(_0x21bc59,null))[_0x234d('0x23')](function(_0x1cac97){if(_0x1cac97){_0x328743=_0x1cac97;_0x14eb03['model']=_[_0x234d('0x32')](db[_0x234d('0x4d')][_0x234d('0x2d')]);_0x14eb03['query']=_[_0x234d('0x32')](_0x528eee['query']);_0x14eb03[_0x234d('0x33')]=_[_0x234d('0x34')](_0x14eb03[_0x234d('0x30')],_0x14eb03[_0x234d('0x31')]);_0x248e9b[_0x234d('0x35')]=_[_0x234d('0x34')](_0x14eb03[_0x234d('0x30')],qs['fields'](_0x528eee[_0x234d('0x31')][_0x234d('0x36')]));_0x248e9b['attributes']=_0x248e9b['attributes']['length']?_0x248e9b['attributes']:_0x14eb03[_0x234d('0x30')];_0x248e9b[_0x234d('0x39')]=qs[_0x234d('0x3a')](_0x528eee[_0x234d('0x31')][_0x234d('0x3a')]);_0x248e9b[_0x234d('0x3b')]=qs[_0x234d('0x33')](_[_0x234d('0x3c')](_0x528eee[_0x234d('0x31')],_0x14eb03[_0x234d('0x33')]));if(_0x528eee[_0x234d('0x31')][_0x234d('0x3d')]){_0x248e9b[_0x234d('0x3b')]=_[_0x234d('0x3e')](_0x248e9b[_0x234d('0x3b')],{'$or':_['map'](_0x248e9b[_0x234d('0x35')],function(_0x484139){var _0x38b85d={};_0x38b85d[_0x484139]={'$like':'%'+_0x528eee[_0x234d('0x31')]['filter']+'%'};return _0x38b85d;})});}_0x248e9b=_['merge']({},_0x248e9b,_0x528eee[_0x234d('0x40')]);return _0x328743[_0x234d('0x4e')](_0x248e9b);}})[_0x234d('0x23')](function(_0x3f91cf){if(_0x3f91cf){_0x303bff=_0x3f91cf[_0x234d('0x47')];if(!_0x528eee[_0x234d('0x31')]['hasOwnProperty'](_0x234d('0x38'))){_0x248e9b[_0x234d('0x1d')]=qs['limit'](_0x528eee[_0x234d('0x31')][_0x234d('0x1d')]);_0x248e9b['offset']=qs[_0x234d('0x1b')](_0x528eee[_0x234d('0x31')]['offset']);}return _0x328743[_0x234d('0x4e')](_0x248e9b);}})[_0x234d('0x23')](function(_0x5e026e){if(_0x5e026e){return _0x5e026e?{'count':_0x303bff,'rows':_0x5e026e}:null;}})[_0x234d('0x23')](respondWithResult(_0x21bc59,null))['catch'](handleError(_0x21bc59,null));};exports[_0x234d('0x50')]=function(_0x588e78,_0x486aeb,_0x1fdbfb){var _0x45449b={};var _0x1cb2bc={};var _0x1ea513;var _0x5dbec4;return db[_0x234d('0x2c')]['findOne']({'where':{'id':_0x588e78[_0x234d('0x46')]['id']}})[_0x234d('0x23')](handleEntityNotFound(_0x486aeb,null))[_0x234d('0x23')](function(_0x1c9d79){if(_0x1c9d79){_0x1ea513=_0x1c9d79;_0x1cb2bc['model']=_['keys'](db[_0x234d('0x4d')][_0x234d('0x2d')]);_0x1cb2bc[_0x234d('0x31')]=_['keys'](_0x588e78[_0x234d('0x31')]);_0x1cb2bc['filters']=_[_0x234d('0x34')](_0x1cb2bc['model'],_0x1cb2bc[_0x234d('0x31')]);_0x45449b[_0x234d('0x35')]=_[_0x234d('0x34')](_0x1cb2bc[_0x234d('0x30')],qs[_0x234d('0x36')](_0x588e78[_0x234d('0x31')][_0x234d('0x36')]));_0x45449b[_0x234d('0x35')]=_0x45449b[_0x234d('0x35')][_0x234d('0x47')]?_0x45449b[_0x234d('0x35')]:_0x1cb2bc[_0x234d('0x30')];_0x45449b['order']=qs[_0x234d('0x3a')](_0x588e78[_0x234d('0x31')][_0x234d('0x3a')]);_0x45449b[_0x234d('0x3b')]=qs[_0x234d('0x33')](_['pick'](_0x588e78['query'],_0x1cb2bc[_0x234d('0x33')]));if(_0x588e78['query'][_0x234d('0x3d')]){_0x45449b[_0x234d('0x3b')]=_['merge'](_0x45449b[_0x234d('0x3b')],{'$or':_[_0x234d('0x2b')](_0x45449b[_0x234d('0x35')],function(_0x48a1f8){var _0x5294e9={};_0x5294e9[_0x48a1f8]={'$like':'%'+_0x588e78[_0x234d('0x31')][_0x234d('0x3d')]+'%'};return _0x5294e9;})});}_0x45449b=_[_0x234d('0x3e')]({},_0x45449b,_0x588e78[_0x234d('0x40')]);return _0x1ea513[_0x234d('0x50')](_0x45449b);}})[_0x234d('0x23')](function(_0x27e58d){if(_0x27e58d){_0x5dbec4=_0x27e58d['length'];if(!_0x588e78['query'][_0x234d('0x37')](_0x234d('0x38'))){_0x45449b['limit']=qs[_0x234d('0x1d')](_0x588e78['query']['limit']);_0x45449b[_0x234d('0x1b')]=qs[_0x234d('0x1b')](_0x588e78['query']['offset']);}return _0x1ea513[_0x234d('0x50')](_0x45449b);}})[_0x234d('0x23')](function(_0x44891e){if(_0x44891e){return _0x44891e?{'count':_0x5dbec4,'rows':_0x44891e}:null;}})['then'](respondWithResult(_0x486aeb,null))[_0x234d('0x44')](handleError(_0x486aeb,null));}; \ No newline at end of file +var _0x4e15=['apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','getFields','findOne','ZohoField','sort','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set'];(function(_0x4dfd10,_0x3169d5){var _0x267950=function(_0x15b4ae){while(--_0x15b4ae){_0x4dfd10['push'](_0x4dfd10['shift']());}};_0x267950(++_0x3169d5);}(_0x4e15,0x124));var _0x54e1=function(_0x5eeefa,_0x38ee52){_0x5eeefa=_0x5eeefa-0x0;var _0x513b6b=_0x4e15[_0x5eeefa];return _0x513b6b;};'use strict';var emlformat=require(_0x54e1('0x0'));var rimraf=require(_0x54e1('0x1'));var zipdir=require(_0x54e1('0x2'));var jsonpatch=require(_0x54e1('0x3'));var rp=require(_0x54e1('0x4'));var moment=require(_0x54e1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x54e1('0x6'));var util=require(_0x54e1('0x7'));var path=require('path');var sox=require(_0x54e1('0x8'));var csv=require('to-csv');var ejs=require(_0x54e1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54e1('0xa'));var squel=require(_0x54e1('0xb'));var crypto=require(_0x54e1('0xc'));var jsforce=require(_0x54e1('0xd'));var deskjs=require(_0x54e1('0xe'));var toCsv=require(_0x54e1('0xf'));var querystring=require(_0x54e1('0x10'));var Papa=require(_0x54e1('0x11'));var Redis=require(_0x54e1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54e1('0x13'));var logger=require('../../config/logger')(_0x54e1('0x14'));var utils=require(_0x54e1('0x15'));var config=require(_0x54e1('0x16'));var licenseUtil=require(_0x54e1('0x17'));var db=require(_0x54e1('0x18'))['db'];function respondWithStatusCode(_0x5c7166,_0x184899){_0x184899=_0x184899||0xcc;return function(_0x485d1c){if(_0x485d1c){return _0x5c7166['sendStatus'](_0x184899);}return _0x5c7166[_0x54e1('0x19')](_0x184899)[_0x54e1('0x1a')]();};}function respondWithResult(_0x16cad7,_0x2d6a61){_0x2d6a61=_0x2d6a61||0xc8;return function(_0x1db134){if(_0x1db134){return _0x16cad7[_0x54e1('0x19')](_0x2d6a61)['json'](_0x1db134);}};}function respondWithFilteredResult(_0x305b01,_0x49b9b8){return function(_0xc61967){if(_0xc61967){var _0xea0870=typeof _0x49b9b8['offset']===_0x54e1('0x1b')&&typeof _0x49b9b8[_0x54e1('0x1c')]===_0x54e1('0x1b');var _0x4bf773=_0xc61967[_0x54e1('0x1d')];var _0x5a17a1=_0xea0870?0x0:_0x49b9b8[_0x54e1('0x1e')];var _0x55a15c=_0xea0870?_0xc61967[_0x54e1('0x1d')]:_0x49b9b8['offset']+_0x49b9b8[_0x54e1('0x1c')];var _0xeb4e5d;if(_0x55a15c>=_0x4bf773){_0x55a15c=_0x4bf773;_0xeb4e5d=0xc8;}else{_0xeb4e5d=0xce;}_0x305b01[_0x54e1('0x19')](_0xeb4e5d);return _0x305b01[_0x54e1('0x1f')]('Content-Range',_0x5a17a1+'-'+_0x55a15c+'/'+_0x4bf773)['json'](_0xc61967);}return null;};}function patchUpdates(_0x5009db){return function(_0x5c53e0){try{jsonpatch[_0x54e1('0x20')](_0x5c53e0,_0x5009db,!![]);}catch(_0x6dd14d){return BPromise['reject'](_0x6dd14d);}return _0x5c53e0[_0x54e1('0x21')]();};}function saveUpdates(_0x45fce2,_0x3bdbd0){return function(_0x2b42ce){if(_0x2b42ce){return _0x2b42ce[_0x54e1('0x22')](_0x45fce2)[_0x54e1('0x23')](function(_0x47ec56){return _0x47ec56;});}return null;};}function removeEntity(_0x57c385,_0x5095b1){return function(_0x5b6e36){if(_0x5b6e36){return _0x5b6e36[_0x54e1('0x24')]()[_0x54e1('0x23')](function(){_0x57c385[_0x54e1('0x19')](0xcc)[_0x54e1('0x1a')]();});}};}function handleEntityNotFound(_0x450d4f,_0xdd1a3f){return function(_0xcca238){if(!_0xcca238){_0x450d4f[_0x54e1('0x25')](0x194);}return _0xcca238;};}function handleError(_0xe262dd,_0x20c585){_0x20c585=_0x20c585||0x1f4;return function(_0x2901e1){logger['error'](_0x2901e1[_0x54e1('0x26')]);if(_0x2901e1[_0x54e1('0x27')]){delete _0x2901e1['name'];}_0xe262dd[_0x54e1('0x19')](_0x20c585)[_0x54e1('0x28')](_0x2901e1);};}exports[_0x54e1('0x29')]=function(_0x5c2853,_0x505755){var _0x5315ce={},_0x4b6c32={},_0x389e78={'count':0x0,'rows':[]};var _0x5d1189=_[_0x54e1('0x2a')](db[_0x54e1('0x2b')]['rawAttributes'],function(_0x19061c){return{'name':_0x19061c[_0x54e1('0x2c')],'type':_0x19061c[_0x54e1('0x2d')][_0x54e1('0x2e')]};});_0x4b6c32[_0x54e1('0x2f')]=_[_0x54e1('0x2a')](_0x5d1189,_0x54e1('0x27'));_0x4b6c32[_0x54e1('0x30')]=_[_0x54e1('0x31')](_0x5c2853[_0x54e1('0x30')]);_0x4b6c32[_0x54e1('0x32')]=_[_0x54e1('0x33')](_0x4b6c32[_0x54e1('0x2f')],_0x4b6c32['query']);_0x5315ce[_0x54e1('0x34')]=_[_0x54e1('0x33')](_0x4b6c32[_0x54e1('0x2f')],qs[_0x54e1('0x35')](_0x5c2853[_0x54e1('0x30')][_0x54e1('0x35')]));_0x5315ce['attributes']=_0x5315ce['attributes'][_0x54e1('0x36')]?_0x5315ce[_0x54e1('0x34')]:_0x4b6c32['model'];if(!_0x5c2853[_0x54e1('0x30')]['hasOwnProperty'](_0x54e1('0x37'))){_0x5315ce[_0x54e1('0x1c')]=qs[_0x54e1('0x1c')](_0x5c2853[_0x54e1('0x30')]['limit']);_0x5315ce[_0x54e1('0x1e')]=qs[_0x54e1('0x1e')](_0x5c2853[_0x54e1('0x30')][_0x54e1('0x1e')]);}_0x5315ce[_0x54e1('0x38')]=qs['sort'](_0x5c2853[_0x54e1('0x30')]['sort']);_0x5315ce[_0x54e1('0x39')]=qs['filters'](_[_0x54e1('0x3a')](_0x5c2853[_0x54e1('0x30')],_0x4b6c32[_0x54e1('0x32')]),_0x5d1189);if(_0x5c2853['query'][_0x54e1('0x3b')]){_0x5315ce[_0x54e1('0x39')]=_['merge'](_0x5315ce[_0x54e1('0x39')],{'$or':_['map'](_0x5d1189,function(_0x5392ae){if(_0x5392ae['type']!==_0x54e1('0x3c')){var _0x10a16a={};_0x10a16a[_0x5392ae[_0x54e1('0x27')]]={'$like':'%'+_0x5c2853[_0x54e1('0x30')][_0x54e1('0x3b')]+'%'};return _0x10a16a;}})});}_0x5315ce=_[_0x54e1('0x3d')]({},_0x5315ce,_0x5c2853['options']);var _0x5b9044={'where':_0x5315ce[_0x54e1('0x39')]};return db[_0x54e1('0x2b')][_0x54e1('0x1d')](_0x5b9044)[_0x54e1('0x23')](function(_0x50bbad){_0x389e78[_0x54e1('0x1d')]=_0x50bbad;if(_0x5c2853['query'][_0x54e1('0x3e')]){_0x5315ce[_0x54e1('0x3f')]=[{'all':!![]}];}return db[_0x54e1('0x2b')][_0x54e1('0x40')](_0x5315ce);})[_0x54e1('0x23')](function(_0x439127){_0x389e78[_0x54e1('0x41')]=_0x439127;return _0x389e78;})[_0x54e1('0x23')](respondWithFilteredResult(_0x505755,_0x5315ce))[_0x54e1('0x42')](handleError(_0x505755,null));};exports[_0x54e1('0x43')]=function(_0x15e267,_0x4bc2a2){var _0x2aa208={'raw':![],'where':{'id':_0x15e267[_0x54e1('0x44')]['id']}},_0x44a43c={};_0x44a43c[_0x54e1('0x2f')]=_[_0x54e1('0x31')](db[_0x54e1('0x2b')][_0x54e1('0x45')]);_0x44a43c[_0x54e1('0x30')]=_[_0x54e1('0x31')](_0x15e267[_0x54e1('0x30')]);_0x44a43c['filters']=_['intersection'](_0x44a43c[_0x54e1('0x2f')],_0x44a43c[_0x54e1('0x30')]);_0x2aa208[_0x54e1('0x34')]=_['intersection'](_0x44a43c['model'],qs[_0x54e1('0x35')](_0x15e267[_0x54e1('0x30')][_0x54e1('0x35')]));_0x2aa208['attributes']=_0x2aa208[_0x54e1('0x34')][_0x54e1('0x36')]?_0x2aa208[_0x54e1('0x34')]:_0x44a43c[_0x54e1('0x2f')];if(_0x15e267[_0x54e1('0x30')][_0x54e1('0x3e')]){_0x2aa208[_0x54e1('0x3f')]=[{'all':!![]}];}_0x2aa208=_[_0x54e1('0x3d')]({},_0x2aa208,_0x15e267[_0x54e1('0x46')]);return db['ZohoConfiguration'][_0x54e1('0x47')](_0x2aa208)[_0x54e1('0x23')](handleEntityNotFound(_0x4bc2a2,null))[_0x54e1('0x23')](respondWithResult(_0x4bc2a2,null))[_0x54e1('0x42')](handleError(_0x4bc2a2,null));};exports[_0x54e1('0x48')]=function(_0x35833f,_0x2ba3f4){return db[_0x54e1('0x2b')]['create'](_0x35833f[_0x54e1('0x49')],{})[_0x54e1('0x23')](respondWithResult(_0x2ba3f4,0xc9))[_0x54e1('0x42')](handleError(_0x2ba3f4,null));};exports[_0x54e1('0x22')]=function(_0x303be1,_0x31a1dc){if(_0x303be1['body']['id']){delete _0x303be1[_0x54e1('0x49')]['id'];}return db[_0x54e1('0x2b')][_0x54e1('0x47')]({'where':{'id':_0x303be1['params']['id']}})[_0x54e1('0x23')](handleEntityNotFound(_0x31a1dc,null))[_0x54e1('0x23')](saveUpdates(_0x303be1['body'],null))['then'](respondWithResult(_0x31a1dc,null))[_0x54e1('0x42')](handleError(_0x31a1dc,null));};exports[_0x54e1('0x24')]=function(_0x496c9e,_0x400c62){return db[_0x54e1('0x2b')][_0x54e1('0x47')]({'where':{'id':_0x496c9e['params']['id']}})['then'](handleEntityNotFound(_0x400c62,null))[_0x54e1('0x23')](removeEntity(_0x400c62,null))['catch'](handleError(_0x400c62,null));};exports[_0x54e1('0x4a')]=function(_0x426088,_0x58ddb8,_0x218168){var _0x54e6b0={};var _0xbaa2e0={};var _0x1485e1;var _0x5d38bc;return db[_0x54e1('0x2b')][_0x54e1('0x4b')]({'where':{'id':_0x426088[_0x54e1('0x44')]['id']}})[_0x54e1('0x23')](handleEntityNotFound(_0x58ddb8,null))['then'](function(_0x42cb26){if(_0x42cb26){_0x1485e1=_0x42cb26;_0xbaa2e0['model']=_[_0x54e1('0x31')](db[_0x54e1('0x4c')][_0x54e1('0x45')]);_0xbaa2e0[_0x54e1('0x30')]=_['keys'](_0x426088[_0x54e1('0x30')]);_0xbaa2e0[_0x54e1('0x32')]=_[_0x54e1('0x33')](_0xbaa2e0[_0x54e1('0x2f')],_0xbaa2e0[_0x54e1('0x30')]);_0x54e6b0['attributes']=_[_0x54e1('0x33')](_0xbaa2e0['model'],qs[_0x54e1('0x35')](_0x426088[_0x54e1('0x30')][_0x54e1('0x35')]));_0x54e6b0[_0x54e1('0x34')]=_0x54e6b0[_0x54e1('0x34')][_0x54e1('0x36')]?_0x54e6b0[_0x54e1('0x34')]:_0xbaa2e0['model'];_0x54e6b0['order']=qs[_0x54e1('0x4d')](_0x426088['query']['sort']);_0x54e6b0['where']=qs[_0x54e1('0x32')](_[_0x54e1('0x3a')](_0x426088[_0x54e1('0x30')],_0xbaa2e0['filters']));if(_0x426088[_0x54e1('0x30')]['filter']){_0x54e6b0[_0x54e1('0x39')]=_[_0x54e1('0x3d')](_0x54e6b0[_0x54e1('0x39')],{'$or':_[_0x54e1('0x2a')](_0x54e6b0['attributes'],function(_0x5d0b1e){var _0xf0715c={};_0xf0715c[_0x5d0b1e]={'$like':'%'+_0x426088['query'][_0x54e1('0x3b')]+'%'};return _0xf0715c;})});}_0x54e6b0=_['merge']({},_0x54e6b0,_0x426088[_0x54e1('0x46')]);return _0x1485e1[_0x54e1('0x4a')](_0x54e6b0);}})[_0x54e1('0x23')](function(_0x5ccfd3){if(_0x5ccfd3){_0x5d38bc=_0x5ccfd3[_0x54e1('0x36')];if(!_0x426088[_0x54e1('0x30')][_0x54e1('0x4e')]('nolimit')){_0x54e6b0[_0x54e1('0x1c')]=qs[_0x54e1('0x1c')](_0x426088[_0x54e1('0x30')][_0x54e1('0x1c')]);_0x54e6b0[_0x54e1('0x1e')]=qs['offset'](_0x426088[_0x54e1('0x30')][_0x54e1('0x1e')]);}return _0x1485e1[_0x54e1('0x4a')](_0x54e6b0);}})[_0x54e1('0x23')](function(_0x4d11dc){if(_0x4d11dc){return _0x4d11dc?{'count':_0x5d38bc,'rows':_0x4d11dc}:null;}})[_0x54e1('0x23')](respondWithResult(_0x58ddb8,null))['catch'](handleError(_0x58ddb8,null));};exports[_0x54e1('0x4f')]=function(_0xfdba3c,_0x5530f8,_0x3ea2d9){var _0x37d6bd={};var _0x20ea07={};var _0x53ae37;var _0x47185c;return db[_0x54e1('0x2b')][_0x54e1('0x4b')]({'where':{'id':_0xfdba3c[_0x54e1('0x44')]['id']}})['then'](handleEntityNotFound(_0x5530f8,null))['then'](function(_0x206a26){if(_0x206a26){_0x53ae37=_0x206a26;_0x20ea07[_0x54e1('0x2f')]=_[_0x54e1('0x31')](db[_0x54e1('0x4c')][_0x54e1('0x45')]);_0x20ea07['query']=_['keys'](_0xfdba3c[_0x54e1('0x30')]);_0x20ea07['filters']=_[_0x54e1('0x33')](_0x20ea07['model'],_0x20ea07[_0x54e1('0x30')]);_0x37d6bd[_0x54e1('0x34')]=_[_0x54e1('0x33')](_0x20ea07[_0x54e1('0x2f')],qs[_0x54e1('0x35')](_0xfdba3c[_0x54e1('0x30')]['fields']));_0x37d6bd[_0x54e1('0x34')]=_0x37d6bd['attributes']['length']?_0x37d6bd[_0x54e1('0x34')]:_0x20ea07[_0x54e1('0x2f')];_0x37d6bd[_0x54e1('0x38')]=qs[_0x54e1('0x4d')](_0xfdba3c[_0x54e1('0x30')][_0x54e1('0x4d')]);_0x37d6bd['where']=qs[_0x54e1('0x32')](_[_0x54e1('0x3a')](_0xfdba3c[_0x54e1('0x30')],_0x20ea07[_0x54e1('0x32')]));if(_0xfdba3c['query'][_0x54e1('0x3b')]){_0x37d6bd['where']=_[_0x54e1('0x3d')](_0x37d6bd[_0x54e1('0x39')],{'$or':_[_0x54e1('0x2a')](_0x37d6bd['attributes'],function(_0x4c54d0){var _0x5ae987={};_0x5ae987[_0x4c54d0]={'$like':'%'+_0xfdba3c[_0x54e1('0x30')][_0x54e1('0x3b')]+'%'};return _0x5ae987;})});}_0x37d6bd=_[_0x54e1('0x3d')]({},_0x37d6bd,_0xfdba3c[_0x54e1('0x46')]);return _0x53ae37[_0x54e1('0x4f')](_0x37d6bd);}})[_0x54e1('0x23')](function(_0x51d6e6){if(_0x51d6e6){_0x47185c=_0x51d6e6[_0x54e1('0x36')];if(!_0xfdba3c[_0x54e1('0x30')][_0x54e1('0x4e')]('nolimit')){_0x37d6bd['limit']=qs['limit'](_0xfdba3c[_0x54e1('0x30')][_0x54e1('0x1c')]);_0x37d6bd[_0x54e1('0x1e')]=qs[_0x54e1('0x1e')](_0xfdba3c[_0x54e1('0x30')][_0x54e1('0x1e')]);}return _0x53ae37[_0x54e1('0x4f')](_0x37d6bd);}})[_0x54e1('0x23')](function(_0x191ba2){if(_0x191ba2){return _0x191ba2?{'count':_0x47185c,'rows':_0x191ba2}:null;}})[_0x54e1('0x23')](respondWithResult(_0x5530f8,null))[_0x54e1('0x42')](handleError(_0x5530f8,null));};exports[_0x54e1('0x50')]=function(_0x42e00d,_0x86ea96,_0x178e02){var _0x58e05b={};var _0x377f07={};var _0x23cd72;var _0xde8d03;return db[_0x54e1('0x2b')][_0x54e1('0x4b')]({'where':{'id':_0x42e00d[_0x54e1('0x44')]['id']}})[_0x54e1('0x23')](handleEntityNotFound(_0x86ea96,null))[_0x54e1('0x23')](function(_0x17fa5c){if(_0x17fa5c){_0x23cd72=_0x17fa5c;_0x377f07[_0x54e1('0x2f')]=_[_0x54e1('0x31')](db[_0x54e1('0x4c')]['rawAttributes']);_0x377f07['query']=_[_0x54e1('0x31')](_0x42e00d['query']);_0x377f07[_0x54e1('0x32')]=_[_0x54e1('0x33')](_0x377f07[_0x54e1('0x2f')],_0x377f07[_0x54e1('0x30')]);_0x58e05b[_0x54e1('0x34')]=_[_0x54e1('0x33')](_0x377f07[_0x54e1('0x2f')],qs[_0x54e1('0x35')](_0x42e00d[_0x54e1('0x30')][_0x54e1('0x35')]));_0x58e05b['attributes']=_0x58e05b['attributes'][_0x54e1('0x36')]?_0x58e05b['attributes']:_0x377f07[_0x54e1('0x2f')];_0x58e05b[_0x54e1('0x38')]=qs['sort'](_0x42e00d[_0x54e1('0x30')]['sort']);_0x58e05b[_0x54e1('0x39')]=qs[_0x54e1('0x32')](_[_0x54e1('0x3a')](_0x42e00d[_0x54e1('0x30')],_0x377f07['filters']));if(_0x42e00d[_0x54e1('0x30')][_0x54e1('0x3b')]){_0x58e05b[_0x54e1('0x39')]=_['merge'](_0x58e05b['where'],{'$or':_[_0x54e1('0x2a')](_0x58e05b['attributes'],function(_0x23c9a8){var _0x38d709={};_0x38d709[_0x23c9a8]={'$like':'%'+_0x42e00d[_0x54e1('0x30')][_0x54e1('0x3b')]+'%'};return _0x38d709;})});}_0x58e05b=_[_0x54e1('0x3d')]({},_0x58e05b,_0x42e00d['options']);return _0x23cd72['getDescriptions'](_0x58e05b);}})[_0x54e1('0x23')](function(_0x536372){if(_0x536372){_0xde8d03=_0x536372[_0x54e1('0x36')];if(!_0x42e00d['query'][_0x54e1('0x4e')]('nolimit')){_0x58e05b[_0x54e1('0x1c')]=qs['limit'](_0x42e00d[_0x54e1('0x30')][_0x54e1('0x1c')]);_0x58e05b[_0x54e1('0x1e')]=qs[_0x54e1('0x1e')](_0x42e00d[_0x54e1('0x30')][_0x54e1('0x1e')]);}return _0x23cd72[_0x54e1('0x50')](_0x58e05b);}})['then'](function(_0x3d2f5e){if(_0x3d2f5e){return _0x3d2f5e?{'count':_0xde8d03,'rows':_0x3d2f5e}:null;}})['then'](respondWithResult(_0x86ea96,null))[_0x54e1('0x42')](handleError(_0x86ea96,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index eaf5621..2be799c 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 _0x2ed4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ZohoConfiguration','lodash'];(function(_0x813b50,_0x7bdeaa){var _0x4f6010=function(_0x23e0ef){while(--_0x23e0ef){_0x813b50['push'](_0x813b50['shift']());}};_0x4f6010(++_0x7bdeaa);}(_0x2ed4,0x83));var _0x42ed=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x2ed4[_0x53b53e];return _0xbb6179;};'use strict';var _=require(_0x42ed('0x0'));var util=require(_0x42ed('0x1'));var logger=require(_0x42ed('0x2'))(_0x42ed('0x3'));var moment=require(_0x42ed('0x4'));var BPromise=require(_0x42ed('0x5'));var rp=require(_0x42ed('0x6'));var fs=require('fs');var path=require(_0x42ed('0x7'));var rimraf=require(_0x42ed('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x42ed('0x9')]=function(_0x546c9e,_0x28e7f3){return _0x546c9e[_0x42ed('0xa')](_0x42ed('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e03=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations'];(function(_0x36b79c,_0x57b9dd){var _0x3f6e12=function(_0xd2dca9){while(--_0xd2dca9){_0x36b79c['push'](_0x36b79c['shift']());}};_0x3f6e12(++_0x57b9dd);}(_0x2e03,0x12c));var _0x32e0=function(_0x1a99b5,_0x1dfd3b){_0x1a99b5=_0x1a99b5-0x0;var _0x268f64=_0x2e03[_0x1a99b5];return _0x268f64;};'use strict';var _=require('lodash');var util=require(_0x32e0('0x0'));var logger=require(_0x32e0('0x1'))('api');var moment=require(_0x32e0('0x2'));var BPromise=require(_0x32e0('0x3'));var rp=require(_0x32e0('0x4'));var fs=require('fs');var path=require(_0x32e0('0x5'));var rimraf=require(_0x32e0('0x6'));var config=require(_0x32e0('0x7'));var attributes=require(_0x32e0('0x8'));module[_0x32e0('0x9')]=function(_0x5c4ea5,_0x53fadf){return _0x5c4ea5[_0x32e0('0xa')]('ZohoConfiguration',attributes,{'tableName':_0x32e0('0xb'),'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 2864c42..6a6d313 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 _0x8469=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b823b,_0x3c3f3f){var _0x1cbe3d=function(_0x5cc7fe){while(--_0x5cc7fe){_0x2b823b['push'](_0x2b823b['shift']());}};_0x1cbe3d(++_0x3c3f3f);}(_0x8469,0x137));var _0x9846=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x8469[_0x1857d0];return _0x3e3c46;};'use strict';var _=require(_0x9846('0x0'));var util=require(_0x9846('0x1'));var moment=require(_0x9846('0x2'));var BPromise=require(_0x9846('0x3'));var rs=require(_0x9846('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9846('0x5'));var config=require(_0x9846('0x6'));var jayson=require(_0x9846('0x7'));var client=jayson[_0x9846('0x8')][_0x9846('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c1de7,_0x2ed132,_0x20da89){return new BPromise(function(_0x34eecc,_0x21e5ae){return client['request'](_0x1c1de7,_0x20da89)['then'](function(_0x4daaf7){logger['info'](_0x9846('0xa'),_0x2ed132,_0x9846('0xb'));logger[_0x9846('0xc')](_0x9846('0xd'),_0x2ed132,_0x9846('0xb'),JSON['stringify'](_0x4daaf7));if(_0x4daaf7[_0x9846('0xe')]){if(_0x4daaf7[_0x9846('0xe')][_0x9846('0xf')]===0x1f4){logger[_0x9846('0xe')](_0x9846('0xa'),_0x2ed132,_0x4daaf7['error'][_0x9846('0x10')]);return _0x21e5ae(_0x4daaf7['error']['message']);}logger[_0x9846('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ed132,_0x4daaf7['error']['message']);return _0x34eecc(_0x4daaf7[_0x9846('0xe')][_0x9846('0x10')]);}else{logger[_0x9846('0x11')](_0x9846('0xa'),_0x2ed132,_0x9846('0xb'));_0x34eecc(_0x4daaf7['result'][_0x9846('0x10')]);}})['catch'](function(_0x28c1ea){logger[_0x9846('0xe')](_0x9846('0xa'),_0x2ed132,_0x28c1ea);_0x21e5ae(_0x28c1ea);});});} \ No newline at end of file +var _0x72d7=['../../config/environment','client','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x72d7,0x19b));var _0x772d=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x72d7[_0x9df060];return _0x338dfe;};'use strict';var _=require('lodash');var util=require(_0x772d('0x0'));var moment=require(_0x772d('0x1'));var BPromise=require(_0x772d('0x2'));var rs=require(_0x772d('0x3'));var fs=require('fs');var Redis=require(_0x772d('0x4'));var db=require(_0x772d('0x5'))['db'];var utils=require(_0x772d('0x6'));var logger=require(_0x772d('0x7'))(_0x772d('0x8'));var config=require(_0x772d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x772d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44030f,_0x529031,_0x3a3ac3){return new BPromise(function(_0x3ec65a,_0x358598){return client['request'](_0x44030f,_0x3a3ac3)[_0x772d('0xb')](function(_0x34a08b){logger['info'](_0x772d('0xc'),_0x529031,_0x772d('0xd'));logger[_0x772d('0xe')](_0x772d('0xf'),_0x529031,'request\x20sent',JSON['stringify'](_0x34a08b));if(_0x34a08b[_0x772d('0x10')]){if(_0x34a08b[_0x772d('0x10')][_0x772d('0x11')]===0x1f4){logger[_0x772d('0x10')](_0x772d('0xc'),_0x529031,_0x34a08b[_0x772d('0x10')]['message']);return _0x358598(_0x34a08b[_0x772d('0x10')][_0x772d('0x12')]);}logger['error'](_0x772d('0xc'),_0x529031,_0x34a08b[_0x772d('0x10')][_0x772d('0x12')]);return _0x3ec65a(_0x34a08b['error'][_0x772d('0x12')]);}else{logger['info'](_0x772d('0xc'),_0x529031,_0x772d('0xd'));_0x3ec65a(_0x34a08b[_0x772d('0x13')][_0x772d('0x12')]);}})['catch'](function(_0x199fcc){logger[_0x772d('0x10')](_0x772d('0xc'),_0x529031,_0x199fcc);_0x358598(_0x199fcc);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a0e949b..48467e7 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 _0xedcc=['post','create','put','update','delete','multer','path','express','fs-extra','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xedcc,0x105));var _0xcedc=function(_0x340ed8,_0x88df6d){_0x340ed8=_0x340ed8-0x0;var _0x252f7d=_0xedcc[_0x340ed8];return _0x252f7d;};'use strict';var multer=require(_0xcedc('0x0'));var util=require('util');var path=require(_0xcedc('0x1'));var timeout=require('connect-timeout');var express=require(_0xcedc('0x2'));var router=express['Router']();var fs_extra=require(_0xcedc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcedc('0x4'));var config=require('../../config/environment');var controller=require(_0xcedc('0x5'));router[_0xcedc('0x6')]('/',auth[_0xcedc('0x7')](),controller[_0xcedc('0x8')]);router[_0xcedc('0x6')](_0xcedc('0x9'),auth[_0xcedc('0x7')](),controller[_0xcedc('0xa')]);router[_0xcedc('0xb')]('/',auth['isAuthenticated'](),controller[_0xcedc('0xc')]);router[_0xcedc('0xd')](_0xcedc('0x9'),auth[_0xcedc('0x7')](),controller[_0xcedc('0xe')]);router[_0xcedc('0xf')]('/:id',auth[_0xcedc('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9828=['post','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2871aa,_0x57c2eb){var _0x4dc854=function(_0x2b17b8){while(--_0x2b17b8){_0x2871aa['push'](_0x2871aa['shift']());}};_0x4dc854(++_0x57c2eb);}(_0x9828,0x1d3));var _0x8982=function(_0x4b8eb3,_0x503f82){_0x4b8eb3=_0x4b8eb3-0x0;var _0x1ad8b2=_0x9828[_0x4b8eb3];return _0x1ad8b2;};'use strict';var multer=require(_0x8982('0x0'));var util=require('util');var path=require(_0x8982('0x1'));var timeout=require(_0x8982('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8982('0x3'));var auth=require(_0x8982('0x4'));var interaction=require(_0x8982('0x5'));var config=require(_0x8982('0x6'));var controller=require(_0x8982('0x7'));router[_0x8982('0x8')]('/',auth[_0x8982('0x9')](),controller[_0x8982('0xa')]);router[_0x8982('0x8')](_0x8982('0xb'),auth[_0x8982('0x9')](),controller[_0x8982('0xc')]);router[_0x8982('0xd')]('/',auth[_0x8982('0x9')](),controller['create']);router['put'](_0x8982('0xb'),auth[_0x8982('0x9')](),controller['update']);router['delete'](_0x8982('0xb'),auth['isAuthenticated'](),controller[_0x8982('0xe')]);module[_0x8982('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3512b91..5e98eb0 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 _0x8c1e=['variable','customVariable','keyValue','picklist','STRING','exports','ENUM','string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c1e,0x165));var _0xe8c1=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x8c1e[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require('sequelize');module[_0xe8c1('0x0')]={'type':{'type':Sequelize[_0xe8c1('0x1')](_0xe8c1('0x2'),_0xe8c1('0x3'),_0xe8c1('0x4'),_0xe8c1('0x5'),_0xe8c1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe8c1('0x1')](_0xe8c1('0x2'),_0xe8c1('0x3'),_0xe8c1('0x4'))},'keyContent':{'type':Sequelize[_0xe8c1('0x7')]},'idField':{'type':Sequelize[_0xe8c1('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe8c1('0x7')]}}; \ No newline at end of file +var _0x6ae9=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x404fdf,_0x239067){var _0x5f0aed=function(_0x31e83b){while(--_0x31e83b){_0x404fdf['push'](_0x404fdf['shift']());}};_0x5f0aed(++_0x239067);}(_0x6ae9,0x1bd));var _0x96ae=function(_0x57d82b,_0x4189bf){_0x57d82b=_0x57d82b-0x0;var _0x28053e=_0x6ae9[_0x57d82b];return _0x28053e;};'use strict';var Sequelize=require(_0x96ae('0x0'));module[_0x96ae('0x1')]={'type':{'type':Sequelize[_0x96ae('0x2')](_0x96ae('0x3'),_0x96ae('0x4'),_0x96ae('0x5'),_0x96ae('0x6'),'picklist'),'defaultValue':_0x96ae('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x96ae('0x7')]},'keyType':{'type':Sequelize[_0x96ae('0x2')](_0x96ae('0x3'),'variable',_0x96ae('0x5'))},'keyContent':{'type':Sequelize[_0x96ae('0x7')]},'idField':{'type':Sequelize[_0x96ae('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x96ae('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x96ae('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 801eb63..5cdb0dd 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 _0x7cca=['map','ZohoField','fieldName','type','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0x7cca,0x67));var _0xa7cc=function(_0x2f0e95,_0x3e946e){_0x2f0e95=_0x2f0e95-0x0;var _0x230c64=_0x7cca[_0x2f0e95];return _0x230c64;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa7cc('0x0'));var jsonpatch=require(_0xa7cc('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa7cc('0x2'));var util=require('util');var path=require('path');var sox=require(_0xa7cc('0x3'));var csv=require(_0xa7cc('0x4'));var ejs=require(_0xa7cc('0x5'));var fs=require('fs');var fs_extra=require(_0xa7cc('0x6'));var _=require(_0xa7cc('0x7'));var squel=require(_0xa7cc('0x8'));var crypto=require(_0xa7cc('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7cc('0x4'));var querystring=require(_0xa7cc('0xa'));var Papa=require(_0xa7cc('0xb'));var Redis=require(_0xa7cc('0xc'));var authService=require(_0xa7cc('0xd'));var qs=require(_0xa7cc('0xe'));var as=require(_0xa7cc('0xf'));var hardwareService=require(_0xa7cc('0x10'));var logger=require(_0xa7cc('0x11'))(_0xa7cc('0x12'));var utils=require('../../config/utils');var config=require(_0xa7cc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7cc('0x14'))['db'];function respondWithStatusCode(_0x5e7d6f,_0x4bb91a){_0x4bb91a=_0x4bb91a||0xcc;return function(_0x27cfa5){if(_0x27cfa5){return _0x5e7d6f['sendStatus'](_0x4bb91a);}return _0x5e7d6f[_0xa7cc('0x15')](_0x4bb91a)['end']();};}function respondWithResult(_0x303d6d,_0xb49321){_0xb49321=_0xb49321||0xc8;return function(_0x258a7c){if(_0x258a7c){return _0x303d6d['status'](_0xb49321)[_0xa7cc('0x16')](_0x258a7c);}};}function respondWithFilteredResult(_0x1f965a,_0x28e3c8){return function(_0x5cc3fb){if(_0x5cc3fb){var _0x40ec57=typeof _0x28e3c8[_0xa7cc('0x17')]===_0xa7cc('0x18')&&typeof _0x28e3c8[_0xa7cc('0x19')]===_0xa7cc('0x18');var _0x22e689=_0x5cc3fb[_0xa7cc('0x1a')];var _0x1d1bd7=_0x40ec57?0x0:_0x28e3c8[_0xa7cc('0x17')];var _0xcc85f4=_0x40ec57?_0x5cc3fb[_0xa7cc('0x1a')]:_0x28e3c8[_0xa7cc('0x17')]+_0x28e3c8[_0xa7cc('0x19')];var _0x2de319;if(_0xcc85f4>=_0x22e689){_0xcc85f4=_0x22e689;_0x2de319=0xc8;}else{_0x2de319=0xce;}_0x1f965a[_0xa7cc('0x15')](_0x2de319);return _0x1f965a[_0xa7cc('0x1b')](_0xa7cc('0x1c'),_0x1d1bd7+'-'+_0xcc85f4+'/'+_0x22e689)['json'](_0x5cc3fb);}return null;};}function patchUpdates(_0x11b302){return function(_0x4d8f2c){try{jsonpatch[_0xa7cc('0x1d')](_0x4d8f2c,_0x11b302,!![]);}catch(_0x501be7){return BPromise[_0xa7cc('0x1e')](_0x501be7);}return _0x4d8f2c[_0xa7cc('0x1f')]();};}function saveUpdates(_0x4c9f30,_0x50dee2){return function(_0x1fb50f){if(_0x1fb50f){return _0x1fb50f[_0xa7cc('0x20')](_0x4c9f30)['then'](function(_0x27e311){return _0x27e311;});}return null;};}function removeEntity(_0x183c4e,_0x15b6df){return function(_0x206df2){if(_0x206df2){return _0x206df2[_0xa7cc('0x21')]()[_0xa7cc('0x22')](function(){_0x183c4e['status'](0xcc)[_0xa7cc('0x23')]();});}};}function handleEntityNotFound(_0x3c409b,_0x211bd4){return function(_0x2ca82b){if(!_0x2ca82b){_0x3c409b['sendStatus'](0x194);}return _0x2ca82b;};}function handleError(_0xb8c7c8,_0x9dad){_0x9dad=_0x9dad||0x1f4;return function(_0x541c4c){logger[_0xa7cc('0x24')](_0x541c4c[_0xa7cc('0x25')]);if(_0x541c4c[_0xa7cc('0x26')]){delete _0x541c4c[_0xa7cc('0x26')];}_0xb8c7c8['status'](_0x9dad)[_0xa7cc('0x27')](_0x541c4c);};}exports[_0xa7cc('0x28')]=function(_0x28e052,_0x134e51){var _0x40e76a={},_0x21f2ab={},_0x2cc61b={'count':0x0,'rows':[]};var _0x3d7eeb=_[_0xa7cc('0x29')](db[_0xa7cc('0x2a')]['rawAttributes'],function(_0x2beee1){return{'name':_0x2beee1[_0xa7cc('0x2b')],'type':_0x2beee1[_0xa7cc('0x2c')]['key']};});_0x21f2ab['model']=_[_0xa7cc('0x29')](_0x3d7eeb,_0xa7cc('0x26'));_0x21f2ab['query']=_[_0xa7cc('0x2d')](_0x28e052['query']);_0x21f2ab[_0xa7cc('0x2e')]=_[_0xa7cc('0x2f')](_0x21f2ab[_0xa7cc('0x30')],_0x21f2ab['query']);_0x40e76a[_0xa7cc('0x31')]=_[_0xa7cc('0x2f')](_0x21f2ab[_0xa7cc('0x30')],qs[_0xa7cc('0x32')](_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x32')]));_0x40e76a[_0xa7cc('0x31')]=_0x40e76a['attributes'][_0xa7cc('0x34')]?_0x40e76a[_0xa7cc('0x31')]:_0x21f2ab[_0xa7cc('0x30')];if(!_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x35')]('nolimit')){_0x40e76a[_0xa7cc('0x19')]=qs['limit'](_0x28e052['query'][_0xa7cc('0x19')]);_0x40e76a[_0xa7cc('0x17')]=qs['offset'](_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x17')]);}_0x40e76a[_0xa7cc('0x36')]=qs['sort'](_0x28e052[_0xa7cc('0x33')][_0xa7cc('0x37')]);_0x40e76a[_0xa7cc('0x38')]=qs['filters'](_[_0xa7cc('0x39')](_0x28e052[_0xa7cc('0x33')],_0x21f2ab[_0xa7cc('0x2e')]),_0x3d7eeb);if(_0x28e052[_0xa7cc('0x33')]['filter']){_0x40e76a['where']=_[_0xa7cc('0x3a')](_0x40e76a[_0xa7cc('0x38')],{'$or':_['map'](_0x3d7eeb,function(_0x336e35){if(_0x336e35[_0xa7cc('0x2c')]!==_0xa7cc('0x3b')){var _0x116fbb={};_0x116fbb[_0x336e35[_0xa7cc('0x26')]]={'$like':'%'+_0x28e052['query']['filter']+'%'};return _0x116fbb;}})});}_0x40e76a=_[_0xa7cc('0x3a')]({},_0x40e76a,_0x28e052[_0xa7cc('0x3c')]);var _0x16119a={'where':_0x40e76a[_0xa7cc('0x38')]};return db['ZohoField']['count'](_0x16119a)['then'](function(_0x1a629f){_0x2cc61b[_0xa7cc('0x1a')]=_0x1a629f;if(_0x28e052['query'][_0xa7cc('0x3d')]){_0x40e76a[_0xa7cc('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0xa7cc('0x3f')](_0x40e76a);})[_0xa7cc('0x22')](function(_0x409b1a){_0x2cc61b[_0xa7cc('0x40')]=_0x409b1a;return _0x2cc61b;})[_0xa7cc('0x22')](respondWithFilteredResult(_0x134e51,_0x40e76a))[_0xa7cc('0x41')](handleError(_0x134e51,null));};exports[_0xa7cc('0x42')]=function(_0xdcb834,_0x329e03){var _0x55c5ac={'raw':!![],'where':{'id':_0xdcb834[_0xa7cc('0x43')]['id']}},_0xb07bf1={};_0xb07bf1[_0xa7cc('0x30')]=_[_0xa7cc('0x2d')](db[_0xa7cc('0x2a')][_0xa7cc('0x44')]);_0xb07bf1[_0xa7cc('0x33')]=_[_0xa7cc('0x2d')](_0xdcb834[_0xa7cc('0x33')]);_0xb07bf1[_0xa7cc('0x2e')]=_[_0xa7cc('0x2f')](_0xb07bf1[_0xa7cc('0x30')],_0xb07bf1[_0xa7cc('0x33')]);_0x55c5ac[_0xa7cc('0x31')]=_[_0xa7cc('0x2f')](_0xb07bf1['model'],qs[_0xa7cc('0x32')](_0xdcb834[_0xa7cc('0x33')][_0xa7cc('0x32')]));_0x55c5ac[_0xa7cc('0x31')]=_0x55c5ac[_0xa7cc('0x31')]['length']?_0x55c5ac[_0xa7cc('0x31')]:_0xb07bf1['model'];if(_0xdcb834[_0xa7cc('0x33')][_0xa7cc('0x3d')]){_0x55c5ac[_0xa7cc('0x3e')]=[{'all':!![]}];}_0x55c5ac=_['merge']({},_0x55c5ac,_0xdcb834[_0xa7cc('0x3c')]);return db[_0xa7cc('0x2a')][_0xa7cc('0x45')](_0x55c5ac)[_0xa7cc('0x22')](handleEntityNotFound(_0x329e03,null))[_0xa7cc('0x22')](respondWithResult(_0x329e03,null))[_0xa7cc('0x41')](handleError(_0x329e03,null));};exports[_0xa7cc('0x46')]=function(_0xf41dcf,_0x3dd183){return db[_0xa7cc('0x2a')][_0xa7cc('0x46')](_0xf41dcf['body'],{})[_0xa7cc('0x22')](respondWithResult(_0x3dd183,0xc9))['catch'](handleError(_0x3dd183,null));};exports['update']=function(_0x328f8d,_0x3aed84){if(_0x328f8d[_0xa7cc('0x47')]['id']){delete _0x328f8d[_0xa7cc('0x47')]['id'];}return db[_0xa7cc('0x2a')][_0xa7cc('0x45')]({'where':{'id':_0x328f8d['params']['id']}})['then'](handleEntityNotFound(_0x3aed84,null))[_0xa7cc('0x22')](saveUpdates(_0x328f8d[_0xa7cc('0x47')],null))[_0xa7cc('0x22')](respondWithResult(_0x3aed84,null))['catch'](handleError(_0x3aed84,null));};exports[_0xa7cc('0x21')]=function(_0xbfa4de,_0x3f4278){return db['ZohoField'][_0xa7cc('0x45')]({'where':{'id':_0xbfa4de[_0xa7cc('0x43')]['id']}})[_0xa7cc('0x22')](handleEntityNotFound(_0x3f4278,null))['then'](removeEntity(_0x3f4278,null))[_0xa7cc('0x41')](handleError(_0x3f4278,null));}; \ No newline at end of file +var _0xe21a=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','ZohoField','rows','params','includeAll','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','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/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection'];(function(_0x1ce4ba,_0x379542){var _0x4e3d62=function(_0x4411c1){while(--_0x4411c1){_0x1ce4ba['push'](_0x1ce4ba['shift']());}};_0x4e3d62(++_0x379542);}(_0xe21a,0xf6));var _0xae21=function(_0x55d2d8,_0x155e63){_0x55d2d8=_0x55d2d8-0x0;var _0x501b86=_0xe21a[_0x55d2d8];return _0x501b86;};'use strict';var emlformat=require(_0xae21('0x0'));var rimraf=require(_0xae21('0x1'));var zipdir=require(_0xae21('0x2'));var jsonpatch=require(_0xae21('0x3'));var rp=require(_0xae21('0x4'));var moment=require(_0xae21('0x5'));var BPromise=require(_0xae21('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xae21('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae21('0x8'));var fs=require('fs');var fs_extra=require(_0xae21('0x9'));var _=require(_0xae21('0xa'));var squel=require(_0xae21('0xb'));var crypto=require('crypto');var jsforce=require(_0xae21('0xc'));var deskjs=require(_0xae21('0xd'));var toCsv=require(_0xae21('0xe'));var querystring=require(_0xae21('0xf'));var Papa=require(_0xae21('0x10'));var Redis=require(_0xae21('0x11'));var authService=require(_0xae21('0x12'));var qs=require(_0xae21('0x13'));var as=require(_0xae21('0x14'));var hardwareService=require(_0xae21('0x15'));var logger=require(_0xae21('0x16'))(_0xae21('0x17'));var utils=require(_0xae21('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xae21('0x19'));var db=require(_0xae21('0x1a'))['db'];function respondWithStatusCode(_0x584144,_0xd3c0d4){_0xd3c0d4=_0xd3c0d4||0xcc;return function(_0x42bed5){if(_0x42bed5){return _0x584144[_0xae21('0x1b')](_0xd3c0d4);}return _0x584144['status'](_0xd3c0d4)[_0xae21('0x1c')]();};}function respondWithResult(_0x59bdc7,_0x56f4ff){_0x56f4ff=_0x56f4ff||0xc8;return function(_0x33484f){if(_0x33484f){return _0x59bdc7[_0xae21('0x1d')](_0x56f4ff)[_0xae21('0x1e')](_0x33484f);}};}function respondWithFilteredResult(_0x32d4f5,_0xa81c25){return function(_0x300321){if(_0x300321){var _0x2cb60b=typeof _0xa81c25[_0xae21('0x1f')]===_0xae21('0x20')&&typeof _0xa81c25[_0xae21('0x21')]===_0xae21('0x20');var _0x1699f0=_0x300321[_0xae21('0x22')];var _0x2d41c0=_0x2cb60b?0x0:_0xa81c25[_0xae21('0x1f')];var _0x89972c=_0x2cb60b?_0x300321['count']:_0xa81c25['offset']+_0xa81c25[_0xae21('0x21')];var _0x2efd5e;if(_0x89972c>=_0x1699f0){_0x89972c=_0x1699f0;_0x2efd5e=0xc8;}else{_0x2efd5e=0xce;}_0x32d4f5[_0xae21('0x1d')](_0x2efd5e);return _0x32d4f5[_0xae21('0x23')](_0xae21('0x24'),_0x2d41c0+'-'+_0x89972c+'/'+_0x1699f0)[_0xae21('0x1e')](_0x300321);}return null;};}function patchUpdates(_0x3cdf7b){return function(_0x3d0742){try{jsonpatch[_0xae21('0x25')](_0x3d0742,_0x3cdf7b,!![]);}catch(_0x213226){return BPromise[_0xae21('0x26')](_0x213226);}return _0x3d0742[_0xae21('0x27')]();};}function saveUpdates(_0x2ebc09,_0x5ad1ed){return function(_0x273dee){if(_0x273dee){return _0x273dee['update'](_0x2ebc09)[_0xae21('0x28')](function(_0x30476f){return _0x30476f;});}return null;};}function removeEntity(_0x2af254,_0x139d54){return function(_0x4d6514){if(_0x4d6514){return _0x4d6514['destroy']()[_0xae21('0x28')](function(){_0x2af254['status'](0xcc)[_0xae21('0x1c')]();});}};}function handleEntityNotFound(_0xd58e69,_0x2c3847){return function(_0x558373){if(!_0x558373){_0xd58e69[_0xae21('0x1b')](0x194);}return _0x558373;};}function handleError(_0x742df6,_0x16515f){_0x16515f=_0x16515f||0x1f4;return function(_0x27555c){logger[_0xae21('0x29')](_0x27555c[_0xae21('0x2a')]);if(_0x27555c[_0xae21('0x2b')]){delete _0x27555c[_0xae21('0x2b')];}_0x742df6[_0xae21('0x1d')](_0x16515f)[_0xae21('0x2c')](_0x27555c);};}exports[_0xae21('0x2d')]=function(_0x100bd9,_0x36e65b){var _0xf75e5e={},_0x33e320={},_0xd54662={'count':0x0,'rows':[]};var _0x42e496=_[_0xae21('0x2e')](db['ZohoField']['rawAttributes'],function(_0x1a5cbf){return{'name':_0x1a5cbf[_0xae21('0x2f')],'type':_0x1a5cbf[_0xae21('0x30')][_0xae21('0x31')]};});_0x33e320['model']=_[_0xae21('0x2e')](_0x42e496,_0xae21('0x2b'));_0x33e320[_0xae21('0x32')]=_[_0xae21('0x33')](_0x100bd9[_0xae21('0x32')]);_0x33e320[_0xae21('0x34')]=_[_0xae21('0x35')](_0x33e320[_0xae21('0x36')],_0x33e320[_0xae21('0x32')]);_0xf75e5e[_0xae21('0x37')]=_['intersection'](_0x33e320['model'],qs[_0xae21('0x38')](_0x100bd9[_0xae21('0x32')]['fields']));_0xf75e5e[_0xae21('0x37')]=_0xf75e5e[_0xae21('0x37')][_0xae21('0x39')]?_0xf75e5e['attributes']:_0x33e320[_0xae21('0x36')];if(!_0x100bd9['query'][_0xae21('0x3a')](_0xae21('0x3b'))){_0xf75e5e[_0xae21('0x21')]=qs[_0xae21('0x21')](_0x100bd9[_0xae21('0x32')]['limit']);_0xf75e5e[_0xae21('0x1f')]=qs[_0xae21('0x1f')](_0x100bd9[_0xae21('0x32')][_0xae21('0x1f')]);}_0xf75e5e[_0xae21('0x3c')]=qs[_0xae21('0x3d')](_0x100bd9[_0xae21('0x32')][_0xae21('0x3d')]);_0xf75e5e[_0xae21('0x3e')]=qs[_0xae21('0x34')](_['pick'](_0x100bd9['query'],_0x33e320[_0xae21('0x34')]),_0x42e496);if(_0x100bd9[_0xae21('0x32')][_0xae21('0x3f')]){_0xf75e5e[_0xae21('0x3e')]=_[_0xae21('0x40')](_0xf75e5e['where'],{'$or':_[_0xae21('0x2e')](_0x42e496,function(_0x1a6e06){if(_0x1a6e06[_0xae21('0x30')]!=='VIRTUAL'){var _0x5e73b6={};_0x5e73b6[_0x1a6e06[_0xae21('0x2b')]]={'$like':'%'+_0x100bd9[_0xae21('0x32')][_0xae21('0x3f')]+'%'};return _0x5e73b6;}})});}_0xf75e5e=_['merge']({},_0xf75e5e,_0x100bd9['options']);var _0x494ad1={'where':_0xf75e5e['where']};return db[_0xae21('0x41')][_0xae21('0x22')](_0x494ad1)[_0xae21('0x28')](function(_0x7cb76c){_0xd54662['count']=_0x7cb76c;if(_0x100bd9[_0xae21('0x32')]['includeAll']){_0xf75e5e['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0xf75e5e);})[_0xae21('0x28')](function(_0x32bb8b){_0xd54662[_0xae21('0x42')]=_0x32bb8b;return _0xd54662;})['then'](respondWithFilteredResult(_0x36e65b,_0xf75e5e))['catch'](handleError(_0x36e65b,null));};exports['show']=function(_0x5907fa,_0x40485a){var _0xe3d9eb={'raw':!![],'where':{'id':_0x5907fa[_0xae21('0x43')]['id']}},_0x5922ef={};_0x5922ef[_0xae21('0x36')]=_[_0xae21('0x33')](db[_0xae21('0x41')]['rawAttributes']);_0x5922ef[_0xae21('0x32')]=_[_0xae21('0x33')](_0x5907fa['query']);_0x5922ef[_0xae21('0x34')]=_[_0xae21('0x35')](_0x5922ef[_0xae21('0x36')],_0x5922ef['query']);_0xe3d9eb[_0xae21('0x37')]=_['intersection'](_0x5922ef[_0xae21('0x36')],qs['fields'](_0x5907fa[_0xae21('0x32')][_0xae21('0x38')]));_0xe3d9eb[_0xae21('0x37')]=_0xe3d9eb[_0xae21('0x37')][_0xae21('0x39')]?_0xe3d9eb[_0xae21('0x37')]:_0x5922ef[_0xae21('0x36')];if(_0x5907fa[_0xae21('0x32')][_0xae21('0x44')]){_0xe3d9eb['include']=[{'all':!![]}];}_0xe3d9eb=_[_0xae21('0x40')]({},_0xe3d9eb,_0x5907fa[_0xae21('0x45')]);return db[_0xae21('0x41')][_0xae21('0x46')](_0xe3d9eb)[_0xae21('0x28')](handleEntityNotFound(_0x40485a,null))[_0xae21('0x28')](respondWithResult(_0x40485a,null))[_0xae21('0x47')](handleError(_0x40485a,null));};exports[_0xae21('0x48')]=function(_0x1d5b92,_0x3c314a){return db[_0xae21('0x41')][_0xae21('0x48')](_0x1d5b92['body'],{})[_0xae21('0x28')](respondWithResult(_0x3c314a,0xc9))['catch'](handleError(_0x3c314a,null));};exports['update']=function(_0x1d3689,_0x455cf8){if(_0x1d3689[_0xae21('0x49')]['id']){delete _0x1d3689['body']['id'];}return db['ZohoField'][_0xae21('0x46')]({'where':{'id':_0x1d3689[_0xae21('0x43')]['id']}})[_0xae21('0x28')](handleEntityNotFound(_0x455cf8,null))[_0xae21('0x28')](saveUpdates(_0x1d3689[_0xae21('0x49')],null))[_0xae21('0x28')](respondWithResult(_0x455cf8,null))[_0xae21('0x47')](handleError(_0x455cf8,null));};exports[_0xae21('0x4a')]=function(_0x33941b,_0x59e82b){return db['ZohoField']['find']({'where':{'id':_0x33941b[_0xae21('0x43')]['id']}})[_0xae21('0x28')](handleEntityNotFound(_0x59e82b,null))[_0xae21('0x28')](removeEntity(_0x59e82b,null))[_0xae21('0x47')](handleError(_0x59e82b,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 9f5868d..f30274b 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x430c=['api','moment','bluebird','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x29953d,_0x3dcad5){var _0x261168=function(_0x54e3c9){while(--_0x54e3c9){_0x29953d['push'](_0x29953d['shift']());}};_0x261168(++_0x3dcad5);}(_0x430c,0x1a1));var _0xc430=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x430c[_0x324fe8];return _0x4a1cd9;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x9'),_0xc430('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x323f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api'];(function(_0x11fd4e,_0x1a32ec){var _0x324371=function(_0x3f90a1){while(--_0x3f90a1){_0x11fd4e['push'](_0x11fd4e['shift']());}};_0x324371(++_0x1a32ec);}(_0x323f,0x1ee));var _0xf323=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x323f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));module[_0xf323('0x9')]=function(_0x371707,_0x5d7d60){return _0x371707[_0xf323('0xa')](_0xf323('0xb'),attributes,{'tableName':_0xf323('0xc'),'paranoid':![],'indexes':[{'name':_0xf323('0xd'),'fields':[_0xf323('0xe'),_0xf323('0xf')],'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 106af96..f822b96 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 _0x15f9=['ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe96a68,_0x5bbd3a){var _0x4f5d00=function(_0x3a7291){while(--_0x3a7291){_0xe96a68['push'](_0xe96a68['shift']());}};_0x4f5d00(++_0x5bbd3a);}(_0x15f9,0x164));var _0x915f=function(_0x5aa258,_0x594029){_0x5aa258=_0x5aa258-0x0;var _0x1c27de=_0x15f9[_0x5aa258];return _0x1c27de;};'use strict';var _=require(_0x915f('0x0'));var util=require(_0x915f('0x1'));var moment=require('moment');var BPromise=require(_0x915f('0x2'));var rs=require(_0x915f('0x3'));var fs=require('fs');var Redis=require(_0x915f('0x4'));var db=require(_0x915f('0x5'))['db'];var utils=require(_0x915f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x915f('0x7'));var jayson=require(_0x915f('0x8'));var client=jayson['client'][_0x915f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4695a0,_0x397f8b,_0x7d264b){return new BPromise(function(_0x22f692,_0x39bd7d){return client[_0x915f('0xa')](_0x4695a0,_0x7d264b)[_0x915f('0xb')](function(_0x36c262){logger[_0x915f('0xc')]('ZohoField,\x20%s,\x20%s',_0x397f8b,_0x915f('0xd'));logger[_0x915f('0xe')](_0x915f('0xf'),_0x397f8b,_0x915f('0xd'),JSON[_0x915f('0x10')](_0x36c262));if(_0x36c262[_0x915f('0x11')]){if(_0x36c262[_0x915f('0x11')]['code']===0x1f4){logger[_0x915f('0x11')]('ZohoField,\x20%s,\x20%s',_0x397f8b,_0x36c262[_0x915f('0x11')]['message']);return _0x39bd7d(_0x36c262[_0x915f('0x11')]['message']);}logger['error'](_0x915f('0x12'),_0x397f8b,_0x36c262['error'][_0x915f('0x13')]);return _0x22f692(_0x36c262[_0x915f('0x11')][_0x915f('0x13')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x397f8b,_0x915f('0xd'));_0x22f692(_0x36c262[_0x915f('0x14')]['message']);}})[_0x915f('0x15')](function(_0x29a46a){logger[_0x915f('0x11')](_0x915f('0x12'),_0x397f8b,_0x29a46a);_0x39bd7d(_0x29a46a);});});} \ No newline at end of file +var _0x1170=['ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x568d90,_0x4dab47){var _0x25289b=function(_0x551a7a){while(--_0x551a7a){_0x568d90['push'](_0x568d90['shift']());}};_0x25289b(++_0x4dab47);}(_0x1170,0x16e));var _0x0117=function(_0xac358e,_0x5e95a7){_0xac358e=_0xac358e-0x0;var _0x34c79a=_0x1170[_0xac358e];return _0x34c79a;};'use strict';var _=require(_0x0117('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0117('0x1'));var fs=require('fs');var Redis=require(_0x0117('0x2'));var db=require(_0x0117('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0117('0x4'))(_0x0117('0x5'));var config=require(_0x0117('0x6'));var jayson=require(_0x0117('0x7'));var client=jayson[_0x0117('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e813e,_0x1c5c52,_0x58a7ac){return new BPromise(function(_0xf0450,_0xf57883){return client[_0x0117('0x9')](_0x1e813e,_0x58a7ac)['then'](function(_0x373abf){logger['info'](_0x0117('0xa'),_0x1c5c52,_0x0117('0xb'));logger['debug'](_0x0117('0xc'),_0x1c5c52,_0x0117('0xb'),JSON['stringify'](_0x373abf));if(_0x373abf['error']){if(_0x373abf[_0x0117('0xd')][_0x0117('0xe')]===0x1f4){logger[_0x0117('0xd')]('ZohoField,\x20%s,\x20%s',_0x1c5c52,_0x373abf[_0x0117('0xd')][_0x0117('0xf')]);return _0xf57883(_0x373abf[_0x0117('0xd')][_0x0117('0xf')]);}logger[_0x0117('0xd')](_0x0117('0xa'),_0x1c5c52,_0x373abf[_0x0117('0xd')]['message']);return _0xf0450(_0x373abf[_0x0117('0xd')][_0x0117('0xf')]);}else{logger['info'](_0x0117('0xa'),_0x1c5c52,'request\x20sent');_0xf0450(_0x373abf[_0x0117('0x10')][_0x0117('0xf')]);}})[_0x0117('0x11')](function(_0x5365e6){logger[_0x0117('0xd')](_0x0117('0xa'),_0x1c5c52,_0x5365e6);_0xf57883(_0x5365e6);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 41682c6..544f49c 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(_0x4cd81b,_0x18daef){var _0xeae723=function(_0x4c5e7a){while(--_0x4c5e7a){_0x4cd81b['push'](_0x4cd81b['shift']());}};_0xeae723(++_0x18daef);}(_0x70e0,0x17b));var _0x070e=function(_0x57437d,_0x559ab5){_0x57437d=_0x57437d-0x0;var _0x18b945=_0x70e0[_0x57437d];return _0x18b945;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2a4392,_0x207355){var _0x435272=function(_0xe9f280){while(--_0xe9f280){_0x2a4392['push'](_0x2a4392['shift']());}};_0x435272(++_0x207355);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index be2fab5..86e8f45 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 _0x2a92=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x342198,_0x2539eb){var _0x2bf07c=function(_0x3dcf78){while(--_0x3dcf78){_0x342198['push'](_0x342198['shift']());}};_0x2bf07c(++_0x2539eb);}(_0x2a92,0x6f));var _0x22a9=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0x2a92[_0x48b810];return _0x23c17d;};'use strict';var Sequelize=require(_0x22a9('0x0'));module[_0x22a9('0x1')]={'name':{'type':Sequelize[_0x22a9('0x2')],'allowNull':![],'unique':_0x22a9('0x3')},'version':{'type':Sequelize[_0x22a9('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x22a9('0x2')],'defaultValue':_0x22a9('0x4')},'filename':{'type':Sequelize[_0x22a9('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x22a9('0x2')]},'size':{'type':Sequelize[_0x22a9('0x5')]},'active':{'type':Sequelize[_0x22a9('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x22a9('0x2')]},'state':{'type':Sequelize[_0x22a9('0x2')],'unique':_0x22a9('0x7')},'description':{'type':Sequelize[_0x22a9('0x2')]},'title':{'type':Sequelize[_0x22a9('0x2')]},'remoteUri':{'type':Sequelize[_0x22a9('0x2')]},'link':{'type':Sequelize[_0x22a9('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x9ddf=['BOOLEAN','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9ddf,0x1b7));var _0xf9dd=function(_0x3357b8,_0xeb406){_0x3357b8=_0x3357b8-0x0;var _0x50737a=_0x9ddf[_0x3357b8];return _0x50737a;};'use strict';var Sequelize=require('sequelize');module[_0xf9dd('0x0')]={'name':{'type':Sequelize[_0xf9dd('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xf9dd('0x1')],'allowNull':![],'unique':_0xf9dd('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xf9dd('0x3')},'filename':{'type':Sequelize[_0xf9dd('0x1')]},'path':{'type':Sequelize[_0xf9dd('0x1')]},'type':{'type':Sequelize[_0xf9dd('0x1')]},'size':{'type':Sequelize[_0xf9dd('0x4')]},'active':{'type':Sequelize[_0xf9dd('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xf9dd('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xf9dd('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xf9dd('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xf9dd('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 2f24b6c..34005a5 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 _0x4888=['lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','Integration','includeAll','include','rows','catch','params','options','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x45aa1,_0x35bf74){var _0x36cc77=function(_0x52da2d){while(--_0x52da2d){_0x45aa1['push'](_0x45aa1['shift']());}};_0x36cc77(++_0x35bf74);}(_0x4888,0x198));var _0x8488=function(_0x287e09,_0x185de8){_0x287e09=_0x287e09-0x0;var _0x31ddc0=_0x4888[_0x287e09];return _0x31ddc0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['Integration']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')](_0x52042c[_0x8488('0x42')],{})[_0x8488('0x21')](respondWithResult(_0x1f0516,0xc9))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x43')]=function(_0x299d8e,_0x1bc2e1){if(_0x299d8e[_0x8488('0x42')]['id']){delete _0x299d8e[_0x8488('0x42')]['id'];}return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x299d8e['params']['id']}})['then'](handleEntityNotFound(_0x1bc2e1,null))[_0x8488('0x21')](saveUpdates(_0x299d8e[_0x8488('0x42')],null))[_0x8488('0x21')](respondWithResult(_0x1bc2e1,null))[_0x8488('0x3e')](handleError(_0x1bc2e1,null));};exports[_0x8488('0x45')]=function(_0x22d22c,_0x25f2dc){return db[_0x8488('0x3a')][_0x8488('0x44')]({'where':{'id':_0x22d22c['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x25f2dc,null))[_0x8488('0x21')](removeEntity(_0x25f2dc,null))['catch'](handleError(_0x25f2dc,null));}; \ No newline at end of file +var _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x15bbfb,_0x1bf07f){var _0x796b18=function(_0x628df7){while(--_0x628df7){_0x15bbfb['push'](_0x15bbfb['shift']());}};_0x796b18(++_0x1bf07f);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0xfcf0[_0x1795df];return _0x3f13c0;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 01d8d84..cdf8cb4 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 _0x86dd=['bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','util','../../config/logger','api'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x86dd,0x11f));var _0xd86d=function(_0x32acb4,_0x164242){_0x32acb4=_0x32acb4-0x0;var _0x54531b=_0x86dd[_0x32acb4];return _0x54531b;};'use strict';var _=require('lodash');var util=require(_0xd86d('0x0'));var logger=require(_0xd86d('0x1'))(_0xd86d('0x2'));var moment=require('moment');var BPromise=require(_0xd86d('0x3'));var rp=require(_0xd86d('0x4'));var fs=require('fs');var path=require(_0xd86d('0x5'));var rimraf=require(_0xd86d('0x6'));var config=require('../../config/environment');var attributes=require(_0xd86d('0x7'));module[_0xd86d('0x8')]=function(_0x1774f6,_0x3168da){return _0x1774f6[_0xd86d('0x9')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6810=['Integration','integrations','lodash','util','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define'];(function(_0x4a57fb,_0x14aa24){var _0x174036=function(_0x421dcc){while(--_0x421dcc){_0x4a57fb['push'](_0x4a57fb['shift']());}};_0x174036(++_0x14aa24);}(_0x6810,0xde));var _0x0681=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6810[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0681('0x0'));var util=require(_0x0681('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0681('0x2'));var rp=require(_0x0681('0x3'));var fs=require('fs');var path=require(_0x0681('0x4'));var rimraf=require(_0x0681('0x5'));var config=require('../../config/environment');var attributes=require(_0x0681('0x6'));module[_0x0681('0x7')]=function(_0xd85568,_0x444856){return _0xd85568[_0x0681('0x8')](_0x0681('0x9'),attributes,{'tableName':_0x0681('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 44bf65f..63ecc97 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5a7f3c,_0x4121e5){var _0x3b18d4=function(_0xc8317b){while(--_0xc8317b){_0x5a7f3c['push'](_0x5a7f3c['shift']());}};_0x3b18d4(++_0x4121e5);}(_0xdb28,0x106));var _0x8db2=function(_0x12c994,_0x5e1287){_0x12c994=_0x12c994-0x0;var _0x498769=_0xdb28[_0x12c994];return _0x498769;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\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(_0x499149,_0x153f44){var _0x22999b=function(_0x1d7d8c){while(--_0x1d7d8c){_0x499149['push'](_0x499149['shift']());}};_0x22999b(++_0x153f44);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3cce71,_0x2a3f3f){_0x3cce71=_0x3cce71-0x0;var _0x38238f=_0xc6ac[_0x3cce71];return _0x38238f;};'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']('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index ed9dd77..41a4dfa 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 _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0xd943,0x15d));var _0x3d94=function(_0x27f4d7,_0x527300){_0x27f4d7=_0x27f4d7-0x0;var _0x17c50b=_0xd943[_0x27f4d7];return _0x17c50b;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file +var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x896e,0x1e9));var _0xe896=function(_0x2a755d,_0x1d2486){_0x2a755d=_0x2a755d-0x0;var _0x425a66=_0x896e[_0x2a755d];return _0x425a66;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 46078b5..1937af5 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 _0xa6a9=['BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x2d4042,_0x40bec6){var _0x53fae0=function(_0x3d709e){while(--_0x3d709e){_0x2d4042['push'](_0x2d4042['shift']());}};_0x53fae0(++_0x40bec6);}(_0xa6a9,0xe2));var _0x9a6a=function(_0x2f023d,_0x29dfe5){_0x2f023d=_0x2f023d-0x0;var _0x4ef240=_0xa6a9[_0x2f023d];return _0x4ef240;};'use strict';var Sequelize=require(_0x9a6a('0x0'));module[_0x9a6a('0x1')]={'integration':{'type':Sequelize[_0x9a6a('0x2')]},'eventChannel':{'type':Sequelize[_0x9a6a('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x9a6a('0x2')]},'integrationId':{'type':Sequelize[_0x9a6a('0x3')]},'contacts':{'type':Sequelize[_0x9a6a('0x2')]},'uniqueid':{'type':Sequelize[_0x9a6a('0x2')]},'calleridnum':{'type':Sequelize[_0x9a6a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9a6a('0x2')]},'interface':{'type':Sequelize[_0x9a6a('0x2')]},'membername':{'type':Sequelize[_0x9a6a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9a6a('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9a6a('0x3')]},'agentcomplete':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9a6a('0x4')]},'talktime':{'type':Sequelize[_0x9a6a('0x3')]},'agentacw':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9a6a('0x3')]},'reason':{'type':Sequelize[_0x9a6a('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9a6a('0x4')]},'agentdump':{'type':Sequelize[_0x9a6a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x9a6a('0x4')]},'lastevent':{'type':Sequelize[_0x9a6a('0x2')]},'channel':{'type':Sequelize[_0x9a6a('0x2')]},'channelstate':{'type':Sequelize[_0x9a6a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9a6a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9a6a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9a6a('0x2')]},'exten':{'type':Sequelize[_0x9a6a('0x2')]},'priority':{'type':Sequelize[_0x9a6a('0x2')]},'destchannel':{'type':Sequelize[_0x9a6a('0x2')]},'destchannelstate':{'type':Sequelize[_0x9a6a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9a6a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9a6a('0x2')]},'destcalleridname':{'type':Sequelize[_0x9a6a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9a6a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9a6a('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9a6a('0x2')]},'destcontext':{'type':Sequelize[_0x9a6a('0x2')]},'destexten':{'type':Sequelize[_0x9a6a('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x9a6a('0x2')]},'messageId':{'type':Sequelize[_0x9a6a('0x2')]},'inReplyTo':{'type':Sequelize[_0x9a6a('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9a6a('0x2')]},'cc':{'type':Sequelize[_0x9a6a('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x9a6a('0x6')]},'text':{'type':Sequelize[_0x9a6a('0x6')]},'status':{'type':Sequelize['ENUM'](_0x9a6a('0x7'),_0x9a6a('0x8'),_0x9a6a('0x9'),_0x9a6a('0xa'))},'url':{'type':Sequelize[_0x9a6a('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5a09=['ENUM','SENT','SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x5acceb,_0x49c3e7){var _0x13a5ad=function(_0x3c2706){while(--_0x3c2706){_0x5acceb['push'](_0x5acceb['shift']());}};_0x13a5ad(++_0x49c3e7);}(_0x5a09,0xd6));var _0x95a0=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0x5a09[_0x452968];return _0xb6f9ae;};'use strict';var Sequelize=require('sequelize');module[_0x95a0('0x0')]={'integration':{'type':Sequelize[_0x95a0('0x1')]},'eventChannel':{'type':Sequelize[_0x95a0('0x1')]},'exitStatus':{'type':Sequelize[_0x95a0('0x1')]},'ticketId':{'type':Sequelize[_0x95a0('0x1')]},'integrationId':{'type':Sequelize[_0x95a0('0x2')]},'contacts':{'type':Sequelize[_0x95a0('0x1')]},'uniqueid':{'type':Sequelize[_0x95a0('0x1')]},'calleridnum':{'type':Sequelize[_0x95a0('0x1')]},'calleridname':{'type':Sequelize[_0x95a0('0x1')]},'queue':{'type':Sequelize[_0x95a0('0x1')]},'interface':{'type':Sequelize[_0x95a0('0x1')]},'membername':{'type':Sequelize[_0x95a0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x95a0('0x3')]},'agentconnectAt':{'type':Sequelize[_0x95a0('0x3')]},'holdtime':{'type':Sequelize[_0x95a0('0x2')]},'agentcomplete':{'type':Sequelize[_0x95a0('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x95a0('0x3')]},'talktime':{'type':Sequelize[_0x95a0('0x2')]},'agentacw':{'type':Sequelize[_0x95a0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x95a0('0x2')]},'reason':{'type':Sequelize[_0x95a0('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x95a0('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x95a0('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x95a0('0x3')]},'lastevent':{'type':Sequelize[_0x95a0('0x1')]},'channel':{'type':Sequelize[_0x95a0('0x1')]},'channelstate':{'type':Sequelize[_0x95a0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x95a0('0x1')]},'connectedlinename':{'type':Sequelize[_0x95a0('0x1')]},'language':{'type':Sequelize[_0x95a0('0x1')]},'accountcode':{'type':Sequelize[_0x95a0('0x1')]},'context':{'type':Sequelize[_0x95a0('0x1')]},'exten':{'type':Sequelize[_0x95a0('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x95a0('0x1')]},'destchannelstate':{'type':Sequelize[_0x95a0('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x95a0('0x1')]},'destcalleridname':{'type':Sequelize[_0x95a0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x95a0('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x95a0('0x1')]},'destaccountcode':{'type':Sequelize[_0x95a0('0x1')]},'destcontext':{'type':Sequelize[_0x95a0('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x95a0('0x1')]},'messageId':{'type':Sequelize[_0x95a0('0x1')]},'inReplyTo':{'type':Sequelize[_0x95a0('0x1')]},'subject':{'type':Sequelize[_0x95a0('0x1')]},'from':{'type':Sequelize[_0x95a0('0x1')]},'to':{'type':Sequelize[_0x95a0('0x1')]},'cc':{'type':Sequelize[_0x95a0('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x95a0('0x5')]},'text':{'type':Sequelize[_0x95a0('0x5')]},'status':{'type':Sequelize[_0x95a0('0x6')](_0x95a0('0x7'),_0x95a0('0x8'),_0x95a0('0x9'),_0x95a0('0xa'))},'url':{'type':Sequelize[_0x95a0('0x1')]},'app':{'type':Sequelize[_0x95a0('0x1')]},'appdata':{'type':Sequelize[_0x95a0('0x1')]},'projectId':{'type':Sequelize[_0x95a0('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c98e414..33cdb9e 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 _0x61fb=['end','json','offset','undefined','count','limit','set','apply','reject','save','then','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','includeAll','show','params','include','options','catch','create','find','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x53e999,_0xc7195b){var _0x3fa453=function(_0x5a6b86){while(--_0x5a6b86){_0x53e999['push'](_0x53e999['shift']());}};_0x3fa453(++_0xc7195b);}(_0x61fb,0x1b2));var _0xb61f=function(_0x2b95ae,_0xa0a178){_0x2b95ae=_0x2b95ae-0x0;var _0x36ffbd=_0x61fb[_0x2b95ae];return _0x36ffbd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb61f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb61f('0x1'));var rp=require(_0xb61f('0x2'));var moment=require(_0xb61f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb61f('0x4'));var util=require(_0xb61f('0x5'));var path=require(_0xb61f('0x6'));var sox=require(_0xb61f('0x7'));var csv=require(_0xb61f('0x8'));var ejs=require(_0xb61f('0x9'));var fs=require('fs');var fs_extra=require(_0xb61f('0xa'));var _=require(_0xb61f('0xb'));var squel=require(_0xb61f('0xc'));var crypto=require(_0xb61f('0xd'));var jsforce=require(_0xb61f('0xe'));var deskjs=require(_0xb61f('0xf'));var toCsv=require(_0xb61f('0x8'));var querystring=require('querystring');var Papa=require(_0xb61f('0x10'));var Redis=require(_0xb61f('0x11'));var authService=require(_0xb61f('0x12'));var qs=require(_0xb61f('0x13'));var as=require(_0xb61f('0x14'));var hardwareService=require(_0xb61f('0x15'));var logger=require(_0xb61f('0x16'))(_0xb61f('0x17'));var utils=require('../../config/utils');var config=require(_0xb61f('0x18'));var licenseUtil=require(_0xb61f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e597c,_0x3fc7a4){_0x3fc7a4=_0x3fc7a4||0xcc;return function(_0x3241de){if(_0x3241de){return _0x3e597c[_0xb61f('0x1a')](_0x3fc7a4);}return _0x3e597c[_0xb61f('0x1b')](_0x3fc7a4)[_0xb61f('0x1c')]();};}function respondWithResult(_0x12ef5e,_0x470c5e){_0x470c5e=_0x470c5e||0xc8;return function(_0xab0c3b){if(_0xab0c3b){return _0x12ef5e['status'](_0x470c5e)[_0xb61f('0x1d')](_0xab0c3b);}};}function respondWithFilteredResult(_0x5e93da,_0x4f340c){return function(_0x1cffcd){if(_0x1cffcd){var _0x364b55=typeof _0x4f340c[_0xb61f('0x1e')]===_0xb61f('0x1f')&&typeof _0x4f340c['limit']==='undefined';var _0x394360=_0x1cffcd[_0xb61f('0x20')];var _0x466385=_0x364b55?0x0:_0x4f340c['offset'];var _0x272024=_0x364b55?_0x1cffcd[_0xb61f('0x20')]:_0x4f340c[_0xb61f('0x1e')]+_0x4f340c[_0xb61f('0x21')];var _0x2ba024;if(_0x272024>=_0x394360){_0x272024=_0x394360;_0x2ba024=0xc8;}else{_0x2ba024=0xce;}_0x5e93da[_0xb61f('0x1b')](_0x2ba024);return _0x5e93da[_0xb61f('0x22')]('Content-Range',_0x466385+'-'+_0x272024+'/'+_0x394360)[_0xb61f('0x1d')](_0x1cffcd);}return null;};}function patchUpdates(_0x2798c6){return function(_0x3609cf){try{jsonpatch[_0xb61f('0x23')](_0x3609cf,_0x2798c6,!![]);}catch(_0x37f7bf){return BPromise[_0xb61f('0x24')](_0x37f7bf);}return _0x3609cf[_0xb61f('0x25')]();};}function saveUpdates(_0x303147,_0x465646){return function(_0x2c81eb){if(_0x2c81eb){return _0x2c81eb['update'](_0x303147)[_0xb61f('0x26')](function(_0x4b0546){return _0x4b0546;});}return null;};}function removeEntity(_0x4bd283,_0x39bbea){return function(_0x5a1679){if(_0x5a1679){return _0x5a1679['destroy']()[_0xb61f('0x26')](function(){_0x4bd283[_0xb61f('0x1b')](0xcc)[_0xb61f('0x1c')]();});}};}function handleEntityNotFound(_0x3a1be8,_0xc58937){return function(_0x482789){if(!_0x482789){_0x3a1be8[_0xb61f('0x1a')](0x194);}return _0x482789;};}function handleError(_0x28cee6,_0x2b2449){_0x2b2449=_0x2b2449||0x1f4;return function(_0x4e8da8){logger[_0xb61f('0x27')](_0x4e8da8[_0xb61f('0x28')]);if(_0x4e8da8[_0xb61f('0x29')]){delete _0x4e8da8[_0xb61f('0x29')];}_0x28cee6[_0xb61f('0x1b')](_0x2b2449)[_0xb61f('0x2a')](_0x4e8da8);};}exports[_0xb61f('0x2b')]=function(_0x9aa4e1,_0x306345){var _0x22f8c8={},_0x1ad1b9={},_0x553c17={'count':0x0,'rows':[]};var _0x42f697=_['map'](db[_0xb61f('0x2c')][_0xb61f('0x2d')],function(_0x2098e0){return{'name':_0x2098e0[_0xb61f('0x2e')],'type':_0x2098e0[_0xb61f('0x2f')][_0xb61f('0x30')]};});_0x1ad1b9[_0xb61f('0x31')]=_['map'](_0x42f697,_0xb61f('0x29'));_0x1ad1b9['query']=_[_0xb61f('0x32')](_0x9aa4e1[_0xb61f('0x33')]);_0x1ad1b9[_0xb61f('0x34')]=_[_0xb61f('0x35')](_0x1ad1b9[_0xb61f('0x31')],_0x1ad1b9[_0xb61f('0x33')]);_0x22f8c8[_0xb61f('0x36')]=_[_0xb61f('0x35')](_0x1ad1b9[_0xb61f('0x31')],qs[_0xb61f('0x37')](_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x37')]));_0x22f8c8['attributes']=_0x22f8c8[_0xb61f('0x36')][_0xb61f('0x38')]?_0x22f8c8[_0xb61f('0x36')]:_0x1ad1b9['model'];if(!_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x39')](_0xb61f('0x3a'))){_0x22f8c8[_0xb61f('0x21')]=qs[_0xb61f('0x21')](_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x21')]);_0x22f8c8[_0xb61f('0x1e')]=qs[_0xb61f('0x1e')](_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x1e')]);}_0x22f8c8[_0xb61f('0x3b')]=qs[_0xb61f('0x3c')](_0x9aa4e1[_0xb61f('0x33')]['sort']);_0x22f8c8[_0xb61f('0x3d')]=qs[_0xb61f('0x34')](_['pick'](_0x9aa4e1['query'],_0x1ad1b9['filters']),_0x42f697);if(_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x3e')]){_0x22f8c8[_0xb61f('0x3d')]=_['merge'](_0x22f8c8[_0xb61f('0x3d')],{'$or':_[_0xb61f('0x3f')](_0x42f697,function(_0x3cc096){if(_0x3cc096[_0xb61f('0x2f')]!==_0xb61f('0x40')){var _0x108da2={};_0x108da2[_0x3cc096['name']]={'$like':'%'+_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x3e')]+'%'};return _0x108da2;}})});}_0x22f8c8=_[_0xb61f('0x41')]({},_0x22f8c8,_0x9aa4e1['options']);var _0x3fb4c4={'where':_0x22f8c8[_0xb61f('0x3d')]};return db['IntegrationReport'][_0xb61f('0x20')](_0x3fb4c4)[_0xb61f('0x26')](function(_0xf76553){_0x553c17[_0xb61f('0x20')]=_0xf76553;if(_0x9aa4e1[_0xb61f('0x33')][_0xb61f('0x42')]){_0x22f8c8['include']=[{'all':!![]}];}return db[_0xb61f('0x2c')]['findAll'](_0x22f8c8);})[_0xb61f('0x26')](function(_0x3a194f){_0x553c17['rows']=_0x3a194f;return _0x553c17;})[_0xb61f('0x26')](respondWithFilteredResult(_0x306345,_0x22f8c8))['catch'](handleError(_0x306345,null));};exports[_0xb61f('0x43')]=function(_0x47a96b,_0x37e814){var _0x5c1796={'raw':![],'where':{'id':_0x47a96b[_0xb61f('0x44')]['id']}},_0x437dbe={};_0x437dbe[_0xb61f('0x31')]=_[_0xb61f('0x32')](db[_0xb61f('0x2c')]['rawAttributes']);_0x437dbe[_0xb61f('0x33')]=_[_0xb61f('0x32')](_0x47a96b['query']);_0x437dbe[_0xb61f('0x34')]=_[_0xb61f('0x35')](_0x437dbe[_0xb61f('0x31')],_0x437dbe['query']);_0x5c1796[_0xb61f('0x36')]=_[_0xb61f('0x35')](_0x437dbe[_0xb61f('0x31')],qs[_0xb61f('0x37')](_0x47a96b['query'][_0xb61f('0x37')]));_0x5c1796[_0xb61f('0x36')]=_0x5c1796['attributes']['length']?_0x5c1796[_0xb61f('0x36')]:_0x437dbe['model'];if(_0x47a96b['query'][_0xb61f('0x42')]){_0x5c1796[_0xb61f('0x45')]=[{'all':!![]}];}_0x5c1796=_[_0xb61f('0x41')]({},_0x5c1796,_0x47a96b[_0xb61f('0x46')]);return db['IntegrationReport']['find'](_0x5c1796)[_0xb61f('0x26')](handleEntityNotFound(_0x37e814,null))[_0xb61f('0x26')](respondWithResult(_0x37e814,null))[_0xb61f('0x47')](handleError(_0x37e814,null));};exports[_0xb61f('0x48')]=function(_0x158e8c,_0x49acee){return db['IntegrationReport'][_0xb61f('0x48')](_0x158e8c['body'],{})[_0xb61f('0x26')](respondWithResult(_0x49acee,0xc9))[_0xb61f('0x47')](handleError(_0x49acee,null));};exports['update']=function(_0x51b93b,_0x18e649){if(_0x51b93b['body']['id']){delete _0x51b93b['body']['id'];}return db['IntegrationReport'][_0xb61f('0x49')]({'where':{'id':_0x51b93b[_0xb61f('0x44')]['id']}})[_0xb61f('0x26')](handleEntityNotFound(_0x18e649,null))[_0xb61f('0x26')](saveUpdates(_0x51b93b[_0xb61f('0x4a')],null))[_0xb61f('0x26')](respondWithResult(_0x18e649,null))[_0xb61f('0x47')](handleError(_0x18e649,null));};exports[_0xb61f('0x4b')]=function(_0x168886,_0xb1e475){return db[_0xb61f('0x2c')][_0xb61f('0x49')]({'where':{'id':_0x168886[_0xb61f('0x44')]['id']}})[_0xb61f('0x26')](handleEntityNotFound(_0xb1e475,null))['then'](removeEntity(_0xb1e475,null))[_0xb61f('0x47')](handleError(_0xb1e475,null));};exports[_0xb61f('0x4c')]=function(_0x3369fb,_0x231403){return db[_0xb61f('0x2c')][_0xb61f('0x4c')]()[_0xb61f('0x26')](respondWithResult(_0x231403,null))[_0xb61f('0x47')](handleError(_0x231403,null));}; \ No newline at end of file +var _0xcbff=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','save','update','then','destroy','end','error','stack','name','send','index','map','IntegrationReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x45e651,_0x19aec4){var _0x4356d4=function(_0xdb3f44){while(--_0xdb3f44){_0x45e651['push'](_0x45e651['shift']());}};_0x4356d4(++_0x19aec4);}(_0xcbff,0xfb));var _0xfcbf=function(_0x27edba,_0x3b8b4f){_0x27edba=_0x27edba-0x0;var _0x4d2d31=_0xcbff[_0x27edba];return _0x4d2d31;};'use strict';var emlformat=require(_0xfcbf('0x0'));var rimraf=require(_0xfcbf('0x1'));var zipdir=require(_0xfcbf('0x2'));var jsonpatch=require(_0xfcbf('0x3'));var rp=require(_0xfcbf('0x4'));var moment=require(_0xfcbf('0x5'));var BPromise=require(_0xfcbf('0x6'));var Mustache=require('mustache');var util=require(_0xfcbf('0x7'));var path=require(_0xfcbf('0x8'));var sox=require(_0xfcbf('0x9'));var csv=require(_0xfcbf('0xa'));var ejs=require(_0xfcbf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcbf('0xc'));var squel=require(_0xfcbf('0xd'));var crypto=require(_0xfcbf('0xe'));var jsforce=require(_0xfcbf('0xf'));var deskjs=require(_0xfcbf('0x10'));var toCsv=require(_0xfcbf('0xa'));var querystring=require(_0xfcbf('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcbf('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcbf('0x13'));var logger=require(_0xfcbf('0x14'))(_0xfcbf('0x15'));var utils=require(_0xfcbf('0x16'));var config=require(_0xfcbf('0x17'));var licenseUtil=require(_0xfcbf('0x18'));var db=require(_0xfcbf('0x19'))['db'];function respondWithStatusCode(_0x1ae5f4,_0x67d774){_0x67d774=_0x67d774||0xcc;return function(_0x1c2908){if(_0x1c2908){return _0x1ae5f4[_0xfcbf('0x1a')](_0x67d774);}return _0x1ae5f4[_0xfcbf('0x1b')](_0x67d774)['end']();};}function respondWithResult(_0x14a3b4,_0x1d478b){_0x1d478b=_0x1d478b||0xc8;return function(_0x6cd04f){if(_0x6cd04f){return _0x14a3b4[_0xfcbf('0x1b')](_0x1d478b)[_0xfcbf('0x1c')](_0x6cd04f);}};}function respondWithFilteredResult(_0x47b2e8,_0x2a7bfe){return function(_0x3b35dd){if(_0x3b35dd){var _0x219216=typeof _0x2a7bfe[_0xfcbf('0x1d')]==='undefined'&&typeof _0x2a7bfe['limit']===_0xfcbf('0x1e');var _0x17ea07=_0x3b35dd[_0xfcbf('0x1f')];var _0x16c867=_0x219216?0x0:_0x2a7bfe[_0xfcbf('0x1d')];var _0x37a46c=_0x219216?_0x3b35dd[_0xfcbf('0x1f')]:_0x2a7bfe[_0xfcbf('0x1d')]+_0x2a7bfe[_0xfcbf('0x20')];var _0x2c5099;if(_0x37a46c>=_0x17ea07){_0x37a46c=_0x17ea07;_0x2c5099=0xc8;}else{_0x2c5099=0xce;}_0x47b2e8['status'](_0x2c5099);return _0x47b2e8['set']('Content-Range',_0x16c867+'-'+_0x37a46c+'/'+_0x17ea07)[_0xfcbf('0x1c')](_0x3b35dd);}return null;};}function patchUpdates(_0x4feab3){return function(_0x467f02){try{jsonpatch[_0xfcbf('0x21')](_0x467f02,_0x4feab3,!![]);}catch(_0x519223){return BPromise['reject'](_0x519223);}return _0x467f02[_0xfcbf('0x22')]();};}function saveUpdates(_0x2834be,_0x52a92a){return function(_0x360067){if(_0x360067){return _0x360067[_0xfcbf('0x23')](_0x2834be)[_0xfcbf('0x24')](function(_0x481ae4){return _0x481ae4;});}return null;};}function removeEntity(_0x5580c0,_0x1c025c){return function(_0x3d5864){if(_0x3d5864){return _0x3d5864[_0xfcbf('0x25')]()[_0xfcbf('0x24')](function(){_0x5580c0['status'](0xcc)[_0xfcbf('0x26')]();});}};}function handleEntityNotFound(_0xad7fdc,_0x44ebb4){return function(_0x33d0b1){if(!_0x33d0b1){_0xad7fdc[_0xfcbf('0x1a')](0x194);}return _0x33d0b1;};}function handleError(_0x477897,_0x81e043){_0x81e043=_0x81e043||0x1f4;return function(_0xaa6910){logger[_0xfcbf('0x27')](_0xaa6910[_0xfcbf('0x28')]);if(_0xaa6910[_0xfcbf('0x29')]){delete _0xaa6910[_0xfcbf('0x29')];}_0x477897[_0xfcbf('0x1b')](_0x81e043)[_0xfcbf('0x2a')](_0xaa6910);};}exports[_0xfcbf('0x2b')]=function(_0x51e4ce,_0x1f48ad){var _0x129990={},_0x8e10e={},_0x5ce71e={'count':0x0,'rows':[]};var _0x47307d=_[_0xfcbf('0x2c')](db[_0xfcbf('0x2d')]['rawAttributes'],function(_0x26bbe9){return{'name':_0x26bbe9[_0xfcbf('0x2e')],'type':_0x26bbe9[_0xfcbf('0x2f')][_0xfcbf('0x30')]};});_0x8e10e['model']=_[_0xfcbf('0x2c')](_0x47307d,_0xfcbf('0x29'));_0x8e10e[_0xfcbf('0x31')]=_[_0xfcbf('0x32')](_0x51e4ce['query']);_0x8e10e[_0xfcbf('0x33')]=_[_0xfcbf('0x34')](_0x8e10e[_0xfcbf('0x35')],_0x8e10e['query']);_0x129990[_0xfcbf('0x36')]=_['intersection'](_0x8e10e[_0xfcbf('0x35')],qs[_0xfcbf('0x37')](_0x51e4ce[_0xfcbf('0x31')]['fields']));_0x129990[_0xfcbf('0x36')]=_0x129990[_0xfcbf('0x36')][_0xfcbf('0x38')]?_0x129990[_0xfcbf('0x36')]:_0x8e10e[_0xfcbf('0x35')];if(!_0x51e4ce[_0xfcbf('0x31')][_0xfcbf('0x39')](_0xfcbf('0x3a'))){_0x129990[_0xfcbf('0x20')]=qs[_0xfcbf('0x20')](_0x51e4ce[_0xfcbf('0x31')][_0xfcbf('0x20')]);_0x129990[_0xfcbf('0x1d')]=qs[_0xfcbf('0x1d')](_0x51e4ce[_0xfcbf('0x31')][_0xfcbf('0x1d')]);}_0x129990[_0xfcbf('0x3b')]=qs[_0xfcbf('0x3c')](_0x51e4ce['query'][_0xfcbf('0x3c')]);_0x129990[_0xfcbf('0x3d')]=qs[_0xfcbf('0x33')](_[_0xfcbf('0x3e')](_0x51e4ce[_0xfcbf('0x31')],_0x8e10e[_0xfcbf('0x33')]),_0x47307d);if(_0x51e4ce[_0xfcbf('0x31')][_0xfcbf('0x3f')]){_0x129990[_0xfcbf('0x3d')]=_[_0xfcbf('0x40')](_0x129990[_0xfcbf('0x3d')],{'$or':_[_0xfcbf('0x2c')](_0x47307d,function(_0x77321e){if(_0x77321e['type']!==_0xfcbf('0x41')){var _0x1a6884={};_0x1a6884[_0x77321e[_0xfcbf('0x29')]]={'$like':'%'+_0x51e4ce[_0xfcbf('0x31')][_0xfcbf('0x3f')]+'%'};return _0x1a6884;}})});}_0x129990=_['merge']({},_0x129990,_0x51e4ce[_0xfcbf('0x42')]);var _0x1cfb6e={'where':_0x129990[_0xfcbf('0x3d')]};return db[_0xfcbf('0x2d')][_0xfcbf('0x1f')](_0x1cfb6e)[_0xfcbf('0x24')](function(_0x26b49e){_0x5ce71e[_0xfcbf('0x1f')]=_0x26b49e;if(_0x51e4ce[_0xfcbf('0x31')][_0xfcbf('0x43')]){_0x129990['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xfcbf('0x44')](_0x129990);})['then'](function(_0x4ac1d8){_0x5ce71e[_0xfcbf('0x45')]=_0x4ac1d8;return _0x5ce71e;})[_0xfcbf('0x24')](respondWithFilteredResult(_0x1f48ad,_0x129990))[_0xfcbf('0x46')](handleError(_0x1f48ad,null));};exports['show']=function(_0x2a9747,_0x4704a6){var _0x23b8cd={'raw':![],'where':{'id':_0x2a9747['params']['id']}},_0x3aedc0={};_0x3aedc0[_0xfcbf('0x35')]=_[_0xfcbf('0x32')](db['IntegrationReport']['rawAttributes']);_0x3aedc0[_0xfcbf('0x31')]=_['keys'](_0x2a9747[_0xfcbf('0x31')]);_0x3aedc0[_0xfcbf('0x33')]=_[_0xfcbf('0x34')](_0x3aedc0['model'],_0x3aedc0[_0xfcbf('0x31')]);_0x23b8cd[_0xfcbf('0x36')]=_[_0xfcbf('0x34')](_0x3aedc0[_0xfcbf('0x35')],qs[_0xfcbf('0x37')](_0x2a9747[_0xfcbf('0x31')]['fields']));_0x23b8cd['attributes']=_0x23b8cd[_0xfcbf('0x36')][_0xfcbf('0x38')]?_0x23b8cd[_0xfcbf('0x36')]:_0x3aedc0[_0xfcbf('0x35')];if(_0x2a9747[_0xfcbf('0x31')]['includeAll']){_0x23b8cd[_0xfcbf('0x47')]=[{'all':!![]}];}_0x23b8cd=_[_0xfcbf('0x40')]({},_0x23b8cd,_0x2a9747[_0xfcbf('0x42')]);return db[_0xfcbf('0x2d')][_0xfcbf('0x48')](_0x23b8cd)[_0xfcbf('0x24')](handleEntityNotFound(_0x4704a6,null))[_0xfcbf('0x24')](respondWithResult(_0x4704a6,null))['catch'](handleError(_0x4704a6,null));};exports[_0xfcbf('0x49')]=function(_0x224c3d,_0x319f8d){return db[_0xfcbf('0x2d')][_0xfcbf('0x49')](_0x224c3d[_0xfcbf('0x4a')],{})['then'](respondWithResult(_0x319f8d,0xc9))[_0xfcbf('0x46')](handleError(_0x319f8d,null));};exports[_0xfcbf('0x23')]=function(_0x2b1016,_0xe11537){if(_0x2b1016[_0xfcbf('0x4a')]['id']){delete _0x2b1016[_0xfcbf('0x4a')]['id'];}return db[_0xfcbf('0x2d')][_0xfcbf('0x48')]({'where':{'id':_0x2b1016['params']['id']}})['then'](handleEntityNotFound(_0xe11537,null))['then'](saveUpdates(_0x2b1016[_0xfcbf('0x4a')],null))[_0xfcbf('0x24')](respondWithResult(_0xe11537,null))[_0xfcbf('0x46')](handleError(_0xe11537,null));};exports[_0xfcbf('0x25')]=function(_0x5b40b2,_0x544a55){return db[_0xfcbf('0x2d')][_0xfcbf('0x48')]({'where':{'id':_0x5b40b2[_0xfcbf('0x4b')]['id']}})[_0xfcbf('0x24')](handleEntityNotFound(_0x544a55,null))[_0xfcbf('0x24')](removeEntity(_0x544a55,null))[_0xfcbf('0x46')](handleError(_0x544a55,null));};exports[_0xfcbf('0x4c')]=function(_0x1e915a,_0x1ca50a){return db[_0xfcbf('0x2d')]['describe']()[_0xfcbf('0x24')](respondWithResult(_0x1ca50a,null))[_0xfcbf('0x46')](handleError(_0x1ca50a,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index ed4f80c..f871e57 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 _0xde70=['lodash','util','api','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','IntegrationReport','report_integration'];(function(_0x41b65f,_0x416f40){var _0x5a3aca=function(_0xb5ff2d){while(--_0xb5ff2d){_0x41b65f['push'](_0x41b65f['shift']());}};_0x5a3aca(++_0x416f40);}(_0xde70,0x1b8));var _0x0de7=function(_0x43f47b,_0x311636){_0x43f47b=_0x43f47b-0x0;var _0x4af9a6=_0xde70[_0x43f47b];return _0x4af9a6;};'use strict';var _=require(_0x0de7('0x0'));var util=require(_0x0de7('0x1'));var logger=require('../../config/logger')(_0x0de7('0x2'));var moment=require('moment');var BPromise=require(_0x0de7('0x3'));var rp=require(_0x0de7('0x4'));var fs=require('fs');var path=require(_0x0de7('0x5'));var rimraf=require(_0x0de7('0x6'));var config=require('../../config/environment');var attributes=require(_0x0de7('0x7'));module[_0x0de7('0x8')]=function(_0x119861,_0x3264f8){return _0x119861['define'](_0x0de7('0x9'),attributes,{'tableName':_0x0de7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8df3=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','IntegrationReport','util'];(function(_0x3e6729,_0x16d4af){var _0x535bcd=function(_0x5e6c5f){while(--_0x5e6c5f){_0x3e6729['push'](_0x3e6729['shift']());}};_0x535bcd(++_0x16d4af);}(_0x8df3,0xfc));var _0x38df=function(_0x2ccf81,_0x4bbda0){_0x2ccf81=_0x2ccf81-0x0;var _0x2fdfe9=_0x8df3[_0x2ccf81];return _0x2fdfe9;};'use strict';var _=require('lodash');var util=require(_0x38df('0x0'));var logger=require(_0x38df('0x1'))(_0x38df('0x2'));var moment=require(_0x38df('0x3'));var BPromise=require('bluebird');var rp=require(_0x38df('0x4'));var fs=require('fs');var path=require(_0x38df('0x5'));var rimraf=require(_0x38df('0x6'));var config=require(_0x38df('0x7'));var attributes=require('./integrationReport.attributes');module[_0x38df('0x8')]=function(_0x166f20,_0x52fbe4){return _0x166f20[_0x38df('0x9')](_0x38df('0xa'),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 44ca169..8b53f46 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x399cb4,_0x30bd73){_0x399cb4=_0x399cb4-0x0;var _0x41c0e3=_0x3f8a[_0x399cb4];return _0x41c0e3;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x54cb64,_0x34338f){var _0x1e91ea=function(_0x18ca1f){while(--_0x18ca1f){_0x54cb64['push'](_0x54cb64['shift']());}};_0x1e91ea(++_0x34338f);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('IntegrationReport,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 936a731..7af1a90 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 _0x7923=['/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','isAuthenticated','addIntervals','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','index','/:id'];(function(_0x1d6cc5,_0x10597e){var _0x43186a=function(_0x3dcf2f){while(--_0x3dcf2f){_0x1d6cc5['push'](_0x1d6cc5['shift']());}};_0x43186a(++_0x10597e);}(_0x7923,0x8f));var _0x3792=function(_0x40ae5f,_0x4ce8e1){_0x40ae5f=_0x40ae5f-0x0;var _0x5d82c5=_0x7923[_0x40ae5f];return _0x5d82c5;};'use strict';var multer=require(_0x3792('0x0'));var util=require(_0x3792('0x1'));var path=require(_0x3792('0x2'));var timeout=require(_0x3792('0x3'));var express=require(_0x3792('0x4'));var router=express[_0x3792('0x5')]();var fs_extra=require(_0x3792('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3792('0x7'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x3792('0x8')]('/',auth['isAuthenticated'](),controller[_0x3792('0x9')]);router[_0x3792('0x8')](_0x3792('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3792('0x8')](_0x3792('0xb'),auth['isAuthenticated'](),controller[_0x3792('0xc')]);router[_0x3792('0xd')]('/',auth['isAuthenticated'](),controller[_0x3792('0xe')]);router[_0x3792('0xd')](_0x3792('0xb'),auth['isAuthenticated'](),controller['addInterval']);router[_0x3792('0xd')](_0x3792('0xf'),auth[_0x3792('0x10')](),controller[_0x3792('0x11')]);router['put']('/:id',auth[_0x3792('0x10')](),controller[_0x3792('0x12')]);router[_0x3792('0x13')](_0x3792('0xa'),auth[_0x3792('0x10')](),controller[_0x3792('0x14')]);module[_0x3792('0x15')]=router; \ No newline at end of file +var _0x52ad=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','create','post','/:id/sub_intervals','addInterval','addIntervals','put'];(function(_0x2fc323,_0x364cf5){var _0xc952a3=function(_0x3c8670){while(--_0x3c8670){_0x2fc323['push'](_0x2fc323['shift']());}};_0xc952a3(++_0x364cf5);}(_0x52ad,0x1d8));var _0xd52a=function(_0x25d1e8,_0x38ee63){_0x25d1e8=_0x25d1e8-0x0;var _0x30fb9f=_0x52ad[_0x25d1e8];return _0x30fb9f;};'use strict';var multer=require(_0xd52a('0x0'));var util=require(_0xd52a('0x1'));var path=require(_0xd52a('0x2'));var timeout=require(_0xd52a('0x3'));var express=require('express');var router=express[_0xd52a('0x4')]();var fs_extra=require(_0xd52a('0x5'));var auth=require(_0xd52a('0x6'));var interaction=require(_0xd52a('0x7'));var config=require(_0xd52a('0x8'));var controller=require(_0xd52a('0x9'));router[_0xd52a('0xa')]('/',auth[_0xd52a('0xb')](),controller[_0xd52a('0xc')]);router['get'](_0xd52a('0xd'),auth[_0xd52a('0xb')](),controller[_0xd52a('0xe')]);router[_0xd52a('0xa')]('/:id/sub_intervals',auth[_0xd52a('0xb')](),controller[_0xd52a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd52a('0x10')]);router[_0xd52a('0x11')](_0xd52a('0x12'),auth[_0xd52a('0xb')](),controller[_0xd52a('0x13')]);router[_0xd52a('0x11')]('/:id/sub_intervals/create_many',auth[_0xd52a('0xb')](),controller[_0xd52a('0x14')]);router[_0xd52a('0x15')](_0xd52a('0xd'),auth[_0xd52a('0xb')](),controller[_0xd52a('0x16')]);router[_0xd52a('0x17')](_0xd52a('0xd'),auth[_0xd52a('0xb')](),controller[_0xd52a('0x18')]);module[_0xd52a('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index cb77001..3520e69 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 _0xfa2e=['sequelize','STRING'];(function(_0x4be64f,_0x35c983){var _0x370f5a=function(_0x306bfa){while(--_0x306bfa){_0x4be64f['push'](_0x4be64f['shift']());}};_0x370f5a(++_0x35c983);}(_0xfa2e,0x12e));var _0xefa2=function(_0x591d31,_0x2b20a1){_0x591d31=_0x591d31-0x0;var _0x12b89f=_0xfa2e[_0x591d31];return _0x12b89f;};'use strict';var Sequelize=require(_0xefa2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefa2('0x1')]},'interval':{'type':Sequelize[_0xefa2('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x1a4f=['sequelize','STRING'];(function(_0x54279b,_0x11231a){var _0x591d16=function(_0x4ad174){while(--_0x4ad174){_0x54279b['push'](_0x54279b['shift']());}};_0x591d16(++_0x11231a);}(_0x1a4f,0x116));var _0xf1a4=function(_0x1f99fc,_0x1cb2ee){_0x1f99fc=_0x1f99fc-0x0;var _0x474f5c=_0x1a4f[_0x1f99fc];return _0x474f5c;};'use strict';var Sequelize=require(_0xf1a4('0x0'));module['exports']={'name':{'type':Sequelize[_0xf1a4('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf1a4('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 09b34cd..c27b28f 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 _0x4737=['request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xce2d46,_0x3be00c){var _0xa284d1=function(_0x1bcef5){while(--_0x1bcef5){_0xce2d46['push'](_0xce2d46['shift']());}};_0xa284d1(++_0x3be00c);}(_0x4737,0x119));var _0x7473=function(_0x45fd25,_0x235429){_0x45fd25=_0x45fd25-0x0;var _0x81d2a3=_0x4737[_0x45fd25];return _0x81d2a3;};'use strict';var emlformat=require(_0x7473('0x0'));var rimraf=require(_0x7473('0x1'));var zipdir=require(_0x7473('0x2'));var jsonpatch=require(_0x7473('0x3'));var rp=require(_0x7473('0x4'));var moment=require('moment');var BPromise=require(_0x7473('0x5'));var Mustache=require('mustache');var util=require(_0x7473('0x6'));var path=require(_0x7473('0x7'));var sox=require(_0x7473('0x8'));var csv=require(_0x7473('0x9'));var ejs=require(_0x7473('0xa'));var fs=require('fs');var fs_extra=require(_0x7473('0xb'));var _=require(_0x7473('0xc'));var squel=require(_0x7473('0xd'));var crypto=require(_0x7473('0xe'));var jsforce=require(_0x7473('0xf'));var deskjs=require(_0x7473('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7473('0x11'));var Redis=require('ioredis');var authService=require(_0x7473('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7473('0x13'));var logger=require(_0x7473('0x14'))('api');var utils=require(_0x7473('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7473('0x16'))['db'];var extensions=require(_0x7473('0x17'));function respondWithStatusCode(_0x3f6aa5,_0x33350f){_0x33350f=_0x33350f||0xcc;return function(_0x58a6de){if(_0x58a6de){return _0x3f6aa5[_0x7473('0x18')](_0x33350f);}return _0x3f6aa5[_0x7473('0x19')](_0x33350f)[_0x7473('0x1a')]();};}function respondWithResult(_0x149ec2,_0x4209db){_0x4209db=_0x4209db||0xc8;return function(_0x45d786){if(_0x45d786){return _0x149ec2['status'](_0x4209db)[_0x7473('0x1b')](_0x45d786);}};}function respondWithFilteredResult(_0x1e0c60,_0x5aaa45){return function(_0x2f9d28){if(_0x2f9d28){var _0x512c16=typeof _0x5aaa45[_0x7473('0x1c')]===_0x7473('0x1d')&&typeof _0x5aaa45[_0x7473('0x1e')]==='undefined';var _0x37874d=_0x2f9d28[_0x7473('0x1f')];var _0x2d49e8=_0x512c16?0x0:_0x5aaa45['offset'];var _0xc67a4d=_0x512c16?_0x2f9d28[_0x7473('0x1f')]:_0x5aaa45[_0x7473('0x1c')]+_0x5aaa45[_0x7473('0x1e')];var _0x47c112;if(_0xc67a4d>=_0x37874d){_0xc67a4d=_0x37874d;_0x47c112=0xc8;}else{_0x47c112=0xce;}_0x1e0c60[_0x7473('0x19')](_0x47c112);return _0x1e0c60[_0x7473('0x20')](_0x7473('0x21'),_0x2d49e8+'-'+_0xc67a4d+'/'+_0x37874d)[_0x7473('0x1b')](_0x2f9d28);}return null;};}function patchUpdates(_0x47986b){return function(_0x50cf75){try{jsonpatch[_0x7473('0x22')](_0x50cf75,_0x47986b,!![]);}catch(_0xc62af5){return BPromise[_0x7473('0x23')](_0xc62af5);}return _0x50cf75['save']();};}function saveUpdates(_0x149841,_0x2926b5){return function(_0x2e0e1c){if(_0x2e0e1c){return _0x2e0e1c[_0x7473('0x24')](_0x149841)['then'](function(_0x257793){return _0x257793;});}return null;};}function removeEntity(_0x3cb883,_0x7b67d2){return function(_0x198de2){if(_0x198de2){return _0x198de2[_0x7473('0x25')]()[_0x7473('0x26')](function(){var _0xd8c32d=_0x198de2[_0x7473('0x27')]({'plain':!![]});var _0x440109=_0x7473('0x28');return db[_0x7473('0x29')][_0x7473('0x25')]({'where':{'type':_0x440109,'resourceId':_0xd8c32d['id']}})[_0x7473('0x26')](function(){return _0x198de2;});})['then'](function(){_0x3cb883[_0x7473('0x19')](0xcc)[_0x7473('0x1a')]();});}};}function handleEntityNotFound(_0x25fc9c,_0x52199e){return function(_0x3db1df){if(!_0x3db1df){_0x25fc9c[_0x7473('0x18')](0x194);}return _0x3db1df;};}function handleError(_0xe4e405,_0x44a696){_0x44a696=_0x44a696||0x1f4;return function(_0x4223c2){logger[_0x7473('0x2a')](_0x4223c2[_0x7473('0x2b')]);if(_0x4223c2[_0x7473('0x2c')]){delete _0x4223c2[_0x7473('0x2c')];}_0xe4e405[_0x7473('0x19')](_0x44a696)[_0x7473('0x2d')](_0x4223c2);};}exports[_0x7473('0x2e')]=function(_0x490387,_0x3a8832){var _0xde71c4={},_0x5d82dc={},_0x261742={'count':0x0,'rows':[]};var _0x44feb2=_['map'](db[_0x7473('0x2f')][_0x7473('0x30')],function(_0x5458a1){return{'name':_0x5458a1[_0x7473('0x31')],'type':_0x5458a1[_0x7473('0x32')][_0x7473('0x33')]};});_0x5d82dc['model']=_[_0x7473('0x34')](_0x44feb2,_0x7473('0x2c'));_0x5d82dc[_0x7473('0x35')]=_[_0x7473('0x36')](_0x490387[_0x7473('0x35')]);_0x5d82dc['filters']=_[_0x7473('0x37')](_0x5d82dc[_0x7473('0x38')],_0x5d82dc[_0x7473('0x35')]);_0xde71c4['attributes']=_[_0x7473('0x37')](_0x5d82dc[_0x7473('0x38')],qs[_0x7473('0x39')](_0x490387[_0x7473('0x35')][_0x7473('0x39')]));_0xde71c4[_0x7473('0x3a')]=_0xde71c4['attributes']['length']?_0xde71c4[_0x7473('0x3a')]:_0x5d82dc[_0x7473('0x38')];if(!_0x490387[_0x7473('0x35')][_0x7473('0x3b')](_0x7473('0x3c'))){_0xde71c4[_0x7473('0x1e')]=qs[_0x7473('0x1e')](_0x490387[_0x7473('0x35')][_0x7473('0x1e')]);_0xde71c4[_0x7473('0x1c')]=qs[_0x7473('0x1c')](_0x490387['query'][_0x7473('0x1c')]);}_0xde71c4[_0x7473('0x3d')]=qs[_0x7473('0x3e')](_0x490387[_0x7473('0x35')][_0x7473('0x3e')]);_0xde71c4['where']=qs[_0x7473('0x3f')](_[_0x7473('0x40')](_0x490387[_0x7473('0x35')],_0x5d82dc[_0x7473('0x3f')]),_0x44feb2);if(_0x490387['query'][_0x7473('0x41')]){_0xde71c4['where']=_[_0x7473('0x42')](_0xde71c4['where'],{'$or':_['map'](_0x44feb2,function(_0x5984a0){if(_0x5984a0[_0x7473('0x32')]!==_0x7473('0x43')){var _0x4ad032={};_0x4ad032[_0x5984a0[_0x7473('0x2c')]]={'$like':'%'+_0x490387[_0x7473('0x35')]['filter']+'%'};return _0x4ad032;}})});}_0xde71c4=_[_0x7473('0x42')]({},_0xde71c4,_0x490387[_0x7473('0x44')]);var _0x11e1a0={'where':_0xde71c4[_0x7473('0x45')]};return db[_0x7473('0x2f')][_0x7473('0x1f')](_0x11e1a0)[_0x7473('0x26')](function(_0x4fd1cd){_0x261742[_0x7473('0x1f')]=_0x4fd1cd;if(_0x490387[_0x7473('0x35')][_0x7473('0x46')]){_0xde71c4[_0x7473('0x47')]=[{'all':!![]}];}return db[_0x7473('0x2f')][_0x7473('0x48')](_0xde71c4);})[_0x7473('0x26')](function(_0x469bf0){_0x261742[_0x7473('0x49')]=_0x469bf0;return _0x261742;})[_0x7473('0x26')](respondWithFilteredResult(_0x3a8832,_0xde71c4))[_0x7473('0x4a')](handleError(_0x3a8832,null));};exports[_0x7473('0x4b')]=function(_0x4e7122,_0x4ba751){var _0x3ef1b9={'raw':!![],'where':{'id':_0x4e7122[_0x7473('0x4c')]['id']}},_0x259085={};_0x259085['model']=_['keys'](db['Interval'][_0x7473('0x30')]);_0x259085[_0x7473('0x35')]=_[_0x7473('0x36')](_0x4e7122[_0x7473('0x35')]);_0x259085['filters']=_[_0x7473('0x37')](_0x259085['model'],_0x259085[_0x7473('0x35')]);_0x3ef1b9[_0x7473('0x3a')]=_['intersection'](_0x259085[_0x7473('0x38')],qs[_0x7473('0x39')](_0x4e7122['query']['fields']));_0x3ef1b9['attributes']=_0x3ef1b9[_0x7473('0x3a')][_0x7473('0x4d')]?_0x3ef1b9[_0x7473('0x3a')]:_0x259085[_0x7473('0x38')];if(_0x4e7122['query'][_0x7473('0x46')]){_0x3ef1b9[_0x7473('0x47')]=[{'all':!![]}];}_0x3ef1b9=_[_0x7473('0x42')]({},_0x3ef1b9,_0x4e7122[_0x7473('0x44')]);return db[_0x7473('0x2f')][_0x7473('0x4e')](_0x3ef1b9)[_0x7473('0x26')](handleEntityNotFound(_0x4ba751,null))[_0x7473('0x26')](respondWithResult(_0x4ba751,null))[_0x7473('0x4a')](handleError(_0x4ba751,null));};exports['create']=function(_0x37e7be,_0x50616d){return db[_0x7473('0x2f')][_0x7473('0x4f')](_0x37e7be[_0x7473('0x50')],{})[_0x7473('0x26')](function(_0x43f1a0){var _0x1c24e5=_0x37e7be[_0x7473('0x51')]['get']({'plain':!![]});if(!_0x1c24e5)throw new Error(_0x7473('0x52'));if(_0x1c24e5[_0x7473('0x53')]===_0x7473('0x51')){var _0x573bb2=_0x43f1a0[_0x7473('0x27')]({'plain':!![]});var _0x379750=_0x7473('0x28');return db[_0x7473('0x54')][_0x7473('0x4e')]({'where':{'name':_0x379750,'userProfileId':_0x1c24e5[_0x7473('0x55')]},'raw':!![]})[_0x7473('0x26')](function(_0x3942ab){if(_0x3942ab&&_0x3942ab[_0x7473('0x56')]===0x0){return db[_0x7473('0x29')]['create']({'name':_0x573bb2[_0x7473('0x2c')],'resourceId':_0x573bb2['id'],'type':_0x3942ab[_0x7473('0x2c')],'sectionId':_0x3942ab['id']},{})[_0x7473('0x26')](function(){return _0x43f1a0;});}else{return _0x43f1a0;}})['catch'](function(_0x378043){logger['error'](_0x7473('0x57'),_0x378043);throw _0x378043;});}return _0x43f1a0;})[_0x7473('0x26')](respondWithResult(_0x50616d,0xc9))[_0x7473('0x4a')](handleError(_0x50616d,null));};exports['update']=function(_0x2115b7,_0x2236bb){if(_0x2115b7[_0x7473('0x50')]['id']){delete _0x2115b7[_0x7473('0x50')]['id'];}return db['Interval'][_0x7473('0x4e')]({'where':{'id':_0x2115b7['params']['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x2236bb,null))[_0x7473('0x26')](saveUpdates(_0x2115b7[_0x7473('0x50')],null))[_0x7473('0x26')](respondWithResult(_0x2236bb,null))[_0x7473('0x4a')](handleError(_0x2236bb,null));};exports[_0x7473('0x25')]=function(_0x5a93d6,_0x265f00){return db[_0x7473('0x2f')]['find']({'where':{'id':_0x5a93d6[_0x7473('0x4c')]['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x265f00,null))[_0x7473('0x26')](removeEntity(_0x265f00,null))[_0x7473('0x4a')](handleError(_0x265f00,null));};exports['addInterval']=function(_0x4c32e5,_0x416341,_0x2a3953){if(_0x4c32e5[_0x7473('0x50')]['id']){delete _0x4c32e5[_0x7473('0x50')]['id'];}return db[_0x7473('0x2f')][_0x7473('0x4e')]({'where':{'id':_0x4c32e5[_0x7473('0x4c')]['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x416341,null))[_0x7473('0x26')](function(_0x584ba1){if(_0x584ba1){_0x4c32e5['body'][_0x7473('0x58')]=_0x584ba1['id'];return db['Interval']['create'](_0x4c32e5[_0x7473('0x50')]);}})['then'](respondWithResult(_0x416341,null))['catch'](handleError(_0x416341,null));};exports[_0x7473('0x59')]=function(_0x46f218,_0x2ed172,_0x44f2b8){var _0x57ef18={};var _0x5e641c={};var _0xc859a6;var _0x3529f5;return db[_0x7473('0x2f')][_0x7473('0x5a')]({'where':{'id':_0x46f218[_0x7473('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ed172,null))[_0x7473('0x26')](function(_0x2e5809){if(_0x2e5809){_0xc859a6=_0x2e5809;_0x5e641c['model']=_[_0x7473('0x36')](db[_0x7473('0x2f')][_0x7473('0x30')]);_0x5e641c[_0x7473('0x35')]=_[_0x7473('0x36')](_0x46f218[_0x7473('0x35')]);_0x5e641c[_0x7473('0x3f')]=_[_0x7473('0x37')](_0x5e641c[_0x7473('0x38')],_0x5e641c[_0x7473('0x35')]);_0x57ef18[_0x7473('0x3a')]=_[_0x7473('0x37')](_0x5e641c[_0x7473('0x38')],qs[_0x7473('0x39')](_0x46f218[_0x7473('0x35')][_0x7473('0x39')]));_0x57ef18[_0x7473('0x3a')]=_0x57ef18['attributes'][_0x7473('0x4d')]?_0x57ef18[_0x7473('0x3a')]:_0x5e641c['model'];_0x57ef18[_0x7473('0x3d')]=qs[_0x7473('0x3e')](_0x46f218[_0x7473('0x35')][_0x7473('0x3e')]);_0x57ef18[_0x7473('0x45')]=qs[_0x7473('0x3f')](_['pick'](_0x46f218[_0x7473('0x35')],_0x5e641c[_0x7473('0x3f')]));if(_0x46f218[_0x7473('0x35')][_0x7473('0x41')]){_0x57ef18['where']=_[_0x7473('0x42')](_0x57ef18[_0x7473('0x45')],{'$or':_[_0x7473('0x34')](_0x57ef18[_0x7473('0x3a')],function(_0x24b81c){var _0xe08c55={};_0xe08c55[_0x24b81c]={'$like':'%'+_0x46f218[_0x7473('0x35')][_0x7473('0x41')]+'%'};return _0xe08c55;})});}_0x57ef18=_[_0x7473('0x42')]({},_0x57ef18,_0x46f218['options']);return _0xc859a6['getIntervals'](_0x57ef18);}})['then'](function(_0x25015e){if(_0x25015e){_0x3529f5=_0x25015e[_0x7473('0x4d')];if(!_0x46f218['query'][_0x7473('0x3b')]('nolimit')){_0x57ef18['limit']=qs[_0x7473('0x1e')](_0x46f218[_0x7473('0x35')][_0x7473('0x1e')]);_0x57ef18[_0x7473('0x1c')]=qs[_0x7473('0x1c')](_0x46f218[_0x7473('0x35')]['offset']);}return _0xc859a6[_0x7473('0x59')](_0x57ef18);}})['then'](function(_0x18151a){if(_0x18151a){return _0x18151a?{'count':_0x3529f5,'rows':_0x18151a}:null;}})[_0x7473('0x26')](respondWithResult(_0x2ed172,null))[_0x7473('0x4a')](handleError(_0x2ed172,null));};exports[_0x7473('0x5b')]=function(_0x4d75fe,_0x1d9076,_0x39d07d){return db[_0x7473('0x2f')][_0x7473('0x5a')]({'where':{'id':_0x4d75fe['params']['id']}})[_0x7473('0x26')](handleEntityNotFound(_0x1d9076,null))['then'](function(_0xb46093){if(_0xb46093){return db[_0x7473('0x5c')][_0x7473('0x5d')](function(_0x5114b7){return db[_0x7473('0x2f')][_0x7473('0x25')]({'where':{'IntervalId':_0x4d75fe[_0x7473('0x4c')]['id']},'transaction':_0x5114b7})['then'](function(_0x48445a){var _0x26759e=_[_0x7473('0x34')](_0x4d75fe[_0x7473('0x50')],function(_0x57f279){delete _0x57f279['id'];_0x57f279[_0x7473('0x58')]=_0x4d75fe[_0x7473('0x4c')]['id'];return _0x57f279;});return db[_0x7473('0x2f')][_0x7473('0x5e')](_0x26759e,{'transaction':_0x5114b7});});})[_0x7473('0x26')](function(){return db[_0x7473('0x2f')][_0x7473('0x48')]({'where':{'IntervalId':_0x4d75fe[_0x7473('0x4c')]['id']}});});}})['then'](respondWithResult(_0x1d9076,null))[_0x7473('0x4a')](handleError(_0x1d9076,null));}; \ No newline at end of file +var _0x6042=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','sequelize','transaction','bulkCreate','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','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x361034,_0x36061a){var _0x4d9953=function(_0x245112){while(--_0x245112){_0x361034['push'](_0x361034['shift']());}};_0x4d9953(++_0x36061a);}(_0x6042,0xdf));var _0x2604=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6042[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x2604('0x0'));var rimraf=require(_0x2604('0x1'));var zipdir=require(_0x2604('0x2'));var jsonpatch=require(_0x2604('0x3'));var rp=require(_0x2604('0x4'));var moment=require('moment');var BPromise=require(_0x2604('0x5'));var Mustache=require(_0x2604('0x6'));var util=require('util');var path=require(_0x2604('0x7'));var sox=require(_0x2604('0x8'));var csv=require(_0x2604('0x9'));var ejs=require(_0x2604('0xa'));var fs=require('fs');var fs_extra=require(_0x2604('0xb'));var _=require(_0x2604('0xc'));var squel=require(_0x2604('0xd'));var crypto=require(_0x2604('0xe'));var jsforce=require(_0x2604('0xf'));var deskjs=require(_0x2604('0x10'));var toCsv=require(_0x2604('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2604('0x11'));var qs=require(_0x2604('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2604('0x13'))(_0x2604('0x14'));var utils=require(_0x2604('0x15'));var config=require(_0x2604('0x16'));var licenseUtil=require(_0x2604('0x17'));var db=require(_0x2604('0x18'))['db'];var extensions=require(_0x2604('0x19'));function respondWithStatusCode(_0x516770,_0xf9e443){_0xf9e443=_0xf9e443||0xcc;return function(_0x3084ac){if(_0x3084ac){return _0x516770[_0x2604('0x1a')](_0xf9e443);}return _0x516770[_0x2604('0x1b')](_0xf9e443)['end']();};}function respondWithResult(_0x35bd91,_0x3d5b2c){_0x3d5b2c=_0x3d5b2c||0xc8;return function(_0x2d472c){if(_0x2d472c){return _0x35bd91[_0x2604('0x1b')](_0x3d5b2c)[_0x2604('0x1c')](_0x2d472c);}};}function respondWithFilteredResult(_0x403eb,_0x2926bc){return function(_0x4fb888){if(_0x4fb888){var _0x1d7355=typeof _0x2926bc['offset']===_0x2604('0x1d')&&typeof _0x2926bc['limit']===_0x2604('0x1d');var _0x30c217=_0x4fb888['count'];var _0x28e27b=_0x1d7355?0x0:_0x2926bc['offset'];var _0x294387=_0x1d7355?_0x4fb888['count']:_0x2926bc[_0x2604('0x1e')]+_0x2926bc[_0x2604('0x1f')];var _0x526898;if(_0x294387>=_0x30c217){_0x294387=_0x30c217;_0x526898=0xc8;}else{_0x526898=0xce;}_0x403eb[_0x2604('0x1b')](_0x526898);return _0x403eb[_0x2604('0x20')](_0x2604('0x21'),_0x28e27b+'-'+_0x294387+'/'+_0x30c217)[_0x2604('0x1c')](_0x4fb888);}return null;};}function patchUpdates(_0x4fb363){return function(_0x4daf0b){try{jsonpatch[_0x2604('0x22')](_0x4daf0b,_0x4fb363,!![]);}catch(_0x430073){return BPromise[_0x2604('0x23')](_0x430073);}return _0x4daf0b[_0x2604('0x24')]();};}function saveUpdates(_0x78a390,_0x1b6ce0){return function(_0x47e22){if(_0x47e22){return _0x47e22['update'](_0x78a390)[_0x2604('0x25')](function(_0x8740b8){return _0x8740b8;});}return null;};}function removeEntity(_0x4ede4a,_0x1c90ed){return function(_0x359688){if(_0x359688){return _0x359688['destroy']()[_0x2604('0x25')](function(){var _0x403fea=_0x359688[_0x2604('0x26')]({'plain':!![]});var _0x5bbf31='Intervals';return db[_0x2604('0x27')][_0x2604('0x28')]({'where':{'type':_0x5bbf31,'resourceId':_0x403fea['id']}})[_0x2604('0x25')](function(){return _0x359688;});})[_0x2604('0x25')](function(){_0x4ede4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c70d0,_0x38c504){return function(_0x271a46){if(!_0x271a46){_0x2c70d0[_0x2604('0x1a')](0x194);}return _0x271a46;};}function handleError(_0x1c3038,_0xbb7a0b){_0xbb7a0b=_0xbb7a0b||0x1f4;return function(_0x481111){logger[_0x2604('0x29')](_0x481111[_0x2604('0x2a')]);if(_0x481111[_0x2604('0x2b')]){delete _0x481111[_0x2604('0x2b')];}_0x1c3038['status'](_0xbb7a0b)[_0x2604('0x2c')](_0x481111);};}exports[_0x2604('0x2d')]=function(_0x284f15,_0x525e28){var _0xc3b8f3={},_0x2e28e1={},_0x34ee4e={'count':0x0,'rows':[]};var _0x1e9141=_[_0x2604('0x2e')](db[_0x2604('0x2f')][_0x2604('0x30')],function(_0x21c727){return{'name':_0x21c727[_0x2604('0x31')],'type':_0x21c727[_0x2604('0x32')]['key']};});_0x2e28e1[_0x2604('0x33')]=_[_0x2604('0x2e')](_0x1e9141,_0x2604('0x2b'));_0x2e28e1[_0x2604('0x34')]=_[_0x2604('0x35')](_0x284f15[_0x2604('0x34')]);_0x2e28e1[_0x2604('0x36')]=_[_0x2604('0x37')](_0x2e28e1['model'],_0x2e28e1[_0x2604('0x34')]);_0xc3b8f3[_0x2604('0x38')]=_[_0x2604('0x37')](_0x2e28e1[_0x2604('0x33')],qs['fields'](_0x284f15[_0x2604('0x34')][_0x2604('0x39')]));_0xc3b8f3[_0x2604('0x38')]=_0xc3b8f3[_0x2604('0x38')][_0x2604('0x3a')]?_0xc3b8f3[_0x2604('0x38')]:_0x2e28e1[_0x2604('0x33')];if(!_0x284f15['query'][_0x2604('0x3b')](_0x2604('0x3c'))){_0xc3b8f3[_0x2604('0x1f')]=qs[_0x2604('0x1f')](_0x284f15[_0x2604('0x34')][_0x2604('0x1f')]);_0xc3b8f3[_0x2604('0x1e')]=qs['offset'](_0x284f15['query']['offset']);}_0xc3b8f3[_0x2604('0x3d')]=qs[_0x2604('0x3e')](_0x284f15[_0x2604('0x34')][_0x2604('0x3e')]);_0xc3b8f3[_0x2604('0x3f')]=qs[_0x2604('0x36')](_[_0x2604('0x40')](_0x284f15[_0x2604('0x34')],_0x2e28e1[_0x2604('0x36')]),_0x1e9141);if(_0x284f15['query'][_0x2604('0x41')]){_0xc3b8f3['where']=_[_0x2604('0x42')](_0xc3b8f3['where'],{'$or':_[_0x2604('0x2e')](_0x1e9141,function(_0x376c87){if(_0x376c87[_0x2604('0x32')]!=='VIRTUAL'){var _0x57ae76={};_0x57ae76[_0x376c87[_0x2604('0x2b')]]={'$like':'%'+_0x284f15['query']['filter']+'%'};return _0x57ae76;}})});}_0xc3b8f3=_[_0x2604('0x42')]({},_0xc3b8f3,_0x284f15[_0x2604('0x43')]);var _0x41255={'where':_0xc3b8f3[_0x2604('0x3f')]};return db[_0x2604('0x2f')][_0x2604('0x44')](_0x41255)[_0x2604('0x25')](function(_0x2a6d21){_0x34ee4e[_0x2604('0x44')]=_0x2a6d21;if(_0x284f15[_0x2604('0x34')][_0x2604('0x45')]){_0xc3b8f3[_0x2604('0x46')]=[{'all':!![]}];}return db[_0x2604('0x2f')][_0x2604('0x47')](_0xc3b8f3);})['then'](function(_0x25a835){_0x34ee4e[_0x2604('0x48')]=_0x25a835;return _0x34ee4e;})['then'](respondWithFilteredResult(_0x525e28,_0xc3b8f3))[_0x2604('0x49')](handleError(_0x525e28,null));};exports['show']=function(_0x313c80,_0xd3e87d){var _0x3d4acb={'raw':!![],'where':{'id':_0x313c80[_0x2604('0x4a')]['id']}},_0x142cf0={};_0x142cf0[_0x2604('0x33')]=_[_0x2604('0x35')](db[_0x2604('0x2f')][_0x2604('0x30')]);_0x142cf0[_0x2604('0x34')]=_[_0x2604('0x35')](_0x313c80[_0x2604('0x34')]);_0x142cf0['filters']=_['intersection'](_0x142cf0[_0x2604('0x33')],_0x142cf0['query']);_0x3d4acb['attributes']=_[_0x2604('0x37')](_0x142cf0[_0x2604('0x33')],qs['fields'](_0x313c80[_0x2604('0x34')][_0x2604('0x39')]));_0x3d4acb[_0x2604('0x38')]=_0x3d4acb[_0x2604('0x38')][_0x2604('0x3a')]?_0x3d4acb['attributes']:_0x142cf0[_0x2604('0x33')];if(_0x313c80[_0x2604('0x34')]['includeAll']){_0x3d4acb[_0x2604('0x46')]=[{'all':!![]}];}_0x3d4acb=_[_0x2604('0x42')]({},_0x3d4acb,_0x313c80['options']);return db[_0x2604('0x2f')][_0x2604('0x4b')](_0x3d4acb)[_0x2604('0x25')](handleEntityNotFound(_0xd3e87d,null))[_0x2604('0x25')](respondWithResult(_0xd3e87d,null))[_0x2604('0x49')](handleError(_0xd3e87d,null));};exports[_0x2604('0x4c')]=function(_0x572399,_0x5d45b3){return db['Interval']['create'](_0x572399[_0x2604('0x4d')],{})[_0x2604('0x25')](function(_0x360f0a){var _0x2fc9e7=_0x572399[_0x2604('0x4e')]['get']({'plain':!![]});if(!_0x2fc9e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fc9e7[_0x2604('0x4f')]===_0x2604('0x4e')){var _0x29481b=_0x360f0a[_0x2604('0x26')]({'plain':!![]});var _0x33dfea=_0x2604('0x50');return db[_0x2604('0x51')][_0x2604('0x4b')]({'where':{'name':_0x33dfea,'userProfileId':_0x2fc9e7[_0x2604('0x52')]},'raw':!![]})['then'](function(_0x39b1a1){if(_0x39b1a1&&_0x39b1a1[_0x2604('0x53')]===0x0){return db[_0x2604('0x27')][_0x2604('0x4c')]({'name':_0x29481b[_0x2604('0x2b')],'resourceId':_0x29481b['id'],'type':_0x39b1a1[_0x2604('0x2b')],'sectionId':_0x39b1a1['id']},{})['then'](function(){return _0x360f0a;});}else{return _0x360f0a;}})[_0x2604('0x49')](function(_0x5b2b5b){logger[_0x2604('0x29')](_0x2604('0x54'),_0x5b2b5b);throw _0x5b2b5b;});}return _0x360f0a;})[_0x2604('0x25')](respondWithResult(_0x5d45b3,0xc9))['catch'](handleError(_0x5d45b3,null));};exports[_0x2604('0x55')]=function(_0x5b4788,_0x3027f2){if(_0x5b4788[_0x2604('0x4d')]['id']){delete _0x5b4788[_0x2604('0x4d')]['id'];}return db[_0x2604('0x2f')][_0x2604('0x4b')]({'where':{'id':_0x5b4788['params']['id']}})[_0x2604('0x25')](handleEntityNotFound(_0x3027f2,null))['then'](saveUpdates(_0x5b4788[_0x2604('0x4d')],null))[_0x2604('0x25')](respondWithResult(_0x3027f2,null))[_0x2604('0x49')](handleError(_0x3027f2,null));};exports[_0x2604('0x28')]=function(_0x7e4884,_0x35160d){return db[_0x2604('0x2f')][_0x2604('0x4b')]({'where':{'id':_0x7e4884[_0x2604('0x4a')]['id']}})[_0x2604('0x25')](handleEntityNotFound(_0x35160d,null))['then'](removeEntity(_0x35160d,null))[_0x2604('0x49')](handleError(_0x35160d,null));};exports[_0x2604('0x56')]=function(_0x54cd7c,_0x41cb9c,_0x7a54e3){if(_0x54cd7c[_0x2604('0x4d')]['id']){delete _0x54cd7c['body']['id'];}return db['Interval'][_0x2604('0x4b')]({'where':{'id':_0x54cd7c[_0x2604('0x4a')]['id']}})[_0x2604('0x25')](handleEntityNotFound(_0x41cb9c,null))[_0x2604('0x25')](function(_0x2d2b47){if(_0x2d2b47){_0x54cd7c[_0x2604('0x4d')][_0x2604('0x57')]=_0x2d2b47['id'];return db[_0x2604('0x2f')][_0x2604('0x4c')](_0x54cd7c[_0x2604('0x4d')]);}})['then'](respondWithResult(_0x41cb9c,null))[_0x2604('0x49')](handleError(_0x41cb9c,null));};exports[_0x2604('0x58')]=function(_0x1f1928,_0x552d4a,_0x4a2caa){var _0x112cfb={};var _0x4d2d1f={};var _0x2d5582;var _0x1788da;return db['Interval']['findOne']({'where':{'id':_0x1f1928[_0x2604('0x4a')]['id']}})[_0x2604('0x25')](handleEntityNotFound(_0x552d4a,null))[_0x2604('0x25')](function(_0x3c2e87){if(_0x3c2e87){_0x2d5582=_0x3c2e87;_0x4d2d1f[_0x2604('0x33')]=_[_0x2604('0x35')](db['Interval'][_0x2604('0x30')]);_0x4d2d1f[_0x2604('0x34')]=_[_0x2604('0x35')](_0x1f1928[_0x2604('0x34')]);_0x4d2d1f[_0x2604('0x36')]=_[_0x2604('0x37')](_0x4d2d1f[_0x2604('0x33')],_0x4d2d1f[_0x2604('0x34')]);_0x112cfb[_0x2604('0x38')]=_['intersection'](_0x4d2d1f['model'],qs[_0x2604('0x39')](_0x1f1928[_0x2604('0x34')]['fields']));_0x112cfb[_0x2604('0x38')]=_0x112cfb[_0x2604('0x38')][_0x2604('0x3a')]?_0x112cfb[_0x2604('0x38')]:_0x4d2d1f['model'];_0x112cfb[_0x2604('0x3d')]=qs['sort'](_0x1f1928[_0x2604('0x34')][_0x2604('0x3e')]);_0x112cfb[_0x2604('0x3f')]=qs[_0x2604('0x36')](_[_0x2604('0x40')](_0x1f1928[_0x2604('0x34')],_0x4d2d1f[_0x2604('0x36')]));if(_0x1f1928['query'][_0x2604('0x41')]){_0x112cfb['where']=_[_0x2604('0x42')](_0x112cfb[_0x2604('0x3f')],{'$or':_[_0x2604('0x2e')](_0x112cfb[_0x2604('0x38')],function(_0x2663e2){var _0x443a29={};_0x443a29[_0x2663e2]={'$like':'%'+_0x1f1928['query']['filter']+'%'};return _0x443a29;})});}_0x112cfb=_[_0x2604('0x42')]({},_0x112cfb,_0x1f1928[_0x2604('0x43')]);return _0x2d5582[_0x2604('0x58')](_0x112cfb);}})[_0x2604('0x25')](function(_0xd30134){if(_0xd30134){_0x1788da=_0xd30134[_0x2604('0x3a')];if(!_0x1f1928[_0x2604('0x34')][_0x2604('0x3b')]('nolimit')){_0x112cfb['limit']=qs[_0x2604('0x1f')](_0x1f1928[_0x2604('0x34')][_0x2604('0x1f')]);_0x112cfb[_0x2604('0x1e')]=qs[_0x2604('0x1e')](_0x1f1928[_0x2604('0x34')][_0x2604('0x1e')]);}return _0x2d5582['getIntervals'](_0x112cfb);}})[_0x2604('0x25')](function(_0x291809){if(_0x291809){return _0x291809?{'count':_0x1788da,'rows':_0x291809}:null;}})[_0x2604('0x25')](respondWithResult(_0x552d4a,null))['catch'](handleError(_0x552d4a,null));};exports['addIntervals']=function(_0xd32ae8,_0x243a8d,_0x54898b){return db[_0x2604('0x2f')][_0x2604('0x59')]({'where':{'id':_0xd32ae8[_0x2604('0x4a')]['id']}})[_0x2604('0x25')](handleEntityNotFound(_0x243a8d,null))['then'](function(_0x14adca){if(_0x14adca){return db[_0x2604('0x5a')][_0x2604('0x5b')](function(_0x167139){return db[_0x2604('0x2f')]['destroy']({'where':{'IntervalId':_0xd32ae8[_0x2604('0x4a')]['id']},'transaction':_0x167139})['then'](function(_0x27b3ee){var _0x307a6c=_[_0x2604('0x2e')](_0xd32ae8[_0x2604('0x4d')],function(_0x29d928){delete _0x29d928['id'];_0x29d928[_0x2604('0x57')]=_0xd32ae8[_0x2604('0x4a')]['id'];return _0x29d928;});return db['Interval'][_0x2604('0x5c')](_0x307a6c,{'transaction':_0x167139});});})['then'](function(){return db[_0x2604('0x2f')][_0x2604('0x47')]({'where':{'IntervalId':_0xd32ae8['params']['id']}});});}})[_0x2604('0x25')](respondWithResult(_0x243a8d,null))[_0x2604('0x49')](handleError(_0x243a8d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 4e14267..4cdce45 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 _0x6493=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_intervals','rewrite','lodash'];(function(_0x4f74fc,_0x437d62){var _0x60c6b6=function(_0x586807){while(--_0x586807){_0x4f74fc['push'](_0x4f74fc['shift']());}};_0x60c6b6(++_0x437d62);}(_0x6493,0xc2));var _0x3649=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x6493[_0x4ca6a4];return _0x120555;};'use strict';var _=require(_0x3649('0x0'));var util=require(_0x3649('0x1'));var logger=require(_0x3649('0x2'))(_0x3649('0x3'));var moment=require('moment');var BPromise=require(_0x3649('0x4'));var rp=require(_0x3649('0x5'));var fs=require('fs');var path=require(_0x3649('0x6'));var rimraf=require(_0x3649('0x7'));var config=require(_0x3649('0x8'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x3649('0x9')]=function(_0x3d3372,_0x4cec87){return _0x3d3372[_0x3649('0xa')]('Interval',attributes,{'tableName':_0x3649('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xe97a6,_0x3232c4){extensions['rewrite'](_0x3d3372,_0xe97a6);},'afterBulkCreate':function(_0x5843cc,_0x4d7807,_0x40a5bc){_0x40a5bc();extensions[_0x3649('0xc')](_0x3d3372,_0x5843cc[0x0]);},'afterUpdate':function(_0x3d463b,_0x108bcf){extensions[_0x3649('0xc')](_0x3d3372,_0x3d463b);},'afterDestroy':function(_0x58b161,_0x5b6b47){extensions['rewrite'](_0x3d3372,_0x58b161);}}});}; \ No newline at end of file +var _0xe862=['moment','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','../../config/logger','api'];(function(_0x5f259c,_0x26127d){var _0xddcf04=function(_0x5ea71f){while(--_0x5ea71f){_0x5f259c['push'](_0x5f259c['shift']());}};_0xddcf04(++_0x26127d);}(_0xe862,0x76));var _0x2e86=function(_0x2560a0,_0x463859){_0x2560a0=_0x2560a0-0x0;var _0x32fef8=_0xe862[_0x2560a0];return _0x32fef8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e86('0x0'))(_0x2e86('0x1'));var moment=require(_0x2e86('0x2'));var BPromise=require('bluebird');var rp=require(_0x2e86('0x3'));var fs=require('fs');var path=require(_0x2e86('0x4'));var rimraf=require(_0x2e86('0x5'));var config=require(_0x2e86('0x6'));var attributes=require(_0x2e86('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0x2e86('0x8')]=function(_0x191d4c,_0x139bac){return _0x191d4c[_0x2e86('0x9')]('Interval',attributes,{'tableName':_0x2e86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xafcdca,_0x43b966){extensions['rewrite'](_0x191d4c,_0xafcdca);},'afterBulkCreate':function(_0x2886ed,_0x395c46,_0x585763){_0x585763();extensions[_0x2e86('0xb')](_0x191d4c,_0x2886ed[0x0]);},'afterUpdate':function(_0x5292e1,_0x27f319){extensions[_0x2e86('0xb')](_0x191d4c,_0x5292e1);},'afterDestroy':function(_0x469001,_0x559efa){extensions['rewrite'](_0x191d4c,_0x469001);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e4e9d4a..17c69ea 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(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 aa17cb3..15cdbda 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x28ff39,_0x39b6f8){var _0xa20be6=function(_0x44b2cd){while(--_0x44b2cd){_0x28ff39['push'](_0x28ff39['shift']());}};_0xa20be6(++_0x39b6f8);}(_0x2ef3,0xba));var _0x32ef=function(_0x34895d,_0x444ddf){_0x34895d=_0x34895d-0x0;var _0x268030=_0x2ef3[_0x34895d];return _0x268030;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 91aca04..451d0fe 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 _0x2525=['bluebird','https','../../config/logger','api','3eAmWpBVP0','key','Report','\x20from\x20','description','issuetype','Bug','fields','email','oldToken','customfield_11502','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','stringify','setEncoding','utf8','data','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','x-forwarded-for','remoteAddress','connection','socket'];(function(_0x59ed7a,_0x20261e){var _0x37b0d7=function(_0x31a48e){while(--_0x31a48e){_0x59ed7a['push'](_0x59ed7a['shift']());}};_0x37b0d7(++_0x20261e);}(_0x2525,0x108));var _0x5252=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2525[_0xd1d19a];return _0x52a79d;};'use strict';var BPromise=require(_0x5252('0x0'));var https=require(_0x5252('0x1'));var logger=require(_0x5252('0x2'))(_0x5252('0x3'));var USERNAME='support';var PASSWORD=_0x5252('0x4');function openIssue(_0x4f8339,_0x169f94){var _0x258ea5={'fields':{'project':{'key':_0x4f8339[_0x5252('0x5')]||'MOTGUI'},'summary':(_0x4f8339['summary']||_0x5252('0x6'))+_0x5252('0x7')+_0x4f8339['ip'],'description':_0x4f8339[_0x5252('0x8')]||JSON['stringify'](_0x4f8339),'issuetype':{'name':_0x4f8339[_0x5252('0x9')]||_0x5252('0xa')}}};_0x258ea5[_0x5252('0xb')]['customfield_11500']=_0x4f8339[_0x5252('0xc')];_0x258ea5['fields']['customfield_11501']=_0x4f8339[_0x5252('0xd')];_0x258ea5['fields'][_0x5252('0xe')]=_0x4f8339['newToken'];_0x258ea5['fields']['customfield_11503']=_0x4f8339[_0x5252('0xf')];_0x258ea5[_0x5252('0xb')][_0x5252('0x10')]=_0x4f8339[_0x5252('0x11')];_0x258ea5[_0x5252('0xb')][_0x5252('0x12')]=_0x4f8339['ip'];var _0x4c54c6={'host':_0x5252('0x13'),'port':0x1bb,'path':_0x5252('0x14'),'method':_0x5252('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x5252('0x16'),'Authorization':_0x5252('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x5252('0x18')]('base64')}};var _0x5a7c8b=JSON[_0x5252('0x19')](_0x258ea5);var _0x4a0113=https['request'](_0x4c54c6,function(_0x2a63dc){_0x2a63dc[_0x5252('0x1a')](_0x5252('0x1b'));var _0x2bf899='';_0x2a63dc['on'](_0x5252('0x1c'),function(_0x38d250){_0x2bf899+=_0x38d250;});_0x2a63dc['on']('end',function(){if(_0x169f94){return _0x169f94[_0x5252('0x1d')](_0x2a63dc[_0x5252('0x1e')])[_0x5252('0x1f')](JSON['parse'](_0x2bf899));}});});_0x4a0113['on'](_0x5252('0x20'),function(_0x12bfed){if(_0x169f94){return _0x169f94['status'](0x1f4)[_0x5252('0x1f')]({'errors':[{'message':_0x5252('0x21'),'type':_0x5252('0x22')}]});}});_0x4a0113[_0x5252('0x23')](_0x5a7c8b);_0x4a0113[_0x5252('0x24')]();}exports[_0x5252('0x25')]=openIssue;exports[_0x5252('0x26')]=function(_0x33d33b,_0x122ee4){_0x33d33b[_0x5252('0x27')]['ip']=_0x33d33b['headers'][_0x5252('0x28')]||_0x33d33b['connection']['remoteAddress']||_0x33d33b['socket'][_0x5252('0x29')]||_0x33d33b[_0x5252('0x2a')][_0x5252('0x2b')]['remoteAddress'];return openIssue(_0x33d33b[_0x5252('0x27')],_0x122ee4);}; \ No newline at end of file +var _0xf9dc=['description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','write','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','body','../../config/logger','key','MOTGUI','summary','\x20from\x20'];(function(_0x455f6f,_0x88d815){var _0x41b2e5=function(_0x3139c7){while(--_0x3139c7){_0x455f6f['push'](_0x455f6f['shift']());}};_0x41b2e5(++_0x88d815);}(_0xf9dc,0x121));var _0xcf9d=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xf9dc[_0xf2662b];return _0x257dc7;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0xcf9d('0x0'))('api');var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x2f9579,_0x5665f7){var _0x1ade03={'fields':{'project':{'key':_0x2f9579[_0xcf9d('0x1')]||_0xcf9d('0x2')},'summary':(_0x2f9579[_0xcf9d('0x3')]||'Report')+_0xcf9d('0x4')+_0x2f9579['ip'],'description':_0x2f9579[_0xcf9d('0x5')]||JSON[_0xcf9d('0x6')](_0x2f9579),'issuetype':{'name':_0x2f9579[_0xcf9d('0x7')]||'Bug'}}};_0x1ade03[_0xcf9d('0x8')]['customfield_11500']=_0x2f9579[_0xcf9d('0x9')];_0x1ade03['fields'][_0xcf9d('0xa')]=_0x2f9579[_0xcf9d('0xb')];_0x1ade03['fields'][_0xcf9d('0xc')]=_0x2f9579[_0xcf9d('0xd')];_0x1ade03[_0xcf9d('0x8')][_0xcf9d('0xe')]=_0x2f9579[_0xcf9d('0xf')];_0x1ade03[_0xcf9d('0x8')]['customfield_11504']=_0x2f9579[_0xcf9d('0x10')];_0x1ade03[_0xcf9d('0x8')][_0xcf9d('0x11')]=_0x2f9579['ip'];var _0x5a168c={'host':_0xcf9d('0x12'),'port':0x1bb,'path':_0xcf9d('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xcf9d('0x14'),'Authorization':_0xcf9d('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0xcf9d('0x16')]('base64')}};var _0x26f2e2=JSON[_0xcf9d('0x6')](_0x1ade03);var _0x183a5e=https[_0xcf9d('0x17')](_0x5a168c,function(_0x10b3c8){_0x10b3c8[_0xcf9d('0x18')](_0xcf9d('0x19'));var _0x4d577e='';_0x10b3c8['on'](_0xcf9d('0x1a'),function(_0x2e15e9){_0x4d577e+=_0x2e15e9;});_0x10b3c8['on'](_0xcf9d('0x1b'),function(){if(_0x5665f7){return _0x5665f7[_0xcf9d('0x1c')](_0x10b3c8[_0xcf9d('0x1d')])[_0xcf9d('0x1e')](JSON[_0xcf9d('0x1f')](_0x4d577e));}});});_0x183a5e['on'](_0xcf9d('0x20'),function(_0x11c1a4){if(_0x5665f7){return _0x5665f7['status'](0x1f4)[_0xcf9d('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xcf9d('0x21')}]});}});_0x183a5e[_0xcf9d('0x22')](_0x26f2e2);_0x183a5e[_0xcf9d('0x1b')]();}exports[_0xcf9d('0x23')]=openIssue;exports['send']=function(_0x2968ff,_0x445225){_0x2968ff['body']['ip']=_0x2968ff[_0xcf9d('0x24')][_0xcf9d('0x25')]||_0x2968ff[_0xcf9d('0x26')][_0xcf9d('0x27')]||_0x2968ff[_0xcf9d('0x28')][_0xcf9d('0x27')]||_0x2968ff[_0xcf9d('0x26')]['socket'][_0xcf9d('0x27')];return openIssue(_0x2968ff[_0xcf9d('0x29')],_0x445225);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 745ebca..8fa7cd1 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 _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x2bd750,_0x39be0a){var _0xf32aab=function(_0x2c7869){while(--_0x2c7869){_0x2bd750['push'](_0x2bd750['shift']());}};_0xf32aab(++_0x39be0a);}(_0x4522,0x1a0));var _0x2452=function(_0x5e5e17,_0x1e80c3){_0x5e5e17=_0x5e5e17-0x0;var _0x22f9af=_0x4522[_0x5e5e17];return _0x22f9af;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2452('0xf')]);router['put']('/:id',auth[_0x2452('0x9')](),controller[_0x2452('0x10')]);router[_0x2452('0x11')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x12')]);module[_0x2452('0x13')]=router; \ No newline at end of file +var _0x2750=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x2750,0x13b));var _0x0275=function(_0x2c3761,_0x57c2c8){_0x2c3761=_0x2c3761-0x0;var _0x444944=_0x2750[_0x2c3761];return _0x444944;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var fs_extra=require(_0x0275('0x5'));var auth=require(_0x0275('0x6'));var interaction=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var controller=require(_0x0275('0x9'));router[_0x0275('0xa')]('/',auth['isAuthenticated'](),controller[_0x0275('0xb')]);router[_0x0275('0xa')](_0x0275('0xc'),auth[_0x0275('0xd')](),controller['describe']);router[_0x0275('0xa')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller['show']);router['post']('/',auth[_0x0275('0xd')](),controller['create']);router[_0x0275('0xf')](_0x0275('0xe'),auth[_0x0275('0xd')](),controller[_0x0275('0x10')]);router[_0x0275('0x11')]('/:id',auth[_0x0275('0xd')](),controller[_0x0275('0x12')]);module[_0x0275('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 0401185..810c291 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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7a54,0x106));var _0x47a5=function(_0x4737de,_0x56b593){_0x4737de=_0x4737de-0x0;var _0x2dad55=_0x7a54[_0x4737de];return _0x2dad55;};'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(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a54,0x106));var _0x47a5=function(_0x3eb954,_0x3eeaa){_0x3eb954=_0x3eb954-0x0;var _0x2920bd=_0x7a54[_0x3eb954];return _0x2920bd;};'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 8d27c35..f8f9be2 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 _0x37a7=['name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','attributes','fields','find','catch','create','body','destroy','describe','eml-format','rimraf','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','error','stack'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x37a7,0x6f));var _0x737a=function(_0x5184d9,_0x5d90b6){_0x5184d9=_0x5184d9-0x0;var _0x1639b6=_0x37a7[_0x5184d9];return _0x1639b6;};'use strict';var emlformat=require(_0x737a('0x0'));var rimraf=require(_0x737a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x737a('0x2'));var BPromise=require(_0x737a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x737a('0x4'));var csv=require(_0x737a('0x5'));var ejs=require(_0x737a('0x6'));var fs=require('fs');var fs_extra=require(_0x737a('0x7'));var _=require(_0x737a('0x8'));var squel=require('squel');var crypto=require(_0x737a('0x9'));var jsforce=require(_0x737a('0xa'));var deskjs=require(_0x737a('0xb'));var toCsv=require(_0x737a('0x5'));var querystring=require('querystring');var Papa=require(_0x737a('0xc'));var Redis=require(_0x737a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x737a('0xe'));var as=require(_0x737a('0xf'));var hardwareService=require(_0x737a('0x10'));var logger=require(_0x737a('0x11'))(_0x737a('0x12'));var utils=require(_0x737a('0x13'));var config=require(_0x737a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x737a('0x15'))['db'];function respondWithStatusCode(_0x22cc58,_0x2c4e57){_0x2c4e57=_0x2c4e57||0xcc;return function(_0x202575){if(_0x202575){return _0x22cc58[_0x737a('0x16')](_0x2c4e57);}return _0x22cc58[_0x737a('0x17')](_0x2c4e57)[_0x737a('0x18')]();};}function respondWithResult(_0x216a1d,_0x59b844){_0x59b844=_0x59b844||0xc8;return function(_0x449a00){if(_0x449a00){return _0x216a1d[_0x737a('0x17')](_0x59b844)['json'](_0x449a00);}};}function respondWithFilteredResult(_0x597c9d,_0xbf359e){return function(_0x37fc59){if(_0x37fc59){var _0x64901f=typeof _0xbf359e[_0x737a('0x19')]===_0x737a('0x1a')&&typeof _0xbf359e[_0x737a('0x1b')]==='undefined';var _0x369f2f=_0x37fc59['count'];var _0x30344f=_0x64901f?0x0:_0xbf359e[_0x737a('0x19')];var _0x58fb1f=_0x64901f?_0x37fc59[_0x737a('0x1c')]:_0xbf359e['offset']+_0xbf359e['limit'];var _0x3bf493;if(_0x58fb1f>=_0x369f2f){_0x58fb1f=_0x369f2f;_0x3bf493=0xc8;}else{_0x3bf493=0xce;}_0x597c9d[_0x737a('0x17')](_0x3bf493);return _0x597c9d['set'](_0x737a('0x1d'),_0x30344f+'-'+_0x58fb1f+'/'+_0x369f2f)[_0x737a('0x1e')](_0x37fc59);}return null;};}function patchUpdates(_0x8d8378){return function(_0x5d8e46){try{jsonpatch[_0x737a('0x1f')](_0x5d8e46,_0x8d8378,!![]);}catch(_0x4ac430){return BPromise[_0x737a('0x20')](_0x4ac430);}return _0x5d8e46['save']();};}function saveUpdates(_0x28a36e,_0x21d412){return function(_0x1e801d){if(_0x1e801d){return _0x1e801d[_0x737a('0x21')](_0x28a36e)[_0x737a('0x22')](function(_0xd334c0){return _0xd334c0;});}return null;};}function removeEntity(_0x1979e9,_0x379439){return function(_0x4deb7c){if(_0x4deb7c){return _0x4deb7c['destroy']()[_0x737a('0x22')](function(){_0x1979e9['status'](0xcc)[_0x737a('0x18')]();});}};}function handleEntityNotFound(_0x55c901,_0x23d112){return function(_0x1d1642){if(!_0x1d1642){_0x55c901[_0x737a('0x16')](0x194);}return _0x1d1642;};}function handleError(_0x417033,_0x43f395){_0x43f395=_0x43f395||0x1f4;return function(_0x49a1d3){logger[_0x737a('0x23')](_0x49a1d3[_0x737a('0x24')]);if(_0x49a1d3[_0x737a('0x25')]){delete _0x49a1d3[_0x737a('0x25')];}_0x417033[_0x737a('0x17')](_0x43f395)[_0x737a('0x26')](_0x49a1d3);};}exports[_0x737a('0x27')]=function(_0x5a3590,_0x1e2e4c){var _0x15a81c={},_0x2e2a20={},_0x34d20e={'count':0x0,'rows':[]};var _0x22c841=_['map'](db[_0x737a('0x28')][_0x737a('0x29')],function(_0x4115c5){return{'name':_0x4115c5[_0x737a('0x2a')],'type':_0x4115c5['type'][_0x737a('0x2b')]};});_0x2e2a20[_0x737a('0x2c')]=_[_0x737a('0x2d')](_0x22c841,_0x737a('0x25'));_0x2e2a20[_0x737a('0x2e')]=_[_0x737a('0x2f')](_0x5a3590[_0x737a('0x2e')]);_0x2e2a20[_0x737a('0x30')]=_[_0x737a('0x31')](_0x2e2a20[_0x737a('0x2c')],_0x2e2a20['query']);_0x15a81c['attributes']=_['intersection'](_0x2e2a20[_0x737a('0x2c')],qs['fields'](_0x5a3590['query']['fields']));_0x15a81c['attributes']=_0x15a81c['attributes'][_0x737a('0x32')]?_0x15a81c['attributes']:_0x2e2a20['model'];if(!_0x5a3590[_0x737a('0x2e')][_0x737a('0x33')](_0x737a('0x34'))){_0x15a81c[_0x737a('0x1b')]=qs[_0x737a('0x1b')](_0x5a3590[_0x737a('0x2e')][_0x737a('0x1b')]);_0x15a81c[_0x737a('0x19')]=qs[_0x737a('0x19')](_0x5a3590[_0x737a('0x2e')][_0x737a('0x19')]);}_0x15a81c[_0x737a('0x35')]=qs[_0x737a('0x36')](_0x5a3590[_0x737a('0x2e')][_0x737a('0x36')]);_0x15a81c[_0x737a('0x37')]=qs['filters'](_[_0x737a('0x38')](_0x5a3590[_0x737a('0x2e')],_0x2e2a20[_0x737a('0x30')]),_0x22c841);if(_0x5a3590[_0x737a('0x2e')][_0x737a('0x39')]){_0x15a81c['where']=_[_0x737a('0x3a')](_0x15a81c[_0x737a('0x37')],{'$or':_[_0x737a('0x2d')](_0x22c841,function(_0x5d2c04){if(_0x5d2c04['type']!==_0x737a('0x3b')){var _0xc62b6b={};_0xc62b6b[_0x5d2c04['name']]={'$like':'%'+_0x5a3590[_0x737a('0x2e')][_0x737a('0x39')]+'%'};return _0xc62b6b;}})});}_0x15a81c=_[_0x737a('0x3a')]({},_0x15a81c,_0x5a3590[_0x737a('0x3c')]);var _0x3b47db={'where':_0x15a81c['where']};return db[_0x737a('0x28')][_0x737a('0x1c')](_0x3b47db)[_0x737a('0x22')](function(_0x3f3f22){_0x34d20e['count']=_0x3f3f22;if(_0x5a3590[_0x737a('0x2e')][_0x737a('0x3d')]){_0x15a81c[_0x737a('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x15a81c);})[_0x737a('0x22')](function(_0x43a939){_0x34d20e[_0x737a('0x3f')]=_0x43a939;return _0x34d20e;})[_0x737a('0x22')](respondWithFilteredResult(_0x1e2e4c,_0x15a81c))['catch'](handleError(_0x1e2e4c,null));};exports[_0x737a('0x40')]=function(_0x45e818,_0x3d2f9e){var _0x451598={'raw':!![],'where':{'id':_0x45e818[_0x737a('0x41')]['id']}},_0xca416f={};_0xca416f['model']=_[_0x737a('0x2f')](db['JscriptyAnswerReport']['rawAttributes']);_0xca416f[_0x737a('0x2e')]=_[_0x737a('0x2f')](_0x45e818[_0x737a('0x2e')]);_0xca416f[_0x737a('0x30')]=_['intersection'](_0xca416f['model'],_0xca416f[_0x737a('0x2e')]);_0x451598[_0x737a('0x42')]=_[_0x737a('0x31')](_0xca416f['model'],qs[_0x737a('0x43')](_0x45e818[_0x737a('0x2e')][_0x737a('0x43')]));_0x451598[_0x737a('0x42')]=_0x451598[_0x737a('0x42')][_0x737a('0x32')]?_0x451598[_0x737a('0x42')]:_0xca416f[_0x737a('0x2c')];if(_0x45e818[_0x737a('0x2e')][_0x737a('0x3d')]){_0x451598[_0x737a('0x3e')]=[{'all':!![]}];}_0x451598=_[_0x737a('0x3a')]({},_0x451598,_0x45e818[_0x737a('0x3c')]);return db[_0x737a('0x28')][_0x737a('0x44')](_0x451598)[_0x737a('0x22')](handleEntityNotFound(_0x3d2f9e,null))[_0x737a('0x22')](respondWithResult(_0x3d2f9e,null))[_0x737a('0x45')](handleError(_0x3d2f9e,null));};exports['create']=function(_0x1f3810,_0x1102cf){return db[_0x737a('0x28')][_0x737a('0x46')](_0x1f3810['body'],{})[_0x737a('0x22')](respondWithResult(_0x1102cf,0xc9))[_0x737a('0x45')](handleError(_0x1102cf,null));};exports[_0x737a('0x21')]=function(_0xd91856,_0x3f9b66){if(_0xd91856[_0x737a('0x47')]['id']){delete _0xd91856[_0x737a('0x47')]['id'];}return db[_0x737a('0x28')]['find']({'where':{'id':_0xd91856[_0x737a('0x41')]['id']}})[_0x737a('0x22')](handleEntityNotFound(_0x3f9b66,null))[_0x737a('0x22')](saveUpdates(_0xd91856[_0x737a('0x47')],null))[_0x737a('0x22')](respondWithResult(_0x3f9b66,null))['catch'](handleError(_0x3f9b66,null));};exports[_0x737a('0x48')]=function(_0x13d85d,_0x2ec643){return db[_0x737a('0x28')][_0x737a('0x44')]({'where':{'id':_0x13d85d[_0x737a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2ec643,null))[_0x737a('0x22')](removeEntity(_0x2ec643,null))['catch'](handleError(_0x2ec643,null));};exports[_0x737a('0x49')]=function(_0x3a0a08,_0x1d213c){return db[_0x737a('0x28')][_0x737a('0x49')]()['then'](respondWithResult(_0x1d213c,null))[_0x737a('0x45')](handleError(_0x1d213c,null));}; \ No newline at end of file +var _0x9fd4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x9fd4,0x16c));var _0x49fd=function(_0x3e39e3,_0xcd7b7e){_0x3e39e3=_0x3e39e3-0x0;var _0x452aef=_0x9fd4[_0x3e39e3];return _0x452aef;};'use strict';var emlformat=require(_0x49fd('0x0'));var rimraf=require(_0x49fd('0x1'));var zipdir=require(_0x49fd('0x2'));var jsonpatch=require(_0x49fd('0x3'));var rp=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var BPromise=require(_0x49fd('0x6'));var Mustache=require(_0x49fd('0x7'));var util=require(_0x49fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49fd('0x9'));var ejs=require(_0x49fd('0xa'));var fs=require('fs');var fs_extra=require(_0x49fd('0xb'));var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0x9'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var as=require(_0x49fd('0x14'));var hardwareService=require(_0x49fd('0x15'));var logger=require(_0x49fd('0x16'))(_0x49fd('0x17'));var utils=require('../../config/utils');var config=require(_0x49fd('0x18'));var licenseUtil=require(_0x49fd('0x19'));var db=require(_0x49fd('0x1a'))['db'];function respondWithStatusCode(_0x40d1b0,_0x15dabd){_0x15dabd=_0x15dabd||0xcc;return function(_0x206bd8){if(_0x206bd8){return _0x40d1b0[_0x49fd('0x1b')](_0x15dabd);}return _0x40d1b0[_0x49fd('0x1c')](_0x15dabd)[_0x49fd('0x1d')]();};}function respondWithResult(_0x652890,_0x157b09){_0x157b09=_0x157b09||0xc8;return function(_0x44c18c){if(_0x44c18c){return _0x652890[_0x49fd('0x1c')](_0x157b09)[_0x49fd('0x1e')](_0x44c18c);}};}function respondWithFilteredResult(_0x264ab1,_0x201109){return function(_0x2859f2){if(_0x2859f2){var _0x3ca675=typeof _0x201109[_0x49fd('0x1f')]===_0x49fd('0x20')&&typeof _0x201109[_0x49fd('0x21')]===_0x49fd('0x20');var _0x320fe5=_0x2859f2[_0x49fd('0x22')];var _0xb55d24=_0x3ca675?0x0:_0x201109[_0x49fd('0x1f')];var _0x598793=_0x3ca675?_0x2859f2[_0x49fd('0x22')]:_0x201109[_0x49fd('0x1f')]+_0x201109['limit'];var _0x5c323a;if(_0x598793>=_0x320fe5){_0x598793=_0x320fe5;_0x5c323a=0xc8;}else{_0x5c323a=0xce;}_0x264ab1[_0x49fd('0x1c')](_0x5c323a);return _0x264ab1['set'](_0x49fd('0x23'),_0xb55d24+'-'+_0x598793+'/'+_0x320fe5)[_0x49fd('0x1e')](_0x2859f2);}return null;};}function patchUpdates(_0x599315){return function(_0xf7efcf){try{jsonpatch[_0x49fd('0x24')](_0xf7efcf,_0x599315,!![]);}catch(_0x5ae3bc){return BPromise[_0x49fd('0x25')](_0x5ae3bc);}return _0xf7efcf[_0x49fd('0x26')]();};}function saveUpdates(_0x2e1c40,_0x290f59){return function(_0x20fa0d){if(_0x20fa0d){return _0x20fa0d[_0x49fd('0x27')](_0x2e1c40)['then'](function(_0x46019d){return _0x46019d;});}return null;};}function removeEntity(_0xd43815,_0x8f202b){return function(_0x4bf811){if(_0x4bf811){return _0x4bf811[_0x49fd('0x28')]()[_0x49fd('0x29')](function(){_0xd43815[_0x49fd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597161,_0x497469){return function(_0x13c5a8){if(!_0x13c5a8){_0x597161[_0x49fd('0x1b')](0x194);}return _0x13c5a8;};}function handleError(_0x4ec190,_0x302ab2){_0x302ab2=_0x302ab2||0x1f4;return function(_0x9587b9){logger[_0x49fd('0x2a')](_0x9587b9[_0x49fd('0x2b')]);if(_0x9587b9[_0x49fd('0x2c')]){delete _0x9587b9['name'];}_0x4ec190[_0x49fd('0x1c')](_0x302ab2)['send'](_0x9587b9);};}exports[_0x49fd('0x2d')]=function(_0x89badc,_0x54acb5){var _0x203038={},_0x2c8568={},_0x23374c={'count':0x0,'rows':[]};var _0x43826f=_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')],function(_0x242203){return{'name':_0x242203['fieldName'],'type':_0x242203[_0x49fd('0x31')]['key']};});_0x2c8568[_0x49fd('0x32')]=_['map'](_0x43826f,_0x49fd('0x2c'));_0x2c8568[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x89badc['query']);_0x2c8568['filters']=_['intersection'](_0x2c8568[_0x49fd('0x32')],_0x2c8568[_0x49fd('0x33')]);_0x203038['attributes']=_[_0x49fd('0x35')](_0x2c8568['model'],qs['fields'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x36')]));_0x203038[_0x49fd('0x37')]=_0x203038[_0x49fd('0x37')][_0x49fd('0x38')]?_0x203038['attributes']:_0x2c8568['model'];if(!_0x89badc[_0x49fd('0x33')][_0x49fd('0x39')](_0x49fd('0x3a'))){_0x203038[_0x49fd('0x21')]=qs['limit'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x21')]);_0x203038[_0x49fd('0x1f')]=qs[_0x49fd('0x1f')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x1f')]);}_0x203038[_0x49fd('0x3b')]=qs[_0x49fd('0x3c')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x3c')]);_0x203038[_0x49fd('0x3d')]=qs['filters'](_[_0x49fd('0x3e')](_0x89badc[_0x49fd('0x33')],_0x2c8568[_0x49fd('0x3f')]),_0x43826f);if(_0x89badc[_0x49fd('0x33')][_0x49fd('0x40')]){_0x203038[_0x49fd('0x3d')]=_[_0x49fd('0x41')](_0x203038[_0x49fd('0x3d')],{'$or':_[_0x49fd('0x2e')](_0x43826f,function(_0x4a1856){if(_0x4a1856[_0x49fd('0x31')]!=='VIRTUAL'){var _0x46e84c={};_0x46e84c[_0x4a1856[_0x49fd('0x2c')]]={'$like':'%'+_0x89badc['query'][_0x49fd('0x40')]+'%'};return _0x46e84c;}})});}_0x203038=_[_0x49fd('0x41')]({},_0x203038,_0x89badc['options']);var _0x1f9a65={'where':_0x203038['where']};return db['JscriptyAnswerReport']['count'](_0x1f9a65)[_0x49fd('0x29')](function(_0x32982e){_0x23374c[_0x49fd('0x22')]=_0x32982e;if(_0x89badc[_0x49fd('0x33')]['includeAll']){_0x203038[_0x49fd('0x42')]=[{'all':!![]}];}return db[_0x49fd('0x2f')][_0x49fd('0x43')](_0x203038);})[_0x49fd('0x29')](function(_0x115c5a){_0x23374c[_0x49fd('0x44')]=_0x115c5a;return _0x23374c;})[_0x49fd('0x29')](respondWithFilteredResult(_0x54acb5,_0x203038))[_0x49fd('0x45')](handleError(_0x54acb5,null));};exports['show']=function(_0x255a73,_0x2c8ab1){var _0x4dce94={'raw':!![],'where':{'id':_0x255a73[_0x49fd('0x46')]['id']}},_0x3be41b={};_0x3be41b['model']=_[_0x49fd('0x34')](db['JscriptyAnswerReport'][_0x49fd('0x30')]);_0x3be41b[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x255a73[_0x49fd('0x33')]);_0x3be41b['filters']=_['intersection'](_0x3be41b[_0x49fd('0x32')],_0x3be41b['query']);_0x4dce94[_0x49fd('0x37')]=_[_0x49fd('0x35')](_0x3be41b[_0x49fd('0x32')],qs[_0x49fd('0x36')](_0x255a73['query'][_0x49fd('0x36')]));_0x4dce94[_0x49fd('0x37')]=_0x4dce94[_0x49fd('0x37')][_0x49fd('0x38')]?_0x4dce94[_0x49fd('0x37')]:_0x3be41b[_0x49fd('0x32')];if(_0x255a73[_0x49fd('0x33')][_0x49fd('0x47')]){_0x4dce94[_0x49fd('0x42')]=[{'all':!![]}];}_0x4dce94=_[_0x49fd('0x41')]({},_0x4dce94,_0x255a73[_0x49fd('0x48')]);return db[_0x49fd('0x2f')][_0x49fd('0x49')](_0x4dce94)[_0x49fd('0x29')](handleEntityNotFound(_0x2c8ab1,null))['then'](respondWithResult(_0x2c8ab1,null))['catch'](handleError(_0x2c8ab1,null));};exports[_0x49fd('0x4a')]=function(_0xa3518f,_0x42287e){return db[_0x49fd('0x2f')]['create'](_0xa3518f[_0x49fd('0x4b')],{})[_0x49fd('0x29')](respondWithResult(_0x42287e,0xc9))['catch'](handleError(_0x42287e,null));};exports[_0x49fd('0x27')]=function(_0x270360,_0xaac56f){if(_0x270360[_0x49fd('0x4b')]['id']){delete _0x270360[_0x49fd('0x4b')]['id'];}return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x46')]['id']}})[_0x49fd('0x29')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x29')](saveUpdates(_0x270360[_0x49fd('0x4b')],null))['then'](respondWithResult(_0xaac56f,null))[_0x49fd('0x45')](handleError(_0xaac56f,null));};exports[_0x49fd('0x28')]=function(_0x32694b,_0x263cf3){return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x32694b['params']['id']}})['then'](handleEntityNotFound(_0x263cf3,null))[_0x49fd('0x29')](removeEntity(_0x263cf3,null))[_0x49fd('0x45')](handleError(_0x263cf3,null));};exports[_0x49fd('0x4c')]=function(_0x5c34c0,_0x31783f){return db[_0x49fd('0x2f')]['describe']()['then'](respondWithResult(_0x31783f,null))['catch'](handleError(_0x31783f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4473d34..c501df4 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 _0x7569=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','rimraf','./jscriptyAnswerReport.attributes','exports'];(function(_0x5d5062,_0x4c7226){var _0x3e2ad1=function(_0x5ce243){while(--_0x5ce243){_0x5d5062['push'](_0x5d5062['shift']());}};_0x3e2ad1(++_0x4c7226);}(_0x7569,0x71));var _0x9756=function(_0x1a2b2f,_0x2e58cb){_0x1a2b2f=_0x1a2b2f-0x0;var _0x48cf5b=_0x7569[_0x1a2b2f];return _0x48cf5b;};'use strict';var _=require(_0x9756('0x0'));var util=require(_0x9756('0x1'));var logger=require(_0x9756('0x2'))('api');var moment=require(_0x9756('0x3'));var BPromise=require('bluebird');var rp=require(_0x9756('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9756('0x5'));var config=require('../../config/environment');var attributes=require(_0x9756('0x6'));module[_0x9756('0x7')]=function(_0x27df9f,_0x48a91d){return _0x27df9f[_0x9756('0x8')](_0x9756('0x9'),attributes,{'tableName':_0x9756('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa668=['report_jscripty_answers','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0xa668,0x1c3));var _0x8a66=function(_0x2716de,_0x263660){_0x2716de=_0x2716de-0x0;var _0x385180=_0xa668[_0x2716de];return _0x385180;};'use strict';var _=require(_0x8a66('0x0'));var util=require(_0x8a66('0x1'));var logger=require(_0x8a66('0x2'))('api');var moment=require(_0x8a66('0x3'));var BPromise=require(_0x8a66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8a66('0x5'));var attributes=require(_0x8a66('0x6'));module[_0x8a66('0x7')]=function(_0x54d161,_0x48fa52){return _0x54d161['define'](_0x8a66('0x8'),attributes,{'tableName':_0x8a66('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 7912a75..e9e7e29 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 _0x93aa=['error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1be178,_0x3bf9ab){var _0x37e2d0=function(_0x545e92){while(--_0x545e92){_0x1be178['push'](_0x1be178['shift']());}};_0x37e2d0(++_0x3bf9ab);}(_0x93aa,0x1b7));var _0xa93a=function(_0x1be714,_0x38f376){_0x1be714=_0x1be714-0x0;var _0x3f2739=_0x93aa[_0x1be714];return _0x3f2739;};'use strict';var _=require(_0xa93a('0x0'));var util=require(_0xa93a('0x1'));var moment=require(_0xa93a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa93a('0x3'));var fs=require('fs');var Redis=require(_0xa93a('0x4'));var db=require(_0xa93a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa93a('0x6'));var config=require(_0xa93a('0x7'));var jayson=require(_0xa93a('0x8'));var client=jayson[_0xa93a('0x9')][_0xa93a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bee0d,_0x2ba7e2,_0xa5e468){return new BPromise(function(_0x4eda60,_0x554e24){return client[_0xa93a('0xb')](_0x5bee0d,_0xa5e468)[_0xa93a('0xc')](function(_0x4fe1c3){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0xa93a('0xd'));logger[_0xa93a('0xe')](_0xa93a('0xf'),_0x2ba7e2,_0xa93a('0xd'),JSON[_0xa93a('0x10')](_0x4fe1c3));if(_0x4fe1c3[_0xa93a('0x11')]){if(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x12')]===0x1f4){logger[_0xa93a('0x11')](_0xa93a('0x13'),_0x2ba7e2,_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);return _0x554e24(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);}logger[_0xa93a('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0x4fe1c3['error'][_0xa93a('0x14')]);return _0x4eda60(_0x4fe1c3[_0xa93a('0x11')][_0xa93a('0x14')]);}else{logger[_0xa93a('0x15')](_0xa93a('0x13'),_0x2ba7e2,_0xa93a('0xd'));_0x4eda60(_0x4fe1c3[_0xa93a('0x16')]['message']);}})[_0xa93a('0x17')](function(_0x44fa67){logger[_0xa93a('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ba7e2,_0x44fa67);_0x554e24(_0x44fa67);});});} \ No newline at end of file +var _0x4637=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4637,0x1bc));var _0x7463=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4637[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7463('0x0'));var rs=require(_0x7463('0x1'));var fs=require('fs');var Redis=require(_0x7463('0x2'));var db=require(_0x7463('0x3'))['db'];var utils=require(_0x7463('0x4'));var logger=require(_0x7463('0x5'))(_0x7463('0x6'));var config=require(_0x7463('0x7'));var jayson=require(_0x7463('0x8'));var client=jayson[_0x7463('0x9')][_0x7463('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d5dea,_0x4cf4c4,_0x4aa527){return new BPromise(function(_0xc392d8,_0x4765c5){return client[_0x7463('0xb')](_0x5d5dea,_0x4aa527)[_0x7463('0xc')](function(_0x55eb73){logger[_0x7463('0xd')](_0x7463('0xe'),_0x4cf4c4,'request\x20sent');logger[_0x7463('0xf')](_0x7463('0x10'),_0x4cf4c4,_0x7463('0x11'),JSON['stringify'](_0x55eb73));if(_0x55eb73['error']){if(_0x55eb73[_0x7463('0x12')][_0x7463('0x13')]===0x1f4){logger[_0x7463('0x12')](_0x7463('0xe'),_0x4cf4c4,_0x55eb73[_0x7463('0x12')][_0x7463('0x14')]);return _0x4765c5(_0x55eb73[_0x7463('0x12')][_0x7463('0x14')]);}logger[_0x7463('0x12')](_0x7463('0xe'),_0x4cf4c4,_0x55eb73[_0x7463('0x12')][_0x7463('0x14')]);return _0xc392d8(_0x55eb73[_0x7463('0x12')][_0x7463('0x14')]);}else{logger['info'](_0x7463('0xe'),_0x4cf4c4,_0x7463('0x11'));_0xc392d8(_0x55eb73[_0x7463('0x15')][_0x7463('0x14')]);}})[_0x7463('0x16')](function(_0x4e3e29){logger[_0x7463('0x12')](_0x7463('0xe'),_0x4cf4c4,_0x4e3e29);_0x4765c5(_0x4e3e29);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8c0aea8..588aaf3 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 _0x8dfe=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','/:id/sessions','getAnswers','30s','getSummary','post','clone','put','/:id','update','delete'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x8dfe,0x151));var _0xe8df=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8dfe[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xe8df('0x0'));var util=require(_0xe8df('0x1'));var path=require('path');var timeout=require(_0xe8df('0x2'));var express=require(_0xe8df('0x3'));var router=express[_0xe8df('0x4')]();var fs_extra=require(_0xe8df('0x5'));var auth=require(_0xe8df('0x6'));var interaction=require(_0xe8df('0x7'));var config=require(_0xe8df('0x8'));var controller=require(_0xe8df('0x9'));router[_0xe8df('0xa')]('/',auth['isAuthenticated'](),controller[_0xe8df('0xb')]);router[_0xe8df('0xa')]('/:id',auth[_0xe8df('0xc')](),controller['show']);router['get'](_0xe8df('0xd'),auth[_0xe8df('0xc')](),controller['getSessions']);router['get']('/:id/answers',auth[_0xe8df('0xc')](),controller[_0xe8df('0xe')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout(_0xe8df('0xf')),controller[_0xe8df('0x10')]);router[_0xe8df('0x11')]('/',auth[_0xe8df('0xc')](),controller['create']);router[_0xe8df('0x11')]('/:id/clone',auth[_0xe8df('0xc')](),controller[_0xe8df('0x12')]);router[_0xe8df('0x13')](_0xe8df('0x14'),auth[_0xe8df('0xc')](),controller[_0xe8df('0x15')]);router[_0xe8df('0x16')](_0xe8df('0x14'),auth[_0xe8df('0xc')](),controller['destroy']);module[_0xe8df('0x17')]=router; \ No newline at end of file +var _0x554c=['show','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x554c,0xca));var _0xc554=function(_0x3f37d0,_0x4ea2af){_0x3f37d0=_0x3f37d0-0x0;var _0x63dc2d=_0x554c[_0x3f37d0];return _0x63dc2d;};'use strict';var multer=require('multer');var util=require(_0xc554('0x0'));var path=require(_0xc554('0x1'));var timeout=require(_0xc554('0x2'));var express=require(_0xc554('0x3'));var router=express[_0xc554('0x4')]();var fs_extra=require(_0xc554('0x5'));var auth=require(_0xc554('0x6'));var interaction=require(_0xc554('0x7'));var config=require(_0xc554('0x8'));var controller=require(_0xc554('0x9'));router[_0xc554('0xa')]('/',auth['isAuthenticated'](),controller[_0xc554('0xb')]);router[_0xc554('0xa')](_0xc554('0xc'),auth[_0xc554('0xd')](),controller[_0xc554('0xe')]);router[_0xc554('0xa')]('/:id/sessions',auth[_0xc554('0xd')](),controller['getSessions']);router[_0xc554('0xa')](_0xc554('0xf'),auth[_0xc554('0xd')](),controller[_0xc554('0x10')]);router[_0xc554('0xa')](_0xc554('0x11'),auth[_0xc554('0xd')](),timeout(_0xc554('0x12')),controller[_0xc554('0x13')]);router[_0xc554('0x14')]('/',auth[_0xc554('0xd')](),controller[_0xc554('0x15')]);router[_0xc554('0x14')](_0xc554('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0xc554('0x17')](_0xc554('0xc'),auth[_0xc554('0xd')](),controller[_0xc554('0x18')]);router['delete'](_0xc554('0xc'),auth[_0xc554('0xd')](),controller[_0xc554('0x19')]);module[_0xc554('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 38448ed..cd0cb96 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 _0x16fd=['TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','lodash','util','STRING','name'];(function(_0x21d0e6,_0x5a7aa6){var _0x1cc2d1=function(_0x25ded8){while(--_0x25ded8){_0x21d0e6['push'](_0x21d0e6['shift']());}};_0x1cc2d1(++_0x5a7aa6);}(_0x16fd,0x114));var _0xd16f=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x16fd[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require('sequelize');var _=require(_0xd16f('0x0'));var util=require(_0xd16f('0x1'));module['exports']={'name':{'type':Sequelize[_0xd16f('0x2')],'unique':_0xd16f('0x3')},'description':{'type':Sequelize[_0xd16f('0x2')]},'formData':{'type':Sequelize[_0xd16f('0x4')](_0xd16f('0x5')),'set':function(_0x227935){if(_[_0xd16f('0x6')](_0x227935)){this[_0xd16f('0x7')](_0xd16f('0x8'),JSON[_0xd16f('0x9')](_0x227935));}else if(_[_0xd16f('0xa')](_0x227935)){this[_0xd16f('0x7')](_0xd16f('0x8'),_0x227935);}else{this[_0xd16f('0x7')](_0xd16f('0x8'),util[_0xd16f('0xb')](_0xd16f('0xc'),this['getDataValue']('name')||'',this['getDataValue'](_0xd16f('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2bde=['getDataValue','BOOLEAN','lodash','util','exports','STRING','name','TEXT','isObjectLike','setDataValue','stringify','isString','formData','format'];(function(_0x85d6cb,_0x577fe7){var _0x4c5fc6=function(_0x441a20){while(--_0x441a20){_0x85d6cb['push'](_0x85d6cb['shift']());}};_0x4c5fc6(++_0x577fe7);}(_0x2bde,0xaa));var _0xe2bd=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x2bde[_0x448f8];return _0xa73126;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe2bd('0x0'));var util=require(_0xe2bd('0x1'));module[_0xe2bd('0x2')]={'name':{'type':Sequelize[_0xe2bd('0x3')],'unique':_0xe2bd('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xe2bd('0x5')]('long'),'set':function(_0x27225c){if(_[_0xe2bd('0x6')](_0x27225c)){this[_0xe2bd('0x7')]('formData',JSON[_0xe2bd('0x8')](_0x27225c));}else if(_[_0xe2bd('0x9')](_0x27225c)){this['setDataValue'](_0xe2bd('0xa'),_0x27225c);}else{this['setDataValue'](_0xe2bd('0xa'),util[_0xe2bd('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xe2bd('0xc')](_0xe2bd('0x4'))||'',this[_0xe2bd('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe2bd('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 6412906..affe6f3 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 _0x3cb4=['starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','count','limit','apply','reject','save','update','then','destroy','Projects','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','create','body','user','role','get','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getSessions','findOne','JscriptySessionReport','nolimit','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3cb4,0x1f1));var _0x43cb=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x3cb4[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x43cb('0x0'));var zipdir=require(_0x43cb('0x1'));var jsonpatch=require(_0x43cb('0x2'));var rp=require(_0x43cb('0x3'));var moment=require(_0x43cb('0x4'));var BPromise=require(_0x43cb('0x5'));var Mustache=require(_0x43cb('0x6'));var util=require(_0x43cb('0x7'));var path=require('path');var sox=require(_0x43cb('0x8'));var csv=require(_0x43cb('0x9'));var ejs=require(_0x43cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43cb('0xb'));var squel=require(_0x43cb('0xc'));var crypto=require(_0x43cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x43cb('0xe'));var toCsv=require(_0x43cb('0x9'));var querystring=require(_0x43cb('0xf'));var Papa=require(_0x43cb('0x10'));var Redis=require(_0x43cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x43cb('0x12'));var as=require(_0x43cb('0x13'));var hardwareService=require(_0x43cb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x43cb('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54f320,_0x593baa){_0x593baa=_0x593baa||0xcc;return function(_0x362982){if(_0x362982){return _0x54f320[_0x43cb('0x16')](_0x593baa);}return _0x54f320[_0x43cb('0x17')](_0x593baa)[_0x43cb('0x18')]();};}function respondWithResult(_0x422559,_0x3ea3d2){_0x3ea3d2=_0x3ea3d2||0xc8;return function(_0x33ffc4){if(_0x33ffc4){return _0x422559[_0x43cb('0x17')](_0x3ea3d2)[_0x43cb('0x19')](_0x33ffc4);}};}function respondWithFilteredResult(_0x3af51f,_0x2ecb6f){return function(_0x9a8ae0){if(_0x9a8ae0){var _0x252ebb=typeof _0x2ecb6f[_0x43cb('0x1a')]==='undefined'&&typeof _0x2ecb6f['limit']==='undefined';var _0x366af3=_0x9a8ae0[_0x43cb('0x1b')];var _0x4f52ce=_0x252ebb?0x0:_0x2ecb6f[_0x43cb('0x1a')];var _0x131797=_0x252ebb?_0x9a8ae0[_0x43cb('0x1b')]:_0x2ecb6f['offset']+_0x2ecb6f[_0x43cb('0x1c')];var _0x36ef48;if(_0x131797>=_0x366af3){_0x131797=_0x366af3;_0x36ef48=0xc8;}else{_0x36ef48=0xce;}_0x3af51f[_0x43cb('0x17')](_0x36ef48);return _0x3af51f['set']('Content-Range',_0x4f52ce+'-'+_0x131797+'/'+_0x366af3)[_0x43cb('0x19')](_0x9a8ae0);}return null;};}function patchUpdates(_0x122197){return function(_0x2e3f1c){try{jsonpatch[_0x43cb('0x1d')](_0x2e3f1c,_0x122197,!![]);}catch(_0x3cda74){return BPromise[_0x43cb('0x1e')](_0x3cda74);}return _0x2e3f1c[_0x43cb('0x1f')]();};}function saveUpdates(_0x2dc8f6,_0x3257a0){return function(_0x51f1b4){if(_0x51f1b4){return _0x51f1b4[_0x43cb('0x20')](_0x2dc8f6)[_0x43cb('0x21')](function(_0x365549){return _0x365549;});}return null;};}function removeEntity(_0x3c02a0,_0x3b09b5){return function(_0x497cef){if(_0x497cef){return _0x497cef[_0x43cb('0x22')]()[_0x43cb('0x21')](function(){var _0x5ec436=_0x497cef['get']({'plain':!![]});var _0xd4bbc2=_0x43cb('0x23');return db['UserProfileResource'][_0x43cb('0x22')]({'where':{'type':_0xd4bbc2,'resourceId':_0x5ec436['id']}})['then'](function(){return _0x497cef;});})[_0x43cb('0x21')](function(){_0x3c02a0[_0x43cb('0x17')](0xcc)[_0x43cb('0x18')]();});}};}function handleEntityNotFound(_0x42b200,_0xa1002c){return function(_0x57dba8){if(!_0x57dba8){_0x42b200[_0x43cb('0x16')](0x194);}return _0x57dba8;};}function handleError(_0x43009c,_0x5552c2){_0x5552c2=_0x5552c2||0x1f4;return function(_0x166167){logger['error'](_0x166167[_0x43cb('0x24')]);if(_0x166167[_0x43cb('0x25')]){delete _0x166167[_0x43cb('0x25')];}_0x43009c[_0x43cb('0x17')](_0x5552c2)[_0x43cb('0x26')](_0x166167);};}exports['index']=function(_0x1a27fa,_0x562f14){var _0x492484={},_0x57f9dd={},_0x4d09b2={'count':0x0,'rows':[]};var _0x4a8b22=_[_0x43cb('0x27')](db['JscriptyProject']['rawAttributes'],function(_0x4268ca){return{'name':_0x4268ca[_0x43cb('0x28')],'type':_0x4268ca[_0x43cb('0x29')][_0x43cb('0x2a')]};});_0x57f9dd[_0x43cb('0x2b')]=_[_0x43cb('0x27')](_0x4a8b22,_0x43cb('0x25'));_0x57f9dd[_0x43cb('0x2c')]=_[_0x43cb('0x2d')](_0x1a27fa['query']);_0x57f9dd[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x57f9dd[_0x43cb('0x2b')],_0x57f9dd[_0x43cb('0x2c')]);_0x492484[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x57f9dd[_0x43cb('0x2b')],qs[_0x43cb('0x31')](_0x1a27fa[_0x43cb('0x2c')]['fields']));_0x492484[_0x43cb('0x30')]=_0x492484[_0x43cb('0x30')][_0x43cb('0x32')]?_0x492484[_0x43cb('0x30')]:_0x57f9dd['model'];if(!_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x33')]('nolimit')){_0x492484[_0x43cb('0x1c')]=qs[_0x43cb('0x1c')](_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x1c')]);_0x492484[_0x43cb('0x1a')]=qs[_0x43cb('0x1a')](_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x1a')]);}_0x492484['order']=qs['sort'](_0x1a27fa['query'][_0x43cb('0x34')]);_0x492484['where']=qs[_0x43cb('0x2e')](_['pick'](_0x1a27fa[_0x43cb('0x2c')],_0x57f9dd['filters']),_0x4a8b22);if(_0x1a27fa['query'][_0x43cb('0x35')]){_0x492484[_0x43cb('0x36')]=_[_0x43cb('0x37')](_0x492484[_0x43cb('0x36')],{'$or':_[_0x43cb('0x27')](_0x4a8b22,function(_0x3379b0){if(_0x3379b0[_0x43cb('0x29')]!==_0x43cb('0x38')){var _0x2394fa={};_0x2394fa[_0x3379b0[_0x43cb('0x25')]]={'$like':'%'+_0x1a27fa['query'][_0x43cb('0x35')]+'%'};return _0x2394fa;}})});}_0x492484=_[_0x43cb('0x37')]({},_0x492484,_0x1a27fa[_0x43cb('0x39')]);var _0x49c8fb={'where':_0x492484['where']};return db['JscriptyProject']['count'](_0x49c8fb)[_0x43cb('0x21')](function(_0xa14bf4){_0x4d09b2[_0x43cb('0x1b')]=_0xa14bf4;if(_0x1a27fa[_0x43cb('0x2c')][_0x43cb('0x3a')]){_0x492484[_0x43cb('0x3b')]=[{'all':!![]}];}return db[_0x43cb('0x3c')][_0x43cb('0x3d')](_0x492484);})[_0x43cb('0x21')](function(_0x317e73){_0x4d09b2[_0x43cb('0x3e')]=_0x317e73;return _0x4d09b2;})[_0x43cb('0x21')](respondWithFilteredResult(_0x562f14,_0x492484))[_0x43cb('0x3f')](handleError(_0x562f14,null));};exports[_0x43cb('0x40')]=function(_0x28e190,_0x1eb402){var _0x464257={'raw':![],'where':{'id':_0x28e190[_0x43cb('0x41')]['id']}},_0x422db2={};_0x422db2[_0x43cb('0x2b')]=_[_0x43cb('0x2d')](db[_0x43cb('0x3c')]['rawAttributes']);_0x422db2[_0x43cb('0x2c')]=_[_0x43cb('0x2d')](_0x28e190[_0x43cb('0x2c')]);_0x422db2[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x422db2[_0x43cb('0x2b')],_0x422db2[_0x43cb('0x2c')]);_0x464257[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x422db2[_0x43cb('0x2b')],qs[_0x43cb('0x31')](_0x28e190[_0x43cb('0x2c')][_0x43cb('0x31')]));_0x464257[_0x43cb('0x30')]=_0x464257[_0x43cb('0x30')][_0x43cb('0x32')]?_0x464257[_0x43cb('0x30')]:_0x422db2[_0x43cb('0x2b')];if(_0x28e190['query'][_0x43cb('0x3a')]){_0x464257['include']=[{'all':!![]}];}_0x464257=_[_0x43cb('0x37')]({},_0x464257,_0x28e190[_0x43cb('0x39')]);return db[_0x43cb('0x3c')]['find'](_0x464257)[_0x43cb('0x21')](handleEntityNotFound(_0x1eb402,null))[_0x43cb('0x21')](respondWithResult(_0x1eb402,null))[_0x43cb('0x3f')](handleError(_0x1eb402,null));};exports[_0x43cb('0x42')]=function(_0x3ccaeb,_0x6aaf47){return db[_0x43cb('0x3c')]['create'](_0x3ccaeb[_0x43cb('0x43')],{})[_0x43cb('0x21')](function(_0x31d13c){var _0x2ef140=_0x3ccaeb[_0x43cb('0x44')]['get']({'plain':!![]});if(!_0x2ef140)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ef140[_0x43cb('0x45')]===_0x43cb('0x44')){var _0x1967cf=_0x31d13c[_0x43cb('0x46')]({'plain':!![]});var _0xedc49b='Projects';return db['UserProfileSection'][_0x43cb('0x47')]({'where':{'name':_0xedc49b,'userProfileId':_0x2ef140[_0x43cb('0x48')]},'raw':!![]})[_0x43cb('0x21')](function(_0x4107bd){if(_0x4107bd&&_0x4107bd[_0x43cb('0x49')]===0x0){return db[_0x43cb('0x4a')][_0x43cb('0x42')]({'name':_0x1967cf['name'],'resourceId':_0x1967cf['id'],'type':_0x4107bd[_0x43cb('0x25')],'sectionId':_0x4107bd['id']},{})[_0x43cb('0x21')](function(){return _0x31d13c;});}else{return _0x31d13c;}})[_0x43cb('0x3f')](function(_0x4a6aa1){logger[_0x43cb('0x4b')](_0x43cb('0x4c'),_0x4a6aa1);throw _0x4a6aa1;});}return _0x31d13c;})['then'](respondWithResult(_0x6aaf47,0xc9))[_0x43cb('0x3f')](handleError(_0x6aaf47,null));};exports[_0x43cb('0x4d')]=function(_0x2bfaa4,_0x3976f8){var _0x1d3bfa={'where':{'id':_0x2bfaa4[_0x43cb('0x41')]['id']}},_0x22333a={};_0x22333a[_0x43cb('0x2b')]=_['keys'](db[_0x43cb('0x3c')][_0x43cb('0x4e')]);_0x1d3bfa[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x22333a['model'],qs['fields'](_0x2bfaa4['query'][_0x43cb('0x31')]));_0x1d3bfa[_0x43cb('0x30')]=_0x1d3bfa['attributes'][_0x43cb('0x32')]?_0x1d3bfa[_0x43cb('0x30')]:_0x22333a[_0x43cb('0x2b')];if(_0x2bfaa4[_0x43cb('0x2c')][_0x43cb('0x3a')]){_0x1d3bfa[_0x43cb('0x3b')]=[{'all':!![]}];}_0x1d3bfa=_[_0x43cb('0x37')]({},_0x1d3bfa,_0x2bfaa4[_0x43cb('0x39')]);return db[_0x43cb('0x3c')][_0x43cb('0x47')](_0x1d3bfa)[_0x43cb('0x21')](handleEntityNotFound(_0x3976f8,null))[_0x43cb('0x21')](function(_0x2b6d91){if(_0x2b6d91){var _0x132cab=_0x2b6d91['get']({'plain':!![]});_0x132cab=qs[_0x43cb('0x4f')](_0x132cab,['id','createdAt',_0x43cb('0x50')]);_0x2bfaa4[_0x43cb('0x43')]=_['omit'](_0x2bfaa4[_0x43cb('0x43')],['id',_0x43cb('0x51'),_0x43cb('0x50')]);return db[_0x43cb('0x3c')][_0x43cb('0x42')](_[_0x43cb('0x37')](_0x132cab,_0x2bfaa4['body']),{'include':_0x2bfaa4[_0x43cb('0x2c')][_0x43cb('0x3a')]?[{'all':!![]}]:undefined})['then'](function(_0x399c9c){var _0x248ee8=_0x2bfaa4['user'][_0x43cb('0x46')]({'plain':!![]});if(!_0x248ee8)throw new Error(_0x43cb('0x52'));if(_0x248ee8[_0x43cb('0x45')]===_0x43cb('0x44')){var _0x4989d0=_0x399c9c['get']({'plain':!![]});var _0x22f39b=_0x43cb('0x23');return db[_0x43cb('0x53')][_0x43cb('0x47')]({'where':{'name':_0x22f39b,'userProfileId':_0x248ee8[_0x43cb('0x48')]},'raw':!![]})[_0x43cb('0x21')](function(_0x5b6bf3){if(_0x5b6bf3&&_0x5b6bf3[_0x43cb('0x49')]===0x0){return db['UserProfileResource'][_0x43cb('0x42')]({'name':_0x4989d0[_0x43cb('0x25')],'resourceId':_0x4989d0['id'],'type':_0x5b6bf3['name'],'sectionId':_0x5b6bf3['id']},{})['then'](function(){return _0x399c9c;});}else{return _0x399c9c;}})['catch'](function(_0x45cda9){logger[_0x43cb('0x4b')](_0x43cb('0x4c'),_0x45cda9);throw _0x45cda9;});}return _0x399c9c;});}})['then'](respondWithResult(_0x3976f8,0xc9))[_0x43cb('0x3f')](handleError(_0x3976f8,null));};exports['update']=function(_0x2e2891,_0x4901c6){if(_0x2e2891[_0x43cb('0x43')]['id']){delete _0x2e2891['body']['id'];}return db[_0x43cb('0x3c')][_0x43cb('0x47')]({'where':{'id':_0x2e2891['params']['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x4901c6,null))[_0x43cb('0x21')](saveUpdates(_0x2e2891[_0x43cb('0x43')],null))[_0x43cb('0x21')](respondWithResult(_0x4901c6,null))[_0x43cb('0x3f')](handleError(_0x4901c6,null));};exports['destroy']=function(_0x32684b,_0x5d4acf){return db['JscriptyProject'][_0x43cb('0x47')]({'where':{'id':_0x32684b['params']['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x5d4acf,null))[_0x43cb('0x21')](removeEntity(_0x5d4acf,null))[_0x43cb('0x3f')](handleError(_0x5d4acf,null));};exports[_0x43cb('0x54')]=function(_0x4db737,_0x34e07a,_0x462a5c){var _0x49cd75={'raw':!![],'where':{}};var _0x3248f3={};var _0x11126d={'count':0x0,'rows':[]};return db[_0x43cb('0x3c')][_0x43cb('0x55')]({'where':{'id':_0x4db737[_0x43cb('0x41')]['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x34e07a,null))[_0x43cb('0x21')](function(_0x1f34aa){if(_0x1f34aa){_0x3248f3[_0x43cb('0x2b')]=_[_0x43cb('0x2d')](db[_0x43cb('0x56')][_0x43cb('0x4e')]);_0x3248f3[_0x43cb('0x2c')]=_[_0x43cb('0x2d')](_0x4db737['query']);_0x3248f3[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x3248f3['model'],_0x3248f3[_0x43cb('0x2c')]);_0x49cd75[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x3248f3['model'],qs[_0x43cb('0x31')](_0x4db737['query'][_0x43cb('0x31')]));_0x49cd75[_0x43cb('0x30')]=_0x49cd75[_0x43cb('0x30')][_0x43cb('0x32')]?_0x49cd75[_0x43cb('0x30')]:_0x3248f3[_0x43cb('0x2b')];if(!_0x4db737[_0x43cb('0x2c')]['hasOwnProperty'](_0x43cb('0x57'))){_0x49cd75[_0x43cb('0x1c')]=qs[_0x43cb('0x1c')](_0x4db737[_0x43cb('0x2c')][_0x43cb('0x1c')]);_0x49cd75[_0x43cb('0x1a')]=qs[_0x43cb('0x1a')](_0x4db737[_0x43cb('0x2c')][_0x43cb('0x1a')]);}_0x49cd75['order']=qs['sort'](_0x4db737[_0x43cb('0x2c')][_0x43cb('0x34')]);_0x49cd75[_0x43cb('0x36')]=qs[_0x43cb('0x2e')](_[_0x43cb('0x58')](_0x4db737['query'],_0x3248f3[_0x43cb('0x2e')]));_0x49cd75[_0x43cb('0x36')][_0x43cb('0x59')]=_0x1f34aa['id'];if(_0x4db737[_0x43cb('0x2c')]['filter']){_0x49cd75[_0x43cb('0x36')]=_['merge'](_0x49cd75[_0x43cb('0x36')],{'$or':_[_0x43cb('0x27')](_0x49cd75[_0x43cb('0x30')],function(_0x139775){var _0x3e3002={};_0x3e3002[_0x139775]={'$like':'%'+_0x4db737[_0x43cb('0x2c')]['filter']+'%'};return _0x3e3002;})});}_0x49cd75=_['merge']({},_0x49cd75,_0x4db737[_0x43cb('0x39')]);return db[_0x43cb('0x56')][_0x43cb('0x1b')]({'where':_0x49cd75['where']})[_0x43cb('0x21')](function(_0xc4e39b){_0x11126d[_0x43cb('0x1b')]=_0xc4e39b;if(_0x4db737[_0x43cb('0x2c')]['includeAll']){_0x49cd75[_0x43cb('0x3b')]=[{'all':!![]}];}return db[_0x43cb('0x56')]['findAll'](_0x49cd75);})[_0x43cb('0x21')](function(_0x1df71d){_0x11126d[_0x43cb('0x3e')]=_0x1df71d;return _0x11126d;});}})[_0x43cb('0x21')](respondWithFilteredResult(_0x34e07a,_0x49cd75))[_0x43cb('0x3f')](handleError(_0x34e07a,null));};exports[_0x43cb('0x5a')]=function(_0x12ba30,_0x5a6c54,_0x103607){var _0x22d2e1={'raw':!![],'where':{}};var _0x5b3acf={};var _0x26156c={'count':0x0,'rows':[]};return db[_0x43cb('0x3c')][_0x43cb('0x55')]({'where':{'id':_0x12ba30[_0x43cb('0x41')]['id']}})[_0x43cb('0x21')](handleEntityNotFound(_0x5a6c54,null))['then'](function(_0x1b95b8){if(_0x1b95b8){_0x5b3acf[_0x43cb('0x2b')]=_[_0x43cb('0x2d')](db[_0x43cb('0x5b')]['rawAttributes']);_0x5b3acf['query']=_[_0x43cb('0x2d')](_0x12ba30['query']);_0x5b3acf[_0x43cb('0x2e')]=_[_0x43cb('0x2f')](_0x5b3acf['model'],_0x5b3acf[_0x43cb('0x2c')]);_0x22d2e1[_0x43cb('0x30')]=_[_0x43cb('0x2f')](_0x5b3acf['model'],qs['fields'](_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x31')]));_0x22d2e1['attributes']=_0x22d2e1[_0x43cb('0x30')][_0x43cb('0x32')]?_0x22d2e1['attributes']:_0x5b3acf[_0x43cb('0x2b')];if(!_0x12ba30['query'][_0x43cb('0x33')]('nolimit')){_0x22d2e1[_0x43cb('0x1c')]=qs['limit'](_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x1c')]);_0x22d2e1['offset']=qs[_0x43cb('0x1a')](_0x12ba30['query'][_0x43cb('0x1a')]);}_0x22d2e1['order']=qs[_0x43cb('0x34')](_0x12ba30[_0x43cb('0x2c')]['sort']);_0x22d2e1[_0x43cb('0x36')]=qs[_0x43cb('0x2e')](_['pick'](_0x12ba30[_0x43cb('0x2c')],_0x5b3acf['filters']));_0x22d2e1['where']['ProjectId']=_0x1b95b8['id'];if(_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x35')]){_0x22d2e1[_0x43cb('0x36')]=_['merge'](_0x22d2e1[_0x43cb('0x36')],{'$or':_['map'](_0x22d2e1[_0x43cb('0x30')],function(_0x55d15c){var _0x755009={};_0x755009[_0x55d15c]={'$like':'%'+_0x12ba30['query']['filter']+'%'};return _0x755009;})});}_0x22d2e1=_[_0x43cb('0x37')]({},_0x22d2e1,_0x12ba30[_0x43cb('0x39')]);return db[_0x43cb('0x5b')]['count']({'where':_0x22d2e1[_0x43cb('0x36')]})[_0x43cb('0x21')](function(_0x3411f5){_0x26156c[_0x43cb('0x1b')]=_0x3411f5;if(_0x12ba30[_0x43cb('0x2c')][_0x43cb('0x3a')]){_0x22d2e1[_0x43cb('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x43cb('0x3d')](_0x22d2e1);})[_0x43cb('0x21')](function(_0x38a1b4){_0x26156c['rows']=_0x38a1b4;return _0x26156c;});}})[_0x43cb('0x21')](respondWithFilteredResult(_0x5a6c54,_0x22d2e1))['catch'](handleError(_0x5a6c54,null));};function char(_0x424e37){return _0x43cb('0x5c')===typeof _0x424e37?String[_0x43cb('0x5d')][_0x43cb('0x1d')](null,arguments):_0x424e37;}function needsEncapsulation(_0x43f03c){return!!_0x43f03c&&(_0x43f03c['toString']()['indexOf'](char(0xd))>=0x0||_0x43f03c[_0x43cb('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x43f03c[_0x43cb('0x5e')]()[_0x43cb('0x5f')](char(0x2c))>=0x0||_0x43f03c[_0x43cb('0x5e')]()[_0x43cb('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x513b85){var _0x1f6f8b=char(0x22),_0x117930='\x5c'+char(0x22),_0x4ef7fb=_0x513b85[_0x43cb('0x5e')]()['replace'](new RegExp(_0x1f6f8b,'g'),_0x117930);return _0x1f6f8b+_0x4ef7fb+_0x1f6f8b;}exports[_0x43cb('0x60')]=function(_0x4071dc,_0x1ee543,_0x47be38){var _0x1ec417,_0x43445b;var _0x199351={'where':{'ProjectId':_0x4071dc[_0x43cb('0x41')]['id']}};if(_0x4071dc[_0x43cb('0x2c')][_0x43cb('0x61')]){_0x199351['where'][_0x43cb('0x62')]=JSON[_0x43cb('0x63')](_0x4071dc['query'][_0x43cb('0x61')]);}return db[_0x43cb('0x56')][_0x43cb('0x3d')](_0x199351)[_0x43cb('0x21')](handleEntityNotFound(_0x1ee543,null))[_0x43cb('0x21')](function(_0x12bbca){if(_0x12bbca){_0x1ec417=_0x12bbca;return db[_0x43cb('0x64')][_0x43cb('0x3d')]({'where':{'SessionId':{'$in':_['map'](_0x1ec417,'id')},'ProjectId':_0x4071dc[_0x43cb('0x41')]['id']},'order':_0x43cb('0x65')});}})[_0x43cb('0x21')](handleEntityNotFound(_0x1ee543,null))['then'](function(_0xcd5c9d){if(_0xcd5c9d){_0x43445b=_0xcd5c9d;var _0xb1a289={};for(var _0x31ed64=0x0,_0x266b52=_0x43445b[_0x43cb('0x32')];_0x31ed64<_0x266b52;_0x31ed64++){if(!_0xb1a289[_0x43cb('0x33')](_0x43445b[_0x31ed64][_0x43cb('0x66')])){_0xb1a289[_0x43445b[_0x31ed64][_0x43cb('0x66')]]=needsEncapsulation(_0x43445b[_0x31ed64][_0x43cb('0x67')])?encapsulate(_0x43445b[_0x31ed64][_0x43cb('0x67')]):_0x43445b[_0x31ed64][_0x43cb('0x67')];}}var _0x49a951=[],_0x59ae65={};for(var _0x4239db=0x0,_0xc7cebc=_0x1ec417[_0x43cb('0x32')];_0x4239db<_0xc7cebc;_0x4239db++){_0x59ae65={'ProjectId':_0x4071dc[_0x43cb('0x41')]['id'],'SessionId':_0x1ec417[_0x4239db]['id'],'StartTime':moment(_0x1ec417[_0x4239db][_0x43cb('0x62')])[_0x43cb('0x68')](_0x43cb('0x69'))};for(var _0x2c783a=0x0,_0x525b60=_0x43445b['length'];_0x2c783a<_0x525b60;_0x2c783a++){if(_0x43445b[_0x2c783a][_0x43cb('0x6a')]==_0x1ec417[_0x4239db]['id']&&_0xb1a289[_0x43cb('0x33')](_0x43445b[_0x2c783a][_0x43cb('0x66')])){_0x59ae65[_0xb1a289[_0x43445b[_0x2c783a]['questionId']]]=_0x43445b[_0x2c783a][_0x43cb('0x6b')];}}for(var _0x37ff49 in _0xb1a289){if(!_0x59ae65[_0x43cb('0x33')](_0xb1a289[_0x37ff49])){_0x59ae65[_0xb1a289[_0x37ff49]]=null;}}_0x49a951[_0x43cb('0x6c')](_0x59ae65);}return _0x49a951;}})[_0x43cb('0x21')](function(_0xd71133){if(!_[_0x43cb('0x6d')](_0xd71133)){var _0x322e06=toCsv(_0xd71133);var _0x136a90=Date[_0x43cb('0x6e')]();fs[_0x43cb('0x6f')](util[_0x43cb('0x68')](_0x43cb('0x70'),_0x4071dc[_0x43cb('0x41')]['id'],_0x136a90),_0x322e06);_0x1ee543['setHeader'](_0x43cb('0x71'),_0x43cb('0x72')+util[_0x43cb('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0x4071dc[_0x43cb('0x41')]['id'],_0x136a90));_0x1ee543[_0x43cb('0x73')](_0x43cb('0x74'),_0x43cb('0x75'));return _0x1ee543[_0x43cb('0x76')](util[_0x43cb('0x68')](_0x43cb('0x70'),_0x4071dc[_0x43cb('0x41')]['id'],_0x136a90));}else{return _0x1ee543[_0x43cb('0x16')](0xcc);}})[_0x43cb('0x3f')](handleError(_0x1ee543,null));}; \ No newline at end of file +var _0x184d=['YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','rimraf','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','Projects','UserProfileResource','error','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','clone','params','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','options','findAll','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','starttime','startTime','-createdAt','questionId','question','format'];(function(_0x5d8ee1,_0x3626cb){var _0x2e312b=function(_0x237770){while(--_0x237770){_0x5d8ee1['push'](_0x5d8ee1['shift']());}};_0x2e312b(++_0x3626cb);}(_0x184d,0x1d0));var _0xd184=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x184d[_0x5627e1];return _0x2f013f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd184('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd184('0x1'));var Mustache=require(_0xd184('0x2'));var util=require(_0xd184('0x3'));var path=require(_0xd184('0x4'));var sox=require(_0xd184('0x5'));var csv=require(_0xd184('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd184('0x7'));var crypto=require(_0xd184('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd184('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd184('0xa'));var Redis=require(_0xd184('0xb'));var authService=require(_0xd184('0xc'));var qs=require(_0xd184('0xd'));var as=require(_0xd184('0xe'));var hardwareService=require(_0xd184('0xf'));var logger=require('../../config/logger')(_0xd184('0x10'));var utils=require(_0xd184('0x11'));var config=require(_0xd184('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd184('0x13'))['db'];function respondWithStatusCode(_0x5e5585,_0x33b94c){_0x33b94c=_0x33b94c||0xcc;return function(_0x3e27db){if(_0x3e27db){return _0x5e5585[_0xd184('0x14')](_0x33b94c);}return _0x5e5585[_0xd184('0x15')](_0x33b94c)[_0xd184('0x16')]();};}function respondWithResult(_0x7dc346,_0x5a13eb){_0x5a13eb=_0x5a13eb||0xc8;return function(_0x35a0f5){if(_0x35a0f5){return _0x7dc346[_0xd184('0x15')](_0x5a13eb)[_0xd184('0x17')](_0x35a0f5);}};}function respondWithFilteredResult(_0x313c07,_0x712577){return function(_0x316f4a){if(_0x316f4a){var _0x3fe670=typeof _0x712577[_0xd184('0x18')]===_0xd184('0x19')&&typeof _0x712577[_0xd184('0x1a')]==='undefined';var _0x48203f=_0x316f4a['count'];var _0x2584f8=_0x3fe670?0x0:_0x712577[_0xd184('0x18')];var _0x3dd63e=_0x3fe670?_0x316f4a[_0xd184('0x1b')]:_0x712577[_0xd184('0x18')]+_0x712577[_0xd184('0x1a')];var _0x2f9f39;if(_0x3dd63e>=_0x48203f){_0x3dd63e=_0x48203f;_0x2f9f39=0xc8;}else{_0x2f9f39=0xce;}_0x313c07['status'](_0x2f9f39);return _0x313c07[_0xd184('0x1c')](_0xd184('0x1d'),_0x2584f8+'-'+_0x3dd63e+'/'+_0x48203f)[_0xd184('0x17')](_0x316f4a);}return null;};}function patchUpdates(_0x38bbaf){return function(_0x92a5f9){try{jsonpatch[_0xd184('0x1e')](_0x92a5f9,_0x38bbaf,!![]);}catch(_0x540294){return BPromise[_0xd184('0x1f')](_0x540294);}return _0x92a5f9['save']();};}function saveUpdates(_0x1318a7,_0x2fc10d){return function(_0x1cae70){if(_0x1cae70){return _0x1cae70[_0xd184('0x20')](_0x1318a7)[_0xd184('0x21')](function(_0x1aeafb){return _0x1aeafb;});}return null;};}function removeEntity(_0x52b84b,_0x5398b5){return function(_0x466307){if(_0x466307){return _0x466307['destroy']()['then'](function(){var _0xcb670d=_0x466307['get']({'plain':!![]});var _0x5ae859=_0xd184('0x22');return db[_0xd184('0x23')]['destroy']({'where':{'type':_0x5ae859,'resourceId':_0xcb670d['id']}})[_0xd184('0x21')](function(){return _0x466307;});})[_0xd184('0x21')](function(){_0x52b84b[_0xd184('0x15')](0xcc)[_0xd184('0x16')]();});}};}function handleEntityNotFound(_0x1cdd3e,_0x1f8c99){return function(_0x116254){if(!_0x116254){_0x1cdd3e[_0xd184('0x14')](0x194);}return _0x116254;};}function handleError(_0x201088,_0x3c4c18){_0x3c4c18=_0x3c4c18||0x1f4;return function(_0x540b6d){logger[_0xd184('0x24')](_0x540b6d['stack']);if(_0x540b6d[_0xd184('0x25')]){delete _0x540b6d[_0xd184('0x25')];}_0x201088['status'](_0x3c4c18)[_0xd184('0x26')](_0x540b6d);};}exports[_0xd184('0x27')]=function(_0x3dbdb7,_0x652273){var _0x202dd0={},_0x4b12d1={},_0x3e37e7={'count':0x0,'rows':[]};var _0x2f77c4=_['map'](db[_0xd184('0x28')][_0xd184('0x29')],function(_0xf9167e){return{'name':_0xf9167e[_0xd184('0x2a')],'type':_0xf9167e[_0xd184('0x2b')][_0xd184('0x2c')]};});_0x4b12d1[_0xd184('0x2d')]=_[_0xd184('0x2e')](_0x2f77c4,_0xd184('0x25'));_0x4b12d1[_0xd184('0x2f')]=_[_0xd184('0x30')](_0x3dbdb7[_0xd184('0x2f')]);_0x4b12d1[_0xd184('0x31')]=_['intersection'](_0x4b12d1['model'],_0x4b12d1[_0xd184('0x2f')]);_0x202dd0[_0xd184('0x32')]=_[_0xd184('0x33')](_0x4b12d1[_0xd184('0x2d')],qs[_0xd184('0x34')](_0x3dbdb7[_0xd184('0x2f')]['fields']));_0x202dd0[_0xd184('0x32')]=_0x202dd0['attributes'][_0xd184('0x35')]?_0x202dd0['attributes']:_0x4b12d1[_0xd184('0x2d')];if(!_0x3dbdb7[_0xd184('0x2f')]['hasOwnProperty'](_0xd184('0x36'))){_0x202dd0[_0xd184('0x1a')]=qs[_0xd184('0x1a')](_0x3dbdb7[_0xd184('0x2f')][_0xd184('0x1a')]);_0x202dd0[_0xd184('0x18')]=qs['offset'](_0x3dbdb7['query'][_0xd184('0x18')]);}_0x202dd0[_0xd184('0x37')]=qs['sort'](_0x3dbdb7[_0xd184('0x2f')][_0xd184('0x38')]);_0x202dd0[_0xd184('0x39')]=qs[_0xd184('0x31')](_['pick'](_0x3dbdb7[_0xd184('0x2f')],_0x4b12d1[_0xd184('0x31')]),_0x2f77c4);if(_0x3dbdb7['query'][_0xd184('0x3a')]){_0x202dd0['where']=_[_0xd184('0x3b')](_0x202dd0[_0xd184('0x39')],{'$or':_['map'](_0x2f77c4,function(_0x1508d9){if(_0x1508d9[_0xd184('0x2b')]!==_0xd184('0x3c')){var _0x3aae38={};_0x3aae38[_0x1508d9['name']]={'$like':'%'+_0x3dbdb7[_0xd184('0x2f')]['filter']+'%'};return _0x3aae38;}})});}_0x202dd0=_[_0xd184('0x3b')]({},_0x202dd0,_0x3dbdb7['options']);var _0x165f5b={'where':_0x202dd0[_0xd184('0x39')]};return db[_0xd184('0x28')][_0xd184('0x1b')](_0x165f5b)[_0xd184('0x21')](function(_0x1e7afa){_0x3e37e7['count']=_0x1e7afa;if(_0x3dbdb7[_0xd184('0x2f')][_0xd184('0x3d')]){_0x202dd0[_0xd184('0x3e')]=[{'all':!![]}];}return db[_0xd184('0x28')]['findAll'](_0x202dd0);})[_0xd184('0x21')](function(_0x52839b){_0x3e37e7[_0xd184('0x3f')]=_0x52839b;return _0x3e37e7;})[_0xd184('0x21')](respondWithFilteredResult(_0x652273,_0x202dd0))[_0xd184('0x40')](handleError(_0x652273,null));};exports[_0xd184('0x41')]=function(_0x11cbe,_0x15f8fc){var _0x394004={'raw':![],'where':{'id':_0x11cbe['params']['id']}},_0x75d871={};_0x75d871[_0xd184('0x2d')]=_[_0xd184('0x30')](db[_0xd184('0x28')][_0xd184('0x29')]);_0x75d871['query']=_[_0xd184('0x30')](_0x11cbe['query']);_0x75d871['filters']=_[_0xd184('0x33')](_0x75d871['model'],_0x75d871['query']);_0x394004[_0xd184('0x32')]=_[_0xd184('0x33')](_0x75d871[_0xd184('0x2d')],qs[_0xd184('0x34')](_0x11cbe[_0xd184('0x2f')][_0xd184('0x34')]));_0x394004[_0xd184('0x32')]=_0x394004[_0xd184('0x32')][_0xd184('0x35')]?_0x394004[_0xd184('0x32')]:_0x75d871[_0xd184('0x2d')];if(_0x11cbe['query'][_0xd184('0x3d')]){_0x394004[_0xd184('0x3e')]=[{'all':!![]}];}_0x394004=_['merge']({},_0x394004,_0x11cbe['options']);return db[_0xd184('0x28')][_0xd184('0x42')](_0x394004)[_0xd184('0x21')](handleEntityNotFound(_0x15f8fc,null))[_0xd184('0x21')](respondWithResult(_0x15f8fc,null))[_0xd184('0x40')](handleError(_0x15f8fc,null));};exports[_0xd184('0x43')]=function(_0x452fb7,_0x553929){return db['JscriptyProject'][_0xd184('0x43')](_0x452fb7[_0xd184('0x44')],{})[_0xd184('0x21')](function(_0x4b44f4){var _0x1b1ea0=_0x452fb7[_0xd184('0x45')][_0xd184('0x46')]({'plain':!![]});if(!_0x1b1ea0)throw new Error(_0xd184('0x47'));if(_0x1b1ea0[_0xd184('0x48')]===_0xd184('0x45')){var _0x53a103=_0x4b44f4['get']({'plain':!![]});var _0x157c06=_0xd184('0x22');return db['UserProfileSection'][_0xd184('0x42')]({'where':{'name':_0x157c06,'userProfileId':_0x1b1ea0['userProfileId']},'raw':!![]})[_0xd184('0x21')](function(_0x4651a9){if(_0x4651a9&&_0x4651a9[_0xd184('0x49')]===0x0){return db[_0xd184('0x23')]['create']({'name':_0x53a103['name'],'resourceId':_0x53a103['id'],'type':_0x4651a9[_0xd184('0x25')],'sectionId':_0x4651a9['id']},{})[_0xd184('0x21')](function(){return _0x4b44f4;});}else{return _0x4b44f4;}})[_0xd184('0x40')](function(_0x5778d5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5778d5);throw _0x5778d5;});}return _0x4b44f4;})[_0xd184('0x21')](respondWithResult(_0x553929,0xc9))[_0xd184('0x40')](handleError(_0x553929,null));};exports[_0xd184('0x4a')]=function(_0xb97b3,_0x2d89d5){var _0x5120da={'where':{'id':_0xb97b3[_0xd184('0x4b')]['id']}},_0x32f59c={};_0x32f59c['model']=_[_0xd184('0x30')](db[_0xd184('0x28')][_0xd184('0x29')]);_0x5120da[_0xd184('0x32')]=_[_0xd184('0x33')](_0x32f59c['model'],qs[_0xd184('0x34')](_0xb97b3[_0xd184('0x2f')][_0xd184('0x34')]));_0x5120da[_0xd184('0x32')]=_0x5120da[_0xd184('0x32')][_0xd184('0x35')]?_0x5120da['attributes']:_0x32f59c[_0xd184('0x2d')];if(_0xb97b3[_0xd184('0x2f')][_0xd184('0x3d')]){_0x5120da[_0xd184('0x3e')]=[{'all':!![]}];}_0x5120da=_[_0xd184('0x3b')]({},_0x5120da,_0xb97b3['options']);return db[_0xd184('0x28')]['find'](_0x5120da)['then'](handleEntityNotFound(_0x2d89d5,null))['then'](function(_0x10bbfb){if(_0x10bbfb){var _0x2e9036=_0x10bbfb[_0xd184('0x46')]({'plain':!![]});_0x2e9036=qs[_0xd184('0x4c')](_0x2e9036,['id',_0xd184('0x4d'),_0xd184('0x4e')]);_0xb97b3[_0xd184('0x44')]=_['omit'](_0xb97b3[_0xd184('0x44')],['id',_0xd184('0x4d'),_0xd184('0x4e')]);return db['JscriptyProject'][_0xd184('0x43')](_[_0xd184('0x3b')](_0x2e9036,_0xb97b3[_0xd184('0x44')]),{'include':_0xb97b3[_0xd184('0x2f')][_0xd184('0x3d')]?[{'all':!![]}]:undefined})[_0xd184('0x21')](function(_0x58c43c){var _0xe569e=_0xb97b3[_0xd184('0x45')][_0xd184('0x46')]({'plain':!![]});if(!_0xe569e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe569e[_0xd184('0x48')]===_0xd184('0x45')){var _0x4ac2a5=_0x58c43c[_0xd184('0x46')]({'plain':!![]});var _0x22a1ef='Projects';return db[_0xd184('0x4f')][_0xd184('0x42')]({'where':{'name':_0x22a1ef,'userProfileId':_0xe569e['userProfileId']},'raw':!![]})[_0xd184('0x21')](function(_0x3aeefb){if(_0x3aeefb&&_0x3aeefb[_0xd184('0x49')]===0x0){return db[_0xd184('0x23')][_0xd184('0x43')]({'name':_0x4ac2a5['name'],'resourceId':_0x4ac2a5['id'],'type':_0x3aeefb[_0xd184('0x25')],'sectionId':_0x3aeefb['id']},{})[_0xd184('0x21')](function(){return _0x58c43c;});}else{return _0x58c43c;}})['catch'](function(_0x4c8da6){logger['error'](_0xd184('0x50'),_0x4c8da6);throw _0x4c8da6;});}return _0x58c43c;});}})['then'](respondWithResult(_0x2d89d5,0xc9))[_0xd184('0x40')](handleError(_0x2d89d5,null));};exports[_0xd184('0x20')]=function(_0x5bafb9,_0x4dedf6){if(_0x5bafb9[_0xd184('0x44')]['id']){delete _0x5bafb9[_0xd184('0x44')]['id'];}return db['JscriptyProject'][_0xd184('0x42')]({'where':{'id':_0x5bafb9[_0xd184('0x4b')]['id']}})[_0xd184('0x21')](handleEntityNotFound(_0x4dedf6,null))[_0xd184('0x21')](saveUpdates(_0x5bafb9['body'],null))['then'](respondWithResult(_0x4dedf6,null))['catch'](handleError(_0x4dedf6,null));};exports['destroy']=function(_0x3916f4,_0x596e03){return db[_0xd184('0x28')][_0xd184('0x42')]({'where':{'id':_0x3916f4[_0xd184('0x4b')]['id']}})[_0xd184('0x21')](handleEntityNotFound(_0x596e03,null))[_0xd184('0x21')](removeEntity(_0x596e03,null))[_0xd184('0x40')](handleError(_0x596e03,null));};exports[_0xd184('0x51')]=function(_0x5f1c62,_0x2b29b9,_0x36d131){var _0x165206={'raw':!![],'where':{}};var _0x17d2e7={};var _0x46bccf={'count':0x0,'rows':[]};return db[_0xd184('0x28')][_0xd184('0x52')]({'where':{'id':_0x5f1c62['params']['id']}})[_0xd184('0x21')](handleEntityNotFound(_0x2b29b9,null))['then'](function(_0x477553){if(_0x477553){_0x17d2e7[_0xd184('0x2d')]=_[_0xd184('0x30')](db[_0xd184('0x53')][_0xd184('0x29')]);_0x17d2e7[_0xd184('0x2f')]=_[_0xd184('0x30')](_0x5f1c62[_0xd184('0x2f')]);_0x17d2e7['filters']=_[_0xd184('0x33')](_0x17d2e7[_0xd184('0x2d')],_0x17d2e7[_0xd184('0x2f')]);_0x165206['attributes']=_['intersection'](_0x17d2e7['model'],qs[_0xd184('0x34')](_0x5f1c62[_0xd184('0x2f')][_0xd184('0x34')]));_0x165206[_0xd184('0x32')]=_0x165206[_0xd184('0x32')][_0xd184('0x35')]?_0x165206['attributes']:_0x17d2e7[_0xd184('0x2d')];if(!_0x5f1c62[_0xd184('0x2f')][_0xd184('0x54')](_0xd184('0x36'))){_0x165206[_0xd184('0x1a')]=qs[_0xd184('0x1a')](_0x5f1c62[_0xd184('0x2f')][_0xd184('0x1a')]);_0x165206['offset']=qs[_0xd184('0x18')](_0x5f1c62[_0xd184('0x2f')]['offset']);}_0x165206[_0xd184('0x37')]=qs[_0xd184('0x38')](_0x5f1c62[_0xd184('0x2f')][_0xd184('0x38')]);_0x165206[_0xd184('0x39')]=qs['filters'](_['pick'](_0x5f1c62[_0xd184('0x2f')],_0x17d2e7[_0xd184('0x31')]));_0x165206[_0xd184('0x39')][_0xd184('0x55')]=_0x477553['id'];if(_0x5f1c62[_0xd184('0x2f')][_0xd184('0x3a')]){_0x165206[_0xd184('0x39')]=_[_0xd184('0x3b')](_0x165206['where'],{'$or':_[_0xd184('0x2e')](_0x165206['attributes'],function(_0x71149e){var _0x918e6f={};_0x918e6f[_0x71149e]={'$like':'%'+_0x5f1c62[_0xd184('0x2f')]['filter']+'%'};return _0x918e6f;})});}_0x165206=_[_0xd184('0x3b')]({},_0x165206,_0x5f1c62[_0xd184('0x56')]);return db[_0xd184('0x53')][_0xd184('0x1b')]({'where':_0x165206[_0xd184('0x39')]})[_0xd184('0x21')](function(_0x4d076d){_0x46bccf[_0xd184('0x1b')]=_0x4d076d;if(_0x5f1c62[_0xd184('0x2f')][_0xd184('0x3d')]){_0x165206['include']=[{'all':!![]}];}return db[_0xd184('0x53')][_0xd184('0x57')](_0x165206);})[_0xd184('0x21')](function(_0x253b7b){_0x46bccf[_0xd184('0x3f')]=_0x253b7b;return _0x46bccf;});}})[_0xd184('0x21')](respondWithFilteredResult(_0x2b29b9,_0x165206))['catch'](handleError(_0x2b29b9,null));};exports[_0xd184('0x58')]=function(_0x498866,_0x29e0fb,_0x15ea6b){var _0x13c1c2={'raw':!![],'where':{}};var _0x10aef3={};var _0x499546={'count':0x0,'rows':[]};return db[_0xd184('0x28')][_0xd184('0x52')]({'where':{'id':_0x498866[_0xd184('0x4b')]['id']}})[_0xd184('0x21')](handleEntityNotFound(_0x29e0fb,null))[_0xd184('0x21')](function(_0x289e71){if(_0x289e71){_0x10aef3[_0xd184('0x2d')]=_[_0xd184('0x30')](db[_0xd184('0x59')][_0xd184('0x29')]);_0x10aef3[_0xd184('0x2f')]=_[_0xd184('0x30')](_0x498866['query']);_0x10aef3['filters']=_[_0xd184('0x33')](_0x10aef3[_0xd184('0x2d')],_0x10aef3[_0xd184('0x2f')]);_0x13c1c2[_0xd184('0x32')]=_[_0xd184('0x33')](_0x10aef3[_0xd184('0x2d')],qs[_0xd184('0x34')](_0x498866['query'][_0xd184('0x34')]));_0x13c1c2[_0xd184('0x32')]=_0x13c1c2['attributes'][_0xd184('0x35')]?_0x13c1c2[_0xd184('0x32')]:_0x10aef3[_0xd184('0x2d')];if(!_0x498866[_0xd184('0x2f')]['hasOwnProperty'](_0xd184('0x36'))){_0x13c1c2[_0xd184('0x1a')]=qs['limit'](_0x498866[_0xd184('0x2f')]['limit']);_0x13c1c2[_0xd184('0x18')]=qs[_0xd184('0x18')](_0x498866[_0xd184('0x2f')]['offset']);}_0x13c1c2['order']=qs[_0xd184('0x38')](_0x498866[_0xd184('0x2f')][_0xd184('0x38')]);_0x13c1c2[_0xd184('0x39')]=qs[_0xd184('0x31')](_['pick'](_0x498866[_0xd184('0x2f')],_0x10aef3[_0xd184('0x31')]));_0x13c1c2[_0xd184('0x39')][_0xd184('0x55')]=_0x289e71['id'];if(_0x498866['query']['filter']){_0x13c1c2[_0xd184('0x39')]=_[_0xd184('0x3b')](_0x13c1c2[_0xd184('0x39')],{'$or':_['map'](_0x13c1c2[_0xd184('0x32')],function(_0x4d276a){var _0xe6118e={};_0xe6118e[_0x4d276a]={'$like':'%'+_0x498866[_0xd184('0x2f')][_0xd184('0x3a')]+'%'};return _0xe6118e;})});}_0x13c1c2=_[_0xd184('0x3b')]({},_0x13c1c2,_0x498866[_0xd184('0x56')]);return db[_0xd184('0x59')]['count']({'where':_0x13c1c2[_0xd184('0x39')]})[_0xd184('0x21')](function(_0x466c3c){_0x499546[_0xd184('0x1b')]=_0x466c3c;if(_0x498866[_0xd184('0x2f')][_0xd184('0x3d')]){_0x13c1c2['include']=[{'all':!![]}];}return db[_0xd184('0x59')][_0xd184('0x57')](_0x13c1c2);})[_0xd184('0x21')](function(_0x425190){_0x499546[_0xd184('0x3f')]=_0x425190;return _0x499546;});}})[_0xd184('0x21')](respondWithFilteredResult(_0x29e0fb,_0x13c1c2))[_0xd184('0x40')](handleError(_0x29e0fb,null));};function char(_0x407617){return _0xd184('0x5a')===typeof _0x407617?String[_0xd184('0x5b')][_0xd184('0x1e')](null,arguments):_0x407617;}function needsEncapsulation(_0x3c0c23){return!!_0x3c0c23&&(_0x3c0c23[_0xd184('0x5c')]()[_0xd184('0x5d')](char(0xd))>=0x0||_0x3c0c23[_0xd184('0x5c')]()[_0xd184('0x5d')](char(0xa))>=0x0||_0x3c0c23[_0xd184('0x5c')]()[_0xd184('0x5d')](char(0x2c))>=0x0||_0x3c0c23[_0xd184('0x5c')]()[_0xd184('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x1c842f){var _0x589b5b=char(0x22),_0x39e09e='\x5c'+char(0x22),_0x27a697=_0x1c842f['toString']()[_0xd184('0x5e')](new RegExp(_0x589b5b,'g'),_0x39e09e);return _0x589b5b+_0x27a697+_0x589b5b;}exports['getSummary']=function(_0x4d258e,_0x5e6452,_0x5977ba){var _0x15fcd5,_0x491cf9;var _0x18569e={'where':{'ProjectId':_0x4d258e[_0xd184('0x4b')]['id']}};if(_0x4d258e[_0xd184('0x2f')]['startTime']){_0x18569e[_0xd184('0x39')][_0xd184('0x5f')]=JSON['parse'](_0x4d258e['query'][_0xd184('0x60')]);}return db[_0xd184('0x53')][_0xd184('0x57')](_0x18569e)['then'](handleEntityNotFound(_0x5e6452,null))[_0xd184('0x21')](function(_0x3a42d4){if(_0x3a42d4){_0x15fcd5=_0x3a42d4;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_['map'](_0x15fcd5,'id')},'ProjectId':_0x4d258e['params']['id']},'order':_0xd184('0x61')});}})[_0xd184('0x21')](handleEntityNotFound(_0x5e6452,null))[_0xd184('0x21')](function(_0x386b28){if(_0x386b28){_0x491cf9=_0x386b28;var _0x3b5831={};for(var _0xe1f8be=0x0,_0x42097c=_0x491cf9[_0xd184('0x35')];_0xe1f8be<_0x42097c;_0xe1f8be++){if(!_0x3b5831[_0xd184('0x54')](_0x491cf9[_0xe1f8be][_0xd184('0x62')])){_0x3b5831[_0x491cf9[_0xe1f8be][_0xd184('0x62')]]=needsEncapsulation(_0x491cf9[_0xe1f8be][_0xd184('0x63')])?encapsulate(_0x491cf9[_0xe1f8be][_0xd184('0x63')]):_0x491cf9[_0xe1f8be][_0xd184('0x63')];}}var _0x37c9a8=[],_0x5521a4={};for(var _0xe7a5c7=0x0,_0x33a28b=_0x15fcd5[_0xd184('0x35')];_0xe7a5c7<_0x33a28b;_0xe7a5c7++){_0x5521a4={'ProjectId':_0x4d258e[_0xd184('0x4b')]['id'],'SessionId':_0x15fcd5[_0xe7a5c7]['id'],'StartTime':moment(_0x15fcd5[_0xe7a5c7][_0xd184('0x5f')])[_0xd184('0x64')](_0xd184('0x65'))};for(var _0xfafafe=0x0,_0x3d80c1=_0x491cf9[_0xd184('0x35')];_0xfafafe<_0x3d80c1;_0xfafafe++){if(_0x491cf9[_0xfafafe][_0xd184('0x66')]==_0x15fcd5[_0xe7a5c7]['id']&&_0x3b5831['hasOwnProperty'](_0x491cf9[_0xfafafe][_0xd184('0x62')])){_0x5521a4[_0x3b5831[_0x491cf9[_0xfafafe][_0xd184('0x62')]]]=_0x491cf9[_0xfafafe]['answer'];}}for(var _0xdb85d5 in _0x3b5831){if(!_0x5521a4[_0xd184('0x54')](_0x3b5831[_0xdb85d5])){_0x5521a4[_0x3b5831[_0xdb85d5]]=null;}}_0x37c9a8[_0xd184('0x67')](_0x5521a4);}return _0x37c9a8;}})['then'](function(_0x3b826c){if(!_[_0xd184('0x68')](_0x3b826c)){var _0xd33e6=toCsv(_0x3b826c);var _0x3414be=Date[_0xd184('0x69')]();fs[_0xd184('0x6a')](util['format'](_0xd184('0x6b'),_0x4d258e[_0xd184('0x4b')]['id'],_0x3414be),_0xd33e6);_0x5e6452['setHeader'](_0xd184('0x6c'),'attachment;\x20filename='+util[_0xd184('0x64')](_0xd184('0x6d'),_0x4d258e['params']['id'],_0x3414be));_0x5e6452[_0xd184('0x6e')]('Content-type',_0xd184('0x6f'));return _0x5e6452[_0xd184('0x70')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4d258e['params']['id'],_0x3414be));}else{return _0x5e6452[_0xd184('0x14')](0xcc);}})[_0xd184('0x40')](handleError(_0x5e6452,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e95db23..48e2ec8 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 _0x4fd7=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','jscripty_projects'];(function(_0x5a425d,_0x135dec){var _0x41b787=function(_0x53bab6){while(--_0x53bab6){_0x5a425d['push'](_0x5a425d['shift']());}};_0x41b787(++_0x135dec);}(_0x4fd7,0xe6));var _0x74fd=function(_0x36c286,_0x4cf7e9){_0x36c286=_0x36c286-0x0;var _0x3b1408=_0x4fd7[_0x36c286];return _0x3b1408;};'use strict';var _=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var logger=require(_0x74fd('0x2'))(_0x74fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74fd('0x4'));var fs=require('fs');var path=require(_0x74fd('0x5'));var rimraf=require('rimraf');var config=require(_0x74fd('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x74fd('0x7')]=function(_0x480ec2,_0x1959e1){return _0x480ec2[_0x74fd('0x8')]('JscriptyProject',attributes,{'tableName':_0x74fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f29=['jscripty_projects','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x5564b0,_0x3cfc26){var _0x1831dc=function(_0xf8e40e){while(--_0xf8e40e){_0x5564b0['push'](_0x5564b0['shift']());}};_0x1831dc(++_0x3cfc26);}(_0x4f29,0xfd));var _0x94f2=function(_0x2602bc,_0x5cd21b){_0x2602bc=_0x2602bc-0x0;var _0x1a4594=_0x4f29[_0x2602bc];return _0x1a4594;};'use strict';var _=require('lodash');var util=require(_0x94f2('0x0'));var logger=require(_0x94f2('0x1'))(_0x94f2('0x2'));var moment=require(_0x94f2('0x3'));var BPromise=require(_0x94f2('0x4'));var rp=require(_0x94f2('0x5'));var fs=require('fs');var path=require(_0x94f2('0x6'));var rimraf=require(_0x94f2('0x7'));var config=require(_0x94f2('0x8'));var attributes=require(_0x94f2('0x9'));module[_0x94f2('0xa')]=function(_0x493302,_0x5e9216){return _0x493302[_0x94f2('0xb')](_0x94f2('0xc'),attributes,{'tableName':_0x94f2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index ba18d9b..ae3efb0 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 _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac4a,0x13f));var _0xaac4=function(_0x48560f,_0xe31371){_0x48560f=_0x48560f-0x0;var _0x23eda3=_0xac4a[_0x48560f];return _0x23eda3;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x112839,_0x1191b0){var _0x39de5b=function(_0x172b4a){while(--_0x172b4a){_0x112839['push'](_0x112839['shift']());}};_0x39de5b(++_0x1191b0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 4b5904d..43b2fee 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 _0x415b=['fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x16ee21,_0x2b9d60){var _0x1ae6fd=function(_0x1526df){while(--_0x1526df){_0x16ee21['push'](_0x16ee21['shift']());}};_0x1ae6fd(++_0x2b9d60);}(_0x415b,0x15c));var _0xb415=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x415b[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xb415('0x0'));var util=require('util');var path=require(_0xb415('0x1'));var timeout=require('connect-timeout');var express=require(_0xb415('0x2'));var router=express[_0xb415('0x3')]();var fs_extra=require(_0xb415('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb415('0x5'));var config=require(_0xb415('0x6'));var controller=require(_0xb415('0x7'));router['get']('/',auth[_0xb415('0x8')](),controller[_0xb415('0x9')]);router[_0xb415('0xa')](_0xb415('0xb'),auth[_0xb415('0x8')](),controller[_0xb415('0xc')]);router['get'](_0xb415('0xd'),auth[_0xb415('0x8')](),controller[_0xb415('0xe')]);router[_0xb415('0xf')]('/',auth['isAuthenticated'](),controller[_0xb415('0x10')]);router[_0xb415('0x11')]('/:id',auth[_0xb415('0x8')](),controller[_0xb415('0x12')]);router[_0xb415('0x13')](_0xb415('0xd'),auth[_0xb415('0x8')](),controller[_0xb415('0x14')]);module[_0xb415('0x15')]=router; \ No newline at end of file +var _0x61b9=['/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index'];(function(_0xc67084,_0x3e2efc){var _0x4d06c6=function(_0x2eb951){while(--_0x2eb951){_0xc67084['push'](_0xc67084['shift']());}};_0x4d06c6(++_0x3e2efc);}(_0x61b9,0x107));var _0x961b=function(_0x44e00a,_0x248bbc){_0x44e00a=_0x44e00a-0x0;var _0x2bdfba=_0x61b9[_0x44e00a];return _0x2bdfba;};'use strict';var multer=require(_0x961b('0x0'));var util=require(_0x961b('0x1'));var path=require(_0x961b('0x2'));var timeout=require(_0x961b('0x3'));var express=require(_0x961b('0x4'));var router=express[_0x961b('0x5')]();var fs_extra=require(_0x961b('0x6'));var auth=require(_0x961b('0x7'));var interaction=require(_0x961b('0x8'));var config=require(_0x961b('0x9'));var controller=require(_0x961b('0xa'));router['get']('/',auth[_0x961b('0xb')](),controller[_0x961b('0xc')]);router['get'](_0x961b('0xd'),auth[_0x961b('0xb')](),controller[_0x961b('0xe')]);router['get'](_0x961b('0xf'),auth[_0x961b('0xb')](),controller[_0x961b('0x10')]);router[_0x961b('0x11')]('/',auth['isAuthenticated'](),controller[_0x961b('0x12')]);router[_0x961b('0x13')](_0x961b('0xf'),auth['isAuthenticated'](),controller[_0x961b('0x14')]);router['delete'](_0x961b('0xf'),auth[_0x961b('0xb')](),controller[_0x961b('0x15')]);module[_0x961b('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 1c5316e..022f968 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0xa1f4df,_0x3b8ead){_0xa1f4df=_0xa1f4df-0x0;var _0x1b1533=_0x7a54[_0xa1f4df];return _0x1b1533;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x1514dc,_0x3695e5){_0x1514dc=_0x1514dc-0x0;var _0x38ac26=_0x7a54[_0x1514dc];return _0x38ac26;};'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 47a9f12..165488a 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 _0x49eb=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','include','find','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x2909b4,_0x1ad87f){var _0x47e4fa=function(_0x200acf){while(--_0x200acf){_0x2909b4['push'](_0x2909b4['shift']());}};_0x47e4fa(++_0x1ad87f);}(_0x49eb,0x12d));var _0xb49e=function(_0x5cce5a,_0x298d54){_0x5cce5a=_0x5cce5a-0x0;var _0x354e33=_0x49eb[_0x5cce5a];return _0x354e33;};'use strict';var emlformat=require(_0xb49e('0x0'));var rimraf=require(_0xb49e('0x1'));var zipdir=require(_0xb49e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb49e('0x3'));var moment=require(_0xb49e('0x4'));var BPromise=require(_0xb49e('0x5'));var Mustache=require(_0xb49e('0x6'));var util=require(_0xb49e('0x7'));var path=require(_0xb49e('0x8'));var sox=require(_0xb49e('0x9'));var csv=require(_0xb49e('0xa'));var ejs=require(_0xb49e('0xb'));var fs=require('fs');var fs_extra=require(_0xb49e('0xc'));var _=require(_0xb49e('0xd'));var squel=require('squel');var crypto=require(_0xb49e('0xe'));var jsforce=require(_0xb49e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb49e('0x10'));var authService=require(_0xb49e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb49e('0x12'));var hardwareService=require(_0xb49e('0x13'));var logger=require(_0xb49e('0x14'))(_0xb49e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb49e('0x16'));var db=require(_0xb49e('0x17'))['db'];function respondWithStatusCode(_0x30f180,_0x3f5dd5){_0x3f5dd5=_0x3f5dd5||0xcc;return function(_0x5cbeac){if(_0x5cbeac){return _0x30f180[_0xb49e('0x18')](_0x3f5dd5);}return _0x30f180['status'](_0x3f5dd5)[_0xb49e('0x19')]();};}function respondWithResult(_0x3c5718,_0x3783a4){_0x3783a4=_0x3783a4||0xc8;return function(_0x314395){if(_0x314395){return _0x3c5718[_0xb49e('0x1a')](_0x3783a4)[_0xb49e('0x1b')](_0x314395);}};}function respondWithFilteredResult(_0x992ea0,_0x2fb0bd){return function(_0x6c6b32){if(_0x6c6b32){var _0x174fc5=typeof _0x2fb0bd[_0xb49e('0x1c')]==='undefined'&&typeof _0x2fb0bd[_0xb49e('0x1d')]===_0xb49e('0x1e');var _0x52cf75=_0x6c6b32['count'];var _0x412f88=_0x174fc5?0x0:_0x2fb0bd['offset'];var _0x154808=_0x174fc5?_0x6c6b32[_0xb49e('0x1f')]:_0x2fb0bd['offset']+_0x2fb0bd['limit'];var _0x32e03c;if(_0x154808>=_0x52cf75){_0x154808=_0x52cf75;_0x32e03c=0xc8;}else{_0x32e03c=0xce;}_0x992ea0['status'](_0x32e03c);return _0x992ea0[_0xb49e('0x20')](_0xb49e('0x21'),_0x412f88+'-'+_0x154808+'/'+_0x52cf75)[_0xb49e('0x1b')](_0x6c6b32);}return null;};}function patchUpdates(_0x3518cb){return function(_0x2a4cc8){try{jsonpatch[_0xb49e('0x22')](_0x2a4cc8,_0x3518cb,!![]);}catch(_0x1b09b1){return BPromise['reject'](_0x1b09b1);}return _0x2a4cc8[_0xb49e('0x23')]();};}function saveUpdates(_0x480268,_0x4c9611){return function(_0x37c6f3){if(_0x37c6f3){return _0x37c6f3[_0xb49e('0x24')](_0x480268)[_0xb49e('0x25')](function(_0x429d77){return _0x429d77;});}return null;};}function removeEntity(_0x4cee7c,_0x18224d){return function(_0x30b66e){if(_0x30b66e){return _0x30b66e[_0xb49e('0x26')]()[_0xb49e('0x25')](function(){_0x4cee7c['status'](0xcc)[_0xb49e('0x19')]();});}};}function handleEntityNotFound(_0x397601,_0x33f062){return function(_0x1b9edd){if(!_0x1b9edd){_0x397601[_0xb49e('0x18')](0x194);}return _0x1b9edd;};}function handleError(_0x1d294a,_0x38e3e4){_0x38e3e4=_0x38e3e4||0x1f4;return function(_0x2cde41){logger[_0xb49e('0x27')](_0x2cde41[_0xb49e('0x28')]);if(_0x2cde41[_0xb49e('0x29')]){delete _0x2cde41['name'];}_0x1d294a[_0xb49e('0x1a')](_0x38e3e4)[_0xb49e('0x2a')](_0x2cde41);};}exports[_0xb49e('0x2b')]=function(_0x9a7c35,_0x203251){var _0x45ad67={},_0x41349b={},_0x1f44dc={'count':0x0,'rows':[]};var _0x1a3763=_[_0xb49e('0x2c')](db[_0xb49e('0x2d')][_0xb49e('0x2e')],function(_0x5c32e9){return{'name':_0x5c32e9['fieldName'],'type':_0x5c32e9[_0xb49e('0x2f')][_0xb49e('0x30')]};});_0x41349b[_0xb49e('0x31')]=_[_0xb49e('0x2c')](_0x1a3763,'name');_0x41349b[_0xb49e('0x32')]=_[_0xb49e('0x33')](_0x9a7c35[_0xb49e('0x32')]);_0x41349b[_0xb49e('0x34')]=_[_0xb49e('0x35')](_0x41349b['model'],_0x41349b[_0xb49e('0x32')]);_0x45ad67[_0xb49e('0x36')]=_[_0xb49e('0x35')](_0x41349b[_0xb49e('0x31')],qs[_0xb49e('0x37')](_0x9a7c35[_0xb49e('0x32')]['fields']));_0x45ad67[_0xb49e('0x36')]=_0x45ad67[_0xb49e('0x36')][_0xb49e('0x38')]?_0x45ad67['attributes']:_0x41349b[_0xb49e('0x31')];if(!_0x9a7c35[_0xb49e('0x32')][_0xb49e('0x39')](_0xb49e('0x3a'))){_0x45ad67['limit']=qs['limit'](_0x9a7c35[_0xb49e('0x32')][_0xb49e('0x1d')]);_0x45ad67[_0xb49e('0x1c')]=qs[_0xb49e('0x1c')](_0x9a7c35['query'][_0xb49e('0x1c')]);}_0x45ad67[_0xb49e('0x3b')]=qs[_0xb49e('0x3c')](_0x9a7c35[_0xb49e('0x32')]['sort']);_0x45ad67[_0xb49e('0x3d')]=qs[_0xb49e('0x34')](_[_0xb49e('0x3e')](_0x9a7c35[_0xb49e('0x32')],_0x41349b['filters']),_0x1a3763);if(_0x9a7c35['query'][_0xb49e('0x3f')]){_0x45ad67[_0xb49e('0x3d')]=_[_0xb49e('0x40')](_0x45ad67[_0xb49e('0x3d')],{'$or':_[_0xb49e('0x2c')](_0x1a3763,function(_0x4859c6){if(_0x4859c6[_0xb49e('0x2f')]!==_0xb49e('0x41')){var _0x14f809={};_0x14f809[_0x4859c6[_0xb49e('0x29')]]={'$like':'%'+_0x9a7c35['query'][_0xb49e('0x3f')]+'%'};return _0x14f809;}})});}_0x45ad67=_['merge']({},_0x45ad67,_0x9a7c35[_0xb49e('0x42')]);var _0x423662={'where':_0x45ad67[_0xb49e('0x3d')]};return db[_0xb49e('0x2d')][_0xb49e('0x1f')](_0x423662)[_0xb49e('0x25')](function(_0xf4bec6){_0x1f44dc[_0xb49e('0x1f')]=_0xf4bec6;if(_0x9a7c35[_0xb49e('0x32')]['includeAll']){_0x45ad67['include']=[{'all':!![]}];}return db[_0xb49e('0x2d')][_0xb49e('0x43')](_0x45ad67);})['then'](function(_0x1d9645){_0x1f44dc[_0xb49e('0x44')]=_0x1d9645;return _0x1f44dc;})['then'](respondWithFilteredResult(_0x203251,_0x45ad67))[_0xb49e('0x45')](handleError(_0x203251,null));};exports['show']=function(_0xebbdb7,_0x36133f){var _0x1d31e2={'raw':!![],'where':{'id':_0xebbdb7[_0xb49e('0x46')]['id']}},_0xe7275d={};_0xe7275d[_0xb49e('0x31')]=_[_0xb49e('0x33')](db['JscriptyQuestionReport']['rawAttributes']);_0xe7275d[_0xb49e('0x32')]=_[_0xb49e('0x33')](_0xebbdb7['query']);_0xe7275d[_0xb49e('0x34')]=_[_0xb49e('0x35')](_0xe7275d[_0xb49e('0x31')],_0xe7275d[_0xb49e('0x32')]);_0x1d31e2[_0xb49e('0x36')]=_[_0xb49e('0x35')](_0xe7275d[_0xb49e('0x31')],qs['fields'](_0xebbdb7[_0xb49e('0x32')][_0xb49e('0x37')]));_0x1d31e2[_0xb49e('0x36')]=_0x1d31e2['attributes']['length']?_0x1d31e2[_0xb49e('0x36')]:_0xe7275d['model'];if(_0xebbdb7[_0xb49e('0x32')]['includeAll']){_0x1d31e2[_0xb49e('0x47')]=[{'all':!![]}];}_0x1d31e2=_[_0xb49e('0x40')]({},_0x1d31e2,_0xebbdb7[_0xb49e('0x42')]);return db[_0xb49e('0x2d')][_0xb49e('0x48')](_0x1d31e2)['then'](handleEntityNotFound(_0x36133f,null))[_0xb49e('0x25')](respondWithResult(_0x36133f,null))['catch'](handleError(_0x36133f,null));};exports[_0xb49e('0x49')]=function(_0x126f93,_0x444268){return db[_0xb49e('0x2d')][_0xb49e('0x49')](_0x126f93[_0xb49e('0x4a')],{})[_0xb49e('0x25')](respondWithResult(_0x444268,0xc9))[_0xb49e('0x45')](handleError(_0x444268,null));};exports['update']=function(_0x291519,_0x156721){if(_0x291519[_0xb49e('0x4a')]['id']){delete _0x291519['body']['id'];}return db[_0xb49e('0x2d')][_0xb49e('0x48')]({'where':{'id':_0x291519['params']['id']}})['then'](handleEntityNotFound(_0x156721,null))[_0xb49e('0x25')](saveUpdates(_0x291519[_0xb49e('0x4a')],null))[_0xb49e('0x25')](respondWithResult(_0x156721,null))[_0xb49e('0x45')](handleError(_0x156721,null));};exports['destroy']=function(_0x153163,_0xa56c28){return db[_0xb49e('0x2d')][_0xb49e('0x48')]({'where':{'id':_0x153163[_0xb49e('0x46')]['id']}})[_0xb49e('0x25')](handleEntityNotFound(_0xa56c28,null))['then'](removeEntity(_0xa56c28,null))[_0xb49e('0x45')](handleError(_0xa56c28,null));};exports[_0xb49e('0x4b')]=function(_0x400d89,_0x351b00){return db[_0xb49e('0x2d')][_0xb49e('0x4b')]()[_0xb49e('0x25')](respondWithResult(_0x351b00,null))['catch'](handleError(_0x351b00,null));}; \ No newline at end of file +var _0xa84d=['rows','catch','show','params','keys','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','json','apply','save','update','then','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x18b826,_0x14e472){var _0x48605b=function(_0x35a69a){while(--_0x35a69a){_0x18b826['push'](_0x18b826['shift']());}};_0x48605b(++_0x14e472);}(_0xa84d,0xa0));var _0xda84=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa84d[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda84('0x0'));var zipdir=require(_0xda84('0x1'));var jsonpatch=require(_0xda84('0x2'));var rp=require(_0xda84('0x3'));var moment=require(_0xda84('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xda84('0x5'));var util=require(_0xda84('0x6'));var path=require(_0xda84('0x7'));var sox=require(_0xda84('0x8'));var csv=require('to-csv');var ejs=require(_0xda84('0x9'));var fs=require('fs');var fs_extra=require(_0xda84('0xa'));var _=require(_0xda84('0xb'));var squel=require(_0xda84('0xc'));var crypto=require(_0xda84('0xd'));var jsforce=require(_0xda84('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xda84('0xf'));var querystring=require(_0xda84('0x10'));var Papa=require(_0xda84('0x11'));var Redis=require(_0xda84('0x12'));var authService=require(_0xda84('0x13'));var qs=require(_0xda84('0x14'));var as=require(_0xda84('0x15'));var hardwareService=require(_0xda84('0x16'));var logger=require(_0xda84('0x17'))(_0xda84('0x18'));var utils=require(_0xda84('0x19'));var config=require(_0xda84('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xda84('0x1b'))['db'];function respondWithStatusCode(_0x1463a2,_0x266a9a){_0x266a9a=_0x266a9a||0xcc;return function(_0x53f00c){if(_0x53f00c){return _0x1463a2[_0xda84('0x1c')](_0x266a9a);}return _0x1463a2[_0xda84('0x1d')](_0x266a9a)['end']();};}function respondWithResult(_0x508c11,_0x4ab3ae){_0x4ab3ae=_0x4ab3ae||0xc8;return function(_0xf65b1b){if(_0xf65b1b){return _0x508c11[_0xda84('0x1d')](_0x4ab3ae)['json'](_0xf65b1b);}};}function respondWithFilteredResult(_0x17bd1b,_0x5c968f){return function(_0x774a9e){if(_0x774a9e){var _0x5d0b54=typeof _0x5c968f[_0xda84('0x1e')]==='undefined'&&typeof _0x5c968f[_0xda84('0x1f')]===_0xda84('0x20');var _0xbf0b69=_0x774a9e[_0xda84('0x21')];var _0x13196c=_0x5d0b54?0x0:_0x5c968f['offset'];var _0x6402d3=_0x5d0b54?_0x774a9e[_0xda84('0x21')]:_0x5c968f['offset']+_0x5c968f[_0xda84('0x1f')];var _0x2b0fe4;if(_0x6402d3>=_0xbf0b69){_0x6402d3=_0xbf0b69;_0x2b0fe4=0xc8;}else{_0x2b0fe4=0xce;}_0x17bd1b[_0xda84('0x1d')](_0x2b0fe4);return _0x17bd1b['set']('Content-Range',_0x13196c+'-'+_0x6402d3+'/'+_0xbf0b69)[_0xda84('0x22')](_0x774a9e);}return null;};}function patchUpdates(_0x367fb4){return function(_0xbb42fc){try{jsonpatch[_0xda84('0x23')](_0xbb42fc,_0x367fb4,!![]);}catch(_0x3a0aad){return BPromise['reject'](_0x3a0aad);}return _0xbb42fc[_0xda84('0x24')]();};}function saveUpdates(_0x1838e6,_0x4ef5a1){return function(_0xb41a2c){if(_0xb41a2c){return _0xb41a2c[_0xda84('0x25')](_0x1838e6)[_0xda84('0x26')](function(_0x542b9f){return _0x542b9f;});}return null;};}function removeEntity(_0x4c9a8b,_0x104bda){return function(_0x4a1234){if(_0x4a1234){return _0x4a1234['destroy']()[_0xda84('0x26')](function(){_0x4c9a8b[_0xda84('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x83022b,_0x3dcd37){return function(_0x27794a){if(!_0x27794a){_0x83022b[_0xda84('0x1c')](0x194);}return _0x27794a;};}function handleError(_0x51d9d9,_0x1f1960){_0x1f1960=_0x1f1960||0x1f4;return function(_0x1d0c25){logger['error'](_0x1d0c25[_0xda84('0x27')]);if(_0x1d0c25[_0xda84('0x28')]){delete _0x1d0c25[_0xda84('0x28')];}_0x51d9d9[_0xda84('0x1d')](_0x1f1960)[_0xda84('0x29')](_0x1d0c25);};}exports[_0xda84('0x2a')]=function(_0xa1954e,_0x5bd7ab){var _0x164aa7={},_0x4a4068={},_0x5d747b={'count':0x0,'rows':[]};var _0x44a94e=_[_0xda84('0x2b')](db[_0xda84('0x2c')]['rawAttributes'],function(_0xdd3db1){return{'name':_0xdd3db1[_0xda84('0x2d')],'type':_0xdd3db1[_0xda84('0x2e')][_0xda84('0x2f')]};});_0x4a4068[_0xda84('0x30')]=_['map'](_0x44a94e,_0xda84('0x28'));_0x4a4068['query']=_['keys'](_0xa1954e[_0xda84('0x31')]);_0x4a4068[_0xda84('0x32')]=_[_0xda84('0x33')](_0x4a4068['model'],_0x4a4068[_0xda84('0x31')]);_0x164aa7[_0xda84('0x34')]=_[_0xda84('0x33')](_0x4a4068[_0xda84('0x30')],qs[_0xda84('0x35')](_0xa1954e[_0xda84('0x31')][_0xda84('0x35')]));_0x164aa7['attributes']=_0x164aa7[_0xda84('0x34')][_0xda84('0x36')]?_0x164aa7[_0xda84('0x34')]:_0x4a4068[_0xda84('0x30')];if(!_0xa1954e[_0xda84('0x31')][_0xda84('0x37')](_0xda84('0x38'))){_0x164aa7[_0xda84('0x1f')]=qs[_0xda84('0x1f')](_0xa1954e[_0xda84('0x31')][_0xda84('0x1f')]);_0x164aa7['offset']=qs[_0xda84('0x1e')](_0xa1954e['query']['offset']);}_0x164aa7[_0xda84('0x39')]=qs[_0xda84('0x3a')](_0xa1954e[_0xda84('0x31')]['sort']);_0x164aa7[_0xda84('0x3b')]=qs[_0xda84('0x32')](_[_0xda84('0x3c')](_0xa1954e[_0xda84('0x31')],_0x4a4068[_0xda84('0x32')]),_0x44a94e);if(_0xa1954e[_0xda84('0x31')][_0xda84('0x3d')]){_0x164aa7['where']=_[_0xda84('0x3e')](_0x164aa7[_0xda84('0x3b')],{'$or':_['map'](_0x44a94e,function(_0x3811ef){if(_0x3811ef['type']!==_0xda84('0x3f')){var _0x25b4f7={};_0x25b4f7[_0x3811ef['name']]={'$like':'%'+_0xa1954e['query'][_0xda84('0x3d')]+'%'};return _0x25b4f7;}})});}_0x164aa7=_['merge']({},_0x164aa7,_0xa1954e[_0xda84('0x40')]);var _0x22b683={'where':_0x164aa7[_0xda84('0x3b')]};return db[_0xda84('0x2c')]['count'](_0x22b683)[_0xda84('0x26')](function(_0x378474){_0x5d747b['count']=_0x378474;if(_0xa1954e[_0xda84('0x31')][_0xda84('0x41')]){_0x164aa7[_0xda84('0x42')]=[{'all':!![]}];}return db[_0xda84('0x2c')][_0xda84('0x43')](_0x164aa7);})[_0xda84('0x26')](function(_0x1fe688){_0x5d747b[_0xda84('0x44')]=_0x1fe688;return _0x5d747b;})[_0xda84('0x26')](respondWithFilteredResult(_0x5bd7ab,_0x164aa7))[_0xda84('0x45')](handleError(_0x5bd7ab,null));};exports[_0xda84('0x46')]=function(_0x57c0a5,_0x54c0df){var _0xf47b7={'raw':!![],'where':{'id':_0x57c0a5[_0xda84('0x47')]['id']}},_0x606d62={};_0x606d62[_0xda84('0x30')]=_[_0xda84('0x48')](db['JscriptyQuestionReport']['rawAttributes']);_0x606d62['query']=_['keys'](_0x57c0a5[_0xda84('0x31')]);_0x606d62['filters']=_[_0xda84('0x33')](_0x606d62['model'],_0x606d62[_0xda84('0x31')]);_0xf47b7['attributes']=_[_0xda84('0x33')](_0x606d62[_0xda84('0x30')],qs[_0xda84('0x35')](_0x57c0a5[_0xda84('0x31')]['fields']));_0xf47b7[_0xda84('0x34')]=_0xf47b7[_0xda84('0x34')][_0xda84('0x36')]?_0xf47b7[_0xda84('0x34')]:_0x606d62[_0xda84('0x30')];if(_0x57c0a5[_0xda84('0x31')][_0xda84('0x41')]){_0xf47b7[_0xda84('0x42')]=[{'all':!![]}];}_0xf47b7=_[_0xda84('0x3e')]({},_0xf47b7,_0x57c0a5[_0xda84('0x40')]);return db[_0xda84('0x2c')]['find'](_0xf47b7)[_0xda84('0x26')](handleEntityNotFound(_0x54c0df,null))[_0xda84('0x26')](respondWithResult(_0x54c0df,null))[_0xda84('0x45')](handleError(_0x54c0df,null));};exports['create']=function(_0x2a51d2,_0x485d6e){return db[_0xda84('0x2c')]['create'](_0x2a51d2[_0xda84('0x49')],{})['then'](respondWithResult(_0x485d6e,0xc9))[_0xda84('0x45')](handleError(_0x485d6e,null));};exports[_0xda84('0x25')]=function(_0xeaac24,_0x1286fb){if(_0xeaac24['body']['id']){delete _0xeaac24[_0xda84('0x49')]['id'];}return db[_0xda84('0x2c')][_0xda84('0x4a')]({'where':{'id':_0xeaac24[_0xda84('0x47')]['id']}})[_0xda84('0x26')](handleEntityNotFound(_0x1286fb,null))['then'](saveUpdates(_0xeaac24[_0xda84('0x49')],null))['then'](respondWithResult(_0x1286fb,null))[_0xda84('0x45')](handleError(_0x1286fb,null));};exports[_0xda84('0x4b')]=function(_0x4bdb1a,_0x1e3bcf){return db[_0xda84('0x2c')][_0xda84('0x4a')]({'where':{'id':_0x4bdb1a[_0xda84('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e3bcf,null))[_0xda84('0x26')](removeEntity(_0x1e3bcf,null))[_0xda84('0x45')](handleError(_0x1e3bcf,null));};exports['describe']=function(_0x4b4a42,_0x4e6c1d){return db[_0xda84('0x2c')]['describe']()['then'](respondWithResult(_0x4e6c1d,null))['catch'](handleError(_0x4e6c1d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 2986e6d..d211db6 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 _0xd3c3=['moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd3c3,0x8c));var _0x3d3c=function(_0x510c08,_0x4aa014){_0x510c08=_0x510c08-0x0;var _0x52c95e=_0xd3c3[_0x510c08];return _0x52c95e;};'use strict';var _=require('lodash');var util=require(_0x3d3c('0x0'));var logger=require(_0x3d3c('0x1'))(_0x3d3c('0x2'));var moment=require(_0x3d3c('0x3'));var BPromise=require(_0x3d3c('0x4'));var rp=require(_0x3d3c('0x5'));var fs=require('fs');var path=require(_0x3d3c('0x6'));var rimraf=require('rimraf');var config=require(_0x3d3c('0x7'));var attributes=require(_0x3d3c('0x8'));module[_0x3d3c('0x9')]=function(_0x4511c4,_0x4d2b85){return _0x4511c4[_0x3d3c('0xa')](_0x3d3c('0xb'),attributes,{'tableName':_0x3d3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x659a=['exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','bluebird','path','../../config/environment'];(function(_0x57330b,_0x4cb518){var _0x3936c1=function(_0x4ec0f5){while(--_0x4ec0f5){_0x57330b['push'](_0x57330b['shift']());}};_0x3936c1(++_0x4cb518);}(_0x659a,0xee));var _0xa659=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x659a[_0x2f8530];return _0x5e814e;};'use strict';var _=require(_0xa659('0x0'));var util=require(_0xa659('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa659('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa659('0x3'));var rimraf=require('rimraf');var config=require(_0xa659('0x4'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xa659('0x5')]=function(_0x388e72,_0x21da11){return _0x388e72[_0xa659('0x6')](_0xa659('0x7'),attributes,{'tableName':_0xa659('0x8'),'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 470cb64..b81bedd 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 _0x942b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3ac09b,_0x5e89cd){var _0x3744a6=function(_0x9f735){while(--_0x9f735){_0x3ac09b['push'](_0x3ac09b['shift']());}};_0x3744a6(++_0x5e89cd);}(_0x942b,0x182));var _0xb942=function(_0x4edb97,_0x35b799){_0x4edb97=_0x4edb97-0x0;var _0x3c4940=_0x942b[_0x4edb97];return _0x3c4940;};'use strict';var _=require(_0xb942('0x0'));var util=require(_0xb942('0x1'));var moment=require(_0xb942('0x2'));var BPromise=require(_0xb942('0x3'));var rs=require(_0xb942('0x4'));var fs=require('fs');var Redis=require(_0xb942('0x5'));var db=require(_0xb942('0x6'))['db'];var utils=require(_0xb942('0x7'));var logger=require(_0xb942('0x8'))(_0xb942('0x9'));var config=require(_0xb942('0xa'));var jayson=require(_0xb942('0xb'));var client=jayson[_0xb942('0xc')][_0xb942('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2613cf,_0x438106,_0xdb6a9d){return new BPromise(function(_0x2ee30c,_0x7d5c0){return client[_0xb942('0xe')](_0x2613cf,_0xdb6a9d)['then'](function(_0x3a80b9){logger['info'](_0xb942('0xf'),_0x438106,_0xb942('0x10'));logger['debug'](_0xb942('0x11'),_0x438106,_0xb942('0x10'),JSON[_0xb942('0x12')](_0x3a80b9));if(_0x3a80b9['error']){if(_0x3a80b9[_0xb942('0x13')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x438106,_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);return _0x7d5c0(_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);}logger[_0xb942('0x13')](_0xb942('0xf'),_0x438106,_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);return _0x2ee30c(_0x3a80b9[_0xb942('0x13')][_0xb942('0x14')]);}else{logger['info'](_0xb942('0xf'),_0x438106,_0xb942('0x10'));_0x2ee30c(_0x3a80b9[_0xb942('0x15')]['message']);}})[_0xb942('0x16')](function(_0x4dcbd5){logger[_0xb942('0x13')](_0xb942('0xf'),_0x438106,_0x4dcbd5);_0x7d5c0(_0x4dcbd5);});});} \ No newline at end of file +var _0xa55e=['request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x33c537,_0x4c6b7a){var _0x5c7907=function(_0x9c8365){while(--_0x9c8365){_0x33c537['push'](_0x33c537['shift']());}};_0x5c7907(++_0x4c6b7a);}(_0xa55e,0x186));var _0xea55=function(_0x41bfc8,_0x564943){_0x41bfc8=_0x41bfc8-0x0;var _0x12e942=_0xa55e[_0x41bfc8];return _0x12e942;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea55('0x0'));var BPromise=require(_0xea55('0x1'));var rs=require(_0xea55('0x2'));var fs=require('fs');var Redis=require(_0xea55('0x3'));var db=require(_0xea55('0x4'))['db'];var utils=require(_0xea55('0x5'));var logger=require(_0xea55('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xea55('0x7')][_0xea55('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x591bf7,_0x16c568,_0x51e501){return new BPromise(function(_0x3169ec,_0xc4fa7d){return client[_0xea55('0x9')](_0x591bf7,_0x51e501)[_0xea55('0xa')](function(_0x407338){logger[_0xea55('0xb')](_0xea55('0xc'),_0x16c568,_0xea55('0xd'));logger['debug'](_0xea55('0xe'),_0x16c568,_0xea55('0xd'),JSON[_0xea55('0xf')](_0x407338));if(_0x407338[_0xea55('0x10')]){if(_0x407338['error'][_0xea55('0x11')]===0x1f4){logger['error'](_0xea55('0xc'),_0x16c568,_0x407338['error'][_0xea55('0x12')]);return _0xc4fa7d(_0x407338['error'][_0xea55('0x12')]);}logger[_0xea55('0x10')](_0xea55('0xc'),_0x16c568,_0x407338[_0xea55('0x10')][_0xea55('0x12')]);return _0x3169ec(_0x407338[_0xea55('0x10')]['message']);}else{logger[_0xea55('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16c568,'request\x20sent');_0x3169ec(_0x407338[_0xea55('0x13')][_0xea55('0x12')]);}})[_0xea55('0x14')](function(_0x35f222){logger[_0xea55('0x10')](_0xea55('0xc'),_0x16c568,_0x35f222);_0xc4fa7d(_0x35f222);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9e234fe..eb1aa70 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 _0x6963=['describe','get','/:id','show','/:id/questions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','/describe'];(function(_0x3f49f0,_0x38fd8c){var _0x37586f=function(_0x5c76c8){while(--_0x5c76c8){_0x3f49f0['push'](_0x3f49f0['shift']());}};_0x37586f(++_0x38fd8c);}(_0x6963,0xf1));var _0x3696=function(_0xeab08f,_0x4000f2){_0xeab08f=_0xeab08f-0x0;var _0x5b563e=_0x6963[_0xeab08f];return _0x5b563e;};'use strict';var multer=require(_0x3696('0x0'));var util=require(_0x3696('0x1'));var path=require(_0x3696('0x2'));var timeout=require(_0x3696('0x3'));var express=require(_0x3696('0x4'));var router=express[_0x3696('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3696('0x6'));var controller=require(_0x3696('0x7'));router['get']('/',auth[_0x3696('0x8')](),controller[_0x3696('0x9')]);router['get'](_0x3696('0xa'),auth[_0x3696('0x8')](),controller[_0x3696('0xb')]);router[_0x3696('0xc')](_0x3696('0xd'),auth[_0x3696('0x8')](),controller[_0x3696('0xe')]);router[_0x3696('0xc')](_0x3696('0xf'),auth[_0x3696('0x8')](),controller['getQuestions']);router['post']('/',auth['isAuthenticated'](),controller[_0x3696('0x10')]);router[_0x3696('0x11')](_0x3696('0xd'),auth['isAuthenticated'](),controller[_0x3696('0x12')]);router['delete'](_0x3696('0xd'),auth[_0x3696('0x8')](),controller[_0x3696('0x13')]);module[_0x3696('0x14')]=router; \ No newline at end of file +var _0xac48=['/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x184047,_0x5b5784){var _0x54e5e8=function(_0x1e58e1){while(--_0x1e58e1){_0x184047['push'](_0x184047['shift']());}};_0x54e5e8(++_0x5b5784);}(_0xac48,0x1c2));var _0x8ac4=function(_0x407938,_0x25da01){_0x407938=_0x407938-0x0;var _0x1a9596=_0xac48[_0x407938];return _0x1a9596;};'use strict';var multer=require(_0x8ac4('0x0'));var util=require(_0x8ac4('0x1'));var path=require(_0x8ac4('0x2'));var timeout=require('connect-timeout');var express=require(_0x8ac4('0x3'));var router=express[_0x8ac4('0x4')]();var fs_extra=require(_0x8ac4('0x5'));var auth=require(_0x8ac4('0x6'));var interaction=require(_0x8ac4('0x7'));var config=require(_0x8ac4('0x8'));var controller=require('./jscriptySessionReport.controller');router[_0x8ac4('0x9')]('/',auth[_0x8ac4('0xa')](),controller[_0x8ac4('0xb')]);router['get'](_0x8ac4('0xc'),auth[_0x8ac4('0xa')](),controller['describe']);router[_0x8ac4('0x9')](_0x8ac4('0xd'),auth['isAuthenticated'](),controller[_0x8ac4('0xe')]);router[_0x8ac4('0x9')]('/:id/questions',auth[_0x8ac4('0xa')](),controller['getQuestions']);router[_0x8ac4('0xf')]('/',auth[_0x8ac4('0xa')](),controller[_0x8ac4('0x10')]);router['put']('/:id',auth[_0x8ac4('0xa')](),controller[_0x8ac4('0x11')]);router[_0x8ac4('0x12')](_0x8ac4('0xd'),auth[_0x8ac4('0xa')](),controller[_0x8ac4('0x13')]);module[_0x8ac4('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d7d969e..60faaa8 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 _0xb4f2=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue'];(function(_0x167b08,_0xc4e643){var _0x53c9bb=function(_0x53792d){while(--_0x53792d){_0x167b08['push'](_0x167b08['shift']());}};_0x53c9bb(++_0xc4e643);}(_0xb4f2,0x196));var _0x2b4f=function(_0x3150a8,_0x5513aa){_0x3150a8=_0x3150a8-0x0;var _0x8e6005=_0xb4f2[_0x3150a8];return _0x8e6005;};'use strict';var moment=require(_0x2b4f('0x0'));var Sequelize=require('sequelize');module[_0x2b4f('0x1')]={'starttime':{'type':Sequelize[_0x2b4f('0x2')],'set':function(_0x281880){this[_0x2b4f('0x3')](_0x2b4f('0x4'),_0x281880);this[_0x2b4f('0x3')](_0x2b4f('0x5'),moment()[_0x2b4f('0x6')](_0x2b4f('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2b4f('0x8')]},'projectname':{'type':Sequelize[_0x2b4f('0x8')]},'queue':{'type':Sequelize[_0x2b4f('0x8')]},'uniqueid':{'type':Sequelize[_0x2b4f('0x8')]},'calleridname':{'type':Sequelize[_0x2b4f('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x2b4f('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xff54=['BOOLEAN','moment','sequelize','exports','DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xff54,0x1b9));var _0x4ff5=function(_0x29fb8a,_0x3c767f){_0x29fb8a=_0x29fb8a-0x0;var _0x484799=_0xff54[_0x29fb8a];return _0x484799;};'use strict';var moment=require(_0x4ff5('0x0'));var Sequelize=require(_0x4ff5('0x1'));module[_0x4ff5('0x2')]={'starttime':{'type':Sequelize[_0x4ff5('0x3')],'set':function(_0x4260fa){this['setDataValue'](_0x4ff5('0x4'),_0x4260fa);this[_0x4ff5('0x5')](_0x4ff5('0x6'),moment()[_0x4ff5('0x7')](_0x4ff5('0x8')));}},'endtime':{'type':Sequelize[_0x4ff5('0x3')]},'membername':{'type':Sequelize[_0x4ff5('0x9')]},'projectname':{'type':Sequelize[_0x4ff5('0x9')]},'queue':{'type':Sequelize[_0x4ff5('0x9')]},'uniqueid':{'type':Sequelize[_0x4ff5('0x9')]},'calleridname':{'type':Sequelize[_0x4ff5('0x9')]},'calleridnum':{'type':Sequelize[_0x4ff5('0x9')]},'completed':{'type':Sequelize[_0x4ff5('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index f9ede76..ae337f8 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 _0xed37=['undefined','limit','count','set','Content-Range','save','update','then','error','stack','send','index','JscriptySessionReport','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0xed37,0x14e));var _0x7ed3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xed37[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x7ed3('0x0'));var rimraf=require(_0x7ed3('0x1'));var zipdir=require(_0x7ed3('0x2'));var jsonpatch=require(_0x7ed3('0x3'));var rp=require(_0x7ed3('0x4'));var moment=require(_0x7ed3('0x5'));var BPromise=require(_0x7ed3('0x6'));var Mustache=require(_0x7ed3('0x7'));var util=require(_0x7ed3('0x8'));var path=require('path');var sox=require(_0x7ed3('0x9'));var csv=require('to-csv');var ejs=require(_0x7ed3('0xa'));var fs=require('fs');var fs_extra=require(_0x7ed3('0xb'));var _=require('lodash');var squel=require(_0x7ed3('0xc'));var crypto=require('crypto');var jsforce=require(_0x7ed3('0xd'));var deskjs=require(_0x7ed3('0xe'));var toCsv=require(_0x7ed3('0xf'));var querystring=require('querystring');var Papa=require(_0x7ed3('0x10'));var Redis=require('ioredis');var authService=require(_0x7ed3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ed3('0x12'));var logger=require('../../config/logger')(_0x7ed3('0x13'));var utils=require('../../config/utils');var config=require(_0x7ed3('0x14'));var licenseUtil=require(_0x7ed3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aeede,_0x47b8fd){_0x47b8fd=_0x47b8fd||0xcc;return function(_0x52db59){if(_0x52db59){return _0x5aeede[_0x7ed3('0x16')](_0x47b8fd);}return _0x5aeede[_0x7ed3('0x17')](_0x47b8fd)['end']();};}function respondWithResult(_0x5aaa39,_0x175131){_0x175131=_0x175131||0xc8;return function(_0x1b3d91){if(_0x1b3d91){return _0x5aaa39[_0x7ed3('0x17')](_0x175131)[_0x7ed3('0x18')](_0x1b3d91);}};}function respondWithFilteredResult(_0x24db36,_0x472751){return function(_0x3835de){if(_0x3835de){var _0x4657ba=typeof _0x472751[_0x7ed3('0x19')]===_0x7ed3('0x1a')&&typeof _0x472751[_0x7ed3('0x1b')]===_0x7ed3('0x1a');var _0x40d8c0=_0x3835de[_0x7ed3('0x1c')];var _0x55ba8d=_0x4657ba?0x0:_0x472751[_0x7ed3('0x19')];var _0x3ce4fb=_0x4657ba?_0x3835de['count']:_0x472751['offset']+_0x472751[_0x7ed3('0x1b')];var _0xed38bf;if(_0x3ce4fb>=_0x40d8c0){_0x3ce4fb=_0x40d8c0;_0xed38bf=0xc8;}else{_0xed38bf=0xce;}_0x24db36[_0x7ed3('0x17')](_0xed38bf);return _0x24db36[_0x7ed3('0x1d')](_0x7ed3('0x1e'),_0x55ba8d+'-'+_0x3ce4fb+'/'+_0x40d8c0)['json'](_0x3835de);}return null;};}function patchUpdates(_0xb5bb95){return function(_0x36fa58){try{jsonpatch['apply'](_0x36fa58,_0xb5bb95,!![]);}catch(_0x2c5716){return BPromise['reject'](_0x2c5716);}return _0x36fa58[_0x7ed3('0x1f')]();};}function saveUpdates(_0x3a6f67,_0x2ebea9){return function(_0x274c72){if(_0x274c72){return _0x274c72[_0x7ed3('0x20')](_0x3a6f67)[_0x7ed3('0x21')](function(_0x568b2c){return _0x568b2c;});}return null;};}function removeEntity(_0xb03175,_0x563a09){return function(_0x65484){if(_0x65484){return _0x65484['destroy']()[_0x7ed3('0x21')](function(){_0xb03175['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3177ce,_0x42f404){return function(_0x1a2e49){if(!_0x1a2e49){_0x3177ce[_0x7ed3('0x16')](0x194);}return _0x1a2e49;};}function handleError(_0x3eac89,_0x1203d9){_0x1203d9=_0x1203d9||0x1f4;return function(_0x24a07f){logger[_0x7ed3('0x22')](_0x24a07f[_0x7ed3('0x23')]);if(_0x24a07f['name']){delete _0x24a07f['name'];}_0x3eac89['status'](_0x1203d9)[_0x7ed3('0x24')](_0x24a07f);};}exports[_0x7ed3('0x25')]=function(_0x137daf,_0x436b33){var _0x3ab297={},_0x165998={},_0x2e5e0f={'count':0x0,'rows':[]};var _0x2365bd=_['map'](db[_0x7ed3('0x26')]['rawAttributes'],function(_0x30960d){return{'name':_0x30960d[_0x7ed3('0x27')],'type':_0x30960d['type']['key']};});_0x165998[_0x7ed3('0x28')]=_[_0x7ed3('0x29')](_0x2365bd,'name');_0x165998[_0x7ed3('0x2a')]=_[_0x7ed3('0x2b')](_0x137daf[_0x7ed3('0x2a')]);_0x165998[_0x7ed3('0x2c')]=_['intersection'](_0x165998[_0x7ed3('0x28')],_0x165998['query']);_0x3ab297['attributes']=_[_0x7ed3('0x2d')](_0x165998[_0x7ed3('0x28')],qs[_0x7ed3('0x2e')](_0x137daf['query'][_0x7ed3('0x2e')]));_0x3ab297[_0x7ed3('0x2f')]=_0x3ab297[_0x7ed3('0x2f')][_0x7ed3('0x30')]?_0x3ab297[_0x7ed3('0x2f')]:_0x165998['model'];if(!_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x31')]('nolimit')){_0x3ab297[_0x7ed3('0x1b')]=qs['limit'](_0x137daf['query'][_0x7ed3('0x1b')]);_0x3ab297[_0x7ed3('0x19')]=qs[_0x7ed3('0x19')](_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x19')]);}_0x3ab297[_0x7ed3('0x32')]=qs['sort'](_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x33')]);_0x3ab297['where']=qs[_0x7ed3('0x2c')](_['pick'](_0x137daf[_0x7ed3('0x2a')],_0x165998[_0x7ed3('0x2c')]),_0x2365bd);if(_0x137daf['query'][_0x7ed3('0x34')]){_0x3ab297[_0x7ed3('0x35')]=_[_0x7ed3('0x36')](_0x3ab297[_0x7ed3('0x35')],{'$or':_[_0x7ed3('0x29')](_0x2365bd,function(_0x3b7820){if(_0x3b7820['type']!=='VIRTUAL'){var _0x5b6e86={};_0x5b6e86[_0x3b7820['name']]={'$like':'%'+_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x34')]+'%'};return _0x5b6e86;}})});}_0x3ab297=_[_0x7ed3('0x36')]({},_0x3ab297,_0x137daf[_0x7ed3('0x37')]);var _0xaa8050={'where':_0x3ab297[_0x7ed3('0x35')]};return db[_0x7ed3('0x26')]['count'](_0xaa8050)['then'](function(_0xe975da){_0x2e5e0f[_0x7ed3('0x1c')]=_0xe975da;if(_0x137daf[_0x7ed3('0x2a')][_0x7ed3('0x38')]){_0x3ab297[_0x7ed3('0x39')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x7ed3('0x3a')](_0x3ab297);})['then'](function(_0x2953c9){_0x2e5e0f[_0x7ed3('0x3b')]=_0x2953c9;return _0x2e5e0f;})[_0x7ed3('0x21')](respondWithFilteredResult(_0x436b33,_0x3ab297))['catch'](handleError(_0x436b33,null));};exports[_0x7ed3('0x3c')]=function(_0xf4c814,_0x415019){var _0x57bf49={'raw':!![],'where':{'id':_0xf4c814[_0x7ed3('0x3d')]['id']}},_0x77d5de={};_0x77d5de[_0x7ed3('0x28')]=_['keys'](db[_0x7ed3('0x26')][_0x7ed3('0x3e')]);_0x77d5de[_0x7ed3('0x2a')]=_[_0x7ed3('0x2b')](_0xf4c814[_0x7ed3('0x2a')]);_0x77d5de[_0x7ed3('0x2c')]=_[_0x7ed3('0x2d')](_0x77d5de['model'],_0x77d5de[_0x7ed3('0x2a')]);_0x57bf49[_0x7ed3('0x2f')]=_['intersection'](_0x77d5de[_0x7ed3('0x28')],qs[_0x7ed3('0x2e')](_0xf4c814[_0x7ed3('0x2a')][_0x7ed3('0x2e')]));_0x57bf49['attributes']=_0x57bf49[_0x7ed3('0x2f')][_0x7ed3('0x30')]?_0x57bf49['attributes']:_0x77d5de[_0x7ed3('0x28')];if(_0xf4c814[_0x7ed3('0x2a')][_0x7ed3('0x38')]){_0x57bf49[_0x7ed3('0x39')]=[{'all':!![]}];}_0x57bf49=_[_0x7ed3('0x36')]({},_0x57bf49,_0xf4c814[_0x7ed3('0x37')]);return db['JscriptySessionReport'][_0x7ed3('0x3f')](_0x57bf49)[_0x7ed3('0x21')](handleEntityNotFound(_0x415019,null))['then'](respondWithResult(_0x415019,null))[_0x7ed3('0x40')](handleError(_0x415019,null));};exports['create']=function(_0x4c020f,_0x2f0cda){return db['JscriptySessionReport'][_0x7ed3('0x41')](_0x4c020f['body'],{})['then'](respondWithResult(_0x2f0cda,0xc9))[_0x7ed3('0x40')](handleError(_0x2f0cda,null));};exports[_0x7ed3('0x20')]=function(_0x5dbadc,_0x28e0cf){if(_0x5dbadc['body']['id']){delete _0x5dbadc['body']['id'];}return db[_0x7ed3('0x26')][_0x7ed3('0x3f')]({'where':{'id':_0x5dbadc[_0x7ed3('0x3d')]['id']}})[_0x7ed3('0x21')](handleEntityNotFound(_0x28e0cf,null))[_0x7ed3('0x21')](saveUpdates(_0x5dbadc['body'],null))[_0x7ed3('0x21')](respondWithResult(_0x28e0cf,null))[_0x7ed3('0x40')](handleError(_0x28e0cf,null));};exports['destroy']=function(_0x2fcbbc,_0x2089e0){return db['JscriptySessionReport'][_0x7ed3('0x3f')]({'where':{'id':_0x2fcbbc['params']['id']}})[_0x7ed3('0x21')](handleEntityNotFound(_0x2089e0,null))[_0x7ed3('0x21')](removeEntity(_0x2089e0,null))[_0x7ed3('0x40')](handleError(_0x2089e0,null));};exports[_0x7ed3('0x42')]=function(_0x46b0aa,_0x52d79f){return db['JscriptySessionReport'][_0x7ed3('0x42')]()[_0x7ed3('0x21')](respondWithResult(_0x52d79f,null))['catch'](handleError(_0x52d79f,null));};exports[_0x7ed3('0x43')]=function(_0x5001cc,_0x525e0c,_0x49f517){var _0x5e3157={'raw':!![],'where':{}};var _0x32d65b={};var _0x357874={'count':0x0,'rows':[]};return db[_0x7ed3('0x26')][_0x7ed3('0x44')]({'where':{'id':_0x5001cc['params']['id']}})[_0x7ed3('0x21')](handleEntityNotFound(_0x525e0c,null))[_0x7ed3('0x21')](function(_0x4d1e19){if(_0x4d1e19){_0x32d65b['model']=_['keys'](db[_0x7ed3('0x45')][_0x7ed3('0x3e')]);_0x32d65b[_0x7ed3('0x2a')]=_['keys'](_0x5001cc['query']);_0x32d65b[_0x7ed3('0x2c')]=_[_0x7ed3('0x2d')](_0x32d65b[_0x7ed3('0x28')],_0x32d65b[_0x7ed3('0x2a')]);_0x5e3157[_0x7ed3('0x2f')]=_[_0x7ed3('0x2d')](_0x32d65b[_0x7ed3('0x28')],qs[_0x7ed3('0x2e')](_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x2e')]));_0x5e3157['attributes']=_0x5e3157['attributes'][_0x7ed3('0x30')]?_0x5e3157[_0x7ed3('0x2f')]:_0x32d65b['model'];if(!_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x31')](_0x7ed3('0x46'))){_0x5e3157[_0x7ed3('0x1b')]=qs[_0x7ed3('0x1b')](_0x5001cc['query'][_0x7ed3('0x1b')]);_0x5e3157[_0x7ed3('0x19')]=qs[_0x7ed3('0x19')](_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x19')]);}_0x5e3157[_0x7ed3('0x32')]=qs['sort'](_0x5001cc[_0x7ed3('0x2a')]['sort']);_0x5e3157[_0x7ed3('0x35')]=qs['filters'](_[_0x7ed3('0x47')](_0x5001cc[_0x7ed3('0x2a')],_0x32d65b[_0x7ed3('0x2c')]));_0x5e3157[_0x7ed3('0x35')]['SessionId']=_0x4d1e19['id'];if(_0x5001cc[_0x7ed3('0x2a')][_0x7ed3('0x34')]){_0x5e3157[_0x7ed3('0x35')]=_[_0x7ed3('0x36')](_0x5e3157['where'],{'$or':_[_0x7ed3('0x29')](_0x5e3157[_0x7ed3('0x2f')],function(_0x166922){var _0x4f8dcc={};_0x4f8dcc[_0x166922]={'$like':'%'+_0x5001cc['query'][_0x7ed3('0x34')]+'%'};return _0x4f8dcc;})});}_0x5e3157=_[_0x7ed3('0x36')]({},_0x5e3157,_0x5001cc['options']);return db[_0x7ed3('0x45')][_0x7ed3('0x1c')]({'where':_0x5e3157[_0x7ed3('0x35')]})[_0x7ed3('0x21')](function(_0x4c6541){_0x357874['count']=_0x4c6541;if(_0x5001cc['query'][_0x7ed3('0x38')]){_0x5e3157['include']=[{'all':!![]}];}return db[_0x7ed3('0x45')][_0x7ed3('0x3a')](_0x5e3157);})[_0x7ed3('0x21')](function(_0x5d5af3){_0x357874['rows']=_0x5d5af3;return _0x357874;});}})['then'](respondWithFilteredResult(_0x525e0c,_0x5e3157))[_0x7ed3('0x40')](handleError(_0x525e0c,null));}; \ No newline at end of file +var _0x1a53=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject','then','destroy','end','stack','name','send','map','JscriptySessionReport','type','key','model','query','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','intersection','include','find','create','body','update','describe','findOne','JscriptyQuestionReport','hasOwnProperty','eml-format'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0x1a53,0xe6));var _0x31a5=function(_0x517337,_0x195d5e){_0x517337=_0x517337-0x0;var _0x3aaa01=_0x1a53[_0x517337];return _0x3aaa01;};'use strict';var emlformat=require(_0x31a5('0x0'));var rimraf=require(_0x31a5('0x1'));var zipdir=require(_0x31a5('0x2'));var jsonpatch=require(_0x31a5('0x3'));var rp=require(_0x31a5('0x4'));var moment=require(_0x31a5('0x5'));var BPromise=require(_0x31a5('0x6'));var Mustache=require(_0x31a5('0x7'));var util=require('util');var path=require(_0x31a5('0x8'));var sox=require('sox');var csv=require(_0x31a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31a5('0xa'));var _=require(_0x31a5('0xb'));var squel=require(_0x31a5('0xc'));var crypto=require('crypto');var jsforce=require(_0x31a5('0xd'));var deskjs=require(_0x31a5('0xe'));var toCsv=require(_0x31a5('0x9'));var querystring=require(_0x31a5('0xf'));var Papa=require(_0x31a5('0x10'));var Redis=require(_0x31a5('0x11'));var authService=require(_0x31a5('0x12'));var qs=require(_0x31a5('0x13'));var as=require(_0x31a5('0x14'));var hardwareService=require(_0x31a5('0x15'));var logger=require(_0x31a5('0x16'))(_0x31a5('0x17'));var utils=require(_0x31a5('0x18'));var config=require(_0x31a5('0x19'));var licenseUtil=require(_0x31a5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2087cb,_0x49bc39){_0x49bc39=_0x49bc39||0xcc;return function(_0x4079da){if(_0x4079da){return _0x2087cb[_0x31a5('0x1b')](_0x49bc39);}return _0x2087cb[_0x31a5('0x1c')](_0x49bc39)['end']();};}function respondWithResult(_0x2110a0,_0x180b5b){_0x180b5b=_0x180b5b||0xc8;return function(_0x150c3e){if(_0x150c3e){return _0x2110a0[_0x31a5('0x1c')](_0x180b5b)[_0x31a5('0x1d')](_0x150c3e);}};}function respondWithFilteredResult(_0x47788e,_0x3b905d){return function(_0xe4bc13){if(_0xe4bc13){var _0x2f7830=typeof _0x3b905d[_0x31a5('0x1e')]===_0x31a5('0x1f')&&typeof _0x3b905d[_0x31a5('0x20')]==='undefined';var _0x2da66b=_0xe4bc13[_0x31a5('0x21')];var _0x476791=_0x2f7830?0x0:_0x3b905d['offset'];var _0x5c7573=_0x2f7830?_0xe4bc13[_0x31a5('0x21')]:_0x3b905d[_0x31a5('0x1e')]+_0x3b905d['limit'];var _0x1d1b6f;if(_0x5c7573>=_0x2da66b){_0x5c7573=_0x2da66b;_0x1d1b6f=0xc8;}else{_0x1d1b6f=0xce;}_0x47788e[_0x31a5('0x1c')](_0x1d1b6f);return _0x47788e['set']('Content-Range',_0x476791+'-'+_0x5c7573+'/'+_0x2da66b)['json'](_0xe4bc13);}return null;};}function patchUpdates(_0x478620){return function(_0x42b73c){try{jsonpatch[_0x31a5('0x22')](_0x42b73c,_0x478620,!![]);}catch(_0x473123){return BPromise[_0x31a5('0x23')](_0x473123);}return _0x42b73c['save']();};}function saveUpdates(_0x1ae3b6,_0x256407){return function(_0x1e74d2){if(_0x1e74d2){return _0x1e74d2['update'](_0x1ae3b6)[_0x31a5('0x24')](function(_0x3a89f4){return _0x3a89f4;});}return null;};}function removeEntity(_0x48f6c9,_0x39092d){return function(_0xbd3e09){if(_0xbd3e09){return _0xbd3e09[_0x31a5('0x25')]()[_0x31a5('0x24')](function(){_0x48f6c9[_0x31a5('0x1c')](0xcc)[_0x31a5('0x26')]();});}};}function handleEntityNotFound(_0x4f9dee,_0x3d6e83){return function(_0x19b97c){if(!_0x19b97c){_0x4f9dee['sendStatus'](0x194);}return _0x19b97c;};}function handleError(_0x1fb0cd,_0x548ae6){_0x548ae6=_0x548ae6||0x1f4;return function(_0x1395cc){logger['error'](_0x1395cc[_0x31a5('0x27')]);if(_0x1395cc['name']){delete _0x1395cc[_0x31a5('0x28')];}_0x1fb0cd[_0x31a5('0x1c')](_0x548ae6)[_0x31a5('0x29')](_0x1395cc);};}exports['index']=function(_0x567ab1,_0x476475){var _0x45ad12={},_0x138a0c={},_0x22cef1={'count':0x0,'rows':[]};var _0x1c538f=_[_0x31a5('0x2a')](db[_0x31a5('0x2b')]['rawAttributes'],function(_0x32cb55){return{'name':_0x32cb55['fieldName'],'type':_0x32cb55[_0x31a5('0x2c')][_0x31a5('0x2d')]};});_0x138a0c[_0x31a5('0x2e')]=_['map'](_0x1c538f,_0x31a5('0x28'));_0x138a0c[_0x31a5('0x2f')]=_['keys'](_0x567ab1[_0x31a5('0x2f')]);_0x138a0c['filters']=_['intersection'](_0x138a0c[_0x31a5('0x2e')],_0x138a0c[_0x31a5('0x2f')]);_0x45ad12[_0x31a5('0x30')]=_['intersection'](_0x138a0c[_0x31a5('0x2e')],qs[_0x31a5('0x31')](_0x567ab1[_0x31a5('0x2f')][_0x31a5('0x31')]));_0x45ad12[_0x31a5('0x30')]=_0x45ad12[_0x31a5('0x30')][_0x31a5('0x32')]?_0x45ad12[_0x31a5('0x30')]:_0x138a0c['model'];if(!_0x567ab1['query']['hasOwnProperty'](_0x31a5('0x33'))){_0x45ad12['limit']=qs[_0x31a5('0x20')](_0x567ab1['query'][_0x31a5('0x20')]);_0x45ad12['offset']=qs[_0x31a5('0x1e')](_0x567ab1[_0x31a5('0x2f')][_0x31a5('0x1e')]);}_0x45ad12[_0x31a5('0x34')]=qs[_0x31a5('0x35')](_0x567ab1[_0x31a5('0x2f')][_0x31a5('0x35')]);_0x45ad12[_0x31a5('0x36')]=qs[_0x31a5('0x37')](_['pick'](_0x567ab1[_0x31a5('0x2f')],_0x138a0c[_0x31a5('0x37')]),_0x1c538f);if(_0x567ab1[_0x31a5('0x2f')][_0x31a5('0x38')]){_0x45ad12[_0x31a5('0x36')]=_[_0x31a5('0x39')](_0x45ad12[_0x31a5('0x36')],{'$or':_[_0x31a5('0x2a')](_0x1c538f,function(_0x56ec54){if(_0x56ec54[_0x31a5('0x2c')]!=='VIRTUAL'){var _0x58251b={};_0x58251b[_0x56ec54['name']]={'$like':'%'+_0x567ab1[_0x31a5('0x2f')][_0x31a5('0x38')]+'%'};return _0x58251b;}})});}_0x45ad12=_[_0x31a5('0x39')]({},_0x45ad12,_0x567ab1[_0x31a5('0x3a')]);var _0x1f31c9={'where':_0x45ad12[_0x31a5('0x36')]};return db[_0x31a5('0x2b')][_0x31a5('0x21')](_0x1f31c9)[_0x31a5('0x24')](function(_0x4a5449){_0x22cef1['count']=_0x4a5449;if(_0x567ab1[_0x31a5('0x2f')][_0x31a5('0x3b')]){_0x45ad12['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x31a5('0x3c')](_0x45ad12);})[_0x31a5('0x24')](function(_0x2b8dd0){_0x22cef1[_0x31a5('0x3d')]=_0x2b8dd0;return _0x22cef1;})[_0x31a5('0x24')](respondWithFilteredResult(_0x476475,_0x45ad12))[_0x31a5('0x3e')](handleError(_0x476475,null));};exports[_0x31a5('0x3f')]=function(_0x5f50a8,_0x13e8d8){var _0x2425ee={'raw':!![],'where':{'id':_0x5f50a8[_0x31a5('0x40')]['id']}},_0x442db0={};_0x442db0[_0x31a5('0x2e')]=_[_0x31a5('0x41')](db[_0x31a5('0x2b')][_0x31a5('0x42')]);_0x442db0[_0x31a5('0x2f')]=_[_0x31a5('0x41')](_0x5f50a8['query']);_0x442db0[_0x31a5('0x37')]=_[_0x31a5('0x43')](_0x442db0[_0x31a5('0x2e')],_0x442db0[_0x31a5('0x2f')]);_0x2425ee['attributes']=_[_0x31a5('0x43')](_0x442db0[_0x31a5('0x2e')],qs['fields'](_0x5f50a8[_0x31a5('0x2f')]['fields']));_0x2425ee[_0x31a5('0x30')]=_0x2425ee[_0x31a5('0x30')]['length']?_0x2425ee['attributes']:_0x442db0[_0x31a5('0x2e')];if(_0x5f50a8[_0x31a5('0x2f')][_0x31a5('0x3b')]){_0x2425ee[_0x31a5('0x44')]=[{'all':!![]}];}_0x2425ee=_[_0x31a5('0x39')]({},_0x2425ee,_0x5f50a8['options']);return db[_0x31a5('0x2b')][_0x31a5('0x45')](_0x2425ee)[_0x31a5('0x24')](handleEntityNotFound(_0x13e8d8,null))[_0x31a5('0x24')](respondWithResult(_0x13e8d8,null))[_0x31a5('0x3e')](handleError(_0x13e8d8,null));};exports[_0x31a5('0x46')]=function(_0x55bfa3,_0x302134){return db[_0x31a5('0x2b')][_0x31a5('0x46')](_0x55bfa3[_0x31a5('0x47')],{})['then'](respondWithResult(_0x302134,0xc9))[_0x31a5('0x3e')](handleError(_0x302134,null));};exports[_0x31a5('0x48')]=function(_0x299128,_0x31a8b7){if(_0x299128[_0x31a5('0x47')]['id']){delete _0x299128['body']['id'];}return db[_0x31a5('0x2b')][_0x31a5('0x45')]({'where':{'id':_0x299128[_0x31a5('0x40')]['id']}})[_0x31a5('0x24')](handleEntityNotFound(_0x31a8b7,null))['then'](saveUpdates(_0x299128[_0x31a5('0x47')],null))[_0x31a5('0x24')](respondWithResult(_0x31a8b7,null))['catch'](handleError(_0x31a8b7,null));};exports[_0x31a5('0x25')]=function(_0x41297e,_0x18ae39){return db['JscriptySessionReport'][_0x31a5('0x45')]({'where':{'id':_0x41297e[_0x31a5('0x40')]['id']}})[_0x31a5('0x24')](handleEntityNotFound(_0x18ae39,null))[_0x31a5('0x24')](removeEntity(_0x18ae39,null))['catch'](handleError(_0x18ae39,null));};exports[_0x31a5('0x49')]=function(_0x31de9e,_0x1c20bf){return db[_0x31a5('0x2b')][_0x31a5('0x49')]()[_0x31a5('0x24')](respondWithResult(_0x1c20bf,null))[_0x31a5('0x3e')](handleError(_0x1c20bf,null));};exports['getQuestions']=function(_0x249ed5,_0x51cea5,_0x4f6ba5){var _0x4215d3={'raw':!![],'where':{}};var _0x3340f7={};var _0x5d6d07={'count':0x0,'rows':[]};return db[_0x31a5('0x2b')][_0x31a5('0x4a')]({'where':{'id':_0x249ed5[_0x31a5('0x40')]['id']}})[_0x31a5('0x24')](handleEntityNotFound(_0x51cea5,null))[_0x31a5('0x24')](function(_0x112e35){if(_0x112e35){_0x3340f7[_0x31a5('0x2e')]=_[_0x31a5('0x41')](db[_0x31a5('0x4b')][_0x31a5('0x42')]);_0x3340f7[_0x31a5('0x2f')]=_[_0x31a5('0x41')](_0x249ed5[_0x31a5('0x2f')]);_0x3340f7['filters']=_['intersection'](_0x3340f7[_0x31a5('0x2e')],_0x3340f7[_0x31a5('0x2f')]);_0x4215d3[_0x31a5('0x30')]=_['intersection'](_0x3340f7[_0x31a5('0x2e')],qs[_0x31a5('0x31')](_0x249ed5[_0x31a5('0x2f')][_0x31a5('0x31')]));_0x4215d3[_0x31a5('0x30')]=_0x4215d3[_0x31a5('0x30')][_0x31a5('0x32')]?_0x4215d3['attributes']:_0x3340f7[_0x31a5('0x2e')];if(!_0x249ed5[_0x31a5('0x2f')][_0x31a5('0x4c')]('nolimit')){_0x4215d3['limit']=qs[_0x31a5('0x20')](_0x249ed5['query'][_0x31a5('0x20')]);_0x4215d3[_0x31a5('0x1e')]=qs[_0x31a5('0x1e')](_0x249ed5[_0x31a5('0x2f')][_0x31a5('0x1e')]);}_0x4215d3[_0x31a5('0x34')]=qs['sort'](_0x249ed5[_0x31a5('0x2f')][_0x31a5('0x35')]);_0x4215d3['where']=qs[_0x31a5('0x37')](_['pick'](_0x249ed5[_0x31a5('0x2f')],_0x3340f7[_0x31a5('0x37')]));_0x4215d3[_0x31a5('0x36')]['SessionId']=_0x112e35['id'];if(_0x249ed5[_0x31a5('0x2f')][_0x31a5('0x38')]){_0x4215d3[_0x31a5('0x36')]=_[_0x31a5('0x39')](_0x4215d3['where'],{'$or':_[_0x31a5('0x2a')](_0x4215d3[_0x31a5('0x30')],function(_0x3934cb){var _0xf4788b={};_0xf4788b[_0x3934cb]={'$like':'%'+_0x249ed5[_0x31a5('0x2f')]['filter']+'%'};return _0xf4788b;})});}_0x4215d3=_[_0x31a5('0x39')]({},_0x4215d3,_0x249ed5[_0x31a5('0x3a')]);return db[_0x31a5('0x4b')]['count']({'where':_0x4215d3[_0x31a5('0x36')]})[_0x31a5('0x24')](function(_0x2df952){_0x5d6d07['count']=_0x2df952;if(_0x249ed5[_0x31a5('0x2f')][_0x31a5('0x3b')]){_0x4215d3[_0x31a5('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x31a5('0x3c')](_0x4215d3);})[_0x31a5('0x24')](function(_0x37cd58){_0x5d6d07[_0x31a5('0x3d')]=_0x37cd58;return _0x5d6d07;});}})[_0x31a5('0x24')](respondWithFilteredResult(_0x51cea5,_0x4215d3))['catch'](handleError(_0x51cea5,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index daf609f..89ba443 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 _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1036c1,_0x10bf6c){var _0x241268=function(_0x3c67f5){while(--_0x3c67f5){_0x1036c1['push'](_0x1036c1['shift']());}};_0x241268(++_0x10bf6c);}(_0x6050,0x196));var _0x0605=function(_0x67ee24,_0x4f6b54){_0x67ee24=_0x67ee24-0x0;var _0x2bd8db=_0x6050[_0x67ee24];return _0x2bd8db;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0x1daca4,_0x32b9b2){var _0x3c6f85=function(_0x36ccee){while(--_0x36ccee){_0x1daca4['push'](_0x1daca4['shift']());}};_0x3c6f85(++_0x32b9b2);}(_0x53ec,0x192));var _0xc53e=function(_0x4c060b,_0x4c5e75){_0x4c060b=_0x4c060b-0x0;var _0x5b9790=_0x53ec[_0x4c060b];return _0x5b9790;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index cc145ea..79630f4 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 _0xb145=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message'];(function(_0x4572ec,_0x4942f0){var _0x24eea2=function(_0x5a9e3a){while(--_0x5a9e3a){_0x4572ec['push'](_0x4572ec['shift']());}};_0x24eea2(++_0x4942f0);}(_0xb145,0xa3));var _0x5b14=function(_0x5b0c0b,_0x15e06c){_0x5b0c0b=_0x5b0c0b-0x0;var _0x5c8f71=_0xb145[_0x5b0c0b];return _0x5c8f71;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var BPromise=require(_0x5b14('0x2'));var rs=require(_0x5b14('0x3'));var fs=require('fs');var Redis=require(_0x5b14('0x4'));var db=require(_0x5b14('0x5'))['db'];var utils=require(_0x5b14('0x6'));var logger=require(_0x5b14('0x7'))('rpc');var config=require(_0x5b14('0x8'));var jayson=require(_0x5b14('0x9'));var client=jayson[_0x5b14('0xa')][_0x5b14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50fd91,_0x1d12ed,_0x2a3921){return new BPromise(function(_0x34530a,_0x62cdcd){return client[_0x5b14('0xc')](_0x50fd91,_0x2a3921)['then'](function(_0x32d729){logger[_0x5b14('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d12ed,_0x5b14('0xe'));logger[_0x5b14('0xf')](_0x5b14('0x10'),_0x1d12ed,_0x5b14('0xe'),JSON[_0x5b14('0x11')](_0x32d729));if(_0x32d729['error']){if(_0x32d729[_0x5b14('0x12')]['code']===0x1f4){logger[_0x5b14('0x12')](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x62cdcd(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);return _0x34530a(_0x32d729[_0x5b14('0x12')][_0x5b14('0x14')]);}else{logger[_0x5b14('0xd')](_0x5b14('0x13'),_0x1d12ed,_0x5b14('0xe'));_0x34530a(_0x32d729[_0x5b14('0x15')][_0x5b14('0x14')]);}})[_0x5b14('0x16')](function(_0x2c3efb){logger['error'](_0x5b14('0x13'),_0x1d12ed,_0x2c3efb);_0x62cdcd(_0x2c3efb);});});} \ No newline at end of file +var _0x6050=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0x6050,0x196));var _0x0605=function(_0x1f382a,_0x8c43ac){_0x1f382a=_0x1f382a-0x0;var _0x2d31fe=_0x6050[_0x1f382a];return _0x2d31fe;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index a88f37d..07e87b6 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 _0x3e9f=['isAuthenticated','downloadLogFile','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','update','/download_log_file'];(function(_0x3b3fb2,_0x21a7a7){var _0x2c998a=function(_0x9ad1df){while(--_0x9ad1df){_0x3b3fb2['push'](_0x3b3fb2['shift']());}};_0x2c998a(++_0x21a7a7);}(_0x3e9f,0x17f));var _0xf3e9=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x3e9f[_0x273c39];return _0x46d6b5;};'use strict';var multer=require(_0xf3e9('0x0'));var util=require(_0xf3e9('0x1'));var path=require('path');var timeout=require(_0xf3e9('0x2'));var express=require(_0xf3e9('0x3'));var router=express[_0xf3e9('0x4')]();var fs_extra=require(_0xf3e9('0x5'));var auth=require(_0xf3e9('0x6'));var interaction=require(_0xf3e9('0x7'));var config=require(_0xf3e9('0x8'));var controller=require(_0xf3e9('0x9'));router[_0xf3e9('0xa')]('/',controller[_0xf3e9('0xb')]);router[_0xf3e9('0xc')](_0xf3e9('0xd'),auth['isAuthenticated'](),controller[_0xf3e9('0xe')]);router[_0xf3e9('0xa')](_0xf3e9('0xf'),auth[_0xf3e9('0x10')](),controller[_0xf3e9('0x11')]);module[_0xf3e9('0x12')]=router; \ No newline at end of file +var _0x329d=['../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x329d,0x192));var _0xd329=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x329d[_0x311909];return _0x8d3163;};'use strict';var multer=require(_0xd329('0x0'));var util=require(_0xd329('0x1'));var path=require('path');var timeout=require(_0xd329('0x2'));var express=require(_0xd329('0x3'));var router=express['Router']();var fs_extra=require(_0xd329('0x4'));var auth=require(_0xd329('0x5'));var interaction=require(_0xd329('0x6'));var config=require(_0xd329('0x7'));var controller=require(_0xd329('0x8'));router[_0xd329('0x9')]('/',controller[_0xd329('0xa')]);router[_0xd329('0xb')](_0xd329('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd329('0x9')](_0xd329('0xd'),auth[_0xd329('0xe')](),controller[_0xd329('0xf')]);module[_0xd329('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index a3522cc..654bcfd 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 _0x0f22=['STRING','sequelize','exports','TEXT'];(function(_0x5338d3,_0x35c206){var _0x3f494a=function(_0x3a71b1){while(--_0x3a71b1){_0x5338d3['push'](_0x5338d3['shift']());}};_0x3f494a(++_0x35c206);}(_0x0f22,0x15d));var _0x20f2=function(_0x1f5833,_0x1f639e){_0x1f5833=_0x1f5833-0x0;var _0x40aa81=_0x0f22[_0x1f5833];return _0x40aa81;};'use strict';var Sequelize=require(_0x20f2('0x0'));module[_0x20f2('0x1')]={'license':{'type':Sequelize[_0x20f2('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x20f2('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x32f1=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0x32f1,0x1a5));var _0x132f=function(_0x2eb0a5,_0x31c8c6){_0x2eb0a5=_0x2eb0a5-0x0;var _0x180f48=_0x32f1[_0x2eb0a5];return _0x180f48;};'use strict';var Sequelize=require(_0x132f('0x0'));module[_0x132f('0x1')]={'license':{'type':Sequelize[_0x132f('0x2')]},'data1':{'type':Sequelize[_0x132f('0x3')]},'data2':{'type':Sequelize[_0x132f('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x132f('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 e0b0d1f..13edca0 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 _0x5627=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','../../config/license/util','index','model','keys','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','License','find','params','get','checkLicense','key','demo','license-info.log','join','/var','log','attachment;\x20filename=','set','Content-Type','text/plain','download','eml-format','rimraf'];(function(_0xba35c0,_0x3a3943){var _0x2847c5=function(_0x5e2309){while(--_0x5e2309){_0xba35c0['push'](_0xba35c0['shift']());}};_0x2847c5(++_0x3a3943);}(_0x5627,0x1cc));var _0x7562=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5627[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x7562('0x0'));var rimraf=require(_0x7562('0x1'));var zipdir=require(_0x7562('0x2'));var jsonpatch=require(_0x7562('0x3'));var rp=require('request-promise');var moment=require(_0x7562('0x4'));var BPromise=require(_0x7562('0x5'));var Mustache=require(_0x7562('0x6'));var util=require(_0x7562('0x7'));var path=require(_0x7562('0x8'));var sox=require('sox');var csv=require(_0x7562('0x9'));var ejs=require(_0x7562('0xa'));var fs=require('fs');var fs_extra=require(_0x7562('0xb'));var _=require(_0x7562('0xc'));var squel=require(_0x7562('0xd'));var crypto=require(_0x7562('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7562('0x9'));var querystring=require(_0x7562('0xf'));var Papa=require(_0x7562('0x10'));var Redis=require(_0x7562('0x11'));var authService=require(_0x7562('0x12'));var qs=require(_0x7562('0x13'));var as=require(_0x7562('0x14'));var hardwareService=require(_0x7562('0x15'));var logger=require(_0x7562('0x16'))(_0x7562('0x17'));var utils=require(_0x7562('0x18'));var config=require(_0x7562('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7562('0x1a'))['db'];function respondWithStatusCode(_0x5c33ff,_0x426fdf){_0x426fdf=_0x426fdf||0xcc;return function(_0x4b535e){if(_0x4b535e){return _0x5c33ff[_0x7562('0x1b')](_0x426fdf);}return _0x5c33ff[_0x7562('0x1c')](_0x426fdf)[_0x7562('0x1d')]();};}function respondWithResult(_0x394b77,_0x59237a){_0x59237a=_0x59237a||0xc8;return function(_0x100ad0){if(_0x100ad0){return _0x394b77[_0x7562('0x1c')](_0x59237a)[_0x7562('0x1e')](_0x100ad0);}};}function respondWithFilteredResult(_0x13f097,_0x3349c5){return function(_0x41cef0){if(_0x41cef0){var _0x960ae1=typeof _0x3349c5[_0x7562('0x1f')]==='undefined'&&typeof _0x3349c5[_0x7562('0x20')]===_0x7562('0x21');var _0x16e214=_0x41cef0[_0x7562('0x22')];var _0x5ae93c=_0x960ae1?0x0:_0x3349c5[_0x7562('0x1f')];var _0x58cdc5=_0x960ae1?_0x41cef0[_0x7562('0x22')]:_0x3349c5[_0x7562('0x1f')]+_0x3349c5['limit'];var _0x2ca48a;if(_0x58cdc5>=_0x16e214){_0x58cdc5=_0x16e214;_0x2ca48a=0xc8;}else{_0x2ca48a=0xce;}_0x13f097[_0x7562('0x1c')](_0x2ca48a);return _0x13f097['set'](_0x7562('0x23'),_0x5ae93c+'-'+_0x58cdc5+'/'+_0x16e214)[_0x7562('0x1e')](_0x41cef0);}return null;};}function patchUpdates(_0x4ea661){return function(_0x1fc601){try{jsonpatch[_0x7562('0x24')](_0x1fc601,_0x4ea661,!![]);}catch(_0x2b93c0){return BPromise[_0x7562('0x25')](_0x2b93c0);}return _0x1fc601[_0x7562('0x26')]();};}function saveUpdates(_0x426812,_0xd6175f){return function(_0x3ef69a){if(_0x3ef69a){return _0x3ef69a[_0x7562('0x27')](_0x426812)['then'](function(_0xa4aec4){return _0xa4aec4;});}return null;};}function removeEntity(_0x5926a1,_0x13254f){return function(_0x45f86b){if(_0x45f86b){return _0x45f86b[_0x7562('0x28')]()[_0x7562('0x29')](function(){_0x5926a1['status'](0xcc)[_0x7562('0x1d')]();});}};}function handleEntityNotFound(_0x45ac3d,_0x3f8185){return function(_0x503312){if(!_0x503312){_0x45ac3d[_0x7562('0x1b')](0x194);}return _0x503312;};}function handleError(_0x115ded,_0x3f8c44){_0x3f8c44=_0x3f8c44||0x1f4;return function(_0x1d4b6b){logger[_0x7562('0x2a')](_0x1d4b6b[_0x7562('0x2b')]);if(_0x1d4b6b[_0x7562('0x2c')]){delete _0x1d4b6b['name'];}_0x115ded[_0x7562('0x1c')](_0x3f8c44)[_0x7562('0x2d')](_0x1d4b6b);};}var utilLicense=require(_0x7562('0x2e'));exports[_0x7562('0x2f')]=function(_0x5f3787,_0x6b833c){var _0x354b1a={'raw':!![],'where':{'id':0x1}},_0x3342d8={};_0x3342d8[_0x7562('0x30')]=_[_0x7562('0x31')](db['License']['rawAttributes']);_0x3342d8[_0x7562('0x32')]=_[_0x7562('0x31')](_0x5f3787['query']);_0x3342d8[_0x7562('0x33')]=_[_0x7562('0x34')](_0x3342d8[_0x7562('0x30')],_0x3342d8[_0x7562('0x32')]);_0x354b1a[_0x7562('0x35')]=_[_0x7562('0x34')](_0x3342d8[_0x7562('0x30')],qs[_0x7562('0x36')](_0x5f3787['query']['fields']));_0x354b1a[_0x7562('0x35')]=_0x354b1a[_0x7562('0x35')][_0x7562('0x37')]?_0x354b1a[_0x7562('0x35')]:_0x3342d8['model'];_0x354b1a=_[_0x7562('0x38')]({},_0x354b1a,_0x5f3787[_0x7562('0x39')]);return utilLicense[_0x7562('0x3a')](_0x354b1a)['then'](respondWithResult(_0x6b833c,null))[_0x7562('0x3b')](handleError(_0x6b833c,null));};exports[_0x7562('0x27')]=function(_0xd7da71,_0x540904){if(_0xd7da71['body']['id']){delete _0xd7da71[_0x7562('0x3c')]['id'];}return db[_0x7562('0x3d')][_0x7562('0x3e')]({'where':{'id':_0xd7da71[_0x7562('0x3f')]['id']}})[_0x7562('0x29')](handleEntityNotFound(_0x540904,null))[_0x7562('0x29')](function(_0x3beab2){var _0x3bfbc8=_0x3beab2[_0x7562('0x40')]({'plain':!![]});return utilLicense[_0x7562('0x41')](_0x3bfbc8,_0xd7da71[_0x7562('0x3c')][_0x7562('0x42')]);})[_0x7562('0x29')](function(_0x5d5ec8){if(!_0x5d5ec8[_0x7562('0x43')]){return saveUpdates(_0xd7da71['body'],null);}return _0x5d5ec8;})[_0x7562('0x29')](respondWithResult(_0x540904,null))[_0x7562('0x3b')](handleError(_0x540904,null));};exports['downloadLogFile']=function(_0x145209,_0x61fd5d){var _0x144e15=_0x7562('0x44');var _0x215552=path[_0x7562('0x45')](_0x7562('0x46'),_0x7562('0x47'),'xcally',_0x144e15);_0x61fd5d['setHeader']('Content-disposition',_0x7562('0x48')+_0x144e15);_0x61fd5d[_0x7562('0x49')](_0x7562('0x4a'),_0x7562('0x4b'));_0x61fd5d[_0x7562('0x4c')](_0x215552);}; \ No newline at end of file +var _0x5891=['status','json','undefined','limit','count','offset','set','reject','save','update','then','end','stack','name','index','keys','rawAttributes','query','filters','intersection','attributes','model','fields','length','merge','getLicense','catch','body','License','get','checkLicense','key','demo','downloadLogFile','license-info.log','/var','xcally','attachment;\x20filename=','download','eml-format','zip-dir','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x58bda4,_0x1c83fe){var _0x1e7305=function(_0x25f958){while(--_0x25f958){_0x58bda4['push'](_0x58bda4['shift']());}};_0x1e7305(++_0x1c83fe);}(_0x5891,0x11f));var _0x1589=function(_0x25ce8f,_0x2afa8e){_0x25ce8f=_0x25ce8f-0x0;var _0x286a90=_0x5891[_0x25ce8f];return _0x286a90;};'use strict';var emlformat=require(_0x1589('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1589('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1589('0x2'));var moment=require('moment');var BPromise=require(_0x1589('0x3'));var Mustache=require(_0x1589('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1589('0x5'));var ejs=require(_0x1589('0x6'));var fs=require('fs');var fs_extra=require(_0x1589('0x7'));var _=require(_0x1589('0x8'));var squel=require(_0x1589('0x9'));var crypto=require(_0x1589('0xa'));var jsforce=require(_0x1589('0xb'));var deskjs=require(_0x1589('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1589('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1589('0xe'));var as=require(_0x1589('0xf'));var hardwareService=require(_0x1589('0x10'));var logger=require(_0x1589('0x11'))(_0x1589('0x12'));var utils=require('../../config/utils');var config=require(_0x1589('0x13'));var licenseUtil=require(_0x1589('0x14'));var db=require(_0x1589('0x15'))['db'];function respondWithStatusCode(_0x5c0f47,_0x3e883a){_0x3e883a=_0x3e883a||0xcc;return function(_0x22fd2d){if(_0x22fd2d){return _0x5c0f47[_0x1589('0x16')](_0x3e883a);}return _0x5c0f47['status'](_0x3e883a)['end']();};}function respondWithResult(_0x21d1ad,_0x8b51f2){_0x8b51f2=_0x8b51f2||0xc8;return function(_0x2c2a29){if(_0x2c2a29){return _0x21d1ad[_0x1589('0x17')](_0x8b51f2)[_0x1589('0x18')](_0x2c2a29);}};}function respondWithFilteredResult(_0x43b27b,_0x533784){return function(_0x5cc643){if(_0x5cc643){var _0x1b00e3=typeof _0x533784['offset']===_0x1589('0x19')&&typeof _0x533784[_0x1589('0x1a')]===_0x1589('0x19');var _0x5b607d=_0x5cc643[_0x1589('0x1b')];var _0xd081c6=_0x1b00e3?0x0:_0x533784[_0x1589('0x1c')];var _0x271ed9=_0x1b00e3?_0x5cc643[_0x1589('0x1b')]:_0x533784[_0x1589('0x1c')]+_0x533784[_0x1589('0x1a')];var _0x335354;if(_0x271ed9>=_0x5b607d){_0x271ed9=_0x5b607d;_0x335354=0xc8;}else{_0x335354=0xce;}_0x43b27b['status'](_0x335354);return _0x43b27b[_0x1589('0x1d')]('Content-Range',_0xd081c6+'-'+_0x271ed9+'/'+_0x5b607d)['json'](_0x5cc643);}return null;};}function patchUpdates(_0x1e52cc){return function(_0x8572f7){try{jsonpatch['apply'](_0x8572f7,_0x1e52cc,!![]);}catch(_0x21fad2){return BPromise[_0x1589('0x1e')](_0x21fad2);}return _0x8572f7[_0x1589('0x1f')]();};}function saveUpdates(_0xfc7ed1,_0x29a26e){return function(_0x23daac){if(_0x23daac){return _0x23daac[_0x1589('0x20')](_0xfc7ed1)[_0x1589('0x21')](function(_0x1e3704){return _0x1e3704;});}return null;};}function removeEntity(_0x203bf8,_0x3451ad){return function(_0x314209){if(_0x314209){return _0x314209['destroy']()[_0x1589('0x21')](function(){_0x203bf8[_0x1589('0x17')](0xcc)[_0x1589('0x22')]();});}};}function handleEntityNotFound(_0x43b089,_0x2da55a){return function(_0x2380ee){if(!_0x2380ee){_0x43b089['sendStatus'](0x194);}return _0x2380ee;};}function handleError(_0x1d1d33,_0x180c33){_0x180c33=_0x180c33||0x1f4;return function(_0x59a145){logger['error'](_0x59a145[_0x1589('0x23')]);if(_0x59a145[_0x1589('0x24')]){delete _0x59a145[_0x1589('0x24')];}_0x1d1d33[_0x1589('0x17')](_0x180c33)['send'](_0x59a145);};}var utilLicense=require(_0x1589('0x14'));exports[_0x1589('0x25')]=function(_0xe6411c,_0xc3a36b){var _0x462c5f={'raw':!![],'where':{'id':0x1}},_0x413f57={};_0x413f57['model']=_[_0x1589('0x26')](db['License'][_0x1589('0x27')]);_0x413f57[_0x1589('0x28')]=_['keys'](_0xe6411c[_0x1589('0x28')]);_0x413f57[_0x1589('0x29')]=_[_0x1589('0x2a')](_0x413f57['model'],_0x413f57['query']);_0x462c5f[_0x1589('0x2b')]=_['intersection'](_0x413f57[_0x1589('0x2c')],qs[_0x1589('0x2d')](_0xe6411c[_0x1589('0x28')]['fields']));_0x462c5f[_0x1589('0x2b')]=_0x462c5f[_0x1589('0x2b')][_0x1589('0x2e')]?_0x462c5f[_0x1589('0x2b')]:_0x413f57[_0x1589('0x2c')];_0x462c5f=_[_0x1589('0x2f')]({},_0x462c5f,_0xe6411c['options']);return utilLicense[_0x1589('0x30')](_0x462c5f)['then'](respondWithResult(_0xc3a36b,null))[_0x1589('0x31')](handleError(_0xc3a36b,null));};exports[_0x1589('0x20')]=function(_0x54332b,_0x1058e9){if(_0x54332b[_0x1589('0x32')]['id']){delete _0x54332b[_0x1589('0x32')]['id'];}return db[_0x1589('0x33')]['find']({'where':{'id':_0x54332b['params']['id']}})['then'](handleEntityNotFound(_0x1058e9,null))['then'](function(_0x4cc688){var _0x3edd8e=_0x4cc688[_0x1589('0x34')]({'plain':!![]});return utilLicense[_0x1589('0x35')](_0x3edd8e,_0x54332b[_0x1589('0x32')][_0x1589('0x36')]);})['then'](function(_0x43332e){if(!_0x43332e[_0x1589('0x37')]){return saveUpdates(_0x54332b[_0x1589('0x32')],null);}return _0x43332e;})[_0x1589('0x21')](respondWithResult(_0x1058e9,null))['catch'](handleError(_0x1058e9,null));};exports[_0x1589('0x38')]=function(_0x3394a5,_0x56fcba){var _0x53709b=_0x1589('0x39');var _0x972ecb=path['join'](_0x1589('0x3a'),'log',_0x1589('0x3b'),_0x53709b);_0x56fcba['setHeader']('Content-disposition',_0x1589('0x3c')+_0x53709b);_0x56fcba['set']('Content-Type','text/plain');_0x56fcba[_0x1589('0x3d')](_0x972ecb);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e80582e..91182ad 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 _0xf253=['rimraf','../../config/environment','./license.attributes','exports','define','License','license','api','moment','bluebird','request-promise','path'];(function(_0x1bb7d1,_0x4afbef){var _0x4d0861=function(_0x363fd5){while(--_0x363fd5){_0x1bb7d1['push'](_0x1bb7d1['shift']());}};_0x4d0861(++_0x4afbef);}(_0xf253,0xdf));var _0x3f25=function(_0x131604,_0x475a68){_0x131604=_0x131604-0x0;var _0x4a2aea=_0xf253[_0x131604];return _0x4a2aea;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3f25('0x0'));var moment=require(_0x3f25('0x1'));var BPromise=require(_0x3f25('0x2'));var rp=require(_0x3f25('0x3'));var fs=require('fs');var path=require(_0x3f25('0x4'));var rimraf=require(_0x3f25('0x5'));var config=require(_0x3f25('0x6'));var attributes=require(_0x3f25('0x7'));module[_0x3f25('0x8')]=function(_0x3e9876,_0x240cd0){return _0x3e9876[_0x3f25('0x9')](_0x3f25('0xa'),attributes,{'tableName':_0x3f25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eef=['moment','request-promise','path','rimraf','../../config/environment','exports','License','license','util','../../config/logger'];(function(_0x584a30,_0x4d0a27){var _0x14e2a2=function(_0x2557ec){while(--_0x2557ec){_0x584a30['push'](_0x584a30['shift']());}};_0x14e2a2(++_0x4d0a27);}(_0x6eef,0xda));var _0xf6ee=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x6eef[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require('lodash');var util=require(_0xf6ee('0x0'));var logger=require(_0xf6ee('0x1'))('api');var moment=require(_0xf6ee('0x2'));var BPromise=require('bluebird');var rp=require(_0xf6ee('0x3'));var fs=require('fs');var path=require(_0xf6ee('0x4'));var rimraf=require(_0xf6ee('0x5'));var config=require(_0xf6ee('0x6'));var attributes=require('./license.attributes');module[_0xf6ee('0x7')]=function(_0x586db0,_0x321cb8){return _0x586db0['define'](_0xf6ee('0x8'),attributes,{'tableName':_0xf6ee('0x9'),'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 fb361c2..2cfafa8 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 _0x33af=['info','request\x20sent','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1e8c72,_0x4a6d36){var _0x707394=function(_0x3d79a4){while(--_0x3d79a4){_0x1e8c72['push'](_0x1e8c72['shift']());}};_0x707394(++_0x4a6d36);}(_0x33af,0x1bc));var _0xf33a=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0x33af[_0x5bb4e8];return _0x2a86f2;};'use strict';var _=require(_0xf33a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf33a('0x3'))['db'];var utils=require(_0xf33a('0x4'));var logger=require(_0xf33a('0x5'))('rpc');var config=require(_0xf33a('0x6'));var jayson=require(_0xf33a('0x7'));var client=jayson[_0xf33a('0x8')][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42e5fd,_0x11a73c,_0x22580c){return new BPromise(function(_0x2775d3,_0x263d4f){return client['request'](_0x42e5fd,_0x22580c)[_0xf33a('0xa')](function(_0x1495f3){logger['info'](_0xf33a('0xb'),_0x11a73c,'request\x20sent');logger[_0xf33a('0xc')](_0xf33a('0xd'),_0x11a73c,'request\x20sent',JSON[_0xf33a('0xe')](_0x1495f3));if(_0x1495f3['error']){if(_0x1495f3[_0xf33a('0xf')][_0xf33a('0x10')]===0x1f4){logger['error'](_0xf33a('0xb'),_0x11a73c,_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);return _0x263d4f(_0x1495f3['error'][_0xf33a('0x11')]);}logger['error'](_0xf33a('0xb'),_0x11a73c,_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);return _0x2775d3(_0x1495f3[_0xf33a('0xf')][_0xf33a('0x11')]);}else{logger[_0xf33a('0x12')]('License,\x20%s,\x20%s',_0x11a73c,_0xf33a('0x13'));_0x2775d3(_0x1495f3[_0xf33a('0x14')][_0xf33a('0x11')]);}})[_0xf33a('0x15')](function(_0x55528c){logger['error']('License,\x20%s,\x20%s',_0x11a73c,_0x55528c);_0x263d4f(_0x55528c);});});} \ No newline at end of file +var _0x7c11=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x29bb41,_0x3ddc89){var _0x5dad92=function(_0x1387c3){while(--_0x1387c3){_0x29bb41['push'](_0x29bb41['shift']());}};_0x5dad92(++_0x3ddc89);}(_0x7c11,0x15c));var _0x17c1=function(_0x47776f,_0x482990){_0x47776f=_0x47776f-0x0;var _0x137f26=_0x7c11[_0x47776f];return _0x137f26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x17c1('0x0'));var BPromise=require(_0x17c1('0x1'));var rs=require(_0x17c1('0x2'));var fs=require('fs');var Redis=require(_0x17c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x17c1('0x4'));var logger=require(_0x17c1('0x5'))(_0x17c1('0x6'));var config=require(_0x17c1('0x7'));var jayson=require(_0x17c1('0x8'));var client=jayson[_0x17c1('0x9')][_0x17c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58b4a2,_0x37aa11,_0x41dc0a){return new BPromise(function(_0x132466,_0x4e5e7e){return client[_0x17c1('0xb')](_0x58b4a2,_0x41dc0a)[_0x17c1('0xc')](function(_0x4d12b3){logger[_0x17c1('0xd')](_0x17c1('0xe'),_0x37aa11,'request\x20sent');logger['debug'](_0x17c1('0xf'),_0x37aa11,_0x17c1('0x10'),JSON[_0x17c1('0x11')](_0x4d12b3));if(_0x4d12b3[_0x17c1('0x12')]){if(_0x4d12b3[_0x17c1('0x12')][_0x17c1('0x13')]===0x1f4){logger['error'](_0x17c1('0xe'),_0x37aa11,_0x4d12b3[_0x17c1('0x12')][_0x17c1('0x14')]);return _0x4e5e7e(_0x4d12b3[_0x17c1('0x12')]['message']);}logger[_0x17c1('0x12')]('License,\x20%s,\x20%s',_0x37aa11,_0x4d12b3[_0x17c1('0x12')][_0x17c1('0x14')]);return _0x132466(_0x4d12b3['error']['message']);}else{logger[_0x17c1('0xd')](_0x17c1('0xe'),_0x37aa11,_0x17c1('0x10'));_0x132466(_0x4d12b3[_0x17c1('0x15')][_0x17c1('0x14')]);}})['catch'](function(_0x1a3a6c){logger[_0x17c1('0x12')](_0x17c1('0xe'),_0x37aa11,_0x1a3a6c);_0x4e5e7e(_0x1a3a6c);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 73cc44c..4470d96 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 _0x9260=['../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','post','addAnswer','create','addImap','addSmtp','/:id/interactions','/:id/applications','addApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2b76ed,_0x351a05){var _0x23ba5a=function(_0x30cfff){while(--_0x30cfff){_0x2b76ed['push'](_0x2b76ed['shift']());}};_0x23ba5a(++_0x351a05);}(_0x9260,0x16a));var _0x0926=function(_0xd26568,_0x2aca04){_0xd26568=_0xd26568-0x0;var _0x2c628b=_0x9260[_0xd26568];return _0x2c628b;};'use strict';var multer=require(_0x0926('0x0'));var util=require('util');var path=require(_0x0926('0x1'));var timeout=require(_0x0926('0x2'));var express=require(_0x0926('0x3'));var router=express[_0x0926('0x4')]();var fs_extra=require(_0x0926('0x5'));var auth=require(_0x0926('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0926('0x7'));var controller=require(_0x0926('0x8'));router[_0x0926('0x9')]('/',auth[_0x0926('0xa')](),controller[_0x0926('0xb')]);router[_0x0926('0x9')](_0x0926('0xc'),auth[_0x0926('0xa')](),controller[_0x0926('0xd')]);router[_0x0926('0x9')](_0x0926('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x0926('0xf'),auth[_0x0926('0xa')](),controller['getDispositions']);router['get'](_0x0926('0x10'),auth[_0x0926('0xa')](),controller[_0x0926('0x11')]);router['get'](_0x0926('0x12'),auth[_0x0926('0xa')](),controller[_0x0926('0x13')]);router[_0x0926('0x9')](_0x0926('0x14'),auth[_0x0926('0xa')](),controller[_0x0926('0x15')]);router[_0x0926('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x0926('0x9')]('/:id/applications',auth[_0x0926('0xa')](),controller[_0x0926('0x16')]);router[_0x0926('0x9')](_0x0926('0x17'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0926('0x9')](_0x0926('0x18'),auth[_0x0926('0xa')](),controller[_0x0926('0x19')]);router[_0x0926('0x9')](_0x0926('0x1a'),auth[_0x0926('0xa')](),controller['getAgents']);router[_0x0926('0x1b')](_0x0926('0xf'),auth[_0x0926('0xa')](),controller['addDisposition']);router[_0x0926('0x1b')](_0x0926('0x10'),auth[_0x0926('0xa')](),controller[_0x0926('0x1c')]);router[_0x0926('0x1b')]('/',auth[_0x0926('0xa')](),controller[_0x0926('0x1d')]);router[_0x0926('0x1b')]('/:id/in_servers',auth[_0x0926('0xa')](),controller[_0x0926('0x1e')]);router['post'](_0x0926('0x14'),auth[_0x0926('0xa')](),controller[_0x0926('0x1f')]);router[_0x0926('0x1b')](_0x0926('0x20'),auth[_0x0926('0xa')](),controller['addInteraction']);router[_0x0926('0x1b')](_0x0926('0x21'),auth[_0x0926('0xa')](),controller[_0x0926('0x22')]);router['post'](_0x0926('0x23'),auth['isAuthenticated'](),controller[_0x0926('0x24')]);router[_0x0926('0x1b')]('/:id/users',auth[_0x0926('0xa')](),controller[_0x0926('0x25')]);router[_0x0926('0x26')]('/:id',auth[_0x0926('0xa')](),controller['update']);router[_0x0926('0x27')](_0x0926('0xf'),auth[_0x0926('0xa')](),controller[_0x0926('0x28')]);router['delete'](_0x0926('0x10'),auth[_0x0926('0xa')](),controller[_0x0926('0x29')]);router['delete'](_0x0926('0x12'),auth['isAuthenticated'](),controller[_0x0926('0x2a')]);router[_0x0926('0x27')](_0x0926('0x14'),auth[_0x0926('0xa')](),controller['removeSmtp']);router[_0x0926('0x27')](_0x0926('0xe'),auth[_0x0926('0xa')](),controller[_0x0926('0x2b')]);router[_0x0926('0x27')](_0x0926('0x1a'),auth[_0x0926('0xa')](),controller[_0x0926('0x2c')]);module[_0x0926('0x2d')]=router; \ No newline at end of file +var _0xd653=['removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','get','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','getInteractions','/:id/applications','/:id/verify','verifySmtp','getAgents','post','create','/:id/in_servers','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','/:id/users','put','update','removeDispositions','delete','removeAnswers'];(function(_0x3e29a5,_0x48c496){var _0x35aa0f=function(_0x4de24e){while(--_0x4de24e){_0x3e29a5['push'](_0x3e29a5['shift']());}};_0x35aa0f(++_0x48c496);}(_0xd653,0x1b0));var _0x3d65=function(_0x355b05,_0x372de6){_0x355b05=_0x355b05-0x0;var _0x580be2=_0xd653[_0x355b05];return _0x580be2;};'use strict';var multer=require(_0x3d65('0x0'));var util=require(_0x3d65('0x1'));var path=require(_0x3d65('0x2'));var timeout=require(_0x3d65('0x3'));var express=require(_0x3d65('0x4'));var router=express[_0x3d65('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3d65('0x6'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0x3d65('0x7')](),controller['index']);router[_0x3d65('0x8')]('/describe',auth[_0x3d65('0x7')](),controller['describe']);router[_0x3d65('0x8')](_0x3d65('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x3d65('0x8')](_0x3d65('0xa'),auth[_0x3d65('0x7')](),controller['getDispositions']);router[_0x3d65('0x8')](_0x3d65('0xb'),auth[_0x3d65('0x7')](),controller[_0x3d65('0xc')]);router[_0x3d65('0x8')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x3d65('0xd')]);router['get']('/:id/out_servers',auth[_0x3d65('0x7')](),controller[_0x3d65('0xe')]);router[_0x3d65('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x3d65('0xf')]);router[_0x3d65('0x8')](_0x3d65('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x3d65('0x8')]('/:id/messages',auth[_0x3d65('0x7')](),controller['getMessages']);router['get'](_0x3d65('0x11'),auth['isAuthenticated'](),controller[_0x3d65('0x12')]);router[_0x3d65('0x8')]('/:id/users',auth[_0x3d65('0x7')](),controller[_0x3d65('0x13')]);router[_0x3d65('0x14')]('/:id/dispositions',auth[_0x3d65('0x7')](),controller['addDisposition']);router[_0x3d65('0x14')](_0x3d65('0xb'),auth[_0x3d65('0x7')](),controller['addAnswer']);router[_0x3d65('0x14')]('/',auth['isAuthenticated'](),controller[_0x3d65('0x15')]);router[_0x3d65('0x14')](_0x3d65('0x16'),auth['isAuthenticated'](),controller['addImap']);router[_0x3d65('0x14')](_0x3d65('0x17'),auth['isAuthenticated'](),controller[_0x3d65('0x18')]);router[_0x3d65('0x14')](_0x3d65('0x19'),auth[_0x3d65('0x7')](),controller[_0x3d65('0x1a')]);router[_0x3d65('0x14')](_0x3d65('0x10'),auth['isAuthenticated'](),controller[_0x3d65('0x1b')]);router[_0x3d65('0x14')](_0x3d65('0x1c'),auth[_0x3d65('0x7')](),controller[_0x3d65('0x1d')]);router['post'](_0x3d65('0x1e'),auth[_0x3d65('0x7')](),controller['addAgents']);router[_0x3d65('0x1f')](_0x3d65('0x9'),auth[_0x3d65('0x7')](),controller[_0x3d65('0x20')]);router['delete'](_0x3d65('0xa'),auth[_0x3d65('0x7')](),controller[_0x3d65('0x21')]);router[_0x3d65('0x22')]('/:id/canned_answers',auth[_0x3d65('0x7')](),controller[_0x3d65('0x23')]);router[_0x3d65('0x22')](_0x3d65('0x16'),auth[_0x3d65('0x7')](),controller['removeImap']);router[_0x3d65('0x22')]('/:id/out_servers',auth[_0x3d65('0x7')](),controller[_0x3d65('0x24')]);router[_0x3d65('0x22')](_0x3d65('0x9'),auth[_0x3d65('0x7')](),controller['destroy']);router[_0x3d65('0x22')](_0x3d65('0x1e'),auth['isAuthenticated'](),controller[_0x3d65('0x25')]);module[_0x3d65('0x26')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index dbb604b..b1ed96b 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 _0xab63=['yahoo','outlook365','getDataValue','custom','provider','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','ENUM','gmail','hotmail'];(function(_0x208d89,_0x56bec0){var _0xda6990=function(_0x3bfe3b){while(--_0x3bfe3b){_0x208d89['push'](_0x208d89['shift']());}};_0xda6990(++_0x56bec0);}(_0xab63,0x1f3));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3ab6('0x0'));module['exports']={'description':{'type':Sequelize[_0x3ab6('0x1')]},'name':{'type':Sequelize[_0x3ab6('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x3ab6('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3ab6('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3ab6('0x3')]},'markAsUnread':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3ab6('0x1')],'allowNull':![],'defaultValue':_0x3ab6('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x3ab6('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3ab6('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ab6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3ab6('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3ab6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3ab6('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3ab6('0x8'),'set':function(_0x2794f8){if(!_0x2794f8)this[_0x3ab6('0x9')](_0x3ab6('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x2794f8);}},'provider':{'type':Sequelize[_0x3ab6('0xb')](_0x3ab6('0xc'),_0x3ab6('0xd'),_0x3ab6('0xe'),_0x3ab6('0xf')),'defaultValue':null,'get':function(){if(!this[_0x3ab6('0x10')]('provider'))return _0x3ab6('0x11');return this['getDataValue'](_0x3ab6('0x12'));},'set':function(_0x1897d6){if(_0x1897d6===_0x3ab6('0x11'))_0x1897d6=null;return this[_0x3ab6('0x9')](_0x3ab6('0x12'),_0x1897d6);}}}; \ No newline at end of file +var _0xe876=['Arial,Helvetica,sans-serif','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','hotmail','yahoo','outlook365','provider','custom','getDataValue','sequelize','STRING','BOOLEAN','TEXT'];(function(_0x4449c1,_0x1c1edd){var _0x6c5b3=function(_0x343e2d){while(--_0x343e2d){_0x4449c1['push'](_0x4449c1['shift']());}};_0x6c5b3(++_0x1c1edd);}(_0xe876,0x6e));var _0x6e87=function(_0x3bfa96,_0x4e2873){_0x3bfa96=_0x3bfa96-0x0;var _0x487e09=_0xe876[_0x3bfa96];return _0x487e09;};'use strict';var Sequelize=require(_0x6e87('0x0'));module['exports']={'description':{'type':Sequelize[_0x6e87('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x6e87('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6e87('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x6e87('0x3')]},'markAsUnread':{'type':Sequelize[_0x6e87('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6e87('0x1')],'allowNull':![],'defaultValue':_0x6e87('0x4')},'fontSize':{'type':Sequelize[_0x6e87('0x5')](0x2)[_0x6e87('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6e87('0x7');}},'notificationSound':{'type':Sequelize[_0x6e87('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6e87('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e87('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e87('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x6e87('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6e87('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x45c68c){if(!_0x45c68c)this[_0x6e87('0x9')](_0x6e87('0xa'),null);this[_0x6e87('0x9')](_0x6e87('0xb'),_0x45c68c);}},'provider':{'type':Sequelize[_0x6e87('0xc')]('gmail',_0x6e87('0xd'),_0x6e87('0xe'),_0x6e87('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x6e87('0x10')))return _0x6e87('0x11');return this[_0x6e87('0x12')](_0x6e87('0x10'));},'set':function(_0xf7ff39){if(_0xf7ff39===_0x6e87('0x11'))_0xf7ff39=null;return this[_0x6e87('0x9')](_0x6e87('0x10'),_0xf7ff39);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 724edbc..69cbb02 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 _0xdfb8=['format','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','http','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','update','destroy','get','stack','name','yahoo','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','body','custom','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','sort','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','basename','getSmtpOptions','SendMail','sendMail','Contacts','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0xdfb8,0x192));var _0x8dfb=function(_0x45dbe3,_0xd2bf96){_0x45dbe3=_0x45dbe3-0x0;var _0x1e71cf=_0xdfb8[_0x45dbe3];return _0x1e71cf;};'use strict';var moment=require(_0x8dfb('0x0'));var BPromise=require(_0x8dfb('0x1'));var util=require(_0x8dfb('0x2'));var path=require(_0x8dfb('0x3'));var _=require(_0x8dfb('0x4'));var juice=require('juice');var Redis=require(_0x8dfb('0x5'));var qs=require(_0x8dfb('0x6'));var logger=require('../../config/logger')(_0x8dfb('0x7'));var config=require('../../config/environment');var db=require(_0x8dfb('0x8'))['db'];config[_0x8dfb('0x9')]=_[_0x8dfb('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8dfb('0xb'))(new Redis(config['redis']));require(_0x8dfb('0xc'))[_0x8dfb('0xd')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8dfb('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x2e14da,_0x834a23,_0x3307f7,_0x544438){return new BPromise(function(_0x3aca8b,_0x1dd552){var _0x25c1df=_0x544438||client;return _0x25c1df[_0x8dfb('0xf')](_0x2e14da,_0x3307f7)[_0x8dfb('0x10')](function(_0x299dc3){logger[_0x8dfb('0x11')]('MailAccount,\x20%s,\x20%s',_0x834a23,_0x8dfb('0x12'));logger['debug'](_0x8dfb('0x13'),_0x834a23,_0x8dfb('0x12'),JSON[_0x8dfb('0x14')](_0x299dc3));if(_0x299dc3[_0x8dfb('0x15')]){if(_0x299dc3['error']['code']===0x1f4){logger[_0x8dfb('0x15')]('MailAccount,\x20%s,\x20%s',_0x834a23,_0x299dc3[_0x8dfb('0x15')][_0x8dfb('0x16')]);return _0x1dd552(_0x299dc3[_0x8dfb('0x15')]['message']);}logger[_0x8dfb('0x15')](_0x8dfb('0x17'),_0x834a23,_0x299dc3[_0x8dfb('0x15')][_0x8dfb('0x16')]);return _0x3aca8b(_0x299dc3['error'][_0x8dfb('0x16')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x834a23,_0x8dfb('0x12'));_0x3aca8b(_0x299dc3[_0x8dfb('0x18')][_0x8dfb('0x16')]);}})[_0x8dfb('0x19')](function(_0x30ec9b){logger[_0x8dfb('0x15')](_0x8dfb('0x17'),_0x834a23,_0x30ec9b);_0x1dd552(_0x30ec9b);});});}function respondWithStatusCode(_0x5eca1b,_0x418e9a){_0x418e9a=_0x418e9a||0xcc;return function(_0x41689e){if(_0x41689e){return _0x5eca1b[_0x8dfb('0x1a')](_0x418e9a);}return _0x5eca1b[_0x8dfb('0x1b')](_0x418e9a)[_0x8dfb('0x1c')]();};}function respondWithResult(_0x102743,_0x2df391){_0x2df391=_0x2df391||0xc8;return function(_0x5b5b10){if(_0x5b5b10){return _0x102743[_0x8dfb('0x1b')](_0x2df391)['json'](_0x5b5b10);}};}function respondWithFilteredResult(_0x19f109,_0x5aecfa){return function(_0x3ffdcc){if(_0x3ffdcc){var _0x585aa8=typeof _0x5aecfa[_0x8dfb('0x1d')]===_0x8dfb('0x1e')&&typeof _0x5aecfa[_0x8dfb('0x1f')]===_0x8dfb('0x1e');var _0x91a2cb=_0x3ffdcc[_0x8dfb('0x20')];var _0x290d91=_0x585aa8?0x0:_0x5aecfa[_0x8dfb('0x1d')];var _0x372f28=_0x585aa8?_0x3ffdcc['count']:_0x5aecfa[_0x8dfb('0x1d')]+_0x5aecfa[_0x8dfb('0x1f')];var _0x5a65b1;if(_0x372f28>=_0x91a2cb){_0x372f28=_0x91a2cb;_0x5a65b1=0xc8;}else{_0x5a65b1=0xce;}_0x19f109[_0x8dfb('0x1b')](_0x5a65b1);return _0x19f109[_0x8dfb('0x21')]('Content-Range',_0x290d91+'-'+_0x372f28+'/'+_0x91a2cb)[_0x8dfb('0x22')](_0x3ffdcc);}return null;};}function saveUpdates(_0x2ec343){return function(_0x4e590d){if(_0x4e590d){return _0x4e590d[_0x8dfb('0x23')](_0x2ec343)[_0x8dfb('0x10')](function(_0x379f0f){return _0x379f0f;});}return null;};}function removeEntity(_0x435322){return function(_0xe3d615){if(_0xe3d615){return _0xe3d615[_0x8dfb('0x24')]()[_0x8dfb('0x10')](function(){var _0x4d30e1=_0xe3d615[_0x8dfb('0x25')]({'plain':!![]});var _0x58a6b2='MailAccounts';return db['UserProfileResource'][_0x8dfb('0x24')]({'where':{'type':_0x58a6b2,'resourceId':_0x4d30e1['id']}})[_0x8dfb('0x10')](function(){return _0xe3d615;});})[_0x8dfb('0x10')](function(){_0x435322['status'](0xcc)[_0x8dfb('0x1c')]();});}};}function handleEntityNotFound(_0x4598ac){return function(_0xf0e0c7){if(!_0xf0e0c7){_0x4598ac[_0x8dfb('0x1a')](0x194);}return _0xf0e0c7;};}function handleError(_0x1a7f7,_0x433ebf){_0x433ebf=_0x433ebf||0x1f4;return function(_0x4bf98a){logger[_0x8dfb('0x15')](_0x4bf98a[_0x8dfb('0x26')]);if(_0x4bf98a[_0x8dfb('0x27')]){delete _0x4bf98a['name'];}_0x1a7f7[_0x8dfb('0x1b')](_0x433ebf)['send'](_0x4bf98a);};}function getImapHost(_0x3ac8cc){switch(_0x3ac8cc){case'gmail':return'imap.gmail.com';case _0x8dfb('0x28'):return'imap.mail.yahoo.com';case _0x8dfb('0x29'):return _0x8dfb('0x2a');case _0x8dfb('0x2b'):return'outlook.office365.com';}throw new Error(_0x8dfb('0x2c'),_0x3ac8cc);}function getSmtpHost(_0x514d41){switch(_0x514d41){case _0x8dfb('0x2d'):return _0x8dfb('0x2e');case _0x8dfb('0x28'):return _0x8dfb('0x2f');case _0x8dfb('0x29'):return _0x8dfb('0x30');case _0x8dfb('0x2b'):return'smtp.office365.com';}throw new Error(_0x8dfb('0x2c'),_0x514d41);}function getAuthenticationOptions(_0x241a36,_0x1c6931){var _0x109d67={};var _0x498bc4={};if(_0x241a36){_0x109d67[_0x8dfb('0x31')]=_0x498bc4[_0x8dfb('0x31')]=_0x1c6931[_0x8dfb('0x32')];_0x109d67[_0x8dfb('0x33')]=_0x498bc4[_0x8dfb('0x34')]=_0x1c6931[_0x8dfb('0x33')];if(_0x1c6931[_0x8dfb('0x35')]){_0x109d67[_0x8dfb('0x35')]=_0x498bc4[_0x8dfb('0x35')]=!![];_0x109d67[_0x8dfb('0x36')]=_0x498bc4[_0x8dfb('0x36')]=_0x1c6931[_0x8dfb('0x36')];_0x109d67[_0x8dfb('0x33')]=_0x498bc4[_0x8dfb('0x34')]=null;}else{_0x109d67[_0x8dfb('0x36')]=_0x498bc4[_0x8dfb('0x36')]=null;}_0x109d67[_0x8dfb('0x37')]=getImapHost(_0x241a36);_0x109d67[_0x8dfb('0x38')]=0x3e1;_0x498bc4[_0x8dfb('0x37')]=getSmtpHost(_0x241a36);_0x498bc4['port']=0x24b;_0x498bc4[_0x8dfb('0x39')]=![];_0x109d67['service']=_0x498bc4[_0x8dfb('0x3a')]=null;}else{if(_0x1c6931[_0x8dfb('0x3b')]){_0x109d67[_0x8dfb('0x31')]=_0x498bc4[_0x8dfb('0x31')]=_0x1c6931[_0x8dfb('0x32')];_0x109d67[_0x8dfb('0x33')]=_0x498bc4[_0x8dfb('0x34')]=_0x1c6931['password'];}else{_0x109d67[_0x8dfb('0x3b')]=_0x498bc4['authentication']=![];_0x109d67[_0x8dfb('0x31')]=_0x498bc4[_0x8dfb('0x31')]=null;_0x109d67['password']=_0x498bc4[_0x8dfb('0x34')]=null;}_0x109d67[_0x8dfb('0x37')]=_0x1c6931[_0x8dfb('0x3c')][_0x8dfb('0x37')];_0x109d67[_0x8dfb('0x38')]=_0x1c6931[_0x8dfb('0x3c')][_0x8dfb('0x38')];_0x498bc4[_0x8dfb('0x37')]=_0x1c6931['Smtp']['host'];_0x498bc4[_0x8dfb('0x38')]=_0x1c6931[_0x8dfb('0x3d')][_0x8dfb('0x38')];}return{'Imap':_0x109d67,'Smtp':_0x498bc4};}exports['index']=function(_0x288eeb,_0x3beea9){var _0x5befd7={'include':[{'model':db[_0x8dfb('0x3e')],'as':_0x8dfb('0x3c')},{'model':db[_0x8dfb('0x3f')],'as':_0x8dfb('0x3d')},{'model':db[_0x8dfb('0x40')],'as':_0x8dfb('0x41')}]},_0x498f97={},_0x2387e0={'count':0x0,'rows':[]};var _0x5128eb=_[_0x8dfb('0x42')](db[_0x8dfb('0x43')][_0x8dfb('0x44')],function(_0x5f43c6){return{'name':_0x5f43c6[_0x8dfb('0x45')],'type':_0x5f43c6[_0x8dfb('0x46')][_0x8dfb('0x47')]};});_0x498f97[_0x8dfb('0x48')]=_[_0x8dfb('0x42')](_0x5128eb,_0x8dfb('0x27'));_0x498f97[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x288eeb[_0x8dfb('0x49')]);_0x498f97[_0x8dfb('0x4b')]=_['intersection'](_0x498f97[_0x8dfb('0x48')],_0x498f97[_0x8dfb('0x49')]);_0x5befd7['attributes']=_[_0x8dfb('0x4c')](_0x498f97[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x5befd7[_0x8dfb('0x4e')]=_0x5befd7[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x5befd7[_0x8dfb('0x4e')]:_0x498f97['model'];if(!_0x288eeb[_0x8dfb('0x49')]['hasOwnProperty'](_0x8dfb('0x50'))){_0x5befd7[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x288eeb[_0x8dfb('0x49')]['limit']);_0x5befd7[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x1d')]);}_0x5befd7[_0x8dfb('0x51')]=qs['sort'](_0x288eeb[_0x8dfb('0x49')]['sort']);_0x5befd7[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x288eeb[_0x8dfb('0x49')],_0x498f97['filters']),_0x5128eb);if(_0x288eeb[_0x8dfb('0x49')]['filter']){_0x5befd7[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0x5befd7['where'],{'$or':_[_0x8dfb('0x42')](_0x5128eb,function(_0x968cc6){if(_0x968cc6[_0x8dfb('0x46')]!==_0x8dfb('0x55')){var _0x4b3c2f={};_0x4b3c2f[_0x968cc6['name']]={'$like':'%'+_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0x4b3c2f;}})});}_0x5befd7=_[_0x8dfb('0x54')]({},_0x5befd7,_0x288eeb['options']);var _0x170958={'where':_0x5befd7[_0x8dfb('0x52')]};return db[_0x8dfb('0x43')][_0x8dfb('0x20')](_0x170958)[_0x8dfb('0x10')](function(_0x49e4c0){_0x2387e0['count']=_0x49e4c0;if(_0x288eeb[_0x8dfb('0x49')][_0x8dfb('0x57')]){_0x5befd7[_0x8dfb('0x58')]=[{'all':!![]}];}return db[_0x8dfb('0x43')][_0x8dfb('0x59')](_0x5befd7);})['then'](function(_0x51514d){_0x2387e0[_0x8dfb('0x5a')]=_0x51514d;return _0x2387e0;})[_0x8dfb('0x10')](respondWithFilteredResult(_0x3beea9,_0x5befd7))[_0x8dfb('0x19')](handleError(_0x3beea9,null));};exports[_0x8dfb('0x5b')]=function(_0xdbf6ad,_0x1e4721){var _0x4c3951={'raw':![],'where':{'id':_0xdbf6ad[_0x8dfb('0x5c')]['id']},'include':[{'model':db[_0x8dfb('0x3e')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x8dfb('0x40')],'as':_0x8dfb('0x41')}]},_0xb5f0ff={};_0xb5f0ff[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db[_0x8dfb('0x43')][_0x8dfb('0x44')]);_0xb5f0ff['query']=_[_0x8dfb('0x4a')](_0xdbf6ad[_0x8dfb('0x49')]);_0xb5f0ff[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0xb5f0ff[_0x8dfb('0x48')],_0xb5f0ff[_0x8dfb('0x49')]);_0x4c3951[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0xb5f0ff[_0x8dfb('0x48')],qs['fields'](_0xdbf6ad[_0x8dfb('0x49')]['fields']));_0x4c3951[_0x8dfb('0x4e')]=_0x4c3951[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x4c3951[_0x8dfb('0x4e')]:_0xb5f0ff[_0x8dfb('0x48')];if(_0xdbf6ad['query'][_0x8dfb('0x57')]){_0x4c3951[_0x8dfb('0x58')]=[{'all':!![]}];}_0x4c3951=_[_0x8dfb('0x54')]({},_0x4c3951,_0xdbf6ad[_0x8dfb('0x5d')]);return db[_0x8dfb('0x43')][_0x8dfb('0x5e')](_0x4c3951)[_0x8dfb('0x10')](handleEntityNotFound(_0x1e4721,null))['then'](respondWithResult(_0x1e4721,null))[_0x8dfb('0x19')](handleError(_0x1e4721,null));};exports[_0x8dfb('0x23')]=function(_0x5e1257,_0x415b3d){if(_0x5e1257[_0x8dfb('0x5f')]['id']){delete _0x5e1257[_0x8dfb('0x5f')]['id'];}var _0x44b90a=_0x5e1257[_0x8dfb('0x5f')]['provider']===_0x8dfb('0x60')?null:_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x61')];var _0x117351=_0x5e1257['body'][_0x8dfb('0x3c')]||{};var _0x114099=_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3d')]||{};if(_0x44b90a){_0x117351[_0x8dfb('0x37')]=getImapHost(_0x44b90a);_0x117351['port']=0x3e1;_0x114099[_0x8dfb('0x37')]=getSmtpHost(_0x44b90a);_0x114099[_0x8dfb('0x38')]=0x24b;_0x114099[_0x8dfb('0x39')]=![];}if(_0x114099['modernAuthentication']){_0x114099[_0x8dfb('0x39')]=![];}else{_0x114099[_0x8dfb('0x36')]=null;}if(!_0x117351['modernAuthentication'])_0x117351[_0x8dfb('0x36')]=null;_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3c')]=_0x117351;_0x5e1257['body'][_0x8dfb('0x3d')]=_0x114099;return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x5e1257[_0x8dfb('0x5c')]['id']},'include':[{'model':db[_0x8dfb('0x3e')],'as':_0x8dfb('0x3c')},{'model':db[_0x8dfb('0x3f')],'as':'Smtp'},{'model':db[_0x8dfb('0x40')],'as':_0x8dfb('0x41')}]})[_0x8dfb('0x10')](handleEntityNotFound(_0x415b3d,null))[_0x8dfb('0x10')](function(_0x4f0b48){if(!_0x4f0b48)throw new Error(_0x8dfb('0x62'));if(_0x4f0b48[_0x8dfb('0x3a')])delete _0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3c')];return _0x4f0b48;})['then'](saveUpdates(_0x5e1257[_0x8dfb('0x5f')],null))[_0x8dfb('0x10')](function(_0xfe14f1){if(!_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3c')])return _0xfe14f1;return db['MailServerIn'][_0x8dfb('0x23')](_0x5e1257['body']['Imap'],{'where':{'MailAccountId':_0xfe14f1['id']}})['then'](function(){return _0xfe14f1;});})[_0x8dfb('0x10')](function(_0x4596ed){if(!_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3d')])return _0x4596ed;return db['MailServerOut'][_0x8dfb('0x23')](_0x5e1257[_0x8dfb('0x5f')][_0x8dfb('0x3d')],{'where':{'MailAccountId':_0x4596ed['id']}})[_0x8dfb('0x10')](function(){return _0x4596ed;});})[_0x8dfb('0x10')](respondWithResult(_0x415b3d,null))['catch'](handleError(_0x415b3d,null));};exports[_0x8dfb('0x63')]=function(_0x154451,_0x489ed6){return db[_0x8dfb('0x43')][_0x8dfb('0x63')]()[_0x8dfb('0x10')](respondWithResult(_0x489ed6,null))[_0x8dfb('0x19')](handleError(_0x489ed6,null));};exports[_0x8dfb('0x64')]=function(_0x4edc77,_0xb2d399){if(_0x4edc77[_0x8dfb('0x5f')]['id']){delete _0x4edc77[_0x8dfb('0x5f')]['id'];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x4edc77[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0xb2d399,null))['then'](function(_0x18070b){if(_0x18070b){_0x4edc77[_0x8dfb('0x5f')][_0x8dfb('0x65')]=_0x18070b['id'];return db[_0x8dfb('0x66')][_0x8dfb('0x67')](_0x4edc77['body']);}})[_0x8dfb('0x10')](respondWithResult(_0xb2d399,null))[_0x8dfb('0x19')](handleError(_0xb2d399,null));};exports[_0x8dfb('0x68')]=function(_0x42d975,_0x27dff0){var _0x5c8b48={'raw':![],'where':{}};var _0x29e855={};var _0x1daf66={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x42d975[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x27dff0,null))['then'](function(_0x4535b3){if(_0x4535b3){_0x29e855[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db[_0x8dfb('0x66')][_0x8dfb('0x44')]);_0x29e855[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x42d975[_0x8dfb('0x49')]);_0x29e855[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0x29e855[_0x8dfb('0x48')],_0x29e855['query']);_0x5c8b48[_0x8dfb('0x4e')]=_['intersection'](_0x29e855[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x5c8b48[_0x8dfb('0x4e')]=_0x5c8b48[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x5c8b48[_0x8dfb('0x4e')]:_0x29e855[_0x8dfb('0x48')];if(!_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x5c8b48[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x42d975['query'][_0x8dfb('0x1f')]);_0x5c8b48[_0x8dfb('0x1d')]=qs['offset'](_0x42d975['query'][_0x8dfb('0x1d')]);}_0x5c8b48[_0x8dfb('0x51')]=qs[_0x8dfb('0x6b')](_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x5c8b48['where']=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x42d975['query'],_0x29e855[_0x8dfb('0x4b')]));_0x5c8b48['where'][_0x8dfb('0x65')]=_0x4535b3['id'];if(_0x42d975[_0x8dfb('0x49')]['filter']){_0x5c8b48[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0x5c8b48[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0x5c8b48['attributes'],function(_0x3eae93){var _0x382ec1={};_0x382ec1[_0x3eae93]={'$like':'%'+_0x42d975[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0x382ec1;})});}_0x5c8b48=_[_0x8dfb('0x54')]({},_0x5c8b48,_0x42d975[_0x8dfb('0x5d')]);return db[_0x8dfb('0x66')][_0x8dfb('0x20')]({'where':_0x5c8b48['where']})[_0x8dfb('0x10')](function(_0x3b045d){_0x1daf66[_0x8dfb('0x20')]=_0x3b045d;if(_0x42d975['query'][_0x8dfb('0x57')]){_0x5c8b48['include']=[{'all':!![]}];}return db[_0x8dfb('0x66')]['findAll'](_0x5c8b48);})['then'](function(_0x23e91e){_0x1daf66['rows']=_0x23e91e;return _0x1daf66;});}})[_0x8dfb('0x10')](respondWithFilteredResult(_0x27dff0,_0x5c8b48))[_0x8dfb('0x19')](handleError(_0x27dff0,null));};exports[_0x8dfb('0x6c')]=function(_0x4cb6e2,_0x399b82){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x4cb6e2[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x399b82,null))[_0x8dfb('0x10')](function(_0x2d9cb1){if(_0x2d9cb1){return _0x2d9cb1['removeDispositions'](_0x4cb6e2[_0x8dfb('0x49')][_0x8dfb('0x6d')]);}})[_0x8dfb('0x10')](respondWithStatusCode(_0x399b82,null))[_0x8dfb('0x19')](handleError(_0x399b82,null));};exports['addAnswer']=function(_0x581d8c,_0xa91c1b){if(_0x581d8c[_0x8dfb('0x5f')]['id']){delete _0x581d8c[_0x8dfb('0x5f')]['id'];}return db['MailAccount'][_0x8dfb('0x5e')]({'where':{'id':_0x581d8c[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0xa91c1b,null))[_0x8dfb('0x10')](function(_0x2c1c0b){if(_0x2c1c0b){_0x581d8c['body']['MailAccountId']=_0x2c1c0b['id'];return db[_0x8dfb('0x6e')][_0x8dfb('0x67')](_0x581d8c[_0x8dfb('0x5f')]);}})['then'](respondWithResult(_0xa91c1b,null))[_0x8dfb('0x19')](handleError(_0xa91c1b,null));};exports[_0x8dfb('0x6f')]=function(_0x1cbf1d,_0x3357e0){var _0x2d86f1={'raw':![],'where':{}};var _0x21c7ec={};var _0x162574={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x1cbf1d[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x3357e0,null))['then'](function(_0x54ba9d){if(_0x54ba9d){_0x21c7ec[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db[_0x8dfb('0x6e')][_0x8dfb('0x44')]);_0x21c7ec[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x1cbf1d['query']);_0x21c7ec[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0x21c7ec[_0x8dfb('0x48')],_0x21c7ec[_0x8dfb('0x49')]);_0x2d86f1[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0x21c7ec[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x1cbf1d[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x2d86f1[_0x8dfb('0x4e')]=_0x2d86f1[_0x8dfb('0x4e')]['length']?_0x2d86f1[_0x8dfb('0x4e')]:_0x21c7ec['model'];if(!_0x1cbf1d['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x2d86f1[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x1cbf1d['query']['limit']);_0x2d86f1[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x1cbf1d[_0x8dfb('0x49')]['offset']);}_0x2d86f1[_0x8dfb('0x51')]=qs['sort'](_0x1cbf1d[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x2d86f1[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x1cbf1d['query'],_0x21c7ec[_0x8dfb('0x4b')]));_0x2d86f1[_0x8dfb('0x52')][_0x8dfb('0x65')]=_0x54ba9d['id'];if(_0x1cbf1d['query'][_0x8dfb('0x56')]){_0x2d86f1[_0x8dfb('0x52')]=_['merge'](_0x2d86f1[_0x8dfb('0x52')],{'$or':_['map'](_0x2d86f1[_0x8dfb('0x4e')],function(_0x1747c9){var _0x2b9a20={};_0x2b9a20[_0x1747c9]={'$like':'%'+_0x1cbf1d[_0x8dfb('0x49')]['filter']+'%'};return _0x2b9a20;})});}_0x2d86f1=_[_0x8dfb('0x54')]({},_0x2d86f1,_0x1cbf1d[_0x8dfb('0x5d')]);return db[_0x8dfb('0x6e')][_0x8dfb('0x20')]({'where':_0x2d86f1[_0x8dfb('0x52')]})[_0x8dfb('0x10')](function(_0xbe1d91){_0x162574[_0x8dfb('0x20')]=_0xbe1d91;if(_0x1cbf1d['query'][_0x8dfb('0x57')]){_0x2d86f1[_0x8dfb('0x58')]=[{'all':!![]}];}return db[_0x8dfb('0x6e')]['findAll'](_0x2d86f1);})[_0x8dfb('0x10')](function(_0x48a966){_0x162574[_0x8dfb('0x5a')]=_0x48a966;return _0x162574;});}})[_0x8dfb('0x10')](respondWithFilteredResult(_0x3357e0,_0x2d86f1))[_0x8dfb('0x19')](handleError(_0x3357e0,null));};exports[_0x8dfb('0x70')]=function(_0x36bf8a,_0x2b0d00){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x36bf8a[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x2b0d00,null))[_0x8dfb('0x10')](function(_0x13cf50){if(_0x13cf50){return _0x13cf50[_0x8dfb('0x70')](_0x36bf8a[_0x8dfb('0x49')]['ids']);}})[_0x8dfb('0x10')](respondWithStatusCode(_0x2b0d00,null))[_0x8dfb('0x19')](handleError(_0x2b0d00,null));};exports[_0x8dfb('0x67')]=function(_0x2153e0,_0x5402c6){var _0x30ad07={'name':_0x2153e0['body'][_0x8dfb('0x27')],'key':_0x2153e0[_0x8dfb('0x5f')]['key'],'provider':_0x2153e0['body'][_0x8dfb('0x61')]===_0x8dfb('0x60')?null:_0x2153e0['body']['provider'],'email':_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x71')],'ListId':_0x2153e0['body'][_0x8dfb('0x72')],'active':!_[_0x8dfb('0x73')](_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x74')])?_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x74')]:!![],'description':_0x2153e0[_0x8dfb('0x5f')][_0x8dfb('0x75')]||null};var _0x4b59cf=getAuthenticationOptions(_0x30ad07[_0x8dfb('0x61')],_0x2153e0[_0x8dfb('0x5f')]);_0x30ad07[_0x8dfb('0x3c')]=_0x4b59cf[_0x8dfb('0x3c')];_0x30ad07[_0x8dfb('0x3d')]=_0x4b59cf[_0x8dfb('0x3d')];return db[_0x8dfb('0x43')]['create'](_0x30ad07,{'include':[{'model':db['MailServerOut'],'as':_0x8dfb('0x3d')},{'model':db[_0x8dfb('0x3e')],'as':_0x8dfb('0x3c')}]})[_0x8dfb('0x10')](function(_0x20437c){var _0x18be6e=_0x2153e0[_0x8dfb('0x31')]['get']({'plain':!![]});if(!_0x18be6e)throw new Error(_0x8dfb('0x76'));if(_0x18be6e[_0x8dfb('0x77')]===_0x8dfb('0x31')){var _0x30c259=_0x20437c['get']({'plain':!![]});return db[_0x8dfb('0x78')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x18be6e['userProfileId']},'raw':!![]})['then'](function(_0x2851bd){if(_0x2851bd&&_0x2851bd[_0x8dfb('0x79')]===0x0){return db[_0x8dfb('0x7a')][_0x8dfb('0x67')]({'name':_0x30c259[_0x8dfb('0x27')],'resourceId':_0x30c259['id'],'type':_0x2851bd[_0x8dfb('0x27')],'sectionId':_0x2851bd['id']},{})[_0x8dfb('0x10')](function(){return _0x20437c;});}else{return _0x20437c;}})[_0x8dfb('0x19')](function(_0x772872){logger[_0x8dfb('0x15')](_0x8dfb('0x7b'),_0x772872);throw _0x772872;});}return _0x20437c;})['then'](respondWithResult(_0x5402c6,0xc9))[_0x8dfb('0x19')](handleError(_0x5402c6,null));};exports[_0x8dfb('0x7c')]=function(_0x2cd51f,_0x390323){return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x2cd51f[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x390323,null))[_0x8dfb('0x10')](function(_0x5f9856){if(_0x5f9856){return _0x5f9856['getImap']();}return null;})[_0x8dfb('0x10')](respondWithResult(_0x390323,null))[_0x8dfb('0x19')](handleError(_0x390323,null));};exports[_0x8dfb('0x7d')]=function(_0x1b9e8d,_0x4bddd7){if(_0x1b9e8d['body']['id']){delete _0x1b9e8d[_0x8dfb('0x5f')]['id'];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x1b9e8d['params']['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x4bddd7,null))[_0x8dfb('0x10')](function(_0x1ba68b){if(_0x1ba68b){_0x1b9e8d[_0x8dfb('0x5f')][_0x8dfb('0x65')]=_0x1ba68b['id'];return db[_0x8dfb('0x3e')][_0x8dfb('0x67')](_0x1b9e8d[_0x8dfb('0x5f')]);}})['then'](respondWithResult(_0x4bddd7,null))[_0x8dfb('0x19')](handleError(_0x4bddd7,null));};exports[_0x8dfb('0x7e')]=function(_0x5b7be0,_0x1015e4){return db[_0x8dfb('0x43')]['findOne']({'where':{'id':_0x5b7be0[_0x8dfb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1015e4,null))[_0x8dfb('0x10')](function(_0x580788){if(_0x580788){return _0x580788['setImap'](null);}return null;})[_0x8dfb('0x10')](respondWithStatusCode(_0x1015e4,null))[_0x8dfb('0x19')](handleError(_0x1015e4,null));};exports[_0x8dfb('0x7f')]=function(_0x2a2c4b,_0x2a2d25){return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x2a2c4b[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x2a2d25,null))[_0x8dfb('0x10')](function(_0x25e96c){if(_0x25e96c){return _0x25e96c[_0x8dfb('0x7f')]();}return null;})[_0x8dfb('0x10')](respondWithResult(_0x2a2d25,null))[_0x8dfb('0x19')](handleError(_0x2a2d25,null));};exports[_0x8dfb('0x80')]=function(_0x406b58,_0x57a69c){if(_0x406b58[_0x8dfb('0x5f')]['id']){delete _0x406b58[_0x8dfb('0x5f')]['id'];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x406b58['params']['id']}})['then'](handleEntityNotFound(_0x57a69c,null))['then'](function(_0x145a16){if(_0x145a16){_0x406b58[_0x8dfb('0x5f')][_0x8dfb('0x65')]=_0x145a16['id'];return db[_0x8dfb('0x3f')]['create'](_0x406b58[_0x8dfb('0x5f')]);}})['then'](respondWithResult(_0x57a69c,null))[_0x8dfb('0x19')](handleError(_0x57a69c,null));};exports[_0x8dfb('0x81')]=function(_0xc5d8c8,_0xd838c6){return db[_0x8dfb('0x43')]['findOne']({'where':{'id':_0xc5d8c8[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0xd838c6,null))[_0x8dfb('0x10')](function(_0x20b8f0){if(_0x20b8f0){return _0x20b8f0[_0x8dfb('0x82')](null);}return null;})['then'](respondWithStatusCode(_0xd838c6,null))[_0x8dfb('0x19')](handleError(_0xd838c6,null));};exports[_0x8dfb('0x83')]=function(_0x29686b,_0x155536){return db[_0x8dfb('0x84')]['find']({'where':{'id':_0x29686b[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x155536,null))['then'](function(_0x5126c8){if(_0x5126c8){return _0x5126c8[_0x8dfb('0x83')](_0x29686b['body']['ids'],_[_0x8dfb('0x85')](_0x29686b[_0x8dfb('0x5f')],[_0x8dfb('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x155536,null))[_0x8dfb('0x19')](handleError(_0x155536,null));};exports[_0x8dfb('0x86')]=function(_0x1f6247,_0x50d0c3){var _0x9234bb={'raw':![],'where':{}};var _0x2822df={};var _0x5b85aa={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')]['findOne']({'where':{'id':_0x1f6247[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x50d0c3,null))['then'](function(_0x380f9f){if(_0x380f9f){_0x2822df[_0x8dfb('0x48')]=_['keys'](db[_0x8dfb('0x84')][_0x8dfb('0x44')]);_0x2822df[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x1f6247['query']);_0x2822df['filters']=_[_0x8dfb('0x4c')](_0x2822df[_0x8dfb('0x48')],_0x2822df['query']);_0x9234bb[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0x2822df[_0x8dfb('0x48')],qs['fields'](_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x9234bb[_0x8dfb('0x4e')]=_0x9234bb[_0x8dfb('0x4e')]['length']?_0x9234bb[_0x8dfb('0x4e')]:_0x2822df[_0x8dfb('0x48')];if(!_0x1f6247['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x9234bb['limit']=qs[_0x8dfb('0x1f')](_0x1f6247[_0x8dfb('0x49')]['limit']);_0x9234bb[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x1d')]);}_0x9234bb['order']=qs['sort'](_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x9234bb[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x1f6247[_0x8dfb('0x49')],_0x2822df[_0x8dfb('0x4b')]));_0x9234bb['where'][_0x8dfb('0x65')]=_0x380f9f['id'];if(_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0x9234bb[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0x9234bb[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0x9234bb[_0x8dfb('0x4e')],function(_0x4d6bce){var _0xdf7fa9={};_0xdf7fa9[_0x4d6bce]={'$like':'%'+_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0xdf7fa9;})});}_0x9234bb=_[_0x8dfb('0x54')]({},_0x9234bb,_0x1f6247[_0x8dfb('0x5d')]);return db['MailInteraction'][_0x8dfb('0x20')]({'where':_0x9234bb[_0x8dfb('0x52')]})[_0x8dfb('0x10')](function(_0x246c1d){_0x5b85aa[_0x8dfb('0x20')]=_0x246c1d;if(_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x57')]){_0x9234bb[_0x8dfb('0x58')]=[{'model':db[_0x8dfb('0x87')],'as':_0x8dfb('0x88'),'required':![]},{'model':db[_0x8dfb('0x89')],'as':_0x8dfb('0x8a'),'attributes':[_0x8dfb('0x27'),_0x8dfb('0x8b'),_0x8dfb('0x8c')],'required':![]},{'model':db[_0x8dfb('0x8d')],'as':_0x8dfb('0x8e'),'attributes':['id','name',_0x8dfb('0x8f')],'where':_0x1f6247['query'][_0x8dfb('0x90')]?{'id':_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x90')]}:undefined,'required':_0x1f6247[_0x8dfb('0x49')][_0x8dfb('0x90')]?!![]:![]}];}return db[_0x8dfb('0x84')]['findAll'](_0x9234bb);})[_0x8dfb('0x10')](function(_0x2eeb1d){_0x5b85aa['rows']=_0x2eeb1d;return _0x5b85aa;});}})['then'](respondWithFilteredResult(_0x50d0c3,_0x9234bb))['catch'](handleError(_0x50d0c3,null));};exports[_0x8dfb('0x91')]=function addApplications(_0x177e08,_0x5dfb7c){var _0x59e762=_0x177e08[_0x8dfb('0x5c')]['id'];var _0x2c5e89=_0x177e08[_0x8dfb('0x5f')];var _0x1e7e95=0xc8;var _0x4dac4e=null;return db[_0x8dfb('0x92')]['transaction']({'isolationLevel':db[_0x8dfb('0x92')]['Transaction'][_0x8dfb('0x93')][_0x8dfb('0x94')]},function(_0x52d254){return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x59e762},'transaction':_0x52d254})[_0x8dfb('0x10')](function(_0x41b9d8){if(_0x41b9d8){return db['MailApplication'][_0x8dfb('0x24')]({'where':{'MailAccountId':_0x59e762},'transaction':_0x52d254})[_0x8dfb('0x10')](function(){var _0x48e775=_['map'](_0x2c5e89,function(_0x59f5f6){_0x59f5f6[_0x8dfb('0x65')]=_0x59e762;return _0x59f5f6;});return db[_0x8dfb('0x95')][_0x8dfb('0x96')](_0x48e775,{'transaction':_0x52d254});});}else{_0x1e7e95=0x194;_0x4dac4e=[];}});})[_0x8dfb('0x10')](function(){if(_0x1e7e95!==0x194){return db[_0x8dfb('0x95')][_0x8dfb('0x97')]({'where':{'MailAccountId':_0x59e762},'order':_0x8dfb('0x98')})[_0x8dfb('0x10')](function(_0x5d5b98){_0x4dac4e=_0x5d5b98;});}})[_0x8dfb('0x19')](function(_0x482b90){_0x1e7e95=0x1f4;logger[_0x8dfb('0x15')](_0x482b90[_0x8dfb('0x26')]);if(_0x482b90['name']){delete _0x482b90['name'];}_0x4dac4e=_0x482b90;})[_0x8dfb('0x99')](function(){if(_0x4dac4e===null){_0x5dfb7c['sendStatus'](_0x1e7e95);}else{if(_0x1e7e95===0x1f4){_0x5dfb7c['status'](_0x1e7e95)[_0x8dfb('0x9a')](_0x4dac4e);}else{_0x5dfb7c[_0x8dfb('0x1b')](_0x1e7e95)[_0x8dfb('0x22')](_0x4dac4e);}}});};exports[_0x8dfb('0x9b')]=function(_0x11078d,_0x33ab2e){var _0xb511d6={};var _0x259c79={};var _0x5c95fd;var _0x1b4850;return db['MailAccount'][_0x8dfb('0x69')]({'where':{'id':_0x11078d[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x33ab2e,null))[_0x8dfb('0x10')](function(_0x59b293){if(_0x59b293){_0x5c95fd=_0x59b293;_0x259c79['model']=_[_0x8dfb('0x4a')](db[_0x8dfb('0x95')][_0x8dfb('0x44')]);_0x259c79['query']=_[_0x8dfb('0x4a')](_0x11078d[_0x8dfb('0x49')]);_0x259c79[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0x259c79[_0x8dfb('0x48')],_0x259c79[_0x8dfb('0x49')]);_0xb511d6[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0x259c79[_0x8dfb('0x48')],qs[_0x8dfb('0x4d')](_0x11078d[_0x8dfb('0x49')]['fields']));_0xb511d6[_0x8dfb('0x4e')]=_0xb511d6[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0xb511d6['attributes']:_0x259c79[_0x8dfb('0x48')];_0xb511d6[_0x8dfb('0x51')]=qs[_0x8dfb('0x6b')](_0x11078d['query']['sort']);_0xb511d6[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x11078d[_0x8dfb('0x49')],_0x259c79['filters']));if(_0x11078d[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0xb511d6[_0x8dfb('0x52')]=_[_0x8dfb('0x54')](_0xb511d6[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0xb511d6[_0x8dfb('0x4e')],function(_0x47d2d8){var _0x1af136={};_0x1af136[_0x47d2d8]={'$like':'%'+_0x11078d[_0x8dfb('0x49')]['filter']+'%'};return _0x1af136;})});}_0xb511d6=_[_0x8dfb('0x54')]({},_0xb511d6,_0x11078d['options']);return _0x5c95fd[_0x8dfb('0x9b')](_0xb511d6);}})[_0x8dfb('0x10')](function(_0x424846){if(_0x424846){_0x1b4850=_0x424846[_0x8dfb('0x4f')];if(!_0x11078d[_0x8dfb('0x49')][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0xb511d6[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x11078d['query'][_0x8dfb('0x1f')]);_0xb511d6[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x11078d['query'][_0x8dfb('0x1d')]);}return _0x5c95fd['getApplications'](_0xb511d6);}})[_0x8dfb('0x10')](function(_0x5938e1){if(_0x5938e1){return _0x5938e1?{'count':_0x1b4850,'rows':_0x5938e1}:null;}})['then'](respondWithResult(_0x33ab2e,null))[_0x8dfb('0x19')](handleError(_0x33ab2e,null));};exports[_0x8dfb('0x9c')]=function(_0x41e2b6,_0x3fa041){var _0xee7599={'raw':!![],'where':{}};var _0xc6e186={};var _0x3598f4={'count':0x0,'rows':[]};return db[_0x8dfb('0x43')][_0x8dfb('0x69')]({'where':{'id':_0x41e2b6[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x3fa041,null))[_0x8dfb('0x10')](function(_0xb3958f){if(_0xb3958f){_0xc6e186['model']=_[_0x8dfb('0x4a')](db[_0x8dfb('0x9d')]['rawAttributes']);_0xc6e186[_0x8dfb('0x49')]=_['keys'](_0x41e2b6[_0x8dfb('0x49')]);_0xc6e186[_0x8dfb('0x4b')]=_[_0x8dfb('0x4c')](_0xc6e186[_0x8dfb('0x48')],_0xc6e186['query']);_0xee7599[_0x8dfb('0x4e')]=_[_0x8dfb('0x4c')](_0xc6e186['model'],qs[_0x8dfb('0x4d')](_0x41e2b6['query'][_0x8dfb('0x4d')]));_0xee7599[_0x8dfb('0x4e')]=_0xee7599['attributes']['length']?_0xee7599[_0x8dfb('0x4e')]:_0xc6e186[_0x8dfb('0x48')];if(!_0x41e2b6['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0xee7599[_0x8dfb('0x1f')]=qs['limit'](_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x1f')]);_0xee7599[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x41e2b6['query'][_0x8dfb('0x1d')]);}_0xee7599[_0x8dfb('0x51')]=qs[_0x8dfb('0x6b')](_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0xee7599[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x41e2b6[_0x8dfb('0x49')],_0xc6e186['filters']));_0xee7599[_0x8dfb('0x52')][_0x8dfb('0x65')]=_0xb3958f['id'];if(_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0xee7599['where']=_[_0x8dfb('0x54')](_0xee7599[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0xee7599[_0x8dfb('0x4e')],function(_0x5b61e3){var _0x43a6e3={};_0x43a6e3[_0x5b61e3]={'$like':'%'+_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0x43a6e3;})});}if(_0x41e2b6['query']['$gte']){var _0x48288c=_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x9e')][_0x8dfb('0x9f')](',');var _0x57345f={};_0x57345f[_0x48288c[0x0]]={'$gte':moment(_0x48288c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0xee7599[_0x8dfb('0x52')]=_['merge'](_0xee7599[_0x8dfb('0x52')],_0x57345f);}_0xee7599=_[_0x8dfb('0x54')]({},_0xee7599,_0x41e2b6['options']);return db['MailMessage']['count']({'where':_0xee7599[_0x8dfb('0x52')]})[_0x8dfb('0x10')](function(_0x2e48b8){_0x3598f4[_0x8dfb('0x20')]=_0x2e48b8;if(_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0x57')]){_0xee7599[_0x8dfb('0x58')]=[{'all':!![]}];}return db[_0x8dfb('0x9d')][_0x8dfb('0x59')](_0xee7599);})[_0x8dfb('0x10')](function(_0x34653c){if(_0x41e2b6[_0x8dfb('0x49')][_0x8dfb('0xa0')]===_0x8dfb('0xa1')){for(var _0x3136b7=0x0;_0x3136b7<_0x34653c[_0x8dfb('0x4f')];_0x3136b7++){_0x34653c[_0x3136b7][_0x8dfb('0x5f')]=juice(_0x34653c[_0x3136b7][_0x8dfb('0x5f')]);}}_0x3598f4[_0x8dfb('0x5a')]=_0x34653c;return _0x3598f4;});}})['then'](respondWithFilteredResult(_0x3fa041,_0xee7599))[_0x8dfb('0x19')](handleError(_0x3fa041,null));};exports[_0x8dfb('0x9a')]=function(_0x3ee438,_0x3c3e43){var _0x3f1374,_0x401f77={},_0x3c4a07;if(_0x3ee438[_0x8dfb('0x5f')]['to']){_0x3c4a07=_0x3ee438[_0x8dfb('0x5f')]['to']['split'](',')[0x0];}return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x3ee438[_0x8dfb('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x8dfb('0xa2'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x3c4a07},'limit':0x1,'order':[[_0x8dfb('0xa3'),_0x8dfb('0xa4')]]}]},{'model':db[_0x8dfb('0x3f')],'as':_0x8dfb('0x3d'),'raw':!![],'include':[{'model':db[_0x8dfb('0xa5')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x3c3e43,null))['then'](function(_0x4842e6){if(!_0x4842e6)return;_0x3f1374=_0x4842e6;if(!_0x4842e6[_0x8dfb('0x3d')])throw new Error(_0x8dfb('0xa6'));if(_[_0x8dfb('0x73')](_0x3ee438['body'][_0x8dfb('0xa7')])){_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xa7')]=util['format'](_0x8dfb('0xa8'),_0x4842e6[_0x8dfb('0x27')],_0x4842e6[_0x8dfb('0x71')]||_0x4842e6[_0x8dfb('0x3d')][_0x8dfb('0x31')]);}if(_0x3ee438['body'][_0x8dfb('0xa9')]&&_0x3ee438['body'][_0x8dfb('0xa9')][_0x8dfb('0x4f')]){for(var _0x1c16e5=0x0;_0x1c16e5<_0x3ee438['body']['attachments']['length'];_0x1c16e5+=0x1){_0x3ee438['body'][_0x8dfb('0xa9')][_0x1c16e5]={'filename':_0x3ee438['body'][_0x8dfb('0xa9')][_0x1c16e5][_0x8dfb('0x27')],'path':path[_0x8dfb('0xaa')](config['root'],'server/files/attachments',_0x3ee438[_0x8dfb('0x5f')]['attachments'][_0x1c16e5][_0x8dfb('0xab')])};}}var _0x78d193=_0x4842e6[_0x8dfb('0xac')]();return respondWithRpcPromise(_0x8dfb('0xad'),_0x8dfb('0xae'),{'account':_0x78d193,'message':_0x3ee438[_0x8dfb('0x5f')]});})['then'](function(_0x503109){if(!_0x503109)return;_0x401f77=_0x503109;if(!_0x3f1374[_0x8dfb('0xa2')])throw new Error('List\x20not\x20found');if(_0x3f1374[_0x8dfb('0xa2')][_0x8dfb('0xaf')][_0x8dfb('0x4f')])return _0x3f1374[_0x8dfb('0xa2')][_0x8dfb('0xaf')][0x0];return db[_0x8dfb('0x87')][_0x8dfb('0x67')](_[_0x8dfb('0xa')](_0x3ee438[_0x8dfb('0x5f')],{'firstName':_0x3ee438[_0x8dfb('0x5f')]['to'],'email':_0x3ee438['body']['to'],'phone':_0x3ee438[_0x8dfb('0x5f')]['to'],'ListId':_0x3f1374[_0x8dfb('0x72')]}));})[_0x8dfb('0x10')](function(_0x21c8f4){if(!_0x21c8f4)return;var _0x1cea03={'UserId':_0x3ee438['user']['id'],'ContactId':_0x21c8f4['id'],'MailAccountId':_0x3f1374['id'],'inReplyTo':_0x401f77[_0x8dfb('0xb0')],'to':_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xa7')],'cc':_0x3ee438['body']['cc'],'subject':_0x3ee438[_0x8dfb('0x5f')]['subject'],'attach':_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xb1')],'firstMsgDirection':_0x8dfb('0xb2'),'lastMsgAt':moment()['format'](_0x8dfb('0xb3')),'lastMsgDirection':_0x8dfb('0xb2'),'Messages':[_['merge'](_0x3ee438[_0x8dfb('0x5f')],{'messageId':_0x401f77['messageId'],'sentAt':moment()[_0x8dfb('0xb4')](_0x8dfb('0xb3')),'read':!![],'MailAccountId':_0x3f1374['id'],'UserId':_0x3ee438[_0x8dfb('0x31')]['id'],'ContactId':_0x21c8f4['id']})]};if(_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xb5')]){_0x1cea03=_['merge'](_0x1cea03,_0x3ee438[_0x8dfb('0x5f')][_0x8dfb('0xb5')]);}return db[_0x8dfb('0x84')][_0x8dfb('0x67')](_0x1cea03,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x8dfb('0x10')](respondWithResult(_0x3c3e43,null))[_0x8dfb('0x19')](handleError(_0x3c3e43,null));};exports[_0x8dfb('0xb6')]=function(_0x100288,_0xcebc5b){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x100288[_0x8dfb('0x5c')]['id']},'include':[{'model':db[_0x8dfb('0x3f')],'as':_0x8dfb('0x3d'),'raw':!![],'include':[{'model':db[_0x8dfb('0xa5')],'as':_0x8dfb('0xa5'),'raw':!![]}]}]})[_0x8dfb('0x10')](handleEntityNotFound(_0xcebc5b,null))[_0x8dfb('0x10')](function(_0x35c514){if(!_0x35c514[_0x8dfb('0x3d')])return;var _0x95de3d=_0x35c514[_0x8dfb('0xac')]();return respondWithRpcPromise(_0x8dfb('0xb7'),_0x8dfb('0xb6'),{'account':_0x95de3d});})[_0x8dfb('0x10')](respondWithResult(_0xcebc5b,null))['catch'](handleError(_0xcebc5b,null));};exports[_0x8dfb('0x24')]=function(_0x59d2cc,_0x2cd850){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x59d2cc[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x2cd850,null))[_0x8dfb('0x10')](function(_0x141ff4){if(_0x141ff4&&_0x141ff4['service']){throw new db[(_0x8dfb('0xb8'))][(_0x8dfb('0xb9'))](_0x8dfb('0xba'));}return _0x141ff4;})[_0x8dfb('0x10')](removeEntity(_0x2cd850,null))[_0x8dfb('0x19')](handleError(_0x2cd850,null));};exports[_0x8dfb('0xbb')]=function(_0x470d8b,_0x253f3b){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x470d8b['params']['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x253f3b,null))['then'](function(_0x27e06b){if(_0x27e06b){return _0x27e06b[_0x8dfb('0xbb')](_0x470d8b[_0x8dfb('0x5f')][_0x8dfb('0x6d')],_[_0x8dfb('0x85')](_0x470d8b[_0x8dfb('0x5f')],['ids','id'])||{})[_0x8dfb('0xbc')](function(_0x2d6637){for(var _0x17f70f=0x0;_0x17f70f<_0x470d8b[_0x8dfb('0x5f')]['ids'][_0x8dfb('0x4f')];_0x17f70f+=0x1){socket[_0x8dfb('0xbd')](_0x8dfb('0xbe'),{'UserId':Number(_0x470d8b[_0x8dfb('0x5f')][_0x8dfb('0x6d')][_0x17f70f]),'MailAccountId':Number(_0x470d8b[_0x8dfb('0x5c')]['id'])});}return _0x2d6637;});}})[_0x8dfb('0x10')](respondWithResult(_0x253f3b,null))['catch'](handleError(_0x253f3b,null));};exports[_0x8dfb('0xbf')]=function(_0x5566dc,_0x596977){return db[_0x8dfb('0x43')][_0x8dfb('0x5e')]({'where':{'id':_0x5566dc[_0x8dfb('0x5c')]['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x596977,null))[_0x8dfb('0x10')](function(_0x9029ef){if(_0x9029ef){return _0x9029ef[_0x8dfb('0xbf')](_0x5566dc['query']['ids'])[_0x8dfb('0x10')](function(){if(_['isArray'](_0x5566dc[_0x8dfb('0x49')][_0x8dfb('0x6d')])){for(var _0x35e8f9=0x0;_0x35e8f9<_0x5566dc[_0x8dfb('0x49')][_0x8dfb('0x6d')][_0x8dfb('0x4f')];_0x35e8f9+=0x1){socket[_0x8dfb('0xbd')](_0x8dfb('0xc0'),{'UserId':Number(_0x5566dc['query'][_0x8dfb('0x6d')][_0x35e8f9]),'MailAccountId':Number(_0x5566dc[_0x8dfb('0x5c')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x5566dc[_0x8dfb('0x49')][_0x8dfb('0x6d')]),'MailAccountId':Number(_0x5566dc[_0x8dfb('0x5c')]['id'])});}});}})[_0x8dfb('0x10')](respondWithStatusCode(_0x596977,null))[_0x8dfb('0x19')](handleError(_0x596977,null));};exports['getAgents']=function(_0x5ce263,_0x1d7c16){var _0x8a7f03={};var _0x2c64e0={};var _0x3f7b14;var _0x5bbf1b;return db['MailAccount'][_0x8dfb('0x69')]({'where':{'id':_0x5ce263['params']['id']}})[_0x8dfb('0x10')](handleEntityNotFound(_0x1d7c16,null))[_0x8dfb('0x10')](function(_0x2da4dc){if(_0x2da4dc){_0x3f7b14=_0x2da4dc;_0x2c64e0[_0x8dfb('0x48')]=_[_0x8dfb('0x4a')](db['User']['rawAttributes']);_0x2c64e0[_0x8dfb('0x49')]=_[_0x8dfb('0x4a')](_0x5ce263['query']);_0x2c64e0['filters']=_[_0x8dfb('0x4c')](_0x2c64e0[_0x8dfb('0x48')],_0x2c64e0['query']);_0x8a7f03['attributes']=_['intersection'](_0x2c64e0[_0x8dfb('0x48')],qs['fields'](_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x4d')]));_0x8a7f03[_0x8dfb('0x4e')]=_0x8a7f03[_0x8dfb('0x4e')][_0x8dfb('0x4f')]?_0x8a7f03[_0x8dfb('0x4e')]:_0x2c64e0[_0x8dfb('0x48')];_0x8a7f03[_0x8dfb('0x51')]=qs['sort'](_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x6b')]);_0x8a7f03[_0x8dfb('0x52')]=qs[_0x8dfb('0x4b')](_[_0x8dfb('0x53')](_0x5ce263[_0x8dfb('0x49')],_0x2c64e0[_0x8dfb('0x4b')]));if(_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x56')]){_0x8a7f03['where']=_[_0x8dfb('0x54')](_0x8a7f03[_0x8dfb('0x52')],{'$or':_[_0x8dfb('0x42')](_0x8a7f03['attributes'],function(_0x15c7ea){var _0xa675bd={};_0xa675bd[_0x15c7ea]={'$like':'%'+_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x56')]+'%'};return _0xa675bd;})});}_0x8a7f03=_[_0x8dfb('0x54')]({},_0x8a7f03,_0x5ce263['options']);return _0x3f7b14['getAgents'](_0x8a7f03);}})[_0x8dfb('0x10')](function(_0x3dce3a){if(_0x3dce3a){_0x5bbf1b=_0x3dce3a[_0x8dfb('0x4f')];if(!_0x5ce263['query'][_0x8dfb('0x6a')](_0x8dfb('0x50'))){_0x8a7f03[_0x8dfb('0x1f')]=qs[_0x8dfb('0x1f')](_0x5ce263[_0x8dfb('0x49')]['limit']);_0x8a7f03[_0x8dfb('0x1d')]=qs[_0x8dfb('0x1d')](_0x5ce263[_0x8dfb('0x49')][_0x8dfb('0x1d')]);}return _0x3f7b14[_0x8dfb('0xc1')](_0x8a7f03);}})[_0x8dfb('0x10')](function(_0x10ccac){if(_0x10ccac){return _0x10ccac?{'count':_0x5bbf1b,'rows':_0x10ccac}:null;}})[_0x8dfb('0x10')](respondWithResult(_0x1d7c16,null))['catch'](handleError(_0x1d7c16,null));}; \ No newline at end of file +var _0x6b9f=['sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','body','provider','custom','mandatoryDispositionPause','describe','addDisposition','Disposition','create','findOne','rawAttributes','pick','MailAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','active','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','ids','omit','CmContact','Contact','Owner','fullname','internal','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','finally','getApplications','getMessages','MailMessage','$gte','split','inlineCss','true','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','ListId','messageId','subject','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','map','MailAccount','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x6b9f,0x1e5));var _0xf6b9=function(_0x5ef0bd,_0x28e566){_0x5ef0bd=_0x5ef0bd-0x0;var _0x3b6c8e=_0x6b9f[_0x5ef0bd];return _0x3b6c8e;};'use strict';var moment=require(_0xf6b9('0x0'));var BPromise=require(_0xf6b9('0x1'));var util=require('util');var path=require('path');var _=require(_0xf6b9('0x2'));var juice=require(_0xf6b9('0x3'));var Redis=require(_0xf6b9('0x4'));var qs=require(_0xf6b9('0x5'));var logger=require(_0xf6b9('0x6'))(_0xf6b9('0x7'));var config=require(_0xf6b9('0x8'));var db=require('../../mysqldb')['db'];config[_0xf6b9('0x9')]=_[_0xf6b9('0xa')](config[_0xf6b9('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6b9('0xb'))(new Redis(config[_0xf6b9('0x9')]));require(_0xf6b9('0xc'))[_0xf6b9('0xd')](socket);var jayson=require(_0xf6b9('0xe'));var client=jayson[_0xf6b9('0xf')][_0xf6b9('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x20fee4,_0x32f645,_0x1f08d4,_0x1c189d){return new BPromise(function(_0x1fdc41,_0x32979d){var _0x4a1ccb=_0x1c189d||client;return _0x4a1ccb['request'](_0x20fee4,_0x1f08d4)[_0xf6b9('0x11')](function(_0x14b54a){logger[_0xf6b9('0x12')](_0xf6b9('0x13'),_0x32f645,_0xf6b9('0x14'));logger[_0xf6b9('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x32f645,_0xf6b9('0x14'),JSON[_0xf6b9('0x16')](_0x14b54a));if(_0x14b54a[_0xf6b9('0x17')]){if(_0x14b54a['error'][_0xf6b9('0x18')]===0x1f4){logger[_0xf6b9('0x17')](_0xf6b9('0x13'),_0x32f645,_0x14b54a[_0xf6b9('0x17')][_0xf6b9('0x19')]);return _0x32979d(_0x14b54a[_0xf6b9('0x17')][_0xf6b9('0x19')]);}logger['error'](_0xf6b9('0x13'),_0x32f645,_0x14b54a[_0xf6b9('0x17')][_0xf6b9('0x19')]);return _0x1fdc41(_0x14b54a[_0xf6b9('0x17')][_0xf6b9('0x19')]);}else{logger[_0xf6b9('0x12')]('MailAccount,\x20%s,\x20%s',_0x32f645,_0xf6b9('0x14'));_0x1fdc41(_0x14b54a['result'][_0xf6b9('0x19')]);}})[_0xf6b9('0x1a')](function(_0x37400c){logger[_0xf6b9('0x17')](_0xf6b9('0x13'),_0x32f645,_0x37400c);_0x32979d(_0x37400c);});});}function respondWithStatusCode(_0x1598a6,_0x7b6e9f){_0x7b6e9f=_0x7b6e9f||0xcc;return function(_0x3a37eb){if(_0x3a37eb){return _0x1598a6[_0xf6b9('0x1b')](_0x7b6e9f);}return _0x1598a6[_0xf6b9('0x1c')](_0x7b6e9f)[_0xf6b9('0x1d')]();};}function respondWithResult(_0x4f6b96,_0xce0fb4){_0xce0fb4=_0xce0fb4||0xc8;return function(_0x5a8d52){if(_0x5a8d52){return _0x4f6b96[_0xf6b9('0x1c')](_0xce0fb4)[_0xf6b9('0x1e')](_0x5a8d52);}};}function respondWithFilteredResult(_0x3698ef,_0x193fae){return function(_0x5bc50c){if(_0x5bc50c){var _0x48b85b=typeof _0x193fae[_0xf6b9('0x1f')]==='undefined'&&typeof _0x193fae[_0xf6b9('0x20')]===_0xf6b9('0x21');var _0x567c23=_0x5bc50c[_0xf6b9('0x22')];var _0x54b4ce=_0x48b85b?0x0:_0x193fae['offset'];var _0x38faa1=_0x48b85b?_0x5bc50c[_0xf6b9('0x22')]:_0x193fae[_0xf6b9('0x1f')]+_0x193fae[_0xf6b9('0x20')];var _0x34489b;if(_0x38faa1>=_0x567c23){_0x38faa1=_0x567c23;_0x34489b=0xc8;}else{_0x34489b=0xce;}_0x3698ef[_0xf6b9('0x1c')](_0x34489b);return _0x3698ef['set'](_0xf6b9('0x23'),_0x54b4ce+'-'+_0x38faa1+'/'+_0x567c23)[_0xf6b9('0x1e')](_0x5bc50c);}return null;};}function saveUpdates(_0x5daecf){return function(_0x35456d){if(_0x35456d){return _0x35456d[_0xf6b9('0x24')](_0x5daecf)[_0xf6b9('0x11')](function(_0x4f95fe){return _0x4f95fe;});}return null;};}function removeEntity(_0x587a83){return function(_0x257de6){if(_0x257de6){return _0x257de6[_0xf6b9('0x25')]()[_0xf6b9('0x11')](function(){var _0x1d7441=_0x257de6[_0xf6b9('0x26')]({'plain':!![]});var _0xe3b3e=_0xf6b9('0x27');return db[_0xf6b9('0x28')][_0xf6b9('0x25')]({'where':{'type':_0xe3b3e,'resourceId':_0x1d7441['id']}})[_0xf6b9('0x11')](function(){return _0x257de6;});})[_0xf6b9('0x11')](function(){_0x587a83[_0xf6b9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39c240){return function(_0x3289f2){if(!_0x3289f2){_0x39c240['sendStatus'](0x194);}return _0x3289f2;};}function handleError(_0xb1be6f,_0x30a432){_0x30a432=_0x30a432||0x1f4;return function(_0x4afd6d){logger[_0xf6b9('0x17')](_0x4afd6d[_0xf6b9('0x29')]);if(_0x4afd6d['name']){delete _0x4afd6d[_0xf6b9('0x2a')];}_0xb1be6f['status'](_0x30a432)[_0xf6b9('0x2b')](_0x4afd6d);};}function getImapHost(_0x5509f3){switch(_0x5509f3){case _0xf6b9('0x2c'):return _0xf6b9('0x2d');case _0xf6b9('0x2e'):return _0xf6b9('0x2f');case _0xf6b9('0x30'):return _0xf6b9('0x31');case'outlook365':return _0xf6b9('0x32');}throw new Error(_0xf6b9('0x33'),_0x5509f3);}function getSmtpHost(_0x353623){switch(_0x353623){case _0xf6b9('0x2c'):return _0xf6b9('0x34');case _0xf6b9('0x2e'):return _0xf6b9('0x35');case'hotmail':return _0xf6b9('0x36');case _0xf6b9('0x37'):return _0xf6b9('0x38');}throw new Error('Unknown\x20email\x20service\x20provider',_0x353623);}function getAuthenticationOptions(_0xaaf79f,_0x5c7e09){var _0xb09158={};var _0x2e381d={};if(_0xaaf79f){_0xb09158[_0xf6b9('0x39')]=_0x2e381d[_0xf6b9('0x39')]=_0x5c7e09[_0xf6b9('0x3a')];_0xb09158[_0xf6b9('0x3b')]=_0x2e381d[_0xf6b9('0x3c')]=_0x5c7e09[_0xf6b9('0x3b')];if(_0x5c7e09[_0xf6b9('0x3d')]){_0xb09158[_0xf6b9('0x3d')]=_0x2e381d[_0xf6b9('0x3d')]=!![];_0xb09158['CloudProviderId']=_0x2e381d[_0xf6b9('0x3e')]=_0x5c7e09['CloudProviderId'];_0xb09158[_0xf6b9('0x3b')]=_0x2e381d[_0xf6b9('0x3c')]=null;}else{_0xb09158[_0xf6b9('0x3e')]=_0x2e381d['CloudProviderId']=null;}_0xb09158[_0xf6b9('0x3f')]=getImapHost(_0xaaf79f);_0xb09158['port']=0x3e1;_0x2e381d['host']=getSmtpHost(_0xaaf79f);_0x2e381d[_0xf6b9('0x40')]=0x24b;_0x2e381d[_0xf6b9('0x41')]=![];_0xb09158[_0xf6b9('0x42')]=_0x2e381d[_0xf6b9('0x42')]=null;}else{if(_0x5c7e09[_0xf6b9('0x43')]){_0xb09158[_0xf6b9('0x39')]=_0x2e381d[_0xf6b9('0x39')]=_0x5c7e09['username'];_0xb09158[_0xf6b9('0x3b')]=_0x2e381d[_0xf6b9('0x3c')]=_0x5c7e09[_0xf6b9('0x3b')];}else{_0xb09158[_0xf6b9('0x43')]=_0x2e381d['authentication']=![];_0xb09158[_0xf6b9('0x39')]=_0x2e381d[_0xf6b9('0x39')]=null;_0xb09158[_0xf6b9('0x3b')]=_0x2e381d['pass']=null;}_0xb09158[_0xf6b9('0x3f')]=_0x5c7e09[_0xf6b9('0x44')][_0xf6b9('0x3f')];_0xb09158['port']=_0x5c7e09[_0xf6b9('0x44')][_0xf6b9('0x40')];_0x2e381d[_0xf6b9('0x3f')]=_0x5c7e09['Smtp']['host'];_0x2e381d[_0xf6b9('0x40')]=_0x5c7e09[_0xf6b9('0x45')]['port'];}return{'Imap':_0xb09158,'Smtp':_0x2e381d};}exports[_0xf6b9('0x46')]=function(_0x2e3865,_0x167a1d){var _0x14b652={'include':[{'model':db[_0xf6b9('0x47')],'as':'Imap'},{'model':db[_0xf6b9('0x48')],'as':_0xf6b9('0x45')},{'model':db[_0xf6b9('0x49')],'as':'mandatoryDispositionPause'}]},_0x264e58={},_0x4f97aa={'count':0x0,'rows':[]};var _0x233e42=_[_0xf6b9('0x4a')](db[_0xf6b9('0x4b')]['rawAttributes'],function(_0x16a0d8){return{'name':_0x16a0d8[_0xf6b9('0x4c')],'type':_0x16a0d8[_0xf6b9('0x4d')][_0xf6b9('0x4e')]};});_0x264e58[_0xf6b9('0x4f')]=_[_0xf6b9('0x4a')](_0x233e42,'name');_0x264e58[_0xf6b9('0x50')]=_['keys'](_0x2e3865[_0xf6b9('0x50')]);_0x264e58['filters']=_['intersection'](_0x264e58[_0xf6b9('0x4f')],_0x264e58['query']);_0x14b652[_0xf6b9('0x51')]=_[_0xf6b9('0x52')](_0x264e58[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0x2e3865['query'][_0xf6b9('0x53')]));_0x14b652[_0xf6b9('0x51')]=_0x14b652['attributes'][_0xf6b9('0x54')]?_0x14b652[_0xf6b9('0x51')]:_0x264e58['model'];if(!_0x2e3865[_0xf6b9('0x50')][_0xf6b9('0x55')](_0xf6b9('0x56'))){_0x14b652['limit']=qs[_0xf6b9('0x20')](_0x2e3865[_0xf6b9('0x50')][_0xf6b9('0x20')]);_0x14b652[_0xf6b9('0x1f')]=qs[_0xf6b9('0x1f')](_0x2e3865[_0xf6b9('0x50')]['offset']);}_0x14b652[_0xf6b9('0x57')]=qs['sort'](_0x2e3865[_0xf6b9('0x50')][_0xf6b9('0x58')]);_0x14b652[_0xf6b9('0x59')]=qs[_0xf6b9('0x5a')](_['pick'](_0x2e3865[_0xf6b9('0x50')],_0x264e58[_0xf6b9('0x5a')]),_0x233e42);if(_0x2e3865[_0xf6b9('0x50')][_0xf6b9('0x5b')]){_0x14b652[_0xf6b9('0x59')]=_[_0xf6b9('0x5c')](_0x14b652[_0xf6b9('0x59')],{'$or':_[_0xf6b9('0x4a')](_0x233e42,function(_0x2b27f4){if(_0x2b27f4[_0xf6b9('0x4d')]!==_0xf6b9('0x5d')){var _0x598a93={};_0x598a93[_0x2b27f4[_0xf6b9('0x2a')]]={'$like':'%'+_0x2e3865[_0xf6b9('0x50')][_0xf6b9('0x5b')]+'%'};return _0x598a93;}})});}_0x14b652=_[_0xf6b9('0x5c')]({},_0x14b652,_0x2e3865[_0xf6b9('0x5e')]);var _0x365dd0={'where':_0x14b652[_0xf6b9('0x59')]};return db['MailAccount'][_0xf6b9('0x22')](_0x365dd0)['then'](function(_0x10d0b0){_0x4f97aa[_0xf6b9('0x22')]=_0x10d0b0;if(_0x2e3865[_0xf6b9('0x50')][_0xf6b9('0x5f')]){_0x14b652['include']=[{'all':!![]}];}return db[_0xf6b9('0x4b')][_0xf6b9('0x60')](_0x14b652);})[_0xf6b9('0x11')](function(_0x35672f){_0x4f97aa[_0xf6b9('0x61')]=_0x35672f;return _0x4f97aa;})['then'](respondWithFilteredResult(_0x167a1d,_0x14b652))[_0xf6b9('0x1a')](handleError(_0x167a1d,null));};exports[_0xf6b9('0x62')]=function(_0x5695e4,_0x2ed792){var _0x8dbe8={'raw':![],'where':{'id':_0x5695e4[_0xf6b9('0x63')]['id']},'include':[{'model':db[_0xf6b9('0x47')],'as':_0xf6b9('0x44')},{'model':db[_0xf6b9('0x48')],'as':'Smtp'},{'model':db[_0xf6b9('0x49')],'as':'mandatoryDispositionPause'}]},_0x2866f4={};_0x2866f4[_0xf6b9('0x4f')]=_[_0xf6b9('0x64')](db[_0xf6b9('0x4b')]['rawAttributes']);_0x2866f4[_0xf6b9('0x50')]=_[_0xf6b9('0x64')](_0x5695e4[_0xf6b9('0x50')]);_0x2866f4[_0xf6b9('0x5a')]=_[_0xf6b9('0x52')](_0x2866f4[_0xf6b9('0x4f')],_0x2866f4[_0xf6b9('0x50')]);_0x8dbe8[_0xf6b9('0x51')]=_[_0xf6b9('0x52')](_0x2866f4[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0x5695e4[_0xf6b9('0x50')][_0xf6b9('0x53')]));_0x8dbe8[_0xf6b9('0x51')]=_0x8dbe8[_0xf6b9('0x51')]['length']?_0x8dbe8['attributes']:_0x2866f4[_0xf6b9('0x4f')];if(_0x5695e4[_0xf6b9('0x50')][_0xf6b9('0x5f')]){_0x8dbe8[_0xf6b9('0x65')]=[{'all':!![]}];}_0x8dbe8=_[_0xf6b9('0x5c')]({},_0x8dbe8,_0x5695e4[_0xf6b9('0x5e')]);return db['MailAccount'][_0xf6b9('0x66')](_0x8dbe8)[_0xf6b9('0x11')](handleEntityNotFound(_0x2ed792,null))['then'](respondWithResult(_0x2ed792,null))['catch'](handleError(_0x2ed792,null));};exports[_0xf6b9('0x24')]=function(_0x16d97a,_0x1a6cc0){if(_0x16d97a['body']['id']){delete _0x16d97a[_0xf6b9('0x67')]['id'];}var _0x22e728=_0x16d97a[_0xf6b9('0x67')][_0xf6b9('0x68')]===_0xf6b9('0x69')?null:_0x16d97a['body']['provider'];var _0x438fcf=_0x16d97a['body'][_0xf6b9('0x44')]||{};var _0x20d519=_0x16d97a['body']['Smtp']||{};if(_0x22e728){_0x438fcf[_0xf6b9('0x3f')]=getImapHost(_0x22e728);_0x438fcf[_0xf6b9('0x40')]=0x3e1;_0x20d519[_0xf6b9('0x3f')]=getSmtpHost(_0x22e728);_0x20d519[_0xf6b9('0x40')]=0x24b;_0x20d519[_0xf6b9('0x41')]=![];}if(_0x20d519[_0xf6b9('0x3d')]){_0x20d519[_0xf6b9('0x41')]=![];}else{_0x20d519[_0xf6b9('0x3e')]=null;}if(!_0x438fcf[_0xf6b9('0x3d')])_0x438fcf[_0xf6b9('0x3e')]=null;_0x16d97a[_0xf6b9('0x67')][_0xf6b9('0x44')]=_0x438fcf;_0x16d97a['body'][_0xf6b9('0x45')]=_0x20d519;return db[_0xf6b9('0x4b')][_0xf6b9('0x66')]({'where':{'id':_0x16d97a[_0xf6b9('0x63')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf6b9('0x44')},{'model':db[_0xf6b9('0x48')],'as':_0xf6b9('0x45')},{'model':db[_0xf6b9('0x49')],'as':_0xf6b9('0x6a')}]})[_0xf6b9('0x11')](handleEntityNotFound(_0x1a6cc0,null))[_0xf6b9('0x11')](function(_0x58a327){if(!_0x58a327)throw new Error('Mail\x20Account\x20not\x20found');if(_0x58a327[_0xf6b9('0x42')])delete _0x16d97a[_0xf6b9('0x67')][_0xf6b9('0x44')];return _0x58a327;})[_0xf6b9('0x11')](saveUpdates(_0x16d97a[_0xf6b9('0x67')],null))[_0xf6b9('0x11')](function(_0x4b17cd){if(!_0x16d97a[_0xf6b9('0x67')]['Imap'])return _0x4b17cd;return db[_0xf6b9('0x47')][_0xf6b9('0x24')](_0x16d97a[_0xf6b9('0x67')]['Imap'],{'where':{'MailAccountId':_0x4b17cd['id']}})[_0xf6b9('0x11')](function(){return _0x4b17cd;});})[_0xf6b9('0x11')](function(_0x4680be){if(!_0x16d97a[_0xf6b9('0x67')][_0xf6b9('0x45')])return _0x4680be;return db[_0xf6b9('0x48')][_0xf6b9('0x24')](_0x16d97a['body']['Smtp'],{'where':{'MailAccountId':_0x4680be['id']}})[_0xf6b9('0x11')](function(){return _0x4680be;});})[_0xf6b9('0x11')](respondWithResult(_0x1a6cc0,null))[_0xf6b9('0x1a')](handleError(_0x1a6cc0,null));};exports['describe']=function(_0x49a2e7,_0x391b60){return db[_0xf6b9('0x4b')][_0xf6b9('0x6b')]()[_0xf6b9('0x11')](respondWithResult(_0x391b60,null))['catch'](handleError(_0x391b60,null));};exports[_0xf6b9('0x6c')]=function(_0x4a545a,_0x2e878b){if(_0x4a545a['body']['id']){delete _0x4a545a[_0xf6b9('0x67')]['id'];}return db['MailAccount'][_0xf6b9('0x66')]({'where':{'id':_0x4a545a[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x2e878b,null))[_0xf6b9('0x11')](function(_0x84c87c){if(_0x84c87c){_0x4a545a['body']['MailAccountId']=_0x84c87c['id'];return db[_0xf6b9('0x6d')][_0xf6b9('0x6e')](_0x4a545a['body']);}})[_0xf6b9('0x11')](respondWithResult(_0x2e878b,null))[_0xf6b9('0x1a')](handleError(_0x2e878b,null));};exports['getDispositions']=function(_0x492e47,_0x501c60){var _0x1be91b={'raw':![],'where':{}};var _0x1137e9={};var _0x3125dd={'count':0x0,'rows':[]};return db['MailAccount'][_0xf6b9('0x6f')]({'where':{'id':_0x492e47[_0xf6b9('0x63')]['id']}})['then'](handleEntityNotFound(_0x501c60,null))[_0xf6b9('0x11')](function(_0x1b3a84){if(_0x1b3a84){_0x1137e9[_0xf6b9('0x4f')]=_[_0xf6b9('0x64')](db['Disposition'][_0xf6b9('0x70')]);_0x1137e9['query']=_[_0xf6b9('0x64')](_0x492e47[_0xf6b9('0x50')]);_0x1137e9['filters']=_[_0xf6b9('0x52')](_0x1137e9[_0xf6b9('0x4f')],_0x1137e9[_0xf6b9('0x50')]);_0x1be91b[_0xf6b9('0x51')]=_[_0xf6b9('0x52')](_0x1137e9[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0x492e47['query']['fields']));_0x1be91b[_0xf6b9('0x51')]=_0x1be91b[_0xf6b9('0x51')]['length']?_0x1be91b['attributes']:_0x1137e9['model'];if(!_0x492e47['query']['hasOwnProperty'](_0xf6b9('0x56'))){_0x1be91b[_0xf6b9('0x20')]=qs['limit'](_0x492e47[_0xf6b9('0x50')][_0xf6b9('0x20')]);_0x1be91b[_0xf6b9('0x1f')]=qs['offset'](_0x492e47['query'][_0xf6b9('0x1f')]);}_0x1be91b[_0xf6b9('0x57')]=qs[_0xf6b9('0x58')](_0x492e47[_0xf6b9('0x50')][_0xf6b9('0x58')]);_0x1be91b[_0xf6b9('0x59')]=qs[_0xf6b9('0x5a')](_[_0xf6b9('0x71')](_0x492e47[_0xf6b9('0x50')],_0x1137e9['filters']));_0x1be91b[_0xf6b9('0x59')][_0xf6b9('0x72')]=_0x1b3a84['id'];if(_0x492e47[_0xf6b9('0x50')]['filter']){_0x1be91b[_0xf6b9('0x59')]=_['merge'](_0x1be91b[_0xf6b9('0x59')],{'$or':_[_0xf6b9('0x4a')](_0x1be91b[_0xf6b9('0x51')],function(_0x4e79c7){var _0x2a9202={};_0x2a9202[_0x4e79c7]={'$like':'%'+_0x492e47[_0xf6b9('0x50')]['filter']+'%'};return _0x2a9202;})});}_0x1be91b=_[_0xf6b9('0x5c')]({},_0x1be91b,_0x492e47[_0xf6b9('0x5e')]);return db[_0xf6b9('0x6d')][_0xf6b9('0x22')]({'where':_0x1be91b[_0xf6b9('0x59')]})[_0xf6b9('0x11')](function(_0x1d0998){_0x3125dd['count']=_0x1d0998;if(_0x492e47['query']['includeAll']){_0x1be91b[_0xf6b9('0x65')]=[{'all':!![]}];}return db[_0xf6b9('0x6d')][_0xf6b9('0x60')](_0x1be91b);})[_0xf6b9('0x11')](function(_0x14e6fc){_0x3125dd[_0xf6b9('0x61')]=_0x14e6fc;return _0x3125dd;});}})['then'](respondWithFilteredResult(_0x501c60,_0x1be91b))[_0xf6b9('0x1a')](handleError(_0x501c60,null));};exports['removeDispositions']=function(_0x3d0061,_0x3a99f0){return db[_0xf6b9('0x4b')][_0xf6b9('0x66')]({'where':{'id':_0x3d0061[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x3a99f0,null))[_0xf6b9('0x11')](function(_0x5b0d04){if(_0x5b0d04){return _0x5b0d04[_0xf6b9('0x73')](_0x3d0061[_0xf6b9('0x50')]['ids']);}})[_0xf6b9('0x11')](respondWithStatusCode(_0x3a99f0,null))['catch'](handleError(_0x3a99f0,null));};exports[_0xf6b9('0x74')]=function(_0x2d8670,_0x256250){if(_0x2d8670[_0xf6b9('0x67')]['id']){delete _0x2d8670[_0xf6b9('0x67')]['id'];}return db[_0xf6b9('0x4b')][_0xf6b9('0x66')]({'where':{'id':_0x2d8670['params']['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x256250,null))[_0xf6b9('0x11')](function(_0xc14e26){if(_0xc14e26){_0x2d8670[_0xf6b9('0x67')][_0xf6b9('0x72')]=_0xc14e26['id'];return db[_0xf6b9('0x75')][_0xf6b9('0x6e')](_0x2d8670[_0xf6b9('0x67')]);}})[_0xf6b9('0x11')](respondWithResult(_0x256250,null))[_0xf6b9('0x1a')](handleError(_0x256250,null));};exports[_0xf6b9('0x76')]=function(_0x30a865,_0x5bbc8f){var _0x44c965={'raw':![],'where':{}};var _0x370c7c={};var _0x5d61fa={'count':0x0,'rows':[]};return db[_0xf6b9('0x4b')]['findOne']({'where':{'id':_0x30a865['params']['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x5bbc8f,null))[_0xf6b9('0x11')](function(_0x2fdb78){if(_0x2fdb78){_0x370c7c[_0xf6b9('0x4f')]=_[_0xf6b9('0x64')](db['CannedAnswer'][_0xf6b9('0x70')]);_0x370c7c[_0xf6b9('0x50')]=_[_0xf6b9('0x64')](_0x30a865[_0xf6b9('0x50')]);_0x370c7c[_0xf6b9('0x5a')]=_[_0xf6b9('0x52')](_0x370c7c[_0xf6b9('0x4f')],_0x370c7c[_0xf6b9('0x50')]);_0x44c965[_0xf6b9('0x51')]=_['intersection'](_0x370c7c[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0x30a865['query']['fields']));_0x44c965['attributes']=_0x44c965['attributes'][_0xf6b9('0x54')]?_0x44c965['attributes']:_0x370c7c['model'];if(!_0x30a865['query'][_0xf6b9('0x55')](_0xf6b9('0x56'))){_0x44c965[_0xf6b9('0x20')]=qs['limit'](_0x30a865[_0xf6b9('0x50')][_0xf6b9('0x20')]);_0x44c965[_0xf6b9('0x1f')]=qs[_0xf6b9('0x1f')](_0x30a865['query'][_0xf6b9('0x1f')]);}_0x44c965[_0xf6b9('0x57')]=qs[_0xf6b9('0x58')](_0x30a865[_0xf6b9('0x50')][_0xf6b9('0x58')]);_0x44c965[_0xf6b9('0x59')]=qs[_0xf6b9('0x5a')](_['pick'](_0x30a865['query'],_0x370c7c['filters']));_0x44c965[_0xf6b9('0x59')][_0xf6b9('0x72')]=_0x2fdb78['id'];if(_0x30a865[_0xf6b9('0x50')]['filter']){_0x44c965[_0xf6b9('0x59')]=_[_0xf6b9('0x5c')](_0x44c965[_0xf6b9('0x59')],{'$or':_[_0xf6b9('0x4a')](_0x44c965[_0xf6b9('0x51')],function(_0x14adaa){var _0x18c1c1={};_0x18c1c1[_0x14adaa]={'$like':'%'+_0x30a865[_0xf6b9('0x50')][_0xf6b9('0x5b')]+'%'};return _0x18c1c1;})});}_0x44c965=_[_0xf6b9('0x5c')]({},_0x44c965,_0x30a865[_0xf6b9('0x5e')]);return db[_0xf6b9('0x75')][_0xf6b9('0x22')]({'where':_0x44c965['where']})['then'](function(_0x51a0cc){_0x5d61fa[_0xf6b9('0x22')]=_0x51a0cc;if(_0x30a865[_0xf6b9('0x50')][_0xf6b9('0x5f')]){_0x44c965[_0xf6b9('0x65')]=[{'all':!![]}];}return db[_0xf6b9('0x75')]['findAll'](_0x44c965);})['then'](function(_0x1cb323){_0x5d61fa['rows']=_0x1cb323;return _0x5d61fa;});}})['then'](respondWithFilteredResult(_0x5bbc8f,_0x44c965))[_0xf6b9('0x1a')](handleError(_0x5bbc8f,null));};exports['removeAnswers']=function(_0x44deb4,_0x2f0ecb){return db[_0xf6b9('0x4b')]['find']({'where':{'id':_0x44deb4[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x2f0ecb,null))[_0xf6b9('0x11')](function(_0x24f9cf){if(_0x24f9cf){return _0x24f9cf[_0xf6b9('0x77')](_0x44deb4[_0xf6b9('0x50')]['ids']);}})[_0xf6b9('0x11')](respondWithStatusCode(_0x2f0ecb,null))['catch'](handleError(_0x2f0ecb,null));};exports[_0xf6b9('0x6e')]=function(_0x39dd75,_0x559270){var _0x5a4630={'name':_0x39dd75[_0xf6b9('0x67')][_0xf6b9('0x2a')],'key':_0x39dd75['body'][_0xf6b9('0x4e')],'provider':_0x39dd75['body'][_0xf6b9('0x68')]===_0xf6b9('0x69')?null:_0x39dd75[_0xf6b9('0x67')][_0xf6b9('0x68')],'email':_0x39dd75[_0xf6b9('0x67')][_0xf6b9('0x78')],'ListId':_0x39dd75[_0xf6b9('0x67')]['ListId'],'active':!_['isNil'](_0x39dd75[_0xf6b9('0x67')][_0xf6b9('0x79')])?_0x39dd75[_0xf6b9('0x67')][_0xf6b9('0x79')]:!![],'description':_0x39dd75[_0xf6b9('0x67')]['description']||null};var _0x58eed8=getAuthenticationOptions(_0x5a4630[_0xf6b9('0x68')],_0x39dd75[_0xf6b9('0x67')]);_0x5a4630[_0xf6b9('0x44')]=_0x58eed8[_0xf6b9('0x44')];_0x5a4630[_0xf6b9('0x45')]=_0x58eed8['Smtp'];return db[_0xf6b9('0x4b')][_0xf6b9('0x6e')](_0x5a4630,{'include':[{'model':db[_0xf6b9('0x48')],'as':_0xf6b9('0x45')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xf6b9('0x11')](function(_0x40244b){var _0xacf05e=_0x39dd75['user'][_0xf6b9('0x26')]({'plain':!![]});if(!_0xacf05e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xacf05e[_0xf6b9('0x7a')]==='user'){var _0x503567=_0x40244b['get']({'plain':!![]});return db[_0xf6b9('0x7b')][_0xf6b9('0x66')]({'where':{'name':_0xf6b9('0x27'),'userProfileId':_0xacf05e[_0xf6b9('0x7c')]},'raw':!![]})[_0xf6b9('0x11')](function(_0x3a634b){if(_0x3a634b&&_0x3a634b[_0xf6b9('0x7d')]===0x0){return db[_0xf6b9('0x28')][_0xf6b9('0x6e')]({'name':_0x503567[_0xf6b9('0x2a')],'resourceId':_0x503567['id'],'type':_0x3a634b[_0xf6b9('0x2a')],'sectionId':_0x3a634b['id']},{})[_0xf6b9('0x11')](function(){return _0x40244b;});}else{return _0x40244b;}})['catch'](function(_0x509a52){logger[_0xf6b9('0x17')](_0xf6b9('0x7e'),_0x509a52);throw _0x509a52;});}return _0x40244b;})[_0xf6b9('0x11')](respondWithResult(_0x559270,0xc9))[_0xf6b9('0x1a')](handleError(_0x559270,null));};exports[_0xf6b9('0x7f')]=function(_0x389605,_0x55a458){return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0x389605['params']['id']}})['then'](handleEntityNotFound(_0x55a458,null))[_0xf6b9('0x11')](function(_0x4f4b78){if(_0x4f4b78){return _0x4f4b78[_0xf6b9('0x7f')]();}return null;})[_0xf6b9('0x11')](respondWithResult(_0x55a458,null))[_0xf6b9('0x1a')](handleError(_0x55a458,null));};exports['addImap']=function(_0x43cef1,_0x5f19ba){if(_0x43cef1[_0xf6b9('0x67')]['id']){delete _0x43cef1[_0xf6b9('0x67')]['id'];}return db[_0xf6b9('0x4b')][_0xf6b9('0x66')]({'where':{'id':_0x43cef1[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x5f19ba,null))['then'](function(_0x2b989f){if(_0x2b989f){_0x43cef1['body'][_0xf6b9('0x72')]=_0x2b989f['id'];return db[_0xf6b9('0x47')][_0xf6b9('0x6e')](_0x43cef1[_0xf6b9('0x67')]);}})[_0xf6b9('0x11')](respondWithResult(_0x5f19ba,null))[_0xf6b9('0x1a')](handleError(_0x5f19ba,null));};exports['removeImap']=function(_0x2fdba7,_0x598379){return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0x2fdba7['params']['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x598379,null))[_0xf6b9('0x11')](function(_0x7fd44b){if(_0x7fd44b){return _0x7fd44b[_0xf6b9('0x80')](null);}return null;})['then'](respondWithStatusCode(_0x598379,null))[_0xf6b9('0x1a')](handleError(_0x598379,null));};exports[_0xf6b9('0x81')]=function(_0x2219ae,_0x412baa){return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0x2219ae[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x412baa,null))[_0xf6b9('0x11')](function(_0x444e17){if(_0x444e17){return _0x444e17[_0xf6b9('0x81')]();}return null;})[_0xf6b9('0x11')](respondWithResult(_0x412baa,null))['catch'](handleError(_0x412baa,null));};exports['addSmtp']=function(_0x9b7d6b,_0x2747ae){if(_0x9b7d6b[_0xf6b9('0x67')]['id']){delete _0x9b7d6b[_0xf6b9('0x67')]['id'];}return db[_0xf6b9('0x4b')]['find']({'where':{'id':_0x9b7d6b[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x2747ae,null))[_0xf6b9('0x11')](function(_0x480715){if(_0x480715){_0x9b7d6b[_0xf6b9('0x67')][_0xf6b9('0x72')]=_0x480715['id'];return db['MailServerOut'][_0xf6b9('0x6e')](_0x9b7d6b[_0xf6b9('0x67')]);}})[_0xf6b9('0x11')](respondWithResult(_0x2747ae,null))[_0xf6b9('0x1a')](handleError(_0x2747ae,null));};exports[_0xf6b9('0x82')]=function(_0x7c951a,_0x347d13){return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0x7c951a['params']['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x347d13,null))[_0xf6b9('0x11')](function(_0xc8b340){if(_0xc8b340){return _0xc8b340['setSmtp'](null);}return null;})[_0xf6b9('0x11')](respondWithStatusCode(_0x347d13,null))[_0xf6b9('0x1a')](handleError(_0x347d13,null));};exports[_0xf6b9('0x83')]=function(_0x58bac7,_0x4a3c8a){return db[_0xf6b9('0x84')][_0xf6b9('0x66')]({'where':{'id':_0x58bac7['params']['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x4a3c8a,null))[_0xf6b9('0x11')](function(_0x144998){if(_0x144998){return _0x144998[_0xf6b9('0x83')](_0x58bac7['body'][_0xf6b9('0x85')],_[_0xf6b9('0x86')](_0x58bac7[_0xf6b9('0x67')],['ids','id'])||{});}})[_0xf6b9('0x11')](respondWithResult(_0x4a3c8a,null))[_0xf6b9('0x1a')](handleError(_0x4a3c8a,null));};exports['getInteractions']=function(_0x56703c,_0x37839a){var _0x1e8621={'raw':![],'where':{}};var _0x3d6eac={};var _0x4dbaca={'count':0x0,'rows':[]};return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0x56703c[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x37839a,null))[_0xf6b9('0x11')](function(_0x199d11){if(_0x199d11){_0x3d6eac[_0xf6b9('0x4f')]=_[_0xf6b9('0x64')](db[_0xf6b9('0x84')]['rawAttributes']);_0x3d6eac['query']=_[_0xf6b9('0x64')](_0x56703c[_0xf6b9('0x50')]);_0x3d6eac[_0xf6b9('0x5a')]=_[_0xf6b9('0x52')](_0x3d6eac[_0xf6b9('0x4f')],_0x3d6eac[_0xf6b9('0x50')]);_0x1e8621[_0xf6b9('0x51')]=_[_0xf6b9('0x52')](_0x3d6eac[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0x56703c['query']['fields']));_0x1e8621[_0xf6b9('0x51')]=_0x1e8621[_0xf6b9('0x51')][_0xf6b9('0x54')]?_0x1e8621[_0xf6b9('0x51')]:_0x3d6eac[_0xf6b9('0x4f')];if(!_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x55')]('nolimit')){_0x1e8621[_0xf6b9('0x20')]=qs[_0xf6b9('0x20')](_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x20')]);_0x1e8621['offset']=qs[_0xf6b9('0x1f')](_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x1f')]);}_0x1e8621[_0xf6b9('0x57')]=qs[_0xf6b9('0x58')](_0x56703c[_0xf6b9('0x50')]['sort']);_0x1e8621[_0xf6b9('0x59')]=qs[_0xf6b9('0x5a')](_['pick'](_0x56703c['query'],_0x3d6eac[_0xf6b9('0x5a')]));_0x1e8621['where'][_0xf6b9('0x72')]=_0x199d11['id'];if(_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x5b')]){_0x1e8621['where']=_['merge'](_0x1e8621[_0xf6b9('0x59')],{'$or':_[_0xf6b9('0x4a')](_0x1e8621[_0xf6b9('0x51')],function(_0x29473d){var _0x10ea30={};_0x10ea30[_0x29473d]={'$like':'%'+_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x5b')]+'%'};return _0x10ea30;})});}_0x1e8621=_['merge']({},_0x1e8621,_0x56703c[_0xf6b9('0x5e')]);return db[_0xf6b9('0x84')]['count']({'where':_0x1e8621[_0xf6b9('0x59')]})['then'](function(_0x42289c){_0x4dbaca[_0xf6b9('0x22')]=_0x42289c;if(_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x5f')]){_0x1e8621[_0xf6b9('0x65')]=[{'model':db[_0xf6b9('0x87')],'as':_0xf6b9('0x88'),'required':![]},{'model':db['User'],'as':_0xf6b9('0x89'),'attributes':['name',_0xf6b9('0x8a'),_0xf6b9('0x8b')],'required':![]},{'model':db['Tag'],'as':_0xf6b9('0x8c'),'attributes':['id',_0xf6b9('0x2a'),'color'],'where':_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x8d')]?{'id':_0x56703c[_0xf6b9('0x50')][_0xf6b9('0x8d')]}:undefined,'required':_0x56703c[_0xf6b9('0x50')]['tag']?!![]:![]}];}return db[_0xf6b9('0x84')][_0xf6b9('0x60')](_0x1e8621);})[_0xf6b9('0x11')](function(_0x238f85){_0x4dbaca[_0xf6b9('0x61')]=_0x238f85;return _0x4dbaca;});}})[_0xf6b9('0x11')](respondWithFilteredResult(_0x37839a,_0x1e8621))[_0xf6b9('0x1a')](handleError(_0x37839a,null));};exports[_0xf6b9('0x8e')]=function addApplications(_0xcac619,_0x5d81b5){var _0x1f62fa=_0xcac619[_0xf6b9('0x63')]['id'];var _0x56167d=_0xcac619[_0xf6b9('0x67')];var _0x449e9b=0xc8;var _0x2fcfa1=null;return db[_0xf6b9('0x8f')]['transaction']({'isolationLevel':db[_0xf6b9('0x8f')][_0xf6b9('0x90')][_0xf6b9('0x91')][_0xf6b9('0x92')]},function(_0xe62ae){return db[_0xf6b9('0x4b')]['findOne']({'where':{'id':_0x1f62fa},'transaction':_0xe62ae})[_0xf6b9('0x11')](function(_0x32f174){if(_0x32f174){return db[_0xf6b9('0x93')][_0xf6b9('0x25')]({'where':{'MailAccountId':_0x1f62fa},'transaction':_0xe62ae})['then'](function(){var _0x2a9deb=_[_0xf6b9('0x4a')](_0x56167d,function(_0x5d36c6){_0x5d36c6['MailAccountId']=_0x1f62fa;return _0x5d36c6;});return db['MailApplication']['bulkCreate'](_0x2a9deb,{'transaction':_0xe62ae});});}else{_0x449e9b=0x194;_0x2fcfa1=[];}});})['then'](function(){if(_0x449e9b!==0x194){return db[_0xf6b9('0x93')]['findAndCountAll']({'where':{'MailAccountId':_0x1f62fa},'order':'priority'})[_0xf6b9('0x11')](function(_0x5e1b13){_0x2fcfa1=_0x5e1b13;});}})[_0xf6b9('0x1a')](function(_0x24f793){_0x449e9b=0x1f4;logger[_0xf6b9('0x17')](_0x24f793[_0xf6b9('0x29')]);if(_0x24f793['name']){delete _0x24f793[_0xf6b9('0x2a')];}_0x2fcfa1=_0x24f793;})[_0xf6b9('0x94')](function(){if(_0x2fcfa1===null){_0x5d81b5[_0xf6b9('0x1b')](_0x449e9b);}else{if(_0x449e9b===0x1f4){_0x5d81b5[_0xf6b9('0x1c')](_0x449e9b)[_0xf6b9('0x2b')](_0x2fcfa1);}else{_0x5d81b5[_0xf6b9('0x1c')](_0x449e9b)[_0xf6b9('0x1e')](_0x2fcfa1);}}});};exports[_0xf6b9('0x95')]=function(_0xf85ed1,_0x3c9456){var _0x3a5345={};var _0x32afcc={};var _0x5d7e3c;var _0x18a44c;return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0xf85ed1[_0xf6b9('0x63')]['id']}})['then'](handleEntityNotFound(_0x3c9456,null))[_0xf6b9('0x11')](function(_0xbf9422){if(_0xbf9422){_0x5d7e3c=_0xbf9422;_0x32afcc[_0xf6b9('0x4f')]=_['keys'](db[_0xf6b9('0x93')]['rawAttributes']);_0x32afcc[_0xf6b9('0x50')]=_[_0xf6b9('0x64')](_0xf85ed1[_0xf6b9('0x50')]);_0x32afcc['filters']=_['intersection'](_0x32afcc[_0xf6b9('0x4f')],_0x32afcc[_0xf6b9('0x50')]);_0x3a5345[_0xf6b9('0x51')]=_['intersection'](_0x32afcc[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0xf85ed1[_0xf6b9('0x50')][_0xf6b9('0x53')]));_0x3a5345['attributes']=_0x3a5345[_0xf6b9('0x51')][_0xf6b9('0x54')]?_0x3a5345[_0xf6b9('0x51')]:_0x32afcc['model'];_0x3a5345[_0xf6b9('0x57')]=qs[_0xf6b9('0x58')](_0xf85ed1[_0xf6b9('0x50')][_0xf6b9('0x58')]);_0x3a5345[_0xf6b9('0x59')]=qs[_0xf6b9('0x5a')](_['pick'](_0xf85ed1['query'],_0x32afcc[_0xf6b9('0x5a')]));if(_0xf85ed1[_0xf6b9('0x50')][_0xf6b9('0x5b')]){_0x3a5345['where']=_[_0xf6b9('0x5c')](_0x3a5345[_0xf6b9('0x59')],{'$or':_[_0xf6b9('0x4a')](_0x3a5345[_0xf6b9('0x51')],function(_0x336be0){var _0x3b3e9d={};_0x3b3e9d[_0x336be0]={'$like':'%'+_0xf85ed1['query'][_0xf6b9('0x5b')]+'%'};return _0x3b3e9d;})});}_0x3a5345=_[_0xf6b9('0x5c')]({},_0x3a5345,_0xf85ed1[_0xf6b9('0x5e')]);return _0x5d7e3c['getApplications'](_0x3a5345);}})[_0xf6b9('0x11')](function(_0x1543f4){if(_0x1543f4){_0x18a44c=_0x1543f4[_0xf6b9('0x54')];if(!_0xf85ed1[_0xf6b9('0x50')][_0xf6b9('0x55')](_0xf6b9('0x56'))){_0x3a5345['limit']=qs[_0xf6b9('0x20')](_0xf85ed1[_0xf6b9('0x50')][_0xf6b9('0x20')]);_0x3a5345[_0xf6b9('0x1f')]=qs['offset'](_0xf85ed1[_0xf6b9('0x50')][_0xf6b9('0x1f')]);}return _0x5d7e3c[_0xf6b9('0x95')](_0x3a5345);}})['then'](function(_0x1f4811){if(_0x1f4811){return _0x1f4811?{'count':_0x18a44c,'rows':_0x1f4811}:null;}})[_0xf6b9('0x11')](respondWithResult(_0x3c9456,null))['catch'](handleError(_0x3c9456,null));};exports[_0xf6b9('0x96')]=function(_0x4bf9fb,_0x4a5e47){var _0x419a03={'raw':!![],'where':{}};var _0x50cf66={};var _0x2d3d12={'count':0x0,'rows':[]};return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0x4bf9fb[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x4a5e47,null))[_0xf6b9('0x11')](function(_0x4209e9){if(_0x4209e9){_0x50cf66[_0xf6b9('0x4f')]=_[_0xf6b9('0x64')](db[_0xf6b9('0x97')][_0xf6b9('0x70')]);_0x50cf66['query']=_[_0xf6b9('0x64')](_0x4bf9fb[_0xf6b9('0x50')]);_0x50cf66['filters']=_['intersection'](_0x50cf66[_0xf6b9('0x4f')],_0x50cf66['query']);_0x419a03[_0xf6b9('0x51')]=_[_0xf6b9('0x52')](_0x50cf66[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0x4bf9fb['query'][_0xf6b9('0x53')]));_0x419a03[_0xf6b9('0x51')]=_0x419a03['attributes'][_0xf6b9('0x54')]?_0x419a03[_0xf6b9('0x51')]:_0x50cf66[_0xf6b9('0x4f')];if(!_0x4bf9fb[_0xf6b9('0x50')]['hasOwnProperty'](_0xf6b9('0x56'))){_0x419a03['limit']=qs[_0xf6b9('0x20')](_0x4bf9fb[_0xf6b9('0x50')]['limit']);_0x419a03[_0xf6b9('0x1f')]=qs[_0xf6b9('0x1f')](_0x4bf9fb[_0xf6b9('0x50')][_0xf6b9('0x1f')]);}_0x419a03['order']=qs[_0xf6b9('0x58')](_0x4bf9fb[_0xf6b9('0x50')]['sort']);_0x419a03['where']=qs[_0xf6b9('0x5a')](_[_0xf6b9('0x71')](_0x4bf9fb[_0xf6b9('0x50')],_0x50cf66[_0xf6b9('0x5a')]));_0x419a03[_0xf6b9('0x59')]['MailAccountId']=_0x4209e9['id'];if(_0x4bf9fb[_0xf6b9('0x50')][_0xf6b9('0x5b')]){_0x419a03['where']=_[_0xf6b9('0x5c')](_0x419a03[_0xf6b9('0x59')],{'$or':_[_0xf6b9('0x4a')](_0x419a03[_0xf6b9('0x51')],function(_0x2ea8ad){var _0x5d7709={};_0x5d7709[_0x2ea8ad]={'$like':'%'+_0x4bf9fb[_0xf6b9('0x50')][_0xf6b9('0x5b')]+'%'};return _0x5d7709;})});}if(_0x4bf9fb['query'][_0xf6b9('0x98')]){var _0x3dd025=_0x4bf9fb[_0xf6b9('0x50')][_0xf6b9('0x98')][_0xf6b9('0x99')](',');var _0x35b20d={};_0x35b20d[_0x3dd025[0x0]]={'$gte':moment(_0x3dd025[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x419a03[_0xf6b9('0x59')]=_[_0xf6b9('0x5c')](_0x419a03[_0xf6b9('0x59')],_0x35b20d);}_0x419a03=_['merge']({},_0x419a03,_0x4bf9fb['options']);return db[_0xf6b9('0x97')][_0xf6b9('0x22')]({'where':_0x419a03['where']})[_0xf6b9('0x11')](function(_0x479d94){_0x2d3d12['count']=_0x479d94;if(_0x4bf9fb['query'][_0xf6b9('0x5f')]){_0x419a03[_0xf6b9('0x65')]=[{'all':!![]}];}return db[_0xf6b9('0x97')][_0xf6b9('0x60')](_0x419a03);})['then'](function(_0x1e30a1){if(_0x4bf9fb[_0xf6b9('0x50')][_0xf6b9('0x9a')]===_0xf6b9('0x9b')){for(var _0x9283ad=0x0;_0x9283ad<_0x1e30a1[_0xf6b9('0x54')];_0x9283ad++){_0x1e30a1[_0x9283ad]['body']=juice(_0x1e30a1[_0x9283ad]['body']);}}_0x2d3d12[_0xf6b9('0x61')]=_0x1e30a1;return _0x2d3d12;});}})[_0xf6b9('0x11')](respondWithFilteredResult(_0x4a5e47,_0x419a03))[_0xf6b9('0x1a')](handleError(_0x4a5e47,null));};exports[_0xf6b9('0x2b')]=function(_0x536628,_0x3eebfe){var _0xa2268e,_0x354932={},_0x53f180;if(_0x536628[_0xf6b9('0x67')]['to']){_0x53f180=_0x536628[_0xf6b9('0x67')]['to'][_0xf6b9('0x99')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x536628[_0xf6b9('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0xf6b9('0x9c'),'include':[{'model':db[_0xf6b9('0x87')],'as':_0xf6b9('0x9d'),'where':{'email':_0x53f180},'limit':0x1,'order':[['updatedAt',_0xf6b9('0x9e')]]}]},{'model':db[_0xf6b9('0x48')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf6b9('0x9f')],'as':_0xf6b9('0x9f'),'raw':!![]}]}]})[_0xf6b9('0x11')](handleEntityNotFound(_0x3eebfe,null))[_0xf6b9('0x11')](function(_0x390a53){if(!_0x390a53)return;_0xa2268e=_0x390a53;if(!_0x390a53['Smtp'])throw new Error(_0xf6b9('0xa0'));if(_[_0xf6b9('0xa1')](_0x536628[_0xf6b9('0x67')][_0xf6b9('0xa2')])){_0x536628[_0xf6b9('0x67')][_0xf6b9('0xa2')]=util[_0xf6b9('0xa3')](_0xf6b9('0xa4'),_0x390a53[_0xf6b9('0x2a')],_0x390a53[_0xf6b9('0x78')]||_0x390a53['Smtp'][_0xf6b9('0x39')]);}if(_0x536628['body']['attachments']&&_0x536628['body'][_0xf6b9('0xa5')][_0xf6b9('0x54')]){for(var _0x48ee3f=0x0;_0x48ee3f<_0x536628[_0xf6b9('0x67')][_0xf6b9('0xa5')]['length'];_0x48ee3f+=0x1){_0x536628[_0xf6b9('0x67')]['attachments'][_0x48ee3f]={'filename':_0x536628['body'][_0xf6b9('0xa5')][_0x48ee3f][_0xf6b9('0x2a')],'path':path[_0xf6b9('0xa6')](config[_0xf6b9('0xa7')],_0xf6b9('0xa8'),_0x536628[_0xf6b9('0x67')][_0xf6b9('0xa5')][_0x48ee3f][_0xf6b9('0xa9')])};}}var _0x31115d=_0x390a53[_0xf6b9('0xaa')]();return respondWithRpcPromise(_0xf6b9('0xab'),'sendMail',{'account':_0x31115d,'message':_0x536628[_0xf6b9('0x67')]});})[_0xf6b9('0x11')](function(_0x157324){if(!_0x157324)return;_0x354932=_0x157324;if(!_0xa2268e[_0xf6b9('0x9c')])throw new Error(_0xf6b9('0xac'));if(_0xa2268e[_0xf6b9('0x9c')]['Contacts'][_0xf6b9('0x54')])return _0xa2268e['List']['Contacts'][0x0];return db['CmContact']['create'](_[_0xf6b9('0xa')](_0x536628[_0xf6b9('0x67')],{'firstName':_0x536628['body']['to'],'email':_0x536628['body']['to'],'phone':_0x536628['body']['to'],'ListId':_0xa2268e[_0xf6b9('0xad')]}));})[_0xf6b9('0x11')](function(_0x3e961d){if(!_0x3e961d)return;var _0x1cfce1={'UserId':_0x536628[_0xf6b9('0x39')]['id'],'ContactId':_0x3e961d['id'],'MailAccountId':_0xa2268e['id'],'inReplyTo':_0x354932[_0xf6b9('0xae')],'to':_0x536628['body'][_0xf6b9('0xa2')],'cc':_0x536628[_0xf6b9('0x67')]['cc'],'subject':_0x536628[_0xf6b9('0x67')][_0xf6b9('0xaf')],'attach':_0x536628[_0xf6b9('0x67')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xf6b9('0xb0')),'lastMsgDirection':_0xf6b9('0xb1'),'Messages':[_[_0xf6b9('0x5c')](_0x536628['body'],{'messageId':_0x354932[_0xf6b9('0xae')],'sentAt':moment()[_0xf6b9('0xa3')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xa2268e['id'],'UserId':_0x536628[_0xf6b9('0x39')]['id'],'ContactId':_0x3e961d['id']})]};if(_0x536628['body']['Interaction']){_0x1cfce1=_[_0xf6b9('0x5c')](_0x1cfce1,_0x536628[_0xf6b9('0x67')][_0xf6b9('0xb2')]);}return db['MailInteraction'][_0xf6b9('0x6e')](_0x1cfce1,{'include':[{'model':db['MailMessage'],'as':_0xf6b9('0xb3')}]});})[_0xf6b9('0x11')](respondWithResult(_0x3eebfe,null))['catch'](handleError(_0x3eebfe,null));};exports['verifySmtp']=function(_0x488bf3,_0x85a74e){return db[_0xf6b9('0x4b')]['find']({'where':{'id':_0x488bf3[_0xf6b9('0x63')]['id']},'include':[{'model':db[_0xf6b9('0x48')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf6b9('0x9f')],'as':_0xf6b9('0x9f'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x85a74e,null))[_0xf6b9('0x11')](function(_0x138a4d){if(!_0x138a4d['Smtp'])return;var _0x560e50=_0x138a4d[_0xf6b9('0xaa')]();return respondWithRpcPromise(_0xf6b9('0xb4'),_0xf6b9('0xb5'),{'account':_0x560e50});})[_0xf6b9('0x11')](respondWithResult(_0x85a74e,null))[_0xf6b9('0x1a')](handleError(_0x85a74e,null));};exports[_0xf6b9('0x25')]=function(_0x441b55,_0x23a6a6){return db[_0xf6b9('0x4b')][_0xf6b9('0x66')]({'where':{'id':_0x441b55[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x23a6a6,null))['then'](function(_0x345752){if(_0x345752&&_0x345752[_0xf6b9('0x42')]){throw new db[(_0xf6b9('0xb6'))][(_0xf6b9('0xb7'))](_0xf6b9('0xb8'));}return _0x345752;})[_0xf6b9('0x11')](removeEntity(_0x23a6a6,null))[_0xf6b9('0x1a')](handleError(_0x23a6a6,null));};exports[_0xf6b9('0xb9')]=function(_0x21d1db,_0x35f3e5){return db['MailAccount'][_0xf6b9('0x66')]({'where':{'id':_0x21d1db[_0xf6b9('0x63')]['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0x35f3e5,null))[_0xf6b9('0x11')](function(_0xc15992){if(_0xc15992){return _0xc15992[_0xf6b9('0xb9')](_0x21d1db[_0xf6b9('0x67')]['ids'],_[_0xf6b9('0x86')](_0x21d1db[_0xf6b9('0x67')],['ids','id'])||{})[_0xf6b9('0xba')](function(_0x19946e){for(var _0x21ee64=0x0;_0x21ee64<_0x21d1db[_0xf6b9('0x67')]['ids']['length'];_0x21ee64+=0x1){socket['emit'](_0xf6b9('0xbb'),{'UserId':Number(_0x21d1db[_0xf6b9('0x67')]['ids'][_0x21ee64]),'MailAccountId':Number(_0x21d1db[_0xf6b9('0x63')]['id'])});}return _0x19946e;});}})[_0xf6b9('0x11')](respondWithResult(_0x35f3e5,null))[_0xf6b9('0x1a')](handleError(_0x35f3e5,null));};exports[_0xf6b9('0xbc')]=function(_0x3947e8,_0xa15360){return db['MailAccount'][_0xf6b9('0x66')]({'where':{'id':_0x3947e8['params']['id']}})[_0xf6b9('0x11')](handleEntityNotFound(_0xa15360,null))['then'](function(_0x4c721e){if(_0x4c721e){return _0x4c721e[_0xf6b9('0xbc')](_0x3947e8[_0xf6b9('0x50')]['ids'])[_0xf6b9('0x11')](function(){if(_['isArray'](_0x3947e8[_0xf6b9('0x50')][_0xf6b9('0x85')])){for(var _0x5545da=0x0;_0x5545da<_0x3947e8['query']['ids'][_0xf6b9('0x54')];_0x5545da+=0x1){socket['emit'](_0xf6b9('0xbd'),{'UserId':Number(_0x3947e8[_0xf6b9('0x50')][_0xf6b9('0x85')][_0x5545da]),'MailAccountId':Number(_0x3947e8[_0xf6b9('0x63')]['id'])});}}else{socket['emit'](_0xf6b9('0xbd'),{'UserId':Number(_0x3947e8[_0xf6b9('0x50')][_0xf6b9('0x85')]),'MailAccountId':Number(_0x3947e8[_0xf6b9('0x63')]['id'])});}});}})[_0xf6b9('0x11')](respondWithStatusCode(_0xa15360,null))['catch'](handleError(_0xa15360,null));};exports[_0xf6b9('0xbe')]=function(_0xcb5d0c,_0x703b50){var _0xed040d={};var _0x295ab4={};var _0x112969;var _0x9762fb;return db[_0xf6b9('0x4b')][_0xf6b9('0x6f')]({'where':{'id':_0xcb5d0c[_0xf6b9('0x63')]['id']}})['then'](handleEntityNotFound(_0x703b50,null))['then'](function(_0x58359b){if(_0x58359b){_0x112969=_0x58359b;_0x295ab4[_0xf6b9('0x4f')]=_['keys'](db['User']['rawAttributes']);_0x295ab4[_0xf6b9('0x50')]=_[_0xf6b9('0x64')](_0xcb5d0c[_0xf6b9('0x50')]);_0x295ab4[_0xf6b9('0x5a')]=_['intersection'](_0x295ab4['model'],_0x295ab4[_0xf6b9('0x50')]);_0xed040d[_0xf6b9('0x51')]=_[_0xf6b9('0x52')](_0x295ab4[_0xf6b9('0x4f')],qs[_0xf6b9('0x53')](_0xcb5d0c[_0xf6b9('0x50')][_0xf6b9('0x53')]));_0xed040d[_0xf6b9('0x51')]=_0xed040d[_0xf6b9('0x51')][_0xf6b9('0x54')]?_0xed040d[_0xf6b9('0x51')]:_0x295ab4[_0xf6b9('0x4f')];_0xed040d[_0xf6b9('0x57')]=qs['sort'](_0xcb5d0c[_0xf6b9('0x50')][_0xf6b9('0x58')]);_0xed040d[_0xf6b9('0x59')]=qs[_0xf6b9('0x5a')](_['pick'](_0xcb5d0c[_0xf6b9('0x50')],_0x295ab4[_0xf6b9('0x5a')]));if(_0xcb5d0c[_0xf6b9('0x50')][_0xf6b9('0x5b')]){_0xed040d['where']=_['merge'](_0xed040d[_0xf6b9('0x59')],{'$or':_[_0xf6b9('0x4a')](_0xed040d['attributes'],function(_0x34c46d){var _0x499725={};_0x499725[_0x34c46d]={'$like':'%'+_0xcb5d0c[_0xf6b9('0x50')][_0xf6b9('0x5b')]+'%'};return _0x499725;})});}_0xed040d=_[_0xf6b9('0x5c')]({},_0xed040d,_0xcb5d0c[_0xf6b9('0x5e')]);return _0x112969['getAgents'](_0xed040d);}})[_0xf6b9('0x11')](function(_0x5648d9){if(_0x5648d9){_0x9762fb=_0x5648d9[_0xf6b9('0x54')];if(!_0xcb5d0c[_0xf6b9('0x50')][_0xf6b9('0x55')]('nolimit')){_0xed040d[_0xf6b9('0x20')]=qs[_0xf6b9('0x20')](_0xcb5d0c[_0xf6b9('0x50')][_0xf6b9('0x20')]);_0xed040d['offset']=qs[_0xf6b9('0x1f')](_0xcb5d0c[_0xf6b9('0x50')][_0xf6b9('0x1f')]);}return _0x112969['getAgents'](_0xed040d);}})['then'](function(_0x548949){if(_0x548949){return _0x548949?{'count':_0x9762fb,'rows':_0x548949}:null;}})[_0xf6b9('0x11')](respondWithResult(_0x703b50,null))['catch'](handleError(_0x703b50,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b19d7a5..5769a2d 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 _0x3989=['MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3989,0x12f));var _0x9398=function(_0x98cd88,_0x348051){_0x98cd88=_0x98cd88-0x0;var _0x33b9e0=_0x3989[_0x98cd88];return _0x33b9e0;};'use strict';var EventEmitter=require(_0x9398('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x9398('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9398('0x2')](0x0);var events={'afterCreate':_0x9398('0x3'),'afterUpdate':_0x9398('0x4'),'afterDestroy':_0x9398('0x5')};function emitEvent(_0x117eaf){return function(_0x4759ec,_0x2f9145,_0x2774cb){MailAccountEvents[_0x9398('0x6')](_0x117eaf+':'+_0x4759ec['id'],_0x4759ec);MailAccountEvents[_0x9398('0x6')](_0x117eaf,_0x4759ec);_0x2774cb(null);};}for(var e in events){if(events[_0x9398('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xfcd2=['update','emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcd2,0x13f));var _0x2fcd=function(_0x28b346,_0x26914c){_0x28b346=_0x28b346-0x0;var _0x41e7f2=_0xfcd2[_0x28b346];return _0x41e7f2;};'use strict';var EventEmitter=require(_0x2fcd('0x0'));var MailAccount=require(_0x2fcd('0x1'))['db'][_0x2fcd('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2fcd('0x3')](0x0);var events={'afterCreate':_0x2fcd('0x4'),'afterUpdate':_0x2fcd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x463a8b){return function(_0x28af6d,_0x302501,_0x4b2b18){MailAccountEvents[_0x2fcd('0x6')](_0x463a8b+':'+_0x28af6d['id'],_0x28af6d);MailAccountEvents['emit'](_0x463a8b,_0x28af6d);_0x4b2b18(null);};}for(var e in events){if(events[_0x2fcd('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x2fcd('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 155b741..d986e06 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 _0x58bf=['mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','modernAuthentication','OAuth2','user','CloudProvider','auth','pass','./mailAccount.attributes','exports','define'];(function(_0x263904,_0x52bb61){var _0x33bef8=function(_0x5850ef){while(--_0x5850ef){_0x263904['push'](_0x263904['shift']());}};_0x33bef8(++_0x52bb61);}(_0x58bf,0xc3));var _0xf58b=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0x58bf[_0x165c96];return _0x5c2420;};'use strict';var attributes=require(_0xf58b('0x0'));module[_0xf58b('0x1')]=function(_0x4ee0a4){return _0x4ee0a4[_0xf58b('0x2')]('MailAccount',attributes,{'tableName':_0xf58b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xe3848b=this;var _0x242471={'id':_0xe3848b['id'],'tls':{'rejectUnauthorized':![]}};if(_0xe3848b[_0xf58b('0x4')]!==_0xf58b('0x5')){_0x242471[_0xf58b('0x6')]=_0xe3848b[_0xf58b('0x4')];}else{_0x242471['host']=_0xe3848b['Smtp'][_0xf58b('0x7')];_0x242471[_0xf58b('0x8')]=_0xe3848b[_0xf58b('0x9')][_0xf58b('0x8')];_0x242471[_0xf58b('0xa')]=_0xe3848b['Smtp']['secure'];}if(_0xe3848b[_0xf58b('0x9')][_0xf58b('0xb')]){if(_0xe3848b[_0xf58b('0x9')][_0xf58b('0xc')]){if(!_0xe3848b[_0xf58b('0x9')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x242471['auth']={'type':_0xf58b('0xd'),'user':_0xe3848b[_0xf58b('0x9')][_0xf58b('0xe')],'accessToken':_0xe3848b['Smtp'][_0xf58b('0xf')]['data5']};}else{_0x242471[_0xf58b('0x10')]={'user':_0xe3848b[_0xf58b('0x9')][_0xf58b('0xe')],'pass':_0xe3848b[_0xf58b('0x9')][_0xf58b('0x11')]};}}return _0x242471;}}});}; \ No newline at end of file +var _0x73d8=['host','Smtp','port','secure','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','CloudProvider','data5','pass','./mailAccount.attributes','exports','define','MailAccount','provider','custom'];(function(_0x2a7c2a,_0x37cc9e){var _0x195732=function(_0x4d3902){while(--_0x4d3902){_0x2a7c2a['push'](_0x2a7c2a['shift']());}};_0x195732(++_0x37cc9e);}(_0x73d8,0xb5));var _0x873d=function(_0x28ec49,_0x352f20){_0x28ec49=_0x28ec49-0x0;var _0x4088c0=_0x73d8[_0x28ec49];return _0x4088c0;};'use strict';var attributes=require(_0x873d('0x0'));module[_0x873d('0x1')]=function(_0x3b5723){return _0x3b5723[_0x873d('0x2')](_0x873d('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5e464e=this;var _0x51d26c={'id':_0x5e464e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5e464e[_0x873d('0x4')]!==_0x873d('0x5')){_0x51d26c['service']=_0x5e464e[_0x873d('0x4')];}else{_0x51d26c['host']=_0x5e464e['Smtp'][_0x873d('0x6')];_0x51d26c['port']=_0x5e464e[_0x873d('0x7')][_0x873d('0x8')];_0x51d26c['secure']=_0x5e464e[_0x873d('0x7')][_0x873d('0x9')];}if(_0x5e464e[_0x873d('0x7')]['authentication']){if(_0x5e464e['Smtp'][_0x873d('0xa')]){if(!_0x5e464e['Smtp']['CloudProvider'])throw new Error(_0x873d('0xb'));_0x51d26c[_0x873d('0xc')]={'type':'OAuth2','user':_0x5e464e[_0x873d('0x7')][_0x873d('0xd')],'accessToken':_0x5e464e[_0x873d('0x7')][_0x873d('0xe')][_0x873d('0xf')]};}else{_0x51d26c[_0x873d('0xc')]={'user':_0x5e464e[_0x873d('0x7')][_0x873d('0xd')],'pass':_0x5e464e[_0x873d('0x7')][_0x873d('0x10')]};}}return _0x51d26c;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 49bee34..dafcb25 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 _0xc6ac=['update','interaction','created','contact','attachments','originTo','bcc','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications','list','orderBy','priority','asc','autoclose','length','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread'];(function(_0x207b87,_0x3266e5){var _0xbc46ff=function(_0x8a4c5f){while(--_0x8a4c5f){_0x207b87['push'](_0x207b87['shift']());}};_0xbc46ff(++_0x3266e5);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x11d508,_0x8beb18){_0x11d508=_0x11d508-0x0;var _0x4088f5=_0xc6ac[_0x11d508];return _0x4088f5;};'use strict';var _=require(_0xcc6a('0x0'));var moment=require(_0xcc6a('0x1'));var BPromise=require(_0xcc6a('0x2'));var rs=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var db=require(_0xcc6a('0x5'))['db'];var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var jayson=require(_0xcc6a('0x9'));var client=jayson[_0xcc6a('0xa')][_0xcc6a('0xb')]({'port':0x232c});config[_0xcc6a('0xc')]=_[_0xcc6a('0xd')](config['redis'],{'host':_0xcc6a('0xe'),'port':0x18eb});var socket=require(_0xcc6a('0xf'))(new Redis(config[_0xcc6a('0xc')]));require('./mailAccount.socket')[_0xcc6a('0x10')](socket);function respondWithRpcPromise(_0x210f63,_0x7806a0,_0x463ebb){return new BPromise(function(_0x3eb04a,_0x5e91a2){return client[_0xcc6a('0x11')](_0x210f63,_0x463ebb)[_0xcc6a('0x12')](function(_0x109693){logger['info'](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));logger[_0xcc6a('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x7806a0,'request\x20sent',JSON[_0xcc6a('0x16')](_0x109693));if(_0x109693[_0xcc6a('0x17')]){if(_0x109693[_0xcc6a('0x17')]['code']===0x1f4){logger['error'](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);return _0x5e91a2(_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);}logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')]['message']);return _0x3eb04a(_0x109693['error']['message']);}else{logger[_0xcc6a('0x19')](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));_0x3eb04a(_0x109693[_0xcc6a('0x1a')][_0xcc6a('0x18')]);}})[_0xcc6a('0x1b')](function(_0x2d9585){logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x2d9585);_0x5e91a2(_0x2d9585);});});}exports[_0xcc6a('0x1c')]=function(_0x1d20a3){var _0x5b657e=this;return new Promise(function(_0xfec60f,_0x3e1fda){return db[_0xcc6a('0x1d')][_0xcc6a('0x1e')]({'raw':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')]['attributes']||null:null,'limit':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x22')]||null:null,'include':_0x1d20a3['options']?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x5fc697){return{'model':db[_0x5fc697['model']],'as':_0x5fc697['as'],'attributes':_0x5fc697[_0xcc6a('0x25')],'include':_0x5fc697[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x5fc697['include'],function(_0x3afb3a){return{'model':db[_0x3afb3a[_0xcc6a('0x26')]],'as':_0x3afb3a['as'],'attributes':_0x3afb3a['attributes'],'include':_0x3afb3a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x3afb3a[_0xcc6a('0x23')],function(_0x473f88){return{'model':db[_0x473f88['model']],'as':_0x473f88['as'],'attributes':_0x473f88[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x2c6d88){logger['info'](_0xcc6a('0x1c'),_0x1d20a3);logger['debug']('GetMailAccount',_0x1d20a3,JSON[_0xcc6a('0x16')](_0x2c6d88));_0xfec60f(_0x2c6d88);})[_0xcc6a('0x1b')](function(_0x3aa315){logger[_0xcc6a('0x17')](_0xcc6a('0x1c'),_0x3aa315[_0xcc6a('0x18')],_0x1d20a3);_0x3e1fda(_0x5b657e['error'](0x1f4,_0x3aa315[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x27')]=function(_0x147aff){var _0x2faeb5=this;return new Promise(function(_0x211a8c,_0x152ebd){return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'raw':_0x147aff['options']?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')]['attributes']||null:null,'include':_0x147aff[_0xcc6a('0x1f')]?_0x147aff['options']['include']?_['map'](_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x1101ec){return{'model':db[_0x1101ec[_0xcc6a('0x26')]],'as':_0x1101ec['as'],'attributes':_0x1101ec[_0xcc6a('0x25')],'include':_0x1101ec['include']?_['map'](_0x1101ec[_0xcc6a('0x23')],function(_0x11173a){return{'model':db[_0x11173a[_0xcc6a('0x26')]],'as':_0x11173a['as'],'attributes':_0x11173a['attributes'],'include':_0x11173a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x11173a[_0xcc6a('0x23')],function(_0xa326b2){return{'model':db[_0xa326b2[_0xcc6a('0x26')]],'as':_0xa326b2['as'],'attributes':_0xa326b2[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x18a252){if(_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x29')]===!![])_0x18a252[_0xcc6a('0x2a')](_0xcc6a('0x2b'),_0x18a252[_0xcc6a('0x2c')]());logger[_0xcc6a('0x19')](_0xcc6a('0x27'),_0x147aff);logger[_0xcc6a('0x15')](_0xcc6a('0x27'),_0x147aff,JSON[_0xcc6a('0x16')](_0x18a252));_0x211a8c(_0x18a252);})['catch'](function(_0x553e66){logger[_0xcc6a('0x17')](_0xcc6a('0x27'),_0x553e66[_0xcc6a('0x18')],_0x147aff);_0x152ebd(_0x2faeb5[_0xcc6a('0x17')](0x1f4,_0x553e66[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x2d')]=function(_0x3273bc){var _0x1199f1=this;return new Promise(function(_0x49b65c,_0x56bc7d){var _0x470e3b={'body':_0x3273bc['body'],'channel':'mail'};var _0x5cf1ba=_[_0xcc6a('0x2e')](_[_0xcc6a('0x2f')](db[_0xcc6a('0x30')][_0xcc6a('0x31')]),[_0xcc6a('0x32'),'updatedAt',_0xcc6a('0x33'),_0xcc6a('0x34')]);var _0x17e5a0=![];if(_0x3273bc[_0xcc6a('0x35')]['id']){delete _0x3273bc[_0xcc6a('0x35')]['id'];}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x37')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x38')));}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x35')])||_0x3273bc['body'][_0xcc6a('0x35')]===''){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x39')));}if(_['isNil'](_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cf1ba));}if(!_['includes'](_0x5cf1ba,_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x3b')+_0x5cf1ba));}var _0x345e94={};_0x345e94[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')]['from'];return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'where':{'id':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x3d')],'as':_0xcc6a('0x3e'),'include':[{'model':db[_0xcc6a('0x30')],'as':'Contacts','where':_0x345e94,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xcc6a('0x3f')],'as':_0xcc6a('0x40')},{'model':db[_0xcc6a('0x41')],'as':_0xcc6a('0x42'),'include':[{'model':db['CloudProvider'],'as':_0xcc6a('0x43')}]}]})['then'](function(_0x3aa7dd){if(_0x3aa7dd&&_0x3aa7dd[_0xcc6a('0x3e')]){var _0xcfc540=_0x3aa7dd[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x3c')]=_[_0xcc6a('0x45')](_0xcfc540,['Applications',_0xcc6a('0x3e')]);_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x2b')]=_0x3aa7dd[_0xcc6a('0x2c')]();_0x470e3b[_0xcc6a('0x46')]=_0xcfc540[_0xcc6a('0x40')];_0x470e3b[_0xcc6a('0x47')]=_0xcfc540[_0xcc6a('0x3e')];_0x470e3b[_0xcc6a('0x46')]=_[_0xcc6a('0x48')](_0x470e3b['applications'],[_0xcc6a('0x49')],[_0xcc6a('0x4a')]);if(_0x470e3b[_0xcc6a('0x3c')]&&_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x4b')]){_0x470e3b[_0xcc6a('0x46')]['push']({'id':0x0,'priority':_0x470e3b['applications'][_0xcc6a('0x4c')]+0x1,'app':'close','appdata':_0xcc6a('0x4b'),'interval':_0xcc6a('0x4d')});}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')];}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')];}if(_0xcfc540[_0xcc6a('0x3e')]['Contacts'][_0xcc6a('0x4c')]){return _0xcfc540['List'][_0xcc6a('0x4e')][0x0];}var _0x1570fe=_[_0xcc6a('0xd')](_0x3273bc['body'],{'firstName':_0x3273bc[_0xcc6a('0x35')]['from'],'ListId':_0xcfc540[_0xcc6a('0x34')]});_0x1570fe[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x37')];return db[_0xcc6a('0x30')][_0xcc6a('0x4f')](_0x1570fe);}else{throw new Error(_0xcc6a('0x50'));}})[_0xcc6a('0x12')](function(_0x11459f){_0x470e3b['contact']=_0x11459f;if(_0x11459f){if(!_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x51')]){_0x3273bc['body'][_0xcc6a('0x18')][_0xcc6a('0x51')]=rs[_0xcc6a('0x52')]()+'\x20'+_0x3273bc['body'][_0xcc6a('0x18')]['from'];}var _0x5e53e4={'ContactId':_0x11459f['id'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x54')],'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'};return db[_0xcc6a('0x57')]['find']({'where':{'closed':![],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x58')],'as':_0xcc6a('0x59'),'attributes':[_0xcc6a('0x51')],'where':{'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x5a')]}}]})[_0xcc6a('0x12')](function(_0x2686c8){if(_0x2686c8){return[_0x2686c8,![]];}return db[_0xcc6a('0x57')]['create'](_0x5e53e4)['then'](function(_0x4fe041){return[_0x4fe041,!![]];});});}else{throw new Error(_0xcc6a('0x5b'));}})[_0xcc6a('0x5c')](function(_0x9c444,_0x4a9f34){if(_0x9c444){_0x17e5a0=_0x4a9f34;if(!_0x4a9f34){return _0x9c444[_0xcc6a('0x5d')]({'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc['body']['message'][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x53')],'attach':_0x9c444[_0xcc6a('0x54')]?_0x9c444[_0xcc6a('0x54')]:_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xcc6a('0x56')),'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'});}else{return _0x9c444;}}})[_0xcc6a('0x12')](function(_0x56a3a0){_0x470e3b['interaction']=_0x56a3a0[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x5f')]=_0x17e5a0;return db[_0xcc6a('0x58')]['create']({'body':_0x3273bc['body']['body'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'MailInteractionId':_0x56a3a0['id'],'direction':'in','ContactId':_0x470e3b[_0xcc6a('0x60')]['id'],'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['messageId'],'from':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['from'],'to':_0x3273bc[_0xcc6a('0x35')]['message']['to'],'cc':_0x3273bc[_0xcc6a('0x35')]['message']['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc['body'][_0xcc6a('0x18')]['attach'],'Attachments':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x61')],'originTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x62')],'originCc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originCc'],'bcc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x63')],'ChatWebsiteId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['ChatWebsiteId']||null,'originChannel':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x64')]||null},{'include':[{'model':db[_0xcc6a('0x65')],'as':_0xcc6a('0x66')}]});})[_0xcc6a('0x12')](function(_0x598833){_0x470e3b[_0xcc6a('0x18')]=_0x598833;if(_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x67')]){return db[_0xcc6a('0x68')][_0xcc6a('0x28')]({'attributes':['id',_0xcc6a('0x69')],'where':{'id':_0x470e3b['interaction']['UserId']}})[_0xcc6a('0x12')](function(_0x43cbee){if(_0x43cbee){_0x470e3b[_0xcc6a('0x46')][_0xcc6a('0x6a')]({'id':0x0,'priority':0x0,'app':_0xcc6a('0x6b'),'appdata':_0x43cbee[_0xcc6a('0x69')]+','+(_0x470e3b[_0xcc6a('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0xcc6a('0x4d')});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);})[_0xcc6a('0x12')](function(_0x5e8e19){_0x49b65c(_0x5e8e19);})[_0xcc6a('0x1b')](function(_0x4688d3){_0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0x4688d3['message']));});});}; \ No newline at end of file +var _0x66fa=['ShowMailAccount','smtp','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','Applications','MailServerOut','Smtp','List','get','omit','smtpOptions','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch'];(function(_0x7caee1,_0x40dc30){var _0x4d26af=function(_0x479a34){while(--_0x479a34){_0x7caee1['push'](_0x7caee1['shift']());}};_0x4d26af(++_0x40dc30);}(_0x66fa,0x117));var _0xa66f=function(_0x474938,_0x3e1491){_0x474938=_0x474938-0x0;var _0x6b9e2d=_0x66fa[_0x474938];return _0x6b9e2d;};'use strict';var _=require(_0xa66f('0x0'));var moment=require(_0xa66f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa66f('0x2'));var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var logger=require(_0xa66f('0x5'))(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var jayson=require(_0xa66f('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xa66f('0x9')]=_[_0xa66f('0xa')](config[_0xa66f('0x9')],{'host':_0xa66f('0xb'),'port':0x18eb});var socket=require(_0xa66f('0xc'))(new Redis(config['redis']));require(_0xa66f('0xd'))['register'](socket);function respondWithRpcPromise(_0x46c788,_0x597c7c,_0x101e10){return new BPromise(function(_0x53ca76,_0x52d802){return client['request'](_0x46c788,_0x101e10)[_0xa66f('0xe')](function(_0x825868){logger['info'](_0xa66f('0xf'),_0x597c7c,'request\x20sent');logger[_0xa66f('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x597c7c,_0xa66f('0x11'),JSON[_0xa66f('0x12')](_0x825868));if(_0x825868[_0xa66f('0x13')]){if(_0x825868['error']['code']===0x1f4){logger[_0xa66f('0x13')]('MailAccount,\x20%s,\x20%s',_0x597c7c,_0x825868['error']['message']);return _0x52d802(_0x825868[_0xa66f('0x13')][_0xa66f('0x14')]);}logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x825868[_0xa66f('0x13')]['message']);return _0x53ca76(_0x825868['error'][_0xa66f('0x14')]);}else{logger[_0xa66f('0x15')](_0xa66f('0xf'),_0x597c7c,_0xa66f('0x11'));_0x53ca76(_0x825868['result'][_0xa66f('0x14')]);}})['catch'](function(_0x4a28d4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x4a28d4);_0x52d802(_0x4a28d4);});});}exports[_0xa66f('0x16')]=function(_0x355ddc){var _0x2c5b76=this;return new Promise(function(_0x408bc7,_0x251f60){return db[_0xa66f('0x17')][_0xa66f('0x18')]({'raw':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x355ddc['options']?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'limit':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')]['limit']||null:null,'include':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x355ddc['options']['include'],function(_0xed98b9){return{'model':db[_0xed98b9['model']],'as':_0xed98b9['as'],'attributes':_0xed98b9[_0xa66f('0x1c')],'include':_0xed98b9[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0xed98b9['include'],function(_0x4683c7){return{'model':db[_0x4683c7[_0xa66f('0x1f')]],'as':_0x4683c7['as'],'attributes':_0x4683c7[_0xa66f('0x1c')],'include':_0x4683c7[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x4683c7[_0xa66f('0x1d')],function(_0x1eb86a){return{'model':db[_0x1eb86a[_0xa66f('0x1f')]],'as':_0x1eb86a['as'],'attributes':_0x1eb86a[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xe')](function(_0x45f71c){logger[_0xa66f('0x15')](_0xa66f('0x16'),_0x355ddc);logger[_0xa66f('0x10')]('GetMailAccount',_0x355ddc,JSON['stringify'](_0x45f71c));_0x408bc7(_0x45f71c);})[_0xa66f('0x20')](function(_0x27ceae){logger['error'](_0xa66f('0x16'),_0x27ceae[_0xa66f('0x14')],_0x355ddc);_0x251f60(_0x2c5b76['error'](0x1f4,_0x27ceae[_0xa66f('0x14')]));});});};exports[_0xa66f('0x21')]=function(_0x9d78d5){var _0x2c2ace=this;return new Promise(function(_0x395623,_0x548add){return db[_0xa66f('0x17')]['find']({'raw':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'include':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')],function(_0x35ef27){return{'model':db[_0x35ef27[_0xa66f('0x1f')]],'as':_0x35ef27['as'],'attributes':_0x35ef27['attributes'],'include':_0x35ef27[_0xa66f('0x1d')]?_['map'](_0x35ef27[_0xa66f('0x1d')],function(_0x46f6cc){return{'model':db[_0x46f6cc[_0xa66f('0x1f')]],'as':_0x46f6cc['as'],'attributes':_0x46f6cc[_0xa66f('0x1c')],'include':_0x46f6cc[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x46f6cc[_0xa66f('0x1d')],function(_0xcee582){return{'model':db[_0xcee582['model']],'as':_0xcee582['as'],'attributes':_0xcee582[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4477cf){if(_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x22')]===!![])_0x4477cf['setDataValue']('smtpOptions',_0x4477cf[_0xa66f('0x23')]());logger[_0xa66f('0x15')](_0xa66f('0x21'),_0x9d78d5);logger[_0xa66f('0x10')](_0xa66f('0x21'),_0x9d78d5,JSON['stringify'](_0x4477cf));_0x395623(_0x4477cf);})['catch'](function(_0x49b869){logger[_0xa66f('0x13')]('ShowMailAccount',_0x49b869['message'],_0x9d78d5);_0x548add(_0x2c2ace['error'](0x1f4,_0x49b869[_0xa66f('0x14')]));});});};exports['NotifyMailAccount']=function(_0x8965d3){var _0x17d942=this;return new Promise(function(_0x23a546,_0x1647a0){var _0xd65c5d={'body':_0x8965d3[_0xa66f('0x24')],'channel':_0xa66f('0x25')};var _0x261089=_[_0xa66f('0x26')](_[_0xa66f('0x27')](db[_0xa66f('0x28')][_0xa66f('0x29')]),[_0xa66f('0x2a'),_0xa66f('0x2b'),'CompanyId',_0xa66f('0x2c')]);var _0x25c2cb=![];if(_0x8965d3['body']['id']){delete _0x8965d3[_0xa66f('0x24')]['id'];}if(_['isNil'](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')])){return _0x1647a0(_0x17d942['error'](0x1f4,_0xa66f('0x2e')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')]['body'])||_0x8965d3[_0xa66f('0x24')]['body']===''){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x30')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x32')+_0x261089));}if(!_['includes'](_0x261089,_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x33')+_0x261089));}var _0x374e53={};_0x374e53[_0x8965d3['body']['mapKey']]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x17')][_0xa66f('0x34')]({'where':{'id':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x36')],'as':'List','include':[{'model':db[_0xa66f('0x28')],'as':_0xa66f('0x37'),'where':_0x374e53,'limit':0x1,'order':[[_0xa66f('0x2b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xa66f('0x38')},{'model':db[_0xa66f('0x39')],'as':_0xa66f('0x3a'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x19e7ce){if(_0x19e7ce&&_0x19e7ce[_0xa66f('0x3b')]){var _0x40d3b6=_0x19e7ce[_0xa66f('0x3c')]({'plain':!![]});_0xd65c5d[_0xa66f('0x35')]=_[_0xa66f('0x3d')](_0x40d3b6,[_0xa66f('0x38'),_0xa66f('0x3b')]);_0xd65c5d['account'][_0xa66f('0x3e')]=_0x19e7ce[_0xa66f('0x23')]();_0xd65c5d[_0xa66f('0x3f')]=_0x40d3b6[_0xa66f('0x38')];_0xd65c5d[_0xa66f('0x40')]=_0x40d3b6[_0xa66f('0x3b')];_0xd65c5d['applications']=_[_0xa66f('0x41')](_0xd65c5d[_0xa66f('0x3f')],[_0xa66f('0x42')],[_0xa66f('0x43')]);if(_0xd65c5d[_0xa66f('0x35')]&&_0xd65c5d['account'][_0xa66f('0x44')]){_0xd65c5d['applications'][_0xa66f('0x45')]({'id':0x0,'priority':_0xd65c5d['applications']['length']+0x1,'app':_0xa66f('0x46'),'appdata':_0xa66f('0x44'),'interval':_0xa66f('0x47')});}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x38')]){delete _0xd65c5d[_0xa66f('0x35')]['Applications'];}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')]){delete _0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')];}if(_0x40d3b6['List'][_0xa66f('0x37')]['length']){return _0x40d3b6[_0xa66f('0x3b')][_0xa66f('0x37')][0x0];}var _0x21482f=_[_0xa66f('0xa')](_0x8965d3[_0xa66f('0x24')],{'firstName':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')],'ListId':_0x40d3b6['ListId']});_0x21482f[_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')]]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x28')][_0xa66f('0x48')](_0x21482f);}else{throw new Error(_0xa66f('0x49'));}})[_0xa66f('0xe')](function(_0x350fce){_0xd65c5d['contact']=_0x350fce;if(_0x350fce){if(!_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')]){_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')]=rs[_0xa66f('0x4b')]()+'\x20'+_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x2d')];}var _0x11c89e={'ContactId':_0x350fce['id'],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'inReplyTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x4a')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3['body']['message'][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['attach'],'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'};return db[_0xa66f('0x4f')][_0xa66f('0x34')]({'where':{'closed':![],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x51'),'attributes':[_0xa66f('0x4a')],'where':{'messageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x52')]}}]})[_0xa66f('0xe')](function(_0x235e4f){if(_0x235e4f){return[_0x235e4f,![]];}return db[_0xa66f('0x4f')][_0xa66f('0x48')](_0x11c89e)[_0xa66f('0xe')](function(_0x41ffa7){return[_0x41ffa7,!![]];});});}else{throw new Error(_0xa66f('0x53'));}})['spread'](function(_0x52f22d,_0x46327d){if(_0x52f22d){_0x25c2cb=_0x46327d;if(!_0x46327d){return _0x52f22d[_0xa66f('0x54')]({'inReplyTo':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')],'to':_0x8965d3['body'][_0xa66f('0x14')]['from'],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['subject'],'attach':_0x52f22d[_0xa66f('0x55')]?_0x52f22d[_0xa66f('0x55')]:_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x55')],'substatus':null,'substatusAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'});}else{return _0x52f22d;}}})[_0xa66f('0xe')](function(_0x290323){_0xd65c5d[_0xa66f('0x56')]=_0x290323['get']({'plain':!![]});_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x57')]=_0x25c2cb;return db[_0xa66f('0x50')][_0xa66f('0x48')]({'body':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x24')],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'MailInteractionId':_0x290323['id'],'direction':'in','ContactId':_0xd65c5d[_0xa66f('0x58')]['id'],'messageId':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')],'from':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['to'],'cc':_0x8965d3[_0xa66f('0x24')]['message']['cc'],'subject':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')]['message']['attach'],'Attachments':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x59')],'originTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5a')],'originCc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5b')],'bcc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5c')],'ChatWebsiteId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5d')]||null,'originChannel':_0x8965d3[_0xa66f('0x24')]['message']['originChannel']||_0xa66f('0x5e'),'ChatOfflineMessageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0xa66f('0x60')}]});})['then'](function(_0x4feda0){_0xd65c5d['message']=_0x4feda0;if(_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]){return db[_0xa66f('0x62')][_0xa66f('0x34')]({'attributes':['id',_0xa66f('0x63')],'where':{'id':_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]}})[_0xa66f('0xe')](function(_0x1ee6e0){if(_0x1ee6e0){_0xd65c5d[_0xa66f('0x3f')][_0xa66f('0x64')]({'id':0x0,'priority':0x0,'app':_0xa66f('0x65'),'appdata':_0x1ee6e0[_0xa66f('0x63')]+','+(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x66')]||0xa),'interval':_0xa66f('0x47')});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);})['then'](function(_0xc4b32b){_0x23a546(_0xc4b32b);})[_0xa66f('0x20')](function(_0x2bb4e5){_0x1647a0(_0x17d942['error'](0x1f4,_0x2bb4e5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 93309e7..450808f 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 _0xed11=['register','length','mailAccount:','emit','removeListener'];(function(_0xb813c0,_0x33d406){var _0x15bf17=function(_0x13d827){while(--_0x13d827){_0xb813c0['push'](_0xb813c0['shift']());}};_0x15bf17(++_0x33d406);}(_0xed11,0x107));var _0x1ed1=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xed11[_0x1beef3];return _0x5af964;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove','update'];function createListener(_0x504f3d,_0x207153){return function(_0x37d7f0){_0x207153[_0x1ed1('0x0')](_0x504f3d,_0x37d7f0);};}function removeListener(_0x428305,_0x4f2eb3){return function(){MailAccountEvents[_0x1ed1('0x1')](_0x428305,_0x4f2eb3);};}exports[_0x1ed1('0x2')]=function(_0x31007f){for(var _0x5e56af=0x0,_0x2d61f7=events[_0x1ed1('0x3')];_0x5e56af<_0x2d61f7;_0x5e56af++){var _0x45749a=events[_0x5e56af];var _0x2ccb55=createListener(_0x1ed1('0x4')+_0x45749a,_0x31007f);MailAccountEvents['on'](_0x45749a,_0x2ccb55);}}; \ No newline at end of file +var _0x20a1=['register','mailAccount:','./mailAccount.events','emit','removeListener'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0x20a1,0x101));var _0x120a=function(_0xaa473d,_0x7f8f32){_0xaa473d=_0xaa473d-0x0;var _0x166f33=_0x20a1[_0xaa473d];return _0x166f33;};'use strict';var MailAccountEvents=require(_0x120a('0x0'));var events=['save','remove','update'];function createListener(_0x4db2eb,_0x1d5aa9){return function(_0x1c1236){_0x1d5aa9[_0x120a('0x1')](_0x4db2eb,_0x1c1236);};}function removeListener(_0x4024a1,_0x4db550){return function(){MailAccountEvents[_0x120a('0x2')](_0x4024a1,_0x4db550);};}exports[_0x120a('0x3')]=function(_0x205722){for(var _0x11cab3=0x0,_0x164def=events['length'];_0x11cab3<_0x164def;_0x11cab3++){var _0x57a024=events[_0x11cab3];var _0x100dea=createListener(_0x120a('0x4')+_0x57a024,_0x205722);MailAccountEvents['on'](_0x57a024,_0x100dea);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index f7599ea..ced0007 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 _0xeba1=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete'];(function(_0x1b11a0,_0x336a59){var _0x5cd0f0=function(_0x432a29){while(--_0x432a29){_0x1b11a0['push'](_0x1b11a0['shift']());}};_0x5cd0f0(++_0x336a59);}(_0xeba1,0x1c1));var _0x1eba=function(_0x24efed,_0xf8689f){_0x24efed=_0x24efed-0x0;var _0x4d99da=_0xeba1[_0x24efed];return _0x4d99da;};'use strict';var multer=require(_0x1eba('0x0'));var util=require(_0x1eba('0x1'));var path=require(_0x1eba('0x2'));var timeout=require(_0x1eba('0x3'));var express=require(_0x1eba('0x4'));var router=express[_0x1eba('0x5')]();var fs_extra=require(_0x1eba('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1eba('0x7'));var config=require('../../config/environment');var controller=require(_0x1eba('0x8'));router['get'](_0x1eba('0x9'),auth[_0x1eba('0xa')](),controller[_0x1eba('0xb')]);router[_0x1eba('0xc')](_0x1eba('0x9'),auth[_0x1eba('0xa')](),controller[_0x1eba('0xd')]);router[_0x1eba('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1eba('0xf')]=router; \ No newline at end of file +var _0x2f1d=['isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','/:id','put'];(function(_0x1fcd21,_0x5ece68){var _0x298d93=function(_0x137198){while(--_0x137198){_0x1fcd21['push'](_0x1fcd21['shift']());}};_0x298d93(++_0x5ece68);}(_0x2f1d,0x1e0));var _0xd2f1=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x2f1d[_0xef8146];return _0x5a6cb0;};'use strict';var multer=require(_0xd2f1('0x0'));var util=require(_0xd2f1('0x1'));var path=require(_0xd2f1('0x2'));var timeout=require(_0xd2f1('0x3'));var express=require('express');var router=express[_0xd2f1('0x4')]();var fs_extra=require(_0xd2f1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd2f1('0x6'));var controller=require('./mailApplication.controller');router[_0xd2f1('0x7')](_0xd2f1('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xd2f1('0x9')](_0xd2f1('0x8'),auth[_0xd2f1('0xa')](),controller[_0xd2f1('0xb')]);router[_0xd2f1('0xc')](_0xd2f1('0x8'),auth['isAuthenticated'](),controller[_0xd2f1('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 45646a7..4de1118 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 _0xc0d3=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc0d3,0x95));var _0x3c0d=function(_0x20db1c,_0x68a5de){_0x20db1c=_0x20db1c-0x0;var _0x2fe584=_0xc0d3[_0x20db1c];return _0x2fe584;};'use strict';var Sequelize=require('sequelize');module[_0x3c0d('0x0')]={'priority':{'type':Sequelize[_0x3c0d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3c0d('0x2')],'allowNull':![],'defaultValue':_0x3c0d('0x3')},'appdata':{'type':Sequelize[_0x3c0d('0x4')]()},'description':{'type':Sequelize[_0x3c0d('0x2')]},'interval':{'type':Sequelize[_0x3c0d('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc402=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x5d6267,_0x4b123c){var _0x1753c8=function(_0x149921){while(--_0x149921){_0x5d6267['push'](_0x5d6267['shift']());}};_0x1753c8(++_0x4b123c);}(_0xc402,0x1dc));var _0x2c40=function(_0x23a1b9,_0x3a080d){_0x23a1b9=_0x23a1b9-0x0;var _0x475529=_0xc402[_0x23a1b9];return _0x475529;};'use strict';var Sequelize=require(_0x2c40('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2c40('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2c40('0x2')],'allowNull':![],'defaultValue':_0x2c40('0x3')},'appdata':{'type':Sequelize[_0x2c40('0x4')]()},'description':{'type':Sequelize[_0x2c40('0x2')]},'interval':{'type':Sequelize[_0x2c40('0x2')],'defaultValue':_0x2c40('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index abdd0d4..662a24f 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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','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','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x1519ec,_0x26ab64){var _0x4ebabc=function(_0x2f098d){while(--_0x2f098d){_0x1519ec['push'](_0x1519ec['shift']());}};_0x4ebabc(++_0x26ab64);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +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(_0x35f55a,_0x1bc45f){var _0x23f6bd=function(_0x25229e){while(--_0x25229e){_0x35f55a['push'](_0x35f55a['shift']());}};_0x23f6bd(++_0x1bc45f);}(_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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 859d926..4b795c6 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 _0x9138=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports','mail_applications','utf8mb4'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9138,0x1a0));var _0x8913=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x9138[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0x8913('0x0'));var util=require(_0x8913('0x1'));var logger=require(_0x8913('0x2'))(_0x8913('0x3'));var moment=require(_0x8913('0x4'));var BPromise=require(_0x8913('0x5'));var rp=require(_0x8913('0x6'));var fs=require('fs');var path=require(_0x8913('0x7'));var rimraf=require(_0x8913('0x8'));var config=require('../../config/environment');var attributes=require(_0x8913('0x9'));module[_0x8913('0xa')]=function(_0xe560d5,_0x5dbca9){return _0xe560d5['define']('MailApplication',attributes,{'tableName':_0x8913('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8913('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9b34=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','lodash','api','request-promise','path','rimraf'];(function(_0x5bced2,_0x1983d6){var _0x51ec49=function(_0x360b56){while(--_0x360b56){_0x5bced2['push'](_0x5bced2['shift']());}};_0x51ec49(++_0x1983d6);}(_0x9b34,0xab));var _0x49b3=function(_0x3f1550,_0x4849b1){_0x3f1550=_0x3f1550-0x0;var _0x45e154=_0x9b34[_0x3f1550];return _0x45e154;};'use strict';var _=require(_0x49b3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x49b3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49b3('0x2'));var fs=require('fs');var path=require(_0x49b3('0x3'));var rimraf=require(_0x49b3('0x4'));var config=require(_0x49b3('0x5'));var attributes=require(_0x49b3('0x6'));module[_0x49b3('0x7')]=function(_0x343704,_0x10eb0c){return _0x343704[_0x49b3('0x8')](_0x49b3('0x9'),attributes,{'tableName':_0x49b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d815346..7e91a28 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 _0x3837=['raw','limit','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','update','body','options'];(function(_0x273277,_0x383dd5){var _0x3d33af=function(_0x13d2b1){while(--_0x13d2b1){_0x273277['push'](_0x273277['shift']());}};_0x3d33af(++_0x383dd5);}(_0x3837,0x162));var _0x7383=function(_0x222b4a,_0x511895){_0x222b4a=_0x222b4a-0x0;var _0x1dfeea=_0x3837[_0x222b4a];return _0x1dfeea;};'use strict';var _=require(_0x7383('0x0'));var util=require(_0x7383('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7383('0x2'));var fs=require('fs');var Redis=require(_0x7383('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7383('0x4'));var logger=require(_0x7383('0x5'))(_0x7383('0x6'));var config=require(_0x7383('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7383('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x347e88,_0x936b03,_0xc3e259){return new BPromise(function(_0x490443,_0x536855){return client[_0x7383('0x9')](_0x347e88,_0xc3e259)['then'](function(_0x118b0b){logger[_0x7383('0xa')](_0x7383('0xb'),_0x936b03,_0x7383('0xc'));logger[_0x7383('0xd')](_0x7383('0xe'),_0x936b03,_0x7383('0xc'),JSON[_0x7383('0xf')](_0x118b0b));if(_0x118b0b['error']){if(_0x118b0b[_0x7383('0x10')][_0x7383('0x11')]===0x1f4){logger[_0x7383('0x10')](_0x7383('0xb'),_0x936b03,_0x118b0b[_0x7383('0x10')][_0x7383('0x12')]);return _0x536855(_0x118b0b['error'][_0x7383('0x12')]);}logger[_0x7383('0x10')](_0x7383('0xb'),_0x936b03,_0x118b0b['error'][_0x7383('0x12')]);return _0x490443(_0x118b0b[_0x7383('0x10')][_0x7383('0x12')]);}else{logger[_0x7383('0xa')](_0x7383('0xb'),_0x936b03,_0x7383('0xc'));_0x490443(_0x118b0b[_0x7383('0x13')][_0x7383('0x12')]);}})['catch'](function(_0x205172){logger[_0x7383('0x10')]('MailApplication,\x20%s,\x20%s',_0x936b03,_0x205172);_0x536855(_0x205172);});});}exports[_0x7383('0x14')]=function(_0x3920cd){var _0x4fd0d9=this;return new Promise(function(_0x2ddc0e,_0x1fd804){return db['MailApplication'][_0x7383('0x15')](_0x3920cd[_0x7383('0x16')],{'raw':_0x3920cd['options']?_0x3920cd[_0x7383('0x17')][_0x7383('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3920cd['options']?_0x3920cd['options']['where']||null:null,'attributes':_0x3920cd['options']?_0x3920cd['options']['attributes']||null:null,'limit':_0x3920cd['options']?_0x3920cd['options'][_0x7383('0x19')]||null:null})['then'](function(_0x3252b3){logger[_0x7383('0xa')]('UpdateMailApplication',_0x3920cd);logger[_0x7383('0xd')](_0x7383('0x14'),_0x3920cd,JSON[_0x7383('0xf')](_0x3252b3));_0x2ddc0e(_0x3252b3);})[_0x7383('0x1a')](function(_0x4979fe){logger[_0x7383('0x10')]('UpdateMailApplication',_0x4979fe[_0x7383('0x12')],_0x3920cd);_0x1fd804(_0x4fd0d9[_0x7383('0x10')](0x1f4,_0x4979fe[_0x7383('0x12')]));});});}; \ No newline at end of file +var _0xee4c=['request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','MailApplication','update','options','raw','attributes','limit','UpdateMailApplication','stringify','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http'];(function(_0x1dac4f,_0x36a9b3){var _0x5cf734=function(_0x4e51ef){while(--_0x4e51ef){_0x1dac4f['push'](_0x1dac4f['shift']());}};_0x5cf734(++_0x36a9b3);}(_0xee4c,0x163));var _0xcee4=function(_0x5626d3,_0x5accb4){_0x5626d3=_0x5626d3-0x0;var _0xe5db6e=_0xee4c[_0x5626d3];return _0xe5db6e;};'use strict';var _=require('lodash');var util=require(_0xcee4('0x0'));var moment=require(_0xcee4('0x1'));var BPromise=require(_0xcee4('0x2'));var rs=require(_0xcee4('0x3'));var fs=require('fs');var Redis=require(_0xcee4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcee4('0x5'))(_0xcee4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcee4('0x7')][_0xcee4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5733f0,_0xfeabaa,_0x33f7f8){return new BPromise(function(_0x123a66,_0x1ca4d4){return client[_0xcee4('0x9')](_0x5733f0,_0x33f7f8)[_0xcee4('0xa')](function(_0x29c0e7){logger['info'](_0xcee4('0xb'),_0xfeabaa,'request\x20sent');logger[_0xcee4('0xc')](_0xcee4('0xd'),_0xfeabaa,_0xcee4('0xe'),JSON['stringify'](_0x29c0e7));if(_0x29c0e7[_0xcee4('0xf')]){if(_0x29c0e7[_0xcee4('0xf')][_0xcee4('0x10')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0xfeabaa,_0x29c0e7[_0xcee4('0xf')][_0xcee4('0x11')]);return _0x1ca4d4(_0x29c0e7[_0xcee4('0xf')][_0xcee4('0x11')]);}logger[_0xcee4('0xf')]('MailApplication,\x20%s,\x20%s',_0xfeabaa,_0x29c0e7[_0xcee4('0xf')][_0xcee4('0x11')]);return _0x123a66(_0x29c0e7[_0xcee4('0xf')]['message']);}else{logger[_0xcee4('0x12')](_0xcee4('0xb'),_0xfeabaa,_0xcee4('0xe'));_0x123a66(_0x29c0e7['result']['message']);}})[_0xcee4('0x13')](function(_0x4863b9){logger['error'](_0xcee4('0xb'),_0xfeabaa,_0x4863b9);_0x1ca4d4(_0x4863b9);});});}exports['UpdateMailApplication']=function(_0x5db248){var _0x450412=this;return new Promise(function(_0x5ccdfb,_0x1847b6){return db[_0xcee4('0x14')][_0xcee4('0x15')](_0x5db248['body'],{'raw':_0x5db248[_0xcee4('0x16')]?_0x5db248[_0xcee4('0x16')][_0xcee4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5db248[_0xcee4('0x16')]?_0x5db248['options']['where']||null:null,'attributes':_0x5db248[_0xcee4('0x16')]?_0x5db248[_0xcee4('0x16')][_0xcee4('0x18')]||null:null,'limit':_0x5db248['options']?_0x5db248['options'][_0xcee4('0x19')]||null:null})[_0xcee4('0xa')](function(_0x328d69){logger[_0xcee4('0x12')](_0xcee4('0x1a'),_0x5db248);logger[_0xcee4('0xc')](_0xcee4('0x1a'),_0x5db248,JSON[_0xcee4('0x1b')](_0x328d69));_0x5ccdfb(_0x328d69);})[_0xcee4('0x13')](function(_0x1beb37){logger[_0xcee4('0xf')](_0xcee4('0x1a'),_0x1beb37[_0xcee4('0x11')],_0x5db248);_0x1847b6(_0x450412['error'](0x1f4,_0x1beb37[_0xcee4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c4238e3..2e643f6 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 _0x2071=['mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/interaction/service','./mailInteraction.controller','get','/describe','isAuthenticated','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x2071,0x10e));var _0x1207=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0x2071[_0xe2c95e];return _0x42ce6f;};'use strict';var express=require(_0x1207('0x0'));var router=express[_0x1207('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x1207('0x2'));var controller=require(_0x1207('0x3'));router[_0x1207('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1207('0x4')](_0x1207('0x5'),auth[_0x1207('0x6')](),controller['describe']);router[_0x1207('0x4')](_0x1207('0x7'),auth[_0x1207('0x6')](),controller['show']);router[_0x1207('0x4')](_0x1207('0x8'),auth['isAuthenticated'](),controller[_0x1207('0x9')]);router[_0x1207('0x4')](_0x1207('0xa'),auth[_0x1207('0x6')](),controller[_0x1207('0xb')]);router[_0x1207('0xc')]('/',auth['isAuthenticated'](),controller[_0x1207('0xd')]);router[_0x1207('0xc')]('/:id/messages',auth[_0x1207('0x6')](),controller[_0x1207('0xe')]);router[_0x1207('0xc')](_0x1207('0xf'),auth[_0x1207('0x6')](),interaction['tracked'](_0x1207('0x10'),_0x1207('0x11')),controller[_0x1207('0x12')]);router['put'](_0x1207('0x7'),auth[_0x1207('0x6')](),interaction[_0x1207('0x13')]('mail',_0x1207('0x14')),controller[_0x1207('0x15')]);router['delete'](_0x1207('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0x1207('0x10'),_0x1207('0x16')),controller[_0x1207('0x17')]);router[_0x1207('0x18')](_0x1207('0xf'),auth['isAuthenticated'](),controller[_0x1207('0x19')]);module['exports']=router; \ No newline at end of file +var _0x33d1=['removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','/:id','mailinteraction:update','update','delete','mailinteraction:destroy','destroy'];(function(_0x1081c6,_0x82e257){var _0x347172=function(_0x1bf550){while(--_0x1bf550){_0x1081c6['push'](_0x1081c6['shift']());}};_0x347172(++_0x82e257);}(_0x33d1,0x197));var _0x133d=function(_0x349f5f,_0x740898){_0x349f5f=_0x349f5f-0x0;var _0x3a4194=_0x33d1[_0x349f5f];return _0x3a4194;};'use strict';var express=require(_0x133d('0x0'));var router=express['Router']();var auth=require(_0x133d('0x1'));var interaction=require(_0x133d('0x2'));var controller=require(_0x133d('0x3'));router['get']('/',auth[_0x133d('0x4')](),controller[_0x133d('0x5')]);router[_0x133d('0x6')]('/describe',auth[_0x133d('0x4')](),controller['describe']);router[_0x133d('0x6')]('/:id',auth[_0x133d('0x4')](),controller[_0x133d('0x7')]);router['get'](_0x133d('0x8'),auth[_0x133d('0x4')](),controller[_0x133d('0x9')]);router[_0x133d('0x6')](_0x133d('0xa'),auth['isAuthenticated'](),controller[_0x133d('0xb')]);router[_0x133d('0xc')]('/',auth[_0x133d('0x4')](),controller['create']);router['post']('/:id/messages',auth[_0x133d('0x4')](),controller['addMessage']);router[_0x133d('0xc')](_0x133d('0xd'),auth[_0x133d('0x4')](),interaction[_0x133d('0xe')](_0x133d('0xf'),_0x133d('0x10')),controller[_0x133d('0x11')]);router[_0x133d('0x12')](_0x133d('0x13'),auth[_0x133d('0x4')](),interaction['tracked'](_0x133d('0xf'),_0x133d('0x14')),controller[_0x133d('0x15')]);router[_0x133d('0x16')](_0x133d('0x13'),auth[_0x133d('0x4')](),interaction['tracked']('mail',_0x133d('0x17')),controller[_0x133d('0x18')]);router[_0x133d('0x16')](_0x133d('0xd'),auth[_0x133d('0x4')](),controller[_0x133d('0x19')]);module[_0x133d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f816d0c..2935319 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 _0x9494=['STRING','TEXT','DATE','ENUM','out','sequelize','iconv','BOOLEAN'];(function(_0x26cb9a,_0x1148cb){var _0x32e0cc=function(_0x21261c){while(--_0x21261c){_0x26cb9a['push'](_0x26cb9a['shift']());}};_0x32e0cc(++_0x1148cb);}(_0x9494,0x185));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4949('0x0'));var iconv=require(_0x4949('0x1'));module['exports']={'closed':{'type':Sequelize[_0x4949('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4949('0x3')]},'secondDisposition':{'type':Sequelize[_0x4949('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4949('0x3')]},'note':{'type':Sequelize[_0x4949('0x3')]},'inReplyTo':{'type':Sequelize[_0x4949('0x3')](0x1fe)},'to':{'type':Sequelize[_0x4949('0x3')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x4949('0x4')]()},'attach':{'type':Sequelize[_0x4949('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4949('0x5')]},'substatus':{'type':Sequelize[_0x4949('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x4949('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x4949('0x6')]('in',_0x4949('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4949('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x4949('0x6')]('in',_0x4949('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xaff8=['TEXT','BOOLEAN','ENUM','out','sequelize','iconv','exports','DATE','STRING'];(function(_0x3ff6ab,_0x5299e5){var _0x450f50=function(_0x442647){while(--_0x442647){_0x3ff6ab['push'](_0x3ff6ab['shift']());}};_0x450f50(++_0x5299e5);}(_0xaff8,0x1c6));var _0x8aff=function(_0x1bd91c,_0x285e72){_0x1bd91c=_0x1bd91c-0x0;var _0x3bc43c=_0xaff8[_0x1bd91c];return _0x3bc43c;};'use strict';var Sequelize=require(_0x8aff('0x0'));var iconv=require(_0x8aff('0x1'));module[_0x8aff('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8aff('0x3')]},'disposition':{'type':Sequelize[_0x8aff('0x4')]},'secondDisposition':{'type':Sequelize[_0x8aff('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8aff('0x4')]},'note':{'type':Sequelize[_0x8aff('0x4')]},'inReplyTo':{'type':Sequelize[_0x8aff('0x4')](0x1fe)},'to':{'type':Sequelize[_0x8aff('0x4')]},'cc':{'type':Sequelize[_0x8aff('0x5')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x8aff('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x8aff('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8aff('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8aff('0x7')]('in',_0x8aff('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8aff('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index d24714d..3cb1714 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 _0x5089=['rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','status','stack','name','send','index','MailInteraction','fieldName','type','getOptions','findAll','mail','query','user','then','catch','show','params','model','keys','rawAttributes','filters','attributes','intersection','fields','includeAll','include','merge','options','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','hasOwnProperty','order','where','MailInteractionId','filter','$gte','split','format','inlineCss','true','length','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','join','root','server','tmp','transcript-%d-%s.zip','attachments','push','Messages','bcc','sort','get','mkdirSync','each','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','download','unlinkSync','eml-format'];(function(_0x2bd35b,_0x44f393){var _0x3d4955=function(_0x5d5d67){while(--_0x5d5d67){_0x2bd35b['push'](_0x2bd35b['shift']());}};_0x3d4955(++_0x44f393);}(_0x5089,0x1bb));var _0x9508=function(_0x399849,_0x3b630d){_0x399849=_0x399849-0x0;var _0xfbb04=_0x5089[_0x399849];return _0xfbb04;};'use strict';var emlformat=require(_0x9508('0x0'));var rimraf=require(_0x9508('0x1'));var zipdir=require('zip-dir');var moment=require(_0x9508('0x2'));var BPromise=require(_0x9508('0x3'));var util=require(_0x9508('0x4'));var path=require(_0x9508('0x5'));var fs=require('fs');var _=require(_0x9508('0x6'));var juice=require('juice');var Redis=require(_0x9508('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x9508('0x8'));var logger=require(_0x9508('0x9'))(_0x9508('0xa'));var config=require('../../config/environment');var db=require(_0x9508('0xb'))['db'];var htmlEntities=require(_0x9508('0xc'));config['redis']=_[_0x9508('0xd')](config[_0x9508('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x9508('0xf'))(new Redis(config['redis']));require(_0x9508('0x10'))[_0x9508('0x11')](socket);function respondWithStatusCode(_0x852feb,_0x21f8c1){_0x21f8c1=_0x21f8c1||0xcc;return function(_0x839509){if(_0x839509){return _0x852feb[_0x9508('0x12')](_0x21f8c1);}return _0x852feb['status'](_0x21f8c1)[_0x9508('0x13')]();};}function respondWithResult(_0x507887,_0x2c4fd9){_0x2c4fd9=_0x2c4fd9||0xc8;return function(_0x396896){if(_0x396896){return _0x507887['status'](_0x2c4fd9)[_0x9508('0x14')](_0x396896);}};}function respondWithFilteredResult(_0x3b7427,_0x10ceef){return function(_0x4701de){if(_0x4701de){var _0x51ef92=typeof _0x10ceef[_0x9508('0x15')]===_0x9508('0x16')&&typeof _0x10ceef['limit']===_0x9508('0x16');var _0x539746=_0x4701de[_0x9508('0x17')];var _0x418889=_0x51ef92?0x0:_0x10ceef[_0x9508('0x15')];var _0x255a03=_0x51ef92?_0x4701de[_0x9508('0x17')]:_0x10ceef[_0x9508('0x15')]+_0x10ceef[_0x9508('0x18')];var _0x20df7d;if(_0x255a03>=_0x539746){_0x255a03=_0x539746;_0x20df7d=0xc8;}else{_0x20df7d=0xce;}_0x3b7427['status'](_0x20df7d);return _0x3b7427[_0x9508('0x19')](_0x9508('0x1a'),_0x418889+'-'+_0x255a03+'/'+_0x539746)[_0x9508('0x14')](_0x4701de);}return null;};}function saveUpdates(_0x1ba7e6){return function(_0x23c30e){if(_0x23c30e){return _0x23c30e[_0x9508('0x1b')](_0x1ba7e6)['then'](function(_0x4cbf6a){return _0x4cbf6a;});}return null;};}function removeEntity(_0x17e43c){return function(_0x47f7a2){if(_0x47f7a2){return _0x47f7a2[_0x9508('0x1c')]()['then'](function(){_0x17e43c[_0x9508('0x1d')](0xcc)[_0x9508('0x13')]();});}};}function handleEntityNotFound(_0x226f29){return function(_0x1dfc6c){if(!_0x1dfc6c){_0x226f29[_0x9508('0x12')](0x194);}return _0x1dfc6c;};}function handleError(_0x2f8106,_0x20eb53){_0x20eb53=_0x20eb53||0x1f4;return function(_0x5f4f0c){logger['error'](_0x5f4f0c[_0x9508('0x1e')]);if(_0x5f4f0c[_0x9508('0x1f')]){delete _0x5f4f0c[_0x9508('0x1f')];}_0x2f8106[_0x9508('0x1d')](_0x20eb53)[_0x9508('0x20')](_0x5f4f0c);};}exports[_0x9508('0x21')]=function(_0x4b68e9,_0x5e9a80){var _0x46d23f={};var _0x55cc4d=_['map'](db[_0x9508('0x22')]['rawAttributes'],function(_0x5db4e1){return{'name':_0x5db4e1[_0x9508('0x23')],'type':_0x5db4e1[_0x9508('0x24')]['key']};});_0x46d23f=qs[_0x9508('0x25')](_0x55cc4d,_0x4b68e9);return interaction[_0x9508('0x26')](_0x9508('0x27'),_0x4b68e9[_0x9508('0x28')],_0x4b68e9[_0x9508('0x29')],_0x46d23f,_0x55cc4d)[_0x9508('0x2a')](respondWithFilteredResult(_0x5e9a80,_0x46d23f))[_0x9508('0x2b')](handleError(_0x5e9a80,null));};exports[_0x9508('0x2c')]=function(_0x414534,_0x24df6){var _0x19a984={'raw':![],'where':{'id':_0x414534[_0x9508('0x2d')]['id']}},_0x55f36c={};_0x55f36c[_0x9508('0x2e')]=_[_0x9508('0x2f')](db['MailInteraction'][_0x9508('0x30')]);_0x55f36c[_0x9508('0x28')]=_['keys'](_0x414534[_0x9508('0x28')]);_0x55f36c[_0x9508('0x31')]=_['intersection'](_0x55f36c[_0x9508('0x2e')],_0x55f36c[_0x9508('0x28')]);_0x19a984[_0x9508('0x32')]=_[_0x9508('0x33')](_0x55f36c['model'],qs['fields'](_0x414534[_0x9508('0x28')][_0x9508('0x34')]));_0x19a984[_0x9508('0x32')]=_0x19a984['attributes']['length']?_0x19a984[_0x9508('0x32')]:_0x55f36c[_0x9508('0x2e')];if(_0x414534[_0x9508('0x28')][_0x9508('0x35')]){_0x19a984[_0x9508('0x36')]=[{'all':!![]}];}_0x19a984=_[_0x9508('0x37')]({},_0x19a984,_0x414534[_0x9508('0x38')]);return db[_0x9508('0x22')][_0x9508('0x39')](_0x19a984)[_0x9508('0x2a')](handleEntityNotFound(_0x24df6,null))['then'](respondWithResult(_0x24df6,null))[_0x9508('0x2b')](handleError(_0x24df6,null));};exports[_0x9508('0x3a')]=function(_0x5d7098,_0x2644ef){return db[_0x9508('0x22')][_0x9508('0x3a')](_0x5d7098[_0x9508('0x3b')],{})[_0x9508('0x2a')](respondWithResult(_0x2644ef,0xc9))[_0x9508('0x2b')](handleError(_0x2644ef,null));};exports[_0x9508('0x1b')]=function(_0x3700f1,_0xfb6676){if(_0x3700f1[_0x9508('0x3b')]['id']){delete _0x3700f1[_0x9508('0x3b')]['id'];}return db['MailInteraction'][_0x9508('0x39')]({'where':{'id':_0x3700f1['params']['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0xfb6676,null))[_0x9508('0x2a')](saveUpdates(_0x3700f1[_0x9508('0x3b')],null))['then'](respondWithResult(_0xfb6676,null))['catch'](handleError(_0xfb6676,null));};exports[_0x9508('0x1c')]=function(_0x1f28f6,_0x1277b1){return db[_0x9508('0x22')]['find']({'where':{'id':_0x1f28f6[_0x9508('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1277b1,null))[_0x9508('0x2a')](removeEntity(_0x1277b1,null))[_0x9508('0x2b')](handleError(_0x1277b1,null));};exports['describe']=function(_0x33e412,_0x37217e){return db['MailInteraction'][_0x9508('0x3c')]()[_0x9508('0x2a')](respondWithResult(_0x37217e,null))[_0x9508('0x2b')](handleError(_0x37217e,null));};exports[_0x9508('0x3d')]=function(_0x4e2561,_0x52701f){return db[_0x9508('0x3e')]['find']({'where':{'id':_0x4e2561[_0x9508('0x2d')]['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0x52701f,null))[_0x9508('0x2a')](function(_0x4215e9){if(_0x4215e9){return _0x4215e9['addMessage'](_0x4e2561['body']['ids'],_[_0x9508('0x3f')](_0x4e2561['body'],[_0x9508('0x40'),'id'])||{});}})['then'](respondWithResult(_0x52701f,null))[_0x9508('0x2b')](handleError(_0x52701f,null));};exports[_0x9508('0x41')]=function(_0x21af4c,_0x464c1a){var _0x5b456a={'raw':![],'where':{}};var _0x152288={};var _0x57b2c={'count':0x0,'rows':[]};return db[_0x9508('0x22')]['findOne']({'where':{'id':_0x21af4c[_0x9508('0x2d')]['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0x464c1a,null))['then'](function(_0x4f865d){if(_0x4f865d){_0x152288['model']=_[_0x9508('0x2f')](db['MailMessage']['rawAttributes']);_0x152288[_0x9508('0x28')]=_[_0x9508('0x2f')](_0x21af4c[_0x9508('0x28')]);_0x152288[_0x9508('0x31')]=_[_0x9508('0x33')](_0x152288[_0x9508('0x2e')],_0x152288['query']);_0x5b456a[_0x9508('0x32')]=_[_0x9508('0x33')](_0x152288[_0x9508('0x2e')],qs['fields'](_0x21af4c[_0x9508('0x28')][_0x9508('0x34')]));_0x5b456a[_0x9508('0x32')]=_0x5b456a[_0x9508('0x32')]['length']?_0x5b456a[_0x9508('0x32')]:_0x152288['model'];if(!_0x21af4c[_0x9508('0x28')][_0x9508('0x42')]('nolimit')){_0x5b456a[_0x9508('0x18')]=qs[_0x9508('0x18')](_0x21af4c['query'][_0x9508('0x18')]);_0x5b456a[_0x9508('0x15')]=qs['offset'](_0x21af4c[_0x9508('0x28')]['offset']);}_0x5b456a[_0x9508('0x43')]=qs['sort'](_0x21af4c[_0x9508('0x28')]['sort']);_0x5b456a['where']=qs['filters'](_['pick'](_0x21af4c[_0x9508('0x28')],_0x152288[_0x9508('0x31')]));_0x5b456a[_0x9508('0x44')][_0x9508('0x45')]=_0x4f865d['id'];if(_0x21af4c[_0x9508('0x28')][_0x9508('0x46')]){_0x5b456a[_0x9508('0x44')]=_[_0x9508('0x37')](_0x5b456a[_0x9508('0x44')],{'$or':_['map'](_0x5b456a[_0x9508('0x32')],function(_0x304232){var _0x3b202f={};_0x3b202f[_0x304232]={'$like':'%'+_0x21af4c[_0x9508('0x28')][_0x9508('0x46')]+'%'};return _0x3b202f;})});}if(_0x21af4c['query']['$gte']){var _0x1873c9=_0x21af4c['query'][_0x9508('0x47')][_0x9508('0x48')](',');var _0x490031={};_0x490031[_0x1873c9[0x0]]={'$gte':moment(_0x1873c9[0x1])[_0x9508('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b456a['where']=_[_0x9508('0x37')](_0x5b456a[_0x9508('0x44')],_0x490031);}_0x5b456a=_['merge']({},_0x5b456a,_0x21af4c[_0x9508('0x38')]);return db[_0x9508('0x3e')][_0x9508('0x17')]({'where':_0x5b456a[_0x9508('0x44')]})[_0x9508('0x2a')](function(_0x40c08d){_0x57b2c[_0x9508('0x17')]=_0x40c08d;if(_0x21af4c[_0x9508('0x28')][_0x9508('0x35')]){_0x5b456a[_0x9508('0x36')]=[{'all':!![]}];}return db[_0x9508('0x3e')][_0x9508('0x26')](_0x5b456a);})[_0x9508('0x2a')](function(_0x2005f0){if(_0x21af4c['query'][_0x9508('0x4a')]===_0x9508('0x4b')){for(var _0x54e1b4=0x0;_0x54e1b4<_0x2005f0[_0x9508('0x4c')];_0x54e1b4++){_0x2005f0[_0x54e1b4]['body']=juice(_0x2005f0[_0x54e1b4]['body']);}}_0x57b2c[_0x9508('0x4d')]=_0x2005f0;return _0x57b2c;});}})[_0x9508('0x2a')](respondWithFilteredResult(_0x464c1a,_0x5b456a))['catch'](handleError(_0x464c1a,null));};exports[_0x9508('0x4e')]=function(_0x198389,_0x553e6b){return db[_0x9508('0x22')][_0x9508('0x39')]({'where':{'id':_0x198389[_0x9508('0x2d')]['id']}})['then'](handleEntityNotFound(_0x553e6b,null))[_0x9508('0x2a')](function(_0x17ffe4){if(_0x17ffe4){return _0x17ffe4[_0x9508('0x4f')](_0x198389[_0x9508('0x3b')][_0x9508('0x40')],_[_0x9508('0x3f')](_0x198389['body'],[_0x9508('0x40'),'id'])||{})[_0x9508('0x50')](function(){return db[_0x9508('0x51')][_0x9508('0x26')]({'attributes':['id','name',_0x9508('0x52')],'where':{'id':_0x198389['body'][_0x9508('0x40')]}});})[_0x9508('0x2a')](function(_0x4a6c43){socket[_0x9508('0x53')](_0x9508('0x54'),{'id':Number(_0x198389['params']['id']),'tags':_0x4a6c43||[]});return{'id':Number(_0x198389[_0x9508('0x2d')]['id']),'tags':_0x4a6c43||[]};});}})[_0x9508('0x2a')](respondWithResult(_0x553e6b,null))[_0x9508('0x2b')](handleError(_0x553e6b,null));};exports[_0x9508('0x55')]=function(_0x5aa42b,_0x1d84e8){return db[_0x9508('0x22')][_0x9508('0x39')]({'where':{'id':_0x5aa42b[_0x9508('0x2d')]['id']}})[_0x9508('0x2a')](handleEntityNotFound(_0x1d84e8,null))[_0x9508('0x2a')](function(_0x67371f){if(_0x67371f){return _0x67371f[_0x9508('0x55')](_0x5aa42b['query'][_0x9508('0x40')]);}})[_0x9508('0x2a')](respondWithStatusCode(_0x1d84e8,null))[_0x9508('0x2b')](handleError(_0x1d84e8,null));};exports['download']=function(_0x2dabf8,_0x5f4cde){var _0x3256e9=moment()['unix']()['toString']();var _0x54f0f3=path[_0x9508('0x56')](config[_0x9508('0x57')],_0x9508('0x58'),'files',_0x9508('0x59'));var _0x2c98c3=path[_0x9508('0x56')](config[_0x9508('0x57')],_0x9508('0x58'),'files','attachments');var _0xd9d83e=path[_0x9508('0x56')](_0x54f0f3,_0x3256e9);var _0x1d3e4d=util[_0x9508('0x49')](_0x9508('0x5a'),_0x2dabf8[_0x9508('0x2d')]['id'],_0x3256e9);var _0xa557a0=path[_0x9508('0x56')](_0x54f0f3,_0x1d3e4d);var _0x3e60d0=[];if(_0x2dabf8[_0x9508('0x28')][_0x9508('0x5b')]){_0x3e60d0[_0x9508('0x5c')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x2618e2=[{'model':db['MailMessage'],'as':_0x9508('0x5d'),'attributes':['id','body','from','to','cc',_0x9508('0x5e'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x9508('0x5f')]('id'),'include':_0x3e60d0}];return db[_0x9508('0x22')][_0x9508('0x39')]({'where':{'id':_0x2dabf8[_0x9508('0x2d')]['id']},'include':_0x2618e2})[_0x9508('0x2a')](handleEntityNotFound(_0x5f4cde,null))[_0x9508('0x2a')](function(_0x222e63){if(_0x222e63&&_0x222e63[_0x9508('0x5d')]){var _0xa3e550=_0x222e63[_0x9508('0x60')]({'plain':!![]});fs[_0x9508('0x61')](_0xd9d83e);return BPromise[_0x9508('0x62')](_0xa3e550[_0x9508('0x5d')],function(_0x445f67,_0x456828){var _0x5710dd={'from':_0x445f67[_0x9508('0x63')],'to':_0x445f67['to'],'subject':_0x445f67['subject'],'html':htmlEntities[_0x9508('0x64')](_0x445f67[_0x9508('0x3b')]),'headers':{'Date':moment(_0x445f67[_0x9508('0x65')])[_0x9508('0x49')](_0x9508('0x66'))},'attachments':[]};if(_0x445f67['cc']){_0x5710dd[_0x9508('0x67')]['Cc']=_0x445f67['cc'];}if(_0x445f67[_0x9508('0x5e')]){_0x5710dd[_0x9508('0x67')][_0x9508('0x68')]=_0x445f67[_0x9508('0x5e')];}return new BPromise(function(_0x2f292b,_0x470f52){if(_0x445f67['Attachments']){for(var _0x2db0af=0x0;_0x2db0af<_0x445f67[_0x9508('0x69')][_0x9508('0x4c')];_0x2db0af++){var _0x4bddc1=_0x445f67['Attachments'][_0x2db0af];var _0x37fb85=path[_0x9508('0x56')](_0x2c98c3,_0x4bddc1[_0x9508('0x6a')]);if(fs[_0x9508('0x6b')](_0x37fb85)){_0x5710dd[_0x9508('0x5b')][_0x9508('0x5c')]({'name':_0x4bddc1[_0x9508('0x1f')],'contentType':_0x4bddc1['type'],'data':fs[_0x9508('0x6c')](_0x37fb85)});}}}emlformat['build'](_0x5710dd,function(_0x5b0b62,_0x4779dd){if(_0x5b0b62)return _0x470f52(_0x5b0b62);fs['writeFileSync'](path[_0x9508('0x56')](_0xd9d83e,util[_0x9508('0x49')]('message%d.eml',_0x456828)),_0x4779dd);return _0x2f292b(_0x4779dd);});});})[_0x9508('0x2a')](function(){return new BPromise(function(_0x5e4a15,_0x2d625a){zipdir(_0xd9d83e,{'saveTo':_0xa557a0},function(_0x5d9dd2,_0x3b0dc3){if(_0x5d9dd2)return _0x2d625a(_0x5d9dd2);return _0x5e4a15(_0x3b0dc3);});})[_0x9508('0x2a')](function(){return new BPromise(function(_0x29471f,_0x21c1b7){rimraf(_0xd9d83e,function(_0x8c3027){if(_0x8c3027)_0x21c1b7(_0x8c3027);return _0x29471f();});});})[_0x9508('0x2a')](function(){return _0x5f4cde[_0x9508('0x6d')](_0xa557a0,_0x1d3e4d,function(_0x3a7c37){if(!_0x3a7c37)fs[_0x9508('0x6e')](_0xa557a0);});});});}else{return _0x5f4cde[_0x9508('0x12')](0xc8);}})['catch'](handleError(_0x5f4cde,null));}; \ No newline at end of file +var _0x8456=['unix','join','root','server','files','format','transcript-%d-%s.zip','attachments','push','Attachment','Messages','from','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','bluebird','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','getOptions','findAll','mail','user','catch','show','model','keys','query','filters','intersection','fields','attributes','length','include','find','create','body','params','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','true','rows','addTags','setTags','spread','mailInteractionTags:save','removeTags','download'];(function(_0x206711,_0x4125b4){var _0x4fe02b=function(_0x27dc45){while(--_0x27dc45){_0x206711['push'](_0x206711['shift']());}};_0x4fe02b(++_0x4125b4);}(_0x8456,0xfd));var _0x6845=function(_0x11bd8f,_0x14ec62){_0x11bd8f=_0x11bd8f-0x0;var _0x3e83dd=_0x8456[_0x11bd8f];return _0x3e83dd;};'use strict';var emlformat=require(_0x6845('0x0'));var rimraf=require(_0x6845('0x1'));var zipdir=require(_0x6845('0x2'));var moment=require('moment');var BPromise=require(_0x6845('0x3'));var util=require('util');var path=require(_0x6845('0x4'));var fs=require('fs');var _=require(_0x6845('0x5'));var juice=require(_0x6845('0x6'));var Redis=require(_0x6845('0x7'));var interaction=require(_0x6845('0x8'));var qs=require(_0x6845('0x9'));var logger=require(_0x6845('0xa'))(_0x6845('0xb'));var config=require(_0x6845('0xc'));var db=require(_0x6845('0xd'))['db'];var htmlEntities=require('html-entities');config[_0x6845('0xe')]=_['defaults'](config[_0x6845('0xe')],{'host':_0x6845('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6845('0xe')]));require(_0x6845('0x10'))[_0x6845('0x11')](socket);function respondWithStatusCode(_0x578d62,_0x1bcdbd){_0x1bcdbd=_0x1bcdbd||0xcc;return function(_0x24bf8e){if(_0x24bf8e){return _0x578d62[_0x6845('0x12')](_0x1bcdbd);}return _0x578d62[_0x6845('0x13')](_0x1bcdbd)[_0x6845('0x14')]();};}function respondWithResult(_0x254d21,_0x5c440b){_0x5c440b=_0x5c440b||0xc8;return function(_0x3ffb94){if(_0x3ffb94){return _0x254d21[_0x6845('0x13')](_0x5c440b)[_0x6845('0x15')](_0x3ffb94);}};}function respondWithFilteredResult(_0x1370e1,_0x28e976){return function(_0x570ee6){if(_0x570ee6){var _0x5bb7fd=typeof _0x28e976[_0x6845('0x16')]===_0x6845('0x17')&&typeof _0x28e976[_0x6845('0x18')]==='undefined';var _0x162425=_0x570ee6[_0x6845('0x19')];var _0x34f107=_0x5bb7fd?0x0:_0x28e976[_0x6845('0x16')];var _0x275005=_0x5bb7fd?_0x570ee6[_0x6845('0x19')]:_0x28e976[_0x6845('0x16')]+_0x28e976['limit'];var _0x14043b;if(_0x275005>=_0x162425){_0x275005=_0x162425;_0x14043b=0xc8;}else{_0x14043b=0xce;}_0x1370e1['status'](_0x14043b);return _0x1370e1['set'](_0x6845('0x1a'),_0x34f107+'-'+_0x275005+'/'+_0x162425)[_0x6845('0x15')](_0x570ee6);}return null;};}function saveUpdates(_0x5e5959){return function(_0x3056a4){if(_0x3056a4){return _0x3056a4[_0x6845('0x1b')](_0x5e5959)[_0x6845('0x1c')](function(_0x204276){return _0x204276;});}return null;};}function removeEntity(_0x1b0889){return function(_0x298286){if(_0x298286){return _0x298286[_0x6845('0x1d')]()[_0x6845('0x1c')](function(){_0x1b0889['status'](0xcc)[_0x6845('0x14')]();});}};}function handleEntityNotFound(_0x33132d){return function(_0x2a16f8){if(!_0x2a16f8){_0x33132d[_0x6845('0x12')](0x194);}return _0x2a16f8;};}function handleError(_0x47b92d,_0x5f2356){_0x5f2356=_0x5f2356||0x1f4;return function(_0x4e5e97){logger[_0x6845('0x1e')](_0x4e5e97[_0x6845('0x1f')]);if(_0x4e5e97[_0x6845('0x20')]){delete _0x4e5e97[_0x6845('0x20')];}_0x47b92d['status'](_0x5f2356)[_0x6845('0x21')](_0x4e5e97);};}exports['index']=function(_0x348eed,_0x334ed6){var _0x550a9f={};var _0x2e91d3=_[_0x6845('0x22')](db[_0x6845('0x23')][_0x6845('0x24')],function(_0x42f22b){return{'name':_0x42f22b[_0x6845('0x25')],'type':_0x42f22b[_0x6845('0x26')]['key']};});_0x550a9f=qs[_0x6845('0x27')](_0x2e91d3,_0x348eed);return interaction[_0x6845('0x28')](_0x6845('0x29'),_0x348eed['query'],_0x348eed[_0x6845('0x2a')],_0x550a9f,_0x2e91d3)[_0x6845('0x1c')](respondWithFilteredResult(_0x334ed6,_0x550a9f))[_0x6845('0x2b')](handleError(_0x334ed6,null));};exports[_0x6845('0x2c')]=function(_0x42beb6,_0x5af058){var _0x14cd05={'raw':![],'where':{'id':_0x42beb6['params']['id']}},_0x265666={};_0x265666[_0x6845('0x2d')]=_[_0x6845('0x2e')](db[_0x6845('0x23')]['rawAttributes']);_0x265666['query']=_[_0x6845('0x2e')](_0x42beb6[_0x6845('0x2f')]);_0x265666[_0x6845('0x30')]=_[_0x6845('0x31')](_0x265666['model'],_0x265666['query']);_0x14cd05['attributes']=_[_0x6845('0x31')](_0x265666['model'],qs[_0x6845('0x32')](_0x42beb6['query'][_0x6845('0x32')]));_0x14cd05[_0x6845('0x33')]=_0x14cd05[_0x6845('0x33')][_0x6845('0x34')]?_0x14cd05[_0x6845('0x33')]:_0x265666[_0x6845('0x2d')];if(_0x42beb6[_0x6845('0x2f')]['includeAll']){_0x14cd05[_0x6845('0x35')]=[{'all':!![]}];}_0x14cd05=_['merge']({},_0x14cd05,_0x42beb6['options']);return db[_0x6845('0x23')][_0x6845('0x36')](_0x14cd05)[_0x6845('0x1c')](handleEntityNotFound(_0x5af058,null))[_0x6845('0x1c')](respondWithResult(_0x5af058,null))['catch'](handleError(_0x5af058,null));};exports[_0x6845('0x37')]=function(_0x22528f,_0x1efba4){return db[_0x6845('0x23')][_0x6845('0x37')](_0x22528f[_0x6845('0x38')],{})[_0x6845('0x1c')](respondWithResult(_0x1efba4,0xc9))[_0x6845('0x2b')](handleError(_0x1efba4,null));};exports['update']=function(_0x4739fe,_0x1164bd){if(_0x4739fe[_0x6845('0x38')]['id']){delete _0x4739fe[_0x6845('0x38')]['id'];}return db[_0x6845('0x23')][_0x6845('0x36')]({'where':{'id':_0x4739fe[_0x6845('0x39')]['id']}})[_0x6845('0x1c')](handleEntityNotFound(_0x1164bd,null))[_0x6845('0x1c')](saveUpdates(_0x4739fe[_0x6845('0x38')],null))['then'](respondWithResult(_0x1164bd,null))[_0x6845('0x2b')](handleError(_0x1164bd,null));};exports[_0x6845('0x1d')]=function(_0x58bf58,_0x39aedf){return db[_0x6845('0x23')][_0x6845('0x36')]({'where':{'id':_0x58bf58[_0x6845('0x39')]['id']}})[_0x6845('0x1c')](handleEntityNotFound(_0x39aedf,null))[_0x6845('0x1c')](removeEntity(_0x39aedf,null))[_0x6845('0x2b')](handleError(_0x39aedf,null));};exports['describe']=function(_0x53c691,_0x4bcdf6){return db[_0x6845('0x23')][_0x6845('0x3a')]()[_0x6845('0x1c')](respondWithResult(_0x4bcdf6,null))[_0x6845('0x2b')](handleError(_0x4bcdf6,null));};exports[_0x6845('0x3b')]=function(_0x3434d7,_0x491c46){return db[_0x6845('0x3c')][_0x6845('0x36')]({'where':{'id':_0x3434d7[_0x6845('0x39')]['id']}})[_0x6845('0x1c')](handleEntityNotFound(_0x491c46,null))[_0x6845('0x1c')](function(_0xe5f3b7){if(_0xe5f3b7){return _0xe5f3b7[_0x6845('0x3b')](_0x3434d7[_0x6845('0x38')][_0x6845('0x3d')],_[_0x6845('0x3e')](_0x3434d7[_0x6845('0x38')],[_0x6845('0x3d'),'id'])||{});}})[_0x6845('0x1c')](respondWithResult(_0x491c46,null))[_0x6845('0x2b')](handleError(_0x491c46,null));};exports[_0x6845('0x3f')]=function(_0x4a9cb1,_0x5cf943){var _0x440067={'raw':![],'where':{}};var _0x11e959={};var _0x4a9201={'count':0x0,'rows':[]};return db[_0x6845('0x23')][_0x6845('0x40')]({'where':{'id':_0x4a9cb1[_0x6845('0x39')]['id']}})[_0x6845('0x1c')](handleEntityNotFound(_0x5cf943,null))[_0x6845('0x1c')](function(_0x4b1a41){if(_0x4b1a41){_0x11e959[_0x6845('0x2d')]=_[_0x6845('0x2e')](db[_0x6845('0x3c')][_0x6845('0x24')]);_0x11e959[_0x6845('0x2f')]=_['keys'](_0x4a9cb1[_0x6845('0x2f')]);_0x11e959[_0x6845('0x30')]=_[_0x6845('0x31')](_0x11e959['model'],_0x11e959['query']);_0x440067['attributes']=_[_0x6845('0x31')](_0x11e959[_0x6845('0x2d')],qs[_0x6845('0x32')](_0x4a9cb1['query']['fields']));_0x440067['attributes']=_0x440067[_0x6845('0x33')][_0x6845('0x34')]?_0x440067[_0x6845('0x33')]:_0x11e959[_0x6845('0x2d')];if(!_0x4a9cb1['query'][_0x6845('0x41')](_0x6845('0x42'))){_0x440067['limit']=qs[_0x6845('0x18')](_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x18')]);_0x440067[_0x6845('0x16')]=qs[_0x6845('0x16')](_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x16')]);}_0x440067[_0x6845('0x43')]=qs['sort'](_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x44')]);_0x440067[_0x6845('0x45')]=qs[_0x6845('0x30')](_[_0x6845('0x46')](_0x4a9cb1[_0x6845('0x2f')],_0x11e959[_0x6845('0x30')]));_0x440067[_0x6845('0x45')][_0x6845('0x47')]=_0x4b1a41['id'];if(_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x48')]){_0x440067['where']=_[_0x6845('0x49')](_0x440067[_0x6845('0x45')],{'$or':_['map'](_0x440067['attributes'],function(_0x2f86da){var _0x3ec599={};_0x3ec599[_0x2f86da]={'$like':'%'+_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x48')]+'%'};return _0x3ec599;})});}if(_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x4a')]){var _0x5b2964=_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x4a')][_0x6845('0x4b')](',');var _0xf03572={};_0xf03572[_0x5b2964[0x0]]={'$gte':moment(_0x5b2964[0x1])['format'](_0x6845('0x4c'))};_0x440067[_0x6845('0x45')]=_[_0x6845('0x49')](_0x440067[_0x6845('0x45')],_0xf03572);}_0x440067=_[_0x6845('0x49')]({},_0x440067,_0x4a9cb1['options']);return db['MailMessage']['count']({'where':_0x440067[_0x6845('0x45')]})['then'](function(_0x6c1661){_0x4a9201[_0x6845('0x19')]=_0x6c1661;if(_0x4a9cb1[_0x6845('0x2f')][_0x6845('0x4d')]){_0x440067[_0x6845('0x35')]=[{'all':!![]}];}return db[_0x6845('0x3c')]['findAll'](_0x440067);})[_0x6845('0x1c')](function(_0x176fdf){if(_0x4a9cb1[_0x6845('0x2f')]['inlineCss']===_0x6845('0x4e')){for(var _0x1bb0f1=0x0;_0x1bb0f1<_0x176fdf['length'];_0x1bb0f1++){_0x176fdf[_0x1bb0f1][_0x6845('0x38')]=juice(_0x176fdf[_0x1bb0f1]['body']);}}_0x4a9201[_0x6845('0x4f')]=_0x176fdf;return _0x4a9201;});}})[_0x6845('0x1c')](respondWithFilteredResult(_0x5cf943,_0x440067))[_0x6845('0x2b')](handleError(_0x5cf943,null));};exports[_0x6845('0x50')]=function(_0x2cd776,_0x5136fb){return db[_0x6845('0x23')][_0x6845('0x36')]({'where':{'id':_0x2cd776['params']['id']}})['then'](handleEntityNotFound(_0x5136fb,null))[_0x6845('0x1c')](function(_0x49e008){if(_0x49e008){return _0x49e008[_0x6845('0x51')](_0x2cd776['body'][_0x6845('0x3d')],_['omit'](_0x2cd776[_0x6845('0x38')],['ids','id'])||{})[_0x6845('0x52')](function(){return db['Tag']['findAll']({'attributes':['id',_0x6845('0x20'),'color'],'where':{'id':_0x2cd776[_0x6845('0x38')][_0x6845('0x3d')]}});})[_0x6845('0x1c')](function(_0x16fa29){socket['emit'](_0x6845('0x53'),{'id':Number(_0x2cd776['params']['id']),'tags':_0x16fa29||[]});return{'id':Number(_0x2cd776[_0x6845('0x39')]['id']),'tags':_0x16fa29||[]};});}})[_0x6845('0x1c')](respondWithResult(_0x5136fb,null))['catch'](handleError(_0x5136fb,null));};exports[_0x6845('0x54')]=function(_0x2741b4,_0x773c6e){return db[_0x6845('0x23')][_0x6845('0x36')]({'where':{'id':_0x2741b4['params']['id']}})['then'](handleEntityNotFound(_0x773c6e,null))['then'](function(_0x54bc34){if(_0x54bc34){return _0x54bc34[_0x6845('0x54')](_0x2741b4[_0x6845('0x2f')]['ids']);}})[_0x6845('0x1c')](respondWithStatusCode(_0x773c6e,null))[_0x6845('0x2b')](handleError(_0x773c6e,null));};exports[_0x6845('0x55')]=function(_0x243827,_0x4e58c9){var _0x1ba944=moment()[_0x6845('0x56')]()['toString']();var _0x4e4dd4=path[_0x6845('0x57')](config[_0x6845('0x58')],_0x6845('0x59'),_0x6845('0x5a'),'tmp');var _0x572ef1=path[_0x6845('0x57')](config[_0x6845('0x58')],'server',_0x6845('0x5a'),'attachments');var _0x3749b9=path['join'](_0x4e4dd4,_0x1ba944);var _0x598275=util[_0x6845('0x5b')](_0x6845('0x5c'),_0x243827[_0x6845('0x39')]['id'],_0x1ba944);var _0x3ce741=path['join'](_0x4e4dd4,_0x598275);var _0x5cfe67=[];if(_0x243827[_0x6845('0x2f')][_0x6845('0x5d')]){_0x5cfe67[_0x6845('0x5e')]({'model':db[_0x6845('0x5f')],'as':'Attachments','raw':!![]});}var _0x263860=[{'model':db[_0x6845('0x3c')],'as':_0x6845('0x60'),'attributes':['id',_0x6845('0x38'),_0x6845('0x61'),'to','cc','bcc','subject','createdAt'],'where':{'secret':![]},'order':qs[_0x6845('0x44')]('id'),'include':_0x5cfe67}];return db[_0x6845('0x23')][_0x6845('0x36')]({'where':{'id':_0x243827[_0x6845('0x39')]['id']},'include':_0x263860})[_0x6845('0x1c')](handleEntityNotFound(_0x4e58c9,null))[_0x6845('0x1c')](function(_0x2e7689){if(_0x2e7689&&_0x2e7689[_0x6845('0x60')]){var _0x3fe595=_0x2e7689[_0x6845('0x62')]({'plain':!![]});fs[_0x6845('0x63')](_0x3749b9);return BPromise[_0x6845('0x64')](_0x3fe595['Messages'],function(_0x62de32,_0x690075){var _0x1a469c={'from':_0x62de32[_0x6845('0x61')],'to':_0x62de32['to'],'subject':_0x62de32[_0x6845('0x65')],'html':htmlEntities[_0x6845('0x66')](_0x62de32[_0x6845('0x38')]),'headers':{'Date':moment(_0x62de32['createdAt'])['format'](_0x6845('0x67'))},'attachments':[]};if(_0x62de32['cc']){_0x1a469c[_0x6845('0x68')]['Cc']=_0x62de32['cc'];}if(_0x62de32[_0x6845('0x69')]){_0x1a469c[_0x6845('0x68')]['Bcc']=_0x62de32[_0x6845('0x69')];}return new BPromise(function(_0x544239,_0x34fab6){if(_0x62de32['Attachments']){for(var _0x58429c=0x0;_0x58429c<_0x62de32[_0x6845('0x6a')]['length'];_0x58429c++){var _0x1ba6c4=_0x62de32['Attachments'][_0x58429c];var _0x22a6a6=path[_0x6845('0x57')](_0x572ef1,_0x1ba6c4[_0x6845('0x6b')]);if(fs[_0x6845('0x6c')](_0x22a6a6)){_0x1a469c[_0x6845('0x5d')][_0x6845('0x5e')]({'name':_0x1ba6c4['name'],'contentType':_0x1ba6c4[_0x6845('0x26')],'data':fs[_0x6845('0x6d')](_0x22a6a6)});}}}emlformat[_0x6845('0x6e')](_0x1a469c,function(_0x17bca9,_0x1eadc4){if(_0x17bca9)return _0x34fab6(_0x17bca9);fs['writeFileSync'](path[_0x6845('0x57')](_0x3749b9,util['format'](_0x6845('0x6f'),_0x690075)),_0x1eadc4);return _0x544239(_0x1eadc4);});});})[_0x6845('0x1c')](function(){return new BPromise(function(_0x43dddd,_0x33f7bb){zipdir(_0x3749b9,{'saveTo':_0x3ce741},function(_0x4080d7,_0xe77b78){if(_0x4080d7)return _0x33f7bb(_0x4080d7);return _0x43dddd(_0xe77b78);});})[_0x6845('0x1c')](function(){return new BPromise(function(_0x1a09f2,_0x5d4d01){rimraf(_0x3749b9,function(_0x3fc3f7){if(_0x3fc3f7)_0x5d4d01(_0x3fc3f7);return _0x1a09f2();});});})[_0x6845('0x1c')](function(){return _0x4e58c9[_0x6845('0x55')](_0x3ce741,_0x598275,function(_0x5e3768){if(!_0x5e3768)fs[_0x6845('0x70')](_0x3ce741);});});});}else{return _0x4e58c9[_0x6845('0x12')](0xc8);}})[_0x6845('0x2b')](handleError(_0x4e58c9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 27a9eb3..3826170 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 _0xc490=['emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x379021,_0x5f49e0){var _0x5a3431=function(_0x68ca07){while(--_0x68ca07){_0x379021['push'](_0x379021['shift']());}};_0x5a3431(++_0x5f49e0);}(_0xc490,0xf3));var _0x0c49=function(_0x58b4c0,_0xe35dd9){_0x58b4c0=_0x58b4c0-0x0;var _0x14fc22=_0xc490[_0x58b4c0];return _0x14fc22;};'use strict';var EventEmitter=require(_0x0c49('0x0'));var MailInteraction=require(_0x0c49('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x0c49('0x1'))['db'][_0x0c49('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0c49('0x3'),'afterUpdate':_0x0c49('0x4'),'afterDestroy':_0x0c49('0x5')};function emitEvent(_0x16c010){return function(_0x3b8a6c,_0x5e0157,_0x1bb455){_0x3b8a6c[_0x0c49('0x6')]({'attributes':['id'],'raw':!![]})[_0x0c49('0x7')](function(_0x278f8a){_0x3b8a6c[_0x0c49('0x8')]('Users',_0x278f8a[_0x0c49('0x9')](function(_0x48b312){return{'id':_0x48b312['id']};}));return MailMessage[_0x0c49('0xa')]({'where':{'MailInteractionId':_0x3b8a6c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0c49('0x7')](function(_0x1b8826){_0x3b8a6c[_0x0c49('0x8')](_0x0c49('0xb'),_0x1b8826[_0x0c49('0xc')]);MailInteractionEvents[_0x0c49('0xd')](_0x16c010+':'+_0x3b8a6c['id'],_0x3b8a6c);MailInteractionEvents[_0x0c49('0xd')](_0x16c010,_0x3b8a6c);_0x1bb455(null);})['catch'](_0x1bb455(null));};}for(var e in events){if(events[_0x0c49('0xe')](e)){var event=events[e];MailInteraction[_0x0c49('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xfb3b=['save','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners'];(function(_0x5be892,_0x68238a){var _0x53fc35=function(_0x8626ac){while(--_0x8626ac){_0x5be892['push'](_0x5be892['shift']());}};_0x53fc35(++_0x68238a);}(_0xfb3b,0x109));var _0xbfb3=function(_0x2b5c66,_0x121174){_0x2b5c66=_0x2b5c66-0x0;var _0x15705a=_0xfb3b[_0x2b5c66];return _0x15705a;};'use strict';var EventEmitter=require(_0xbfb3('0x0'));var MailInteraction=require(_0xbfb3('0x1'))['db'][_0xbfb3('0x2')];var MailMessage=require(_0xbfb3('0x1'))['db'][_0xbfb3('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbfb3('0x4')](0x0);var events={'afterCreate':_0xbfb3('0x5'),'afterUpdate':'update','afterDestroy':_0xbfb3('0x6')};function emitEvent(_0xb7d4a4){return function(_0x54426f,_0x36bd53,_0x4ddf3b){_0x54426f[_0xbfb3('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5f5cea){_0x54426f['setDataValue'](_0xbfb3('0x8'),_0x5f5cea[_0xbfb3('0x9')](function(_0x4c8c5f){return{'id':_0x4c8c5f['id']};}));return MailMessage[_0xbfb3('0xa')]({'where':{'MailInteractionId':_0x54426f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfb3('0xb')](function(_0x5dc685){_0x54426f[_0xbfb3('0xc')](_0xbfb3('0xd'),_0x5dc685['length']);MailInteractionEvents['emit'](_0xb7d4a4+':'+_0x54426f['id'],_0x54426f);MailInteractionEvents[_0xbfb3('0xe')](_0xb7d4a4,_0x54426f);_0x4ddf3b(null);})[_0xbfb3('0xf')](_0x4ddf3b(null));};}for(var e in events){if(events[_0xbfb3('0x10')](e)){var event=events[e];MailInteraction[_0xbfb3('0x11')](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 71e138e..0b68bd7 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 _0xe5f4=['YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','models','closed','then','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format'];(function(_0x39b9cd,_0x1ac76a){var _0x441cf4=function(_0x4687b4){while(--_0x4687b4){_0x39b9cd['push'](_0x39b9cd['shift']());}};_0x441cf4(++_0x1ac76a);}(_0xe5f4,0x10e));var _0x4e5f=function(_0x2d0b84,_0x34682d){_0x2d0b84=_0x2d0b84-0x0;var _0x8d0088=_0xe5f4[_0x2d0b84];return _0x8d0088;};'use strict';var _=require(_0x4e5f('0x0'));var util=require(_0x4e5f('0x1'));var logger=require(_0x4e5f('0x2'))(_0x4e5f('0x3'));var moment=require(_0x4e5f('0x4'));var BPromise=require(_0x4e5f('0x5'));var rp=require(_0x4e5f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e5f('0x7'));var config=require(_0x4e5f('0x8'));var attributes=require(_0x4e5f('0x9'));module[_0x4e5f('0xa')]=function(_0x355c05,_0x392eb5){return _0x355c05[_0x4e5f('0xb')]('MailInteraction',attributes,{'tableName':_0x4e5f('0xc'),'paranoid':![],'indexes':[{'name':_0x4e5f('0xd'),'fields':['subject','to'],'type':_0x4e5f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x88afcd,_0x330484,_0x5f0a04){if(_0x88afcd[_0x4e5f('0xf')]){_0x88afcd[_0x4e5f('0x10')]=moment()[_0x4e5f('0x11')](_0x4e5f('0x12'));}if(_0x88afcd['closed']){_0x88afcd[_0x4e5f('0x13')]=moment()[_0x4e5f('0x11')](_0x4e5f('0x12'));}_0x5f0a04(null,_0x330484);},'beforeUpdate':function(_0x5a974e,_0x2ea7a5,_0x314894){if(_0x5a974e[_0x4e5f('0x14')](_0x4e5f('0xf'))){_0x5a974e[_0x4e5f('0x10')]=_0x5a974e['substatus']?moment()[_0x4e5f('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5a974e[_0x4e5f('0x14')]('closed')){_0x5a974e['closedAt']=moment()[_0x4e5f('0x11')](_0x4e5f('0x12'));_0x5a974e[_0x4e5f('0xf')]=null;_0x5a974e['substatusAt']=null;}_0x314894(null,_0x5a974e);},'afterUpdate':function(_0x4820f1,_0x43af5a,_0x32a1e5){var _0x4e2cc6=_0x355c05[_0x4e5f('0x15')];var _0x5c5cc7=_0x4820f1['get']({'plain':!![]});if(_0x5c5cc7[_0x4e5f('0x16')]){return _0x4e2cc6['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x5c5cc7['id']}})[_0x4e5f('0x17')](function(){_0x32a1e5();})['catch'](function(_0x3ec219){_0x32a1e5(_0x3ec219);});}else{_0x32a1e5();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x17b1=['substatus','closed','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed'];(function(_0x4cc2fb,_0x5c004b){var _0x4acace=function(_0x1d9bec){while(--_0x1d9bec){_0x4cc2fb['push'](_0x4cc2fb['shift']());}};_0x4acace(++_0x5c004b);}(_0x17b1,0x11f));var _0x117b=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x17b1[_0x1ee5be];return _0x177140;};'use strict';var _=require(_0x117b('0x0'));var util=require(_0x117b('0x1'));var logger=require(_0x117b('0x2'))(_0x117b('0x3'));var moment=require(_0x117b('0x4'));var BPromise=require(_0x117b('0x5'));var rp=require(_0x117b('0x6'));var fs=require('fs');var path=require(_0x117b('0x7'));var rimraf=require('rimraf');var config=require(_0x117b('0x8'));var attributes=require(_0x117b('0x9'));module[_0x117b('0xa')]=function(_0x33b80a,_0x2dff01){return _0x33b80a[_0x117b('0xb')](_0x117b('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x117b('0xd'),'fields':[_0x117b('0xe'),'to'],'type':_0x117b('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x19dc9e,_0x17f741,_0x5068e2){if(_0x19dc9e['substatus']){_0x19dc9e[_0x117b('0x10')]=moment()[_0x117b('0x11')](_0x117b('0x12'));}if(_0x19dc9e['closed']){_0x19dc9e[_0x117b('0x13')]=moment()[_0x117b('0x11')](_0x117b('0x12'));}_0x5068e2(null,_0x17f741);},'beforeUpdate':function(_0x4c6aec,_0x5ab3c0,_0x12ab9b){if(_0x4c6aec[_0x117b('0x14')]('substatus')){_0x4c6aec['substatusAt']=_0x4c6aec[_0x117b('0x15')]?moment()[_0x117b('0x11')](_0x117b('0x12')):null;}if(_0x4c6aec[_0x117b('0x14')](_0x117b('0x16'))){_0x4c6aec[_0x117b('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c6aec['substatus']=null;_0x4c6aec[_0x117b('0x10')]=null;}_0x12ab9b(null,_0x4c6aec);},'afterUpdate':function(_0x35511f,_0x287188,_0x206587){var _0x270c78=_0x33b80a['models'];var _0x3f7eae=_0x35511f['get']({'plain':!![]});if(_0x3f7eae[_0x117b('0x16')]){return _0x270c78[_0x117b('0x17')][_0x117b('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x3f7eae['id']}})[_0x117b('0x19')](function(){_0x206587();})[_0x117b('0x1a')](function(_0x3562c5){_0x206587(_0x3562c5);});}else{_0x206587();}}},'charset':'utf8mb4','collate':_0x117b('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3955204..cc3d9dc 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 _0xaa3f=['MailInteraction,\x20%s,\x20%s','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x46cf0d,_0x115e3a){var _0x531d37=function(_0x1b0281){while(--_0x1b0281){_0x46cf0d['push'](_0x46cf0d['shift']());}};_0x531d37(++_0x115e3a);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x307fc9,_0x46c299){_0x307fc9=_0x307fc9-0x0;var _0x2a090d=_0xaa3f[_0x307fc9];return _0x2a090d;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var moment=require(_0xfaa3('0x2'));var BPromise=require(_0xfaa3('0x3'));var rs=require(_0xfaa3('0x4'));var fs=require('fs');var Redis=require(_0xfaa3('0x5'));var db=require(_0xfaa3('0x6'))['db'];var utils=require(_0xfaa3('0x7'));var logger=require(_0xfaa3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfaa3('0x9'));var client=jayson['client'][_0xfaa3('0xa')]({'port':0x232a});config[_0xfaa3('0xb')]=_[_0xfaa3('0xc')](config[_0xfaa3('0xb')],{'host':_0xfaa3('0xd'),'port':0x18eb});var socket=require(_0xfaa3('0xe'))(new Redis(config[_0xfaa3('0xb')]));require('./mailInteraction.socket')[_0xfaa3('0xf')](socket);function respondWithRpcPromise(_0x28de66,_0x49380c,_0x5ca0da){return new BPromise(function(_0x44d88e,_0xce3b1f){return client[_0xfaa3('0x10')](_0x28de66,_0x5ca0da)[_0xfaa3('0x11')](function(_0x23e4b6){logger[_0xfaa3('0x12')]('MailInteraction,\x20%s,\x20%s',_0x49380c,_0xfaa3('0x13'));logger['debug'](_0xfaa3('0x14'),_0x49380c,_0xfaa3('0x13'),JSON[_0xfaa3('0x15')](_0x23e4b6));if(_0x23e4b6['error']){if(_0x23e4b6[_0xfaa3('0x16')]['code']===0x1f4){logger[_0xfaa3('0x16')](_0xfaa3('0x17'),_0x49380c,_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);return _0xce3b1f(_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x49380c,_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);return _0x44d88e(_0x23e4b6[_0xfaa3('0x16')][_0xfaa3('0x18')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x49380c,'request\x20sent');_0x44d88e(_0x23e4b6['result']['message']);}})[_0xfaa3('0x19')](function(_0x5cc884){logger[_0xfaa3('0x16')](_0xfaa3('0x17'),_0x49380c,_0x5cc884);_0xce3b1f(_0x5cc884);});});}exports[_0xfaa3('0x1a')]=function(_0x34b276){var _0x1c32dd=this;return new Promise(function(_0x310b0d,_0x1dd053){return db[_0xfaa3('0x1b')][_0xfaa3('0x1c')](_0x34b276[_0xfaa3('0x1d')],{'raw':_0x34b276['options']?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')]['where']||null:null,'attributes':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x20')]||null:null,'limit':_0x34b276[_0xfaa3('0x1e')]?_0x34b276[_0xfaa3('0x1e')][_0xfaa3('0x21')]||null:null})[_0xfaa3('0x11')](function(_0x11841c){logger['info'](_0xfaa3('0x1a'),_0x34b276);logger[_0xfaa3('0x22')](_0xfaa3('0x1a'),_0x34b276,JSON[_0xfaa3('0x15')](_0x11841c));_0x310b0d(_0x11841c);})[_0xfaa3('0x19')](function(_0xf83bbe){logger[_0xfaa3('0x16')](_0xfaa3('0x1a'),_0xf83bbe[_0xfaa3('0x18')],_0x34b276);_0x1dd053(_0x1c32dd[_0xfaa3('0x16')](0x1f4,_0xf83bbe[_0xfaa3('0x18')]));});});};exports[_0xfaa3('0x23')]=function(_0x18bd3e){return new Promise(function(_0x1bc202,_0x2d7c43){return db['MailInteraction'][_0xfaa3('0x24')]({'where':_0x18bd3e[_0xfaa3('0x1e')]?_0x18bd3e[_0xfaa3('0x1e')]['where']||null:null})[_0xfaa3('0x11')](function(_0x50fb9f){if(_0x50fb9f){return _0x50fb9f[_0xfaa3('0x25')](_0x18bd3e['body'][_0xfaa3('0x26')],_[_0xfaa3('0x27')](_0x18bd3e[_0xfaa3('0x1d')],[_0xfaa3('0x26'),'id'])||{});}})[_0xfaa3('0x28')](function(_0x33ae08){logger[_0xfaa3('0x12')](_0xfaa3('0x29'),_0x18bd3e);logger['debug'](_0xfaa3('0x29'),_0x18bd3e,JSON[_0xfaa3('0x15')](_0x33ae08));_0x1bc202(_0x33ae08);})[_0xfaa3('0x19')](function(_0x174f78){logger[_0xfaa3('0x16')](_0xfaa3('0x29'),_0x174f78[_0xfaa3('0x18')],_0x18bd3e);_0x2d7c43(_this[_0xfaa3('0x16')](0x1f4,_0x174f78[_0xfaa3('0x18')]));});});}; \ No newline at end of file +var _0x6829=['limit','UpdateMailInteraction','AddTagsToMailInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','body','options'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x6829,0xf3));var _0x9682=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x6829[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x9682('0x0'));var util=require(_0x9682('0x1'));var moment=require(_0x9682('0x2'));var BPromise=require(_0x9682('0x3'));var rs=require(_0x9682('0x4'));var fs=require('fs');var Redis=require(_0x9682('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9682('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9682('0x7'));var client=jayson[_0x9682('0x8')]['http']({'port':0x232a});config[_0x9682('0x9')]=_['defaults'](config[_0x9682('0x9')],{'host':_0x9682('0xa'),'port':0x18eb});var socket=require(_0x9682('0xb'))(new Redis(config['redis']));require(_0x9682('0xc'))[_0x9682('0xd')](socket);function respondWithRpcPromise(_0x3a171d,_0x43db3f,_0x43b2b4){return new BPromise(function(_0x311d7c,_0x1bac30){return client[_0x9682('0xe')](_0x3a171d,_0x43b2b4)[_0x9682('0xf')](function(_0x56fd90){logger[_0x9682('0x10')](_0x9682('0x11'),_0x43db3f,_0x9682('0x12'));logger[_0x9682('0x13')](_0x9682('0x14'),_0x43db3f,_0x9682('0x12'),JSON[_0x9682('0x15')](_0x56fd90));if(_0x56fd90[_0x9682('0x16')]){if(_0x56fd90['error'][_0x9682('0x17')]===0x1f4){logger[_0x9682('0x16')]('MailInteraction,\x20%s,\x20%s',_0x43db3f,_0x56fd90[_0x9682('0x16')][_0x9682('0x18')]);return _0x1bac30(_0x56fd90[_0x9682('0x16')][_0x9682('0x18')]);}logger[_0x9682('0x16')](_0x9682('0x11'),_0x43db3f,_0x56fd90['error'][_0x9682('0x18')]);return _0x311d7c(_0x56fd90[_0x9682('0x16')]['message']);}else{logger[_0x9682('0x10')](_0x9682('0x11'),_0x43db3f,_0x9682('0x12'));_0x311d7c(_0x56fd90[_0x9682('0x19')]['message']);}})[_0x9682('0x1a')](function(_0x54163b){logger[_0x9682('0x16')]('MailInteraction,\x20%s,\x20%s',_0x43db3f,_0x54163b);_0x1bac30(_0x54163b);});});}exports['UpdateMailInteraction']=function(_0x427a03){var _0x461307=this;return new Promise(function(_0xfe19d5,_0x144ef0){return db[_0x9682('0x1b')]['update'](_0x427a03[_0x9682('0x1c')],{'raw':_0x427a03[_0x9682('0x1d')]?_0x427a03[_0x9682('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x427a03[_0x9682('0x1d')]?_0x427a03[_0x9682('0x1d')]['where']||null:null,'attributes':_0x427a03[_0x9682('0x1d')]?_0x427a03[_0x9682('0x1d')]['attributes']||null:null,'limit':_0x427a03[_0x9682('0x1d')]?_0x427a03[_0x9682('0x1d')][_0x9682('0x1e')]||null:null})[_0x9682('0xf')](function(_0x22ab80){logger['info'](_0x9682('0x1f'),_0x427a03);logger[_0x9682('0x13')](_0x9682('0x1f'),_0x427a03,JSON['stringify'](_0x22ab80));_0xfe19d5(_0x22ab80);})[_0x9682('0x1a')](function(_0xc9d9d2){logger[_0x9682('0x16')](_0x9682('0x1f'),_0xc9d9d2[_0x9682('0x18')],_0x427a03);_0x144ef0(_0x461307[_0x9682('0x16')](0x1f4,_0xc9d9d2[_0x9682('0x18')]));});});};exports[_0x9682('0x20')]=function(_0xbe4934){return new Promise(function(_0xa7ab1f,_0x43c729){return db['MailInteraction'][_0x9682('0x21')]({'where':_0xbe4934['options']?_0xbe4934[_0x9682('0x1d')][_0x9682('0x22')]||null:null})['then'](function(_0x58f189){if(_0x58f189){return _0x58f189[_0x9682('0x23')](_0xbe4934[_0x9682('0x1c')]['ids'],_['omit'](_0xbe4934['body'],[_0x9682('0x24'),'id'])||{});}})[_0x9682('0x25')](function(_0x381302){logger[_0x9682('0x10')]('AddTags',_0xbe4934);logger[_0x9682('0x13')](_0x9682('0x26'),_0xbe4934,JSON[_0x9682('0x15')](_0x381302));_0xa7ab1f(_0x381302);})['catch'](function(_0x15bdcb){logger[_0x9682('0x16')](_0x9682('0x26'),_0x15bdcb['message'],_0xbe4934);_0x43c729(_this[_0x9682('0x16')](0x1f4,_0x15bdcb[_0x9682('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index d878913..576ed22 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 _0x2758=['update','register','length','./mailInteraction.events','save','remove'];(function(_0x511159,_0x882b97){var _0x3b01ff=function(_0x41b265){while(--_0x41b265){_0x511159['push'](_0x511159['shift']());}};_0x3b01ff(++_0x882b97);}(_0x2758,0x1bf));var _0x8275=function(_0x3b5587,_0x22a6f4){_0x3b5587=_0x3b5587-0x0;var _0x3fbb62=_0x2758[_0x3b5587];return _0x3fbb62;};'use strict';var MailInteractionEvents=require(_0x8275('0x0'));var events=[_0x8275('0x1'),_0x8275('0x2'),_0x8275('0x3')];function createListener(_0x56f85c,_0x4cace3){return function(_0x3f69e3){_0x4cace3['emit'](_0x56f85c,_0x3f69e3);};}function removeListener(_0x235838,_0x4cecd4){return function(){MailInteractionEvents['removeListener'](_0x235838,_0x4cecd4);};}exports[_0x8275('0x4')]=function(_0x10a061){for(var _0x34d6f4=0x0,_0x2146b3=events[_0x8275('0x5')];_0x34d6f4<_0x2146b3;_0x34d6f4++){var _0x17bf4c=events[_0x34d6f4];var _0x35b457=createListener('mailInteraction:'+_0x17bf4c,_0x10a061);MailInteractionEvents['on'](_0x17bf4c,_0x35b457);}}; \ No newline at end of file +var _0xdc1f=['register','length','./mailInteraction.events','save','update','emit'];(function(_0x2ca993,_0x11af2c){var _0x4b256a=function(_0x193b8c){while(--_0x193b8c){_0x2ca993['push'](_0x2ca993['shift']());}};_0x4b256a(++_0x11af2c);}(_0xdc1f,0x194));var _0xfdc1=function(_0x195a46,_0x19909b){_0x195a46=_0x195a46-0x0;var _0xddcc95=_0xdc1f[_0x195a46];return _0xddcc95;};'use strict';var MailInteractionEvents=require(_0xfdc1('0x0'));var events=[_0xfdc1('0x1'),'remove',_0xfdc1('0x2')];function createListener(_0x4aa9e3,_0x57179b){return function(_0x58dfcf){_0x57179b[_0xfdc1('0x3')](_0x4aa9e3,_0x58dfcf);};}function removeListener(_0x2e6da2,_0x2a9212){return function(){MailInteractionEvents['removeListener'](_0x2e6da2,_0x2a9212);};}exports[_0xfdc1('0x4')]=function(_0x524ac3){for(var _0x1c8a08=0x0,_0x4cb978=events[_0xfdc1('0x5')];_0x1c8a08<_0x4cb978;_0x1c8a08++){var _0x593e5f=events[_0x1c8a08];var _0x2e0019=createListener('mailInteraction:'+_0x593e5f,_0x524ac3);MailInteractionEvents['on'](_0x593e5f,_0x2e0019);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index e92ba7a..45792e4 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 _0xb13f=['../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','mail','create','update','put','/:id/accept','accept','reject','delete','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb13f,0x1de));var _0xfb13=function(_0x3fb5ad,_0x398b8a){_0x3fb5ad=_0x3fb5ad-0x0;var _0x434c20=_0xb13f[_0x3fb5ad];return _0x434c20;};'use strict';var multer=require(_0xfb13('0x0'));var util=require(_0xfb13('0x1'));var path=require('path');var timeout=require(_0xfb13('0x2'));var express=require('express');var router=express[_0xfb13('0x3')]();var fs_extra=require(_0xfb13('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfb13('0x5'));var config=require('../../config/environment');var controller=require(_0xfb13('0x6'));router[_0xfb13('0x7')]('/',auth[_0xfb13('0x8')](),controller[_0xfb13('0x9')]);router[_0xfb13('0x7')](_0xfb13('0xa'),auth[_0xfb13('0x8')](),controller[_0xfb13('0xb')]);router[_0xfb13('0x7')](_0xfb13('0xc'),auth[_0xfb13('0x8')](),controller['show']);router[_0xfb13('0x7')]('/:id/download',auth[_0xfb13('0x8')](),controller['download']);router[_0xfb13('0xd')]('/',auth[_0xfb13('0x8')](),interaction['tracked'](_0xfb13('0xe'),'mailmessage:create'),controller[_0xfb13('0xf')]);router['put'](_0xfb13('0xc'),auth['isAuthenticated'](),controller[_0xfb13('0x10')]);router[_0xfb13('0x11')](_0xfb13('0x12'),auth['isAuthenticated'](),controller[_0xfb13('0x13')]);router[_0xfb13('0x11')]('/:id/reject',auth[_0xfb13('0x8')](),controller[_0xfb13('0x14')]);router[_0xfb13('0x15')]('/:id',auth[_0xfb13('0x8')](),controller['destroy']);module[_0xfb13('0x16')]=router; \ No newline at end of file +var _0xfa20=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy'];(function(_0x41e743,_0x587cd2){var _0x5ece6b=function(_0x2f4d3b){while(--_0x2f4d3b){_0x41e743['push'](_0x41e743['shift']());}};_0x5ece6b(++_0x587cd2);}(_0xfa20,0x141));var _0x0fa2=function(_0x54a8d3,_0x12b8b7){_0x54a8d3=_0x54a8d3-0x0;var _0x5eec0e=_0xfa20[_0x54a8d3];return _0x5eec0e;};'use strict';var multer=require(_0x0fa2('0x0'));var util=require(_0x0fa2('0x1'));var path=require(_0x0fa2('0x2'));var timeout=require(_0x0fa2('0x3'));var express=require(_0x0fa2('0x4'));var router=express[_0x0fa2('0x5')]();var fs_extra=require(_0x0fa2('0x6'));var auth=require(_0x0fa2('0x7'));var interaction=require(_0x0fa2('0x8'));var config=require(_0x0fa2('0x9'));var controller=require(_0x0fa2('0xa'));router['get']('/',auth[_0x0fa2('0xb')](),controller[_0x0fa2('0xc')]);router['get'](_0x0fa2('0xd'),auth[_0x0fa2('0xb')](),controller[_0x0fa2('0xe')]);router[_0x0fa2('0xf')](_0x0fa2('0x10'),auth[_0x0fa2('0xb')](),controller[_0x0fa2('0x11')]);router[_0x0fa2('0xf')](_0x0fa2('0x12'),auth[_0x0fa2('0xb')](),controller['download']);router[_0x0fa2('0x13')]('/',auth[_0x0fa2('0xb')](),interaction[_0x0fa2('0x14')](_0x0fa2('0x15'),_0x0fa2('0x16')),controller[_0x0fa2('0x17')]);router[_0x0fa2('0x18')](_0x0fa2('0x10'),auth['isAuthenticated'](),controller[_0x0fa2('0x19')]);router['put'](_0x0fa2('0x1a'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x0fa2('0x1b'),auth[_0x0fa2('0xb')](),controller[_0x0fa2('0x1c')]);router[_0x0fa2('0x1d')](_0x0fa2('0x10'),auth[_0x0fa2('0xb')](),controller[_0x0fa2('0x1e')]);module[_0x0fa2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 678c4d7..01df7f8 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 _0x6dfd=['Email','exports','long','TEXT','BOOLEAN','ENUM','STRING','INTEGER','Chat'];(function(_0x8c0385,_0x465f02){var _0x1301ba=function(_0x435cd3){while(--_0x435cd3){_0x8c0385['push'](_0x8c0385['shift']());}};_0x1301ba(++_0x465f02);}(_0x6dfd,0x88));var _0xd6df=function(_0x436b41,_0x26e3d3){_0x436b41=_0x436b41-0x0;var _0xfaa7d0=_0x6dfd[_0x436b41];return _0xfaa7d0;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xd6df('0x0')]={'body':{'type':Sequelize['TEXT'](_0xd6df('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd6df('0x2')]('medium')},'read':{'type':Sequelize[_0xd6df('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6df('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd6df('0x5')](0x1fe)},'from':{'type':Sequelize[_0xd6df('0x5')]},'to':{'type':Sequelize[_0xd6df('0x2')](_0xd6df('0x1'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0xd6df('0x2')](_0xd6df('0x1'))},'subject':{'type':Sequelize[_0xd6df('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xd6df('0x6')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd6df('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xd6df('0x2')]('long')},'originCc':{'type':Sequelize[_0xd6df('0x2')]('long')},'originChannel':{'type':Sequelize[_0xd6df('0x4')]('Email',_0xd6df('0x7')),'defaultValue':_0xd6df('0x8'),'allowNull':![]}}; \ No newline at end of file +var _0x32b1=['sequelize','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x32b1,0x84));var _0x132b=function(_0x38323b,_0x5f79df){_0x38323b=_0x38323b-0x0;var _0x2b9af5=_0x32b1[_0x38323b];return _0x2b9af5;};'use strict';var Sequelize=require(_0x132b('0x0'));var _=require(_0x132b('0x1'));module['exports']={'body':{'type':Sequelize[_0x132b('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x132b('0x2')](_0x132b('0x3'))},'read':{'type':Sequelize[_0x132b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x132b('0x5')]('in','out'),'defaultValue':_0x132b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x132b('0x7')](0x1fe)},'from':{'type':Sequelize[_0x132b('0x7')]},'to':{'type':Sequelize[_0x132b('0x2')](_0x132b('0x8'))},'cc':{'type':Sequelize[_0x132b('0x2')](_0x132b('0x8'))},'bcc':{'type':Sequelize[_0x132b('0x2')](_0x132b('0x8'))},'subject':{'type':Sequelize[_0x132b('0x2')]},'sentAt':{'type':Sequelize[_0x132b('0x9')]},'attach':{'type':Sequelize[_0x132b('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x132b('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x132b('0x9')]},'originTo':{'type':Sequelize[_0x132b('0x2')](_0x132b('0x8'))},'originCc':{'type':Sequelize[_0x132b('0x2')]('long')},'originChannel':{'type':Sequelize[_0x132b('0x5')](_0x132b('0xb'),'Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 08cd4e7..4e9a394 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 _0x767a=['user','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','fullname','interface','SIP/%s','channel','EventManager','acceptmessage','mail','RejectMessage','rejectMessage','QueryTypes','email','motionChannel','event','reject','fromString','rejectmessage','unix','toString','server','files','tmp','from','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','download','unlinkSync','eml-format','bluebird','util','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','Content-Range','destroy','stack','name','send','index','map','fieldName','type','keys','query','attributes','intersection','model','fields','length','nolimit','order','sort','where','filters','pick','merge','filter','options','MailMessage','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','update','body','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','attachments','join','root','basename','List','ListId','List\x20not\x20found','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','read','format','UserId'];(function(_0x154e0d,_0x2d81a7){var _0x206294=function(_0xb5a963){while(--_0xb5a963){_0x154e0d['push'](_0x154e0d['shift']());}};_0x206294(++_0x2d81a7);}(_0x767a,0xce));var _0xa767=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x767a[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0xa767('0x0'));var moment=require('moment');var BPromise=require(_0xa767('0x1'));var util=require(_0xa767('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xa767('0x3'));var htmlToText=require(_0xa767('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xa767('0x5'))(_0xa767('0x6'));var interaction_log=require(_0xa767('0x5'))(_0xa767('0x7'));var config=require(_0xa767('0x8'));var db=require(_0xa767('0x9'))['db'];config[_0xa767('0xa')]=_['defaults'](config[_0xa767('0xa')],{'host':_0xa767('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa767('0xa')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0xa767('0xc')](socket);var jayson=require(_0xa767('0xd'));var client=jayson[_0xa767('0xe')]['http']({'port':0x232c});var client9003=jayson['client'][_0xa767('0xf')]({'port':0x232b});var client9002=jayson['client'][_0xa767('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x5c7e0a,_0x270a85,_0x3c7809,_0x486810){return new BPromise(function(_0x57c6cc,_0x32a595){var _0x1401f2=_0x486810||client;return _0x1401f2[_0xa767('0x10')](_0x5c7e0a,_0x3c7809)[_0xa767('0x11')](function(_0x55d784){logger[_0xa767('0x12')](_0xa767('0x13'),_0x270a85,_0xa767('0x14'));logger[_0xa767('0x15')](_0xa767('0x16'),_0x270a85,_0xa767('0x14'),JSON[_0xa767('0x17')](_0x55d784));if(_0x55d784[_0xa767('0x18')]){if(_0x55d784[_0xa767('0x18')][_0xa767('0x19')]===0x1f4){logger[_0xa767('0x18')](_0xa767('0x13'),_0x270a85,_0x55d784[_0xa767('0x18')][_0xa767('0x1a')]);return _0x32a595(_0x55d784[_0xa767('0x18')]['message']);}logger[_0xa767('0x18')]('MailMessage,\x20%s,\x20%s',_0x270a85,_0x55d784[_0xa767('0x18')]['message']);return _0x57c6cc(_0x55d784[_0xa767('0x18')][_0xa767('0x1a')]);}else{logger[_0xa767('0x12')]('MailMessage,\x20%s,\x20%s',_0x270a85,_0xa767('0x14'));_0x57c6cc(_0x55d784['result'][_0xa767('0x1a')]);}})[_0xa767('0x1b')](function(_0x1374ec){logger[_0xa767('0x18')]('MailMessage,\x20%s,\x20%s',_0x270a85,_0x1374ec);_0x32a595(_0x1374ec);});});}function respondWithResult(_0x33a0cf,_0x51d7f1){_0x51d7f1=_0x51d7f1||0xc8;return function(_0x7ffbaa){if(_0x7ffbaa){return _0x33a0cf[_0xa767('0x1c')](_0x51d7f1)[_0xa767('0x1d')](_0x7ffbaa);}};}function respondWithFilteredResult(_0x2a7cfa,_0x5225b7){return function(_0x2e1655){if(_0x2e1655){var _0x17fda8=typeof _0x5225b7[_0xa767('0x1e')]===_0xa767('0x1f')&&typeof _0x5225b7[_0xa767('0x20')]===_0xa767('0x1f');var _0x3bb576=_0x2e1655['count'];var _0x3fe796=_0x17fda8?0x0:_0x5225b7[_0xa767('0x1e')];var _0x514f11=_0x17fda8?_0x2e1655['count']:_0x5225b7[_0xa767('0x1e')]+_0x5225b7[_0xa767('0x20')];var _0x55de0b;if(_0x514f11>=_0x3bb576){_0x514f11=_0x3bb576;_0x55de0b=0xc8;}else{_0x55de0b=0xce;}_0x2a7cfa[_0xa767('0x1c')](_0x55de0b);return _0x2a7cfa['set'](_0xa767('0x21'),_0x3fe796+'-'+_0x514f11+'/'+_0x3bb576)[_0xa767('0x1d')](_0x2e1655);}return null;};}function saveUpdates(_0x402bdd){return function(_0x2d6c3d){if(_0x2d6c3d){return _0x2d6c3d['update'](_0x402bdd)[_0xa767('0x11')](function(_0x178795){return _0x178795;});}return null;};}function removeEntity(_0x58be9e){return function(_0x3cf9c1){if(_0x3cf9c1){return _0x3cf9c1[_0xa767('0x22')]()[_0xa767('0x11')](function(){_0x58be9e[_0xa767('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f397){return function(_0x31051f){if(!_0x31051f){_0x19f397['sendStatus'](0x194);}return _0x31051f;};}function handleError(_0x326f4d,_0x425f82){_0x425f82=_0x425f82||0x1f4;return function(_0x5392a9){logger['error'](_0x5392a9[_0xa767('0x23')]);if(_0x5392a9['name']){delete _0x5392a9[_0xa767('0x24')];}_0x326f4d['status'](_0x425f82)[_0xa767('0x25')](_0x5392a9);};}exports[_0xa767('0x26')]=function(_0x5097fb,_0x1fd71b){var _0x62f7ea={},_0xde040e={},_0x2c67c7={'count':0x0,'rows':[]};var _0x1c3b68=_[_0xa767('0x27')](db['MailMessage']['rawAttributes'],function(_0x4a2beb){return{'name':_0x4a2beb[_0xa767('0x28')],'type':_0x4a2beb[_0xa767('0x29')]['key']};});_0xde040e['model']=_[_0xa767('0x27')](_0x1c3b68,_0xa767('0x24'));_0xde040e['query']=_[_0xa767('0x2a')](_0x5097fb['query']);_0xde040e['filters']=_['intersection'](_0xde040e['model'],_0xde040e[_0xa767('0x2b')]);_0x62f7ea[_0xa767('0x2c')]=_[_0xa767('0x2d')](_0xde040e[_0xa767('0x2e')],qs[_0xa767('0x2f')](_0x5097fb[_0xa767('0x2b')][_0xa767('0x2f')]));_0x62f7ea[_0xa767('0x2c')]=_0x62f7ea[_0xa767('0x2c')][_0xa767('0x30')]?_0x62f7ea[_0xa767('0x2c')]:_0xde040e[_0xa767('0x2e')];if(!_0x5097fb['query']['hasOwnProperty'](_0xa767('0x31'))){_0x62f7ea[_0xa767('0x20')]=qs[_0xa767('0x20')](_0x5097fb[_0xa767('0x2b')][_0xa767('0x20')]);_0x62f7ea['offset']=qs['offset'](_0x5097fb['query'][_0xa767('0x1e')]);}_0x62f7ea[_0xa767('0x32')]=qs[_0xa767('0x33')](_0x5097fb[_0xa767('0x2b')][_0xa767('0x33')]);_0x62f7ea[_0xa767('0x34')]=qs[_0xa767('0x35')](_[_0xa767('0x36')](_0x5097fb[_0xa767('0x2b')],_0xde040e['filters']),_0x1c3b68);if(_0x5097fb[_0xa767('0x2b')]['filter']){_0x62f7ea[_0xa767('0x34')]=_[_0xa767('0x37')](_0x62f7ea[_0xa767('0x34')],{'$or':_[_0xa767('0x27')](_0x1c3b68,function(_0x2b5339){if(_0x2b5339['type']!=='VIRTUAL'){var _0x434fc6={};_0x434fc6[_0x2b5339[_0xa767('0x24')]]={'$like':'%'+_0x5097fb[_0xa767('0x2b')][_0xa767('0x38')]+'%'};return _0x434fc6;}})});}_0x62f7ea=_['merge']({},_0x62f7ea,_0x5097fb[_0xa767('0x39')]);var _0x24f018={'where':_0x62f7ea['where']};return db[_0xa767('0x3a')][_0xa767('0x3b')](_0x24f018)[_0xa767('0x11')](function(_0x2946c3){_0x2c67c7['count']=_0x2946c3;if(_0x5097fb[_0xa767('0x2b')][_0xa767('0x3c')]){_0x62f7ea[_0xa767('0x3d')]=[{'all':!![]}];}return db['MailMessage'][_0xa767('0x3e')](_0x62f7ea);})['then'](function(_0x395bf4){_0x2c67c7[_0xa767('0x3f')]=_0x395bf4;return _0x2c67c7;})['then'](respondWithFilteredResult(_0x1fd71b,_0x62f7ea))[_0xa767('0x1b')](handleError(_0x1fd71b,null));};exports[_0xa767('0x40')]=function(_0x49f0f5,_0x35faca){var _0x4fe05e={'raw':!![],'where':{'id':_0x49f0f5[_0xa767('0x41')]['id']}},_0x19a09d={};_0x19a09d['model']=_[_0xa767('0x2a')](db[_0xa767('0x3a')][_0xa767('0x42')]);_0x19a09d[_0xa767('0x2b')]=_[_0xa767('0x2a')](_0x49f0f5['query']);_0x19a09d[_0xa767('0x35')]=_[_0xa767('0x2d')](_0x19a09d[_0xa767('0x2e')],_0x19a09d[_0xa767('0x2b')]);_0x4fe05e[_0xa767('0x2c')]=_[_0xa767('0x2d')](_0x19a09d[_0xa767('0x2e')],qs[_0xa767('0x2f')](_0x49f0f5[_0xa767('0x2b')][_0xa767('0x2f')]));_0x4fe05e[_0xa767('0x2c')]=_0x4fe05e[_0xa767('0x2c')][_0xa767('0x30')]?_0x4fe05e[_0xa767('0x2c')]:_0x19a09d[_0xa767('0x2e')];if(_0x49f0f5['query']['includeAll']){_0x4fe05e[_0xa767('0x3d')]=[{'all':!![]}];}_0x4fe05e=_[_0xa767('0x37')]({},_0x4fe05e,_0x49f0f5['options']);return db[_0xa767('0x3a')][_0xa767('0x43')](_0x4fe05e)[_0xa767('0x11')](handleEntityNotFound(_0x35faca,null))[_0xa767('0x11')](respondWithResult(_0x35faca,null))['catch'](handleError(_0x35faca,null));};exports[_0xa767('0x44')]=function(_0x13135f,_0x2684b6){if(_0x13135f['body']['id']){delete _0x13135f[_0xa767('0x45')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x13135f[_0xa767('0x41')]['id']}})[_0xa767('0x11')](handleEntityNotFound(_0x2684b6,null))[_0xa767('0x11')](saveUpdates(_0x13135f[_0xa767('0x45')],null))[_0xa767('0x11')](respondWithResult(_0x2684b6,null))[_0xa767('0x1b')](handleError(_0x2684b6,null));};exports[_0xa767('0x22')]=function(_0x349f7b,_0x252e9f){return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x349f7b[_0xa767('0x41')]['id']}})[_0xa767('0x11')](handleEntityNotFound(_0x252e9f,null))[_0xa767('0x11')](removeEntity(_0x252e9f,null))[_0xa767('0x1b')](handleError(_0x252e9f,null));};exports[_0xa767('0x46')]=function(_0x4f4a60,_0x379bdf){return db[_0xa767('0x3a')][_0xa767('0x46')]()['then'](respondWithResult(_0x379bdf,null))[_0xa767('0x1b')](handleError(_0x379bdf,null));};exports[_0xa767('0x47')]=function(_0x527725,_0x16aa3c){return db[_0xa767('0x3a')][_0xa767('0x47')](_0x527725[_0xa767('0x45')])[_0xa767('0x11')](function(_0x1f6c62){if(_0x1f6c62){if(_0x1f6c62[_0xa767('0x48')]===_0xa767('0x49')&&!_0x1f6c62[_0xa767('0x4a')]){var _0x3cf75a,_0x40de57,_0x48d32a;if(_0x527725[_0xa767('0x45')]['to']){_0x40de57=_0x527725[_0xa767('0x45')]['to'][_0xa767('0x4b')](',')[0x0];}return db['MailAccount'][_0xa767('0x4c')]({'where':{'id':_0x1f6c62[_0xa767('0x4d')]},'include':[{'model':db[_0xa767('0x4e')],'as':'List','include':[{'model':db[_0xa767('0x4f')],'as':_0xa767('0x50'),'where':{'email':_0x40de57},'limit':0x1,'order':[[_0xa767('0x51'),_0xa767('0x52')]]}]},{'model':db[_0xa767('0x53')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa767('0x54')],'as':'CloudProvider','raw':!![]}]}]})[_0xa767('0x11')](function(_0x1de1b1){_0x3cf75a=_0x1de1b1;if(!_0x3cf75a||!_0x3cf75a['Smtp'])return;var _0x5b37e7=_0x3cf75a['getSmtpOptions']();if(_0x527725[_0xa767('0x45')][_0xa767('0x55')]&&_0x527725['body']['attachments'][_0xa767('0x30')]){for(var _0x4a7f89=0x0;_0x4a7f89<_0x527725[_0xa767('0x45')]['attachments'][_0xa767('0x30')];_0x4a7f89+=0x1){_0x527725[_0xa767('0x45')][_0xa767('0x55')][_0x4a7f89]={'filename':_0x527725[_0xa767('0x45')][_0xa767('0x55')][_0x4a7f89][_0xa767('0x24')],'path':path[_0xa767('0x56')](config[_0xa767('0x57')],'server/files/attachments',_0x527725['body'][_0xa767('0x55')][_0x4a7f89][_0xa767('0x58')])};}}_0x48d32a={'account':_0x5b37e7,'message':_0x527725[_0xa767('0x45')]};return;})['then'](function(){if(_0x3cf75a[_0xa767('0x59')]){if(_0x3cf75a[_0xa767('0x59')][_0xa767('0x50')][_0xa767('0x30')]){return _0x3cf75a[_0xa767('0x59')][_0xa767('0x50')][0x0];}else{return db['CmContact'][_0xa767('0x47')](_['defaults'](_0x527725[_0xa767('0x45')],{'firstName':_0x527725[_0xa767('0x45')]['to'],'email':_0x527725[_0xa767('0x45')]['to'],'phone':_0x527725[_0xa767('0x45')]['to'],'ListId':_0x3cf75a[_0xa767('0x5a')]}));}}else{throw new Error(_0xa767('0x5b'));}})[_0xa767('0x11')](function(){if(_0x48d32a){return respondWithRpcPromise('SendMail','sendMail',_0x48d32a,client9003)[_0xa767('0x11')](function(_0x424a82){return _0x1f6c62[_0xa767('0x44')]({'read':!![],'messageId':_0x424a82[_0xa767('0x5c')],'sentAt':moment()['format'](_0xa767('0x5d'))});})[_0xa767('0x1b')](function(_0x54176a){logger[_0xa767('0x18')]('%s',JSON[_0xa767('0x17')](_0x54176a));return _0x1f6c62;});}return _0x1f6c62;});}return _0x1f6c62;}})[_0xa767('0x11')](respondWithResult(_0x16aa3c,0xc9))[_0xa767('0x1b')](handleError(_0x16aa3c,null));};exports[_0xa767('0x5e')]=function(_0x47c756,_0x6abb3f){var _0x1d6518={'agent':{},'channel':'mail'};if(_0x47c756[_0xa767('0x45')]['id']){delete _0x47c756[_0xa767('0x45')]['id'];}_0x47c756[_0xa767('0x45')][_0xa767('0x5f')]=!![];_0x47c756[_0xa767('0x45')]['readAt']=moment()[_0xa767('0x60')](_0xa767('0x5d'));_0x47c756['body'][_0xa767('0x61')]=_0x47c756['body'][_0xa767('0x61')]||_0x47c756[_0xa767('0x62')]['id'];_0x1d6518['agent']['id']=_0x47c756['body'][_0xa767('0x61')];return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x47c756['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6abb3f,null))[_0xa767('0x11')](saveUpdates(_0x47c756[_0xa767('0x45')],null))[_0xa767('0x11')](function(_0x255637){if(_0x255637){_0x1d6518[_0xa767('0x1a')]=_0x255637[_0xa767('0x63')]({'plain':!![]});return db[_0xa767('0x64')]['find']({'where':{'id':_0x255637[_0xa767('0x65')]}});}return null;})[_0xa767('0x11')](handleEntityNotFound(_0x6abb3f,null))[_0xa767('0x11')](function(_0x41e221){if(_0x41e221){return _0x41e221[_0xa767('0x44')]({'UserId':_0x47c756[_0xa767('0x45')][_0xa767('0x61')],'read1stAt':_[_0xa767('0x66')](_0x41e221[_0xa767('0x67')])?moment()['format'](_0xa767('0x5d')):undefined});}return null;})[_0xa767('0x11')](function(_0x58c437){if(_0x58c437){_0x1d6518[_0xa767('0x68')]=_0x58c437[_0xa767('0x63')]({'plain':!![]});interaction_log['info'](_0xa767('0x69'),_0x47c756['user']['id'],_0x47c756[_0xa767('0x62')][_0xa767('0x24')],_0x47c756['user'][_0xa767('0x6a')],_0x1d6518[_0xa767('0x68')]['id'],_0x47c756['body']?JSON['stringify'](_0x47c756[_0xa767('0x45')]):_0xa767('0x6b'));return respondWithRpcPromise(_0xa767('0x6c'),'acceptMessage',_0x1d6518);}return null;})['then'](function(_0x56906c){var _0x290412=_0xa767('0x6d')+_0x56906c[_0xa767('0x1a')][_0xa767('0x6e')];return db['sequelize'][_0xa767('0x2b')](_0x290412,{'type':db[_0xa767('0x6f')]['QueryTypes'][_0xa767('0x70')],'raw':!![]})['then'](function(_0x131e03){return _0x131e03;});})[_0xa767('0x11')](function(_0x42a084){if(_0x42a084){_0x1d6518['message'][_0xa767('0x71')]=_0x42a084[0x0];if(!_0x47c756['body'][_0xa767('0x61')])return;return db[_0xa767('0x72')][_0xa767('0x43')]({'where':{'id':_0x47c756[_0xa767('0x45')][_0xa767('0x61')],'role':_0xa767('0x73')},'attributes':['id',_0xa767('0x24'),_0xa767('0x74'),'email','internal'],'raw':!![]});}return null;})[_0xa767('0x11')](function(_0x355242){if(!_0x355242)return null;_0x1d6518['message'][_0xa767('0x73')]=_0x355242;return _0x1d6518;})[_0xa767('0x11')](function(_0x1af81e){if(_0x1af81e){if(_0x47c756['body']['manual']){_0x1d6518[_0xa767('0x1a')][_0xa767('0x75')]=util[_0xa767('0x60')](_0xa767('0x76'),_0x47c756[_0xa767('0x62')]['name']);_0x1d6518['message'][_0xa767('0x77')]=_0x1d6518['channel'];_0x1d6518[_0xa767('0x1a')]['motionChannel']=_0x1d6518[_0xa767('0x77')];_0x1d6518[_0xa767('0x1a')]['event']=_0xa767('0x5e');_0x1d6518[_0xa767('0x1a')][_0xa767('0x45')]=htmlToText['fromString'](_0x1d6518[_0xa767('0x1a')]['body']);return respondWithRpcPromise(_0xa767('0x78'),_0xa767('0x78'),{'event':_0xa767('0x79'),'message':_0x1d6518[_0xa767('0x1a')]},client9002)[_0xa767('0x11')](function(){return _0x1d6518;});}return _0x1d6518;}return null;})[_0xa767('0x11')](respondWithResult(_0x6abb3f,null))['catch'](handleError(_0x6abb3f,null));};exports['reject']=function(_0x1eadd4,_0xbf6144){var _0x46890f={'agent':{},'channel':_0xa767('0x7a')};if(_0x1eadd4[_0xa767('0x45')]['id']){delete _0x1eadd4[_0xa767('0x45')]['id'];}_0x1eadd4[_0xa767('0x45')][_0xa767('0x61')]=_0x1eadd4[_0xa767('0x45')]['UserId']||_0x1eadd4['user']['id'];_0x46890f[_0xa767('0x73')]['id']=_0x1eadd4[_0xa767('0x45')][_0xa767('0x61')];return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x1eadd4[_0xa767('0x41')]['id'],'UserId':null}})[_0xa767('0x11')](handleEntityNotFound(_0xbf6144,null))['then'](function(_0x32ed11){if(_0x32ed11){_0x46890f[_0xa767('0x1a')]=_0x32ed11[_0xa767('0x63')]({'plain':!![]});return db[_0xa767('0x64')][_0xa767('0x43')]({'where':{'id':_0x32ed11[_0xa767('0x65')]}});}return null;})[_0xa767('0x11')](handleEntityNotFound(_0xbf6144,null))['then'](function(_0x324a4f){if(_0x324a4f){_0x46890f[_0xa767('0x68')]=_0x324a4f[_0xa767('0x63')]({'plain':!![]});interaction_log[_0xa767('0x12')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1eadd4[_0xa767('0x62')]['id'],_0x1eadd4['user'][_0xa767('0x24')],_0x1eadd4[_0xa767('0x62')][_0xa767('0x6a')],_0x46890f[_0xa767('0x68')]['id'],_0x1eadd4[_0xa767('0x45')]?JSON[_0xa767('0x17')](_0x1eadd4['body']):'null');return respondWithRpcPromise(_0xa767('0x7b'),_0xa767('0x7c'),_0x46890f);}return null;})[_0xa767('0x11')](function(_0x514962){var _0x174300=_0xa767('0x6d')+_0x514962[_0xa767('0x1a')][_0xa767('0x6e')];return db['sequelize'][_0xa767('0x2b')](_0x174300,{'type':db['Sequelize'][_0xa767('0x7d')]['SELECT'],'raw':!![]})[_0xa767('0x11')](function(_0x58cb22){return _0x58cb22;});})[_0xa767('0x11')](function(_0x54a059){if(_0x54a059){_0x46890f[_0xa767('0x1a')][_0xa767('0x71')]=_0x54a059[0x0];if(!_0x1eadd4[_0xa767('0x45')][_0xa767('0x61')])return;return db[_0xa767('0x72')][_0xa767('0x43')]({'where':{'id':_0x1eadd4[_0xa767('0x45')]['UserId'],'role':_0xa767('0x73')},'attributes':['id',_0xa767('0x24'),_0xa767('0x74'),_0xa767('0x7e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x33c291){if(!_0x33c291)return null;_0x46890f[_0xa767('0x1a')]['agent']=_0x33c291;return _0x46890f;})['then'](function(_0x5e4b12){if(_0x5e4b12){_0x5e4b12[_0xa767('0x1a')]['interface']=util[_0xa767('0x60')](_0xa767('0x76'),_0x1eadd4[_0xa767('0x62')][_0xa767('0x24')]);_0x5e4b12[_0xa767('0x1a')]['channel']=_0x46890f[_0xa767('0x77')];_0x5e4b12[_0xa767('0x1a')][_0xa767('0x7f')]=_0x46890f['channel'];_0x5e4b12[_0xa767('0x1a')][_0xa767('0x80')]=_0xa767('0x81');_0x5e4b12[_0xa767('0x1a')][_0xa767('0x45')]=htmlToText[_0xa767('0x82')](_0x46890f[_0xa767('0x1a')][_0xa767('0x45')]);respondWithRpcPromise(_0xa767('0x78'),'EventManager',{'event':_0xa767('0x83'),'message':_0x5e4b12[_0xa767('0x1a')]},client9002);return _0x46890f;}return null;})[_0xa767('0x11')](respondWithResult(_0xbf6144,null))[_0xa767('0x1b')](handleError(_0xbf6144,null));};exports['download']=function(_0x2ae599,_0x54dba0){var _0x4da14c=moment()[_0xa767('0x84')]()[_0xa767('0x85')]();var _0x40d076=path[_0xa767('0x56')](config['root'],_0xa767('0x86'),_0xa767('0x87'),_0xa767('0x88'));var _0x1ae42d=path[_0xa767('0x56')](config[_0xa767('0x57')],_0xa767('0x86'),_0xa767('0x87'),_0xa767('0x55'));var _0x3105d3=util[_0xa767('0x60')]('message-%s.eml',_0x4da14c);return db[_0xa767('0x3a')][_0xa767('0x43')]({'where':{'id':_0x2ae599[_0xa767('0x41')]['id']},'attributes':['id',_0xa767('0x45'),_0xa767('0x89'),'to','cc',_0xa767('0x8a'),_0xa767('0x8b'),'createdAt'],'include':_0x2ae599[_0xa767('0x2b')][_0xa767('0x55')]?[{'model':db[_0xa767('0x8c')],'as':_0xa767('0x8d')}]:undefined})['then'](handleEntityNotFound(_0x54dba0,null))[_0xa767('0x11')](function(_0x19d9b5){if(_0x19d9b5){var _0x3cca0e=_0x19d9b5;var _0x241439={'from':_0x3cca0e[_0xa767('0x89')],'to':_0x3cca0e['to'],'subject':_0x3cca0e['subject'],'html':htmlEntities[_0xa767('0x8e')](_0x3cca0e[_0xa767('0x45')]),'headers':{'Date':moment(_0x3cca0e['createdAt'])['format'](_0xa767('0x8f'))},'attachments':[]};if(_0x19d9b5['cc']){_0x241439['headers']['Cc']=_0x19d9b5['cc'];}if(_0x19d9b5[_0xa767('0x8a')]){_0x241439[_0xa767('0x90')][_0xa767('0x91')]=_0x19d9b5[_0xa767('0x8a')];}return new BPromise(function(_0x140ced,_0x5e282f){if(_0x19d9b5[_0xa767('0x8d')]){for(var _0x33394c=0x0;_0x33394c<_0x19d9b5['Attachments'][_0xa767('0x30')];_0x33394c++){var _0x148a8a=_0x19d9b5[_0xa767('0x8d')][_0x33394c];var _0x10b6f4=path['join'](_0x1ae42d,_0x148a8a[_0xa767('0x58')]);if(fs[_0xa767('0x92')](_0x10b6f4)){_0x241439[_0xa767('0x55')][_0xa767('0x93')]({'name':_0x148a8a[_0xa767('0x24')],'contentType':_0x148a8a['type'],'data':fs[_0xa767('0x94')](_0x10b6f4)});}}}emlformat[_0xa767('0x95')](_0x241439,function(_0x40b0eb,_0x55ef98){if(_0x40b0eb)return _0x5e282f(_0x40b0eb);fs['writeFileSync'](path[_0xa767('0x56')](_0x40d076,_0x3105d3),_0x55ef98);return _0x140ced(_0x55ef98);});});}})[_0xa767('0x11')](function(_0x4e647b){if(_0x4e647b){return _0x54dba0[_0xa767('0x96')](path[_0xa767('0x56')](_0x40d076,_0x3105d3),_0x3105d3,function(_0x4898ae){if(!_0x4898ae)fs[_0xa767('0x97')](path[_0xa767('0x56')](_0x40d076,_0x3105d3));});}})[_0xa767('0x1b')](handleError(_0x54dba0,null));}; \ No newline at end of file +var _0x9a63=['sendStatus','stack','name','index','MailMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','body','destroy','find','describe','create','out','secret','split','MailAccount','findOne','CmList','List','Contacts','updatedAt','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','CmContact','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','get','MailInteraction','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','manual','interface','SIP/%s','channel','event','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','internal','motionChannel','EventManager','rejectmessage','download','unix','toString','server','files','tmp','from','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','update','end'];(function(_0x35901a,_0x3d7b3b){var _0x1cfd4e=function(_0x592e4d){while(--_0x592e4d){_0x35901a['push'](_0x35901a['shift']());}};_0x1cfd4e(++_0x3d7b3b);}(_0x9a63,0x11c));var _0x39a6=function(_0x29e030,_0x1c60cd){_0x29e030=_0x29e030-0x0;var _0x375763=_0x9a63[_0x29e030];return _0x375763;};'use strict';var emlformat=require(_0x39a6('0x0'));var moment=require(_0x39a6('0x1'));var BPromise=require(_0x39a6('0x2'));var util=require(_0x39a6('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x39a6('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x39a6('0x5'));var qs=require(_0x39a6('0x6'));var logger=require(_0x39a6('0x7'))('api');var interaction_log=require(_0x39a6('0x7'))(_0x39a6('0x8'));var config=require(_0x39a6('0x9'));var db=require(_0x39a6('0xa'))['db'];config['redis']=_[_0x39a6('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x39a6('0xc'))(new Redis(config[_0x39a6('0xd')]));var htmlEntities=require(_0x39a6('0xe'));require(_0x39a6('0xf'))[_0x39a6('0x10')](socket);var jayson=require(_0x39a6('0x11'));var client=jayson[_0x39a6('0x12')]['http']({'port':0x232c});var client9003=jayson[_0x39a6('0x12')][_0x39a6('0x13')]({'port':0x232b});var client9002=jayson[_0x39a6('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16e569,_0x49cc7f,_0x509a46,_0x47c47e){return new BPromise(function(_0x23dccd,_0xf20faf){var _0x334daf=_0x47c47e||client;return _0x334daf[_0x39a6('0x14')](_0x16e569,_0x509a46)[_0x39a6('0x15')](function(_0x2d8195){logger[_0x39a6('0x16')](_0x39a6('0x17'),_0x49cc7f,_0x39a6('0x18'));logger[_0x39a6('0x19')](_0x39a6('0x1a'),_0x49cc7f,_0x39a6('0x18'),JSON[_0x39a6('0x1b')](_0x2d8195));if(_0x2d8195[_0x39a6('0x1c')]){if(_0x2d8195['error'][_0x39a6('0x1d')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x49cc7f,_0x2d8195[_0x39a6('0x1c')][_0x39a6('0x1e')]);return _0xf20faf(_0x2d8195['error'][_0x39a6('0x1e')]);}logger[_0x39a6('0x1c')](_0x39a6('0x17'),_0x49cc7f,_0x2d8195[_0x39a6('0x1c')][_0x39a6('0x1e')]);return _0x23dccd(_0x2d8195[_0x39a6('0x1c')]['message']);}else{logger[_0x39a6('0x16')](_0x39a6('0x17'),_0x49cc7f,'request\x20sent');_0x23dccd(_0x2d8195[_0x39a6('0x1f')][_0x39a6('0x1e')]);}})[_0x39a6('0x20')](function(_0x945ed9){logger[_0x39a6('0x1c')](_0x39a6('0x17'),_0x49cc7f,_0x945ed9);_0xf20faf(_0x945ed9);});});}function respondWithResult(_0x18a5b5,_0x4931c5){_0x4931c5=_0x4931c5||0xc8;return function(_0x5d7e12){if(_0x5d7e12){return _0x18a5b5[_0x39a6('0x21')](_0x4931c5)[_0x39a6('0x22')](_0x5d7e12);}};}function respondWithFilteredResult(_0xabd9ee,_0x704aba){return function(_0x354b71){if(_0x354b71){var _0x48e7ea=typeof _0x704aba[_0x39a6('0x23')]===_0x39a6('0x24')&&typeof _0x704aba[_0x39a6('0x25')]===_0x39a6('0x24');var _0x3a25d5=_0x354b71[_0x39a6('0x26')];var _0x12ec09=_0x48e7ea?0x0:_0x704aba[_0x39a6('0x23')];var _0x5e3c02=_0x48e7ea?_0x354b71[_0x39a6('0x26')]:_0x704aba['offset']+_0x704aba['limit'];var _0x5784f2;if(_0x5e3c02>=_0x3a25d5){_0x5e3c02=_0x3a25d5;_0x5784f2=0xc8;}else{_0x5784f2=0xce;}_0xabd9ee[_0x39a6('0x21')](_0x5784f2);return _0xabd9ee[_0x39a6('0x27')]('Content-Range',_0x12ec09+'-'+_0x5e3c02+'/'+_0x3a25d5)[_0x39a6('0x22')](_0x354b71);}return null;};}function saveUpdates(_0x2d1f80){return function(_0x50fa6e){if(_0x50fa6e){return _0x50fa6e[_0x39a6('0x28')](_0x2d1f80)[_0x39a6('0x15')](function(_0x599580){return _0x599580;});}return null;};}function removeEntity(_0x4439a7){return function(_0x1f0940){if(_0x1f0940){return _0x1f0940['destroy']()['then'](function(){_0x4439a7[_0x39a6('0x21')](0xcc)[_0x39a6('0x29')]();});}};}function handleEntityNotFound(_0x4b96a7){return function(_0x2ede5a){if(!_0x2ede5a){_0x4b96a7[_0x39a6('0x2a')](0x194);}return _0x2ede5a;};}function handleError(_0x25ecaa,_0x5a4397){_0x5a4397=_0x5a4397||0x1f4;return function(_0x395a47){logger[_0x39a6('0x1c')](_0x395a47[_0x39a6('0x2b')]);if(_0x395a47[_0x39a6('0x2c')]){delete _0x395a47[_0x39a6('0x2c')];}_0x25ecaa[_0x39a6('0x21')](_0x5a4397)['send'](_0x395a47);};}exports[_0x39a6('0x2d')]=function(_0x537f94,_0x46fcaa){var _0x33e48c={},_0x190993={},_0x191f70={'count':0x0,'rows':[]};var _0x5f4fff=_['map'](db[_0x39a6('0x2e')][_0x39a6('0x2f')],function(_0x2f2652){return{'name':_0x2f2652[_0x39a6('0x30')],'type':_0x2f2652[_0x39a6('0x31')]['key']};});_0x190993[_0x39a6('0x32')]=_['map'](_0x5f4fff,_0x39a6('0x2c'));_0x190993['query']=_[_0x39a6('0x33')](_0x537f94[_0x39a6('0x34')]);_0x190993[_0x39a6('0x35')]=_[_0x39a6('0x36')](_0x190993['model'],_0x190993[_0x39a6('0x34')]);_0x33e48c['attributes']=_[_0x39a6('0x36')](_0x190993['model'],qs[_0x39a6('0x37')](_0x537f94[_0x39a6('0x34')][_0x39a6('0x37')]));_0x33e48c[_0x39a6('0x38')]=_0x33e48c[_0x39a6('0x38')][_0x39a6('0x39')]?_0x33e48c['attributes']:_0x190993[_0x39a6('0x32')];if(!_0x537f94[_0x39a6('0x34')][_0x39a6('0x3a')](_0x39a6('0x3b'))){_0x33e48c[_0x39a6('0x25')]=qs['limit'](_0x537f94['query']['limit']);_0x33e48c[_0x39a6('0x23')]=qs[_0x39a6('0x23')](_0x537f94['query'][_0x39a6('0x23')]);}_0x33e48c[_0x39a6('0x3c')]=qs['sort'](_0x537f94['query'][_0x39a6('0x3d')]);_0x33e48c[_0x39a6('0x3e')]=qs[_0x39a6('0x35')](_[_0x39a6('0x3f')](_0x537f94[_0x39a6('0x34')],_0x190993[_0x39a6('0x35')]),_0x5f4fff);if(_0x537f94['query']['filter']){_0x33e48c[_0x39a6('0x3e')]=_[_0x39a6('0x40')](_0x33e48c[_0x39a6('0x3e')],{'$or':_[_0x39a6('0x41')](_0x5f4fff,function(_0x59dba2){if(_0x59dba2[_0x39a6('0x31')]!==_0x39a6('0x42')){var _0x4d6e8e={};_0x4d6e8e[_0x59dba2['name']]={'$like':'%'+_0x537f94[_0x39a6('0x34')][_0x39a6('0x43')]+'%'};return _0x4d6e8e;}})});}_0x33e48c=_[_0x39a6('0x40')]({},_0x33e48c,_0x537f94['options']);var _0x1d868b={'where':_0x33e48c['where']};return db['MailMessage'][_0x39a6('0x26')](_0x1d868b)[_0x39a6('0x15')](function(_0x2dba5f){_0x191f70[_0x39a6('0x26')]=_0x2dba5f;if(_0x537f94[_0x39a6('0x34')][_0x39a6('0x44')]){_0x33e48c[_0x39a6('0x45')]=[{'all':!![]}];}return db['MailMessage'][_0x39a6('0x46')](_0x33e48c);})[_0x39a6('0x15')](function(_0x3b12d6){_0x191f70[_0x39a6('0x47')]=_0x3b12d6;return _0x191f70;})[_0x39a6('0x15')](respondWithFilteredResult(_0x46fcaa,_0x33e48c))[_0x39a6('0x20')](handleError(_0x46fcaa,null));};exports[_0x39a6('0x48')]=function(_0x269e7a,_0x3bba3a){var _0x312c57={'raw':!![],'where':{'id':_0x269e7a[_0x39a6('0x49')]['id']}},_0x33df5e={};_0x33df5e[_0x39a6('0x32')]=_[_0x39a6('0x33')](db['MailMessage'][_0x39a6('0x2f')]);_0x33df5e['query']=_[_0x39a6('0x33')](_0x269e7a[_0x39a6('0x34')]);_0x33df5e[_0x39a6('0x35')]=_['intersection'](_0x33df5e[_0x39a6('0x32')],_0x33df5e['query']);_0x312c57['attributes']=_[_0x39a6('0x36')](_0x33df5e[_0x39a6('0x32')],qs[_0x39a6('0x37')](_0x269e7a[_0x39a6('0x34')][_0x39a6('0x37')]));_0x312c57['attributes']=_0x312c57['attributes']['length']?_0x312c57[_0x39a6('0x38')]:_0x33df5e[_0x39a6('0x32')];if(_0x269e7a[_0x39a6('0x34')][_0x39a6('0x44')]){_0x312c57[_0x39a6('0x45')]=[{'all':!![]}];}_0x312c57=_['merge']({},_0x312c57,_0x269e7a[_0x39a6('0x4a')]);return db[_0x39a6('0x2e')]['find'](_0x312c57)['then'](handleEntityNotFound(_0x3bba3a,null))[_0x39a6('0x15')](respondWithResult(_0x3bba3a,null))[_0x39a6('0x20')](handleError(_0x3bba3a,null));};exports[_0x39a6('0x28')]=function(_0xf0fec,_0x4d0f52){if(_0xf0fec['body']['id']){delete _0xf0fec[_0x39a6('0x4b')]['id'];}return db[_0x39a6('0x2e')]['find']({'where':{'id':_0xf0fec['params']['id']}})['then'](handleEntityNotFound(_0x4d0f52,null))[_0x39a6('0x15')](saveUpdates(_0xf0fec[_0x39a6('0x4b')],null))[_0x39a6('0x15')](respondWithResult(_0x4d0f52,null))[_0x39a6('0x20')](handleError(_0x4d0f52,null));};exports[_0x39a6('0x4c')]=function(_0x5707f1,_0x2e747c){return db[_0x39a6('0x2e')][_0x39a6('0x4d')]({'where':{'id':_0x5707f1[_0x39a6('0x49')]['id']}})[_0x39a6('0x15')](handleEntityNotFound(_0x2e747c,null))[_0x39a6('0x15')](removeEntity(_0x2e747c,null))[_0x39a6('0x20')](handleError(_0x2e747c,null));};exports['describe']=function(_0x2b5d9c,_0x2dc4de){return db[_0x39a6('0x2e')][_0x39a6('0x4e')]()[_0x39a6('0x15')](respondWithResult(_0x2dc4de,null))[_0x39a6('0x20')](handleError(_0x2dc4de,null));};exports[_0x39a6('0x4f')]=function(_0x54c652,_0x30fd11){return db[_0x39a6('0x2e')]['create'](_0x54c652['body'])[_0x39a6('0x15')](function(_0x25ccbf){if(_0x25ccbf){if(_0x25ccbf['direction']===_0x39a6('0x50')&&!_0x25ccbf[_0x39a6('0x51')]){var _0x506008,_0x11efef,_0x312833;if(_0x54c652[_0x39a6('0x4b')]['to']){_0x11efef=_0x54c652[_0x39a6('0x4b')]['to'][_0x39a6('0x52')](',')[0x0];}return db[_0x39a6('0x53')][_0x39a6('0x54')]({'where':{'id':_0x25ccbf['MailAccountId']},'include':[{'model':db[_0x39a6('0x55')],'as':_0x39a6('0x56'),'include':[{'model':db['CmContact'],'as':_0x39a6('0x57'),'where':{'email':_0x11efef},'limit':0x1,'order':[[_0x39a6('0x58'),'DESC']]}]},{'model':db[_0x39a6('0x59')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x39a6('0x5a')],'as':_0x39a6('0x5a'),'raw':!![]}]}]})[_0x39a6('0x15')](function(_0x280b9a){_0x506008=_0x280b9a;if(!_0x506008||!_0x506008[_0x39a6('0x5b')])return;var _0x50fb1d=_0x506008[_0x39a6('0x5c')]();if(_0x54c652[_0x39a6('0x4b')][_0x39a6('0x5d')]&&_0x54c652[_0x39a6('0x4b')][_0x39a6('0x5d')][_0x39a6('0x39')]){for(var _0x2f1342=0x0;_0x2f1342<_0x54c652[_0x39a6('0x4b')][_0x39a6('0x5d')][_0x39a6('0x39')];_0x2f1342+=0x1){_0x54c652['body'][_0x39a6('0x5d')][_0x2f1342]={'filename':_0x54c652['body'][_0x39a6('0x5d')][_0x2f1342][_0x39a6('0x2c')],'path':path[_0x39a6('0x5e')](config[_0x39a6('0x5f')],'server/files/attachments',_0x54c652[_0x39a6('0x4b')][_0x39a6('0x5d')][_0x2f1342]['basename'])};}}_0x312833={'account':_0x50fb1d,'message':_0x54c652[_0x39a6('0x4b')]};return;})['then'](function(){if(_0x506008['List']){if(_0x506008[_0x39a6('0x56')]['Contacts'][_0x39a6('0x39')]){return _0x506008[_0x39a6('0x56')]['Contacts'][0x0];}else{return db[_0x39a6('0x60')][_0x39a6('0x4f')](_[_0x39a6('0xb')](_0x54c652[_0x39a6('0x4b')],{'firstName':_0x54c652[_0x39a6('0x4b')]['to'],'email':_0x54c652[_0x39a6('0x4b')]['to'],'phone':_0x54c652['body']['to'],'ListId':_0x506008[_0x39a6('0x61')]}));}}else{throw new Error(_0x39a6('0x62'));}})[_0x39a6('0x15')](function(){if(_0x312833){return respondWithRpcPromise('SendMail',_0x39a6('0x63'),_0x312833,client9003)[_0x39a6('0x15')](function(_0x28297f){return _0x25ccbf[_0x39a6('0x28')]({'read':!![],'messageId':_0x28297f[_0x39a6('0x64')],'sentAt':moment()[_0x39a6('0x65')](_0x39a6('0x66'))});})[_0x39a6('0x20')](function(_0x338969){logger['error']('%s',JSON['stringify'](_0x338969));return _0x25ccbf;});}return _0x25ccbf;});}return _0x25ccbf;}})[_0x39a6('0x15')](respondWithResult(_0x30fd11,0xc9))[_0x39a6('0x20')](handleError(_0x30fd11,null));};exports[_0x39a6('0x67')]=function(_0x3490a5,_0x2d70b3){var _0x2e1603={'agent':{},'channel':_0x39a6('0x68')};if(_0x3490a5[_0x39a6('0x4b')]['id']){delete _0x3490a5['body']['id'];}_0x3490a5[_0x39a6('0x4b')]['read']=!![];_0x3490a5[_0x39a6('0x4b')][_0x39a6('0x69')]=moment()['format'](_0x39a6('0x66'));_0x3490a5['body'][_0x39a6('0x6a')]=_0x3490a5[_0x39a6('0x4b')][_0x39a6('0x6a')]||_0x3490a5['user']['id'];_0x2e1603['agent']['id']=_0x3490a5['body'][_0x39a6('0x6a')];return db[_0x39a6('0x2e')][_0x39a6('0x4d')]({'where':{'id':_0x3490a5['params']['id'],'UserId':null}})[_0x39a6('0x15')](handleEntityNotFound(_0x2d70b3,null))['then'](saveUpdates(_0x3490a5[_0x39a6('0x4b')],null))[_0x39a6('0x15')](function(_0x5e1a42){if(_0x5e1a42){_0x2e1603[_0x39a6('0x1e')]=_0x5e1a42[_0x39a6('0x6b')]({'plain':!![]});return db[_0x39a6('0x6c')]['find']({'where':{'id':_0x5e1a42['MailInteractionId']}});}return null;})[_0x39a6('0x15')](handleEntityNotFound(_0x2d70b3,null))[_0x39a6('0x15')](function(_0xd2c9b7){if(_0xd2c9b7){return _0xd2c9b7[_0x39a6('0x28')]({'UserId':_0x3490a5[_0x39a6('0x4b')][_0x39a6('0x6a')],'read1stAt':_[_0x39a6('0x6d')](_0xd2c9b7[_0x39a6('0x6e')])?moment()[_0x39a6('0x65')](_0x39a6('0x66')):undefined});}return null;})[_0x39a6('0x15')](function(_0x38b157){if(_0x38b157){_0x2e1603[_0x39a6('0x6f')]=_0x38b157['get']({'plain':!![]});interaction_log['info'](_0x39a6('0x70'),_0x3490a5[_0x39a6('0x71')]['id'],_0x3490a5['user'][_0x39a6('0x2c')],_0x3490a5[_0x39a6('0x71')][_0x39a6('0x72')],_0x2e1603[_0x39a6('0x6f')]['id'],_0x3490a5[_0x39a6('0x4b')]?JSON[_0x39a6('0x1b')](_0x3490a5['body']):'null');return respondWithRpcPromise(_0x39a6('0x73'),_0x39a6('0x74'),_0x2e1603);}return null;})[_0x39a6('0x15')](function(_0x472157){var _0x224db3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x472157[_0x39a6('0x1e')][_0x39a6('0x75')];return db['sequelize'][_0x39a6('0x34')](_0x224db3,{'type':db[_0x39a6('0x76')][_0x39a6('0x77')][_0x39a6('0x78')],'raw':!![]})['then'](function(_0x500a80){return _0x500a80;});})[_0x39a6('0x15')](function(_0x4815cc){if(_0x4815cc){_0x2e1603[_0x39a6('0x1e')][_0x39a6('0x79')]=_0x4815cc[0x0];if(!_0x3490a5[_0x39a6('0x4b')][_0x39a6('0x6a')])return;return db['User'][_0x39a6('0x4d')]({'where':{'id':_0x3490a5[_0x39a6('0x4b')][_0x39a6('0x6a')],'role':_0x39a6('0x7a')},'attributes':['id',_0x39a6('0x2c'),_0x39a6('0x7b'),_0x39a6('0x7c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x350248){if(!_0x350248)return null;_0x2e1603['message'][_0x39a6('0x7a')]=_0x350248;return _0x2e1603;})[_0x39a6('0x15')](function(_0x3df062){if(_0x3df062){if(_0x3490a5[_0x39a6('0x4b')][_0x39a6('0x7d')]){_0x2e1603[_0x39a6('0x1e')][_0x39a6('0x7e')]=util[_0x39a6('0x65')](_0x39a6('0x7f'),_0x3490a5['user'][_0x39a6('0x2c')]);_0x2e1603[_0x39a6('0x1e')][_0x39a6('0x80')]=_0x2e1603[_0x39a6('0x80')];_0x2e1603['message']['motionChannel']=_0x2e1603[_0x39a6('0x80')];_0x2e1603[_0x39a6('0x1e')][_0x39a6('0x81')]='accept';_0x2e1603[_0x39a6('0x1e')][_0x39a6('0x4b')]=htmlToText['fromString'](_0x2e1603[_0x39a6('0x1e')][_0x39a6('0x4b')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0x39a6('0x82'),'message':_0x2e1603[_0x39a6('0x1e')]},client9002)[_0x39a6('0x15')](function(){return _0x2e1603;});}return _0x2e1603;}return null;})['then'](respondWithResult(_0x2d70b3,null))[_0x39a6('0x20')](handleError(_0x2d70b3,null));};exports[_0x39a6('0x83')]=function(_0x4d89f2,_0x45a669){var _0x460ba2={'agent':{},'channel':_0x39a6('0x68')};if(_0x4d89f2[_0x39a6('0x4b')]['id']){delete _0x4d89f2[_0x39a6('0x4b')]['id'];}_0x4d89f2['body']['UserId']=_0x4d89f2['body'][_0x39a6('0x6a')]||_0x4d89f2[_0x39a6('0x71')]['id'];_0x460ba2[_0x39a6('0x7a')]['id']=_0x4d89f2[_0x39a6('0x4b')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x4d89f2['params']['id'],'UserId':null}})[_0x39a6('0x15')](handleEntityNotFound(_0x45a669,null))[_0x39a6('0x15')](function(_0x3458aa){if(_0x3458aa){_0x460ba2[_0x39a6('0x1e')]=_0x3458aa[_0x39a6('0x6b')]({'plain':!![]});return db[_0x39a6('0x6c')][_0x39a6('0x4d')]({'where':{'id':_0x3458aa[_0x39a6('0x84')]}});}return null;})[_0x39a6('0x15')](handleEntityNotFound(_0x45a669,null))[_0x39a6('0x15')](function(_0x3e04bf){if(_0x3e04bf){_0x460ba2[_0x39a6('0x6f')]=_0x3e04bf[_0x39a6('0x6b')]({'plain':!![]});interaction_log[_0x39a6('0x16')](_0x39a6('0x85'),_0x4d89f2['user']['id'],_0x4d89f2[_0x39a6('0x71')][_0x39a6('0x2c')],_0x4d89f2[_0x39a6('0x71')][_0x39a6('0x72')],_0x460ba2[_0x39a6('0x6f')]['id'],_0x4d89f2[_0x39a6('0x4b')]?JSON[_0x39a6('0x1b')](_0x4d89f2[_0x39a6('0x4b')]):_0x39a6('0x86'));return respondWithRpcPromise('RejectMessage',_0x39a6('0x87'),_0x460ba2);}return null;})[_0x39a6('0x15')](function(_0x54e59b){var _0x356f39=_0x39a6('0x88')+_0x54e59b['message'][_0x39a6('0x75')];return db['sequelize'][_0x39a6('0x34')](_0x356f39,{'type':db[_0x39a6('0x76')][_0x39a6('0x77')][_0x39a6('0x78')],'raw':!![]})[_0x39a6('0x15')](function(_0x55ab52){return _0x55ab52;});})[_0x39a6('0x15')](function(_0x28174e){if(_0x28174e){_0x460ba2[_0x39a6('0x1e')][_0x39a6('0x79')]=_0x28174e[0x0];if(!_0x4d89f2[_0x39a6('0x4b')][_0x39a6('0x6a')])return;return db[_0x39a6('0x89')][_0x39a6('0x4d')]({'where':{'id':_0x4d89f2[_0x39a6('0x4b')][_0x39a6('0x6a')],'role':_0x39a6('0x7a')},'attributes':['id',_0x39a6('0x2c'),_0x39a6('0x7b'),_0x39a6('0x7c'),_0x39a6('0x8a')],'raw':!![]});}return null;})[_0x39a6('0x15')](function(_0x1cda0f){if(!_0x1cda0f)return null;_0x460ba2['message']['agent']=_0x1cda0f;return _0x460ba2;})['then'](function(_0x3e6ba9){if(_0x3e6ba9){_0x3e6ba9[_0x39a6('0x1e')]['interface']=util[_0x39a6('0x65')](_0x39a6('0x7f'),_0x4d89f2[_0x39a6('0x71')]['name']);_0x3e6ba9[_0x39a6('0x1e')]['channel']=_0x460ba2['channel'];_0x3e6ba9['message'][_0x39a6('0x8b')]=_0x460ba2[_0x39a6('0x80')];_0x3e6ba9[_0x39a6('0x1e')][_0x39a6('0x81')]=_0x39a6('0x83');_0x3e6ba9['message'][_0x39a6('0x4b')]=htmlToText['fromString'](_0x460ba2[_0x39a6('0x1e')][_0x39a6('0x4b')]);respondWithRpcPromise(_0x39a6('0x8c'),_0x39a6('0x8c'),{'event':_0x39a6('0x8d'),'message':_0x3e6ba9[_0x39a6('0x1e')]},client9002);return _0x460ba2;}return null;})[_0x39a6('0x15')](respondWithResult(_0x45a669,null))[_0x39a6('0x20')](handleError(_0x45a669,null));};exports[_0x39a6('0x8e')]=function(_0x26f21f,_0xf5b38b){var _0x3ac3f4=moment()[_0x39a6('0x8f')]()[_0x39a6('0x90')]();var _0x50323f=path[_0x39a6('0x5e')](config['root'],_0x39a6('0x91'),_0x39a6('0x92'),_0x39a6('0x93'));var _0x193b4d=path[_0x39a6('0x5e')](config[_0x39a6('0x5f')],'server',_0x39a6('0x92'),_0x39a6('0x5d'));var _0x8c96ac=util[_0x39a6('0x65')]('message-%s.eml',_0x3ac3f4);return db['MailMessage']['find']({'where':{'id':_0x26f21f[_0x39a6('0x49')]['id']},'attributes':['id',_0x39a6('0x4b'),_0x39a6('0x94'),'to','cc',_0x39a6('0x95'),_0x39a6('0x96'),'createdAt'],'include':_0x26f21f[_0x39a6('0x34')][_0x39a6('0x5d')]?[{'model':db[_0x39a6('0x97')],'as':_0x39a6('0x98')}]:undefined})[_0x39a6('0x15')](handleEntityNotFound(_0xf5b38b,null))[_0x39a6('0x15')](function(_0xfb139){if(_0xfb139){var _0x1a22ce=_0xfb139;var _0x4c5809={'from':_0x1a22ce['from'],'to':_0x1a22ce['to'],'subject':_0x1a22ce[_0x39a6('0x96')],'html':htmlEntities[_0x39a6('0x99')](_0x1a22ce['body']),'headers':{'Date':moment(_0x1a22ce['createdAt'])[_0x39a6('0x65')](_0x39a6('0x9a'))},'attachments':[]};if(_0xfb139['cc']){_0x4c5809['headers']['Cc']=_0xfb139['cc'];}if(_0xfb139[_0x39a6('0x95')]){_0x4c5809[_0x39a6('0x9b')][_0x39a6('0x9c')]=_0xfb139[_0x39a6('0x95')];}return new BPromise(function(_0x151a3a,_0x261902){if(_0xfb139['Attachments']){for(var _0x2f92a6=0x0;_0x2f92a6<_0xfb139['Attachments'][_0x39a6('0x39')];_0x2f92a6++){var _0x1e68cd=_0xfb139[_0x39a6('0x98')][_0x2f92a6];var _0x5b4324=path[_0x39a6('0x5e')](_0x193b4d,_0x1e68cd[_0x39a6('0x9d')]);if(fs['existsSync'](_0x5b4324)){_0x4c5809['attachments'][_0x39a6('0x9e')]({'name':_0x1e68cd[_0x39a6('0x2c')],'contentType':_0x1e68cd[_0x39a6('0x31')],'data':fs[_0x39a6('0x9f')](_0x5b4324)});}}}emlformat[_0x39a6('0xa0')](_0x4c5809,function(_0x50eaf4,_0x3e36a3){if(_0x50eaf4)return _0x261902(_0x50eaf4);fs[_0x39a6('0xa1')](path[_0x39a6('0x5e')](_0x50323f,_0x8c96ac),_0x3e36a3);return _0x151a3a(_0x3e36a3);});});}})['then'](function(_0x5f062c){if(_0x5f062c){return _0xf5b38b[_0x39a6('0x8e')](path[_0x39a6('0x5e')](_0x50323f,_0x8c96ac),_0x8c96ac,function(_0x2d2dc1){if(!_0x2d2dc1)fs[_0x39a6('0xa2')](path[_0x39a6('0x5e')](_0x50323f,_0x8c96ac));});}})[_0x39a6('0x20')](handleError(_0xf5b38b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8ba7a6a..1f5dd93 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 _0x0a2c=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x3486b0,_0x248021){var _0x2c8a3f=function(_0x7b5568){while(--_0x7b5568){_0x3486b0['push'](_0x3486b0['shift']());}};_0x2c8a3f(++_0x248021);}(_0x0a2c,0xd5));var _0xc0a2=function(_0x32c6d2,_0x24416e){_0x32c6d2=_0x32c6d2-0x0;var _0x46b834=_0x0a2c[_0x32c6d2];return _0x46b834;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xc0a2('0x0'))['db'][_0xc0a2('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc0a2('0x2')](0x0);var events={'afterCreate':_0xc0a2('0x3'),'afterUpdate':_0xc0a2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a7637){return function(_0x43edfe,_0x2284d1,_0x4288dd){MailMessageEvents[_0xc0a2('0x5')](_0x5a7637+':'+_0x43edfe['id'],_0x43edfe);MailMessageEvents[_0xc0a2('0x5')](_0x5a7637,_0x43edfe);_0x4288dd(null);};}for(var e in events){if(events[_0xc0a2('0x6')](e)){var event=events[e];MailMessage[_0xc0a2('0x7')](e,emitEvent(event));}}module[_0xc0a2('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xe4af=['hook','exports','events','../../mysqldb','MailMessage','save','update','emit'];(function(_0x13b820,_0x1f5f77){var _0x27b744=function(_0x2c01eb){while(--_0x2c01eb){_0x13b820['push'](_0x13b820['shift']());}};_0x27b744(++_0x1f5f77);}(_0xe4af,0xa2));var _0xfe4a=function(_0x329bdc,_0x216b43){_0x329bdc=_0x329bdc-0x0;var _0x5ce1fc=_0xe4af[_0x329bdc];return _0x5ce1fc;};'use strict';var EventEmitter=require(_0xfe4a('0x0'));var MailMessage=require(_0xfe4a('0x1'))['db'][_0xfe4a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfe4a('0x3'),'afterUpdate':_0xfe4a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11e964){return function(_0x19ed81,_0x5637d5,_0x23ab4e){MailMessageEvents[_0xfe4a('0x5')](_0x11e964+':'+_0x19ed81['id'],_0x19ed81);MailMessageEvents['emit'](_0x11e964,_0x19ed81);_0x23ab4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xfe4a('0x6')](e,emitEvent(event));}}module[_0xfe4a('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index d04279d..a710671 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 _0xf457=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','direction','toLowerCase','out','secret','UserId','findOne','MailInteractionId','update','createdAt','catch','error'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0xf457,0x1f1));var _0x7f45=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf457[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7f45('0x0'));var util=require(_0x7f45('0x1'));var logger=require(_0x7f45('0x2'))(_0x7f45('0x3'));var moment=require(_0x7f45('0x4'));var BPromise=require(_0x7f45('0x5'));var rp=require(_0x7f45('0x6'));var htmlToText=require(_0x7f45('0x7'));var fs=require('fs');var path=require(_0x7f45('0x8'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f45('0x9'));module['exports']=function(_0x1e52d1,_0x312ae7){return _0x1e52d1[_0x7f45('0xa')](_0x7f45('0xb'),attributes,{'tableName':_0x7f45('0xc'),'paranoid':![],'indexes':[{'name':_0x7f45('0xd'),'fields':[_0x7f45('0xd')]},{'name':_0x7f45('0xe'),'fields':['plainBody',_0x7f45('0xf')],'type':_0x7f45('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x568439,_0x49b18a,_0x2bee6b){if(_0x568439[_0x7f45('0x11')]){_0x568439[_0x7f45('0x12')]=htmlToText['fromString'](_0x568439[_0x7f45('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2bee6b(null,_0x49b18a);},'afterCreate':function(_0x2fb934,_0x2e98ff,_0xec8bc1){var _0x4c10d5=_0x1e52d1['models'];var _0x5c7cd4=_0x2fb934['get']({'plain':!![]});if(_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()==='in'||_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()===_0x7f45('0x15')&&!_0x5c7cd4[_0x7f45('0x16')]&&!_['isNil'](_0x5c7cd4[_0x7f45('0x17')])){_0x4c10d5['MailInteraction'][_0x7f45('0x18')]({'where':{'id':_0x5c7cd4[_0x7f45('0x19')]}})['then'](function(_0x376824){if(_0x376824){_0x376824[_0x7f45('0x1a')]({'lastMsgAt':_0x5c7cd4[_0x7f45('0x1b')],'lastMsgDirection':_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()});}})[_0x7f45('0x1c')](function(_0x197260){console[_0x7f45('0x1d')](_0x197260);});}_0xec8bc1();}},'charset':_0x7f45('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd48f=['path','rimraf','../../config/environment','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','catch','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x22b5fa,_0x5702d8){var _0x385ac0=function(_0x2b1ef1){while(--_0x2b1ef1){_0x22b5fa['push'](_0x22b5fa['shift']());}};_0x385ac0(++_0x5702d8);}(_0xd48f,0x87));var _0xfd48=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd48f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfd48('0x0'));var util=require(_0xfd48('0x1'));var logger=require(_0xfd48('0x2'))(_0xfd48('0x3'));var moment=require(_0xfd48('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xfd48('0x5'));var rimraf=require(_0xfd48('0x6'));var config=require(_0xfd48('0x7'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x417ddb,_0x37c242){return _0x417ddb['define'](_0xfd48('0x8'),attributes,{'tableName':_0xfd48('0x9'),'paranoid':![],'indexes':[{'name':_0xfd48('0xa'),'fields':['messageId']},{'name':_0xfd48('0xb'),'fields':[_0xfd48('0xc'),'subject'],'type':_0xfd48('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x380caf,_0x3e5455,_0x4bc0ec){if(_0x380caf[_0xfd48('0xe')]){_0x380caf[_0xfd48('0xc')]=htmlToText[_0xfd48('0xf')](_0x380caf[_0xfd48('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4bc0ec(null,_0x3e5455);},'afterCreate':function(_0x41b264,_0x6744fd,_0x1be06a){var _0x122668=_0x417ddb[_0xfd48('0x10')];var _0x5f5c08=_0x41b264[_0xfd48('0x11')]({'plain':!![]});if(_0x5f5c08['direction']['toLowerCase']()==='in'||_0x5f5c08[_0xfd48('0x12')][_0xfd48('0x13')]()===_0xfd48('0x14')&&!_0x5f5c08[_0xfd48('0x15')]&&!_[_0xfd48('0x16')](_0x5f5c08[_0xfd48('0x17')])){_0x122668['MailInteraction'][_0xfd48('0x18')]({'where':{'id':_0x5f5c08[_0xfd48('0x19')]}})['then'](function(_0x139572){if(_0x139572){_0x139572['update']({'lastMsgAt':_0x5f5c08['createdAt'],'lastMsgDirection':_0x5f5c08[_0xfd48('0x12')]['toLowerCase']()});}})[_0xfd48('0x1a')](function(_0x335fa2){console['error'](_0x335fa2);});}_0x1be06a();}},'charset':_0xfd48('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index e7df8c9..8720eb2 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 _0x77e6=['catch','CreateMailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x77e6,0x1a6));var _0x677e=function(_0x163d8f,_0x1a344b){_0x163d8f=_0x163d8f-0x0;var _0x48e996=_0x77e6[_0x163d8f];return _0x48e996;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});config[_0x677e('0xb')]=_['defaults'](config['redis'],{'host':_0x677e('0xc'),'port':0x18eb});var socket=require(_0x677e('0xd'))(new Redis(config[_0x677e('0xb')]));require(_0x677e('0xe'))['register'](socket);function respondWithRpcPromise(_0x206305,_0x5bf52d,_0x3cdbe3){return new BPromise(function(_0x227084,_0x1e4fd9){return client[_0x677e('0xf')](_0x206305,_0x3cdbe3)[_0x677e('0x10')](function(_0x49ca35){logger[_0x677e('0x11')](_0x677e('0x12'),_0x5bf52d,_0x677e('0x13'));logger[_0x677e('0x14')](_0x677e('0x15'),_0x5bf52d,_0x677e('0x13'),JSON[_0x677e('0x16')](_0x49ca35));if(_0x49ca35[_0x677e('0x17')]){if(_0x49ca35['error']['code']===0x1f4){logger['error'](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x1e4fd9(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}logger[_0x677e('0x17')](_0x677e('0x12'),_0x5bf52d,_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);return _0x227084(_0x49ca35[_0x677e('0x17')][_0x677e('0x18')]);}else{logger[_0x677e('0x11')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0x677e('0x13'));_0x227084(_0x49ca35[_0x677e('0x19')][_0x677e('0x18')]);}})[_0x677e('0x1a')](function(_0xba1c26){logger[_0x677e('0x17')]('MailMessage,\x20%s,\x20%s',_0x5bf52d,_0xba1c26);_0x1e4fd9(_0xba1c26);});});}exports[_0x677e('0x1b')]=function(_0x4bfbb6){var _0x18424e=this;return new Promise(function(_0x267aac,_0x26e9c5){return db['MailMessage'][_0x677e('0x1c')](_0x4bfbb6[_0x677e('0x1d')],{'raw':_0x4bfbb6[_0x677e('0x1e')]?_0x4bfbb6[_0x677e('0x1e')][_0x677e('0x1f')]===undefined?!![]:![]:!![]})[_0x677e('0x10')](function(_0x3a7895){logger['info']('CreateMailMessage',_0x4bfbb6);logger['debug'](_0x677e('0x1b'),_0x4bfbb6,JSON[_0x677e('0x16')](_0x3a7895));_0x267aac(_0x3a7895);})[_0x677e('0x1a')](function(_0x540d0e){logger[_0x677e('0x17')](_0x677e('0x1b'),_0x540d0e[_0x677e('0x18')],_0x4bfbb6);_0x26e9c5(_0x18424e[_0x677e('0x17')](0x1f4,_0x540d0e[_0x677e('0x18')]));});});}; \ No newline at end of file +var _0xb9be=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0xb9be,0xc5));var _0xeb9b=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xb9be[_0x513545];return _0x18b7c5;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});config['redis']=_[_0xeb9b('0xc')](config[_0xeb9b('0xd')],{'host':_0xeb9b('0xe'),'port':0x18eb});var socket=require(_0xeb9b('0xf'))(new Redis(config[_0xeb9b('0xd')]));require(_0xeb9b('0x10'))[_0xeb9b('0x11')](socket);function respondWithRpcPromise(_0x16761a,_0x32f0c4,_0x4f4952){return new BPromise(function(_0x20c855,_0x58d6a4){return client['request'](_0x16761a,_0x4f4952)[_0xeb9b('0x12')](function(_0x4236c0){logger['info'](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));logger[_0xeb9b('0x15')](_0xeb9b('0x16'),_0x32f0c4,'request\x20sent',JSON['stringify'](_0x4236c0));if(_0x4236c0['error']){if(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x18')]===0x1f4){logger[_0xeb9b('0x17')]('MailMessage,\x20%s,\x20%s',_0x32f0c4,_0x4236c0['error']['message']);return _0x58d6a4(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);}logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);return _0x20c855(_0x4236c0[_0xeb9b('0x17')]['message']);}else{logger[_0xeb9b('0x1a')](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));_0x20c855(_0x4236c0[_0xeb9b('0x1b')][_0xeb9b('0x19')]);}})[_0xeb9b('0x1c')](function(_0x21010e){logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x21010e);_0x58d6a4(_0x21010e);});});}exports[_0xeb9b('0x1d')]=function(_0x4f436e){var _0x43dc48=this;return new Promise(function(_0x5a7ffd,_0x5d5f54){return db[_0xeb9b('0x1e')][_0xeb9b('0x1f')](_0x4f436e['body'],{'raw':_0x4f436e[_0xeb9b('0x20')]?_0x4f436e[_0xeb9b('0x20')][_0xeb9b('0x21')]===undefined?!![]:![]:!![]})[_0xeb9b('0x12')](function(_0x3c8be7){logger[_0xeb9b('0x1a')](_0xeb9b('0x1d'),_0x4f436e);logger[_0xeb9b('0x15')](_0xeb9b('0x1d'),_0x4f436e,JSON[_0xeb9b('0x22')](_0x3c8be7));_0x5a7ffd(_0x3c8be7);})[_0xeb9b('0x1c')](function(_0x296f95){logger[_0xeb9b('0x17')](_0xeb9b('0x1d'),_0x296f95[_0xeb9b('0x19')],_0x4f436e);_0x5d5f54(_0x43dc48[_0xeb9b('0x17')](0x1f4,_0x296f95['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 6355bf6..e57a28a 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 _0x77a3=['./mailMessage.events','save','emit','length'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0x77a3,0xfc));var _0x377a=function(_0x5c85e3,_0x48bfe5){_0x5c85e3=_0x5c85e3-0x0;var _0x4ca6e3=_0x77a3[_0x5c85e3];return _0x4ca6e3;};'use strict';var MailMessageEvents=require(_0x377a('0x0'));var events=[_0x377a('0x1'),'remove','update'];function createListener(_0x219493,_0x3de647){return function(_0x1fa9f0){_0x3de647[_0x377a('0x2')](_0x219493,_0x1fa9f0);};}function removeListener(_0x3688c9,_0x32d937){return function(){MailMessageEvents['removeListener'](_0x3688c9,_0x32d937);};}exports['register']=function(_0x2ca6b1){for(var _0x2e935c=0x0,_0x26177f=events[_0x377a('0x3')];_0x2e935c<_0x26177f;_0x2e935c++){var _0x1cc8d8=events[_0x2e935c];var _0x56202b=createListener('mailMessage:'+_0x1cc8d8,_0x2ca6b1);MailMessageEvents['on'](_0x1cc8d8,_0x56202b);}}; \ No newline at end of file +var _0xf9f9=['removeListener','register','length','mailMessage:','./mailMessage.events','remove','update'];(function(_0xb600b9,_0x3de35c){var _0x3e315b=function(_0x739ec0){while(--_0x739ec0){_0xb600b9['push'](_0xb600b9['shift']());}};_0x3e315b(++_0x3de35c);}(_0xf9f9,0x15b));var _0x9f9f=function(_0xe68172,_0x456629){_0xe68172=_0xe68172-0x0;var _0x1e22e2=_0xf9f9[_0xe68172];return _0x1e22e2;};'use strict';var MailMessageEvents=require(_0x9f9f('0x0'));var events=['save',_0x9f9f('0x1'),_0x9f9f('0x2')];function createListener(_0x7a6294,_0x4b1c12){return function(_0x2ed1a4){_0x4b1c12['emit'](_0x7a6294,_0x2ed1a4);};}function removeListener(_0x1ff088,_0x3038ec){return function(){MailMessageEvents[_0x9f9f('0x3')](_0x1ff088,_0x3038ec);};}exports[_0x9f9f('0x4')]=function(_0x42f74b){for(var _0x51010f=0x0,_0x5ee2e9=events[_0x9f9f('0x5')];_0x51010f<_0x5ee2e9;_0x51010f++){var _0x5db038=events[_0x51010f];var _0x3a0b50=createListener(_0x9f9f('0x6')+_0x5db038,_0x42f74b);MailMessageEvents['on'](_0x5db038,_0x3a0b50);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index be13cf1..3331541 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 _0xa086=['removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id','delete','destroy'];(function(_0x104258,_0x96ab1e){var _0x5ec041=function(_0x635ac0){while(--_0x635ac0){_0x104258['push'](_0x104258['shift']());}};_0x5ec041(++_0x96ab1e);}(_0xa086,0x1c3));var _0x6a08=function(_0x187826,_0x2bd187){_0x187826=_0x187826-0x0;var _0x2fd5bb=_0xa086[_0x187826];return _0x2fd5bb;};'use strict';var multer=require(_0x6a08('0x0'));var util=require('util');var path=require(_0x6a08('0x1'));var timeout=require(_0x6a08('0x2'));var express=require(_0x6a08('0x3'));var router=express[_0x6a08('0x4')]();var fs_extra=require(_0x6a08('0x5'));var auth=require(_0x6a08('0x6'));var interaction=require(_0x6a08('0x7'));var config=require(_0x6a08('0x8'));var controller=require(_0x6a08('0x9'));router[_0x6a08('0xa')]('/',auth[_0x6a08('0xb')](),controller[_0x6a08('0xc')]);router[_0x6a08('0xa')](_0x6a08('0xd'),auth[_0x6a08('0xb')](),controller[_0x6a08('0xe')]);router[_0x6a08('0xa')]('/:id',auth[_0x6a08('0xb')](),controller[_0x6a08('0xf')]);router[_0x6a08('0xa')](_0x6a08('0x10'),auth[_0x6a08('0xb')](),controller[_0x6a08('0x11')]);router[_0x6a08('0xa')](_0x6a08('0x12'),auth['isAuthenticated'](),controller[_0x6a08('0x13')]);router[_0x6a08('0xa')](_0x6a08('0x14'),auth[_0x6a08('0xb')](),controller['getAgents']);router[_0x6a08('0x15')]('/',auth[_0x6a08('0xb')](),controller[_0x6a08('0x16')]);router[_0x6a08('0x15')](_0x6a08('0x12'),auth['isAuthenticated'](),controller[_0x6a08('0x17')]);router[_0x6a08('0x15')](_0x6a08('0x14'),auth['isAuthenticated'](),controller[_0x6a08('0x18')]);router[_0x6a08('0x19')](_0x6a08('0x1a'),auth[_0x6a08('0xb')](),controller['update']);router[_0x6a08('0x1b')]('/:id',auth[_0x6a08('0xb')](),controller[_0x6a08('0x1c')]);router[_0x6a08('0x1b')]('/:id/teams',auth[_0x6a08('0xb')](),controller[_0x6a08('0x1d')]);router[_0x6a08('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x318f=['removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams'];(function(_0x3a15bc,_0x1874f8){var _0x50d633=function(_0x4339d8){while(--_0x4339d8){_0x3a15bc['push'](_0x3a15bc['shift']());}};_0x50d633(++_0x1874f8);}(_0x318f,0x18a));var _0xf318=function(_0x41c205,_0x3d43b7){_0x41c205=_0x41c205-0x0;var _0x35f4e4=_0x318f[_0x41c205];return _0x35f4e4;};'use strict';var multer=require(_0xf318('0x0'));var util=require(_0xf318('0x1'));var path=require(_0xf318('0x2'));var timeout=require('connect-timeout');var express=require(_0xf318('0x3'));var router=express['Router']();var fs_extra=require(_0xf318('0x4'));var auth=require(_0xf318('0x5'));var interaction=require(_0xf318('0x6'));var config=require(_0xf318('0x7'));var controller=require(_0xf318('0x8'));router['get']('/',auth[_0xf318('0x9')](),controller['index']);router[_0xf318('0xa')]('/describe',auth[_0xf318('0x9')](),controller[_0xf318('0xb')]);router[_0xf318('0xa')](_0xf318('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf318('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0xf318('0xd')]);router[_0xf318('0xa')](_0xf318('0xe'),auth[_0xf318('0x9')](),controller[_0xf318('0xf')]);router['get'](_0xf318('0x10'),auth[_0xf318('0x9')](),controller[_0xf318('0x11')]);router[_0xf318('0x12')]('/',auth[_0xf318('0x9')](),controller['create']);router[_0xf318('0x12')]('/:id/teams',auth[_0xf318('0x9')](),controller[_0xf318('0x13')]);router['post'](_0xf318('0x10'),auth[_0xf318('0x9')](),controller[_0xf318('0x14')]);router[_0xf318('0x15')](_0xf318('0xc'),auth[_0xf318('0x9')](),controller[_0xf318('0x16')]);router[_0xf318('0x17')]('/:id',auth[_0xf318('0x9')](),controller[_0xf318('0x18')]);router[_0xf318('0x17')](_0xf318('0xe'),auth[_0xf318('0x9')](),controller[_0xf318('0x19')]);router[_0xf318('0x17')](_0xf318('0x10'),auth[_0xf318('0x9')](),controller[_0xf318('0x1a')]);module[_0xf318('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 89eb001..15ec5eb 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 _0x9aff=['STRING','ENUM','rrmemory','roundrobin','sequelize'];(function(_0xfe19be,_0x3b5470){var _0xa433ee=function(_0x1ee9b7){while(--_0x1ee9b7){_0xfe19be['push'](_0xfe19be['shift']());}};_0xa433ee(++_0x3b5470);}(_0x9aff,0x1e9));var _0xf9af=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x9aff[_0x4fbfd9];return _0x31dc94;};'use strict';var Sequelize=require(_0xf9af('0x0'));module['exports']={'name':{'type':Sequelize[_0xf9af('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf9af('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf9af('0x2')](_0xf9af('0x3'),'beepall',_0xf9af('0x4'))}}; \ No newline at end of file +var _0x7f67=['exports','STRING','rrmemory','beepall','roundrobin','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7f67,0x113));var _0x77f6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x7f67[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x77f6('0x0'));module[_0x77f6('0x1')]={'name':{'type':Sequelize[_0x77f6('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x77f6('0x3'),_0x77f6('0x4'),_0x77f6('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2be644e..a363df5 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 _0x1841=['include','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','UserMailQueue','MailQueueId','filter','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','hasOwnProperty','online','voicePause','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','User','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','nolimit','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','status','end','json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','get','MailQueues','sendStatus','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','merge','VIRTUAL','includeAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1841,0xdf));var _0x1184=function(_0x4705f9,_0xd5ef3){_0x4705f9=_0x4705f9-0x0;var _0x295e4b=_0x1841[_0x4705f9];return _0x295e4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1184('0x0'));var zipdir=require(_0x1184('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1184('0x2'));var BPromise=require(_0x1184('0x3'));var Mustache=require(_0x1184('0x4'));var util=require(_0x1184('0x5'));var path=require(_0x1184('0x6'));var sox=require('sox');var csv=require(_0x1184('0x7'));var ejs=require(_0x1184('0x8'));var fs=require('fs');var fs_extra=require(_0x1184('0x9'));var _=require(_0x1184('0xa'));var squel=require(_0x1184('0xb'));var crypto=require(_0x1184('0xc'));var jsforce=require(_0x1184('0xd'));var deskjs=require(_0x1184('0xe'));var toCsv=require(_0x1184('0x7'));var querystring=require(_0x1184('0xf'));var Papa=require(_0x1184('0x10'));var Redis=require(_0x1184('0x11'));var authService=require(_0x1184('0x12'));var qs=require(_0x1184('0x13'));var as=require(_0x1184('0x14'));var hardwareService=require(_0x1184('0x15'));var logger=require(_0x1184('0x16'))(_0x1184('0x17'));var utils=require(_0x1184('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1184('0x19'));var db=require(_0x1184('0x1a'))['db'];config[_0x1184('0x1b')]=_[_0x1184('0x1c')](config[_0x1184('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1184('0x1d'))(new Redis(config[_0x1184('0x1b')]));require(_0x1184('0x1e'))['register'](socket);function respondWithStatusCode(_0x54283b,_0x27637d){_0x27637d=_0x27637d||0xcc;return function(_0x4a9543){if(_0x4a9543){return _0x54283b['sendStatus'](_0x27637d);}return _0x54283b[_0x1184('0x1f')](_0x27637d)[_0x1184('0x20')]();};}function respondWithResult(_0xdfe346,_0x3e1d78){_0x3e1d78=_0x3e1d78||0xc8;return function(_0x56f21c){if(_0x56f21c){return _0xdfe346[_0x1184('0x1f')](_0x3e1d78)[_0x1184('0x21')](_0x56f21c);}};}function respondWithFilteredResult(_0x14e379,_0x2e30f6){return function(_0x2ce3c0){if(_0x2ce3c0){var _0x5bf7e7=typeof _0x2e30f6[_0x1184('0x22')]===_0x1184('0x23')&&typeof _0x2e30f6['limit']===_0x1184('0x23');var _0x4a64d6=_0x2ce3c0[_0x1184('0x24')];var _0x301bfe=_0x5bf7e7?0x0:_0x2e30f6['offset'];var _0x50f80f=_0x5bf7e7?_0x2ce3c0['count']:_0x2e30f6[_0x1184('0x22')]+_0x2e30f6[_0x1184('0x25')];var _0x5af629;if(_0x50f80f>=_0x4a64d6){_0x50f80f=_0x4a64d6;_0x5af629=0xc8;}else{_0x5af629=0xce;}_0x14e379[_0x1184('0x1f')](_0x5af629);return _0x14e379[_0x1184('0x26')](_0x1184('0x27'),_0x301bfe+'-'+_0x50f80f+'/'+_0x4a64d6)['json'](_0x2ce3c0);}return null;};}function patchUpdates(_0x220ef1){return function(_0x28bc84){try{jsonpatch['apply'](_0x28bc84,_0x220ef1,!![]);}catch(_0x50d242){return BPromise['reject'](_0x50d242);}return _0x28bc84[_0x1184('0x28')]();};}function saveUpdates(_0x250d9b,_0x31b0d0){return function(_0x202616){if(_0x202616){return _0x202616['update'](_0x250d9b)[_0x1184('0x29')](function(_0x348bd8){return _0x348bd8;});}return null;};}function removeEntity(_0x1f2a6a,_0x32a97b){return function(_0x31293a){if(_0x31293a){return _0x31293a[_0x1184('0x2a')]()['then'](function(){var _0x333d6a=_0x31293a[_0x1184('0x2b')]({'plain':!![]});var _0x5910c4=_0x1184('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5910c4,'resourceId':_0x333d6a['id']}})[_0x1184('0x29')](function(){return _0x31293a;});})['then'](function(){_0x1f2a6a[_0x1184('0x1f')](0xcc)[_0x1184('0x20')]();});}};}function handleEntityNotFound(_0xcffbf6,_0x11d92f){return function(_0xad0370){if(!_0xad0370){_0xcffbf6[_0x1184('0x2d')](0x194);}return _0xad0370;};}function handleError(_0x52aac3,_0x1ed2f6){_0x1ed2f6=_0x1ed2f6||0x1f4;return function(_0x5b8c72){logger[_0x1184('0x2e')](_0x5b8c72[_0x1184('0x2f')]);if(_0x5b8c72[_0x1184('0x30')]){delete _0x5b8c72['name'];}_0x52aac3[_0x1184('0x1f')](_0x1ed2f6)[_0x1184('0x31')](_0x5b8c72);};}exports['index']=function(_0xef33fa,_0x327329){var _0x436c32={},_0x2f5231={},_0x2ae33b={'count':0x0,'rows':[]};var _0xb49ffa=_['map'](db[_0x1184('0x32')][_0x1184('0x33')],function(_0x2cebad){return{'name':_0x2cebad[_0x1184('0x34')],'type':_0x2cebad[_0x1184('0x35')][_0x1184('0x36')]};});_0x2f5231['model']=_[_0x1184('0x37')](_0xb49ffa,_0x1184('0x30'));_0x2f5231['query']=_[_0x1184('0x38')](_0xef33fa[_0x1184('0x39')]);_0x2f5231[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x2f5231[_0x1184('0x3c')],_0x2f5231[_0x1184('0x39')]);_0x436c32['attributes']=_[_0x1184('0x3b')](_0x2f5231[_0x1184('0x3c')],qs[_0x1184('0x3d')](_0xef33fa[_0x1184('0x39')][_0x1184('0x3d')]));_0x436c32[_0x1184('0x3e')]=_0x436c32[_0x1184('0x3e')][_0x1184('0x3f')]?_0x436c32[_0x1184('0x3e')]:_0x2f5231[_0x1184('0x3c')];if(!_0xef33fa[_0x1184('0x39')]['hasOwnProperty']('nolimit')){_0x436c32[_0x1184('0x25')]=qs['limit'](_0xef33fa[_0x1184('0x39')][_0x1184('0x25')]);_0x436c32['offset']=qs[_0x1184('0x22')](_0xef33fa['query'][_0x1184('0x22')]);}_0x436c32[_0x1184('0x40')]=qs[_0x1184('0x41')](_0xef33fa['query'][_0x1184('0x41')]);_0x436c32[_0x1184('0x42')]=qs['filters'](_[_0x1184('0x43')](_0xef33fa[_0x1184('0x39')],_0x2f5231[_0x1184('0x3a')]),_0xb49ffa);if(_0xef33fa[_0x1184('0x39')]['filter']){_0x436c32[_0x1184('0x42')]=_[_0x1184('0x44')](_0x436c32[_0x1184('0x42')],{'$or':_['map'](_0xb49ffa,function(_0x531fea){if(_0x531fea[_0x1184('0x35')]!==_0x1184('0x45')){var _0x132f99={};_0x132f99[_0x531fea[_0x1184('0x30')]]={'$like':'%'+_0xef33fa[_0x1184('0x39')]['filter']+'%'};return _0x132f99;}})});}_0x436c32=_[_0x1184('0x44')]({},_0x436c32,_0xef33fa['options']);var _0x503692={'where':_0x436c32[_0x1184('0x42')]};return db[_0x1184('0x32')][_0x1184('0x24')](_0x503692)[_0x1184('0x29')](function(_0x252615){_0x2ae33b['count']=_0x252615;if(_0xef33fa[_0x1184('0x39')][_0x1184('0x46')]){_0x436c32[_0x1184('0x47')]=[{'all':!![]}];}return db[_0x1184('0x32')]['findAll'](_0x436c32);})[_0x1184('0x29')](function(_0x420864){_0x2ae33b[_0x1184('0x48')]=_0x420864;return _0x2ae33b;})[_0x1184('0x29')](respondWithFilteredResult(_0x327329,_0x436c32))[_0x1184('0x49')](handleError(_0x327329,null));};exports[_0x1184('0x4a')]=function(_0x18c72a,_0x3a7e9d){var _0x37b553={'raw':!![],'where':{'id':_0x18c72a[_0x1184('0x4b')]['id']}},_0x331270={};_0x331270[_0x1184('0x3c')]=_[_0x1184('0x38')](db[_0x1184('0x32')][_0x1184('0x33')]);_0x331270[_0x1184('0x39')]=_[_0x1184('0x38')](_0x18c72a[_0x1184('0x39')]);_0x331270[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x331270[_0x1184('0x3c')],_0x331270[_0x1184('0x39')]);_0x37b553[_0x1184('0x3e')]=_[_0x1184('0x3b')](_0x331270['model'],qs['fields'](_0x18c72a[_0x1184('0x39')][_0x1184('0x3d')]));_0x37b553[_0x1184('0x3e')]=_0x37b553[_0x1184('0x3e')][_0x1184('0x3f')]?_0x37b553[_0x1184('0x3e')]:_0x331270['model'];if(_0x18c72a[_0x1184('0x39')][_0x1184('0x46')]){_0x37b553[_0x1184('0x47')]=[{'all':!![]}];}_0x37b553=_['merge']({},_0x37b553,_0x18c72a[_0x1184('0x4c')]);return db[_0x1184('0x32')]['find'](_0x37b553)[_0x1184('0x29')](handleEntityNotFound(_0x3a7e9d,null))['then'](respondWithResult(_0x3a7e9d,null))[_0x1184('0x49')](handleError(_0x3a7e9d,null));};exports[_0x1184('0x4d')]=function(_0x3104d2,_0x45e9ab){return db[_0x1184('0x32')][_0x1184('0x4d')](_0x3104d2[_0x1184('0x4e')],{})[_0x1184('0x29')](function(_0x495bc1){var _0x191097=_0x3104d2[_0x1184('0x4f')]['get']({'plain':!![]});if(!_0x191097)throw new Error(_0x1184('0x50'));if(_0x191097[_0x1184('0x51')]===_0x1184('0x4f')){var _0x4c2bab=_0x495bc1[_0x1184('0x2b')]({'plain':!![]});var _0xfcb93e=_0x1184('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0xfcb93e,'userProfileId':_0x191097[_0x1184('0x52')]},'raw':!![]})['then'](function(_0x53caf2){if(_0x53caf2&&_0x53caf2[_0x1184('0x53')]===0x0){return db[_0x1184('0x54')][_0x1184('0x4d')]({'name':_0x4c2bab[_0x1184('0x30')],'resourceId':_0x4c2bab['id'],'type':_0x53caf2[_0x1184('0x30')],'sectionId':_0x53caf2['id']},{})['then'](function(){return _0x495bc1;});}else{return _0x495bc1;}})[_0x1184('0x49')](function(_0x262b85){logger['error'](_0x1184('0x55'),_0x262b85);throw _0x262b85;});}return _0x495bc1;})[_0x1184('0x29')](respondWithResult(_0x45e9ab,0xc9))[_0x1184('0x49')](handleError(_0x45e9ab,null));};exports[_0x1184('0x56')]=function(_0x4a1e0c,_0x3abff0){if(_0x4a1e0c[_0x1184('0x4e')]['id']){delete _0x4a1e0c[_0x1184('0x4e')]['id'];}return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x4a1e0c[_0x1184('0x4b')]['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x3abff0,null))[_0x1184('0x29')](saveUpdates(_0x4a1e0c['body'],null))['then'](respondWithResult(_0x3abff0,null))['catch'](handleError(_0x3abff0,null));};exports[_0x1184('0x2a')]=function(_0x2b8b86,_0xc2c883){return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x2b8b86[_0x1184('0x4b')]['id']}})[_0x1184('0x29')](handleEntityNotFound(_0xc2c883,null))[_0x1184('0x29')](removeEntity(_0xc2c883,null))['catch'](handleError(_0xc2c883,null));};exports['describe']=function(_0x2cf128,_0x3598f4){return db[_0x1184('0x32')][_0x1184('0x58')]()[_0x1184('0x29')](respondWithResult(_0x3598f4,null))[_0x1184('0x49')](handleError(_0x3598f4,null));};exports[_0x1184('0x59')]=function(_0x12cb2b,_0x4eb396,_0x424f7a){var _0x2e9380={'raw':!![],'where':{}},_0x598751={},_0x50003d;return db[_0x1184('0x32')][_0x1184('0x5a')]({'where':{'id':_0x12cb2b[_0x1184('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4eb396,null))['then'](function(_0x12417a){if(_0x12417a){_0x50003d=_0x12417a[_0x1184('0x2b')]({'plain':!![]});_0x598751[_0x1184('0x3c')]=_['keys'](db[_0x1184('0x5b')][_0x1184('0x33')]);_0x598751[_0x1184('0x39')]=_[_0x1184('0x38')](_0x12cb2b[_0x1184('0x39')]);_0x598751[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x598751[_0x1184('0x3c')],_0x598751[_0x1184('0x39')]);_0x2e9380[_0x1184('0x3e')]=_[_0x1184('0x3b')](_0x598751[_0x1184('0x3c')],qs['fields'](_0x12cb2b[_0x1184('0x39')][_0x1184('0x3d')]));_0x2e9380[_0x1184('0x3e')]=_0x2e9380[_0x1184('0x3e')][_0x1184('0x3f')]?_0x2e9380['attributes']:_0x598751['model'];if(!_0x12cb2b[_0x1184('0x39')]['hasOwnProperty']('nolimit')){_0x2e9380['limit']=qs[_0x1184('0x25')](_0x12cb2b[_0x1184('0x39')]['limit']);_0x2e9380[_0x1184('0x22')]=qs[_0x1184('0x22')](_0x12cb2b[_0x1184('0x39')]['offset']);}_0x2e9380[_0x1184('0x40')]=qs[_0x1184('0x41')](_0x12cb2b[_0x1184('0x39')]['sort']);_0x2e9380[_0x1184('0x42')]=qs[_0x1184('0x3a')](_[_0x1184('0x43')](_0x12cb2b[_0x1184('0x39')],_0x598751['filters']));_0x2e9380[_0x1184('0x42')][_0x1184('0x5c')]=_0x12417a['id'];if(_0x12cb2b[_0x1184('0x39')][_0x1184('0x5d')]){_0x2e9380['where']=_[_0x1184('0x44')](_0x2e9380[_0x1184('0x42')],{'$or':_[_0x1184('0x37')](_0x2e9380[_0x1184('0x3e')],function(_0x320f4a){var _0xbb88d8={};_0xbb88d8[_0x320f4a]={'$like':'%'+_0x12cb2b[_0x1184('0x39')][_0x1184('0x5d')]+'%'};return _0xbb88d8;})});}_0x2e9380=_[_0x1184('0x44')]({},_0x2e9380,_0x12cb2b[_0x1184('0x4c')]);return db['UserMailQueue'][_0x1184('0x5e')](_0x2e9380);}})[_0x1184('0x29')](function(_0x2fb5c3){if(_0x2fb5c3){return db['User'][_0x1184('0x5f')]({'where':{'id':_[_0x1184('0x37')](_0x2fb5c3,_0x1184('0x60')),'role':_0x1184('0x61')},'attributes':['id',_0x1184('0x30'),_0x1184('0x62'),_0x1184('0x63'),_0x1184('0x64')]});}})[_0x1184('0x29')](function(_0x83383b){if(_0x83383b){return{'count':_0x83383b[_0x1184('0x24')],'rows':_[_0x1184('0x37')](_0x83383b[_0x1184('0x48')],function(_0x103513){return{'membername':_0x103513[_0x1184('0x30')],'UserId':_0x103513['id'],'queue_name':_0x50003d[_0x1184('0x30')],'MailQueueId':_0x50003d['id'],'interface':util[_0x1184('0x65')](_0x1184('0x66'),_0x1184('0x67'),_0x103513['name']),'penalty':0x0,'paused':_0x103513['mailPause'],'createdAt':_0x103513[_0x1184('0x64')],'updatedAt':_0x103513[_0x1184('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1184('0x29')](respondWithFilteredResult(_0x4eb396,_0x2e9380))[_0x1184('0x49')](handleError(_0x4eb396,null));};exports['getTeams']=function(_0x506de4,_0x5daa39,_0x1d572a){var _0x5bd584={};var _0x202b1c={};var _0x113599;var _0x195812;return db[_0x1184('0x32')][_0x1184('0x5a')]({'where':{'id':_0x506de4['params']['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x5daa39,null))['then'](function(_0x2619f0){if(_0x2619f0){_0x113599=_0x2619f0;_0x202b1c[_0x1184('0x3c')]=_['keys'](db[_0x1184('0x68')]['rawAttributes']);_0x202b1c[_0x1184('0x39')]=_[_0x1184('0x38')](_0x506de4[_0x1184('0x39')]);_0x202b1c[_0x1184('0x3a')]=_[_0x1184('0x3b')](_0x202b1c[_0x1184('0x3c')],_0x202b1c['query']);_0x5bd584[_0x1184('0x3e')]=_[_0x1184('0x3b')](_0x202b1c[_0x1184('0x3c')],qs[_0x1184('0x3d')](_0x506de4['query'][_0x1184('0x3d')]));_0x5bd584[_0x1184('0x3e')]=_0x5bd584[_0x1184('0x3e')][_0x1184('0x3f')]?_0x5bd584[_0x1184('0x3e')]:_0x202b1c[_0x1184('0x3c')];_0x5bd584['order']=qs[_0x1184('0x41')](_0x506de4[_0x1184('0x39')][_0x1184('0x41')]);_0x5bd584[_0x1184('0x42')]=qs[_0x1184('0x3a')](_[_0x1184('0x43')](_0x506de4[_0x1184('0x39')],_0x202b1c[_0x1184('0x3a')]));if(_0x506de4['query']['filter']){_0x5bd584[_0x1184('0x42')]=_[_0x1184('0x44')](_0x5bd584[_0x1184('0x42')],{'$or':_[_0x1184('0x37')](_0x5bd584['attributes'],function(_0x5c022c){var _0x5738e4={};_0x5738e4[_0x5c022c]={'$like':'%'+_0x506de4['query'][_0x1184('0x5d')]+'%'};return _0x5738e4;})});}_0x5bd584=_[_0x1184('0x44')]({},_0x5bd584,_0x506de4[_0x1184('0x4c')]);return _0x113599[_0x1184('0x69')](_0x5bd584);}})[_0x1184('0x29')](function(_0x2bbe6c){if(_0x2bbe6c){_0x195812=_0x2bbe6c[_0x1184('0x3f')];if(!_0x506de4['query'][_0x1184('0x6a')]('nolimit')){_0x5bd584['limit']=qs['limit'](_0x506de4[_0x1184('0x39')][_0x1184('0x25')]);_0x5bd584[_0x1184('0x22')]=qs['offset'](_0x506de4[_0x1184('0x39')][_0x1184('0x22')]);}return _0x113599[_0x1184('0x69')](_0x5bd584);}})[_0x1184('0x29')](function(_0x3b4cc){if(_0x3b4cc){return _0x3b4cc?{'count':_0x195812,'rows':_0x3b4cc}:null;}})[_0x1184('0x29')](respondWithResult(_0x5daa39,null))['catch'](handleError(_0x5daa39,null));};exports['addTeams']=function(_0x5eb5c9,_0x138b52,_0x4b4dec){var _0x2172f5=_0x5eb5c9['body']['ids'];return db[_0x1184('0x68')][_0x1184('0x5e')]({'where':{'id':_0x2172f5},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1184('0x30'),_0x1184('0x6b'),_0x1184('0x6c'),'interface'],'raw':!![]}]})[_0x1184('0x29')](function(_0x128491){if(_0x128491){var _0x507669=_[_0x1184('0x6d')](_0x128491,function(_0x3e44c4){var _0x96a05=_0x3e44c4[_0x1184('0x2b')]({'plain':!![]});return _0x96a05[_0x1184('0x6e')];});return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x5eb5c9[_0x1184('0x4b')]['id']}})['then'](function(_0x956a0f){return db['sequelize'][_0x1184('0x6f')](function(_0x269ffc){return _0x956a0f['addTeams'](_0x2172f5,{'transaction':_0x269ffc})[_0x1184('0x29')](function(){return BPromise[_0x1184('0x70')](_0x507669,function(_0x1db0a8){return db['UserMailQueue'][_0x1184('0x71')]({'where':{'UserId':_0x1db0a8['id'],'MailQueueId':_0x5eb5c9[_0x1184('0x4b')]['id']},'transaction':_0x269ffc});});})[_0x1184('0x29')](function(){_0x507669[_0x1184('0x72')](function(_0x4720e7){socket[_0x1184('0x73')](_0x1184('0x74'),{'UserId':_0x4720e7['id'],'MailQueueId':_0x956a0f['id']});});});});});}})[_0x1184('0x29')](respondWithStatusCode(_0x138b52,null))[_0x1184('0x49')](handleError(_0x138b52,null));};exports[_0x1184('0x75')]=function(_0x3b36e3,_0xea099d,_0x1d96ff){return db[_0x1184('0x68')][_0x1184('0x5e')]({'where':{'id':_0x3b36e3[_0x1184('0x39')][_0x1184('0x76')]},'attributes':['id'],'include':[{'model':db[_0x1184('0x77')],'as':_0x1184('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x1184('0x29')](handleEntityNotFound(_0xea099d,null))[_0x1184('0x29')](function(_0x228cf5){var _0x27ce60=_['map'](_0x228cf5,'id');var _0x51629e=[];var _0x51cc63=[];var _0x37f788=squel[_0x1184('0x78')]();_0x37f788['field'](_0x1184('0x79'))[_0x1184('0x7a')]('team_has_mail_queues','tq')['join'](_0x1184('0x7b'),'ut',_0x1184('0x7c'))['where'](_0x1184('0x7d'),_0x3b36e3[_0x1184('0x4b')]['id']);for(var _0x105e2e=0x0;_0x105e2e<_0x228cf5['length'];_0x105e2e+=0x1){let _0x56dae5=_0x228cf5[_0x105e2e];for(var _0x3f6aa8=0x0;_0x3f6aa8<_0x56dae5['Agents'][_0x1184('0x3f')];_0x3f6aa8+=0x1){let _0x467972=_0x56dae5[_0x1184('0x6e')][_0x3f6aa8];var _0x1ac485=_0x37f788[_0x1184('0x7e')]();_0x1ac485[_0x1184('0x42')](_0x1184('0x7f'),_0x467972['id']);_0x51cc63[_0x1184('0x80')](db[_0x1184('0x81')][_0x1184('0x39')](_0x1ac485[_0x1184('0x82')](),{'type':db[_0x1184('0x81')][_0x1184('0x83')][_0x1184('0x84')]})[_0x1184('0x29')](function(_0x240c9f){if(_0x240c9f[_0x1184('0x3f')]===0x1){return _0x467972['id'];}else{var _0x239288=_[_0x1184('0x85')](_['map'](_0x240c9f,_0x1184('0x86')),function(_0x99fdb8){return _[_0x1184('0x87')](_0x27ce60,_0x99fdb8);});if(_0x239288){return _0x467972['id'];}}}));}}return BPromise[_0x1184('0x88')](_0x51cc63)['then'](function(_0x4eaf9a){_0x51629e=_(_0x51629e)['union'](_0x4eaf9a)[_0x1184('0x89')]()[_0x1184('0x8a')]();return db['MailQueue']['find']({'where':{'id':_0x3b36e3['params']['id']}})[_0x1184('0x29')](function(_0x248bd3){return db[_0x1184('0x81')][_0x1184('0x6f')](function(_0x330713){return _0x248bd3['removeTeams'](_0x3b36e3[_0x1184('0x39')][_0x1184('0x76')],{'transaction':_0x330713})[_0x1184('0x29')](function(){if(!_['isEmpty'](_0x51629e)){return _0x248bd3[_0x1184('0x8b')](_0x51629e,{'transaction':_0x330713});}})[_0x1184('0x29')](function(){_0x51629e['forEach'](function(_0x555213){socket['emit'](_0x1184('0x8c'),{'UserId':_0x555213,'MailQueueId':_0x248bd3['id']});});});});});});})[_0x1184('0x29')](respondWithStatusCode(_0xea099d,null))[_0x1184('0x49')](handleError(_0xea099d,null));};exports[_0x1184('0x8d')]=function(_0xff6e33,_0x22b35b,_0x176c3b){return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0xff6e33[_0x1184('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22b35b,null))['then'](function(_0x497b5e){if(_0x497b5e){return _0x497b5e[_0x1184('0x8d')](_0xff6e33[_0x1184('0x4e')][_0x1184('0x76')],_[_0x1184('0x8e')](_0xff6e33[_0x1184('0x4e')],[_0x1184('0x76'),'id'])||{})[_0x1184('0x8f')](function(_0x376ce7){for(var _0x23186d=0x0;_0x23186d<_0xff6e33[_0x1184('0x4e')][_0x1184('0x76')][_0x1184('0x3f')];_0x23186d+=0x1){socket[_0x1184('0x73')](_0x1184('0x74'),{'UserId':Number(_0xff6e33['body'][_0x1184('0x76')][_0x23186d]),'MailQueueId':Number(_0xff6e33[_0x1184('0x4b')]['id'])});}return _0x376ce7;});}})[_0x1184('0x29')](respondWithResult(_0x22b35b,null))[_0x1184('0x49')](handleError(_0x22b35b,null));};exports[_0x1184('0x8b')]=function(_0x279bf6,_0x510d26,_0xd95a0f){return db[_0x1184('0x32')][_0x1184('0x57')]({'where':{'id':_0x279bf6[_0x1184('0x4b')]['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x510d26,null))[_0x1184('0x29')](function(_0x518c74){if(_0x518c74){return _0x518c74[_0x1184('0x8b')](_0x279bf6[_0x1184('0x39')]['ids'])[_0x1184('0x29')](function(){if(_[_0x1184('0x90')](_0x279bf6[_0x1184('0x39')][_0x1184('0x76')])){for(var _0x1501ad=0x0;_0x1501ad<_0x279bf6[_0x1184('0x39')][_0x1184('0x76')]['length'];_0x1501ad+=0x1){socket[_0x1184('0x73')](_0x1184('0x8c'),{'UserId':Number(_0x279bf6[_0x1184('0x39')]['ids'][_0x1501ad]),'MailQueueId':Number(_0x279bf6[_0x1184('0x4b')]['id'])});}}else{socket[_0x1184('0x73')](_0x1184('0x8c'),{'UserId':Number(_0x279bf6['query'][_0x1184('0x76')]),'MailQueueId':Number(_0x279bf6['params']['id'])});}});}})[_0x1184('0x29')](respondWithStatusCode(_0x510d26,null))['catch'](handleError(_0x510d26,null));};exports[_0x1184('0x91')]=function(_0x355fa8,_0x13c377,_0x55614e){var _0x5606b1={};var _0x141fd2={};var _0x3fd28a;var _0x51e1a2;return db['MailQueue'][_0x1184('0x5a')]({'where':{'id':_0x355fa8['params']['id']}})[_0x1184('0x29')](handleEntityNotFound(_0x13c377,null))[_0x1184('0x29')](function(_0x1311af){if(_0x1311af){_0x3fd28a=_0x1311af;_0x141fd2['model']=_[_0x1184('0x38')](db[_0x1184('0x77')][_0x1184('0x33')]);_0x141fd2[_0x1184('0x39')]=_[_0x1184('0x38')](_0x355fa8[_0x1184('0x39')]);_0x141fd2['filters']=_['intersection'](_0x141fd2[_0x1184('0x3c')],_0x141fd2['query']);_0x5606b1[_0x1184('0x3e')]=_['intersection'](_0x141fd2[_0x1184('0x3c')],qs['fields'](_0x355fa8[_0x1184('0x39')][_0x1184('0x3d')]));_0x5606b1[_0x1184('0x3e')]=_0x5606b1[_0x1184('0x3e')][_0x1184('0x3f')]?_0x5606b1[_0x1184('0x3e')]:_0x141fd2['model'];_0x5606b1[_0x1184('0x40')]=qs[_0x1184('0x41')](_0x355fa8[_0x1184('0x39')][_0x1184('0x41')]);_0x5606b1[_0x1184('0x42')]=qs[_0x1184('0x3a')](_[_0x1184('0x43')](_0x355fa8[_0x1184('0x39')],_0x141fd2[_0x1184('0x3a')]));if(_0x355fa8[_0x1184('0x39')][_0x1184('0x5d')]){_0x5606b1[_0x1184('0x42')]=_['merge'](_0x5606b1[_0x1184('0x42')],{'$or':_[_0x1184('0x37')](_0x5606b1[_0x1184('0x3e')],function(_0x1ca6cc){var _0x5b6931={};_0x5b6931[_0x1ca6cc]={'$like':'%'+_0x355fa8[_0x1184('0x39')][_0x1184('0x5d')]+'%'};return _0x5b6931;})});}_0x5606b1=_['merge']({},_0x5606b1,_0x355fa8[_0x1184('0x4c')]);return _0x3fd28a['getAgents'](_0x5606b1);}})[_0x1184('0x29')](function(_0x5201d7){if(_0x5201d7){_0x51e1a2=_0x5201d7['length'];if(!_0x355fa8['query'][_0x1184('0x6a')](_0x1184('0x92'))){_0x5606b1[_0x1184('0x25')]=qs['limit'](_0x355fa8[_0x1184('0x39')]['limit']);_0x5606b1[_0x1184('0x22')]=qs[_0x1184('0x22')](_0x355fa8[_0x1184('0x39')]['offset']);}return _0x3fd28a[_0x1184('0x91')](_0x5606b1);}})[_0x1184('0x29')](function(_0x3d529a){if(_0x3d529a){return _0x3d529a?{'count':_0x51e1a2,'rows':_0x3d529a}:null;}})[_0x1184('0x29')](respondWithResult(_0x13c377,null))[_0x1184('0x49')](handleError(_0x13c377,null));}; \ No newline at end of file +var _0xaf80=['include','findAll','rows','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','MailQueueId','filter','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','addTeams','Team','User','Agents','online','voicePause','flatMap','transaction','each','forEach','emit','userMailQueue:save','removeTeams','select','field','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','compact','value','ids','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','get','MailQueues','UserProfileResource','destroy','then','error','stack','name','send','MailQueue','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xaf80,0x1ef));var _0x0af8=function(_0x582714,_0x543712){_0x582714=_0x582714-0x0;var _0x1d6063=_0xaf80[_0x582714];return _0x1d6063;};'use strict';var emlformat=require(_0x0af8('0x0'));var rimraf=require(_0x0af8('0x1'));var zipdir=require(_0x0af8('0x2'));var jsonpatch=require(_0x0af8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0af8('0x4'));var util=require(_0x0af8('0x5'));var path=require(_0x0af8('0x6'));var sox=require(_0x0af8('0x7'));var csv=require(_0x0af8('0x8'));var ejs=require(_0x0af8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0af8('0xa'));var crypto=require('crypto');var jsforce=require(_0x0af8('0xb'));var deskjs=require(_0x0af8('0xc'));var toCsv=require(_0x0af8('0x8'));var querystring=require('querystring');var Papa=require(_0x0af8('0xd'));var Redis=require(_0x0af8('0xe'));var authService=require(_0x0af8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0af8('0x10'));var logger=require(_0x0af8('0x11'))(_0x0af8('0x12'));var utils=require(_0x0af8('0x13'));var config=require(_0x0af8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0af8('0x15'))['db'];config[_0x0af8('0x16')]=_[_0x0af8('0x17')](config[_0x0af8('0x16')],{'host':_0x0af8('0x18'),'port':0x18eb});var socket=require(_0x0af8('0x19'))(new Redis(config[_0x0af8('0x16')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x420432,_0xbfd057){_0xbfd057=_0xbfd057||0xcc;return function(_0x287cfc){if(_0x287cfc){return _0x420432[_0x0af8('0x1a')](_0xbfd057);}return _0x420432[_0x0af8('0x1b')](_0xbfd057)[_0x0af8('0x1c')]();};}function respondWithResult(_0x4755cb,_0x325b4c){_0x325b4c=_0x325b4c||0xc8;return function(_0x50d5ba){if(_0x50d5ba){return _0x4755cb['status'](_0x325b4c)['json'](_0x50d5ba);}};}function respondWithFilteredResult(_0x3294ce,_0x465161){return function(_0x54e946){if(_0x54e946){var _0x2ace30=typeof _0x465161[_0x0af8('0x1d')]===_0x0af8('0x1e')&&typeof _0x465161['limit']==='undefined';var _0x50b8fa=_0x54e946[_0x0af8('0x1f')];var _0x1eb805=_0x2ace30?0x0:_0x465161['offset'];var _0x2baa24=_0x2ace30?_0x54e946['count']:_0x465161['offset']+_0x465161[_0x0af8('0x20')];var _0x2e0b36;if(_0x2baa24>=_0x50b8fa){_0x2baa24=_0x50b8fa;_0x2e0b36=0xc8;}else{_0x2e0b36=0xce;}_0x3294ce[_0x0af8('0x1b')](_0x2e0b36);return _0x3294ce[_0x0af8('0x21')](_0x0af8('0x22'),_0x1eb805+'-'+_0x2baa24+'/'+_0x50b8fa)['json'](_0x54e946);}return null;};}function patchUpdates(_0x592523){return function(_0x3f6c88){try{jsonpatch[_0x0af8('0x23')](_0x3f6c88,_0x592523,!![]);}catch(_0x4b0492){return BPromise[_0x0af8('0x24')](_0x4b0492);}return _0x3f6c88[_0x0af8('0x25')]();};}function saveUpdates(_0x404b25,_0x1b046b){return function(_0x43e3d1){if(_0x43e3d1){return _0x43e3d1['update'](_0x404b25)['then'](function(_0x1c6306){return _0x1c6306;});}return null;};}function removeEntity(_0x3b2a80,_0x359583){return function(_0xb43164){if(_0xb43164){return _0xb43164['destroy']()['then'](function(){var _0x315ad=_0xb43164[_0x0af8('0x26')]({'plain':!![]});var _0x23a102=_0x0af8('0x27');return db[_0x0af8('0x28')][_0x0af8('0x29')]({'where':{'type':_0x23a102,'resourceId':_0x315ad['id']}})[_0x0af8('0x2a')](function(){return _0xb43164;});})['then'](function(){_0x3b2a80[_0x0af8('0x1b')](0xcc)[_0x0af8('0x1c')]();});}};}function handleEntityNotFound(_0x1a7fdf,_0x20eab4){return function(_0x1b94cf){if(!_0x1b94cf){_0x1a7fdf[_0x0af8('0x1a')](0x194);}return _0x1b94cf;};}function handleError(_0x4575b0,_0xa21efe){_0xa21efe=_0xa21efe||0x1f4;return function(_0x80bdcc){logger[_0x0af8('0x2b')](_0x80bdcc[_0x0af8('0x2c')]);if(_0x80bdcc['name']){delete _0x80bdcc[_0x0af8('0x2d')];}_0x4575b0['status'](_0xa21efe)[_0x0af8('0x2e')](_0x80bdcc);};}exports['index']=function(_0x318ca7,_0x1d2d4f){var _0x535352={},_0x14cf8b={},_0x2466c3={'count':0x0,'rows':[]};var _0x34b3e5=_['map'](db[_0x0af8('0x2f')][_0x0af8('0x30')],function(_0x6fe9e9){return{'name':_0x6fe9e9['fieldName'],'type':_0x6fe9e9[_0x0af8('0x31')][_0x0af8('0x32')]};});_0x14cf8b[_0x0af8('0x33')]=_[_0x0af8('0x34')](_0x34b3e5,_0x0af8('0x2d'));_0x14cf8b[_0x0af8('0x35')]=_['keys'](_0x318ca7[_0x0af8('0x35')]);_0x14cf8b[_0x0af8('0x36')]=_[_0x0af8('0x37')](_0x14cf8b[_0x0af8('0x33')],_0x14cf8b[_0x0af8('0x35')]);_0x535352[_0x0af8('0x38')]=_[_0x0af8('0x37')](_0x14cf8b[_0x0af8('0x33')],qs[_0x0af8('0x39')](_0x318ca7[_0x0af8('0x35')][_0x0af8('0x39')]));_0x535352[_0x0af8('0x38')]=_0x535352['attributes'][_0x0af8('0x3a')]?_0x535352[_0x0af8('0x38')]:_0x14cf8b[_0x0af8('0x33')];if(!_0x318ca7[_0x0af8('0x35')][_0x0af8('0x3b')](_0x0af8('0x3c'))){_0x535352[_0x0af8('0x20')]=qs['limit'](_0x318ca7[_0x0af8('0x35')][_0x0af8('0x20')]);_0x535352[_0x0af8('0x1d')]=qs['offset'](_0x318ca7[_0x0af8('0x35')][_0x0af8('0x1d')]);}_0x535352[_0x0af8('0x3d')]=qs['sort'](_0x318ca7[_0x0af8('0x35')][_0x0af8('0x3e')]);_0x535352[_0x0af8('0x3f')]=qs[_0x0af8('0x36')](_[_0x0af8('0x40')](_0x318ca7[_0x0af8('0x35')],_0x14cf8b[_0x0af8('0x36')]),_0x34b3e5);if(_0x318ca7['query']['filter']){_0x535352[_0x0af8('0x3f')]=_[_0x0af8('0x41')](_0x535352['where'],{'$or':_[_0x0af8('0x34')](_0x34b3e5,function(_0x4486b8){if(_0x4486b8['type']!==_0x0af8('0x42')){var _0x596d74={};_0x596d74[_0x4486b8[_0x0af8('0x2d')]]={'$like':'%'+_0x318ca7[_0x0af8('0x35')]['filter']+'%'};return _0x596d74;}})});}_0x535352=_[_0x0af8('0x41')]({},_0x535352,_0x318ca7[_0x0af8('0x43')]);var _0x497695={'where':_0x535352[_0x0af8('0x3f')]};return db['MailQueue'][_0x0af8('0x1f')](_0x497695)[_0x0af8('0x2a')](function(_0x141d2f){_0x2466c3['count']=_0x141d2f;if(_0x318ca7['query'][_0x0af8('0x44')]){_0x535352[_0x0af8('0x45')]=[{'all':!![]}];}return db[_0x0af8('0x2f')][_0x0af8('0x46')](_0x535352);})['then'](function(_0x1293d8){_0x2466c3[_0x0af8('0x47')]=_0x1293d8;return _0x2466c3;})[_0x0af8('0x2a')](respondWithFilteredResult(_0x1d2d4f,_0x535352))['catch'](handleError(_0x1d2d4f,null));};exports[_0x0af8('0x48')]=function(_0x22d810,_0x5039ea){var _0x2e55d7={'raw':!![],'where':{'id':_0x22d810[_0x0af8('0x49')]['id']}},_0x5babc4={};_0x5babc4['model']=_['keys'](db['MailQueue'][_0x0af8('0x30')]);_0x5babc4['query']=_[_0x0af8('0x4a')](_0x22d810['query']);_0x5babc4[_0x0af8('0x36')]=_[_0x0af8('0x37')](_0x5babc4[_0x0af8('0x33')],_0x5babc4[_0x0af8('0x35')]);_0x2e55d7[_0x0af8('0x38')]=_['intersection'](_0x5babc4['model'],qs[_0x0af8('0x39')](_0x22d810[_0x0af8('0x35')][_0x0af8('0x39')]));_0x2e55d7[_0x0af8('0x38')]=_0x2e55d7[_0x0af8('0x38')][_0x0af8('0x3a')]?_0x2e55d7[_0x0af8('0x38')]:_0x5babc4['model'];if(_0x22d810['query'][_0x0af8('0x44')]){_0x2e55d7[_0x0af8('0x45')]=[{'all':!![]}];}_0x2e55d7=_[_0x0af8('0x41')]({},_0x2e55d7,_0x22d810[_0x0af8('0x43')]);return db['MailQueue'][_0x0af8('0x4b')](_0x2e55d7)[_0x0af8('0x2a')](handleEntityNotFound(_0x5039ea,null))[_0x0af8('0x2a')](respondWithResult(_0x5039ea,null))[_0x0af8('0x4c')](handleError(_0x5039ea,null));};exports[_0x0af8('0x4d')]=function(_0x4678f8,_0x4e7d6e){return db[_0x0af8('0x2f')]['create'](_0x4678f8[_0x0af8('0x4e')],{})['then'](function(_0xeddce9){var _0x36ec9e=_0x4678f8[_0x0af8('0x4f')]['get']({'plain':!![]});if(!_0x36ec9e)throw new Error(_0x0af8('0x50'));if(_0x36ec9e[_0x0af8('0x51')]==='user'){var _0x40811e=_0xeddce9[_0x0af8('0x26')]({'plain':!![]});var _0x2ae5cc=_0x0af8('0x27');return db[_0x0af8('0x52')][_0x0af8('0x4b')]({'where':{'name':_0x2ae5cc,'userProfileId':_0x36ec9e[_0x0af8('0x53')]},'raw':!![]})['then'](function(_0x3af515){if(_0x3af515&&_0x3af515[_0x0af8('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x40811e[_0x0af8('0x2d')],'resourceId':_0x40811e['id'],'type':_0x3af515[_0x0af8('0x2d')],'sectionId':_0x3af515['id']},{})['then'](function(){return _0xeddce9;});}else{return _0xeddce9;}})[_0x0af8('0x4c')](function(_0x21610d){logger['error'](_0x0af8('0x55'),_0x21610d);throw _0x21610d;});}return _0xeddce9;})['then'](respondWithResult(_0x4e7d6e,0xc9))['catch'](handleError(_0x4e7d6e,null));};exports[_0x0af8('0x56')]=function(_0x1911cd,_0x553625){if(_0x1911cd[_0x0af8('0x4e')]['id']){delete _0x1911cd[_0x0af8('0x4e')]['id'];}return db['MailQueue'][_0x0af8('0x4b')]({'where':{'id':_0x1911cd['params']['id']}})[_0x0af8('0x2a')](handleEntityNotFound(_0x553625,null))[_0x0af8('0x2a')](saveUpdates(_0x1911cd['body'],null))['then'](respondWithResult(_0x553625,null))[_0x0af8('0x4c')](handleError(_0x553625,null));};exports[_0x0af8('0x29')]=function(_0xda3fa2,_0x44fea6){return db['MailQueue'][_0x0af8('0x4b')]({'where':{'id':_0xda3fa2[_0x0af8('0x49')]['id']}})[_0x0af8('0x2a')](handleEntityNotFound(_0x44fea6,null))['then'](removeEntity(_0x44fea6,null))[_0x0af8('0x4c')](handleError(_0x44fea6,null));};exports[_0x0af8('0x57')]=function(_0x48879c,_0x521e35){return db[_0x0af8('0x2f')][_0x0af8('0x57')]()[_0x0af8('0x2a')](respondWithResult(_0x521e35,null))['catch'](handleError(_0x521e35,null));};exports[_0x0af8('0x58')]=function(_0x3c1866,_0x28059d,_0x1922a0){var _0x109e4c={'raw':!![],'where':{}},_0x5c3ab9={},_0x143cf;return db['MailQueue'][_0x0af8('0x59')]({'where':{'id':_0x3c1866['params']['id']}})[_0x0af8('0x2a')](handleEntityNotFound(_0x28059d,null))[_0x0af8('0x2a')](function(_0x31ec8e){if(_0x31ec8e){_0x143cf=_0x31ec8e[_0x0af8('0x26')]({'plain':!![]});_0x5c3ab9[_0x0af8('0x33')]=_[_0x0af8('0x4a')](db[_0x0af8('0x5a')][_0x0af8('0x30')]);_0x5c3ab9[_0x0af8('0x35')]=_['keys'](_0x3c1866[_0x0af8('0x35')]);_0x5c3ab9[_0x0af8('0x36')]=_[_0x0af8('0x37')](_0x5c3ab9['model'],_0x5c3ab9['query']);_0x109e4c[_0x0af8('0x38')]=_[_0x0af8('0x37')](_0x5c3ab9[_0x0af8('0x33')],qs[_0x0af8('0x39')](_0x3c1866[_0x0af8('0x35')][_0x0af8('0x39')]));_0x109e4c['attributes']=_0x109e4c[_0x0af8('0x38')]['length']?_0x109e4c[_0x0af8('0x38')]:_0x5c3ab9[_0x0af8('0x33')];if(!_0x3c1866['query']['hasOwnProperty']('nolimit')){_0x109e4c[_0x0af8('0x20')]=qs[_0x0af8('0x20')](_0x3c1866[_0x0af8('0x35')][_0x0af8('0x20')]);_0x109e4c[_0x0af8('0x1d')]=qs[_0x0af8('0x1d')](_0x3c1866['query'][_0x0af8('0x1d')]);}_0x109e4c[_0x0af8('0x3d')]=qs[_0x0af8('0x3e')](_0x3c1866['query'][_0x0af8('0x3e')]);_0x109e4c[_0x0af8('0x3f')]=qs['filters'](_[_0x0af8('0x40')](_0x3c1866[_0x0af8('0x35')],_0x5c3ab9[_0x0af8('0x36')]));_0x109e4c[_0x0af8('0x3f')][_0x0af8('0x5b')]=_0x31ec8e['id'];if(_0x3c1866['query'][_0x0af8('0x5c')]){_0x109e4c[_0x0af8('0x3f')]=_[_0x0af8('0x41')](_0x109e4c[_0x0af8('0x3f')],{'$or':_['map'](_0x109e4c['attributes'],function(_0x491e89){var _0x4e7ec4={};_0x4e7ec4[_0x491e89]={'$like':'%'+_0x3c1866[_0x0af8('0x35')][_0x0af8('0x5c')]+'%'};return _0x4e7ec4;})});}_0x109e4c=_[_0x0af8('0x41')]({},_0x109e4c,_0x3c1866['options']);return db['UserMailQueue']['findAll'](_0x109e4c);}})['then'](function(_0x31c448){if(_0x31c448){return db['User'][_0x0af8('0x5d')]({'where':{'id':_[_0x0af8('0x34')](_0x31c448,_0x0af8('0x5e')),'role':_0x0af8('0x5f')},'attributes':['id','name',_0x0af8('0x60'),_0x0af8('0x61'),_0x0af8('0x62')]});}})[_0x0af8('0x2a')](function(_0x205ea5){if(_0x205ea5){return{'count':_0x205ea5[_0x0af8('0x1f')],'rows':_[_0x0af8('0x34')](_0x205ea5[_0x0af8('0x47')],function(_0x5890bd){return{'membername':_0x5890bd[_0x0af8('0x2d')],'UserId':_0x5890bd['id'],'queue_name':_0x143cf[_0x0af8('0x2d')],'MailQueueId':_0x143cf['id'],'interface':util[_0x0af8('0x63')](_0x0af8('0x64'),'SIP',_0x5890bd[_0x0af8('0x2d')]),'penalty':0x0,'paused':_0x5890bd[_0x0af8('0x60')],'createdAt':_0x5890bd[_0x0af8('0x62')],'updatedAt':_0x5890bd[_0x0af8('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x28059d,_0x109e4c))['catch'](handleError(_0x28059d,null));};exports[_0x0af8('0x65')]=function(_0x77a5fe,_0x14dbcb,_0x711f4){var _0x3f8ac2={};var _0x1386e4={};var _0x443a31;var _0x1c0dab;return db[_0x0af8('0x2f')][_0x0af8('0x59')]({'where':{'id':_0x77a5fe[_0x0af8('0x49')]['id']}})[_0x0af8('0x2a')](handleEntityNotFound(_0x14dbcb,null))[_0x0af8('0x2a')](function(_0x300cde){if(_0x300cde){_0x443a31=_0x300cde;_0x1386e4['model']=_[_0x0af8('0x4a')](db['Team']['rawAttributes']);_0x1386e4['query']=_[_0x0af8('0x4a')](_0x77a5fe['query']);_0x1386e4['filters']=_['intersection'](_0x1386e4[_0x0af8('0x33')],_0x1386e4[_0x0af8('0x35')]);_0x3f8ac2[_0x0af8('0x38')]=_[_0x0af8('0x37')](_0x1386e4[_0x0af8('0x33')],qs[_0x0af8('0x39')](_0x77a5fe['query'][_0x0af8('0x39')]));_0x3f8ac2['attributes']=_0x3f8ac2[_0x0af8('0x38')][_0x0af8('0x3a')]?_0x3f8ac2['attributes']:_0x1386e4['model'];_0x3f8ac2[_0x0af8('0x3d')]=qs[_0x0af8('0x3e')](_0x77a5fe[_0x0af8('0x35')]['sort']);_0x3f8ac2['where']=qs['filters'](_['pick'](_0x77a5fe[_0x0af8('0x35')],_0x1386e4[_0x0af8('0x36')]));if(_0x77a5fe['query'][_0x0af8('0x5c')]){_0x3f8ac2[_0x0af8('0x3f')]=_[_0x0af8('0x41')](_0x3f8ac2['where'],{'$or':_[_0x0af8('0x34')](_0x3f8ac2[_0x0af8('0x38')],function(_0x3f0ea2){var _0x2b0a44={};_0x2b0a44[_0x3f0ea2]={'$like':'%'+_0x77a5fe[_0x0af8('0x35')][_0x0af8('0x5c')]+'%'};return _0x2b0a44;})});}_0x3f8ac2=_[_0x0af8('0x41')]({},_0x3f8ac2,_0x77a5fe['options']);return _0x443a31[_0x0af8('0x65')](_0x3f8ac2);}})['then'](function(_0x5476fb){if(_0x5476fb){_0x1c0dab=_0x5476fb[_0x0af8('0x3a')];if(!_0x77a5fe[_0x0af8('0x35')][_0x0af8('0x3b')](_0x0af8('0x3c'))){_0x3f8ac2[_0x0af8('0x20')]=qs[_0x0af8('0x20')](_0x77a5fe[_0x0af8('0x35')][_0x0af8('0x20')]);_0x3f8ac2[_0x0af8('0x1d')]=qs[_0x0af8('0x1d')](_0x77a5fe['query'][_0x0af8('0x1d')]);}return _0x443a31[_0x0af8('0x65')](_0x3f8ac2);}})[_0x0af8('0x2a')](function(_0x36e8d7){if(_0x36e8d7){return _0x36e8d7?{'count':_0x1c0dab,'rows':_0x36e8d7}:null;}})[_0x0af8('0x2a')](respondWithResult(_0x14dbcb,null))['catch'](handleError(_0x14dbcb,null));};exports[_0x0af8('0x66')]=function(_0x406a20,_0x612f4d,_0x34b0d1){var _0x41d201=_0x406a20[_0x0af8('0x4e')]['ids'];return db[_0x0af8('0x67')][_0x0af8('0x46')]({'where':{'id':_0x41d201},'attributes':['id'],'include':[{'model':db[_0x0af8('0x68')],'as':_0x0af8('0x69'),'attributes':['id',_0x0af8('0x2d'),_0x0af8('0x6a'),_0x0af8('0x6b'),'interface'],'raw':!![]}]})[_0x0af8('0x2a')](function(_0x5b2b62){if(_0x5b2b62){var _0x3ed30d=_[_0x0af8('0x6c')](_0x5b2b62,function(_0x129a0c){var _0x325022=_0x129a0c[_0x0af8('0x26')]({'plain':!![]});return _0x325022[_0x0af8('0x69')];});return db[_0x0af8('0x2f')][_0x0af8('0x4b')]({'where':{'id':_0x406a20['params']['id']}})['then'](function(_0x4fa26e){return db['sequelize'][_0x0af8('0x6d')](function(_0x30cabe){return _0x4fa26e[_0x0af8('0x66')](_0x41d201,{'transaction':_0x30cabe})[_0x0af8('0x2a')](function(){return BPromise[_0x0af8('0x6e')](_0x3ed30d,function(_0x3b5a6d){return db[_0x0af8('0x5a')]['findOrCreate']({'where':{'UserId':_0x3b5a6d['id'],'MailQueueId':_0x406a20[_0x0af8('0x49')]['id']},'transaction':_0x30cabe});});})[_0x0af8('0x2a')](function(){_0x3ed30d[_0x0af8('0x6f')](function(_0x531942){socket[_0x0af8('0x70')](_0x0af8('0x71'),{'UserId':_0x531942['id'],'MailQueueId':_0x4fa26e['id']});});});});});}})[_0x0af8('0x2a')](respondWithStatusCode(_0x612f4d,null))['catch'](handleError(_0x612f4d,null));};exports[_0x0af8('0x72')]=function(_0x54608e,_0x39070a,_0x2127aa){return db['Team']['findAll']({'where':{'id':_0x54608e[_0x0af8('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0af8('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x39070a,null))['then'](function(_0x9854c5){var _0x29cf19=_[_0x0af8('0x34')](_0x9854c5,'id');var _0x4cd7d3=[];var _0x11e213=[];var _0x2ad52c=squel[_0x0af8('0x73')]();_0x2ad52c[_0x0af8('0x74')]('tq.TeamId')['from'](_0x0af8('0x75'),'tq')[_0x0af8('0x76')](_0x0af8('0x77'),'ut',_0x0af8('0x78'))[_0x0af8('0x3f')](_0x0af8('0x79'),_0x54608e[_0x0af8('0x49')]['id']);for(var _0x9e5e17=0x0;_0x9e5e17<_0x9854c5[_0x0af8('0x3a')];_0x9e5e17+=0x1){let _0x2eeab0=_0x9854c5[_0x9e5e17];for(var _0xb25174=0x0;_0xb25174<_0x2eeab0[_0x0af8('0x69')][_0x0af8('0x3a')];_0xb25174+=0x1){let _0x1bbc22=_0x2eeab0[_0x0af8('0x69')][_0xb25174];var _0x15a918=_0x2ad52c[_0x0af8('0x7a')]();_0x15a918[_0x0af8('0x3f')](_0x0af8('0x7b'),_0x1bbc22['id']);_0x11e213[_0x0af8('0x7c')](db[_0x0af8('0x7d')][_0x0af8('0x35')](_0x15a918['toString'](),{'type':db[_0x0af8('0x7d')][_0x0af8('0x7e')][_0x0af8('0x7f')]})[_0x0af8('0x2a')](function(_0x4f5b2f){if(_0x4f5b2f[_0x0af8('0x3a')]===0x1){return _0x1bbc22['id'];}else{var _0x3cab4b=_[_0x0af8('0x80')](_[_0x0af8('0x34')](_0x4f5b2f,_0x0af8('0x81')),function(_0x580d2b){return _[_0x0af8('0x82')](_0x29cf19,_0x580d2b);});if(_0x3cab4b){return _0x1bbc22['id'];}}}));}}return BPromise['all'](_0x11e213)[_0x0af8('0x2a')](function(_0x50f374){_0x4cd7d3=_(_0x4cd7d3)['union'](_0x50f374)[_0x0af8('0x83')]()[_0x0af8('0x84')]();return db[_0x0af8('0x2f')][_0x0af8('0x4b')]({'where':{'id':_0x54608e[_0x0af8('0x49')]['id']}})['then'](function(_0x4ca932){return db[_0x0af8('0x7d')][_0x0af8('0x6d')](function(_0x27f8c0){return _0x4ca932['removeTeams'](_0x54608e['query'][_0x0af8('0x85')],{'transaction':_0x27f8c0})[_0x0af8('0x2a')](function(){if(!_[_0x0af8('0x86')](_0x4cd7d3)){return _0x4ca932['removeAgents'](_0x4cd7d3,{'transaction':_0x27f8c0});}})[_0x0af8('0x2a')](function(){_0x4cd7d3[_0x0af8('0x6f')](function(_0x20ee60){socket[_0x0af8('0x70')](_0x0af8('0x87'),{'UserId':_0x20ee60,'MailQueueId':_0x4ca932['id']});});});});});});})['then'](respondWithStatusCode(_0x39070a,null))['catch'](handleError(_0x39070a,null));};exports['addAgents']=function(_0x189487,_0x1e232b,_0x90306e){return db[_0x0af8('0x2f')][_0x0af8('0x4b')]({'where':{'id':_0x189487[_0x0af8('0x49')]['id']}})[_0x0af8('0x2a')](handleEntityNotFound(_0x1e232b,null))[_0x0af8('0x2a')](function(_0x5c35b7){if(_0x5c35b7){return _0x5c35b7[_0x0af8('0x88')](_0x189487['body'][_0x0af8('0x85')],_[_0x0af8('0x89')](_0x189487['body'],['ids','id'])||{})[_0x0af8('0x8a')](function(_0x55998b){for(var _0x194320=0x0;_0x194320<_0x189487[_0x0af8('0x4e')]['ids']['length'];_0x194320+=0x1){socket[_0x0af8('0x70')](_0x0af8('0x71'),{'UserId':Number(_0x189487[_0x0af8('0x4e')][_0x0af8('0x85')][_0x194320]),'MailQueueId':Number(_0x189487[_0x0af8('0x49')]['id'])});}return _0x55998b;});}})[_0x0af8('0x2a')](respondWithResult(_0x1e232b,null))[_0x0af8('0x4c')](handleError(_0x1e232b,null));};exports[_0x0af8('0x8b')]=function(_0x478671,_0x28eb85,_0x2794fc){return db[_0x0af8('0x2f')][_0x0af8('0x4b')]({'where':{'id':_0x478671[_0x0af8('0x49')]['id']}})[_0x0af8('0x2a')](handleEntityNotFound(_0x28eb85,null))['then'](function(_0x5d587e){if(_0x5d587e){return _0x5d587e['removeAgents'](_0x478671[_0x0af8('0x35')]['ids'])[_0x0af8('0x2a')](function(){if(_['isArray'](_0x478671['query']['ids'])){for(var _0x35a6ac=0x0;_0x35a6ac<_0x478671[_0x0af8('0x35')]['ids'][_0x0af8('0x3a')];_0x35a6ac+=0x1){socket[_0x0af8('0x70')](_0x0af8('0x87'),{'UserId':Number(_0x478671[_0x0af8('0x35')][_0x0af8('0x85')][_0x35a6ac]),'MailQueueId':Number(_0x478671['params']['id'])});}}else{socket['emit'](_0x0af8('0x87'),{'UserId':Number(_0x478671['query'][_0x0af8('0x85')]),'MailQueueId':Number(_0x478671[_0x0af8('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x28eb85,null))[_0x0af8('0x4c')](handleError(_0x28eb85,null));};exports[_0x0af8('0x8c')]=function(_0x3d9de3,_0x38ae7f,_0x435f98){var _0x513210={};var _0x268c2d={};var _0x1d30eb;var _0x45c812;return db['MailQueue'][_0x0af8('0x59')]({'where':{'id':_0x3d9de3[_0x0af8('0x49')]['id']}})[_0x0af8('0x2a')](handleEntityNotFound(_0x38ae7f,null))['then'](function(_0x1ead84){if(_0x1ead84){_0x1d30eb=_0x1ead84;_0x268c2d[_0x0af8('0x33')]=_[_0x0af8('0x4a')](db['User'][_0x0af8('0x30')]);_0x268c2d[_0x0af8('0x35')]=_[_0x0af8('0x4a')](_0x3d9de3[_0x0af8('0x35')]);_0x268c2d[_0x0af8('0x36')]=_[_0x0af8('0x37')](_0x268c2d[_0x0af8('0x33')],_0x268c2d['query']);_0x513210[_0x0af8('0x38')]=_['intersection'](_0x268c2d[_0x0af8('0x33')],qs[_0x0af8('0x39')](_0x3d9de3[_0x0af8('0x35')][_0x0af8('0x39')]));_0x513210[_0x0af8('0x38')]=_0x513210['attributes']['length']?_0x513210[_0x0af8('0x38')]:_0x268c2d[_0x0af8('0x33')];_0x513210[_0x0af8('0x3d')]=qs[_0x0af8('0x3e')](_0x3d9de3[_0x0af8('0x35')][_0x0af8('0x3e')]);_0x513210['where']=qs[_0x0af8('0x36')](_[_0x0af8('0x40')](_0x3d9de3['query'],_0x268c2d[_0x0af8('0x36')]));if(_0x3d9de3[_0x0af8('0x35')]['filter']){_0x513210[_0x0af8('0x3f')]=_[_0x0af8('0x41')](_0x513210[_0x0af8('0x3f')],{'$or':_[_0x0af8('0x34')](_0x513210[_0x0af8('0x38')],function(_0x111c46){var _0x504539={};_0x504539[_0x111c46]={'$like':'%'+_0x3d9de3[_0x0af8('0x35')][_0x0af8('0x5c')]+'%'};return _0x504539;})});}_0x513210=_[_0x0af8('0x41')]({},_0x513210,_0x3d9de3[_0x0af8('0x43')]);return _0x1d30eb[_0x0af8('0x8c')](_0x513210);}})[_0x0af8('0x2a')](function(_0x51e686){if(_0x51e686){_0x45c812=_0x51e686[_0x0af8('0x3a')];if(!_0x3d9de3[_0x0af8('0x35')][_0x0af8('0x3b')](_0x0af8('0x3c'))){_0x513210[_0x0af8('0x20')]=qs['limit'](_0x3d9de3[_0x0af8('0x35')][_0x0af8('0x20')]);_0x513210[_0x0af8('0x1d')]=qs[_0x0af8('0x1d')](_0x3d9de3[_0x0af8('0x35')]['offset']);}return _0x1d30eb[_0x0af8('0x8c')](_0x513210);}})['then'](function(_0x1bb3a9){if(_0x1bb3a9){return _0x1bb3a9?{'count':_0x45c812,'rows':_0x1bb3a9}:null;}})['then'](respondWithResult(_0x38ae7f,null))[_0x0af8('0x4c')](handleError(_0x38ae7f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d3c99ac..6d44d9d 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 _0x2b6a=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','MailQueue'];(function(_0x445c5a,_0x3c4bc8){var _0x303437=function(_0x2ad4eb){while(--_0x2ad4eb){_0x445c5a['push'](_0x445c5a['shift']());}};_0x303437(++_0x3c4bc8);}(_0x2b6a,0xcd));var _0xa2b6=function(_0x5a1b23,_0x2445b7){_0x5a1b23=_0x5a1b23-0x0;var _0x5562fd=_0x2b6a[_0x5a1b23];return _0x5562fd;};'use strict';var EventEmitter=require(_0xa2b6('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xa2b6('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa2b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa2b6('0x3'),'afterDestroy':_0xa2b6('0x4')};function emitEvent(_0x32194e){return function(_0x575a3d,_0xb1350,_0x40c275){MailQueueEvents['emit'](_0x32194e+':'+_0x575a3d['id'],_0x575a3d);MailQueueEvents[_0xa2b6('0x5')](_0x32194e,_0x575a3d);_0x40c275(null);};}for(var e in events){if(events[_0xa2b6('0x6')](e)){var event=events[e];MailQueue[_0xa2b6('0x7')](e,emitEvent(event));}}module[_0xa2b6('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x8a73=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1455d7,_0x1b1778){var _0x14ee34=function(_0x1f4ab3){while(--_0x1f4ab3){_0x1455d7['push'](_0x1455d7['shift']());}};_0x14ee34(++_0x1b1778);}(_0x8a73,0x18c));var _0x38a7=function(_0x1d89c9,_0x575a40){_0x1d89c9=_0x1d89c9-0x0;var _0x1ee0e4=_0x8a73[_0x1d89c9];return _0x1ee0e4;};'use strict';var EventEmitter=require(_0x38a7('0x0'));var MailQueue=require(_0x38a7('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x38a7('0x2')](0x0);var events={'afterCreate':_0x38a7('0x3'),'afterUpdate':_0x38a7('0x4'),'afterDestroy':_0x38a7('0x5')};function emitEvent(_0x26b47c){return function(_0x3df588,_0x56ddb1,_0x5829e1){MailQueueEvents[_0x38a7('0x6')](_0x26b47c+':'+_0x3df588['id'],_0x3df588);MailQueueEvents[_0x38a7('0x6')](_0x26b47c,_0x3df588);_0x5829e1(null);};}for(var e in events){if(events[_0x38a7('0x7')](e)){var event=events[e];MailQueue[_0x38a7('0x8')](e,emitEvent(event));}}module[_0x38a7('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index d57796f..1d26989 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 _0xfff6=['mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x5140c0,_0x46a73c){var _0x3ee199=function(_0x33ba80){while(--_0x33ba80){_0x5140c0['push'](_0x5140c0['shift']());}};_0x3ee199(++_0x46a73c);}(_0xfff6,0x83));var _0x6fff=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfff6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x6fff('0x0'));var util=require(_0x6fff('0x1'));var logger=require(_0x6fff('0x2'))(_0x6fff('0x3'));var moment=require(_0x6fff('0x4'));var BPromise=require(_0x6fff('0x5'));var rp=require(_0x6fff('0x6'));var fs=require('fs');var path=require(_0x6fff('0x7'));var rimraf=require('rimraf');var config=require(_0x6fff('0x8'));var attributes=require(_0x6fff('0x9'));module[_0x6fff('0xa')]=function(_0x19a8a5,_0x4358b9){return _0x19a8a5[_0x6fff('0xb')]('MailQueue',attributes,{'tableName':_0x6fff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9208=['request-promise','path','../../config/environment','exports','MailQueue','mail_queues','lodash','../../config/logger','api'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9208,0x8d));var _0x8920=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9208[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8920('0x0'));var util=require('util');var logger=require(_0x8920('0x1'))(_0x8920('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8920('0x3'));var fs=require('fs');var path=require(_0x8920('0x4'));var rimraf=require('rimraf');var config=require(_0x8920('0x5'));var attributes=require('./mailQueue.attributes');module[_0x8920('0x6')]=function(_0x21e47c,_0x2fc241){return _0x21e47c['define'](_0x8920('0x7'),attributes,{'tableName':_0x8920('0x8'),'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 7579535..6ae1f10 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 _0xa0aa=['then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','map','include','model','ShowMailQueue','find','raw','where','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request'];(function(_0x4134f6,_0x37316d){var _0x1b678d=function(_0x63fd4a){while(--_0x63fd4a){_0x4134f6['push'](_0x4134f6['shift']());}};_0x1b678d(++_0x37316d);}(_0xa0aa,0x19b));var _0xaa0a=function(_0x179e43,_0x2837e0){_0x179e43=_0x179e43-0x0;var _0x5b1994=_0xa0aa[_0x179e43];return _0x5b1994;};'use strict';var _=require(_0xaa0a('0x0'));var util=require(_0xaa0a('0x1'));var moment=require('moment');var BPromise=require(_0xaa0a('0x2'));var rs=require(_0xaa0a('0x3'));var fs=require('fs');var Redis=require(_0xaa0a('0x4'));var db=require(_0xaa0a('0x5'))['db'];var utils=require(_0xaa0a('0x6'));var logger=require(_0xaa0a('0x7'))(_0xaa0a('0x8'));var config=require(_0xaa0a('0x9'));var jayson=require(_0xaa0a('0xa'));var client=jayson[_0xaa0a('0xb')][_0xaa0a('0xc')]({'port':0x232a});config[_0xaa0a('0xd')]=_[_0xaa0a('0xe')](config['redis'],{'host':_0xaa0a('0xf'),'port':0x18eb});var socket=require(_0xaa0a('0x10'))(new Redis(config[_0xaa0a('0xd')]));require(_0xaa0a('0x11'))['register'](socket);function respondWithRpcPromise(_0x287239,_0x960aab,_0x168dfa){return new BPromise(function(_0x4f6447,_0xbce866){return client[_0xaa0a('0x12')](_0x287239,_0x168dfa)[_0xaa0a('0x13')](function(_0x291767){logger[_0xaa0a('0x14')](_0xaa0a('0x15'),_0x960aab,'request\x20sent');logger[_0xaa0a('0x16')](_0xaa0a('0x17'),_0x960aab,'request\x20sent',JSON['stringify'](_0x291767));if(_0x291767[_0xaa0a('0x18')]){if(_0x291767['error'][_0xaa0a('0x19')]===0x1f4){logger[_0xaa0a('0x18')](_0xaa0a('0x15'),_0x960aab,_0x291767[_0xaa0a('0x18')][_0xaa0a('0x1a')]);return _0xbce866(_0x291767['error'][_0xaa0a('0x1a')]);}logger[_0xaa0a('0x18')]('MailQueue,\x20%s,\x20%s',_0x960aab,_0x291767['error'][_0xaa0a('0x1a')]);return _0x4f6447(_0x291767[_0xaa0a('0x18')][_0xaa0a('0x1a')]);}else{logger[_0xaa0a('0x14')](_0xaa0a('0x15'),_0x960aab,'request\x20sent');_0x4f6447(_0x291767[_0xaa0a('0x1b')][_0xaa0a('0x1a')]);}})[_0xaa0a('0x1c')](function(_0x52b516){logger['error']('MailQueue,\x20%s,\x20%s',_0x960aab,_0x52b516);_0xbce866(_0x52b516);});});}exports[_0xaa0a('0x1d')]=function(_0x1e8819){var _0x25ab0c=this;return new Promise(function(_0x1237e7,_0x5f4ef1){return db[_0xaa0a('0x1e')][_0xaa0a('0x1f')]({'raw':_0x1e8819['options']?_0x1e8819['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819[_0xaa0a('0x20')]['where']||null:null,'attributes':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819['options'][_0xaa0a('0x21')]||null:null,'limit':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819[_0xaa0a('0x20')][_0xaa0a('0x22')]||null:null,'include':_0x1e8819[_0xaa0a('0x20')]?_0x1e8819[_0xaa0a('0x20')]['include']?_[_0xaa0a('0x23')](_0x1e8819['options'][_0xaa0a('0x24')],function(_0x148103){return{'model':db[_0x148103['model']],'as':_0x148103['as'],'attributes':_0x148103[_0xaa0a('0x21')],'include':_0x148103[_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x148103[_0xaa0a('0x24')],function(_0x512f2d){return{'model':db[_0x512f2d[_0xaa0a('0x25')]],'as':_0x512f2d['as'],'attributes':_0x512f2d[_0xaa0a('0x21')],'include':_0x512f2d[_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x512f2d[_0xaa0a('0x24')],function(_0x1f7f27){return{'model':db[_0x1f7f27[_0xaa0a('0x25')]],'as':_0x1f7f27['as'],'attributes':_0x1f7f27[_0xaa0a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ea031){logger[_0xaa0a('0x14')](_0xaa0a('0x1d'),_0x1e8819);logger[_0xaa0a('0x16')](_0xaa0a('0x1d'),_0x1e8819,JSON['stringify'](_0x3ea031));_0x1237e7(_0x3ea031);})[_0xaa0a('0x1c')](function(_0x4ade8a){logger[_0xaa0a('0x18')]('GetMailQueue',_0x4ade8a[_0xaa0a('0x1a')],_0x1e8819);_0x5f4ef1(_0x25ab0c[_0xaa0a('0x18')](0x1f4,_0x4ade8a[_0xaa0a('0x1a')]));});});};exports[_0xaa0a('0x26')]=function(_0x3ecd44){var _0x3da60f=this;return new Promise(function(_0x438292,_0x239a05){return db['MailQueue'][_0xaa0a('0x27')]({'raw':_0x3ecd44['options']?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x28')]===undefined?!![]:![]:!![],'where':_0x3ecd44[_0xaa0a('0x20')]?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x29')]||null:null,'attributes':_0x3ecd44[_0xaa0a('0x20')]?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x21')]||null:null,'include':_0x3ecd44[_0xaa0a('0x20')]?_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x3ecd44[_0xaa0a('0x20')][_0xaa0a('0x24')],function(_0x11ee8d){return{'model':db[_0x11ee8d['model']],'as':_0x11ee8d['as'],'attributes':_0x11ee8d[_0xaa0a('0x21')],'include':_0x11ee8d[_0xaa0a('0x24')]?_[_0xaa0a('0x23')](_0x11ee8d[_0xaa0a('0x24')],function(_0x21ec92){return{'model':db[_0x21ec92[_0xaa0a('0x25')]],'as':_0x21ec92['as'],'attributes':_0x21ec92[_0xaa0a('0x21')],'include':_0x21ec92['include']?_[_0xaa0a('0x23')](_0x21ec92[_0xaa0a('0x24')],function(_0xb0dfec){return{'model':db[_0xb0dfec[_0xaa0a('0x25')]],'as':_0xb0dfec['as'],'attributes':_0xb0dfec[_0xaa0a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xaa0a('0x13')](function(_0xc428fd){logger[_0xaa0a('0x14')](_0xaa0a('0x26'),_0x3ecd44);logger[_0xaa0a('0x16')](_0xaa0a('0x26'),_0x3ecd44,JSON[_0xaa0a('0x2a')](_0xc428fd));_0x438292(_0xc428fd);})['catch'](function(_0x51a4e0){logger[_0xaa0a('0x18')](_0xaa0a('0x26'),_0x51a4e0[_0xaa0a('0x1a')],_0x3ecd44);_0x239a05(_0x3da60f['error'](0x1f4,_0x51a4e0['message']));});});}; \ No newline at end of file +var _0xc120=['where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','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','catch','GetMailQueue','MailQueue','options','raw'];(function(_0x31c95e,_0x32cc0b){var _0x38aaef=function(_0x4b3c6b){while(--_0x4b3c6b){_0x31c95e['push'](_0x31c95e['shift']());}};_0x38aaef(++_0x32cc0b);}(_0xc120,0xf2));var _0x0c12=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc120[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0c12('0x0'));var util=require(_0x0c12('0x1'));var moment=require(_0x0c12('0x2'));var BPromise=require(_0x0c12('0x3'));var rs=require(_0x0c12('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0c12('0x5'));var logger=require(_0x0c12('0x6'))(_0x0c12('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c12('0x8'));var client=jayson['client'][_0x0c12('0x9')]({'port':0x232a});config['redis']=_[_0x0c12('0xa')](config[_0x0c12('0xb')],{'host':_0x0c12('0xc'),'port':0x18eb});var socket=require(_0x0c12('0xd'))(new Redis(config[_0x0c12('0xb')]));require('./mailQueue.socket')[_0x0c12('0xe')](socket);function respondWithRpcPromise(_0x1ed5d1,_0x16d534,_0x5a5bf0){return new BPromise(function(_0x50314b,_0x41a977){return client[_0x0c12('0xf')](_0x1ed5d1,_0x5a5bf0)[_0x0c12('0x10')](function(_0x555e27){logger[_0x0c12('0x11')](_0x0c12('0x12'),_0x16d534,_0x0c12('0x13'));logger[_0x0c12('0x14')](_0x0c12('0x15'),_0x16d534,_0x0c12('0x13'),JSON[_0x0c12('0x16')](_0x555e27));if(_0x555e27[_0x0c12('0x17')]){if(_0x555e27[_0x0c12('0x17')][_0x0c12('0x18')]===0x1f4){logger[_0x0c12('0x17')](_0x0c12('0x12'),_0x16d534,_0x555e27[_0x0c12('0x17')][_0x0c12('0x19')]);return _0x41a977(_0x555e27[_0x0c12('0x17')]['message']);}logger[_0x0c12('0x17')]('MailQueue,\x20%s,\x20%s',_0x16d534,_0x555e27[_0x0c12('0x17')][_0x0c12('0x19')]);return _0x50314b(_0x555e27['error'][_0x0c12('0x19')]);}else{logger[_0x0c12('0x11')](_0x0c12('0x12'),_0x16d534,_0x0c12('0x13'));_0x50314b(_0x555e27['result'][_0x0c12('0x19')]);}})[_0x0c12('0x1a')](function(_0x284744){logger['error'](_0x0c12('0x12'),_0x16d534,_0x284744);_0x41a977(_0x284744);});});}exports[_0x0c12('0x1b')]=function(_0x5aa3d9){var _0x22510f=this;return new Promise(function(_0x4bd4fe,_0xee9a13){return db[_0x0c12('0x1c')]['findAll']({'raw':_0x5aa3d9[_0x0c12('0x1d')]?_0x5aa3d9[_0x0c12('0x1d')][_0x0c12('0x1e')]===undefined?!![]:![]:!![],'where':_0x5aa3d9[_0x0c12('0x1d')]?_0x5aa3d9[_0x0c12('0x1d')][_0x0c12('0x1f')]||null:null,'attributes':_0x5aa3d9[_0x0c12('0x1d')]?_0x5aa3d9[_0x0c12('0x1d')][_0x0c12('0x20')]||null:null,'limit':_0x5aa3d9[_0x0c12('0x1d')]?_0x5aa3d9['options'][_0x0c12('0x21')]||null:null,'include':_0x5aa3d9[_0x0c12('0x1d')]?_0x5aa3d9[_0x0c12('0x1d')]['include']?_['map'](_0x5aa3d9[_0x0c12('0x1d')][_0x0c12('0x22')],function(_0x245504){return{'model':db[_0x245504['model']],'as':_0x245504['as'],'attributes':_0x245504[_0x0c12('0x20')],'include':_0x245504[_0x0c12('0x22')]?_[_0x0c12('0x23')](_0x245504['include'],function(_0x58bf46){return{'model':db[_0x58bf46[_0x0c12('0x24')]],'as':_0x58bf46['as'],'attributes':_0x58bf46[_0x0c12('0x20')],'include':_0x58bf46[_0x0c12('0x22')]?_['map'](_0x58bf46[_0x0c12('0x22')],function(_0x3aa713){return{'model':db[_0x3aa713[_0x0c12('0x24')]],'as':_0x3aa713['as'],'attributes':_0x3aa713[_0x0c12('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0c12('0x10')](function(_0x292891){logger[_0x0c12('0x11')]('GetMailQueue',_0x5aa3d9);logger[_0x0c12('0x14')](_0x0c12('0x1b'),_0x5aa3d9,JSON[_0x0c12('0x16')](_0x292891));_0x4bd4fe(_0x292891);})[_0x0c12('0x1a')](function(_0x5b34b0){logger[_0x0c12('0x17')](_0x0c12('0x1b'),_0x5b34b0[_0x0c12('0x19')],_0x5aa3d9);_0xee9a13(_0x22510f[_0x0c12('0x17')](0x1f4,_0x5b34b0[_0x0c12('0x19')]));});});};exports[_0x0c12('0x25')]=function(_0x4f9e58){var _0x5abb9f=this;return new Promise(function(_0x88a7b4,_0x4d476f){return db['MailQueue'][_0x0c12('0x26')]({'raw':_0x4f9e58[_0x0c12('0x1d')]?_0x4f9e58[_0x0c12('0x1d')][_0x0c12('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f9e58[_0x0c12('0x1d')]?_0x4f9e58['options'][_0x0c12('0x1f')]||null:null,'attributes':_0x4f9e58[_0x0c12('0x1d')]?_0x4f9e58['options'][_0x0c12('0x20')]||null:null,'include':_0x4f9e58['options']?_0x4f9e58[_0x0c12('0x1d')][_0x0c12('0x22')]?_['map'](_0x4f9e58['options']['include'],function(_0x74e134){return{'model':db[_0x74e134[_0x0c12('0x24')]],'as':_0x74e134['as'],'attributes':_0x74e134[_0x0c12('0x20')],'include':_0x74e134['include']?_['map'](_0x74e134['include'],function(_0x5f274c){return{'model':db[_0x5f274c[_0x0c12('0x24')]],'as':_0x5f274c['as'],'attributes':_0x5f274c['attributes'],'include':_0x5f274c[_0x0c12('0x22')]?_[_0x0c12('0x23')](_0x5f274c[_0x0c12('0x22')],function(_0x5df9a0){return{'model':db[_0x5df9a0['model']],'as':_0x5df9a0['as'],'attributes':_0x5df9a0[_0x0c12('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0c12('0x10')](function(_0x51da9f){logger[_0x0c12('0x11')](_0x0c12('0x25'),_0x4f9e58);logger[_0x0c12('0x14')](_0x0c12('0x25'),_0x4f9e58,JSON[_0x0c12('0x16')](_0x51da9f));_0x88a7b4(_0x51da9f);})[_0x0c12('0x1a')](function(_0x182b97){logger['error'](_0x0c12('0x25'),_0x182b97['message'],_0x4f9e58);_0x4d476f(_0x5abb9f['error'](0x1f4,_0x182b97[_0x0c12('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d72cb8c..a6e12d7 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 _0xff8d=['remove','emit','removeListener','register','length','mailQueue:','save'];(function(_0x45d4f4,_0x5d7be9){var _0x41856e=function(_0x171e14){while(--_0x171e14){_0x45d4f4['push'](_0x45d4f4['shift']());}};_0x41856e(++_0x5d7be9);}(_0xff8d,0x7d));var _0xdff8=function(_0x118823,_0xa96d91){_0x118823=_0x118823-0x0;var _0x402664=_0xff8d[_0x118823];return _0x402664;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xdff8('0x0'),_0xdff8('0x1'),'update'];function createListener(_0x5326ad,_0x392931){return function(_0x16ef22){_0x392931[_0xdff8('0x2')](_0x5326ad,_0x16ef22);};}function removeListener(_0x37ad59,_0x56196d){return function(){MailQueueEvents[_0xdff8('0x3')](_0x37ad59,_0x56196d);};}exports[_0xdff8('0x4')]=function(_0xdaf0a3){for(var _0x42a72c=0x0,_0xa983d1=events[_0xdff8('0x5')];_0x42a72c<_0xa983d1;_0x42a72c++){var _0x8b8fee=events[_0x42a72c];var _0x110d9e=createListener(_0xdff8('0x6')+_0x8b8fee,_0xdaf0a3);MailQueueEvents['on'](_0x8b8fee,_0x110d9e);}}; \ No newline at end of file +var _0x5b89=['removeListener','length','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5b89,0x1a3));var _0x95b8=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x5b89[_0x1477ef];return _0x164acd;};'use strict';var MailQueueEvents=require(_0x95b8('0x0'));var events=[_0x95b8('0x1'),_0x95b8('0x2'),_0x95b8('0x3')];function createListener(_0x49735c,_0x1b9111){return function(_0x23fffa){_0x1b9111[_0x95b8('0x4')](_0x49735c,_0x23fffa);};}function removeListener(_0x481368,_0x14f594){return function(){MailQueueEvents[_0x95b8('0x5')](_0x481368,_0x14f594);};}exports['register']=function(_0x510d28){for(var _0x37851d=0x0,_0x3c1f00=events[_0x95b8('0x6')];_0x37851d<_0x3c1f00;_0x37851d++){var _0x4cafe9=events[_0x37851d];var _0x11bc92=createListener(_0x95b8('0x7')+_0x4cafe9,_0x510d28);MailQueueEvents['on'](_0x4cafe9,_0x11bc92);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0822486..339947e 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 _0x9675=['multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports'];(function(_0x8e55f3,_0x4ada75){var _0x22a439=function(_0x35f9aa){while(--_0x35f9aa){_0x8e55f3['push'](_0x8e55f3['shift']());}};_0x22a439(++_0x4ada75);}(_0x9675,0x1b5));var _0x5967=function(_0x52316a,_0x2e1bd0){_0x52316a=_0x52316a-0x0;var _0x47dbd2=_0x9675[_0x52316a];return _0x47dbd2;};'use strict';var multer=require(_0x5967('0x0'));var util=require('util');var path=require(_0x5967('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5967('0x2'));var auth=require(_0x5967('0x3'));var interaction=require(_0x5967('0x4'));var config=require('../../config/environment');var controller=require(_0x5967('0x5'));router[_0x5967('0x6')]('/',auth['isAuthenticated'](),controller[_0x5967('0x7')]);router[_0x5967('0x6')](_0x5967('0x8'),auth['isAuthenticated'](),controller[_0x5967('0x9')]);router[_0x5967('0x6')](_0x5967('0xa'),auth[_0x5967('0xb')](),controller[_0x5967('0xc')]);router['post']('/',auth[_0x5967('0xb')](),controller[_0x5967('0xd')]);router[_0x5967('0xe')](_0x5967('0xa'),auth[_0x5967('0xb')](),controller[_0x5967('0xf')]);router[_0x5967('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5967('0x11')]);module[_0x5967('0x12')]=router; \ No newline at end of file +var _0x48ff=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','post','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x48ff,0x10b));var _0xf48f=function(_0x25887e,_0xc63665){_0x25887e=_0x25887e-0x0;var _0x4a2844=_0x48ff[_0x25887e];return _0x4a2844;};'use strict';var multer=require('multer');var util=require(_0xf48f('0x0'));var path=require('path');var timeout=require(_0xf48f('0x1'));var express=require('express');var router=express[_0xf48f('0x2')]();var fs_extra=require(_0xf48f('0x3'));var auth=require(_0xf48f('0x4'));var interaction=require(_0xf48f('0x5'));var config=require(_0xf48f('0x6'));var controller=require('./mailQueueReport.controller');router[_0xf48f('0x7')]('/',auth['isAuthenticated'](),controller[_0xf48f('0x8')]);router[_0xf48f('0x7')](_0xf48f('0x9'),auth[_0xf48f('0xa')](),controller['describe']);router[_0xf48f('0x7')](_0xf48f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf48f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf48f('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xf48f('0xe')]);router[_0xf48f('0xf')](_0xf48f('0xb'),auth[_0xf48f('0xa')](),controller[_0xf48f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 4eff2ad..a64900a 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 _0x7dcc=['sequelize','STRING','DATE','moment'];(function(_0x54b275,_0x439272){var _0x145f0c=function(_0x544bae){while(--_0x544bae){_0x54b275['push'](_0x54b275['shift']());}};_0x145f0c(++_0x439272);}(_0x7dcc,0xc3));var _0xc7dc=function(_0x54ece6,_0x11a6c6){_0x54ece6=_0x54ece6-0x0;var _0x2cfd35=_0x7dcc[_0x54ece6];return _0x2cfd35;};'use strict';var moment=require(_0xc7dc('0x0'));var Sequelize=require(_0xc7dc('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc7dc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc7dc('0x2')]},'joinAt':{'type':Sequelize[_0xc7dc('0x3')]},'leaveAt':{'type':Sequelize[_0xc7dc('0x3')]},'acceptAt':{'type':Sequelize[_0xc7dc('0x3')]},'exitAt':{'type':Sequelize[_0xc7dc('0x3')]},'reason':{'type':Sequelize[_0xc7dc('0x2')]}}; \ No newline at end of file +var _0xace9=['moment','exports','STRING','DATE'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xace9,0x148));var _0x9ace=function(_0x2d5ece,_0x2470c3){_0x2d5ece=_0x2d5ece-0x0;var _0x50edc4=_0xace9[_0x2d5ece];return _0x50edc4;};'use strict';var moment=require(_0x9ace('0x0'));var Sequelize=require('sequelize');module[_0x9ace('0x1')]={'uniqueid':{'type':Sequelize[_0x9ace('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9ace('0x2')]},'joinAt':{'type':Sequelize[_0x9ace('0x3')]},'leaveAt':{'type':Sequelize[_0x9ace('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9ace('0x3')]},'reason':{'type':Sequelize[_0x9ace('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 617531b..d6e9f44 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 _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','MailQueueReport','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x588280,_0x3844cd){var _0x9452e9=function(_0x4b7945){while(--_0x4b7945){_0x588280['push'](_0x588280['shift']());}};_0x9452e9(++_0x3844cd);}(_0xef0f,0x168));var _0xfef0=function(_0x57b57e,_0x3d89e8){_0x57b57e=_0x57b57e-0x0;var _0x48c809=_0xef0f[_0x57b57e];return _0x48c809;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['MailQueueReport']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':!![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file +var _0xcf2f=['sort','pick','where','merge','VIRTUAL','filter','options','MailQueueReport','includeAll','include','rows','catch','params','find','create','body','destroy','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x5aba56,_0x17f8bb){var _0x273611=function(_0x341702){while(--_0x341702){_0x5aba56['push'](_0x5aba56['shift']());}};_0x273611(++_0x17f8bb);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x60da79,_0x36320c){_0x60da79=_0x60da79-0x0;var _0x171ca0=_0xcf2f[_0x60da79];return _0x171ca0;};'use strict';var emlformat=require(_0xfcf2('0x0'));var rimraf=require(_0xfcf2('0x1'));var zipdir=require(_0xfcf2('0x2'));var jsonpatch=require(_0xfcf2('0x3'));var rp=require(_0xfcf2('0x4'));var moment=require('moment');var BPromise=require(_0xfcf2('0x5'));var Mustache=require(_0xfcf2('0x6'));var util=require(_0xfcf2('0x7'));var path=require(_0xfcf2('0x8'));var sox=require(_0xfcf2('0x9'));var csv=require(_0xfcf2('0xa'));var ejs=require(_0xfcf2('0xb'));var fs=require('fs');var fs_extra=require(_0xfcf2('0xc'));var _=require(_0xfcf2('0xd'));var squel=require(_0xfcf2('0xe'));var crypto=require(_0xfcf2('0xf'));var jsforce=require(_0xfcf2('0x10'));var deskjs=require(_0xfcf2('0x11'));var toCsv=require(_0xfcf2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcf2('0x12'));var qs=require(_0xfcf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcf2('0x14'));var logger=require(_0xfcf2('0x15'))(_0xfcf2('0x16'));var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfcf2('0x18'))['db'];function respondWithStatusCode(_0x1ba610,_0x175ac9){_0x175ac9=_0x175ac9||0xcc;return function(_0x1be8cc){if(_0x1be8cc){return _0x1ba610['sendStatus'](_0x175ac9);}return _0x1ba610[_0xfcf2('0x19')](_0x175ac9)['end']();};}function respondWithResult(_0x5b414a,_0x5dc04b){_0x5dc04b=_0x5dc04b||0xc8;return function(_0xc87ff4){if(_0xc87ff4){return _0x5b414a['status'](_0x5dc04b)[_0xfcf2('0x1a')](_0xc87ff4);}};}function respondWithFilteredResult(_0x1febf8,_0x245f9a){return function(_0x21f7d1){if(_0x21f7d1){var _0x315b2f=typeof _0x245f9a[_0xfcf2('0x1b')]===_0xfcf2('0x1c')&&typeof _0x245f9a['limit']===_0xfcf2('0x1c');var _0x213125=_0x21f7d1[_0xfcf2('0x1d')];var _0x581d78=_0x315b2f?0x0:_0x245f9a[_0xfcf2('0x1b')];var _0x1b3c89=_0x315b2f?_0x21f7d1[_0xfcf2('0x1d')]:_0x245f9a[_0xfcf2('0x1b')]+_0x245f9a[_0xfcf2('0x1e')];var _0x53c406;if(_0x1b3c89>=_0x213125){_0x1b3c89=_0x213125;_0x53c406=0xc8;}else{_0x53c406=0xce;}_0x1febf8[_0xfcf2('0x19')](_0x53c406);return _0x1febf8[_0xfcf2('0x1f')]('Content-Range',_0x581d78+'-'+_0x1b3c89+'/'+_0x213125)[_0xfcf2('0x1a')](_0x21f7d1);}return null;};}function patchUpdates(_0x23c079){return function(_0x206738){try{jsonpatch[_0xfcf2('0x20')](_0x206738,_0x23c079,!![]);}catch(_0x51e0b7){return BPromise[_0xfcf2('0x21')](_0x51e0b7);}return _0x206738[_0xfcf2('0x22')]();};}function saveUpdates(_0x422c5a,_0x1eeebd){return function(_0x5afab5){if(_0x5afab5){return _0x5afab5[_0xfcf2('0x23')](_0x422c5a)[_0xfcf2('0x24')](function(_0x232f6f){return _0x232f6f;});}return null;};}function removeEntity(_0x584e76,_0x26641a){return function(_0x151aa8){if(_0x151aa8){return _0x151aa8['destroy']()[_0xfcf2('0x24')](function(){_0x584e76[_0xfcf2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6f14,_0x26bfcc){return function(_0x1f0f07){if(!_0x1f0f07){_0x1e6f14[_0xfcf2('0x25')](0x194);}return _0x1f0f07;};}function handleError(_0x5bb384,_0x1deca3){_0x1deca3=_0x1deca3||0x1f4;return function(_0x448222){logger[_0xfcf2('0x26')](_0x448222[_0xfcf2('0x27')]);if(_0x448222[_0xfcf2('0x28')]){delete _0x448222[_0xfcf2('0x28')];}_0x5bb384[_0xfcf2('0x19')](_0x1deca3)[_0xfcf2('0x29')](_0x448222);};}exports[_0xfcf2('0x2a')]=function(_0x56f839,_0x4c2935){var _0x695f31={},_0x878504={},_0x3308c3={'count':0x0,'rows':[]};var _0x532db6=_[_0xfcf2('0x2b')](db['MailQueueReport'][_0xfcf2('0x2c')],function(_0x26651e){return{'name':_0x26651e[_0xfcf2('0x2d')],'type':_0x26651e[_0xfcf2('0x2e')][_0xfcf2('0x2f')]};});_0x878504[_0xfcf2('0x30')]=_[_0xfcf2('0x2b')](_0x532db6,'name');_0x878504['query']=_[_0xfcf2('0x31')](_0x56f839[_0xfcf2('0x32')]);_0x878504[_0xfcf2('0x33')]=_[_0xfcf2('0x34')](_0x878504['model'],_0x878504['query']);_0x695f31[_0xfcf2('0x35')]=_['intersection'](_0x878504[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x56f839['query'][_0xfcf2('0x36')]));_0x695f31[_0xfcf2('0x35')]=_0x695f31[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x695f31[_0xfcf2('0x35')]:_0x878504[_0xfcf2('0x30')];if(!_0x56f839[_0xfcf2('0x32')]['hasOwnProperty'](_0xfcf2('0x38'))){_0x695f31[_0xfcf2('0x1e')]=qs['limit'](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x1e')]);_0x695f31['offset']=qs[_0xfcf2('0x1b')](_0x56f839[_0xfcf2('0x32')]['offset']);}_0x695f31[_0xfcf2('0x39')]=qs[_0xfcf2('0x3a')](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3a')]);_0x695f31['where']=qs[_0xfcf2('0x33')](_[_0xfcf2('0x3b')](_0x56f839[_0xfcf2('0x32')],_0x878504[_0xfcf2('0x33')]),_0x532db6);if(_0x56f839[_0xfcf2('0x32')]['filter']){_0x695f31[_0xfcf2('0x3c')]=_[_0xfcf2('0x3d')](_0x695f31[_0xfcf2('0x3c')],{'$or':_[_0xfcf2('0x2b')](_0x532db6,function(_0x41cac2){if(_0x41cac2['type']!==_0xfcf2('0x3e')){var _0x4dfc61={};_0x4dfc61[_0x41cac2[_0xfcf2('0x28')]]={'$like':'%'+_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3f')]+'%'};return _0x4dfc61;}})});}_0x695f31=_[_0xfcf2('0x3d')]({},_0x695f31,_0x56f839[_0xfcf2('0x40')]);var _0x59b404={'where':_0x695f31[_0xfcf2('0x3c')]};return db[_0xfcf2('0x41')][_0xfcf2('0x1d')](_0x59b404)['then'](function(_0x1e8e71){_0x3308c3[_0xfcf2('0x1d')]=_0x1e8e71;if(_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x695f31[_0xfcf2('0x43')]=[{'all':!![]}];}return db[_0xfcf2('0x41')]['findAll'](_0x695f31);})['then'](function(_0x526c42){_0x3308c3[_0xfcf2('0x44')]=_0x526c42;return _0x3308c3;})[_0xfcf2('0x24')](respondWithFilteredResult(_0x4c2935,_0x695f31))[_0xfcf2('0x45')](handleError(_0x4c2935,null));};exports['show']=function(_0x559aea,_0x5efb5c){var _0x3fb288={'raw':!![],'where':{'id':_0x559aea[_0xfcf2('0x46')]['id']}},_0xab0747={};_0xab0747[_0xfcf2('0x30')]=_[_0xfcf2('0x31')](db[_0xfcf2('0x41')][_0xfcf2('0x2c')]);_0xab0747[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](_0x559aea[_0xfcf2('0x32')]);_0xab0747[_0xfcf2('0x33')]=_['intersection'](_0xab0747['model'],_0xab0747[_0xfcf2('0x32')]);_0x3fb288[_0xfcf2('0x35')]=_[_0xfcf2('0x34')](_0xab0747[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x3fb288[_0xfcf2('0x35')]=_0x3fb288[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x3fb288[_0xfcf2('0x35')]:_0xab0747[_0xfcf2('0x30')];if(_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x3fb288[_0xfcf2('0x43')]=[{'all':!![]}];}_0x3fb288=_[_0xfcf2('0x3d')]({},_0x3fb288,_0x559aea[_0xfcf2('0x40')]);return db['MailQueueReport'][_0xfcf2('0x47')](_0x3fb288)[_0xfcf2('0x24')](handleEntityNotFound(_0x5efb5c,null))['then'](respondWithResult(_0x5efb5c,null))[_0xfcf2('0x45')](handleError(_0x5efb5c,null));};exports['create']=function(_0x12eef4,_0xe85e89){return db[_0xfcf2('0x41')][_0xfcf2('0x48')](_0x12eef4['body'],{})['then'](respondWithResult(_0xe85e89,0xc9))['catch'](handleError(_0xe85e89,null));};exports[_0xfcf2('0x23')]=function(_0x37d4bb,_0x20fcab){if(_0x37d4bb[_0xfcf2('0x49')]['id']){delete _0x37d4bb['body']['id'];}return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x37d4bb[_0xfcf2('0x46')]['id']}})['then'](handleEntityNotFound(_0x20fcab,null))[_0xfcf2('0x24')](saveUpdates(_0x37d4bb[_0xfcf2('0x49')],null))[_0xfcf2('0x24')](respondWithResult(_0x20fcab,null))[_0xfcf2('0x45')](handleError(_0x20fcab,null));};exports[_0xfcf2('0x4a')]=function(_0x4af270,_0x4c14d){return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x4af270[_0xfcf2('0x46')]['id']}})[_0xfcf2('0x24')](handleEntityNotFound(_0x4c14d,null))[_0xfcf2('0x24')](removeEntity(_0x4c14d,null))['catch'](handleError(_0x4c14d,null));};exports['describe']=function(_0x4aa02f,_0x37c8b4){return db[_0xfcf2('0x41')]['describe']()['then'](respondWithResult(_0x37c8b4,null))[_0xfcf2('0x45')](handleError(_0x37c8b4,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 06ed9fe..186b614 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 _0xee9c=['path','rimraf','exports','define','MailQueueReport','uniqueid','util','../../config/logger','api','moment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xee9c,0x1e6));var _0xcee9=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xee9c[_0x531d15];return _0x271a18;};'use strict';var _=require('lodash');var util=require(_0xcee9('0x0'));var logger=require(_0xcee9('0x1'))(_0xcee9('0x2'));var moment=require(_0xcee9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcee9('0x4'));var rimraf=require(_0xcee9('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xcee9('0x6')]=function(_0x547ea0,_0x2e438b){return _0x547ea0[_0xcee9('0x7')](_0xcee9('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcee9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc769=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport'];(function(_0x59888f,_0x502d13){var _0x53c519=function(_0x505686){while(--_0x505686){_0x59888f['push'](_0x59888f['shift']());}};_0x53c519(++_0x502d13);}(_0xc769,0x1ef));var _0x9c76=function(_0x11b329,_0x3679ef){_0x11b329=_0x11b329-0x0;var _0x1d61b=_0xc769[_0x11b329];return _0x1d61b;};'use strict';var _=require(_0x9c76('0x0'));var util=require(_0x9c76('0x1'));var logger=require(_0x9c76('0x2'))(_0x9c76('0x3'));var moment=require(_0x9c76('0x4'));var BPromise=require(_0x9c76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c76('0x6'));var rimraf=require(_0x9c76('0x7'));var config=require(_0x9c76('0x8'));var attributes=require(_0x9c76('0x9'));module['exports']=function(_0xac5371,_0x2bd3c9){return _0xac5371[_0x9c76('0xa')](_0x9c76('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x9c76('0xc'),'fields':[_0x9c76('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index bba4310..110b59e 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c920f,_0x54ff2c){var _0x56e0d8=function(_0x34e7d8){while(--_0x34e7d8){_0x2c920f['push'](_0x2c920f['shift']());}};_0x56e0d8(++_0x54ff2c);}(_0x1261,0x144));var _0x1126=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x1261[_0x20b29c];return _0x20d81b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x306226,_0x13046a){var _0x4b520c=function(_0xed529e){while(--_0xed529e){_0x306226['push'](_0x306226['shift']());}};_0x4b520c(++_0x13046a);}(_0x1261,0x144));var _0x1126=function(_0x5d815b,_0x4c422d){_0x5d815b=_0x5d815b-0x0;var _0x5440a9=_0x1261[_0x5d815b];return _0x5440a9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 6c65517..f2297cf 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4a1c92,_0x519cb7){var _0x40c266=function(_0x29da48){while(--_0x29da48){_0x4a1c92['push'](_0x4a1c92['shift']());}};_0x40c266(++_0x519cb7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xd27806,_0x1cb8dd){var _0x2f81cc=function(_0x250ed0){while(--_0x250ed0){_0xd27806['push'](_0xd27806['shift']());}};_0x2f81cc(++_0x1cb8dd);}(_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 df91e37..b6afe68 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 _0x89e8=['STRING','BOOLEAN','INTEGER','INBOX','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x89e8,0xf4));var _0x889e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x89e8[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x889e('0x0')]={'description':{'type':Sequelize[_0x889e('0x1')]},'host':{'type':Sequelize[_0x889e('0x1')]},'authentication':{'type':Sequelize[_0x889e('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x889e('0x1')]},'port':{'type':Sequelize[_0x889e('0x3')]},'tls':{'type':Sequelize[_0x889e('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x889e('0x1')],'defaultValue':_0x889e('0x4')},'connTimeout':{'type':Sequelize[_0x889e('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x889e('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x889e('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x28c3=['INTEGER','INBOX','STRING','BOOLEAN'];(function(_0x1612d6,_0x5577bf){var _0x27a583=function(_0x3dc4a2){while(--_0x3dc4a2){_0x1612d6['push'](_0x1612d6['shift']());}};_0x27a583(++_0x5577bf);}(_0x28c3,0x1a6));var _0x328c=function(_0x104a72,_0x2b73f2){_0x104a72=_0x104a72-0x0;var _0x3f0552=_0x28c3[_0x104a72];return _0x3f0552;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x328c('0x0')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x328c('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x328c('0x0')]},'password':{'type':Sequelize[_0x328c('0x0')]},'port':{'type':Sequelize[_0x328c('0x2')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x328c('0x3')},'connTimeout':{'type':Sequelize[_0x328c('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x328c('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x328c('0x0')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 83cd629..ee52a32 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 _0xfc86=['./mailServerIn.attributes','exports','mail_servers_in','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x2b7c5f,_0x2cd24c){var _0x373651=function(_0x31324a){while(--_0x31324a){_0x2b7c5f['push'](_0x2b7c5f['shift']());}};_0x373651(++_0x2cd24c);}(_0xfc86,0x14d));var _0x6fc8=function(_0x4e7ae5,_0x407167){_0x4e7ae5=_0x4e7ae5-0x0;var _0x14d181=_0xfc86[_0x4e7ae5];return _0x14d181;};'use strict';var _=require('lodash');var util=require(_0x6fc8('0x0'));var logger=require(_0x6fc8('0x1'))(_0x6fc8('0x2'));var moment=require(_0x6fc8('0x3'));var BPromise=require(_0x6fc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6fc8('0x5'));var config=require(_0x6fc8('0x6'));var attributes=require(_0x6fc8('0x7'));module[_0x6fc8('0x8')]=function(_0x76d3d8,_0x372ba7){return _0x76d3d8['define']('MailServerIn',attributes,{'tableName':_0x6fc8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33dd=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util'];(function(_0x4fe26e,_0x20a0c7){var _0x187315=function(_0x21f5aa){while(--_0x21f5aa){_0x4fe26e['push'](_0x4fe26e['shift']());}};_0x187315(++_0x20a0c7);}(_0x33dd,0x1ab));var _0xd33d=function(_0x1ed678,_0x5ff62d){_0x1ed678=_0x1ed678-0x0;var _0x3df817=_0x33dd[_0x1ed678];return _0x3df817;};'use strict';var _=require(_0xd33d('0x0'));var util=require(_0xd33d('0x1'));var logger=require(_0xd33d('0x2'))(_0xd33d('0x3'));var moment=require(_0xd33d('0x4'));var BPromise=require(_0xd33d('0x5'));var rp=require(_0xd33d('0x6'));var fs=require('fs');var path=require(_0xd33d('0x7'));var rimraf=require('rimraf');var config=require(_0xd33d('0x8'));var attributes=require(_0xd33d('0x9'));module[_0xd33d('0xa')]=function(_0x238e29,_0x2875d8){return _0x238e29['define'](_0xd33d('0xb'),attributes,{'tableName':_0xd33d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 39a81c5..1db11f5 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 _0xe3db=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xe3db,0xc8));var _0xbe3d=function(_0x41efb3,_0xd798df){_0x41efb3=_0x41efb3-0x0;var _0xcb88a0=_0xe3db[_0x41efb3];return _0xcb88a0;};'use strict';var _=require(_0xbe3d('0x0'));var util=require(_0xbe3d('0x1'));var moment=require('moment');var BPromise=require(_0xbe3d('0x2'));var rs=require(_0xbe3d('0x3'));var fs=require('fs');var Redis=require(_0xbe3d('0x4'));var db=require(_0xbe3d('0x5'))['db'];var utils=require(_0xbe3d('0x6'));var logger=require(_0xbe3d('0x7'))(_0xbe3d('0x8'));var config=require(_0xbe3d('0x9'));var jayson=require(_0xbe3d('0xa'));var client=jayson[_0xbe3d('0xb')][_0xbe3d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c255b,_0x314709,_0x90d1ab){return new BPromise(function(_0x24136a,_0x37e7c0){return client['request'](_0x4c255b,_0x90d1ab)[_0xbe3d('0xd')](function(_0x2aa8ff){logger['info']('MailServerIn,\x20%s,\x20%s',_0x314709,_0xbe3d('0xe'));logger[_0xbe3d('0xf')](_0xbe3d('0x10'),_0x314709,_0xbe3d('0xe'),JSON[_0xbe3d('0x11')](_0x2aa8ff));if(_0x2aa8ff[_0xbe3d('0x12')]){if(_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x13')]===0x1f4){logger[_0xbe3d('0x12')](_0xbe3d('0x14'),_0x314709,_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);return _0x37e7c0(_0x2aa8ff['error'][_0xbe3d('0x15')]);}logger[_0xbe3d('0x12')](_0xbe3d('0x14'),_0x314709,_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);return _0x24136a(_0x2aa8ff[_0xbe3d('0x12')][_0xbe3d('0x15')]);}else{logger[_0xbe3d('0x16')](_0xbe3d('0x14'),_0x314709,_0xbe3d('0xe'));_0x24136a(_0x2aa8ff[_0xbe3d('0x17')][_0xbe3d('0x15')]);}})[_0xbe3d('0x18')](function(_0x3f8630){logger['error'](_0xbe3d('0x14'),_0x314709,_0x3f8630);_0x37e7c0(_0x3f8630);});});}exports[_0xbe3d('0x19')]=function(_0x1a5ab3){var _0xaacdf8=this;return new Promise(function(_0x3cf995,_0x1a35af){return db[_0xbe3d('0x1a')][_0xbe3d('0x1b')]({'raw':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3['options'][_0xbe3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3[_0xbe3d('0x1c')][_0xbe3d('0x1e')]||null:null,'attributes':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3[_0xbe3d('0x1c')][_0xbe3d('0x1f')]||null:null,'limit':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3[_0xbe3d('0x1c')][_0xbe3d('0x20')]||null:null,'include':_0x1a5ab3[_0xbe3d('0x1c')]?_0x1a5ab3['options'][_0xbe3d('0x21')]?_[_0xbe3d('0x22')](_0x1a5ab3['options'][_0xbe3d('0x21')],function(_0x4b755a){return{'model':db[_0x4b755a[_0xbe3d('0x23')]],'as':_0x4b755a['as'],'attributes':_0x4b755a[_0xbe3d('0x1f')],'include':_0x4b755a['include']?_[_0xbe3d('0x22')](_0x4b755a[_0xbe3d('0x21')],function(_0x39c4d2){return{'model':db[_0x39c4d2[_0xbe3d('0x23')]],'as':_0x39c4d2['as'],'attributes':_0x39c4d2[_0xbe3d('0x1f')],'include':_0x39c4d2[_0xbe3d('0x21')]?_[_0xbe3d('0x22')](_0x39c4d2[_0xbe3d('0x21')],function(_0x446403){return{'model':db[_0x446403['model']],'as':_0x446403['as'],'attributes':_0x446403[_0xbe3d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2738c7){logger['info'](_0xbe3d('0x19'),_0x1a5ab3);logger['debug'](_0xbe3d('0x19'),_0x1a5ab3,JSON[_0xbe3d('0x11')](_0x2738c7));_0x3cf995(_0x2738c7);})[_0xbe3d('0x18')](function(_0xd349f1){logger[_0xbe3d('0x12')](_0xbe3d('0x19'),_0xd349f1[_0xbe3d('0x15')],_0x1a5ab3);_0x1a35af(_0xaacdf8['error'](0x1f4,_0xd349f1[_0xbe3d('0x15')]));});});}; \ No newline at end of file +var _0xf0cc=['request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetMailServerIn','lodash','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x40a6fa,_0x14acdd){_0x40a6fa=_0x40a6fa-0x0;var _0x2902fa=_0xf0cc[_0x40a6fa];return _0x2902fa;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf0c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf0c('0x2'))['db'];var utils=require(_0xcf0c('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf0c('0x4'));var jayson=require(_0xcf0c('0x5'));var client=jayson[_0xcf0c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x346cb0,_0x1503f6,_0x2cb15a){return new BPromise(function(_0x5d4cdb,_0x54cef0){return client[_0xcf0c('0x7')](_0x346cb0,_0x2cb15a)['then'](function(_0x289e0d){logger['info'](_0xcf0c('0x8'),_0x1503f6,_0xcf0c('0x9'));logger[_0xcf0c('0xa')](_0xcf0c('0xb'),_0x1503f6,_0xcf0c('0x9'),JSON[_0xcf0c('0xc')](_0x289e0d));if(_0x289e0d[_0xcf0c('0xd')]){if(_0x289e0d['error'][_0xcf0c('0xe')]===0x1f4){logger[_0xcf0c('0xd')](_0xcf0c('0x8'),_0x1503f6,_0x289e0d[_0xcf0c('0xd')][_0xcf0c('0xf')]);return _0x54cef0(_0x289e0d['error'][_0xcf0c('0xf')]);}logger[_0xcf0c('0xd')](_0xcf0c('0x8'),_0x1503f6,_0x289e0d['error']['message']);return _0x5d4cdb(_0x289e0d[_0xcf0c('0xd')]['message']);}else{logger[_0xcf0c('0x10')](_0xcf0c('0x8'),_0x1503f6,'request\x20sent');_0x5d4cdb(_0x289e0d['result']['message']);}})[_0xcf0c('0x11')](function(_0x5b4f26){logger[_0xcf0c('0xd')](_0xcf0c('0x8'),_0x1503f6,_0x5b4f26);_0x54cef0(_0x5b4f26);});});}exports['GetMailServerIn']=function(_0x48766e){var _0x244ece=this;return new Promise(function(_0x3c43e5,_0x3c297c){return db['MailServerIn'][_0xcf0c('0x12')]({'raw':_0x48766e[_0xcf0c('0x13')]?_0x48766e[_0xcf0c('0x13')][_0xcf0c('0x14')]===undefined?!![]:![]:!![],'where':_0x48766e[_0xcf0c('0x13')]?_0x48766e[_0xcf0c('0x13')][_0xcf0c('0x15')]||null:null,'attributes':_0x48766e[_0xcf0c('0x13')]?_0x48766e['options'][_0xcf0c('0x16')]||null:null,'limit':_0x48766e[_0xcf0c('0x13')]?_0x48766e['options'][_0xcf0c('0x17')]||null:null,'include':_0x48766e[_0xcf0c('0x13')]?_0x48766e[_0xcf0c('0x13')][_0xcf0c('0x18')]?_[_0xcf0c('0x19')](_0x48766e[_0xcf0c('0x13')][_0xcf0c('0x18')],function(_0xbdf266){return{'model':db[_0xbdf266[_0xcf0c('0x1a')]],'as':_0xbdf266['as'],'attributes':_0xbdf266['attributes'],'include':_0xbdf266[_0xcf0c('0x18')]?_['map'](_0xbdf266[_0xcf0c('0x18')],function(_0x39f5e0){return{'model':db[_0x39f5e0[_0xcf0c('0x1a')]],'as':_0x39f5e0['as'],'attributes':_0x39f5e0['attributes'],'include':_0x39f5e0['include']?_[_0xcf0c('0x19')](_0x39f5e0[_0xcf0c('0x18')],function(_0x45ca82){return{'model':db[_0x45ca82[_0xcf0c('0x1a')]],'as':_0x45ca82['as'],'attributes':_0x45ca82[_0xcf0c('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcf0c('0x1b')](function(_0x3b38d9){logger['info'](_0xcf0c('0x1c'),_0x48766e);logger[_0xcf0c('0xa')](_0xcf0c('0x1c'),_0x48766e,JSON[_0xcf0c('0xc')](_0x3b38d9));_0x3c43e5(_0x3b38d9);})['catch'](function(_0x56da28){logger['error']('GetMailServerIn',_0x56da28[_0xcf0c('0xf')],_0x48766e);_0x3c297c(_0x244ece[_0xcf0c('0xd')](0x1f4,_0x56da28[_0xcf0c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 874ae63..465dded 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7a54,0x106));var _0x47a5=function(_0x36f112,_0x2b45a7){_0x36f112=_0x36f112-0x0;var _0x4f90bc=_0x7a54[_0x36f112];return _0x4f90bc;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 10dc6d9..38d8674 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 _0x6f7a=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x10bb83,_0xcfd6a9){_0x10bb83=_0x10bb83-0x0;var _0xf6e07b=_0x6f7a[_0x10bb83];return _0xf6e07b;};'use strict';var Sequelize=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]={'description':{'type':Sequelize[_0xa6f7('0x2')]},'host':{'type':Sequelize[_0xa6f7('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xa6f7('0x2')]},'port':{'type':Sequelize[_0xa6f7('0x3')]},'secure':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xa6f7('0x2')]},'authentication':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xa6f7('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7072=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7072,0x138));var _0x2707=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7072[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'description':{'type':Sequelize[_0x2707('0x1')]},'host':{'type':Sequelize[_0x2707('0x1')]},'user':{'type':Sequelize[_0x2707('0x1')]},'pass':{'type':Sequelize[_0x2707('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x2707('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2707('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 3cdbc7f..e92900a 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 _0xebe6=['pick','merge','type','VIRTUAL','filter','options','MailServerOut','findAll','rows','catch','show','params','include','find','create','body','eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters'];(function(_0x3823d9,_0x31618e){var _0x3f3863=function(_0x33c256){while(--_0x33c256){_0x3823d9['push'](_0x3823d9['shift']());}};_0x3f3863(++_0x31618e);}(_0xebe6,0x96));var _0x6ebe=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0xebe6[_0x1ebe2f];return _0xdeb06f;};'use strict';var emlformat=require(_0x6ebe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ebe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ebe('0x2'));var util=require('util');var path=require(_0x6ebe('0x3'));var sox=require('sox');var csv=require(_0x6ebe('0x4'));var ejs=require(_0x6ebe('0x5'));var fs=require('fs');var fs_extra=require(_0x6ebe('0x6'));var _=require(_0x6ebe('0x7'));var squel=require('squel');var crypto=require(_0x6ebe('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ebe('0x4'));var querystring=require('querystring');var Papa=require(_0x6ebe('0x9'));var Redis=require(_0x6ebe('0xa'));var authService=require(_0x6ebe('0xb'));var qs=require(_0x6ebe('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ebe('0xd'))(_0x6ebe('0xe'));var utils=require(_0x6ebe('0xf'));var config=require(_0x6ebe('0x10'));var licenseUtil=require(_0x6ebe('0x11'));var db=require(_0x6ebe('0x12'))['db'];function respondWithStatusCode(_0x50d9ec,_0x499ed7){_0x499ed7=_0x499ed7||0xcc;return function(_0x5dca4f){if(_0x5dca4f){return _0x50d9ec['sendStatus'](_0x499ed7);}return _0x50d9ec[_0x6ebe('0x13')](_0x499ed7)[_0x6ebe('0x14')]();};}function respondWithResult(_0x577ccd,_0x31b00c){_0x31b00c=_0x31b00c||0xc8;return function(_0x4e0611){if(_0x4e0611){return _0x577ccd[_0x6ebe('0x13')](_0x31b00c)[_0x6ebe('0x15')](_0x4e0611);}};}function respondWithFilteredResult(_0x15b7a1,_0x2fd11d){return function(_0x8a6cc3){if(_0x8a6cc3){var _0x4c00ca=typeof _0x2fd11d[_0x6ebe('0x16')]===_0x6ebe('0x17')&&typeof _0x2fd11d[_0x6ebe('0x18')]===_0x6ebe('0x17');var _0x107165=_0x8a6cc3['count'];var _0x23e330=_0x4c00ca?0x0:_0x2fd11d[_0x6ebe('0x16')];var _0x3aa50b=_0x4c00ca?_0x8a6cc3[_0x6ebe('0x19')]:_0x2fd11d[_0x6ebe('0x16')]+_0x2fd11d['limit'];var _0x2a228a;if(_0x3aa50b>=_0x107165){_0x3aa50b=_0x107165;_0x2a228a=0xc8;}else{_0x2a228a=0xce;}_0x15b7a1[_0x6ebe('0x13')](_0x2a228a);return _0x15b7a1[_0x6ebe('0x1a')](_0x6ebe('0x1b'),_0x23e330+'-'+_0x3aa50b+'/'+_0x107165)[_0x6ebe('0x15')](_0x8a6cc3);}return null;};}function patchUpdates(_0xac1dcd){return function(_0x1914fe){try{jsonpatch[_0x6ebe('0x1c')](_0x1914fe,_0xac1dcd,!![]);}catch(_0x43a0f3){return BPromise[_0x6ebe('0x1d')](_0x43a0f3);}return _0x1914fe[_0x6ebe('0x1e')]();};}function saveUpdates(_0x51c3af,_0x2c3964){return function(_0xc74ef0){if(_0xc74ef0){return _0xc74ef0[_0x6ebe('0x1f')](_0x51c3af)[_0x6ebe('0x20')](function(_0x43145e){return _0x43145e;});}return null;};}function removeEntity(_0x5d6e19,_0x4df4ba){return function(_0x4e2734){if(_0x4e2734){return _0x4e2734[_0x6ebe('0x21')]()[_0x6ebe('0x20')](function(){_0x5d6e19[_0x6ebe('0x13')](0xcc)[_0x6ebe('0x14')]();});}};}function handleEntityNotFound(_0x439454,_0x3fc80e){return function(_0x4c5a62){if(!_0x4c5a62){_0x439454['sendStatus'](0x194);}return _0x4c5a62;};}function handleError(_0x196f4f,_0x62b838){_0x62b838=_0x62b838||0x1f4;return function(_0x438cbd){logger['error'](_0x438cbd[_0x6ebe('0x22')]);if(_0x438cbd[_0x6ebe('0x23')]){delete _0x438cbd[_0x6ebe('0x23')];}_0x196f4f[_0x6ebe('0x13')](_0x62b838)[_0x6ebe('0x24')](_0x438cbd);};}exports[_0x6ebe('0x25')]=function(_0x416fbb,_0x2574ad){var _0x48e931={},_0xf53829={},_0x1c38c9={'count':0x0,'rows':[]};var _0x25b1ec=_[_0x6ebe('0x26')](db['MailServerOut']['rawAttributes'],function(_0x589736){return{'name':_0x589736['fieldName'],'type':_0x589736['type'][_0x6ebe('0x27')]};});_0xf53829[_0x6ebe('0x28')]=_['map'](_0x25b1ec,_0x6ebe('0x23'));_0xf53829[_0x6ebe('0x29')]=_[_0x6ebe('0x2a')](_0x416fbb[_0x6ebe('0x29')]);_0xf53829['filters']=_['intersection'](_0xf53829['model'],_0xf53829['query']);_0x48e931[_0x6ebe('0x2b')]=_[_0x6ebe('0x2c')](_0xf53829['model'],qs['fields'](_0x416fbb['query'][_0x6ebe('0x2d')]));_0x48e931[_0x6ebe('0x2b')]=_0x48e931[_0x6ebe('0x2b')][_0x6ebe('0x2e')]?_0x48e931[_0x6ebe('0x2b')]:_0xf53829[_0x6ebe('0x28')];if(!_0x416fbb[_0x6ebe('0x29')]['hasOwnProperty']('nolimit')){_0x48e931[_0x6ebe('0x18')]=qs[_0x6ebe('0x18')](_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x18')]);_0x48e931[_0x6ebe('0x16')]=qs[_0x6ebe('0x16')](_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x16')]);}_0x48e931[_0x6ebe('0x2f')]=qs[_0x6ebe('0x30')](_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x30')]);_0x48e931[_0x6ebe('0x31')]=qs[_0x6ebe('0x32')](_[_0x6ebe('0x33')](_0x416fbb[_0x6ebe('0x29')],_0xf53829[_0x6ebe('0x32')]),_0x25b1ec);if(_0x416fbb[_0x6ebe('0x29')]['filter']){_0x48e931[_0x6ebe('0x31')]=_[_0x6ebe('0x34')](_0x48e931[_0x6ebe('0x31')],{'$or':_[_0x6ebe('0x26')](_0x25b1ec,function(_0x1b1397){if(_0x1b1397[_0x6ebe('0x35')]!==_0x6ebe('0x36')){var _0x4fb82f={};_0x4fb82f[_0x1b1397[_0x6ebe('0x23')]]={'$like':'%'+_0x416fbb[_0x6ebe('0x29')][_0x6ebe('0x37')]+'%'};return _0x4fb82f;}})});}_0x48e931=_[_0x6ebe('0x34')]({},_0x48e931,_0x416fbb[_0x6ebe('0x38')]);var _0x24f248={'where':_0x48e931['where']};return db[_0x6ebe('0x39')]['count'](_0x24f248)['then'](function(_0x522b8f){_0x1c38c9['count']=_0x522b8f;if(_0x416fbb[_0x6ebe('0x29')]['includeAll']){_0x48e931['include']=[{'all':!![]}];}return db[_0x6ebe('0x39')][_0x6ebe('0x3a')](_0x48e931);})['then'](function(_0xd9ce0c){_0x1c38c9[_0x6ebe('0x3b')]=_0xd9ce0c;return _0x1c38c9;})[_0x6ebe('0x20')](respondWithFilteredResult(_0x2574ad,_0x48e931))[_0x6ebe('0x3c')](handleError(_0x2574ad,null));};exports[_0x6ebe('0x3d')]=function(_0x241d51,_0x2ad3e2){var _0xb861fb={'raw':!![],'where':{'id':_0x241d51[_0x6ebe('0x3e')]['id']}},_0x53f0a8={};_0x53f0a8['model']=_[_0x6ebe('0x2a')](db['MailServerOut']['rawAttributes']);_0x53f0a8['query']=_['keys'](_0x241d51[_0x6ebe('0x29')]);_0x53f0a8[_0x6ebe('0x32')]=_[_0x6ebe('0x2c')](_0x53f0a8['model'],_0x53f0a8[_0x6ebe('0x29')]);_0xb861fb[_0x6ebe('0x2b')]=_['intersection'](_0x53f0a8[_0x6ebe('0x28')],qs[_0x6ebe('0x2d')](_0x241d51[_0x6ebe('0x29')][_0x6ebe('0x2d')]));_0xb861fb[_0x6ebe('0x2b')]=_0xb861fb[_0x6ebe('0x2b')][_0x6ebe('0x2e')]?_0xb861fb[_0x6ebe('0x2b')]:_0x53f0a8[_0x6ebe('0x28')];if(_0x241d51[_0x6ebe('0x29')]['includeAll']){_0xb861fb[_0x6ebe('0x3f')]=[{'all':!![]}];}_0xb861fb=_[_0x6ebe('0x34')]({},_0xb861fb,_0x241d51[_0x6ebe('0x38')]);return db[_0x6ebe('0x39')][_0x6ebe('0x40')](_0xb861fb)[_0x6ebe('0x20')](handleEntityNotFound(_0x2ad3e2,null))[_0x6ebe('0x20')](respondWithResult(_0x2ad3e2,null))['catch'](handleError(_0x2ad3e2,null));};exports[_0x6ebe('0x41')]=function(_0x42d817,_0x15b926){return db['MailServerOut'][_0x6ebe('0x41')](_0x42d817[_0x6ebe('0x42')],{})[_0x6ebe('0x20')](respondWithResult(_0x15b926,0xc9))[_0x6ebe('0x3c')](handleError(_0x15b926,null));};exports[_0x6ebe('0x1f')]=function(_0x28ccdd,_0x260e28){if(_0x28ccdd['body']['id']){delete _0x28ccdd[_0x6ebe('0x42')]['id'];}return db[_0x6ebe('0x39')][_0x6ebe('0x40')]({'where':{'id':_0x28ccdd['params']['id']}})[_0x6ebe('0x20')](handleEntityNotFound(_0x260e28,null))[_0x6ebe('0x20')](saveUpdates(_0x28ccdd[_0x6ebe('0x42')],null))[_0x6ebe('0x20')](respondWithResult(_0x260e28,null))['catch'](handleError(_0x260e28,null));};exports[_0x6ebe('0x21')]=function(_0x231e43,_0x2270c7){return db[_0x6ebe('0x39')][_0x6ebe('0x40')]({'where':{'id':_0x231e43['params']['id']}})['then'](handleEntityNotFound(_0x2270c7,null))[_0x6ebe('0x20')](removeEntity(_0x2270c7,null))['catch'](handleError(_0x2270c7,null));}; \ No newline at end of file +var _0x72b7=['options','includeAll','include','findAll','rows','catch','show','params','intersection','fields','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','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','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type'];(function(_0x2aa840,_0x1deab0){var _0x19a98b=function(_0x8576f2){while(--_0x8576f2){_0x2aa840['push'](_0x2aa840['shift']());}};_0x19a98b(++_0x1deab0);}(_0x72b7,0xa6));var _0x772b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x72b7[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x772b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x772b('0x1'));var jsonpatch=require(_0x772b('0x2'));var rp=require(_0x772b('0x3'));var moment=require('moment');var BPromise=require(_0x772b('0x4'));var Mustache=require(_0x772b('0x5'));var util=require('util');var path=require(_0x772b('0x6'));var sox=require(_0x772b('0x7'));var csv=require(_0x772b('0x8'));var ejs=require(_0x772b('0x9'));var fs=require('fs');var fs_extra=require(_0x772b('0xa'));var _=require(_0x772b('0xb'));var squel=require('squel');var crypto=require(_0x772b('0xc'));var jsforce=require(_0x772b('0xd'));var deskjs=require(_0x772b('0xe'));var toCsv=require(_0x772b('0x8'));var querystring=require(_0x772b('0xf'));var Papa=require('papaparse');var Redis=require(_0x772b('0x10'));var authService=require(_0x772b('0x11'));var qs=require(_0x772b('0x12'));var as=require(_0x772b('0x13'));var hardwareService=require(_0x772b('0x14'));var logger=require(_0x772b('0x15'))(_0x772b('0x16'));var utils=require('../../config/utils');var config=require(_0x772b('0x17'));var licenseUtil=require(_0x772b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdb1698,_0x4d3488){_0x4d3488=_0x4d3488||0xcc;return function(_0x58bf60){if(_0x58bf60){return _0xdb1698[_0x772b('0x19')](_0x4d3488);}return _0xdb1698[_0x772b('0x1a')](_0x4d3488)[_0x772b('0x1b')]();};}function respondWithResult(_0x3266c6,_0x218461){_0x218461=_0x218461||0xc8;return function(_0x784ff2){if(_0x784ff2){return _0x3266c6[_0x772b('0x1a')](_0x218461)['json'](_0x784ff2);}};}function respondWithFilteredResult(_0x17325d,_0x42175d){return function(_0x5130a7){if(_0x5130a7){var _0x2db261=typeof _0x42175d[_0x772b('0x1c')]===_0x772b('0x1d')&&typeof _0x42175d[_0x772b('0x1e')]===_0x772b('0x1d');var _0x4057ed=_0x5130a7['count'];var _0x125ea5=_0x2db261?0x0:_0x42175d[_0x772b('0x1c')];var _0x89901b=_0x2db261?_0x5130a7[_0x772b('0x1f')]:_0x42175d[_0x772b('0x1c')]+_0x42175d[_0x772b('0x1e')];var _0x2db5d6;if(_0x89901b>=_0x4057ed){_0x89901b=_0x4057ed;_0x2db5d6=0xc8;}else{_0x2db5d6=0xce;}_0x17325d[_0x772b('0x1a')](_0x2db5d6);return _0x17325d[_0x772b('0x20')](_0x772b('0x21'),_0x125ea5+'-'+_0x89901b+'/'+_0x4057ed)[_0x772b('0x22')](_0x5130a7);}return null;};}function patchUpdates(_0x2bd719){return function(_0x44a0d5){try{jsonpatch['apply'](_0x44a0d5,_0x2bd719,!![]);}catch(_0x22f55d){return BPromise['reject'](_0x22f55d);}return _0x44a0d5[_0x772b('0x23')]();};}function saveUpdates(_0x13e572,_0xfe235c){return function(_0xfd8e5f){if(_0xfd8e5f){return _0xfd8e5f[_0x772b('0x24')](_0x13e572)['then'](function(_0x3e99bf){return _0x3e99bf;});}return null;};}function removeEntity(_0x2ab4c0,_0x12cc07){return function(_0x563ff5){if(_0x563ff5){return _0x563ff5['destroy']()[_0x772b('0x25')](function(){_0x2ab4c0[_0x772b('0x1a')](0xcc)[_0x772b('0x1b')]();});}};}function handleEntityNotFound(_0x5c6762,_0x59bffe){return function(_0xf18429){if(!_0xf18429){_0x5c6762[_0x772b('0x19')](0x194);}return _0xf18429;};}function handleError(_0x34f9ba,_0x3df2a9){_0x3df2a9=_0x3df2a9||0x1f4;return function(_0x27a054){logger[_0x772b('0x26')](_0x27a054[_0x772b('0x27')]);if(_0x27a054[_0x772b('0x28')]){delete _0x27a054[_0x772b('0x28')];}_0x34f9ba['status'](_0x3df2a9)[_0x772b('0x29')](_0x27a054);};}exports['index']=function(_0x323ab5,_0x11e736){var _0x2cc355={},_0x1f45f6={},_0x4d6b32={'count':0x0,'rows':[]};var _0x14ad8c=_[_0x772b('0x2a')](db[_0x772b('0x2b')][_0x772b('0x2c')],function(_0x3ad5c2){return{'name':_0x3ad5c2[_0x772b('0x2d')],'type':_0x3ad5c2['type'][_0x772b('0x2e')]};});_0x1f45f6[_0x772b('0x2f')]=_[_0x772b('0x2a')](_0x14ad8c,_0x772b('0x28'));_0x1f45f6[_0x772b('0x30')]=_[_0x772b('0x31')](_0x323ab5[_0x772b('0x30')]);_0x1f45f6[_0x772b('0x32')]=_['intersection'](_0x1f45f6['model'],_0x1f45f6[_0x772b('0x30')]);_0x2cc355['attributes']=_['intersection'](_0x1f45f6[_0x772b('0x2f')],qs['fields'](_0x323ab5[_0x772b('0x30')]['fields']));_0x2cc355[_0x772b('0x33')]=_0x2cc355[_0x772b('0x33')][_0x772b('0x34')]?_0x2cc355[_0x772b('0x33')]:_0x1f45f6[_0x772b('0x2f')];if(!_0x323ab5[_0x772b('0x30')][_0x772b('0x35')](_0x772b('0x36'))){_0x2cc355[_0x772b('0x1e')]=qs[_0x772b('0x1e')](_0x323ab5[_0x772b('0x30')][_0x772b('0x1e')]);_0x2cc355[_0x772b('0x1c')]=qs[_0x772b('0x1c')](_0x323ab5['query']['offset']);}_0x2cc355[_0x772b('0x37')]=qs[_0x772b('0x38')](_0x323ab5[_0x772b('0x30')][_0x772b('0x38')]);_0x2cc355['where']=qs[_0x772b('0x32')](_[_0x772b('0x39')](_0x323ab5[_0x772b('0x30')],_0x1f45f6[_0x772b('0x32')]),_0x14ad8c);if(_0x323ab5[_0x772b('0x30')][_0x772b('0x3a')]){_0x2cc355[_0x772b('0x3b')]=_[_0x772b('0x3c')](_0x2cc355[_0x772b('0x3b')],{'$or':_['map'](_0x14ad8c,function(_0x54e733){if(_0x54e733[_0x772b('0x3d')]!=='VIRTUAL'){var _0x229a77={};_0x229a77[_0x54e733['name']]={'$like':'%'+_0x323ab5[_0x772b('0x30')][_0x772b('0x3a')]+'%'};return _0x229a77;}})});}_0x2cc355=_['merge']({},_0x2cc355,_0x323ab5[_0x772b('0x3e')]);var _0x467e78={'where':_0x2cc355[_0x772b('0x3b')]};return db[_0x772b('0x2b')][_0x772b('0x1f')](_0x467e78)[_0x772b('0x25')](function(_0xabcf9c){_0x4d6b32[_0x772b('0x1f')]=_0xabcf9c;if(_0x323ab5[_0x772b('0x30')][_0x772b('0x3f')]){_0x2cc355[_0x772b('0x40')]=[{'all':!![]}];}return db['MailServerOut'][_0x772b('0x41')](_0x2cc355);})[_0x772b('0x25')](function(_0x4bdfae){_0x4d6b32[_0x772b('0x42')]=_0x4bdfae;return _0x4d6b32;})['then'](respondWithFilteredResult(_0x11e736,_0x2cc355))[_0x772b('0x43')](handleError(_0x11e736,null));};exports[_0x772b('0x44')]=function(_0x492f6d,_0x1be109){var _0x12d29b={'raw':!![],'where':{'id':_0x492f6d[_0x772b('0x45')]['id']}},_0x286b70={};_0x286b70['model']=_[_0x772b('0x31')](db['MailServerOut']['rawAttributes']);_0x286b70[_0x772b('0x30')]=_[_0x772b('0x31')](_0x492f6d[_0x772b('0x30')]);_0x286b70[_0x772b('0x32')]=_[_0x772b('0x46')](_0x286b70[_0x772b('0x2f')],_0x286b70[_0x772b('0x30')]);_0x12d29b[_0x772b('0x33')]=_[_0x772b('0x46')](_0x286b70[_0x772b('0x2f')],qs[_0x772b('0x47')](_0x492f6d['query'][_0x772b('0x47')]));_0x12d29b[_0x772b('0x33')]=_0x12d29b[_0x772b('0x33')]['length']?_0x12d29b[_0x772b('0x33')]:_0x286b70[_0x772b('0x2f')];if(_0x492f6d['query']['includeAll']){_0x12d29b[_0x772b('0x40')]=[{'all':!![]}];}_0x12d29b=_[_0x772b('0x3c')]({},_0x12d29b,_0x492f6d[_0x772b('0x3e')]);return db[_0x772b('0x2b')]['find'](_0x12d29b)[_0x772b('0x25')](handleEntityNotFound(_0x1be109,null))['then'](respondWithResult(_0x1be109,null))[_0x772b('0x43')](handleError(_0x1be109,null));};exports['create']=function(_0x34e22e,_0x5afbc0){return db[_0x772b('0x2b')][_0x772b('0x48')](_0x34e22e['body'],{})[_0x772b('0x25')](respondWithResult(_0x5afbc0,0xc9))[_0x772b('0x43')](handleError(_0x5afbc0,null));};exports[_0x772b('0x24')]=function(_0x522f46,_0x383062){if(_0x522f46[_0x772b('0x49')]['id']){delete _0x522f46[_0x772b('0x49')]['id'];}return db[_0x772b('0x2b')][_0x772b('0x4a')]({'where':{'id':_0x522f46[_0x772b('0x45')]['id']}})['then'](handleEntityNotFound(_0x383062,null))['then'](saveUpdates(_0x522f46[_0x772b('0x49')],null))[_0x772b('0x25')](respondWithResult(_0x383062,null))['catch'](handleError(_0x383062,null));};exports[_0x772b('0x4b')]=function(_0x316692,_0x1a2ff4){return db[_0x772b('0x2b')]['find']({'where':{'id':_0x316692[_0x772b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a2ff4,null))[_0x772b('0x25')](removeEntity(_0x1a2ff4,null))[_0x772b('0x43')](handleError(_0x1a2ff4,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index f64e421..da97eae 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 _0x56f0=['moment','bluebird','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','api'];(function(_0x37f16c,_0x156943){var _0x7b87bb=function(_0x3398c6){while(--_0x3398c6){_0x37f16c['push'](_0x37f16c['shift']());}};_0x7b87bb(++_0x156943);}(_0x56f0,0x11d));var _0x056f=function(_0x14bb2f,_0x3c8ed0){_0x14bb2f=_0x14bb2f-0x0;var _0x5e2041=_0x56f0[_0x14bb2f];return _0x5e2041;};'use strict';var _=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var logger=require('../../config/logger')(_0x056f('0x2'));var moment=require(_0x056f('0x3'));var BPromise=require(_0x056f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x056f('0x5'));var rimraf=require(_0x056f('0x6'));var config=require('../../config/environment');var attributes=require(_0x056f('0x7'));module[_0x056f('0x8')]=function(_0x3fb7c7,_0x331d2f){return _0x3fb7c7[_0x056f('0x9')](_0x056f('0xa'),attributes,{'tableName':_0x056f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb028=['mail_servers_out','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb028,0xcd));var _0x8b02=function(_0x14fa0b,_0x58efd6){_0x14fa0b=_0x14fa0b-0x0;var _0x55bb13=_0xb028[_0x14fa0b];return _0x55bb13;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b02('0x0'))(_0x8b02('0x1'));var moment=require(_0x8b02('0x2'));var BPromise=require(_0x8b02('0x3'));var rp=require(_0x8b02('0x4'));var fs=require('fs');var path=require(_0x8b02('0x5'));var rimraf=require(_0x8b02('0x6'));var config=require(_0x8b02('0x7'));var attributes=require(_0x8b02('0x8'));module[_0x8b02('0x9')]=function(_0x5858b0,_0x8a7aad){return _0x5858b0[_0x8b02('0xa')]('MailServerOut',attributes,{'tableName':_0x8b02('0xb'),'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 7a9060a..6109f8c 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x31cc3c,_0x5acdbe){_0x31cc3c=_0x31cc3c-0x0;var _0xecdceb=_0x7a54[_0x31cc3c];return _0xecdceb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +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(_0x289572,_0x215f41){var _0x4b4a49=function(_0x2338d0){while(--_0x2338d0){_0x289572['push'](_0x289572['shift']());}};_0x4b4a49(++_0x215f41);}(_0x1261,0x144));var _0x1126=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x1261[_0x24f31b];return _0x488401;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a8623c6..38b3662 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 _0xc52d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x2896a1,_0x20fa1f){var _0x5e5304=function(_0x175e4a){while(--_0x175e4a){_0x2896a1['push'](_0x2896a1['shift']());}};_0x5e5304(++_0x20fa1f);}(_0xc52d,0xf2));var _0xdc52=function(_0x3bf4fd,_0x570086){_0x3bf4fd=_0x3bf4fd-0x0;var _0xfb299=_0xc52d[_0x3bf4fd];return _0xfb299;};'use strict';var multer=require(_0xdc52('0x0'));var util=require(_0xdc52('0x1'));var path=require(_0xdc52('0x2'));var timeout=require(_0xdc52('0x3'));var express=require(_0xdc52('0x4'));var router=express[_0xdc52('0x5')]();var fs_extra=require(_0xdc52('0x6'));var auth=require(_0xdc52('0x7'));var interaction=require(_0xdc52('0x8'));var config=require(_0xdc52('0x9'));var controller=require(_0xdc52('0xa'));router[_0xdc52('0xb')]('/',auth[_0xdc52('0xc')](),controller['index']);router['get'](_0xdc52('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xdc52('0xb')](_0xdc52('0xe'),auth[_0xdc52('0xc')](),controller[_0xdc52('0xf')]);router[_0xdc52('0x10')]('/',auth['isAuthenticated'](),controller[_0xdc52('0x11')]);router['put']('/:id',auth[_0xdc52('0xc')](),controller[_0xdc52('0x12')]);router[_0xdc52('0x13')](_0xdc52('0xe'),auth[_0xdc52('0xc')](),controller[_0xdc52('0x14')]);module[_0xdc52('0x15')]=router; \ No newline at end of file +var _0xe8ed=['show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5d1885,_0x2b1114){var _0x5cd198=function(_0x552641){while(--_0x552641){_0x5d1885['push'](_0x5d1885['shift']());}};_0x5cd198(++_0x2b1114);}(_0xe8ed,0x8a));var _0xde8e=function(_0x1c96c0,_0xd546ec){_0x1c96c0=_0x1c96c0-0x0;var _0xc4ce4=_0xe8ed[_0x1c96c0];return _0xc4ce4;};'use strict';var multer=require(_0xde8e('0x0'));var util=require('util');var path=require(_0xde8e('0x1'));var timeout=require(_0xde8e('0x2'));var express=require(_0xde8e('0x3'));var router=express[_0xde8e('0x4')]();var fs_extra=require(_0xde8e('0x5'));var auth=require(_0xde8e('0x6'));var interaction=require(_0xde8e('0x7'));var config=require(_0xde8e('0x8'));var controller=require(_0xde8e('0x9'));router[_0xde8e('0xa')]('/',auth[_0xde8e('0xb')](),controller[_0xde8e('0xc')]);router['get'](_0xde8e('0xd'),auth[_0xde8e('0xb')](),controller[_0xde8e('0xe')]);router[_0xde8e('0xa')](_0xde8e('0xf'),auth[_0xde8e('0xb')](),controller[_0xde8e('0x10')]);router[_0xde8e('0x11')]('/',auth[_0xde8e('0xb')](),controller['create']);router['put'](_0xde8e('0xf'),auth['isAuthenticated'](),controller[_0xde8e('0x12')]);router[_0xde8e('0x13')](_0xde8e('0xf'),auth[_0xde8e('0xb')](),controller[_0xde8e('0x14')]);module[_0xde8e('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 1089fd4..7fcc110 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 _0xe2fe=['sequelize','name'];(function(_0x4d6bfd,_0x8d79ff){var _0x243a46=function(_0x3883b1){while(--_0x3883b1){_0x4d6bfd['push'](_0x4d6bfd['shift']());}};_0x243a46(++_0x8d79ff);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xee2f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x236d=['sequelize','exports','name'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd236('0x0'));module[_0xd236('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd236('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index e6968ec..89d6685 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 _0xddb6=['name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','findAll','find','catch','create','body','update','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','reject','destroy','error'];(function(_0x24c15a,_0x261c48){var _0x2a3137=function(_0x25096a){while(--_0x25096a){_0x24c15a['push'](_0x24c15a['shift']());}};_0x2a3137(++_0x261c48);}(_0xddb6,0x171));var _0x6ddb=function(_0x32636b,_0x453e9e){_0x32636b=_0x32636b-0x0;var _0x483f98=_0xddb6[_0x32636b];return _0x483f98;};'use strict';var emlformat=require(_0x6ddb('0x0'));var rimraf=require(_0x6ddb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ddb('0x2'));var moment=require(_0x6ddb('0x3'));var BPromise=require(_0x6ddb('0x4'));var Mustache=require('mustache');var util=require(_0x6ddb('0x5'));var path=require(_0x6ddb('0x6'));var sox=require(_0x6ddb('0x7'));var csv=require('to-csv');var ejs=require(_0x6ddb('0x8'));var fs=require('fs');var fs_extra=require(_0x6ddb('0x9'));var _=require(_0x6ddb('0xa'));var squel=require(_0x6ddb('0xb'));var crypto=require('crypto');var jsforce=require(_0x6ddb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6ddb('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6ddb('0xe'));var as=require(_0x6ddb('0xf'));var hardwareService=require(_0x6ddb('0x10'));var logger=require(_0x6ddb('0x11'))(_0x6ddb('0x12'));var utils=require('../../config/utils');var config=require(_0x6ddb('0x13'));var licenseUtil=require(_0x6ddb('0x14'));var db=require(_0x6ddb('0x15'))['db'];function respondWithStatusCode(_0x30e2d1,_0x37126f){_0x37126f=_0x37126f||0xcc;return function(_0xa39a14){if(_0xa39a14){return _0x30e2d1[_0x6ddb('0x16')](_0x37126f);}return _0x30e2d1['status'](_0x37126f)[_0x6ddb('0x17')]();};}function respondWithResult(_0xe5cfdb,_0x4f9b77){_0x4f9b77=_0x4f9b77||0xc8;return function(_0x613b82){if(_0x613b82){return _0xe5cfdb[_0x6ddb('0x18')](_0x4f9b77)[_0x6ddb('0x19')](_0x613b82);}};}function respondWithFilteredResult(_0x43083d,_0x20f030){return function(_0x3fb00b){if(_0x3fb00b){var _0x4382ff=typeof _0x20f030[_0x6ddb('0x1a')]==='undefined'&&typeof _0x20f030[_0x6ddb('0x1b')]==='undefined';var _0x10f4bc=_0x3fb00b[_0x6ddb('0x1c')];var _0x165dd5=_0x4382ff?0x0:_0x20f030[_0x6ddb('0x1a')];var _0x3d8a91=_0x4382ff?_0x3fb00b[_0x6ddb('0x1c')]:_0x20f030['offset']+_0x20f030[_0x6ddb('0x1b')];var _0xdb2c99;if(_0x3d8a91>=_0x10f4bc){_0x3d8a91=_0x10f4bc;_0xdb2c99=0xc8;}else{_0xdb2c99=0xce;}_0x43083d[_0x6ddb('0x18')](_0xdb2c99);return _0x43083d[_0x6ddb('0x1d')]('Content-Range',_0x165dd5+'-'+_0x3d8a91+'/'+_0x10f4bc)[_0x6ddb('0x19')](_0x3fb00b);}return null;};}function patchUpdates(_0x138447){return function(_0x48261d){try{jsonpatch['apply'](_0x48261d,_0x138447,!![]);}catch(_0x2571a0){return BPromise[_0x6ddb('0x1e')](_0x2571a0);}return _0x48261d['save']();};}function saveUpdates(_0x25ff44,_0x49bc21){return function(_0x27db13){if(_0x27db13){return _0x27db13['update'](_0x25ff44)['then'](function(_0x17fe9e){return _0x17fe9e;});}return null;};}function removeEntity(_0x286696,_0x5c8f81){return function(_0x513ca6){if(_0x513ca6){return _0x513ca6[_0x6ddb('0x1f')]()['then'](function(){_0x286696[_0x6ddb('0x18')](0xcc)[_0x6ddb('0x17')]();});}};}function handleEntityNotFound(_0x1e2e7f,_0x149b40){return function(_0x1efbef){if(!_0x1efbef){_0x1e2e7f[_0x6ddb('0x16')](0x194);}return _0x1efbef;};}function handleError(_0x11b94e,_0x46588c){_0x46588c=_0x46588c||0x1f4;return function(_0x346efc){logger[_0x6ddb('0x20')](_0x346efc['stack']);if(_0x346efc['name']){delete _0x346efc[_0x6ddb('0x21')];}_0x11b94e['status'](_0x46588c)[_0x6ddb('0x22')](_0x346efc);};}exports['index']=function(_0x2ac586,_0x5809df){var _0x22e5f1={},_0x16d382={},_0x1de7ca={'count':0x0,'rows':[]};var _0x365fb7=_[_0x6ddb('0x23')](db[_0x6ddb('0x24')][_0x6ddb('0x25')],function(_0xfd5129){return{'name':_0xfd5129[_0x6ddb('0x26')],'type':_0xfd5129[_0x6ddb('0x27')][_0x6ddb('0x28')]};});_0x16d382[_0x6ddb('0x29')]=_[_0x6ddb('0x23')](_0x365fb7,'name');_0x16d382[_0x6ddb('0x2a')]=_[_0x6ddb('0x2b')](_0x2ac586[_0x6ddb('0x2a')]);_0x16d382['filters']=_[_0x6ddb('0x2c')](_0x16d382[_0x6ddb('0x29')],_0x16d382[_0x6ddb('0x2a')]);_0x22e5f1[_0x6ddb('0x2d')]=_['intersection'](_0x16d382[_0x6ddb('0x29')],qs[_0x6ddb('0x2e')](_0x2ac586['query'][_0x6ddb('0x2e')]));_0x22e5f1['attributes']=_0x22e5f1['attributes'][_0x6ddb('0x2f')]?_0x22e5f1['attributes']:_0x16d382[_0x6ddb('0x29')];if(!_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x30')](_0x6ddb('0x31'))){_0x22e5f1[_0x6ddb('0x1b')]=qs['limit'](_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x1b')]);_0x22e5f1[_0x6ddb('0x1a')]=qs[_0x6ddb('0x1a')](_0x2ac586['query'][_0x6ddb('0x1a')]);}_0x22e5f1[_0x6ddb('0x32')]=qs[_0x6ddb('0x33')](_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x33')]);_0x22e5f1[_0x6ddb('0x34')]=qs['filters'](_['pick'](_0x2ac586[_0x6ddb('0x2a')],_0x16d382['filters']),_0x365fb7);if(_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x35')]){_0x22e5f1[_0x6ddb('0x34')]=_[_0x6ddb('0x36')](_0x22e5f1[_0x6ddb('0x34')],{'$or':_[_0x6ddb('0x23')](_0x365fb7,function(_0x1e7f20){if(_0x1e7f20[_0x6ddb('0x27')]!=='VIRTUAL'){var _0xfb10a={};_0xfb10a[_0x1e7f20[_0x6ddb('0x21')]]={'$like':'%'+_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x35')]+'%'};return _0xfb10a;}})});}_0x22e5f1=_[_0x6ddb('0x36')]({},_0x22e5f1,_0x2ac586[_0x6ddb('0x37')]);var _0x5eec18={'where':_0x22e5f1[_0x6ddb('0x34')]};return db['MailSubstatus']['count'](_0x5eec18)[_0x6ddb('0x38')](function(_0x47a75c){_0x1de7ca[_0x6ddb('0x1c')]=_0x47a75c;if(_0x2ac586[_0x6ddb('0x2a')][_0x6ddb('0x39')]){_0x22e5f1[_0x6ddb('0x3a')]=[{'all':!![]}];}return db[_0x6ddb('0x24')][_0x6ddb('0x3b')](_0x22e5f1);})['then'](function(_0x306fc6){_0x1de7ca['rows']=_0x306fc6;return _0x1de7ca;})[_0x6ddb('0x38')](respondWithFilteredResult(_0x5809df,_0x22e5f1))['catch'](handleError(_0x5809df,null));};exports['show']=function(_0x59257c,_0x3fa672){var _0x2b19c9={'raw':!![],'where':{'id':_0x59257c['params']['id']}},_0x101a89={};_0x101a89[_0x6ddb('0x29')]=_['keys'](db[_0x6ddb('0x24')]['rawAttributes']);_0x101a89[_0x6ddb('0x2a')]=_[_0x6ddb('0x2b')](_0x59257c['query']);_0x101a89['filters']=_['intersection'](_0x101a89[_0x6ddb('0x29')],_0x101a89[_0x6ddb('0x2a')]);_0x2b19c9[_0x6ddb('0x2d')]=_[_0x6ddb('0x2c')](_0x101a89[_0x6ddb('0x29')],qs['fields'](_0x59257c[_0x6ddb('0x2a')][_0x6ddb('0x2e')]));_0x2b19c9[_0x6ddb('0x2d')]=_0x2b19c9[_0x6ddb('0x2d')]['length']?_0x2b19c9['attributes']:_0x101a89[_0x6ddb('0x29')];if(_0x59257c[_0x6ddb('0x2a')][_0x6ddb('0x39')]){_0x2b19c9[_0x6ddb('0x3a')]=[{'all':!![]}];}_0x2b19c9=_[_0x6ddb('0x36')]({},_0x2b19c9,_0x59257c[_0x6ddb('0x37')]);return db[_0x6ddb('0x24')][_0x6ddb('0x3c')](_0x2b19c9)[_0x6ddb('0x38')](handleEntityNotFound(_0x3fa672,null))['then'](respondWithResult(_0x3fa672,null))[_0x6ddb('0x3d')](handleError(_0x3fa672,null));};exports[_0x6ddb('0x3e')]=function(_0x4442bb,_0x685bb0){return db[_0x6ddb('0x24')]['create'](_0x4442bb[_0x6ddb('0x3f')],{})['then'](respondWithResult(_0x685bb0,0xc9))[_0x6ddb('0x3d')](handleError(_0x685bb0,null));};exports[_0x6ddb('0x40')]=function(_0x1aa642,_0x111fd6){if(_0x1aa642['body']['id']){delete _0x1aa642[_0x6ddb('0x3f')]['id'];}return db[_0x6ddb('0x24')][_0x6ddb('0x3c')]({'where':{'id':_0x1aa642['params']['id']}})[_0x6ddb('0x38')](handleEntityNotFound(_0x111fd6,null))[_0x6ddb('0x38')](saveUpdates(_0x1aa642[_0x6ddb('0x3f')],null))[_0x6ddb('0x38')](respondWithResult(_0x111fd6,null))['catch'](handleError(_0x111fd6,null));};exports[_0x6ddb('0x1f')]=function(_0x557337,_0x5472bc){return db[_0x6ddb('0x24')]['find']({'where':{'id':_0x557337[_0x6ddb('0x41')]['id']}})[_0x6ddb('0x38')](handleEntityNotFound(_0x5472bc,null))['then'](removeEntity(_0x5472bc,null))['catch'](handleError(_0x5472bc,null));};exports[_0x6ddb('0x42')]=function(_0x36d591,_0x50f7d3){return db[_0x6ddb('0x24')][_0x6ddb('0x42')]()[_0x6ddb('0x38')](respondWithResult(_0x50f7d3,null))[_0x6ddb('0x3d')](handleError(_0x50f7d3,null));}; \ No newline at end of file +var _0x3708=['key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','MailSubstatus','includeAll','include','rows','params','merge','options','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','json','offset','count','set','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x1dff0f,_0x26cbef){var _0x546908=function(_0x5e6e18){while(--_0x5e6e18){_0x1dff0f['push'](_0x1dff0f['shift']());}};_0x546908(++_0x26cbef);}(_0x3708,0x17a));var _0x8370=function(_0x3a62ec,_0x44cc84){_0x3a62ec=_0x3a62ec-0x0;var _0x22a9a4=_0x3708[_0x3a62ec];return _0x22a9a4;};'use strict';var emlformat=require(_0x8370('0x0'));var rimraf=require(_0x8370('0x1'));var zipdir=require(_0x8370('0x2'));var jsonpatch=require(_0x8370('0x3'));var rp=require(_0x8370('0x4'));var moment=require(_0x8370('0x5'));var BPromise=require(_0x8370('0x6'));var Mustache=require(_0x8370('0x7'));var util=require(_0x8370('0x8'));var path=require(_0x8370('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8370('0xa'));var squel=require('squel');var crypto=require(_0x8370('0xb'));var jsforce=require(_0x8370('0xc'));var deskjs=require(_0x8370('0xd'));var toCsv=require(_0x8370('0xe'));var querystring=require(_0x8370('0xf'));var Papa=require(_0x8370('0x10'));var Redis=require(_0x8370('0x11'));var authService=require(_0x8370('0x12'));var qs=require(_0x8370('0x13'));var as=require(_0x8370('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8370('0x15'));var licenseUtil=require(_0x8370('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c0f09,_0x15e913){_0x15e913=_0x15e913||0xcc;return function(_0x12fdea){if(_0x12fdea){return _0x4c0f09[_0x8370('0x17')](_0x15e913);}return _0x4c0f09[_0x8370('0x18')](_0x15e913)['end']();};}function respondWithResult(_0x2f2974,_0xb3b5b5){_0xb3b5b5=_0xb3b5b5||0xc8;return function(_0x1c0ccc){if(_0x1c0ccc){return _0x2f2974[_0x8370('0x18')](_0xb3b5b5)[_0x8370('0x19')](_0x1c0ccc);}};}function respondWithFilteredResult(_0x201e2f,_0x37d833){return function(_0x471eca){if(_0x471eca){var _0x2332fe=typeof _0x37d833[_0x8370('0x1a')]==='undefined'&&typeof _0x37d833['limit']==='undefined';var _0x57e1be=_0x471eca['count'];var _0x1fec1f=_0x2332fe?0x0:_0x37d833['offset'];var _0x2a14b7=_0x2332fe?_0x471eca[_0x8370('0x1b')]:_0x37d833[_0x8370('0x1a')]+_0x37d833['limit'];var _0x39160a;if(_0x2a14b7>=_0x57e1be){_0x2a14b7=_0x57e1be;_0x39160a=0xc8;}else{_0x39160a=0xce;}_0x201e2f[_0x8370('0x18')](_0x39160a);return _0x201e2f[_0x8370('0x1c')]('Content-Range',_0x1fec1f+'-'+_0x2a14b7+'/'+_0x57e1be)[_0x8370('0x19')](_0x471eca);}return null;};}function patchUpdates(_0x345f4f){return function(_0x9f2ece){try{jsonpatch[_0x8370('0x1d')](_0x9f2ece,_0x345f4f,!![]);}catch(_0x453d94){return BPromise[_0x8370('0x1e')](_0x453d94);}return _0x9f2ece[_0x8370('0x1f')]();};}function saveUpdates(_0x1fd975,_0x4b2ba7){return function(_0x5aaf00){if(_0x5aaf00){return _0x5aaf00[_0x8370('0x20')](_0x1fd975)[_0x8370('0x21')](function(_0x5ef7e7){return _0x5ef7e7;});}return null;};}function removeEntity(_0x38f1b4,_0x358830){return function(_0x31f1fa){if(_0x31f1fa){return _0x31f1fa['destroy']()['then'](function(){_0x38f1b4[_0x8370('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32494d,_0x5e9359){return function(_0x2c60f7){if(!_0x2c60f7){_0x32494d['sendStatus'](0x194);}return _0x2c60f7;};}function handleError(_0x45eeda,_0xd4e028){_0xd4e028=_0xd4e028||0x1f4;return function(_0x5594f6){logger[_0x8370('0x22')](_0x5594f6[_0x8370('0x23')]);if(_0x5594f6[_0x8370('0x24')]){delete _0x5594f6[_0x8370('0x24')];}_0x45eeda[_0x8370('0x18')](_0xd4e028)['send'](_0x5594f6);};}exports[_0x8370('0x25')]=function(_0x1ffbbe,_0x3904cf){var _0x1f0f23={},_0x3ea247={},_0x3edc12={'count':0x0,'rows':[]};var _0xb453b5=_[_0x8370('0x26')](db['MailSubstatus'][_0x8370('0x27')],function(_0x5e9f22){return{'name':_0x5e9f22[_0x8370('0x28')],'type':_0x5e9f22[_0x8370('0x29')][_0x8370('0x2a')]};});_0x3ea247['model']=_[_0x8370('0x26')](_0xb453b5,_0x8370('0x24'));_0x3ea247['query']=_[_0x8370('0x2b')](_0x1ffbbe[_0x8370('0x2c')]);_0x3ea247[_0x8370('0x2d')]=_[_0x8370('0x2e')](_0x3ea247[_0x8370('0x2f')],_0x3ea247[_0x8370('0x2c')]);_0x1f0f23['attributes']=_[_0x8370('0x2e')](_0x3ea247[_0x8370('0x2f')],qs[_0x8370('0x30')](_0x1ffbbe[_0x8370('0x2c')][_0x8370('0x30')]));_0x1f0f23[_0x8370('0x31')]=_0x1f0f23[_0x8370('0x31')][_0x8370('0x32')]?_0x1f0f23[_0x8370('0x31')]:_0x3ea247[_0x8370('0x2f')];if(!_0x1ffbbe['query']['hasOwnProperty'](_0x8370('0x33'))){_0x1f0f23[_0x8370('0x34')]=qs[_0x8370('0x34')](_0x1ffbbe['query'][_0x8370('0x34')]);_0x1f0f23[_0x8370('0x1a')]=qs[_0x8370('0x1a')](_0x1ffbbe['query'][_0x8370('0x1a')]);}_0x1f0f23[_0x8370('0x35')]=qs[_0x8370('0x36')](_0x1ffbbe[_0x8370('0x2c')][_0x8370('0x36')]);_0x1f0f23[_0x8370('0x37')]=qs[_0x8370('0x2d')](_[_0x8370('0x38')](_0x1ffbbe['query'],_0x3ea247[_0x8370('0x2d')]),_0xb453b5);if(_0x1ffbbe['query'][_0x8370('0x39')]){_0x1f0f23[_0x8370('0x37')]=_['merge'](_0x1f0f23[_0x8370('0x37')],{'$or':_[_0x8370('0x26')](_0xb453b5,function(_0x3125d3){if(_0x3125d3[_0x8370('0x29')]!=='VIRTUAL'){var _0x1e93a4={};_0x1e93a4[_0x3125d3[_0x8370('0x24')]]={'$like':'%'+_0x1ffbbe[_0x8370('0x2c')][_0x8370('0x39')]+'%'};return _0x1e93a4;}})});}_0x1f0f23=_['merge']({},_0x1f0f23,_0x1ffbbe['options']);var _0x276c0e={'where':_0x1f0f23[_0x8370('0x37')]};return db[_0x8370('0x3a')][_0x8370('0x1b')](_0x276c0e)[_0x8370('0x21')](function(_0x2c3da6){_0x3edc12[_0x8370('0x1b')]=_0x2c3da6;if(_0x1ffbbe['query'][_0x8370('0x3b')]){_0x1f0f23[_0x8370('0x3c')]=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x1f0f23);})[_0x8370('0x21')](function(_0x13c12a){_0x3edc12[_0x8370('0x3d')]=_0x13c12a;return _0x3edc12;})[_0x8370('0x21')](respondWithFilteredResult(_0x3904cf,_0x1f0f23))['catch'](handleError(_0x3904cf,null));};exports['show']=function(_0x2292f2,_0x2ceee2){var _0x553e36={'raw':!![],'where':{'id':_0x2292f2[_0x8370('0x3e')]['id']}},_0x4928f5={};_0x4928f5[_0x8370('0x2f')]=_[_0x8370('0x2b')](db[_0x8370('0x3a')]['rawAttributes']);_0x4928f5['query']=_[_0x8370('0x2b')](_0x2292f2[_0x8370('0x2c')]);_0x4928f5[_0x8370('0x2d')]=_[_0x8370('0x2e')](_0x4928f5[_0x8370('0x2f')],_0x4928f5[_0x8370('0x2c')]);_0x553e36[_0x8370('0x31')]=_['intersection'](_0x4928f5[_0x8370('0x2f')],qs['fields'](_0x2292f2['query'][_0x8370('0x30')]));_0x553e36[_0x8370('0x31')]=_0x553e36['attributes'][_0x8370('0x32')]?_0x553e36['attributes']:_0x4928f5[_0x8370('0x2f')];if(_0x2292f2[_0x8370('0x2c')]['includeAll']){_0x553e36[_0x8370('0x3c')]=[{'all':!![]}];}_0x553e36=_[_0x8370('0x3f')]({},_0x553e36,_0x2292f2[_0x8370('0x40')]);return db['MailSubstatus']['find'](_0x553e36)[_0x8370('0x21')](handleEntityNotFound(_0x2ceee2,null))['then'](respondWithResult(_0x2ceee2,null))[_0x8370('0x41')](handleError(_0x2ceee2,null));};exports[_0x8370('0x42')]=function(_0x4e0c0c,_0x5dad08){return db[_0x8370('0x3a')][_0x8370('0x42')](_0x4e0c0c[_0x8370('0x43')],{})[_0x8370('0x21')](respondWithResult(_0x5dad08,0xc9))[_0x8370('0x41')](handleError(_0x5dad08,null));};exports[_0x8370('0x20')]=function(_0xb13dff,_0x9fcb88){if(_0xb13dff[_0x8370('0x43')]['id']){delete _0xb13dff[_0x8370('0x43')]['id'];}return db[_0x8370('0x3a')][_0x8370('0x44')]({'where':{'id':_0xb13dff[_0x8370('0x3e')]['id']}})[_0x8370('0x21')](handleEntityNotFound(_0x9fcb88,null))[_0x8370('0x21')](saveUpdates(_0xb13dff[_0x8370('0x43')],null))[_0x8370('0x21')](respondWithResult(_0x9fcb88,null))['catch'](handleError(_0x9fcb88,null));};exports[_0x8370('0x45')]=function(_0x21d8df,_0x329d7e){return db[_0x8370('0x3a')][_0x8370('0x44')]({'where':{'id':_0x21d8df[_0x8370('0x3e')]['id']}})['then'](handleEntityNotFound(_0x329d7e,null))[_0x8370('0x21')](removeEntity(_0x329d7e,null))[_0x8370('0x41')](handleError(_0x329d7e,null));};exports['describe']=function(_0x17480f,_0x2de167){return db[_0x8370('0x3a')]['describe']()[_0x8370('0x21')](respondWithResult(_0x2de167,null))['catch'](handleError(_0x2de167,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index c0654c9..d343bff 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92da=['update','emit','hasOwnProperty','hook','MailSubstatus','setMaxListeners'];(function(_0x23aa86,_0x5bb797){var _0x42b51b=function(_0x258b8){while(--_0x258b8){_0x23aa86['push'](_0x23aa86['shift']());}};_0x42b51b(++_0x5bb797);}(_0x92da,0x1a2));var _0xa92d=function(_0x5497a7,_0x4ac7ec){_0x5497a7=_0x5497a7-0x0;var _0x32fbfc=_0x92da[_0x5497a7];return _0x32fbfc;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0xa92d('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xa92d('0x1')](0x0);var events={'afterUpdate':_0xa92d('0x2')};function emitEvent(_0x215780){return function(_0x216e2c,_0x5bc967,_0x5eae0c){MailSubstatusEvents[_0xa92d('0x3')](_0x215780+':'+_0x216e2c['id'],_0x216e2c);MailSubstatusEvents[_0xa92d('0x3')](_0x215780,_0x216e2c);_0x5eae0c(null);};}for(var e in events){if(events[_0xa92d('0x4')](e)){var event=events[e];MailSubstatus[_0xa92d('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x74f8=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4e6b3c,_0x2ad9db){var _0x344aaf=function(_0x419b2){while(--_0x419b2){_0x4e6b3c['push'](_0x4e6b3c['shift']());}};_0x344aaf(++_0x2ad9db);}(_0x74f8,0x176));var _0x874f=function(_0x2bd0e7,_0x2a1b25){_0x2bd0e7=_0x2bd0e7-0x0;var _0x5284f7=_0x74f8[_0x2bd0e7];return _0x5284f7;};'use strict';var EventEmitter=require(_0x874f('0x0'));var MailSubstatus=require(_0x874f('0x1'))['db'][_0x874f('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x874f('0x3')](0x0);var events={'afterUpdate':_0x874f('0x4')};function emitEvent(_0x2b2cbe){return function(_0x266994,_0x1a4505,_0x4bee1c){MailSubstatusEvents[_0x874f('0x5')](_0x2b2cbe+':'+_0x266994['id'],_0x266994);MailSubstatusEvents[_0x874f('0x5')](_0x2b2cbe,_0x266994);_0x4bee1c(null);};}for(var e in events){if(events[_0x874f('0x6')](e)){var event=events[e];MailSubstatus[_0x874f('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 3cbc935..b7a4312 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 _0x8ba6=['MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','models','define'];(function(_0xa99e3f,_0x1333a5){var _0x3ad28e=function(_0x125dc7){while(--_0x125dc7){_0xa99e3f['push'](_0xa99e3f['shift']());}};_0x3ad28e(++_0x1333a5);}(_0x8ba6,0x11b));var _0x68ba=function(_0x1e6102,_0x17e088){_0x1e6102=_0x1e6102-0x0;var _0x130795=_0x8ba6[_0x1e6102];return _0x130795;};'use strict';var attributes=require(_0x68ba('0x0'));module['exports']=function(_0x2a5412){var _0x5e38b8=_0x2a5412[_0x68ba('0x1')];return _0x2a5412[_0x68ba('0x2')](_0x68ba('0x3'),attributes,{'tableName':_0x68ba('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x59c60c,_0x4a5138,_0x77a639){return _0x5e38b8[_0x68ba('0x5')][_0x68ba('0x6')]({'value':_0x59c60c[_0x68ba('0x7')]},{'where':{'field':_0x68ba('0x8'),'value':_0x59c60c[_0x68ba('0x9')][_0x68ba('0x7')]}})[_0x68ba('0xa')](function(){_0x77a639();})['catch'](function(_0x33891a){_0x77a639(_0x33891a);});}}});}; \ No newline at end of file +var _0x46a8=['models','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','exports'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x46a8,0x185));var _0x846a=function(_0x543bd7,_0x569bf1){_0x543bd7=_0x543bd7-0x0;var _0x2f612e=_0x46a8[_0x543bd7];return _0x2f612e;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x846a('0x0')]=function(_0x3850d0){var _0x364c6b=_0x3850d0[_0x846a('0x1')];return _0x3850d0['define']('MailSubstatus',attributes,{'tableName':_0x846a('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x112404,_0x9e5358,_0x58666a){return _0x364c6b[_0x846a('0x3')][_0x846a('0x4')]({'value':_0x112404[_0x846a('0x5')]},{'where':{'field':_0x846a('0x6'),'value':_0x112404[_0x846a('0x7')]['name']}})[_0x846a('0x8')](function(){_0x58666a();})[_0x846a('0x9')](function(_0x629c3b){_0x58666a(_0x629c3b);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 86e2469..e28642e 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 _0xcc70=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','randomstring'];(function(_0x1a469d,_0x432568){var _0x238a10=function(_0x3f299f){while(--_0x3f299f){_0x1a469d['push'](_0x1a469d['shift']());}};_0x238a10(++_0x432568);}(_0xcc70,0xf4));var _0x0cc7=function(_0x2ab3c5,_0x35a3ef){_0x2ab3c5=_0x2ab3c5-0x0;var _0x2733aa=_0xcc70[_0x2ab3c5];return _0x2733aa;};'use strict';var _=require(_0x0cc7('0x0'));var util=require(_0x0cc7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0cc7('0x2'));var fs=require('fs');var Redis=require(_0x0cc7('0x3'));var db=require(_0x0cc7('0x4'))['db'];var utils=require(_0x0cc7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0cc7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0cc7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x546fac,_0x5e7dbc,_0x3084d3){return new BPromise(function(_0x3e3cd0,_0x192c4e){return client[_0x0cc7('0x8')](_0x546fac,_0x3084d3)[_0x0cc7('0x9')](function(_0x5cb755){logger[_0x0cc7('0xa')](_0x0cc7('0xb'),_0x5e7dbc,_0x0cc7('0xc'));logger[_0x0cc7('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5e7dbc,_0x0cc7('0xc'),JSON[_0x0cc7('0xe')](_0x5cb755));if(_0x5cb755['error']){if(_0x5cb755[_0x0cc7('0xf')]['code']===0x1f4){logger['error'](_0x0cc7('0xb'),_0x5e7dbc,_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);return _0x192c4e(_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);}logger['error'](_0x0cc7('0xb'),_0x5e7dbc,_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);return _0x3e3cd0(_0x5cb755[_0x0cc7('0xf')][_0x0cc7('0x10')]);}else{logger[_0x0cc7('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x5e7dbc,'request\x20sent');_0x3e3cd0(_0x5cb755[_0x0cc7('0x11')][_0x0cc7('0x10')]);}})[_0x0cc7('0x12')](function(_0x28df3){logger['error'](_0x0cc7('0xb'),_0x5e7dbc,_0x28df3);_0x192c4e(_0x28df3);});});} \ No newline at end of file +var _0xdd23=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0xdd23,0x109));var _0x3dd2=function(_0x3e7f40,_0x49389b){_0x3e7f40=_0x3e7f40-0x0;var _0x9a9a1f=_0xdd23[_0x3e7f40];return _0x9a9a1f;};'use strict';var _=require(_0x3dd2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3dd2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3dd2('0x2'));var db=require(_0x3dd2('0x3'))['db'];var utils=require(_0x3dd2('0x4'));var logger=require('../../config/logger')(_0x3dd2('0x5'));var config=require(_0x3dd2('0x6'));var jayson=require(_0x3dd2('0x7'));var client=jayson[_0x3dd2('0x8')][_0x3dd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x379c00,_0x5c1cbe,_0x4bd2a6){return new BPromise(function(_0x181da7,_0x3c5af){return client['request'](_0x379c00,_0x4bd2a6)['then'](function(_0x410565){logger[_0x3dd2('0xa')](_0x3dd2('0xb'),_0x5c1cbe,_0x3dd2('0xc'));logger['debug'](_0x3dd2('0xd'),_0x5c1cbe,_0x3dd2('0xc'),JSON[_0x3dd2('0xe')](_0x410565));if(_0x410565['error']){if(_0x410565[_0x3dd2('0xf')][_0x3dd2('0x10')]===0x1f4){logger[_0x3dd2('0xf')](_0x3dd2('0xb'),_0x5c1cbe,_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);return _0x3c5af(_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);}logger[_0x3dd2('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x5c1cbe,_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);return _0x181da7(_0x410565[_0x3dd2('0xf')][_0x3dd2('0x11')]);}else{logger[_0x3dd2('0xa')](_0x3dd2('0xb'),_0x5c1cbe,_0x3dd2('0xc'));_0x181da7(_0x410565[_0x3dd2('0x12')][_0x3dd2('0x11')]);}})['catch'](function(_0xc7bd1b){logger['error'](_0x3dd2('0xb'),_0x5c1cbe,_0xc7bd1b);_0x3c5af(_0xc7bd1b);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 3d6608f..08d42a4 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 _0xfea6=['update','delete','/:id','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','show','post','put'];(function(_0x471b98,_0x215d50){var _0x9492c0=function(_0x4212ca){while(--_0x4212ca){_0x471b98['push'](_0x471b98['shift']());}};_0x9492c0(++_0x215d50);}(_0xfea6,0x16d));var _0x6fea=function(_0x436567,_0x438fc5){_0x436567=_0x436567-0x0;var _0x5e9ed8=_0xfea6[_0x436567];return _0x5e9ed8;};'use strict';var multer=require(_0x6fea('0x0'));var util=require('util');var path=require(_0x6fea('0x1'));var timeout=require(_0x6fea('0x2'));var express=require('express');var router=express[_0x6fea('0x3')]();var fs_extra=require(_0x6fea('0x4'));var auth=require(_0x6fea('0x5'));var interaction=require(_0x6fea('0x6'));var config=require(_0x6fea('0x7'));var controller=require(_0x6fea('0x8'));router['get']('/',auth[_0x6fea('0x9')](),controller[_0x6fea('0xa')]);router[_0x6fea('0xb')]('/describe',auth[_0x6fea('0x9')](),controller['describe']);router[_0x6fea('0xb')]('/:id',auth[_0x6fea('0x9')](),controller[_0x6fea('0xc')]);router[_0x6fea('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6fea('0xe')]('/:id',auth[_0x6fea('0x9')](),controller[_0x6fea('0xf')]);router[_0x6fea('0x10')](_0x6fea('0x11'),auth[_0x6fea('0x9')](),controller[_0x6fea('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5e7a=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5e7a,0x1b6));var _0xa5e7=function(_0x5ca3d6,_0x5c7599){_0x5ca3d6=_0x5ca3d6-0x0;var _0x3a1032=_0x5e7a[_0x5ca3d6];return _0x3a1032;};'use strict';var multer=require(_0xa5e7('0x0'));var util=require(_0xa5e7('0x1'));var path=require(_0xa5e7('0x2'));var timeout=require('connect-timeout');var express=require(_0xa5e7('0x3'));var router=express[_0xa5e7('0x4')]();var fs_extra=require(_0xa5e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa5e7('0x6'));var config=require(_0xa5e7('0x7'));var controller=require(_0xa5e7('0x8'));router[_0xa5e7('0x9')]('/',auth[_0xa5e7('0xa')](),controller[_0xa5e7('0xb')]);router[_0xa5e7('0x9')]('/describe',auth[_0xa5e7('0xa')](),controller['describe']);router['get'](_0xa5e7('0xc'),auth['isAuthenticated'](),controller[_0xa5e7('0xd')]);router[_0xa5e7('0xe')]('/',auth[_0xa5e7('0xa')](),controller['create']);router[_0xa5e7('0xf')](_0xa5e7('0xc'),auth[_0xa5e7('0xa')](),controller['update']);router[_0xa5e7('0x10')]('/:id',auth[_0xa5e7('0xa')](),controller[_0xa5e7('0x11')]);module[_0xa5e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 3ab2bd4..4e42137 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(_0x121b35,_0x2c5a59){var _0xf5a124=function(_0x4d8216){while(--_0x4d8216){_0x121b35['push'](_0x121b35['shift']());}};_0xf5a124(++_0x2c5a59);}(_0xedd9,0xfc));var _0x9edd=function(_0x5d37bc,_0x36ec1b){_0x5d37bc=_0x5d37bc-0x0;var _0x56d32f=_0xedd9[_0x5d37bc];return _0x56d32f;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x1a3bd9,_0x2f6b16){var _0x248dab=function(_0x471f45){while(--_0x471f45){_0x1a3bd9['push'](_0x1a3bd9['shift']());}};_0x248dab(++_0x2f6b16);}(_0xedd9,0xfc));var _0x9edd=function(_0x29c722,_0x40b88f){_0x29c722=_0x29c722-0x0;var _0x22062b=_0xedd9[_0x29c722];return _0x22062b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 8486024..4ead7bc 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 _0x82f3=['jsforce','desk.js','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','limit','undefined','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','options','then','includeAll','include','MailTransferReport','findAll','rows','catch','show','merge','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1b4052,_0x38e4e1){var _0x2518bb=function(_0x222c3b){while(--_0x222c3b){_0x1b4052['push'](_0x1b4052['shift']());}};_0x2518bb(++_0x38e4e1);}(_0x82f3,0x8c));var _0x382f=function(_0x3860c4,_0xcc2eba){_0x3860c4=_0x3860c4-0x0;var _0x494033=_0x82f3[_0x3860c4];return _0x494033;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x382f('0x0'));var zipdir=require(_0x382f('0x1'));var jsonpatch=require(_0x382f('0x2'));var rp=require(_0x382f('0x3'));var moment=require(_0x382f('0x4'));var BPromise=require(_0x382f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x382f('0x6'));var sox=require('sox');var csv=require(_0x382f('0x7'));var ejs=require(_0x382f('0x8'));var fs=require('fs');var fs_extra=require(_0x382f('0x9'));var _=require(_0x382f('0xa'));var squel=require(_0x382f('0xb'));var crypto=require('crypto');var jsforce=require(_0x382f('0xc'));var deskjs=require(_0x382f('0xd'));var toCsv=require(_0x382f('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x382f('0xe'));var authService=require(_0x382f('0xf'));var qs=require(_0x382f('0x10'));var as=require(_0x382f('0x11'));var hardwareService=require(_0x382f('0x12'));var logger=require(_0x382f('0x13'))(_0x382f('0x14'));var utils=require('../../config/utils');var config=require(_0x382f('0x15'));var licenseUtil=require(_0x382f('0x16'));var db=require(_0x382f('0x17'))['db'];function respondWithStatusCode(_0xf9583b,_0x36854b){_0x36854b=_0x36854b||0xcc;return function(_0xedc78){if(_0xedc78){return _0xf9583b[_0x382f('0x18')](_0x36854b);}return _0xf9583b[_0x382f('0x19')](_0x36854b)[_0x382f('0x1a')]();};}function respondWithResult(_0x29a32a,_0x408caa){_0x408caa=_0x408caa||0xc8;return function(_0x2ff58){if(_0x2ff58){return _0x29a32a[_0x382f('0x19')](_0x408caa)[_0x382f('0x1b')](_0x2ff58);}};}function respondWithFilteredResult(_0x1b98e7,_0x34f770){return function(_0x355169){if(_0x355169){var _0x4cdbee=typeof _0x34f770[_0x382f('0x1c')]==='undefined'&&typeof _0x34f770[_0x382f('0x1d')]===_0x382f('0x1e');var _0x43a562=_0x355169[_0x382f('0x1f')];var _0x41670c=_0x4cdbee?0x0:_0x34f770[_0x382f('0x1c')];var _0x3315a7=_0x4cdbee?_0x355169[_0x382f('0x1f')]:_0x34f770[_0x382f('0x1c')]+_0x34f770['limit'];var _0x418a83;if(_0x3315a7>=_0x43a562){_0x3315a7=_0x43a562;_0x418a83=0xc8;}else{_0x418a83=0xce;}_0x1b98e7[_0x382f('0x19')](_0x418a83);return _0x1b98e7[_0x382f('0x20')](_0x382f('0x21'),_0x41670c+'-'+_0x3315a7+'/'+_0x43a562)[_0x382f('0x1b')](_0x355169);}return null;};}function patchUpdates(_0x3cb1fe){return function(_0x4f6bd5){try{jsonpatch[_0x382f('0x22')](_0x4f6bd5,_0x3cb1fe,!![]);}catch(_0x358064){return BPromise['reject'](_0x358064);}return _0x4f6bd5[_0x382f('0x23')]();};}function saveUpdates(_0x24eaf9,_0x3c9d86){return function(_0x103d47){if(_0x103d47){return _0x103d47[_0x382f('0x24')](_0x24eaf9)['then'](function(_0x2e0f1e){return _0x2e0f1e;});}return null;};}function removeEntity(_0x3fa696,_0x3c8fc9){return function(_0x36bc61){if(_0x36bc61){return _0x36bc61[_0x382f('0x25')]()['then'](function(){_0x3fa696[_0x382f('0x19')](0xcc)[_0x382f('0x1a')]();});}};}function handleEntityNotFound(_0x210faf,_0x375ddd){return function(_0x8d07){if(!_0x8d07){_0x210faf['sendStatus'](0x194);}return _0x8d07;};}function handleError(_0xa96527,_0x1add65){_0x1add65=_0x1add65||0x1f4;return function(_0x1e2a79){logger[_0x382f('0x26')](_0x1e2a79[_0x382f('0x27')]);if(_0x1e2a79['name']){delete _0x1e2a79[_0x382f('0x28')];}_0xa96527[_0x382f('0x19')](_0x1add65)[_0x382f('0x29')](_0x1e2a79);};}exports[_0x382f('0x2a')]=function(_0x319213,_0xf1dcff){var _0x4c0899={},_0x3d5cc4={},_0x3f7a6f={'count':0x0,'rows':[]};var _0x3a550d=_[_0x382f('0x2b')](db['MailTransferReport']['rawAttributes'],function(_0x33996c){return{'name':_0x33996c[_0x382f('0x2c')],'type':_0x33996c[_0x382f('0x2d')]['key']};});_0x3d5cc4[_0x382f('0x2e')]=_[_0x382f('0x2b')](_0x3a550d,_0x382f('0x28'));_0x3d5cc4[_0x382f('0x2f')]=_[_0x382f('0x30')](_0x319213[_0x382f('0x2f')]);_0x3d5cc4['filters']=_['intersection'](_0x3d5cc4[_0x382f('0x2e')],_0x3d5cc4['query']);_0x4c0899['attributes']=_[_0x382f('0x31')](_0x3d5cc4[_0x382f('0x2e')],qs[_0x382f('0x32')](_0x319213[_0x382f('0x2f')][_0x382f('0x32')]));_0x4c0899['attributes']=_0x4c0899[_0x382f('0x33')][_0x382f('0x34')]?_0x4c0899[_0x382f('0x33')]:_0x3d5cc4[_0x382f('0x2e')];if(!_0x319213[_0x382f('0x2f')]['hasOwnProperty'](_0x382f('0x35'))){_0x4c0899[_0x382f('0x1d')]=qs[_0x382f('0x1d')](_0x319213[_0x382f('0x2f')][_0x382f('0x1d')]);_0x4c0899[_0x382f('0x1c')]=qs[_0x382f('0x1c')](_0x319213[_0x382f('0x2f')][_0x382f('0x1c')]);}_0x4c0899[_0x382f('0x36')]=qs[_0x382f('0x37')](_0x319213[_0x382f('0x2f')][_0x382f('0x37')]);_0x4c0899['where']=qs[_0x382f('0x38')](_[_0x382f('0x39')](_0x319213[_0x382f('0x2f')],_0x3d5cc4[_0x382f('0x38')]),_0x3a550d);if(_0x319213[_0x382f('0x2f')]['filter']){_0x4c0899['where']=_['merge'](_0x4c0899[_0x382f('0x3a')],{'$or':_[_0x382f('0x2b')](_0x3a550d,function(_0x26925c){if(_0x26925c[_0x382f('0x2d')]!==_0x382f('0x3b')){var _0x5d5912={};_0x5d5912[_0x26925c[_0x382f('0x28')]]={'$like':'%'+_0x319213['query'][_0x382f('0x3c')]+'%'};return _0x5d5912;}})});}_0x4c0899=_['merge']({},_0x4c0899,_0x319213[_0x382f('0x3d')]);var _0x4ea256={'where':_0x4c0899[_0x382f('0x3a')]};return db['MailTransferReport'][_0x382f('0x1f')](_0x4ea256)[_0x382f('0x3e')](function(_0x487fe7){_0x3f7a6f[_0x382f('0x1f')]=_0x487fe7;if(_0x319213[_0x382f('0x2f')][_0x382f('0x3f')]){_0x4c0899[_0x382f('0x40')]=[{'all':!![]}];}return db[_0x382f('0x41')][_0x382f('0x42')](_0x4c0899);})['then'](function(_0xcbc9f6){_0x3f7a6f[_0x382f('0x43')]=_0xcbc9f6;return _0x3f7a6f;})['then'](respondWithFilteredResult(_0xf1dcff,_0x4c0899))[_0x382f('0x44')](handleError(_0xf1dcff,null));};exports[_0x382f('0x45')]=function(_0x556205,_0x5a47ef){var _0x2ca2c1={'raw':!![],'where':{'id':_0x556205['params']['id']}},_0x1b1b1d={};_0x1b1b1d['model']=_[_0x382f('0x30')](db['MailTransferReport']['rawAttributes']);_0x1b1b1d[_0x382f('0x2f')]=_[_0x382f('0x30')](_0x556205[_0x382f('0x2f')]);_0x1b1b1d['filters']=_['intersection'](_0x1b1b1d[_0x382f('0x2e')],_0x1b1b1d[_0x382f('0x2f')]);_0x2ca2c1[_0x382f('0x33')]=_[_0x382f('0x31')](_0x1b1b1d['model'],qs[_0x382f('0x32')](_0x556205[_0x382f('0x2f')]['fields']));_0x2ca2c1[_0x382f('0x33')]=_0x2ca2c1[_0x382f('0x33')]['length']?_0x2ca2c1[_0x382f('0x33')]:_0x1b1b1d['model'];if(_0x556205[_0x382f('0x2f')]['includeAll']){_0x2ca2c1[_0x382f('0x40')]=[{'all':!![]}];}_0x2ca2c1=_[_0x382f('0x46')]({},_0x2ca2c1,_0x556205[_0x382f('0x3d')]);return db['MailTransferReport'][_0x382f('0x47')](_0x2ca2c1)[_0x382f('0x3e')](handleEntityNotFound(_0x5a47ef,null))['then'](respondWithResult(_0x5a47ef,null))[_0x382f('0x44')](handleError(_0x5a47ef,null));};exports[_0x382f('0x48')]=function(_0x19c01b,_0x13bc38){return db[_0x382f('0x41')][_0x382f('0x48')](_0x19c01b[_0x382f('0x49')],{})[_0x382f('0x3e')](respondWithResult(_0x13bc38,0xc9))[_0x382f('0x44')](handleError(_0x13bc38,null));};exports['update']=function(_0x1275b7,_0x185916){if(_0x1275b7[_0x382f('0x49')]['id']){delete _0x1275b7[_0x382f('0x49')]['id'];}return db['MailTransferReport'][_0x382f('0x47')]({'where':{'id':_0x1275b7['params']['id']}})[_0x382f('0x3e')](handleEntityNotFound(_0x185916,null))[_0x382f('0x3e')](saveUpdates(_0x1275b7['body'],null))[_0x382f('0x3e')](respondWithResult(_0x185916,null))[_0x382f('0x44')](handleError(_0x185916,null));};exports[_0x382f('0x25')]=function(_0x554760,_0x53d793){return db[_0x382f('0x41')][_0x382f('0x47')]({'where':{'id':_0x554760[_0x382f('0x4a')]['id']}})[_0x382f('0x3e')](handleEntityNotFound(_0x53d793,null))[_0x382f('0x3e')](removeEntity(_0x53d793,null))[_0x382f('0x44')](handleError(_0x53d793,null));};exports[_0x382f('0x4b')]=function(_0x22cb7e,_0x731178){return db['MailTransferReport'][_0x382f('0x4b')]()[_0x382f('0x3e')](respondWithResult(_0x731178,null))[_0x382f('0x44')](handleError(_0x731178,null));}; \ No newline at end of file +var _0x7061=['type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','MailTransferReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','reject','save','update','then','destroy','end','error','stack','name','index','rawAttributes','fieldName'];(function(_0x151174,_0x264fe5){var _0x4fc099=function(_0x400b88){while(--_0x400b88){_0x151174['push'](_0x151174['shift']());}};_0x4fc099(++_0x264fe5);}(_0x7061,0xbd));var _0x1706=function(_0x1abb46,_0x1f089c){_0x1abb46=_0x1abb46-0x0;var _0x593f0b=_0x7061[_0x1abb46];return _0x593f0b;};'use strict';var emlformat=require(_0x1706('0x0'));var rimraf=require(_0x1706('0x1'));var zipdir=require(_0x1706('0x2'));var jsonpatch=require(_0x1706('0x3'));var rp=require(_0x1706('0x4'));var moment=require(_0x1706('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1706('0x6'));var util=require(_0x1706('0x7'));var path=require(_0x1706('0x8'));var sox=require(_0x1706('0x9'));var csv=require(_0x1706('0xa'));var ejs=require(_0x1706('0xb'));var fs=require('fs');var fs_extra=require(_0x1706('0xc'));var _=require('lodash');var squel=require(_0x1706('0xd'));var crypto=require(_0x1706('0xe'));var jsforce=require(_0x1706('0xf'));var deskjs=require(_0x1706('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1706('0x11'));var Papa=require(_0x1706('0x12'));var Redis=require(_0x1706('0x13'));var authService=require(_0x1706('0x14'));var qs=require(_0x1706('0x15'));var as=require(_0x1706('0x16'));var hardwareService=require(_0x1706('0x17'));var logger=require('../../config/logger')(_0x1706('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1706('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x583be2,_0x30c673){_0x30c673=_0x30c673||0xcc;return function(_0x46b389){if(_0x46b389){return _0x583be2[_0x1706('0x1a')](_0x30c673);}return _0x583be2[_0x1706('0x1b')](_0x30c673)['end']();};}function respondWithResult(_0x1fd365,_0x141eb6){_0x141eb6=_0x141eb6||0xc8;return function(_0x2cccbc){if(_0x2cccbc){return _0x1fd365[_0x1706('0x1b')](_0x141eb6)[_0x1706('0x1c')](_0x2cccbc);}};}function respondWithFilteredResult(_0x48994d,_0x1690ea){return function(_0x18eff1){if(_0x18eff1){var _0x58fd80=typeof _0x1690ea['offset']===_0x1706('0x1d')&&typeof _0x1690ea['limit']===_0x1706('0x1d');var _0x168e42=_0x18eff1[_0x1706('0x1e')];var _0x20fbb4=_0x58fd80?0x0:_0x1690ea[_0x1706('0x1f')];var _0x1ebbd2=_0x58fd80?_0x18eff1[_0x1706('0x1e')]:_0x1690ea[_0x1706('0x1f')]+_0x1690ea[_0x1706('0x20')];var _0x1919a0;if(_0x1ebbd2>=_0x168e42){_0x1ebbd2=_0x168e42;_0x1919a0=0xc8;}else{_0x1919a0=0xce;}_0x48994d['status'](_0x1919a0);return _0x48994d['set']('Content-Range',_0x20fbb4+'-'+_0x1ebbd2+'/'+_0x168e42)[_0x1706('0x1c')](_0x18eff1);}return null;};}function patchUpdates(_0x538093){return function(_0x2c7caf){try{jsonpatch['apply'](_0x2c7caf,_0x538093,!![]);}catch(_0x552fd8){return BPromise[_0x1706('0x21')](_0x552fd8);}return _0x2c7caf[_0x1706('0x22')]();};}function saveUpdates(_0x54979b,_0x2ed3b2){return function(_0xf38248){if(_0xf38248){return _0xf38248[_0x1706('0x23')](_0x54979b)[_0x1706('0x24')](function(_0x22d610){return _0x22d610;});}return null;};}function removeEntity(_0x1d1a92,_0x55d464){return function(_0x15769f){if(_0x15769f){return _0x15769f[_0x1706('0x25')]()[_0x1706('0x24')](function(){_0x1d1a92[_0x1706('0x1b')](0xcc)[_0x1706('0x26')]();});}};}function handleEntityNotFound(_0x259430,_0x130354){return function(_0x35ee95){if(!_0x35ee95){_0x259430[_0x1706('0x1a')](0x194);}return _0x35ee95;};}function handleError(_0x41feab,_0x2fcaa5){_0x2fcaa5=_0x2fcaa5||0x1f4;return function(_0x5aa527){logger[_0x1706('0x27')](_0x5aa527[_0x1706('0x28')]);if(_0x5aa527[_0x1706('0x29')]){delete _0x5aa527[_0x1706('0x29')];}_0x41feab[_0x1706('0x1b')](_0x2fcaa5)['send'](_0x5aa527);};}exports[_0x1706('0x2a')]=function(_0x4b1a01,_0x31cf2d){var _0x1e537f={},_0x23c435={},_0x1f9aca={'count':0x0,'rows':[]};var _0x2a652f=_['map'](db['MailTransferReport'][_0x1706('0x2b')],function(_0x4a9c56){return{'name':_0x4a9c56[_0x1706('0x2c')],'type':_0x4a9c56[_0x1706('0x2d')][_0x1706('0x2e')]};});_0x23c435[_0x1706('0x2f')]=_[_0x1706('0x30')](_0x2a652f,_0x1706('0x29'));_0x23c435[_0x1706('0x31')]=_[_0x1706('0x32')](_0x4b1a01[_0x1706('0x31')]);_0x23c435[_0x1706('0x33')]=_[_0x1706('0x34')](_0x23c435[_0x1706('0x2f')],_0x23c435[_0x1706('0x31')]);_0x1e537f[_0x1706('0x35')]=_[_0x1706('0x34')](_0x23c435[_0x1706('0x2f')],qs['fields'](_0x4b1a01[_0x1706('0x31')][_0x1706('0x36')]));_0x1e537f[_0x1706('0x35')]=_0x1e537f[_0x1706('0x35')][_0x1706('0x37')]?_0x1e537f['attributes']:_0x23c435[_0x1706('0x2f')];if(!_0x4b1a01[_0x1706('0x31')][_0x1706('0x38')](_0x1706('0x39'))){_0x1e537f[_0x1706('0x20')]=qs[_0x1706('0x20')](_0x4b1a01[_0x1706('0x31')][_0x1706('0x20')]);_0x1e537f[_0x1706('0x1f')]=qs[_0x1706('0x1f')](_0x4b1a01['query'][_0x1706('0x1f')]);}_0x1e537f[_0x1706('0x3a')]=qs[_0x1706('0x3b')](_0x4b1a01[_0x1706('0x31')]['sort']);_0x1e537f[_0x1706('0x3c')]=qs[_0x1706('0x33')](_[_0x1706('0x3d')](_0x4b1a01[_0x1706('0x31')],_0x23c435[_0x1706('0x33')]),_0x2a652f);if(_0x4b1a01[_0x1706('0x31')][_0x1706('0x3e')]){_0x1e537f[_0x1706('0x3c')]=_['merge'](_0x1e537f['where'],{'$or':_[_0x1706('0x30')](_0x2a652f,function(_0x55a095){if(_0x55a095[_0x1706('0x2d')]!==_0x1706('0x3f')){var _0x3ee637={};_0x3ee637[_0x55a095['name']]={'$like':'%'+_0x4b1a01['query']['filter']+'%'};return _0x3ee637;}})});}_0x1e537f=_[_0x1706('0x40')]({},_0x1e537f,_0x4b1a01[_0x1706('0x41')]);var _0x2732d8={'where':_0x1e537f[_0x1706('0x3c')]};return db[_0x1706('0x42')][_0x1706('0x1e')](_0x2732d8)[_0x1706('0x24')](function(_0x25c221){_0x1f9aca[_0x1706('0x1e')]=_0x25c221;if(_0x4b1a01[_0x1706('0x31')][_0x1706('0x43')]){_0x1e537f[_0x1706('0x44')]=[{'all':!![]}];}return db[_0x1706('0x42')][_0x1706('0x45')](_0x1e537f);})[_0x1706('0x24')](function(_0x7ac92a){_0x1f9aca[_0x1706('0x46')]=_0x7ac92a;return _0x1f9aca;})[_0x1706('0x24')](respondWithFilteredResult(_0x31cf2d,_0x1e537f))['catch'](handleError(_0x31cf2d,null));};exports[_0x1706('0x47')]=function(_0xccc824,_0x55596f){var _0x3ba230={'raw':!![],'where':{'id':_0xccc824[_0x1706('0x48')]['id']}},_0x1cbc84={};_0x1cbc84[_0x1706('0x2f')]=_['keys'](db['MailTransferReport']['rawAttributes']);_0x1cbc84[_0x1706('0x31')]=_[_0x1706('0x32')](_0xccc824[_0x1706('0x31')]);_0x1cbc84[_0x1706('0x33')]=_[_0x1706('0x34')](_0x1cbc84[_0x1706('0x2f')],_0x1cbc84[_0x1706('0x31')]);_0x3ba230[_0x1706('0x35')]=_[_0x1706('0x34')](_0x1cbc84[_0x1706('0x2f')],qs[_0x1706('0x36')](_0xccc824[_0x1706('0x31')]['fields']));_0x3ba230[_0x1706('0x35')]=_0x3ba230[_0x1706('0x35')][_0x1706('0x37')]?_0x3ba230[_0x1706('0x35')]:_0x1cbc84[_0x1706('0x2f')];if(_0xccc824[_0x1706('0x31')][_0x1706('0x43')]){_0x3ba230[_0x1706('0x44')]=[{'all':!![]}];}_0x3ba230=_[_0x1706('0x40')]({},_0x3ba230,_0xccc824[_0x1706('0x41')]);return db[_0x1706('0x42')][_0x1706('0x49')](_0x3ba230)[_0x1706('0x24')](handleEntityNotFound(_0x55596f,null))[_0x1706('0x24')](respondWithResult(_0x55596f,null))[_0x1706('0x4a')](handleError(_0x55596f,null));};exports[_0x1706('0x4b')]=function(_0x4c9fe8,_0x3a6946){return db[_0x1706('0x42')][_0x1706('0x4b')](_0x4c9fe8[_0x1706('0x4c')],{})[_0x1706('0x24')](respondWithResult(_0x3a6946,0xc9))[_0x1706('0x4a')](handleError(_0x3a6946,null));};exports[_0x1706('0x23')]=function(_0x4c3de0,_0x8ca8c2){if(_0x4c3de0[_0x1706('0x4c')]['id']){delete _0x4c3de0[_0x1706('0x4c')]['id'];}return db[_0x1706('0x42')][_0x1706('0x49')]({'where':{'id':_0x4c3de0[_0x1706('0x48')]['id']}})['then'](handleEntityNotFound(_0x8ca8c2,null))['then'](saveUpdates(_0x4c3de0[_0x1706('0x4c')],null))['then'](respondWithResult(_0x8ca8c2,null))[_0x1706('0x4a')](handleError(_0x8ca8c2,null));};exports[_0x1706('0x25')]=function(_0x22b022,_0x14754f){return db['MailTransferReport'][_0x1706('0x49')]({'where':{'id':_0x22b022[_0x1706('0x48')]['id']}})[_0x1706('0x24')](handleEntityNotFound(_0x14754f,null))[_0x1706('0x24')](removeEntity(_0x14754f,null))['catch'](handleError(_0x14754f,null));};exports[_0x1706('0x4d')]=function(_0x35ea8a,_0x5a86a6){return db[_0x1706('0x42')][_0x1706('0x4d')]()['then'](respondWithResult(_0x5a86a6,null))[_0x1706('0x4a')](handleError(_0x5a86a6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 0f58856..73b235d 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 _0x5d01=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer'];(function(_0xb26065,_0x36df08){var _0x974dce=function(_0x1b5ace){while(--_0x1b5ace){_0xb26065['push'](_0xb26065['shift']());}};_0x974dce(++_0x36df08);}(_0x5d01,0xe5));var _0x15d0=function(_0x33c9d8,_0x123ea0){_0x33c9d8=_0x33c9d8-0x0;var _0x111e52=_0x5d01[_0x33c9d8];return _0x111e52;};'use strict';var _=require(_0x15d0('0x0'));var util=require('util');var logger=require(_0x15d0('0x1'))(_0x15d0('0x2'));var moment=require('moment');var BPromise=require(_0x15d0('0x3'));var rp=require(_0x15d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15d0('0x5'));var attributes=require(_0x15d0('0x6'));module[_0x15d0('0x7')]=function(_0x1b0e27,_0x2af55d){return _0x1b0e27[_0x15d0('0x8')](_0x15d0('0x9'),attributes,{'tableName':_0x15d0('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x15d0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xecd9=['api','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2981fb,_0x5d0e8d){var _0x4f5ea0=function(_0xb85fc){while(--_0xb85fc){_0x2981fb['push'](_0x2981fb['shift']());}};_0x4f5ea0(++_0x5d0e8d);}(_0xecd9,0x13f));var _0x9ecd=function(_0x114b67,_0x2d298f){_0x114b67=_0x114b67-0x0;var _0x159a01=_0xecd9[_0x114b67];return _0x159a01;};'use strict';var _=require(_0x9ecd('0x0'));var util=require(_0x9ecd('0x1'));var logger=require(_0x9ecd('0x2'))(_0x9ecd('0x3'));var moment=require(_0x9ecd('0x4'));var BPromise=require(_0x9ecd('0x5'));var rp=require(_0x9ecd('0x6'));var fs=require('fs');var path=require(_0x9ecd('0x7'));var rimraf=require('rimraf');var config=require(_0x9ecd('0x8'));var attributes=require(_0x9ecd('0x9'));module[_0x9ecd('0xa')]=function(_0x3106a4,_0x18346c){return _0x3106a4['define'](_0x9ecd('0xb'),attributes,{'tableName':_0x9ecd('0xc'),'paranoid':![],'indexes':[{'name':_0x9ecd('0xd'),'fields':[_0x9ecd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 166eacd..5d4774b 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 _0x1b78=['stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5b6762,_0xebb101){var _0x34c15b=function(_0xb84ba7){while(--_0xb84ba7){_0x5b6762['push'](_0x5b6762['shift']());}};_0x34c15b(++_0xebb101);}(_0x1b78,0x164));var _0x81b7=function(_0x7e9670,_0x2cee61){_0x7e9670=_0x7e9670-0x0;var _0x1196d5=_0x1b78[_0x7e9670];return _0x1196d5;};'use strict';var _=require(_0x81b7('0x0'));var util=require(_0x81b7('0x1'));var moment=require(_0x81b7('0x2'));var BPromise=require(_0x81b7('0x3'));var rs=require(_0x81b7('0x4'));var fs=require('fs');var Redis=require(_0x81b7('0x5'));var db=require(_0x81b7('0x6'))['db'];var utils=require(_0x81b7('0x7'));var logger=require(_0x81b7('0x8'))(_0x81b7('0x9'));var config=require(_0x81b7('0xa'));var jayson=require(_0x81b7('0xb'));var client=jayson[_0x81b7('0xc')][_0x81b7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d24eb,_0x301350,_0x16ff35){return new BPromise(function(_0x10eb93,_0x4b95b0){return client[_0x81b7('0xe')](_0x4d24eb,_0x16ff35)[_0x81b7('0xf')](function(_0x26657d){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x301350,'request\x20sent');logger[_0x81b7('0x10')](_0x81b7('0x11'),_0x301350,_0x81b7('0x12'),JSON[_0x81b7('0x13')](_0x26657d));if(_0x26657d[_0x81b7('0x14')]){if(_0x26657d[_0x81b7('0x14')][_0x81b7('0x15')]===0x1f4){logger['error'](_0x81b7('0x16'),_0x301350,_0x26657d[_0x81b7('0x14')][_0x81b7('0x17')]);return _0x4b95b0(_0x26657d[_0x81b7('0x14')][_0x81b7('0x17')]);}logger[_0x81b7('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x301350,_0x26657d[_0x81b7('0x14')][_0x81b7('0x17')]);return _0x10eb93(_0x26657d['error'][_0x81b7('0x17')]);}else{logger['info'](_0x81b7('0x16'),_0x301350,'request\x20sent');_0x10eb93(_0x26657d[_0x81b7('0x18')][_0x81b7('0x17')]);}})['catch'](function(_0x10c76b){logger[_0x81b7('0x14')](_0x81b7('0x16'),_0x301350,_0x10c76b);_0x4b95b0(_0x10c76b);});});} \ No newline at end of file +var _0xa89b=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x5bfe0c,_0x16a2e4){var _0x2e3c3b=function(_0x3f20f4){while(--_0x3f20f4){_0x5bfe0c['push'](_0x5bfe0c['shift']());}};_0x2e3c3b(++_0x16a2e4);}(_0xa89b,0x134));var _0xba89=function(_0x3e6ac0,_0x34b200){_0x3e6ac0=_0x3e6ac0-0x0;var _0xe1dee5=_0xa89b[_0x3e6ac0];return _0xe1dee5;};'use strict';var _=require(_0xba89('0x0'));var util=require(_0xba89('0x1'));var moment=require(_0xba89('0x2'));var BPromise=require(_0xba89('0x3'));var rs=require(_0xba89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba89('0x5'))['db'];var utils=require(_0xba89('0x6'));var logger=require(_0xba89('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xba89('0x8'));var client=jayson[_0xba89('0x9')][_0xba89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x434ab6,_0x2ff70a,_0x118935){return new BPromise(function(_0x1d3694,_0x40a9e2){return client['request'](_0x434ab6,_0x118935)[_0xba89('0xb')](function(_0xc1066b){logger['info'](_0xba89('0xc'),_0x2ff70a,'request\x20sent');logger[_0xba89('0xd')](_0xba89('0xe'),_0x2ff70a,_0xba89('0xf'),JSON['stringify'](_0xc1066b));if(_0xc1066b['error']){if(_0xc1066b[_0xba89('0x10')][_0xba89('0x11')]===0x1f4){logger[_0xba89('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x2ff70a,_0xc1066b['error'][_0xba89('0x12')]);return _0x40a9e2(_0xc1066b[_0xba89('0x10')][_0xba89('0x12')]);}logger[_0xba89('0x10')](_0xba89('0xc'),_0x2ff70a,_0xc1066b[_0xba89('0x10')][_0xba89('0x12')]);return _0x1d3694(_0xc1066b[_0xba89('0x10')][_0xba89('0x12')]);}else{logger[_0xba89('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x2ff70a,'request\x20sent');_0x1d3694(_0xc1066b[_0xba89('0x14')][_0xba89('0x12')]);}})[_0xba89('0x15')](function(_0x43e819){logger[_0xba89('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x2ff70a,_0x43e819);_0x40a9e2(_0x43e819);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 624775e..9487650 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 _0x1662=['describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated'];(function(_0x5c16bf,_0x5d4465){var _0x22b6e3=function(_0x59bc68){while(--_0x59bc68){_0x5c16bf['push'](_0x5c16bf['shift']());}};_0x22b6e3(++_0x5d4465);}(_0x1662,0x1ec));var _0x2166=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1662[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require(_0x2166('0x0'));var path=require(_0x2166('0x1'));var timeout=require(_0x2166('0x2'));var express=require(_0x2166('0x3'));var router=express['Router']();var fs_extra=require(_0x2166('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2166('0x5'));var config=require(_0x2166('0x6'));var controller=require(_0x2166('0x7'));router[_0x2166('0x8')]('/',auth['isAuthenticated'](),controller[_0x2166('0x9')]);router[_0x2166('0x8')](_0x2166('0xa'),auth[_0x2166('0xb')](),controller[_0x2166('0xc')]);router[_0x2166('0x8')](_0x2166('0xd'),auth[_0x2166('0xb')](),controller['show']);router[_0x2166('0xe')]('/',auth['isAuthenticated'](),controller[_0x2166('0xf')]);router[_0x2166('0x10')](_0x2166('0xd'),auth['isAuthenticated'](),controller[_0x2166('0x11')]);router[_0x2166('0x12')](_0x2166('0xd'),auth[_0x2166('0xb')](),controller[_0x2166('0x13')]);module[_0x2166('0x14')]=router; \ No newline at end of file +var _0xd5ff=['./memberReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x346597,_0x275261){var _0x4a375a=function(_0x31e083){while(--_0x31e083){_0x346597['push'](_0x346597['shift']());}};_0x4a375a(++_0x275261);}(_0xd5ff,0x1ad));var _0xfd5f=function(_0x5c6b80,_0x291fe5){_0x5c6b80=_0x5c6b80-0x0;var _0xbde1ae=_0xd5ff[_0x5c6b80];return _0xbde1ae;};'use strict';var multer=require(_0xfd5f('0x0'));var util=require(_0xfd5f('0x1'));var path=require(_0xfd5f('0x2'));var timeout=require(_0xfd5f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfd5f('0x4'));var auth=require(_0xfd5f('0x5'));var interaction=require(_0xfd5f('0x6'));var config=require(_0xfd5f('0x7'));var controller=require(_0xfd5f('0x8'));router['get']('/',auth[_0xfd5f('0x9')](),controller[_0xfd5f('0xa')]);router[_0xfd5f('0xb')](_0xfd5f('0xc'),auth[_0xfd5f('0x9')](),controller[_0xfd5f('0xd')]);router['get'](_0xfd5f('0xe'),auth[_0xfd5f('0x9')](),controller[_0xfd5f('0xf')]);router[_0xfd5f('0x10')]('/',auth[_0xfd5f('0x9')](),controller[_0xfd5f('0x11')]);router[_0xfd5f('0x12')](_0xfd5f('0xe'),auth[_0xfd5f('0x9')](),controller[_0xfd5f('0x13')]);router[_0xfd5f('0x14')](_0xfd5f('0xe'),auth[_0xfd5f('0x9')](),controller[_0xfd5f('0x15')]);module[_0xfd5f('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 6847200..c70ab63 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 _0x8ca7=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING'];(function(_0x5add57,_0x50f735){var _0x1ed737=function(_0x45f175){while(--_0x45f175){_0x5add57['push'](_0x5add57['shift']());}};_0x1ed737(++_0x50f735);}(_0x8ca7,0xb1));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x78ca('0x0'));var moment=require('moment');module[_0x78ca('0x1')]={'channel':{'type':Sequelize[_0x78ca('0x2')]},'membername':{'type':Sequelize[_0x78ca('0x2')]},'interface':{'type':Sequelize[_0x78ca('0x2')]},'type':{'type':Sequelize[_0x78ca('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x78ca('0x3')},'duration':{'type':Sequelize[_0x78ca('0x4')]},'enterAt':{'type':Sequelize[_0x78ca('0x5')]},'exitAt':{'type':Sequelize[_0x78ca('0x5')],'set':function(_0xa84b17){var _0x3a73e2=moment(_0xa84b17);var _0x5abcd4=moment(this[_0x78ca('0x6')]('enterAt'));var _0x4a2b1c=_0x3a73e2[_0x78ca('0x7')](_0x5abcd4,_0x78ca('0x8'));this['setDataValue'](_0x78ca('0x9'),_0xa84b17);this[_0x78ca('0xa')](_0x78ca('0xb'),_0x4a2b1c>=0x0?_0x4a2b1c:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x78ca('0xc')},'data2':{'type':Sequelize[_0x78ca('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0x78ca('0xd')},'data4':{'type':Sequelize[_0x78ca('0x2')],'comment':_0x78ca('0xe')},'data5':{'type':Sequelize[_0x78ca('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x78ca('0x4')]},'uniqueid':{'type':Sequelize[_0x78ca('0x2')]}}; \ No newline at end of file +var _0x16db=['talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[destination]'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16db,0x16a));var _0xb16d=function(_0x454b36,_0x74cac4){_0x454b36=_0x454b36-0x0;var _0x389b43=_0x16db[_0x454b36];return _0x389b43;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb16d('0x0'));module['exports']={'channel':{'type':Sequelize[_0xb16d('0x1')]},'membername':{'type':Sequelize[_0xb16d('0x1')]},'interface':{'type':Sequelize[_0xb16d('0x1')]},'type':{'type':Sequelize[_0xb16d('0x1')],'defaultValue':_0xb16d('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xb16d('0x3')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb16d('0x4')],'set':function(_0x414266){var _0x540713=moment(_0x414266);var _0x1e2660=moment(this[_0xb16d('0x5')](_0xb16d('0x6')));var _0x3aea3b=_0x540713[_0xb16d('0x7')](_0x1e2660,_0xb16d('0x8'));this[_0xb16d('0x9')](_0xb16d('0xa'),_0x414266);this[_0xb16d('0x9')](_0xb16d('0xb'),_0x3aea3b>=0x0?_0x3aea3b:null);}},'data1':{'type':Sequelize[_0xb16d('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xb16d('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xb16d('0xc')},'data4':{'type':Sequelize[_0xb16d('0x1')],'comment':_0xb16d('0xd')},'data5':{'type':Sequelize[_0xb16d('0x1')],'comment':_0xb16d('0xe')},'role':{'type':Sequelize[_0xb16d('0x1')]},'internal':{'type':Sequelize[_0xb16d('0x3')]},'uniqueid':{'type':Sequelize[_0xb16d('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 3fad86d..12b7e15 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0x55ca[_0x1221e8];return _0x3f3041;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _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(_0x514717,_0x3e4573){var _0x51caa7=function(_0xa70730){while(--_0xa70730){_0x514717['push'](_0x514717['shift']());}};_0x51caa7(++_0x3e4573);}(_0x008c,0x188));var _0xc008=function(_0xf2efae,_0x307737){_0xf2efae=_0xf2efae-0x0;var _0x241311=_0x008c[_0xf2efae];return _0x241311;};'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 c7cf096..af61c13 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 _0x9e5c=['exports','MemberReport','membername_interface','membername','interface','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e5c,0x17f));var _0xc9e5=function(_0x518dca,_0x3762c4){_0x518dca=_0x518dca-0x0;var _0x239950=_0x9e5c[_0x518dca];return _0x239950;};'use strict';var _=require(_0xc9e5('0x0'));var util=require('util');var logger=require(_0xc9e5('0x1'))(_0xc9e5('0x2'));var moment=require(_0xc9e5('0x3'));var BPromise=require(_0xc9e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9e5('0x5'));var rimraf=require(_0xc9e5('0x6'));var config=require(_0xc9e5('0x7'));var attributes=require(_0xc9e5('0x8'));module[_0xc9e5('0x9')]=function(_0x570775,_0x46694e){return _0x570775['define'](_0xc9e5('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xc9e5('0xb'),'fields':[_0xc9e5('0xc'),_0xc9e5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72bd=['../../config/logger','api','request-promise','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x72bd,0xcf));var _0xd72b=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x72bd[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xd72b('0x0'));var util=require('util');var logger=require(_0xd72b('0x1'))(_0xd72b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd72b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd72b('0x4'));var config=require(_0xd72b('0x5'));var attributes=require(_0xd72b('0x6'));module['exports']=function(_0x3f3b04,_0x1668d8){return _0x3f3b04[_0xd72b('0x7')](_0xd72b('0x8'),attributes,{'tableName':_0xd72b('0x9'),'paranoid':![],'indexes':[{'name':_0xd72b('0xa'),'fields':[_0xd72b('0xb'),_0xd72b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 285599e..bcdbbf8 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 _0xf78f=['CreateMemberReport','create','body','UpdateMemberReport','update','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','client','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','info'];(function(_0x5750c1,_0x21018b){var _0x266a39=function(_0x1eac4d){while(--_0x1eac4d){_0x5750c1['push'](_0x5750c1['shift']());}};_0x266a39(++_0x21018b);}(_0xf78f,0x72));var _0xff78=function(_0x5ad513,_0x56f6a0){_0x5ad513=_0x5ad513-0x0;var _0xf4e9e9=_0xf78f[_0x5ad513];return _0xf4e9e9;};'use strict';var _=require('lodash');var util=require(_0xff78('0x0'));var moment=require(_0xff78('0x1'));var BPromise=require(_0xff78('0x2'));var rs=require(_0xff78('0x3'));var fs=require('fs');var Redis=require(_0xff78('0x4'));var db=require(_0xff78('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[_0xff78('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14edec,_0x2badae,_0x437ed4){return new BPromise(function(_0x32df40,_0x542ba4){return client[_0xff78('0x7')](_0x14edec,_0x437ed4)[_0xff78('0x8')](function(_0x15fd5b){logger['info']('MemberReport,\x20%s,\x20%s',_0x2badae,_0xff78('0x9'));logger[_0xff78('0xa')](_0xff78('0xb'),_0x2badae,_0xff78('0x9'),JSON[_0xff78('0xc')](_0x15fd5b));if(_0x15fd5b[_0xff78('0xd')]){if(_0x15fd5b[_0xff78('0xd')][_0xff78('0xe')]===0x1f4){logger['error'](_0xff78('0xf'),_0x2badae,_0x15fd5b[_0xff78('0xd')]['message']);return _0x542ba4(_0x15fd5b[_0xff78('0xd')]['message']);}logger[_0xff78('0xd')]('MemberReport,\x20%s,\x20%s',_0x2badae,_0x15fd5b[_0xff78('0xd')][_0xff78('0x10')]);return _0x32df40(_0x15fd5b[_0xff78('0xd')][_0xff78('0x10')]);}else{logger['info'](_0xff78('0xf'),_0x2badae,_0xff78('0x9'));_0x32df40(_0x15fd5b[_0xff78('0x11')][_0xff78('0x10')]);}})[_0xff78('0x12')](function(_0x1f6aef){logger[_0xff78('0xd')]('MemberReport,\x20%s,\x20%s',_0x2badae,_0x1f6aef);_0x542ba4(_0x1f6aef);});});}exports[_0xff78('0x13')]=function(_0x183cd1){var _0x2eda17=this;return new Promise(function(_0x201af4,_0x38aa08){return db[_0xff78('0x14')][_0xff78('0x15')]({'raw':_0x183cd1[_0xff78('0x16')]?_0x183cd1['options'][_0xff78('0x17')]===undefined?!![]:![]:!![],'where':_0x183cd1[_0xff78('0x16')]?_0x183cd1[_0xff78('0x16')]['where']||null:null,'attributes':_0x183cd1[_0xff78('0x16')]?_0x183cd1['options'][_0xff78('0x18')]||null:null,'limit':_0x183cd1[_0xff78('0x16')]?_0x183cd1[_0xff78('0x16')][_0xff78('0x19')]||null:null,'include':_0x183cd1[_0xff78('0x16')]?_0x183cd1['options']['include']?_[_0xff78('0x1a')](_0x183cd1[_0xff78('0x16')][_0xff78('0x1b')],function(_0x600dbe){return{'model':db[_0x600dbe[_0xff78('0x1c')]],'as':_0x600dbe['as'],'attributes':_0x600dbe[_0xff78('0x18')],'include':_0x600dbe[_0xff78('0x1b')]?_[_0xff78('0x1a')](_0x600dbe['include'],function(_0x184563){return{'model':db[_0x184563[_0xff78('0x1c')]],'as':_0x184563['as'],'attributes':_0x184563[_0xff78('0x18')],'include':_0x184563[_0xff78('0x1b')]?_['map'](_0x184563[_0xff78('0x1b')],function(_0xb77e22){return{'model':db[_0xb77e22[_0xff78('0x1c')]],'as':_0xb77e22['as'],'attributes':_0xb77e22[_0xff78('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff78('0x8')](function(_0x59c24d){logger[_0xff78('0x1d')](_0xff78('0x13'),_0x183cd1);logger[_0xff78('0xa')](_0xff78('0x13'),_0x183cd1,JSON[_0xff78('0xc')](_0x59c24d));_0x201af4(_0x59c24d);})[_0xff78('0x12')](function(_0x3500cc){logger[_0xff78('0xd')](_0xff78('0x13'),_0x3500cc[_0xff78('0x10')],_0x183cd1);_0x38aa08(_0x2eda17[_0xff78('0xd')](0x1f4,_0x3500cc['message']));});});};exports[_0xff78('0x1e')]=function(_0x22aa0a){var _0x2afa72=this;return new Promise(function(_0x238cb5,_0x598095){return db[_0xff78('0x14')][_0xff78('0x1f')](_0x22aa0a[_0xff78('0x20')],{'raw':_0x22aa0a[_0xff78('0x16')]?_0x22aa0a[_0xff78('0x16')][_0xff78('0x17')]===undefined?!![]:![]:!![]})[_0xff78('0x8')](function(_0x1425bb){logger['info'](_0xff78('0x1e'),_0x22aa0a);logger[_0xff78('0xa')](_0xff78('0x1e'),_0x22aa0a,JSON[_0xff78('0xc')](_0x1425bb));_0x238cb5(_0x1425bb);})[_0xff78('0x12')](function(_0x1e472b){logger[_0xff78('0xd')]('CreateMemberReport',_0x1e472b[_0xff78('0x10')],_0x22aa0a);_0x598095(_0x2afa72['error'](0x1f4,_0x1e472b[_0xff78('0x10')]));});});};exports[_0xff78('0x21')]=function(_0x194af6){var _0x150dd3=this;return new Promise(function(_0x4fd4b7,_0x266a56){return db[_0xff78('0x14')][_0xff78('0x22')](_0x194af6[_0xff78('0x20')],{'raw':_0x194af6[_0xff78('0x16')]?_0x194af6[_0xff78('0x16')][_0xff78('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194af6[_0xff78('0x16')]?_0x194af6[_0xff78('0x16')][_0xff78('0x23')]||null:null,'attributes':_0x194af6[_0xff78('0x16')]?_0x194af6['options'][_0xff78('0x18')]||null:null,'limit':_0x194af6[_0xff78('0x16')]?_0x194af6[_0xff78('0x16')][_0xff78('0x19')]||null:null})[_0xff78('0x8')](function(_0x315385){logger[_0xff78('0x1d')](_0xff78('0x21'),_0x194af6);logger[_0xff78('0xa')]('UpdateMemberReport',_0x194af6,JSON['stringify'](_0x315385));_0x4fd4b7(_0x315385);})[_0xff78('0x12')](function(_0xb04b47){logger['error']('UpdateMemberReport',_0xb04b47['message'],_0x194af6);_0x266a56(_0x150dd3[_0xff78('0xd')](0x1f4,_0xb04b47['message']));});});}; \ No newline at end of file +var _0x6333=['jayson/promise','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMemberReport','findAll','options','where','attributes','limit','include','map','model','then','stringify','CreateMemberReport','MemberReport','create','body','raw','debug','UpdateMemberReport','update','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x51a0a9,_0x569499){var _0x4bd20c=function(_0x26235a){while(--_0x26235a){_0x51a0a9['push'](_0x51a0a9['shift']());}};_0x4bd20c(++_0x569499);}(_0x6333,0x83));var _0x3633=function(_0x13d6bc,_0x48ed7f){_0x13d6bc=_0x13d6bc-0x0;var _0x230550=_0x6333[_0x13d6bc];return _0x230550;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3633('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3633('0x1'));var db=require(_0x3633('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3633('0x3'))('rpc');var config=require(_0x3633('0x4'));var jayson=require(_0x3633('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23c014,_0x1c4c20,_0x272da5){return new BPromise(function(_0x5c35ba,_0x5b5055){return client[_0x3633('0x6')](_0x23c014,_0x272da5)['then'](function(_0x4ee8e3){logger[_0x3633('0x7')](_0x3633('0x8'),_0x1c4c20,_0x3633('0x9'));logger['debug'](_0x3633('0xa'),_0x1c4c20,_0x3633('0x9'),JSON['stringify'](_0x4ee8e3));if(_0x4ee8e3['error']){if(_0x4ee8e3[_0x3633('0xb')]['code']===0x1f4){logger['error'](_0x3633('0x8'),_0x1c4c20,_0x4ee8e3[_0x3633('0xb')][_0x3633('0xc')]);return _0x5b5055(_0x4ee8e3[_0x3633('0xb')][_0x3633('0xc')]);}logger['error'](_0x3633('0x8'),_0x1c4c20,_0x4ee8e3[_0x3633('0xb')][_0x3633('0xc')]);return _0x5c35ba(_0x4ee8e3[_0x3633('0xb')]['message']);}else{logger['info'](_0x3633('0x8'),_0x1c4c20,_0x3633('0x9'));_0x5c35ba(_0x4ee8e3[_0x3633('0xd')][_0x3633('0xc')]);}})[_0x3633('0xe')](function(_0x3b0fd7){logger['error'](_0x3633('0x8'),_0x1c4c20,_0x3b0fd7);_0x5b5055(_0x3b0fd7);});});}exports[_0x3633('0xf')]=function(_0x578e08){var _0x57961b=this;return new Promise(function(_0x38a7bc,_0x53ece3){return db['MemberReport'][_0x3633('0x10')]({'raw':_0x578e08[_0x3633('0x11')]?_0x578e08[_0x3633('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x578e08[_0x3633('0x11')]?_0x578e08[_0x3633('0x11')][_0x3633('0x12')]||null:null,'attributes':_0x578e08['options']?_0x578e08[_0x3633('0x11')][_0x3633('0x13')]||null:null,'limit':_0x578e08[_0x3633('0x11')]?_0x578e08['options'][_0x3633('0x14')]||null:null,'include':_0x578e08[_0x3633('0x11')]?_0x578e08['options'][_0x3633('0x15')]?_[_0x3633('0x16')](_0x578e08[_0x3633('0x11')][_0x3633('0x15')],function(_0x4306ef){return{'model':db[_0x4306ef[_0x3633('0x17')]],'as':_0x4306ef['as'],'attributes':_0x4306ef[_0x3633('0x13')],'include':_0x4306ef[_0x3633('0x15')]?_[_0x3633('0x16')](_0x4306ef[_0x3633('0x15')],function(_0x2c781f){return{'model':db[_0x2c781f[_0x3633('0x17')]],'as':_0x2c781f['as'],'attributes':_0x2c781f['attributes'],'include':_0x2c781f[_0x3633('0x15')]?_[_0x3633('0x16')](_0x2c781f['include'],function(_0x19c36c){return{'model':db[_0x19c36c[_0x3633('0x17')]],'as':_0x19c36c['as'],'attributes':_0x19c36c[_0x3633('0x13')]};}):[]};}):[]};}):[]:[]})[_0x3633('0x18')](function(_0x19df4a){logger[_0x3633('0x7')](_0x3633('0xf'),_0x578e08);logger['debug'](_0x3633('0xf'),_0x578e08,JSON[_0x3633('0x19')](_0x19df4a));_0x38a7bc(_0x19df4a);})[_0x3633('0xe')](function(_0xbf7c64){logger[_0x3633('0xb')](_0x3633('0xf'),_0xbf7c64[_0x3633('0xc')],_0x578e08);_0x53ece3(_0x57961b[_0x3633('0xb')](0x1f4,_0xbf7c64[_0x3633('0xc')]));});});};exports[_0x3633('0x1a')]=function(_0x4fddd5){var _0x37b887=this;return new Promise(function(_0x162d3a,_0x35c22c){return db[_0x3633('0x1b')][_0x3633('0x1c')](_0x4fddd5[_0x3633('0x1d')],{'raw':_0x4fddd5[_0x3633('0x11')]?_0x4fddd5['options'][_0x3633('0x1e')]===undefined?!![]:![]:!![]})[_0x3633('0x18')](function(_0x5a8009){logger[_0x3633('0x7')](_0x3633('0x1a'),_0x4fddd5);logger[_0x3633('0x1f')](_0x3633('0x1a'),_0x4fddd5,JSON[_0x3633('0x19')](_0x5a8009));_0x162d3a(_0x5a8009);})['catch'](function(_0x342b66){logger['error']('CreateMemberReport',_0x342b66[_0x3633('0xc')],_0x4fddd5);_0x35c22c(_0x37b887['error'](0x1f4,_0x342b66[_0x3633('0xc')]));});});};exports[_0x3633('0x20')]=function(_0x4edba7){var _0x41a460=this;return new Promise(function(_0x180bfd,_0x516181){return db['MemberReport'][_0x3633('0x21')](_0x4edba7[_0x3633('0x1d')],{'raw':_0x4edba7[_0x3633('0x11')]?_0x4edba7[_0x3633('0x11')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4edba7[_0x3633('0x11')]?_0x4edba7[_0x3633('0x11')][_0x3633('0x12')]||null:null,'attributes':_0x4edba7['options']?_0x4edba7[_0x3633('0x11')]['attributes']||null:null,'limit':_0x4edba7[_0x3633('0x11')]?_0x4edba7[_0x3633('0x11')][_0x3633('0x14')]||null:null})[_0x3633('0x18')](function(_0x5088d0){logger[_0x3633('0x7')](_0x3633('0x20'),_0x4edba7);logger['debug'](_0x3633('0x20'),_0x4edba7,JSON['stringify'](_0x5088d0));_0x180bfd(_0x5088d0);})[_0x3633('0xe')](function(_0x43ba38){logger[_0x3633('0xb')]('UpdateMemberReport',_0x43ba38[_0x3633('0xc')],_0x4edba7);_0x516181(_0x41a460['error'](0x1f4,_0x43ba38[_0x3633('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index e517d79..fcff955 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 _0x56f0=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','index'];(function(_0x58aa20,_0x22e608){var _0x22b883=function(_0x703293){while(--_0x703293){_0x58aa20['push'](_0x58aa20['shift']());}};_0x22b883(++_0x22e608);}(_0x56f0,0x145));var _0x056f=function(_0x38576d,_0x527dc7){_0x38576d=_0x38576d-0x0;var _0x32534a=_0x56f0[_0x38576d];return _0x32534a;};'use strict';var multer=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var path=require('path');var timeout=require(_0x056f('0x2'));var express=require(_0x056f('0x3'));var router=express[_0x056f('0x4')]();var fs_extra=require(_0x056f('0x5'));var auth=require(_0x056f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x056f('0x7'));var controller=require(_0x056f('0x8'));router[_0x056f('0x9')]('/',controller[_0x056f('0xa')]);module[_0x056f('0xb')]=router; \ No newline at end of file +var _0x6e08=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util'];(function(_0x1e4612,_0x3536d8){var _0x4f1a59=function(_0x4049e4){while(--_0x4049e4){_0x1e4612['push'](_0x1e4612['shift']());}};_0x4f1a59(++_0x3536d8);}(_0x6e08,0x196));var _0x86e0=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0x6e08[_0x2a2e72];return _0x3cfb4a;};'use strict';var multer=require('multer');var util=require(_0x86e0('0x0'));var path=require(_0x86e0('0x1'));var timeout=require(_0x86e0('0x2'));var express=require('express');var router=express[_0x86e0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86e0('0x4'));var interaction=require(_0x86e0('0x5'));var config=require(_0x86e0('0x6'));var controller=require(_0x86e0('0x7'));router[_0x86e0('0x8')]('/',controller[_0x86e0('0x9')]);module[_0x86e0('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index b560364..77faaee 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 _0x046b=['sequelize','exports','version'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x046b,0xbd));var _0xb046=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x046b[_0x1af05b];return _0x5be7cc;};'use strict';var Sequelize=require(_0xb046('0x0'));module[_0xb046('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xb046('0x2')}}; \ No newline at end of file +var _0x21ce=['STRING','version','sequelize','exports'];(function(_0x2384ab,_0x5a2094){var _0x2711ae=function(_0x56741f){while(--_0x56741f){_0x2384ab['push'](_0x2384ab['shift']());}};_0x2711ae(++_0x5a2094);}(_0x21ce,0x1aa));var _0xe21c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x21ce[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xe21c('0x0'));module[_0xe21c('0x1')]={'version':{'type':Sequelize[_0xe21c('0x2')],'unique':_0xe21c('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 4fa907f..280a661 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 _0xd91d=['include','findAll','eml-format','zip-dir','fast-json-patch','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','Migration','includeAll'];(function(_0x1fa350,_0x2fe140){var _0xf11e76=function(_0x228141){while(--_0x228141){_0x1fa350['push'](_0x1fa350['shift']());}};_0xf11e76(++_0x2fe140);}(_0xd91d,0x188));var _0xdd91=function(_0x1357f5,_0x5b5562){_0x1357f5=_0x1357f5-0x0;var _0x32cf74=_0xd91d[_0x1357f5];return _0x32cf74;};'use strict';var emlformat=require(_0xdd91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd91('0x1'));var jsonpatch=require(_0xdd91('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd91('0x3'));var util=require(_0xdd91('0x4'));var path=require('path');var sox=require(_0xdd91('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd91('0x6'));var _=require(_0xdd91('0x7'));var squel=require(_0xdd91('0x8'));var crypto=require(_0xdd91('0x9'));var jsforce=require(_0xdd91('0xa'));var deskjs=require(_0xdd91('0xb'));var toCsv=require(_0xdd91('0xc'));var querystring=require(_0xdd91('0xd'));var Papa=require(_0xdd91('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd91('0xf'));var as=require(_0xdd91('0x10'));var hardwareService=require(_0xdd91('0x11'));var logger=require(_0xdd91('0x12'))(_0xdd91('0x13'));var utils=require(_0xdd91('0x14'));var config=require(_0xdd91('0x15'));var licenseUtil=require(_0xdd91('0x16'));var db=require(_0xdd91('0x17'))['db'];function respondWithStatusCode(_0x494ffb,_0x170b3b){_0x170b3b=_0x170b3b||0xcc;return function(_0x2d0db8){if(_0x2d0db8){return _0x494ffb['sendStatus'](_0x170b3b);}return _0x494ffb[_0xdd91('0x18')](_0x170b3b)[_0xdd91('0x19')]();};}function respondWithResult(_0x604290,_0x318962){_0x318962=_0x318962||0xc8;return function(_0xe49a02){if(_0xe49a02){return _0x604290[_0xdd91('0x18')](_0x318962)['json'](_0xe49a02);}};}function respondWithFilteredResult(_0x2dacfb,_0x32062f){return function(_0x40fe4c){if(_0x40fe4c){var _0x28bb96=typeof _0x32062f['offset']===_0xdd91('0x1a')&&typeof _0x32062f[_0xdd91('0x1b')]===_0xdd91('0x1a');var _0x13abcb=_0x40fe4c[_0xdd91('0x1c')];var _0x35dc2e=_0x28bb96?0x0:_0x32062f[_0xdd91('0x1d')];var _0x65acea=_0x28bb96?_0x40fe4c[_0xdd91('0x1c')]:_0x32062f[_0xdd91('0x1d')]+_0x32062f[_0xdd91('0x1b')];var _0x25e5b1;if(_0x65acea>=_0x13abcb){_0x65acea=_0x13abcb;_0x25e5b1=0xc8;}else{_0x25e5b1=0xce;}_0x2dacfb[_0xdd91('0x18')](_0x25e5b1);return _0x2dacfb[_0xdd91('0x1e')](_0xdd91('0x1f'),_0x35dc2e+'-'+_0x65acea+'/'+_0x13abcb)['json'](_0x40fe4c);}return null;};}function patchUpdates(_0x240e25){return function(_0x843f73){try{jsonpatch[_0xdd91('0x20')](_0x843f73,_0x240e25,!![]);}catch(_0x1e15dd){return BPromise[_0xdd91('0x21')](_0x1e15dd);}return _0x843f73['save']();};}function saveUpdates(_0x428ae5,_0x409ded){return function(_0x1981a3){if(_0x1981a3){return _0x1981a3[_0xdd91('0x22')](_0x428ae5)[_0xdd91('0x23')](function(_0x480a16){return _0x480a16;});}return null;};}function removeEntity(_0x17d35d,_0x4ed311){return function(_0x3eecb1){if(_0x3eecb1){return _0x3eecb1[_0xdd91('0x24')]()['then'](function(){_0x17d35d[_0xdd91('0x18')](0xcc)[_0xdd91('0x19')]();});}};}function handleEntityNotFound(_0x4800e1,_0xe14558){return function(_0x4b53f3){if(!_0x4b53f3){_0x4800e1[_0xdd91('0x25')](0x194);}return _0x4b53f3;};}function handleError(_0x456102,_0x2cf9ca){_0x2cf9ca=_0x2cf9ca||0x1f4;return function(_0x622209){logger[_0xdd91('0x26')](_0x622209[_0xdd91('0x27')]);if(_0x622209[_0xdd91('0x28')]){delete _0x622209[_0xdd91('0x28')];}_0x456102[_0xdd91('0x18')](_0x2cf9ca)[_0xdd91('0x29')](_0x622209);};}exports['index']=function(_0x5b5bad,_0x7901c){var _0x1d878d={},_0x47ad92={},_0x1eddc2={'count':0x0,'rows':[]};var _0x1d1935=_[_0xdd91('0x2a')](db['Migration'][_0xdd91('0x2b')],function(_0x5c901){return{'name':_0x5c901['fieldName'],'type':_0x5c901[_0xdd91('0x2c')][_0xdd91('0x2d')]};});_0x47ad92[_0xdd91('0x2e')]=_[_0xdd91('0x2a')](_0x1d1935,_0xdd91('0x28'));_0x47ad92[_0xdd91('0x2f')]=_['keys'](_0x5b5bad['query']);_0x47ad92[_0xdd91('0x30')]=_[_0xdd91('0x31')](_0x47ad92['model'],_0x47ad92[_0xdd91('0x2f')]);_0x1d878d['attributes']=_['intersection'](_0x47ad92[_0xdd91('0x2e')],qs['fields'](_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x32')]));_0x1d878d[_0xdd91('0x33')]=_0x1d878d[_0xdd91('0x33')][_0xdd91('0x34')]?_0x1d878d[_0xdd91('0x33')]:_0x47ad92[_0xdd91('0x2e')];if(!_0x5b5bad[_0xdd91('0x2f')]['hasOwnProperty'](_0xdd91('0x35'))){_0x1d878d[_0xdd91('0x1b')]=qs[_0xdd91('0x1b')](_0x5b5bad['query']['limit']);_0x1d878d[_0xdd91('0x1d')]=qs[_0xdd91('0x1d')](_0x5b5bad['query']['offset']);}_0x1d878d[_0xdd91('0x36')]=qs[_0xdd91('0x37')](_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x37')]);_0x1d878d['where']=qs[_0xdd91('0x30')](_[_0xdd91('0x38')](_0x5b5bad['query'],_0x47ad92['filters']),_0x1d1935);if(_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x39')]){_0x1d878d['where']=_[_0xdd91('0x3a')](_0x1d878d['where'],{'$or':_[_0xdd91('0x2a')](_0x1d1935,function(_0x8d9a17){if(_0x8d9a17[_0xdd91('0x2c')]!==_0xdd91('0x3b')){var _0x56f777={};_0x56f777[_0x8d9a17['name']]={'$like':'%'+_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x39')]+'%'};return _0x56f777;}})});}_0x1d878d=_['merge']({},_0x1d878d,_0x5b5bad['options']);var _0xc23b66={'where':_0x1d878d[_0xdd91('0x3c')]};return db[_0xdd91('0x3d')]['count'](_0xc23b66)[_0xdd91('0x23')](function(_0x2dc00c){_0x1eddc2[_0xdd91('0x1c')]=_0x2dc00c;if(_0x5b5bad[_0xdd91('0x2f')][_0xdd91('0x3e')]){_0x1d878d[_0xdd91('0x3f')]=[{'all':!![]}];}return db[_0xdd91('0x3d')][_0xdd91('0x40')](_0x1d878d);})[_0xdd91('0x23')](function(_0xf2eafd){_0x1eddc2['rows']=_0xf2eafd;return _0x1eddc2;})[_0xdd91('0x23')](respondWithFilteredResult(_0x7901c,_0x1d878d))['catch'](handleError(_0x7901c,null));}; \ No newline at end of file +var _0xcde5=['apply','save','update','then','error','send','index','map','Migration','fieldName','type','model','name','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','include','findAll','rows','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range'];(function(_0x3718f9,_0x3ee488){var _0x2bee21=function(_0x548991){while(--_0x548991){_0x3718f9['push'](_0x3718f9['shift']());}};_0x2bee21(++_0x3ee488);}(_0xcde5,0x1ce));var _0x5cde=function(_0x3b9f36,_0x31eb7e){_0x3b9f36=_0x3b9f36-0x0;var _0xfae4ec=_0xcde5[_0x3b9f36];return _0xfae4ec;};'use strict';var emlformat=require(_0x5cde('0x0'));var rimraf=require(_0x5cde('0x1'));var zipdir=require(_0x5cde('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cde('0x3'));var BPromise=require(_0x5cde('0x4'));var Mustache=require(_0x5cde('0x5'));var util=require(_0x5cde('0x6'));var path=require(_0x5cde('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cde('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5cde('0x9'));var jsforce=require(_0x5cde('0xa'));var deskjs=require(_0x5cde('0xb'));var toCsv=require(_0x5cde('0xc'));var querystring=require(_0x5cde('0xd'));var Papa=require(_0x5cde('0xe'));var Redis=require(_0x5cde('0xf'));var authService=require(_0x5cde('0x10'));var qs=require(_0x5cde('0x11'));var as=require(_0x5cde('0x12'));var hardwareService=require(_0x5cde('0x13'));var logger=require(_0x5cde('0x14'))(_0x5cde('0x15'));var utils=require(_0x5cde('0x16'));var config=require(_0x5cde('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5cde('0x18'))['db'];function respondWithStatusCode(_0x1785ce,_0x557008){_0x557008=_0x557008||0xcc;return function(_0x447494){if(_0x447494){return _0x1785ce[_0x5cde('0x19')](_0x557008);}return _0x1785ce['status'](_0x557008)['end']();};}function respondWithResult(_0x198141,_0x509f13){_0x509f13=_0x509f13||0xc8;return function(_0x3acd12){if(_0x3acd12){return _0x198141['status'](_0x509f13)[_0x5cde('0x1a')](_0x3acd12);}};}function respondWithFilteredResult(_0x78173a,_0x4e033d){return function(_0x58a056){if(_0x58a056){var _0x4b0c28=typeof _0x4e033d[_0x5cde('0x1b')]===_0x5cde('0x1c')&&typeof _0x4e033d[_0x5cde('0x1d')]===_0x5cde('0x1c');var _0x7d77fe=_0x58a056[_0x5cde('0x1e')];var _0x3d4f5c=_0x4b0c28?0x0:_0x4e033d[_0x5cde('0x1b')];var _0x35007b=_0x4b0c28?_0x58a056['count']:_0x4e033d[_0x5cde('0x1b')]+_0x4e033d[_0x5cde('0x1d')];var _0x55915f;if(_0x35007b>=_0x7d77fe){_0x35007b=_0x7d77fe;_0x55915f=0xc8;}else{_0x55915f=0xce;}_0x78173a[_0x5cde('0x1f')](_0x55915f);return _0x78173a[_0x5cde('0x20')](_0x5cde('0x21'),_0x3d4f5c+'-'+_0x35007b+'/'+_0x7d77fe)['json'](_0x58a056);}return null;};}function patchUpdates(_0x4232f6){return function(_0x263b64){try{jsonpatch[_0x5cde('0x22')](_0x263b64,_0x4232f6,!![]);}catch(_0x2c7ffb){return BPromise['reject'](_0x2c7ffb);}return _0x263b64[_0x5cde('0x23')]();};}function saveUpdates(_0x229902,_0x45ab44){return function(_0x56818c){if(_0x56818c){return _0x56818c[_0x5cde('0x24')](_0x229902)[_0x5cde('0x25')](function(_0x21d292){return _0x21d292;});}return null;};}function removeEntity(_0x928c9e,_0x256856){return function(_0x48a1c6){if(_0x48a1c6){return _0x48a1c6['destroy']()[_0x5cde('0x25')](function(){_0x928c9e[_0x5cde('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4faa14,_0x360df4){return function(_0xa26d78){if(!_0xa26d78){_0x4faa14[_0x5cde('0x19')](0x194);}return _0xa26d78;};}function handleError(_0x19b1aa,_0x2f8f47){_0x2f8f47=_0x2f8f47||0x1f4;return function(_0x363843){logger[_0x5cde('0x26')](_0x363843['stack']);if(_0x363843['name']){delete _0x363843['name'];}_0x19b1aa[_0x5cde('0x1f')](_0x2f8f47)[_0x5cde('0x27')](_0x363843);};}exports[_0x5cde('0x28')]=function(_0x3f6857,_0x21d647){var _0x3c5916={},_0x337764={},_0x5610fb={'count':0x0,'rows':[]};var _0x190bbe=_[_0x5cde('0x29')](db[_0x5cde('0x2a')]['rawAttributes'],function(_0x46aaa7){return{'name':_0x46aaa7[_0x5cde('0x2b')],'type':_0x46aaa7[_0x5cde('0x2c')]['key']};});_0x337764[_0x5cde('0x2d')]=_[_0x5cde('0x29')](_0x190bbe,_0x5cde('0x2e'));_0x337764[_0x5cde('0x2f')]=_[_0x5cde('0x30')](_0x3f6857[_0x5cde('0x2f')]);_0x337764[_0x5cde('0x31')]=_[_0x5cde('0x32')](_0x337764['model'],_0x337764[_0x5cde('0x2f')]);_0x3c5916[_0x5cde('0x33')]=_['intersection'](_0x337764[_0x5cde('0x2d')],qs['fields'](_0x3f6857[_0x5cde('0x2f')]['fields']));_0x3c5916['attributes']=_0x3c5916[_0x5cde('0x33')]['length']?_0x3c5916['attributes']:_0x337764[_0x5cde('0x2d')];if(!_0x3f6857[_0x5cde('0x2f')][_0x5cde('0x34')](_0x5cde('0x35'))){_0x3c5916[_0x5cde('0x1d')]=qs[_0x5cde('0x1d')](_0x3f6857[_0x5cde('0x2f')][_0x5cde('0x1d')]);_0x3c5916[_0x5cde('0x1b')]=qs[_0x5cde('0x1b')](_0x3f6857[_0x5cde('0x2f')][_0x5cde('0x1b')]);}_0x3c5916['order']=qs[_0x5cde('0x36')](_0x3f6857[_0x5cde('0x2f')][_0x5cde('0x36')]);_0x3c5916[_0x5cde('0x37')]=qs[_0x5cde('0x31')](_['pick'](_0x3f6857[_0x5cde('0x2f')],_0x337764['filters']),_0x190bbe);if(_0x3f6857[_0x5cde('0x2f')]['filter']){_0x3c5916[_0x5cde('0x37')]=_[_0x5cde('0x38')](_0x3c5916[_0x5cde('0x37')],{'$or':_['map'](_0x190bbe,function(_0x51ad09){if(_0x51ad09['type']!==_0x5cde('0x39')){var _0x1dc9af={};_0x1dc9af[_0x51ad09[_0x5cde('0x2e')]]={'$like':'%'+_0x3f6857['query']['filter']+'%'};return _0x1dc9af;}})});}_0x3c5916=_[_0x5cde('0x38')]({},_0x3c5916,_0x3f6857['options']);var _0x4f6c78={'where':_0x3c5916['where']};return db[_0x5cde('0x2a')]['count'](_0x4f6c78)[_0x5cde('0x25')](function(_0x421a3a){_0x5610fb[_0x5cde('0x1e')]=_0x421a3a;if(_0x3f6857[_0x5cde('0x2f')]['includeAll']){_0x3c5916[_0x5cde('0x3a')]=[{'all':!![]}];}return db[_0x5cde('0x2a')][_0x5cde('0x3b')](_0x3c5916);})[_0x5cde('0x25')](function(_0x56b21a){_0x5610fb[_0x5cde('0x3c')]=_0x56b21a;return _0x5610fb;})[_0x5cde('0x25')](respondWithFilteredResult(_0x21d647,_0x3c5916))[_0x5cde('0x3d')](handleError(_0x21d647,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a9d7176..79e6960 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 _0x292f=['../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x25621d,_0x10fa36){var _0x48f34b=function(_0x409530){while(--_0x409530){_0x25621d['push'](_0x25621d['shift']());}};_0x48f34b(++_0x10fa36);}(_0x292f,0x7d));var _0xf292=function(_0x764874,_0x3ed544){_0x764874=_0x764874-0x0;var _0x29f9d5=_0x292f[_0x764874];return _0x29f9d5;};'use strict';var _=require(_0xf292('0x0'));var util=require(_0xf292('0x1'));var logger=require(_0xf292('0x2'))(_0xf292('0x3'));var moment=require(_0xf292('0x4'));var BPromise=require(_0xf292('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf292('0x6'));var config=require(_0xf292('0x7'));var attributes=require(_0xf292('0x8'));module[_0xf292('0x9')]=function(_0x3c69b6,_0x4e287c){return _0x3c69b6[_0xf292('0xa')]('Migration',attributes,{'tableName':_0xf292('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc0=['lodash','bluebird','path','rimraf','../../config/environment','./migration.attributes','define'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5fc0,0x12d));var _0x05fc=function(_0x5a2a20,_0x4c1f2e){_0x5a2a20=_0x5a2a20-0x0;var _0x5c8433=_0x5fc0[_0x5a2a20];return _0x5c8433;};'use strict';var _=require(_0x05fc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x05fc('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05fc('0x2'));var rimraf=require(_0x05fc('0x3'));var config=require(_0x05fc('0x4'));var attributes=require(_0x05fc('0x5'));module['exports']=function(_0x5a849e,_0x5ba0fa){return _0x5a849e[_0x05fc('0x6')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 7cb63db..9e02411 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 _0x18a5=['../../config/logger','rpc','../../config/environment','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x18a5,0x164));var _0x518a=function(_0x2f4a23,_0x2e05b0){_0x2f4a23=_0x2f4a23-0x0;var _0x515019=_0x18a5[_0x2f4a23];return _0x515019;};'use strict';var _=require(_0x518a('0x0'));var util=require(_0x518a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x518a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x518a('0x3'))['db'];var utils=require(_0x518a('0x4'));var logger=require(_0x518a('0x5'))(_0x518a('0x6'));var config=require(_0x518a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea311,_0x1d4199,_0x19a2df){return new BPromise(function(_0x2a5fa6,_0x8bd966){return client[_0x518a('0x8')](_0x2ea311,_0x19a2df)[_0x518a('0x9')](function(_0xb996c3){logger[_0x518a('0xa')](_0x518a('0xb'),_0x1d4199,_0x518a('0xc'));logger[_0x518a('0xd')](_0x518a('0xe'),_0x1d4199,_0x518a('0xc'),JSON[_0x518a('0xf')](_0xb996c3));if(_0xb996c3['error']){if(_0xb996c3[_0x518a('0x10')]['code']===0x1f4){logger[_0x518a('0x10')]('Migration,\x20%s,\x20%s',_0x1d4199,_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);return _0x8bd966(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}logger[_0x518a('0x10')](_0x518a('0xb'),_0x1d4199,_0xb996c3[_0x518a('0x10')]['message']);return _0x2a5fa6(_0xb996c3[_0x518a('0x10')][_0x518a('0x11')]);}else{logger[_0x518a('0xa')]('Migration,\x20%s,\x20%s',_0x1d4199,_0x518a('0xc'));_0x2a5fa6(_0xb996c3[_0x518a('0x12')]['message']);}})['catch'](function(_0x177882){logger['error'](_0x518a('0xb'),_0x1d4199,_0x177882);_0x8bd966(_0x177882);});});} \ No newline at end of file +var _0x09dd=['stringify','error','code','message','result','catch','Migration,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0x09dd,0xb7));var _0xd09d=function(_0x13915f,_0x3d90c6){_0x13915f=_0x13915f-0x0;var _0x373181=_0x09dd[_0x13915f];return _0x373181;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var moment=require(_0xd09d('0x2'));var BPromise=require(_0xd09d('0x3'));var rs=require(_0xd09d('0x4'));var fs=require('fs');var Redis=require(_0xd09d('0x5'));var db=require(_0xd09d('0x6'))['db'];var utils=require(_0xd09d('0x7'));var logger=require(_0xd09d('0x8'))('rpc');var config=require(_0xd09d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd09d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57eba0,_0x5e2910,_0x50af75){return new BPromise(function(_0x58c10c,_0x483c0a){return client[_0xd09d('0xb')](_0x57eba0,_0x50af75)['then'](function(_0x439f9c){logger[_0xd09d('0xc')]('Migration,\x20%s,\x20%s',_0x5e2910,'request\x20sent');logger['debug'](_0xd09d('0xd'),_0x5e2910,_0xd09d('0xe'),JSON[_0xd09d('0xf')](_0x439f9c));if(_0x439f9c[_0xd09d('0x10')]){if(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x11')]===0x1f4){logger[_0xd09d('0x10')]('Migration,\x20%s,\x20%s',_0x5e2910,_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);return _0x483c0a(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);}logger[_0xd09d('0x10')]('Migration,\x20%s,\x20%s',_0x5e2910,_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);return _0x58c10c(_0x439f9c[_0xd09d('0x10')][_0xd09d('0x12')]);}else{logger[_0xd09d('0xc')]('Migration,\x20%s,\x20%s',_0x5e2910,_0xd09d('0xe'));_0x58c10c(_0x439f9c[_0xd09d('0x13')]['message']);}})[_0xd09d('0x14')](function(_0x1a4def){logger[_0xd09d('0x10')](_0xd09d('0x15'),_0x5e2910,_0x1a4def);_0x483c0a(_0x1a4def);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 802241c..a6257aa 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 _0xf19c=['show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated'];(function(_0x176784,_0x372480){var _0xf1f47=function(_0x18cfdc){while(--_0x18cfdc){_0x176784['push'](_0x176784['shift']());}};_0xf1f47(++_0x372480);}(_0xf19c,0x10b));var _0xcf19=function(_0x4314c1,_0x54c70d){_0x4314c1=_0x4314c1-0x0;var _0x3ffae0=_0xf19c[_0x4314c1];return _0x3ffae0;};'use strict';var multer=require(_0xcf19('0x0'));var util=require(_0xcf19('0x1'));var path=require(_0xcf19('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf19('0x3'));var router=express[_0xcf19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf19('0x5'));var interaction=require(_0xcf19('0x6'));var config=require(_0xcf19('0x7'));var controller=require(_0xcf19('0x8'));router[_0xcf19('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf19('0xa')]);router[_0xcf19('0x9')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0xd')]);router[_0xcf19('0xe')]('/',auth['isAuthenticated'](),controller[_0xcf19('0xf')]);router[_0xcf19('0x10')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x11')]);router[_0xcf19('0x12')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1329=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','post','isAuthenticated','create','put','destroy'];(function(_0x5c2591,_0x1668f8){var _0x47373f=function(_0x5a6399){while(--_0x5a6399){_0x5c2591['push'](_0x5c2591['shift']());}};_0x47373f(++_0x1668f8);}(_0x1329,0x199));var _0x9132=function(_0x41ea67,_0x508758){_0x41ea67=_0x41ea67-0x0;var _0x30aa58=_0x1329[_0x41ea67];return _0x30aa58;};'use strict';var multer=require(_0x9132('0x0'));var util=require(_0x9132('0x1'));var path=require(_0x9132('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9132('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9132('0x4'));var interaction=require(_0x9132('0x5'));var config=require(_0x9132('0x6'));var controller=require(_0x9132('0x7'));router[_0x9132('0x8')]('/',auth['isAuthenticated'](),controller[_0x9132('0x9')]);router[_0x9132('0x8')](_0x9132('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9132('0xb')]('/',auth[_0x9132('0xc')](),controller[_0x9132('0xd')]);router[_0x9132('0xe')]('/:id',auth[_0x9132('0xc')](),controller['update']);router['delete'](_0x9132('0xa'),auth[_0x9132('0xc')](),controller[_0x9132('0xf')]);module[_0x9132('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index f88e2f5..100e24c 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 _0xdef6=['localnet','externip','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x270239,_0x183766){var _0x19c470=function(_0x2ad596){while(--_0x2ad596){_0x270239['push'](_0x270239['shift']());}};_0x19c470(++_0x183766);}(_0xdef6,0x1ad));var _0x6def=function(_0x10296f,_0x4db559){_0x10296f=_0x10296f-0x0;var _0x404832=_0xdef6[_0x10296f];return _0x404832;};'use strict';var Sequelize=require(_0x6def('0x0'));module[_0x6def('0x1')]={'type':{'type':Sequelize[_0x6def('0x2')](_0x6def('0x3'),_0x6def('0x4'),_0x6def('0x5'),_0x6def('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6def('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb025=['sequelize','exports','ENUM','externip','stun','turn'];(function(_0x35a09f,_0x387589){var _0x48712d=function(_0x443049){while(--_0x443049){_0x35a09f['push'](_0x35a09f['shift']());}};_0x48712d(++_0x387589);}(_0xb025,0x180));var _0x5b02=function(_0x21936c,_0x29ba17){_0x21936c=_0x21936c-0x0;var _0x1e8509=_0xb025[_0x21936c];return _0x1e8509;};'use strict';var Sequelize=require(_0x5b02('0x0'));module[_0x5b02('0x1')]={'type':{'type':Sequelize[_0x5b02('0x2')]('localnet',_0x5b02('0x3'),_0x5b02('0x4'),_0x5b02('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e580fc4..3b47918 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 _0x154a=['find','create','body','toUpperCase','STUN','readFileSync','join','root','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/stun_multiple.ejs','format','toLowerCase','params','chan_sip.so','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','json','undefined','count','offset','limit','status','set','Content-Range','update','destroy','end','stack','name','send','index','map','Network','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x39e5d2,_0x5c44f8){var _0x2f0519=function(_0x5e5877){while(--_0x5e5877){_0x39e5d2['push'](_0x39e5d2['shift']());}};_0x2f0519(++_0x5c44f8);}(_0x154a,0x123));var _0xa154=function(_0x48a03c,_0x3282f8){_0x48a03c=_0x48a03c-0x0;var _0x5e9ac7=_0x154a[_0x48a03c];return _0x5e9ac7;};'use strict';var util=require(_0xa154('0x0'));var path=require(_0xa154('0x1'));var ejs=require(_0xa154('0x2'));var fs=require('fs');var _=require(_0xa154('0x3'));var qs=require(_0xa154('0x4'));var logger=require(_0xa154('0x5'))(_0xa154('0x6'));var config=require(_0xa154('0x7'));var db=require(_0xa154('0x8'))['db'];var jayson=require(_0xa154('0x9'));var client=jayson[_0xa154('0xa')][_0xa154('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x490436,_0x24dab0,_0x2f0906,_0x389e7b){return new Promise(function(_0x5ec600,_0x2d8471){var _0x54678a=_0x389e7b||client;return _0x54678a[_0xa154('0xc')](_0x490436,_0x2f0906)[_0xa154('0xd')](function(_0x7bddfb){logger[_0xa154('0xe')](_0xa154('0xf'),_0x24dab0,_0xa154('0x10'));logger[_0xa154('0x11')](_0xa154('0x12'),_0x24dab0,_0xa154('0x10'),JSON['stringify'](_0x7bddfb));if(_0x7bddfb[_0xa154('0x13')]){if(_0x7bddfb[_0xa154('0x13')][_0xa154('0x14')]===0x1f4){logger[_0xa154('0x13')]('Network,\x20%s,\x20%s',_0x24dab0,_0x7bddfb[_0xa154('0x13')]['message']);return _0x2d8471(_0x7bddfb[_0xa154('0x13')][_0xa154('0x15')]);}logger[_0xa154('0x13')](_0xa154('0xf'),_0x24dab0,_0x7bddfb[_0xa154('0x13')][_0xa154('0x15')]);return _0x5ec600(_0x7bddfb[_0xa154('0x13')]['message']);}else{logger[_0xa154('0xe')](_0xa154('0xf'),_0x24dab0,_0xa154('0x10'));_0x5ec600(_0x7bddfb[_0xa154('0x16')]['message']);}})['catch'](function(_0x495a9b){logger[_0xa154('0x13')](_0xa154('0xf'),_0x24dab0,_0x495a9b);_0x2d8471(_0x495a9b);});});}function respondWithResult(_0xb9f102,_0x51c46d){_0x51c46d=_0x51c46d||0xc8;return function(_0x1448b0){if(_0x1448b0){return _0xb9f102['status'](_0x51c46d)[_0xa154('0x17')](_0x1448b0);}};}function respondWithFilteredResult(_0x286ab3,_0x23a1bf){return function(_0x48a4df){if(_0x48a4df){var _0x4e6a6d=typeof _0x23a1bf['offset']===_0xa154('0x18')&&typeof _0x23a1bf['limit']===_0xa154('0x18');var _0x55c8c1=_0x48a4df[_0xa154('0x19')];var _0x3c1ce5=_0x4e6a6d?0x0:_0x23a1bf[_0xa154('0x1a')];var _0x45422e=_0x4e6a6d?_0x48a4df[_0xa154('0x19')]:_0x23a1bf[_0xa154('0x1a')]+_0x23a1bf[_0xa154('0x1b')];var _0xf92caa;if(_0x45422e>=_0x55c8c1){_0x45422e=_0x55c8c1;_0xf92caa=0xc8;}else{_0xf92caa=0xce;}_0x286ab3[_0xa154('0x1c')](_0xf92caa);return _0x286ab3[_0xa154('0x1d')](_0xa154('0x1e'),_0x3c1ce5+'-'+_0x45422e+'/'+_0x55c8c1)[_0xa154('0x17')](_0x48a4df);}return null;};}function saveUpdates(_0x5c6561){return function(_0x409b87){if(_0x409b87){return _0x409b87[_0xa154('0x1f')](_0x5c6561)['then'](function(_0x9c4208){return _0x9c4208;});}return null;};}function removeEntity(_0x2a0e81){return function(_0x299223){if(_0x299223){return _0x299223[_0xa154('0x20')]()[_0xa154('0xd')](function(){_0x2a0e81[_0xa154('0x1c')](0xcc)[_0xa154('0x21')]();});}};}function handleEntityNotFound(_0x231712){return function(_0xb95e42){if(!_0xb95e42){_0x231712['sendStatus'](0x194);}return _0xb95e42;};}function handleError(_0x148d94,_0x390113){_0x390113=_0x390113||0x1f4;return function(_0x41a7ec){logger[_0xa154('0x13')](_0x41a7ec[_0xa154('0x22')]);if(_0x41a7ec[_0xa154('0x23')]){delete _0x41a7ec[_0xa154('0x23')];}_0x148d94['status'](_0x390113)[_0xa154('0x24')](_0x41a7ec);};}exports[_0xa154('0x25')]=function(_0xfb108b,_0x40e2a2){var _0x5b7e51={},_0x484b4f={},_0x2356f6={'count':0x0,'rows':[]};var _0x205dc2=_[_0xa154('0x26')](db[_0xa154('0x27')][_0xa154('0x28')],function(_0x35ff23){return{'name':_0x35ff23['fieldName'],'type':_0x35ff23['type'][_0xa154('0x29')]};});_0x484b4f[_0xa154('0x2a')]=_[_0xa154('0x26')](_0x205dc2,_0xa154('0x23'));_0x484b4f['query']=_[_0xa154('0x2b')](_0xfb108b[_0xa154('0x2c')]);_0x484b4f[_0xa154('0x2d')]=_[_0xa154('0x2e')](_0x484b4f[_0xa154('0x2a')],_0x484b4f[_0xa154('0x2c')]);_0x5b7e51[_0xa154('0x2f')]=_['intersection'](_0x484b4f[_0xa154('0x2a')],qs['fields'](_0xfb108b[_0xa154('0x2c')][_0xa154('0x30')]));_0x5b7e51[_0xa154('0x2f')]=_0x5b7e51[_0xa154('0x2f')][_0xa154('0x31')]?_0x5b7e51['attributes']:_0x484b4f['model'];if(!_0xfb108b[_0xa154('0x2c')][_0xa154('0x32')]('nolimit')){_0x5b7e51[_0xa154('0x1b')]=qs['limit'](_0xfb108b[_0xa154('0x2c')][_0xa154('0x1b')]);_0x5b7e51['offset']=qs[_0xa154('0x1a')](_0xfb108b['query']['offset']);}_0x5b7e51[_0xa154('0x33')]=qs[_0xa154('0x34')](_0xfb108b[_0xa154('0x2c')][_0xa154('0x34')]);_0x5b7e51[_0xa154('0x35')]=qs[_0xa154('0x2d')](_[_0xa154('0x36')](_0xfb108b['query'],_0x484b4f[_0xa154('0x2d')]),_0x205dc2);if(_0xfb108b[_0xa154('0x2c')]['filter']){_0x5b7e51[_0xa154('0x35')]=_['merge'](_0x5b7e51[_0xa154('0x35')],{'$or':_['map'](_0x205dc2,function(_0x569f81){if(_0x569f81[_0xa154('0x37')]!==_0xa154('0x38')){var _0x176708={};_0x176708[_0x569f81['name']]={'$like':'%'+_0xfb108b[_0xa154('0x2c')][_0xa154('0x39')]+'%'};return _0x176708;}})});}_0x5b7e51=_[_0xa154('0x3a')]({},_0x5b7e51,_0xfb108b[_0xa154('0x3b')]);var _0x37d895={'where':_0x5b7e51[_0xa154('0x35')]};return db[_0xa154('0x27')][_0xa154('0x19')](_0x37d895)[_0xa154('0xd')](function(_0x23bc26){_0x2356f6['count']=_0x23bc26;if(_0xfb108b['query'][_0xa154('0x3c')]){_0x5b7e51[_0xa154('0x3d')]=[{'all':!![]}];}return db[_0xa154('0x27')][_0xa154('0x3e')](_0x5b7e51);})[_0xa154('0xd')](function(_0x16e2f1){_0x2356f6[_0xa154('0x3f')]=_0x16e2f1;return _0x2356f6;})['then'](respondWithFilteredResult(_0x40e2a2,_0x5b7e51))[_0xa154('0x40')](handleError(_0x40e2a2,null));};exports['show']=function(_0x4ad40d,_0xfb5084){var _0x66f637={'raw':!![],'where':{'id':_0x4ad40d['params']['id']}},_0x49c5e6={};_0x49c5e6[_0xa154('0x2a')]=_[_0xa154('0x2b')](db[_0xa154('0x27')][_0xa154('0x28')]);_0x49c5e6[_0xa154('0x2c')]=_[_0xa154('0x2b')](_0x4ad40d[_0xa154('0x2c')]);_0x49c5e6['filters']=_['intersection'](_0x49c5e6[_0xa154('0x2a')],_0x49c5e6['query']);_0x66f637['attributes']=_[_0xa154('0x2e')](_0x49c5e6['model'],qs[_0xa154('0x30')](_0x4ad40d[_0xa154('0x2c')]['fields']));_0x66f637['attributes']=_0x66f637[_0xa154('0x2f')]['length']?_0x66f637['attributes']:_0x49c5e6['model'];if(_0x4ad40d[_0xa154('0x2c')][_0xa154('0x3c')]){_0x66f637[_0xa154('0x3d')]=[{'all':!![]}];}_0x66f637=_[_0xa154('0x3a')]({},_0x66f637,_0x4ad40d['options']);return db[_0xa154('0x27')][_0xa154('0x41')](_0x66f637)[_0xa154('0xd')](handleEntityNotFound(_0xfb5084,null))[_0xa154('0xd')](respondWithResult(_0xfb5084,null))['catch'](handleError(_0xfb5084,null));};exports[_0xa154('0x42')]=function(_0x1674e5,_0x830421){var _0x3a2b5c;return db[_0xa154('0x27')][_0xa154('0x42')](_0x1674e5[_0xa154('0x43')],{'raw':!![]})[_0xa154('0xd')](function(_0x1584d1){_0x3a2b5c=_0x1584d1;return db[_0xa154('0x27')][_0xa154('0x3e')]({'where':{'type':_0x1674e5[_0xa154('0x43')]['type']},'raw':!![]});})[_0xa154('0xd')](function(_0x329d1b){if(_0x3a2b5c[_0xa154('0x37')][_0xa154('0x44')]()==_0xa154('0x45')){var _0x27495c=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x5076d2=ejs[_0xa154('0x49')](_0x27495c,{'networks':_0x329d1b||[]});fs[_0xa154('0x4a')](_0xa154('0x4b'),_0x5076d2);return respondWithRpcPromise('Reload',_0xa154('0x42'),{'module':_0xa154('0x4c')});}else if(_0x3a2b5c[_0xa154('0x37')]['toUpperCase']()==_0xa154('0x4d')){var _0x46e4a8=fs['readFileSync'](path[_0xa154('0x47')](config['root'],_0xa154('0x4e')),_0xa154('0x4f'));var _0x354e9b=ejs[_0xa154('0x49')](_0x46e4a8,{'networks':_0x329d1b||[]});fs[_0xa154('0x4a')](_0xa154('0x50'),_0x354e9b);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x42'),{'module':_0xa154('0x4c')});}else{var _0x2bf42b=fs['readFileSync'](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x52')),_0xa154('0x4f'));var _0x5422fc=ejs[_0xa154('0x49')](_0x2bf42b,{'networks':_0x329d1b||[]});fs['writeFileSync'](util['format'](_0xa154('0x53'),_0x1674e5[_0xa154('0x43')][_0xa154('0x37')]['toLowerCase']()),_0x5422fc);return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});}})[_0xa154('0xd')](function(){return _0x3a2b5c;})[_0xa154('0xd')](respondWithResult(_0x830421,0xc9))[_0xa154('0x40')](handleError(_0x830421,null));};exports['update']=function(_0x2db504,_0x12b81d){var _0x15b606;return db[_0xa154('0x27')]['find']({'where':{'id':_0x2db504['params']['id']}})[_0xa154('0xd')](handleEntityNotFound(_0x12b81d,null))['then'](saveUpdates(_0x2db504[_0xa154('0x43')],null))[_0xa154('0xd')](function(_0xdca907){if(_0xdca907){_0x15b606=_0xdca907;return db['Network'][_0xa154('0x3e')]({'where':{'type':_0x15b606[_0xa154('0x37')]},'raw':!![]});}return null;})[_0xa154('0xd')](function(_0x2fc9be){if(_0x15b606[_0xa154('0x37')][_0xa154('0x44')]()==_0xa154('0x45')){var _0x5e0a5e=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x54')),'utf8');var _0x56703e=ejs[_0xa154('0x49')](_0x5e0a5e,{'networks':_0x2fc9be||[]});fs[_0xa154('0x4a')](_0xa154('0x4b'),_0x56703e);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x1f'),{'module':_0xa154('0x4c')});}else if(_0x15b606[_0xa154('0x37')]['toUpperCase']()=='TURN'){var _0x3355b5=fs['readFileSync'](path[_0xa154('0x47')](config[_0xa154('0x48')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x49715d=ejs['render'](_0x3355b5,{'networks':_0x2fc9be||[]});fs['writeFileSync'](_0xa154('0x50'),_0x49715d);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x1f'),{'module':_0xa154('0x4c')});}else{var _0x26d33=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],'server/files/templates/network.ejs'),'utf8');var _0x3b7e4f=ejs[_0xa154('0x49')](_0x26d33,{'networks':_0x2fc9be||[]});fs[_0xa154('0x4a')](util[_0xa154('0x55')](_0xa154('0x53'),_0x2db504[_0xa154('0x43')][_0xa154('0x37')][_0xa154('0x56')]()),_0x3b7e4f);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x1f'),{'module':'chan_sip.so'});}})['then'](function(_0x1f0f22){if(_0x1f0f22){return _0x15b606;}return null;})[_0xa154('0xd')](respondWithResult(_0x12b81d,null))[_0xa154('0x40')](handleError(_0x12b81d,null));};exports['destroy']=function(_0x507331,_0x4a395d){var _0x24c554;return db[_0xa154('0x27')][_0xa154('0x41')]({'where':{'id':_0x507331[_0xa154('0x57')]['id']}})[_0xa154('0xd')](function(_0x36bb57){_0x24c554=_0x36bb57;return _0x36bb57;})[_0xa154('0xd')](handleEntityNotFound(_0x4a395d,null))[_0xa154('0xd')](removeEntity(_0x4a395d,null))['then'](function(){if(_0x24c554){return db[_0xa154('0x27')]['findAll']({'where':{'type':_0x24c554[_0xa154('0x37')]},'raw':!![]});}})[_0xa154('0xd')](function(_0x8f8537){if(_0x24c554[_0xa154('0x37')][_0xa154('0x44')]()==_0xa154('0x45')){var _0x292b55=fs['readFileSync'](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x54')),_0xa154('0x4f'));var _0x361ca1=ejs[_0xa154('0x49')](_0x292b55,{'networks':_0x8f8537||[]});fs[_0xa154('0x4a')](_0xa154('0x4b'),_0x361ca1);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x20'),{'module':_0xa154('0x4c')});}else if(_0x24c554['type']['toUpperCase']()==_0xa154('0x4d')){var _0x31c495=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x4e')),_0xa154('0x4f'));var _0x3f45fb=ejs[_0xa154('0x49')](_0x31c495,{'networks':_0x8f8537||[]});fs['writeFileSync'](_0xa154('0x50'),_0x3f45fb);return respondWithRpcPromise('Reload','destroy',{'module':_0xa154('0x4c')});}else{var _0x3ad458=fs[_0xa154('0x46')](path[_0xa154('0x47')](config[_0xa154('0x48')],_0xa154('0x52')),_0xa154('0x4f'));var _0x1c4df6=ejs[_0xa154('0x49')](_0x3ad458,{'networks':_0x8f8537||[]});fs['writeFileSync'](util[_0xa154('0x55')](_0xa154('0x53'),_0x24c554[_0xa154('0x37')]['toLowerCase']()),_0x1c4df6);return respondWithRpcPromise(_0xa154('0x51'),_0xa154('0x20'),{'module':_0xa154('0x58')});}})[_0xa154('0x40')](handleError(_0x4a395d,null));}; \ No newline at end of file +var _0x04b6=['info','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','offset','limit','undefined','count','status','set','Content-Range','json','then','name','index','map','Network','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','rawAttributes','length','find','create','body','toUpperCase','STUN','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','params','update','chan_sip.so','destroy','util','path','ejs','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','http'];(function(_0x12f2d3,_0x2e0c4c){var _0x131fb8=function(_0x31d48d){while(--_0x31d48d){_0x12f2d3['push'](_0x12f2d3['shift']());}};_0x131fb8(++_0x2e0c4c);}(_0x04b6,0x142));var _0x604b=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0x04b6[_0x1faaa1];return _0x994ec;};'use strict';var util=require(_0x604b('0x0'));var path=require(_0x604b('0x1'));var ejs=require(_0x604b('0x2'));var fs=require('fs');var _=require(_0x604b('0x3'));var qs=require(_0x604b('0x4'));var logger=require('../../config/logger')('api');var config=require(_0x604b('0x5'));var db=require(_0x604b('0x6'))['db'];var jayson=require(_0x604b('0x7'));var client=jayson[_0x604b('0x8')][_0x604b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432e51,_0xeb746e,_0x45067a,_0x170bb9){return new Promise(function(_0x32e85,_0x44faea){var _0x8a41a5=_0x170bb9||client;return _0x8a41a5['request'](_0x432e51,_0x45067a)['then'](function(_0x56e81e){logger[_0x604b('0xa')]('Network,\x20%s,\x20%s',_0xeb746e,'request\x20sent');logger['debug'](_0x604b('0xb'),_0xeb746e,_0x604b('0xc'),JSON[_0x604b('0xd')](_0x56e81e));if(_0x56e81e[_0x604b('0xe')]){if(_0x56e81e[_0x604b('0xe')][_0x604b('0xf')]===0x1f4){logger[_0x604b('0xe')](_0x604b('0x10'),_0xeb746e,_0x56e81e[_0x604b('0xe')]['message']);return _0x44faea(_0x56e81e[_0x604b('0xe')][_0x604b('0x11')]);}logger[_0x604b('0xe')]('Network,\x20%s,\x20%s',_0xeb746e,_0x56e81e[_0x604b('0xe')][_0x604b('0x11')]);return _0x32e85(_0x56e81e[_0x604b('0xe')][_0x604b('0x11')]);}else{logger[_0x604b('0xa')](_0x604b('0x10'),_0xeb746e,'request\x20sent');_0x32e85(_0x56e81e[_0x604b('0x12')][_0x604b('0x11')]);}})[_0x604b('0x13')](function(_0x116b41){logger['error'](_0x604b('0x10'),_0xeb746e,_0x116b41);_0x44faea(_0x116b41);});});}function respondWithResult(_0x6e57e5,_0x30cd80){_0x30cd80=_0x30cd80||0xc8;return function(_0x4d3e8b){if(_0x4d3e8b){return _0x6e57e5['status'](_0x30cd80)['json'](_0x4d3e8b);}};}function respondWithFilteredResult(_0x5d9f44,_0x2d3bfd){return function(_0x5cf031){if(_0x5cf031){var _0xde5278=typeof _0x2d3bfd[_0x604b('0x14')]==='undefined'&&typeof _0x2d3bfd[_0x604b('0x15')]===_0x604b('0x16');var _0x50945e=_0x5cf031[_0x604b('0x17')];var _0x187d0a=_0xde5278?0x0:_0x2d3bfd[_0x604b('0x14')];var _0x31d028=_0xde5278?_0x5cf031[_0x604b('0x17')]:_0x2d3bfd[_0x604b('0x14')]+_0x2d3bfd[_0x604b('0x15')];var _0x1643a6;if(_0x31d028>=_0x50945e){_0x31d028=_0x50945e;_0x1643a6=0xc8;}else{_0x1643a6=0xce;}_0x5d9f44[_0x604b('0x18')](_0x1643a6);return _0x5d9f44[_0x604b('0x19')](_0x604b('0x1a'),_0x187d0a+'-'+_0x31d028+'/'+_0x50945e)[_0x604b('0x1b')](_0x5cf031);}return null;};}function saveUpdates(_0x18d7b5){return function(_0x345280){if(_0x345280){return _0x345280['update'](_0x18d7b5)['then'](function(_0x262bd9){return _0x262bd9;});}return null;};}function removeEntity(_0x589719){return function(_0x214951){if(_0x214951){return _0x214951['destroy']()[_0x604b('0x1c')](function(){_0x589719['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x67f221){return function(_0x1a6434){if(!_0x1a6434){_0x67f221['sendStatus'](0x194);}return _0x1a6434;};}function handleError(_0x3b6958,_0x6e4c39){_0x6e4c39=_0x6e4c39||0x1f4;return function(_0x3344e5){logger[_0x604b('0xe')](_0x3344e5['stack']);if(_0x3344e5[_0x604b('0x1d')]){delete _0x3344e5[_0x604b('0x1d')];}_0x3b6958['status'](_0x6e4c39)['send'](_0x3344e5);};}exports[_0x604b('0x1e')]=function(_0xafa3f6,_0x4c8e9e){var _0x455576={},_0xed62b0={},_0x1cfde7={'count':0x0,'rows':[]};var _0x161400=_[_0x604b('0x1f')](db[_0x604b('0x20')]['rawAttributes'],function(_0x3279e6){return{'name':_0x3279e6[_0x604b('0x21')],'type':_0x3279e6[_0x604b('0x22')][_0x604b('0x23')]};});_0xed62b0[_0x604b('0x24')]=_[_0x604b('0x1f')](_0x161400,_0x604b('0x1d'));_0xed62b0[_0x604b('0x25')]=_['keys'](_0xafa3f6[_0x604b('0x25')]);_0xed62b0[_0x604b('0x26')]=_[_0x604b('0x27')](_0xed62b0[_0x604b('0x24')],_0xed62b0['query']);_0x455576[_0x604b('0x28')]=_['intersection'](_0xed62b0[_0x604b('0x24')],qs[_0x604b('0x29')](_0xafa3f6[_0x604b('0x25')][_0x604b('0x29')]));_0x455576[_0x604b('0x28')]=_0x455576[_0x604b('0x28')]['length']?_0x455576['attributes']:_0xed62b0[_0x604b('0x24')];if(!_0xafa3f6[_0x604b('0x25')][_0x604b('0x2a')]('nolimit')){_0x455576[_0x604b('0x15')]=qs['limit'](_0xafa3f6[_0x604b('0x25')]['limit']);_0x455576[_0x604b('0x14')]=qs[_0x604b('0x14')](_0xafa3f6[_0x604b('0x25')][_0x604b('0x14')]);}_0x455576[_0x604b('0x2b')]=qs['sort'](_0xafa3f6[_0x604b('0x25')][_0x604b('0x2c')]);_0x455576[_0x604b('0x2d')]=qs[_0x604b('0x26')](_[_0x604b('0x2e')](_0xafa3f6[_0x604b('0x25')],_0xed62b0[_0x604b('0x26')]),_0x161400);if(_0xafa3f6['query']['filter']){_0x455576['where']=_[_0x604b('0x2f')](_0x455576[_0x604b('0x2d')],{'$or':_[_0x604b('0x1f')](_0x161400,function(_0x300abe){if(_0x300abe[_0x604b('0x22')]!==_0x604b('0x30')){var _0x507613={};_0x507613[_0x300abe[_0x604b('0x1d')]]={'$like':'%'+_0xafa3f6[_0x604b('0x25')][_0x604b('0x31')]+'%'};return _0x507613;}})});}_0x455576=_['merge']({},_0x455576,_0xafa3f6[_0x604b('0x32')]);var _0x588a3e={'where':_0x455576['where']};return db[_0x604b('0x20')][_0x604b('0x17')](_0x588a3e)[_0x604b('0x1c')](function(_0x3e2abe){_0x1cfde7[_0x604b('0x17')]=_0x3e2abe;if(_0xafa3f6['query'][_0x604b('0x33')]){_0x455576[_0x604b('0x34')]=[{'all':!![]}];}return db[_0x604b('0x20')][_0x604b('0x35')](_0x455576);})[_0x604b('0x1c')](function(_0x4b5922){_0x1cfde7['rows']=_0x4b5922;return _0x1cfde7;})[_0x604b('0x1c')](respondWithFilteredResult(_0x4c8e9e,_0x455576))['catch'](handleError(_0x4c8e9e,null));};exports[_0x604b('0x36')]=function(_0x4c0aa5,_0x5533bb){var _0x143fca={'raw':!![],'where':{'id':_0x4c0aa5['params']['id']}},_0x350195={};_0x350195[_0x604b('0x24')]=_['keys'](db[_0x604b('0x20')][_0x604b('0x37')]);_0x350195['query']=_['keys'](_0x4c0aa5[_0x604b('0x25')]);_0x350195[_0x604b('0x26')]=_[_0x604b('0x27')](_0x350195['model'],_0x350195[_0x604b('0x25')]);_0x143fca[_0x604b('0x28')]=_['intersection'](_0x350195['model'],qs[_0x604b('0x29')](_0x4c0aa5[_0x604b('0x25')][_0x604b('0x29')]));_0x143fca[_0x604b('0x28')]=_0x143fca['attributes'][_0x604b('0x38')]?_0x143fca[_0x604b('0x28')]:_0x350195[_0x604b('0x24')];if(_0x4c0aa5[_0x604b('0x25')][_0x604b('0x33')]){_0x143fca[_0x604b('0x34')]=[{'all':!![]}];}_0x143fca=_[_0x604b('0x2f')]({},_0x143fca,_0x4c0aa5[_0x604b('0x32')]);return db['Network'][_0x604b('0x39')](_0x143fca)[_0x604b('0x1c')](handleEntityNotFound(_0x5533bb,null))[_0x604b('0x1c')](respondWithResult(_0x5533bb,null))[_0x604b('0x13')](handleError(_0x5533bb,null));};exports[_0x604b('0x3a')]=function(_0x508ecb,_0xa45877){var _0x253905;return db['Network'][_0x604b('0x3a')](_0x508ecb[_0x604b('0x3b')],{'raw':!![]})[_0x604b('0x1c')](function(_0x41041c){_0x253905=_0x41041c;return db[_0x604b('0x20')][_0x604b('0x35')]({'where':{'type':_0x508ecb[_0x604b('0x3b')][_0x604b('0x22')]},'raw':!![]});})['then'](function(_0x179f1f){if(_0x253905[_0x604b('0x22')][_0x604b('0x3c')]()==_0x604b('0x3d')){var _0xae2823=fs['readFileSync'](path[_0x604b('0x3e')](config['root'],_0x604b('0x3f')),_0x604b('0x40'));var _0x53c544=ejs[_0x604b('0x41')](_0xae2823,{'networks':_0x179f1f||[]});fs[_0x604b('0x42')](_0x604b('0x43'),_0x53c544);return respondWithRpcPromise('Reload',_0x604b('0x3a'),{'module':_0x604b('0x44')});}else if(_0x253905[_0x604b('0x22')][_0x604b('0x3c')]()==_0x604b('0x45')){var _0x1a6739=fs[_0x604b('0x46')](path[_0x604b('0x3e')](config[_0x604b('0x47')],_0x604b('0x48')),_0x604b('0x40'));var _0x2275d3=ejs['render'](_0x1a6739,{'networks':_0x179f1f||[]});fs[_0x604b('0x42')](_0x604b('0x49'),_0x2275d3);return respondWithRpcPromise(_0x604b('0x4a'),_0x604b('0x3a'),{'module':_0x604b('0x44')});}else{var _0x1c6fc=fs[_0x604b('0x46')](path['join'](config[_0x604b('0x47')],_0x604b('0x4b')),_0x604b('0x40'));var _0x484618=ejs[_0x604b('0x41')](_0x1c6fc,{'networks':_0x179f1f||[]});fs[_0x604b('0x42')](util[_0x604b('0x4c')](_0x604b('0x4d'),_0x508ecb[_0x604b('0x3b')][_0x604b('0x22')][_0x604b('0x4e')]()),_0x484618);return respondWithRpcPromise(_0x604b('0x4a'),_0x604b('0x3a'),{'module':'chan_sip.so'});}})[_0x604b('0x1c')](function(){return _0x253905;})[_0x604b('0x1c')](respondWithResult(_0xa45877,0xc9))[_0x604b('0x13')](handleError(_0xa45877,null));};exports['update']=function(_0x2eaa4d,_0x5c0092){var _0x3d2964;return db[_0x604b('0x20')]['find']({'where':{'id':_0x2eaa4d[_0x604b('0x4f')]['id']}})[_0x604b('0x1c')](handleEntityNotFound(_0x5c0092,null))[_0x604b('0x1c')](saveUpdates(_0x2eaa4d[_0x604b('0x3b')],null))[_0x604b('0x1c')](function(_0x412db9){if(_0x412db9){_0x3d2964=_0x412db9;return db['Network'][_0x604b('0x35')]({'where':{'type':_0x3d2964[_0x604b('0x22')]},'raw':!![]});}return null;})[_0x604b('0x1c')](function(_0x2858e3){if(_0x3d2964['type'][_0x604b('0x3c')]()==_0x604b('0x3d')){var _0x1dda3d=fs[_0x604b('0x46')](path['join'](config[_0x604b('0x47')],_0x604b('0x3f')),'utf8');var _0xddc2c0=ejs[_0x604b('0x41')](_0x1dda3d,{'networks':_0x2858e3||[]});fs[_0x604b('0x42')](_0x604b('0x43'),_0xddc2c0);return respondWithRpcPromise('Reload',_0x604b('0x50'),{'module':_0x604b('0x44')});}else if(_0x3d2964[_0x604b('0x22')][_0x604b('0x3c')]()==_0x604b('0x45')){var _0x48bcee=fs[_0x604b('0x46')](path['join'](config['root'],_0x604b('0x48')),_0x604b('0x40'));var _0x47f370=ejs[_0x604b('0x41')](_0x48bcee,{'networks':_0x2858e3||[]});fs[_0x604b('0x42')](_0x604b('0x49'),_0x47f370);return respondWithRpcPromise('Reload',_0x604b('0x50'),{'module':'res_stun_monitor.so'});}else{var _0x1ce415=fs['readFileSync'](path[_0x604b('0x3e')](config['root'],_0x604b('0x4b')),_0x604b('0x40'));var _0x14376e=ejs[_0x604b('0x41')](_0x1ce415,{'networks':_0x2858e3||[]});fs[_0x604b('0x42')](util[_0x604b('0x4c')](_0x604b('0x4d'),_0x2eaa4d[_0x604b('0x3b')][_0x604b('0x22')]['toLowerCase']()),_0x14376e);return respondWithRpcPromise(_0x604b('0x4a'),'update',{'module':_0x604b('0x51')});}})[_0x604b('0x1c')](function(_0x27ef57){if(_0x27ef57){return _0x3d2964;}return null;})[_0x604b('0x1c')](respondWithResult(_0x5c0092,null))[_0x604b('0x13')](handleError(_0x5c0092,null));};exports[_0x604b('0x52')]=function(_0x7ce065,_0x5dbcb5){var _0x58f57d;return db[_0x604b('0x20')][_0x604b('0x39')]({'where':{'id':_0x7ce065[_0x604b('0x4f')]['id']}})[_0x604b('0x1c')](function(_0x10dde1){_0x58f57d=_0x10dde1;return _0x10dde1;})[_0x604b('0x1c')](handleEntityNotFound(_0x5dbcb5,null))['then'](removeEntity(_0x5dbcb5,null))[_0x604b('0x1c')](function(){if(_0x58f57d){return db['Network'][_0x604b('0x35')]({'where':{'type':_0x58f57d[_0x604b('0x22')]},'raw':!![]});}})[_0x604b('0x1c')](function(_0x1c5c4a){if(_0x58f57d[_0x604b('0x22')][_0x604b('0x3c')]()==_0x604b('0x3d')){var _0x545bfe=fs['readFileSync'](path['join'](config[_0x604b('0x47')],_0x604b('0x3f')),'utf8');var _0xa205c=ejs['render'](_0x545bfe,{'networks':_0x1c5c4a||[]});fs['writeFileSync'](_0x604b('0x43'),_0xa205c);return respondWithRpcPromise(_0x604b('0x4a'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x58f57d[_0x604b('0x22')][_0x604b('0x3c')]()==_0x604b('0x45')){var _0x421d1f=fs[_0x604b('0x46')](path[_0x604b('0x3e')](config[_0x604b('0x47')],_0x604b('0x48')),_0x604b('0x40'));var _0x5416e5=ejs['render'](_0x421d1f,{'networks':_0x1c5c4a||[]});fs[_0x604b('0x42')](_0x604b('0x49'),_0x5416e5);return respondWithRpcPromise('Reload',_0x604b('0x52'),{'module':_0x604b('0x44')});}else{var _0x23927a=fs['readFileSync'](path[_0x604b('0x3e')](config[_0x604b('0x47')],_0x604b('0x4b')),'utf8');var _0x4ec628=ejs['render'](_0x23927a,{'networks':_0x1c5c4a||[]});fs[_0x604b('0x42')](util[_0x604b('0x4c')](_0x604b('0x4d'),_0x58f57d[_0x604b('0x22')][_0x604b('0x4e')]()),_0x4ec628);return respondWithRpcPromise(_0x604b('0x4a'),'destroy',{'module':_0x604b('0x51')});}})['catch'](handleError(_0x5dbcb5,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 1f25d34..ca834e0 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 _0xe644=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1b2779,_0x181d22){var _0x162929=function(_0x2d0083){while(--_0x2d0083){_0x1b2779['push'](_0x1b2779['shift']());}};_0x162929(++_0x181d22);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac4a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./network.attributes','define','network'];(function(_0x53a453,_0x2f1f55){var _0xc6cb31=function(_0x8ee3db){while(--_0x8ee3db){_0x53a453['push'](_0x53a453['shift']());}};_0xc6cb31(++_0x2f1f55);}(_0xac4a,0x13f));var _0xaac4=function(_0xc187df,_0x3e577e){_0xc187df=_0xc187df-0x0;var _0x2c0f80=_0xac4a[_0xc187df];return _0x2c0f80;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('Network',attributes,{'tableName':_0xaac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index bca745f..b5aee87 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x48dd1f,_0x266ca2){_0x48dd1f=_0x48dd1f-0x0;var _0x262407=_0x7a54[_0x48dd1f];return _0x262407;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x50c0f0,_0x5d4f46){_0x50c0f0=_0x50c0f0-0x0;var _0x5364ca=_0x7a54[_0x50c0f0];return _0x5364ca;};'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 f6b26c5..d43a1df 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 _0x295d=['send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send'];(function(_0x302791,_0x577e39){var _0x52b59a=function(_0x1349ba){while(--_0x1349ba){_0x302791['push'](_0x302791['shift']());}};_0x52b59a(++_0x577e39);}(_0x295d,0xb5));var _0xd295=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x295d[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xd295('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd295('0x1'));var express=require(_0xd295('0x2'));var router=express[_0xd295('0x3')]();var fs_extra=require(_0xd295('0x4'));var auth=require(_0xd295('0x5'));var interaction=require(_0xd295('0x6'));var config=require(_0xd295('0x7'));var controller=require('./openchannelAccount.controller');router[_0xd295('0x8')]('/',auth['isAuthenticated'](),controller[_0xd295('0x9')]);router[_0xd295('0x8')](_0xd295('0xa'),auth[_0xd295('0xb')](),controller[_0xd295('0xc')]);router[_0xd295('0x8')](_0xd295('0xd'),auth['isAuthenticated'](),controller[_0xd295('0xe')]);router[_0xd295('0x8')](_0xd295('0xf'),auth[_0xd295('0xb')](),controller[_0xd295('0x10')]);router['get']('/:id/canned_answers',auth[_0xd295('0xb')](),controller[_0xd295('0x11')]);router[_0xd295('0x8')](_0xd295('0x12'),auth[_0xd295('0xb')](),controller[_0xd295('0x13')]);router['get'](_0xd295('0x14'),auth[_0xd295('0xb')](),controller[_0xd295('0x15')]);router[_0xd295('0x8')](_0xd295('0x16'),auth['isAuthenticated'](),controller[_0xd295('0x17')]);router[_0xd295('0x18')]('/',auth[_0xd295('0xb')](),controller[_0xd295('0x19')]);router['post'](_0xd295('0xf'),auth[_0xd295('0xb')](),controller[_0xd295('0x1a')]);router[_0xd295('0x18')](_0xd295('0x1b'),auth[_0xd295('0xb')](),controller[_0xd295('0x1c')]);router[_0xd295('0x18')](_0xd295('0x1d'),controller[_0xd295('0x1e')]);router[_0xd295('0x18')](_0xd295('0x12'),auth['isAuthenticated'](),controller[_0xd295('0x1f')]);router[_0xd295('0x18')](_0xd295('0x16'),auth['isAuthenticated'](),controller[_0xd295('0x20')]);router['post'](_0xd295('0x21'),auth[_0xd295('0xb')](),controller[_0xd295('0x22')]);router[_0xd295('0x23')]('/:id',auth[_0xd295('0xb')](),controller[_0xd295('0x24')]);router[_0xd295('0x25')](_0xd295('0xd'),auth[_0xd295('0xb')](),controller[_0xd295('0x26')]);router['delete'](_0xd295('0xf'),auth[_0xd295('0xb')](),controller[_0xd295('0x27')]);router[_0xd295('0x25')](_0xd295('0x1b'),auth[_0xd295('0xb')](),controller[_0xd295('0x28')]);router[_0xd295('0x25')](_0xd295('0x16'),auth[_0xd295('0xb')](),controller[_0xd295('0x29')]);module[_0xd295('0x2a')]=router; \ No newline at end of file +var _0xe882=['getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','addDisposition','addAnswer','post','/:id/notify','notify','addApplications','addAgents','/:id/send','send','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe882,0x146));var _0x2e88=function(_0x51206e,_0x2bb6a6){_0x51206e=_0x51206e-0x0;var _0x8fe5de=_0xe882[_0x51206e];return _0x8fe5de;};'use strict';var multer=require(_0x2e88('0x0'));var util=require(_0x2e88('0x1'));var path=require(_0x2e88('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e88('0x3')]();var fs_extra=require(_0x2e88('0x4'));var auth=require(_0x2e88('0x5'));var interaction=require(_0x2e88('0x6'));var config=require(_0x2e88('0x7'));var controller=require(_0x2e88('0x8'));router[_0x2e88('0x9')]('/',auth[_0x2e88('0xa')](),controller[_0x2e88('0xb')]);router[_0x2e88('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2e88('0xc')]);router['get'](_0x2e88('0xd'),auth['isAuthenticated'](),controller[_0x2e88('0xe')]);router[_0x2e88('0x9')](_0x2e88('0xf'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x10')]);router['get'](_0x2e88('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x2e88('0x9')](_0x2e88('0x12'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x13')]);router[_0x2e88('0x9')](_0x2e88('0x14'),auth[_0x2e88('0xa')](),controller['getInteractions']);router[_0x2e88('0x9')](_0x2e88('0x15'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x16')]);router['post']('/',auth[_0x2e88('0xa')](),controller['create']);router['post'](_0x2e88('0xf'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x17')]);router['post'](_0x2e88('0x11'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x18')]);router[_0x2e88('0x19')](_0x2e88('0x1a'),controller[_0x2e88('0x1b')]);router[_0x2e88('0x19')](_0x2e88('0x12'),auth['isAuthenticated'](),controller[_0x2e88('0x1c')]);router[_0x2e88('0x19')](_0x2e88('0x15'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x1d')]);router[_0x2e88('0x19')](_0x2e88('0x1e'),auth['isAuthenticated'](),controller[_0x2e88('0x1f')]);router['put'](_0x2e88('0xd'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x20')]);router[_0x2e88('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x2e88('0x22')]);router[_0x2e88('0x21')](_0x2e88('0xf'),auth[_0x2e88('0xa')](),controller['removeDispositions']);router['delete'](_0x2e88('0x11'),auth[_0x2e88('0xa')](),controller[_0x2e88('0x23')]);router['delete'](_0x2e88('0x15'),auth['isAuthenticated'](),controller[_0x2e88('0x24')]);module[_0x2e88('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 7a94273..1301461 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 _0xf9ad=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize','randomstring','exports','name','STRING','BOOLEAN'];(function(_0x1427b8,_0x2a9484){var _0x3b0efd=function(_0x1e68db){while(--_0x1e68db){_0x1427b8['push'](_0x1427b8['shift']());}};_0x3b0efd(++_0x2a9484);}(_0xf9ad,0x150));var _0xdf9a=function(_0x4b9f7c,_0x371fd6){_0x4b9f7c=_0x4b9f7c-0x0;var _0x5e32f9=_0xf9ad[_0x4b9f7c];return _0x5e32f9;};'use strict';var Sequelize=require(_0xdf9a('0x0'));var rs=require(_0xdf9a('0x1'));module[_0xdf9a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xdf9a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdf9a('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xdf9a('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xdf9a('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xdf9a('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdf9a('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xdf9a('0x4')]},'queueTransfer':{'type':Sequelize[_0xdf9a('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdf9a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdf9a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdf9a('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xdf9a('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xdf9a('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xec48ec){if(!_0xec48ec)this[_0xdf9a('0x8')]('mandatoryDispositionPauseId',null);this[_0xdf9a('0x8')]('mandatoryDisposition',_0xec48ec);}}}; \ No newline at end of file +var _0xc232=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc232,0x177));var _0x2c23=function(_0x2e4bbc,_0x3b0036){_0x2e4bbc=_0x2e4bbc-0x0;var _0x517b41=_0xc232[_0x2e4bbc];return _0x517b41;};'use strict';var Sequelize=require(_0x2c23('0x0'));var rs=require(_0x2c23('0x1'));module[_0x2c23('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x2c23('0x3')]},'token':{'type':Sequelize[_0x2c23('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x2c23('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2c23('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2c23('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2c23('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2c23('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2c23('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2c23('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2c23('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2c23('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2c23('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2c23('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x2c23('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x2c23('0x5')],'defaultValue':![],'comment':_0x2c23('0x8'),'set':function(_0x11db62){if(!_0x11db62)this[_0x2c23('0x9')](_0x2c23('0xa'),null);this[_0x2c23('0x9')](_0x2c23('0xb'),_0x11db62);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index e867693..d9cb86a 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 _0x1738=['orderBy','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','sendStatus','stack','send','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','count','include','findAll','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','order','pick','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','account','applications','list'];(function(_0x4ce803,_0x35cd6b){var _0x384b19=function(_0x25d1ae){while(--_0x25d1ae){_0x4ce803['push'](_0x4ce803['shift']());}};_0x384b19(++_0x35cd6b);}(_0x1738,0x1bc));var _0x8173=function(_0x2553aa,_0x420113){_0x2553aa=_0x2553aa-0x0;var _0x315462=_0x1738[_0x2553aa];return _0x315462;};'use strict';var emlformat=require(_0x8173('0x0'));var rimraf=require(_0x8173('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8173('0x2'));var moment=require(_0x8173('0x3'));var BPromise=require(_0x8173('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8173('0x5'));var sox=require(_0x8173('0x6'));var csv=require(_0x8173('0x7'));var ejs=require(_0x8173('0x8'));var fs=require('fs');var fs_extra=require(_0x8173('0x9'));var _=require(_0x8173('0xa'));var squel=require(_0x8173('0xb'));var crypto=require(_0x8173('0xc'));var jsforce=require(_0x8173('0xd'));var deskjs=require(_0x8173('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8173('0xf'));var Redis=require(_0x8173('0x10'));var authService=require(_0x8173('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8173('0x12'));var logger=require(_0x8173('0x13'))(_0x8173('0x14'));var utils=require(_0x8173('0x15'));var config=require(_0x8173('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8173('0x17'))['db'];config['redis']=_[_0x8173('0x18')](config[_0x8173('0x19')],{'host':_0x8173('0x1a'),'port':0x18eb});var socket=require(_0x8173('0x1b'))(new Redis(config[_0x8173('0x19')]));require('./openchannelAccount.socket')[_0x8173('0x1c')](socket);var jayson=require(_0x8173('0x1d'));var client=jayson[_0x8173('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8173('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x40bf0e,_0x2e7ca5,_0x58fcf1,_0x2932b2){return new BPromise(function(_0x114b42,_0x4d1fa2){var _0x70e7fc=_0x2932b2||client;return _0x70e7fc[_0x8173('0x20')](_0x40bf0e,_0x58fcf1)[_0x8173('0x21')](function(_0x312eae){logger[_0x8173('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e7ca5,_0x8173('0x23'));logger[_0x8173('0x24')](_0x8173('0x25'),_0x2e7ca5,_0x8173('0x23'),JSON[_0x8173('0x26')](_0x312eae));if(_0x312eae[_0x8173('0x27')]){if(_0x312eae[_0x8173('0x27')][_0x8173('0x28')]===0x1f4){logger[_0x8173('0x27')](_0x8173('0x29'),_0x2e7ca5,_0x312eae['error'][_0x8173('0x2a')]);return _0x4d1fa2(_0x312eae[_0x8173('0x27')]['message']);}logger[_0x8173('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x2e7ca5,_0x312eae[_0x8173('0x27')]['message']);return _0x114b42(_0x312eae[_0x8173('0x27')]['message']);}else{logger[_0x8173('0x22')](_0x8173('0x29'),_0x2e7ca5,'request\x20sent');_0x114b42(_0x312eae[_0x8173('0x2b')]['message']);}})[_0x8173('0x2c')](function(_0x189acd){logger[_0x8173('0x27')](_0x8173('0x29'),_0x2e7ca5,_0x189acd);_0x4d1fa2(_0x189acd);});});}function respondWithStatusCode(_0x273820,_0x39cb27){_0x39cb27=_0x39cb27||0xcc;return function(_0x27b92a){if(_0x27b92a){return _0x273820['sendStatus'](_0x39cb27);}return _0x273820[_0x8173('0x2d')](_0x39cb27)[_0x8173('0x2e')]();};}function respondWithResult(_0x4fbe19,_0x52c249){_0x52c249=_0x52c249||0xc8;return function(_0x2eea21){if(_0x2eea21){return _0x4fbe19[_0x8173('0x2d')](_0x52c249)[_0x8173('0x2f')](_0x2eea21);}};}function respondWithFilteredResult(_0x5ee6e0,_0x50a935){return function(_0x223a9c){if(_0x223a9c){var _0x469a51=typeof _0x50a935[_0x8173('0x30')]===_0x8173('0x31')&&typeof _0x50a935['limit']===_0x8173('0x31');var _0x547b3a=_0x223a9c['count'];var _0xb2f261=_0x469a51?0x0:_0x50a935[_0x8173('0x30')];var _0x4c8b01=_0x469a51?_0x223a9c['count']:_0x50a935[_0x8173('0x30')]+_0x50a935[_0x8173('0x32')];var _0x36c282;if(_0x4c8b01>=_0x547b3a){_0x4c8b01=_0x547b3a;_0x36c282=0xc8;}else{_0x36c282=0xce;}_0x5ee6e0['status'](_0x36c282);return _0x5ee6e0[_0x8173('0x33')](_0x8173('0x34'),_0xb2f261+'-'+_0x4c8b01+'/'+_0x547b3a)[_0x8173('0x2f')](_0x223a9c);}return null;};}function patchUpdates(_0x464998){return function(_0x262222){try{jsonpatch['apply'](_0x262222,_0x464998,!![]);}catch(_0x448e32){return BPromise[_0x8173('0x35')](_0x448e32);}return _0x262222[_0x8173('0x36')]();};}function saveUpdates(_0x5c27ba,_0x2d7823){return function(_0x2aa38f){if(_0x2aa38f){return _0x2aa38f[_0x8173('0x37')](_0x5c27ba)[_0x8173('0x21')](function(_0x16a4a2){return _0x16a4a2;});}return null;};}function removeEntity(_0x41ae06,_0x2dea9a){return function(_0x29a6b6){if(_0x29a6b6){return _0x29a6b6[_0x8173('0x38')]()['then'](function(){var _0x46bde2=_0x29a6b6[_0x8173('0x39')]({'plain':!![]});var _0x1ba0bb=_0x8173('0x3a');return db['UserProfileResource'][_0x8173('0x38')]({'where':{'type':_0x1ba0bb,'resourceId':_0x46bde2['id']}})[_0x8173('0x21')](function(){return _0x29a6b6;});})[_0x8173('0x21')](function(){_0x41ae06[_0x8173('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40395d,_0x257619){return function(_0x45888a){if(!_0x45888a){_0x40395d[_0x8173('0x3b')](0x194);}return _0x45888a;};}function handleError(_0x5c5bf4,_0x4416e8){_0x4416e8=_0x4416e8||0x1f4;return function(_0x2ab1e4){logger[_0x8173('0x27')](_0x2ab1e4[_0x8173('0x3c')]);if(_0x2ab1e4['name']){delete _0x2ab1e4['name'];}_0x5c5bf4['status'](_0x4416e8)[_0x8173('0x3d')](_0x2ab1e4);};}exports['index']=function(_0x36dcb8,_0x4c36ae){var _0x5c2eef={'include':[{'model':db[_0x8173('0x3e')],'as':_0x8173('0x3f')}]},_0x2247fd={},_0xc6875b={'count':0x0,'rows':[]};var _0x374c51=_[_0x8173('0x40')](db['OpenchannelAccount'][_0x8173('0x41')],function(_0x34651a){return{'name':_0x34651a['fieldName'],'type':_0x34651a[_0x8173('0x42')][_0x8173('0x43')]};});_0x2247fd['model']=_[_0x8173('0x40')](_0x374c51,'name');_0x2247fd['query']=_['keys'](_0x36dcb8[_0x8173('0x44')]);_0x2247fd[_0x8173('0x45')]=_[_0x8173('0x46')](_0x2247fd['model'],_0x2247fd[_0x8173('0x44')]);_0x5c2eef[_0x8173('0x47')]=_[_0x8173('0x46')](_0x2247fd[_0x8173('0x48')],qs[_0x8173('0x49')](_0x36dcb8[_0x8173('0x44')][_0x8173('0x49')]));_0x5c2eef['attributes']=_0x5c2eef[_0x8173('0x47')][_0x8173('0x4a')]?_0x5c2eef[_0x8173('0x47')]:_0x2247fd[_0x8173('0x48')];if(!_0x36dcb8[_0x8173('0x44')][_0x8173('0x4b')](_0x8173('0x4c'))){_0x5c2eef['limit']=qs[_0x8173('0x32')](_0x36dcb8[_0x8173('0x44')][_0x8173('0x32')]);_0x5c2eef[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x36dcb8[_0x8173('0x44')]['offset']);}_0x5c2eef['order']=qs[_0x8173('0x4d')](_0x36dcb8[_0x8173('0x44')]['sort']);_0x5c2eef[_0x8173('0x4e')]=qs['filters'](_['pick'](_0x36dcb8[_0x8173('0x44')],_0x2247fd[_0x8173('0x45')]),_0x374c51);if(_0x36dcb8[_0x8173('0x44')][_0x8173('0x4f')]){_0x5c2eef[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x5c2eef[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x374c51,function(_0x2194de){if(_0x2194de[_0x8173('0x42')]!==_0x8173('0x51')){var _0x22d907={};_0x22d907[_0x2194de['name']]={'$like':'%'+_0x36dcb8['query'][_0x8173('0x4f')]+'%'};return _0x22d907;}})});}_0x5c2eef=_[_0x8173('0x50')]({},_0x5c2eef,_0x36dcb8[_0x8173('0x52')]);var _0x426d6={'where':_0x5c2eef[_0x8173('0x4e')]};return db[_0x8173('0x53')][_0x8173('0x54')](_0x426d6)[_0x8173('0x21')](function(_0x2f04bb){_0xc6875b[_0x8173('0x54')]=_0x2f04bb;if(_0x36dcb8[_0x8173('0x44')]['includeAll']){_0x5c2eef[_0x8173('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x8173('0x56')](_0x5c2eef);})[_0x8173('0x21')](function(_0x565e06){_0xc6875b['rows']=_0x565e06;return _0xc6875b;})[_0x8173('0x21')](respondWithFilteredResult(_0x4c36ae,_0x5c2eef))[_0x8173('0x2c')](handleError(_0x4c36ae,null));};exports['show']=function(_0xeb218e,_0x5ab9e1){var _0x5d06c3={'raw':![],'where':{'id':_0xeb218e[_0x8173('0x57')]['id']},'include':[{'model':db[_0x8173('0x3e')],'as':_0x8173('0x3f')}]},_0x4c8ee0={};_0x4c8ee0[_0x8173('0x48')]=_['keys'](db[_0x8173('0x53')][_0x8173('0x41')]);_0x4c8ee0[_0x8173('0x44')]=_[_0x8173('0x58')](_0xeb218e[_0x8173('0x44')]);_0x4c8ee0[_0x8173('0x45')]=_['intersection'](_0x4c8ee0[_0x8173('0x48')],_0x4c8ee0[_0x8173('0x44')]);_0x5d06c3[_0x8173('0x47')]=_[_0x8173('0x46')](_0x4c8ee0[_0x8173('0x48')],qs['fields'](_0xeb218e[_0x8173('0x44')][_0x8173('0x49')]));_0x5d06c3[_0x8173('0x47')]=_0x5d06c3[_0x8173('0x47')]['length']?_0x5d06c3[_0x8173('0x47')]:_0x4c8ee0[_0x8173('0x48')];if(_0xeb218e['query'][_0x8173('0x59')]){_0x5d06c3[_0x8173('0x55')]=[{'all':!![]}];}_0x5d06c3=_[_0x8173('0x50')]({},_0x5d06c3,_0xeb218e[_0x8173('0x52')]);return db[_0x8173('0x53')][_0x8173('0x5a')](_0x5d06c3)[_0x8173('0x21')](handleEntityNotFound(_0x5ab9e1,null))[_0x8173('0x21')](respondWithResult(_0x5ab9e1,null))[_0x8173('0x2c')](handleError(_0x5ab9e1,null));};exports['create']=function(_0x1dab4a,_0x3e4d5e){return db[_0x8173('0x53')][_0x8173('0x5b')](_0x1dab4a[_0x8173('0x5c')],{})[_0x8173('0x21')](function(_0x551bf0){var _0x2feeff=_0x1dab4a['user']['get']({'plain':!![]});if(!_0x2feeff)throw new Error(_0x8173('0x5d'));if(_0x2feeff['role']===_0x8173('0x5e')){var _0x580f5c=_0x551bf0[_0x8173('0x39')]({'plain':!![]});var _0x7f471c='OpenchannelAccounts';return db[_0x8173('0x5f')][_0x8173('0x5a')]({'where':{'name':_0x7f471c,'userProfileId':_0x2feeff[_0x8173('0x60')]},'raw':!![]})[_0x8173('0x21')](function(_0x5f280b){if(_0x5f280b&&_0x5f280b['autoAssociation']===0x0){return db[_0x8173('0x61')][_0x8173('0x5b')]({'name':_0x580f5c[_0x8173('0x62')],'resourceId':_0x580f5c['id'],'type':_0x5f280b[_0x8173('0x62')],'sectionId':_0x5f280b['id']},{})[_0x8173('0x21')](function(){return _0x551bf0;});}else{return _0x551bf0;}})['catch'](function(_0x52b3df){logger[_0x8173('0x27')](_0x8173('0x63'),_0x52b3df);throw _0x52b3df;});}return _0x551bf0;})[_0x8173('0x21')](respondWithResult(_0x3e4d5e,0xc9))[_0x8173('0x2c')](handleError(_0x3e4d5e,null));};exports['update']=function(_0x5148e4,_0x3890c7){if(_0x5148e4['body']['id']){delete _0x5148e4[_0x8173('0x5c')]['id'];}return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x5148e4[_0x8173('0x57')]['id']},'include':[{'model':db[_0x8173('0x3e')],'as':'mandatoryDispositionPause'}]})[_0x8173('0x21')](handleEntityNotFound(_0x3890c7,null))[_0x8173('0x21')](saveUpdates(_0x5148e4[_0x8173('0x5c')],null))[_0x8173('0x21')](respondWithResult(_0x3890c7,null))[_0x8173('0x2c')](handleError(_0x3890c7,null));};exports['destroy']=function(_0x1775f8,_0x4cf730){return db[_0x8173('0x53')]['find']({'where':{'id':_0x1775f8[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x4cf730,null))[_0x8173('0x21')](removeEntity(_0x4cf730,null))['catch'](handleError(_0x4cf730,null));};exports[_0x8173('0x64')]=function(_0x353c0c,_0x41233c){return db['OpenchannelAccount'][_0x8173('0x64')]()['then'](respondWithResult(_0x41233c,null))[_0x8173('0x2c')](handleError(_0x41233c,null));};exports['addDisposition']=function(_0x182ccc,_0x3d79ef,_0x13373a){if(_0x182ccc[_0x8173('0x5c')]['id']){delete _0x182ccc[_0x8173('0x5c')]['id'];}return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x182ccc['params']['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x3d79ef,null))[_0x8173('0x21')](function(_0x3293e4){if(_0x3293e4){_0x182ccc[_0x8173('0x5c')]['OpenchannelAccountId']=_0x3293e4['id'];return db[_0x8173('0x65')][_0x8173('0x5b')](_0x182ccc[_0x8173('0x5c')]);}})[_0x8173('0x21')](respondWithResult(_0x3d79ef,null))[_0x8173('0x2c')](handleError(_0x3d79ef,null));};exports[_0x8173('0x66')]=function(_0x4290c2,_0x2fb923,_0x56d3d8){var _0x56b779={'raw':![],'where':{}};var _0x5568e1={};var _0x363c04={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8173('0x67')]({'where':{'id':_0x4290c2[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x2fb923,null))[_0x8173('0x21')](function(_0x3b0fe3){if(_0x3b0fe3){_0x5568e1[_0x8173('0x48')]=_[_0x8173('0x58')](db[_0x8173('0x65')]['rawAttributes']);_0x5568e1[_0x8173('0x44')]=_[_0x8173('0x58')](_0x4290c2[_0x8173('0x44')]);_0x5568e1[_0x8173('0x45')]=_[_0x8173('0x46')](_0x5568e1[_0x8173('0x48')],_0x5568e1['query']);_0x56b779[_0x8173('0x47')]=_[_0x8173('0x46')](_0x5568e1['model'],qs['fields'](_0x4290c2[_0x8173('0x44')][_0x8173('0x49')]));_0x56b779[_0x8173('0x47')]=_0x56b779[_0x8173('0x47')][_0x8173('0x4a')]?_0x56b779[_0x8173('0x47')]:_0x5568e1[_0x8173('0x48')];if(!_0x4290c2[_0x8173('0x44')][_0x8173('0x4b')](_0x8173('0x4c'))){_0x56b779[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x4290c2[_0x8173('0x44')]['limit']);_0x56b779[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x4290c2[_0x8173('0x44')][_0x8173('0x30')]);}_0x56b779[_0x8173('0x68')]=qs[_0x8173('0x4d')](_0x4290c2['query'][_0x8173('0x4d')]);_0x56b779['where']=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x4290c2[_0x8173('0x44')],_0x5568e1[_0x8173('0x45')]));_0x56b779[_0x8173('0x4e')][_0x8173('0x6a')]=_0x3b0fe3['id'];if(_0x4290c2['query']['filter']){_0x56b779[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x56b779[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x56b779[_0x8173('0x47')],function(_0x14494e){var _0x260c00={};_0x260c00[_0x14494e]={'$like':'%'+_0x4290c2[_0x8173('0x44')][_0x8173('0x4f')]+'%'};return _0x260c00;})});}_0x56b779=_[_0x8173('0x50')]({},_0x56b779,_0x4290c2[_0x8173('0x52')]);return db['Disposition'][_0x8173('0x54')]({'where':_0x56b779['where']})[_0x8173('0x21')](function(_0x4eb89a){_0x363c04[_0x8173('0x54')]=_0x4eb89a;if(_0x4290c2[_0x8173('0x44')][_0x8173('0x59')]){_0x56b779[_0x8173('0x55')]=[{'all':!![]}];}return db[_0x8173('0x65')][_0x8173('0x56')](_0x56b779);})['then'](function(_0x15a48f){_0x363c04['rows']=_0x15a48f;return _0x363c04;});}})[_0x8173('0x21')](respondWithFilteredResult(_0x2fb923,_0x56b779))[_0x8173('0x2c')](handleError(_0x2fb923,null));};exports['removeDispositions']=function(_0x5322d3,_0x45b5d1,_0x498dc6){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x5322d3['params']['id']}})['then'](handleEntityNotFound(_0x45b5d1,null))[_0x8173('0x21')](function(_0x2a2603){if(_0x2a2603){return _0x2a2603[_0x8173('0x6b')](_0x5322d3['query'][_0x8173('0x6c')]);}})['then'](respondWithStatusCode(_0x45b5d1,null))['catch'](handleError(_0x45b5d1,null));};exports[_0x8173('0x6d')]=function(_0x31cab8,_0x22727d,_0x1bbea4){if(_0x31cab8[_0x8173('0x5c')]['id']){delete _0x31cab8['body']['id'];}return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x31cab8['params']['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x22727d,null))[_0x8173('0x21')](function(_0x39ed10){if(_0x39ed10){_0x31cab8[_0x8173('0x5c')][_0x8173('0x6a')]=_0x39ed10['id'];return db[_0x8173('0x6e')][_0x8173('0x5b')](_0x31cab8['body']);}})[_0x8173('0x21')](respondWithResult(_0x22727d,null))['catch'](handleError(_0x22727d,null));};exports[_0x8173('0x6f')]=function(_0x3c78f1,_0x45c8e6,_0x25de7e){var _0x40aeea={'raw':![],'where':{}};var _0x367f80={};var _0x3d3ce5={'count':0x0,'rows':[]};return db[_0x8173('0x53')][_0x8173('0x67')]({'where':{'id':_0x3c78f1[_0x8173('0x57')]['id']}})['then'](handleEntityNotFound(_0x45c8e6,null))['then'](function(_0x24f500){if(_0x24f500){_0x367f80[_0x8173('0x48')]=_[_0x8173('0x58')](db['CannedAnswer'][_0x8173('0x41')]);_0x367f80[_0x8173('0x44')]=_[_0x8173('0x58')](_0x3c78f1[_0x8173('0x44')]);_0x367f80[_0x8173('0x45')]=_[_0x8173('0x46')](_0x367f80['model'],_0x367f80[_0x8173('0x44')]);_0x40aeea[_0x8173('0x47')]=_[_0x8173('0x46')](_0x367f80[_0x8173('0x48')],qs['fields'](_0x3c78f1[_0x8173('0x44')][_0x8173('0x49')]));_0x40aeea[_0x8173('0x47')]=_0x40aeea['attributes'][_0x8173('0x4a')]?_0x40aeea[_0x8173('0x47')]:_0x367f80[_0x8173('0x48')];if(!_0x3c78f1['query']['hasOwnProperty'](_0x8173('0x4c'))){_0x40aeea[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x3c78f1['query'][_0x8173('0x32')]);_0x40aeea[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x3c78f1[_0x8173('0x44')][_0x8173('0x30')]);}_0x40aeea[_0x8173('0x68')]=qs[_0x8173('0x4d')](_0x3c78f1[_0x8173('0x44')][_0x8173('0x4d')]);_0x40aeea[_0x8173('0x4e')]=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x3c78f1[_0x8173('0x44')],_0x367f80[_0x8173('0x45')]));_0x40aeea['where']['OpenchannelAccountId']=_0x24f500['id'];if(_0x3c78f1[_0x8173('0x44')][_0x8173('0x4f')]){_0x40aeea['where']=_[_0x8173('0x50')](_0x40aeea[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x40aeea[_0x8173('0x47')],function(_0x4100c8){var _0x533596={};_0x533596[_0x4100c8]={'$like':'%'+_0x3c78f1[_0x8173('0x44')][_0x8173('0x4f')]+'%'};return _0x533596;})});}_0x40aeea=_['merge']({},_0x40aeea,_0x3c78f1[_0x8173('0x52')]);return db['CannedAnswer'][_0x8173('0x54')]({'where':_0x40aeea[_0x8173('0x4e')]})['then'](function(_0x189484){_0x3d3ce5[_0x8173('0x54')]=_0x189484;if(_0x3c78f1[_0x8173('0x44')][_0x8173('0x59')]){_0x40aeea[_0x8173('0x55')]=[{'all':!![]}];}return db[_0x8173('0x6e')]['findAll'](_0x40aeea);})[_0x8173('0x21')](function(_0x2da352){_0x3d3ce5[_0x8173('0x70')]=_0x2da352;return _0x3d3ce5;});}})['then'](respondWithFilteredResult(_0x45c8e6,_0x40aeea))[_0x8173('0x2c')](handleError(_0x45c8e6,null));};exports[_0x8173('0x71')]=function(_0x17a47d,_0x518a1e,_0x51a996){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x17a47d['params']['id']}})['then'](handleEntityNotFound(_0x518a1e,null))[_0x8173('0x21')](function(_0x34735c){if(_0x34735c){return _0x34735c[_0x8173('0x71')](_0x17a47d[_0x8173('0x44')][_0x8173('0x6c')]);}})[_0x8173('0x21')](respondWithStatusCode(_0x518a1e,null))[_0x8173('0x2c')](handleError(_0x518a1e,null));};exports[_0x8173('0x72')]=function(_0x3f63b1,_0x13b259,_0x2793a5){var _0x54801f={'body':_0x3f63b1[_0x8173('0x5c')],'channel':_0x8173('0x73')};var _0x32f6ae=[];var _0x4d304c=[];var _0x547d22={};var _0x22979f=![];return db[_0x8173('0x74')][_0x8173('0x64')]()[_0x8173('0x21')](function(_0x33b49e){if(!_0x33b49e){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))](_0x8173('0x77'));}_0x32f6ae=_[_0x8173('0x78')](_[_0x8173('0x58')](_0x33b49e),[_0x8173('0x79'),_0x8173('0x7a')]);_0x4d304c=_['difference'](_[_0x8173('0x58')](_0x33b49e),[_0x8173('0x79'),_0x8173('0x7a'),_0x8173('0x7b'),_0x8173('0x7c')]);if(_0x3f63b1[_0x8173('0x5c')]['id']){delete _0x3f63b1[_0x8173('0x5c')]['id'];}if(_['isNil'](_0x3f63b1['body'][_0x8173('0x7d')])){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3f63b1[_0x8173('0x5c')][_0x8173('0x5c')])||_0x3f63b1[_0x8173('0x5c')][_0x8173('0x5c')]===''){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8173('0x7e')](_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7f')])){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))](_0x8173('0x80')+_0x4d304c);}if(!_[_0x8173('0x81')](_0x4d304c,_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7f')])){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d304c);}_0x547d22[_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7f')]]=_0x3f63b1[_0x8173('0x5c')]['from'];})[_0x8173('0x21')](function(){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x3f63b1[_0x8173('0x57')]['id']},'include':[{'model':db[_0x8173('0x82')],'as':_0x8173('0x83'),'include':[{'model':db['CmContact'],'as':_0x8173('0x84'),'where':_0x547d22,'limit':0x1,'order':[[_0x8173('0x7a'),_0x8173('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0x8173('0x86')}]});})[_0x8173('0x21')](handleEntityNotFound(_0x13b259,null))['then'](function(_0x406298){if(_0x406298&&_0x406298[_0x8173('0x83')]){_0x54801f[_0x8173('0x87')]=_0x406298;_0x54801f[_0x8173('0x88')]=_0x406298[_0x8173('0x86')];_0x54801f[_0x8173('0x89')]=_0x406298['List'];_0x54801f[_0x8173('0x88')]=_[_0x8173('0x8a')](_0x54801f[_0x8173('0x88')],['priority'],[_0x8173('0x8b')]);if(_0x54801f[_0x8173('0x87')][_0x8173('0x86')]){delete _0x54801f[_0x8173('0x87')][_0x8173('0x86')];}if(_0x54801f[_0x8173('0x87')][_0x8173('0x83')]&&_0x54801f[_0x8173('0x87')][_0x8173('0x83')]['Contacts'][_0x8173('0x4a')]){return _0x54801f[_0x8173('0x87')][_0x8173('0x83')][_0x8173('0x84')][0x0];}var _0x33151a=_[_0x8173('0x18')](_0x3f63b1[_0x8173('0x5c')],{'firstName':_0x3f63b1[_0x8173('0x5c')][_0x8173('0x7d')],'ListId':_0x406298[_0x8173('0x7c')]});_0x33151a[_0x3f63b1[_0x8173('0x5c')]['mapKey']]=_0x3f63b1[_0x8173('0x5c')]['from'];return db['CmContact'][_0x8173('0x5b')](_0x33151a,{'fields':_0x32f6ae,'raw':!![]});}})[_0x8173('0x21')](handleEntityNotFound(_0x13b259,null))[_0x8173('0x21')](function(_0xec2ba4){_0x54801f[_0x8173('0x8c')]=_0xec2ba4;if(_0xec2ba4){var _0x34bba0={'ContactId':_0xec2ba4['id'],'OpenchannelAccountId':_0x3f63b1[_0x8173('0x57')]['id'],'from':(_0xec2ba4[_0x8173('0x8d')]||'')+'\x20'+(_0xec2ba4[_0x8173('0x8e')]||'')};var _0x538ffd={'OpenchannelAccountId':_0x3f63b1[_0x8173('0x57')]['id'],'closed':![]};if(_0x3f63b1[_0x8173('0x5c')][_0x8173('0x8f')]){_0x538ffd['threadId']=_0x3f63b1['body'][_0x8173('0x8f')];return db[_0x8173('0x90')]['find']({'where':_0x538ffd})[_0x8173('0x21')](function(_0x1992be){if(_0x1992be){return[_0x1992be,![]];}_0x34bba0[_0x8173('0x8f')]=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x8f')];_0x34bba0[_0x8173('0x91')]=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x91')];return db[_0x8173('0x90')][_0x8173('0x5b')](_0x34bba0)[_0x8173('0x21')](function(_0x2268ac){return[_0x2268ac,!![]];});});}else{_0x538ffd[_0x8173('0x8f')]=null;}_0x538ffd[_0x8173('0x92')]=_0xec2ba4['id'];return db[_0x8173('0x90')][_0x8173('0x5a')]({'where':_0x538ffd})[_0x8173('0x21')](function(_0xa7cece){if(_0xa7cece){return[_0xa7cece,![]];}return db['OpenchannelInteraction'][_0x8173('0x5b')](_0x34bba0)[_0x8173('0x21')](function(_0x5c480e){return[_0x5c480e,!![]];});});}})[_0x8173('0x93')](function(_0x10a060,_0x4cf1ca){if(_0x10a060){_0x22979f=_0x4cf1ca;if(!_0x4cf1ca){var _0x2e7dd4={'from':(_0x54801f[_0x8173('0x8c')][_0x8173('0x8d')]||'')+'\x20'+(_0x54801f[_0x8173('0x8c')][_0x8173('0x8e')]||'')};if(_0x3f63b1['body'][_0x8173('0x8f')]&&_0x3f63b1['body'][_0x8173('0x94')]&&_0x3f63b1[_0x8173('0x5c')][_0x8173('0x8f')]!=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x94')]){_0x2e7dd4[_0x8173('0x8f')]=_0x3f63b1[_0x8173('0x5c')][_0x8173('0x94')];}return _0x10a060[_0x8173('0x37')](_0x2e7dd4);}else{return _0x10a060;}}})[_0x8173('0x21')](function(_0x12fdbd){_0x54801f['interaction']=_0x12fdbd[_0x8173('0x39')]({'plain':!![]});_0x54801f[_0x8173('0x95')]['created']=_0x22979f;if(_0x54801f['interaction'][_0x8173('0x96')]){if(_0x54801f[_0x8173('0x87')][_0x8173('0x97')]){_0x54801f[_0x8173('0x88')][_0x8173('0x98')]({'id':0x0,'priority':_0x54801f['applications'][_0x8173('0x4a')]+0x1,'app':_0x8173('0x99'),'appdata':_0x8173('0x9a'),'interval':_0x8173('0x9b')});}}return db[_0x8173('0x9c')][_0x8173('0x5b')]({'body':_0x3f63b1[_0x8173('0x5c')][_0x8173('0x5c')],'OpenchannelAccountId':_0x3f63b1[_0x8173('0x57')]['id'],'OpenchannelInteractionId':_0x12fdbd['id'],'direction':'in','ContactId':_0x54801f[_0x8173('0x8c')]['id'],'AttachmentId':_0x3f63b1[_0x8173('0x5c')][_0x8173('0x9d')]});})[_0x8173('0x21')](function(_0x42ddb6){_0x54801f['message']=_0x42ddb6;if(_0x54801f['interaction'][_0x8173('0x9e')]){return db[_0x8173('0x9f')]['find']({'attributes':['id','name'],'where':{'id':_0x54801f[_0x8173('0x95')]['UserId']}})[_0x8173('0x21')](function(_0x5abf83){if(_0x5abf83){_0x54801f[_0x8173('0x88')][_0x8173('0xa0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5abf83[_0x8173('0x62')]+','+(_0x54801f[_0x8173('0x87')][_0x8173('0xa1')]||0xa),'interval':_0x8173('0x9b')});_0x54801f['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x8173('0xa2'),_0x54801f);});}return respondWithRpcPromise(_0x8173('0xa3'),_0x8173('0xa2'),_0x54801f);})[_0x8173('0x21')](function(_0x493115){respondWithRpcPromise('EventManager',_0x8173('0xa4'),{'event':_0x8173('0x72'),'message':_0x493115},client9002);return _0x493115;})[_0x8173('0x21')](respondWithResult(_0x13b259,null))['catch'](handleError(_0x13b259,null));};exports[_0x8173('0xa5')]=function(_0x3639eb,_0x2bed39){var _0x405185=_0x3639eb[_0x8173('0x57')]['id'];var _0x16d7b1=_0x3639eb[_0x8173('0x5c')];var _0x51dba6=0xc8;var _0x500991=null;return db[_0x8173('0xa6')][_0x8173('0xa7')]({'isolationLevel':db[_0x8173('0xa6')][_0x8173('0xa8')][_0x8173('0xa9')][_0x8173('0xaa')]},function(_0x249b62){return db[_0x8173('0x53')][_0x8173('0x67')]({'where':{'id':_0x405185},'transaction':_0x249b62})[_0x8173('0x21')](function(_0x514630){if(_0x514630){return db[_0x8173('0xab')][_0x8173('0x38')]({'where':{'OpenchannelAccountId':_0x405185},'transaction':_0x249b62})[_0x8173('0x21')](function(){var _0x48b21a=_[_0x8173('0x40')](_0x16d7b1,function(_0xf12a99){_0xf12a99[_0x8173('0x6a')]=_0x405185;return _0xf12a99;});return db[_0x8173('0xab')][_0x8173('0xac')](_0x48b21a,{'transaction':_0x249b62});});}else{_0x51dba6=0x194;_0x500991=[];}});})['then'](function(){if(_0x51dba6!==0x194){return db[_0x8173('0xab')][_0x8173('0xad')]({'where':{'OpenchannelAccountId':_0x405185},'order':_0x8173('0xae')})[_0x8173('0x21')](function(_0x24b4b2){_0x500991=_0x24b4b2;});}})[_0x8173('0x2c')](function(_0x35557c){_0x51dba6=0x1f4;logger[_0x8173('0x27')](_0x35557c[_0x8173('0x3c')]);if(_0x35557c[_0x8173('0x62')]){delete _0x35557c[_0x8173('0x62')];}_0x500991=_0x35557c;})['finally'](function(){if(_0x500991===null){_0x2bed39['sendStatus'](_0x51dba6);}else{if(_0x51dba6===0x1f4){_0x2bed39[_0x8173('0x2d')](_0x51dba6)[_0x8173('0x3d')](_0x500991);}else{_0x2bed39['status'](_0x51dba6)[_0x8173('0x2f')](_0x500991);}}});};exports[_0x8173('0xaf')]=function(_0x7f3719,_0xeca401,_0x3d8478){var _0x15494f={};var _0xab3c80={};var _0x1113fa;var _0x48ebea;return db[_0x8173('0x53')]['findOne']({'where':{'id':_0x7f3719['params']['id']}})[_0x8173('0x21')](handleEntityNotFound(_0xeca401,null))[_0x8173('0x21')](function(_0x647a56){if(_0x647a56){_0x1113fa=_0x647a56;_0xab3c80[_0x8173('0x48')]=_[_0x8173('0x58')](db[_0x8173('0xab')]['rawAttributes']);_0xab3c80['query']=_[_0x8173('0x58')](_0x7f3719['query']);_0xab3c80[_0x8173('0x45')]=_[_0x8173('0x46')](_0xab3c80[_0x8173('0x48')],_0xab3c80['query']);_0x15494f[_0x8173('0x47')]=_[_0x8173('0x46')](_0xab3c80[_0x8173('0x48')],qs['fields'](_0x7f3719[_0x8173('0x44')][_0x8173('0x49')]));_0x15494f[_0x8173('0x47')]=_0x15494f[_0x8173('0x47')][_0x8173('0x4a')]?_0x15494f[_0x8173('0x47')]:_0xab3c80['model'];_0x15494f['order']=qs[_0x8173('0x4d')](_0x7f3719[_0x8173('0x44')][_0x8173('0x4d')]);_0x15494f[_0x8173('0x4e')]=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x7f3719[_0x8173('0x44')],_0xab3c80[_0x8173('0x45')]));if(_0x7f3719[_0x8173('0x44')][_0x8173('0x4f')]){_0x15494f[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x15494f[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x15494f[_0x8173('0x47')],function(_0xe4dd43){var _0x189451={};_0x189451[_0xe4dd43]={'$like':'%'+_0x7f3719[_0x8173('0x44')]['filter']+'%'};return _0x189451;})});}_0x15494f=_[_0x8173('0x50')]({},_0x15494f,_0x7f3719[_0x8173('0x52')]);return _0x1113fa[_0x8173('0xaf')](_0x15494f);}})[_0x8173('0x21')](function(_0x245762){if(_0x245762){_0x48ebea=_0x245762['length'];if(!_0x7f3719['query'][_0x8173('0x4b')]('nolimit')){_0x15494f[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x7f3719['query']['limit']);_0x15494f[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x7f3719[_0x8173('0x44')][_0x8173('0x30')]);}return _0x1113fa[_0x8173('0xaf')](_0x15494f);}})['then'](function(_0x56d856){if(_0x56d856){return _0x56d856?{'count':_0x48ebea,'rows':_0x56d856}:null;}})[_0x8173('0x21')](respondWithResult(_0xeca401,null))['catch'](handleError(_0xeca401,null));};exports[_0x8173('0xb0')]=function(_0x5ecfc0,_0x2956ec,_0x4a628f){var _0x2eb7cd={'raw':![],'where':{}};var _0x10d14e={};var _0x137295={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8173('0x67')]({'where':{'id':_0x5ecfc0[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x2956ec,null))[_0x8173('0x21')](function(_0x1e3d1c){if(_0x1e3d1c){_0x10d14e[_0x8173('0x48')]=_[_0x8173('0x58')](db['OpenchannelInteraction'][_0x8173('0x41')]);_0x10d14e['query']=_[_0x8173('0x58')](_0x5ecfc0[_0x8173('0x44')]);_0x10d14e['filters']=_['intersection'](_0x10d14e['model'],_0x10d14e[_0x8173('0x44')]);_0x2eb7cd[_0x8173('0x47')]=_['intersection'](_0x10d14e[_0x8173('0x48')],qs[_0x8173('0x49')](_0x5ecfc0[_0x8173('0x44')]['fields']));_0x2eb7cd[_0x8173('0x47')]=_0x2eb7cd['attributes'][_0x8173('0x4a')]?_0x2eb7cd['attributes']:_0x10d14e['model'];if(!_0x5ecfc0[_0x8173('0x44')][_0x8173('0x4b')](_0x8173('0x4c'))){_0x2eb7cd[_0x8173('0x32')]=qs['limit'](_0x5ecfc0[_0x8173('0x44')]['limit']);_0x2eb7cd[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x5ecfc0[_0x8173('0x44')][_0x8173('0x30')]);}_0x2eb7cd[_0x8173('0x68')]=qs['sort'](_0x5ecfc0[_0x8173('0x44')][_0x8173('0x4d')]);_0x2eb7cd['where']=qs[_0x8173('0x45')](_[_0x8173('0x69')](_0x5ecfc0['query'],_0x10d14e[_0x8173('0x45')]));_0x2eb7cd[_0x8173('0x4e')]['OpenchannelAccountId']=_0x1e3d1c['id'];if(_0x5ecfc0[_0x8173('0x44')][_0x8173('0x4f')]){_0x2eb7cd[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x2eb7cd[_0x8173('0x4e')],{'$or':_[_0x8173('0x40')](_0x2eb7cd['attributes'],function(_0x155030){var _0x48dcc8={};_0x48dcc8[_0x155030]={'$like':'%'+_0x5ecfc0['query'][_0x8173('0x4f')]+'%'};return _0x48dcc8;})});}_0x2eb7cd=_['merge']({},_0x2eb7cd,_0x5ecfc0[_0x8173('0x52')]);return db[_0x8173('0x90')]['count']({'where':_0x2eb7cd['where']})[_0x8173('0x21')](function(_0x3fb802){_0x137295[_0x8173('0x54')]=_0x3fb802;if(_0x5ecfc0[_0x8173('0x44')][_0x8173('0x59')]){_0x2eb7cd[_0x8173('0x55')]=[{'model':db[_0x8173('0x74')],'as':_0x8173('0xb1'),'required':![]},{'model':db[_0x8173('0x9f')],'as':_0x8173('0xb2'),'attributes':['name',_0x8173('0xb3'),_0x8173('0xb4')],'required':![]},{'model':db[_0x8173('0xb5')],'as':'Tags','attributes':['id','name','color'],'where':_0x5ecfc0['query'][_0x8173('0xb6')]?{'id':_0x5ecfc0[_0x8173('0x44')][_0x8173('0xb6')]}:undefined,'required':_0x5ecfc0[_0x8173('0x44')][_0x8173('0xb6')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x2eb7cd);})['then'](function(_0x4b7cf4){_0x137295['rows']=_0x4b7cf4;return _0x137295;});}})[_0x8173('0x21')](respondWithFilteredResult(_0x2956ec,_0x2eb7cd))[_0x8173('0x2c')](handleError(_0x2956ec,null));};exports[_0x8173('0xb7')]=function(_0x2abef3,_0x208ac4,_0x2f327e){return db[_0x8173('0x53')][_0x8173('0x5a')]({'where':{'id':_0x2abef3[_0x8173('0x57')]['id']}})['then'](handleEntityNotFound(_0x208ac4,null))['then'](function(_0x2d54a0){if(_0x2d54a0){return _0x2d54a0[_0x8173('0xb7')](_0x2abef3[_0x8173('0x5c')][_0x8173('0x6c')],_['omit'](_0x2abef3[_0x8173('0x5c')],['ids','id'])||{})[_0x8173('0x93')](function(_0x4b832c){for(var _0x3e4970=0x0;_0x3e4970<_0x2abef3[_0x8173('0x5c')][_0x8173('0x6c')][_0x8173('0x4a')];_0x3e4970+=0x1){socket[_0x8173('0xb8')](_0x8173('0xb9'),{'UserId':Number(_0x2abef3[_0x8173('0x5c')][_0x8173('0x6c')][_0x3e4970]),'OpenchannelAccountId':Number(_0x2abef3[_0x8173('0x57')]['id'])});}return _0x4b832c;});}})[_0x8173('0x21')](respondWithResult(_0x208ac4,null))[_0x8173('0x2c')](handleError(_0x208ac4,null));};exports[_0x8173('0xba')]=function(_0x3464b0,_0x1b877c,_0xf956e1){return db['OpenchannelAccount'][_0x8173('0x5a')]({'where':{'id':_0x3464b0[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x1b877c,null))[_0x8173('0x21')](function(_0x1c63cc){if(_0x1c63cc){return _0x1c63cc[_0x8173('0xba')](_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')])['then'](function(){if(_[_0x8173('0xbb')](_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')])){for(var _0x42e5e7=0x0;_0x42e5e7<_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')]['length'];_0x42e5e7+=0x1){socket[_0x8173('0xb8')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3464b0[_0x8173('0x44')][_0x8173('0x6c')][_0x42e5e7]),'OpenchannelAccountId':Number(_0x3464b0['params']['id'])});}}else{socket[_0x8173('0xb8')](_0x8173('0xbc'),{'UserId':Number(_0x3464b0[_0x8173('0x44')]['ids']),'OpenchannelAccountId':Number(_0x3464b0[_0x8173('0x57')]['id'])});}});}})[_0x8173('0x21')](respondWithStatusCode(_0x1b877c,null))[_0x8173('0x2c')](handleError(_0x1b877c,null));};exports[_0x8173('0xbd')]=function(_0x2cfcd6,_0x3fbcd1,_0x473238){var _0x35573f={};var _0x40809b={};var _0x4272d6;var _0x35d85c;return db[_0x8173('0x53')][_0x8173('0x67')]({'where':{'id':_0x2cfcd6[_0x8173('0x57')]['id']}})[_0x8173('0x21')](handleEntityNotFound(_0x3fbcd1,null))[_0x8173('0x21')](function(_0x48e336){if(_0x48e336){_0x4272d6=_0x48e336;_0x40809b[_0x8173('0x48')]=_[_0x8173('0x58')](db[_0x8173('0x9f')][_0x8173('0x41')]);_0x40809b['query']=_['keys'](_0x2cfcd6[_0x8173('0x44')]);_0x40809b[_0x8173('0x45')]=_['intersection'](_0x40809b[_0x8173('0x48')],_0x40809b['query']);_0x35573f[_0x8173('0x47')]=_[_0x8173('0x46')](_0x40809b[_0x8173('0x48')],qs['fields'](_0x2cfcd6['query']['fields']));_0x35573f[_0x8173('0x47')]=_0x35573f[_0x8173('0x47')][_0x8173('0x4a')]?_0x35573f['attributes']:_0x40809b[_0x8173('0x48')];_0x35573f[_0x8173('0x68')]=qs[_0x8173('0x4d')](_0x2cfcd6[_0x8173('0x44')][_0x8173('0x4d')]);_0x35573f[_0x8173('0x4e')]=qs['filters'](_[_0x8173('0x69')](_0x2cfcd6[_0x8173('0x44')],_0x40809b[_0x8173('0x45')]));if(_0x2cfcd6['query'][_0x8173('0x4f')]){_0x35573f[_0x8173('0x4e')]=_[_0x8173('0x50')](_0x35573f['where'],{'$or':_['map'](_0x35573f['attributes'],function(_0x55d25b){var _0x55cfbf={};_0x55cfbf[_0x55d25b]={'$like':'%'+_0x2cfcd6['query'][_0x8173('0x4f')]+'%'};return _0x55cfbf;})});}_0x35573f=_['merge']({},_0x35573f,_0x2cfcd6[_0x8173('0x52')]);return _0x4272d6[_0x8173('0xbd')](_0x35573f);}})[_0x8173('0x21')](function(_0xd833ff){if(_0xd833ff){_0x35d85c=_0xd833ff[_0x8173('0x4a')];if(!_0x2cfcd6[_0x8173('0x44')][_0x8173('0x4b')]('nolimit')){_0x35573f[_0x8173('0x32')]=qs[_0x8173('0x32')](_0x2cfcd6[_0x8173('0x44')]['limit']);_0x35573f[_0x8173('0x30')]=qs[_0x8173('0x30')](_0x2cfcd6[_0x8173('0x44')][_0x8173('0x30')]);}return _0x4272d6[_0x8173('0xbd')](_0x35573f);}})[_0x8173('0x21')](function(_0x6884f){if(_0x6884f){return _0x6884f?{'count':_0x35d85c,'rows':_0x6884f}:null;}})[_0x8173('0x21')](respondWithResult(_0x3fbcd1,null))['catch'](handleError(_0x3fbcd1,null));};exports[_0x8173('0x3d')]=function(_0x20f4d0,_0x4ba412,_0x5a7651){var _0x4a84cc,_0x2eb627,_0x5d695d;if(_[_0x8173('0x7e')](_0x20f4d0[_0x8173('0x5c')]['body'])||_0x20f4d0['body'][_0x8173('0x5c')]===''){throw new db[(_0x8173('0x75'))][(_0x8173('0x76'))](_0x8173('0xbe'));}if(_[_0x8173('0x7e')](_0x20f4d0[_0x8173('0x5c')]['to'])){}_0x4a84cc=_0x20f4d0['body']['to'];return db['OpenchannelAccount'][_0x8173('0x67')]({'where':{'id':_0x20f4d0['params']['id']}})['then'](handleEntityNotFound(_0x4ba412,null))['then'](function(_0x27b520){if(_0x27b520){return db[_0x8173('0x53')]['find']({'where':{'id':_0x27b520['id']},'include':[{'model':db['CmList'],'as':_0x8173('0x83'),'include':[{'model':db[_0x8173('0x74')],'as':_0x8173('0x84'),'where':{[_0x27b520[_0x8173('0x7f')]]:_0x4a84cc},'limit':0x1,'order':[[_0x8173('0x7a'),_0x8173('0x85')]]}]}]})[_0x8173('0x21')](handleEntityNotFound(_0x4ba412,null))[_0x8173('0x21')](function(_0x231119){if(_0x231119&&_0x231119['List']){_0x2eb627=_0x231119[_0x8173('0x39')]({'plain':!![]});if(_0x2eb627[_0x8173('0x83')]&&_0x2eb627[_0x8173('0x83')][_0x8173('0x84')][_0x8173('0x4a')]){return _0x2eb627[_0x8173('0x83')]['Contacts'][0x0];}return db[_0x8173('0x74')][_0x8173('0x5b')](_['defaults'](_0x20f4d0[_0x8173('0x5c')],{'firstName':_0x4a84cc,[_0x231119[_0x8173('0x7f')]]:_0x4a84cc,'phone':_0x4a84cc,'ListId':_0x2eb627[_0x8173('0x7c')]}));}})[_0x8173('0x21')](handleEntityNotFound(_0x4ba412,null))[_0x8173('0x21')](function(_0x5c63f2){if(_0x5c63f2){_0x5d695d=_0x5c63f2;return db['OpenchannelInteraction'][_0x8173('0x5a')]({'where':{'ContactId':_0x5d695d['id'],'closed':![],'OpenchannelAccountId':_0x2eb627['id']}})['then'](function(_0x8cb3f0){if(_0x8cb3f0){return[_0x8cb3f0,![]];}return db[_0x8173('0x90')]['create']({'UserId':_0x20f4d0[_0x8173('0x5e')]['id'],'ContactId':_0x5d695d['id'],'OpenchannelAccountId':_0x2eb627['id'],'lastMsgDirection':_0x8173('0xbf'),'firstMsgDirection':_0x8173('0xbf'),'Messages':[_[_0x8173('0x50')](_0x20f4d0[_0x8173('0x5c')],{'read':![],'body':_0x20f4d0[_0x8173('0x5c')][_0x8173('0x5c')],'OpenchannelAccountId':_0x2eb627['id'],'UserId':_0x20f4d0[_0x8173('0x5e')]['id'],'ContactId':_0x5d695d['id']})]},{'include':[{'model':db[_0x8173('0x9c')],'as':'Messages'}]})[_0x8173('0x21')](function(_0xc91783){return[_0xc91783,!![]];});});}})[_0x8173('0x93')](function(_0x83eedd,_0x404109){if(_0x404109){return _0x83eedd;}return db[_0x8173('0x9c')]['create'](_[_0x8173('0x50')](_0x20f4d0[_0x8173('0x5c')],{'read':![],'body':_0x20f4d0[_0x8173('0x5c')]['body'],'OpenchannelAccountId':_0x2eb627['id'],'OpenchannelInteractionId':_0x83eedd['id'],'UserId':_0x20f4d0[_0x8173('0x5e')]['id'],'ContactId':_0x5d695d['id']}))[_0x8173('0x21')](function(_0x7b12e7){_0x83eedd['dataValues'][_0x8173('0xc0')]=[];_0x83eedd[_0x8173('0xc1')][_0x8173('0xc0')]['push'](_0x7b12e7['dataValues']);return _0x83eedd;});});}})['then'](respondWithResult(_0x4ba412,null))[_0x8173('0x2c')](handleError(_0x4ba412,null));}; \ No newline at end of file +var _0xe8a4=['catch','sendStatus','status','offset','undefined','limit','apply','reject','save','update','get','end','send','index','OpenchannelAccount','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','show','params','Pause','rawAttributes','filters','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','find','userProfileId','autoAssociation','name','mandatoryDispositionPause','destroy','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','asc','defaults','ListId','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','json','getApplications','Contact','User','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','out','dataValues','Messages','eml-format','zip-dir','request-promise','moment','bluebird','util','path','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','redis','socket.io-emitter','./openchannelAccount.socket','jayson/promise','http','client','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xd08da0,_0x30b2a1){var _0x56f585=function(_0x3c63ae){while(--_0x3c63ae){_0xd08da0['push'](_0xd08da0['shift']());}};_0x56f585(++_0x30b2a1);}(_0xe8a4,0x158));var _0x4e8a=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xe8a4[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0x4e8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e8a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e8a('0x2'));var moment=require(_0x4e8a('0x3'));var BPromise=require(_0x4e8a('0x4'));var Mustache=require('mustache');var util=require(_0x4e8a('0x5'));var path=require(_0x4e8a('0x6'));var sox=require('sox');var csv=require(_0x4e8a('0x7'));var ejs=require(_0x4e8a('0x8'));var fs=require('fs');var fs_extra=require(_0x4e8a('0x9'));var _=require(_0x4e8a('0xa'));var squel=require(_0x4e8a('0xb'));var crypto=require(_0x4e8a('0xc'));var jsforce=require(_0x4e8a('0xd'));var deskjs=require(_0x4e8a('0xe'));var toCsv=require(_0x4e8a('0x7'));var querystring=require(_0x4e8a('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e8a('0x10'));var authService=require(_0x4e8a('0x11'));var qs=require(_0x4e8a('0x12'));var as=require(_0x4e8a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e8a('0x14'))(_0x4e8a('0x15'));var utils=require('../../config/utils');var config=require(_0x4e8a('0x16'));var licenseUtil=require(_0x4e8a('0x17'));var db=require(_0x4e8a('0x18'))['db'];config[_0x4e8a('0x19')]=_['defaults'](config[_0x4e8a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e8a('0x1a'))(new Redis(config[_0x4e8a('0x19')]));require(_0x4e8a('0x1b'))['register'](socket);var jayson=require(_0x4e8a('0x1c'));var client=jayson['client'][_0x4e8a('0x1d')]({'port':0x232c});var client9002=jayson[_0x4e8a('0x1e')][_0x4e8a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4e2a54,_0x458235,_0x16af6f,_0x435200){return new BPromise(function(_0x13eb23,_0x5460e8){var _0x2390e4=_0x435200||client;return _0x2390e4['request'](_0x4e2a54,_0x16af6f)[_0x4e8a('0x1f')](function(_0x121a60){logger[_0x4e8a('0x20')](_0x4e8a('0x21'),_0x458235,_0x4e8a('0x22'));logger[_0x4e8a('0x23')](_0x4e8a('0x24'),_0x458235,_0x4e8a('0x22'),JSON[_0x4e8a('0x25')](_0x121a60));if(_0x121a60['error']){if(_0x121a60['error']['code']===0x1f4){logger[_0x4e8a('0x26')](_0x4e8a('0x21'),_0x458235,_0x121a60[_0x4e8a('0x26')][_0x4e8a('0x27')]);return _0x5460e8(_0x121a60[_0x4e8a('0x26')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x458235,_0x121a60['error'][_0x4e8a('0x27')]);return _0x13eb23(_0x121a60[_0x4e8a('0x26')][_0x4e8a('0x27')]);}else{logger['info'](_0x4e8a('0x21'),_0x458235,_0x4e8a('0x22'));_0x13eb23(_0x121a60['result'][_0x4e8a('0x27')]);}})[_0x4e8a('0x28')](function(_0x50a80a){logger[_0x4e8a('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x458235,_0x50a80a);_0x5460e8(_0x50a80a);});});}function respondWithStatusCode(_0x3f88c2,_0x34b531){_0x34b531=_0x34b531||0xcc;return function(_0x3a9d32){if(_0x3a9d32){return _0x3f88c2[_0x4e8a('0x29')](_0x34b531);}return _0x3f88c2['status'](_0x34b531)['end']();};}function respondWithResult(_0x27a048,_0x31bbe1){_0x31bbe1=_0x31bbe1||0xc8;return function(_0x5a71e3){if(_0x5a71e3){return _0x27a048[_0x4e8a('0x2a')](_0x31bbe1)['json'](_0x5a71e3);}};}function respondWithFilteredResult(_0x1d22d5,_0x5766c5){return function(_0x2d1e63){if(_0x2d1e63){var _0x3f53a9=typeof _0x5766c5[_0x4e8a('0x2b')]===_0x4e8a('0x2c')&&typeof _0x5766c5[_0x4e8a('0x2d')]==='undefined';var _0x56efc4=_0x2d1e63['count'];var _0x3e450b=_0x3f53a9?0x0:_0x5766c5[_0x4e8a('0x2b')];var _0x2a3703=_0x3f53a9?_0x2d1e63['count']:_0x5766c5[_0x4e8a('0x2b')]+_0x5766c5['limit'];var _0x200ca8;if(_0x2a3703>=_0x56efc4){_0x2a3703=_0x56efc4;_0x200ca8=0xc8;}else{_0x200ca8=0xce;}_0x1d22d5['status'](_0x200ca8);return _0x1d22d5['set']('Content-Range',_0x3e450b+'-'+_0x2a3703+'/'+_0x56efc4)['json'](_0x2d1e63);}return null;};}function patchUpdates(_0x2be564){return function(_0x3647df){try{jsonpatch[_0x4e8a('0x2e')](_0x3647df,_0x2be564,!![]);}catch(_0x9331dd){return BPromise[_0x4e8a('0x2f')](_0x9331dd);}return _0x3647df[_0x4e8a('0x30')]();};}function saveUpdates(_0x382b16,_0x287d9c){return function(_0x5224be){if(_0x5224be){return _0x5224be[_0x4e8a('0x31')](_0x382b16)['then'](function(_0x3d9dd2){return _0x3d9dd2;});}return null;};}function removeEntity(_0x254dfb,_0x52ef06){return function(_0x3fd5b9){if(_0x3fd5b9){return _0x3fd5b9['destroy']()[_0x4e8a('0x1f')](function(){var _0x21af7d=_0x3fd5b9[_0x4e8a('0x32')]({'plain':!![]});var _0x44d8e7='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x44d8e7,'resourceId':_0x21af7d['id']}})[_0x4e8a('0x1f')](function(){return _0x3fd5b9;});})['then'](function(){_0x254dfb[_0x4e8a('0x2a')](0xcc)[_0x4e8a('0x33')]();});}};}function handleEntityNotFound(_0x37ca6e,_0x5564df){return function(_0x3c74de){if(!_0x3c74de){_0x37ca6e[_0x4e8a('0x29')](0x194);}return _0x3c74de;};}function handleError(_0x318d14,_0x297dfb){_0x297dfb=_0x297dfb||0x1f4;return function(_0x39bd2d){logger[_0x4e8a('0x26')](_0x39bd2d['stack']);if(_0x39bd2d['name']){delete _0x39bd2d['name'];}_0x318d14[_0x4e8a('0x2a')](_0x297dfb)[_0x4e8a('0x34')](_0x39bd2d);};}exports[_0x4e8a('0x35')]=function(_0x38538d,_0x274d4c){var _0xb4a961={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2b9f0f={},_0x135375={'count':0x0,'rows':[]};var _0x5b2b6c=_['map'](db[_0x4e8a('0x36')]['rawAttributes'],function(_0x31e3f1){return{'name':_0x31e3f1[_0x4e8a('0x37')],'type':_0x31e3f1[_0x4e8a('0x38')]['key']};});_0x2b9f0f[_0x4e8a('0x39')]=_[_0x4e8a('0x3a')](_0x5b2b6c,'name');_0x2b9f0f[_0x4e8a('0x3b')]=_[_0x4e8a('0x3c')](_0x38538d['query']);_0x2b9f0f['filters']=_[_0x4e8a('0x3d')](_0x2b9f0f[_0x4e8a('0x39')],_0x2b9f0f['query']);_0xb4a961[_0x4e8a('0x3e')]=_[_0x4e8a('0x3d')](_0x2b9f0f[_0x4e8a('0x39')],qs[_0x4e8a('0x3f')](_0x38538d[_0x4e8a('0x3b')][_0x4e8a('0x3f')]));_0xb4a961['attributes']=_0xb4a961[_0x4e8a('0x3e')]['length']?_0xb4a961[_0x4e8a('0x3e')]:_0x2b9f0f[_0x4e8a('0x39')];if(!_0x38538d['query'][_0x4e8a('0x40')](_0x4e8a('0x41'))){_0xb4a961[_0x4e8a('0x2d')]=qs[_0x4e8a('0x2d')](_0x38538d[_0x4e8a('0x3b')][_0x4e8a('0x2d')]);_0xb4a961[_0x4e8a('0x2b')]=qs['offset'](_0x38538d[_0x4e8a('0x3b')]['offset']);}_0xb4a961[_0x4e8a('0x42')]=qs['sort'](_0x38538d[_0x4e8a('0x3b')][_0x4e8a('0x43')]);_0xb4a961[_0x4e8a('0x44')]=qs['filters'](_[_0x4e8a('0x45')](_0x38538d['query'],_0x2b9f0f['filters']),_0x5b2b6c);if(_0x38538d[_0x4e8a('0x3b')][_0x4e8a('0x46')]){_0xb4a961['where']=_['merge'](_0xb4a961['where'],{'$or':_[_0x4e8a('0x3a')](_0x5b2b6c,function(_0x41e8ce){if(_0x41e8ce[_0x4e8a('0x38')]!==_0x4e8a('0x47')){var _0x46d40c={};_0x46d40c[_0x41e8ce['name']]={'$like':'%'+_0x38538d[_0x4e8a('0x3b')]['filter']+'%'};return _0x46d40c;}})});}_0xb4a961=_['merge']({},_0xb4a961,_0x38538d[_0x4e8a('0x48')]);var _0xfeb06a={'where':_0xb4a961[_0x4e8a('0x44')]};return db[_0x4e8a('0x36')][_0x4e8a('0x49')](_0xfeb06a)[_0x4e8a('0x1f')](function(_0x6610ef){_0x135375[_0x4e8a('0x49')]=_0x6610ef;if(_0x38538d[_0x4e8a('0x3b')][_0x4e8a('0x4a')]){_0xb4a961[_0x4e8a('0x4b')]=[{'all':!![]}];}return db[_0x4e8a('0x36')]['findAll'](_0xb4a961);})[_0x4e8a('0x1f')](function(_0x3cb1ee){_0x135375['rows']=_0x3cb1ee;return _0x135375;})[_0x4e8a('0x1f')](respondWithFilteredResult(_0x274d4c,_0xb4a961))[_0x4e8a('0x28')](handleError(_0x274d4c,null));};exports[_0x4e8a('0x4c')]=function(_0x5d8d31,_0x27d7e4){var _0x3e6302={'raw':![],'where':{'id':_0x5d8d31[_0x4e8a('0x4d')]['id']},'include':[{'model':db[_0x4e8a('0x4e')],'as':'mandatoryDispositionPause'}]},_0x5071d8={};_0x5071d8[_0x4e8a('0x39')]=_[_0x4e8a('0x3c')](db[_0x4e8a('0x36')][_0x4e8a('0x4f')]);_0x5071d8[_0x4e8a('0x3b')]=_[_0x4e8a('0x3c')](_0x5d8d31['query']);_0x5071d8[_0x4e8a('0x50')]=_[_0x4e8a('0x3d')](_0x5071d8[_0x4e8a('0x39')],_0x5071d8['query']);_0x3e6302[_0x4e8a('0x3e')]=_[_0x4e8a('0x3d')](_0x5071d8[_0x4e8a('0x39')],qs[_0x4e8a('0x3f')](_0x5d8d31[_0x4e8a('0x3b')][_0x4e8a('0x3f')]));_0x3e6302[_0x4e8a('0x3e')]=_0x3e6302['attributes'][_0x4e8a('0x51')]?_0x3e6302[_0x4e8a('0x3e')]:_0x5071d8[_0x4e8a('0x39')];if(_0x5d8d31['query']['includeAll']){_0x3e6302['include']=[{'all':!![]}];}_0x3e6302=_[_0x4e8a('0x52')]({},_0x3e6302,_0x5d8d31[_0x4e8a('0x48')]);return db[_0x4e8a('0x36')]['find'](_0x3e6302)['then'](handleEntityNotFound(_0x27d7e4,null))[_0x4e8a('0x1f')](respondWithResult(_0x27d7e4,null))['catch'](handleError(_0x27d7e4,null));};exports['create']=function(_0x2bca57,_0x1e3672){return db['OpenchannelAccount'][_0x4e8a('0x53')](_0x2bca57[_0x4e8a('0x54')],{})[_0x4e8a('0x1f')](function(_0x2e493e){var _0xba9887=_0x2bca57[_0x4e8a('0x55')]['get']({'plain':!![]});if(!_0xba9887)throw new Error(_0x4e8a('0x56'));if(_0xba9887[_0x4e8a('0x57')]===_0x4e8a('0x55')){var _0x48f01f=_0x2e493e['get']({'plain':!![]});var _0x3f04ce=_0x4e8a('0x58');return db[_0x4e8a('0x59')][_0x4e8a('0x5a')]({'where':{'name':_0x3f04ce,'userProfileId':_0xba9887[_0x4e8a('0x5b')]},'raw':!![]})[_0x4e8a('0x1f')](function(_0x4b5831){if(_0x4b5831&&_0x4b5831[_0x4e8a('0x5c')]===0x0){return db['UserProfileResource'][_0x4e8a('0x53')]({'name':_0x48f01f[_0x4e8a('0x5d')],'resourceId':_0x48f01f['id'],'type':_0x4b5831[_0x4e8a('0x5d')],'sectionId':_0x4b5831['id']},{})['then'](function(){return _0x2e493e;});}else{return _0x2e493e;}})['catch'](function(_0xba5aaa){logger[_0x4e8a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xba5aaa);throw _0xba5aaa;});}return _0x2e493e;})[_0x4e8a('0x1f')](respondWithResult(_0x1e3672,0xc9))[_0x4e8a('0x28')](handleError(_0x1e3672,null));};exports[_0x4e8a('0x31')]=function(_0x4b418b,_0x5a9873){if(_0x4b418b['body']['id']){delete _0x4b418b['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x4b418b[_0x4e8a('0x4d')]['id']},'include':[{'model':db[_0x4e8a('0x4e')],'as':_0x4e8a('0x5e')}]})[_0x4e8a('0x1f')](handleEntityNotFound(_0x5a9873,null))['then'](saveUpdates(_0x4b418b[_0x4e8a('0x54')],null))[_0x4e8a('0x1f')](respondWithResult(_0x5a9873,null))[_0x4e8a('0x28')](handleError(_0x5a9873,null));};exports[_0x4e8a('0x5f')]=function(_0x41a277,_0x273970){return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0x41a277['params']['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x273970,null))[_0x4e8a('0x1f')](removeEntity(_0x273970,null))[_0x4e8a('0x28')](handleError(_0x273970,null));};exports[_0x4e8a('0x60')]=function(_0x19c96f,_0x24e88e){return db[_0x4e8a('0x36')]['describe']()[_0x4e8a('0x1f')](respondWithResult(_0x24e88e,null))['catch'](handleError(_0x24e88e,null));};exports['addDisposition']=function(_0x16e344,_0x5a5e82,_0x48be64){if(_0x16e344[_0x4e8a('0x54')]['id']){delete _0x16e344[_0x4e8a('0x54')]['id'];}return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0x16e344[_0x4e8a('0x4d')]['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x5a5e82,null))[_0x4e8a('0x1f')](function(_0x538a01){if(_0x538a01){_0x16e344[_0x4e8a('0x54')][_0x4e8a('0x61')]=_0x538a01['id'];return db[_0x4e8a('0x62')][_0x4e8a('0x53')](_0x16e344[_0x4e8a('0x54')]);}})[_0x4e8a('0x1f')](respondWithResult(_0x5a5e82,null))[_0x4e8a('0x28')](handleError(_0x5a5e82,null));};exports[_0x4e8a('0x63')]=function(_0x373840,_0x199372,_0x269e2f){var _0x4d87ea={'raw':![],'where':{}};var _0xd64425={};var _0x5085d7={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4e8a('0x64')]({'where':{'id':_0x373840['params']['id']}})['then'](handleEntityNotFound(_0x199372,null))[_0x4e8a('0x1f')](function(_0x3f31bf){if(_0x3f31bf){_0xd64425[_0x4e8a('0x39')]=_['keys'](db[_0x4e8a('0x62')]['rawAttributes']);_0xd64425[_0x4e8a('0x3b')]=_[_0x4e8a('0x3c')](_0x373840[_0x4e8a('0x3b')]);_0xd64425['filters']=_[_0x4e8a('0x3d')](_0xd64425[_0x4e8a('0x39')],_0xd64425[_0x4e8a('0x3b')]);_0x4d87ea[_0x4e8a('0x3e')]=_[_0x4e8a('0x3d')](_0xd64425[_0x4e8a('0x39')],qs[_0x4e8a('0x3f')](_0x373840['query'][_0x4e8a('0x3f')]));_0x4d87ea[_0x4e8a('0x3e')]=_0x4d87ea[_0x4e8a('0x3e')][_0x4e8a('0x51')]?_0x4d87ea[_0x4e8a('0x3e')]:_0xd64425[_0x4e8a('0x39')];if(!_0x373840['query']['hasOwnProperty'](_0x4e8a('0x41'))){_0x4d87ea['limit']=qs[_0x4e8a('0x2d')](_0x373840[_0x4e8a('0x3b')][_0x4e8a('0x2d')]);_0x4d87ea[_0x4e8a('0x2b')]=qs[_0x4e8a('0x2b')](_0x373840['query'][_0x4e8a('0x2b')]);}_0x4d87ea[_0x4e8a('0x42')]=qs[_0x4e8a('0x43')](_0x373840[_0x4e8a('0x3b')][_0x4e8a('0x43')]);_0x4d87ea[_0x4e8a('0x44')]=qs['filters'](_[_0x4e8a('0x45')](_0x373840[_0x4e8a('0x3b')],_0xd64425[_0x4e8a('0x50')]));_0x4d87ea['where'][_0x4e8a('0x61')]=_0x3f31bf['id'];if(_0x373840[_0x4e8a('0x3b')][_0x4e8a('0x46')]){_0x4d87ea[_0x4e8a('0x44')]=_[_0x4e8a('0x52')](_0x4d87ea[_0x4e8a('0x44')],{'$or':_['map'](_0x4d87ea[_0x4e8a('0x3e')],function(_0x2a0337){var _0x3716f5={};_0x3716f5[_0x2a0337]={'$like':'%'+_0x373840[_0x4e8a('0x3b')][_0x4e8a('0x46')]+'%'};return _0x3716f5;})});}_0x4d87ea=_['merge']({},_0x4d87ea,_0x373840[_0x4e8a('0x48')]);return db['Disposition'][_0x4e8a('0x49')]({'where':_0x4d87ea[_0x4e8a('0x44')]})[_0x4e8a('0x1f')](function(_0xf168f8){_0x5085d7['count']=_0xf168f8;if(_0x373840[_0x4e8a('0x3b')][_0x4e8a('0x4a')]){_0x4d87ea['include']=[{'all':!![]}];}return db[_0x4e8a('0x62')][_0x4e8a('0x65')](_0x4d87ea);})['then'](function(_0x1260b8){_0x5085d7[_0x4e8a('0x66')]=_0x1260b8;return _0x5085d7;});}})['then'](respondWithFilteredResult(_0x199372,_0x4d87ea))[_0x4e8a('0x28')](handleError(_0x199372,null));};exports[_0x4e8a('0x67')]=function(_0x207042,_0x3a1902,_0xf8d79){return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0x207042[_0x4e8a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3a1902,null))[_0x4e8a('0x1f')](function(_0x480b18){if(_0x480b18){return _0x480b18['removeDispositions'](_0x207042['query']['ids']);}})[_0x4e8a('0x1f')](respondWithStatusCode(_0x3a1902,null))[_0x4e8a('0x28')](handleError(_0x3a1902,null));};exports[_0x4e8a('0x68')]=function(_0x24d1d1,_0x425bd8,_0x48f51d){if(_0x24d1d1[_0x4e8a('0x54')]['id']){delete _0x24d1d1[_0x4e8a('0x54')]['id'];}return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0x24d1d1['params']['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x425bd8,null))[_0x4e8a('0x1f')](function(_0x281723){if(_0x281723){_0x24d1d1[_0x4e8a('0x54')][_0x4e8a('0x61')]=_0x281723['id'];return db[_0x4e8a('0x69')][_0x4e8a('0x53')](_0x24d1d1['body']);}})[_0x4e8a('0x1f')](respondWithResult(_0x425bd8,null))[_0x4e8a('0x28')](handleError(_0x425bd8,null));};exports['getAnswers']=function(_0x4bc834,_0x18d2e4,_0x207177){var _0x448b0c={'raw':![],'where':{}};var _0x338644={};var _0x1fbfcb={'count':0x0,'rows':[]};return db[_0x4e8a('0x36')][_0x4e8a('0x64')]({'where':{'id':_0x4bc834[_0x4e8a('0x4d')]['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x18d2e4,null))[_0x4e8a('0x1f')](function(_0x59b671){if(_0x59b671){_0x338644[_0x4e8a('0x39')]=_[_0x4e8a('0x3c')](db['CannedAnswer']['rawAttributes']);_0x338644['query']=_['keys'](_0x4bc834['query']);_0x338644[_0x4e8a('0x50')]=_[_0x4e8a('0x3d')](_0x338644[_0x4e8a('0x39')],_0x338644[_0x4e8a('0x3b')]);_0x448b0c[_0x4e8a('0x3e')]=_[_0x4e8a('0x3d')](_0x338644[_0x4e8a('0x39')],qs[_0x4e8a('0x3f')](_0x4bc834[_0x4e8a('0x3b')]['fields']));_0x448b0c['attributes']=_0x448b0c[_0x4e8a('0x3e')][_0x4e8a('0x51')]?_0x448b0c[_0x4e8a('0x3e')]:_0x338644[_0x4e8a('0x39')];if(!_0x4bc834[_0x4e8a('0x3b')][_0x4e8a('0x40')](_0x4e8a('0x41'))){_0x448b0c[_0x4e8a('0x2d')]=qs[_0x4e8a('0x2d')](_0x4bc834['query'][_0x4e8a('0x2d')]);_0x448b0c[_0x4e8a('0x2b')]=qs[_0x4e8a('0x2b')](_0x4bc834[_0x4e8a('0x3b')][_0x4e8a('0x2b')]);}_0x448b0c[_0x4e8a('0x42')]=qs[_0x4e8a('0x43')](_0x4bc834[_0x4e8a('0x3b')][_0x4e8a('0x43')]);_0x448b0c[_0x4e8a('0x44')]=qs[_0x4e8a('0x50')](_[_0x4e8a('0x45')](_0x4bc834[_0x4e8a('0x3b')],_0x338644[_0x4e8a('0x50')]));_0x448b0c[_0x4e8a('0x44')][_0x4e8a('0x61')]=_0x59b671['id'];if(_0x4bc834[_0x4e8a('0x3b')][_0x4e8a('0x46')]){_0x448b0c[_0x4e8a('0x44')]=_['merge'](_0x448b0c['where'],{'$or':_[_0x4e8a('0x3a')](_0x448b0c[_0x4e8a('0x3e')],function(_0x4a8d3c){var _0x27f2aa={};_0x27f2aa[_0x4a8d3c]={'$like':'%'+_0x4bc834[_0x4e8a('0x3b')][_0x4e8a('0x46')]+'%'};return _0x27f2aa;})});}_0x448b0c=_[_0x4e8a('0x52')]({},_0x448b0c,_0x4bc834[_0x4e8a('0x48')]);return db[_0x4e8a('0x69')][_0x4e8a('0x49')]({'where':_0x448b0c['where']})['then'](function(_0x31f050){_0x1fbfcb[_0x4e8a('0x49')]=_0x31f050;if(_0x4bc834['query'][_0x4e8a('0x4a')]){_0x448b0c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4e8a('0x65')](_0x448b0c);})['then'](function(_0x17c2e6){_0x1fbfcb['rows']=_0x17c2e6;return _0x1fbfcb;});}})[_0x4e8a('0x1f')](respondWithFilteredResult(_0x18d2e4,_0x448b0c))['catch'](handleError(_0x18d2e4,null));};exports[_0x4e8a('0x6a')]=function(_0x51ca02,_0x23b8dd,_0x30bc95){return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0x51ca02[_0x4e8a('0x4d')]['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x23b8dd,null))[_0x4e8a('0x1f')](function(_0x506331){if(_0x506331){return _0x506331[_0x4e8a('0x6a')](_0x51ca02[_0x4e8a('0x3b')][_0x4e8a('0x6b')]);}})['then'](respondWithStatusCode(_0x23b8dd,null))[_0x4e8a('0x28')](handleError(_0x23b8dd,null));};exports[_0x4e8a('0x6c')]=function(_0x18248e,_0x1a245,_0x25df7c){var _0x5ea155={'body':_0x18248e['body'],'channel':_0x4e8a('0x6d')};var _0x4cc2d0=[];var _0x149581=[];var _0x5253fe={};var _0x214d44=![];return db[_0x4e8a('0x6e')][_0x4e8a('0x60')]()[_0x4e8a('0x1f')](function(_0x307dd9){if(!_0x307dd9){throw new db[(_0x4e8a('0x6f'))][(_0x4e8a('0x70'))](_0x4e8a('0x71'));}_0x4cc2d0=_[_0x4e8a('0x72')](_[_0x4e8a('0x3c')](_0x307dd9),[_0x4e8a('0x73'),_0x4e8a('0x74')]);_0x149581=_[_0x4e8a('0x72')](_[_0x4e8a('0x3c')](_0x307dd9),[_0x4e8a('0x73'),_0x4e8a('0x74'),_0x4e8a('0x75'),'ListId']);if(_0x18248e[_0x4e8a('0x54')]['id']){delete _0x18248e[_0x4e8a('0x54')]['id'];}if(_[_0x4e8a('0x76')](_0x18248e['body'][_0x4e8a('0x77')])){throw new db[(_0x4e8a('0x6f'))][(_0x4e8a('0x70'))](_0x4e8a('0x78'));}if(_[_0x4e8a('0x76')](_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x54')])||_0x18248e[_0x4e8a('0x54')]['body']===''){throw new db['Sequelize'][(_0x4e8a('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4e8a('0x76')](_0x18248e['body'][_0x4e8a('0x79')])){throw new db[(_0x4e8a('0x6f'))][(_0x4e8a('0x70'))](_0x4e8a('0x7a')+_0x149581);}if(!_[_0x4e8a('0x7b')](_0x149581,_0x18248e['body'][_0x4e8a('0x79')])){throw new db[(_0x4e8a('0x6f'))]['ValidationError'](_0x4e8a('0x7c')+_0x149581);}_0x5253fe[_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x79')]]=_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x77')];})[_0x4e8a('0x1f')](function(){return db['OpenchannelAccount'][_0x4e8a('0x5a')]({'where':{'id':_0x18248e['params']['id']},'include':[{'model':db['CmList'],'as':_0x4e8a('0x7d'),'include':[{'model':db[_0x4e8a('0x6e')],'as':_0x4e8a('0x7e'),'where':_0x5253fe,'limit':0x1,'order':[[_0x4e8a('0x74'),_0x4e8a('0x7f')]]}]},{'model':db[_0x4e8a('0x80')],'as':_0x4e8a('0x81')}]});})[_0x4e8a('0x1f')](handleEntityNotFound(_0x1a245,null))[_0x4e8a('0x1f')](function(_0x3d6c2e){if(_0x3d6c2e&&_0x3d6c2e['List']){_0x5ea155[_0x4e8a('0x82')]=_0x3d6c2e;_0x5ea155['applications']=_0x3d6c2e[_0x4e8a('0x81')];_0x5ea155[_0x4e8a('0x83')]=_0x3d6c2e['List'];_0x5ea155[_0x4e8a('0x84')]=_[_0x4e8a('0x85')](_0x5ea155[_0x4e8a('0x84')],['priority'],[_0x4e8a('0x86')]);if(_0x5ea155[_0x4e8a('0x82')]['Applications']){delete _0x5ea155[_0x4e8a('0x82')][_0x4e8a('0x81')];}if(_0x5ea155[_0x4e8a('0x82')]['List']&&_0x5ea155[_0x4e8a('0x82')][_0x4e8a('0x7d')][_0x4e8a('0x7e')][_0x4e8a('0x51')]){return _0x5ea155[_0x4e8a('0x82')]['List'][_0x4e8a('0x7e')][0x0];}var _0x547fa2=_[_0x4e8a('0x87')](_0x18248e['body'],{'firstName':_0x18248e[_0x4e8a('0x54')]['from'],'ListId':_0x3d6c2e[_0x4e8a('0x88')]});_0x547fa2[_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x79')]]=_0x18248e[_0x4e8a('0x54')]['from'];return db['CmContact'][_0x4e8a('0x53')](_0x547fa2,{'fields':_0x4cc2d0,'raw':!![]});}})['then'](handleEntityNotFound(_0x1a245,null))[_0x4e8a('0x1f')](function(_0x3c92aa){_0x5ea155['contact']=_0x3c92aa;if(_0x3c92aa){var _0x48decf={'ContactId':_0x3c92aa['id'],'OpenchannelAccountId':_0x18248e[_0x4e8a('0x4d')]['id'],'from':(_0x3c92aa[_0x4e8a('0x89')]||'')+'\x20'+(_0x3c92aa[_0x4e8a('0x8a')]||'')};var _0x34669a={'OpenchannelAccountId':_0x18248e[_0x4e8a('0x4d')]['id'],'closed':![]};if(_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x8b')]){_0x34669a[_0x4e8a('0x8b')]=_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x8b')];return db['OpenchannelInteraction'][_0x4e8a('0x5a')]({'where':_0x34669a})[_0x4e8a('0x1f')](function(_0x1ca2d3){if(_0x1ca2d3){return[_0x1ca2d3,![]];}_0x48decf[_0x4e8a('0x8b')]=_0x18248e['body'][_0x4e8a('0x8b')];_0x48decf[_0x4e8a('0x8c')]=_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x8c')];return db['OpenchannelInteraction'][_0x4e8a('0x53')](_0x48decf)[_0x4e8a('0x1f')](function(_0x642cf2){return[_0x642cf2,!![]];});});}else{_0x34669a[_0x4e8a('0x8b')]=null;}_0x34669a['ContactId']=_0x3c92aa['id'];return db[_0x4e8a('0x8d')]['find']({'where':_0x34669a})[_0x4e8a('0x1f')](function(_0x2f6414){if(_0x2f6414){return[_0x2f6414,![]];}return db[_0x4e8a('0x8d')][_0x4e8a('0x53')](_0x48decf)['then'](function(_0x4bd604){return[_0x4bd604,!![]];});});}})[_0x4e8a('0x8e')](function(_0xe6f7df,_0x57e652){if(_0xe6f7df){_0x214d44=_0x57e652;if(!_0x57e652){var _0x5938b1={'from':(_0x5ea155[_0x4e8a('0x8f')][_0x4e8a('0x89')]||'')+'\x20'+(_0x5ea155[_0x4e8a('0x8f')][_0x4e8a('0x8a')]||'')};if(_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x8b')]&&_0x18248e['body']['messageId']&&_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x8b')]!=_0x18248e[_0x4e8a('0x54')]['messageId']){_0x5938b1[_0x4e8a('0x8b')]=_0x18248e['body'][_0x4e8a('0x90')];}return _0xe6f7df[_0x4e8a('0x31')](_0x5938b1);}else{return _0xe6f7df;}}})[_0x4e8a('0x1f')](function(_0x2df779){_0x5ea155[_0x4e8a('0x91')]=_0x2df779[_0x4e8a('0x32')]({'plain':!![]});_0x5ea155[_0x4e8a('0x91')][_0x4e8a('0x92')]=_0x214d44;if(_0x5ea155['interaction'][_0x4e8a('0x92')]){if(_0x5ea155[_0x4e8a('0x82')][_0x4e8a('0x93')]){_0x5ea155[_0x4e8a('0x84')][_0x4e8a('0x94')]({'id':0x0,'priority':_0x5ea155[_0x4e8a('0x84')][_0x4e8a('0x51')]+0x1,'app':_0x4e8a('0x95'),'appdata':_0x4e8a('0x96'),'interval':_0x4e8a('0x97')});}}return db[_0x4e8a('0x98')]['create']({'body':_0x18248e['body'][_0x4e8a('0x54')],'OpenchannelAccountId':_0x18248e[_0x4e8a('0x4d')]['id'],'OpenchannelInteractionId':_0x2df779['id'],'direction':'in','ContactId':_0x5ea155[_0x4e8a('0x8f')]['id'],'AttachmentId':_0x18248e[_0x4e8a('0x54')][_0x4e8a('0x99')]});})['then'](function(_0x224681){_0x5ea155[_0x4e8a('0x27')]=_0x224681;if(_0x5ea155[_0x4e8a('0x91')][_0x4e8a('0x9a')]){return db['User']['find']({'attributes':['id',_0x4e8a('0x5d')],'where':{'id':_0x5ea155['interaction'][_0x4e8a('0x9a')]}})[_0x4e8a('0x1f')](function(_0x6a3ca1){if(_0x6a3ca1){_0x5ea155[_0x4e8a('0x84')][_0x4e8a('0x9b')]({'id':0x0,'priority':0x0,'app':_0x4e8a('0x9c'),'appdata':_0x6a3ca1['name']+','+(_0x5ea155[_0x4e8a('0x82')][_0x4e8a('0x9d')]||0xa),'interval':_0x4e8a('0x97')});_0x5ea155[_0x4e8a('0x9e')]=![];}return respondWithRpcPromise(_0x4e8a('0x9f'),_0x4e8a('0xa0'),_0x5ea155);});}return respondWithRpcPromise('Start',_0x4e8a('0xa0'),_0x5ea155);})[_0x4e8a('0x1f')](function(_0x21193d){respondWithRpcPromise(_0x4e8a('0xa1'),'EventManager',{'event':_0x4e8a('0x6c'),'message':_0x21193d},client9002);return _0x21193d;})[_0x4e8a('0x1f')](respondWithResult(_0x1a245,null))['catch'](handleError(_0x1a245,null));};exports[_0x4e8a('0xa2')]=function(_0xc17b81,_0x700386){var _0x7accea=_0xc17b81[_0x4e8a('0x4d')]['id'];var _0x3adf9=_0xc17b81[_0x4e8a('0x54')];var _0x2e4993=0xc8;var _0xb91f6a=null;return db[_0x4e8a('0xa3')][_0x4e8a('0xa4')]({'isolationLevel':db[_0x4e8a('0xa3')][_0x4e8a('0xa5')][_0x4e8a('0xa6')][_0x4e8a('0xa7')]},function(_0x34d6d7){return db[_0x4e8a('0x36')][_0x4e8a('0x64')]({'where':{'id':_0x7accea},'transaction':_0x34d6d7})['then'](function(_0x45b678){if(_0x45b678){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x7accea},'transaction':_0x34d6d7})[_0x4e8a('0x1f')](function(){var _0x3f2bbc=_[_0x4e8a('0x3a')](_0x3adf9,function(_0x5315b6){_0x5315b6[_0x4e8a('0x61')]=_0x7accea;return _0x5315b6;});return db[_0x4e8a('0x80')][_0x4e8a('0xa8')](_0x3f2bbc,{'transaction':_0x34d6d7});});}else{_0x2e4993=0x194;_0xb91f6a=[];}});})[_0x4e8a('0x1f')](function(){if(_0x2e4993!==0x194){return db[_0x4e8a('0x80')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x7accea},'order':'priority'})['then'](function(_0x1c4382){_0xb91f6a=_0x1c4382;});}})[_0x4e8a('0x28')](function(_0x1dc1a6){_0x2e4993=0x1f4;logger[_0x4e8a('0x26')](_0x1dc1a6['stack']);if(_0x1dc1a6[_0x4e8a('0x5d')]){delete _0x1dc1a6[_0x4e8a('0x5d')];}_0xb91f6a=_0x1dc1a6;})[_0x4e8a('0xa9')](function(){if(_0xb91f6a===null){_0x700386['sendStatus'](_0x2e4993);}else{if(_0x2e4993===0x1f4){_0x700386[_0x4e8a('0x2a')](_0x2e4993)[_0x4e8a('0x34')](_0xb91f6a);}else{_0x700386[_0x4e8a('0x2a')](_0x2e4993)[_0x4e8a('0xaa')](_0xb91f6a);}}});};exports[_0x4e8a('0xab')]=function(_0x1dbf0a,_0x3c1d5f,_0x19ddcc){var _0x4bafed={};var _0x288bb3={};var _0x2c45c0;var _0x465aa7;return db['OpenchannelAccount'][_0x4e8a('0x64')]({'where':{'id':_0x1dbf0a['params']['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x3c1d5f,null))['then'](function(_0x119115){if(_0x119115){_0x2c45c0=_0x119115;_0x288bb3[_0x4e8a('0x39')]=_[_0x4e8a('0x3c')](db[_0x4e8a('0x80')][_0x4e8a('0x4f')]);_0x288bb3[_0x4e8a('0x3b')]=_[_0x4e8a('0x3c')](_0x1dbf0a['query']);_0x288bb3[_0x4e8a('0x50')]=_['intersection'](_0x288bb3[_0x4e8a('0x39')],_0x288bb3[_0x4e8a('0x3b')]);_0x4bafed[_0x4e8a('0x3e')]=_['intersection'](_0x288bb3[_0x4e8a('0x39')],qs[_0x4e8a('0x3f')](_0x1dbf0a[_0x4e8a('0x3b')][_0x4e8a('0x3f')]));_0x4bafed['attributes']=_0x4bafed[_0x4e8a('0x3e')][_0x4e8a('0x51')]?_0x4bafed[_0x4e8a('0x3e')]:_0x288bb3[_0x4e8a('0x39')];_0x4bafed[_0x4e8a('0x42')]=qs[_0x4e8a('0x43')](_0x1dbf0a[_0x4e8a('0x3b')]['sort']);_0x4bafed['where']=qs[_0x4e8a('0x50')](_['pick'](_0x1dbf0a['query'],_0x288bb3[_0x4e8a('0x50')]));if(_0x1dbf0a[_0x4e8a('0x3b')][_0x4e8a('0x46')]){_0x4bafed[_0x4e8a('0x44')]=_['merge'](_0x4bafed[_0x4e8a('0x44')],{'$or':_['map'](_0x4bafed['attributes'],function(_0x2c7202){var _0x55e895={};_0x55e895[_0x2c7202]={'$like':'%'+_0x1dbf0a[_0x4e8a('0x3b')][_0x4e8a('0x46')]+'%'};return _0x55e895;})});}_0x4bafed=_['merge']({},_0x4bafed,_0x1dbf0a[_0x4e8a('0x48')]);return _0x2c45c0[_0x4e8a('0xab')](_0x4bafed);}})[_0x4e8a('0x1f')](function(_0x51578a){if(_0x51578a){_0x465aa7=_0x51578a[_0x4e8a('0x51')];if(!_0x1dbf0a[_0x4e8a('0x3b')][_0x4e8a('0x40')](_0x4e8a('0x41'))){_0x4bafed[_0x4e8a('0x2d')]=qs[_0x4e8a('0x2d')](_0x1dbf0a[_0x4e8a('0x3b')][_0x4e8a('0x2d')]);_0x4bafed[_0x4e8a('0x2b')]=qs[_0x4e8a('0x2b')](_0x1dbf0a['query']['offset']);}return _0x2c45c0[_0x4e8a('0xab')](_0x4bafed);}})['then'](function(_0x3c936b){if(_0x3c936b){return _0x3c936b?{'count':_0x465aa7,'rows':_0x3c936b}:null;}})[_0x4e8a('0x1f')](respondWithResult(_0x3c1d5f,null))[_0x4e8a('0x28')](handleError(_0x3c1d5f,null));};exports['getInteractions']=function(_0x119aca,_0x1309fd,_0x5290b1){var _0x200939={'raw':![],'where':{}};var _0x53fa64={};var _0x2787be={'count':0x0,'rows':[]};return db[_0x4e8a('0x36')][_0x4e8a('0x64')]({'where':{'id':_0x119aca[_0x4e8a('0x4d')]['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x1309fd,null))[_0x4e8a('0x1f')](function(_0x218a9b){if(_0x218a9b){_0x53fa64[_0x4e8a('0x39')]=_['keys'](db[_0x4e8a('0x8d')][_0x4e8a('0x4f')]);_0x53fa64[_0x4e8a('0x3b')]=_[_0x4e8a('0x3c')](_0x119aca[_0x4e8a('0x3b')]);_0x53fa64[_0x4e8a('0x50')]=_[_0x4e8a('0x3d')](_0x53fa64['model'],_0x53fa64[_0x4e8a('0x3b')]);_0x200939[_0x4e8a('0x3e')]=_[_0x4e8a('0x3d')](_0x53fa64[_0x4e8a('0x39')],qs['fields'](_0x119aca[_0x4e8a('0x3b')]['fields']));_0x200939[_0x4e8a('0x3e')]=_0x200939[_0x4e8a('0x3e')][_0x4e8a('0x51')]?_0x200939[_0x4e8a('0x3e')]:_0x53fa64[_0x4e8a('0x39')];if(!_0x119aca[_0x4e8a('0x3b')]['hasOwnProperty'](_0x4e8a('0x41'))){_0x200939['limit']=qs[_0x4e8a('0x2d')](_0x119aca['query'][_0x4e8a('0x2d')]);_0x200939[_0x4e8a('0x2b')]=qs['offset'](_0x119aca['query'][_0x4e8a('0x2b')]);}_0x200939[_0x4e8a('0x42')]=qs[_0x4e8a('0x43')](_0x119aca['query']['sort']);_0x200939[_0x4e8a('0x44')]=qs[_0x4e8a('0x50')](_[_0x4e8a('0x45')](_0x119aca['query'],_0x53fa64[_0x4e8a('0x50')]));_0x200939[_0x4e8a('0x44')][_0x4e8a('0x61')]=_0x218a9b['id'];if(_0x119aca[_0x4e8a('0x3b')][_0x4e8a('0x46')]){_0x200939['where']=_[_0x4e8a('0x52')](_0x200939[_0x4e8a('0x44')],{'$or':_[_0x4e8a('0x3a')](_0x200939[_0x4e8a('0x3e')],function(_0x413213){var _0x4476c7={};_0x4476c7[_0x413213]={'$like':'%'+_0x119aca[_0x4e8a('0x3b')][_0x4e8a('0x46')]+'%'};return _0x4476c7;})});}_0x200939=_['merge']({},_0x200939,_0x119aca[_0x4e8a('0x48')]);return db['OpenchannelInteraction'][_0x4e8a('0x49')]({'where':_0x200939['where']})[_0x4e8a('0x1f')](function(_0x1ce93d){_0x2787be['count']=_0x1ce93d;if(_0x119aca[_0x4e8a('0x3b')][_0x4e8a('0x4a')]){_0x200939[_0x4e8a('0x4b')]=[{'model':db['CmContact'],'as':_0x4e8a('0xac'),'required':![]},{'model':db[_0x4e8a('0xad')],'as':_0x4e8a('0xae'),'attributes':[_0x4e8a('0x5d'),_0x4e8a('0xaf'),'internal'],'required':![]},{'model':db[_0x4e8a('0xb0')],'as':_0x4e8a('0xb1'),'attributes':['id',_0x4e8a('0x5d'),_0x4e8a('0xb2')],'where':_0x119aca[_0x4e8a('0x3b')][_0x4e8a('0xb3')]?{'id':_0x119aca[_0x4e8a('0x3b')][_0x4e8a('0xb3')]}:undefined,'required':_0x119aca[_0x4e8a('0x3b')][_0x4e8a('0xb3')]?!![]:![]}];}return db[_0x4e8a('0x8d')]['findAll'](_0x200939);})[_0x4e8a('0x1f')](function(_0x53181a){_0x2787be[_0x4e8a('0x66')]=_0x53181a;return _0x2787be;});}})[_0x4e8a('0x1f')](respondWithFilteredResult(_0x1309fd,_0x200939))[_0x4e8a('0x28')](handleError(_0x1309fd,null));};exports[_0x4e8a('0xb4')]=function(_0x12c01c,_0x20d19b,_0x46fe87){return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0x12c01c['params']['id']}})['then'](handleEntityNotFound(_0x20d19b,null))['then'](function(_0x311abf){if(_0x311abf){return _0x311abf[_0x4e8a('0xb4')](_0x12c01c[_0x4e8a('0x54')][_0x4e8a('0x6b')],_[_0x4e8a('0xb5')](_0x12c01c[_0x4e8a('0x54')],['ids','id'])||{})['spread'](function(_0x147937){for(var _0x5250c5=0x0;_0x5250c5<_0x12c01c[_0x4e8a('0x54')]['ids'][_0x4e8a('0x51')];_0x5250c5+=0x1){socket[_0x4e8a('0xb6')](_0x4e8a('0xb7'),{'UserId':Number(_0x12c01c[_0x4e8a('0x54')][_0x4e8a('0x6b')][_0x5250c5]),'OpenchannelAccountId':Number(_0x12c01c[_0x4e8a('0x4d')]['id'])});}return _0x147937;});}})['then'](respondWithResult(_0x20d19b,null))[_0x4e8a('0x28')](handleError(_0x20d19b,null));};exports[_0x4e8a('0xb8')]=function(_0xda3a48,_0x59b94d,_0xa01a57){return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0xda3a48[_0x4e8a('0x4d')]['id']}})[_0x4e8a('0x1f')](handleEntityNotFound(_0x59b94d,null))[_0x4e8a('0x1f')](function(_0x4b6cd7){if(_0x4b6cd7){return _0x4b6cd7[_0x4e8a('0xb8')](_0xda3a48[_0x4e8a('0x3b')]['ids'])[_0x4e8a('0x1f')](function(){if(_['isArray'](_0xda3a48['query']['ids'])){for(var _0x54d9f5=0x0;_0x54d9f5<_0xda3a48['query'][_0x4e8a('0x6b')][_0x4e8a('0x51')];_0x54d9f5+=0x1){socket[_0x4e8a('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0xda3a48[_0x4e8a('0x3b')][_0x4e8a('0x6b')][_0x54d9f5]),'OpenchannelAccountId':Number(_0xda3a48[_0x4e8a('0x4d')]['id'])});}}else{socket[_0x4e8a('0xb6')](_0x4e8a('0xb9'),{'UserId':Number(_0xda3a48[_0x4e8a('0x3b')]['ids']),'OpenchannelAccountId':Number(_0xda3a48['params']['id'])});}});}})[_0x4e8a('0x1f')](respondWithStatusCode(_0x59b94d,null))[_0x4e8a('0x28')](handleError(_0x59b94d,null));};exports[_0x4e8a('0xba')]=function(_0x1b96fd,_0x3755af,_0x42608d){var _0xfd81d9={};var _0x331fba={};var _0x13901f;var _0x4acb77;return db[_0x4e8a('0x36')][_0x4e8a('0x64')]({'where':{'id':_0x1b96fd[_0x4e8a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3755af,null))[_0x4e8a('0x1f')](function(_0x165a19){if(_0x165a19){_0x13901f=_0x165a19;_0x331fba[_0x4e8a('0x39')]=_[_0x4e8a('0x3c')](db['User'][_0x4e8a('0x4f')]);_0x331fba[_0x4e8a('0x3b')]=_[_0x4e8a('0x3c')](_0x1b96fd[_0x4e8a('0x3b')]);_0x331fba[_0x4e8a('0x50')]=_[_0x4e8a('0x3d')](_0x331fba[_0x4e8a('0x39')],_0x331fba[_0x4e8a('0x3b')]);_0xfd81d9[_0x4e8a('0x3e')]=_[_0x4e8a('0x3d')](_0x331fba[_0x4e8a('0x39')],qs[_0x4e8a('0x3f')](_0x1b96fd[_0x4e8a('0x3b')][_0x4e8a('0x3f')]));_0xfd81d9[_0x4e8a('0x3e')]=_0xfd81d9[_0x4e8a('0x3e')][_0x4e8a('0x51')]?_0xfd81d9[_0x4e8a('0x3e')]:_0x331fba['model'];_0xfd81d9[_0x4e8a('0x42')]=qs[_0x4e8a('0x43')](_0x1b96fd[_0x4e8a('0x3b')]['sort']);_0xfd81d9[_0x4e8a('0x44')]=qs['filters'](_[_0x4e8a('0x45')](_0x1b96fd[_0x4e8a('0x3b')],_0x331fba[_0x4e8a('0x50')]));if(_0x1b96fd[_0x4e8a('0x3b')][_0x4e8a('0x46')]){_0xfd81d9[_0x4e8a('0x44')]=_['merge'](_0xfd81d9[_0x4e8a('0x44')],{'$or':_[_0x4e8a('0x3a')](_0xfd81d9[_0x4e8a('0x3e')],function(_0x4073a){var _0xe954d={};_0xe954d[_0x4073a]={'$like':'%'+_0x1b96fd[_0x4e8a('0x3b')][_0x4e8a('0x46')]+'%'};return _0xe954d;})});}_0xfd81d9=_[_0x4e8a('0x52')]({},_0xfd81d9,_0x1b96fd[_0x4e8a('0x48')]);return _0x13901f[_0x4e8a('0xba')](_0xfd81d9);}})[_0x4e8a('0x1f')](function(_0x279e9b){if(_0x279e9b){_0x4acb77=_0x279e9b['length'];if(!_0x1b96fd[_0x4e8a('0x3b')]['hasOwnProperty'](_0x4e8a('0x41'))){_0xfd81d9['limit']=qs[_0x4e8a('0x2d')](_0x1b96fd[_0x4e8a('0x3b')]['limit']);_0xfd81d9[_0x4e8a('0x2b')]=qs[_0x4e8a('0x2b')](_0x1b96fd[_0x4e8a('0x3b')][_0x4e8a('0x2b')]);}return _0x13901f[_0x4e8a('0xba')](_0xfd81d9);}})[_0x4e8a('0x1f')](function(_0x22bb64){if(_0x22bb64){return _0x22bb64?{'count':_0x4acb77,'rows':_0x22bb64}:null;}})[_0x4e8a('0x1f')](respondWithResult(_0x3755af,null))['catch'](handleError(_0x3755af,null));};exports[_0x4e8a('0x34')]=function(_0xb8b053,_0x262584,_0x2b5819){var _0x4b5a26,_0x241071,_0x1af060;if(_['isNil'](_0xb8b053[_0x4e8a('0x54')][_0x4e8a('0x54')])||_0xb8b053['body'][_0x4e8a('0x54')]===''){throw new db[(_0x4e8a('0x6f'))][(_0x4e8a('0x70'))](_0x4e8a('0xbb'));}if(_['isNil'](_0xb8b053['body']['to'])){}_0x4b5a26=_0xb8b053[_0x4e8a('0x54')]['to'];return db['OpenchannelAccount'][_0x4e8a('0x64')]({'where':{'id':_0xb8b053[_0x4e8a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x262584,null))['then'](function(_0x549920){if(_0x549920){return db[_0x4e8a('0x36')][_0x4e8a('0x5a')]({'where':{'id':_0x549920['id']},'include':[{'model':db[_0x4e8a('0xbc')],'as':_0x4e8a('0x7d'),'include':[{'model':db['CmContact'],'as':_0x4e8a('0x7e'),'where':{[_0x549920['mapKey']]:_0x4b5a26},'limit':0x1,'order':[[_0x4e8a('0x74'),_0x4e8a('0x7f')]]}]}]})[_0x4e8a('0x1f')](handleEntityNotFound(_0x262584,null))['then'](function(_0x1ee4b1){if(_0x1ee4b1&&_0x1ee4b1[_0x4e8a('0x7d')]){_0x241071=_0x1ee4b1[_0x4e8a('0x32')]({'plain':!![]});if(_0x241071['List']&&_0x241071['List'][_0x4e8a('0x7e')][_0x4e8a('0x51')]){return _0x241071['List'][_0x4e8a('0x7e')][0x0];}return db[_0x4e8a('0x6e')][_0x4e8a('0x53')](_[_0x4e8a('0x87')](_0xb8b053['body'],{'firstName':_0x4b5a26,[_0x1ee4b1[_0x4e8a('0x79')]]:_0x4b5a26,'phone':_0x4b5a26,'ListId':_0x241071[_0x4e8a('0x88')]}));}})['then'](handleEntityNotFound(_0x262584,null))[_0x4e8a('0x1f')](function(_0x35457b){if(_0x35457b){_0x1af060=_0x35457b;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x1af060['id'],'closed':![],'OpenchannelAccountId':_0x241071['id']}})['then'](function(_0x3fbaec){if(_0x3fbaec){return[_0x3fbaec,![]];}return db[_0x4e8a('0x8d')][_0x4e8a('0x53')]({'UserId':_0xb8b053[_0x4e8a('0x55')]['id'],'ContactId':_0x1af060['id'],'OpenchannelAccountId':_0x241071['id'],'lastMsgDirection':_0x4e8a('0xbd'),'firstMsgDirection':_0x4e8a('0xbd'),'Messages':[_['merge'](_0xb8b053['body'],{'read':![],'body':_0xb8b053[_0x4e8a('0x54')][_0x4e8a('0x54')],'OpenchannelAccountId':_0x241071['id'],'UserId':_0xb8b053['user']['id'],'ContactId':_0x1af060['id']})]},{'include':[{'model':db[_0x4e8a('0x98')],'as':'Messages'}]})[_0x4e8a('0x1f')](function(_0x56631e){return[_0x56631e,!![]];});});}})['spread'](function(_0x36fef7,_0x446c57){if(_0x446c57){return _0x36fef7;}return db[_0x4e8a('0x98')][_0x4e8a('0x53')](_['merge'](_0xb8b053[_0x4e8a('0x54')],{'read':![],'body':_0xb8b053[_0x4e8a('0x54')][_0x4e8a('0x54')],'OpenchannelAccountId':_0x241071['id'],'OpenchannelInteractionId':_0x36fef7['id'],'UserId':_0xb8b053[_0x4e8a('0x55')]['id'],'ContactId':_0x1af060['id']}))[_0x4e8a('0x1f')](function(_0x4f0f86){_0x36fef7[_0x4e8a('0xbe')]['Messages']=[];_0x36fef7[_0x4e8a('0xbe')][_0x4e8a('0xbf')][_0x4e8a('0x94')](_0x4f0f86[_0x4e8a('0xbe')]);return _0x36fef7;});});}})[_0x4e8a('0x1f')](respondWithResult(_0x262584,null))['catch'](handleError(_0x262584,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 51a43db..986c241 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 _0x2dae=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x84aaad,_0x5274a4){var _0x41af6b=function(_0x164921){while(--_0x164921){_0x84aaad['push'](_0x84aaad['shift']());}};_0x41af6b(++_0x5274a4);}(_0x2dae,0xc3));var _0xe2da=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x2dae[_0x494d1f];return _0x457b6e;};'use strict';var EventEmitter=require(_0xe2da('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xe2da('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe2da('0x2')](0x0);var events={'afterCreate':_0xe2da('0x3'),'afterUpdate':_0xe2da('0x4'),'afterDestroy':_0xe2da('0x5')};function emitEvent(_0x481d97){return function(_0x25b9f2,_0x439b5d,_0x77e45e){OpenchannelAccountEvents[_0xe2da('0x6')](_0x481d97+':'+_0x25b9f2['id'],_0x25b9f2);OpenchannelAccountEvents['emit'](_0x481d97,_0x25b9f2);_0x77e45e(null);};}for(var e in events){if(events[_0xe2da('0x7')](e)){var event=events[e];OpenchannelAccount[_0xe2da('0x8')](e,emitEvent(event));}}module[_0xe2da('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb903=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb','OpenchannelAccount'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xb903,0x185));var _0x3b90=function(_0x4831a3,_0xead372){_0x4831a3=_0x4831a3-0x0;var _0x888b0e=_0xb903[_0x4831a3];return _0x888b0e;};'use strict';var EventEmitter=require(_0x3b90('0x0'));var OpenchannelAccount=require(_0x3b90('0x1'))['db'][_0x3b90('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3b90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b90('0x4'),'afterDestroy':_0x3b90('0x5')};function emitEvent(_0x3b024a){return function(_0x1cd5d8,_0x30d8db,_0x40f726){OpenchannelAccountEvents[_0x3b90('0x6')](_0x3b024a+':'+_0x1cd5d8['id'],_0x1cd5d8);OpenchannelAccountEvents['emit'](_0x3b024a,_0x1cd5d8);_0x40f726(null);};}for(var e in events){if(events[_0x3b90('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](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 b065650..730c6fb 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(_0x4c5368,_0x28d31e){var _0x3e2035=function(_0x5304f1){while(--_0x5304f1){_0x4c5368['push'](_0x4c5368['shift']());}};_0x3e2035(++_0x28d31e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x5a7245,_0x18814e){var _0x441022=function(_0x1c0272){while(--_0x1c0272){_0x5a7245['push'](_0x5a7245['shift']());}};_0x441022(++_0x18814e);}(_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 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 26c7c49..495f870 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 _0xeb74=['request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./openchannelAccount.socket','register'];(function(_0x7fee8c,_0x1a180a){var _0x4f0510=function(_0x39c4eb){while(--_0x39c4eb){_0x7fee8c['push'](_0x7fee8c['shift']());}};_0x4f0510(++_0x1a180a);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4f191a,_0xad9b6){_0x4f191a=_0x4f191a-0x0;var _0x4ebc58=_0xeb74[_0x4f191a];return _0x4ebc58;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});config[_0x4eb7('0xc')]=_['defaults'](config[_0x4eb7('0xc')],{'host':_0x4eb7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4eb7('0xe'))[_0x4eb7('0xf')](socket);function respondWithRpcPromise(_0x4b3add,_0xa72e98,_0x4ff98e){return new BPromise(function(_0x3326cd,_0x462392){return client[_0x4eb7('0x10')](_0x4b3add,_0x4ff98e)['then'](function(_0x2b32be){logger[_0x4eb7('0x11')](_0x4eb7('0x12'),_0xa72e98,_0x4eb7('0x13'));logger[_0x4eb7('0x14')](_0x4eb7('0x15'),_0xa72e98,_0x4eb7('0x13'),JSON['stringify'](_0x2b32be));if(_0x2b32be['error']){if(_0x2b32be['error'][_0x4eb7('0x16')]===0x1f4){logger['error'](_0x4eb7('0x12'),_0xa72e98,_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);return _0x462392(_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);}logger[_0x4eb7('0x17')](_0x4eb7('0x12'),_0xa72e98,_0x2b32be[_0x4eb7('0x17')][_0x4eb7('0x18')]);return _0x3326cd(_0x2b32be[_0x4eb7('0x17')]['message']);}else{logger[_0x4eb7('0x11')](_0x4eb7('0x12'),_0xa72e98,_0x4eb7('0x13'));_0x3326cd(_0x2b32be[_0x4eb7('0x19')][_0x4eb7('0x18')]);}})[_0x4eb7('0x1a')](function(_0x2d0ea7){logger[_0x4eb7('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0xa72e98,_0x2d0ea7);_0x462392(_0x2d0ea7);});});} \ No newline at end of file +var _0x5eb1=['redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x5eb1,0x7c));var _0x15eb=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x5eb1[_0x46428c];return _0x16a677;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var moment=require(_0x15eb('0x1'));var BPromise=require(_0x15eb('0x2'));var rs=require(_0x15eb('0x3'));var fs=require('fs');var Redis=require(_0x15eb('0x4'));var db=require(_0x15eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15eb('0x6'))(_0x15eb('0x7'));var config=require(_0x15eb('0x8'));var jayson=require(_0x15eb('0x9'));var client=jayson['client'][_0x15eb('0xa')]({'port':0x232a});config[_0x15eb('0xb')]=_['defaults'](config[_0x15eb('0xb')],{'host':_0x15eb('0xc'),'port':0x18eb});var socket=require(_0x15eb('0xd'))(new Redis(config[_0x15eb('0xb')]));require(_0x15eb('0xe'))[_0x15eb('0xf')](socket);function respondWithRpcPromise(_0x412db6,_0x1481ae,_0x295e45){return new BPromise(function(_0x31e040,_0x3f08c1){return client[_0x15eb('0x10')](_0x412db6,_0x295e45)[_0x15eb('0x11')](function(_0x56c25c){logger[_0x15eb('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x1481ae,'request\x20sent');logger['debug'](_0x15eb('0x13'),_0x1481ae,_0x15eb('0x14'),JSON[_0x15eb('0x15')](_0x56c25c));if(_0x56c25c[_0x15eb('0x16')]){if(_0x56c25c['error'][_0x15eb('0x17')]===0x1f4){logger[_0x15eb('0x16')](_0x15eb('0x18'),_0x1481ae,_0x56c25c[_0x15eb('0x16')]['message']);return _0x3f08c1(_0x56c25c['error']['message']);}logger['error'](_0x15eb('0x18'),_0x1481ae,_0x56c25c['error']['message']);return _0x31e040(_0x56c25c[_0x15eb('0x16')]['message']);}else{logger[_0x15eb('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x1481ae,_0x15eb('0x14'));_0x31e040(_0x56c25c['result'][_0x15eb('0x19')]);}})[_0x15eb('0x1a')](function(_0x5cc4b1){logger[_0x15eb('0x16')](_0x15eb('0x18'),_0x1481ae,_0x5cc4b1);_0x3f08c1(_0x5cc4b1);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index ece50aa..3479e68 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 _0x2504=['remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x76faa4,_0x4a8b9c){var _0x5cab58=function(_0x159033){while(--_0x159033){_0x76faa4['push'](_0x76faa4['shift']());}};_0x5cab58(++_0x4a8b9c);}(_0x2504,0xee));var _0x4250=function(_0x579728,_0x770600){_0x579728=_0x579728-0x0;var _0x3e03fd=_0x2504[_0x579728];return _0x3e03fd;};'use strict';var OpenchannelAccountEvents=require(_0x4250('0x0'));var events=[_0x4250('0x1'),_0x4250('0x2'),_0x4250('0x3')];function createListener(_0x307ca9,_0x67c47b){return function(_0x41d71d){_0x67c47b[_0x4250('0x4')](_0x307ca9,_0x41d71d);};}function removeListener(_0x17d2d8,_0xc31f3a){return function(){OpenchannelAccountEvents[_0x4250('0x5')](_0x17d2d8,_0xc31f3a);};}exports[_0x4250('0x6')]=function(_0x493da9){for(var _0x473cb8=0x0,_0x4e177e=events['length'];_0x473cb8<_0x4e177e;_0x473cb8++){var _0x370998=events[_0x473cb8];var _0x477312=createListener(_0x4250('0x7')+_0x370998,_0x493da9);OpenchannelAccountEvents['on'](_0x370998,_0x477312);}}; \ No newline at end of file +var _0xee5b=['./openchannelAccount.events','remove','update','emit','register'];(function(_0x32d07d,_0x254d4a){var _0x34a4e9=function(_0x5f3c22){while(--_0x5f3c22){_0x32d07d['push'](_0x32d07d['shift']());}};_0x34a4e9(++_0x254d4a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x850626,_0x5072ff){_0x850626=_0x850626-0x0;var _0x11da82=_0xee5b[_0x850626];return _0x11da82;};'use strict';var OpenchannelAccountEvents=require(_0xbee5('0x0'));var events=['save',_0xbee5('0x1'),_0xbee5('0x2')];function createListener(_0x4f850a,_0x1893e4){return function(_0x2b93c2){_0x1893e4[_0xbee5('0x3')](_0x4f850a,_0x2b93c2);};}function removeListener(_0x210159,_0x4bd202){return function(){OpenchannelAccountEvents['removeListener'](_0x210159,_0x4bd202);};}exports[_0xbee5('0x4')]=function(_0x2c0bde){for(var _0xab6e4d=0x0,_0x804ab8=events['length'];_0xab6e4d<_0x804ab8;_0xab6e4d++){var _0x5505e3=events[_0xab6e4d];var _0x53d5b9=createListener('openchannelAccount:'+_0x5505e3,_0x2c0bde);OpenchannelAccountEvents['on'](_0x5505e3,_0x53d5b9);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 2a4a4cb..6ca15ea 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 _0x6ad8=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','show','put','/:id','delete','util','path','connect-timeout'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x6ad8,0xdd));var _0x86ad=function(_0x55214a,_0x63f115){_0x55214a=_0x55214a-0x0;var _0x341ebe=_0x6ad8[_0x55214a];return _0x341ebe;};'use strict';var multer=require('multer');var util=require(_0x86ad('0x0'));var path=require(_0x86ad('0x1'));var timeout=require(_0x86ad('0x2'));var express=require(_0x86ad('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86ad('0x4'));var interaction=require(_0x86ad('0x5'));var config=require(_0x86ad('0x6'));var controller=require(_0x86ad('0x7'));router[_0x86ad('0x8')]('/',auth[_0x86ad('0x9')](),controller['index']);router[_0x86ad('0x8')]('/:id',auth[_0x86ad('0x9')](),controller[_0x86ad('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x86ad('0xb')](_0x86ad('0xc'),auth[_0x86ad('0x9')](),controller['update']);router[_0x86ad('0xd')](_0x86ad('0xc'),auth[_0x86ad('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5437=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy'];(function(_0x5667a9,_0x564cc9){var _0x3dca31=function(_0x13c11f){while(--_0x13c11f){_0x5667a9['push'](_0x5667a9['shift']());}};_0x3dca31(++_0x564cc9);}(_0x5437,0x1b6));var _0x7543=function(_0x37de50,_0x27f82a){_0x37de50=_0x37de50-0x0;var _0x2c37dc=_0x5437[_0x37de50];return _0x2c37dc;};'use strict';var multer=require('multer');var util=require(_0x7543('0x0'));var path=require(_0x7543('0x1'));var timeout=require('connect-timeout');var express=require(_0x7543('0x2'));var router=express[_0x7543('0x3')]();var fs_extra=require(_0x7543('0x4'));var auth=require(_0x7543('0x5'));var interaction=require(_0x7543('0x6'));var config=require(_0x7543('0x7'));var controller=require(_0x7543('0x8'));router[_0x7543('0x9')]('/',auth[_0x7543('0xa')](),controller['index']);router[_0x7543('0x9')](_0x7543('0xb'),auth['isAuthenticated'](),controller[_0x7543('0xc')]);router[_0x7543('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7543('0xe')](_0x7543('0xb'),auth[_0x7543('0xa')](),controller[_0x7543('0xf')]);router[_0x7543('0x10')](_0x7543('0xb'),auth[_0x7543('0xa')](),controller[_0x7543('0x11')]);module[_0x7543('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6a2463d..be501c8 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 _0x283b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x128335,_0x5ed274){var _0x3ea5cd=function(_0x26b521){while(--_0x26b521){_0x128335['push'](_0x128335['shift']());}};_0x3ea5cd(++_0x5ed274);}(_0x283b,0xb8));var _0xb283=function(_0x54f634,_0x4a8120){_0x54f634=_0x54f634-0x0;var _0x551cd8=_0x283b[_0x54f634];return _0x551cd8;};'use strict';var Sequelize=require(_0xb283('0x0'));module[_0xb283('0x1')]={'priority':{'type':Sequelize[_0xb283('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb283('0x3')],'allowNull':![],'defaultValue':_0xb283('0x4')},'appdata':{'type':Sequelize[_0xb283('0x5')]()},'description':{'type':Sequelize[_0xb283('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb283('0x6')}}; \ No newline at end of file +var _0x2e40=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x14db54,_0x564c7c){var _0x57cafa=function(_0xc57ea){while(--_0xc57ea){_0x14db54['push'](_0x14db54['shift']());}};_0x57cafa(++_0x564c7c);}(_0x2e40,0x10f));var _0x02e4=function(_0x245d8d,_0x4fd9cf){_0x245d8d=_0x245d8d-0x0;var _0x31e2de=_0x2e40[_0x245d8d];return _0x31e2de;};'use strict';var Sequelize=require(_0x02e4('0x0'));module[_0x02e4('0x1')]={'priority':{'type':Sequelize[_0x02e4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x02e4('0x3')],'allowNull':![],'defaultValue':_0x02e4('0x4')},'appdata':{'type':Sequelize[_0x02e4('0x5')]()},'description':{'type':Sequelize[_0x02e4('0x3')]},'interval':{'type':Sequelize[_0x02e4('0x3')],'defaultValue':_0x02e4('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 3035958..a5c6bfd 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 _0x121a=['attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelApplication','rows','catch','show','rawAttributes','filters','length','includeAll','find','create','body','update','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','then','destroy','stack','name','send','map','type','model','query','keys','intersection'];(function(_0x5e31f3,_0x26086d){var _0xe8f38b=function(_0x35d1c2){while(--_0x35d1c2){_0x5e31f3['push'](_0x5e31f3['shift']());}};_0xe8f38b(++_0x26086d);}(_0x121a,0x166));var _0xa121=function(_0xcfe2f6,_0x27effa){_0xcfe2f6=_0xcfe2f6-0x0;var _0x47bc9f=_0x121a[_0xcfe2f6];return _0x47bc9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa121('0x0'));var zipdir=require(_0xa121('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa121('0x2'));var moment=require(_0xa121('0x3'));var BPromise=require(_0xa121('0x4'));var Mustache=require(_0xa121('0x5'));var util=require(_0xa121('0x6'));var path=require(_0xa121('0x7'));var sox=require('sox');var csv=require(_0xa121('0x8'));var ejs=require(_0xa121('0x9'));var fs=require('fs');var fs_extra=require(_0xa121('0xa'));var _=require(_0xa121('0xb'));var squel=require(_0xa121('0xc'));var crypto=require(_0xa121('0xd'));var jsforce=require(_0xa121('0xe'));var deskjs=require(_0xa121('0xf'));var toCsv=require(_0xa121('0x8'));var querystring=require('querystring');var Papa=require(_0xa121('0x10'));var Redis=require(_0xa121('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa121('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa121('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa121('0x14'));var config=require(_0xa121('0x15'));var licenseUtil=require(_0xa121('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2751a0,_0x1e5e40){_0x1e5e40=_0x1e5e40||0xcc;return function(_0x46ff52){if(_0x46ff52){return _0x2751a0[_0xa121('0x17')](_0x1e5e40);}return _0x2751a0['status'](_0x1e5e40)[_0xa121('0x18')]();};}function respondWithResult(_0x361135,_0x3b5bd3){_0x3b5bd3=_0x3b5bd3||0xc8;return function(_0x5cb183){if(_0x5cb183){return _0x361135[_0xa121('0x19')](_0x3b5bd3)[_0xa121('0x1a')](_0x5cb183);}};}function respondWithFilteredResult(_0x12389a,_0x3cf001){return function(_0x4e50f9){if(_0x4e50f9){var _0xd9d0ea=typeof _0x3cf001['offset']===_0xa121('0x1b')&&typeof _0x3cf001[_0xa121('0x1c')]==='undefined';var _0xcc22cc=_0x4e50f9[_0xa121('0x1d')];var _0x123930=_0xd9d0ea?0x0:_0x3cf001[_0xa121('0x1e')];var _0x2dd78c=_0xd9d0ea?_0x4e50f9[_0xa121('0x1d')]:_0x3cf001[_0xa121('0x1e')]+_0x3cf001[_0xa121('0x1c')];var _0xe6329d;if(_0x2dd78c>=_0xcc22cc){_0x2dd78c=_0xcc22cc;_0xe6329d=0xc8;}else{_0xe6329d=0xce;}_0x12389a['status'](_0xe6329d);return _0x12389a[_0xa121('0x1f')]('Content-Range',_0x123930+'-'+_0x2dd78c+'/'+_0xcc22cc)[_0xa121('0x1a')](_0x4e50f9);}return null;};}function patchUpdates(_0xad6ee9){return function(_0x957e62){try{jsonpatch['apply'](_0x957e62,_0xad6ee9,!![]);}catch(_0x2d8291){return BPromise[_0xa121('0x20')](_0x2d8291);}return _0x957e62['save']();};}function saveUpdates(_0x17d1a3,_0x499121){return function(_0x36d596){if(_0x36d596){return _0x36d596['update'](_0x17d1a3)[_0xa121('0x21')](function(_0x2e2cb0){return _0x2e2cb0;});}return null;};}function removeEntity(_0x2866ad,_0x5222f6){return function(_0x28fb74){if(_0x28fb74){return _0x28fb74[_0xa121('0x22')]()[_0xa121('0x21')](function(){_0x2866ad[_0xa121('0x19')](0xcc)[_0xa121('0x18')]();});}};}function handleEntityNotFound(_0x241bc8,_0x5d9293){return function(_0x2fceba){if(!_0x2fceba){_0x241bc8[_0xa121('0x17')](0x194);}return _0x2fceba;};}function handleError(_0x265131,_0x3378fe){_0x3378fe=_0x3378fe||0x1f4;return function(_0x10d394){logger['error'](_0x10d394[_0xa121('0x23')]);if(_0x10d394[_0xa121('0x24')]){delete _0x10d394[_0xa121('0x24')];}_0x265131[_0xa121('0x19')](_0x3378fe)[_0xa121('0x25')](_0x10d394);};}exports['index']=function(_0x2a5e14,_0x3f5fe3){var _0x17a4a7={},_0x5ab38e={},_0x5e8db2={'count':0x0,'rows':[]};var _0x563a41=_[_0xa121('0x26')](db['OpenchannelApplication']['rawAttributes'],function(_0x5b96e6){return{'name':_0x5b96e6['fieldName'],'type':_0x5b96e6[_0xa121('0x27')]['key']};});_0x5ab38e[_0xa121('0x28')]=_[_0xa121('0x26')](_0x563a41,_0xa121('0x24'));_0x5ab38e[_0xa121('0x29')]=_[_0xa121('0x2a')](_0x2a5e14[_0xa121('0x29')]);_0x5ab38e['filters']=_[_0xa121('0x2b')](_0x5ab38e[_0xa121('0x28')],_0x5ab38e['query']);_0x17a4a7[_0xa121('0x2c')]=_[_0xa121('0x2b')](_0x5ab38e[_0xa121('0x28')],qs[_0xa121('0x2d')](_0x2a5e14['query'][_0xa121('0x2d')]));_0x17a4a7[_0xa121('0x2c')]=_0x17a4a7['attributes']['length']?_0x17a4a7[_0xa121('0x2c')]:_0x5ab38e[_0xa121('0x28')];if(!_0x2a5e14[_0xa121('0x29')]['hasOwnProperty'](_0xa121('0x2e'))){_0x17a4a7[_0xa121('0x1c')]=qs[_0xa121('0x1c')](_0x2a5e14[_0xa121('0x29')][_0xa121('0x1c')]);_0x17a4a7[_0xa121('0x1e')]=qs['offset'](_0x2a5e14[_0xa121('0x29')][_0xa121('0x1e')]);}_0x17a4a7['order']=qs[_0xa121('0x2f')](_0x2a5e14[_0xa121('0x29')]['sort']);_0x17a4a7[_0xa121('0x30')]=qs['filters'](_[_0xa121('0x31')](_0x2a5e14['query'],_0x5ab38e['filters']),_0x563a41);if(_0x2a5e14['query'][_0xa121('0x32')]){_0x17a4a7[_0xa121('0x30')]=_['merge'](_0x17a4a7[_0xa121('0x30')],{'$or':_[_0xa121('0x26')](_0x563a41,function(_0x58769c){if(_0x58769c[_0xa121('0x27')]!==_0xa121('0x33')){var _0x289ce9={};_0x289ce9[_0x58769c[_0xa121('0x24')]]={'$like':'%'+_0x2a5e14[_0xa121('0x29')][_0xa121('0x32')]+'%'};return _0x289ce9;}})});}_0x17a4a7=_[_0xa121('0x34')]({},_0x17a4a7,_0x2a5e14[_0xa121('0x35')]);var _0x4d91df={'where':_0x17a4a7[_0xa121('0x30')]};return db[_0xa121('0x36')]['count'](_0x4d91df)['then'](function(_0x338e57){_0x5e8db2[_0xa121('0x1d')]=_0x338e57;if(_0x2a5e14[_0xa121('0x29')]['includeAll']){_0x17a4a7['include']=[{'all':!![]}];}return db[_0xa121('0x36')]['findAll'](_0x17a4a7);})[_0xa121('0x21')](function(_0x297be7){_0x5e8db2[_0xa121('0x37')]=_0x297be7;return _0x5e8db2;})['then'](respondWithFilteredResult(_0x3f5fe3,_0x17a4a7))[_0xa121('0x38')](handleError(_0x3f5fe3,null));};exports[_0xa121('0x39')]=function(_0x200bb7,_0x302d62){var _0x59de34={'raw':!![],'where':{'id':_0x200bb7['params']['id']}},_0x23bb3f={};_0x23bb3f['model']=_[_0xa121('0x2a')](db['OpenchannelApplication'][_0xa121('0x3a')]);_0x23bb3f[_0xa121('0x29')]=_[_0xa121('0x2a')](_0x200bb7[_0xa121('0x29')]);_0x23bb3f[_0xa121('0x3b')]=_[_0xa121('0x2b')](_0x23bb3f[_0xa121('0x28')],_0x23bb3f[_0xa121('0x29')]);_0x59de34[_0xa121('0x2c')]=_[_0xa121('0x2b')](_0x23bb3f[_0xa121('0x28')],qs[_0xa121('0x2d')](_0x200bb7[_0xa121('0x29')][_0xa121('0x2d')]));_0x59de34[_0xa121('0x2c')]=_0x59de34['attributes'][_0xa121('0x3c')]?_0x59de34[_0xa121('0x2c')]:_0x23bb3f[_0xa121('0x28')];if(_0x200bb7['query'][_0xa121('0x3d')]){_0x59de34['include']=[{'all':!![]}];}_0x59de34=_[_0xa121('0x34')]({},_0x59de34,_0x200bb7[_0xa121('0x35')]);return db['OpenchannelApplication'][_0xa121('0x3e')](_0x59de34)[_0xa121('0x21')](handleEntityNotFound(_0x302d62,null))[_0xa121('0x21')](respondWithResult(_0x302d62,null))[_0xa121('0x38')](handleError(_0x302d62,null));};exports[_0xa121('0x3f')]=function(_0x23e93b,_0x2f5f8c){return db['OpenchannelApplication'][_0xa121('0x3f')](_0x23e93b[_0xa121('0x40')],{})[_0xa121('0x21')](respondWithResult(_0x2f5f8c,0xc9))['catch'](handleError(_0x2f5f8c,null));};exports[_0xa121('0x41')]=function(_0x35cadf,_0x4152fe){if(_0x35cadf[_0xa121('0x40')]['id']){delete _0x35cadf[_0xa121('0x40')]['id'];}return db['OpenchannelApplication'][_0xa121('0x3e')]({'where':{'id':_0x35cadf[_0xa121('0x42')]['id']}})[_0xa121('0x21')](handleEntityNotFound(_0x4152fe,null))['then'](saveUpdates(_0x35cadf[_0xa121('0x40')],null))['then'](respondWithResult(_0x4152fe,null))['catch'](handleError(_0x4152fe,null));};exports[_0xa121('0x22')]=function(_0x3b4517,_0x4f4dab){return db[_0xa121('0x36')]['find']({'where':{'id':_0x3b4517['params']['id']}})[_0xa121('0x21')](handleEntityNotFound(_0x4f4dab,null))['then'](removeEntity(_0x4f4dab,null))['catch'](handleError(_0x4f4dab,null));}; \ No newline at end of file +var _0xd7d3=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','name','send','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','params','find','create','body','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','../../components/auth/service'];(function(_0x451b9a,_0xabd4bb){var _0x656a84=function(_0x25b668){while(--_0x25b668){_0x451b9a['push'](_0x451b9a['shift']());}};_0x656a84(++_0xabd4bb);}(_0xd7d3,0x168));var _0x3d7d=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0xd7d3[_0x333714];return _0x4c211e;};'use strict';var emlformat=require(_0x3d7d('0x0'));var rimraf=require(_0x3d7d('0x1'));var zipdir=require(_0x3d7d('0x2'));var jsonpatch=require(_0x3d7d('0x3'));var rp=require('request-promise');var moment=require(_0x3d7d('0x4'));var BPromise=require(_0x3d7d('0x5'));var Mustache=require(_0x3d7d('0x6'));var util=require(_0x3d7d('0x7'));var path=require(_0x3d7d('0x8'));var sox=require(_0x3d7d('0x9'));var csv=require(_0x3d7d('0xa'));var ejs=require(_0x3d7d('0xb'));var fs=require('fs');var fs_extra=require(_0x3d7d('0xc'));var _=require(_0x3d7d('0xd'));var squel=require(_0x3d7d('0xe'));var crypto=require(_0x3d7d('0xf'));var jsforce=require(_0x3d7d('0x10'));var deskjs=require(_0x3d7d('0x11'));var toCsv=require(_0x3d7d('0xa'));var querystring=require(_0x3d7d('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3d7d('0x13'));var qs=require(_0x3d7d('0x14'));var as=require(_0x3d7d('0x15'));var hardwareService=require(_0x3d7d('0x16'));var logger=require(_0x3d7d('0x17'))(_0x3d7d('0x18'));var utils=require('../../config/utils');var config=require(_0x3d7d('0x19'));var licenseUtil=require(_0x3d7d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20bd27,_0x4c07e8){_0x4c07e8=_0x4c07e8||0xcc;return function(_0x2c2b92){if(_0x2c2b92){return _0x20bd27[_0x3d7d('0x1b')](_0x4c07e8);}return _0x20bd27[_0x3d7d('0x1c')](_0x4c07e8)[_0x3d7d('0x1d')]();};}function respondWithResult(_0x66183f,_0x4c6884){_0x4c6884=_0x4c6884||0xc8;return function(_0x5546d7){if(_0x5546d7){return _0x66183f[_0x3d7d('0x1c')](_0x4c6884)[_0x3d7d('0x1e')](_0x5546d7);}};}function respondWithFilteredResult(_0x445bb4,_0x5c90f3){return function(_0x5282b){if(_0x5282b){var _0xc2c7fe=typeof _0x5c90f3[_0x3d7d('0x1f')]==='undefined'&&typeof _0x5c90f3['limit']===_0x3d7d('0x20');var _0x309b3b=_0x5282b[_0x3d7d('0x21')];var _0x53320a=_0xc2c7fe?0x0:_0x5c90f3[_0x3d7d('0x1f')];var _0x12972f=_0xc2c7fe?_0x5282b[_0x3d7d('0x21')]:_0x5c90f3[_0x3d7d('0x1f')]+_0x5c90f3[_0x3d7d('0x22')];var _0x5e049b;if(_0x12972f>=_0x309b3b){_0x12972f=_0x309b3b;_0x5e049b=0xc8;}else{_0x5e049b=0xce;}_0x445bb4[_0x3d7d('0x1c')](_0x5e049b);return _0x445bb4[_0x3d7d('0x23')](_0x3d7d('0x24'),_0x53320a+'-'+_0x12972f+'/'+_0x309b3b)[_0x3d7d('0x1e')](_0x5282b);}return null;};}function patchUpdates(_0x154a21){return function(_0x5c9ea3){try{jsonpatch['apply'](_0x5c9ea3,_0x154a21,!![]);}catch(_0x27036e){return BPromise[_0x3d7d('0x25')](_0x27036e);}return _0x5c9ea3[_0x3d7d('0x26')]();};}function saveUpdates(_0x24203d,_0xa3f3ab){return function(_0x318c45){if(_0x318c45){return _0x318c45[_0x3d7d('0x27')](_0x24203d)['then'](function(_0x2b9bd5){return _0x2b9bd5;});}return null;};}function removeEntity(_0x40a123,_0x211487){return function(_0x5d25e9){if(_0x5d25e9){return _0x5d25e9[_0x3d7d('0x28')]()[_0x3d7d('0x29')](function(){_0x40a123['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fdfbf,_0x4ad02c){return function(_0x5a8337){if(!_0x5a8337){_0x4fdfbf[_0x3d7d('0x1b')](0x194);}return _0x5a8337;};}function handleError(_0x4ff6e8,_0xbe95ff){_0xbe95ff=_0xbe95ff||0x1f4;return function(_0x560747){logger[_0x3d7d('0x2a')](_0x560747['stack']);if(_0x560747[_0x3d7d('0x2b')]){delete _0x560747[_0x3d7d('0x2b')];}_0x4ff6e8[_0x3d7d('0x1c')](_0xbe95ff)[_0x3d7d('0x2c')](_0x560747);};}exports['index']=function(_0x2e3fc3,_0x32d3e1){var _0x595ce1={},_0x4df3b1={},_0x2808c4={'count':0x0,'rows':[]};var _0x53cb08=_['map'](db['OpenchannelApplication'][_0x3d7d('0x2d')],function(_0x25e802){return{'name':_0x25e802['fieldName'],'type':_0x25e802['type'][_0x3d7d('0x2e')]};});_0x4df3b1[_0x3d7d('0x2f')]=_[_0x3d7d('0x30')](_0x53cb08,_0x3d7d('0x2b'));_0x4df3b1[_0x3d7d('0x31')]=_[_0x3d7d('0x32')](_0x2e3fc3[_0x3d7d('0x31')]);_0x4df3b1[_0x3d7d('0x33')]=_[_0x3d7d('0x34')](_0x4df3b1[_0x3d7d('0x2f')],_0x4df3b1[_0x3d7d('0x31')]);_0x595ce1[_0x3d7d('0x35')]=_[_0x3d7d('0x34')](_0x4df3b1['model'],qs['fields'](_0x2e3fc3[_0x3d7d('0x31')][_0x3d7d('0x36')]));_0x595ce1[_0x3d7d('0x35')]=_0x595ce1[_0x3d7d('0x35')]['length']?_0x595ce1[_0x3d7d('0x35')]:_0x4df3b1[_0x3d7d('0x2f')];if(!_0x2e3fc3[_0x3d7d('0x31')][_0x3d7d('0x37')](_0x3d7d('0x38'))){_0x595ce1['limit']=qs[_0x3d7d('0x22')](_0x2e3fc3[_0x3d7d('0x31')][_0x3d7d('0x22')]);_0x595ce1[_0x3d7d('0x1f')]=qs[_0x3d7d('0x1f')](_0x2e3fc3[_0x3d7d('0x31')][_0x3d7d('0x1f')]);}_0x595ce1['order']=qs[_0x3d7d('0x39')](_0x2e3fc3['query']['sort']);_0x595ce1[_0x3d7d('0x3a')]=qs['filters'](_[_0x3d7d('0x3b')](_0x2e3fc3[_0x3d7d('0x31')],_0x4df3b1[_0x3d7d('0x33')]),_0x53cb08);if(_0x2e3fc3[_0x3d7d('0x31')][_0x3d7d('0x3c')]){_0x595ce1[_0x3d7d('0x3a')]=_[_0x3d7d('0x3d')](_0x595ce1[_0x3d7d('0x3a')],{'$or':_['map'](_0x53cb08,function(_0x51c894){if(_0x51c894[_0x3d7d('0x3e')]!==_0x3d7d('0x3f')){var _0x37a76a={};_0x37a76a[_0x51c894[_0x3d7d('0x2b')]]={'$like':'%'+_0x2e3fc3[_0x3d7d('0x31')]['filter']+'%'};return _0x37a76a;}})});}_0x595ce1=_[_0x3d7d('0x3d')]({},_0x595ce1,_0x2e3fc3[_0x3d7d('0x40')]);var _0x202fc6={'where':_0x595ce1['where']};return db[_0x3d7d('0x41')][_0x3d7d('0x21')](_0x202fc6)[_0x3d7d('0x29')](function(_0x5b7317){_0x2808c4['count']=_0x5b7317;if(_0x2e3fc3[_0x3d7d('0x31')][_0x3d7d('0x42')]){_0x595ce1[_0x3d7d('0x43')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x3d7d('0x44')](_0x595ce1);})[_0x3d7d('0x29')](function(_0x14c5b7){_0x2808c4[_0x3d7d('0x45')]=_0x14c5b7;return _0x2808c4;})['then'](respondWithFilteredResult(_0x32d3e1,_0x595ce1))[_0x3d7d('0x46')](handleError(_0x32d3e1,null));};exports[_0x3d7d('0x47')]=function(_0x293c4c,_0x299c31){var _0x42a8ff={'raw':!![],'where':{'id':_0x293c4c[_0x3d7d('0x48')]['id']}},_0x10267a={};_0x10267a['model']=_['keys'](db['OpenchannelApplication'][_0x3d7d('0x2d')]);_0x10267a[_0x3d7d('0x31')]=_[_0x3d7d('0x32')](_0x293c4c[_0x3d7d('0x31')]);_0x10267a[_0x3d7d('0x33')]=_[_0x3d7d('0x34')](_0x10267a['model'],_0x10267a[_0x3d7d('0x31')]);_0x42a8ff['attributes']=_[_0x3d7d('0x34')](_0x10267a['model'],qs[_0x3d7d('0x36')](_0x293c4c['query']['fields']));_0x42a8ff[_0x3d7d('0x35')]=_0x42a8ff[_0x3d7d('0x35')]['length']?_0x42a8ff[_0x3d7d('0x35')]:_0x10267a[_0x3d7d('0x2f')];if(_0x293c4c['query'][_0x3d7d('0x42')]){_0x42a8ff[_0x3d7d('0x43')]=[{'all':!![]}];}_0x42a8ff=_[_0x3d7d('0x3d')]({},_0x42a8ff,_0x293c4c[_0x3d7d('0x40')]);return db[_0x3d7d('0x41')][_0x3d7d('0x49')](_0x42a8ff)['then'](handleEntityNotFound(_0x299c31,null))[_0x3d7d('0x29')](respondWithResult(_0x299c31,null))[_0x3d7d('0x46')](handleError(_0x299c31,null));};exports[_0x3d7d('0x4a')]=function(_0x1b1cf5,_0xa98c02){return db[_0x3d7d('0x41')]['create'](_0x1b1cf5['body'],{})[_0x3d7d('0x29')](respondWithResult(_0xa98c02,0xc9))[_0x3d7d('0x46')](handleError(_0xa98c02,null));};exports[_0x3d7d('0x27')]=function(_0x4bdca8,_0x49d262){if(_0x4bdca8[_0x3d7d('0x4b')]['id']){delete _0x4bdca8[_0x3d7d('0x4b')]['id'];}return db[_0x3d7d('0x41')][_0x3d7d('0x49')]({'where':{'id':_0x4bdca8['params']['id']}})[_0x3d7d('0x29')](handleEntityNotFound(_0x49d262,null))[_0x3d7d('0x29')](saveUpdates(_0x4bdca8[_0x3d7d('0x4b')],null))['then'](respondWithResult(_0x49d262,null))[_0x3d7d('0x46')](handleError(_0x49d262,null));};exports['destroy']=function(_0x103db1,_0x565f48){return db[_0x3d7d('0x41')][_0x3d7d('0x49')]({'where':{'id':_0x103db1[_0x3d7d('0x48')]['id']}})[_0x3d7d('0x29')](handleEntityNotFound(_0x565f48,null))[_0x3d7d('0x29')](removeEntity(_0x565f48,null))[_0x3d7d('0x46')](handleError(_0x565f48,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 50d3246..d294099 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 _0x6d6b=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelApplication.attributes'];(function(_0x1c1ffd,_0x3365f4){var _0x693f67=function(_0x99ff99){while(--_0x99ff99){_0x1c1ffd['push'](_0x1c1ffd['shift']());}};_0x693f67(++_0x3365f4);}(_0x6d6b,0xf0));var _0xb6d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d6b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb6d6('0x0'));var util=require('util');var logger=require(_0xb6d6('0x1'))(_0xb6d6('0x2'));var moment=require(_0xb6d6('0x3'));var BPromise=require(_0xb6d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6d6('0x5'));var rimraf=require(_0xb6d6('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6d6('0x7'));module['exports']=function(_0x15b059,_0x2cf857){return _0x15b059['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcf27=['openchannel_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xcf27,0x122));var _0x7cf2=function(_0x42f4ba,_0x1d45bb){_0x42f4ba=_0x42f4ba-0x0;var _0x236457=_0xcf27[_0x42f4ba];return _0x236457;};'use strict';var _=require('lodash');var util=require(_0x7cf2('0x0'));var logger=require(_0x7cf2('0x1'))('api');var moment=require(_0x7cf2('0x2'));var BPromise=require(_0x7cf2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cf2('0x4'));var rimraf=require(_0x7cf2('0x5'));var config=require(_0x7cf2('0x6'));var attributes=require(_0x7cf2('0x7'));module['exports']=function(_0x1744f9,_0x42a390){return _0x1744f9[_0x7cf2('0x8')](_0x7cf2('0x9'),attributes,{'tableName':_0x7cf2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7cf2('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index b68b706..7a2d5a4 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 _0xa7b7=['body','options','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0xd261dc,_0x14e18b){var _0x19fdc0=function(_0x380350){while(--_0x380350){_0xd261dc['push'](_0xd261dc['shift']());}};_0x19fdc0(++_0x14e18b);}(_0xa7b7,0x186));var _0x7a7b=function(_0xd32970,_0x43a555){_0xd32970=_0xd32970-0x0;var _0x3c1ccf=_0xa7b7[_0xd32970];return _0x3c1ccf;};'use strict';var _=require('lodash');var util=require(_0x7a7b('0x0'));var moment=require(_0x7a7b('0x1'));var BPromise=require(_0x7a7b('0x2'));var rs=require(_0x7a7b('0x3'));var fs=require('fs');var Redis=require(_0x7a7b('0x4'));var db=require(_0x7a7b('0x5'))['db'];var utils=require(_0x7a7b('0x6'));var logger=require(_0x7a7b('0x7'))(_0x7a7b('0x8'));var config=require(_0x7a7b('0x9'));var jayson=require(_0x7a7b('0xa'));var client=jayson[_0x7a7b('0xb')][_0x7a7b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41af7f,_0x207fd1,_0x117aa1){return new BPromise(function(_0x1f1d66,_0x15139d){return client['request'](_0x41af7f,_0x117aa1)[_0x7a7b('0xd')](function(_0x512389){logger[_0x7a7b('0xe')](_0x7a7b('0xf'),_0x207fd1,_0x7a7b('0x10'));logger[_0x7a7b('0x11')](_0x7a7b('0x12'),_0x207fd1,_0x7a7b('0x10'),JSON[_0x7a7b('0x13')](_0x512389));if(_0x512389[_0x7a7b('0x14')]){if(_0x512389[_0x7a7b('0x14')]['code']===0x1f4){logger[_0x7a7b('0x14')](_0x7a7b('0xf'),_0x207fd1,_0x512389[_0x7a7b('0x14')][_0x7a7b('0x15')]);return _0x15139d(_0x512389[_0x7a7b('0x14')][_0x7a7b('0x15')]);}logger['error'](_0x7a7b('0xf'),_0x207fd1,_0x512389['error']['message']);return _0x1f1d66(_0x512389['error']['message']);}else{logger['info'](_0x7a7b('0xf'),_0x207fd1,'request\x20sent');_0x1f1d66(_0x512389[_0x7a7b('0x16')][_0x7a7b('0x15')]);}})[_0x7a7b('0x17')](function(_0x389219){logger['error'](_0x7a7b('0xf'),_0x207fd1,_0x389219);_0x15139d(_0x389219);});});}exports[_0x7a7b('0x18')]=function(_0x2482fd){var _0x1fa6cf=this;return new Promise(function(_0x526dbd,_0x4a8e42){return db[_0x7a7b('0x19')]['update'](_0x2482fd[_0x7a7b('0x1a')],{'raw':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd[_0x7a7b('0x1b')][_0x7a7b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd['options'][_0x7a7b('0x1d')]||null:null,'attributes':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd[_0x7a7b('0x1b')][_0x7a7b('0x1e')]||null:null,'limit':_0x2482fd[_0x7a7b('0x1b')]?_0x2482fd['options'][_0x7a7b('0x1f')]||null:null})['then'](function(_0x4279a6){logger[_0x7a7b('0xe')]('UpdateOpenchannelApplication',_0x2482fd);logger[_0x7a7b('0x11')]('UpdateOpenchannelApplication',_0x2482fd,JSON[_0x7a7b('0x13')](_0x4279a6));_0x526dbd(_0x4279a6);})[_0x7a7b('0x17')](function(_0x4f90a1){logger[_0x7a7b('0x14')]('UpdateOpenchannelApplication',_0x4f90a1[_0x7a7b('0x15')],_0x2482fd);_0x4a8e42(_0x1fa6cf[_0x7a7b('0x14')](0x1f4,_0x4f90a1[_0x7a7b('0x15')]));});});}; \ No newline at end of file +var _0x1b1f=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','OpenchannelApplication','body','options','raw','limit','UpdateOpenchannelApplication','stringify','lodash','util','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','debug'];(function(_0x2887e8,_0x3add12){var _0x5c84fd=function(_0x547b76){while(--_0x547b76){_0x2887e8['push'](_0x2887e8['shift']());}};_0x5c84fd(++_0x3add12);}(_0x1b1f,0x17a));var _0xf1b1=function(_0x310fb6,_0x5b69a9){_0x310fb6=_0x310fb6-0x0;var _0x51c336=_0x1b1f[_0x310fb6];return _0x51c336;};'use strict';var _=require(_0xf1b1('0x0'));var util=require(_0xf1b1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf1b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf1b1('0x3'))('rpc');var config=require(_0xf1b1('0x4'));var jayson=require(_0xf1b1('0x5'));var client=jayson[_0xf1b1('0x6')][_0xf1b1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4335a4,_0x3f2f9c,_0x41f9e5){return new BPromise(function(_0x2f01b6,_0x4e61df){return client['request'](_0x4335a4,_0x41f9e5)[_0xf1b1('0x8')](function(_0x282edc){logger[_0xf1b1('0x9')](_0xf1b1('0xa'),_0x3f2f9c,'request\x20sent');logger[_0xf1b1('0xb')](_0xf1b1('0xc'),_0x3f2f9c,'request\x20sent',JSON['stringify'](_0x282edc));if(_0x282edc['error']){if(_0x282edc[_0xf1b1('0xd')][_0xf1b1('0xe')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x3f2f9c,_0x282edc[_0xf1b1('0xd')]['message']);return _0x4e61df(_0x282edc[_0xf1b1('0xd')][_0xf1b1('0xf')]);}logger[_0xf1b1('0xd')](_0xf1b1('0xa'),_0x3f2f9c,_0x282edc[_0xf1b1('0xd')]['message']);return _0x2f01b6(_0x282edc[_0xf1b1('0xd')][_0xf1b1('0xf')]);}else{logger['info'](_0xf1b1('0xa'),_0x3f2f9c,_0xf1b1('0x10'));_0x2f01b6(_0x282edc[_0xf1b1('0x11')]['message']);}})[_0xf1b1('0x12')](function(_0x2c7b33){logger['error'](_0xf1b1('0xa'),_0x3f2f9c,_0x2c7b33);_0x4e61df(_0x2c7b33);});});}exports['UpdateOpenchannelApplication']=function(_0x4d1688){var _0x365ab4=this;return new Promise(function(_0x3631a5,_0x5eb72){return db[_0xf1b1('0x13')]['update'](_0x4d1688[_0xf1b1('0x14')],{'raw':_0x4d1688[_0xf1b1('0x15')]?_0x4d1688['options'][_0xf1b1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d1688[_0xf1b1('0x15')]?_0x4d1688['options']['where']||null:null,'attributes':_0x4d1688['options']?_0x4d1688[_0xf1b1('0x15')]['attributes']||null:null,'limit':_0x4d1688[_0xf1b1('0x15')]?_0x4d1688[_0xf1b1('0x15')][_0xf1b1('0x17')]||null:null})[_0xf1b1('0x8')](function(_0x2f1f98){logger[_0xf1b1('0x9')](_0xf1b1('0x18'),_0x4d1688);logger[_0xf1b1('0xb')](_0xf1b1('0x18'),_0x4d1688,JSON[_0xf1b1('0x19')](_0x2f1f98));_0x3631a5(_0x2f1f98);})['catch'](function(_0x4efee0){logger['error'](_0xf1b1('0x18'),_0x4efee0[_0xf1b1('0xf')],_0x4d1688);_0x5eb72(_0x365ab4['error'](0x1f4,_0x4efee0[_0xf1b1('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 5c4820f..be86350 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 _0x6bdc=['tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelInteraction.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage'];(function(_0x40a9da,_0x4b0f34){var _0x3de8f3=function(_0x5726d9){while(--_0x5726d9){_0x40a9da['push'](_0x40a9da['shift']());}};_0x3de8f3(++_0x4b0f34);}(_0x6bdc,0x87));var _0xc6bd=function(_0x59704c,_0x2e88bc){_0x59704c=_0x59704c-0x0;var _0x291962=_0x6bdc[_0x59704c];return _0x291962;};'use strict';var multer=require('multer');var util=require(_0xc6bd('0x0'));var path=require(_0xc6bd('0x1'));var timeout=require(_0xc6bd('0x2'));var express=require(_0xc6bd('0x3'));var router=express[_0xc6bd('0x4')]();var fs_extra=require(_0xc6bd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc6bd('0x6'));var controller=require(_0xc6bd('0x7'));router[_0xc6bd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6bd('0x8')](_0xc6bd('0x9'),auth['isAuthenticated'](),controller[_0xc6bd('0xa')]);router[_0xc6bd('0x8')](_0xc6bd('0xb'),auth[_0xc6bd('0xc')](),controller[_0xc6bd('0xd')]);router[_0xc6bd('0x8')](_0xc6bd('0xe'),auth[_0xc6bd('0xc')](),controller['getMessages']);router[_0xc6bd('0x8')](_0xc6bd('0xf'),auth['isAuthenticated'](),controller[_0xc6bd('0x10')]);router[_0xc6bd('0x11')]('/',auth[_0xc6bd('0xc')](),controller[_0xc6bd('0x12')]);router[_0xc6bd('0x11')]('/:id/messages',auth[_0xc6bd('0xc')](),controller[_0xc6bd('0x13')]);router[_0xc6bd('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xc6bd('0x14')](_0xc6bd('0x15'),_0xc6bd('0x16')),controller[_0xc6bd('0x17')]);router['put'](_0xc6bd('0xb'),auth['isAuthenticated'](),interaction[_0xc6bd('0x14')](_0xc6bd('0x15'),_0xc6bd('0x18')),controller[_0xc6bd('0x19')]);router[_0xc6bd('0x1a')](_0xc6bd('0xb'),auth[_0xc6bd('0xc')](),interaction[_0xc6bd('0x14')](_0xc6bd('0x15'),_0xc6bd('0x1b')),controller[_0xc6bd('0x1c')]);router['delete'](_0xc6bd('0x1d'),auth[_0xc6bd('0xc')](),controller[_0xc6bd('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xbbd0=['download','post','addMessage','openchannel','openchannelinteraction:addtags','put','tracked','update','openchannelinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download'];(function(_0x3f34aa,_0x2b059a){var _0x5ed27e=function(_0x30be2e){while(--_0x30be2e){_0x3f34aa['push'](_0x3f34aa['shift']());}};_0x5ed27e(++_0x2b059a);}(_0xbbd0,0xd9));var _0x0bbd=function(_0x1409da,_0xe8f1cc){_0x1409da=_0x1409da-0x0;var _0x3e648c=_0xbbd0[_0x1409da];return _0x3e648c;};'use strict';var multer=require(_0x0bbd('0x0'));var util=require(_0x0bbd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0bbd('0x2'));var router=express['Router']();var fs_extra=require(_0x0bbd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0bbd('0x4'));var config=require(_0x0bbd('0x5'));var controller=require(_0x0bbd('0x6'));router[_0x0bbd('0x7')]('/',auth[_0x0bbd('0x8')](),controller[_0x0bbd('0x9')]);router[_0x0bbd('0x7')]('/describe',auth[_0x0bbd('0x8')](),controller[_0x0bbd('0xa')]);router[_0x0bbd('0x7')](_0x0bbd('0xb'),auth[_0x0bbd('0x8')](),controller[_0x0bbd('0xc')]);router[_0x0bbd('0x7')](_0x0bbd('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0bbd('0x7')](_0x0bbd('0xe'),auth[_0x0bbd('0x8')](),controller[_0x0bbd('0xf')]);router[_0x0bbd('0x10')]('/',auth[_0x0bbd('0x8')](),controller['create']);router[_0x0bbd('0x10')](_0x0bbd('0xd'),auth['isAuthenticated'](),controller[_0x0bbd('0x11')]);router[_0x0bbd('0x10')]('/:id/tags',auth[_0x0bbd('0x8')](),interaction['tracked'](_0x0bbd('0x12'),_0x0bbd('0x13')),controller['addTags']);router[_0x0bbd('0x14')]('/:id',auth[_0x0bbd('0x8')](),interaction[_0x0bbd('0x15')](_0x0bbd('0x12'),'openchannelinteraction:update'),controller[_0x0bbd('0x16')]);router['delete'](_0x0bbd('0xb'),auth[_0x0bbd('0x8')](),interaction['tracked'](_0x0bbd('0x12'),_0x0bbd('0x17')),controller[_0x0bbd('0x18')]);router[_0x0bbd('0x19')](_0x0bbd('0x1a'),auth['isAuthenticated'](),controller[_0x0bbd('0x1b')]);module[_0x0bbd('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index da1b6d6..ad0de4f 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 _0xda65=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x427c7d,_0x40100b){var _0x3082fe=function(_0x11c7be){while(--_0x11c7be){_0x427c7d['push'](_0x427c7d['shift']());}};_0x3082fe(++_0x40100b);}(_0xda65,0x1d0));var _0x5da6=function(_0x51f052,_0x222f05){_0x51f052=_0x51f052-0x0;var _0x51067e=_0xda65[_0x51f052];return _0x51067e;};'use strict';var Sequelize=require(_0x5da6('0x0'));module[_0x5da6('0x1')]={'closed':{'type':Sequelize[_0x5da6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5da6('0x3')]},'secondDisposition':{'type':Sequelize[_0x5da6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5da6('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x5da6('0x3')]},'externalUrl':{'type':Sequelize[_0x5da6('0x3')]},'lastMsgAt':{'type':Sequelize[_0x5da6('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5da6('0x5')]('in',_0x5da6('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5da6('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb2b5=['out','ENUM','BOOLEAN','STRING','DATE'];(function(_0x5b192d,_0x1241f1){var _0x352f33=function(_0x1ddad8){while(--_0x1ddad8){_0x5b192d['push'](_0x5b192d['shift']());}};_0x352f33(++_0x1241f1);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xb2b5[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5b2b('0x0')]},'secondDisposition':{'type':Sequelize[_0x5b2b('0x0')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5b2b('0x1')]},'threadId':{'type':Sequelize[_0x5b2b('0x0')]},'externalUrl':{'type':Sequelize[_0x5b2b('0x0')]},'lastMsgAt':{'type':Sequelize[_0x5b2b('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x5b2b('0x2')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x5b2b('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x5b2b('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index c5e5835..3af6858 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 _0x131d=['create','body','describe','addMessage','OpenchannelMessage','ids','omit','findOne','nolimit','order','sort','where','OpenchannelInteractionId','merge','map','filter','$gte','split','format','findAll','rows','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Attachment','Messages','read','OpenchannelAccount','Owner','fullname','get','Openchannel','Account','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','basename','existsSync','pipe','createWriteStream','direction','out','lastName','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','set','json','update','then','destroy','status','error','stack','name','send','OpenchannelInteraction','rawAttributes','fieldName','getOptions','catch','query','type','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x131d,0x1bb));var _0xd131=function(_0x30a931,_0x440026){_0x30a931=_0x30a931-0x0;var _0x5b7ab1=_0x131d[_0x30a931];return _0x5b7ab1;};'use strict';var rimraf=require(_0xd131('0x0'));var zipdir=require(_0xd131('0x1'));var moment=require(_0xd131('0x2'));var util=require('util');var path=require(_0xd131('0x3'));var ejs=require(_0xd131('0x4'));var fs=require('fs');var _=require(_0xd131('0x5'));var Redis=require('ioredis');var interaction=require(_0xd131('0x6'));var qs=require(_0xd131('0x7'));var pdf=require(_0xd131('0x8'));var logger=require(_0xd131('0x9'))('api');var config=require(_0xd131('0xa'));var db=require(_0xd131('0xb'))['db'];config[_0xd131('0xc')]=_[_0xd131('0xd')](config['redis'],{'host':_0xd131('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd131('0xc')]));require(_0xd131('0xf'))[_0xd131('0x10')](socket);function respondWithStatusCode(_0x3a65b2,_0x4df969){_0x4df969=_0x4df969||0xcc;return function(_0x450c71){if(_0x450c71){return _0x3a65b2[_0xd131('0x11')](_0x4df969);}return _0x3a65b2['status'](_0x4df969)[_0xd131('0x12')]();};}function respondWithResult(_0x5ebf0d,_0x5e6c99){_0x5e6c99=_0x5e6c99||0xc8;return function(_0x22c16d){if(_0x22c16d){return _0x5ebf0d['status'](_0x5e6c99)['json'](_0x22c16d);}};}function respondWithFilteredResult(_0x598205,_0x13dbf0){return function(_0x3bf713){if(_0x3bf713){var _0x332f4a=typeof _0x13dbf0[_0xd131('0x13')]===_0xd131('0x14')&&typeof _0x13dbf0[_0xd131('0x15')]===_0xd131('0x14');var _0xd88b2a=_0x3bf713[_0xd131('0x16')];var _0x38bb78=_0x332f4a?0x0:_0x13dbf0[_0xd131('0x13')];var _0x5a6b9f=_0x332f4a?_0x3bf713['count']:_0x13dbf0[_0xd131('0x13')]+_0x13dbf0['limit'];var _0x35151c;if(_0x5a6b9f>=_0xd88b2a){_0x5a6b9f=_0xd88b2a;_0x35151c=0xc8;}else{_0x35151c=0xce;}_0x598205['status'](_0x35151c);return _0x598205[_0xd131('0x17')]('Content-Range',_0x38bb78+'-'+_0x5a6b9f+'/'+_0xd88b2a)[_0xd131('0x18')](_0x3bf713);}return null;};}function saveUpdates(_0x123d8d){return function(_0x5b14d5){if(_0x5b14d5){return _0x5b14d5[_0xd131('0x19')](_0x123d8d)[_0xd131('0x1a')](function(_0x5b3df0){return _0x5b3df0;});}return null;};}function removeEntity(_0x492c63){return function(_0x3994a5){if(_0x3994a5){return _0x3994a5[_0xd131('0x1b')]()[_0xd131('0x1a')](function(){_0x492c63[_0xd131('0x1c')](0xcc)[_0xd131('0x12')]();});}};}function handleEntityNotFound(_0x3b6663){return function(_0x198818){if(!_0x198818){_0x3b6663['sendStatus'](0x194);}return _0x198818;};}function handleError(_0x1ca180,_0x275ec5){_0x275ec5=_0x275ec5||0x1f4;return function(_0x3914dc){logger[_0xd131('0x1d')](_0x3914dc[_0xd131('0x1e')]);if(_0x3914dc[_0xd131('0x1f')]){delete _0x3914dc[_0xd131('0x1f')];}_0x1ca180[_0xd131('0x1c')](_0x275ec5)[_0xd131('0x20')](_0x3914dc);};}exports['index']=function(_0x2a3bef,_0x51b9ed){var _0x390124={};var _0x414e85=_['map'](db[_0xd131('0x21')][_0xd131('0x22')],function(_0x1eb6df){return{'name':_0x1eb6df[_0xd131('0x23')],'type':_0x1eb6df['type']['key']};});_0x390124=qs[_0xd131('0x24')](_0x414e85,_0x2a3bef);return interaction['findAll']('openchannel',_0x2a3bef['query'],_0x2a3bef['user'],_0x390124,_0x414e85)[_0xd131('0x1a')](respondWithFilteredResult(_0x51b9ed,_0x390124))[_0xd131('0x25')](handleError(_0x51b9ed,null));};exports['show']=function(_0x46a3e3,_0x60e287){var _0x2a986e={};if(_0x46a3e3[_0xd131('0x26')][_0xd131('0x27')]&&_0x46a3e3[_0xd131('0x26')][_0xd131('0x27')]===_0xd131('0x28')){_0x2a986e['from']=_0x46a3e3[_0xd131('0x29')]['id'];}else{_0x2a986e['id']=_0x46a3e3['params']['id'];}var _0x4c16b3={'raw':![],'where':_0x2a986e},_0x454025={};_0x454025[_0xd131('0x2a')]=_[_0xd131('0x2b')](db[_0xd131('0x21')][_0xd131('0x22')]);_0x454025[_0xd131('0x26')]=_[_0xd131('0x2b')](_0x46a3e3['query']);_0x454025[_0xd131('0x2c')]=_[_0xd131('0x2d')](_0x454025[_0xd131('0x2a')],_0x454025[_0xd131('0x26')]);_0x4c16b3[_0xd131('0x2e')]=_['intersection'](_0x454025['model'],qs[_0xd131('0x2f')](_0x46a3e3[_0xd131('0x26')]['fields']));_0x4c16b3[_0xd131('0x2e')]=_0x4c16b3[_0xd131('0x2e')][_0xd131('0x30')]?_0x4c16b3[_0xd131('0x2e')]:_0x454025['model'];if(_0x46a3e3[_0xd131('0x26')][_0xd131('0x31')]){_0x4c16b3[_0xd131('0x32')]=[{'all':!![]}];}_0x4c16b3=_['merge']({},_0x4c16b3,_0x46a3e3[_0xd131('0x33')]);return db[_0xd131('0x21')][_0xd131('0x34')](_0x4c16b3)['then'](handleEntityNotFound(_0x60e287,null))[_0xd131('0x1a')](respondWithResult(_0x60e287,null))['catch'](handleError(_0x60e287,null));};exports[_0xd131('0x35')]=function(_0x3032b7,_0x4aed13){return db[_0xd131('0x21')][_0xd131('0x35')](_0x3032b7[_0xd131('0x36')],{})[_0xd131('0x1a')](respondWithResult(_0x4aed13,0xc9))[_0xd131('0x25')](handleError(_0x4aed13,null));};exports[_0xd131('0x19')]=function(_0x48839c,_0x15accc){if(_0x48839c['body']['id']){delete _0x48839c[_0xd131('0x36')]['id'];}return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x48839c[_0xd131('0x29')]['id']}})['then'](handleEntityNotFound(_0x15accc,null))['then'](saveUpdates(_0x48839c[_0xd131('0x36')],null))['then'](respondWithResult(_0x15accc,null))[_0xd131('0x25')](handleError(_0x15accc,null));};exports[_0xd131('0x1b')]=function(_0x2d495e,_0x1f1905){return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x2d495e[_0xd131('0x29')]['id']}})[_0xd131('0x1a')](handleEntityNotFound(_0x1f1905,null))[_0xd131('0x1a')](removeEntity(_0x1f1905,null))[_0xd131('0x25')](handleError(_0x1f1905,null));};exports[_0xd131('0x37')]=function(_0x371de1,_0x2d2c94){return db['OpenchannelInteraction'][_0xd131('0x37')]()[_0xd131('0x1a')](respondWithResult(_0x2d2c94,null))[_0xd131('0x25')](handleError(_0x2d2c94,null));};exports[_0xd131('0x38')]=function(_0x2e1e59,_0x43f6bb){return db[_0xd131('0x39')]['find']({'where':{'id':_0x2e1e59[_0xd131('0x29')]['id']}})['then'](handleEntityNotFound(_0x43f6bb,null))[_0xd131('0x1a')](function(_0x394c4a){if(_0x394c4a){return _0x394c4a[_0xd131('0x38')](_0x2e1e59[_0xd131('0x36')][_0xd131('0x3a')],_[_0xd131('0x3b')](_0x2e1e59[_0xd131('0x36')],[_0xd131('0x3a'),'id'])||{});}})[_0xd131('0x1a')](respondWithResult(_0x43f6bb,null))['catch'](handleError(_0x43f6bb,null));};exports['getMessages']=function(_0x138716,_0x42f0ad){var _0x7eaa94={'raw':![],'where':{}};var _0x435c2c={};var _0x516ca7={'count':0x0,'rows':[]};return db[_0xd131('0x21')][_0xd131('0x3c')]({'where':{'id':_0x138716[_0xd131('0x29')]['id']}})['then'](handleEntityNotFound(_0x42f0ad,null))[_0xd131('0x1a')](function(_0x5c07bf){if(_0x5c07bf){_0x435c2c[_0xd131('0x2a')]=_['keys'](db[_0xd131('0x39')][_0xd131('0x22')]);_0x435c2c[_0xd131('0x26')]=_[_0xd131('0x2b')](_0x138716[_0xd131('0x26')]);_0x435c2c[_0xd131('0x2c')]=_[_0xd131('0x2d')](_0x435c2c[_0xd131('0x2a')],_0x435c2c[_0xd131('0x26')]);_0x7eaa94[_0xd131('0x2e')]=_[_0xd131('0x2d')](_0x435c2c[_0xd131('0x2a')],qs['fields'](_0x138716[_0xd131('0x26')][_0xd131('0x2f')]));_0x7eaa94['attributes']=_0x7eaa94[_0xd131('0x2e')]['length']?_0x7eaa94[_0xd131('0x2e')]:_0x435c2c[_0xd131('0x2a')];if(!_0x138716[_0xd131('0x26')]['hasOwnProperty'](_0xd131('0x3d'))){_0x7eaa94['limit']=qs[_0xd131('0x15')](_0x138716['query'][_0xd131('0x15')]);_0x7eaa94['offset']=qs['offset'](_0x138716[_0xd131('0x26')]['offset']);}_0x7eaa94[_0xd131('0x3e')]=qs[_0xd131('0x3f')](_0x138716[_0xd131('0x26')]['sort']);_0x7eaa94[_0xd131('0x40')]=qs[_0xd131('0x2c')](_['pick'](_0x138716[_0xd131('0x26')],_0x435c2c[_0xd131('0x2c')]));_0x7eaa94[_0xd131('0x40')][_0xd131('0x41')]=_0x5c07bf['id'];if(_0x138716['query']['filter']){_0x7eaa94[_0xd131('0x40')]=_[_0xd131('0x42')](_0x7eaa94[_0xd131('0x40')],{'$or':_[_0xd131('0x43')](_0x7eaa94[_0xd131('0x2e')],function(_0x374ef8){var _0xa06027={};_0xa06027[_0x374ef8]={'$like':'%'+_0x138716['query'][_0xd131('0x44')]+'%'};return _0xa06027;})});}if(_0x138716['query'][_0xd131('0x45')]){var _0x3cffa3=_0x138716[_0xd131('0x26')][_0xd131('0x45')][_0xd131('0x46')](',');var _0x233413={};_0x233413[_0x3cffa3[0x0]]={'$gte':moment(_0x3cffa3[0x1])[_0xd131('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7eaa94[_0xd131('0x40')]=_['merge'](_0x7eaa94[_0xd131('0x40')],_0x233413);}_0x7eaa94=_[_0xd131('0x42')]({},_0x7eaa94,_0x138716[_0xd131('0x33')]);return db['OpenchannelMessage'][_0xd131('0x16')]({'where':_0x7eaa94[_0xd131('0x40')]})[_0xd131('0x1a')](function(_0xfad45d){_0x516ca7[_0xd131('0x16')]=_0xfad45d;if(_0x138716[_0xd131('0x26')][_0xd131('0x31')]){_0x7eaa94[_0xd131('0x32')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xd131('0x48')](_0x7eaa94);})[_0xd131('0x1a')](function(_0x36393d){_0x516ca7[_0xd131('0x49')]=_0x36393d;return _0x516ca7;});}})[_0xd131('0x1a')](respondWithFilteredResult(_0x42f0ad,_0x7eaa94))[_0xd131('0x25')](handleError(_0x42f0ad,null));};exports[_0xd131('0x4a')]=function(_0x5a82a4,_0x3b2199){return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x5a82a4[_0xd131('0x29')]['id']}})[_0xd131('0x1a')](handleEntityNotFound(_0x3b2199,null))[_0xd131('0x1a')](function(_0x1f1b39){if(_0x1f1b39){return _0x1f1b39['setTags'](_0x5a82a4[_0xd131('0x36')]['ids'],_[_0xd131('0x3b')](_0x5a82a4['body'],[_0xd131('0x3a'),'id'])||{})[_0xd131('0x4b')](function(){return db['Tag'][_0xd131('0x48')]({'attributes':['id','name','color'],'where':{'id':_0x5a82a4[_0xd131('0x36')][_0xd131('0x3a')]}});})[_0xd131('0x1a')](function(_0x59e5b2){socket[_0xd131('0x4c')](_0xd131('0x4d'),{'id':Number(_0x5a82a4[_0xd131('0x29')]['id']),'tags':_0x59e5b2||[]});return{'id':Number(_0x5a82a4[_0xd131('0x29')]['id']),'tags':_0x59e5b2||[]};});}})['then'](respondWithResult(_0x3b2199,null))[_0xd131('0x25')](handleError(_0x3b2199,null));};exports[_0xd131('0x4e')]=function(_0x209e33,_0x5f46c2){return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x209e33[_0xd131('0x29')]['id']}})[_0xd131('0x1a')](handleEntityNotFound(_0x5f46c2,null))[_0xd131('0x1a')](function(_0x4d5fe8){if(_0x4d5fe8){return _0x4d5fe8[_0xd131('0x4e')](_0x209e33['query'][_0xd131('0x3a')]);}})['then'](respondWithStatusCode(_0x5f46c2,null))['catch'](handleError(_0x5f46c2,null));};exports[_0xd131('0x4f')]=function(_0x437d43,_0x5d6774){var _0x213aa2=moment()[_0xd131('0x50')]()[_0xd131('0x51')]();var _0x194809=path[_0xd131('0x52')](config[_0xd131('0x53')],_0xd131('0x54'),_0xd131('0x55'),_0xd131('0x56'));var _0xdc7009=path[_0xd131('0x52')](config[_0xd131('0x53')],_0xd131('0x54'),_0xd131('0x55'),_0xd131('0x57'));var _0x31e6d1=path[_0xd131('0x52')](_0x194809,_0x213aa2);var _0x14353c=util['format'](_0xd131('0x58'),_0x437d43[_0xd131('0x29')]['id'],_0x213aa2);var _0x4354c9=path['join'](_0x194809,_0x14353c);var _0x27cbcc=[];_0x27cbcc[_0xd131('0x59')]({'model':db[_0xd131('0x5a')],'as':_0xd131('0x5a'),'attributes':['id','fullname'],'raw':!![]});_0x27cbcc[_0xd131('0x59')]({'model':db[_0xd131('0x5b')],'as':_0xd131('0x5c'),'attributes':['id',_0xd131('0x5d'),'lastName'],'raw':!![]});if(_0x437d43[_0xd131('0x26')][_0xd131('0x57')]){_0x27cbcc['push']({'model':db[_0xd131('0x5e')],'as':'Attachment','raw':!![]});}var _0xb09ed7=[{'model':db[_0xd131('0x39')],'as':_0xd131('0x5f'),'attributes':['id',_0xd131('0x36'),'createdAt','direction','secret',_0xd131('0x60')],'include':_0x27cbcc}];_0xb09ed7[_0xd131('0x59')]({'model':db[_0xd131('0x61')],'as':'Account','attributes':['id',_0xd131('0x1f')]});_0xb09ed7['push']({'model':db[_0xd131('0x5a')],'as':_0xd131('0x62'),'attributes':['id',_0xd131('0x63')]});return db[_0xd131('0x21')][_0xd131('0x34')]({'where':{'id':_0x437d43['params']['id']},'include':_0xb09ed7})[_0xd131('0x1a')](handleEntityNotFound(_0x5d6774,null))[_0xd131('0x1a')](function(_0x255125){if(_0x255125){var _0x1a656e=_0x255125[_0xd131('0x64')]({'plain':!![]});fs['mkdirSync'](_0x31e6d1);var _0x800225={'channel':_0xd131('0x65'),'account':_0x1a656e[_0xd131('0x66')][_0xd131('0x1f')],'agent':_0x1a656e[_0xd131('0x62')]?_0x1a656e[_0xd131('0x62')][_0xd131('0x63')]:_0xd131('0x67'),'createdAt':moment(_0x1a656e[_0xd131('0x68')])[_0xd131('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd131('0x51')](),'closedAt':_0x1a656e['closed']?moment(_0x1a656e['closedAt'])[_0xd131('0x47')](_0xd131('0x69'))['toString']():'','disposition':_0x1a656e[_0xd131('0x6a')],'visibility':_0x1a656e[_0xd131('0x6b')]?_0xd131('0x6c'):'Private','messages':_(_0x1a656e[_0xd131('0x5f')])[_0xd131('0x44')]({'secret':![]})[_0xd131('0x43')](function(_0x11eab3){if(_0x11eab3['Attachment']){var _0x5d7287=path[_0xd131('0x52')](_0xdc7009,_0x11eab3[_0xd131('0x5e')][_0xd131('0x6d')]);if(fs[_0xd131('0x6e')](_0x5d7287)){fs['createReadStream'](_0x5d7287)[_0xd131('0x6f')](fs[_0xd131('0x70')](path[_0xd131('0x52')](_0x31e6d1,_0x11eab3[_0xd131('0x5e')][_0xd131('0x6d')])));}}return{'date':moment(_0x11eab3['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd131('0x51')](),'sender':_0x11eab3[_0xd131('0x71')]===_0xd131('0x72')?_0x11eab3['User']?_0x11eab3[_0xd131('0x5a')][_0xd131('0x63')]:'System':_0x11eab3[_0xd131('0x5c')][_0xd131('0x5d')]+(_0x11eab3[_0xd131('0x5c')]['lastName']?'\x20'+_0x11eab3['Contact'][_0xd131('0x73')]:''),'body':_0x11eab3['Attachment']?_0x11eab3[_0xd131('0x5e')][_0xd131('0x6d')]:_0x11eab3[_0xd131('0x36')],'direction':_0x11eab3[_0xd131('0x71')]==='out'?'A':'C','secret':_0x11eab3[_0xd131('0x74')],'read':_0x11eab3[_0xd131('0x60')],'attachment':_0x11eab3[_0xd131('0x5e')]};})[_0xd131('0x75')]()};return ejs[_0xd131('0x76')](path[_0xd131('0x52')](config[_0xd131('0x53')],_0xd131('0x54'),_0xd131('0x77'),_0xd131('0x78')),{'interaction':_0x800225})['then'](function(_0x8cd253){var _0x583434=path[_0xd131('0x52')](_0x31e6d1,_0xd131('0x79')+_0x1a656e['id']+'-'+_0x213aa2+'.pdf');var _0x553eb2={'path':_0x583434,'channel':'Openchannel','interactionId':_0x1a656e['id']};return pdf['createPdfFromHTML'](_0x8cd253,_0x553eb2);})[_0xd131('0x1a')](function(){return new Promise(function(_0x27aad0,_0x1958b8){zipdir(_0x31e6d1,{'saveTo':_0x4354c9},function(_0x4409f3,_0x18b4f5){if(_0x4409f3)return _0x1958b8(_0x4409f3);return _0x27aad0(_0x18b4f5);});})[_0xd131('0x1a')](function(){return new Promise(function(_0x2ff22d,_0x38ac91){rimraf(_0x31e6d1,function(_0x378d46){if(_0x378d46)_0x38ac91(_0x378d46);return _0x2ff22d();});});})[_0xd131('0x1a')](function(){return _0x5d6774[_0xd131('0x4f')](_0x4354c9,_0x14353c,function(_0x1a3caf){if(_0x1a3caf){logger[_0xd131('0x1d')](_0xd131('0x7a'),_0x1a3caf);}else{fs[_0xd131('0x7b')](_0x4354c9);}});});});}else{return _0x5d6774['sendStatus'](0xc8);}})[_0xd131('0x25')](handleError(_0x5d6774,null));}; \ No newline at end of file +var _0x30a3=['fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','toString','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','Content-Range','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','key','getOptions','openchannel','query','user','catch','show','type','from','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','findAll','rows','addTags','setTags','spread','Tag','color','emit','removeTags','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User'];(function(_0x51b5ec,_0x16b503){var _0x1f1237=function(_0x3e8250){while(--_0x3e8250){_0x51b5ec['push'](_0x51b5ec['shift']());}};_0x1f1237(++_0x16b503);}(_0x30a3,0x1b8));var _0x330a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a3[_0x20a584];return _0x4b41a8;};'use strict';var rimraf=require(_0x330a('0x0'));var zipdir=require(_0x330a('0x1'));var moment=require(_0x330a('0x2'));var util=require(_0x330a('0x3'));var path=require(_0x330a('0x4'));var ejs=require(_0x330a('0x5'));var fs=require('fs');var _=require(_0x330a('0x6'));var Redis=require('ioredis');var interaction=require(_0x330a('0x7'));var qs=require(_0x330a('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x330a('0x9'))(_0x330a('0xa'));var config=require(_0x330a('0xb'));var db=require(_0x330a('0xc'))['db'];config[_0x330a('0xd')]=_[_0x330a('0xe')](config[_0x330a('0xd')],{'host':_0x330a('0xf'),'port':0x18eb});var socket=require(_0x330a('0x10'))(new Redis(config[_0x330a('0xd')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1759f7,_0x20836e){_0x20836e=_0x20836e||0xcc;return function(_0x5482b5){if(_0x5482b5){return _0x1759f7[_0x330a('0x11')](_0x20836e);}return _0x1759f7['status'](_0x20836e)[_0x330a('0x12')]();};}function respondWithResult(_0x49ba60,_0x61eda8){_0x61eda8=_0x61eda8||0xc8;return function(_0x4cde47){if(_0x4cde47){return _0x49ba60[_0x330a('0x13')](_0x61eda8)[_0x330a('0x14')](_0x4cde47);}};}function respondWithFilteredResult(_0x4dbd5a,_0x31a673){return function(_0x305000){if(_0x305000){var _0x49e167=typeof _0x31a673[_0x330a('0x15')]===_0x330a('0x16')&&typeof _0x31a673[_0x330a('0x17')]===_0x330a('0x16');var _0x408db5=_0x305000['count'];var _0x1f3132=_0x49e167?0x0:_0x31a673[_0x330a('0x15')];var _0x3bcdfb=_0x49e167?_0x305000['count']:_0x31a673[_0x330a('0x15')]+_0x31a673[_0x330a('0x17')];var _0x12d719;if(_0x3bcdfb>=_0x408db5){_0x3bcdfb=_0x408db5;_0x12d719=0xc8;}else{_0x12d719=0xce;}_0x4dbd5a[_0x330a('0x13')](_0x12d719);return _0x4dbd5a['set'](_0x330a('0x18'),_0x1f3132+'-'+_0x3bcdfb+'/'+_0x408db5)['json'](_0x305000);}return null;};}function saveUpdates(_0x4742a8){return function(_0x3290ec){if(_0x3290ec){return _0x3290ec['update'](_0x4742a8)[_0x330a('0x19')](function(_0x34c227){return _0x34c227;});}return null;};}function removeEntity(_0x16399e){return function(_0x29b520){if(_0x29b520){return _0x29b520[_0x330a('0x1a')]()['then'](function(){_0x16399e[_0x330a('0x13')](0xcc)[_0x330a('0x12')]();});}};}function handleEntityNotFound(_0x28f696){return function(_0x4f4b29){if(!_0x4f4b29){_0x28f696['sendStatus'](0x194);}return _0x4f4b29;};}function handleError(_0x5c36c0,_0x5b2f59){_0x5b2f59=_0x5b2f59||0x1f4;return function(_0x2f9331){logger[_0x330a('0x1b')](_0x2f9331[_0x330a('0x1c')]);if(_0x2f9331[_0x330a('0x1d')]){delete _0x2f9331[_0x330a('0x1d')];}_0x5c36c0[_0x330a('0x13')](_0x5b2f59)[_0x330a('0x1e')](_0x2f9331);};}exports[_0x330a('0x1f')]=function(_0x1f5250,_0x40aa1d){var _0x209b10={};var _0x36a9ce=_[_0x330a('0x20')](db[_0x330a('0x21')][_0x330a('0x22')],function(_0x142d18){return{'name':_0x142d18[_0x330a('0x23')],'type':_0x142d18['type'][_0x330a('0x24')]};});_0x209b10=qs[_0x330a('0x25')](_0x36a9ce,_0x1f5250);return interaction['findAll'](_0x330a('0x26'),_0x1f5250[_0x330a('0x27')],_0x1f5250[_0x330a('0x28')],_0x209b10,_0x36a9ce)[_0x330a('0x19')](respondWithFilteredResult(_0x40aa1d,_0x209b10))[_0x330a('0x29')](handleError(_0x40aa1d,null));};exports[_0x330a('0x2a')]=function(_0x2c9545,_0x54ffd0){var _0x3e721c={};if(_0x2c9545[_0x330a('0x27')]['type']&&_0x2c9545[_0x330a('0x27')][_0x330a('0x2b')]===_0x330a('0x2c')){_0x3e721c[_0x330a('0x2c')]=_0x2c9545['params']['id'];}else{_0x3e721c['id']=_0x2c9545[_0x330a('0x2d')]['id'];}var _0x4ca1ee={'raw':![],'where':_0x3e721c},_0x1d7fe9={};_0x1d7fe9['model']=_[_0x330a('0x2e')](db[_0x330a('0x21')][_0x330a('0x22')]);_0x1d7fe9[_0x330a('0x27')]=_[_0x330a('0x2e')](_0x2c9545[_0x330a('0x27')]);_0x1d7fe9[_0x330a('0x2f')]=_[_0x330a('0x30')](_0x1d7fe9[_0x330a('0x31')],_0x1d7fe9[_0x330a('0x27')]);_0x4ca1ee[_0x330a('0x32')]=_[_0x330a('0x30')](_0x1d7fe9[_0x330a('0x31')],qs[_0x330a('0x33')](_0x2c9545[_0x330a('0x27')]['fields']));_0x4ca1ee[_0x330a('0x32')]=_0x4ca1ee[_0x330a('0x32')][_0x330a('0x34')]?_0x4ca1ee[_0x330a('0x32')]:_0x1d7fe9[_0x330a('0x31')];if(_0x2c9545[_0x330a('0x27')][_0x330a('0x35')]){_0x4ca1ee[_0x330a('0x36')]=[{'all':!![]}];}_0x4ca1ee=_[_0x330a('0x37')]({},_0x4ca1ee,_0x2c9545[_0x330a('0x38')]);return db['OpenchannelInteraction']['find'](_0x4ca1ee)['then'](handleEntityNotFound(_0x54ffd0,null))[_0x330a('0x19')](respondWithResult(_0x54ffd0,null))[_0x330a('0x29')](handleError(_0x54ffd0,null));};exports[_0x330a('0x39')]=function(_0x1a7590,_0x42c496){return db[_0x330a('0x21')][_0x330a('0x39')](_0x1a7590['body'],{})[_0x330a('0x19')](respondWithResult(_0x42c496,0xc9))[_0x330a('0x29')](handleError(_0x42c496,null));};exports['update']=function(_0x19d012,_0x29e58d){if(_0x19d012[_0x330a('0x3a')]['id']){delete _0x19d012[_0x330a('0x3a')]['id'];}return db[_0x330a('0x21')][_0x330a('0x3b')]({'where':{'id':_0x19d012['params']['id']}})[_0x330a('0x19')](handleEntityNotFound(_0x29e58d,null))[_0x330a('0x19')](saveUpdates(_0x19d012[_0x330a('0x3a')],null))[_0x330a('0x19')](respondWithResult(_0x29e58d,null))[_0x330a('0x29')](handleError(_0x29e58d,null));};exports['destroy']=function(_0x482191,_0x2ab7fc){return db[_0x330a('0x21')][_0x330a('0x3b')]({'where':{'id':_0x482191['params']['id']}})['then'](handleEntityNotFound(_0x2ab7fc,null))[_0x330a('0x19')](removeEntity(_0x2ab7fc,null))[_0x330a('0x29')](handleError(_0x2ab7fc,null));};exports[_0x330a('0x3c')]=function(_0x74f9cb,_0x1e8a2c){return db['OpenchannelInteraction']['describe']()[_0x330a('0x19')](respondWithResult(_0x1e8a2c,null))[_0x330a('0x29')](handleError(_0x1e8a2c,null));};exports[_0x330a('0x3d')]=function(_0x4e909b,_0x36bccc){return db[_0x330a('0x3e')][_0x330a('0x3b')]({'where':{'id':_0x4e909b['params']['id']}})[_0x330a('0x19')](handleEntityNotFound(_0x36bccc,null))[_0x330a('0x19')](function(_0x2fc87b){if(_0x2fc87b){return _0x2fc87b[_0x330a('0x3d')](_0x4e909b[_0x330a('0x3a')][_0x330a('0x3f')],_[_0x330a('0x40')](_0x4e909b[_0x330a('0x3a')],[_0x330a('0x3f'),'id'])||{});}})[_0x330a('0x19')](respondWithResult(_0x36bccc,null))[_0x330a('0x29')](handleError(_0x36bccc,null));};exports[_0x330a('0x41')]=function(_0x419db6,_0x1e639c){var _0x4964cb={'raw':![],'where':{}};var _0x239076={};var _0x1e3e80={'count':0x0,'rows':[]};return db[_0x330a('0x21')][_0x330a('0x42')]({'where':{'id':_0x419db6[_0x330a('0x2d')]['id']}})[_0x330a('0x19')](handleEntityNotFound(_0x1e639c,null))[_0x330a('0x19')](function(_0x5da7cb){if(_0x5da7cb){_0x239076[_0x330a('0x31')]=_[_0x330a('0x2e')](db[_0x330a('0x3e')]['rawAttributes']);_0x239076[_0x330a('0x27')]=_['keys'](_0x419db6[_0x330a('0x27')]);_0x239076[_0x330a('0x2f')]=_[_0x330a('0x30')](_0x239076['model'],_0x239076[_0x330a('0x27')]);_0x4964cb['attributes']=_[_0x330a('0x30')](_0x239076['model'],qs[_0x330a('0x33')](_0x419db6[_0x330a('0x27')][_0x330a('0x33')]));_0x4964cb[_0x330a('0x32')]=_0x4964cb[_0x330a('0x32')][_0x330a('0x34')]?_0x4964cb[_0x330a('0x32')]:_0x239076[_0x330a('0x31')];if(!_0x419db6[_0x330a('0x27')]['hasOwnProperty'](_0x330a('0x43'))){_0x4964cb['limit']=qs['limit'](_0x419db6[_0x330a('0x27')][_0x330a('0x17')]);_0x4964cb['offset']=qs[_0x330a('0x15')](_0x419db6[_0x330a('0x27')][_0x330a('0x15')]);}_0x4964cb['order']=qs[_0x330a('0x44')](_0x419db6[_0x330a('0x27')][_0x330a('0x44')]);_0x4964cb[_0x330a('0x45')]=qs[_0x330a('0x2f')](_[_0x330a('0x46')](_0x419db6[_0x330a('0x27')],_0x239076[_0x330a('0x2f')]));_0x4964cb['where'][_0x330a('0x47')]=_0x5da7cb['id'];if(_0x419db6[_0x330a('0x27')][_0x330a('0x48')]){_0x4964cb[_0x330a('0x45')]=_[_0x330a('0x37')](_0x4964cb[_0x330a('0x45')],{'$or':_[_0x330a('0x20')](_0x4964cb[_0x330a('0x32')],function(_0x1fb38c){var _0x13832f={};_0x13832f[_0x1fb38c]={'$like':'%'+_0x419db6['query']['filter']+'%'};return _0x13832f;})});}if(_0x419db6[_0x330a('0x27')]['$gte']){var _0x4e39de=_0x419db6[_0x330a('0x27')][_0x330a('0x49')][_0x330a('0x4a')](',');var _0x40cb2c={};_0x40cb2c[_0x4e39de[0x0]]={'$gte':moment(_0x4e39de[0x1])[_0x330a('0x4b')](_0x330a('0x4c'))};_0x4964cb['where']=_['merge'](_0x4964cb[_0x330a('0x45')],_0x40cb2c);}_0x4964cb=_[_0x330a('0x37')]({},_0x4964cb,_0x419db6['options']);return db[_0x330a('0x3e')][_0x330a('0x4d')]({'where':_0x4964cb[_0x330a('0x45')]})[_0x330a('0x19')](function(_0x3a9acb){_0x1e3e80[_0x330a('0x4d')]=_0x3a9acb;if(_0x419db6[_0x330a('0x27')][_0x330a('0x35')]){_0x4964cb[_0x330a('0x36')]=[{'all':!![]}];}return db[_0x330a('0x3e')][_0x330a('0x4e')](_0x4964cb);})[_0x330a('0x19')](function(_0x433054){_0x1e3e80[_0x330a('0x4f')]=_0x433054;return _0x1e3e80;});}})[_0x330a('0x19')](respondWithFilteredResult(_0x1e639c,_0x4964cb))[_0x330a('0x29')](handleError(_0x1e639c,null));};exports[_0x330a('0x50')]=function(_0x238b3c,_0x3003e6){return db['OpenchannelInteraction'][_0x330a('0x3b')]({'where':{'id':_0x238b3c[_0x330a('0x2d')]['id']}})[_0x330a('0x19')](handleEntityNotFound(_0x3003e6,null))[_0x330a('0x19')](function(_0x2cfa21){if(_0x2cfa21){return _0x2cfa21[_0x330a('0x51')](_0x238b3c[_0x330a('0x3a')][_0x330a('0x3f')],_['omit'](_0x238b3c['body'],[_0x330a('0x3f'),'id'])||{})[_0x330a('0x52')](function(){return db[_0x330a('0x53')]['findAll']({'attributes':['id',_0x330a('0x1d'),_0x330a('0x54')],'where':{'id':_0x238b3c[_0x330a('0x3a')][_0x330a('0x3f')]}});})['then'](function(_0xd72e1d){socket[_0x330a('0x55')]('openchannelInteractionTags:save',{'id':Number(_0x238b3c[_0x330a('0x2d')]['id']),'tags':_0xd72e1d||[]});return{'id':Number(_0x238b3c[_0x330a('0x2d')]['id']),'tags':_0xd72e1d||[]};});}})[_0x330a('0x19')](respondWithResult(_0x3003e6,null))['catch'](handleError(_0x3003e6,null));};exports[_0x330a('0x56')]=function(_0xc8a34a,_0x57b76c){return db[_0x330a('0x21')][_0x330a('0x3b')]({'where':{'id':_0xc8a34a[_0x330a('0x2d')]['id']}})[_0x330a('0x19')](handleEntityNotFound(_0x57b76c,null))[_0x330a('0x19')](function(_0x5e6c68){if(_0x5e6c68){return _0x5e6c68[_0x330a('0x56')](_0xc8a34a[_0x330a('0x27')][_0x330a('0x3f')]);}})[_0x330a('0x19')](respondWithStatusCode(_0x57b76c,null))['catch'](handleError(_0x57b76c,null));};exports['download']=function(_0x1e911b,_0x117154){var _0x2c7f25=moment()['unix']()['toString']();var _0x3df5de=path[_0x330a('0x57')](config[_0x330a('0x58')],_0x330a('0x59'),_0x330a('0x5a'),_0x330a('0x5b'));var _0x5542c8=path[_0x330a('0x57')](config[_0x330a('0x58')],_0x330a('0x59'),_0x330a('0x5a'),_0x330a('0x5c'));var _0x40ab56=path[_0x330a('0x57')](_0x3df5de,_0x2c7f25);var _0x4dfac0=util[_0x330a('0x4b')](_0x330a('0x5d'),_0x1e911b[_0x330a('0x2d')]['id'],_0x2c7f25);var _0x4df42e=path['join'](_0x3df5de,_0x4dfac0);var _0x27441f=[];_0x27441f[_0x330a('0x5e')]({'model':db['User'],'as':_0x330a('0x5f'),'attributes':['id',_0x330a('0x60')],'raw':!![]});_0x27441f[_0x330a('0x5e')]({'model':db[_0x330a('0x61')],'as':_0x330a('0x62'),'attributes':['id',_0x330a('0x63'),_0x330a('0x64')],'raw':!![]});if(_0x1e911b[_0x330a('0x27')][_0x330a('0x5c')]){_0x27441f[_0x330a('0x5e')]({'model':db[_0x330a('0x65')],'as':'Attachment','raw':!![]});}var _0x437610=[{'model':db[_0x330a('0x3e')],'as':_0x330a('0x66'),'attributes':['id','body',_0x330a('0x67'),'direction',_0x330a('0x68'),_0x330a('0x69')],'include':_0x27441f}];_0x437610['push']({'model':db[_0x330a('0x6a')],'as':_0x330a('0x6b'),'attributes':['id',_0x330a('0x1d')]});_0x437610['push']({'model':db[_0x330a('0x5f')],'as':_0x330a('0x6c'),'attributes':['id','fullname']});return db[_0x330a('0x21')][_0x330a('0x3b')]({'where':{'id':_0x1e911b[_0x330a('0x2d')]['id']},'include':_0x437610})[_0x330a('0x19')](handleEntityNotFound(_0x117154,null))['then'](function(_0x45a0e9){if(_0x45a0e9){var _0x1ab6d7=_0x45a0e9[_0x330a('0x6d')]({'plain':!![]});fs[_0x330a('0x6e')](_0x40ab56);var _0x25fb91={'channel':_0x330a('0x6f'),'account':_0x1ab6d7['Account']['name'],'agent':_0x1ab6d7[_0x330a('0x6c')]?_0x1ab6d7[_0x330a('0x6c')][_0x330a('0x60')]:_0x330a('0x70'),'createdAt':moment(_0x1ab6d7['createdAt'])[_0x330a('0x4b')](_0x330a('0x4c'))[_0x330a('0x71')](),'closedAt':_0x1ab6d7['closed']?moment(_0x1ab6d7[_0x330a('0x72')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x330a('0x71')]():'','disposition':_0x1ab6d7['disposition'],'visibility':_0x1ab6d7[_0x330a('0x73')]?_0x330a('0x74'):_0x330a('0x75'),'messages':_(_0x1ab6d7['Messages'])['filter']({'secret':![]})[_0x330a('0x20')](function(_0x5901c9){if(_0x5901c9[_0x330a('0x65')]){var _0x303dc9=path[_0x330a('0x57')](_0x5542c8,_0x5901c9[_0x330a('0x65')][_0x330a('0x76')]);if(fs[_0x330a('0x77')](_0x303dc9)){fs[_0x330a('0x78')](_0x303dc9)[_0x330a('0x79')](fs[_0x330a('0x7a')](path[_0x330a('0x57')](_0x40ab56,_0x5901c9[_0x330a('0x65')]['basename'])));}}return{'date':moment(_0x5901c9['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x330a('0x71')](),'sender':_0x5901c9['direction']===_0x330a('0x7b')?_0x5901c9[_0x330a('0x5f')]?_0x5901c9[_0x330a('0x5f')][_0x330a('0x60')]:_0x330a('0x7c'):_0x5901c9['Contact'][_0x330a('0x63')]+(_0x5901c9[_0x330a('0x62')][_0x330a('0x64')]?'\x20'+_0x5901c9[_0x330a('0x62')][_0x330a('0x64')]:''),'body':_0x5901c9['Attachment']?_0x5901c9[_0x330a('0x65')]['basename']:_0x5901c9[_0x330a('0x3a')],'direction':_0x5901c9['direction']===_0x330a('0x7b')?'A':'C','secret':_0x5901c9[_0x330a('0x68')],'read':_0x5901c9[_0x330a('0x69')],'attachment':_0x5901c9[_0x330a('0x65')]};})[_0x330a('0x7d')]()};return ejs[_0x330a('0x7e')](path['join'](config[_0x330a('0x58')],_0x330a('0x59'),'views',_0x330a('0x7f')),{'interaction':_0x25fb91})['then'](function(_0x540657){var _0x399c4f=path['join'](_0x40ab56,_0x330a('0x80')+_0x1ab6d7['id']+'-'+_0x2c7f25+_0x330a('0x81'));var _0x2bbeb6={'path':_0x399c4f,'channel':_0x330a('0x6f'),'interactionId':_0x1ab6d7['id']};return pdf[_0x330a('0x82')](_0x540657,_0x2bbeb6);})[_0x330a('0x19')](function(){return new Promise(function(_0x3b36b1,_0x476bd2){zipdir(_0x40ab56,{'saveTo':_0x4df42e},function(_0x15b970,_0x5bd575){if(_0x15b970)return _0x476bd2(_0x15b970);return _0x3b36b1(_0x5bd575);});})[_0x330a('0x19')](function(){return new Promise(function(_0x336721,_0x4a1e9f){rimraf(_0x40ab56,function(_0x4758c8){if(_0x4758c8)_0x4a1e9f(_0x4758c8);return _0x336721();});});})[_0x330a('0x19')](function(){return _0x117154[_0x330a('0x83')](_0x4df42e,_0x4dfac0,function(_0xc2da8e){if(_0xc2da8e){logger['error'](_0x330a('0x84'),_0xc2da8e);}else{fs[_0x330a('0x85')](_0x4df42e);}});});});}else{return _0x117154[_0x330a('0x11')](0xc8);}})[_0x330a('0x29')](handleError(_0x117154,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 8a9c091..65748c5 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 _0x4d19=['setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hook','../../mysqldb','remove','getUsers'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0x4d19,0x1b9));var _0x94d1=function(_0x49a068,_0x53aade){_0x49a068=_0x49a068-0x0;var _0x4cbc65=_0x4d19[_0x49a068];return _0x4cbc65;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x94d1('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x94d1('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x94d1('0x1')};function emitEvent(_0x5180ef){return function(_0x1ea2eb,_0x557b2a,_0x2dccb6){_0x1ea2eb[_0x94d1('0x2')]({'attributes':['id'],'raw':!![]})['then'](function(_0x467e24){_0x1ea2eb[_0x94d1('0x3')](_0x94d1('0x4'),_0x467e24[_0x94d1('0x5')](function(_0x3c1bde){return{'id':_0x3c1bde['id']};}));return OpenchannelMessage[_0x94d1('0x6')]({'where':{'OpenchannelInteractionId':_0x1ea2eb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x94d1('0x7')](function(_0x1a4d2b){_0x1ea2eb[_0x94d1('0x3')](_0x94d1('0x8'),_0x1a4d2b[_0x94d1('0x9')]);OpenchannelInteractionEvents['emit'](_0x5180ef+':'+_0x1ea2eb['id'],_0x1ea2eb);OpenchannelInteractionEvents[_0x94d1('0xa')](_0x5180ef,_0x1ea2eb);_0x2dccb6(null);})['catch'](_0x2dccb6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x94d1('0xb')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1edb=['getUsers','then','Users','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x54d0b1,_0x1abf62){var _0x26a67c=function(_0x120064){while(--_0x120064){_0x54d0b1['push'](_0x54d0b1['shift']());}};_0x26a67c(++_0x1abf62);}(_0x1edb,0x12a));var _0xb1ed=function(_0x18d879,_0x5bb13f){_0x18d879=_0x18d879-0x0;var _0x599459=_0x1edb[_0x18d879];return _0x599459;};'use strict';var EventEmitter=require(_0xb1ed('0x0'));var OpenchannelInteraction=require(_0xb1ed('0x1'))['db'][_0xb1ed('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xb1ed('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb1ed('0x4')](0x0);var events={'afterCreate':_0xb1ed('0x5'),'afterUpdate':_0xb1ed('0x6'),'afterDestroy':_0xb1ed('0x7')};function emitEvent(_0x1b5271){return function(_0xa08046,_0x55076b,_0x22295b){_0xa08046[_0xb1ed('0x8')]({'attributes':['id'],'raw':!![]})[_0xb1ed('0x9')](function(_0x1c8584){_0xa08046['setDataValue'](_0xb1ed('0xa'),_0x1c8584['map'](function(_0x52cd16){return{'id':_0x52cd16['id']};}));return OpenchannelMessage[_0xb1ed('0xb')]({'where':{'OpenchannelInteractionId':_0xa08046['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb1ed('0x9')](function(_0x3fc8c0){_0xa08046[_0xb1ed('0xc')](_0xb1ed('0xd'),_0x3fc8c0['length']);OpenchannelInteractionEvents[_0xb1ed('0xe')](_0x1b5271+':'+_0xa08046['id'],_0xa08046);OpenchannelInteractionEvents[_0xb1ed('0xe')](_0x1b5271,_0xa08046);_0x22295b(null);})['catch'](_0x22295b(null));};}for(var e in events){if(events[_0xb1ed('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xb1ed('0x10')](e,emitEvent(event));}}module[_0xb1ed('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 57eb3e4..e1cf609 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 _0xc9bb=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x1bc44d,_0x46379f){var _0x39969a=function(_0x459d6c){while(--_0x459d6c){_0x1bc44d['push'](_0x1bc44d['shift']());}};_0x39969a(++_0x46379f);}(_0xc9bb,0x8e));var _0xbc9b=function(_0x35aaf9,_0x3efa26){_0x35aaf9=_0x35aaf9-0x0;var _0x32e3ca=_0xc9bb[_0x35aaf9];return _0x32e3ca;};'use strict';var _=require(_0xbc9b('0x0'));var util=require(_0xbc9b('0x1'));var logger=require('../../config/logger')(_0xbc9b('0x2'));var moment=require(_0xbc9b('0x3'));var BPromise=require(_0xbc9b('0x4'));var rp=require(_0xbc9b('0x5'));var fs=require('fs');var path=require(_0xbc9b('0x6'));var rimraf=require(_0xbc9b('0x7'));var config=require(_0xbc9b('0x8'));var attributes=require(_0xbc9b('0x9'));module[_0xbc9b('0xa')]=function(_0x327961,_0x518be7){return _0x327961[_0xbc9b('0xb')](_0xbc9b('0xc'),attributes,{'tableName':_0xbc9b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc9b('0xe'),'collate':_0xbc9b('0xf'),'hooks':{'beforeUpdate':function(_0x5403c3,_0x503dc1,_0x513c6e){if(_0x5403c3[_0xbc9b('0x10')]('closed')){_0x5403c3['closedAt']=moment()[_0xbc9b('0x11')](_0xbc9b('0x12'));}_0x513c6e(null,_0x5403c3);}}});}; \ No newline at end of file +var _0x595d=['utf8mb4_unicode_ci','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x595d,0x82));var _0xd595=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x595d[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0xd595('0x0'));var util=require(_0xd595('0x1'));var logger=require(_0xd595('0x2'))('api');var moment=require(_0xd595('0x3'));var BPromise=require(_0xd595('0x4'));var rp=require(_0xd595('0x5'));var fs=require('fs');var path=require(_0xd595('0x6'));var rimraf=require(_0xd595('0x7'));var config=require(_0xd595('0x8'));var attributes=require(_0xd595('0x9'));module[_0xd595('0xa')]=function(_0x14f1d7,_0x2f096c){return _0x14f1d7[_0xd595('0xb')](_0xd595('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd595('0xd'),'collate':_0xd595('0xe'),'hooks':{'beforeUpdate':function(_0x4217bd,_0x4d23b7,_0x3ac3fd){if(_0x4217bd[_0xd595('0xf')](_0xd595('0x10'))){_0x4217bd['closedAt']=moment()['format'](_0xd595('0x11'));}_0x3ac3fd(null,_0x4217bd);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index c9f337e..4439ce4 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 _0x18b9=['OpenchannelInteraction','update','options','raw','where','attributes','then','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction'];(function(_0x1f8381,_0x4a02f7){var _0x599ab6=function(_0x350087){while(--_0x350087){_0x1f8381['push'](_0x1f8381['shift']());}};_0x599ab6(++_0x4a02f7);}(_0x18b9,0x8d));var _0x918b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x18b9[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x918b('0x0'));var util=require(_0x918b('0x1'));var moment=require('moment');var BPromise=require(_0x918b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x918b('0x3'));var db=require(_0x918b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x918b('0x5'))(_0x918b('0x6'));var config=require(_0x918b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x918b('0x8')][_0x918b('0x9')]({'port':0x232a});config[_0x918b('0xa')]=_[_0x918b('0xb')](config[_0x918b('0xa')],{'host':_0x918b('0xc'),'port':0x18eb});var socket=require(_0x918b('0xd'))(new Redis(config[_0x918b('0xa')]));require('./openchannelInteraction.socket')[_0x918b('0xe')](socket);function respondWithRpcPromise(_0xacf277,_0x15697d,_0x94336f){return new BPromise(function(_0x511b17,_0x170176){return client[_0x918b('0xf')](_0xacf277,_0x94336f)['then'](function(_0x402840){logger[_0x918b('0x10')](_0x918b('0x11'),_0x15697d,_0x918b('0x12'));logger[_0x918b('0x13')](_0x918b('0x14'),_0x15697d,_0x918b('0x12'),JSON[_0x918b('0x15')](_0x402840));if(_0x402840[_0x918b('0x16')]){if(_0x402840[_0x918b('0x16')][_0x918b('0x17')]===0x1f4){logger['error'](_0x918b('0x11'),_0x15697d,_0x402840['error']['message']);return _0x170176(_0x402840[_0x918b('0x16')][_0x918b('0x18')]);}logger[_0x918b('0x16')](_0x918b('0x11'),_0x15697d,_0x402840[_0x918b('0x16')][_0x918b('0x18')]);return _0x511b17(_0x402840[_0x918b('0x16')][_0x918b('0x18')]);}else{logger[_0x918b('0x10')](_0x918b('0x11'),_0x15697d,_0x918b('0x12'));_0x511b17(_0x402840[_0x918b('0x19')][_0x918b('0x18')]);}})['catch'](function(_0xeafe94){logger[_0x918b('0x16')](_0x918b('0x11'),_0x15697d,_0xeafe94);_0x170176(_0xeafe94);});});}exports[_0x918b('0x1a')]=function(_0x167751){var _0x25468f=this;return new Promise(function(_0x330d00,_0x195cc5){return db[_0x918b('0x1b')][_0x918b('0x1c')](_0x167751['body'],{'raw':_0x167751[_0x918b('0x1d')]?_0x167751[_0x918b('0x1d')][_0x918b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x167751[_0x918b('0x1d')]?_0x167751['options'][_0x918b('0x1f')]||null:null,'attributes':_0x167751[_0x918b('0x1d')]?_0x167751[_0x918b('0x1d')][_0x918b('0x20')]||null:null,'limit':_0x167751[_0x918b('0x1d')]?_0x167751[_0x918b('0x1d')]['limit']||null:null})[_0x918b('0x21')](function(_0x44f50a){logger[_0x918b('0x10')]('UpdateOpenchannelInteraction',_0x167751);logger[_0x918b('0x13')](_0x918b('0x1a'),_0x167751,JSON[_0x918b('0x15')](_0x44f50a));_0x330d00(_0x44f50a);})['catch'](function(_0x15da0e){logger['error'](_0x918b('0x1a'),_0x15da0e[_0x918b('0x18')],_0x167751);_0x195cc5(_0x25468f['error'](0x1f4,_0x15da0e[_0x918b('0x18')]));});});};exports[_0x918b('0x22')]=function(_0x5f2166){return new Promise(function(_0x586606,_0x429f5b){return db['OpenchannelInteraction'][_0x918b('0x23')]({'where':_0x5f2166[_0x918b('0x1d')]?_0x5f2166[_0x918b('0x1d')]['where']||null:null})[_0x918b('0x21')](function(_0x461c52){if(_0x461c52){return _0x461c52[_0x918b('0x24')](_0x5f2166[_0x918b('0x25')][_0x918b('0x26')],_[_0x918b('0x27')](_0x5f2166['body'],[_0x918b('0x26'),'id'])||{});}})[_0x918b('0x28')](function(_0x513ea7){logger[_0x918b('0x10')](_0x918b('0x29'),_0x5f2166);logger['debug'](_0x918b('0x29'),_0x5f2166,JSON[_0x918b('0x15')](_0x513ea7));_0x586606(_0x513ea7);})['catch'](function(_0x1f7ad0){logger['error']('AddTags',_0x1f7ad0[_0x918b('0x18')],_0x5f2166);_0x429f5b(_this[_0x918b('0x16')](0x1f4,_0x1f7ad0[_0x918b('0x18')]));});});}; \ No newline at end of file +var _0x99bd=['options','raw','where','limit','find','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body'];(function(_0x1c8d0a,_0x39f7c4){var _0x20fdf3=function(_0x458a15){while(--_0x458a15){_0x1c8d0a['push'](_0x1c8d0a['shift']());}};_0x20fdf3(++_0x39f7c4);}(_0x99bd,0xc5));var _0xd99b=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x99bd[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require(_0xd99b('0x0'));var moment=require(_0xd99b('0x1'));var BPromise=require(_0xd99b('0x2'));var rs=require(_0xd99b('0x3'));var fs=require('fs');var Redis=require(_0xd99b('0x4'));var db=require(_0xd99b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd99b('0x6'))(_0xd99b('0x7'));var config=require(_0xd99b('0x8'));var jayson=require(_0xd99b('0x9'));var client=jayson[_0xd99b('0xa')][_0xd99b('0xb')]({'port':0x232a});config[_0xd99b('0xc')]=_[_0xd99b('0xd')](config['redis'],{'host':_0xd99b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd99b('0xc')]));require('./openchannelInteraction.socket')[_0xd99b('0xf')](socket);function respondWithRpcPromise(_0x5e8db9,_0x297e72,_0x457b0d){return new BPromise(function(_0x4ce649,_0x48012a){return client[_0xd99b('0x10')](_0x5e8db9,_0x457b0d)[_0xd99b('0x11')](function(_0x2a9a1b){logger[_0xd99b('0x12')](_0xd99b('0x13'),_0x297e72,_0xd99b('0x14'));logger[_0xd99b('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x297e72,_0xd99b('0x14'),JSON[_0xd99b('0x16')](_0x2a9a1b));if(_0x2a9a1b['error']){if(_0x2a9a1b[_0xd99b('0x17')][_0xd99b('0x18')]===0x1f4){logger['error'](_0xd99b('0x13'),_0x297e72,_0x2a9a1b[_0xd99b('0x17')][_0xd99b('0x19')]);return _0x48012a(_0x2a9a1b['error'][_0xd99b('0x19')]);}logger[_0xd99b('0x17')](_0xd99b('0x13'),_0x297e72,_0x2a9a1b['error']['message']);return _0x4ce649(_0x2a9a1b[_0xd99b('0x17')][_0xd99b('0x19')]);}else{logger[_0xd99b('0x12')](_0xd99b('0x13'),_0x297e72,_0xd99b('0x14'));_0x4ce649(_0x2a9a1b[_0xd99b('0x1a')][_0xd99b('0x19')]);}})[_0xd99b('0x1b')](function(_0x33165b){logger[_0xd99b('0x17')](_0xd99b('0x13'),_0x297e72,_0x33165b);_0x48012a(_0x33165b);});});}exports[_0xd99b('0x1c')]=function(_0x3beb10){var _0x2b407b=this;return new Promise(function(_0x45f6e6,_0x565918){return db[_0xd99b('0x1d')]['update'](_0x3beb10[_0xd99b('0x1e')],{'raw':_0x3beb10[_0xd99b('0x1f')]?_0x3beb10[_0xd99b('0x1f')][_0xd99b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3beb10[_0xd99b('0x1f')]?_0x3beb10[_0xd99b('0x1f')][_0xd99b('0x21')]||null:null,'attributes':_0x3beb10[_0xd99b('0x1f')]?_0x3beb10[_0xd99b('0x1f')]['attributes']||null:null,'limit':_0x3beb10['options']?_0x3beb10[_0xd99b('0x1f')][_0xd99b('0x22')]||null:null})[_0xd99b('0x11')](function(_0x593e76){logger['info'](_0xd99b('0x1c'),_0x3beb10);logger[_0xd99b('0x15')]('UpdateOpenchannelInteraction',_0x3beb10,JSON[_0xd99b('0x16')](_0x593e76));_0x45f6e6(_0x593e76);})[_0xd99b('0x1b')](function(_0x56b1df){logger[_0xd99b('0x17')](_0xd99b('0x1c'),_0x56b1df['message'],_0x3beb10);_0x565918(_0x2b407b[_0xd99b('0x17')](0x1f4,_0x56b1df[_0xd99b('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x32097c){return new Promise(function(_0x1506af,_0x4e6725){return db['OpenchannelInteraction'][_0xd99b('0x23')]({'where':_0x32097c[_0xd99b('0x1f')]?_0x32097c[_0xd99b('0x1f')][_0xd99b('0x21')]||null:null})[_0xd99b('0x11')](function(_0x548976){if(_0x548976){return _0x548976['addTags'](_0x32097c['body']['ids'],_['omit'](_0x32097c[_0xd99b('0x1e')],['ids','id'])||{});}})[_0xd99b('0x24')](function(_0x108b6d){logger[_0xd99b('0x12')](_0xd99b('0x25'),_0x32097c);logger[_0xd99b('0x15')](_0xd99b('0x25'),_0x32097c,JSON['stringify'](_0x108b6d));_0x1506af(_0x108b6d);})[_0xd99b('0x1b')](function(_0x4c2e29){logger['error']('AddTags',_0x4c2e29['message'],_0x32097c);_0x4e6725(_this[_0xd99b('0x17')](0x1f4,_0x4c2e29[_0xd99b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 3aad25d..2b5d19e 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 _0x48d9=['removeListener','register','openchannelInteraction:','save','remove','update','emit'];(function(_0x21b40f,_0x2ebb33){var _0x94b34a=function(_0x5baab4){while(--_0x5baab4){_0x21b40f['push'](_0x21b40f['shift']());}};_0x94b34a(++_0x2ebb33);}(_0x48d9,0x8f));var _0x948d=function(_0x87413c,_0x34c62b){_0x87413c=_0x87413c-0x0;var _0x4018e2=_0x48d9[_0x87413c];return _0x4018e2;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x948d('0x0'),_0x948d('0x1'),_0x948d('0x2')];function createListener(_0x5dfed0,_0x8df431){return function(_0x293842){_0x8df431[_0x948d('0x3')](_0x5dfed0,_0x293842);};}function removeListener(_0x904c60,_0x5d7a9e){return function(){OpenchannelInteractionEvents[_0x948d('0x4')](_0x904c60,_0x5d7a9e);};}exports[_0x948d('0x5')]=function(_0x5a5f67){for(var _0x7bd82c=0x0,_0x40be29=events['length'];_0x7bd82c<_0x40be29;_0x7bd82c++){var _0x8e66df=events[_0x7bd82c];var _0x531016=createListener(_0x948d('0x6')+_0x8e66df,_0x5a5f67);OpenchannelInteractionEvents['on'](_0x8e66df,_0x531016);}}; \ No newline at end of file +var _0x9378=['save','remove','update','emit','removeListener','register','length','./openchannelInteraction.events'];(function(_0x245f95,_0x185462){var _0x1e09ce=function(_0x1f955a){while(--_0x1f955a){_0x245f95['push'](_0x245f95['shift']());}};_0x1e09ce(++_0x185462);}(_0x9378,0xb7));var _0x8937=function(_0x5cdea1,_0x2a5435){_0x5cdea1=_0x5cdea1-0x0;var _0xcf563d=_0x9378[_0x5cdea1];return _0xcf563d;};'use strict';var OpenchannelInteractionEvents=require(_0x8937('0x0'));var events=[_0x8937('0x1'),_0x8937('0x2'),_0x8937('0x3')];function createListener(_0x3720bd,_0x5b6507){return function(_0x461048){_0x5b6507[_0x8937('0x4')](_0x3720bd,_0x461048);};}function removeListener(_0x25c56a,_0x32a021){return function(){OpenchannelInteractionEvents[_0x8937('0x5')](_0x25c56a,_0x32a021);};}exports[_0x8937('0x6')]=function(_0x5b2cb6){for(var _0xd93040=0x0,_0x5a9550=events[_0x8937('0x7')];_0xd93040<_0x5a9550;_0xd93040++){var _0x4e37bd=events[_0xd93040];var _0xaec618=createListener('openchannelInteraction:'+_0x4e37bd,_0x5b2cb6);OpenchannelInteractionEvents['on'](_0x4e37bd,_0xaec618);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 78648cf..def6994 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x384182,_0x4b9b3d){var _0x5461c8=function(_0x24d021){while(--_0x24d021){_0x384182['push'](_0x384182['shift']());}};_0x5461c8(++_0x4b9b3d);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x126d3c,_0x4a1720){var _0x40bb3f=function(_0x1d2f3d){while(--_0x1d2f3d){_0x126d3c['push'](_0x126d3c['shift']());}};_0x40bb3f(++_0x4a1720);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 454a6a5..fcb1717 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 _0x4b6c=['TEXT','sequelize','exports','medium','BOOLEAN','out','DATE'];(function(_0x1448bf,_0x2baca5){var _0x370f8c=function(_0x4c7345){while(--_0x4c7345){_0x1448bf['push'](_0x1448bf['shift']());}};_0x370f8c(++_0x2baca5);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc4b6('0x0'));module[_0xc4b6('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc4b6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc4b6('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc4b6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc4b6('0x4')),'defaultValue':_0xc4b6('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc4b6('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc4b6('0x6')]}}; \ No newline at end of file +var _0x1d21=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x1d21,0x158));var _0x11d2=function(_0x25ba6a,_0x4422d6){_0x25ba6a=_0x25ba6a-0x0;var _0x1be09a=_0x1d21[_0x25ba6a];return _0x1be09a;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'body':{'type':Sequelize[_0x11d2('0x2')](_0x11d2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x11d2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d2('0x5')]('in',_0x11d2('0x6')),'defaultValue':_0x11d2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x11d2('0x7')]},'providerResponse':{'type':Sequelize[_0x11d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 83e3f74..738aafe 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 _0xe1ae=['[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','json','undefined','offset','count','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','OpenchannelMessage','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','create','body','describe','openchannel-interactions','openchannel','read','readAt','format','UserId','get','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction'];(function(_0x25eaf8,_0x958c7a){var _0x5f2f29=function(_0x115d7d){while(--_0x115d7d){_0x25eaf8['push'](_0x25eaf8['shift']());}};_0x5f2f29(++_0x958c7a);}(_0xe1ae,0x137));var _0xee1a=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0xe1ae[_0x9db5d3];return _0x477a81;};'use strict';var emlformat=require(_0xee1a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee1a('0x1'));var jsonpatch=require(_0xee1a('0x2'));var rp=require(_0xee1a('0x3'));var moment=require(_0xee1a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee1a('0x5'));var util=require(_0xee1a('0x6'));var path=require(_0xee1a('0x7'));var sox=require('sox');var csv=require(_0xee1a('0x8'));var ejs=require(_0xee1a('0x9'));var fs=require('fs');var fs_extra=require(_0xee1a('0xa'));var _=require(_0xee1a('0xb'));var squel=require(_0xee1a('0xc'));var crypto=require(_0xee1a('0xd'));var jsforce=require(_0xee1a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee1a('0xf'));var Papa=require(_0xee1a('0x10'));var Redis=require(_0xee1a('0x11'));var authService=require(_0xee1a('0x12'));var qs=require(_0xee1a('0x13'));var as=require(_0xee1a('0x14'));var hardwareService=require(_0xee1a('0x15'));var logger=require(_0xee1a('0x16'))(_0xee1a('0x17'));var utils=require(_0xee1a('0x18'));var config=require(_0xee1a('0x19'));var licenseUtil=require(_0xee1a('0x1a'));var db=require(_0xee1a('0x1b'))['db'];config[_0xee1a('0x1c')]=_[_0xee1a('0x1d')](config[_0xee1a('0x1c')],{'host':_0xee1a('0x1e'),'port':0x18eb});var socket=require(_0xee1a('0x1f'))(new Redis(config['redis']));require(_0xee1a('0x20'))[_0xee1a('0x21')](socket);var jayson=require(_0xee1a('0x22'));var client=jayson[_0xee1a('0x23')][_0xee1a('0x24')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f0c3f,_0x121fbc,_0x256246,_0x2b7f22){return new BPromise(function(_0x586e7a,_0x58457b){var _0x504f41=_0x2b7f22||client;return _0x504f41[_0xee1a('0x25')](_0x4f0c3f,_0x256246)[_0xee1a('0x26')](function(_0x504d8b){logger[_0xee1a('0x27')](_0xee1a('0x28'),_0x121fbc,_0xee1a('0x29'));logger[_0xee1a('0x2a')](_0xee1a('0x2b'),_0x121fbc,_0xee1a('0x29'),JSON[_0xee1a('0x2c')](_0x504d8b));if(_0x504d8b['error']){if(_0x504d8b['error'][_0xee1a('0x2d')]===0x1f4){logger[_0xee1a('0x2e')](_0xee1a('0x28'),_0x121fbc,_0x504d8b[_0xee1a('0x2e')][_0xee1a('0x2f')]);return _0x58457b(_0x504d8b[_0xee1a('0x2e')][_0xee1a('0x2f')]);}logger[_0xee1a('0x2e')]('OpenchannelMessage,\x20%s,\x20%s',_0x121fbc,_0x504d8b[_0xee1a('0x2e')]['message']);return _0x586e7a(_0x504d8b['error'][_0xee1a('0x2f')]);}else{logger[_0xee1a('0x27')](_0xee1a('0x28'),_0x121fbc,_0xee1a('0x29'));_0x586e7a(_0x504d8b[_0xee1a('0x30')]['message']);}})[_0xee1a('0x31')](function(_0x300a31){logger[_0xee1a('0x2e')](_0xee1a('0x28'),_0x121fbc,_0x300a31);_0x58457b(_0x300a31);});});}function respondWithStatusCode(_0xad1b2f,_0x403201){_0x403201=_0x403201||0xcc;return function(_0x317942){if(_0x317942){return _0xad1b2f['sendStatus'](_0x403201);}return _0xad1b2f[_0xee1a('0x32')](_0x403201)['end']();};}function respondWithResult(_0x606c27,_0x45a4ea){_0x45a4ea=_0x45a4ea||0xc8;return function(_0x4bb7a5){if(_0x4bb7a5){return _0x606c27[_0xee1a('0x32')](_0x45a4ea)[_0xee1a('0x33')](_0x4bb7a5);}};}function respondWithFilteredResult(_0x11f8e5,_0x2fbc36){return function(_0x464cb5){if(_0x464cb5){var _0x2de60e=typeof _0x2fbc36['offset']===_0xee1a('0x34')&&typeof _0x2fbc36['limit']===_0xee1a('0x34');var _0x310ee5=_0x464cb5['count'];var _0xaca959=_0x2de60e?0x0:_0x2fbc36[_0xee1a('0x35')];var _0x246477=_0x2de60e?_0x464cb5[_0xee1a('0x36')]:_0x2fbc36[_0xee1a('0x35')]+_0x2fbc36[_0xee1a('0x37')];var _0x22fc4a;if(_0x246477>=_0x310ee5){_0x246477=_0x310ee5;_0x22fc4a=0xc8;}else{_0x22fc4a=0xce;}_0x11f8e5[_0xee1a('0x32')](_0x22fc4a);return _0x11f8e5[_0xee1a('0x38')](_0xee1a('0x39'),_0xaca959+'-'+_0x246477+'/'+_0x310ee5)[_0xee1a('0x33')](_0x464cb5);}return null;};}function patchUpdates(_0x3169fc){return function(_0xbdde4f){try{jsonpatch['apply'](_0xbdde4f,_0x3169fc,!![]);}catch(_0x3f096b){return BPromise[_0xee1a('0x3a')](_0x3f096b);}return _0xbdde4f[_0xee1a('0x3b')]();};}function saveUpdates(_0x120684,_0x3309ad){return function(_0xaf227f){if(_0xaf227f){return _0xaf227f[_0xee1a('0x3c')](_0x120684)[_0xee1a('0x26')](function(_0x40afec){return _0x40afec;});}return null;};}function removeEntity(_0x27e483,_0x17f480){return function(_0x2d9a64){if(_0x2d9a64){return _0x2d9a64[_0xee1a('0x3d')]()[_0xee1a('0x26')](function(){_0x27e483[_0xee1a('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26e3ed,_0xa5a8d7){return function(_0x32ceba){if(!_0x32ceba){_0x26e3ed[_0xee1a('0x3e')](0x194);}return _0x32ceba;};}function handleError(_0x48f2de,_0x1f49c1){_0x1f49c1=_0x1f49c1||0x1f4;return function(_0x31432d){logger[_0xee1a('0x2e')](_0x31432d[_0xee1a('0x3f')]);if(_0x31432d[_0xee1a('0x40')]){delete _0x31432d[_0xee1a('0x40')];}_0x48f2de[_0xee1a('0x32')](_0x1f49c1)[_0xee1a('0x41')](_0x31432d);};}exports['index']=function(_0x46a0f1,_0x393b1c){var _0x391dc1={},_0x198cb7={},_0x10249e={'count':0x0,'rows':[]};var _0x4a876c=_['map'](db[_0xee1a('0x42')][_0xee1a('0x43')],function(_0x487415){return{'name':_0x487415[_0xee1a('0x44')],'type':_0x487415['type'][_0xee1a('0x45')]};});_0x198cb7['model']=_[_0xee1a('0x46')](_0x4a876c,'name');_0x198cb7['query']=_[_0xee1a('0x47')](_0x46a0f1[_0xee1a('0x48')]);_0x198cb7[_0xee1a('0x49')]=_[_0xee1a('0x4a')](_0x198cb7[_0xee1a('0x4b')],_0x198cb7['query']);_0x391dc1['attributes']=_[_0xee1a('0x4a')](_0x198cb7[_0xee1a('0x4b')],qs[_0xee1a('0x4c')](_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x4c')]));_0x391dc1[_0xee1a('0x4d')]=_0x391dc1[_0xee1a('0x4d')]['length']?_0x391dc1['attributes']:_0x198cb7[_0xee1a('0x4b')];if(!_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x4e')](_0xee1a('0x4f'))){_0x391dc1[_0xee1a('0x37')]=qs[_0xee1a('0x37')](_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x37')]);_0x391dc1[_0xee1a('0x35')]=qs['offset'](_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x35')]);}_0x391dc1[_0xee1a('0x50')]=qs[_0xee1a('0x51')](_0x46a0f1['query']['sort']);_0x391dc1[_0xee1a('0x52')]=qs['filters'](_['pick'](_0x46a0f1[_0xee1a('0x48')],_0x198cb7[_0xee1a('0x49')]),_0x4a876c);if(_0x46a0f1['query']['filter']){_0x391dc1[_0xee1a('0x52')]=_[_0xee1a('0x53')](_0x391dc1['where'],{'$or':_['map'](_0x4a876c,function(_0x58801e){if(_0x58801e[_0xee1a('0x54')]!==_0xee1a('0x55')){var _0x20fa9d={};_0x20fa9d[_0x58801e[_0xee1a('0x40')]]={'$like':'%'+_0x46a0f1[_0xee1a('0x48')]['filter']+'%'};return _0x20fa9d;}})});}_0x391dc1=_[_0xee1a('0x53')]({},_0x391dc1,_0x46a0f1['options']);var _0x8020a7={'where':_0x391dc1[_0xee1a('0x52')]};return db[_0xee1a('0x42')]['count'](_0x8020a7)['then'](function(_0x3ddc4b){_0x10249e[_0xee1a('0x36')]=_0x3ddc4b;if(_0x46a0f1[_0xee1a('0x48')][_0xee1a('0x56')]){_0x391dc1['include']=[{'all':!![]}];}return db[_0xee1a('0x42')][_0xee1a('0x57')](_0x391dc1);})[_0xee1a('0x26')](function(_0x25a381){_0x10249e[_0xee1a('0x58')]=_0x25a381;return _0x10249e;})['then'](respondWithFilteredResult(_0x393b1c,_0x391dc1))[_0xee1a('0x31')](handleError(_0x393b1c,null));};exports[_0xee1a('0x59')]=function(_0x2b0d4b,_0x5a0325){var _0x468374={'raw':!![],'where':{'id':_0x2b0d4b[_0xee1a('0x5a')]['id']}},_0x3cf1f6={};_0x3cf1f6[_0xee1a('0x4b')]=_[_0xee1a('0x47')](db[_0xee1a('0x42')][_0xee1a('0x43')]);_0x3cf1f6[_0xee1a('0x48')]=_[_0xee1a('0x47')](_0x2b0d4b[_0xee1a('0x48')]);_0x3cf1f6[_0xee1a('0x49')]=_[_0xee1a('0x4a')](_0x3cf1f6[_0xee1a('0x4b')],_0x3cf1f6['query']);_0x468374[_0xee1a('0x4d')]=_[_0xee1a('0x4a')](_0x3cf1f6['model'],qs[_0xee1a('0x4c')](_0x2b0d4b[_0xee1a('0x48')][_0xee1a('0x4c')]));_0x468374[_0xee1a('0x4d')]=_0x468374['attributes']['length']?_0x468374[_0xee1a('0x4d')]:_0x3cf1f6[_0xee1a('0x4b')];if(_0x2b0d4b[_0xee1a('0x48')][_0xee1a('0x56')]){_0x468374[_0xee1a('0x5b')]=[{'all':!![]}];}_0x468374=_[_0xee1a('0x53')]({},_0x468374,_0x2b0d4b[_0xee1a('0x5c')]);return db[_0xee1a('0x42')][_0xee1a('0x5d')](_0x468374)['then'](handleEntityNotFound(_0x5a0325,null))[_0xee1a('0x26')](respondWithResult(_0x5a0325,null))['catch'](handleError(_0x5a0325,null));};exports[_0xee1a('0x5e')]=function(_0x14c5f6,_0x432f5b){return db['OpenchannelMessage']['create'](_0x14c5f6['body'],{})[_0xee1a('0x26')](respondWithResult(_0x432f5b,0xc9))[_0xee1a('0x31')](handleError(_0x432f5b,null));};exports[_0xee1a('0x3c')]=function(_0xaceb05,_0x4da456){if(_0xaceb05['body']['id']){delete _0xaceb05[_0xee1a('0x5f')]['id'];}return db['OpenchannelMessage'][_0xee1a('0x5d')]({'where':{'id':_0xaceb05[_0xee1a('0x5a')]['id']}})[_0xee1a('0x26')](handleEntityNotFound(_0x4da456,null))['then'](saveUpdates(_0xaceb05[_0xee1a('0x5f')],null))['then'](respondWithResult(_0x4da456,null))[_0xee1a('0x31')](handleError(_0x4da456,null));};exports[_0xee1a('0x3d')]=function(_0x13b0a0,_0x36aa1e){return db[_0xee1a('0x42')][_0xee1a('0x5d')]({'where':{'id':_0x13b0a0[_0xee1a('0x5a')]['id']}})[_0xee1a('0x26')](handleEntityNotFound(_0x36aa1e,null))[_0xee1a('0x26')](removeEntity(_0x36aa1e,null))['catch'](handleError(_0x36aa1e,null));};exports[_0xee1a('0x60')]=function(_0x105726,_0x529407){return db['OpenchannelMessage'][_0xee1a('0x60')]()['then'](respondWithResult(_0x529407,null))['catch'](handleError(_0x529407,null));};var interaction_log=require(_0xee1a('0x16'))(_0xee1a('0x61'));exports['accept']=function(_0x7e92c2,_0x52a9ec,_0x5f4449){var _0x436fba={'agent':{},'channel':_0xee1a('0x62')};if(_0x7e92c2['body']['id']){delete _0x7e92c2[_0xee1a('0x5f')]['id'];}_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x63')]=!![];_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x64')]=moment()[_0xee1a('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')]=_0x7e92c2['body']['UserId']||_0x7e92c2['user']['id'];_0x436fba['agent']['id']=_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')];return db[_0xee1a('0x42')][_0xee1a('0x5d')]({'where':{'id':_0x7e92c2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52a9ec,null))[_0xee1a('0x26')](saveUpdates(_0x7e92c2[_0xee1a('0x5f')],null))[_0xee1a('0x26')](function(_0xaf110b){if(_0xaf110b){_0x436fba[_0xee1a('0x2f')]=_0xaf110b[_0xee1a('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0xee1a('0x5d')]({'where':{'id':_0xaf110b[_0xee1a('0x68')]}});}return null;})[_0xee1a('0x26')](handleEntityNotFound(_0x52a9ec,null))[_0xee1a('0x26')](function(_0x451285){if(_0x451285){return _0x451285[_0xee1a('0x3c')]({'UserId':_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')],'read1stAt':_[_0xee1a('0x69')](_0x451285[_0xee1a('0x6a')])?moment()[_0xee1a('0x65')](_0xee1a('0x6b')):undefined});}return null;})[_0xee1a('0x26')](function(_0x2875c1){if(_0x2875c1){_0x436fba[_0xee1a('0x6c')]=_0x2875c1['get']({'plain':!![]});interaction_log[_0xee1a('0x27')](_0xee1a('0x6d'),_0x7e92c2['user']['id'],_0x7e92c2[_0xee1a('0x6e')][_0xee1a('0x40')],_0x7e92c2[_0xee1a('0x6e')][_0xee1a('0x6f')],_0x436fba[_0xee1a('0x6c')]['id'],_0x7e92c2[_0xee1a('0x5f')]?JSON[_0xee1a('0x2c')](_0x7e92c2[_0xee1a('0x5f')]):_0xee1a('0x70'));return respondWithRpcPromise('AcceptMessage',_0xee1a('0x71'),_0x436fba);}return null;})[_0xee1a('0x26')](function(_0x238e65){var _0x1a6ba9=_0xee1a('0x72')+_0x238e65[_0xee1a('0x2f')][_0xee1a('0x73')];return db[_0xee1a('0x74')][_0xee1a('0x48')](_0x1a6ba9,{'type':db[_0xee1a('0x75')][_0xee1a('0x76')][_0xee1a('0x77')],'raw':!![]})[_0xee1a('0x26')](function(_0x42976b){return _0x42976b;});})[_0xee1a('0x26')](function(_0x48deed){if(_0x48deed){_0x436fba['message'][_0xee1a('0x78')]=_0x48deed[0x0];if(!_0x7e92c2['body'][_0xee1a('0x66')])return;return db[_0xee1a('0x79')][_0xee1a('0x5d')]({'where':{'id':_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x66')],'role':'agent'},'attributes':['id',_0xee1a('0x40'),_0xee1a('0x7a'),_0xee1a('0x7b'),_0xee1a('0x7c')],'raw':!![]});}return null;})['then'](function(_0x4a15a2){if(!_0x4a15a2)return null;_0x436fba[_0xee1a('0x2f')][_0xee1a('0x7d')]=_0x4a15a2;return _0x436fba;})[_0xee1a('0x26')](function(_0x35af59){if(_0x35af59){if(_0x7e92c2[_0xee1a('0x5f')][_0xee1a('0x7e')]){_0x436fba[_0xee1a('0x2f')][_0xee1a('0x7f')]=util[_0xee1a('0x65')](_0xee1a('0x80'),_0x7e92c2[_0xee1a('0x6e')][_0xee1a('0x40')]);_0x436fba[_0xee1a('0x2f')][_0xee1a('0x81')]=_0x436fba[_0xee1a('0x81')];_0x436fba['message'][_0xee1a('0x82')]=_0x436fba[_0xee1a('0x81')];_0x436fba[_0xee1a('0x2f')][_0xee1a('0x83')]=_0xee1a('0x84');return respondWithRpcPromise(_0xee1a('0x85'),_0xee1a('0x85'),{'event':_0xee1a('0x86'),'message':_0x436fba[_0xee1a('0x2f')]},client9002)[_0xee1a('0x26')](function(){return _0x436fba;});}return _0x436fba;}return null;})[_0xee1a('0x26')](respondWithResult(_0x52a9ec,null))[_0xee1a('0x31')](handleError(_0x52a9ec,null));};var interaction_log=require(_0xee1a('0x16'))(_0xee1a('0x61'));exports['reject']=function(_0x460a1f,_0x42cdee,_0x250432){var _0x43b500={'agent':{},'channel':_0xee1a('0x62')};if(_0x460a1f[_0xee1a('0x5f')]['id']){delete _0x460a1f[_0xee1a('0x5f')]['id'];}_0x460a1f[_0xee1a('0x5f')][_0xee1a('0x66')]=_0x460a1f['body']['UserId']||_0x460a1f['user']['id'];_0x43b500[_0xee1a('0x7d')]['id']=_0x460a1f[_0xee1a('0x5f')]['UserId'];return db[_0xee1a('0x42')][_0xee1a('0x5d')]({'where':{'id':_0x460a1f['params']['id'],'UserId':null}})[_0xee1a('0x26')](handleEntityNotFound(_0x42cdee,null))['then'](function(_0x8d74ca){if(_0x8d74ca){_0x43b500[_0xee1a('0x2f')]=_0x8d74ca['get']({'plain':!![]});return db[_0xee1a('0x87')][_0xee1a('0x5d')]({'where':{'id':_0x8d74ca['OpenchannelInteractionId']}});}return null;})[_0xee1a('0x26')](handleEntityNotFound(_0x42cdee,null))[_0xee1a('0x26')](function(_0x48e5ed){if(_0x48e5ed){_0x43b500[_0xee1a('0x6c')]=_0x48e5ed['get']({'plain':!![]});interaction_log[_0xee1a('0x27')](_0xee1a('0x88'),_0x460a1f['user']['id'],_0x460a1f['user'][_0xee1a('0x40')],_0x460a1f[_0xee1a('0x6e')]['role'],_0x43b500['interaction']['id'],_0x460a1f['body']?JSON['stringify'](_0x460a1f[_0xee1a('0x5f')]):_0xee1a('0x70'));return respondWithRpcPromise(_0xee1a('0x89'),_0xee1a('0x8a'),_0x43b500);}return null;})['then'](function(_0x23a4fd){var _0x1617a6=_0xee1a('0x72')+_0x23a4fd[_0xee1a('0x2f')][_0xee1a('0x73')];return db['sequelize'][_0xee1a('0x48')](_0x1617a6,{'type':db['Sequelize'][_0xee1a('0x76')][_0xee1a('0x77')],'raw':!![]})[_0xee1a('0x26')](function(_0x2a8fcc){return _0x2a8fcc;});})[_0xee1a('0x26')](function(_0x3a0455){if(_0x3a0455){_0x43b500[_0xee1a('0x2f')][_0xee1a('0x78')]=_0x3a0455[0x0];if(!_0x460a1f['body']['UserId'])return;return db[_0xee1a('0x79')]['find']({'where':{'id':_0x460a1f[_0xee1a('0x5f')][_0xee1a('0x66')],'role':_0xee1a('0x7d')},'attributes':['id',_0xee1a('0x40'),_0xee1a('0x7a'),_0xee1a('0x7b'),'internal'],'raw':!![]});}return null;})[_0xee1a('0x26')](function(_0x11b2f0){if(!_0x11b2f0)return null;_0x43b500[_0xee1a('0x2f')][_0xee1a('0x7d')]=_0x11b2f0;return _0x43b500;})[_0xee1a('0x26')](function(_0x15b641){if(_0x15b641){_0x15b641[_0xee1a('0x2f')][_0xee1a('0x7f')]=util['format'](_0xee1a('0x80'),_0x460a1f[_0xee1a('0x6e')][_0xee1a('0x40')]);_0x15b641['message']['channel']=_0x43b500[_0xee1a('0x81')];_0x15b641[_0xee1a('0x2f')][_0xee1a('0x82')]=_0x43b500[_0xee1a('0x81')];_0x15b641[_0xee1a('0x2f')][_0xee1a('0x83')]=_0xee1a('0x3a');respondWithRpcPromise('EventManager','EventManager',{'event':_0xee1a('0x8b'),'message':_0x15b641[_0xee1a('0x2f')]},client9002);return _0x43b500;}return null;})[_0xee1a('0x26')](respondWithResult(_0x42cdee,null))['catch'](handleError(_0x42cdee,null));}; \ No newline at end of file +var _0x5da0=['hasOwnProperty','nolimit','sort','pick','filter','where','map','VIRTUAL','merge','options','includeAll','include','rows','params','length','find','create','body','destroy','describe','../../config/logger','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','agent','email','channel','motionChannel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','fullname','internal','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter','register','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','end','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5da0,0x1be));var _0x05da=function(_0x17cb36,_0x3cfc3e){_0x17cb36=_0x17cb36-0x0;var _0x3ae236=_0x5da0[_0x17cb36];return _0x3ae236;};'use strict';var emlformat=require(_0x05da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05da('0x1'));var jsonpatch=require(_0x05da('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x05da('0x3'));var Mustache=require(_0x05da('0x4'));var util=require(_0x05da('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x05da('0x6'));var ejs=require(_0x05da('0x7'));var fs=require('fs');var fs_extra=require(_0x05da('0x8'));var _=require('lodash');var squel=require(_0x05da('0x9'));var crypto=require(_0x05da('0xa'));var jsforce=require(_0x05da('0xb'));var deskjs=require(_0x05da('0xc'));var toCsv=require(_0x05da('0x6'));var querystring=require(_0x05da('0xd'));var Papa=require(_0x05da('0xe'));var Redis=require(_0x05da('0xf'));var authService=require(_0x05da('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x05da('0x11'));var hardwareService=require(_0x05da('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x05da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x05da('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x05da('0x15')](config[_0x05da('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x05da('0x17'))(new Redis(config[_0x05da('0x16')]));require('./openchannelMessage.socket')[_0x05da('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x05da('0x19')][_0x05da('0x1a')]({'port':0x232c});var client9002=jayson[_0x05da('0x19')][_0x05da('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4be144,_0x3cf9a0,_0x12cb21,_0x4c4944){return new BPromise(function(_0x4adcd0,_0xb5f26){var _0x590b65=_0x4c4944||client;return _0x590b65['request'](_0x4be144,_0x12cb21)[_0x05da('0x1b')](function(_0x19e6e1){logger[_0x05da('0x1c')](_0x05da('0x1d'),_0x3cf9a0,_0x05da('0x1e'));logger[_0x05da('0x1f')](_0x05da('0x20'),_0x3cf9a0,'request\x20sent',JSON['stringify'](_0x19e6e1));if(_0x19e6e1[_0x05da('0x21')]){if(_0x19e6e1[_0x05da('0x21')][_0x05da('0x22')]===0x1f4){logger[_0x05da('0x21')](_0x05da('0x1d'),_0x3cf9a0,_0x19e6e1['error'][_0x05da('0x23')]);return _0xb5f26(_0x19e6e1[_0x05da('0x21')]['message']);}logger[_0x05da('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x3cf9a0,_0x19e6e1['error'][_0x05da('0x23')]);return _0x4adcd0(_0x19e6e1[_0x05da('0x21')][_0x05da('0x23')]);}else{logger[_0x05da('0x1c')](_0x05da('0x1d'),_0x3cf9a0,_0x05da('0x1e'));_0x4adcd0(_0x19e6e1[_0x05da('0x24')][_0x05da('0x23')]);}})[_0x05da('0x25')](function(_0x1fd43d){logger[_0x05da('0x21')](_0x05da('0x1d'),_0x3cf9a0,_0x1fd43d);_0xb5f26(_0x1fd43d);});});}function respondWithStatusCode(_0x140ae7,_0x4ced0f){_0x4ced0f=_0x4ced0f||0xcc;return function(_0x3554be){if(_0x3554be){return _0x140ae7['sendStatus'](_0x4ced0f);}return _0x140ae7['status'](_0x4ced0f)['end']();};}function respondWithResult(_0x561e5f,_0x50bff1){_0x50bff1=_0x50bff1||0xc8;return function(_0x31342a){if(_0x31342a){return _0x561e5f[_0x05da('0x26')](_0x50bff1)[_0x05da('0x27')](_0x31342a);}};}function respondWithFilteredResult(_0x226f2b,_0x1d9cba){return function(_0x3b61e5){if(_0x3b61e5){var _0x7409ff=typeof _0x1d9cba['offset']===_0x05da('0x28')&&typeof _0x1d9cba[_0x05da('0x29')]===_0x05da('0x28');var _0x18dc93=_0x3b61e5[_0x05da('0x2a')];var _0xf8ccbc=_0x7409ff?0x0:_0x1d9cba['offset'];var _0x43a993=_0x7409ff?_0x3b61e5['count']:_0x1d9cba[_0x05da('0x2b')]+_0x1d9cba[_0x05da('0x29')];var _0x551688;if(_0x43a993>=_0x18dc93){_0x43a993=_0x18dc93;_0x551688=0xc8;}else{_0x551688=0xce;}_0x226f2b['status'](_0x551688);return _0x226f2b[_0x05da('0x2c')](_0x05da('0x2d'),_0xf8ccbc+'-'+_0x43a993+'/'+_0x18dc93)[_0x05da('0x27')](_0x3b61e5);}return null;};}function patchUpdates(_0x1f39c5){return function(_0x3b0ae8){try{jsonpatch[_0x05da('0x2e')](_0x3b0ae8,_0x1f39c5,!![]);}catch(_0x2ca9d5){return BPromise[_0x05da('0x2f')](_0x2ca9d5);}return _0x3b0ae8['save']();};}function saveUpdates(_0x4b3f1d,_0x10e685){return function(_0x3eafdb){if(_0x3eafdb){return _0x3eafdb[_0x05da('0x30')](_0x4b3f1d)['then'](function(_0x3dabd5){return _0x3dabd5;});}return null;};}function removeEntity(_0x580e4c,_0x3aa171){return function(_0xdf238){if(_0xdf238){return _0xdf238['destroy']()[_0x05da('0x1b')](function(){_0x580e4c['status'](0xcc)[_0x05da('0x31')]();});}};}function handleEntityNotFound(_0x2c89ae,_0x33e1dc){return function(_0x577889){if(!_0x577889){_0x2c89ae['sendStatus'](0x194);}return _0x577889;};}function handleError(_0x5a15c6,_0x220332){_0x220332=_0x220332||0x1f4;return function(_0x411b75){logger['error'](_0x411b75[_0x05da('0x32')]);if(_0x411b75[_0x05da('0x33')]){delete _0x411b75[_0x05da('0x33')];}_0x5a15c6['status'](_0x220332)[_0x05da('0x34')](_0x411b75);};}exports[_0x05da('0x35')]=function(_0x2d0731,_0x3046b7){var _0x381827={},_0x157d57={},_0x2fac1c={'count':0x0,'rows':[]};var _0x5d4871=_['map'](db[_0x05da('0x36')][_0x05da('0x37')],function(_0x275a08){return{'name':_0x275a08[_0x05da('0x38')],'type':_0x275a08[_0x05da('0x39')][_0x05da('0x3a')]};});_0x157d57[_0x05da('0x3b')]=_['map'](_0x5d4871,'name');_0x157d57['query']=_[_0x05da('0x3c')](_0x2d0731[_0x05da('0x3d')]);_0x157d57[_0x05da('0x3e')]=_[_0x05da('0x3f')](_0x157d57['model'],_0x157d57[_0x05da('0x3d')]);_0x381827[_0x05da('0x40')]=_['intersection'](_0x157d57[_0x05da('0x3b')],qs['fields'](_0x2d0731[_0x05da('0x3d')][_0x05da('0x41')]));_0x381827[_0x05da('0x40')]=_0x381827[_0x05da('0x40')]['length']?_0x381827[_0x05da('0x40')]:_0x157d57['model'];if(!_0x2d0731[_0x05da('0x3d')][_0x05da('0x42')](_0x05da('0x43'))){_0x381827[_0x05da('0x29')]=qs[_0x05da('0x29')](_0x2d0731[_0x05da('0x3d')][_0x05da('0x29')]);_0x381827[_0x05da('0x2b')]=qs['offset'](_0x2d0731['query'][_0x05da('0x2b')]);}_0x381827['order']=qs['sort'](_0x2d0731[_0x05da('0x3d')][_0x05da('0x44')]);_0x381827['where']=qs['filters'](_[_0x05da('0x45')](_0x2d0731['query'],_0x157d57[_0x05da('0x3e')]),_0x5d4871);if(_0x2d0731[_0x05da('0x3d')][_0x05da('0x46')]){_0x381827['where']=_['merge'](_0x381827[_0x05da('0x47')],{'$or':_[_0x05da('0x48')](_0x5d4871,function(_0x3bf25d){if(_0x3bf25d[_0x05da('0x39')]!==_0x05da('0x49')){var _0x23bc21={};_0x23bc21[_0x3bf25d[_0x05da('0x33')]]={'$like':'%'+_0x2d0731[_0x05da('0x3d')]['filter']+'%'};return _0x23bc21;}})});}_0x381827=_[_0x05da('0x4a')]({},_0x381827,_0x2d0731[_0x05da('0x4b')]);var _0x1c62d2={'where':_0x381827[_0x05da('0x47')]};return db['OpenchannelMessage'][_0x05da('0x2a')](_0x1c62d2)[_0x05da('0x1b')](function(_0x24238a){_0x2fac1c[_0x05da('0x2a')]=_0x24238a;if(_0x2d0731[_0x05da('0x3d')][_0x05da('0x4c')]){_0x381827[_0x05da('0x4d')]=[{'all':!![]}];}return db[_0x05da('0x36')]['findAll'](_0x381827);})[_0x05da('0x1b')](function(_0x1ea733){_0x2fac1c[_0x05da('0x4e')]=_0x1ea733;return _0x2fac1c;})[_0x05da('0x1b')](respondWithFilteredResult(_0x3046b7,_0x381827))['catch'](handleError(_0x3046b7,null));};exports['show']=function(_0x46f4e2,_0x7d56e7){var _0x425039={'raw':!![],'where':{'id':_0x46f4e2[_0x05da('0x4f')]['id']}},_0x3d8922={};_0x3d8922[_0x05da('0x3b')]=_[_0x05da('0x3c')](db[_0x05da('0x36')]['rawAttributes']);_0x3d8922[_0x05da('0x3d')]=_[_0x05da('0x3c')](_0x46f4e2[_0x05da('0x3d')]);_0x3d8922[_0x05da('0x3e')]=_[_0x05da('0x3f')](_0x3d8922[_0x05da('0x3b')],_0x3d8922[_0x05da('0x3d')]);_0x425039[_0x05da('0x40')]=_[_0x05da('0x3f')](_0x3d8922[_0x05da('0x3b')],qs['fields'](_0x46f4e2[_0x05da('0x3d')][_0x05da('0x41')]));_0x425039[_0x05da('0x40')]=_0x425039['attributes'][_0x05da('0x50')]?_0x425039[_0x05da('0x40')]:_0x3d8922[_0x05da('0x3b')];if(_0x46f4e2[_0x05da('0x3d')][_0x05da('0x4c')]){_0x425039[_0x05da('0x4d')]=[{'all':!![]}];}_0x425039=_['merge']({},_0x425039,_0x46f4e2['options']);return db[_0x05da('0x36')][_0x05da('0x51')](_0x425039)['then'](handleEntityNotFound(_0x7d56e7,null))[_0x05da('0x1b')](respondWithResult(_0x7d56e7,null))[_0x05da('0x25')](handleError(_0x7d56e7,null));};exports[_0x05da('0x52')]=function(_0x4d33dc,_0x834759){return db['OpenchannelMessage']['create'](_0x4d33dc[_0x05da('0x53')],{})[_0x05da('0x1b')](respondWithResult(_0x834759,0xc9))[_0x05da('0x25')](handleError(_0x834759,null));};exports[_0x05da('0x30')]=function(_0x146310,_0x3bce9a){if(_0x146310[_0x05da('0x53')]['id']){delete _0x146310[_0x05da('0x53')]['id'];}return db[_0x05da('0x36')]['find']({'where':{'id':_0x146310[_0x05da('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3bce9a,null))['then'](saveUpdates(_0x146310['body'],null))[_0x05da('0x1b')](respondWithResult(_0x3bce9a,null))[_0x05da('0x25')](handleError(_0x3bce9a,null));};exports[_0x05da('0x54')]=function(_0x31ca4e,_0x44be95){return db[_0x05da('0x36')][_0x05da('0x51')]({'where':{'id':_0x31ca4e['params']['id']}})['then'](handleEntityNotFound(_0x44be95,null))['then'](removeEntity(_0x44be95,null))[_0x05da('0x25')](handleError(_0x44be95,null));};exports['describe']=function(_0x125ba8,_0x11efb3){return db['OpenchannelMessage'][_0x05da('0x55')]()[_0x05da('0x1b')](respondWithResult(_0x11efb3,null))[_0x05da('0x25')](handleError(_0x11efb3,null));};var interaction_log=require(_0x05da('0x56'))(_0x05da('0x57'));exports['accept']=function(_0x145239,_0x2ee47e,_0x143af9){var _0x5a5187={'agent':{},'channel':_0x05da('0x58')};if(_0x145239[_0x05da('0x53')]['id']){delete _0x145239[_0x05da('0x53')]['id'];}_0x145239[_0x05da('0x53')][_0x05da('0x59')]=!![];_0x145239[_0x05da('0x53')][_0x05da('0x5a')]=moment()['format'](_0x05da('0x5b'));_0x145239[_0x05da('0x53')][_0x05da('0x5c')]=_0x145239[_0x05da('0x53')][_0x05da('0x5c')]||_0x145239[_0x05da('0x5d')]['id'];_0x5a5187['agent']['id']=_0x145239[_0x05da('0x53')]['UserId'];return db[_0x05da('0x36')][_0x05da('0x51')]({'where':{'id':_0x145239[_0x05da('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ee47e,null))[_0x05da('0x1b')](saveUpdates(_0x145239[_0x05da('0x53')],null))['then'](function(_0x154ec9){if(_0x154ec9){_0x5a5187[_0x05da('0x23')]=_0x154ec9[_0x05da('0x5e')]({'plain':!![]});return db[_0x05da('0x5f')][_0x05da('0x51')]({'where':{'id':_0x154ec9[_0x05da('0x60')]}});}return null;})[_0x05da('0x1b')](handleEntityNotFound(_0x2ee47e,null))[_0x05da('0x1b')](function(_0x43bb22){if(_0x43bb22){return _0x43bb22[_0x05da('0x30')]({'UserId':_0x145239[_0x05da('0x53')][_0x05da('0x5c')],'read1stAt':_[_0x05da('0x61')](_0x43bb22[_0x05da('0x62')])?moment()[_0x05da('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x05da('0x1b')](function(_0x3e9c73){if(_0x3e9c73){_0x5a5187[_0x05da('0x64')]=_0x3e9c73[_0x05da('0x5e')]({'plain':!![]});interaction_log['info'](_0x05da('0x65'),_0x145239[_0x05da('0x5d')]['id'],_0x145239['user']['name'],_0x145239[_0x05da('0x5d')][_0x05da('0x66')],_0x5a5187[_0x05da('0x64')]['id'],_0x145239[_0x05da('0x53')]?JSON[_0x05da('0x67')](_0x145239[_0x05da('0x53')]):_0x05da('0x68'));return respondWithRpcPromise(_0x05da('0x69'),_0x05da('0x6a'),_0x5a5187);}return null;})[_0x05da('0x1b')](function(_0x4f4cd7){var _0x4b81c0=_0x05da('0x6b')+_0x4f4cd7[_0x05da('0x23')][_0x05da('0x6c')];return db[_0x05da('0x6d')][_0x05da('0x3d')](_0x4b81c0,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x05da('0x1b')](function(_0x36196c){return _0x36196c;});})['then'](function(_0x21ab0f){if(_0x21ab0f){_0x5a5187[_0x05da('0x23')][_0x05da('0x6e')]=_0x21ab0f[0x0];if(!_0x145239['body']['UserId'])return;return db[_0x05da('0x6f')][_0x05da('0x51')]({'where':{'id':_0x145239[_0x05da('0x53')][_0x05da('0x5c')],'role':_0x05da('0x70')},'attributes':['id',_0x05da('0x33'),'fullname',_0x05da('0x71'),'internal'],'raw':!![]});}return null;})[_0x05da('0x1b')](function(_0x3763f6){if(!_0x3763f6)return null;_0x5a5187[_0x05da('0x23')][_0x05da('0x70')]=_0x3763f6;return _0x5a5187;})['then'](function(_0x31b6a5){if(_0x31b6a5){if(_0x145239['body']['manual']){_0x5a5187[_0x05da('0x23')]['interface']=util[_0x05da('0x63')]('SIP/%s',_0x145239[_0x05da('0x5d')]['name']);_0x5a5187[_0x05da('0x23')]['channel']=_0x5a5187[_0x05da('0x72')];_0x5a5187['message'][_0x05da('0x73')]=_0x5a5187[_0x05da('0x72')];_0x5a5187[_0x05da('0x23')][_0x05da('0x74')]=_0x05da('0x75');return respondWithRpcPromise(_0x05da('0x76'),'EventManager',{'event':_0x05da('0x77'),'message':_0x5a5187['message']},client9002)[_0x05da('0x1b')](function(){return _0x5a5187;});}return _0x5a5187;}return null;})[_0x05da('0x1b')](respondWithResult(_0x2ee47e,null))[_0x05da('0x25')](handleError(_0x2ee47e,null));};var interaction_log=require(_0x05da('0x56'))(_0x05da('0x57'));exports[_0x05da('0x2f')]=function(_0x1ddba6,_0x292105,_0x4896d3){var _0x26ff76={'agent':{},'channel':'openchannel'};if(_0x1ddba6[_0x05da('0x53')]['id']){delete _0x1ddba6[_0x05da('0x53')]['id'];}_0x1ddba6[_0x05da('0x53')][_0x05da('0x5c')]=_0x1ddba6['body'][_0x05da('0x5c')]||_0x1ddba6['user']['id'];_0x26ff76['agent']['id']=_0x1ddba6[_0x05da('0x53')][_0x05da('0x5c')];return db[_0x05da('0x36')]['find']({'where':{'id':_0x1ddba6[_0x05da('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x292105,null))[_0x05da('0x1b')](function(_0x207f30){if(_0x207f30){_0x26ff76[_0x05da('0x23')]=_0x207f30[_0x05da('0x5e')]({'plain':!![]});return db[_0x05da('0x5f')]['find']({'where':{'id':_0x207f30[_0x05da('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x292105,null))[_0x05da('0x1b')](function(_0x29f8c0){if(_0x29f8c0){_0x26ff76['interaction']=_0x29f8c0['get']({'plain':!![]});interaction_log[_0x05da('0x1c')](_0x05da('0x78'),_0x1ddba6[_0x05da('0x5d')]['id'],_0x1ddba6[_0x05da('0x5d')][_0x05da('0x33')],_0x1ddba6[_0x05da('0x5d')][_0x05da('0x66')],_0x26ff76[_0x05da('0x64')]['id'],_0x1ddba6[_0x05da('0x53')]?JSON[_0x05da('0x67')](_0x1ddba6[_0x05da('0x53')]):'null');return respondWithRpcPromise(_0x05da('0x79'),_0x05da('0x7a'),_0x26ff76);}return null;})[_0x05da('0x1b')](function(_0x5129a2){var _0x5b25df=_0x05da('0x6b')+_0x5129a2[_0x05da('0x23')][_0x05da('0x6c')];return db[_0x05da('0x6d')][_0x05da('0x3d')](_0x5b25df,{'type':db['Sequelize']['QueryTypes'][_0x05da('0x7b')],'raw':!![]})['then'](function(_0x4109b7){return _0x4109b7;});})[_0x05da('0x1b')](function(_0x43fa75){if(_0x43fa75){_0x26ff76[_0x05da('0x23')][_0x05da('0x6e')]=_0x43fa75[0x0];if(!_0x1ddba6[_0x05da('0x53')]['UserId'])return;return db['User'][_0x05da('0x51')]({'where':{'id':_0x1ddba6[_0x05da('0x53')][_0x05da('0x5c')],'role':'agent'},'attributes':['id',_0x05da('0x33'),_0x05da('0x7c'),'email',_0x05da('0x7d')],'raw':!![]});}return null;})[_0x05da('0x1b')](function(_0x168f64){if(!_0x168f64)return null;_0x26ff76[_0x05da('0x23')][_0x05da('0x70')]=_0x168f64;return _0x26ff76;})['then'](function(_0x5c0ce5){if(_0x5c0ce5){_0x5c0ce5['message']['interface']=util['format'](_0x05da('0x7e'),_0x1ddba6[_0x05da('0x5d')][_0x05da('0x33')]);_0x5c0ce5['message'][_0x05da('0x72')]=_0x26ff76[_0x05da('0x72')];_0x5c0ce5[_0x05da('0x23')]['motionChannel']=_0x26ff76[_0x05da('0x72')];_0x5c0ce5['message'][_0x05da('0x74')]=_0x05da('0x2f');respondWithRpcPromise(_0x05da('0x76'),_0x05da('0x76'),{'event':_0x05da('0x7f'),'message':_0x5c0ce5[_0x05da('0x23')]},client9002);return _0x26ff76;}return null;})['then'](respondWithResult(_0x292105,null))[_0x05da('0x25')](handleError(_0x292105,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 3b0167e..9217a22 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 _0xeef2=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x14e833,_0x1ffc79){var _0x31195d=function(_0xbcfb12){while(--_0xbcfb12){_0x14e833['push'](_0x14e833['shift']());}};_0x31195d(++_0x1ffc79);}(_0xeef2,0xb1));var _0x2eef=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xeef2[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x2eef('0x0'));var OpenchannelMessage=require(_0x2eef('0x1'))['db'][_0x2eef('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2eef('0x3')](0x0);var events={'afterCreate':_0x2eef('0x4'),'afterUpdate':_0x2eef('0x5'),'afterDestroy':_0x2eef('0x6')};function emitEvent(_0x4bfc0c){return function(_0x357ae4,_0x4de6ff,_0x1e7d6f){OpenchannelMessageEvents['emit'](_0x4bfc0c+':'+_0x357ae4['id'],_0x357ae4);OpenchannelMessageEvents[_0x2eef('0x7')](_0x4bfc0c,_0x357ae4);_0x1e7d6f(null);};}for(var e in events){if(events[_0x2eef('0x8')](e)){var event=events[e];OpenchannelMessage[_0x2eef('0x9')](e,emitEvent(event));}}module[_0x2eef('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xda38=['hasOwnProperty','exports','events','OpenchannelMessage','remove','emit'];(function(_0xed34b9,_0x268465){var _0x47f64b=function(_0x40c13f){while(--_0x40c13f){_0xed34b9['push'](_0xed34b9['shift']());}};_0x47f64b(++_0x268465);}(_0xda38,0x14c));var _0x8da3=function(_0x29b929,_0x2a4b10){_0x29b929=_0x29b929-0x0;var _0x3a8ce6=_0xda38[_0x29b929];return _0x3a8ce6;};'use strict';var EventEmitter=require(_0x8da3('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x8da3('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8da3('0x2')};function emitEvent(_0x8355b5){return function(_0x959f32,_0x587cec,_0x1f569d){OpenchannelMessageEvents[_0x8da3('0x3')](_0x8355b5+':'+_0x959f32['id'],_0x959f32);OpenchannelMessageEvents['emit'](_0x8355b5,_0x959f32);_0x1f569d(null);};}for(var e in events){if(events[_0x8da3('0x4')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x8da3('0x5')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 6451f42..e8a6308 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 _0x4b63=['POST','info','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','OpenchannelInteractionId','update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelInteraction','Interactions','keys','then','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','method','GET'];(function(_0x2ea4d4,_0x15af14){var _0x1ef235=function(_0x260c1a){while(--_0x260c1a){_0x2ea4d4['push'](_0x2ea4d4['shift']());}};_0x1ef235(++_0x15af14);}(_0x4b63,0x199));var _0x34b6=function(_0x377cce,_0x3b4f48){_0x377cce=_0x377cce-0x0;var _0x256bc9=_0x4b63[_0x377cce];return _0x256bc9;};'use strict';var _=require(_0x34b6('0x0'));var util=require(_0x34b6('0x1'));var logger=require('../../config/logger')(_0x34b6('0x2'));var moment=require(_0x34b6('0x3'));var BPromise=require(_0x34b6('0x4'));var rp=require(_0x34b6('0x5'));var fs=require('fs');var path=require(_0x34b6('0x6'));var rimraf=require('rimraf');var config=require(_0x34b6('0x7'));var attributes=require(_0x34b6('0x8'));module['exports']=function(_0x8f6f0f,_0x1f7c6f){return _0x8f6f0f['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x34b6('0x9'),'fields':[_0x34b6('0xa')],'type':_0x34b6('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e7dea,_0x5d9094,_0x243a15){var _0x20bf26=_0x8f6f0f[_0x34b6('0xc')];var _0x2709cc=_0x4e7dea[_0x34b6('0xd')]({'plain':!![]});if(_0x2709cc[_0x34b6('0xe')]['toLowerCase']()==='in'||_0x2709cc['direction']['toLowerCase']()===_0x34b6('0xf')&&!_0x2709cc[_0x34b6('0x10')]&&!_[_0x34b6('0x11')](_0x2709cc[_0x34b6('0x12')])){_0x20bf26['OpenchannelInteraction']['findOne']({'where':{'id':_0x2709cc[_0x34b6('0x13')]}})['then'](function(_0x24dd8c){if(_0x24dd8c){_0x24dd8c[_0x34b6('0x14')]({'lastMsgAt':_0x2709cc[_0x34b6('0x15')],'lastMsgDirection':_0x2709cc[_0x34b6('0xe')]['toLowerCase']()});}})[_0x34b6('0x16')](function(_0x242baf){console['error'](_0x242baf);});}if(_0x2709cc['direction']===_0x34b6('0xf')&&!_0x2709cc[_0x34b6('0x10')]){var _0x1cc619;_0x20bf26[_0x34b6('0x17')][_0x34b6('0x18')]()['then'](function(_0x5f1f5d){return _0x20bf26[_0x34b6('0x19')][_0x34b6('0x1a')]({'where':{'id':_0x2709cc['OpenchannelAccountId']},'include':[{'model':_0x20bf26[_0x34b6('0x1b')],'as':_0x34b6('0x1c'),'where':{'id':_0x2709cc['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x20bf26[_0x34b6('0x17')],'as':'Contact','attributes':_[_0x34b6('0x1d')](_0x5f1f5d)}]}]});})[_0x34b6('0x1e')](function(_0x3c0f7e){_0x1cc619=_0x3c0f7e[_0x34b6('0xd')]({'plain':!![]});if(_0x1cc619&&_0x1cc619[_0x34b6('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x34b6('0x20'),util[_0x34b6('0x21')](_0x34b6('0x22'),_0x2709cc['id'],_0x1cc619[_0x34b6('0x1f')]));if(_0x1cc619['Interactions']&&_0x1cc619['Interactions'][_0x34b6('0x23')]){_0x2709cc[_0x34b6('0x24')]=_[_0x34b6('0x25')](_0x1cc619[_0x34b6('0x1c')][0x0],_0x34b6('0x26'));_0x2709cc['Contact']=_0x1cc619[_0x34b6('0x1c')][0x0][_0x34b6('0x26')];}var _0x5d9094={'method':'POST','uri':encodeURI(_0x1cc619[_0x34b6('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5d9094[_0x34b6('0x27')]){case _0x34b6('0x28'):_0x5d9094['qs']=_0x2709cc;break;case _0x34b6('0x29'):_0x5d9094[_0x34b6('0xa')]=_0x2709cc;break;}return rp(_0x5d9094)[_0x34b6('0x1e')](function(_0x196b83){logger[_0x34b6('0x2a')](_0x34b6('0x2b'),_0x34b6('0x20'),util[_0x34b6('0x21')](_0x34b6('0x2c'),_0x2709cc['id'],_0x1cc619[_0x34b6('0x1f')]));if(_0x196b83[_0x34b6('0xa')][_0x34b6('0x2d')]&&_0x196b83['body'][_0x34b6('0x2d')]!=_0x2709cc[_0x34b6('0x24')][_0x34b6('0x2d')]){return _0x20bf26['OpenchannelInteraction'][_0x34b6('0x14')]({'threadId':_0x196b83[_0x34b6('0xa')][_0x34b6('0x2d')]},{'where':{'id':_0x2709cc[_0x34b6('0x24')]['id']}});}else{return;}})[_0x34b6('0x1e')](function(){return _0x4e7dea[_0x34b6('0x14')]({'read':!![]});})[_0x34b6('0x16')](function(_0x46ae2b){logger[_0x34b6('0x2e')]('OpenchannelMessage,\x20%s,\x20%s',_0x34b6('0x20'),util[_0x34b6('0x2f')](_0x46ae2b,{'showHidden':![],'depth':null}));_0x243a15();});}else{_0x243a15();}})['finally'](function(){_0x243a15();});}else{_0x243a15();}}},'charset':_0x34b6('0x30'),'collate':_0x34b6('0x31')});}; \ No newline at end of file +var _0x3ec3=['describe','find','OpenchannelAccountId','Interactions','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','catch','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','error','CmContact'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3ec3,0x17e));var _0x33ec=function(_0x4f96ac,_0x18dc01){_0x4f96ac=_0x4f96ac-0x0;var _0x33bd52=_0x3ec3[_0x4f96ac];return _0x33bd52;};'use strict';var _=require(_0x33ec('0x0'));var util=require(_0x33ec('0x1'));var logger=require(_0x33ec('0x2'))(_0x33ec('0x3'));var moment=require(_0x33ec('0x4'));var BPromise=require(_0x33ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33ec('0x6'));var rimraf=require(_0x33ec('0x7'));var config=require(_0x33ec('0x8'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x7d57df,_0x18868b){return _0x7d57df[_0x33ec('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x33ec('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x33ec('0xb')],'type':_0x33ec('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47d037,_0x16a63b,_0x1b8566){var _0x251da9=_0x7d57df['models'];var _0x2e962c=_0x47d037[_0x33ec('0xd')]({'plain':!![]});if(_0x2e962c[_0x33ec('0xe')]['toLowerCase']()==='in'||_0x2e962c[_0x33ec('0xe')][_0x33ec('0xf')]()===_0x33ec('0x10')&&!_0x2e962c[_0x33ec('0x11')]&&!_[_0x33ec('0x12')](_0x2e962c[_0x33ec('0x13')])){_0x251da9[_0x33ec('0x14')][_0x33ec('0x15')]({'where':{'id':_0x2e962c[_0x33ec('0x16')]}})[_0x33ec('0x17')](function(_0x25bc2d){if(_0x25bc2d){_0x25bc2d['update']({'lastMsgAt':_0x2e962c['createdAt'],'lastMsgDirection':_0x2e962c[_0x33ec('0xe')][_0x33ec('0xf')]()});}})['catch'](function(_0x4e52fa){console[_0x33ec('0x18')](_0x4e52fa);});}if(_0x2e962c[_0x33ec('0xe')]===_0x33ec('0x10')&&!_0x2e962c[_0x33ec('0x11')]){var _0xca1c37;_0x251da9[_0x33ec('0x19')][_0x33ec('0x1a')]()[_0x33ec('0x17')](function(_0x5806c5){return _0x251da9['OpenchannelAccount'][_0x33ec('0x1b')]({'where':{'id':_0x2e962c[_0x33ec('0x1c')]},'include':[{'model':_0x251da9[_0x33ec('0x14')],'as':_0x33ec('0x1d'),'where':{'id':_0x2e962c['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x251da9['CmContact'],'as':'Contact','attributes':_[_0x33ec('0x1e')](_0x5806c5)}]}]});})['then'](function(_0x3b28ab){_0xca1c37=_0x3b28ab[_0x33ec('0xd')]({'plain':!![]});if(_0xca1c37&&_0xca1c37[_0x33ec('0x1f')]){logger['info'](_0x33ec('0x20'),_0x33ec('0x21'),util[_0x33ec('0x22')](_0x33ec('0x23'),_0x2e962c['id'],_0xca1c37[_0x33ec('0x1f')]));if(_0xca1c37[_0x33ec('0x1d')]&&_0xca1c37['Interactions'][_0x33ec('0x24')]){_0x2e962c[_0x33ec('0x25')]=_[_0x33ec('0x26')](_0xca1c37[_0x33ec('0x1d')][0x0],_0x33ec('0x27'));_0x2e962c[_0x33ec('0x27')]=_0xca1c37[_0x33ec('0x1d')][0x0][_0x33ec('0x27')];}var _0x16a63b={'method':_0x33ec('0x28'),'uri':encodeURI(_0xca1c37[_0x33ec('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x16a63b[_0x33ec('0x29')]){case _0x33ec('0x2a'):_0x16a63b['qs']=_0x2e962c;break;case _0x33ec('0x28'):_0x16a63b['body']=_0x2e962c;break;}return rp(_0x16a63b)[_0x33ec('0x17')](function(_0x3b2a53){logger[_0x33ec('0x2b')](_0x33ec('0x20'),_0x33ec('0x21'),util[_0x33ec('0x22')](_0x33ec('0x2c'),_0x2e962c['id'],_0xca1c37[_0x33ec('0x1f')]));if(_0x3b2a53[_0x33ec('0xb')]['threadId']&&_0x3b2a53[_0x33ec('0xb')][_0x33ec('0x2d')]!=_0x2e962c[_0x33ec('0x25')]['threadId']){return _0x251da9[_0x33ec('0x14')][_0x33ec('0x2e')]({'threadId':_0x3b2a53['body'][_0x33ec('0x2d')]},{'where':{'id':_0x2e962c[_0x33ec('0x25')]['id']}});}else{return;}})[_0x33ec('0x17')](function(){return _0x47d037[_0x33ec('0x2e')]({'read':!![]});})[_0x33ec('0x2f')](function(_0x57ccdf){logger[_0x33ec('0x18')](_0x33ec('0x20'),_0x33ec('0x21'),util[_0x33ec('0x30')](_0x57ccdf,{'showHidden':![],'depth':null}));_0x1b8566();});}else{_0x1b8566();}})[_0x33ec('0x31')](function(){_0x1b8566();});}else{_0x1b8566();}}},'charset':_0x33ec('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6c7697b..1682b7e 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 _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1d7afc,_0xaab7ed){var _0x136b80=function(_0x331c8c){while(--_0x331c8c){_0x1d7afc['push'](_0x1d7afc['shift']());}};_0x136b80(++_0xaab7ed);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27714d,_0x457b53){_0x27714d=_0x27714d-0x0;var _0x18e2fb=_0x0b0e[_0x27714d];return _0x18e2fb;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x8faa4a,_0x56c874){var _0x563d00=function(_0x1b085f){while(--_0x1b085f){_0x8faa4a['push'](_0x8faa4a['shift']());}};_0x563d00(++_0x56c874);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index e44fcb2..b70e610 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 _0xf722=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xf722,0x18f));var _0x2f72=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf722[_0x5b644e];return _0x49c6bf;};'use strict';var OpenchannelMessageEvents=require(_0x2f72('0x0'));var events=[_0x2f72('0x1'),_0x2f72('0x2'),_0x2f72('0x3')];function createListener(_0x5e6b94,_0x23d53e){return function(_0x297070){_0x23d53e[_0x2f72('0x4')](_0x5e6b94,_0x297070);};}function removeListener(_0x418aed,_0x47d759){return function(){OpenchannelMessageEvents[_0x2f72('0x5')](_0x418aed,_0x47d759);};}exports[_0x2f72('0x6')]=function(_0x334168){for(var _0x537e3d=0x0,_0x4d4cf4=events[_0x2f72('0x7')];_0x537e3d<_0x4d4cf4;_0x537e3d++){var _0x3cb15e=events[_0x537e3d];var _0x1f3afb=createListener(_0x2f72('0x8')+_0x3cb15e,_0x334168);OpenchannelMessageEvents['on'](_0x3cb15e,_0x1f3afb);}}; \ No newline at end of file +var _0xa17b=['save','remove','update','emit','removeListener','register','length','./openchannelMessage.events'];(function(_0x588a1e,_0xba57fa){var _0x25c2d6=function(_0x238253){while(--_0x238253){_0x588a1e['push'](_0x588a1e['shift']());}};_0x25c2d6(++_0xba57fa);}(_0xa17b,0xbf));var _0xba17=function(_0x1d4ba0,_0x3d5924){_0x1d4ba0=_0x1d4ba0-0x0;var _0x3aa023=_0xa17b[_0x1d4ba0];return _0x3aa023;};'use strict';var OpenchannelMessageEvents=require(_0xba17('0x0'));var events=[_0xba17('0x1'),_0xba17('0x2'),_0xba17('0x3')];function createListener(_0x196f5f,_0x541e30){return function(_0xdea7e){_0x541e30[_0xba17('0x4')](_0x196f5f,_0xdea7e);};}function removeListener(_0x398ae8,_0x3d0b6b){return function(){OpenchannelMessageEvents[_0xba17('0x5')](_0x398ae8,_0x3d0b6b);};}exports[_0xba17('0x6')]=function(_0x15d033){for(var _0x87974a=0x0,_0x270af8=events[_0xba17('0x7')];_0x87974a<_0x270af8;_0x87974a++){var _0x12b141=events[_0x87974a];var _0x2b90bf=createListener('openchannelMessage:'+_0x12b141,_0x15d033);OpenchannelMessageEvents['on'](_0x12b141,_0x2b90bf);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 397c07b..4eb4145 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 _0x8477=['/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','get','describe','/:id','show'];(function(_0x594e7a,_0x5455af){var _0x14369d=function(_0x3f4e84){while(--_0x3f4e84){_0x594e7a['push'](_0x594e7a['shift']());}};_0x14369d(++_0x5455af);}(_0x8477,0x112));var _0x7847=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x8477[_0x1347f8];return _0x218368;};'use strict';var multer=require(_0x7847('0x0'));var util=require(_0x7847('0x1'));var path=require('path');var timeout=require(_0x7847('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7847('0x3'));var auth=require(_0x7847('0x4'));var interaction=require(_0x7847('0x5'));var config=require('../../config/environment');var controller=require(_0x7847('0x6'));router['get']('/',auth[_0x7847('0x7')](),controller['index']);router[_0x7847('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7847('0x9')]);router[_0x7847('0x8')](_0x7847('0xa'),auth[_0x7847('0x7')](),controller[_0x7847('0xb')]);router[_0x7847('0x8')](_0x7847('0xc'),auth[_0x7847('0x7')](),controller[_0x7847('0xd')]);router[_0x7847('0x8')](_0x7847('0xe'),auth[_0x7847('0x7')](),controller['getTeams']);router[_0x7847('0x8')](_0x7847('0xf'),auth[_0x7847('0x7')](),controller[_0x7847('0x10')]);router[_0x7847('0x11')]('/',auth[_0x7847('0x7')](),controller['create']);router[_0x7847('0x11')](_0x7847('0xe'),auth[_0x7847('0x7')](),controller[_0x7847('0x12')]);router[_0x7847('0x11')]('/:id/users',auth[_0x7847('0x7')](),controller[_0x7847('0x13')]);router[_0x7847('0x14')]('/:id',auth[_0x7847('0x7')](),controller[_0x7847('0x15')]);router[_0x7847('0x16')](_0x7847('0xa'),auth[_0x7847('0x7')](),controller[_0x7847('0x17')]);router[_0x7847('0x16')]('/:id/teams',auth[_0x7847('0x7')](),controller[_0x7847('0x18')]);router['delete'](_0x7847('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7847('0x19')]=router; \ No newline at end of file +var _0xa07d=['get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./openchannelQueue.controller'];(function(_0x459d30,_0x4e010e){var _0x49526c=function(_0x20772b){while(--_0x20772b){_0x459d30['push'](_0x459d30['shift']());}};_0x49526c(++_0x4e010e);}(_0xa07d,0x12d));var _0xda07=function(_0xa270f3,_0x293fd){_0xa270f3=_0xa270f3-0x0;var _0x48767f=_0xa07d[_0xa270f3];return _0x48767f;};'use strict';var multer=require('multer');var util=require(_0xda07('0x0'));var path=require(_0xda07('0x1'));var timeout=require(_0xda07('0x2'));var express=require(_0xda07('0x3'));var router=express['Router']();var fs_extra=require(_0xda07('0x4'));var auth=require(_0xda07('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xda07('0x6'));router[_0xda07('0x7')]('/',auth[_0xda07('0x8')](),controller[_0xda07('0x9')]);router[_0xda07('0x7')](_0xda07('0xa'),auth['isAuthenticated'](),controller[_0xda07('0xb')]);router[_0xda07('0x7')]('/:id',auth[_0xda07('0x8')](),controller[_0xda07('0xc')]);router[_0xda07('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0xda07('0xd')]);router[_0xda07('0x7')](_0xda07('0xe'),auth[_0xda07('0x8')](),controller[_0xda07('0xf')]);router[_0xda07('0x7')](_0xda07('0x10'),auth[_0xda07('0x8')](),controller[_0xda07('0x11')]);router[_0xda07('0x12')]('/',auth[_0xda07('0x8')](),controller['create']);router[_0xda07('0x12')](_0xda07('0xe'),auth['isAuthenticated'](),controller[_0xda07('0x13')]);router[_0xda07('0x12')]('/:id/users',auth[_0xda07('0x8')](),controller[_0xda07('0x14')]);router[_0xda07('0x15')](_0xda07('0x16'),auth[_0xda07('0x8')](),controller['update']);router[_0xda07('0x17')]('/:id',auth[_0xda07('0x8')](),controller[_0xda07('0x18')]);router[_0xda07('0x17')](_0xda07('0xe'),auth['isAuthenticated'](),controller[_0xda07('0x19')]);router[_0xda07('0x17')](_0xda07('0x10'),auth[_0xda07('0x8')](),controller[_0xda07('0x1a')]);module[_0xda07('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 3461570..ed54701 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 _0x5640=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0xe94a2c,_0x4e7fce){var _0x167d75=function(_0x2a4211){while(--_0x2a4211){_0xe94a2c['push'](_0xe94a2c['shift']());}};_0x167d75(++_0x4e7fce);}(_0x5640,0x67));var _0x0564=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5640[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x0564('0x0'));module[_0x0564('0x1')]={'name':{'type':Sequelize[_0x0564('0x2')],'unique':_0x0564('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0564('0x2')]},'timeout':{'type':Sequelize[_0x0564('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0564('0x5')](_0x0564('0x6'),_0x0564('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x23c5=['ENUM','beepall','roundrobin','sequelize','STRING'];(function(_0x193a17,_0x34bc56){var _0x271747=function(_0x217ec4){while(--_0x217ec4){_0x193a17['push'](_0x193a17['shift']());}};_0x271747(++_0x34bc56);}(_0x23c5,0x1a7));var _0x523c=function(_0x355e1e,_0x5cb353){_0x355e1e=_0x355e1e-0x0;var _0x5246d1=_0x23c5[_0x355e1e];return _0x5246d1;};'use strict';var Sequelize=require(_0x523c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x523c('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x523c('0x2')]('rrmemory',_0x523c('0x3'),_0x523c('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index dd47855..74cb670 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 _0x074d=['union','compact','removeTeams','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','order','OpenchannelQueueId','findAndCountAll','map','agent','updatedAt','createdAt','format','SIP','openchannelPause','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userOpenchannelQueue:save','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','OpenchannelQueueId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all'];(function(_0x13f353,_0x101eda){var _0x139d67=function(_0x20eef1){while(--_0x20eef1){_0x13f353['push'](_0x13f353['shift']());}};_0x139d67(++_0x101eda);}(_0x074d,0x98));var _0xd074=function(_0x58698c,_0x3f9b82){_0x58698c=_0x58698c-0x0;var _0x23bc2f=_0x074d[_0x58698c];return _0x23bc2f;};'use strict';var emlformat=require(_0xd074('0x0'));var rimraf=require(_0xd074('0x1'));var zipdir=require(_0xd074('0x2'));var jsonpatch=require(_0xd074('0x3'));var rp=require(_0xd074('0x4'));var moment=require(_0xd074('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd074('0x6'));var path=require(_0xd074('0x7'));var sox=require(_0xd074('0x8'));var csv=require(_0xd074('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd074('0xa'));var crypto=require(_0xd074('0xb'));var jsforce=require(_0xd074('0xc'));var deskjs=require(_0xd074('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd074('0xe'));var Papa=require(_0xd074('0xf'));var Redis=require(_0xd074('0x10'));var authService=require(_0xd074('0x11'));var qs=require(_0xd074('0x12'));var as=require(_0xd074('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd074('0x14'))(_0xd074('0x15'));var utils=require(_0xd074('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd074('0x17'));var db=require(_0xd074('0x18'))['db'];config['redis']=_[_0xd074('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd074('0x1a'))(new Redis(config[_0xd074('0x1b')]));require(_0xd074('0x1c'))[_0xd074('0x1d')](socket);function respondWithStatusCode(_0x55fb63,_0x2ef095){_0x2ef095=_0x2ef095||0xcc;return function(_0x3cac19){if(_0x3cac19){return _0x55fb63[_0xd074('0x1e')](_0x2ef095);}return _0x55fb63[_0xd074('0x1f')](_0x2ef095)[_0xd074('0x20')]();};}function respondWithResult(_0xb0d3d1,_0x1c22ac){_0x1c22ac=_0x1c22ac||0xc8;return function(_0x3de38f){if(_0x3de38f){return _0xb0d3d1['status'](_0x1c22ac)[_0xd074('0x21')](_0x3de38f);}};}function respondWithFilteredResult(_0x415a27,_0x3bd762){return function(_0x11b8f4){if(_0x11b8f4){var _0xe90d6f=typeof _0x3bd762[_0xd074('0x22')]===_0xd074('0x23')&&typeof _0x3bd762[_0xd074('0x24')]===_0xd074('0x23');var _0xf418da=_0x11b8f4[_0xd074('0x25')];var _0x1d0fa8=_0xe90d6f?0x0:_0x3bd762[_0xd074('0x22')];var _0xf19209=_0xe90d6f?_0x11b8f4[_0xd074('0x25')]:_0x3bd762[_0xd074('0x22')]+_0x3bd762[_0xd074('0x24')];var _0x42a2ae;if(_0xf19209>=_0xf418da){_0xf19209=_0xf418da;_0x42a2ae=0xc8;}else{_0x42a2ae=0xce;}_0x415a27['status'](_0x42a2ae);return _0x415a27['set']('Content-Range',_0x1d0fa8+'-'+_0xf19209+'/'+_0xf418da)[_0xd074('0x21')](_0x11b8f4);}return null;};}function patchUpdates(_0x1278db){return function(_0x35f374){try{jsonpatch[_0xd074('0x26')](_0x35f374,_0x1278db,!![]);}catch(_0x42cd1d){return BPromise[_0xd074('0x27')](_0x42cd1d);}return _0x35f374[_0xd074('0x28')]();};}function saveUpdates(_0x2e9240,_0x11f423){return function(_0x2d456c){if(_0x2d456c){return _0x2d456c['update'](_0x2e9240)[_0xd074('0x29')](function(_0x484b18){return _0x484b18;});}return null;};}function removeEntity(_0x461552,_0x1d97f6){return function(_0x2200aa){if(_0x2200aa){return _0x2200aa[_0xd074('0x2a')]()[_0xd074('0x29')](function(){var _0x45f72f=_0x2200aa[_0xd074('0x2b')]({'plain':!![]});var _0x1f8f75=_0xd074('0x2c');return db[_0xd074('0x2d')][_0xd074('0x2a')]({'where':{'type':_0x1f8f75,'resourceId':_0x45f72f['id']}})[_0xd074('0x29')](function(){return _0x2200aa;});})[_0xd074('0x29')](function(){_0x461552[_0xd074('0x1f')](0xcc)[_0xd074('0x20')]();});}};}function handleEntityNotFound(_0x3cfc45,_0x53f671){return function(_0x2e39ab){if(!_0x2e39ab){_0x3cfc45['sendStatus'](0x194);}return _0x2e39ab;};}function handleError(_0x400b0d,_0x2c7f39){_0x2c7f39=_0x2c7f39||0x1f4;return function(_0xef45c){logger[_0xd074('0x2e')](_0xef45c['stack']);if(_0xef45c[_0xd074('0x2f')]){delete _0xef45c['name'];}_0x400b0d['status'](_0x2c7f39)['send'](_0xef45c);};}exports['index']=function(_0x17e02f,_0x6a55e2){var _0x351449={},_0xa9b140={},_0x1e25b9={'count':0x0,'rows':[]};var _0x597e5d=_['map'](db[_0xd074('0x30')][_0xd074('0x31')],function(_0x396c19){return{'name':_0x396c19[_0xd074('0x32')],'type':_0x396c19[_0xd074('0x33')][_0xd074('0x34')]};});_0xa9b140[_0xd074('0x35')]=_['map'](_0x597e5d,_0xd074('0x2f'));_0xa9b140[_0xd074('0x36')]=_['keys'](_0x17e02f[_0xd074('0x36')]);_0xa9b140[_0xd074('0x37')]=_[_0xd074('0x38')](_0xa9b140[_0xd074('0x35')],_0xa9b140[_0xd074('0x36')]);_0x351449[_0xd074('0x39')]=_['intersection'](_0xa9b140['model'],qs[_0xd074('0x3a')](_0x17e02f[_0xd074('0x36')][_0xd074('0x3a')]));_0x351449[_0xd074('0x39')]=_0x351449[_0xd074('0x39')][_0xd074('0x3b')]?_0x351449[_0xd074('0x39')]:_0xa9b140[_0xd074('0x35')];if(!_0x17e02f[_0xd074('0x36')][_0xd074('0x3c')]('nolimit')){_0x351449[_0xd074('0x24')]=qs[_0xd074('0x24')](_0x17e02f[_0xd074('0x36')][_0xd074('0x24')]);_0x351449[_0xd074('0x22')]=qs[_0xd074('0x22')](_0x17e02f[_0xd074('0x36')][_0xd074('0x22')]);}_0x351449['order']=qs[_0xd074('0x3d')](_0x17e02f[_0xd074('0x36')][_0xd074('0x3d')]);_0x351449[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0x17e02f['query'],_0xa9b140[_0xd074('0x37')]),_0x597e5d);if(_0x17e02f[_0xd074('0x36')][_0xd074('0x40')]){_0x351449[_0xd074('0x3e')]=_['merge'](_0x351449[_0xd074('0x3e')],{'$or':_['map'](_0x597e5d,function(_0x4d7be3){if(_0x4d7be3[_0xd074('0x33')]!==_0xd074('0x41')){var _0x485dad={};_0x485dad[_0x4d7be3['name']]={'$like':'%'+_0x17e02f[_0xd074('0x36')]['filter']+'%'};return _0x485dad;}})});}_0x351449=_[_0xd074('0x42')]({},_0x351449,_0x17e02f[_0xd074('0x43')]);var _0xb81f12={'where':_0x351449[_0xd074('0x3e')]};return db[_0xd074('0x30')][_0xd074('0x25')](_0xb81f12)['then'](function(_0x595eb8){_0x1e25b9[_0xd074('0x25')]=_0x595eb8;if(_0x17e02f[_0xd074('0x36')][_0xd074('0x44')]){_0x351449[_0xd074('0x45')]=[{'all':!![]}];}return db[_0xd074('0x30')][_0xd074('0x46')](_0x351449);})[_0xd074('0x29')](function(_0x4bcf3b){_0x1e25b9[_0xd074('0x47')]=_0x4bcf3b;return _0x1e25b9;})[_0xd074('0x29')](respondWithFilteredResult(_0x6a55e2,_0x351449))[_0xd074('0x48')](handleError(_0x6a55e2,null));};exports['show']=function(_0x50cf5c,_0x599d85){var _0x146a72={'raw':!![],'where':{'id':_0x50cf5c[_0xd074('0x49')]['id']}},_0x500617={};_0x500617[_0xd074('0x35')]=_[_0xd074('0x4a')](db[_0xd074('0x30')][_0xd074('0x31')]);_0x500617['query']=_[_0xd074('0x4a')](_0x50cf5c[_0xd074('0x36')]);_0x500617[_0xd074('0x37')]=_[_0xd074('0x38')](_0x500617[_0xd074('0x35')],_0x500617[_0xd074('0x36')]);_0x146a72[_0xd074('0x39')]=_[_0xd074('0x38')](_0x500617[_0xd074('0x35')],qs['fields'](_0x50cf5c[_0xd074('0x36')][_0xd074('0x3a')]));_0x146a72[_0xd074('0x39')]=_0x146a72[_0xd074('0x39')]['length']?_0x146a72[_0xd074('0x39')]:_0x500617[_0xd074('0x35')];if(_0x50cf5c[_0xd074('0x36')][_0xd074('0x44')]){_0x146a72[_0xd074('0x45')]=[{'all':!![]}];}_0x146a72=_[_0xd074('0x42')]({},_0x146a72,_0x50cf5c['options']);return db['OpenchannelQueue']['find'](_0x146a72)[_0xd074('0x29')](handleEntityNotFound(_0x599d85,null))['then'](respondWithResult(_0x599d85,null))['catch'](handleError(_0x599d85,null));};exports[_0xd074('0x4b')]=function(_0x4e5e32,_0x3389ec){return db['OpenchannelQueue']['create'](_0x4e5e32['body'],{})[_0xd074('0x29')](function(_0x10d690){var _0x331756=_0x4e5e32['user'][_0xd074('0x2b')]({'plain':!![]});if(!_0x331756)throw new Error(_0xd074('0x4c'));if(_0x331756[_0xd074('0x4d')]===_0xd074('0x4e')){var _0x11c291=_0x10d690[_0xd074('0x2b')]({'plain':!![]});var _0x2292e2=_0xd074('0x2c');return db[_0xd074('0x4f')]['find']({'where':{'name':_0x2292e2,'userProfileId':_0x331756[_0xd074('0x50')]},'raw':!![]})[_0xd074('0x29')](function(_0xfba178){if(_0xfba178&&_0xfba178['autoAssociation']===0x0){return db['UserProfileResource'][_0xd074('0x4b')]({'name':_0x11c291[_0xd074('0x2f')],'resourceId':_0x11c291['id'],'type':_0xfba178['name'],'sectionId':_0xfba178['id']},{})[_0xd074('0x29')](function(){return _0x10d690;});}else{return _0x10d690;}})[_0xd074('0x48')](function(_0x447c23){logger['error'](_0xd074('0x51'),_0x447c23);throw _0x447c23;});}return _0x10d690;})[_0xd074('0x29')](respondWithResult(_0x3389ec,0xc9))[_0xd074('0x48')](handleError(_0x3389ec,null));};exports[_0xd074('0x52')]=function(_0x2da027,_0x1cdac7){if(_0x2da027[_0xd074('0x53')]['id']){delete _0x2da027[_0xd074('0x53')]['id'];}return db['OpenchannelQueue'][_0xd074('0x54')]({'where':{'id':_0x2da027[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x1cdac7,null))[_0xd074('0x29')](saveUpdates(_0x2da027['body'],null))[_0xd074('0x29')](respondWithResult(_0x1cdac7,null))['catch'](handleError(_0x1cdac7,null));};exports[_0xd074('0x2a')]=function(_0x20fcc7,_0x459d2f){return db[_0xd074('0x30')][_0xd074('0x54')]({'where':{'id':_0x20fcc7['params']['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x459d2f,null))['then'](removeEntity(_0x459d2f,null))[_0xd074('0x48')](handleError(_0x459d2f,null));};exports[_0xd074('0x55')]=function(_0xdae92b,_0x613fcf){return db[_0xd074('0x30')][_0xd074('0x55')]()[_0xd074('0x29')](respondWithResult(_0x613fcf,null))[_0xd074('0x48')](handleError(_0x613fcf,null));};exports[_0xd074('0x56')]=function(_0xa33fe2,_0x5baa47,_0x48442d){var _0x4c46cf={'raw':!![],'where':{}},_0x217b43={},_0x592c73;return db[_0xd074('0x30')][_0xd074('0x57')]({'where':{'id':_0xa33fe2[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x5baa47,null))[_0xd074('0x29')](function(_0x1e7b8c){if(_0x1e7b8c){_0x592c73=_0x1e7b8c[_0xd074('0x2b')]({'plain':!![]});_0x217b43[_0xd074('0x35')]=_[_0xd074('0x4a')](db[_0xd074('0x58')]['rawAttributes']);_0x217b43[_0xd074('0x36')]=_[_0xd074('0x4a')](_0xa33fe2[_0xd074('0x36')]);_0x217b43[_0xd074('0x37')]=_[_0xd074('0x38')](_0x217b43['model'],_0x217b43[_0xd074('0x36')]);_0x4c46cf[_0xd074('0x39')]=_[_0xd074('0x38')](_0x217b43[_0xd074('0x35')],qs['fields'](_0xa33fe2['query'][_0xd074('0x3a')]));_0x4c46cf[_0xd074('0x39')]=_0x4c46cf['attributes']['length']?_0x4c46cf[_0xd074('0x39')]:_0x217b43['model'];if(!_0xa33fe2['query'][_0xd074('0x3c')](_0xd074('0x59'))){_0x4c46cf['limit']=qs[_0xd074('0x24')](_0xa33fe2[_0xd074('0x36')]['limit']);_0x4c46cf[_0xd074('0x22')]=qs[_0xd074('0x22')](_0xa33fe2['query']['offset']);}_0x4c46cf[_0xd074('0x5a')]=qs['sort'](_0xa33fe2[_0xd074('0x36')][_0xd074('0x3d')]);_0x4c46cf[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0xa33fe2['query'],_0x217b43[_0xd074('0x37')]));_0x4c46cf[_0xd074('0x3e')][_0xd074('0x5b')]=_0x1e7b8c['id'];if(_0xa33fe2[_0xd074('0x36')][_0xd074('0x40')]){_0x4c46cf[_0xd074('0x3e')]=_['merge'](_0x4c46cf[_0xd074('0x3e')],{'$or':_['map'](_0x4c46cf[_0xd074('0x39')],function(_0x3a9781){var _0x5b3e22={};_0x5b3e22[_0x3a9781]={'$like':'%'+_0xa33fe2[_0xd074('0x36')][_0xd074('0x40')]+'%'};return _0x5b3e22;})});}_0x4c46cf=_[_0xd074('0x42')]({},_0x4c46cf,_0xa33fe2['options']);return db[_0xd074('0x58')][_0xd074('0x46')](_0x4c46cf);}})[_0xd074('0x29')](function(_0x191057){if(_0x191057){return db['User'][_0xd074('0x5c')]({'where':{'id':_[_0xd074('0x5d')](_0x191057,'UserId'),'role':_0xd074('0x5e')},'attributes':['id','name','openchannelPause',_0xd074('0x5f'),_0xd074('0x60')]});}})['then'](function(_0x386ea5){if(_0x386ea5){return{'count':_0x386ea5[_0xd074('0x25')],'rows':_[_0xd074('0x5d')](_0x386ea5[_0xd074('0x47')],function(_0x4c1cf0){return{'membername':_0x4c1cf0[_0xd074('0x2f')],'UserId':_0x4c1cf0['id'],'queue_name':_0x592c73['name'],'OpenchannelQueueId':_0x592c73['id'],'interface':util[_0xd074('0x61')]('%s/%s',_0xd074('0x62'),_0x4c1cf0[_0xd074('0x2f')]),'penalty':0x0,'paused':_0x4c1cf0[_0xd074('0x63')],'createdAt':_0x4c1cf0[_0xd074('0x60')],'updatedAt':_0x4c1cf0[_0xd074('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5baa47,_0x4c46cf))['catch'](handleError(_0x5baa47,null));};exports[_0xd074('0x64')]=function(_0x341201,_0x26c57f,_0x3ec3c9){var _0x18b8cf={};var _0x2e7b5d={};var _0x593945;var _0x80b9f9;return db[_0xd074('0x30')]['findOne']({'where':{'id':_0x341201[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x26c57f,null))[_0xd074('0x29')](function(_0x3e87e1){if(_0x3e87e1){_0x593945=_0x3e87e1;_0x2e7b5d[_0xd074('0x35')]=_['keys'](db[_0xd074('0x65')]['rawAttributes']);_0x2e7b5d[_0xd074('0x36')]=_[_0xd074('0x4a')](_0x341201['query']);_0x2e7b5d[_0xd074('0x37')]=_[_0xd074('0x38')](_0x2e7b5d[_0xd074('0x35')],_0x2e7b5d[_0xd074('0x36')]);_0x18b8cf[_0xd074('0x39')]=_['intersection'](_0x2e7b5d[_0xd074('0x35')],qs[_0xd074('0x3a')](_0x341201['query']['fields']));_0x18b8cf[_0xd074('0x39')]=_0x18b8cf[_0xd074('0x39')]['length']?_0x18b8cf[_0xd074('0x39')]:_0x2e7b5d[_0xd074('0x35')];_0x18b8cf[_0xd074('0x5a')]=qs[_0xd074('0x3d')](_0x341201[_0xd074('0x36')]['sort']);_0x18b8cf[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0x341201[_0xd074('0x36')],_0x2e7b5d[_0xd074('0x37')]));if(_0x341201[_0xd074('0x36')][_0xd074('0x40')]){_0x18b8cf[_0xd074('0x3e')]=_[_0xd074('0x42')](_0x18b8cf[_0xd074('0x3e')],{'$or':_[_0xd074('0x5d')](_0x18b8cf['attributes'],function(_0x214b07){var _0x2de455={};_0x2de455[_0x214b07]={'$like':'%'+_0x341201[_0xd074('0x36')][_0xd074('0x40')]+'%'};return _0x2de455;})});}_0x18b8cf=_[_0xd074('0x42')]({},_0x18b8cf,_0x341201['options']);return _0x593945[_0xd074('0x64')](_0x18b8cf);}})[_0xd074('0x29')](function(_0x1f3c41){if(_0x1f3c41){_0x80b9f9=_0x1f3c41[_0xd074('0x3b')];if(!_0x341201[_0xd074('0x36')][_0xd074('0x3c')](_0xd074('0x59'))){_0x18b8cf[_0xd074('0x24')]=qs[_0xd074('0x24')](_0x341201[_0xd074('0x36')]['limit']);_0x18b8cf[_0xd074('0x22')]=qs[_0xd074('0x22')](_0x341201[_0xd074('0x36')][_0xd074('0x22')]);}return _0x593945[_0xd074('0x64')](_0x18b8cf);}})[_0xd074('0x29')](function(_0x4bf58a){if(_0x4bf58a){return _0x4bf58a?{'count':_0x80b9f9,'rows':_0x4bf58a}:null;}})[_0xd074('0x29')](respondWithResult(_0x26c57f,null))[_0xd074('0x48')](handleError(_0x26c57f,null));};exports[_0xd074('0x66')]=function(_0x4f1796,_0x3c9ab6,_0x1e93cb){var _0x487b84=_0x4f1796['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x487b84},'attributes':['id'],'include':[{'model':db[_0xd074('0x67')],'as':_0xd074('0x68'),'attributes':['id',_0xd074('0x2f'),_0xd074('0x69'),_0xd074('0x6a'),_0xd074('0x6b')],'raw':!![]}]})[_0xd074('0x29')](function(_0x38e7b5){if(_0x38e7b5){var _0x29a00b=_[_0xd074('0x6c')](_0x38e7b5,function(_0x56a5a8){var _0x2dbfdc=_0x56a5a8[_0xd074('0x2b')]({'plain':!![]});return _0x2dbfdc['Agents'];});return db[_0xd074('0x30')]['find']({'where':{'id':_0x4f1796['params']['id']}})[_0xd074('0x29')](function(_0x2f8342){return db[_0xd074('0x6d')]['transaction'](function(_0x393f7e){return _0x2f8342['addTeams'](_0x487b84,{'transaction':_0x393f7e})[_0xd074('0x29')](function(){return BPromise[_0xd074('0x6e')](_0x29a00b,function(_0x13ec49){return db[_0xd074('0x58')][_0xd074('0x6f')]({'where':{'UserId':_0x13ec49['id'],'OpenchannelQueueId':_0x4f1796[_0xd074('0x49')]['id']},'transaction':_0x393f7e});});})[_0xd074('0x29')](function(){_0x29a00b['forEach'](function(_0x32c5c9){socket[_0xd074('0x70')](_0xd074('0x71'),{'UserId':_0x32c5c9['id'],'OpenchannelQueueId':_0x2f8342['id']});});});});});}})[_0xd074('0x29')](respondWithStatusCode(_0x3c9ab6,null))[_0xd074('0x48')](handleError(_0x3c9ab6,null));};exports['removeTeams']=function(_0x4fb3c1,_0xa11261,_0x4ba747){return db[_0xd074('0x65')][_0xd074('0x46')]({'where':{'id':_0x4fb3c1[_0xd074('0x36')][_0xd074('0x72')]},'attributes':['id'],'include':[{'model':db[_0xd074('0x67')],'as':_0xd074('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa11261,null))['then'](function(_0x4377c1){var _0x6276d4=_[_0xd074('0x5d')](_0x4377c1,'id');var _0x4d3bf6=[];var _0x1f86ee=[];var _0x4863be=squel[_0xd074('0x73')]();_0x4863be[_0xd074('0x74')](_0xd074('0x75'))[_0xd074('0x76')](_0xd074('0x77'),'tq')['join'](_0xd074('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xd074('0x79'),_0x4fb3c1[_0xd074('0x49')]['id']);for(var _0x59e06b=0x0;_0x59e06b<_0x4377c1['length'];_0x59e06b+=0x1){let _0x3dfee4=_0x4377c1[_0x59e06b];for(var _0x5a39fa=0x0;_0x5a39fa<_0x3dfee4[_0xd074('0x68')][_0xd074('0x3b')];_0x5a39fa+=0x1){let _0x488a52=_0x3dfee4[_0xd074('0x68')][_0x5a39fa];var _0x42fd55=_0x4863be['clone']();_0x42fd55[_0xd074('0x3e')]('ut.UserId\x20=\x20?',_0x488a52['id']);_0x1f86ee[_0xd074('0x7a')](db[_0xd074('0x6d')][_0xd074('0x36')](_0x42fd55['toString'](),{'type':db[_0xd074('0x6d')][_0xd074('0x7b')][_0xd074('0x7c')]})[_0xd074('0x29')](function(_0x25b2cc){if(_0x25b2cc[_0xd074('0x3b')]===0x1){return _0x488a52['id'];}else{var _0x2afce6=_[_0xd074('0x7d')](_['map'](_0x25b2cc,'TeamId'),function(_0x390234){return _[_0xd074('0x7e')](_0x6276d4,_0x390234);});if(_0x2afce6){return _0x488a52['id'];}}}));}}return BPromise[_0xd074('0x7f')](_0x1f86ee)['then'](function(_0x21939d){_0x4d3bf6=_(_0x4d3bf6)[_0xd074('0x80')](_0x21939d)[_0xd074('0x81')]()['value']();return db[_0xd074('0x30')][_0xd074('0x54')]({'where':{'id':_0x4fb3c1[_0xd074('0x49')]['id']}})['then'](function(_0x24078b){return db[_0xd074('0x6d')]['transaction'](function(_0x21c8e2){return _0x24078b[_0xd074('0x82')](_0x4fb3c1['query']['ids'],{'transaction':_0x21c8e2})[_0xd074('0x29')](function(){if(!_[_0xd074('0x83')](_0x4d3bf6)){return _0x24078b[_0xd074('0x84')](_0x4d3bf6,{'transaction':_0x21c8e2});}})['then'](function(){_0x4d3bf6[_0xd074('0x85')](function(_0x3eebe1){socket[_0xd074('0x70')](_0xd074('0x86'),{'UserId':_0x3eebe1,'OpenchannelQueueId':_0x24078b['id']});});});});});});})[_0xd074('0x29')](respondWithStatusCode(_0xa11261,null))['catch'](handleError(_0xa11261,null));};exports[_0xd074('0x87')]=function(_0x167bb6,_0x3d4f84,_0x473d1c){return db[_0xd074('0x30')][_0xd074('0x54')]({'where':{'id':_0x167bb6['params']['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x3d4f84,null))[_0xd074('0x29')](function(_0x585360){if(_0x585360){return _0x585360[_0xd074('0x87')](_0x167bb6['body']['ids'],_[_0xd074('0x88')](_0x167bb6[_0xd074('0x53')],[_0xd074('0x72'),'id'])||{})[_0xd074('0x89')](function(_0x4752d7){for(var _0x544559=0x0;_0x544559<_0x167bb6[_0xd074('0x53')][_0xd074('0x72')]['length'];_0x544559+=0x1){socket[_0xd074('0x70')](_0xd074('0x71'),{'UserId':Number(_0x167bb6['body']['ids'][_0x544559]),'OpenchannelQueueId':Number(_0x167bb6['params']['id'])});}return _0x4752d7;});}})['then'](respondWithResult(_0x3d4f84,null))[_0xd074('0x48')](handleError(_0x3d4f84,null));};exports[_0xd074('0x84')]=function(_0x3e4eb3,_0x3d3a37,_0x3feb16){return db[_0xd074('0x30')]['find']({'where':{'id':_0x3e4eb3[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x3d3a37,null))[_0xd074('0x29')](function(_0x2a543a){if(_0x2a543a){return _0x2a543a['removeAgents'](_0x3e4eb3['query'][_0xd074('0x72')])[_0xd074('0x29')](function(){if(_[_0xd074('0x8a')](_0x3e4eb3[_0xd074('0x36')][_0xd074('0x72')])){for(var _0x3bb9ff=0x0;_0x3bb9ff<_0x3e4eb3['query']['ids']['length'];_0x3bb9ff+=0x1){socket[_0xd074('0x70')](_0xd074('0x86'),{'UserId':Number(_0x3e4eb3['query'][_0xd074('0x72')][_0x3bb9ff]),'OpenchannelQueueId':Number(_0x3e4eb3[_0xd074('0x49')]['id'])});}}else{socket[_0xd074('0x70')](_0xd074('0x86'),{'UserId':Number(_0x3e4eb3[_0xd074('0x36')]['ids']),'OpenchannelQueueId':Number(_0x3e4eb3[_0xd074('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d3a37,null))[_0xd074('0x48')](handleError(_0x3d3a37,null));};exports[_0xd074('0x8b')]=function(_0x4204f8,_0x2668a0,_0x575bf1){var _0x2b0dda={};var _0x251033={};var _0x44f245;var _0xcfc7b4;return db[_0xd074('0x30')]['findOne']({'where':{'id':_0x4204f8[_0xd074('0x49')]['id']}})[_0xd074('0x29')](handleEntityNotFound(_0x2668a0,null))[_0xd074('0x29')](function(_0x72446c){if(_0x72446c){_0x44f245=_0x72446c;_0x251033[_0xd074('0x35')]=_[_0xd074('0x4a')](db[_0xd074('0x67')][_0xd074('0x31')]);_0x251033[_0xd074('0x36')]=_[_0xd074('0x4a')](_0x4204f8[_0xd074('0x36')]);_0x251033[_0xd074('0x37')]=_['intersection'](_0x251033[_0xd074('0x35')],_0x251033[_0xd074('0x36')]);_0x2b0dda['attributes']=_[_0xd074('0x38')](_0x251033['model'],qs[_0xd074('0x3a')](_0x4204f8['query'][_0xd074('0x3a')]));_0x2b0dda['attributes']=_0x2b0dda['attributes'][_0xd074('0x3b')]?_0x2b0dda[_0xd074('0x39')]:_0x251033[_0xd074('0x35')];_0x2b0dda[_0xd074('0x5a')]=qs[_0xd074('0x3d')](_0x4204f8['query'][_0xd074('0x3d')]);_0x2b0dda[_0xd074('0x3e')]=qs[_0xd074('0x37')](_[_0xd074('0x3f')](_0x4204f8[_0xd074('0x36')],_0x251033['filters']));if(_0x4204f8[_0xd074('0x36')][_0xd074('0x40')]){_0x2b0dda[_0xd074('0x3e')]=_[_0xd074('0x42')](_0x2b0dda[_0xd074('0x3e')],{'$or':_['map'](_0x2b0dda[_0xd074('0x39')],function(_0x4f98c8){var _0x30228b={};_0x30228b[_0x4f98c8]={'$like':'%'+_0x4204f8[_0xd074('0x36')][_0xd074('0x40')]+'%'};return _0x30228b;})});}_0x2b0dda=_[_0xd074('0x42')]({},_0x2b0dda,_0x4204f8[_0xd074('0x43')]);return _0x44f245[_0xd074('0x8b')](_0x2b0dda);}})['then'](function(_0xd58dce){if(_0xd58dce){_0xcfc7b4=_0xd58dce[_0xd074('0x3b')];if(!_0x4204f8[_0xd074('0x36')][_0xd074('0x3c')](_0xd074('0x59'))){_0x2b0dda['limit']=qs[_0xd074('0x24')](_0x4204f8[_0xd074('0x36')][_0xd074('0x24')]);_0x2b0dda[_0xd074('0x22')]=qs[_0xd074('0x22')](_0x4204f8['query'][_0xd074('0x22')]);}return _0x44f245['getAgents'](_0x2b0dda);}})[_0xd074('0x29')](function(_0x16b74e){if(_0x16b74e){return _0x16b74e?{'count':_0xcfc7b4,'rows':_0x16b74e}:null;}})[_0xd074('0x29')](respondWithResult(_0x2668a0,null))[_0xd074('0x48')](handleError(_0x2668a0,null));}; \ No newline at end of file +var _0xf2c4=['each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','User','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','emit','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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/license/util','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','sendStatus','undefined','limit','count','offset','Content-Range','json','reject','save','then','destroy','get','UserProfileResource','status','error','stack','name','index','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelQueue','include','show','params','rawAttributes','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','findAndCountAll','openchannelPause','updatedAt','createdAt','rows','%s/%s','SIP','findOne','Team','getTeams','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction'];(function(_0x3390b3,_0x354c9c){var _0x4befca=function(_0x114951){while(--_0x114951){_0x3390b3['push'](_0x3390b3['shift']());}};_0x4befca(++_0x354c9c);}(_0xf2c4,0xab));var _0x4f2c=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf2c4[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f2c('0x0'));var jsonpatch=require(_0x4f2c('0x1'));var rp=require(_0x4f2c('0x2'));var moment=require(_0x4f2c('0x3'));var BPromise=require(_0x4f2c('0x4'));var Mustache=require(_0x4f2c('0x5'));var util=require(_0x4f2c('0x6'));var path=require(_0x4f2c('0x7'));var sox=require(_0x4f2c('0x8'));var csv=require('to-csv');var ejs=require(_0x4f2c('0x9'));var fs=require('fs');var fs_extra=require(_0x4f2c('0xa'));var _=require(_0x4f2c('0xb'));var squel=require(_0x4f2c('0xc'));var crypto=require('crypto');var jsforce=require(_0x4f2c('0xd'));var deskjs=require(_0x4f2c('0xe'));var toCsv=require(_0x4f2c('0xf'));var querystring=require(_0x4f2c('0x10'));var Papa=require(_0x4f2c('0x11'));var Redis=require(_0x4f2c('0x12'));var authService=require(_0x4f2c('0x13'));var qs=require(_0x4f2c('0x14'));var as=require(_0x4f2c('0x15'));var hardwareService=require(_0x4f2c('0x16'));var logger=require(_0x4f2c('0x17'))(_0x4f2c('0x18'));var utils=require(_0x4f2c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4f2c('0x1a'));var db=require(_0x4f2c('0x1b'))['db'];config['redis']=_[_0x4f2c('0x1c')](config[_0x4f2c('0x1d')],{'host':_0x4f2c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4f2c('0x1f'))['register'](socket);function respondWithStatusCode(_0x3fbdd4,_0x88efda){_0x88efda=_0x88efda||0xcc;return function(_0x148446){if(_0x148446){return _0x3fbdd4[_0x4f2c('0x20')](_0x88efda);}return _0x3fbdd4['status'](_0x88efda)['end']();};}function respondWithResult(_0x545d99,_0x3be9a9){_0x3be9a9=_0x3be9a9||0xc8;return function(_0x2fef91){if(_0x2fef91){return _0x545d99['status'](_0x3be9a9)['json'](_0x2fef91);}};}function respondWithFilteredResult(_0x41d064,_0x4a9f76){return function(_0x3eb03c){if(_0x3eb03c){var _0x443057=typeof _0x4a9f76['offset']===_0x4f2c('0x21')&&typeof _0x4a9f76[_0x4f2c('0x22')]===_0x4f2c('0x21');var _0x3bf567=_0x3eb03c[_0x4f2c('0x23')];var _0x46a8b4=_0x443057?0x0:_0x4a9f76['offset'];var _0x280f58=_0x443057?_0x3eb03c[_0x4f2c('0x23')]:_0x4a9f76[_0x4f2c('0x24')]+_0x4a9f76['limit'];var _0x28682e;if(_0x280f58>=_0x3bf567){_0x280f58=_0x3bf567;_0x28682e=0xc8;}else{_0x28682e=0xce;}_0x41d064['status'](_0x28682e);return _0x41d064['set'](_0x4f2c('0x25'),_0x46a8b4+'-'+_0x280f58+'/'+_0x3bf567)[_0x4f2c('0x26')](_0x3eb03c);}return null;};}function patchUpdates(_0x1ef8fe){return function(_0x28b37b){try{jsonpatch['apply'](_0x28b37b,_0x1ef8fe,!![]);}catch(_0x1382f2){return BPromise[_0x4f2c('0x27')](_0x1382f2);}return _0x28b37b[_0x4f2c('0x28')]();};}function saveUpdates(_0x1b92b3,_0x1455a4){return function(_0x1e1503){if(_0x1e1503){return _0x1e1503['update'](_0x1b92b3)[_0x4f2c('0x29')](function(_0x51ffd2){return _0x51ffd2;});}return null;};}function removeEntity(_0x16f873,_0x3cbc3f){return function(_0x6aa815){if(_0x6aa815){return _0x6aa815[_0x4f2c('0x2a')]()[_0x4f2c('0x29')](function(){var _0x45f038=_0x6aa815[_0x4f2c('0x2b')]({'plain':!![]});var _0x3b2042='OpenchannelQueues';return db[_0x4f2c('0x2c')][_0x4f2c('0x2a')]({'where':{'type':_0x3b2042,'resourceId':_0x45f038['id']}})[_0x4f2c('0x29')](function(){return _0x6aa815;});})[_0x4f2c('0x29')](function(){_0x16f873[_0x4f2c('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ccf9,_0x3c4c2c){return function(_0x5cb924){if(!_0x5cb924){_0x25ccf9['sendStatus'](0x194);}return _0x5cb924;};}function handleError(_0x725522,_0x1e5dc1){_0x1e5dc1=_0x1e5dc1||0x1f4;return function(_0x11f7ea){logger[_0x4f2c('0x2e')](_0x11f7ea[_0x4f2c('0x2f')]);if(_0x11f7ea[_0x4f2c('0x30')]){delete _0x11f7ea[_0x4f2c('0x30')];}_0x725522['status'](_0x1e5dc1)['send'](_0x11f7ea);};}exports[_0x4f2c('0x31')]=function(_0x15253e,_0x4e8ce9){var _0x3cc5fb={},_0x6052b3={},_0x1492b5={'count':0x0,'rows':[]};var _0x4ef76f=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x20f392){return{'name':_0x20f392[_0x4f2c('0x32')],'type':_0x20f392['type'][_0x4f2c('0x33')]};});_0x6052b3[_0x4f2c('0x34')]=_[_0x4f2c('0x35')](_0x4ef76f,'name');_0x6052b3['query']=_[_0x4f2c('0x36')](_0x15253e[_0x4f2c('0x37')]);_0x6052b3[_0x4f2c('0x38')]=_[_0x4f2c('0x39')](_0x6052b3['model'],_0x6052b3[_0x4f2c('0x37')]);_0x3cc5fb['attributes']=_[_0x4f2c('0x39')](_0x6052b3[_0x4f2c('0x34')],qs[_0x4f2c('0x3a')](_0x15253e[_0x4f2c('0x37')][_0x4f2c('0x3a')]));_0x3cc5fb[_0x4f2c('0x3b')]=_0x3cc5fb[_0x4f2c('0x3b')][_0x4f2c('0x3c')]?_0x3cc5fb[_0x4f2c('0x3b')]:_0x6052b3['model'];if(!_0x15253e[_0x4f2c('0x37')]['hasOwnProperty'](_0x4f2c('0x3d'))){_0x3cc5fb['limit']=qs[_0x4f2c('0x22')](_0x15253e['query'][_0x4f2c('0x22')]);_0x3cc5fb[_0x4f2c('0x24')]=qs[_0x4f2c('0x24')](_0x15253e[_0x4f2c('0x37')][_0x4f2c('0x24')]);}_0x3cc5fb[_0x4f2c('0x3e')]=qs[_0x4f2c('0x3f')](_0x15253e[_0x4f2c('0x37')][_0x4f2c('0x3f')]);_0x3cc5fb[_0x4f2c('0x40')]=qs['filters'](_[_0x4f2c('0x41')](_0x15253e[_0x4f2c('0x37')],_0x6052b3['filters']),_0x4ef76f);if(_0x15253e[_0x4f2c('0x37')]['filter']){_0x3cc5fb['where']=_[_0x4f2c('0x42')](_0x3cc5fb[_0x4f2c('0x40')],{'$or':_[_0x4f2c('0x35')](_0x4ef76f,function(_0x4aaf54){if(_0x4aaf54['type']!==_0x4f2c('0x43')){var _0x54ed81={};_0x54ed81[_0x4aaf54[_0x4f2c('0x30')]]={'$like':'%'+_0x15253e['query'][_0x4f2c('0x44')]+'%'};return _0x54ed81;}})});}_0x3cc5fb=_[_0x4f2c('0x42')]({},_0x3cc5fb,_0x15253e[_0x4f2c('0x45')]);var _0x22e5ad={'where':_0x3cc5fb[_0x4f2c('0x40')]};return db[_0x4f2c('0x46')][_0x4f2c('0x23')](_0x22e5ad)[_0x4f2c('0x29')](function(_0x62c240){_0x1492b5['count']=_0x62c240;if(_0x15253e[_0x4f2c('0x37')]['includeAll']){_0x3cc5fb[_0x4f2c('0x47')]=[{'all':!![]}];}return db[_0x4f2c('0x46')]['findAll'](_0x3cc5fb);})[_0x4f2c('0x29')](function(_0x489d2b){_0x1492b5['rows']=_0x489d2b;return _0x1492b5;})[_0x4f2c('0x29')](respondWithFilteredResult(_0x4e8ce9,_0x3cc5fb))['catch'](handleError(_0x4e8ce9,null));};exports[_0x4f2c('0x48')]=function(_0x4aad30,_0x365ee4){var _0x1f2fff={'raw':!![],'where':{'id':_0x4aad30[_0x4f2c('0x49')]['id']}},_0x9b2092={};_0x9b2092[_0x4f2c('0x34')]=_[_0x4f2c('0x36')](db[_0x4f2c('0x46')][_0x4f2c('0x4a')]);_0x9b2092[_0x4f2c('0x37')]=_[_0x4f2c('0x36')](_0x4aad30[_0x4f2c('0x37')]);_0x9b2092['filters']=_[_0x4f2c('0x39')](_0x9b2092['model'],_0x9b2092[_0x4f2c('0x37')]);_0x1f2fff[_0x4f2c('0x3b')]=_[_0x4f2c('0x39')](_0x9b2092[_0x4f2c('0x34')],qs[_0x4f2c('0x3a')](_0x4aad30['query']['fields']));_0x1f2fff[_0x4f2c('0x3b')]=_0x1f2fff[_0x4f2c('0x3b')][_0x4f2c('0x3c')]?_0x1f2fff[_0x4f2c('0x3b')]:_0x9b2092[_0x4f2c('0x34')];if(_0x4aad30[_0x4f2c('0x37')]['includeAll']){_0x1f2fff['include']=[{'all':!![]}];}_0x1f2fff=_[_0x4f2c('0x42')]({},_0x1f2fff,_0x4aad30[_0x4f2c('0x45')]);return db[_0x4f2c('0x46')][_0x4f2c('0x4b')](_0x1f2fff)[_0x4f2c('0x29')](handleEntityNotFound(_0x365ee4,null))[_0x4f2c('0x29')](respondWithResult(_0x365ee4,null))[_0x4f2c('0x4c')](handleError(_0x365ee4,null));};exports[_0x4f2c('0x4d')]=function(_0x577b12,_0x5298cb){return db[_0x4f2c('0x46')]['create'](_0x577b12[_0x4f2c('0x4e')],{})[_0x4f2c('0x29')](function(_0x49c229){var _0x1a36b2=_0x577b12[_0x4f2c('0x4f')][_0x4f2c('0x2b')]({'plain':!![]});if(!_0x1a36b2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a36b2[_0x4f2c('0x50')]===_0x4f2c('0x4f')){var _0x1108e8=_0x49c229[_0x4f2c('0x2b')]({'plain':!![]});var _0x37e853='OpenchannelQueues';return db[_0x4f2c('0x51')][_0x4f2c('0x4b')]({'where':{'name':_0x37e853,'userProfileId':_0x1a36b2[_0x4f2c('0x52')]},'raw':!![]})[_0x4f2c('0x29')](function(_0x2ec685){if(_0x2ec685&&_0x2ec685[_0x4f2c('0x53')]===0x0){return db[_0x4f2c('0x2c')][_0x4f2c('0x4d')]({'name':_0x1108e8[_0x4f2c('0x30')],'resourceId':_0x1108e8['id'],'type':_0x2ec685[_0x4f2c('0x30')],'sectionId':_0x2ec685['id']},{})[_0x4f2c('0x29')](function(){return _0x49c229;});}else{return _0x49c229;}})[_0x4f2c('0x4c')](function(_0x38bdc0){logger[_0x4f2c('0x2e')](_0x4f2c('0x54'),_0x38bdc0);throw _0x38bdc0;});}return _0x49c229;})[_0x4f2c('0x29')](respondWithResult(_0x5298cb,0xc9))[_0x4f2c('0x4c')](handleError(_0x5298cb,null));};exports['update']=function(_0x11ca1c,_0x2df175){if(_0x11ca1c[_0x4f2c('0x4e')]['id']){delete _0x11ca1c['body']['id'];}return db[_0x4f2c('0x46')]['find']({'where':{'id':_0x11ca1c[_0x4f2c('0x49')]['id']}})['then'](handleEntityNotFound(_0x2df175,null))[_0x4f2c('0x29')](saveUpdates(_0x11ca1c[_0x4f2c('0x4e')],null))[_0x4f2c('0x29')](respondWithResult(_0x2df175,null))[_0x4f2c('0x4c')](handleError(_0x2df175,null));};exports[_0x4f2c('0x2a')]=function(_0x25599f,_0x4a040f){return db['OpenchannelQueue']['find']({'where':{'id':_0x25599f[_0x4f2c('0x49')]['id']}})[_0x4f2c('0x29')](handleEntityNotFound(_0x4a040f,null))[_0x4f2c('0x29')](removeEntity(_0x4a040f,null))['catch'](handleError(_0x4a040f,null));};exports[_0x4f2c('0x55')]=function(_0x200529,_0x4719a9){return db[_0x4f2c('0x46')]['describe']()[_0x4f2c('0x29')](respondWithResult(_0x4719a9,null))[_0x4f2c('0x4c')](handleError(_0x4719a9,null));};exports[_0x4f2c('0x56')]=function(_0x10bf8f,_0xd0c44f,_0x21febe){var _0x7ac2b5={'raw':!![],'where':{}},_0x5edc54={},_0x5db9e4;return db[_0x4f2c('0x46')]['findOne']({'where':{'id':_0x10bf8f[_0x4f2c('0x49')]['id']}})[_0x4f2c('0x29')](handleEntityNotFound(_0xd0c44f,null))[_0x4f2c('0x29')](function(_0x4ccedc){if(_0x4ccedc){_0x5db9e4=_0x4ccedc[_0x4f2c('0x2b')]({'plain':!![]});_0x5edc54['model']=_['keys'](db[_0x4f2c('0x57')][_0x4f2c('0x4a')]);_0x5edc54['query']=_[_0x4f2c('0x36')](_0x10bf8f['query']);_0x5edc54[_0x4f2c('0x38')]=_['intersection'](_0x5edc54[_0x4f2c('0x34')],_0x5edc54['query']);_0x7ac2b5['attributes']=_[_0x4f2c('0x39')](_0x5edc54[_0x4f2c('0x34')],qs[_0x4f2c('0x3a')](_0x10bf8f['query'][_0x4f2c('0x3a')]));_0x7ac2b5[_0x4f2c('0x3b')]=_0x7ac2b5['attributes'][_0x4f2c('0x3c')]?_0x7ac2b5[_0x4f2c('0x3b')]:_0x5edc54[_0x4f2c('0x34')];if(!_0x10bf8f[_0x4f2c('0x37')][_0x4f2c('0x58')](_0x4f2c('0x3d'))){_0x7ac2b5[_0x4f2c('0x22')]=qs[_0x4f2c('0x22')](_0x10bf8f[_0x4f2c('0x37')][_0x4f2c('0x22')]);_0x7ac2b5[_0x4f2c('0x24')]=qs[_0x4f2c('0x24')](_0x10bf8f[_0x4f2c('0x37')]['offset']);}_0x7ac2b5[_0x4f2c('0x3e')]=qs[_0x4f2c('0x3f')](_0x10bf8f[_0x4f2c('0x37')][_0x4f2c('0x3f')]);_0x7ac2b5['where']=qs[_0x4f2c('0x38')](_[_0x4f2c('0x41')](_0x10bf8f[_0x4f2c('0x37')],_0x5edc54[_0x4f2c('0x38')]));_0x7ac2b5['where']['OpenchannelQueueId']=_0x4ccedc['id'];if(_0x10bf8f['query'][_0x4f2c('0x44')]){_0x7ac2b5[_0x4f2c('0x40')]=_[_0x4f2c('0x42')](_0x7ac2b5[_0x4f2c('0x40')],{'$or':_[_0x4f2c('0x35')](_0x7ac2b5[_0x4f2c('0x3b')],function(_0x4f56d4){var _0x552486={};_0x552486[_0x4f56d4]={'$like':'%'+_0x10bf8f['query']['filter']+'%'};return _0x552486;})});}_0x7ac2b5=_[_0x4f2c('0x42')]({},_0x7ac2b5,_0x10bf8f[_0x4f2c('0x45')]);return db[_0x4f2c('0x57')]['findAll'](_0x7ac2b5);}})[_0x4f2c('0x29')](function(_0x42caa4){if(_0x42caa4){return db['User'][_0x4f2c('0x59')]({'where':{'id':_[_0x4f2c('0x35')](_0x42caa4,'UserId'),'role':'agent'},'attributes':['id','name',_0x4f2c('0x5a'),_0x4f2c('0x5b'),_0x4f2c('0x5c')]});}})[_0x4f2c('0x29')](function(_0x44f20a){if(_0x44f20a){return{'count':_0x44f20a['count'],'rows':_[_0x4f2c('0x35')](_0x44f20a[_0x4f2c('0x5d')],function(_0x401802){return{'membername':_0x401802[_0x4f2c('0x30')],'UserId':_0x401802['id'],'queue_name':_0x5db9e4[_0x4f2c('0x30')],'OpenchannelQueueId':_0x5db9e4['id'],'interface':util['format'](_0x4f2c('0x5e'),_0x4f2c('0x5f'),_0x401802[_0x4f2c('0x30')]),'penalty':0x0,'paused':_0x401802[_0x4f2c('0x5a')],'createdAt':_0x401802[_0x4f2c('0x5c')],'updatedAt':_0x401802[_0x4f2c('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4f2c('0x29')](respondWithFilteredResult(_0xd0c44f,_0x7ac2b5))[_0x4f2c('0x4c')](handleError(_0xd0c44f,null));};exports['getTeams']=function(_0xb46839,_0x987dd6,_0x58b065){var _0x3fb07e={};var _0x300cca={};var _0x401f5c;var _0x2aa60f;return db[_0x4f2c('0x46')][_0x4f2c('0x60')]({'where':{'id':_0xb46839['params']['id']}})[_0x4f2c('0x29')](handleEntityNotFound(_0x987dd6,null))[_0x4f2c('0x29')](function(_0x7fdffe){if(_0x7fdffe){_0x401f5c=_0x7fdffe;_0x300cca['model']=_[_0x4f2c('0x36')](db[_0x4f2c('0x61')][_0x4f2c('0x4a')]);_0x300cca[_0x4f2c('0x37')]=_['keys'](_0xb46839['query']);_0x300cca[_0x4f2c('0x38')]=_[_0x4f2c('0x39')](_0x300cca[_0x4f2c('0x34')],_0x300cca[_0x4f2c('0x37')]);_0x3fb07e[_0x4f2c('0x3b')]=_[_0x4f2c('0x39')](_0x300cca[_0x4f2c('0x34')],qs['fields'](_0xb46839[_0x4f2c('0x37')][_0x4f2c('0x3a')]));_0x3fb07e['attributes']=_0x3fb07e['attributes'][_0x4f2c('0x3c')]?_0x3fb07e[_0x4f2c('0x3b')]:_0x300cca[_0x4f2c('0x34')];_0x3fb07e[_0x4f2c('0x3e')]=qs[_0x4f2c('0x3f')](_0xb46839[_0x4f2c('0x37')][_0x4f2c('0x3f')]);_0x3fb07e[_0x4f2c('0x40')]=qs['filters'](_['pick'](_0xb46839[_0x4f2c('0x37')],_0x300cca[_0x4f2c('0x38')]));if(_0xb46839[_0x4f2c('0x37')][_0x4f2c('0x44')]){_0x3fb07e[_0x4f2c('0x40')]=_[_0x4f2c('0x42')](_0x3fb07e[_0x4f2c('0x40')],{'$or':_['map'](_0x3fb07e[_0x4f2c('0x3b')],function(_0x234439){var _0x476dc7={};_0x476dc7[_0x234439]={'$like':'%'+_0xb46839[_0x4f2c('0x37')][_0x4f2c('0x44')]+'%'};return _0x476dc7;})});}_0x3fb07e=_[_0x4f2c('0x42')]({},_0x3fb07e,_0xb46839['options']);return _0x401f5c['getTeams'](_0x3fb07e);}})[_0x4f2c('0x29')](function(_0xbaac4e){if(_0xbaac4e){_0x2aa60f=_0xbaac4e[_0x4f2c('0x3c')];if(!_0xb46839['query']['hasOwnProperty'](_0x4f2c('0x3d'))){_0x3fb07e[_0x4f2c('0x22')]=qs[_0x4f2c('0x22')](_0xb46839[_0x4f2c('0x37')][_0x4f2c('0x22')]);_0x3fb07e['offset']=qs[_0x4f2c('0x24')](_0xb46839[_0x4f2c('0x37')]['offset']);}return _0x401f5c[_0x4f2c('0x62')](_0x3fb07e);}})['then'](function(_0x25efe7){if(_0x25efe7){return _0x25efe7?{'count':_0x2aa60f,'rows':_0x25efe7}:null;}})[_0x4f2c('0x29')](respondWithResult(_0x987dd6,null))[_0x4f2c('0x4c')](handleError(_0x987dd6,null));};exports['addTeams']=function(_0x3702e5,_0x264da6,_0x5b838a){var _0x5280c4=_0x3702e5['body'][_0x4f2c('0x63')];return db['Team'][_0x4f2c('0x64')]({'where':{'id':_0x5280c4},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4f2c('0x65'),'attributes':['id',_0x4f2c('0x30'),_0x4f2c('0x66'),_0x4f2c('0x67'),_0x4f2c('0x68')],'raw':!![]}]})['then'](function(_0x3ed7c0){if(_0x3ed7c0){var _0x22411e=_['flatMap'](_0x3ed7c0,function(_0x4572d8){var _0x4ad031=_0x4572d8['get']({'plain':!![]});return _0x4ad031[_0x4f2c('0x65')];});return db[_0x4f2c('0x46')][_0x4f2c('0x4b')]({'where':{'id':_0x3702e5['params']['id']}})['then'](function(_0x43e3c3){return db[_0x4f2c('0x69')][_0x4f2c('0x6a')](function(_0x53e6ee){return _0x43e3c3['addTeams'](_0x5280c4,{'transaction':_0x53e6ee})[_0x4f2c('0x29')](function(){return BPromise[_0x4f2c('0x6b')](_0x22411e,function(_0x4d0b1e){return db[_0x4f2c('0x57')][_0x4f2c('0x6c')]({'where':{'UserId':_0x4d0b1e['id'],'OpenchannelQueueId':_0x3702e5[_0x4f2c('0x49')]['id']},'transaction':_0x53e6ee});});})[_0x4f2c('0x29')](function(){_0x22411e[_0x4f2c('0x6d')](function(_0x3e8030){socket['emit'](_0x4f2c('0x6e'),{'UserId':_0x3e8030['id'],'OpenchannelQueueId':_0x43e3c3['id']});});});});});}})[_0x4f2c('0x29')](respondWithStatusCode(_0x264da6,null))[_0x4f2c('0x4c')](handleError(_0x264da6,null));};exports[_0x4f2c('0x6f')]=function(_0x38cf39,_0x385f3a,_0x149fa2){return db[_0x4f2c('0x61')]['findAll']({'where':{'id':_0x38cf39[_0x4f2c('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4f2c('0x70')],'as':_0x4f2c('0x65'),'attributes':['id'],'raw':!![]}]})[_0x4f2c('0x29')](handleEntityNotFound(_0x385f3a,null))[_0x4f2c('0x29')](function(_0x43fea0){var _0x1128d4=_['map'](_0x43fea0,'id');var _0x310a42=[];var _0x4ea289=[];var _0x544a39=squel[_0x4f2c('0x71')]();_0x544a39[_0x4f2c('0x72')](_0x4f2c('0x73'))['from'](_0x4f2c('0x74'),'tq')[_0x4f2c('0x75')](_0x4f2c('0x76'),'ut',_0x4f2c('0x77'))[_0x4f2c('0x40')](_0x4f2c('0x78'),_0x38cf39[_0x4f2c('0x49')]['id']);for(var _0x9b433c=0x0;_0x9b433c<_0x43fea0[_0x4f2c('0x3c')];_0x9b433c+=0x1){let _0x1928aa=_0x43fea0[_0x9b433c];for(var _0x40d5a2=0x0;_0x40d5a2<_0x1928aa[_0x4f2c('0x65')][_0x4f2c('0x3c')];_0x40d5a2+=0x1){let _0xfc9cd7=_0x1928aa[_0x4f2c('0x65')][_0x40d5a2];var _0x4137eb=_0x544a39[_0x4f2c('0x79')]();_0x4137eb['where'](_0x4f2c('0x7a'),_0xfc9cd7['id']);_0x4ea289[_0x4f2c('0x7b')](db[_0x4f2c('0x69')][_0x4f2c('0x37')](_0x4137eb['toString'](),{'type':db[_0x4f2c('0x69')][_0x4f2c('0x7c')][_0x4f2c('0x7d')]})['then'](function(_0x1d86b1){if(_0x1d86b1[_0x4f2c('0x3c')]===0x1){return _0xfc9cd7['id'];}else{var _0x520213=_['every'](_[_0x4f2c('0x35')](_0x1d86b1,_0x4f2c('0x7e')),function(_0x5094d5){return _[_0x4f2c('0x7f')](_0x1128d4,_0x5094d5);});if(_0x520213){return _0xfc9cd7['id'];}}}));}}return BPromise[_0x4f2c('0x80')](_0x4ea289)[_0x4f2c('0x29')](function(_0x53cb5f){_0x310a42=_(_0x310a42)[_0x4f2c('0x81')](_0x53cb5f)[_0x4f2c('0x82')]()[_0x4f2c('0x83')]();return db[_0x4f2c('0x46')][_0x4f2c('0x4b')]({'where':{'id':_0x38cf39[_0x4f2c('0x49')]['id']}})[_0x4f2c('0x29')](function(_0x480e24){return db['sequelize'][_0x4f2c('0x6a')](function(_0xff6c4f){return _0x480e24[_0x4f2c('0x6f')](_0x38cf39['query'][_0x4f2c('0x63')],{'transaction':_0xff6c4f})[_0x4f2c('0x29')](function(){if(!_[_0x4f2c('0x84')](_0x310a42)){return _0x480e24[_0x4f2c('0x85')](_0x310a42,{'transaction':_0xff6c4f});}})[_0x4f2c('0x29')](function(){_0x310a42[_0x4f2c('0x6d')](function(_0x5e3470){socket['emit'](_0x4f2c('0x86'),{'UserId':_0x5e3470,'OpenchannelQueueId':_0x480e24['id']});});});});});});})[_0x4f2c('0x29')](respondWithStatusCode(_0x385f3a,null))['catch'](handleError(_0x385f3a,null));};exports[_0x4f2c('0x87')]=function(_0x4aaa88,_0x18ca3a,_0xaef004){return db[_0x4f2c('0x46')][_0x4f2c('0x4b')]({'where':{'id':_0x4aaa88[_0x4f2c('0x49')]['id']}})['then'](handleEntityNotFound(_0x18ca3a,null))[_0x4f2c('0x29')](function(_0x6df1c0){if(_0x6df1c0){return _0x6df1c0[_0x4f2c('0x87')](_0x4aaa88[_0x4f2c('0x4e')]['ids'],_['omit'](_0x4aaa88[_0x4f2c('0x4e')],[_0x4f2c('0x63'),'id'])||{})[_0x4f2c('0x88')](function(_0x5410b4){for(var _0xbafccf=0x0;_0xbafccf<_0x4aaa88[_0x4f2c('0x4e')]['ids'][_0x4f2c('0x3c')];_0xbafccf+=0x1){socket[_0x4f2c('0x89')](_0x4f2c('0x6e'),{'UserId':Number(_0x4aaa88[_0x4f2c('0x4e')][_0x4f2c('0x63')][_0xbafccf]),'OpenchannelQueueId':Number(_0x4aaa88[_0x4f2c('0x49')]['id'])});}return _0x5410b4;});}})['then'](respondWithResult(_0x18ca3a,null))[_0x4f2c('0x4c')](handleError(_0x18ca3a,null));};exports[_0x4f2c('0x85')]=function(_0x189459,_0x5dbaec,_0xd320c3){return db[_0x4f2c('0x46')][_0x4f2c('0x4b')]({'where':{'id':_0x189459[_0x4f2c('0x49')]['id']}})[_0x4f2c('0x29')](handleEntityNotFound(_0x5dbaec,null))[_0x4f2c('0x29')](function(_0x48a8ad){if(_0x48a8ad){return _0x48a8ad[_0x4f2c('0x85')](_0x189459['query'][_0x4f2c('0x63')])[_0x4f2c('0x29')](function(){if(_['isArray'](_0x189459[_0x4f2c('0x37')][_0x4f2c('0x63')])){for(var _0x84e69e=0x0;_0x84e69e<_0x189459['query'][_0x4f2c('0x63')][_0x4f2c('0x3c')];_0x84e69e+=0x1){socket[_0x4f2c('0x89')](_0x4f2c('0x86'),{'UserId':Number(_0x189459['query'][_0x4f2c('0x63')][_0x84e69e]),'OpenchannelQueueId':Number(_0x189459['params']['id'])});}}else{socket[_0x4f2c('0x89')](_0x4f2c('0x86'),{'UserId':Number(_0x189459[_0x4f2c('0x37')][_0x4f2c('0x63')]),'OpenchannelQueueId':Number(_0x189459[_0x4f2c('0x49')]['id'])});}});}})[_0x4f2c('0x29')](respondWithStatusCode(_0x5dbaec,null))[_0x4f2c('0x4c')](handleError(_0x5dbaec,null));};exports[_0x4f2c('0x8a')]=function(_0x13eb69,_0x32d04c,_0x5c355c){var _0x479e24={};var _0x2a4177={};var _0x5508a4;var _0x5b9c18;return db[_0x4f2c('0x46')][_0x4f2c('0x60')]({'where':{'id':_0x13eb69[_0x4f2c('0x49')]['id']}})[_0x4f2c('0x29')](handleEntityNotFound(_0x32d04c,null))[_0x4f2c('0x29')](function(_0x181c57){if(_0x181c57){_0x5508a4=_0x181c57;_0x2a4177['model']=_[_0x4f2c('0x36')](db[_0x4f2c('0x70')][_0x4f2c('0x4a')]);_0x2a4177[_0x4f2c('0x37')]=_['keys'](_0x13eb69[_0x4f2c('0x37')]);_0x2a4177[_0x4f2c('0x38')]=_[_0x4f2c('0x39')](_0x2a4177['model'],_0x2a4177[_0x4f2c('0x37')]);_0x479e24[_0x4f2c('0x3b')]=_[_0x4f2c('0x39')](_0x2a4177[_0x4f2c('0x34')],qs[_0x4f2c('0x3a')](_0x13eb69[_0x4f2c('0x37')]['fields']));_0x479e24[_0x4f2c('0x3b')]=_0x479e24[_0x4f2c('0x3b')][_0x4f2c('0x3c')]?_0x479e24[_0x4f2c('0x3b')]:_0x2a4177['model'];_0x479e24['order']=qs['sort'](_0x13eb69[_0x4f2c('0x37')][_0x4f2c('0x3f')]);_0x479e24[_0x4f2c('0x40')]=qs[_0x4f2c('0x38')](_[_0x4f2c('0x41')](_0x13eb69['query'],_0x2a4177[_0x4f2c('0x38')]));if(_0x13eb69[_0x4f2c('0x37')][_0x4f2c('0x44')]){_0x479e24[_0x4f2c('0x40')]=_[_0x4f2c('0x42')](_0x479e24[_0x4f2c('0x40')],{'$or':_[_0x4f2c('0x35')](_0x479e24['attributes'],function(_0x2e26b8){var _0x3df4ad={};_0x3df4ad[_0x2e26b8]={'$like':'%'+_0x13eb69[_0x4f2c('0x37')][_0x4f2c('0x44')]+'%'};return _0x3df4ad;})});}_0x479e24=_[_0x4f2c('0x42')]({},_0x479e24,_0x13eb69[_0x4f2c('0x45')]);return _0x5508a4[_0x4f2c('0x8a')](_0x479e24);}})[_0x4f2c('0x29')](function(_0x173fb6){if(_0x173fb6){_0x5b9c18=_0x173fb6[_0x4f2c('0x3c')];if(!_0x13eb69[_0x4f2c('0x37')]['hasOwnProperty'](_0x4f2c('0x3d'))){_0x479e24['limit']=qs[_0x4f2c('0x22')](_0x13eb69[_0x4f2c('0x37')]['limit']);_0x479e24[_0x4f2c('0x24')]=qs['offset'](_0x13eb69[_0x4f2c('0x37')][_0x4f2c('0x24')]);}return _0x5508a4['getAgents'](_0x479e24);}})[_0x4f2c('0x29')](function(_0x42c84b){if(_0x42c84b){return _0x42c84b?{'count':_0x5b9c18,'rows':_0x42c84b}:null;}})[_0x4f2c('0x29')](respondWithResult(_0x32d04c,null))[_0x4f2c('0x4c')](handleError(_0x32d04c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6c76545..9231c26 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 _0x4286=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x206338,_0x2d800b){var _0x2b87f2=function(_0x436c1c){while(--_0x436c1c){_0x206338['push'](_0x206338['shift']());}};_0x2b87f2(++_0x2d800b);}(_0x4286,0xbd));var _0x6428=function(_0x1b72e6,_0x590db8){_0x1b72e6=_0x1b72e6-0x0;var _0x743d1a=_0x4286[_0x1b72e6];return _0x743d1a;};'use strict';var EventEmitter=require(_0x6428('0x0'));var OpenchannelQueue=require(_0x6428('0x1'))['db'][_0x6428('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6428('0x3')](0x0);var events={'afterCreate':_0x6428('0x4'),'afterUpdate':_0x6428('0x5'),'afterDestroy':_0x6428('0x6')};function emitEvent(_0x551b7f){return function(_0x20d1f6,_0x33c197,_0x3cab7d){OpenchannelQueueEvents[_0x6428('0x7')](_0x551b7f+':'+_0x20d1f6['id'],_0x20d1f6);OpenchannelQueueEvents[_0x6428('0x7')](_0x551b7f,_0x20d1f6);_0x3cab7d(null);};}for(var e in events){if(events[_0x6428('0x8')](e)){var event=events[e];OpenchannelQueue[_0x6428('0x9')](e,emitEvent(event));}}module[_0x6428('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xb4c9=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x2ffb2f,_0x59fc10){var _0x51d5a2=function(_0x5795aa){while(--_0x5795aa){_0x2ffb2f['push'](_0x2ffb2f['shift']());}};_0x51d5a2(++_0x59fc10);}(_0xb4c9,0x1e9));var _0x9b4c=function(_0x510070,_0x1514d2){_0x510070=_0x510070-0x0;var _0x41fa45=_0xb4c9[_0x510070];return _0x41fa45;};'use strict';var EventEmitter=require(_0x9b4c('0x0'));var OpenchannelQueue=require(_0x9b4c('0x1'))['db'][_0x9b4c('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9b4c('0x3')](0x0);var events={'afterCreate':_0x9b4c('0x4'),'afterUpdate':_0x9b4c('0x5'),'afterDestroy':_0x9b4c('0x6')};function emitEvent(_0x31d3a4){return function(_0x3a8377,_0x4f1736,_0xb5414f){OpenchannelQueueEvents['emit'](_0x31d3a4+':'+_0x3a8377['id'],_0x3a8377);OpenchannelQueueEvents[_0x9b4c('0x7')](_0x31d3a4,_0x3a8377);_0xb5414f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x9b4c('0x8')](e,emitEvent(event));}}module[_0x9b4c('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index b1be40a..c3415b7 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 _0x922c=['api','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x366948,_0x3fdce2){var _0x494179=function(_0x3bda79){while(--_0x3bda79){_0x366948['push'](_0x366948['shift']());}};_0x494179(++_0x3fdce2);}(_0x922c,0xc3));var _0xc922=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x922c[_0x15cdcb];return _0x37b069;};'use strict';var _=require(_0xc922('0x0'));var util=require(_0xc922('0x1'));var logger=require(_0xc922('0x2'))(_0xc922('0x3'));var moment=require(_0xc922('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc922('0x5'));var rimraf=require(_0xc922('0x6'));var config=require(_0xc922('0x7'));var attributes=require(_0xc922('0x8'));module[_0xc922('0x9')]=function(_0x290705,_0xed0bb6){return _0x290705[_0xc922('0xa')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbec4=['../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x1267d2,_0x455313){var _0x5e4500=function(_0x598341){while(--_0x598341){_0x1267d2['push'](_0x1267d2['shift']());}};_0x5e4500(++_0x455313);}(_0xbec4,0x1a7));var _0x4bec=function(_0x4610b4,_0x19810d){_0x4610b4=_0x4610b4-0x0;var _0x391a6c=_0xbec4[_0x4610b4];return _0x391a6c;};'use strict';var _=require(_0x4bec('0x0'));var util=require('util');var logger=require(_0x4bec('0x1'))('api');var moment=require(_0x4bec('0x2'));var BPromise=require(_0x4bec('0x3'));var rp=require(_0x4bec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4bec('0x5'));var config=require(_0x4bec('0x6'));var attributes=require(_0x4bec('0x7'));module[_0x4bec('0x8')]=function(_0x560330,_0x3e700e){return _0x560330[_0x4bec('0x9')](_0x4bec('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 8a11b52..ebcab10 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 _0x0f34=['GetOpenchannelQueue','options','raw','limit','include','map','attributes','model','then','ShowOpenchannelQueue','find','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x415ec7,_0xf0ed17){var _0x2dcadd=function(_0x51ee26){while(--_0x51ee26){_0x415ec7['push'](_0x415ec7['shift']());}};_0x2dcadd(++_0xf0ed17);}(_0x0f34,0x134));var _0x40f3=function(_0x55d893,_0x325ebe){_0x55d893=_0x55d893-0x0;var _0x52d152=_0x0f34[_0x55d893];return _0x52d152;};'use strict';var _=require(_0x40f3('0x0'));var util=require(_0x40f3('0x1'));var moment=require('moment');var BPromise=require(_0x40f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40f3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x40f3('0x4'));var logger=require(_0x40f3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x40f3('0x6'));var client=jayson[_0x40f3('0x7')][_0x40f3('0x8')]({'port':0x232a});config[_0x40f3('0x9')]=_[_0x40f3('0xa')](config[_0x40f3('0x9')],{'host':_0x40f3('0xb'),'port':0x18eb});var socket=require(_0x40f3('0xc'))(new Redis(config[_0x40f3('0x9')]));require(_0x40f3('0xd'))[_0x40f3('0xe')](socket);function respondWithRpcPromise(_0x36b67c,_0x5c6848,_0x1c7830){return new BPromise(function(_0x1f7f28,_0x241fad){return client[_0x40f3('0xf')](_0x36b67c,_0x1c7830)['then'](function(_0x301302){logger[_0x40f3('0x10')](_0x40f3('0x11'),_0x5c6848,_0x40f3('0x12'));logger[_0x40f3('0x13')](_0x40f3('0x14'),_0x5c6848,_0x40f3('0x12'),JSON['stringify'](_0x301302));if(_0x301302[_0x40f3('0x15')]){if(_0x301302[_0x40f3('0x15')][_0x40f3('0x16')]===0x1f4){logger['error'](_0x40f3('0x11'),_0x5c6848,_0x301302[_0x40f3('0x15')]['message']);return _0x241fad(_0x301302[_0x40f3('0x15')][_0x40f3('0x17')]);}logger[_0x40f3('0x15')](_0x40f3('0x11'),_0x5c6848,_0x301302['error'][_0x40f3('0x17')]);return _0x1f7f28(_0x301302['error']['message']);}else{logger[_0x40f3('0x10')](_0x40f3('0x11'),_0x5c6848,_0x40f3('0x12'));_0x1f7f28(_0x301302['result'][_0x40f3('0x17')]);}})[_0x40f3('0x18')](function(_0x32af70){logger[_0x40f3('0x15')](_0x40f3('0x11'),_0x5c6848,_0x32af70);_0x241fad(_0x32af70);});});}exports[_0x40f3('0x19')]=function(_0x139d3c){var _0x201558=this;return new Promise(function(_0x67634d,_0x282506){return db['OpenchannelQueue']['findAll']({'raw':_0x139d3c['options']?_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1b')]===undefined?!![]:![]:!![],'where':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')]['where']||null:null,'attributes':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')]['attributes']||null:null,'limit':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1c')]||null:null,'include':_0x139d3c[_0x40f3('0x1a')]?_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1d')]?_[_0x40f3('0x1e')](_0x139d3c[_0x40f3('0x1a')][_0x40f3('0x1d')],function(_0x30687c){return{'model':db[_0x30687c['model']],'as':_0x30687c['as'],'attributes':_0x30687c[_0x40f3('0x1f')],'include':_0x30687c[_0x40f3('0x1d')]?_['map'](_0x30687c[_0x40f3('0x1d')],function(_0x219e8c){return{'model':db[_0x219e8c[_0x40f3('0x20')]],'as':_0x219e8c['as'],'attributes':_0x219e8c[_0x40f3('0x1f')],'include':_0x219e8c['include']?_[_0x40f3('0x1e')](_0x219e8c['include'],function(_0x4c5169){return{'model':db[_0x4c5169[_0x40f3('0x20')]],'as':_0x4c5169['as'],'attributes':_0x4c5169[_0x40f3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x40f3('0x21')](function(_0x42964c){logger[_0x40f3('0x10')]('GetOpenchannelQueue',_0x139d3c);logger['debug'](_0x40f3('0x19'),_0x139d3c,JSON['stringify'](_0x42964c));_0x67634d(_0x42964c);})[_0x40f3('0x18')](function(_0x1e2eb0){logger[_0x40f3('0x15')](_0x40f3('0x19'),_0x1e2eb0[_0x40f3('0x17')],_0x139d3c);_0x282506(_0x201558['error'](0x1f4,_0x1e2eb0[_0x40f3('0x17')]));});});};exports[_0x40f3('0x22')]=function(_0x3ce5d4){var _0x396ea5=this;return new Promise(function(_0x501452,_0x4c1947){return db['OpenchannelQueue'][_0x40f3('0x23')]({'raw':_0x3ce5d4[_0x40f3('0x1a')]?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ce5d4[_0x40f3('0x1a')]?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x24')]||null:null,'attributes':_0x3ce5d4['options']?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1f')]||null:null,'include':_0x3ce5d4[_0x40f3('0x1a')]?_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1d')]?_['map'](_0x3ce5d4[_0x40f3('0x1a')][_0x40f3('0x1d')],function(_0x444c28){return{'model':db[_0x444c28['model']],'as':_0x444c28['as'],'attributes':_0x444c28[_0x40f3('0x1f')],'include':_0x444c28[_0x40f3('0x1d')]?_[_0x40f3('0x1e')](_0x444c28[_0x40f3('0x1d')],function(_0x4b288c){return{'model':db[_0x4b288c[_0x40f3('0x20')]],'as':_0x4b288c['as'],'attributes':_0x4b288c[_0x40f3('0x1f')],'include':_0x4b288c['include']?_[_0x40f3('0x1e')](_0x4b288c[_0x40f3('0x1d')],function(_0x263c75){return{'model':db[_0x263c75[_0x40f3('0x20')]],'as':_0x263c75['as'],'attributes':_0x263c75['attributes']};}):[]};}):[]};}):[]:[]})[_0x40f3('0x21')](function(_0x27c099){logger[_0x40f3('0x10')](_0x40f3('0x22'),_0x3ce5d4);logger[_0x40f3('0x13')](_0x40f3('0x22'),_0x3ce5d4,JSON['stringify'](_0x27c099));_0x501452(_0x27c099);})[_0x40f3('0x18')](function(_0x1e7b5f){logger[_0x40f3('0x15')](_0x40f3('0x22'),_0x1e7b5f[_0x40f3('0x17')],_0x3ce5d4);_0x4c1947(_0x396ea5[_0x40f3('0x15')](0x1f4,_0x1e7b5f[_0x40f3('0x17')]));});});}; \ No newline at end of file +var _0x58c5=['socket.io-emitter','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','ShowOpenchannelQueue','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost'];(function(_0x4a6108,_0x35d316){var _0x2c0799=function(_0x25a007){while(--_0x25a007){_0x4a6108['push'](_0x4a6108['shift']());}};_0x2c0799(++_0x35d316);}(_0x58c5,0x99));var _0x558c=function(_0x7e0738,_0x3bb303){_0x7e0738=_0x7e0738-0x0;var _0x4f4d65=_0x58c5[_0x7e0738];return _0x4f4d65;};'use strict';var _=require(_0x558c('0x0'));var util=require(_0x558c('0x1'));var moment=require(_0x558c('0x2'));var BPromise=require(_0x558c('0x3'));var rs=require(_0x558c('0x4'));var fs=require('fs');var Redis=require(_0x558c('0x5'));var db=require(_0x558c('0x6'))['db'];var utils=require(_0x558c('0x7'));var logger=require(_0x558c('0x8'))(_0x558c('0x9'));var config=require('../../config/environment');var jayson=require(_0x558c('0xa'));var client=jayson['client'][_0x558c('0xb')]({'port':0x232a});config[_0x558c('0xc')]=_[_0x558c('0xd')](config[_0x558c('0xc')],{'host':_0x558c('0xe'),'port':0x18eb});var socket=require(_0x558c('0xf'))(new Redis(config[_0x558c('0xc')]));require(_0x558c('0x10'))[_0x558c('0x11')](socket);function respondWithRpcPromise(_0xb8f073,_0x47a986,_0x3b2f0c){return new BPromise(function(_0x2d9411,_0x33ca4c){return client['request'](_0xb8f073,_0x3b2f0c)[_0x558c('0x12')](function(_0x5521f9){logger['info'](_0x558c('0x13'),_0x47a986,'request\x20sent');logger[_0x558c('0x14')](_0x558c('0x15'),_0x47a986,_0x558c('0x16'),JSON[_0x558c('0x17')](_0x5521f9));if(_0x5521f9[_0x558c('0x18')]){if(_0x5521f9[_0x558c('0x18')][_0x558c('0x19')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x47a986,_0x5521f9[_0x558c('0x18')][_0x558c('0x1a')]);return _0x33ca4c(_0x5521f9['error']['message']);}logger[_0x558c('0x18')](_0x558c('0x13'),_0x47a986,_0x5521f9[_0x558c('0x18')][_0x558c('0x1a')]);return _0x2d9411(_0x5521f9[_0x558c('0x18')][_0x558c('0x1a')]);}else{logger[_0x558c('0x1b')](_0x558c('0x13'),_0x47a986,_0x558c('0x16'));_0x2d9411(_0x5521f9[_0x558c('0x1c')][_0x558c('0x1a')]);}})[_0x558c('0x1d')](function(_0xfd8981){logger[_0x558c('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x47a986,_0xfd8981);_0x33ca4c(_0xfd8981);});});}exports[_0x558c('0x1e')]=function(_0x515b87){var _0x5d4a82=this;return new Promise(function(_0x5b2c14,_0x2c8229){return db[_0x558c('0x1f')][_0x558c('0x20')]({'raw':_0x515b87[_0x558c('0x21')]?_0x515b87['options'][_0x558c('0x22')]===undefined?!![]:![]:!![],'where':_0x515b87['options']?_0x515b87[_0x558c('0x21')]['where']||null:null,'attributes':_0x515b87[_0x558c('0x21')]?_0x515b87['options'][_0x558c('0x23')]||null:null,'limit':_0x515b87[_0x558c('0x21')]?_0x515b87['options'][_0x558c('0x24')]||null:null,'include':_0x515b87[_0x558c('0x21')]?_0x515b87[_0x558c('0x21')][_0x558c('0x25')]?_[_0x558c('0x26')](_0x515b87[_0x558c('0x21')][_0x558c('0x25')],function(_0x2615ec){return{'model':db[_0x2615ec['model']],'as':_0x2615ec['as'],'attributes':_0x2615ec[_0x558c('0x23')],'include':_0x2615ec[_0x558c('0x25')]?_[_0x558c('0x26')](_0x2615ec[_0x558c('0x25')],function(_0x4e4c66){return{'model':db[_0x4e4c66[_0x558c('0x27')]],'as':_0x4e4c66['as'],'attributes':_0x4e4c66['attributes'],'include':_0x4e4c66[_0x558c('0x25')]?_[_0x558c('0x26')](_0x4e4c66[_0x558c('0x25')],function(_0x3de76c){return{'model':db[_0x3de76c[_0x558c('0x27')]],'as':_0x3de76c['as'],'attributes':_0x3de76c[_0x558c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x558c('0x12')](function(_0x302398){logger[_0x558c('0x1b')](_0x558c('0x1e'),_0x515b87);logger[_0x558c('0x14')](_0x558c('0x1e'),_0x515b87,JSON['stringify'](_0x302398));_0x5b2c14(_0x302398);})['catch'](function(_0x1eb181){logger['error'](_0x558c('0x1e'),_0x1eb181[_0x558c('0x1a')],_0x515b87);_0x2c8229(_0x5d4a82['error'](0x1f4,_0x1eb181[_0x558c('0x1a')]));});});};exports[_0x558c('0x28')]=function(_0x58d109){var _0x1e242e=this;return new Promise(function(_0x155cb9,_0x1e105c){return db[_0x558c('0x1f')]['find']({'raw':_0x58d109[_0x558c('0x21')]?_0x58d109[_0x558c('0x21')][_0x558c('0x22')]===undefined?!![]:![]:!![],'where':_0x58d109['options']?_0x58d109[_0x558c('0x21')][_0x558c('0x29')]||null:null,'attributes':_0x58d109[_0x558c('0x21')]?_0x58d109['options'][_0x558c('0x23')]||null:null,'include':_0x58d109[_0x558c('0x21')]?_0x58d109[_0x558c('0x21')][_0x558c('0x25')]?_['map'](_0x58d109[_0x558c('0x21')][_0x558c('0x25')],function(_0xd69fd2){return{'model':db[_0xd69fd2[_0x558c('0x27')]],'as':_0xd69fd2['as'],'attributes':_0xd69fd2[_0x558c('0x23')],'include':_0xd69fd2[_0x558c('0x25')]?_[_0x558c('0x26')](_0xd69fd2['include'],function(_0x2a6503){return{'model':db[_0x2a6503[_0x558c('0x27')]],'as':_0x2a6503['as'],'attributes':_0x2a6503[_0x558c('0x23')],'include':_0x2a6503[_0x558c('0x25')]?_[_0x558c('0x26')](_0x2a6503[_0x558c('0x25')],function(_0x5d0cf8){return{'model':db[_0x5d0cf8['model']],'as':_0x5d0cf8['as'],'attributes':_0x5d0cf8[_0x558c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x558c('0x12')](function(_0x22e3de){logger[_0x558c('0x1b')](_0x558c('0x28'),_0x58d109);logger['debug'](_0x558c('0x28'),_0x58d109,JSON[_0x558c('0x17')](_0x22e3de));_0x155cb9(_0x22e3de);})[_0x558c('0x1d')](function(_0x569e2a){logger[_0x558c('0x18')]('ShowOpenchannelQueue',_0x569e2a[_0x558c('0x1a')],_0x58d109);_0x1e105c(_0x1e242e['error'](0x1f4,_0x569e2a[_0x558c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e967bbd..09e074f 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 _0x461b=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x381021,_0x498ce6){var _0x15bd35=function(_0x1845e0){while(--_0x1845e0){_0x381021['push'](_0x381021['shift']());}};_0x15bd35(++_0x498ce6);}(_0x461b,0xbf));var _0xb461=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x461b[_0x13e741];return _0x3f8bb3;};'use strict';var OpenchannelQueueEvents=require(_0xb461('0x0'));var events=[_0xb461('0x1'),_0xb461('0x2'),_0xb461('0x3')];function createListener(_0x4705c5,_0x55b3dd){return function(_0x22e0c5){_0x55b3dd[_0xb461('0x4')](_0x4705c5,_0x22e0c5);};}function removeListener(_0x3447d1,_0x317858){return function(){OpenchannelQueueEvents[_0xb461('0x5')](_0x3447d1,_0x317858);};}exports[_0xb461('0x6')]=function(_0x38b7ae){for(var _0x260fe5=0x0,_0x11bdba=events[_0xb461('0x7')];_0x260fe5<_0x11bdba;_0x260fe5++){var _0x291481=events[_0x260fe5];var _0x4eba3e=createListener(_0xb461('0x8')+_0x291481,_0x38b7ae);OpenchannelQueueEvents['on'](_0x291481,_0x4eba3e);}}; \ No newline at end of file +var _0xe0e2=['./openchannelQueue.events','remove','removeListener','openchannelQueue:'];(function(_0x1a147f,_0x36b3d0){var _0x101ebb=function(_0x14839a){while(--_0x14839a){_0x1a147f['push'](_0x1a147f['shift']());}};_0x101ebb(++_0x36b3d0);}(_0xe0e2,0x13c));var _0x2e0e=function(_0x4b3358,_0x5cda77){_0x4b3358=_0x4b3358-0x0;var _0x1ea011=_0xe0e2[_0x4b3358];return _0x1ea011;};'use strict';var OpenchannelQueueEvents=require(_0x2e0e('0x0'));var events=['save',_0x2e0e('0x1'),'update'];function createListener(_0x1c1f21,_0x2dfde9){return function(_0x48ae61){_0x2dfde9['emit'](_0x1c1f21,_0x48ae61);};}function removeListener(_0x5ed516,_0x33b0c3){return function(){OpenchannelQueueEvents[_0x2e0e('0x2')](_0x5ed516,_0x33b0c3);};}exports['register']=function(_0x3f1790){for(var _0x6ebf9b=0x0,_0x26449f=events['length'];_0x6ebf9b<_0x26449f;_0x6ebf9b++){var _0x1a72ca=events[_0x6ebf9b];var _0x17b427=createListener(_0x2e0e('0x3')+_0x1a72ca,_0x3f1790);OpenchannelQueueEvents['on'](_0x1a72ca,_0x17b427);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 49e6e31..2996102 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 _0xcd49=['../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/:id','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x448fe6,_0x4a3e61){var _0x591b51=function(_0x5e1c79){while(--_0x5e1c79){_0x448fe6['push'](_0x448fe6['shift']());}};_0x591b51(++_0x4a3e61);}(_0xcd49,0x65));var _0x9cd4=function(_0x1c0f3d,_0x55a9e2){_0x1c0f3d=_0x1c0f3d-0x0;var _0x4d71a8=_0xcd49[_0x1c0f3d];return _0x4d71a8;};'use strict';var multer=require(_0x9cd4('0x0'));var util=require(_0x9cd4('0x1'));var path=require('path');var timeout=require(_0x9cd4('0x2'));var express=require(_0x9cd4('0x3'));var router=express['Router']();var fs_extra=require(_0x9cd4('0x4'));var auth=require(_0x9cd4('0x5'));var interaction=require(_0x9cd4('0x6'));var config=require(_0x9cd4('0x7'));var controller=require(_0x9cd4('0x8'));router['get']('/',auth[_0x9cd4('0x9')](),controller[_0x9cd4('0xa')]);router[_0x9cd4('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9cd4('0xb')](_0x9cd4('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9cd4('0x9')](),controller['create']);router[_0x9cd4('0xd')](_0x9cd4('0xc'),auth['isAuthenticated'](),controller[_0x9cd4('0xe')]);router[_0x9cd4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9cd4('0x10')]);module[_0x9cd4('0x11')]=router; \ No newline at end of file +var _0x6893=['isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x3355b9,_0x99035c){var _0xd867ed=function(_0x323356){while(--_0x323356){_0x3355b9['push'](_0x3355b9['shift']());}};_0xd867ed(++_0x99035c);}(_0x6893,0x15b));var _0x3689=function(_0x467488,_0x38c7ae){_0x467488=_0x467488-0x0;var _0x56107f=_0x6893[_0x467488];return _0x56107f;};'use strict';var multer=require(_0x3689('0x0'));var util=require(_0x3689('0x1'));var path=require(_0x3689('0x2'));var timeout=require(_0x3689('0x3'));var express=require(_0x3689('0x4'));var router=express['Router']();var fs_extra=require(_0x3689('0x5'));var auth=require(_0x3689('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3689('0x7'));var controller=require(_0x3689('0x8'));router[_0x3689('0x9')]('/',auth[_0x3689('0xa')](),controller[_0x3689('0xb')]);router[_0x3689('0x9')](_0x3689('0xc'),auth[_0x3689('0xa')](),controller['describe']);router['get'](_0x3689('0xd'),auth[_0x3689('0xa')](),controller[_0x3689('0xe')]);router[_0x3689('0xf')]('/',auth[_0x3689('0xa')](),controller[_0x3689('0x10')]);router[_0x3689('0x11')](_0x3689('0xd'),auth[_0x3689('0xa')](),controller['update']);router[_0x3689('0x12')](_0x3689('0xd'),auth[_0x3689('0xa')](),controller[_0x3689('0x13')]);module[_0x3689('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 770b18a..b0c9983 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 _0x73a7=['sequelize','exports','STRING','DATE'];(function(_0x16e871,_0x231ced){var _0x4b315a=function(_0x5d139c){while(--_0x5d139c){_0x16e871['push'](_0x16e871['shift']());}};_0x4b315a(++_0x231ced);}(_0x73a7,0x80));var _0x773a=function(_0x59c6e7,_0x43454c){_0x59c6e7=_0x59c6e7-0x0;var _0x36b853=_0x73a7[_0x59c6e7];return _0x36b853;};'use strict';var moment=require('moment');var Sequelize=require(_0x773a('0x0'));module[_0x773a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x773a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x773a('0x3')]},'acceptAt':{'type':Sequelize[_0x773a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x773a('0x2')]}}; \ No newline at end of file +var _0x0b08=['moment','sequelize','STRING','DATE'];(function(_0x36aca5,_0x58f459){var _0x2df60a=function(_0x54e4dd){while(--_0x54e4dd){_0x36aca5['push'](_0x36aca5['shift']());}};_0x2df60a(++_0x58f459);}(_0x0b08,0x108));var _0x80b0=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x0b08[_0x5756c6];return _0x4b5806;};'use strict';var moment=require(_0x80b0('0x0'));var Sequelize=require(_0x80b0('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x80b0('0x2')]},'joinAt':{'type':Sequelize[_0x80b0('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x80b0('0x3')]},'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 c0ae848..fe740dd 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 _0xf057=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x32cc68,_0x5d2b21){var _0x472ab1=function(_0x14ff66){while(--_0x14ff66){_0x32cc68['push'](_0x32cc68['shift']());}};_0x472ab1(++_0x5d2b21);}(_0xf057,0xde));var _0x7f05=function(_0x51588c,_0x1b4a22){_0x51588c=_0x51588c-0x0;var _0x5ba11c=_0xf057[_0x51588c];return _0x5ba11c;};'use strict';var emlformat=require(_0x7f05('0x0'));var rimraf=require(_0x7f05('0x1'));var zipdir=require(_0x7f05('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f05('0x3'));var moment=require(_0x7f05('0x4'));var BPromise=require(_0x7f05('0x5'));var Mustache=require(_0x7f05('0x6'));var util=require(_0x7f05('0x7'));var path=require(_0x7f05('0x8'));var sox=require(_0x7f05('0x9'));var csv=require(_0x7f05('0xa'));var ejs=require(_0x7f05('0xb'));var fs=require('fs');var fs_extra=require(_0x7f05('0xc'));var _=require(_0x7f05('0xd'));var squel=require(_0x7f05('0xe'));var crypto=require(_0x7f05('0xf'));var jsforce=require(_0x7f05('0x10'));var deskjs=require(_0x7f05('0x11'));var toCsv=require(_0x7f05('0xa'));var querystring=require(_0x7f05('0x12'));var Papa=require('papaparse');var Redis=require(_0x7f05('0x13'));var authService=require(_0x7f05('0x14'));var qs=require(_0x7f05('0x15'));var as=require(_0x7f05('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7f05('0x17'));var utils=require(_0x7f05('0x18'));var config=require(_0x7f05('0x19'));var licenseUtil=require(_0x7f05('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x438fbf,_0x6ca2b2){_0x6ca2b2=_0x6ca2b2||0xcc;return function(_0x281318){if(_0x281318){return _0x438fbf[_0x7f05('0x1b')](_0x6ca2b2);}return _0x438fbf[_0x7f05('0x1c')](_0x6ca2b2)[_0x7f05('0x1d')]();};}function respondWithResult(_0x4be1da,_0x2c8de1){_0x2c8de1=_0x2c8de1||0xc8;return function(_0x3c47fa){if(_0x3c47fa){return _0x4be1da[_0x7f05('0x1c')](_0x2c8de1)[_0x7f05('0x1e')](_0x3c47fa);}};}function respondWithFilteredResult(_0x32e308,_0x522b9f){return function(_0x3c6c80){if(_0x3c6c80){var _0x3378e4=typeof _0x522b9f['offset']===_0x7f05('0x1f')&&typeof _0x522b9f[_0x7f05('0x20')]==='undefined';var _0x5e88f7=_0x3c6c80[_0x7f05('0x21')];var _0x3de79b=_0x3378e4?0x0:_0x522b9f[_0x7f05('0x22')];var _0x42e0ab=_0x3378e4?_0x3c6c80[_0x7f05('0x21')]:_0x522b9f[_0x7f05('0x22')]+_0x522b9f[_0x7f05('0x20')];var _0x130c3e;if(_0x42e0ab>=_0x5e88f7){_0x42e0ab=_0x5e88f7;_0x130c3e=0xc8;}else{_0x130c3e=0xce;}_0x32e308['status'](_0x130c3e);return _0x32e308[_0x7f05('0x23')](_0x7f05('0x24'),_0x3de79b+'-'+_0x42e0ab+'/'+_0x5e88f7)[_0x7f05('0x1e')](_0x3c6c80);}return null;};}function patchUpdates(_0x4b47a2){return function(_0x8d3733){try{jsonpatch['apply'](_0x8d3733,_0x4b47a2,!![]);}catch(_0x30985b){return BPromise[_0x7f05('0x25')](_0x30985b);}return _0x8d3733[_0x7f05('0x26')]();};}function saveUpdates(_0x4fefda,_0x294c8d){return function(_0x5f10f5){if(_0x5f10f5){return _0x5f10f5[_0x7f05('0x27')](_0x4fefda)['then'](function(_0x3f83e0){return _0x3f83e0;});}return null;};}function removeEntity(_0x55436b,_0x32dbe6){return function(_0x11c4f3){if(_0x11c4f3){return _0x11c4f3['destroy']()[_0x7f05('0x28')](function(){_0x55436b[_0x7f05('0x1c')](0xcc)[_0x7f05('0x1d')]();});}};}function handleEntityNotFound(_0x2780db,_0x3c0be5){return function(_0xda132e){if(!_0xda132e){_0x2780db['sendStatus'](0x194);}return _0xda132e;};}function handleError(_0x22bb83,_0x3cca29){_0x3cca29=_0x3cca29||0x1f4;return function(_0x44574a){logger[_0x7f05('0x29')](_0x44574a[_0x7f05('0x2a')]);if(_0x44574a[_0x7f05('0x2b')]){delete _0x44574a['name'];}_0x22bb83['status'](_0x3cca29)[_0x7f05('0x2c')](_0x44574a);};}exports[_0x7f05('0x2d')]=function(_0x11f721,_0x135d96){var _0xee4787={},_0x22714d={},_0x23e99b={'count':0x0,'rows':[]};var _0x3c160a=_[_0x7f05('0x2e')](db[_0x7f05('0x2f')][_0x7f05('0x30')],function(_0x2a52d7){return{'name':_0x2a52d7[_0x7f05('0x31')],'type':_0x2a52d7[_0x7f05('0x32')][_0x7f05('0x33')]};});_0x22714d[_0x7f05('0x34')]=_[_0x7f05('0x2e')](_0x3c160a,'name');_0x22714d['query']=_[_0x7f05('0x35')](_0x11f721['query']);_0x22714d[_0x7f05('0x36')]=_[_0x7f05('0x37')](_0x22714d[_0x7f05('0x34')],_0x22714d[_0x7f05('0x38')]);_0xee4787[_0x7f05('0x39')]=_[_0x7f05('0x37')](_0x22714d['model'],qs[_0x7f05('0x3a')](_0x11f721['query']['fields']));_0xee4787['attributes']=_0xee4787[_0x7f05('0x39')]['length']?_0xee4787[_0x7f05('0x39')]:_0x22714d[_0x7f05('0x34')];if(!_0x11f721[_0x7f05('0x38')][_0x7f05('0x3b')]('nolimit')){_0xee4787[_0x7f05('0x20')]=qs['limit'](_0x11f721['query']['limit']);_0xee4787[_0x7f05('0x22')]=qs[_0x7f05('0x22')](_0x11f721['query']['offset']);}_0xee4787[_0x7f05('0x3c')]=qs[_0x7f05('0x3d')](_0x11f721['query'][_0x7f05('0x3d')]);_0xee4787[_0x7f05('0x3e')]=qs[_0x7f05('0x36')](_[_0x7f05('0x3f')](_0x11f721['query'],_0x22714d[_0x7f05('0x36')]),_0x3c160a);if(_0x11f721['query']['filter']){_0xee4787[_0x7f05('0x3e')]=_['merge'](_0xee4787[_0x7f05('0x3e')],{'$or':_[_0x7f05('0x2e')](_0x3c160a,function(_0xb5fa98){if(_0xb5fa98[_0x7f05('0x32')]!==_0x7f05('0x40')){var _0x53dab7={};_0x53dab7[_0xb5fa98[_0x7f05('0x2b')]]={'$like':'%'+_0x11f721[_0x7f05('0x38')][_0x7f05('0x41')]+'%'};return _0x53dab7;}})});}_0xee4787=_[_0x7f05('0x42')]({},_0xee4787,_0x11f721[_0x7f05('0x43')]);var _0x206c6f={'where':_0xee4787[_0x7f05('0x3e')]};return db[_0x7f05('0x2f')]['count'](_0x206c6f)['then'](function(_0xfd4b01){_0x23e99b[_0x7f05('0x21')]=_0xfd4b01;if(_0x11f721[_0x7f05('0x38')][_0x7f05('0x44')]){_0xee4787[_0x7f05('0x45')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x7f05('0x46')](_0xee4787);})[_0x7f05('0x28')](function(_0x38678c){_0x23e99b[_0x7f05('0x47')]=_0x38678c;return _0x23e99b;})[_0x7f05('0x28')](respondWithFilteredResult(_0x135d96,_0xee4787))[_0x7f05('0x48')](handleError(_0x135d96,null));};exports[_0x7f05('0x49')]=function(_0x5821d3,_0x5d9c79){var _0x36afa5={'raw':!![],'where':{'id':_0x5821d3[_0x7f05('0x4a')]['id']}},_0x27bc23={};_0x27bc23[_0x7f05('0x34')]=_[_0x7f05('0x35')](db[_0x7f05('0x2f')][_0x7f05('0x30')]);_0x27bc23[_0x7f05('0x38')]=_[_0x7f05('0x35')](_0x5821d3[_0x7f05('0x38')]);_0x27bc23['filters']=_[_0x7f05('0x37')](_0x27bc23[_0x7f05('0x34')],_0x27bc23[_0x7f05('0x38')]);_0x36afa5[_0x7f05('0x39')]=_[_0x7f05('0x37')](_0x27bc23['model'],qs[_0x7f05('0x3a')](_0x5821d3[_0x7f05('0x38')][_0x7f05('0x3a')]));_0x36afa5[_0x7f05('0x39')]=_0x36afa5[_0x7f05('0x39')]['length']?_0x36afa5[_0x7f05('0x39')]:_0x27bc23[_0x7f05('0x34')];if(_0x5821d3[_0x7f05('0x38')][_0x7f05('0x44')]){_0x36afa5['include']=[{'all':!![]}];}_0x36afa5=_['merge']({},_0x36afa5,_0x5821d3[_0x7f05('0x43')]);return db[_0x7f05('0x2f')][_0x7f05('0x4b')](_0x36afa5)[_0x7f05('0x28')](handleEntityNotFound(_0x5d9c79,null))[_0x7f05('0x28')](respondWithResult(_0x5d9c79,null))['catch'](handleError(_0x5d9c79,null));};exports['create']=function(_0x385a9c,_0x1a4654){return db['OpenchannelQueueReport'][_0x7f05('0x4c')](_0x385a9c[_0x7f05('0x4d')],{})[_0x7f05('0x28')](respondWithResult(_0x1a4654,0xc9))[_0x7f05('0x48')](handleError(_0x1a4654,null));};exports[_0x7f05('0x27')]=function(_0x4afa33,_0x311962){if(_0x4afa33[_0x7f05('0x4d')]['id']){delete _0x4afa33['body']['id'];}return db['OpenchannelQueueReport'][_0x7f05('0x4b')]({'where':{'id':_0x4afa33[_0x7f05('0x4a')]['id']}})[_0x7f05('0x28')](handleEntityNotFound(_0x311962,null))['then'](saveUpdates(_0x4afa33[_0x7f05('0x4d')],null))[_0x7f05('0x28')](respondWithResult(_0x311962,null))[_0x7f05('0x48')](handleError(_0x311962,null));};exports[_0x7f05('0x4e')]=function(_0x296222,_0x37eeda){return db[_0x7f05('0x2f')][_0x7f05('0x4b')]({'where':{'id':_0x296222['params']['id']}})[_0x7f05('0x28')](handleEntityNotFound(_0x37eeda,null))[_0x7f05('0x28')](removeEntity(_0x37eeda,null))['catch'](handleError(_0x37eeda,null));};exports[_0x7f05('0x4f')]=function(_0x24fc58,_0x538b55){return db['OpenchannelQueueReport']['describe']()[_0x7f05('0x28')](respondWithResult(_0x538b55,null))[_0x7f05('0x48')](handleError(_0x538b55,null));}; \ No newline at end of file +var _0x5676=['Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','OpenchannelQueueReport','include','catch','includeAll','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5676,0x15b));var _0x6567=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5676[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x6567('0x0'));var rimraf=require(_0x6567('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6567('0x2'));var rp=require(_0x6567('0x3'));var moment=require(_0x6567('0x4'));var BPromise=require(_0x6567('0x5'));var Mustache=require(_0x6567('0x6'));var util=require('util');var path=require(_0x6567('0x7'));var sox=require(_0x6567('0x8'));var csv=require(_0x6567('0x9'));var ejs=require(_0x6567('0xa'));var fs=require('fs');var fs_extra=require(_0x6567('0xb'));var _=require(_0x6567('0xc'));var squel=require('squel');var crypto=require(_0x6567('0xd'));var jsforce=require(_0x6567('0xe'));var deskjs=require(_0x6567('0xf'));var toCsv=require(_0x6567('0x9'));var querystring=require(_0x6567('0x10'));var Papa=require(_0x6567('0x11'));var Redis=require(_0x6567('0x12'));var authService=require(_0x6567('0x13'));var qs=require(_0x6567('0x14'));var as=require(_0x6567('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6567('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6567('0x17'));var db=require(_0x6567('0x18'))['db'];function respondWithStatusCode(_0x3f5321,_0x49fb36){_0x49fb36=_0x49fb36||0xcc;return function(_0x16d9c0){if(_0x16d9c0){return _0x3f5321[_0x6567('0x19')](_0x49fb36);}return _0x3f5321[_0x6567('0x1a')](_0x49fb36)['end']();};}function respondWithResult(_0xe58943,_0x39ea1d){_0x39ea1d=_0x39ea1d||0xc8;return function(_0x10e9d9){if(_0x10e9d9){return _0xe58943['status'](_0x39ea1d)[_0x6567('0x1b')](_0x10e9d9);}};}function respondWithFilteredResult(_0x416538,_0x52cc23){return function(_0x39f8e0){if(_0x39f8e0){var _0x387aad=typeof _0x52cc23[_0x6567('0x1c')]==='undefined'&&typeof _0x52cc23[_0x6567('0x1d')]===_0x6567('0x1e');var _0x1a7d84=_0x39f8e0[_0x6567('0x1f')];var _0x394039=_0x387aad?0x0:_0x52cc23[_0x6567('0x1c')];var _0x2320fd=_0x387aad?_0x39f8e0[_0x6567('0x1f')]:_0x52cc23[_0x6567('0x1c')]+_0x52cc23['limit'];var _0x150702;if(_0x2320fd>=_0x1a7d84){_0x2320fd=_0x1a7d84;_0x150702=0xc8;}else{_0x150702=0xce;}_0x416538[_0x6567('0x1a')](_0x150702);return _0x416538[_0x6567('0x20')](_0x6567('0x21'),_0x394039+'-'+_0x2320fd+'/'+_0x1a7d84)[_0x6567('0x1b')](_0x39f8e0);}return null;};}function patchUpdates(_0x2ba518){return function(_0x693d75){try{jsonpatch['apply'](_0x693d75,_0x2ba518,!![]);}catch(_0x3903ff){return BPromise[_0x6567('0x22')](_0x3903ff);}return _0x693d75[_0x6567('0x23')]();};}function saveUpdates(_0x38c10b,_0x362f12){return function(_0x536807){if(_0x536807){return _0x536807['update'](_0x38c10b)[_0x6567('0x24')](function(_0x40367a){return _0x40367a;});}return null;};}function removeEntity(_0x564315,_0x100471){return function(_0x1fe5e6){if(_0x1fe5e6){return _0x1fe5e6[_0x6567('0x25')]()[_0x6567('0x24')](function(){_0x564315[_0x6567('0x1a')](0xcc)[_0x6567('0x26')]();});}};}function handleEntityNotFound(_0x2ba9be,_0x123b21){return function(_0x1b4c57){if(!_0x1b4c57){_0x2ba9be[_0x6567('0x19')](0x194);}return _0x1b4c57;};}function handleError(_0x31c863,_0x371e0c){_0x371e0c=_0x371e0c||0x1f4;return function(_0x5ad5a4){logger[_0x6567('0x27')](_0x5ad5a4[_0x6567('0x28')]);if(_0x5ad5a4[_0x6567('0x29')]){delete _0x5ad5a4[_0x6567('0x29')];}_0x31c863['status'](_0x371e0c)[_0x6567('0x2a')](_0x5ad5a4);};}exports[_0x6567('0x2b')]=function(_0xec62f1,_0x436cd2){var _0x2fe833={},_0x333b29={},_0x15c48d={'count':0x0,'rows':[]};var _0x40ee59=_['map'](db['OpenchannelQueueReport'][_0x6567('0x2c')],function(_0x1563f6){return{'name':_0x1563f6[_0x6567('0x2d')],'type':_0x1563f6[_0x6567('0x2e')][_0x6567('0x2f')]};});_0x333b29['model']=_[_0x6567('0x30')](_0x40ee59,_0x6567('0x29'));_0x333b29[_0x6567('0x31')]=_[_0x6567('0x32')](_0xec62f1[_0x6567('0x31')]);_0x333b29[_0x6567('0x33')]=_['intersection'](_0x333b29[_0x6567('0x34')],_0x333b29['query']);_0x2fe833[_0x6567('0x35')]=_['intersection'](_0x333b29[_0x6567('0x34')],qs[_0x6567('0x36')](_0xec62f1['query'][_0x6567('0x36')]));_0x2fe833['attributes']=_0x2fe833[_0x6567('0x35')][_0x6567('0x37')]?_0x2fe833[_0x6567('0x35')]:_0x333b29['model'];if(!_0xec62f1['query'][_0x6567('0x38')](_0x6567('0x39'))){_0x2fe833['limit']=qs[_0x6567('0x1d')](_0xec62f1[_0x6567('0x31')][_0x6567('0x1d')]);_0x2fe833[_0x6567('0x1c')]=qs[_0x6567('0x1c')](_0xec62f1[_0x6567('0x31')]['offset']);}_0x2fe833[_0x6567('0x3a')]=qs[_0x6567('0x3b')](_0xec62f1[_0x6567('0x31')][_0x6567('0x3b')]);_0x2fe833['where']=qs[_0x6567('0x33')](_[_0x6567('0x3c')](_0xec62f1[_0x6567('0x31')],_0x333b29[_0x6567('0x33')]),_0x40ee59);if(_0xec62f1['query'][_0x6567('0x3d')]){_0x2fe833['where']=_[_0x6567('0x3e')](_0x2fe833[_0x6567('0x3f')],{'$or':_[_0x6567('0x30')](_0x40ee59,function(_0x5d61e5){if(_0x5d61e5[_0x6567('0x2e')]!==_0x6567('0x40')){var _0xda277b={};_0xda277b[_0x5d61e5[_0x6567('0x29')]]={'$like':'%'+_0xec62f1[_0x6567('0x31')][_0x6567('0x3d')]+'%'};return _0xda277b;}})});}_0x2fe833=_[_0x6567('0x3e')]({},_0x2fe833,_0xec62f1[_0x6567('0x41')]);var _0x324cb4={'where':_0x2fe833[_0x6567('0x3f')]};return db[_0x6567('0x42')][_0x6567('0x1f')](_0x324cb4)[_0x6567('0x24')](function(_0x29045c){_0x15c48d[_0x6567('0x1f')]=_0x29045c;if(_0xec62f1[_0x6567('0x31')]['includeAll']){_0x2fe833[_0x6567('0x43')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x2fe833);})[_0x6567('0x24')](function(_0x40d757){_0x15c48d['rows']=_0x40d757;return _0x15c48d;})['then'](respondWithFilteredResult(_0x436cd2,_0x2fe833))[_0x6567('0x44')](handleError(_0x436cd2,null));};exports['show']=function(_0x5e20ae,_0x3bd2e0){var _0x15547a={'raw':!![],'where':{'id':_0x5e20ae['params']['id']}},_0x54ea7a={};_0x54ea7a['model']=_[_0x6567('0x32')](db[_0x6567('0x42')]['rawAttributes']);_0x54ea7a[_0x6567('0x31')]=_[_0x6567('0x32')](_0x5e20ae[_0x6567('0x31')]);_0x54ea7a[_0x6567('0x33')]=_['intersection'](_0x54ea7a[_0x6567('0x34')],_0x54ea7a[_0x6567('0x31')]);_0x15547a[_0x6567('0x35')]=_['intersection'](_0x54ea7a[_0x6567('0x34')],qs['fields'](_0x5e20ae['query']['fields']));_0x15547a[_0x6567('0x35')]=_0x15547a[_0x6567('0x35')][_0x6567('0x37')]?_0x15547a[_0x6567('0x35')]:_0x54ea7a[_0x6567('0x34')];if(_0x5e20ae[_0x6567('0x31')][_0x6567('0x45')]){_0x15547a[_0x6567('0x43')]=[{'all':!![]}];}_0x15547a=_['merge']({},_0x15547a,_0x5e20ae[_0x6567('0x41')]);return db[_0x6567('0x42')][_0x6567('0x46')](_0x15547a)['then'](handleEntityNotFound(_0x3bd2e0,null))[_0x6567('0x24')](respondWithResult(_0x3bd2e0,null))[_0x6567('0x44')](handleError(_0x3bd2e0,null));};exports[_0x6567('0x47')]=function(_0x436bda,_0x5368d5){return db[_0x6567('0x42')][_0x6567('0x47')](_0x436bda[_0x6567('0x48')],{})[_0x6567('0x24')](respondWithResult(_0x5368d5,0xc9))[_0x6567('0x44')](handleError(_0x5368d5,null));};exports[_0x6567('0x49')]=function(_0x391bc3,_0x1f98ac){if(_0x391bc3[_0x6567('0x48')]['id']){delete _0x391bc3[_0x6567('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x6567('0x46')]({'where':{'id':_0x391bc3[_0x6567('0x4a')]['id']}})[_0x6567('0x24')](handleEntityNotFound(_0x1f98ac,null))['then'](saveUpdates(_0x391bc3[_0x6567('0x48')],null))['then'](respondWithResult(_0x1f98ac,null))[_0x6567('0x44')](handleError(_0x1f98ac,null));};exports['destroy']=function(_0x277d99,_0x55d9be){return db[_0x6567('0x42')][_0x6567('0x46')]({'where':{'id':_0x277d99[_0x6567('0x4a')]['id']}})[_0x6567('0x24')](handleEntityNotFound(_0x55d9be,null))[_0x6567('0x24')](removeEntity(_0x55d9be,null))[_0x6567('0x44')](handleError(_0x55d9be,null));};exports['describe']=function(_0x4c0bec,_0x545f09){return db['OpenchannelQueueReport'][_0x6567('0x4b')]()['then'](respondWithResult(_0x545f09,null))['catch'](handleError(_0x545f09,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 6612195..a04db14 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x42f4db,_0x2bbcc4){var _0x1b38ee=function(_0x3cba9c){while(--_0x3cba9c){_0x42f4db['push'](_0x42f4db['shift']());}};_0x1b38ee(++_0x2bbcc4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x5fc3[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x31680f,_0x4f289e){var _0x5beae2=function(_0x483eaa){while(--_0x483eaa){_0x31680f['push'](_0x31680f['shift']());}};_0x5beae2(++_0x4f289e);}(_0x1261,0x144));var _0x1126=function(_0x29ecbc,_0x2929d9){_0x29ecbc=_0x29ecbc-0x0;var _0x5709b0=_0x1261[_0x29ecbc];return _0x5709b0;};'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 bb884ca..2c77886 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 _0xd290=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug'];(function(_0x5ab98c,_0x34e59c){var _0x5c3bed=function(_0x407fcc){while(--_0x407fcc){_0x5ab98c['push'](_0x5ab98c['shift']());}};_0x5c3bed(++_0x34e59c);}(_0xd290,0x165));var _0x0d29=function(_0x57cbf6,_0x414bc7){_0x57cbf6=_0x57cbf6-0x0;var _0xf168dc=_0xd290[_0x57cbf6];return _0xf168dc;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var moment=require('moment');var BPromise=require(_0x0d29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d29('0x3'))['db'];var utils=require(_0x0d29('0x4'));var logger=require(_0x0d29('0x5'))(_0x0d29('0x6'));var config=require(_0x0d29('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0d29('0x8')][_0x0d29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151d32,_0x376d19,_0x276aeb){return new BPromise(function(_0x4edfcd,_0x3ee63c){return client[_0x0d29('0xa')](_0x151d32,_0x276aeb)[_0x0d29('0xb')](function(_0x4b876e){logger[_0x0d29('0xc')](_0x0d29('0xd'),_0x376d19,'request\x20sent');logger[_0x0d29('0xe')](_0x0d29('0xf'),_0x376d19,'request\x20sent',JSON[_0x0d29('0x10')](_0x4b876e));if(_0x4b876e['error']){if(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x12')]===0x1f4){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x3ee63c(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x13')]);}logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x4edfcd(_0x4b876e['error']['message']);}else{logger[_0x0d29('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x376d19,_0x0d29('0x14'));_0x4edfcd(_0x4b876e['result'][_0x0d29('0x13')]);}})[_0x0d29('0x15')](function(_0x2a04d6){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x2a04d6);_0x3ee63c(_0x2a04d6);});});}exports[_0x0d29('0x16')]=function(_0x488fa2){var _0x319a36=this;return new Promise(function(_0x2600b3,_0xca30af){return db[_0x0d29('0x17')][_0x0d29('0x18')](_0x488fa2[_0x0d29('0x19')],{'raw':_0x488fa2[_0x0d29('0x1a')]?_0x488fa2['options'][_0x0d29('0x1b')]===undefined?!![]:![]:!![]})[_0x0d29('0xb')](function(_0x215cd7){logger[_0x0d29('0xc')](_0x0d29('0x16'),_0x488fa2);logger[_0x0d29('0xe')](_0x0d29('0x16'),_0x488fa2,JSON[_0x0d29('0x10')](_0x215cd7));_0x2600b3(_0x215cd7);})[_0x0d29('0x15')](function(_0xed8228){logger[_0x0d29('0x11')](_0x0d29('0x16'),_0xed8228[_0x0d29('0x13')],_0x488fa2);_0xca30af(_0x319a36['error'](0x1f4,_0xed8228[_0x0d29('0x13')]));});});};exports[_0x0d29('0x1c')]=function(_0x2f0fe2){var _0xd3afa0=this;return new Promise(function(_0x4adc85,_0x249205){return db[_0x0d29('0x17')][_0x0d29('0x1d')](_0x2f0fe2[_0x0d29('0x19')],{'raw':_0x2f0fe2[_0x0d29('0x1a')]?_0x2f0fe2[_0x0d29('0x1a')][_0x0d29('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f0fe2['options']?_0x2f0fe2['options'][_0x0d29('0x1e')]||null:null,'attributes':_0x2f0fe2['options']?_0x2f0fe2[_0x0d29('0x1a')]['attributes']||null:null,'limit':_0x2f0fe2['options']?_0x2f0fe2[_0x0d29('0x1a')]['limit']||null:null})[_0x0d29('0xb')](function(_0x5c197f){logger[_0x0d29('0xc')](_0x0d29('0x1c'),_0x2f0fe2);logger['debug'](_0x0d29('0x1c'),_0x2f0fe2,JSON[_0x0d29('0x10')](_0x5c197f));_0x4adc85(_0x5c197f);})[_0x0d29('0x15')](function(_0x58caa6){logger[_0x0d29('0x11')](_0x0d29('0x1c'),_0x58caa6[_0x0d29('0x13')],_0x2f0fe2);_0x249205(_0xd3afa0[_0x0d29('0x11')](0x1f4,_0x58caa6[_0x0d29('0x13')]));});});}; \ No newline at end of file +var _0xe511=['info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','UpdateOpenchannelQueueReport','update','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe511,0x16f));var _0x1e51=function(_0xd6d2b9,_0x48c95a){_0xd6d2b9=_0xd6d2b9-0x0;var _0x2a51c5=_0xe511[_0xd6d2b9];return _0x2a51c5;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ed6b,_0x5c4590,_0x4fa2ba){return new BPromise(function(_0x394ad8,_0x133021){return client['request'](_0x21ed6b,_0x4fa2ba)['then'](function(_0x658941){logger[_0x1e51('0xa')](_0x1e51('0xb'),_0x5c4590,_0x1e51('0xc'));logger[_0x1e51('0xd')](_0x1e51('0xe'),_0x5c4590,'request\x20sent',JSON[_0x1e51('0xf')](_0x658941));if(_0x658941[_0x1e51('0x10')]){if(_0x658941[_0x1e51('0x10')][_0x1e51('0x11')]===0x1f4){logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941['error'][_0x1e51('0x12')]);return _0x133021(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);return _0x394ad8(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}else{logger[_0x1e51('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5c4590,_0x1e51('0xc'));_0x394ad8(_0x658941[_0x1e51('0x13')][_0x1e51('0x12')]);}})['catch'](function(_0xa3b410){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5c4590,_0xa3b410);_0x133021(_0xa3b410);});});}exports[_0x1e51('0x14')]=function(_0x27dcad){var _0x40ae4c=this;return new Promise(function(_0x4785a5,_0x4d1aae){return db[_0x1e51('0x15')]['create'](_0x27dcad[_0x1e51('0x16')],{'raw':_0x27dcad['options']?_0x27dcad[_0x1e51('0x17')][_0x1e51('0x18')]===undefined?!![]:![]:!![]})[_0x1e51('0x19')](function(_0x183a95){logger['info']('CreateOpenchannelQueueReport',_0x27dcad);logger['debug']('CreateOpenchannelQueueReport',_0x27dcad,JSON[_0x1e51('0xf')](_0x183a95));_0x4785a5(_0x183a95);})['catch'](function(_0x3f7340){logger[_0x1e51('0x10')](_0x1e51('0x14'),_0x3f7340[_0x1e51('0x12')],_0x27dcad);_0x4d1aae(_0x40ae4c[_0x1e51('0x10')](0x1f4,_0x3f7340[_0x1e51('0x12')]));});});};exports[_0x1e51('0x1a')]=function(_0x461d3d){var _0x4bcdd3=this;return new Promise(function(_0x4d04c0,_0x43f5c5){return db[_0x1e51('0x15')][_0x1e51('0x1b')](_0x461d3d[_0x1e51('0x16')],{'raw':_0x461d3d['options']?_0x461d3d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x461d3d[_0x1e51('0x17')]?_0x461d3d[_0x1e51('0x17')][_0x1e51('0x1c')]||null:null,'attributes':_0x461d3d['options']?_0x461d3d[_0x1e51('0x17')]['attributes']||null:null,'limit':_0x461d3d['options']?_0x461d3d[_0x1e51('0x17')]['limit']||null:null})[_0x1e51('0x19')](function(_0x1eb79f){logger['info'](_0x1e51('0x1a'),_0x461d3d);logger[_0x1e51('0xd')](_0x1e51('0x1a'),_0x461d3d,JSON[_0x1e51('0xf')](_0x1eb79f));_0x4d04c0(_0x1eb79f);})['catch'](function(_0x4cf046){logger['error'](_0x1e51('0x1a'),_0x4cf046[_0x1e51('0x12')],_0x461d3d);_0x43f5c5(_0x4bcdd3[_0x1e51('0x10')](0x1f4,_0x4cf046[_0x1e51('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0cd6b6f..8aac2dd 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 _0x1b9b=['update','delete','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x1bf749,_0x120201){var _0x5f0db9=function(_0x6cdc2b){while(--_0x6cdc2b){_0x1bf749['push'](_0x1bf749['shift']());}};_0x5f0db9(++_0x120201);}(_0x1b9b,0xd2));var _0xb1b9=function(_0x4c9c2b,_0x286b4c){_0x4c9c2b=_0x4c9c2b-0x0;var _0x246768=_0x1b9b[_0x4c9c2b];return _0x246768;};'use strict';var multer=require(_0xb1b9('0x0'));var util=require(_0xb1b9('0x1'));var path=require('path');var timeout=require(_0xb1b9('0x2'));var express=require(_0xb1b9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb1b9('0x4'));var interaction=require(_0xb1b9('0x5'));var config=require('../../config/environment');var controller=require(_0xb1b9('0x6'));router[_0xb1b9('0x7')]('/',auth[_0xb1b9('0x8')](),controller['index']);router['get'](_0xb1b9('0x9'),auth[_0xb1b9('0x8')](),controller[_0xb1b9('0xa')]);router[_0xb1b9('0x7')](_0xb1b9('0xb'),auth['isAuthenticated'](),controller[_0xb1b9('0xc')]);router[_0xb1b9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xb1b9('0x8')](),controller[_0xb1b9('0xe')]);router[_0xb1b9('0xf')](_0xb1b9('0xb'),auth[_0xb1b9('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcfd7=['show','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','/:id','isAuthenticated'];(function(_0x15f515,_0x154277){var _0x5917da=function(_0x4ccb02){while(--_0x4ccb02){_0x15f515['push'](_0x15f515['shift']());}};_0x5917da(++_0x154277);}(_0xcfd7,0x1c8));var _0x7cfd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfd7[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x7cfd('0x0'));var util=require(_0x7cfd('0x1'));var path=require(_0x7cfd('0x2'));var timeout=require(_0x7cfd('0x3'));var express=require('express');var router=express[_0x7cfd('0x4')]();var fs_extra=require(_0x7cfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7cfd('0x6'));var config=require(_0x7cfd('0x7'));var controller=require(_0x7cfd('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7cfd('0x9')](_0x7cfd('0xa'),auth[_0x7cfd('0xb')](),controller[_0x7cfd('0xc')]);router['post']('/',auth[_0x7cfd('0xb')](),controller[_0x7cfd('0xd')]);router[_0x7cfd('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7cfd('0xf')]);router[_0x7cfd('0x10')](_0x7cfd('0xa'),auth[_0x7cfd('0xb')](),controller['destroy']);module[_0x7cfd('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6aa7537..cb99c0b 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4dd1a0,_0x2786d7){var _0x1941e0=function(_0x4bbf79){while(--_0x4bbf79){_0x4dd1a0['push'](_0x4dd1a0['shift']());}};_0x1941e0(++_0x2786d7);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x338fe9,_0x977340){var _0x5c9ed5=function(_0x160fca){while(--_0x160fca){_0x338fe9['push'](_0x338fe9['shift']());}};_0x5c9ed5(++_0x977340);}(_0x70e0,0x17b));var _0x070e=function(_0x2c2c04,_0x8bcd42){_0x2c2c04=_0x2c2c04-0x0;var _0x3b22d9=_0x70e0[_0x2c2c04];return _0x3b22d9;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 5f2ee84..1052a3c 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 _0xd687=['undefined','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','nolimit','limit','sort','filters','pick','filter','merge','VIRTUAL','where','includeAll','include','rows','show','params','length','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset'];(function(_0x93d359,_0x133e38){var _0x3a9524=function(_0x546aa0){while(--_0x546aa0){_0x93d359['push'](_0x93d359['shift']());}};_0x3a9524(++_0x133e38);}(_0xd687,0x1e5));var _0x7d68=function(_0x1dc8ce,_0x46f0a2){_0x1dc8ce=_0x1dc8ce-0x0;var _0xc1fadd=_0xd687[_0x1dc8ce];return _0xc1fadd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d68('0x0'));var zipdir=require(_0x7d68('0x1'));var jsonpatch=require(_0x7d68('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d68('0x3'));var Mustache=require(_0x7d68('0x4'));var util=require(_0x7d68('0x5'));var path=require(_0x7d68('0x6'));var sox=require(_0x7d68('0x7'));var csv=require(_0x7d68('0x8'));var ejs=require(_0x7d68('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d68('0xa'));var squel=require(_0x7d68('0xb'));var crypto=require('crypto');var jsforce=require(_0x7d68('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7d68('0x8'));var querystring=require(_0x7d68('0xd'));var Papa=require(_0x7d68('0xe'));var Redis=require(_0x7d68('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7d68('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d68('0x11'));var logger=require(_0x7d68('0x12'))(_0x7d68('0x13'));var utils=require(_0x7d68('0x14'));var config=require(_0x7d68('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26e579,_0x4ad189){_0x4ad189=_0x4ad189||0xcc;return function(_0x326714){if(_0x326714){return _0x26e579[_0x7d68('0x16')](_0x4ad189);}return _0x26e579[_0x7d68('0x17')](_0x4ad189)['end']();};}function respondWithResult(_0x5800b5,_0x12fe79){_0x12fe79=_0x12fe79||0xc8;return function(_0x1b785c){if(_0x1b785c){return _0x5800b5[_0x7d68('0x17')](_0x12fe79)[_0x7d68('0x18')](_0x1b785c);}};}function respondWithFilteredResult(_0x5bdfd5,_0x69e5e0){return function(_0x2e31b1){if(_0x2e31b1){var _0x3a7d7e=typeof _0x69e5e0[_0x7d68('0x19')]===_0x7d68('0x1a')&&typeof _0x69e5e0['limit']===_0x7d68('0x1a');var _0x3f988b=_0x2e31b1[_0x7d68('0x1b')];var _0x3caae6=_0x3a7d7e?0x0:_0x69e5e0['offset'];var _0x291966=_0x3a7d7e?_0x2e31b1[_0x7d68('0x1b')]:_0x69e5e0[_0x7d68('0x19')]+_0x69e5e0['limit'];var _0x25cd9d;if(_0x291966>=_0x3f988b){_0x291966=_0x3f988b;_0x25cd9d=0xc8;}else{_0x25cd9d=0xce;}_0x5bdfd5['status'](_0x25cd9d);return _0x5bdfd5[_0x7d68('0x1c')](_0x7d68('0x1d'),_0x3caae6+'-'+_0x291966+'/'+_0x3f988b)[_0x7d68('0x18')](_0x2e31b1);}return null;};}function patchUpdates(_0x3851b8){return function(_0x3b9b2c){try{jsonpatch[_0x7d68('0x1e')](_0x3b9b2c,_0x3851b8,!![]);}catch(_0x2d2c7c){return BPromise['reject'](_0x2d2c7c);}return _0x3b9b2c[_0x7d68('0x1f')]();};}function saveUpdates(_0x1b7479,_0x2bb8a4){return function(_0x3d1efc){if(_0x3d1efc){return _0x3d1efc[_0x7d68('0x20')](_0x1b7479)[_0x7d68('0x21')](function(_0x3e0d94){return _0x3e0d94;});}return null;};}function removeEntity(_0x3f4830,_0x4371bc){return function(_0x5f1bfe){if(_0x5f1bfe){return _0x5f1bfe[_0x7d68('0x22')]()[_0x7d68('0x21')](function(){_0x3f4830[_0x7d68('0x17')](0xcc)[_0x7d68('0x23')]();});}};}function handleEntityNotFound(_0x42f5de,_0x2aee51){return function(_0x4abbdc){if(!_0x4abbdc){_0x42f5de['sendStatus'](0x194);}return _0x4abbdc;};}function handleError(_0x3536df,_0x34615a){_0x34615a=_0x34615a||0x1f4;return function(_0x581290){logger[_0x7d68('0x24')](_0x581290[_0x7d68('0x25')]);if(_0x581290[_0x7d68('0x26')]){delete _0x581290['name'];}_0x3536df['status'](_0x34615a)[_0x7d68('0x27')](_0x581290);};}exports[_0x7d68('0x28')]=function(_0x23633b,_0x3bc2a3){var _0x107535={},_0x4e26a7={},_0x38a8fe={'count':0x0,'rows':[]};var _0x2e03e7=_[_0x7d68('0x29')](db[_0x7d68('0x2a')][_0x7d68('0x2b')],function(_0x5d4f59){return{'name':_0x5d4f59['fieldName'],'type':_0x5d4f59[_0x7d68('0x2c')][_0x7d68('0x2d')]};});_0x4e26a7[_0x7d68('0x2e')]=_[_0x7d68('0x29')](_0x2e03e7,_0x7d68('0x26'));_0x4e26a7['query']=_[_0x7d68('0x2f')](_0x23633b[_0x7d68('0x30')]);_0x4e26a7['filters']=_[_0x7d68('0x31')](_0x4e26a7[_0x7d68('0x2e')],_0x4e26a7[_0x7d68('0x30')]);_0x107535[_0x7d68('0x32')]=_[_0x7d68('0x31')](_0x4e26a7[_0x7d68('0x2e')],qs[_0x7d68('0x33')](_0x23633b[_0x7d68('0x30')][_0x7d68('0x33')]));_0x107535['attributes']=_0x107535[_0x7d68('0x32')]['length']?_0x107535[_0x7d68('0x32')]:_0x4e26a7[_0x7d68('0x2e')];if(!_0x23633b[_0x7d68('0x30')]['hasOwnProperty'](_0x7d68('0x34'))){_0x107535['limit']=qs[_0x7d68('0x35')](_0x23633b[_0x7d68('0x30')][_0x7d68('0x35')]);_0x107535[_0x7d68('0x19')]=qs[_0x7d68('0x19')](_0x23633b[_0x7d68('0x30')][_0x7d68('0x19')]);}_0x107535['order']=qs[_0x7d68('0x36')](_0x23633b[_0x7d68('0x30')]['sort']);_0x107535['where']=qs[_0x7d68('0x37')](_[_0x7d68('0x38')](_0x23633b[_0x7d68('0x30')],_0x4e26a7[_0x7d68('0x37')]),_0x2e03e7);if(_0x23633b[_0x7d68('0x30')][_0x7d68('0x39')]){_0x107535['where']=_[_0x7d68('0x3a')](_0x107535['where'],{'$or':_[_0x7d68('0x29')](_0x2e03e7,function(_0x551283){if(_0x551283[_0x7d68('0x2c')]!==_0x7d68('0x3b')){var _0x399d34={};_0x399d34[_0x551283[_0x7d68('0x26')]]={'$like':'%'+_0x23633b['query']['filter']+'%'};return _0x399d34;}})});}_0x107535=_['merge']({},_0x107535,_0x23633b['options']);var _0x4f3c01={'where':_0x107535[_0x7d68('0x3c')]};return db[_0x7d68('0x2a')]['count'](_0x4f3c01)[_0x7d68('0x21')](function(_0x1d124b){_0x38a8fe[_0x7d68('0x1b')]=_0x1d124b;if(_0x23633b['query'][_0x7d68('0x3d')]){_0x107535[_0x7d68('0x3e')]=[{'all':!![]}];}return db[_0x7d68('0x2a')]['findAll'](_0x107535);})[_0x7d68('0x21')](function(_0x54f40d){_0x38a8fe[_0x7d68('0x3f')]=_0x54f40d;return _0x38a8fe;})[_0x7d68('0x21')](respondWithFilteredResult(_0x3bc2a3,_0x107535))['catch'](handleError(_0x3bc2a3,null));};exports[_0x7d68('0x40')]=function(_0x412f8a,_0x46aa35){var _0x50b920={'raw':!![],'where':{'id':_0x412f8a[_0x7d68('0x41')]['id']}},_0x3e9b89={};_0x3e9b89['model']=_[_0x7d68('0x2f')](db['OpenchannelTransferReport']['rawAttributes']);_0x3e9b89['query']=_[_0x7d68('0x2f')](_0x412f8a[_0x7d68('0x30')]);_0x3e9b89[_0x7d68('0x37')]=_[_0x7d68('0x31')](_0x3e9b89[_0x7d68('0x2e')],_0x3e9b89[_0x7d68('0x30')]);_0x50b920[_0x7d68('0x32')]=_[_0x7d68('0x31')](_0x3e9b89[_0x7d68('0x2e')],qs[_0x7d68('0x33')](_0x412f8a[_0x7d68('0x30')][_0x7d68('0x33')]));_0x50b920[_0x7d68('0x32')]=_0x50b920[_0x7d68('0x32')][_0x7d68('0x42')]?_0x50b920[_0x7d68('0x32')]:_0x3e9b89[_0x7d68('0x2e')];if(_0x412f8a['query'][_0x7d68('0x3d')]){_0x50b920['include']=[{'all':!![]}];}_0x50b920=_[_0x7d68('0x3a')]({},_0x50b920,_0x412f8a[_0x7d68('0x43')]);return db[_0x7d68('0x2a')][_0x7d68('0x44')](_0x50b920)[_0x7d68('0x21')](handleEntityNotFound(_0x46aa35,null))['then'](respondWithResult(_0x46aa35,null))[_0x7d68('0x45')](handleError(_0x46aa35,null));};exports[_0x7d68('0x46')]=function(_0x4175b8,_0x242d8b){return db[_0x7d68('0x2a')][_0x7d68('0x46')](_0x4175b8[_0x7d68('0x47')],{})[_0x7d68('0x21')](respondWithResult(_0x242d8b,0xc9))[_0x7d68('0x45')](handleError(_0x242d8b,null));};exports[_0x7d68('0x20')]=function(_0x3bbd6e,_0x4530c2){if(_0x3bbd6e[_0x7d68('0x47')]['id']){delete _0x3bbd6e[_0x7d68('0x47')]['id'];}return db[_0x7d68('0x2a')][_0x7d68('0x44')]({'where':{'id':_0x3bbd6e[_0x7d68('0x41')]['id']}})[_0x7d68('0x21')](handleEntityNotFound(_0x4530c2,null))[_0x7d68('0x21')](saveUpdates(_0x3bbd6e['body'],null))[_0x7d68('0x21')](respondWithResult(_0x4530c2,null))['catch'](handleError(_0x4530c2,null));};exports[_0x7d68('0x22')]=function(_0xf6a86b,_0x12700b){return db[_0x7d68('0x2a')][_0x7d68('0x44')]({'where':{'id':_0xf6a86b[_0x7d68('0x41')]['id']}})[_0x7d68('0x21')](handleEntityNotFound(_0x12700b,null))['then'](removeEntity(_0x12700b,null))[_0x7d68('0x45')](handleError(_0x12700b,null));};exports['describe']=function(_0x277c70,_0x5e942e){return db[_0x7d68('0x2a')][_0x7d68('0x48')]()[_0x7d68('0x21')](respondWithResult(_0x5e942e,null))[_0x7d68('0x45')](handleError(_0x5e942e,null));}; \ No newline at end of file +var _0xa16d=['include','findAll','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll'];(function(_0x20cb5d,_0x5b6ec7){var _0x33dd23=function(_0x5918a9){while(--_0x5918a9){_0x20cb5d['push'](_0x20cb5d['shift']());}};_0x33dd23(++_0x5b6ec7);}(_0xa16d,0x18a));var _0xda16=function(_0x1622a0,_0x2b55a9){_0x1622a0=_0x1622a0-0x0;var _0x2a2308=_0xa16d[_0x1622a0];return _0x2a2308;};'use strict';var emlformat=require(_0xda16('0x0'));var rimraf=require(_0xda16('0x1'));var zipdir=require(_0xda16('0x2'));var jsonpatch=require(_0xda16('0x3'));var rp=require(_0xda16('0x4'));var moment=require(_0xda16('0x5'));var BPromise=require(_0xda16('0x6'));var Mustache=require(_0xda16('0x7'));var util=require('util');var path=require(_0xda16('0x8'));var sox=require(_0xda16('0x9'));var csv=require('to-csv');var ejs=require(_0xda16('0xa'));var fs=require('fs');var fs_extra=require(_0xda16('0xb'));var _=require(_0xda16('0xc'));var squel=require(_0xda16('0xd'));var crypto=require(_0xda16('0xe'));var jsforce=require(_0xda16('0xf'));var deskjs=require(_0xda16('0x10'));var toCsv=require(_0xda16('0x11'));var querystring=require('querystring');var Papa=require(_0xda16('0x12'));var Redis=require(_0xda16('0x13'));var authService=require(_0xda16('0x14'));var qs=require(_0xda16('0x15'));var as=require(_0xda16('0x16'));var hardwareService=require(_0xda16('0x17'));var logger=require(_0xda16('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xda16('0x19'));var db=require(_0xda16('0x1a'))['db'];function respondWithStatusCode(_0x41192b,_0x483e3a){_0x483e3a=_0x483e3a||0xcc;return function(_0x11c9b5){if(_0x11c9b5){return _0x41192b['sendStatus'](_0x483e3a);}return _0x41192b[_0xda16('0x1b')](_0x483e3a)[_0xda16('0x1c')]();};}function respondWithResult(_0x136022,_0x39040b){_0x39040b=_0x39040b||0xc8;return function(_0x16255b){if(_0x16255b){return _0x136022[_0xda16('0x1b')](_0x39040b)[_0xda16('0x1d')](_0x16255b);}};}function respondWithFilteredResult(_0x55cc89,_0x5a2613){return function(_0x1ec5de){if(_0x1ec5de){var _0x1d5172=typeof _0x5a2613[_0xda16('0x1e')]==='undefined'&&typeof _0x5a2613['limit']===_0xda16('0x1f');var _0x36dc83=_0x1ec5de[_0xda16('0x20')];var _0x15e039=_0x1d5172?0x0:_0x5a2613[_0xda16('0x1e')];var _0x56c6ce=_0x1d5172?_0x1ec5de[_0xda16('0x20')]:_0x5a2613['offset']+_0x5a2613[_0xda16('0x21')];var _0x47d7f6;if(_0x56c6ce>=_0x36dc83){_0x56c6ce=_0x36dc83;_0x47d7f6=0xc8;}else{_0x47d7f6=0xce;}_0x55cc89['status'](_0x47d7f6);return _0x55cc89['set'](_0xda16('0x22'),_0x15e039+'-'+_0x56c6ce+'/'+_0x36dc83)['json'](_0x1ec5de);}return null;};}function patchUpdates(_0x4ace29){return function(_0x5aee9a){try{jsonpatch['apply'](_0x5aee9a,_0x4ace29,!![]);}catch(_0x3db444){return BPromise[_0xda16('0x23')](_0x3db444);}return _0x5aee9a[_0xda16('0x24')]();};}function saveUpdates(_0x2f4e57,_0x37ed67){return function(_0x33e258){if(_0x33e258){return _0x33e258[_0xda16('0x25')](_0x2f4e57)[_0xda16('0x26')](function(_0x5a025c){return _0x5a025c;});}return null;};}function removeEntity(_0x35a587,_0x43d424){return function(_0xfc99ca){if(_0xfc99ca){return _0xfc99ca[_0xda16('0x27')]()['then'](function(){_0x35a587[_0xda16('0x1b')](0xcc)[_0xda16('0x1c')]();});}};}function handleEntityNotFound(_0x561095,_0x934a50){return function(_0x3bbe57){if(!_0x3bbe57){_0x561095[_0xda16('0x28')](0x194);}return _0x3bbe57;};}function handleError(_0x1b27d9,_0x52bf5a){_0x52bf5a=_0x52bf5a||0x1f4;return function(_0x15d7d8){logger[_0xda16('0x29')](_0x15d7d8[_0xda16('0x2a')]);if(_0x15d7d8[_0xda16('0x2b')]){delete _0x15d7d8[_0xda16('0x2b')];}_0x1b27d9['status'](_0x52bf5a)[_0xda16('0x2c')](_0x15d7d8);};}exports[_0xda16('0x2d')]=function(_0x1d96e4,_0x56ef3a){var _0x15e09a={},_0x3f5150={},_0x3f3f2c={'count':0x0,'rows':[]};var _0x3e071f=_[_0xda16('0x2e')](db[_0xda16('0x2f')]['rawAttributes'],function(_0x4a01dc){return{'name':_0x4a01dc[_0xda16('0x30')],'type':_0x4a01dc['type'][_0xda16('0x31')]};});_0x3f5150[_0xda16('0x32')]=_[_0xda16('0x2e')](_0x3e071f,'name');_0x3f5150[_0xda16('0x33')]=_['keys'](_0x1d96e4[_0xda16('0x33')]);_0x3f5150[_0xda16('0x34')]=_[_0xda16('0x35')](_0x3f5150[_0xda16('0x32')],_0x3f5150[_0xda16('0x33')]);_0x15e09a['attributes']=_[_0xda16('0x35')](_0x3f5150[_0xda16('0x32')],qs[_0xda16('0x36')](_0x1d96e4[_0xda16('0x33')][_0xda16('0x36')]));_0x15e09a[_0xda16('0x37')]=_0x15e09a[_0xda16('0x37')][_0xda16('0x38')]?_0x15e09a[_0xda16('0x37')]:_0x3f5150[_0xda16('0x32')];if(!_0x1d96e4[_0xda16('0x33')][_0xda16('0x39')]('nolimit')){_0x15e09a[_0xda16('0x21')]=qs[_0xda16('0x21')](_0x1d96e4[_0xda16('0x33')][_0xda16('0x21')]);_0x15e09a[_0xda16('0x1e')]=qs[_0xda16('0x1e')](_0x1d96e4[_0xda16('0x33')]['offset']);}_0x15e09a[_0xda16('0x3a')]=qs[_0xda16('0x3b')](_0x1d96e4['query'][_0xda16('0x3b')]);_0x15e09a['where']=qs[_0xda16('0x34')](_[_0xda16('0x3c')](_0x1d96e4['query'],_0x3f5150[_0xda16('0x34')]),_0x3e071f);if(_0x1d96e4[_0xda16('0x33')][_0xda16('0x3d')]){_0x15e09a[_0xda16('0x3e')]=_[_0xda16('0x3f')](_0x15e09a['where'],{'$or':_[_0xda16('0x2e')](_0x3e071f,function(_0x4282b8){if(_0x4282b8[_0xda16('0x40')]!==_0xda16('0x41')){var _0x997929={};_0x997929[_0x4282b8[_0xda16('0x2b')]]={'$like':'%'+_0x1d96e4[_0xda16('0x33')][_0xda16('0x3d')]+'%'};return _0x997929;}})});}_0x15e09a=_[_0xda16('0x3f')]({},_0x15e09a,_0x1d96e4[_0xda16('0x42')]);var _0x2811b0={'where':_0x15e09a[_0xda16('0x3e')]};return db[_0xda16('0x2f')][_0xda16('0x20')](_0x2811b0)[_0xda16('0x26')](function(_0x3ad3d8){_0x3f3f2c[_0xda16('0x20')]=_0x3ad3d8;if(_0x1d96e4[_0xda16('0x33')][_0xda16('0x43')]){_0x15e09a[_0xda16('0x44')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xda16('0x45')](_0x15e09a);})['then'](function(_0x140585){_0x3f3f2c['rows']=_0x140585;return _0x3f3f2c;})['then'](respondWithFilteredResult(_0x56ef3a,_0x15e09a))[_0xda16('0x46')](handleError(_0x56ef3a,null));};exports[_0xda16('0x47')]=function(_0x220c31,_0x480279){var _0x42c5f9={'raw':!![],'where':{'id':_0x220c31[_0xda16('0x48')]['id']}},_0x4910ad={};_0x4910ad[_0xda16('0x32')]=_[_0xda16('0x49')](db[_0xda16('0x2f')]['rawAttributes']);_0x4910ad['query']=_[_0xda16('0x49')](_0x220c31[_0xda16('0x33')]);_0x4910ad[_0xda16('0x34')]=_['intersection'](_0x4910ad['model'],_0x4910ad[_0xda16('0x33')]);_0x42c5f9[_0xda16('0x37')]=_[_0xda16('0x35')](_0x4910ad[_0xda16('0x32')],qs['fields'](_0x220c31[_0xda16('0x33')][_0xda16('0x36')]));_0x42c5f9['attributes']=_0x42c5f9[_0xda16('0x37')][_0xda16('0x38')]?_0x42c5f9[_0xda16('0x37')]:_0x4910ad['model'];if(_0x220c31['query']['includeAll']){_0x42c5f9['include']=[{'all':!![]}];}_0x42c5f9=_['merge']({},_0x42c5f9,_0x220c31['options']);return db['OpenchannelTransferReport']['find'](_0x42c5f9)[_0xda16('0x26')](handleEntityNotFound(_0x480279,null))[_0xda16('0x26')](respondWithResult(_0x480279,null))[_0xda16('0x46')](handleError(_0x480279,null));};exports['create']=function(_0x543bbc,_0x55a4df){return db['OpenchannelTransferReport'][_0xda16('0x4a')](_0x543bbc[_0xda16('0x4b')],{})[_0xda16('0x26')](respondWithResult(_0x55a4df,0xc9))['catch'](handleError(_0x55a4df,null));};exports['update']=function(_0x528cb3,_0x5d49a8){if(_0x528cb3['body']['id']){delete _0x528cb3['body']['id'];}return db[_0xda16('0x2f')][_0xda16('0x4c')]({'where':{'id':_0x528cb3[_0xda16('0x48')]['id']}})[_0xda16('0x26')](handleEntityNotFound(_0x5d49a8,null))[_0xda16('0x26')](saveUpdates(_0x528cb3['body'],null))['then'](respondWithResult(_0x5d49a8,null))[_0xda16('0x46')](handleError(_0x5d49a8,null));};exports['destroy']=function(_0x2c3fd4,_0x1e4b5f){return db[_0xda16('0x2f')][_0xda16('0x4c')]({'where':{'id':_0x2c3fd4[_0xda16('0x48')]['id']}})[_0xda16('0x26')](handleEntityNotFound(_0x1e4b5f,null))[_0xda16('0x26')](removeEntity(_0x1e4b5f,null))[_0xda16('0x46')](handleError(_0x1e4b5f,null));};exports['describe']=function(_0x865749,_0x510ab9){return db[_0xda16('0x2f')]['describe']()[_0xda16('0x26')](respondWithResult(_0x510ab9,null))[_0xda16('0x46')](handleError(_0x510ab9,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 580c07a..340ebb3 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 _0x8c35=['exports','define','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x8c35,0x153));var _0x58c3=function(_0x3059bd,_0x1edc9b){_0x3059bd=_0x3059bd-0x0;var _0xa294b=_0x8c35[_0x3059bd];return _0xa294b;};'use strict';var _=require(_0x58c3('0x0'));var util=require(_0x58c3('0x1'));var logger=require(_0x58c3('0x2'))(_0x58c3('0x3'));var moment=require('moment');var BPromise=require(_0x58c3('0x4'));var rp=require(_0x58c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58c3('0x6'));var config=require(_0x58c3('0x7'));var attributes=require(_0x58c3('0x8'));module[_0x58c3('0x9')]=function(_0x1de548,_0x54de75){return _0x1de548[_0x58c3('0xa')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x58c3('0xb'),'fields':[_0x58c3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x06a6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','uniqueid','lodash','api'];(function(_0x48c03c,_0x3a0d41){var _0x33b898=function(_0x1d5f1a){while(--_0x1d5f1a){_0x48c03c['push'](_0x48c03c['shift']());}};_0x33b898(++_0x3a0d41);}(_0x06a6,0x1b6));var _0x606a=function(_0x29b67a,_0x45b0f0){_0x29b67a=_0x29b67a-0x0;var _0x575714=_0x06a6[_0x29b67a];return _0x575714;};'use strict';var _=require(_0x606a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x606a('0x1'));var moment=require(_0x606a('0x2'));var BPromise=require(_0x606a('0x3'));var rp=require(_0x606a('0x4'));var fs=require('fs');var path=require(_0x606a('0x5'));var rimraf=require(_0x606a('0x6'));var config=require(_0x606a('0x7'));var attributes=require(_0x606a('0x8'));module['exports']=function(_0x3d9cb1,_0x2d3fa0){return _0x3d9cb1['define'](_0x606a('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x606a('0xa'),'fields':[_0x606a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index cf98288..bf51b4e 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 _0x294b=['jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x468fa5,_0x2062bb){var _0x1d9d6c=function(_0x4814d6){while(--_0x4814d6){_0x468fa5['push'](_0x468fa5['shift']());}};_0x1d9d6c(++_0x2062bb);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var moment=require(_0xb294('0x1'));var BPromise=require(_0xb294('0x2'));var rs=require(_0xb294('0x3'));var fs=require('fs');var Redis=require(_0xb294('0x4'));var db=require(_0xb294('0x5'))['db'];var utils=require(_0xb294('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb294('0x7'));var jayson=require(_0xb294('0x8'));var client=jayson[_0xb294('0x9')][_0xb294('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc7910,_0x509dbd,_0x39dfbf){return new BPromise(function(_0x5110aa,_0x5226a4){return client['request'](_0xcc7910,_0x39dfbf)[_0xb294('0xb')](function(_0x33f8e5){logger[_0xb294('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,'request\x20sent');logger['debug'](_0xb294('0xd'),_0x509dbd,_0xb294('0xe'),JSON[_0xb294('0xf')](_0x33f8e5));if(_0x33f8e5[_0xb294('0x10')]){if(_0x33f8e5[_0xb294('0x10')][_0xb294('0x11')]===0x1f4){logger[_0xb294('0x10')](_0xb294('0x12'),_0x509dbd,_0x33f8e5[_0xb294('0x10')][_0xb294('0x13')]);return _0x5226a4(_0x33f8e5['error']['message']);}logger[_0xb294('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,_0x33f8e5['error'][_0xb294('0x13')]);return _0x5110aa(_0x33f8e5[_0xb294('0x10')][_0xb294('0x13')]);}else{logger[_0xb294('0xc')](_0xb294('0x12'),_0x509dbd,_0xb294('0xe'));_0x5110aa(_0x33f8e5[_0xb294('0x14')][_0xb294('0x13')]);}})[_0xb294('0x15')](function(_0x289839){logger[_0xb294('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x509dbd,_0x289839);_0x5226a4(_0x289839);});});} \ No newline at end of file +var _0xa1f6=['client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise'];(function(_0x2e63c4,_0x3eebe9){var _0x41ae37=function(_0x51139b){while(--_0x51139b){_0x2e63c4['push'](_0x2e63c4['shift']());}};_0x41ae37(++_0x3eebe9);}(_0xa1f6,0x19d));var _0x6a1f=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0xa1f6[_0xcf5436];return _0xc4f5c8;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var moment=require(_0x6a1f('0x2'));var BPromise=require(_0x6a1f('0x3'));var rs=require(_0x6a1f('0x4'));var fs=require('fs');var Redis=require(_0x6a1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6a1f('0x6'));var client=jayson[_0x6a1f('0x7')][_0x6a1f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a772b,_0x328033,_0x3ecd63){return new BPromise(function(_0x36c00b,_0x56bf63){return client[_0x6a1f('0x9')](_0x3a772b,_0x3ecd63)[_0x6a1f('0xa')](function(_0x2300b1){logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x328033,'request\x20sent');logger[_0x6a1f('0xd')](_0x6a1f('0xe'),_0x328033,_0x6a1f('0xf'),JSON[_0x6a1f('0x10')](_0x2300b1));if(_0x2300b1['error']){if(_0x2300b1[_0x6a1f('0x11')]['code']===0x1f4){logger[_0x6a1f('0x11')](_0x6a1f('0xc'),_0x328033,_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);return _0x56bf63(_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);}logger[_0x6a1f('0x11')](_0x6a1f('0xc'),_0x328033,_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);return _0x36c00b(_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);}else{logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x328033,_0x6a1f('0xf'));_0x36c00b(_0x2300b1[_0x6a1f('0x13')][_0x6a1f('0x12')]);}})[_0x6a1f('0x14')](function(_0x2c44a0){logger['error'](_0x6a1f('0xc'),_0x328033,_0x2c44a0);_0x56bf63(_0x2c44a0);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 45901ee..445de50 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 _0xac33=['/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index'];(function(_0xbc4f9f,_0x111984){var _0x3bec7d=function(_0x2f5ed7){while(--_0x2f5ed7){_0xbc4f9f['push'](_0xbc4f9f['shift']());}};_0x3bec7d(++_0x111984);}(_0xac33,0xea));var _0x3ac3=function(_0x317725,_0x1bd734){_0x317725=_0x317725-0x0;var _0x1e08cb=_0xac33[_0x317725];return _0x1e08cb;};'use strict';var multer=require(_0x3ac3('0x0'));var util=require(_0x3ac3('0x1'));var path=require(_0x3ac3('0x2'));var timeout=require(_0x3ac3('0x3'));var express=require(_0x3ac3('0x4'));var router=express['Router']();var fs_extra=require(_0x3ac3('0x5'));var auth=require(_0x3ac3('0x6'));var interaction=require(_0x3ac3('0x7'));var config=require(_0x3ac3('0x8'));var controller=require(_0x3ac3('0x9'));router[_0x3ac3('0xa')]('/',auth[_0x3ac3('0xb')](),controller[_0x3ac3('0xc')]);router[_0x3ac3('0xa')](_0x3ac3('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x3ac3('0xb')](),controller[_0x3ac3('0xe')]);router[_0x3ac3('0xf')](_0x3ac3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x3ac3('0x10')](_0x3ac3('0xd'),auth[_0x3ac3('0xb')](),controller[_0x3ac3('0x11')]);module[_0x3ac3('0x12')]=router; \ No newline at end of file +var _0xac2b=['show','post','isAuthenticated','create','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./pause.controller','index','get'];(function(_0xad3ac2,_0xb570a2){var _0x4a53f3=function(_0x120253){while(--_0x120253){_0xad3ac2['push'](_0xad3ac2['shift']());}};_0x4a53f3(++_0xb570a2);}(_0xac2b,0x182));var _0xbac2=function(_0x1a7a1b,_0x518846){_0x1a7a1b=_0x1a7a1b-0x0;var _0x350750=_0xac2b[_0x1a7a1b];return _0x350750;};'use strict';var multer=require('multer');var util=require(_0xbac2('0x0'));var path=require(_0xbac2('0x1'));var timeout=require(_0xbac2('0x2'));var express=require(_0xbac2('0x3'));var router=express[_0xbac2('0x4')]();var fs_extra=require(_0xbac2('0x5'));var auth=require(_0xbac2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbac2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbac2('0x8')]);router[_0xbac2('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbac2('0xa')]);router[_0xbac2('0xb')]('/',auth[_0xbac2('0xc')](),controller[_0xbac2('0xd')]);router['put'](_0xbac2('0xe'),auth[_0xbac2('0xc')](),controller[_0xbac2('0xf')]);router[_0xbac2('0x10')](_0xbac2('0xe'),auth[_0xbac2('0xc')](),controller['destroy']);module[_0xbac2('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 8e0a13a..014e3ba 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 _0x821c=['name','STRING','sequelize'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x821c,0x12b));var _0xc821=function(_0x1ca93c,_0x3271ab){_0x1ca93c=_0x1ca93c-0x0;var _0x185169=_0x821c[_0x1ca93c];return _0x185169;};'use strict';var Sequelize=require(_0xc821('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc821('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xc821('0x2')]}}; \ No newline at end of file +var _0xacd0=['STRING','name'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xacd0,0x14a));var _0x0acd=function(_0x386306,_0x1363c9){_0x386306=_0x386306-0x0;var _0xcb23d=_0xacd0[_0x386306];return _0xcb23d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0acd('0x0')],'unique':_0x0acd('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x0acd('0x0')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 0ff2064..b9c6b36 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 _0x581e=['filter','merge','VIRTUAL','Pause','includeAll','findAll','show','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','userProfileId','autoAssociation','params','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','order','sort','where','pick','filters'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0x581e,0x18f));var _0xe581=function(_0x33e348,_0x42c2f0){_0x33e348=_0x33e348-0x0;var _0x208b39=_0x581e[_0x33e348];return _0x208b39;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe581('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe581('0x1'));var Mustache=require(_0xe581('0x2'));var util=require(_0xe581('0x3'));var path=require(_0xe581('0x4'));var sox=require(_0xe581('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe581('0x6'));var _=require(_0xe581('0x7'));var squel=require(_0xe581('0x8'));var crypto=require(_0xe581('0x9'));var jsforce=require(_0xe581('0xa'));var deskjs=require(_0xe581('0xb'));var toCsv=require(_0xe581('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe581('0xd'));var qs=require(_0xe581('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe581('0xf'));var logger=require(_0xe581('0x10'))(_0xe581('0x11'));var utils=require('../../config/utils');var config=require(_0xe581('0x12'));var licenseUtil=require(_0xe581('0x13'));var db=require(_0xe581('0x14'))['db'];function respondWithStatusCode(_0x2b2887,_0x38963d){_0x38963d=_0x38963d||0xcc;return function(_0x3a2d72){if(_0x3a2d72){return _0x2b2887['sendStatus'](_0x38963d);}return _0x2b2887[_0xe581('0x15')](_0x38963d)[_0xe581('0x16')]();};}function respondWithResult(_0x1f63cb,_0x42bdff){_0x42bdff=_0x42bdff||0xc8;return function(_0x5c4798){if(_0x5c4798){return _0x1f63cb[_0xe581('0x15')](_0x42bdff)[_0xe581('0x17')](_0x5c4798);}};}function respondWithFilteredResult(_0x2803d7,_0x33765b){return function(_0x165f97){if(_0x165f97){var _0x3560c2=typeof _0x33765b[_0xe581('0x18')]===_0xe581('0x19')&&typeof _0x33765b[_0xe581('0x1a')]==='undefined';var _0xc4a087=_0x165f97[_0xe581('0x1b')];var _0x3c8265=_0x3560c2?0x0:_0x33765b['offset'];var _0x195119=_0x3560c2?_0x165f97[_0xe581('0x1b')]:_0x33765b[_0xe581('0x18')]+_0x33765b['limit'];var _0x4d6cb2;if(_0x195119>=_0xc4a087){_0x195119=_0xc4a087;_0x4d6cb2=0xc8;}else{_0x4d6cb2=0xce;}_0x2803d7[_0xe581('0x15')](_0x4d6cb2);return _0x2803d7[_0xe581('0x1c')]('Content-Range',_0x3c8265+'-'+_0x195119+'/'+_0xc4a087)['json'](_0x165f97);}return null;};}function patchUpdates(_0x583276){return function(_0x5ecc9d){try{jsonpatch['apply'](_0x5ecc9d,_0x583276,!![]);}catch(_0x1b73fc){return BPromise[_0xe581('0x1d')](_0x1b73fc);}return _0x5ecc9d[_0xe581('0x1e')]();};}function saveUpdates(_0x154648,_0x3ff1c8){return function(_0x3ef812){if(_0x3ef812){return _0x3ef812[_0xe581('0x1f')](_0x154648)[_0xe581('0x20')](function(_0x4541bf){return _0x4541bf;});}return null;};}function removeEntity(_0x5455f5,_0x44ed9b){return function(_0x4ef870){if(_0x4ef870){return _0x4ef870[_0xe581('0x21')]()['then'](function(){var _0x224c03=_0x4ef870[_0xe581('0x22')]({'plain':!![]});var _0x5eebfa='Pauses';return db[_0xe581('0x23')][_0xe581('0x21')]({'where':{'type':_0x5eebfa,'resourceId':_0x224c03['id']}})[_0xe581('0x20')](function(){return _0x4ef870;});})[_0xe581('0x20')](function(){_0x5455f5[_0xe581('0x15')](0xcc)[_0xe581('0x16')]();});}};}function handleEntityNotFound(_0x5a0ec1,_0x42f516){return function(_0x402b7f){if(!_0x402b7f){_0x5a0ec1[_0xe581('0x24')](0x194);}return _0x402b7f;};}function handleError(_0x4276ca,_0x1977c2){_0x1977c2=_0x1977c2||0x1f4;return function(_0x10d852){logger[_0xe581('0x25')](_0x10d852[_0xe581('0x26')]);if(_0x10d852[_0xe581('0x27')]){delete _0x10d852[_0xe581('0x27')];}_0x4276ca[_0xe581('0x15')](_0x1977c2)['send'](_0x10d852);};}exports[_0xe581('0x28')]=function(_0x1f613f,_0x342230){var _0x3ef912={},_0x3d05bb={},_0x347586={'count':0x0,'rows':[]};var _0x2dcce9=_[_0xe581('0x29')](db['Pause'][_0xe581('0x2a')],function(_0x417ac4){return{'name':_0x417ac4[_0xe581('0x2b')],'type':_0x417ac4[_0xe581('0x2c')]['key']};});_0x3d05bb[_0xe581('0x2d')]=_['map'](_0x2dcce9,_0xe581('0x27'));_0x3d05bb[_0xe581('0x2e')]=_[_0xe581('0x2f')](_0x1f613f[_0xe581('0x2e')]);_0x3d05bb['filters']=_[_0xe581('0x30')](_0x3d05bb['model'],_0x3d05bb[_0xe581('0x2e')]);_0x3ef912['attributes']=_[_0xe581('0x30')](_0x3d05bb['model'],qs['fields'](_0x1f613f[_0xe581('0x2e')][_0xe581('0x31')]));_0x3ef912[_0xe581('0x32')]=_0x3ef912['attributes'][_0xe581('0x33')]?_0x3ef912[_0xe581('0x32')]:_0x3d05bb['model'];if(!_0x1f613f[_0xe581('0x2e')]['hasOwnProperty']('nolimit')){_0x3ef912[_0xe581('0x1a')]=qs[_0xe581('0x1a')](_0x1f613f[_0xe581('0x2e')][_0xe581('0x1a')]);_0x3ef912[_0xe581('0x18')]=qs['offset'](_0x1f613f['query'][_0xe581('0x18')]);}_0x3ef912[_0xe581('0x34')]=qs[_0xe581('0x35')](_0x1f613f[_0xe581('0x2e')][_0xe581('0x35')]);_0x3ef912[_0xe581('0x36')]=qs['filters'](_[_0xe581('0x37')](_0x1f613f[_0xe581('0x2e')],_0x3d05bb[_0xe581('0x38')]),_0x2dcce9);if(_0x1f613f[_0xe581('0x2e')][_0xe581('0x39')]){_0x3ef912[_0xe581('0x36')]=_[_0xe581('0x3a')](_0x3ef912[_0xe581('0x36')],{'$or':_['map'](_0x2dcce9,function(_0x32651f){if(_0x32651f[_0xe581('0x2c')]!==_0xe581('0x3b')){var _0x2bfa34={};_0x2bfa34[_0x32651f[_0xe581('0x27')]]={'$like':'%'+_0x1f613f[_0xe581('0x2e')][_0xe581('0x39')]+'%'};return _0x2bfa34;}})});}_0x3ef912=_[_0xe581('0x3a')]({},_0x3ef912,_0x1f613f['options']);var _0xcc4e2e={'where':_0x3ef912['where']};return db[_0xe581('0x3c')]['count'](_0xcc4e2e)['then'](function(_0x5eb33a){_0x347586['count']=_0x5eb33a;if(_0x1f613f['query'][_0xe581('0x3d')]){_0x3ef912['include']=[{'all':!![]}];}return db[_0xe581('0x3c')][_0xe581('0x3e')](_0x3ef912);})['then'](function(_0x5369ae){_0x347586['rows']=_0x5369ae;return _0x347586;})[_0xe581('0x20')](respondWithFilteredResult(_0x342230,_0x3ef912))['catch'](handleError(_0x342230,null));};exports[_0xe581('0x3f')]=function(_0x448d2a,_0x594e65){var _0x220e2d={'raw':!![],'where':{'id':_0x448d2a['params']['id']}},_0x593262={};_0x593262[_0xe581('0x2d')]=_['keys'](db['Pause'][_0xe581('0x2a')]);_0x593262[_0xe581('0x2e')]=_[_0xe581('0x2f')](_0x448d2a['query']);_0x593262['filters']=_[_0xe581('0x30')](_0x593262['model'],_0x593262['query']);_0x220e2d[_0xe581('0x32')]=_[_0xe581('0x30')](_0x593262['model'],qs['fields'](_0x448d2a[_0xe581('0x2e')][_0xe581('0x31')]));_0x220e2d[_0xe581('0x32')]=_0x220e2d[_0xe581('0x32')][_0xe581('0x33')]?_0x220e2d[_0xe581('0x32')]:_0x593262[_0xe581('0x2d')];if(_0x448d2a[_0xe581('0x2e')]['includeAll']){_0x220e2d['include']=[{'all':!![]}];}_0x220e2d=_[_0xe581('0x3a')]({},_0x220e2d,_0x448d2a[_0xe581('0x40')]);return db[_0xe581('0x3c')][_0xe581('0x41')](_0x220e2d)[_0xe581('0x20')](handleEntityNotFound(_0x594e65,null))['then'](respondWithResult(_0x594e65,null))[_0xe581('0x42')](handleError(_0x594e65,null));};exports[_0xe581('0x43')]=function(_0x495480,_0x28d73f){return db[_0xe581('0x3c')][_0xe581('0x43')](_0x495480[_0xe581('0x44')],{})[_0xe581('0x20')](function(_0x5eaa1d){var _0x51fcc0=_0x495480[_0xe581('0x45')][_0xe581('0x22')]({'plain':!![]});if(!_0x51fcc0)throw new Error(_0xe581('0x46'));if(_0x51fcc0[_0xe581('0x47')]===_0xe581('0x45')){var _0x47beef=_0x5eaa1d['get']({'plain':!![]});var _0x2022f7=_0xe581('0x48');return db['UserProfileSection'][_0xe581('0x41')]({'where':{'name':_0x2022f7,'userProfileId':_0x51fcc0[_0xe581('0x49')]},'raw':!![]})['then'](function(_0x463013){if(_0x463013&&_0x463013[_0xe581('0x4a')]===0x0){return db['UserProfileResource'][_0xe581('0x43')]({'name':_0x47beef['name'],'resourceId':_0x47beef['id'],'type':_0x463013[_0xe581('0x27')],'sectionId':_0x463013['id']},{})['then'](function(){return _0x5eaa1d;});}else{return _0x5eaa1d;}})['catch'](function(_0x4090a1){logger[_0xe581('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4090a1);throw _0x4090a1;});}return _0x5eaa1d;})[_0xe581('0x20')](respondWithResult(_0x28d73f,0xc9))[_0xe581('0x42')](handleError(_0x28d73f,null));};exports[_0xe581('0x1f')]=function(_0x1a95ad,_0xb05d76){if(_0x1a95ad[_0xe581('0x44')]['id']){delete _0x1a95ad[_0xe581('0x44')]['id'];}return db[_0xe581('0x3c')]['find']({'where':{'id':_0x1a95ad['params']['id']}})[_0xe581('0x20')](handleEntityNotFound(_0xb05d76,null))[_0xe581('0x20')](saveUpdates(_0x1a95ad[_0xe581('0x44')],null))['then'](respondWithResult(_0xb05d76,null))[_0xe581('0x42')](handleError(_0xb05d76,null));};exports['destroy']=function(_0x3f2528,_0x570186){return db[_0xe581('0x3c')]['find']({'where':{'id':_0x3f2528[_0xe581('0x4b')]['id']}})[_0xe581('0x20')](handleEntityNotFound(_0x570186,null))[_0xe581('0x20')](removeEntity(_0x570186,null))['catch'](handleError(_0x570186,null));}; \ No newline at end of file +var _0x9e76=['name','send','map','Pause','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','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','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','Pauses','sendStatus','error','stack'];(function(_0x3e381c,_0x4a86ab){var _0x5a8f6e=function(_0x46b954){while(--_0x46b954){_0x3e381c['push'](_0x3e381c['shift']());}};_0x5a8f6e(++_0x4a86ab);}(_0x9e76,0x77));var _0x69e7=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x9e76[_0x36884e];return _0x1cc367;};'use strict';var emlformat=require(_0x69e7('0x0'));var rimraf=require(_0x69e7('0x1'));var zipdir=require(_0x69e7('0x2'));var jsonpatch=require(_0x69e7('0x3'));var rp=require('request-promise');var moment=require(_0x69e7('0x4'));var BPromise=require(_0x69e7('0x5'));var Mustache=require('mustache');var util=require(_0x69e7('0x6'));var path=require(_0x69e7('0x7'));var sox=require('sox');var csv=require(_0x69e7('0x8'));var ejs=require(_0x69e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e7('0xa'));var squel=require(_0x69e7('0xb'));var crypto=require('crypto');var jsforce=require(_0x69e7('0xc'));var deskjs=require(_0x69e7('0xd'));var toCsv=require(_0x69e7('0x8'));var querystring=require(_0x69e7('0xe'));var Papa=require(_0x69e7('0xf'));var Redis=require('ioredis');var authService=require(_0x69e7('0x10'));var qs=require(_0x69e7('0x11'));var as=require(_0x69e7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69e7('0x13'))(_0x69e7('0x14'));var utils=require(_0x69e7('0x15'));var config=require(_0x69e7('0x16'));var licenseUtil=require(_0x69e7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cf627,_0x51ca6a){_0x51ca6a=_0x51ca6a||0xcc;return function(_0x25fbb5){if(_0x25fbb5){return _0x3cf627['sendStatus'](_0x51ca6a);}return _0x3cf627['status'](_0x51ca6a)['end']();};}function respondWithResult(_0x2e700e,_0x30ff42){_0x30ff42=_0x30ff42||0xc8;return function(_0x596af6){if(_0x596af6){return _0x2e700e[_0x69e7('0x18')](_0x30ff42)[_0x69e7('0x19')](_0x596af6);}};}function respondWithFilteredResult(_0x1179f2,_0x4d8756){return function(_0x44e720){if(_0x44e720){var _0x570afe=typeof _0x4d8756[_0x69e7('0x1a')]===_0x69e7('0x1b')&&typeof _0x4d8756[_0x69e7('0x1c')]==='undefined';var _0x115ddb=_0x44e720[_0x69e7('0x1d')];var _0x444bf3=_0x570afe?0x0:_0x4d8756[_0x69e7('0x1a')];var _0x1175a3=_0x570afe?_0x44e720[_0x69e7('0x1d')]:_0x4d8756['offset']+_0x4d8756[_0x69e7('0x1c')];var _0x33f55c;if(_0x1175a3>=_0x115ddb){_0x1175a3=_0x115ddb;_0x33f55c=0xc8;}else{_0x33f55c=0xce;}_0x1179f2[_0x69e7('0x18')](_0x33f55c);return _0x1179f2[_0x69e7('0x1e')](_0x69e7('0x1f'),_0x444bf3+'-'+_0x1175a3+'/'+_0x115ddb)[_0x69e7('0x19')](_0x44e720);}return null;};}function patchUpdates(_0x54aa4b){return function(_0x5b9be7){try{jsonpatch[_0x69e7('0x20')](_0x5b9be7,_0x54aa4b,!![]);}catch(_0x512d4e){return BPromise['reject'](_0x512d4e);}return _0x5b9be7[_0x69e7('0x21')]();};}function saveUpdates(_0x35acef,_0x18930a){return function(_0xf1241e){if(_0xf1241e){return _0xf1241e['update'](_0x35acef)[_0x69e7('0x22')](function(_0x1d40bf){return _0x1d40bf;});}return null;};}function removeEntity(_0x5a92da,_0x1be950){return function(_0x3b6225){if(_0x3b6225){return _0x3b6225[_0x69e7('0x23')]()[_0x69e7('0x22')](function(){var _0x1a1f01=_0x3b6225[_0x69e7('0x24')]({'plain':!![]});var _0x24aea4=_0x69e7('0x25');return db['UserProfileResource'][_0x69e7('0x23')]({'where':{'type':_0x24aea4,'resourceId':_0x1a1f01['id']}})[_0x69e7('0x22')](function(){return _0x3b6225;});})[_0x69e7('0x22')](function(){_0x5a92da[_0x69e7('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ab601,_0x2b8a73){return function(_0x8f5702){if(!_0x8f5702){_0x3ab601[_0x69e7('0x26')](0x194);}return _0x8f5702;};}function handleError(_0x5b41db,_0x54acf1){_0x54acf1=_0x54acf1||0x1f4;return function(_0x13cfed){logger[_0x69e7('0x27')](_0x13cfed[_0x69e7('0x28')]);if(_0x13cfed[_0x69e7('0x29')]){delete _0x13cfed[_0x69e7('0x29')];}_0x5b41db[_0x69e7('0x18')](_0x54acf1)[_0x69e7('0x2a')](_0x13cfed);};}exports['index']=function(_0x358427,_0x59b824){var _0x2ef06f={},_0x4687b2={},_0x568bc0={'count':0x0,'rows':[]};var _0x5a5b51=_[_0x69e7('0x2b')](db[_0x69e7('0x2c')][_0x69e7('0x2d')],function(_0xc9739f){return{'name':_0xc9739f[_0x69e7('0x2e')],'type':_0xc9739f[_0x69e7('0x2f')]['key']};});_0x4687b2[_0x69e7('0x30')]=_[_0x69e7('0x2b')](_0x5a5b51,_0x69e7('0x29'));_0x4687b2[_0x69e7('0x31')]=_['keys'](_0x358427['query']);_0x4687b2[_0x69e7('0x32')]=_[_0x69e7('0x33')](_0x4687b2[_0x69e7('0x30')],_0x4687b2[_0x69e7('0x31')]);_0x2ef06f[_0x69e7('0x34')]=_[_0x69e7('0x33')](_0x4687b2[_0x69e7('0x30')],qs[_0x69e7('0x35')](_0x358427[_0x69e7('0x31')][_0x69e7('0x35')]));_0x2ef06f[_0x69e7('0x34')]=_0x2ef06f[_0x69e7('0x34')][_0x69e7('0x36')]?_0x2ef06f[_0x69e7('0x34')]:_0x4687b2[_0x69e7('0x30')];if(!_0x358427[_0x69e7('0x31')][_0x69e7('0x37')](_0x69e7('0x38'))){_0x2ef06f[_0x69e7('0x1c')]=qs[_0x69e7('0x1c')](_0x358427[_0x69e7('0x31')][_0x69e7('0x1c')]);_0x2ef06f[_0x69e7('0x1a')]=qs[_0x69e7('0x1a')](_0x358427[_0x69e7('0x31')][_0x69e7('0x1a')]);}_0x2ef06f[_0x69e7('0x39')]=qs[_0x69e7('0x3a')](_0x358427['query'][_0x69e7('0x3a')]);_0x2ef06f['where']=qs[_0x69e7('0x32')](_[_0x69e7('0x3b')](_0x358427[_0x69e7('0x31')],_0x4687b2['filters']),_0x5a5b51);if(_0x358427['query']['filter']){_0x2ef06f[_0x69e7('0x3c')]=_[_0x69e7('0x3d')](_0x2ef06f[_0x69e7('0x3c')],{'$or':_['map'](_0x5a5b51,function(_0x1a479e){if(_0x1a479e[_0x69e7('0x2f')]!==_0x69e7('0x3e')){var _0x19e480={};_0x19e480[_0x1a479e[_0x69e7('0x29')]]={'$like':'%'+_0x358427[_0x69e7('0x31')][_0x69e7('0x3f')]+'%'};return _0x19e480;}})});}_0x2ef06f=_[_0x69e7('0x3d')]({},_0x2ef06f,_0x358427[_0x69e7('0x40')]);var _0x2d86dd={'where':_0x2ef06f['where']};return db['Pause'][_0x69e7('0x1d')](_0x2d86dd)[_0x69e7('0x22')](function(_0x460c26){_0x568bc0[_0x69e7('0x1d')]=_0x460c26;if(_0x358427[_0x69e7('0x31')][_0x69e7('0x41')]){_0x2ef06f[_0x69e7('0x42')]=[{'all':!![]}];}return db['Pause'][_0x69e7('0x43')](_0x2ef06f);})['then'](function(_0x1d686f){_0x568bc0['rows']=_0x1d686f;return _0x568bc0;})[_0x69e7('0x22')](respondWithFilteredResult(_0x59b824,_0x2ef06f))['catch'](handleError(_0x59b824,null));};exports[_0x69e7('0x44')]=function(_0x5cc2e5,_0x54eaa0){var _0x106b4e={'raw':!![],'where':{'id':_0x5cc2e5['params']['id']}},_0xc693ae={};_0xc693ae[_0x69e7('0x30')]=_['keys'](db['Pause'][_0x69e7('0x2d')]);_0xc693ae['query']=_[_0x69e7('0x45')](_0x5cc2e5[_0x69e7('0x31')]);_0xc693ae[_0x69e7('0x32')]=_['intersection'](_0xc693ae['model'],_0xc693ae[_0x69e7('0x31')]);_0x106b4e[_0x69e7('0x34')]=_['intersection'](_0xc693ae[_0x69e7('0x30')],qs[_0x69e7('0x35')](_0x5cc2e5['query'][_0x69e7('0x35')]));_0x106b4e[_0x69e7('0x34')]=_0x106b4e[_0x69e7('0x34')][_0x69e7('0x36')]?_0x106b4e[_0x69e7('0x34')]:_0xc693ae[_0x69e7('0x30')];if(_0x5cc2e5['query']['includeAll']){_0x106b4e['include']=[{'all':!![]}];}_0x106b4e=_['merge']({},_0x106b4e,_0x5cc2e5['options']);return db['Pause'][_0x69e7('0x46')](_0x106b4e)[_0x69e7('0x22')](handleEntityNotFound(_0x54eaa0,null))[_0x69e7('0x22')](respondWithResult(_0x54eaa0,null))[_0x69e7('0x47')](handleError(_0x54eaa0,null));};exports[_0x69e7('0x48')]=function(_0x44363a,_0xcdfc0a){return db[_0x69e7('0x2c')][_0x69e7('0x48')](_0x44363a[_0x69e7('0x49')],{})['then'](function(_0x203db5){var _0x1ed8a4=_0x44363a[_0x69e7('0x4a')][_0x69e7('0x24')]({'plain':!![]});if(!_0x1ed8a4)throw new Error(_0x69e7('0x4b'));if(_0x1ed8a4[_0x69e7('0x4c')]===_0x69e7('0x4a')){var _0x3ed51e=_0x203db5[_0x69e7('0x24')]({'plain':!![]});var _0x4a6dce='Pauses';return db[_0x69e7('0x4d')][_0x69e7('0x46')]({'where':{'name':_0x4a6dce,'userProfileId':_0x1ed8a4['userProfileId']},'raw':!![]})[_0x69e7('0x22')](function(_0x2f7703){if(_0x2f7703&&_0x2f7703[_0x69e7('0x4e')]===0x0){return db[_0x69e7('0x4f')][_0x69e7('0x48')]({'name':_0x3ed51e['name'],'resourceId':_0x3ed51e['id'],'type':_0x2f7703[_0x69e7('0x29')],'sectionId':_0x2f7703['id']},{})[_0x69e7('0x22')](function(){return _0x203db5;});}else{return _0x203db5;}})[_0x69e7('0x47')](function(_0x5b7749){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7749);throw _0x5b7749;});}return _0x203db5;})[_0x69e7('0x22')](respondWithResult(_0xcdfc0a,0xc9))[_0x69e7('0x47')](handleError(_0xcdfc0a,null));};exports['update']=function(_0x5b71fc,_0x1a6ac4){if(_0x5b71fc['body']['id']){delete _0x5b71fc[_0x69e7('0x49')]['id'];}return db[_0x69e7('0x2c')][_0x69e7('0x46')]({'where':{'id':_0x5b71fc['params']['id']}})['then'](handleEntityNotFound(_0x1a6ac4,null))[_0x69e7('0x22')](saveUpdates(_0x5b71fc[_0x69e7('0x49')],null))[_0x69e7('0x22')](respondWithResult(_0x1a6ac4,null))[_0x69e7('0x47')](handleError(_0x1a6ac4,null));};exports[_0x69e7('0x23')]=function(_0x4c0dba,_0x4d77df){return db[_0x69e7('0x2c')][_0x69e7('0x46')]({'where':{'id':_0x4c0dba['params']['id']}})['then'](handleEntityNotFound(_0x4d77df,null))[_0x69e7('0x22')](removeEntity(_0x4d77df,null))[_0x69e7('0x47')](handleError(_0x4d77df,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 9b7d028..457d0fa 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 _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6aa7,0x178));var _0x76aa=function(_0x44e80b,_0x351b98){_0x44e80b=_0x44e80b-0x0;var _0x864b01=_0x6aa7[_0x44e80b];return _0x864b01;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x577da6,_0x356b2e){var _0x2f770e=function(_0xe07d7){while(--_0xe07d7){_0x577da6['push'](_0x577da6['shift']());}};_0x2f770e(++_0x356b2e);}(_0xabce,0x103));var _0xeabc=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xabce[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'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 88305fb..054af70 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1dd99e,_0x5010a9){var _0x293463=function(_0x593ae2){while(--_0x593ae2){_0x1dd99e['push'](_0x1dd99e['shift']());}};_0x293463(++_0x5010a9);}(_0x7a54,0x106));var _0x47a5=function(_0x552611,_0x1b05a0){_0x552611=_0x552611-0x0;var _0x101711=_0x7a54[_0x552611];return _0x101711;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x8eea20,_0xfa1375){var _0x21146a=function(_0x5b5441){while(--_0x5b5441){_0x8eea20['push'](_0x8eea20['shift']());}};_0x21146a(++_0xfa1375);}(_0x7a54,0x106));var _0x47a5=function(_0x218eeb,_0x444e08){_0x218eeb=_0x218eeb-0x0;var _0x363573=_0x7a54[_0x218eeb];return _0x363573;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index b23a46a..4410041 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 _0x00bb=['upload','post','put','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','originalname','replace','%s-%s%s','basename','extname','file'];(function(_0x32618c,_0x1abe61){var _0x48fbbb=function(_0x4c29a2){while(--_0x4c29a2){_0x32618c['push'](_0x32618c['shift']());}};_0x48fbbb(++_0x1abe61);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),controller[_0xb00b('0xa')]);router[_0xb00b('0x8')](_0xb00b('0xb'),auth[_0xb00b('0xc')](),controller['show']);router['get'](_0xb00b('0xd'),auth[_0xb00b('0xc')](),controller[_0xb00b('0xe')]);var upload=multer({'storage':multer[_0xb00b('0xf')]({'destination':function(_0x28d3cc,_0x48e125,_0x3182db){_0x3182db(null,path['join'](config['root'],'server/files/plugins'));},'filename':function(_0x4ff792,_0x2d8ddf,_0x1be8aa){_0x2d8ddf[_0xb00b('0x10')]=_0x2d8ddf[_0xb00b('0x10')][_0xb00b('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1be8aa(null,util['format'](_0xb00b('0x12'),path[_0xb00b('0x13')](_0x2d8ddf['originalname'],path[_0xb00b('0x14')](_0x2d8ddf[_0xb00b('0x10')])),Date['now'](),path['extname'](_0x2d8ddf[_0xb00b('0x10')])));}})});router['post']('/',upload['single'](_0xb00b('0x15')),controller[_0xb00b('0x16')]);router[_0xb00b('0x17')](_0xb00b('0x9'),controller['webhookPost']);router[_0xb00b('0x18')]('/:id',auth[_0xb00b('0xc')](),controller['update']);router[_0xb00b('0x19')]('/:id',auth[_0xb00b('0xc')](),controller[_0xb00b('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5ad3=['webhookGet','/:id','show','download','root','server/files/plugins','replace','format','%s-%s%s','originalname','extname','now','post','single','file','/webhook','webhookPost','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index'];(function(_0x3c4354,_0x4f1c97){var _0x422fb7=function(_0x3b31e2){while(--_0x3b31e2){_0x3c4354['push'](_0x3c4354['shift']());}};_0x422fb7(++_0x4f1c97);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0x5ad3[_0x1e8f35];return _0x446c13;};'use strict';var multer=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var path=require(_0x35ad('0x2'));var timeout=require(_0x35ad('0x3'));var express=require('express');var router=express[_0x35ad('0x4')]();var fs_extra=require(_0x35ad('0x5'));var auth=require(_0x35ad('0x6'));var interaction=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var controller=require(_0x35ad('0x9'));router[_0x35ad('0xa')]('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xc')]);router[_0x35ad('0xa')]('/webhook',controller[_0x35ad('0xd')]);router[_0x35ad('0xa')](_0x35ad('0xe'),auth['isAuthenticated'](),controller[_0x35ad('0xf')]);router['get']('/:id/download',auth[_0x35ad('0xb')](),controller[_0x35ad('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34c2cb,_0x3a70a9,_0x4ad760){_0x4ad760(null,path['join'](config[_0x35ad('0x11')],_0x35ad('0x12')));},'filename':function(_0x4cf6bd,_0x3c4dd5,_0x33e2ec){_0x3c4dd5['originalname']=_0x3c4dd5['originalname'][_0x35ad('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33e2ec(null,util[_0x35ad('0x14')](_0x35ad('0x15'),path['basename'](_0x3c4dd5[_0x35ad('0x16')],path[_0x35ad('0x17')](_0x3c4dd5['originalname'])),Date[_0x35ad('0x18')](),path['extname'](_0x3c4dd5['originalname'])));}})});router[_0x35ad('0x19')]('/',upload[_0x35ad('0x1a')](_0x35ad('0x1b')),controller['upload']);router[_0x35ad('0x19')](_0x35ad('0x1c'),controller[_0x35ad('0x1d')]);router[_0x35ad('0x1e')](_0x35ad('0xe'),auth[_0x35ad('0xb')](),controller['update']);router[_0x35ad('0x1f')](_0x35ad('0xe'),auth['isAuthenticated'](),controller['delete']);module[_0x35ad('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 ddb2a57..79d323f 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 _0x02bb=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x02bb,0x197));var _0xb02b=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x02bb[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0xb02b('0x0'));module[_0xb02b('0x1')]={'name':{'type':Sequelize[_0xb02b('0x2')]},'type':{'type':Sequelize[_0xb02b('0x3')]('html',_0xb02b('0x4'))},'description':{'type':Sequelize[_0xb02b('0x5')]},'version':{'type':Sequelize[_0xb02b('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xb02b('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb02b('0x7')},'sidebar':{'type':Sequelize[_0xb02b('0x3')](_0xb02b('0x8'),_0xb02b('0x9'),_0xb02b('0xa'),_0xb02b('0xb')),'defaultValue':'always','comment':_0xb02b('0xc')},'icon':{'type':Sequelize[_0xb02b('0x2')]},'adminUrl':{'type':Sequelize[_0xb02b('0x2')]},'agentUrl':{'type':Sequelize[_0xb02b('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4ec5=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','script'];(function(_0x52f63c,_0x5bd56a){var _0x2c5dd0=function(_0x271982){while(--_0x271982){_0x52f63c['push'](_0x52f63c['shift']());}};_0x2c5dd0(++_0x5bd56a);}(_0x4ec5,0x189));var _0x54ec=function(_0x501feb,_0x5b46a2){_0x501feb=_0x501feb-0x0;var _0x279970=_0x4ec5[_0x501feb];return _0x279970;};'use strict';var Sequelize=require(_0x54ec('0x0'));module['exports']={'name':{'type':Sequelize[_0x54ec('0x1')]},'type':{'type':Sequelize['ENUM']('html',_0x54ec('0x2'))},'description':{'type':Sequelize[_0x54ec('0x3')]},'version':{'type':Sequelize[_0x54ec('0x3')]},'path':{'type':Sequelize[_0x54ec('0x1')],'comment':_0x54ec('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x54ec('0x5'),_0x54ec('0x6'),_0x54ec('0x7')),'defaultValue':_0x54ec('0x6'),'comment':_0x54ec('0x8')},'icon':{'type':Sequelize[_0x54ec('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x54ec('0x1')]},'scriptPath':{'type':Sequelize[_0x54ec('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 88c0372..36d27ff 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 _0xc7c8=['%s%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','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','./plugin.socket','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','download','params','join','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','server/files/plugins','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','Plugin\x20manifest\x20missing','manifest.json','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon-apps','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Plugins','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Extracted\x20folder\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','method'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0xc7c8,0x16d));var _0x8c7c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc7c8[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x8c7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c7c('0x1'));var jsonpatch=require(_0x8c7c('0x2'));var rp=require(_0x8c7c('0x3'));var moment=require(_0x8c7c('0x4'));var BPromise=require(_0x8c7c('0x5'));var Mustache=require(_0x8c7c('0x6'));var util=require(_0x8c7c('0x7'));var path=require(_0x8c7c('0x8'));var sox=require(_0x8c7c('0x9'));var csv=require(_0x8c7c('0xa'));var ejs=require(_0x8c7c('0xb'));var fs=require('fs');var fs_extra=require(_0x8c7c('0xc'));var _=require(_0x8c7c('0xd'));var squel=require(_0x8c7c('0xe'));var crypto=require(_0x8c7c('0xf'));var jsforce=require(_0x8c7c('0x10'));var deskjs=require(_0x8c7c('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8c7c('0x12'));var Papa=require('papaparse');var extract=require(_0x8c7c('0x13'));var rimraf=require(_0x8c7c('0x14'));var archiver=require(_0x8c7c('0x15'));var Redis=require(_0x8c7c('0x16'));var authService=require(_0x8c7c('0x17'));var qs=require(_0x8c7c('0x18'));var as=require(_0x8c7c('0x19'));var hardwareService=require(_0x8c7c('0x1a'));var logger=require(_0x8c7c('0x1b'))(_0x8c7c('0x1c'));var utils=require(_0x8c7c('0x1d'));var config=require(_0x8c7c('0x1e'));var licenseUtil=require(_0x8c7c('0x1f'));var db=require(_0x8c7c('0x20'))['db'];config[_0x8c7c('0x21')]=_[_0x8c7c('0x22')](config['redis'],{'host':_0x8c7c('0x23'),'port':0x18eb});var socket=require(_0x8c7c('0x24'))(new Redis(config[_0x8c7c('0x21')]));require(_0x8c7c('0x25'))['register'](socket);function respondWithStatusCode(_0x4e0569,_0x50d92e){_0x50d92e=_0x50d92e||0xcc;return function(_0x4e43c2){if(_0x4e43c2){return _0x4e0569[_0x8c7c('0x26')](_0x50d92e);}return _0x4e0569[_0x8c7c('0x27')](_0x50d92e)[_0x8c7c('0x28')]();};}function respondWithResult(_0x190c1a,_0x2609f0){_0x2609f0=_0x2609f0||0xc8;return function(_0x3445d1){if(_0x3445d1){return _0x190c1a[_0x8c7c('0x27')](_0x2609f0)[_0x8c7c('0x29')](_0x3445d1);}};}function respondWithFilteredResult(_0x516201,_0x53eb88){return function(_0x210f22){if(_0x210f22){var _0x14b627=typeof _0x53eb88['offset']===_0x8c7c('0x2a')&&typeof _0x53eb88[_0x8c7c('0x2b')]==='undefined';var _0x2ee3b9=_0x210f22[_0x8c7c('0x2c')];var _0x489512=_0x14b627?0x0:_0x53eb88['offset'];var _0x237490=_0x14b627?_0x210f22[_0x8c7c('0x2c')]:_0x53eb88['offset']+_0x53eb88[_0x8c7c('0x2b')];var _0x169988;if(_0x237490>=_0x2ee3b9){_0x237490=_0x2ee3b9;_0x169988=0xc8;}else{_0x169988=0xce;}_0x516201[_0x8c7c('0x27')](_0x169988);return _0x516201[_0x8c7c('0x2d')](_0x8c7c('0x2e'),_0x489512+'-'+_0x237490+'/'+_0x2ee3b9)[_0x8c7c('0x29')](_0x210f22);}return null;};}function patchUpdates(_0x3fe475){return function(_0x3cad68){try{jsonpatch[_0x8c7c('0x2f')](_0x3cad68,_0x3fe475,!![]);}catch(_0x477527){return BPromise[_0x8c7c('0x30')](_0x477527);}return _0x3cad68[_0x8c7c('0x31')]();};}function saveUpdates(_0xe8b1e0,_0x4fd7a0){return function(_0x3d6917){if(_0x3d6917){return _0x3d6917[_0x8c7c('0x32')](_0xe8b1e0)[_0x8c7c('0x33')](function(_0x8827e9){return _0x8827e9;});}return null;};}function removeEntity(_0x40caab,_0xa418ab){return function(_0x2cb022){if(_0x2cb022){return _0x2cb022[_0x8c7c('0x34')]()[_0x8c7c('0x33')](function(){var _0x1949ea=_0x2cb022[_0x8c7c('0x35')]({'plain':!![]});var _0x1eaba0='Plugins';return db['UserProfileResource'][_0x8c7c('0x34')]({'where':{'type':_0x1eaba0,'resourceId':_0x1949ea['id']}})['then'](function(){return _0x2cb022;});})[_0x8c7c('0x33')](function(){_0x40caab[_0x8c7c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed438,_0x22c877){return function(_0x505ee9){if(!_0x505ee9){_0x2ed438['sendStatus'](0x194);}return _0x505ee9;};}function handleError(_0x537997,_0x23dfca){_0x23dfca=_0x23dfca||0x1f4;return function(_0x28be47){logger[_0x8c7c('0x36')](_0x28be47['stack']);if(_0x28be47[_0x8c7c('0x37')]){delete _0x28be47[_0x8c7c('0x37')];}_0x537997['status'](_0x23dfca)['send'](_0x28be47);};}exports[_0x8c7c('0x38')]=function(_0x305533,_0x25e7a1){var _0x348723={},_0x550d78={},_0x1d8610={'count':0x0,'rows':[]};var _0x2e5352=_[_0x8c7c('0x39')](db[_0x8c7c('0x3a')][_0x8c7c('0x3b')],function(_0x2ecbb4){return{'name':_0x2ecbb4[_0x8c7c('0x3c')],'type':_0x2ecbb4[_0x8c7c('0x3d')][_0x8c7c('0x3e')]};});_0x550d78[_0x8c7c('0x3f')]=_['map'](_0x2e5352,_0x8c7c('0x37'));_0x550d78['query']=_[_0x8c7c('0x40')](_0x305533['query']);_0x550d78[_0x8c7c('0x41')]=_[_0x8c7c('0x42')](_0x550d78[_0x8c7c('0x3f')],_0x550d78[_0x8c7c('0x43')]);_0x348723['attributes']=_[_0x8c7c('0x42')](_0x550d78[_0x8c7c('0x3f')],qs[_0x8c7c('0x44')](_0x305533['query']['fields']));_0x348723[_0x8c7c('0x45')]=_0x348723['attributes'][_0x8c7c('0x46')]?_0x348723[_0x8c7c('0x45')]:_0x550d78[_0x8c7c('0x3f')];if(!_0x305533[_0x8c7c('0x43')][_0x8c7c('0x47')](_0x8c7c('0x48'))){_0x348723[_0x8c7c('0x2b')]=qs['limit'](_0x305533[_0x8c7c('0x43')]['limit']);_0x348723[_0x8c7c('0x49')]=qs['offset'](_0x305533[_0x8c7c('0x43')][_0x8c7c('0x49')]);}_0x348723['order']=qs[_0x8c7c('0x4a')](_0x305533[_0x8c7c('0x43')][_0x8c7c('0x4a')]);_0x348723[_0x8c7c('0x4b')]=qs[_0x8c7c('0x41')](_[_0x8c7c('0x4c')](_0x305533[_0x8c7c('0x43')],_0x550d78[_0x8c7c('0x41')]),_0x2e5352);if(_0x305533[_0x8c7c('0x43')][_0x8c7c('0x4d')]){_0x348723[_0x8c7c('0x4b')]=_[_0x8c7c('0x4e')](_0x348723[_0x8c7c('0x4b')],{'$or':_[_0x8c7c('0x39')](_0x2e5352,function(_0x48a960){if(_0x48a960[_0x8c7c('0x3d')]!==_0x8c7c('0x4f')){var _0x42e1c3={};_0x42e1c3[_0x48a960[_0x8c7c('0x37')]]={'$like':'%'+_0x305533['query'][_0x8c7c('0x4d')]+'%'};return _0x42e1c3;}})});}_0x348723=_[_0x8c7c('0x4e')]({},_0x348723,_0x305533[_0x8c7c('0x50')]);var _0x456dd7={'where':_0x348723[_0x8c7c('0x4b')]};return db['Plugin'][_0x8c7c('0x2c')](_0x456dd7)['then'](function(_0xd9a6ec){_0x1d8610['count']=_0xd9a6ec;if(_0x305533[_0x8c7c('0x43')][_0x8c7c('0x51')]){_0x348723['include']=[{'all':!![]}];}return db[_0x8c7c('0x3a')][_0x8c7c('0x52')](_0x348723);})[_0x8c7c('0x33')](function(_0x4fc775){_0x1d8610[_0x8c7c('0x53')]=_0x4fc775;return _0x1d8610;})[_0x8c7c('0x33')](respondWithFilteredResult(_0x25e7a1,_0x348723))['catch'](handleError(_0x25e7a1,null));};exports[_0x8c7c('0x54')]=function(_0x2bbaee,_0x223fb8){var _0x1e45f6={'raw':!![],'where':{'id':_0x2bbaee['params']['id']}},_0x15a3dd={};_0x15a3dd[_0x8c7c('0x3f')]=_['keys'](db[_0x8c7c('0x3a')][_0x8c7c('0x3b')]);_0x15a3dd['query']=_[_0x8c7c('0x40')](_0x2bbaee[_0x8c7c('0x43')]);_0x15a3dd['filters']=_['intersection'](_0x15a3dd[_0x8c7c('0x3f')],_0x15a3dd[_0x8c7c('0x43')]);_0x1e45f6[_0x8c7c('0x45')]=_[_0x8c7c('0x42')](_0x15a3dd[_0x8c7c('0x3f')],qs[_0x8c7c('0x44')](_0x2bbaee[_0x8c7c('0x43')]['fields']));_0x1e45f6['attributes']=_0x1e45f6[_0x8c7c('0x45')][_0x8c7c('0x46')]?_0x1e45f6[_0x8c7c('0x45')]:_0x15a3dd[_0x8c7c('0x3f')];if(_0x2bbaee[_0x8c7c('0x43')]['includeAll']){_0x1e45f6[_0x8c7c('0x55')]=[{'all':!![]}];}_0x1e45f6=_[_0x8c7c('0x4e')]({},_0x1e45f6,_0x2bbaee[_0x8c7c('0x50')]);return db['Plugin'][_0x8c7c('0x56')](_0x1e45f6)['then'](handleEntityNotFound(_0x223fb8,null))[_0x8c7c('0x33')](respondWithResult(_0x223fb8,null))['catch'](handleError(_0x223fb8,null));};exports[_0x8c7c('0x57')]=function(_0x40b9d8,_0x2644b3,_0x32160e){return db['Plugin'][_0x8c7c('0x56')]({'where':{'id':_0x40b9d8[_0x8c7c('0x58')]['id']},'attributes':[_0x8c7c('0x37'),_0x8c7c('0x8')],'raw':!![]})[_0x8c7c('0x33')](handleEntityNotFound(_0x2644b3,null))['then'](function(_0x486fb4){if(_0x486fb4){var _0x479f08=path[_0x8c7c('0x59')](config['root'],'server/files/plugins',util['format'](_0x8c7c('0x5a'),path[_0x8c7c('0x5b')](_0x486fb4[_0x8c7c('0x8')])));var _0x35c031=fs[_0x8c7c('0x5c')](_0x479f08);var _0x5cbc4f=archiver(_0x8c7c('0x5d'),{'zlib':{'level':0x9}});_0x5cbc4f['on'](_0x8c7c('0x5e'),function(_0x13c4c2){if(_0x13c4c2[_0x8c7c('0x5f')]===_0x8c7c('0x60')){logger[_0x8c7c('0x36')](_0x13c4c2);}else{throw new db[(_0x8c7c('0x61'))][(_0x8c7c('0x62'))](_0x8c7c('0x63'));}});_0x5cbc4f['on'](_0x8c7c('0x36'),function(_0x4df8c6){throw new db['Sequelize'][(_0x8c7c('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5cbc4f['pipe'](_0x35c031);_0x5cbc4f['glob'](_0x8c7c('0x64'),{'cwd':path[_0x8c7c('0x59')](config['root'],_0x8c7c('0x65'),path['dirname'](_0x486fb4[_0x8c7c('0x8')])),'ignore':[path[_0x8c7c('0x59')](path[_0x8c7c('0x5b')](_0x486fb4[_0x8c7c('0x8')]),_0x8c7c('0x66')),path[_0x8c7c('0x59')](path['basename'](_0x486fb4[_0x8c7c('0x8')]),_0x8c7c('0x67'))],'nodir':!![]})[_0x8c7c('0x68')]();_0x35c031['on'](_0x8c7c('0x69'),function(){if(!fs[_0x8c7c('0x6a')](_0x479f08)){throw new db[(_0x8c7c('0x61'))][(_0x8c7c('0x62'))](_0x8c7c('0x6b'));}return _0x2644b3['download'](_0x479f08,util[_0x8c7c('0x6c')](_0x8c7c('0x5a'),path[_0x8c7c('0x5b')](_0x486fb4['path'])),function(_0x165575){if(_0x165575){throw new db[(_0x8c7c('0x61'))][(_0x8c7c('0x62'))](_0x8c7c('0x6d'));}fs[_0x8c7c('0x6e')](_0x479f08);logger[_0x8c7c('0x6f')](_0x8c7c('0x70'));logger[_0x8c7c('0x6f')](_0x8c7c('0x71'));});});}return null;})['catch'](handleError(_0x2644b3,null));};exports[_0x8c7c('0x72')]=function(_0x513cec,_0x57204c,_0x51a82a){var _0x27af42=path[_0x8c7c('0x5b')](_0x513cec[_0x8c7c('0x73')][_0x8c7c('0x74')],path[_0x8c7c('0x75')](_0x513cec[_0x8c7c('0x73')][_0x8c7c('0x74')]));var _0x17eac5=path[_0x8c7c('0x59')](config[_0x8c7c('0x76')],'server/files/plugins',_0x513cec['file']['filename']);var _0x50feeb=path[_0x8c7c('0x59')](config[_0x8c7c('0x76')],_0x8c7c('0x65'),_0x27af42);logger[_0x8c7c('0x6f')](_0x8c7c('0x77'),_0x17eac5);logger['info'](_0x8c7c('0x78'),_0x50feeb);try{fs[_0x8c7c('0x79')](_0x17eac5,parseInt('0777',0x8));extract(_0x17eac5,{'dir':_0x50feeb},function(_0x21cc2a){if(_0x21cc2a){logger[_0x8c7c('0x36')](_0x21cc2a);handleError(_0x21cc2a,!![]);};var _0x455ff5=fs[_0x8c7c('0x7a')](_0x50feeb);if(_0x455ff5['length']>0x1){removeReferences(_0x17eac5,_0x50feeb);logger['error'](_0x8c7c('0x7b'));return _0x51a82a(new Error(_0x8c7c('0x7b')));}var _0x1d1376=fs[_0x8c7c('0x7c')](path[_0x8c7c('0x59')](_0x50feeb,_0x455ff5[0x0]));if(_0x1d1376[_0x8c7c('0x7d')]()){removeReferences(_0x17eac5,_0x50feeb);logger[_0x8c7c('0x36')](_0x8c7c('0x7b'));return _0x51a82a(new Error(_0x8c7c('0x7b')));}if(_0x1d1376[_0x8c7c('0x7e')]()){var _0x156262=fs[_0x8c7c('0x7a')](path['join'](_0x50feeb,_0x455ff5[0x0]));if(_0x156262[_0x8c7c('0x46')]===0x0){removeReferences(_0x17eac5,_0x50feeb);logger['error']('Invalid\x20plugin\x20structure');return _0x51a82a(new Error('Invalid\x20plugin\x20structure'));}var _0x14e1b9=_0x156262['some'](function(_0xb50a3c){return _0xb50a3c==='manifest.json';});if(!_0x14e1b9){return _0x51a82a(new Error(_0x8c7c('0x7f')));}var _0x17e894=fs['readFileSync'](path[_0x8c7c('0x59')](_0x50feeb,_0x455ff5[0x0],_0x8c7c('0x80')));var _0x69f819=JSON['parse'](_0x17e894);if(_0x8c7c('0x2a')==typeof _0x69f819['name']){return _0x51a82a(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x69f819['type']){return _0x51a82a(new Error(_0x8c7c('0x81')));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x82')]){return _0x51a82a(new Error(_0x8c7c('0x83')));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x84')]){return _0x51a82a(new Error(_0x8c7c('0x85')));}if(_0x69f819['type']===_0x8c7c('0x86')){if('undefined'==typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]){return _0x51a82a(new Error(_0x8c7c('0x88')));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]['admin']&&_0x8c7c('0x2a')==typeof _0x69f819['parameters'][_0x8c7c('0x87')][_0x8c7c('0x89')]){return _0x51a82a(new Error(_0x8c7c('0x8a')));}}else if(_0x69f819[_0x8c7c('0x3d')]===_0x8c7c('0x8b')){if(_0x8c7c('0x2a')==typeof _0x69f819['parameters'][_0x8c7c('0x8c')]){return _0x51a82a(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x8c7c('0x2a')==typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x8d')]){return _0x51a82a(new Error(_0x8c7c('0x8e')));}}else{return _0x51a82a(new Error(_0x8c7c('0x8f')));}var _0x124a94=_0x69f819[_0x8c7c('0x37')];var _0x3f2dd9=_0x69f819[_0x8c7c('0x90')];var _0x34c09d=_0x69f819[_0x8c7c('0x3d')];var _0xa7eb80=_0x69f819['sidebar']?_0x69f819[_0x8c7c('0x91')]:'always';var _0x329353=_0x69f819['icon']?_0x69f819['icon']:_0x8c7c('0x92');var _0x11878c='';var _0x4e2a0b='';var _0x36483b='';var _0x512dd3='';var _0x536272=_0x69f819[_0x8c7c('0x82')];if(_0x34c09d===_0x8c7c('0x86')){if(_0x8c7c('0x2a')!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x93')]){var _0x3d3f4d=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x93')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3d3f4d)){_0x11878c=path[_0x8c7c('0x59')](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x3d3f4d);}else{_0x11878c=_0x3d3f4d;}}else{logger[_0x8c7c('0x6f')](_0x8c7c('0x95'));}if('undefined'!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]['agent']){var _0x36fd86=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x8c7c('0x96')](_0x36fd86)){_0x4e2a0b=path[_0x8c7c('0x59')](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x36fd86);}else{_0x4e2a0b=_0x36fd86;}}else{logger['info'](_0x8c7c('0x97'));}}else if(_0x34c09d==='script'){_0x36483b=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x8c')];_0x512dd3=_0x69f819['parameters'][_0x8c7c('0x8d')];if('undefined'!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')]){if(_0x8c7c('0x2a')!=typeof _0x69f819['parameters'][_0x8c7c('0x87')]['admin']){var _0x3d3f4d=_0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x8c7c('0x96')](_0x3d3f4d)){_0x11878c=path['join'](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x3d3f4d);}else{_0x11878c=_0x3d3f4d;}}if('undefined'!=typeof _0x69f819[_0x8c7c('0x84')][_0x8c7c('0x87')][_0x8c7c('0x89')]){var _0x36fd86=_0x69f819['parameters'][_0x8c7c('0x87')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x8c7c('0x96')](_0x36fd86)){_0x4e2a0b=path[_0x8c7c('0x59')](_0x8c7c('0x94'),_0x27af42,_0x455ff5[0x0],_0x36fd86);}else{_0x4e2a0b=_0x36fd86;}}}}var _0xead1c4={'name':_0x124a94,'description':_0x3f2dd9,'path':path[_0x8c7c('0x59')](_0x27af42,_0x455ff5[0x0]),'type':_0x34c09d,'sidebar':_0xa7eb80,'icon':_0x329353,'adminUrl':_0x11878c,'agentUrl':_0x4e2a0b,'scriptName':_0x36483b,'scriptPath':_0x512dd3,'version':_0x536272};removeReferences(_0x17eac5,null);return db[_0x8c7c('0x3a')][_0x8c7c('0x98')](_0xead1c4)['then'](function(_0x572889){var _0xbe11d2={'role':_0x513cec[_0x8c7c('0x99')]['role'],'userProfileId':_0x513cec[_0x8c7c('0x99')][_0x8c7c('0x9a')]};if(!_0xbe11d2)throw new Error(_0x8c7c('0x9b'));if(_0xbe11d2[_0x8c7c('0x9c')]===_0x8c7c('0x9d')){var _0x4db5fa=_0x572889[_0x8c7c('0x35')]({'plain':!![]});return db['UserProfileSection'][_0x8c7c('0x56')]({'where':{'name':_0x8c7c('0x9e'),'userProfileId':_0xbe11d2[_0x8c7c('0x9a')]},'raw':!![]})[_0x8c7c('0x33')](function(_0x3c7f83){if(_0x3c7f83&&_0x3c7f83[_0x8c7c('0x9f')]===0x0){return db['UserProfileResource'][_0x8c7c('0x98')]({'name':_0x4db5fa[_0x8c7c('0x37')],'resourceId':_0x4db5fa['id'],'type':_0x3c7f83[_0x8c7c('0x37')],'sectionId':_0x3c7f83['id']},{})[_0x8c7c('0x33')](function(){return _0x572889;});}else{return _0x572889;}})[_0x8c7c('0xa0')](function(_0x5ea0f5){logger[_0x8c7c('0x36')](_0x8c7c('0xa1'),_0x5ea0f5);throw _0x5ea0f5;});}return _0x572889;})[_0x8c7c('0x33')](respondWithResult(_0x57204c,null))[_0x8c7c('0xa0')](handleError(_0x57204c,null));}});}catch(_0x362c0e){_0x57204c[_0x8c7c('0x27')](0x1f4)[_0x8c7c('0xa2')](_0x362c0e);}};function removeReferences(_0xdee235,_0x3b6a3c){try{if(_0xdee235){fs['unlinkSync'](_0xdee235);logger['info']('Zip\x20archive\x20removed');}if(_0x3b6a3c){rimraf(_0x3b6a3c,function(){});logger[_0x8c7c('0x6f')](_0x8c7c('0xa3'));}}catch(_0x244809){logger['error'](_0x244809);}}exports[_0x8c7c('0x32')]=function(_0x1e5f5a,_0x5b72db,_0x459f64){return db[_0x8c7c('0x3a')][_0x8c7c('0x56')]({'where':{'id':_0x1e5f5a['params']['id']}})[_0x8c7c('0x33')](handleEntityNotFound(_0x5b72db,null))['then'](saveUpdates(_0x1e5f5a[_0x8c7c('0x99')],null))[_0x8c7c('0x33')](respondWithResult(_0x5b72db,null))[_0x8c7c('0xa0')](handleError(_0x5b72db,null));};exports[_0x8c7c('0xa4')]=function(_0x55605f,_0x25f0de,_0x3a21e2){return db[_0x8c7c('0x3a')]['find']({'where':{'id':_0x55605f['params']['id']}})[_0x8c7c('0x33')](function(_0x55e9b4){if(_0x55e9b4){return _0x55e9b4[_0x8c7c('0x34')]();}})[_0x8c7c('0x33')](function(_0x521085){rimraf(path[_0x8c7c('0x59')](config[_0x8c7c('0x76')],'server/files/plugins',path[_0x8c7c('0xa5')](_0x521085[_0x8c7c('0x8')])),function(){});return _0x521085;})['then'](handleEntityNotFound(_0x25f0de,null))['then'](respondWithStatusCode(_0x25f0de,null))['catch'](handleError(_0x25f0de,null));};exports[_0x8c7c('0xa6')]=function(_0x477354,_0x290bfe,_0x3936dd){return BPromise['resolve']()['then'](function(){if(!_0x477354[_0x8c7c('0x43')]['path']){throw new Error(_0x8c7c('0xa7'));}if(!_0x477354[_0x8c7c('0x43')][_0x8c7c('0xa8')]){throw new Error(_0x8c7c('0xa9'));}var _0x3948a8=_0x477354['query']['hostname']?_0x477354['query'][_0x8c7c('0xaa')]+':'+_0x477354['query'][_0x8c7c('0xa8')]:_0x8c7c('0xab')+_0x477354[_0x8c7c('0x43')][_0x8c7c('0xa8')];var _0x1ff009=_0x477354[_0x8c7c('0x43')][_0x8c7c('0x29')]?_0x477354[_0x8c7c('0x43')]['json']:!![];var _0x2720e5=_0x477354[_0x8c7c('0x43')]['encoding']?_0x477354[_0x8c7c('0x43')][_0x8c7c('0xac')]:null;var _0x1657fe={'method':_0x477354['method'],'uri':util['format']('%s%s',_0x3948a8,_0x477354[_0x8c7c('0x43')]['path']),'json':_0x1ff009,'resolveWithFullResponse':!![],'encoding':_0x2720e5,'qs':_0x477354[_0x8c7c('0x43')]};if(_0x477354[_0x8c7c('0xad')]){_0x1657fe[_0x8c7c('0xad')]=_0x477354['headers'];if(_0x1657fe[_0x8c7c('0xad')][_0x8c7c('0xae')]){delete _0x1657fe[_0x8c7c('0xad')][_0x8c7c('0xae')];}}if(_0x1657fe[_0x8c7c('0xad')]['content-type']){delete _0x1657fe[_0x8c7c('0xad')][_0x8c7c('0xaf')];}return rp(_0x1657fe);})['then'](function(_0x422a94){if(_0x422a94){_0x290bfe[_0x8c7c('0x2d')](_0x422a94[_0x8c7c('0xad')]);logger[_0x8c7c('0x6f')](_0x422a94[_0x8c7c('0x99')]);if(_[_0x8c7c('0xb0')](_0x477354['query'][_0x8c7c('0x8')],_0x8c7c('0x57'))&&_0x422a94[_0x8c7c('0xb1')]==0x1f4){return _0x290bfe[_0x8c7c('0x26')](_0x422a94['statusCode']);}else{return _0x290bfe[_0x8c7c('0x27')](_0x422a94[_0x8c7c('0xb1')])[_0x8c7c('0xa2')](_0x422a94[_0x8c7c('0x99')]);}}else{return _0x290bfe['sendStatus'](0xc8);}})[_0x8c7c('0xa0')](handleError(_0x290bfe,null));};exports[_0x8c7c('0xb2')]=function(_0xa76d08,_0x3d8266,_0x4d3357){return BPromise[_0x8c7c('0xb3')]()[_0x8c7c('0x33')](function(){if(!_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0x8')]){throw new Error(_0x8c7c('0xa7'));}if(!_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xa8')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2f9744=_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xaa')]?_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xaa')]+':'+_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xa8')]:_0x8c7c('0xab')+_0xa76d08[_0x8c7c('0x43')]['port'];var _0x417d17=_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0x29')]?_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0x29')]:!![];var _0xb4b943=_0xa76d08['query'][_0x8c7c('0xac')]?_0xa76d08[_0x8c7c('0x43')][_0x8c7c('0xac')]:null;var _0x2adf32={'method':_0xa76d08[_0x8c7c('0xb4')],'uri':util[_0x8c7c('0x6c')](_0x8c7c('0xb5'),_0x2f9744,_0xa76d08[_0x8c7c('0x43')]['path']),'json':_0x417d17,'resolveWithFullResponse':!![],'encoding':_0xb4b943,'body':_0xa76d08[_0x8c7c('0x99')]};if(_0xa76d08[_0x8c7c('0xad')]){_0x2adf32[_0x8c7c('0xad')]=_0xa76d08[_0x8c7c('0xad')];if(_0x2adf32[_0x8c7c('0xad')][_0x8c7c('0xae')]){delete _0x2adf32[_0x8c7c('0xad')][_0x8c7c('0xae')];}}if(_0x2adf32[_0x8c7c('0xad')]['content-type']){delete _0x2adf32[_0x8c7c('0xad')][_0x8c7c('0xaf')];}return rp(_0x2adf32);})[_0x8c7c('0x33')](function(_0x5d181a){if(_0x5d181a){_0x3d8266[_0x8c7c('0x2d')](_0x5d181a[_0x8c7c('0xad')]);logger[_0x8c7c('0x6f')](_0x5d181a[_0x8c7c('0x99')]);return _0x3d8266[_0x8c7c('0x27')](_0x5d181a[_0x8c7c('0xb1')])[_0x8c7c('0xa2')](_0x5d181a[_0x8c7c('0x99')]);}else{return _0x3d8266['sendStatus'](0xc8);}})['catch'](handleError(_0x3d8266,null));}; \ No newline at end of file +var _0x6ff2=['sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','type','query','keys','intersection','model','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','catch','show','length','include','find','download','params','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','encoding','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./plugin.socket','register'];(function(_0x1a22ef,_0x1ef6df){var _0x4a8226=function(_0x47508a){while(--_0x47508a){_0x1a22ef['push'](_0x1a22ef['shift']());}};_0x4a8226(++_0x1ef6df);}(_0x6ff2,0x1e6));var _0x26ff=function(_0x360ed3,_0x373a8c){_0x360ed3=_0x360ed3-0x0;var _0x35f005=_0x6ff2[_0x360ed3];return _0x35f005;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26ff('0x1'));var rp=require(_0x26ff('0x2'));var moment=require(_0x26ff('0x3'));var BPromise=require(_0x26ff('0x4'));var Mustache=require(_0x26ff('0x5'));var util=require('util');var path=require(_0x26ff('0x6'));var sox=require(_0x26ff('0x7'));var csv=require(_0x26ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26ff('0x9'));var _=require('lodash');var squel=require(_0x26ff('0xa'));var crypto=require(_0x26ff('0xb'));var jsforce=require(_0x26ff('0xc'));var deskjs=require(_0x26ff('0xd'));var toCsv=require(_0x26ff('0x8'));var querystring=require('querystring');var Papa=require(_0x26ff('0xe'));var extract=require(_0x26ff('0xf'));var rimraf=require(_0x26ff('0x0'));var archiver=require(_0x26ff('0x10'));var Redis=require(_0x26ff('0x11'));var authService=require(_0x26ff('0x12'));var qs=require(_0x26ff('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26ff('0x14'));var logger=require(_0x26ff('0x15'))(_0x26ff('0x16'));var utils=require('../../config/utils');var config=require(_0x26ff('0x17'));var licenseUtil=require(_0x26ff('0x18'));var db=require(_0x26ff('0x19'))['db'];config[_0x26ff('0x1a')]=_[_0x26ff('0x1b')](config[_0x26ff('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26ff('0x1a')]));require(_0x26ff('0x1c'))[_0x26ff('0x1d')](socket);function respondWithStatusCode(_0x29a68d,_0x502035){_0x502035=_0x502035||0xcc;return function(_0x4b4d53){if(_0x4b4d53){return _0x29a68d[_0x26ff('0x1e')](_0x502035);}return _0x29a68d[_0x26ff('0x1f')](_0x502035)[_0x26ff('0x20')]();};}function respondWithResult(_0x2b142d,_0x12b14c){_0x12b14c=_0x12b14c||0xc8;return function(_0x1522c4){if(_0x1522c4){return _0x2b142d[_0x26ff('0x1f')](_0x12b14c)[_0x26ff('0x21')](_0x1522c4);}};}function respondWithFilteredResult(_0x241b0b,_0x25f874){return function(_0x195887){if(_0x195887){var _0x24ec62=typeof _0x25f874[_0x26ff('0x22')]==='undefined'&&typeof _0x25f874[_0x26ff('0x23')]===_0x26ff('0x24');var _0x56b797=_0x195887[_0x26ff('0x25')];var _0xd24938=_0x24ec62?0x0:_0x25f874[_0x26ff('0x22')];var _0x252bd8=_0x24ec62?_0x195887['count']:_0x25f874[_0x26ff('0x22')]+_0x25f874['limit'];var _0x3df9d3;if(_0x252bd8>=_0x56b797){_0x252bd8=_0x56b797;_0x3df9d3=0xc8;}else{_0x3df9d3=0xce;}_0x241b0b['status'](_0x3df9d3);return _0x241b0b['set'](_0x26ff('0x26'),_0xd24938+'-'+_0x252bd8+'/'+_0x56b797)[_0x26ff('0x21')](_0x195887);}return null;};}function patchUpdates(_0x4eabdb){return function(_0x5c78cb){try{jsonpatch[_0x26ff('0x27')](_0x5c78cb,_0x4eabdb,!![]);}catch(_0x4374d8){return BPromise[_0x26ff('0x28')](_0x4374d8);}return _0x5c78cb[_0x26ff('0x29')]();};}function saveUpdates(_0x4ede2a,_0x1f1a6d){return function(_0x1031a6){if(_0x1031a6){return _0x1031a6['update'](_0x4ede2a)[_0x26ff('0x2a')](function(_0x4f81bb){return _0x4f81bb;});}return null;};}function removeEntity(_0x22017a,_0x295680){return function(_0x24e7f7){if(_0x24e7f7){return _0x24e7f7[_0x26ff('0x2b')]()[_0x26ff('0x2a')](function(){var _0x3d5110=_0x24e7f7[_0x26ff('0x2c')]({'plain':!![]});var _0x1c013f='Plugins';return db[_0x26ff('0x2d')][_0x26ff('0x2b')]({'where':{'type':_0x1c013f,'resourceId':_0x3d5110['id']}})[_0x26ff('0x2a')](function(){return _0x24e7f7;});})['then'](function(){_0x22017a[_0x26ff('0x1f')](0xcc)[_0x26ff('0x20')]();});}};}function handleEntityNotFound(_0x21f3be,_0x9696f8){return function(_0x2a3c98){if(!_0x2a3c98){_0x21f3be[_0x26ff('0x1e')](0x194);}return _0x2a3c98;};}function handleError(_0x143597,_0xc88525){_0xc88525=_0xc88525||0x1f4;return function(_0x3900cc){logger[_0x26ff('0x2e')](_0x3900cc[_0x26ff('0x2f')]);if(_0x3900cc[_0x26ff('0x30')]){delete _0x3900cc['name'];}_0x143597[_0x26ff('0x1f')](_0xc88525)[_0x26ff('0x31')](_0x3900cc);};}exports[_0x26ff('0x32')]=function(_0x534f45,_0x1bdb15){var _0x2542fa={},_0x8b270b={},_0x100270={'count':0x0,'rows':[]};var _0x11545a=_['map'](db[_0x26ff('0x33')][_0x26ff('0x34')],function(_0x2ee2a0){return{'name':_0x2ee2a0['fieldName'],'type':_0x2ee2a0[_0x26ff('0x35')]['key']};});_0x8b270b['model']=_['map'](_0x11545a,'name');_0x8b270b[_0x26ff('0x36')]=_[_0x26ff('0x37')](_0x534f45[_0x26ff('0x36')]);_0x8b270b['filters']=_[_0x26ff('0x38')](_0x8b270b[_0x26ff('0x39')],_0x8b270b[_0x26ff('0x36')]);_0x2542fa[_0x26ff('0x3a')]=_[_0x26ff('0x38')](_0x8b270b[_0x26ff('0x39')],qs['fields'](_0x534f45[_0x26ff('0x36')][_0x26ff('0x3b')]));_0x2542fa[_0x26ff('0x3a')]=_0x2542fa[_0x26ff('0x3a')]['length']?_0x2542fa['attributes']:_0x8b270b[_0x26ff('0x39')];if(!_0x534f45[_0x26ff('0x36')]['hasOwnProperty'](_0x26ff('0x3c'))){_0x2542fa['limit']=qs[_0x26ff('0x23')](_0x534f45[_0x26ff('0x36')][_0x26ff('0x23')]);_0x2542fa[_0x26ff('0x22')]=qs[_0x26ff('0x22')](_0x534f45['query'][_0x26ff('0x22')]);}_0x2542fa[_0x26ff('0x3d')]=qs[_0x26ff('0x3e')](_0x534f45[_0x26ff('0x36')][_0x26ff('0x3e')]);_0x2542fa['where']=qs[_0x26ff('0x3f')](_[_0x26ff('0x40')](_0x534f45[_0x26ff('0x36')],_0x8b270b['filters']),_0x11545a);if(_0x534f45[_0x26ff('0x36')][_0x26ff('0x41')]){_0x2542fa[_0x26ff('0x42')]=_[_0x26ff('0x43')](_0x2542fa[_0x26ff('0x42')],{'$or':_[_0x26ff('0x44')](_0x11545a,function(_0x438863){if(_0x438863[_0x26ff('0x35')]!==_0x26ff('0x45')){var _0x5b8485={};_0x5b8485[_0x438863[_0x26ff('0x30')]]={'$like':'%'+_0x534f45[_0x26ff('0x36')]['filter']+'%'};return _0x5b8485;}})});}_0x2542fa=_['merge']({},_0x2542fa,_0x534f45[_0x26ff('0x46')]);var _0x3bbc0a={'where':_0x2542fa[_0x26ff('0x42')]};return db[_0x26ff('0x33')][_0x26ff('0x25')](_0x3bbc0a)[_0x26ff('0x2a')](function(_0x3a3c8d){_0x100270[_0x26ff('0x25')]=_0x3a3c8d;if(_0x534f45[_0x26ff('0x36')][_0x26ff('0x47')]){_0x2542fa['include']=[{'all':!![]}];}return db[_0x26ff('0x33')]['findAll'](_0x2542fa);})[_0x26ff('0x2a')](function(_0xffe0b2){_0x100270['rows']=_0xffe0b2;return _0x100270;})[_0x26ff('0x2a')](respondWithFilteredResult(_0x1bdb15,_0x2542fa))[_0x26ff('0x48')](handleError(_0x1bdb15,null));};exports[_0x26ff('0x49')]=function(_0x203f3c,_0xdabb05){var _0x5972d5={'raw':!![],'where':{'id':_0x203f3c['params']['id']}},_0x50d3de={};_0x50d3de['model']=_[_0x26ff('0x37')](db[_0x26ff('0x33')]['rawAttributes']);_0x50d3de['query']=_[_0x26ff('0x37')](_0x203f3c[_0x26ff('0x36')]);_0x50d3de[_0x26ff('0x3f')]=_['intersection'](_0x50d3de[_0x26ff('0x39')],_0x50d3de[_0x26ff('0x36')]);_0x5972d5[_0x26ff('0x3a')]=_[_0x26ff('0x38')](_0x50d3de['model'],qs[_0x26ff('0x3b')](_0x203f3c[_0x26ff('0x36')]['fields']));_0x5972d5[_0x26ff('0x3a')]=_0x5972d5[_0x26ff('0x3a')][_0x26ff('0x4a')]?_0x5972d5[_0x26ff('0x3a')]:_0x50d3de[_0x26ff('0x39')];if(_0x203f3c[_0x26ff('0x36')]['includeAll']){_0x5972d5[_0x26ff('0x4b')]=[{'all':!![]}];}_0x5972d5=_[_0x26ff('0x43')]({},_0x5972d5,_0x203f3c['options']);return db[_0x26ff('0x33')][_0x26ff('0x4c')](_0x5972d5)[_0x26ff('0x2a')](handleEntityNotFound(_0xdabb05,null))[_0x26ff('0x2a')](respondWithResult(_0xdabb05,null))['catch'](handleError(_0xdabb05,null));};exports[_0x26ff('0x4d')]=function(_0x5c5501,_0x1a4747,_0x41a37b){return db[_0x26ff('0x33')]['find']({'where':{'id':_0x5c5501[_0x26ff('0x4e')]['id']},'attributes':[_0x26ff('0x30'),_0x26ff('0x6')],'raw':!![]})[_0x26ff('0x2a')](handleEntityNotFound(_0x1a4747,null))['then'](function(_0x451dac){if(_0x451dac){var _0x126a8d=path[_0x26ff('0x4f')](config[_0x26ff('0x50')],_0x26ff('0x51'),util[_0x26ff('0x52')]('%s.zip',path[_0x26ff('0x53')](_0x451dac[_0x26ff('0x6')])));var _0x191d59=fs[_0x26ff('0x54')](_0x126a8d);var _0x155335=archiver(_0x26ff('0x55'),{'zlib':{'level':0x9}});_0x155335['on'](_0x26ff('0x56'),function(_0x5ef048){if(_0x5ef048[_0x26ff('0x57')]===_0x26ff('0x58')){logger[_0x26ff('0x2e')](_0x5ef048);}else{throw new db[(_0x26ff('0x59'))][(_0x26ff('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x155335['on']('error',function(_0x52fe70){throw new db['Sequelize'][(_0x26ff('0x5a'))](_0x26ff('0x5b'));});_0x155335[_0x26ff('0x5c')](_0x191d59);_0x155335[_0x26ff('0x5d')]('**/*',{'cwd':path[_0x26ff('0x4f')](config[_0x26ff('0x50')],_0x26ff('0x51'),path[_0x26ff('0x5e')](_0x451dac[_0x26ff('0x6')])),'ignore':[path[_0x26ff('0x4f')](path[_0x26ff('0x53')](_0x451dac[_0x26ff('0x6')]),_0x26ff('0x5f')),path['join'](path['basename'](_0x451dac[_0x26ff('0x6')]),_0x26ff('0x60'))],'nodir':!![]})[_0x26ff('0x61')]();_0x191d59['on'](_0x26ff('0x62'),function(){if(!fs[_0x26ff('0x63')](_0x126a8d)){throw new db[(_0x26ff('0x59'))][(_0x26ff('0x5a'))]('Plugin\x20not\x20found');}return _0x1a4747['download'](_0x126a8d,util[_0x26ff('0x52')](_0x26ff('0x64'),path['basename'](_0x451dac['path'])),function(_0x4054f5){if(_0x4054f5){throw new db[(_0x26ff('0x59'))]['Error'](_0x26ff('0x65'));}fs['unlinkSync'](_0x126a8d);logger[_0x26ff('0x66')](_0x26ff('0x67'));logger['info'](_0x26ff('0x68'));});});}return null;})[_0x26ff('0x48')](handleError(_0x1a4747,null));};exports[_0x26ff('0x69')]=function(_0x8136d3,_0x41e8b4,_0x419fb7){var _0x26bf1b=path[_0x26ff('0x53')](_0x8136d3[_0x26ff('0x6a')][_0x26ff('0x6b')],path[_0x26ff('0x6c')](_0x8136d3[_0x26ff('0x6a')][_0x26ff('0x6b')]));var _0x195f50=path[_0x26ff('0x4f')](config[_0x26ff('0x50')],'server/files/plugins',_0x8136d3[_0x26ff('0x6a')][_0x26ff('0x6b')]);var _0x39af87=path[_0x26ff('0x4f')](config[_0x26ff('0x50')],'server/files/plugins',_0x26bf1b);logger['info'](_0x26ff('0x6d'),_0x195f50);logger[_0x26ff('0x66')](_0x26ff('0x6e'),_0x39af87);try{fs['chmodSync'](_0x195f50,parseInt(_0x26ff('0x6f'),0x8));extract(_0x195f50,{'dir':_0x39af87},function(_0x51040c){if(_0x51040c){logger['error'](_0x51040c);handleError(_0x51040c,!![]);};var _0x36334c=fs['readdirSync'](_0x39af87);if(_0x36334c[_0x26ff('0x4a')]>0x1){removeReferences(_0x195f50,_0x39af87);logger['error'](_0x26ff('0x70'));return _0x419fb7(new Error(_0x26ff('0x70')));}var _0x3b8599=fs[_0x26ff('0x71')](path[_0x26ff('0x4f')](_0x39af87,_0x36334c[0x0]));if(_0x3b8599[_0x26ff('0x72')]()){removeReferences(_0x195f50,_0x39af87);logger['error'](_0x26ff('0x70'));return _0x419fb7(new Error(_0x26ff('0x70')));}if(_0x3b8599[_0x26ff('0x73')]()){var _0x4a99ef=fs[_0x26ff('0x74')](path['join'](_0x39af87,_0x36334c[0x0]));if(_0x4a99ef[_0x26ff('0x4a')]===0x0){removeReferences(_0x195f50,_0x39af87);logger[_0x26ff('0x2e')](_0x26ff('0x70'));return _0x419fb7(new Error(_0x26ff('0x70')));}var _0x3b7b9b=_0x4a99ef[_0x26ff('0x75')](function(_0x2945e3){return _0x2945e3===_0x26ff('0x76');});if(!_0x3b7b9b){return _0x419fb7(new Error('Plugin\x20manifest\x20missing'));}var _0x14b80a=fs['readFileSync'](path[_0x26ff('0x4f')](_0x39af87,_0x36334c[0x0],_0x26ff('0x76')));var _0x363e1b=JSON[_0x26ff('0x77')](_0x14b80a);if(_0x26ff('0x24')==typeof _0x363e1b[_0x26ff('0x30')]){return _0x419fb7(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x363e1b[_0x26ff('0x35')]){return _0x419fb7(new Error(_0x26ff('0x78')));}if(_0x26ff('0x24')==typeof _0x363e1b[_0x26ff('0x79')]){return _0x419fb7(new Error(_0x26ff('0x7a')));}if(_0x26ff('0x24')==typeof _0x363e1b['parameters']){return _0x419fb7(new Error(_0x26ff('0x7b')));}if(_0x363e1b['type']===_0x26ff('0x7c')){if(_0x26ff('0x24')==typeof _0x363e1b['parameters'][_0x26ff('0x7d')]){return _0x419fb7(new Error(_0x26ff('0x7e')));}if(_0x26ff('0x24')==typeof _0x363e1b[_0x26ff('0x7f')][_0x26ff('0x7d')][_0x26ff('0x80')]&&_0x26ff('0x24')==typeof _0x363e1b['parameters'][_0x26ff('0x7d')][_0x26ff('0x81')]){return _0x419fb7(new Error(_0x26ff('0x82')));}}else if(_0x363e1b['type']===_0x26ff('0x83')){if(_0x26ff('0x24')==typeof _0x363e1b['parameters'][_0x26ff('0x84')]){return _0x419fb7(new Error(_0x26ff('0x85')));}if(_0x26ff('0x24')==typeof _0x363e1b['parameters'][_0x26ff('0x86')]){return _0x419fb7(new Error(_0x26ff('0x87')));}}else{return _0x419fb7(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x4bfd7b=_0x363e1b[_0x26ff('0x30')];var _0x92f5bd=_0x363e1b[_0x26ff('0x88')];var _0x5dbd59=_0x363e1b[_0x26ff('0x35')];var _0xe7891c=_0x363e1b[_0x26ff('0x89')]?_0x363e1b['sidebar']:_0x26ff('0x8a');var _0x197518=_0x363e1b[_0x26ff('0x8b')]?_0x363e1b[_0x26ff('0x8b')]:_0x26ff('0x8c');var _0x3e3ac4='';var _0x420952='';var _0x51146b='';var _0x2a2aa4='';var _0x121b5b=_0x363e1b[_0x26ff('0x79')];if(_0x5dbd59===_0x26ff('0x7c')){if(_0x26ff('0x24')!=typeof _0x363e1b[_0x26ff('0x7f')]['views'][_0x26ff('0x80')]){var _0x2690bb=_0x363e1b[_0x26ff('0x7f')][_0x26ff('0x7d')][_0x26ff('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x26ff('0x8d')](_0x2690bb)){_0x3e3ac4=path[_0x26ff('0x4f')](_0x26ff('0x8e'),_0x26bf1b,_0x36334c[0x0],_0x2690bb);}else{_0x3e3ac4=_0x2690bb;}}else{logger[_0x26ff('0x66')](_0x26ff('0x8f'));}if(_0x26ff('0x24')!=typeof _0x363e1b[_0x26ff('0x7f')][_0x26ff('0x7d')][_0x26ff('0x81')]){var _0x5df02d=_0x363e1b['parameters'][_0x26ff('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x26ff('0x8d')](_0x5df02d)){_0x420952=path[_0x26ff('0x4f')](_0x26ff('0x8e'),_0x26bf1b,_0x36334c[0x0],_0x5df02d);}else{_0x420952=_0x5df02d;}}else{logger[_0x26ff('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5dbd59===_0x26ff('0x83')){_0x51146b=_0x363e1b[_0x26ff('0x7f')][_0x26ff('0x84')];_0x2a2aa4=_0x363e1b[_0x26ff('0x7f')][_0x26ff('0x86')];if('undefined'!=typeof _0x363e1b[_0x26ff('0x7f')]['views']){if(_0x26ff('0x24')!=typeof _0x363e1b['parameters'][_0x26ff('0x7d')][_0x26ff('0x80')]){var _0x2690bb=_0x363e1b[_0x26ff('0x7f')][_0x26ff('0x7d')][_0x26ff('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x26ff('0x8d')](_0x2690bb)){_0x3e3ac4=path[_0x26ff('0x4f')]('plugins',_0x26bf1b,_0x36334c[0x0],_0x2690bb);}else{_0x3e3ac4=_0x2690bb;}}if(_0x26ff('0x24')!=typeof _0x363e1b[_0x26ff('0x7f')]['views']['agent']){var _0x5df02d=_0x363e1b[_0x26ff('0x7f')][_0x26ff('0x7d')][_0x26ff('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5df02d)){_0x420952=path[_0x26ff('0x4f')](_0x26ff('0x8e'),_0x26bf1b,_0x36334c[0x0],_0x5df02d);}else{_0x420952=_0x5df02d;}}}}var _0x248512={'name':_0x4bfd7b,'description':_0x92f5bd,'path':path[_0x26ff('0x4f')](_0x26bf1b,_0x36334c[0x0]),'type':_0x5dbd59,'sidebar':_0xe7891c,'icon':_0x197518,'adminUrl':_0x3e3ac4,'agentUrl':_0x420952,'scriptName':_0x51146b,'scriptPath':_0x2a2aa4,'version':_0x121b5b};removeReferences(_0x195f50,null);return db[_0x26ff('0x33')][_0x26ff('0x90')](_0x248512)[_0x26ff('0x2a')](function(_0x1f2bdf){var _0x118290={'role':_0x8136d3['body']['role'],'userProfileId':_0x8136d3[_0x26ff('0x91')]['userProfileId']};if(!_0x118290)throw new Error(_0x26ff('0x92'));if(_0x118290['role']===_0x26ff('0x93')){var _0x314aab=_0x1f2bdf['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x26ff('0x94'),'userProfileId':_0x118290[_0x26ff('0x95')]},'raw':!![]})[_0x26ff('0x2a')](function(_0x1d05f0){if(_0x1d05f0&&_0x1d05f0[_0x26ff('0x96')]===0x0){return db[_0x26ff('0x2d')][_0x26ff('0x90')]({'name':_0x314aab['name'],'resourceId':_0x314aab['id'],'type':_0x1d05f0[_0x26ff('0x30')],'sectionId':_0x1d05f0['id']},{})[_0x26ff('0x2a')](function(){return _0x1f2bdf;});}else{return _0x1f2bdf;}})[_0x26ff('0x48')](function(_0x121d59){logger[_0x26ff('0x2e')](_0x26ff('0x97'),_0x121d59);throw _0x121d59;});}return _0x1f2bdf;})[_0x26ff('0x2a')](respondWithResult(_0x41e8b4,null))[_0x26ff('0x48')](handleError(_0x41e8b4,null));}});}catch(_0xe7245d){_0x41e8b4['status'](0x1f4)[_0x26ff('0x31')](_0xe7245d);}};function removeReferences(_0x18f862,_0x44af41){try{if(_0x18f862){fs[_0x26ff('0x98')](_0x18f862);logger[_0x26ff('0x66')](_0x26ff('0x99'));}if(_0x44af41){rimraf(_0x44af41,function(){});logger['info'](_0x26ff('0x9a'));}}catch(_0x1644b4){logger[_0x26ff('0x2e')](_0x1644b4);}}exports[_0x26ff('0x9b')]=function(_0x4e26bf,_0x2f7138,_0x2da615){return db[_0x26ff('0x33')][_0x26ff('0x4c')]({'where':{'id':_0x4e26bf[_0x26ff('0x4e')]['id']}})[_0x26ff('0x2a')](handleEntityNotFound(_0x2f7138,null))['then'](saveUpdates(_0x4e26bf[_0x26ff('0x91')],null))[_0x26ff('0x2a')](respondWithResult(_0x2f7138,null))['catch'](handleError(_0x2f7138,null));};exports[_0x26ff('0x9c')]=function(_0x3f37c0,_0x246828,_0x3a2da1){return db['Plugin'][_0x26ff('0x4c')]({'where':{'id':_0x3f37c0['params']['id']}})[_0x26ff('0x2a')](function(_0x329fbf){if(_0x329fbf){return _0x329fbf[_0x26ff('0x2b')]();}})['then'](function(_0x141b2d){rimraf(path[_0x26ff('0x4f')](config[_0x26ff('0x50')],_0x26ff('0x51'),path[_0x26ff('0x5e')](_0x141b2d[_0x26ff('0x6')])),function(){});return _0x141b2d;})[_0x26ff('0x2a')](handleEntityNotFound(_0x246828,null))['then'](respondWithStatusCode(_0x246828,null))[_0x26ff('0x48')](handleError(_0x246828,null));};exports[_0x26ff('0x9d')]=function(_0x3cda81,_0x253de0,_0x27125a){return BPromise[_0x26ff('0x9e')]()[_0x26ff('0x2a')](function(){if(!_0x3cda81['query'][_0x26ff('0x6')]){throw new Error(_0x26ff('0x9f'));}if(!_0x3cda81[_0x26ff('0x36')][_0x26ff('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x105e62=_0x3cda81[_0x26ff('0x36')][_0x26ff('0xa1')]?_0x3cda81[_0x26ff('0x36')]['hostname']+':'+_0x3cda81[_0x26ff('0x36')][_0x26ff('0xa0')]:_0x26ff('0xa2')+_0x3cda81[_0x26ff('0x36')]['port'];var _0x54b6e7=_0x3cda81[_0x26ff('0x36')][_0x26ff('0x21')]?_0x3cda81[_0x26ff('0x36')][_0x26ff('0x21')]:!![];var _0x3ad3a4=_0x3cda81[_0x26ff('0x36')]['encoding']?_0x3cda81[_0x26ff('0x36')]['encoding']:null;var _0x3384d3={'method':_0x3cda81[_0x26ff('0xa3')],'uri':util[_0x26ff('0x52')](_0x26ff('0xa4'),_0x105e62,_0x3cda81[_0x26ff('0x36')]['path']),'json':_0x54b6e7,'resolveWithFullResponse':!![],'encoding':_0x3ad3a4,'qs':_0x3cda81['query']};if(_0x3cda81[_0x26ff('0xa5')]){_0x3384d3[_0x26ff('0xa5')]=_0x3cda81[_0x26ff('0xa5')];if(_0x3384d3[_0x26ff('0xa5')][_0x26ff('0xa6')]){delete _0x3384d3[_0x26ff('0xa5')][_0x26ff('0xa6')];}}if(_0x3384d3[_0x26ff('0xa5')]['content-type']){delete _0x3384d3[_0x26ff('0xa5')][_0x26ff('0xa7')];}return rp(_0x3384d3);})[_0x26ff('0x2a')](function(_0x1bf6c8){if(_0x1bf6c8){_0x253de0['set'](_0x1bf6c8[_0x26ff('0xa5')]);logger[_0x26ff('0x66')](_0x1bf6c8[_0x26ff('0x91')]);if(_[_0x26ff('0xa8')](_0x3cda81[_0x26ff('0x36')][_0x26ff('0x6')],_0x26ff('0x4d'))&&_0x1bf6c8[_0x26ff('0xa9')]==0x1f4){return _0x253de0['sendStatus'](_0x1bf6c8[_0x26ff('0xa9')]);}else{return _0x253de0[_0x26ff('0x1f')](_0x1bf6c8['statusCode'])['send'](_0x1bf6c8[_0x26ff('0x91')]);}}else{return _0x253de0['sendStatus'](0xc8);}})['catch'](handleError(_0x253de0,null));};exports[_0x26ff('0xaa')]=function(_0xeb6e17,_0x12e057,_0x5edd1b){return BPromise[_0x26ff('0x9e')]()[_0x26ff('0x2a')](function(){if(!_0xeb6e17[_0x26ff('0x36')][_0x26ff('0x6')]){throw new Error(_0x26ff('0x9f'));}if(!_0xeb6e17['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x25cee3=_0xeb6e17[_0x26ff('0x36')]['hostname']?_0xeb6e17[_0x26ff('0x36')][_0x26ff('0xa1')]+':'+_0xeb6e17[_0x26ff('0x36')][_0x26ff('0xa0')]:'http://localhost:'+_0xeb6e17[_0x26ff('0x36')][_0x26ff('0xa0')];var _0x2b0595=_0xeb6e17['query'][_0x26ff('0x21')]?_0xeb6e17['query']['json']:!![];var _0x121ccc=_0xeb6e17[_0x26ff('0x36')][_0x26ff('0xab')]?_0xeb6e17['query'][_0x26ff('0xab')]:null;var _0x4d4a30={'method':_0xeb6e17['method'],'uri':util[_0x26ff('0x52')](_0x26ff('0xa4'),_0x25cee3,_0xeb6e17[_0x26ff('0x36')]['path']),'json':_0x2b0595,'resolveWithFullResponse':!![],'encoding':_0x121ccc,'body':_0xeb6e17[_0x26ff('0x91')]};if(_0xeb6e17[_0x26ff('0xa5')]){_0x4d4a30[_0x26ff('0xa5')]=_0xeb6e17[_0x26ff('0xa5')];if(_0x4d4a30[_0x26ff('0xa5')][_0x26ff('0xa6')]){delete _0x4d4a30[_0x26ff('0xa5')][_0x26ff('0xa6')];}}if(_0x4d4a30[_0x26ff('0xa5')]['content-type']){delete _0x4d4a30[_0x26ff('0xa5')][_0x26ff('0xa7')];}return rp(_0x4d4a30);})[_0x26ff('0x2a')](function(_0x8532cd){if(_0x8532cd){_0x12e057['set'](_0x8532cd['headers']);logger[_0x26ff('0x66')](_0x8532cd['body']);return _0x12e057[_0x26ff('0x1f')](_0x8532cd[_0x26ff('0xa9')])[_0x26ff('0x31')](_0x8532cd[_0x26ff('0x91')]);}else{return _0x12e057[_0x26ff('0x1e')](0xc8);}})[_0x26ff('0x48')](handleError(_0x12e057,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 07419b8..5acad51 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 _0xc9ab=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x170a79,_0xab81ec){var _0x487c3f=function(_0x3322b9){while(--_0x3322b9){_0x170a79['push'](_0x170a79['shift']());}};_0x487c3f(++_0xab81ec);}(_0xc9ab,0x125));var _0xbc9a=function(_0x293c66,_0x193d9b){_0x293c66=_0x293c66-0x0;var _0x4d2c4c=_0xc9ab[_0x293c66];return _0x4d2c4c;};'use strict';var EventEmitter=require(_0xbc9a('0x0'));var Plugin=require(_0xbc9a('0x1'))['db'][_0xbc9a('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbc9a('0x3')};function emitEvent(_0x20e8eb){return function(_0x23d40c,_0x33e557,_0x16f84d){PluginEvents[_0xbc9a('0x4')](_0x20e8eb+':'+_0x23d40c['id'],_0x23d40c);PluginEvents[_0xbc9a('0x4')](_0x20e8eb,_0x23d40c);_0x16f84d(null);};}for(var e in events){if(events[_0xbc9a('0x5')](e)){var event=events[e];Plugin[_0xbc9a('0x6')](e,emitEvent(event));}}module[_0xbc9a('0x7')]=PluginEvents; \ No newline at end of file +var _0xc1dc=['../../mysqldb','Plugin','save','remove','emit','hasOwnProperty','events'];(function(_0x3f5b9a,_0x475e44){var _0x25780b=function(_0xc89ada){while(--_0xc89ada){_0x3f5b9a['push'](_0x3f5b9a['shift']());}};_0x25780b(++_0x475e44);}(_0xc1dc,0x84));var _0xcc1d=function(_0x5aec1d,_0x1f495c){_0x5aec1d=_0x5aec1d-0x0;var _0x3822db=_0xc1dc[_0x5aec1d];return _0x3822db;};'use strict';var EventEmitter=require(_0xcc1d('0x0'));var Plugin=require(_0xcc1d('0x1'))['db'][_0xcc1d('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc1d('0x3'),'afterUpdate':'update','afterDestroy':_0xcc1d('0x4')};function emitEvent(_0x3f14d6){return function(_0x48011a,_0x14741b,_0x35ffe8){PluginEvents[_0xcc1d('0x5')](_0x3f14d6+':'+_0x48011a['id'],_0x48011a);PluginEvents[_0xcc1d('0x5')](_0x3f14d6,_0x48011a);_0x35ffe8(null);};}for(var e in events){if(events[_0xcc1d('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index c2e2aa3..7287047 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 _0x5bf2=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5bf2,0x129));var _0x25bf=function(_0xe0efa5,_0x28d42c){_0xe0efa5=_0xe0efa5-0x0;var _0x3ce13a=_0x5bf2[_0xe0efa5];return _0x3ce13a;};'use strict';var _=require(_0x25bf('0x0'));var util=require(_0x25bf('0x1'));var logger=require(_0x25bf('0x2'))(_0x25bf('0x3'));var moment=require(_0x25bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x25bf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25bf('0x6'));var config=require(_0x25bf('0x7'));var attributes=require(_0x25bf('0x8'));module[_0x25bf('0x9')]=function(_0x1c73da,_0x1ac4e2){return _0x1c73da[_0x25bf('0xa')](_0x25bf('0xb'),attributes,{'tableName':_0x25bf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc755=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','plugins'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xc755,0x140));var _0x5c75=function(_0x1e840c,_0x4f45e2){_0x1e840c=_0x1e840c-0x0;var _0x24ed9a=_0xc755[_0x1e840c];return _0x24ed9a;};'use strict';var _=require(_0x5c75('0x0'));var util=require('util');var logger=require(_0x5c75('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5c75('0x2'));var rp=require(_0x5c75('0x3'));var fs=require('fs');var path=require(_0x5c75('0x4'));var rimraf=require(_0x5c75('0x5'));var config=require(_0x5c75('0x6'));var attributes=require('./plugin.attributes');module[_0x5c75('0x7')]=function(_0x561863,_0x3670a9){return _0x561863[_0x5c75('0x8')]('Plugin',attributes,{'tableName':_0x5c75('0x9'),'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 d449861..1b3be2d 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 _0x2b87=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1630e1,_0x324505){var _0x2018a2=function(_0x158ada){while(--_0x158ada){_0x1630e1['push'](_0x1630e1['shift']());}};_0x2018a2(++_0x324505);}(_0x2b87,0x178));var _0x72b8=function(_0x25de08,_0x99cdb6){_0x25de08=_0x25de08-0x0;var _0x56eb5e=_0x2b87[_0x25de08];return _0x56eb5e;};'use strict';var _=require(_0x72b8('0x0'));var util=require(_0x72b8('0x1'));var moment=require(_0x72b8('0x2'));var BPromise=require(_0x72b8('0x3'));var rs=require(_0x72b8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b8('0x5'))['db'];var utils=require(_0x72b8('0x6'));var logger=require('../../config/logger')(_0x72b8('0x7'));var config=require(_0x72b8('0x8'));var jayson=require(_0x72b8('0x9'));var client=jayson[_0x72b8('0xa')][_0x72b8('0xb')]({'port':0x232a});config[_0x72b8('0xc')]=_[_0x72b8('0xd')](config[_0x72b8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x72b8('0xe'))(new Redis(config['redis']));require(_0x72b8('0xf'))[_0x72b8('0x10')](socket);function respondWithRpcPromise(_0x68ed19,_0xef8505,_0x5a0e88){return new BPromise(function(_0x3a9fac,_0xa66987){return client[_0x72b8('0x11')](_0x68ed19,_0x5a0e88)[_0x72b8('0x12')](function(_0x342107){logger[_0x72b8('0x13')](_0x72b8('0x14'),_0xef8505,_0x72b8('0x15'));logger[_0x72b8('0x16')](_0x72b8('0x17'),_0xef8505,_0x72b8('0x15'),JSON[_0x72b8('0x18')](_0x342107));if(_0x342107[_0x72b8('0x19')]){if(_0x342107['error'][_0x72b8('0x1a')]===0x1f4){logger[_0x72b8('0x19')](_0x72b8('0x14'),_0xef8505,_0x342107[_0x72b8('0x19')][_0x72b8('0x1b')]);return _0xa66987(_0x342107['error']['message']);}logger[_0x72b8('0x19')](_0x72b8('0x14'),_0xef8505,_0x342107[_0x72b8('0x19')]['message']);return _0x3a9fac(_0x342107[_0x72b8('0x19')][_0x72b8('0x1b')]);}else{logger['info'](_0x72b8('0x14'),_0xef8505,_0x72b8('0x15'));_0x3a9fac(_0x342107[_0x72b8('0x1c')][_0x72b8('0x1b')]);}})[_0x72b8('0x1d')](function(_0x122ed5){logger['error']('Plugin,\x20%s,\x20%s',_0xef8505,_0x122ed5);_0xa66987(_0x122ed5);});});}exports[_0x72b8('0x1e')]=function(_0x3a0980){var _0x567bad=this;return new Promise(function(_0x232c18,_0xd48d05){return db[_0x72b8('0x1f')][_0x72b8('0x20')](_0x3a0980['body'],{'raw':_0x3a0980['options']?_0x3a0980[_0x72b8('0x21')][_0x72b8('0x22')]===undefined?!![]:![]:!![]})[_0x72b8('0x12')](function(_0x2c8ffd){logger[_0x72b8('0x13')](_0x72b8('0x1e'),_0x3a0980);logger[_0x72b8('0x16')](_0x72b8('0x1e'),_0x3a0980,JSON[_0x72b8('0x18')](_0x2c8ffd));_0x232c18(_0x2c8ffd);})[_0x72b8('0x1d')](function(_0x17425c){logger[_0x72b8('0x19')](_0x72b8('0x1e'),_0x17425c[_0x72b8('0x1b')],_0x3a0980);_0xd48d05(_0x567bad[_0x72b8('0x19')](0x1f4,_0x17425c[_0x72b8('0x1b')]));});});}; \ No newline at end of file +var _0x8433=['error','code','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xafdf47,_0x38b5b3){var _0x1e6c17=function(_0x6f64be){while(--_0x6f64be){_0xafdf47['push'](_0xafdf47['shift']());}};_0x1e6c17(++_0x38b5b3);}(_0x8433,0x1d8));var _0x3843=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0x8433[_0x3b87f4];return _0x63d16e;};'use strict';var _=require(_0x3843('0x0'));var util=require(_0x3843('0x1'));var moment=require(_0x3843('0x2'));var BPromise=require(_0x3843('0x3'));var rs=require(_0x3843('0x4'));var fs=require('fs');var Redis=require(_0x3843('0x5'));var db=require(_0x3843('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3843('0x7'))('rpc');var config=require(_0x3843('0x8'));var jayson=require(_0x3843('0x9'));var client=jayson[_0x3843('0xa')][_0x3843('0xb')]({'port':0x232a});config[_0x3843('0xc')]=_[_0x3843('0xd')](config[_0x3843('0xc')],{'host':_0x3843('0xe'),'port':0x18eb});var socket=require(_0x3843('0xf'))(new Redis(config[_0x3843('0xc')]));require(_0x3843('0x10'))['register'](socket);function respondWithRpcPromise(_0x4a39c3,_0x232d7c,_0x841392){return new BPromise(function(_0x371e22,_0x4c4994){return client[_0x3843('0x11')](_0x4a39c3,_0x841392)[_0x3843('0x12')](function(_0x2290ef){logger[_0x3843('0x13')]('Plugin,\x20%s,\x20%s',_0x232d7c,_0x3843('0x14'));logger['debug'](_0x3843('0x15'),_0x232d7c,_0x3843('0x14'),JSON[_0x3843('0x16')](_0x2290ef));if(_0x2290ef[_0x3843('0x17')]){if(_0x2290ef[_0x3843('0x17')][_0x3843('0x18')]===0x1f4){logger[_0x3843('0x17')](_0x3843('0x19'),_0x232d7c,_0x2290ef[_0x3843('0x17')][_0x3843('0x1a')]);return _0x4c4994(_0x2290ef[_0x3843('0x17')][_0x3843('0x1a')]);}logger[_0x3843('0x17')](_0x3843('0x19'),_0x232d7c,_0x2290ef[_0x3843('0x17')][_0x3843('0x1a')]);return _0x371e22(_0x2290ef[_0x3843('0x17')][_0x3843('0x1a')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x232d7c,_0x3843('0x14'));_0x371e22(_0x2290ef['result'][_0x3843('0x1a')]);}})[_0x3843('0x1b')](function(_0x864fc8){logger[_0x3843('0x17')](_0x3843('0x19'),_0x232d7c,_0x864fc8);_0x4c4994(_0x864fc8);});});}exports[_0x3843('0x1c')]=function(_0xbbcc0e){var _0xa39464=this;return new Promise(function(_0xa4a8c7,_0xa2da5){return db[_0x3843('0x1d')][_0x3843('0x1e')](_0xbbcc0e[_0x3843('0x1f')],{'raw':_0xbbcc0e[_0x3843('0x20')]?_0xbbcc0e[_0x3843('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x3843('0x12')](function(_0x219c9b){logger['info'](_0x3843('0x1c'),_0xbbcc0e);logger['debug'](_0x3843('0x1c'),_0xbbcc0e,JSON[_0x3843('0x16')](_0x219c9b));_0xa4a8c7(_0x219c9b);})['catch'](function(_0x19f8bd){logger[_0x3843('0x17')](_0x3843('0x1c'),_0x19f8bd[_0x3843('0x1a')],_0xbbcc0e);_0xa2da5(_0xa39464[_0x3843('0x17')](0x1f4,_0x19f8bd['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index e6c9333..bbd5baa 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 _0x1d52=['./plugin.events','remove','update','register','length','plugin:'];(function(_0x2de54e,_0x5afd91){var _0x3d5384=function(_0x2cc26d){while(--_0x2cc26d){_0x2de54e['push'](_0x2de54e['shift']());}};_0x3d5384(++_0x5afd91);}(_0x1d52,0x180));var _0x21d5=function(_0x285c55,_0x252e0c){_0x285c55=_0x285c55-0x0;var _0x5554b2=_0x1d52[_0x285c55];return _0x5554b2;};'use strict';var PluginEvents=require(_0x21d5('0x0'));var events=['save',_0x21d5('0x1'),_0x21d5('0x2')];function createListener(_0x319912,_0x1641ea){return function(_0x1dfb1a){_0x1641ea['emit'](_0x319912,_0x1dfb1a);};}function removeListener(_0x57dbed,_0x1a83b7){return function(){PluginEvents['removeListener'](_0x57dbed,_0x1a83b7);};}exports[_0x21d5('0x3')]=function(_0x234759){for(var _0x5e05d3=0x0,_0x4af863=events[_0x21d5('0x4')];_0x5e05d3<_0x4af863;_0x5e05d3++){var _0x309fcc=events[_0x5e05d3];var _0x543a50=createListener(_0x21d5('0x5')+_0x309fcc,_0x234759);PluginEvents['on'](_0x309fcc,_0x543a50);}}; \ No newline at end of file +var _0xf68d=['length','plugin:','save','remove','update','emit','removeListener','register'];(function(_0x1e5b2b,_0x1852f4){var _0x38b780=function(_0x1684ae){while(--_0x1684ae){_0x1e5b2b['push'](_0x1e5b2b['shift']());}};_0x38b780(++_0x1852f4);}(_0xf68d,0x192));var _0xdf68=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xf68d[_0x2d7f0e];return _0x110b07;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xdf68('0x0'),_0xdf68('0x1'),_0xdf68('0x2')];function createListener(_0x5738af,_0x511af8){return function(_0x1489e5){_0x511af8[_0xdf68('0x3')](_0x5738af,_0x1489e5);};}function removeListener(_0x27dd84,_0x3f8947){return function(){PluginEvents[_0xdf68('0x4')](_0x27dd84,_0x3f8947);};}exports[_0xdf68('0x5')]=function(_0xcfb274){for(var _0x5977a5=0x0,_0x18def2=events[_0xdf68('0x6')];_0x5977a5<_0x18def2;_0x5977a5++){var _0x515914=events[_0x5977a5];var _0x492ead=createListener(_0xdf68('0x7')+_0x515914,_0xcfb274);PluginEvents['on'](_0x515914,_0x492ead);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index c59af56..c7c7dbc 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(_0x2a9337,_0x21ff2e){var _0x70d78c=function(_0x3458eb){while(--_0x3458eb){_0x2a9337['push'](_0x2a9337['shift']());}};_0x70d78c(++_0x21ff2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x2db637,_0x3d5742){var _0x2aa2a8=function(_0x179d7b){while(--_0x179d7b){_0x2db637['push'](_0x2db637['shift']());}};_0x2aa2a8(++_0x3d5742);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 52176e0..1aabb37 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 _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(_0xb37099,_0x2bc4eb){var _0x373280=function(_0x4252aa){while(--_0x4252aa){_0xb37099['push'](_0xb37099['shift']());}};_0x373280(++_0x2bc4eb);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x20ebb5,_0x237d88){_0x20ebb5=_0x20ebb5-0x0;var _0x487182=_0xe5b5[_0x20ebb5];return _0x487182;};'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 +var _0x1339=['body','params','delete','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','then','reject','motion2','catch','show','describe','create','../../files/plugins','cwd','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x1339,0x1ed));var _0x9133=function(_0x39be95,_0xcabdb0){_0x39be95=_0x39be95-0x0;var _0x525cea=_0x1339[_0x39be95];return _0x525cea;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var path=require(_0x9133('0x2'));var exec=require(_0x9133('0x3'))[_0x9133('0x4')];var BPromise=require(_0x9133('0x5'));function handleEntityNotFound(_0x176e80,_0x110c51){return function(_0x558345){if(!_0x558345){_0x176e80[_0x9133('0x6')](0x194);;}return _0x558345;};}function respondWithResult(_0x855473,_0x379915){_0x379915=_0x379915||0xc8;return function(_0x539af6){if(_0x539af6){return _0x855473[_0x9133('0x7')](_0x379915)[_0x9133('0x8')](_0x539af6);}return null;};}function handleError(_0x3059c4,_0x431a55){_0x431a55=_0x431a55||0x1f4;return function(_0x261698){logger[_0x9133('0x9')](_0x261698[_0x9133('0xa')]);if(_0x261698[_0x9133('0xb')]){delete _0x261698[_0x9133('0xb')];}_0x3059c4[_0x9133('0x7')](_0x431a55)['send'](_0x261698);};}function execChildProcess(){return new BPromise(function(_0x3f9650,_0x3533fa){exec(_0x9133('0xc'),function(_0x452481,_0x3b8f89,_0x244ced){logger['info'](_0x3b8f89);logger[_0x9133('0xd')](_0x244ced);if(_0x452481){logger[_0x9133('0x9')](_0x452481);return _0x3533fa(_0x452481);}return _0x3f9650(_0x3b8f89);});});}exports['index']=function(_0x5283a3,_0x10475c){return pm2['list']()[_0x9133('0xe')](function(_0x439e1a){if(_0x439e1a){var _0x17dfd1=_[_0x9133('0xf')](_0x439e1a,function(_0x31847a){return _0x31847a[_0x9133('0xb')]==='express'||_0x31847a[_0x9133('0xb')]===_0x9133('0x10');});return{'rows':_0x17dfd1,'count':_0x17dfd1['length']};}return null;})[_0x9133('0xe')](respondWithResult(_0x10475c,null))[_0x9133('0x11')](handleError(_0x10475c,null));};exports[_0x9133('0x12')]=function(_0x427663,_0x4a2c4f){return pm2[_0x9133('0x13')](_0x427663['params']['id'])[_0x9133('0xe')](respondWithResult(_0x4a2c4f,null))['then'](handleEntityNotFound(_0x4a2c4f,null))[_0x9133('0x11')](handleError(_0x4a2c4f,null));};exports[_0x9133('0x14')]=function(_0x5e8620,_0x38dd60){if(_0x5e8620['body'][_0x9133('0xb')]&&_0x5e8620['body']['script']){var _0x2f7354=path['join'](__dirname,_0x9133('0x15'),_0x5e8620['body']['script']);var _0x4c846e=process[_0x9133('0x16')]();process[_0x9133('0x17')](path['dirname'](_0x2f7354));return execChildProcess()[_0x9133('0xe')](function(_0x3f5d0e){process[_0x9133('0x17')](_0x4c846e);return pm2[_0x9133('0x18')]({'name':_0x5e8620['body'][_0x9133('0xb')],'script':_0x2f7354});})['then'](function(_0x187e32){pm2[_0x9133('0x19')]();return _0x187e32[0x0];})[_0x9133('0xe')](respondWithResult(_0x38dd60,0xc9))[_0x9133('0x11')](handleError(_0x38dd60,null));}else{return _0x38dd60[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':_0x9133('0x1b')});}};exports[_0x9133('0x1c')]=function(_0x1b6b3e,_0x46050b){if(_0x1b6b3e['body']['id']){delete _0x1b6b3e['body']['id'];}var _0x477bf1={'online':_0x9133('0x1d'),'stopped':_0x9133('0x1e')};if(_0x477bf1[_0x9133('0x1f')](_0x1b6b3e['body']['status'])){return pm2[_0x477bf1[_0x1b6b3e[_0x9133('0x20')][_0x9133('0x7')]]](_0x1b6b3e[_0x9133('0x21')]['id'])[_0x9133('0xe')](respondWithResult(_0x46050b,0xc8))[_0x9133('0x11')](handleError(_0x46050b,null));}else{return _0x46050b[_0x9133('0x7')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x1ad222,_0x4a4a8e){if(_0x1ad222[_0x9133('0x20')]['id']){delete _0x1ad222[_0x9133('0x20')]['id'];}if(_0x1ad222['params']['id']){return pm2[_0x9133('0x22')](_0x1ad222['params']['id'])[_0x9133('0xe')](function(_0x26ca56){pm2[_0x9133('0x19')]();return _0x26ca56[0x0];})['then'](respondWithResult(_0x4a4a8e,null))[_0x9133('0x11')](handleError(_0x4a4a8e,null));}else{return _0x4a4a8e[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 2f08053..64bf4b9 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 _0x2f14=['Router','../../components/auth/service','get','/agents','isAuthenticated','getAgents','/queues','exports','express'];(function(_0x43e05b,_0x32cb03){var _0x5172f5=function(_0x1e85ac){while(--_0x1e85ac){_0x43e05b['push'](_0x43e05b['shift']());}};_0x5172f5(++_0x32cb03);}(_0x2f14,0x1b8));var _0x42f1=function(_0x2c1d16,_0x2f0dd5){_0x2c1d16=_0x2c1d16-0x0;var _0x29cf36=_0x2f14[_0x2c1d16];return _0x29cf36;};'use strict';var express=require(_0x42f1('0x0'));var router=express[_0x42f1('0x1')]();var auth=require(_0x42f1('0x2'));var controller=require('./realtime.controller');router[_0x42f1('0x3')](_0x42f1('0x4'),auth[_0x42f1('0x5')](),controller[_0x42f1('0x6')]);router[_0x42f1('0x3')](_0x42f1('0x7'),auth['isAuthenticated'](),controller['getQueues']);module[_0x42f1('0x8')]=router; \ No newline at end of file +var _0x16af=['isAuthenticated','getQueues','exports','express','Router','../../components/auth/service','get','/agents','getAgents','/queues'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x16af,0x67));var _0xf16a=function(_0x376676,_0x56d55b){_0x376676=_0x376676-0x0;var _0x1f0b27=_0x16af[_0x376676];return _0x1f0b27;};'use strict';var express=require(_0xf16a('0x0'));var router=express[_0xf16a('0x1')]();var auth=require(_0xf16a('0x2'));var controller=require('./realtime.controller');router[_0xf16a('0x3')](_0xf16a('0x4'),auth['isAuthenticated'](),controller[_0xf16a('0x5')]);router[_0xf16a('0x3')](_0xf16a('0x6'),auth[_0xf16a('0x7')](),controller[_0xf16a('0x8')]);module[_0xf16a('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 06986db..0e51705 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 _0xafab=['key','role','agent','getOptions','raw','sequelize','FIELD(id,','forEach','*pause','Pause','where','user','userProfileId','Agents','UserProfile','getResources','findAndCountAll','filterAgentAttributes','globalStatus','getAgentStatus','Status','sortAgentsByStatus','Queue','rawAttributes','fieldName','QueueCampaigns','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','voice','request','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','then','result','loggedIn','available','waiting','talking','paused','outbound','push','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','pTalking','find','merge','pick','filter','queue','length','some','connectedlinenum','toString','getMembers','UserId','accountcode','online','User','findAll','QueueId','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','pause','resolve','channel','sort','getUpdatedSortOptions','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','type'];(function(_0x1fcc55,_0x6f617e){var _0x3ae024=function(_0xfbdc93){while(--_0xfbdc93){_0x1fcc55['push'](_0x1fcc55['shift']());}};_0x3ae024(++_0x6f617e);}(_0xafab,0x192));var _0xbafa=function(_0x154279,_0xeab21f){_0x154279=_0x154279-0x0;var _0x20bb97=_0xafab[_0x154279];return _0x20bb97;};'use strict';var util=require(_0xbafa('0x0'));var _=require(_0xbafa('0x1'));var jayson=require(_0xbafa('0x2'));var rta=require('../../components/realtime/agents');var qs=require(_0xbafa('0x3'));var utils=require(_0xbafa('0x4'));var logger=require(_0xbafa('0x5'))(_0xbafa('0x6'));var db=require(_0xbafa('0x7'))['db'];var amiClient=jayson[_0xbafa('0x8')][_0xbafa('0x9')]({'port':0x232a});var routingClient=jayson[_0xbafa('0x8')][_0xbafa('0x9')]({'port':0x232c});function respondWithFilteredResult(_0x2e9849,_0x21da8a){return function(_0x318d00){if(_0x318d00){var _0x125f86=typeof _0x21da8a[_0xbafa('0xa')]===_0xbafa('0xb')&&typeof _0x21da8a[_0xbafa('0xc')]===_0xbafa('0xb');var _0x920d0e=_0x318d00[_0xbafa('0xd')];var _0x390b81=_0x125f86?0x0:_0x21da8a[_0xbafa('0xa')];var _0x4fc1f6=_0x125f86?_0x318d00['count']:_0x21da8a['offset']+_0x21da8a[_0xbafa('0xc')];var _0x2caeab;if(_0x4fc1f6>=_0x920d0e){_0x4fc1f6=_0x920d0e;_0x2caeab=0xc8;}else{_0x2caeab=0xce;}_0x2e9849[_0xbafa('0xe')](_0x2caeab);return _0x2e9849[_0xbafa('0xf')](_0xbafa('0x10'),_0x390b81+'-'+_0x4fc1f6+'/'+_0x920d0e)[_0xbafa('0x11')](_0x318d00);}return null;};}function handleError(_0x2c8a5c,_0x3c830b){_0x3c830b=_0x3c830b||0x1f4;return function(_0x2522ac){logger[_0xbafa('0x12')](_0x2522ac[_0xbafa('0x13')]);if(_0x2522ac[_0xbafa('0x14')]){delete _0x2522ac[_0xbafa('0x14')];}_0x2c8a5c['status'](_0x3c830b)['send'](_0x2522ac);};}function getRealtimeQueues(_0x25322d,_0xc8b1ae){return new Promise(function(_0x2ede8e,_0x1cbb8f){var _0x2e584c=_0xc8b1ae===_0xbafa('0x15')?amiClient:routingClient;return _0x2e584c[_0xbafa('0x16')](_[_0xbafa('0x17')](_0xc8b1ae)+_0xbafa('0x18'),_0x25322d)['then'](function(_0x4f47c6){if(_0x4f47c6[_0xbafa('0x12')])throw new Error(util['format'](_0xbafa('0x19'),_0xc8b1ae));return _0x2ede8e(_0x4f47c6['result']);})[_0xbafa('0x1a')](function(_0x564a49){_0x1cbb8f(_0x564a49);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x29f91a,_0x54cc5f){return amiClient[_0xbafa('0x16')](_0xbafa('0x1b'),{})[_0xbafa('0x1c')](function(_0x107cc6){if(_0x107cc6[_0xbafa('0x12')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x29f91a(_0x107cc6[_0xbafa('0x1d')]);})[_0xbafa('0x1a')](function(_0x9c8a1d){_0x54cc5f(_0x9c8a1d);});});}function initializeQueues(_0x1c9d51,_0x4d0197,_0x10b4be,_0x45fe4e){var _0x48de2e=[_0xbafa('0x1e'),_0xbafa('0x1f'),_0xbafa('0x20'),_0xbafa('0x21'),_0xbafa('0x22')];if(_0x10b4be==='voice'&&_0x45fe4e===_0xbafa('0x23')){_0x48de2e[_0xbafa('0x24')]('pTalking',_0xbafa('0x25'),'message',_0xbafa('0x26'),_0xbafa('0x27'),_0xbafa('0x28'),_0xbafa('0x29'),_0xbafa('0x2a'),_0xbafa('0x2b'),_0xbafa('0x2c'),_0xbafa('0x2d'),'erlangBusyFactor',_0xbafa('0x2e'),_0xbafa('0x2f'),_0xbafa('0x30'),_0xbafa('0x31'),_0xbafa('0x32'),_0xbafa('0x33'),_0xbafa('0x34'),_0xbafa('0x35'),'predictiveIntervalAvgHoldtime',_0xbafa('0x36'));}return _0x1c9d51[_0xbafa('0x37')](function(_0x206cf6){var _0x2e7f1e=_0x206cf6[_0xbafa('0x38')]({'plain':!![]});_0x2e7f1e[_0xbafa('0x39')]=[];_0x2e7f1e[_0xbafa('0x22')]=0x0;_0x2e7f1e[_0xbafa('0x3a')]=0x0;_0x2e7f1e[_0xbafa('0x1e')]=0x0;_0x2e7f1e[_0xbafa('0x1f')]=0x0;_0x2e7f1e[_0xbafa('0x20')]=0x0;if(_0x10b4be===_0xbafa('0x15')){_0x2e7f1e[_0xbafa('0x21')]=0x0;_0x2e7f1e[_0xbafa('0x3b')]=0x0;if(_0x45fe4e===_0xbafa('0x23')){_0x2e7f1e[_0xbafa('0x3c')]=0x0;_0x2e7f1e[_0xbafa('0x25')]=0x0;}}var _0x2d1ba4=_[_0xbafa('0x3d')](_0x4d0197,['id',_0x2e7f1e['id']]);if(_0x2d1ba4)_[_0xbafa('0x3e')](_0x2e7f1e,_[_0xbafa('0x3f')](_0x2d1ba4,_0x48de2e));return _0x2e7f1e;});}function updateAgentVoiceStatus(_0x573cfb,_0x3272a9,_0x307763){var _0x44db68=_[_0xbafa('0x40')](_0x307763,[_0xbafa('0x41'),_0x3272a9[_0xbafa('0x14')]]);if(_0x44db68[_0xbafa('0x42')]===0x0)return _0x573cfb[_0xbafa('0x3b')]=!![];if(_[_0xbafa('0x43')](_0x44db68,[_0xbafa('0x44'),_0x573cfb['internal'][_0xbafa('0x45')]()]))return _0x573cfb[_0xbafa('0x21')]=!![];if(!_0x573cfb[_0xbafa('0x21')])return _0x573cfb[_0xbafa('0x3b')]=!![];}function getVoiceQueueAgents(_0x3f04ac,_0x1d9f78,_0x4c4618,_0x4bc466){var _0x5ec11f=_[_0xbafa('0x3d')](_0x1d9f78,['id',_0x3f04ac['id']]);if(!_0x5ec11f)return _0x3f04ac;return _0x5ec11f[_0xbafa('0x46')]({'raw':!![]})['then'](function(_0x54f98c){for(var _0x4419e2=0x0;_0x4419e2<_0x54f98c['length'];_0x4419e2++){var _0x1fd63c=_[_0xbafa('0x3d')](_0x4c4618,['id',_0x54f98c[_0x4419e2][_0xbafa('0x47')]]);if(!_0x1fd63c){_0x1fd63c={'id':_0x54f98c[_0x4419e2][_0xbafa('0x47')],'name':_0x54f98c[_0x4419e2][_0xbafa('0x47')],'accountcode':'','online':![]};}var _0x5e70ff={'id':_0x1fd63c['id'],'name':_0x1fd63c[_0xbafa('0x14')],'internal':_0x1fd63c[_0xbafa('0x48')],'online':Boolean(_0x1fd63c[_0xbafa('0x49')]),'paused':Boolean(_0x54f98c[_0x4419e2][_0xbafa('0x22')])};if(_0x1fd63c['voiceStatus']==='talking')updateAgentVoiceStatus(_0x5e70ff,_0x3f04ac,_0x4bc466);if(_0x5e70ff[_0xbafa('0x49')])_0x3f04ac[_0xbafa('0x3a')]++;if(_0x5e70ff[_0xbafa('0x3b')])_0x3f04ac['busy']++;if(_0x5e70ff[_0xbafa('0x22')]&&!_0x5e70ff[_0xbafa('0x3b')]&&!_0x5e70ff[_0xbafa('0x21')])_0x3f04ac[_0xbafa('0x22')]++;_0x3f04ac['agents'][_0xbafa('0x24')](_0x5e70ff);}return _0x3f04ac;});}function getQueueAgents(_0x4e1b1d,_0x1a422d,_0x45e8ae){var _0x14a892=_0xbafa('0x4a')+_[_0xbafa('0x17')](_0x45e8ae)+'Queue';var _0x1c853d=_0x45e8ae+'Pause';return db[_0x14a892][_0xbafa('0x4b')]({'where':{[_['startCase'](_0x45e8ae)+_0xbafa('0x4c')]:_0x4e1b1d['id']},'raw':!![]})[_0xbafa('0x1c')](function(_0x2d6d6c){for(var _0x426cd8=0x0;_0x426cd8<_0x2d6d6c['length'];_0x426cd8++){var _0x424d23=_[_0xbafa('0x3d')](_0x1a422d,['id',_0x2d6d6c[_0x426cd8][_0xbafa('0x47')]]);if(!_0x424d23){_0x424d23={'id':_0x2d6d6c[_0x426cd8][_0xbafa('0x47')],'name':_0x2d6d6c[_0x426cd8][_0xbafa('0x47')],'online':![],['pauseField']:![]};}var _0x3f6b50={'id':_0x424d23['id'],'name':_0x424d23['name'],'online':Boolean(_0x424d23[_0xbafa('0x49')]),'paused':Boolean(_0x424d23[_0x1c853d])};if(_0x3f6b50[_0xbafa('0x49')])_0x4e1b1d[_0xbafa('0x3a')]++;_0x4e1b1d[_0xbafa('0x39')][_0xbafa('0x24')](_0x3f6b50);}return _0x4e1b1d;});}function validateChannel(_0x19e485){var _0x2fbdf5=utils[_0xbafa('0x4d')]();if(!_[_0xbafa('0x4e')](_0x2fbdf5,_0x19e485[_0xbafa('0x4f')]()))throw new Error(_0xbafa('0x50'));return _0x19e485[_0xbafa('0x4f')]();}exports[_0xbafa('0x51')]=function(_0x17e1d7,_0x241c0d){var _0x3c14d9={'count':0x0,'rows':[]};var _0x188570={};var _0x590c8d;var _0x1356bd;var _0x2d1fdd;var _0x1ea5b1;var _0x39dd91=utils['getChannels']();var _0xf89571=_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x53')];var _0x482c9b=_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x54')];var _0x1c2a3d=_0x17e1d7['query']['pauseTypeFilter'];var _0x4e6ce4=_0x482c9b===_0xbafa('0x55')||_0x482c9b==='*pause'?!![]:![];var _0x426426=[];var _0x9abb6a;Promise[_0xbafa('0x56')]()[_0xbafa('0x1c')](function(){if(_0x17e1d7[_0xbafa('0x52')]['channel']){_0x590c8d=validateChannel(_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x57')]);}if(!_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]||!_0x17e1d7['query'][_0xbafa('0x58')][_0xbafa('0x4e')]('globalStatus')){_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]=rta['validateSortParameter'](_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]);return;}var _0x407f48=rta[_0xbafa('0x59')](_0x17e1d7[_0xbafa('0x52')]['sort']);_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x58')]=_0x407f48['fields'][_0xbafa('0x5a')](',');_0x1356bd=_0x407f48[_0xbafa('0x5b')];})['then'](function(){if(!_0xf89571){return[];}return rta[_0xbafa('0x5c')](_0xf89571,_0x590c8d);})[_0xbafa('0x1c')](function(_0x3289cd){_0x426426=_0x3289cd;return rta[_0xbafa('0x5d')]();})[_0xbafa('0x1c')](function(_0x2766b4){_0x1ea5b1=_0x2766b4[_0xbafa('0x5e')];if((!_0x482c9b||_0x4e6ce4)&&!_0x1356bd){return _0x426426;}if(_0x1356bd&&!_0x482c9b){return rta[_0xbafa('0x5f')](_0x1ea5b1,_0x426426,_0x1356bd);}else{return rta[_0xbafa('0x60')](_0x1ea5b1,_0x426426,_0x482c9b);}})[_0xbafa('0x1c')](function(_0x34f41c){_0x426426=_0x34f41c;var _0x475ea6=![];if(_0x426426[_0xbafa('0x42')]===0x0){if(_0xf89571||_0x482c9b){_0x475ea6=!![];}if(_0x4e6ce4){_0x475ea6=![];}}if(_0x475ea6){return _0x3c14d9;}var _0x17d5b1=_[_0xbafa('0x37')](db[_0xbafa('0x4a')]['rawAttributes'],function(_0x2013e5){return{'name':_0x2013e5['fieldName'],'type':_0x2013e5[_0xbafa('0x61')][_0xbafa('0x62')]};});_0x17e1d7['query'][_0xbafa('0x63')]=_0xbafa('0x64');_0x17e1d7[_0xbafa('0x52')][_0xbafa('0x49')]=!![];_0x188570=qs[_0xbafa('0x65')](_0x17d5b1,_0x17e1d7);_0x188570[_0xbafa('0x66')]=!![];var _0x195c44=[];if(_0x426426[_0xbafa('0x42')]>0x0){_0x195c44[_0xbafa('0x24')]({'id':{'$in':_0x426426}});if(_0x1356bd&&!_0x482c9b){_0x9abb6a=[db[_0xbafa('0x67')]['literal'](_0xbafa('0x68')+_0x426426+')')];_0x188570[_0xbafa('0x5b')]=_0x9abb6a;}}if(_0x4e6ce4){_0x39dd91[_0xbafa('0x69')](function(_0x3be47e){var _0xc3d414=!![];if(_0x482c9b===_0xbafa('0x6a')&&_0x590c8d!==_0x3be47e){_0xc3d414=![];}_0x195c44[_0xbafa('0x24')]({[_0x3be47e+_0xbafa('0x6b')]:_0xc3d414});});if(_0x1c2a3d){_0x195c44[_0xbafa('0x24')]({'pauseType':_0x1c2a3d});}}else if(_0x482c9b){_0x39dd91[_0xbafa('0x69')](function(_0x3489d5){_0x195c44[_0xbafa('0x24')]({[_0x3489d5+_0xbafa('0x6b')]:![]});});}_0x188570[_0xbafa('0x6c')]=_[_0xbafa('0x3e')](_0x188570['where'],{'$and':_0x195c44});if(_0x17e1d7[_0xbafa('0x6d')][_0xbafa('0x63')]===_0xbafa('0x6d')){var _0x2279b2={'params':{'id':_0x17e1d7[_0xbafa('0x6d')][_0xbafa('0x6e')]},'query':{'section':_0xbafa('0x6f'),'role':_0xbafa('0x64'),'online':!![],'raw':!![],'ids':_0x426426,'customSorting':_0x9abb6a}};if(_0x4e6ce4){_0x2279b2[_0xbafa('0x52')]['extraQueryConditions']=_0x195c44;}_0x2279b2[_0xbafa('0x52')]=Object['assign'](_0x2279b2[_0xbafa('0x52')],_0x17e1d7[_0xbafa('0x52')]);delete _0x2279b2['query']['id'];return db[_0xbafa('0x70')][_0xbafa('0x71')](_0x2279b2);}return db['User'][_0xbafa('0x72')](_0x188570);})[_0xbafa('0x1c')](function(_0x5d1a96){_0x3c14d9[_0xbafa('0xd')]=_0x5d1a96[_0xbafa('0xd')];_0x2d1fdd=_0x5d1a96[_0xbafa('0x5e')];return _0x2d1fdd[_0xbafa('0x37')](function(_0x5abbf5){var _0xbcb5bf=_[_0xbafa('0x3d')](_0x1ea5b1,['id',_0x5abbf5['id']]);if(_0xbcb5bf){var _0x3afd06=rta[_0xbafa('0x73')](_0xbcb5bf);_[_0xbafa('0x3e')](_0x5abbf5,_0x3afd06);}_0x5abbf5[_0xbafa('0x74')]=rta[_0xbafa('0x75')](_0x5abbf5);if(_0x5abbf5['globalStatus']['includes'](_0xbafa('0x55'))){_0x39dd91[_0xbafa('0x69')](function(_0x1c668d){if(_0x5abbf5[_0x1c668d+_0xbafa('0x6b')]){_0x5abbf5[_0x1c668d+_0xbafa('0x76')]='pause';}});}return _0x5abbf5;});})[_0xbafa('0x1c')](function(_0x432cb5){if(!_0x1356bd||_0x9abb6a){return _0x432cb5;}return rta[_0xbafa('0x77')](_0x432cb5,_0x1356bd);})['then'](function(_0x4c23c5){_0x3c14d9['rows']=_0x4c23c5;return _0x3c14d9;})[_0xbafa('0x1c')](respondWithFilteredResult(_0x241c0d,_0x188570))[_0xbafa('0x1a')](handleError(_0x241c0d,null));};exports['getQueues']=function(_0x5ce30f,_0x3cf443){var _0x18f241={'count':0x0,'rows':[]},_0x29ee4e={},_0x58e735,_0x30532f,_0xd0fc64,_0x2a74fb,_0x3952f7;Promise['resolve']()['then'](function(){if(_0x5ce30f['query'][_0xbafa('0x57')])_0x58e735=validateChannel(_0x5ce30f['query'][_0xbafa('0x57')]);var _0xfe71b0=_[_0xbafa('0x17')](_0x58e735)+_0xbafa('0x78');var _0x50d8ce=_[_0xbafa('0x37')](db[_0xfe71b0][_0xbafa('0x79')],function(_0x3f44ed){return{'name':_0x3f44ed[_0xbafa('0x7a')],'type':_0x3f44ed[_0xbafa('0x61')][_0xbafa('0x62')]};});_0x29ee4e=qs[_0xbafa('0x65')](_0x50d8ce,_0x5ce30f);if(_0x5ce30f[_0xbafa('0x6d')][_0xbafa('0x63')]===_0xbafa('0x6d')){var _0x2701d1={'params':{'id':_0x5ce30f[_0xbafa('0x6d')][_0xbafa('0x6e')]},'query':{'section':_0x58e735===_0xbafa('0x15')&&_0x5ce30f[_0xbafa('0x52')]['type']===_0xbafa('0x23')?_0xbafa('0x7b'):_[_0xbafa('0x17')](_0x58e735)+'Queues','type':_0x5ce30f['query']['type'],'nolimit':!![],'sort':_0xbafa('0x14'),'filter':_0x5ce30f['query'][_0xbafa('0x40')]}};return db[_0xbafa('0x70')][_0xbafa('0x71')](_0x2701d1);}return db[_0xfe71b0][_0xbafa('0x72')](_0x29ee4e);})[_0xbafa('0x1c')](function(_0x2a0a47){_0x18f241['count']=_0x2a0a47['count'];_0x30532f=_0x2a0a47[_0xbafa('0x5e')];return getRealtimeQueues(_0x5ce30f,_0x58e735);})[_0xbafa('0x1c')](function(_0x245a57){_0x2a74fb=_0x245a57['rows'];return rta['getRealtimeAgents']();})['then'](function(_0x2f7f90){_0xd0fc64=_0x2f7f90[_0xbafa('0x5e')];if(_0x58e735!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xbafa('0x1c')](function(_0x8972b1){_0x3952f7=_0x8972b1?_0x8972b1[_0xbafa('0x5e')]:[];return initializeQueues(_0x30532f,_0x2a74fb,_0x58e735,_0x5ce30f[_0xbafa('0x52')][_0xbafa('0x61')]);})['then'](function(_0x5a8bb2){var _0x282d9f=_0x5a8bb2[_0xbafa('0x37')](function(_0x4580c8){if(_0x58e735==='voice')return getVoiceQueueAgents(_0x4580c8,_0x30532f,_0xd0fc64,_0x3952f7);else return getQueueAgents(_0x4580c8,_0xd0fc64,_0x58e735);});return Promise[_0xbafa('0x7c')](_0x282d9f);})['then'](function(_0x287f47){_0x18f241[_0xbafa('0x5e')]=_0x287f47;return _0x18f241;})['then'](respondWithFilteredResult(_0x3cf443,_0x29ee4e))['catch'](handleError(_0x3cf443,null));}; \ No newline at end of file +var _0x0aae=['client','count','offset','status','set','Content-Range','error','name','send','request','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','voice','push','pTalking','originated','message','dialActive','startPredictive','startProgressive','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','loggedIn','busy','merge','pick','length','some','connectedlinenum','toString','getMembers','find','UserId','online','voiceStatus','User','startCase','Pause','QueueId','getChannels','Invalid\x20channel','toLowerCase','getAgents','globalQueueFilter','query','globalStatusFilter','pause','*pause','resolve','channel','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','getSortedAgentsIdsByStatus','getAgentIdsByStatus','fieldName','type','key','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','order','forEach','where','user','Agents','assign','UserProfile','findAndCountAll','rows','getAgentStatus','sortAgentsByStatus','rawAttributes','userProfileId','outbound','QueueCampaigns','filter','getResources','all','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','../../mysqldb','http'];(function(_0x5ee85d,_0x1a8510){var _0x5b1966=function(_0x31e1d1){while(--_0x31e1d1){_0x5ee85d['push'](_0x5ee85d['shift']());}};_0x5b1966(++_0x1a8510);}(_0x0aae,0x1c3));var _0xe0aa=function(_0x34d641,_0x5d2b8a){_0x34d641=_0x34d641-0x0;var _0x525ffb=_0x0aae[_0x34d641];return _0x525ffb;};'use strict';var util=require(_0xe0aa('0x0'));var _=require(_0xe0aa('0x1'));var jayson=require(_0xe0aa('0x2'));var rta=require(_0xe0aa('0x3'));var qs=require(_0xe0aa('0x4'));var utils=require(_0xe0aa('0x5'));var logger=require(_0xe0aa('0x6'))('api');var db=require(_0xe0aa('0x7'))['db'];var amiClient=jayson['client'][_0xe0aa('0x8')]({'port':0x232a});var routingClient=jayson[_0xe0aa('0x9')][_0xe0aa('0x8')]({'port':0x232c});function respondWithFilteredResult(_0xab5c5d,_0x5149b6){return function(_0x27b361){if(_0x27b361){var _0x2a3261=typeof _0x5149b6['offset']==='undefined'&&typeof _0x5149b6['limit']==='undefined';var _0x38a43f=_0x27b361[_0xe0aa('0xa')];var _0x55202d=_0x2a3261?0x0:_0x5149b6[_0xe0aa('0xb')];var _0x1fdb47=_0x2a3261?_0x27b361[_0xe0aa('0xa')]:_0x5149b6[_0xe0aa('0xb')]+_0x5149b6['limit'];var _0x697b96;if(_0x1fdb47>=_0x38a43f){_0x1fdb47=_0x38a43f;_0x697b96=0xc8;}else{_0x697b96=0xce;}_0xab5c5d[_0xe0aa('0xc')](_0x697b96);return _0xab5c5d[_0xe0aa('0xd')](_0xe0aa('0xe'),_0x55202d+'-'+_0x1fdb47+'/'+_0x38a43f)['json'](_0x27b361);}return null;};}function handleError(_0xce29a2,_0x4fcb38){_0x4fcb38=_0x4fcb38||0x1f4;return function(_0x2f926f){logger[_0xe0aa('0xf')](_0x2f926f['stack']);if(_0x2f926f[_0xe0aa('0x10')]){delete _0x2f926f['name'];}_0xce29a2[_0xe0aa('0xc')](_0x4fcb38)[_0xe0aa('0x11')](_0x2f926f);};}function getRealtimeQueues(_0x1115b3,_0x160599){return new Promise(function(_0x61d895,_0x1d1960){var _0x481321=_0x160599==='voice'?amiClient:routingClient;return _0x481321[_0xe0aa('0x12')](_['startCase'](_0x160599)+_0xe0aa('0x13'),_0x1115b3)[_0xe0aa('0x14')](function(_0x4e42ba){if(_0x4e42ba[_0xe0aa('0xf')])throw new Error(util[_0xe0aa('0x15')](_0xe0aa('0x16'),_0x160599));return _0x61d895(_0x4e42ba[_0xe0aa('0x17')]);})[_0xe0aa('0x18')](function(_0x1b6193){_0x1d1960(_0x1b6193);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3b3ab2,_0x1ce46c){return amiClient[_0xe0aa('0x12')]('VoiceQueuesChannels',{})[_0xe0aa('0x14')](function(_0x1b8d01){if(_0x1b8d01[_0xe0aa('0xf')])throw new Error(_0xe0aa('0x19'));return _0x3b3ab2(_0x1b8d01[_0xe0aa('0x17')]);})[_0xe0aa('0x18')](function(_0x2791b5){_0x1ce46c(_0x2791b5);});});}function initializeQueues(_0x2b1adc,_0x59cd0f,_0x1fbc1f,_0x3cf96e){var _0x391e8c=['loggedIn',_0xe0aa('0x1a'),_0xe0aa('0x1b'),_0xe0aa('0x1c'),_0xe0aa('0x1d')];if(_0x1fbc1f===_0xe0aa('0x1e')&&_0x3cf96e==='outbound'){_0x391e8c[_0xe0aa('0x1f')](_0xe0aa('0x20'),_0xe0aa('0x21'),_0xe0aa('0x22'),_0xe0aa('0x23'),'dialMethod','Trunk',_0xe0aa('0x24'),_0xe0aa('0x25'),'erlangCalls','erlangCallToSecond','erlangAbandonmentRate',_0xe0aa('0x26'),_0xe0aa('0x27'),_0xe0aa('0x28'),_0xe0aa('0x29'),_0xe0aa('0x2a'),_0xe0aa('0x2b'),_0xe0aa('0x2c'),'predictiveIntervalDroppedCallsTimeout',_0xe0aa('0x2d'),'predictiveIntervalAvgHoldtime',_0xe0aa('0x2e'));}return _0x2b1adc[_0xe0aa('0x2f')](function(_0x40d8f4){var _0x13a284=_0x40d8f4[_0xe0aa('0x30')]({'plain':!![]});_0x13a284[_0xe0aa('0x31')]=[];_0x13a284[_0xe0aa('0x1d')]=0x0;_0x13a284[_0xe0aa('0x32')]=0x0;_0x13a284[_0xe0aa('0x33')]=0x0;_0x13a284['available']=0x0;_0x13a284[_0xe0aa('0x1b')]=0x0;if(_0x1fbc1f==='voice'){_0x13a284[_0xe0aa('0x1c')]=0x0;_0x13a284[_0xe0aa('0x34')]=0x0;if(_0x3cf96e==='outbound'){_0x13a284[_0xe0aa('0x20')]=0x0;_0x13a284[_0xe0aa('0x21')]=0x0;}}var _0xf7541a=_['find'](_0x59cd0f,['id',_0x13a284['id']]);if(_0xf7541a)_[_0xe0aa('0x35')](_0x13a284,_[_0xe0aa('0x36')](_0xf7541a,_0x391e8c));return _0x13a284;});}function updateAgentVoiceStatus(_0x1fa61d,_0x409fb4,_0x4e748e){var _0x47d63c=_['filter'](_0x4e748e,['queue',_0x409fb4[_0xe0aa('0x10')]]);if(_0x47d63c[_0xe0aa('0x37')]===0x0)return _0x1fa61d[_0xe0aa('0x34')]=!![];if(_[_0xe0aa('0x38')](_0x47d63c,[_0xe0aa('0x39'),_0x1fa61d['internal'][_0xe0aa('0x3a')]()]))return _0x1fa61d[_0xe0aa('0x1c')]=!![];if(!_0x1fa61d[_0xe0aa('0x1c')])return _0x1fa61d[_0xe0aa('0x34')]=!![];}function getVoiceQueueAgents(_0x395fad,_0x210469,_0xeef056,_0x2d429c){var _0x2bd60e=_['find'](_0x210469,['id',_0x395fad['id']]);if(!_0x2bd60e)return _0x395fad;return _0x2bd60e[_0xe0aa('0x3b')]({'raw':!![]})['then'](function(_0x2ff34b){for(var _0x12ba4d=0x0;_0x12ba4d<_0x2ff34b['length'];_0x12ba4d++){var _0x51769a=_[_0xe0aa('0x3c')](_0xeef056,['id',_0x2ff34b[_0x12ba4d][_0xe0aa('0x3d')]]);if(!_0x51769a){_0x51769a={'id':_0x2ff34b[_0x12ba4d]['UserId'],'name':_0x2ff34b[_0x12ba4d]['UserId'],'accountcode':'','online':![]};}var _0x57c636={'id':_0x51769a['id'],'name':_0x51769a[_0xe0aa('0x10')],'internal':_0x51769a['accountcode'],'online':Boolean(_0x51769a[_0xe0aa('0x3e')]),'paused':Boolean(_0x2ff34b[_0x12ba4d][_0xe0aa('0x1d')])};if(_0x51769a[_0xe0aa('0x3f')]===_0xe0aa('0x1c'))updateAgentVoiceStatus(_0x57c636,_0x395fad,_0x2d429c);if(_0x57c636[_0xe0aa('0x3e')])_0x395fad[_0xe0aa('0x32')]++;if(_0x57c636[_0xe0aa('0x34')])_0x395fad[_0xe0aa('0x34')]++;if(_0x57c636[_0xe0aa('0x1d')]&&!_0x57c636[_0xe0aa('0x34')]&&!_0x57c636[_0xe0aa('0x1c')])_0x395fad[_0xe0aa('0x1d')]++;_0x395fad[_0xe0aa('0x31')]['push'](_0x57c636);}return _0x395fad;});}function getQueueAgents(_0x4fc0b1,_0x3a0976,_0x400b59){var _0x62046=_0xe0aa('0x40')+_[_0xe0aa('0x41')](_0x400b59)+'Queue';var _0x501a4d=_0x400b59+_0xe0aa('0x42');return db[_0x62046]['findAll']({'where':{[_[_0xe0aa('0x41')](_0x400b59)+_0xe0aa('0x43')]:_0x4fc0b1['id']},'raw':!![]})[_0xe0aa('0x14')](function(_0x3d82db){for(var _0x45ff61=0x0;_0x45ff61<_0x3d82db[_0xe0aa('0x37')];_0x45ff61++){var _0x3a0778=_[_0xe0aa('0x3c')](_0x3a0976,['id',_0x3d82db[_0x45ff61]['UserId']]);if(!_0x3a0778){_0x3a0778={'id':_0x3d82db[_0x45ff61][_0xe0aa('0x3d')],'name':_0x3d82db[_0x45ff61][_0xe0aa('0x3d')],'online':![],['pauseField']:![]};}var _0x1464a3={'id':_0x3a0778['id'],'name':_0x3a0778[_0xe0aa('0x10')],'online':Boolean(_0x3a0778[_0xe0aa('0x3e')]),'paused':Boolean(_0x3a0778[_0x501a4d])};if(_0x1464a3['online'])_0x4fc0b1[_0xe0aa('0x32')]++;_0x4fc0b1['agents'][_0xe0aa('0x1f')](_0x1464a3);}return _0x4fc0b1;});}function validateChannel(_0x111b88){var _0x250528=utils[_0xe0aa('0x44')]();if(!_['includes'](_0x250528,_0x111b88['toLowerCase']()))throw new Error(_0xe0aa('0x45'));return _0x111b88[_0xe0aa('0x46')]();}exports[_0xe0aa('0x47')]=function(_0x4d863e,_0x30208d){var _0x52fe6f={'count':0x0,'rows':[]};var _0x452335={};var _0x5ea079;var _0x4e28b1;var _0x372cd0;var _0x348d10;var _0x1692c0=utils['getChannels']();var _0x1f8a7e=_0x4d863e['query'][_0xe0aa('0x48')];var _0xa1318d=_0x4d863e[_0xe0aa('0x49')][_0xe0aa('0x4a')];var _0x4f6b48=_0x4d863e[_0xe0aa('0x49')]['pauseTypeFilter'];var _0xd65b2e=_0xa1318d===_0xe0aa('0x4b')||_0xa1318d===_0xe0aa('0x4c')?!![]:![];var _0x5b71b8=[];var _0x13813d;Promise[_0xe0aa('0x4d')]()['then'](function(){if(_0x4d863e[_0xe0aa('0x49')][_0xe0aa('0x4e')]){_0x5ea079=validateChannel(_0x4d863e[_0xe0aa('0x49')]['channel']);}if(!_0x4d863e[_0xe0aa('0x49')][_0xe0aa('0x4f')]||!_0x4d863e['query']['sort'][_0xe0aa('0x50')](_0xe0aa('0x51'))){_0x4d863e[_0xe0aa('0x49')][_0xe0aa('0x4f')]=rta[_0xe0aa('0x52')](_0x4d863e['query'][_0xe0aa('0x4f')]);return;}var _0x327b4f=rta[_0xe0aa('0x53')](_0x4d863e[_0xe0aa('0x49')]['sort']);_0x4d863e['query'][_0xe0aa('0x4f')]=_0x327b4f[_0xe0aa('0x54')]['join'](',');_0x4e28b1=_0x327b4f['order'];})[_0xe0aa('0x14')](function(){if(!_0x1f8a7e){return[];}return rta['getAgentIdsByQueues'](_0x1f8a7e,_0x5ea079);})[_0xe0aa('0x14')](function(_0x31f25e){_0x5b71b8=_0x31f25e;return rta['getRealtimeAgents']();})[_0xe0aa('0x14')](function(_0x6cb91b){_0x348d10=_0x6cb91b['rows'];if((!_0xa1318d||_0xd65b2e)&&!_0x4e28b1){return _0x5b71b8;}if(_0x4e28b1&&!_0xa1318d){return rta[_0xe0aa('0x55')](_0x348d10,_0x5b71b8,_0x4e28b1);}else{return rta[_0xe0aa('0x56')](_0x348d10,_0x5b71b8,_0xa1318d);}})[_0xe0aa('0x14')](function(_0x15c779){_0x5b71b8=_0x15c779;var _0x403812=![];if(_0x5b71b8['length']===0x0){if(_0x1f8a7e||_0xa1318d){_0x403812=!![];}if(_0xd65b2e){_0x403812=![];}}if(_0x403812){return _0x52fe6f;}var _0x3d27bd=_[_0xe0aa('0x2f')](db['User']['rawAttributes'],function(_0x25d1d4){return{'name':_0x25d1d4[_0xe0aa('0x57')],'type':_0x25d1d4[_0xe0aa('0x58')][_0xe0aa('0x59')]};});_0x4d863e[_0xe0aa('0x49')][_0xe0aa('0x5a')]=_0xe0aa('0x5b');_0x4d863e[_0xe0aa('0x49')][_0xe0aa('0x3e')]=!![];_0x452335=qs[_0xe0aa('0x5c')](_0x3d27bd,_0x4d863e);_0x452335[_0xe0aa('0x5d')]=!![];var _0x234861=[];if(_0x5b71b8['length']>0x0){_0x234861[_0xe0aa('0x1f')]({'id':{'$in':_0x5b71b8}});if(_0x4e28b1&&!_0xa1318d){_0x13813d=[db[_0xe0aa('0x5e')][_0xe0aa('0x5f')](_0xe0aa('0x60')+_0x5b71b8+')')];_0x452335[_0xe0aa('0x61')]=_0x13813d;}}if(_0xd65b2e){_0x1692c0[_0xe0aa('0x62')](function(_0xab7a55){var _0x325fdf=!![];if(_0xa1318d===_0xe0aa('0x4c')&&_0x5ea079!==_0xab7a55){_0x325fdf=![];}_0x234861['push']({[_0xab7a55+'Pause']:_0x325fdf});});if(_0x4f6b48){_0x234861[_0xe0aa('0x1f')]({'pauseType':_0x4f6b48});}}else if(_0xa1318d){_0x1692c0[_0xe0aa('0x62')](function(_0x388d7f){_0x234861[_0xe0aa('0x1f')]({[_0x388d7f+_0xe0aa('0x42')]:![]});});}_0x452335[_0xe0aa('0x63')]=_[_0xe0aa('0x35')](_0x452335[_0xe0aa('0x63')],{'$and':_0x234861});if(_0x4d863e[_0xe0aa('0x64')][_0xe0aa('0x5a')]===_0xe0aa('0x64')){var _0x396f6c={'params':{'id':_0x4d863e[_0xe0aa('0x64')]['userProfileId']},'query':{'section':_0xe0aa('0x65'),'role':_0xe0aa('0x5b'),'online':!![],'raw':!![],'ids':_0x5b71b8,'customSorting':_0x13813d}};if(_0xd65b2e){_0x396f6c[_0xe0aa('0x49')]['extraQueryConditions']=_0x234861;}_0x396f6c[_0xe0aa('0x49')]=Object[_0xe0aa('0x66')](_0x396f6c[_0xe0aa('0x49')],_0x4d863e[_0xe0aa('0x49')]);delete _0x396f6c[_0xe0aa('0x49')]['id'];return db[_0xe0aa('0x67')]['getResources'](_0x396f6c);}return db[_0xe0aa('0x40')][_0xe0aa('0x68')](_0x452335);})['then'](function(_0x2b0d4b){_0x52fe6f['count']=_0x2b0d4b[_0xe0aa('0xa')];_0x372cd0=_0x2b0d4b[_0xe0aa('0x69')];return _0x372cd0[_0xe0aa('0x2f')](function(_0x2375e8){var _0x5295a7=_['find'](_0x348d10,['id',_0x2375e8['id']]);if(_0x5295a7){var _0x139d73=rta['filterAgentAttributes'](_0x5295a7);_[_0xe0aa('0x35')](_0x2375e8,_0x139d73);}_0x2375e8[_0xe0aa('0x51')]=rta[_0xe0aa('0x6a')](_0x2375e8);if(_0x2375e8[_0xe0aa('0x51')][_0xe0aa('0x50')](_0xe0aa('0x4b'))){_0x1692c0[_0xe0aa('0x62')](function(_0x4e046e){if(_0x2375e8[_0x4e046e+_0xe0aa('0x42')]){_0x2375e8[_0x4e046e+'Status']='pause';}});}return _0x2375e8;});})[_0xe0aa('0x14')](function(_0x236fc8){if(!_0x4e28b1||_0x13813d){return _0x236fc8;}return rta[_0xe0aa('0x6b')](_0x236fc8,_0x4e28b1);})[_0xe0aa('0x14')](function(_0x54d9da){_0x52fe6f['rows']=_0x54d9da;return _0x52fe6f;})[_0xe0aa('0x14')](respondWithFilteredResult(_0x30208d,_0x452335))[_0xe0aa('0x18')](handleError(_0x30208d,null));};exports['getQueues']=function(_0x523656,_0x5ebfa7){var _0x4e52b9={'count':0x0,'rows':[]},_0x3b4736={},_0x2e645b,_0x57e0f4,_0x1a7bd3,_0x1631c9,_0x5e25c1;Promise['resolve']()[_0xe0aa('0x14')](function(){if(_0x523656[_0xe0aa('0x49')][_0xe0aa('0x4e')])_0x2e645b=validateChannel(_0x523656[_0xe0aa('0x49')]['channel']);var _0x26e333=_[_0xe0aa('0x41')](_0x2e645b)+'Queue';var _0x3f39ad=_['map'](db[_0x26e333][_0xe0aa('0x6c')],function(_0x106356){return{'name':_0x106356[_0xe0aa('0x57')],'type':_0x106356['type'][_0xe0aa('0x59')]};});_0x3b4736=qs[_0xe0aa('0x5c')](_0x3f39ad,_0x523656);if(_0x523656[_0xe0aa('0x64')]['role']===_0xe0aa('0x64')){var _0x4f757a={'params':{'id':_0x523656[_0xe0aa('0x64')][_0xe0aa('0x6d')]},'query':{'section':_0x2e645b===_0xe0aa('0x1e')&&_0x523656[_0xe0aa('0x49')][_0xe0aa('0x58')]===_0xe0aa('0x6e')?_0xe0aa('0x6f'):_[_0xe0aa('0x41')](_0x2e645b)+'Queues','type':_0x523656[_0xe0aa('0x49')][_0xe0aa('0x58')],'nolimit':!![],'sort':_0xe0aa('0x10'),'filter':_0x523656['query'][_0xe0aa('0x70')]}};return db[_0xe0aa('0x67')][_0xe0aa('0x71')](_0x4f757a);}return db[_0x26e333]['findAndCountAll'](_0x3b4736);})[_0xe0aa('0x14')](function(_0x2eb9d5){_0x4e52b9['count']=_0x2eb9d5[_0xe0aa('0xa')];_0x57e0f4=_0x2eb9d5[_0xe0aa('0x69')];return getRealtimeQueues(_0x523656,_0x2e645b);})['then'](function(_0xd162c2){_0x1631c9=_0xd162c2[_0xe0aa('0x69')];return rta['getRealtimeAgents']();})['then'](function(_0x5358be){_0x1a7bd3=_0x5358be[_0xe0aa('0x69')];if(_0x2e645b!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xe0aa('0x14')](function(_0x137236){_0x5e25c1=_0x137236?_0x137236[_0xe0aa('0x69')]:[];return initializeQueues(_0x57e0f4,_0x1631c9,_0x2e645b,_0x523656[_0xe0aa('0x49')][_0xe0aa('0x58')]);})['then'](function(_0x2da767){var _0x36d57d=_0x2da767['map'](function(_0x4f37a5){if(_0x2e645b===_0xe0aa('0x1e'))return getVoiceQueueAgents(_0x4f37a5,_0x57e0f4,_0x1a7bd3,_0x5e25c1);else return getQueueAgents(_0x4f37a5,_0x1a7bd3,_0x2e645b);});return Promise[_0xe0aa('0x72')](_0x36d57d);})['then'](function(_0x24027f){_0x4e52b9[_0xe0aa('0x69')]=_0x24027f;return _0x4e52b9;})[_0xe0aa('0x14')](respondWithFilteredResult(_0x5ebfa7,_0x3b4736))[_0xe0aa('0x18')](handleError(_0x5ebfa7,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8c2b34b..136a7fb 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xa4e80b,_0x4d910f){var _0x384d3a=function(_0x47d243){while(--_0x47d243){_0xa4e80b['push'](_0xa4e80b['shift']());}};_0x384d3a(++_0x4d910f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x212635,_0x7d8026){var _0x21f0e9=function(_0x2a4bdd){while(--_0x2a4bdd){_0x212635['push'](_0x212635['shift']());}};_0x21f0e9(++_0x7d8026);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0xcb91[_0x2e6dbf];return _0x2680e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 63e6543..c4a431e 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 _0x687b=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x5a5a98,_0x74f555){var _0x7d43ef=function(_0x36116a){while(--_0x36116a){_0x5a5a98['push'](_0x5a5a98['shift']());}};_0x7d43ef(++_0x74f555);}(_0x687b,0x14a));var _0xb687=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0x687b[_0x525798];return _0x57da9a;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'state':{'type':Sequelize[_0xb687('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb687('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb687('0x4')]},'responsetime':{'type':Sequelize[_0xb687('0x4')]},'ringtime':{'type':Sequelize[_0xb687('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb687('0x3')]},'campaigntype':{'type':Sequelize[_0xb687('0x3')]},'membername':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file +var _0xec46=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x4c5685,_0x1fe6b9){var _0x226884=function(_0x1c5fba){while(--_0x1c5fba){_0x4c5685['push'](_0x4c5685['shift']());}};_0x226884(++_0x1fe6b9);}(_0xec46,0x19c));var _0x6ec4=function(_0x5e81d7,_0x330d7){_0x5e81d7=_0x5e81d7-0x0;var _0x2a1a28=_0xec46[_0x5e81d7];return _0x2a1a28;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'state':{'type':Sequelize[_0x6ec4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6ec4('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6ec4('0x4')]},'responsetime':{'type':Sequelize[_0x6ec4('0x4')]},'ringtime':{'type':Sequelize[_0x6ec4('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6ec4('0x3')]},'membername':{'type':Sequelize[_0x6ec4('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 943ddda..8532952 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 _0x089e=['exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1e821a,_0x2ecd6c){var _0x5c97dd=function(_0x453e77){while(--_0x453e77){_0x1e821a['push'](_0x1e821a['shift']());}};_0x5c97dd(++_0x2ecd6c);}(_0x089e,0x10b));var _0xe089=function(_0x38ba9c,_0x1ec0d8){_0x38ba9c=_0x38ba9c-0x0;var _0x132c94=_0x089e[_0x38ba9c];return _0x132c94;};'use strict';var _=require(_0xe089('0x0'));var util=require(_0xe089('0x1'));var logger=require(_0xe089('0x2'))(_0xe089('0x3'));var moment=require(_0xe089('0x4'));var BPromise=require(_0xe089('0x5'));var rp=require(_0xe089('0x6'));var fs=require('fs');var path=require(_0xe089('0x7'));var rimraf=require('rimraf');var config=require(_0xe089('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xe089('0x9')]=function(_0x51c231,_0x504ce8){return _0x51c231['define'](_0xe089('0xa'),attributes,{'tableName':_0xe089('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7ba=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf7ba,0x184));var _0xaf7b=function(_0x14b188,_0x16efbc){_0x14b188=_0x14b188-0x0;var _0x378534=_0xf7ba[_0x14b188];return _0x378534;};'use strict';var _=require(_0xaf7b('0x0'));var util=require(_0xaf7b('0x1'));var logger=require(_0xaf7b('0x2'))('api');var moment=require(_0xaf7b('0x3'));var BPromise=require(_0xaf7b('0x4'));var rp=require(_0xaf7b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf7b('0x6'));var config=require(_0xaf7b('0x7'));var attributes=require(_0xaf7b('0x8'));module[_0xaf7b('0x9')]=function(_0x1ce087,_0x51c036){return _0x1ce087[_0xaf7b('0xa')](_0xaf7b('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index ba17d06..fbfa4b7 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 _0x484d=['raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x484d,0x145));var _0xd484=function(_0x2034ea,_0x59ef99){_0x2034ea=_0x2034ea-0x0;var _0xcc93b9=_0x484d[_0x2034ea];return _0xcc93b9;};'use strict';var _=require(_0xd484('0x0'));var util=require(_0xd484('0x1'));var moment=require(_0xd484('0x2'));var BPromise=require('bluebird');var rs=require(_0xd484('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd484('0x4'))['db'];var utils=require(_0xd484('0x5'));var logger=require(_0xd484('0x6'))(_0xd484('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd484('0x8')][_0xd484('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7667,_0x4776b4,_0x1faba5){return new BPromise(function(_0x106db6,_0x28b43c){return client[_0xd484('0xa')](_0x4d7667,_0x1faba5)[_0xd484('0xb')](function(_0x1b6d9e){logger[_0xd484('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x4776b4,_0xd484('0xd'));logger[_0xd484('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4776b4,'request\x20sent',JSON[_0xd484('0xf')](_0x1b6d9e));if(_0x1b6d9e[_0xd484('0x10')]){if(_0x1b6d9e['error'][_0xd484('0x11')]===0x1f4){logger[_0xd484('0x10')](_0xd484('0x12'),_0x4776b4,_0x1b6d9e[_0xd484('0x10')][_0xd484('0x13')]);return _0x28b43c(_0x1b6d9e[_0xd484('0x10')]['message']);}logger[_0xd484('0x10')](_0xd484('0x12'),_0x4776b4,_0x1b6d9e[_0xd484('0x10')][_0xd484('0x13')]);return _0x106db6(_0x1b6d9e[_0xd484('0x10')][_0xd484('0x13')]);}else{logger[_0xd484('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x4776b4,_0xd484('0xd'));_0x106db6(_0x1b6d9e[_0xd484('0x14')][_0xd484('0x13')]);}})[_0xd484('0x15')](function(_0x5cb400){logger[_0xd484('0x10')](_0xd484('0x12'),_0x4776b4,_0x5cb400);_0x28b43c(_0x5cb400);});});}exports[_0xd484('0x16')]=function(_0x5bd1fc){var _0x13b7ab=this;return new Promise(function(_0x1d5290,_0xf19180){return db[_0xd484('0x17')][_0xd484('0x18')](_0x5bd1fc['body'],{'raw':_0x5bd1fc[_0xd484('0x19')]?_0x5bd1fc[_0xd484('0x19')][_0xd484('0x1a')]===undefined?!![]:![]:!![]})[_0xd484('0xb')](function(_0x4413af){logger[_0xd484('0xc')](_0xd484('0x16'),_0x5bd1fc);logger[_0xd484('0xe')](_0xd484('0x16'),_0x5bd1fc,JSON[_0xd484('0xf')](_0x4413af));_0x1d5290(_0x4413af);})['catch'](function(_0x225590){logger[_0xd484('0x10')](_0xd484('0x16'),_0x225590[_0xd484('0x13')],_0x5bd1fc);_0xf19180(_0x13b7ab[_0xd484('0x10')](0x1f4,_0x225590[_0xd484('0x13')]));});});}; \ No newline at end of file +var _0xfae7=['catch','CreateReportAgentPreview','ReportAgentPreview','body','options','debug','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x134e1a,_0x49a300){var _0x4fc6e6=function(_0xd402f1){while(--_0xd402f1){_0x134e1a['push'](_0x134e1a['shift']());}};_0x4fc6e6(++_0x49a300);}(_0xfae7,0x1d7));var _0x7fae=function(_0x3e0e5e,_0x1c9382){_0x3e0e5e=_0x3e0e5e-0x0;var _0x4c0066=_0xfae7[_0x3e0e5e];return _0x4c0066;};'use strict';var _=require(_0x7fae('0x0'));var util=require(_0x7fae('0x1'));var moment=require(_0x7fae('0x2'));var BPromise=require(_0x7fae('0x3'));var rs=require(_0x7fae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7fae('0x5'));var logger=require(_0x7fae('0x6'))(_0x7fae('0x7'));var config=require(_0x7fae('0x8'));var jayson=require(_0x7fae('0x9'));var client=jayson[_0x7fae('0xa')][_0x7fae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ef744,_0x47e0e3,_0x38a373){return new BPromise(function(_0x26e0cc,_0x211a6d){return client[_0x7fae('0xc')](_0x4ef744,_0x38a373)[_0x7fae('0xd')](function(_0x4d7d34){logger[_0x7fae('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x47e0e3,'request\x20sent');logger['debug'](_0x7fae('0xf'),_0x47e0e3,'request\x20sent',JSON['stringify'](_0x4d7d34));if(_0x4d7d34['error']){if(_0x4d7d34[_0x7fae('0x10')][_0x7fae('0x11')]===0x1f4){logger[_0x7fae('0x10')](_0x7fae('0x12'),_0x47e0e3,_0x4d7d34[_0x7fae('0x10')][_0x7fae('0x13')]);return _0x211a6d(_0x4d7d34[_0x7fae('0x10')][_0x7fae('0x13')]);}logger[_0x7fae('0x10')](_0x7fae('0x12'),_0x47e0e3,_0x4d7d34['error']['message']);return _0x26e0cc(_0x4d7d34[_0x7fae('0x10')]['message']);}else{logger[_0x7fae('0xe')](_0x7fae('0x12'),_0x47e0e3,_0x7fae('0x14'));_0x26e0cc(_0x4d7d34[_0x7fae('0x15')][_0x7fae('0x13')]);}})[_0x7fae('0x16')](function(_0x453bea){logger[_0x7fae('0x10')](_0x7fae('0x12'),_0x47e0e3,_0x453bea);_0x211a6d(_0x453bea);});});}exports[_0x7fae('0x17')]=function(_0xb59ec4){var _0x36bf50=this;return new Promise(function(_0x59fffc,_0x47e914){return db[_0x7fae('0x18')]['create'](_0xb59ec4[_0x7fae('0x19')],{'raw':_0xb59ec4[_0x7fae('0x1a')]?_0xb59ec4[_0x7fae('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7fae('0xd')](function(_0x2d24ca){logger[_0x7fae('0xe')](_0x7fae('0x17'),_0xb59ec4);logger[_0x7fae('0x1b')](_0x7fae('0x17'),_0xb59ec4,JSON[_0x7fae('0x1c')](_0x2d24ca));_0x59fffc(_0x2d24ca);})[_0x7fae('0x16')](function(_0x13ade8){logger[_0x7fae('0x10')]('CreateReportAgentPreview',_0x13ade8['message'],_0xb59ec4);_0x47e914(_0x36bf50['error'](0x1f4,_0x13ade8[_0x7fae('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8256515..eeef606 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 _0x7eaf=['put','/agents/:id/capacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','queueNotify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','agentNotify','exports','multer','util','path','Router','./rpc.controller','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents'];(function(_0xf279a1,_0x401669){var _0x5e01b7=function(_0x4681ae){while(--_0x4681ae){_0xf279a1['push'](_0xf279a1['shift']());}};_0x5e01b7(++_0x401669);}(_0x7eaf,0x11b));var _0xf7ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eaf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf7ea('0x0'));var util=require(_0xf7ea('0x1'));var path=require(_0xf7ea('0x2'));var express=require('express');var router=express[_0xf7ea('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0xf7ea('0x4'));router['get']('/voice/channels',auth[_0xf7ea('0x5')](),controller['voiceChannels']);router[_0xf7ea('0x6')](_0xf7ea('0x7'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x8')]);router[_0xf7ea('0x6')](_0xf7ea('0x9'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0xa')]);router[_0xf7ea('0x6')](_0xf7ea('0xb'),auth['isAuthenticated'](),controller[_0xf7ea('0xc')]);router[_0xf7ea('0x6')](_0xf7ea('0xd'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0xe')]);router[_0xf7ea('0x6')](_0xf7ea('0xf'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x10')]);router[_0xf7ea('0x6')](_0xf7ea('0x11'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x12')]);router[_0xf7ea('0x6')]('/openchannel/queues',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x13')]);router[_0xf7ea('0x6')](_0xf7ea('0x14'),auth[_0xf7ea('0x5')](),controller['smsQueues']);router[_0xf7ea('0x6')](_0xf7ea('0x15'),auth[_0xf7ea('0x5')](),controller['whatsappQueues']);router[_0xf7ea('0x6')](_0xf7ea('0x16'),auth[_0xf7ea('0x5')](),controller['faxQueues']);router['get'](_0xf7ea('0x17'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x18')]);router['get'](_0xf7ea('0x19'),auth['isAuthenticated'](),controller[_0xf7ea('0x1a')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0xf7ea('0x5')](),controller['voiceQueuesChannel']);router[_0xf7ea('0x6')](_0xf7ea('0x1b'),auth['isAuthenticated'](),controller[_0xf7ea('0x1c')]);router[_0xf7ea('0x6')](_0xf7ea('0x1d'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x1e')]);router[_0xf7ea('0x6')](_0xf7ea('0x1f'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x20')]);router['put'](_0xf7ea('0x1f'),auth[_0xf7ea('0x5')](),controller['updateVoiceQueue']);router[_0xf7ea('0x6')](_0xf7ea('0x21'),auth[_0xf7ea('0x5')](),controller['outbound']);router['get'](_0xf7ea('0x22'),auth['isAuthenticated'](),controller[_0xf7ea('0x23')]);router[_0xf7ea('0x6')](_0xf7ea('0x24'),auth['isAuthenticated'](),controller['agents']);router[_0xf7ea('0x25')](_0xf7ea('0x26'),auth[_0xf7ea('0x5')](),controller['agentCapacity']);router['get']('/telephones',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x27')]);router['get'](_0xf7ea('0x28'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x29')]);router[_0xf7ea('0x6')]('/campaigns',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2a')]);router[_0xf7ea('0x6')](_0xf7ea('0x2b'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2c')]);router[_0xf7ea('0x6')](_0xf7ea('0x2d'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2e')]);router[_0xf7ea('0x6')]('/mail/queues/waitinginteractions',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x2f')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0xf7ea('0x5')](),controller['openchannelQueuesWaitingInteractions']);router[_0xf7ea('0x6')](_0xf7ea('0x30'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x31')]);router[_0xf7ea('0x6')](_0xf7ea('0x32'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x33')]);router[_0xf7ea('0x6')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xf7ea('0x34')]);router[_0xf7ea('0x6')](_0xf7ea('0x35'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x36')]);router[_0xf7ea('0x37')](_0xf7ea('0x38'),auth[_0xf7ea('0x5')](),controller['queueNotify'](_0xf7ea('0x39')));router['get'](_0xf7ea('0x3a'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x3b')]);router[_0xf7ea('0x37')](_0xf7ea('0x3c'),auth[_0xf7ea('0x5')](),controller['queueNotify'](_0xf7ea('0x3d')));router['get'](_0xf7ea('0x3e'),auth['isAuthenticated'](),controller[_0xf7ea('0x3f')]);router['post'](_0xf7ea('0x40'),auth[_0xf7ea('0x5')](),controller['queueNotify'](_0xf7ea('0x41')));router[_0xf7ea('0x6')](_0xf7ea('0x42'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x43')]);router[_0xf7ea('0x37')]('/openchannel/queues/:id/notify',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x44')](_0xf7ea('0x45')));router[_0xf7ea('0x6')](_0xf7ea('0x46'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x47')]);router[_0xf7ea('0x37')](_0xf7ea('0x48'),auth['isAuthenticated'](),controller[_0xf7ea('0x44')]('sms'));router[_0xf7ea('0x37')](_0xf7ea('0x49'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x44')](_0xf7ea('0x4a')));router[_0xf7ea('0x6')](_0xf7ea('0x4b'),auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x4c')]);router[_0xf7ea('0x6')](_0xf7ea('0x4d'),auth[_0xf7ea('0x5')](),controller['showWhatsappQueues']);router[_0xf7ea('0x37')]('/agents/:id/notify',auth[_0xf7ea('0x5')](),controller[_0xf7ea('0x4e')]);module[_0xf7ea('0x4f')]=router; \ No newline at end of file +var _0xde3f=['trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','post','queueNotify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','whatsapp','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','util','path','express','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks'];(function(_0x38c1fe,_0x3f2e6f){var _0x24d5f5=function(_0x150ca9){while(--_0x150ca9){_0x38c1fe['push'](_0x38c1fe['shift']());}};_0x24d5f5(++_0x3f2e6f);}(_0xde3f,0x14d));var _0xfde3=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xde3f[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0xfde3('0x0'));var path=require(_0xfde3('0x1'));var express=require(_0xfde3('0x2'));var router=express[_0xfde3('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0xfde3('0x4'));router[_0xfde3('0x5')](_0xfde3('0x6'),auth['isAuthenticated'](),controller[_0xfde3('0x7')]);router['get'](_0xfde3('0x8'),auth['isAuthenticated'](),controller[_0xfde3('0x9')]);router[_0xfde3('0x5')](_0xfde3('0xa'),auth[_0xfde3('0xb')](),controller[_0xfde3('0xc')]);router['get'](_0xfde3('0xd'),auth[_0xfde3('0xb')](),controller['voiceQueues']);router['get']('/chat/queues',auth[_0xfde3('0xb')](),controller['chatQueues']);router[_0xfde3('0x5')]('/mail/queues',auth[_0xfde3('0xb')](),controller['mailQueues']);router[_0xfde3('0x5')](_0xfde3('0xe'),auth[_0xfde3('0xb')](),controller[_0xfde3('0xf')]);router[_0xfde3('0x5')](_0xfde3('0x10'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0xfde3('0x5')](_0xfde3('0x11'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x12')]);router[_0xfde3('0x5')](_0xfde3('0x13'),auth[_0xfde3('0xb')](),controller['whatsappQueues']);router['get'](_0xfde3('0x14'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x15')]);router['get'](_0xfde3('0x16'),auth[_0xfde3('0xb')](),controller['voiceQueuesPreview']);router[_0xfde3('0x5')](_0xfde3('0x17'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0xfde3('0x5')](_0xfde3('0x18'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x19')]);router[_0xfde3('0x5')](_0xfde3('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xfde3('0x5')](_0xfde3('0x1b'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x1c')]);router['get'](_0xfde3('0x1d'),auth[_0xfde3('0xb')](),controller['showVoiceQueues']);router[_0xfde3('0x1e')](_0xfde3('0x1d'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x1f')]);router['get'](_0xfde3('0x20'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x21')]);router[_0xfde3('0x5')](_0xfde3('0x22'),auth['isAuthenticated'](),controller[_0xfde3('0x23')]);router[_0xfde3('0x5')](_0xfde3('0x24'),auth[_0xfde3('0xb')](),controller['agents']);router[_0xfde3('0x1e')](_0xfde3('0x25'),auth['isAuthenticated'](),controller[_0xfde3('0x26')]);router[_0xfde3('0x5')](_0xfde3('0x27'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x28')]);router[_0xfde3('0x5')](_0xfde3('0x29'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x2a')]);router[_0xfde3('0x5')](_0xfde3('0x2b'),auth['isAuthenticated'](),controller[_0xfde3('0x2c')]);router[_0xfde3('0x5')](_0xfde3('0x2d'),auth[_0xfde3('0xb')](),controller['faxAccounts']);router[_0xfde3('0x5')](_0xfde3('0x2e'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x2f')]);router[_0xfde3('0x5')](_0xfde3('0x30'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x31')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0xfde3('0xb')](),controller['openchannelQueuesWaitingInteractions']);router[_0xfde3('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0xfde3('0xb')](),controller[_0xfde3('0x32')]);router[_0xfde3('0x5')](_0xfde3('0x33'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x34')]);router[_0xfde3('0x5')](_0xfde3('0x35'),auth['isAuthenticated'](),controller[_0xfde3('0x36')]);router['get']('/fax/queues/waitinginteractions',auth[_0xfde3('0xb')](),controller['faxQueuesWaitingInteractions']);router['post']('/mail/queues/:id/notify',auth[_0xfde3('0xb')](),controller['queueNotify'](_0xfde3('0x37')));router[_0xfde3('0x5')](_0xfde3('0x38'),auth['isAuthenticated'](),controller[_0xfde3('0x39')]);router['post'](_0xfde3('0x3a'),auth['isAuthenticated'](),controller['queueNotify'](_0xfde3('0x3b')));router[_0xfde3('0x5')](_0xfde3('0x3c'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x3d')]);router[_0xfde3('0x3e')]('/fax/queues/:id/notify',auth[_0xfde3('0xb')](),controller[_0xfde3('0x3f')](_0xfde3('0x40')));router[_0xfde3('0x5')]('/fax/queues/:id',auth[_0xfde3('0xb')](),controller[_0xfde3('0x41')]);router[_0xfde3('0x3e')](_0xfde3('0x42'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x3f')](_0xfde3('0x43')));router['get'](_0xfde3('0x44'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x45')]);router['post']('/sms/queues/:id/notify',auth[_0xfde3('0xb')](),controller[_0xfde3('0x3f')]('sms'));router[_0xfde3('0x3e')]('/whatsapp/queues/:id/notify',auth[_0xfde3('0xb')](),controller['queueNotify'](_0xfde3('0x46')));router[_0xfde3('0x5')]('/sms/queues/:id',auth[_0xfde3('0xb')](),controller[_0xfde3('0x47')]);router[_0xfde3('0x5')](_0xfde3('0x48'),auth[_0xfde3('0xb')](),controller['showWhatsappQueues']);router['post'](_0xfde3('0x49'),auth[_0xfde3('0xb')](),controller[_0xfde3('0x4a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 825785b..f439c2b 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 _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x16acff,_0x56ebcc){var _0x311209=function(_0x4f871f){while(--_0x4f871f){_0x16acff['push'](_0x16acff['shift']());}};_0x311209(++_0x56ebcc);}(_0x2d17,0x17e));var _0x72d1=function(_0x1e2853,_0x2f3288){_0x1e2853=_0x1e2853-0x0;var _0x52f41e=_0x2d17[_0x1e2853];return _0x52f41e;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));}; \ No newline at end of file +var _0x2bd8=['SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','\x20Message\x20not\x20found','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','message','result','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','format','agent','internal','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues'];(function(_0x4308e6,_0x1e2924){var _0x555d58=function(_0x45248e){while(--_0x45248e){_0x4308e6['push'](_0x4308e6['shift']());}};_0x555d58(++_0x1e2924);}(_0x2bd8,0x130));var _0x82bd=function(_0xd86522,_0x16c87b){_0xd86522=_0xd86522-0x0;var _0x3a1c2c=_0x2bd8[_0xd86522];return _0x3a1c2c;};'use strict';var BPromise=require(_0x82bd('0x0'));var moment=require('moment');var _=require(_0x82bd('0x1'));var util=require(_0x82bd('0x2'));var db=require(_0x82bd('0x3'))['db'];var logger=require(_0x82bd('0x4'))(_0x82bd('0x5'));var jayson=require(_0x82bd('0x6'));var amiClient=jayson[_0x82bd('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0x82bd('0x7')][_0x82bd('0x8')]({'port':0x232b});var routingClient=jayson[_0x82bd('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){var _0x1666cf=_0x226f60?_0x226f60:amiClient;return _0x1666cf['request'](_0x19dbb1,_0x77d7a9)['then'](function(_0x51c6ea){if(_0x51c6ea[_0x82bd('0x9')]){if(_0x51c6ea['error']['code']===0x1f4){return _0x4dc3a6(_0x51c6ea[_0x82bd('0x9')]['message']);}return _0x1f7463(_0x51c6ea['error'][_0x82bd('0xa')]);}else{_0x1f7463(_0x51c6ea[_0x82bd('0xb')]);}})['catch'](function(_0x140ad6){_0x4dc3a6(_0x140ad6);});});}function respondWithResult(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xc8;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0xc')](_0xfaccf7)[_0x82bd('0xd')](_0x51e17e);}return _0x5f1ab9[_0x82bd('0xe')](0x194);};}function handleError(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0x1f4;return function(_0x446ffc){logger[_0x82bd('0x9')](_0x446ffc['stack']);if(_0x446ffc[_0x82bd('0xf')]){delete _0x446ffc['name'];}_0x2ca530[_0x82bd('0xc')](_0x58d82b)[_0x82bd('0x10')](_0x446ffc);};}function findById(_0x2c5155){return function(_0x300982){if(!_[_0x82bd('0x11')](_0x2c5155)&&!_[_0x82bd('0x11')](_0x300982)&&!_[_0x82bd('0x11')](_0x300982[_0x82bd('0x12')])){return _[_0x82bd('0x13')](_0x300982[_0x82bd('0x12')],function(_0x390107){return _0x390107['id']==_0x2c5155;});}return null;};}exports[_0x82bd('0x14')]=function(_0x1c3779,_0x253741){return respondWithRpcPromise('VoiceChannels',_0x1c3779['query'])[_0x82bd('0x15')](respondWithResult(_0x253741,null))[_0x82bd('0x16')](handleError(_0x253741,null));};exports[_0x82bd('0x17')]=function(_0xc9fcdf,_0x34899b){return respondWithRpcPromise(_0x82bd('0x18'),_[_0x82bd('0x19')](_0xc9fcdf[_0x82bd('0x1a')],_0xc9fcdf[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x34899b,null))[_0x82bd('0x16')](handleError(_0x34899b,null));};exports[_0x82bd('0x1c')]=function(_0x1ca91f,_0x3260c4){return respondWithRpcPromise(_0x82bd('0x1d'),_[_0x82bd('0x19')](_0x1ca91f[_0x82bd('0x1a')],_0x1ca91f[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x3260c4,null))['catch'](handleError(_0x3260c4,null));};exports['voiceQueues']=function(_0x4248be,_0x436ecd){return respondWithRpcPromise(_0x82bd('0x1e'),_0x4248be[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x436ecd,null))[_0x82bd('0x16')](handleError(_0x436ecd,null));};exports[_0x82bd('0x1f')]=function(_0xbef23b,_0x2f0bb6){return respondWithRpcPromise(_0x82bd('0x1e'),_0xbef23b['query'])['then'](findById(_0xbef23b['params']['id']))['then'](respondWithResult(_0x2f0bb6,null))[_0x82bd('0x16')](handleError(_0x2f0bb6,null));};exports[_0x82bd('0x20')]=function(_0x351d3d,_0x190bca){return respondWithRpcPromise(_0x82bd('0x21'),_['merge'](_0x351d3d['body'],_0x351d3d['params']))[_0x82bd('0x15')](respondWithResult(_0x190bca,null))[_0x82bd('0x16')](handleError(_0x190bca,null));};exports[_0x82bd('0x22')]=function(_0x580ba8,_0x166c46){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x82bd('0x19')](_0x580ba8[_0x82bd('0x1a')],_0x580ba8[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x166c46,null))[_0x82bd('0x16')](handleError(_0x166c46,null));};exports[_0x82bd('0x23')]=function(_0x5ca7fc,_0x591b38){return respondWithRpcPromise(_0x82bd('0x24'),_0x5ca7fc[_0x82bd('0x1a')])['then'](respondWithResult(_0x591b38,null))[_0x82bd('0x16')](handleError(_0x591b38,null));};exports['voiceQueuesChannel']=function(_0x578e6e,_0x3b8015){return respondWithRpcPromise(_0x82bd('0x25'),_[_0x82bd('0x19')](_0x578e6e[_0x82bd('0x1a')],_0x578e6e[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0x3b8015,null))[_0x82bd('0x16')](handleError(_0x3b8015,null));};exports[_0x82bd('0x26')]=function(_0x42dc7f,_0xefc6e4){return respondWithRpcPromise(_0x82bd('0x27'),_[_0x82bd('0x19')](_0x42dc7f[_0x82bd('0x1a')],_0x42dc7f[_0x82bd('0x1b')]))[_0x82bd('0x15')](respondWithResult(_0xefc6e4,null))[_0x82bd('0x16')](handleError(_0xefc6e4,null));};exports[_0x82bd('0x28')]=function(_0x4bdcae,_0x59b7ca){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x82bd('0x19')](_0x4bdcae[_0x82bd('0x1a')],_0x4bdcae['params']))[_0x82bd('0x15')](respondWithResult(_0x59b7ca,null))['catch'](handleError(_0x59b7ca,null));};exports['outbound']=function(_0x4c5f8d,_0x2b7675){return respondWithRpcPromise(_0x82bd('0x29'),_0x4c5f8d[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x2b7675,null))[_0x82bd('0x16')](handleError(_0x2b7675,null));};exports['outboundChannels']=function(_0x54e33f,_0x575c14){return respondWithRpcPromise(_0x82bd('0x2a'),_0x54e33f['query'])['then'](respondWithResult(_0x575c14,null))[_0x82bd('0x16')](handleError(_0x575c14,null));};exports[_0x82bd('0x2b')]=function(_0x3192e2,_0x2c5e7d){var _0x3ff054;return respondWithRpcPromise(_0x82bd('0x2c'),_0x3192e2[_0x82bd('0x1a')])[_0x82bd('0x15')](function(_0x18752a){_0x3ff054=_0x18752a;return respondWithRpcPromise('Agents',_0x3192e2['query'],routingClient);})[_0x82bd('0x15')](function(_0x689b3c){return _['merge']({},_0x689b3c,_0x3ff054);})['then'](respondWithResult(_0x2c5e7d,null))[_0x82bd('0x16')](handleError(_0x2c5e7d,null));};exports[_0x82bd('0x2d')]=function(_0x4d310b,_0x121f1f){if(_0x4d310b[_0x82bd('0x2e')]&&_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]&&_0x4d310b[_0x82bd('0x30')]&&_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')]){for(var _0x2c429d in _0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]){if(_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')]['hasOwnProperty'](_0x2c429d)){db[_0x82bd('0x31')][_0x82bd('0x32')]({'where':{'channel':_0x2c429d,'membername':_0x4d310b['user']['name'],'type':_0x82bd('0x33'),'exitAt':null,'uniqueid':_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d]&&_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d]['length']?{'$notIn':_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d]}:{'$ne':null}}})[_0x82bd('0x15')](function(_0x4b2fb8){var _0x158957=moment()['format'](_0x82bd('0x34'));for(var _0x6d65c6=0x0,_0x587aec=_0x4b2fb8[_0x82bd('0x35')];_0x6d65c6<_0x587aec;_0x6d65c6+=0x1){_0x4b2fb8[_0x6d65c6][_0x82bd('0x36')]({'exitAt':_0x158957});}});for(var _0x54d12e=0x0;_0x54d12e<_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d]['length'];_0x54d12e+=0x1){db[_0x82bd('0x31')][_0x82bd('0x37')]({'where':{'channel':_0x2c429d,'membername':_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')],'type':'INTERACTION','uniqueid':_0x4d310b['body'][_0x82bd('0x2f')][_0x2c429d][_0x54d12e],'exitAt':null},'defaults':{'channel':_0x2c429d,'membername':_0x4d310b[_0x82bd('0x30')]['name'],'interface':_[_0x82bd('0x11')](_0x4d310b[_0x82bd('0x30')][_0x82bd('0x38')])?util['format'](_0x82bd('0x39'),_0x4d310b[_0x82bd('0x30')][_0x82bd('0xf')]):_0x4d310b[_0x82bd('0x30')][_0x82bd('0x38')],'type':_0x82bd('0x33'),'enterAt':moment()[_0x82bd('0x3a')](_0x82bd('0x34')),'role':_0x82bd('0x3b'),'internal':_0x4d310b[_0x82bd('0x30')][_0x82bd('0x3c')],'uniqueid':_0x4d310b[_0x82bd('0x2e')][_0x82bd('0x2f')][_0x2c429d][_0x54d12e]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x4d310b[_0x82bd('0x1b')]['id'],'capacity':_0x4d310b[_0x82bd('0x2e')]['capacity']},routingClient)[_0x82bd('0x15')](respondWithResult(_0x121f1f,null))[_0x82bd('0x16')](handleError(_0x121f1f,null));};exports[_0x82bd('0x3d')]=function(_0x4237ef,_0x55a2e6){return respondWithRpcPromise('Telephones',_0x4237ef[_0x82bd('0x1a')])['then'](respondWithResult(_0x55a2e6,null))['catch'](handleError(_0x55a2e6,null));};exports[_0x82bd('0x3e')]=function(_0x4c35dd,_0x523cbe){return respondWithRpcPromise(_0x82bd('0x3f'),_0x4c35dd[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x523cbe,null))[_0x82bd('0x16')](handleError(_0x523cbe,null));};exports[_0x82bd('0x40')]=function(_0x1a7402,_0x417c29){return respondWithRpcPromise(_0x82bd('0x41'),_0x1a7402[_0x82bd('0x1a')])[_0x82bd('0x15')](respondWithResult(_0x417c29,null))[_0x82bd('0x16')](handleError(_0x417c29,null));};exports[_0x82bd('0x42')]=function(_0x153fad,_0x1a1cdc){return respondWithRpcPromise(_0x82bd('0x43'),_0x153fad['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x1a1cdc,null))[_0x82bd('0x16')](handleError(_0x1a1cdc,null));};exports[_0x82bd('0x44')]=function(_0x354581,_0x9bf8fa){return respondWithRpcPromise('ChatQueues',_0x354581['query'],routingClient)['then'](findById(_0x354581['params']['id']))[_0x82bd('0x15')](respondWithResult(_0x9bf8fa,null))[_0x82bd('0x16')](handleError(_0x9bf8fa,null));};exports[_0x82bd('0x45')]=function(_0x127f8f,_0x568fc3){return respondWithRpcPromise('MailQueues',_0x127f8f[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x568fc3,null))[_0x82bd('0x16')](handleError(_0x568fc3,null));};exports['showMailQueues']=function(_0x2657bc,_0x2252ef){return respondWithRpcPromise(_0x82bd('0x46'),_0x2657bc[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x2657bc[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x2252ef,null))[_0x82bd('0x16')](handleError(_0x2252ef,null));};exports[_0x82bd('0x47')]=function(_0x20b636,_0x3ae44e){return respondWithRpcPromise(_0x82bd('0x48'),_0x20b636[_0x82bd('0x1a')],mailClient)[_0x82bd('0x15')](respondWithResult(_0x3ae44e,null))[_0x82bd('0x16')](handleError(_0x3ae44e,null));};exports[_0x82bd('0x49')]=function(_0x124ca4,_0x1fa71d){return respondWithRpcPromise('OpenchannelQueues',_0x124ca4[_0x82bd('0x1a')],routingClient)['then'](respondWithResult(_0x1fa71d,null))['catch'](handleError(_0x1fa71d,null));};exports[_0x82bd('0x4a')]=function(_0x4d2305,_0x306247){return respondWithRpcPromise(_0x82bd('0x4b'),_0x4d2305[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x4d2305[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x306247,null))[_0x82bd('0x16')](handleError(_0x306247,null));};exports[_0x82bd('0x4c')]=function(_0x40d6cf,_0x37ede1){return respondWithRpcPromise(_0x82bd('0x4d'),_0x40d6cf['query'],routingClient)['then'](respondWithResult(_0x37ede1,null))[_0x82bd('0x16')](handleError(_0x37ede1,null));};exports[_0x82bd('0x4e')]=function(_0x513e1d,_0x47d136){return respondWithRpcPromise(_0x82bd('0x4d'),_0x513e1d[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x513e1d[_0x82bd('0x1b')]['id']))['then'](respondWithResult(_0x47d136,null))[_0x82bd('0x16')](handleError(_0x47d136,null));};exports['whatsappQueues']=function(_0x1a16c1,_0x6ff77c){return respondWithRpcPromise('WhatsappQueues',_0x1a16c1[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x6ff77c,null))[_0x82bd('0x16')](handleError(_0x6ff77c,null));};exports[_0x82bd('0x4f')]=function(_0x5a5d66,_0x1b5b39){return respondWithRpcPromise(_0x82bd('0x50'),_0x5a5d66[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x5a5d66[_0x82bd('0x1b')]['id']))[_0x82bd('0x15')](respondWithResult(_0x1b5b39,null))[_0x82bd('0x16')](handleError(_0x1b5b39,null));};exports[_0x82bd('0x51')]=function(_0x1384b0,_0x544f10){return respondWithRpcPromise(_0x82bd('0x52'),_0x1384b0['query'],routingClient)['then'](respondWithResult(_0x544f10,null))[_0x82bd('0x16')](handleError(_0x544f10,null));};exports[_0x82bd('0x53')]=function(_0x529cb2,_0x2d2a7e){return respondWithRpcPromise('FaxQueues',_0x529cb2[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](findById(_0x529cb2['params']['id']))[_0x82bd('0x15')](respondWithResult(_0x2d2a7e,null))[_0x82bd('0x16')](handleError(_0x2d2a7e,null));};exports['faxAccounts']=function(_0x505032,_0x5bd3ae){return respondWithRpcPromise(_0x82bd('0x54'),_0x505032[_0x82bd('0x1a')])['then'](respondWithResult(_0x5bd3ae,null))[_0x82bd('0x16')](handleError(_0x5bd3ae,null));};exports[_0x82bd('0x55')]=function(_0x52b73f,_0x5591af){return respondWithRpcPromise(_0x82bd('0x56'),_0x52b73f['query'],routingClient)['then'](respondWithResult(_0x5591af,null))[_0x82bd('0x16')](handleError(_0x5591af,null));};exports[_0x82bd('0x57')]=function(_0x988094,_0x3d1f0d){return respondWithRpcPromise(_0x82bd('0x58'),_0x988094['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x3d1f0d,null))['catch'](handleError(_0x3d1f0d,null));};exports[_0x82bd('0x59')]=function(_0x5e25c3,_0x2fbf08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5e25c3['query'],routingClient)[_0x82bd('0x15')](respondWithResult(_0x2fbf08,null))[_0x82bd('0x16')](handleError(_0x2fbf08,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x282263,_0x15a849){return respondWithRpcPromise(_0x82bd('0x5a'),_0x282263['query'],routingClient)['then'](function(_0x197368){if(_0x282263[_0x82bd('0x1a')]['type']!==undefined){var _0x222f9d=_(_0x197368[_0x82bd('0x12')])['filter']([_0x282263[_0x82bd('0x1a')][_0x82bd('0x5b')],_0x282263[_0x82bd('0x1b')]['id']])[_0x82bd('0x5c')](_0x82bd('0x5d'))[_0x82bd('0x5e')]()['value']();return _0x197368[_0x82bd('0x12')][_0x82bd('0x5f')](function(_0x12bc87){return _0x222f9d['indexOf'](_0x12bc87[_0x82bd('0x5d')])>-0x1;});}else{return _0x197368['rows'][_0x82bd('0x5f')](function(_0x2d9bc0){return _0x2d9bc0[_0x82bd('0x5d')]===parseInt(_0x282263[_0x82bd('0x1b')]['id']);});}})[_0x82bd('0x15')](respondWithResult(_0x15a849,null))['catch'](handleError(_0x15a849,null));};exports[_0x82bd('0x60')]=function(_0x39b9d5,_0x54e547){return respondWithRpcPromise(_0x82bd('0x61'),_0x39b9d5[_0x82bd('0x1a')],routingClient)['then'](respondWithResult(_0x54e547,null))[_0x82bd('0x16')](handleError(_0x54e547,null));};exports[_0x82bd('0x62')]=function(_0x42d4c9,_0x55fe38){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x42d4c9[_0x82bd('0x1a')],routingClient)[_0x82bd('0x15')](respondWithResult(_0x55fe38,null))[_0x82bd('0x16')](handleError(_0x55fe38,null));};exports['faxQueuesWaitingInteractions']=function(_0x465979,_0x4721c3){return respondWithRpcPromise(_0x82bd('0x63'),_0x465979['query'],routingClient)['then'](respondWithResult(_0x4721c3,null))['catch'](handleError(_0x4721c3,null));};exports['queueNotify']=function(_0x437463){return function(_0x45bbf7,_0x4b5bf4){var _0x35d111,_0x546106;var _0x1da93f=_['capitalize'](_0x437463);var _0x43d8a2=_0x437463===_0x82bd('0x64')?_0x82bd('0x65'):'Account';return db[_0x1da93f+_0x82bd('0x66')][_0x82bd('0x67')]({'raw':!![],'where':{'id':_0x45bbf7[_0x82bd('0x1b')]['id']}})[_0x82bd('0x15')](function(_0xbe937d){if(_['isNil'](_0xbe937d)){throw new Error(_0x1da93f+_0x82bd('0x68'));}_0x35d111=_0xbe937d;return db[_0x1da93f+_0x82bd('0x69')][_0x82bd('0x67')]({'where':{'id':_0x45bbf7['body']['messageId']},'include':[{'model':db[_0x1da93f+'Interaction'],'as':_0x82bd('0x6a')},{'model':db[_0x1da93f+_0x43d8a2],'as':_0x82bd('0x6b')}]});})[_0x82bd('0x15')](function(_0x1a7f98){if(_[_0x82bd('0x11')](_0x1a7f98)){throw new Error(_0x1da93f+'\x20Message\x20not\x20found');}_0x546106=_0x1a7f98;return _0x1a7f98['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5a8e7f={'uniqueid':_0x437463+'.'+_0x546106['id']+'.'+_0x546106[_0x82bd('0x6a')]['id'],'FromUserId':_0x45bbf7[_0x82bd('0x30')]['id'],'type':_0x82bd('0x6c')};_0x5a8e7f[_0x1da93f+_0x82bd('0x6d')]=_0x546106['id'];_0x5a8e7f[_0x1da93f+_0x82bd('0x6e')]=_0x546106[_0x82bd('0x6a')]['id'];_0x5a8e7f[_0x82bd('0x6f')+_0x1da93f+_0x43d8a2+'Id']=_0x546106['Account']['id'];_0x5a8e7f['To'+_0x1da93f+_0x82bd('0x70')]=_0x35d111['id'];return db[_0x1da93f+_0x82bd('0x71')][_0x82bd('0x72')](_0x5a8e7f);})[_0x82bd('0x15')](function(){return respondWithRpcPromise(_0x82bd('0x73'),{'channel':_0x437463,'interaction':_0x546106[_0x82bd('0x6a')],'message':_0x546106,'account':_0x546106[_0x82bd('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x82bd('0x6c'),'appdata':_0x35d111[_0x82bd('0xf')]+','+(_0x546106[_0x82bd('0x6b')][_0x82bd('0x74')]||0x12c),'interval':_0x82bd('0x75')}]},routingClient);})[_0x82bd('0x15')](respondWithResult(_0x4b5bf4,null))['catch'](handleError(_0x4b5bf4,null));};};exports[_0x82bd('0x76')]=function(_0x3d14c7,_0x57c71c){var _0x588d7f,_0x5ca4b5;if(_['isNil'](_0x3d14c7[_0x82bd('0x2e')][_0x82bd('0x77')])){throw new Error(_0x82bd('0x78'));}var _0x2eda47=_0x3d14c7[_0x82bd('0x2e')][_0x82bd('0x77')];var _0x17f2aa=_[_0x82bd('0x79')](_0x2eda47);var _0x534fee=_0x2eda47===_0x82bd('0x64')?'Website':_0x82bd('0x6b');return db[_0x82bd('0x7a')][_0x82bd('0x67')]({'raw':!![],'where':{'id':_0x3d14c7[_0x82bd('0x1b')]['id'],'role':'agent'}})[_0x82bd('0x15')](function(_0x2c92d8){if(_[_0x82bd('0x11')](_0x2c92d8)){throw new Error(_0x82bd('0x7b'));}_0x588d7f=_0x2c92d8;return db[_0x17f2aa+'Message'][_0x82bd('0x67')]({'where':{'id':_0x3d14c7[_0x82bd('0x2e')]['messageId']},'include':[{'model':db[_0x17f2aa+'Interaction'],'as':'Interaction'},{'model':db[_0x17f2aa+_0x534fee],'as':_0x82bd('0x6b')}]});})[_0x82bd('0x15')](function(_0x291587){if(_[_0x82bd('0x11')](_0x291587)){throw new Error(_0x17f2aa+_0x82bd('0x7c'));}_0x5ca4b5=_0x291587;return _0x291587[_0x82bd('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x82bd('0x15')](function(){var _0x8f45e2={'uniqueid':_0x2eda47+'.'+_0x5ca4b5['id']+'.'+_0x5ca4b5[_0x82bd('0x6a')]['id'],'FromUserId':_0x3d14c7[_0x82bd('0x30')]['id'],'type':_0x82bd('0x6c'),'ToUserId':_0x588d7f['id']};_0x8f45e2[_0x17f2aa+_0x82bd('0x6d')]=_0x5ca4b5['id'];_0x8f45e2[_0x17f2aa+_0x82bd('0x6e')]=_0x5ca4b5[_0x82bd('0x6a')]['id'];_0x8f45e2[_0x82bd('0x6f')+_0x17f2aa+_0x534fee+'Id']=_0x5ca4b5[_0x82bd('0x6b')]['id'];return db[_0x17f2aa+_0x82bd('0x71')][_0x82bd('0x72')](_0x8f45e2);})[_0x82bd('0x15')](function(){return respondWithRpcPromise(_0x82bd('0x73'),{'channel':_0x2eda47,'interaction':_0x5ca4b5[_0x82bd('0x6a')],'message':_0x5ca4b5,'account':_0x5ca4b5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x588d7f[_0x82bd('0xf')]+','+(_0x5ca4b5[_0x82bd('0x6b')][_0x82bd('0x7e')]||0x12c),'interval':_0x82bd('0x75')}]},routingClient);})['then'](respondWithResult(_0x57c71c,null))['catch'](handleError(_0x57c71c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b3f0022..5af92cf 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 _0x9736=['destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','run','post','create','put','update'];(function(_0x17f145,_0x3422bb){var _0x2d5420=function(_0x3eb38b){while(--_0x3eb38b){_0x17f145['push'](_0x17f145['shift']());}};_0x2d5420(++_0x3422bb);}(_0x9736,0xef));var _0x6973=function(_0x33993e,_0xd4ae85){_0x33993e=_0x33993e-0x0;var _0x1c3281=_0x9736[_0x33993e];return _0x1c3281;};'use strict';var multer=require('multer');var util=require(_0x6973('0x0'));var path=require('path');var timeout=require(_0x6973('0x1'));var express=require(_0x6973('0x2'));var router=express[_0x6973('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6973('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6973('0x5'));var controller=require(_0x6973('0x6'));router[_0x6973('0x7')]('/',auth[_0x6973('0x8')](),controller['index']);router[_0x6973('0x7')](_0x6973('0x9'),auth['isAuthenticated'](),controller[_0x6973('0xa')]);router['get']('/:id/run',auth[_0x6973('0x8')](),controller[_0x6973('0xb')]);router[_0x6973('0xc')]('/',auth[_0x6973('0x8')](),controller[_0x6973('0xd')]);router[_0x6973('0xe')](_0x6973('0x9'),auth[_0x6973('0x8')](),controller[_0x6973('0xf')]);router['delete']('/:id',auth[_0x6973('0x8')](),controller[_0x6973('0x10')]);module['exports']=router; \ No newline at end of file +var _0xccc0=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x590f5e,_0x5f4080){var _0x517fd6=function(_0x555ab6){while(--_0x555ab6){_0x590f5e['push'](_0x590f5e['shift']());}};_0x517fd6(++_0x5f4080);}(_0xccc0,0x1f3));var _0x0ccc=function(_0x7b192c,_0x2ccb96){_0x7b192c=_0x7b192c-0x0;var _0xbb2dc0=_0xccc0[_0x7b192c];return _0xbb2dc0;};'use strict';var multer=require(_0x0ccc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0ccc('0x1'));var express=require(_0x0ccc('0x2'));var router=express[_0x0ccc('0x3')]();var fs_extra=require(_0x0ccc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0ccc('0x5'));var controller=require('./schedule.controller');router[_0x0ccc('0x6')]('/',auth[_0x0ccc('0x7')](),controller[_0x0ccc('0x8')]);router['get'](_0x0ccc('0x9'),auth[_0x0ccc('0x7')](),controller[_0x0ccc('0xa')]);router[_0x0ccc('0x6')](_0x0ccc('0xb'),auth['isAuthenticated'](),controller[_0x0ccc('0xc')]);router[_0x0ccc('0xd')]('/',auth[_0x0ccc('0x7')](),controller[_0x0ccc('0xe')]);router['put'](_0x0ccc('0x9'),auth[_0x0ccc('0x7')](),controller['update']);router[_0x0ccc('0xf')](_0x0ccc('0x9'),auth[_0x0ccc('0x7')](),controller[_0x0ccc('0x10')]);module[_0x0ccc('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 92d69e0..bdca87f 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 _0x1148=['STRING','BOOLEAN','DATE','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','exports'];(function(_0xfa3fe6,_0x1dc469){var _0x16a55e=function(_0xcd7029){while(--_0xcd7029){_0xfa3fe6['push'](_0xfa3fe6['shift']());}};_0x16a55e(++_0x1dc469);}(_0x1148,0x6b));var _0x8114=function(_0x23cb53,_0x1266ae){_0x23cb53=_0x23cb53-0x0;var _0x40d706=_0x1148[_0x23cb53];return _0x40d706;};'use strict';var Sequelize=require('sequelize');module[_0x8114('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8114('0x1')]},'active':{'type':Sequelize[_0x8114('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8114('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x8114('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8114('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8114('0x4')](_0x8114('0x5'),_0x8114('0x6'),_0x8114('0x7'),_0x8114('0x8'),_0x8114('0x9'),_0x8114('0xa'),_0x8114('0xb')),'allowNull':![],'defaultValue':_0x8114('0x9')},'output':{'type':Sequelize[_0x8114('0x4')](_0x8114('0xc'),_0x8114('0xd'),_0x8114('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x8114('0x4')](_0x8114('0xf'),_0x8114('0x10')),'allowNull':![],'defaultValue':_0x8114('0xf')},'sendMail':{'type':Sequelize[_0x8114('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x8114('0x1')]},'cc':{'type':Sequelize[_0x8114('0x11')]},'bcc':{'type':Sequelize[_0x8114('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x77dd=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','weeks','days','hours','minutes','pdf','xlsx','csv','custom','TEXT','sequelize','exports','STRING'];(function(_0x474648,_0x14643f){var _0x1c0d19=function(_0x3bfbc9){while(--_0x3bfbc9){_0x474648['push'](_0x474648['shift']());}};_0x1c0d19(++_0x14643f);}(_0x77dd,0xce));var _0xd77d=function(_0x1e9d62,_0x25bb8e){_0x1e9d62=_0x1e9d62-0x0;var _0x56c490=_0x77dd[_0x1e9d62];return _0x56c490;};'use strict';var Sequelize=require(_0xd77d('0x0'));module[_0xd77d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd77d('0x2')]},'active':{'type':Sequelize[_0xd77d('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd77d('0x4')},'startAt':{'type':Sequelize[_0xd77d('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd77d('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd77d('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd77d('0x7')](_0xd77d('0x8'),'quarters',_0xd77d('0x9'),_0xd77d('0xa'),_0xd77d('0xb'),_0xd77d('0xc'),_0xd77d('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xd77d('0x7')]('csv',_0xd77d('0xe'),_0xd77d('0xf')),'allowNull':![],'defaultValue':_0xd77d('0x10')},'type':{'type':Sequelize[_0xd77d('0x7')](_0xd77d('0x11'),'default'),'allowNull':![],'defaultValue':_0xd77d('0x11')},'sendMail':{'type':Sequelize[_0xd77d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd77d('0x2')]},'cc':{'type':Sequelize[_0xd77d('0x12')]},'bcc':{'type':Sequelize[_0xd77d('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xd77d('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 901ed07..369d31d 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 _0xe397=['bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Schedule','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','request-promise'];(function(_0x68b935,_0x585c62){var _0x3c2b13=function(_0x214d39){while(--_0x214d39){_0x68b935['push'](_0x68b935['shift']());}};_0x3c2b13(++_0x585c62);}(_0xe397,0xf3));var _0x7e39=function(_0x3eabbd,_0x60102f){_0x3eabbd=_0x3eabbd-0x0;var _0x16ccac=_0xe397[_0x3eabbd];return _0x16ccac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e39('0x0'));var zipdir=require(_0x7e39('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e39('0x2'));var moment=require('moment');var BPromise=require(_0x7e39('0x3'));var Mustache=require('mustache');var util=require(_0x7e39('0x4'));var path=require(_0x7e39('0x5'));var sox=require(_0x7e39('0x6'));var csv=require(_0x7e39('0x7'));var ejs=require(_0x7e39('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e39('0x9'));var squel=require(_0x7e39('0xa'));var crypto=require(_0x7e39('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e39('0x7'));var querystring=require(_0x7e39('0xc'));var Papa=require(_0x7e39('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e39('0xe'));var as=require(_0x7e39('0xf'));var hardwareService=require(_0x7e39('0x10'));var logger=require(_0x7e39('0x11'))(_0x7e39('0x12'));var utils=require(_0x7e39('0x13'));var config=require(_0x7e39('0x14'));var licenseUtil=require(_0x7e39('0x15'));var db=require(_0x7e39('0x16'))['db'];function respondWithStatusCode(_0x13cb2e,_0x3d0181){_0x3d0181=_0x3d0181||0xcc;return function(_0x3ae062){if(_0x3ae062){return _0x13cb2e[_0x7e39('0x17')](_0x3d0181);}return _0x13cb2e[_0x7e39('0x18')](_0x3d0181)[_0x7e39('0x19')]();};}function respondWithResult(_0xdfd666,_0x31190){_0x31190=_0x31190||0xc8;return function(_0x296454){if(_0x296454){return _0xdfd666[_0x7e39('0x18')](_0x31190)[_0x7e39('0x1a')](_0x296454);}};}function respondWithFilteredResult(_0x3ba20d,_0x49772a){return function(_0x5017ff){if(_0x5017ff){var _0x1816a1=typeof _0x49772a['offset']==='undefined'&&typeof _0x49772a[_0x7e39('0x1b')]===_0x7e39('0x1c');var _0x4bde3d=_0x5017ff[_0x7e39('0x1d')];var _0x2633a1=_0x1816a1?0x0:_0x49772a[_0x7e39('0x1e')];var _0x135545=_0x1816a1?_0x5017ff[_0x7e39('0x1d')]:_0x49772a['offset']+_0x49772a['limit'];var _0x1cca45;if(_0x135545>=_0x4bde3d){_0x135545=_0x4bde3d;_0x1cca45=0xc8;}else{_0x1cca45=0xce;}_0x3ba20d[_0x7e39('0x18')](_0x1cca45);return _0x3ba20d[_0x7e39('0x1f')](_0x7e39('0x20'),_0x2633a1+'-'+_0x135545+'/'+_0x4bde3d)[_0x7e39('0x1a')](_0x5017ff);}return null;};}function patchUpdates(_0x378d1b){return function(_0xe40331){try{jsonpatch['apply'](_0xe40331,_0x378d1b,!![]);}catch(_0x364619){return BPromise[_0x7e39('0x21')](_0x364619);}return _0xe40331[_0x7e39('0x22')]();};}function saveUpdates(_0xfdb241,_0x283760){return function(_0x23dd93){if(_0x23dd93){return _0x23dd93[_0x7e39('0x23')](_0xfdb241)['then'](function(_0x5d33a2){return _0x5d33a2;});}return null;};}function removeEntity(_0x31491,_0x1d1918){return function(_0xa255cf){if(_0xa255cf){return _0xa255cf['destroy']()[_0x7e39('0x24')](function(){var _0x8180c4=_0xa255cf[_0x7e39('0x25')]({'plain':!![]});var _0x132562='Scheduler';return db['UserProfileResource'][_0x7e39('0x26')]({'where':{'type':_0x132562,'resourceId':_0x8180c4['id']}})['then'](function(){return _0xa255cf;});})['then'](function(){_0x31491[_0x7e39('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d703f,_0x3123a2){return function(_0x38a24a){if(!_0x38a24a){_0x3d703f['sendStatus'](0x194);}return _0x38a24a;};}function handleError(_0x1a32ea,_0x288f74){_0x288f74=_0x288f74||0x1f4;return function(_0x18b505){logger[_0x7e39('0x27')](_0x18b505[_0x7e39('0x28')]);if(_0x18b505['name']){delete _0x18b505[_0x7e39('0x29')];}_0x1a32ea[_0x7e39('0x18')](_0x288f74)[_0x7e39('0x2a')](_0x18b505);};}exports['index']=function(_0xe0793d,_0x2d29f2){var _0x5a98e9={},_0x43c704={},_0x32982f={'count':0x0,'rows':[]};var _0x93b852=_[_0x7e39('0x2b')](db['Schedule']['rawAttributes'],function(_0x4f6f88){return{'name':_0x4f6f88[_0x7e39('0x2c')],'type':_0x4f6f88[_0x7e39('0x2d')][_0x7e39('0x2e')]};});_0x43c704[_0x7e39('0x2f')]=_[_0x7e39('0x2b')](_0x93b852,_0x7e39('0x29'));_0x43c704[_0x7e39('0x30')]=_[_0x7e39('0x31')](_0xe0793d[_0x7e39('0x30')]);_0x43c704[_0x7e39('0x32')]=_[_0x7e39('0x33')](_0x43c704[_0x7e39('0x2f')],_0x43c704[_0x7e39('0x30')]);_0x5a98e9[_0x7e39('0x34')]=_[_0x7e39('0x33')](_0x43c704[_0x7e39('0x2f')],qs[_0x7e39('0x35')](_0xe0793d['query'][_0x7e39('0x35')]));_0x5a98e9[_0x7e39('0x34')]=_0x5a98e9['attributes']['length']?_0x5a98e9[_0x7e39('0x34')]:_0x43c704[_0x7e39('0x2f')];if(!_0xe0793d[_0x7e39('0x30')][_0x7e39('0x36')]('nolimit')){_0x5a98e9[_0x7e39('0x1b')]=qs[_0x7e39('0x1b')](_0xe0793d[_0x7e39('0x30')][_0x7e39('0x1b')]);_0x5a98e9[_0x7e39('0x1e')]=qs[_0x7e39('0x1e')](_0xe0793d[_0x7e39('0x30')][_0x7e39('0x1e')]);}_0x5a98e9[_0x7e39('0x37')]=qs[_0x7e39('0x38')](_0xe0793d['query'][_0x7e39('0x38')]);_0x5a98e9[_0x7e39('0x39')]=qs['filters'](_['pick'](_0xe0793d[_0x7e39('0x30')],_0x43c704[_0x7e39('0x32')]),_0x93b852);if(_0xe0793d[_0x7e39('0x30')][_0x7e39('0x3a')]){_0x5a98e9[_0x7e39('0x39')]=_[_0x7e39('0x3b')](_0x5a98e9[_0x7e39('0x39')],{'$or':_[_0x7e39('0x2b')](_0x93b852,function(_0x4e07c2){if(_0x4e07c2[_0x7e39('0x2d')]!==_0x7e39('0x3c')){var _0x3d6dea={};_0x3d6dea[_0x4e07c2['name']]={'$like':'%'+_0xe0793d['query'][_0x7e39('0x3a')]+'%'};return _0x3d6dea;}})});}_0x5a98e9=_[_0x7e39('0x3b')]({},_0x5a98e9,_0xe0793d[_0x7e39('0x3d')]);var _0x5a3454={'where':_0x5a98e9[_0x7e39('0x39')]};return db['Schedule'][_0x7e39('0x1d')](_0x5a3454)[_0x7e39('0x24')](function(_0x3183c1){_0x32982f['count']=_0x3183c1;if(_0xe0793d[_0x7e39('0x30')][_0x7e39('0x3e')]){_0x5a98e9[_0x7e39('0x3f')]=[{'all':!![]}];}return db[_0x7e39('0x40')][_0x7e39('0x41')](_0x5a98e9);})[_0x7e39('0x24')](function(_0x426023){_0x32982f['rows']=_0x426023;return _0x32982f;})['then'](respondWithFilteredResult(_0x2d29f2,_0x5a98e9))[_0x7e39('0x42')](handleError(_0x2d29f2,null));};exports[_0x7e39('0x43')]=function(_0xc7ec62,_0x2c3343){var _0x36a312={'raw':![],'where':{'id':_0xc7ec62[_0x7e39('0x44')]['id']}},_0x5204e8={};_0x5204e8[_0x7e39('0x2f')]=_['keys'](db[_0x7e39('0x40')]['rawAttributes']);_0x5204e8['query']=_[_0x7e39('0x31')](_0xc7ec62[_0x7e39('0x30')]);_0x5204e8[_0x7e39('0x32')]=_[_0x7e39('0x33')](_0x5204e8[_0x7e39('0x2f')],_0x5204e8[_0x7e39('0x30')]);_0x36a312['attributes']=_[_0x7e39('0x33')](_0x5204e8[_0x7e39('0x2f')],qs[_0x7e39('0x35')](_0xc7ec62[_0x7e39('0x30')]['fields']));_0x36a312[_0x7e39('0x34')]=_0x36a312[_0x7e39('0x34')]['length']?_0x36a312[_0x7e39('0x34')]:_0x5204e8[_0x7e39('0x2f')];if(_0xc7ec62['query']['includeAll']){_0x36a312[_0x7e39('0x3f')]=[{'all':!![]}];}_0x36a312=_['merge']({},_0x36a312,_0xc7ec62[_0x7e39('0x3d')]);return db['Schedule'][_0x7e39('0x45')](_0x36a312)[_0x7e39('0x24')](handleEntityNotFound(_0x2c3343,null))[_0x7e39('0x24')](respondWithResult(_0x2c3343,null))[_0x7e39('0x42')](handleError(_0x2c3343,null));};exports[_0x7e39('0x46')]=function(_0x70d2f8,_0x1c77e9){return db['Schedule'][_0x7e39('0x46')](_0x70d2f8[_0x7e39('0x47')],{})['then'](function(_0x49238b){var _0x56cd16=_0x70d2f8[_0x7e39('0x48')][_0x7e39('0x25')]({'plain':!![]});if(!_0x56cd16)throw new Error(_0x7e39('0x49'));if(_0x56cd16[_0x7e39('0x4a')]===_0x7e39('0x48')){var _0x40adf5=_0x49238b['get']({'plain':!![]});var _0x582939='Scheduler';return db[_0x7e39('0x4b')][_0x7e39('0x45')]({'where':{'name':_0x582939,'userProfileId':_0x56cd16[_0x7e39('0x4c')]},'raw':!![]})[_0x7e39('0x24')](function(_0x3a59df){if(_0x3a59df&&_0x3a59df[_0x7e39('0x4d')]===0x0){return db[_0x7e39('0x4e')]['create']({'name':_0x40adf5[_0x7e39('0x29')],'resourceId':_0x40adf5['id'],'type':_0x3a59df[_0x7e39('0x29')],'sectionId':_0x3a59df['id']},{})['then'](function(){return _0x49238b;});}else{return _0x49238b;}})[_0x7e39('0x42')](function(_0x127172){logger[_0x7e39('0x27')](_0x7e39('0x4f'),_0x127172);throw _0x127172;});}return _0x49238b;})[_0x7e39('0x24')](respondWithResult(_0x1c77e9,0xc9))[_0x7e39('0x42')](handleError(_0x1c77e9,null));};exports[_0x7e39('0x23')]=function(_0x4befbe,_0x5ba008){if(_0x4befbe['body']['id']){delete _0x4befbe[_0x7e39('0x47')]['id'];}return db['Schedule'][_0x7e39('0x45')]({'where':{'id':_0x4befbe['params']['id']}})['then'](handleEntityNotFound(_0x5ba008,null))[_0x7e39('0x24')](saveUpdates(_0x4befbe['body'],null))[_0x7e39('0x24')](respondWithResult(_0x5ba008,null))[_0x7e39('0x42')](handleError(_0x5ba008,null));};exports[_0x7e39('0x26')]=function(_0x2b0641,_0x44ad1b){return db[_0x7e39('0x40')][_0x7e39('0x45')]({'where':{'id':_0x2b0641[_0x7e39('0x44')]['id']}})['then'](handleEntityNotFound(_0x44ad1b,null))[_0x7e39('0x24')](removeEntity(_0x44ad1b,null))[_0x7e39('0x42')](handleError(_0x44ad1b,null));};exports[_0x7e39('0x50')]=function(_0x5973be,_0x2a6d0e,_0x126471){var _0x1604ac=require(_0x7e39('0x51'));return db['Schedule'][_0x7e39('0x45')]({'where':{'id':_0x5973be[_0x7e39('0x44')]['id']},'raw':!![]})[_0x7e39('0x24')](handleEntityNotFound(_0x2a6d0e,null))[_0x7e39('0x24')](function(){_0x1604ac['run'](_0x5973be[_0x7e39('0x44')]['id']);})[_0x7e39('0x24')](respondWithStatusCode(_0x2a6d0e,null))[_0x7e39('0x42')](handleError(_0x2a6d0e,null));}; \ No newline at end of file +var _0x1bf0=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','get','Scheduler','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x3596e7,_0x976f09){var _0x46fa54=function(_0x55d7e2){while(--_0x55d7e2){_0x3596e7['push'](_0x3596e7['shift']());}};_0x46fa54(++_0x976f09);}(_0x1bf0,0x9a));var _0x01bf=function(_0x1580d3,_0x214bba){_0x1580d3=_0x1580d3-0x0;var _0x25d78b=_0x1bf0[_0x1580d3];return _0x25d78b;};'use strict';var emlformat=require(_0x01bf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x01bf('0x1'));var rp=require('request-promise');var moment=require(_0x01bf('0x2'));var BPromise=require(_0x01bf('0x3'));var Mustache=require(_0x01bf('0x4'));var util=require(_0x01bf('0x5'));var path=require(_0x01bf('0x6'));var sox=require(_0x01bf('0x7'));var csv=require(_0x01bf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01bf('0x9'));var _=require(_0x01bf('0xa'));var squel=require(_0x01bf('0xb'));var crypto=require(_0x01bf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x01bf('0xd'));var toCsv=require(_0x01bf('0x8'));var querystring=require(_0x01bf('0xe'));var Papa=require(_0x01bf('0xf'));var Redis=require('ioredis');var authService=require(_0x01bf('0x10'));var qs=require(_0x01bf('0x11'));var as=require(_0x01bf('0x12'));var hardwareService=require(_0x01bf('0x13'));var logger=require('../../config/logger')(_0x01bf('0x14'));var utils=require(_0x01bf('0x15'));var config=require(_0x01bf('0x16'));var licenseUtil=require(_0x01bf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29f645,_0x455ad5){_0x455ad5=_0x455ad5||0xcc;return function(_0x4190e4){if(_0x4190e4){return _0x29f645['sendStatus'](_0x455ad5);}return _0x29f645['status'](_0x455ad5)[_0x01bf('0x18')]();};}function respondWithResult(_0x17d414,_0xe26762){_0xe26762=_0xe26762||0xc8;return function(_0x3a2dd9){if(_0x3a2dd9){return _0x17d414[_0x01bf('0x19')](_0xe26762)[_0x01bf('0x1a')](_0x3a2dd9);}};}function respondWithFilteredResult(_0x979a6,_0x1ca6ba){return function(_0x477079){if(_0x477079){var _0x18b602=typeof _0x1ca6ba[_0x01bf('0x1b')]==='undefined'&&typeof _0x1ca6ba[_0x01bf('0x1c')]===_0x01bf('0x1d');var _0x21d621=_0x477079[_0x01bf('0x1e')];var _0x5da70b=_0x18b602?0x0:_0x1ca6ba['offset'];var _0x403acc=_0x18b602?_0x477079[_0x01bf('0x1e')]:_0x1ca6ba[_0x01bf('0x1b')]+_0x1ca6ba[_0x01bf('0x1c')];var _0x1f3b0e;if(_0x403acc>=_0x21d621){_0x403acc=_0x21d621;_0x1f3b0e=0xc8;}else{_0x1f3b0e=0xce;}_0x979a6[_0x01bf('0x19')](_0x1f3b0e);return _0x979a6[_0x01bf('0x1f')]('Content-Range',_0x5da70b+'-'+_0x403acc+'/'+_0x21d621)[_0x01bf('0x1a')](_0x477079);}return null;};}function patchUpdates(_0x4c53ba){return function(_0x414312){try{jsonpatch[_0x01bf('0x20')](_0x414312,_0x4c53ba,!![]);}catch(_0x352658){return BPromise[_0x01bf('0x21')](_0x352658);}return _0x414312[_0x01bf('0x22')]();};}function saveUpdates(_0x539d15,_0x463565){return function(_0x26c6dd){if(_0x26c6dd){return _0x26c6dd['update'](_0x539d15)[_0x01bf('0x23')](function(_0x1dc900){return _0x1dc900;});}return null;};}function removeEntity(_0x5ec328,_0x570e7c){return function(_0x5d27bd){if(_0x5d27bd){return _0x5d27bd[_0x01bf('0x24')]()['then'](function(){var _0x3716cd=_0x5d27bd[_0x01bf('0x25')]({'plain':!![]});var _0x2968a6=_0x01bf('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2968a6,'resourceId':_0x3716cd['id']}})[_0x01bf('0x23')](function(){return _0x5d27bd;});})[_0x01bf('0x23')](function(){_0x5ec328[_0x01bf('0x19')](0xcc)[_0x01bf('0x18')]();});}};}function handleEntityNotFound(_0x158df8,_0x10c608){return function(_0x126f26){if(!_0x126f26){_0x158df8[_0x01bf('0x27')](0x194);}return _0x126f26;};}function handleError(_0x5049e1,_0x5c2b39){_0x5c2b39=_0x5c2b39||0x1f4;return function(_0x23a092){logger[_0x01bf('0x28')](_0x23a092[_0x01bf('0x29')]);if(_0x23a092[_0x01bf('0x2a')]){delete _0x23a092[_0x01bf('0x2a')];}_0x5049e1[_0x01bf('0x19')](_0x5c2b39)[_0x01bf('0x2b')](_0x23a092);};}exports[_0x01bf('0x2c')]=function(_0xe0f2d0,_0x44c3ba){var _0xbf2d2={},_0x3ef25a={},_0x2822dd={'count':0x0,'rows':[]};var _0x4dbef4=_[_0x01bf('0x2d')](db[_0x01bf('0x2e')][_0x01bf('0x2f')],function(_0x127974){return{'name':_0x127974[_0x01bf('0x30')],'type':_0x127974[_0x01bf('0x31')]['key']};});_0x3ef25a[_0x01bf('0x32')]=_[_0x01bf('0x2d')](_0x4dbef4,'name');_0x3ef25a[_0x01bf('0x33')]=_[_0x01bf('0x34')](_0xe0f2d0['query']);_0x3ef25a['filters']=_[_0x01bf('0x35')](_0x3ef25a[_0x01bf('0x32')],_0x3ef25a[_0x01bf('0x33')]);_0xbf2d2[_0x01bf('0x36')]=_[_0x01bf('0x35')](_0x3ef25a[_0x01bf('0x32')],qs[_0x01bf('0x37')](_0xe0f2d0[_0x01bf('0x33')][_0x01bf('0x37')]));_0xbf2d2[_0x01bf('0x36')]=_0xbf2d2[_0x01bf('0x36')]['length']?_0xbf2d2[_0x01bf('0x36')]:_0x3ef25a[_0x01bf('0x32')];if(!_0xe0f2d0[_0x01bf('0x33')][_0x01bf('0x38')](_0x01bf('0x39'))){_0xbf2d2['limit']=qs[_0x01bf('0x1c')](_0xe0f2d0['query']['limit']);_0xbf2d2[_0x01bf('0x1b')]=qs[_0x01bf('0x1b')](_0xe0f2d0[_0x01bf('0x33')][_0x01bf('0x1b')]);}_0xbf2d2[_0x01bf('0x3a')]=qs[_0x01bf('0x3b')](_0xe0f2d0[_0x01bf('0x33')]['sort']);_0xbf2d2[_0x01bf('0x3c')]=qs[_0x01bf('0x3d')](_[_0x01bf('0x3e')](_0xe0f2d0[_0x01bf('0x33')],_0x3ef25a[_0x01bf('0x3d')]),_0x4dbef4);if(_0xe0f2d0[_0x01bf('0x33')][_0x01bf('0x3f')]){_0xbf2d2['where']=_[_0x01bf('0x40')](_0xbf2d2[_0x01bf('0x3c')],{'$or':_['map'](_0x4dbef4,function(_0x2cea07){if(_0x2cea07[_0x01bf('0x31')]!=='VIRTUAL'){var _0x545280={};_0x545280[_0x2cea07[_0x01bf('0x2a')]]={'$like':'%'+_0xe0f2d0[_0x01bf('0x33')][_0x01bf('0x3f')]+'%'};return _0x545280;}})});}_0xbf2d2=_[_0x01bf('0x40')]({},_0xbf2d2,_0xe0f2d0['options']);var _0xcab316={'where':_0xbf2d2[_0x01bf('0x3c')]};return db[_0x01bf('0x2e')]['count'](_0xcab316)['then'](function(_0x1de7b6){_0x2822dd[_0x01bf('0x1e')]=_0x1de7b6;if(_0xe0f2d0['query'][_0x01bf('0x41')]){_0xbf2d2[_0x01bf('0x42')]=[{'all':!![]}];}return db[_0x01bf('0x2e')]['findAll'](_0xbf2d2);})['then'](function(_0x118b9b){_0x2822dd[_0x01bf('0x43')]=_0x118b9b;return _0x2822dd;})[_0x01bf('0x23')](respondWithFilteredResult(_0x44c3ba,_0xbf2d2))['catch'](handleError(_0x44c3ba,null));};exports['show']=function(_0x518903,_0x258e2f){var _0x5a7f28={'raw':![],'where':{'id':_0x518903[_0x01bf('0x44')]['id']}},_0x2829e3={};_0x2829e3[_0x01bf('0x32')]=_[_0x01bf('0x34')](db[_0x01bf('0x2e')]['rawAttributes']);_0x2829e3[_0x01bf('0x33')]=_[_0x01bf('0x34')](_0x518903[_0x01bf('0x33')]);_0x2829e3['filters']=_[_0x01bf('0x35')](_0x2829e3[_0x01bf('0x32')],_0x2829e3[_0x01bf('0x33')]);_0x5a7f28['attributes']=_['intersection'](_0x2829e3[_0x01bf('0x32')],qs[_0x01bf('0x37')](_0x518903[_0x01bf('0x33')][_0x01bf('0x37')]));_0x5a7f28[_0x01bf('0x36')]=_0x5a7f28[_0x01bf('0x36')][_0x01bf('0x45')]?_0x5a7f28[_0x01bf('0x36')]:_0x2829e3[_0x01bf('0x32')];if(_0x518903[_0x01bf('0x33')][_0x01bf('0x41')]){_0x5a7f28[_0x01bf('0x42')]=[{'all':!![]}];}_0x5a7f28=_[_0x01bf('0x40')]({},_0x5a7f28,_0x518903[_0x01bf('0x46')]);return db[_0x01bf('0x2e')][_0x01bf('0x47')](_0x5a7f28)['then'](handleEntityNotFound(_0x258e2f,null))[_0x01bf('0x23')](respondWithResult(_0x258e2f,null))['catch'](handleError(_0x258e2f,null));};exports[_0x01bf('0x48')]=function(_0x5d36c2,_0x337e9e){return db[_0x01bf('0x2e')][_0x01bf('0x48')](_0x5d36c2[_0x01bf('0x49')],{})['then'](function(_0x180510){var _0x5a70c1=_0x5d36c2[_0x01bf('0x4a')][_0x01bf('0x25')]({'plain':!![]});if(!_0x5a70c1)throw new Error(_0x01bf('0x4b'));if(_0x5a70c1[_0x01bf('0x4c')]===_0x01bf('0x4a')){var _0x8b35e6=_0x180510[_0x01bf('0x25')]({'plain':!![]});var _0x53405b=_0x01bf('0x26');return db[_0x01bf('0x4d')][_0x01bf('0x47')]({'where':{'name':_0x53405b,'userProfileId':_0x5a70c1['userProfileId']},'raw':!![]})[_0x01bf('0x23')](function(_0x3fb65f){if(_0x3fb65f&&_0x3fb65f['autoAssociation']===0x0){return db[_0x01bf('0x4e')]['create']({'name':_0x8b35e6['name'],'resourceId':_0x8b35e6['id'],'type':_0x3fb65f[_0x01bf('0x2a')],'sectionId':_0x3fb65f['id']},{})['then'](function(){return _0x180510;});}else{return _0x180510;}})[_0x01bf('0x4f')](function(_0x46f753){logger[_0x01bf('0x28')](_0x01bf('0x50'),_0x46f753);throw _0x46f753;});}return _0x180510;})['then'](respondWithResult(_0x337e9e,0xc9))['catch'](handleError(_0x337e9e,null));};exports[_0x01bf('0x51')]=function(_0x435c07,_0x32c8f3){if(_0x435c07[_0x01bf('0x49')]['id']){delete _0x435c07[_0x01bf('0x49')]['id'];}return db[_0x01bf('0x2e')][_0x01bf('0x47')]({'where':{'id':_0x435c07[_0x01bf('0x44')]['id']}})[_0x01bf('0x23')](handleEntityNotFound(_0x32c8f3,null))[_0x01bf('0x23')](saveUpdates(_0x435c07[_0x01bf('0x49')],null))['then'](respondWithResult(_0x32c8f3,null))[_0x01bf('0x4f')](handleError(_0x32c8f3,null));};exports[_0x01bf('0x24')]=function(_0x418a3c,_0x5b73ed){return db[_0x01bf('0x2e')][_0x01bf('0x47')]({'where':{'id':_0x418a3c[_0x01bf('0x44')]['id']}})[_0x01bf('0x23')](handleEntityNotFound(_0x5b73ed,null))['then'](removeEntity(_0x5b73ed,null))[_0x01bf('0x4f')](handleError(_0x5b73ed,null));};exports[_0x01bf('0x52')]=function(_0x3523f1,_0x18ae7b,_0x3e31e2){var _0x2972d1=require(_0x01bf('0x53'));return db[_0x01bf('0x2e')][_0x01bf('0x47')]({'where':{'id':_0x3523f1['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x18ae7b,null))[_0x01bf('0x23')](function(){_0x2972d1[_0x01bf('0x52')](_0x3523f1[_0x01bf('0x44')]['id']);})['then'](respondWithStatusCode(_0x18ae7b,null))[_0x01bf('0x4f')](handleError(_0x18ae7b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index cb04518..9054268 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 _0x9935=['../../config/environment','exports','define','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x47edc4,_0x550a5d){var _0x159758=function(_0x993c8a){while(--_0x993c8a){_0x47edc4['push'](_0x47edc4['shift']());}};_0x159758(++_0x550a5d);}(_0x9935,0x1cf));var _0x5993=function(_0x5c4620,_0x51e5c0){_0x5c4620=_0x5c4620-0x0;var _0x52722b=_0x9935[_0x5c4620];return _0x52722b;};'use strict';var _=require(_0x5993('0x0'));var util=require(_0x5993('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5993('0x2'));var BPromise=require(_0x5993('0x3'));var rp=require(_0x5993('0x4'));var fs=require('fs');var path=require(_0x5993('0x5'));var rimraf=require(_0x5993('0x6'));var config=require(_0x5993('0x7'));var attributes=require('./schedule.attributes');module[_0x5993('0x8')]=function(_0x5d6c9b,_0x57bd56){return _0x5d6c9b[_0x5993('0x9')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15f1=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Schedule','lodash','util'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x15f1,0x111));var _0x115f=function(_0x2d5280,_0x6b6ba8){_0x2d5280=_0x2d5280-0x0;var _0x1d5bc9=_0x15f1[_0x2d5280];return _0x1d5bc9;};'use strict';var _=require(_0x115f('0x0'));var util=require(_0x115f('0x1'));var logger=require('../../config/logger')(_0x115f('0x2'));var moment=require(_0x115f('0x3'));var BPromise=require(_0x115f('0x4'));var rp=require(_0x115f('0x5'));var fs=require('fs');var path=require(_0x115f('0x6'));var rimraf=require('rimraf');var config=require(_0x115f('0x7'));var attributes=require('./schedule.attributes');module[_0x115f('0x8')]=function(_0x4356f6,_0x836958){return _0x4356f6[_0x115f('0x9')](_0x115f('0xa'),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 a3f8fe2..55ab157 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 _0xfc73=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error'];(function(_0x3893ad,_0x3b3a57){var _0x411ac2=function(_0x2dcea6){while(--_0x2dcea6){_0x3893ad['push'](_0x3893ad['shift']());}};_0x411ac2(++_0x3b3a57);}(_0xfc73,0x145));var _0x3fc7=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xfc73[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require(_0x3fc7('0x0'));var moment=require('moment');var BPromise=require(_0x3fc7('0x1'));var rs=require(_0x3fc7('0x2'));var fs=require('fs');var Redis=require(_0x3fc7('0x3'));var db=require(_0x3fc7('0x4'))['db'];var utils=require(_0x3fc7('0x5'));var logger=require(_0x3fc7('0x6'))(_0x3fc7('0x7'));var config=require('../../config/environment');var jayson=require(_0x3fc7('0x8'));var client=jayson[_0x3fc7('0x9')][_0x3fc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x94ddb6,_0x55055f,_0x3a8690){return new BPromise(function(_0x912d96,_0x32f636){return client['request'](_0x94ddb6,_0x3a8690)['then'](function(_0x121a7d){logger[_0x3fc7('0xb')](_0x3fc7('0xc'),_0x55055f,_0x3fc7('0xd'));logger[_0x3fc7('0xe')](_0x3fc7('0xf'),_0x55055f,'request\x20sent',JSON['stringify'](_0x121a7d));if(_0x121a7d[_0x3fc7('0x10')]){if(_0x121a7d['error']['code']===0x1f4){logger[_0x3fc7('0x10')](_0x3fc7('0xc'),_0x55055f,_0x121a7d['error'][_0x3fc7('0x11')]);return _0x32f636(_0x121a7d['error'][_0x3fc7('0x11')]);}logger[_0x3fc7('0x10')](_0x3fc7('0xc'),_0x55055f,_0x121a7d[_0x3fc7('0x10')][_0x3fc7('0x11')]);return _0x912d96(_0x121a7d['error'][_0x3fc7('0x11')]);}else{logger[_0x3fc7('0xb')](_0x3fc7('0xc'),_0x55055f,'request\x20sent');_0x912d96(_0x121a7d['result'][_0x3fc7('0x11')]);}})[_0x3fc7('0x12')](function(_0x3e8d2a){logger[_0x3fc7('0x10')]('Schedule,\x20%s,\x20%s',_0x55055f,_0x3e8d2a);_0x32f636(_0x3e8d2a);});});} \ No newline at end of file +var _0xf254=['then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf254,0x1c2));var _0x4f25=function(_0x1ccb95,_0x1b3be8){_0x1ccb95=_0x1ccb95-0x0;var _0x1a9725=_0xf254[_0x1ccb95];return _0x1a9725;};'use strict';var _=require(_0x4f25('0x0'));var util=require('util');var moment=require(_0x4f25('0x1'));var BPromise=require(_0x4f25('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f25('0x3'));var db=require(_0x4f25('0x4'))['db'];var utils=require(_0x4f25('0x5'));var logger=require(_0x4f25('0x6'))(_0x4f25('0x7'));var config=require(_0x4f25('0x8'));var jayson=require(_0x4f25('0x9'));var client=jayson['client'][_0x4f25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1828ea,_0x534db9,_0x156696){return new BPromise(function(_0x47c797,_0x2ff989){return client[_0x4f25('0xb')](_0x1828ea,_0x156696)[_0x4f25('0xc')](function(_0x5e11c4){logger[_0x4f25('0xd')](_0x4f25('0xe'),_0x534db9,'request\x20sent');logger[_0x4f25('0xf')](_0x4f25('0x10'),_0x534db9,'request\x20sent',JSON[_0x4f25('0x11')](_0x5e11c4));if(_0x5e11c4[_0x4f25('0x12')]){if(_0x5e11c4[_0x4f25('0x12')]['code']===0x1f4){logger[_0x4f25('0x12')]('Schedule,\x20%s,\x20%s',_0x534db9,_0x5e11c4[_0x4f25('0x12')][_0x4f25('0x13')]);return _0x2ff989(_0x5e11c4[_0x4f25('0x12')][_0x4f25('0x13')]);}logger[_0x4f25('0x12')](_0x4f25('0xe'),_0x534db9,_0x5e11c4[_0x4f25('0x12')]['message']);return _0x47c797(_0x5e11c4[_0x4f25('0x12')]['message']);}else{logger[_0x4f25('0xd')](_0x4f25('0xe'),_0x534db9,'request\x20sent');_0x47c797(_0x5e11c4[_0x4f25('0x14')][_0x4f25('0x13')]);}})[_0x4f25('0x15')](function(_0x259384){logger[_0x4f25('0x12')](_0x4f25('0xe'),_0x534db9,_0x259384);_0x2ff989(_0x259384);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 00ab644..64731d6 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 _0xaeed=['update','delete','/:id','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x341843,_0x260de0){var _0x15d702=function(_0x2d53d8){while(--_0x2d53d8){_0x341843['push'](_0x341843['shift']());}};_0x15d702(++_0x260de0);}(_0xaeed,0x108));var _0xdaee=function(_0x5f3983,_0x432047){_0x5f3983=_0x5f3983-0x0;var _0x554957=_0xaeed[_0x5f3983];return _0x554957;};'use strict';var multer=require(_0xdaee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdaee('0x1'));var router=express[_0xdaee('0x2')]();var fs_extra=require(_0xdaee('0x3'));var auth=require(_0xdaee('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdaee('0x5'));var controller=require(_0xdaee('0x6'));router[_0xdaee('0x7')]('/',auth[_0xdaee('0x8')](),controller[_0xdaee('0x9')]);router[_0xdaee('0x7')](_0xdaee('0xa'),auth['isAuthenticated'](),controller[_0xdaee('0xb')]);router[_0xdaee('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xdaee('0xc')]);router['get']('/:id/download',auth[_0xdaee('0x8')](),controller['download']);router[_0xdaee('0xd')]('/',auth['isAuthenticated'](),controller[_0xdaee('0xe')]);router[_0xdaee('0xf')]('/:id',auth[_0xdaee('0x8')](),controller[_0xdaee('0x10')]);router[_0xdaee('0x11')](_0xdaee('0x12'),auth[_0xdaee('0x8')](),controller[_0xdaee('0x13')]);module['exports']=router; \ No newline at end of file +var _0x944c=['get','isAuthenticated','index','/describe','describe','show','/:id/download','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x944c,0x6f));var _0xc944=function(_0x11e711,_0x5282a0){_0x11e711=_0x11e711-0x0;var _0x62dda2=_0x944c[_0x11e711];return _0x62dda2;};'use strict';var multer=require(_0xc944('0x0'));var util=require(_0xc944('0x1'));var path=require('path');var timeout=require(_0xc944('0x2'));var express=require(_0xc944('0x3'));var router=express[_0xc944('0x4')]();var fs_extra=require(_0xc944('0x5'));var auth=require(_0xc944('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc944('0x7'));var controller=require(_0xc944('0x8'));router[_0xc944('0x9')]('/',auth[_0xc944('0xa')](),controller[_0xc944('0xb')]);router[_0xc944('0x9')](_0xc944('0xc'),auth[_0xc944('0xa')](),controller[_0xc944('0xd')]);router[_0xc944('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc944('0xe')]);router[_0xc944('0x9')](_0xc944('0xf'),auth[_0xc944('0xa')](),controller['download']);router[_0xc944('0x10')]('/',auth[_0xc944('0xa')](),controller[_0xc944('0x11')]);router[_0xc944('0x12')]('/:id',auth[_0xc944('0xa')](),controller[_0xc944('0x13')]);router[_0xc944('0x14')](_0xc944('0x15'),auth[_0xc944('0xa')](),controller[_0xc944('0x16')]);module[_0xc944('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index b76ef57..9be7ddf 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 _0x543b=['path','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','toString','DATE','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x543b,0x18d));var _0xb543=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x543b[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xb543('0x0'));var moment=require(_0xb543('0x1'));var path=require(_0xb543('0x2'));var config=require('../../config/environment');module[_0xb543('0x3')]={'format':{'type':Sequelize[_0xb543('0x4')],'get':function(){return this[_0xb543('0x5')]('value')?path[_0xb543('0x6')](this[_0xb543('0x5')](_0xb543('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xb543('0x8')]},'channel':{'type':Sequelize[_0xb543('0x8')]},'value':{'type':Sequelize[_0xb543('0x8')],'set':function(_0x208c95){var _0x338142=_0x208c95[_0xb543('0x9')](/\\/g,'/');this[_0xb543('0xa')](_0xb543('0x7'),_0x338142);}},'rating':{'type':Sequelize[_0xb543('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0xa94776){this['setDataValue'](_0xb543('0xc'),moment()[_0xb543('0xd')](_0xa94776,'ms'));this[_0xb543('0xa')](_0xb543('0xe'),moment());this[_0xb543('0xa')](_0xb543('0xf'),_0xa94776);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb543('0x5')](_0xb543('0xc')))[_0xb543('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xb543('0x11')]();}},'closedAt':{'type':Sequelize[_0xb543('0x12')],'get':function(){return moment(this[_0xb543('0x5')]('closedAt'))['format'](_0xb543('0x13'))[_0xb543('0x11')]();}},'createdAt':{'type':Sequelize[_0xb543('0x12')],'get':function(){return moment(this[_0xb543('0x5')]('createdAt'))[_0xb543('0x10')](_0xb543('0x13'))[_0xb543('0x11')]();}},'updatedAt':{'type':Sequelize[_0xb543('0x12')],'get':function(){return moment(this['getDataValue'](_0xb543('0x14')))['format'](_0xb543('0x13'))[_0xb543('0x11')]();}}}; \ No newline at end of file +var _0x85de=['subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','replace','INTEGER','setDataValue','startedAt'];(function(_0x415a0b,_0x26e7cb){var _0x5acf90=function(_0x17ea2f){while(--_0x17ea2f){_0x415a0b['push'](_0x415a0b['shift']());}};_0x5acf90(++_0x26e7cb);}(_0x85de,0x65));var _0xe85d=function(_0x2af417,_0xd04052){_0x2af417=_0x2af417-0x0;var _0x132f9b=_0x85de[_0x2af417];return _0x132f9b;};'use strict';var Sequelize=require(_0xe85d('0x0'));var moment=require(_0xe85d('0x1'));var path=require(_0xe85d('0x2'));var config=require(_0xe85d('0x3'));module[_0xe85d('0x4')]={'format':{'type':Sequelize[_0xe85d('0x5')],'get':function(){return this['getDataValue'](_0xe85d('0x6'))?path[_0xe85d('0x7')](this[_0xe85d('0x8')](_0xe85d('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe85d('0x9')],'set':function(_0x27401c){var _0x387bfc=_0x27401c[_0xe85d('0xa')](/\\/g,'/');this['setDataValue'](_0xe85d('0x6'),_0x387bfc);}},'rating':{'type':Sequelize[_0xe85d('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe85d('0xb')],'set':function(_0x89b2b2){this[_0xe85d('0xc')](_0xe85d('0xd'),moment()[_0xe85d('0xe')](_0x89b2b2,'ms'));this[_0xe85d('0xc')](_0xe85d('0xf'),moment());this[_0xe85d('0xc')](_0xe85d('0x10'),_0x89b2b2);}},'startedAt':{'type':Sequelize[_0xe85d('0x11')],'get':function(){return moment(this[_0xe85d('0x8')](_0xe85d('0xd')))[_0xe85d('0x12')](_0xe85d('0x13'))[_0xe85d('0x14')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xe85d('0xf')))[_0xe85d('0x12')](_0xe85d('0x13'))[_0xe85d('0x14')]();}},'createdAt':{'type':Sequelize[_0xe85d('0x11')],'get':function(){return moment(this[_0xe85d('0x8')](_0xe85d('0x15')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe85d('0x8')](_0xe85d('0x16')))['format'](_0xe85d('0x13'))[_0xe85d('0x14')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 5115c47..c4b7d9b 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 _0xdc97=['join','root','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','format','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','ScreenRecording','includeAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid'];(function(_0x304412,_0x5c775c){var _0x3a52fa=function(_0xae402c){while(--_0xae402c){_0x304412['push'](_0x304412['shift']());}};_0x3a52fa(++_0x5c775c);}(_0xdc97,0x13b));var _0x7dc9=function(_0x45644e,_0x47c18d){_0x45644e=_0x45644e-0x0;var _0x3ecd7f=_0xdc97[_0x45644e];return _0x3ecd7f;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['ScreenRecording']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['differenceBy'](_[_0x7dc9('0x27')](_0x14083d,_0x7dc9('0x24')),[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x450124[_0x7dc9('0x29')]);_0x1fcf0e['filters']=_['intersection'](_0x1fcf0e['model'],_0x1fcf0e[_0x7dc9('0x29')]);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e[_0x7dc9('0x2c')],qs[_0x7dc9('0x2d')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x229f8e[_0x7dc9('0x2e')]=_0x229f8e[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x229f8e['attributes']:_0x1fcf0e[_0x7dc9('0x2c')];if(!_0x450124['query'][_0x7dc9('0x30')](_0x7dc9('0x31'))){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124['query'][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query']['offset']);}_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x33')](_0x450124[_0x7dc9('0x29')][_0x7dc9('0x33')]);_0x229f8e['where']=qs[_0x7dc9('0x34')](_[_0x7dc9('0x35')](_0x450124[_0x7dc9('0x29')],_0x1fcf0e[_0x7dc9('0x34')]),_0x14083d);if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]){_0x229f8e[_0x7dc9('0x37')]=_[_0x7dc9('0x38')](_0x229f8e[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x452aed){if(_0x452aed[_0x7dc9('0x39')]!=='VIRTUAL'){var _0x34b5c9={};_0x34b5c9[_0x452aed[_0x7dc9('0x24')]]={'$like':'%'+_0x450124[_0x7dc9('0x29')][_0x7dc9('0x36')]+'%'};return _0x34b5c9;}})});}_0x229f8e=_['merge']({},_0x229f8e,_0x450124[_0x7dc9('0x3a')]);var _0x89db0e={'where':_0x229f8e[_0x7dc9('0x37')]};return db[_0x7dc9('0x3b')][_0x7dc9('0x1b')](_0x89db0e)[_0x7dc9('0x21')](function(_0x5a1201){_0x3c4379['count']=_0x5a1201;if(_0x450124[_0x7dc9('0x29')][_0x7dc9('0x3c')]){_0x229f8e['include']=[{'all':!![]}];}return db[_0x7dc9('0x3b')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x2a91fe){_0x3c4379[_0x7dc9('0x3d')]=_0x2a91fe;return _0x3c4379;})['then'](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3e')](handleError(_0x236d42,null));};exports[_0x7dc9('0x3f')]=function(_0x1929b6,_0x95513c){var _0x28ffc0={'raw':![],'where':{'id':_0x1929b6[_0x7dc9('0x40')]['id']}},_0x23499a={};_0x23499a['model']=_[_0x7dc9('0x2a')](db['ScreenRecording']['rawAttributes']);_0x23499a[_0x7dc9('0x29')]=_[_0x7dc9('0x2a')](_0x1929b6[_0x7dc9('0x29')]);_0x23499a[_0x7dc9('0x34')]=_[_0x7dc9('0x2b')](_0x23499a[_0x7dc9('0x2c')],_0x23499a[_0x7dc9('0x29')]);_0x28ffc0[_0x7dc9('0x2e')]=_[_0x7dc9('0x2b')](_0x23499a['model'],qs[_0x7dc9('0x2d')](_0x1929b6[_0x7dc9('0x29')][_0x7dc9('0x2d')]));_0x28ffc0[_0x7dc9('0x2e')]=_0x28ffc0[_0x7dc9('0x2e')][_0x7dc9('0x2f')]?_0x28ffc0['attributes']:_0x23499a[_0x7dc9('0x2c')];if(_0x1929b6[_0x7dc9('0x29')]['includeAll']){_0x28ffc0[_0x7dc9('0x41')]=[{'all':!![]}];}_0x28ffc0=_[_0x7dc9('0x38')]({},_0x28ffc0,_0x1929b6[_0x7dc9('0x3a')]);return db['ScreenRecording'][_0x7dc9('0x42')](_0x28ffc0)['then'](handleEntityNotFound(_0x95513c,null))['then'](respondWithResult(_0x95513c,null))[_0x7dc9('0x3e')](handleError(_0x95513c,null));};exports[_0x7dc9('0x43')]=function(_0x36d591,_0x5e0dc5){return db['ScreenRecording'][_0x7dc9('0x43')](_0x36d591['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x5e0dc5,0xc9))[_0x7dc9('0x3e')](handleError(_0x5e0dc5,null));};exports['update']=function(_0x24ccce,_0x1d6c0a){if(_0x24ccce[_0x7dc9('0x44')]['id']){delete _0x24ccce[_0x7dc9('0x44')]['id'];}delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x45')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x46')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x47')];delete _0x24ccce[_0x7dc9('0x44')][_0x7dc9('0x48')];return db[_0x7dc9('0x3b')]['find']({'where':{'id':_0x24ccce[_0x7dc9('0x40')]['id']}})['then'](handleEntityNotFound(_0x1d6c0a,null))['then'](saveUpdates(_0x24ccce[_0x7dc9('0x44')],null))[_0x7dc9('0x21')](respondWithResult(_0x1d6c0a,null))[_0x7dc9('0x3e')](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x49')]=function(_0x346d27,_0x510e2a){return db[_0x7dc9('0x3b')][_0x7dc9('0x49')]()[_0x7dc9('0x21')](respondWithResult(_0x510e2a,null))['catch'](handleError(_0x510e2a,null));};exports[_0x7dc9('0x4a')]=function(_0x3fc164,_0x2cf133,_0x32bc31){var _0xf41b8c=require(_0x7dc9('0x4b'));var _0x593132=![];var _0x366b8b={};if(_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]&&_0x3fc164[_0x7dc9('0x29')][_0x7dc9('0x39')]===_0x7dc9('0x4c')){_0x366b8b[_0x7dc9('0x4c')]=_0x3fc164[_0x7dc9('0x40')]['id'];}else{_0x366b8b['id']=_0x3fc164[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':_0x366b8b,'attributes':['id',_0x7dc9('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x2cf133,null))[_0x7dc9('0x21')](function(_0x39be46){if(_0x39be46){var _0x38df9a=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x39be46[_0x7dc9('0x48')]);var _0xd8d327=util[_0x7dc9('0x28')](_0x7dc9('0x4f'),_0x38df9a);if(fs[_0x7dc9('0x50')](_0xd8d327)){_0x593132=!![];return _0xf41b8c[_0x7dc9('0x51')](_0xd8d327,_0x38df9a,config['secrets']['recording'])['then'](function(){return _0x39be46;});}return _0x39be46;}})[_0x7dc9('0x21')](function(_0x3daf33){if(_0x3daf33){var _0x32a64f=path[_0x7dc9('0x4d')](config['root'],'server/files/screen_recordings',_0x3daf33[_0x7dc9('0x48')]);if(!fs[_0x7dc9('0x50')](_0x32a64f)){throw new db[(_0x7dc9('0x52'))][(_0x7dc9('0x53'))](_0x7dc9('0x54'));}if(_0x3daf33[_0x7dc9('0x55')]){return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,_0x3daf33['filename']+path[_0x7dc9('0x56')](_0x32a64f),function(){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}else{return _0x2cf133[_0x7dc9('0x4a')](_0x32a64f,function(_0x1dad95){if(_0x593132){fs[_0x7dc9('0x57')](_0x32a64f);}});}}})['catch'](function(_0x175858){if(_0x175858[_0x7dc9('0x58')]===_0x7dc9('0x54')){_0x2cf133[_0x7dc9('0x16')](0x194)[_0x7dc9('0x25')](_0x7dc9('0x59'));}else{return handleError(_0x2cf133,null);}});};exports[_0x7dc9('0x5a')]=function(_0x2a02ed,_0x3463e4){return db[_0x7dc9('0x3b')][_0x7dc9('0x42')]({'where':{'id':_0x2a02ed[_0x7dc9('0x40')]['id']}})[_0x7dc9('0x21')](function(_0x5eee27){if(_[_0x7dc9('0x5b')](_0x5eee27)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5eee27;})[_0x7dc9('0x21')](function(_0x15cf19){var _0x48ea37=path[_0x7dc9('0x4d')](config[_0x7dc9('0x4e')],'server/files/screen_recordings',_0x15cf19[_0x7dc9('0x48')]);logger[_0x7dc9('0x5c')](_0x7dc9('0x5d'),_0x48ea37);if(!_['isNil'](_0x15cf19['value'])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger[_0x7dc9('0x5c')](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}_0x48ea37=_0x48ea37+_0x7dc9('0x61');if(!_[_0x7dc9('0x5b')](_0x15cf19[_0x7dc9('0x48')])&&fs[_0x7dc9('0x50')](_0x48ea37)){logger['info'](_0x7dc9('0x5e')+_0x48ea37+_0x7dc9('0x5f'));fs[_0x7dc9('0x60')](_0x48ea37);}return _0x15cf19;})['then'](function(_0x4f80bd){if(!_0x4f80bd)throw new InternalError();return _0x4f80bd[_0x7dc9('0x5a')]();})[_0x7dc9('0x21')](function(){_0x3463e4[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();})['catch'](handleError(_0x3463e4,null));}; \ No newline at end of file +var _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x52fabd,_0x2d0d53){var _0x247ec7=function(_0x810951){while(--_0x810951){_0x52fabd['push'](_0x52fabd['shift']());}};_0x247ec7(++_0x2d0d53);}(_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['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3fda180..6135a76 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 _0x6bc4=['./screenRecording.attributes','exports','ScreenRecording','interactionid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3bb9d9,_0xe64235){var _0x4ca040=function(_0x592c59){while(--_0x592c59){_0x3bb9d9['push'](_0x3bb9d9['shift']());}};_0x4ca040(++_0xe64235);}(_0x6bc4,0xa9));var _0x46bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6bc4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x46bc('0x0'));var moment=require(_0x46bc('0x1'));var BPromise=require(_0x46bc('0x2'));var rp=require(_0x46bc('0x3'));var fs=require('fs');var path=require(_0x46bc('0x4'));var rimraf=require(_0x46bc('0x5'));var config=require(_0x46bc('0x6'));var attributes=require(_0x46bc('0x7'));module[_0x46bc('0x8')]=function(_0xec0413,_0x383834){return _0xec0413['define'](_0x46bc('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x46bc('0xa'),'fields':[_0x46bc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6795=['moment','bluebird','request-promise','path','../../config/environment','exports','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x6795,0x165));var _0x5679=function(_0x3e93a8,_0x19554a){_0x3e93a8=_0x3e93a8-0x0;var _0x27dac3=_0x6795[_0x3e93a8];return _0x27dac3;};'use strict';var _=require(_0x5679('0x0'));var util=require('util');var logger=require(_0x5679('0x1'))(_0x5679('0x2'));var moment=require(_0x5679('0x3'));var BPromise=require(_0x5679('0x4'));var rp=require(_0x5679('0x5'));var fs=require('fs');var path=require(_0x5679('0x6'));var rimraf=require('rimraf');var config=require(_0x5679('0x7'));var attributes=require('./screenRecording.attributes');module[_0x5679('0x8')]=function(_0x3edcb8,_0x2b853a){return _0x3edcb8['define'](_0x5679('0x9'),attributes,{'tableName':_0x5679('0xa'),'paranoid':![],'indexes':[{'name':_0x5679('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index cff07f5..adef841 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 _0xc592=['rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0xc592,0x1ea));var _0x2c59=function(_0x2cde23,_0x3d2800){_0x2cde23=_0x2cde23-0x0;var _0x2753fc=_0xc592[_0x2cde23];return _0x2753fc;};'use strict';var _=require('lodash');var util=require(_0x2c59('0x0'));var moment=require(_0x2c59('0x1'));var BPromise=require(_0x2c59('0x2'));var rs=require(_0x2c59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c59('0x4'));var config=require(_0x2c59('0x5'));var jayson=require(_0x2c59('0x6'));var client=jayson[_0x2c59('0x7')][_0x2c59('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34de8a,_0x53be06,_0x5f021c){return new BPromise(function(_0x167208,_0x2185b2){return client['request'](_0x34de8a,_0x5f021c)[_0x2c59('0x9')](function(_0x1fc182){logger[_0x2c59('0xa')](_0x2c59('0xb'),_0x53be06,_0x2c59('0xc'));logger[_0x2c59('0xd')](_0x2c59('0xe'),_0x53be06,_0x2c59('0xc'),JSON[_0x2c59('0xf')](_0x1fc182));if(_0x1fc182[_0x2c59('0x10')]){if(_0x1fc182['error'][_0x2c59('0x11')]===0x1f4){logger[_0x2c59('0x10')](_0x2c59('0xb'),_0x53be06,_0x1fc182[_0x2c59('0x10')][_0x2c59('0x12')]);return _0x2185b2(_0x1fc182[_0x2c59('0x10')]['message']);}logger['error'](_0x2c59('0xb'),_0x53be06,_0x1fc182['error'][_0x2c59('0x12')]);return _0x167208(_0x1fc182['error']['message']);}else{logger[_0x2c59('0xa')](_0x2c59('0xb'),_0x53be06,_0x2c59('0xc'));_0x167208(_0x1fc182['result'][_0x2c59('0x12')]);}})['catch'](function(_0x6bf8e2){logger[_0x2c59('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x53be06,_0x6bf8e2);_0x2185b2(_0x6bf8e2);});});} \ No newline at end of file +var _0x52f0=['../../config/environment','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x52f0,0xcc));var _0x052f=function(_0x50d2db,_0x47481f){_0x50d2db=_0x50d2db-0x0;var _0x1c7e27=_0x52f0[_0x50d2db];return _0x1c7e27;};'use strict';var _=require('lodash');var util=require(_0x052f('0x0'));var moment=require(_0x052f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x052f('0x2'));var db=require(_0x052f('0x3'))['db'];var utils=require(_0x052f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x052f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x052f('0x6')][_0x052f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ef4be,_0x5e28a4,_0x564036){return new BPromise(function(_0xdd2b63,_0x47c66b){return client[_0x052f('0x8')](_0x2ef4be,_0x564036)['then'](function(_0x4ba75b){logger[_0x052f('0x9')](_0x052f('0xa'),_0x5e28a4,_0x052f('0xb'));logger[_0x052f('0xc')](_0x052f('0xd'),_0x5e28a4,'request\x20sent',JSON[_0x052f('0xe')](_0x4ba75b));if(_0x4ba75b[_0x052f('0xf')]){if(_0x4ba75b[_0x052f('0xf')][_0x052f('0x10')]===0x1f4){logger[_0x052f('0xf')](_0x052f('0xa'),_0x5e28a4,_0x4ba75b[_0x052f('0xf')][_0x052f('0x11')]);return _0x47c66b(_0x4ba75b[_0x052f('0xf')][_0x052f('0x11')]);}logger['error'](_0x052f('0xa'),_0x5e28a4,_0x4ba75b['error']['message']);return _0xdd2b63(_0x4ba75b[_0x052f('0xf')][_0x052f('0x11')]);}else{logger[_0x052f('0x9')](_0x052f('0xa'),_0x5e28a4,'request\x20sent');_0xdd2b63(_0x4ba75b[_0x052f('0x12')][_0x052f('0x11')]);}})['catch'](function(_0x555719){logger[_0x052f('0xf')](_0x052f('0xa'),_0x5e28a4,_0x555719);_0x47c66b(_0x555719);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index c495caf..e2cd7e4 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 _0xc272=['../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','getDate','/:id','show','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','addLogo','logologin','/:id/logo_login','file','preferred','server/files/images/logos/','addFavicon','put','exports','multer','path','connect-timeout','fs-extra'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc272,0x1a9));var _0x2c27=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xc272[_0x5ce3c8];return _0xa76867;};'use strict';var multer=require(_0x2c27('0x0'));var util=require('util');var path=require(_0x2c27('0x1'));var timeout=require(_0x2c27('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2c27('0x3'));var auth=require(_0x2c27('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2c27('0x5'));var controller=require(_0x2c27('0x6'));router[_0x2c27('0x7')]('/',auth[_0x2c27('0x8')](),controller['index']);router[_0x2c27('0x7')]('/now',controller[_0x2c27('0x9')]);router[_0x2c27('0x7')](_0x2c27('0xa'),controller[_0x2c27('0xb')]);router[_0x2c27('0x7')](_0x2c27('0xc'),controller['getLogo']);router[_0x2c27('0x7')]('/:id/logo_login',controller[_0x2c27('0xd')]);router['get'](_0x2c27('0xe'),controller[_0x2c27('0xf')]);router[_0x2c27('0x7')](_0x2c27('0x10'),controller[_0x2c27('0x11')]);router[_0x2c27('0x7')](_0x2c27('0x12'),controller[_0x2c27('0x13')]);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x2a638a,_0xc9cf13,_0x673fa3){_0x673fa3(null,path[_0x2c27('0x15')](config[_0x2c27('0x16')],'server/files/images/logos/'));},'filename':function(_0x255102,_0x14c053,_0x4e9d78){_0x4e9d78(null,util[_0x2c27('0x17')](_0x2c27('0x18'),_0x2c27('0x19'),path[_0x2c27('0x1a')](_0x14c053[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')](_0x2c27('0xc'),upload[_0x2c27('0x1d')]('file'),controller[_0x2c27('0x1e')]);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x33cca3,_0x44bd85,_0x2a4f9f){_0x2a4f9f(null,path['join'](config[_0x2c27('0x16')],'server/files/images/logos/'));},'filename':function(_0x4c7541,_0x49935c,_0x57239c){_0x57239c(null,util[_0x2c27('0x17')](_0x2c27('0x18'),_0x2c27('0x1f'),path[_0x2c27('0x1a')](_0x49935c[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')](_0x2c27('0x20'),upload['single'](_0x2c27('0x21')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x4e7d99,_0x3cb3a7,_0x525fdf){_0x525fdf(null,path[_0x2c27('0x15')](config[_0x2c27('0x16')],'server/files/images/logos/'));},'filename':function(_0x30741e,_0x1e7b6e,_0x5167e){_0x5167e(null,util[_0x2c27('0x17')](_0x2c27('0x18'),_0x2c27('0x22'),path[_0x2c27('0x1a')](_0x1e7b6e[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')]('/:id/preferred',upload['single'](_0x2c27('0x21')),controller['addPreferred']);var upload=multer({'storage':multer[_0x2c27('0x14')]({'destination':function(_0x14bbd7,_0x3ce50f,_0x507090){_0x507090(null,path[_0x2c27('0x15')](config[_0x2c27('0x16')],_0x2c27('0x23')));},'filename':function(_0x2808da,_0x38c41f,_0x5e2255){_0x5e2255(null,util[_0x2c27('0x17')]('%s%s','favicon',path[_0x2c27('0x1a')](_0x38c41f[_0x2c27('0x1b')])));}})});router[_0x2c27('0x1c')]('/:id/favicon',upload[_0x2c27('0x1d')](_0x2c27('0x21')),controller[_0x2c27('0x24')]);router[_0x2c27('0x25')](_0x2c27('0xa'),auth[_0x2c27('0x8')](),controller['update']);module[_0x2c27('0x26')]=router; \ No newline at end of file +var _0x672a=['put','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','extname','originalname','/:id/logo','single','server/files/images/logos/','%s%s','logologin','/:id/logo_login','addLogoLogin','preferred','post','/:id/preferred','file','favicon','addFavicon'];(function(_0x2a6268,_0x4b0429){var _0x32f1f1=function(_0xb70ae){while(--_0xb70ae){_0x2a6268['push'](_0x2a6268['shift']());}};_0x32f1f1(++_0x4b0429);}(_0x672a,0x121));var _0xa672=function(_0x574c3b,_0x56c826){_0x574c3b=_0x574c3b-0x0;var _0x24ea08=_0x672a[_0x574c3b];return _0x24ea08;};'use strict';var multer=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var path=require(_0xa672('0x2'));var timeout=require(_0xa672('0x3'));var express=require(_0xa672('0x4'));var router=express['Router']();var fs_extra=require(_0xa672('0x5'));var auth=require(_0xa672('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa672('0x7'));router['get']('/',auth[_0xa672('0x8')](),controller[_0xa672('0x9')]);router[_0xa672('0xa')](_0xa672('0xb'),controller[_0xa672('0xc')]);router[_0xa672('0xa')](_0xa672('0xd'),controller[_0xa672('0xe')]);router[_0xa672('0xa')]('/:id/logo',controller['getLogo']);router[_0xa672('0xa')]('/:id/logo_login',controller[_0xa672('0xf')]);router[_0xa672('0xa')](_0xa672('0x10'),controller['gdpr']);router[_0xa672('0xa')]('/:id/preferred',controller[_0xa672('0x11')]);router[_0xa672('0xa')](_0xa672('0x12'),controller[_0xa672('0x13')]);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0x42833c,_0x3625b8,_0x9aad21){_0x9aad21(null,path[_0xa672('0x15')](config[_0xa672('0x16')],'server/files/images/logos/'));},'filename':function(_0x3c3710,_0x48c55f,_0x4cd1e5){_0x4cd1e5(null,util[_0xa672('0x17')]('%s%s','logo',path[_0xa672('0x18')](_0x48c55f[_0xa672('0x19')])));}})});router['post'](_0xa672('0x1a'),upload[_0xa672('0x1b')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0x4f150f,_0x1995bb,_0xbd51e6){_0xbd51e6(null,path[_0xa672('0x15')](config['root'],_0xa672('0x1c')));},'filename':function(_0x6a2dbc,_0x19cef2,_0x329b4d){_0x329b4d(null,util[_0xa672('0x17')](_0xa672('0x1d'),_0xa672('0x1e'),path[_0xa672('0x18')](_0x19cef2[_0xa672('0x19')])));}})});router['post'](_0xa672('0x1f'),upload[_0xa672('0x1b')]('file'),controller[_0xa672('0x20')]);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0xd7a9c2,_0x1e1491,_0x45e76f){_0x45e76f(null,path[_0xa672('0x15')](config[_0xa672('0x16')],_0xa672('0x1c')));},'filename':function(_0x3f4c50,_0x10d1cf,_0x403c9d){_0x403c9d(null,util[_0xa672('0x17')](_0xa672('0x1d'),_0xa672('0x21'),path[_0xa672('0x18')](_0x10d1cf[_0xa672('0x19')])));}})});router[_0xa672('0x22')](_0xa672('0x23'),upload[_0xa672('0x1b')](_0xa672('0x24')),controller['addPreferred']);var upload=multer({'storage':multer[_0xa672('0x14')]({'destination':function(_0xc9a63f,_0x39576e,_0x132836){_0x132836(null,path[_0xa672('0x15')](config[_0xa672('0x16')],_0xa672('0x1c')));},'filename':function(_0x47dfd4,_0x27fa29,_0x4100f1){_0x4100f1(null,util['format']('%s%s',_0xa672('0x25'),path[_0xa672('0x18')](_0x27fa29['originalname'])));}})});router[_0xa672('0x22')]('/:id/favicon',upload[_0xa672('0x1b')](_0xa672('0x24')),controller[_0xa672('0x26')]);router[_0xa672('0x27')](_0xa672('0xd'),auth[_0xa672('0x8')](),controller['update']);module[_0xa672('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 c5703ca..e631fdd 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x28beca,_0x2d129d){var _0x107508=function(_0x4d800d){while(--_0x4d800d){_0x28beca['push'](_0x28beca['shift']());}};_0x107508(++_0x2d129d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x1f718e,_0x46bfa6){var _0x108721=function(_0x40f2c7){while(--_0x40f2c7){_0x1f718e['push'](_0x1f718e['shift']());}};_0x108721(++_0x46bfa6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 122f4e1..cc6c7fd 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 _0xb3e9=['\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','name','send','index','map','Setting','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','addLogo','file','body','filename','params','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','download','getLicense','defaultPreferred','default_loginLogo.svg'];(function(_0x5504fc,_0x2e161c){var _0xbad34c=function(_0x1f62de){while(--_0x1f62de){_0x5504fc['push'](_0x5504fc['shift']());}};_0xbad34c(++_0x2e161c);}(_0xb3e9,0x1eb));var _0x9b3e=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xb3e9[_0x22b68a];return _0x1ac67a;};'use strict';var emlformat=require(_0x9b3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b3e('0x1'));var jsonpatch=require(_0x9b3e('0x2'));var rp=require(_0x9b3e('0x3'));var moment=require(_0x9b3e('0x4'));var BPromise=require(_0x9b3e('0x5'));var Mustache=require(_0x9b3e('0x6'));var util=require(_0x9b3e('0x7'));var path=require('path');var sox=require(_0x9b3e('0x8'));var csv=require('to-csv');var ejs=require(_0x9b3e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b3e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b3e('0xb'));var querystring=require(_0x9b3e('0xc'));var Papa=require(_0x9b3e('0xd'));var Redis=require(_0x9b3e('0xe'));var authService=require(_0x9b3e('0xf'));var qs=require(_0x9b3e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9b3e('0x11'));var utils=require(_0x9b3e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9b3e('0x13'));var db=require(_0x9b3e('0x14'))['db'];var jayson=require(_0x9b3e('0x15'));var client=jayson[_0x9b3e('0x16')][_0x9b3e('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x54ccf6,_0x5824c0,_0x30c2b8,_0x38d9fd){return new BPromise(function(_0xe2be16,_0x6637e0){var _0x82ec8d=_0x38d9fd||client;return _0x82ec8d[_0x9b3e('0x18')](_0x54ccf6,_0x30c2b8)[_0x9b3e('0x19')](function(_0x15a7cf){logger[_0x9b3e('0x1a')](_0x9b3e('0x1b'),_0x5824c0,_0x9b3e('0x1c'));logger[_0x9b3e('0x1d')](_0x9b3e('0x1e'),_0x5824c0,_0x9b3e('0x1c'),JSON[_0x9b3e('0x1f')](_0x15a7cf));if(_0x15a7cf[_0x9b3e('0x20')]){if(_0x15a7cf['error'][_0x9b3e('0x21')]===0x1f4){logger[_0x9b3e('0x20')](_0x9b3e('0x1b'),_0x5824c0,_0x15a7cf['error'][_0x9b3e('0x22')]);return _0x6637e0(_0x15a7cf[_0x9b3e('0x20')][_0x9b3e('0x22')]);}logger['error'](_0x9b3e('0x1b'),_0x5824c0,_0x15a7cf['error'][_0x9b3e('0x22')]);return _0xe2be16(_0x15a7cf[_0x9b3e('0x20')][_0x9b3e('0x22')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x5824c0,_0x9b3e('0x1c'));_0xe2be16(_0x15a7cf[_0x9b3e('0x23')][_0x9b3e('0x22')]);}})[_0x9b3e('0x24')](function(_0x591ae8){logger[_0x9b3e('0x20')](_0x9b3e('0x1b'),_0x5824c0,_0x591ae8);_0x6637e0(_0x591ae8);});});}function respondWithStatusCode(_0x101293,_0x4b9029){_0x4b9029=_0x4b9029||0xcc;return function(_0x984e96){if(_0x984e96){return _0x101293[_0x9b3e('0x25')](_0x4b9029);}return _0x101293[_0x9b3e('0x26')](_0x4b9029)[_0x9b3e('0x27')]();};}function respondWithResult(_0x3fd7ee,_0x501541){_0x501541=_0x501541||0xc8;return function(_0x162875){if(_0x162875){return _0x3fd7ee['status'](_0x501541)[_0x9b3e('0x28')](_0x162875);}};}function respondWithFilteredResult(_0x19d9c4,_0x2bdb0a){return function(_0x4cd6f0){if(_0x4cd6f0){var _0x19d8fe=typeof _0x2bdb0a[_0x9b3e('0x29')]===_0x9b3e('0x2a')&&typeof _0x2bdb0a[_0x9b3e('0x2b')]==='undefined';var _0x36078c=_0x4cd6f0[_0x9b3e('0x2c')];var _0x109e04=_0x19d8fe?0x0:_0x2bdb0a['offset'];var _0x1bbdf0=_0x19d8fe?_0x4cd6f0['count']:_0x2bdb0a[_0x9b3e('0x29')]+_0x2bdb0a[_0x9b3e('0x2b')];var _0x52ae43;if(_0x1bbdf0>=_0x36078c){_0x1bbdf0=_0x36078c;_0x52ae43=0xc8;}else{_0x52ae43=0xce;}_0x19d9c4[_0x9b3e('0x26')](_0x52ae43);return _0x19d9c4[_0x9b3e('0x2d')](_0x9b3e('0x2e'),_0x109e04+'-'+_0x1bbdf0+'/'+_0x36078c)[_0x9b3e('0x28')](_0x4cd6f0);}return null;};}function patchUpdates(_0x32abfa){return function(_0x581599){try{jsonpatch['apply'](_0x581599,_0x32abfa,!![]);}catch(_0x52d35d){return BPromise[_0x9b3e('0x2f')](_0x52d35d);}return _0x581599[_0x9b3e('0x30')]();};}function saveUpdates(_0x3d8aea,_0x4e858c){return function(_0x371e86){if(_0x371e86){return _0x371e86[_0x9b3e('0x31')](_0x3d8aea)['then'](function(_0x4cfaf3){return _0x4cfaf3;});}return null;};}function removeEntity(_0x20dcb6,_0x50478c){return function(_0x4448be){if(_0x4448be){return _0x4448be['destroy']()[_0x9b3e('0x19')](function(){_0x20dcb6[_0x9b3e('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44cec6,_0x5ea501){return function(_0x5b7243){if(!_0x5b7243){_0x44cec6[_0x9b3e('0x25')](0x194);}return _0x5b7243;};}function handleError(_0x4538cf,_0x274bcb){_0x274bcb=_0x274bcb||0x1f4;return function(_0x37a2bd){logger[_0x9b3e('0x20')](_0x37a2bd['stack']);if(_0x37a2bd[_0x9b3e('0x32')]){delete _0x37a2bd[_0x9b3e('0x32')];}_0x4538cf['status'](_0x274bcb)[_0x9b3e('0x33')](_0x37a2bd);};}exports[_0x9b3e('0x34')]=function(_0x62ef33,_0x229cff){var _0x5a8adb={},_0x260ed7={},_0xcaba6a={'count':0x0,'rows':[]};var _0x228752=_[_0x9b3e('0x35')](db[_0x9b3e('0x36')][_0x9b3e('0x37')],function(_0x15bda6){return{'name':_0x15bda6['fieldName'],'type':_0x15bda6[_0x9b3e('0x38')][_0x9b3e('0x39')]};});_0x260ed7['model']=_[_0x9b3e('0x35')](_0x228752,_0x9b3e('0x32'));_0x260ed7['query']=_[_0x9b3e('0x3a')](_0x62ef33[_0x9b3e('0x3b')]);_0x260ed7[_0x9b3e('0x3c')]=_['intersection'](_0x260ed7[_0x9b3e('0x3d')],_0x260ed7[_0x9b3e('0x3b')]);_0x5a8adb[_0x9b3e('0x3e')]=_[_0x9b3e('0x3f')](_0x260ed7[_0x9b3e('0x3d')],qs[_0x9b3e('0x40')](_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x40')]));_0x5a8adb[_0x9b3e('0x3e')]=_0x5a8adb[_0x9b3e('0x3e')][_0x9b3e('0x41')]?_0x5a8adb[_0x9b3e('0x3e')]:_0x260ed7['model'];if(!_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x42')](_0x9b3e('0x43'))){_0x5a8adb[_0x9b3e('0x2b')]=qs[_0x9b3e('0x2b')](_0x62ef33[_0x9b3e('0x3b')]['limit']);_0x5a8adb[_0x9b3e('0x29')]=qs[_0x9b3e('0x29')](_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x29')]);}_0x5a8adb[_0x9b3e('0x44')]=qs[_0x9b3e('0x45')](_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x45')]);_0x5a8adb[_0x9b3e('0x46')]=qs[_0x9b3e('0x3c')](_['pick'](_0x62ef33[_0x9b3e('0x3b')],_0x260ed7['filters']),_0x228752);if(_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x47')]){_0x5a8adb[_0x9b3e('0x46')]=_[_0x9b3e('0x48')](_0x5a8adb[_0x9b3e('0x46')],{'$or':_[_0x9b3e('0x35')](_0x228752,function(_0x30df9d){if(_0x30df9d[_0x9b3e('0x38')]!==_0x9b3e('0x49')){var _0x2eb9c2={};_0x2eb9c2[_0x30df9d[_0x9b3e('0x32')]]={'$like':'%'+_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x47')]+'%'};return _0x2eb9c2;}})});}_0x5a8adb=_['merge']({},_0x5a8adb,_0x62ef33[_0x9b3e('0x4a')]);var _0x736de1={'where':_0x5a8adb['where']};return db[_0x9b3e('0x36')][_0x9b3e('0x2c')](_0x736de1)[_0x9b3e('0x19')](function(_0x4132f3){_0xcaba6a[_0x9b3e('0x2c')]=_0x4132f3;if(_0x62ef33[_0x9b3e('0x3b')][_0x9b3e('0x4b')]){_0x5a8adb[_0x9b3e('0x4c')]=[{'all':!![]}];}return db['Setting'][_0x9b3e('0x4d')](_0x5a8adb);})[_0x9b3e('0x19')](function(_0x5523e9){_0xcaba6a[_0x9b3e('0x4e')]=_0x5523e9;return _0xcaba6a;})['then'](respondWithFilteredResult(_0x229cff,_0x5a8adb))[_0x9b3e('0x24')](handleError(_0x229cff,null));};exports[_0x9b3e('0x4f')]=function(_0x3dd607,_0x28b23c){var _0x422375={'raw':![],'where':{'id':_0x3dd607['params']['id']}},_0x24fd22={};_0x24fd22[_0x9b3e('0x3d')]=_[_0x9b3e('0x3a')](db[_0x9b3e('0x36')][_0x9b3e('0x37')]);_0x24fd22[_0x9b3e('0x3b')]=_['keys'](_0x3dd607[_0x9b3e('0x3b')]);_0x24fd22[_0x9b3e('0x3c')]=_[_0x9b3e('0x3f')](_0x24fd22[_0x9b3e('0x3d')],_0x24fd22[_0x9b3e('0x3b')]);_0x422375['attributes']=_[_0x9b3e('0x3f')](_0x24fd22['model'],qs['fields'](_0x3dd607[_0x9b3e('0x3b')]['fields']));_0x422375[_0x9b3e('0x3e')]=_0x422375[_0x9b3e('0x3e')]['length']?_0x422375[_0x9b3e('0x3e')]:_0x24fd22[_0x9b3e('0x3d')];if(_0x3dd607[_0x9b3e('0x3b')][_0x9b3e('0x4b')]){_0x422375[_0x9b3e('0x4c')]=[{'all':!![]}];}_0x422375=_[_0x9b3e('0x48')]({},_0x422375,_0x3dd607[_0x9b3e('0x4a')]);return db[_0x9b3e('0x36')]['find'](_0x422375)[_0x9b3e('0x19')](handleEntityNotFound(_0x28b23c,null))['then'](respondWithResult(_0x28b23c,null))[_0x9b3e('0x24')](handleError(_0x28b23c,null));};exports[_0x9b3e('0x31')]=function(_0x33f3c6,_0x13e292){if(_0x33f3c6['body']['id']){delete _0x33f3c6['body']['id'];}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x33f3c6['params']['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x13e292,null))['then'](saveUpdates(_0x33f3c6['body'],null))[_0x9b3e('0x19')](respondWithResult(_0x13e292,null))[_0x9b3e('0x24')](handleError(_0x13e292,null));};exports[_0x9b3e('0x51')]=function(_0x359c4e,_0x2dfac5,_0x308682){if(_0x359c4e[_0x9b3e('0x52')]&&_0x359c4e[_0x9b3e('0x52')]['filename']){_0x359c4e[_0x9b3e('0x53')]['logo']=_0x359c4e['file'][_0x9b3e('0x54')];}return db['Setting'][_0x9b3e('0x50')]({'where':{'id':_0x359c4e[_0x9b3e('0x55')]['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x2dfac5,null))['then'](saveUpdates(_0x359c4e[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x2dfac5,null))[_0x9b3e('0x24')](handleError(_0x2dfac5,null));};exports[_0x9b3e('0x56')]=function(_0x4dc42d,_0x2fcd78,_0x1cfa74){if(_0x4dc42d['file']&&_0x4dc42d[_0x9b3e('0x52')][_0x9b3e('0x54')]){_0x4dc42d[_0x9b3e('0x53')][_0x9b3e('0x57')]=_0x4dc42d[_0x9b3e('0x52')][_0x9b3e('0x54')];}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x4dc42d[_0x9b3e('0x55')]['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x2fcd78,null))[_0x9b3e('0x19')](saveUpdates(_0x4dc42d[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x2fcd78,null))[_0x9b3e('0x24')](handleError(_0x2fcd78,null));};var utilLicense=require('../../config/license/util');exports[_0x9b3e('0x58')]=function(_0x37a36c,_0x43a589,_0x115589){var _0x1d7cf3=_0x9b3e('0x59');var _0x184a5c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2f6bd0){if(_0x2f6bd0){_0x184a5c=_0x2f6bd0;}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x37a36c['params']['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),_0x9b3e('0x5d'),_0x9b3e('0x5e'),'defaultPreferred',_0x9b3e('0x5f')],'raw':!![]});})[_0x9b3e('0x19')](handleEntityNotFound(_0x43a589,null))[_0x9b3e('0x19')](function(_0x4fd1a5){if(_0x4fd1a5){var _0x48b279=_0x4fd1a5[_0x9b3e('0x5a')]&&fs[_0x9b3e('0x60')](path['join'](config[_0x9b3e('0x61')],_0x1d7cf3,_[_0x9b3e('0x62')](_0x4fd1a5['logo'])))?path['join'](config[_0x9b3e('0x61')],_0x1d7cf3,_[_0x9b3e('0x62')](_0x4fd1a5[_0x9b3e('0x5a')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x1d7cf3,_['toLower'](_0x9b3e('0x64')));var _0x16e3db='default'+_[_0x9b3e('0x65')](_0x9b3e('0x5a'));if(_0x4fd1a5[_0x16e3db]||!_0x184a5c[_0x9b3e('0x66')]){_0x48b279=path['join'](config[_0x9b3e('0x61')],_0x1d7cf3,_[_0x9b3e('0x62')]('default_logo.svg'));}if(!fs[_0x9b3e('0x60')](_0x48b279)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_[_0x9b3e('0x65')](_0x9b3e('0x5a'))+'\x20not\x20found');}return _0x43a589[_0x9b3e('0x69')](_0x48b279);}})['catch'](handleError(_0x43a589,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x9baa38,_0xc9d09e,_0x37eace){var _0x589ced=_0x9b3e('0x59');var _0x667b34={'custom':![]};return utilLicense[_0x9b3e('0x6a')]()[_0x9b3e('0x19')](function(_0x31f20e){if(_0x31f20e){_0x667b34=_0x31f20e;}return db['Setting']['find']({'where':{'id':_0x9baa38[_0x9b3e('0x55')]['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),_0x9b3e('0x5d'),_0x9b3e('0x5e'),_0x9b3e('0x6b'),_0x9b3e('0x5f')],'raw':!![]});})[_0x9b3e('0x19')](handleEntityNotFound(_0xc9d09e,null))['then'](function(_0x37e54c){if(_0x37e54c){var _0xecbba3=_0x37e54c[_0x9b3e('0x57')]&&fs[_0x9b3e('0x60')](path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x589ced,_['toLower'](_0x37e54c[_0x9b3e('0x57')])))?path[_0x9b3e('0x63')](config['root'],_0x589ced,_['toLower'](_0x37e54c[_0x9b3e('0x57')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x589ced,_[_0x9b3e('0x62')](_0x9b3e('0x6c')));var _0x18e81a='default'+_[_0x9b3e('0x65')]('loginLogo');if(_0x37e54c[_0x18e81a]||!_0x667b34['custom']){_0xecbba3=path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x589ced,_[_0x9b3e('0x62')](_0x9b3e('0x6c')));}if(!fs['existsSync'](_0xecbba3)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_[_0x9b3e('0x65')]('loginLogo')+_0x9b3e('0x6d'));}return _0xc9d09e[_0x9b3e('0x69')](_0xecbba3);}})[_0x9b3e('0x24')](handleError(_0xc9d09e,null));};exports[_0x9b3e('0x6e')]=function(_0xa5a299,_0x1fb3d1){return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0xa5a299[_0x9b3e('0x55')]['id']},'attributes':[_0x9b3e('0x6f')]})['then'](respondWithResult(_0x1fb3d1,null))[_0x9b3e('0x24')](handleError(_0x1fb3d1,null));};exports[_0x9b3e('0x70')]=function(_0x49900c,_0x330cdc,_0x54d4d8){if(_0x49900c[_0x9b3e('0x52')]&&_0x49900c[_0x9b3e('0x52')][_0x9b3e('0x54')]){_0x49900c[_0x9b3e('0x53')][_0x9b3e('0x5b')]=_0x49900c[_0x9b3e('0x52')][_0x9b3e('0x54')];}return db['Setting'][_0x9b3e('0x50')]({'where':{'id':_0x49900c['params']['id']}})[_0x9b3e('0x19')](handleEntityNotFound(_0x330cdc,null))[_0x9b3e('0x19')](saveUpdates(_0x49900c[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x330cdc,null))['catch'](handleError(_0x330cdc,null));};var utilLicense=require('../../config/license/util');exports[_0x9b3e('0x71')]=function(_0xb80182,_0x340ce6,_0x4afda4){var _0x330f7e='server/files/images/logos';var _0x551098={'custom':![]};return utilLicense[_0x9b3e('0x6a')]()[_0x9b3e('0x19')](function(_0x1b3b78){if(_0x1b3b78){_0x551098=_0x1b3b78;}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0xb80182['params']['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),_0x9b3e('0x5d'),_0x9b3e('0x5e'),'defaultPreferred',_0x9b3e('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x340ce6,null))[_0x9b3e('0x19')](function(_0xb55250){if(_0xb55250){var _0x3429a8=_0xb55250['preferred']&&fs['existsSync'](path['join'](config['root'],_0x330f7e,_[_0x9b3e('0x62')](_0xb55250[_0x9b3e('0x5b')])))?path[_0x9b3e('0x63')](config['root'],_0x330f7e,_[_0x9b3e('0x62')](_0xb55250[_0x9b3e('0x5b')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x330f7e,_['toLower']('default_preferred.png'));var _0x28fdfa=_0x9b3e('0x72')+_[_0x9b3e('0x65')](_0x9b3e('0x5b'));if(_0xb55250[_0x28fdfa]||!_0x551098[_0x9b3e('0x66')]||!_0x551098['preferred']){_0x3429a8=path['join'](config[_0x9b3e('0x61')],_0x330f7e,_['toLower']('default_preferred.png'));}if(!fs[_0x9b3e('0x60')](_0x3429a8)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_['upperFirst'](_0x9b3e('0x5b'))+_0x9b3e('0x6d'));}return _0x340ce6[_0x9b3e('0x69')](_0x3429a8);}})[_0x9b3e('0x24')](handleError(_0x340ce6,null));};exports[_0x9b3e('0x73')]=function(_0x1b2a8f,_0x25b634,_0x3e86be){if(_0x1b2a8f[_0x9b3e('0x52')]&&_0x1b2a8f[_0x9b3e('0x52')]['filename']){_0x1b2a8f[_0x9b3e('0x53')][_0x9b3e('0x5c')]=_0x1b2a8f[_0x9b3e('0x52')][_0x9b3e('0x54')];}return db[_0x9b3e('0x36')][_0x9b3e('0x50')]({'where':{'id':_0x1b2a8f['params']['id']}})['then'](handleEntityNotFound(_0x25b634,null))['then'](saveUpdates(_0x1b2a8f[_0x9b3e('0x53')],null))[_0x9b3e('0x19')](respondWithResult(_0x25b634,null))[_0x9b3e('0x24')](handleError(_0x25b634,null));};var utilLicense=require('../../config/license/util');exports[_0x9b3e('0x74')]=function(_0x351e69,_0x2cdd9d,_0x44d410){var _0x7c3729=_0x9b3e('0x59');var _0x71c490={'custom':![]};return utilLicense[_0x9b3e('0x6a')]()[_0x9b3e('0x19')](function(_0x2a2792){if(_0x2a2792){_0x71c490=_0x2a2792;}return db['Setting']['find']({'where':{'id':_0x351e69[_0x9b3e('0x55')]['id']},'attributes':[_0x9b3e('0x5a'),_0x9b3e('0x57'),_0x9b3e('0x5b'),_0x9b3e('0x5c'),'defaultLogo','defaultLoginLogo',_0x9b3e('0x6b'),_0x9b3e('0x5f')],'raw':!![]});})[_0x9b3e('0x19')](handleEntityNotFound(_0x2cdd9d,null))['then'](function(_0x447244){if(_0x447244){var _0x438a46=_0x447244['favicon']&&fs[_0x9b3e('0x60')](path[_0x9b3e('0x63')](config['root'],_0x7c3729,_[_0x9b3e('0x62')](_0x447244[_0x9b3e('0x5c')])))?path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x7c3729,_['toLower'](_0x447244[_0x9b3e('0x5c')])):path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x7c3729,_[_0x9b3e('0x62')](_0x9b3e('0x75')));var _0x32a108=_0x9b3e('0x72')+_[_0x9b3e('0x65')](_0x9b3e('0x5c'));if(_0x447244[_0x32a108]||!_0x71c490[_0x9b3e('0x66')]){_0x438a46=path[_0x9b3e('0x63')](config[_0x9b3e('0x61')],_0x7c3729,_[_0x9b3e('0x62')](_0x9b3e('0x75')));}if(!fs[_0x9b3e('0x60')](_0x438a46)){throw new db[(_0x9b3e('0x67'))][(_0x9b3e('0x68'))](_['upperFirst']('favicon')+_0x9b3e('0x6d'));}return _0x2cdd9d[_0x9b3e('0x69')](_0x438a46);}})['catch'](handleError(_0x2cdd9d,null));};exports[_0x9b3e('0x76')]=function(_0x5cd651,_0x244324){var _0x574571={'offset':moment()[_0x9b3e('0x77')]()};_0x574571['now']=moment()[_0x9b3e('0x77')](_0x574571[_0x9b3e('0x29')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x244324[_0x9b3e('0x26')](0xc8)[_0x9b3e('0x33')](_0x574571);}; \ No newline at end of file +var _0x0e85=['eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','set','Content-Range','json','apply','save','then','destroy','sendStatus','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','VIRTUAL','merge','Setting','count','includeAll','include','findAll','rows','show','params','rawAttributes','length','options','find','body','addLogo','file','addLogoLogin','loginLogo','filename','server/files/images/logos','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','../../config/license/util','preferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x0e85,0x7c));var _0x50e8=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x0e85[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];var jayson=require(_0x50e8('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3cb45c,_0x2abda1,_0x1a4c85,_0x473aa7){return new BPromise(function(_0x54efd3,_0x18596f){var _0x3149d4=_0x473aa7||client;return _0x3149d4[_0x50e8('0x18')](_0x3cb45c,_0x1a4c85)['then'](function(_0x5524a3){logger[_0x50e8('0x19')](_0x50e8('0x1a'),_0x2abda1,_0x50e8('0x1b'));logger[_0x50e8('0x1c')](_0x50e8('0x1d'),_0x2abda1,_0x50e8('0x1b'),JSON['stringify'](_0x5524a3));if(_0x5524a3['error']){if(_0x5524a3[_0x50e8('0x1e')][_0x50e8('0x1f')]===0x1f4){logger[_0x50e8('0x1e')](_0x50e8('0x1a'),_0x2abda1,_0x5524a3[_0x50e8('0x1e')][_0x50e8('0x20')]);return _0x18596f(_0x5524a3[_0x50e8('0x1e')]['message']);}logger[_0x50e8('0x1e')]('Setting,\x20%s,\x20%s',_0x2abda1,_0x5524a3[_0x50e8('0x1e')][_0x50e8('0x20')]);return _0x54efd3(_0x5524a3[_0x50e8('0x1e')][_0x50e8('0x20')]);}else{logger[_0x50e8('0x19')]('Setting,\x20%s,\x20%s',_0x2abda1,_0x50e8('0x1b'));_0x54efd3(_0x5524a3[_0x50e8('0x21')]['message']);}})[_0x50e8('0x22')](function(_0x41500f){logger['error'](_0x50e8('0x1a'),_0x2abda1,_0x41500f);_0x18596f(_0x41500f);});});}function respondWithStatusCode(_0xe7e56c,_0x4f56b7){_0x4f56b7=_0x4f56b7||0xcc;return function(_0x47a3d8){if(_0x47a3d8){return _0xe7e56c['sendStatus'](_0x4f56b7);}return _0xe7e56c[_0x50e8('0x23')](_0x4f56b7)[_0x50e8('0x24')]();};}function respondWithResult(_0x124402,_0x371a1f){_0x371a1f=_0x371a1f||0xc8;return function(_0xc2f832){if(_0xc2f832){return _0x124402[_0x50e8('0x23')](_0x371a1f)['json'](_0xc2f832);}};}function respondWithFilteredResult(_0x3a6442,_0x396611){return function(_0x4b3a09){if(_0x4b3a09){var _0x177201=typeof _0x396611[_0x50e8('0x25')]===_0x50e8('0x26')&&typeof _0x396611[_0x50e8('0x27')]==='undefined';var _0x1f5a6c=_0x4b3a09['count'];var _0x30fedf=_0x177201?0x0:_0x396611[_0x50e8('0x25')];var _0x42bbef=_0x177201?_0x4b3a09['count']:_0x396611[_0x50e8('0x25')]+_0x396611[_0x50e8('0x27')];var _0x1bed48;if(_0x42bbef>=_0x1f5a6c){_0x42bbef=_0x1f5a6c;_0x1bed48=0xc8;}else{_0x1bed48=0xce;}_0x3a6442[_0x50e8('0x23')](_0x1bed48);return _0x3a6442[_0x50e8('0x28')](_0x50e8('0x29'),_0x30fedf+'-'+_0x42bbef+'/'+_0x1f5a6c)[_0x50e8('0x2a')](_0x4b3a09);}return null;};}function patchUpdates(_0x54d81d){return function(_0x290fd2){try{jsonpatch[_0x50e8('0x2b')](_0x290fd2,_0x54d81d,!![]);}catch(_0x535c24){return BPromise['reject'](_0x535c24);}return _0x290fd2[_0x50e8('0x2c')]();};}function saveUpdates(_0x3543b2,_0x32db93){return function(_0x47ace2){if(_0x47ace2){return _0x47ace2['update'](_0x3543b2)[_0x50e8('0x2d')](function(_0x19e3cc){return _0x19e3cc;});}return null;};}function removeEntity(_0x5c2e04,_0x26b974){return function(_0x17c6a5){if(_0x17c6a5){return _0x17c6a5[_0x50e8('0x2e')]()[_0x50e8('0x2d')](function(){_0x5c2e04['status'](0xcc)[_0x50e8('0x24')]();});}};}function handleEntityNotFound(_0x4ec6ad,_0x3aec30){return function(_0x33fc5b){if(!_0x33fc5b){_0x4ec6ad[_0x50e8('0x2f')](0x194);}return _0x33fc5b;};}function handleError(_0x5e2c30,_0x306816){_0x306816=_0x306816||0x1f4;return function(_0x40f566){logger['error'](_0x40f566[_0x50e8('0x30')]);if(_0x40f566[_0x50e8('0x31')]){delete _0x40f566[_0x50e8('0x31')];}_0x5e2c30[_0x50e8('0x23')](_0x306816)['send'](_0x40f566);};}exports[_0x50e8('0x32')]=function(_0x40dbe8,_0x24d3ea){var _0x4e2a37={},_0x5e556c={},_0x3c7778={'count':0x0,'rows':[]};var _0x2d0ccf=_[_0x50e8('0x33')](db['Setting']['rawAttributes'],function(_0x5dff99){return{'name':_0x5dff99[_0x50e8('0x34')],'type':_0x5dff99[_0x50e8('0x35')][_0x50e8('0x36')]};});_0x5e556c[_0x50e8('0x37')]=_[_0x50e8('0x33')](_0x2d0ccf,_0x50e8('0x31'));_0x5e556c[_0x50e8('0x38')]=_[_0x50e8('0x39')](_0x40dbe8[_0x50e8('0x38')]);_0x5e556c[_0x50e8('0x3a')]=_['intersection'](_0x5e556c[_0x50e8('0x37')],_0x5e556c[_0x50e8('0x38')]);_0x4e2a37[_0x50e8('0x3b')]=_[_0x50e8('0x3c')](_0x5e556c['model'],qs[_0x50e8('0x3d')](_0x40dbe8[_0x50e8('0x38')][_0x50e8('0x3d')]));_0x4e2a37[_0x50e8('0x3b')]=_0x4e2a37[_0x50e8('0x3b')]['length']?_0x4e2a37['attributes']:_0x5e556c[_0x50e8('0x37')];if(!_0x40dbe8[_0x50e8('0x38')]['hasOwnProperty'](_0x50e8('0x3e'))){_0x4e2a37[_0x50e8('0x27')]=qs[_0x50e8('0x27')](_0x40dbe8[_0x50e8('0x38')][_0x50e8('0x27')]);_0x4e2a37[_0x50e8('0x25')]=qs[_0x50e8('0x25')](_0x40dbe8[_0x50e8('0x38')]['offset']);}_0x4e2a37[_0x50e8('0x3f')]=qs[_0x50e8('0x40')](_0x40dbe8[_0x50e8('0x38')][_0x50e8('0x40')]);_0x4e2a37['where']=qs[_0x50e8('0x3a')](_[_0x50e8('0x41')](_0x40dbe8[_0x50e8('0x38')],_0x5e556c[_0x50e8('0x3a')]),_0x2d0ccf);if(_0x40dbe8['query'][_0x50e8('0x42')]){_0x4e2a37['where']=_['merge'](_0x4e2a37['where'],{'$or':_[_0x50e8('0x33')](_0x2d0ccf,function(_0x30077f){if(_0x30077f['type']!==_0x50e8('0x43')){var _0x2007c4={};_0x2007c4[_0x30077f[_0x50e8('0x31')]]={'$like':'%'+_0x40dbe8[_0x50e8('0x38')][_0x50e8('0x42')]+'%'};return _0x2007c4;}})});}_0x4e2a37=_[_0x50e8('0x44')]({},_0x4e2a37,_0x40dbe8['options']);var _0x16fdf6={'where':_0x4e2a37['where']};return db[_0x50e8('0x45')][_0x50e8('0x46')](_0x16fdf6)['then'](function(_0xcac7c2){_0x3c7778['count']=_0xcac7c2;if(_0x40dbe8[_0x50e8('0x38')][_0x50e8('0x47')]){_0x4e2a37[_0x50e8('0x48')]=[{'all':!![]}];}return db[_0x50e8('0x45')][_0x50e8('0x49')](_0x4e2a37);})[_0x50e8('0x2d')](function(_0x229d60){_0x3c7778[_0x50e8('0x4a')]=_0x229d60;return _0x3c7778;})[_0x50e8('0x2d')](respondWithFilteredResult(_0x24d3ea,_0x4e2a37))[_0x50e8('0x22')](handleError(_0x24d3ea,null));};exports[_0x50e8('0x4b')]=function(_0x49bfa8,_0x179f6b){var _0x275a1b={'raw':![],'where':{'id':_0x49bfa8[_0x50e8('0x4c')]['id']}},_0x479431={};_0x479431['model']=_[_0x50e8('0x39')](db['Setting'][_0x50e8('0x4d')]);_0x479431[_0x50e8('0x38')]=_[_0x50e8('0x39')](_0x49bfa8[_0x50e8('0x38')]);_0x479431[_0x50e8('0x3a')]=_[_0x50e8('0x3c')](_0x479431[_0x50e8('0x37')],_0x479431['query']);_0x275a1b[_0x50e8('0x3b')]=_[_0x50e8('0x3c')](_0x479431[_0x50e8('0x37')],qs[_0x50e8('0x3d')](_0x49bfa8[_0x50e8('0x38')][_0x50e8('0x3d')]));_0x275a1b['attributes']=_0x275a1b[_0x50e8('0x3b')][_0x50e8('0x4e')]?_0x275a1b[_0x50e8('0x3b')]:_0x479431[_0x50e8('0x37')];if(_0x49bfa8['query'][_0x50e8('0x47')]){_0x275a1b[_0x50e8('0x48')]=[{'all':!![]}];}_0x275a1b=_[_0x50e8('0x44')]({},_0x275a1b,_0x49bfa8[_0x50e8('0x4f')]);return db[_0x50e8('0x45')][_0x50e8('0x50')](_0x275a1b)[_0x50e8('0x2d')](handleEntityNotFound(_0x179f6b,null))['then'](respondWithResult(_0x179f6b,null))['catch'](handleError(_0x179f6b,null));};exports['update']=function(_0x2b54ad,_0x1400e7){if(_0x2b54ad[_0x50e8('0x51')]['id']){delete _0x2b54ad[_0x50e8('0x51')]['id'];}return db[_0x50e8('0x45')][_0x50e8('0x50')]({'where':{'id':_0x2b54ad['params']['id']}})[_0x50e8('0x2d')](handleEntityNotFound(_0x1400e7,null))[_0x50e8('0x2d')](saveUpdates(_0x2b54ad[_0x50e8('0x51')],null))[_0x50e8('0x2d')](respondWithResult(_0x1400e7,null))['catch'](handleError(_0x1400e7,null));};exports[_0x50e8('0x52')]=function(_0xf773fd,_0x373b41,_0x1cc5ba){if(_0xf773fd[_0x50e8('0x53')]&&_0xf773fd[_0x50e8('0x53')]['filename']){_0xf773fd[_0x50e8('0x51')]['logo']=_0xf773fd['file']['filename'];}return db[_0x50e8('0x45')]['find']({'where':{'id':_0xf773fd[_0x50e8('0x4c')]['id']}})[_0x50e8('0x2d')](handleEntityNotFound(_0x373b41,null))[_0x50e8('0x2d')](saveUpdates(_0xf773fd[_0x50e8('0x51')],null))[_0x50e8('0x2d')](respondWithResult(_0x373b41,null))[_0x50e8('0x22')](handleError(_0x373b41,null));};exports[_0x50e8('0x54')]=function(_0x59cdf2,_0x26ab46,_0x42f1ed){if(_0x59cdf2[_0x50e8('0x53')]&&_0x59cdf2['file']['filename']){_0x59cdf2['body'][_0x50e8('0x55')]=_0x59cdf2[_0x50e8('0x53')][_0x50e8('0x56')];}return db[_0x50e8('0x45')][_0x50e8('0x50')]({'where':{'id':_0x59cdf2[_0x50e8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26ab46,null))[_0x50e8('0x2d')](saveUpdates(_0x59cdf2['body'],null))[_0x50e8('0x2d')](respondWithResult(_0x26ab46,null))[_0x50e8('0x22')](handleError(_0x26ab46,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x51775a,_0x2eed72,_0x3588f0){var _0x5d1fc8=_0x50e8('0x57');var _0xb2d01a={'custom':![]};return utilLicense[_0x50e8('0x58')]()[_0x50e8('0x2d')](function(_0x71bf27){if(_0x71bf27){_0xb2d01a=_0x71bf27;}return db['Setting'][_0x50e8('0x50')]({'where':{'id':_0x51775a[_0x50e8('0x4c')]['id']},'attributes':[_0x50e8('0x59'),'loginLogo','preferred',_0x50e8('0x5a'),_0x50e8('0x5b'),_0x50e8('0x5c'),_0x50e8('0x5d'),_0x50e8('0x5e')],'raw':!![]});})[_0x50e8('0x2d')](handleEntityNotFound(_0x2eed72,null))['then'](function(_0x51ffae){if(_0x51ffae){var _0x127190=_0x51ffae['logo']&&fs[_0x50e8('0x5f')](path[_0x50e8('0x60')](config['root'],_0x5d1fc8,_[_0x50e8('0x61')](_0x51ffae['logo'])))?path['join'](config['root'],_0x5d1fc8,_[_0x50e8('0x61')](_0x51ffae[_0x50e8('0x59')])):path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x5d1fc8,_['toLower']('default_logo.svg'));var _0x25d89e=_0x50e8('0x63')+_[_0x50e8('0x64')](_0x50e8('0x59'));if(_0x51ffae[_0x25d89e]||!_0xb2d01a[_0x50e8('0x65')]){_0x127190=path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x5d1fc8,_[_0x50e8('0x61')](_0x50e8('0x66')));}if(!fs[_0x50e8('0x5f')](_0x127190)){throw new db[(_0x50e8('0x67'))][(_0x50e8('0x68'))](_[_0x50e8('0x64')](_0x50e8('0x59'))+_0x50e8('0x69'));}return _0x2eed72[_0x50e8('0x6a')](_0x127190);}})[_0x50e8('0x22')](handleError(_0x2eed72,null));};var utilLicense=require(_0x50e8('0x6b'));exports['getLogoLogin']=function(_0x35a382,_0x474978,_0xd9e82e){var _0x2359c2='server/files/images/logos';var _0x2e6992={'custom':![]};return utilLicense[_0x50e8('0x58')]()[_0x50e8('0x2d')](function(_0x161a07){if(_0x161a07){_0x2e6992=_0x161a07;}return db[_0x50e8('0x45')][_0x50e8('0x50')]({'where':{'id':_0x35a382['params']['id']},'attributes':[_0x50e8('0x59'),_0x50e8('0x55'),_0x50e8('0x6c'),_0x50e8('0x5a'),'defaultLogo',_0x50e8('0x5c'),'defaultPreferred',_0x50e8('0x5e')],'raw':!![]});})[_0x50e8('0x2d')](handleEntityNotFound(_0x474978,null))[_0x50e8('0x2d')](function(_0x1637b2){if(_0x1637b2){var _0x3b1aea=_0x1637b2['loginLogo']&&fs[_0x50e8('0x5f')](path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x2359c2,_[_0x50e8('0x61')](_0x1637b2[_0x50e8('0x55')])))?path[_0x50e8('0x60')](config['root'],_0x2359c2,_[_0x50e8('0x61')](_0x1637b2[_0x50e8('0x55')])):path['join'](config[_0x50e8('0x62')],_0x2359c2,_[_0x50e8('0x61')]('default_loginLogo.svg'));var _0x3d56e7='default'+_[_0x50e8('0x64')](_0x50e8('0x55'));if(_0x1637b2[_0x3d56e7]||!_0x2e6992['custom']){_0x3b1aea=path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x2359c2,_[_0x50e8('0x61')](_0x50e8('0x6d')));}if(!fs['existsSync'](_0x3b1aea)){throw new db[(_0x50e8('0x67'))]['ValidationError'](_[_0x50e8('0x64')](_0x50e8('0x55'))+'\x20not\x20found');}return _0x474978[_0x50e8('0x6a')](_0x3b1aea);}})[_0x50e8('0x22')](handleError(_0x474978,null));};exports[_0x50e8('0x6e')]=function(_0x2ea86b,_0x223355){return db[_0x50e8('0x45')][_0x50e8('0x50')]({'where':{'id':_0x2ea86b[_0x50e8('0x4c')]['id']},'attributes':[_0x50e8('0x6f')]})['then'](respondWithResult(_0x223355,null))[_0x50e8('0x22')](handleError(_0x223355,null));};exports[_0x50e8('0x70')]=function(_0x38c8ef,_0x5a79c4,_0x7d64e0){if(_0x38c8ef[_0x50e8('0x53')]&&_0x38c8ef[_0x50e8('0x53')]['filename']){_0x38c8ef['body'][_0x50e8('0x6c')]=_0x38c8ef[_0x50e8('0x53')]['filename'];}return db[_0x50e8('0x45')]['find']({'where':{'id':_0x38c8ef[_0x50e8('0x4c')]['id']}})[_0x50e8('0x2d')](handleEntityNotFound(_0x5a79c4,null))[_0x50e8('0x2d')](saveUpdates(_0x38c8ef[_0x50e8('0x51')],null))['then'](respondWithResult(_0x5a79c4,null))[_0x50e8('0x22')](handleError(_0x5a79c4,null));};var utilLicense=require('../../config/license/util');exports[_0x50e8('0x71')]=function(_0x51ea2a,_0x55d39f,_0x368d17){var _0x37429f='server/files/images/logos';var _0x18c2af={'custom':![]};return utilLicense['getLicense']()[_0x50e8('0x2d')](function(_0x585a79){if(_0x585a79){_0x18c2af=_0x585a79;}return db['Setting'][_0x50e8('0x50')]({'where':{'id':_0x51ea2a[_0x50e8('0x4c')]['id']},'attributes':[_0x50e8('0x59'),_0x50e8('0x55'),'preferred',_0x50e8('0x5a'),'defaultLogo','defaultLoginLogo',_0x50e8('0x5d'),_0x50e8('0x5e')],'raw':!![]});})[_0x50e8('0x2d')](handleEntityNotFound(_0x55d39f,null))['then'](function(_0x4f6906){if(_0x4f6906){var _0x4fe69f=_0x4f6906[_0x50e8('0x6c')]&&fs[_0x50e8('0x5f')](path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x37429f,_[_0x50e8('0x61')](_0x4f6906[_0x50e8('0x6c')])))?path['join'](config['root'],_0x37429f,_[_0x50e8('0x61')](_0x4f6906[_0x50e8('0x6c')])):path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x37429f,_[_0x50e8('0x61')]('default_preferred.png'));var _0x38a3da=_0x50e8('0x63')+_[_0x50e8('0x64')]('preferred');if(_0x4f6906[_0x38a3da]||!_0x18c2af['custom']||!_0x18c2af[_0x50e8('0x6c')]){_0x4fe69f=path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x37429f,_['toLower'](_0x50e8('0x72')));}if(!fs[_0x50e8('0x5f')](_0x4fe69f)){throw new db['Sequelize'][(_0x50e8('0x68'))](_['upperFirst'](_0x50e8('0x6c'))+_0x50e8('0x69'));}return _0x55d39f[_0x50e8('0x6a')](_0x4fe69f);}})[_0x50e8('0x22')](handleError(_0x55d39f,null));};exports[_0x50e8('0x73')]=function(_0x2f6815,_0x1c4f8f,_0x323e9f){if(_0x2f6815[_0x50e8('0x53')]&&_0x2f6815['file'][_0x50e8('0x56')]){_0x2f6815['body'][_0x50e8('0x5a')]=_0x2f6815[_0x50e8('0x53')][_0x50e8('0x56')];}return db[_0x50e8('0x45')][_0x50e8('0x50')]({'where':{'id':_0x2f6815[_0x50e8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1c4f8f,null))[_0x50e8('0x2d')](saveUpdates(_0x2f6815[_0x50e8('0x51')],null))[_0x50e8('0x2d')](respondWithResult(_0x1c4f8f,null))[_0x50e8('0x22')](handleError(_0x1c4f8f,null));};var utilLicense=require(_0x50e8('0x6b'));exports[_0x50e8('0x74')]=function(_0x4182f2,_0x5e399c,_0x1f576a){var _0x4253e8=_0x50e8('0x57');var _0xc55fb5={'custom':![]};return utilLicense[_0x50e8('0x58')]()[_0x50e8('0x2d')](function(_0x2cec01){if(_0x2cec01){_0xc55fb5=_0x2cec01;}return db[_0x50e8('0x45')]['find']({'where':{'id':_0x4182f2['params']['id']},'attributes':['logo',_0x50e8('0x55'),'preferred',_0x50e8('0x5a'),_0x50e8('0x5b'),_0x50e8('0x5c'),_0x50e8('0x5d'),_0x50e8('0x5e')],'raw':!![]});})[_0x50e8('0x2d')](handleEntityNotFound(_0x5e399c,null))[_0x50e8('0x2d')](function(_0x101d46){if(_0x101d46){var _0x351ece=_0x101d46[_0x50e8('0x5a')]&&fs[_0x50e8('0x5f')](path['join'](config[_0x50e8('0x62')],_0x4253e8,_[_0x50e8('0x61')](_0x101d46['favicon'])))?path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x4253e8,_[_0x50e8('0x61')](_0x101d46[_0x50e8('0x5a')])):path['join'](config[_0x50e8('0x62')],_0x4253e8,_[_0x50e8('0x61')]('default_favicon.ico'));var _0x20cdb1='default'+_[_0x50e8('0x64')](_0x50e8('0x5a'));if(_0x101d46[_0x20cdb1]||!_0xc55fb5[_0x50e8('0x65')]){_0x351ece=path[_0x50e8('0x60')](config[_0x50e8('0x62')],_0x4253e8,_[_0x50e8('0x61')](_0x50e8('0x75')));}if(!fs[_0x50e8('0x5f')](_0x351ece)){throw new db[(_0x50e8('0x67'))]['ValidationError'](_[_0x50e8('0x64')](_0x50e8('0x5a'))+_0x50e8('0x69'));}return _0x5e399c['download'](_0x351ece);}})[_0x50e8('0x22')](handleError(_0x5e399c,null));};exports[_0x50e8('0x76')]=function(_0xa8c6b2,_0x2850a1){var _0x5a4e02={'offset':moment()['utcOffset']()};_0x5a4e02[_0x50e8('0x77')]=moment()[_0x50e8('0x78')](_0x5a4e02[_0x50e8('0x25')])[_0x50e8('0x79')](_0x50e8('0x7a'));return _0x2850a1['status'](0xc8)[_0x50e8('0x7b')](_0x5a4e02);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e93389c..5c0c6f8 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x2f634a,_0x3ac1ad){var _0x1b09a2=function(_0x41595e){while(--_0x41595e){_0x2f634a['push'](_0x2f634a['shift']());}};_0x1b09a2(++_0x3ac1ad);}(_0xedd9,0xfc));var _0x9edd=function(_0x12b4fe,_0x2a28cf){_0x12b4fe=_0x12b4fe-0x0;var _0x228076=_0xedd9[_0x12b4fe];return _0x228076;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','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 55702a7..fc87dd7 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 _0x0788=['info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x2d1599,_0x1fc8f){var _0x536be3=function(_0x188686){while(--_0x188686){_0x2d1599['push'](_0x2d1599['shift']());}};_0x536be3(++_0x1fc8f);}(_0x0788,0x133));var _0x8078=function(_0x5596e8,_0x2d6883){_0x5596e8=_0x5596e8-0x0;var _0x2f2533=_0x0788[_0x5596e8];return _0x2f2533;};'use strict';var _=require(_0x8078('0x0'));var util=require(_0x8078('0x1'));var moment=require(_0x8078('0x2'));var BPromise=require(_0x8078('0x3'));var rs=require(_0x8078('0x4'));var fs=require('fs');var Redis=require(_0x8078('0x5'));var db=require(_0x8078('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8078('0x7'))(_0x8078('0x8'));var config=require(_0x8078('0x9'));var jayson=require(_0x8078('0xa'));var client=jayson['client'][_0x8078('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219fde,_0x2732f3,_0x56a66b){return new BPromise(function(_0x34aa16,_0x14d452){return client['request'](_0x219fde,_0x56a66b)[_0x8078('0xc')](function(_0x4546a3){logger[_0x8078('0xd')](_0x8078('0xe'),_0x2732f3,_0x8078('0xf'));logger[_0x8078('0x10')](_0x8078('0x11'),_0x2732f3,'request\x20sent',JSON[_0x8078('0x12')](_0x4546a3));if(_0x4546a3[_0x8078('0x13')]){if(_0x4546a3[_0x8078('0x13')]['code']===0x1f4){logger[_0x8078('0x13')](_0x8078('0xe'),_0x2732f3,_0x4546a3['error']['message']);return _0x14d452(_0x4546a3['error'][_0x8078('0x14')]);}logger['error']('Setting,\x20%s,\x20%s',_0x2732f3,_0x4546a3[_0x8078('0x13')][_0x8078('0x14')]);return _0x34aa16(_0x4546a3[_0x8078('0x13')][_0x8078('0x14')]);}else{logger[_0x8078('0xd')](_0x8078('0xe'),_0x2732f3,_0x8078('0xf'));_0x34aa16(_0x4546a3[_0x8078('0x15')][_0x8078('0x14')]);}})[_0x8078('0x16')](function(_0x34be57){logger[_0x8078('0x13')]('Setting,\x20%s,\x20%s',_0x2732f3,_0x34be57);_0x14d452(_0x34be57);});});}exports[_0x8078('0x17')]=function(_0x4c64e4){var _0x4fe90f=this;return new Promise(function(_0x27c391,_0x5da782){return db[_0x8078('0x18')][_0x8078('0x19')]({'raw':_0x4c64e4[_0x8078('0x1a')]?_0x4c64e4[_0x8078('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4c64e4[_0x8078('0x1a')]?_0x4c64e4[_0x8078('0x1a')][_0x8078('0x1b')]||null:null,'attributes':_0x4c64e4[_0x8078('0x1a')]?_0x4c64e4['options'][_0x8078('0x1c')]||null:null,'include':_0x4c64e4['options']?_0x4c64e4[_0x8078('0x1a')][_0x8078('0x1d')]?_[_0x8078('0x1e')](_0x4c64e4[_0x8078('0x1a')][_0x8078('0x1d')],function(_0x4f4587){return{'model':db[_0x4f4587[_0x8078('0x1f')]],'as':_0x4f4587['as'],'attributes':_0x4f4587[_0x8078('0x1c')],'include':_0x4f4587[_0x8078('0x1d')]?_[_0x8078('0x1e')](_0x4f4587[_0x8078('0x1d')],function(_0x4a8391){return{'model':db[_0x4a8391[_0x8078('0x1f')]],'as':_0x4a8391['as'],'attributes':_0x4a8391['attributes'],'include':_0x4a8391[_0x8078('0x1d')]?_[_0x8078('0x1e')](_0x4a8391[_0x8078('0x1d')],function(_0x506b57){return{'model':db[_0x506b57['model']],'as':_0x506b57['as'],'attributes':_0x506b57[_0x8078('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb1dd2f){logger[_0x8078('0xd')]('ShowSetting',_0x4c64e4);logger[_0x8078('0x10')]('ShowSetting',_0x4c64e4,JSON['stringify'](_0xb1dd2f));_0x27c391(_0xb1dd2f);})[_0x8078('0x16')](function(_0x4875f5){logger['error']('ShowSetting',_0x4875f5[_0x8078('0x14')],_0x4c64e4);_0x5da782(_0x4fe90f[_0x8078('0x13')](0x1f4,_0x4875f5[_0x8078('0x14')]));});});}; \ No newline at end of file +var _0x8b87=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','map','include','model','stringify','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x494df3,_0xb1231a){var _0x494949=function(_0x5bd4cc){while(--_0x5bd4cc){_0x494df3['push'](_0x494df3['shift']());}};_0x494949(++_0xb1231a);}(_0x8b87,0xdb));var _0x78b8=function(_0x1a1947,_0x54798f){_0x1a1947=_0x1a1947-0x0;var _0x5781ec=_0x8b87[_0x1a1947];return _0x5781ec;};'use strict';var _=require(_0x78b8('0x0'));var util=require('util');var moment=require(_0x78b8('0x1'));var BPromise=require(_0x78b8('0x2'));var rs=require(_0x78b8('0x3'));var fs=require('fs');var Redis=require(_0x78b8('0x4'));var db=require(_0x78b8('0x5'))['db'];var utils=require(_0x78b8('0x6'));var logger=require(_0x78b8('0x7'))('rpc');var config=require(_0x78b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x78b8('0x9')][_0x78b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x384b91,_0x1c34ea,_0x1b5a3d){return new BPromise(function(_0x25cd9b,_0x3c4c43){return client[_0x78b8('0xb')](_0x384b91,_0x1b5a3d)['then'](function(_0x458f0b){logger[_0x78b8('0xc')]('Setting,\x20%s,\x20%s',_0x1c34ea,_0x78b8('0xd'));logger[_0x78b8('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x1c34ea,_0x78b8('0xd'),JSON['stringify'](_0x458f0b));if(_0x458f0b[_0x78b8('0xf')]){if(_0x458f0b[_0x78b8('0xf')][_0x78b8('0x10')]===0x1f4){logger[_0x78b8('0xf')](_0x78b8('0x11'),_0x1c34ea,_0x458f0b[_0x78b8('0xf')][_0x78b8('0x12')]);return _0x3c4c43(_0x458f0b['error'][_0x78b8('0x12')]);}logger['error'](_0x78b8('0x11'),_0x1c34ea,_0x458f0b['error'][_0x78b8('0x12')]);return _0x25cd9b(_0x458f0b[_0x78b8('0xf')][_0x78b8('0x12')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x1c34ea,_0x78b8('0xd'));_0x25cd9b(_0x458f0b[_0x78b8('0x13')][_0x78b8('0x12')]);}})[_0x78b8('0x14')](function(_0x1accce){logger[_0x78b8('0xf')]('Setting,\x20%s,\x20%s',_0x1c34ea,_0x1accce);_0x3c4c43(_0x1accce);});});}exports[_0x78b8('0x15')]=function(_0x19cfe3){var _0x4c88f6=this;return new Promise(function(_0x1cd4d5,_0x5f5816){return db[_0x78b8('0x16')][_0x78b8('0x17')]({'raw':_0x19cfe3['options']?_0x19cfe3[_0x78b8('0x18')][_0x78b8('0x19')]===undefined?!![]:![]:!![],'where':_0x19cfe3[_0x78b8('0x18')]?_0x19cfe3[_0x78b8('0x18')][_0x78b8('0x1a')]||null:null,'attributes':_0x19cfe3[_0x78b8('0x18')]?_0x19cfe3[_0x78b8('0x18')][_0x78b8('0x1b')]||null:null,'include':_0x19cfe3[_0x78b8('0x18')]?_0x19cfe3['options']['include']?_[_0x78b8('0x1c')](_0x19cfe3[_0x78b8('0x18')]['include'],function(_0x3fd95a){return{'model':db[_0x3fd95a['model']],'as':_0x3fd95a['as'],'attributes':_0x3fd95a[_0x78b8('0x1b')],'include':_0x3fd95a[_0x78b8('0x1d')]?_[_0x78b8('0x1c')](_0x3fd95a['include'],function(_0x5060d6){return{'model':db[_0x5060d6['model']],'as':_0x5060d6['as'],'attributes':_0x5060d6['attributes'],'include':_0x5060d6[_0x78b8('0x1d')]?_[_0x78b8('0x1c')](_0x5060d6['include'],function(_0x1b1d55){return{'model':db[_0x1b1d55[_0x78b8('0x1e')]],'as':_0x1b1d55['as'],'attributes':_0x1b1d55[_0x78b8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2181c4){logger[_0x78b8('0xc')](_0x78b8('0x15'),_0x19cfe3);logger[_0x78b8('0xe')](_0x78b8('0x15'),_0x19cfe3,JSON[_0x78b8('0x1f')](_0x2181c4));_0x1cd4d5(_0x2181c4);})[_0x78b8('0x14')](function(_0x171576){logger[_0x78b8('0xf')](_0x78b8('0x15'),_0x171576[_0x78b8('0x12')],_0x19cfe3);_0x5f5816(_0x4c88f6['error'](0x1f4,_0x171576[_0x78b8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 97d8356..e2d6638 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x2e84ee,_0x283c59){var _0x5c82d0=function(_0x9cf8ca){while(--_0x9cf8ca){_0x2e84ee['push'](_0x2e84ee['shift']());}};_0x5c82d0(++_0x283c59);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +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(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0x814b,0x1a2));var _0xb814=function(_0x509083,_0xa6676b){_0x509083=_0x509083-0x0;var _0x4b2495=_0x814b[_0x509083];return _0x4b2495;};'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 diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ab186ab..bf51776 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 _0xb9ff=['ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','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','randomstring','name','STRING','generate'];(function(_0x4dcac4,_0x10e48a){var _0x2a238d=function(_0x25c6fc){while(--_0x25c6fc){_0x4dcac4['push'](_0x4dcac4['shift']());}};_0x2a238d(++_0x10e48a);}(_0xb9ff,0x1b4));var _0xfb9f=function(_0xfb7636,_0x4d0595){_0xfb7636=_0xfb7636-0x0;var _0x33218d=_0xb9ff[_0xfb7636];return _0x33218d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfb9f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xfb9f('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xfb9f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xfb9f('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfb9f('0x3')]();}},'phone':{'type':Sequelize[_0xfb9f('0x2')]},'type':{'type':Sequelize[_0xfb9f('0x4')](_0xfb9f('0x5'),_0xfb9f('0x6'),_0xfb9f('0x7'),_0xfb9f('0x8'),'plivo',_0xfb9f('0x9'),_0xfb9f('0xa'),_0xfb9f('0xb'),_0xfb9f('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0xfb9f('0x2')]},'authId':{'type':Sequelize[_0xfb9f('0x2')]},'authToken':{'type':Sequelize[_0xfb9f('0x2')]},'smsMethod':{'type':Sequelize[_0xfb9f('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfb9f('0x2')]},'password':{'type':Sequelize[_0xfb9f('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xfb9f('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xfb9f('0x2')]},'deliveryReport':{'type':Sequelize[_0xfb9f('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xfb9f('0x2')]},'notificationTemplate':{'type':Sequelize[_0xfb9f('0xe')],'defaultValue':function(){return _0xfb9f('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb9f('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb9f('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb9f('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb9f('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfb9f('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb9f('0x10')],'comment':_0xfb9f('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfb9f('0x12'),'set':function(_0x1d4c8a){if(!_0x1d4c8a)this[_0xfb9f('0x13')](_0xfb9f('0x14'),null);this[_0xfb9f('0x13')](_0xfb9f('0x15'),_0x1d4c8a);}}}; \ No newline at end of file +var _0x14a1=['clickatell','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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo'];(function(_0x368646,_0x98de3d){var _0x9338b7=function(_0x23174e){while(--_0x23174e){_0x368646['push'](_0x368646['shift']());}};_0x9338b7(++_0x98de3d);}(_0x14a1,0x1ee));var _0x114a=function(_0x14b029,_0x27910d){_0x14b029=_0x14b029-0x0;var _0x3cd279=_0x14a1[_0x14b029];return _0x3cd279;};'use strict';var Sequelize=require(_0x114a('0x0'));var rs=require(_0x114a('0x1'));module[_0x114a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x114a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x114a('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x114a('0x5')]();}},'phone':{'type':Sequelize[_0x114a('0x4')]},'type':{'type':Sequelize[_0x114a('0x6')](_0x114a('0x7'),_0x114a('0x8'),_0x114a('0x9'),_0x114a('0xa'),_0x114a('0xb'),_0x114a('0xc'),'bandwidth','csc',_0x114a('0xd'),_0x114a('0xe'))},'accountSid':{'type':Sequelize[_0x114a('0x4')]},'authId':{'type':Sequelize[_0x114a('0x4')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x114a('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x114a('0x4')]},'applicationId':{'type':Sequelize[_0x114a('0x4')]},'accountId':{'type':Sequelize[_0x114a('0x4')]},'senderString':{'type':Sequelize[_0x114a('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x114a('0x4')]},'notificationTemplate':{'type':Sequelize[_0x114a('0xf')],'defaultValue':function(){return _0x114a('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x114a('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x114a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x114a('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x114a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x114a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x114a('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x114a('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x114a('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x114a('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x6699c){if(!_0x6699c)this['setDataValue'](_0x114a('0x14'),null);this['setDataValue'](_0x114a('0x15'),_0x6699c);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 3e8d666..08b38cb 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 _0x34d9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','rawAttributes','removeAnswers','notify','sms','account','applications','orderBy','Applications','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','clicksend','message_id','plivo','Text','infobip','results','csc','segmentedMessage','bandwidth','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','List','out','SmsMessage','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','type','key','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','SmsAccount','includeAll','include','findAll','rows','show','params','model','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34d9,0x8c));var _0x934d=function(_0x2c1e09,_0x3cc278){_0x2c1e09=_0x2c1e09-0x0;var _0x132611=_0x34d9[_0x2c1e09];return _0x132611;};'use strict';var emlformat=require(_0x934d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x934d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x934d('0x2'));var BPromise=require(_0x934d('0x3'));var Mustache=require('mustache');var util=require(_0x934d('0x4'));var path=require(_0x934d('0x5'));var sox=require(_0x934d('0x6'));var csv=require(_0x934d('0x7'));var ejs=require(_0x934d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x934d('0x9'));var squel=require(_0x934d('0xa'));var crypto=require('crypto');var jsforce=require(_0x934d('0xb'));var deskjs=require(_0x934d('0xc'));var toCsv=require(_0x934d('0x7'));var querystring=require('querystring');var Papa=require(_0x934d('0xd'));var Redis=require(_0x934d('0xe'));var authService=require(_0x934d('0xf'));var qs=require(_0x934d('0x10'));var as=require(_0x934d('0x11'));var hardwareService=require(_0x934d('0x12'));var logger=require(_0x934d('0x13'))(_0x934d('0x14'));var utils=require(_0x934d('0x15'));var config=require(_0x934d('0x16'));var licenseUtil=require(_0x934d('0x17'));var db=require(_0x934d('0x18'))['db'];config[_0x934d('0x19')]=_[_0x934d('0x1a')](config[_0x934d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x934d('0x1b'))(new Redis(config[_0x934d('0x19')]));require(_0x934d('0x1c'))['register'](socket);var jayson=require(_0x934d('0x1d'));var client=jayson[_0x934d('0x1e')][_0x934d('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x42af7e,_0x19798b,_0x59ebbd,_0x1b1587){return new BPromise(function(_0x3bcf02,_0x8222c4){var _0x17240a=_0x1b1587||client;return _0x17240a[_0x934d('0x20')](_0x42af7e,_0x59ebbd)[_0x934d('0x21')](function(_0x42e96e){logger[_0x934d('0x22')]('SmsAccount,\x20%s,\x20%s',_0x19798b,'request\x20sent');logger[_0x934d('0x23')](_0x934d('0x24'),_0x19798b,_0x934d('0x25'),JSON['stringify'](_0x42e96e));if(_0x42e96e[_0x934d('0x26')]){if(_0x42e96e[_0x934d('0x26')]['code']===0x1f4){logger['error'](_0x934d('0x27'),_0x19798b,_0x42e96e['error'][_0x934d('0x28')]);return _0x8222c4(_0x42e96e[_0x934d('0x26')][_0x934d('0x28')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x19798b,_0x42e96e['error'][_0x934d('0x28')]);return _0x3bcf02(_0x42e96e['error'][_0x934d('0x28')]);}else{logger[_0x934d('0x22')]('SmsAccount,\x20%s,\x20%s',_0x19798b,'request\x20sent');_0x3bcf02(_0x42e96e[_0x934d('0x29')][_0x934d('0x28')]);}})[_0x934d('0x2a')](function(_0x4ef2e3){logger[_0x934d('0x26')](_0x934d('0x27'),_0x19798b,_0x4ef2e3);_0x8222c4(_0x4ef2e3);});});}function respondWithStatusCode(_0x2ea891,_0x57bd67){_0x57bd67=_0x57bd67||0xcc;return function(_0x390d25){if(_0x390d25){return _0x2ea891[_0x934d('0x2b')](_0x57bd67);}return _0x2ea891[_0x934d('0x2c')](_0x57bd67)[_0x934d('0x2d')]();};}function respondWithResult(_0x3b10c8,_0x34bf5c){_0x34bf5c=_0x34bf5c||0xc8;return function(_0x19e5a8){if(_0x19e5a8){return _0x3b10c8[_0x934d('0x2c')](_0x34bf5c)['json'](_0x19e5a8);}};}function respondWithFilteredResult(_0x20bcd6,_0x52927c){return function(_0x337b75){if(_0x337b75){var _0x40076a=typeof _0x52927c[_0x934d('0x2e')]===_0x934d('0x2f')&&typeof _0x52927c['limit']===_0x934d('0x2f');var _0x46b60d=_0x337b75[_0x934d('0x30')];var _0x4b9c1f=_0x40076a?0x0:_0x52927c[_0x934d('0x2e')];var _0x20bd43=_0x40076a?_0x337b75['count']:_0x52927c[_0x934d('0x2e')]+_0x52927c[_0x934d('0x31')];var _0x238478;if(_0x20bd43>=_0x46b60d){_0x20bd43=_0x46b60d;_0x238478=0xc8;}else{_0x238478=0xce;}_0x20bcd6[_0x934d('0x2c')](_0x238478);return _0x20bcd6[_0x934d('0x32')]('Content-Range',_0x4b9c1f+'-'+_0x20bd43+'/'+_0x46b60d)[_0x934d('0x33')](_0x337b75);}return null;};}function patchUpdates(_0x2cfe12){return function(_0x27f629){try{jsonpatch[_0x934d('0x34')](_0x27f629,_0x2cfe12,!![]);}catch(_0x2d0200){return BPromise[_0x934d('0x35')](_0x2d0200);}return _0x27f629['save']();};}function saveUpdates(_0x79f5a7,_0x209faf){return function(_0xc59dda){if(_0xc59dda){return _0xc59dda['update'](_0x79f5a7)[_0x934d('0x21')](function(_0x428861){return _0x428861;});}return null;};}function removeEntity(_0x44bb85,_0x529a03){return function(_0x3e3833){if(_0x3e3833){return _0x3e3833[_0x934d('0x36')]()['then'](function(){var _0x532cec=_0x3e3833[_0x934d('0x37')]({'plain':!![]});var _0x48baee=_0x934d('0x38');return db[_0x934d('0x39')][_0x934d('0x36')]({'where':{'type':_0x48baee,'resourceId':_0x532cec['id']}})['then'](function(){return _0x3e3833;});})[_0x934d('0x21')](function(){_0x44bb85[_0x934d('0x2c')](0xcc)[_0x934d('0x2d')]();});}};}function handleEntityNotFound(_0x844a99,_0x19ae8e){return function(_0x56cd0b){if(!_0x56cd0b){_0x844a99[_0x934d('0x2b')](0x194);}return _0x56cd0b;};}function handleError(_0x3ebdaa,_0xe3f4e1){_0xe3f4e1=_0xe3f4e1||0x1f4;return function(_0x586ee3){logger['error'](_0x586ee3[_0x934d('0x3a')]);if(_0x586ee3[_0x934d('0x3b')]){delete _0x586ee3['name'];}_0x3ebdaa[_0x934d('0x2c')](_0xe3f4e1)[_0x934d('0x3c')](_0x586ee3);};}exports[_0x934d('0x3d')]=function(_0x20e13c,_0x1365f9){var _0x25430f={'include':[{'model':db[_0x934d('0x3e')],'as':_0x934d('0x3f')}]},_0x4fe732={},_0x2c8714={'count':0x0,'rows':[]};var _0x1d2e9d=_[_0x934d('0x40')](db['SmsAccount']['rawAttributes'],function(_0x117455){return{'name':_0x117455['fieldName'],'type':_0x117455[_0x934d('0x41')][_0x934d('0x42')]};});_0x4fe732['model']=_[_0x934d('0x40')](_0x1d2e9d,_0x934d('0x3b'));_0x4fe732['query']=_[_0x934d('0x43')](_0x20e13c[_0x934d('0x44')]);_0x4fe732[_0x934d('0x45')]=_['intersection'](_0x4fe732['model'],_0x4fe732[_0x934d('0x44')]);_0x25430f[_0x934d('0x46')]=_[_0x934d('0x47')](_0x4fe732['model'],qs[_0x934d('0x48')](_0x20e13c[_0x934d('0x44')]['fields']));_0x25430f[_0x934d('0x46')]=_0x25430f[_0x934d('0x46')][_0x934d('0x49')]?_0x25430f['attributes']:_0x4fe732['model'];if(!_0x20e13c[_0x934d('0x44')][_0x934d('0x4a')]('nolimit')){_0x25430f['limit']=qs['limit'](_0x20e13c[_0x934d('0x44')]['limit']);_0x25430f[_0x934d('0x2e')]=qs[_0x934d('0x2e')](_0x20e13c[_0x934d('0x44')][_0x934d('0x2e')]);}_0x25430f[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x20e13c['query']['sort']);_0x25430f['where']=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x20e13c[_0x934d('0x44')],_0x4fe732[_0x934d('0x45')]),_0x1d2e9d);if(_0x20e13c['query']['filter']){_0x25430f[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x25430f['where'],{'$or':_[_0x934d('0x40')](_0x1d2e9d,function(_0x423f3a){if(_0x423f3a[_0x934d('0x41')]!==_0x934d('0x50')){var _0x168d18={};_0x168d18[_0x423f3a['name']]={'$like':'%'+_0x20e13c[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x168d18;}})});}_0x25430f=_[_0x934d('0x4f')]({},_0x25430f,_0x20e13c[_0x934d('0x52')]);var _0x142712={'where':_0x25430f[_0x934d('0x4e')]};return db[_0x934d('0x53')][_0x934d('0x30')](_0x142712)[_0x934d('0x21')](function(_0x4c5bd3){_0x2c8714[_0x934d('0x30')]=_0x4c5bd3;if(_0x20e13c['query'][_0x934d('0x54')]){_0x25430f[_0x934d('0x55')]=[{'all':!![]}];}return db[_0x934d('0x53')][_0x934d('0x56')](_0x25430f);})['then'](function(_0x34dc36){_0x2c8714[_0x934d('0x57')]=_0x34dc36;return _0x2c8714;})[_0x934d('0x21')](respondWithFilteredResult(_0x1365f9,_0x25430f))[_0x934d('0x2a')](handleError(_0x1365f9,null));};exports[_0x934d('0x58')]=function(_0x43d09d,_0x4c8b2e){var _0x260401={'raw':![],'where':{'id':_0x43d09d[_0x934d('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x934d('0x3f')}]},_0x47f553={};_0x47f553['model']=_[_0x934d('0x43')](db[_0x934d('0x53')]['rawAttributes']);_0x47f553[_0x934d('0x44')]=_[_0x934d('0x43')](_0x43d09d[_0x934d('0x44')]);_0x47f553['filters']=_[_0x934d('0x47')](_0x47f553[_0x934d('0x5a')],_0x47f553[_0x934d('0x44')]);_0x260401[_0x934d('0x46')]=_[_0x934d('0x47')](_0x47f553[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x43d09d[_0x934d('0x44')][_0x934d('0x48')]));_0x260401[_0x934d('0x46')]=_0x260401['attributes'][_0x934d('0x49')]?_0x260401['attributes']:_0x47f553[_0x934d('0x5a')];if(_0x43d09d[_0x934d('0x44')][_0x934d('0x54')]){_0x260401[_0x934d('0x55')]=[{'all':!![]}];}_0x260401=_[_0x934d('0x4f')]({},_0x260401,_0x43d09d['options']);return db[_0x934d('0x53')][_0x934d('0x5b')](_0x260401)['then'](handleEntityNotFound(_0x4c8b2e,null))[_0x934d('0x21')](respondWithResult(_0x4c8b2e,null))[_0x934d('0x2a')](handleError(_0x4c8b2e,null));};exports[_0x934d('0x5c')]=function(_0x923d2,_0x1d1709){return db['SmsAccount']['create'](_0x923d2['body'],{})[_0x934d('0x21')](function(_0x1bc0e9){var _0x11b26a=_0x923d2['user']['get']({'plain':!![]});if(!_0x11b26a)throw new Error(_0x934d('0x5d'));if(_0x11b26a[_0x934d('0x5e')]===_0x934d('0x5f')){var _0x14946e=_0x1bc0e9['get']({'plain':!![]});var _0x3caeeb=_0x934d('0x38');return db[_0x934d('0x60')][_0x934d('0x5b')]({'where':{'name':_0x3caeeb,'userProfileId':_0x11b26a[_0x934d('0x61')]},'raw':!![]})['then'](function(_0x240e5e){if(_0x240e5e&&_0x240e5e[_0x934d('0x62')]===0x0){return db[_0x934d('0x39')][_0x934d('0x5c')]({'name':_0x14946e[_0x934d('0x3b')],'resourceId':_0x14946e['id'],'type':_0x240e5e[_0x934d('0x3b')],'sectionId':_0x240e5e['id']},{})[_0x934d('0x21')](function(){return _0x1bc0e9;});}else{return _0x1bc0e9;}})[_0x934d('0x2a')](function(_0x87cd3f){logger[_0x934d('0x26')](_0x934d('0x63'),_0x87cd3f);throw _0x87cd3f;});}return _0x1bc0e9;})[_0x934d('0x21')](respondWithResult(_0x1d1709,0xc9))['catch'](handleError(_0x1d1709,null));};exports[_0x934d('0x64')]=function(_0x340e22,_0x6fc3e){if(_0x340e22[_0x934d('0x65')]['id']){delete _0x340e22['body']['id'];}return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x340e22[_0x934d('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x6fc3e,null))[_0x934d('0x21')](saveUpdates(_0x340e22[_0x934d('0x65')],null))['then'](respondWithResult(_0x6fc3e,null))[_0x934d('0x2a')](handleError(_0x6fc3e,null));};exports[_0x934d('0x36')]=function(_0x5a4a07,_0x28d2c6){return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x5a4a07[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x28d2c6,null))[_0x934d('0x21')](removeEntity(_0x28d2c6,null))[_0x934d('0x2a')](handleError(_0x28d2c6,null));};exports[_0x934d('0x66')]=function(_0xf9d7a4,_0x5234b0){return db[_0x934d('0x53')]['describe']()['then'](respondWithResult(_0x5234b0,null))[_0x934d('0x2a')](handleError(_0x5234b0,null));};exports[_0x934d('0x67')]=function(_0x55a157,_0x5994d9,_0x51ef17){if(_0x55a157[_0x934d('0x65')]['id']){delete _0x55a157[_0x934d('0x65')]['id'];}return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x55a157[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x5994d9,null))['then'](function(_0x463786){if(_0x463786){_0x55a157[_0x934d('0x65')][_0x934d('0x68')]=_0x463786['id'];return db['Disposition'][_0x934d('0x5c')](_0x55a157[_0x934d('0x65')]);}})[_0x934d('0x21')](respondWithResult(_0x5994d9,null))[_0x934d('0x2a')](handleError(_0x5994d9,null));};exports[_0x934d('0x69')]=function(_0x4734ff,_0x3717c2,_0x19a20a){var _0x4016fc={'raw':![],'where':{}};var _0x13e1f7={};var _0x365be2={'count':0x0,'rows':[]};return db[_0x934d('0x53')][_0x934d('0x6a')]({'where':{'id':_0x4734ff[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x3717c2,null))[_0x934d('0x21')](function(_0x34c8e3){if(_0x34c8e3){_0x13e1f7[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0x6b')]['rawAttributes']);_0x13e1f7[_0x934d('0x44')]=_['keys'](_0x4734ff[_0x934d('0x44')]);_0x13e1f7[_0x934d('0x45')]=_[_0x934d('0x47')](_0x13e1f7[_0x934d('0x5a')],_0x13e1f7[_0x934d('0x44')]);_0x4016fc[_0x934d('0x46')]=_[_0x934d('0x47')](_0x13e1f7[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x4734ff[_0x934d('0x44')]['fields']));_0x4016fc[_0x934d('0x46')]=_0x4016fc[_0x934d('0x46')][_0x934d('0x49')]?_0x4016fc[_0x934d('0x46')]:_0x13e1f7[_0x934d('0x5a')];if(!_0x4734ff['query'][_0x934d('0x4a')](_0x934d('0x6c'))){_0x4016fc['limit']=qs[_0x934d('0x31')](_0x4734ff[_0x934d('0x44')][_0x934d('0x31')]);_0x4016fc['offset']=qs[_0x934d('0x2e')](_0x4734ff[_0x934d('0x44')]['offset']);}_0x4016fc[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x4734ff['query'][_0x934d('0x4c')]);_0x4016fc[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x4734ff[_0x934d('0x44')],_0x13e1f7[_0x934d('0x45')]));_0x4016fc[_0x934d('0x4e')]['SmsAccountId']=_0x34c8e3['id'];if(_0x4734ff[_0x934d('0x44')]['filter']){_0x4016fc[_0x934d('0x4e')]=_['merge'](_0x4016fc[_0x934d('0x4e')],{'$or':_[_0x934d('0x40')](_0x4016fc['attributes'],function(_0x34898d){var _0x5b6b23={};_0x5b6b23[_0x34898d]={'$like':'%'+_0x4734ff['query'][_0x934d('0x51')]+'%'};return _0x5b6b23;})});}_0x4016fc=_[_0x934d('0x4f')]({},_0x4016fc,_0x4734ff[_0x934d('0x52')]);return db[_0x934d('0x6b')][_0x934d('0x30')]({'where':_0x4016fc[_0x934d('0x4e')]})[_0x934d('0x21')](function(_0x4e7e8b){_0x365be2['count']=_0x4e7e8b;if(_0x4734ff[_0x934d('0x44')]['includeAll']){_0x4016fc[_0x934d('0x55')]=[{'all':!![]}];}return db[_0x934d('0x6b')][_0x934d('0x56')](_0x4016fc);})['then'](function(_0x412a28){_0x365be2[_0x934d('0x57')]=_0x412a28;return _0x365be2;});}})[_0x934d('0x21')](respondWithFilteredResult(_0x3717c2,_0x4016fc))[_0x934d('0x2a')](handleError(_0x3717c2,null));};exports[_0x934d('0x6d')]=function(_0x3cf7a2,_0x185f3f,_0x3bd29a){return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x3cf7a2[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0x185f3f,null))['then'](function(_0x320e6c){if(_0x320e6c){return _0x320e6c['removeDispositions'](_0x3cf7a2[_0x934d('0x44')][_0x934d('0x6e')]);}})[_0x934d('0x21')](respondWithStatusCode(_0x185f3f,null))[_0x934d('0x2a')](handleError(_0x185f3f,null));};exports[_0x934d('0x6f')]=function(_0x59a6e3,_0xd57f41,_0x3aedbd){if(_0x59a6e3[_0x934d('0x65')]['id']){delete _0x59a6e3[_0x934d('0x65')]['id'];}return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x59a6e3[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0xd57f41,null))[_0x934d('0x21')](function(_0x4e3f67){if(_0x4e3f67){_0x59a6e3[_0x934d('0x65')][_0x934d('0x68')]=_0x4e3f67['id'];return db['CannedAnswer'][_0x934d('0x5c')](_0x59a6e3[_0x934d('0x65')]);}})[_0x934d('0x21')](respondWithResult(_0xd57f41,null))[_0x934d('0x2a')](handleError(_0xd57f41,null));};exports[_0x934d('0x70')]=function(_0x4f8fce,_0x5ed22b,_0x7df3e1){var _0x45dc17={'raw':![],'where':{}};var _0xe8dd20={};var _0x137d19={'count':0x0,'rows':[]};return db[_0x934d('0x53')]['findOne']({'where':{'id':_0x4f8fce[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x5ed22b,null))[_0x934d('0x21')](function(_0xd5aa42){if(_0xd5aa42){_0xe8dd20[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0x71')][_0x934d('0x72')]);_0xe8dd20['query']=_['keys'](_0x4f8fce[_0x934d('0x44')]);_0xe8dd20[_0x934d('0x45')]=_['intersection'](_0xe8dd20['model'],_0xe8dd20[_0x934d('0x44')]);_0x45dc17[_0x934d('0x46')]=_[_0x934d('0x47')](_0xe8dd20[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x4f8fce[_0x934d('0x44')]['fields']));_0x45dc17[_0x934d('0x46')]=_0x45dc17[_0x934d('0x46')][_0x934d('0x49')]?_0x45dc17[_0x934d('0x46')]:_0xe8dd20[_0x934d('0x5a')];if(!_0x4f8fce[_0x934d('0x44')]['hasOwnProperty'](_0x934d('0x6c'))){_0x45dc17[_0x934d('0x31')]=qs[_0x934d('0x31')](_0x4f8fce[_0x934d('0x44')]['limit']);_0x45dc17[_0x934d('0x2e')]=qs['offset'](_0x4f8fce[_0x934d('0x44')][_0x934d('0x2e')]);}_0x45dc17[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x4f8fce[_0x934d('0x44')]['sort']);_0x45dc17[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x4f8fce[_0x934d('0x44')],_0xe8dd20['filters']));_0x45dc17[_0x934d('0x4e')][_0x934d('0x68')]=_0xd5aa42['id'];if(_0x4f8fce[_0x934d('0x44')][_0x934d('0x51')]){_0x45dc17[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x45dc17['where'],{'$or':_[_0x934d('0x40')](_0x45dc17[_0x934d('0x46')],function(_0x53dc0f){var _0x18eb22={};_0x18eb22[_0x53dc0f]={'$like':'%'+_0x4f8fce['query'][_0x934d('0x51')]+'%'};return _0x18eb22;})});}_0x45dc17=_['merge']({},_0x45dc17,_0x4f8fce[_0x934d('0x52')]);return db[_0x934d('0x71')][_0x934d('0x30')]({'where':_0x45dc17['where']})[_0x934d('0x21')](function(_0x5e674c){_0x137d19[_0x934d('0x30')]=_0x5e674c;if(_0x4f8fce[_0x934d('0x44')][_0x934d('0x54')]){_0x45dc17[_0x934d('0x55')]=[{'all':!![]}];}return db[_0x934d('0x71')][_0x934d('0x56')](_0x45dc17);})[_0x934d('0x21')](function(_0x33ddb1){_0x137d19['rows']=_0x33ddb1;return _0x137d19;});}})[_0x934d('0x21')](respondWithFilteredResult(_0x5ed22b,_0x45dc17))[_0x934d('0x2a')](handleError(_0x5ed22b,null));};exports[_0x934d('0x73')]=function(_0x52f5dd,_0x3791a1,_0x5b8d14){return db[_0x934d('0x53')]['find']({'where':{'id':_0x52f5dd[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x3791a1,null))['then'](function(_0xd0fa7b){if(_0xd0fa7b){return _0xd0fa7b[_0x934d('0x73')](_0x52f5dd[_0x934d('0x44')][_0x934d('0x6e')]);}})[_0x934d('0x21')](respondWithStatusCode(_0x3791a1,null))[_0x934d('0x2a')](handleError(_0x3791a1,null));};exports[_0x934d('0x74')]=function(_0x4a2a65,_0x1c0ee5,_0x36d551){var _0x514ac4={'channel':_0x934d('0x75')};var _0x3563dd=[];var _0x4e0a8f=[];var _0x1179ee={};return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x4a2a65[_0x934d('0x59')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1c0ee5,null))[_0x934d('0x21')](function(_0x5abb06){_0x514ac4[_0x934d('0x76')]=_0x5abb06;_0x514ac4[_0x934d('0x77')]=_[_0x934d('0x78')](_0x5abb06[_0x934d('0x79')],[_0x934d('0x7a')],[_0x934d('0x7b')]);if(_0x514ac4[_0x934d('0x76')]['Applications']){delete _0x514ac4['account'][_0x934d('0x79')];}return db[_0x934d('0x7c')][_0x934d('0x66')]();})[_0x934d('0x21')](function(_0xf09edc){if(!_0xf09edc){throw new db['Sequelize'][(_0x934d('0x7d'))](_0x934d('0x7e'));}_0x3563dd=_[_0x934d('0x7f')](_[_0x934d('0x43')](_0xf09edc),[_0x934d('0x80'),_0x934d('0x81')]);_0x4e0a8f=_[_0x934d('0x7f')](_[_0x934d('0x43')](_0xf09edc),[_0x934d('0x80'),'updatedAt',_0x934d('0x82'),_0x934d('0x83')]);_0x514ac4[_0x934d('0x65')]={'mapKey':_0x934d('0x84')};if(_0x514ac4[_0x934d('0x76')][_0x934d('0x41')]){switch(_0x514ac4[_0x934d('0x76')][_0x934d('0x41')]){case _0x934d('0x85'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65['body'][_0x934d('0x87')];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x88')];_0x514ac4['body'][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8a')];break;case _0x934d('0x8b'):_0x514ac4['body']['from']='+'+_0x4a2a65[_0x934d('0x65')]['sender'];_0x514ac4['body'][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8c')];break;case'connectel':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x86')];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x28')];break;case _0x934d('0x8d'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x86')];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')]['body'];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8e')];break;case _0x934d('0x8f'):_0x514ac4['body'][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')]['From'];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x90')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')]['MessageUUID'];break;case _0x934d('0x91'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]='+'+_0x4a2a65[_0x934d('0x65')][_0x934d('0x92')][0x0]['from'];_0x514ac4['body'][_0x934d('0x65')]=_0x4a2a65['body']['results'][0x0][_0x934d('0x8c')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x92')][0x0][_0x934d('0x89')];break;case _0x934d('0x93'):_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')]['originatingAddress'];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x94')][_0x934d('0x28')];break;case'clickatell':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')]=_0x4a2a65['body']['fromNumber'];_0x514ac4[_0x934d('0x65')][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x8c')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')]['replyMessageId'];break;case _0x934d('0x95'):_0x514ac4['body'][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][0x0][_0x934d('0x28')]['id'];_0x514ac4['body'][_0x934d('0x86')]=_0x4a2a65['body'][0x0][_0x934d('0x28')][_0x934d('0x86')];_0x514ac4['body'][_0x934d('0x65')]=_0x4a2a65[_0x934d('0x65')][0x0][_0x934d('0x28')][_0x934d('0x8c')];break;case _0x934d('0x96'):_0x514ac4['body'][_0x934d('0x86')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x86')];_0x514ac4['body']['body']=_0x4a2a65['body'][_0x934d('0x28')];_0x514ac4[_0x934d('0x65')][_0x934d('0x89')]=_0x4a2a65[_0x934d('0x65')][_0x934d('0x97')];break;}}if(_0x514ac4[_0x934d('0x65')]['id']){delete _0x514ac4[_0x934d('0x65')]['id'];}if(_[_0x934d('0x98')](_0x514ac4[_0x934d('0x65')][_0x934d('0x86')])){throw new db[(_0x934d('0x99'))][(_0x934d('0x7d'))](_0x934d('0x9a'));}if(_[_0x934d('0x98')](_0x514ac4[_0x934d('0x65')][_0x934d('0x65')])||_0x514ac4['body'][_0x934d('0x65')]===''){throw new db[(_0x934d('0x99'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x514ac4[_0x934d('0x65')]['mapKey'])){throw new db[(_0x934d('0x99'))][(_0x934d('0x7d'))](_0x934d('0x9b')+_0x4e0a8f);}if(!_[_0x934d('0x9c')](_0x4e0a8f,_0x514ac4[_0x934d('0x65')][_0x934d('0x9d')])){throw new db['Sequelize']['ValidationError'](_0x934d('0x9e')+_0x4e0a8f);}_0x1179ee[_0x514ac4[_0x934d('0x65')][_0x934d('0x9d')]]=_0x514ac4[_0x934d('0x65')]['from'];return db[_0x934d('0x9f')][_0x934d('0x5b')]({'where':{'id':_0x514ac4[_0x934d('0x76')][_0x934d('0x83')]},'include':[{'model':db[_0x934d('0x7c')],'as':_0x934d('0xa0'),'where':_0x1179ee,'limit':0x1,'order':[[_0x934d('0x81'),_0x934d('0xa1')]]}]});})[_0x934d('0x21')](handleEntityNotFound(_0x1c0ee5,null))[_0x934d('0x21')](function(_0x2f4b49){if(_0x2f4b49){_0x514ac4[_0x934d('0xa2')]=_[_0x934d('0xa3')](_0x2f4b49,[_0x934d('0xa0')]);if(_0x2f4b49[_0x934d('0xa0')][_0x934d('0x49')]){return _0x2f4b49[_0x934d('0xa0')][0x0];}var _0x3741ea=_[_0x934d('0x1a')](_0x514ac4['body'],{'firstName':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')],'ListId':_0x2f4b49['id']});_0x3741ea[_0x514ac4[_0x934d('0x65')]['mapKey']]=_0x514ac4[_0x934d('0x65')][_0x934d('0x86')];return db[_0x934d('0x7c')][_0x934d('0x5c')](_0x3741ea,{'fields':_0x3563dd,'raw':!![]});}})['then'](handleEntityNotFound(_0x1c0ee5,null))['then'](function(_0x13c60b){if(_0x13c60b){_0x514ac4[_0x934d('0xa4')]=_0x13c60b;var _0x5da587={'ContactId':_0x13c60b['id'],'phone':_0x514ac4['body'][_0x934d('0x86')],'SmsAccountId':_0x4a2a65['params']['id']};var _0x446b38={'ContactId':_0x13c60b['id'],'SmsAccountId':_0x4a2a65[_0x934d('0x59')]['id'],'closed':![]};return db[_0x934d('0xa5')][_0x934d('0x5b')]({'where':_0x446b38})['then'](function(_0x2f5648){if(_0x2f5648){return[_0x2f5648,![]];}return db[_0x934d('0xa5')]['create'](_0x5da587)[_0x934d('0x21')](function(_0x58a725){return[_0x58a725,!![]];});});}})[_0x934d('0xa6')](function(_0x37ee4e,_0x2b73e9){_0x514ac4[_0x934d('0xa7')]=_0x37ee4e[_0x934d('0x37')]({'plain':!![]});_0x514ac4[_0x934d('0xa7')]['created']=![];if(_0x2b73e9){if(_0x514ac4['account']['autoclose']){_0x514ac4[_0x934d('0x77')][_0x934d('0xa8')]({'id':0x0,'priority':_0x514ac4[_0x934d('0x77')][_0x934d('0x49')]+0x1,'app':_0x934d('0xa9'),'appdata':_0x934d('0xaa'),'interval':_0x934d('0xab')});}_0x514ac4[_0x934d('0xa7')][_0x934d('0xac')]=!![];}return db['SmsMessage'][_0x934d('0x5c')]({'phone':_0x514ac4[_0x934d('0x65')][_0x934d('0x86')],'messageId':_0x514ac4[_0x934d('0x65')][_0x934d('0x89')],'body':_0x514ac4[_0x934d('0x65')][_0x934d('0x65')],'SmsAccountId':_0x4a2a65['params']['id'],'SmsInteractionId':_0x37ee4e['id'],'direction':'in','ContactId':_0x37ee4e[_0x934d('0xad')],'AttachmentId':_0x514ac4['body'][_0x934d('0xae')]});})['then'](function(_0x1a9918){_0x514ac4['message']=_0x1a9918;if(_0x514ac4[_0x934d('0xa7')][_0x934d('0xaf')]){return db[_0x934d('0xb0')]['find']({'attributes':['id',_0x934d('0x3b')],'where':{'id':_0x514ac4[_0x934d('0xa7')][_0x934d('0xaf')]}})['then'](function(_0x5efe93){if(_0x5efe93){_0x514ac4[_0x934d('0x77')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5efe93['name']+','+(_0x514ac4[_0x934d('0x76')][_0x934d('0xb1')]||0xa),'interval':_0x934d('0xab')});}return respondWithRpcPromise(_0x934d('0xb2'),_0x934d('0xb3'),_0x514ac4);});}return respondWithRpcPromise(_0x934d('0xb2'),_0x934d('0xb3'),_0x514ac4);})[_0x934d('0x21')](function(_0x501101){if(_0x501101){var _0x3bdef0=0xc8;var _0x38ca01=_0x934d('0xb4');logger[_0x934d('0x22')](_0x934d('0x24'),_0x38ca01,_0x3bdef0,_0x934d('0xb5'));logger[_0x934d('0x23')](_0x934d('0xb6'),_0x38ca01,_0x3bdef0,_0x934d('0xb5'),JSON['stringify'](_0x501101));if(_0x514ac4[_0x934d('0x76')][_0x934d('0x41')]===_0x934d('0x85')){return _0x1c0ee5['status'](_0x3bdef0)[_0x934d('0x32')]('Content-Type',_0x934d('0xb7'))['send'](_0x934d('0xb8'));}else{return _0x1c0ee5[_0x934d('0x2c')](_0x3bdef0)[_0x934d('0x33')](_0x501101);}}})[_0x934d('0x2a')](handleError(_0x1c0ee5,null));};exports[_0x934d('0xb9')]=function(_0x2efb08,_0x3908e3){var _0x12f160=_0x2efb08[_0x934d('0x59')]['id'];var _0x5a142f=_0x2efb08['body'];var _0x9960d4=0xc8;var _0x461289=null;return db[_0x934d('0xba')][_0x934d('0xbb')]({'isolationLevel':db['sequelize'][_0x934d('0xbc')][_0x934d('0xbd')]['READ_COMMITTED']},function(_0x4d51fc){return db[_0x934d('0x53')][_0x934d('0x6a')]({'where':{'id':_0x12f160},'transaction':_0x4d51fc})[_0x934d('0x21')](function(_0x13b144){if(_0x13b144){return db[_0x934d('0xbe')]['destroy']({'where':{'SmsAccountId':_0x12f160},'transaction':_0x4d51fc})['then'](function(){var _0x4664a7=_[_0x934d('0x40')](_0x5a142f,function(_0x321f00){_0x321f00[_0x934d('0x68')]=_0x12f160;return _0x321f00;});return db[_0x934d('0xbe')][_0x934d('0xbf')](_0x4664a7,{'transaction':_0x4d51fc});});}else{_0x9960d4=0x194;_0x461289=[];}});})[_0x934d('0x21')](function(){if(_0x9960d4!==0x194){return db[_0x934d('0xbe')][_0x934d('0xc0')]({'where':{'SmsAccountId':_0x12f160},'order':'priority'})[_0x934d('0x21')](function(_0x1f438d){_0x461289=_0x1f438d;});}})[_0x934d('0x2a')](function(_0x47db9d){_0x9960d4=0x1f4;logger['error'](_0x47db9d['stack']);if(_0x47db9d[_0x934d('0x3b')]){delete _0x47db9d[_0x934d('0x3b')];}_0x461289=_0x47db9d;})[_0x934d('0xc1')](function(){if(_0x461289===null){_0x3908e3[_0x934d('0x2b')](_0x9960d4);}else{if(_0x9960d4===0x1f4){_0x3908e3[_0x934d('0x2c')](_0x9960d4)['send'](_0x461289);}else{_0x3908e3[_0x934d('0x2c')](_0x9960d4)['json'](_0x461289);}}});};exports[_0x934d('0xc2')]=function(_0x2c05b5,_0x74d31d,_0x1d0bc4){var _0x417baa={};var _0x1b1dca={};var _0x477464;var _0x4fa1d9;return db['SmsAccount'][_0x934d('0x6a')]({'where':{'id':_0x2c05b5[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0x74d31d,null))[_0x934d('0x21')](function(_0x340348){if(_0x340348){_0x477464=_0x340348;_0x1b1dca['model']=_[_0x934d('0x43')](db[_0x934d('0xbe')][_0x934d('0x72')]);_0x1b1dca[_0x934d('0x44')]=_[_0x934d('0x43')](_0x2c05b5[_0x934d('0x44')]);_0x1b1dca[_0x934d('0x45')]=_['intersection'](_0x1b1dca[_0x934d('0x5a')],_0x1b1dca[_0x934d('0x44')]);_0x417baa['attributes']=_[_0x934d('0x47')](_0x1b1dca[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x2c05b5['query'][_0x934d('0x48')]));_0x417baa[_0x934d('0x46')]=_0x417baa['attributes'][_0x934d('0x49')]?_0x417baa[_0x934d('0x46')]:_0x1b1dca[_0x934d('0x5a')];_0x417baa[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x2c05b5[_0x934d('0x44')][_0x934d('0x4c')]);_0x417baa[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x2c05b5['query'],_0x1b1dca[_0x934d('0x45')]));if(_0x2c05b5[_0x934d('0x44')]['filter']){_0x417baa[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x417baa[_0x934d('0x4e')],{'$or':_[_0x934d('0x40')](_0x417baa[_0x934d('0x46')],function(_0x19b16b){var _0x5bb357={};_0x5bb357[_0x19b16b]={'$like':'%'+_0x2c05b5[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x5bb357;})});}_0x417baa=_['merge']({},_0x417baa,_0x2c05b5[_0x934d('0x52')]);return _0x477464[_0x934d('0xc2')](_0x417baa);}})['then'](function(_0x5f4e93){if(_0x5f4e93){_0x4fa1d9=_0x5f4e93['length'];if(!_0x2c05b5[_0x934d('0x44')][_0x934d('0x4a')](_0x934d('0x6c'))){_0x417baa['limit']=qs[_0x934d('0x31')](_0x2c05b5[_0x934d('0x44')][_0x934d('0x31')]);_0x417baa[_0x934d('0x2e')]=qs[_0x934d('0x2e')](_0x2c05b5['query'][_0x934d('0x2e')]);}return _0x477464[_0x934d('0xc2')](_0x417baa);}})[_0x934d('0x21')](function(_0x5eb9f6){if(_0x5eb9f6){return _0x5eb9f6?{'count':_0x4fa1d9,'rows':_0x5eb9f6}:null;}})[_0x934d('0x21')](respondWithResult(_0x74d31d,null))['catch'](handleError(_0x74d31d,null));};exports[_0x934d('0xc3')]=function(_0x336cf9,_0x453b10,_0x1e5d54){var _0x2c185f={'raw':![],'where':{}};var _0x5bb4b4={};var _0x49428={'count':0x0,'rows':[]};return db['SmsAccount'][_0x934d('0x6a')]({'where':{'id':_0x336cf9[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x453b10,null))['then'](function(_0x4c70ca){if(_0x4c70ca){_0x5bb4b4[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0xa5')]['rawAttributes']);_0x5bb4b4['query']=_['keys'](_0x336cf9[_0x934d('0x44')]);_0x5bb4b4[_0x934d('0x45')]=_[_0x934d('0x47')](_0x5bb4b4['model'],_0x5bb4b4['query']);_0x2c185f[_0x934d('0x46')]=_[_0x934d('0x47')](_0x5bb4b4[_0x934d('0x5a')],qs['fields'](_0x336cf9['query'][_0x934d('0x48')]));_0x2c185f[_0x934d('0x46')]=_0x2c185f[_0x934d('0x46')]['length']?_0x2c185f[_0x934d('0x46')]:_0x5bb4b4['model'];if(!_0x336cf9['query'][_0x934d('0x4a')](_0x934d('0x6c'))){_0x2c185f[_0x934d('0x31')]=qs['limit'](_0x336cf9[_0x934d('0x44')]['limit']);_0x2c185f['offset']=qs[_0x934d('0x2e')](_0x336cf9[_0x934d('0x44')][_0x934d('0x2e')]);}_0x2c185f[_0x934d('0x4b')]=qs[_0x934d('0x4c')](_0x336cf9[_0x934d('0x44')][_0x934d('0x4c')]);_0x2c185f[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x336cf9[_0x934d('0x44')],_0x5bb4b4[_0x934d('0x45')]));_0x2c185f[_0x934d('0x4e')]['SmsAccountId']=_0x4c70ca['id'];if(_0x336cf9[_0x934d('0x44')][_0x934d('0x51')]){_0x2c185f[_0x934d('0x4e')]=_['merge'](_0x2c185f[_0x934d('0x4e')],{'$or':_[_0x934d('0x40')](_0x2c185f[_0x934d('0x46')],function(_0x9329fb){var _0x127bdf={};_0x127bdf[_0x9329fb]={'$like':'%'+_0x336cf9[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x127bdf;})});}_0x2c185f=_[_0x934d('0x4f')]({},_0x2c185f,_0x336cf9[_0x934d('0x52')]);return db[_0x934d('0xa5')][_0x934d('0x30')]({'where':_0x2c185f['where']})[_0x934d('0x21')](function(_0x29354b){_0x49428['count']=_0x29354b;if(_0x336cf9[_0x934d('0x44')][_0x934d('0x54')]){_0x2c185f['include']=[{'model':db['CmContact'],'as':_0x934d('0xc4'),'required':![]},{'model':db[_0x934d('0xb0')],'as':_0x934d('0xc5'),'attributes':[_0x934d('0x3b'),_0x934d('0xc6'),_0x934d('0xc7')],'required':![]},{'model':db[_0x934d('0xc8')],'as':'Tags','attributes':['id',_0x934d('0x3b'),_0x934d('0xc9')],'where':_0x336cf9[_0x934d('0x44')][_0x934d('0xca')]?{'id':_0x336cf9[_0x934d('0x44')][_0x934d('0xca')]}:undefined,'required':_0x336cf9[_0x934d('0x44')][_0x934d('0xca')]?!![]:![]}];}return db[_0x934d('0xa5')][_0x934d('0x56')](_0x2c185f);})[_0x934d('0x21')](function(_0x49f300){_0x49428['rows']=_0x49f300;return _0x49428;});}})[_0x934d('0x21')](respondWithFilteredResult(_0x453b10,_0x2c185f))[_0x934d('0x2a')](handleError(_0x453b10,null));};exports['send']=function(_0x745eba,_0x266137,_0x236337){var _0x438524,_0x344fcb,_0x3c5013;if(_[_0x934d('0x98')](_0x745eba[_0x934d('0x65')]['body'])||_0x745eba[_0x934d('0x65')][_0x934d('0x65')]===''){throw new db[(_0x934d('0x99'))][(_0x934d('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x934d('0x98')](_0x745eba[_0x934d('0x65')]['to'])){throw new db['Sequelize'][(_0x934d('0x7d'))]('to\x20is\x20mandatory');}_0x438524=_0x745eba['body']['to'];return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x745eba[_0x934d('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x934d('0x7c')],'as':'Contacts','where':{'mobile':_0x438524},'limit':0x1,'order':[[_0x934d('0x81'),_0x934d('0xa1')]]}]}]})[_0x934d('0x21')](handleEntityNotFound(_0x266137,null))[_0x934d('0x21')](function(_0x5ddc41){if(_0x5ddc41&&_0x5ddc41[_0x934d('0xcb')]){_0x344fcb=_0x5ddc41['get']({'plain':!![]});if(_0x344fcb[_0x934d('0xcb')]&&_0x344fcb[_0x934d('0xcb')][_0x934d('0xa0')][_0x934d('0x49')]){return _0x344fcb[_0x934d('0xcb')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x934d('0x1a')](_0x745eba['body'],{'firstName':_0x438524,'mobile':_0x438524,'phone':_0x438524,'ListId':_0x344fcb[_0x934d('0x83')]}));}})[_0x934d('0x21')](handleEntityNotFound(_0x266137,null))[_0x934d('0x21')](function(_0xf48b0a){if(_0xf48b0a){_0x3c5013=_0xf48b0a;return db['SmsInteraction']['find']({'where':{'ContactId':_0x3c5013['id'],'closed':![],'SmsAccountId':_0x344fcb['id']}})[_0x934d('0x21')](function(_0x4ae4f9){if(_0x4ae4f9){return[_0x4ae4f9,![]];}return db[_0x934d('0xa5')][_0x934d('0x5c')]({'UserId':_0x745eba[_0x934d('0x5f')]['id'],'ContactId':_0x3c5013['id'],'SmsAccountId':_0x344fcb['id'],'phone':_0x438524,'firstMsgDirection':_0x934d('0xcc'),'Messages':[_[_0x934d('0x4f')](_0x745eba[_0x934d('0x65')],{'read':![],'body':_0x745eba[_0x934d('0x65')][_0x934d('0x65')],'phone':_0x438524,'SmsAccountId':_0x344fcb['id'],'UserId':_0x745eba[_0x934d('0x5f')]['id'],'ContactId':_0x3c5013['id']})]},{'include':[{'model':db[_0x934d('0xcd')],'as':'Messages'}]})[_0x934d('0x21')](function(_0x27a217){return[_0x27a217,!![]];});});}})[_0x934d('0xa6')](function(_0x1ab45b,_0x178aab){if(_0x178aab){return _0x1ab45b;}return db[_0x934d('0xcd')][_0x934d('0x5c')](_[_0x934d('0x4f')](_0x745eba[_0x934d('0x65')],{'read':![],'body':_0x745eba[_0x934d('0x65')][_0x934d('0x65')],'phone':_0x438524,'SmsAccountId':_0x344fcb['id'],'SmsInteractionId':_0x1ab45b['id'],'UserId':_0x745eba[_0x934d('0x5f')]['id'],'ContactId':_0x3c5013['id']}))[_0x934d('0x21')](function(_0x502c9a){_0x1ab45b[_0x934d('0xce')][_0x934d('0xcf')]=[];_0x1ab45b['dataValues'][_0x934d('0xcf')][_0x934d('0xa8')](_0x502c9a['dataValues']);return _0x1ab45b;});})[_0x934d('0x21')](respondWithResult(_0x266137,null))[_0x934d('0x2a')](handleError(_0x266137,null));};exports[_0x934d('0x2c')]=function(_0x36b4df,_0x1df140,_0x159889){if(_0x36b4df[_0x934d('0x65')]['id']){delete _0x36b4df[_0x934d('0x65')]['id'];}var _0x21ed84,_0x4acefe,_0x5c3ecc;return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x36b4df[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x1df140,null))[_0x934d('0x21')](function(_0x2e81b6){if(_0x2e81b6){_0x5c3ecc=_0x2e81b6;logger[_0x934d('0x23')](_0x934d('0x24'),'status',_0x934d('0xd0'),_0x2e81b6['type'],util[_0x934d('0xd1')](_0x36b4df['body'],{'showHidden':![],'depth':null}));switch(_0x2e81b6[_0x934d('0x41')]){case _0x934d('0x8b'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0xd2')]&&_0x36b4df[_0x934d('0x65')][_0x934d('0x2c')]){_0x4acefe=_0x36b4df[_0x934d('0x65')][_0x934d('0x2c')];return db['SmsMessage']['find']({'where':{'messageId':_0x36b4df[_0x934d('0x65')][_0x934d('0xd2')]}});}break;case _0x934d('0xd3'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0xd4')]&&_0x36b4df[_0x934d('0x65')][_0x934d('0xd5')]){_0x4acefe=_0x36b4df[_0x934d('0x65')][_0x934d('0xd5')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')]['requestid']}});}break;case _0x934d('0x8d'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0x8e')]&&_0x36b4df['body'][_0x934d('0xd6')]){_0x4acefe=_0x36b4df[_0x934d('0x65')][_0x934d('0xd6')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')][_0x934d('0x8e')]}});}break;case'infobip':var _0x532aad=_0x36b4df[_0x934d('0x65')][_0x934d('0x92')][0x0];if(_0x532aad[_0x934d('0x89')]&&_0x532aad[_0x934d('0x2c')][_0x934d('0xd7')]===_0x934d('0xd8')){_0x4acefe=_0x532aad['status'][_0x934d('0xd7')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x532aad[_0x934d('0x89')]}});}break;case _0x934d('0xd9'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0x89')]&&_0x36b4df[_0x934d('0x65')]['status']){_0x4acefe=_0x36b4df['body'][_0x934d('0x2c')];return db['SmsMessage'][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')][_0x934d('0x89')]}});}break;case _0x934d('0x95'):if(_0x36b4df[_0x934d('0x65')][0x0][_0x934d('0x28')]['id']){_0x4acefe=_0x36b4df[_0x934d('0x65')][0x0][_0x934d('0x41')];return db[_0x934d('0xcd')][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df[_0x934d('0x65')][0x0][_0x934d('0x28')]['id']}});}break;case _0x934d('0x96'):if(_0x36b4df[_0x934d('0x65')][_0x934d('0xda')]&&_0x36b4df[_0x934d('0x65')]['status']){_0x4acefe=_0x36b4df[_0x934d('0x65')]['status'];return db[_0x934d('0xcd')][_0x934d('0x5b')]({'where':{'messageId':_0x36b4df['body'][_0x934d('0xda')]}});}break;}}})[_0x934d('0x21')](handleEntityNotFound(_0x1df140,null))['then'](function(_0x226649){if(_0x226649){_0x21ed84=_0x226649;switch(_0x5c3ecc[_0x934d('0x41')]){case'skebby':if(_0x4acefe===_0x934d('0xd8')){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x8b'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0xd3'):if(_0x4acefe==='1'){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x8b'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0x8d'):if(!_0x36b4df[_0x934d('0x65')]['error_code']&&_0x4acefe>=0xc8&&_0x4acefe<=0xce){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x934d('0x2c'),'clicksend',util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4521aa=_0x36b4df[_0x934d('0x65')][_0x934d('0x92')][0x0];if(_0x4521aa[_0x934d('0x2c')][_0x934d('0xd7')]===_0x934d('0xd8')){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x91'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0xd9'):if(_0x4acefe==_0x934d('0xdb')||_0x4acefe==_0x934d('0xdc')){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0xd9'),util['inspect'](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;case _0x934d('0x95'):if(_0x4acefe=='message-delivered'){return _0x21ed84[_0x934d('0x64')]({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x95'),util['inspect'](_0x36b4df['body'],{'showHidden':![],'depth':null}));}break;case _0x934d('0x96'):if(_0x4acefe===_0x934d('0xdd')||_0x4acefe===_0x934d('0xde')){return _0x21ed84['update']({'read':!![]});}else{logger['error'](_0x934d('0x24'),_0x934d('0x2c'),_0x934d('0x96'),util[_0x934d('0xd1')](_0x36b4df[_0x934d('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x21ed84;}})[_0x934d('0x21')](respondWithResult(_0x1df140,null))[_0x934d('0x2a')](handleError(_0x1df140,null));};exports[_0x934d('0xdf')]=function(_0x36677f,_0x46b760,_0x15a4ce){var _0x56325d,_0x35920c,_0x3a41c5;return db[_0x934d('0x53')]['find']({'where':{'id':_0x36677f[_0x934d('0x59')]['id']}})['then'](handleEntityNotFound(_0x46b760,null))['then'](function(_0x49a8d5){if(_0x49a8d5){_0x3a41c5=_0x49a8d5;logger[_0x934d('0x23')](_0x934d('0x24'),'status',_0x934d('0xd0'),_0x49a8d5[_0x934d('0x41')],util[_0x934d('0xd1')](_0x36677f['query'],{'showHidden':![],'depth':null}));switch(_0x49a8d5[_0x934d('0x41')]){case _0x934d('0x93'):if(_0x36677f['query'][_0x934d('0xe0')]&&_0x36677f[_0x934d('0x44')][_0x934d('0xe1')]){_0x35920c=_0x36677f[_0x934d('0x44')]['state'];return db[_0x934d('0xcd')]['find']({'where':{'messageId':_0x36677f[_0x934d('0x44')][_0x934d('0xe0')]}});}break;}}})[_0x934d('0x21')](handleEntityNotFound(_0x46b760,null))[_0x934d('0x21')](function(_0x36c4dc){if(_0x36c4dc){_0x56325d=_0x36c4dc;switch(_0x3a41c5[_0x934d('0x41')]){case _0x934d('0x93'):if(_0x35920c==='2'||_0x35920c==='6'){return _0x56325d[_0x934d('0x64')]({'read':!![]});}else{logger[_0x934d('0x26')](_0x934d('0x24'),'status',_0x934d('0x93'),util['inspect'](_0x36677f[_0x934d('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x56325d;}})[_0x934d('0x21')](respondWithResult(_0x46b760,null))[_0x934d('0x2a')](handleError(_0x46b760,null));};exports[_0x934d('0xe2')]=function(_0x5f4c96,_0xfbdf08,_0x7ee685){return db[_0x934d('0x53')][_0x934d('0x5b')]({'where':{'id':_0x5f4c96['params']['id']}})[_0x934d('0x21')](handleEntityNotFound(_0xfbdf08,null))[_0x934d('0x21')](function(_0x48c3cb){if(_0x48c3cb){return _0x48c3cb[_0x934d('0xe2')](_0x5f4c96['body']['ids'],_[_0x934d('0xa3')](_0x5f4c96[_0x934d('0x65')],[_0x934d('0x6e'),'id'])||{})[_0x934d('0xa6')](function(_0x47bf01){for(var _0x5dbfd=0x0;_0x5dbfd<_0x5f4c96['body'][_0x934d('0x6e')]['length'];_0x5dbfd+=0x1){socket[_0x934d('0xe3')](_0x934d('0xe4'),{'UserId':Number(_0x5f4c96[_0x934d('0x65')][_0x934d('0x6e')][_0x5dbfd]),'SmsAccountId':Number(_0x5f4c96[_0x934d('0x59')]['id'])});}return _0x47bf01;});}})['then'](respondWithResult(_0xfbdf08,null))[_0x934d('0x2a')](handleError(_0xfbdf08,null));};exports[_0x934d('0xe5')]=function(_0x436b53,_0x510ded,_0x15da5a){return db['SmsAccount']['find']({'where':{'id':_0x436b53[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x510ded,null))['then'](function(_0x567393){if(_0x567393){return _0x567393['removeAgents'](_0x436b53['query'][_0x934d('0x6e')])['then'](function(){if(_[_0x934d('0xe6')](_0x436b53['query']['ids'])){for(var _0x133b29=0x0;_0x133b29<_0x436b53[_0x934d('0x44')][_0x934d('0x6e')][_0x934d('0x49')];_0x133b29+=0x1){socket[_0x934d('0xe3')](_0x934d('0xe7'),{'UserId':Number(_0x436b53[_0x934d('0x44')]['ids'][_0x133b29]),'SmsAccountId':Number(_0x436b53[_0x934d('0x59')]['id'])});}}else{socket[_0x934d('0xe3')](_0x934d('0xe7'),{'UserId':Number(_0x436b53[_0x934d('0x44')][_0x934d('0x6e')]),'SmsAccountId':Number(_0x436b53['params']['id'])});}});}})['then'](respondWithStatusCode(_0x510ded,null))[_0x934d('0x2a')](handleError(_0x510ded,null));};exports[_0x934d('0xe8')]=function(_0x1e1e8f,_0x386b97,_0x8d8335){var _0x3cf5ad={};var _0x588746={};var _0x2ae05a;var _0x322aad;return db[_0x934d('0x53')][_0x934d('0x6a')]({'where':{'id':_0x1e1e8f[_0x934d('0x59')]['id']}})[_0x934d('0x21')](handleEntityNotFound(_0x386b97,null))['then'](function(_0x4674bb){if(_0x4674bb){_0x2ae05a=_0x4674bb;_0x588746[_0x934d('0x5a')]=_[_0x934d('0x43')](db[_0x934d('0xb0')][_0x934d('0x72')]);_0x588746[_0x934d('0x44')]=_[_0x934d('0x43')](_0x1e1e8f[_0x934d('0x44')]);_0x588746[_0x934d('0x45')]=_[_0x934d('0x47')](_0x588746['model'],_0x588746[_0x934d('0x44')]);_0x3cf5ad[_0x934d('0x46')]=_['intersection'](_0x588746[_0x934d('0x5a')],qs[_0x934d('0x48')](_0x1e1e8f[_0x934d('0x44')][_0x934d('0x48')]));_0x3cf5ad['attributes']=_0x3cf5ad[_0x934d('0x46')][_0x934d('0x49')]?_0x3cf5ad[_0x934d('0x46')]:_0x588746[_0x934d('0x5a')];_0x3cf5ad['order']=qs['sort'](_0x1e1e8f[_0x934d('0x44')][_0x934d('0x4c')]);_0x3cf5ad[_0x934d('0x4e')]=qs[_0x934d('0x45')](_[_0x934d('0x4d')](_0x1e1e8f[_0x934d('0x44')],_0x588746[_0x934d('0x45')]));if(_0x1e1e8f[_0x934d('0x44')][_0x934d('0x51')]){_0x3cf5ad[_0x934d('0x4e')]=_[_0x934d('0x4f')](_0x3cf5ad[_0x934d('0x4e')],{'$or':_['map'](_0x3cf5ad[_0x934d('0x46')],function(_0x3911c7){var _0x128b52={};_0x128b52[_0x3911c7]={'$like':'%'+_0x1e1e8f[_0x934d('0x44')][_0x934d('0x51')]+'%'};return _0x128b52;})});}_0x3cf5ad=_[_0x934d('0x4f')]({},_0x3cf5ad,_0x1e1e8f[_0x934d('0x52')]);return _0x2ae05a['getAgents'](_0x3cf5ad);}})['then'](function(_0x144f34){if(_0x144f34){_0x322aad=_0x144f34['length'];if(!_0x1e1e8f['query']['hasOwnProperty'](_0x934d('0x6c'))){_0x3cf5ad[_0x934d('0x31')]=qs[_0x934d('0x31')](_0x1e1e8f[_0x934d('0x44')]['limit']);_0x3cf5ad[_0x934d('0x2e')]=qs['offset'](_0x1e1e8f[_0x934d('0x44')]['offset']);}return _0x2ae05a[_0x934d('0xe8')](_0x3cf5ad);}})[_0x934d('0x21')](function(_0x494348){if(_0x494348){return _0x494348?{'count':_0x322aad,'rows':_0x494348}:null;}})[_0x934d('0x21')](respondWithResult(_0x386b97,null))[_0x934d('0x2a')](handleError(_0x386b97,null));}; \ No newline at end of file +var _0xb2e6=['fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','SmsAccountId','Disposition','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','Applications','account','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','twilio','from','From','MessageSid','skebby','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','results','originatingAddress','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','list','omit','CmContact','contact','SmsInteraction','created','autoclose','push','close','unmanaged','*,*,*,*','interaction','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','user','out','SmsMessage','spread','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','infobip','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','csc','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','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/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0xb2e6,0x186));var _0x6b2e=function(_0xf7be62,_0x1be268){_0xf7be62=_0xf7be62-0x0;var _0x4b6318=_0xb2e6[_0xf7be62];return _0x4b6318;};'use strict';var emlformat=require(_0x6b2e('0x0'));var rimraf=require(_0x6b2e('0x1'));var zipdir=require(_0x6b2e('0x2'));var jsonpatch=require(_0x6b2e('0x3'));var rp=require('request-promise');var moment=require(_0x6b2e('0x4'));var BPromise=require(_0x6b2e('0x5'));var Mustache=require(_0x6b2e('0x6'));var util=require(_0x6b2e('0x7'));var path=require('path');var sox=require(_0x6b2e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b2e('0x9'));var _=require(_0x6b2e('0xa'));var squel=require(_0x6b2e('0xb'));var crypto=require(_0x6b2e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6b2e('0xd'));var querystring=require(_0x6b2e('0xe'));var Papa=require(_0x6b2e('0xf'));var Redis=require('ioredis');var authService=require(_0x6b2e('0x10'));var qs=require(_0x6b2e('0x11'));var as=require(_0x6b2e('0x12'));var hardwareService=require(_0x6b2e('0x13'));var logger=require(_0x6b2e('0x14'))(_0x6b2e('0x15'));var utils=require('../../config/utils');var config=require(_0x6b2e('0x16'));var licenseUtil=require(_0x6b2e('0x17'));var db=require(_0x6b2e('0x18'))['db'];config['redis']=_[_0x6b2e('0x19')](config['redis'],{'host':_0x6b2e('0x1a'),'port':0x18eb});var socket=require(_0x6b2e('0x1b'))(new Redis(config[_0x6b2e('0x1c')]));require(_0x6b2e('0x1d'))[_0x6b2e('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6b2e('0x1f')][_0x6b2e('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x28c61f,_0x3483f2,_0x267533,_0x21309e){return new BPromise(function(_0x1cd7b0,_0x2d85e9){var _0x5a4b70=_0x21309e||client;return _0x5a4b70[_0x6b2e('0x21')](_0x28c61f,_0x267533)[_0x6b2e('0x22')](function(_0x4aec3a){logger[_0x6b2e('0x23')](_0x6b2e('0x24'),_0x3483f2,_0x6b2e('0x25'));logger[_0x6b2e('0x26')](_0x6b2e('0x27'),_0x3483f2,_0x6b2e('0x25'),JSON[_0x6b2e('0x28')](_0x4aec3a));if(_0x4aec3a[_0x6b2e('0x29')]){if(_0x4aec3a[_0x6b2e('0x29')][_0x6b2e('0x2a')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x3483f2,_0x4aec3a[_0x6b2e('0x29')][_0x6b2e('0x2b')]);return _0x2d85e9(_0x4aec3a[_0x6b2e('0x29')][_0x6b2e('0x2b')]);}logger[_0x6b2e('0x29')](_0x6b2e('0x24'),_0x3483f2,_0x4aec3a[_0x6b2e('0x29')][_0x6b2e('0x2b')]);return _0x1cd7b0(_0x4aec3a[_0x6b2e('0x29')][_0x6b2e('0x2b')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x3483f2,_0x6b2e('0x25'));_0x1cd7b0(_0x4aec3a[_0x6b2e('0x2c')]['message']);}})['catch'](function(_0x5de714){logger['error'](_0x6b2e('0x24'),_0x3483f2,_0x5de714);_0x2d85e9(_0x5de714);});});}function respondWithStatusCode(_0x29f842,_0xbb9653){_0xbb9653=_0xbb9653||0xcc;return function(_0x195fab){if(_0x195fab){return _0x29f842[_0x6b2e('0x2d')](_0xbb9653);}return _0x29f842['status'](_0xbb9653)[_0x6b2e('0x2e')]();};}function respondWithResult(_0x58964e,_0x350d38){_0x350d38=_0x350d38||0xc8;return function(_0x548bf5){if(_0x548bf5){return _0x58964e[_0x6b2e('0x2f')](_0x350d38)[_0x6b2e('0x30')](_0x548bf5);}};}function respondWithFilteredResult(_0x418754,_0x4f9731){return function(_0x1068d6){if(_0x1068d6){var _0x2dae87=typeof _0x4f9731[_0x6b2e('0x31')]===_0x6b2e('0x32')&&typeof _0x4f9731['limit']===_0x6b2e('0x32');var _0x324eb6=_0x1068d6[_0x6b2e('0x33')];var _0x37c9b4=_0x2dae87?0x0:_0x4f9731[_0x6b2e('0x31')];var _0xdaeb48=_0x2dae87?_0x1068d6[_0x6b2e('0x33')]:_0x4f9731[_0x6b2e('0x31')]+_0x4f9731[_0x6b2e('0x34')];var _0x34a1e3;if(_0xdaeb48>=_0x324eb6){_0xdaeb48=_0x324eb6;_0x34a1e3=0xc8;}else{_0x34a1e3=0xce;}_0x418754[_0x6b2e('0x2f')](_0x34a1e3);return _0x418754['set'](_0x6b2e('0x35'),_0x37c9b4+'-'+_0xdaeb48+'/'+_0x324eb6)[_0x6b2e('0x30')](_0x1068d6);}return null;};}function patchUpdates(_0x260ce3){return function(_0x1f96e0){try{jsonpatch[_0x6b2e('0x36')](_0x1f96e0,_0x260ce3,!![]);}catch(_0x31493e){return BPromise[_0x6b2e('0x37')](_0x31493e);}return _0x1f96e0[_0x6b2e('0x38')]();};}function saveUpdates(_0x51402,_0x5a6154){return function(_0x32875c){if(_0x32875c){return _0x32875c[_0x6b2e('0x39')](_0x51402)['then'](function(_0x50ca7b){return _0x50ca7b;});}return null;};}function removeEntity(_0x33a0ad,_0xf8956){return function(_0x2a44cd){if(_0x2a44cd){return _0x2a44cd[_0x6b2e('0x3a')]()[_0x6b2e('0x22')](function(){var _0x148c97=_0x2a44cd[_0x6b2e('0x3b')]({'plain':!![]});var _0x3ef552=_0x6b2e('0x3c');return db['UserProfileResource'][_0x6b2e('0x3a')]({'where':{'type':_0x3ef552,'resourceId':_0x148c97['id']}})['then'](function(){return _0x2a44cd;});})[_0x6b2e('0x22')](function(){_0x33a0ad[_0x6b2e('0x2f')](0xcc)[_0x6b2e('0x2e')]();});}};}function handleEntityNotFound(_0x441a70,_0x2d3345){return function(_0x238b75){if(!_0x238b75){_0x441a70['sendStatus'](0x194);}return _0x238b75;};}function handleError(_0x416a69,_0x557e6a){_0x557e6a=_0x557e6a||0x1f4;return function(_0x57a60b){logger[_0x6b2e('0x29')](_0x57a60b[_0x6b2e('0x3d')]);if(_0x57a60b['name']){delete _0x57a60b[_0x6b2e('0x3e')];}_0x416a69['status'](_0x557e6a)[_0x6b2e('0x3f')](_0x57a60b);};}exports[_0x6b2e('0x40')]=function(_0x3f1c8b,_0x2e785a){var _0x1d504f={'include':[{'model':db['Pause'],'as':_0x6b2e('0x41')}]},_0x13d8cc={},_0x4ec672={'count':0x0,'rows':[]};var _0x51c679=_[_0x6b2e('0x42')](db[_0x6b2e('0x43')][_0x6b2e('0x44')],function(_0x437752){return{'name':_0x437752[_0x6b2e('0x45')],'type':_0x437752[_0x6b2e('0x46')][_0x6b2e('0x47')]};});_0x13d8cc[_0x6b2e('0x48')]=_[_0x6b2e('0x42')](_0x51c679,_0x6b2e('0x3e'));_0x13d8cc[_0x6b2e('0x49')]=_[_0x6b2e('0x4a')](_0x3f1c8b['query']);_0x13d8cc[_0x6b2e('0x4b')]=_[_0x6b2e('0x4c')](_0x13d8cc['model'],_0x13d8cc[_0x6b2e('0x49')]);_0x1d504f[_0x6b2e('0x4d')]=_[_0x6b2e('0x4c')](_0x13d8cc[_0x6b2e('0x48')],qs[_0x6b2e('0x4e')](_0x3f1c8b[_0x6b2e('0x49')][_0x6b2e('0x4e')]));_0x1d504f[_0x6b2e('0x4d')]=_0x1d504f['attributes'][_0x6b2e('0x4f')]?_0x1d504f[_0x6b2e('0x4d')]:_0x13d8cc[_0x6b2e('0x48')];if(!_0x3f1c8b[_0x6b2e('0x49')][_0x6b2e('0x50')](_0x6b2e('0x51'))){_0x1d504f[_0x6b2e('0x34')]=qs[_0x6b2e('0x34')](_0x3f1c8b[_0x6b2e('0x49')][_0x6b2e('0x34')]);_0x1d504f['offset']=qs[_0x6b2e('0x31')](_0x3f1c8b[_0x6b2e('0x49')][_0x6b2e('0x31')]);}_0x1d504f['order']=qs['sort'](_0x3f1c8b[_0x6b2e('0x49')][_0x6b2e('0x52')]);_0x1d504f['where']=qs['filters'](_['pick'](_0x3f1c8b[_0x6b2e('0x49')],_0x13d8cc[_0x6b2e('0x4b')]),_0x51c679);if(_0x3f1c8b[_0x6b2e('0x49')][_0x6b2e('0x53')]){_0x1d504f[_0x6b2e('0x54')]=_['merge'](_0x1d504f[_0x6b2e('0x54')],{'$or':_[_0x6b2e('0x42')](_0x51c679,function(_0x4227aa){if(_0x4227aa['type']!=='VIRTUAL'){var _0x5e94e0={};_0x5e94e0[_0x4227aa[_0x6b2e('0x3e')]]={'$like':'%'+_0x3f1c8b[_0x6b2e('0x49')][_0x6b2e('0x53')]+'%'};return _0x5e94e0;}})});}_0x1d504f=_[_0x6b2e('0x55')]({},_0x1d504f,_0x3f1c8b[_0x6b2e('0x56')]);var _0x2e500a={'where':_0x1d504f[_0x6b2e('0x54')]};return db[_0x6b2e('0x43')][_0x6b2e('0x33')](_0x2e500a)[_0x6b2e('0x22')](function(_0x1e74b6){_0x4ec672['count']=_0x1e74b6;if(_0x3f1c8b['query'][_0x6b2e('0x57')]){_0x1d504f[_0x6b2e('0x58')]=[{'all':!![]}];}return db[_0x6b2e('0x43')][_0x6b2e('0x59')](_0x1d504f);})[_0x6b2e('0x22')](function(_0x4bc553){_0x4ec672[_0x6b2e('0x5a')]=_0x4bc553;return _0x4ec672;})[_0x6b2e('0x22')](respondWithFilteredResult(_0x2e785a,_0x1d504f))['catch'](handleError(_0x2e785a,null));};exports[_0x6b2e('0x5b')]=function(_0x5e0b68,_0x21411c){var _0x446c6a={'raw':![],'where':{'id':_0x5e0b68[_0x6b2e('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x6b2e('0x41')}]},_0x56b512={};_0x56b512['model']=_[_0x6b2e('0x4a')](db[_0x6b2e('0x43')][_0x6b2e('0x44')]);_0x56b512[_0x6b2e('0x49')]=_[_0x6b2e('0x4a')](_0x5e0b68[_0x6b2e('0x49')]);_0x56b512['filters']=_['intersection'](_0x56b512[_0x6b2e('0x48')],_0x56b512[_0x6b2e('0x49')]);_0x446c6a[_0x6b2e('0x4d')]=_[_0x6b2e('0x4c')](_0x56b512[_0x6b2e('0x48')],qs[_0x6b2e('0x4e')](_0x5e0b68[_0x6b2e('0x49')][_0x6b2e('0x4e')]));_0x446c6a[_0x6b2e('0x4d')]=_0x446c6a[_0x6b2e('0x4d')]['length']?_0x446c6a['attributes']:_0x56b512[_0x6b2e('0x48')];if(_0x5e0b68[_0x6b2e('0x49')]['includeAll']){_0x446c6a[_0x6b2e('0x58')]=[{'all':!![]}];}_0x446c6a=_[_0x6b2e('0x55')]({},_0x446c6a,_0x5e0b68[_0x6b2e('0x56')]);return db[_0x6b2e('0x43')][_0x6b2e('0x5d')](_0x446c6a)[_0x6b2e('0x22')](handleEntityNotFound(_0x21411c,null))[_0x6b2e('0x22')](respondWithResult(_0x21411c,null))[_0x6b2e('0x5e')](handleError(_0x21411c,null));};exports[_0x6b2e('0x5f')]=function(_0x2a7703,_0x187a1e){return db[_0x6b2e('0x43')][_0x6b2e('0x5f')](_0x2a7703[_0x6b2e('0x60')],{})[_0x6b2e('0x22')](function(_0x112599){var _0x579a90=_0x2a7703['user'][_0x6b2e('0x3b')]({'plain':!![]});if(!_0x579a90)throw new Error(_0x6b2e('0x61'));if(_0x579a90[_0x6b2e('0x62')]==='user'){var _0x944776=_0x112599[_0x6b2e('0x3b')]({'plain':!![]});var _0x54702a=_0x6b2e('0x3c');return db[_0x6b2e('0x63')][_0x6b2e('0x5d')]({'where':{'name':_0x54702a,'userProfileId':_0x579a90[_0x6b2e('0x64')]},'raw':!![]})['then'](function(_0x25d26c){if(_0x25d26c&&_0x25d26c[_0x6b2e('0x65')]===0x0){return db['UserProfileResource'][_0x6b2e('0x5f')]({'name':_0x944776[_0x6b2e('0x3e')],'resourceId':_0x944776['id'],'type':_0x25d26c[_0x6b2e('0x3e')],'sectionId':_0x25d26c['id']},{})['then'](function(){return _0x112599;});}else{return _0x112599;}})[_0x6b2e('0x5e')](function(_0x5084e4){logger[_0x6b2e('0x29')](_0x6b2e('0x66'),_0x5084e4);throw _0x5084e4;});}return _0x112599;})['then'](respondWithResult(_0x187a1e,0xc9))['catch'](handleError(_0x187a1e,null));};exports[_0x6b2e('0x39')]=function(_0x5121e8,_0x26c70b){if(_0x5121e8[_0x6b2e('0x60')]['id']){delete _0x5121e8['body']['id'];}return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0x5121e8[_0x6b2e('0x5c')]['id']},'include':[{'model':db[_0x6b2e('0x67')],'as':_0x6b2e('0x41')}]})[_0x6b2e('0x22')](handleEntityNotFound(_0x26c70b,null))[_0x6b2e('0x22')](saveUpdates(_0x5121e8[_0x6b2e('0x60')],null))[_0x6b2e('0x22')](respondWithResult(_0x26c70b,null))[_0x6b2e('0x5e')](handleError(_0x26c70b,null));};exports[_0x6b2e('0x3a')]=function(_0x3c58bb,_0x35911e){return db['SmsAccount']['find']({'where':{'id':_0x3c58bb[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x35911e,null))[_0x6b2e('0x22')](removeEntity(_0x35911e,null))[_0x6b2e('0x5e')](handleError(_0x35911e,null));};exports[_0x6b2e('0x68')]=function(_0x13a2b8,_0x3d2ae6){return db['SmsAccount']['describe']()[_0x6b2e('0x22')](respondWithResult(_0x3d2ae6,null))['catch'](handleError(_0x3d2ae6,null));};exports['addDisposition']=function(_0x453dff,_0x1f778d,_0x999c2e){if(_0x453dff[_0x6b2e('0x60')]['id']){delete _0x453dff[_0x6b2e('0x60')]['id'];}return db[_0x6b2e('0x43')]['find']({'where':{'id':_0x453dff[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x1f778d,null))['then'](function(_0x3b84e5){if(_0x3b84e5){_0x453dff[_0x6b2e('0x60')][_0x6b2e('0x69')]=_0x3b84e5['id'];return db[_0x6b2e('0x6a')][_0x6b2e('0x5f')](_0x453dff[_0x6b2e('0x60')]);}})['then'](respondWithResult(_0x1f778d,null))[_0x6b2e('0x5e')](handleError(_0x1f778d,null));};exports[_0x6b2e('0x6b')]=function(_0xfd5340,_0x3d4495,_0x24b798){var _0xe90801={'raw':![],'where':{}};var _0x293fe6={};var _0x5034df={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6b2e('0x6c')]({'where':{'id':_0xfd5340[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x3d4495,null))[_0x6b2e('0x22')](function(_0x3b0f7f){if(_0x3b0f7f){_0x293fe6[_0x6b2e('0x48')]=_[_0x6b2e('0x4a')](db[_0x6b2e('0x6a')][_0x6b2e('0x44')]);_0x293fe6['query']=_['keys'](_0xfd5340[_0x6b2e('0x49')]);_0x293fe6[_0x6b2e('0x4b')]=_['intersection'](_0x293fe6[_0x6b2e('0x48')],_0x293fe6['query']);_0xe90801[_0x6b2e('0x4d')]=_['intersection'](_0x293fe6[_0x6b2e('0x48')],qs['fields'](_0xfd5340[_0x6b2e('0x49')][_0x6b2e('0x4e')]));_0xe90801[_0x6b2e('0x4d')]=_0xe90801[_0x6b2e('0x4d')][_0x6b2e('0x4f')]?_0xe90801[_0x6b2e('0x4d')]:_0x293fe6[_0x6b2e('0x48')];if(!_0xfd5340[_0x6b2e('0x49')][_0x6b2e('0x50')](_0x6b2e('0x51'))){_0xe90801[_0x6b2e('0x34')]=qs[_0x6b2e('0x34')](_0xfd5340[_0x6b2e('0x49')][_0x6b2e('0x34')]);_0xe90801['offset']=qs[_0x6b2e('0x31')](_0xfd5340['query'][_0x6b2e('0x31')]);}_0xe90801[_0x6b2e('0x6d')]=qs[_0x6b2e('0x52')](_0xfd5340[_0x6b2e('0x49')][_0x6b2e('0x52')]);_0xe90801[_0x6b2e('0x54')]=qs[_0x6b2e('0x4b')](_[_0x6b2e('0x6e')](_0xfd5340[_0x6b2e('0x49')],_0x293fe6[_0x6b2e('0x4b')]));_0xe90801[_0x6b2e('0x54')][_0x6b2e('0x69')]=_0x3b0f7f['id'];if(_0xfd5340['query'][_0x6b2e('0x53')]){_0xe90801[_0x6b2e('0x54')]=_[_0x6b2e('0x55')](_0xe90801[_0x6b2e('0x54')],{'$or':_['map'](_0xe90801[_0x6b2e('0x4d')],function(_0x233c1f){var _0x1e3eca={};_0x1e3eca[_0x233c1f]={'$like':'%'+_0xfd5340[_0x6b2e('0x49')]['filter']+'%'};return _0x1e3eca;})});}_0xe90801=_[_0x6b2e('0x55')]({},_0xe90801,_0xfd5340['options']);return db[_0x6b2e('0x6a')][_0x6b2e('0x33')]({'where':_0xe90801[_0x6b2e('0x54')]})[_0x6b2e('0x22')](function(_0x115899){_0x5034df['count']=_0x115899;if(_0xfd5340[_0x6b2e('0x49')][_0x6b2e('0x57')]){_0xe90801[_0x6b2e('0x58')]=[{'all':!![]}];}return db[_0x6b2e('0x6a')][_0x6b2e('0x59')](_0xe90801);})[_0x6b2e('0x22')](function(_0x41e271){_0x5034df[_0x6b2e('0x5a')]=_0x41e271;return _0x5034df;});}})[_0x6b2e('0x22')](respondWithFilteredResult(_0x3d4495,_0xe90801))[_0x6b2e('0x5e')](handleError(_0x3d4495,null));};exports['removeDispositions']=function(_0x15b0df,_0x1fd844,_0xe2c5ae){return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0x15b0df[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x1fd844,null))[_0x6b2e('0x22')](function(_0x5708ed){if(_0x5708ed){return _0x5708ed[_0x6b2e('0x6f')](_0x15b0df[_0x6b2e('0x49')][_0x6b2e('0x70')]);}})[_0x6b2e('0x22')](respondWithStatusCode(_0x1fd844,null))['catch'](handleError(_0x1fd844,null));};exports[_0x6b2e('0x71')]=function(_0x1549af,_0x474050,_0x9f16ae){if(_0x1549af['body']['id']){delete _0x1549af['body']['id'];}return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0x1549af[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x474050,null))[_0x6b2e('0x22')](function(_0x309cb3){if(_0x309cb3){_0x1549af[_0x6b2e('0x60')][_0x6b2e('0x69')]=_0x309cb3['id'];return db['CannedAnswer']['create'](_0x1549af['body']);}})[_0x6b2e('0x22')](respondWithResult(_0x474050,null))['catch'](handleError(_0x474050,null));};exports[_0x6b2e('0x72')]=function(_0x2ca0fc,_0x4e9ac6,_0x2f5ee1){var _0xa19dfc={'raw':![],'where':{}};var _0x599982={};var _0xb8f1cf={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2ca0fc['params']['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x4e9ac6,null))[_0x6b2e('0x22')](function(_0xbb851c){if(_0xbb851c){_0x599982[_0x6b2e('0x48')]=_[_0x6b2e('0x4a')](db['CannedAnswer']['rawAttributes']);_0x599982[_0x6b2e('0x49')]=_[_0x6b2e('0x4a')](_0x2ca0fc[_0x6b2e('0x49')]);_0x599982['filters']=_[_0x6b2e('0x4c')](_0x599982[_0x6b2e('0x48')],_0x599982[_0x6b2e('0x49')]);_0xa19dfc[_0x6b2e('0x4d')]=_['intersection'](_0x599982[_0x6b2e('0x48')],qs[_0x6b2e('0x4e')](_0x2ca0fc[_0x6b2e('0x49')][_0x6b2e('0x4e')]));_0xa19dfc[_0x6b2e('0x4d')]=_0xa19dfc[_0x6b2e('0x4d')][_0x6b2e('0x4f')]?_0xa19dfc['attributes']:_0x599982[_0x6b2e('0x48')];if(!_0x2ca0fc[_0x6b2e('0x49')][_0x6b2e('0x50')]('nolimit')){_0xa19dfc['limit']=qs[_0x6b2e('0x34')](_0x2ca0fc[_0x6b2e('0x49')][_0x6b2e('0x34')]);_0xa19dfc[_0x6b2e('0x31')]=qs[_0x6b2e('0x31')](_0x2ca0fc['query']['offset']);}_0xa19dfc['order']=qs[_0x6b2e('0x52')](_0x2ca0fc[_0x6b2e('0x49')]['sort']);_0xa19dfc['where']=qs['filters'](_[_0x6b2e('0x6e')](_0x2ca0fc['query'],_0x599982[_0x6b2e('0x4b')]));_0xa19dfc['where'][_0x6b2e('0x69')]=_0xbb851c['id'];if(_0x2ca0fc['query'][_0x6b2e('0x53')]){_0xa19dfc['where']=_[_0x6b2e('0x55')](_0xa19dfc['where'],{'$or':_['map'](_0xa19dfc[_0x6b2e('0x4d')],function(_0x425533){var _0x260e52={};_0x260e52[_0x425533]={'$like':'%'+_0x2ca0fc[_0x6b2e('0x49')]['filter']+'%'};return _0x260e52;})});}_0xa19dfc=_['merge']({},_0xa19dfc,_0x2ca0fc[_0x6b2e('0x56')]);return db['CannedAnswer'][_0x6b2e('0x33')]({'where':_0xa19dfc[_0x6b2e('0x54')]})[_0x6b2e('0x22')](function(_0x30123d){_0xb8f1cf['count']=_0x30123d;if(_0x2ca0fc[_0x6b2e('0x49')][_0x6b2e('0x57')]){_0xa19dfc[_0x6b2e('0x58')]=[{'all':!![]}];}return db[_0x6b2e('0x73')]['findAll'](_0xa19dfc);})[_0x6b2e('0x22')](function(_0x25810a){_0xb8f1cf[_0x6b2e('0x5a')]=_0x25810a;return _0xb8f1cf;});}})['then'](respondWithFilteredResult(_0x4e9ac6,_0xa19dfc))[_0x6b2e('0x5e')](handleError(_0x4e9ac6,null));};exports[_0x6b2e('0x74')]=function(_0x292bd8,_0x2117c7,_0x596fb1){return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0x292bd8[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x2117c7,null))[_0x6b2e('0x22')](function(_0x55a57d){if(_0x55a57d){return _0x55a57d[_0x6b2e('0x74')](_0x292bd8[_0x6b2e('0x49')][_0x6b2e('0x70')]);}})['then'](respondWithStatusCode(_0x2117c7,null))['catch'](handleError(_0x2117c7,null));};exports[_0x6b2e('0x75')]=function(_0x1eb62b,_0x2afcaf,_0x3b4757){var _0x349cbd={'channel':'sms'};var _0x34069e=[];var _0x4d64e9=[];var _0x2b0b00={};return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0x1eb62b[_0x6b2e('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x6b2e('0x76')}]})['then'](handleEntityNotFound(_0x2afcaf,null))['then'](function(_0x5c6ada){_0x349cbd[_0x6b2e('0x77')]=_0x5c6ada;_0x349cbd[_0x6b2e('0x78')]=_[_0x6b2e('0x79')](_0x5c6ada[_0x6b2e('0x76')],['priority'],[_0x6b2e('0x7a')]);if(_0x349cbd[_0x6b2e('0x77')][_0x6b2e('0x76')]){delete _0x349cbd['account'][_0x6b2e('0x76')];}return db['CmContact']['describe']();})['then'](function(_0x25a6d9){if(!_0x25a6d9){throw new db[(_0x6b2e('0x7b'))][(_0x6b2e('0x7c'))](_0x6b2e('0x7d'));}_0x34069e=_[_0x6b2e('0x7e')](_[_0x6b2e('0x4a')](_0x25a6d9),['createdAt',_0x6b2e('0x7f')]);_0x4d64e9=_[_0x6b2e('0x7e')](_[_0x6b2e('0x4a')](_0x25a6d9),[_0x6b2e('0x80'),_0x6b2e('0x7f'),'CompanyId',_0x6b2e('0x81')]);_0x349cbd[_0x6b2e('0x60')]={'mapKey':'mobile'};if(_0x349cbd['account']['type']){switch(_0x349cbd['account'][_0x6b2e('0x46')]){case _0x6b2e('0x82'):_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')]=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x84')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b[_0x6b2e('0x60')]['Body'];_0x349cbd[_0x6b2e('0x60')]['messageId']=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x85')];break;case _0x6b2e('0x86'):_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')]='+'+_0x1eb62b['body']['sender'];_0x349cbd[_0x6b2e('0x60')]['body']=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x87')];break;case _0x6b2e('0x88'):_0x349cbd[_0x6b2e('0x60')]['from']=_0x1eb62b['body'][_0x6b2e('0x83')];_0x349cbd['body'][_0x6b2e('0x60')]=_0x1eb62b['body'][_0x6b2e('0x2b')];break;case _0x6b2e('0x89'):_0x349cbd[_0x6b2e('0x60')]['from']=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x83')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x60')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x8a')]=_0x1eb62b['body'][_0x6b2e('0x8b')];break;case _0x6b2e('0x8c'):_0x349cbd[_0x6b2e('0x60')]['from']=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x84')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b['body'][_0x6b2e('0x8d')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x8a')]=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x8e')];break;case'infobip':_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')]='+'+_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x8f')][0x0][_0x6b2e('0x83')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x8f')][0x0][_0x6b2e('0x87')];_0x349cbd['body']['messageId']=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x8f')][0x0]['messageId'];break;case'csc':_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')]=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x90')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b[_0x6b2e('0x60')]['segmentedMessage'][_0x6b2e('0x2b')];break;case _0x6b2e('0x91'):_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')]=_0x1eb62b[_0x6b2e('0x60')]['fromNumber'];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x87')];_0x349cbd[_0x6b2e('0x60')]['messageId']=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x92')];break;case _0x6b2e('0x93'):_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x8a')]=_0x1eb62b['body'][0x0][_0x6b2e('0x2b')]['id'];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')]=_0x1eb62b[_0x6b2e('0x60')][0x0][_0x6b2e('0x2b')]['from'];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b[_0x6b2e('0x60')][0x0][_0x6b2e('0x2b')]['text'];break;case _0x6b2e('0x94'):_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')]=_0x1eb62b['body'][_0x6b2e('0x83')];_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]=_0x1eb62b['body'][_0x6b2e('0x2b')];_0x349cbd['body'][_0x6b2e('0x8a')]=_0x1eb62b[_0x6b2e('0x60')][_0x6b2e('0x95')];break;}}if(_0x349cbd[_0x6b2e('0x60')]['id']){delete _0x349cbd[_0x6b2e('0x60')]['id'];}if(_[_0x6b2e('0x96')](_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')])){throw new db[(_0x6b2e('0x7b'))]['ValidationError'](_0x6b2e('0x97'));}if(_[_0x6b2e('0x96')](_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')])||_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')]===''){throw new db[(_0x6b2e('0x7b'))][(_0x6b2e('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6b2e('0x96')](_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x98')])){throw new db[(_0x6b2e('0x7b'))][(_0x6b2e('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4d64e9);}if(!_[_0x6b2e('0x99')](_0x4d64e9,_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x98')])){throw new db[(_0x6b2e('0x7b'))][(_0x6b2e('0x7c'))](_0x6b2e('0x9a')+_0x4d64e9);}_0x2b0b00[_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x98')]]=_0x349cbd['body'][_0x6b2e('0x83')];return db['CmList']['find']({'where':{'id':_0x349cbd[_0x6b2e('0x77')][_0x6b2e('0x81')]},'include':[{'model':db['CmContact'],'as':_0x6b2e('0x9b'),'where':_0x2b0b00,'limit':0x1,'order':[[_0x6b2e('0x7f'),'DESC']]}]});})[_0x6b2e('0x22')](handleEntityNotFound(_0x2afcaf,null))['then'](function(_0x53aa01){if(_0x53aa01){_0x349cbd[_0x6b2e('0x9c')]=_[_0x6b2e('0x9d')](_0x53aa01,[_0x6b2e('0x9b')]);if(_0x53aa01['Contacts'][_0x6b2e('0x4f')]){return _0x53aa01[_0x6b2e('0x9b')][0x0];}var _0xee103f=_[_0x6b2e('0x19')](_0x349cbd[_0x6b2e('0x60')],{'firstName':_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')],'ListId':_0x53aa01['id']});_0xee103f[_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x98')]]=_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')];return db[_0x6b2e('0x9e')][_0x6b2e('0x5f')](_0xee103f,{'fields':_0x34069e,'raw':!![]});}})['then'](handleEntityNotFound(_0x2afcaf,null))[_0x6b2e('0x22')](function(_0x2b4398){if(_0x2b4398){_0x349cbd[_0x6b2e('0x9f')]=_0x2b4398;var _0x5fab79={'ContactId':_0x2b4398['id'],'phone':_0x349cbd['body'][_0x6b2e('0x83')],'SmsAccountId':_0x1eb62b[_0x6b2e('0x5c')]['id']};var _0xc41712={'ContactId':_0x2b4398['id'],'SmsAccountId':_0x1eb62b[_0x6b2e('0x5c')]['id'],'closed':![]};return db[_0x6b2e('0xa0')][_0x6b2e('0x5d')]({'where':_0xc41712})[_0x6b2e('0x22')](function(_0x1075d3){if(_0x1075d3){return[_0x1075d3,![]];}return db[_0x6b2e('0xa0')][_0x6b2e('0x5f')](_0x5fab79)['then'](function(_0x95429b){return[_0x95429b,!![]];});});}})['spread'](function(_0x2c6eb7,_0x56fc82){_0x349cbd['interaction']=_0x2c6eb7[_0x6b2e('0x3b')]({'plain':!![]});_0x349cbd['interaction'][_0x6b2e('0xa1')]=![];if(_0x56fc82){if(_0x349cbd[_0x6b2e('0x77')][_0x6b2e('0xa2')]){_0x349cbd[_0x6b2e('0x78')][_0x6b2e('0xa3')]({'id':0x0,'priority':_0x349cbd[_0x6b2e('0x78')][_0x6b2e('0x4f')]+0x1,'app':_0x6b2e('0xa4'),'appdata':_0x6b2e('0xa5'),'interval':_0x6b2e('0xa6')});}_0x349cbd[_0x6b2e('0xa7')]['created']=!![];}return db['SmsMessage'][_0x6b2e('0x5f')]({'phone':_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x83')],'messageId':_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x8a')],'body':_0x349cbd[_0x6b2e('0x60')][_0x6b2e('0x60')],'SmsAccountId':_0x1eb62b[_0x6b2e('0x5c')]['id'],'SmsInteractionId':_0x2c6eb7['id'],'direction':'in','ContactId':_0x2c6eb7['ContactId'],'AttachmentId':_0x349cbd[_0x6b2e('0x60')]['AttachmentId']});})[_0x6b2e('0x22')](function(_0x3f7d5e){_0x349cbd['message']=_0x3f7d5e;if(_0x349cbd[_0x6b2e('0xa7')][_0x6b2e('0xa8')]){return db[_0x6b2e('0xa9')][_0x6b2e('0x5d')]({'attributes':['id',_0x6b2e('0x3e')],'where':{'id':_0x349cbd[_0x6b2e('0xa7')][_0x6b2e('0xa8')]}})['then'](function(_0x29082c){if(_0x29082c){_0x349cbd[_0x6b2e('0x78')][_0x6b2e('0xaa')]({'id':0x0,'priority':0x0,'app':_0x6b2e('0xab'),'appdata':_0x29082c[_0x6b2e('0x3e')]+','+(_0x349cbd[_0x6b2e('0x77')][_0x6b2e('0xac')]||0xa),'interval':_0x6b2e('0xa6')});}return respondWithRpcPromise(_0x6b2e('0xad'),_0x6b2e('0xae'),_0x349cbd);});}return respondWithRpcPromise('Start',_0x6b2e('0xae'),_0x349cbd);})['then'](function(_0x2aaea8){if(_0x2aaea8){var _0x5b8f1d=0xc8;var _0x5d508d='receiveMessage';logger[_0x6b2e('0x23')](_0x6b2e('0x27'),_0x5d508d,_0x5b8f1d,_0x6b2e('0xaf'));logger[_0x6b2e('0x26')](_0x6b2e('0xb0'),_0x5d508d,_0x5b8f1d,_0x6b2e('0xaf'),JSON['stringify'](_0x2aaea8));if(_0x349cbd[_0x6b2e('0x77')][_0x6b2e('0x46')]==='twilio'){return _0x2afcaf[_0x6b2e('0x2f')](_0x5b8f1d)[_0x6b2e('0xb1')](_0x6b2e('0xb2'),_0x6b2e('0xb3'))[_0x6b2e('0x3f')](_0x6b2e('0xb4'));}else{return _0x2afcaf[_0x6b2e('0x2f')](_0x5b8f1d)[_0x6b2e('0x30')](_0x2aaea8);}}})['catch'](handleError(_0x2afcaf,null));};exports[_0x6b2e('0xb5')]=function(_0x38263b,_0x123891){var _0x5716a3=_0x38263b['params']['id'];var _0x3cea9c=_0x38263b[_0x6b2e('0x60')];var _0xfc695c=0xc8;var _0x53e045=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x6b2e('0xb6')][_0x6b2e('0xb7')][_0x6b2e('0xb8')][_0x6b2e('0xb9')]},function(_0x11e2cf){return db[_0x6b2e('0x43')]['findOne']({'where':{'id':_0x5716a3},'transaction':_0x11e2cf})[_0x6b2e('0x22')](function(_0x1ab044){if(_0x1ab044){return db['SmsApplication'][_0x6b2e('0x3a')]({'where':{'SmsAccountId':_0x5716a3},'transaction':_0x11e2cf})[_0x6b2e('0x22')](function(){var _0xaab640=_['map'](_0x3cea9c,function(_0x4b37ac){_0x4b37ac['SmsAccountId']=_0x5716a3;return _0x4b37ac;});return db[_0x6b2e('0xba')][_0x6b2e('0xbb')](_0xaab640,{'transaction':_0x11e2cf});});}else{_0xfc695c=0x194;_0x53e045=[];}});})[_0x6b2e('0x22')](function(){if(_0xfc695c!==0x194){return db[_0x6b2e('0xba')][_0x6b2e('0xbc')]({'where':{'SmsAccountId':_0x5716a3},'order':_0x6b2e('0xbd')})[_0x6b2e('0x22')](function(_0x567ad7){_0x53e045=_0x567ad7;});}})[_0x6b2e('0x5e')](function(_0x584f04){_0xfc695c=0x1f4;logger[_0x6b2e('0x29')](_0x584f04['stack']);if(_0x584f04[_0x6b2e('0x3e')]){delete _0x584f04['name'];}_0x53e045=_0x584f04;})[_0x6b2e('0xbe')](function(){if(_0x53e045===null){_0x123891[_0x6b2e('0x2d')](_0xfc695c);}else{if(_0xfc695c===0x1f4){_0x123891[_0x6b2e('0x2f')](_0xfc695c)[_0x6b2e('0x3f')](_0x53e045);}else{_0x123891[_0x6b2e('0x2f')](_0xfc695c)['json'](_0x53e045);}}});};exports['getApplications']=function(_0x13251e,_0x5b9577,_0x30ffc3){var _0x1f0054={};var _0x4a7ee9={};var _0x5b94dd;var _0x341d00;return db[_0x6b2e('0x43')]['findOne']({'where':{'id':_0x13251e['params']['id']}})['then'](handleEntityNotFound(_0x5b9577,null))[_0x6b2e('0x22')](function(_0x5a74bc){if(_0x5a74bc){_0x5b94dd=_0x5a74bc;_0x4a7ee9['model']=_[_0x6b2e('0x4a')](db[_0x6b2e('0xba')]['rawAttributes']);_0x4a7ee9[_0x6b2e('0x49')]=_['keys'](_0x13251e[_0x6b2e('0x49')]);_0x4a7ee9[_0x6b2e('0x4b')]=_['intersection'](_0x4a7ee9['model'],_0x4a7ee9['query']);_0x1f0054[_0x6b2e('0x4d')]=_[_0x6b2e('0x4c')](_0x4a7ee9['model'],qs[_0x6b2e('0x4e')](_0x13251e[_0x6b2e('0x49')][_0x6b2e('0x4e')]));_0x1f0054[_0x6b2e('0x4d')]=_0x1f0054[_0x6b2e('0x4d')][_0x6b2e('0x4f')]?_0x1f0054[_0x6b2e('0x4d')]:_0x4a7ee9[_0x6b2e('0x48')];_0x1f0054['order']=qs[_0x6b2e('0x52')](_0x13251e['query'][_0x6b2e('0x52')]);_0x1f0054[_0x6b2e('0x54')]=qs['filters'](_[_0x6b2e('0x6e')](_0x13251e[_0x6b2e('0x49')],_0x4a7ee9[_0x6b2e('0x4b')]));if(_0x13251e[_0x6b2e('0x49')]['filter']){_0x1f0054[_0x6b2e('0x54')]=_[_0x6b2e('0x55')](_0x1f0054[_0x6b2e('0x54')],{'$or':_[_0x6b2e('0x42')](_0x1f0054[_0x6b2e('0x4d')],function(_0x56481b){var _0x34f779={};_0x34f779[_0x56481b]={'$like':'%'+_0x13251e[_0x6b2e('0x49')][_0x6b2e('0x53')]+'%'};return _0x34f779;})});}_0x1f0054=_[_0x6b2e('0x55')]({},_0x1f0054,_0x13251e[_0x6b2e('0x56')]);return _0x5b94dd[_0x6b2e('0xbf')](_0x1f0054);}})[_0x6b2e('0x22')](function(_0x13777d){if(_0x13777d){_0x341d00=_0x13777d[_0x6b2e('0x4f')];if(!_0x13251e[_0x6b2e('0x49')][_0x6b2e('0x50')](_0x6b2e('0x51'))){_0x1f0054[_0x6b2e('0x34')]=qs['limit'](_0x13251e[_0x6b2e('0x49')][_0x6b2e('0x34')]);_0x1f0054[_0x6b2e('0x31')]=qs[_0x6b2e('0x31')](_0x13251e[_0x6b2e('0x49')][_0x6b2e('0x31')]);}return _0x5b94dd[_0x6b2e('0xbf')](_0x1f0054);}})['then'](function(_0xb3c5a2){if(_0xb3c5a2){return _0xb3c5a2?{'count':_0x341d00,'rows':_0xb3c5a2}:null;}})['then'](respondWithResult(_0x5b9577,null))[_0x6b2e('0x5e')](handleError(_0x5b9577,null));};exports[_0x6b2e('0xc0')]=function(_0x50fe4b,_0x4f58d2,_0x4b76e4){var _0x404dec={'raw':![],'where':{}};var _0x5df8c8={};var _0x50f35e={'count':0x0,'rows':[]};return db[_0x6b2e('0x43')]['findOne']({'where':{'id':_0x50fe4b[_0x6b2e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4f58d2,null))[_0x6b2e('0x22')](function(_0x1ba0f3){if(_0x1ba0f3){_0x5df8c8[_0x6b2e('0x48')]=_[_0x6b2e('0x4a')](db['SmsInteraction']['rawAttributes']);_0x5df8c8[_0x6b2e('0x49')]=_[_0x6b2e('0x4a')](_0x50fe4b['query']);_0x5df8c8[_0x6b2e('0x4b')]=_['intersection'](_0x5df8c8[_0x6b2e('0x48')],_0x5df8c8[_0x6b2e('0x49')]);_0x404dec['attributes']=_['intersection'](_0x5df8c8[_0x6b2e('0x48')],qs['fields'](_0x50fe4b[_0x6b2e('0x49')][_0x6b2e('0x4e')]));_0x404dec[_0x6b2e('0x4d')]=_0x404dec[_0x6b2e('0x4d')][_0x6b2e('0x4f')]?_0x404dec['attributes']:_0x5df8c8[_0x6b2e('0x48')];if(!_0x50fe4b[_0x6b2e('0x49')][_0x6b2e('0x50')](_0x6b2e('0x51'))){_0x404dec[_0x6b2e('0x34')]=qs[_0x6b2e('0x34')](_0x50fe4b[_0x6b2e('0x49')]['limit']);_0x404dec[_0x6b2e('0x31')]=qs[_0x6b2e('0x31')](_0x50fe4b[_0x6b2e('0x49')]['offset']);}_0x404dec[_0x6b2e('0x6d')]=qs[_0x6b2e('0x52')](_0x50fe4b['query'][_0x6b2e('0x52')]);_0x404dec['where']=qs['filters'](_[_0x6b2e('0x6e')](_0x50fe4b[_0x6b2e('0x49')],_0x5df8c8[_0x6b2e('0x4b')]));_0x404dec[_0x6b2e('0x54')][_0x6b2e('0x69')]=_0x1ba0f3['id'];if(_0x50fe4b[_0x6b2e('0x49')][_0x6b2e('0x53')]){_0x404dec[_0x6b2e('0x54')]=_[_0x6b2e('0x55')](_0x404dec[_0x6b2e('0x54')],{'$or':_['map'](_0x404dec[_0x6b2e('0x4d')],function(_0x2b7e80){var _0x55d777={};_0x55d777[_0x2b7e80]={'$like':'%'+_0x50fe4b[_0x6b2e('0x49')][_0x6b2e('0x53')]+'%'};return _0x55d777;})});}_0x404dec=_[_0x6b2e('0x55')]({},_0x404dec,_0x50fe4b['options']);return db[_0x6b2e('0xa0')][_0x6b2e('0x33')]({'where':_0x404dec[_0x6b2e('0x54')]})[_0x6b2e('0x22')](function(_0x1d8b38){_0x50f35e[_0x6b2e('0x33')]=_0x1d8b38;if(_0x50fe4b['query']['includeAll']){_0x404dec['include']=[{'model':db[_0x6b2e('0x9e')],'as':_0x6b2e('0xc1'),'required':![]},{'model':db[_0x6b2e('0xa9')],'as':_0x6b2e('0xc2'),'attributes':[_0x6b2e('0x3e'),_0x6b2e('0xc3'),_0x6b2e('0xc4')],'required':![]},{'model':db[_0x6b2e('0xc5')],'as':'Tags','attributes':['id',_0x6b2e('0x3e'),_0x6b2e('0xc6')],'where':_0x50fe4b['query'][_0x6b2e('0xc7')]?{'id':_0x50fe4b['query'][_0x6b2e('0xc7')]}:undefined,'required':_0x50fe4b[_0x6b2e('0x49')][_0x6b2e('0xc7')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x404dec);})['then'](function(_0x3476ea){_0x50f35e[_0x6b2e('0x5a')]=_0x3476ea;return _0x50f35e;});}})['then'](respondWithFilteredResult(_0x4f58d2,_0x404dec))[_0x6b2e('0x5e')](handleError(_0x4f58d2,null));};exports['send']=function(_0x9ef9c0,_0x24bf08,_0x99162f){var _0x397154,_0x366306,_0x53a777;if(_[_0x6b2e('0x96')](_0x9ef9c0['body'][_0x6b2e('0x60')])||_0x9ef9c0[_0x6b2e('0x60')]['body']===''){throw new db[(_0x6b2e('0x7b'))]['ValidationError'](_0x6b2e('0xc8'));}if(_[_0x6b2e('0x96')](_0x9ef9c0[_0x6b2e('0x60')]['to'])){throw new db[(_0x6b2e('0x7b'))][(_0x6b2e('0x7c'))](_0x6b2e('0xc9'));}_0x397154=_0x9ef9c0[_0x6b2e('0x60')]['to'];return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0x9ef9c0['params']['id']},'include':[{'model':db[_0x6b2e('0xca')],'as':'List','include':[{'model':db[_0x6b2e('0x9e')],'as':_0x6b2e('0x9b'),'where':{'mobile':_0x397154},'limit':0x1,'order':[[_0x6b2e('0x7f'),'DESC']]}]}]})[_0x6b2e('0x22')](handleEntityNotFound(_0x24bf08,null))[_0x6b2e('0x22')](function(_0x3250c6){if(_0x3250c6&&_0x3250c6[_0x6b2e('0xcb')]){_0x366306=_0x3250c6[_0x6b2e('0x3b')]({'plain':!![]});if(_0x366306['List']&&_0x366306[_0x6b2e('0xcb')]['Contacts'][_0x6b2e('0x4f')]){return _0x366306[_0x6b2e('0xcb')][_0x6b2e('0x9b')][0x0];}return db['CmContact'][_0x6b2e('0x5f')](_[_0x6b2e('0x19')](_0x9ef9c0['body'],{'firstName':_0x397154,'mobile':_0x397154,'phone':_0x397154,'ListId':_0x366306[_0x6b2e('0x81')]}));}})[_0x6b2e('0x22')](handleEntityNotFound(_0x24bf08,null))[_0x6b2e('0x22')](function(_0x333a7f){if(_0x333a7f){_0x53a777=_0x333a7f;return db[_0x6b2e('0xa0')]['find']({'where':{'ContactId':_0x53a777['id'],'closed':![],'SmsAccountId':_0x366306['id']}})['then'](function(_0xf21d3e){if(_0xf21d3e){return[_0xf21d3e,![]];}return db[_0x6b2e('0xa0')][_0x6b2e('0x5f')]({'UserId':_0x9ef9c0[_0x6b2e('0xcc')]['id'],'ContactId':_0x53a777['id'],'SmsAccountId':_0x366306['id'],'phone':_0x397154,'firstMsgDirection':_0x6b2e('0xcd'),'Messages':[_[_0x6b2e('0x55')](_0x9ef9c0[_0x6b2e('0x60')],{'read':![],'body':_0x9ef9c0[_0x6b2e('0x60')]['body'],'phone':_0x397154,'SmsAccountId':_0x366306['id'],'UserId':_0x9ef9c0[_0x6b2e('0xcc')]['id'],'ContactId':_0x53a777['id']})]},{'include':[{'model':db[_0x6b2e('0xce')],'as':'Messages'}]})[_0x6b2e('0x22')](function(_0xe50cb0){return[_0xe50cb0,!![]];});});}})[_0x6b2e('0xcf')](function(_0x3719a1,_0x1c1621){if(_0x1c1621){return _0x3719a1;}return db[_0x6b2e('0xce')][_0x6b2e('0x5f')](_[_0x6b2e('0x55')](_0x9ef9c0[_0x6b2e('0x60')],{'read':![],'body':_0x9ef9c0[_0x6b2e('0x60')]['body'],'phone':_0x397154,'SmsAccountId':_0x366306['id'],'SmsInteractionId':_0x3719a1['id'],'UserId':_0x9ef9c0['user']['id'],'ContactId':_0x53a777['id']}))[_0x6b2e('0x22')](function(_0x4c783d){_0x3719a1[_0x6b2e('0xd0')][_0x6b2e('0xd1')]=[];_0x3719a1[_0x6b2e('0xd0')][_0x6b2e('0xd1')][_0x6b2e('0xa3')](_0x4c783d[_0x6b2e('0xd0')]);return _0x3719a1;});})[_0x6b2e('0x22')](respondWithResult(_0x24bf08,null))['catch'](handleError(_0x24bf08,null));};exports[_0x6b2e('0x2f')]=function(_0xded693,_0x44ba0a,_0x31316c){if(_0xded693[_0x6b2e('0x60')]['id']){delete _0xded693[_0x6b2e('0x60')]['id'];}var _0x23aecb,_0x5b784c,_0x4bc6de;return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0xded693[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x44ba0a,null))[_0x6b2e('0x22')](function(_0x14f680){if(_0x14f680){_0x4bc6de=_0x14f680;logger[_0x6b2e('0x26')](_0x6b2e('0x27'),_0x6b2e('0x2f'),_0x6b2e('0xd2'),_0x14f680[_0x6b2e('0x46')],util[_0x6b2e('0xd3')](_0xded693[_0x6b2e('0x60')],{'showHidden':![],'depth':null}));switch(_0x14f680[_0x6b2e('0x46')]){case _0x6b2e('0x86'):if(_0xded693[_0x6b2e('0x60')][_0x6b2e('0xd4')]&&_0xded693['body'][_0x6b2e('0x2f')]){_0x5b784c=_0xded693[_0x6b2e('0x60')][_0x6b2e('0x2f')];return db[_0x6b2e('0xce')][_0x6b2e('0x5d')]({'where':{'messageId':_0xded693[_0x6b2e('0x60')][_0x6b2e('0xd4')]}});}break;case'connectel':if(_0xded693['body']['requestid']&&_0xded693[_0x6b2e('0x60')]['statusInt']){_0x5b784c=_0xded693[_0x6b2e('0x60')][_0x6b2e('0xd5')];return db['SmsMessage'][_0x6b2e('0x5d')]({'where':{'messageId':_0xded693['body'][_0x6b2e('0xd6')]}});}break;case'clicksend':if(_0xded693['body'][_0x6b2e('0x8b')]&&_0xded693[_0x6b2e('0x60')][_0x6b2e('0xd7')]){_0x5b784c=_0xded693[_0x6b2e('0x60')][_0x6b2e('0xd7')];return db[_0x6b2e('0xce')][_0x6b2e('0x5d')]({'where':{'messageId':_0xded693['body'][_0x6b2e('0x8b')]}});}break;case _0x6b2e('0xd8'):var _0x12250c=_0xded693[_0x6b2e('0x60')][_0x6b2e('0x8f')][0x0];if(_0x12250c[_0x6b2e('0x8a')]&&_0x12250c[_0x6b2e('0x2f')][_0x6b2e('0xd9')]===_0x6b2e('0xda')){_0x5b784c=_0x12250c[_0x6b2e('0x2f')][_0x6b2e('0xd9')];return db[_0x6b2e('0xce')]['find']({'where':{'messageId':_0x12250c[_0x6b2e('0x8a')]}});}break;case'clickatell':if(_0xded693[_0x6b2e('0x60')]['messageId']&&_0xded693[_0x6b2e('0x60')][_0x6b2e('0x2f')]){_0x5b784c=_0xded693[_0x6b2e('0x60')][_0x6b2e('0x2f')];return db['SmsMessage'][_0x6b2e('0x5d')]({'where':{'messageId':_0xded693[_0x6b2e('0x60')][_0x6b2e('0x8a')]}});}break;case _0x6b2e('0x93'):if(_0xded693[_0x6b2e('0x60')][0x0]['message']['id']){_0x5b784c=_0xded693[_0x6b2e('0x60')][0x0][_0x6b2e('0x46')];return db['SmsMessage'][_0x6b2e('0x5d')]({'where':{'messageId':_0xded693[_0x6b2e('0x60')][0x0][_0x6b2e('0x2b')]['id']}});}break;case _0x6b2e('0x94'):if(_0xded693[_0x6b2e('0x60')][_0x6b2e('0xdb')]&&_0xded693[_0x6b2e('0x60')][_0x6b2e('0x2f')]){_0x5b784c=_0xded693[_0x6b2e('0x60')][_0x6b2e('0x2f')];return db[_0x6b2e('0xce')][_0x6b2e('0x5d')]({'where':{'messageId':_0xded693['body'][_0x6b2e('0xdb')]}});}break;}}})[_0x6b2e('0x22')](handleEntityNotFound(_0x44ba0a,null))[_0x6b2e('0x22')](function(_0x82725a){if(_0x82725a){_0x23aecb=_0x82725a;switch(_0x4bc6de['type']){case _0x6b2e('0x86'):if(_0x5b784c===_0x6b2e('0xda')){return _0x23aecb[_0x6b2e('0x39')]({'read':!![]});}else{logger[_0x6b2e('0x29')](_0x6b2e('0x27'),_0x6b2e('0x2f'),'skebby',util[_0x6b2e('0xd3')](_0xded693['body'],{'showHidden':![],'depth':null}));}break;case _0x6b2e('0x88'):if(_0x5b784c==='1'){return _0x23aecb[_0x6b2e('0x39')]({'read':!![]});}else{logger['error'](_0x6b2e('0x27'),'status',_0x6b2e('0x86'),util[_0x6b2e('0xd3')](_0xded693[_0x6b2e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x6b2e('0x89'):if(!_0xded693[_0x6b2e('0x60')]['error_code']&&_0x5b784c>=0xc8&&_0x5b784c<=0xce){return _0x23aecb[_0x6b2e('0x39')]({'read':!![]});}else{logger[_0x6b2e('0x29')](_0x6b2e('0x27'),_0x6b2e('0x2f'),_0x6b2e('0x89'),util['inspect'](_0xded693[_0x6b2e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x6b2e('0xd8'):var _0x672fa6=_0xded693[_0x6b2e('0x60')][_0x6b2e('0x8f')][0x0];if(_0x672fa6['status'][_0x6b2e('0xd9')]===_0x6b2e('0xda')){return _0x23aecb[_0x6b2e('0x39')]({'read':!![]});}else{logger[_0x6b2e('0x29')](_0x6b2e('0x27'),_0x6b2e('0x2f'),_0x6b2e('0xd8'),util[_0x6b2e('0xd3')](_0xded693[_0x6b2e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x6b2e('0x91'):if(_0x5b784c==_0x6b2e('0xdc')||_0x5b784c==_0x6b2e('0xdd')){return _0x23aecb[_0x6b2e('0x39')]({'read':!![]});}else{logger[_0x6b2e('0x29')](_0x6b2e('0x27'),_0x6b2e('0x2f'),_0x6b2e('0x91'),util[_0x6b2e('0xd3')](_0xded693[_0x6b2e('0x60')],{'showHidden':![],'depth':null}));}break;case _0x6b2e('0x93'):if(_0x5b784c=='message-delivered'){return _0x23aecb[_0x6b2e('0x39')]({'read':!![]});}else{logger[_0x6b2e('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x6b2e('0x93'),util[_0x6b2e('0xd3')](_0xded693[_0x6b2e('0x60')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x5b784c===_0x6b2e('0xde')||_0x5b784c==='ACCEPTD'){return _0x23aecb[_0x6b2e('0x39')]({'read':!![]});}else{logger[_0x6b2e('0x29')](_0x6b2e('0x27'),'status',_0x6b2e('0x94'),util[_0x6b2e('0xd3')](_0xded693[_0x6b2e('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x23aecb;}})[_0x6b2e('0x22')](respondWithResult(_0x44ba0a,null))[_0x6b2e('0x5e')](handleError(_0x44ba0a,null));};exports[_0x6b2e('0xdf')]=function(_0x27b754,_0x5c1f90,_0x3b1174){var _0x34f2ce,_0x158f0a,_0x25044e;return db['SmsAccount']['find']({'where':{'id':_0x27b754['params']['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x5c1f90,null))['then'](function(_0x5d4186){if(_0x5d4186){_0x25044e=_0x5d4186;logger[_0x6b2e('0x26')](_0x6b2e('0x27'),'status','received\x20delivery\x20report\x20from',_0x5d4186[_0x6b2e('0x46')],util['inspect'](_0x27b754[_0x6b2e('0x49')],{'showHidden':![],'depth':null}));switch(_0x5d4186[_0x6b2e('0x46')]){case _0x6b2e('0xe0'):if(_0x27b754[_0x6b2e('0x49')][_0x6b2e('0xe1')]&&_0x27b754[_0x6b2e('0x49')][_0x6b2e('0xe2')]){_0x158f0a=_0x27b754['query'][_0x6b2e('0xe2')];return db[_0x6b2e('0xce')][_0x6b2e('0x5d')]({'where':{'messageId':_0x27b754[_0x6b2e('0x49')][_0x6b2e('0xe1')]}});}break;}}})['then'](handleEntityNotFound(_0x5c1f90,null))[_0x6b2e('0x22')](function(_0x7fb0ab){if(_0x7fb0ab){_0x34f2ce=_0x7fb0ab;switch(_0x25044e[_0x6b2e('0x46')]){case _0x6b2e('0xe0'):if(_0x158f0a==='2'||_0x158f0a==='6'){return _0x34f2ce[_0x6b2e('0x39')]({'read':!![]});}else{logger[_0x6b2e('0x29')](_0x6b2e('0x27'),_0x6b2e('0x2f'),_0x6b2e('0xe0'),util['inspect'](_0x27b754['query'],{'showHidden':![],'depth':null}));};break;}return _0x34f2ce;}})[_0x6b2e('0x22')](respondWithResult(_0x5c1f90,null))[_0x6b2e('0x5e')](handleError(_0x5c1f90,null));};exports[_0x6b2e('0xe3')]=function(_0x24c002,_0x4947ca,_0x1c07ba){return db[_0x6b2e('0x43')]['find']({'where':{'id':_0x24c002['params']['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x4947ca,null))[_0x6b2e('0x22')](function(_0x1121f3){if(_0x1121f3){return _0x1121f3[_0x6b2e('0xe3')](_0x24c002['body'][_0x6b2e('0x70')],_[_0x6b2e('0x9d')](_0x24c002[_0x6b2e('0x60')],[_0x6b2e('0x70'),'id'])||{})[_0x6b2e('0xcf')](function(_0x9312cf){for(var _0x33055c=0x0;_0x33055c<_0x24c002['body']['ids'][_0x6b2e('0x4f')];_0x33055c+=0x1){socket['emit'](_0x6b2e('0xe4'),{'UserId':Number(_0x24c002[_0x6b2e('0x60')]['ids'][_0x33055c]),'SmsAccountId':Number(_0x24c002[_0x6b2e('0x5c')]['id'])});}return _0x9312cf;});}})[_0x6b2e('0x22')](respondWithResult(_0x4947ca,null))[_0x6b2e('0x5e')](handleError(_0x4947ca,null));};exports[_0x6b2e('0xe5')]=function(_0x406cf0,_0x2bff16,_0x55b45c){return db[_0x6b2e('0x43')][_0x6b2e('0x5d')]({'where':{'id':_0x406cf0[_0x6b2e('0x5c')]['id']}})[_0x6b2e('0x22')](handleEntityNotFound(_0x2bff16,null))['then'](function(_0x5efa72){if(_0x5efa72){return _0x5efa72[_0x6b2e('0xe5')](_0x406cf0[_0x6b2e('0x49')]['ids'])[_0x6b2e('0x22')](function(){if(_[_0x6b2e('0xe6')](_0x406cf0[_0x6b2e('0x49')]['ids'])){for(var _0x30f1ee=0x0;_0x30f1ee<_0x406cf0[_0x6b2e('0x49')][_0x6b2e('0x70')][_0x6b2e('0x4f')];_0x30f1ee+=0x1){socket[_0x6b2e('0xe7')](_0x6b2e('0xe8'),{'UserId':Number(_0x406cf0[_0x6b2e('0x49')][_0x6b2e('0x70')][_0x30f1ee]),'SmsAccountId':Number(_0x406cf0['params']['id'])});}}else{socket['emit'](_0x6b2e('0xe8'),{'UserId':Number(_0x406cf0[_0x6b2e('0x49')][_0x6b2e('0x70')]),'SmsAccountId':Number(_0x406cf0[_0x6b2e('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2bff16,null))['catch'](handleError(_0x2bff16,null));};exports[_0x6b2e('0xe9')]=function(_0x1a1069,_0x3ef4fd,_0x58bcce){var _0x22487f={};var _0x2f4904={};var _0x1d185f;var _0x1e3c64;return db[_0x6b2e('0x43')][_0x6b2e('0x6c')]({'where':{'id':_0x1a1069[_0x6b2e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3ef4fd,null))[_0x6b2e('0x22')](function(_0x330289){if(_0x330289){_0x1d185f=_0x330289;_0x2f4904['model']=_[_0x6b2e('0x4a')](db['User'][_0x6b2e('0x44')]);_0x2f4904['query']=_[_0x6b2e('0x4a')](_0x1a1069[_0x6b2e('0x49')]);_0x2f4904[_0x6b2e('0x4b')]=_[_0x6b2e('0x4c')](_0x2f4904[_0x6b2e('0x48')],_0x2f4904['query']);_0x22487f[_0x6b2e('0x4d')]=_[_0x6b2e('0x4c')](_0x2f4904['model'],qs[_0x6b2e('0x4e')](_0x1a1069[_0x6b2e('0x49')][_0x6b2e('0x4e')]));_0x22487f[_0x6b2e('0x4d')]=_0x22487f[_0x6b2e('0x4d')][_0x6b2e('0x4f')]?_0x22487f[_0x6b2e('0x4d')]:_0x2f4904[_0x6b2e('0x48')];_0x22487f['order']=qs[_0x6b2e('0x52')](_0x1a1069[_0x6b2e('0x49')][_0x6b2e('0x52')]);_0x22487f[_0x6b2e('0x54')]=qs[_0x6b2e('0x4b')](_[_0x6b2e('0x6e')](_0x1a1069['query'],_0x2f4904[_0x6b2e('0x4b')]));if(_0x1a1069[_0x6b2e('0x49')][_0x6b2e('0x53')]){_0x22487f[_0x6b2e('0x54')]=_[_0x6b2e('0x55')](_0x22487f[_0x6b2e('0x54')],{'$or':_[_0x6b2e('0x42')](_0x22487f[_0x6b2e('0x4d')],function(_0x425b8d){var _0x5ed07d={};_0x5ed07d[_0x425b8d]={'$like':'%'+_0x1a1069[_0x6b2e('0x49')][_0x6b2e('0x53')]+'%'};return _0x5ed07d;})});}_0x22487f=_[_0x6b2e('0x55')]({},_0x22487f,_0x1a1069[_0x6b2e('0x56')]);return _0x1d185f[_0x6b2e('0xe9')](_0x22487f);}})[_0x6b2e('0x22')](function(_0x53b759){if(_0x53b759){_0x1e3c64=_0x53b759[_0x6b2e('0x4f')];if(!_0x1a1069['query'][_0x6b2e('0x50')](_0x6b2e('0x51'))){_0x22487f[_0x6b2e('0x34')]=qs[_0x6b2e('0x34')](_0x1a1069['query'][_0x6b2e('0x34')]);_0x22487f[_0x6b2e('0x31')]=qs['offset'](_0x1a1069[_0x6b2e('0x49')][_0x6b2e('0x31')]);}return _0x1d185f['getAgents'](_0x22487f);}})[_0x6b2e('0x22')](function(_0x59bcb8){if(_0x59bcb8){return _0x59bcb8?{'count':_0x1e3c64,'rows':_0x59bcb8}:null;}})[_0x6b2e('0x22')](respondWithResult(_0x3ef4fd,null))[_0x6b2e('0x5e')](handleError(_0x3ef4fd,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index e797ed3..5367bd8 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 _0xa541=['remove','exports','../../mysqldb','SmsAccount','save','update'];(function(_0x4c7741,_0x34e467){var _0x43b02a=function(_0x292c88){while(--_0x292c88){_0x4c7741['push'](_0x4c7741['shift']());}};_0x43b02a(++_0x34e467);}(_0xa541,0x10a));var _0x1a54=function(_0x2f7f77,_0x1881e2){_0x2f7f77=_0x2f7f77-0x0;var _0x32cd81=_0xa541[_0x2f7f77];return _0x32cd81;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x1a54('0x0'))['db'][_0x1a54('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1a54('0x2'),'afterUpdate':_0x1a54('0x3'),'afterDestroy':_0x1a54('0x4')};function emitEvent(_0x29b59f){return function(_0x3c9aeb,_0x5ca6fb,_0x16e179){SmsAccountEvents['emit'](_0x29b59f+':'+_0x3c9aeb['id'],_0x3c9aeb);SmsAccountEvents['emit'](_0x29b59f,_0x3c9aeb);_0x16e179(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x1a54('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0x148d=['events','../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4c7bca,_0xf81478){var _0x39435c=function(_0x7811cc){while(--_0x7811cc){_0x4c7bca['push'](_0x4c7bca['shift']());}};_0x39435c(++_0xf81478);}(_0x148d,0x87));var _0xd148=function(_0x896b36,_0x1da70b){_0x896b36=_0x896b36-0x0;var _0x3afee7=_0x148d[_0x896b36];return _0x3afee7;};'use strict';var EventEmitter=require(_0xd148('0x0'));var SmsAccount=require(_0xd148('0x1'))['db'][_0xd148('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xd148('0x3')](0x0);var events={'afterCreate':_0xd148('0x4'),'afterUpdate':'update','afterDestroy':_0xd148('0x5')};function emitEvent(_0x3b3079){return function(_0x591596,_0x45ade6,_0x10a83e){SmsAccountEvents['emit'](_0x3b3079+':'+_0x591596['id'],_0x591596);SmsAccountEvents[_0xd148('0x6')](_0x3b3079,_0x591596);_0x10a83e(null);};}for(var e in events){if(events[_0xd148('0x7')](e)){var event=events[e];SmsAccount[_0xd148('0x8')](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 2bc6638..94fdf37 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 _0xb9cb=['api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0xb9cb,0x191));var _0xbb9c=function(_0x35c300,_0x284351){_0x35c300=_0x35c300-0x0;var _0x59e44b=_0xb9cb[_0x35c300];return _0x59e44b;};'use strict';var _=require(_0xbb9c('0x0'));var util=require(_0xbb9c('0x1'));var logger=require('../../config/logger')(_0xbb9c('0x2'));var moment=require(_0xbb9c('0x3'));var BPromise=require(_0xbb9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb9c('0x5'));var rimraf=require(_0xbb9c('0x6'));var config=require(_0xbb9c('0x7'));var attributes=require(_0xbb9c('0x8'));module[_0xbb9c('0x9')]=function(_0x11498b,_0x10242b){return _0x11498b[_0xbb9c('0xa')](_0xbb9c('0xb'),attributes,{'tableName':_0xbb9c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30c1=['path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','../../config/logger','api','request-promise'];(function(_0x51bc13,_0x6bc6f2){var _0xb3a656=function(_0x4ad099){while(--_0x4ad099){_0x51bc13['push'](_0x51bc13['shift']());}};_0xb3a656(++_0x6bc6f2);}(_0x30c1,0x10f));var _0x130c=function(_0x2c58c2,_0x52dc66){_0x2c58c2=_0x2c58c2-0x0;var _0x3e2389=_0x30c1[_0x2c58c2];return _0x3e2389;};'use strict';var _=require(_0x130c('0x0'));var util=require('util');var logger=require(_0x130c('0x1'))(_0x130c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x130c('0x3'));var fs=require('fs');var path=require(_0x130c('0x4'));var rimraf=require(_0x130c('0x5'));var config=require('../../config/environment');var attributes=require(_0x130c('0x6'));module[_0x130c('0x7')]=function(_0x353d0d,_0x10e502){return _0x353d0d[_0x130c('0x8')](_0x130c('0x9'),attributes,{'tableName':_0x130c('0xa'),'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 1e4106c..796dabf 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 _0x9120=['request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','ShowSmsAccount','find','options','raw','where','attributes','map','include','model','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsAccount.socket','register'];(function(_0x4eab11,_0x420bfb){var _0x417a63=function(_0x35f378){while(--_0x35f378){_0x4eab11['push'](_0x4eab11['shift']());}};_0x417a63(++_0x420bfb);}(_0x9120,0xe0));var _0x0912=function(_0x5a37a1,_0x57a269){_0x5a37a1=_0x5a37a1-0x0;var _0x2581a7=_0x9120[_0x5a37a1];return _0x2581a7;};'use strict';var _=require(_0x0912('0x0'));var util=require('util');var moment=require(_0x0912('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0912('0x2'));var db=require(_0x0912('0x3'))['db'];var utils=require(_0x0912('0x4'));var logger=require(_0x0912('0x5'))('rpc');var config=require(_0x0912('0x6'));var jayson=require(_0x0912('0x7'));var client=jayson[_0x0912('0x8')]['http']({'port':0x232a});config[_0x0912('0x9')]=_[_0x0912('0xa')](config['redis'],{'host':_0x0912('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0912('0x9')]));require(_0x0912('0xc'))[_0x0912('0xd')](socket);function respondWithRpcPromise(_0x4cfdb0,_0x2de88a,_0x2de010){return new BPromise(function(_0x3caaa8,_0x3da41b){return client[_0x0912('0xe')](_0x4cfdb0,_0x2de010)[_0x0912('0xf')](function(_0x435761){logger[_0x0912('0x10')](_0x0912('0x11'),_0x2de88a,'request\x20sent');logger[_0x0912('0x12')](_0x0912('0x13'),_0x2de88a,_0x0912('0x14'),JSON['stringify'](_0x435761));if(_0x435761[_0x0912('0x15')]){if(_0x435761[_0x0912('0x15')]['code']===0x1f4){logger['error'](_0x0912('0x11'),_0x2de88a,_0x435761[_0x0912('0x15')][_0x0912('0x16')]);return _0x3da41b(_0x435761['error'][_0x0912('0x16')]);}logger[_0x0912('0x15')](_0x0912('0x11'),_0x2de88a,_0x435761[_0x0912('0x15')][_0x0912('0x16')]);return _0x3caaa8(_0x435761['error'][_0x0912('0x16')]);}else{logger['info'](_0x0912('0x11'),_0x2de88a,_0x0912('0x14'));_0x3caaa8(_0x435761[_0x0912('0x17')]['message']);}})[_0x0912('0x18')](function(_0x1297f2){logger['error'](_0x0912('0x11'),_0x2de88a,_0x1297f2);_0x3da41b(_0x1297f2);});});}exports[_0x0912('0x19')]=function(_0x40d964){var _0x4592c1=this;return new Promise(function(_0x221f87,_0x478724){return db['SmsAccount'][_0x0912('0x1a')]({'raw':_0x40d964[_0x0912('0x1b')]?_0x40d964[_0x0912('0x1b')][_0x0912('0x1c')]===undefined?!![]:![]:!![],'where':_0x40d964['options']?_0x40d964[_0x0912('0x1b')][_0x0912('0x1d')]||null:null,'attributes':_0x40d964[_0x0912('0x1b')]?_0x40d964[_0x0912('0x1b')][_0x0912('0x1e')]||null:null,'include':_0x40d964[_0x0912('0x1b')]?_0x40d964[_0x0912('0x1b')]['include']?_[_0x0912('0x1f')](_0x40d964['options'][_0x0912('0x20')],function(_0x28fdb4){return{'model':db[_0x28fdb4['model']],'as':_0x28fdb4['as'],'attributes':_0x28fdb4['attributes'],'include':_0x28fdb4[_0x0912('0x20')]?_[_0x0912('0x1f')](_0x28fdb4[_0x0912('0x20')],function(_0x88406b){return{'model':db[_0x88406b[_0x0912('0x21')]],'as':_0x88406b['as'],'attributes':_0x88406b[_0x0912('0x1e')],'include':_0x88406b[_0x0912('0x20')]?_['map'](_0x88406b[_0x0912('0x20')],function(_0x407583){return{'model':db[_0x407583[_0x0912('0x21')]],'as':_0x407583['as'],'attributes':_0x407583[_0x0912('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0912('0xf')](function(_0x3db297){logger[_0x0912('0x10')](_0x0912('0x19'),_0x40d964);logger['debug']('ShowSmsAccount',_0x40d964,JSON['stringify'](_0x3db297));_0x221f87(_0x3db297);})[_0x0912('0x18')](function(_0x7f137b){logger[_0x0912('0x15')](_0x0912('0x19'),_0x7f137b[_0x0912('0x16')],_0x40d964);_0x478724(_0x4592c1[_0x0912('0x15')](0x1f4,_0x7f137b[_0x0912('0x16')]));});});}; \ No newline at end of file +var _0x22a0=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','map','model','include','lodash','util','moment','bluebird','randomstring'];(function(_0x25f805,_0x59caf3){var _0xf6628f=function(_0x3cb938){while(--_0x3cb938){_0x25f805['push'](_0x25f805['shift']());}};_0xf6628f(++_0x59caf3);}(_0x22a0,0x151));var _0x022a=function(_0x8abc6a,_0x3b446a){_0x8abc6a=_0x8abc6a-0x0;var _0xbc0286=_0x22a0[_0x8abc6a];return _0xbc0286;};'use strict';var _=require(_0x022a('0x0'));var util=require(_0x022a('0x1'));var moment=require(_0x022a('0x2'));var BPromise=require(_0x022a('0x3'));var rs=require(_0x022a('0x4'));var fs=require('fs');var Redis=require(_0x022a('0x5'));var db=require(_0x022a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x022a('0x7'))(_0x022a('0x8'));var config=require(_0x022a('0x9'));var jayson=require(_0x022a('0xa'));var client=jayson['client'][_0x022a('0xb')]({'port':0x232a});config[_0x022a('0xc')]=_[_0x022a('0xd')](config[_0x022a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x022a('0xe'))(new Redis(config['redis']));require(_0x022a('0xf'))[_0x022a('0x10')](socket);function respondWithRpcPromise(_0x5cb1e4,_0x10596f,_0x2706c9){return new BPromise(function(_0x10771b,_0x5c2419){return client[_0x022a('0x11')](_0x5cb1e4,_0x2706c9)[_0x022a('0x12')](function(_0x36ce0c){logger[_0x022a('0x13')](_0x022a('0x14'),_0x10596f,_0x022a('0x15'));logger[_0x022a('0x16')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x10596f,_0x022a('0x15'),JSON[_0x022a('0x17')](_0x36ce0c));if(_0x36ce0c['error']){if(_0x36ce0c['error'][_0x022a('0x18')]===0x1f4){logger[_0x022a('0x19')](_0x022a('0x14'),_0x10596f,_0x36ce0c[_0x022a('0x19')][_0x022a('0x1a')]);return _0x5c2419(_0x36ce0c[_0x022a('0x19')][_0x022a('0x1a')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x10596f,_0x36ce0c[_0x022a('0x19')][_0x022a('0x1a')]);return _0x10771b(_0x36ce0c[_0x022a('0x19')][_0x022a('0x1a')]);}else{logger[_0x022a('0x13')](_0x022a('0x14'),_0x10596f,_0x022a('0x15'));_0x10771b(_0x36ce0c[_0x022a('0x1b')][_0x022a('0x1a')]);}})[_0x022a('0x1c')](function(_0x202ee4){logger[_0x022a('0x19')](_0x022a('0x14'),_0x10596f,_0x202ee4);_0x5c2419(_0x202ee4);});});}exports[_0x022a('0x1d')]=function(_0x3a6466){var _0xcda0f3=this;return new Promise(function(_0x34f547,_0x5e0176){return db[_0x022a('0x1e')][_0x022a('0x1f')]({'raw':_0x3a6466['options']?_0x3a6466[_0x022a('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3a6466['options']?_0x3a6466['options'][_0x022a('0x21')]||null:null,'attributes':_0x3a6466['options']?_0x3a6466[_0x022a('0x20')][_0x022a('0x22')]||null:null,'include':_0x3a6466['options']?_0x3a6466[_0x022a('0x20')]['include']?_[_0x022a('0x23')](_0x3a6466['options']['include'],function(_0x2cd6f9){return{'model':db[_0x2cd6f9[_0x022a('0x24')]],'as':_0x2cd6f9['as'],'attributes':_0x2cd6f9[_0x022a('0x22')],'include':_0x2cd6f9['include']?_[_0x022a('0x23')](_0x2cd6f9[_0x022a('0x25')],function(_0x33a63d){return{'model':db[_0x33a63d[_0x022a('0x24')]],'as':_0x33a63d['as'],'attributes':_0x33a63d['attributes'],'include':_0x33a63d[_0x022a('0x25')]?_['map'](_0x33a63d[_0x022a('0x25')],function(_0x372991){return{'model':db[_0x372991[_0x022a('0x24')]],'as':_0x372991['as'],'attributes':_0x372991[_0x022a('0x22')]};}):[]};}):[]};}):[]:[]})[_0x022a('0x12')](function(_0x3ecdcc){logger[_0x022a('0x13')](_0x022a('0x1d'),_0x3a6466);logger['debug']('ShowSmsAccount',_0x3a6466,JSON[_0x022a('0x17')](_0x3ecdcc));_0x34f547(_0x3ecdcc);})[_0x022a('0x1c')](function(_0x1b6852){logger[_0x022a('0x19')](_0x022a('0x1d'),_0x1b6852[_0x022a('0x1a')],_0x3a6466);_0x5e0176(_0xcda0f3[_0x022a('0x19')](0x1f4,_0x1b6852[_0x022a('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index a254518..30e6a1d 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 341c4c6..03b81af 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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0xc4c628,_0x552c85){var _0x168519=function(_0x45e66b){while(--_0x45e66b){_0xc4c628['push'](_0xc4c628['shift']());}};_0x168519(++_0x552c85);}(_0x55ca,0x126));var _0xa55c=function(_0x1fb6ff,_0x474709){_0x1fb6ff=_0x1fb6ff-0x0;var _0x339f61=_0x55ca[_0x1fb6ff];return _0x339f61;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5af08d,_0x1d182d){var _0x295832=function(_0x228ed6){while(--_0x228ed6){_0x5af08d['push'](_0x5af08d['shift']());}};_0x295832(++_0x1d182d);}(_0x7217,0x19e));var _0x7721=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x7217[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index e1c6071..22d3517 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 _0xb02b=['STRING','TEXT','*,*,*,*'];(function(_0x6c75da,_0x1b96d6){var _0x5f5d21=function(_0x5ef793){while(--_0x5ef793){_0x6c75da['push'](_0x6c75da['shift']());}};_0x5f5d21(++_0x1b96d6);}(_0xb02b,0x6f));var _0xbb02=function(_0x26c31c,_0x58d241){_0x26c31c=_0x26c31c-0x0;var _0x44d20d=_0xb02b[_0x26c31c];return _0x44d20d;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbb02('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbb02('0x1')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbb02('0x2')}}; \ No newline at end of file +var _0xae5e=['STRING','TEXT','*,*,*,*'];(function(_0x25378a,_0x5b20f3){var _0xe7cba4=function(_0x2cbde3){while(--_0x2cbde3){_0x25378a['push'](_0x25378a['shift']());}};_0xe7cba4(++_0x5b20f3);}(_0xae5e,0x1d1));var _0xeae5=function(_0x39246f,_0x10253e){_0x39246f=_0x39246f-0x0;var _0x90be33=_0xae5e[_0x39246f];return _0x90be33;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xeae5('0x0')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xeae5('0x1')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xeae5('0x0')],'defaultValue':_0xeae5('0x2')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index fecab9b..cd00387 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 _0xc103=['count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsApplication','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0xc103,0xc5));var _0x3c10=function(_0x47db69,_0x132873){_0x47db69=_0x47db69-0x0;var _0x38115a=_0xc103[_0x47db69];return _0x38115a;};'use strict';var emlformat=require(_0x3c10('0x0'));var rimraf=require(_0x3c10('0x1'));var zipdir=require(_0x3c10('0x2'));var jsonpatch=require(_0x3c10('0x3'));var rp=require(_0x3c10('0x4'));var moment=require(_0x3c10('0x5'));var BPromise=require(_0x3c10('0x6'));var Mustache=require(_0x3c10('0x7'));var util=require('util');var path=require(_0x3c10('0x8'));var sox=require(_0x3c10('0x9'));var csv=require(_0x3c10('0xa'));var ejs=require(_0x3c10('0xb'));var fs=require('fs');var fs_extra=require(_0x3c10('0xc'));var _=require(_0x3c10('0xd'));var squel=require(_0x3c10('0xe'));var crypto=require('crypto');var jsforce=require(_0x3c10('0xf'));var deskjs=require(_0x3c10('0x10'));var toCsv=require(_0x3c10('0xa'));var querystring=require(_0x3c10('0x11'));var Papa=require('papaparse');var Redis=require(_0x3c10('0x12'));var authService=require(_0x3c10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c10('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3c10('0x15'));var licenseUtil=require(_0x3c10('0x16'));var db=require(_0x3c10('0x17'))['db'];function respondWithStatusCode(_0x1d6136,_0x5894df){_0x5894df=_0x5894df||0xcc;return function(_0x37cf0f){if(_0x37cf0f){return _0x1d6136[_0x3c10('0x18')](_0x5894df);}return _0x1d6136[_0x3c10('0x19')](_0x5894df)[_0x3c10('0x1a')]();};}function respondWithResult(_0x46e7ac,_0x1a5d07){_0x1a5d07=_0x1a5d07||0xc8;return function(_0xb7c215){if(_0xb7c215){return _0x46e7ac[_0x3c10('0x19')](_0x1a5d07)[_0x3c10('0x1b')](_0xb7c215);}};}function respondWithFilteredResult(_0x202fe4,_0x4dd237){return function(_0x4f4617){if(_0x4f4617){var _0x4ea34e=typeof _0x4dd237[_0x3c10('0x1c')]===_0x3c10('0x1d')&&typeof _0x4dd237[_0x3c10('0x1e')]===_0x3c10('0x1d');var _0x83702d=_0x4f4617[_0x3c10('0x1f')];var _0x253fa3=_0x4ea34e?0x0:_0x4dd237[_0x3c10('0x1c')];var _0x15d1c1=_0x4ea34e?_0x4f4617[_0x3c10('0x1f')]:_0x4dd237[_0x3c10('0x1c')]+_0x4dd237[_0x3c10('0x1e')];var _0x745d4;if(_0x15d1c1>=_0x83702d){_0x15d1c1=_0x83702d;_0x745d4=0xc8;}else{_0x745d4=0xce;}_0x202fe4['status'](_0x745d4);return _0x202fe4[_0x3c10('0x20')](_0x3c10('0x21'),_0x253fa3+'-'+_0x15d1c1+'/'+_0x83702d)[_0x3c10('0x1b')](_0x4f4617);}return null;};}function patchUpdates(_0x1864f0){return function(_0x3f3d02){try{jsonpatch['apply'](_0x3f3d02,_0x1864f0,!![]);}catch(_0x20d8c8){return BPromise[_0x3c10('0x22')](_0x20d8c8);}return _0x3f3d02['save']();};}function saveUpdates(_0x1353da,_0x29adc2){return function(_0x50f816){if(_0x50f816){return _0x50f816[_0x3c10('0x23')](_0x1353da)[_0x3c10('0x24')](function(_0xc882b8){return _0xc882b8;});}return null;};}function removeEntity(_0x1fb63b,_0x7a8521){return function(_0x3b0838){if(_0x3b0838){return _0x3b0838[_0x3c10('0x25')]()[_0x3c10('0x24')](function(){_0x1fb63b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x576f25,_0x1b0557){return function(_0x2aa1bf){if(!_0x2aa1bf){_0x576f25[_0x3c10('0x18')](0x194);}return _0x2aa1bf;};}function handleError(_0x34de6e,_0x4a8b60){_0x4a8b60=_0x4a8b60||0x1f4;return function(_0x14b76){logger[_0x3c10('0x26')](_0x14b76[_0x3c10('0x27')]);if(_0x14b76[_0x3c10('0x28')]){delete _0x14b76[_0x3c10('0x28')];}_0x34de6e[_0x3c10('0x19')](_0x4a8b60)[_0x3c10('0x29')](_0x14b76);};}exports[_0x3c10('0x2a')]=function(_0x568dac,_0x474ab1){var _0x3269c3={},_0x5df0e4={},_0x2718c7={'count':0x0,'rows':[]};var _0x44e20b=_[_0x3c10('0x2b')](db['SmsApplication'][_0x3c10('0x2c')],function(_0x50d152){return{'name':_0x50d152[_0x3c10('0x2d')],'type':_0x50d152[_0x3c10('0x2e')][_0x3c10('0x2f')]};});_0x5df0e4['model']=_[_0x3c10('0x2b')](_0x44e20b,_0x3c10('0x28'));_0x5df0e4[_0x3c10('0x30')]=_[_0x3c10('0x31')](_0x568dac[_0x3c10('0x30')]);_0x5df0e4[_0x3c10('0x32')]=_[_0x3c10('0x33')](_0x5df0e4['model'],_0x5df0e4[_0x3c10('0x30')]);_0x3269c3[_0x3c10('0x34')]=_[_0x3c10('0x33')](_0x5df0e4['model'],qs[_0x3c10('0x35')](_0x568dac[_0x3c10('0x30')][_0x3c10('0x35')]));_0x3269c3[_0x3c10('0x34')]=_0x3269c3[_0x3c10('0x34')][_0x3c10('0x36')]?_0x3269c3['attributes']:_0x5df0e4[_0x3c10('0x37')];if(!_0x568dac[_0x3c10('0x30')][_0x3c10('0x38')](_0x3c10('0x39'))){_0x3269c3[_0x3c10('0x1e')]=qs[_0x3c10('0x1e')](_0x568dac[_0x3c10('0x30')][_0x3c10('0x1e')]);_0x3269c3[_0x3c10('0x1c')]=qs[_0x3c10('0x1c')](_0x568dac['query'][_0x3c10('0x1c')]);}_0x3269c3[_0x3c10('0x3a')]=qs['sort'](_0x568dac[_0x3c10('0x30')][_0x3c10('0x3b')]);_0x3269c3[_0x3c10('0x3c')]=qs[_0x3c10('0x32')](_[_0x3c10('0x3d')](_0x568dac[_0x3c10('0x30')],_0x5df0e4[_0x3c10('0x32')]),_0x44e20b);if(_0x568dac['query'][_0x3c10('0x3e')]){_0x3269c3[_0x3c10('0x3c')]=_['merge'](_0x3269c3[_0x3c10('0x3c')],{'$or':_[_0x3c10('0x2b')](_0x44e20b,function(_0x57050a){if(_0x57050a[_0x3c10('0x2e')]!==_0x3c10('0x3f')){var _0x34a81e={};_0x34a81e[_0x57050a[_0x3c10('0x28')]]={'$like':'%'+_0x568dac[_0x3c10('0x30')][_0x3c10('0x3e')]+'%'};return _0x34a81e;}})});}_0x3269c3=_[_0x3c10('0x40')]({},_0x3269c3,_0x568dac[_0x3c10('0x41')]);var _0x3eeaef={'where':_0x3269c3['where']};return db[_0x3c10('0x42')][_0x3c10('0x1f')](_0x3eeaef)['then'](function(_0x26dfcd){_0x2718c7[_0x3c10('0x1f')]=_0x26dfcd;if(_0x568dac[_0x3c10('0x30')][_0x3c10('0x43')]){_0x3269c3[_0x3c10('0x44')]=[{'all':!![]}];}return db['SmsApplication'][_0x3c10('0x45')](_0x3269c3);})[_0x3c10('0x24')](function(_0xf7c9f4){_0x2718c7[_0x3c10('0x46')]=_0xf7c9f4;return _0x2718c7;})[_0x3c10('0x24')](respondWithFilteredResult(_0x474ab1,_0x3269c3))[_0x3c10('0x47')](handleError(_0x474ab1,null));};exports['show']=function(_0x14b45c,_0x4acbba){var _0xbb0fa0={'raw':!![],'where':{'id':_0x14b45c[_0x3c10('0x48')]['id']}},_0x1047a7={};_0x1047a7[_0x3c10('0x37')]=_[_0x3c10('0x31')](db[_0x3c10('0x42')][_0x3c10('0x2c')]);_0x1047a7[_0x3c10('0x30')]=_[_0x3c10('0x31')](_0x14b45c['query']);_0x1047a7[_0x3c10('0x32')]=_[_0x3c10('0x33')](_0x1047a7[_0x3c10('0x37')],_0x1047a7['query']);_0xbb0fa0[_0x3c10('0x34')]=_[_0x3c10('0x33')](_0x1047a7['model'],qs[_0x3c10('0x35')](_0x14b45c[_0x3c10('0x30')][_0x3c10('0x35')]));_0xbb0fa0[_0x3c10('0x34')]=_0xbb0fa0[_0x3c10('0x34')][_0x3c10('0x36')]?_0xbb0fa0[_0x3c10('0x34')]:_0x1047a7[_0x3c10('0x37')];if(_0x14b45c['query'][_0x3c10('0x43')]){_0xbb0fa0[_0x3c10('0x44')]=[{'all':!![]}];}_0xbb0fa0=_['merge']({},_0xbb0fa0,_0x14b45c['options']);return db[_0x3c10('0x42')][_0x3c10('0x49')](_0xbb0fa0)[_0x3c10('0x24')](handleEntityNotFound(_0x4acbba,null))[_0x3c10('0x24')](respondWithResult(_0x4acbba,null))[_0x3c10('0x47')](handleError(_0x4acbba,null));};exports[_0x3c10('0x4a')]=function(_0x2dfdb9,_0x54d536){return db[_0x3c10('0x42')][_0x3c10('0x4a')](_0x2dfdb9[_0x3c10('0x4b')],{})['then'](respondWithResult(_0x54d536,0xc9))[_0x3c10('0x47')](handleError(_0x54d536,null));};exports['update']=function(_0x55893f,_0x10313d){if(_0x55893f[_0x3c10('0x4b')]['id']){delete _0x55893f[_0x3c10('0x4b')]['id'];}return db['SmsApplication'][_0x3c10('0x49')]({'where':{'id':_0x55893f[_0x3c10('0x48')]['id']}})[_0x3c10('0x24')](handleEntityNotFound(_0x10313d,null))[_0x3c10('0x24')](saveUpdates(_0x55893f[_0x3c10('0x4b')],null))[_0x3c10('0x24')](respondWithResult(_0x10313d,null))['catch'](handleError(_0x10313d,null));};exports[_0x3c10('0x25')]=function(_0x42d065,_0x1fcc87){return db[_0x3c10('0x42')]['find']({'where':{'id':_0x42d065['params']['id']}})['then'](handleEntityNotFound(_0x1fcc87,null))[_0x3c10('0x24')](removeEntity(_0x1fcc87,null))[_0x3c10('0x47')](handleError(_0x1fcc87,null));}; \ No newline at end of file +var _0xebd6=['type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','SmsApplication','fieldName'];(function(_0x24177a,_0x2c92e0){var _0x3b7131=function(_0x1b3975){while(--_0x1b3975){_0x24177a['push'](_0x24177a['shift']());}};_0x3b7131(++_0x2c92e0);}(_0xebd6,0xf0));var _0x6ebd=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xebd6[_0x2d2c16];return _0x53f2fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ebd('0x0'));var zipdir=require(_0x6ebd('0x1'));var jsonpatch=require(_0x6ebd('0x2'));var rp=require('request-promise');var moment=require(_0x6ebd('0x3'));var BPromise=require(_0x6ebd('0x4'));var Mustache=require(_0x6ebd('0x5'));var util=require('util');var path=require(_0x6ebd('0x6'));var sox=require(_0x6ebd('0x7'));var csv=require(_0x6ebd('0x8'));var ejs=require(_0x6ebd('0x9'));var fs=require('fs');var fs_extra=require(_0x6ebd('0xa'));var _=require(_0x6ebd('0xb'));var squel=require(_0x6ebd('0xc'));var crypto=require('crypto');var jsforce=require(_0x6ebd('0xd'));var deskjs=require(_0x6ebd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ebd('0xf'));var Papa=require(_0x6ebd('0x10'));var Redis=require(_0x6ebd('0x11'));var authService=require(_0x6ebd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6ebd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ebd('0x14'))(_0x6ebd('0x15'));var utils=require(_0x6ebd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6ebd('0x17'));var db=require(_0x6ebd('0x18'))['db'];function respondWithStatusCode(_0x4f7280,_0xe18df3){_0xe18df3=_0xe18df3||0xcc;return function(_0x4d8f51){if(_0x4d8f51){return _0x4f7280[_0x6ebd('0x19')](_0xe18df3);}return _0x4f7280[_0x6ebd('0x1a')](_0xe18df3)[_0x6ebd('0x1b')]();};}function respondWithResult(_0x9799e9,_0x19d2d1){_0x19d2d1=_0x19d2d1||0xc8;return function(_0x39be91){if(_0x39be91){return _0x9799e9[_0x6ebd('0x1a')](_0x19d2d1)[_0x6ebd('0x1c')](_0x39be91);}};}function respondWithFilteredResult(_0x4e0625,_0x41ffcd){return function(_0x333033){if(_0x333033){var _0x53e5c8=typeof _0x41ffcd[_0x6ebd('0x1d')]==='undefined'&&typeof _0x41ffcd[_0x6ebd('0x1e')]==='undefined';var _0x116974=_0x333033[_0x6ebd('0x1f')];var _0xe01eab=_0x53e5c8?0x0:_0x41ffcd['offset'];var _0x573f84=_0x53e5c8?_0x333033[_0x6ebd('0x1f')]:_0x41ffcd[_0x6ebd('0x1d')]+_0x41ffcd[_0x6ebd('0x1e')];var _0x4cf109;if(_0x573f84>=_0x116974){_0x573f84=_0x116974;_0x4cf109=0xc8;}else{_0x4cf109=0xce;}_0x4e0625[_0x6ebd('0x1a')](_0x4cf109);return _0x4e0625['set'](_0x6ebd('0x20'),_0xe01eab+'-'+_0x573f84+'/'+_0x116974)[_0x6ebd('0x1c')](_0x333033);}return null;};}function patchUpdates(_0x2853a6){return function(_0x298637){try{jsonpatch[_0x6ebd('0x21')](_0x298637,_0x2853a6,!![]);}catch(_0x1b7259){return BPromise[_0x6ebd('0x22')](_0x1b7259);}return _0x298637[_0x6ebd('0x23')]();};}function saveUpdates(_0x4e8e8b,_0x4c43b3){return function(_0x5c2a5c){if(_0x5c2a5c){return _0x5c2a5c[_0x6ebd('0x24')](_0x4e8e8b)[_0x6ebd('0x25')](function(_0x2c22bf){return _0x2c22bf;});}return null;};}function removeEntity(_0x218f4c,_0x279c81){return function(_0x48deb1){if(_0x48deb1){return _0x48deb1[_0x6ebd('0x26')]()[_0x6ebd('0x25')](function(){_0x218f4c[_0x6ebd('0x1a')](0xcc)[_0x6ebd('0x1b')]();});}};}function handleEntityNotFound(_0x2fb185,_0x47e013){return function(_0x4a32d2){if(!_0x4a32d2){_0x2fb185[_0x6ebd('0x19')](0x194);}return _0x4a32d2;};}function handleError(_0x15e90f,_0x1c03ca){_0x1c03ca=_0x1c03ca||0x1f4;return function(_0x43805e){logger['error'](_0x43805e[_0x6ebd('0x27')]);if(_0x43805e[_0x6ebd('0x28')]){delete _0x43805e[_0x6ebd('0x28')];}_0x15e90f['status'](_0x1c03ca)['send'](_0x43805e);};}exports['index']=function(_0x5a26ed,_0x3af9d1){var _0x1d4ae8={},_0x3fedf4={},_0x3628e4={'count':0x0,'rows':[]};var _0x2f53dd=_[_0x6ebd('0x29')](db[_0x6ebd('0x2a')]['rawAttributes'],function(_0x3235a9){return{'name':_0x3235a9[_0x6ebd('0x2b')],'type':_0x3235a9[_0x6ebd('0x2c')][_0x6ebd('0x2d')]};});_0x3fedf4[_0x6ebd('0x2e')]=_[_0x6ebd('0x29')](_0x2f53dd,'name');_0x3fedf4[_0x6ebd('0x2f')]=_['keys'](_0x5a26ed['query']);_0x3fedf4[_0x6ebd('0x30')]=_[_0x6ebd('0x31')](_0x3fedf4['model'],_0x3fedf4[_0x6ebd('0x2f')]);_0x1d4ae8['attributes']=_[_0x6ebd('0x31')](_0x3fedf4[_0x6ebd('0x2e')],qs[_0x6ebd('0x32')](_0x5a26ed[_0x6ebd('0x2f')][_0x6ebd('0x32')]));_0x1d4ae8['attributes']=_0x1d4ae8[_0x6ebd('0x33')][_0x6ebd('0x34')]?_0x1d4ae8[_0x6ebd('0x33')]:_0x3fedf4[_0x6ebd('0x2e')];if(!_0x5a26ed[_0x6ebd('0x2f')]['hasOwnProperty'](_0x6ebd('0x35'))){_0x1d4ae8['limit']=qs['limit'](_0x5a26ed[_0x6ebd('0x2f')][_0x6ebd('0x1e')]);_0x1d4ae8['offset']=qs[_0x6ebd('0x1d')](_0x5a26ed['query']['offset']);}_0x1d4ae8[_0x6ebd('0x36')]=qs[_0x6ebd('0x37')](_0x5a26ed[_0x6ebd('0x2f')]['sort']);_0x1d4ae8[_0x6ebd('0x38')]=qs[_0x6ebd('0x30')](_[_0x6ebd('0x39')](_0x5a26ed[_0x6ebd('0x2f')],_0x3fedf4[_0x6ebd('0x30')]),_0x2f53dd);if(_0x5a26ed[_0x6ebd('0x2f')]['filter']){_0x1d4ae8[_0x6ebd('0x38')]=_[_0x6ebd('0x3a')](_0x1d4ae8[_0x6ebd('0x38')],{'$or':_[_0x6ebd('0x29')](_0x2f53dd,function(_0x5e0d3c){if(_0x5e0d3c[_0x6ebd('0x2c')]!=='VIRTUAL'){var _0x2cd757={};_0x2cd757[_0x5e0d3c[_0x6ebd('0x28')]]={'$like':'%'+_0x5a26ed[_0x6ebd('0x2f')]['filter']+'%'};return _0x2cd757;}})});}_0x1d4ae8=_[_0x6ebd('0x3a')]({},_0x1d4ae8,_0x5a26ed[_0x6ebd('0x3b')]);var _0xab7166={'where':_0x1d4ae8[_0x6ebd('0x38')]};return db[_0x6ebd('0x2a')][_0x6ebd('0x1f')](_0xab7166)[_0x6ebd('0x25')](function(_0x2546ad){_0x3628e4[_0x6ebd('0x1f')]=_0x2546ad;if(_0x5a26ed[_0x6ebd('0x2f')][_0x6ebd('0x3c')]){_0x1d4ae8['include']=[{'all':!![]}];}return db[_0x6ebd('0x2a')][_0x6ebd('0x3d')](_0x1d4ae8);})[_0x6ebd('0x25')](function(_0x5d8491){_0x3628e4[_0x6ebd('0x3e')]=_0x5d8491;return _0x3628e4;})[_0x6ebd('0x25')](respondWithFilteredResult(_0x3af9d1,_0x1d4ae8))[_0x6ebd('0x3f')](handleError(_0x3af9d1,null));};exports[_0x6ebd('0x40')]=function(_0x482778,_0x30e3a1){var _0x3027b4={'raw':!![],'where':{'id':_0x482778[_0x6ebd('0x41')]['id']}},_0x16ffd6={};_0x16ffd6['model']=_[_0x6ebd('0x42')](db[_0x6ebd('0x2a')]['rawAttributes']);_0x16ffd6['query']=_['keys'](_0x482778[_0x6ebd('0x2f')]);_0x16ffd6[_0x6ebd('0x30')]=_['intersection'](_0x16ffd6['model'],_0x16ffd6[_0x6ebd('0x2f')]);_0x3027b4[_0x6ebd('0x33')]=_[_0x6ebd('0x31')](_0x16ffd6['model'],qs['fields'](_0x482778['query'][_0x6ebd('0x32')]));_0x3027b4[_0x6ebd('0x33')]=_0x3027b4[_0x6ebd('0x33')]['length']?_0x3027b4[_0x6ebd('0x33')]:_0x16ffd6['model'];if(_0x482778['query'][_0x6ebd('0x3c')]){_0x3027b4[_0x6ebd('0x43')]=[{'all':!![]}];}_0x3027b4=_[_0x6ebd('0x3a')]({},_0x3027b4,_0x482778[_0x6ebd('0x3b')]);return db[_0x6ebd('0x2a')][_0x6ebd('0x44')](_0x3027b4)['then'](handleEntityNotFound(_0x30e3a1,null))[_0x6ebd('0x25')](respondWithResult(_0x30e3a1,null))[_0x6ebd('0x3f')](handleError(_0x30e3a1,null));};exports[_0x6ebd('0x45')]=function(_0x53b9c9,_0x72be53){return db[_0x6ebd('0x2a')][_0x6ebd('0x45')](_0x53b9c9[_0x6ebd('0x46')],{})[_0x6ebd('0x25')](respondWithResult(_0x72be53,0xc9))[_0x6ebd('0x3f')](handleError(_0x72be53,null));};exports[_0x6ebd('0x24')]=function(_0x110352,_0x23ab91){if(_0x110352['body']['id']){delete _0x110352[_0x6ebd('0x46')]['id'];}return db['SmsApplication'][_0x6ebd('0x44')]({'where':{'id':_0x110352[_0x6ebd('0x41')]['id']}})[_0x6ebd('0x25')](handleEntityNotFound(_0x23ab91,null))['then'](saveUpdates(_0x110352[_0x6ebd('0x46')],null))[_0x6ebd('0x25')](respondWithResult(_0x23ab91,null))[_0x6ebd('0x3f')](handleError(_0x23ab91,null));};exports[_0x6ebd('0x26')]=function(_0x22f7b4,_0x28a23){return db[_0x6ebd('0x2a')][_0x6ebd('0x44')]({'where':{'id':_0x22f7b4[_0x6ebd('0x41')]['id']}})[_0x6ebd('0x25')](handleEntityNotFound(_0x28a23,null))[_0x6ebd('0x25')](removeEntity(_0x28a23,null))['catch'](handleError(_0x28a23,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index fdefadd..46e7c1b 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 _0xd4de=['request-promise','path','../../config/environment','./smsApplication.attributes','exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x28bb81,_0x5e15fe){var _0x2c8102=function(_0x1c18c0){while(--_0x1c18c0){_0x28bb81['push'](_0x28bb81['shift']());}};_0x2c8102(++_0x5e15fe);}(_0xd4de,0x173));var _0xed4d=function(_0x51bde5,_0xeed681){_0x51bde5=_0x51bde5-0x0;var _0x5bee3c=_0xd4de[_0x51bde5];return _0x5bee3c;};'use strict';var _=require(_0xed4d('0x0'));var util=require(_0xed4d('0x1'));var logger=require(_0xed4d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xed4d('0x3'));var fs=require('fs');var path=require(_0xed4d('0x4'));var rimraf=require('rimraf');var config=require(_0xed4d('0x5'));var attributes=require(_0xed4d('0x6'));module[_0xed4d('0x7')]=function(_0x1f42e6,_0x27594c){return _0x1f42e6['define'](_0xed4d('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed4d('0x9'),'collate':_0xed4d('0xa')});}; \ No newline at end of file +var _0x4e8d=['utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4'];(function(_0x4af3a7,_0x49f744){var _0x4342b0=function(_0x409f23){while(--_0x409f23){_0x4af3a7['push'](_0x4af3a7['shift']());}};_0x4342b0(++_0x49f744);}(_0x4e8d,0x156));var _0xd4e8=function(_0x578323,_0x3c9a64){_0x578323=_0x578323-0x0;var _0x5931e7=_0x4e8d[_0x578323];return _0x5931e7;};'use strict';var _=require(_0xd4e8('0x0'));var util=require('util');var logger=require(_0xd4e8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd4e8('0x2'));var rp=require(_0xd4e8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4e8('0x4'));var config=require(_0xd4e8('0x5'));var attributes=require(_0xd4e8('0x6'));module[_0xd4e8('0x7')]=function(_0x506be7,_0xcd01fa){return _0x506be7[_0xd4e8('0x8')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4e8('0x9'),'collate':_0xd4e8('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2086fa3..ce996f7 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 _0x4d5a=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x71c2a1,_0x2dab27){var _0x1e142c=function(_0x40fe1a){while(--_0x40fe1a){_0x71c2a1['push'](_0x71c2a1['shift']());}};_0x1e142c(++_0x2dab27);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x4d5a[_0x311c35];return _0x5cc50c;};'use strict';var _=require('lodash');var util=require(_0xa4d5('0x0'));var moment=require(_0xa4d5('0x1'));var BPromise=require(_0xa4d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4d5('0x3'));var db=require(_0xa4d5('0x4'))['db'];var utils=require(_0xa4d5('0x5'));var logger=require(_0xa4d5('0x6'))('rpc');var config=require(_0xa4d5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1856aa,_0x166db3,_0x318315){return new BPromise(function(_0x408db0,_0x3bed6b){return client[_0xa4d5('0x9')](_0x1856aa,_0x318315)['then'](function(_0x5586de){logger[_0xa4d5('0xa')](_0xa4d5('0xb'),_0x166db3,_0xa4d5('0xc'));logger[_0xa4d5('0xd')](_0xa4d5('0xe'),_0x166db3,_0xa4d5('0xc'),JSON[_0xa4d5('0xf')](_0x5586de));if(_0x5586de[_0xa4d5('0x10')]){if(_0x5586de['error']['code']===0x1f4){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x3bed6b(_0x5586de['error']['message']);}logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x408db0(_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x166db3,_0xa4d5('0xc'));_0x408db0(_0x5586de[_0xa4d5('0x12')]['message']);}})[_0xa4d5('0x13')](function(_0x31eed7){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x31eed7);_0x3bed6b(_0x31eed7);});});} \ No newline at end of file +var _0x39d2=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x27d0ad,_0x3f8bef){var _0x4eec43=function(_0x336bb6){while(--_0x336bb6){_0x27d0ad['push'](_0x27d0ad['shift']());}};_0x4eec43(++_0x3f8bef);}(_0x39d2,0xf5));var _0x239d=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x39d2[_0x34eb31];return _0x254994;};'use strict';var _=require(_0x239d('0x0'));var util=require('util');var moment=require(_0x239d('0x1'));var BPromise=require(_0x239d('0x2'));var rs=require(_0x239d('0x3'));var fs=require('fs');var Redis=require(_0x239d('0x4'));var db=require(_0x239d('0x5'))['db'];var utils=require(_0x239d('0x6'));var logger=require(_0x239d('0x7'))(_0x239d('0x8'));var config=require(_0x239d('0x9'));var jayson=require(_0x239d('0xa'));var client=jayson[_0x239d('0xb')][_0x239d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f0947,_0x53d457,_0x262efe){return new BPromise(function(_0x2a6811,_0x3f9948){return client[_0x239d('0xd')](_0x1f0947,_0x262efe)[_0x239d('0xe')](function(_0x3d7f32){logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));logger[_0x239d('0x12')](_0x239d('0x13'),_0x53d457,_0x239d('0x11'),JSON[_0x239d('0x14')](_0x3d7f32));if(_0x3d7f32[_0x239d('0x15')]){if(_0x3d7f32[_0x239d('0x15')]['code']===0x1f4){logger['error'](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x3f9948(_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);}logger[_0x239d('0x15')](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x2a6811(_0x3d7f32['error'][_0x239d('0x16')]);}else{logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));_0x2a6811(_0x3d7f32[_0x239d('0x17')]['message']);}})['catch'](function(_0x141582){logger['error'](_0x239d('0x10'),_0x53d457,_0x141582);_0x3f9948(_0x141582);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5835b46..03e7604 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0xfceab,_0x160001){var _0x25807d=function(_0xfeaffd){while(--_0xfeaffd){_0xfceab['push'](_0xfceab['shift']());}};_0x25807d(++_0x160001);}(_0x955f,0x1eb));var _0xf955=function(_0x32b0e8,_0x556d6e){_0x32b0e8=_0x32b0e8-0x0;var _0x22dd0c=_0x955f[_0x32b0e8];return _0x22dd0c;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file +var _0xb62e=['removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy'];(function(_0x158902,_0x4c45bc){var _0x2bec55=function(_0x446ce1){while(--_0x446ce1){_0x158902['push'](_0x158902['shift']());}};_0x2bec55(++_0x4c45bc);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/describe',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xeb62('0xc')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0xc')](_0xeb62('0x11'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x13')]('/',auth[_0xeb62('0xa')](),controller['create']);router[_0xeb62('0x13')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x14')]);router['post'](_0xeb62('0x15'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')]('sms',_0xeb62('0x17')),controller[_0xeb62('0x18')]);router[_0xeb62('0x19')]('/:id',auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1b')),controller[_0xeb62('0x1c')]);router[_0xeb62('0x1d')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1e')),controller[_0xeb62('0x1f')]);router[_0xeb62('0x1d')]('/:id/tags',auth[_0xeb62('0xa')](),controller[_0xeb62('0x20')]);module[_0xeb62('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 110d31c..d476dd3 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 _0x33ac=['moment','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x5db4b0,_0x27af13){var _0x9eaa85=function(_0x99c049){while(--_0x99c049){_0x5db4b0['push'](_0x5db4b0['shift']());}};_0x9eaa85(++_0x27af13);}(_0x33ac,0x1f2));var _0xc33a=function(_0x458c18,_0x18ce26){_0x458c18=_0x458c18-0x0;var _0x14fa65=_0x33ac[_0x458c18];return _0x14fa65;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc33a('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc33a('0x1')]},'disposition':{'type':Sequelize[_0xc33a('0x2')]},'secondDisposition':{'type':Sequelize[_0xc33a('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc33a('0x2')]},'note':{'type':Sequelize[_0xc33a('0x2')]},'phone':{'type':Sequelize[_0xc33a('0x2')]},'read1stAt':{'type':Sequelize[_0xc33a('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xc33a('0x3')]('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc33a('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x304b=['exports','BOOLEAN','DATE','STRING','ENUM','out','moment'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x304b,0xfb));var _0xb304=function(_0x3721a7,_0x48972d){_0x3721a7=_0x3721a7-0x0;var _0x1d65dd=_0x304b[_0x3721a7];return _0x1d65dd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb304('0x0'));module[_0xb304('0x1')]={'closed':{'type':Sequelize[_0xb304('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb304('0x3')]},'disposition':{'type':Sequelize[_0xb304('0x4')]},'secondDisposition':{'type':Sequelize[_0xb304('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb304('0x4')]},'note':{'type':Sequelize[_0xb304('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb304('0x5')]('in',_0xb304('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb304('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb304('0x5')]('in',_0xb304('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb304('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 5a0f2ac..72208ab 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 _0x061b=['ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','status','offset','undefined','limit','count','json','update','then','error','name','send','index','map','SmsInteraction','fieldName','type','getOptions','findAll','query','user','show','model','keys','filters','intersection','fields','attributes','length','include','merge','options','find','body','params','catch','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','omit','spread','color','emit','smsInteractionTags:save','removeTags','download','toString','join','server','transcript-%d-%s.zip','push','User','CmContact','Contact','lastName','Messages','createdAt','secret','read','SmsAccount','Owner','fullname','get','mkdirSync','Sms','N.A.','closed','disposition','direction','out','System','firstName','value','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash'];(function(_0x3bee0c,_0x1d412f){var _0x531ce2=function(_0x4c6e19){while(--_0x4c6e19){_0x3bee0c['push'](_0x3bee0c['shift']());}};_0x531ce2(++_0x1d412f);}(_0x061b,0x6f));var _0xb061=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x061b[_0x51020b];return _0x371e47;};'use strict';var rimraf=require(_0xb061('0x0'));var zipdir=require(_0xb061('0x1'));var moment=require(_0xb061('0x2'));var BPromise=require('bluebird');var util=require(_0xb061('0x3'));var path=require(_0xb061('0x4'));var ejs=require(_0xb061('0x5'));var fs=require('fs');var _=require(_0xb061('0x6'));var Redis=require(_0xb061('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xb061('0x8'));var pdf=require(_0xb061('0x9'));var logger=require(_0xb061('0xa'))(_0xb061('0xb'));var config=require('../../config/environment');var db=require(_0xb061('0xc'))['db'];config[_0xb061('0xd')]=_[_0xb061('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb061('0xf'))(new Redis(config[_0xb061('0xd')]));require(_0xb061('0x10'))['register'](socket);function respondWithStatusCode(_0x428528,_0x273ad5){_0x273ad5=_0x273ad5||0xcc;return function(_0x4622da){if(_0x4622da){return _0x428528[_0xb061('0x11')](_0x273ad5);}return _0x428528[_0xb061('0x12')](_0x273ad5)['end']();};}function respondWithResult(_0x5c7285,_0x1ddad7){_0x1ddad7=_0x1ddad7||0xc8;return function(_0x2b49dd){if(_0x2b49dd){return _0x5c7285[_0xb061('0x12')](_0x1ddad7)['json'](_0x2b49dd);}};}function respondWithFilteredResult(_0x108657,_0x3d452f){return function(_0x3ca9b5){if(_0x3ca9b5){var _0x33fdf1=typeof _0x3d452f[_0xb061('0x13')]===_0xb061('0x14')&&typeof _0x3d452f[_0xb061('0x15')]==='undefined';var _0x333de6=_0x3ca9b5[_0xb061('0x16')];var _0x35b5ad=_0x33fdf1?0x0:_0x3d452f[_0xb061('0x13')];var _0x464842=_0x33fdf1?_0x3ca9b5[_0xb061('0x16')]:_0x3d452f[_0xb061('0x13')]+_0x3d452f[_0xb061('0x15')];var _0xa5a89e;if(_0x464842>=_0x333de6){_0x464842=_0x333de6;_0xa5a89e=0xc8;}else{_0xa5a89e=0xce;}_0x108657[_0xb061('0x12')](_0xa5a89e);return _0x108657['set']('Content-Range',_0x35b5ad+'-'+_0x464842+'/'+_0x333de6)[_0xb061('0x17')](_0x3ca9b5);}return null;};}function saveUpdates(_0x255d38){return function(_0x20e518){if(_0x20e518){return _0x20e518[_0xb061('0x18')](_0x255d38)[_0xb061('0x19')](function(_0x190157){return _0x190157;});}return null;};}function removeEntity(_0x4df96e){return function(_0x266c99){if(_0x266c99){return _0x266c99['destroy']()['then'](function(){_0x4df96e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3401){return function(_0x37cc19){if(!_0x37cc19){_0x2f3401[_0xb061('0x11')](0x194);}return _0x37cc19;};}function handleError(_0x11ee00,_0x161257){_0x161257=_0x161257||0x1f4;return function(_0x1cf4ae){logger[_0xb061('0x1a')](_0x1cf4ae['stack']);if(_0x1cf4ae[_0xb061('0x1b')]){delete _0x1cf4ae['name'];}_0x11ee00[_0xb061('0x12')](_0x161257)[_0xb061('0x1c')](_0x1cf4ae);};}exports[_0xb061('0x1d')]=function(_0x422cc7,_0x2da824){var _0x390371={};var _0x25bae2=_[_0xb061('0x1e')](db[_0xb061('0x1f')]['rawAttributes'],function(_0x37da52){return{'name':_0x37da52[_0xb061('0x20')],'type':_0x37da52[_0xb061('0x21')]['key']};});_0x390371=qs[_0xb061('0x22')](_0x25bae2,_0x422cc7);return interaction[_0xb061('0x23')]('sms',_0x422cc7[_0xb061('0x24')],_0x422cc7[_0xb061('0x25')],_0x390371,_0x25bae2)[_0xb061('0x19')](respondWithFilteredResult(_0x2da824,_0x390371))['catch'](handleError(_0x2da824,null));};exports[_0xb061('0x26')]=function(_0x1b393e,_0x5d1937){var _0x1fec75={'raw':![],'where':{'id':_0x1b393e['params']['id']}},_0x5f2dbb={};_0x5f2dbb[_0xb061('0x27')]=_[_0xb061('0x28')](db['SmsInteraction']['rawAttributes']);_0x5f2dbb[_0xb061('0x24')]=_[_0xb061('0x28')](_0x1b393e[_0xb061('0x24')]);_0x5f2dbb[_0xb061('0x29')]=_[_0xb061('0x2a')](_0x5f2dbb[_0xb061('0x27')],_0x5f2dbb[_0xb061('0x24')]);_0x1fec75['attributes']=_[_0xb061('0x2a')](_0x5f2dbb[_0xb061('0x27')],qs[_0xb061('0x2b')](_0x1b393e[_0xb061('0x24')][_0xb061('0x2b')]));_0x1fec75[_0xb061('0x2c')]=_0x1fec75['attributes'][_0xb061('0x2d')]?_0x1fec75[_0xb061('0x2c')]:_0x5f2dbb[_0xb061('0x27')];if(_0x1b393e['query']['includeAll']){_0x1fec75[_0xb061('0x2e')]=[{'all':!![]}];}_0x1fec75=_[_0xb061('0x2f')]({},_0x1fec75,_0x1b393e[_0xb061('0x30')]);return db[_0xb061('0x1f')][_0xb061('0x31')](_0x1fec75)[_0xb061('0x19')](handleEntityNotFound(_0x5d1937,null))[_0xb061('0x19')](respondWithResult(_0x5d1937,null))['catch'](handleError(_0x5d1937,null));};exports['create']=function(_0x7cac4f,_0x4ae7a0){return db[_0xb061('0x1f')]['create'](_0x7cac4f[_0xb061('0x32')],{})[_0xb061('0x19')](respondWithResult(_0x4ae7a0,0xc9))['catch'](handleError(_0x4ae7a0,null));};exports['update']=function(_0x501c61,_0x1db69f){if(_0x501c61[_0xb061('0x32')]['id']){delete _0x501c61[_0xb061('0x32')]['id'];}return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0x501c61[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x1db69f,null))['then'](saveUpdates(_0x501c61[_0xb061('0x32')],null))[_0xb061('0x19')](respondWithResult(_0x1db69f,null))[_0xb061('0x34')](handleError(_0x1db69f,null));};exports[_0xb061('0x35')]=function(_0x1034ad,_0x5e4aa8){return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0x1034ad[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x5e4aa8,null))[_0xb061('0x19')](removeEntity(_0x5e4aa8,null))[_0xb061('0x34')](handleError(_0x5e4aa8,null));};exports[_0xb061('0x36')]=function(_0x2a240a,_0x483d5a){return db[_0xb061('0x1f')][_0xb061('0x36')]()[_0xb061('0x19')](respondWithResult(_0x483d5a,null))[_0xb061('0x34')](handleError(_0x483d5a,null));};exports[_0xb061('0x37')]=function(_0x1705e3,_0x269350){return db[_0xb061('0x38')]['find']({'where':{'id':_0x1705e3[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x269350,null))['then'](function(_0xe46d98){if(_0xe46d98){return _0xe46d98['addMessage'](_0x1705e3['body'][_0xb061('0x39')],_['omit'](_0x1705e3['body'],[_0xb061('0x39'),'id'])||{});}})[_0xb061('0x19')](respondWithResult(_0x269350,null))['catch'](handleError(_0x269350,null));};exports[_0xb061('0x3a')]=function(_0xc89300,_0x551ff8){var _0x3989a6={'raw':![],'where':{}};var _0x538097={};var _0x100726={'count':0x0,'rows':[]};return db[_0xb061('0x1f')][_0xb061('0x3b')]({'where':{'id':_0xc89300[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x551ff8,null))['then'](function(_0x43887a){if(_0x43887a){_0x538097[_0xb061('0x27')]=_[_0xb061('0x28')](db['SmsMessage'][_0xb061('0x3c')]);_0x538097[_0xb061('0x24')]=_[_0xb061('0x28')](_0xc89300[_0xb061('0x24')]);_0x538097['filters']=_[_0xb061('0x2a')](_0x538097[_0xb061('0x27')],_0x538097[_0xb061('0x24')]);_0x3989a6[_0xb061('0x2c')]=_['intersection'](_0x538097[_0xb061('0x27')],qs[_0xb061('0x2b')](_0xc89300[_0xb061('0x24')]['fields']));_0x3989a6[_0xb061('0x2c')]=_0x3989a6[_0xb061('0x2c')][_0xb061('0x2d')]?_0x3989a6[_0xb061('0x2c')]:_0x538097[_0xb061('0x27')];if(!_0xc89300[_0xb061('0x24')][_0xb061('0x3d')](_0xb061('0x3e'))){_0x3989a6[_0xb061('0x15')]=qs[_0xb061('0x15')](_0xc89300[_0xb061('0x24')][_0xb061('0x15')]);_0x3989a6['offset']=qs[_0xb061('0x13')](_0xc89300[_0xb061('0x24')][_0xb061('0x13')]);}_0x3989a6[_0xb061('0x3f')]=qs[_0xb061('0x40')](_0xc89300[_0xb061('0x24')][_0xb061('0x40')]);_0x3989a6[_0xb061('0x41')]=qs[_0xb061('0x29')](_['pick'](_0xc89300[_0xb061('0x24')],_0x538097[_0xb061('0x29')]));_0x3989a6[_0xb061('0x41')][_0xb061('0x42')]=_0x43887a['id'];if(_0xc89300['query'][_0xb061('0x43')]){_0x3989a6[_0xb061('0x41')]=_[_0xb061('0x2f')](_0x3989a6['where'],{'$or':_[_0xb061('0x1e')](_0x3989a6[_0xb061('0x2c')],function(_0x3aff5e){var _0x105d16={};_0x105d16[_0x3aff5e]={'$like':'%'+_0xc89300[_0xb061('0x24')][_0xb061('0x43')]+'%'};return _0x105d16;})});}if(_0xc89300[_0xb061('0x24')][_0xb061('0x44')]){var _0x1bf08e=_0xc89300[_0xb061('0x24')][_0xb061('0x44')][_0xb061('0x45')](',');var _0x516f3b={};_0x516f3b[_0x1bf08e[0x0]]={'$gte':moment(_0x1bf08e[0x1])[_0xb061('0x46')](_0xb061('0x47'))};_0x3989a6['where']=_['merge'](_0x3989a6[_0xb061('0x41')],_0x516f3b);}_0x3989a6=_[_0xb061('0x2f')]({},_0x3989a6,_0xc89300[_0xb061('0x30')]);return db[_0xb061('0x38')]['count']({'where':_0x3989a6[_0xb061('0x41')]})[_0xb061('0x19')](function(_0x1b3804){_0x100726['count']=_0x1b3804;if(_0xc89300[_0xb061('0x24')][_0xb061('0x48')]){_0x3989a6[_0xb061('0x2e')]=[{'all':!![]}];}return db['SmsMessage'][_0xb061('0x23')](_0x3989a6);})[_0xb061('0x19')](function(_0x568cb5){_0x100726[_0xb061('0x49')]=_0x568cb5;return _0x100726;});}})[_0xb061('0x19')](respondWithFilteredResult(_0x551ff8,_0x3989a6))[_0xb061('0x34')](handleError(_0x551ff8,null));};exports[_0xb061('0x4a')]=function(_0xea8bd5,_0x1143c5){return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0xea8bd5[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x1143c5,null))[_0xb061('0x19')](function(_0x431a5a){if(_0x431a5a){return _0x431a5a['setTags'](_0xea8bd5[_0xb061('0x32')]['ids'],_[_0xb061('0x4b')](_0xea8bd5[_0xb061('0x32')],[_0xb061('0x39'),'id'])||{})[_0xb061('0x4c')](function(){return db['Tag'][_0xb061('0x23')]({'attributes':['id',_0xb061('0x1b'),_0xb061('0x4d')],'where':{'id':_0xea8bd5[_0xb061('0x32')][_0xb061('0x39')]}});})[_0xb061('0x19')](function(_0x22f3fc){socket[_0xb061('0x4e')](_0xb061('0x4f'),{'id':Number(_0xea8bd5[_0xb061('0x33')]['id']),'tags':_0x22f3fc||[]});return{'id':Number(_0xea8bd5[_0xb061('0x33')]['id']),'tags':_0x22f3fc||[]};});}})['then'](respondWithResult(_0x1143c5,null))[_0xb061('0x34')](handleError(_0x1143c5,null));};exports[_0xb061('0x50')]=function(_0x26b959,_0x54e63f){return db[_0xb061('0x1f')]['find']({'where':{'id':_0x26b959[_0xb061('0x33')]['id']}})[_0xb061('0x19')](handleEntityNotFound(_0x54e63f,null))['then'](function(_0x559922){if(_0x559922){return _0x559922[_0xb061('0x50')](_0x26b959[_0xb061('0x24')]['ids']);}})['then'](respondWithStatusCode(_0x54e63f,null))['catch'](handleError(_0x54e63f,null));};exports[_0xb061('0x51')]=function(_0x276e5c,_0xe918a1){var _0x31be08=moment()['unix']()[_0xb061('0x52')]();var _0x43db33=path[_0xb061('0x53')](config['root'],_0xb061('0x54'),'files','tmp');var _0x1f53f9=path[_0xb061('0x53')](_0x43db33,_0x31be08);var _0x247739=util[_0xb061('0x46')](_0xb061('0x55'),_0x276e5c[_0xb061('0x33')]['id'],_0x31be08);var _0x20d5d4=path['join'](_0x43db33,_0x247739);var _0x39e7bf=[];_0x39e7bf[_0xb061('0x56')]({'model':db['User'],'as':_0xb061('0x57'),'attributes':['id','fullname'],'raw':!![]});_0x39e7bf[_0xb061('0x56')]({'model':db[_0xb061('0x58')],'as':_0xb061('0x59'),'attributes':['id','firstName',_0xb061('0x5a')],'raw':!![]});var _0x4363a8=[{'model':db[_0xb061('0x38')],'as':_0xb061('0x5b'),'attributes':['id',_0xb061('0x32'),_0xb061('0x5c'),'direction',_0xb061('0x5d'),_0xb061('0x5e')],'include':_0x39e7bf}];_0x4363a8[_0xb061('0x56')]({'model':db[_0xb061('0x5f')],'as':'Account','attributes':['id',_0xb061('0x1b')]});_0x4363a8[_0xb061('0x56')]({'model':db[_0xb061('0x57')],'as':_0xb061('0x60'),'attributes':['id',_0xb061('0x61')]});return db[_0xb061('0x1f')][_0xb061('0x31')]({'where':{'id':_0x276e5c[_0xb061('0x33')]['id']},'include':_0x4363a8})['then'](handleEntityNotFound(_0xe918a1,null))[_0xb061('0x19')](function(_0x2f0041){if(_0x2f0041){var _0x2b1be4=_0x2f0041[_0xb061('0x62')]({'plain':!![]});fs[_0xb061('0x63')](_0x1f53f9);var _0x387212={'channel':_0xb061('0x64'),'account':_0x2b1be4['Account'][_0xb061('0x1b')],'agent':_0x2b1be4[_0xb061('0x60')]?_0x2b1be4[_0xb061('0x60')]['fullname']:_0xb061('0x65'),'createdAt':moment(_0x2b1be4['createdAt'])[_0xb061('0x46')](_0xb061('0x47'))[_0xb061('0x52')](),'closedAt':_0x2b1be4[_0xb061('0x66')]?moment(_0x2b1be4['closedAt'])[_0xb061('0x46')](_0xb061('0x47'))[_0xb061('0x52')]():'','disposition':_0x2b1be4[_0xb061('0x67')],'messages':_(_0x2b1be4[_0xb061('0x5b')])[_0xb061('0x43')]({'secret':![]})[_0xb061('0x1e')](function(_0x47ec7f){return{'date':moment(_0x47ec7f[_0xb061('0x5c')])[_0xb061('0x46')](_0xb061('0x47'))[_0xb061('0x52')](),'sender':_0x47ec7f[_0xb061('0x68')]===_0xb061('0x69')?_0x47ec7f[_0xb061('0x57')]?_0x47ec7f[_0xb061('0x57')][_0xb061('0x61')]:_0xb061('0x6a'):_0x47ec7f['Contact'][_0xb061('0x6b')]+(_0x47ec7f['Contact'][_0xb061('0x5a')]?'\x20'+_0x47ec7f[_0xb061('0x59')]['lastName']:''),'body':_0x47ec7f['body'],'direction':_0x47ec7f[_0xb061('0x68')]===_0xb061('0x69')?'A':'C','secret':_0x47ec7f[_0xb061('0x5d')],'read':_0x47ec7f[_0xb061('0x5e')]};})[_0xb061('0x6c')]()};return ejs['renderFile'](path[_0xb061('0x53')](config[_0xb061('0x6d')],_0xb061('0x54'),_0xb061('0x6e'),_0xb061('0x6f')),{'interaction':_0x387212})[_0xb061('0x19')](function(_0x5b9162){var _0x3aae43=path[_0xb061('0x53')](_0x1f53f9,_0xb061('0x70')+_0x2b1be4['id']+'-'+_0x31be08+_0xb061('0x71'));var _0x428f46={'path':_0x3aae43,'channel':_0xb061('0x64'),'interactionId':_0x2b1be4['id']};return pdf[_0xb061('0x72')](_0x5b9162,_0x428f46);})[_0xb061('0x19')](function(){return new BPromise(function(_0x4612fe,_0x5c9e63){zipdir(_0x1f53f9,{'saveTo':_0x20d5d4},function(_0x2b3ddd,_0x5d4341){if(_0x2b3ddd)return _0x5c9e63(_0x2b3ddd);return _0x4612fe(_0x5d4341);});})[_0xb061('0x19')](function(){return new BPromise(function(_0x597dc5,_0x2c3df5){rimraf(_0x1f53f9,function(_0x5bc387){if(_0x5bc387)_0x2c3df5(_0x5bc387);return _0x597dc5();});});})[_0xb061('0x19')](function(){return _0xe918a1[_0xb061('0x51')](_0x20d5d4,_0x247739,function(_0x4f8601){if(_0x4f8601){console[_0xb061('0x73')](_0xb061('0x74'),_0x4f8601);}else{fs[_0xb061('0x75')](_0x20d5d4);}});});});}else{return _0xe918a1['sendStatus'](0xc8);}})[_0xb061('0x34')](handleError(_0xe918a1,null));}; \ No newline at end of file +var _0x7ce9=['secret','read','get','mkdirSync','Sms','Account','Owner','N.A.','closed','closedAt','disposition','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','rimraf','zip-dir','moment','bluebird','path','ejs','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','stack','name','send','map','SmsInteraction','rawAttributes','type','findAll','sms','query','user','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','catch','destroy','describe','SmsMessage','addMessage','ids','findOne','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','omit','spread','removeTags','unix','toString','join','root','server','files','tmp','User','fullname','Contact','Messages','createdAt','direction'];(function(_0x1ad1f5,_0x289284){var _0x4cf142=function(_0x237fef){while(--_0x237fef){_0x1ad1f5['push'](_0x1ad1f5['shift']());}};_0x4cf142(++_0x289284);}(_0x7ce9,0x88));var _0x97ce=function(_0x4291dd,_0x95d82){_0x4291dd=_0x4291dd-0x0;var _0x152462=_0x7ce9[_0x4291dd];return _0x152462;};'use strict';var rimraf=require(_0x97ce('0x0'));var zipdir=require(_0x97ce('0x1'));var moment=require(_0x97ce('0x2'));var BPromise=require(_0x97ce('0x3'));var util=require('util');var path=require(_0x97ce('0x4'));var ejs=require(_0x97ce('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x97ce('0x6'));var interaction=require(_0x97ce('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x97ce('0x8'))(_0x97ce('0x9'));var config=require(_0x97ce('0xa'));var db=require(_0x97ce('0xb'))['db'];config[_0x97ce('0xc')]=_[_0x97ce('0xd')](config[_0x97ce('0xc')],{'host':_0x97ce('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4ee635,_0xeee737){_0xeee737=_0xeee737||0xcc;return function(_0x61961b){if(_0x61961b){return _0x4ee635[_0x97ce('0xf')](_0xeee737);}return _0x4ee635[_0x97ce('0x10')](_0xeee737)['end']();};}function respondWithResult(_0x261d88,_0x29fe1f){_0x29fe1f=_0x29fe1f||0xc8;return function(_0x431758){if(_0x431758){return _0x261d88[_0x97ce('0x10')](_0x29fe1f)[_0x97ce('0x11')](_0x431758);}};}function respondWithFilteredResult(_0x305e67,_0x3a4ed9){return function(_0x2090cc){if(_0x2090cc){var _0x3d89ea=typeof _0x3a4ed9[_0x97ce('0x12')]===_0x97ce('0x13')&&typeof _0x3a4ed9[_0x97ce('0x14')]===_0x97ce('0x13');var _0xb9e7f4=_0x2090cc[_0x97ce('0x15')];var _0x17fb01=_0x3d89ea?0x0:_0x3a4ed9['offset'];var _0x9840ac=_0x3d89ea?_0x2090cc[_0x97ce('0x15')]:_0x3a4ed9[_0x97ce('0x12')]+_0x3a4ed9[_0x97ce('0x14')];var _0x59a395;if(_0x9840ac>=_0xb9e7f4){_0x9840ac=_0xb9e7f4;_0x59a395=0xc8;}else{_0x59a395=0xce;}_0x305e67[_0x97ce('0x10')](_0x59a395);return _0x305e67[_0x97ce('0x16')](_0x97ce('0x17'),_0x17fb01+'-'+_0x9840ac+'/'+_0xb9e7f4)[_0x97ce('0x11')](_0x2090cc);}return null;};}function saveUpdates(_0x46d8e9){return function(_0x2b6c59){if(_0x2b6c59){return _0x2b6c59[_0x97ce('0x18')](_0x46d8e9)[_0x97ce('0x19')](function(_0x47f374){return _0x47f374;});}return null;};}function removeEntity(_0x45a39f){return function(_0x12d2e5){if(_0x12d2e5){return _0x12d2e5['destroy']()[_0x97ce('0x19')](function(){_0x45a39f[_0x97ce('0x10')](0xcc)[_0x97ce('0x1a')]();});}};}function handleEntityNotFound(_0x39b783){return function(_0x1611df){if(!_0x1611df){_0x39b783['sendStatus'](0x194);}return _0x1611df;};}function handleError(_0x521cb9,_0x55b9d9){_0x55b9d9=_0x55b9d9||0x1f4;return function(_0x180ff1){logger['error'](_0x180ff1[_0x97ce('0x1b')]);if(_0x180ff1[_0x97ce('0x1c')]){delete _0x180ff1['name'];}_0x521cb9[_0x97ce('0x10')](_0x55b9d9)[_0x97ce('0x1d')](_0x180ff1);};}exports['index']=function(_0x30ca5f,_0x3d9a48){var _0x14dbf2={};var _0x3cc82e=_[_0x97ce('0x1e')](db[_0x97ce('0x1f')][_0x97ce('0x20')],function(_0xc4928b){return{'name':_0xc4928b['fieldName'],'type':_0xc4928b[_0x97ce('0x21')]['key']};});_0x14dbf2=qs['getOptions'](_0x3cc82e,_0x30ca5f);return interaction[_0x97ce('0x22')](_0x97ce('0x23'),_0x30ca5f[_0x97ce('0x24')],_0x30ca5f[_0x97ce('0x25')],_0x14dbf2,_0x3cc82e)[_0x97ce('0x19')](respondWithFilteredResult(_0x3d9a48,_0x14dbf2))['catch'](handleError(_0x3d9a48,null));};exports[_0x97ce('0x26')]=function(_0x198e04,_0xf5f709){var _0x1c7d36={'raw':![],'where':{'id':_0x198e04[_0x97ce('0x27')]['id']}},_0x3525df={};_0x3525df['model']=_[_0x97ce('0x28')](db[_0x97ce('0x1f')][_0x97ce('0x20')]);_0x3525df['query']=_[_0x97ce('0x28')](_0x198e04[_0x97ce('0x24')]);_0x3525df[_0x97ce('0x29')]=_[_0x97ce('0x2a')](_0x3525df[_0x97ce('0x2b')],_0x3525df['query']);_0x1c7d36[_0x97ce('0x2c')]=_[_0x97ce('0x2a')](_0x3525df['model'],qs['fields'](_0x198e04[_0x97ce('0x24')][_0x97ce('0x2d')]));_0x1c7d36[_0x97ce('0x2c')]=_0x1c7d36[_0x97ce('0x2c')][_0x97ce('0x2e')]?_0x1c7d36[_0x97ce('0x2c')]:_0x3525df['model'];if(_0x198e04[_0x97ce('0x24')][_0x97ce('0x2f')]){_0x1c7d36['include']=[{'all':!![]}];}_0x1c7d36=_[_0x97ce('0x30')]({},_0x1c7d36,_0x198e04[_0x97ce('0x31')]);return db['SmsInteraction'][_0x97ce('0x32')](_0x1c7d36)[_0x97ce('0x19')](handleEntityNotFound(_0xf5f709,null))['then'](respondWithResult(_0xf5f709,null))['catch'](handleError(_0xf5f709,null));};exports['create']=function(_0x18ffc2,_0xc514bc){return db[_0x97ce('0x1f')][_0x97ce('0x33')](_0x18ffc2[_0x97ce('0x34')],{})[_0x97ce('0x19')](respondWithResult(_0xc514bc,0xc9))[_0x97ce('0x35')](handleError(_0xc514bc,null));};exports[_0x97ce('0x18')]=function(_0x3e8796,_0x28957e){if(_0x3e8796[_0x97ce('0x34')]['id']){delete _0x3e8796['body']['id'];}return db[_0x97ce('0x1f')][_0x97ce('0x32')]({'where':{'id':_0x3e8796[_0x97ce('0x27')]['id']}})[_0x97ce('0x19')](handleEntityNotFound(_0x28957e,null))[_0x97ce('0x19')](saveUpdates(_0x3e8796[_0x97ce('0x34')],null))[_0x97ce('0x19')](respondWithResult(_0x28957e,null))['catch'](handleError(_0x28957e,null));};exports[_0x97ce('0x36')]=function(_0x551615,_0x2e7a6){return db['SmsInteraction'][_0x97ce('0x32')]({'where':{'id':_0x551615[_0x97ce('0x27')]['id']}})[_0x97ce('0x19')](handleEntityNotFound(_0x2e7a6,null))[_0x97ce('0x19')](removeEntity(_0x2e7a6,null))[_0x97ce('0x35')](handleError(_0x2e7a6,null));};exports[_0x97ce('0x37')]=function(_0xc2b670,_0x51febd){return db[_0x97ce('0x1f')]['describe']()['then'](respondWithResult(_0x51febd,null))[_0x97ce('0x35')](handleError(_0x51febd,null));};exports['addMessage']=function(_0x50be89,_0x4b9b8b){return db[_0x97ce('0x38')]['find']({'where':{'id':_0x50be89[_0x97ce('0x27')]['id']}})[_0x97ce('0x19')](handleEntityNotFound(_0x4b9b8b,null))['then'](function(_0x111943){if(_0x111943){return _0x111943[_0x97ce('0x39')](_0x50be89[_0x97ce('0x34')][_0x97ce('0x3a')],_['omit'](_0x50be89[_0x97ce('0x34')],['ids','id'])||{});}})['then'](respondWithResult(_0x4b9b8b,null))['catch'](handleError(_0x4b9b8b,null));};exports['getMessages']=function(_0x1a9e4c,_0x3c0274){var _0x227767={'raw':![],'where':{}};var _0x33c231={};var _0x5d941c={'count':0x0,'rows':[]};return db[_0x97ce('0x1f')][_0x97ce('0x3b')]({'where':{'id':_0x1a9e4c[_0x97ce('0x27')]['id']}})[_0x97ce('0x19')](handleEntityNotFound(_0x3c0274,null))[_0x97ce('0x19')](function(_0x479d17){if(_0x479d17){_0x33c231[_0x97ce('0x2b')]=_[_0x97ce('0x28')](db[_0x97ce('0x38')][_0x97ce('0x20')]);_0x33c231[_0x97ce('0x24')]=_[_0x97ce('0x28')](_0x1a9e4c[_0x97ce('0x24')]);_0x33c231[_0x97ce('0x29')]=_[_0x97ce('0x2a')](_0x33c231[_0x97ce('0x2b')],_0x33c231[_0x97ce('0x24')]);_0x227767[_0x97ce('0x2c')]=_['intersection'](_0x33c231[_0x97ce('0x2b')],qs[_0x97ce('0x2d')](_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x2d')]));_0x227767[_0x97ce('0x2c')]=_0x227767[_0x97ce('0x2c')][_0x97ce('0x2e')]?_0x227767[_0x97ce('0x2c')]:_0x33c231[_0x97ce('0x2b')];if(!_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x3c')]('nolimit')){_0x227767[_0x97ce('0x14')]=qs[_0x97ce('0x14')](_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x14')]);_0x227767[_0x97ce('0x12')]=qs[_0x97ce('0x12')](_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x12')]);}_0x227767[_0x97ce('0x3d')]=qs[_0x97ce('0x3e')](_0x1a9e4c['query'][_0x97ce('0x3e')]);_0x227767[_0x97ce('0x3f')]=qs['filters'](_[_0x97ce('0x40')](_0x1a9e4c[_0x97ce('0x24')],_0x33c231['filters']));_0x227767[_0x97ce('0x3f')][_0x97ce('0x41')]=_0x479d17['id'];if(_0x1a9e4c[_0x97ce('0x24')]['filter']){_0x227767[_0x97ce('0x3f')]=_['merge'](_0x227767[_0x97ce('0x3f')],{'$or':_[_0x97ce('0x1e')](_0x227767['attributes'],function(_0x5c98cc){var _0x36f052={};_0x36f052[_0x5c98cc]={'$like':'%'+_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x42')]+'%'};return _0x36f052;})});}if(_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x43')]){var _0x49da09=_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x43')][_0x97ce('0x44')](',');var _0x487b9d={};_0x487b9d[_0x49da09[0x0]]={'$gte':moment(_0x49da09[0x1])[_0x97ce('0x45')](_0x97ce('0x46'))};_0x227767[_0x97ce('0x3f')]=_[_0x97ce('0x30')](_0x227767[_0x97ce('0x3f')],_0x487b9d);}_0x227767=_['merge']({},_0x227767,_0x1a9e4c[_0x97ce('0x31')]);return db['SmsMessage'][_0x97ce('0x15')]({'where':_0x227767['where']})[_0x97ce('0x19')](function(_0xa96734){_0x5d941c['count']=_0xa96734;if(_0x1a9e4c[_0x97ce('0x24')][_0x97ce('0x2f')]){_0x227767['include']=[{'all':!![]}];}return db['SmsMessage'][_0x97ce('0x22')](_0x227767);})[_0x97ce('0x19')](function(_0x187f9a){_0x5d941c[_0x97ce('0x47')]=_0x187f9a;return _0x5d941c;});}})[_0x97ce('0x19')](respondWithFilteredResult(_0x3c0274,_0x227767))['catch'](handleError(_0x3c0274,null));};exports['addTags']=function(_0x5145f7,_0x83eebc){return db[_0x97ce('0x1f')][_0x97ce('0x32')]({'where':{'id':_0x5145f7[_0x97ce('0x27')]['id']}})[_0x97ce('0x19')](handleEntityNotFound(_0x83eebc,null))[_0x97ce('0x19')](function(_0x2cf13d){if(_0x2cf13d){return _0x2cf13d['setTags'](_0x5145f7[_0x97ce('0x34')][_0x97ce('0x3a')],_[_0x97ce('0x48')](_0x5145f7[_0x97ce('0x34')],['ids','id'])||{})[_0x97ce('0x49')](function(){return db['Tag'][_0x97ce('0x22')]({'attributes':['id',_0x97ce('0x1c'),'color'],'where':{'id':_0x5145f7[_0x97ce('0x34')]['ids']}});})[_0x97ce('0x19')](function(_0x540694){socket['emit']('smsInteractionTags:save',{'id':Number(_0x5145f7['params']['id']),'tags':_0x540694||[]});return{'id':Number(_0x5145f7['params']['id']),'tags':_0x540694||[]};});}})[_0x97ce('0x19')](respondWithResult(_0x83eebc,null))[_0x97ce('0x35')](handleError(_0x83eebc,null));};exports[_0x97ce('0x4a')]=function(_0x556b7e,_0x5260da){return db[_0x97ce('0x1f')][_0x97ce('0x32')]({'where':{'id':_0x556b7e[_0x97ce('0x27')]['id']}})['then'](handleEntityNotFound(_0x5260da,null))[_0x97ce('0x19')](function(_0x4078fe){if(_0x4078fe){return _0x4078fe[_0x97ce('0x4a')](_0x556b7e[_0x97ce('0x24')]['ids']);}})['then'](respondWithStatusCode(_0x5260da,null))['catch'](handleError(_0x5260da,null));};exports['download']=function(_0x306f24,_0xe71db2){var _0x331078=moment()[_0x97ce('0x4b')]()[_0x97ce('0x4c')]();var _0x171dca=path[_0x97ce('0x4d')](config[_0x97ce('0x4e')],_0x97ce('0x4f'),_0x97ce('0x50'),_0x97ce('0x51'));var _0x157f92=path[_0x97ce('0x4d')](_0x171dca,_0x331078);var _0xcc43b7=util[_0x97ce('0x45')]('transcript-%d-%s.zip',_0x306f24[_0x97ce('0x27')]['id'],_0x331078);var _0x1380a5=path['join'](_0x171dca,_0xcc43b7);var _0x9da260=[];_0x9da260['push']({'model':db[_0x97ce('0x52')],'as':'User','attributes':['id',_0x97ce('0x53')],'raw':!![]});_0x9da260['push']({'model':db['CmContact'],'as':_0x97ce('0x54'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x4efcdd=[{'model':db[_0x97ce('0x38')],'as':_0x97ce('0x55'),'attributes':['id',_0x97ce('0x34'),_0x97ce('0x56'),_0x97ce('0x57'),_0x97ce('0x58'),_0x97ce('0x59')],'include':_0x9da260}];_0x4efcdd['push']({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x97ce('0x1c')]});_0x4efcdd['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x97ce('0x53')]});return db['SmsInteraction'][_0x97ce('0x32')]({'where':{'id':_0x306f24[_0x97ce('0x27')]['id']},'include':_0x4efcdd})['then'](handleEntityNotFound(_0xe71db2,null))['then'](function(_0x3a2a12){if(_0x3a2a12){var _0x526073=_0x3a2a12[_0x97ce('0x5a')]({'plain':!![]});fs[_0x97ce('0x5b')](_0x157f92);var _0x1278a1={'channel':_0x97ce('0x5c'),'account':_0x526073[_0x97ce('0x5d')][_0x97ce('0x1c')],'agent':_0x526073[_0x97ce('0x5e')]?_0x526073[_0x97ce('0x5e')][_0x97ce('0x53')]:_0x97ce('0x5f'),'createdAt':moment(_0x526073['createdAt'])[_0x97ce('0x45')](_0x97ce('0x46'))[_0x97ce('0x4c')](),'closedAt':_0x526073[_0x97ce('0x60')]?moment(_0x526073[_0x97ce('0x61')])[_0x97ce('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0x97ce('0x4c')]():'','disposition':_0x526073[_0x97ce('0x62')],'messages':_(_0x526073['Messages'])['filter']({'secret':![]})[_0x97ce('0x1e')](function(_0x2216b7){return{'date':moment(_0x2216b7[_0x97ce('0x56')])[_0x97ce('0x45')](_0x97ce('0x46'))[_0x97ce('0x4c')](),'sender':_0x2216b7['direction']===_0x97ce('0x63')?_0x2216b7[_0x97ce('0x52')]?_0x2216b7[_0x97ce('0x52')]['fullname']:_0x97ce('0x64'):_0x2216b7[_0x97ce('0x54')]['firstName']+(_0x2216b7[_0x97ce('0x54')][_0x97ce('0x65')]?'\x20'+_0x2216b7['Contact'][_0x97ce('0x65')]:''),'body':_0x2216b7['body'],'direction':_0x2216b7[_0x97ce('0x57')]===_0x97ce('0x63')?'A':'C','secret':_0x2216b7['secret'],'read':_0x2216b7[_0x97ce('0x59')]};})[_0x97ce('0x66')]()};return ejs[_0x97ce('0x67')](path[_0x97ce('0x4d')](config[_0x97ce('0x4e')],'server',_0x97ce('0x68'),_0x97ce('0x69')),{'interaction':_0x1278a1})[_0x97ce('0x19')](function(_0x376ae1){var _0x188379=path[_0x97ce('0x4d')](_0x157f92,_0x97ce('0x6a')+_0x526073['id']+'-'+_0x331078+_0x97ce('0x6b'));var _0x93ec9c={'path':_0x188379,'channel':_0x97ce('0x5c'),'interactionId':_0x526073['id']};return pdf[_0x97ce('0x6c')](_0x376ae1,_0x93ec9c);})[_0x97ce('0x19')](function(){return new BPromise(function(_0x10390b,_0x5024af){zipdir(_0x157f92,{'saveTo':_0x1380a5},function(_0x2f40ec,_0x248e3d){if(_0x2f40ec)return _0x5024af(_0x2f40ec);return _0x10390b(_0x248e3d);});})['then'](function(){return new BPromise(function(_0x3d20d3,_0x1448a0){rimraf(_0x157f92,function(_0x4e1501){if(_0x4e1501)_0x1448a0(_0x4e1501);return _0x3d20d3();});});})[_0x97ce('0x19')](function(){return _0xe71db2[_0x97ce('0x6d')](_0x1380a5,_0xcc43b7,function(_0x24d730){if(_0x24d730){console[_0x97ce('0x6e')](_0x97ce('0x6f'),_0x24d730);}else{fs['unlinkSync'](_0x1380a5);}});});});}else{return _0xe71db2[_0x97ce('0xf')](0xc8);}})[_0x97ce('0x35')](handleError(_0xe71db2,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index a20c5d8..c81cd69 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 _0x7916=['Users','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers'];(function(_0x5dfb29,_0x2a82de){var _0x331677=function(_0x5d7ac4){while(--_0x5d7ac4){_0x5dfb29['push'](_0x5dfb29['shift']());}};_0x331677(++_0x2a82de);}(_0x7916,0x128));var _0x6791=function(_0x153738,_0xe704c1){_0x153738=_0x153738-0x0;var _0x3028d9=_0x7916[_0x153738];return _0x3028d9;};'use strict';var EventEmitter=require(_0x6791('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x6791('0x1')];var SmsMessage=require(_0x6791('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6791('0x3')](0x0);var events={'afterCreate':_0x6791('0x4'),'afterUpdate':_0x6791('0x5'),'afterDestroy':_0x6791('0x6')};function emitEvent(_0x5e6303){return function(_0xe98396,_0x5a5726,_0x3ca328){_0xe98396[_0x6791('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8b85ff){_0xe98396['setDataValue'](_0x6791('0x8'),_0x8b85ff['map'](function(_0x4ef65f){return{'id':_0x4ef65f['id']};}));return SmsMessage[_0x6791('0x9')]({'where':{'SmsInteractionId':_0xe98396['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6791('0xa')](function(_0x579950){_0xe98396[_0x6791('0xb')](_0x6791('0xc'),_0x579950[_0x6791('0xd')]);SmsInteractionEvents['emit'](_0x5e6303+':'+_0xe98396['id'],_0xe98396);SmsInteractionEvents[_0x6791('0xe')](_0x5e6303,_0xe98396);_0x3ca328(null);})[_0x6791('0xf')](_0x3ca328(null));};}for(var e in events){if(events[_0x6791('0x10')](e)){var event=events[e];SmsInteraction[_0x6791('0x11')](e,emitEvent(event));}}module[_0x6791('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x0120=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','then','unreadMessages','emit','catch'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x0120,0x6f));var _0x0012=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x0120[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0x0012('0x0'));var SmsInteraction=require(_0x0012('0x1'))['db'][_0x0012('0x2')];var SmsMessage=require(_0x0012('0x1'))['db'][_0x0012('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0012('0x4')](0x0);var events={'afterCreate':_0x0012('0x5'),'afterUpdate':_0x0012('0x6'),'afterDestroy':_0x0012('0x7')};function emitEvent(_0x302029){return function(_0x3505ab,_0x3fcfbc,_0x4eaa5b){_0x3505ab['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x95d441){_0x3505ab[_0x0012('0x8')](_0x0012('0x9'),_0x95d441[_0x0012('0xa')](function(_0x33c82f){return{'id':_0x33c82f['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3505ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0012('0xb')](function(_0x2d484c){_0x3505ab[_0x0012('0x8')](_0x0012('0xc'),_0x2d484c['length']);SmsInteractionEvents[_0x0012('0xd')](_0x302029+':'+_0x3505ab['id'],_0x3505ab);SmsInteractionEvents['emit'](_0x302029,_0x3505ab);_0x4eaa5b(null);})[_0x0012('0xe')](_0x4eaa5b(null));};}for(var e in events){if(events[_0x0012('0xf')](e)){var event=events[e];SmsInteraction[_0x0012('0x10')](e,emitEvent(event));}}module[_0x0012('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4207cf6..3ac4bbe 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 _0xdc0e=['exports','define','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xdc0e,0xf7));var _0xedc0=function(_0x34fe22,_0x4b0faa){_0x34fe22=_0x34fe22-0x0;var _0x126030=_0xdc0e[_0x34fe22];return _0x126030;};'use strict';var _=require(_0xedc0('0x0'));var util=require(_0xedc0('0x1'));var logger=require(_0xedc0('0x2'))('api');var moment=require(_0xedc0('0x3'));var BPromise=require(_0xedc0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedc0('0x5'));var rimraf=require(_0xedc0('0x6'));var config=require(_0xedc0('0x7'));var attributes=require(_0xedc0('0x8'));module[_0xedc0('0x9')]=function(_0x45a61a,_0x5f868f){return _0x45a61a[_0xedc0('0xa')](_0xedc0('0xb'),attributes,{'tableName':_0xedc0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46cef2,_0x50dbf6,_0x47ba00){if(_0x46cef2[_0xedc0('0xd')]('closed')){_0x46cef2['closedAt']=moment()[_0xedc0('0xe')](_0xedc0('0xf'));}_0x47ba00(null,_0x46cef2);}}});}; \ No newline at end of file +var _0x023d=['define','SmsInteraction','sms_interactions','closed','closedAt','format','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x4815cc,_0x3560c2){var _0x581d84=function(_0xb62a49){while(--_0xb62a49){_0x4815cc['push'](_0x4815cc['shift']());}};_0x581d84(++_0x3560c2);}(_0x023d,0x19b));var _0xd023=function(_0x456879,_0x241d35){_0x456879=_0x456879-0x0;var _0xcd7fa0=_0x023d[_0x456879];return _0xcd7fa0;};'use strict';var _=require(_0xd023('0x0'));var util=require('util');var logger=require(_0xd023('0x1'))(_0xd023('0x2'));var moment=require(_0xd023('0x3'));var BPromise=require(_0xd023('0x4'));var rp=require(_0xd023('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd023('0x6'));var config=require(_0xd023('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xd023('0x8')]=function(_0x3a6733,_0x403172){return _0x3a6733[_0xd023('0x9')](_0xd023('0xa'),attributes,{'tableName':_0xd023('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d8911,_0x1f3feb,_0x11c60a){if(_0x4d8911['changed'](_0xd023('0xc'))){_0x4d8911[_0xd023('0xd')]=moment()[_0xd023('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x11c60a(null,_0x4d8911);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 729c6dc..6f70bdf 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 _0x6332=['message','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','attributes','AddTagsToSmsInteraction','find','where','addTags','ids','omit','spread','AddTags','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6332,0x1b3));var _0x2633=function(_0x493982,_0x35dacb){_0x493982=_0x493982-0x0;var _0x567a6d=_0x6332[_0x493982];return _0x567a6d;};'use strict';var _=require(_0x2633('0x0'));var util=require('util');var moment=require(_0x2633('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2633('0x2'));var db=require(_0x2633('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2633('0x4'))('rpc');var config=require(_0x2633('0x5'));var jayson=require(_0x2633('0x6'));var client=jayson[_0x2633('0x7')]['http']({'port':0x232a});config[_0x2633('0x8')]=_[_0x2633('0x9')](config[_0x2633('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2633('0xa'))['register'](socket);function respondWithRpcPromise(_0x263254,_0xe9e62d,_0x582b17){return new BPromise(function(_0x58c0d5,_0x1efc0f){return client[_0x2633('0xb')](_0x263254,_0x582b17)[_0x2633('0xc')](function(_0x40ff1e){logger[_0x2633('0xd')](_0x2633('0xe'),_0xe9e62d,_0x2633('0xf'));logger[_0x2633('0x10')](_0x2633('0x11'),_0xe9e62d,'request\x20sent',JSON[_0x2633('0x12')](_0x40ff1e));if(_0x40ff1e[_0x2633('0x13')]){if(_0x40ff1e[_0x2633('0x13')][_0x2633('0x14')]===0x1f4){logger['error'](_0x2633('0xe'),_0xe9e62d,_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);return _0x1efc0f(_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);}logger['error'](_0x2633('0xe'),_0xe9e62d,_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);return _0x58c0d5(_0x40ff1e[_0x2633('0x13')][_0x2633('0x15')]);}else{logger['info'](_0x2633('0xe'),_0xe9e62d,'request\x20sent');_0x58c0d5(_0x40ff1e[_0x2633('0x16')][_0x2633('0x15')]);}})['catch'](function(_0x90d895){logger[_0x2633('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xe9e62d,_0x90d895);_0x1efc0f(_0x90d895);});});}exports[_0x2633('0x17')]=function(_0xb632d3){var _0x1100a7=this;return new Promise(function(_0xd7552d,_0x191ea1){return db[_0x2633('0x18')]['update'](_0xb632d3[_0x2633('0x19')],{'raw':_0xb632d3[_0x2633('0x1a')]?_0xb632d3[_0x2633('0x1a')][_0x2633('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb632d3[_0x2633('0x1a')]?_0xb632d3['options']['where']||null:null,'attributes':_0xb632d3['options']?_0xb632d3[_0x2633('0x1a')][_0x2633('0x1c')]||null:null,'limit':_0xb632d3[_0x2633('0x1a')]?_0xb632d3['options']['limit']||null:null})[_0x2633('0xc')](function(_0x276f7a){logger['info']('UpdateSmsInteraction',_0xb632d3);logger['debug'](_0x2633('0x17'),_0xb632d3,JSON['stringify'](_0x276f7a));_0xd7552d(_0x276f7a);})['catch'](function(_0x86d1dd){logger['error']('UpdateSmsInteraction',_0x86d1dd[_0x2633('0x15')],_0xb632d3);_0x191ea1(_0x1100a7[_0x2633('0x13')](0x1f4,_0x86d1dd[_0x2633('0x15')]));});});};exports[_0x2633('0x1d')]=function(_0x27b8de){return new Promise(function(_0x44ec56,_0x18151f){return db[_0x2633('0x18')][_0x2633('0x1e')]({'where':_0x27b8de[_0x2633('0x1a')]?_0x27b8de[_0x2633('0x1a')][_0x2633('0x1f')]||null:null})['then'](function(_0x24aa36){if(_0x24aa36){return _0x24aa36[_0x2633('0x20')](_0x27b8de[_0x2633('0x19')][_0x2633('0x21')],_[_0x2633('0x22')](_0x27b8de['body'],['ids','id'])||{});}})[_0x2633('0x23')](function(_0x3bcb0c){logger['info']('AddTags',_0x27b8de);logger[_0x2633('0x10')](_0x2633('0x24'),_0x27b8de,JSON[_0x2633('0x12')](_0x3bcb0c));_0x44ec56(_0x3bcb0c);})[_0x2633('0x25')](function(_0x4504c5){logger[_0x2633('0x13')](_0x2633('0x24'),_0x4504c5['message'],_0x27b8de);_0x18151f(_this['error'](0x1f4,_0x4504c5[_0x2633('0x15')]));});});}; \ No newline at end of file +var _0x81ce=['http','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x81ce,0xcc));var _0xe81c=function(_0x147092,_0x515f86){_0x147092=_0x147092-0x0;var _0x4c823a=_0x81ce[_0x147092];return _0x4c823a;};'use strict';var _=require(_0xe81c('0x0'));var util=require(_0xe81c('0x1'));var moment=require(_0xe81c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe81c('0x3'));var db=require(_0xe81c('0x4'))['db'];var utils=require(_0xe81c('0x5'));var logger=require(_0xe81c('0x6'))(_0xe81c('0x7'));var config=require(_0xe81c('0x8'));var jayson=require(_0xe81c('0x9'));var client=jayson[_0xe81c('0xa')][_0xe81c('0xb')]({'port':0x232a});config[_0xe81c('0xc')]=_['defaults'](config[_0xe81c('0xc')],{'host':_0xe81c('0xd'),'port':0x18eb});var socket=require(_0xe81c('0xe'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xe81c('0xf')](socket);function respondWithRpcPromise(_0x40e793,_0x22d936,_0x467655){return new BPromise(function(_0x269d38,_0x354e04){return client[_0xe81c('0x10')](_0x40e793,_0x467655)[_0xe81c('0x11')](function(_0x560624){logger[_0xe81c('0x12')](_0xe81c('0x13'),_0x22d936,'request\x20sent');logger[_0xe81c('0x14')](_0xe81c('0x15'),_0x22d936,_0xe81c('0x16'),JSON[_0xe81c('0x17')](_0x560624));if(_0x560624[_0xe81c('0x18')]){if(_0x560624[_0xe81c('0x18')][_0xe81c('0x19')]===0x1f4){logger[_0xe81c('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x22d936,_0x560624['error'][_0xe81c('0x1a')]);return _0x354e04(_0x560624[_0xe81c('0x18')][_0xe81c('0x1a')]);}logger[_0xe81c('0x18')](_0xe81c('0x13'),_0x22d936,_0x560624['error'][_0xe81c('0x1a')]);return _0x269d38(_0x560624['error'][_0xe81c('0x1a')]);}else{logger[_0xe81c('0x12')](_0xe81c('0x13'),_0x22d936,_0xe81c('0x16'));_0x269d38(_0x560624[_0xe81c('0x1b')]['message']);}})[_0xe81c('0x1c')](function(_0x525f98){logger[_0xe81c('0x18')](_0xe81c('0x13'),_0x22d936,_0x525f98);_0x354e04(_0x525f98);});});}exports[_0xe81c('0x1d')]=function(_0x33ad72){var _0x19b7cc=this;return new Promise(function(_0xc4242b,_0x3251c8){return db[_0xe81c('0x1e')]['update'](_0x33ad72[_0xe81c('0x1f')],{'raw':_0x33ad72[_0xe81c('0x20')]?_0x33ad72[_0xe81c('0x20')][_0xe81c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33ad72[_0xe81c('0x20')]?_0x33ad72[_0xe81c('0x20')][_0xe81c('0x22')]||null:null,'attributes':_0x33ad72['options']?_0x33ad72[_0xe81c('0x20')][_0xe81c('0x23')]||null:null,'limit':_0x33ad72[_0xe81c('0x20')]?_0x33ad72[_0xe81c('0x20')][_0xe81c('0x24')]||null:null})[_0xe81c('0x11')](function(_0x2f66ab){logger[_0xe81c('0x12')](_0xe81c('0x1d'),_0x33ad72);logger[_0xe81c('0x14')](_0xe81c('0x1d'),_0x33ad72,JSON[_0xe81c('0x17')](_0x2f66ab));_0xc4242b(_0x2f66ab);})[_0xe81c('0x1c')](function(_0x502a31){logger[_0xe81c('0x18')](_0xe81c('0x1d'),_0x502a31[_0xe81c('0x1a')],_0x33ad72);_0x3251c8(_0x19b7cc[_0xe81c('0x18')](0x1f4,_0x502a31[_0xe81c('0x1a')]));});});};exports[_0xe81c('0x25')]=function(_0x46a9bb){return new Promise(function(_0x54aa20,_0x422a5a){return db['SmsInteraction']['find']({'where':_0x46a9bb[_0xe81c('0x20')]?_0x46a9bb[_0xe81c('0x20')][_0xe81c('0x22')]||null:null})[_0xe81c('0x11')](function(_0x2fea83){if(_0x2fea83){return _0x2fea83[_0xe81c('0x26')](_0x46a9bb['body'][_0xe81c('0x27')],_[_0xe81c('0x28')](_0x46a9bb[_0xe81c('0x1f')],[_0xe81c('0x27'),'id'])||{});}})[_0xe81c('0x29')](function(_0x3708f9){logger[_0xe81c('0x12')](_0xe81c('0x2a'),_0x46a9bb);logger[_0xe81c('0x14')](_0xe81c('0x2a'),_0x46a9bb,JSON[_0xe81c('0x17')](_0x3708f9));_0x54aa20(_0x3708f9);})['catch'](function(_0x12f77c){logger['error'](_0xe81c('0x2a'),_0x12f77c['message'],_0x46a9bb);_0x422a5a(_this['error'](0x1f4,_0x12f77c[_0xe81c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ebe1b98..07baa64 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 _0x0646=['smsInteraction:','update','emit','removeListener','length'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x0646,0x119));var _0x6064=function(_0x2a0566,_0x136e55){_0x2a0566=_0x2a0566-0x0;var _0x45ec17=_0x0646[_0x2a0566];return _0x45ec17;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save','remove',_0x6064('0x0')];function createListener(_0x253926,_0x3643ec){return function(_0x46c0b5){_0x3643ec[_0x6064('0x1')](_0x253926,_0x46c0b5);};}function removeListener(_0x48ac56,_0x92fa7d){return function(){SmsInteractionEvents[_0x6064('0x2')](_0x48ac56,_0x92fa7d);};}exports['register']=function(_0x48e987){for(var _0x221ac5=0x0,_0x3e5724=events[_0x6064('0x3')];_0x221ac5<_0x3e5724;_0x221ac5++){var _0x4e3cb7=events[_0x221ac5];var _0x452cf1=createListener(_0x6064('0x4')+_0x4e3cb7,_0x48e987);SmsInteractionEvents['on'](_0x4e3cb7,_0x452cf1);}}; \ No newline at end of file +var _0xcc9d=['./smsInteraction.events','save','update','emit','length','smsInteraction:'];(function(_0x3eb0ac,_0x160fb3){var _0x29322c=function(_0x104b77){while(--_0x104b77){_0x3eb0ac['push'](_0x3eb0ac['shift']());}};_0x29322c(++_0x160fb3);}(_0xcc9d,0x12c));var _0xdcc9=function(_0x58910c,_0x26f60a){_0x58910c=_0x58910c-0x0;var _0x21508a=_0xcc9d[_0x58910c];return _0x21508a;};'use strict';var SmsInteractionEvents=require(_0xdcc9('0x0'));var events=[_0xdcc9('0x1'),'remove',_0xdcc9('0x2')];function createListener(_0x24f8ba,_0x5b4446){return function(_0x4a0a21){_0x5b4446[_0xdcc9('0x3')](_0x24f8ba,_0x4a0a21);};}function removeListener(_0x507970,_0x99d95e){return function(){SmsInteractionEvents['removeListener'](_0x507970,_0x99d95e);};}exports['register']=function(_0x222ac6){for(var _0x294304=0x0,_0x2177cd=events[_0xdcc9('0x4')];_0x294304<_0x2177cd;_0x294304++){var _0x3a03c6=events[_0x294304];var _0x55ab96=createListener(_0xdcc9('0x5')+_0x3a03c6,_0x222ac6);SmsInteractionEvents['on'](_0x3a03c6,_0x55ab96);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 5f9fdac..e64d1ea 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 _0x8d41=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','sms','smsmessage:create','status','put','update','accept','/:id/reject','delete'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8d41,0x12c));var _0x18d4=function(_0x45a91c,_0x56541f){_0x45a91c=_0x45a91c-0x0;var _0x587932=_0x8d41[_0x45a91c];return _0x587932;};'use strict';var multer=require(_0x18d4('0x0'));var util=require(_0x18d4('0x1'));var path=require(_0x18d4('0x2'));var timeout=require(_0x18d4('0x3'));var express=require(_0x18d4('0x4'));var router=express[_0x18d4('0x5')]();var fs_extra=require(_0x18d4('0x6'));var auth=require(_0x18d4('0x7'));var interaction=require(_0x18d4('0x8'));var config=require(_0x18d4('0x9'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x18d4('0xa')](),controller[_0x18d4('0xb')]);router[_0x18d4('0xc')](_0x18d4('0xd'),auth[_0x18d4('0xa')](),controller[_0x18d4('0xe')]);router[_0x18d4('0xc')](_0x18d4('0xf'),auth['isAuthenticated'](),controller[_0x18d4('0x10')]);router['post']('/',auth[_0x18d4('0xa')](),interaction['tracked'](_0x18d4('0x11'),_0x18d4('0x12')),controller['create']);router['post']('/:id/status',controller[_0x18d4('0x13')]);router[_0x18d4('0x14')](_0x18d4('0xf'),auth[_0x18d4('0xa')](),controller[_0x18d4('0x15')]);router[_0x18d4('0x14')]('/:id/accept',auth[_0x18d4('0xa')](),controller[_0x18d4('0x16')]);router['put'](_0x18d4('0x17'),auth['isAuthenticated'](),controller['reject']);router[_0x18d4('0x18')](_0x18d4('0xf'),auth[_0x18d4('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1071=['describe','/:id','show','post','sms','create','status','put','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1071,0xde));var _0x1107=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1071[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x1107('0x0'));var path=require(_0x1107('0x1'));var timeout=require(_0x1107('0x2'));var express=require(_0x1107('0x3'));var router=express['Router']();var fs_extra=require(_0x1107('0x4'));var auth=require(_0x1107('0x5'));var interaction=require(_0x1107('0x6'));var config=require(_0x1107('0x7'));var controller=require('./smsMessage.controller');router[_0x1107('0x8')]('/',auth[_0x1107('0x9')](),controller[_0x1107('0xa')]);router['get'](_0x1107('0xb'),auth['isAuthenticated'](),controller[_0x1107('0xc')]);router[_0x1107('0x8')](_0x1107('0xd'),auth[_0x1107('0x9')](),controller[_0x1107('0xe')]);router[_0x1107('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x1107('0x10'),'smsmessage:create'),controller[_0x1107('0x11')]);router['post']('/:id/status',controller[_0x1107('0x12')]);router[_0x1107('0x13')](_0x1107('0xd'),auth[_0x1107('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x1107('0x9')](),controller[_0x1107('0x14')]);router['put'](_0x1107('0x15'),auth[_0x1107('0x9')](),controller[_0x1107('0x16')]);router[_0x1107('0x17')](_0x1107('0xd'),auth[_0x1107('0x9')](),controller[_0x1107('0x18')]);module[_0x1107('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 905c728..a1533ac 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 _0x3531=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x3c2342,_0x14262a){var _0x4ea52c=function(_0x126bb0){while(--_0x126bb0){_0x3c2342['push'](_0x3c2342['shift']());}};_0x4ea52c(++_0x14262a);}(_0x3531,0x177));var _0x1353=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x3531[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0x1353('0x0'));module[_0x1353('0x1')]={'body':{'type':Sequelize[_0x1353('0x2')](_0x1353('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1353('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1353('0x5')]('in',_0x1353('0x6')),'defaultValue':_0x1353('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1353('0x7')](0xbe)},'phone':{'type':Sequelize[_0x1353('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1353('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1353('0x2')]}}; \ No newline at end of file +var _0xbcb8=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x46d7d4,_0x2c0daf){var _0x633137=function(_0xf591e1){while(--_0xf591e1){_0x46d7d4['push'](_0x46d7d4['shift']());}};_0x633137(++_0x2c0daf);}(_0xbcb8,0x1c9));var _0x8bcb=function(_0x46baca,_0x487e88){_0x46baca=_0x46baca-0x0;var _0xea978d=_0xbcb8[_0x46baca];return _0xea978d;};'use strict';var Sequelize=require(_0x8bcb('0x0'));module[_0x8bcb('0x1')]={'body':{'type':Sequelize[_0x8bcb('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8bcb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8bcb('0x4')]('in','out'),'defaultValue':_0x8bcb('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8bcb('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8bcb('0x6')]},'readAt':{'type':Sequelize[_0x8bcb('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8bcb('0x6')]},'providerResponse':{'type':Sequelize[_0x8bcb('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 92b1e11..06b7205 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 _0x1f3c=['include','findAll','rows','show','params','fields','create','body','find','describe','sms-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','contact','User','SIP/%s','SmsAccount','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','json','offset','limit','count','status','Content-Range','apply','save','update','destroy','name','send','index','map','SmsMessage','rawAttributes','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f3c,0xd7));var _0xc1f3=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x1f3c[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require(_0xc1f3('0x0'));var rimraf=require(_0xc1f3('0x1'));var zipdir=require(_0xc1f3('0x2'));var jsonpatch=require(_0xc1f3('0x3'));var rp=require(_0xc1f3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc1f3('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1f3('0x6'));var _=require(_0xc1f3('0x7'));var squel=require('squel');var crypto=require(_0xc1f3('0x8'));var jsforce=require(_0xc1f3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc1f3('0x5'));var querystring=require(_0xc1f3('0xa'));var Papa=require(_0xc1f3('0xb'));var Redis=require(_0xc1f3('0xc'));var authService=require(_0xc1f3('0xd'));var qs=require(_0xc1f3('0xe'));var as=require(_0xc1f3('0xf'));var hardwareService=require(_0xc1f3('0x10'));var logger=require(_0xc1f3('0x11'))(_0xc1f3('0x12'));var utils=require(_0xc1f3('0x13'));var config=require(_0xc1f3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1f3('0x15'))['db'];config['redis']=_[_0xc1f3('0x16')](config['redis'],{'host':_0xc1f3('0x17'),'port':0x18eb});var socket=require(_0xc1f3('0x18'))(new Redis(config[_0xc1f3('0x19')]));require(_0xc1f3('0x1a'))[_0xc1f3('0x1b')](socket);var jayson=require(_0xc1f3('0x1c'));var client=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232c});var client9002=jayson[_0xc1f3('0x1d')][_0xc1f3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3aee70,_0xd96b1a,_0x1d028c,_0x224405){return new BPromise(function(_0x1d0bbf,_0x18718f){var _0x292200=_0x224405||client;return _0x292200[_0xc1f3('0x1f')](_0x3aee70,_0x1d028c)[_0xc1f3('0x20')](function(_0x384e34){logger[_0xc1f3('0x21')](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xd96b1a,_0xc1f3('0x23'),JSON[_0xc1f3('0x26')](_0x384e34));if(_0x384e34[_0xc1f3('0x27')]){if(_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x28')]===0x1f4){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x18718f(_0x384e34[_0xc1f3('0x27')]['message']);}logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x384e34[_0xc1f3('0x27')][_0xc1f3('0x29')]);return _0x1d0bbf(_0x384e34['error']['message']);}else{logger['info'](_0xc1f3('0x22'),_0xd96b1a,_0xc1f3('0x23'));_0x1d0bbf(_0x384e34['result']['message']);}})[_0xc1f3('0x2a')](function(_0x32cc58){logger[_0xc1f3('0x27')](_0xc1f3('0x22'),_0xd96b1a,_0x32cc58);_0x18718f(_0x32cc58);});});}function respondWithStatusCode(_0x247273,_0xca9551){_0xca9551=_0xca9551||0xcc;return function(_0x4d8b22){if(_0x4d8b22){return _0x247273[_0xc1f3('0x2b')](_0xca9551);}return _0x247273['status'](_0xca9551)[_0xc1f3('0x2c')]();};}function respondWithResult(_0x5a308f,_0x3d6ffa){_0x3d6ffa=_0x3d6ffa||0xc8;return function(_0xe82fda){if(_0xe82fda){return _0x5a308f['status'](_0x3d6ffa)[_0xc1f3('0x2d')](_0xe82fda);}};}function respondWithFilteredResult(_0xa634b2,_0x48d8d9){return function(_0x5134e2){if(_0x5134e2){var _0xba1594=typeof _0x48d8d9[_0xc1f3('0x2e')]==='undefined'&&typeof _0x48d8d9[_0xc1f3('0x2f')]==='undefined';var _0x5c496b=_0x5134e2[_0xc1f3('0x30')];var _0x1f93eb=_0xba1594?0x0:_0x48d8d9['offset'];var _0x29e377=_0xba1594?_0x5134e2[_0xc1f3('0x30')]:_0x48d8d9[_0xc1f3('0x2e')]+_0x48d8d9[_0xc1f3('0x2f')];var _0x4511dc;if(_0x29e377>=_0x5c496b){_0x29e377=_0x5c496b;_0x4511dc=0xc8;}else{_0x4511dc=0xce;}_0xa634b2[_0xc1f3('0x31')](_0x4511dc);return _0xa634b2['set'](_0xc1f3('0x32'),_0x1f93eb+'-'+_0x29e377+'/'+_0x5c496b)[_0xc1f3('0x2d')](_0x5134e2);}return null;};}function patchUpdates(_0x3a682e){return function(_0x376188){try{jsonpatch[_0xc1f3('0x33')](_0x376188,_0x3a682e,!![]);}catch(_0x3d3651){return BPromise['reject'](_0x3d3651);}return _0x376188[_0xc1f3('0x34')]();};}function saveUpdates(_0x5ad983,_0x59cc66){return function(_0x39385f){if(_0x39385f){return _0x39385f[_0xc1f3('0x35')](_0x5ad983)[_0xc1f3('0x20')](function(_0x12f945){return _0x12f945;});}return null;};}function removeEntity(_0x5e058f,_0x76c393){return function(_0xbfc61b){if(_0xbfc61b){return _0xbfc61b[_0xc1f3('0x36')]()['then'](function(){_0x5e058f[_0xc1f3('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56eb94,_0x24c9ab){return function(_0x285b7e){if(!_0x285b7e){_0x56eb94[_0xc1f3('0x2b')](0x194);}return _0x285b7e;};}function handleError(_0x14f688,_0x5b8762){_0x5b8762=_0x5b8762||0x1f4;return function(_0x36494e){logger[_0xc1f3('0x27')](_0x36494e['stack']);if(_0x36494e['name']){delete _0x36494e[_0xc1f3('0x37')];}_0x14f688[_0xc1f3('0x31')](_0x5b8762)[_0xc1f3('0x38')](_0x36494e);};}exports[_0xc1f3('0x39')]=function(_0x17640c,_0x365654){var _0x255bc9={},_0x23c53b={},_0x4d71cc={'count':0x0,'rows':[]};var _0x30b90b=_[_0xc1f3('0x3a')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')],function(_0x28c2ab){return{'name':_0x28c2ab['fieldName'],'type':_0x28c2ab['type'][_0xc1f3('0x3d')]};});_0x23c53b[_0xc1f3('0x3e')]=_[_0xc1f3('0x3a')](_0x30b90b,_0xc1f3('0x37'));_0x23c53b[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x17640c[_0xc1f3('0x3f')]);_0x23c53b['filters']=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],_0x23c53b['query']);_0x255bc9[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0x23c53b[_0xc1f3('0x3e')],qs['fields'](_0x17640c[_0xc1f3('0x3f')]['fields']));_0x255bc9[_0xc1f3('0x42')]=_0x255bc9[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x255bc9[_0xc1f3('0x42')]:_0x23c53b[_0xc1f3('0x3e')];if(!_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x44')](_0xc1f3('0x45'))){_0x255bc9[_0xc1f3('0x2f')]=qs['limit'](_0x17640c['query'][_0xc1f3('0x2f')]);_0x255bc9[_0xc1f3('0x2e')]=qs[_0xc1f3('0x2e')](_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x2e')]);}_0x255bc9[_0xc1f3('0x46')]=qs[_0xc1f3('0x47')](_0x17640c['query'][_0xc1f3('0x47')]);_0x255bc9[_0xc1f3('0x48')]=qs[_0xc1f3('0x49')](_[_0xc1f3('0x4a')](_0x17640c['query'],_0x23c53b[_0xc1f3('0x49')]),_0x30b90b);if(_0x17640c[_0xc1f3('0x3f')]['filter']){_0x255bc9[_0xc1f3('0x48')]=_[_0xc1f3('0x4b')](_0x255bc9[_0xc1f3('0x48')],{'$or':_[_0xc1f3('0x3a')](_0x30b90b,function(_0x3a1b67){if(_0x3a1b67['type']!=='VIRTUAL'){var _0x1aa9c4={};_0x1aa9c4[_0x3a1b67['name']]={'$like':'%'+_0x17640c[_0xc1f3('0x3f')][_0xc1f3('0x4c')]+'%'};return _0x1aa9c4;}})});}_0x255bc9=_[_0xc1f3('0x4b')]({},_0x255bc9,_0x17640c[_0xc1f3('0x4d')]);var _0x5adf0d={'where':_0x255bc9[_0xc1f3('0x48')]};return db[_0xc1f3('0x3b')][_0xc1f3('0x30')](_0x5adf0d)[_0xc1f3('0x20')](function(_0x21bb48){_0x4d71cc[_0xc1f3('0x30')]=_0x21bb48;if(_0x17640c['query'][_0xc1f3('0x4e')]){_0x255bc9[_0xc1f3('0x4f')]=[{'all':!![]}];}return db['SmsMessage'][_0xc1f3('0x50')](_0x255bc9);})['then'](function(_0x556c2a){_0x4d71cc[_0xc1f3('0x51')]=_0x556c2a;return _0x4d71cc;})[_0xc1f3('0x20')](respondWithFilteredResult(_0x365654,_0x255bc9))[_0xc1f3('0x2a')](handleError(_0x365654,null));};exports[_0xc1f3('0x52')]=function(_0x226ac6,_0x4f3d36){var _0x3f3e56={'raw':!![],'where':{'id':_0x226ac6[_0xc1f3('0x53')]['id']}},_0xddadbc={};_0xddadbc[_0xc1f3('0x3e')]=_[_0xc1f3('0x40')](db[_0xc1f3('0x3b')][_0xc1f3('0x3c')]);_0xddadbc[_0xc1f3('0x3f')]=_[_0xc1f3('0x40')](_0x226ac6[_0xc1f3('0x3f')]);_0xddadbc['filters']=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],_0xddadbc['query']);_0x3f3e56[_0xc1f3('0x42')]=_[_0xc1f3('0x41')](_0xddadbc[_0xc1f3('0x3e')],qs[_0xc1f3('0x54')](_0x226ac6[_0xc1f3('0x3f')]['fields']));_0x3f3e56[_0xc1f3('0x42')]=_0x3f3e56[_0xc1f3('0x42')][_0xc1f3('0x43')]?_0x3f3e56[_0xc1f3('0x42')]:_0xddadbc['model'];if(_0x226ac6[_0xc1f3('0x3f')][_0xc1f3('0x4e')]){_0x3f3e56[_0xc1f3('0x4f')]=[{'all':!![]}];}_0x3f3e56=_[_0xc1f3('0x4b')]({},_0x3f3e56,_0x226ac6['options']);return db[_0xc1f3('0x3b')]['find'](_0x3f3e56)[_0xc1f3('0x20')](handleEntityNotFound(_0x4f3d36,null))[_0xc1f3('0x20')](respondWithResult(_0x4f3d36,null))[_0xc1f3('0x2a')](handleError(_0x4f3d36,null));};exports[_0xc1f3('0x55')]=function(_0x30a98a,_0x56b13e){return db[_0xc1f3('0x3b')][_0xc1f3('0x55')](_0x30a98a[_0xc1f3('0x56')],{})[_0xc1f3('0x20')](respondWithResult(_0x56b13e,0xc9))['catch'](handleError(_0x56b13e,null));};exports['update']=function(_0x5a892e,_0x351d91){if(_0x5a892e[_0xc1f3('0x56')]['id']){delete _0x5a892e[_0xc1f3('0x56')]['id'];}return db[_0xc1f3('0x3b')]['find']({'where':{'id':_0x5a892e[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x351d91,null))[_0xc1f3('0x20')](saveUpdates(_0x5a892e[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](respondWithResult(_0x351d91,null))[_0xc1f3('0x2a')](handleError(_0x351d91,null));};exports[_0xc1f3('0x36')]=function(_0x1c1f98,_0x26a404){return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x1c1f98[_0xc1f3('0x53')]['id']}})[_0xc1f3('0x20')](handleEntityNotFound(_0x26a404,null))[_0xc1f3('0x20')](removeEntity(_0x26a404,null))['catch'](handleError(_0x26a404,null));};exports[_0xc1f3('0x58')]=function(_0x5a180a,_0x51c871){return db['SmsMessage']['describe']()[_0xc1f3('0x20')](respondWithResult(_0x51c871,null))[_0xc1f3('0x2a')](handleError(_0x51c871,null));};var interaction_log=require(_0xc1f3('0x11'))(_0xc1f3('0x59'));exports[_0xc1f3('0x5a')]=function(_0x3d014c,_0x59e3b2,_0x3ed229){var _0x1fb566={'agent':{},'channel':'sms'};if(_0x3d014c['body']['id']){delete _0x3d014c[_0xc1f3('0x56')]['id'];}_0x3d014c[_0xc1f3('0x56')]['read']=!![];_0x3d014c['body']['readAt']=moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c'));_0x3d014c['body']['UserId']=_0x3d014c[_0xc1f3('0x56')]['UserId']||_0x3d014c['user']['id'];_0x1fb566[_0xc1f3('0x5d')]['id']=_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x3d014c[_0xc1f3('0x53')]['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))[_0xc1f3('0x20')](saveUpdates(_0x3d014c[_0xc1f3('0x56')],null))[_0xc1f3('0x20')](function(_0x4858d1){if(_0x4858d1){_0x1fb566[_0xc1f3('0x29')]=_0x4858d1['get']({'plain':!![]});return db['SmsInteraction'][_0xc1f3('0x57')]({'where':{'id':_0x4858d1[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x59e3b2,null))['then'](function(_0x8d1afc){if(_0x8d1afc){return _0x8d1afc['update']({'UserId':_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')],'read1stAt':_[_0xc1f3('0x60')](_0x8d1afc['read1stAt'])?moment()[_0xc1f3('0x5b')](_0xc1f3('0x5c')):undefined});}return null;})['then'](function(_0x1dcd45){if(_0x1dcd45){_0x1fb566[_0xc1f3('0x61')]=_0x1dcd45[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x63'),_0x3d014c[_0xc1f3('0x64')]['id'],_0x3d014c['user']['name'],_0x3d014c[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x1fb566[_0xc1f3('0x61')]['id'],_0x3d014c[_0xc1f3('0x56')]?JSON[_0xc1f3('0x26')](_0x3d014c[_0xc1f3('0x56')]):'null');return respondWithRpcPromise(_0xc1f3('0x66'),_0xc1f3('0x67'),_0x1fb566);}return null;})[_0xc1f3('0x20')](function(_0x1ea368){var _0x5a017e=_0xc1f3('0x68')+_0x1ea368['message'][_0xc1f3('0x69')];return db['sequelize']['query'](_0x5a017e,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x3741e9){return _0x3741e9;});})[_0xc1f3('0x20')](function(_0x28988e){if(_0x28988e){_0x1fb566[_0xc1f3('0x29')]['contact']=_0x28988e[0x0];if(!_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db['User'][_0xc1f3('0x57')]({'where':{'id':_0x3d014c['body'][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),_0xc1f3('0x6d'),_0xc1f3('0x6e'),_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x2a3c59){if(!_0x2a3c59)return null;_0x1fb566[_0xc1f3('0x29')]['agent']=_0x2a3c59;return _0x1fb566;})[_0xc1f3('0x20')](function(_0x2341d9){if(_0x2341d9){if(_0x3d014c[_0xc1f3('0x56')][_0xc1f3('0x70')]){_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x71')]=util['format']('SIP/%s',_0x3d014c['user'][_0xc1f3('0x37')]);_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566['message'][_0xc1f3('0x73')]=_0x1fb566[_0xc1f3('0x72')];_0x1fb566[_0xc1f3('0x29')][_0xc1f3('0x74')]=_0xc1f3('0x5a');return respondWithRpcPromise(_0xc1f3('0x75'),'EventManager',{'event':_0xc1f3('0x76'),'message':_0x1fb566[_0xc1f3('0x29')]},client9002)[_0xc1f3('0x20')](function(){return _0x1fb566;});}return _0x1fb566;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x59e3b2,null))[_0xc1f3('0x2a')](handleError(_0x59e3b2,null));};var interaction_log=require('../../config/logger')(_0xc1f3('0x59'));exports[_0xc1f3('0x77')]=function(_0x27c584,_0x4f7801,_0x5143e1){var _0x18fa9e={'agent':{},'channel':'sms'};if(_0x27c584[_0xc1f3('0x56')]['id']){delete _0x27c584[_0xc1f3('0x56')]['id'];}_0x27c584[_0xc1f3('0x56')]['UserId']=_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')]||_0x27c584[_0xc1f3('0x64')]['id'];_0x18fa9e[_0xc1f3('0x5d')]['id']=_0x27c584['body'][_0xc1f3('0x5e')];return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x27c584['params']['id'],'UserId':null}})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0x2ab773){if(_0x2ab773){_0x18fa9e[_0xc1f3('0x29')]=_0x2ab773[_0xc1f3('0x62')]({'plain':!![]});return db[_0xc1f3('0x78')][_0xc1f3('0x57')]({'where':{'id':_0x2ab773[_0xc1f3('0x5f')]}});}return null;})[_0xc1f3('0x20')](handleEntityNotFound(_0x4f7801,null))[_0xc1f3('0x20')](function(_0xabb11b){if(_0xabb11b){_0x18fa9e[_0xc1f3('0x61')]=_0xabb11b[_0xc1f3('0x62')]({'plain':!![]});interaction_log[_0xc1f3('0x21')](_0xc1f3('0x79'),_0x27c584[_0xc1f3('0x64')]['id'],_0x27c584[_0xc1f3('0x64')]['name'],_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x65')],_0x18fa9e[_0xc1f3('0x61')]['id'],_0x27c584[_0xc1f3('0x56')]?JSON['stringify'](_0x27c584[_0xc1f3('0x56')]):_0xc1f3('0x7a'));return respondWithRpcPromise(_0xc1f3('0x7b'),_0xc1f3('0x7c'),_0x18fa9e);}return null;})[_0xc1f3('0x20')](function(_0x12bcad){var _0x12d5f2=_0xc1f3('0x68')+_0x12bcad[_0xc1f3('0x29')][_0xc1f3('0x69')];return db[_0xc1f3('0x7d')][_0xc1f3('0x3f')](_0x12d5f2,{'type':db[_0xc1f3('0x6a')][_0xc1f3('0x6b')][_0xc1f3('0x6c')],'raw':!![]})[_0xc1f3('0x20')](function(_0x4de1ad){return _0x4de1ad;});})[_0xc1f3('0x20')](function(_0x47df10){if(_0x47df10){_0x18fa9e['message'][_0xc1f3('0x7e')]=_0x47df10[0x0];if(!_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')])return;return db[_0xc1f3('0x7f')][_0xc1f3('0x57')]({'where':{'id':_0x27c584[_0xc1f3('0x56')][_0xc1f3('0x5e')],'role':_0xc1f3('0x5d')},'attributes':['id',_0xc1f3('0x37'),'fullname','email',_0xc1f3('0x6f')],'raw':!![]});}return null;})[_0xc1f3('0x20')](function(_0x575168){if(!_0x575168)return null;_0x18fa9e[_0xc1f3('0x29')][_0xc1f3('0x5d')]=_0x575168;return _0x18fa9e;})[_0xc1f3('0x20')](function(_0x2ae53f){if(_0x2ae53f){_0x2ae53f[_0xc1f3('0x29')]['interface']=util[_0xc1f3('0x5b')](_0xc1f3('0x80'),_0x27c584[_0xc1f3('0x64')][_0xc1f3('0x37')]);_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x72')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f[_0xc1f3('0x29')][_0xc1f3('0x73')]=_0x18fa9e[_0xc1f3('0x72')];_0x2ae53f['message'][_0xc1f3('0x74')]='reject';respondWithRpcPromise(_0xc1f3('0x75'),_0xc1f3('0x75'),{'event':'rejectmessage','message':_0x2ae53f[_0xc1f3('0x29')]},client9002);return _0x18fa9e;}return null;})[_0xc1f3('0x20')](respondWithResult(_0x4f7801,null))['catch'](handleError(_0x4f7801,null));};exports['status']=function(_0x4776a7,_0xb21983,_0x1b2d6a){if(_0x4776a7[_0xc1f3('0x56')]['id']){delete _0x4776a7['body']['id'];}var _0x30f853;return db[_0xc1f3('0x3b')][_0xc1f3('0x57')]({'where':{'id':_0x4776a7[_0xc1f3('0x53')]['id']}})['then'](handleEntityNotFound(_0xb21983,null))['then'](function(_0xb52f9f){if(_0xb52f9f){_0x30f853=_0xb52f9f;return db[_0xc1f3('0x81')]['find']({'where':{'id':_0xb52f9f['SmsAccountId']}});}})[_0xc1f3('0x20')](handleEntityNotFound(_0xb21983,null))[_0xc1f3('0x20')](function(_0x2c8e93){if(_0x2c8e93){logger[_0xc1f3('0x24')](_0xc1f3('0x25'),_0xc1f3('0x31'),_0xc1f3('0x82'),_0x2c8e93[_0xc1f3('0x83')],util['inspect'](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));switch(_0x2c8e93[_0xc1f3('0x83')]){case _0xc1f3('0x84'):if(_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x85')]&&_0x4776a7[_0xc1f3('0x56')]['MessageSid']===_0x30f853[_0xc1f3('0x86')]){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),'status','twilio',util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x89'):if(_0x4776a7[_0xc1f3('0x56')]['MessageUUID']&&_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x8a')]===_0x30f853[_0xc1f3('0x86')]&&_[_0xc1f3('0x8b')]([_0xc1f3('0x8c'),_0xc1f3('0x8d')],_0x4776a7['body'][_0xc1f3('0x8e')])>=0x0){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x8f'),util[_0xc1f3('0x88')](_0x4776a7[_0xc1f3('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc1f3('0x90'):var _0x3c835c=_0x4776a7[_0xc1f3('0x56')][_0xc1f3('0x91')][0x0];if(_0x3c835c[_0xc1f3('0x31')]['groupName']===_0xc1f3('0x92')){return _0x30f853[_0xc1f3('0x35')]({'read':!![]});}else{logger[_0xc1f3('0x27')](_0xc1f3('0x87'),_0xc1f3('0x31'),_0xc1f3('0x90'),util['inspect'](_0x4776a7['body'],{'showHidden':![],'depth':null}));}break;}return _0x30f853;}})['then'](respondWithResult(_0xb21983,null))[_0xc1f3('0x2a')](handleError(_0xb21983,null));}; \ No newline at end of file +var _0xe9f2=['defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','rawAttributes','key','map','name','keys','query','model','attributes','fields','length','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','then','include','SmsMessage','findAll','show','params','intersection','includeAll','find','create','body','describe','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','Sequelize','SELECT','User','motionChannel','EventManager','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x8d985e,_0x5ac6c9){var _0x85ef94=function(_0xe0de1d){while(--_0xe0de1d){_0x8d985e['push'](_0x8d985e['shift']());}};_0x85ef94(++_0x5ac6c9);}(_0xe9f2,0x10f));var _0x2e9f=function(_0x59cc6b,_0x518f90){_0x59cc6b=_0x59cc6b-0x0;var _0x140b4e=_0xe9f2[_0x59cc6b];return _0x140b4e;};'use strict';var emlformat=require(_0x2e9f('0x0'));var rimraf=require(_0x2e9f('0x1'));var zipdir=require(_0x2e9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e9f('0x3'));var moment=require(_0x2e9f('0x4'));var BPromise=require(_0x2e9f('0x5'));var Mustache=require(_0x2e9f('0x6'));var util=require(_0x2e9f('0x7'));var path=require(_0x2e9f('0x8'));var sox=require(_0x2e9f('0x9'));var csv=require(_0x2e9f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e9f('0xb'));var squel=require('squel');var crypto=require(_0x2e9f('0xc'));var jsforce=require(_0x2e9f('0xd'));var deskjs=require(_0x2e9f('0xe'));var toCsv=require(_0x2e9f('0xa'));var querystring=require(_0x2e9f('0xf'));var Papa=require(_0x2e9f('0x10'));var Redis=require(_0x2e9f('0x11'));var authService=require(_0x2e9f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2e9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e9f('0x14'))(_0x2e9f('0x15'));var utils=require(_0x2e9f('0x16'));var config=require(_0x2e9f('0x17'));var licenseUtil=require(_0x2e9f('0x18'));var db=require(_0x2e9f('0x19'))['db'];config[_0x2e9f('0x1a')]=_[_0x2e9f('0x1b')](config[_0x2e9f('0x1a')],{'host':_0x2e9f('0x1c'),'port':0x18eb});var socket=require(_0x2e9f('0x1d'))(new Redis(config[_0x2e9f('0x1a')]));require(_0x2e9f('0x1e'))[_0x2e9f('0x1f')](socket);var jayson=require(_0x2e9f('0x20'));var client=jayson[_0x2e9f('0x21')][_0x2e9f('0x22')]({'port':0x232c});var client9002=jayson[_0x2e9f('0x21')][_0x2e9f('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x51dfbb,_0x1e5b31,_0x1aa159,_0x415b31){return new BPromise(function(_0x150aaa,_0x4421dc){var _0x3d48a7=_0x415b31||client;return _0x3d48a7[_0x2e9f('0x23')](_0x51dfbb,_0x1aa159)['then'](function(_0x48331a){logger[_0x2e9f('0x24')](_0x2e9f('0x25'),_0x1e5b31,'request\x20sent');logger[_0x2e9f('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1e5b31,_0x2e9f('0x27'),JSON[_0x2e9f('0x28')](_0x48331a));if(_0x48331a[_0x2e9f('0x29')]){if(_0x48331a[_0x2e9f('0x29')][_0x2e9f('0x2a')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1e5b31,_0x48331a['error'][_0x2e9f('0x2b')]);return _0x4421dc(_0x48331a[_0x2e9f('0x29')][_0x2e9f('0x2b')]);}logger['error'](_0x2e9f('0x25'),_0x1e5b31,_0x48331a['error'][_0x2e9f('0x2b')]);return _0x150aaa(_0x48331a[_0x2e9f('0x29')][_0x2e9f('0x2b')]);}else{logger[_0x2e9f('0x24')](_0x2e9f('0x25'),_0x1e5b31,_0x2e9f('0x27'));_0x150aaa(_0x48331a['result'][_0x2e9f('0x2b')]);}})[_0x2e9f('0x2c')](function(_0x384070){logger[_0x2e9f('0x29')](_0x2e9f('0x25'),_0x1e5b31,_0x384070);_0x4421dc(_0x384070);});});}function respondWithStatusCode(_0x1be656,_0x1c4bbc){_0x1c4bbc=_0x1c4bbc||0xcc;return function(_0x1e370d){if(_0x1e370d){return _0x1be656['sendStatus'](_0x1c4bbc);}return _0x1be656['status'](_0x1c4bbc)[_0x2e9f('0x2d')]();};}function respondWithResult(_0x1dbbf5,_0x3afc8f){_0x3afc8f=_0x3afc8f||0xc8;return function(_0x1f84dd){if(_0x1f84dd){return _0x1dbbf5[_0x2e9f('0x2e')](_0x3afc8f)[_0x2e9f('0x2f')](_0x1f84dd);}};}function respondWithFilteredResult(_0x10d8b9,_0x2ceae8){return function(_0x2bbd84){if(_0x2bbd84){var _0x813932=typeof _0x2ceae8[_0x2e9f('0x30')]===_0x2e9f('0x31')&&typeof _0x2ceae8[_0x2e9f('0x32')]==='undefined';var _0x138376=_0x2bbd84[_0x2e9f('0x33')];var _0x9a7c20=_0x813932?0x0:_0x2ceae8[_0x2e9f('0x30')];var _0x346f26=_0x813932?_0x2bbd84[_0x2e9f('0x33')]:_0x2ceae8[_0x2e9f('0x30')]+_0x2ceae8[_0x2e9f('0x32')];var _0x3cc13d;if(_0x346f26>=_0x138376){_0x346f26=_0x138376;_0x3cc13d=0xc8;}else{_0x3cc13d=0xce;}_0x10d8b9[_0x2e9f('0x2e')](_0x3cc13d);return _0x10d8b9[_0x2e9f('0x34')](_0x2e9f('0x35'),_0x9a7c20+'-'+_0x346f26+'/'+_0x138376)['json'](_0x2bbd84);}return null;};}function patchUpdates(_0x439ff3){return function(_0x2243ac){try{jsonpatch[_0x2e9f('0x36')](_0x2243ac,_0x439ff3,!![]);}catch(_0x8b23d8){return BPromise[_0x2e9f('0x37')](_0x8b23d8);}return _0x2243ac[_0x2e9f('0x38')]();};}function saveUpdates(_0x5a55f1,_0x4dd74c){return function(_0x4832b8){if(_0x4832b8){return _0x4832b8[_0x2e9f('0x39')](_0x5a55f1)['then'](function(_0x49c997){return _0x49c997;});}return null;};}function removeEntity(_0x688274,_0x167abd){return function(_0x19d81b){if(_0x19d81b){return _0x19d81b[_0x2e9f('0x3a')]()['then'](function(){_0x688274['status'](0xcc)[_0x2e9f('0x2d')]();});}};}function handleEntityNotFound(_0x566d3b,_0xb03fb1){return function(_0x4bf552){if(!_0x4bf552){_0x566d3b['sendStatus'](0x194);}return _0x4bf552;};}function handleError(_0x4aee40,_0xb3d6dd){_0xb3d6dd=_0xb3d6dd||0x1f4;return function(_0x51895c){logger['error'](_0x51895c[_0x2e9f('0x3b')]);if(_0x51895c['name']){delete _0x51895c['name'];}_0x4aee40['status'](_0xb3d6dd)[_0x2e9f('0x3c')](_0x51895c);};}exports[_0x2e9f('0x3d')]=function(_0x26c256,_0x287e08){var _0x3a2294={},_0x5e6076={},_0x49cd47={'count':0x0,'rows':[]};var _0x29639d=_['map'](db['SmsMessage'][_0x2e9f('0x3e')],function(_0x26930f){return{'name':_0x26930f['fieldName'],'type':_0x26930f['type'][_0x2e9f('0x3f')]};});_0x5e6076['model']=_[_0x2e9f('0x40')](_0x29639d,_0x2e9f('0x41'));_0x5e6076['query']=_[_0x2e9f('0x42')](_0x26c256[_0x2e9f('0x43')]);_0x5e6076['filters']=_['intersection'](_0x5e6076[_0x2e9f('0x44')],_0x5e6076[_0x2e9f('0x43')]);_0x3a2294[_0x2e9f('0x45')]=_['intersection'](_0x5e6076[_0x2e9f('0x44')],qs[_0x2e9f('0x46')](_0x26c256['query']['fields']));_0x3a2294['attributes']=_0x3a2294[_0x2e9f('0x45')][_0x2e9f('0x47')]?_0x3a2294[_0x2e9f('0x45')]:_0x5e6076[_0x2e9f('0x44')];if(!_0x26c256[_0x2e9f('0x43')]['hasOwnProperty']('nolimit')){_0x3a2294[_0x2e9f('0x32')]=qs[_0x2e9f('0x32')](_0x26c256[_0x2e9f('0x43')][_0x2e9f('0x32')]);_0x3a2294['offset']=qs[_0x2e9f('0x30')](_0x26c256[_0x2e9f('0x43')]['offset']);}_0x3a2294[_0x2e9f('0x48')]=qs['sort'](_0x26c256[_0x2e9f('0x43')][_0x2e9f('0x49')]);_0x3a2294['where']=qs[_0x2e9f('0x4a')](_[_0x2e9f('0x4b')](_0x26c256[_0x2e9f('0x43')],_0x5e6076[_0x2e9f('0x4a')]),_0x29639d);if(_0x26c256['query']['filter']){_0x3a2294[_0x2e9f('0x4c')]=_[_0x2e9f('0x4d')](_0x3a2294[_0x2e9f('0x4c')],{'$or':_['map'](_0x29639d,function(_0x31d4b2){if(_0x31d4b2[_0x2e9f('0x4e')]!==_0x2e9f('0x4f')){var _0x1ef1ab={};_0x1ef1ab[_0x31d4b2[_0x2e9f('0x41')]]={'$like':'%'+_0x26c256[_0x2e9f('0x43')][_0x2e9f('0x50')]+'%'};return _0x1ef1ab;}})});}_0x3a2294=_[_0x2e9f('0x4d')]({},_0x3a2294,_0x26c256[_0x2e9f('0x51')]);var _0x5dab9a={'where':_0x3a2294['where']};return db['SmsMessage'][_0x2e9f('0x33')](_0x5dab9a)[_0x2e9f('0x52')](function(_0x45c92a){_0x49cd47[_0x2e9f('0x33')]=_0x45c92a;if(_0x26c256['query']['includeAll']){_0x3a2294[_0x2e9f('0x53')]=[{'all':!![]}];}return db[_0x2e9f('0x54')][_0x2e9f('0x55')](_0x3a2294);})[_0x2e9f('0x52')](function(_0x17cd16){_0x49cd47['rows']=_0x17cd16;return _0x49cd47;})[_0x2e9f('0x52')](respondWithFilteredResult(_0x287e08,_0x3a2294))[_0x2e9f('0x2c')](handleError(_0x287e08,null));};exports[_0x2e9f('0x56')]=function(_0x32dbb3,_0x25a5f0){var _0xee96a2={'raw':!![],'where':{'id':_0x32dbb3[_0x2e9f('0x57')]['id']}},_0x3eda15={};_0x3eda15[_0x2e9f('0x44')]=_[_0x2e9f('0x42')](db[_0x2e9f('0x54')][_0x2e9f('0x3e')]);_0x3eda15[_0x2e9f('0x43')]=_[_0x2e9f('0x42')](_0x32dbb3['query']);_0x3eda15[_0x2e9f('0x4a')]=_[_0x2e9f('0x58')](_0x3eda15['model'],_0x3eda15['query']);_0xee96a2[_0x2e9f('0x45')]=_[_0x2e9f('0x58')](_0x3eda15['model'],qs['fields'](_0x32dbb3[_0x2e9f('0x43')][_0x2e9f('0x46')]));_0xee96a2[_0x2e9f('0x45')]=_0xee96a2[_0x2e9f('0x45')][_0x2e9f('0x47')]?_0xee96a2['attributes']:_0x3eda15[_0x2e9f('0x44')];if(_0x32dbb3[_0x2e9f('0x43')][_0x2e9f('0x59')]){_0xee96a2[_0x2e9f('0x53')]=[{'all':!![]}];}_0xee96a2=_[_0x2e9f('0x4d')]({},_0xee96a2,_0x32dbb3[_0x2e9f('0x51')]);return db[_0x2e9f('0x54')][_0x2e9f('0x5a')](_0xee96a2)[_0x2e9f('0x52')](handleEntityNotFound(_0x25a5f0,null))['then'](respondWithResult(_0x25a5f0,null))['catch'](handleError(_0x25a5f0,null));};exports['create']=function(_0x4bd628,_0x37daa9){return db[_0x2e9f('0x54')][_0x2e9f('0x5b')](_0x4bd628[_0x2e9f('0x5c')],{})[_0x2e9f('0x52')](respondWithResult(_0x37daa9,0xc9))[_0x2e9f('0x2c')](handleError(_0x37daa9,null));};exports[_0x2e9f('0x39')]=function(_0x49228c,_0x16ec93){if(_0x49228c[_0x2e9f('0x5c')]['id']){delete _0x49228c['body']['id'];}return db['SmsMessage'][_0x2e9f('0x5a')]({'where':{'id':_0x49228c[_0x2e9f('0x57')]['id']}})[_0x2e9f('0x52')](handleEntityNotFound(_0x16ec93,null))['then'](saveUpdates(_0x49228c[_0x2e9f('0x5c')],null))[_0x2e9f('0x52')](respondWithResult(_0x16ec93,null))[_0x2e9f('0x2c')](handleError(_0x16ec93,null));};exports[_0x2e9f('0x3a')]=function(_0x32211d,_0x159c01){return db['SmsMessage'][_0x2e9f('0x5a')]({'where':{'id':_0x32211d[_0x2e9f('0x57')]['id']}})[_0x2e9f('0x52')](handleEntityNotFound(_0x159c01,null))['then'](removeEntity(_0x159c01,null))['catch'](handleError(_0x159c01,null));};exports[_0x2e9f('0x5d')]=function(_0x36ebbd,_0x46c48f){return db[_0x2e9f('0x54')][_0x2e9f('0x5d')]()[_0x2e9f('0x52')](respondWithResult(_0x46c48f,null))[_0x2e9f('0x2c')](handleError(_0x46c48f,null));};var interaction_log=require(_0x2e9f('0x14'))('sms-interactions');exports[_0x2e9f('0x5e')]=function(_0x21b76e,_0x66a757,_0x4d1cb4){var _0x581622={'agent':{},'channel':_0x2e9f('0x5f')};if(_0x21b76e[_0x2e9f('0x5c')]['id']){delete _0x21b76e['body']['id'];}_0x21b76e['body']['read']=!![];_0x21b76e['body']['readAt']=moment()[_0x2e9f('0x60')](_0x2e9f('0x61'));_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x62')]=_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x62')]||_0x21b76e[_0x2e9f('0x63')]['id'];_0x581622[_0x2e9f('0x64')]['id']=_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x62')];return db[_0x2e9f('0x54')]['find']({'where':{'id':_0x21b76e[_0x2e9f('0x57')]['id'],'UserId':null}})[_0x2e9f('0x52')](handleEntityNotFound(_0x66a757,null))[_0x2e9f('0x52')](saveUpdates(_0x21b76e[_0x2e9f('0x5c')],null))[_0x2e9f('0x52')](function(_0x4e99ea){if(_0x4e99ea){_0x581622[_0x2e9f('0x2b')]=_0x4e99ea['get']({'plain':!![]});return db[_0x2e9f('0x65')]['find']({'where':{'id':_0x4e99ea[_0x2e9f('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x66a757,null))['then'](function(_0x10e37e){if(_0x10e37e){return _0x10e37e[_0x2e9f('0x39')]({'UserId':_0x21b76e[_0x2e9f('0x5c')]['UserId'],'read1stAt':_[_0x2e9f('0x67')](_0x10e37e[_0x2e9f('0x68')])?moment()[_0x2e9f('0x60')](_0x2e9f('0x61')):undefined});}return null;})[_0x2e9f('0x52')](function(_0xb11c94){if(_0xb11c94){_0x581622['interaction']=_0xb11c94[_0x2e9f('0x69')]({'plain':!![]});interaction_log[_0x2e9f('0x24')](_0x2e9f('0x6a'),_0x21b76e[_0x2e9f('0x63')]['id'],_0x21b76e['user'][_0x2e9f('0x41')],_0x21b76e[_0x2e9f('0x63')][_0x2e9f('0x6b')],_0x581622['interaction']['id'],_0x21b76e['body']?JSON[_0x2e9f('0x28')](_0x21b76e[_0x2e9f('0x5c')]):'null');return respondWithRpcPromise(_0x2e9f('0x6c'),_0x2e9f('0x6d'),_0x581622);}return null;})['then'](function(_0x1f39e9){var _0x186d16=_0x2e9f('0x6e')+_0x1f39e9[_0x2e9f('0x2b')][_0x2e9f('0x6f')];return db['sequelize']['query'](_0x186d16,{'type':db['Sequelize'][_0x2e9f('0x70')]['SELECT'],'raw':!![]})[_0x2e9f('0x52')](function(_0x18981){return _0x18981;});})[_0x2e9f('0x52')](function(_0x4ab059){if(_0x4ab059){_0x581622['message'][_0x2e9f('0x71')]=_0x4ab059[0x0];if(!_0x21b76e['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x21b76e[_0x2e9f('0x5c')]['UserId'],'role':_0x2e9f('0x64')},'attributes':['id',_0x2e9f('0x41'),_0x2e9f('0x72'),_0x2e9f('0x73'),_0x2e9f('0x74')],'raw':!![]});}return null;})[_0x2e9f('0x52')](function(_0x4110d0){if(!_0x4110d0)return null;_0x581622[_0x2e9f('0x2b')][_0x2e9f('0x64')]=_0x4110d0;return _0x581622;})[_0x2e9f('0x52')](function(_0xdd95a6){if(_0xdd95a6){if(_0x21b76e[_0x2e9f('0x5c')][_0x2e9f('0x75')]){_0x581622[_0x2e9f('0x2b')][_0x2e9f('0x76')]=util['format'](_0x2e9f('0x77'),_0x21b76e['user'][_0x2e9f('0x41')]);_0x581622['message'][_0x2e9f('0x78')]=_0x581622['channel'];_0x581622[_0x2e9f('0x2b')]['motionChannel']=_0x581622[_0x2e9f('0x78')];_0x581622[_0x2e9f('0x2b')][_0x2e9f('0x79')]=_0x2e9f('0x5e');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x581622['message']},client9002)[_0x2e9f('0x52')](function(){return _0x581622;});}return _0x581622;}return null;})['then'](respondWithResult(_0x66a757,null))[_0x2e9f('0x2c')](handleError(_0x66a757,null));};var interaction_log=require(_0x2e9f('0x14'))('sms-interactions');exports[_0x2e9f('0x37')]=function(_0x31b78e,_0x3e3f05,_0x134d9b){var _0x2fb416={'agent':{},'channel':'sms'};if(_0x31b78e['body']['id']){delete _0x31b78e[_0x2e9f('0x5c')]['id'];}_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')]=_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')]||_0x31b78e[_0x2e9f('0x63')]['id'];_0x2fb416[_0x2e9f('0x64')]['id']=_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')];return db[_0x2e9f('0x54')][_0x2e9f('0x5a')]({'where':{'id':_0x31b78e[_0x2e9f('0x57')]['id'],'UserId':null}})[_0x2e9f('0x52')](handleEntityNotFound(_0x3e3f05,null))['then'](function(_0x21351d){if(_0x21351d){_0x2fb416[_0x2e9f('0x2b')]=_0x21351d['get']({'plain':!![]});return db[_0x2e9f('0x65')]['find']({'where':{'id':_0x21351d[_0x2e9f('0x66')]}});}return null;})[_0x2e9f('0x52')](handleEntityNotFound(_0x3e3f05,null))[_0x2e9f('0x52')](function(_0x5cbb09){if(_0x5cbb09){_0x2fb416[_0x2e9f('0x7a')]=_0x5cbb09['get']({'plain':!![]});interaction_log[_0x2e9f('0x24')](_0x2e9f('0x7b'),_0x31b78e[_0x2e9f('0x63')]['id'],_0x31b78e[_0x2e9f('0x63')][_0x2e9f('0x41')],_0x31b78e[_0x2e9f('0x63')]['role'],_0x2fb416['interaction']['id'],_0x31b78e['body']?JSON['stringify'](_0x31b78e['body']):_0x2e9f('0x7c'));return respondWithRpcPromise(_0x2e9f('0x7d'),_0x2e9f('0x7e'),_0x2fb416);}return null;})['then'](function(_0x1f38e9){var _0x59d0b3=_0x2e9f('0x6e')+_0x1f38e9['message']['ContactId'];return db[_0x2e9f('0x7f')][_0x2e9f('0x43')](_0x59d0b3,{'type':db[_0x2e9f('0x80')][_0x2e9f('0x70')][_0x2e9f('0x81')],'raw':!![]})[_0x2e9f('0x52')](function(_0x101a1d){return _0x101a1d;});})['then'](function(_0x2e56c3){if(_0x2e56c3){_0x2fb416[_0x2e9f('0x2b')]['contact']=_0x2e56c3[0x0];if(!_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')])return;return db[_0x2e9f('0x82')][_0x2e9f('0x5a')]({'where':{'id':_0x31b78e[_0x2e9f('0x5c')][_0x2e9f('0x62')],'role':'agent'},'attributes':['id',_0x2e9f('0x41'),_0x2e9f('0x72'),_0x2e9f('0x73'),_0x2e9f('0x74')],'raw':!![]});}return null;})[_0x2e9f('0x52')](function(_0x39ff18){if(!_0x39ff18)return null;_0x2fb416['message'][_0x2e9f('0x64')]=_0x39ff18;return _0x2fb416;})[_0x2e9f('0x52')](function(_0x57929b){if(_0x57929b){_0x57929b[_0x2e9f('0x2b')]['interface']=util[_0x2e9f('0x60')](_0x2e9f('0x77'),_0x31b78e['user'][_0x2e9f('0x41')]);_0x57929b[_0x2e9f('0x2b')][_0x2e9f('0x78')]=_0x2fb416[_0x2e9f('0x78')];_0x57929b[_0x2e9f('0x2b')][_0x2e9f('0x83')]=_0x2fb416[_0x2e9f('0x78')];_0x57929b[_0x2e9f('0x2b')][_0x2e9f('0x79')]=_0x2e9f('0x37');respondWithRpcPromise(_0x2e9f('0x84'),_0x2e9f('0x84'),{'event':_0x2e9f('0x85'),'message':_0x57929b[_0x2e9f('0x2b')]},client9002);return _0x2fb416;}return null;})[_0x2e9f('0x52')](respondWithResult(_0x3e3f05,null))['catch'](handleError(_0x3e3f05,null));};exports[_0x2e9f('0x2e')]=function(_0xf6c55e,_0x406e82,_0x450165){if(_0xf6c55e[_0x2e9f('0x5c')]['id']){delete _0xf6c55e[_0x2e9f('0x5c')]['id'];}var _0x275f5f;return db[_0x2e9f('0x54')][_0x2e9f('0x5a')]({'where':{'id':_0xf6c55e[_0x2e9f('0x57')]['id']}})[_0x2e9f('0x52')](handleEntityNotFound(_0x406e82,null))[_0x2e9f('0x52')](function(_0x190935){if(_0x190935){_0x275f5f=_0x190935;return db[_0x2e9f('0x86')]['find']({'where':{'id':_0x190935['SmsAccountId']}});}})[_0x2e9f('0x52')](handleEntityNotFound(_0x406e82,null))[_0x2e9f('0x52')](function(_0xf54248){if(_0xf54248){logger[_0x2e9f('0x26')](_0x2e9f('0x87'),_0x2e9f('0x2e'),_0x2e9f('0x88'),_0xf54248[_0x2e9f('0x4e')],util[_0x2e9f('0x89')](_0xf6c55e[_0x2e9f('0x5c')],{'showHidden':![],'depth':null}));switch(_0xf54248['type']){case _0x2e9f('0x8a'):if(_0xf6c55e[_0x2e9f('0x5c')]['MessageSid']&&_0xf6c55e['body'][_0x2e9f('0x8b')]===_0x275f5f[_0x2e9f('0x8c')]){return _0x275f5f[_0x2e9f('0x39')]({'read':!![]});}else{logger[_0x2e9f('0x29')](_0x2e9f('0x8d'),'status',_0x2e9f('0x8a'),util[_0x2e9f('0x89')](_0xf6c55e['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x8e')]&&_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x8e')]===_0x275f5f[_0x2e9f('0x8c')]&&_['indexOf'](['sent','delivered'],_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x8f')])>=0x0){return _0x275f5f[_0x2e9f('0x39')]({'read':!![]});}else{logger[_0x2e9f('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2e9f('0x2e'),_0x2e9f('0x90'),util[_0x2e9f('0x89')](_0xf6c55e[_0x2e9f('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2e9f('0x91'):var _0x3bbfa9=_0xf6c55e[_0x2e9f('0x5c')][_0x2e9f('0x92')][0x0];if(_0x3bbfa9[_0x2e9f('0x2e')][_0x2e9f('0x93')]===_0x2e9f('0x94')){return _0x275f5f[_0x2e9f('0x39')]({'read':!![]});}else{logger[_0x2e9f('0x29')](_0x2e9f('0x8d'),_0x2e9f('0x2e'),'infobip',util['inspect'](_0xf6c55e[_0x2e9f('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x275f5f;}})[_0x2e9f('0x52')](respondWithResult(_0x406e82,null))['catch'](handleError(_0x406e82,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 7c0b087..99ef1fe 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 _0xdc8a=['events','../../mysqldb','SmsMessage','save','remove','emit','hasOwnProperty'];(function(_0x58c053,_0x51c43f){var _0xe1079=function(_0x172345){while(--_0x172345){_0x58c053['push'](_0x58c053['shift']());}};_0xe1079(++_0x51c43f);}(_0xdc8a,0xf5));var _0xadc8=function(_0x1c75ea,_0x3a0dfc){_0x1c75ea=_0x1c75ea-0x0;var _0x48fa0d=_0xdc8a[_0x1c75ea];return _0x48fa0d;};'use strict';var EventEmitter=require(_0xadc8('0x0'));var SmsMessage=require(_0xadc8('0x1'))['db'][_0xadc8('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xadc8('0x3'),'afterUpdate':'update','afterDestroy':_0xadc8('0x4')};function emitEvent(_0x43e415){return function(_0x4e666d,_0x5a4f70,_0x4b93ca){SmsMessageEvents[_0xadc8('0x5')](_0x43e415+':'+_0x4e666d['id'],_0x4e666d);SmsMessageEvents[_0xadc8('0x5')](_0x43e415,_0x4e666d);_0x4b93ca(null);};}for(var e in events){if(events[_0xadc8('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x8622=['update','remove','emit','hasOwnProperty','hook','exports','SmsMessage','save'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x8622,0x146));var _0x2862=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8622[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x2862('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2862('0x1'),'afterUpdate':_0x2862('0x2'),'afterDestroy':_0x2862('0x3')};function emitEvent(_0x409dc9){return function(_0x5e897b,_0x5db3c7,_0x16d0ee){SmsMessageEvents[_0x2862('0x4')](_0x409dc9+':'+_0x5e897b['id'],_0x5e897b);SmsMessageEvents[_0x2862('0x4')](_0x409dc9,_0x5e897b);_0x16d0ee(null);};}for(var e in events){if(events[_0x2862('0x5')](e)){var event=events[e];SmsMessage[_0x2862('0x6')](e,emitEvent(event));}}module[_0x2862('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 7102b25..4bec0d2 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 _0xe8b5=['signature=','GET','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','intelepeer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','accountSid','phone','authToken','messages','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','read','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','clickSend','plivo','authId','remote','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort','length','digest','hex'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xe8b5,0x17a));var _0x5e8b=function(_0x1ccc19,_0x2a5e47){_0x1ccc19=_0x1ccc19-0x0;var _0x393065=_0xe8b5[_0x1ccc19];return _0x393065;};'use strict';var _=require(_0x5e8b('0x0'));var util=require(_0x5e8b('0x1'));var logger=require(_0x5e8b('0x2'))(_0x5e8b('0x3'));var moment=require(_0x5e8b('0x4'));var BPromise=require(_0x5e8b('0x5'));var rp=require(_0x5e8b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e8b('0x7'));var config=require('../../config/environment');var attributes=require(_0x5e8b('0x8'));module[_0x5e8b('0x9')]=function(_0x69c48a,_0x494934){return _0x69c48a[_0x5e8b('0xa')]('SmsMessage',attributes,{'tableName':_0x5e8b('0xb'),'paranoid':![],'indexes':[{'name':_0x5e8b('0xc'),'fields':[_0x5e8b('0xc')]},{'name':_0x5e8b('0xd'),'fields':[_0x5e8b('0xe')],'type':_0x5e8b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f98b4,_0x364f21,_0x4d1d5c){var _0x38c2cc=_0x69c48a[_0x5e8b('0x10')];var _0x17ce18=_0x1f98b4[_0x5e8b('0x11')]({'plain':!![]});if(_0x17ce18['direction'][_0x5e8b('0x12')]()==='in'||_0x17ce18[_0x5e8b('0x13')][_0x5e8b('0x12')]()===_0x5e8b('0x14')&&!_0x17ce18[_0x5e8b('0x15')]&&!_[_0x5e8b('0x16')](_0x17ce18[_0x5e8b('0x17')])&&!_[_0x5e8b('0x16')](_0x17ce18[_0x5e8b('0x18')])){_0x38c2cc[_0x5e8b('0x19')][_0x5e8b('0x1a')]({'where':{'id':_0x17ce18[_0x5e8b('0x18')]}})[_0x5e8b('0x1b')](function(_0x365888){if(_0x365888){_0x365888[_0x5e8b('0x1c')]({'lastMsgAt':_0x17ce18[_0x5e8b('0x1d')],'lastMsgDirection':_0x17ce18[_0x5e8b('0x13')][_0x5e8b('0x12')]()});}})[_0x5e8b('0x1e')](function(_0x44ce14){console[_0x5e8b('0x1f')](_0x44ce14);});}if(_0x17ce18[_0x5e8b('0x13')]===_0x5e8b('0x14')&&!_0x17ce18[_0x5e8b('0x15')]){var _0x53f425;_0x38c2cc[_0x5e8b('0x20')][_0x5e8b('0x21')]({'where':{'id':_0x17ce18[_0x5e8b('0x22')]},'raw':!![]})[_0x5e8b('0x1b')](function(_0x4b0c54){_0x53f425=_0x4b0c54;if(_0x53f425&&_0x53f425[_0x5e8b('0x23')]){switch(_0x53f425[_0x5e8b('0x23')]){case'twilio':var _0x5da5cf=require('twilio');if(_0x53f425[_0x5e8b('0x24')]&&_0x53f425['authToken']&&_0x53f425[_0x5e8b('0x25')]){var _0x313d3f=new _0x5da5cf(_0x53f425[_0x5e8b('0x24')],_0x53f425[_0x5e8b('0x26')]);_0x313d3f[_0x5e8b('0x27')]['create']({'body':_0x17ce18[_0x5e8b('0xe')],'to':_0x17ce18[_0x5e8b('0x25')],'from':_0x53f425[_0x5e8b('0x25')],'statusCallback':_0x53f425['remote']+_0x5e8b('0x28')+_0x17ce18['id']+_0x5e8b('0x29')+_0x53f425[_0x5e8b('0x2a')]})[_0x5e8b('0x1b')](function(_0x2e2d87){if(_0x2e2d87[_0x5e8b('0x2b')]){return _0x1f98b4[_0x5e8b('0x1c')]({'messageId':_0x2e2d87[_0x5e8b('0x2b')]});}})[_0x5e8b('0x1e')](function(_0x170a50){logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x2e'),util[_0x5e8b('0x2f')](_0x170a50,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x2e'),_0x5e8b('0x30'));}break;case'skebby':var _0xab6ca0=_0x5e8b('0x31');if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425['password']){var _0x3e4352={'recipient':[_0x17ce18[_0x5e8b('0x25')]],'message':_0x17ce18[_0x5e8b('0xe')],'message_type':_0x53f425['smsMethod']};if(_0x53f425['smsMethod']&&_0x53f425[_0x5e8b('0x33')]!=='SI'){_0x3e4352[_0x5e8b('0x34')]=_0x53f425[_0x5e8b('0x25')];}var _0x357586={'url':_0xab6ca0+_0x5e8b('0x35')+_0x53f425[_0x5e8b('0x32')]+'&password='+_0x53f425[_0x5e8b('0x36')],'method':'GET'};rp(_0x357586)[_0x5e8b('0x1b')](function(_0x544f5a){var _0x3c2069=_0x544f5a[_0x5e8b('0x37')](';');var _0x446145={'user_key':_0x3c2069[0x0],'session_key':_0x3c2069[0x1]};_0x357586={'url':_0xab6ca0+_0x5e8b('0x38'),'method':_0x5e8b('0x39'),'headers':{'user_key':_0x446145[_0x5e8b('0x3a')],'Session_key':_0x446145[_0x5e8b('0x3b')]},'json':!![],'body':_0x3e4352};return rp(_0x357586);})[_0x5e8b('0x1b')](function(_0x471ad1){if(_0x471ad1[_0x5e8b('0x3c')]>=0x1){var _0x39d934={'messageId':_0x471ad1[_0x5e8b('0x3d')]};if(_0x53f425[_0x5e8b('0x33')]!=='GP'||!_0x53f425[_0x5e8b('0x3e')]){_0x39d934['read']=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x39d934);}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x3f'),util['inspect'](_0x471ad1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x60273a){return logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x3f'),util[_0x5e8b('0x2f')](_0x60273a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5e8b('0x2c'),'afterCreate','skebby',_0x5e8b('0x40'));}break;case _0x5e8b('0x41'):if(_0x53f425['authToken']){var _0x5427ee={'recipient':_0x17ce18[_0x5e8b('0x25')],'message':_0x17ce18[_0x5e8b('0xe')],'sender':_0x53f425[_0x5e8b('0x42')]||_0x53f425[_0x5e8b('0x25')],'authorization':_0x53f425[_0x5e8b('0x26')]};var _0x364f21={'method':_0x5e8b('0x39'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x5427ee,'json':!![]};rp(_0x364f21)[_0x5e8b('0x1b')](function(_0xe59331){var _0x4ea5a4={'messageId':_0xe59331[_0x5e8b('0x43')]};if(!_0x53f425['deliveryReport']){_0x4ea5a4[_0x5e8b('0x44')]=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x4ea5a4);})[_0x5e8b('0x1e')](function(_0x2e689b){logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'connectel',util[_0x5e8b('0x2f')](_0x2e689b,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x41'),_0x5e8b('0x45'));}break;case _0x5e8b('0x46'):if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425['password']){var _0x5427ee={'messages':[{'source':'xCALLY\x20Motion','to':_0x17ce18[_0x5e8b('0x25')],'body':_0x17ce18[_0x5e8b('0xe')],'from':_0x53f425[_0x5e8b('0x42')]||_0x53f425['phone']}]};var _0x19b5b5=util[_0x5e8b('0x47')](_0x5e8b('0x48'),_0x53f425[_0x5e8b('0x32')],_0x53f425[_0x5e8b('0x36')]);var _0x364f21={'method':'POST','uri':_0x5e8b('0x49'),'body':_0x5427ee,'headers':{'Authorization':util['format'](_0x5e8b('0x4a'),new Buffer(_0x19b5b5)['toString'](_0x5e8b('0x4b')))},'json':!![]};rp(_0x364f21)[_0x5e8b('0x1b')](function(_0x1f2d98){if(_0x1f2d98[_0x5e8b('0x4c')]>=0xc8&&_0x1f2d98['http_code']<=0xce){if(_0x1f2d98[_0x5e8b('0x4d')]&&_0x1f2d98[_0x5e8b('0x4d')][_0x5e8b('0x4e')]>0x0){var _0x4b615f=_['head'](_0x1f2d98['data'][_0x5e8b('0x27')]);var _0x17405f={'messageId':_0x4b615f['message_id']};if(!_0x53f425['deliveryReport']){_0x17405f[_0x5e8b('0x44')]=!![];}return _0x1f98b4['update'](_0x17405f);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x4f'),util[_0x5e8b('0x2f')](_0x1f2d98,{'showHidden':![],'depth':null}));}}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),'afterCreate',_0x5e8b('0x4f'),util[_0x5e8b('0x2f')](_0x1f2d98,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1a3b21){logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x4f'),util[_0x5e8b('0x2f')](_0x1a3b21,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x4f'),_0x5e8b('0x40'));}break;case _0x5e8b('0x50'):if(_0x53f425[_0x5e8b('0x51')]&&_0x53f425[_0x5e8b('0x26')]){var _0x5427ee={'dst':_0x17ce18['phone'],'text':_0x17ce18[_0x5e8b('0xe')],'src':_0x53f425[_0x5e8b('0x42')]||_0x53f425[_0x5e8b('0x25')],'url':_0x53f425[_0x5e8b('0x52')]+_0x5e8b('0x28')+_0x17ce18['id']+'/status?token='+_0x53f425[_0x5e8b('0x2a')]};var _0x19b5b5=util[_0x5e8b('0x47')](_0x5e8b('0x48'),_0x53f425[_0x5e8b('0x51')],_0x53f425[_0x5e8b('0x26')]);var _0x364f21={'method':'POST','uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x53f425['authId']),'body':_0x5427ee,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x19b5b5)[_0x5e8b('0x53')]('base64'))},'json':!![]};rp(_0x364f21)[_0x5e8b('0x1b')](function(_0x55195e){var _0x1e24b2={'messageId':_0x55195e[_0x5e8b('0x54')][0x0]};return _0x1f98b4[_0x5e8b('0x1c')](_0x1e24b2);})[_0x5e8b('0x1e')](function(_0x54b305){logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x50'),util[_0x5e8b('0x2f')](_0x54b305,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x50'),_0x5e8b('0x55'));}break;case _0x5e8b('0x56'):if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425[_0x5e8b('0x36')]){if(_0x53f425['baseUrl']){var _0x3b700c={'method':'POST','uri':_0x53f425[_0x5e8b('0x57')]+_0x5e8b('0x58'),'body':{'username':_0x53f425[_0x5e8b('0x32')],'password':_0x53f425['password']},'json':!![]};return rp(_0x3b700c)[_0x5e8b('0x1b')](function(_0x38d65c){var _0x1191da={'method':_0x5e8b('0x39'),'uri':_0x53f425['baseUrl']+_0x5e8b('0x59'),'body':{'messages':[{'from':_0x53f425[_0x5e8b('0x25')],'destinations':[{'to':_0x17ce18['phone']}],'text':_0x17ce18[_0x5e8b('0xe')],'notifyUrl':_0x53f425[_0x5e8b('0x52')]+_0x5e8b('0x28')+_0x17ce18['id']+_0x5e8b('0x29')+_0x53f425[_0x5e8b('0x2a')],'notifyContentType':_0x5e8b('0x5a'),'callbackData':_0x53f425['phone']+';'+_0x17ce18[_0x5e8b('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x38d65c[_0x5e8b('0x2a')]},'json':!![]};return rp(_0x1191da)[_0x5e8b('0x1b')](function(_0x229ccf){if(_0x229ccf[_0x5e8b('0x27')]){var _0x1bfc98={'messageId':_0x229ccf[_0x5e8b('0x27')][0x0][_0x5e8b('0xc')]};if(!_0x53f425['deliveryReport']){_0x1bfc98[_0x5e8b('0x44')]=!![];}return _0x1f98b4['update'](_0x1bfc98);}else{return logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'infobip',util[_0x5e8b('0x2f')](_0x229ccf,{'showHidden':![],'depth':null}));}});})[_0x5e8b('0x1e')](function(_0x420b36){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x56'),util[_0x5e8b('0x2f')](_0x420b36,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x56'),_0x5e8b('0x5b'));}}else{logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),_0x5e8b('0x56'),_0x5e8b('0x40'));}break;case _0x5e8b('0x5c'):var _0xe384de=require(_0x5e8b('0x5d'));if(_0x53f425[_0x5e8b('0x5e')]){var _0x2b0bf0={};_0x2b0bf0[_0x5e8b('0x5f')]=_0x53f425[_0x5e8b('0x32')];_0x2b0bf0[_0x5e8b('0x25')]=_0x17ce18[_0x5e8b('0x25')];_0x2b0bf0['sender']=_0x53f425['phone'];_0x2b0bf0['text']=_0x17ce18[_0x5e8b('0xe')];_0x2b0bf0[_0x5e8b('0x60')]=+new Date();var _0x4e5795='';var _0x55f255='';var _0x291d0c=Object[_0x5e8b('0x61')](_0x2b0bf0);_0x291d0c[_0x5e8b('0x62')]();for(var _0x43feca=0x0;_0x43feca<_0x291d0c[_0x5e8b('0x63')];_0x43feca++){if(_0x4e5795!=''){_0x4e5795+='&';}_0x4e5795+=_0x291d0c[_0x43feca]+'='+encodeURIComponent(_0x2b0bf0[_0x291d0c[_0x43feca]]);_0x55f255+=_0x2b0bf0[_0x291d0c[_0x43feca]];}_0x55f255+=_0x53f425[_0x5e8b('0x5e')];_0x55f255=_0xe384de['createHash']('md5')[_0x5e8b('0x1c')](_0x55f255)[_0x5e8b('0x64')](_0x5e8b('0x65'));if(_0x4e5795!==''){_0x4e5795+='&';}_0x4e5795+=_0x5e8b('0x66')+_0x55f255;var _0x357586={'method':_0x5e8b('0x67'),'uri':_0x53f425[_0x5e8b('0x57')]+'/external/get/send.php?'+_0x4e5795,'json':!![]};return rp(_0x357586)[_0x5e8b('0x1b')](function(_0x5c1ba2){var _0x3ce7ea=Object[_0x5e8b('0x61')](_0x5c1ba2);if(_0x5c1ba2[_0x3ce7ea[0x0]]['error']&&parseInt(_0x5c1ba2[_0x3ce7ea[0x0]]['error'])===0x0){var _0x3ee73f={'messageId':_0x5c1ba2[_0x3ce7ea[0x0]][_0x5e8b('0x68')]};if(!_0x53f425[_0x5e8b('0x3e')]){_0x3ee73f[_0x5e8b('0x44')]=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x3ee73f);}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'csc',util[_0x5e8b('0x2f')](_0x5c1ba2[_0x5e8b('0x1f')],{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x40e544){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),'afterCreate','csc',util[_0x5e8b('0x2f')](_0x40e544,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x5c'),_0x5e8b('0x69'));}break;case _0x5e8b('0x6a'):if(_0x53f425[_0x5e8b('0x5e')]){var _0x422c1c={'method':_0x5e8b('0x39'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x53f425[_0x5e8b('0x5e')]},'body':{'content':_0x17ce18[_0x5e8b('0xe')],'to':[_0x17ce18['phone']],'from':_0x53f425['phone'],'binary':![],'clientMessageId':_0x5e8b('0x6b'),'charset':'UTF-8'},'json':!![]};rp(_0x422c1c)[_0x5e8b('0x1b')](function(_0x2028a3){if(!_0x2028a3[_0x5e8b('0x1f')]){var _0x4f3d0f={'messageId':_0x2028a3[_0x5e8b('0x27')][0x0]['apiMessageId']};if(!_0x53f425[_0x5e8b('0x3e')]){_0x4f3d0f['read']=!![];}return _0x1f98b4[_0x5e8b('0x1c')](_0x4f3d0f);}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),'afterCreate',_0x5e8b('0x6a'),util['inspect'](_0x2028a3['error'],{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x106cb7){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x6a'),util['inspect'](_0x106cb7,{'showHidden':![],'depth':null}));});}else{logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x6a'),_0x5e8b('0x69'));}break;case _0x5e8b('0x6c'):if(_0x53f425[_0x5e8b('0x32')]&&_0x53f425[_0x5e8b('0x36')]){var _0x19b5b5=util[_0x5e8b('0x47')](_0x5e8b('0x48'),_0x53f425[_0x5e8b('0x32')],_0x53f425[_0x5e8b('0x36')]);var _0x364f21={'method':_0x5e8b('0x39'),'uri':_0x5e8b('0x6d')+_0x53f425['accountId']+'/messages','body':{'to':[_0x17ce18[_0x5e8b('0x25')]],'text':_0x17ce18[_0x5e8b('0xe')],'from':_0x53f425['phone'],'applicationId':_0x53f425[_0x5e8b('0x6e')]},'headers':{'Authorization':util[_0x5e8b('0x47')](_0x5e8b('0x4a'),new Buffer(_0x19b5b5)[_0x5e8b('0x53')](_0x5e8b('0x4b')))},'json':!![]};rp(_0x364f21)['then'](function(_0x25ab52){if(_0x25ab52['id']){var _0x21f58e={'messageId':_0x25ab52['id']};return _0x1f98b4['update'](_0x21f58e);}else{logger[_0x5e8b('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5e8b('0x2d'),'bandwidth',util[_0x5e8b('0x2f')](_0x25ab52,{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x2bcd6f){logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x6c'),util[_0x5e8b('0x2f')](_0x2bcd6f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),'bandwidth',_0x5e8b('0x40'));}break;case'intelepeer':if(_0x53f425[_0x5e8b('0x5e')]){var _0x49cb2a={};var _0x357586={'method':_0x5e8b('0x39'),'uri':_0x5e8b('0x6f'),'headers':{'Authorization':_0x5e8b('0x70')+_0x53f425[_0x5e8b('0x5e')],'Content-Type':_0x5e8b('0x5a')},'body':{'from':_0x53f425[_0x5e8b('0x25')],'to':_0x17ce18[_0x5e8b('0x25')],'text':_0x17ce18['body']},'json':!![]};return rp(_0x357586)[_0x5e8b('0x1b')](function(_0x5a4aaf){if(_0x5a4aaf[_0x5e8b('0x71')]==0xca){_0x49cb2a[_0x5e8b('0x72')]=_0x5a4aaf;var _0x34c536={'method':_0x5e8b('0x39'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x5e8b('0x70')+_0x53f425[_0x5e8b('0x5e')],'Content-Type':_0x5e8b('0x5a')},'body':{'refid':_0x49cb2a[_0x5e8b('0x72')][_0x5e8b('0x73')]},'json':!![]};return rp(_0x34c536)[_0x5e8b('0x1b')](function(_0x5d5bb1){_0x49cb2a[_0x5e8b('0x74')]=_0x5d5bb1;var _0x2005dc={'messageId':_0x49cb2a['message']['refid'],'read':!![]};return _0x1f98b4[_0x5e8b('0x1c')](_0x2005dc);});}else{return logger['error'](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x75'),util[_0x5e8b('0x2f')](_0x5a4aaf,{'showHidden':![],'depth':null}));}})[_0x5e8b('0x1e')](function(_0x380daa){return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x75'),util[_0x5e8b('0x2f')](_0x380daa,{'showHidden':![],'depth':null}));});}else{return logger[_0x5e8b('0x1f')](_0x5e8b('0x2c'),_0x5e8b('0x2d'),_0x5e8b('0x75'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x4d1d5c();});}else{_0x4d1d5c();}}},'charset':_0x5e8b('0x76'),'collate':_0x5e8b('0x77')});}; \ No newline at end of file +var _0x55c6=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','findOne','then','update','catch','error','find','type','twilio','accountSid','authToken','create','body','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','password','smsMethod','sender','GET','split','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','IBSSO\x20','messages','messageId','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','text','timestamp','sort','digest','hex','signature=','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','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','status','refid','finally','utf8mb4'];(function(_0x107f87,_0x2fc1b3){var _0x1a18fe=function(_0x4d737c){while(--_0x4d737c){_0x107f87['push'](_0x107f87['shift']());}};_0x1a18fe(++_0x2fc1b3);}(_0x55c6,0x15d));var _0x655c=function(_0x2d241a,_0x3981f1){_0x2d241a=_0x2d241a-0x0;var _0x1d5b56=_0x55c6[_0x2d241a];return _0x1d5b56;};'use strict';var _=require('lodash');var util=require(_0x655c('0x0'));var logger=require(_0x655c('0x1'))(_0x655c('0x2'));var moment=require(_0x655c('0x3'));var BPromise=require('bluebird');var rp=require(_0x655c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x655c('0x5'));var config=require(_0x655c('0x6'));var attributes=require(_0x655c('0x7'));module[_0x655c('0x8')]=function(_0x3fa621,_0x22e7a7){return _0x3fa621[_0x655c('0x9')](_0x655c('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x655c('0xb'),'fields':['body'],'type':_0x655c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x442056,_0x30530a,_0x236119){var _0x43a845=_0x3fa621[_0x655c('0xd')];var _0x3d3290=_0x442056[_0x655c('0xe')]({'plain':!![]});if(_0x3d3290[_0x655c('0xf')]['toLowerCase']()==='in'||_0x3d3290['direction'][_0x655c('0x10')]()===_0x655c('0x11')&&!_0x3d3290[_0x655c('0x12')]&&!_['isNil'](_0x3d3290['UserId'])&&!_[_0x655c('0x13')](_0x3d3290[_0x655c('0x14')])){_0x43a845['SmsInteraction'][_0x655c('0x15')]({'where':{'id':_0x3d3290[_0x655c('0x14')]}})[_0x655c('0x16')](function(_0x525772){if(_0x525772){_0x525772[_0x655c('0x17')]({'lastMsgAt':_0x3d3290['createdAt'],'lastMsgDirection':_0x3d3290[_0x655c('0xf')][_0x655c('0x10')]()});}})[_0x655c('0x18')](function(_0x34e10f){console[_0x655c('0x19')](_0x34e10f);});}if(_0x3d3290[_0x655c('0xf')]===_0x655c('0x11')&&!_0x3d3290[_0x655c('0x12')]){var _0x518cf6;_0x43a845['SmsAccount'][_0x655c('0x1a')]({'where':{'id':_0x3d3290['SmsAccountId']},'raw':!![]})[_0x655c('0x16')](function(_0x588db2){_0x518cf6=_0x588db2;if(_0x518cf6&&_0x518cf6['type']){switch(_0x518cf6[_0x655c('0x1b')]){case _0x655c('0x1c'):var _0x51a6e6=require(_0x655c('0x1c'));if(_0x518cf6[_0x655c('0x1d')]&&_0x518cf6[_0x655c('0x1e')]&&_0x518cf6['phone']){var _0x273a5c=new _0x51a6e6(_0x518cf6[_0x655c('0x1d')],_0x518cf6[_0x655c('0x1e')]);_0x273a5c['messages'][_0x655c('0x1f')]({'body':_0x3d3290[_0x655c('0x20')],'to':_0x3d3290[_0x655c('0x21')],'from':_0x518cf6[_0x655c('0x21')],'statusCallback':_0x518cf6[_0x655c('0x22')]+_0x655c('0x23')+_0x3d3290['id']+_0x655c('0x24')+_0x518cf6[_0x655c('0x25')]})['then'](function(_0x349176){if(_0x349176[_0x655c('0x26')]){return _0x442056['update']({'messageId':_0x349176[_0x655c('0x26')]});}})[_0x655c('0x18')](function(_0x168f5e){logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x655c('0x27'),'twilio',util['inspect'](_0x168f5e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x1c'),_0x655c('0x29'));}break;case _0x655c('0x2a'):var _0x2602f4='https://api.skebby.it/API/v1.0/REST/';if(_0x518cf6[_0x655c('0x2b')]&&_0x518cf6[_0x655c('0x2c')]){var _0x4c5bde={'recipient':[_0x3d3290['phone']],'message':_0x3d3290[_0x655c('0x20')],'message_type':_0x518cf6['smsMethod']};if(_0x518cf6['smsMethod']&&_0x518cf6[_0x655c('0x2d')]!=='SI'){_0x4c5bde[_0x655c('0x2e')]=_0x518cf6[_0x655c('0x21')];}var _0x13f085={'url':_0x2602f4+'login?username='+_0x518cf6[_0x655c('0x2b')]+'&password='+_0x518cf6[_0x655c('0x2c')],'method':_0x655c('0x2f')};rp(_0x13f085)[_0x655c('0x16')](function(_0x5d6c05){var _0x30b12f=_0x5d6c05[_0x655c('0x30')](';');var _0x12d07d={'user_key':_0x30b12f[0x0],'session_key':_0x30b12f[0x1]};_0x13f085={'url':_0x2602f4+'sms','method':_0x655c('0x31'),'headers':{'user_key':_0x12d07d[_0x655c('0x32')],'Session_key':_0x12d07d[_0x655c('0x33')]},'json':!![],'body':_0x4c5bde};return rp(_0x13f085);})['then'](function(_0x12c39e){if(_0x12c39e[_0x655c('0x34')]>=0x1){var _0x403381={'messageId':_0x12c39e[_0x655c('0x35')]};if(_0x518cf6['smsMethod']!=='GP'||!_0x518cf6[_0x655c('0x36')]){_0x403381[_0x655c('0x37')]=!![];}return _0x442056[_0x655c('0x17')](_0x403381);}else{return logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x2a'),util[_0x655c('0x38')](_0x12c39e,{'showHidden':![],'depth':null}));}})[_0x655c('0x18')](function(_0x21d286){return logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x655c('0x2a'),util[_0x655c('0x38')](_0x21d286,{'showHidden':![],'depth':null}));});}else{logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x655c('0x27'),_0x655c('0x2a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x655c('0x39'):if(_0x518cf6[_0x655c('0x1e')]){var _0x2057d8={'recipient':_0x3d3290[_0x655c('0x21')],'message':_0x3d3290[_0x655c('0x20')],'sender':_0x518cf6[_0x655c('0x3a')]||_0x518cf6[_0x655c('0x21')],'authorization':_0x518cf6[_0x655c('0x1e')]};var _0x30530a={'method':_0x655c('0x31'),'uri':_0x655c('0x3b'),'body':_0x2057d8,'json':!![]};rp(_0x30530a)[_0x655c('0x16')](function(_0x3b4ae6){var _0x500b3f={'messageId':_0x3b4ae6[_0x655c('0x3c')]};if(!_0x518cf6[_0x655c('0x36')]){_0x500b3f['read']=!![];}return _0x442056[_0x655c('0x17')](_0x500b3f);})[_0x655c('0x18')](function(_0x248dd6){logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x39'),util[_0x655c('0x38')](_0x248dd6,{'showHidden':![],'depth':null}));});}else{logger[_0x655c('0x19')](_0x655c('0x28'),'afterCreate',_0x655c('0x39'),'Missing\x20parameters:\x20authToken');}break;case _0x655c('0x3d'):if(_0x518cf6[_0x655c('0x2b')]&&_0x518cf6[_0x655c('0x2c')]){var _0x2057d8={'messages':[{'source':_0x655c('0x3e'),'to':_0x3d3290[_0x655c('0x21')],'body':_0x3d3290['body'],'from':_0x518cf6[_0x655c('0x3a')]||_0x518cf6['phone']}]};var _0x5dfa01=util[_0x655c('0x3f')](_0x655c('0x40'),_0x518cf6[_0x655c('0x2b')],_0x518cf6[_0x655c('0x2c')]);var _0x30530a={'method':_0x655c('0x31'),'uri':_0x655c('0x41'),'body':_0x2057d8,'headers':{'Authorization':util[_0x655c('0x3f')]('Basic\x20%s',new Buffer(_0x5dfa01)[_0x655c('0x42')]('base64'))},'json':!![]};rp(_0x30530a)['then'](function(_0x4291ad){if(_0x4291ad[_0x655c('0x43')]>=0xc8&&_0x4291ad[_0x655c('0x43')]<=0xce){if(_0x4291ad[_0x655c('0x44')]&&_0x4291ad[_0x655c('0x44')]['queued_count']>0x0){var _0xce5fee=_['head'](_0x4291ad[_0x655c('0x44')]['messages']);var _0x3d468e={'messageId':_0xce5fee[_0x655c('0x45')]};if(!_0x518cf6[_0x655c('0x36')]){_0x3d468e['read']=!![];}return _0x442056[_0x655c('0x17')](_0x3d468e);}else{logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x655c('0x27'),_0x655c('0x46'),util[_0x655c('0x38')](_0x4291ad,{'showHidden':![],'depth':null}));}}else{logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x46'),util[_0x655c('0x38')](_0x4291ad,{'showHidden':![],'depth':null}));}})['catch'](function(_0x37a65f){logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x655c('0x27'),'clickSend',util[_0x655c('0x38')](_0x37a65f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x46'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x518cf6[_0x655c('0x47')]&&_0x518cf6[_0x655c('0x1e')]){var _0x2057d8={'dst':_0x3d3290[_0x655c('0x21')],'text':_0x3d3290[_0x655c('0x20')],'src':_0x518cf6[_0x655c('0x3a')]||_0x518cf6['phone'],'url':_0x518cf6[_0x655c('0x22')]+_0x655c('0x23')+_0x3d3290['id']+_0x655c('0x24')+_0x518cf6[_0x655c('0x25')]};var _0x5dfa01=util[_0x655c('0x3f')]('%s:%s',_0x518cf6[_0x655c('0x47')],_0x518cf6[_0x655c('0x1e')]);var _0x30530a={'method':_0x655c('0x31'),'uri':util['format'](_0x655c('0x48'),_0x518cf6[_0x655c('0x47')]),'body':_0x2057d8,'headers':{'Authorization':util[_0x655c('0x3f')](_0x655c('0x49'),new Buffer(_0x5dfa01)['toString'](_0x655c('0x4a')))},'json':!![]};rp(_0x30530a)[_0x655c('0x16')](function(_0x3e6d08){var _0x1e1c94={'messageId':_0x3e6d08['message_uuid'][0x0]};return _0x442056['update'](_0x1e1c94);})[_0x655c('0x18')](function(_0x3ad630){logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x4b'),util[_0x655c('0x38')](_0x3ad630,{'showHidden':![],'depth':null}));});}else{logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x655c('0x27'),_0x655c('0x4b'),_0x655c('0x4c'));}break;case _0x655c('0x4d'):if(_0x518cf6['username']&&_0x518cf6['password']){if(_0x518cf6['baseUrl']){var _0x31f532={'method':'POST','uri':_0x518cf6[_0x655c('0x4e')]+'/auth/1/session','body':{'username':_0x518cf6[_0x655c('0x2b')],'password':_0x518cf6[_0x655c('0x2c')]},'json':!![]};return rp(_0x31f532)[_0x655c('0x16')](function(_0x2aa387){var _0x4b2906={'method':_0x655c('0x31'),'uri':_0x518cf6[_0x655c('0x4e')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x518cf6[_0x655c('0x21')],'destinations':[{'to':_0x3d3290[_0x655c('0x21')]}],'text':_0x3d3290[_0x655c('0x20')],'notifyUrl':_0x518cf6['remote']+_0x655c('0x23')+_0x3d3290['id']+'/status?token='+_0x518cf6['token'],'notifyContentType':'application/json','callbackData':_0x518cf6['phone']+';'+_0x3d3290[_0x655c('0x20')]}]},'headers':{'Authorization':_0x655c('0x4f')+_0x2aa387[_0x655c('0x25')]},'json':!![]};return rp(_0x4b2906)[_0x655c('0x16')](function(_0x272694){if(_0x272694[_0x655c('0x50')]){var _0x1b21f6={'messageId':_0x272694[_0x655c('0x50')][0x0][_0x655c('0x51')]};if(!_0x518cf6[_0x655c('0x36')]){_0x1b21f6[_0x655c('0x37')]=!![];}return _0x442056['update'](_0x1b21f6);}else{return logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),'infobip',util[_0x655c('0x38')](_0x272694,{'showHidden':![],'depth':null}));}});})[_0x655c('0x18')](function(_0x2d5d64){return logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x4d'),util[_0x655c('0x38')](_0x2d5d64,{'showHidden':![],'depth':null}));});}else{logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x655c('0x27'),_0x655c('0x4d'),_0x655c('0x52'));}}else{logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x4d'),_0x655c('0x53'));}break;case _0x655c('0x54'):var _0x2d6746=require(_0x655c('0x55'));if(_0x518cf6[_0x655c('0x56')]){var _0x190ac0={};_0x190ac0['login']=_0x518cf6[_0x655c('0x2b')];_0x190ac0[_0x655c('0x21')]=_0x3d3290[_0x655c('0x21')];_0x190ac0[_0x655c('0x2e')]=_0x518cf6[_0x655c('0x21')];_0x190ac0[_0x655c('0x57')]=_0x3d3290[_0x655c('0x20')];_0x190ac0[_0x655c('0x58')]=+new Date();var _0x3d9136='';var _0x4fc9f2='';var _0x58e8b2=Object['keys'](_0x190ac0);_0x58e8b2[_0x655c('0x59')]();for(var _0x13d8f7=0x0;_0x13d8f7<_0x58e8b2['length'];_0x13d8f7++){if(_0x3d9136!=''){_0x3d9136+='&';}_0x3d9136+=_0x58e8b2[_0x13d8f7]+'='+encodeURIComponent(_0x190ac0[_0x58e8b2[_0x13d8f7]]);_0x4fc9f2+=_0x190ac0[_0x58e8b2[_0x13d8f7]];}_0x4fc9f2+=_0x518cf6[_0x655c('0x56')];_0x4fc9f2=_0x2d6746['createHash']('md5')[_0x655c('0x17')](_0x4fc9f2)[_0x655c('0x5a')](_0x655c('0x5b'));if(_0x3d9136!==''){_0x3d9136+='&';}_0x3d9136+=_0x655c('0x5c')+_0x4fc9f2;var _0x13f085={'method':'GET','uri':_0x518cf6['baseUrl']+'/external/get/send.php?'+_0x3d9136,'json':!![]};return rp(_0x13f085)[_0x655c('0x16')](function(_0x1d45f2){var _0x8c0357=Object[_0x655c('0x5d')](_0x1d45f2);if(_0x1d45f2[_0x8c0357[0x0]][_0x655c('0x19')]&&parseInt(_0x1d45f2[_0x8c0357[0x0]][_0x655c('0x19')])===0x0){var _0x887590={'messageId':_0x1d45f2[_0x8c0357[0x0]][_0x655c('0x5e')]};if(!_0x518cf6[_0x655c('0x36')]){_0x887590[_0x655c('0x37')]=!![];}return _0x442056[_0x655c('0x17')](_0x887590);}else{return logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x655c('0x54'),util[_0x655c('0x38')](_0x1d45f2['error'],{'showHidden':![],'depth':null}));}})[_0x655c('0x18')](function(_0x1612fa){return logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x54'),util['inspect'](_0x1612fa,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x655c('0x27'),'csc',_0x655c('0x5f'));}break;case _0x655c('0x60'):if(_0x518cf6['apiKey']){var _0x41b2b7={'method':_0x655c('0x31'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x518cf6[_0x655c('0x56')]},'body':{'content':_0x3d3290['body'],'to':[_0x3d3290[_0x655c('0x21')]],'from':_0x518cf6[_0x655c('0x21')],'binary':![],'clientMessageId':_0x655c('0x61'),'charset':_0x655c('0x62')},'json':!![]};rp(_0x41b2b7)[_0x655c('0x16')](function(_0x263168){if(!_0x263168[_0x655c('0x19')]){var _0x473759={'messageId':_0x263168[_0x655c('0x50')][0x0][_0x655c('0x63')]};if(!_0x518cf6['deliveryReport']){_0x473759[_0x655c('0x37')]=!![];}return _0x442056[_0x655c('0x17')](_0x473759);}else{return logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),'clickatell',util['inspect'](_0x263168[_0x655c('0x19')],{'showHidden':![],'depth':null}));}})[_0x655c('0x18')](function(_0x4f3318){return logger[_0x655c('0x19')](_0x655c('0x28'),'afterCreate',_0x655c('0x60'),util[_0x655c('0x38')](_0x4f3318,{'showHidden':![],'depth':null}));});}else{logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),'clickatell',_0x655c('0x5f'));}break;case _0x655c('0x64'):if(_0x518cf6[_0x655c('0x2b')]&&_0x518cf6[_0x655c('0x2c')]){var _0x5dfa01=util[_0x655c('0x3f')]('%s:%s',_0x518cf6[_0x655c('0x2b')],_0x518cf6[_0x655c('0x2c')]);var _0x30530a={'method':_0x655c('0x31'),'uri':_0x655c('0x65')+_0x518cf6[_0x655c('0x66')]+'/messages','body':{'to':[_0x3d3290[_0x655c('0x21')]],'text':_0x3d3290[_0x655c('0x20')],'from':_0x518cf6[_0x655c('0x21')],'applicationId':_0x518cf6[_0x655c('0x67')]},'headers':{'Authorization':util[_0x655c('0x3f')](_0x655c('0x49'),new Buffer(_0x5dfa01)['toString']('base64'))},'json':!![]};rp(_0x30530a)[_0x655c('0x16')](function(_0x3c6006){if(_0x3c6006['id']){var _0x22759c={'messageId':_0x3c6006['id']};return _0x442056['update'](_0x22759c);}else{logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x64'),util['inspect'](_0x3c6006,{'showHidden':![],'depth':null}));}})[_0x655c('0x18')](function(_0x57e354){logger['error'](_0x655c('0x28'),_0x655c('0x27'),'bandwidth',util[_0x655c('0x38')](_0x57e354,{'showHidden':![],'depth':null}));});}else{logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x64'),_0x655c('0x53'));}break;case _0x655c('0x68'):if(_0x518cf6['apiKey']){var _0x54d9d3={};var _0x13f085={'method':_0x655c('0x31'),'uri':_0x655c('0x69'),'headers':{'Authorization':_0x655c('0x6a')+_0x518cf6[_0x655c('0x56')],'Content-Type':_0x655c('0x6b')},'body':{'from':_0x518cf6[_0x655c('0x21')],'to':_0x3d3290[_0x655c('0x21')],'text':_0x3d3290['body']},'json':!![]};return rp(_0x13f085)[_0x655c('0x16')](function(_0x4b0beb){if(_0x4b0beb[_0x655c('0x6c')]==0xca){_0x54d9d3[_0x655c('0x6d')]=_0x4b0beb;var _0x3634ef={'method':_0x655c('0x31'),'uri':_0x655c('0x6e'),'headers':{'Authorization':_0x655c('0x6a')+_0x518cf6[_0x655c('0x56')],'Content-Type':_0x655c('0x6b')},'body':{'refid':_0x54d9d3[_0x655c('0x6d')]['refid']},'json':!![]};return rp(_0x3634ef)[_0x655c('0x16')](function(_0x3abb89){_0x54d9d3[_0x655c('0x6f')]=_0x3abb89;var _0x504248={'messageId':_0x54d9d3[_0x655c('0x6d')][_0x655c('0x70')],'read':!![]};return _0x442056[_0x655c('0x17')](_0x504248);});}else{return logger[_0x655c('0x19')](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x68'),util[_0x655c('0x38')](_0x4b0beb,{'showHidden':![],'depth':null}));}})[_0x655c('0x18')](function(_0x272c5d){return logger['error'](_0x655c('0x28'),_0x655c('0x27'),_0x655c('0x68'),util[_0x655c('0x38')](_0x272c5d,{'showHidden':![],'depth':null}));});}else{return logger[_0x655c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x655c('0x68'),'Token\x20not\x20received');}break;}}})[_0x655c('0x71')](function(){_0x236119();});}else{_0x236119();}}},'charset':_0x655c('0x72'),'collate':_0x655c('0x73')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 904f81a..15aab56 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 _0x1ff6=['message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsMessage,\x20%s,\x20%s'];(function(_0x5dfcd4,_0x3ceb22){var _0x353a4c=function(_0x476fa7){while(--_0x476fa7){_0x5dfcd4['push'](_0x5dfcd4['shift']());}};_0x353a4c(++_0x3ceb22);}(_0x1ff6,0x122));var _0x61ff=function(_0x930fab,_0x514b26){_0x930fab=_0x930fab-0x0;var _0x39751e=_0x1ff6[_0x930fab];return _0x39751e;};'use strict';var _=require('lodash');var util=require(_0x61ff('0x0'));var moment=require(_0x61ff('0x1'));var BPromise=require(_0x61ff('0x2'));var rs=require(_0x61ff('0x3'));var fs=require('fs');var Redis=require(_0x61ff('0x4'));var db=require(_0x61ff('0x5'))['db'];var utils=require(_0x61ff('0x6'));var logger=require('../../config/logger')(_0x61ff('0x7'));var config=require(_0x61ff('0x8'));var jayson=require(_0x61ff('0x9'));var client=jayson[_0x61ff('0xa')]['http']({'port':0x232a});config[_0x61ff('0xb')]=_[_0x61ff('0xc')](config[_0x61ff('0xb')],{'host':_0x61ff('0xd'),'port':0x18eb});var socket=require(_0x61ff('0xe'))(new Redis(config[_0x61ff('0xb')]));require(_0x61ff('0xf'))[_0x61ff('0x10')](socket);function respondWithRpcPromise(_0x380fd4,_0x14a68a,_0x394266){return new BPromise(function(_0x5b7d9a,_0x2edea3){return client[_0x61ff('0x11')](_0x380fd4,_0x394266)[_0x61ff('0x12')](function(_0x3a7064){logger[_0x61ff('0x13')]('SmsMessage,\x20%s,\x20%s',_0x14a68a,'request\x20sent');logger[_0x61ff('0x14')](_0x61ff('0x15'),_0x14a68a,_0x61ff('0x16'),JSON['stringify'](_0x3a7064));if(_0x3a7064[_0x61ff('0x17')]){if(_0x3a7064[_0x61ff('0x17')]['code']===0x1f4){logger[_0x61ff('0x17')](_0x61ff('0x18'),_0x14a68a,_0x3a7064[_0x61ff('0x17')][_0x61ff('0x19')]);return _0x2edea3(_0x3a7064[_0x61ff('0x17')]['message']);}logger[_0x61ff('0x17')](_0x61ff('0x18'),_0x14a68a,_0x3a7064['error'][_0x61ff('0x19')]);return _0x5b7d9a(_0x3a7064[_0x61ff('0x17')]['message']);}else{logger[_0x61ff('0x13')](_0x61ff('0x18'),_0x14a68a,_0x61ff('0x16'));_0x5b7d9a(_0x3a7064[_0x61ff('0x1a')][_0x61ff('0x19')]);}})[_0x61ff('0x1b')](function(_0x32ae64){logger[_0x61ff('0x17')](_0x61ff('0x18'),_0x14a68a,_0x32ae64);_0x2edea3(_0x32ae64);});});}exports[_0x61ff('0x1c')]=function(_0x426ed6){var _0x1e86e3=this;return new Promise(function(_0x4d8022,_0x483484){return db[_0x61ff('0x1d')][_0x61ff('0x1e')](_0x426ed6[_0x61ff('0x1f')],{'raw':_0x426ed6[_0x61ff('0x20')]?_0x426ed6[_0x61ff('0x20')][_0x61ff('0x21')]===undefined?!![]:![]:!![]})[_0x61ff('0x12')](function(_0x2dda60){logger[_0x61ff('0x13')](_0x61ff('0x1c'),_0x426ed6);logger[_0x61ff('0x14')](_0x61ff('0x1c'),_0x426ed6,JSON[_0x61ff('0x22')](_0x2dda60));_0x4d8022(_0x2dda60);})['catch'](function(_0x2f0551){logger['error']('CreateSmsMessage',_0x2f0551[_0x61ff('0x19')],_0x426ed6);_0x483484(_0x1e86e3['error'](0x1f4,_0x2f0551[_0x61ff('0x19')]));});});}; \ No newline at end of file +var _0xf6f0=['http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsMessage','options','raw','CreateSmsMessage','debug','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5962b6,_0x14c532){var _0x8814ff=function(_0x11e0fe){while(--_0x11e0fe){_0x5962b6['push'](_0x5962b6['shift']());}};_0x8814ff(++_0x14c532);}(_0xf6f0,0x9a));var _0x0f6f=function(_0x1508e9,_0x5dfaec){_0x1508e9=_0x1508e9-0x0;var _0x5a0bf5=_0xf6f0[_0x1508e9];return _0x5a0bf5;};'use strict';var _=require('lodash');var util=require(_0x0f6f('0x0'));var moment=require(_0x0f6f('0x1'));var BPromise=require(_0x0f6f('0x2'));var rs=require(_0x0f6f('0x3'));var fs=require('fs');var Redis=require(_0x0f6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f6f('0x5'));var logger=require(_0x0f6f('0x6'))(_0x0f6f('0x7'));var config=require(_0x0f6f('0x8'));var jayson=require(_0x0f6f('0x9'));var client=jayson[_0x0f6f('0xa')][_0x0f6f('0xb')]({'port':0x232a});config[_0x0f6f('0xc')]=_[_0x0f6f('0xd')](config[_0x0f6f('0xc')],{'host':_0x0f6f('0xe'),'port':0x18eb});var socket=require(_0x0f6f('0xf'))(new Redis(config[_0x0f6f('0xc')]));require(_0x0f6f('0x10'))[_0x0f6f('0x11')](socket);function respondWithRpcPromise(_0x37dc77,_0x2086f8,_0xdd06e7){return new BPromise(function(_0x1c27e6,_0x4d4a09){return client[_0x0f6f('0x12')](_0x37dc77,_0xdd06e7)['then'](function(_0x356605){logger[_0x0f6f('0x13')](_0x0f6f('0x14'),_0x2086f8,_0x0f6f('0x15'));logger['debug'](_0x0f6f('0x16'),_0x2086f8,'request\x20sent',JSON[_0x0f6f('0x17')](_0x356605));if(_0x356605[_0x0f6f('0x18')]){if(_0x356605[_0x0f6f('0x18')]['code']===0x1f4){logger[_0x0f6f('0x18')](_0x0f6f('0x14'),_0x2086f8,_0x356605[_0x0f6f('0x18')]['message']);return _0x4d4a09(_0x356605[_0x0f6f('0x18')][_0x0f6f('0x19')]);}logger[_0x0f6f('0x18')](_0x0f6f('0x14'),_0x2086f8,_0x356605[_0x0f6f('0x18')][_0x0f6f('0x19')]);return _0x1c27e6(_0x356605['error'][_0x0f6f('0x19')]);}else{logger[_0x0f6f('0x13')](_0x0f6f('0x14'),_0x2086f8,'request\x20sent');_0x1c27e6(_0x356605[_0x0f6f('0x1a')][_0x0f6f('0x19')]);}})['catch'](function(_0x5db864){logger[_0x0f6f('0x18')](_0x0f6f('0x14'),_0x2086f8,_0x5db864);_0x4d4a09(_0x5db864);});});}exports['CreateSmsMessage']=function(_0x69abe2){var _0x2585ae=this;return new Promise(function(_0x20ba93,_0x12eccd){return db[_0x0f6f('0x1b')]['create'](_0x69abe2['body'],{'raw':_0x69abe2[_0x0f6f('0x1c')]?_0x69abe2[_0x0f6f('0x1c')][_0x0f6f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x25f4a0){logger[_0x0f6f('0x13')](_0x0f6f('0x1e'),_0x69abe2);logger[_0x0f6f('0x1f')]('CreateSmsMessage',_0x69abe2,JSON[_0x0f6f('0x17')](_0x25f4a0));_0x20ba93(_0x25f4a0);})[_0x0f6f('0x20')](function(_0x4b4015){logger[_0x0f6f('0x18')](_0x0f6f('0x1e'),_0x4b4015[_0x0f6f('0x19')],_0x69abe2);_0x12eccd(_0x2585ae[_0x0f6f('0x18')](0x1f4,_0x4b4015['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index de217f2..1c6c0e0 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 _0xe851=['smsMessage:','./smsMessage.events','remove','update','emit','register','length'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xe851,0x1c8));var _0x1e85=function(_0x3adbfe,_0x46854c){_0x3adbfe=_0x3adbfe-0x0;var _0x155bc5=_0xe851[_0x3adbfe];return _0x155bc5;};'use strict';var SmsMessageEvents=require(_0x1e85('0x0'));var events=['save',_0x1e85('0x1'),_0x1e85('0x2')];function createListener(_0x5e0dd4,_0x2cf7a8){return function(_0xc0181a){_0x2cf7a8[_0x1e85('0x3')](_0x5e0dd4,_0xc0181a);};}function removeListener(_0x2bbc0f,_0x28ce65){return function(){SmsMessageEvents['removeListener'](_0x2bbc0f,_0x28ce65);};}exports[_0x1e85('0x4')]=function(_0x54dcea){for(var _0x4c6d35=0x0,_0x11ddfa=events[_0x1e85('0x5')];_0x4c6d35<_0x11ddfa;_0x4c6d35++){var _0x3bc202=events[_0x4c6d35];var _0x3030cb=createListener(_0x1e85('0x6')+_0x3bc202,_0x54dcea);SmsMessageEvents['on'](_0x3bc202,_0x3030cb);}}; \ No newline at end of file +var _0x1301=['smsMessage:','./smsMessage.events','save','update','emit','length'];(function(_0x50b16c,_0x5e9cce){var _0x4e939a=function(_0x9f560){while(--_0x9f560){_0x50b16c['push'](_0x50b16c['shift']());}};_0x4e939a(++_0x5e9cce);}(_0x1301,0xd9));var _0x1130=function(_0x289fa5,_0x2272cf){_0x289fa5=_0x289fa5-0x0;var _0x23fc68=_0x1301[_0x289fa5];return _0x23fc68;};'use strict';var SmsMessageEvents=require(_0x1130('0x0'));var events=[_0x1130('0x1'),'remove',_0x1130('0x2')];function createListener(_0x27f98c,_0x2cbe24){return function(_0x28eeaa){_0x2cbe24[_0x1130('0x3')](_0x27f98c,_0x28eeaa);};}function removeListener(_0x235f9c,_0x3335ae){return function(){SmsMessageEvents['removeListener'](_0x235f9c,_0x3335ae);};}exports['register']=function(_0x22774a){for(var _0x553776=0x0,_0x30860e=events[_0x1130('0x4')];_0x553776<_0x30860e;_0x553776++){var _0x1bf4d3=events[_0x553776];var _0x5ced8e=createListener(_0x1130('0x5')+_0x1bf4d3,_0x22774a);SmsMessageEvents['on'](_0x1bf4d3,_0x5ced8e);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 42d2a01..df57090 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 _0x1dc9=['/:id/teams','addTeams','put','update','delete','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create'];(function(_0x52b22f,_0x12c645){var _0x3eea4e=function(_0x1ce222){while(--_0x1ce222){_0x52b22f['push'](_0x52b22f['shift']());}};_0x3eea4e(++_0x12c645);}(_0x1dc9,0x1e7));var _0x91dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dc9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x91dc('0x0'));var path=require(_0x91dc('0x1'));var timeout=require(_0x91dc('0x2'));var express=require(_0x91dc('0x3'));var router=express[_0x91dc('0x4')]();var fs_extra=require(_0x91dc('0x5'));var auth=require(_0x91dc('0x6'));var interaction=require(_0x91dc('0x7'));var config=require(_0x91dc('0x8'));var controller=require(_0x91dc('0x9'));router['get']('/',auth[_0x91dc('0xa')](),controller[_0x91dc('0xb')]);router[_0x91dc('0xc')](_0x91dc('0xd'),auth[_0x91dc('0xa')](),controller[_0x91dc('0xe')]);router[_0x91dc('0xc')](_0x91dc('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x91dc('0xc')](_0x91dc('0x10'),auth[_0x91dc('0xa')](),controller[_0x91dc('0x11')]);router[_0x91dc('0xc')]('/:id/teams',auth[_0x91dc('0xa')](),controller[_0x91dc('0x12')]);router[_0x91dc('0xc')](_0x91dc('0x13'),auth['isAuthenticated'](),controller[_0x91dc('0x14')]);router[_0x91dc('0x15')]('/',auth[_0x91dc('0xa')](),controller[_0x91dc('0x16')]);router[_0x91dc('0x15')](_0x91dc('0x17'),auth[_0x91dc('0xa')](),controller[_0x91dc('0x18')]);router[_0x91dc('0x15')](_0x91dc('0x13'),auth[_0x91dc('0xa')](),controller['addAgents']);router[_0x91dc('0x19')](_0x91dc('0xf'),auth['isAuthenticated'](),controller[_0x91dc('0x1a')]);router[_0x91dc('0x1b')](_0x91dc('0xf'),auth[_0x91dc('0xa')](),controller['destroy']);router[_0x91dc('0x1b')](_0x91dc('0x17'),auth[_0x91dc('0xa')](),controller[_0x91dc('0x1c')]);router['delete']('/:id/users',auth[_0x91dc('0xa')](),controller[_0x91dc('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x6ced=['/:id/users','getAgents','post','addAgents','put','/:id','delete','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x498913,_0x1d6977){var _0x1fa421=function(_0x3e0345){while(--_0x3e0345){_0x498913['push'](_0x498913['shift']());}};_0x1fa421(++_0x1d6977);}(_0x6ced,0xb2));var _0xd6ce=function(_0x565a52,_0xf10f89){_0x565a52=_0x565a52-0x0;var _0x888e=_0x6ced[_0x565a52];return _0x888e;};'use strict';var multer=require('multer');var util=require(_0xd6ce('0x0'));var path=require('path');var timeout=require(_0xd6ce('0x1'));var express=require(_0xd6ce('0x2'));var router=express[_0xd6ce('0x3')]();var fs_extra=require(_0xd6ce('0x4'));var auth=require(_0xd6ce('0x5'));var interaction=require(_0xd6ce('0x6'));var config=require('../../config/environment');var controller=require(_0xd6ce('0x7'));router[_0xd6ce('0x8')]('/',auth[_0xd6ce('0x9')](),controller[_0xd6ce('0xa')]);router[_0xd6ce('0x8')](_0xd6ce('0xb'),auth['isAuthenticated'](),controller[_0xd6ce('0xc')]);router[_0xd6ce('0x8')]('/:id',auth[_0xd6ce('0x9')](),controller[_0xd6ce('0xd')]);router[_0xd6ce('0x8')](_0xd6ce('0xe'),auth['isAuthenticated'](),controller[_0xd6ce('0xf')]);router[_0xd6ce('0x8')](_0xd6ce('0x10'),auth['isAuthenticated'](),controller[_0xd6ce('0x11')]);router[_0xd6ce('0x8')](_0xd6ce('0x12'),auth[_0xd6ce('0x9')](),controller[_0xd6ce('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd6ce('0x14')](_0xd6ce('0x10'),auth[_0xd6ce('0x9')](),controller['addTeams']);router[_0xd6ce('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xd6ce('0x15')]);router[_0xd6ce('0x16')](_0xd6ce('0x17'),auth[_0xd6ce('0x9')](),controller['update']);router[_0xd6ce('0x18')](_0xd6ce('0x17'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xd6ce('0x10'),auth[_0xd6ce('0x9')](),controller[_0xd6ce('0x19')]);router[_0xd6ce('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xd6ce('0x1a')]);module[_0xd6ce('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6d4ff94..90ff60f 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 _0x3c88=['sequelize','exports','STRING','INTEGER','ENUM','beepall','roundrobin'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x3c88,0x70));var _0x83c8=function(_0x5cdd21,_0x513469){_0x5cdd21=_0x5cdd21-0x0;var _0x1fce47=_0x3c88[_0x5cdd21];return _0x1fce47;};'use strict';var Sequelize=require(_0x83c8('0x0'));module[_0x83c8('0x1')]={'name':{'type':Sequelize[_0x83c8('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x83c8('0x2')]},'timeout':{'type':Sequelize[_0x83c8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x83c8('0x4')]('rrmemory',_0x83c8('0x5'),_0x83c8('0x6'))}}; \ No newline at end of file +var _0x605e=['roundrobin','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x52c595,_0x3a6776){var _0x2516bf=function(_0x244957){while(--_0x244957){_0x52c595['push'](_0x52c595['shift']());}};_0x2516bf(++_0x3a6776);}(_0x605e,0x1a9));var _0xe605=function(_0x1a7477,_0x230129){_0x1a7477=_0x1a7477-0x0;var _0xe7a760=_0x605e[_0x1a7477];return _0xe7a760;};'use strict';var Sequelize=require('sequelize');module[_0xe605('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe605('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe605('0x2')]},'timeout':{'type':Sequelize[_0xe605('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe605('0x4')](_0xe605('0x5'),_0xe605('0x6'),_0xe605('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a7745fe..2f0b28c 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 _0xc0a7=['UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','pick','where','filter','merge','options','includeAll','include','SmsQueue','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','sort','SmsQueueId','User','findAndCountAll','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','hasOwnProperty','addTeams','ids','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','SmsQueues'];(function(_0x252620,_0x3d76b9){var _0x538f61=function(_0x4cbc6f){while(--_0x4cbc6f){_0x252620['push'](_0x252620['shift']());}};_0x538f61(++_0x3d76b9);}(_0xc0a7,0xee));var _0x7c0a=function(_0x530b18,_0x319614){_0x530b18=_0x530b18-0x0;var _0x2f305e=_0xc0a7[_0x530b18];return _0x2f305e;};'use strict';var emlformat=require(_0x7c0a('0x0'));var rimraf=require(_0x7c0a('0x1'));var zipdir=require(_0x7c0a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c0a('0x3'));var moment=require(_0x7c0a('0x4'));var BPromise=require(_0x7c0a('0x5'));var Mustache=require(_0x7c0a('0x6'));var util=require('util');var path=require(_0x7c0a('0x7'));var sox=require(_0x7c0a('0x8'));var csv=require(_0x7c0a('0x9'));var ejs=require(_0x7c0a('0xa'));var fs=require('fs');var fs_extra=require(_0x7c0a('0xb'));var _=require(_0x7c0a('0xc'));var squel=require(_0x7c0a('0xd'));var crypto=require(_0x7c0a('0xe'));var jsforce=require(_0x7c0a('0xf'));var deskjs=require(_0x7c0a('0x10'));var toCsv=require(_0x7c0a('0x9'));var querystring=require(_0x7c0a('0x11'));var Papa=require(_0x7c0a('0x12'));var Redis=require('ioredis');var authService=require(_0x7c0a('0x13'));var qs=require(_0x7c0a('0x14'));var as=require(_0x7c0a('0x15'));var hardwareService=require(_0x7c0a('0x16'));var logger=require(_0x7c0a('0x17'))(_0x7c0a('0x18'));var utils=require(_0x7c0a('0x19'));var config=require(_0x7c0a('0x1a'));var licenseUtil=require(_0x7c0a('0x1b'));var db=require(_0x7c0a('0x1c'))['db'];config[_0x7c0a('0x1d')]=_[_0x7c0a('0x1e')](config[_0x7c0a('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c0a('0x1d')]));require('./smsQueue.socket')[_0x7c0a('0x1f')](socket);function respondWithStatusCode(_0x255911,_0x80b70e){_0x80b70e=_0x80b70e||0xcc;return function(_0x119594){if(_0x119594){return _0x255911[_0x7c0a('0x20')](_0x80b70e);}return _0x255911['status'](_0x80b70e)[_0x7c0a('0x21')]();};}function respondWithResult(_0x7828fb,_0xcb7e63){_0xcb7e63=_0xcb7e63||0xc8;return function(_0x32032c){if(_0x32032c){return _0x7828fb[_0x7c0a('0x22')](_0xcb7e63)[_0x7c0a('0x23')](_0x32032c);}};}function respondWithFilteredResult(_0x52aa9e,_0x534962){return function(_0x1ecb2a){if(_0x1ecb2a){var _0x46cafb=typeof _0x534962[_0x7c0a('0x24')]===_0x7c0a('0x25')&&typeof _0x534962[_0x7c0a('0x26')]==='undefined';var _0x1d6427=_0x1ecb2a[_0x7c0a('0x27')];var _0x546ac8=_0x46cafb?0x0:_0x534962[_0x7c0a('0x24')];var _0x53da9f=_0x46cafb?_0x1ecb2a['count']:_0x534962[_0x7c0a('0x24')]+_0x534962['limit'];var _0x3ecf07;if(_0x53da9f>=_0x1d6427){_0x53da9f=_0x1d6427;_0x3ecf07=0xc8;}else{_0x3ecf07=0xce;}_0x52aa9e['status'](_0x3ecf07);return _0x52aa9e[_0x7c0a('0x28')](_0x7c0a('0x29'),_0x546ac8+'-'+_0x53da9f+'/'+_0x1d6427)[_0x7c0a('0x23')](_0x1ecb2a);}return null;};}function patchUpdates(_0xa9c1b6){return function(_0x5632f3){try{jsonpatch[_0x7c0a('0x2a')](_0x5632f3,_0xa9c1b6,!![]);}catch(_0x51e810){return BPromise['reject'](_0x51e810);}return _0x5632f3['save']();};}function saveUpdates(_0x588544,_0x1eaea9){return function(_0x127ac4){if(_0x127ac4){return _0x127ac4[_0x7c0a('0x2b')](_0x588544)[_0x7c0a('0x2c')](function(_0x3ddbe0){return _0x3ddbe0;});}return null;};}function removeEntity(_0x15bc46,_0x4bfa38){return function(_0x1fd876){if(_0x1fd876){return _0x1fd876[_0x7c0a('0x2d')]()[_0x7c0a('0x2c')](function(){var _0x247fed=_0x1fd876[_0x7c0a('0x2e')]({'plain':!![]});var _0x961dcd=_0x7c0a('0x2f');return db[_0x7c0a('0x30')][_0x7c0a('0x2d')]({'where':{'type':_0x961dcd,'resourceId':_0x247fed['id']}})[_0x7c0a('0x2c')](function(){return _0x1fd876;});})[_0x7c0a('0x2c')](function(){_0x15bc46['status'](0xcc)[_0x7c0a('0x21')]();});}};}function handleEntityNotFound(_0x351af1,_0x304fde){return function(_0x55aacf){if(!_0x55aacf){_0x351af1['sendStatus'](0x194);}return _0x55aacf;};}function handleError(_0x4d2360,_0x5e04cb){_0x5e04cb=_0x5e04cb||0x1f4;return function(_0x4d5f98){logger[_0x7c0a('0x31')](_0x4d5f98[_0x7c0a('0x32')]);if(_0x4d5f98[_0x7c0a('0x33')]){delete _0x4d5f98[_0x7c0a('0x33')];}_0x4d2360[_0x7c0a('0x22')](_0x5e04cb)[_0x7c0a('0x34')](_0x4d5f98);};}exports['index']=function(_0x332dcb,_0x22de87){var _0x484145={},_0x4d03d8={},_0x1d1ce7={'count':0x0,'rows':[]};var _0x20d144=_[_0x7c0a('0x35')](db['SmsQueue'][_0x7c0a('0x36')],function(_0x506a7a){return{'name':_0x506a7a[_0x7c0a('0x37')],'type':_0x506a7a[_0x7c0a('0x38')][_0x7c0a('0x39')]};});_0x4d03d8[_0x7c0a('0x3a')]=_[_0x7c0a('0x35')](_0x20d144,_0x7c0a('0x33'));_0x4d03d8['query']=_[_0x7c0a('0x3b')](_0x332dcb[_0x7c0a('0x3c')]);_0x4d03d8[_0x7c0a('0x3d')]=_[_0x7c0a('0x3e')](_0x4d03d8['model'],_0x4d03d8[_0x7c0a('0x3c')]);_0x484145['attributes']=_[_0x7c0a('0x3e')](_0x4d03d8['model'],qs['fields'](_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x484145[_0x7c0a('0x40')]=_0x484145[_0x7c0a('0x40')]['length']?_0x484145['attributes']:_0x4d03d8[_0x7c0a('0x3a')];if(!_0x332dcb['query']['hasOwnProperty'](_0x7c0a('0x41'))){_0x484145[_0x7c0a('0x26')]=qs[_0x7c0a('0x26')](_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x26')]);_0x484145[_0x7c0a('0x24')]=qs[_0x7c0a('0x24')](_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x24')]);}_0x484145[_0x7c0a('0x42')]=qs['sort'](_0x332dcb[_0x7c0a('0x3c')]['sort']);_0x484145['where']=qs[_0x7c0a('0x3d')](_[_0x7c0a('0x43')](_0x332dcb[_0x7c0a('0x3c')],_0x4d03d8[_0x7c0a('0x3d')]),_0x20d144);if(_0x332dcb[_0x7c0a('0x3c')]['filter']){_0x484145[_0x7c0a('0x44')]=_['merge'](_0x484145[_0x7c0a('0x44')],{'$or':_[_0x7c0a('0x35')](_0x20d144,function(_0xeedde5){if(_0xeedde5[_0x7c0a('0x38')]!=='VIRTUAL'){var _0x24d6fc={};_0x24d6fc[_0xeedde5[_0x7c0a('0x33')]]={'$like':'%'+_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x24d6fc;}})});}_0x484145=_[_0x7c0a('0x46')]({},_0x484145,_0x332dcb[_0x7c0a('0x47')]);var _0x765253={'where':_0x484145[_0x7c0a('0x44')]};return db['SmsQueue'][_0x7c0a('0x27')](_0x765253)[_0x7c0a('0x2c')](function(_0x233896){_0x1d1ce7[_0x7c0a('0x27')]=_0x233896;if(_0x332dcb[_0x7c0a('0x3c')][_0x7c0a('0x48')]){_0x484145[_0x7c0a('0x49')]=[{'all':!![]}];}return db[_0x7c0a('0x4a')][_0x7c0a('0x4b')](_0x484145);})[_0x7c0a('0x2c')](function(_0x34fb49){_0x1d1ce7[_0x7c0a('0x4c')]=_0x34fb49;return _0x1d1ce7;})[_0x7c0a('0x2c')](respondWithFilteredResult(_0x22de87,_0x484145))[_0x7c0a('0x4d')](handleError(_0x22de87,null));};exports[_0x7c0a('0x4e')]=function(_0x384db7,_0x544b4d){var _0x32eb63={'raw':!![],'where':{'id':_0x384db7[_0x7c0a('0x4f')]['id']}},_0x14f66c={};_0x14f66c[_0x7c0a('0x3a')]=_[_0x7c0a('0x3b')](db['SmsQueue'][_0x7c0a('0x36')]);_0x14f66c[_0x7c0a('0x3c')]=_['keys'](_0x384db7[_0x7c0a('0x3c')]);_0x14f66c['filters']=_['intersection'](_0x14f66c[_0x7c0a('0x3a')],_0x14f66c['query']);_0x32eb63[_0x7c0a('0x40')]=_['intersection'](_0x14f66c[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0x384db7[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x32eb63[_0x7c0a('0x40')]=_0x32eb63['attributes'][_0x7c0a('0x50')]?_0x32eb63['attributes']:_0x14f66c['model'];if(_0x384db7[_0x7c0a('0x3c')]['includeAll']){_0x32eb63['include']=[{'all':!![]}];}_0x32eb63=_[_0x7c0a('0x46')]({},_0x32eb63,_0x384db7[_0x7c0a('0x47')]);return db[_0x7c0a('0x4a')][_0x7c0a('0x51')](_0x32eb63)[_0x7c0a('0x2c')](handleEntityNotFound(_0x544b4d,null))['then'](respondWithResult(_0x544b4d,null))[_0x7c0a('0x4d')](handleError(_0x544b4d,null));};exports[_0x7c0a('0x52')]=function(_0x4d2d4e,_0x55f68c){return db[_0x7c0a('0x4a')]['create'](_0x4d2d4e[_0x7c0a('0x53')],{})['then'](function(_0x2b64e9){var _0x599d80=_0x4d2d4e[_0x7c0a('0x54')][_0x7c0a('0x2e')]({'plain':!![]});if(!_0x599d80)throw new Error(_0x7c0a('0x55'));if(_0x599d80[_0x7c0a('0x56')]===_0x7c0a('0x54')){var _0x4231f2=_0x2b64e9[_0x7c0a('0x2e')]({'plain':!![]});var _0x3dfc08=_0x7c0a('0x2f');return db[_0x7c0a('0x57')][_0x7c0a('0x51')]({'where':{'name':_0x3dfc08,'userProfileId':_0x599d80['userProfileId']},'raw':!![]})['then'](function(_0x39f358){if(_0x39f358&&_0x39f358['autoAssociation']===0x0){return db['UserProfileResource'][_0x7c0a('0x52')]({'name':_0x4231f2[_0x7c0a('0x33')],'resourceId':_0x4231f2['id'],'type':_0x39f358[_0x7c0a('0x33')],'sectionId':_0x39f358['id']},{})['then'](function(){return _0x2b64e9;});}else{return _0x2b64e9;}})[_0x7c0a('0x4d')](function(_0x63570b){logger[_0x7c0a('0x31')](_0x7c0a('0x58'),_0x63570b);throw _0x63570b;});}return _0x2b64e9;})[_0x7c0a('0x2c')](respondWithResult(_0x55f68c,0xc9))[_0x7c0a('0x4d')](handleError(_0x55f68c,null));};exports['update']=function(_0x539d42,_0x2071a5){if(_0x539d42[_0x7c0a('0x53')]['id']){delete _0x539d42['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x539d42[_0x7c0a('0x4f')]['id']}})[_0x7c0a('0x2c')](handleEntityNotFound(_0x2071a5,null))['then'](saveUpdates(_0x539d42[_0x7c0a('0x53')],null))[_0x7c0a('0x2c')](respondWithResult(_0x2071a5,null))['catch'](handleError(_0x2071a5,null));};exports[_0x7c0a('0x2d')]=function(_0x12b5af,_0x43e23b){return db['SmsQueue'][_0x7c0a('0x51')]({'where':{'id':_0x12b5af[_0x7c0a('0x4f')]['id']}})[_0x7c0a('0x2c')](handleEntityNotFound(_0x43e23b,null))['then'](removeEntity(_0x43e23b,null))[_0x7c0a('0x4d')](handleError(_0x43e23b,null));};exports['describe']=function(_0x3b92ae,_0xa82894){return db[_0x7c0a('0x4a')][_0x7c0a('0x59')]()[_0x7c0a('0x2c')](respondWithResult(_0xa82894,null))[_0x7c0a('0x4d')](handleError(_0xa82894,null));};exports[_0x7c0a('0x5a')]=function(_0xabbe3d,_0x23912f,_0x512778){var _0x182b53={'raw':!![],'where':{}},_0x296f62={},_0x26e720;return db['SmsQueue'][_0x7c0a('0x5b')]({'where':{'id':_0xabbe3d['params']['id']}})['then'](handleEntityNotFound(_0x23912f,null))['then'](function(_0x2f66f7){if(_0x2f66f7){_0x26e720=_0x2f66f7['get']({'plain':!![]});_0x296f62[_0x7c0a('0x3a')]=_['keys'](db[_0x7c0a('0x5c')][_0x7c0a('0x36')]);_0x296f62[_0x7c0a('0x3c')]=_[_0x7c0a('0x3b')](_0xabbe3d[_0x7c0a('0x3c')]);_0x296f62[_0x7c0a('0x3d')]=_['intersection'](_0x296f62[_0x7c0a('0x3a')],_0x296f62[_0x7c0a('0x3c')]);_0x182b53['attributes']=_[_0x7c0a('0x3e')](_0x296f62[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0xabbe3d[_0x7c0a('0x3c')]['fields']));_0x182b53['attributes']=_0x182b53[_0x7c0a('0x40')][_0x7c0a('0x50')]?_0x182b53[_0x7c0a('0x40')]:_0x296f62[_0x7c0a('0x3a')];if(!_0xabbe3d[_0x7c0a('0x3c')]['hasOwnProperty'](_0x7c0a('0x41'))){_0x182b53[_0x7c0a('0x26')]=qs['limit'](_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x26')]);_0x182b53[_0x7c0a('0x24')]=qs[_0x7c0a('0x24')](_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x24')]);}_0x182b53['order']=qs[_0x7c0a('0x5d')](_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x5d')]);_0x182b53[_0x7c0a('0x44')]=qs['filters'](_[_0x7c0a('0x43')](_0xabbe3d[_0x7c0a('0x3c')],_0x296f62[_0x7c0a('0x3d')]));_0x182b53[_0x7c0a('0x44')][_0x7c0a('0x5e')]=_0x2f66f7['id'];if(_0xabbe3d['query'][_0x7c0a('0x45')]){_0x182b53['where']=_[_0x7c0a('0x46')](_0x182b53[_0x7c0a('0x44')],{'$or':_[_0x7c0a('0x35')](_0x182b53[_0x7c0a('0x40')],function(_0x1a4bd6){var _0x2c8a46={};_0x2c8a46[_0x1a4bd6]={'$like':'%'+_0xabbe3d[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x2c8a46;})});}_0x182b53=_[_0x7c0a('0x46')]({},_0x182b53,_0xabbe3d['options']);return db[_0x7c0a('0x5c')][_0x7c0a('0x4b')](_0x182b53);}})[_0x7c0a('0x2c')](function(_0x33170b){if(_0x33170b){return db[_0x7c0a('0x5f')][_0x7c0a('0x60')]({'where':{'id':_[_0x7c0a('0x35')](_0x33170b,'UserId'),'role':'agent'},'attributes':['id',_0x7c0a('0x33'),_0x7c0a('0x61'),_0x7c0a('0x62'),'createdAt']});}})[_0x7c0a('0x2c')](function(_0x3765ac){if(_0x3765ac){return{'count':_0x3765ac[_0x7c0a('0x27')],'rows':_[_0x7c0a('0x35')](_0x3765ac[_0x7c0a('0x4c')],function(_0x135d18){return{'membername':_0x135d18[_0x7c0a('0x33')],'UserId':_0x135d18['id'],'queue_name':_0x26e720[_0x7c0a('0x33')],'SmsQueueId':_0x26e720['id'],'interface':util[_0x7c0a('0x63')](_0x7c0a('0x64'),_0x7c0a('0x65'),_0x135d18[_0x7c0a('0x33')]),'penalty':0x0,'paused':_0x135d18[_0x7c0a('0x61')],'createdAt':_0x135d18[_0x7c0a('0x66')],'updatedAt':_0x135d18[_0x7c0a('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c0a('0x2c')](respondWithFilteredResult(_0x23912f,_0x182b53))['catch'](handleError(_0x23912f,null));};exports[_0x7c0a('0x67')]=function(_0x4ca183,_0x68b58,_0x51677f){var _0x501d2f={};var _0x594739={};var _0x3ef210;var _0x44a6fa;return db[_0x7c0a('0x4a')][_0x7c0a('0x5b')]({'where':{'id':_0x4ca183[_0x7c0a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x68b58,null))[_0x7c0a('0x2c')](function(_0x125bcd){if(_0x125bcd){_0x3ef210=_0x125bcd;_0x594739[_0x7c0a('0x3a')]=_[_0x7c0a('0x3b')](db[_0x7c0a('0x68')][_0x7c0a('0x36')]);_0x594739[_0x7c0a('0x3c')]=_[_0x7c0a('0x3b')](_0x4ca183[_0x7c0a('0x3c')]);_0x594739[_0x7c0a('0x3d')]=_['intersection'](_0x594739['model'],_0x594739['query']);_0x501d2f[_0x7c0a('0x40')]=_[_0x7c0a('0x3e')](_0x594739[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x501d2f['attributes']=_0x501d2f[_0x7c0a('0x40')][_0x7c0a('0x50')]?_0x501d2f[_0x7c0a('0x40')]:_0x594739[_0x7c0a('0x3a')];_0x501d2f[_0x7c0a('0x42')]=qs['sort'](_0x4ca183['query']['sort']);_0x501d2f['where']=qs[_0x7c0a('0x3d')](_[_0x7c0a('0x43')](_0x4ca183[_0x7c0a('0x3c')],_0x594739[_0x7c0a('0x3d')]));if(_0x4ca183['query'][_0x7c0a('0x45')]){_0x501d2f['where']=_[_0x7c0a('0x46')](_0x501d2f['where'],{'$or':_['map'](_0x501d2f[_0x7c0a('0x40')],function(_0x4d908e){var _0x33a504={};_0x33a504[_0x4d908e]={'$like':'%'+_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x33a504;})});}_0x501d2f=_['merge']({},_0x501d2f,_0x4ca183[_0x7c0a('0x47')]);return _0x3ef210[_0x7c0a('0x67')](_0x501d2f);}})[_0x7c0a('0x2c')](function(_0x2b14f6){if(_0x2b14f6){_0x44a6fa=_0x2b14f6['length'];if(!_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x69')]('nolimit')){_0x501d2f['limit']=qs['limit'](_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x26')]);_0x501d2f[_0x7c0a('0x24')]=qs[_0x7c0a('0x24')](_0x4ca183[_0x7c0a('0x3c')][_0x7c0a('0x24')]);}return _0x3ef210[_0x7c0a('0x67')](_0x501d2f);}})[_0x7c0a('0x2c')](function(_0x4e03a9){if(_0x4e03a9){return _0x4e03a9?{'count':_0x44a6fa,'rows':_0x4e03a9}:null;}})[_0x7c0a('0x2c')](respondWithResult(_0x68b58,null))['catch'](handleError(_0x68b58,null));};exports[_0x7c0a('0x6a')]=function(_0x56040,_0x2e83dc,_0x2a41fb){var _0x528930=_0x56040[_0x7c0a('0x53')][_0x7c0a('0x6b')];return db[_0x7c0a('0x68')][_0x7c0a('0x4b')]({'where':{'id':_0x528930},'attributes':['id'],'include':[{'model':db[_0x7c0a('0x5f')],'as':'Agents','attributes':['id',_0x7c0a('0x33'),'online',_0x7c0a('0x6c'),_0x7c0a('0x6d')],'raw':!![]}]})[_0x7c0a('0x2c')](function(_0x232d32){if(_0x232d32){var _0x3b16ce=_[_0x7c0a('0x6e')](_0x232d32,function(_0x3f353c){var _0x5bdc6f=_0x3f353c[_0x7c0a('0x2e')]({'plain':!![]});return _0x5bdc6f[_0x7c0a('0x6f')];});return db[_0x7c0a('0x4a')][_0x7c0a('0x51')]({'where':{'id':_0x56040['params']['id']}})['then'](function(_0x2b0f3e){return db['sequelize'][_0x7c0a('0x70')](function(_0xe5510b){return _0x2b0f3e[_0x7c0a('0x6a')](_0x528930,{'transaction':_0xe5510b})[_0x7c0a('0x2c')](function(){return BPromise[_0x7c0a('0x71')](_0x3b16ce,function(_0x278ef6){return db['UserSmsQueue'][_0x7c0a('0x72')]({'where':{'UserId':_0x278ef6['id'],'SmsQueueId':_0x56040[_0x7c0a('0x4f')]['id']},'transaction':_0xe5510b});});})[_0x7c0a('0x2c')](function(){_0x3b16ce[_0x7c0a('0x73')](function(_0x418403){socket[_0x7c0a('0x74')](_0x7c0a('0x75'),{'UserId':_0x418403['id'],'SmsQueueId':_0x2b0f3e['id']});});});});});}})[_0x7c0a('0x2c')](respondWithStatusCode(_0x2e83dc,null))[_0x7c0a('0x4d')](handleError(_0x2e83dc,null));};exports[_0x7c0a('0x76')]=function(_0x4ad83d,_0x3c6c11,_0x36e6b0){return db['Team'][_0x7c0a('0x4b')]({'where':{'id':_0x4ad83d[_0x7c0a('0x3c')][_0x7c0a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x7c0a('0x5f')],'as':_0x7c0a('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x7c0a('0x2c')](handleEntityNotFound(_0x3c6c11,null))['then'](function(_0x130dd6){var _0x2e56ad=_[_0x7c0a('0x35')](_0x130dd6,'id');var _0x8ac2b9=[];var _0x34587e=[];var _0x4ba03c=squel[_0x7c0a('0x77')]();_0x4ba03c['field'](_0x7c0a('0x78'))['from'](_0x7c0a('0x79'),'tq')[_0x7c0a('0x7a')](_0x7c0a('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7c0a('0x44')](_0x7c0a('0x7c'),_0x4ad83d[_0x7c0a('0x4f')]['id']);for(var _0x330031=0x0;_0x330031<_0x130dd6[_0x7c0a('0x50')];_0x330031+=0x1){let _0x1207c2=_0x130dd6[_0x330031];for(var _0x1b68f8=0x0;_0x1b68f8<_0x1207c2[_0x7c0a('0x6f')][_0x7c0a('0x50')];_0x1b68f8+=0x1){let _0x565246=_0x1207c2['Agents'][_0x1b68f8];var _0x28e061=_0x4ba03c[_0x7c0a('0x7d')]();_0x28e061['where'](_0x7c0a('0x7e'),_0x565246['id']);_0x34587e[_0x7c0a('0x7f')](db[_0x7c0a('0x80')][_0x7c0a('0x3c')](_0x28e061['toString'](),{'type':db[_0x7c0a('0x80')][_0x7c0a('0x81')][_0x7c0a('0x82')]})['then'](function(_0x3c337b){if(_0x3c337b['length']===0x1){return _0x565246['id'];}else{var _0x5acb84=_['every'](_[_0x7c0a('0x35')](_0x3c337b,_0x7c0a('0x83')),function(_0x3eb4e4){return _['includes'](_0x2e56ad,_0x3eb4e4);});if(_0x5acb84){return _0x565246['id'];}}}));}}return BPromise[_0x7c0a('0x84')](_0x34587e)[_0x7c0a('0x2c')](function(_0x5b5504){_0x8ac2b9=_(_0x8ac2b9)[_0x7c0a('0x85')](_0x5b5504)[_0x7c0a('0x86')]()['value']();return db[_0x7c0a('0x4a')][_0x7c0a('0x51')]({'where':{'id':_0x4ad83d['params']['id']}})['then'](function(_0x5bc4a3){return db['sequelize'][_0x7c0a('0x70')](function(_0x3c295d){return _0x5bc4a3[_0x7c0a('0x76')](_0x4ad83d[_0x7c0a('0x3c')][_0x7c0a('0x6b')],{'transaction':_0x3c295d})[_0x7c0a('0x2c')](function(){if(!_[_0x7c0a('0x87')](_0x8ac2b9)){return _0x5bc4a3[_0x7c0a('0x88')](_0x8ac2b9,{'transaction':_0x3c295d});}})[_0x7c0a('0x2c')](function(){_0x8ac2b9[_0x7c0a('0x73')](function(_0x3c02b9){socket[_0x7c0a('0x74')](_0x7c0a('0x89'),{'UserId':_0x3c02b9,'SmsQueueId':_0x5bc4a3['id']});});});});});});})['then'](respondWithStatusCode(_0x3c6c11,null))[_0x7c0a('0x4d')](handleError(_0x3c6c11,null));};exports[_0x7c0a('0x8a')]=function(_0x111894,_0x3fe5d6,_0x366272){return db['SmsQueue'][_0x7c0a('0x51')]({'where':{'id':_0x111894[_0x7c0a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3fe5d6,null))['then'](function(_0x3c488a){if(_0x3c488a){return _0x3c488a[_0x7c0a('0x8a')](_0x111894[_0x7c0a('0x53')][_0x7c0a('0x6b')],_[_0x7c0a('0x8b')](_0x111894[_0x7c0a('0x53')],[_0x7c0a('0x6b'),'id'])||{})[_0x7c0a('0x8c')](function(_0x29067a){for(var _0x1dd30f=0x0;_0x1dd30f<_0x111894[_0x7c0a('0x53')][_0x7c0a('0x6b')][_0x7c0a('0x50')];_0x1dd30f+=0x1){socket['emit'](_0x7c0a('0x75'),{'UserId':Number(_0x111894[_0x7c0a('0x53')]['ids'][_0x1dd30f]),'SmsQueueId':Number(_0x111894[_0x7c0a('0x4f')]['id'])});}return _0x29067a;});}})[_0x7c0a('0x2c')](respondWithResult(_0x3fe5d6,null))[_0x7c0a('0x4d')](handleError(_0x3fe5d6,null));};exports[_0x7c0a('0x88')]=function(_0x55ceac,_0x1e7f83,_0x531070){return db[_0x7c0a('0x4a')][_0x7c0a('0x51')]({'where':{'id':_0x55ceac[_0x7c0a('0x4f')]['id']}})[_0x7c0a('0x2c')](handleEntityNotFound(_0x1e7f83,null))[_0x7c0a('0x2c')](function(_0x2927d2){if(_0x2927d2){return _0x2927d2[_0x7c0a('0x88')](_0x55ceac[_0x7c0a('0x3c')][_0x7c0a('0x6b')])[_0x7c0a('0x2c')](function(){if(_[_0x7c0a('0x8d')](_0x55ceac[_0x7c0a('0x3c')]['ids'])){for(var _0x217901=0x0;_0x217901<_0x55ceac[_0x7c0a('0x3c')][_0x7c0a('0x6b')][_0x7c0a('0x50')];_0x217901+=0x1){socket[_0x7c0a('0x74')](_0x7c0a('0x89'),{'UserId':Number(_0x55ceac[_0x7c0a('0x3c')][_0x7c0a('0x6b')][_0x217901]),'SmsQueueId':Number(_0x55ceac[_0x7c0a('0x4f')]['id'])});}}else{socket['emit'](_0x7c0a('0x89'),{'UserId':Number(_0x55ceac['query'][_0x7c0a('0x6b')]),'SmsQueueId':Number(_0x55ceac[_0x7c0a('0x4f')]['id'])});}});}})[_0x7c0a('0x2c')](respondWithStatusCode(_0x1e7f83,null))['catch'](handleError(_0x1e7f83,null));};exports[_0x7c0a('0x8e')]=function(_0x36f536,_0x527dd9,_0x3abae9){var _0x126a3d={};var _0x236039={};var _0x343089;var _0x38816f;return db[_0x7c0a('0x4a')][_0x7c0a('0x5b')]({'where':{'id':_0x36f536['params']['id']}})['then'](handleEntityNotFound(_0x527dd9,null))[_0x7c0a('0x2c')](function(_0x55c505){if(_0x55c505){_0x343089=_0x55c505;_0x236039[_0x7c0a('0x3a')]=_[_0x7c0a('0x3b')](db[_0x7c0a('0x5f')][_0x7c0a('0x36')]);_0x236039[_0x7c0a('0x3c')]=_['keys'](_0x36f536[_0x7c0a('0x3c')]);_0x236039[_0x7c0a('0x3d')]=_[_0x7c0a('0x3e')](_0x236039[_0x7c0a('0x3a')],_0x236039[_0x7c0a('0x3c')]);_0x126a3d['attributes']=_[_0x7c0a('0x3e')](_0x236039[_0x7c0a('0x3a')],qs[_0x7c0a('0x3f')](_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x3f')]));_0x126a3d['attributes']=_0x126a3d['attributes'][_0x7c0a('0x50')]?_0x126a3d[_0x7c0a('0x40')]:_0x236039['model'];_0x126a3d[_0x7c0a('0x42')]=qs[_0x7c0a('0x5d')](_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x5d')]);_0x126a3d[_0x7c0a('0x44')]=qs['filters'](_[_0x7c0a('0x43')](_0x36f536[_0x7c0a('0x3c')],_0x236039[_0x7c0a('0x3d')]));if(_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x45')]){_0x126a3d[_0x7c0a('0x44')]=_[_0x7c0a('0x46')](_0x126a3d[_0x7c0a('0x44')],{'$or':_[_0x7c0a('0x35')](_0x126a3d[_0x7c0a('0x40')],function(_0x43bf7a){var _0x531eb8={};_0x531eb8[_0x43bf7a]={'$like':'%'+_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x45')]+'%'};return _0x531eb8;})});}_0x126a3d=_[_0x7c0a('0x46')]({},_0x126a3d,_0x36f536['options']);return _0x343089['getAgents'](_0x126a3d);}})[_0x7c0a('0x2c')](function(_0x56e2bb){if(_0x56e2bb){_0x38816f=_0x56e2bb[_0x7c0a('0x50')];if(!_0x36f536[_0x7c0a('0x3c')][_0x7c0a('0x69')](_0x7c0a('0x41'))){_0x126a3d[_0x7c0a('0x26')]=qs[_0x7c0a('0x26')](_0x36f536[_0x7c0a('0x3c')]['limit']);_0x126a3d['offset']=qs['offset'](_0x36f536['query'][_0x7c0a('0x24')]);}return _0x343089[_0x7c0a('0x8e')](_0x126a3d);}})[_0x7c0a('0x2c')](function(_0x422bd9){if(_0x422bd9){return _0x422bd9?{'count':_0x38816f,'rows':_0x422bd9}:null;}})[_0x7c0a('0x2c')](respondWithResult(_0x527dd9,null))['catch'](handleError(_0x527dd9,null));}; \ No newline at end of file +var _0xa8b1=['SmsQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserSmsQueue','length','hasOwnProperty','order','pick','SmsQueueId','findAll','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','ids','Agents','voicePause','flatMap','sequelize','each','findOrCreate','emit','removeTeams','select','field','from','join','push','QueryTypes','every','includes','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','SmsQueues','error','stack','name','send','index','map'];(function(_0x35b4d9,_0x4dea32){var _0xda3222=function(_0x1c02e9){while(--_0x1c02e9){_0x35b4d9['push'](_0x35b4d9['shift']());}};_0xda3222(++_0x4dea32);}(_0xa8b1,0xd7));var _0x1a8b=function(_0x2aea56,_0x241ac4){_0x2aea56=_0x2aea56-0x0;var _0x311497=_0xa8b1[_0x2aea56];return _0x311497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a8b('0x0'));var zipdir=require(_0x1a8b('0x1'));var jsonpatch=require(_0x1a8b('0x2'));var rp=require(_0x1a8b('0x3'));var moment=require(_0x1a8b('0x4'));var BPromise=require(_0x1a8b('0x5'));var Mustache=require(_0x1a8b('0x6'));var util=require(_0x1a8b('0x7'));var path=require(_0x1a8b('0x8'));var sox=require('sox');var csv=require(_0x1a8b('0x9'));var ejs=require(_0x1a8b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a8b('0xb'));var crypto=require(_0x1a8b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a8b('0xd'));var Redis=require(_0x1a8b('0xe'));var authService=require(_0x1a8b('0xf'));var qs=require(_0x1a8b('0x10'));var as=require(_0x1a8b('0x11'));var hardwareService=require(_0x1a8b('0x12'));var logger=require('../../config/logger')(_0x1a8b('0x13'));var utils=require(_0x1a8b('0x14'));var config=require(_0x1a8b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a8b('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1a8b('0x17'))(new Redis(config['redis']));require(_0x1a8b('0x18'))[_0x1a8b('0x19')](socket);function respondWithStatusCode(_0x2e7397,_0x367fe9){_0x367fe9=_0x367fe9||0xcc;return function(_0x38d304){if(_0x38d304){return _0x2e7397[_0x1a8b('0x1a')](_0x367fe9);}return _0x2e7397[_0x1a8b('0x1b')](_0x367fe9)[_0x1a8b('0x1c')]();};}function respondWithResult(_0xebc0db,_0x2d5622){_0x2d5622=_0x2d5622||0xc8;return function(_0x396edb){if(_0x396edb){return _0xebc0db[_0x1a8b('0x1b')](_0x2d5622)[_0x1a8b('0x1d')](_0x396edb);}};}function respondWithFilteredResult(_0x31935e,_0x460d4e){return function(_0x4e6a30){if(_0x4e6a30){var _0x22f790=typeof _0x460d4e[_0x1a8b('0x1e')]===_0x1a8b('0x1f')&&typeof _0x460d4e[_0x1a8b('0x20')]===_0x1a8b('0x1f');var _0x356e01=_0x4e6a30[_0x1a8b('0x21')];var _0x5605a6=_0x22f790?0x0:_0x460d4e[_0x1a8b('0x1e')];var _0x2e7407=_0x22f790?_0x4e6a30[_0x1a8b('0x21')]:_0x460d4e[_0x1a8b('0x1e')]+_0x460d4e[_0x1a8b('0x20')];var _0x466d34;if(_0x2e7407>=_0x356e01){_0x2e7407=_0x356e01;_0x466d34=0xc8;}else{_0x466d34=0xce;}_0x31935e[_0x1a8b('0x1b')](_0x466d34);return _0x31935e[_0x1a8b('0x22')]('Content-Range',_0x5605a6+'-'+_0x2e7407+'/'+_0x356e01)[_0x1a8b('0x1d')](_0x4e6a30);}return null;};}function patchUpdates(_0x373e72){return function(_0x3928db){try{jsonpatch[_0x1a8b('0x23')](_0x3928db,_0x373e72,!![]);}catch(_0x547326){return BPromise[_0x1a8b('0x24')](_0x547326);}return _0x3928db[_0x1a8b('0x25')]();};}function saveUpdates(_0x204f46,_0xd67e34){return function(_0x249403){if(_0x249403){return _0x249403[_0x1a8b('0x26')](_0x204f46)[_0x1a8b('0x27')](function(_0x3afdfa){return _0x3afdfa;});}return null;};}function removeEntity(_0x48efd1,_0x2823bb){return function(_0x4459f6){if(_0x4459f6){return _0x4459f6[_0x1a8b('0x28')]()['then'](function(){var _0x5075e0=_0x4459f6[_0x1a8b('0x29')]({'plain':!![]});var _0x573473=_0x1a8b('0x2a');return db['UserProfileResource'][_0x1a8b('0x28')]({'where':{'type':_0x573473,'resourceId':_0x5075e0['id']}})[_0x1a8b('0x27')](function(){return _0x4459f6;});})['then'](function(){_0x48efd1[_0x1a8b('0x1b')](0xcc)[_0x1a8b('0x1c')]();});}};}function handleEntityNotFound(_0x59f301,_0x5f40fd){return function(_0x4b52ce){if(!_0x4b52ce){_0x59f301[_0x1a8b('0x1a')](0x194);}return _0x4b52ce;};}function handleError(_0x4b96f3,_0x22a66b){_0x22a66b=_0x22a66b||0x1f4;return function(_0x599670){logger[_0x1a8b('0x2b')](_0x599670[_0x1a8b('0x2c')]);if(_0x599670[_0x1a8b('0x2d')]){delete _0x599670['name'];}_0x4b96f3[_0x1a8b('0x1b')](_0x22a66b)[_0x1a8b('0x2e')](_0x599670);};}exports[_0x1a8b('0x2f')]=function(_0xb5c7c1,_0x3f7330){var _0x100a25={},_0x5869d6={},_0x14b4b9={'count':0x0,'rows':[]};var _0x35e765=_[_0x1a8b('0x30')](db[_0x1a8b('0x31')][_0x1a8b('0x32')],function(_0x1a6574){return{'name':_0x1a6574[_0x1a8b('0x33')],'type':_0x1a6574['type'][_0x1a8b('0x34')]};});_0x5869d6['model']=_[_0x1a8b('0x30')](_0x35e765,'name');_0x5869d6[_0x1a8b('0x35')]=_[_0x1a8b('0x36')](_0xb5c7c1[_0x1a8b('0x35')]);_0x5869d6[_0x1a8b('0x37')]=_[_0x1a8b('0x38')](_0x5869d6[_0x1a8b('0x39')],_0x5869d6[_0x1a8b('0x35')]);_0x100a25['attributes']=_['intersection'](_0x5869d6['model'],qs[_0x1a8b('0x3a')](_0xb5c7c1[_0x1a8b('0x35')][_0x1a8b('0x3a')]));_0x100a25[_0x1a8b('0x3b')]=_0x100a25[_0x1a8b('0x3b')]['length']?_0x100a25[_0x1a8b('0x3b')]:_0x5869d6[_0x1a8b('0x39')];if(!_0xb5c7c1[_0x1a8b('0x35')]['hasOwnProperty'](_0x1a8b('0x3c'))){_0x100a25[_0x1a8b('0x20')]=qs[_0x1a8b('0x20')](_0xb5c7c1[_0x1a8b('0x35')][_0x1a8b('0x20')]);_0x100a25[_0x1a8b('0x1e')]=qs[_0x1a8b('0x1e')](_0xb5c7c1[_0x1a8b('0x35')]['offset']);}_0x100a25['order']=qs[_0x1a8b('0x3d')](_0xb5c7c1['query']['sort']);_0x100a25[_0x1a8b('0x3e')]=qs[_0x1a8b('0x37')](_['pick'](_0xb5c7c1['query'],_0x5869d6[_0x1a8b('0x37')]),_0x35e765);if(_0xb5c7c1[_0x1a8b('0x35')]['filter']){_0x100a25[_0x1a8b('0x3e')]=_[_0x1a8b('0x3f')](_0x100a25[_0x1a8b('0x3e')],{'$or':_[_0x1a8b('0x30')](_0x35e765,function(_0xf4aebb){if(_0xf4aebb[_0x1a8b('0x40')]!==_0x1a8b('0x41')){var _0x3aad42={};_0x3aad42[_0xf4aebb[_0x1a8b('0x2d')]]={'$like':'%'+_0xb5c7c1['query'][_0x1a8b('0x42')]+'%'};return _0x3aad42;}})});}_0x100a25=_[_0x1a8b('0x3f')]({},_0x100a25,_0xb5c7c1[_0x1a8b('0x43')]);var _0x16540c={'where':_0x100a25[_0x1a8b('0x3e')]};return db['SmsQueue'][_0x1a8b('0x21')](_0x16540c)[_0x1a8b('0x27')](function(_0x1c744d){_0x14b4b9[_0x1a8b('0x21')]=_0x1c744d;if(_0xb5c7c1[_0x1a8b('0x35')][_0x1a8b('0x44')]){_0x100a25[_0x1a8b('0x45')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x100a25);})['then'](function(_0x137e4e){_0x14b4b9[_0x1a8b('0x46')]=_0x137e4e;return _0x14b4b9;})[_0x1a8b('0x27')](respondWithFilteredResult(_0x3f7330,_0x100a25))[_0x1a8b('0x47')](handleError(_0x3f7330,null));};exports[_0x1a8b('0x48')]=function(_0x87a37f,_0x2834b4){var _0x5de0e8={'raw':!![],'where':{'id':_0x87a37f[_0x1a8b('0x49')]['id']}},_0x527569={};_0x527569['model']=_[_0x1a8b('0x36')](db[_0x1a8b('0x31')][_0x1a8b('0x32')]);_0x527569['query']=_[_0x1a8b('0x36')](_0x87a37f['query']);_0x527569[_0x1a8b('0x37')]=_[_0x1a8b('0x38')](_0x527569[_0x1a8b('0x39')],_0x527569[_0x1a8b('0x35')]);_0x5de0e8[_0x1a8b('0x3b')]=_[_0x1a8b('0x38')](_0x527569[_0x1a8b('0x39')],qs[_0x1a8b('0x3a')](_0x87a37f[_0x1a8b('0x35')]['fields']));_0x5de0e8['attributes']=_0x5de0e8['attributes']['length']?_0x5de0e8['attributes']:_0x527569[_0x1a8b('0x39')];if(_0x87a37f[_0x1a8b('0x35')][_0x1a8b('0x44')]){_0x5de0e8['include']=[{'all':!![]}];}_0x5de0e8=_[_0x1a8b('0x3f')]({},_0x5de0e8,_0x87a37f['options']);return db[_0x1a8b('0x31')][_0x1a8b('0x4a')](_0x5de0e8)[_0x1a8b('0x27')](handleEntityNotFound(_0x2834b4,null))[_0x1a8b('0x27')](respondWithResult(_0x2834b4,null))['catch'](handleError(_0x2834b4,null));};exports[_0x1a8b('0x4b')]=function(_0x4b789d,_0x1bbb80){return db['SmsQueue'][_0x1a8b('0x4b')](_0x4b789d[_0x1a8b('0x4c')],{})[_0x1a8b('0x27')](function(_0x1a7cee){var _0x41e31a=_0x4b789d[_0x1a8b('0x4d')][_0x1a8b('0x29')]({'plain':!![]});if(!_0x41e31a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41e31a['role']===_0x1a8b('0x4d')){var _0x3bbcf9=_0x1a7cee[_0x1a8b('0x29')]({'plain':!![]});var _0x35b5c8='SmsQueues';return db[_0x1a8b('0x4e')][_0x1a8b('0x4a')]({'where':{'name':_0x35b5c8,'userProfileId':_0x41e31a[_0x1a8b('0x4f')]},'raw':!![]})['then'](function(_0x352712){if(_0x352712&&_0x352712['autoAssociation']===0x0){return db[_0x1a8b('0x50')][_0x1a8b('0x4b')]({'name':_0x3bbcf9[_0x1a8b('0x2d')],'resourceId':_0x3bbcf9['id'],'type':_0x352712[_0x1a8b('0x2d')],'sectionId':_0x352712['id']},{})[_0x1a8b('0x27')](function(){return _0x1a7cee;});}else{return _0x1a7cee;}})[_0x1a8b('0x47')](function(_0x4ca28d){logger[_0x1a8b('0x2b')](_0x1a8b('0x51'),_0x4ca28d);throw _0x4ca28d;});}return _0x1a7cee;})[_0x1a8b('0x27')](respondWithResult(_0x1bbb80,0xc9))['catch'](handleError(_0x1bbb80,null));};exports[_0x1a8b('0x26')]=function(_0x41b65e,_0x3b039d){if(_0x41b65e[_0x1a8b('0x4c')]['id']){delete _0x41b65e[_0x1a8b('0x4c')]['id'];}return db[_0x1a8b('0x31')][_0x1a8b('0x4a')]({'where':{'id':_0x41b65e[_0x1a8b('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b039d,null))[_0x1a8b('0x27')](saveUpdates(_0x41b65e[_0x1a8b('0x4c')],null))[_0x1a8b('0x27')](respondWithResult(_0x3b039d,null))[_0x1a8b('0x47')](handleError(_0x3b039d,null));};exports[_0x1a8b('0x28')]=function(_0x55558b,_0x491be8){return db[_0x1a8b('0x31')][_0x1a8b('0x4a')]({'where':{'id':_0x55558b[_0x1a8b('0x49')]['id']}})[_0x1a8b('0x27')](handleEntityNotFound(_0x491be8,null))[_0x1a8b('0x27')](removeEntity(_0x491be8,null))[_0x1a8b('0x47')](handleError(_0x491be8,null));};exports['describe']=function(_0x228b6b,_0x411c1d){return db[_0x1a8b('0x31')][_0x1a8b('0x52')]()[_0x1a8b('0x27')](respondWithResult(_0x411c1d,null))[_0x1a8b('0x47')](handleError(_0x411c1d,null));};exports['getMembers']=function(_0x315eaa,_0x58d73c,_0x508e87){var _0x5e3f64={'raw':!![],'where':{}},_0x513cc6={},_0x1db621;return db[_0x1a8b('0x31')][_0x1a8b('0x53')]({'where':{'id':_0x315eaa[_0x1a8b('0x49')]['id']}})['then'](handleEntityNotFound(_0x58d73c,null))['then'](function(_0x4486c3){if(_0x4486c3){_0x1db621=_0x4486c3['get']({'plain':!![]});_0x513cc6[_0x1a8b('0x39')]=_['keys'](db[_0x1a8b('0x54')]['rawAttributes']);_0x513cc6['query']=_[_0x1a8b('0x36')](_0x315eaa['query']);_0x513cc6[_0x1a8b('0x37')]=_[_0x1a8b('0x38')](_0x513cc6[_0x1a8b('0x39')],_0x513cc6[_0x1a8b('0x35')]);_0x5e3f64['attributes']=_[_0x1a8b('0x38')](_0x513cc6[_0x1a8b('0x39')],qs[_0x1a8b('0x3a')](_0x315eaa['query'][_0x1a8b('0x3a')]));_0x5e3f64[_0x1a8b('0x3b')]=_0x5e3f64['attributes'][_0x1a8b('0x55')]?_0x5e3f64['attributes']:_0x513cc6[_0x1a8b('0x39')];if(!_0x315eaa[_0x1a8b('0x35')][_0x1a8b('0x56')](_0x1a8b('0x3c'))){_0x5e3f64[_0x1a8b('0x20')]=qs[_0x1a8b('0x20')](_0x315eaa[_0x1a8b('0x35')][_0x1a8b('0x20')]);_0x5e3f64[_0x1a8b('0x1e')]=qs[_0x1a8b('0x1e')](_0x315eaa[_0x1a8b('0x35')][_0x1a8b('0x1e')]);}_0x5e3f64[_0x1a8b('0x57')]=qs['sort'](_0x315eaa[_0x1a8b('0x35')][_0x1a8b('0x3d')]);_0x5e3f64[_0x1a8b('0x3e')]=qs[_0x1a8b('0x37')](_[_0x1a8b('0x58')](_0x315eaa[_0x1a8b('0x35')],_0x513cc6[_0x1a8b('0x37')]));_0x5e3f64[_0x1a8b('0x3e')][_0x1a8b('0x59')]=_0x4486c3['id'];if(_0x315eaa[_0x1a8b('0x35')][_0x1a8b('0x42')]){_0x5e3f64[_0x1a8b('0x3e')]=_[_0x1a8b('0x3f')](_0x5e3f64['where'],{'$or':_['map'](_0x5e3f64[_0x1a8b('0x3b')],function(_0x5dbd8b){var _0x3ef577={};_0x3ef577[_0x5dbd8b]={'$like':'%'+_0x315eaa[_0x1a8b('0x35')]['filter']+'%'};return _0x3ef577;})});}_0x5e3f64=_[_0x1a8b('0x3f')]({},_0x5e3f64,_0x315eaa['options']);return db[_0x1a8b('0x54')][_0x1a8b('0x5a')](_0x5e3f64);}})[_0x1a8b('0x27')](function(_0x724ffd){if(_0x724ffd){return db[_0x1a8b('0x5b')][_0x1a8b('0x5c')]({'where':{'id':_['map'](_0x724ffd,_0x1a8b('0x5d')),'role':'agent'},'attributes':['id',_0x1a8b('0x2d'),_0x1a8b('0x5e'),_0x1a8b('0x5f'),_0x1a8b('0x60')]});}})[_0x1a8b('0x27')](function(_0x449b2a){if(_0x449b2a){return{'count':_0x449b2a[_0x1a8b('0x21')],'rows':_[_0x1a8b('0x30')](_0x449b2a[_0x1a8b('0x46')],function(_0x5ba7f7){return{'membername':_0x5ba7f7[_0x1a8b('0x2d')],'UserId':_0x5ba7f7['id'],'queue_name':_0x1db621[_0x1a8b('0x2d')],'SmsQueueId':_0x1db621['id'],'interface':util[_0x1a8b('0x61')](_0x1a8b('0x62'),'SIP',_0x5ba7f7[_0x1a8b('0x2d')]),'penalty':0x0,'paused':_0x5ba7f7[_0x1a8b('0x5e')],'createdAt':_0x5ba7f7[_0x1a8b('0x60')],'updatedAt':_0x5ba7f7[_0x1a8b('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a8b('0x27')](respondWithFilteredResult(_0x58d73c,_0x5e3f64))[_0x1a8b('0x47')](handleError(_0x58d73c,null));};exports['getTeams']=function(_0x3acab4,_0x46a13a,_0xa87981){var _0x538283={};var _0x5da092={};var _0x3214ab;var _0x559263;return db['SmsQueue'][_0x1a8b('0x53')]({'where':{'id':_0x3acab4[_0x1a8b('0x49')]['id']}})[_0x1a8b('0x27')](handleEntityNotFound(_0x46a13a,null))[_0x1a8b('0x27')](function(_0x58b276){if(_0x58b276){_0x3214ab=_0x58b276;_0x5da092[_0x1a8b('0x39')]=_[_0x1a8b('0x36')](db[_0x1a8b('0x63')][_0x1a8b('0x32')]);_0x5da092[_0x1a8b('0x35')]=_['keys'](_0x3acab4['query']);_0x5da092['filters']=_[_0x1a8b('0x38')](_0x5da092['model'],_0x5da092[_0x1a8b('0x35')]);_0x538283[_0x1a8b('0x3b')]=_[_0x1a8b('0x38')](_0x5da092['model'],qs[_0x1a8b('0x3a')](_0x3acab4[_0x1a8b('0x35')]['fields']));_0x538283[_0x1a8b('0x3b')]=_0x538283[_0x1a8b('0x3b')][_0x1a8b('0x55')]?_0x538283[_0x1a8b('0x3b')]:_0x5da092[_0x1a8b('0x39')];_0x538283['order']=qs[_0x1a8b('0x3d')](_0x3acab4[_0x1a8b('0x35')][_0x1a8b('0x3d')]);_0x538283[_0x1a8b('0x3e')]=qs[_0x1a8b('0x37')](_['pick'](_0x3acab4[_0x1a8b('0x35')],_0x5da092[_0x1a8b('0x37')]));if(_0x3acab4['query'][_0x1a8b('0x42')]){_0x538283[_0x1a8b('0x3e')]=_[_0x1a8b('0x3f')](_0x538283[_0x1a8b('0x3e')],{'$or':_[_0x1a8b('0x30')](_0x538283[_0x1a8b('0x3b')],function(_0x3a1e1b){var _0x382553={};_0x382553[_0x3a1e1b]={'$like':'%'+_0x3acab4[_0x1a8b('0x35')]['filter']+'%'};return _0x382553;})});}_0x538283=_[_0x1a8b('0x3f')]({},_0x538283,_0x3acab4[_0x1a8b('0x43')]);return _0x3214ab[_0x1a8b('0x64')](_0x538283);}})[_0x1a8b('0x27')](function(_0x587ccb){if(_0x587ccb){_0x559263=_0x587ccb['length'];if(!_0x3acab4['query'][_0x1a8b('0x56')](_0x1a8b('0x3c'))){_0x538283[_0x1a8b('0x20')]=qs[_0x1a8b('0x20')](_0x3acab4[_0x1a8b('0x35')][_0x1a8b('0x20')]);_0x538283[_0x1a8b('0x1e')]=qs[_0x1a8b('0x1e')](_0x3acab4[_0x1a8b('0x35')]['offset']);}return _0x3214ab[_0x1a8b('0x64')](_0x538283);}})['then'](function(_0x4d15f6){if(_0x4d15f6){return _0x4d15f6?{'count':_0x559263,'rows':_0x4d15f6}:null;}})[_0x1a8b('0x27')](respondWithResult(_0x46a13a,null))[_0x1a8b('0x47')](handleError(_0x46a13a,null));};exports['addTeams']=function(_0x5f3401,_0xdbe2fd,_0x18a0f7){var _0x557f29=_0x5f3401['body'][_0x1a8b('0x65')];return db['Team'][_0x1a8b('0x5a')]({'where':{'id':_0x557f29},'attributes':['id'],'include':[{'model':db[_0x1a8b('0x5b')],'as':_0x1a8b('0x66'),'attributes':['id',_0x1a8b('0x2d'),'online',_0x1a8b('0x67'),'interface'],'raw':!![]}]})[_0x1a8b('0x27')](function(_0x5a1e0a){if(_0x5a1e0a){var _0x168d61=_[_0x1a8b('0x68')](_0x5a1e0a,function(_0x3afdbd){var _0x3775a0=_0x3afdbd[_0x1a8b('0x29')]({'plain':!![]});return _0x3775a0[_0x1a8b('0x66')];});return db[_0x1a8b('0x31')][_0x1a8b('0x4a')]({'where':{'id':_0x5f3401['params']['id']}})[_0x1a8b('0x27')](function(_0x51e757){return db[_0x1a8b('0x69')]['transaction'](function(_0x417b11){return _0x51e757['addTeams'](_0x557f29,{'transaction':_0x417b11})[_0x1a8b('0x27')](function(){return BPromise[_0x1a8b('0x6a')](_0x168d61,function(_0x5bcc4e){return db[_0x1a8b('0x54')][_0x1a8b('0x6b')]({'where':{'UserId':_0x5bcc4e['id'],'SmsQueueId':_0x5f3401['params']['id']},'transaction':_0x417b11});});})['then'](function(){_0x168d61['forEach'](function(_0x4de264){socket[_0x1a8b('0x6c')]('userSmsQueue:save',{'UserId':_0x4de264['id'],'SmsQueueId':_0x51e757['id']});});});});});}})[_0x1a8b('0x27')](respondWithStatusCode(_0xdbe2fd,null))['catch'](handleError(_0xdbe2fd,null));};exports[_0x1a8b('0x6d')]=function(_0x45c8ca,_0x36e109,_0x1516ab){return db['Team'][_0x1a8b('0x5a')]({'where':{'id':_0x45c8ca[_0x1a8b('0x35')][_0x1a8b('0x65')]},'attributes':['id'],'include':[{'model':db[_0x1a8b('0x5b')],'as':_0x1a8b('0x66'),'attributes':['id'],'raw':!![]}]})[_0x1a8b('0x27')](handleEntityNotFound(_0x36e109,null))['then'](function(_0x19d9fe){var _0x4018b3=_[_0x1a8b('0x30')](_0x19d9fe,'id');var _0x1b7116=[];var _0x249778=[];var _0x1476a5=squel[_0x1a8b('0x6e')]();_0x1476a5[_0x1a8b('0x6f')]('tq.TeamId')[_0x1a8b('0x70')]('team_has_sms_queues','tq')[_0x1a8b('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1a8b('0x3e')]('SmsQueueId\x20=\x20?',_0x45c8ca[_0x1a8b('0x49')]['id']);for(var _0x133f93=0x0;_0x133f93<_0x19d9fe[_0x1a8b('0x55')];_0x133f93+=0x1){let _0x104cd5=_0x19d9fe[_0x133f93];for(var _0x1688ba=0x0;_0x1688ba<_0x104cd5['Agents'][_0x1a8b('0x55')];_0x1688ba+=0x1){let _0x3a89aa=_0x104cd5['Agents'][_0x1688ba];var _0x14cd36=_0x1476a5['clone']();_0x14cd36['where']('ut.UserId\x20=\x20?',_0x3a89aa['id']);_0x249778[_0x1a8b('0x72')](db[_0x1a8b('0x69')][_0x1a8b('0x35')](_0x14cd36['toString'](),{'type':db['sequelize'][_0x1a8b('0x73')]['SELECT']})[_0x1a8b('0x27')](function(_0x13bfd7){if(_0x13bfd7['length']===0x1){return _0x3a89aa['id'];}else{var _0x45cd07=_[_0x1a8b('0x74')](_[_0x1a8b('0x30')](_0x13bfd7,'TeamId'),function(_0x3b47ce){return _[_0x1a8b('0x75')](_0x4018b3,_0x3b47ce);});if(_0x45cd07){return _0x3a89aa['id'];}}}));}}return BPromise[_0x1a8b('0x76')](_0x249778)[_0x1a8b('0x27')](function(_0x16bd83){_0x1b7116=_(_0x1b7116)[_0x1a8b('0x77')](_0x16bd83)[_0x1a8b('0x78')]()[_0x1a8b('0x79')]();return db['SmsQueue'][_0x1a8b('0x4a')]({'where':{'id':_0x45c8ca['params']['id']}})['then'](function(_0x41e06c){return db[_0x1a8b('0x69')][_0x1a8b('0x7a')](function(_0x696a6f){return _0x41e06c['removeTeams'](_0x45c8ca[_0x1a8b('0x35')]['ids'],{'transaction':_0x696a6f})[_0x1a8b('0x27')](function(){if(!_[_0x1a8b('0x7b')](_0x1b7116)){return _0x41e06c[_0x1a8b('0x7c')](_0x1b7116,{'transaction':_0x696a6f});}})[_0x1a8b('0x27')](function(){_0x1b7116[_0x1a8b('0x7d')](function(_0x524f37){socket[_0x1a8b('0x6c')](_0x1a8b('0x7e'),{'UserId':_0x524f37,'SmsQueueId':_0x41e06c['id']});});});});});});})[_0x1a8b('0x27')](respondWithStatusCode(_0x36e109,null))[_0x1a8b('0x47')](handleError(_0x36e109,null));};exports[_0x1a8b('0x7f')]=function(_0x1ad583,_0x44c580,_0x55e96f){return db[_0x1a8b('0x31')][_0x1a8b('0x4a')]({'where':{'id':_0x1ad583[_0x1a8b('0x49')]['id']}})[_0x1a8b('0x27')](handleEntityNotFound(_0x44c580,null))['then'](function(_0x2d0a85){if(_0x2d0a85){return _0x2d0a85[_0x1a8b('0x7f')](_0x1ad583[_0x1a8b('0x4c')][_0x1a8b('0x65')],_['omit'](_0x1ad583[_0x1a8b('0x4c')],[_0x1a8b('0x65'),'id'])||{})[_0x1a8b('0x80')](function(_0x5afab2){for(var _0x252f48=0x0;_0x252f48<_0x1ad583[_0x1a8b('0x4c')][_0x1a8b('0x65')][_0x1a8b('0x55')];_0x252f48+=0x1){socket[_0x1a8b('0x6c')](_0x1a8b('0x81'),{'UserId':Number(_0x1ad583[_0x1a8b('0x4c')][_0x1a8b('0x65')][_0x252f48]),'SmsQueueId':Number(_0x1ad583[_0x1a8b('0x49')]['id'])});}return _0x5afab2;});}})[_0x1a8b('0x27')](respondWithResult(_0x44c580,null))['catch'](handleError(_0x44c580,null));};exports['removeAgents']=function(_0x10da35,_0x5c9e7a,_0x321d62){return db['SmsQueue'][_0x1a8b('0x4a')]({'where':{'id':_0x10da35[_0x1a8b('0x49')]['id']}})[_0x1a8b('0x27')](handleEntityNotFound(_0x5c9e7a,null))['then'](function(_0x45d178){if(_0x45d178){return _0x45d178['removeAgents'](_0x10da35['query'][_0x1a8b('0x65')])[_0x1a8b('0x27')](function(){if(_[_0x1a8b('0x82')](_0x10da35[_0x1a8b('0x35')][_0x1a8b('0x65')])){for(var _0x5a53c1=0x0;_0x5a53c1<_0x10da35['query'][_0x1a8b('0x65')][_0x1a8b('0x55')];_0x5a53c1+=0x1){socket[_0x1a8b('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0x10da35[_0x1a8b('0x35')][_0x1a8b('0x65')][_0x5a53c1]),'SmsQueueId':Number(_0x10da35[_0x1a8b('0x49')]['id'])});}}else{socket[_0x1a8b('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0x10da35[_0x1a8b('0x35')][_0x1a8b('0x65')]),'SmsQueueId':Number(_0x10da35[_0x1a8b('0x49')]['id'])});}});}})[_0x1a8b('0x27')](respondWithStatusCode(_0x5c9e7a,null))[_0x1a8b('0x47')](handleError(_0x5c9e7a,null));};exports['getAgents']=function(_0x402e78,_0x393eb0,_0x28d58d){var _0x58c202={};var _0x1588fb={};var _0x539082;var _0xa77645;return db[_0x1a8b('0x31')]['findOne']({'where':{'id':_0x402e78[_0x1a8b('0x49')]['id']}})[_0x1a8b('0x27')](handleEntityNotFound(_0x393eb0,null))[_0x1a8b('0x27')](function(_0x347cf1){if(_0x347cf1){_0x539082=_0x347cf1;_0x1588fb[_0x1a8b('0x39')]=_[_0x1a8b('0x36')](db['User']['rawAttributes']);_0x1588fb[_0x1a8b('0x35')]=_[_0x1a8b('0x36')](_0x402e78[_0x1a8b('0x35')]);_0x1588fb[_0x1a8b('0x37')]=_[_0x1a8b('0x38')](_0x1588fb['model'],_0x1588fb[_0x1a8b('0x35')]);_0x58c202['attributes']=_[_0x1a8b('0x38')](_0x1588fb[_0x1a8b('0x39')],qs[_0x1a8b('0x3a')](_0x402e78[_0x1a8b('0x35')][_0x1a8b('0x3a')]));_0x58c202[_0x1a8b('0x3b')]=_0x58c202[_0x1a8b('0x3b')][_0x1a8b('0x55')]?_0x58c202[_0x1a8b('0x3b')]:_0x1588fb[_0x1a8b('0x39')];_0x58c202[_0x1a8b('0x57')]=qs[_0x1a8b('0x3d')](_0x402e78[_0x1a8b('0x35')][_0x1a8b('0x3d')]);_0x58c202[_0x1a8b('0x3e')]=qs[_0x1a8b('0x37')](_[_0x1a8b('0x58')](_0x402e78[_0x1a8b('0x35')],_0x1588fb[_0x1a8b('0x37')]));if(_0x402e78[_0x1a8b('0x35')][_0x1a8b('0x42')]){_0x58c202[_0x1a8b('0x3e')]=_[_0x1a8b('0x3f')](_0x58c202[_0x1a8b('0x3e')],{'$or':_[_0x1a8b('0x30')](_0x58c202[_0x1a8b('0x3b')],function(_0x2f0f82){var _0x4f6064={};_0x4f6064[_0x2f0f82]={'$like':'%'+_0x402e78[_0x1a8b('0x35')][_0x1a8b('0x42')]+'%'};return _0x4f6064;})});}_0x58c202=_[_0x1a8b('0x3f')]({},_0x58c202,_0x402e78[_0x1a8b('0x43')]);return _0x539082[_0x1a8b('0x83')](_0x58c202);}})[_0x1a8b('0x27')](function(_0x17d59c){if(_0x17d59c){_0xa77645=_0x17d59c['length'];if(!_0x402e78[_0x1a8b('0x35')][_0x1a8b('0x56')](_0x1a8b('0x3c'))){_0x58c202['limit']=qs[_0x1a8b('0x20')](_0x402e78[_0x1a8b('0x35')][_0x1a8b('0x20')]);_0x58c202[_0x1a8b('0x1e')]=qs[_0x1a8b('0x1e')](_0x402e78[_0x1a8b('0x35')][_0x1a8b('0x1e')]);}return _0x539082['getAgents'](_0x58c202);}})[_0x1a8b('0x27')](function(_0xeec598){if(_0xeec598){return _0xeec598?{'count':_0xa77645,'rows':_0xeec598}:null;}})[_0x1a8b('0x27')](respondWithResult(_0x393eb0,null))[_0x1a8b('0x47')](handleError(_0x393eb0,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 57d3c41..93346a6 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 _0xaeb1=['hasOwnProperty','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x23c23c,_0x5ee1ff){var _0xf99e32=function(_0x16c73f){while(--_0x16c73f){_0x23c23c['push'](_0x23c23c['shift']());}};_0xf99e32(++_0x5ee1ff);}(_0xaeb1,0x1e2));var _0x1aeb=function(_0x23a1f6,_0x3d615b){_0x23a1f6=_0x23a1f6-0x0;var _0x3c42a9=_0xaeb1[_0x23a1f6];return _0x3c42a9;};'use strict';var EventEmitter=require(_0x1aeb('0x0'));var SmsQueue=require(_0x1aeb('0x1'))['db'][_0x1aeb('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1aeb('0x3')](0x0);var events={'afterCreate':_0x1aeb('0x4'),'afterUpdate':_0x1aeb('0x5'),'afterDestroy':_0x1aeb('0x6')};function emitEvent(_0x1f0ef5){return function(_0xf7c5d3,_0x1f853d,_0x51ab9d){SmsQueueEvents[_0x1aeb('0x7')](_0x1f0ef5+':'+_0xf7c5d3['id'],_0xf7c5d3);SmsQueueEvents[_0x1aeb('0x7')](_0x1f0ef5,_0xf7c5d3);_0x51ab9d(null);};}for(var e in events){if(events[_0x1aeb('0x8')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x1aeb('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x509c=['../../mysqldb','setMaxListeners','remove','emit','hook','events'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x509c,0x167));var _0xc509=function(_0x339382,_0x27de89){_0x339382=_0x339382-0x0;var _0x19b5c6=_0x509c[_0x339382];return _0x19b5c6;};'use strict';var EventEmitter=require(_0xc509('0x0'));var SmsQueue=require(_0xc509('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc509('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc509('0x3')};function emitEvent(_0x246b75){return function(_0x30b089,_0x328353,_0x46ff19){SmsQueueEvents[_0xc509('0x4')](_0x246b75+':'+_0x30b089['id'],_0x30b089);SmsQueueEvents[_0xc509('0x4')](_0x246b75,_0x30b089);_0x46ff19(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xc509('0x5')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index a3b1458..6f47904 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 _0x637d=['SmsQueue','lodash','moment','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0x5c63dd,_0x47fe21){var _0xd44abd=function(_0x204fc5){while(--_0x204fc5){_0x5c63dd['push'](_0x5c63dd['shift']());}};_0xd44abd(++_0x47fe21);}(_0x637d,0xcc));var _0xd637=function(_0x4e5db4,_0x5305e8){_0x4e5db4=_0x4e5db4-0x0;var _0x4dfc45=_0x637d[_0x4e5db4];return _0x4dfc45;};'use strict';var _=require(_0xd637('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd637('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd637('0x2'));var config=require(_0xd637('0x3'));var attributes=require(_0xd637('0x4'));module[_0xd637('0x5')]=function(_0x3e8845,_0x28c8a2){return _0x3e8845['define'](_0xd637('0x6'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9bf=['moment','bluebird','request-promise','../../config/environment','exports','SmsQueue','lodash','../../config/logger','api'];(function(_0x4edab2,_0x5a7ba5){var _0x5094ea=function(_0x23cda4){while(--_0x23cda4){_0x4edab2['push'](_0x4edab2['shift']());}};_0x5094ea(++_0x5a7ba5);}(_0xa9bf,0x8d));var _0xfa9b=function(_0x23b2cd,_0x3b894d){_0x23b2cd=_0x23b2cd-0x0;var _0x28aa68=_0xa9bf[_0x23b2cd];return _0x28aa68;};'use strict';var _=require(_0xfa9b('0x0'));var util=require('util');var logger=require(_0xfa9b('0x1'))(_0xfa9b('0x2'));var moment=require(_0xfa9b('0x3'));var BPromise=require(_0xfa9b('0x4'));var rp=require(_0xfa9b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfa9b('0x6'));var attributes=require('./smsQueue.attributes');module[_0xfa9b('0x7')]=function(_0x99747b,_0x17ebe0){return _0x99747b['define'](_0xfa9b('0x8'),attributes,{'tableName':'sms_queues','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 7318014..9a5af48 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 _0xe139=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','findAll','options','raw','attributes','limit','include','map','model','ShowSmsQueue','find','lodash','util'];(function(_0x4f92ce,_0x23dc6e){var _0x9ae8f=function(_0x3763d5){while(--_0x3763d5){_0x4f92ce['push'](_0x4f92ce['shift']());}};_0x9ae8f(++_0x23dc6e);}(_0xe139,0x198));var _0x9e13=function(_0x2697ce,_0x184174){_0x2697ce=_0x2697ce-0x0;var _0x1c9f08=_0xe139[_0x2697ce];return _0x1c9f08;};'use strict';var _=require(_0x9e13('0x0'));var util=require(_0x9e13('0x1'));var moment=require(_0x9e13('0x2'));var BPromise=require(_0x9e13('0x3'));var rs=require(_0x9e13('0x4'));var fs=require('fs');var Redis=require(_0x9e13('0x5'));var db=require(_0x9e13('0x6'))['db'];var utils=require(_0x9e13('0x7'));var logger=require(_0x9e13('0x8'))(_0x9e13('0x9'));var config=require(_0x9e13('0xa'));var jayson=require(_0x9e13('0xb'));var client=jayson[_0x9e13('0xc')][_0x9e13('0xd')]({'port':0x232a});config[_0x9e13('0xe')]=_['defaults'](config[_0x9e13('0xe')],{'host':_0x9e13('0xf'),'port':0x18eb});var socket=require(_0x9e13('0x10'))(new Redis(config[_0x9e13('0xe')]));require(_0x9e13('0x11'))['register'](socket);function respondWithRpcPromise(_0x24e00f,_0x1350d9,_0x1f7297){return new BPromise(function(_0x144e1d,_0x2fa2cc){return client[_0x9e13('0x12')](_0x24e00f,_0x1f7297)[_0x9e13('0x13')](function(_0x1e8de8){logger[_0x9e13('0x14')](_0x9e13('0x15'),_0x1350d9,_0x9e13('0x16'));logger[_0x9e13('0x17')](_0x9e13('0x18'),_0x1350d9,_0x9e13('0x16'),JSON[_0x9e13('0x19')](_0x1e8de8));if(_0x1e8de8[_0x9e13('0x1a')]){if(_0x1e8de8[_0x9e13('0x1a')]['code']===0x1f4){logger['error'](_0x9e13('0x15'),_0x1350d9,_0x1e8de8[_0x9e13('0x1a')]['message']);return _0x2fa2cc(_0x1e8de8['error'][_0x9e13('0x1b')]);}logger[_0x9e13('0x1a')](_0x9e13('0x15'),_0x1350d9,_0x1e8de8['error']['message']);return _0x144e1d(_0x1e8de8[_0x9e13('0x1a')]['message']);}else{logger[_0x9e13('0x14')]('SmsQueue,\x20%s,\x20%s',_0x1350d9,_0x9e13('0x16'));_0x144e1d(_0x1e8de8[_0x9e13('0x1c')][_0x9e13('0x1b')]);}})[_0x9e13('0x1d')](function(_0x1a5979){logger[_0x9e13('0x1a')](_0x9e13('0x15'),_0x1350d9,_0x1a5979);_0x2fa2cc(_0x1a5979);});});}exports[_0x9e13('0x1e')]=function(_0x105185){var _0x2a8eef=this;return new Promise(function(_0x33aa99,_0x7ce513){return db['SmsQueue'][_0x9e13('0x1f')]({'raw':_0x105185[_0x9e13('0x20')]?_0x105185[_0x9e13('0x20')][_0x9e13('0x21')]===undefined?!![]:![]:!![],'where':_0x105185[_0x9e13('0x20')]?_0x105185['options']['where']||null:null,'attributes':_0x105185[_0x9e13('0x20')]?_0x105185[_0x9e13('0x20')][_0x9e13('0x22')]||null:null,'limit':_0x105185[_0x9e13('0x20')]?_0x105185['options'][_0x9e13('0x23')]||null:null,'include':_0x105185[_0x9e13('0x20')]?_0x105185[_0x9e13('0x20')][_0x9e13('0x24')]?_[_0x9e13('0x25')](_0x105185[_0x9e13('0x20')][_0x9e13('0x24')],function(_0x191a1a){return{'model':db[_0x191a1a[_0x9e13('0x26')]],'as':_0x191a1a['as'],'attributes':_0x191a1a['attributes'],'include':_0x191a1a['include']?_[_0x9e13('0x25')](_0x191a1a[_0x9e13('0x24')],function(_0x429786){return{'model':db[_0x429786['model']],'as':_0x429786['as'],'attributes':_0x429786['attributes'],'include':_0x429786[_0x9e13('0x24')]?_[_0x9e13('0x25')](_0x429786[_0x9e13('0x24')],function(_0x1e9ce8){return{'model':db[_0x1e9ce8[_0x9e13('0x26')]],'as':_0x1e9ce8['as'],'attributes':_0x1e9ce8[_0x9e13('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x506192){logger[_0x9e13('0x14')](_0x9e13('0x1e'),_0x105185);logger[_0x9e13('0x17')](_0x9e13('0x1e'),_0x105185,JSON[_0x9e13('0x19')](_0x506192));_0x33aa99(_0x506192);})[_0x9e13('0x1d')](function(_0x2e129b){logger[_0x9e13('0x1a')](_0x9e13('0x1e'),_0x2e129b['message'],_0x105185);_0x7ce513(_0x2a8eef[_0x9e13('0x1a')](0x1f4,_0x2e129b[_0x9e13('0x1b')]));});});};exports[_0x9e13('0x27')]=function(_0x4cf8db){var _0xfd04f4=this;return new Promise(function(_0x4afa1f,_0x3f64e2){return db['SmsQueue'][_0x9e13('0x28')]({'raw':_0x4cf8db[_0x9e13('0x20')]?_0x4cf8db[_0x9e13('0x20')][_0x9e13('0x21')]===undefined?!![]:![]:!![],'where':_0x4cf8db[_0x9e13('0x20')]?_0x4cf8db[_0x9e13('0x20')]['where']||null:null,'attributes':_0x4cf8db['options']?_0x4cf8db[_0x9e13('0x20')][_0x9e13('0x22')]||null:null,'include':_0x4cf8db['options']?_0x4cf8db['options'][_0x9e13('0x24')]?_[_0x9e13('0x25')](_0x4cf8db[_0x9e13('0x20')]['include'],function(_0x301822){return{'model':db[_0x301822['model']],'as':_0x301822['as'],'attributes':_0x301822[_0x9e13('0x22')],'include':_0x301822[_0x9e13('0x24')]?_['map'](_0x301822[_0x9e13('0x24')],function(_0x20f404){return{'model':db[_0x20f404[_0x9e13('0x26')]],'as':_0x20f404['as'],'attributes':_0x20f404['attributes'],'include':_0x20f404[_0x9e13('0x24')]?_['map'](_0x20f404[_0x9e13('0x24')],function(_0x1dc94e){return{'model':db[_0x1dc94e[_0x9e13('0x26')]],'as':_0x1dc94e['as'],'attributes':_0x1dc94e[_0x9e13('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41c45b){logger[_0x9e13('0x14')](_0x9e13('0x27'),_0x4cf8db);logger[_0x9e13('0x17')](_0x9e13('0x27'),_0x4cf8db,JSON[_0x9e13('0x19')](_0x41c45b));_0x4afa1f(_0x41c45b);})['catch'](function(_0x1b5611){logger[_0x9e13('0x1a')]('ShowSmsQueue',_0x1b5611[_0x9e13('0x1b')],_0x4cf8db);_0x3f64e2(_0xfd04f4[_0x9e13('0x1a')](0x1f4,_0x1b5611[_0x9e13('0x1b')]));});});}; \ No newline at end of file +var _0x49ba=['find','ShowSmsQueue','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetSmsQueue','SmsQueue','options','raw','where','limit','include','map','model','attributes','catch'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0x49ba,0x11b));var _0xa49b=function(_0xcbca12,_0x1294f2){_0xcbca12=_0xcbca12-0x0;var _0x4b9f31=_0x49ba[_0xcbca12];return _0x4b9f31;};'use strict';var _=require(_0xa49b('0x0'));var util=require(_0xa49b('0x1'));var moment=require(_0xa49b('0x2'));var BPromise=require(_0xa49b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa49b('0x4'));var db=require(_0xa49b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa49b('0x6'))(_0xa49b('0x7'));var config=require(_0xa49b('0x8'));var jayson=require(_0xa49b('0x9'));var client=jayson[_0xa49b('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa49b('0xb')](config[_0xa49b('0xc')],{'host':_0xa49b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa49b('0xc')]));require(_0xa49b('0xe'))[_0xa49b('0xf')](socket);function respondWithRpcPromise(_0x122f1e,_0x1568af,_0x352b24){return new BPromise(function(_0x2b4f70,_0x499afa){return client['request'](_0x122f1e,_0x352b24)[_0xa49b('0x10')](function(_0x132c61){logger[_0xa49b('0x11')](_0xa49b('0x12'),_0x1568af,_0xa49b('0x13'));logger[_0xa49b('0x14')](_0xa49b('0x15'),_0x1568af,_0xa49b('0x13'),JSON['stringify'](_0x132c61));if(_0x132c61[_0xa49b('0x16')]){if(_0x132c61[_0xa49b('0x16')][_0xa49b('0x17')]===0x1f4){logger[_0xa49b('0x16')](_0xa49b('0x12'),_0x1568af,_0x132c61[_0xa49b('0x16')][_0xa49b('0x18')]);return _0x499afa(_0x132c61[_0xa49b('0x16')][_0xa49b('0x18')]);}logger[_0xa49b('0x16')](_0xa49b('0x12'),_0x1568af,_0x132c61['error'][_0xa49b('0x18')]);return _0x2b4f70(_0x132c61['error']['message']);}else{logger['info'](_0xa49b('0x12'),_0x1568af,_0xa49b('0x13'));_0x2b4f70(_0x132c61[_0xa49b('0x19')]['message']);}})['catch'](function(_0x454025){logger[_0xa49b('0x16')](_0xa49b('0x12'),_0x1568af,_0x454025);_0x499afa(_0x454025);});});}exports[_0xa49b('0x1a')]=function(_0x59bcb8){var _0x19049b=this;return new Promise(function(_0x2c26c8,_0x2c02ab){return db[_0xa49b('0x1b')]['findAll']({'raw':_0x59bcb8[_0xa49b('0x1c')]?_0x59bcb8[_0xa49b('0x1c')][_0xa49b('0x1d')]===undefined?!![]:![]:!![],'where':_0x59bcb8[_0xa49b('0x1c')]?_0x59bcb8[_0xa49b('0x1c')][_0xa49b('0x1e')]||null:null,'attributes':_0x59bcb8[_0xa49b('0x1c')]?_0x59bcb8[_0xa49b('0x1c')]['attributes']||null:null,'limit':_0x59bcb8['options']?_0x59bcb8[_0xa49b('0x1c')][_0xa49b('0x1f')]||null:null,'include':_0x59bcb8[_0xa49b('0x1c')]?_0x59bcb8[_0xa49b('0x1c')][_0xa49b('0x20')]?_[_0xa49b('0x21')](_0x59bcb8['options'][_0xa49b('0x20')],function(_0x468068){return{'model':db[_0x468068[_0xa49b('0x22')]],'as':_0x468068['as'],'attributes':_0x468068[_0xa49b('0x23')],'include':_0x468068['include']?_[_0xa49b('0x21')](_0x468068[_0xa49b('0x20')],function(_0x5e29ec){return{'model':db[_0x5e29ec[_0xa49b('0x22')]],'as':_0x5e29ec['as'],'attributes':_0x5e29ec[_0xa49b('0x23')],'include':_0x5e29ec['include']?_[_0xa49b('0x21')](_0x5e29ec[_0xa49b('0x20')],function(_0x4e2681){return{'model':db[_0x4e2681[_0xa49b('0x22')]],'as':_0x4e2681['as'],'attributes':_0x4e2681[_0xa49b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27403f){logger[_0xa49b('0x11')]('GetSmsQueue',_0x59bcb8);logger[_0xa49b('0x14')](_0xa49b('0x1a'),_0x59bcb8,JSON['stringify'](_0x27403f));_0x2c26c8(_0x27403f);})[_0xa49b('0x24')](function(_0x4d7b1e){logger[_0xa49b('0x16')]('GetSmsQueue',_0x4d7b1e['message'],_0x59bcb8);_0x2c02ab(_0x19049b[_0xa49b('0x16')](0x1f4,_0x4d7b1e['message']));});});};exports['ShowSmsQueue']=function(_0x3e09c8){var _0x510c2c=this;return new Promise(function(_0x543004,_0x2dd545){return db['SmsQueue'][_0xa49b('0x25')]({'raw':_0x3e09c8['options']?_0x3e09c8[_0xa49b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3e09c8[_0xa49b('0x1c')]?_0x3e09c8[_0xa49b('0x1c')]['where']||null:null,'attributes':_0x3e09c8[_0xa49b('0x1c')]?_0x3e09c8['options'][_0xa49b('0x23')]||null:null,'include':_0x3e09c8[_0xa49b('0x1c')]?_0x3e09c8['options']['include']?_[_0xa49b('0x21')](_0x3e09c8[_0xa49b('0x1c')][_0xa49b('0x20')],function(_0x33fc0e){return{'model':db[_0x33fc0e[_0xa49b('0x22')]],'as':_0x33fc0e['as'],'attributes':_0x33fc0e['attributes'],'include':_0x33fc0e[_0xa49b('0x20')]?_[_0xa49b('0x21')](_0x33fc0e[_0xa49b('0x20')],function(_0xee2b1){return{'model':db[_0xee2b1['model']],'as':_0xee2b1['as'],'attributes':_0xee2b1[_0xa49b('0x23')],'include':_0xee2b1[_0xa49b('0x20')]?_[_0xa49b('0x21')](_0xee2b1[_0xa49b('0x20')],function(_0x495530){return{'model':db[_0x495530[_0xa49b('0x22')]],'as':_0x495530['as'],'attributes':_0x495530[_0xa49b('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa49b('0x10')](function(_0x1d6b5d){logger[_0xa49b('0x11')](_0xa49b('0x26'),_0x3e09c8);logger[_0xa49b('0x14')](_0xa49b('0x26'),_0x3e09c8,JSON[_0xa49b('0x27')](_0x1d6b5d));_0x543004(_0x1d6b5d);})[_0xa49b('0x24')](function(_0x5645ca){logger[_0xa49b('0x16')](_0xa49b('0x26'),_0x5645ca['message'],_0x3e09c8);_0x2dd545(_0x510c2c[_0xa49b('0x16')](0x1f4,_0x5645ca[_0xa49b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index b31ab8f..b6afe06 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 _0xb71d=['length','save','remove','removeListener'];(function(_0x2f9a98,_0x206f96){var _0x2d7280=function(_0x3be447){while(--_0x3be447){_0x2f9a98['push'](_0x2f9a98['shift']());}};_0x2d7280(++_0x206f96);}(_0xb71d,0xe9));var _0xdb71=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb71d[_0xfae23b];return _0x200640;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xdb71('0x0'),_0xdb71('0x1'),'update'];function createListener(_0x1ba93a,_0x1b96e1){return function(_0x34a67a){_0x1b96e1['emit'](_0x1ba93a,_0x34a67a);};}function removeListener(_0x3be372,_0x2609b8){return function(){SmsQueueEvents[_0xdb71('0x2')](_0x3be372,_0x2609b8);};}exports['register']=function(_0x4007b4){for(var _0x27e43c=0x0,_0x1aa185=events[_0xdb71('0x3')];_0x27e43c<_0x1aa185;_0x27e43c++){var _0x200b75=events[_0x27e43c];var _0x3f47ae=createListener('smsQueue:'+_0x200b75,_0x4007b4);SmsQueueEvents['on'](_0x200b75,_0x3f47ae);}}; \ No newline at end of file +var _0x2e66=['smsQueue:','./smsQueue.events','save','remove','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2e66,0xf6));var _0x62e6=function(_0x4a62bb,_0x3bf277){_0x4a62bb=_0x4a62bb-0x0;var _0x2d1adc=_0x2e66[_0x4a62bb];return _0x2d1adc;};'use strict';var SmsQueueEvents=require(_0x62e6('0x0'));var events=[_0x62e6('0x1'),_0x62e6('0x2'),'update'];function createListener(_0x302f4b,_0xf023b7){return function(_0x4d8381){_0xf023b7[_0x62e6('0x3')](_0x302f4b,_0x4d8381);};}function removeListener(_0x57dc36,_0x35e52f){return function(){SmsQueueEvents['removeListener'](_0x57dc36,_0x35e52f);};}exports['register']=function(_0x1d93f1){for(var _0x5df8f3=0x0,_0x4a9f5c=events['length'];_0x5df8f3<_0x4a9f5c;_0x5df8f3++){var _0xd43572=events[_0x5df8f3];var _0x592328=createListener(_0x62e6('0x4')+_0xd43572,_0x1d93f1);SmsQueueEvents['on'](_0xd43572,_0x592328);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 9a89ef7..801efca 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 _0xe953=['fs-extra','../../components/interaction/service','./smsQueueReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','delete','destroy','exports','Router'];(function(_0x422130,_0x3af22c){var _0x34a79e=function(_0x5ef389){while(--_0x5ef389){_0x422130['push'](_0x422130['shift']());}};_0x34a79e(++_0x3af22c);}(_0xe953,0x1d0));var _0x3e95=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0xe953[_0x5eaa0b];return _0x28b295;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3e95('0x0')]();var fs_extra=require(_0x3e95('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x3e95('0x2'));var config=require('../../config/environment');var controller=require(_0x3e95('0x3'));router['get']('/',auth[_0x3e95('0x4')](),controller[_0x3e95('0x5')]);router[_0x3e95('0x6')](_0x3e95('0x7'),auth[_0x3e95('0x4')](),controller['describe']);router[_0x3e95('0x6')](_0x3e95('0x8'),auth[_0x3e95('0x4')](),controller['show']);router[_0x3e95('0x9')]('/',auth[_0x3e95('0x4')](),controller[_0x3e95('0xa')]);router[_0x3e95('0xb')]('/:id',auth[_0x3e95('0x4')](),controller['update']);router[_0x3e95('0xc')](_0x3e95('0x8'),auth[_0x3e95('0x4')](),controller[_0x3e95('0xd')]);module[_0x3e95('0xe')]=router; \ No newline at end of file +var _0xeebc=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0xeebc,0x6f));var _0xceeb=function(_0x30cf65,_0x4a76ca){_0x30cf65=_0x30cf65-0x0;var _0x9940a4=_0xeebc[_0x30cf65];return _0x9940a4;};'use strict';var multer=require(_0xceeb('0x0'));var util=require(_0xceeb('0x1'));var path=require(_0xceeb('0x2'));var timeout=require(_0xceeb('0x3'));var express=require('express');var router=express[_0xceeb('0x4')]();var fs_extra=require(_0xceeb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xceeb('0x6'));var config=require(_0xceeb('0x7'));var controller=require('./smsQueueReport.controller');router[_0xceeb('0x8')]('/',auth[_0xceeb('0x9')](),controller[_0xceeb('0xa')]);router['get']('/describe',auth[_0xceeb('0x9')](),controller['describe']);router[_0xceeb('0x8')]('/:id',auth[_0xceeb('0x9')](),controller[_0xceeb('0xb')]);router[_0xceeb('0xc')]('/',auth[_0xceeb('0x9')](),controller[_0xceeb('0xd')]);router['put'](_0xceeb('0xe'),auth[_0xceeb('0x9')](),controller[_0xceeb('0xf')]);router[_0xceeb('0x10')](_0xceeb('0xe'),auth[_0xceeb('0x9')](),controller[_0xceeb('0x11')]);module[_0xceeb('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index a0cb055..9b2a5f8 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 _0x12f1=['DATE','moment','exports','STRING'];(function(_0x3f8d39,_0x57f2a7){var _0x30bf45=function(_0x4aa292){while(--_0x4aa292){_0x3f8d39['push'](_0x3f8d39['shift']());}};_0x30bf45(++_0x57f2a7);}(_0x12f1,0x151));var _0x112f=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x12f1[_0xc8db6b];return _0x12cb81;};'use strict';var moment=require(_0x112f('0x0'));var Sequelize=require('sequelize');module[_0x112f('0x1')]={'uniqueid':{'type':Sequelize[_0x112f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x112f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x112f('0x3')]},'acceptAt':{'type':Sequelize[_0x112f('0x3')]},'exitAt':{'type':Sequelize[_0x112f('0x3')]},'reason':{'type':Sequelize[_0x112f('0x2')]}}; \ No newline at end of file +var _0xc701=['moment','sequelize','exports','STRING','DATE'];(function(_0x793c1e,_0x5b94de){var _0xa07cf7=function(_0x377188){while(--_0x377188){_0x793c1e['push'](_0x793c1e['shift']());}};_0xa07cf7(++_0x5b94de);}(_0xc701,0x82));var _0x1c70=function(_0x5b2a15,_0xd200ec){_0x5b2a15=_0x5b2a15-0x0;var _0x33038d=_0xc701[_0x5b2a15];return _0x33038d;};'use strict';var moment=require(_0x1c70('0x0'));var Sequelize=require(_0x1c70('0x1'));module[_0x1c70('0x2')]={'uniqueid':{'type':Sequelize[_0x1c70('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1c70('0x3')]},'joinAt':{'type':Sequelize[_0x1c70('0x4')]},'leaveAt':{'type':Sequelize[_0x1c70('0x4')]},'acceptAt':{'type':Sequelize[_0x1c70('0x4')]},'exitAt':{'type':Sequelize[_0x1c70('0x4')]},'reason':{'type':Sequelize[_0x1c70('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 3cbd298..cb1fb09 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 _0x5c9a=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','rimraf','zip-dir','moment','mustache','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key'];(function(_0x2fbadc,_0x57dac7){var _0x44a072=function(_0x2e845a){while(--_0x2e845a){_0x2fbadc['push'](_0x2fbadc['shift']());}};_0x44a072(++_0x57dac7);}(_0x5c9a,0x6a));var _0xa5c9=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0x5c9a[_0x57a670];return _0x41ce21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5c9('0x0'));var zipdir=require(_0xa5c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa5c9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa5c9('0x3'));var util=require('util');var path=require('path');var sox=require(_0xa5c9('0x4'));var csv=require(_0xa5c9('0x5'));var ejs=require(_0xa5c9('0x6'));var fs=require('fs');var fs_extra=require(_0xa5c9('0x7'));var _=require(_0xa5c9('0x8'));var squel=require(_0xa5c9('0x9'));var crypto=require('crypto');var jsforce=require(_0xa5c9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa5c9('0xb'));var Papa=require(_0xa5c9('0xc'));var Redis=require(_0xa5c9('0xd'));var authService=require(_0xa5c9('0xe'));var qs=require(_0xa5c9('0xf'));var as=require(_0xa5c9('0x10'));var hardwareService=require(_0xa5c9('0x11'));var logger=require(_0xa5c9('0x12'))('api');var utils=require(_0xa5c9('0x13'));var config=require(_0xa5c9('0x14'));var licenseUtil=require(_0xa5c9('0x15'));var db=require(_0xa5c9('0x16'))['db'];function respondWithStatusCode(_0x2c2ccc,_0x5f1561){_0x5f1561=_0x5f1561||0xcc;return function(_0x1529d2){if(_0x1529d2){return _0x2c2ccc[_0xa5c9('0x17')](_0x5f1561);}return _0x2c2ccc[_0xa5c9('0x18')](_0x5f1561)[_0xa5c9('0x19')]();};}function respondWithResult(_0x14382d,_0xd38d0a){_0xd38d0a=_0xd38d0a||0xc8;return function(_0x518aae){if(_0x518aae){return _0x14382d['status'](_0xd38d0a)[_0xa5c9('0x1a')](_0x518aae);}};}function respondWithFilteredResult(_0x411866,_0x373c4d){return function(_0x4f3749){if(_0x4f3749){var _0x423138=typeof _0x373c4d[_0xa5c9('0x1b')]===_0xa5c9('0x1c')&&typeof _0x373c4d['limit']==='undefined';var _0x15c01d=_0x4f3749['count'];var _0x267727=_0x423138?0x0:_0x373c4d[_0xa5c9('0x1b')];var _0x41c39d=_0x423138?_0x4f3749[_0xa5c9('0x1d')]:_0x373c4d[_0xa5c9('0x1b')]+_0x373c4d[_0xa5c9('0x1e')];var _0x30d87e;if(_0x41c39d>=_0x15c01d){_0x41c39d=_0x15c01d;_0x30d87e=0xc8;}else{_0x30d87e=0xce;}_0x411866['status'](_0x30d87e);return _0x411866[_0xa5c9('0x1f')](_0xa5c9('0x20'),_0x267727+'-'+_0x41c39d+'/'+_0x15c01d)[_0xa5c9('0x1a')](_0x4f3749);}return null;};}function patchUpdates(_0x13aa04){return function(_0x38ce47){try{jsonpatch[_0xa5c9('0x21')](_0x38ce47,_0x13aa04,!![]);}catch(_0x998b2e){return BPromise[_0xa5c9('0x22')](_0x998b2e);}return _0x38ce47[_0xa5c9('0x23')]();};}function saveUpdates(_0x278325,_0x192467){return function(_0x280410){if(_0x280410){return _0x280410[_0xa5c9('0x24')](_0x278325)[_0xa5c9('0x25')](function(_0x3bdcb3){return _0x3bdcb3;});}return null;};}function removeEntity(_0xea00b7,_0x588c06){return function(_0x4ce603){if(_0x4ce603){return _0x4ce603[_0xa5c9('0x26')]()[_0xa5c9('0x25')](function(){_0xea00b7['status'](0xcc)[_0xa5c9('0x19')]();});}};}function handleEntityNotFound(_0x2dfcea,_0x3ddda6){return function(_0x56f1a1){if(!_0x56f1a1){_0x2dfcea[_0xa5c9('0x17')](0x194);}return _0x56f1a1;};}function handleError(_0x5a7818,_0x1dcea5){_0x1dcea5=_0x1dcea5||0x1f4;return function(_0x487540){logger[_0xa5c9('0x27')](_0x487540[_0xa5c9('0x28')]);if(_0x487540[_0xa5c9('0x29')]){delete _0x487540['name'];}_0x5a7818[_0xa5c9('0x18')](_0x1dcea5)[_0xa5c9('0x2a')](_0x487540);};}exports[_0xa5c9('0x2b')]=function(_0x1c6995,_0x52afd7){var _0x3e9b54={},_0x4331fa={},_0x18bfd9={'count':0x0,'rows':[]};var _0x3f06bb=_[_0xa5c9('0x2c')](db[_0xa5c9('0x2d')][_0xa5c9('0x2e')],function(_0x497fc1){return{'name':_0x497fc1[_0xa5c9('0x2f')],'type':_0x497fc1[_0xa5c9('0x30')][_0xa5c9('0x31')]};});_0x4331fa[_0xa5c9('0x32')]=_[_0xa5c9('0x2c')](_0x3f06bb,_0xa5c9('0x29'));_0x4331fa[_0xa5c9('0x33')]=_[_0xa5c9('0x34')](_0x1c6995['query']);_0x4331fa[_0xa5c9('0x35')]=_[_0xa5c9('0x36')](_0x4331fa['model'],_0x4331fa[_0xa5c9('0x33')]);_0x3e9b54[_0xa5c9('0x37')]=_[_0xa5c9('0x36')](_0x4331fa['model'],qs[_0xa5c9('0x38')](_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x38')]));_0x3e9b54[_0xa5c9('0x37')]=_0x3e9b54[_0xa5c9('0x37')][_0xa5c9('0x39')]?_0x3e9b54['attributes']:_0x4331fa[_0xa5c9('0x32')];if(!_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x3a')](_0xa5c9('0x3b'))){_0x3e9b54['limit']=qs['limit'](_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x1e')]);_0x3e9b54[_0xa5c9('0x1b')]=qs[_0xa5c9('0x1b')](_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x1b')]);}_0x3e9b54[_0xa5c9('0x3c')]=qs[_0xa5c9('0x3d')](_0x1c6995['query']['sort']);_0x3e9b54[_0xa5c9('0x3e')]=qs[_0xa5c9('0x35')](_[_0xa5c9('0x3f')](_0x1c6995['query'],_0x4331fa[_0xa5c9('0x35')]),_0x3f06bb);if(_0x1c6995['query']['filter']){_0x3e9b54[_0xa5c9('0x3e')]=_[_0xa5c9('0x40')](_0x3e9b54['where'],{'$or':_[_0xa5c9('0x2c')](_0x3f06bb,function(_0x5cdc9a){if(_0x5cdc9a[_0xa5c9('0x30')]!==_0xa5c9('0x41')){var _0x206340={};_0x206340[_0x5cdc9a['name']]={'$like':'%'+_0x1c6995[_0xa5c9('0x33')]['filter']+'%'};return _0x206340;}})});}_0x3e9b54=_[_0xa5c9('0x40')]({},_0x3e9b54,_0x1c6995['options']);var _0x5da2f7={'where':_0x3e9b54['where']};return db[_0xa5c9('0x2d')][_0xa5c9('0x1d')](_0x5da2f7)[_0xa5c9('0x25')](function(_0xcacb4){_0x18bfd9[_0xa5c9('0x1d')]=_0xcacb4;if(_0x1c6995[_0xa5c9('0x33')][_0xa5c9('0x42')]){_0x3e9b54[_0xa5c9('0x43')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xa5c9('0x44')](_0x3e9b54);})[_0xa5c9('0x25')](function(_0x151d89){_0x18bfd9[_0xa5c9('0x45')]=_0x151d89;return _0x18bfd9;})['then'](respondWithFilteredResult(_0x52afd7,_0x3e9b54))['catch'](handleError(_0x52afd7,null));};exports[_0xa5c9('0x46')]=function(_0x16bb87,_0x2e9983){var _0x4f570b={'raw':!![],'where':{'id':_0x16bb87[_0xa5c9('0x47')]['id']}},_0x72013b={};_0x72013b[_0xa5c9('0x32')]=_[_0xa5c9('0x34')](db['SmsQueueReport'][_0xa5c9('0x2e')]);_0x72013b[_0xa5c9('0x33')]=_[_0xa5c9('0x34')](_0x16bb87['query']);_0x72013b['filters']=_[_0xa5c9('0x36')](_0x72013b[_0xa5c9('0x32')],_0x72013b['query']);_0x4f570b[_0xa5c9('0x37')]=_['intersection'](_0x72013b[_0xa5c9('0x32')],qs[_0xa5c9('0x38')](_0x16bb87[_0xa5c9('0x33')][_0xa5c9('0x38')]));_0x4f570b[_0xa5c9('0x37')]=_0x4f570b[_0xa5c9('0x37')][_0xa5c9('0x39')]?_0x4f570b[_0xa5c9('0x37')]:_0x72013b['model'];if(_0x16bb87['query'][_0xa5c9('0x42')]){_0x4f570b[_0xa5c9('0x43')]=[{'all':!![]}];}_0x4f570b=_['merge']({},_0x4f570b,_0x16bb87[_0xa5c9('0x48')]);return db[_0xa5c9('0x2d')][_0xa5c9('0x49')](_0x4f570b)[_0xa5c9('0x25')](handleEntityNotFound(_0x2e9983,null))[_0xa5c9('0x25')](respondWithResult(_0x2e9983,null))[_0xa5c9('0x4a')](handleError(_0x2e9983,null));};exports[_0xa5c9('0x4b')]=function(_0x5e81e3,_0x3c5fad){return db[_0xa5c9('0x2d')][_0xa5c9('0x4b')](_0x5e81e3[_0xa5c9('0x4c')],{})['then'](respondWithResult(_0x3c5fad,0xc9))[_0xa5c9('0x4a')](handleError(_0x3c5fad,null));};exports[_0xa5c9('0x24')]=function(_0x57bd3d,_0x3e3be9){if(_0x57bd3d['body']['id']){delete _0x57bd3d[_0xa5c9('0x4c')]['id'];}return db[_0xa5c9('0x2d')][_0xa5c9('0x49')]({'where':{'id':_0x57bd3d['params']['id']}})[_0xa5c9('0x25')](handleEntityNotFound(_0x3e3be9,null))[_0xa5c9('0x25')](saveUpdates(_0x57bd3d[_0xa5c9('0x4c')],null))[_0xa5c9('0x25')](respondWithResult(_0x3e3be9,null))[_0xa5c9('0x4a')](handleError(_0x3e3be9,null));};exports[_0xa5c9('0x26')]=function(_0x50fa09,_0x2e96d1){return db[_0xa5c9('0x2d')][_0xa5c9('0x49')]({'where':{'id':_0x50fa09[_0xa5c9('0x47')]['id']}})[_0xa5c9('0x25')](handleEntityNotFound(_0x2e96d1,null))[_0xa5c9('0x25')](removeEntity(_0x2e96d1,null))[_0xa5c9('0x4a')](handleError(_0x2e96d1,null));};exports['describe']=function(_0x4b8188,_0x357650){return db['SmsQueueReport'][_0xa5c9('0x4d')]()[_0xa5c9('0x25')](respondWithResult(_0x357650,null))[_0xa5c9('0x4a')](handleError(_0x357650,null));}; \ No newline at end of file +var _0xd99a=['save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply'];(function(_0x8247e3,_0x1429b6){var _0x3aa0a3=function(_0xc24b57){while(--_0xc24b57){_0x8247e3['push'](_0x8247e3['shift']());}};_0x3aa0a3(++_0x1429b6);}(_0xd99a,0x7a));var _0xad99=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xd99a[_0x5d6c3e];return _0x44ecb7;};'use strict';var emlformat=require(_0xad99('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xad99('0x1'));var rp=require(_0xad99('0x2'));var moment=require(_0xad99('0x3'));var BPromise=require(_0xad99('0x4'));var Mustache=require(_0xad99('0x5'));var util=require(_0xad99('0x6'));var path=require(_0xad99('0x7'));var sox=require('sox');var csv=require(_0xad99('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad99('0x9'));var _=require(_0xad99('0xa'));var squel=require(_0xad99('0xb'));var crypto=require(_0xad99('0xc'));var jsforce=require(_0xad99('0xd'));var deskjs=require(_0xad99('0xe'));var toCsv=require(_0xad99('0x8'));var querystring=require('querystring');var Papa=require(_0xad99('0xf'));var Redis=require(_0xad99('0x10'));var authService=require(_0xad99('0x11'));var qs=require(_0xad99('0x12'));var as=require(_0xad99('0x13'));var hardwareService=require(_0xad99('0x14'));var logger=require(_0xad99('0x15'))(_0xad99('0x16'));var utils=require(_0xad99('0x17'));var config=require(_0xad99('0x18'));var licenseUtil=require(_0xad99('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f4d4,_0x4ccfe3){_0x4ccfe3=_0x4ccfe3||0xcc;return function(_0x3da4c1){if(_0x3da4c1){return _0x14f4d4[_0xad99('0x1a')](_0x4ccfe3);}return _0x14f4d4[_0xad99('0x1b')](_0x4ccfe3)[_0xad99('0x1c')]();};}function respondWithResult(_0x202bf0,_0x1d29c6){_0x1d29c6=_0x1d29c6||0xc8;return function(_0x39a662){if(_0x39a662){return _0x202bf0[_0xad99('0x1b')](_0x1d29c6)['json'](_0x39a662);}};}function respondWithFilteredResult(_0x4e5382,_0x361db8){return function(_0x324422){if(_0x324422){var _0x1f547a=typeof _0x361db8['offset']===_0xad99('0x1d')&&typeof _0x361db8['limit']===_0xad99('0x1d');var _0x45a309=_0x324422[_0xad99('0x1e')];var _0x20a5cd=_0x1f547a?0x0:_0x361db8['offset'];var _0x30bab1=_0x1f547a?_0x324422['count']:_0x361db8[_0xad99('0x1f')]+_0x361db8[_0xad99('0x20')];var _0xfaee58;if(_0x30bab1>=_0x45a309){_0x30bab1=_0x45a309;_0xfaee58=0xc8;}else{_0xfaee58=0xce;}_0x4e5382[_0xad99('0x1b')](_0xfaee58);return _0x4e5382[_0xad99('0x21')](_0xad99('0x22'),_0x20a5cd+'-'+_0x30bab1+'/'+_0x45a309)['json'](_0x324422);}return null;};}function patchUpdates(_0x36df2c){return function(_0x41a9a8){try{jsonpatch[_0xad99('0x23')](_0x41a9a8,_0x36df2c,!![]);}catch(_0x48b4bf){return BPromise['reject'](_0x48b4bf);}return _0x41a9a8[_0xad99('0x24')]();};}function saveUpdates(_0x4bcce3,_0x231efe){return function(_0x5749e2){if(_0x5749e2){return _0x5749e2[_0xad99('0x25')](_0x4bcce3)[_0xad99('0x26')](function(_0x401552){return _0x401552;});}return null;};}function removeEntity(_0x59d138,_0x28feb4){return function(_0x231d5a){if(_0x231d5a){return _0x231d5a['destroy']()[_0xad99('0x26')](function(){_0x59d138[_0xad99('0x1b')](0xcc)[_0xad99('0x1c')]();});}};}function handleEntityNotFound(_0x5bd838,_0x1d4559){return function(_0x5b0fda){if(!_0x5b0fda){_0x5bd838[_0xad99('0x1a')](0x194);}return _0x5b0fda;};}function handleError(_0x15e6fd,_0x3dad57){_0x3dad57=_0x3dad57||0x1f4;return function(_0x16ea32){logger[_0xad99('0x27')](_0x16ea32[_0xad99('0x28')]);if(_0x16ea32[_0xad99('0x29')]){delete _0x16ea32['name'];}_0x15e6fd['status'](_0x3dad57)[_0xad99('0x2a')](_0x16ea32);};}exports[_0xad99('0x2b')]=function(_0x450eaf,_0x4ef3b5){var _0x11427a={},_0x4ca23e={},_0x1f8022={'count':0x0,'rows':[]};var _0x501227=_[_0xad99('0x2c')](db[_0xad99('0x2d')][_0xad99('0x2e')],function(_0x5b1772){return{'name':_0x5b1772[_0xad99('0x2f')],'type':_0x5b1772[_0xad99('0x30')][_0xad99('0x31')]};});_0x4ca23e[_0xad99('0x32')]=_[_0xad99('0x2c')](_0x501227,'name');_0x4ca23e['query']=_[_0xad99('0x33')](_0x450eaf[_0xad99('0x34')]);_0x4ca23e[_0xad99('0x35')]=_['intersection'](_0x4ca23e[_0xad99('0x32')],_0x4ca23e[_0xad99('0x34')]);_0x11427a[_0xad99('0x36')]=_[_0xad99('0x37')](_0x4ca23e['model'],qs['fields'](_0x450eaf[_0xad99('0x34')][_0xad99('0x38')]));_0x11427a[_0xad99('0x36')]=_0x11427a[_0xad99('0x36')][_0xad99('0x39')]?_0x11427a['attributes']:_0x4ca23e[_0xad99('0x32')];if(!_0x450eaf[_0xad99('0x34')][_0xad99('0x3a')](_0xad99('0x3b'))){_0x11427a[_0xad99('0x20')]=qs[_0xad99('0x20')](_0x450eaf['query']['limit']);_0x11427a[_0xad99('0x1f')]=qs[_0xad99('0x1f')](_0x450eaf[_0xad99('0x34')][_0xad99('0x1f')]);}_0x11427a[_0xad99('0x3c')]=qs['sort'](_0x450eaf[_0xad99('0x34')][_0xad99('0x3d')]);_0x11427a[_0xad99('0x3e')]=qs[_0xad99('0x35')](_[_0xad99('0x3f')](_0x450eaf['query'],_0x4ca23e[_0xad99('0x35')]),_0x501227);if(_0x450eaf[_0xad99('0x34')]['filter']){_0x11427a[_0xad99('0x3e')]=_[_0xad99('0x40')](_0x11427a[_0xad99('0x3e')],{'$or':_[_0xad99('0x2c')](_0x501227,function(_0x29ca60){if(_0x29ca60[_0xad99('0x30')]!==_0xad99('0x41')){var _0x321e1e={};_0x321e1e[_0x29ca60[_0xad99('0x29')]]={'$like':'%'+_0x450eaf['query'][_0xad99('0x42')]+'%'};return _0x321e1e;}})});}_0x11427a=_['merge']({},_0x11427a,_0x450eaf[_0xad99('0x43')]);var _0x5cbbaa={'where':_0x11427a[_0xad99('0x3e')]};return db[_0xad99('0x2d')][_0xad99('0x1e')](_0x5cbbaa)[_0xad99('0x26')](function(_0x1107a3){_0x1f8022[_0xad99('0x1e')]=_0x1107a3;if(_0x450eaf[_0xad99('0x34')][_0xad99('0x44')]){_0x11427a[_0xad99('0x45')]=[{'all':!![]}];}return db[_0xad99('0x2d')][_0xad99('0x46')](_0x11427a);})[_0xad99('0x26')](function(_0x5e4c10){_0x1f8022['rows']=_0x5e4c10;return _0x1f8022;})[_0xad99('0x26')](respondWithFilteredResult(_0x4ef3b5,_0x11427a))[_0xad99('0x47')](handleError(_0x4ef3b5,null));};exports[_0xad99('0x48')]=function(_0x5f26cc,_0x891fb3){var _0x5b25b0={'raw':!![],'where':{'id':_0x5f26cc[_0xad99('0x49')]['id']}},_0x858038={};_0x858038[_0xad99('0x32')]=_[_0xad99('0x33')](db[_0xad99('0x2d')]['rawAttributes']);_0x858038[_0xad99('0x34')]=_[_0xad99('0x33')](_0x5f26cc[_0xad99('0x34')]);_0x858038[_0xad99('0x35')]=_['intersection'](_0x858038[_0xad99('0x32')],_0x858038[_0xad99('0x34')]);_0x5b25b0['attributes']=_['intersection'](_0x858038[_0xad99('0x32')],qs[_0xad99('0x38')](_0x5f26cc[_0xad99('0x34')][_0xad99('0x38')]));_0x5b25b0[_0xad99('0x36')]=_0x5b25b0['attributes'][_0xad99('0x39')]?_0x5b25b0['attributes']:_0x858038['model'];if(_0x5f26cc[_0xad99('0x34')][_0xad99('0x44')]){_0x5b25b0[_0xad99('0x45')]=[{'all':!![]}];}_0x5b25b0=_['merge']({},_0x5b25b0,_0x5f26cc[_0xad99('0x43')]);return db[_0xad99('0x2d')][_0xad99('0x4a')](_0x5b25b0)['then'](handleEntityNotFound(_0x891fb3,null))[_0xad99('0x26')](respondWithResult(_0x891fb3,null))[_0xad99('0x47')](handleError(_0x891fb3,null));};exports[_0xad99('0x4b')]=function(_0x549b3e,_0x49bd33){return db[_0xad99('0x2d')][_0xad99('0x4b')](_0x549b3e['body'],{})['then'](respondWithResult(_0x49bd33,0xc9))[_0xad99('0x47')](handleError(_0x49bd33,null));};exports[_0xad99('0x25')]=function(_0x3a2fe1,_0x3767e2){if(_0x3a2fe1[_0xad99('0x4c')]['id']){delete _0x3a2fe1[_0xad99('0x4c')]['id'];}return db[_0xad99('0x2d')]['find']({'where':{'id':_0x3a2fe1['params']['id']}})[_0xad99('0x26')](handleEntityNotFound(_0x3767e2,null))['then'](saveUpdates(_0x3a2fe1[_0xad99('0x4c')],null))[_0xad99('0x26')](respondWithResult(_0x3767e2,null))[_0xad99('0x47')](handleError(_0x3767e2,null));};exports[_0xad99('0x4d')]=function(_0x262201,_0x8c9c5c){return db[_0xad99('0x2d')]['find']({'where':{'id':_0x262201[_0xad99('0x49')]['id']}})['then'](handleEntityNotFound(_0x8c9c5c,null))[_0xad99('0x26')](removeEntity(_0x8c9c5c,null))[_0xad99('0x47')](handleError(_0x8c9c5c,null));};exports['describe']=function(_0x54deb1,_0x40895e){return db[_0xad99('0x2d')][_0xad99('0x4e')]()[_0xad99('0x26')](respondWithResult(_0x40895e,null))[_0xad99('0x47')](handleError(_0x40895e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bf50564..dd2d7b4 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0xcb9960,_0x2ae9f5){var _0x488be5=function(_0x193203){while(--_0x193203){_0xcb9960['push'](_0xcb9960['shift']());}};_0x488be5(++_0x2ae9f5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xcb91[_0x5d9867];return _0x7d2118;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 538e507..aa08cf4 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 _0xb013=['error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5a0704,_0x1ada6a){var _0x345be2=function(_0x1a7022){while(--_0x1a7022){_0x5a0704['push'](_0x5a0704['shift']());}};_0x345be2(++_0x1ada6a);}(_0xb013,0x156));var _0x3b01=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xb013[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x3b01('0x0'));var util=require(_0x3b01('0x1'));var moment=require(_0x3b01('0x2'));var BPromise=require(_0x3b01('0x3'));var rs=require(_0x3b01('0x4'));var fs=require('fs');var Redis=require(_0x3b01('0x5'));var db=require(_0x3b01('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b01('0x7'))(_0x3b01('0x8'));var config=require(_0x3b01('0x9'));var jayson=require(_0x3b01('0xa'));var client=jayson[_0x3b01('0xb')][_0x3b01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4caef3,_0x1bf99a,_0x88421f){return new BPromise(function(_0x2d8861,_0x3d1e07){return client[_0x3b01('0xd')](_0x4caef3,_0x88421f)[_0x3b01('0xe')](function(_0x5efc81){logger[_0x3b01('0xf')](_0x3b01('0x10'),_0x1bf99a,_0x3b01('0x11'));logger[_0x3b01('0x12')](_0x3b01('0x13'),_0x1bf99a,_0x3b01('0x11'),JSON[_0x3b01('0x14')](_0x5efc81));if(_0x5efc81[_0x3b01('0x15')]){if(_0x5efc81['error'][_0x3b01('0x16')]===0x1f4){logger['error'](_0x3b01('0x10'),_0x1bf99a,_0x5efc81[_0x3b01('0x15')][_0x3b01('0x17')]);return _0x3d1e07(_0x5efc81[_0x3b01('0x15')][_0x3b01('0x17')]);}logger[_0x3b01('0x15')](_0x3b01('0x10'),_0x1bf99a,_0x5efc81[_0x3b01('0x15')][_0x3b01('0x17')]);return _0x2d8861(_0x5efc81['error']['message']);}else{logger['info'](_0x3b01('0x10'),_0x1bf99a,'request\x20sent');_0x2d8861(_0x5efc81['result'][_0x3b01('0x17')]);}})[_0x3b01('0x18')](function(_0x559ff3){logger['error'](_0x3b01('0x10'),_0x1bf99a,_0x559ff3);_0x3d1e07(_0x559ff3);});});}exports[_0x3b01('0x19')]=function(_0xd96be0){var _0x3ba4c7=this;return new Promise(function(_0x166a7d,_0x269c19){return db[_0x3b01('0x1a')][_0x3b01('0x1b')](_0xd96be0[_0x3b01('0x1c')],{'raw':_0xd96be0[_0x3b01('0x1d')]?_0xd96be0[_0x3b01('0x1d')][_0x3b01('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x45a088){logger['info'](_0x3b01('0x19'),_0xd96be0);logger[_0x3b01('0x12')](_0x3b01('0x19'),_0xd96be0,JSON[_0x3b01('0x14')](_0x45a088));_0x166a7d(_0x45a088);})['catch'](function(_0x2a76d1){logger[_0x3b01('0x15')](_0x3b01('0x19'),_0x2a76d1[_0x3b01('0x17')],_0xd96be0);_0x269c19(_0x3ba4c7[_0x3b01('0x15')](0x1f4,_0x2a76d1[_0x3b01('0x17')]));});});};exports['UpdateSmsQueueReport']=function(_0x56ed66){var _0x2be4f3=this;return new Promise(function(_0x3f9607,_0x26eeb8){return db['SmsQueueReport']['update'](_0x56ed66[_0x3b01('0x1c')],{'raw':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')]['where']||null:null,'attributes':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')]['attributes']||null:null,'limit':_0x56ed66[_0x3b01('0x1d')]?_0x56ed66[_0x3b01('0x1d')][_0x3b01('0x1f')]||null:null})[_0x3b01('0xe')](function(_0x2fca5c){logger[_0x3b01('0xf')](_0x3b01('0x20'),_0x56ed66);logger[_0x3b01('0x12')](_0x3b01('0x20'),_0x56ed66,JSON[_0x3b01('0x14')](_0x2fca5c));_0x3f9607(_0x2fca5c);})[_0x3b01('0x18')](function(_0xc6ddfc){logger[_0x3b01('0x15')](_0x3b01('0x20'),_0xc6ddfc[_0x3b01('0x17')],_0x56ed66);_0x26eeb8(_0x2be4f3[_0x3b01('0x15')](0x1f4,_0xc6ddfc[_0x3b01('0x17')]));});});}; \ No newline at end of file +var _0x9841=['SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','debug','update','body','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info'];(function(_0x12ee37,_0x57179e){var _0x3d4c84=function(_0x311a0e){while(--_0x311a0e){_0x12ee37['push'](_0x12ee37['shift']());}};_0x3d4c84(++_0x57179e);}(_0x9841,0x193));var _0x1984=function(_0x5f3840,_0x35d3f7){_0x5f3840=_0x5f3840-0x0;var _0x5ed4e0=_0x9841[_0x5f3840];return _0x5ed4e0;};'use strict';var _=require(_0x1984('0x0'));var util=require(_0x1984('0x1'));var moment=require(_0x1984('0x2'));var BPromise=require('bluebird');var rs=require(_0x1984('0x3'));var fs=require('fs');var Redis=require(_0x1984('0x4'));var db=require(_0x1984('0x5'))['db'];var utils=require(_0x1984('0x6'));var logger=require(_0x1984('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1984('0x8'));var client=jayson[_0x1984('0x9')][_0x1984('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54bfad,_0x4c4142,_0x33f047){return new BPromise(function(_0x45d00a,_0xeceb23){return client[_0x1984('0xb')](_0x54bfad,_0x33f047)['then'](function(_0x3835fd){logger[_0x1984('0xc')](_0x1984('0xd'),_0x4c4142,_0x1984('0xe'));logger['debug'](_0x1984('0xf'),_0x4c4142,_0x1984('0xe'),JSON[_0x1984('0x10')](_0x3835fd));if(_0x3835fd[_0x1984('0x11')]){if(_0x3835fd[_0x1984('0x11')]['code']===0x1f4){logger[_0x1984('0x11')](_0x1984('0xd'),_0x4c4142,_0x3835fd[_0x1984('0x11')]['message']);return _0xeceb23(_0x3835fd[_0x1984('0x11')][_0x1984('0x12')]);}logger[_0x1984('0x11')](_0x1984('0xd'),_0x4c4142,_0x3835fd[_0x1984('0x11')][_0x1984('0x12')]);return _0x45d00a(_0x3835fd[_0x1984('0x11')][_0x1984('0x12')]);}else{logger[_0x1984('0xc')](_0x1984('0xd'),_0x4c4142,_0x1984('0xe'));_0x45d00a(_0x3835fd['result'][_0x1984('0x12')]);}})[_0x1984('0x13')](function(_0x5ac77c){logger[_0x1984('0x11')](_0x1984('0xd'),_0x4c4142,_0x5ac77c);_0xeceb23(_0x5ac77c);});});}exports[_0x1984('0x14')]=function(_0x216cad){var _0x519c6f=this;return new Promise(function(_0x58a31e,_0x3ed706){return db[_0x1984('0x15')][_0x1984('0x16')](_0x216cad['body'],{'raw':_0x216cad[_0x1984('0x17')]?_0x216cad['options'][_0x1984('0x18')]===undefined?!![]:![]:!![]})[_0x1984('0x19')](function(_0x38143d){logger[_0x1984('0xc')]('CreateSmsQueueReport',_0x216cad);logger[_0x1984('0x1a')](_0x1984('0x14'),_0x216cad,JSON[_0x1984('0x10')](_0x38143d));_0x58a31e(_0x38143d);})['catch'](function(_0x5dd57f){logger['error'](_0x1984('0x14'),_0x5dd57f[_0x1984('0x12')],_0x216cad);_0x3ed706(_0x519c6f['error'](0x1f4,_0x5dd57f['message']));});});};exports['UpdateSmsQueueReport']=function(_0x474023){var _0x442e65=this;return new Promise(function(_0x26463c,_0x248fb1){return db[_0x1984('0x15')][_0x1984('0x1b')](_0x474023[_0x1984('0x1c')],{'raw':_0x474023[_0x1984('0x17')]?_0x474023[_0x1984('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x474023[_0x1984('0x17')]?_0x474023[_0x1984('0x17')]['where']||null:null,'attributes':_0x474023['options']?_0x474023['options'][_0x1984('0x1d')]||null:null,'limit':_0x474023[_0x1984('0x17')]?_0x474023[_0x1984('0x17')][_0x1984('0x1e')]||null:null})[_0x1984('0x19')](function(_0x27b993){logger[_0x1984('0xc')](_0x1984('0x1f'),_0x474023);logger[_0x1984('0x1a')](_0x1984('0x1f'),_0x474023,JSON[_0x1984('0x10')](_0x27b993));_0x26463c(_0x27b993);})[_0x1984('0x13')](function(_0x11a04f){logger[_0x1984('0x11')](_0x1984('0x1f'),_0x11a04f[_0x1984('0x12')],_0x474023);_0x248fb1(_0x442e65[_0x1984('0x11')](0x1f4,_0x11a04f[_0x1984('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 948cec0..e4b3fff 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 _0x5075=['get','isAuthenticated','describe','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index'];(function(_0x3fc41c,_0x3b4db4){var _0x1d27fd=function(_0x3efbba){while(--_0x3efbba){_0x3fc41c['push'](_0x3fc41c['shift']());}};_0x1d27fd(++_0x3b4db4);}(_0x5075,0x73));var _0x5507=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x5075[_0x1b745b];return _0x120a9d;};'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('0xf')]('/',auth[_0x5507('0xc')](),controller[_0x5507('0x10')]);router['put'](_0x5507('0x11'),auth[_0x5507('0xc')](),controller['update']);router[_0x5507('0x12')](_0x5507('0x11'),auth['isAuthenticated'](),controller[_0x5507('0x13')]);module[_0x5507('0x14')]=router; \ No newline at end of file +var _0x0f4d=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','show','create','put','update','delete','/:id','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2fac1d,_0x2ad399){var _0x4d16a1=function(_0x1f4bc4){while(--_0x1f4bc4){_0x2fac1d['push'](_0x2fac1d['shift']());}};_0x4d16a1(++_0x2ad399);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x455b06,_0x2374ff){_0x455b06=_0x455b06-0x0;var _0x2c884e=_0x0f4d[_0x455b06];return _0x2c884e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0f4('0x0'));var express=require('express');var router=express[_0xd0f4('0x1')]();var fs_extra=require(_0xd0f4('0x2'));var auth=require(_0xd0f4('0x3'));var interaction=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var controller=require(_0xd0f4('0x6'));router[_0xd0f4('0x7')]('/',auth[_0xd0f4('0x8')](),controller['index']);router[_0xd0f4('0x7')](_0xd0f4('0x9'),auth['isAuthenticated'](),controller[_0xd0f4('0xa')]);router[_0xd0f4('0x7')]('/:id',auth[_0xd0f4('0x8')](),controller[_0xd0f4('0xb')]);router['post']('/',auth[_0xd0f4('0x8')](),controller[_0xd0f4('0xc')]);router[_0xd0f4('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd0f4('0xe')]);router[_0xd0f4('0xf')](_0xd0f4('0x10'),auth[_0xd0f4('0x8')](),controller[_0xd0f4('0x11')]);module[_0xd0f4('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 5eaf8f2..20d6d30 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x49369e,_0x3777d8){var _0x22d7c3=function(_0x3855cd){while(--_0x3855cd){_0x49369e['push'](_0x49369e['shift']());}};_0x22d7c3(++_0x3777d8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x00bb[_0x46aff0];return _0x9d78cf;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x440236,_0x3701a4){var _0x508192=function(_0x43b13e){while(--_0x43b13e){_0x440236['push'](_0x440236['shift']());}};_0x508192(++_0x3701a4);}(_0x008c,0x188));var _0xc008=function(_0x1e8bcb,_0x474a81){_0x1e8bcb=_0x1e8bcb-0x0;var _0x212080=_0x008c[_0x1e8bcb];return _0x212080;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 01bdec0..dee112d 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 _0x079d=['where','pick','filter','merge','VIRTUAL','includeAll','catch','show','keys','rawAttributes','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x079d,0xa6));var _0xd079=function(_0x4a7dec,_0x5f4581){_0x4a7dec=_0x4a7dec-0x0;var _0x188634=_0x079d[_0x4a7dec];return _0x188634;};'use strict';var emlformat=require(_0xd079('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd079('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd079('0x2'));var moment=require(_0xd079('0x3'));var BPromise=require(_0xd079('0x4'));var Mustache=require(_0xd079('0x5'));var util=require('util');var path=require(_0xd079('0x6'));var sox=require(_0xd079('0x7'));var csv=require(_0xd079('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd079('0x9'));var _=require(_0xd079('0xa'));var squel=require('squel');var crypto=require(_0xd079('0xb'));var jsforce=require(_0xd079('0xc'));var deskjs=require(_0xd079('0xd'));var toCsv=require(_0xd079('0x8'));var querystring=require(_0xd079('0xe'));var Papa=require(_0xd079('0xf'));var Redis=require(_0xd079('0x10'));var authService=require(_0xd079('0x11'));var qs=require(_0xd079('0x12'));var as=require(_0xd079('0x13'));var hardwareService=require(_0xd079('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd079('0x15'));var licenseUtil=require(_0xd079('0x16'));var db=require(_0xd079('0x17'))['db'];function respondWithStatusCode(_0x495036,_0x2c5e5f){_0x2c5e5f=_0x2c5e5f||0xcc;return function(_0x30890b){if(_0x30890b){return _0x495036[_0xd079('0x18')](_0x2c5e5f);}return _0x495036['status'](_0x2c5e5f)[_0xd079('0x19')]();};}function respondWithResult(_0x28f95a,_0x547c03){_0x547c03=_0x547c03||0xc8;return function(_0x5b6ea1){if(_0x5b6ea1){return _0x28f95a[_0xd079('0x1a')](_0x547c03)[_0xd079('0x1b')](_0x5b6ea1);}};}function respondWithFilteredResult(_0x57d92e,_0x1f997b){return function(_0x331465){if(_0x331465){var _0x1e5627=typeof _0x1f997b[_0xd079('0x1c')]===_0xd079('0x1d')&&typeof _0x1f997b[_0xd079('0x1e')]===_0xd079('0x1d');var _0x1ce7b5=_0x331465[_0xd079('0x1f')];var _0x44974a=_0x1e5627?0x0:_0x1f997b['offset'];var _0x35d97f=_0x1e5627?_0x331465[_0xd079('0x1f')]:_0x1f997b[_0xd079('0x1c')]+_0x1f997b[_0xd079('0x1e')];var _0x166bcc;if(_0x35d97f>=_0x1ce7b5){_0x35d97f=_0x1ce7b5;_0x166bcc=0xc8;}else{_0x166bcc=0xce;}_0x57d92e[_0xd079('0x1a')](_0x166bcc);return _0x57d92e[_0xd079('0x20')](_0xd079('0x21'),_0x44974a+'-'+_0x35d97f+'/'+_0x1ce7b5)['json'](_0x331465);}return null;};}function patchUpdates(_0x2330b6){return function(_0x39bec5){try{jsonpatch[_0xd079('0x22')](_0x39bec5,_0x2330b6,!![]);}catch(_0x35ee15){return BPromise[_0xd079('0x23')](_0x35ee15);}return _0x39bec5[_0xd079('0x24')]();};}function saveUpdates(_0x43399b,_0x54e96e){return function(_0x56fc59){if(_0x56fc59){return _0x56fc59[_0xd079('0x25')](_0x43399b)[_0xd079('0x26')](function(_0x287c95){return _0x287c95;});}return null;};}function removeEntity(_0x36f984,_0x277fe4){return function(_0x404f60){if(_0x404f60){return _0x404f60[_0xd079('0x27')]()[_0xd079('0x26')](function(){_0x36f984[_0xd079('0x1a')](0xcc)[_0xd079('0x19')]();});}};}function handleEntityNotFound(_0x56d08c,_0x2261ba){return function(_0x580a42){if(!_0x580a42){_0x56d08c[_0xd079('0x18')](0x194);}return _0x580a42;};}function handleError(_0x1cd72c,_0x5945e0){_0x5945e0=_0x5945e0||0x1f4;return function(_0x56ec57){logger[_0xd079('0x28')](_0x56ec57[_0xd079('0x29')]);if(_0x56ec57[_0xd079('0x2a')]){delete _0x56ec57['name'];}_0x1cd72c['status'](_0x5945e0)[_0xd079('0x2b')](_0x56ec57);};}exports[_0xd079('0x2c')]=function(_0x4ebbee,_0x551547){var _0x14ce47={},_0x3c6830={},_0x1dfc6e={'count':0x0,'rows':[]};var _0x4f2a42=_[_0xd079('0x2d')](db[_0xd079('0x2e')]['rawAttributes'],function(_0x358ca5){return{'name':_0x358ca5[_0xd079('0x2f')],'type':_0x358ca5[_0xd079('0x30')]['key']};});_0x3c6830[_0xd079('0x31')]=_[_0xd079('0x2d')](_0x4f2a42,_0xd079('0x2a'));_0x3c6830['query']=_['keys'](_0x4ebbee[_0xd079('0x32')]);_0x3c6830[_0xd079('0x33')]=_['intersection'](_0x3c6830['model'],_0x3c6830[_0xd079('0x32')]);_0x14ce47[_0xd079('0x34')]=_[_0xd079('0x35')](_0x3c6830[_0xd079('0x31')],qs[_0xd079('0x36')](_0x4ebbee[_0xd079('0x32')]['fields']));_0x14ce47[_0xd079('0x34')]=_0x14ce47[_0xd079('0x34')]['length']?_0x14ce47[_0xd079('0x34')]:_0x3c6830['model'];if(!_0x4ebbee['query'][_0xd079('0x37')](_0xd079('0x38'))){_0x14ce47['limit']=qs['limit'](_0x4ebbee[_0xd079('0x32')][_0xd079('0x1e')]);_0x14ce47[_0xd079('0x1c')]=qs['offset'](_0x4ebbee[_0xd079('0x32')][_0xd079('0x1c')]);}_0x14ce47[_0xd079('0x39')]=qs['sort'](_0x4ebbee['query'][_0xd079('0x3a')]);_0x14ce47[_0xd079('0x3b')]=qs[_0xd079('0x33')](_[_0xd079('0x3c')](_0x4ebbee[_0xd079('0x32')],_0x3c6830[_0xd079('0x33')]),_0x4f2a42);if(_0x4ebbee[_0xd079('0x32')][_0xd079('0x3d')]){_0x14ce47[_0xd079('0x3b')]=_[_0xd079('0x3e')](_0x14ce47[_0xd079('0x3b')],{'$or':_[_0xd079('0x2d')](_0x4f2a42,function(_0x2df2a3){if(_0x2df2a3[_0xd079('0x30')]!==_0xd079('0x3f')){var _0x3fd719={};_0x3fd719[_0x2df2a3[_0xd079('0x2a')]]={'$like':'%'+_0x4ebbee[_0xd079('0x32')][_0xd079('0x3d')]+'%'};return _0x3fd719;}})});}_0x14ce47=_['merge']({},_0x14ce47,_0x4ebbee['options']);var _0x4cc443={'where':_0x14ce47[_0xd079('0x3b')]};return db['SmsTransferReport']['count'](_0x4cc443)[_0xd079('0x26')](function(_0x20dd5a){_0x1dfc6e[_0xd079('0x1f')]=_0x20dd5a;if(_0x4ebbee[_0xd079('0x32')][_0xd079('0x40')]){_0x14ce47['include']=[{'all':!![]}];}return db[_0xd079('0x2e')]['findAll'](_0x14ce47);})[_0xd079('0x26')](function(_0x58eaca){_0x1dfc6e['rows']=_0x58eaca;return _0x1dfc6e;})[_0xd079('0x26')](respondWithFilteredResult(_0x551547,_0x14ce47))[_0xd079('0x41')](handleError(_0x551547,null));};exports[_0xd079('0x42')]=function(_0x151ccf,_0x5bf5b0){var _0x4a3565={'raw':!![],'where':{'id':_0x151ccf['params']['id']}},_0x1db308={};_0x1db308[_0xd079('0x31')]=_[_0xd079('0x43')](db[_0xd079('0x2e')][_0xd079('0x44')]);_0x1db308[_0xd079('0x32')]=_[_0xd079('0x43')](_0x151ccf[_0xd079('0x32')]);_0x1db308[_0xd079('0x33')]=_[_0xd079('0x35')](_0x1db308['model'],_0x1db308['query']);_0x4a3565[_0xd079('0x34')]=_[_0xd079('0x35')](_0x1db308[_0xd079('0x31')],qs[_0xd079('0x36')](_0x151ccf[_0xd079('0x32')]['fields']));_0x4a3565[_0xd079('0x34')]=_0x4a3565[_0xd079('0x34')]['length']?_0x4a3565[_0xd079('0x34')]:_0x1db308[_0xd079('0x31')];if(_0x151ccf[_0xd079('0x32')][_0xd079('0x40')]){_0x4a3565[_0xd079('0x45')]=[{'all':!![]}];}_0x4a3565=_['merge']({},_0x4a3565,_0x151ccf['options']);return db['SmsTransferReport'][_0xd079('0x46')](_0x4a3565)[_0xd079('0x26')](handleEntityNotFound(_0x5bf5b0,null))[_0xd079('0x26')](respondWithResult(_0x5bf5b0,null))[_0xd079('0x41')](handleError(_0x5bf5b0,null));};exports[_0xd079('0x47')]=function(_0x2833e4,_0x47a48d){return db['SmsTransferReport']['create'](_0x2833e4[_0xd079('0x48')],{})['then'](respondWithResult(_0x47a48d,0xc9))[_0xd079('0x41')](handleError(_0x47a48d,null));};exports[_0xd079('0x25')]=function(_0x4b40c5,_0x485023){if(_0x4b40c5[_0xd079('0x48')]['id']){delete _0x4b40c5['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x4b40c5[_0xd079('0x49')]['id']}})[_0xd079('0x26')](handleEntityNotFound(_0x485023,null))[_0xd079('0x26')](saveUpdates(_0x4b40c5[_0xd079('0x48')],null))[_0xd079('0x26')](respondWithResult(_0x485023,null))[_0xd079('0x41')](handleError(_0x485023,null));};exports[_0xd079('0x27')]=function(_0x10b1e0,_0x337892){return db[_0xd079('0x2e')]['find']({'where':{'id':_0x10b1e0[_0xd079('0x49')]['id']}})['then'](handleEntityNotFound(_0x337892,null))[_0xd079('0x26')](removeEntity(_0x337892,null))['catch'](handleError(_0x337892,null));};exports[_0xd079('0x4a')]=function(_0x222331,_0x2d322a){return db[_0xd079('0x2e')][_0xd079('0x4a')]()[_0xd079('0x26')](respondWithResult(_0x2d322a,null))[_0xd079('0x41')](handleError(_0x2d322a,null));}; \ No newline at end of file +var _0x1acd=['stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','fields','include','find','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1acd,0x15a));var _0xd1ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1acd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd1ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1ac('0x1'));var jsonpatch=require(_0xd1ac('0x2'));var rp=require(_0xd1ac('0x3'));var moment=require(_0xd1ac('0x4'));var BPromise=require(_0xd1ac('0x5'));var Mustache=require(_0xd1ac('0x6'));var util=require(_0xd1ac('0x7'));var path=require(_0xd1ac('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd1ac('0x9'));var fs=require('fs');var fs_extra=require(_0xd1ac('0xa'));var _=require(_0xd1ac('0xb'));var squel=require(_0xd1ac('0xc'));var crypto=require(_0xd1ac('0xd'));var jsforce=require(_0xd1ac('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd1ac('0xf'));var querystring=require(_0xd1ac('0x10'));var Papa=require(_0xd1ac('0x11'));var Redis=require(_0xd1ac('0x12'));var authService=require(_0xd1ac('0x13'));var qs=require(_0xd1ac('0x14'));var as=require(_0xd1ac('0x15'));var hardwareService=require(_0xd1ac('0x16'));var logger=require('../../config/logger')(_0xd1ac('0x17'));var utils=require(_0xd1ac('0x18'));var config=require(_0xd1ac('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1ac('0x1a'))['db'];function respondWithStatusCode(_0x419dd7,_0x2787db){_0x2787db=_0x2787db||0xcc;return function(_0x33221f){if(_0x33221f){return _0x419dd7[_0xd1ac('0x1b')](_0x2787db);}return _0x419dd7[_0xd1ac('0x1c')](_0x2787db)[_0xd1ac('0x1d')]();};}function respondWithResult(_0x210352,_0x40f82e){_0x40f82e=_0x40f82e||0xc8;return function(_0x5f28d4){if(_0x5f28d4){return _0x210352[_0xd1ac('0x1c')](_0x40f82e)[_0xd1ac('0x1e')](_0x5f28d4);}};}function respondWithFilteredResult(_0x21b39f,_0x174f6b){return function(_0x2bfe7c){if(_0x2bfe7c){var _0x35de2c=typeof _0x174f6b['offset']==='undefined'&&typeof _0x174f6b[_0xd1ac('0x1f')]===_0xd1ac('0x20');var _0x4fb9be=_0x2bfe7c[_0xd1ac('0x21')];var _0x2073fd=_0x35de2c?0x0:_0x174f6b[_0xd1ac('0x22')];var _0x4a482c=_0x35de2c?_0x2bfe7c[_0xd1ac('0x21')]:_0x174f6b[_0xd1ac('0x22')]+_0x174f6b['limit'];var _0x4c6f7c;if(_0x4a482c>=_0x4fb9be){_0x4a482c=_0x4fb9be;_0x4c6f7c=0xc8;}else{_0x4c6f7c=0xce;}_0x21b39f[_0xd1ac('0x1c')](_0x4c6f7c);return _0x21b39f[_0xd1ac('0x23')](_0xd1ac('0x24'),_0x2073fd+'-'+_0x4a482c+'/'+_0x4fb9be)[_0xd1ac('0x1e')](_0x2bfe7c);}return null;};}function patchUpdates(_0x3e5e6d){return function(_0x370ed9){try{jsonpatch['apply'](_0x370ed9,_0x3e5e6d,!![]);}catch(_0x385458){return BPromise[_0xd1ac('0x25')](_0x385458);}return _0x370ed9['save']();};}function saveUpdates(_0x4b03b7,_0x387904){return function(_0x11ed38){if(_0x11ed38){return _0x11ed38['update'](_0x4b03b7)[_0xd1ac('0x26')](function(_0xbc93ab){return _0xbc93ab;});}return null;};}function removeEntity(_0x42333f,_0x5ad16b){return function(_0x2932de){if(_0x2932de){return _0x2932de['destroy']()[_0xd1ac('0x26')](function(){_0x42333f[_0xd1ac('0x1c')](0xcc)[_0xd1ac('0x1d')]();});}};}function handleEntityNotFound(_0x4328d7,_0x641ac2){return function(_0x177a03){if(!_0x177a03){_0x4328d7['sendStatus'](0x194);}return _0x177a03;};}function handleError(_0x29d00c,_0x57eb07){_0x57eb07=_0x57eb07||0x1f4;return function(_0x17a1ed){logger['error'](_0x17a1ed[_0xd1ac('0x27')]);if(_0x17a1ed['name']){delete _0x17a1ed[_0xd1ac('0x28')];}_0x29d00c[_0xd1ac('0x1c')](_0x57eb07)[_0xd1ac('0x29')](_0x17a1ed);};}exports[_0xd1ac('0x2a')]=function(_0x450df8,_0x170e86){var _0x9617ef={},_0x4a769d={},_0x26e0bd={'count':0x0,'rows':[]};var _0x4e9c86=_[_0xd1ac('0x2b')](db[_0xd1ac('0x2c')][_0xd1ac('0x2d')],function(_0x4213d0){return{'name':_0x4213d0[_0xd1ac('0x2e')],'type':_0x4213d0[_0xd1ac('0x2f')][_0xd1ac('0x30')]};});_0x4a769d['model']=_[_0xd1ac('0x2b')](_0x4e9c86,'name');_0x4a769d[_0xd1ac('0x31')]=_[_0xd1ac('0x32')](_0x450df8[_0xd1ac('0x31')]);_0x4a769d[_0xd1ac('0x33')]=_[_0xd1ac('0x34')](_0x4a769d[_0xd1ac('0x35')],_0x4a769d[_0xd1ac('0x31')]);_0x9617ef[_0xd1ac('0x36')]=_[_0xd1ac('0x34')](_0x4a769d[_0xd1ac('0x35')],qs['fields'](_0x450df8[_0xd1ac('0x31')]['fields']));_0x9617ef[_0xd1ac('0x36')]=_0x9617ef[_0xd1ac('0x36')][_0xd1ac('0x37')]?_0x9617ef[_0xd1ac('0x36')]:_0x4a769d['model'];if(!_0x450df8[_0xd1ac('0x31')][_0xd1ac('0x38')](_0xd1ac('0x39'))){_0x9617ef[_0xd1ac('0x1f')]=qs[_0xd1ac('0x1f')](_0x450df8[_0xd1ac('0x31')][_0xd1ac('0x1f')]);_0x9617ef[_0xd1ac('0x22')]=qs[_0xd1ac('0x22')](_0x450df8[_0xd1ac('0x31')][_0xd1ac('0x22')]);}_0x9617ef[_0xd1ac('0x3a')]=qs[_0xd1ac('0x3b')](_0x450df8[_0xd1ac('0x31')][_0xd1ac('0x3b')]);_0x9617ef[_0xd1ac('0x3c')]=qs[_0xd1ac('0x33')](_[_0xd1ac('0x3d')](_0x450df8[_0xd1ac('0x31')],_0x4a769d[_0xd1ac('0x33')]),_0x4e9c86);if(_0x450df8[_0xd1ac('0x31')][_0xd1ac('0x3e')]){_0x9617ef['where']=_[_0xd1ac('0x3f')](_0x9617ef['where'],{'$or':_['map'](_0x4e9c86,function(_0x140573){if(_0x140573[_0xd1ac('0x2f')]!=='VIRTUAL'){var _0xd15596={};_0xd15596[_0x140573[_0xd1ac('0x28')]]={'$like':'%'+_0x450df8[_0xd1ac('0x31')][_0xd1ac('0x3e')]+'%'};return _0xd15596;}})});}_0x9617ef=_[_0xd1ac('0x3f')]({},_0x9617ef,_0x450df8[_0xd1ac('0x40')]);var _0x384592={'where':_0x9617ef[_0xd1ac('0x3c')]};return db[_0xd1ac('0x2c')][_0xd1ac('0x21')](_0x384592)[_0xd1ac('0x26')](function(_0x5ecfed){_0x26e0bd[_0xd1ac('0x21')]=_0x5ecfed;if(_0x450df8[_0xd1ac('0x31')][_0xd1ac('0x41')]){_0x9617ef['include']=[{'all':!![]}];}return db[_0xd1ac('0x2c')][_0xd1ac('0x42')](_0x9617ef);})[_0xd1ac('0x26')](function(_0x294444){_0x26e0bd['rows']=_0x294444;return _0x26e0bd;})[_0xd1ac('0x26')](respondWithFilteredResult(_0x170e86,_0x9617ef))[_0xd1ac('0x43')](handleError(_0x170e86,null));};exports[_0xd1ac('0x44')]=function(_0x436df9,_0x28414b){var _0x34228b={'raw':!![],'where':{'id':_0x436df9[_0xd1ac('0x45')]['id']}},_0x4ee260={};_0x4ee260['model']=_[_0xd1ac('0x32')](db[_0xd1ac('0x2c')]['rawAttributes']);_0x4ee260[_0xd1ac('0x31')]=_[_0xd1ac('0x32')](_0x436df9['query']);_0x4ee260[_0xd1ac('0x33')]=_['intersection'](_0x4ee260['model'],_0x4ee260['query']);_0x34228b[_0xd1ac('0x36')]=_['intersection'](_0x4ee260['model'],qs['fields'](_0x436df9[_0xd1ac('0x31')][_0xd1ac('0x46')]));_0x34228b[_0xd1ac('0x36')]=_0x34228b[_0xd1ac('0x36')][_0xd1ac('0x37')]?_0x34228b[_0xd1ac('0x36')]:_0x4ee260['model'];if(_0x436df9[_0xd1ac('0x31')][_0xd1ac('0x41')]){_0x34228b[_0xd1ac('0x47')]=[{'all':!![]}];}_0x34228b=_[_0xd1ac('0x3f')]({},_0x34228b,_0x436df9[_0xd1ac('0x40')]);return db[_0xd1ac('0x2c')][_0xd1ac('0x48')](_0x34228b)[_0xd1ac('0x26')](handleEntityNotFound(_0x28414b,null))[_0xd1ac('0x26')](respondWithResult(_0x28414b,null))['catch'](handleError(_0x28414b,null));};exports['create']=function(_0x2bb2a6,_0x43dba8){return db[_0xd1ac('0x2c')]['create'](_0x2bb2a6[_0xd1ac('0x49')],{})[_0xd1ac('0x26')](respondWithResult(_0x43dba8,0xc9))[_0xd1ac('0x43')](handleError(_0x43dba8,null));};exports[_0xd1ac('0x4a')]=function(_0x428689,_0xf97f74){if(_0x428689[_0xd1ac('0x49')]['id']){delete _0x428689[_0xd1ac('0x49')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x428689[_0xd1ac('0x45')]['id']}})[_0xd1ac('0x26')](handleEntityNotFound(_0xf97f74,null))[_0xd1ac('0x26')](saveUpdates(_0x428689['body'],null))['then'](respondWithResult(_0xf97f74,null))[_0xd1ac('0x43')](handleError(_0xf97f74,null));};exports[_0xd1ac('0x4b')]=function(_0x7237bc,_0x51a76a){return db[_0xd1ac('0x2c')][_0xd1ac('0x48')]({'where':{'id':_0x7237bc[_0xd1ac('0x45')]['id']}})[_0xd1ac('0x26')](handleEntityNotFound(_0x51a76a,null))[_0xd1ac('0x26')](removeEntity(_0x51a76a,null))['catch'](handleError(_0x51a76a,null));};exports[_0xd1ac('0x4c')]=function(_0x2287b3,_0x2e907f){return db[_0xd1ac('0x2c')][_0xd1ac('0x4c')]()[_0xd1ac('0x26')](respondWithResult(_0x2e907f,null))['catch'](handleError(_0x2e907f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index ca4eef3..ce1f230 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 _0xb1fc=['lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','define','report_sms_transfer','uniqueid'];(function(_0x3ddd35,_0x723b){var _0x457c35=function(_0x2285b5){while(--_0x2285b5){_0x3ddd35['push'](_0x3ddd35['shift']());}};_0x457c35(++_0x723b);}(_0xb1fc,0x78));var _0xcb1f=function(_0x7f7e71,_0x546848){_0x7f7e71=_0x7f7e71-0x0;var _0x381571=_0xb1fc[_0x7f7e71];return _0x381571;};'use strict';var _=require(_0xcb1f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcb1f('0x1'));var BPromise=require(_0xcb1f('0x2'));var rp=require(_0xcb1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb1f('0x4'));var config=require(_0xcb1f('0x5'));var attributes=require(_0xcb1f('0x6'));module['exports']=function(_0x58f32c,_0x2d450b){return _0x58f32c[_0xcb1f('0x7')]('SmsTransferReport',attributes,{'tableName':_0xcb1f('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcb1f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x853c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x2f8055,_0x3948e3){var _0x5966f2=function(_0x2dd7c4){while(--_0x2dd7c4){_0x2f8055['push'](_0x2f8055['shift']());}};_0x5966f2(++_0x3948e3);}(_0x853c,0x1a1));var _0xc853=function(_0x5134d9,_0x50cca6){_0x5134d9=_0x5134d9-0x0;var _0x44b670=_0x853c[_0x5134d9];return _0x44b670;};'use strict';var _=require(_0xc853('0x0'));var util=require('util');var logger=require(_0xc853('0x1'))(_0xc853('0x2'));var moment=require(_0xc853('0x3'));var BPromise=require(_0xc853('0x4'));var rp=require(_0xc853('0x5'));var fs=require('fs');var path=require(_0xc853('0x6'));var rimraf=require(_0xc853('0x7'));var config=require(_0xc853('0x8'));var attributes=require(_0xc853('0x9'));module[_0xc853('0xa')]=function(_0x257e3a,_0x4f1dd0){return _0x257e3a[_0xc853('0xb')]('SmsTransferReport',attributes,{'tableName':_0xc853('0xc'),'paranoid':![],'indexes':[{'name':_0xc853('0xd'),'fields':[_0xc853('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 5865b90..4c52026 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 _0x4b19=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b2f90,_0x2dff29){var _0x21864c=function(_0x4467cb){while(--_0x4467cb){_0x3b2f90['push'](_0x3b2f90['shift']());}};_0x21864c(++_0x2dff29);}(_0x4b19,0x195));var _0x94b1=function(_0x1c0e80,_0x31928e){_0x1c0e80=_0x1c0e80-0x0;var _0x39ce51=_0x4b19[_0x1c0e80];return _0x39ce51;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var moment=require(_0x94b1('0x1'));var BPromise=require(_0x94b1('0x2'));var rs=require(_0x94b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b1('0x4'))['db'];var utils=require(_0x94b1('0x5'));var logger=require(_0x94b1('0x6'))('rpc');var config=require(_0x94b1('0x7'));var jayson=require(_0x94b1('0x8'));var client=jayson['client'][_0x94b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110a52,_0x4ea1f9,_0x40c69c){return new BPromise(function(_0x201a02,_0xad0a85){return client['request'](_0x110a52,_0x40c69c)[_0x94b1('0xa')](function(_0x4f948b){logger['info'](_0x94b1('0xb'),_0x4ea1f9,_0x94b1('0xc'));logger[_0x94b1('0xd')](_0x94b1('0xe'),_0x4ea1f9,_0x94b1('0xc'),JSON[_0x94b1('0xf')](_0x4f948b));if(_0x4f948b['error']){if(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x11')]===0x1f4){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x4f948b['error']['message']);return _0xad0a85(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4ea1f9,_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);return _0x201a02(_0x4f948b['error'][_0x94b1('0x12')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x4ea1f9,_0x94b1('0xc'));_0x201a02(_0x4f948b[_0x94b1('0x13')][_0x94b1('0x12')]);}})[_0x94b1('0x14')](function(_0x494138){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x494138);_0xad0a85(_0x494138);});});} \ No newline at end of file +var _0x5a93=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2b3735,_0x5af12c){var _0x32ab8e=function(_0x16b6f0){while(--_0x16b6f0){_0x2b3735['push'](_0x2b3735['shift']());}};_0x32ab8e(++_0x5af12c);}(_0x5a93,0xf6));var _0x35a9=function(_0x179829,_0x1b3c22){_0x179829=_0x179829-0x0;var _0x339572=_0x5a93[_0x179829];return _0x339572;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var moment=require('moment');var BPromise=require(_0x35a9('0x1'));var rs=require(_0x35a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x35a9('0x3'));var logger=require(_0x35a9('0x4'))(_0x35a9('0x5'));var config=require('../../config/environment');var jayson=require(_0x35a9('0x6'));var client=jayson[_0x35a9('0x7')][_0x35a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x354490,_0x271228,_0x45e6f7){return new BPromise(function(_0x71d143,_0x22d770){return client[_0x35a9('0x9')](_0x354490,_0x45e6f7)[_0x35a9('0xa')](function(_0x5b4f25){logger[_0x35a9('0xb')](_0x35a9('0xc'),_0x271228,_0x35a9('0xd'));logger[_0x35a9('0xe')](_0x35a9('0xf'),_0x271228,_0x35a9('0xd'),JSON['stringify'](_0x5b4f25));if(_0x5b4f25[_0x35a9('0x10')]){if(_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x11')]===0x1f4){logger[_0x35a9('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x271228,_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);return _0x22d770(_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);}logger['error'](_0x35a9('0xc'),_0x271228,_0x5b4f25[_0x35a9('0x10')][_0x35a9('0x12')]);return _0x71d143(_0x5b4f25[_0x35a9('0x10')]['message']);}else{logger[_0x35a9('0xb')](_0x35a9('0xc'),_0x271228,_0x35a9('0xd'));_0x71d143(_0x5b4f25['result'][_0x35a9('0x12')]);}})[_0x35a9('0x13')](function(_0x14eeb5){logger[_0x35a9('0x10')](_0x35a9('0xc'),_0x271228,_0x14eeb5);_0x22d770(_0x14eeb5);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f038ec7..78a0519 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 _0x118f=['join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','file','create','delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage'];(function(_0x27c99a,_0x46adc6){var _0x1653d3=function(_0x5d7afb){while(--_0x5d7afb){_0x27c99a['push'](_0x27c99a['shift']());}};_0x1653d3(++_0x46adc6);}(_0x118f,0xc2));var _0xf118=function(_0x2c6147,_0x30daee){_0x2c6147=_0x2c6147-0x0;var _0x4bdee8=_0x118f[_0x2c6147];return _0x4bdee8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf118('0x0'));var timeout=require(_0xf118('0x1'));var express=require(_0xf118('0x2'));var router=express[_0xf118('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf118('0x4'));var interaction=require(_0xf118('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xf118('0x6')]('/',auth['isAuthenticated'](),controller[_0xf118('0x7')]);router[_0xf118('0x6')](_0xf118('0x8'),auth[_0xf118('0x9')](),controller[_0xf118('0xa')]);router[_0xf118('0x6')](_0xf118('0xb'),auth[_0xf118('0x9')](),controller[_0xf118('0xc')]);var upload=multer({'storage':multer[_0xf118('0xd')]({'destination':function(_0x3905d0,_0x557693,_0x417801){_0x417801(null,path[_0xf118('0xe')](config['root'],_0xf118('0xf')));},'filename':function(_0x3479dd,_0x4053d0,_0x4f7804){_0x4053d0[_0xf118('0x10')]=_0x4053d0[_0xf118('0x10')][_0xf118('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f7804(null,util[_0xf118('0x12')](_0xf118('0x13'),path[_0xf118('0x14')](_0x4053d0[_0xf118('0x10')],path[_0xf118('0x15')](_0x4053d0['originalname'])),Date['now'](),path[_0xf118('0x15')](_0x4053d0['originalname'])));}})});router[_0xf118('0x16')]('/',upload['single'](_0xf118('0x17')),controller[_0xf118('0x18')]);router['put']('/:id',auth[_0xf118('0x9')](),controller['update']);router[_0xf118('0x19')](_0xf118('0x8'),auth[_0xf118('0x9')](),controller[_0xf118('0x19')]);module['exports']=router; \ No newline at end of file +var _0x3b47=['single','create','put','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','/:id/download','isAuthenticated','download','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','now','extname','post'];(function(_0x27fcc1,_0x3537a1){var _0x5b8476=function(_0x551bf2){while(--_0x551bf2){_0x27fcc1['push'](_0x27fcc1['shift']());}};_0x5b8476(++_0x3537a1);}(_0x3b47,0x1d4));var _0x73b4=function(_0x9568cd,_0x1640fe){_0x9568cd=_0x9568cd-0x0;var _0x13c849=_0x3b47[_0x9568cd];return _0x13c849;};'use strict';var multer=require(_0x73b4('0x0'));var util=require(_0x73b4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x73b4('0x2'));var router=express[_0x73b4('0x3')]();var fs_extra=require(_0x73b4('0x4'));var auth=require(_0x73b4('0x5'));var interaction=require(_0x73b4('0x6'));var config=require(_0x73b4('0x7'));var controller=require(_0x73b4('0x8'));router[_0x73b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x73b4('0xa')]);router[_0x73b4('0x9')](_0x73b4('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x73b4('0xc'),auth[_0x73b4('0xd')](),controller[_0x73b4('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32abf1,_0x16d8f2,_0x26b233){_0x26b233(null,path[_0x73b4('0xf')](config[_0x73b4('0x10')],_0x73b4('0x11')));},'filename':function(_0x20cb6c,_0x53624d,_0x456c1a){_0x53624d[_0x73b4('0x12')]=_0x53624d['originalname'][_0x73b4('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x456c1a(null,util['format'](_0x73b4('0x14'),path[_0x73b4('0x15')](_0x53624d[_0x73b4('0x12')],path['extname'](_0x53624d[_0x73b4('0x12')])),Date[_0x73b4('0x16')](),path[_0x73b4('0x17')](_0x53624d[_0x73b4('0x12')])));}})});router[_0x73b4('0x18')]('/',upload[_0x73b4('0x19')]('file'),controller[_0x73b4('0x1a')]);router[_0x73b4('0x1b')](_0x73b4('0xb'),auth[_0x73b4('0xd')](),controller['update']);router[_0x73b4('0x1c')](_0x73b4('0xb'),auth[_0x73b4('0xd')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 74f60fe..f9aef6c 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 _0xcc60=['exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0xbc90df,_0x47a814){var _0x4b3cd2=function(_0x40278f){while(--_0x40278f){_0xbc90df['push'](_0xbc90df['shift']());}};_0x4b3cd2(++_0x47a814);}(_0xcc60,0x127));var _0x0cc6=function(_0x2b63db,_0x217456){_0x2b63db=_0x2b63db-0x0;var _0x174778=_0xcc60[_0x2b63db];return _0x174778;};'use strict';var Sequelize=require('sequelize');module[_0x0cc6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x0cc6('0x1')]},'display_name':{'type':Sequelize[_0x0cc6('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x0cc6('0x1')]},'original_format':{'type':Sequelize[_0x0cc6('0x1')]},'original_duration':{'type':Sequelize[_0x0cc6('0x2')]},'original_sampleCount':{'type':Sequelize[_0x0cc6('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x0cc6('0x3')]},'original_sampleRate':{'type':Sequelize[_0x0cc6('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x0cc6('0x3')]},'converted_channelCount':{'type':Sequelize[_0x0cc6('0x4')]},'converted_bitRate':{'type':Sequelize[_0x0cc6('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe63f=['FLOAT','BIGINT','INTEGER','sequelize','STRING','name'];(function(_0x4f33ce,_0x4ac092){var _0x4bfa35=function(_0x15530d){while(--_0x15530d){_0x4f33ce['push'](_0x4f33ce['shift']());}};_0x4bfa35(++_0x4ac092);}(_0xe63f,0xed));var _0xfe63=function(_0x2d20b8,_0x3ac9fb){_0x2d20b8=_0x2d20b8-0x0;var _0x41e600=_0xe63f[_0x2d20b8];return _0x41e600;};'use strict';var Sequelize=require(_0xfe63('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe63('0x1')],'unique':_0xfe63('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xfe63('0x1')]},'display_name':{'type':Sequelize[_0xfe63('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xfe63('0x1')]},'original_format':{'type':Sequelize[_0xfe63('0x1')]},'original_duration':{'type':Sequelize[_0xfe63('0x3')]},'original_sampleCount':{'type':Sequelize[_0xfe63('0x4')]},'original_channelCount':{'type':Sequelize[_0xfe63('0x5')]},'original_bitRate':{'type':Sequelize[_0xfe63('0x4')]},'original_sampleRate':{'type':Sequelize[_0xfe63('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xfe63('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xfe63('0x4')]},'converted_channelCount':{'type':Sequelize[_0xfe63('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xfe63('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 5436226..70c8ac2 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 _0xfe42=['transcode','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','description','delete','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','get','Sounds','UserProfileResource','error','name','send','index','map','Sound','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','order','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','options','find','converted_format','existsSync','join','server/files/sounds/converted','save_name','Sequelize','ValidationError','root','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777'];(function(_0x26c562,_0xe4be5c){var _0x462368=function(_0x38db51){while(--_0x38db51){_0x26c562['push'](_0x26c562['shift']());}};_0x462368(++_0xe4be5c);}(_0xfe42,0x1e1));var _0x2fe4=function(_0x29af8f,_0x2cd760){_0x29af8f=_0x29af8f-0x0;var _0x1adb1e=_0xfe42[_0x29af8f];return _0x1adb1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2fe4('0x0'));var jsonpatch=require(_0x2fe4('0x1'));var rp=require(_0x2fe4('0x2'));var moment=require(_0x2fe4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2fe4('0x4'));var util=require('util');var path=require(_0x2fe4('0x5'));var sox=require(_0x2fe4('0x6'));var csv=require('to-csv');var ejs=require(_0x2fe4('0x7'));var fs=require('fs');var fs_extra=require(_0x2fe4('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2fe4('0x9'));var Papa=require(_0x2fe4('0xa'));var Redis=require('ioredis');var authService=require(_0x2fe4('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x2fe4('0xc'));var hardwareService=require(_0x2fe4('0xd'));var logger=require(_0x2fe4('0xe'))(_0x2fe4('0xf'));var utils=require('../../config/utils');var config=require(_0x2fe4('0x10'));var licenseUtil=require(_0x2fe4('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dcba1,_0x4ba8fb){_0x4ba8fb=_0x4ba8fb||0xcc;return function(_0x22e072){if(_0x22e072){return _0x4dcba1[_0x2fe4('0x12')](_0x4ba8fb);}return _0x4dcba1[_0x2fe4('0x13')](_0x4ba8fb)[_0x2fe4('0x14')]();};}function respondWithResult(_0x296531,_0x5cb9bd){_0x5cb9bd=_0x5cb9bd||0xc8;return function(_0x287ba8){if(_0x287ba8){return _0x296531[_0x2fe4('0x13')](_0x5cb9bd)[_0x2fe4('0x15')](_0x287ba8);}};}function respondWithFilteredResult(_0x44ce52,_0x1b5868){return function(_0xd596a5){if(_0xd596a5){var _0x589943=typeof _0x1b5868[_0x2fe4('0x16')]===_0x2fe4('0x17')&&typeof _0x1b5868[_0x2fe4('0x18')]==='undefined';var _0x1417d0=_0xd596a5['count'];var _0x116fc3=_0x589943?0x0:_0x1b5868[_0x2fe4('0x16')];var _0x279d35=_0x589943?_0xd596a5[_0x2fe4('0x19')]:_0x1b5868[_0x2fe4('0x16')]+_0x1b5868[_0x2fe4('0x18')];var _0x50c281;if(_0x279d35>=_0x1417d0){_0x279d35=_0x1417d0;_0x50c281=0xc8;}else{_0x50c281=0xce;}_0x44ce52[_0x2fe4('0x13')](_0x50c281);return _0x44ce52['set'](_0x2fe4('0x1a'),_0x116fc3+'-'+_0x279d35+'/'+_0x1417d0)['json'](_0xd596a5);}return null;};}function patchUpdates(_0x47c825){return function(_0x219121){try{jsonpatch['apply'](_0x219121,_0x47c825,!![]);}catch(_0x7ce622){return BPromise[_0x2fe4('0x1b')](_0x7ce622);}return _0x219121['save']();};}function saveUpdates(_0xa8181d,_0x82fc04){return function(_0x20bd51){if(_0x20bd51){return _0x20bd51[_0x2fe4('0x1c')](_0xa8181d)['then'](function(_0x4dce94){return _0x4dce94;});}return null;};}function removeEntity(_0x223f4f,_0x1365b6){return function(_0x424ca6){if(_0x424ca6){return _0x424ca6[_0x2fe4('0x1d')]()[_0x2fe4('0x1e')](function(){var _0x1fff0e=_0x424ca6[_0x2fe4('0x1f')]({'plain':!![]});var _0x151327=_0x2fe4('0x20');return db[_0x2fe4('0x21')][_0x2fe4('0x1d')]({'where':{'type':_0x151327,'resourceId':_0x1fff0e['id']}})[_0x2fe4('0x1e')](function(){return _0x424ca6;});})['then'](function(){_0x223f4f[_0x2fe4('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37c950,_0x3855ed){return function(_0x6fb631){if(!_0x6fb631){_0x37c950[_0x2fe4('0x12')](0x194);}return _0x6fb631;};}function handleError(_0x1e8e0a,_0x28efb9){_0x28efb9=_0x28efb9||0x1f4;return function(_0x20b149){logger[_0x2fe4('0x22')](_0x20b149['stack']);if(_0x20b149[_0x2fe4('0x23')]){delete _0x20b149[_0x2fe4('0x23')];}_0x1e8e0a[_0x2fe4('0x13')](_0x28efb9)[_0x2fe4('0x24')](_0x20b149);};}exports[_0x2fe4('0x25')]=function(_0x5d2587,_0xe8436){var _0x1ffe8b={},_0x411fab={},_0x10d1b3={'count':0x0,'rows':[]};var _0xe2e1d5=_[_0x2fe4('0x26')](db[_0x2fe4('0x27')]['rawAttributes'],function(_0x2fe075){return{'name':_0x2fe075[_0x2fe4('0x28')],'type':_0x2fe075[_0x2fe4('0x29')]['key']};});_0x411fab[_0x2fe4('0x2a')]=_['map'](_0xe2e1d5,_0x2fe4('0x23'));_0x411fab[_0x2fe4('0x2b')]=_['keys'](_0x5d2587[_0x2fe4('0x2b')]);_0x411fab['filters']=_['intersection'](_0x411fab[_0x2fe4('0x2a')],_0x411fab[_0x2fe4('0x2b')]);_0x1ffe8b['attributes']=_[_0x2fe4('0x2c')](_0x411fab[_0x2fe4('0x2a')],qs[_0x2fe4('0x2d')](_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x2d')]));_0x1ffe8b[_0x2fe4('0x2e')]=_0x1ffe8b['attributes']['length']?_0x1ffe8b[_0x2fe4('0x2e')]:_0x411fab[_0x2fe4('0x2a')];if(!_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x2f')]('nolimit')){_0x1ffe8b[_0x2fe4('0x18')]=qs[_0x2fe4('0x18')](_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x18')]);_0x1ffe8b[_0x2fe4('0x16')]=qs[_0x2fe4('0x16')](_0x5d2587['query'][_0x2fe4('0x16')]);}_0x1ffe8b[_0x2fe4('0x30')]=qs['sort'](_0x5d2587[_0x2fe4('0x2b')]['sort']);_0x1ffe8b[_0x2fe4('0x31')]=qs[_0x2fe4('0x32')](_[_0x2fe4('0x33')](_0x5d2587[_0x2fe4('0x2b')],_0x411fab[_0x2fe4('0x32')]),_0xe2e1d5);if(_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x34')]){_0x1ffe8b[_0x2fe4('0x31')]=_[_0x2fe4('0x35')](_0x1ffe8b[_0x2fe4('0x31')],{'$or':_[_0x2fe4('0x26')](_0xe2e1d5,function(_0x2ce188){if(_0x2ce188[_0x2fe4('0x29')]!=='VIRTUAL'){var _0x192635={};_0x192635[_0x2ce188[_0x2fe4('0x23')]]={'$like':'%'+_0x5d2587['query'][_0x2fe4('0x34')]+'%'};return _0x192635;}})});}_0x1ffe8b=_[_0x2fe4('0x35')]({},_0x1ffe8b,_0x5d2587['options']);var _0x372966={'where':_0x1ffe8b['where']};return db[_0x2fe4('0x27')][_0x2fe4('0x19')](_0x372966)[_0x2fe4('0x1e')](function(_0x22b275){_0x10d1b3[_0x2fe4('0x19')]=_0x22b275;if(_0x5d2587[_0x2fe4('0x2b')][_0x2fe4('0x36')]){_0x1ffe8b['include']=[{'all':!![]}];}return db[_0x2fe4('0x27')][_0x2fe4('0x37')](_0x1ffe8b);})[_0x2fe4('0x1e')](function(_0x42eef1){_0x10d1b3[_0x2fe4('0x38')]=_0x42eef1;return _0x10d1b3;})['then'](respondWithFilteredResult(_0xe8436,_0x1ffe8b))[_0x2fe4('0x39')](handleError(_0xe8436,null));};exports[_0x2fe4('0x3a')]=function(_0x280e78,_0xf24a2b){var _0x3af0ab={'raw':!![],'where':{'id':_0x280e78[_0x2fe4('0x3b')]['id']}},_0x8242ed={};_0x8242ed[_0x2fe4('0x2a')]=_[_0x2fe4('0x3c')](db[_0x2fe4('0x27')][_0x2fe4('0x3d')]);_0x8242ed[_0x2fe4('0x2b')]=_[_0x2fe4('0x3c')](_0x280e78['query']);_0x8242ed[_0x2fe4('0x32')]=_[_0x2fe4('0x2c')](_0x8242ed[_0x2fe4('0x2a')],_0x8242ed['query']);_0x3af0ab[_0x2fe4('0x2e')]=_[_0x2fe4('0x2c')](_0x8242ed['model'],qs[_0x2fe4('0x2d')](_0x280e78['query']['fields']));_0x3af0ab[_0x2fe4('0x2e')]=_0x3af0ab[_0x2fe4('0x2e')][_0x2fe4('0x3e')]?_0x3af0ab[_0x2fe4('0x2e')]:_0x8242ed[_0x2fe4('0x2a')];if(_0x280e78[_0x2fe4('0x2b')]['includeAll']){_0x3af0ab[_0x2fe4('0x3f')]=[{'all':!![]}];}_0x3af0ab=_[_0x2fe4('0x35')]({},_0x3af0ab,_0x280e78[_0x2fe4('0x40')]);return db['Sound'][_0x2fe4('0x41')](_0x3af0ab)[_0x2fe4('0x1e')](handleEntityNotFound(_0xf24a2b,null))['then'](respondWithResult(_0xf24a2b,null))[_0x2fe4('0x39')](handleError(_0xf24a2b,null));};exports['download']=function(_0x1ed8cf,_0x182331,_0x1e983c){return db[_0x2fe4('0x27')][_0x2fe4('0x41')]({'where':{'id':_0x1ed8cf[_0x2fe4('0x3b')]['id']},'attributes':[_0x2fe4('0x23'),'save_name',_0x2fe4('0x42')],'raw':!![]})[_0x2fe4('0x1e')](handleEntityNotFound(_0x182331,null))[_0x2fe4('0x1e')](function(_0x2c265e){if(_0x2c265e){if(!fs[_0x2fe4('0x43')](path[_0x2fe4('0x44')](config['root'],_0x2fe4('0x45'),_0x2c265e[_0x2fe4('0x46')]+'.'+_0x2c265e[_0x2fe4('0x42')]))){throw new db[(_0x2fe4('0x47'))][(_0x2fe4('0x48'))]('Sound\x20not\x20found');}return _0x182331['download'](path['join'](config[_0x2fe4('0x49')],_0x2fe4('0x45'),util[_0x2fe4('0x4a')]('%s.%s',_0x2c265e[_0x2fe4('0x46')],_0x2c265e[_0x2fe4('0x42')])),util['format'](_0x2fe4('0x4b'),_0x2c265e['name'],_0x2c265e[_0x2fe4('0x42')]));}return null;})[_0x2fe4('0x39')](handleError(_0x182331,null));};exports[_0x2fe4('0x4c')]=function(_0x7ffca7,_0xc63777,_0x591092){var _0x5e4c00={'name':path[_0x2fe4('0x4d')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x4f')],path[_0x2fe4('0x50')](_0x7ffca7['file'][_0x2fe4('0x4f')])),'save_name':path[_0x2fe4('0x4d')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')],path['extname'](_0x7ffca7['file'][_0x2fe4('0x51')])),'original_format':path['extname'](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x4f')])['substring'](0x1),'converted_format':_0x2fe4('0x52')};var _0x16f5db=path[_0x2fe4('0x44')](config[_0x2fe4('0x49')],_0x2fe4('0x53'),_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')]);var _0x458714=path['join'](config[_0x2fe4('0x49')],'server/files/sounds/converted',util[_0x2fe4('0x4a')](_0x2fe4('0x4b'),path[_0x2fe4('0x4d')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')],path[_0x2fe4('0x50')](_0x7ffca7[_0x2fe4('0x4e')][_0x2fe4('0x51')])),_0x5e4c00[_0x2fe4('0x42')]));logger['info'](_0x2fe4('0x54'),_0x16f5db);logger[_0x2fe4('0x55')](_0x2fe4('0x56'),_0x458714);try{fs[_0x2fe4('0x57')](_0x16f5db,parseInt(_0x2fe4('0x58'),0x8));var _0xfb9c6f=sox[_0x2fe4('0x59')](_0x16f5db,_0x458714,{'sampleRate':0x1f40,'format':_0x2fe4('0x52'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xfb9c6f['on'](_0x2fe4('0x22'),function(_0x1f9425){fs['unlinkSync'](_0x16f5db);_0xc63777[_0x2fe4('0x13')](0x1f4)['send'](_0x1f9425);});_0xfb9c6f['on'](_0x2fe4('0x5a'),function(_0x105442){_0x5e4c00['original_duration']=isNaN(_0x105442['duration'])?null:_0x105442[_0x2fe4('0x5b')]*0x3e8;_0x5e4c00[_0x2fe4('0x5c')]=isNaN(_0x105442['sampleCount'])?null:_0x105442[_0x2fe4('0x5d')];_0x5e4c00[_0x2fe4('0x5e')]=isNaN(_0x105442[_0x2fe4('0x5f')])?null:_0x105442[_0x2fe4('0x5f')];_0x5e4c00[_0x2fe4('0x60')]=isNaN(_0x105442[_0x2fe4('0x61')])?null:_0x105442[_0x2fe4('0x61')];_0x5e4c00[_0x2fe4('0x62')]=isNaN(_0x105442[_0x2fe4('0x63')])?null:_0x105442[_0x2fe4('0x63')];});_0xfb9c6f['on'](_0x2fe4('0x64'),function(_0x25d050){_0x5e4c00[_0x2fe4('0x65')]=isNaN(_0x25d050[_0x2fe4('0x5b')])?null:_0x25d050[_0x2fe4('0x5b')]*0x3e8;_0x5e4c00['converted_sampleCount']=isNaN(_0x25d050[_0x2fe4('0x5d')])?null:_0x25d050[_0x2fe4('0x5d')];_0x5e4c00[_0x2fe4('0x66')]=isNaN(_0x25d050[_0x2fe4('0x5f')])?null:_0x25d050[_0x2fe4('0x5f')];_0x5e4c00[_0x2fe4('0x67')]=isNaN(_0x25d050[_0x2fe4('0x61')])?null:_0x25d050[_0x2fe4('0x61')];_0x5e4c00[_0x2fe4('0x68')]=isNaN(_0x25d050[_0x2fe4('0x63')])?null:_0x25d050['sampleRate'];});_0xfb9c6f['on'](_0x2fe4('0x14'),function(){fs[_0x2fe4('0x57')](_0x458714,parseInt(_0x2fe4('0x58'),0x8));return db[_0x2fe4('0x27')][_0x2fe4('0x4c')](_0x5e4c00)[_0x2fe4('0x1e')](function(_0x18cf55){var _0x237a69={'role':_0x7ffca7['body'][_0x2fe4('0x69')],'userProfileId':_0x7ffca7[_0x2fe4('0x6a')][_0x2fe4('0x6b')]};if(!_0x237a69)throw new Error(_0x2fe4('0x6c'));if(_0x237a69[_0x2fe4('0x69')]===_0x2fe4('0x6d')){var _0x5e3955=_0x18cf55[_0x2fe4('0x1f')]({'plain':!![]});return db['UserProfileSection'][_0x2fe4('0x41')]({'where':{'name':_0x2fe4('0x20'),'userProfileId':_0x237a69[_0x2fe4('0x6b')]},'raw':!![]})[_0x2fe4('0x1e')](function(_0x58f0b9){if(_0x58f0b9&&_0x58f0b9[_0x2fe4('0x6e')]===0x0){return db[_0x2fe4('0x21')][_0x2fe4('0x4c')]({'name':_0x5e3955[_0x2fe4('0x23')],'resourceId':_0x5e3955['id'],'type':_0x58f0b9[_0x2fe4('0x23')],'sectionId':_0x58f0b9['id']},{})[_0x2fe4('0x1e')](function(){return _0x18cf55;});}else{return _0x18cf55;}})[_0x2fe4('0x39')](function(_0x2a81d3){logger[_0x2fe4('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a81d3);throw _0x2a81d3;});}return _0x18cf55;})[_0x2fe4('0x1e')](respondWithResult(_0xc63777,null))['catch'](handleError(_0xc63777,null));});_0xfb9c6f['start']();}catch(_0x13152c){_0xc63777[_0x2fe4('0x13')](0x1f4)[_0x2fe4('0x24')](_0x13152c);}};exports[_0x2fe4('0x1c')]=function(_0x33b640,_0x38b59b,_0x54c784){return db['Sound'][_0x2fe4('0x41')]({'where':{'id':_0x33b640[_0x2fe4('0x3b')]['id']}})[_0x2fe4('0x1e')](handleEntityNotFound(_0x38b59b,null))[_0x2fe4('0x1e')](saveUpdates(_[_0x2fe4('0x33')](_0x33b640['body'],[_0x2fe4('0x23'),_0x2fe4('0x6f')]),null))[_0x2fe4('0x1e')](respondWithResult(_0x38b59b,null))[_0x2fe4('0x39')](handleError(_0x38b59b,null));};exports[_0x2fe4('0x70')]=function(_0x4e23fc,_0xef5359,_0x1f97a9){return db[_0x2fe4('0x27')][_0x2fe4('0x41')]({'where':{'id':_0x4e23fc[_0x2fe4('0x3b')]['id']}})[_0x2fe4('0x1e')](function(_0x46bea8){if(_0x46bea8){return _0x46bea8[_0x2fe4('0x1d')]();}})['then'](function(_0xfdd5c5){var _0x3e1d33=path[_0x2fe4('0x44')](config[_0x2fe4('0x49')],_0x2fe4('0x53'),util[_0x2fe4('0x4a')](_0x2fe4('0x4b'),_0xfdd5c5[_0x2fe4('0x46')],_0xfdd5c5['original_format']));var _0x545125=path[_0x2fe4('0x44')](config['root'],_0x2fe4('0x45'),util[_0x2fe4('0x4a')](_0x2fe4('0x4b'),_0xfdd5c5[_0x2fe4('0x46')],_0xfdd5c5[_0x2fe4('0x42')]));fs[_0x2fe4('0x71')](_0x3e1d33);fs['unlinkSync'](_0x545125);return _0xfdd5c5;})['then'](function(_0x47b425){if(_0x47b425){return _0xef5359['status'](0xcc)[_0x2fe4('0x14')]();}})[_0x2fe4('0x1e')](handleEntityNotFound(_0xef5359,null))['catch'](handleError(_0xef5359,null));}; \ No newline at end of file +var _0xb944=['original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','description','delete','original_format','unlinkSync','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','length','include','download','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','src','original_duration','duration','original_sampleCount','original_channelCount','channelCount'];(function(_0x22e117,_0x1087bd){var _0x372ed0=function(_0x10c2e4){while(--_0x10c2e4){_0x22e117['push'](_0x22e117['shift']());}};_0x372ed0(++_0x1087bd);}(_0xb944,0x1aa));var _0x4b94=function(_0x39658b,_0xf72a7f){_0x39658b=_0x39658b-0x0;var _0xa37442=_0xb944[_0x39658b];return _0xa37442;};'use strict';var emlformat=require(_0x4b94('0x0'));var rimraf=require(_0x4b94('0x1'));var zipdir=require(_0x4b94('0x2'));var jsonpatch=require(_0x4b94('0x3'));var rp=require('request-promise');var moment=require(_0x4b94('0x4'));var BPromise=require(_0x4b94('0x5'));var Mustache=require(_0x4b94('0x6'));var util=require(_0x4b94('0x7'));var path=require(_0x4b94('0x8'));var sox=require(_0x4b94('0x9'));var csv=require(_0x4b94('0xa'));var ejs=require(_0x4b94('0xb'));var fs=require('fs');var fs_extra=require(_0x4b94('0xc'));var _=require(_0x4b94('0xd'));var squel=require(_0x4b94('0xe'));var crypto=require(_0x4b94('0xf'));var jsforce=require(_0x4b94('0x10'));var deskjs=require(_0x4b94('0x11'));var toCsv=require(_0x4b94('0xa'));var querystring=require(_0x4b94('0x12'));var Papa=require(_0x4b94('0x13'));var Redis=require('ioredis');var authService=require(_0x4b94('0x14'));var qs=require(_0x4b94('0x15'));var as=require(_0x4b94('0x16'));var hardwareService=require(_0x4b94('0x17'));var logger=require(_0x4b94('0x18'))(_0x4b94('0x19'));var utils=require(_0x4b94('0x1a'));var config=require(_0x4b94('0x1b'));var licenseUtil=require(_0x4b94('0x1c'));var db=require(_0x4b94('0x1d'))['db'];function respondWithStatusCode(_0x5a1b62,_0x155073){_0x155073=_0x155073||0xcc;return function(_0x50194b){if(_0x50194b){return _0x5a1b62[_0x4b94('0x1e')](_0x155073);}return _0x5a1b62[_0x4b94('0x1f')](_0x155073)[_0x4b94('0x20')]();};}function respondWithResult(_0x3e2bba,_0x29f0af){_0x29f0af=_0x29f0af||0xc8;return function(_0x1fcff4){if(_0x1fcff4){return _0x3e2bba[_0x4b94('0x1f')](_0x29f0af)[_0x4b94('0x21')](_0x1fcff4);}};}function respondWithFilteredResult(_0x4eba6b,_0x2c066a){return function(_0x185fda){if(_0x185fda){var _0xa7c946=typeof _0x2c066a['offset']===_0x4b94('0x22')&&typeof _0x2c066a[_0x4b94('0x23')]==='undefined';var _0x2e3aed=_0x185fda[_0x4b94('0x24')];var _0x4e8c3f=_0xa7c946?0x0:_0x2c066a[_0x4b94('0x25')];var _0x4d18e7=_0xa7c946?_0x185fda[_0x4b94('0x24')]:_0x2c066a[_0x4b94('0x25')]+_0x2c066a[_0x4b94('0x23')];var _0x12e0b7;if(_0x4d18e7>=_0x2e3aed){_0x4d18e7=_0x2e3aed;_0x12e0b7=0xc8;}else{_0x12e0b7=0xce;}_0x4eba6b[_0x4b94('0x1f')](_0x12e0b7);return _0x4eba6b[_0x4b94('0x26')](_0x4b94('0x27'),_0x4e8c3f+'-'+_0x4d18e7+'/'+_0x2e3aed)['json'](_0x185fda);}return null;};}function patchUpdates(_0x3f89f7){return function(_0x4cc9c7){try{jsonpatch[_0x4b94('0x28')](_0x4cc9c7,_0x3f89f7,!![]);}catch(_0x51b1ee){return BPromise[_0x4b94('0x29')](_0x51b1ee);}return _0x4cc9c7[_0x4b94('0x2a')]();};}function saveUpdates(_0x2ffe4d,_0x421086){return function(_0x24b266){if(_0x24b266){return _0x24b266[_0x4b94('0x2b')](_0x2ffe4d)[_0x4b94('0x2c')](function(_0x54915d){return _0x54915d;});}return null;};}function removeEntity(_0x52caf4,_0x13ce26){return function(_0x2f227a){if(_0x2f227a){return _0x2f227a[_0x4b94('0x2d')]()[_0x4b94('0x2c')](function(){var _0x467b3e=_0x2f227a['get']({'plain':!![]});var _0x53339a='Sounds';return db['UserProfileResource'][_0x4b94('0x2d')]({'where':{'type':_0x53339a,'resourceId':_0x467b3e['id']}})[_0x4b94('0x2c')](function(){return _0x2f227a;});})['then'](function(){_0x52caf4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d0ad1,_0x3d9493){return function(_0x5c606b){if(!_0x5c606b){_0x1d0ad1['sendStatus'](0x194);}return _0x5c606b;};}function handleError(_0x57565b,_0x36504a){_0x36504a=_0x36504a||0x1f4;return function(_0x1d4d6f){logger[_0x4b94('0x2e')](_0x1d4d6f['stack']);if(_0x1d4d6f[_0x4b94('0x2f')]){delete _0x1d4d6f['name'];}_0x57565b[_0x4b94('0x1f')](_0x36504a)[_0x4b94('0x30')](_0x1d4d6f);};}exports['index']=function(_0x38396f,_0x300ef2){var _0x19e269={},_0x2c211d={},_0x2af2c1={'count':0x0,'rows':[]};var _0x49731b=_[_0x4b94('0x31')](db[_0x4b94('0x32')][_0x4b94('0x33')],function(_0x369cd4){return{'name':_0x369cd4[_0x4b94('0x34')],'type':_0x369cd4[_0x4b94('0x35')][_0x4b94('0x36')]};});_0x2c211d[_0x4b94('0x37')]=_[_0x4b94('0x31')](_0x49731b,'name');_0x2c211d[_0x4b94('0x38')]=_[_0x4b94('0x39')](_0x38396f[_0x4b94('0x38')]);_0x2c211d[_0x4b94('0x3a')]=_[_0x4b94('0x3b')](_0x2c211d[_0x4b94('0x37')],_0x2c211d[_0x4b94('0x38')]);_0x19e269[_0x4b94('0x3c')]=_[_0x4b94('0x3b')](_0x2c211d[_0x4b94('0x37')],qs[_0x4b94('0x3d')](_0x38396f[_0x4b94('0x38')][_0x4b94('0x3d')]));_0x19e269[_0x4b94('0x3c')]=_0x19e269[_0x4b94('0x3c')]['length']?_0x19e269[_0x4b94('0x3c')]:_0x2c211d[_0x4b94('0x37')];if(!_0x38396f['query'][_0x4b94('0x3e')](_0x4b94('0x3f'))){_0x19e269['limit']=qs[_0x4b94('0x23')](_0x38396f['query'][_0x4b94('0x23')]);_0x19e269['offset']=qs[_0x4b94('0x25')](_0x38396f[_0x4b94('0x38')]['offset']);}_0x19e269['order']=qs[_0x4b94('0x40')](_0x38396f['query'][_0x4b94('0x40')]);_0x19e269[_0x4b94('0x41')]=qs[_0x4b94('0x3a')](_[_0x4b94('0x42')](_0x38396f['query'],_0x2c211d['filters']),_0x49731b);if(_0x38396f[_0x4b94('0x38')]['filter']){_0x19e269[_0x4b94('0x41')]=_[_0x4b94('0x43')](_0x19e269[_0x4b94('0x41')],{'$or':_[_0x4b94('0x31')](_0x49731b,function(_0x2557cf){if(_0x2557cf[_0x4b94('0x35')]!=='VIRTUAL'){var _0x4f8d02={};_0x4f8d02[_0x2557cf['name']]={'$like':'%'+_0x38396f[_0x4b94('0x38')][_0x4b94('0x44')]+'%'};return _0x4f8d02;}})});}_0x19e269=_[_0x4b94('0x43')]({},_0x19e269,_0x38396f[_0x4b94('0x45')]);var _0x1cebfa={'where':_0x19e269[_0x4b94('0x41')]};return db['Sound'][_0x4b94('0x24')](_0x1cebfa)[_0x4b94('0x2c')](function(_0x170ba7){_0x2af2c1[_0x4b94('0x24')]=_0x170ba7;if(_0x38396f[_0x4b94('0x38')][_0x4b94('0x46')]){_0x19e269['include']=[{'all':!![]}];}return db[_0x4b94('0x32')][_0x4b94('0x47')](_0x19e269);})['then'](function(_0x12a808){_0x2af2c1[_0x4b94('0x48')]=_0x12a808;return _0x2af2c1;})[_0x4b94('0x2c')](respondWithFilteredResult(_0x300ef2,_0x19e269))[_0x4b94('0x49')](handleError(_0x300ef2,null));};exports[_0x4b94('0x4a')]=function(_0x4b71ed,_0x2fa068){var _0x131dd8={'raw':!![],'where':{'id':_0x4b71ed['params']['id']}},_0x26b66b={};_0x26b66b[_0x4b94('0x37')]=_[_0x4b94('0x39')](db['Sound'][_0x4b94('0x33')]);_0x26b66b[_0x4b94('0x38')]=_[_0x4b94('0x39')](_0x4b71ed[_0x4b94('0x38')]);_0x26b66b[_0x4b94('0x3a')]=_['intersection'](_0x26b66b[_0x4b94('0x37')],_0x26b66b['query']);_0x131dd8[_0x4b94('0x3c')]=_[_0x4b94('0x3b')](_0x26b66b[_0x4b94('0x37')],qs[_0x4b94('0x3d')](_0x4b71ed['query'][_0x4b94('0x3d')]));_0x131dd8[_0x4b94('0x3c')]=_0x131dd8['attributes'][_0x4b94('0x4b')]?_0x131dd8[_0x4b94('0x3c')]:_0x26b66b[_0x4b94('0x37')];if(_0x4b71ed[_0x4b94('0x38')][_0x4b94('0x46')]){_0x131dd8[_0x4b94('0x4c')]=[{'all':!![]}];}_0x131dd8=_[_0x4b94('0x43')]({},_0x131dd8,_0x4b71ed[_0x4b94('0x45')]);return db[_0x4b94('0x32')]['find'](_0x131dd8)[_0x4b94('0x2c')](handleEntityNotFound(_0x2fa068,null))[_0x4b94('0x2c')](respondWithResult(_0x2fa068,null))['catch'](handleError(_0x2fa068,null));};exports[_0x4b94('0x4d')]=function(_0x2f43d3,_0x34b843,_0x7abc61){return db['Sound'][_0x4b94('0x4e')]({'where':{'id':_0x2f43d3['params']['id']},'attributes':['name',_0x4b94('0x4f'),_0x4b94('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x34b843,null))['then'](function(_0x309044){if(_0x309044){if(!fs[_0x4b94('0x51')](path[_0x4b94('0x52')](config[_0x4b94('0x53')],_0x4b94('0x54'),_0x309044[_0x4b94('0x4f')]+'.'+_0x309044[_0x4b94('0x50')]))){throw new db[(_0x4b94('0x55'))][(_0x4b94('0x56'))](_0x4b94('0x57'));}return _0x34b843[_0x4b94('0x4d')](path[_0x4b94('0x52')](config[_0x4b94('0x53')],'server/files/sounds/converted',util['format'](_0x4b94('0x58'),_0x309044['save_name'],_0x309044[_0x4b94('0x50')])),util[_0x4b94('0x59')](_0x4b94('0x58'),_0x309044['name'],_0x309044[_0x4b94('0x50')]));}return null;})[_0x4b94('0x49')](handleError(_0x34b843,null));};exports[_0x4b94('0x5a')]=function(_0x7edc99,_0x479c4c,_0x4541ab){var _0x113242={'name':path[_0x4b94('0x5b')](_0x7edc99[_0x4b94('0x5c')]['originalname'],path[_0x4b94('0x5d')](_0x7edc99[_0x4b94('0x5c')][_0x4b94('0x5e')])),'save_name':path[_0x4b94('0x5b')](_0x7edc99[_0x4b94('0x5c')][_0x4b94('0x5f')],path['extname'](_0x7edc99[_0x4b94('0x5c')][_0x4b94('0x5f')])),'original_format':path[_0x4b94('0x5d')](_0x7edc99[_0x4b94('0x5c')]['originalname'])[_0x4b94('0x60')](0x1),'converted_format':_0x4b94('0x61')};var _0x22074e=path[_0x4b94('0x52')](config[_0x4b94('0x53')],_0x4b94('0x62'),_0x7edc99['file']['filename']);var _0x163b93=path[_0x4b94('0x52')](config[_0x4b94('0x53')],'server/files/sounds/converted',util[_0x4b94('0x59')](_0x4b94('0x58'),path[_0x4b94('0x5b')](_0x7edc99['file'][_0x4b94('0x5f')],path[_0x4b94('0x5d')](_0x7edc99[_0x4b94('0x5c')][_0x4b94('0x5f')])),_0x113242[_0x4b94('0x50')]));logger[_0x4b94('0x63')](_0x4b94('0x64'),_0x22074e);logger[_0x4b94('0x63')](_0x4b94('0x65'),_0x163b93);try{fs[_0x4b94('0x66')](_0x22074e,parseInt('0777',0x8));var _0x36ec57=sox[_0x4b94('0x67')](_0x22074e,_0x163b93,{'sampleRate':0x1f40,'format':_0x4b94('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36ec57['on']('error',function(_0x2d68d9){fs['unlinkSync'](_0x22074e);_0x479c4c[_0x4b94('0x1f')](0x1f4)['send'](_0x2d68d9);});_0x36ec57['on'](_0x4b94('0x68'),function(_0x4a978a){_0x113242[_0x4b94('0x69')]=isNaN(_0x4a978a[_0x4b94('0x6a')])?null:_0x4a978a[_0x4b94('0x6a')]*0x3e8;_0x113242[_0x4b94('0x6b')]=isNaN(_0x4a978a['sampleCount'])?null:_0x4a978a['sampleCount'];_0x113242[_0x4b94('0x6c')]=isNaN(_0x4a978a[_0x4b94('0x6d')])?null:_0x4a978a[_0x4b94('0x6d')];_0x113242[_0x4b94('0x6e')]=isNaN(_0x4a978a[_0x4b94('0x6f')])?null:_0x4a978a[_0x4b94('0x6f')];_0x113242['original_sampleRate']=isNaN(_0x4a978a[_0x4b94('0x70')])?null:_0x4a978a[_0x4b94('0x70')];});_0x36ec57['on'](_0x4b94('0x71'),function(_0x20c9be){_0x113242[_0x4b94('0x72')]=isNaN(_0x20c9be[_0x4b94('0x6a')])?null:_0x20c9be[_0x4b94('0x6a')]*0x3e8;_0x113242[_0x4b94('0x73')]=isNaN(_0x20c9be[_0x4b94('0x74')])?null:_0x20c9be[_0x4b94('0x74')];_0x113242[_0x4b94('0x75')]=isNaN(_0x20c9be['channelCount'])?null:_0x20c9be[_0x4b94('0x6d')];_0x113242['converted_bitRate']=isNaN(_0x20c9be[_0x4b94('0x6f')])?null:_0x20c9be['bitRate'];_0x113242[_0x4b94('0x76')]=isNaN(_0x20c9be[_0x4b94('0x70')])?null:_0x20c9be[_0x4b94('0x70')];});_0x36ec57['on']('end',function(){fs[_0x4b94('0x66')](_0x163b93,parseInt(_0x4b94('0x77'),0x8));return db[_0x4b94('0x32')][_0x4b94('0x5a')](_0x113242)[_0x4b94('0x2c')](function(_0x21e607){var _0xbb295b={'role':_0x7edc99[_0x4b94('0x78')][_0x4b94('0x79')],'userProfileId':_0x7edc99['body'][_0x4b94('0x7a')]};if(!_0xbb295b)throw new Error(_0x4b94('0x7b'));if(_0xbb295b['role']===_0x4b94('0x7c')){var _0x3fd704=_0x21e607['get']({'plain':!![]});return db[_0x4b94('0x7d')][_0x4b94('0x4e')]({'where':{'name':_0x4b94('0x7e'),'userProfileId':_0xbb295b['userProfileId']},'raw':!![]})[_0x4b94('0x2c')](function(_0x47df7b){if(_0x47df7b&&_0x47df7b[_0x4b94('0x7f')]===0x0){return db['UserProfileResource'][_0x4b94('0x5a')]({'name':_0x3fd704[_0x4b94('0x2f')],'resourceId':_0x3fd704['id'],'type':_0x47df7b[_0x4b94('0x2f')],'sectionId':_0x47df7b['id']},{})[_0x4b94('0x2c')](function(){return _0x21e607;});}else{return _0x21e607;}})['catch'](function(_0x1dccad){logger[_0x4b94('0x2e')](_0x4b94('0x80'),_0x1dccad);throw _0x1dccad;});}return _0x21e607;})['then'](respondWithResult(_0x479c4c,null))['catch'](handleError(_0x479c4c,null));});_0x36ec57['start']();}catch(_0x3973a7){_0x479c4c['status'](0x1f4)['send'](_0x3973a7);}};exports[_0x4b94('0x2b')]=function(_0x394fef,_0x116ef9,_0x310531){return db['Sound'][_0x4b94('0x4e')]({'where':{'id':_0x394fef[_0x4b94('0x81')]['id']}})[_0x4b94('0x2c')](handleEntityNotFound(_0x116ef9,null))['then'](saveUpdates(_[_0x4b94('0x42')](_0x394fef[_0x4b94('0x78')],[_0x4b94('0x2f'),_0x4b94('0x82')]),null))['then'](respondWithResult(_0x116ef9,null))[_0x4b94('0x49')](handleError(_0x116ef9,null));};exports[_0x4b94('0x83')]=function(_0x5b5c1e,_0x5a322c,_0x23bb5d){return db[_0x4b94('0x32')][_0x4b94('0x4e')]({'where':{'id':_0x5b5c1e[_0x4b94('0x81')]['id']}})['then'](function(_0x4675a1){if(_0x4675a1){return _0x4675a1[_0x4b94('0x2d')]();}})[_0x4b94('0x2c')](function(_0x53dc7f){var _0x598ea6=path[_0x4b94('0x52')](config[_0x4b94('0x53')],_0x4b94('0x62'),util['format'](_0x4b94('0x58'),_0x53dc7f[_0x4b94('0x4f')],_0x53dc7f[_0x4b94('0x84')]));var _0x540d3a=path['join'](config['root'],_0x4b94('0x54'),util[_0x4b94('0x59')](_0x4b94('0x58'),_0x53dc7f[_0x4b94('0x4f')],_0x53dc7f[_0x4b94('0x50')]));fs[_0x4b94('0x85')](_0x598ea6);fs['unlinkSync'](_0x540d3a);return _0x53dc7f;})[_0x4b94('0x2c')](function(_0xcf8c0e){if(_0xcf8c0e){return _0x5a322c[_0x4b94('0x1f')](0xcc)['end']();}})[_0x4b94('0x2c')](handleEntityNotFound(_0x5a322c,null))['catch'](handleError(_0x5a322c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index fe1392f..7d77fea 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 _0xaa33=['../../config/logger','api','moment','rimraf','../../config/environment','Sound','tools_sounds','lodash','util'];(function(_0x4ef4e2,_0x4faf5f){var _0x3a96a4=function(_0x4694b0){while(--_0x4694b0){_0x4ef4e2['push'](_0x4ef4e2['shift']());}};_0x3a96a4(++_0x4faf5f);}(_0xaa33,0x97));var _0x3aa3=function(_0x3b95e8,_0x400cb8){_0x3b95e8=_0x3b95e8-0x0;var _0x3363a9=_0xaa33[_0x3b95e8];return _0x3363a9;};'use strict';var _=require(_0x3aa3('0x0'));var util=require(_0x3aa3('0x1'));var logger=require(_0x3aa3('0x2'))(_0x3aa3('0x3'));var moment=require(_0x3aa3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3aa3('0x5'));var config=require(_0x3aa3('0x6'));var attributes=require('./sound.attributes');module['exports']=function(_0x2e78e1,_0x39b8d7){return _0x2e78e1['define'](_0x3aa3('0x7'),attributes,{'tableName':_0x3aa3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe8d=['../../config/logger','api','moment','request-promise','path','rimraf','Sound','tools_sounds','lodash','util'];(function(_0x3a9105,_0x4f86a1){var _0x567bac=function(_0x3cdf7d){while(--_0x3cdf7d){_0x3a9105['push'](_0x3a9105['shift']());}};_0x567bac(++_0x4f86a1);}(_0xfe8d,0x184));var _0xdfe8=function(_0x45a713,_0x26b459){_0x45a713=_0x45a713-0x0;var _0x240cc9=_0xfe8d[_0x45a713];return _0x240cc9;};'use strict';var _=require(_0xdfe8('0x0'));var util=require(_0xdfe8('0x1'));var logger=require(_0xdfe8('0x2'))(_0xdfe8('0x3'));var moment=require(_0xdfe8('0x4'));var BPromise=require('bluebird');var rp=require(_0xdfe8('0x5'));var fs=require('fs');var path=require(_0xdfe8('0x6'));var rimraf=require(_0xdfe8('0x7'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module['exports']=function(_0x466f8b,_0x1b7af3){return _0x466f8b['define'](_0xdfe8('0x8'),attributes,{'tableName':_0xdfe8('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 b0440c6..859a8e8 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 _0xc22a=['code','message','result','catch','ShowSound','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x24fb57,_0x46341f){var _0x261fe2=function(_0xd1c00b){while(--_0xd1c00b){_0x24fb57['push'](_0x24fb57['shift']());}};_0x261fe2(++_0x46341f);}(_0xc22a,0x111));var _0xac22=function(_0xfcbe07,_0x5e2119){_0xfcbe07=_0xfcbe07-0x0;var _0x5b2664=_0xc22a[_0xfcbe07];return _0x5b2664;};'use strict';var _=require(_0xac22('0x0'));var util=require(_0xac22('0x1'));var moment=require(_0xac22('0x2'));var BPromise=require(_0xac22('0x3'));var rs=require(_0xac22('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xac22('0x5'));var logger=require(_0xac22('0x6'))('rpc');var config=require(_0xac22('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xac22('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x419b59,_0x36e624,_0x8700fe){return new BPromise(function(_0x1b601e,_0x374d6f){return client[_0xac22('0x9')](_0x419b59,_0x8700fe)[_0xac22('0xa')](function(_0x5bd0b5){logger[_0xac22('0xb')](_0xac22('0xc'),_0x36e624,'request\x20sent');logger[_0xac22('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x36e624,_0xac22('0xe'),JSON[_0xac22('0xf')](_0x5bd0b5));if(_0x5bd0b5[_0xac22('0x10')]){if(_0x5bd0b5['error'][_0xac22('0x11')]===0x1f4){logger['error'](_0xac22('0xc'),_0x36e624,_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);return _0x374d6f(_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);}logger[_0xac22('0x10')](_0xac22('0xc'),_0x36e624,_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);return _0x1b601e(_0x5bd0b5[_0xac22('0x10')][_0xac22('0x12')]);}else{logger['info']('Sound,\x20%s,\x20%s',_0x36e624,_0xac22('0xe'));_0x1b601e(_0x5bd0b5[_0xac22('0x13')]['message']);}})[_0xac22('0x14')](function(_0xc8aff6){logger['error'](_0xac22('0xc'),_0x36e624,_0xc8aff6);_0x374d6f(_0xc8aff6);});});}exports[_0xac22('0x15')]=function(_0x4f9983){var _0x39c144=this;return new Promise(function(_0x218205,_0x63b1e8){return db['Sound'][_0xac22('0x16')]({'raw':_0x4f9983[_0xac22('0x17')]?_0x4f9983[_0xac22('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4f9983['options']?_0x4f9983[_0xac22('0x17')][_0xac22('0x18')]||null:null,'attributes':_0x4f9983[_0xac22('0x17')]?_0x4f9983[_0xac22('0x17')][_0xac22('0x19')]||null:null,'include':_0x4f9983[_0xac22('0x17')]?_0x4f9983[_0xac22('0x17')][_0xac22('0x1a')]?_[_0xac22('0x1b')](_0x4f9983[_0xac22('0x17')][_0xac22('0x1a')],function(_0xa53b1){return{'model':db[_0xa53b1[_0xac22('0x1c')]],'as':_0xa53b1['as'],'attributes':_0xa53b1[_0xac22('0x19')],'include':_0xa53b1[_0xac22('0x1a')]?_[_0xac22('0x1b')](_0xa53b1['include'],function(_0x3d3ebc){return{'model':db[_0x3d3ebc[_0xac22('0x1c')]],'as':_0x3d3ebc['as'],'attributes':_0x3d3ebc['attributes'],'include':_0x3d3ebc[_0xac22('0x1a')]?_[_0xac22('0x1b')](_0x3d3ebc[_0xac22('0x1a')],function(_0x2d13c9){return{'model':db[_0x2d13c9[_0xac22('0x1c')]],'as':_0x2d13c9['as'],'attributes':_0x2d13c9[_0xac22('0x19')]};}):[]};}):[]};}):[]:[]})[_0xac22('0xa')](function(_0x4251aa){logger[_0xac22('0xb')](_0xac22('0x15'),_0x4f9983);logger[_0xac22('0xd')]('ShowSound',_0x4f9983,JSON['stringify'](_0x4251aa));_0x218205(_0x4251aa);})[_0xac22('0x14')](function(_0x3369a0){logger[_0xac22('0x10')](_0xac22('0x15'),_0x3369a0['message'],_0x4f9983);_0x63b1e8(_0x39c144['error'](0x1f4,_0x3369a0[_0xac22('0x12')]));});});}; \ No newline at end of file +var _0x4639=['include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4639,0x10b));var _0x9463=function(_0xc1c93f,_0x1fba71){_0xc1c93f=_0xc1c93f-0x0;var _0x3f81cb=_0x4639[_0xc1c93f];return _0x3f81cb;};'use strict';var _=require(_0x9463('0x0'));var util=require(_0x9463('0x1'));var moment=require('moment');var BPromise=require(_0x9463('0x2'));var rs=require(_0x9463('0x3'));var fs=require('fs');var Redis=require(_0x9463('0x4'));var db=require(_0x9463('0x5'))['db'];var utils=require(_0x9463('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9463('0x7'));var jayson=require(_0x9463('0x8'));var client=jayson[_0x9463('0x9')][_0x9463('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17a502,_0x206ad1,_0x286aa6){return new BPromise(function(_0x1ce71a,_0x5e7f06){return client[_0x9463('0xb')](_0x17a502,_0x286aa6)[_0x9463('0xc')](function(_0x119a49){logger[_0x9463('0xd')](_0x9463('0xe'),_0x206ad1,_0x9463('0xf'));logger[_0x9463('0x10')](_0x9463('0x11'),_0x206ad1,_0x9463('0xf'),JSON[_0x9463('0x12')](_0x119a49));if(_0x119a49[_0x9463('0x13')]){if(_0x119a49[_0x9463('0x13')][_0x9463('0x14')]===0x1f4){logger[_0x9463('0x13')](_0x9463('0xe'),_0x206ad1,_0x119a49['error'][_0x9463('0x15')]);return _0x5e7f06(_0x119a49[_0x9463('0x13')][_0x9463('0x15')]);}logger['error'](_0x9463('0xe'),_0x206ad1,_0x119a49['error']['message']);return _0x1ce71a(_0x119a49['error'][_0x9463('0x15')]);}else{logger[_0x9463('0xd')](_0x9463('0xe'),_0x206ad1,_0x9463('0xf'));_0x1ce71a(_0x119a49[_0x9463('0x16')]['message']);}})[_0x9463('0x17')](function(_0x2dc28){logger[_0x9463('0x13')]('Sound,\x20%s,\x20%s',_0x206ad1,_0x2dc28);_0x5e7f06(_0x2dc28);});});}exports[_0x9463('0x18')]=function(_0x44af3b){var _0x3eb416=this;return new Promise(function(_0x3c68ae,_0x32d42b){return db[_0x9463('0x19')][_0x9463('0x1a')]({'raw':_0x44af3b['options']?_0x44af3b[_0x9463('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x44af3b['options']?_0x44af3b[_0x9463('0x1b')][_0x9463('0x1c')]||null:null,'attributes':_0x44af3b['options']?_0x44af3b[_0x9463('0x1b')][_0x9463('0x1d')]||null:null,'include':_0x44af3b['options']?_0x44af3b[_0x9463('0x1b')][_0x9463('0x1e')]?_[_0x9463('0x1f')](_0x44af3b['options']['include'],function(_0x4d378c){return{'model':db[_0x4d378c[_0x9463('0x20')]],'as':_0x4d378c['as'],'attributes':_0x4d378c[_0x9463('0x1d')],'include':_0x4d378c[_0x9463('0x1e')]?_[_0x9463('0x1f')](_0x4d378c[_0x9463('0x1e')],function(_0x44c87e){return{'model':db[_0x44c87e[_0x9463('0x20')]],'as':_0x44c87e['as'],'attributes':_0x44c87e['attributes'],'include':_0x44c87e[_0x9463('0x1e')]?_['map'](_0x44c87e[_0x9463('0x1e')],function(_0x420ff7){return{'model':db[_0x420ff7[_0x9463('0x20')]],'as':_0x420ff7['as'],'attributes':_0x420ff7['attributes']};}):[]};}):[]};}):[]:[]})[_0x9463('0xc')](function(_0x293751){logger['info'](_0x9463('0x18'),_0x44af3b);logger['debug'](_0x9463('0x18'),_0x44af3b,JSON['stringify'](_0x293751));_0x3c68ae(_0x293751);})[_0x9463('0x17')](function(_0x266325){logger[_0x9463('0x13')](_0x9463('0x18'),_0x266325[_0x9463('0x15')],_0x44af3b);_0x32d42b(_0x3eb416[_0x9463('0x13')](0x1f4,_0x266325['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index fd4c937..20a4ca9 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 _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0x8603,0x190));var _0x3860=function(_0x3f9dfc,_0x3aacad){_0x3f9dfc=_0x3f9dfc-0x0;var _0x2c0568=_0x8603[_0x3f9dfc];return _0x2c0568;};'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 +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x14bf66,_0x3e1066){var _0xaf4bf7=function(_0x3d9c3f){while(--_0x3d9c3f){_0x14bf66['push'](_0x14bf66['shift']());}};_0xaf4bf7(++_0x3e1066);}(_0x2032,0xd9));var _0x2203=function(_0x10c592,_0x1ad3e4){_0x10c592=_0x10c592-0x0;var _0xafa773=_0x2032[_0x10c592];return _0xafa773;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 114fca1..1e1b520 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 _0x268c=['sequelize','STRING','medium','ENUM','out','TEXT'];(function(_0x526958,_0x447c54){var _0xfc503e=function(_0x48f0cf){while(--_0x48f0cf){_0x526958['push'](_0x526958['shift']());}};_0xfc503e(++_0x447c54);}(_0x268c,0xcc));var _0xc268=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x268c[_0x1a37e3];return _0x4db78a;};'use strict';var Sequelize=require(_0xc268('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc268('0x1')]},'body':{'type':Sequelize['TEXT'](_0xc268('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xc268('0x3')]('in',_0xc268('0x4')),'defaultValue':_0xc268('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc268('0x1')]},'providerResponse':{'type':Sequelize[_0xc268('0x5')]}}; \ No newline at end of file +var _0xd02c=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0xb038c5,_0x1272d9){var _0x1e36c9=function(_0x239a29){while(--_0x239a29){_0xb038c5['push'](_0xb038c5['shift']());}};_0x1e36c9(++_0x1272d9);}(_0xd02c,0x97));var _0xcd02=function(_0x1d0507,_0x4fbf3f){_0x1d0507=_0x1d0507-0x0;var _0x305340=_0xd02c[_0x1d0507];return _0x305340;};'use strict';var Sequelize=require(_0xcd02('0x0'));module[_0xcd02('0x1')]={'uniqueid':{'type':Sequelize[_0xcd02('0x2')]},'body':{'type':Sequelize[_0xcd02('0x3')](_0xcd02('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xcd02('0x5')]('in',_0xcd02('0x6')),'defaultValue':_0xcd02('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xcd02('0x2')]},'providerResponse':{'type':Sequelize[_0xcd02('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index ee22ede..9ffa9f5 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 _0x65c9=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x65c9,0x182));var _0x965c=function(_0x2a8af1,_0x3d79dd){_0x2a8af1=_0x2a8af1-0x0;var _0x4eed9a=_0x65c9[_0x2a8af1];return _0x4eed9a;};'use strict';var emlformat=require(_0x965c('0x0'));var rimraf=require(_0x965c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x965c('0x2'));var rp=require(_0x965c('0x3'));var moment=require(_0x965c('0x4'));var BPromise=require(_0x965c('0x5'));var Mustache=require(_0x965c('0x6'));var util=require(_0x965c('0x7'));var path=require(_0x965c('0x8'));var sox=require(_0x965c('0x9'));var csv=require(_0x965c('0xa'));var ejs=require(_0x965c('0xb'));var fs=require('fs');var fs_extra=require(_0x965c('0xc'));var _=require(_0x965c('0xd'));var squel=require('squel');var crypto=require(_0x965c('0xe'));var jsforce=require(_0x965c('0xf'));var deskjs=require(_0x965c('0x10'));var toCsv=require(_0x965c('0xa'));var querystring=require(_0x965c('0x11'));var Papa=require(_0x965c('0x12'));var Redis=require(_0x965c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x965c('0x14'));var as=require(_0x965c('0x15'));var hardwareService=require(_0x965c('0x16'));var logger=require(_0x965c('0x17'))(_0x965c('0x18'));var utils=require(_0x965c('0x19'));var config=require(_0x965c('0x1a'));var licenseUtil=require(_0x965c('0x1b'));var db=require(_0x965c('0x1c'))['db'];function respondWithStatusCode(_0x3ff4ea,_0x154827){_0x154827=_0x154827||0xcc;return function(_0x1d5cb4){if(_0x1d5cb4){return _0x3ff4ea[_0x965c('0x1d')](_0x154827);}return _0x3ff4ea[_0x965c('0x1e')](_0x154827)['end']();};}function respondWithResult(_0x1e343c,_0x26618f){_0x26618f=_0x26618f||0xc8;return function(_0x2901f7){if(_0x2901f7){return _0x1e343c['status'](_0x26618f)[_0x965c('0x1f')](_0x2901f7);}};}function respondWithFilteredResult(_0x2a9580,_0x20dee0){return function(_0x4f61de){if(_0x4f61de){var _0x1c820a=typeof _0x20dee0['offset']==='undefined'&&typeof _0x20dee0['limit']===_0x965c('0x20');var _0xeaf323=_0x4f61de[_0x965c('0x21')];var _0x14e990=_0x1c820a?0x0:_0x20dee0['offset'];var _0x590c6a=_0x1c820a?_0x4f61de['count']:_0x20dee0[_0x965c('0x22')]+_0x20dee0[_0x965c('0x23')];var _0x2e5608;if(_0x590c6a>=_0xeaf323){_0x590c6a=_0xeaf323;_0x2e5608=0xc8;}else{_0x2e5608=0xce;}_0x2a9580[_0x965c('0x1e')](_0x2e5608);return _0x2a9580[_0x965c('0x24')](_0x965c('0x25'),_0x14e990+'-'+_0x590c6a+'/'+_0xeaf323)[_0x965c('0x1f')](_0x4f61de);}return null;};}function patchUpdates(_0x3f5ec9){return function(_0x11f510){try{jsonpatch[_0x965c('0x26')](_0x11f510,_0x3f5ec9,!![]);}catch(_0xa2c510){return BPromise['reject'](_0xa2c510);}return _0x11f510[_0x965c('0x27')]();};}function saveUpdates(_0x230d38,_0x4e345c){return function(_0x490626){if(_0x490626){return _0x490626[_0x965c('0x28')](_0x230d38)['then'](function(_0x4393aa){return _0x4393aa;});}return null;};}function removeEntity(_0x2ac16c,_0x3dcfa2){return function(_0x4d41e5){if(_0x4d41e5){return _0x4d41e5[_0x965c('0x29')]()[_0x965c('0x2a')](function(){_0x2ac16c[_0x965c('0x1e')](0xcc)[_0x965c('0x2b')]();});}};}function handleEntityNotFound(_0x5ddefa,_0x169619){return function(_0x4db10a){if(!_0x4db10a){_0x5ddefa['sendStatus'](0x194);}return _0x4db10a;};}function handleError(_0x4d19f6,_0xc5d241){_0xc5d241=_0xc5d241||0x1f4;return function(_0x327aa6){logger[_0x965c('0x2c')](_0x327aa6['stack']);if(_0x327aa6['name']){delete _0x327aa6[_0x965c('0x2d')];}_0x4d19f6['status'](_0xc5d241)[_0x965c('0x2e')](_0x327aa6);};}exports['index']=function(_0x4e00d4,_0xa21a2f){var _0x9227f8={},_0x8f9853={},_0x17a7bd={'count':0x0,'rows':[]};var _0x392a54=_[_0x965c('0x2f')](db[_0x965c('0x30')][_0x965c('0x31')],function(_0x570fa6){return{'name':_0x570fa6[_0x965c('0x32')],'type':_0x570fa6[_0x965c('0x33')][_0x965c('0x34')]};});_0x8f9853[_0x965c('0x35')]=_[_0x965c('0x2f')](_0x392a54,_0x965c('0x2d'));_0x8f9853[_0x965c('0x36')]=_[_0x965c('0x37')](_0x4e00d4['query']);_0x8f9853[_0x965c('0x38')]=_['intersection'](_0x8f9853['model'],_0x8f9853[_0x965c('0x36')]);_0x9227f8[_0x965c('0x39')]=_[_0x965c('0x3a')](_0x8f9853['model'],qs[_0x965c('0x3b')](_0x4e00d4[_0x965c('0x36')][_0x965c('0x3b')]));_0x9227f8['attributes']=_0x9227f8[_0x965c('0x39')][_0x965c('0x3c')]?_0x9227f8[_0x965c('0x39')]:_0x8f9853['model'];if(!_0x4e00d4[_0x965c('0x36')][_0x965c('0x3d')](_0x965c('0x3e'))){_0x9227f8[_0x965c('0x23')]=qs[_0x965c('0x23')](_0x4e00d4[_0x965c('0x36')]['limit']);_0x9227f8[_0x965c('0x22')]=qs[_0x965c('0x22')](_0x4e00d4[_0x965c('0x36')][_0x965c('0x22')]);}_0x9227f8[_0x965c('0x3f')]=qs[_0x965c('0x40')](_0x4e00d4[_0x965c('0x36')][_0x965c('0x40')]);_0x9227f8['where']=qs[_0x965c('0x38')](_[_0x965c('0x41')](_0x4e00d4[_0x965c('0x36')],_0x8f9853[_0x965c('0x38')]),_0x392a54);if(_0x4e00d4['query'][_0x965c('0x42')]){_0x9227f8[_0x965c('0x43')]=_[_0x965c('0x44')](_0x9227f8[_0x965c('0x43')],{'$or':_['map'](_0x392a54,function(_0xd48e10){if(_0xd48e10['type']!==_0x965c('0x45')){var _0x232fab={};_0x232fab[_0xd48e10[_0x965c('0x2d')]]={'$like':'%'+_0x4e00d4[_0x965c('0x36')][_0x965c('0x42')]+'%'};return _0x232fab;}})});}_0x9227f8=_['merge']({},_0x9227f8,_0x4e00d4[_0x965c('0x46')]);var _0x278779={'where':_0x9227f8[_0x965c('0x43')]};return db[_0x965c('0x30')][_0x965c('0x21')](_0x278779)[_0x965c('0x2a')](function(_0x2a93a7){_0x17a7bd[_0x965c('0x21')]=_0x2a93a7;if(_0x4e00d4['query'][_0x965c('0x47')]){_0x9227f8[_0x965c('0x48')]=[{'all':!![]}];}return db[_0x965c('0x30')][_0x965c('0x49')](_0x9227f8);})[_0x965c('0x2a')](function(_0x3e6a26){_0x17a7bd[_0x965c('0x4a')]=_0x3e6a26;return _0x17a7bd;})[_0x965c('0x2a')](respondWithFilteredResult(_0xa21a2f,_0x9227f8))[_0x965c('0x4b')](handleError(_0xa21a2f,null));};exports[_0x965c('0x4c')]=function(_0x4f579b,_0x268dd1){var _0x513a94={'raw':!![],'where':{'id':_0x4f579b['params']['id']}},_0x2090e4={};_0x2090e4[_0x965c('0x35')]=_[_0x965c('0x37')](db[_0x965c('0x30')][_0x965c('0x31')]);_0x2090e4[_0x965c('0x36')]=_[_0x965c('0x37')](_0x4f579b['query']);_0x2090e4['filters']=_[_0x965c('0x3a')](_0x2090e4[_0x965c('0x35')],_0x2090e4['query']);_0x513a94[_0x965c('0x39')]=_[_0x965c('0x3a')](_0x2090e4[_0x965c('0x35')],qs['fields'](_0x4f579b[_0x965c('0x36')][_0x965c('0x3b')]));_0x513a94[_0x965c('0x39')]=_0x513a94[_0x965c('0x39')][_0x965c('0x3c')]?_0x513a94[_0x965c('0x39')]:_0x2090e4[_0x965c('0x35')];if(_0x4f579b[_0x965c('0x36')]['includeAll']){_0x513a94['include']=[{'all':!![]}];}_0x513a94=_['merge']({},_0x513a94,_0x4f579b[_0x965c('0x46')]);return db[_0x965c('0x30')][_0x965c('0x4d')](_0x513a94)['then'](handleEntityNotFound(_0x268dd1,null))['then'](respondWithResult(_0x268dd1,null))['catch'](handleError(_0x268dd1,null));};exports['create']=function(_0x32a80e,_0x5eb4e6){return db[_0x965c('0x30')][_0x965c('0x4e')](_0x32a80e[_0x965c('0x4f')],{})[_0x965c('0x2a')](respondWithResult(_0x5eb4e6,0xc9))[_0x965c('0x4b')](handleError(_0x5eb4e6,null));};exports[_0x965c('0x28')]=function(_0x592e8b,_0x331b6f){if(_0x592e8b[_0x965c('0x4f')]['id']){delete _0x592e8b[_0x965c('0x4f')]['id'];}return db['SquareMessage'][_0x965c('0x4d')]({'where':{'id':_0x592e8b[_0x965c('0x50')]['id']}})[_0x965c('0x2a')](handleEntityNotFound(_0x331b6f,null))['then'](saveUpdates(_0x592e8b['body'],null))[_0x965c('0x2a')](respondWithResult(_0x331b6f,null))[_0x965c('0x4b')](handleError(_0x331b6f,null));};exports[_0x965c('0x29')]=function(_0x3e6e09,_0xb4c48){return db[_0x965c('0x30')][_0x965c('0x4d')]({'where':{'id':_0x3e6e09[_0x965c('0x50')]['id']}})[_0x965c('0x2a')](handleEntityNotFound(_0xb4c48,null))[_0x965c('0x2a')](removeEntity(_0xb4c48,null))[_0x965c('0x4b')](handleError(_0xb4c48,null));}; \ No newline at end of file +var _0xb10d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','params','keys','length','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x413ca3,_0xa12330){var _0x2cc2b9=function(_0x39fe91){while(--_0x39fe91){_0x413ca3['push'](_0x413ca3['shift']());}};_0x2cc2b9(++_0xa12330);}(_0xb10d,0x17f));var _0xdb10=function(_0x1b4749,_0x27df1d){_0x1b4749=_0x1b4749-0x0;var _0x5e1c4f=_0xb10d[_0x1b4749];return _0x5e1c4f;};'use strict';var emlformat=require(_0xdb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb10('0x1'));var jsonpatch=require(_0xdb10('0x2'));var rp=require(_0xdb10('0x3'));var moment=require(_0xdb10('0x4'));var BPromise=require(_0xdb10('0x5'));var Mustache=require(_0xdb10('0x6'));var util=require(_0xdb10('0x7'));var path=require(_0xdb10('0x8'));var sox=require(_0xdb10('0x9'));var csv=require(_0xdb10('0xa'));var ejs=require(_0xdb10('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb10('0xc'));var squel=require(_0xdb10('0xd'));var crypto=require(_0xdb10('0xe'));var jsforce=require(_0xdb10('0xf'));var deskjs=require(_0xdb10('0x10'));var toCsv=require(_0xdb10('0xa'));var querystring=require(_0xdb10('0x11'));var Papa=require(_0xdb10('0x12'));var Redis=require(_0xdb10('0x13'));var authService=require(_0xdb10('0x14'));var qs=require(_0xdb10('0x15'));var as=require(_0xdb10('0x16'));var hardwareService=require(_0xdb10('0x17'));var logger=require(_0xdb10('0x18'))(_0xdb10('0x19'));var utils=require(_0xdb10('0x1a'));var config=require(_0xdb10('0x1b'));var licenseUtil=require(_0xdb10('0x1c'));var db=require(_0xdb10('0x1d'))['db'];function respondWithStatusCode(_0x3d4cda,_0x412adc){_0x412adc=_0x412adc||0xcc;return function(_0x21d1ec){if(_0x21d1ec){return _0x3d4cda[_0xdb10('0x1e')](_0x412adc);}return _0x3d4cda[_0xdb10('0x1f')](_0x412adc)['end']();};}function respondWithResult(_0x30b302,_0x1daa95){_0x1daa95=_0x1daa95||0xc8;return function(_0xf8cc1){if(_0xf8cc1){return _0x30b302[_0xdb10('0x1f')](_0x1daa95)[_0xdb10('0x20')](_0xf8cc1);}};}function respondWithFilteredResult(_0x169a84,_0x489421){return function(_0x161e0d){if(_0x161e0d){var _0x21393b=typeof _0x489421[_0xdb10('0x21')]===_0xdb10('0x22')&&typeof _0x489421[_0xdb10('0x23')]==='undefined';var _0xe826ef=_0x161e0d['count'];var _0xbf36da=_0x21393b?0x0:_0x489421['offset'];var _0x3b9f45=_0x21393b?_0x161e0d[_0xdb10('0x24')]:_0x489421[_0xdb10('0x21')]+_0x489421[_0xdb10('0x23')];var _0x5ec280;if(_0x3b9f45>=_0xe826ef){_0x3b9f45=_0xe826ef;_0x5ec280=0xc8;}else{_0x5ec280=0xce;}_0x169a84[_0xdb10('0x1f')](_0x5ec280);return _0x169a84[_0xdb10('0x25')](_0xdb10('0x26'),_0xbf36da+'-'+_0x3b9f45+'/'+_0xe826ef)[_0xdb10('0x20')](_0x161e0d);}return null;};}function patchUpdates(_0x5b7409){return function(_0xcb38eb){try{jsonpatch[_0xdb10('0x27')](_0xcb38eb,_0x5b7409,!![]);}catch(_0x373964){return BPromise[_0xdb10('0x28')](_0x373964);}return _0xcb38eb[_0xdb10('0x29')]();};}function saveUpdates(_0x2b6244,_0x145497){return function(_0x30baba){if(_0x30baba){return _0x30baba[_0xdb10('0x2a')](_0x2b6244)['then'](function(_0x11a34b){return _0x11a34b;});}return null;};}function removeEntity(_0x148f2b,_0x5ba42a){return function(_0x249e94){if(_0x249e94){return _0x249e94[_0xdb10('0x2b')]()[_0xdb10('0x2c')](function(){_0x148f2b[_0xdb10('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47db13,_0xc65e60){return function(_0x53e626){if(!_0x53e626){_0x47db13[_0xdb10('0x1e')](0x194);}return _0x53e626;};}function handleError(_0x464ab,_0x39116e){_0x39116e=_0x39116e||0x1f4;return function(_0x4db7ba){logger[_0xdb10('0x2d')](_0x4db7ba[_0xdb10('0x2e')]);if(_0x4db7ba[_0xdb10('0x2f')]){delete _0x4db7ba[_0xdb10('0x2f')];}_0x464ab[_0xdb10('0x1f')](_0x39116e)[_0xdb10('0x30')](_0x4db7ba);};}exports[_0xdb10('0x31')]=function(_0x2a9ecd,_0xa48d52){var _0x42ef28={},_0x3627ae={},_0xb1c49c={'count':0x0,'rows':[]};var _0x3073de=_[_0xdb10('0x32')](db[_0xdb10('0x33')][_0xdb10('0x34')],function(_0x4a68a9){return{'name':_0x4a68a9[_0xdb10('0x35')],'type':_0x4a68a9[_0xdb10('0x36')][_0xdb10('0x37')]};});_0x3627ae[_0xdb10('0x38')]=_[_0xdb10('0x32')](_0x3073de,_0xdb10('0x2f'));_0x3627ae[_0xdb10('0x39')]=_['keys'](_0x2a9ecd[_0xdb10('0x39')]);_0x3627ae[_0xdb10('0x3a')]=_[_0xdb10('0x3b')](_0x3627ae['model'],_0x3627ae['query']);_0x42ef28['attributes']=_['intersection'](_0x3627ae[_0xdb10('0x38')],qs[_0xdb10('0x3c')](_0x2a9ecd['query']['fields']));_0x42ef28['attributes']=_0x42ef28[_0xdb10('0x3d')]['length']?_0x42ef28[_0xdb10('0x3d')]:_0x3627ae[_0xdb10('0x38')];if(!_0x2a9ecd['query'][_0xdb10('0x3e')](_0xdb10('0x3f'))){_0x42ef28[_0xdb10('0x23')]=qs['limit'](_0x2a9ecd[_0xdb10('0x39')][_0xdb10('0x23')]);_0x42ef28[_0xdb10('0x21')]=qs[_0xdb10('0x21')](_0x2a9ecd[_0xdb10('0x39')][_0xdb10('0x21')]);}_0x42ef28[_0xdb10('0x40')]=qs[_0xdb10('0x41')](_0x2a9ecd[_0xdb10('0x39')][_0xdb10('0x41')]);_0x42ef28[_0xdb10('0x42')]=qs[_0xdb10('0x3a')](_[_0xdb10('0x43')](_0x2a9ecd[_0xdb10('0x39')],_0x3627ae['filters']),_0x3073de);if(_0x2a9ecd['query'][_0xdb10('0x44')]){_0x42ef28[_0xdb10('0x42')]=_[_0xdb10('0x45')](_0x42ef28[_0xdb10('0x42')],{'$or':_[_0xdb10('0x32')](_0x3073de,function(_0x33c9dd){if(_0x33c9dd[_0xdb10('0x36')]!=='VIRTUAL'){var _0x514ca9={};_0x514ca9[_0x33c9dd[_0xdb10('0x2f')]]={'$like':'%'+_0x2a9ecd['query']['filter']+'%'};return _0x514ca9;}})});}_0x42ef28=_['merge']({},_0x42ef28,_0x2a9ecd[_0xdb10('0x46')]);var _0x2540e1={'where':_0x42ef28[_0xdb10('0x42')]};return db['SquareMessage'][_0xdb10('0x24')](_0x2540e1)[_0xdb10('0x2c')](function(_0x1c3704){_0xb1c49c[_0xdb10('0x24')]=_0x1c3704;if(_0x2a9ecd[_0xdb10('0x39')][_0xdb10('0x47')]){_0x42ef28['include']=[{'all':!![]}];}return db[_0xdb10('0x33')][_0xdb10('0x48')](_0x42ef28);})['then'](function(_0xff6b0a){_0xb1c49c['rows']=_0xff6b0a;return _0xb1c49c;})[_0xdb10('0x2c')](respondWithFilteredResult(_0xa48d52,_0x42ef28))['catch'](handleError(_0xa48d52,null));};exports['show']=function(_0x442ae4,_0x34bb49){var _0x7009e1={'raw':!![],'where':{'id':_0x442ae4[_0xdb10('0x49')]['id']}},_0x477391={};_0x477391[_0xdb10('0x38')]=_[_0xdb10('0x4a')](db[_0xdb10('0x33')][_0xdb10('0x34')]);_0x477391['query']=_['keys'](_0x442ae4[_0xdb10('0x39')]);_0x477391['filters']=_[_0xdb10('0x3b')](_0x477391[_0xdb10('0x38')],_0x477391[_0xdb10('0x39')]);_0x7009e1['attributes']=_[_0xdb10('0x3b')](_0x477391[_0xdb10('0x38')],qs[_0xdb10('0x3c')](_0x442ae4[_0xdb10('0x39')][_0xdb10('0x3c')]));_0x7009e1[_0xdb10('0x3d')]=_0x7009e1[_0xdb10('0x3d')][_0xdb10('0x4b')]?_0x7009e1[_0xdb10('0x3d')]:_0x477391[_0xdb10('0x38')];if(_0x442ae4[_0xdb10('0x39')][_0xdb10('0x47')]){_0x7009e1['include']=[{'all':!![]}];}_0x7009e1=_[_0xdb10('0x45')]({},_0x7009e1,_0x442ae4[_0xdb10('0x46')]);return db[_0xdb10('0x33')]['find'](_0x7009e1)[_0xdb10('0x2c')](handleEntityNotFound(_0x34bb49,null))[_0xdb10('0x2c')](respondWithResult(_0x34bb49,null))[_0xdb10('0x4c')](handleError(_0x34bb49,null));};exports[_0xdb10('0x4d')]=function(_0x216b1f,_0x42ef91){return db[_0xdb10('0x33')]['create'](_0x216b1f['body'],{})[_0xdb10('0x2c')](respondWithResult(_0x42ef91,0xc9))[_0xdb10('0x4c')](handleError(_0x42ef91,null));};exports[_0xdb10('0x2a')]=function(_0x2740d3,_0x3b2bc9){if(_0x2740d3[_0xdb10('0x4e')]['id']){delete _0x2740d3[_0xdb10('0x4e')]['id'];}return db[_0xdb10('0x33')][_0xdb10('0x4f')]({'where':{'id':_0x2740d3[_0xdb10('0x49')]['id']}})[_0xdb10('0x2c')](handleEntityNotFound(_0x3b2bc9,null))[_0xdb10('0x2c')](saveUpdates(_0x2740d3[_0xdb10('0x4e')],null))['then'](respondWithResult(_0x3b2bc9,null))['catch'](handleError(_0x3b2bc9,null));};exports[_0xdb10('0x2b')]=function(_0x2d708e,_0x312717){return db[_0xdb10('0x33')][_0xdb10('0x4f')]({'where':{'id':_0x2d708e[_0xdb10('0x49')]['id']}})['then'](handleEntityNotFound(_0x312717,null))['then'](removeEntity(_0x312717,null))['catch'](handleError(_0x312717,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 58c208c..f1b02cf 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 _0x76ed=['SquareMessage','lodash','api','request-promise','path','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x8bca3f,_0x158cf8){var _0x448ab5=function(_0x5b5537){while(--_0x5b5537){_0x8bca3f['push'](_0x8bca3f['shift']());}};_0x448ab5(++_0x158cf8);}(_0x76ed,0x1e7));var _0xd76e=function(_0x4c0699,_0x1f326d){_0x4c0699=_0x4c0699-0x0;var _0x472d6f=_0x76ed[_0x4c0699];return _0x472d6f;};'use strict';var _=require(_0xd76e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd76e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd76e('0x2'));var fs=require('fs');var path=require(_0xd76e('0x3'));var rimraf=require('rimraf');var config=require(_0xd76e('0x4'));var attributes=require(_0xd76e('0x5'));module[_0xd76e('0x6')]=function(_0x4f367f,_0x4cc66b){return _0x4f367f[_0xd76e('0x7')](_0xd76e('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa186=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d14f8,_0x4f3d1b){var _0x5a870f=function(_0x520f01){while(--_0x520f01){_0x3d14f8['push'](_0x3d14f8['shift']());}};_0x5a870f(++_0x4f3d1b);}(_0xa186,0x8c));var _0x6a18=function(_0x55234d,_0x3fa5a2){_0x55234d=_0x55234d-0x0;var _0x85b0ab=_0xa186[_0x55234d];return _0x85b0ab;};'use strict';var _=require(_0x6a18('0x0'));var util=require(_0x6a18('0x1'));var logger=require(_0x6a18('0x2'))(_0x6a18('0x3'));var moment=require(_0x6a18('0x4'));var BPromise=require(_0x6a18('0x5'));var rp=require(_0x6a18('0x6'));var fs=require('fs');var path=require(_0x6a18('0x7'));var rimraf=require(_0x6a18('0x8'));var config=require(_0x6a18('0x9'));var attributes=require(_0x6a18('0xa'));module[_0x6a18('0xb')]=function(_0x30c237,_0x32e731){return _0x30c237[_0x6a18('0xc')](_0x6a18('0xd'),attributes,{'tableName':_0x6a18('0xe'),'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 8361cb1..e23c865 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 _0x7b82=['result','catch','CreateSquareMessage','SquareMessage','options','then','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','info','SquareMessage,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x1275fe,_0xee2c86){var _0x57db9d=function(_0xb2f944){while(--_0xb2f944){_0x1275fe['push'](_0x1275fe['shift']());}};_0x57db9d(++_0xee2c86);}(_0x7b82,0xa8));var _0x27b8=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x7b82[_0x100e36];return _0x1df0c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27b8('0x0'));var BPromise=require('bluebird');var rs=require(_0x27b8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27b8('0x2'))['db'];var utils=require(_0x27b8('0x3'));var logger=require('../../config/logger')(_0x27b8('0x4'));var config=require('../../config/environment');var jayson=require(_0x27b8('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee26b,_0x5b23c6,_0x5f5b36){return new BPromise(function(_0x3fdfa7,_0x36fabb){return client['request'](_0x3ee26b,_0x5f5b36)['then'](function(_0x4cf2c3){logger[_0x27b8('0x6')](_0x27b8('0x7'),_0x5b23c6,'request\x20sent');logger[_0x27b8('0x8')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5b23c6,'request\x20sent',JSON[_0x27b8('0x9')](_0x4cf2c3));if(_0x4cf2c3[_0x27b8('0xa')]){if(_0x4cf2c3[_0x27b8('0xa')]['code']===0x1f4){logger[_0x27b8('0xa')](_0x27b8('0x7'),_0x5b23c6,_0x4cf2c3[_0x27b8('0xa')]['message']);return _0x36fabb(_0x4cf2c3['error']['message']);}logger['error'](_0x27b8('0x7'),_0x5b23c6,_0x4cf2c3[_0x27b8('0xa')][_0x27b8('0xb')]);return _0x3fdfa7(_0x4cf2c3['error'][_0x27b8('0xb')]);}else{logger[_0x27b8('0x6')](_0x27b8('0x7'),_0x5b23c6,'request\x20sent');_0x3fdfa7(_0x4cf2c3[_0x27b8('0xc')]['message']);}})[_0x27b8('0xd')](function(_0x4907d6){logger[_0x27b8('0xa')](_0x27b8('0x7'),_0x5b23c6,_0x4907d6);_0x36fabb(_0x4907d6);});});}exports[_0x27b8('0xe')]=function(_0x2f8e76){var _0x9cc703=this;return new Promise(function(_0x487fcc,_0x2cb3a3){return db[_0x27b8('0xf')]['create'](_0x2f8e76['body'],{'raw':_0x2f8e76[_0x27b8('0x10')]?_0x2f8e76[_0x27b8('0x10')]['raw']===undefined?!![]:![]:!![]})[_0x27b8('0x11')](function(_0x28b567){logger[_0x27b8('0x6')]('CreateSquareMessage',_0x2f8e76);logger[_0x27b8('0x8')](_0x27b8('0xe'),_0x2f8e76,JSON['stringify'](_0x28b567));_0x487fcc(_0x28b567);})[_0x27b8('0xd')](function(_0x119c21){logger[_0x27b8('0xa')](_0x27b8('0xe'),_0x119c21[_0x27b8('0xb')],_0x2f8e76);_0x2cb3a3(_0x9cc703[_0x27b8('0xa')](0x1f4,_0x119c21[_0x27b8('0xb')]));});});}; \ No newline at end of file +var _0x509a=['debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options'];(function(_0xd0c182,_0x527c8a){var _0x5a70eb=function(_0x5b210c){while(--_0x5b210c){_0xd0c182['push'](_0xd0c182['shift']());}};_0x5a70eb(++_0x527c8a);}(_0x509a,0x10f));var _0xa509=function(_0x2306de,_0x5b9304){_0x2306de=_0x2306de-0x0;var _0x3143e9=_0x509a[_0x2306de];return _0x3143e9;};'use strict';var _=require('lodash');var util=require(_0xa509('0x0'));var moment=require(_0xa509('0x1'));var BPromise=require(_0xa509('0x2'));var rs=require(_0xa509('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa509('0x4'))['db'];var utils=require(_0xa509('0x5'));var logger=require('../../config/logger')(_0xa509('0x6'));var config=require(_0xa509('0x7'));var jayson=require(_0xa509('0x8'));var client=jayson[_0xa509('0x9')][_0xa509('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x633422,_0xffa3fc,_0x25d7f6){return new BPromise(function(_0x1d428e,_0x129f09){return client['request'](_0x633422,_0x25d7f6)[_0xa509('0xb')](function(_0x473415){logger[_0xa509('0xc')](_0xa509('0xd'),_0xffa3fc,_0xa509('0xe'));logger['debug'](_0xa509('0xf'),_0xffa3fc,_0xa509('0xe'),JSON[_0xa509('0x10')](_0x473415));if(_0x473415[_0xa509('0x11')]){if(_0x473415[_0xa509('0x11')]['code']===0x1f4){logger[_0xa509('0x11')](_0xa509('0xd'),_0xffa3fc,_0x473415['error'][_0xa509('0x12')]);return _0x129f09(_0x473415[_0xa509('0x11')][_0xa509('0x12')]);}logger[_0xa509('0x11')](_0xa509('0xd'),_0xffa3fc,_0x473415[_0xa509('0x11')][_0xa509('0x12')]);return _0x1d428e(_0x473415[_0xa509('0x11')][_0xa509('0x12')]);}else{logger[_0xa509('0xc')](_0xa509('0xd'),_0xffa3fc,_0xa509('0xe'));_0x1d428e(_0x473415[_0xa509('0x13')][_0xa509('0x12')]);}})[_0xa509('0x14')](function(_0x35c492){logger['error'](_0xa509('0xd'),_0xffa3fc,_0x35c492);_0x129f09(_0x35c492);});});}exports[_0xa509('0x15')]=function(_0x1a6e75){var _0x3b267c=this;return new Promise(function(_0x5dd8af,_0x3a113a){return db[_0xa509('0x16')][_0xa509('0x17')](_0x1a6e75[_0xa509('0x18')],{'raw':_0x1a6e75['options']?_0x1a6e75[_0xa509('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c83b9){logger[_0xa509('0xc')](_0xa509('0x15'),_0x1a6e75);logger[_0xa509('0x1a')](_0xa509('0x15'),_0x1a6e75,JSON['stringify'](_0x4c83b9));_0x5dd8af(_0x4c83b9);})[_0xa509('0x14')](function(_0x469193){logger['error'](_0xa509('0x15'),_0x469193['message'],_0x1a6e75);_0x3a113a(_0x3b267c[_0xa509('0x11')](0x1f4,_0x469193['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index ad5fd59..9583348 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 _0xce73=['/:id','show','15s','test','post','create','put','update','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index'];(function(_0x373a23,_0x21b5de){var _0x16d483=function(_0x34f6fd){while(--_0x34f6fd){_0x373a23['push'](_0x373a23['shift']());}};_0x16d483(++_0x21b5de);}(_0xce73,0x8d));var _0x3ce7=function(_0x56e476,_0x1cfc79){_0x56e476=_0x56e476-0x0;var _0x4a9704=_0xce73[_0x56e476];return _0x4a9704;};'use strict';var multer=require(_0x3ce7('0x0'));var util=require(_0x3ce7('0x1'));var path=require(_0x3ce7('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ce7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3ce7('0x4'));var interaction=require(_0x3ce7('0x5'));var config=require(_0x3ce7('0x6'));var controller=require(_0x3ce7('0x7'));router[_0x3ce7('0x8')]('/',auth[_0x3ce7('0x9')](),controller[_0x3ce7('0xa')]);router['get'](_0x3ce7('0xb'),auth[_0x3ce7('0x9')](),controller[_0x3ce7('0xc')]);router['get']('/:id/test',auth[_0x3ce7('0x9')](),timeout(_0x3ce7('0xd')),controller[_0x3ce7('0xe')]);router[_0x3ce7('0xf')]('/',auth[_0x3ce7('0x9')](),controller[_0x3ce7('0x10')]);router[_0x3ce7('0x11')](_0x3ce7('0xb'),auth[_0x3ce7('0x9')](),controller[_0x3ce7('0x12')]);router['delete']('/:id',auth[_0x3ce7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5717=['isAuthenticated','show','/:id/test','15s','test','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','index','/:id'];(function(_0x2ab367,_0x314027){var _0x486412=function(_0x462243){while(--_0x462243){_0x2ab367['push'](_0x2ab367['shift']());}};_0x486412(++_0x314027);}(_0x5717,0x6b));var _0x7571=function(_0x44d568,_0x4132f8){_0x44d568=_0x44d568-0x0;var _0x3d286a=_0x5717[_0x44d568];return _0x3d286a;};'use strict';var multer=require(_0x7571('0x0'));var util=require(_0x7571('0x1'));var path=require(_0x7571('0x2'));var timeout=require(_0x7571('0x3'));var express=require(_0x7571('0x4'));var router=express[_0x7571('0x5')]();var fs_extra=require(_0x7571('0x6'));var auth=require(_0x7571('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7571('0x8'));var controller=require(_0x7571('0x9'));router[_0x7571('0xa')]('/',auth['isAuthenticated'](),controller[_0x7571('0xb')]);router['get'](_0x7571('0xc'),auth[_0x7571('0xd')](),controller[_0x7571('0xe')]);router[_0x7571('0xa')](_0x7571('0xf'),auth[_0x7571('0xd')](),timeout(_0x7571('0x10')),controller[_0x7571('0x11')]);router[_0x7571('0x12')]('/',auth[_0x7571('0xd')](),controller[_0x7571('0x13')]);router[_0x7571('0x14')](_0x7571('0xc'),auth[_0x7571('0xd')](),controller[_0x7571('0x15')]);router['delete'](_0x7571('0xc'),auth[_0x7571('0xd')](),controller[_0x7571('0x16')]);module[_0x7571('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c06967a..ad37462 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 _0x6ba4=['exports','STRING','sequelize'];(function(_0x2df84d,_0x56d874){var _0x2634ce=function(_0x8e8e31){while(--_0x8e8e31){_0x2df84d['push'](_0x2df84d['shift']());}};_0x2634ce(++_0x56d874);}(_0x6ba4,0x1d9));var _0x46ba=function(_0xfd2aa,_0x5ddbcf){_0xfd2aa=_0xfd2aa-0x0;var _0x289511=_0x6ba4[_0xfd2aa];return _0x289511;};'use strict';var Sequelize=require(_0x46ba('0x0'));module[_0x46ba('0x1')]={'name':{'type':Sequelize[_0x46ba('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7a37=['sequelize','STRING','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a37,0x192));var _0x77a3=function(_0x15252f,_0x80473d){_0x15252f=_0x15252f-0x0;var _0x3bedec=_0x7a37[_0x15252f];return _0x3bedec;};'use strict';var Sequelize=require(_0x77a3('0x0'));module['exports']={'name':{'type':Sequelize[_0x77a3('0x1')],'unique':_0x77a3('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77a3('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index f7cff52..00393bb 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 _0xb878=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','reject','save','then','destroy','ODBC','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection'];(function(_0x429f8d,_0x304058){var _0x50fc79=function(_0x3a1570){while(--_0x3a1570){_0x429f8d['push'](_0x429f8d['shift']());}};_0x50fc79(++_0x304058);}(_0xb878,0x1cc));var _0x8b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb878[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b87('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b87('0x1'));var rp=require('request-promise');var moment=require(_0x8b87('0x2'));var BPromise=require(_0x8b87('0x3'));var Mustache=require(_0x8b87('0x4'));var util=require('util');var path=require(_0x8b87('0x5'));var sox=require(_0x8b87('0x6'));var csv=require('to-csv');var ejs=require(_0x8b87('0x7'));var fs=require('fs');var fs_extra=require(_0x8b87('0x8'));var _=require(_0x8b87('0x9'));var squel=require('squel');var crypto=require(_0x8b87('0xa'));var jsforce=require(_0x8b87('0xb'));var deskjs=require(_0x8b87('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8b87('0xd'));var Papa=require(_0x8b87('0xe'));var Redis=require(_0x8b87('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8b87('0x10'));var as=require(_0x8b87('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b87('0x12'))(_0x8b87('0x13'));var utils=require(_0x8b87('0x14'));var config=require(_0x8b87('0x15'));var licenseUtil=require(_0x8b87('0x16'));var db=require(_0x8b87('0x17'))['db'];function respondWithStatusCode(_0xa1bd1c,_0x1c54c9){_0x1c54c9=_0x1c54c9||0xcc;return function(_0x2f3557){if(_0x2f3557){return _0xa1bd1c[_0x8b87('0x18')](_0x1c54c9);}return _0xa1bd1c['status'](_0x1c54c9)[_0x8b87('0x19')]();};}function respondWithResult(_0x520576,_0x3ff7b3){_0x3ff7b3=_0x3ff7b3||0xc8;return function(_0x2ed842){if(_0x2ed842){return _0x520576['status'](_0x3ff7b3)[_0x8b87('0x1a')](_0x2ed842);}};}function respondWithFilteredResult(_0xa5b935,_0x1e10a6){return function(_0x1c7118){if(_0x1c7118){var _0x44e1fb=typeof _0x1e10a6[_0x8b87('0x1b')]===_0x8b87('0x1c')&&typeof _0x1e10a6['limit']===_0x8b87('0x1c');var _0x1fbbbf=_0x1c7118[_0x8b87('0x1d')];var _0x3b901b=_0x44e1fb?0x0:_0x1e10a6[_0x8b87('0x1b')];var _0x4ad72d=_0x44e1fb?_0x1c7118['count']:_0x1e10a6[_0x8b87('0x1b')]+_0x1e10a6[_0x8b87('0x1e')];var _0x922fe3;if(_0x4ad72d>=_0x1fbbbf){_0x4ad72d=_0x1fbbbf;_0x922fe3=0xc8;}else{_0x922fe3=0xce;}_0xa5b935[_0x8b87('0x1f')](_0x922fe3);return _0xa5b935[_0x8b87('0x20')](_0x8b87('0x21'),_0x3b901b+'-'+_0x4ad72d+'/'+_0x1fbbbf)['json'](_0x1c7118);}return null;};}function patchUpdates(_0x57de67){return function(_0x4f6b91){try{jsonpatch['apply'](_0x4f6b91,_0x57de67,!![]);}catch(_0x56281c){return BPromise[_0x8b87('0x22')](_0x56281c);}return _0x4f6b91[_0x8b87('0x23')]();};}function saveUpdates(_0x5985cd,_0x11288b){return function(_0x7a15db){if(_0x7a15db){return _0x7a15db['update'](_0x5985cd)[_0x8b87('0x24')](function(_0x22b184){return _0x22b184;});}return null;};}function removeEntity(_0x4c8ba3,_0x5c9a99){return function(_0x3755cd){if(_0x3755cd){return _0x3755cd[_0x8b87('0x25')]()[_0x8b87('0x24')](function(){var _0x1b1c74=_0x3755cd['get']({'plain':!![]});var _0x5d24ad=_0x8b87('0x26');return db['UserProfileResource'][_0x8b87('0x25')]({'where':{'type':_0x5d24ad,'resourceId':_0x1b1c74['id']}})[_0x8b87('0x24')](function(){return _0x3755cd;});})[_0x8b87('0x24')](function(){_0x4c8ba3[_0x8b87('0x1f')](0xcc)[_0x8b87('0x19')]();});}};}function handleEntityNotFound(_0x26ef57,_0x4cf6a7){return function(_0x586bc4){if(!_0x586bc4){_0x26ef57[_0x8b87('0x18')](0x194);}return _0x586bc4;};}function handleError(_0x2dfc70,_0x5409b5){_0x5409b5=_0x5409b5||0x1f4;return function(_0x2ddb37){logger[_0x8b87('0x27')](_0x2ddb37[_0x8b87('0x28')]);if(_0x2ddb37[_0x8b87('0x29')]){delete _0x2ddb37[_0x8b87('0x29')];}_0x2dfc70[_0x8b87('0x1f')](_0x5409b5)[_0x8b87('0x2a')](_0x2ddb37);};}exports[_0x8b87('0x2b')]=function(_0x4d9538,_0x2a60f9){var _0x34efc6={},_0x45677b={},_0x564c4d={'count':0x0,'rows':[]};var _0x3f0cc1=_[_0x8b87('0x2c')](db[_0x8b87('0x2d')][_0x8b87('0x2e')],function(_0x5b404c){return{'name':_0x5b404c[_0x8b87('0x2f')],'type':_0x5b404c['type'][_0x8b87('0x30')]};});_0x45677b[_0x8b87('0x31')]=_[_0x8b87('0x2c')](_0x3f0cc1,_0x8b87('0x29'));_0x45677b[_0x8b87('0x32')]=_[_0x8b87('0x33')](_0x4d9538[_0x8b87('0x32')]);_0x45677b[_0x8b87('0x34')]=_[_0x8b87('0x35')](_0x45677b[_0x8b87('0x31')],_0x45677b[_0x8b87('0x32')]);_0x34efc6[_0x8b87('0x36')]=_['intersection'](_0x45677b['model'],qs['fields'](_0x4d9538[_0x8b87('0x32')][_0x8b87('0x37')]));_0x34efc6[_0x8b87('0x36')]=_0x34efc6['attributes'][_0x8b87('0x38')]?_0x34efc6[_0x8b87('0x36')]:_0x45677b[_0x8b87('0x31')];if(!_0x4d9538[_0x8b87('0x32')][_0x8b87('0x39')](_0x8b87('0x3a'))){_0x34efc6['limit']=qs[_0x8b87('0x1e')](_0x4d9538['query'][_0x8b87('0x1e')]);_0x34efc6[_0x8b87('0x1b')]=qs[_0x8b87('0x1b')](_0x4d9538[_0x8b87('0x32')][_0x8b87('0x1b')]);}_0x34efc6[_0x8b87('0x3b')]=qs[_0x8b87('0x3c')](_0x4d9538[_0x8b87('0x32')][_0x8b87('0x3c')]);_0x34efc6[_0x8b87('0x3d')]=qs['filters'](_[_0x8b87('0x3e')](_0x4d9538[_0x8b87('0x32')],_0x45677b[_0x8b87('0x34')]),_0x3f0cc1);if(_0x4d9538[_0x8b87('0x32')][_0x8b87('0x3f')]){_0x34efc6[_0x8b87('0x3d')]=_[_0x8b87('0x40')](_0x34efc6[_0x8b87('0x3d')],{'$or':_[_0x8b87('0x2c')](_0x3f0cc1,function(_0x5a1f55){if(_0x5a1f55['type']!==_0x8b87('0x41')){var _0x2c318a={};_0x2c318a[_0x5a1f55['name']]={'$like':'%'+_0x4d9538[_0x8b87('0x32')]['filter']+'%'};return _0x2c318a;}})});}_0x34efc6=_[_0x8b87('0x40')]({},_0x34efc6,_0x4d9538[_0x8b87('0x42')]);var _0x2bd816={'where':_0x34efc6['where']};return db[_0x8b87('0x2d')]['count'](_0x2bd816)['then'](function(_0x571e68){_0x564c4d['count']=_0x571e68;if(_0x4d9538[_0x8b87('0x32')]['includeAll']){_0x34efc6[_0x8b87('0x43')]=[{'all':!![]}];}return db['SquareOdbc'][_0x8b87('0x44')](_0x34efc6);})[_0x8b87('0x24')](function(_0x3a6ebc){_0x564c4d[_0x8b87('0x45')]=_0x3a6ebc;return _0x564c4d;})[_0x8b87('0x24')](respondWithFilteredResult(_0x2a60f9,_0x34efc6))[_0x8b87('0x46')](handleError(_0x2a60f9,null));};exports[_0x8b87('0x47')]=function(_0x416358,_0x5653a3){var _0x361827={'raw':!![],'where':{'id':_0x416358[_0x8b87('0x48')]['id']}},_0x1710bf={};_0x1710bf[_0x8b87('0x31')]=_[_0x8b87('0x33')](db['SquareOdbc']['rawAttributes']);_0x1710bf['query']=_['keys'](_0x416358[_0x8b87('0x32')]);_0x1710bf[_0x8b87('0x34')]=_[_0x8b87('0x35')](_0x1710bf[_0x8b87('0x31')],_0x1710bf['query']);_0x361827[_0x8b87('0x36')]=_['intersection'](_0x1710bf['model'],qs[_0x8b87('0x37')](_0x416358[_0x8b87('0x32')]['fields']));_0x361827[_0x8b87('0x36')]=_0x361827['attributes'][_0x8b87('0x38')]?_0x361827[_0x8b87('0x36')]:_0x1710bf[_0x8b87('0x31')];if(_0x416358[_0x8b87('0x32')][_0x8b87('0x49')]){_0x361827[_0x8b87('0x43')]=[{'all':!![]}];}_0x361827=_[_0x8b87('0x40')]({},_0x361827,_0x416358['options']);return db['SquareOdbc'][_0x8b87('0x4a')](_0x361827)['then'](handleEntityNotFound(_0x5653a3,null))[_0x8b87('0x24')](respondWithResult(_0x5653a3,null))[_0x8b87('0x46')](handleError(_0x5653a3,null));};exports['create']=function(_0x553ac6,_0x128069){return db[_0x8b87('0x2d')][_0x8b87('0x4b')](_0x553ac6['body'],{})['then'](function(_0x11c919){var _0x3a004b=_0x553ac6[_0x8b87('0x4c')]['get']({'plain':!![]});if(!_0x3a004b)throw new Error(_0x8b87('0x4d'));if(_0x3a004b['role']===_0x8b87('0x4c')){var _0x25d217=_0x11c919[_0x8b87('0x4e')]({'plain':!![]});var _0x2461dc='ODBC';return db[_0x8b87('0x4f')][_0x8b87('0x4a')]({'where':{'name':_0x2461dc,'userProfileId':_0x3a004b[_0x8b87('0x50')]},'raw':!![]})[_0x8b87('0x24')](function(_0x6e4ad1){if(_0x6e4ad1&&_0x6e4ad1[_0x8b87('0x51')]===0x0){return db['UserProfileResource'][_0x8b87('0x4b')]({'name':_0x25d217[_0x8b87('0x29')],'resourceId':_0x25d217['id'],'type':_0x6e4ad1[_0x8b87('0x29')],'sectionId':_0x6e4ad1['id']},{})[_0x8b87('0x24')](function(){return _0x11c919;});}else{return _0x11c919;}})[_0x8b87('0x46')](function(_0x132b23){logger[_0x8b87('0x27')](_0x8b87('0x52'),_0x132b23);throw _0x132b23;});}return _0x11c919;})['then'](respondWithResult(_0x128069,0xc9))[_0x8b87('0x46')](handleError(_0x128069,null));};exports[_0x8b87('0x53')]=function(_0x4bbee2,_0xa677ef){if(_0x4bbee2[_0x8b87('0x54')]['id']){delete _0x4bbee2[_0x8b87('0x54')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x4bbee2[_0x8b87('0x48')]['id']}})[_0x8b87('0x24')](handleEntityNotFound(_0xa677ef,null))[_0x8b87('0x24')](saveUpdates(_0x4bbee2[_0x8b87('0x54')],null))[_0x8b87('0x24')](respondWithResult(_0xa677ef,null))[_0x8b87('0x46')](handleError(_0xa677ef,null));};exports['destroy']=function(_0x5e0218,_0x2480e4){return db[_0x8b87('0x2d')][_0x8b87('0x4a')]({'where':{'id':_0x5e0218[_0x8b87('0x48')]['id']}})['then'](handleEntityNotFound(_0x2480e4,null))['then'](removeEntity(_0x2480e4,null))[_0x8b87('0x46')](handleError(_0x2480e4,null));};exports[_0x8b87('0x55')]=function(_0x4363c6,_0x466b8e,_0x13a168){var _0x3ebadf;return db[_0x8b87('0x2d')]['find']({'where':{'id':_0x4363c6['params']['id']},'attributes':['id',_0x8b87('0x56')]})[_0x8b87('0x24')](handleEntityNotFound(_0x466b8e,null))['then'](function(_0x22417d){if(_0x22417d){var _0x2fbd1a=require(_0x8b87('0x57'))();_0x2fbd1a[_0x8b87('0x58')](_0x22417d[_0x8b87('0x56')]);_0x2fbd1a[_0x8b87('0x59')]();return _0x22417d;}})[_0x8b87('0x24')](respondWithResult(_0x466b8e,null))[_0x8b87('0x46')](handleError(_0x466b8e,null));}; \ No newline at end of file +var _0x5b80=['sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','update','test','dsn','closeSync','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','ODBC','sendStatus','error','stack','name','index','SquareOdbc','rawAttributes','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x1978f8,_0x5dc5b0){var _0x285d93=function(_0x20656e){while(--_0x20656e){_0x1978f8['push'](_0x1978f8['shift']());}};_0x285d93(++_0x5dc5b0);}(_0x5b80,0xc2));var _0x05b8=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x5b80[_0x433a86];return _0x23000c;};'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(_0x05b8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x05b8('0x1'));var util=require('util');var path=require(_0x05b8('0x2'));var sox=require(_0x05b8('0x3'));var csv=require(_0x05b8('0x4'));var ejs=require(_0x05b8('0x5'));var fs=require('fs');var fs_extra=require(_0x05b8('0x6'));var _=require(_0x05b8('0x7'));var squel=require(_0x05b8('0x8'));var crypto=require(_0x05b8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x05b8('0xa'));var toCsv=require(_0x05b8('0x4'));var querystring=require(_0x05b8('0xb'));var Papa=require('papaparse');var Redis=require(_0x05b8('0xc'));var authService=require(_0x05b8('0xd'));var qs=require(_0x05b8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05b8('0xf'));var logger=require(_0x05b8('0x10'))(_0x05b8('0x11'));var utils=require(_0x05b8('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x05b8('0x13'));var db=require(_0x05b8('0x14'))['db'];function respondWithStatusCode(_0x5b3631,_0x2eeeba){_0x2eeeba=_0x2eeeba||0xcc;return function(_0x5b5464){if(_0x5b5464){return _0x5b3631['sendStatus'](_0x2eeeba);}return _0x5b3631['status'](_0x2eeeba)['end']();};}function respondWithResult(_0x3edb35,_0x1b7f9e){_0x1b7f9e=_0x1b7f9e||0xc8;return function(_0x149e8d){if(_0x149e8d){return _0x3edb35[_0x05b8('0x15')](_0x1b7f9e)[_0x05b8('0x16')](_0x149e8d);}};}function respondWithFilteredResult(_0x3ba702,_0xc5817c){return function(_0x8da748){if(_0x8da748){var _0x49d7b2=typeof _0xc5817c[_0x05b8('0x17')]===_0x05b8('0x18')&&typeof _0xc5817c['limit']===_0x05b8('0x18');var _0x2ceecb=_0x8da748[_0x05b8('0x19')];var _0x52f4ea=_0x49d7b2?0x0:_0xc5817c['offset'];var _0x595de3=_0x49d7b2?_0x8da748['count']:_0xc5817c[_0x05b8('0x17')]+_0xc5817c[_0x05b8('0x1a')];var _0x58ec83;if(_0x595de3>=_0x2ceecb){_0x595de3=_0x2ceecb;_0x58ec83=0xc8;}else{_0x58ec83=0xce;}_0x3ba702[_0x05b8('0x15')](_0x58ec83);return _0x3ba702[_0x05b8('0x1b')](_0x05b8('0x1c'),_0x52f4ea+'-'+_0x595de3+'/'+_0x2ceecb)[_0x05b8('0x16')](_0x8da748);}return null;};}function patchUpdates(_0x3fc4e6){return function(_0x186866){try{jsonpatch[_0x05b8('0x1d')](_0x186866,_0x3fc4e6,!![]);}catch(_0x169926){return BPromise[_0x05b8('0x1e')](_0x169926);}return _0x186866[_0x05b8('0x1f')]();};}function saveUpdates(_0xea09ad,_0x861125){return function(_0x1d6a45){if(_0x1d6a45){return _0x1d6a45['update'](_0xea09ad)['then'](function(_0x26d45b){return _0x26d45b;});}return null;};}function removeEntity(_0x38a94e,_0x3c39d5){return function(_0x26c47b){if(_0x26c47b){return _0x26c47b[_0x05b8('0x20')]()[_0x05b8('0x21')](function(){var _0x3fbc77=_0x26c47b['get']({'plain':!![]});var _0x113461=_0x05b8('0x22');return db['UserProfileResource'][_0x05b8('0x20')]({'where':{'type':_0x113461,'resourceId':_0x3fbc77['id']}})['then'](function(){return _0x26c47b;});})[_0x05b8('0x21')](function(){_0x38a94e[_0x05b8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21a9aa,_0x27153e){return function(_0x40a0b8){if(!_0x40a0b8){_0x21a9aa[_0x05b8('0x23')](0x194);}return _0x40a0b8;};}function handleError(_0x785029,_0x829d69){_0x829d69=_0x829d69||0x1f4;return function(_0x5e592f){logger[_0x05b8('0x24')](_0x5e592f[_0x05b8('0x25')]);if(_0x5e592f[_0x05b8('0x26')]){delete _0x5e592f[_0x05b8('0x26')];}_0x785029[_0x05b8('0x15')](_0x829d69)['send'](_0x5e592f);};}exports[_0x05b8('0x27')]=function(_0x1f58f3,_0x20e1d3){var _0x476595={},_0x127257={},_0x25b3d9={'count':0x0,'rows':[]};var _0x58b138=_['map'](db[_0x05b8('0x28')][_0x05b8('0x29')],function(_0x5dc57e){return{'name':_0x5dc57e['fieldName'],'type':_0x5dc57e['type'][_0x05b8('0x2a')]};});_0x127257['model']=_[_0x05b8('0x2b')](_0x58b138,_0x05b8('0x26'));_0x127257[_0x05b8('0x2c')]=_['keys'](_0x1f58f3[_0x05b8('0x2c')]);_0x127257['filters']=_[_0x05b8('0x2d')](_0x127257[_0x05b8('0x2e')],_0x127257['query']);_0x476595[_0x05b8('0x2f')]=_[_0x05b8('0x2d')](_0x127257[_0x05b8('0x2e')],qs['fields'](_0x1f58f3[_0x05b8('0x2c')][_0x05b8('0x30')]));_0x476595[_0x05b8('0x2f')]=_0x476595[_0x05b8('0x2f')]['length']?_0x476595['attributes']:_0x127257['model'];if(!_0x1f58f3[_0x05b8('0x2c')][_0x05b8('0x31')](_0x05b8('0x32'))){_0x476595[_0x05b8('0x1a')]=qs[_0x05b8('0x1a')](_0x1f58f3[_0x05b8('0x2c')]['limit']);_0x476595[_0x05b8('0x17')]=qs['offset'](_0x1f58f3[_0x05b8('0x2c')][_0x05b8('0x17')]);}_0x476595[_0x05b8('0x33')]=qs[_0x05b8('0x34')](_0x1f58f3[_0x05b8('0x2c')][_0x05b8('0x34')]);_0x476595[_0x05b8('0x35')]=qs[_0x05b8('0x36')](_[_0x05b8('0x37')](_0x1f58f3[_0x05b8('0x2c')],_0x127257['filters']),_0x58b138);if(_0x1f58f3[_0x05b8('0x2c')]['filter']){_0x476595[_0x05b8('0x35')]=_['merge'](_0x476595[_0x05b8('0x35')],{'$or':_[_0x05b8('0x2b')](_0x58b138,function(_0x1a8fa5){if(_0x1a8fa5['type']!==_0x05b8('0x38')){var _0x43f05f={};_0x43f05f[_0x1a8fa5[_0x05b8('0x26')]]={'$like':'%'+_0x1f58f3[_0x05b8('0x2c')]['filter']+'%'};return _0x43f05f;}})});}_0x476595=_[_0x05b8('0x39')]({},_0x476595,_0x1f58f3[_0x05b8('0x3a')]);var _0x37cb80={'where':_0x476595['where']};return db[_0x05b8('0x28')]['count'](_0x37cb80)[_0x05b8('0x21')](function(_0x915a3){_0x25b3d9['count']=_0x915a3;if(_0x1f58f3[_0x05b8('0x2c')][_0x05b8('0x3b')]){_0x476595[_0x05b8('0x3c')]=[{'all':!![]}];}return db[_0x05b8('0x28')][_0x05b8('0x3d')](_0x476595);})['then'](function(_0x2e0cfe){_0x25b3d9[_0x05b8('0x3e')]=_0x2e0cfe;return _0x25b3d9;})[_0x05b8('0x21')](respondWithFilteredResult(_0x20e1d3,_0x476595))[_0x05b8('0x3f')](handleError(_0x20e1d3,null));};exports[_0x05b8('0x40')]=function(_0x143acf,_0x5f1dce){var _0x4249fc={'raw':!![],'where':{'id':_0x143acf[_0x05b8('0x41')]['id']}},_0x4ff262={};_0x4ff262[_0x05b8('0x2e')]=_[_0x05b8('0x42')](db[_0x05b8('0x28')][_0x05b8('0x29')]);_0x4ff262['query']=_[_0x05b8('0x42')](_0x143acf[_0x05b8('0x2c')]);_0x4ff262[_0x05b8('0x36')]=_[_0x05b8('0x2d')](_0x4ff262[_0x05b8('0x2e')],_0x4ff262[_0x05b8('0x2c')]);_0x4249fc[_0x05b8('0x2f')]=_['intersection'](_0x4ff262[_0x05b8('0x2e')],qs['fields'](_0x143acf['query'][_0x05b8('0x30')]));_0x4249fc[_0x05b8('0x2f')]=_0x4249fc[_0x05b8('0x2f')][_0x05b8('0x43')]?_0x4249fc[_0x05b8('0x2f')]:_0x4ff262[_0x05b8('0x2e')];if(_0x143acf[_0x05b8('0x2c')][_0x05b8('0x3b')]){_0x4249fc[_0x05b8('0x3c')]=[{'all':!![]}];}_0x4249fc=_['merge']({},_0x4249fc,_0x143acf[_0x05b8('0x3a')]);return db[_0x05b8('0x28')][_0x05b8('0x44')](_0x4249fc)['then'](handleEntityNotFound(_0x5f1dce,null))['then'](respondWithResult(_0x5f1dce,null))['catch'](handleError(_0x5f1dce,null));};exports[_0x05b8('0x45')]=function(_0x53a527,_0x2672db){return db[_0x05b8('0x28')][_0x05b8('0x45')](_0x53a527[_0x05b8('0x46')],{})[_0x05b8('0x21')](function(_0x5a00f5){var _0x2eacf2=_0x53a527[_0x05b8('0x47')]['get']({'plain':!![]});if(!_0x2eacf2)throw new Error(_0x05b8('0x48'));if(_0x2eacf2[_0x05b8('0x49')]===_0x05b8('0x47')){var _0x4a283c=_0x5a00f5[_0x05b8('0x4a')]({'plain':!![]});var _0x29c409=_0x05b8('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x29c409,'userProfileId':_0x2eacf2[_0x05b8('0x4b')]},'raw':!![]})[_0x05b8('0x21')](function(_0xd0ca8a){if(_0xd0ca8a&&_0xd0ca8a[_0x05b8('0x4c')]===0x0){return db[_0x05b8('0x4d')][_0x05b8('0x45')]({'name':_0x4a283c[_0x05b8('0x26')],'resourceId':_0x4a283c['id'],'type':_0xd0ca8a[_0x05b8('0x26')],'sectionId':_0xd0ca8a['id']},{})[_0x05b8('0x21')](function(){return _0x5a00f5;});}else{return _0x5a00f5;}})['catch'](function(_0x4dbb59){logger[_0x05b8('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dbb59);throw _0x4dbb59;});}return _0x5a00f5;})[_0x05b8('0x21')](respondWithResult(_0x2672db,0xc9))[_0x05b8('0x3f')](handleError(_0x2672db,null));};exports[_0x05b8('0x4e')]=function(_0x30c190,_0x208125){if(_0x30c190['body']['id']){delete _0x30c190[_0x05b8('0x46')]['id'];}return db[_0x05b8('0x28')][_0x05b8('0x44')]({'where':{'id':_0x30c190['params']['id']}})[_0x05b8('0x21')](handleEntityNotFound(_0x208125,null))[_0x05b8('0x21')](saveUpdates(_0x30c190[_0x05b8('0x46')],null))[_0x05b8('0x21')](respondWithResult(_0x208125,null))[_0x05b8('0x3f')](handleError(_0x208125,null));};exports[_0x05b8('0x20')]=function(_0x621aa5,_0x1c5e08){return db[_0x05b8('0x28')][_0x05b8('0x44')]({'where':{'id':_0x621aa5[_0x05b8('0x41')]['id']}})[_0x05b8('0x21')](handleEntityNotFound(_0x1c5e08,null))[_0x05b8('0x21')](removeEntity(_0x1c5e08,null))['catch'](handleError(_0x1c5e08,null));};exports[_0x05b8('0x4f')]=function(_0x131c6f,_0x494c4e,_0x30e307){var _0x31be23;return db[_0x05b8('0x28')][_0x05b8('0x44')]({'where':{'id':_0x131c6f[_0x05b8('0x41')]['id']},'attributes':['id',_0x05b8('0x50')]})[_0x05b8('0x21')](handleEntityNotFound(_0x494c4e,null))[_0x05b8('0x21')](function(_0x1e6ee2){if(_0x1e6ee2){var _0x361979=require('odbc')();_0x361979['openSync'](_0x1e6ee2[_0x05b8('0x50')]);_0x361979[_0x05b8('0x51')]();return _0x1e6ee2;}})[_0x05b8('0x21')](respondWithResult(_0x494c4e,null))[_0x05b8('0x3f')](handleError(_0x494c4e,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f8d1c2f..715647e 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 _0xca85=['rimraf','../../config/environment','exports','define','square_odbc','util','api','moment','bluebird','request-promise','path'];(function(_0x286128,_0xcf8b1d){var _0x3d1ff5=function(_0x455417){while(--_0x455417){_0x286128['push'](_0x286128['shift']());}};_0x3d1ff5(++_0xcf8b1d);}(_0xca85,0x118));var _0x5ca8=function(_0x446e61,_0x27e680){_0x446e61=_0x446e61-0x0;var _0x4160a8=_0xca85[_0x446e61];return _0x4160a8;};'use strict';var _=require('lodash');var util=require(_0x5ca8('0x0'));var logger=require('../../config/logger')(_0x5ca8('0x1'));var moment=require(_0x5ca8('0x2'));var BPromise=require(_0x5ca8('0x3'));var rp=require(_0x5ca8('0x4'));var fs=require('fs');var path=require(_0x5ca8('0x5'));var rimraf=require(_0x5ca8('0x6'));var config=require(_0x5ca8('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x5ca8('0x8')]=function(_0x49d42f,_0x19c2db){return _0x49d42f[_0x5ca8('0x9')]('SquareOdbc',attributes,{'tableName':_0x5ca8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf644=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','lodash'];(function(_0x4b98d8,_0xedf8bb){var _0x986827=function(_0x3478b1){while(--_0x3478b1){_0x4b98d8['push'](_0x4b98d8['shift']());}};_0x986827(++_0xedf8bb);}(_0xf644,0x1eb));var _0x4f64=function(_0xb51cff,_0x10ecb6){_0xb51cff=_0xb51cff-0x0;var _0x2d76fb=_0xf644[_0xb51cff];return _0x2d76fb;};'use strict';var _=require(_0x4f64('0x0'));var util=require(_0x4f64('0x1'));var logger=require(_0x4f64('0x2'))('api');var moment=require(_0x4f64('0x3'));var BPromise=require(_0x4f64('0x4'));var rp=require(_0x4f64('0x5'));var fs=require('fs');var path=require(_0x4f64('0x6'));var rimraf=require(_0x4f64('0x7'));var config=require(_0x4f64('0x8'));var attributes=require(_0x4f64('0x9'));module[_0x4f64('0xa')]=function(_0x23255b,_0x4f0193){return _0x23255b[_0x4f64('0xb')]('SquareOdbc',attributes,{'tableName':'square_odbc','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 6f4ec67..90911f2 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 _0xc65a=['rpc','../../config/environment','client','http','request','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','then','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xc65a,0x191));var _0xac65=function(_0x5d8097,_0x1f9fca){_0x5d8097=_0x5d8097-0x0;var _0x4f3d0b=_0xc65a[_0x5d8097];return _0x4f3d0b;};'use strict';var _=require('lodash');var util=require(_0xac65('0x0'));var moment=require(_0xac65('0x1'));var BPromise=require('bluebird');var rs=require(_0xac65('0x2'));var fs=require('fs');var Redis=require(_0xac65('0x3'));var db=require(_0xac65('0x4'))['db'];var utils=require(_0xac65('0x5'));var logger=require(_0xac65('0x6'))(_0xac65('0x7'));var config=require(_0xac65('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xac65('0x9')][_0xac65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca524,_0x4c07bb,_0xf38fa3){return new BPromise(function(_0xe8409a,_0x9bf34c){return client[_0xac65('0xb')](_0x1ca524,_0xf38fa3)['then'](function(_0x40f407){logger[_0xac65('0xc')](_0xac65('0xd'),_0x4c07bb,'request\x20sent');logger['debug'](_0xac65('0xe'),_0x4c07bb,_0xac65('0xf'),JSON[_0xac65('0x10')](_0x40f407));if(_0x40f407[_0xac65('0x11')]){if(_0x40f407[_0xac65('0x11')][_0xac65('0x12')]===0x1f4){logger[_0xac65('0x11')](_0xac65('0xd'),_0x4c07bb,_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);return _0x9bf34c(_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);}logger[_0xac65('0x11')](_0xac65('0xd'),_0x4c07bb,_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);return _0xe8409a(_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);}else{logger['info'](_0xac65('0xd'),_0x4c07bb,_0xac65('0xf'));_0xe8409a(_0x40f407[_0xac65('0x14')][_0xac65('0x13')]);}})[_0xac65('0x15')](function(_0x8fdad9){logger[_0xac65('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4c07bb,_0x8fdad9);_0x9bf34c(_0x8fdad9);});});}exports[_0xac65('0x16')]=function(_0x4ada4c){var _0x2f8fb0=this;return new Promise(function(_0x3a05b1,_0x1659a4){return db[_0xac65('0x17')][_0xac65('0x18')]({'raw':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1b')]||null:null,'attributes':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1c')]||null:null,'include':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c['options']['include']?_[_0xac65('0x1d')](_0x4ada4c[_0xac65('0x19')][_0xac65('0x1e')],function(_0x333a6e){return{'model':db[_0x333a6e['model']],'as':_0x333a6e['as'],'attributes':_0x333a6e[_0xac65('0x1c')],'include':_0x333a6e[_0xac65('0x1e')]?_[_0xac65('0x1d')](_0x333a6e['include'],function(_0x314174){return{'model':db[_0x314174[_0xac65('0x1f')]],'as':_0x314174['as'],'attributes':_0x314174['attributes'],'include':_0x314174['include']?_[_0xac65('0x1d')](_0x314174[_0xac65('0x1e')],function(_0x50d12e){return{'model':db[_0x50d12e['model']],'as':_0x50d12e['as'],'attributes':_0x50d12e[_0xac65('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac65('0x20')](function(_0x4b01bf){logger[_0xac65('0xc')]('ShowSquareOdbc',_0x4ada4c);logger[_0xac65('0x21')](_0xac65('0x16'),_0x4ada4c,JSON[_0xac65('0x10')](_0x4b01bf));_0x3a05b1(_0x4b01bf);})[_0xac65('0x15')](function(_0x4ce806){logger[_0xac65('0x11')](_0xac65('0x16'),_0x4ce806[_0xac65('0x13')],_0x4ada4c);_0x1659a4(_0x2f8fb0[_0xac65('0x11')](0x1f4,_0x4ce806[_0xac65('0x13')]));});});}; \ No newline at end of file +var _0x18ca=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','attributes','include','model','map','then','lodash','util','moment','randomstring'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x18ca,0x19c));var _0xa18c=function(_0x1b34da,_0x395ec4){_0x1b34da=_0x1b34da-0x0;var _0x2dcaa=_0x18ca[_0x1b34da];return _0x2dcaa;};'use strict';var _=require(_0xa18c('0x0'));var util=require(_0xa18c('0x1'));var moment=require(_0xa18c('0x2'));var BPromise=require('bluebird');var rs=require(_0xa18c('0x3'));var fs=require('fs');var Redis=require(_0xa18c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa18c('0x5'));var logger=require(_0xa18c('0x6'))(_0xa18c('0x7'));var config=require(_0xa18c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa18c('0x9')][_0xa18c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ee8fe,_0x42fedb,_0x401152){return new BPromise(function(_0x46804a,_0x5c457d){return client[_0xa18c('0xb')](_0x2ee8fe,_0x401152)['then'](function(_0x594e75){logger[_0xa18c('0xc')](_0xa18c('0xd'),_0x42fedb,_0xa18c('0xe'));logger[_0xa18c('0xf')](_0xa18c('0x10'),_0x42fedb,_0xa18c('0xe'),JSON[_0xa18c('0x11')](_0x594e75));if(_0x594e75['error']){if(_0x594e75[_0xa18c('0x12')][_0xa18c('0x13')]===0x1f4){logger['error'](_0xa18c('0xd'),_0x42fedb,_0x594e75[_0xa18c('0x12')][_0xa18c('0x14')]);return _0x5c457d(_0x594e75['error']['message']);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x42fedb,_0x594e75[_0xa18c('0x12')][_0xa18c('0x14')]);return _0x46804a(_0x594e75[_0xa18c('0x12')][_0xa18c('0x14')]);}else{logger[_0xa18c('0xc')](_0xa18c('0xd'),_0x42fedb,_0xa18c('0xe'));_0x46804a(_0x594e75[_0xa18c('0x15')][_0xa18c('0x14')]);}})[_0xa18c('0x16')](function(_0x2a3aa6){logger[_0xa18c('0x12')](_0xa18c('0xd'),_0x42fedb,_0x2a3aa6);_0x5c457d(_0x2a3aa6);});});}exports[_0xa18c('0x17')]=function(_0x2660c3){var _0x30cb87=this;return new Promise(function(_0x13227e,_0x26fbe4){return db['SquareOdbc'][_0xa18c('0x18')]({'raw':_0x2660c3[_0xa18c('0x19')]?_0x2660c3[_0xa18c('0x19')][_0xa18c('0x1a')]===undefined?!![]:![]:!![],'where':_0x2660c3[_0xa18c('0x19')]?_0x2660c3[_0xa18c('0x19')]['where']||null:null,'attributes':_0x2660c3['options']?_0x2660c3[_0xa18c('0x19')][_0xa18c('0x1b')]||null:null,'include':_0x2660c3[_0xa18c('0x19')]?_0x2660c3[_0xa18c('0x19')][_0xa18c('0x1c')]?_['map'](_0x2660c3['options'][_0xa18c('0x1c')],function(_0x500549){return{'model':db[_0x500549[_0xa18c('0x1d')]],'as':_0x500549['as'],'attributes':_0x500549[_0xa18c('0x1b')],'include':_0x500549[_0xa18c('0x1c')]?_[_0xa18c('0x1e')](_0x500549[_0xa18c('0x1c')],function(_0x2b09f6){return{'model':db[_0x2b09f6[_0xa18c('0x1d')]],'as':_0x2b09f6['as'],'attributes':_0x2b09f6[_0xa18c('0x1b')],'include':_0x2b09f6[_0xa18c('0x1c')]?_[_0xa18c('0x1e')](_0x2b09f6[_0xa18c('0x1c')],function(_0x1a3cde){return{'model':db[_0x1a3cde['model']],'as':_0x1a3cde['as'],'attributes':_0x1a3cde[_0xa18c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa18c('0x1f')](function(_0x566b8f){logger[_0xa18c('0xc')](_0xa18c('0x17'),_0x2660c3);logger[_0xa18c('0xf')](_0xa18c('0x17'),_0x2660c3,JSON[_0xa18c('0x11')](_0x566b8f));_0x13227e(_0x566b8f);})[_0xa18c('0x16')](function(_0xf838f3){logger[_0xa18c('0x12')](_0xa18c('0x17'),_0xf838f3['message'],_0x2660c3);_0x26fbe4(_0x30cb87[_0xa18c('0x12')](0x1f4,_0xf838f3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 5d974b1..7a09099 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 _0x6df9=['/:id','show','get','getUsers','post','put','update','delete','destroy','/:id/users','removeUsers','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','./squareProject.controller','isAuthenticated','index'];(function(_0x24641b,_0x560408){var _0x483687=function(_0x21a12b){while(--_0x21a12b){_0x24641b['push'](_0x24641b['shift']());}};_0x483687(++_0x560408);}(_0x6df9,0x84));var _0x96df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6df9[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var path=require('path');var timeout=require(_0x96df('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x96df('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x96df('0x4'));var config=require('../../config/environment');var controller=require(_0x96df('0x5'));router['get']('/',auth[_0x96df('0x6')](),controller[_0x96df('0x7')]);router['get'](_0x96df('0x8'),auth[_0x96df('0x6')](),controller[_0x96df('0x9')]);router[_0x96df('0xa')]('/:id/users',auth[_0x96df('0x6')](),controller[_0x96df('0xb')]);router['post']('/',auth[_0x96df('0x6')](),controller['create']);router[_0x96df('0xc')]('/:id/users',auth['isAuthenticated'](),controller['addUsers']);router[_0x96df('0xd')](_0x96df('0x8'),auth[_0x96df('0x6')](),controller[_0x96df('0xe')]);router[_0x96df('0xf')](_0x96df('0x8'),auth['isAuthenticated'](),controller[_0x96df('0x10')]);router[_0x96df('0xf')](_0x96df('0x11'),auth[_0x96df('0x6')](),controller[_0x96df('0x12')]);module[_0x96df('0x13')]=router; \ No newline at end of file +var _0x129f=['addUsers','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','/:id','getUsers','post','create','/:id/users'];(function(_0x5066a5,_0x38eaa4){var _0x290fb2=function(_0x448400){while(--_0x448400){_0x5066a5['push'](_0x5066a5['shift']());}};_0x290fb2(++_0x38eaa4);}(_0x129f,0x13f));var _0xf129=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x129f[_0x15bc81];return _0x59440e;};'use strict';var multer=require(_0xf129('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf129('0x1'));var express=require(_0xf129('0x2'));var router=express[_0xf129('0x3')]();var fs_extra=require(_0xf129('0x4'));var auth=require(_0xf129('0x5'));var interaction=require(_0xf129('0x6'));var config=require(_0xf129('0x7'));var controller=require(_0xf129('0x8'));router['get']('/',auth[_0xf129('0x9')](),controller[_0xf129('0xa')]);router[_0xf129('0xb')](_0xf129('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf129('0xb')]('/:id/users',auth[_0xf129('0x9')](),controller[_0xf129('0xd')]);router[_0xf129('0xe')]('/',auth[_0xf129('0x9')](),controller[_0xf129('0xf')]);router['post'](_0xf129('0x10'),auth[_0xf129('0x9')](),controller[_0xf129('0x11')]);router['put'](_0xf129('0xc'),auth[_0xf129('0x9')](),controller[_0xf129('0x12')]);router['delete'](_0xf129('0xc'),auth[_0xf129('0x9')](),controller[_0xf129('0x13')]);router['delete'](_0xf129('0x10'),auth[_0xf129('0x9')](),controller['removeUsers']);module[_0xf129('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index cd40612..7640788 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 _0x9218=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x1ca98c,_0x32b91e){var _0x35fc49=function(_0x41f58e){while(--_0x41f58e){_0x1ca98c['push'](_0x1ca98c['shift']());}};_0x35fc49(++_0x32b91e);}(_0x9218,0x10b));var _0x8921=function(_0xa720e9,_0xf162db){_0xa720e9=_0xa720e9-0x0;var _0x902310=_0x9218[_0xa720e9];return _0x902310;};'use strict';var Sequelize=require(_0x8921('0x0'));module[_0x8921('0x1')]={'name':{'type':Sequelize[_0x8921('0x2')],'unique':_0x8921('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8921('0x2')]},'notes':{'type':Sequelize[_0x8921('0x4')]},'preproduction':{'type':Sequelize[_0x8921('0x5')](_0x8921('0x6')),'get':function(){if(this[_0x8921('0x7')](_0x8921('0x8'))){return this['getDataValue'](_0x8921('0x8'))[_0x8921('0x9')](_0x8921('0xa'));}}},'production':{'type':Sequelize[_0x8921('0x5')](_0x8921('0x6')),'get':function(){if(this[_0x8921('0x7')](_0x8921('0xb'))){return this[_0x8921('0x7')]('production')[_0x8921('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8921('0xc')]},'publishedAt':{'type':Sequelize[_0x8921('0xc')]}}; \ No newline at end of file +var _0xfdc6=['DATE','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','production','toString','utf8'];(function(_0x5dcda1,_0x5b4550){var _0xf433b9=function(_0x44013e){while(--_0x44013e){_0x5dcda1['push'](_0x5dcda1['shift']());}};_0xf433b9(++_0x5b4550);}(_0xfdc6,0xf3));var _0x6fdc=function(_0x20629d,_0x1a6757){_0x20629d=_0x20629d-0x0;var _0x4ca950=_0xfdc6[_0x20629d];return _0x4ca950;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6fdc('0x0')],'unique':_0x6fdc('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x6fdc('0x2')]},'preproduction':{'type':Sequelize[_0x6fdc('0x3')](_0x6fdc('0x4')),'get':function(){if(this[_0x6fdc('0x5')](_0x6fdc('0x6'))){return this['getDataValue'](_0x6fdc('0x6'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x6fdc('0x4')),'get':function(){if(this[_0x6fdc('0x5')](_0x6fdc('0x7'))){return this[_0x6fdc('0x5')]('production')[_0x6fdc('0x8')](_0x6fdc('0x9'));}}},'savedAt':{'type':Sequelize[_0x6fdc('0xa')]},'publishedAt':{'type':Sequelize[_0x6fdc('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ce30f20..45a351c 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 _0x7096=['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','production','addUsers','omit','removeUsers','isArray','ids','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','end','status','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','then','publish','agi','stringify','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x4e6702,_0x324dda){var _0x300beb=function(_0x5d5b9c){while(--_0x5d5b9c){_0x4e6702['push'](_0x4e6702['shift']());}};_0x300beb(++_0x324dda);}(_0x7096,0x10c));var _0x6709=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x7096[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var Redis=require(_0x6709('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x6709('0x1'))('api');var config=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];config[_0x6709('0x4')]=_[_0x6709('0x5')](config[_0x6709('0x4')],{'host':_0x6709('0x6'),'port':0x18eb});var socket=require(_0x6709('0x7'))(new Redis(config[_0x6709('0x4')]));require(_0x6709('0x8'))[_0x6709('0x9')](socket);function respondWithStatusCode(_0x11ad23,_0x985814){_0x985814=_0x985814||0xcc;return function(_0x30147f){if(_0x30147f){return _0x11ad23['sendStatus'](_0x985814);}return _0x11ad23['status'](_0x985814)[_0x6709('0xa')]();};}function respondWithResult(_0x2d8c0b,_0xbcb47){_0xbcb47=_0xbcb47||0xc8;return function(_0x1aa476){if(_0x1aa476){return _0x2d8c0b[_0x6709('0xb')](_0xbcb47)[_0x6709('0xc')](_0x1aa476);}};}function respondWithFilteredResult(_0x5de1fa,_0x5b9f26){return function(_0x329aa9){if(_0x329aa9){var _0x262261=typeof _0x5b9f26[_0x6709('0xd')]===_0x6709('0xe')&&typeof _0x5b9f26[_0x6709('0xf')]===_0x6709('0xe');var _0x1d56a5=_0x329aa9[_0x6709('0x10')];var _0x5a8ebb=_0x262261?0x0:_0x5b9f26[_0x6709('0xd')];var _0xf59b6e=_0x262261?_0x329aa9[_0x6709('0x10')]:_0x5b9f26[_0x6709('0xd')]+_0x5b9f26['limit'];var _0xc728aa;if(_0xf59b6e>=_0x1d56a5){_0xf59b6e=_0x1d56a5;_0xc728aa=0xc8;}else{_0xc728aa=0xce;}_0x5de1fa['status'](_0xc728aa);return _0x5de1fa[_0x6709('0x11')]('Content-Range',_0x5a8ebb+'-'+_0xf59b6e+'/'+_0x1d56a5)[_0x6709('0xc')](_0x329aa9);}return null;};}function saveUpdates(_0x28866a){return function(_0x95c0c2){if(_0x95c0c2){return _0x95c0c2[_0x6709('0x12')](_0x28866a)['then'](function(_0x52e342){return _0x52e342;});}return null;};}function removeEntity(_0x5c4f94){return function(_0x3fa5b1){if(_0x3fa5b1){return _0x3fa5b1[_0x6709('0x13')]()['then'](function(){var _0x9c1fd8=_0x3fa5b1[_0x6709('0x14')]({'plain':!![]});var _0xf1a70d='SquareProjects';return db[_0x6709('0x15')][_0x6709('0x13')]({'where':{'type':_0xf1a70d,'resourceId':_0x9c1fd8['id']}})[_0x6709('0x16')](function(){return _0x3fa5b1;});})[_0x6709('0x16')](function(){var _0x5485d7=new Redis(config[_0x6709('0x4')]);_0x5485d7[_0x6709('0x17')](_0x6709('0x18'),JSON[_0x6709('0x19')]({'id':_0x3fa5b1['id'],'deleted':!![]}));})[_0x6709('0x16')](function(){_0x5c4f94[_0x6709('0xb')](0xcc)[_0x6709('0xa')]();});}};}function handleEntityNotFound(_0x17763d){return function(_0x386224){if(!_0x386224){_0x17763d[_0x6709('0x1a')](0x194);}return _0x386224;};}function handleError(_0x2f3415,_0xa36371){_0xa36371=_0xa36371||0x1f4;return function(_0x5cf48b){logger[_0x6709('0x1b')](_0x5cf48b[_0x6709('0x1c')]);if(_0x5cf48b[_0x6709('0x1d')]){delete _0x5cf48b['name'];}_0x2f3415[_0x6709('0xb')](_0xa36371)[_0x6709('0x1e')](_0x5cf48b);};}exports[_0x6709('0x1f')]=function(_0x44b465,_0x588e00){var _0x241428={},_0x3076fe={},_0x50f7d6={'count':0x0,'rows':[]};var _0x585073=_[_0x6709('0x20')](db['SquareProject'][_0x6709('0x21')],function(_0x2499a2){return{'name':_0x2499a2['fieldName'],'type':_0x2499a2[_0x6709('0x22')]['key']};});_0x3076fe[_0x6709('0x23')]=_[_0x6709('0x20')](_0x585073,'name');_0x3076fe[_0x6709('0x24')]=_['keys'](_0x44b465[_0x6709('0x24')]);_0x3076fe[_0x6709('0x25')]=_['intersection'](_0x3076fe[_0x6709('0x23')],_0x3076fe['query']);_0x241428[_0x6709('0x26')]=_[_0x6709('0x27')](_0x3076fe['model'],qs['fields'](_0x44b465[_0x6709('0x24')][_0x6709('0x28')]));_0x241428[_0x6709('0x26')]=_0x241428[_0x6709('0x26')][_0x6709('0x29')]?_0x241428[_0x6709('0x26')]:_0x3076fe[_0x6709('0x23')];if(!_0x44b465[_0x6709('0x24')][_0x6709('0x2a')]('nolimit')){_0x241428[_0x6709('0xf')]=qs[_0x6709('0xf')](_0x44b465[_0x6709('0x24')][_0x6709('0xf')]);_0x241428['offset']=qs[_0x6709('0xd')](_0x44b465[_0x6709('0x24')][_0x6709('0xd')]);}_0x241428[_0x6709('0x2b')]=qs['sort'](_0x44b465[_0x6709('0x24')][_0x6709('0x2c')]);_0x241428['where']=qs[_0x6709('0x25')](_[_0x6709('0x2d')](_0x44b465['query'],_0x3076fe[_0x6709('0x25')]),_0x585073);if(_0x44b465[_0x6709('0x24')][_0x6709('0x2e')]){_0x241428[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x241428[_0x6709('0x2f')],{'$or':_[_0x6709('0x20')](_0x585073,function(_0x4bfed4){if(_0x4bfed4[_0x6709('0x22')]!==_0x6709('0x31')){var _0x4fad54={};_0x4fad54[_0x4bfed4[_0x6709('0x1d')]]={'$like':'%'+_0x44b465[_0x6709('0x24')][_0x6709('0x2e')]+'%'};return _0x4fad54;}})});}_0x241428=_[_0x6709('0x30')]({},_0x241428,_0x44b465[_0x6709('0x32')]);var _0x1c12bb={'where':_0x241428['where']};return db[_0x6709('0x33')]['count'](_0x1c12bb)[_0x6709('0x16')](function(_0xbb7a64){_0x50f7d6[_0x6709('0x10')]=_0xbb7a64;if(_0x44b465['query'][_0x6709('0x34')]){_0x241428[_0x6709('0x35')]=[{'all':!![]}];}return db[_0x6709('0x33')][_0x6709('0x36')](_0x241428);})[_0x6709('0x16')](function(_0x1030ee){_0x50f7d6[_0x6709('0x37')]=_0x1030ee;return _0x50f7d6;})['then'](respondWithFilteredResult(_0x588e00,_0x241428))[_0x6709('0x38')](handleError(_0x588e00,null));};exports[_0x6709('0x39')]=function(_0x50fbcd,_0x31d2a6){var _0xe80008={'raw':![],'where':{'id':_0x50fbcd[_0x6709('0x3a')]['id']}},_0x15b18f={};_0x15b18f['model']=_['keys'](db[_0x6709('0x33')][_0x6709('0x21')]);_0x15b18f[_0x6709('0x24')]=_[_0x6709('0x3b')](_0x50fbcd['query']);_0x15b18f['filters']=_['intersection'](_0x15b18f[_0x6709('0x23')],_0x15b18f[_0x6709('0x24')]);_0xe80008['attributes']=_[_0x6709('0x27')](_0x15b18f[_0x6709('0x23')],qs['fields'](_0x50fbcd['query'][_0x6709('0x28')]));_0xe80008[_0x6709('0x26')]=_0xe80008[_0x6709('0x26')][_0x6709('0x29')]?_0xe80008[_0x6709('0x26')]:_0x15b18f['model'];if(_0x50fbcd[_0x6709('0x24')]['includeAll']){_0xe80008[_0x6709('0x35')]=[{'all':!![]}];}_0xe80008=_[_0x6709('0x30')]({},_0xe80008,_0x50fbcd[_0x6709('0x32')]);return db['SquareProject'][_0x6709('0x3c')](_0xe80008)['then'](handleEntityNotFound(_0x31d2a6,null))['then'](respondWithResult(_0x31d2a6,null))[_0x6709('0x38')](handleError(_0x31d2a6,null));};exports[_0x6709('0x3d')]=function(_0x14fcb6,_0x7e38b9){return db[_0x6709('0x33')][_0x6709('0x3d')](_0x14fcb6[_0x6709('0x3e')],{})[_0x6709('0x16')](function(_0x123793){var _0xe999aa=_0x14fcb6[_0x6709('0x3f')][_0x6709('0x14')]({'plain':!![]});if(!_0xe999aa)throw new Error(_0x6709('0x40'));if(_0xe999aa[_0x6709('0x41')]===_0x6709('0x3f')){var _0x4f82a0=_0x123793[_0x6709('0x14')]({'plain':!![]});var _0x4d841a='SquareProjects';return db[_0x6709('0x42')][_0x6709('0x3c')]({'where':{'name':_0x4d841a,'userProfileId':_0xe999aa[_0x6709('0x43')]},'raw':!![]})[_0x6709('0x16')](function(_0x22363b){if(_0x22363b&&_0x22363b[_0x6709('0x44')]===0x0){return db[_0x6709('0x15')][_0x6709('0x3d')]({'name':_0x4f82a0['name'],'resourceId':_0x4f82a0['id'],'type':_0x22363b[_0x6709('0x1d')],'sectionId':_0x22363b['id']},{})[_0x6709('0x16')](function(){return _0x123793;});}else{return _0x123793;}})[_0x6709('0x38')](function(_0x214fbb){logger['error'](_0x6709('0x45'),_0x214fbb);throw _0x214fbb;});}return _0x123793;})['then'](respondWithResult(_0x7e38b9,0xc9))[_0x6709('0x38')](handleError(_0x7e38b9,null));};exports[_0x6709('0x12')]=function(_0x2a563b,_0xb257b5){if(_0x2a563b[_0x6709('0x3e')]['id']){delete _0x2a563b['body']['id'];}return db[_0x6709('0x33')][_0x6709('0x3c')]({'where':{'id':_0x2a563b[_0x6709('0x3a')]['id']}})[_0x6709('0x16')](handleEntityNotFound(_0xb257b5,null))[_0x6709('0x16')](saveUpdates(_0x2a563b['body'],null))['then'](function(_0x447aa5){if(!_0x447aa5)return;var _0x4b5eca=_0x447aa5['get']({'plain':!![]});return _0x4b5eca;})[_0x6709('0x16')](function(_0x437910){var _0x1bf824=new Redis(config[_0x6709('0x4')]);_0x1bf824[_0x6709('0x17')](_0x6709('0x18'),JSON[_0x6709('0x19')](_[_0x6709('0x2d')](_0x437910,['id',_0x6709('0x1d'),_0x6709('0x46')])));return _0x437910;})[_0x6709('0x16')](respondWithResult(_0xb257b5,null))['catch'](handleError(_0xb257b5,null));};exports[_0x6709('0x13')]=function(_0x8c2616,_0x5ea29f){return db['SquareProject'][_0x6709('0x3c')]({'where':{'id':_0x8c2616[_0x6709('0x3a')]['id']}})[_0x6709('0x16')](handleEntityNotFound(_0x5ea29f,null))[_0x6709('0x16')](removeEntity(_0x5ea29f,null))['catch'](handleError(_0x5ea29f,null));};exports[_0x6709('0x47')]=function(_0x492bca,_0x1f838d){return db[_0x6709('0x33')][_0x6709('0x3c')]({'where':{'id':_0x492bca[_0x6709('0x3a')]['id']}})[_0x6709('0x16')](handleEntityNotFound(_0x1f838d,null))['then'](function(_0x49d3c6){if(_0x49d3c6){return _0x49d3c6[_0x6709('0x47')](_0x492bca[_0x6709('0x3e')]['ids'],_[_0x6709('0x48')](_0x492bca[_0x6709('0x3e')],['ids','id'])||{});}})[_0x6709('0x16')](respondWithResult(_0x1f838d,null))[_0x6709('0x38')](handleError(_0x1f838d,null));};exports[_0x6709('0x49')]=function(_0x24c451,_0x4f596e){return db['SquareProject'][_0x6709('0x3c')]({'where':{'id':_0x24c451['params']['id']}})[_0x6709('0x16')](handleEntityNotFound(_0x4f596e,null))[_0x6709('0x16')](function(_0x3c3df7){if(_0x3c3df7){return _0x3c3df7['removeUsers'](_0x24c451[_0x6709('0x24')]['ids'])['then'](function(){if(_[_0x6709('0x4a')](_0x24c451['query'][_0x6709('0x4b')])){for(var _0x5cf7c0=0x0;_0x5cf7c0<_0x24c451[_0x6709('0x24')][_0x6709('0x4b')][_0x6709('0x29')];_0x5cf7c0+=0x1){socket[_0x6709('0x4c')]('userSquareProject:remove',{'UserId':Number(_0x24c451[_0x6709('0x24')][_0x6709('0x4b')][_0x5cf7c0]),'SquareProjectId':Number(_0x24c451[_0x6709('0x3a')]['id'])});}}else{socket[_0x6709('0x4c')](_0x6709('0x4d'),{'UserId':Number(_0x24c451[_0x6709('0x24')][_0x6709('0x4b')]),'SquareProjectId':Number(_0x24c451['params']['id'])});}});}})[_0x6709('0x16')](respondWithStatusCode(_0x4f596e,null))[_0x6709('0x38')](handleError(_0x4f596e,null));};exports[_0x6709('0x4e')]=function(_0x145508,_0x3f4dae){var _0x304268={};var _0xea95f6={};var _0x250bcd;var _0x36b514;return db['SquareProject'][_0x6709('0x4f')]({'where':{'id':_0x145508[_0x6709('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3f4dae,null))[_0x6709('0x16')](function(_0x18b4fa){if(_0x18b4fa){_0x250bcd=_0x18b4fa;_0xea95f6[_0x6709('0x23')]=_[_0x6709('0x3b')](db[_0x6709('0x50')][_0x6709('0x21')]);_0xea95f6[_0x6709('0x24')]=_[_0x6709('0x3b')](_0x145508[_0x6709('0x24')]);_0xea95f6['filters']=_[_0x6709('0x27')](_0xea95f6[_0x6709('0x23')],_0xea95f6[_0x6709('0x24')]);_0x304268[_0x6709('0x26')]=_[_0x6709('0x27')](_0xea95f6[_0x6709('0x23')],qs[_0x6709('0x28')](_0x145508[_0x6709('0x24')][_0x6709('0x28')]));_0x304268[_0x6709('0x26')]=_0x304268[_0x6709('0x26')]['length']?_0x304268[_0x6709('0x26')]:_0xea95f6['model'];_0x304268['order']=qs[_0x6709('0x2c')](_0x145508[_0x6709('0x24')][_0x6709('0x2c')]);_0x304268[_0x6709('0x2f')]=qs[_0x6709('0x25')](_[_0x6709('0x2d')](_0x145508[_0x6709('0x24')],_0xea95f6['filters']));if(_0x145508['query'][_0x6709('0x2e')]){_0x304268['where']=_[_0x6709('0x30')](_0x304268['where'],{'$or':_[_0x6709('0x20')](_0x304268[_0x6709('0x26')],function(_0x59d3d1){var _0x5c4277={};_0x5c4277[_0x59d3d1]={'$like':'%'+_0x145508['query'][_0x6709('0x2e')]+'%'};return _0x5c4277;})});}_0x304268=_[_0x6709('0x30')]({},_0x304268,_0x145508[_0x6709('0x32')]);return _0x250bcd[_0x6709('0x4e')](_0x304268);}})[_0x6709('0x16')](function(_0x193d67){if(_0x193d67){_0x36b514=_0x193d67[_0x6709('0x29')];if(!_0x145508[_0x6709('0x24')][_0x6709('0x2a')](_0x6709('0x51'))){_0x304268[_0x6709('0xf')]=qs[_0x6709('0xf')](_0x145508[_0x6709('0x24')]['limit']);_0x304268[_0x6709('0xd')]=qs[_0x6709('0xd')](_0x145508[_0x6709('0x24')][_0x6709('0xd')]);}return _0x250bcd['getUsers'](_0x304268);}})['then'](function(_0x18fe97){if(_0x18fe97){return _0x18fe97?{'count':_0x36b514,'rows':_0x18fe97}:null;}})['then'](respondWithResult(_0x3f4dae,null))['catch'](handleError(_0x3f4dae,null));}; \ No newline at end of file +var _0x47c5=['findAll','rows','show','params','keys','rawAttributes','includeAll','options','find','create','body','user','get','role','userProfileId','autoAssociation','catch','stringify','production','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','order','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','SquareProjects','UserProfileResource','publish','agi','error','stack','name','send','SquareProject','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x47c5,0x165));var _0x547c=function(_0x3ce6f5,_0x29c4ae){_0x3ce6f5=_0x3ce6f5-0x0;var _0x2844a6=_0x47c5[_0x3ce6f5];return _0x2844a6;};'use strict';var _=require(_0x547c('0x0'));var Redis=require(_0x547c('0x1'));var qs=require(_0x547c('0x2'));var logger=require(_0x547c('0x3'))(_0x547c('0x4'));var config=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];config[_0x547c('0x6')]=_[_0x547c('0x7')](config['redis'],{'host':_0x547c('0x8'),'port':0x18eb});var socket=require(_0x547c('0x9'))(new Redis(config['redis']));require(_0x547c('0xa'))[_0x547c('0xb')](socket);function respondWithStatusCode(_0x381f2e,_0x10a334){_0x10a334=_0x10a334||0xcc;return function(_0x12fb7d){if(_0x12fb7d){return _0x381f2e[_0x547c('0xc')](_0x10a334);}return _0x381f2e[_0x547c('0xd')](_0x10a334)[_0x547c('0xe')]();};}function respondWithResult(_0x10dec9,_0x44a581){_0x44a581=_0x44a581||0xc8;return function(_0x72828d){if(_0x72828d){return _0x10dec9[_0x547c('0xd')](_0x44a581)[_0x547c('0xf')](_0x72828d);}};}function respondWithFilteredResult(_0x2455e9,_0x386e2c){return function(_0x8addbe){if(_0x8addbe){var _0x44ab17=typeof _0x386e2c['offset']===_0x547c('0x10')&&typeof _0x386e2c[_0x547c('0x11')]==='undefined';var _0x436c19=_0x8addbe[_0x547c('0x12')];var _0x171ae4=_0x44ab17?0x0:_0x386e2c[_0x547c('0x13')];var _0x392a35=_0x44ab17?_0x8addbe[_0x547c('0x12')]:_0x386e2c[_0x547c('0x13')]+_0x386e2c[_0x547c('0x11')];var _0x255aa6;if(_0x392a35>=_0x436c19){_0x392a35=_0x436c19;_0x255aa6=0xc8;}else{_0x255aa6=0xce;}_0x2455e9[_0x547c('0xd')](_0x255aa6);return _0x2455e9[_0x547c('0x14')](_0x547c('0x15'),_0x171ae4+'-'+_0x392a35+'/'+_0x436c19)[_0x547c('0xf')](_0x8addbe);}return null;};}function saveUpdates(_0x23644b){return function(_0x2d5331){if(_0x2d5331){return _0x2d5331[_0x547c('0x16')](_0x23644b)[_0x547c('0x17')](function(_0x19d3dd){return _0x19d3dd;});}return null;};}function removeEntity(_0x49acca){return function(_0x4a6c57){if(_0x4a6c57){return _0x4a6c57[_0x547c('0x18')]()[_0x547c('0x17')](function(){var _0xeb059e=_0x4a6c57['get']({'plain':!![]});var _0x248aca=_0x547c('0x19');return db[_0x547c('0x1a')]['destroy']({'where':{'type':_0x248aca,'resourceId':_0xeb059e['id']}})[_0x547c('0x17')](function(){return _0x4a6c57;});})[_0x547c('0x17')](function(){var _0x496c38=new Redis(config['redis']);_0x496c38[_0x547c('0x1b')](_0x547c('0x1c'),JSON['stringify']({'id':_0x4a6c57['id'],'deleted':!![]}));})[_0x547c('0x17')](function(){_0x49acca[_0x547c('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e317a){return function(_0x17fd97){if(!_0x17fd97){_0x2e317a[_0x547c('0xc')](0x194);}return _0x17fd97;};}function handleError(_0x4c718c,_0x3a55a0){_0x3a55a0=_0x3a55a0||0x1f4;return function(_0x361c5c){logger[_0x547c('0x1d')](_0x361c5c[_0x547c('0x1e')]);if(_0x361c5c[_0x547c('0x1f')]){delete _0x361c5c[_0x547c('0x1f')];}_0x4c718c[_0x547c('0xd')](_0x3a55a0)[_0x547c('0x20')](_0x361c5c);};}exports['index']=function(_0x39c5f9,_0x4c66b9){var _0x5b05f2={},_0x4855fd={},_0x478f04={'count':0x0,'rows':[]};var _0x2c725d=_['map'](db[_0x547c('0x21')]['rawAttributes'],function(_0x3ea493){return{'name':_0x3ea493['fieldName'],'type':_0x3ea493[_0x547c('0x22')][_0x547c('0x23')]};});_0x4855fd[_0x547c('0x24')]=_[_0x547c('0x25')](_0x2c725d,_0x547c('0x1f'));_0x4855fd['query']=_['keys'](_0x39c5f9[_0x547c('0x26')]);_0x4855fd['filters']=_[_0x547c('0x27')](_0x4855fd[_0x547c('0x24')],_0x4855fd[_0x547c('0x26')]);_0x5b05f2[_0x547c('0x28')]=_[_0x547c('0x27')](_0x4855fd[_0x547c('0x24')],qs[_0x547c('0x29')](_0x39c5f9['query']['fields']));_0x5b05f2[_0x547c('0x28')]=_0x5b05f2[_0x547c('0x28')][_0x547c('0x2a')]?_0x5b05f2[_0x547c('0x28')]:_0x4855fd[_0x547c('0x24')];if(!_0x39c5f9[_0x547c('0x26')][_0x547c('0x2b')](_0x547c('0x2c'))){_0x5b05f2[_0x547c('0x11')]=qs[_0x547c('0x11')](_0x39c5f9[_0x547c('0x26')][_0x547c('0x11')]);_0x5b05f2[_0x547c('0x13')]=qs[_0x547c('0x13')](_0x39c5f9['query'][_0x547c('0x13')]);}_0x5b05f2['order']=qs['sort'](_0x39c5f9['query'][_0x547c('0x2d')]);_0x5b05f2[_0x547c('0x2e')]=qs[_0x547c('0x2f')](_[_0x547c('0x30')](_0x39c5f9[_0x547c('0x26')],_0x4855fd[_0x547c('0x2f')]),_0x2c725d);if(_0x39c5f9['query']['filter']){_0x5b05f2['where']=_[_0x547c('0x31')](_0x5b05f2[_0x547c('0x2e')],{'$or':_[_0x547c('0x25')](_0x2c725d,function(_0x44687e){if(_0x44687e[_0x547c('0x22')]!==_0x547c('0x32')){var _0x57ce3b={};_0x57ce3b[_0x44687e[_0x547c('0x1f')]]={'$like':'%'+_0x39c5f9['query'][_0x547c('0x33')]+'%'};return _0x57ce3b;}})});}_0x5b05f2=_[_0x547c('0x31')]({},_0x5b05f2,_0x39c5f9['options']);var _0x380705={'where':_0x5b05f2['where']};return db['SquareProject'][_0x547c('0x12')](_0x380705)[_0x547c('0x17')](function(_0x36bffe){_0x478f04[_0x547c('0x12')]=_0x36bffe;if(_0x39c5f9['query']['includeAll']){_0x5b05f2[_0x547c('0x34')]=[{'all':!![]}];}return db[_0x547c('0x21')][_0x547c('0x35')](_0x5b05f2);})['then'](function(_0x3886ae){_0x478f04[_0x547c('0x36')]=_0x3886ae;return _0x478f04;})[_0x547c('0x17')](respondWithFilteredResult(_0x4c66b9,_0x5b05f2))['catch'](handleError(_0x4c66b9,null));};exports[_0x547c('0x37')]=function(_0x3a6a0a,_0xbb08e7){var _0x59ae8a={'raw':![],'where':{'id':_0x3a6a0a[_0x547c('0x38')]['id']}},_0x26e8d2={};_0x26e8d2['model']=_[_0x547c('0x39')](db[_0x547c('0x21')][_0x547c('0x3a')]);_0x26e8d2['query']=_[_0x547c('0x39')](_0x3a6a0a['query']);_0x26e8d2[_0x547c('0x2f')]=_['intersection'](_0x26e8d2[_0x547c('0x24')],_0x26e8d2[_0x547c('0x26')]);_0x59ae8a[_0x547c('0x28')]=_[_0x547c('0x27')](_0x26e8d2[_0x547c('0x24')],qs[_0x547c('0x29')](_0x3a6a0a['query']['fields']));_0x59ae8a[_0x547c('0x28')]=_0x59ae8a[_0x547c('0x28')][_0x547c('0x2a')]?_0x59ae8a['attributes']:_0x26e8d2[_0x547c('0x24')];if(_0x3a6a0a[_0x547c('0x26')][_0x547c('0x3b')]){_0x59ae8a[_0x547c('0x34')]=[{'all':!![]}];}_0x59ae8a=_[_0x547c('0x31')]({},_0x59ae8a,_0x3a6a0a[_0x547c('0x3c')]);return db['SquareProject'][_0x547c('0x3d')](_0x59ae8a)[_0x547c('0x17')](handleEntityNotFound(_0xbb08e7,null))[_0x547c('0x17')](respondWithResult(_0xbb08e7,null))['catch'](handleError(_0xbb08e7,null));};exports[_0x547c('0x3e')]=function(_0x478320,_0xebf295){return db[_0x547c('0x21')]['create'](_0x478320[_0x547c('0x3f')],{})['then'](function(_0x15ffa6){var _0x5025cc=_0x478320[_0x547c('0x40')][_0x547c('0x41')]({'plain':!![]});if(!_0x5025cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5025cc[_0x547c('0x42')]===_0x547c('0x40')){var _0xa005cc=_0x15ffa6[_0x547c('0x41')]({'plain':!![]});var _0x52d419=_0x547c('0x19');return db['UserProfileSection']['find']({'where':{'name':_0x52d419,'userProfileId':_0x5025cc[_0x547c('0x43')]},'raw':!![]})[_0x547c('0x17')](function(_0x3e3f52){if(_0x3e3f52&&_0x3e3f52[_0x547c('0x44')]===0x0){return db[_0x547c('0x1a')][_0x547c('0x3e')]({'name':_0xa005cc[_0x547c('0x1f')],'resourceId':_0xa005cc['id'],'type':_0x3e3f52[_0x547c('0x1f')],'sectionId':_0x3e3f52['id']},{})[_0x547c('0x17')](function(){return _0x15ffa6;});}else{return _0x15ffa6;}})[_0x547c('0x45')](function(_0x25b267){logger[_0x547c('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25b267);throw _0x25b267;});}return _0x15ffa6;})['then'](respondWithResult(_0xebf295,0xc9))[_0x547c('0x45')](handleError(_0xebf295,null));};exports[_0x547c('0x16')]=function(_0x48de6e,_0xadd57d){if(_0x48de6e[_0x547c('0x3f')]['id']){delete _0x48de6e[_0x547c('0x3f')]['id'];}return db[_0x547c('0x21')][_0x547c('0x3d')]({'where':{'id':_0x48de6e[_0x547c('0x38')]['id']}})['then'](handleEntityNotFound(_0xadd57d,null))[_0x547c('0x17')](saveUpdates(_0x48de6e['body'],null))[_0x547c('0x17')](function(_0x1c40e2){if(!_0x1c40e2)return;var _0x1bdaf0=_0x1c40e2['get']({'plain':!![]});return _0x1bdaf0;})[_0x547c('0x17')](function(_0x5abce0){var _0x4e3492=new Redis(config[_0x547c('0x6')]);_0x4e3492['publish'](_0x547c('0x1c'),JSON[_0x547c('0x46')](_[_0x547c('0x30')](_0x5abce0,['id',_0x547c('0x1f'),_0x547c('0x47')])));return _0x5abce0;})[_0x547c('0x17')](respondWithResult(_0xadd57d,null))[_0x547c('0x45')](handleError(_0xadd57d,null));};exports['destroy']=function(_0x19a76a,_0x55dee9){return db[_0x547c('0x21')][_0x547c('0x3d')]({'where':{'id':_0x19a76a[_0x547c('0x38')]['id']}})[_0x547c('0x17')](handleEntityNotFound(_0x55dee9,null))[_0x547c('0x17')](removeEntity(_0x55dee9,null))['catch'](handleError(_0x55dee9,null));};exports[_0x547c('0x48')]=function(_0x5c9ea0,_0x124222){return db[_0x547c('0x21')][_0x547c('0x3d')]({'where':{'id':_0x5c9ea0[_0x547c('0x38')]['id']}})[_0x547c('0x17')](handleEntityNotFound(_0x124222,null))['then'](function(_0x6f0099){if(_0x6f0099){return _0x6f0099[_0x547c('0x48')](_0x5c9ea0['body'][_0x547c('0x49')],_[_0x547c('0x4a')](_0x5c9ea0[_0x547c('0x3f')],[_0x547c('0x49'),'id'])||{});}})['then'](respondWithResult(_0x124222,null))['catch'](handleError(_0x124222,null));};exports['removeUsers']=function(_0x188363,_0x455467){return db['SquareProject'][_0x547c('0x3d')]({'where':{'id':_0x188363['params']['id']}})[_0x547c('0x17')](handleEntityNotFound(_0x455467,null))[_0x547c('0x17')](function(_0xb6cc2e){if(_0xb6cc2e){return _0xb6cc2e[_0x547c('0x4b')](_0x188363[_0x547c('0x26')][_0x547c('0x49')])[_0x547c('0x17')](function(){if(_['isArray'](_0x188363['query'][_0x547c('0x49')])){for(var _0x235fe8=0x0;_0x235fe8<_0x188363[_0x547c('0x26')][_0x547c('0x49')][_0x547c('0x2a')];_0x235fe8+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x188363['query']['ids'][_0x235fe8]),'SquareProjectId':Number(_0x188363['params']['id'])});}}else{socket[_0x547c('0x4c')](_0x547c('0x4d'),{'UserId':Number(_0x188363[_0x547c('0x26')]['ids']),'SquareProjectId':Number(_0x188363[_0x547c('0x38')]['id'])});}});}})[_0x547c('0x17')](respondWithStatusCode(_0x455467,null))[_0x547c('0x45')](handleError(_0x455467,null));};exports[_0x547c('0x4e')]=function(_0x4d83e5,_0x4ab718){var _0x5c395d={};var _0xa66eee={};var _0x1234b3;var _0x42ee7c;return db[_0x547c('0x21')][_0x547c('0x4f')]({'where':{'id':_0x4d83e5['params']['id']}})['then'](handleEntityNotFound(_0x4ab718,null))[_0x547c('0x17')](function(_0x1f589b){if(_0x1f589b){_0x1234b3=_0x1f589b;_0xa66eee[_0x547c('0x24')]=_[_0x547c('0x39')](db[_0x547c('0x50')]['rawAttributes']);_0xa66eee['query']=_['keys'](_0x4d83e5[_0x547c('0x26')]);_0xa66eee['filters']=_[_0x547c('0x27')](_0xa66eee[_0x547c('0x24')],_0xa66eee[_0x547c('0x26')]);_0x5c395d['attributes']=_['intersection'](_0xa66eee[_0x547c('0x24')],qs[_0x547c('0x29')](_0x4d83e5[_0x547c('0x26')][_0x547c('0x29')]));_0x5c395d[_0x547c('0x28')]=_0x5c395d[_0x547c('0x28')][_0x547c('0x2a')]?_0x5c395d['attributes']:_0xa66eee[_0x547c('0x24')];_0x5c395d[_0x547c('0x51')]=qs[_0x547c('0x2d')](_0x4d83e5[_0x547c('0x26')][_0x547c('0x2d')]);_0x5c395d[_0x547c('0x2e')]=qs[_0x547c('0x2f')](_[_0x547c('0x30')](_0x4d83e5['query'],_0xa66eee[_0x547c('0x2f')]));if(_0x4d83e5[_0x547c('0x26')][_0x547c('0x33')]){_0x5c395d[_0x547c('0x2e')]=_['merge'](_0x5c395d[_0x547c('0x2e')],{'$or':_[_0x547c('0x25')](_0x5c395d[_0x547c('0x28')],function(_0x4e2acc){var _0x52cccd={};_0x52cccd[_0x4e2acc]={'$like':'%'+_0x4d83e5['query'][_0x547c('0x33')]+'%'};return _0x52cccd;})});}_0x5c395d=_[_0x547c('0x31')]({},_0x5c395d,_0x4d83e5[_0x547c('0x3c')]);return _0x1234b3['getUsers'](_0x5c395d);}})[_0x547c('0x17')](function(_0x305dd0){if(_0x305dd0){_0x42ee7c=_0x305dd0[_0x547c('0x2a')];if(!_0x4d83e5[_0x547c('0x26')]['hasOwnProperty']('nolimit')){_0x5c395d[_0x547c('0x11')]=qs['limit'](_0x4d83e5[_0x547c('0x26')][_0x547c('0x11')]);_0x5c395d['offset']=qs[_0x547c('0x13')](_0x4d83e5['query'][_0x547c('0x13')]);}return _0x1234b3[_0x547c('0x4e')](_0x5c395d);}})['then'](function(_0x17da4b){if(_0x17da4b){return _0x17da4b?{'count':_0x42ee7c,'rows':_0x17da4b}:null;}})[_0x547c('0x17')](respondWithResult(_0x4ab718,null))[_0x547c('0x45')](handleError(_0x4ab718,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1efc7cc..f525804 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 _0x2642=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x83668,_0x3ffdc6){var _0x558d00=function(_0x565a35){while(--_0x565a35){_0x83668['push'](_0x83668['shift']());}};_0x558d00(++_0x3ffdc6);}(_0x2642,0xb5));var _0x2264=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2642[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x2264('0x0'));var SquareProject=require(_0x2264('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2264('0x2')](0x0);var events={'afterCreate':_0x2264('0x3'),'afterUpdate':_0x2264('0x4'),'afterDestroy':'remove'};function emitEvent(_0x372f15){return function(_0x79285b,_0x24d075,_0x2cee03){SquareProjectEvents[_0x2264('0x5')](_0x372f15+':'+_0x79285b['id'],_0x79285b);SquareProjectEvents[_0x2264('0x5')](_0x372f15,_0x79285b);_0x2cee03(null);};}for(var e in events){if(events[_0x2264('0x6')](e)){var event=events[e];SquareProject[_0x2264('0x7')](e,emitEvent(event));}}module[_0x2264('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xa767=['hook','events','../../mysqldb','SquareProject','setMaxListeners','save','update','emit'];(function(_0x4e859c,_0xc2b230){var _0x3b571d=function(_0x40c359){while(--_0x40c359){_0x4e859c['push'](_0x4e859c['shift']());}};_0x3b571d(++_0xc2b230);}(_0xa767,0x69));var _0x7a76=function(_0x227d3a,_0xdd23d2){_0x227d3a=_0x227d3a-0x0;var _0x44e9af=_0xa767[_0x227d3a];return _0x44e9af;};'use strict';var EventEmitter=require(_0x7a76('0x0'));var SquareProject=require(_0x7a76('0x1'))['db'][_0x7a76('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7a76('0x3')](0x0);var events={'afterCreate':_0x7a76('0x4'),'afterUpdate':_0x7a76('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48553d){return function(_0x3e7fc2,_0x56cdb8,_0xfda31){SquareProjectEvents[_0x7a76('0x6')](_0x48553d+':'+_0x3e7fc2['id'],_0x3e7fc2);SquareProjectEvents[_0x7a76('0x6')](_0x48553d,_0x3e7fc2);_0xfda31(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x7a76('0x7')](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 2a2371c..4064c41 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 _0xc85e=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','production','publishedAt'];(function(_0x23c969,_0x33af7a){var _0x41b45a=function(_0x33c37b){while(--_0x33c37b){_0x23c969['push'](_0x23c969['shift']());}};_0x41b45a(++_0x33af7a);}(_0xc85e,0x1b9));var _0xec85=function(_0x54f072,_0x39e1fd){_0x54f072=_0x54f072-0x0;var _0x42e317=_0xc85e[_0x54f072];return _0x42e317;};'use strict';var _=require(_0xec85('0x0'));var util=require(_0xec85('0x1'));var logger=require(_0xec85('0x2'))(_0xec85('0x3'));var moment=require(_0xec85('0x4'));var BPromise=require(_0xec85('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec85('0x6'));var config=require(_0xec85('0x7'));var attributes=require(_0xec85('0x8'));module[_0xec85('0x9')]=function(_0x239971,_0xc242ea){return _0x239971[_0xec85('0xa')](_0xec85('0xb'),attributes,{'tableName':_0xec85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc4ae5c,_0x3de570,_0x4ec2ae){if(_0xc4ae5c[_0xec85('0xd')](_0xec85('0xe'))){_0xc4ae5c[_0xec85('0xf')]=moment()[_0xec85('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xc4ae5c[_0xec85('0xd')](_0xec85('0x11'))){_0xc4ae5c[_0xec85('0x12')]=moment()[_0xec85('0x10')](_0xec85('0x13'));}_0x4ec2ae(null,_0xc4ae5c);}}});}; \ No newline at end of file +var _0xea54=['./squareProject.attributes','exports','define','SquareProject','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x44b794,_0x451ad2){var _0x1f3c3b=function(_0x15c6c1){while(--_0x15c6c1){_0x44b794['push'](_0x44b794['shift']());}};_0x1f3c3b(++_0x451ad2);}(_0xea54,0x1c9));var _0x4ea5=function(_0x19a409,_0x24dac3){_0x19a409=_0x19a409-0x0;var _0x28241f=_0xea54[_0x19a409];return _0x28241f;};'use strict';var _=require(_0x4ea5('0x0'));var util=require(_0x4ea5('0x1'));var logger=require(_0x4ea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4ea5('0x3'));var rp=require(_0x4ea5('0x4'));var fs=require('fs');var path=require(_0x4ea5('0x5'));var rimraf=require('rimraf');var config=require(_0x4ea5('0x6'));var attributes=require(_0x4ea5('0x7'));module[_0x4ea5('0x8')]=function(_0x5a5a8e,_0x4d1779){return _0x5a5a8e[_0x4ea5('0x9')](_0x4ea5('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2970f8,_0x2f2fb1,_0x27b427){if(_0x2970f8['changed'](_0x4ea5('0xb'))){_0x2970f8['savedAt']=moment()[_0x4ea5('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2970f8['changed'](_0x4ea5('0xd'))){_0x2970f8[_0x4ea5('0xe')]=moment()[_0x4ea5('0xc')](_0x4ea5('0xf'));}_0x27b427(null,_0x2970f8);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 2d6e797..9f31686 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 _0x5dcc=['find','then','info','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','where','limit','map','include','model','attributes','debug','stringify','error','message','ShowSquareProject'];(function(_0x261ce4,_0x163def){var _0x5d84ec=function(_0x1bb4c1){while(--_0x1bb4c1){_0x261ce4['push'](_0x261ce4['shift']());}};_0x5d84ec(++_0x163def);}(_0x5dcc,0xab));var _0xc5dc=function(_0x232e81,_0x23e7ef){_0x232e81=_0x232e81-0x0;var _0x1bd267=_0x5dcc[_0x232e81];return _0x1bd267;};'use strict';var _=require(_0xc5dc('0x0'));var Redis=require(_0xc5dc('0x1'));var db=require(_0xc5dc('0x2'))['db'];var logger=require(_0xc5dc('0x3'))('rpc');var config=require(_0xc5dc('0x4'));config['redis']=_[_0xc5dc('0x5')](config[_0xc5dc('0x6')],{'host':_0xc5dc('0x7'),'port':0x18eb});var socket=require(_0xc5dc('0x8'))(new Redis(config[_0xc5dc('0x6')]));require(_0xc5dc('0x9'))['register'](socket);exports[_0xc5dc('0xa')]=function(_0x385f76){var _0x5a8ed7=this;return new Promise(function(_0x6bc8a4,_0x1147a2){return db[_0xc5dc('0xb')][_0xc5dc('0xc')]({'raw':_0x385f76[_0xc5dc('0xd')]?_0x385f76['options']['raw']===undefined?!![]:![]:!![],'where':_0x385f76[_0xc5dc('0xd')]?_0x385f76[_0xc5dc('0xd')][_0xc5dc('0xe')]||null:null,'attributes':_0x385f76[_0xc5dc('0xd')]?_0x385f76[_0xc5dc('0xd')]['attributes']||null:null,'limit':_0x385f76['options']?_0x385f76[_0xc5dc('0xd')][_0xc5dc('0xf')]||null:null,'include':_0x385f76[_0xc5dc('0xd')]?_0x385f76[_0xc5dc('0xd')]['include']?_[_0xc5dc('0x10')](_0x385f76[_0xc5dc('0xd')][_0xc5dc('0x11')],function(_0x449691){return{'model':db[_0x449691[_0xc5dc('0x12')]],'as':_0x449691['as'],'attributes':_0x449691[_0xc5dc('0x13')],'include':_0x449691[_0xc5dc('0x11')]?_[_0xc5dc('0x10')](_0x449691[_0xc5dc('0x11')],function(_0x171267){return{'model':db[_0x171267[_0xc5dc('0x12')]],'as':_0x171267['as'],'attributes':_0x171267[_0xc5dc('0x13')],'include':_0x171267['include']?_[_0xc5dc('0x10')](_0x171267[_0xc5dc('0x11')],function(_0x1b30d3){return{'model':db[_0x1b30d3[_0xc5dc('0x12')]],'as':_0x1b30d3['as'],'attributes':_0x1b30d3[_0xc5dc('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x130264){logger['info']('GetSquareProjects',_0x385f76);logger[_0xc5dc('0x14')](_0xc5dc('0xa'),_0x385f76,JSON[_0xc5dc('0x15')](_0x130264));_0x6bc8a4(_0x130264);})['catch'](function(_0x31ace1){logger[_0xc5dc('0x16')](_0xc5dc('0xa'),_0x31ace1['message'],_0x385f76);_0x1147a2(_0x5a8ed7[_0xc5dc('0x16')](0x1f4,_0x31ace1[_0xc5dc('0x17')]));});});};exports[_0xc5dc('0x18')]=function(_0x15cfa5){var _0x32c2e6=this;return new Promise(function(_0x23b45a,_0x5aaf82){return db[_0xc5dc('0xb')][_0xc5dc('0x19')]({'raw':_0x15cfa5[_0xc5dc('0xd')]?_0x15cfa5[_0xc5dc('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x15cfa5[_0xc5dc('0xd')]?_0x15cfa5[_0xc5dc('0xd')][_0xc5dc('0xe')]||null:null,'attributes':_0x15cfa5[_0xc5dc('0xd')]?_0x15cfa5[_0xc5dc('0xd')][_0xc5dc('0x13')]||null:null,'include':_0x15cfa5['options']?_0x15cfa5['options']['include']?_[_0xc5dc('0x10')](_0x15cfa5['options'][_0xc5dc('0x11')],function(_0x1a677d){return{'model':db[_0x1a677d[_0xc5dc('0x12')]],'as':_0x1a677d['as'],'attributes':_0x1a677d['attributes'],'include':_0x1a677d[_0xc5dc('0x11')]?_[_0xc5dc('0x10')](_0x1a677d[_0xc5dc('0x11')],function(_0x4ca915){return{'model':db[_0x4ca915['model']],'as':_0x4ca915['as'],'attributes':_0x4ca915[_0xc5dc('0x13')],'include':_0x4ca915['include']?_[_0xc5dc('0x10')](_0x4ca915[_0xc5dc('0x11')],function(_0x13d09f){return{'model':db[_0x13d09f[_0xc5dc('0x12')]],'as':_0x13d09f['as'],'attributes':_0x13d09f[_0xc5dc('0x13')]};}):[]};}):[]};}):[]:[]})[_0xc5dc('0x1a')](function(_0x41de3f){logger[_0xc5dc('0x1b')](_0xc5dc('0x18'),_0x15cfa5);logger[_0xc5dc('0x14')](_0xc5dc('0x18'),_0x15cfa5,JSON[_0xc5dc('0x15')](_0x41de3f));_0x23b45a(_0x41de3f);})['catch'](function(_0x3ef5a4){logger[_0xc5dc('0x16')](_0xc5dc('0x18'),_0x3ef5a4[_0xc5dc('0x17')],_0x15cfa5);_0x5aaf82(_0x32c2e6[_0xc5dc('0x16')](0x1f4,_0x3ef5a4[_0xc5dc('0x17')]));});});}; \ No newline at end of file +var _0xf9e4=['./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','message','error','lodash','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter'];(function(_0x504e3e,_0x150524){var _0x4d74f7=function(_0x160d0a){while(--_0x160d0a){_0x504e3e['push'](_0x504e3e['shift']());}};_0x4d74f7(++_0x150524);}(_0xf9e4,0x121));var _0x4f9e=function(_0x1998e3,_0xfa4283){_0x1998e3=_0x1998e3-0x0;var _0x5d83ea=_0xf9e4[_0x1998e3];return _0x5d83ea;};'use strict';var _=require(_0x4f9e('0x0'));var Redis=require(_0x4f9e('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x4f9e('0x2'))(_0x4f9e('0x3'));var config=require(_0x4f9e('0x4'));config[_0x4f9e('0x5')]=_[_0x4f9e('0x6')](config[_0x4f9e('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f9e('0x7'))(new Redis(config[_0x4f9e('0x5')]));require(_0x4f9e('0x8'))[_0x4f9e('0x9')](socket);exports[_0x4f9e('0xa')]=function(_0xf48fe0){var _0x59c483=this;return new Promise(function(_0x129f36,_0x19270d){return db[_0x4f9e('0xb')]['findAll']({'raw':_0xf48fe0[_0x4f9e('0xc')]?_0xf48fe0[_0x4f9e('0xc')][_0x4f9e('0xd')]===undefined?!![]:![]:!![],'where':_0xf48fe0['options']?_0xf48fe0[_0x4f9e('0xc')][_0x4f9e('0xe')]||null:null,'attributes':_0xf48fe0['options']?_0xf48fe0[_0x4f9e('0xc')][_0x4f9e('0xf')]||null:null,'limit':_0xf48fe0['options']?_0xf48fe0['options'][_0x4f9e('0x10')]||null:null,'include':_0xf48fe0[_0x4f9e('0xc')]?_0xf48fe0[_0x4f9e('0xc')][_0x4f9e('0x11')]?_[_0x4f9e('0x12')](_0xf48fe0[_0x4f9e('0xc')][_0x4f9e('0x11')],function(_0x229166){return{'model':db[_0x229166[_0x4f9e('0x13')]],'as':_0x229166['as'],'attributes':_0x229166[_0x4f9e('0xf')],'include':_0x229166['include']?_[_0x4f9e('0x12')](_0x229166[_0x4f9e('0x11')],function(_0x294988){return{'model':db[_0x294988[_0x4f9e('0x13')]],'as':_0x294988['as'],'attributes':_0x294988[_0x4f9e('0xf')],'include':_0x294988[_0x4f9e('0x11')]?_[_0x4f9e('0x12')](_0x294988[_0x4f9e('0x11')],function(_0x1e2cb2){return{'model':db[_0x1e2cb2['model']],'as':_0x1e2cb2['as'],'attributes':_0x1e2cb2['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f9e('0x14')](function(_0x227132){logger[_0x4f9e('0x15')](_0x4f9e('0xa'),_0xf48fe0);logger[_0x4f9e('0x16')]('GetSquareProjects',_0xf48fe0,JSON[_0x4f9e('0x17')](_0x227132));_0x129f36(_0x227132);})[_0x4f9e('0x18')](function(_0xafec10){logger['error'](_0x4f9e('0xa'),_0xafec10[_0x4f9e('0x19')],_0xf48fe0);_0x19270d(_0x59c483['error'](0x1f4,_0xafec10['message']));});});};exports['ShowSquareProject']=function(_0x4611f0){var _0x362f64=this;return new Promise(function(_0x41ef4c,_0x3295a2){return db[_0x4f9e('0xb')]['find']({'raw':_0x4611f0['options']?_0x4611f0[_0x4f9e('0xc')][_0x4f9e('0xd')]===undefined?!![]:![]:!![],'where':_0x4611f0[_0x4f9e('0xc')]?_0x4611f0[_0x4f9e('0xc')][_0x4f9e('0xe')]||null:null,'attributes':_0x4611f0['options']?_0x4611f0['options'][_0x4f9e('0xf')]||null:null,'include':_0x4611f0[_0x4f9e('0xc')]?_0x4611f0['options']['include']?_[_0x4f9e('0x12')](_0x4611f0['options'][_0x4f9e('0x11')],function(_0x41ba8c){return{'model':db[_0x41ba8c['model']],'as':_0x41ba8c['as'],'attributes':_0x41ba8c[_0x4f9e('0xf')],'include':_0x41ba8c['include']?_[_0x4f9e('0x12')](_0x41ba8c[_0x4f9e('0x11')],function(_0x368729){return{'model':db[_0x368729[_0x4f9e('0x13')]],'as':_0x368729['as'],'attributes':_0x368729['attributes'],'include':_0x368729[_0x4f9e('0x11')]?_[_0x4f9e('0x12')](_0x368729[_0x4f9e('0x11')],function(_0x1e9e5d){return{'model':db[_0x1e9e5d[_0x4f9e('0x13')]],'as':_0x1e9e5d['as'],'attributes':_0x1e9e5d[_0x4f9e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x4f9e('0x14')](function(_0x284e0f){logger[_0x4f9e('0x15')]('ShowSquareProject',_0x4611f0);logger[_0x4f9e('0x16')]('ShowSquareProject',_0x4611f0,JSON['stringify'](_0x284e0f));_0x41ef4c(_0x284e0f);})[_0x4f9e('0x18')](function(_0xcd9702){logger[_0x4f9e('0x1a')]('ShowSquareProject',_0xcd9702[_0x4f9e('0x19')],_0x4611f0);_0x3295a2(_0x362f64[_0x4f9e('0x1a')](0x1f4,_0xcd9702[_0x4f9e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d511693..9725b8e 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 _0x6a8c=['update','emit','removeListener','register','length','squareProject:','./squareProject.events','remove'];(function(_0x437a22,_0x29f9b5){var _0x18c59d=function(_0x408dae){while(--_0x408dae){_0x437a22['push'](_0x437a22['shift']());}};_0x18c59d(++_0x29f9b5);}(_0x6a8c,0x15e));var _0xc6a8=function(_0x3212b5,_0xe27e38){_0x3212b5=_0x3212b5-0x0;var _0x1130fd=_0x6a8c[_0x3212b5];return _0x1130fd;};'use strict';var SquareProjectEvents=require(_0xc6a8('0x0'));var events=['save',_0xc6a8('0x1'),_0xc6a8('0x2')];function createListener(_0x5bffbe,_0x2d9928){return function(_0x289b8a){_0x2d9928[_0xc6a8('0x3')](_0x5bffbe,_0x289b8a);};}function removeListener(_0xacfa65,_0x52ad72){return function(){SquareProjectEvents[_0xc6a8('0x4')](_0xacfa65,_0x52ad72);};}exports[_0xc6a8('0x5')]=function(_0x472ca6){for(var _0xc338fe=0x0,_0x4d0a2c=events[_0xc6a8('0x6')];_0xc338fe<_0x4d0a2c;_0xc338fe++){var _0x4bd321=events[_0xc338fe];var _0xf3e834=createListener(_0xc6a8('0x7')+_0x4bd321,_0x472ca6);SquareProjectEvents['on'](_0x4bd321,_0xf3e834);}}; \ No newline at end of file +var _0x82fe=['length','squareProject:','save','remove','update','removeListener','register'];(function(_0x1ee090,_0x11a13c){var _0x170c74=function(_0x5a3d34){while(--_0x5a3d34){_0x1ee090['push'](_0x1ee090['shift']());}};_0x170c74(++_0x11a13c);}(_0x82fe,0xf0));var _0xe82f=function(_0x5a9397,_0x2e444c){_0x5a9397=_0x5a9397-0x0;var _0x5b89be=_0x82fe[_0x5a9397];return _0x5b89be;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xe82f('0x0'),_0xe82f('0x1'),_0xe82f('0x2')];function createListener(_0x208e06,_0x374e9d){return function(_0x24db88){_0x374e9d['emit'](_0x208e06,_0x24db88);};}function removeListener(_0x1e13c4,_0x2d9e54){return function(){SquareProjectEvents[_0xe82f('0x3')](_0x1e13c4,_0x2d9e54);};}exports[_0xe82f('0x4')]=function(_0x55a211){for(var _0xdfd99=0x0,_0x14a507=events[_0xe82f('0x5')];_0xdfd99<_0x14a507;_0xdfd99++){var _0x53d8dd=events[_0xdfd99];var _0xca6cd=createListener(_0xe82f('0x6')+_0x53d8dd,_0x55a211);SquareProjectEvents['on'](_0x53d8dd,_0xca6cd);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 00177ba..830f07b 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x58a935,_0x427946){var _0x2d6013=function(_0x835191){while(--_0x835191){_0x58a935['push'](_0x58a935['shift']());}};_0x2d6013(++_0x427946);}(_0x4975,0x86));var _0x5497=function(_0x18f4ce,_0xf9d5fd){_0x18f4ce=_0x18f4ce-0x0;var _0x2b34be=_0x4975[_0x18f4ce];return _0x2b34be;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +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(_0x21ba9f,_0x7c3f46){var _0x299d4d=function(_0xf159ef){while(--_0xf159ef){_0x21ba9f['push'](_0x21ba9f['shift']());}};_0x299d4d(++_0x7c3f46);}(_0xabce,0x103));var _0xeabc=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xabce[_0x491a7f];return _0x3d8f44;};'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 f257c37..1e7138c 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 _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x2475f6,_0x14894c){var _0x935818=function(_0x19980e){while(--_0x19980e){_0x2475f6['push'](_0x2475f6['shift']());}};_0x935818(++_0x14894c);}(_0xeec6,0x1c2));var _0x6eec=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0xeec6[_0x4eec9b];return _0x2e3849;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file +var _0xf494=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xf494,0x1c6));var _0x4f49=function(_0x2e608a,_0x58d1f9){_0x2e608a=_0x2e608a-0x0;var _0x2a611b=_0xf494[_0x2e608a];return _0x2a611b;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'uniqueid':{'type':Sequelize[_0x4f49('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4f49('0x2')]},'context':{'type':Sequelize[_0x4f49('0x2')]},'extension':{'type':Sequelize[_0x4f49('0x2')]},'priority':{'type':Sequelize[_0x4f49('0x2')]},'accountcode':{'type':Sequelize[_0x4f49('0x2')]},'dnid':{'type':Sequelize[_0x4f49('0x2')]},'projectName':{'type':Sequelize[_0x4f49('0x2')]},'saveName':{'type':Sequelize[_0x4f49('0x2')]},'filename':{'type':Sequelize[_0x4f49('0x2')]},'savePath':{'type':Sequelize[_0x4f49('0x2')]},'format':{'type':Sequelize[_0x4f49('0x3')],'get':function(){var _0x5eb186='';var _0x58e9a0=this[_0x4f49('0x4')](_0x4f49('0x5'));if(_0x58e9a0){_0x5eb186=_0x58e9a0[_0x4f49('0x6')](_0x58e9a0[_0x4f49('0x7')]('.'));}return _0x5eb186;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 105d978..1ecfcb6 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 _0xe9a9=['savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','fs-extra','lodash','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','error','stack','name','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','download','../../components/encryptor','uniqueid'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe9a9,0x127));var _0x9e9a=function(_0x16d8b2,_0x22a573){_0x16d8b2=_0x16d8b2-0x0;var _0x1fec25=_0xe9a9[_0x16d8b2];return _0x1fec25;};'use strict';var emlformat=require(_0x9e9a('0x0'));var rimraf=require(_0x9e9a('0x1'));var zipdir=require(_0x9e9a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e9a('0x3'));var moment=require(_0x9e9a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e9a('0x5'));var path=require(_0x9e9a('0x6'));var sox=require('sox');var csv=require(_0x9e9a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e9a('0x8'));var _=require(_0x9e9a('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e9a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9e9a('0xb'));var Papa=require('papaparse');var Redis=require(_0x9e9a('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9e9a('0xd'));var hardwareService=require(_0x9e9a('0xe'));var logger=require(_0x9e9a('0xf'))(_0x9e9a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9e9a('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x588cad,_0x44a3b){_0x44a3b=_0x44a3b||0xcc;return function(_0x2f2609){if(_0x2f2609){return _0x588cad['sendStatus'](_0x44a3b);}return _0x588cad[_0x9e9a('0x12')](_0x44a3b)['end']();};}function respondWithResult(_0x2a25c5,_0xf1c683){_0xf1c683=_0xf1c683||0xc8;return function(_0x5282f7){if(_0x5282f7){return _0x2a25c5[_0x9e9a('0x12')](_0xf1c683)['json'](_0x5282f7);}};}function respondWithFilteredResult(_0x1e6f12,_0x5b28e0){return function(_0x2091c1){if(_0x2091c1){var _0xf5c8bb=typeof _0x5b28e0[_0x9e9a('0x13')]===_0x9e9a('0x14')&&typeof _0x5b28e0[_0x9e9a('0x15')]===_0x9e9a('0x14');var _0xb4c524=_0x2091c1[_0x9e9a('0x16')];var _0x54af81=_0xf5c8bb?0x0:_0x5b28e0[_0x9e9a('0x13')];var _0x4cf102=_0xf5c8bb?_0x2091c1[_0x9e9a('0x16')]:_0x5b28e0[_0x9e9a('0x13')]+_0x5b28e0[_0x9e9a('0x15')];var _0x41570d;if(_0x4cf102>=_0xb4c524){_0x4cf102=_0xb4c524;_0x41570d=0xc8;}else{_0x41570d=0xce;}_0x1e6f12[_0x9e9a('0x12')](_0x41570d);return _0x1e6f12[_0x9e9a('0x17')]('Content-Range',_0x54af81+'-'+_0x4cf102+'/'+_0xb4c524)[_0x9e9a('0x18')](_0x2091c1);}return null;};}function patchUpdates(_0x21fe6b){return function(_0x2b1e6b){try{jsonpatch[_0x9e9a('0x19')](_0x2b1e6b,_0x21fe6b,!![]);}catch(_0x58c551){return BPromise[_0x9e9a('0x1a')](_0x58c551);}return _0x2b1e6b[_0x9e9a('0x1b')]();};}function saveUpdates(_0x5a3d94,_0x1413a3){return function(_0xd5f32a){if(_0xd5f32a){return _0xd5f32a['update'](_0x5a3d94)[_0x9e9a('0x1c')](function(_0x185cc4){return _0x185cc4;});}return null;};}function removeEntity(_0x4ce4fd,_0x5c6ff2){return function(_0x4d2f18){if(_0x4d2f18){return _0x4d2f18[_0x9e9a('0x1d')]()['then'](function(){_0x4ce4fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3552eb,_0x1ec4f2){return function(_0x1f93d3){if(!_0x1f93d3){_0x3552eb['sendStatus'](0x194);}return _0x1f93d3;};}function handleError(_0x1e1806,_0x13a862){_0x13a862=_0x13a862||0x1f4;return function(_0x44d91b){logger[_0x9e9a('0x1e')](_0x44d91b[_0x9e9a('0x1f')]);if(_0x44d91b[_0x9e9a('0x20')]){delete _0x44d91b[_0x9e9a('0x20')];}_0x1e1806[_0x9e9a('0x12')](_0x13a862)['send'](_0x44d91b);};}exports['index']=function(_0x875955,_0x1f78bf){var _0x201077={},_0x1020cf={},_0x295a9e={'count':0x0,'rows':[]};var _0x4dfe9=_[_0x9e9a('0x21')](db['SquareRecording'][_0x9e9a('0x22')],function(_0x2958b6){return{'name':_0x2958b6['fieldName'],'type':_0x2958b6[_0x9e9a('0x23')][_0x9e9a('0x24')]};});_0x1020cf[_0x9e9a('0x25')]=_[_0x9e9a('0x21')](_0x4dfe9,_0x9e9a('0x20'));_0x1020cf[_0x9e9a('0x26')]=_[_0x9e9a('0x27')](_0x875955[_0x9e9a('0x26')]);_0x1020cf['filters']=_[_0x9e9a('0x28')](_0x1020cf[_0x9e9a('0x25')],_0x1020cf[_0x9e9a('0x26')]);_0x201077['attributes']=_[_0x9e9a('0x28')](_0x1020cf[_0x9e9a('0x25')],qs[_0x9e9a('0x29')](_0x875955['query'][_0x9e9a('0x29')]));_0x201077[_0x9e9a('0x2a')]=_0x201077[_0x9e9a('0x2a')]['length']?_0x201077['attributes']:_0x1020cf[_0x9e9a('0x25')];if(!_0x875955[_0x9e9a('0x26')][_0x9e9a('0x2b')](_0x9e9a('0x2c'))){_0x201077['limit']=qs[_0x9e9a('0x15')](_0x875955[_0x9e9a('0x26')][_0x9e9a('0x15')]);_0x201077[_0x9e9a('0x13')]=qs[_0x9e9a('0x13')](_0x875955[_0x9e9a('0x26')][_0x9e9a('0x13')]);}_0x201077[_0x9e9a('0x2d')]=qs['sort'](_0x875955[_0x9e9a('0x26')][_0x9e9a('0x2e')]);_0x201077[_0x9e9a('0x2f')]=qs[_0x9e9a('0x30')](_[_0x9e9a('0x31')](_0x875955['query'],_0x1020cf[_0x9e9a('0x30')]),_0x4dfe9);if(_0x875955[_0x9e9a('0x26')]['filter']){_0x201077[_0x9e9a('0x2f')]=_['merge'](_0x201077[_0x9e9a('0x2f')],{'$or':_['map'](_0x4dfe9,function(_0x31d791){if(_0x31d791[_0x9e9a('0x23')]!==_0x9e9a('0x32')){var _0x2ab909={};_0x2ab909[_0x31d791[_0x9e9a('0x20')]]={'$like':'%'+_0x875955['query'][_0x9e9a('0x33')]+'%'};return _0x2ab909;}})});}_0x201077=_[_0x9e9a('0x34')]({},_0x201077,_0x875955[_0x9e9a('0x35')]);var _0x319dfa={'where':_0x201077[_0x9e9a('0x2f')]};return db[_0x9e9a('0x36')][_0x9e9a('0x16')](_0x319dfa)[_0x9e9a('0x1c')](function(_0x525344){_0x295a9e['count']=_0x525344;if(_0x875955[_0x9e9a('0x26')][_0x9e9a('0x37')]){_0x201077[_0x9e9a('0x38')]=[{'all':!![]}];}return db['SquareRecording'][_0x9e9a('0x39')](_0x201077);})[_0x9e9a('0x1c')](function(_0x1783d9){_0x295a9e[_0x9e9a('0x3a')]=_0x1783d9;return _0x295a9e;})[_0x9e9a('0x1c')](respondWithFilteredResult(_0x1f78bf,_0x201077))[_0x9e9a('0x3b')](handleError(_0x1f78bf,null));};exports[_0x9e9a('0x3c')]=function(_0x60d6a8,_0x104632){var _0x208297={'raw':!![],'where':{'id':_0x60d6a8[_0x9e9a('0x3d')]['id']}},_0x1ead0f={};_0x1ead0f['model']=_['keys'](db['SquareRecording'][_0x9e9a('0x22')]);_0x1ead0f[_0x9e9a('0x26')]=_[_0x9e9a('0x27')](_0x60d6a8[_0x9e9a('0x26')]);_0x1ead0f['filters']=_[_0x9e9a('0x28')](_0x1ead0f[_0x9e9a('0x25')],_0x1ead0f[_0x9e9a('0x26')]);_0x208297['attributes']=_['intersection'](_0x1ead0f[_0x9e9a('0x25')],qs['fields'](_0x60d6a8['query'][_0x9e9a('0x29')]));_0x208297[_0x9e9a('0x2a')]=_0x208297['attributes']['length']?_0x208297[_0x9e9a('0x2a')]:_0x1ead0f[_0x9e9a('0x25')];if(_0x60d6a8[_0x9e9a('0x26')]['includeAll']){_0x208297[_0x9e9a('0x38')]=[{'all':!![]}];}_0x208297=_['merge']({},_0x208297,_0x60d6a8['options']);return db[_0x9e9a('0x36')][_0x9e9a('0x3e')](_0x208297)['then'](handleEntityNotFound(_0x104632,null))['then'](respondWithResult(_0x104632,null))['catch'](handleError(_0x104632,null));};exports['create']=function(_0x40c1c1,_0x3b3600){return db[_0x9e9a('0x36')][_0x9e9a('0x3f')](_0x40c1c1['body'],{})[_0x9e9a('0x1c')](respondWithResult(_0x3b3600,0xc9))[_0x9e9a('0x3b')](handleError(_0x3b3600,null));};exports[_0x9e9a('0x40')]=function(_0x243475,_0x3f9b73){if(_0x243475[_0x9e9a('0x41')]['id']){delete _0x243475[_0x9e9a('0x41')]['id'];}return db[_0x9e9a('0x36')][_0x9e9a('0x3e')]({'where':{'id':_0x243475['params']['id']}})['then'](handleEntityNotFound(_0x3f9b73,null))[_0x9e9a('0x1c')](saveUpdates(_0x243475['body'],null))[_0x9e9a('0x1c')](respondWithResult(_0x3f9b73,null))['catch'](handleError(_0x3f9b73,null));};exports[_0x9e9a('0x42')]=function(_0x49633d,_0x1a6d99,_0x28ac13){var _0x169122=require(_0x9e9a('0x43'));var _0x3a0ed7=![];var _0x30c804={};if(_0x49633d['query'][_0x9e9a('0x23')]&&_0x49633d[_0x9e9a('0x26')][_0x9e9a('0x23')]===_0x9e9a('0x44')){_0x30c804[_0x9e9a('0x44')]=_0x49633d[_0x9e9a('0x3d')]['id'];}else{_0x30c804['id']=_0x49633d[_0x9e9a('0x3d')]['id'];}return db[_0x9e9a('0x36')]['find']({'where':_0x30c804,'attributes':['id',_0x9e9a('0x45'),_0x9e9a('0x46')],'raw':!![]})[_0x9e9a('0x1c')](handleEntityNotFound(_0x1a6d99,null))['then'](function(_0x37c24a){if(_0x37c24a){var _0x14163c=_0x37c24a[_0x9e9a('0x45')];var _0x18f8ff=util['format'](_0x9e9a('0x47'),_0x14163c);if(fs[_0x9e9a('0x48')](_0x18f8ff)){_0x3a0ed7=!![];return _0x169122[_0x9e9a('0x49')](_0x18f8ff,_0x14163c,config[_0x9e9a('0x4a')][_0x9e9a('0x4b')])[_0x9e9a('0x1c')](function(){return _0x37c24a;});}return _0x37c24a;}})['then'](function(_0x38d8cb){if(_0x38d8cb){var _0x48ff53=_0x38d8cb[_0x9e9a('0x45')];if(!fs[_0x9e9a('0x48')](_0x48ff53)){throw new db[(_0x9e9a('0x4c'))][(_0x9e9a('0x4d'))]('SquareRecording\x20not\x20found');}if(_0x38d8cb[_0x9e9a('0x46')]){return _0x1a6d99[_0x9e9a('0x42')](_0x48ff53,_0x38d8cb[_0x9e9a('0x46')]+path[_0x9e9a('0x4e')](_0x48ff53),function(){if(_0x3a0ed7){fs[_0x9e9a('0x4f')](_0x48ff53);}});}else{return _0x1a6d99[_0x9e9a('0x42')](_0x48ff53,function(_0x10e709){if(_0x3a0ed7){fs[_0x9e9a('0x4f')](_0x48ff53);}});}}})[_0x9e9a('0x3b')](function(_0x4b48c1){if(_0x4b48c1[_0x9e9a('0x50')]===_0x9e9a('0x51')){_0x1a6d99[_0x9e9a('0x12')](0x194)[_0x9e9a('0x52')](_0x9e9a('0x53'));}else{return handleError(_0x1a6d99,null);}});};exports[_0x9e9a('0x1d')]=function(_0x483691,_0x2b5304){return db[_0x9e9a('0x36')]['find']({'where':{'id':_0x483691['params']['id']}})[_0x9e9a('0x1c')](function(_0xd507a3){if(_[_0x9e9a('0x54')](_0xd507a3)){throw new ReferenceError(_0x9e9a('0x55'));}return _0xd507a3;})[_0x9e9a('0x1c')](function(_0x43ccb7){var _0x565b8d=_0x43ccb7['savePath'];logger[_0x9e9a('0x56')](_0x9e9a('0x57'),_0x565b8d);if(!_[_0x9e9a('0x54')](_0x43ccb7[_0x9e9a('0x45')])&&fs['existsSync'](_0x565b8d)){logger[_0x9e9a('0x56')](_0x9e9a('0x58')+_0x565b8d+_0x9e9a('0x59'));fs['unlinkSync'](_0x565b8d);}_0x565b8d=_0x565b8d+_0x9e9a('0x5a');if(!_['isNil'](_0x43ccb7[_0x9e9a('0x45')])&&fs[_0x9e9a('0x48')](_0x565b8d)){logger[_0x9e9a('0x56')](_0x9e9a('0x58')+_0x565b8d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x565b8d);}return _0x43ccb7;})['then'](function(_0x279208){if(!_0x279208)throw new InternalError();return _0x279208[_0x9e9a('0x1d')]();})[_0x9e9a('0x1c')](function(){_0x2b5304[_0x9e9a('0x12')](0xcc)['end']();})[_0x9e9a('0x3b')](handleError(_0x2b5304,null));}; \ No newline at end of file +var _0xfe13=['%s.cypher','existsSync','recording','ValidationError','filename','extname','unlink','message','SquareRecording\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','findAll','then','rows','show','params','includeAll','find','create','body','update','catch','download','uniqueid','savePath','format'];(function(_0x2d5dd7,_0x2c525a){var _0xb6ff55=function(_0x585f7d){while(--_0x585f7d){_0x2d5dd7['push'](_0x2d5dd7['shift']());}};_0xb6ff55(++_0x2c525a);}(_0xfe13,0x6e));var _0x3fe1=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xfe13[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x3fe1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fe1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fe1('0x2'));var moment=require(_0x3fe1('0x3'));var BPromise=require(_0x3fe1('0x4'));var Mustache=require(_0x3fe1('0x5'));var util=require(_0x3fe1('0x6'));var path=require('path');var sox=require(_0x3fe1('0x7'));var csv=require('to-csv');var ejs=require(_0x3fe1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fe1('0x9'));var squel=require('squel');var crypto=require(_0x3fe1('0xa'));var jsforce=require(_0x3fe1('0xb'));var deskjs=require(_0x3fe1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3fe1('0xd'));var Papa=require(_0x3fe1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3fe1('0xf'));var as=require(_0x3fe1('0x10'));var hardwareService=require(_0x3fe1('0x11'));var logger=require(_0x3fe1('0x12'))(_0x3fe1('0x13'));var utils=require(_0x3fe1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3fe1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21157e,_0x3cb6c6){_0x3cb6c6=_0x3cb6c6||0xcc;return function(_0x2dec58){if(_0x2dec58){return _0x21157e[_0x3fe1('0x16')](_0x3cb6c6);}return _0x21157e['status'](_0x3cb6c6)[_0x3fe1('0x17')]();};}function respondWithResult(_0x19c0ac,_0x1bef79){_0x1bef79=_0x1bef79||0xc8;return function(_0x660082){if(_0x660082){return _0x19c0ac['status'](_0x1bef79)[_0x3fe1('0x18')](_0x660082);}};}function respondWithFilteredResult(_0x4ea656,_0xa8b2da){return function(_0x2be001){if(_0x2be001){var _0x503513=typeof _0xa8b2da[_0x3fe1('0x19')]===_0x3fe1('0x1a')&&typeof _0xa8b2da['limit']===_0x3fe1('0x1a');var _0x4dc81b=_0x2be001[_0x3fe1('0x1b')];var _0x54dc52=_0x503513?0x0:_0xa8b2da[_0x3fe1('0x19')];var _0x3e982d=_0x503513?_0x2be001[_0x3fe1('0x1b')]:_0xa8b2da[_0x3fe1('0x19')]+_0xa8b2da[_0x3fe1('0x1c')];var _0x3c5820;if(_0x3e982d>=_0x4dc81b){_0x3e982d=_0x4dc81b;_0x3c5820=0xc8;}else{_0x3c5820=0xce;}_0x4ea656[_0x3fe1('0x1d')](_0x3c5820);return _0x4ea656[_0x3fe1('0x1e')](_0x3fe1('0x1f'),_0x54dc52+'-'+_0x3e982d+'/'+_0x4dc81b)[_0x3fe1('0x18')](_0x2be001);}return null;};}function patchUpdates(_0x1be27c){return function(_0x25a5d3){try{jsonpatch[_0x3fe1('0x20')](_0x25a5d3,_0x1be27c,!![]);}catch(_0x2a0b50){return BPromise[_0x3fe1('0x21')](_0x2a0b50);}return _0x25a5d3[_0x3fe1('0x22')]();};}function saveUpdates(_0x5f2bc7,_0x1f79ba){return function(_0x496511){if(_0x496511){return _0x496511['update'](_0x5f2bc7)['then'](function(_0x3834eb){return _0x3834eb;});}return null;};}function removeEntity(_0x1f7be4,_0x593b96){return function(_0x2dbf1c){if(_0x2dbf1c){return _0x2dbf1c[_0x3fe1('0x23')]()['then'](function(){_0x1f7be4[_0x3fe1('0x1d')](0xcc)[_0x3fe1('0x17')]();});}};}function handleEntityNotFound(_0x219397,_0x525d57){return function(_0x559355){if(!_0x559355){_0x219397[_0x3fe1('0x16')](0x194);}return _0x559355;};}function handleError(_0x1445fe,_0xb7c2a0){_0xb7c2a0=_0xb7c2a0||0x1f4;return function(_0x2eb5fc){logger[_0x3fe1('0x24')](_0x2eb5fc[_0x3fe1('0x25')]);if(_0x2eb5fc[_0x3fe1('0x26')]){delete _0x2eb5fc[_0x3fe1('0x26')];}_0x1445fe[_0x3fe1('0x1d')](_0xb7c2a0)[_0x3fe1('0x27')](_0x2eb5fc);};}exports[_0x3fe1('0x28')]=function(_0x158683,_0x177f3d){var _0xeeb8f6={},_0x3fae5a={},_0x5b1127={'count':0x0,'rows':[]};var _0x21c87e=_['map'](db[_0x3fe1('0x29')][_0x3fe1('0x2a')],function(_0x2984f4){return{'name':_0x2984f4[_0x3fe1('0x2b')],'type':_0x2984f4[_0x3fe1('0x2c')]['key']};});_0x3fae5a['model']=_['map'](_0x21c87e,'name');_0x3fae5a[_0x3fe1('0x2d')]=_[_0x3fe1('0x2e')](_0x158683['query']);_0x3fae5a[_0x3fe1('0x2f')]=_[_0x3fe1('0x30')](_0x3fae5a['model'],_0x3fae5a[_0x3fe1('0x2d')]);_0xeeb8f6[_0x3fe1('0x31')]=_[_0x3fe1('0x30')](_0x3fae5a[_0x3fe1('0x32')],qs['fields'](_0x158683['query'][_0x3fe1('0x33')]));_0xeeb8f6[_0x3fe1('0x31')]=_0xeeb8f6[_0x3fe1('0x31')][_0x3fe1('0x34')]?_0xeeb8f6['attributes']:_0x3fae5a[_0x3fe1('0x32')];if(!_0x158683['query'][_0x3fe1('0x35')](_0x3fe1('0x36'))){_0xeeb8f6[_0x3fe1('0x1c')]=qs[_0x3fe1('0x1c')](_0x158683[_0x3fe1('0x2d')][_0x3fe1('0x1c')]);_0xeeb8f6['offset']=qs['offset'](_0x158683['query'][_0x3fe1('0x19')]);}_0xeeb8f6[_0x3fe1('0x37')]=qs[_0x3fe1('0x38')](_0x158683['query'][_0x3fe1('0x38')]);_0xeeb8f6[_0x3fe1('0x39')]=qs[_0x3fe1('0x2f')](_[_0x3fe1('0x3a')](_0x158683[_0x3fe1('0x2d')],_0x3fae5a['filters']),_0x21c87e);if(_0x158683['query'][_0x3fe1('0x3b')]){_0xeeb8f6[_0x3fe1('0x39')]=_['merge'](_0xeeb8f6[_0x3fe1('0x39')],{'$or':_[_0x3fe1('0x3c')](_0x21c87e,function(_0x418352){if(_0x418352['type']!==_0x3fe1('0x3d')){var _0x500ef0={};_0x500ef0[_0x418352[_0x3fe1('0x26')]]={'$like':'%'+_0x158683['query']['filter']+'%'};return _0x500ef0;}})});}_0xeeb8f6=_[_0x3fe1('0x3e')]({},_0xeeb8f6,_0x158683[_0x3fe1('0x3f')]);var _0x26a6c1={'where':_0xeeb8f6['where']};return db[_0x3fe1('0x29')][_0x3fe1('0x1b')](_0x26a6c1)['then'](function(_0x1a9bb2){_0x5b1127[_0x3fe1('0x1b')]=_0x1a9bb2;if(_0x158683['query']['includeAll']){_0xeeb8f6[_0x3fe1('0x40')]=[{'all':!![]}];}return db[_0x3fe1('0x29')][_0x3fe1('0x41')](_0xeeb8f6);})[_0x3fe1('0x42')](function(_0x365e83){_0x5b1127[_0x3fe1('0x43')]=_0x365e83;return _0x5b1127;})['then'](respondWithFilteredResult(_0x177f3d,_0xeeb8f6))['catch'](handleError(_0x177f3d,null));};exports[_0x3fe1('0x44')]=function(_0x10437d,_0x83e5ee){var _0xd64307={'raw':!![],'where':{'id':_0x10437d[_0x3fe1('0x45')]['id']}},_0x1d010b={};_0x1d010b[_0x3fe1('0x32')]=_[_0x3fe1('0x2e')](db[_0x3fe1('0x29')][_0x3fe1('0x2a')]);_0x1d010b[_0x3fe1('0x2d')]=_[_0x3fe1('0x2e')](_0x10437d[_0x3fe1('0x2d')]);_0x1d010b['filters']=_[_0x3fe1('0x30')](_0x1d010b[_0x3fe1('0x32')],_0x1d010b['query']);_0xd64307['attributes']=_[_0x3fe1('0x30')](_0x1d010b[_0x3fe1('0x32')],qs[_0x3fe1('0x33')](_0x10437d['query']['fields']));_0xd64307[_0x3fe1('0x31')]=_0xd64307[_0x3fe1('0x31')][_0x3fe1('0x34')]?_0xd64307[_0x3fe1('0x31')]:_0x1d010b[_0x3fe1('0x32')];if(_0x10437d[_0x3fe1('0x2d')][_0x3fe1('0x46')]){_0xd64307[_0x3fe1('0x40')]=[{'all':!![]}];}_0xd64307=_[_0x3fe1('0x3e')]({},_0xd64307,_0x10437d['options']);return db[_0x3fe1('0x29')][_0x3fe1('0x47')](_0xd64307)[_0x3fe1('0x42')](handleEntityNotFound(_0x83e5ee,null))[_0x3fe1('0x42')](respondWithResult(_0x83e5ee,null))['catch'](handleError(_0x83e5ee,null));};exports[_0x3fe1('0x48')]=function(_0x291266,_0x4b9c89){return db[_0x3fe1('0x29')][_0x3fe1('0x48')](_0x291266[_0x3fe1('0x49')],{})[_0x3fe1('0x42')](respondWithResult(_0x4b9c89,0xc9))['catch'](handleError(_0x4b9c89,null));};exports[_0x3fe1('0x4a')]=function(_0x135d40,_0x477a02){if(_0x135d40[_0x3fe1('0x49')]['id']){delete _0x135d40[_0x3fe1('0x49')]['id'];}return db['SquareRecording'][_0x3fe1('0x47')]({'where':{'id':_0x135d40[_0x3fe1('0x45')]['id']}})[_0x3fe1('0x42')](handleEntityNotFound(_0x477a02,null))[_0x3fe1('0x42')](saveUpdates(_0x135d40[_0x3fe1('0x49')],null))[_0x3fe1('0x42')](respondWithResult(_0x477a02,null))[_0x3fe1('0x4b')](handleError(_0x477a02,null));};exports[_0x3fe1('0x4c')]=function(_0x44891b,_0x5ecfa9,_0xe76b17){var _0x4886b3=require('../../components/encryptor');var _0x2a7c93=![];var _0x4a76dc={};if(_0x44891b['query'][_0x3fe1('0x2c')]&&_0x44891b[_0x3fe1('0x2d')][_0x3fe1('0x2c')]===_0x3fe1('0x4d')){_0x4a76dc[_0x3fe1('0x4d')]=_0x44891b['params']['id'];}else{_0x4a76dc['id']=_0x44891b[_0x3fe1('0x45')]['id'];}return db['SquareRecording'][_0x3fe1('0x47')]({'where':_0x4a76dc,'attributes':['id','savePath','filename'],'raw':!![]})['then'](handleEntityNotFound(_0x5ecfa9,null))['then'](function(_0x47b9ae){if(_0x47b9ae){var _0x38f007=_0x47b9ae[_0x3fe1('0x4e')];var _0x174e35=util[_0x3fe1('0x4f')](_0x3fe1('0x50'),_0x38f007);if(fs[_0x3fe1('0x51')](_0x174e35)){_0x2a7c93=!![];return _0x4886b3['decryptFile'](_0x174e35,_0x38f007,config['secrets'][_0x3fe1('0x52')])[_0x3fe1('0x42')](function(){return _0x47b9ae;});}return _0x47b9ae;}})[_0x3fe1('0x42')](function(_0x3b1693){if(_0x3b1693){var _0x30909e=_0x3b1693[_0x3fe1('0x4e')];if(!fs[_0x3fe1('0x51')](_0x30909e)){throw new db['Sequelize'][(_0x3fe1('0x53'))]('SquareRecording\x20not\x20found');}if(_0x3b1693[_0x3fe1('0x54')]){return _0x5ecfa9[_0x3fe1('0x4c')](_0x30909e,_0x3b1693['filename']+path[_0x3fe1('0x55')](_0x30909e),function(){if(_0x2a7c93){fs[_0x3fe1('0x56')](_0x30909e);}});}else{return _0x5ecfa9[_0x3fe1('0x4c')](_0x30909e,function(_0x1d2838){if(_0x2a7c93){fs['unlink'](_0x30909e);}});}}})[_0x3fe1('0x4b')](function(_0x239882){if(_0x239882[_0x3fe1('0x57')]===_0x3fe1('0x58')){_0x5ecfa9['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x5ecfa9,null);}});};exports[_0x3fe1('0x23')]=function(_0x4f483c,_0x3c3f73){return db[_0x3fe1('0x29')]['find']({'where':{'id':_0x4f483c[_0x3fe1('0x45')]['id']}})['then'](function(_0x2b92e9){if(_['isNil'](_0x2b92e9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2b92e9;})[_0x3fe1('0x42')](function(_0x599804){var _0x101317=_0x599804[_0x3fe1('0x4e')];logger['info'](_0x3fe1('0x59'),_0x101317);if(!_[_0x3fe1('0x5a')](_0x599804['savePath'])&&fs[_0x3fe1('0x51')](_0x101317)){logger[_0x3fe1('0x5b')](_0x3fe1('0x5c')+_0x101317+_0x3fe1('0x5d'));fs[_0x3fe1('0x5e')](_0x101317);}_0x101317=_0x101317+'.cypher';if(!_[_0x3fe1('0x5a')](_0x599804[_0x3fe1('0x4e')])&&fs[_0x3fe1('0x51')](_0x101317)){logger[_0x3fe1('0x5b')](_0x3fe1('0x5c')+_0x101317+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3fe1('0x5e')](_0x101317);}return _0x599804;})['then'](function(_0x18d13a){if(!_0x18d13a)throw new InternalError();return _0x18d13a[_0x3fe1('0x23')]();})[_0x3fe1('0x42')](function(){_0x3c3f73['status'](0xcc)[_0x3fe1('0x17')]();})[_0x3fe1('0x4b')](handleError(_0x3c3f73,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 19db19f..65a5a7a 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 _0xcb04=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings'];(function(_0x3d4567,_0x607422){var _0x4403ed=function(_0x506c29){while(--_0x506c29){_0x3d4567['push'](_0x3d4567['shift']());}};_0x4403ed(++_0x607422);}(_0xcb04,0x9a));var _0x4cb0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcb04[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4cb0('0x0'));var util=require(_0x4cb0('0x1'));var logger=require(_0x4cb0('0x2'))(_0x4cb0('0x3'));var moment=require(_0x4cb0('0x4'));var BPromise=require(_0x4cb0('0x5'));var rp=require(_0x4cb0('0x6'));var fs=require('fs');var path=require(_0x4cb0('0x7'));var rimraf=require(_0x4cb0('0x8'));var config=require(_0x4cb0('0x9'));var attributes=require('./squareRecording.attributes');module[_0x4cb0('0xa')]=function(_0x2fb566,_0x247e05){return _0x2fb566[_0x4cb0('0xb')](_0x4cb0('0xc'),attributes,{'tableName':_0x4cb0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1fc=['exports','define','SquareRecording','square_recordings','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x22c320,_0x149e18){var _0x582fe7=function(_0x136ef6){while(--_0x136ef6){_0x22c320['push'](_0x22c320['shift']());}};_0x582fe7(++_0x149e18);}(_0xc1fc,0x93));var _0xcc1f=function(_0x2aa273,_0x3c9d39){_0x2aa273=_0x2aa273-0x0;var _0x4286ae=_0xc1fc[_0x2aa273];return _0x4286ae;};'use strict';var _=require('lodash');var util=require(_0xcc1f('0x0'));var logger=require(_0xcc1f('0x1'))('api');var moment=require(_0xcc1f('0x2'));var BPromise=require(_0xcc1f('0x3'));var rp=require(_0xcc1f('0x4'));var fs=require('fs');var path=require(_0xcc1f('0x5'));var rimraf=require(_0xcc1f('0x6'));var config=require(_0xcc1f('0x7'));var attributes=require(_0xcc1f('0x8'));module[_0xcc1f('0x9')]=function(_0x493a97,_0x5f448b){return _0x493a97[_0xcc1f('0xa')](_0xcc1f('0xb'),attributes,{'tableName':_0xcc1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 9eb45a0..e467c1c 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 _0xf50d=['error','code','message','create','body','options','raw','then','CreateSquareRecording','stringify','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x53077e,_0x1b64ad){var _0x37cbd8=function(_0x3ad9c9){while(--_0x3ad9c9){_0x53077e['push'](_0x53077e['shift']());}};_0x37cbd8(++_0x1b64ad);}(_0xf50d,0xfe));var _0xdf50=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf50d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xdf50('0x0'));var util=require('util');var moment=require(_0xdf50('0x1'));var BPromise=require(_0xdf50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf50('0x3'))['db'];var utils=require(_0xdf50('0x4'));var logger=require(_0xdf50('0x5'))(_0xdf50('0x6'));var config=require(_0xdf50('0x7'));var jayson=require(_0xdf50('0x8'));var client=jayson[_0xdf50('0x9')][_0xdf50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23d8fd,_0x1c221e,_0x2f0683){return new BPromise(function(_0xa3f44a,_0x27d831){return client[_0xdf50('0xb')](_0x23d8fd,_0x2f0683)['then'](function(_0x1ed2d1){logger[_0xdf50('0xc')](_0xdf50('0xd'),_0x1c221e,_0xdf50('0xe'));logger[_0xdf50('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1c221e,'request\x20sent',JSON['stringify'](_0x1ed2d1));if(_0x1ed2d1[_0xdf50('0x10')]){if(_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x11')]===0x1f4){logger[_0xdf50('0x10')]('SquareRecording,\x20%s,\x20%s',_0x1c221e,_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x12')]);return _0x27d831(_0x1ed2d1['error'][_0xdf50('0x12')]);}logger[_0xdf50('0x10')](_0xdf50('0xd'),_0x1c221e,_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x12')]);return _0xa3f44a(_0x1ed2d1[_0xdf50('0x10')][_0xdf50('0x12')]);}else{logger[_0xdf50('0xc')](_0xdf50('0xd'),_0x1c221e,_0xdf50('0xe'));_0xa3f44a(_0x1ed2d1['result'][_0xdf50('0x12')]);}})['catch'](function(_0x1cab72){logger['error'](_0xdf50('0xd'),_0x1c221e,_0x1cab72);_0x27d831(_0x1cab72);});});}exports['CreateSquareRecording']=function(_0x3bee93){var _0xc90c2e=this;return new Promise(function(_0x1c734d,_0x1ddd97){return db['SquareRecording'][_0xdf50('0x13')](_0x3bee93[_0xdf50('0x14')],{'raw':_0x3bee93[_0xdf50('0x15')]?_0x3bee93[_0xdf50('0x15')][_0xdf50('0x16')]===undefined?!![]:![]:!![]})[_0xdf50('0x17')](function(_0x51e938){logger[_0xdf50('0xc')](_0xdf50('0x18'),_0x3bee93);logger[_0xdf50('0xf')](_0xdf50('0x18'),_0x3bee93,JSON[_0xdf50('0x19')](_0x51e938));_0x1c734d(_0x51e938);})[_0xdf50('0x1a')](function(_0xedf711){logger[_0xdf50('0x10')]('CreateSquareRecording',_0xedf711['message'],_0x3bee93);_0x1ddd97(_0xc90c2e[_0xdf50('0x10')](0x1f4,_0xedf711[_0xdf50('0x12')]));});});}; \ No newline at end of file +var _0x7675=['SquareRecording','create','body','raw','stringify','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','SquareRecording,\x20%s,\x20%s','message','info','catch','CreateSquareRecording'];(function(_0x330591,_0x8d930c){var _0x431cf5=function(_0x52b61d){while(--_0x52b61d){_0x330591['push'](_0x330591['shift']());}};_0x431cf5(++_0x8d930c);}(_0x7675,0x131));var _0x5767=function(_0x16337d,_0xabb12a){_0x16337d=_0x16337d-0x0;var _0x3a0bfe=_0x7675[_0x16337d];return _0x3a0bfe;};'use strict';var _=require(_0x5767('0x0'));var util=require('util');var moment=require(_0x5767('0x1'));var BPromise=require(_0x5767('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5767('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5767('0x4'))(_0x5767('0x5'));var config=require(_0x5767('0x6'));var jayson=require(_0x5767('0x7'));var client=jayson[_0x5767('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55ffe0,_0x31598e,_0x1931b1){return new BPromise(function(_0x389ba0,_0x2ee1b5){return client[_0x5767('0x9')](_0x55ffe0,_0x1931b1)[_0x5767('0xa')](function(_0xe93450){logger['info']('SquareRecording,\x20%s,\x20%s',_0x31598e,_0x5767('0xb'));logger[_0x5767('0xc')](_0x5767('0xd'),_0x31598e,_0x5767('0xb'),JSON['stringify'](_0xe93450));if(_0xe93450[_0x5767('0xe')]){if(_0xe93450[_0x5767('0xe')]['code']===0x1f4){logger[_0x5767('0xe')](_0x5767('0xf'),_0x31598e,_0xe93450[_0x5767('0xe')][_0x5767('0x10')]);return _0x2ee1b5(_0xe93450['error']['message']);}logger[_0x5767('0xe')](_0x5767('0xf'),_0x31598e,_0xe93450[_0x5767('0xe')]['message']);return _0x389ba0(_0xe93450['error'][_0x5767('0x10')]);}else{logger[_0x5767('0x11')](_0x5767('0xf'),_0x31598e,_0x5767('0xb'));_0x389ba0(_0xe93450['result'][_0x5767('0x10')]);}})[_0x5767('0x12')](function(_0x5b7a13){logger[_0x5767('0xe')](_0x5767('0xf'),_0x31598e,_0x5b7a13);_0x2ee1b5(_0x5b7a13);});});}exports[_0x5767('0x13')]=function(_0x32ff68){var _0x1504b8=this;return new Promise(function(_0x3440c5,_0x12316e){return db[_0x5767('0x14')][_0x5767('0x15')](_0x32ff68[_0x5767('0x16')],{'raw':_0x32ff68['options']?_0x32ff68['options'][_0x5767('0x17')]===undefined?!![]:![]:!![]})[_0x5767('0xa')](function(_0x109aac){logger['info'](_0x5767('0x13'),_0x32ff68);logger[_0x5767('0xc')](_0x5767('0x13'),_0x32ff68,JSON[_0x5767('0x18')](_0x109aac));_0x3440c5(_0x109aac);})[_0x5767('0x12')](function(_0x1da7bd){logger['error']('CreateSquareRecording',_0x1da7bd['message'],_0x32ff68);_0x12316e(_0x1504b8[_0x5767('0xe')](0x1f4,_0x1da7bd[_0x5767('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 80a3aa9..9a61e20 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(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3ab16f,_0x35646f){var _0x385503=function(_0x4404d2){while(--_0x4404d2){_0x3ab16f['push'](_0x3ab16f['shift']());}};_0x385503(++_0x35646f);}(_0xb10b,0x12a));var _0xbb10=function(_0x11df66,_0x9eabf){_0x11df66=_0x11df66-0x0;var _0xc2dca1=_0xb10b[_0x11df66];return _0xc2dca1;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1b6b167..b3b9e9d 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 _0x7956=['sequelize','exports','STRING','DATE'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x7956,0x1cc));var _0x6795=function(_0x280821,_0x37b7cb){_0x280821=_0x280821-0x0;var _0x5be319=_0x7956[_0x280821];return _0x5be319;};'use strict';var Sequelize=require(_0x6795('0x0'));module[_0x6795('0x1')]={'network':{'type':Sequelize[_0x6795('0x2')]},'network_script':{'type':Sequelize[_0x6795('0x2')]},'request':{'type':Sequelize[_0x6795('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6795('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6795('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6795('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x6795('0x2')]},'callington':{'type':Sequelize[_0x6795('0x2')]},'callingtns':{'type':Sequelize[_0x6795('0x2')]},'dnid':{'type':Sequelize[_0x6795('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x6795('0x2')]},'priority':{'type':Sequelize[_0x6795('0x2')]},'enhanced':{'type':Sequelize[_0x6795('0x2')]},'accountcode':{'type':Sequelize[_0x6795('0x2')]},'threadid':{'type':Sequelize[_0x6795('0x2')]},'project_name':{'type':Sequelize[_0x6795('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6795('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1713=['sequelize','exports','STRING','DATE'];(function(_0x5ceb77,_0xe27ec6){var _0x221450=function(_0xb21c0c){while(--_0xb21c0c){_0x5ceb77['push'](_0x5ceb77['shift']());}};_0x221450(++_0xe27ec6);}(_0x1713,0xc0));var _0x3171=function(_0x56537f,_0x78d8c7){_0x56537f=_0x56537f-0x0;var _0x484671=_0x1713[_0x56537f];return _0x484671;};'use strict';var Sequelize=require(_0x3171('0x0'));module[_0x3171('0x1')]={'network':{'type':Sequelize[_0x3171('0x2')]},'network_script':{'type':Sequelize[_0x3171('0x2')]},'request':{'type':Sequelize[_0x3171('0x2')]},'channel':{'type':Sequelize[_0x3171('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x3171('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3171('0x2')]},'callingpres':{'type':Sequelize[_0x3171('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x3171('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x3171('0x2')]},'rdnis':{'type':Sequelize[_0x3171('0x2')]},'context':{'type':Sequelize[_0x3171('0x2')]},'extension':{'type':Sequelize[_0x3171('0x2')]},'priority':{'type':Sequelize[_0x3171('0x2')]},'enhanced':{'type':Sequelize[_0x3171('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x3171('0x2')]},'project_name':{'type':Sequelize[_0x3171('0x2')]},'joinAt':{'type':Sequelize[_0x3171('0x3')]},'leaveAt':{'type':Sequelize[_0x3171('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 a850c82..c9489cc 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 _0xe398=['set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','params','intersection','length','includeAll','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status'];(function(_0x4af6a0,_0x522121){var _0x4c2b23=function(_0x2f5955){while(--_0x2f5955){_0x4af6a0['push'](_0x4af6a0['shift']());}};_0x4c2b23(++_0x522121);}(_0xe398,0x7e));var _0x8e39=function(_0x2acd51,_0x115bf9){_0x2acd51=_0x2acd51-0x0;var _0x7a3983=_0xe398[_0x2acd51];return _0x7a3983;};'use strict';var emlformat=require(_0x8e39('0x0'));var rimraf=require(_0x8e39('0x1'));var zipdir=require(_0x8e39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e39('0x3'));var moment=require(_0x8e39('0x4'));var BPromise=require(_0x8e39('0x5'));var Mustache=require(_0x8e39('0x6'));var util=require(_0x8e39('0x7'));var path=require(_0x8e39('0x8'));var sox=require(_0x8e39('0x9'));var csv=require('to-csv');var ejs=require(_0x8e39('0xa'));var fs=require('fs');var fs_extra=require(_0x8e39('0xb'));var _=require(_0x8e39('0xc'));var squel=require(_0x8e39('0xd'));var crypto=require(_0x8e39('0xe'));var jsforce=require(_0x8e39('0xf'));var deskjs=require(_0x8e39('0x10'));var toCsv=require(_0x8e39('0x11'));var querystring=require(_0x8e39('0x12'));var Papa=require(_0x8e39('0x13'));var Redis=require(_0x8e39('0x14'));var authService=require(_0x8e39('0x15'));var qs=require(_0x8e39('0x16'));var as=require(_0x8e39('0x17'));var hardwareService=require(_0x8e39('0x18'));var logger=require(_0x8e39('0x19'))(_0x8e39('0x1a'));var utils=require(_0x8e39('0x1b'));var config=require(_0x8e39('0x1c'));var licenseUtil=require(_0x8e39('0x1d'));var db=require(_0x8e39('0x1e'))['db'];function respondWithStatusCode(_0x33c4f3,_0x2b19df){_0x2b19df=_0x2b19df||0xcc;return function(_0x39e107){if(_0x39e107){return _0x33c4f3[_0x8e39('0x1f')](_0x2b19df);}return _0x33c4f3['status'](_0x2b19df)['end']();};}function respondWithResult(_0x5cf5bc,_0x5796b5){_0x5796b5=_0x5796b5||0xc8;return function(_0x5a7a02){if(_0x5a7a02){return _0x5cf5bc['status'](_0x5796b5)[_0x8e39('0x20')](_0x5a7a02);}};}function respondWithFilteredResult(_0x56d92e,_0x147711){return function(_0x48bc7a){if(_0x48bc7a){var _0x61d295=typeof _0x147711[_0x8e39('0x21')]===_0x8e39('0x22')&&typeof _0x147711[_0x8e39('0x23')]==='undefined';var _0x101afc=_0x48bc7a[_0x8e39('0x24')];var _0x1d43b8=_0x61d295?0x0:_0x147711['offset'];var _0x14c9a6=_0x61d295?_0x48bc7a[_0x8e39('0x24')]:_0x147711['offset']+_0x147711[_0x8e39('0x23')];var _0xb2488b;if(_0x14c9a6>=_0x101afc){_0x14c9a6=_0x101afc;_0xb2488b=0xc8;}else{_0xb2488b=0xce;}_0x56d92e[_0x8e39('0x25')](_0xb2488b);return _0x56d92e[_0x8e39('0x26')](_0x8e39('0x27'),_0x1d43b8+'-'+_0x14c9a6+'/'+_0x101afc)['json'](_0x48bc7a);}return null;};}function patchUpdates(_0x4ff19f){return function(_0x1497fc){try{jsonpatch[_0x8e39('0x28')](_0x1497fc,_0x4ff19f,!![]);}catch(_0x4cca41){return BPromise[_0x8e39('0x29')](_0x4cca41);}return _0x1497fc[_0x8e39('0x2a')]();};}function saveUpdates(_0x19045a,_0x5a60c5){return function(_0x4f9a51){if(_0x4f9a51){return _0x4f9a51['update'](_0x19045a)[_0x8e39('0x2b')](function(_0x399b69){return _0x399b69;});}return null;};}function removeEntity(_0x25cf45,_0x2b078d){return function(_0x135603){if(_0x135603){return _0x135603[_0x8e39('0x2c')]()[_0x8e39('0x2b')](function(){_0x25cf45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c2123,_0x530465){return function(_0x3ddb19){if(!_0x3ddb19){_0x3c2123[_0x8e39('0x1f')](0x194);}return _0x3ddb19;};}function handleError(_0x67b8d9,_0x2d1ff1){_0x2d1ff1=_0x2d1ff1||0x1f4;return function(_0x19971a){logger[_0x8e39('0x2d')](_0x19971a[_0x8e39('0x2e')]);if(_0x19971a[_0x8e39('0x2f')]){delete _0x19971a['name'];}_0x67b8d9[_0x8e39('0x25')](_0x2d1ff1)[_0x8e39('0x30')](_0x19971a);};}exports[_0x8e39('0x31')]=function(_0x9ab884,_0x52edb4){var _0xeb6f22={},_0x3c3d37={},_0x307c02={'count':0x0,'rows':[]};var _0x25b2e4=_[_0x8e39('0x32')](db[_0x8e39('0x33')]['rawAttributes'],function(_0x5cf701){return{'name':_0x5cf701[_0x8e39('0x34')],'type':_0x5cf701[_0x8e39('0x35')][_0x8e39('0x36')]};});_0x3c3d37[_0x8e39('0x37')]=_[_0x8e39('0x32')](_0x25b2e4,_0x8e39('0x2f'));_0x3c3d37[_0x8e39('0x38')]=_[_0x8e39('0x39')](_0x9ab884['query']);_0x3c3d37[_0x8e39('0x3a')]=_['intersection'](_0x3c3d37[_0x8e39('0x37')],_0x3c3d37[_0x8e39('0x38')]);_0xeb6f22[_0x8e39('0x3b')]=_['intersection'](_0x3c3d37[_0x8e39('0x37')],qs[_0x8e39('0x3c')](_0x9ab884[_0x8e39('0x38')]['fields']));_0xeb6f22[_0x8e39('0x3b')]=_0xeb6f22[_0x8e39('0x3b')]['length']?_0xeb6f22[_0x8e39('0x3b')]:_0x3c3d37[_0x8e39('0x37')];if(!_0x9ab884[_0x8e39('0x38')][_0x8e39('0x3d')](_0x8e39('0x3e'))){_0xeb6f22['limit']=qs[_0x8e39('0x23')](_0x9ab884[_0x8e39('0x38')]['limit']);_0xeb6f22[_0x8e39('0x21')]=qs[_0x8e39('0x21')](_0x9ab884['query'][_0x8e39('0x21')]);}_0xeb6f22[_0x8e39('0x3f')]=qs[_0x8e39('0x40')](_0x9ab884[_0x8e39('0x38')][_0x8e39('0x40')]);_0xeb6f22[_0x8e39('0x41')]=qs[_0x8e39('0x3a')](_['pick'](_0x9ab884['query'],_0x3c3d37[_0x8e39('0x3a')]),_0x25b2e4);if(_0x9ab884[_0x8e39('0x38')][_0x8e39('0x42')]){_0xeb6f22['where']=_[_0x8e39('0x43')](_0xeb6f22[_0x8e39('0x41')],{'$or':_[_0x8e39('0x32')](_0x25b2e4,function(_0x5eea4a){if(_0x5eea4a[_0x8e39('0x35')]!=='VIRTUAL'){var _0x31c177={};_0x31c177[_0x5eea4a[_0x8e39('0x2f')]]={'$like':'%'+_0x9ab884['query'][_0x8e39('0x42')]+'%'};return _0x31c177;}})});}_0xeb6f22=_[_0x8e39('0x43')]({},_0xeb6f22,_0x9ab884[_0x8e39('0x44')]);var _0x35df0b={'where':_0xeb6f22[_0x8e39('0x41')]};return db['SquareReport'][_0x8e39('0x24')](_0x35df0b)[_0x8e39('0x2b')](function(_0x4e86e9){_0x307c02['count']=_0x4e86e9;if(_0x9ab884[_0x8e39('0x38')]['includeAll']){_0xeb6f22['include']=[{'all':!![]}];}return db[_0x8e39('0x33')][_0x8e39('0x45')](_0xeb6f22);})[_0x8e39('0x2b')](function(_0x313772){_0x307c02[_0x8e39('0x46')]=_0x313772;return _0x307c02;})[_0x8e39('0x2b')](respondWithFilteredResult(_0x52edb4,_0xeb6f22))[_0x8e39('0x47')](handleError(_0x52edb4,null));};exports['show']=function(_0x1094e3,_0x19031f){var _0x437dce={'raw':!![],'where':{'id':_0x1094e3[_0x8e39('0x48')]['id']}},_0xff691={};_0xff691[_0x8e39('0x37')]=_[_0x8e39('0x39')](db[_0x8e39('0x33')]['rawAttributes']);_0xff691[_0x8e39('0x38')]=_[_0x8e39('0x39')](_0x1094e3[_0x8e39('0x38')]);_0xff691[_0x8e39('0x3a')]=_[_0x8e39('0x49')](_0xff691[_0x8e39('0x37')],_0xff691[_0x8e39('0x38')]);_0x437dce[_0x8e39('0x3b')]=_[_0x8e39('0x49')](_0xff691[_0x8e39('0x37')],qs[_0x8e39('0x3c')](_0x1094e3[_0x8e39('0x38')][_0x8e39('0x3c')]));_0x437dce['attributes']=_0x437dce[_0x8e39('0x3b')][_0x8e39('0x4a')]?_0x437dce['attributes']:_0xff691['model'];if(_0x1094e3[_0x8e39('0x38')][_0x8e39('0x4b')]){_0x437dce[_0x8e39('0x4c')]=[{'all':!![]}];}_0x437dce=_[_0x8e39('0x43')]({},_0x437dce,_0x1094e3[_0x8e39('0x44')]);return db[_0x8e39('0x33')][_0x8e39('0x4d')](_0x437dce)[_0x8e39('0x2b')](handleEntityNotFound(_0x19031f,null))['then'](respondWithResult(_0x19031f,null))[_0x8e39('0x47')](handleError(_0x19031f,null));};exports[_0x8e39('0x4e')]=function(_0x4eeecd,_0x4aa1f0){return db[_0x8e39('0x33')][_0x8e39('0x4e')](_0x4eeecd[_0x8e39('0x4f')],{})['then'](respondWithResult(_0x4aa1f0,0xc9))['catch'](handleError(_0x4aa1f0,null));};exports[_0x8e39('0x50')]=function(_0x2b58b5,_0xeaf5c3){if(_0x2b58b5['body']['id']){delete _0x2b58b5[_0x8e39('0x4f')]['id'];}return db[_0x8e39('0x33')][_0x8e39('0x4d')]({'where':{'id':_0x2b58b5[_0x8e39('0x48')]['id']}})[_0x8e39('0x2b')](handleEntityNotFound(_0xeaf5c3,null))['then'](saveUpdates(_0x2b58b5['body'],null))[_0x8e39('0x2b')](respondWithResult(_0xeaf5c3,null))[_0x8e39('0x47')](handleError(_0xeaf5c3,null));};exports[_0x8e39('0x2c')]=function(_0x5b5f71,_0x278814){return db[_0x8e39('0x33')][_0x8e39('0x4d')]({'where':{'id':_0x5b5f71[_0x8e39('0x48')]['id']}})[_0x8e39('0x2b')](handleEntityNotFound(_0x278814,null))[_0x8e39('0x2b')](removeEntity(_0x278814,null))[_0x8e39('0x47')](handleError(_0x278814,null));};exports[_0x8e39('0x51')]=function(_0x3a37c0,_0x3efdd4){return db[_0x8e39('0x33')][_0x8e39('0x51')]()[_0x8e39('0x2b')](respondWithResult(_0x3efdd4,null))[_0x8e39('0x47')](handleError(_0x3efdd4,null));}; \ No newline at end of file +var _0x45e6=['Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','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','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'];(function(_0x4546eb,_0x3aafa0){var _0x2035d4=function(_0x4a92f0){while(--_0x4a92f0){_0x4546eb['push'](_0x4546eb['shift']());}};_0x2035d4(++_0x3aafa0);}(_0x45e6,0x1a5));var _0x645e=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x45e6[_0x44946b];return _0x249bc4;};'use strict';var emlformat=require(_0x645e('0x0'));var rimraf=require(_0x645e('0x1'));var zipdir=require(_0x645e('0x2'));var jsonpatch=require(_0x645e('0x3'));var rp=require(_0x645e('0x4'));var moment=require(_0x645e('0x5'));var BPromise=require(_0x645e('0x6'));var Mustache=require(_0x645e('0x7'));var util=require(_0x645e('0x8'));var path=require(_0x645e('0x9'));var sox=require(_0x645e('0xa'));var csv=require(_0x645e('0xb'));var ejs=require(_0x645e('0xc'));var fs=require('fs');var fs_extra=require(_0x645e('0xd'));var _=require(_0x645e('0xe'));var squel=require(_0x645e('0xf'));var crypto=require('crypto');var jsforce=require(_0x645e('0x10'));var deskjs=require(_0x645e('0x11'));var toCsv=require(_0x645e('0xb'));var querystring=require(_0x645e('0x12'));var Papa=require(_0x645e('0x13'));var Redis=require(_0x645e('0x14'));var authService=require(_0x645e('0x15'));var qs=require(_0x645e('0x16'));var as=require(_0x645e('0x17'));var hardwareService=require(_0x645e('0x18'));var logger=require(_0x645e('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x645e('0x1a'));var licenseUtil=require(_0x645e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56cb52,_0x22a5b8){_0x22a5b8=_0x22a5b8||0xcc;return function(_0x52c03c){if(_0x52c03c){return _0x56cb52[_0x645e('0x1c')](_0x22a5b8);}return _0x56cb52['status'](_0x22a5b8)['end']();};}function respondWithResult(_0x4faf90,_0x15a3d6){_0x15a3d6=_0x15a3d6||0xc8;return function(_0x10927e){if(_0x10927e){return _0x4faf90[_0x645e('0x1d')](_0x15a3d6)[_0x645e('0x1e')](_0x10927e);}};}function respondWithFilteredResult(_0x148c56,_0x7a6906){return function(_0x19f319){if(_0x19f319){var _0xfe883c=typeof _0x7a6906[_0x645e('0x1f')]===_0x645e('0x20')&&typeof _0x7a6906[_0x645e('0x21')]===_0x645e('0x20');var _0x71a8c1=_0x19f319[_0x645e('0x22')];var _0x39ef95=_0xfe883c?0x0:_0x7a6906[_0x645e('0x1f')];var _0x1e584a=_0xfe883c?_0x19f319[_0x645e('0x22')]:_0x7a6906['offset']+_0x7a6906['limit'];var _0xb352be;if(_0x1e584a>=_0x71a8c1){_0x1e584a=_0x71a8c1;_0xb352be=0xc8;}else{_0xb352be=0xce;}_0x148c56[_0x645e('0x1d')](_0xb352be);return _0x148c56['set'](_0x645e('0x23'),_0x39ef95+'-'+_0x1e584a+'/'+_0x71a8c1)[_0x645e('0x1e')](_0x19f319);}return null;};}function patchUpdates(_0x3ace63){return function(_0x384a08){try{jsonpatch[_0x645e('0x24')](_0x384a08,_0x3ace63,!![]);}catch(_0x4c44e6){return BPromise[_0x645e('0x25')](_0x4c44e6);}return _0x384a08[_0x645e('0x26')]();};}function saveUpdates(_0x50d48c,_0x4fa282){return function(_0x59627e){if(_0x59627e){return _0x59627e['update'](_0x50d48c)['then'](function(_0x1243b3){return _0x1243b3;});}return null;};}function removeEntity(_0x261742,_0x2cbc97){return function(_0x47fa6e){if(_0x47fa6e){return _0x47fa6e[_0x645e('0x27')]()[_0x645e('0x28')](function(){_0x261742[_0x645e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224a28,_0x2451ee){return function(_0x29daa4){if(!_0x29daa4){_0x224a28['sendStatus'](0x194);}return _0x29daa4;};}function handleError(_0x551c2f,_0x39e96d){_0x39e96d=_0x39e96d||0x1f4;return function(_0x134314){logger[_0x645e('0x29')](_0x134314[_0x645e('0x2a')]);if(_0x134314[_0x645e('0x2b')]){delete _0x134314['name'];}_0x551c2f[_0x645e('0x1d')](_0x39e96d)[_0x645e('0x2c')](_0x134314);};}exports[_0x645e('0x2d')]=function(_0x7698bd,_0x4ed822){var _0x204c4b={},_0x5cf92a={},_0x26c302={'count':0x0,'rows':[]};var _0x443b87=_[_0x645e('0x2e')](db[_0x645e('0x2f')][_0x645e('0x30')],function(_0x1d82d3){return{'name':_0x1d82d3[_0x645e('0x31')],'type':_0x1d82d3[_0x645e('0x32')]['key']};});_0x5cf92a[_0x645e('0x33')]=_[_0x645e('0x2e')](_0x443b87,_0x645e('0x2b'));_0x5cf92a['query']=_[_0x645e('0x34')](_0x7698bd[_0x645e('0x35')]);_0x5cf92a[_0x645e('0x36')]=_[_0x645e('0x37')](_0x5cf92a[_0x645e('0x33')],_0x5cf92a[_0x645e('0x35')]);_0x204c4b[_0x645e('0x38')]=_['intersection'](_0x5cf92a[_0x645e('0x33')],qs[_0x645e('0x39')](_0x7698bd[_0x645e('0x35')][_0x645e('0x39')]));_0x204c4b[_0x645e('0x38')]=_0x204c4b[_0x645e('0x38')]['length']?_0x204c4b[_0x645e('0x38')]:_0x5cf92a[_0x645e('0x33')];if(!_0x7698bd[_0x645e('0x35')]['hasOwnProperty']('nolimit')){_0x204c4b[_0x645e('0x21')]=qs[_0x645e('0x21')](_0x7698bd[_0x645e('0x35')][_0x645e('0x21')]);_0x204c4b['offset']=qs[_0x645e('0x1f')](_0x7698bd['query'][_0x645e('0x1f')]);}_0x204c4b['order']=qs['sort'](_0x7698bd['query'][_0x645e('0x3a')]);_0x204c4b[_0x645e('0x3b')]=qs[_0x645e('0x36')](_[_0x645e('0x3c')](_0x7698bd['query'],_0x5cf92a[_0x645e('0x36')]),_0x443b87);if(_0x7698bd[_0x645e('0x35')][_0x645e('0x3d')]){_0x204c4b['where']=_[_0x645e('0x3e')](_0x204c4b[_0x645e('0x3b')],{'$or':_[_0x645e('0x2e')](_0x443b87,function(_0x53c77e){if(_0x53c77e[_0x645e('0x32')]!=='VIRTUAL'){var _0x3329b9={};_0x3329b9[_0x53c77e[_0x645e('0x2b')]]={'$like':'%'+_0x7698bd[_0x645e('0x35')][_0x645e('0x3d')]+'%'};return _0x3329b9;}})});}_0x204c4b=_['merge']({},_0x204c4b,_0x7698bd[_0x645e('0x3f')]);var _0x5dab4c={'where':_0x204c4b[_0x645e('0x3b')]};return db['SquareReport'][_0x645e('0x22')](_0x5dab4c)['then'](function(_0x4938bb){_0x26c302[_0x645e('0x22')]=_0x4938bb;if(_0x7698bd[_0x645e('0x35')][_0x645e('0x40')]){_0x204c4b['include']=[{'all':!![]}];}return db[_0x645e('0x2f')][_0x645e('0x41')](_0x204c4b);})[_0x645e('0x28')](function(_0x3aa135){_0x26c302[_0x645e('0x42')]=_0x3aa135;return _0x26c302;})[_0x645e('0x28')](respondWithFilteredResult(_0x4ed822,_0x204c4b))['catch'](handleError(_0x4ed822,null));};exports[_0x645e('0x43')]=function(_0x3513ad,_0x516d58){var _0x41a301={'raw':!![],'where':{'id':_0x3513ad[_0x645e('0x44')]['id']}},_0x36f0e0={};_0x36f0e0['model']=_[_0x645e('0x34')](db[_0x645e('0x2f')][_0x645e('0x30')]);_0x36f0e0[_0x645e('0x35')]=_[_0x645e('0x34')](_0x3513ad[_0x645e('0x35')]);_0x36f0e0[_0x645e('0x36')]=_[_0x645e('0x37')](_0x36f0e0[_0x645e('0x33')],_0x36f0e0['query']);_0x41a301[_0x645e('0x38')]=_['intersection'](_0x36f0e0[_0x645e('0x33')],qs[_0x645e('0x39')](_0x3513ad[_0x645e('0x35')]['fields']));_0x41a301[_0x645e('0x38')]=_0x41a301[_0x645e('0x38')][_0x645e('0x45')]?_0x41a301[_0x645e('0x38')]:_0x36f0e0[_0x645e('0x33')];if(_0x3513ad[_0x645e('0x35')][_0x645e('0x40')]){_0x41a301[_0x645e('0x46')]=[{'all':!![]}];}_0x41a301=_[_0x645e('0x3e')]({},_0x41a301,_0x3513ad[_0x645e('0x3f')]);return db[_0x645e('0x2f')][_0x645e('0x47')](_0x41a301)['then'](handleEntityNotFound(_0x516d58,null))[_0x645e('0x28')](respondWithResult(_0x516d58,null))[_0x645e('0x48')](handleError(_0x516d58,null));};exports[_0x645e('0x49')]=function(_0xa8f07c,_0x52297a){return db[_0x645e('0x2f')][_0x645e('0x49')](_0xa8f07c['body'],{})[_0x645e('0x28')](respondWithResult(_0x52297a,0xc9))[_0x645e('0x48')](handleError(_0x52297a,null));};exports['update']=function(_0x2686fe,_0xf01bb4){if(_0x2686fe['body']['id']){delete _0x2686fe['body']['id'];}return db[_0x645e('0x2f')][_0x645e('0x47')]({'where':{'id':_0x2686fe[_0x645e('0x44')]['id']}})[_0x645e('0x28')](handleEntityNotFound(_0xf01bb4,null))[_0x645e('0x28')](saveUpdates(_0x2686fe[_0x645e('0x4a')],null))[_0x645e('0x28')](respondWithResult(_0xf01bb4,null))[_0x645e('0x48')](handleError(_0xf01bb4,null));};exports['destroy']=function(_0x32c102,_0xf98132){return db['SquareReport']['find']({'where':{'id':_0x32c102['params']['id']}})[_0x645e('0x28')](handleEntityNotFound(_0xf98132,null))[_0x645e('0x28')](removeEntity(_0xf98132,null))[_0x645e('0x48')](handleError(_0xf98132,null));};exports[_0x645e('0x4b')]=function(_0x3f2241,_0x264ec4){return db[_0x645e('0x2f')][_0x645e('0x4b')]()['then'](respondWithResult(_0x264ec4,null))['catch'](handleError(_0x264ec4,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 108f86a..58519c4 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 _0x0a9f=['report_square','uid_pname','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0x0a9f,0x103));var _0xf0a9=function(_0x179a0c,_0x2ca073){_0x179a0c=_0x179a0c-0x0;var _0x1c8b9a=_0x0a9f[_0x179a0c];return _0x1c8b9a;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var logger=require(_0xf0a9('0x2'))(_0xf0a9('0x3'));var moment=require(_0xf0a9('0x4'));var BPromise=require(_0xf0a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0a9('0x6'));var rimraf=require(_0xf0a9('0x7'));var config=require(_0xf0a9('0x8'));var attributes=require(_0xf0a9('0x9'));module[_0xf0a9('0xa')]=function(_0x5978da,_0x509cab){return _0x5978da[_0xf0a9('0xb')](_0xf0a9('0xc'),attributes,{'tableName':_0xf0a9('0xd'),'paranoid':![],'indexes':[{'name':_0xf0a9('0xe'),'fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0xf0a9('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa849=['../../config/environment','define','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3729e9,_0x30edc9){var _0x471a56=function(_0x367383){while(--_0x367383){_0x3729e9['push'](_0x3729e9['shift']());}};_0x471a56(++_0x30edc9);}(_0xa849,0x162));var _0x9a84=function(_0x507862,_0x30f75d){_0x507862=_0x507862-0x0;var _0x4f7e59=_0xa849[_0x507862];return _0x4f7e59;};'use strict';var _=require(_0x9a84('0x0'));var util=require(_0x9a84('0x1'));var logger=require('../../config/logger')(_0x9a84('0x2'));var moment=require(_0x9a84('0x3'));var BPromise=require(_0x9a84('0x4'));var rp=require(_0x9a84('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a84('0x6'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x421963,_0x4eb6e6){return _0x421963[_0x9a84('0x7')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x9a84('0x8'),'fields':[_0x9a84('0x9'),_0x9a84('0xa')]},{'name':_0x9a84('0xb'),'fields':[_0x9a84('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 6153849..9e6e5fb 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 _0x964c=['jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','options','debug','UpdateSquareReport','body','raw','attributes','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x9c7c77,_0x49751f){var _0x2fee9b=function(_0x54858d){while(--_0x54858d){_0x9c7c77['push'](_0x9c7c77['shift']());}};_0x2fee9b(++_0x49751f);}(_0x964c,0x108));var _0xc964=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x964c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc964('0x0'));var util=require(_0xc964('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc964('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc964('0x3'))['db'];var utils=require(_0xc964('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc964('0x5'));var jayson=require(_0xc964('0x6'));var client=jayson[_0xc964('0x7')][_0xc964('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x481ba7,_0x4485eb,_0x11f57d){return new BPromise(function(_0x100c22,_0x5aed50){return client[_0xc964('0x9')](_0x481ba7,_0x11f57d)[_0xc964('0xa')](function(_0x38e81b){logger['info'](_0xc964('0xb'),_0x4485eb,_0xc964('0xc'));logger['debug'](_0xc964('0xd'),_0x4485eb,'request\x20sent',JSON[_0xc964('0xe')](_0x38e81b));if(_0x38e81b[_0xc964('0xf')]){if(_0x38e81b[_0xc964('0xf')][_0xc964('0x10')]===0x1f4){logger[_0xc964('0xf')]('SquareReport,\x20%s,\x20%s',_0x4485eb,_0x38e81b[_0xc964('0xf')]['message']);return _0x5aed50(_0x38e81b['error']['message']);}logger[_0xc964('0xf')]('SquareReport,\x20%s,\x20%s',_0x4485eb,_0x38e81b[_0xc964('0xf')][_0xc964('0x11')]);return _0x100c22(_0x38e81b['error']['message']);}else{logger[_0xc964('0x12')](_0xc964('0xb'),_0x4485eb,_0xc964('0xc'));_0x100c22(_0x38e81b[_0xc964('0x13')][_0xc964('0x11')]);}})[_0xc964('0x14')](function(_0x237cae){logger[_0xc964('0xf')](_0xc964('0xb'),_0x4485eb,_0x237cae);_0x5aed50(_0x237cae);});});}exports[_0xc964('0x15')]=function(_0x5da13d){var _0x4ff157=this;return new Promise(function(_0x58fe5c,_0x21cbea){return db[_0xc964('0x16')][_0xc964('0x17')](_0x5da13d['body'],{'raw':_0x5da13d['options']?_0x5da13d[_0xc964('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc964('0xa')](function(_0x5da215){logger[_0xc964('0x12')](_0xc964('0x15'),_0x5da13d);logger[_0xc964('0x19')](_0xc964('0x15'),_0x5da13d,JSON[_0xc964('0xe')](_0x5da215));_0x58fe5c(_0x5da215);})['catch'](function(_0x2b6ac2){logger['error'](_0xc964('0x15'),_0x2b6ac2[_0xc964('0x11')],_0x5da13d);_0x21cbea(_0x4ff157['error'](0x1f4,_0x2b6ac2['message']));});});};exports[_0xc964('0x1a')]=function(_0x422a2c){var _0xa03b4d=this;return new Promise(function(_0xec8af5,_0x44bd38){return db['SquareReport']['update'](_0x422a2c[_0xc964('0x1b')],{'raw':_0x422a2c[_0xc964('0x18')]?_0x422a2c[_0xc964('0x18')][_0xc964('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422a2c[_0xc964('0x18')]?_0x422a2c['options']['where']||null:null,'attributes':_0x422a2c['options']?_0x422a2c[_0xc964('0x18')][_0xc964('0x1d')]||null:null,'limit':_0x422a2c[_0xc964('0x18')]?_0x422a2c[_0xc964('0x18')]['limit']||null:null})[_0xc964('0xa')](function(_0x48e037){logger[_0xc964('0x12')]('UpdateSquareReport',_0x422a2c);logger[_0xc964('0x19')]('UpdateSquareReport',_0x422a2c,JSON[_0xc964('0xe')](_0x48e037));_0xec8af5(_0x48e037);})['catch'](function(_0x123fc7){logger[_0xc964('0xf')]('UpdateSquareReport',_0x123fc7[_0xc964('0x11')],_0x422a2c);_0x44bd38(_0xa03b4d[_0xc964('0xf')](0x1f4,_0x123fc7[_0xc964('0x11')]));});});}; \ No newline at end of file +var _0x1d23=['SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareReport','SquareReport','create','body','options','debug','UpdateSquareReport','raw','where','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x1d23,0x149));var _0x31d2=function(_0x35ad1d,_0x139af2){_0x35ad1d=_0x35ad1d-0x0;var _0x178bde=_0x1d23[_0x35ad1d];return _0x178bde;};'use strict';var _=require('lodash');var util=require(_0x31d2('0x0'));var moment=require(_0x31d2('0x1'));var BPromise=require(_0x31d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31d2('0x3'));var db=require(_0x31d2('0x4'))['db'];var utils=require(_0x31d2('0x5'));var logger=require(_0x31d2('0x6'))(_0x31d2('0x7'));var config=require('../../config/environment');var jayson=require(_0x31d2('0x8'));var client=jayson[_0x31d2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f39e2,_0x53acf1,_0x441557){return new BPromise(function(_0x3a7bbc,_0x54013e){return client[_0x31d2('0xa')](_0x4f39e2,_0x441557)[_0x31d2('0xb')](function(_0x56717c){logger['info'](_0x31d2('0xc'),_0x53acf1,_0x31d2('0xd'));logger['debug'](_0x31d2('0xe'),_0x53acf1,_0x31d2('0xd'),JSON[_0x31d2('0xf')](_0x56717c));if(_0x56717c['error']){if(_0x56717c[_0x31d2('0x10')][_0x31d2('0x11')]===0x1f4){logger[_0x31d2('0x10')](_0x31d2('0xc'),_0x53acf1,_0x56717c[_0x31d2('0x10')][_0x31d2('0x12')]);return _0x54013e(_0x56717c[_0x31d2('0x10')][_0x31d2('0x12')]);}logger['error'](_0x31d2('0xc'),_0x53acf1,_0x56717c[_0x31d2('0x10')][_0x31d2('0x12')]);return _0x3a7bbc(_0x56717c[_0x31d2('0x10')][_0x31d2('0x12')]);}else{logger[_0x31d2('0x13')](_0x31d2('0xc'),_0x53acf1,_0x31d2('0xd'));_0x3a7bbc(_0x56717c['result'][_0x31d2('0x12')]);}})[_0x31d2('0x14')](function(_0x48f722){logger[_0x31d2('0x10')](_0x31d2('0xc'),_0x53acf1,_0x48f722);_0x54013e(_0x48f722);});});}exports[_0x31d2('0x15')]=function(_0x435c3d){var _0x5df035=this;return new Promise(function(_0x2df205,_0x542d33){return db[_0x31d2('0x16')][_0x31d2('0x17')](_0x435c3d[_0x31d2('0x18')],{'raw':_0x435c3d[_0x31d2('0x19')]?_0x435c3d[_0x31d2('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x595172){logger['info'](_0x31d2('0x15'),_0x435c3d);logger[_0x31d2('0x1a')](_0x31d2('0x15'),_0x435c3d,JSON['stringify'](_0x595172));_0x2df205(_0x595172);})[_0x31d2('0x14')](function(_0x2bd57e){logger[_0x31d2('0x10')](_0x31d2('0x15'),_0x2bd57e['message'],_0x435c3d);_0x542d33(_0x5df035['error'](0x1f4,_0x2bd57e[_0x31d2('0x12')]));});});};exports[_0x31d2('0x1b')]=function(_0x41f64b){var _0x1d9bae=this;return new Promise(function(_0xc5d321,_0x7541d8){return db['SquareReport']['update'](_0x41f64b[_0x31d2('0x18')],{'raw':_0x41f64b[_0x31d2('0x19')]?_0x41f64b['options'][_0x31d2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41f64b[_0x31d2('0x19')]?_0x41f64b['options'][_0x31d2('0x1d')]||null:null,'attributes':_0x41f64b[_0x31d2('0x19')]?_0x41f64b[_0x31d2('0x19')]['attributes']||null:null,'limit':_0x41f64b['options']?_0x41f64b[_0x31d2('0x19')][_0x31d2('0x1e')]||null:null})[_0x31d2('0xb')](function(_0x50a51e){logger[_0x31d2('0x13')](_0x31d2('0x1b'),_0x41f64b);logger[_0x31d2('0x1a')](_0x31d2('0x1b'),_0x41f64b,JSON[_0x31d2('0xf')](_0x50a51e));_0xc5d321(_0x50a51e);})[_0x31d2('0x14')](function(_0xa7cc7c){logger['error'](_0x31d2('0x1b'),_0xa7cc7c[_0x31d2('0x12')],_0x41f64b);_0x7541d8(_0x1d9bae[_0x31d2('0x10')](0x1f4,_0xa7cc7c[_0x31d2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b36e5b8..6f562b3 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 _0x8cf1=['./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','show','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a328d,_0x4a5df0){var _0x277eb5=function(_0x76d28b){while(--_0x76d28b){_0x4a328d['push'](_0x4a328d['shift']());}};_0x277eb5(++_0x4a5df0);}(_0x8cf1,0x147));var _0x18cf=function(_0x1edca6,_0x37dced){_0x1edca6=_0x1edca6-0x0;var _0x4fb753=_0x8cf1[_0x1edca6];return _0x4fb753;};'use strict';var multer=require(_0x18cf('0x0'));var util=require(_0x18cf('0x1'));var path=require(_0x18cf('0x2'));var timeout=require(_0x18cf('0x3'));var express=require(_0x18cf('0x4'));var router=express[_0x18cf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x18cf('0x6'));var interaction=require(_0x18cf('0x7'));var config=require(_0x18cf('0x8'));var controller=require(_0x18cf('0x9'));router[_0x18cf('0xa')]('/',auth['isAuthenticated'](),controller[_0x18cf('0xb')]);router['get'](_0x18cf('0xc'),auth[_0x18cf('0xd')](),controller[_0x18cf('0xe')]);router[_0x18cf('0xa')]('/:id',auth[_0x18cf('0xd')](),controller[_0x18cf('0xf')]);router['post']('/',auth[_0x18cf('0xd')](),controller['create']);router[_0x18cf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x18cf('0x11')]);router[_0x18cf('0x12')](_0x18cf('0x13'),auth[_0x18cf('0xd')](),controller['destroy']);module[_0x18cf('0x14')]=router; \ No newline at end of file +var _0xc32a=['describe','/:id','show','post','create','update','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe'];(function(_0x3fd143,_0x5c0559){var _0x42cef0=function(_0x6d6355){while(--_0x6d6355){_0x3fd143['push'](_0x3fd143['shift']());}};_0x42cef0(++_0x5c0559);}(_0xc32a,0x8d));var _0xac32=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xc32a[_0x9fd887];return _0x1a54ab;};'use strict';var multer=require(_0xac32('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xac32('0x1'));var express=require('express');var router=express[_0xac32('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xac32('0x3'));var interaction=require(_0xac32('0x4'));var config=require(_0xac32('0x5'));var controller=require(_0xac32('0x6'));router[_0xac32('0x7')]('/',auth[_0xac32('0x8')](),controller[_0xac32('0x9')]);router[_0xac32('0x7')](_0xac32('0xa'),auth['isAuthenticated'](),controller[_0xac32('0xb')]);router[_0xac32('0x7')](_0xac32('0xc'),auth[_0xac32('0x8')](),controller[_0xac32('0xd')]);router[_0xac32('0xe')]('/',auth[_0xac32('0x8')](),controller[_0xac32('0xf')]);router['put']('/:id',auth[_0xac32('0x8')](),controller[_0xac32('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xac32('0x11')]);module[_0xac32('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 8072d6f..e888245 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 _0xd293=['sequelize','STRING','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd293,0x10e));var _0x3d29=function(_0x19ed84,_0xac6b09){_0x19ed84=_0x19ed84-0x0;var _0x3006f9=_0xd293[_0x19ed84];return _0x3006f9;};'use strict';var Sequelize=require(_0x3d29('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x3d29('0x1')]},'data':{'type':Sequelize[_0x3d29('0x2')]},'project_name':{'type':Sequelize[_0x3d29('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7112=['TEXT','exports','STRING'];(function(_0x3e4667,_0x159f55){var _0x89df4e=function(_0x49fdf8){while(--_0x49fdf8){_0x3e4667['push'](_0x3e4667['shift']());}};_0x89df4e(++_0x159f55);}(_0x7112,0x1ed));var _0x2711=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7112[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x2711('0x0')]={'uniqueid':{'type':Sequelize[_0x2711('0x1')]},'node':{'type':Sequelize[_0x2711('0x1')]},'application':{'type':Sequelize[_0x2711('0x1')]},'data':{'type':Sequelize[_0x2711('0x2')]},'project_name':{'type':Sequelize[_0x2711('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9cfc5b0..49f45c0 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 _0xe7c3=['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/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','save','update','destroy','then','end','error','name','map','SquareDetailsReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','findAll','catch','show','params','include','find','create','body','describe','eml-format','fast-json-patch','request-promise'];(function(_0x18cc33,_0x13667c){var _0x24dcb=function(_0x59351b){while(--_0x59351b){_0x18cc33['push'](_0x18cc33['shift']());}};_0x24dcb(++_0x13667c);}(_0xe7c3,0x16f));var _0x3e7c=function(_0x33fcc3,_0x34fef5){_0x33fcc3=_0x33fcc3-0x0;var _0x458f97=_0xe7c3[_0x33fcc3];return _0x458f97;};'use strict';var emlformat=require(_0x3e7c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3e7c('0x1'));var rp=require(_0x3e7c('0x2'));var moment=require(_0x3e7c('0x3'));var BPromise=require(_0x3e7c('0x4'));var Mustache=require(_0x3e7c('0x5'));var util=require('util');var path=require(_0x3e7c('0x6'));var sox=require(_0x3e7c('0x7'));var csv=require(_0x3e7c('0x8'));var ejs=require(_0x3e7c('0x9'));var fs=require('fs');var fs_extra=require(_0x3e7c('0xa'));var _=require(_0x3e7c('0xb'));var squel=require(_0x3e7c('0xc'));var crypto=require(_0x3e7c('0xd'));var jsforce=require(_0x3e7c('0xe'));var deskjs=require(_0x3e7c('0xf'));var toCsv=require(_0x3e7c('0x8'));var querystring=require(_0x3e7c('0x10'));var Papa=require(_0x3e7c('0x11'));var Redis=require(_0x3e7c('0x12'));var authService=require(_0x3e7c('0x13'));var qs=require(_0x3e7c('0x14'));var as=require(_0x3e7c('0x15'));var hardwareService=require(_0x3e7c('0x16'));var logger=require(_0x3e7c('0x17'))(_0x3e7c('0x18'));var utils=require(_0x3e7c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3e7c('0x1a'));var db=require(_0x3e7c('0x1b'))['db'];function respondWithStatusCode(_0x672644,_0x12cfe7){_0x12cfe7=_0x12cfe7||0xcc;return function(_0x569617){if(_0x569617){return _0x672644[_0x3e7c('0x1c')](_0x12cfe7);}return _0x672644['status'](_0x12cfe7)['end']();};}function respondWithResult(_0x47b99c,_0x3cb3de){_0x3cb3de=_0x3cb3de||0xc8;return function(_0x2e12e6){if(_0x2e12e6){return _0x47b99c[_0x3e7c('0x1d')](_0x3cb3de)[_0x3e7c('0x1e')](_0x2e12e6);}};}function respondWithFilteredResult(_0x285f73,_0x3f39ea){return function(_0x2ffa75){if(_0x2ffa75){var _0x19bfa8=typeof _0x3f39ea['offset']===_0x3e7c('0x1f')&&typeof _0x3f39ea[_0x3e7c('0x20')]==='undefined';var _0x2b100e=_0x2ffa75['count'];var _0x510337=_0x19bfa8?0x0:_0x3f39ea[_0x3e7c('0x21')];var _0x8e0bb1=_0x19bfa8?_0x2ffa75[_0x3e7c('0x22')]:_0x3f39ea[_0x3e7c('0x21')]+_0x3f39ea[_0x3e7c('0x20')];var _0x4f2382;if(_0x8e0bb1>=_0x2b100e){_0x8e0bb1=_0x2b100e;_0x4f2382=0xc8;}else{_0x4f2382=0xce;}_0x285f73[_0x3e7c('0x1d')](_0x4f2382);return _0x285f73[_0x3e7c('0x23')](_0x3e7c('0x24'),_0x510337+'-'+_0x8e0bb1+'/'+_0x2b100e)[_0x3e7c('0x1e')](_0x2ffa75);}return null;};}function patchUpdates(_0x1e88f7){return function(_0x3b321a){try{jsonpatch['apply'](_0x3b321a,_0x1e88f7,!![]);}catch(_0x37b05f){return BPromise['reject'](_0x37b05f);}return _0x3b321a[_0x3e7c('0x25')]();};}function saveUpdates(_0x4ba36e,_0x2dc9de){return function(_0x1e4773){if(_0x1e4773){return _0x1e4773[_0x3e7c('0x26')](_0x4ba36e)['then'](function(_0x5a4e46){return _0x5a4e46;});}return null;};}function removeEntity(_0x531b34,_0x4460ea){return function(_0x3c79bc){if(_0x3c79bc){return _0x3c79bc[_0x3e7c('0x27')]()[_0x3e7c('0x28')](function(){_0x531b34[_0x3e7c('0x1d')](0xcc)[_0x3e7c('0x29')]();});}};}function handleEntityNotFound(_0x609b6b,_0x5c4f20){return function(_0x4af49d){if(!_0x4af49d){_0x609b6b[_0x3e7c('0x1c')](0x194);}return _0x4af49d;};}function handleError(_0x23687f,_0x5a146e){_0x5a146e=_0x5a146e||0x1f4;return function(_0x5e0c62){logger[_0x3e7c('0x2a')](_0x5e0c62['stack']);if(_0x5e0c62[_0x3e7c('0x2b')]){delete _0x5e0c62[_0x3e7c('0x2b')];}_0x23687f[_0x3e7c('0x1d')](_0x5a146e)['send'](_0x5e0c62);};}exports['index']=function(_0x125931,_0x18cb8f){var _0x1355b5={},_0x53def7={},_0x2e281a={'count':0x0,'rows':[]};var _0x34e386=_[_0x3e7c('0x2c')](db[_0x3e7c('0x2d')]['rawAttributes'],function(_0xd13150){return{'name':_0xd13150[_0x3e7c('0x2e')],'type':_0xd13150[_0x3e7c('0x2f')]['key']};});_0x53def7[_0x3e7c('0x30')]=_[_0x3e7c('0x2c')](_0x34e386,_0x3e7c('0x2b'));_0x53def7[_0x3e7c('0x31')]=_[_0x3e7c('0x32')](_0x125931[_0x3e7c('0x31')]);_0x53def7[_0x3e7c('0x33')]=_[_0x3e7c('0x34')](_0x53def7[_0x3e7c('0x30')],_0x53def7[_0x3e7c('0x31')]);_0x1355b5['attributes']=_[_0x3e7c('0x34')](_0x53def7['model'],qs['fields'](_0x125931['query'][_0x3e7c('0x35')]));_0x1355b5[_0x3e7c('0x36')]=_0x1355b5[_0x3e7c('0x36')][_0x3e7c('0x37')]?_0x1355b5['attributes']:_0x53def7[_0x3e7c('0x30')];if(!_0x125931['query'][_0x3e7c('0x38')](_0x3e7c('0x39'))){_0x1355b5['limit']=qs['limit'](_0x125931[_0x3e7c('0x31')][_0x3e7c('0x20')]);_0x1355b5[_0x3e7c('0x21')]=qs[_0x3e7c('0x21')](_0x125931[_0x3e7c('0x31')][_0x3e7c('0x21')]);}_0x1355b5[_0x3e7c('0x3a')]=qs[_0x3e7c('0x3b')](_0x125931[_0x3e7c('0x31')]['sort']);_0x1355b5[_0x3e7c('0x3c')]=qs[_0x3e7c('0x33')](_[_0x3e7c('0x3d')](_0x125931[_0x3e7c('0x31')],_0x53def7[_0x3e7c('0x33')]),_0x34e386);if(_0x125931[_0x3e7c('0x31')]['filter']){_0x1355b5[_0x3e7c('0x3c')]=_[_0x3e7c('0x3e')](_0x1355b5[_0x3e7c('0x3c')],{'$or':_[_0x3e7c('0x2c')](_0x34e386,function(_0x98b775){if(_0x98b775[_0x3e7c('0x2f')]!==_0x3e7c('0x3f')){var _0x46e55d={};_0x46e55d[_0x98b775[_0x3e7c('0x2b')]]={'$like':'%'+_0x125931[_0x3e7c('0x31')]['filter']+'%'};return _0x46e55d;}})});}_0x1355b5=_[_0x3e7c('0x3e')]({},_0x1355b5,_0x125931[_0x3e7c('0x40')]);var _0xc70d5={'where':_0x1355b5['where']};return db['SquareDetailsReport'][_0x3e7c('0x22')](_0xc70d5)[_0x3e7c('0x28')](function(_0x9ed82){_0x2e281a[_0x3e7c('0x22')]=_0x9ed82;if(_0x125931[_0x3e7c('0x31')]['includeAll']){_0x1355b5['include']=[{'all':!![]}];}return db[_0x3e7c('0x2d')][_0x3e7c('0x41')](_0x1355b5);})[_0x3e7c('0x28')](function(_0x4088f8){_0x2e281a['rows']=_0x4088f8;return _0x2e281a;})['then'](respondWithFilteredResult(_0x18cb8f,_0x1355b5))[_0x3e7c('0x42')](handleError(_0x18cb8f,null));};exports[_0x3e7c('0x43')]=function(_0x2be22f,_0x12d637){var _0x29da9b={'raw':!![],'where':{'id':_0x2be22f[_0x3e7c('0x44')]['id']}},_0x5d5d7c={};_0x5d5d7c[_0x3e7c('0x30')]=_[_0x3e7c('0x32')](db[_0x3e7c('0x2d')]['rawAttributes']);_0x5d5d7c[_0x3e7c('0x31')]=_[_0x3e7c('0x32')](_0x2be22f[_0x3e7c('0x31')]);_0x5d5d7c[_0x3e7c('0x33')]=_[_0x3e7c('0x34')](_0x5d5d7c[_0x3e7c('0x30')],_0x5d5d7c['query']);_0x29da9b[_0x3e7c('0x36')]=_[_0x3e7c('0x34')](_0x5d5d7c[_0x3e7c('0x30')],qs[_0x3e7c('0x35')](_0x2be22f[_0x3e7c('0x31')]['fields']));_0x29da9b['attributes']=_0x29da9b[_0x3e7c('0x36')][_0x3e7c('0x37')]?_0x29da9b[_0x3e7c('0x36')]:_0x5d5d7c[_0x3e7c('0x30')];if(_0x2be22f[_0x3e7c('0x31')]['includeAll']){_0x29da9b[_0x3e7c('0x45')]=[{'all':!![]}];}_0x29da9b=_[_0x3e7c('0x3e')]({},_0x29da9b,_0x2be22f[_0x3e7c('0x40')]);return db[_0x3e7c('0x2d')][_0x3e7c('0x46')](_0x29da9b)[_0x3e7c('0x28')](handleEntityNotFound(_0x12d637,null))[_0x3e7c('0x28')](respondWithResult(_0x12d637,null))[_0x3e7c('0x42')](handleError(_0x12d637,null));};exports[_0x3e7c('0x47')]=function(_0x32e54e,_0x1aacb1){return db[_0x3e7c('0x2d')]['create'](_0x32e54e['body'],{})[_0x3e7c('0x28')](respondWithResult(_0x1aacb1,0xc9))[_0x3e7c('0x42')](handleError(_0x1aacb1,null));};exports[_0x3e7c('0x26')]=function(_0x3926ba,_0x580994){if(_0x3926ba[_0x3e7c('0x48')]['id']){delete _0x3926ba['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x3926ba[_0x3e7c('0x44')]['id']}})[_0x3e7c('0x28')](handleEntityNotFound(_0x580994,null))[_0x3e7c('0x28')](saveUpdates(_0x3926ba[_0x3e7c('0x48')],null))[_0x3e7c('0x28')](respondWithResult(_0x580994,null))[_0x3e7c('0x42')](handleError(_0x580994,null));};exports[_0x3e7c('0x27')]=function(_0x386a6e,_0x117241){return db[_0x3e7c('0x2d')]['find']({'where':{'id':_0x386a6e[_0x3e7c('0x44')]['id']}})[_0x3e7c('0x28')](handleEntityNotFound(_0x117241,null))[_0x3e7c('0x28')](removeEntity(_0x117241,null))[_0x3e7c('0x42')](handleError(_0x117241,null));};exports[_0x3e7c('0x49')]=function(_0x11c1d4,_0x3a2ac9){return db['SquareDetailsReport'][_0x3e7c('0x49')]()['then'](respondWithResult(_0x3a2ac9,null))['catch'](handleError(_0x3a2ac9,null));}; \ No newline at end of file +var _0x6b22=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','set','Content-Range','json','reject','then','destroy','sendStatus','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf'];(function(_0x5920e7,_0x20b42c){var _0x588502=function(_0x2ef0e6){while(--_0x2ef0e6){_0x5920e7['push'](_0x5920e7['shift']());}};_0x588502(++_0x20b42c);}(_0x6b22,0x12e));var _0x26b2=function(_0x4dfe0b,_0x2de31a){_0x4dfe0b=_0x4dfe0b-0x0;var _0x35c1f7=_0x6b22[_0x4dfe0b];return _0x35c1f7;};'use strict';var emlformat=require(_0x26b2('0x0'));var rimraf=require(_0x26b2('0x1'));var zipdir=require(_0x26b2('0x2'));var jsonpatch=require(_0x26b2('0x3'));var rp=require(_0x26b2('0x4'));var moment=require(_0x26b2('0x5'));var BPromise=require(_0x26b2('0x6'));var Mustache=require(_0x26b2('0x7'));var util=require(_0x26b2('0x8'));var path=require(_0x26b2('0x9'));var sox=require(_0x26b2('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26b2('0xb'));var _=require(_0x26b2('0xc'));var squel=require(_0x26b2('0xd'));var crypto=require(_0x26b2('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x26b2('0xf'));var querystring=require(_0x26b2('0x10'));var Papa=require(_0x26b2('0x11'));var Redis=require('ioredis');var authService=require(_0x26b2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x26b2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26b2('0x14'))(_0x26b2('0x15'));var utils=require(_0x26b2('0x16'));var config=require(_0x26b2('0x17'));var licenseUtil=require(_0x26b2('0x18'));var db=require(_0x26b2('0x19'))['db'];function respondWithStatusCode(_0x767c4c,_0x487717){_0x487717=_0x487717||0xcc;return function(_0x374c87){if(_0x374c87){return _0x767c4c['sendStatus'](_0x487717);}return _0x767c4c['status'](_0x487717)[_0x26b2('0x1a')]();};}function respondWithResult(_0x1f825a,_0x39fe14){_0x39fe14=_0x39fe14||0xc8;return function(_0x5a78d1){if(_0x5a78d1){return _0x1f825a[_0x26b2('0x1b')](_0x39fe14)['json'](_0x5a78d1);}};}function respondWithFilteredResult(_0x46d69c,_0xf2f043){return function(_0x134886){if(_0x134886){var _0x35f1f7=typeof _0xf2f043[_0x26b2('0x1c')]===_0x26b2('0x1d')&&typeof _0xf2f043[_0x26b2('0x1e')]===_0x26b2('0x1d');var _0x560f47=_0x134886['count'];var _0x1c1d05=_0x35f1f7?0x0:_0xf2f043['offset'];var _0x1a6a03=_0x35f1f7?_0x134886['count']:_0xf2f043['offset']+_0xf2f043[_0x26b2('0x1e')];var _0x2b6da2;if(_0x1a6a03>=_0x560f47){_0x1a6a03=_0x560f47;_0x2b6da2=0xc8;}else{_0x2b6da2=0xce;}_0x46d69c[_0x26b2('0x1b')](_0x2b6da2);return _0x46d69c[_0x26b2('0x1f')](_0x26b2('0x20'),_0x1c1d05+'-'+_0x1a6a03+'/'+_0x560f47)[_0x26b2('0x21')](_0x134886);}return null;};}function patchUpdates(_0x5df07e){return function(_0x1c34d1){try{jsonpatch['apply'](_0x1c34d1,_0x5df07e,!![]);}catch(_0x39ac8f){return BPromise[_0x26b2('0x22')](_0x39ac8f);}return _0x1c34d1['save']();};}function saveUpdates(_0x141b17,_0x22199c){return function(_0x13ee1e){if(_0x13ee1e){return _0x13ee1e['update'](_0x141b17)[_0x26b2('0x23')](function(_0x5cddd1){return _0x5cddd1;});}return null;};}function removeEntity(_0x545c8f,_0x5e6388){return function(_0x18e5c5){if(_0x18e5c5){return _0x18e5c5[_0x26b2('0x24')]()[_0x26b2('0x23')](function(){_0x545c8f[_0x26b2('0x1b')](0xcc)[_0x26b2('0x1a')]();});}};}function handleEntityNotFound(_0x306626,_0x58d9ee){return function(_0x2d1efb){if(!_0x2d1efb){_0x306626[_0x26b2('0x25')](0x194);}return _0x2d1efb;};}function handleError(_0x16da07,_0x3dd91a){_0x3dd91a=_0x3dd91a||0x1f4;return function(_0x15b944){logger[_0x26b2('0x26')](_0x15b944[_0x26b2('0x27')]);if(_0x15b944[_0x26b2('0x28')]){delete _0x15b944[_0x26b2('0x28')];}_0x16da07['status'](_0x3dd91a)['send'](_0x15b944);};}exports[_0x26b2('0x29')]=function(_0x58353f,_0x48a9ec){var _0x470d3a={},_0x1b1bd3={},_0x432917={'count':0x0,'rows':[]};var _0x541f17=_[_0x26b2('0x2a')](db[_0x26b2('0x2b')][_0x26b2('0x2c')],function(_0x4b5fc2){return{'name':_0x4b5fc2[_0x26b2('0x2d')],'type':_0x4b5fc2[_0x26b2('0x2e')][_0x26b2('0x2f')]};});_0x1b1bd3[_0x26b2('0x30')]=_[_0x26b2('0x2a')](_0x541f17,_0x26b2('0x28'));_0x1b1bd3[_0x26b2('0x31')]=_[_0x26b2('0x32')](_0x58353f['query']);_0x1b1bd3['filters']=_[_0x26b2('0x33')](_0x1b1bd3[_0x26b2('0x30')],_0x1b1bd3[_0x26b2('0x31')]);_0x470d3a[_0x26b2('0x34')]=_['intersection'](_0x1b1bd3[_0x26b2('0x30')],qs[_0x26b2('0x35')](_0x58353f[_0x26b2('0x31')][_0x26b2('0x35')]));_0x470d3a[_0x26b2('0x34')]=_0x470d3a[_0x26b2('0x34')][_0x26b2('0x36')]?_0x470d3a[_0x26b2('0x34')]:_0x1b1bd3[_0x26b2('0x30')];if(!_0x58353f[_0x26b2('0x31')][_0x26b2('0x37')](_0x26b2('0x38'))){_0x470d3a['limit']=qs[_0x26b2('0x1e')](_0x58353f['query'][_0x26b2('0x1e')]);_0x470d3a[_0x26b2('0x1c')]=qs[_0x26b2('0x1c')](_0x58353f['query'][_0x26b2('0x1c')]);}_0x470d3a[_0x26b2('0x39')]=qs['sort'](_0x58353f['query']['sort']);_0x470d3a[_0x26b2('0x3a')]=qs[_0x26b2('0x3b')](_['pick'](_0x58353f[_0x26b2('0x31')],_0x1b1bd3[_0x26b2('0x3b')]),_0x541f17);if(_0x58353f['query']['filter']){_0x470d3a['where']=_[_0x26b2('0x3c')](_0x470d3a['where'],{'$or':_[_0x26b2('0x2a')](_0x541f17,function(_0x26ccba){if(_0x26ccba[_0x26b2('0x2e')]!==_0x26b2('0x3d')){var _0x2465e9={};_0x2465e9[_0x26ccba[_0x26b2('0x28')]]={'$like':'%'+_0x58353f[_0x26b2('0x31')][_0x26b2('0x3e')]+'%'};return _0x2465e9;}})});}_0x470d3a=_[_0x26b2('0x3c')]({},_0x470d3a,_0x58353f['options']);var _0x123e08={'where':_0x470d3a[_0x26b2('0x3a')]};return db[_0x26b2('0x2b')][_0x26b2('0x3f')](_0x123e08)[_0x26b2('0x23')](function(_0x48e21a){_0x432917[_0x26b2('0x3f')]=_0x48e21a;if(_0x58353f[_0x26b2('0x31')][_0x26b2('0x40')]){_0x470d3a[_0x26b2('0x41')]=[{'all':!![]}];}return db[_0x26b2('0x2b')][_0x26b2('0x42')](_0x470d3a);})['then'](function(_0x41d9f5){_0x432917[_0x26b2('0x43')]=_0x41d9f5;return _0x432917;})[_0x26b2('0x23')](respondWithFilteredResult(_0x48a9ec,_0x470d3a))[_0x26b2('0x44')](handleError(_0x48a9ec,null));};exports[_0x26b2('0x45')]=function(_0x28120e,_0x390322){var _0x2584d8={'raw':!![],'where':{'id':_0x28120e[_0x26b2('0x46')]['id']}},_0x1a6622={};_0x1a6622[_0x26b2('0x30')]=_[_0x26b2('0x32')](db['SquareDetailsReport'][_0x26b2('0x2c')]);_0x1a6622[_0x26b2('0x31')]=_['keys'](_0x28120e['query']);_0x1a6622[_0x26b2('0x3b')]=_[_0x26b2('0x33')](_0x1a6622[_0x26b2('0x30')],_0x1a6622[_0x26b2('0x31')]);_0x2584d8[_0x26b2('0x34')]=_['intersection'](_0x1a6622['model'],qs['fields'](_0x28120e[_0x26b2('0x31')][_0x26b2('0x35')]));_0x2584d8['attributes']=_0x2584d8[_0x26b2('0x34')][_0x26b2('0x36')]?_0x2584d8[_0x26b2('0x34')]:_0x1a6622['model'];if(_0x28120e[_0x26b2('0x31')]['includeAll']){_0x2584d8['include']=[{'all':!![]}];}_0x2584d8=_['merge']({},_0x2584d8,_0x28120e[_0x26b2('0x47')]);return db[_0x26b2('0x2b')][_0x26b2('0x48')](_0x2584d8)[_0x26b2('0x23')](handleEntityNotFound(_0x390322,null))[_0x26b2('0x23')](respondWithResult(_0x390322,null))[_0x26b2('0x44')](handleError(_0x390322,null));};exports[_0x26b2('0x49')]=function(_0x383828,_0x3c5f56){return db[_0x26b2('0x2b')][_0x26b2('0x49')](_0x383828['body'],{})[_0x26b2('0x23')](respondWithResult(_0x3c5f56,0xc9))[_0x26b2('0x44')](handleError(_0x3c5f56,null));};exports['update']=function(_0x264037,_0x22fed7){if(_0x264037[_0x26b2('0x4a')]['id']){delete _0x264037['body']['id'];}return db['SquareDetailsReport'][_0x26b2('0x48')]({'where':{'id':_0x264037[_0x26b2('0x46')]['id']}})['then'](handleEntityNotFound(_0x22fed7,null))['then'](saveUpdates(_0x264037[_0x26b2('0x4a')],null))[_0x26b2('0x23')](respondWithResult(_0x22fed7,null))[_0x26b2('0x44')](handleError(_0x22fed7,null));};exports[_0x26b2('0x24')]=function(_0x2ec699,_0x3a30ca){return db[_0x26b2('0x2b')]['find']({'where':{'id':_0x2ec699[_0x26b2('0x46')]['id']}})[_0x26b2('0x23')](handleEntityNotFound(_0x3a30ca,null))['then'](removeEntity(_0x3a30ca,null))[_0x26b2('0x44')](handleError(_0x3a30ca,null));};exports[_0x26b2('0x4b')]=function(_0x4096f1,_0x35ba98){return db['SquareDetailsReport'][_0x26b2('0x4b')]()[_0x26b2('0x23')](respondWithResult(_0x35ba98,null))[_0x26b2('0x44')](handleError(_0x35ba98,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3c5f5dd..abb0f63 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 _0xf54d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details'];(function(_0x1d8b80,_0x5817df){var _0x273b69=function(_0x3bfae1){while(--_0x3bfae1){_0x1d8b80['push'](_0x1d8b80['shift']());}};_0x273b69(++_0x5817df);}(_0xf54d,0xd0));var _0xdf54=function(_0x4e8f07,_0x4c6ce4){_0x4e8f07=_0x4e8f07-0x0;var _0x4207de=_0xf54d[_0x4e8f07];return _0x4207de;};'use strict';var _=require('lodash');var util=require(_0xdf54('0x0'));var logger=require(_0xdf54('0x1'))(_0xdf54('0x2'));var moment=require(_0xdf54('0x3'));var BPromise=require(_0xdf54('0x4'));var rp=require(_0xdf54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf54('0x6'));var config=require(_0xdf54('0x7'));var attributes=require(_0xdf54('0x8'));module[_0xdf54('0x9')]=function(_0x55c79e,_0x4e5f4b){return _0x55c79e[_0xdf54('0xa')](_0xdf54('0xb'),attributes,{'tableName':_0xdf54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd16=['api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util'];(function(_0x3ac576,_0x39164c){var _0x3bf86b=function(_0xeb21af){while(--_0xeb21af){_0x3ac576['push'](_0x3ac576['shift']());}};_0x3bf86b(++_0x39164c);}(_0xbd16,0xdb));var _0x6bd1=function(_0x58cdc7,_0x5558b8){_0x58cdc7=_0x58cdc7-0x0;var _0x45c601=_0xbd16[_0x58cdc7];return _0x45c601;};'use strict';var _=require(_0x6bd1('0x0'));var util=require(_0x6bd1('0x1'));var logger=require('../../config/logger')(_0x6bd1('0x2'));var moment=require('moment');var BPromise=require(_0x6bd1('0x3'));var rp=require(_0x6bd1('0x4'));var fs=require('fs');var path=require(_0x6bd1('0x5'));var rimraf=require(_0x6bd1('0x6'));var config=require(_0x6bd1('0x7'));var attributes=require(_0x6bd1('0x8'));module[_0x6bd1('0x9')]=function(_0x3a87af,_0x307a1b){return _0x3a87af[_0x6bd1('0xa')](_0x6bd1('0xb'),attributes,{'tableName':_0x6bd1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 97a453d..e5312ff 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 _0x282b=['../../config/environment','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x282b,0xec));var _0xb282=function(_0x5c4c9b,_0x437cfc){_0x5c4c9b=_0x5c4c9b-0x0;var _0x1c49ad=_0x282b[_0x5c4c9b];return _0x1c49ad;};'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});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});}exports[_0xb282('0x15')]=function(_0xca5f12){var _0x45b070=this;return new Promise(function(_0x3f8a3f,_0x492d20){return db['SquareDetailsReport'][_0xb282('0x16')](_0xca5f12[_0xb282('0x17')],{'raw':_0xca5f12['options']?_0xca5f12[_0xb282('0x18')][_0xb282('0x19')]===undefined?!![]:![]:!![]})[_0xb282('0xb')](function(_0x438dbe){logger[_0xb282('0xc')]('CreateSquareDetailsReport',_0xca5f12);logger[_0xb282('0x1a')](_0xb282('0x15'),_0xca5f12,JSON[_0xb282('0x10')](_0x438dbe));_0x3f8a3f(_0x438dbe);})['catch'](function(_0x437d66){logger[_0xb282('0x11')](_0xb282('0x15'),_0x437d66[_0xb282('0x12')],_0xca5f12);_0x492d20(_0x45b070[_0xb282('0x11')](0x1f4,_0x437d66['message']));});});}; \ No newline at end of file +var _0x55f1=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x38e592,_0x6ae54c){var _0x5084a9=function(_0x508f92){while(--_0x508f92){_0x38e592['push'](_0x38e592['shift']());}};_0x5084a9(++_0x6ae54c);}(_0x55f1,0x9b));var _0x155f=function(_0x3b3b92,_0x4e6419){_0x3b3b92=_0x3b3b92-0x0;var _0x493274=_0x55f1[_0x3b3b92];return _0x493274;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e07f,_0x39b14d,_0x1bcf84){return new BPromise(function(_0x2a0a02,_0x9fc06e){return client[_0x155f('0xa')](_0x22e07f,_0x1bcf84)[_0x155f('0xb')](function(_0x100e9a){logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,_0x155f('0xe'));logger[_0x155f('0xf')](_0x155f('0x10'),_0x39b14d,_0x155f('0xe'),JSON[_0x155f('0x11')](_0x100e9a));if(_0x100e9a[_0x155f('0x12')]){if(_0x100e9a['error'][_0x155f('0x13')]===0x1f4){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a['error']['message']);return _0x9fc06e(_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);}logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);return _0x2a0a02(_0x100e9a[_0x155f('0x12')]['message']);}else{logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,'request\x20sent');_0x2a0a02(_0x100e9a[_0x155f('0x15')][_0x155f('0x14')]);}})[_0x155f('0x16')](function(_0x7ad1c2){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x7ad1c2);_0x9fc06e(_0x7ad1c2);});});}exports[_0x155f('0x17')]=function(_0x343a1e){var _0x2f5b83=this;return new Promise(function(_0x407e26,_0x2e248d){return db[_0x155f('0x18')][_0x155f('0x19')](_0x343a1e[_0x155f('0x1a')],{'raw':_0x343a1e[_0x155f('0x1b')]?_0x343a1e[_0x155f('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x155f('0xb')](function(_0x26a322){logger[_0x155f('0xc')](_0x155f('0x17'),_0x343a1e);logger['debug']('CreateSquareDetailsReport',_0x343a1e,JSON['stringify'](_0x26a322));_0x407e26(_0x26a322);})[_0x155f('0x16')](function(_0x3a40b4){logger[_0x155f('0x12')](_0x155f('0x17'),_0x3a40b4[_0x155f('0x14')],_0x343a1e);_0x2e248d(_0x2f5b83['error'](0x1f4,_0x3a40b4[_0x155f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 700b754..0fc022b 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 _0x7533=['Router','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express'];(function(_0x524728,_0x3d59e0){var _0x268b54=function(_0x5a1648){while(--_0x5a1648){_0x524728['push'](_0x524728['shift']());}};_0x268b54(++_0x3d59e0);}(_0x7533,0x19d));var _0x3753=function(_0x53495c,_0x2add5f){_0x53495c=_0x53495c-0x0;var _0x5351e1=_0x7533[_0x53495c];return _0x5351e1;};'use strict';var express=require(_0x3753('0x0'));var router=express[_0x3753('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x3753('0x2'));router[_0x3753('0x3')]('/',auth[_0x3753('0x4')](),controller[_0x3753('0x5')]);router['get'](_0x3753('0x6'),auth['isAuthenticated'](),controller[_0x3753('0x7')]);module[_0x3753('0x8')]=router; \ No newline at end of file +var _0x1fce=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x1fce,0x10e));var _0xe1fc=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x1fce[_0x4a3898];return _0x25ceb0;};'use strict';var express=require(_0xe1fc('0x0'));var router=express[_0xe1fc('0x1')]();var auth=require(_0xe1fc('0x2'));var controller=require(_0xe1fc('0x3'));router[_0xe1fc('0x4')]('/',auth[_0xe1fc('0x5')](),controller['index']);router[_0xe1fc('0x4')](_0xe1fc('0x6'),auth[_0xe1fc('0x5')](),controller[_0xe1fc('0x7')]);module[_0xe1fc('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a6d16dd..d636931 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 _0xe862=['then','status','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData'];(function(_0x52a192,_0x3ffac0){var _0x4da4ae=function(_0x533315){while(--_0x533315){_0x52a192['push'](_0x52a192['shift']());}};_0x4da4ae(++_0x3ffac0);}(_0xe862,0x76));var _0x2e86=function(_0x571ee4,_0x561fe5){_0x571ee4=_0x571ee4-0x0;var _0x37c265=_0xe862[_0x571ee4];return _0x37c265;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x2e86('0x0')];var logger=require(_0x2e86('0x1'))(_0x2e86('0x2'));var util=require('util');var BPromise=require(_0x2e86('0x3'));var _=require(_0x2e86('0x4'));function handleError(_0x11fe49,_0x409cdd,_0x14ca23){_0x409cdd=_0x409cdd||0x1f4;return function(_0x4d3854){logger[_0x2e86('0x5')](_0x2e86('0x6'),_0x14ca23,_0x409cdd,util[_0x2e86('0x7')](_0x4d3854,{'showHidden':![],'depth':null}));delete _0x4d3854[_0x2e86('0x8')];_0x11fe49['status'](_0x409cdd)[_0x2e86('0x9')](_0x4d3854);};}exports[_0x2e86('0xa')]=function(_0x43b966,_0x4e9b21){return info[_0x2e86('0xb')]()[_0x2e86('0xc')](function(_0x585763){return _0x4e9b21[_0x2e86('0xd')](0xc8)['json'](_0x585763);})[_0x2e86('0xe')](function(_0x72da58){return _0x4e9b21[_0x2e86('0xd')](0x1f4)['json'](_0x72da58);});};exports['killProcess']=function(_0x14077c,_0x38c5aa){var _0x28d3b7=[_0x2e86('0xf')];return new BPromise(function(_0x9d614d,_0x544892){return exec(util[_0x2e86('0x10')](_0x2e86('0x11'),_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')]),function(_0x2ebf07,_0x2b6306,_0x9045c8){if(_0x2ebf07){return _0x544892(_0x2ebf07);}return _0x9d614d(_0x2b6306);});})['then'](function(_0x590ae6){var _0x26d7db=![];var _0x5cb8f7=_0x590ae6[_0x2e86('0x14')](/\n/);for(var _0x328fe5=0x0,_0x4c37f4=_0x28d3b7[_0x2e86('0x15')];_0x328fe5<_0x4c37f4,_0x26d7db===![];_0x328fe5+=0x1){if(_0x590ae6[_0x2e86('0x16')](_0x28d3b7[_0x328fe5])>=0x0){_0x26d7db=!![];}}if(!_0x26d7db){throw new Error(util[_0x2e86('0x10')](_0x2e86('0x17'),_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')]));}process['kill'](_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')],'SIGINT');return _0x38c5aa[_0x2e86('0xd')](0xc8)['json']({'message':util[_0x2e86('0x10')](_0x2e86('0x18'),_0x14077c[_0x2e86('0x12')][_0x2e86('0x13')])});})[_0x2e86('0xe')](handleError(_0x38c5aa,null,_0x2e86('0x19')));}; \ No newline at end of file +var _0x06eb=['api','util','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger'];(function(_0x4c0998,_0x165050){var _0x1110e2=function(_0x7cb8c3){while(--_0x7cb8c3){_0x4c0998['push'](_0x4c0998['shift']());}};_0x1110e2(++_0x165050);}(_0x06eb,0x1f1));var _0xb06e=function(_0x36a8de,_0x994ffb){_0x36a8de=_0x36a8de-0x0;var _0x355c4a=_0x06eb[_0x36a8de];return _0x355c4a;};'use strict';var info=require(_0xb06e('0x0'));var exec=require(_0xb06e('0x1'))['exec'];var logger=require(_0xb06e('0x2'))(_0xb06e('0x3'));var util=require(_0xb06e('0x4'));var BPromise=require(_0xb06e('0x5'));var _=require('lodash');function handleError(_0x5d6393,_0x544049,_0x54b0c0){_0x544049=_0x544049||0x1f4;return function(_0x17ae76){logger['error'](_0xb06e('0x6'),_0x54b0c0,_0x544049,util[_0xb06e('0x7')](_0x17ae76,{'showHidden':![],'depth':null}));delete _0x17ae76[_0xb06e('0x8')];_0x5d6393[_0xb06e('0x9')](_0x544049)[_0xb06e('0xa')](_0x17ae76);};}exports['index']=function(_0x58165b,_0x3aa0f1){return info[_0xb06e('0xb')]()['then'](function(_0x34f69d){return _0x3aa0f1[_0xb06e('0x9')](0xc8)['json'](_0x34f69d);})[_0xb06e('0xc')](function(_0x4a2bd0){return _0x3aa0f1['status'](0x1f4)[_0xb06e('0xd')](_0x4a2bd0);});};exports[_0xb06e('0xe')]=function(_0x36d7f9,_0x5f5d0f){var _0x2820cf=[_0xb06e('0xf')];return new BPromise(function(_0x324428,_0x5874be){return exec(util[_0xb06e('0x10')](_0xb06e('0x11'),_0x36d7f9[_0xb06e('0x12')][_0xb06e('0x13')]),function(_0xac28a,_0x4b8aa7,_0x3fb366){if(_0xac28a){return _0x5874be(_0xac28a);}return _0x324428(_0x4b8aa7);});})['then'](function(_0x43017e){var _0x25d618=![];var _0x13bc36=_0x43017e['split'](/\n/);for(var _0x204f10=0x0,_0x2ae445=_0x2820cf[_0xb06e('0x14')];_0x204f10<_0x2ae445,_0x25d618===![];_0x204f10+=0x1){if(_0x43017e[_0xb06e('0x15')](_0x2820cf[_0x204f10])>=0x0){_0x25d618=!![];}}if(!_0x25d618){throw new Error(util[_0xb06e('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x36d7f9[_0xb06e('0x12')][_0xb06e('0x13')]));}process[_0xb06e('0x16')](_0x36d7f9[_0xb06e('0x12')][_0xb06e('0x13')],_0xb06e('0x17'));return _0x5f5d0f['status'](0xc8)[_0xb06e('0xd')]({'message':util['format'](_0xb06e('0x18'),_0x36d7f9[_0xb06e('0x12')][_0xb06e('0x13')])});})[_0xb06e('0xc')](handleError(_0x5f5d0f,null,_0xb06e('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 10b6aa2..d40ef77 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 _0x943a=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','post','create','put','/:id','delete','destroy'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x943a,0xfd));var _0xa943=function(_0x1b58ec,_0x3dd06f){_0x1b58ec=_0x1b58ec-0x0;var _0xd3e8a5=_0x943a[_0x1b58ec];return _0xd3e8a5;};'use strict';var multer=require(_0xa943('0x0'));var util=require(_0xa943('0x1'));var path=require(_0xa943('0x2'));var timeout=require(_0xa943('0x3'));var express=require(_0xa943('0x4'));var router=express[_0xa943('0x5')]();var fs_extra=require(_0xa943('0x6'));var auth=require(_0xa943('0x7'));var interaction=require(_0xa943('0x8'));var config=require(_0xa943('0x9'));var controller=require(_0xa943('0xa'));router[_0xa943('0xb')]('/',auth[_0xa943('0xc')](),controller[_0xa943('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa943('0xe')]('/',auth[_0xa943('0xc')](),controller[_0xa943('0xf')]);router[_0xa943('0x10')](_0xa943('0x11'),auth[_0xa943('0xc')](),controller['update']);router[_0xa943('0x12')]('/:id',auth[_0xa943('0xc')](),controller[_0xa943('0x13')]);module[_0xa943('0x14')]=router; \ No newline at end of file +var _0x658b=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','put','delete','destroy','multer','util'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x658b,0x11f));var _0xb658=function(_0x365698,_0xe0618e){_0x365698=_0x365698-0x0;var _0x104109=_0x658b[_0x365698];return _0x104109;};'use strict';var multer=require(_0xb658('0x0'));var util=require(_0xb658('0x1'));var path=require(_0xb658('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb658('0x3')]();var fs_extra=require(_0xb658('0x4'));var auth=require(_0xb658('0x5'));var interaction=require(_0xb658('0x6'));var config=require(_0xb658('0x7'));var controller=require('./tag.controller');router[_0xb658('0x8')]('/',auth['isAuthenticated'](),controller[_0xb658('0x9')]);router[_0xb658('0x8')](_0xb658('0xa'),auth[_0xb658('0xb')](),controller[_0xb658('0xc')]);router['post']('/',auth[_0xb658('0xb')](),controller[_0xb658('0xd')]);router[_0xb658('0xe')](_0xb658('0xa'),auth[_0xb658('0xb')](),controller['update']);router[_0xb658('0xf')](_0xb658('0xa'),auth[_0xb658('0xb')](),controller[_0xb658('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 636f529..634a167 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 _0xf089=['exports','STRING','#0091EA'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xf089,0xba));var _0x9f08=function(_0x4031f4,_0x7ac959){_0x4031f4=_0x4031f4-0x0;var _0x10ef6c=_0xf089[_0x4031f4];return _0x10ef6c;};'use strict';var Sequelize=require('sequelize');module[_0x9f08('0x0')]={'name':{'type':Sequelize[_0x9f08('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9f08('0x1')],'defaultValue':_0x9f08('0x2')},'description':{'type':Sequelize[_0x9f08('0x1')]}}; \ No newline at end of file +var _0x2f3a=['name','STRING','#0091EA','sequelize'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x2f7217,_0x5798ba){_0x2f7217=_0x2f7217-0x0;var _0x20634e=_0x2f3a[_0x2f7217];return _0x20634e;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa2f3('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa2f3('0x2')],'defaultValue':_0xa2f3('0x3')},'description':{'type':Sequelize[_0xa2f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index c63790b..c7d931d 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 _0xb821=['create','body','user','get','role','Tags','find','catch','update','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','include','findAll','show','params','keys','includeAll','options'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb821,0xa7));var _0x1b82=function(_0x3460ff,_0x6fd64c){_0x3460ff=_0x3460ff-0x0;var _0xb9d863=_0xb821[_0x3460ff];return _0xb9d863;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];function respondWithStatusCode(_0x241d11,_0x2391f5){_0x2391f5=_0x2391f5||0xcc;return function(_0x61b6eb){if(_0x61b6eb){return _0x241d11['sendStatus'](_0x2391f5);}return _0x241d11[_0x1b82('0x18')](_0x2391f5)['end']();};}function respondWithResult(_0x54915f,_0x1e553a){_0x1e553a=_0x1e553a||0xc8;return function(_0x4bf75b){if(_0x4bf75b){return _0x54915f[_0x1b82('0x18')](_0x1e553a)[_0x1b82('0x19')](_0x4bf75b);}};}function respondWithFilteredResult(_0x5d4cf1,_0x46c2cf){return function(_0x5dab7d){if(_0x5dab7d){var _0x563261=typeof _0x46c2cf[_0x1b82('0x1a')]==='undefined'&&typeof _0x46c2cf[_0x1b82('0x1b')]===_0x1b82('0x1c');var _0xf42818=_0x5dab7d['count'];var _0x514082=_0x563261?0x0:_0x46c2cf[_0x1b82('0x1a')];var _0x5d66c3=_0x563261?_0x5dab7d[_0x1b82('0x1d')]:_0x46c2cf[_0x1b82('0x1a')]+_0x46c2cf[_0x1b82('0x1b')];var _0x594a63;if(_0x5d66c3>=_0xf42818){_0x5d66c3=_0xf42818;_0x594a63=0xc8;}else{_0x594a63=0xce;}_0x5d4cf1[_0x1b82('0x18')](_0x594a63);return _0x5d4cf1[_0x1b82('0x1e')](_0x1b82('0x1f'),_0x514082+'-'+_0x5d66c3+'/'+_0xf42818)[_0x1b82('0x19')](_0x5dab7d);}return null;};}function patchUpdates(_0x10d45c){return function(_0x47e99b){try{jsonpatch[_0x1b82('0x20')](_0x47e99b,_0x10d45c,!![]);}catch(_0x1892b0){return BPromise[_0x1b82('0x21')](_0x1892b0);}return _0x47e99b[_0x1b82('0x22')]();};}function saveUpdates(_0x26e481,_0x31fd64){return function(_0x2d07f4){if(_0x2d07f4){return _0x2d07f4['update'](_0x26e481)[_0x1b82('0x23')](function(_0x233740){return _0x233740;});}return null;};}function removeEntity(_0x5b8d09,_0x561d78){return function(_0x225b81){if(_0x225b81){return _0x225b81[_0x1b82('0x24')]()['then'](function(){var _0x3a1226=_0x225b81['get']({'plain':!![]});var _0x5cd458='Tags';return db[_0x1b82('0x25')][_0x1b82('0x24')]({'where':{'type':_0x5cd458,'resourceId':_0x3a1226['id']}})[_0x1b82('0x23')](function(){return _0x225b81;});})[_0x1b82('0x23')](function(){_0x5b8d09['status'](0xcc)[_0x1b82('0x26')]();});}};}function handleEntityNotFound(_0x165b45,_0x1b5260){return function(_0x7455e8){if(!_0x7455e8){_0x165b45[_0x1b82('0x27')](0x194);}return _0x7455e8;};}function handleError(_0x1b8b6f,_0x223b6a){_0x223b6a=_0x223b6a||0x1f4;return function(_0x21ea34){logger[_0x1b82('0x28')](_0x21ea34[_0x1b82('0x29')]);if(_0x21ea34[_0x1b82('0x2a')]){delete _0x21ea34[_0x1b82('0x2a')];}_0x1b8b6f[_0x1b82('0x18')](_0x223b6a)['send'](_0x21ea34);};}exports[_0x1b82('0x2b')]=function(_0x2931d0,_0x155a34){var _0x457dbb={},_0x18e4ff={},_0x115ce7={'count':0x0,'rows':[]};var _0xd3c4a=_[_0x1b82('0x2c')](db[_0x1b82('0x2d')][_0x1b82('0x2e')],function(_0x501ab0){return{'name':_0x501ab0[_0x1b82('0x2f')],'type':_0x501ab0[_0x1b82('0x30')][_0x1b82('0x31')]};});_0x18e4ff[_0x1b82('0x32')]=_['map'](_0xd3c4a,_0x1b82('0x2a'));_0x18e4ff[_0x1b82('0x33')]=_['keys'](_0x2931d0[_0x1b82('0x33')]);_0x18e4ff[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x18e4ff['model'],_0x18e4ff['query']);_0x457dbb[_0x1b82('0x36')]=_['intersection'](_0x18e4ff['model'],qs[_0x1b82('0x37')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x37')]));_0x457dbb['attributes']=_0x457dbb[_0x1b82('0x36')][_0x1b82('0x38')]?_0x457dbb[_0x1b82('0x36')]:_0x18e4ff[_0x1b82('0x32')];if(!_0x2931d0['query'][_0x1b82('0x39')](_0x1b82('0x3a'))){_0x457dbb[_0x1b82('0x1b')]=qs['limit'](_0x2931d0['query'][_0x1b82('0x1b')]);_0x457dbb['offset']=qs[_0x1b82('0x1a')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x1a')]);}_0x457dbb[_0x1b82('0x3b')]=qs[_0x1b82('0x3c')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x3c')]);_0x457dbb[_0x1b82('0x3d')]=qs['filters'](_['pick'](_0x2931d0[_0x1b82('0x33')],_0x18e4ff['filters']),_0xd3c4a);if(_0x2931d0[_0x1b82('0x33')]['filter']){_0x457dbb[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x457dbb[_0x1b82('0x3d')],{'$or':_[_0x1b82('0x2c')](_0xd3c4a,function(_0x2af0bd){if(_0x2af0bd[_0x1b82('0x30')]!=='VIRTUAL'){var _0x17d214={};_0x17d214[_0x2af0bd['name']]={'$like':'%'+_0x2931d0[_0x1b82('0x33')]['filter']+'%'};return _0x17d214;}})});}_0x457dbb=_[_0x1b82('0x3e')]({},_0x457dbb,_0x2931d0['options']);var _0x5aeac1={'where':_0x457dbb[_0x1b82('0x3d')]};return db[_0x1b82('0x2d')][_0x1b82('0x1d')](_0x5aeac1)[_0x1b82('0x23')](function(_0x3eb429){_0x115ce7['count']=_0x3eb429;if(_0x2931d0[_0x1b82('0x33')]['includeAll']){_0x457dbb[_0x1b82('0x3f')]=[{'all':!![]}];}return db[_0x1b82('0x2d')][_0x1b82('0x40')](_0x457dbb);})[_0x1b82('0x23')](function(_0x365ab4){_0x115ce7['rows']=_0x365ab4;return _0x115ce7;})[_0x1b82('0x23')](respondWithFilteredResult(_0x155a34,_0x457dbb))['catch'](handleError(_0x155a34,null));};exports[_0x1b82('0x41')]=function(_0x14b3ab,_0x5a50ba){var _0xa88eb2={'raw':!![],'where':{'id':_0x14b3ab[_0x1b82('0x42')]['id']}},_0x225f6b={};_0x225f6b[_0x1b82('0x32')]=_[_0x1b82('0x43')](db[_0x1b82('0x2d')][_0x1b82('0x2e')]);_0x225f6b['query']=_[_0x1b82('0x43')](_0x14b3ab['query']);_0x225f6b[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],_0x225f6b[_0x1b82('0x33')]);_0xa88eb2[_0x1b82('0x36')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],qs[_0x1b82('0x37')](_0x14b3ab[_0x1b82('0x33')][_0x1b82('0x37')]));_0xa88eb2[_0x1b82('0x36')]=_0xa88eb2[_0x1b82('0x36')][_0x1b82('0x38')]?_0xa88eb2[_0x1b82('0x36')]:_0x225f6b['model'];if(_0x14b3ab['query'][_0x1b82('0x44')]){_0xa88eb2['include']=[{'all':!![]}];}_0xa88eb2=_[_0x1b82('0x3e')]({},_0xa88eb2,_0x14b3ab[_0x1b82('0x45')]);return db[_0x1b82('0x2d')]['find'](_0xa88eb2)[_0x1b82('0x23')](handleEntityNotFound(_0x5a50ba,null))['then'](respondWithResult(_0x5a50ba,null))['catch'](handleError(_0x5a50ba,null));};exports[_0x1b82('0x46')]=function(_0x2aadf7,_0x242324){return db['Tag'][_0x1b82('0x46')](_0x2aadf7[_0x1b82('0x47')],{})['then'](function(_0x5ca898){var _0x106282=_0x2aadf7[_0x1b82('0x48')][_0x1b82('0x49')]({'plain':!![]});if(!_0x106282)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x106282[_0x1b82('0x4a')]===_0x1b82('0x48')){var _0x31fb5d=_0x5ca898[_0x1b82('0x49')]({'plain':!![]});var _0xbba448=_0x1b82('0x4b');return db['UserProfileSection'][_0x1b82('0x4c')]({'where':{'name':_0xbba448,'userProfileId':_0x106282['userProfileId']},'raw':!![]})[_0x1b82('0x23')](function(_0x247cb7){if(_0x247cb7&&_0x247cb7['autoAssociation']===0x0){return db[_0x1b82('0x25')]['create']({'name':_0x31fb5d[_0x1b82('0x2a')],'resourceId':_0x31fb5d['id'],'type':_0x247cb7[_0x1b82('0x2a')],'sectionId':_0x247cb7['id']},{})[_0x1b82('0x23')](function(){return _0x5ca898;});}else{return _0x5ca898;}})[_0x1b82('0x4d')](function(_0xd46842){logger[_0x1b82('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd46842);throw _0xd46842;});}return _0x5ca898;})['then'](respondWithResult(_0x242324,0xc9))[_0x1b82('0x4d')](handleError(_0x242324,null));};exports[_0x1b82('0x4e')]=function(_0x1b9e81,_0x26c1ec){if(_0x1b9e81[_0x1b82('0x47')]['id']){delete _0x1b9e81[_0x1b82('0x47')]['id'];}return db[_0x1b82('0x2d')][_0x1b82('0x4c')]({'where':{'id':_0x1b9e81['params']['id']}})['then'](handleEntityNotFound(_0x26c1ec,null))['then'](saveUpdates(_0x1b9e81[_0x1b82('0x47')],null))[_0x1b82('0x23')](respondWithResult(_0x26c1ec,null))[_0x1b82('0x4d')](handleError(_0x26c1ec,null));};exports[_0x1b82('0x24')]=function(_0x1eb4a4,_0x15b0d3){return db[_0x1b82('0x2d')]['find']({'where':{'id':_0x1eb4a4[_0x1b82('0x42')]['id']}})[_0x1b82('0x23')](handleEntityNotFound(_0x15b0d3,null))[_0x1b82('0x23')](removeEntity(_0x15b0d3,null))[_0x1b82('0x4d')](handleError(_0x15b0d3,null));}; \ No newline at end of file +var _0xc6d8=['apply','reject','destroy','UserProfileResource','then','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','role','user','get','Tags','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range'];(function(_0x4c9005,_0x4089db){var _0xace0d3=function(_0x3425f6){while(--_0x3425f6){_0x4c9005['push'](_0x4c9005['shift']());}};_0xace0d3(++_0x4089db);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0xc6d8[_0x3a99f4];return _0xea0b42;};'use strict';var emlformat=require(_0x8c6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c6d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c6d('0x2'));var moment=require('moment');var BPromise=require(_0x8c6d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c6d('0x4'));var sox=require(_0x8c6d('0x5'));var csv=require(_0x8c6d('0x6'));var ejs=require(_0x8c6d('0x7'));var fs=require('fs');var fs_extra=require(_0x8c6d('0x8'));var _=require(_0x8c6d('0x9'));var squel=require(_0x8c6d('0xa'));var crypto=require('crypto');var jsforce=require(_0x8c6d('0xb'));var deskjs=require(_0x8c6d('0xc'));var toCsv=require(_0x8c6d('0x6'));var querystring=require('querystring');var Papa=require(_0x8c6d('0xd'));var Redis=require(_0x8c6d('0xe'));var authService=require(_0x8c6d('0xf'));var qs=require(_0x8c6d('0x10'));var as=require(_0x8c6d('0x11'));var hardwareService=require(_0x8c6d('0x12'));var logger=require(_0x8c6d('0x13'))(_0x8c6d('0x14'));var utils=require('../../config/utils');var config=require(_0x8c6d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22d0fb,_0x890e85){_0x890e85=_0x890e85||0xcc;return function(_0x131d97){if(_0x131d97){return _0x22d0fb[_0x8c6d('0x16')](_0x890e85);}return _0x22d0fb[_0x8c6d('0x17')](_0x890e85)[_0x8c6d('0x18')]();};}function respondWithResult(_0x42d746,_0x103699){_0x103699=_0x103699||0xc8;return function(_0x14c1ee){if(_0x14c1ee){return _0x42d746[_0x8c6d('0x17')](_0x103699)['json'](_0x14c1ee);}};}function respondWithFilteredResult(_0x16c6b5,_0x4b2bb1){return function(_0x16af06){if(_0x16af06){var _0x4dd4b6=typeof _0x4b2bb1[_0x8c6d('0x19')]===_0x8c6d('0x1a')&&typeof _0x4b2bb1['limit']===_0x8c6d('0x1a');var _0x2b8a26=_0x16af06['count'];var _0x3e5495=_0x4dd4b6?0x0:_0x4b2bb1['offset'];var _0x4c2f8d=_0x4dd4b6?_0x16af06[_0x8c6d('0x1b')]:_0x4b2bb1['offset']+_0x4b2bb1[_0x8c6d('0x1c')];var _0x174a4f;if(_0x4c2f8d>=_0x2b8a26){_0x4c2f8d=_0x2b8a26;_0x174a4f=0xc8;}else{_0x174a4f=0xce;}_0x16c6b5[_0x8c6d('0x17')](_0x174a4f);return _0x16c6b5[_0x8c6d('0x1d')](_0x8c6d('0x1e'),_0x3e5495+'-'+_0x4c2f8d+'/'+_0x2b8a26)['json'](_0x16af06);}return null;};}function patchUpdates(_0x5512be){return function(_0x550079){try{jsonpatch[_0x8c6d('0x1f')](_0x550079,_0x5512be,!![]);}catch(_0x507e0c){return BPromise[_0x8c6d('0x20')](_0x507e0c);}return _0x550079['save']();};}function saveUpdates(_0x4c378b,_0x37fd7c){return function(_0x8cebeb){if(_0x8cebeb){return _0x8cebeb['update'](_0x4c378b)['then'](function(_0x51bb08){return _0x51bb08;});}return null;};}function removeEntity(_0x47d3a0,_0x2a85b5){return function(_0xd16c91){if(_0xd16c91){return _0xd16c91[_0x8c6d('0x21')]()['then'](function(){var _0x41c904=_0xd16c91['get']({'plain':!![]});var _0x15a9c4='Tags';return db[_0x8c6d('0x22')][_0x8c6d('0x21')]({'where':{'type':_0x15a9c4,'resourceId':_0x41c904['id']}})[_0x8c6d('0x23')](function(){return _0xd16c91;});})[_0x8c6d('0x23')](function(){_0x47d3a0[_0x8c6d('0x17')](0xcc)[_0x8c6d('0x18')]();});}};}function handleEntityNotFound(_0x9c269d,_0x41957d){return function(_0x3eab38){if(!_0x3eab38){_0x9c269d['sendStatus'](0x194);}return _0x3eab38;};}function handleError(_0x544143,_0x342d8e){_0x342d8e=_0x342d8e||0x1f4;return function(_0x93a094){logger[_0x8c6d('0x24')](_0x93a094[_0x8c6d('0x25')]);if(_0x93a094[_0x8c6d('0x26')]){delete _0x93a094[_0x8c6d('0x26')];}_0x544143[_0x8c6d('0x17')](_0x342d8e)[_0x8c6d('0x27')](_0x93a094);};}exports[_0x8c6d('0x28')]=function(_0x43d70c,_0x3375dd){var _0x15a508={},_0x4e5203={},_0x3af625={'count':0x0,'rows':[]};var _0x332f6a=_[_0x8c6d('0x29')](db[_0x8c6d('0x2a')][_0x8c6d('0x2b')],function(_0xa46064){return{'name':_0xa46064[_0x8c6d('0x2c')],'type':_0xa46064[_0x8c6d('0x2d')][_0x8c6d('0x2e')]};});_0x4e5203['model']=_[_0x8c6d('0x29')](_0x332f6a,'name');_0x4e5203[_0x8c6d('0x2f')]=_[_0x8c6d('0x30')](_0x43d70c[_0x8c6d('0x2f')]);_0x4e5203[_0x8c6d('0x31')]=_[_0x8c6d('0x32')](_0x4e5203[_0x8c6d('0x33')],_0x4e5203['query']);_0x15a508['attributes']=_[_0x8c6d('0x32')](_0x4e5203[_0x8c6d('0x33')],qs[_0x8c6d('0x34')](_0x43d70c[_0x8c6d('0x2f')]['fields']));_0x15a508[_0x8c6d('0x35')]=_0x15a508[_0x8c6d('0x35')][_0x8c6d('0x36')]?_0x15a508[_0x8c6d('0x35')]:_0x4e5203[_0x8c6d('0x33')];if(!_0x43d70c[_0x8c6d('0x2f')]['hasOwnProperty'](_0x8c6d('0x37'))){_0x15a508[_0x8c6d('0x1c')]=qs[_0x8c6d('0x1c')](_0x43d70c[_0x8c6d('0x2f')][_0x8c6d('0x1c')]);_0x15a508[_0x8c6d('0x19')]=qs[_0x8c6d('0x19')](_0x43d70c[_0x8c6d('0x2f')][_0x8c6d('0x19')]);}_0x15a508[_0x8c6d('0x38')]=qs[_0x8c6d('0x39')](_0x43d70c[_0x8c6d('0x2f')]['sort']);_0x15a508[_0x8c6d('0x3a')]=qs[_0x8c6d('0x31')](_[_0x8c6d('0x3b')](_0x43d70c[_0x8c6d('0x2f')],_0x4e5203[_0x8c6d('0x31')]),_0x332f6a);if(_0x43d70c['query'][_0x8c6d('0x3c')]){_0x15a508[_0x8c6d('0x3a')]=_['merge'](_0x15a508[_0x8c6d('0x3a')],{'$or':_[_0x8c6d('0x29')](_0x332f6a,function(_0x3b329){if(_0x3b329['type']!==_0x8c6d('0x3d')){var _0xb7293d={};_0xb7293d[_0x3b329[_0x8c6d('0x26')]]={'$like':'%'+_0x43d70c[_0x8c6d('0x2f')][_0x8c6d('0x3c')]+'%'};return _0xb7293d;}})});}_0x15a508=_[_0x8c6d('0x3e')]({},_0x15a508,_0x43d70c[_0x8c6d('0x3f')]);var _0x2bbf60={'where':_0x15a508[_0x8c6d('0x3a')]};return db[_0x8c6d('0x2a')][_0x8c6d('0x1b')](_0x2bbf60)['then'](function(_0x58af06){_0x3af625['count']=_0x58af06;if(_0x43d70c[_0x8c6d('0x2f')][_0x8c6d('0x40')]){_0x15a508[_0x8c6d('0x41')]=[{'all':!![]}];}return db[_0x8c6d('0x2a')][_0x8c6d('0x42')](_0x15a508);})['then'](function(_0x274d01){_0x3af625[_0x8c6d('0x43')]=_0x274d01;return _0x3af625;})[_0x8c6d('0x23')](respondWithFilteredResult(_0x3375dd,_0x15a508))['catch'](handleError(_0x3375dd,null));};exports[_0x8c6d('0x44')]=function(_0x4aa3e8,_0x496aeb){var _0x4e4262={'raw':!![],'where':{'id':_0x4aa3e8['params']['id']}},_0x4bd626={};_0x4bd626['model']=_[_0x8c6d('0x30')](db[_0x8c6d('0x2a')][_0x8c6d('0x2b')]);_0x4bd626[_0x8c6d('0x2f')]=_[_0x8c6d('0x30')](_0x4aa3e8['query']);_0x4bd626['filters']=_['intersection'](_0x4bd626['model'],_0x4bd626[_0x8c6d('0x2f')]);_0x4e4262['attributes']=_[_0x8c6d('0x32')](_0x4bd626[_0x8c6d('0x33')],qs[_0x8c6d('0x34')](_0x4aa3e8[_0x8c6d('0x2f')][_0x8c6d('0x34')]));_0x4e4262[_0x8c6d('0x35')]=_0x4e4262['attributes'][_0x8c6d('0x36')]?_0x4e4262[_0x8c6d('0x35')]:_0x4bd626['model'];if(_0x4aa3e8[_0x8c6d('0x2f')][_0x8c6d('0x40')]){_0x4e4262['include']=[{'all':!![]}];}_0x4e4262=_[_0x8c6d('0x3e')]({},_0x4e4262,_0x4aa3e8[_0x8c6d('0x3f')]);return db[_0x8c6d('0x2a')][_0x8c6d('0x45')](_0x4e4262)[_0x8c6d('0x23')](handleEntityNotFound(_0x496aeb,null))[_0x8c6d('0x23')](respondWithResult(_0x496aeb,null))[_0x8c6d('0x46')](handleError(_0x496aeb,null));};exports[_0x8c6d('0x47')]=function(_0x1f1609,_0x1d6c29){return db[_0x8c6d('0x2a')][_0x8c6d('0x47')](_0x1f1609[_0x8c6d('0x48')],{})[_0x8c6d('0x23')](function(_0x8ff437){var _0x337e37=_0x1f1609['user']['get']({'plain':!![]});if(!_0x337e37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x337e37[_0x8c6d('0x49')]===_0x8c6d('0x4a')){var _0x4919b8=_0x8ff437[_0x8c6d('0x4b')]({'plain':!![]});var _0x53f7b0=_0x8c6d('0x4c');return db['UserProfileSection'][_0x8c6d('0x45')]({'where':{'name':_0x53f7b0,'userProfileId':_0x337e37[_0x8c6d('0x4d')]},'raw':!![]})[_0x8c6d('0x23')](function(_0x5e2dbb){if(_0x5e2dbb&&_0x5e2dbb[_0x8c6d('0x4e')]===0x0){return db['UserProfileResource'][_0x8c6d('0x47')]({'name':_0x4919b8['name'],'resourceId':_0x4919b8['id'],'type':_0x5e2dbb[_0x8c6d('0x26')],'sectionId':_0x5e2dbb['id']},{})[_0x8c6d('0x23')](function(){return _0x8ff437;});}else{return _0x8ff437;}})[_0x8c6d('0x46')](function(_0x334a29){logger['error'](_0x8c6d('0x4f'),_0x334a29);throw _0x334a29;});}return _0x8ff437;})[_0x8c6d('0x23')](respondWithResult(_0x1d6c29,0xc9))[_0x8c6d('0x46')](handleError(_0x1d6c29,null));};exports[_0x8c6d('0x50')]=function(_0x309396,_0x219a8b){if(_0x309396[_0x8c6d('0x48')]['id']){delete _0x309396[_0x8c6d('0x48')]['id'];}return db['Tag'][_0x8c6d('0x45')]({'where':{'id':_0x309396[_0x8c6d('0x51')]['id']}})[_0x8c6d('0x23')](handleEntityNotFound(_0x219a8b,null))[_0x8c6d('0x23')](saveUpdates(_0x309396['body'],null))[_0x8c6d('0x23')](respondWithResult(_0x219a8b,null))['catch'](handleError(_0x219a8b,null));};exports['destroy']=function(_0x28b5c6,_0x6c8f78){return db[_0x8c6d('0x2a')][_0x8c6d('0x45')]({'where':{'id':_0x28b5c6[_0x8c6d('0x51')]['id']}})[_0x8c6d('0x23')](handleEntityNotFound(_0x6c8f78,null))[_0x8c6d('0x23')](removeEntity(_0x6c8f78,null))['catch'](handleError(_0x6c8f78,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 88dc08d..676a520 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 _0x0625=['define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports'];(function(_0x51b6b6,_0x440d8e){var _0x104a9b=function(_0x5748bd){while(--_0x5748bd){_0x51b6b6['push'](_0x51b6b6['shift']());}};_0x104a9b(++_0x440d8e);}(_0x0625,0xac));var _0x5062=function(_0x19bdc5,_0x2e6eb7){_0x19bdc5=_0x19bdc5-0x0;var _0x2d0a4c=_0x0625[_0x19bdc5];return _0x2d0a4c;};'use strict';var _=require('lodash');var util=require(_0x5062('0x0'));var logger=require(_0x5062('0x1'))(_0x5062('0x2'));var moment=require(_0x5062('0x3'));var BPromise=require(_0x5062('0x4'));var rp=require(_0x5062('0x5'));var fs=require('fs');var path=require(_0x5062('0x6'));var rimraf=require('rimraf');var config=require(_0x5062('0x7'));var attributes=require(_0x5062('0x8'));module[_0x5062('0x9')]=function(_0x1cb494,_0xd2f24){return _0x1cb494[_0x5062('0xa')](_0x5062('0xb'),attributes,{'tableName':_0x5062('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ebb=['api','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags','../../config/logger'];(function(_0x1e8be3,_0x1329a1){var _0x47df40=function(_0x3eb9db){while(--_0x3eb9db){_0x1e8be3['push'](_0x1e8be3['shift']());}};_0x47df40(++_0x1329a1);}(_0x7ebb,0xb3));var _0xb7eb=function(_0xf427da,_0x2ed980){_0xf427da=_0xf427da-0x0;var _0x2408e9=_0x7ebb[_0xf427da];return _0x2408e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb7eb('0x0'))(_0xb7eb('0x1'));var moment=require('moment');var BPromise=require(_0xb7eb('0x2'));var rp=require(_0xb7eb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7eb('0x4'));var config=require(_0xb7eb('0x5'));var attributes=require(_0xb7eb('0x6'));module['exports']=function(_0x3a1f19,_0x13fab9){return _0x3a1f19[_0xb7eb('0x7')](_0xb7eb('0x8'),attributes,{'tableName':_0xb7eb('0x9'),'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 325c8ea..1275c5e 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 _0x4c6d=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x3f3aeb,_0x11a45b){var _0x2b3499=function(_0x47e1c3){while(--_0x47e1c3){_0x3f3aeb['push'](_0x3f3aeb['shift']());}};_0x2b3499(++_0x11a45b);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0xc7694b,_0x24ed38){_0xc7694b=_0xc7694b-0x0;var _0x5ae867=_0x4c6d[_0xc7694b];return _0x5ae867;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});} \ No newline at end of file +var _0x8a28=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x240156,_0x48d5a0){var _0x50c5ea=function(_0x353f44){while(--_0x353f44){_0x240156['push'](_0x240156['shift']());}};_0x50c5ea(++_0x48d5a0);}(_0x8a28,0xfd));var _0x88a2=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x8a28[_0x32d457];return _0x338386;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));var BPromise=require(_0x88a2('0x3'));var rs=require(_0x88a2('0x4'));var fs=require('fs');var Redis=require(_0x88a2('0x5'));var db=require(_0x88a2('0x6'))['db'];var utils=require(_0x88a2('0x7'));var logger=require('../../config/logger')(_0x88a2('0x8'));var config=require(_0x88a2('0x9'));var jayson=require(_0x88a2('0xa'));var client=jayson[_0x88a2('0xb')][_0x88a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cb591,_0x1629ea,_0x5406ed){return new BPromise(function(_0x1cdf6b,_0x2a8576){return client[_0x88a2('0xd')](_0x5cb591,_0x5406ed)[_0x88a2('0xe')](function(_0x2db7dd){logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));logger[_0x88a2('0x12')]('Tag,\x20%s,\x20%s,\x20%s',_0x1629ea,'request\x20sent',JSON[_0x88a2('0x13')](_0x2db7dd));if(_0x2db7dd[_0x88a2('0x14')]){if(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x15')]===0x1f4){logger[_0x88a2('0x14')]('Tag,\x20%s,\x20%s',_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x2a8576(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);}logger['error'](_0x88a2('0x10'),_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x1cdf6b(_0x2db7dd['error'][_0x88a2('0x16')]);}else{logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));_0x1cdf6b(_0x2db7dd[_0x88a2('0x17')][_0x88a2('0x16')]);}})[_0x88a2('0x18')](function(_0x2f5220){logger[_0x88a2('0x14')](_0x88a2('0x10'),_0x1629ea,_0x2f5220);_0x2a8576(_0x2f5220);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e136592..98d8d22 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(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 73cf22f..f355108 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 _0xbaf0=['name','exports','STRING'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x17c48e,_0x2bd0d9){var _0x38871b=function(_0x3dac82){while(--_0x3dac82){_0x17c48e['push'](_0x17c48e['shift']());}};_0x38871b(++_0x2bd0d9);}(_0x2032,0xd9));var _0x2203=function(_0x3dbdc0,_0x2f11fd){_0x3dbdc0=_0x3dbdc0-0x0;var _0x257c45=_0x2032[_0x3dbdc0];return _0x257c45;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 5422ba8..abfb1fc 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 _0x419d=['length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','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','UserSmsQueue','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','VoicePrefixId','sendStatus','getQueues','findOne','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','Queues','add','ids','removeQueues','isValidChannel','remove','capitalize','addAgents','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','through','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','online','voicePause','UserVoiceQueueRt','isNil','SIP/%s','interface','all','spread','removeAgents','isArray','Chat','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','query','intersection','attributes','fields'];(function(_0x5b02db,_0x1f371a){var _0x18ff8c=function(_0x470b9c){while(--_0x470b9c){_0x5b02db['push'](_0x5b02db['shift']());}};_0x18ff8c(++_0x1f371a);}(_0x419d,0x105));var _0xd419=function(_0x12c0b1,_0x1b5fb8){_0x12c0b1=_0x12c0b1-0x0;var _0x10b2ec=_0x419d[_0x12c0b1];return _0x10b2ec;};'use strict';var emlformat=require(_0xd419('0x0'));var rimraf=require(_0xd419('0x1'));var zipdir=require(_0xd419('0x2'));var jsonpatch=require(_0xd419('0x3'));var rp=require(_0xd419('0x4'));var moment=require(_0xd419('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd419('0x6'));var util=require('util');var path=require(_0xd419('0x7'));var sox=require('sox');var csv=require(_0xd419('0x8'));var ejs=require(_0xd419('0x9'));var fs=require('fs');var fs_extra=require(_0xd419('0xa'));var _=require(_0xd419('0xb'));var squel=require('squel');var crypto=require(_0xd419('0xc'));var jsforce=require(_0xd419('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd419('0x8'));var querystring=require('querystring');var Papa=require(_0xd419('0xe'));var Redis=require(_0xd419('0xf'));var authService=require(_0xd419('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd419('0x11'));var hardwareService=require(_0xd419('0x12'));var logger=require(_0xd419('0x13'))(_0xd419('0x14'));var utils=require('../../config/utils');var config=require(_0xd419('0x15'));var licenseUtil=require(_0xd419('0x16'));var db=require(_0xd419('0x17'))['db'];config[_0xd419('0x18')]=_[_0xd419('0x19')](config[_0xd419('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd419('0x1a'))(new Redis(config[_0xd419('0x18')]));require(_0xd419('0x1b'))[_0xd419('0x1c')](socket);function respondWithStatusCode(_0x256267,_0x3853b0){_0x3853b0=_0x3853b0||0xcc;return function(_0x242d25){if(_0x242d25){return _0x256267['sendStatus'](_0x3853b0);}return _0x256267[_0xd419('0x1d')](_0x3853b0)[_0xd419('0x1e')]();};}function respondWithResult(_0x2d1ba5,_0x482c88){_0x482c88=_0x482c88||0xc8;return function(_0x141dbe){if(_0x141dbe){return _0x2d1ba5[_0xd419('0x1d')](_0x482c88)[_0xd419('0x1f')](_0x141dbe);}};}function respondWithFilteredResult(_0x5addfa,_0x4a1343){return function(_0x159a27){if(_0x159a27){var _0x3dd64b=typeof _0x4a1343[_0xd419('0x20')]===_0xd419('0x21')&&typeof _0x4a1343['limit']==='undefined';var _0x3bd7c5=_0x159a27[_0xd419('0x22')];var _0x54992c=_0x3dd64b?0x0:_0x4a1343[_0xd419('0x20')];var _0x5f164e=_0x3dd64b?_0x159a27[_0xd419('0x22')]:_0x4a1343[_0xd419('0x20')]+_0x4a1343['limit'];var _0x4a5bea;if(_0x5f164e>=_0x3bd7c5){_0x5f164e=_0x3bd7c5;_0x4a5bea=0xc8;}else{_0x4a5bea=0xce;}_0x5addfa[_0xd419('0x1d')](_0x4a5bea);return _0x5addfa['set'](_0xd419('0x23'),_0x54992c+'-'+_0x5f164e+'/'+_0x3bd7c5)[_0xd419('0x1f')](_0x159a27);}return null;};}function patchUpdates(_0x148afc){return function(_0x2aaaeb){try{jsonpatch[_0xd419('0x24')](_0x2aaaeb,_0x148afc,!![]);}catch(_0x107421){return BPromise[_0xd419('0x25')](_0x107421);}return _0x2aaaeb[_0xd419('0x26')]();};}function saveUpdates(_0x375a96,_0x293339){return function(_0x1514da){if(_0x1514da){return _0x1514da['update'](_0x375a96)[_0xd419('0x27')](function(_0x24296c){return _0x24296c;});}return null;};}function handleEntityNotFound(_0xa49bf9,_0x5d8c4e){return function(_0xe92346){if(!_0xe92346){_0xa49bf9['sendStatus'](0x194);}return _0xe92346;};}function handleError(_0x2f957f,_0x10c193){_0x10c193=_0x10c193||0x1f4;return function(_0x2f9dbc){logger[_0xd419('0x28')](_0x2f9dbc[_0xd419('0x29')]);if(_0x2f9dbc[_0xd419('0x2a')]){delete _0x2f9dbc[_0xd419('0x2a')];}_0x2f957f['status'](_0x10c193)[_0xd419('0x2b')](_0x2f9dbc);};}exports[_0xd419('0x2c')]=function(_0x369f6e,_0x52d897){var _0x2af26e={},_0x1ae8c7={},_0x873cd5={'count':0x0,'rows':[]};var _0x3e0071=_[_0xd419('0x2d')](db[_0xd419('0x2e')][_0xd419('0x2f')],function(_0x2b3c72){return{'name':_0x2b3c72[_0xd419('0x30')],'type':_0x2b3c72['type'][_0xd419('0x31')]};});_0x1ae8c7[_0xd419('0x32')]=_[_0xd419('0x2d')](_0x3e0071,_0xd419('0x2a'));_0x1ae8c7['query']=_['keys'](_0x369f6e[_0xd419('0x33')]);_0x1ae8c7['filters']=_[_0xd419('0x34')](_0x1ae8c7[_0xd419('0x32')],_0x1ae8c7[_0xd419('0x33')]);_0x2af26e[_0xd419('0x35')]=_[_0xd419('0x34')](_0x1ae8c7['model'],qs[_0xd419('0x36')](_0x369f6e[_0xd419('0x33')][_0xd419('0x36')]));_0x2af26e[_0xd419('0x35')]=_0x2af26e[_0xd419('0x35')][_0xd419('0x37')]?_0x2af26e[_0xd419('0x35')]:_0x1ae8c7[_0xd419('0x32')];if(!_0x369f6e[_0xd419('0x33')][_0xd419('0x38')](_0xd419('0x39'))){_0x2af26e[_0xd419('0x3a')]=qs['limit'](_0x369f6e[_0xd419('0x33')][_0xd419('0x3a')]);_0x2af26e[_0xd419('0x20')]=qs[_0xd419('0x20')](_0x369f6e[_0xd419('0x33')][_0xd419('0x20')]);}_0x2af26e[_0xd419('0x3b')]=qs[_0xd419('0x3c')](_0x369f6e['query'][_0xd419('0x3c')]);_0x2af26e[_0xd419('0x3d')]=qs[_0xd419('0x3e')](_[_0xd419('0x3f')](_0x369f6e[_0xd419('0x33')],_0x1ae8c7[_0xd419('0x3e')]),_0x3e0071);if(_0x369f6e[_0xd419('0x33')]['filter']){_0x2af26e[_0xd419('0x3d')]=_[_0xd419('0x40')](_0x2af26e[_0xd419('0x3d')],{'$or':_[_0xd419('0x2d')](_0x3e0071,function(_0x3fdaa5){if(_0x3fdaa5[_0xd419('0x41')]!==_0xd419('0x42')){var _0x3286ff={};_0x3286ff[_0x3fdaa5[_0xd419('0x2a')]]={'$like':'%'+_0x369f6e['query'][_0xd419('0x43')]+'%'};return _0x3286ff;}})});}_0x2af26e=_[_0xd419('0x40')]({},_0x2af26e,_0x369f6e[_0xd419('0x44')]);var _0x5d9801={'where':_0x2af26e[_0xd419('0x3d')]};return db['Team'][_0xd419('0x22')](_0x5d9801)['then'](function(_0x2d7d41){_0x873cd5['count']=_0x2d7d41;if(_0x369f6e[_0xd419('0x33')][_0xd419('0x45')]){_0x2af26e[_0xd419('0x46')]=[{'all':!![]}];}return db['Team'][_0xd419('0x47')](_0x2af26e);})['then'](function(_0x3e6603){_0x873cd5['rows']=_0x3e6603;return _0x873cd5;})[_0xd419('0x27')](respondWithFilteredResult(_0x52d897,_0x2af26e))[_0xd419('0x48')](handleError(_0x52d897,null));};exports[_0xd419('0x49')]=function(_0x3893c7,_0xfdb7b0){var _0x44fc5e={'raw':![],'where':{'id':_0x3893c7[_0xd419('0x4a')]['id']}},_0x5495bc={};_0x5495bc[_0xd419('0x32')]=_[_0xd419('0x4b')](db[_0xd419('0x2e')][_0xd419('0x2f')]);_0x5495bc[_0xd419('0x33')]=_[_0xd419('0x4b')](_0x3893c7[_0xd419('0x33')]);_0x5495bc['filters']=_[_0xd419('0x34')](_0x5495bc['model'],_0x5495bc[_0xd419('0x33')]);_0x44fc5e[_0xd419('0x35')]=_[_0xd419('0x34')](_0x5495bc[_0xd419('0x32')],qs[_0xd419('0x36')](_0x3893c7['query'][_0xd419('0x36')]));_0x44fc5e[_0xd419('0x35')]=_0x44fc5e[_0xd419('0x35')][_0xd419('0x37')]?_0x44fc5e[_0xd419('0x35')]:_0x5495bc[_0xd419('0x32')];if(_0x3893c7['query'][_0xd419('0x45')]){_0x44fc5e[_0xd419('0x46')]=[{'all':!![]}];}_0x44fc5e=_[_0xd419('0x40')]({},_0x44fc5e,_0x3893c7['options']);return db['Team'][_0xd419('0x4c')](_0x44fc5e)[_0xd419('0x27')](handleEntityNotFound(_0xfdb7b0,null))[_0xd419('0x27')](respondWithResult(_0xfdb7b0,null))[_0xd419('0x48')](handleError(_0xfdb7b0,null));};exports[_0xd419('0x4d')]=function(_0x33a529,_0x6b1ec0){return db[_0xd419('0x2e')][_0xd419('0x4d')](_0x33a529['body'],{})[_0xd419('0x27')](function(_0x5c3b8d){var _0x358128=_0x33a529[_0xd419('0x4e')][_0xd419('0x4f')]({'plain':!![]});if(!_0x358128)throw new Error(_0xd419('0x50'));if(_0x358128[_0xd419('0x51')]===_0xd419('0x4e')){var _0xb3f6a2=_0x5c3b8d[_0xd419('0x4f')]({'plain':!![]});var _0x5b0150=_0xd419('0x52');return db[_0xd419('0x53')][_0xd419('0x4c')]({'where':{'name':_0x5b0150,'userProfileId':_0x358128[_0xd419('0x54')]},'raw':!![]})[_0xd419('0x27')](function(_0x214e55){if(_0x214e55&&_0x214e55[_0xd419('0x55')]===0x0){return db[_0xd419('0x56')][_0xd419('0x4d')]({'name':_0xb3f6a2['name'],'resourceId':_0xb3f6a2['id'],'type':_0x214e55[_0xd419('0x2a')],'sectionId':_0x214e55['id']},{})[_0xd419('0x27')](function(){return _0x5c3b8d;});}else{return _0x5c3b8d;}})[_0xd419('0x48')](function(_0x454361){logger[_0xd419('0x28')](_0xd419('0x57'),_0x454361);throw _0x454361;});}return _0x5c3b8d;})['then'](respondWithResult(_0x6b1ec0,0xc9))[_0xd419('0x48')](handleError(_0x6b1ec0,null));};exports['update']=function(_0x26aada,_0x283b84){if(_0x26aada[_0xd419('0x58')]['id']){delete _0x26aada[_0xd419('0x58')]['id'];}return db[_0xd419('0x2e')]['find']({'where':{'id':_0x26aada[_0xd419('0x4a')]['id']}})['then'](handleEntityNotFound(_0x283b84,null))[_0xd419('0x27')](saveUpdates(_0x26aada['body'],null))[_0xd419('0x27')](respondWithResult(_0x283b84,null))[_0xd419('0x48')](handleError(_0x283b84,null));};exports[_0xd419('0x59')]=function(_0x545b02,_0x1db79d){var _0x453edd=_0x545b02['params']['id'];var _0x1f0b5a=[];return db[_0xd419('0x5a')]['transaction'](function(_0x33ed8b){var _0x27bf61=_0xd419('0x5b')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x27bf61,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b})['then'](function(_0x129ae8){_0x1f0b5a=_[_0xd419('0x2d')](_0x129ae8,function(_0x5e1ffa){return Number(_0x5e1ffa['UserId']);});})[_0xd419('0x27')](function(){var _0x58bc4a=_0xd419('0x5f')+_0x453edd;return db['sequelize'][_0xd419('0x33')](_0x58bc4a,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x46d091){var _0x1400c2=_['map'](_0x46d091,function(_0x1ec6c9){return Number(_0x1ec6c9[_0xd419('0x60')]);});return db[_0xd419('0x61')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'VoiceQueueId':{'$in':_0x1400c2}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x5efedc=_0xd419('0x62')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x5efedc,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x2cc5d5){var _0x1e25f7=_[_0xd419('0x2d')](_0x2cc5d5,function(_0x225df6){return Number(_0x225df6[_0xd419('0x63')]);});return db[_0xd419('0x64')]['destroy']({'where':{'UserId':{'$in':_0x1f0b5a},'MailQueueId':{'$in':_0x1e25f7}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x34033b=_0xd419('0x65')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x34033b,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')]['SELECT'],'raw':!![],'transaction':_0x33ed8b});})['then'](function(_0x12bb7c){var _0x29a260=_[_0xd419('0x2d')](_0x12bb7c,function(_0x21bfa5){return Number(_0x21bfa5['SmsQueueId']);});return db[_0xd419('0x66')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'SmsQueueId':{'$in':_0x29a260}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x2c55ff='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x2c55ff,{'type':db['Sequelize'][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x49fd71){var _0x4d0ca1=_[_0xd419('0x2d')](_0x49fd71,function(_0x3b0f52){return Number(_0x3b0f52['ChatQueueId']);});return db[_0xd419('0x67')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'ChatQueueId':{'$in':_0x4d0ca1}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x4f09da=_0xd419('0x68')+_0x453edd;return db['sequelize']['query'](_0x4f09da,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0xb790db){var _0x7a4619=_[_0xd419('0x2d')](_0xb790db,function(_0x4ee775){return Number(_0x4ee775[_0xd419('0x69')]);});return db[_0xd419('0x6a')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'FaxQueueId':{'$in':_0x7a4619}},'transaction':_0x33ed8b});})['then'](function(){var _0x3a7303=_0xd419('0x6b')+_0x453edd;return db[_0xd419('0x5a')][_0xd419('0x33')](_0x3a7303,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})['then'](function(_0x4caabc){var _0x558a40=_[_0xd419('0x2d')](_0x4caabc,function(_0x934a7d){return Number(_0x934a7d[_0xd419('0x6c')]);});return db[_0xd419('0x6d')][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'OpenchannelQueueId':{'$in':_0x558a40}},'transaction':_0x33ed8b});})[_0xd419('0x27')](function(){var _0x5ef70e=_0xd419('0x6e')+_0x453edd;return db['sequelize'][_0xd419('0x33')](_0x5ef70e,{'type':db[_0xd419('0x5c')][_0xd419('0x5d')][_0xd419('0x5e')],'raw':!![],'transaction':_0x33ed8b});})['then'](function(_0x4e8320){var _0xa99d3d=_[_0xd419('0x2d')](_0x4e8320,function(_0x2aa67b){return Number(_0x2aa67b[_0xd419('0x6f')]);});return db['UserWhatsappQueue'][_0xd419('0x59')]({'where':{'UserId':{'$in':_0x1f0b5a},'WhatsappQueueId':{'$in':_0xa99d3d}},'transaction':_0x33ed8b});})['then'](function(){return db[_0xd419('0x70')][_0xd419('0x4c')]({'where':{'TeamId':_0x453edd}});})[_0xd419('0x27')](function(_0x513c96){if(_0x513c96===null){return;}return db[_0xd419('0x71')]['destroy']({'where':{'UserId':{'$in':_0x1f0b5a},'VoicePrefixId':_0x513c96[_0xd419('0x72')]},'transaction':_0x33ed8b});})['then'](function(){return db[_0xd419('0x2e')]['destroy']({'where':{'id':_0x453edd},'cascade':!![],'transaction':_0x33ed8b});})[_0xd419('0x27')](function(_0x1f6cb8){if(_0x1f6cb8===0x0){_0x1db79d[_0xd419('0x73')](0x194);}else{return db[_0xd419('0x56')][_0xd419('0x59')]({'where':{'type':_0xd419('0x52'),'resourceId':_0x453edd},'cascade':!![],'transaction':_0x33ed8b})[_0xd419('0x27')](function(){_0x1db79d[_0xd419('0x1d')](0xcc)['end']();});}})[_0xd419('0x48')](function(_0x39514f){_0x1db79d['status'](0x1f4)[_0xd419('0x2b')](_0x39514f);});});};exports[_0xd419('0x74')]=function(_0x52a9c2,_0x3b3b80,_0x314688){return db['Team'][_0xd419('0x75')]({'where':{'id':_0x52a9c2['params']['id']}})[_0xd419('0x27')](handleEntityNotFound(_0x3b3b80,null))[_0xd419('0x27')](function(_0x1f94c4){if(!_0x52a9c2['query'][_0xd419('0x76')]||!utils['isValidChannel'](_0x52a9c2['query'][_0xd419('0x76')])){throw new db[(_0xd419('0x5c'))][(_0xd419('0x77'))](_0xd419('0x78'));}var _0x39c22b={};var _0x4b095d={};_0x4b095d[_0xd419('0x32')]=_['keys'](db[_['capitalize'](_0x52a9c2['query'][_0xd419('0x76')][_0xd419('0x79')]())+_0xd419('0x7a')][_0xd419('0x2f')]);_0x4b095d[_0xd419('0x33')]=_['keys'](_0x52a9c2[_0xd419('0x33')]);_0x4b095d['filters']=_['intersection'](_0x4b095d[_0xd419('0x32')],_0x4b095d[_0xd419('0x33')]);_0x39c22b[_0xd419('0x35')]=_['intersection'](_0x4b095d[_0xd419('0x32')],qs['fields'](_0x52a9c2['query'][_0xd419('0x36')]));_0x39c22b[_0xd419('0x35')]=_0x39c22b[_0xd419('0x35')][_0xd419('0x37')]?_0x39c22b[_0xd419('0x35')]:_0x4b095d[_0xd419('0x32')];_0x39c22b['limit']=qs[_0xd419('0x3a')](_0x52a9c2[_0xd419('0x33')][_0xd419('0x3a')]);_0x39c22b['offset']=qs[_0xd419('0x20')](_0x52a9c2[_0xd419('0x33')][_0xd419('0x20')]);_0x39c22b[_0xd419('0x3b')]=qs[_0xd419('0x3c')](_0x52a9c2[_0xd419('0x33')][_0xd419('0x3c')]);_0x39c22b[_0xd419('0x3d')]=qs[_0xd419('0x3e')](_[_0xd419('0x3f')](_0x52a9c2['query'],_0x4b095d[_0xd419('0x3e')]));_0x39c22b=_[_0xd419('0x40')]({},_0x39c22b,_0x52a9c2[_0xd419('0x44')]);return _0x1f94c4[_0xd419('0x4f')+_['capitalize'](_0x52a9c2['query'][_0xd419('0x76')][_0xd419('0x79')]())+_0xd419('0x7b')](_0x39c22b);})[_0xd419('0x27')](respondWithResult(_0x3b3b80,null))[_0xd419('0x48')](handleError(_0x3b3b80,null));};exports['addQueues']=function(_0x5b3420,_0x4f7a7b,_0x441852){return db[_0xd419('0x2e')][_0xd419('0x75')]({'where':{'id':_0x5b3420['params']['id']}})[_0xd419('0x27')](function(_0x2733ca){if(_0x2733ca){if(!_0x5b3420[_0xd419('0x58')]['channel']||!utils['isValidChannel'](_0x5b3420[_0xd419('0x58')][_0xd419('0x76')])){throw new db[(_0xd419('0x5c'))][(_0xd419('0x77'))](_0xd419('0x78'));}return _0x2733ca[_0xd419('0x7c')+_['capitalize'](_0x5b3420['body'][_0xd419('0x76')]['toLowerCase']())+_0xd419('0x7b')](_0x5b3420['body'][_0xd419('0x7d')]);}return null;})['then'](handleEntityNotFound(_0x4f7a7b,null))[_0xd419('0x27')](respondWithStatusCode(_0x4f7a7b,null))[_0xd419('0x48')](handleError(_0x4f7a7b,null));};exports[_0xd419('0x7e')]=function(_0x10a4ef,_0x21b82c,_0xac28e1){return db[_0xd419('0x2e')]['findOne']({'where':{'id':_0x10a4ef['params']['id']}})['then'](function(_0x26e7af){if(_0x26e7af){if(!_0x10a4ef[_0xd419('0x33')][_0xd419('0x76')]||!utils[_0xd419('0x7f')](_0x10a4ef[_0xd419('0x33')]['channel'])){throw new db[(_0xd419('0x5c'))]['ValidationError'](_0xd419('0x78'));}return _0x26e7af[_0xd419('0x80')+_[_0xd419('0x81')](_0x10a4ef[_0xd419('0x33')][_0xd419('0x76')][_0xd419('0x79')]())+_0xd419('0x7b')](_0x10a4ef[_0xd419('0x33')][_0xd419('0x7d')]);}return null;})['then'](handleEntityNotFound(_0x21b82c,null))[_0xd419('0x27')](respondWithStatusCode(_0x21b82c,null))[_0xd419('0x48')](handleError(_0x21b82c,null));};exports[_0xd419('0x82')]=function(_0x5094d4,_0x533dfb){var _0x29e2dc=_['isArray'](_0x5094d4[_0xd419('0x58')][_0xd419('0x7d')])?_0x5094d4[_0xd419('0x58')][_0xd419('0x7d')]:[_0x5094d4['body'][_0xd419('0x7d')]];var _0x429dbd=_0x5094d4[_0xd419('0x4a')]['id'];return db[_0xd419('0x2e')][_0xd419('0x4c')]({'where':{'id':_0x429dbd}})[_0xd419('0x27')](handleEntityNotFound(_0x533dfb,null))['then'](function(_0xc0ef62){if(_0xc0ef62){var _0x2090fd=['Voice','Chat',_0xd419('0x83'),_0xd419('0x84'),_0xd419('0x85'),_0xd419('0x86'),_0xd419('0x87')];return db[_0xd419('0x5a')][_0xd419('0x88')](function(_0x5c67e2){var _0x2bf1c7=_['map'](_0x2090fd,function(_0x2fdaaf){var _0x1747ff={'attributes':['id',_0xd419('0x2a')]};if(_0x2fdaaf===_0xd419('0x89')){_0x1747ff[_0xd419('0x8a')]={'attributes':[_0xd419('0x8b')]};}return _0xc0ef62[_0xd419('0x4f')+_0x2fdaaf+_0xd419('0x7b')](_0x1747ff)[_0xd419('0x27')](function(_0x43e616){var _0x13d113=_[_0xd419('0x2d')](_0x43e616,function(_0x10aef0){var _0x5e4696=_[_0xd419('0x2d')](_0x29e2dc,function(_0xbac421){var _0x291ee5={'where':{'UserId':_0xbac421,[_0x2fdaaf+_0xd419('0x8c')]:_0x10aef0['id']},'transaction':_0x5c67e2};if(_0x2fdaaf===_0xd419('0x89')){_0x291ee5[_0xd419('0x19')]={'penalty':_0x10aef0[_0xd419('0x8d')]['penalty']};}return db[_0xd419('0x8e')+_0x2fdaaf+'Queue']['findOrCreate'](_0x291ee5)[_0xd419('0x27')](function(){socket[_0xd419('0x8f')]('user'+_0x2fdaaf+_0xd419('0x90'),{'UserId':_0xbac421,[_0x2fdaaf+_0xd419('0x8c')]:_0x10aef0['id']});if(_0x2fdaaf!=='Voice'){return;}return db[_0xd419('0x8e')][_0xd419('0x47')]({'where':{'id':_0x29e2dc,'online':0x1},'attributes':['id',_0xd419('0x2a'),_0xd419('0x91'),_0xd419('0x92'),'interface'],'raw':!![]})[_0xd419('0x27')](function(_0x106767){var _0x1d182c=_['map'](_0x106767,function(_0x414dd4){return db[_0xd419('0x93')]['upsert']({'membername':_0x414dd4['name'],'UserId':_0x414dd4['id'],'queue_name':_0x10aef0['name'],'VoiceQueueId':_0x10aef0['id'],'interface':_[_0xd419('0x94')](_0x414dd4['interface'])?util['format'](_0xd419('0x95'),_0x414dd4['name']):_0x414dd4[_0xd419('0x96')],'paused':_0x414dd4['voicePause']||![],'penalty':_0x10aef0[_0xd419('0x8d')][_0xd419('0x8b')]},{'transaction':_0x5c67e2});});return Promise[_0xd419('0x97')](_0x1d182c);});});});return Promise[_0xd419('0x97')](_0x5e4696);});return Promise[_0xd419('0x97')](_0x13d113);})[_0xd419('0x27')](function(){return db[_0xd419('0x70')][_0xd419('0x75')]({'where':{'teamId':_0x429dbd}})[_0xd419('0x27')](function(_0x38abba){if(_0x38abba){var _0x4a0bc1=_[_0xd419('0x2d')](_0x29e2dc,function(_0x5468a1){db[_0xd419('0x71')]['upsert']({'UserId':_0x5468a1,'VoicePrefixId':_0x38abba[_0xd419('0x72')]});});return Promise[_0xd419('0x97')](_0x4a0bc1);}});});});return Promise[_0xd419('0x97')](_0x2bf1c7)[_0xd419('0x27')](function(){return _0xc0ef62[_0xd419('0x82')](_0x29e2dc,{'transaction':_0x5c67e2})[_0xd419('0x98')](function(_0xa83a1c){return _0xa83a1c;});});});}})['then'](respondWithResult(_0x533dfb,null))['catch'](handleError(_0x533dfb,null));};exports[_0xd419('0x99')]=function(_0x23054e,_0x23ac92){var _0xf3f16d=_[_0xd419('0x9a')](_0x23054e['query'][_0xd419('0x7d')])?_0x23054e['query']['ids']:[_0x23054e[_0xd419('0x33')]['ids']];var _0x7d8bbd=_0x23054e[_0xd419('0x4a')]['id'];return db['Team']['find']({'where':{'id':_0x7d8bbd}})[_0xd419('0x27')](handleEntityNotFound(_0x23ac92,null))[_0xd419('0x27')](function(_0x427213){if(_0x427213){var _0x13d5b8=[_0xd419('0x89'),_0xd419('0x9b'),_0xd419('0x83'),_0xd419('0x84'),_0xd419('0x85'),_0xd419('0x86'),_0xd419('0x87')];return db[_0xd419('0x5a')]['transaction'](function(_0x510b86){var _0x28c1eb=_[_0xd419('0x2d')](_0x13d5b8,function(_0x4c21e9){var _0xb9888d={'attributes':['id',_0xd419('0x2a')]};return _0x427213[_0xd419('0x4f')+_0x4c21e9+'Queues'](_0xb9888d)[_0xd419('0x27')](function(_0x567597){var _0x27cb59=_[_0xd419('0x2d')](_0x567597,function(_0x25ca15){return _0x25ca15[_0xd419('0x99')](_0xf3f16d,{'transaction':_0x510b86})['then'](function(){var _0x169d2b=_[_0xd419('0x2d')](_0xf3f16d,function(_0x5f0145){socket['emit'](_0xd419('0x4e')+_0x4c21e9+_0xd419('0x9c'),{'UserId':Number(_0x5f0145),[_0x4c21e9+'QueueId']:_0x25ca15['id']});if(_0x4c21e9!==_0xd419('0x89')){return;}return db[_0xd419('0x93')][_0xd419('0x59')]({'where':{'VoiceQueueId':_0x25ca15['id'],'UserId':_0x5f0145},'transaction':_0x510b86});});return Promise[_0xd419('0x97')](_0x169d2b);});});return Promise[_0xd419('0x97')](_0x27cb59);});});return Promise[_0xd419('0x97')](_0x28c1eb)['then'](function(){return _0x427213[_0xd419('0x99')](_0xf3f16d,{'transaction':_0x510b86});})[_0xd419('0x27')](function(){return db['TeamVoicePrefix'][_0xd419('0x75')]({'where':{'teamId':_0x7d8bbd}})[_0xd419('0x27')](function(_0x3c264d){if(_0x3c264d){var _0xabbeab=_[_0xd419('0x2d')](_0xf3f16d,function(_0x4cb58f){db['UserVoicePrefix'][_0xd419('0x59')]({'where':{'UserId':_0x4cb58f,'VoicePrefixId':_0x3c264d[_0xd419('0x72')]}});});return Promise[_0xd419('0x97')](_0xabbeab);}});});});}})['then'](respondWithStatusCode(_0x23ac92,null))[_0xd419('0x48')](handleError(_0x23ac92,null));};exports['getAgents']=function(_0xe312ac,_0x52bc2b,_0x5d27cd){var _0x4d01f0={};var _0x305822={};var _0x74ce36;var _0x231290;return db[_0xd419('0x2e')][_0xd419('0x75')]({'where':{'id':_0xe312ac['params']['id']}})[_0xd419('0x27')](handleEntityNotFound(_0x52bc2b,null))['then'](function(_0x59c089){if(_0x59c089){_0x74ce36=_0x59c089;_0x305822[_0xd419('0x32')]=_['keys'](db['User'][_0xd419('0x2f')]);_0x305822['query']=_['keys'](_0xe312ac[_0xd419('0x33')]);_0x305822[_0xd419('0x3e')]=_[_0xd419('0x34')](_0x305822['model'],_0x305822[_0xd419('0x33')]);_0x4d01f0['attributes']=_[_0xd419('0x34')](_0x305822['model'],qs['fields'](_0xe312ac[_0xd419('0x33')][_0xd419('0x36')]));_0x4d01f0[_0xd419('0x35')]=_0x4d01f0[_0xd419('0x35')][_0xd419('0x37')]?_0x4d01f0[_0xd419('0x35')]:_0x305822[_0xd419('0x32')];_0x4d01f0['order']=qs[_0xd419('0x3c')](_0xe312ac[_0xd419('0x33')]['sort']);_0x4d01f0['where']=qs[_0xd419('0x3e')](_[_0xd419('0x3f')](_0xe312ac[_0xd419('0x33')],_0x305822[_0xd419('0x3e')]));if(_0xe312ac[_0xd419('0x33')][_0xd419('0x43')]){_0x4d01f0[_0xd419('0x3d')]=_[_0xd419('0x40')](_0x4d01f0['where'],{'$or':_[_0xd419('0x2d')](_0x4d01f0[_0xd419('0x35')],function(_0x53f5b9){var _0x44835b={};_0x44835b[_0x53f5b9]={'$like':'%'+_0xe312ac[_0xd419('0x33')][_0xd419('0x43')]+'%'};return _0x44835b;})});}_0x4d01f0=_[_0xd419('0x40')]({},_0x4d01f0,_0xe312ac[_0xd419('0x44')]);return _0x74ce36[_0xd419('0x9d')](_0x4d01f0);}})[_0xd419('0x27')](function(_0x3e3c9a){if(_0x3e3c9a){_0x231290=_0x3e3c9a['length'];if(!_0xe312ac[_0xd419('0x33')]['hasOwnProperty'](_0xd419('0x39'))){_0x4d01f0[_0xd419('0x3a')]=qs[_0xd419('0x3a')](_0xe312ac[_0xd419('0x33')][_0xd419('0x3a')]);_0x4d01f0[_0xd419('0x20')]=qs[_0xd419('0x20')](_0xe312ac['query'][_0xd419('0x20')]);}return _0x74ce36['getAgents'](_0x4d01f0);}})[_0xd419('0x27')](function(_0xa3ee53){if(_0xa3ee53){return _0xa3ee53?{'count':_0x231290,'rows':_0xa3ee53}:null;}})[_0xd419('0x27')](respondWithResult(_0x52bc2b,null))['catch'](handleError(_0x52bc2b,null));}; \ No newline at end of file +var _0xa69f=['to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','undefined','limit','count','offset','set','apply','reject','save','then','stack','name','send','index','map','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','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','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','isValidChannel','channel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','ValidationError','add','ids','removeQueues','addAgents','Voice','Chat','Sms','Fax','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','Queue:save','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','voicePause','all','spread','removeAgents','Mail','emit','pick','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0x5d6f9d,_0x394054){var _0x197bca=function(_0x4217fd){while(--_0x4217fd){_0x5d6f9d['push'](_0x5d6f9d['shift']());}};_0x197bca(++_0x394054);}(_0xa69f,0x12e));var _0xfa69=function(_0x941ad0,_0xd91c91){_0x941ad0=_0x941ad0-0x0;var _0x202a85=_0xa69f[_0x941ad0];return _0x202a85;};'use strict';var emlformat=require(_0xfa69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa69('0x1'));var jsonpatch=require(_0xfa69('0x2'));var rp=require(_0xfa69('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa69('0x4'));var util=require(_0xfa69('0x5'));var path=require(_0xfa69('0x6'));var sox=require(_0xfa69('0x7'));var csv=require(_0xfa69('0x8'));var ejs=require(_0xfa69('0x9'));var fs=require('fs');var fs_extra=require(_0xfa69('0xa'));var _=require(_0xfa69('0xb'));var squel=require('squel');var crypto=require(_0xfa69('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfa69('0xd'));var toCsv=require(_0xfa69('0x8'));var querystring=require(_0xfa69('0xe'));var Papa=require(_0xfa69('0xf'));var Redis=require(_0xfa69('0x10'));var authService=require(_0xfa69('0x11'));var qs=require(_0xfa69('0x12'));var as=require(_0xfa69('0x13'));var hardwareService=require(_0xfa69('0x14'));var logger=require('../../config/logger')(_0xfa69('0x15'));var utils=require(_0xfa69('0x16'));var config=require(_0xfa69('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa69('0x18'))['db'];config[_0xfa69('0x19')]=_[_0xfa69('0x1a')](config[_0xfa69('0x19')],{'host':_0xfa69('0x1b'),'port':0x18eb});var socket=require(_0xfa69('0x1c'))(new Redis(config['redis']));require(_0xfa69('0x1d'))[_0xfa69('0x1e')](socket);function respondWithStatusCode(_0x478293,_0x26e40c){_0x26e40c=_0x26e40c||0xcc;return function(_0x5211e6){if(_0x5211e6){return _0x478293[_0xfa69('0x1f')](_0x26e40c);}return _0x478293[_0xfa69('0x20')](_0x26e40c)['end']();};}function respondWithResult(_0x5a007c,_0x5d43d7){_0x5d43d7=_0x5d43d7||0xc8;return function(_0x58a192){if(_0x58a192){return _0x5a007c[_0xfa69('0x20')](_0x5d43d7)['json'](_0x58a192);}};}function respondWithFilteredResult(_0x5eac2c,_0x28d250){return function(_0x66c37c){if(_0x66c37c){var _0x42d316=typeof _0x28d250['offset']===_0xfa69('0x21')&&typeof _0x28d250[_0xfa69('0x22')]===_0xfa69('0x21');var _0x4e79f6=_0x66c37c[_0xfa69('0x23')];var _0x23ff42=_0x42d316?0x0:_0x28d250['offset'];var _0xf07e84=_0x42d316?_0x66c37c['count']:_0x28d250[_0xfa69('0x24')]+_0x28d250[_0xfa69('0x22')];var _0x530d01;if(_0xf07e84>=_0x4e79f6){_0xf07e84=_0x4e79f6;_0x530d01=0xc8;}else{_0x530d01=0xce;}_0x5eac2c['status'](_0x530d01);return _0x5eac2c[_0xfa69('0x25')]('Content-Range',_0x23ff42+'-'+_0xf07e84+'/'+_0x4e79f6)['json'](_0x66c37c);}return null;};}function patchUpdates(_0x5f44e8){return function(_0x52b9eb){try{jsonpatch[_0xfa69('0x26')](_0x52b9eb,_0x5f44e8,!![]);}catch(_0x1aa5e1){return BPromise[_0xfa69('0x27')](_0x1aa5e1);}return _0x52b9eb[_0xfa69('0x28')]();};}function saveUpdates(_0x4a1b2c,_0x1c48e7){return function(_0x3eba20){if(_0x3eba20){return _0x3eba20['update'](_0x4a1b2c)[_0xfa69('0x29')](function(_0x1f9a9a){return _0x1f9a9a;});}return null;};}function handleEntityNotFound(_0x15d9a2,_0x24afbf){return function(_0x40df15){if(!_0x40df15){_0x15d9a2[_0xfa69('0x1f')](0x194);}return _0x40df15;};}function handleError(_0x259a6d,_0x379763){_0x379763=_0x379763||0x1f4;return function(_0x5b6ef9){logger['error'](_0x5b6ef9[_0xfa69('0x2a')]);if(_0x5b6ef9[_0xfa69('0x2b')]){delete _0x5b6ef9[_0xfa69('0x2b')];}_0x259a6d[_0xfa69('0x20')](_0x379763)[_0xfa69('0x2c')](_0x5b6ef9);};}exports[_0xfa69('0x2d')]=function(_0x3d7ac7,_0x7b1fd9){var _0x3d6dfa={},_0x49825c={},_0x3eeef4={'count':0x0,'rows':[]};var _0x424b74=_[_0xfa69('0x2e')](db['Team']['rawAttributes'],function(_0x556fa5){return{'name':_0x556fa5[_0xfa69('0x2f')],'type':_0x556fa5[_0xfa69('0x30')][_0xfa69('0x31')]};});_0x49825c['model']=_[_0xfa69('0x2e')](_0x424b74,_0xfa69('0x2b'));_0x49825c['query']=_[_0xfa69('0x32')](_0x3d7ac7[_0xfa69('0x33')]);_0x49825c[_0xfa69('0x34')]=_['intersection'](_0x49825c[_0xfa69('0x35')],_0x49825c[_0xfa69('0x33')]);_0x3d6dfa[_0xfa69('0x36')]=_[_0xfa69('0x37')](_0x49825c[_0xfa69('0x35')],qs[_0xfa69('0x38')](_0x3d7ac7[_0xfa69('0x33')][_0xfa69('0x38')]));_0x3d6dfa[_0xfa69('0x36')]=_0x3d6dfa['attributes'][_0xfa69('0x39')]?_0x3d6dfa[_0xfa69('0x36')]:_0x49825c[_0xfa69('0x35')];if(!_0x3d7ac7[_0xfa69('0x33')][_0xfa69('0x3a')]('nolimit')){_0x3d6dfa['limit']=qs['limit'](_0x3d7ac7[_0xfa69('0x33')]['limit']);_0x3d6dfa[_0xfa69('0x24')]=qs['offset'](_0x3d7ac7[_0xfa69('0x33')][_0xfa69('0x24')]);}_0x3d6dfa[_0xfa69('0x3b')]=qs[_0xfa69('0x3c')](_0x3d7ac7[_0xfa69('0x33')][_0xfa69('0x3c')]);_0x3d6dfa[_0xfa69('0x3d')]=qs['filters'](_['pick'](_0x3d7ac7[_0xfa69('0x33')],_0x49825c[_0xfa69('0x34')]),_0x424b74);if(_0x3d7ac7[_0xfa69('0x33')][_0xfa69('0x3e')]){_0x3d6dfa[_0xfa69('0x3d')]=_[_0xfa69('0x3f')](_0x3d6dfa[_0xfa69('0x3d')],{'$or':_['map'](_0x424b74,function(_0x3aa0d2){if(_0x3aa0d2[_0xfa69('0x30')]!==_0xfa69('0x40')){var _0x149ff9={};_0x149ff9[_0x3aa0d2['name']]={'$like':'%'+_0x3d7ac7['query']['filter']+'%'};return _0x149ff9;}})});}_0x3d6dfa=_['merge']({},_0x3d6dfa,_0x3d7ac7[_0xfa69('0x41')]);var _0x1c4099={'where':_0x3d6dfa[_0xfa69('0x3d')]};return db[_0xfa69('0x42')][_0xfa69('0x23')](_0x1c4099)[_0xfa69('0x29')](function(_0x419238){_0x3eeef4[_0xfa69('0x23')]=_0x419238;if(_0x3d7ac7['query'][_0xfa69('0x43')]){_0x3d6dfa[_0xfa69('0x44')]=[{'all':!![]}];}return db[_0xfa69('0x42')][_0xfa69('0x45')](_0x3d6dfa);})[_0xfa69('0x29')](function(_0x4edbd1){_0x3eeef4[_0xfa69('0x46')]=_0x4edbd1;return _0x3eeef4;})[_0xfa69('0x29')](respondWithFilteredResult(_0x7b1fd9,_0x3d6dfa))[_0xfa69('0x47')](handleError(_0x7b1fd9,null));};exports[_0xfa69('0x48')]=function(_0x3d8878,_0x5dbaf7){var _0x517012={'raw':![],'where':{'id':_0x3d8878[_0xfa69('0x49')]['id']}},_0x35e0ad={};_0x35e0ad[_0xfa69('0x35')]=_[_0xfa69('0x32')](db[_0xfa69('0x42')][_0xfa69('0x4a')]);_0x35e0ad['query']=_[_0xfa69('0x32')](_0x3d8878[_0xfa69('0x33')]);_0x35e0ad[_0xfa69('0x34')]=_['intersection'](_0x35e0ad['model'],_0x35e0ad[_0xfa69('0x33')]);_0x517012['attributes']=_['intersection'](_0x35e0ad[_0xfa69('0x35')],qs[_0xfa69('0x38')](_0x3d8878[_0xfa69('0x33')][_0xfa69('0x38')]));_0x517012[_0xfa69('0x36')]=_0x517012[_0xfa69('0x36')][_0xfa69('0x39')]?_0x517012[_0xfa69('0x36')]:_0x35e0ad[_0xfa69('0x35')];if(_0x3d8878[_0xfa69('0x33')][_0xfa69('0x43')]){_0x517012[_0xfa69('0x44')]=[{'all':!![]}];}_0x517012=_[_0xfa69('0x3f')]({},_0x517012,_0x3d8878[_0xfa69('0x41')]);return db[_0xfa69('0x42')][_0xfa69('0x4b')](_0x517012)[_0xfa69('0x29')](handleEntityNotFound(_0x5dbaf7,null))[_0xfa69('0x29')](respondWithResult(_0x5dbaf7,null))[_0xfa69('0x47')](handleError(_0x5dbaf7,null));};exports[_0xfa69('0x4c')]=function(_0x5ec0f0,_0x5f92ca){return db['Team'][_0xfa69('0x4c')](_0x5ec0f0[_0xfa69('0x4d')],{})[_0xfa69('0x29')](function(_0x4b9bd9){var _0x1392a5=_0x5ec0f0['user'][_0xfa69('0x4e')]({'plain':!![]});if(!_0x1392a5)throw new Error(_0xfa69('0x4f'));if(_0x1392a5['role']===_0xfa69('0x50')){var _0x34b187=_0x4b9bd9[_0xfa69('0x4e')]({'plain':!![]});var _0x58f0ee='Teams';return db[_0xfa69('0x51')][_0xfa69('0x4b')]({'where':{'name':_0x58f0ee,'userProfileId':_0x1392a5[_0xfa69('0x52')]},'raw':!![]})[_0xfa69('0x29')](function(_0x2e3ab3){if(_0x2e3ab3&&_0x2e3ab3['autoAssociation']===0x0){return db[_0xfa69('0x53')]['create']({'name':_0x34b187[_0xfa69('0x2b')],'resourceId':_0x34b187['id'],'type':_0x2e3ab3[_0xfa69('0x2b')],'sectionId':_0x2e3ab3['id']},{})[_0xfa69('0x29')](function(){return _0x4b9bd9;});}else{return _0x4b9bd9;}})['catch'](function(_0x985a){logger[_0xfa69('0x54')](_0xfa69('0x55'),_0x985a);throw _0x985a;});}return _0x4b9bd9;})[_0xfa69('0x29')](respondWithResult(_0x5f92ca,0xc9))[_0xfa69('0x47')](handleError(_0x5f92ca,null));};exports[_0xfa69('0x56')]=function(_0x11e5ea,_0x431f62){if(_0x11e5ea[_0xfa69('0x4d')]['id']){delete _0x11e5ea[_0xfa69('0x4d')]['id'];}return db['Team']['find']({'where':{'id':_0x11e5ea['params']['id']}})[_0xfa69('0x29')](handleEntityNotFound(_0x431f62,null))[_0xfa69('0x29')](saveUpdates(_0x11e5ea['body'],null))[_0xfa69('0x29')](respondWithResult(_0x431f62,null))[_0xfa69('0x47')](handleError(_0x431f62,null));};exports[_0xfa69('0x57')]=function(_0x2e07e7,_0x194efe){var _0x4cd8e2=_0x2e07e7[_0xfa69('0x49')]['id'];var _0x5935d1=[];return db[_0xfa69('0x58')][_0xfa69('0x59')](function(_0x47d802){var _0x4c027b='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x4cd8e2;return db[_0xfa69('0x58')][_0xfa69('0x33')](_0x4c027b,{'type':db[_0xfa69('0x5a')][_0xfa69('0x5b')][_0xfa69('0x5c')],'raw':!![],'transaction':_0x47d802})[_0xfa69('0x29')](function(_0x377eeb){_0x5935d1=_[_0xfa69('0x2e')](_0x377eeb,function(_0x110bcd){return Number(_0x110bcd['UserId']);});})[_0xfa69('0x29')](function(){var _0x59b641=_0xfa69('0x5d')+_0x4cd8e2;return db[_0xfa69('0x58')]['query'](_0x59b641,{'type':db[_0xfa69('0x5a')][_0xfa69('0x5b')][_0xfa69('0x5c')],'raw':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x3d7db0){var _0x3152f1=_[_0xfa69('0x2e')](_0x3d7db0,function(_0x347a96){return Number(_0x347a96['VoiceQueueId']);});return db[_0xfa69('0x5e')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'VoiceQueueId':{'$in':_0x3152f1}},'transaction':_0x47d802});})[_0xfa69('0x29')](function(){var _0x31d022=_0xfa69('0x5f')+_0x4cd8e2;return db[_0xfa69('0x58')]['query'](_0x31d022,{'type':db[_0xfa69('0x5a')][_0xfa69('0x5b')][_0xfa69('0x5c')],'raw':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x3f4620){var _0xc74d67=_[_0xfa69('0x2e')](_0x3f4620,function(_0x3edbba){return Number(_0x3edbba[_0xfa69('0x60')]);});return db[_0xfa69('0x61')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'MailQueueId':{'$in':_0xc74d67}},'transaction':_0x47d802});})[_0xfa69('0x29')](function(){var _0x6a3852=_0xfa69('0x62')+_0x4cd8e2;return db[_0xfa69('0x58')][_0xfa69('0x33')](_0x6a3852,{'type':db[_0xfa69('0x5a')][_0xfa69('0x5b')]['SELECT'],'raw':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x53acfc){var _0x35d4f6=_[_0xfa69('0x2e')](_0x53acfc,function(_0xec44f9){return Number(_0xec44f9[_0xfa69('0x63')]);});return db[_0xfa69('0x64')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'SmsQueueId':{'$in':_0x35d4f6}},'transaction':_0x47d802});})[_0xfa69('0x29')](function(){var _0x5cf0ec='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4cd8e2;return db[_0xfa69('0x58')]['query'](_0x5cf0ec,{'type':db[_0xfa69('0x5a')][_0xfa69('0x5b')][_0xfa69('0x5c')],'raw':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x1b0506){var _0x5aac7f=_[_0xfa69('0x2e')](_0x1b0506,function(_0x1bf4af){return Number(_0x1bf4af[_0xfa69('0x65')]);});return db[_0xfa69('0x66')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'ChatQueueId':{'$in':_0x5aac7f}},'transaction':_0x47d802});})[_0xfa69('0x29')](function(){var _0x2682eb=_0xfa69('0x67')+_0x4cd8e2;return db[_0xfa69('0x58')][_0xfa69('0x33')](_0x2682eb,{'type':db[_0xfa69('0x5a')]['QueryTypes'][_0xfa69('0x5c')],'raw':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x331cf8){var _0x3484de=_['map'](_0x331cf8,function(_0x2f2ac2){return Number(_0x2f2ac2[_0xfa69('0x68')]);});return db[_0xfa69('0x69')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'FaxQueueId':{'$in':_0x3484de}},'transaction':_0x47d802});})[_0xfa69('0x29')](function(){var _0xca5a7f=_0xfa69('0x6a')+_0x4cd8e2;return db[_0xfa69('0x58')]['query'](_0xca5a7f,{'type':db['Sequelize'][_0xfa69('0x5b')]['SELECT'],'raw':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x3e3fa0){var _0x5741a5=_['map'](_0x3e3fa0,function(_0x4280c5){return Number(_0x4280c5[_0xfa69('0x6b')]);});return db[_0xfa69('0x6c')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'OpenchannelQueueId':{'$in':_0x5741a5}},'transaction':_0x47d802});})['then'](function(){var _0x5a2f93=_0xfa69('0x6d')+_0x4cd8e2;return db[_0xfa69('0x58')]['query'](_0x5a2f93,{'type':db['Sequelize'][_0xfa69('0x5b')]['SELECT'],'raw':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x4f22f0){var _0x5681c9=_[_0xfa69('0x2e')](_0x4f22f0,function(_0x401f1d){return Number(_0x401f1d['WhatsappQueueId']);});return db[_0xfa69('0x6e')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'WhatsappQueueId':{'$in':_0x5681c9}},'transaction':_0x47d802});})[_0xfa69('0x29')](function(){return db[_0xfa69('0x6f')][_0xfa69('0x4b')]({'where':{'TeamId':_0x4cd8e2}});})[_0xfa69('0x29')](function(_0x58a65c){if(_0x58a65c===null){return;}return db[_0xfa69('0x70')][_0xfa69('0x57')]({'where':{'UserId':{'$in':_0x5935d1},'VoicePrefixId':_0x58a65c[_0xfa69('0x71')]},'transaction':_0x47d802});})['then'](function(){return db[_0xfa69('0x42')][_0xfa69('0x57')]({'where':{'id':_0x4cd8e2},'cascade':!![],'transaction':_0x47d802});})[_0xfa69('0x29')](function(_0x5bfb01){if(_0x5bfb01===0x0){_0x194efe[_0xfa69('0x1f')](0x194);}else{return db['UserProfileResource'][_0xfa69('0x57')]({'where':{'type':'Teams','resourceId':_0x4cd8e2},'cascade':!![],'transaction':_0x47d802})[_0xfa69('0x29')](function(){_0x194efe[_0xfa69('0x20')](0xcc)[_0xfa69('0x72')]();});}})[_0xfa69('0x47')](function(_0x57d02f){_0x194efe[_0xfa69('0x20')](0x1f4)['send'](_0x57d02f);});});};exports[_0xfa69('0x73')]=function(_0x1e2ec8,_0x1d0cca,_0x2eda32){return db[_0xfa69('0x42')][_0xfa69('0x74')]({'where':{'id':_0x1e2ec8['params']['id']}})[_0xfa69('0x29')](handleEntityNotFound(_0x1d0cca,null))[_0xfa69('0x29')](function(_0x5e3142){if(!_0x1e2ec8[_0xfa69('0x33')]['channel']||!utils[_0xfa69('0x75')](_0x1e2ec8['query'][_0xfa69('0x76')])){throw new db['Sequelize']['ValidationError'](_0xfa69('0x77'));}var _0x356736={};var _0x4f8fb0={};_0x4f8fb0['model']=_[_0xfa69('0x32')](db[_[_0xfa69('0x78')](_0x1e2ec8['query'][_0xfa69('0x76')][_0xfa69('0x79')]())+_0xfa69('0x7a')][_0xfa69('0x4a')]);_0x4f8fb0['query']=_[_0xfa69('0x32')](_0x1e2ec8[_0xfa69('0x33')]);_0x4f8fb0[_0xfa69('0x34')]=_[_0xfa69('0x37')](_0x4f8fb0[_0xfa69('0x35')],_0x4f8fb0[_0xfa69('0x33')]);_0x356736['attributes']=_['intersection'](_0x4f8fb0[_0xfa69('0x35')],qs[_0xfa69('0x38')](_0x1e2ec8[_0xfa69('0x33')][_0xfa69('0x38')]));_0x356736[_0xfa69('0x36')]=_0x356736['attributes'][_0xfa69('0x39')]?_0x356736[_0xfa69('0x36')]:_0x4f8fb0['model'];_0x356736[_0xfa69('0x22')]=qs[_0xfa69('0x22')](_0x1e2ec8[_0xfa69('0x33')][_0xfa69('0x22')]);_0x356736[_0xfa69('0x24')]=qs[_0xfa69('0x24')](_0x1e2ec8[_0xfa69('0x33')][_0xfa69('0x24')]);_0x356736[_0xfa69('0x3b')]=qs[_0xfa69('0x3c')](_0x1e2ec8[_0xfa69('0x33')][_0xfa69('0x3c')]);_0x356736[_0xfa69('0x3d')]=qs['filters'](_['pick'](_0x1e2ec8[_0xfa69('0x33')],_0x4f8fb0[_0xfa69('0x34')]));_0x356736=_[_0xfa69('0x3f')]({},_0x356736,_0x1e2ec8[_0xfa69('0x41')]);return _0x5e3142[_0xfa69('0x4e')+_[_0xfa69('0x78')](_0x1e2ec8['query'][_0xfa69('0x76')][_0xfa69('0x79')]())+_0xfa69('0x7b')](_0x356736);})[_0xfa69('0x29')](respondWithResult(_0x1d0cca,null))['catch'](handleError(_0x1d0cca,null));};exports['addQueues']=function(_0x12c76d,_0x40e7bf,_0x53bc4e){return db[_0xfa69('0x42')]['findOne']({'where':{'id':_0x12c76d['params']['id']}})['then'](function(_0x2fa4d8){if(_0x2fa4d8){if(!_0x12c76d[_0xfa69('0x4d')][_0xfa69('0x76')]||!utils['isValidChannel'](_0x12c76d[_0xfa69('0x4d')][_0xfa69('0x76')])){throw new db['Sequelize'][(_0xfa69('0x7c'))](_0xfa69('0x77'));}return _0x2fa4d8[_0xfa69('0x7d')+_['capitalize'](_0x12c76d[_0xfa69('0x4d')][_0xfa69('0x76')][_0xfa69('0x79')]())+_0xfa69('0x7b')](_0x12c76d[_0xfa69('0x4d')][_0xfa69('0x7e')]);}return null;})[_0xfa69('0x29')](handleEntityNotFound(_0x40e7bf,null))['then'](respondWithStatusCode(_0x40e7bf,null))[_0xfa69('0x47')](handleError(_0x40e7bf,null));};exports[_0xfa69('0x7f')]=function(_0x285f47,_0x17ad14,_0xcee13){return db[_0xfa69('0x42')][_0xfa69('0x74')]({'where':{'id':_0x285f47[_0xfa69('0x49')]['id']}})[_0xfa69('0x29')](function(_0x589b89){if(_0x589b89){if(!_0x285f47[_0xfa69('0x33')][_0xfa69('0x76')]||!utils[_0xfa69('0x75')](_0x285f47[_0xfa69('0x33')][_0xfa69('0x76')])){throw new db[(_0xfa69('0x5a'))][(_0xfa69('0x7c'))](_0xfa69('0x77'));}return _0x589b89['remove'+_[_0xfa69('0x78')](_0x285f47[_0xfa69('0x33')][_0xfa69('0x76')][_0xfa69('0x79')]())+_0xfa69('0x7b')](_0x285f47[_0xfa69('0x33')][_0xfa69('0x7e')]);}return null;})[_0xfa69('0x29')](handleEntityNotFound(_0x17ad14,null))['then'](respondWithStatusCode(_0x17ad14,null))['catch'](handleError(_0x17ad14,null));};exports[_0xfa69('0x80')]=function(_0x2279d4,_0x4c23d5){var _0x223f3e=_['isArray'](_0x2279d4['body'][_0xfa69('0x7e')])?_0x2279d4[_0xfa69('0x4d')][_0xfa69('0x7e')]:[_0x2279d4['body'][_0xfa69('0x7e')]];var _0x5b27db=_0x2279d4[_0xfa69('0x49')]['id'];return db['Team'][_0xfa69('0x4b')]({'where':{'id':_0x5b27db}})[_0xfa69('0x29')](handleEntityNotFound(_0x4c23d5,null))['then'](function(_0x1cdb80){if(_0x1cdb80){var _0x32395a=[_0xfa69('0x81'),_0xfa69('0x82'),'Mail',_0xfa69('0x83'),_0xfa69('0x84'),'Openchannel',_0xfa69('0x85')];return db[_0xfa69('0x58')][_0xfa69('0x59')](function(_0x115f65){var _0x42ea46=_[_0xfa69('0x2e')](_0x32395a,function(_0x41464c){var _0x5bbae6={'attributes':['id',_0xfa69('0x2b')]};if(_0x41464c==='Voice'){_0x5bbae6['through']={'attributes':[_0xfa69('0x86')]};}return _0x1cdb80[_0xfa69('0x4e')+_0x41464c+'Queues'](_0x5bbae6)[_0xfa69('0x29')](function(_0x2d0954){var _0x2a024f=_['map'](_0x2d0954,function(_0x1ab0c0){var _0x90f519=_[_0xfa69('0x2e')](_0x223f3e,function(_0x4c90d4){var _0x2bf1de={'where':{'UserId':_0x4c90d4,[_0x41464c+_0xfa69('0x87')]:_0x1ab0c0['id']},'transaction':_0x115f65};if(_0x41464c===_0xfa69('0x81')){_0x2bf1de[_0xfa69('0x1a')]={'penalty':_0x1ab0c0[_0xfa69('0x88')][_0xfa69('0x86')]};}return db[_0xfa69('0x89')+_0x41464c+'Queue'][_0xfa69('0x8a')](_0x2bf1de)[_0xfa69('0x29')](function(){socket['emit']('user'+_0x41464c+_0xfa69('0x8b'),{'UserId':_0x4c90d4,[_0x41464c+_0xfa69('0x87')]:_0x1ab0c0['id']});if(_0x41464c!=='Voice'){return;}return db['User'][_0xfa69('0x45')]({'where':{'id':_0x223f3e,'online':0x1},'attributes':['id','name','online','voicePause','interface'],'raw':!![]})[_0xfa69('0x29')](function(_0xc70edf){var _0x4f4560=_['map'](_0xc70edf,function(_0x1818e5){return db[_0xfa69('0x8c')][_0xfa69('0x8d')]({'membername':_0x1818e5[_0xfa69('0x2b')],'UserId':_0x1818e5['id'],'queue_name':_0x1ab0c0['name'],'VoiceQueueId':_0x1ab0c0['id'],'interface':_[_0xfa69('0x8e')](_0x1818e5[_0xfa69('0x8f')])?util[_0xfa69('0x90')](_0xfa69('0x91'),_0x1818e5[_0xfa69('0x2b')]):_0x1818e5[_0xfa69('0x8f')],'paused':_0x1818e5[_0xfa69('0x92')]||![],'penalty':_0x1ab0c0['TeamVoiceQueue'][_0xfa69('0x86')]},{'transaction':_0x115f65});});return Promise[_0xfa69('0x93')](_0x4f4560);});});});return Promise['all'](_0x90f519);});return Promise[_0xfa69('0x93')](_0x2a024f);})[_0xfa69('0x29')](function(){return db['TeamVoicePrefix'][_0xfa69('0x74')]({'where':{'teamId':_0x5b27db}})[_0xfa69('0x29')](function(_0x49d871){if(_0x49d871){var _0x33585c=_[_0xfa69('0x2e')](_0x223f3e,function(_0xa0de11){db[_0xfa69('0x70')]['upsert']({'UserId':_0xa0de11,'VoicePrefixId':_0x49d871[_0xfa69('0x71')]});});return Promise[_0xfa69('0x93')](_0x33585c);}});});});return Promise['all'](_0x42ea46)['then'](function(){return _0x1cdb80['addAgents'](_0x223f3e,{'transaction':_0x115f65})[_0xfa69('0x94')](function(_0x1c1505){return _0x1c1505;});});});}})[_0xfa69('0x29')](respondWithResult(_0x4c23d5,null))[_0xfa69('0x47')](handleError(_0x4c23d5,null));};exports[_0xfa69('0x95')]=function(_0x56a558,_0x5ca6bd){var _0x5adb2d=_['isArray'](_0x56a558[_0xfa69('0x33')][_0xfa69('0x7e')])?_0x56a558[_0xfa69('0x33')][_0xfa69('0x7e')]:[_0x56a558[_0xfa69('0x33')][_0xfa69('0x7e')]];var _0x2e86f9=_0x56a558[_0xfa69('0x49')]['id'];return db[_0xfa69('0x42')][_0xfa69('0x4b')]({'where':{'id':_0x2e86f9}})[_0xfa69('0x29')](handleEntityNotFound(_0x5ca6bd,null))['then'](function(_0x11738a){if(_0x11738a){var _0x253002=[_0xfa69('0x81'),_0xfa69('0x82'),_0xfa69('0x96'),_0xfa69('0x83'),'Fax','Openchannel','Whatsapp'];return db[_0xfa69('0x58')][_0xfa69('0x59')](function(_0x3a5f7b){var _0x47ad97=_[_0xfa69('0x2e')](_0x253002,function(_0x157fc4){var _0x4d74a9={'attributes':['id',_0xfa69('0x2b')]};return _0x11738a[_0xfa69('0x4e')+_0x157fc4+'Queues'](_0x4d74a9)[_0xfa69('0x29')](function(_0x11303d){var _0x1af683=_['map'](_0x11303d,function(_0x387e42){return _0x387e42[_0xfa69('0x95')](_0x5adb2d,{'transaction':_0x3a5f7b})[_0xfa69('0x29')](function(){var _0x55d16e=_[_0xfa69('0x2e')](_0x5adb2d,function(_0x1a909e){socket[_0xfa69('0x97')](_0xfa69('0x50')+_0x157fc4+'Queue:remove',{'UserId':Number(_0x1a909e),[_0x157fc4+'QueueId']:_0x387e42['id']});if(_0x157fc4!=='Voice'){return;}return db[_0xfa69('0x8c')][_0xfa69('0x57')]({'where':{'VoiceQueueId':_0x387e42['id'],'UserId':_0x1a909e},'transaction':_0x3a5f7b});});return Promise[_0xfa69('0x93')](_0x55d16e);});});return Promise[_0xfa69('0x93')](_0x1af683);});});return Promise[_0xfa69('0x93')](_0x47ad97)[_0xfa69('0x29')](function(){return _0x11738a['removeAgents'](_0x5adb2d,{'transaction':_0x3a5f7b});})[_0xfa69('0x29')](function(){return db[_0xfa69('0x6f')][_0xfa69('0x74')]({'where':{'teamId':_0x2e86f9}})[_0xfa69('0x29')](function(_0x5bd27a){if(_0x5bd27a){var _0xc6401d=_['map'](_0x5adb2d,function(_0xf3ad2d){db[_0xfa69('0x70')]['destroy']({'where':{'UserId':_0xf3ad2d,'VoicePrefixId':_0x5bd27a['VoicePrefixId']}});});return Promise[_0xfa69('0x93')](_0xc6401d);}});});});}})['then'](respondWithStatusCode(_0x5ca6bd,null))[_0xfa69('0x47')](handleError(_0x5ca6bd,null));};exports['getAgents']=function(_0x43bb30,_0x1fee79,_0x294a98){var _0xd9e1a6={};var _0x48b189={};var _0x238424;var _0x58fdad;return db[_0xfa69('0x42')][_0xfa69('0x74')]({'where':{'id':_0x43bb30['params']['id']}})[_0xfa69('0x29')](handleEntityNotFound(_0x1fee79,null))[_0xfa69('0x29')](function(_0x46e00e){if(_0x46e00e){_0x238424=_0x46e00e;_0x48b189['model']=_[_0xfa69('0x32')](db[_0xfa69('0x89')]['rawAttributes']);_0x48b189[_0xfa69('0x33')]=_[_0xfa69('0x32')](_0x43bb30[_0xfa69('0x33')]);_0x48b189[_0xfa69('0x34')]=_[_0xfa69('0x37')](_0x48b189[_0xfa69('0x35')],_0x48b189[_0xfa69('0x33')]);_0xd9e1a6[_0xfa69('0x36')]=_['intersection'](_0x48b189[_0xfa69('0x35')],qs['fields'](_0x43bb30[_0xfa69('0x33')][_0xfa69('0x38')]));_0xd9e1a6[_0xfa69('0x36')]=_0xd9e1a6[_0xfa69('0x36')][_0xfa69('0x39')]?_0xd9e1a6[_0xfa69('0x36')]:_0x48b189[_0xfa69('0x35')];_0xd9e1a6['order']=qs['sort'](_0x43bb30[_0xfa69('0x33')][_0xfa69('0x3c')]);_0xd9e1a6[_0xfa69('0x3d')]=qs['filters'](_[_0xfa69('0x98')](_0x43bb30[_0xfa69('0x33')],_0x48b189[_0xfa69('0x34')]));if(_0x43bb30['query']['filter']){_0xd9e1a6['where']=_[_0xfa69('0x3f')](_0xd9e1a6[_0xfa69('0x3d')],{'$or':_[_0xfa69('0x2e')](_0xd9e1a6[_0xfa69('0x36')],function(_0x17e3d0){var _0x4afada={};_0x4afada[_0x17e3d0]={'$like':'%'+_0x43bb30[_0xfa69('0x33')]['filter']+'%'};return _0x4afada;})});}_0xd9e1a6=_[_0xfa69('0x3f')]({},_0xd9e1a6,_0x43bb30[_0xfa69('0x41')]);return _0x238424[_0xfa69('0x99')](_0xd9e1a6);}})[_0xfa69('0x29')](function(_0x2083a7){if(_0x2083a7){_0x58fdad=_0x2083a7[_0xfa69('0x39')];if(!_0x43bb30[_0xfa69('0x33')][_0xfa69('0x3a')](_0xfa69('0x9a'))){_0xd9e1a6['limit']=qs[_0xfa69('0x22')](_0x43bb30[_0xfa69('0x33')][_0xfa69('0x22')]);_0xd9e1a6[_0xfa69('0x24')]=qs[_0xfa69('0x24')](_0x43bb30[_0xfa69('0x33')][_0xfa69('0x24')]);}return _0x238424['getAgents'](_0xd9e1a6);}})[_0xfa69('0x29')](function(_0x5a3b2e){if(_0x5a3b2e){return _0x5a3b2e?{'count':_0x58fdad,'rows':_0x5a3b2e}:null;}})[_0xfa69('0x29')](respondWithResult(_0x1fee79,null))[_0xfa69('0x47')](handleError(_0x1fee79,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1321e1f..b1bec41 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 _0x65bc=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x526f1f,_0x37ee7b){var _0x149143=function(_0x26a958){while(--_0x26a958){_0x526f1f['push'](_0x526f1f['shift']());}};_0x149143(++_0x37ee7b);}(_0x65bc,0x17a));var _0xc65b=function(_0x4140fe,_0x370dd5){_0x4140fe=_0x4140fe-0x0;var _0x3e3ecc=_0x65bc[_0x4140fe];return _0x3e3ecc;};'use strict';var EventEmitter=require(_0xc65b('0x0'));var Team=require(_0xc65b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xc65b('0x2')](0x0);var events={'afterCreate':_0xc65b('0x3'),'afterUpdate':_0xc65b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x14aa7f){return function(_0x2a875d,_0x24a05f,_0x36df0e){TeamEvents[_0xc65b('0x5')](_0x14aa7f+':'+_0x2a875d['id'],_0x2a875d);TeamEvents['emit'](_0x14aa7f,_0x2a875d);_0x36df0e(null);};}for(var e in events){if(events[_0xc65b('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc65b('0x7')]=TeamEvents; \ No newline at end of file +var _0xede5=['emit','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xede5,0x1ab));var _0x5ede=function(_0x480a18,_0x285c08){_0x480a18=_0x480a18-0x0;var _0x1f72cb=_0xede5[_0x480a18];return _0x1f72cb;};'use strict';var EventEmitter=require('events');var Team=require(_0x5ede('0x0'))['db'][_0x5ede('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x5ede('0x2')](0x0);var events={'afterCreate':_0x5ede('0x3'),'afterUpdate':_0x5ede('0x4'),'afterDestroy':'remove'};function emitEvent(_0x17fc4a){return function(_0x5ec762,_0x29381b,_0xac23f2){TeamEvents[_0x5ede('0x5')](_0x17fc4a+':'+_0x5ec762['id'],_0x5ec762);TeamEvents[_0x5ede('0x5')](_0x17fc4a,_0x5ec762);_0xac23f2(null);};}for(var e in events){if(events[_0x5ede('0x6')](e)){var event=events[e];Team[_0x5ede('0x7')](e,emitEvent(event));}}module[_0x5ede('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 407f371..9a81b41 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 _0xf185=['Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','catch','lodash','./team.attributes','Queues','then','map','setDataValue','channel','exports','Team','Chat','Fax'];(function(_0x50bb27,_0x5715e0){var _0x237456=function(_0x7574f5){while(--_0x7574f5){_0x50bb27['push'](_0x50bb27['shift']());}};_0x237456(++_0x5715e0);}(_0xf185,0x1bd));var _0x5f18=function(_0x2b0f13,_0x49db0d){_0x2b0f13=_0x2b0f13-0x0;var _0x5e35bb=_0xf185[_0x2b0f13];return _0x5e35bb;};'use strict';var _=require(_0x5f18('0x0'));var attributes=require(_0x5f18('0x1'));function getQueuesByChannel(_0x4763e6,_0x2ce949){var _0xfb9357='get'+_0x2ce949+_0x5f18('0x2');return _0x4763e6[_0xfb9357]()[_0x5f18('0x3')](function(_0x3e5829){return _[_0x5f18('0x4')](_0x3e5829,function(_0x78715){_0x78715[_0x5f18('0x5')](_0x5f18('0x6'),_0x2ce949);return _0x78715;});})['catch'](function(_0x220a32){throw _0x220a32;});}module[_0x5f18('0x7')]=function(_0x5475e7){return _0x5475e7['define'](_0x5f18('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2d4375=this;var _0x4f4c2a=[_0x5f18('0x9'),_0x5f18('0xa'),_0x5f18('0xb'),_0x5f18('0xc'),_0x5f18('0xd'),_0x5f18('0xe'),_0x5f18('0xf')];return Promise[_0x5f18('0x10')]()[_0x5f18('0x3')](function(){var _0x56833f=_[_0x5f18('0x4')](_0x4f4c2a,function(_0x11c1ea){return getQueuesByChannel(_0x2d4375,_0x11c1ea);});return Promise[_0x5f18('0x11')](_0x56833f);})[_0x5f18('0x12')](function(_0x330dfc){throw _0x330dfc;});}}});}; \ No newline at end of file +var _0x2149=['then','map','setDataValue','channel','define','Team','teams','Chat','Mail','Sms','Voice','Whatsapp','resolve','all','get'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2149,0xc2));var _0x9214=function(_0x29524d,_0x1c8fc4){_0x29524d=_0x29524d-0x0;var _0x187be2=_0x2149[_0x29524d];return _0x187be2;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x4ebdd6,_0x3b9596){var _0x2b7a9e=_0x9214('0x0')+_0x3b9596+'Queues';return _0x4ebdd6[_0x2b7a9e]()[_0x9214('0x1')](function(_0x2fdf4f){return _[_0x9214('0x2')](_0x2fdf4f,function(_0x37118a){_0x37118a[_0x9214('0x3')](_0x9214('0x4'),_0x3b9596);return _0x37118a;});})['catch'](function(_0x2f1786){throw _0x2f1786;});}module['exports']=function(_0x37aa2e){return _0x37aa2e[_0x9214('0x5')](_0x9214('0x6'),attributes,{'tableName':_0x9214('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x52e090=this;var _0x33a6c2=[_0x9214('0x8'),'Fax',_0x9214('0x9'),'Openchannel',_0x9214('0xa'),_0x9214('0xb'),_0x9214('0xc')];return Promise[_0x9214('0xd')]()[_0x9214('0x1')](function(){var _0x49fe9a=_[_0x9214('0x2')](_0x33a6c2,function(_0xe164bf){return getQueuesByChannel(_0x52e090,_0xe164bf);});return Promise[_0x9214('0xe')](_0x49fe9a);})['catch'](function(_0xfc6875){throw _0xfc6875;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index b2c080b..ca2f7f2 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 _0xbbc6=['then','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','Team,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','request'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xbbc6,0x90));var _0x6bbc=function(_0x829275,_0x161f1f){_0x829275=_0x829275-0x0;var _0x38f78a=_0xbbc6[_0x829275];return _0x38f78a;};'use strict';var _=require(_0x6bbc('0x0'));var util=require(_0x6bbc('0x1'));var moment=require(_0x6bbc('0x2'));var BPromise=require(_0x6bbc('0x3'));var rs=require(_0x6bbc('0x4'));var fs=require('fs');var Redis=require(_0x6bbc('0x5'));var db=require(_0x6bbc('0x6'))['db'];var utils=require(_0x6bbc('0x7'));var logger=require(_0x6bbc('0x8'))(_0x6bbc('0x9'));var config=require(_0x6bbc('0xa'));var jayson=require(_0x6bbc('0xb'));var client=jayson[_0x6bbc('0xc')]['http']({'port':0x232a});config['redis']=_[_0x6bbc('0xd')](config['redis'],{'host':_0x6bbc('0xe'),'port':0x18eb});var socket=require(_0x6bbc('0xf'))(new Redis(config[_0x6bbc('0x10')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x576091,_0x2862e4,_0x5d0985){return new BPromise(function(_0x193367,_0x4fe50e){return client[_0x6bbc('0x11')](_0x576091,_0x5d0985)[_0x6bbc('0x12')](function(_0x33e36d){logger[_0x6bbc('0x13')]('Team,\x20%s,\x20%s',_0x2862e4,_0x6bbc('0x14'));logger['debug'](_0x6bbc('0x15'),_0x2862e4,'request\x20sent',JSON[_0x6bbc('0x16')](_0x33e36d));if(_0x33e36d[_0x6bbc('0x17')]){if(_0x33e36d[_0x6bbc('0x17')]['code']===0x1f4){logger[_0x6bbc('0x17')]('Team,\x20%s,\x20%s',_0x2862e4,_0x33e36d[_0x6bbc('0x17')]['message']);return _0x4fe50e(_0x33e36d[_0x6bbc('0x17')][_0x6bbc('0x18')]);}logger[_0x6bbc('0x17')](_0x6bbc('0x19'),_0x2862e4,_0x33e36d[_0x6bbc('0x17')][_0x6bbc('0x18')]);return _0x193367(_0x33e36d[_0x6bbc('0x17')][_0x6bbc('0x18')]);}else{logger['info'](_0x6bbc('0x19'),_0x2862e4,'request\x20sent');_0x193367(_0x33e36d[_0x6bbc('0x1a')][_0x6bbc('0x18')]);}})['catch'](function(_0x448af0){logger[_0x6bbc('0x17')](_0x6bbc('0x19'),_0x2862e4,_0x448af0);_0x4fe50e(_0x448af0);});});} \ No newline at end of file +var _0xc532=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x528bd4,_0x4f0985){var _0xb55bda=function(_0x4bef3a){while(--_0x4bef3a){_0x528bd4['push'](_0x528bd4['shift']());}};_0xb55bda(++_0x4f0985);}(_0xc532,0x193));var _0x2c53=function(_0x15a92d,_0x586f2a){_0x15a92d=_0x15a92d-0x0;var _0x25fe49=_0xc532[_0x15a92d];return _0x25fe49;};'use strict';var _=require(_0x2c53('0x0'));var util=require(_0x2c53('0x1'));var moment=require(_0x2c53('0x2'));var BPromise=require(_0x2c53('0x3'));var rs=require(_0x2c53('0x4'));var fs=require('fs');var Redis=require(_0x2c53('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2c53('0x6'))(_0x2c53('0x7'));var config=require(_0x2c53('0x8'));var jayson=require(_0x2c53('0x9'));var client=jayson[_0x2c53('0xa')][_0x2c53('0xb')]({'port':0x232a});config['redis']=_[_0x2c53('0xc')](config['redis'],{'host':_0x2c53('0xd'),'port':0x18eb});var socket=require(_0x2c53('0xe'))(new Redis(config[_0x2c53('0xf')]));require(_0x2c53('0x10'))['register'](socket);function respondWithRpcPromise(_0x5995ea,_0x65e588,_0x5aaf16){return new BPromise(function(_0x226c77,_0x651293){return client[_0x2c53('0x11')](_0x5995ea,_0x5aaf16)['then'](function(_0x2c037c){logger[_0x2c53('0x12')](_0x2c53('0x13'),_0x65e588,_0x2c53('0x14'));logger[_0x2c53('0x15')](_0x2c53('0x16'),_0x65e588,_0x2c53('0x14'),JSON[_0x2c53('0x17')](_0x2c037c));if(_0x2c037c[_0x2c53('0x18')]){if(_0x2c037c[_0x2c53('0x18')][_0x2c53('0x19')]===0x1f4){logger[_0x2c53('0x18')](_0x2c53('0x13'),_0x65e588,_0x2c037c[_0x2c53('0x18')][_0x2c53('0x1a')]);return _0x651293(_0x2c037c[_0x2c53('0x18')][_0x2c53('0x1a')]);}logger[_0x2c53('0x18')](_0x2c53('0x13'),_0x65e588,_0x2c037c[_0x2c53('0x18')]['message']);return _0x226c77(_0x2c037c['error'][_0x2c53('0x1a')]);}else{logger[_0x2c53('0x12')](_0x2c53('0x13'),_0x65e588,_0x2c53('0x14'));_0x226c77(_0x2c037c[_0x2c53('0x1b')][_0x2c53('0x1a')]);}})[_0x2c53('0x1c')](function(_0x487323){logger['error']('Team,\x20%s,\x20%s',_0x65e588,_0x487323);_0x651293(_0x487323);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 853bede..8270370 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 _0x0444=['update','removeListener','register','team:','./team.events'];(function(_0x40f4d6,_0x43c9bb){var _0x51c3d2=function(_0x55f092){while(--_0x55f092){_0x40f4d6['push'](_0x40f4d6['shift']());}};_0x51c3d2(++_0x43c9bb);}(_0x0444,0xbd));var _0x4044=function(_0x40c4f7,_0x5deb14){_0x40c4f7=_0x40c4f7-0x0;var _0x351d93=_0x0444[_0x40c4f7];return _0x351d93;};'use strict';var TeamEvents=require(_0x4044('0x0'));var events=['save','remove',_0x4044('0x1')];function createListener(_0x3b4f86,_0x314e93){return function(_0x13b35d){_0x314e93['emit'](_0x3b4f86,_0x13b35d);};}function removeListener(_0x416e94,_0x467dc2){return function(){TeamEvents[_0x4044('0x2')](_0x416e94,_0x467dc2);};}exports[_0x4044('0x3')]=function(_0x14b919){for(var _0x4acfb2=0x0,_0x31c11f=events['length'];_0x4acfb2<_0x31c11f;_0x4acfb2++){var _0x3e9f69=events[_0x4acfb2];var _0x15704a=createListener(_0x4044('0x4')+_0x3e9f69,_0x14b919);TeamEvents['on'](_0x3e9f69,_0x15704a);}}; \ No newline at end of file +var _0x6d40=['length','team:','./team.events','save','update','emit','removeListener'];(function(_0x5f1116,_0x49762d){var _0x41c98b=function(_0x37ac90){while(--_0x37ac90){_0x5f1116['push'](_0x5f1116['shift']());}};_0x41c98b(++_0x49762d);}(_0x6d40,0x1ec));var _0x06d4=function(_0x448ddf,_0x4fa28c){_0x448ddf=_0x448ddf-0x0;var _0x567d9f=_0x6d40[_0x448ddf];return _0x567d9f;};'use strict';var TeamEvents=require(_0x06d4('0x0'));var events=[_0x06d4('0x1'),'remove',_0x06d4('0x2')];function createListener(_0x3fde81,_0x99c0cc){return function(_0x31af59){_0x99c0cc[_0x06d4('0x3')](_0x3fde81,_0x31af59);};}function removeListener(_0x22bdf7,_0x14ef32){return function(){TeamEvents[_0x06d4('0x4')](_0x22bdf7,_0x14ef32);};}exports['register']=function(_0xa29be3){for(var _0x41b21c=0x0,_0x36f174=events[_0x06d4('0x5')];_0x41b21c<_0x36f174;_0x41b21c++){var _0x35275f=events[_0x41b21c];var _0x4b5868=createListener(_0x06d4('0x6')+_0x35275f,_0xa29be3);TeamEvents['on'](_0x35275f,_0x4b5868);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 62eb3bd..3c1f524 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 _0x8c99=['INTEGER','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8c99,0x1a8));var _0x98c9=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x8c99[_0x39e164];return _0x13fa6b;};'use strict';var Sequelize=require(_0x98c9('0x0'));module[_0x98c9('0x1')]={'TeamId':{'type':Sequelize[_0x98c9('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x98c9('0x2')]}}; \ No newline at end of file +var _0xd5d3=['exports','INTEGER','sequelize'];(function(_0x41875b,_0x3c8be7){var _0x50007d=function(_0x5dd0b4){while(--_0x5dd0b4){_0x41875b['push'](_0x41875b['shift']());}};_0x50007d(++_0x3c8be7);}(_0xd5d3,0x113));var _0x3d5d=function(_0x413586,_0xb892f4){_0x413586=_0x413586-0x0;var _0x3a4aa6=_0xd5d3[_0x413586];return _0x3a4aa6;};'use strict';var Sequelize=require(_0x3d5d('0x0'));module[_0x3d5d('0x1')]={'TeamId':{'type':Sequelize[_0x3d5d('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index f489db1..9f9c0a0 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 _0x138d=['api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x32d2eb,_0x56fe19){var _0x1e3590=function(_0x1c9f47){while(--_0x1c9f47){_0x32d2eb['push'](_0x32d2eb['shift']());}};_0x1e3590(++_0x56fe19);}(_0x138d,0x1ab));var _0xd138=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0x138d[_0x483e3a];return _0x43fca9;};'use strict';var _=require(_0xd138('0x0'));var util=require(_0xd138('0x1'));var logger=require('../../config/logger')(_0xd138('0x2'));var moment=require(_0xd138('0x3'));var BPromise=require(_0xd138('0x4'));var rp=require(_0xd138('0x5'));var fs=require('fs');var path=require(_0xd138('0x6'));var rimraf=require(_0xd138('0x7'));var config=require('../../config/environment');var attributes=require(_0xd138('0x8'));module[_0xd138('0x9')]=function(_0x343962,_0x54f02e){return _0x343962[_0xd138('0xa')](_0xd138('0xb'),attributes,{'tableName':_0xd138('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6000=['bluebird','path','rimraf','./teamVoicePrefix.attributes','define','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x40b0d0,_0x48a626){var _0x37d9ef=function(_0x4791f0){while(--_0x4791f0){_0x40b0d0['push'](_0x40b0d0['shift']());}};_0x37d9ef(++_0x48a626);}(_0x6000,0x17c));var _0x0600=function(_0x5e9032,_0x114d41){_0x5e9032=_0x5e9032-0x0;var _0x19e66d=_0x6000[_0x5e9032];return _0x19e66d;};'use strict';var _=require(_0x0600('0x0'));var util=require(_0x0600('0x1'));var logger=require(_0x0600('0x2'))(_0x0600('0x3'));var moment=require(_0x0600('0x4'));var BPromise=require(_0x0600('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0600('0x6'));var rimraf=require(_0x0600('0x7'));var config=require('../../config/environment');var attributes=require(_0x0600('0x8'));module['exports']=function(_0x38f630,_0xc18208){return _0x38f630[_0x0600('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x0600('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 541e854..a1774f5 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x301c60,_0xcb7733){var _0x2b5357=function(_0x58bb19){while(--_0x58bb19){_0x301c60['push'](_0x301c60['shift']());}};_0x2b5357(++_0xcb7733);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xf0dc46,_0x132fd7){var _0x3ef606=function(_0x5dce4e){while(--_0x5dce4e){_0xf0dc46['push'](_0xf0dc46['shift']());}};_0x3ef606(++_0x132fd7);}(_0xedd9,0xfc));var _0x9edd=function(_0x5b3652,_0x3f21f6){_0x5b3652=_0x5b3652-0x0;var _0xc2adf1=_0xedd9[_0x5b3652];return _0xc2adf1;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 5caec6a..3e91ec9 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 _0x6838=['exports'];(function(_0x2e209b,_0x3642fc){var _0x4ee763=function(_0x39b3e9){while(--_0x39b3e9){_0x2e209b['push'](_0x2e209b['shift']());}};_0x4ee763(++_0x3642fc);}(_0x6838,0x67));var _0x8683=function(_0x45d9bb,_0x2c0350){_0x45d9bb=_0x45d9bb-0x0;var _0x1a36e9=_0x6838[_0x45d9bb];return _0x1a36e9;};'use strict';var Sequelize=require('sequelize');module[_0x8683('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0b7a=['INTEGER','exports'];(function(_0x1cb25b,_0x7cde16){var _0x5bbcde=function(_0x23c736){while(--_0x23c736){_0x1cb25b['push'](_0x1cb25b['shift']());}};_0x5bbcde(++_0x7cde16);}(_0x0b7a,0x141));var _0xa0b7=function(_0x2ca4a0,_0x2e1ba8){_0x2ca4a0=_0x2ca4a0-0x0;var _0x381521=_0x0b7a[_0x2ca4a0];return _0x381521;};'use strict';var Sequelize=require('sequelize');module[_0xa0b7('0x0')]={'penalty':{'type':Sequelize[_0xa0b7('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index bdb1c78..a40ffd7 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 _0x630e=['team_has_voice_queues','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x630e,0x1af));var _0xe630=function(_0x3d0413,_0x108e83){_0x3d0413=_0x3d0413-0x0;var _0x4ceda8=_0x630e[_0x3d0413];return _0x4ceda8;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var logger=require(_0xe630('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe630('0x2'));var rp=require(_0xe630('0x3'));var fs=require('fs');var path=require(_0xe630('0x4'));var rimraf=require('rimraf');var config=require(_0xe630('0x5'));var attributes=require(_0xe630('0x6'));module[_0xe630('0x7')]=function(_0x3d6f93,_0x3936fd){return _0x3d6f93['define'](_0xe630('0x8'),attributes,{'tableName':_0xe630('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x207d=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4a1453,_0x154441){var _0x3850a5=function(_0x20fee9){while(--_0x20fee9){_0x4a1453['push'](_0x4a1453['shift']());}};_0x3850a5(++_0x154441);}(_0x207d,0x10d));var _0xd207=function(_0x2fb343,_0x23078f){_0x2fb343=_0x2fb343-0x0;var _0x9d9832=_0x207d[_0x2fb343];return _0x9d9832;};'use strict';var _=require(_0xd207('0x0'));var util=require(_0xd207('0x1'));var logger=require(_0xd207('0x2'))(_0xd207('0x3'));var moment=require('moment');var BPromise=require(_0xd207('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd207('0x5'));var rimraf=require(_0xd207('0x6'));var config=require('../../config/environment');var attributes=require(_0xd207('0x7'));module[_0xd207('0x8')]=function(_0x18102b,_0x2a8138){return _0x18102b[_0xd207('0x9')](_0xd207('0xa'),attributes,{'tableName':_0xd207('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 79302ee..f955533 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 _0x2f72=['jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3ea96a,_0x5c7ccb){var _0x47e118=function(_0x55cfd3){while(--_0x55cfd3){_0x3ea96a['push'](_0x3ea96a['shift']());}};_0x47e118(++_0x5c7ccb);}(_0x2f72,0x166));var _0x22f7=function(_0x451871,_0x1e9414){_0x451871=_0x451871-0x0;var _0x5254d9=_0x2f72[_0x451871];return _0x5254d9;};'use strict';var _=require(_0x22f7('0x0'));var util=require(_0x22f7('0x1'));var moment=require(_0x22f7('0x2'));var BPromise=require(_0x22f7('0x3'));var rs=require(_0x22f7('0x4'));var fs=require('fs');var Redis=require(_0x22f7('0x5'));var db=require(_0x22f7('0x6'))['db'];var utils=require(_0x22f7('0x7'));var logger=require('../../config/logger')(_0x22f7('0x8'));var config=require(_0x22f7('0x9'));var jayson=require(_0x22f7('0xa'));var client=jayson[_0x22f7('0xb')][_0x22f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11cb61,_0x46195a,_0x1ad8d1){return new BPromise(function(_0x261813,_0x434aa4){return client[_0x22f7('0xd')](_0x11cb61,_0x1ad8d1)[_0x22f7('0xe')](function(_0x8457b5){logger[_0x22f7('0xf')](_0x22f7('0x10'),_0x46195a,_0x22f7('0x11'));logger['debug'](_0x22f7('0x12'),_0x46195a,_0x22f7('0x11'),JSON['stringify'](_0x8457b5));if(_0x8457b5[_0x22f7('0x13')]){if(_0x8457b5[_0x22f7('0x13')]['code']===0x1f4){logger[_0x22f7('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x46195a,_0x8457b5[_0x22f7('0x13')][_0x22f7('0x14')]);return _0x434aa4(_0x8457b5['error'][_0x22f7('0x14')]);}logger[_0x22f7('0x13')](_0x22f7('0x10'),_0x46195a,_0x8457b5[_0x22f7('0x13')][_0x22f7('0x14')]);return _0x261813(_0x8457b5[_0x22f7('0x13')][_0x22f7('0x14')]);}else{logger[_0x22f7('0xf')](_0x22f7('0x10'),_0x46195a,_0x22f7('0x11'));_0x261813(_0x8457b5[_0x22f7('0x15')][_0x22f7('0x14')]);}})[_0x22f7('0x16')](function(_0x3b2861){logger[_0x22f7('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x46195a,_0x3b2861);_0x434aa4(_0x3b2861);});});} \ No newline at end of file +var _0xeeaf=['then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x321484,_0x56e5ff){var _0x5bbf41=function(_0x3b53c0){while(--_0x3b53c0){_0x321484['push'](_0x321484['shift']());}};_0x5bbf41(++_0x56e5ff);}(_0xeeaf,0x1bc));var _0xfeea=function(_0x587ebd,_0x1c3c5b){_0x587ebd=_0x587ebd-0x0;var _0xbd35e7=_0xeeaf[_0x587ebd];return _0xbd35e7;};'use strict';var _=require(_0xfeea('0x0'));var util=require(_0xfeea('0x1'));var moment=require(_0xfeea('0x2'));var BPromise=require(_0xfeea('0x3'));var rs=require(_0xfeea('0x4'));var fs=require('fs');var Redis=require(_0xfeea('0x5'));var db=require(_0xfeea('0x6'))['db'];var utils=require(_0xfeea('0x7'));var logger=require('../../config/logger')(_0xfeea('0x8'));var config=require(_0xfeea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfeea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56ee0c,_0x37f662,_0x4980ef){return new BPromise(function(_0x5e10ec,_0x5ef7c8){return client[_0xfeea('0xb')](_0x56ee0c,_0x4980ef)[_0xfeea('0xc')](function(_0x57db5d){logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x37f662,_0xfeea('0xf'));logger[_0xfeea('0x10')](_0xfeea('0x11'),_0x37f662,_0xfeea('0xf'),JSON[_0xfeea('0x12')](_0x57db5d));if(_0x57db5d[_0xfeea('0x13')]){if(_0x57db5d[_0xfeea('0x13')][_0xfeea('0x14')]===0x1f4){logger[_0xfeea('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x37f662,_0x57db5d['error'][_0xfeea('0x15')]);return _0x5ef7c8(_0x57db5d['error'][_0xfeea('0x15')]);}logger[_0xfeea('0x13')](_0xfeea('0xe'),_0x37f662,_0x57db5d['error'][_0xfeea('0x15')]);return _0x5e10ec(_0x57db5d[_0xfeea('0x13')][_0xfeea('0x15')]);}else{logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x37f662,_0xfeea('0xf'));_0x5e10ec(_0x57db5d[_0xfeea('0x16')][_0xfeea('0x15')]);}})[_0xfeea('0x17')](function(_0x2a3668){logger[_0xfeea('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x37f662,_0x2a3668);_0x5ef7c8(_0x2a3668);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index e77b3a8..8780706 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 _0xa057=['isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','index','get','/:id','show','post'];(function(_0x2d9abc,_0x3ed238){var _0x3ef520=function(_0x48e86a){while(--_0x48e86a){_0x2d9abc['push'](_0x2d9abc['shift']());}};_0x3ef520(++_0x3ed238);}(_0xa057,0x123));var _0x7a05=function(_0x1b1832,_0x54251e){_0x1b1832=_0x1b1832-0x0;var _0x1fb883=_0xa057[_0x1b1832];return _0x1fb883;};'use strict';var multer=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var path=require('path');var timeout=require(_0x7a05('0x2'));var express=require(_0x7a05('0x3'));var router=express[_0x7a05('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7a05('0x5'));var interaction=require(_0x7a05('0x6'));var config=require('../../config/environment');var controller=require(_0x7a05('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a05('0x8')]);router[_0x7a05('0x9')](_0x7a05('0xa'),auth['isAuthenticated'](),controller[_0x7a05('0xb')]);router[_0x7a05('0xc')]('/',auth[_0x7a05('0xd')](),controller['create']);router[_0x7a05('0xe')](_0x7a05('0xa'),auth[_0x7a05('0xd')](),controller[_0x7a05('0xf')]);router[_0x7a05('0x10')](_0x7a05('0xa'),auth['isAuthenticated'](),controller[_0x7a05('0x11')]);module[_0x7a05('0x12')]=router; \ No newline at end of file +var _0x8cda=['get','/:id','show','post','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xa8cd('0x0'));var path=require(_0xa8cd('0x1'));var timeout=require(_0xa8cd('0x2'));var express=require(_0xa8cd('0x3'));var router=express[_0xa8cd('0x4')]();var fs_extra=require(_0xa8cd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa8cd('0x6'));var config=require(_0xa8cd('0x7'));var controller=require(_0xa8cd('0x8'));router['get']('/',auth[_0xa8cd('0x9')](),controller[_0xa8cd('0xa')]);router[_0xa8cd('0xb')](_0xa8cd('0xc'),auth[_0xa8cd('0x9')](),controller[_0xa8cd('0xd')]);router[_0xa8cd('0xe')]('/',auth[_0xa8cd('0x9')](),controller['create']);router['put']('/:id',auth[_0xa8cd('0x9')](),controller['update']);router[_0xa8cd('0xf')](_0xa8cd('0xc'),auth['isAuthenticated'](),controller[_0xa8cd('0x10')]);module[_0xa8cd('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0ab0751..9c303fe 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 _0x7c10=['STRING','TEXT','sequelize'];(function(_0x273ba2,_0x501654){var _0x5b71ac=function(_0x3abb5c){while(--_0x3abb5c){_0x273ba2['push'](_0x273ba2['shift']());}};_0x5b71ac(++_0x501654);}(_0x7c10,0x122));var _0x07c1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7c10[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x07c1('0x0'));module['exports']={'name':{'type':Sequelize[_0x07c1('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x07c1('0x2')]}}; \ No newline at end of file +var _0x4d80=['TEXT','sequelize','exports'];(function(_0x3db58d,_0x3f0c01){var _0x17158d=function(_0x1b03f5){while(--_0x1b03f5){_0x3db58d['push'](_0x3db58d['shift']());}};_0x17158d(++_0x3f0c01);}(_0x4d80,0x12d));var _0x04d8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4d80[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x04d8('0x0'));module[_0x04d8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x04d8('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 4a3eab1..2bec073 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 _0xd50f=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','Templates','UserProfileResource','stack','name','send','index','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','sort','filter','where','merge','options','Template','includeAll','include','findAll','catch','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4396ed,_0x4c3568){var _0x5e046f=function(_0x3fe7a7){while(--_0x3fe7a7){_0x4396ed['push'](_0x4396ed['shift']());}};_0x5e046f(++_0x4c3568);}(_0xd50f,0x130));var _0xfd50=function(_0x33c5af,_0x13d18a){_0x33c5af=_0x33c5af-0x0;var _0x49707f=_0xd50f[_0x33c5af];return _0x49707f;};'use strict';var emlformat=require(_0xfd50('0x0'));var rimraf=require(_0xfd50('0x1'));var zipdir=require(_0xfd50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfd50('0x3'));var moment=require(_0xfd50('0x4'));var BPromise=require(_0xfd50('0x5'));var Mustache=require(_0xfd50('0x6'));var util=require(_0xfd50('0x7'));var path=require(_0xfd50('0x8'));var sox=require(_0xfd50('0x9'));var csv=require(_0xfd50('0xa'));var ejs=require(_0xfd50('0xb'));var fs=require('fs');var fs_extra=require(_0xfd50('0xc'));var _=require(_0xfd50('0xd'));var squel=require(_0xfd50('0xe'));var crypto=require(_0xfd50('0xf'));var jsforce=require(_0xfd50('0x10'));var deskjs=require(_0xfd50('0x11'));var toCsv=require(_0xfd50('0xa'));var querystring=require(_0xfd50('0x12'));var Papa=require(_0xfd50('0x13'));var Redis=require(_0xfd50('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xfd50('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd50('0x16'));var logger=require(_0xfd50('0x17'))(_0xfd50('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd50('0x19'));var db=require(_0xfd50('0x1a'))['db'];function respondWithStatusCode(_0x5450aa,_0x55f40f){_0x55f40f=_0x55f40f||0xcc;return function(_0x37374d){if(_0x37374d){return _0x5450aa[_0xfd50('0x1b')](_0x55f40f);}return _0x5450aa[_0xfd50('0x1c')](_0x55f40f)[_0xfd50('0x1d')]();};}function respondWithResult(_0x53f7c3,_0x5a6990){_0x5a6990=_0x5a6990||0xc8;return function(_0x5babbc){if(_0x5babbc){return _0x53f7c3[_0xfd50('0x1c')](_0x5a6990)[_0xfd50('0x1e')](_0x5babbc);}};}function respondWithFilteredResult(_0x27cb23,_0x2d554f){return function(_0x5c333b){if(_0x5c333b){var _0x9bfcf9=typeof _0x2d554f[_0xfd50('0x1f')]===_0xfd50('0x20')&&typeof _0x2d554f[_0xfd50('0x21')]===_0xfd50('0x20');var _0x4aa796=_0x5c333b[_0xfd50('0x22')];var _0x64dbcf=_0x9bfcf9?0x0:_0x2d554f[_0xfd50('0x1f')];var _0x158a87=_0x9bfcf9?_0x5c333b[_0xfd50('0x22')]:_0x2d554f[_0xfd50('0x1f')]+_0x2d554f[_0xfd50('0x21')];var _0x4d6cf4;if(_0x158a87>=_0x4aa796){_0x158a87=_0x4aa796;_0x4d6cf4=0xc8;}else{_0x4d6cf4=0xce;}_0x27cb23[_0xfd50('0x1c')](_0x4d6cf4);return _0x27cb23[_0xfd50('0x23')](_0xfd50('0x24'),_0x64dbcf+'-'+_0x158a87+'/'+_0x4aa796)[_0xfd50('0x1e')](_0x5c333b);}return null;};}function patchUpdates(_0x99caad){return function(_0x19ac43){try{jsonpatch['apply'](_0x19ac43,_0x99caad,!![]);}catch(_0x171868){return BPromise[_0xfd50('0x25')](_0x171868);}return _0x19ac43['save']();};}function saveUpdates(_0x1943e5,_0x305331){return function(_0x5c9cd6){if(_0x5c9cd6){return _0x5c9cd6[_0xfd50('0x26')](_0x1943e5)[_0xfd50('0x27')](function(_0x4d74fa){return _0x4d74fa;});}return null;};}function removeEntity(_0x2694fc,_0x4c1875){return function(_0x3b1a8c){if(_0x3b1a8c){return _0x3b1a8c[_0xfd50('0x28')]()[_0xfd50('0x27')](function(){var _0x367558=_0x3b1a8c['get']({'plain':!![]});var _0x210210=_0xfd50('0x29');return db[_0xfd50('0x2a')][_0xfd50('0x28')]({'where':{'type':_0x210210,'resourceId':_0x367558['id']}})[_0xfd50('0x27')](function(){return _0x3b1a8c;});})['then'](function(){_0x2694fc[_0xfd50('0x1c')](0xcc)[_0xfd50('0x1d')]();});}};}function handleEntityNotFound(_0x3b6035,_0x1ea9c5){return function(_0x48f390){if(!_0x48f390){_0x3b6035['sendStatus'](0x194);}return _0x48f390;};}function handleError(_0x93394e,_0x37bbad){_0x37bbad=_0x37bbad||0x1f4;return function(_0x463e25){logger['error'](_0x463e25[_0xfd50('0x2b')]);if(_0x463e25[_0xfd50('0x2c')]){delete _0x463e25[_0xfd50('0x2c')];}_0x93394e[_0xfd50('0x1c')](_0x37bbad)[_0xfd50('0x2d')](_0x463e25);};}exports[_0xfd50('0x2e')]=function(_0x49cda4,_0x4796da){var _0x30a132={},_0xf6a698={},_0x39284f={'count':0x0,'rows':[]};var _0x111635=_['map'](db['Template'][_0xfd50('0x2f')],function(_0xafa0b5){return{'name':_0xafa0b5['fieldName'],'type':_0xafa0b5[_0xfd50('0x30')]['key']};});_0xf6a698[_0xfd50('0x31')]=_[_0xfd50('0x32')](_0x111635,_0xfd50('0x2c'));_0xf6a698['query']=_[_0xfd50('0x33')](_0x49cda4[_0xfd50('0x34')]);_0xf6a698[_0xfd50('0x35')]=_[_0xfd50('0x36')](_0xf6a698[_0xfd50('0x31')],_0xf6a698[_0xfd50('0x34')]);_0x30a132[_0xfd50('0x37')]=_[_0xfd50('0x36')](_0xf6a698['model'],qs[_0xfd50('0x38')](_0x49cda4[_0xfd50('0x34')]['fields']));_0x30a132[_0xfd50('0x37')]=_0x30a132['attributes']['length']?_0x30a132[_0xfd50('0x37')]:_0xf6a698[_0xfd50('0x31')];if(!_0x49cda4[_0xfd50('0x34')]['hasOwnProperty']('nolimit')){_0x30a132[_0xfd50('0x21')]=qs['limit'](_0x49cda4[_0xfd50('0x34')]['limit']);_0x30a132[_0xfd50('0x1f')]=qs[_0xfd50('0x1f')](_0x49cda4[_0xfd50('0x34')][_0xfd50('0x1f')]);}_0x30a132['order']=qs[_0xfd50('0x39')](_0x49cda4['query'][_0xfd50('0x39')]);_0x30a132['where']=qs['filters'](_['pick'](_0x49cda4[_0xfd50('0x34')],_0xf6a698[_0xfd50('0x35')]),_0x111635);if(_0x49cda4['query'][_0xfd50('0x3a')]){_0x30a132[_0xfd50('0x3b')]=_[_0xfd50('0x3c')](_0x30a132['where'],{'$or':_[_0xfd50('0x32')](_0x111635,function(_0x22067c){if(_0x22067c[_0xfd50('0x30')]!=='VIRTUAL'){var _0x50ffde={};_0x50ffde[_0x22067c[_0xfd50('0x2c')]]={'$like':'%'+_0x49cda4[_0xfd50('0x34')][_0xfd50('0x3a')]+'%'};return _0x50ffde;}})});}_0x30a132=_[_0xfd50('0x3c')]({},_0x30a132,_0x49cda4[_0xfd50('0x3d')]);var _0xf70485={'where':_0x30a132[_0xfd50('0x3b')]};return db[_0xfd50('0x3e')][_0xfd50('0x22')](_0xf70485)[_0xfd50('0x27')](function(_0x1d89cb){_0x39284f[_0xfd50('0x22')]=_0x1d89cb;if(_0x49cda4[_0xfd50('0x34')][_0xfd50('0x3f')]){_0x30a132[_0xfd50('0x40')]=[{'all':!![]}];}return db['Template'][_0xfd50('0x41')](_0x30a132);})[_0xfd50('0x27')](function(_0x3a8b7b){_0x39284f['rows']=_0x3a8b7b;return _0x39284f;})[_0xfd50('0x27')](respondWithFilteredResult(_0x4796da,_0x30a132))[_0xfd50('0x42')](handleError(_0x4796da,null));};exports[_0xfd50('0x43')]=function(_0x1ee0da,_0x445be5){var _0x56c49c={'raw':!![],'where':{'id':_0x1ee0da[_0xfd50('0x44')]['id']}},_0x4e9f10={};_0x4e9f10['model']=_['keys'](db[_0xfd50('0x3e')]['rawAttributes']);_0x4e9f10[_0xfd50('0x34')]=_[_0xfd50('0x33')](_0x1ee0da[_0xfd50('0x34')]);_0x4e9f10[_0xfd50('0x35')]=_[_0xfd50('0x36')](_0x4e9f10['model'],_0x4e9f10[_0xfd50('0x34')]);_0x56c49c[_0xfd50('0x37')]=_[_0xfd50('0x36')](_0x4e9f10[_0xfd50('0x31')],qs[_0xfd50('0x38')](_0x1ee0da[_0xfd50('0x34')]['fields']));_0x56c49c[_0xfd50('0x37')]=_0x56c49c[_0xfd50('0x37')][_0xfd50('0x45')]?_0x56c49c[_0xfd50('0x37')]:_0x4e9f10[_0xfd50('0x31')];if(_0x1ee0da[_0xfd50('0x34')][_0xfd50('0x3f')]){_0x56c49c[_0xfd50('0x40')]=[{'all':!![]}];}_0x56c49c=_[_0xfd50('0x3c')]({},_0x56c49c,_0x1ee0da[_0xfd50('0x3d')]);return db[_0xfd50('0x3e')][_0xfd50('0x46')](_0x56c49c)[_0xfd50('0x27')](handleEntityNotFound(_0x445be5,null))[_0xfd50('0x27')](respondWithResult(_0x445be5,null))[_0xfd50('0x42')](handleError(_0x445be5,null));};exports[_0xfd50('0x47')]=function(_0x158af4,_0x2584c2){return db['Template'][_0xfd50('0x47')](_0x158af4[_0xfd50('0x48')],{})[_0xfd50('0x27')](function(_0x16abe5){var _0x477e2c=_0x158af4['user'][_0xfd50('0x49')]({'plain':!![]});if(!_0x477e2c)throw new Error(_0xfd50('0x4a'));if(_0x477e2c[_0xfd50('0x4b')]==='user'){var _0x3834fc=_0x16abe5[_0xfd50('0x49')]({'plain':!![]});var _0x506523=_0xfd50('0x29');return db[_0xfd50('0x4c')]['find']({'where':{'name':_0x506523,'userProfileId':_0x477e2c[_0xfd50('0x4d')]},'raw':!![]})['then'](function(_0x17ed75){if(_0x17ed75&&_0x17ed75[_0xfd50('0x4e')]===0x0){return db['UserProfileResource'][_0xfd50('0x47')]({'name':_0x3834fc[_0xfd50('0x2c')],'resourceId':_0x3834fc['id'],'type':_0x17ed75[_0xfd50('0x2c')],'sectionId':_0x17ed75['id']},{})[_0xfd50('0x27')](function(){return _0x16abe5;});}else{return _0x16abe5;}})['catch'](function(_0x32bacb){logger[_0xfd50('0x4f')](_0xfd50('0x50'),_0x32bacb);throw _0x32bacb;});}return _0x16abe5;})['then'](respondWithResult(_0x2584c2,0xc9))['catch'](handleError(_0x2584c2,null));};exports[_0xfd50('0x26')]=function(_0x4ba931,_0x1ca6b5){if(_0x4ba931[_0xfd50('0x48')]['id']){delete _0x4ba931[_0xfd50('0x48')]['id'];}return db['Template'][_0xfd50('0x46')]({'where':{'id':_0x4ba931[_0xfd50('0x44')]['id']}})[_0xfd50('0x27')](handleEntityNotFound(_0x1ca6b5,null))[_0xfd50('0x27')](saveUpdates(_0x4ba931[_0xfd50('0x48')],null))['then'](respondWithResult(_0x1ca6b5,null))[_0xfd50('0x42')](handleError(_0x1ca6b5,null));};exports[_0xfd50('0x28')]=function(_0x895cc6,_0x3a7e88){return db['Template'][_0xfd50('0x46')]({'where':{'id':_0x895cc6[_0xfd50('0x44')]['id']}})[_0xfd50('0x27')](handleEntityNotFound(_0x3a7e88,null))[_0xfd50('0x27')](removeEntity(_0x3a7e88,null))['catch'](handleError(_0x3a7e88,null));}; \ No newline at end of file +var _0xe0ba=['offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','get','Templates','end','sendStatus','error','stack','name','send','index','map','Template','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x5eded0,_0x719cfc){var _0x18ad28=function(_0x84aa9e){while(--_0x84aa9e){_0x5eded0['push'](_0x5eded0['shift']());}};_0x18ad28(++_0x719cfc);}(_0xe0ba,0x90));var _0xae0b=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xe0ba[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require(_0xae0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae0b('0x1'));var jsonpatch=require(_0xae0b('0x2'));var rp=require(_0xae0b('0x3'));var moment=require(_0xae0b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xae0b('0x5'));var path=require('path');var sox=require(_0xae0b('0x6'));var csv=require(_0xae0b('0x7'));var ejs=require(_0xae0b('0x8'));var fs=require('fs');var fs_extra=require(_0xae0b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xae0b('0xa'));var jsforce=require(_0xae0b('0xb'));var deskjs=require(_0xae0b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xae0b('0xd'));var Papa=require(_0xae0b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xae0b('0xf'));var as=require(_0xae0b('0x10'));var hardwareService=require(_0xae0b('0x11'));var logger=require(_0xae0b('0x12'))(_0xae0b('0x13'));var utils=require(_0xae0b('0x14'));var config=require(_0xae0b('0x15'));var licenseUtil=require(_0xae0b('0x16'));var db=require(_0xae0b('0x17'))['db'];function respondWithStatusCode(_0x4259eb,_0x292e6e){_0x292e6e=_0x292e6e||0xcc;return function(_0x6142fe){if(_0x6142fe){return _0x4259eb['sendStatus'](_0x292e6e);}return _0x4259eb['status'](_0x292e6e)['end']();};}function respondWithResult(_0xc9a7b0,_0x125c79){_0x125c79=_0x125c79||0xc8;return function(_0x1ccf3f){if(_0x1ccf3f){return _0xc9a7b0[_0xae0b('0x18')](_0x125c79)[_0xae0b('0x19')](_0x1ccf3f);}};}function respondWithFilteredResult(_0x2822b8,_0x403ea5){return function(_0x3e1663){if(_0x3e1663){var _0x29d456=typeof _0x403ea5[_0xae0b('0x1a')]===_0xae0b('0x1b')&&typeof _0x403ea5[_0xae0b('0x1c')]==='undefined';var _0x1d0636=_0x3e1663['count'];var _0x5f1021=_0x29d456?0x0:_0x403ea5[_0xae0b('0x1a')];var _0x9df73b=_0x29d456?_0x3e1663['count']:_0x403ea5[_0xae0b('0x1a')]+_0x403ea5[_0xae0b('0x1c')];var _0x39ba23;if(_0x9df73b>=_0x1d0636){_0x9df73b=_0x1d0636;_0x39ba23=0xc8;}else{_0x39ba23=0xce;}_0x2822b8[_0xae0b('0x18')](_0x39ba23);return _0x2822b8[_0xae0b('0x1d')](_0xae0b('0x1e'),_0x5f1021+'-'+_0x9df73b+'/'+_0x1d0636)[_0xae0b('0x19')](_0x3e1663);}return null;};}function patchUpdates(_0x37ca35){return function(_0x53833f){try{jsonpatch[_0xae0b('0x1f')](_0x53833f,_0x37ca35,!![]);}catch(_0x1b5121){return BPromise[_0xae0b('0x20')](_0x1b5121);}return _0x53833f[_0xae0b('0x21')]();};}function saveUpdates(_0x182adc,_0xee8e34){return function(_0x426eed){if(_0x426eed){return _0x426eed['update'](_0x182adc)['then'](function(_0x2153f3){return _0x2153f3;});}return null;};}function removeEntity(_0x4fda06,_0x3ba052){return function(_0x22fce6){if(_0x22fce6){return _0x22fce6[_0xae0b('0x22')]()[_0xae0b('0x23')](function(){var _0x5d329b=_0x22fce6[_0xae0b('0x24')]({'plain':!![]});var _0x23dae1=_0xae0b('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x23dae1,'resourceId':_0x5d329b['id']}})[_0xae0b('0x23')](function(){return _0x22fce6;});})['then'](function(){_0x4fda06[_0xae0b('0x18')](0xcc)[_0xae0b('0x26')]();});}};}function handleEntityNotFound(_0x4493e2,_0x5b2221){return function(_0x437324){if(!_0x437324){_0x4493e2[_0xae0b('0x27')](0x194);}return _0x437324;};}function handleError(_0x22ba69,_0x1c593c){_0x1c593c=_0x1c593c||0x1f4;return function(_0x3ac41b){logger[_0xae0b('0x28')](_0x3ac41b[_0xae0b('0x29')]);if(_0x3ac41b[_0xae0b('0x2a')]){delete _0x3ac41b[_0xae0b('0x2a')];}_0x22ba69[_0xae0b('0x18')](_0x1c593c)[_0xae0b('0x2b')](_0x3ac41b);};}exports[_0xae0b('0x2c')]=function(_0x20dc55,_0x313572){var _0xca1cbd={},_0x1dde0d={},_0x467d4f={'count':0x0,'rows':[]};var _0x183f9d=_[_0xae0b('0x2d')](db[_0xae0b('0x2e')][_0xae0b('0x2f')],function(_0x2aa361){return{'name':_0x2aa361['fieldName'],'type':_0x2aa361[_0xae0b('0x30')]['key']};});_0x1dde0d[_0xae0b('0x31')]=_['map'](_0x183f9d,_0xae0b('0x2a'));_0x1dde0d[_0xae0b('0x32')]=_['keys'](_0x20dc55[_0xae0b('0x32')]);_0x1dde0d[_0xae0b('0x33')]=_[_0xae0b('0x34')](_0x1dde0d[_0xae0b('0x31')],_0x1dde0d[_0xae0b('0x32')]);_0xca1cbd[_0xae0b('0x35')]=_[_0xae0b('0x34')](_0x1dde0d[_0xae0b('0x31')],qs[_0xae0b('0x36')](_0x20dc55['query']['fields']));_0xca1cbd[_0xae0b('0x35')]=_0xca1cbd[_0xae0b('0x35')][_0xae0b('0x37')]?_0xca1cbd['attributes']:_0x1dde0d['model'];if(!_0x20dc55[_0xae0b('0x32')]['hasOwnProperty'](_0xae0b('0x38'))){_0xca1cbd['limit']=qs[_0xae0b('0x1c')](_0x20dc55[_0xae0b('0x32')][_0xae0b('0x1c')]);_0xca1cbd[_0xae0b('0x1a')]=qs[_0xae0b('0x1a')](_0x20dc55[_0xae0b('0x32')]['offset']);}_0xca1cbd[_0xae0b('0x39')]=qs[_0xae0b('0x3a')](_0x20dc55[_0xae0b('0x32')][_0xae0b('0x3a')]);_0xca1cbd[_0xae0b('0x3b')]=qs['filters'](_[_0xae0b('0x3c')](_0x20dc55[_0xae0b('0x32')],_0x1dde0d['filters']),_0x183f9d);if(_0x20dc55[_0xae0b('0x32')][_0xae0b('0x3d')]){_0xca1cbd[_0xae0b('0x3b')]=_[_0xae0b('0x3e')](_0xca1cbd[_0xae0b('0x3b')],{'$or':_[_0xae0b('0x2d')](_0x183f9d,function(_0x3f1e9b){if(_0x3f1e9b[_0xae0b('0x30')]!==_0xae0b('0x3f')){var _0x23c5b1={};_0x23c5b1[_0x3f1e9b[_0xae0b('0x2a')]]={'$like':'%'+_0x20dc55['query'][_0xae0b('0x3d')]+'%'};return _0x23c5b1;}})});}_0xca1cbd=_['merge']({},_0xca1cbd,_0x20dc55[_0xae0b('0x40')]);var _0x599785={'where':_0xca1cbd[_0xae0b('0x3b')]};return db[_0xae0b('0x2e')][_0xae0b('0x41')](_0x599785)[_0xae0b('0x23')](function(_0x16f01f){_0x467d4f[_0xae0b('0x41')]=_0x16f01f;if(_0x20dc55['query'][_0xae0b('0x42')]){_0xca1cbd[_0xae0b('0x43')]=[{'all':!![]}];}return db[_0xae0b('0x2e')]['findAll'](_0xca1cbd);})[_0xae0b('0x23')](function(_0x5c0e22){_0x467d4f[_0xae0b('0x44')]=_0x5c0e22;return _0x467d4f;})['then'](respondWithFilteredResult(_0x313572,_0xca1cbd))[_0xae0b('0x45')](handleError(_0x313572,null));};exports[_0xae0b('0x46')]=function(_0x42804a,_0x42e470){var _0x5bc900={'raw':!![],'where':{'id':_0x42804a['params']['id']}},_0x31d1b6={};_0x31d1b6[_0xae0b('0x31')]=_[_0xae0b('0x47')](db[_0xae0b('0x2e')][_0xae0b('0x2f')]);_0x31d1b6[_0xae0b('0x32')]=_[_0xae0b('0x47')](_0x42804a[_0xae0b('0x32')]);_0x31d1b6['filters']=_[_0xae0b('0x34')](_0x31d1b6['model'],_0x31d1b6[_0xae0b('0x32')]);_0x5bc900[_0xae0b('0x35')]=_[_0xae0b('0x34')](_0x31d1b6[_0xae0b('0x31')],qs['fields'](_0x42804a[_0xae0b('0x32')][_0xae0b('0x36')]));_0x5bc900['attributes']=_0x5bc900['attributes'][_0xae0b('0x37')]?_0x5bc900[_0xae0b('0x35')]:_0x31d1b6[_0xae0b('0x31')];if(_0x42804a[_0xae0b('0x32')][_0xae0b('0x42')]){_0x5bc900[_0xae0b('0x43')]=[{'all':!![]}];}_0x5bc900=_[_0xae0b('0x3e')]({},_0x5bc900,_0x42804a['options']);return db[_0xae0b('0x2e')][_0xae0b('0x48')](_0x5bc900)[_0xae0b('0x23')](handleEntityNotFound(_0x42e470,null))[_0xae0b('0x23')](respondWithResult(_0x42e470,null))[_0xae0b('0x45')](handleError(_0x42e470,null));};exports['create']=function(_0x3810a8,_0x1d46b2){return db[_0xae0b('0x2e')][_0xae0b('0x49')](_0x3810a8[_0xae0b('0x4a')],{})[_0xae0b('0x23')](function(_0x11f13e){var _0x107820=_0x3810a8[_0xae0b('0x4b')][_0xae0b('0x24')]({'plain':!![]});if(!_0x107820)throw new Error(_0xae0b('0x4c'));if(_0x107820[_0xae0b('0x4d')]===_0xae0b('0x4b')){var _0x3d7d7c=_0x11f13e[_0xae0b('0x24')]({'plain':!![]});var _0x37289a='Templates';return db[_0xae0b('0x4e')][_0xae0b('0x48')]({'where':{'name':_0x37289a,'userProfileId':_0x107820[_0xae0b('0x4f')]},'raw':!![]})[_0xae0b('0x23')](function(_0x49500a){if(_0x49500a&&_0x49500a[_0xae0b('0x50')]===0x0){return db[_0xae0b('0x51')][_0xae0b('0x49')]({'name':_0x3d7d7c[_0xae0b('0x2a')],'resourceId':_0x3d7d7c['id'],'type':_0x49500a[_0xae0b('0x2a')],'sectionId':_0x49500a['id']},{})['then'](function(){return _0x11f13e;});}else{return _0x11f13e;}})[_0xae0b('0x45')](function(_0x4cf58d){logger[_0xae0b('0x28')](_0xae0b('0x52'),_0x4cf58d);throw _0x4cf58d;});}return _0x11f13e;})[_0xae0b('0x23')](respondWithResult(_0x1d46b2,0xc9))[_0xae0b('0x45')](handleError(_0x1d46b2,null));};exports[_0xae0b('0x53')]=function(_0x216db3,_0x489635){if(_0x216db3[_0xae0b('0x4a')]['id']){delete _0x216db3[_0xae0b('0x4a')]['id'];}return db[_0xae0b('0x2e')][_0xae0b('0x48')]({'where':{'id':_0x216db3[_0xae0b('0x54')]['id']}})[_0xae0b('0x23')](handleEntityNotFound(_0x489635,null))[_0xae0b('0x23')](saveUpdates(_0x216db3[_0xae0b('0x4a')],null))[_0xae0b('0x23')](respondWithResult(_0x489635,null))[_0xae0b('0x45')](handleError(_0x489635,null));};exports[_0xae0b('0x22')]=function(_0x2f566c,_0x156c16){return db[_0xae0b('0x2e')][_0xae0b('0x48')]({'where':{'id':_0x2f566c['params']['id']}})[_0xae0b('0x23')](handleEntityNotFound(_0x156c16,null))[_0xae0b('0x23')](removeEntity(_0x156c16,null))[_0xae0b('0x45')](handleError(_0x156c16,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1432f41..e48c134 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 _0x39a7=['path','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','util','../../config/logger','api','moment','request-promise'];(function(_0x199939,_0x3d3cb9){var _0x1522b6=function(_0x28fe8a){while(--_0x28fe8a){_0x199939['push'](_0x199939['shift']());}};_0x1522b6(++_0x3d3cb9);}(_0x39a7,0x1e7));var _0x739a=function(_0x488b85,_0x10ec23){_0x488b85=_0x488b85-0x0;var _0x59d07d=_0x39a7[_0x488b85];return _0x59d07d;};'use strict';var _=require('lodash');var util=require(_0x739a('0x0'));var logger=require(_0x739a('0x1'))(_0x739a('0x2'));var moment=require(_0x739a('0x3'));var BPromise=require('bluebird');var rp=require(_0x739a('0x4'));var fs=require('fs');var path=require(_0x739a('0x5'));var rimraf=require(_0x739a('0x6'));var config=require(_0x739a('0x7'));var attributes=require(_0x739a('0x8'));module[_0x739a('0x9')]=function(_0x1d8e7a,_0x20830f){return _0x1d8e7a[_0x739a('0xa')]('Template',attributes,{'tableName':_0x739a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x181e=['Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports'];(function(_0x2bfa88,_0xc64230){var _0x2e7039=function(_0x4b87cc){while(--_0x4b87cc){_0x2bfa88['push'](_0x2bfa88['shift']());}};_0x2e7039(++_0xc64230);}(_0x181e,0x12e));var _0xe181=function(_0xe348d6,_0x11a06a){_0xe348d6=_0xe348d6-0x0;var _0x57a7ff=_0x181e[_0xe348d6];return _0x57a7ff;};'use strict';var _=require(_0xe181('0x0'));var util=require('util');var logger=require(_0xe181('0x1'))(_0xe181('0x2'));var moment=require(_0xe181('0x3'));var BPromise=require(_0xe181('0x4'));var rp=require(_0xe181('0x5'));var fs=require('fs');var path=require(_0xe181('0x6'));var rimraf=require('rimraf');var config=require(_0xe181('0x7'));var attributes=require(_0xe181('0x8'));module[_0xe181('0x9')]=function(_0x49b185,_0x5356b7){return _0x49b185['define'](_0xe181('0xa'),attributes,{'tableName':_0xe181('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 b940129..f287a2e 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 _0xb313=['debug','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x34f9e1,_0xa3c565){var _0xdea2c2=function(_0x1439a6){while(--_0x1439a6){_0x34f9e1['push'](_0x34f9e1['shift']());}};_0xdea2c2(++_0xa3c565);}(_0xb313,0x142));var _0x3b31=function(_0x590863,_0x5a74d5){_0x590863=_0x590863-0x0;var _0x5c26d4=_0xb313[_0x590863];return _0x5c26d4;};'use strict';var _=require(_0x3b31('0x0'));var util=require(_0x3b31('0x1'));var moment=require(_0x3b31('0x2'));var BPromise=require(_0x3b31('0x3'));var rs=require(_0x3b31('0x4'));var fs=require('fs');var Redis=require(_0x3b31('0x5'));var db=require(_0x3b31('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b31('0x7'));var config=require('../../config/environment');var jayson=require(_0x3b31('0x8'));var client=jayson[_0x3b31('0x9')][_0x3b31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11fe0a,_0x20d02b,_0x4a5947){return new BPromise(function(_0x192a8d,_0x2267b3){return client[_0x3b31('0xb')](_0x11fe0a,_0x4a5947)[_0x3b31('0xc')](function(_0x448314){logger['info']('Template,\x20%s,\x20%s',_0x20d02b,_0x3b31('0xd'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x20d02b,_0x3b31('0xd'),JSON[_0x3b31('0xe')](_0x448314));if(_0x448314[_0x3b31('0xf')]){if(_0x448314[_0x3b31('0xf')][_0x3b31('0x10')]===0x1f4){logger[_0x3b31('0xf')](_0x3b31('0x11'),_0x20d02b,_0x448314[_0x3b31('0xf')]['message']);return _0x2267b3(_0x448314[_0x3b31('0xf')]['message']);}logger[_0x3b31('0xf')](_0x3b31('0x11'),_0x20d02b,_0x448314[_0x3b31('0xf')][_0x3b31('0x12')]);return _0x192a8d(_0x448314[_0x3b31('0xf')]['message']);}else{logger[_0x3b31('0x13')](_0x3b31('0x11'),_0x20d02b,'request\x20sent');_0x192a8d(_0x448314[_0x3b31('0x14')][_0x3b31('0x12')]);}})[_0x3b31('0x15')](function(_0x5d3eca){logger['error'](_0x3b31('0x11'),_0x20d02b,_0x5d3eca);_0x2267b3(_0x5d3eca);});});}exports['GetTemplate']=function(_0x4f5569){var _0x480a33=this;return new Promise(function(_0x1b008c,_0x401e14){return db['Template'][_0x3b31('0x16')]({'raw':_0x4f5569[_0x3b31('0x17')]?_0x4f5569[_0x3b31('0x17')][_0x3b31('0x18')]===undefined?!![]:![]:!![],'where':_0x4f5569[_0x3b31('0x17')]?_0x4f5569[_0x3b31('0x17')]['where']||null:null,'attributes':_0x4f5569['options']?_0x4f5569[_0x3b31('0x17')][_0x3b31('0x19')]||null:null,'limit':_0x4f5569['options']?_0x4f5569['options'][_0x3b31('0x1a')]||null:null,'include':_0x4f5569['options']?_0x4f5569['options'][_0x3b31('0x1b')]?_[_0x3b31('0x1c')](_0x4f5569[_0x3b31('0x17')]['include'],function(_0x4fb835){return{'model':db[_0x4fb835[_0x3b31('0x1d')]],'as':_0x4fb835['as'],'attributes':_0x4fb835[_0x3b31('0x19')],'include':_0x4fb835['include']?_[_0x3b31('0x1c')](_0x4fb835[_0x3b31('0x1b')],function(_0x21bfb5){return{'model':db[_0x21bfb5[_0x3b31('0x1d')]],'as':_0x21bfb5['as'],'attributes':_0x21bfb5[_0x3b31('0x19')],'include':_0x21bfb5[_0x3b31('0x1b')]?_[_0x3b31('0x1c')](_0x21bfb5['include'],function(_0x2e1e9b){return{'model':db[_0x2e1e9b[_0x3b31('0x1d')]],'as':_0x2e1e9b['as'],'attributes':_0x2e1e9b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57ad6e){logger[_0x3b31('0x13')]('GetTemplate',_0x4f5569);logger[_0x3b31('0x1e')](_0x3b31('0x1f'),_0x4f5569,JSON[_0x3b31('0xe')](_0x57ad6e));_0x1b008c(_0x57ad6e);})[_0x3b31('0x15')](function(_0x4189db){logger['error'](_0x3b31('0x1f'),_0x4189db['message'],_0x4f5569);_0x401e14(_0x480a33['error'](0x1f4,_0x4189db[_0x3b31('0x12')]));});});}; \ No newline at end of file +var _0x02b5=['error','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x41ea22,_0x3b31f4){var _0x9694d3=function(_0x19a86d){while(--_0x19a86d){_0x41ea22['push'](_0x41ea22['shift']());}};_0x9694d3(++_0x3b31f4);}(_0x02b5,0x11e));var _0x502b=function(_0x1cade3,_0x3d9775){_0x1cade3=_0x1cade3-0x0;var _0x15b255=_0x02b5[_0x1cade3];return _0x15b255;};'use strict';var _=require(_0x502b('0x0'));var util=require(_0x502b('0x1'));var moment=require(_0x502b('0x2'));var BPromise=require(_0x502b('0x3'));var rs=require(_0x502b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x502b('0x5'))['db'];var utils=require(_0x502b('0x6'));var logger=require(_0x502b('0x7'))(_0x502b('0x8'));var config=require('../../config/environment');var jayson=require(_0x502b('0x9'));var client=jayson['client'][_0x502b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5564c1,_0x1af1ec,_0x4ca785){return new BPromise(function(_0x20d55d,_0x589f4f){return client[_0x502b('0xb')](_0x5564c1,_0x4ca785)[_0x502b('0xc')](function(_0x5b0a3f){logger[_0x502b('0xd')](_0x502b('0xe'),_0x1af1ec,_0x502b('0xf'));logger[_0x502b('0x10')](_0x502b('0x11'),_0x1af1ec,'request\x20sent',JSON[_0x502b('0x12')](_0x5b0a3f));if(_0x5b0a3f['error']){if(_0x5b0a3f['error'][_0x502b('0x13')]===0x1f4){logger['error'](_0x502b('0xe'),_0x1af1ec,_0x5b0a3f[_0x502b('0x14')][_0x502b('0x15')]);return _0x589f4f(_0x5b0a3f[_0x502b('0x14')][_0x502b('0x15')]);}logger[_0x502b('0x14')](_0x502b('0xe'),_0x1af1ec,_0x5b0a3f[_0x502b('0x14')]['message']);return _0x20d55d(_0x5b0a3f[_0x502b('0x14')][_0x502b('0x15')]);}else{logger[_0x502b('0xd')](_0x502b('0xe'),_0x1af1ec,_0x502b('0xf'));_0x20d55d(_0x5b0a3f[_0x502b('0x16')][_0x502b('0x15')]);}})[_0x502b('0x17')](function(_0x56d05a){logger['error'](_0x502b('0xe'),_0x1af1ec,_0x56d05a);_0x589f4f(_0x56d05a);});});}exports[_0x502b('0x18')]=function(_0x126602){var _0x57a06f=this;return new Promise(function(_0x3c9546,_0x7cb0ae){return db[_0x502b('0x19')]['findAll']({'raw':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1b')]===undefined?!![]:![]:!![],'where':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1c')]||null:null,'attributes':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1d')]||null:null,'limit':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1e')]||null:null,'include':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1f')]?_[_0x502b('0x20')](_0x126602[_0x502b('0x1a')][_0x502b('0x1f')],function(_0x4a0aa3){return{'model':db[_0x4a0aa3[_0x502b('0x21')]],'as':_0x4a0aa3['as'],'attributes':_0x4a0aa3[_0x502b('0x1d')],'include':_0x4a0aa3[_0x502b('0x1f')]?_[_0x502b('0x20')](_0x4a0aa3[_0x502b('0x1f')],function(_0x2e11fe){return{'model':db[_0x2e11fe[_0x502b('0x21')]],'as':_0x2e11fe['as'],'attributes':_0x2e11fe[_0x502b('0x1d')],'include':_0x2e11fe[_0x502b('0x1f')]?_[_0x502b('0x20')](_0x2e11fe['include'],function(_0x33dcfa){return{'model':db[_0x33dcfa['model']],'as':_0x33dcfa['as'],'attributes':_0x33dcfa[_0x502b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x502b('0xc')](function(_0x48e4c7){logger[_0x502b('0xd')](_0x502b('0x18'),_0x126602);logger[_0x502b('0x10')]('GetTemplate',_0x126602,JSON[_0x502b('0x12')](_0x48e4c7));_0x3c9546(_0x48e4c7);})[_0x502b('0x17')](function(_0x704384){logger[_0x502b('0x14')](_0x502b('0x18'),_0x704384[_0x502b('0x15')],_0x126602);_0x7cb0ae(_0x57a06f['error'](0x1f4,_0x704384[_0x502b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index b0978c1..6f8674d 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 _0xa316=['addAllCondition','addAnyCondition','addAction','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','/:id/all_conditions'];(function(_0x252805,_0x1d1e8e){var _0x3e74b9=function(_0x16d7a0){while(--_0x16d7a0){_0x252805['push'](_0x252805['shift']());}};_0x3e74b9(++_0x1d1e8e);}(_0xa316,0x1af));var _0x6a31=function(_0x170f0a,_0x15fad9){_0x170f0a=_0x170f0a-0x0;var _0x5f27a2=_0xa316[_0x170f0a];return _0x5f27a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a31('0x0'));var timeout=require(_0x6a31('0x1'));var express=require(_0x6a31('0x2'));var router=express[_0x6a31('0x3')]();var fs_extra=require(_0x6a31('0x4'));var auth=require(_0x6a31('0x5'));var interaction=require(_0x6a31('0x6'));var config=require('../../config/environment');var controller=require(_0x6a31('0x7'));router[_0x6a31('0x8')]('/',auth[_0x6a31('0x9')](),controller[_0x6a31('0xa')]);router[_0x6a31('0x8')](_0x6a31('0xb'),auth[_0x6a31('0x9')](),controller['show']);router[_0x6a31('0x8')]('/:id/all_conditions',auth[_0x6a31('0x9')](),controller[_0x6a31('0xc')]);router[_0x6a31('0x8')](_0x6a31('0xd'),auth[_0x6a31('0x9')](),controller['getAnyConditions']);router[_0x6a31('0x8')](_0x6a31('0xe'),auth[_0x6a31('0x9')](),controller[_0x6a31('0xf')]);router[_0x6a31('0x10')]('/',auth[_0x6a31('0x9')](),controller[_0x6a31('0x11')]);router[_0x6a31('0x10')](_0x6a31('0x12'),auth['isAuthenticated'](),controller[_0x6a31('0x13')]);router[_0x6a31('0x10')]('/:id/any_conditions',auth[_0x6a31('0x9')](),controller[_0x6a31('0x14')]);router[_0x6a31('0x10')](_0x6a31('0xe'),auth['isAuthenticated'](),controller[_0x6a31('0x15')]);router['put'](_0x6a31('0xb'),auth[_0x6a31('0x9')](),controller[_0x6a31('0x16')]);router[_0x6a31('0x17')]('/:id',auth[_0x6a31('0x9')](),controller['destroy']);module[_0x6a31('0x18')]=router; \ No newline at end of file +var _0xdb35=['util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','put','delete','destroy','multer'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xdb35,0x8f));var _0x5db3=function(_0x49b7d3,_0x3c42e0){_0x49b7d3=_0x49b7d3-0x0;var _0x44a611=_0xdb35[_0x49b7d3];return _0x44a611;};'use strict';var multer=require(_0x5db3('0x0'));var util=require(_0x5db3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5db3('0x2'));var router=express[_0x5db3('0x3')]();var fs_extra=require(_0x5db3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5db3('0x5'));var config=require(_0x5db3('0x6'));var controller=require('./trigger.controller');router[_0x5db3('0x7')]('/',auth[_0x5db3('0x8')](),controller[_0x5db3('0x9')]);router[_0x5db3('0x7')](_0x5db3('0xa'),auth[_0x5db3('0x8')](),controller[_0x5db3('0xb')]);router[_0x5db3('0x7')](_0x5db3('0xc'),auth[_0x5db3('0x8')](),controller[_0x5db3('0xd')]);router[_0x5db3('0x7')](_0x5db3('0xe'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x5db3('0x7')](_0x5db3('0xf'),auth[_0x5db3('0x8')](),controller[_0x5db3('0x10')]);router[_0x5db3('0x11')]('/',auth[_0x5db3('0x8')](),controller['create']);router[_0x5db3('0x11')](_0x5db3('0xc'),auth[_0x5db3('0x8')](),controller[_0x5db3('0x12')]);router['post'](_0x5db3('0xe'),auth[_0x5db3('0x8')](),controller[_0x5db3('0x13')]);router[_0x5db3('0x11')]('/:id/actions',auth[_0x5db3('0x8')](),controller[_0x5db3('0x14')]);router[_0x5db3('0x15')](_0x5db3('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5db3('0x16')](_0x5db3('0xa'),auth[_0x5db3('0x8')](),controller[_0x5db3('0x17')]);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 97c3d43..199ae1e 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 _0x69c5=['BOOLEAN','exports','STRING'];(function(_0x1d851f,_0x705272){var _0x586475=function(_0x47b6bd){while(--_0x47b6bd){_0x1d851f['push'](_0x1d851f['shift']());}};_0x586475(++_0x705272);}(_0x69c5,0x70));var _0x569c=function(_0x4fdf57,_0x11d1c5){_0x4fdf57=_0x4fdf57-0x0;var _0x52ea61=_0x69c5[_0x4fdf57];return _0x52ea61;};'use strict';var Sequelize=require('sequelize');module[_0x569c('0x0')]={'name':{'type':Sequelize[_0x569c('0x1')]},'channel':{'type':Sequelize[_0x569c('0x1')]},'description':{'type':Sequelize[_0x569c('0x1')]},'status':{'type':Sequelize[_0x569c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x8295=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5257c4,_0x50ffd3){var _0x3c1a03=function(_0x424014){while(--_0x424014){_0x5257c4['push'](_0x5257c4['shift']());}};_0x3c1a03(++_0x50ffd3);}(_0x8295,0x1bb));var _0x5829=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x8295[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0x5829('0x0'));module[_0x5829('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5829('0x2')]},'description':{'type':Sequelize[_0x5829('0x2')]},'status':{'type':Sequelize[_0x5829('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 69f627c..3331f33 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 _0x428b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','index','Trigger','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','filter','getAnyConditions','findOne','addAction','TriggerId','Action','getActions'];(function(_0x40f369,_0x11e309){var _0xd22cea=function(_0x7e2d5b){while(--_0x7e2d5b){_0x40f369['push'](_0x40f369['shift']());}};_0xd22cea(++_0x11e309);}(_0x428b,0x18c));var _0xb428=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x428b[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0xb428('0x0'));var rimraf=require(_0xb428('0x1'));var zipdir=require(_0xb428('0x2'));var jsonpatch=require(_0xb428('0x3'));var rp=require(_0xb428('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb428('0x5'));var util=require(_0xb428('0x6'));var path=require(_0xb428('0x7'));var sox=require(_0xb428('0x8'));var csv=require(_0xb428('0x9'));var ejs=require(_0xb428('0xa'));var fs=require('fs');var fs_extra=require(_0xb428('0xb'));var _=require(_0xb428('0xc'));var squel=require(_0xb428('0xd'));var crypto=require(_0xb428('0xe'));var jsforce=require(_0xb428('0xf'));var deskjs=require(_0xb428('0x10'));var toCsv=require(_0xb428('0x9'));var querystring=require('querystring');var Papa=require(_0xb428('0x11'));var Redis=require(_0xb428('0x12'));var authService=require(_0xb428('0x13'));var qs=require(_0xb428('0x14'));var as=require(_0xb428('0x15'));var hardwareService=require(_0xb428('0x16'));var logger=require('../../config/logger')(_0xb428('0x17'));var utils=require(_0xb428('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb428('0x19'))['db'];function respondWithStatusCode(_0x29cd10,_0xea6e1a){_0xea6e1a=_0xea6e1a||0xcc;return function(_0x330f3b){if(_0x330f3b){return _0x29cd10['sendStatus'](_0xea6e1a);}return _0x29cd10[_0xb428('0x1a')](_0xea6e1a)[_0xb428('0x1b')]();};}function respondWithResult(_0x2c4847,_0x54ffc8){_0x54ffc8=_0x54ffc8||0xc8;return function(_0x4b7d58){if(_0x4b7d58){return _0x2c4847['status'](_0x54ffc8)[_0xb428('0x1c')](_0x4b7d58);}};}function respondWithFilteredResult(_0x218178,_0x14be58){return function(_0x1a2055){if(_0x1a2055){var _0x13efb7=typeof _0x14be58[_0xb428('0x1d')]===_0xb428('0x1e')&&typeof _0x14be58[_0xb428('0x1f')]===_0xb428('0x1e');var _0x5e22ef=_0x1a2055['count'];var _0x1090be=_0x13efb7?0x0:_0x14be58['offset'];var _0x11ba06=_0x13efb7?_0x1a2055[_0xb428('0x20')]:_0x14be58[_0xb428('0x1d')]+_0x14be58[_0xb428('0x1f')];var _0x189d1f;if(_0x11ba06>=_0x5e22ef){_0x11ba06=_0x5e22ef;_0x189d1f=0xc8;}else{_0x189d1f=0xce;}_0x218178[_0xb428('0x1a')](_0x189d1f);return _0x218178[_0xb428('0x21')]('Content-Range',_0x1090be+'-'+_0x11ba06+'/'+_0x5e22ef)[_0xb428('0x1c')](_0x1a2055);}return null;};}function patchUpdates(_0x11277e){return function(_0x37d022){try{jsonpatch[_0xb428('0x22')](_0x37d022,_0x11277e,!![]);}catch(_0x4d38d4){return BPromise[_0xb428('0x23')](_0x4d38d4);}return _0x37d022[_0xb428('0x24')]();};}function saveUpdates(_0x497d64,_0x1b23ea){return function(_0x51a188){if(_0x51a188){return _0x51a188[_0xb428('0x25')](_0x497d64)[_0xb428('0x26')](function(_0x2be104){return _0x2be104;});}return null;};}function removeEntity(_0x14bc6c,_0x1c91b2){return function(_0x160f7c){if(_0x160f7c){return _0x160f7c['destroy']()[_0xb428('0x26')](function(){var _0x3aee52=_0x160f7c[_0xb428('0x27')]({'plain':!![]});var _0x47def1=_0xb428('0x28');return db[_0xb428('0x29')][_0xb428('0x2a')]({'where':{'type':_0x47def1,'resourceId':_0x3aee52['id']}})[_0xb428('0x26')](function(){return _0x160f7c;});})[_0xb428('0x26')](function(){_0x14bc6c['status'](0xcc)[_0xb428('0x1b')]();});}};}function handleEntityNotFound(_0x249643,_0x5b0e3e){return function(_0x235861){if(!_0x235861){_0x249643['sendStatus'](0x194);}return _0x235861;};}function handleError(_0x3557a3,_0xeeedc8){_0xeeedc8=_0xeeedc8||0x1f4;return function(_0x5cc46a){logger[_0xb428('0x2b')](_0x5cc46a[_0xb428('0x2c')]);if(_0x5cc46a['name']){delete _0x5cc46a[_0xb428('0x2d')];}_0x3557a3[_0xb428('0x1a')](_0xeeedc8)[_0xb428('0x2e')](_0x5cc46a);};}exports[_0xb428('0x2f')]=function(_0x27f3a3,_0x5d5eae){var _0x4ca886={},_0x3d3c15={},_0x1051ae={'count':0x0,'rows':[]};var _0x5e3d57=_['map'](db[_0xb428('0x30')][_0xb428('0x31')],function(_0x5ee387){return{'name':_0x5ee387[_0xb428('0x32')],'type':_0x5ee387['type'][_0xb428('0x33')]};});_0x3d3c15[_0xb428('0x34')]=_['map'](_0x5e3d57,_0xb428('0x2d'));_0x3d3c15[_0xb428('0x35')]=_[_0xb428('0x36')](_0x27f3a3[_0xb428('0x35')]);_0x3d3c15[_0xb428('0x37')]=_[_0xb428('0x38')](_0x3d3c15['model'],_0x3d3c15[_0xb428('0x35')]);_0x4ca886['attributes']=_[_0xb428('0x38')](_0x3d3c15[_0xb428('0x34')],qs[_0xb428('0x39')](_0x27f3a3['query']['fields']));_0x4ca886['attributes']=_0x4ca886[_0xb428('0x3a')][_0xb428('0x3b')]?_0x4ca886[_0xb428('0x3a')]:_0x3d3c15[_0xb428('0x34')];if(!_0x27f3a3[_0xb428('0x35')][_0xb428('0x3c')](_0xb428('0x3d'))){_0x4ca886['limit']=qs[_0xb428('0x1f')](_0x27f3a3[_0xb428('0x35')][_0xb428('0x1f')]);_0x4ca886['offset']=qs[_0xb428('0x1d')](_0x27f3a3[_0xb428('0x35')][_0xb428('0x1d')]);}_0x4ca886[_0xb428('0x3e')]=qs[_0xb428('0x3f')](_0x27f3a3[_0xb428('0x35')][_0xb428('0x3f')]);_0x4ca886[_0xb428('0x40')]=qs[_0xb428('0x37')](_[_0xb428('0x41')](_0x27f3a3[_0xb428('0x35')],_0x3d3c15[_0xb428('0x37')]),_0x5e3d57);if(_0x27f3a3[_0xb428('0x35')]['filter']){_0x4ca886['where']=_[_0xb428('0x42')](_0x4ca886['where'],{'$or':_[_0xb428('0x43')](_0x5e3d57,function(_0x471643){if(_0x471643[_0xb428('0x44')]!==_0xb428('0x45')){var _0x493051={};_0x493051[_0x471643[_0xb428('0x2d')]]={'$like':'%'+_0x27f3a3[_0xb428('0x35')]['filter']+'%'};return _0x493051;}})});}_0x4ca886=_[_0xb428('0x42')]({},_0x4ca886,_0x27f3a3[_0xb428('0x46')]);var _0x57d438={'where':_0x4ca886[_0xb428('0x40')]};return db['Trigger'][_0xb428('0x20')](_0x57d438)[_0xb428('0x26')](function(_0x22f851){_0x1051ae['count']=_0x22f851;if(_0x27f3a3[_0xb428('0x35')][_0xb428('0x47')]){_0x4ca886[_0xb428('0x48')]=[{'all':!![]}];}return db[_0xb428('0x30')][_0xb428('0x49')](_0x4ca886);})['then'](function(_0x458135){_0x1051ae[_0xb428('0x4a')]=_0x458135;return _0x1051ae;})[_0xb428('0x26')](respondWithFilteredResult(_0x5d5eae,_0x4ca886))[_0xb428('0x4b')](handleError(_0x5d5eae,null));};exports[_0xb428('0x4c')]=function(_0x45aefb,_0x2dc85e){var _0xec8101={'raw':![],'where':{'id':_0x45aefb[_0xb428('0x4d')]['id']}},_0x2cdeb7={};_0x2cdeb7[_0xb428('0x34')]=_[_0xb428('0x36')](db[_0xb428('0x30')][_0xb428('0x31')]);_0x2cdeb7[_0xb428('0x35')]=_[_0xb428('0x36')](_0x45aefb['query']);_0x2cdeb7[_0xb428('0x37')]=_[_0xb428('0x38')](_0x2cdeb7[_0xb428('0x34')],_0x2cdeb7[_0xb428('0x35')]);_0xec8101['attributes']=_['intersection'](_0x2cdeb7[_0xb428('0x34')],qs[_0xb428('0x39')](_0x45aefb[_0xb428('0x35')][_0xb428('0x39')]));_0xec8101[_0xb428('0x3a')]=_0xec8101[_0xb428('0x3a')][_0xb428('0x3b')]?_0xec8101[_0xb428('0x3a')]:_0x2cdeb7[_0xb428('0x34')];if(_0x45aefb[_0xb428('0x35')][_0xb428('0x47')]){_0xec8101['include']=[{'all':!![]}];}_0xec8101=_[_0xb428('0x42')]({},_0xec8101,_0x45aefb[_0xb428('0x46')]);return db['Trigger'][_0xb428('0x4e')](_0xec8101)['then'](handleEntityNotFound(_0x2dc85e,null))[_0xb428('0x26')](respondWithResult(_0x2dc85e,null))['catch'](handleError(_0x2dc85e,null));};exports[_0xb428('0x4f')]=function(_0x273a2b,_0x595cb0){return db[_0xb428('0x30')][_0xb428('0x4f')](_0x273a2b['body'],{})[_0xb428('0x26')](function(_0x18d512){var _0x1440fa=_0x273a2b[_0xb428('0x50')]['get']({'plain':!![]});if(!_0x1440fa)throw new Error(_0xb428('0x51'));if(_0x1440fa[_0xb428('0x52')]===_0xb428('0x50')){var _0xf2eabb=_0x18d512[_0xb428('0x27')]({'plain':!![]});var _0x3cbfea=_0xb428('0x28');return db['UserProfileSection'][_0xb428('0x4e')]({'where':{'name':_0x3cbfea,'userProfileId':_0x1440fa[_0xb428('0x53')]},'raw':!![]})['then'](function(_0x293b0a){if(_0x293b0a&&_0x293b0a[_0xb428('0x54')]===0x0){return db[_0xb428('0x29')][_0xb428('0x4f')]({'name':_0xf2eabb[_0xb428('0x2d')],'resourceId':_0xf2eabb['id'],'type':_0x293b0a['name'],'sectionId':_0x293b0a['id']},{})[_0xb428('0x26')](function(){return _0x18d512;});}else{return _0x18d512;}})[_0xb428('0x4b')](function(_0x21bca2){logger[_0xb428('0x2b')](_0xb428('0x55'),_0x21bca2);throw _0x21bca2;});}return _0x18d512;})[_0xb428('0x26')](respondWithResult(_0x595cb0,0xc9))[_0xb428('0x4b')](handleError(_0x595cb0,null));};exports[_0xb428('0x25')]=function(_0x59a6ed,_0x3b2dd5){if(_0x59a6ed[_0xb428('0x56')]['id']){delete _0x59a6ed['body']['id'];}return db[_0xb428('0x30')][_0xb428('0x4e')]({'where':{'id':_0x59a6ed[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x3b2dd5,null))[_0xb428('0x26')](saveUpdates(_0x59a6ed['body'],null))['then'](respondWithResult(_0x3b2dd5,null))[_0xb428('0x4b')](handleError(_0x3b2dd5,null));};exports['destroy']=function(_0x5653b1,_0x24485f){return db[_0xb428('0x30')]['find']({'where':{'id':_0x5653b1[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x24485f,null))[_0xb428('0x26')](removeEntity(_0x24485f,null))[_0xb428('0x4b')](handleError(_0x24485f,null));};exports[_0xb428('0x57')]=function(_0x4d090b,_0x2fc8cb,_0x547339){if(_0x4d090b[_0xb428('0x56')]['id']){delete _0x4d090b[_0xb428('0x56')]['id'];}return db[_0xb428('0x30')]['find']({'where':{'id':_0x4d090b['params']['id']}})['then'](handleEntityNotFound(_0x2fc8cb,null))[_0xb428('0x26')](function(_0x1224c9){if(_0x1224c9){_0x4d090b[_0xb428('0x56')][_0xb428('0x58')]=_0x1224c9['id'];return db[_0xb428('0x59')]['create'](_0x4d090b[_0xb428('0x56')]);}})[_0xb428('0x26')](respondWithResult(_0x2fc8cb,null))[_0xb428('0x4b')](handleError(_0x2fc8cb,null));};exports[_0xb428('0x5a')]=function(_0x4b1f00,_0x2fc9cc,_0x54c6f6){if(_0x4b1f00[_0xb428('0x56')]['id']){delete _0x4b1f00[_0xb428('0x56')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4b1f00[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x2fc9cc,null))['then'](function(_0x970bcb){if(_0x970bcb){_0x4b1f00[_0xb428('0x56')]['TriggerAnyId']=_0x970bcb['id'];return db[_0xb428('0x59')][_0xb428('0x4f')](_0x4b1f00[_0xb428('0x56')]);}})[_0xb428('0x26')](respondWithResult(_0x2fc9cc,null))[_0xb428('0x4b')](handleError(_0x2fc9cc,null));};exports[_0xb428('0x5b')]=function(_0x2024f7,_0x572bd4,_0x2ffa66){var _0x241b30={};var _0x2a8e30={};var _0x56707e;var _0xac5b6e;return db[_0xb428('0x30')]['findOne']({'where':{'id':_0x2024f7[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0x572bd4,null))[_0xb428('0x26')](function(_0x17e01e){if(_0x17e01e){_0x56707e=_0x17e01e;_0x2a8e30[_0xb428('0x34')]=_['keys'](db[_0xb428('0x59')][_0xb428('0x31')]);_0x2a8e30['query']=_[_0xb428('0x36')](_0x2024f7[_0xb428('0x35')]);_0x2a8e30[_0xb428('0x37')]=_['intersection'](_0x2a8e30['model'],_0x2a8e30['query']);_0x241b30[_0xb428('0x3a')]=_[_0xb428('0x38')](_0x2a8e30[_0xb428('0x34')],qs['fields'](_0x2024f7[_0xb428('0x35')][_0xb428('0x39')]));_0x241b30['attributes']=_0x241b30[_0xb428('0x3a')][_0xb428('0x3b')]?_0x241b30[_0xb428('0x3a')]:_0x2a8e30[_0xb428('0x34')];_0x241b30[_0xb428('0x3e')]=qs[_0xb428('0x3f')](_0x2024f7[_0xb428('0x35')]['sort']);_0x241b30['where']=qs[_0xb428('0x37')](_[_0xb428('0x41')](_0x2024f7[_0xb428('0x35')],_0x2a8e30[_0xb428('0x37')]));if(_0x2024f7['query'][_0xb428('0x5c')]){_0x241b30[_0xb428('0x40')]=_[_0xb428('0x42')](_0x241b30[_0xb428('0x40')],{'$or':_[_0xb428('0x43')](_0x241b30[_0xb428('0x3a')],function(_0x54dc08){var _0x2b37bc={};_0x2b37bc[_0x54dc08]={'$like':'%'+_0x2024f7[_0xb428('0x35')][_0xb428('0x5c')]+'%'};return _0x2b37bc;})});}_0x241b30=_[_0xb428('0x42')]({},_0x241b30,_0x2024f7[_0xb428('0x46')]);return _0x56707e[_0xb428('0x5b')](_0x241b30);}})['then'](function(_0x28070f){if(_0x28070f){_0xac5b6e=_0x28070f[_0xb428('0x3b')];if(!_0x2024f7[_0xb428('0x35')][_0xb428('0x3c')](_0xb428('0x3d'))){_0x241b30[_0xb428('0x1f')]=qs[_0xb428('0x1f')](_0x2024f7[_0xb428('0x35')][_0xb428('0x1f')]);_0x241b30[_0xb428('0x1d')]=qs[_0xb428('0x1d')](_0x2024f7['query']['offset']);}return _0x56707e[_0xb428('0x5b')](_0x241b30);}})['then'](function(_0x53d372){if(_0x53d372){return _0x53d372?{'count':_0xac5b6e,'rows':_0x53d372}:null;}})['then'](respondWithResult(_0x572bd4,null))[_0xb428('0x4b')](handleError(_0x572bd4,null));};exports[_0xb428('0x5d')]=function(_0x4b4418,_0xfa19c4,_0xad63fb){var _0x2abd2a={};var _0x277704={};var _0x446428;var _0x2ae6d2;return db[_0xb428('0x30')][_0xb428('0x5e')]({'where':{'id':_0x4b4418[_0xb428('0x4d')]['id']}})[_0xb428('0x26')](handleEntityNotFound(_0xfa19c4,null))[_0xb428('0x26')](function(_0x960dcd){if(_0x960dcd){_0x446428=_0x960dcd;_0x277704[_0xb428('0x34')]=_['keys'](db['Condition'][_0xb428('0x31')]);_0x277704[_0xb428('0x35')]=_['keys'](_0x4b4418[_0xb428('0x35')]);_0x277704[_0xb428('0x37')]=_[_0xb428('0x38')](_0x277704[_0xb428('0x34')],_0x277704[_0xb428('0x35')]);_0x2abd2a[_0xb428('0x3a')]=_[_0xb428('0x38')](_0x277704['model'],qs[_0xb428('0x39')](_0x4b4418[_0xb428('0x35')][_0xb428('0x39')]));_0x2abd2a[_0xb428('0x3a')]=_0x2abd2a['attributes']['length']?_0x2abd2a['attributes']:_0x277704[_0xb428('0x34')];_0x2abd2a[_0xb428('0x3e')]=qs['sort'](_0x4b4418[_0xb428('0x35')]['sort']);_0x2abd2a[_0xb428('0x40')]=qs['filters'](_[_0xb428('0x41')](_0x4b4418[_0xb428('0x35')],_0x277704[_0xb428('0x37')]));if(_0x4b4418[_0xb428('0x35')][_0xb428('0x5c')]){_0x2abd2a[_0xb428('0x40')]=_['merge'](_0x2abd2a[_0xb428('0x40')],{'$or':_[_0xb428('0x43')](_0x2abd2a[_0xb428('0x3a')],function(_0x52013e){var _0x49f8dd={};_0x49f8dd[_0x52013e]={'$like':'%'+_0x4b4418[_0xb428('0x35')]['filter']+'%'};return _0x49f8dd;})});}_0x2abd2a=_[_0xb428('0x42')]({},_0x2abd2a,_0x4b4418[_0xb428('0x46')]);return _0x446428['getAnyConditions'](_0x2abd2a);}})[_0xb428('0x26')](function(_0x4561aa){if(_0x4561aa){_0x2ae6d2=_0x4561aa[_0xb428('0x3b')];if(!_0x4b4418[_0xb428('0x35')][_0xb428('0x3c')](_0xb428('0x3d'))){_0x2abd2a[_0xb428('0x1f')]=qs[_0xb428('0x1f')](_0x4b4418['query'][_0xb428('0x1f')]);_0x2abd2a[_0xb428('0x1d')]=qs[_0xb428('0x1d')](_0x4b4418['query'][_0xb428('0x1d')]);}return _0x446428[_0xb428('0x5d')](_0x2abd2a);}})[_0xb428('0x26')](function(_0x282136){if(_0x282136){return _0x282136?{'count':_0x2ae6d2,'rows':_0x282136}:null;}})[_0xb428('0x26')](respondWithResult(_0xfa19c4,null))['catch'](handleError(_0xfa19c4,null));};exports[_0xb428('0x5f')]=function(_0x1a1c15,_0x414eaa,_0x15b0c5){if(_0x1a1c15['body']['id']){delete _0x1a1c15[_0xb428('0x56')]['id'];}return db[_0xb428('0x30')]['find']({'where':{'id':_0x1a1c15[_0xb428('0x4d')]['id']}})['then'](handleEntityNotFound(_0x414eaa,null))[_0xb428('0x26')](function(_0x4ce070){if(_0x4ce070){_0x1a1c15[_0xb428('0x56')][_0xb428('0x60')]=_0x4ce070['id'];return db[_0xb428('0x61')][_0xb428('0x4f')](_0x1a1c15[_0xb428('0x56')]);}})[_0xb428('0x26')](respondWithResult(_0x414eaa,null))['catch'](handleError(_0x414eaa,null));};exports[_0xb428('0x62')]=function(_0x211052,_0x46caab,_0x2ffe53){var _0x5b693a={};var _0x1f1d8d={};var _0x3a8415;var _0x487ad7;return db['Trigger'][_0xb428('0x5e')]({'where':{'id':_0x211052[_0xb428('0x4d')]['id']}})['then'](handleEntityNotFound(_0x46caab,null))[_0xb428('0x26')](function(_0x312254){if(_0x312254){_0x3a8415=_0x312254;_0x1f1d8d[_0xb428('0x34')]=_['keys'](db['Action'][_0xb428('0x31')]);_0x1f1d8d[_0xb428('0x35')]=_[_0xb428('0x36')](_0x211052[_0xb428('0x35')]);_0x1f1d8d[_0xb428('0x37')]=_[_0xb428('0x38')](_0x1f1d8d[_0xb428('0x34')],_0x1f1d8d[_0xb428('0x35')]);_0x5b693a['attributes']=_['intersection'](_0x1f1d8d[_0xb428('0x34')],qs[_0xb428('0x39')](_0x211052[_0xb428('0x35')][_0xb428('0x39')]));_0x5b693a[_0xb428('0x3a')]=_0x5b693a[_0xb428('0x3a')][_0xb428('0x3b')]?_0x5b693a[_0xb428('0x3a')]:_0x1f1d8d[_0xb428('0x34')];_0x5b693a[_0xb428('0x3e')]=qs[_0xb428('0x3f')](_0x211052[_0xb428('0x35')][_0xb428('0x3f')]);_0x5b693a[_0xb428('0x40')]=qs[_0xb428('0x37')](_[_0xb428('0x41')](_0x211052['query'],_0x1f1d8d['filters']));if(_0x211052['query'][_0xb428('0x5c')]){_0x5b693a[_0xb428('0x40')]=_['merge'](_0x5b693a[_0xb428('0x40')],{'$or':_[_0xb428('0x43')](_0x5b693a[_0xb428('0x3a')],function(_0x21e7e8){var _0x3d3c14={};_0x3d3c14[_0x21e7e8]={'$like':'%'+_0x211052[_0xb428('0x35')][_0xb428('0x5c')]+'%'};return _0x3d3c14;})});}_0x5b693a=_['merge']({},_0x5b693a,_0x211052[_0xb428('0x46')]);return _0x3a8415[_0xb428('0x62')](_0x5b693a);}})['then'](function(_0x35d0ce){if(_0x35d0ce){_0x487ad7=_0x35d0ce['length'];if(!_0x211052['query'][_0xb428('0x3c')](_0xb428('0x3d'))){_0x5b693a['limit']=qs[_0xb428('0x1f')](_0x211052[_0xb428('0x35')][_0xb428('0x1f')]);_0x5b693a[_0xb428('0x1d')]=qs[_0xb428('0x1d')](_0x211052[_0xb428('0x35')]['offset']);}return _0x3a8415[_0xb428('0x62')](_0x5b693a);}})[_0xb428('0x26')](function(_0x1d5021){if(_0x1d5021){return _0x1d5021?{'count':_0x487ad7,'rows':_0x1d5021}:null;}})[_0xb428('0x26')](respondWithResult(_0x46caab,null))[_0xb428('0x4b')](handleError(_0x46caab,null));}; \ No newline at end of file +var _0xedb0=['sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','role','user','get','userProfileId','error','TriggerAllId','Condition','getAllConditions','findOne','order','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Triggers','UserProfileResource','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit'];(function(_0x4e7939,_0x116ada){var _0x510382=function(_0xcad312){while(--_0xcad312){_0x4e7939['push'](_0x4e7939['shift']());}};_0x510382(++_0x116ada);}(_0xedb0,0xd4));var _0x0edb=function(_0x3839b8,_0x137bac){_0x3839b8=_0x3839b8-0x0;var _0x537fd3=_0xedb0[_0x3839b8];return _0x537fd3;};'use strict';var emlformat=require(_0x0edb('0x0'));var rimraf=require(_0x0edb('0x1'));var zipdir=require(_0x0edb('0x2'));var jsonpatch=require(_0x0edb('0x3'));var rp=require(_0x0edb('0x4'));var moment=require('moment');var BPromise=require(_0x0edb('0x5'));var Mustache=require('mustache');var util=require(_0x0edb('0x6'));var path=require(_0x0edb('0x7'));var sox=require('sox');var csv=require(_0x0edb('0x8'));var ejs=require(_0x0edb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0edb('0xa'));var squel=require('squel');var crypto=require(_0x0edb('0xb'));var jsforce=require(_0x0edb('0xc'));var deskjs=require(_0x0edb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0edb('0xe'));var Papa=require(_0x0edb('0xf'));var Redis=require('ioredis');var authService=require(_0x0edb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0edb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0edb('0x12'))(_0x0edb('0x13'));var utils=require(_0x0edb('0x14'));var config=require(_0x0edb('0x15'));var licenseUtil=require(_0x0edb('0x16'));var db=require(_0x0edb('0x17'))['db'];function respondWithStatusCode(_0x57cb76,_0x10100a){_0x10100a=_0x10100a||0xcc;return function(_0x7c97e9){if(_0x7c97e9){return _0x57cb76[_0x0edb('0x18')](_0x10100a);}return _0x57cb76[_0x0edb('0x19')](_0x10100a)[_0x0edb('0x1a')]();};}function respondWithResult(_0x355bd3,_0x49547c){_0x49547c=_0x49547c||0xc8;return function(_0x2a9b91){if(_0x2a9b91){return _0x355bd3[_0x0edb('0x19')](_0x49547c)[_0x0edb('0x1b')](_0x2a9b91);}};}function respondWithFilteredResult(_0x2a9082,_0x704a88){return function(_0x54f417){if(_0x54f417){var _0x3af147=typeof _0x704a88[_0x0edb('0x1c')]===_0x0edb('0x1d')&&typeof _0x704a88[_0x0edb('0x1e')]===_0x0edb('0x1d');var _0x3b1fb4=_0x54f417[_0x0edb('0x1f')];var _0x1cdcfb=_0x3af147?0x0:_0x704a88[_0x0edb('0x1c')];var _0x43616a=_0x3af147?_0x54f417[_0x0edb('0x1f')]:_0x704a88[_0x0edb('0x1c')]+_0x704a88['limit'];var _0x5a8683;if(_0x43616a>=_0x3b1fb4){_0x43616a=_0x3b1fb4;_0x5a8683=0xc8;}else{_0x5a8683=0xce;}_0x2a9082['status'](_0x5a8683);return _0x2a9082[_0x0edb('0x20')](_0x0edb('0x21'),_0x1cdcfb+'-'+_0x43616a+'/'+_0x3b1fb4)[_0x0edb('0x1b')](_0x54f417);}return null;};}function patchUpdates(_0x540c76){return function(_0x346c05){try{jsonpatch[_0x0edb('0x22')](_0x346c05,_0x540c76,!![]);}catch(_0x3ebd52){return BPromise[_0x0edb('0x23')](_0x3ebd52);}return _0x346c05['save']();};}function saveUpdates(_0xf37583,_0x51521a){return function(_0x303c9b){if(_0x303c9b){return _0x303c9b[_0x0edb('0x24')](_0xf37583)[_0x0edb('0x25')](function(_0x2fdbb8){return _0x2fdbb8;});}return null;};}function removeEntity(_0x2f6c2e,_0x2c11d5){return function(_0x6e23e3){if(_0x6e23e3){return _0x6e23e3[_0x0edb('0x26')]()['then'](function(){var _0x306d04=_0x6e23e3['get']({'plain':!![]});var _0x58d424=_0x0edb('0x27');return db[_0x0edb('0x28')][_0x0edb('0x26')]({'where':{'type':_0x58d424,'resourceId':_0x306d04['id']}})[_0x0edb('0x25')](function(){return _0x6e23e3;});})[_0x0edb('0x25')](function(){_0x2f6c2e[_0x0edb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5956ef,_0x1e35ca){return function(_0x31cac7){if(!_0x31cac7){_0x5956ef['sendStatus'](0x194);}return _0x31cac7;};}function handleError(_0x5b10d2,_0x514c39){_0x514c39=_0x514c39||0x1f4;return function(_0x5f2615){logger['error'](_0x5f2615[_0x0edb('0x29')]);if(_0x5f2615[_0x0edb('0x2a')]){delete _0x5f2615[_0x0edb('0x2a')];}_0x5b10d2['status'](_0x514c39)[_0x0edb('0x2b')](_0x5f2615);};}exports[_0x0edb('0x2c')]=function(_0x4f553c,_0x1efd38){var _0x5304e5={},_0x44f265={},_0x5f317e={'count':0x0,'rows':[]};var _0x220fb3=_[_0x0edb('0x2d')](db[_0x0edb('0x2e')][_0x0edb('0x2f')],function(_0x2069c4){return{'name':_0x2069c4[_0x0edb('0x30')],'type':_0x2069c4[_0x0edb('0x31')]['key']};});_0x44f265[_0x0edb('0x32')]=_[_0x0edb('0x2d')](_0x220fb3,_0x0edb('0x2a'));_0x44f265[_0x0edb('0x33')]=_[_0x0edb('0x34')](_0x4f553c[_0x0edb('0x33')]);_0x44f265['filters']=_['intersection'](_0x44f265[_0x0edb('0x32')],_0x44f265[_0x0edb('0x33')]);_0x5304e5[_0x0edb('0x35')]=_[_0x0edb('0x36')](_0x44f265[_0x0edb('0x32')],qs[_0x0edb('0x37')](_0x4f553c['query']['fields']));_0x5304e5[_0x0edb('0x35')]=_0x5304e5[_0x0edb('0x35')][_0x0edb('0x38')]?_0x5304e5[_0x0edb('0x35')]:_0x44f265[_0x0edb('0x32')];if(!_0x4f553c[_0x0edb('0x33')]['hasOwnProperty'](_0x0edb('0x39'))){_0x5304e5[_0x0edb('0x1e')]=qs[_0x0edb('0x1e')](_0x4f553c['query'][_0x0edb('0x1e')]);_0x5304e5[_0x0edb('0x1c')]=qs[_0x0edb('0x1c')](_0x4f553c[_0x0edb('0x33')][_0x0edb('0x1c')]);}_0x5304e5['order']=qs['sort'](_0x4f553c[_0x0edb('0x33')][_0x0edb('0x3a')]);_0x5304e5['where']=qs[_0x0edb('0x3b')](_[_0x0edb('0x3c')](_0x4f553c[_0x0edb('0x33')],_0x44f265[_0x0edb('0x3b')]),_0x220fb3);if(_0x4f553c['query'][_0x0edb('0x3d')]){_0x5304e5[_0x0edb('0x3e')]=_[_0x0edb('0x3f')](_0x5304e5[_0x0edb('0x3e')],{'$or':_[_0x0edb('0x2d')](_0x220fb3,function(_0x2d9477){if(_0x2d9477[_0x0edb('0x31')]!==_0x0edb('0x40')){var _0x42b32f={};_0x42b32f[_0x2d9477[_0x0edb('0x2a')]]={'$like':'%'+_0x4f553c['query'][_0x0edb('0x3d')]+'%'};return _0x42b32f;}})});}_0x5304e5=_['merge']({},_0x5304e5,_0x4f553c[_0x0edb('0x41')]);var _0x29a96d={'where':_0x5304e5[_0x0edb('0x3e')]};return db[_0x0edb('0x2e')]['count'](_0x29a96d)[_0x0edb('0x25')](function(_0x3d9692){_0x5f317e[_0x0edb('0x1f')]=_0x3d9692;if(_0x4f553c['query'][_0x0edb('0x42')]){_0x5304e5['include']=[{'all':!![]}];}return db[_0x0edb('0x2e')][_0x0edb('0x43')](_0x5304e5);})[_0x0edb('0x25')](function(_0x1a350f){_0x5f317e[_0x0edb('0x44')]=_0x1a350f;return _0x5f317e;})['then'](respondWithFilteredResult(_0x1efd38,_0x5304e5))[_0x0edb('0x45')](handleError(_0x1efd38,null));};exports['show']=function(_0x3c63ff,_0x2d89df){var _0x1e85b4={'raw':![],'where':{'id':_0x3c63ff[_0x0edb('0x46')]['id']}},_0x21b649={};_0x21b649[_0x0edb('0x32')]=_[_0x0edb('0x34')](db['Trigger'][_0x0edb('0x2f')]);_0x21b649[_0x0edb('0x33')]=_[_0x0edb('0x34')](_0x3c63ff[_0x0edb('0x33')]);_0x21b649[_0x0edb('0x3b')]=_['intersection'](_0x21b649[_0x0edb('0x32')],_0x21b649[_0x0edb('0x33')]);_0x1e85b4[_0x0edb('0x35')]=_[_0x0edb('0x36')](_0x21b649[_0x0edb('0x32')],qs[_0x0edb('0x37')](_0x3c63ff[_0x0edb('0x33')][_0x0edb('0x37')]));_0x1e85b4['attributes']=_0x1e85b4['attributes'][_0x0edb('0x38')]?_0x1e85b4[_0x0edb('0x35')]:_0x21b649[_0x0edb('0x32')];if(_0x3c63ff[_0x0edb('0x33')][_0x0edb('0x42')]){_0x1e85b4[_0x0edb('0x47')]=[{'all':!![]}];}_0x1e85b4=_[_0x0edb('0x3f')]({},_0x1e85b4,_0x3c63ff[_0x0edb('0x41')]);return db[_0x0edb('0x2e')][_0x0edb('0x48')](_0x1e85b4)[_0x0edb('0x25')](handleEntityNotFound(_0x2d89df,null))[_0x0edb('0x25')](respondWithResult(_0x2d89df,null))['catch'](handleError(_0x2d89df,null));};exports[_0x0edb('0x49')]=function(_0x16a5bd,_0x7f3ecc){return db['Trigger'][_0x0edb('0x49')](_0x16a5bd[_0x0edb('0x4a')],{})[_0x0edb('0x25')](function(_0x31568c){var _0x407d96=_0x16a5bd['user']['get']({'plain':!![]});if(!_0x407d96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x407d96[_0x0edb('0x4b')]===_0x0edb('0x4c')){var _0x46fabb=_0x31568c[_0x0edb('0x4d')]({'plain':!![]});var _0x3030c2=_0x0edb('0x27');return db['UserProfileSection'][_0x0edb('0x48')]({'where':{'name':_0x3030c2,'userProfileId':_0x407d96[_0x0edb('0x4e')]},'raw':!![]})[_0x0edb('0x25')](function(_0x3d77ae){if(_0x3d77ae&&_0x3d77ae['autoAssociation']===0x0){return db[_0x0edb('0x28')][_0x0edb('0x49')]({'name':_0x46fabb[_0x0edb('0x2a')],'resourceId':_0x46fabb['id'],'type':_0x3d77ae[_0x0edb('0x2a')],'sectionId':_0x3d77ae['id']},{})[_0x0edb('0x25')](function(){return _0x31568c;});}else{return _0x31568c;}})[_0x0edb('0x45')](function(_0x25d5e0){logger[_0x0edb('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25d5e0);throw _0x25d5e0;});}return _0x31568c;})['then'](respondWithResult(_0x7f3ecc,0xc9))[_0x0edb('0x45')](handleError(_0x7f3ecc,null));};exports[_0x0edb('0x24')]=function(_0x43b154,_0x4eddad){if(_0x43b154['body']['id']){delete _0x43b154[_0x0edb('0x4a')]['id'];}return db[_0x0edb('0x2e')][_0x0edb('0x48')]({'where':{'id':_0x43b154[_0x0edb('0x46')]['id']}})[_0x0edb('0x25')](handleEntityNotFound(_0x4eddad,null))['then'](saveUpdates(_0x43b154[_0x0edb('0x4a')],null))[_0x0edb('0x25')](respondWithResult(_0x4eddad,null))['catch'](handleError(_0x4eddad,null));};exports[_0x0edb('0x26')]=function(_0xed4df0,_0x50b95){return db[_0x0edb('0x2e')]['find']({'where':{'id':_0xed4df0[_0x0edb('0x46')]['id']}})[_0x0edb('0x25')](handleEntityNotFound(_0x50b95,null))[_0x0edb('0x25')](removeEntity(_0x50b95,null))[_0x0edb('0x45')](handleError(_0x50b95,null));};exports['addAllCondition']=function(_0xaa3a5a,_0x5a3588,_0x4d06e6){if(_0xaa3a5a['body']['id']){delete _0xaa3a5a['body']['id'];}return db[_0x0edb('0x2e')][_0x0edb('0x48')]({'where':{'id':_0xaa3a5a[_0x0edb('0x46')]['id']}})[_0x0edb('0x25')](handleEntityNotFound(_0x5a3588,null))[_0x0edb('0x25')](function(_0x49e76b){if(_0x49e76b){_0xaa3a5a[_0x0edb('0x4a')][_0x0edb('0x50')]=_0x49e76b['id'];return db['Condition'][_0x0edb('0x49')](_0xaa3a5a['body']);}})['then'](respondWithResult(_0x5a3588,null))[_0x0edb('0x45')](handleError(_0x5a3588,null));};exports['addAnyCondition']=function(_0x577ea8,_0x12a6a1,_0x7521a5){if(_0x577ea8[_0x0edb('0x4a')]['id']){delete _0x577ea8['body']['id'];}return db[_0x0edb('0x2e')]['find']({'where':{'id':_0x577ea8['params']['id']}})[_0x0edb('0x25')](handleEntityNotFound(_0x12a6a1,null))[_0x0edb('0x25')](function(_0x53f647){if(_0x53f647){_0x577ea8[_0x0edb('0x4a')]['TriggerAnyId']=_0x53f647['id'];return db[_0x0edb('0x51')][_0x0edb('0x49')](_0x577ea8[_0x0edb('0x4a')]);}})[_0x0edb('0x25')](respondWithResult(_0x12a6a1,null))[_0x0edb('0x45')](handleError(_0x12a6a1,null));};exports[_0x0edb('0x52')]=function(_0x898fad,_0x2ce304,_0x57568c){var _0xeae698={};var _0x44bb30={};var _0x40d5df;var _0x557b52;return db[_0x0edb('0x2e')][_0x0edb('0x53')]({'where':{'id':_0x898fad[_0x0edb('0x46')]['id']}})[_0x0edb('0x25')](handleEntityNotFound(_0x2ce304,null))['then'](function(_0x56345d){if(_0x56345d){_0x40d5df=_0x56345d;_0x44bb30['model']=_[_0x0edb('0x34')](db[_0x0edb('0x51')][_0x0edb('0x2f')]);_0x44bb30['query']=_[_0x0edb('0x34')](_0x898fad[_0x0edb('0x33')]);_0x44bb30[_0x0edb('0x3b')]=_['intersection'](_0x44bb30[_0x0edb('0x32')],_0x44bb30['query']);_0xeae698[_0x0edb('0x35')]=_[_0x0edb('0x36')](_0x44bb30[_0x0edb('0x32')],qs[_0x0edb('0x37')](_0x898fad[_0x0edb('0x33')][_0x0edb('0x37')]));_0xeae698[_0x0edb('0x35')]=_0xeae698[_0x0edb('0x35')][_0x0edb('0x38')]?_0xeae698[_0x0edb('0x35')]:_0x44bb30['model'];_0xeae698[_0x0edb('0x54')]=qs[_0x0edb('0x3a')](_0x898fad[_0x0edb('0x33')][_0x0edb('0x3a')]);_0xeae698[_0x0edb('0x3e')]=qs[_0x0edb('0x3b')](_[_0x0edb('0x3c')](_0x898fad[_0x0edb('0x33')],_0x44bb30[_0x0edb('0x3b')]));if(_0x898fad['query'][_0x0edb('0x3d')]){_0xeae698[_0x0edb('0x3e')]=_[_0x0edb('0x3f')](_0xeae698[_0x0edb('0x3e')],{'$or':_[_0x0edb('0x2d')](_0xeae698[_0x0edb('0x35')],function(_0x184e88){var _0x3c614d={};_0x3c614d[_0x184e88]={'$like':'%'+_0x898fad[_0x0edb('0x33')]['filter']+'%'};return _0x3c614d;})});}_0xeae698=_[_0x0edb('0x3f')]({},_0xeae698,_0x898fad['options']);return _0x40d5df[_0x0edb('0x52')](_0xeae698);}})['then'](function(_0x58a39d){if(_0x58a39d){_0x557b52=_0x58a39d['length'];if(!_0x898fad[_0x0edb('0x33')][_0x0edb('0x55')]('nolimit')){_0xeae698[_0x0edb('0x1e')]=qs[_0x0edb('0x1e')](_0x898fad[_0x0edb('0x33')][_0x0edb('0x1e')]);_0xeae698[_0x0edb('0x1c')]=qs[_0x0edb('0x1c')](_0x898fad[_0x0edb('0x33')][_0x0edb('0x1c')]);}return _0x40d5df[_0x0edb('0x52')](_0xeae698);}})[_0x0edb('0x25')](function(_0x27ea7c){if(_0x27ea7c){return _0x27ea7c?{'count':_0x557b52,'rows':_0x27ea7c}:null;}})[_0x0edb('0x25')](respondWithResult(_0x2ce304,null))['catch'](handleError(_0x2ce304,null));};exports[_0x0edb('0x56')]=function(_0x32515f,_0x4084fc,_0x523614){var _0x513061={};var _0xc5eebb={};var _0x5fd9e1;var _0x3cead1;return db[_0x0edb('0x2e')][_0x0edb('0x53')]({'where':{'id':_0x32515f['params']['id']}})['then'](handleEntityNotFound(_0x4084fc,null))['then'](function(_0x41fbaa){if(_0x41fbaa){_0x5fd9e1=_0x41fbaa;_0xc5eebb['model']=_['keys'](db[_0x0edb('0x51')][_0x0edb('0x2f')]);_0xc5eebb['query']=_[_0x0edb('0x34')](_0x32515f['query']);_0xc5eebb[_0x0edb('0x3b')]=_[_0x0edb('0x36')](_0xc5eebb['model'],_0xc5eebb[_0x0edb('0x33')]);_0x513061[_0x0edb('0x35')]=_[_0x0edb('0x36')](_0xc5eebb[_0x0edb('0x32')],qs[_0x0edb('0x37')](_0x32515f[_0x0edb('0x33')][_0x0edb('0x37')]));_0x513061[_0x0edb('0x35')]=_0x513061[_0x0edb('0x35')][_0x0edb('0x38')]?_0x513061[_0x0edb('0x35')]:_0xc5eebb[_0x0edb('0x32')];_0x513061[_0x0edb('0x54')]=qs[_0x0edb('0x3a')](_0x32515f[_0x0edb('0x33')]['sort']);_0x513061[_0x0edb('0x3e')]=qs['filters'](_[_0x0edb('0x3c')](_0x32515f[_0x0edb('0x33')],_0xc5eebb[_0x0edb('0x3b')]));if(_0x32515f['query'][_0x0edb('0x3d')]){_0x513061[_0x0edb('0x3e')]=_[_0x0edb('0x3f')](_0x513061['where'],{'$or':_['map'](_0x513061[_0x0edb('0x35')],function(_0x338a45){var _0x4794b9={};_0x4794b9[_0x338a45]={'$like':'%'+_0x32515f[_0x0edb('0x33')][_0x0edb('0x3d')]+'%'};return _0x4794b9;})});}_0x513061=_[_0x0edb('0x3f')]({},_0x513061,_0x32515f[_0x0edb('0x41')]);return _0x5fd9e1[_0x0edb('0x56')](_0x513061);}})[_0x0edb('0x25')](function(_0x2c5a66){if(_0x2c5a66){_0x3cead1=_0x2c5a66[_0x0edb('0x38')];if(!_0x32515f['query']['hasOwnProperty'](_0x0edb('0x39'))){_0x513061['limit']=qs[_0x0edb('0x1e')](_0x32515f[_0x0edb('0x33')]['limit']);_0x513061[_0x0edb('0x1c')]=qs[_0x0edb('0x1c')](_0x32515f[_0x0edb('0x33')][_0x0edb('0x1c')]);}return _0x5fd9e1[_0x0edb('0x56')](_0x513061);}})['then'](function(_0x23c558){if(_0x23c558){return _0x23c558?{'count':_0x3cead1,'rows':_0x23c558}:null;}})[_0x0edb('0x25')](respondWithResult(_0x4084fc,null))['catch'](handleError(_0x4084fc,null));};exports[_0x0edb('0x57')]=function(_0x313953,_0x5e06ec,_0x35aacf){if(_0x313953[_0x0edb('0x4a')]['id']){delete _0x313953[_0x0edb('0x4a')]['id'];}return db[_0x0edb('0x2e')]['find']({'where':{'id':_0x313953[_0x0edb('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e06ec,null))['then'](function(_0x253e33){if(_0x253e33){_0x313953[_0x0edb('0x4a')]['TriggerId']=_0x253e33['id'];return db[_0x0edb('0x58')][_0x0edb('0x49')](_0x313953[_0x0edb('0x4a')]);}})['then'](respondWithResult(_0x5e06ec,null))[_0x0edb('0x45')](handleError(_0x5e06ec,null));};exports[_0x0edb('0x59')]=function(_0x452b32,_0x43c49f,_0x5d124c){var _0x2eb536={};var _0x592d66={};var _0x48d26d;var _0x25c8ae;return db[_0x0edb('0x2e')][_0x0edb('0x53')]({'where':{'id':_0x452b32[_0x0edb('0x46')]['id']}})['then'](handleEntityNotFound(_0x43c49f,null))[_0x0edb('0x25')](function(_0x17cf2d){if(_0x17cf2d){_0x48d26d=_0x17cf2d;_0x592d66[_0x0edb('0x32')]=_[_0x0edb('0x34')](db[_0x0edb('0x58')]['rawAttributes']);_0x592d66[_0x0edb('0x33')]=_['keys'](_0x452b32[_0x0edb('0x33')]);_0x592d66['filters']=_[_0x0edb('0x36')](_0x592d66['model'],_0x592d66[_0x0edb('0x33')]);_0x2eb536['attributes']=_[_0x0edb('0x36')](_0x592d66[_0x0edb('0x32')],qs['fields'](_0x452b32['query'][_0x0edb('0x37')]));_0x2eb536[_0x0edb('0x35')]=_0x2eb536['attributes']['length']?_0x2eb536[_0x0edb('0x35')]:_0x592d66[_0x0edb('0x32')];_0x2eb536[_0x0edb('0x54')]=qs[_0x0edb('0x3a')](_0x452b32[_0x0edb('0x33')][_0x0edb('0x3a')]);_0x2eb536['where']=qs[_0x0edb('0x3b')](_['pick'](_0x452b32[_0x0edb('0x33')],_0x592d66['filters']));if(_0x452b32[_0x0edb('0x33')][_0x0edb('0x3d')]){_0x2eb536['where']=_[_0x0edb('0x3f')](_0x2eb536[_0x0edb('0x3e')],{'$or':_['map'](_0x2eb536[_0x0edb('0x35')],function(_0x46cbb1){var _0x4f9120={};_0x4f9120[_0x46cbb1]={'$like':'%'+_0x452b32[_0x0edb('0x33')][_0x0edb('0x3d')]+'%'};return _0x4f9120;})});}_0x2eb536=_['merge']({},_0x2eb536,_0x452b32[_0x0edb('0x41')]);return _0x48d26d[_0x0edb('0x59')](_0x2eb536);}})[_0x0edb('0x25')](function(_0x48e5f5){if(_0x48e5f5){_0x25c8ae=_0x48e5f5[_0x0edb('0x38')];if(!_0x452b32['query'][_0x0edb('0x55')]('nolimit')){_0x2eb536[_0x0edb('0x1e')]=qs['limit'](_0x452b32[_0x0edb('0x33')][_0x0edb('0x1e')]);_0x2eb536[_0x0edb('0x1c')]=qs['offset'](_0x452b32[_0x0edb('0x33')][_0x0edb('0x1c')]);}return _0x48d26d[_0x0edb('0x59')](_0x2eb536);}})['then'](function(_0x2c56a8){if(_0x2c56a8){return _0x2c56a8?{'count':_0x25c8ae,'rows':_0x2c56a8}:null;}})[_0x0edb('0x25')](respondWithResult(_0x43c49f,null))['catch'](handleError(_0x43c49f,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 794ae6a..70949b3 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 _0x1061=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','lodash','moment','bluebird'];(function(_0x22e7fb,_0x33373d){var _0x4a5f8b=function(_0x56bab5){while(--_0x56bab5){_0x22e7fb['push'](_0x22e7fb['shift']());}};_0x4a5f8b(++_0x33373d);}(_0x1061,0x1b5));var _0x1106=function(_0x40a19a,_0x53cbb6){_0x40a19a=_0x40a19a-0x0;var _0x2db7ad=_0x1061[_0x40a19a];return _0x2db7ad;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1106('0x1'));var BPromise=require(_0x1106('0x2'));var rp=require(_0x1106('0x3'));var fs=require('fs');var path=require(_0x1106('0x4'));var rimraf=require(_0x1106('0x5'));var config=require(_0x1106('0x6'));var attributes=require(_0x1106('0x7'));module[_0x1106('0x8')]=function(_0x5120c6,_0x1f098a){return _0x5120c6[_0x1106('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf53f=['tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0xf53f,0x8d));var _0xff53=function(_0x5f0a09,_0x25bbfb){_0x5f0a09=_0x5f0a09-0x0;var _0x458640=_0xf53f[_0x5f0a09];return _0x458640;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var logger=require(_0xff53('0x2'))(_0xff53('0x3'));var moment=require(_0xff53('0x4'));var BPromise=require(_0xff53('0x5'));var rp=require(_0xff53('0x6'));var fs=require('fs');var path=require(_0xff53('0x7'));var rimraf=require(_0xff53('0x8'));var config=require(_0xff53('0x9'));var attributes=require(_0xff53('0xa'));module[_0xff53('0xb')]=function(_0x54d39c,_0x54e637){return _0x54d39c[_0xff53('0xc')]('Trigger',attributes,{'tableName':_0xff53('0xd'),'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 f7c4ef0..cf1b484 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 _0x9ee3=['GetTrigger','Trigger','findAll','raw','options','where','attributes','limit','include','model','map','ShowTrigger','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x32bef6,_0x5cfe2b){var _0x20cb76=function(_0x4c6eaf){while(--_0x4c6eaf){_0x32bef6['push'](_0x32bef6['shift']());}};_0x20cb76(++_0x5cfe2b);}(_0x9ee3,0x6c));var _0x39ee=function(_0x18362f,_0x137297){_0x18362f=_0x18362f-0x0;var _0xe36dbc=_0x9ee3[_0x18362f];return _0xe36dbc;};'use strict';var _=require(_0x39ee('0x0'));var util=require(_0x39ee('0x1'));var moment=require(_0x39ee('0x2'));var BPromise=require(_0x39ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39ee('0x5'))('rpc');var config=require(_0x39ee('0x6'));var jayson=require(_0x39ee('0x7'));var client=jayson['client'][_0x39ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37ca0c,_0x3b756c,_0x7dcd00){return new BPromise(function(_0x505245,_0x27ac65){return client['request'](_0x37ca0c,_0x7dcd00)[_0x39ee('0x9')](function(_0x18a6fb){logger[_0x39ee('0xa')](_0x39ee('0xb'),_0x3b756c,_0x39ee('0xc'));logger[_0x39ee('0xd')](_0x39ee('0xe'),_0x3b756c,_0x39ee('0xc'),JSON[_0x39ee('0xf')](_0x18a6fb));if(_0x18a6fb[_0x39ee('0x10')]){if(_0x18a6fb[_0x39ee('0x10')]['code']===0x1f4){logger[_0x39ee('0x10')](_0x39ee('0xb'),_0x3b756c,_0x18a6fb[_0x39ee('0x10')][_0x39ee('0x11')]);return _0x27ac65(_0x18a6fb['error'][_0x39ee('0x11')]);}logger[_0x39ee('0x10')]('Trigger,\x20%s,\x20%s',_0x3b756c,_0x18a6fb[_0x39ee('0x10')][_0x39ee('0x11')]);return _0x505245(_0x18a6fb['error'][_0x39ee('0x11')]);}else{logger[_0x39ee('0xa')](_0x39ee('0xb'),_0x3b756c,_0x39ee('0xc'));_0x505245(_0x18a6fb[_0x39ee('0x12')]['message']);}})[_0x39ee('0x13')](function(_0x569704){logger['error'](_0x39ee('0xb'),_0x3b756c,_0x569704);_0x27ac65(_0x569704);});});}exports[_0x39ee('0x14')]=function(_0x8d9e58){var _0x260e62=this;return new Promise(function(_0x4f37cf,_0x1beec6){return db[_0x39ee('0x15')][_0x39ee('0x16')]({'raw':_0x8d9e58['options']?_0x8d9e58['options'][_0x39ee('0x17')]===undefined?!![]:![]:!![],'where':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x19')]||null:null,'attributes':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x1a')]||null:null,'limit':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x1b')]||null:null,'include':_0x8d9e58['options']?_0x8d9e58[_0x39ee('0x18')][_0x39ee('0x1c')]?_['map'](_0x8d9e58['options']['include'],function(_0x476c11){return{'model':db[_0x476c11[_0x39ee('0x1d')]],'as':_0x476c11['as'],'attributes':_0x476c11[_0x39ee('0x1a')],'include':_0x476c11[_0x39ee('0x1c')]?_[_0x39ee('0x1e')](_0x476c11[_0x39ee('0x1c')],function(_0x46dc49){return{'model':db[_0x46dc49[_0x39ee('0x1d')]],'as':_0x46dc49['as'],'attributes':_0x46dc49[_0x39ee('0x1a')],'include':_0x46dc49[_0x39ee('0x1c')]?_[_0x39ee('0x1e')](_0x46dc49[_0x39ee('0x1c')],function(_0x4ec922){return{'model':db[_0x4ec922[_0x39ee('0x1d')]],'as':_0x4ec922['as'],'attributes':_0x4ec922[_0x39ee('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1853ac){logger['info'](_0x39ee('0x14'),_0x8d9e58);logger[_0x39ee('0xd')]('GetTrigger',_0x8d9e58,JSON['stringify'](_0x1853ac));_0x4f37cf(_0x1853ac);})[_0x39ee('0x13')](function(_0x38b644){logger[_0x39ee('0x10')](_0x39ee('0x14'),_0x38b644[_0x39ee('0x11')],_0x8d9e58);_0x1beec6(_0x260e62[_0x39ee('0x10')](0x1f4,_0x38b644[_0x39ee('0x11')]));});});};exports[_0x39ee('0x1f')]=function(_0x3f3a69){var _0x3e6866=this;return new Promise(function(_0x1b9f2a,_0x3982c9){return db[_0x39ee('0x15')]['find']({'raw':_0x3f3a69[_0x39ee('0x18')]?_0x3f3a69[_0x39ee('0x18')][_0x39ee('0x17')]===undefined?!![]:![]:!![],'where':_0x3f3a69['options']?_0x3f3a69['options'][_0x39ee('0x19')]||null:null,'attributes':_0x3f3a69[_0x39ee('0x18')]?_0x3f3a69[_0x39ee('0x18')]['attributes']||null:null,'include':_0x3f3a69[_0x39ee('0x18')]?_0x3f3a69['options']['include']?_[_0x39ee('0x1e')](_0x3f3a69[_0x39ee('0x18')][_0x39ee('0x1c')],function(_0x596f16){return{'model':db[_0x596f16[_0x39ee('0x1d')]],'as':_0x596f16['as'],'attributes':_0x596f16[_0x39ee('0x1a')],'include':_0x596f16[_0x39ee('0x1c')]?_[_0x39ee('0x1e')](_0x596f16[_0x39ee('0x1c')],function(_0x5c68ba){return{'model':db[_0x5c68ba[_0x39ee('0x1d')]],'as':_0x5c68ba['as'],'attributes':_0x5c68ba[_0x39ee('0x1a')],'include':_0x5c68ba[_0x39ee('0x1c')]?_['map'](_0x5c68ba[_0x39ee('0x1c')],function(_0x4f3119){return{'model':db[_0x4f3119[_0x39ee('0x1d')]],'as':_0x4f3119['as'],'attributes':_0x4f3119[_0x39ee('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x462edf){logger['info'](_0x39ee('0x1f'),_0x3f3a69);logger[_0x39ee('0xd')](_0x39ee('0x1f'),_0x3f3a69,JSON['stringify'](_0x462edf));_0x1b9f2a(_0x462edf);})['catch'](function(_0x8a2234){logger[_0x39ee('0x10')]('ShowTrigger',_0x8a2234[_0x39ee('0x11')],_0x3f3a69);_0x3982c9(_0x3e6866['error'](0x1f4,_0x8a2234[_0x39ee('0x11')]));});});}; \ No newline at end of file +var _0x3657=['debug','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','findAll','options','raw','attributes','limit','map','include','model','GetTrigger','ShowTrigger','find','where'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x3657,0xcd));var _0x7365=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x3657[_0x3cb30b];return _0x2ca717;};'use strict';var _=require('lodash');var util=require(_0x7365('0x0'));var moment=require(_0x7365('0x1'));var BPromise=require('bluebird');var rs=require(_0x7365('0x2'));var fs=require('fs');var Redis=require(_0x7365('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7365('0x4'));var config=require(_0x7365('0x5'));var jayson=require(_0x7365('0x6'));var client=jayson[_0x7365('0x7')][_0x7365('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x459cd9,_0xdf7893,_0x4791ed){return new BPromise(function(_0x5d4716,_0xaa4b77){return client[_0x7365('0x9')](_0x459cd9,_0x4791ed)[_0x7365('0xa')](function(_0x3c0b5e){logger[_0x7365('0xb')]('Trigger,\x20%s,\x20%s',_0xdf7893,_0x7365('0xc'));logger['debug'](_0x7365('0xd'),_0xdf7893,_0x7365('0xc'),JSON[_0x7365('0xe')](_0x3c0b5e));if(_0x3c0b5e[_0x7365('0xf')]){if(_0x3c0b5e[_0x7365('0xf')][_0x7365('0x10')]===0x1f4){logger[_0x7365('0xf')](_0x7365('0x11'),_0xdf7893,_0x3c0b5e[_0x7365('0xf')][_0x7365('0x12')]);return _0xaa4b77(_0x3c0b5e[_0x7365('0xf')]['message']);}logger[_0x7365('0xf')]('Trigger,\x20%s,\x20%s',_0xdf7893,_0x3c0b5e[_0x7365('0xf')][_0x7365('0x12')]);return _0x5d4716(_0x3c0b5e['error'][_0x7365('0x12')]);}else{logger[_0x7365('0xb')]('Trigger,\x20%s,\x20%s',_0xdf7893,_0x7365('0xc'));_0x5d4716(_0x3c0b5e[_0x7365('0x13')][_0x7365('0x12')]);}})[_0x7365('0x14')](function(_0x5a81d8){logger['error'](_0x7365('0x11'),_0xdf7893,_0x5a81d8);_0xaa4b77(_0x5a81d8);});});}exports['GetTrigger']=function(_0x2200c3){var _0x39ec6b=this;return new Promise(function(_0x26bd84,_0x251a97){return db['Trigger'][_0x7365('0x15')]({'raw':_0x2200c3[_0x7365('0x16')]?_0x2200c3[_0x7365('0x16')][_0x7365('0x17')]===undefined?!![]:![]:!![],'where':_0x2200c3[_0x7365('0x16')]?_0x2200c3[_0x7365('0x16')]['where']||null:null,'attributes':_0x2200c3[_0x7365('0x16')]?_0x2200c3['options'][_0x7365('0x18')]||null:null,'limit':_0x2200c3[_0x7365('0x16')]?_0x2200c3['options'][_0x7365('0x19')]||null:null,'include':_0x2200c3['options']?_0x2200c3[_0x7365('0x16')]['include']?_[_0x7365('0x1a')](_0x2200c3[_0x7365('0x16')][_0x7365('0x1b')],function(_0x18c067){return{'model':db[_0x18c067[_0x7365('0x1c')]],'as':_0x18c067['as'],'attributes':_0x18c067[_0x7365('0x18')],'include':_0x18c067['include']?_[_0x7365('0x1a')](_0x18c067[_0x7365('0x1b')],function(_0x416f20){return{'model':db[_0x416f20[_0x7365('0x1c')]],'as':_0x416f20['as'],'attributes':_0x416f20[_0x7365('0x18')],'include':_0x416f20[_0x7365('0x1b')]?_[_0x7365('0x1a')](_0x416f20[_0x7365('0x1b')],function(_0x4c542a){return{'model':db[_0x4c542a['model']],'as':_0x4c542a['as'],'attributes':_0x4c542a[_0x7365('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7365('0xa')](function(_0xc35e4d){logger[_0x7365('0xb')](_0x7365('0x1d'),_0x2200c3);logger['debug']('GetTrigger',_0x2200c3,JSON['stringify'](_0xc35e4d));_0x26bd84(_0xc35e4d);})[_0x7365('0x14')](function(_0x103976){logger[_0x7365('0xf')]('GetTrigger',_0x103976[_0x7365('0x12')],_0x2200c3);_0x251a97(_0x39ec6b[_0x7365('0xf')](0x1f4,_0x103976[_0x7365('0x12')]));});});};exports[_0x7365('0x1e')]=function(_0x23ecba){var _0x5899b3=this;return new Promise(function(_0x2faef5,_0x330690){return db['Trigger'][_0x7365('0x1f')]({'raw':_0x23ecba[_0x7365('0x16')]?_0x23ecba[_0x7365('0x16')][_0x7365('0x17')]===undefined?!![]:![]:!![],'where':_0x23ecba[_0x7365('0x16')]?_0x23ecba[_0x7365('0x16')][_0x7365('0x20')]||null:null,'attributes':_0x23ecba['options']?_0x23ecba['options'][_0x7365('0x18')]||null:null,'include':_0x23ecba[_0x7365('0x16')]?_0x23ecba[_0x7365('0x16')][_0x7365('0x1b')]?_['map'](_0x23ecba[_0x7365('0x16')][_0x7365('0x1b')],function(_0x5c42d7){return{'model':db[_0x5c42d7[_0x7365('0x1c')]],'as':_0x5c42d7['as'],'attributes':_0x5c42d7['attributes'],'include':_0x5c42d7['include']?_[_0x7365('0x1a')](_0x5c42d7[_0x7365('0x1b')],function(_0x38146d){return{'model':db[_0x38146d[_0x7365('0x1c')]],'as':_0x38146d['as'],'attributes':_0x38146d['attributes'],'include':_0x38146d[_0x7365('0x1b')]?_[_0x7365('0x1a')](_0x38146d[_0x7365('0x1b')],function(_0x5efb71){return{'model':db[_0x5efb71[_0x7365('0x1c')]],'as':_0x5efb71['as'],'attributes':_0x5efb71['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cee01){logger['info'](_0x7365('0x1e'),_0x23ecba);logger[_0x7365('0x21')]('ShowTrigger',_0x23ecba,JSON[_0x7365('0xe')](_0x4cee01));_0x2faef5(_0x4cee01);})[_0x7365('0x14')](function(_0x3ba89f){logger['error'](_0x7365('0x1e'),_0x3ba89f['message'],_0x23ecba);_0x330690(_0x5899b3[_0x7365('0xf')](0x1f4,_0x3ba89f[_0x7365('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 9897914..4216218 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 _0xa830=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','post','/:id/clone','clone','create','put','/:id','delete'];(function(_0x46b30d,_0x2dc5d9){var _0x30c873=function(_0x46dd32){while(--_0x46dd32){_0x46b30d['push'](_0x46b30d['shift']());}};_0x30c873(++_0x2dc5d9);}(_0xa830,0x120));var _0x0a83=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0xa830[_0xe09d0];return _0x44ad05;};'use strict';var multer=require(_0x0a83('0x0'));var util=require(_0x0a83('0x1'));var path=require(_0x0a83('0x2'));var timeout=require(_0x0a83('0x3'));var express=require(_0x0a83('0x4'));var router=express[_0x0a83('0x5')]();var fs_extra=require(_0x0a83('0x6'));var auth=require(_0x0a83('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0a83('0x8'));var controller=require(_0x0a83('0x9'));router['get']('/',auth[_0x0a83('0xa')](),controller[_0x0a83('0xb')]);router[_0x0a83('0xc')]('/:id',auth[_0x0a83('0xa')](),controller['show']);router[_0x0a83('0xd')](_0x0a83('0xe'),auth[_0x0a83('0xa')](),controller[_0x0a83('0xf')]);router['post']('/',auth[_0x0a83('0xa')](),controller[_0x0a83('0x10')]);router[_0x0a83('0x11')](_0x0a83('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x0a83('0x13')]('/:id',auth[_0x0a83('0xa')](),controller[_0x0a83('0x14')]);module[_0x0a83('0x15')]=router; \ No newline at end of file +var _0x790e=['util','path','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/clone','put','update','delete','destroy','exports','multer'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x790e,0x18f));var _0xe790=function(_0x235097,_0x189ad0){_0x235097=_0x235097-0x0;var _0x28498a=_0x790e[_0x235097];return _0x28498a;};'use strict';var multer=require(_0xe790('0x0'));var util=require(_0xe790('0x1'));var path=require(_0xe790('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe790('0x3'));var config=require(_0xe790('0x4'));var controller=require('./trunk.controller');router[_0xe790('0x5')]('/',auth[_0xe790('0x6')](),controller[_0xe790('0x7')]);router[_0xe790('0x5')](_0xe790('0x8'),auth[_0xe790('0x6')](),controller[_0xe790('0x9')]);router['post'](_0xe790('0xa'),auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0xe790('0x6')](),controller['create']);router[_0xe790('0xb')](_0xe790('0x8'),auth[_0xe790('0x6')](),controller[_0xe790('0xc')]);router[_0xe790('0xd')](_0xe790('0x8'),auth[_0xe790('0x6')](),controller[_0xe790('0xe')]);module[_0xe790('0xf')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 9710a28..3935be6 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 _0x1ca0=['getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','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\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','originate','uas','pai','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join'];(function(_0x51465b,_0xa5be6){var _0x4fbd88=function(_0x439e1a){while(--_0x439e1a){_0x51465b['push'](_0x51465b['shift']());}};_0x4fbd88(++_0xa5be6);}(_0x1ca0,0x16f));var _0x01ca=function(_0x32ac07,_0xb14a29){_0x32ac07=_0x32ac07-0x0;var _0x347b1f=_0x1ca0[_0x32ac07];return _0x347b1f;};'use strict';var Sequelize=require(_0x01ca('0x0'));module[_0x01ca('0x1')]={'name':{'type':Sequelize[_0x01ca('0x2')],'allowNull':![],'unique':_0x01ca('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x5'),_0x01ca('0x6'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x01ca('0x2')],'allowNull':![],'defaultValue':_0x01ca('0x7')},'callingpres':{'type':Sequelize[_0x01ca('0x4')]('ALLOWED_NOT_SCREENED',_0x01ca('0x8'),_0x01ca('0x9'),_0x01ca('0xa'),'PROHIB_NOT_SCREENED',_0x01ca('0xb'),_0x01ca('0xc'),_0x01ca('0xd'))},'deny':{'type':Sequelize[_0x01ca('0x2')]},'permit':{'type':Sequelize[_0x01ca('0x2')]},'secret':{'type':Sequelize[_0x01ca('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x01ca('0x2')]},'transport':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0xe'),'set':function(_0x12b56c){this['setDataValue'](_0x01ca('0xf'),_0x12b56c?_0x12b56c[_0x01ca('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x01ca('0xf'))?this[_0x01ca('0x11')](_0x01ca('0xf'))[_0x01ca('0x12')](','):null;},'comment':_0x01ca('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x01ca('0x14'),'info',_0x01ca('0x15'),_0x01ca('0x16'),'auto'),'defaultValue':_0x01ca('0x14')},'directmedia':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no',_0x01ca('0x18'),_0x01ca('0x19'),_0x01ca('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0x1b'),'set':function(_0x52e13f){this[_0x01ca('0x1c')](_0x01ca('0x1d'),_0x52e13f?_0x52e13f[_0x01ca('0x10')](','):null);},'get':function(){return this[_0x01ca('0x11')](_0x01ca('0x1d'))?this['getDataValue'](_0x01ca('0x1d'))[_0x01ca('0x12')](','):null;},'comment':_0x01ca('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x01ca('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x01ca('0x2')],'allowNull':![],'defaultValue':_0x01ca('0x1f'),'set':function(_0x1672cf){this[_0x01ca('0x1c')](_0x01ca('0x20'),_0x1672cf?_0x1672cf['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x01ca('0x11')](_0x01ca('0x20'))?this[_0x01ca('0x11')]('allow')['split'](';'):null;},'comment':_0x01ca('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x42dc7a){this[_0x01ca('0x1c')](_0x01ca('0x22'),_0x42dc7a?_0x42dc7a[_0x01ca('0x10')](','):null);},'get':function(){return this[_0x01ca('0x11')](_0x01ca('0x22'))?this[_0x01ca('0x11')](_0x01ca('0x22'))['split'](','):null;},'comment':_0x01ca('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no',_0x01ca('0x24'))},'promiscredir':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'accountcode':{'type':Sequelize[_0x01ca('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x01ca('0x4')]('yes','no'),'defaultValue':_0x01ca('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x01ca('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x01ca('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x01ca('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x01ca('0x2')]},'session_timers':{'type':Sequelize[_0x01ca('0x4')]('accept','refuse',_0x01ca('0x27'))},'session_expires':{'type':Sequelize[_0x01ca('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x01ca('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x01ca('0x4')]('uac',_0x01ca('0x28')),'defaultValue':_0x01ca('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x01ca('0x2')]},'regexten':{'type':Sequelize[_0x01ca('0x2')]},'fromdomain':{'type':Sequelize[_0x01ca('0x2')]},'fromuser':{'type':Sequelize[_0x01ca('0x2')]},'port':{'type':Sequelize[_0x01ca('0x25')](0x5)},'qualify':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':_0x01ca('0x17')},'keepalive':{'type':Sequelize[_0x01ca('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x01ca('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x01ca('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x01ca('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x01ca('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no',_0x01ca('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x01ca('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x01ca('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x01ca('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x01ca('0x2')]},'contactdeny':{'type':Sequelize[_0x01ca('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x01ca('0x2')]},'use_q850_reason':{'type':Sequelize[_0x01ca('0x2')]},'maxforwards':{'type':Sequelize[_0x01ca('0x25')](0xb)},'encryption':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'force_avp':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'icesupport':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x17'),'no','fingerprint',_0x01ca('0x2a'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x01ca('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x01ca('0x2')]},'dtlscipher':{'type':Sequelize[_0x01ca('0x2')]},'dtlscafile':{'type':Sequelize[_0x01ca('0x2')]},'dtlscapath':{'type':Sequelize[_0x01ca('0x2')]},'dtlssetup':{'type':Sequelize[_0x01ca('0x4')]('active',_0x01ca('0x2b'),_0x01ca('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x01ca('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x01ca('0x2')]},'recordofffeature':{'type':Sequelize[_0x01ca('0x2')]},'call_limit':{'type':Sequelize[_0x01ca('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x01ca('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x01ca('0x2')]},'mohinterpret':{'type':Sequelize[_0x01ca('0x2')]},'mohsuggest':{'type':Sequelize[_0x01ca('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':_0x01ca('0x2d')},'canreinvite':{'type':Sequelize['ENUM'](_0x01ca('0x17'),'no',_0x01ca('0x18'),_0x01ca('0x19'),_0x01ca('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x01ca('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x01ca('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x01ca('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xe18a=['sequelize','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update','update,nonat','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe18a,0xa2));var _0xae18=function(_0x5e1a5d,_0x2ebbc4){_0x5e1a5d=_0x5e1a5d-0x0;var _0x57b409=_0xe18a[_0x5e1a5d];return _0x57b409;};'use strict';var Sequelize=require(_0xae18('0x0'));module[_0xae18('0x1')]={'name':{'type':Sequelize[_0xae18('0x2')],'allowNull':![],'unique':_0xae18('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x5'),'user',_0xae18('0x6')),'allowNull':![],'defaultValue':_0xae18('0x5')},'context':{'type':Sequelize[_0xae18('0x2')],'allowNull':![],'defaultValue':_0xae18('0x7')},'callingpres':{'type':Sequelize[_0xae18('0x4')]('ALLOWED_NOT_SCREENED',_0xae18('0x8'),_0xae18('0x9'),_0xae18('0xa'),_0xae18('0xb'),_0xae18('0xc'),_0xae18('0xd'),_0xae18('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xae18('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xae18('0x2')]},'remotesecret':{'type':Sequelize[_0xae18('0x2')]},'transport':{'type':Sequelize[_0xae18('0x2')],'defaultValue':_0xae18('0xf'),'set':function(_0x51aae0){this[_0xae18('0x10')](_0xae18('0x11'),_0x51aae0?_0x51aae0[_0xae18('0x12')](','):null);},'get':function(){return this[_0xae18('0x13')](_0xae18('0x11'))?this[_0xae18('0x13')]('transport')['split'](','):null;},'comment':_0xae18('0x14')},'dtmfmode':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x15'),_0xae18('0x16'),'shortinfo',_0xae18('0x17'),_0xae18('0x18')),'defaultValue':_0xae18('0x15')},'directmedia':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no','nonat','update',_0xae18('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xae18('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xae18('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xae18('0x2')],'defaultValue':_0xae18('0x1b'),'set':function(_0x4f4a11){this['setDataValue'](_0xae18('0x1c'),_0x4f4a11?_0x4f4a11['join'](','):null);},'get':function(){return this[_0xae18('0x13')](_0xae18('0x1c'))?this[_0xae18('0x13')](_0xae18('0x1c'))[_0xae18('0x1d')](','):null;},'comment':_0xae18('0x1e')},'callgroup':{'type':Sequelize[_0xae18('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xae18('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xae18('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xae18('0x2')],'defaultValue':_0xae18('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x10e417){this[_0xae18('0x10')](_0xae18('0x20'),_0x10e417?_0x10e417[_0xae18('0x12')](';'):_0xae18('0x21'));},'get':function(){return this[_0xae18('0x13')](_0xae18('0x20'))?this['getDataValue'](_0xae18('0x20'))[_0xae18('0x1d')](';'):null;},'comment':_0xae18('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0xae18('0x19'),'no')},'insecure':{'type':Sequelize[_0xae18('0x2')],'defaultValue':_0xae18('0x23'),'set':function(_0x234dd2){this[_0xae18('0x10')](_0xae18('0x24'),_0x234dd2?_0x234dd2['join'](','):null);},'get':function(){return this[_0xae18('0x13')](_0xae18('0x24'))?this[_0xae18('0x13')]('insecure')[_0xae18('0x1d')](','):null;},'comment':_0xae18('0x25')},'trustrpid':{'type':Sequelize[_0xae18('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xae18('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'useclientcode':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'accountcode':{'type':Sequelize[_0xae18('0x26')](0xb)},'setvar':{'type':Sequelize[_0xae18('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xae18('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no'),'defaultValue':_0xae18('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0xae18('0x2')]},'template':{'type':Sequelize[_0xae18('0x2')]},'videosupport':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xae18('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'mailbox':{'type':Sequelize[_0xae18('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept','refuse',_0xae18('0x28'))},'session_expires':{'type':Sequelize[_0xae18('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xae18('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xae18('0x29'),_0xae18('0x2a')),'defaultValue':_0xae18('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xae18('0x2')]},'fromdomain':{'type':Sequelize[_0xae18('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xae18('0x26')](0x5)},'qualify':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no'),'defaultValue':_0xae18('0x19')},'keepalive':{'type':Sequelize[_0xae18('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xae18('0x2')]},'rtptimeout':{'type':Sequelize[_0xae18('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xae18('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xae18('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xae18('0x4')]('yes','no',_0xae18('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xae18('0x2')]},'callbackextension':{'type':Sequelize[_0xae18('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xae18('0x2')]},'contactdeny':{'type':Sequelize[_0xae18('0x2')]},'contactacl':{'type':Sequelize[_0xae18('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xae18('0x2')]},'maxforwards':{'type':Sequelize[_0xae18('0x26')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xae18('0x4')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0xae18('0x19'),'no')},'icesupport':{'type':Sequelize[_0xae18('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no',_0xae18('0x2c'),_0xae18('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xae18('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xae18('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xae18('0x2')]},'dtlscipher':{'type':Sequelize[_0xae18('0x2')]},'dtlscafile':{'type':Sequelize[_0xae18('0x2')]},'dtlscapath':{'type':Sequelize[_0xae18('0x2')]},'dtlssetup':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x2e'),_0xae18('0x2f'),_0xae18('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xae18('0x2')]},'usereqphone':{'type':Sequelize[_0xae18('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xae18('0x2')]},'recordofffeature':{'type':Sequelize[_0xae18('0x2')]},'call_limit':{'type':Sequelize[_0xae18('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0xae18('0x4')](_0xae18('0x19'),'no')},'vmexten':{'type':Sequelize[_0xae18('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xae18('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xae18('0x2')]},'host':{'type':Sequelize[_0xae18('0x2')],'defaultValue':_0xae18('0x31')},'canreinvite':{'type':Sequelize['ENUM'](_0xae18('0x19'),'no',_0xae18('0x32'),_0xae18('0x33'),_0xae18('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xae18('0x2')]},'otherFields':{'type':Sequelize[_0xae18('0x2')]},'active':{'type':Sequelize[_0xae18('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xae18('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 4660560..637cef6 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 _0xdace=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','get','Trunks','UserProfileResource','destroy','stack','name','send','index','Trunk','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','rows','show','params','keys','find','clone','options','omit','createdAt','updatedAt','body','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','findAll','Reload','update','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs'];(function(_0x4fffdf,_0x103fec){var _0x111c50=function(_0x70c156){while(--_0x70c156){_0x4fffdf['push'](_0x4fffdf['shift']());}};_0x111c50(++_0x103fec);}(_0xdace,0xc5));var _0xedac=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0xdace[_0x3d9b04];return _0x557936;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xedac('0x15'));var client=jayson[_0xedac('0x16')][_0xedac('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342186,_0x9a79a0,_0x473c3e,_0x28444a){return new BPromise(function(_0x11f0b0,_0x593030){var _0x110546=_0x28444a||client;return _0x110546[_0xedac('0x18')](_0x342186,_0x473c3e)[_0xedac('0x19')](function(_0x2676c3){logger[_0xedac('0x1a')]('Trunk,\x20%s,\x20%s',_0x9a79a0,_0xedac('0x1b'));logger['debug'](_0xedac('0x1c'),_0x9a79a0,_0xedac('0x1b'),JSON[_0xedac('0x1d')](_0x2676c3));if(_0x2676c3[_0xedac('0x1e')]){if(_0x2676c3['error']['code']===0x1f4){logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x593030(_0x2676c3['error']['message']);}logger[_0xedac('0x1e')](_0xedac('0x1f'),_0x9a79a0,_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);return _0x11f0b0(_0x2676c3[_0xedac('0x1e')][_0xedac('0x20')]);}else{logger[_0xedac('0x1a')](_0xedac('0x1f'),_0x9a79a0,'request\x20sent');_0x11f0b0(_0x2676c3[_0xedac('0x21')]['message']);}})[_0xedac('0x22')](function(_0x14fc02){logger['error'](_0xedac('0x1f'),_0x9a79a0,_0x14fc02);_0x593030(_0x14fc02);});});}function respondWithStatusCode(_0x404b8d,_0x1c87bf){_0x1c87bf=_0x1c87bf||0xcc;return function(_0x1e5e47){if(_0x1e5e47){return _0x404b8d[_0xedac('0x23')](_0x1c87bf);}return _0x404b8d[_0xedac('0x24')](_0x1c87bf)['end']();};}function respondWithResult(_0x3114a1,_0x87d343){_0x87d343=_0x87d343||0xc8;return function(_0x37563f){if(_0x37563f){return _0x3114a1[_0xedac('0x24')](_0x87d343)[_0xedac('0x25')](_0x37563f);}};}function respondWithFilteredResult(_0x453a3c,_0x40ba53){return function(_0x26c6f7){if(_0x26c6f7){var _0x409825=typeof _0x40ba53[_0xedac('0x26')]==='undefined'&&typeof _0x40ba53[_0xedac('0x27')]===_0xedac('0x28');var _0x19aed3=_0x26c6f7['count'];var _0x313e06=_0x409825?0x0:_0x40ba53['offset'];var _0x524514=_0x409825?_0x26c6f7[_0xedac('0x29')]:_0x40ba53[_0xedac('0x26')]+_0x40ba53[_0xedac('0x27')];var _0x14522a;if(_0x524514>=_0x19aed3){_0x524514=_0x19aed3;_0x14522a=0xc8;}else{_0x14522a=0xce;}_0x453a3c['status'](_0x14522a);return _0x453a3c['set'](_0xedac('0x2a'),_0x313e06+'-'+_0x524514+'/'+_0x19aed3)[_0xedac('0x25')](_0x26c6f7);}return null;};}function patchUpdates(_0x24b182){return function(_0x2ee8d7){try{jsonpatch[_0xedac('0x2b')](_0x2ee8d7,_0x24b182,!![]);}catch(_0x17fcf3){return BPromise[_0xedac('0x2c')](_0x17fcf3);}return _0x2ee8d7['save']();};}function saveUpdates(_0x3bc910,_0x26418a){return function(_0x2cbe33){if(_0x2cbe33){return _0x2cbe33['update'](_0x3bc910)[_0xedac('0x19')](function(_0x1213dc){return _0x1213dc;});}return null;};}function removeEntity(_0x5665d8,_0x3583cd){return function(_0x2c622a){if(_0x2c622a){return _0x2c622a['destroy']()[_0xedac('0x19')](function(){var _0x1e82da=_0x2c622a[_0xedac('0x2d')]({'plain':!![]});var _0x195f78=_0xedac('0x2e');return db[_0xedac('0x2f')][_0xedac('0x30')]({'where':{'type':_0x195f78,'resourceId':_0x1e82da['id']}})[_0xedac('0x19')](function(){return _0x2c622a;});})[_0xedac('0x19')](function(){_0x5665d8[_0xedac('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ef574,_0xf5cd99){return function(_0x2a87ae){if(!_0x2a87ae){_0x9ef574[_0xedac('0x23')](0x194);}return _0x2a87ae;};}function handleError(_0x15815e,_0x1d2f45){_0x1d2f45=_0x1d2f45||0x1f4;return function(_0x107431){logger[_0xedac('0x1e')](_0x107431[_0xedac('0x31')]);if(_0x107431[_0xedac('0x32')]){delete _0x107431[_0xedac('0x32')];}_0x15815e[_0xedac('0x24')](_0x1d2f45)[_0xedac('0x33')](_0x107431);};}exports[_0xedac('0x34')]=function(_0xcf7c0c,_0x527878){var _0x1ddcc1={},_0x42c2c9={},_0x20d997={'count':0x0,'rows':[]};var _0x27481c=_['map'](db[_0xedac('0x35')][_0xedac('0x36')],function(_0x16b9d5){return{'name':_0x16b9d5['fieldName'],'type':_0x16b9d5[_0xedac('0x37')][_0xedac('0x38')]};});_0x42c2c9[_0xedac('0x39')]=_['map'](_0x27481c,_0xedac('0x32'));_0x42c2c9[_0xedac('0x3a')]=_['keys'](_0xcf7c0c[_0xedac('0x3a')]);_0x42c2c9[_0xedac('0x3b')]=_['intersection'](_0x42c2c9[_0xedac('0x39')],_0x42c2c9['query']);_0x1ddcc1[_0xedac('0x3c')]=_[_0xedac('0x3d')](_0x42c2c9[_0xedac('0x39')],qs[_0xedac('0x3e')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x3e')]));_0x1ddcc1['attributes']=_0x1ddcc1[_0xedac('0x3c')][_0xedac('0x3f')]?_0x1ddcc1[_0xedac('0x3c')]:_0x42c2c9[_0xedac('0x39')];if(!_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x40')](_0xedac('0x41'))){_0x1ddcc1[_0xedac('0x27')]=qs[_0xedac('0x27')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x27')]);_0x1ddcc1[_0xedac('0x26')]=qs[_0xedac('0x26')](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x26')]);}_0x1ddcc1[_0xedac('0x42')]=qs['sort'](_0xcf7c0c[_0xedac('0x3a')][_0xedac('0x43')]);_0x1ddcc1[_0xedac('0x44')]=qs['filters'](_['pick'](_0xcf7c0c['query'],_0x42c2c9[_0xedac('0x3b')]),_0x27481c);if(_0xcf7c0c[_0xedac('0x3a')]['filter']){_0x1ddcc1[_0xedac('0x44')]=_['merge'](_0x1ddcc1[_0xedac('0x44')],{'$or':_['map'](_0x27481c,function(_0x13d51d){if(_0x13d51d[_0xedac('0x37')]!==_0xedac('0x45')){var _0x114b2e={};_0x114b2e[_0x13d51d[_0xedac('0x32')]]={'$like':'%'+_0xcf7c0c['query']['filter']+'%'};return _0x114b2e;}})});}_0x1ddcc1=_[_0xedac('0x46')]({},_0x1ddcc1,_0xcf7c0c['options']);var _0x39b159={'where':_0x1ddcc1[_0xedac('0x44')]};return db[_0xedac('0x35')]['count'](_0x39b159)[_0xedac('0x19')](function(_0x45189f){_0x20d997[_0xedac('0x29')]=_0x45189f;if(_0xcf7c0c['query'][_0xedac('0x47')]){_0x1ddcc1[_0xedac('0x48')]=[{'all':!![]}];}return db[_0xedac('0x35')]['findAll'](_0x1ddcc1);})['then'](function(_0x2cb3ca){_0x20d997[_0xedac('0x49')]=_0x2cb3ca;return _0x20d997;})['then'](respondWithFilteredResult(_0x527878,_0x1ddcc1))['catch'](handleError(_0x527878,null));};exports[_0xedac('0x4a')]=function(_0x38425e,_0x4e81bc){var _0x16a45a={'raw':![],'where':{'id':_0x38425e[_0xedac('0x4b')]['id']}},_0x4e0638={};_0x4e0638[_0xedac('0x39')]=_[_0xedac('0x4c')](db[_0xedac('0x35')][_0xedac('0x36')]);_0x4e0638[_0xedac('0x3a')]=_['keys'](_0x38425e[_0xedac('0x3a')]);_0x4e0638[_0xedac('0x3b')]=_['intersection'](_0x4e0638[_0xedac('0x39')],_0x4e0638[_0xedac('0x3a')]);_0x16a45a[_0xedac('0x3c')]=_['intersection'](_0x4e0638['model'],qs[_0xedac('0x3e')](_0x38425e[_0xedac('0x3a')]['fields']));_0x16a45a[_0xedac('0x3c')]=_0x16a45a[_0xedac('0x3c')][_0xedac('0x3f')]?_0x16a45a[_0xedac('0x3c')]:_0x4e0638[_0xedac('0x39')];if(_0x38425e[_0xedac('0x3a')][_0xedac('0x47')]){_0x16a45a[_0xedac('0x48')]=[{'all':!![]}];}_0x16a45a=_['merge']({},_0x16a45a,_0x38425e['options']);return db[_0xedac('0x35')][_0xedac('0x4d')](_0x16a45a)[_0xedac('0x19')](handleEntityNotFound(_0x4e81bc,null))['then'](respondWithResult(_0x4e81bc,null))[_0xedac('0x22')](handleError(_0x4e81bc,null));};exports[_0xedac('0x4e')]=function(_0x5cb635,_0x4f44e){var _0x276c23={'where':{'id':_0x5cb635['params']['id']}},_0x4bc336={};_0x4bc336['model']=_[_0xedac('0x4c')](db['Trunk'][_0xedac('0x36')]);_0x276c23['attributes']=_['intersection'](_0x4bc336[_0xedac('0x39')],qs[_0xedac('0x3e')](_0x5cb635[_0xedac('0x3a')][_0xedac('0x3e')]));_0x276c23[_0xedac('0x3c')]=_0x276c23['attributes'][_0xedac('0x3f')]?_0x276c23['attributes']:_0x4bc336[_0xedac('0x39')];if(_0x5cb635[_0xedac('0x3a')][_0xedac('0x47')]){_0x276c23[_0xedac('0x48')]=[{'all':!![]}];}_0x276c23=_[_0xedac('0x46')]({},_0x276c23,_0x5cb635[_0xedac('0x4f')]);return db[_0xedac('0x35')]['find'](_0x276c23)[_0xedac('0x19')](handleEntityNotFound(_0x4f44e,null))[_0xedac('0x19')](function(_0x1e1847){if(_0x1e1847){var _0xbc0ff5=_0x1e1847[_0xedac('0x2d')]({'plain':!![]});_0xbc0ff5=qs[_0xedac('0x50')](_0xbc0ff5,['id',_0xedac('0x51'),_0xedac('0x52')]);_0x5cb635[_0xedac('0x53')]=_[_0xedac('0x50')](_0x5cb635['body'],['id','createdAt',_0xedac('0x52')]);return db[_0xedac('0x35')][_0xedac('0x54')](_[_0xedac('0x46')](_0xbc0ff5,_0x5cb635[_0xedac('0x53')]),{'include':_0x5cb635['query'][_0xedac('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x8d20e7){var _0x15b168=_0x5cb635['user']['get']({'plain':!![]});if(!_0x15b168)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b168[_0xedac('0x55')]===_0xedac('0x56')){var _0x2523bb=_0x8d20e7[_0xedac('0x2d')]({'plain':!![]});var _0x103632=_0xedac('0x2e');return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0x103632,'userProfileId':_0x15b168[_0xedac('0x58')]},'raw':!![]})[_0xedac('0x19')](function(_0x4fdff8){if(_0x4fdff8&&_0x4fdff8[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')]['create']({'name':_0x2523bb[_0xedac('0x32')],'resourceId':_0x2523bb['id'],'type':_0x4fdff8[_0xedac('0x32')],'sectionId':_0x4fdff8['id']},{})[_0xedac('0x19')](function(){return _0x8d20e7;});}else{return _0x8d20e7;}})[_0xedac('0x22')](function(_0x32d9d8){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x32d9d8);throw _0x32d9d8;});}return _0x8d20e7;});}})[_0xedac('0x19')](respondWithResult(_0x4f44e,0xc9))[_0xedac('0x22')](handleError(_0x4f44e,null));};exports[_0xedac('0x54')]=function(_0xd34f0c,_0x207b40,_0x77fc48){var _0x3a1d68;return db[_0xedac('0x35')][_0xedac('0x54')](_0xd34f0c[_0xedac('0x53')],{'raw':!![]})[_0xedac('0x19')](function(_0x493214){_0x3a1d68=_0x493214;return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x5458c3){var _0x2380ee=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x58ad68=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x300f52=ejs['render'](_0x2380ee,{'trunks':_0x5458c3||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x300f52);if(_0x3a1d68[_0xedac('0x62')]){var _0x218670=ejs[_0xedac('0x63')](_0x58ad68,{'trunks':_0x5458c3||[]});fs['writeFileSync'](_0xedac('0x64'),_0x218670);}})['then'](function(){return respondWithRpcPromise('Reload',_0xedac('0x54'),{'module':_0xedac('0x65')});})[_0xedac('0x19')](function(){var _0x104c27=_0xd34f0c[_0xedac('0x56')]['get']({'plain':!![]});if(!_0x104c27)throw new Error(_0xedac('0x66'));if(_0x104c27['role']===_0xedac('0x56')){var _0x358032=_0x3a1d68[_0xedac('0x2d')]({'plain':!![]});return db[_0xedac('0x57')][_0xedac('0x4d')]({'where':{'name':_0xedac('0x2e'),'userProfileId':_0x104c27['userProfileId']},'raw':!![]})[_0xedac('0x19')](function(_0x1242a2){if(_0x1242a2&&_0x1242a2[_0xedac('0x59')]===0x0){return db[_0xedac('0x2f')][_0xedac('0x54')]({'name':_0x358032[_0xedac('0x32')],'resourceId':_0x358032['id'],'type':_0x1242a2[_0xedac('0x32')],'sectionId':_0x1242a2['id']},{})[_0xedac('0x19')](function(){return _0x3a1d68;});}else{return _0x3a1d68;}})[_0xedac('0x22')](function(_0x134a7a){logger[_0xedac('0x1e')](_0xedac('0x5a'),_0x134a7a);throw _0x134a7a;});}return _0x3a1d68;})['then'](respondWithResult(_0x207b40,0xc9))[_0xedac('0x22')](handleError(_0x207b40,null));};exports['update']=function(_0x5cba66,_0xdf86e8,_0x484b6b){var _0x197dad;return db[_0xedac('0x35')]['find']({'where':{'id':_0x5cba66[_0xedac('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdf86e8,null))[_0xedac('0x19')](saveUpdates(_0x5cba66['body'],null))[_0xedac('0x19')](function(_0x5e512f){if(_0x5e512f){_0x197dad=_0x5e512f;return db[_0xedac('0x35')][_0xedac('0x67')]({'raw':!![]});}})['then'](function(_0x1dfc0b){if(_0x1dfc0b){var _0x4cec80=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config[_0xedac('0x5d')],_0xedac('0x5e')),_0xedac('0x5f'));var _0x4be552=fs[_0xedac('0x5b')](path['join'](config[_0xedac('0x5d')],_0xedac('0x60')),_0xedac('0x5f'));var _0x448066=ejs[_0xedac('0x63')](_0x4cec80,{'trunks':_0x1dfc0b||[]});fs[_0xedac('0x61')]('/etc/asterisk/sip_xcally_trunks.conf',_0x448066);var _0x1d8f28=ejs[_0xedac('0x63')](_0x4be552,{'trunks':_0x1dfc0b||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x1d8f28);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x69'),{'module':_0xedac('0x65')});}return null;})[_0xedac('0x19')](function(_0x5ad133){if(_0x5ad133){return _0x197dad;}})['then'](respondWithResult(_0xdf86e8,null))[_0xedac('0x22')](handleError(_0xdf86e8,null));};exports[_0xedac('0x30')]=function(_0x4dd9bd,_0x3926ed,_0x472e8a){var _0x3b25ef;return db[_0xedac('0x35')][_0xedac('0x4d')]({'where':{'id':_0x4dd9bd[_0xedac('0x4b')]['id']}})[_0xedac('0x19')](handleEntityNotFound(_0x3926ed,null))[_0xedac('0x19')](removeEntity(_0x3926ed,null))[_0xedac('0x19')](function(){return db[_0xedac('0x35')]['findAll']({'raw':!![]});})[_0xedac('0x19')](function(_0x22c47b){var _0x230d51=fs[_0xedac('0x5b')](path[_0xedac('0x5c')](config['root'],_0xedac('0x5e')),_0xedac('0x5f'));var _0x35a3c4=fs[_0xedac('0x5b')](path['join'](config['root'],_0xedac('0x60')),_0xedac('0x5f'));var _0x1f541a=ejs[_0xedac('0x63')](_0x230d51,{'trunks':_0x22c47b});var _0x20f7e6=ejs[_0xedac('0x63')](_0x35a3c4,{'trunks':_0x22c47b});fs[_0xedac('0x61')](_0xedac('0x6a'),_0x1f541a);fs[_0xedac('0x61')](_0xedac('0x64'),_0x20f7e6);return respondWithRpcPromise(_0xedac('0x68'),_0xedac('0x30'),{'module':'chan_sip.so'});})[_0xedac('0x22')](handleError(_0x3926ed,null));}; \ No newline at end of file +var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x813d0a,_0x4fd3d7){var _0x241352=function(_0x3ca375){while(--_0x3ca375){_0x813d0a['push'](_0x813d0a['shift']());}};_0x241352(++_0x4fd3d7);}(_0xe5b3,0x133));var _0x3e5b=function(_0x11b749,_0xd04934){_0x11b749=_0x11b749-0x0;var _0x1bd1f7=_0xe5b3[_0x11b749];return _0x1bd1f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 861f063..7112cc4 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 _0xa44b=['request-promise','rimraf','./trunk.attributes','exports','define','Trunk','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x447f8a,_0x5414ac){var _0x336eec=function(_0x4b08ce){while(--_0x4b08ce){_0x447f8a['push'](_0x447f8a['shift']());}};_0x336eec(++_0x5414ac);}(_0xa44b,0x14a));var _0xba44=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0xa44b[_0x3f94f9];return _0x46f84f;};'use strict';var _=require(_0xba44('0x0'));var util=require(_0xba44('0x1'));var logger=require(_0xba44('0x2'))(_0xba44('0x3'));var moment=require(_0xba44('0x4'));var BPromise=require(_0xba44('0x5'));var rp=require(_0xba44('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba44('0x7'));var config=require('../../config/environment');var attributes=require(_0xba44('0x8'));module[_0xba44('0x9')]=function(_0x1ba5a2,_0x9842e9){return _0x1ba5a2[_0xba44('0xa')](_0xba44('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc56f=['rimraf','../../config/environment','exports','define','Trunk','tools_trunks','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x123273,_0x238013){var _0x4b84af=function(_0x5b6775){while(--_0x5b6775){_0x123273['push'](_0x123273['shift']());}};_0x4b84af(++_0x238013);}(_0xc56f,0x186));var _0xfc56=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xc56f[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require('lodash');var util=require(_0xfc56('0x0'));var logger=require(_0xfc56('0x1'))(_0xfc56('0x2'));var moment=require('moment');var BPromise=require(_0xfc56('0x3'));var rp=require(_0xfc56('0x4'));var fs=require('fs');var path=require(_0xfc56('0x5'));var rimraf=require(_0xfc56('0x6'));var config=require(_0xfc56('0x7'));var attributes=require('./trunk.attributes');module[_0xfc56('0x8')]=function(_0x17153c,_0x279d54){return _0x17153c[_0xfc56('0x9')](_0xfc56('0xa'),attributes,{'tableName':_0xfc56('0xb'),'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 0ba06df..0e39e6b 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 _0x1dcc=['info','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowTrunk','find','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1de3d3,_0x5cb6e3){var _0x2666b2=function(_0x323819){while(--_0x323819){_0x1de3d3['push'](_0x1de3d3['shift']());}};_0x2666b2(++_0x5cb6e3);}(_0x1dcc,0x1a2));var _0xc1dc=function(_0x39350f,_0x3e508f){_0x39350f=_0x39350f-0x0;var _0x35cbc6=_0x1dcc[_0x39350f];return _0x35cbc6;};'use strict';var _=require('lodash');var util=require(_0xc1dc('0x0'));var moment=require(_0xc1dc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dc('0x2'));var db=require(_0xc1dc('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc1dc('0x4'));var config=require(_0xc1dc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc1dc('0x6')][_0xc1dc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x208d80,_0xbef048,_0x559eb5){return new BPromise(function(_0x321427,_0x3692df){return client['request'](_0x208d80,_0x559eb5)['then'](function(_0x4431b7){logger['info'](_0xc1dc('0x8'),_0xbef048,_0xc1dc('0x9'));logger[_0xc1dc('0xa')](_0xc1dc('0xb'),_0xbef048,_0xc1dc('0x9'),JSON[_0xc1dc('0xc')](_0x4431b7));if(_0x4431b7[_0xc1dc('0xd')]){if(_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xe')]===0x1f4){logger[_0xc1dc('0xd')](_0xc1dc('0x8'),_0xbef048,_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xf')]);return _0x3692df(_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xf')]);}logger[_0xc1dc('0xd')](_0xc1dc('0x8'),_0xbef048,_0x4431b7[_0xc1dc('0xd')][_0xc1dc('0xf')]);return _0x321427(_0x4431b7['error'][_0xc1dc('0xf')]);}else{logger[_0xc1dc('0x10')]('Trunk,\x20%s,\x20%s',_0xbef048,_0xc1dc('0x9'));_0x321427(_0x4431b7['result']['message']);}})[_0xc1dc('0x11')](function(_0x3d87b1){logger[_0xc1dc('0xd')](_0xc1dc('0x8'),_0xbef048,_0x3d87b1);_0x3692df(_0x3d87b1);});});}exports[_0xc1dc('0x12')]=function(_0x2f87d9){var _0x9effed=this;return new Promise(function(_0x127974,_0x3a7eb7){return db['Trunk'][_0xc1dc('0x13')]({'raw':_0x2f87d9['options']?_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x15')]===undefined?!![]:![]:!![],'where':_0x2f87d9['options']?_0x2f87d9['options'][_0xc1dc('0x16')]||null:null,'attributes':_0x2f87d9[_0xc1dc('0x14')]?_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x17')]||null:null,'limit':_0x2f87d9[_0xc1dc('0x14')]?_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x18')]||null:null,'include':_0x2f87d9[_0xc1dc('0x14')]?_0x2f87d9['options'][_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0x2f87d9[_0xc1dc('0x14')][_0xc1dc('0x19')],function(_0x44e43c){return{'model':db[_0x44e43c[_0xc1dc('0x1b')]],'as':_0x44e43c['as'],'attributes':_0x44e43c[_0xc1dc('0x17')],'include':_0x44e43c[_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0x44e43c[_0xc1dc('0x19')],function(_0x3ddd96){return{'model':db[_0x3ddd96[_0xc1dc('0x1b')]],'as':_0x3ddd96['as'],'attributes':_0x3ddd96[_0xc1dc('0x17')],'include':_0x3ddd96[_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0x3ddd96['include'],function(_0x2895de){return{'model':db[_0x2895de['model']],'as':_0x2895de['as'],'attributes':_0x2895de[_0xc1dc('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1dc('0x1c')](function(_0x1ce06b){logger[_0xc1dc('0x10')](_0xc1dc('0x12'),_0x2f87d9);logger[_0xc1dc('0xa')](_0xc1dc('0x12'),_0x2f87d9,JSON['stringify'](_0x1ce06b));_0x127974(_0x1ce06b);})[_0xc1dc('0x11')](function(_0x4ecf76){logger[_0xc1dc('0xd')](_0xc1dc('0x12'),_0x4ecf76[_0xc1dc('0xf')],_0x2f87d9);_0x3a7eb7(_0x9effed[_0xc1dc('0xd')](0x1f4,_0x4ecf76['message']));});});};exports[_0xc1dc('0x1d')]=function(_0x5a7f8f){var _0x47afda=this;return new Promise(function(_0x53fd78,_0x4ec49f){return db['Trunk'][_0xc1dc('0x1e')]({'raw':_0x5a7f8f[_0xc1dc('0x14')]?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x15')]===undefined?!![]:![]:!![],'where':_0x5a7f8f['options']?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x16')]||null:null,'attributes':_0x5a7f8f['options']?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x17')]||null:null,'include':_0x5a7f8f[_0xc1dc('0x14')]?_0x5a7f8f[_0xc1dc('0x14')][_0xc1dc('0x19')]?_['map'](_0x5a7f8f[_0xc1dc('0x14')]['include'],function(_0xae1a84){return{'model':db[_0xae1a84['model']],'as':_0xae1a84['as'],'attributes':_0xae1a84[_0xc1dc('0x17')],'include':_0xae1a84[_0xc1dc('0x19')]?_[_0xc1dc('0x1a')](_0xae1a84[_0xc1dc('0x19')],function(_0x20bc01){return{'model':db[_0x20bc01[_0xc1dc('0x1b')]],'as':_0x20bc01['as'],'attributes':_0x20bc01[_0xc1dc('0x17')],'include':_0x20bc01['include']?_[_0xc1dc('0x1a')](_0x20bc01[_0xc1dc('0x19')],function(_0x5dd459){return{'model':db[_0x5dd459[_0xc1dc('0x1b')]],'as':_0x5dd459['as'],'attributes':_0x5dd459[_0xc1dc('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1dc('0x1c')](function(_0x7c1373){logger['info']('ShowTrunk',_0x5a7f8f);logger[_0xc1dc('0xa')](_0xc1dc('0x1d'),_0x5a7f8f,JSON['stringify'](_0x7c1373));_0x53fd78(_0x7c1373);})['catch'](function(_0x39ebd1){logger[_0xc1dc('0xd')](_0xc1dc('0x1d'),_0x39ebd1[_0xc1dc('0xf')],_0x5a7f8f);_0x4ec49f(_0x47afda['error'](0x1f4,_0x39ebd1[_0xc1dc('0xf')]));});});}; \ No newline at end of file +var _0xb6aa=['../../config/utils','../../config/logger','rpc','jayson/promise','http','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include','map','model','then','ShowTrunk','find','where','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b310e,_0x595700){var _0x571eac=function(_0x1e34e3){while(--_0x1e34e3){_0x5b310e['push'](_0x5b310e['shift']());}};_0x571eac(++_0x595700);}(_0xb6aa,0x10b));var _0xab6a=function(_0x19864e,_0x1c83ce){_0x19864e=_0x19864e-0x0;var _0xabd1be=_0xb6aa[_0x19864e];return _0xabd1be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab6a('0x0'));var BPromise=require(_0xab6a('0x1'));var rs=require(_0xab6a('0x2'));var fs=require('fs');var Redis=require(_0xab6a('0x3'));var db=require(_0xab6a('0x4'))['db'];var utils=require(_0xab6a('0x5'));var logger=require(_0xab6a('0x6'))(_0xab6a('0x7'));var config=require('../../config/environment');var jayson=require(_0xab6a('0x8'));var client=jayson['client'][_0xab6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f2ab9,_0x554c88,_0x15df84){return new BPromise(function(_0x2c6d33,_0x57697c){return client['request'](_0x2f2ab9,_0x15df84)['then'](function(_0xf8166c){logger[_0xab6a('0xa')](_0xab6a('0xb'),_0x554c88,'request\x20sent');logger[_0xab6a('0xc')](_0xab6a('0xd'),_0x554c88,_0xab6a('0xe'),JSON[_0xab6a('0xf')](_0xf8166c));if(_0xf8166c[_0xab6a('0x10')]){if(_0xf8166c[_0xab6a('0x10')]['code']===0x1f4){logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0xf8166c['error']['message']);return _0x57697c(_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);}logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);return _0x2c6d33(_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);}else{logger[_0xab6a('0xa')]('Trunk,\x20%s,\x20%s',_0x554c88,_0xab6a('0xe'));_0x2c6d33(_0xf8166c[_0xab6a('0x12')][_0xab6a('0x11')]);}})[_0xab6a('0x13')](function(_0x579096){logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0x579096);_0x57697c(_0x579096);});});}exports[_0xab6a('0x14')]=function(_0x56c7f1){var _0x16590e=this;return new Promise(function(_0xb1ecb9,_0xf1dfd6){return db[_0xab6a('0x15')][_0xab6a('0x16')]({'raw':_0x56c7f1[_0xab6a('0x17')]?_0x56c7f1[_0xab6a('0x17')][_0xab6a('0x18')]===undefined?!![]:![]:!![],'where':_0x56c7f1[_0xab6a('0x17')]?_0x56c7f1[_0xab6a('0x17')]['where']||null:null,'attributes':_0x56c7f1['options']?_0x56c7f1[_0xab6a('0x17')][_0xab6a('0x19')]||null:null,'limit':_0x56c7f1[_0xab6a('0x17')]?_0x56c7f1[_0xab6a('0x17')][_0xab6a('0x1a')]||null:null,'include':_0x56c7f1[_0xab6a('0x17')]?_0x56c7f1[_0xab6a('0x17')][_0xab6a('0x1b')]?_['map'](_0x56c7f1['options']['include'],function(_0x33180f){return{'model':db[_0x33180f['model']],'as':_0x33180f['as'],'attributes':_0x33180f[_0xab6a('0x19')],'include':_0x33180f[_0xab6a('0x1b')]?_[_0xab6a('0x1c')](_0x33180f['include'],function(_0x114a11){return{'model':db[_0x114a11[_0xab6a('0x1d')]],'as':_0x114a11['as'],'attributes':_0x114a11[_0xab6a('0x19')],'include':_0x114a11[_0xab6a('0x1b')]?_[_0xab6a('0x1c')](_0x114a11[_0xab6a('0x1b')],function(_0x37cb09){return{'model':db[_0x37cb09[_0xab6a('0x1d')]],'as':_0x37cb09['as'],'attributes':_0x37cb09[_0xab6a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xab6a('0x1e')](function(_0xc3a4eb){logger['info'](_0xab6a('0x14'),_0x56c7f1);logger[_0xab6a('0xc')]('GetTrunk',_0x56c7f1,JSON[_0xab6a('0xf')](_0xc3a4eb));_0xb1ecb9(_0xc3a4eb);})['catch'](function(_0x229a81){logger['error'](_0xab6a('0x14'),_0x229a81['message'],_0x56c7f1);_0xf1dfd6(_0x16590e[_0xab6a('0x10')](0x1f4,_0x229a81[_0xab6a('0x11')]));});});};exports[_0xab6a('0x1f')]=function(_0x3a0341){var _0xa89e41=this;return new Promise(function(_0x2dcc82,_0x54749b){return db[_0xab6a('0x15')][_0xab6a('0x20')]({'raw':_0x3a0341[_0xab6a('0x17')]?_0x3a0341[_0xab6a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3a0341[_0xab6a('0x17')]?_0x3a0341[_0xab6a('0x17')][_0xab6a('0x21')]||null:null,'attributes':_0x3a0341['options']?_0x3a0341[_0xab6a('0x17')][_0xab6a('0x19')]||null:null,'include':_0x3a0341[_0xab6a('0x17')]?_0x3a0341[_0xab6a('0x17')]['include']?_[_0xab6a('0x1c')](_0x3a0341[_0xab6a('0x17')]['include'],function(_0x4c68a8){return{'model':db[_0x4c68a8[_0xab6a('0x1d')]],'as':_0x4c68a8['as'],'attributes':_0x4c68a8[_0xab6a('0x19')],'include':_0x4c68a8['include']?_[_0xab6a('0x1c')](_0x4c68a8['include'],function(_0x362b3b){return{'model':db[_0x362b3b['model']],'as':_0x362b3b['as'],'attributes':_0x362b3b['attributes'],'include':_0x362b3b[_0xab6a('0x1b')]?_[_0xab6a('0x1c')](_0x362b3b[_0xab6a('0x1b')],function(_0x42d48c){return{'model':db[_0x42d48c[_0xab6a('0x1d')]],'as':_0x42d48c['as'],'attributes':_0x42d48c['attributes']};}):[]};}):[]};}):[]:[]})[_0xab6a('0x1e')](function(_0x58a77a){logger['info']('ShowTrunk',_0x3a0341);logger['debug']('ShowTrunk',_0x3a0341,JSON[_0xab6a('0xf')](_0x58a77a));_0x2dcc82(_0x58a77a);})['catch'](function(_0x527fd8){logger[_0xab6a('0x10')](_0xab6a('0x1f'),_0x527fd8[_0xab6a('0x11')],_0x3a0341);_0x54749b(_0xa89e41[_0xab6a('0x10')](0x1f4,_0x527fd8[_0xab6a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 56e90d8..77b1544 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8dc3=['update','express','Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x36f0de,_0x36987e){var _0x2a6726=function(_0x459620){while(--_0x459620){_0x36f0de['push'](_0x36f0de['shift']());}};_0x2a6726(++_0x36987e);}(_0x8dc3,0x69));var _0x38dc=function(_0x310ed4,_0x220e32){_0x310ed4=_0x310ed4-0x0;var _0x432172=_0x8dc3[_0x310ed4];return _0x432172;};'use strict';var express=require(_0x38dc('0x0'));var router=express[_0x38dc('0x1')]();var auth=require(_0x38dc('0x2'));var controller=require(_0x38dc('0x3'));router[_0x38dc('0x4')](_0x38dc('0x5'),auth[_0x38dc('0x6')](),controller[_0x38dc('0x7')]);module['exports']=router; \ No newline at end of file +var _0x3202=['exports','express','./user-setting.controller','put'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0x3202,0x19d));var _0x2320=function(_0x5e9aa2,_0xd197ca){_0x5e9aa2=_0x5e9aa2-0x0;var _0xc42277=_0x3202[_0x5e9aa2];return _0xc42277;};'use strict';var express=require(_0x2320('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x2320('0x1'));router[_0x2320('0x2')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x2320('0x3')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 786aa02..d07b6f4 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x674f=['error','ENUM','BOOLEAN','DATE','INTEGER','sequelize'];(function(_0x42f318,_0x336c90){var _0x4aa72a=function(_0xfce356){while(--_0xfce356){_0x42f318['push'](_0x42f318['shift']());}};_0x4aa72a(++_0x336c90);}(_0x674f,0x113));var _0xf674=function(_0xc5211a,_0x6e2931){_0xc5211a=_0xc5211a-0x0;var _0x2313ed=_0x674f[_0xc5211a];return _0x2313ed;};'use strict';var Sequelize=require(_0xf674('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf674('0x1'),'warning','info','debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xf674('0x2')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf674('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf674('0x3')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf674('0x4')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf674('0x5')],'unique':'UserId'}}; \ No newline at end of file +var _0xfc54=['TEXT','DATE','INTEGER','sequelize','error','warning','info','debug','exports','ENUM','BOOLEAN'];(function(_0x276e0a,_0xfa4f3f){var _0x1f2970=function(_0x338a0d){while(--_0x338a0d){_0x276e0a['push'](_0x276e0a['shift']());}};_0x1f2970(++_0xfa4f3f);}(_0xfc54,0x92));var _0x4fc5=function(_0x3e451f,_0x10500d){_0x3e451f=_0x3e451f-0x0;var _0x57978f=_0xfc54[_0x3e451f];return _0x57978f;};'use strict';var Sequelize=require(_0x4fc5('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x4fc5('0x1'),_0x4fc5('0x2'),_0x4fc5('0x3'),_0x4fc5('0x4')];module[_0x4fc5('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x4fc5('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4fc5('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4fc5('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x4fc5('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x4fc5('0xa')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 7008350..25292d4 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0834=['api','redis','./user-setting.socket','defaults','localhost','status','json','update','then','sendStatus','name','send','role','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','../../config/logger'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x0834,0x18e));var _0x4083=function(_0x24e428,_0x43bfae){_0x24e428=_0x24e428-0x0;var _0xfe15d2=_0x0834[_0x24e428];return _0xfe15d2;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x4083('0x0'))(_0x4083('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x4083('0x2')]));require(_0x4083('0x3'))['register'](socket);config[_0x4083('0x2')]=_[_0x4083('0x4')](config['redis'],{'host':_0x4083('0x5'),'port':0x18eb});function respondWithResult(_0x5c5a54,_0x31c7ef){_0x31c7ef=_0x31c7ef||0xc8;return function(_0x26ed53){if(_0x26ed53){return _0x5c5a54[_0x4083('0x6')](_0x31c7ef)[_0x4083('0x7')](_0x26ed53);}};}function saveUpdates(_0x129337){return function(_0x26c623){if(_0x26c623){return _0x26c623[_0x4083('0x8')](_0x129337)[_0x4083('0x9')](function(_0x2a5093){return _0x2a5093;});}return null;};}function handleEntityNotFound(_0x2d739c){return function(_0x38a946){if(!_0x38a946){_0x2d739c[_0x4083('0xa')](0x194);}return _0x38a946;};}function handleError(_0x1da687,_0x5d6067){_0x5d6067=_0x5d6067||0x1f4;return function(_0x300a8f){logger['error'](_0x300a8f['stack']);if(_0x300a8f[_0x4083('0xb')]){delete _0x300a8f[_0x4083('0xb')];}_0x1da687['status'](_0x5d6067)[_0x4083('0xc')](_0x300a8f);};}exports[_0x4083('0x8')]=function(_0x236b04,_0x590a81){if(_0x236b04['user'][_0x4083('0xd')]!==_0x4083('0xe'))throw new Error('Unauthorized');if(isNaN(Number(_0x236b04[_0x4083('0xf')]['id'])))throw new Error(_0x4083('0x10'));return db[_0x4083('0x11')][_0x4083('0x12')]({'where':{'id':_0x236b04[_0x4083('0xf')]['id']}})['then'](handleEntityNotFound(_0x590a81,null))[_0x4083('0x9')](saveUpdates(_0x236b04[_0x4083('0x13')],null))[_0x4083('0x9')](respondWithResult(_0x590a81,null))[_0x4083('0x14')](handleError(_0x590a81,null));}; \ No newline at end of file +var _0xd73a=['./user-setting.socket','register','defaults','localhost','status','update','then','error','stack','name','user','role','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','redis'];(function(_0xb3e981,_0x5ab32d){var _0x20b900=function(_0x1958ce){while(--_0x1958ce){_0xb3e981['push'](_0xb3e981['shift']());}};_0x20b900(++_0x5ab32d);}(_0xd73a,0x171));var _0xad73=function(_0x172b7a,_0xead108){_0x172b7a=_0x172b7a-0x0;var _0x42c484=_0xd73a[_0x172b7a];return _0x42c484;};'use strict';var _=require(_0xad73('0x0'));var Redis=require(_0xad73('0x1'));var logger=require(_0xad73('0x2'))(_0xad73('0x3'));var config=require(_0xad73('0x4'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xad73('0x5')]));require(_0xad73('0x6'))[_0xad73('0x7')](socket);config[_0xad73('0x5')]=_[_0xad73('0x8')](config[_0xad73('0x5')],{'host':_0xad73('0x9'),'port':0x18eb});function respondWithResult(_0x2f4736,_0x24d620){_0x24d620=_0x24d620||0xc8;return function(_0x15cf28){if(_0x15cf28){return _0x2f4736[_0xad73('0xa')](_0x24d620)['json'](_0x15cf28);}};}function saveUpdates(_0x39cd6d){return function(_0x55a66c){if(_0x55a66c){return _0x55a66c[_0xad73('0xb')](_0x39cd6d)[_0xad73('0xc')](function(_0x20222b){return _0x20222b;});}return null;};}function handleEntityNotFound(_0x5c3760){return function(_0x957fd4){if(!_0x957fd4){_0x5c3760['sendStatus'](0x194);}return _0x957fd4;};}function handleError(_0x3d5ee5,_0x5eae26){_0x5eae26=_0x5eae26||0x1f4;return function(_0x2b2f33){logger[_0xad73('0xd')](_0x2b2f33[_0xad73('0xe')]);if(_0x2b2f33['name']){delete _0x2b2f33[_0xad73('0xf')];}_0x3d5ee5[_0xad73('0xa')](_0x5eae26)['send'](_0x2b2f33);};}exports[_0xad73('0xb')]=function(_0xadb4c0,_0x2ba4d5){if(_0xadb4c0[_0xad73('0x10')][_0xad73('0x11')]!==_0xad73('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0xadb4c0[_0xad73('0x13')]['id'])))throw new Error(_0xad73('0x14'));return db[_0xad73('0x15')][_0xad73('0x16')]({'where':{'id':_0xadb4c0[_0xad73('0x13')]['id']}})[_0xad73('0xc')](handleEntityNotFound(_0x2ba4d5,null))[_0xad73('0xc')](saveUpdates(_0xadb4c0[_0xad73('0x17')],null))[_0xad73('0xc')](respondWithResult(_0x2ba4d5,null))[_0xad73('0x18')](handleError(_0x2ba4d5,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index d64212a..7e86802 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37ee=['UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x22ed4b,_0x20609c){var _0x4e9cf6=function(_0x3a2de1){while(--_0x3a2de1){_0x22ed4b['push'](_0x22ed4b['shift']());}};_0x4e9cf6(++_0x20609c);}(_0x37ee,0xf8));var _0xe37e=function(_0x4c0884,_0x37159c){_0x4c0884=_0x4c0884-0x0;var _0x3f7990=_0x37ee[_0x4c0884];return _0x3f7990;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0xe37e('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xe37e('0x1')](0x0);var events={'afterCreate':_0xe37e('0x2'),'afterUpdate':_0xe37e('0x3'),'afterDestroy':_0xe37e('0x4')};function emitEvent(_0x4e129d){return function(_0x519b01,_0x4ecdf6,_0x2f514e){UserSettingEvents[_0xe37e('0x5')](_0x4e129d+':'+_0x519b01['id'],_0x519b01);UserSettingEvents[_0xe37e('0x5')](_0x4e129d,_0x519b01);_0x2f514e(null);};}for(var e in events){if(events[_0xe37e('0x6')](e)){var event=events[e];UserSetting[_0xe37e('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x2f4e=['emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting','save','update','remove'];(function(_0x3946e5,_0x390b74){var _0x53fb04=function(_0x44ba7b){while(--_0x44ba7b){_0x3946e5['push'](_0x3946e5['shift']());}};_0x53fb04(++_0x390b74);}(_0x2f4e,0xb7));var _0xe2f4=function(_0x5c09fd,_0x1c2369){_0x5c09fd=_0x5c09fd-0x0;var _0xf05d92=_0x2f4e[_0x5c09fd];return _0xf05d92;};'use strict';var EventEmitter=require(_0xe2f4('0x0'));var UserSetting=require(_0xe2f4('0x1'))['db'][_0xe2f4('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe2f4('0x3'),'afterUpdate':_0xe2f4('0x4'),'afterDestroy':_0xe2f4('0x5')};function emitEvent(_0x3e7eae){return function(_0x8943b8,_0x218673,_0x39a96e){UserSettingEvents['emit'](_0x3e7eae+':'+_0x8943b8['id'],_0x8943b8);UserSettingEvents[_0xe2f4('0x6')](_0x3e7eae,_0x8943b8);_0x39a96e(null);};}for(var e in events){if(events[_0xe2f4('0x7')](e)){var event=events[e];UserSetting[_0xe2f4('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 441dc33..516eaf0 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93e6=['clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings','clientSideLoggingEnabled'];(function(_0xc63d49,_0x48e9f9){var _0x4ff3d9=function(_0x405098){while(--_0x405098){_0xc63d49['push'](_0xc63d49['shift']());}};_0x4ff3d9(++_0x48e9f9);}(_0x93e6,0x11e));var _0x693e=function(_0x268396,_0x864c1c){_0x268396=_0x268396-0x0;var _0x2d7b5d=_0x93e6[_0x268396];return _0x2d7b5d;};'use strict';var attributes=require(_0x693e('0x0'));module['exports']=function(_0x5f4d40){return _0x5f4d40[_0x693e('0x1')]('UserSetting',attributes,{'tableName':_0x693e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e7e48){if(!_0x4e7e48[_0x693e('0x3')])_0x4e7e48[_0x693e('0x4')]=null;else if(_0x4e7e48[_0x693e('0x4')]===null)_0x4e7e48['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x2ca5=['exports','define','user_settings','clientSideLoggingEnabledSince'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x2ca5,0x108));var _0x52ca=function(_0x49693f,_0x4d994f){_0x49693f=_0x49693f-0x0;var _0x1b0f6e=_0x2ca5[_0x49693f];return _0x1b0f6e;};'use strict';var attributes=require('./user-setting.attributes');module[_0x52ca('0x0')]=function(_0x9dfdc){return _0x9dfdc[_0x52ca('0x1')]('UserSetting',attributes,{'tableName':_0x52ca('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51de26){if(!_0x51de26['clientSideLoggingEnabled'])_0x51de26[_0x52ca('0x3')]=null;else if(_0x51de26[_0x52ca('0x3')]===null)_0x51de26[_0x52ca('0x3')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 4d7dc82..5511bcb 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdad1=['save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','./user-setting.events'];(function(_0x2b8e8d,_0x10672e){var _0x433be5=function(_0x1efddc){while(--_0x1efddc){_0x2b8e8d['push'](_0x2b8e8d['shift']());}};_0x433be5(++_0x10672e);}(_0xdad1,0x86));var _0x1dad=function(_0x26b31f,_0x1402a3){_0x26b31f=_0x26b31f-0x0;var _0x1cfd0d=_0xdad1[_0x26b31f];return _0x1cfd0d;};'use strict';var UserSettingEvents=require(_0x1dad('0x0'));var events=[_0x1dad('0x1'),_0x1dad('0x2'),_0x1dad('0x3')];function createListener(_0x2c18ee,_0x543dbc){return function(_0x181a2d){_0x543dbc[_0x1dad('0x4')](_0x2c18ee,_0x181a2d);if(_0x2c18ee===_0x1dad('0x5')){_0x543dbc[_0x1dad('0x4')](_0x1dad('0x6')+_0x181a2d[_0x1dad('0x7')],_0x181a2d);}};}exports[_0x1dad('0x8')]=function(_0x5edd5c){for(var _0x543248=0x0,_0x2260b0=events['length'];_0x543248<_0x2260b0;_0x543248++){var _0x886873=events[_0x543248];var _0x357685=createListener('user-setting:'+_0x886873,_0x5edd5c);UserSettingEvents['on'](_0x886873,_0x357685);}}; \ No newline at end of file +var _0xbac2=['length','user-setting:','./user-setting.events','save','update','emit','user-setting:update:user-','UserId','register'];(function(_0x351eb8,_0x1fe60e){var _0xca7eec=function(_0xcf7c0f){while(--_0xcf7c0f){_0x351eb8['push'](_0x351eb8['shift']());}};_0xca7eec(++_0x1fe60e);}(_0xbac2,0x107));var _0x2bac=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0xbac2[_0x37e886];return _0x57c5cd;};'use strict';var UserSettingEvents=require(_0x2bac('0x0'));var events=[_0x2bac('0x1'),'remove',_0x2bac('0x2')];function createListener(_0x409c7b,_0x438e82){return function(_0x3bfb63){_0x438e82[_0x2bac('0x3')](_0x409c7b,_0x3bfb63);if(_0x409c7b==='user-setting:update'){_0x438e82[_0x2bac('0x3')](_0x2bac('0x4')+_0x3bfb63[_0x2bac('0x5')],_0x3bfb63);}};}exports[_0x2bac('0x6')]=function(_0x389c8e){for(var _0x4dde50=0x0,_0x190b40=events[_0x2bac('0x7')];_0x4dde50<_0x190b40;_0x4dde50++){var _0x242aa8=events[_0x4dde50];var _0x198335=createListener(_0x2bac('0x8')+_0x242aa8,_0x389c8e);UserSettingEvents['on'](_0x242aa8,_0x198335);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 268618c..5cea7f0 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 _0x6af0=['whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','post','addContacts','create','/create_many','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','update','/:id/password','changePassword','delete','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2493c3,_0x419613){var _0x5bd06a=function(_0x4f0f53){while(--_0x4f0f53){_0x2493c3['push'](_0x2493c3['shift']());}};_0x5bd06a(++_0x419613);}(_0x6af0,0x1b6));var _0x06af=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x6af0[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require(_0x06af('0x0'));var util=require(_0x06af('0x1'));var path=require(_0x06af('0x2'));var timeout=require(_0x06af('0x3'));var express=require(_0x06af('0x4'));var router=express['Router']();var fs_extra=require(_0x06af('0x5'));var auth=require(_0x06af('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x06af('0x7'));var controller=require(_0x06af('0x8'));router['get']('/',auth[_0x06af('0x9')](),controller[_0x06af('0xa')]);router[_0x06af('0xb')](_0x06af('0xc'),auth[_0x06af('0x9')](),controller[_0x06af('0xd')]);router[_0x06af('0xb')]('/whoami',auth['isAuthenticated'](),controller[_0x06af('0xe')]);router[_0x06af('0xb')](_0x06af('0xf'),auth[_0x06af('0x9')](),controller[_0x06af('0x10')]);router['get'](_0x06af('0x11'),auth[_0x06af('0x9')](),controller[_0x06af('0x12')]);router[_0x06af('0xb')](_0x06af('0x13'),controller[_0x06af('0x14')]);router[_0x06af('0xb')]('/:id/open_tabs',auth[_0x06af('0x9')](),controller['getOpenTabs']);router[_0x06af('0xb')](_0x06af('0x15'),auth[_0x06af('0x9')](),controller['getContacts']);router['get'](_0x06af('0x16'),auth[_0x06af('0x9')](),controller[_0x06af('0x17')]);router[_0x06af('0xb')](_0x06af('0x18'),auth[_0x06af('0x9')](),controller[_0x06af('0x19')]);router[_0x06af('0xb')](_0x06af('0x1a'),auth[_0x06af('0x9')](),controller[_0x06af('0x1b')]);router[_0x06af('0xb')](_0x06af('0x1c'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x06af('0xb')](_0x06af('0x1d'),auth['isAuthenticated'](),controller[_0x06af('0x1e')]);router['get'](_0x06af('0x1f'),auth[_0x06af('0x9')](),controller[_0x06af('0x20')]);router[_0x06af('0xb')](_0x06af('0x21'),auth[_0x06af('0x9')](),controller['getOpenchannelInteractions']);router[_0x06af('0xb')](_0x06af('0x22'),auth[_0x06af('0x9')](),controller[_0x06af('0x23')]);router['get']('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router['get'](_0x06af('0x24'),auth[_0x06af('0x9')](),controller[_0x06af('0x25')]);router[_0x06af('0xb')](_0x06af('0x26'),auth['isAuthenticated'](),controller[_0x06af('0x27')]);router[_0x06af('0xb')](_0x06af('0x28'),auth['isAuthenticated'](),controller[_0x06af('0x29')]);router[_0x06af('0xb')]('/:id/lists',auth[_0x06af('0x9')](),controller[_0x06af('0x2a')]);router[_0x06af('0xb')](_0x06af('0x2b'),auth['isAuthenticated'](),controller[_0x06af('0x2c')]);router[_0x06af('0xb')](_0x06af('0x2d'),auth['isAuthenticated'](),controller[_0x06af('0x2e')]);router['get'](_0x06af('0x2f'),auth[_0x06af('0x9')](),controller[_0x06af('0x30')]);router[_0x06af('0xb')](_0x06af('0x31'),auth[_0x06af('0x9')](),controller[_0x06af('0x32')]);router['get'](_0x06af('0x33'),auth['isAuthenticated'](),controller[_0x06af('0x34')]);router[_0x06af('0xb')](_0x06af('0x35'),auth['isAuthenticated'](),controller['getSmsAccounts']);router['get'](_0x06af('0x36'),auth['isAuthenticated'](),controller[_0x06af('0x37')]);router['get']('/:id/whatsapp_accounts',auth[_0x06af('0x9')](),controller[_0x06af('0x38')]);router['get'](_0x06af('0x39'),auth['isAuthenticated'](),controller[_0x06af('0x3a')]);router[_0x06af('0xb')](_0x06af('0x3b'),auth[_0x06af('0x9')](),controller['getScheduledCalls']);router[_0x06af('0xb')](_0x06af('0x3c'),auth[_0x06af('0x9')](),controller['getApiKey']);router[_0x06af('0x3d')](_0x06af('0x15'),auth['isAuthenticated'](),controller[_0x06af('0x3e')]);router['post']('/',auth[_0x06af('0x9')](),controller[_0x06af('0x3f')]);router[_0x06af('0x3d')](_0x06af('0x40'),auth['isAuthenticated'](),controller['bulkCreate']);router['post'](_0x06af('0x16'),auth[_0x06af('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x06af('0x41')]({'destination':function(_0x5ae199,_0x139dd3,_0x1cdf3d){_0x1cdf3d(null,path[_0x06af('0x42')](config[_0x06af('0x43')],_0x06af('0x44')));},'filename':function(_0x58e879,_0x51d2cd,_0x39af21){_0x39af21(null,util[_0x06af('0x45')](_0x06af('0x46'),Date[_0x06af('0x47')](),_0x51d2cd[_0x06af('0x48')]));}})});router['post'](_0x06af('0x13'),upload[_0x06af('0x49')](_0x06af('0x4a')),controller[_0x06af('0x4b')]);router[_0x06af('0x3d')](_0x06af('0x4c'),auth[_0x06af('0x9')](),controller['login']);router[_0x06af('0x3d')](_0x06af('0x4d'),auth['isAuthenticated'](),controller[_0x06af('0x4e')]);router[_0x06af('0x3d')](_0x06af('0x4f'),auth[_0x06af('0x9')](),controller[_0x06af('0x50')]);router[_0x06af('0x3d')](_0x06af('0x51'),auth['isAuthenticated'](),controller[_0x06af('0x52')]);router[_0x06af('0x3d')](_0x06af('0x28'),auth[_0x06af('0x9')](),controller['addTeams']);router['post'](_0x06af('0x53'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x06af('0x3d')](_0x06af('0x54'),auth[_0x06af('0x9')](),controller[_0x06af('0x55')]);router[_0x06af('0x3d')](_0x06af('0x56'),auth[_0x06af('0x9')](),controller[_0x06af('0x57')]);router[_0x06af('0x3d')]('/:id/sms_interactions',auth[_0x06af('0x9')](),controller[_0x06af('0x58')]);router['post'](_0x06af('0x59'),auth[_0x06af('0x9')](),controller[_0x06af('0x5a')]);router[_0x06af('0x3d')](_0x06af('0x5b'),auth['isAuthenticated'](),controller[_0x06af('0x5c')]);router['post'](_0x06af('0x2f'),auth[_0x06af('0x9')](),controller[_0x06af('0x5d')]);router[_0x06af('0x3d')]('/:id/mail_accounts',auth[_0x06af('0x9')](),controller['addMailAccounts']);router[_0x06af('0x3d')](_0x06af('0x33'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router[_0x06af('0x3d')](_0x06af('0x35'),auth[_0x06af('0x9')](),controller['addSmsAccounts']);router['post'](_0x06af('0x36'),auth[_0x06af('0x9')](),controller['addChatWebsites']);router[_0x06af('0x3d')](_0x06af('0x5e'),auth[_0x06af('0x9')](),controller[_0x06af('0x5f')]);router[_0x06af('0x3d')](_0x06af('0x39'),auth['isAuthenticated'](),controller['addSquareProjects']);router['post'](_0x06af('0x3c'),auth[_0x06af('0x9')](),controller[_0x06af('0x60')]);router['put']('/:id',auth[_0x06af('0x9')](),controller[_0x06af('0x61')]);router['put'](_0x06af('0x62'),auth['isAuthenticated'](),controller[_0x06af('0x63')]);router[_0x06af('0x64')](_0x06af('0x16'),auth[_0x06af('0x9')](),controller['removeQueues']);router['delete'](_0x06af('0x28'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x06af('0x11'),auth[_0x06af('0x9')](),controller['destroy']);router[_0x06af('0x64')](_0x06af('0x53'),auth[_0x06af('0x9')](),controller[_0x06af('0x65')]);router[_0x06af('0x64')](_0x06af('0x54'),auth[_0x06af('0x9')](),controller[_0x06af('0x66')]);router[_0x06af('0x64')](_0x06af('0x56'),auth['isAuthenticated'](),controller[_0x06af('0x67')]);router[_0x06af('0x64')](_0x06af('0x68'),auth[_0x06af('0x9')](),controller['removeSmsInteractions']);router[_0x06af('0x64')](_0x06af('0x59'),auth[_0x06af('0x9')](),controller[_0x06af('0x69')]);router[_0x06af('0x64')](_0x06af('0x5b'),auth[_0x06af('0x9')](),controller[_0x06af('0x6a')]);router['delete'](_0x06af('0x2f'),auth[_0x06af('0x9')](),controller[_0x06af('0x6b')]);router[_0x06af('0x64')](_0x06af('0x31'),auth['isAuthenticated'](),controller[_0x06af('0x6c')]);router['delete'](_0x06af('0x33'),auth[_0x06af('0x9')](),controller[_0x06af('0x6d')]);router['delete']('/:id/sms_accounts',auth[_0x06af('0x9')](),controller[_0x06af('0x6e')]);router[_0x06af('0x64')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x06af('0x6f')]);router[_0x06af('0x64')](_0x06af('0x5e'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x06af('0x64')]('/:id/square_projects',auth[_0x06af('0x9')](),controller['removeSquareProjects']);router[_0x06af('0x64')]('/:id/api_key',auth[_0x06af('0x9')](),controller[_0x06af('0x70')]);module['exports']=router; \ No newline at end of file +var _0xf623=['/:id/queues','join','root','server/files/images/','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/teams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','update','changePassword','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/whoami','whoami','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','/create_many','bulkCreate'];(function(_0x43cc1c,_0x2b38b8){var _0x5a0ae8=function(_0x58fb4a){while(--_0x58fb4a){_0x43cc1c['push'](_0x43cc1c['shift']());}};_0x5a0ae8(++_0x2b38b8);}(_0xf623,0x11d));var _0x3f62=function(_0x40c8cc,_0x2eae97){_0x40c8cc=_0x40c8cc-0x0;var _0x5bb9e8=_0xf623[_0x40c8cc];return _0x5bb9e8;};'use strict';var multer=require(_0x3f62('0x0'));var util=require('util');var path=require(_0x3f62('0x1'));var timeout=require(_0x3f62('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3f62('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3f62('0x4'));var config=require(_0x3f62('0x5'));var controller=require('./user.controller');router['get']('/',auth[_0x3f62('0x6')](),controller[_0x3f62('0x7')]);router[_0x3f62('0x8')](_0x3f62('0x9'),auth[_0x3f62('0x6')](),controller[_0x3f62('0xa')]);router[_0x3f62('0x8')](_0x3f62('0xb'),auth[_0x3f62('0x6')](),controller[_0x3f62('0xc')]);router[_0x3f62('0x8')]('/presence',auth[_0x3f62('0x6')](),controller[_0x3f62('0xd')]);router[_0x3f62('0x8')](_0x3f62('0xe'),auth[_0x3f62('0x6')](),controller[_0x3f62('0xf')]);router[_0x3f62('0x8')]('/:id/avatar',controller[_0x3f62('0x10')]);router[_0x3f62('0x8')](_0x3f62('0x11'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x12')]);router[_0x3f62('0x8')]('/:id/contacts',auth[_0x3f62('0x6')](),controller[_0x3f62('0x13')]);router['get']('/:id/queues',auth[_0x3f62('0x6')](),controller['getQueues']);router[_0x3f62('0x8')](_0x3f62('0x14'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x15')]);router[_0x3f62('0x8')](_0x3f62('0x16'),auth[_0x3f62('0x6')](),controller['getGroups']);router['get'](_0x3f62('0x17'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x18')]);router[_0x3f62('0x8')](_0x3f62('0x19'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x1a')]);router[_0x3f62('0x8')](_0x3f62('0x1b'),auth[_0x3f62('0x6')](),controller['getChatInteractions']);router[_0x3f62('0x8')]('/:id/openchannel/interactions',auth[_0x3f62('0x6')](),controller[_0x3f62('0x1c')]);router['get'](_0x3f62('0x1d'),auth[_0x3f62('0x6')](),controller['getMailInteractions']);router['get'](_0x3f62('0x1e'),auth[_0x3f62('0x6')](),controller['getSmsInteractions']);router[_0x3f62('0x8')](_0x3f62('0x1f'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x20')]);router[_0x3f62('0x8')](_0x3f62('0x21'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0x3f62('0x8')]('/:id/teams',auth[_0x3f62('0x6')](),controller[_0x3f62('0x22')]);router[_0x3f62('0x8')](_0x3f62('0x23'),auth[_0x3f62('0x6')](),controller['getLists']);router[_0x3f62('0x8')]('/:id/agents',auth['isAuthenticated'](),controller[_0x3f62('0x24')]);router[_0x3f62('0x8')](_0x3f62('0x25'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x26')]);router[_0x3f62('0x8')]('/:id/fax_accounts',auth[_0x3f62('0x6')](),controller[_0x3f62('0x27')]);router[_0x3f62('0x8')](_0x3f62('0x28'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x29')]);router[_0x3f62('0x8')](_0x3f62('0x2a'),auth['isAuthenticated'](),controller[_0x3f62('0x2b')]);router[_0x3f62('0x8')]('/:id/sms_accounts',auth[_0x3f62('0x6')](),controller['getSmsAccounts']);router[_0x3f62('0x8')](_0x3f62('0x2c'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x2d')]);router['get']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x3f62('0x2e')]);router['get']('/:id/square_projects',auth[_0x3f62('0x6')](),controller[_0x3f62('0x2f')]);router[_0x3f62('0x8')](_0x3f62('0x30'),auth['isAuthenticated'](),controller[_0x3f62('0x31')]);router[_0x3f62('0x8')](_0x3f62('0x32'),auth[_0x3f62('0x6')](),controller['getApiKey']);router[_0x3f62('0x33')](_0x3f62('0x34'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x35')]);router[_0x3f62('0x33')]('/',auth[_0x3f62('0x6')](),controller[_0x3f62('0x36')]);router[_0x3f62('0x33')](_0x3f62('0x37'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x38')]);router[_0x3f62('0x33')](_0x3f62('0x39'),auth[_0x3f62('0x6')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x242f65,_0x1a4034,_0x9532c3){_0x9532c3(null,path[_0x3f62('0x3a')](config[_0x3f62('0x3b')],_0x3f62('0x3c')));},'filename':function(_0xd07468,_0x6fc754,_0x389c84){_0x389c84(null,util['format'](_0x3f62('0x3d'),Date[_0x3f62('0x3e')](),_0x6fc754[_0x3f62('0x3f')]));}})});router[_0x3f62('0x33')](_0x3f62('0x40'),upload[_0x3f62('0x41')](_0x3f62('0x42')),controller[_0x3f62('0x43')]);router[_0x3f62('0x33')](_0x3f62('0x44'),auth['isAuthenticated'](),controller[_0x3f62('0x45')]);router[_0x3f62('0x33')](_0x3f62('0x46'),auth[_0x3f62('0x6')](),controller['logout']);router[_0x3f62('0x33')](_0x3f62('0x47'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x48')]);router['post']('/:id/unpause',auth[_0x3f62('0x6')](),controller['unpause']);router[_0x3f62('0x33')](_0x3f62('0x49'),auth['isAuthenticated'](),controller['addTeams']);router[_0x3f62('0x33')](_0x3f62('0x4a'),auth['isAuthenticated'](),controller[_0x3f62('0x4b')]);router[_0x3f62('0x33')]('/:id/mail_interactions',auth[_0x3f62('0x6')](),controller[_0x3f62('0x4c')]);router[_0x3f62('0x33')](_0x3f62('0x4d'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x4e')]);router[_0x3f62('0x33')](_0x3f62('0x4f'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x50')]);router['post'](_0x3f62('0x51'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x52')]);router[_0x3f62('0x33')](_0x3f62('0x53'),auth[_0x3f62('0x6')](),controller['addWhatsappInteractions']);router[_0x3f62('0x33')]('/:id/fax_accounts',auth[_0x3f62('0x6')](),controller[_0x3f62('0x54')]);router[_0x3f62('0x33')](_0x3f62('0x28'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x55')]);router[_0x3f62('0x33')](_0x3f62('0x2a'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x56')]);router[_0x3f62('0x33')](_0x3f62('0x57'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x58')]);router[_0x3f62('0x33')](_0x3f62('0x2c'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x59')]);router[_0x3f62('0x33')](_0x3f62('0x5a'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x5b')]);router[_0x3f62('0x33')](_0x3f62('0x5c'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x5d')]);router[_0x3f62('0x33')](_0x3f62('0x32'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x5e')]);router[_0x3f62('0x5f')](_0x3f62('0xe'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x60')]);router[_0x3f62('0x5f')]('/:id/password',auth[_0x3f62('0x6')](),controller[_0x3f62('0x61')]);router['delete'](_0x3f62('0x39'),auth[_0x3f62('0x6')](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0x3f62('0x6')](),controller['removeTeams']);router[_0x3f62('0x62')](_0x3f62('0xe'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x63')]);router['delete'](_0x3f62('0x4a'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x64')]);router['delete'](_0x3f62('0x65'),auth[_0x3f62('0x6')](),controller['removeMailInteractions']);router[_0x3f62('0x62')](_0x3f62('0x4d'),auth[_0x3f62('0x6')](),controller['removeFaxInteractions']);router[_0x3f62('0x62')](_0x3f62('0x4f'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x66')]);router['delete'](_0x3f62('0x51'),auth['isAuthenticated'](),controller[_0x3f62('0x67')]);router[_0x3f62('0x62')]('/:id/whatsapp_interactions',auth[_0x3f62('0x6')](),controller[_0x3f62('0x68')]);router[_0x3f62('0x62')]('/:id/fax_accounts',auth[_0x3f62('0x6')](),controller[_0x3f62('0x69')]);router[_0x3f62('0x62')](_0x3f62('0x28'),auth['isAuthenticated'](),controller[_0x3f62('0x6a')]);router[_0x3f62('0x62')](_0x3f62('0x2a'),auth['isAuthenticated'](),controller[_0x3f62('0x6b')]);router[_0x3f62('0x62')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x3f62('0x6c')]);router[_0x3f62('0x62')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x3f62('0x6d')]);router[_0x3f62('0x62')](_0x3f62('0x5a'),auth[_0x3f62('0x6')](),controller[_0x3f62('0x6e')]);router[_0x3f62('0x62')]('/:id/square_projects',auth[_0x3f62('0x6')](),controller[_0x3f62('0x6f')]);router[_0x3f62('0x62')](_0x3f62('0x32'),auth['isAuthenticated'](),controller[_0x3f62('0x70')]);module[_0x3f62('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index e21d64d..053f37d 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 _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','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','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x15040b,_0x34f641){var _0x2e1af0=function(_0x53ce44){while(--_0x53ce44){_0x15040b['push'](_0x15040b['shift']());}};_0x2e1af0(++_0x34f641);}(_0x34e8,0x12c));var _0x834e=function(_0x539b24,_0x2be1fc){_0x539b24=_0x539b24-0x0;var _0x1a2741=_0x34e8[_0x539b24];return _0x1a2741;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9afeea6..0a6bf9e 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 _0x8e6a=['Agents','agent','Telephones','telephone','filter','map','value','includes','name','UserProfileResource','destroy','end','sendStatus','stack','index','rawAttributes','fieldName','type','key','password','salt','getOptions','where','User','query','includeAll','userSetting','true','include','attributes','push','findAll','rows','length','chat','dataValues','sms','fax','mail','openchannel','differenceBy','keys','filters','intersection','model','fields','UserSetting','merge','options','find','all','body','params','describe','addContacts','omit','ids','internal','Setting','findById','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','107','108','100','114','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','create','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','spread','QueueId','Queue:save','voice','VoiceQueue','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','capitalize','isArray','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','whatsapp','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WHATSAPP','concat','getContacts','CmContact','sort','pick','CmList','List','Tag','color','tag','nolimit','getQueues','Queue','order','Unknown\x20role','hasOwnProperty','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','resolve','transaction','getAssociatedQueues','flattenDeep','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','getLists','getAgents','getVoiceQueues','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','getChatWebsites','addChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$lt','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','phone','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','send','getUserSetting','getPresence','queues','teams','inbound','flatten','lower','asc','desc','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/license/util','APIBadRequestError','APINotFoundError','../../errors/api','handleError','../../mysqldb','socket.io-emitter','redis','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','emit','userNotification:recalc:','get','role','admin','Users','user'];(function(_0x186ded,_0x2c398d){var _0x187225=function(_0x44744f){while(--_0x44744f){_0x186ded['push'](_0x186ded['shift']());}};_0x187225(++_0x2c398d);}(_0x8e6a,0x167));var _0xa8e6=function(_0xeefceb,_0x357c61){_0xeefceb=_0xeefceb-0x0;var _0x4880c9=_0x8e6a[_0xeefceb];return _0x4880c9;};'use strict';var moment=require(_0xa8e6('0x0'));var util=require('util');var path=require(_0xa8e6('0x1'));var fs=require('fs');var _=require(_0xa8e6('0x2'));var squel=require(_0xa8e6('0x3'));var jayson=require(_0xa8e6('0x4'));var Redis=require(_0xa8e6('0x5'));var authService=require(_0xa8e6('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xa8e6('0x7'))('api');var utils=require(_0xa8e6('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0xa8e6('0x9'));var APIBadRequestError=require('../../errors/api')[_0xa8e6('0xa')];var APINotFoundError=require('../../errors/api')[_0xa8e6('0xb')];var APIHandleError=require(_0xa8e6('0xc'))[_0xa8e6('0xd')];var db=require(_0xa8e6('0xe'))['db'];var socket=require(_0xa8e6('0xf'))(new Redis(config[_0xa8e6('0x10')]));require('./user.socket')['register'](socket);config['redis']=_[_0xa8e6('0x11')](config[_0xa8e6('0x10')],{'host':_0xa8e6('0x12'),'port':0x18eb});var amiClient=jayson[_0xa8e6('0x13')][_0xa8e6('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2975a5,_0x2ded8e,_0x37c2d9,_0x25f4c2){return new Promise(function(_0x3adecb,_0x397129){var _0x141aed=_0x25f4c2||amiClient;return _0x141aed[_0xa8e6('0x15')](_0x2975a5,_0x37c2d9)[_0xa8e6('0x16')](function(_0xea9f10){logger[_0xa8e6('0x17')](_0xa8e6('0x18'),_0x2ded8e,_0xa8e6('0x19'));logger['debug'](_0xa8e6('0x1a'),_0x2ded8e,_0xa8e6('0x19'),JSON['stringify'](_0xea9f10));if(_0xea9f10[_0xa8e6('0x1b')]){if(_0xea9f10[_0xa8e6('0x1b')]['code']===0x1f4){logger['error'](_0xa8e6('0x18'),_0x2ded8e,_0xea9f10['error'][_0xa8e6('0x1c')]);return _0x397129(_0xea9f10[_0xa8e6('0x1b')]['message']);}logger[_0xa8e6('0x1b')](_0xa8e6('0x18'),_0x2ded8e,_0xea9f10[_0xa8e6('0x1b')]['message']);return _0x3adecb(_0xea9f10[_0xa8e6('0x1b')][_0xa8e6('0x1c')]);}else{logger[_0xa8e6('0x17')](_0xa8e6('0x18'),_0x2ded8e,_0xa8e6('0x19'));_0x3adecb(_0xea9f10[_0xa8e6('0x1d')][_0xa8e6('0x1c')]);}})[_0xa8e6('0x1e')](function(_0x167f25){logger[_0xa8e6('0x1b')]('User,\x20%s,\x20%s',_0x2ded8e,_0x167f25);_0x397129(_0x167f25);});});}function respondWithStatusCode(_0x4c74e6,_0x2d1b91){_0x2d1b91=_0x2d1b91||0xcc;return function(_0x53a23f){if(_0x53a23f){return _0x4c74e6['sendStatus'](_0x2d1b91);}return _0x4c74e6[_0xa8e6('0x1f')](_0x2d1b91)['end']();};}function respondWithResult(_0x3a11ce,_0x51503b){_0x51503b=_0x51503b||0xc8;return function(_0x3155b6){if(_0x3155b6){return _0x3a11ce[_0xa8e6('0x1f')](_0x51503b)[_0xa8e6('0x20')](_0x3155b6);}};}function respondWithFilteredResult(_0x26ca38,_0x48a35c){return function(_0x4a8393){if(_0x4a8393){var _0xf98c1d=typeof _0x48a35c[_0xa8e6('0x21')]===_0xa8e6('0x22')&&typeof _0x48a35c[_0xa8e6('0x23')]==='undefined';var _0x5017c8=_0x4a8393[_0xa8e6('0x24')];var _0x45425b=_0xf98c1d?0x0:_0x48a35c[_0xa8e6('0x21')];var _0x256a6e=_0xf98c1d?_0x4a8393[_0xa8e6('0x24')]:_0x48a35c[_0xa8e6('0x21')]+_0x48a35c[_0xa8e6('0x23')];var _0x17d294;if(_0x256a6e>=_0x5017c8){_0x256a6e=_0x5017c8;_0x17d294=0xc8;}else{_0x17d294=0xce;}_0x26ca38[_0xa8e6('0x1f')](_0x17d294);return _0x26ca38[_0xa8e6('0x25')](_0xa8e6('0x26'),_0x45425b+'-'+_0x256a6e+'/'+_0x5017c8)[_0xa8e6('0x20')](_0x4a8393);}return null;};}function saveUpdates(_0x4739db){return function(_0x3da9ba){if(_0x3da9ba){return _0x3da9ba[_0xa8e6('0x27')](_0x4739db)[_0xa8e6('0x16')](function(_0x395ecd){socket[_0xa8e6('0x28')](_0xa8e6('0x29')+_0x395ecd['id'],{});return _0x395ecd;});}return null;};}function removeEntity(_0x4e2b0b){return function(_0x43d9f7){if(_0x43d9f7){return _0x43d9f7['destroy']()[_0xa8e6('0x16')](function(){var _0x43642f=_0x43d9f7[_0xa8e6('0x2a')]({'plain':!![]});if(_0x43642f[_0xa8e6('0x2b')]===_0xa8e6('0x2c'))return;var _0x5e022d=[{'name':_0xa8e6('0x2d'),'value':_0xa8e6('0x2e'),'ignore':!![]},{'name':_0xa8e6('0x2f'),'value':_0xa8e6('0x30'),'ignore':![]},{'name':_0xa8e6('0x31'),'value':_0xa8e6('0x32'),'ignore':![]}];var _0x202d32=_(_0x5e022d)[_0xa8e6('0x33')]('ignore')[_0xa8e6('0x34')](_0xa8e6('0x35'))[_0xa8e6('0x35')]();if(_[_0xa8e6('0x36')](_0x202d32,_0x43642f[_0xa8e6('0x2b')])){return;}var _0x47d931=_['find'](_0x5e022d,[_0xa8e6('0x35'),_0x43642f[_0xa8e6('0x2b')]])[_0xa8e6('0x37')];return db[_0xa8e6('0x38')][_0xa8e6('0x39')]({'where':{'type':_0x47d931,'resourceId':_0x43642f['id']}})['then'](function(){return _0x43d9f7;});})[_0xa8e6('0x16')](function(){_0x4e2b0b[_0xa8e6('0x1f')](0xcc)[_0xa8e6('0x3a')]();});}};}function handleEntityNotFound(_0x13e5b3){return function(_0x248b59){if(!_0x248b59){_0x13e5b3[_0xa8e6('0x3b')](0x194);}return _0x248b59;};}function handleError(_0x7e48f5,_0x147ddc){_0x147ddc=_0x147ddc||0x1f4;return function(_0x1047a9){logger['error'](_0x1047a9[_0xa8e6('0x3c')]);if(_0x1047a9[_0xa8e6('0x37')]){delete _0x1047a9[_0xa8e6('0x37')];}_0x7e48f5['status'](_0x147ddc)['send'](_0x1047a9);};}exports[_0xa8e6('0x3d')]=function(_0x116b4c,_0x27af57){var _0x4af675={},_0x207e84={'count':0x0,'rows':[]};var _0x3e1cb4=_(db['User'][_0xa8e6('0x3e')])[_0xa8e6('0x34')](function(_0x1ee73c){return{'name':_0x1ee73c[_0xa8e6('0x3f')],'type':_0x1ee73c[_0xa8e6('0x40')][_0xa8e6('0x41')]};})['filter'](function(_0x129318){return!_[_0xa8e6('0x36')]([_0xa8e6('0x42'),_0xa8e6('0x43')],_0x129318[_0xa8e6('0x37')]);})['value']();_0x4af675=qs[_0xa8e6('0x44')](_0x3e1cb4,_0x116b4c);var _0x50a93f={'where':_0x4af675[_0xa8e6('0x45')]};return db[_0xa8e6('0x46')][_0xa8e6('0x24')](_0x50a93f)[_0xa8e6('0x16')](function(_0x3e100e){_0x207e84['count']=_0x3e100e;if(_0x116b4c[_0xa8e6('0x47')][_0xa8e6('0x48')]){_0x4af675['include']=[{'all':!![]}];}if(_0x116b4c[_0xa8e6('0x47')][_0xa8e6('0x49')]===_0xa8e6('0x4a')){_0x4af675[_0xa8e6('0x4b')]=[{'model':db['UserSetting'],'as':_0xa8e6('0x49')}];}if(!_['includes'](_0x4af675[_0xa8e6('0x4c')],'id')){_0x4af675['attributes'][_0xa8e6('0x4d')]('id');}return db[_0xa8e6('0x46')][_0xa8e6('0x4e')](_0x4af675);})['then'](function(_0x3a6150){_0x207e84['rows']=_0x3a6150;if(_0x116b4c[_0xa8e6('0x47')]['openTabs']===_0xa8e6('0x4a')){var _0x59ba6e=[];for(var _0x1b9dd8=0x0;_0x1b9dd8<_0x207e84[_0xa8e6('0x4f')][_0xa8e6('0x50')];_0x1b9dd8++){_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x51'),_0x207e84[_0xa8e6('0x4f')][_0x1b9dd8][_0xa8e6('0x52')]));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x53'),_0x207e84['rows'][_0x1b9dd8][_0xa8e6('0x52')]));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x54'),_0x207e84[_0xa8e6('0x4f')][_0x1b9dd8]['dataValues']));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x55'),_0x207e84['rows'][_0x1b9dd8][_0xa8e6('0x52')]));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x56'),_0x207e84['rows'][_0x1b9dd8]['dataValues']));_0x59ba6e[_0xa8e6('0x4d')](get_open_tabs('whatsapp',_0x207e84[_0xa8e6('0x4f')][_0x1b9dd8][_0xa8e6('0x52')]));}return Promise['all'](_0x59ba6e)['then'](function(){return _0x207e84;});}else{return _0x207e84;}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x27af57,_0x4af675))['catch'](handleError(_0x27af57,null));};exports['show']=function(_0x11a83f,_0x8f812){var _0x1fdca9={'raw':![],'where':{'id':_0x11a83f['params']['id']}},_0x41e338={};_0x41e338['model']=_[_0xa8e6('0x57')](_[_0xa8e6('0x58')](db[_0xa8e6('0x46')][_0xa8e6('0x3e')]),[_0xa8e6('0x42'),_0xa8e6('0x43')]);_0x41e338[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x11a83f[_0xa8e6('0x47')]);_0x41e338[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x41e338[_0xa8e6('0x5b')],_0x41e338[_0xa8e6('0x47')]);_0x1fdca9[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x41e338['model'],qs[_0xa8e6('0x5c')](_0x11a83f['query'][_0xa8e6('0x5c')]));_0x1fdca9['attributes']=_0x1fdca9[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x1fdca9[_0xa8e6('0x4c')]:_0x41e338['model'];if(_0x11a83f['query']['includeAll']){_0x1fdca9['include']=[{'all':!![]}];}if(_0x11a83f['query'][_0xa8e6('0x49')]==='true'){_0x1fdca9[_0xa8e6('0x4b')]=[{'model':db[_0xa8e6('0x5d')],'as':_0xa8e6('0x49')}];}_0x1fdca9=_[_0xa8e6('0x5e')]({},_0x1fdca9,_0x11a83f[_0xa8e6('0x5f')]);if(!_[_0xa8e6('0x36')](_0x1fdca9[_0xa8e6('0x4c')],'id')){_0x1fdca9['attributes']['push']('id');}return db[_0xa8e6('0x46')][_0xa8e6('0x60')](_0x1fdca9)[_0xa8e6('0x16')](handleEntityNotFound(_0x8f812,null))['then'](function(_0x4fc353){var _0x2c7778=[];values=_0x4fc353;if(_0x11a83f[_0xa8e6('0x47')]['openTabs']===_0xa8e6('0x4a')){_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x51'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x53'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x56'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778['push'](get_open_tabs('whatsapp',_0x4fc353['dataValues']));_0x2c7778[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x54'),_0x4fc353[_0xa8e6('0x52')]));_0x2c7778['push'](get_open_tabs(_0xa8e6('0x55'),_0x4fc353['dataValues']));return Promise[_0xa8e6('0x61')](_0x2c7778);}else{return values;}})[_0xa8e6('0x16')](function(){return values;})[_0xa8e6('0x16')](respondWithResult(_0x8f812,null))['catch'](handleError(_0x8f812,null));};exports[_0xa8e6('0x27')]=function(_0x46e974,_0x5c272b){if(_0x46e974['body']['id']){delete _0x46e974['body']['id'];}delete _0x46e974[_0xa8e6('0x62')][_0xa8e6('0x2b')];return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x46e974[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x5c272b,null))[_0xa8e6('0x16')](saveUpdates(_0x46e974[_0xa8e6('0x62')],null))[_0xa8e6('0x16')](respondWithResult(_0x5c272b,null))['catch'](handleError(_0x5c272b,null));};exports['describe']=function(_0x10a963,_0x1cf8a0){return db['User'][_0xa8e6('0x64')]()[_0xa8e6('0x16')](respondWithResult(_0x1cf8a0,null))['catch'](handleError(_0x1cf8a0,null));};exports[_0xa8e6('0x65')]=function(_0x83a8c8,_0x2f8c4e){return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x83a8c8[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x2f8c4e,null))[_0xa8e6('0x16')](function(_0x522424){if(_0x522424){return _0x522424[_0xa8e6('0x65')](_0x83a8c8[_0xa8e6('0x62')]['ids'],_[_0xa8e6('0x66')](_0x83a8c8['body'],[_0xa8e6('0x67'),'id'])||{});}})[_0xa8e6('0x16')](respondWithResult(_0x2f8c4e,null))[_0xa8e6('0x1e')](handleError(_0x2f8c4e,null));};function validateUser(_0xee4da3){return new Promise(function(_0x15b648,_0x419f02){if(_0xee4da3[_0xa8e6('0x68')])return _0x15b648(_0xee4da3);return db[_0xa8e6('0x69')][_0xa8e6('0x6a')](0x1)['then'](function(_0x11fb16){if(_0x11fb16['securePassword'])authService[_0xa8e6('0x6b')](_0xee4da3[_0xa8e6('0x42')]);db[_0xa8e6('0x46')][_0xa8e6('0x6c')](_0xa8e6('0x68'))[_0xa8e6('0x16')](function(_0x51ef04){if(_[_0xa8e6('0x6d')](_0x51ef04)){_0xee4da3[_0xa8e6('0x68')]=_0x11fb16[_0xa8e6('0x6e')]||0x1;return;}if(_[_0xa8e6('0x6d')](_0x11fb16[_0xa8e6('0x6e')])||_0x11fb16[_0xa8e6('0x6e')]===_0x51ef04){_0xee4da3[_0xa8e6('0x68')]=_0x51ef04+0x1;return;}if(_0x11fb16[_0xa8e6('0x6e')]>_0x51ef04){_0xee4da3[_0xa8e6('0x68')]=_0x11fb16[_0xa8e6('0x6e')];return;}return db[_0xa8e6('0x6f')]['query'](_0xa8e6('0x70'),{'type':db[_0xa8e6('0x6f')][_0xa8e6('0x71')]['SELECT']})['then'](function(_0x55a977){if(_0x55a977&&_0x55a977[_0xa8e6('0x50')]){for(var _0x38cac7=0x0,_0x4b1da7=_0x55a977[_0xa8e6('0x50')];_0x38cac7<_0x4b1da7&&_['isNil'](_0xee4da3['internal']);_0x38cac7++){if(_0x11fb16[_0xa8e6('0x6e')]<=_0x55a977[_0x38cac7][_0xa8e6('0x72')]){_0xee4da3[_0xa8e6('0x68')]=_0x55a977[_0x38cac7][_0xa8e6('0x72')];}else if(_0x11fb16[_0xa8e6('0x6e')]>_0x55a977[_0x38cac7][_0xa8e6('0x72')]&&_0x11fb16[_0xa8e6('0x6e')]<=_0x55a977[_0x38cac7]['to']){_0xee4da3['internal']=_0x11fb16[_0xa8e6('0x6e')];}}}if(_['isNil'](_0xee4da3[_0xa8e6('0x68')])){_0xee4da3[_0xa8e6('0x68')]=_0x51ef04+0x1;}return _0x15b648(_0xee4da3);});});})['catch'](function(_0x1f2176){_0x419f02(_0x1f2176);});});}function updateUser(_0x3abec6){return new Promise(function(_0x3b6141,_0x536cb6){try{if(_0x3abec6[_0xa8e6('0x73')]){_0x3abec6[_0xa8e6('0x74')]=_0x3abec6[_0xa8e6('0x68')];_0x3abec6[_0xa8e6('0x75')]={'mailbox':_0x3abec6['internal'],'password':_0x3abec6[_0xa8e6('0x42')],'fullname':_0x3abec6[_0xa8e6('0x76')],'email':_0x3abec6[_0xa8e6('0x77')]};}if(_0x3abec6[_0xa8e6('0x2b')]===_0xa8e6('0x30')){if(!_0x3abec6[_0xa8e6('0x78')])_0x3abec6[_0xa8e6('0x78')]=[_0xa8e6('0x79'),_0xa8e6('0x7a'),_0xa8e6('0x7b'),_0xa8e6('0x7c'),_0xa8e6('0x7d'),_0xa8e6('0x7e'),_0xa8e6('0x7f'),'106',_0xa8e6('0x80'),_0xa8e6('0x81'),'109',_0xa8e6('0x82'),'111',_0xa8e6('0x83'),_0xa8e6('0x84')];}_0x3b6141(_0x3abec6);}catch(_0x4b0c76){_0x536cb6(_0x4b0c76);}});}exports['create']=function(_0x63e8dd,_0x10c93f){if(_0x63e8dd['user'][_0xa8e6('0x2b')]===_0xa8e6('0x30'))throw new Error(_0xa8e6('0x85'));if(_0x63e8dd[_0xa8e6('0x62')][_0xa8e6('0x2b')]===_0xa8e6('0x2e')&&_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!==_0xa8e6('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x63e8dd[_0xa8e6('0x62')][_0xa8e6('0x2b')]==='admin'&&_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!=='admin'){throw new Error(_0xa8e6('0x86'));}return licenseUtil['checkUserLimits']([_0x63e8dd[_0xa8e6('0x62')]])['then'](function(){return validateUser(_0x63e8dd[_0xa8e6('0x62')]);})['then'](function(_0x29e884){return updateUser(_0x29e884)[_0xa8e6('0x16')](function(_0x28a22c){if(_0x28a22c['role']===_0xa8e6('0x2c')){_0x28a22c[_0xa8e6('0x87')]=_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x87')];delete _0x28a22c[_0xa8e6('0x88')];}return _0x28a22c;});})[_0xa8e6('0x16')](function(_0x2aa7c3){return db['User'][_0xa8e6('0x89')](_0x2aa7c3,{'include':[{'model':db[_0xa8e6('0x75')],'as':_0xa8e6('0x75')}]});})[_0xa8e6('0x16')](function(_0x32ad86){if(_0x63e8dd['body'][_0xa8e6('0x2b')]===_0xa8e6('0x2e'))return _0x32ad86;if(_0x63e8dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!=='user')return _0x32ad86;return db[_0xa8e6('0x8a')][_0xa8e6('0x60')]({'where':{'name':_0x32ad86[_0xa8e6('0x2b')]==='agent'?_0xa8e6('0x2f'):'Telephones','userProfileId':_0x63e8dd['user'][_0xa8e6('0x88')]},'raw':!![]})[_0xa8e6('0x16')](function(_0x1477d0){if(!_0x1477d0||_0x1477d0[_0xa8e6('0x8b')]!=0x0)return _0x32ad86;return db[_0xa8e6('0x38')]['create']({'name':_0x32ad86[_0xa8e6('0x37')],'resourceId':_0x32ad86['id'],'type':_0x1477d0[_0xa8e6('0x37')],'sectionId':_0x1477d0['id']},{})[_0xa8e6('0x16')](function(){return _0x32ad86;});})['catch'](function(_0x2d913e){logger[_0xa8e6('0x1b')](_0xa8e6('0x8c'),_0x2d913e);throw _0x2d913e;});})[_0xa8e6('0x16')](respondWithResult(_0x10c93f,0xc9))[_0xa8e6('0x1e')](handleError(_0x10c93f,null));};exports[_0xa8e6('0x8d')]=function(_0x5909dd,_0x211269){var _0x52c4c8=_0x5909dd[_0xa8e6('0x62')];var _0x27e547=[];if(_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]==='agent')throw new Error(_0xa8e6('0x85'));if(_[_0xa8e6('0x8e')](_0x52c4c8,['role',_0xa8e6('0x2e')])&&_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x52c4c8,['role',_0xa8e6('0x2c')])&&_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!==_0xa8e6('0x2c')){throw new Error(_0xa8e6('0x8f'));}return licenseUtil[_0xa8e6('0x90')](_0x52c4c8)[_0xa8e6('0x16')](function(){return validateUser(_0x52c4c8[0x0]);})[_0xa8e6('0x16')](function(){for(var _0x191068=0x1;_0x191068<_0x52c4c8[_0xa8e6('0x50')];_0x191068++){var _0x381cde=_0x52c4c8[_0x191068-0x1][_0xa8e6('0x68')];if(!_0x52c4c8[_0x191068][_0xa8e6('0x68')])_0x52c4c8[_0x191068][_0xa8e6('0x68')]=_0x381cde+0x1;_0x27e547[_0xa8e6('0x4d')](validateUser(_0x52c4c8[_0x191068]));}return Promise[_0xa8e6('0x61')](_0x27e547);})[_0xa8e6('0x16')](function(){_0x27e547=[];for(var _0x279925=0x0;_0x279925<_0x52c4c8[_0xa8e6('0x50')];_0x279925++){_0x27e547['push'](updateUser(_0x52c4c8[_0x279925]));}return Promise[_0xa8e6('0x61')](_0x27e547);})[_0xa8e6('0x16')](function(){_0x27e547=_0x52c4c8[_0xa8e6('0x34')](function(_0x3e690f){return db[_0xa8e6('0x46')][_0xa8e6('0x89')](_0x3e690f,{'include':[{'model':db[_0xa8e6('0x75')],'as':_0xa8e6('0x75')}]})[_0xa8e6('0x16')](function(_0x4575bb){_0x3e690f['id']=_0x4575bb['id'];return _0x3e690f;});});return Promise[_0xa8e6('0x61')](_0x27e547);})['then'](function(_0x2136a8){if(_0x5909dd[_0xa8e6('0x62')][_0xa8e6('0x2b')]==='user')return _0x2136a8;if(_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x2b')]!==_0xa8e6('0x2e'))return _0x2136a8;var _0x4cb5e8=_['some'](_0x2136a8,function(_0x302ec9){return _0x302ec9[_0xa8e6('0x2b')]==='agent'||_0x302ec9[_0xa8e6('0x2b')]===_0xa8e6('0x32');});if(!_0x4cb5e8)return _0x2136a8;return db[_0xa8e6('0x8a')][_0xa8e6('0x4e')]({'where':{'name':{'$or':[_0xa8e6('0x2f'),_0xa8e6('0x31')]},'userProfileId':_0x5909dd[_0xa8e6('0x2e')][_0xa8e6('0x88')]},'raw':!![]})[_0xa8e6('0x16')](function(_0x29e40b){if(_[_0xa8e6('0x91')](_0x29e40b)||!_['some'](_0x29e40b,[_0xa8e6('0x8b'),0x0]))return _0x2136a8;_0x27e547=[];var _0x5b9f27=_(_0x29e40b)[_0xa8e6('0x34')](function(_0x437d3b){if(_0x437d3b[_0xa8e6('0x8b')]===0x1)return;return _0x437d3b[_0xa8e6('0x37')]===_0xa8e6('0x2f')?_0xa8e6('0x30'):_0xa8e6('0x32');})[_0xa8e6('0x92')]()[_0xa8e6('0x35')]();for(var _0x31ac9f=0x0;_0x31ac9f<_0x2136a8[_0xa8e6('0x50')];_0x31ac9f++){if(!_[_0xa8e6('0x36')](_0x5b9f27,_0x2136a8[_0x31ac9f][_0xa8e6('0x2b')]))return;var _0x547e8c=_0x2136a8[_0x31ac9f][_0xa8e6('0x2b')]==='agent'?_0xa8e6('0x2f'):_0xa8e6('0x31');_0x27e547[_0xa8e6('0x4d')](db['UserProfileResource'][_0xa8e6('0x89')]({'name':_0x2136a8[_0x31ac9f][_0xa8e6('0x37')],'resourceId':_0x2136a8[_0x31ac9f]['id'],'type':_0x547e8c,'sectionId':_[_0xa8e6('0x60')](_0x29e40b,[_0xa8e6('0x37'),_0x547e8c])['id']},{}));}return Promise[_0xa8e6('0x61')](_0x27e547);});})['then'](respondWithResult(_0x211269,0xc9))[_0xa8e6('0x1e')](handleError(_0x211269,null));};exports[_0xa8e6('0x93')]=function(_0x400f71,_0x56b6db){if(_0x400f71['body']['id']){delete _0x400f71[_0xa8e6('0x62')]['id'];}return db['User']['find']({'where':{'id':_0x400f71[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](function(_0x1cb170){if(!_0x1cb170)return null;if(_0x1cb170['id']===_0x400f71[_0xa8e6('0x2e')]['id']){if(!_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x94')]||!_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')]){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x1cb170[_0xa8e6('0x98')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x94')])){throw new db['Sequelize']['ValidationError'](_0xa8e6('0x99'));}if(_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x94')]===_0x400f71['body'][_0xa8e6('0x95')]){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0x9a'));}}else if(_0x400f71[_0xa8e6('0x2e')]['role']===_0xa8e6('0x2c')){if(!_0x400f71['body'][_0xa8e6('0x95')]){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0x9b'));}}else if(_0x400f71[_0xa8e6('0x2e')][_0xa8e6('0x2b')]==='user'){if(!_0x400f71[_0xa8e6('0x62')]['newPassword']){throw new db['Sequelize'][(_0xa8e6('0x97'))](_0xa8e6('0x9b'));}if(_0x1cb170[_0xa8e6('0x2b')]!==_0xa8e6('0x30')){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0xa8e6('0x97'))]('Unauthorized');}return _0x1cb170;})['then'](handleEntityNotFound(_0x56b6db,null))[_0xa8e6('0x16')](function(_0x2703f6){return db[_0xa8e6('0x69')][_0xa8e6('0x9c')]({'attributes':['id',_0xa8e6('0x9d'),'enforcePasswordHistory',_0xa8e6('0x9e')]})[_0xa8e6('0x16')](function(_0x191da1){if(_0x191da1['securePassword'])authService[_0xa8e6('0x6b')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')]);if(!_0x191da1['enforcePasswordHistory']||!_0x2703f6[_0xa8e6('0x9f')])return _0x2703f6;authService[_0xa8e6('0xa0')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')],_0x2703f6[_0xa8e6('0x9f')],_0x191da1[_0xa8e6('0x9e')]);return _0x2703f6;})[_0xa8e6('0x16')](saveUpdates({'password':_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')],'passwordResetAt':_0x400f71[_0xa8e6('0x2e')]['id']==_0x400f71[_0xa8e6('0x63')]['id']?moment():null,'previousPasswords':authService[_0xa8e6('0xa1')](_0x400f71[_0xa8e6('0x62')][_0xa8e6('0x95')],_0x2703f6[_0xa8e6('0x9f')])},null));})['then'](respondWithResult(_0x56b6db,null))[_0xa8e6('0x1e')](handleError(_0x56b6db,null));};exports['addQueues']=function(_0x349275,_0x4a6b75){var _0x5421fc=_0x349275[_0xa8e6('0x62')][_0xa8e6('0xa2')];return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x349275[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),'role',_0xa8e6('0xa3'),_0xa8e6('0xa4'),_0xa8e6('0xa5'),_0xa8e6('0xa6')]})[_0xa8e6('0x16')](handleEntityNotFound(_0x4a6b75,null))['then'](function(_0x4c75ee){if(_0x4c75ee){if(!utils[_0xa8e6('0xa7')](_0x5421fc)){throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0xa8'));}return _0x4c75ee[_0xa8e6('0xa9')+_['capitalize'](_0x5421fc[_0xa8e6('0xaa')]())+_0xa8e6('0xab')](_0x349275['body']['ids'],{'penalty':_0x349275['body']['penalty']||0x0})[_0xa8e6('0xac')](function(_0xf2c765){for(var _0x883f4b=0x0;_0x883f4b<_0x349275[_0xa8e6('0x62')][_0xa8e6('0x67')]['length'];_0x883f4b+=0x1){var _0x51b65d={'UserId':Number(_0x349275[_0xa8e6('0x63')]['id'])};_0x51b65d[_['capitalize'](_0x5421fc['toLowerCase']())+_0xa8e6('0xad')]=Number(_0x349275[_0xa8e6('0x62')][_0xa8e6('0x67')][_0x883f4b]);socket['emit'](_0xa8e6('0x2e')+_['capitalize'](_0x5421fc['toLowerCase']())+_0xa8e6('0xae'),_0x51b65d);}return _0xf2c765;})[_0xa8e6('0x16')](function(){if(_0x5421fc===_0xa8e6('0xaf')){return db[_0xa8e6('0xb0')][_0xa8e6('0x4e')]({'where':{'id':_0x349275[_0xa8e6('0x62')][_0xa8e6('0x67')]||[]},'raw':!![],'attributes':['id',_0xa8e6('0x37')]});}})[_0xa8e6('0x16')](function(_0x3dd19c){var _0x5e9ed3=_0x4c75ee[_0xa8e6('0x2a')]({'plain':!![]});var _0xb7b7de=[];if(_0x5421fc==='voice'&&_0x5e9ed3[_0xa8e6('0x2b')]===_0xa8e6('0x30')&&_0x5e9ed3[_0xa8e6('0xa3')]){for(let _0x17ba54=0x0;_0x17ba54<_0x3dd19c[_0xa8e6('0x50')];_0x17ba54+=0x1){_0xb7b7de[_0xa8e6('0x4d')]({'membername':_0x5e9ed3[_0xa8e6('0x37')],'UserId':_0x5e9ed3['id'],'queue_name':_0x3dd19c[_0x17ba54]['name'],'VoiceQueueId':_0x3dd19c[_0x17ba54]['id'],'interface':_[_0xa8e6('0x6d')](_0x5e9ed3[_0xa8e6('0xa6')])?util[_0xa8e6('0xb1')](_0xa8e6('0xb2'),_0x5e9ed3[_0xa8e6('0x37')]):_0x5e9ed3[_0xa8e6('0xa6')],'paused':_0x5e9ed3[_0xa8e6('0xa5')]||![],'penalty':_0x349275[_0xa8e6('0x62')][_0xa8e6('0xb3')]||0x0});}return Promise['all'](_0xb7b7de[_0xa8e6('0x34')](function(_0x5abda4){return db[_0xa8e6('0xb4')][_0xa8e6('0xb5')](_0x5abda4);}));}return _0x4c75ee;});}})[_0xa8e6('0x16')](respondWithStatusCode(_0x4a6b75,null))[_0xa8e6('0x1e')](handleError(_0x4a6b75,null));};exports[_0xa8e6('0xb6')]=function(_0x5dce1b,_0x4819c7){var _0x2d6dfd,_0x24d6aa;return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x5dce1b[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b')]})['then'](handleEntityNotFound(_0x4819c7,null))['then'](function(_0x5bdca1){if(_0x5bdca1){_0x2d6dfd=_0x5bdca1;if(!_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0xa2')]||!utils[_0xa8e6('0xa7')](_0x5dce1b['query'][_0xa8e6('0xa2')])){throw new db[(_0xa8e6('0x96'))]['ValidationError']('Unknown\x20channel');}return _0x5bdca1[_0xa8e6('0xb7')+_[_0xa8e6('0xb8')](_0x5dce1b[_0xa8e6('0x47')]['channel']['toLowerCase']())+_0xa8e6('0xab')](_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0x67')]);}})[_0xa8e6('0x16')](function(_0x2843fa){if(_[_0xa8e6('0xb9')](_0x5dce1b[_0xa8e6('0x47')]['ids'])){for(var _0x45eeb1=0x0;_0x45eeb1<_0x5dce1b['query'][_0xa8e6('0x67')]['length'];_0x45eeb1+=0x1){_0x24d6aa={'UserId':Number(_0x5dce1b['params']['id'])};_0x24d6aa[_['capitalize'](_0x5dce1b[_0xa8e6('0x47')]['channel'][_0xa8e6('0xaa')]())+_0xa8e6('0xad')]=Number(_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0x67')][_0x45eeb1]);socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_[_0xa8e6('0xb8')](_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0xa2')][_0xa8e6('0xaa')]())+_0xa8e6('0xba'),_0x24d6aa);}}else{_0x24d6aa={'UserId':Number(_0x5dce1b['params']['id'])};_0x24d6aa[_[_0xa8e6('0xb8')](_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0xa2')][_0xa8e6('0xaa')]())+_0xa8e6('0xad')]=Number(_0x5dce1b[_0xa8e6('0x47')][_0xa8e6('0x67')]);socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_[_0xa8e6('0xb8')](_0x5dce1b['query']['channel']['toLowerCase']())+_0xa8e6('0xba'),_0x24d6aa);}return _0x2843fa;})[_0xa8e6('0x16')](function(){if(_0x5dce1b[_0xa8e6('0x47')]['channel']===_0xa8e6('0xaf')){return db[_0xa8e6('0xb4')][_0xa8e6('0x39')]({'where':{'UserId':_0x5dce1b[_0xa8e6('0x63')]['id'],'VoiceQueueId':_0x5dce1b[_0xa8e6('0x47')]['ids']},'individualHooks':!![]})['then'](function(){return _0x2d6dfd;});}return _0x2d6dfd;})['then'](respondWithStatusCode(_0x4819c7,null))[_0xa8e6('0x1e')](handleError(_0x4819c7,null));};exports[_0xa8e6('0xbb')]=function(_0x4e9ff4,_0x119f65){_0x4e9ff4[_0xa8e6('0x62')][_0xa8e6('0xbc')]=_0x4e9ff4[_0xa8e6('0xbd')][_0xa8e6('0xbe')];return db[_0xa8e6('0x46')]['find']({'where':{'id':_0x4e9ff4['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x119f65,null))[_0xa8e6('0x16')](saveUpdates(_0x4e9ff4[_0xa8e6('0x62')],null))[_0xa8e6('0x16')](respondWithResult(_0x119f65,null))[_0xa8e6('0x1e')](handleError(_0x119f65,null));};exports[_0xa8e6('0xbf')]=function(_0x1859e9,_0x10fe3d){var _0x40d0e0=path[_0xa8e6('0xc0')](config[_0xa8e6('0xc1')],_0xa8e6('0xc2'));return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x1859e9['params']['id']},'attributes':['id',_0xa8e6('0xbc')],'raw':!![]})[_0xa8e6('0x16')](handleEntityNotFound(_0x10fe3d,null))[_0xa8e6('0x16')](function(_0x1d6852){if(_0x1d6852){if(_[_0xa8e6('0x6d')](_0x1d6852['userpic'])){return _0x10fe3d[_0xa8e6('0xc3')](_0x40d0e0);}else{if(!fs[_0xa8e6('0xc4')](path['join'](config[_0xa8e6('0xc1')],_0xa8e6('0xc5'),_0x1d6852[_0xa8e6('0xbc')]))){return _0x10fe3d['download'](_0x40d0e0);}return _0x10fe3d[_0xa8e6('0xc3')](path[_0xa8e6('0xc0')](config['root'],_0xa8e6('0xc5'),_0x1d6852[_0xa8e6('0xbc')]));}}})[_0xa8e6('0x1e')](handleError(_0x10fe3d,null));};exports['getOpenTabs']=function(_0x309cc6,_0x28792f){return db['User'][_0xa8e6('0x60')]({'where':{'id':_0x309cc6[_0xa8e6('0x63')]['id']},'attributes':['id']})[_0xa8e6('0x16')](handleEntityNotFound(_0x28792f,null))[_0xa8e6('0x16')](function(_0x4545d1){var _0x1f00ea=[];values=_0x4545d1[_0xa8e6('0x52')];_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x51'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x53'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea['push'](get_open_tabs(_0xa8e6('0x56'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0xc6'),_0x4545d1[_0xa8e6('0x52')]));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x54'),_0x4545d1['dataValues']));_0x1f00ea[_0xa8e6('0x4d')](get_open_tabs(_0xa8e6('0x55'),_0x4545d1['dataValues']));return Promise['all'](_0x1f00ea);})['then'](function(_0x230764){if(_0x230764){var _0x25e530=_[_0xa8e6('0x34')](values[_0xa8e6('0xc7')],function(_0xc316cf){return{'channel':_0xa8e6('0xc8'),'id':_0xc316cf['id'],'createdAt':_0xc316cf[_0xa8e6('0xc9')]};});var _0x1c6935=_[_0xa8e6('0x34')](values[_0xa8e6('0xca')],function(_0x12bd0a){return{'channel':'FAX','id':_0x12bd0a['id'],'createdAt':_0x12bd0a[_0xa8e6('0xc9')]};});var _0x3b56f6=_['map'](values[_0xa8e6('0xcb')],function(_0x17d6e9){return{'channel':_0xa8e6('0xcc'),'id':_0x17d6e9['id'],'createdAt':_0x17d6e9[_0xa8e6('0xc9')]};});var _0x34df2a=_[_0xa8e6('0x34')](values[_0xa8e6('0xcd')],function(_0x38bdaf){return{'channel':_0xa8e6('0xce'),'id':_0x38bdaf['id'],'createdAt':_0x38bdaf[_0xa8e6('0xc9')]};});var _0x1e4f1e=_[_0xa8e6('0x34')](values[_0xa8e6('0xcf')],function(_0x502f7f){return{'channel':'SMS','id':_0x502f7f['id'],'createdAt':_0x502f7f[_0xa8e6('0xc9')]};});var _0x1a4bd5=_[_0xa8e6('0x34')](values['WhatsappOpenTabs'],function(_0x4b2181){return{'channel':_0xa8e6('0xd0'),'id':_0x4b2181['id'],'createdAt':_0x4b2181[_0xa8e6('0xc9')]};});var _0x1ecda0=_[_0xa8e6('0xd1')](_0x25e530,_0x1c6935,_0x3b56f6,_0x34df2a,_0x1e4f1e,_0x1a4bd5);var _0x4b2fb8={'count':_0x1ecda0[_0xa8e6('0x50')],'rows':_0x1ecda0};return _0x4b2fb8;}else return null;})[_0xa8e6('0x16')](respondWithResult(_0x28792f,null))[_0xa8e6('0x1e')](handleError(_0x28792f,null));};exports[_0xa8e6('0xd2')]=function(_0x31ad1f,_0x980008){var _0x4a0e29={};var _0x3c6922={};var _0x3f052a;var _0x87127a;return db['User'][_0xa8e6('0x9c')]({'where':{'id':_0x31ad1f[_0xa8e6('0x63')]['id']}})['then'](handleEntityNotFound(_0x980008,null))[_0xa8e6('0x16')](function(_0x6ff05b){if(_0x6ff05b){_0x3f052a=_0x6ff05b;_0x3c6922[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0xd3')]['rawAttributes']);_0x3c6922['query']=_['keys'](_0x31ad1f[_0xa8e6('0x47')]);_0x3c6922[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x3c6922[_0xa8e6('0x5b')],_0x3c6922[_0xa8e6('0x47')]);_0x4a0e29[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x3c6922[_0xa8e6('0x5b')],qs['fields'](_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x4a0e29[_0xa8e6('0x4c')]=_0x4a0e29[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x4a0e29[_0xa8e6('0x4c')]:_0x3c6922['model'];_0x4a0e29['order']=qs[_0xa8e6('0xd4')](_0x31ad1f[_0xa8e6('0x47')]['sort']);_0x4a0e29[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x31ad1f[_0xa8e6('0x47')],_0x3c6922[_0xa8e6('0x59')]));if(_0x31ad1f['query'][_0xa8e6('0x33')]){_0x4a0e29[_0xa8e6('0x45')]=_['merge'](_0x4a0e29['where'],{'$or':_[_0xa8e6('0x34')](_0x4a0e29[_0xa8e6('0x4c')],function(_0x1b4cbf){var _0x39f614={};_0x39f614[_0x1b4cbf]={'$like':'%'+_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x39f614;})});}_0x4a0e29=_[_0xa8e6('0x5e')]({},_0x4a0e29,_0x31ad1f[_0xa8e6('0x5f')]);return _0x3f052a['getContacts'](_0x4a0e29);}})['then'](function(_0x4fd2d3){if(_0x4fd2d3){_0x87127a=_0x4fd2d3[_0xa8e6('0x50')];if(_0x31ad1f[_0xa8e6('0x47')]['hasOwnProperty'](_0xa8e6('0x48'))){_0x4a0e29[_0xa8e6('0x4b')]=[{'model':db[_0xa8e6('0xd6')],'as':_0xa8e6('0xd7'),'required':![]},{'model':db[_0xa8e6('0xd8')],'as':'Tags','attributes':['id',_0xa8e6('0x37'),_0xa8e6('0xd9')],'where':_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0xda')]?{'id':_0x31ad1f['query'][_0xa8e6('0xda')]}:undefined,'required':_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0xda')]?!![]:![]}];}if(!_0x31ad1f['query']['hasOwnProperty'](_0xa8e6('0xdb'))){_0x4a0e29['limit']=qs[_0xa8e6('0x23')](_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x4a0e29[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x31ad1f[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x3f052a['getContacts'](_0x4a0e29);}})[_0xa8e6('0x16')](function(_0x1974e8){if(_0x1974e8){return _0x1974e8?{'count':_0x87127a,'rows':_0x1974e8}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x980008,null))[_0xa8e6('0x1e')](handleError(_0x980008,null));};exports[_0xa8e6('0xdc')]=function(_0x2b7625,_0xf576d7){var _0x1f1f11;var _0x4ae581={};var _0x5e948c;return db['User']['findOne']({'where':{'id':_0x2b7625[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b')]})[_0xa8e6('0x16')](handleEntityNotFound(_0xf576d7,null))[_0xa8e6('0x16')](function(_0x15ec93){if(!utils['isValidChannel'](_0x2b7625[_0xa8e6('0x47')]['channel'])){throw new db['Sequelize'][(_0xa8e6('0x97'))](_0xa8e6('0xa8'));}_0x1f1f11=_0x15ec93;var _0x2c1fa9={};_0x2c1fa9[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xdd')][_0xa8e6('0x3e')]);_0x2c1fa9['query']=_['keys'](_0x2b7625['query']);_0x2c1fa9[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x2c1fa9[_0xa8e6('0x5b')],_0x2c1fa9['query']);_0x4ae581['attributes']=_[_0xa8e6('0x5a')](_0x2c1fa9[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x4ae581[_0xa8e6('0x4c')]=_0x4ae581[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x4ae581[_0xa8e6('0x4c')]:_0x2c1fa9[_0xa8e6('0x5b')];_0x4ae581[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x2b7625['query'][_0xa8e6('0xd4')]);_0x4ae581['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x2b7625[_0xa8e6('0x47')],_0x2c1fa9[_0xa8e6('0x59')]));if(_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x4ae581['where']=_[_0xa8e6('0x5e')](_0x4ae581['where'],{'$or':_[_0xa8e6('0x34')](_0x4ae581['attributes'],function(_0x482d0d){var _0x32d47b={};_0x32d47b[_0x482d0d]={'$like':'%'+_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x32d47b;})});}_0x4ae581=_[_0xa8e6('0x5e')]({},_0x4ae581,_0x2b7625[_0xa8e6('0x5f')]);switch(_0x1f1f11[_0xa8e6('0x2b')]){case'admin':return db[_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xdd')][_0xa8e6('0x4e')](_0x4ae581);case _0xa8e6('0x2e'):case _0xa8e6('0x30'):return _0x1f1f11[_0xa8e6('0x2a')+_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xab')](_0x4ae581);default:throw new db[(_0xa8e6('0x96'))][(_0xa8e6('0x97'))](_0xa8e6('0xdf'));}})[_0xa8e6('0x16')](function(_0x550a69){_0x5e948c=_0x550a69[_0xa8e6('0x50')];if(!_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x4ae581[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x2b7625[_0xa8e6('0x47')]['limit']);_0x4ae581[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0x21')]);}switch(_0x1f1f11[_0xa8e6('0x2b')]){case _0xa8e6('0x2c'):return db[_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+'Queue'][_0xa8e6('0x4e')](_0x4ae581);case _0xa8e6('0x2e'):case _0xa8e6('0x30'):return _0x1f1f11[_0xa8e6('0x2a')+_[_0xa8e6('0xb8')](_0x2b7625[_0xa8e6('0x47')][_0xa8e6('0xa2')])+_0xa8e6('0xab')](_0x4ae581);}})[_0xa8e6('0x16')](function(_0x4f2d34){return{'count':_0x5e948c,'rows':_0x4f2d34};})['then'](respondWithResult(_0xf576d7,null))[_0xa8e6('0x1e')](handleError(_0xf576d7,null));};exports['getVoiceQueuesRt']=function(_0x3521c3,_0x4ffa42){var _0x546b97={};var _0x367c7a={};var _0x46518f;var _0x1f2202;return db[_0xa8e6('0x46')]['findOne']({'where':{'id':_0x3521c3[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x4ffa42,null))[_0xa8e6('0x16')](function(_0x3cb23a){if(_0x3cb23a){_0x46518f=_0x3cb23a;_0x367c7a[_0xa8e6('0x5b')]=_['keys'](db['UserVoiceQueueRt'][_0xa8e6('0x3e')]);_0x367c7a['query']=_[_0xa8e6('0x58')](_0x3521c3[_0xa8e6('0x47')]);_0x367c7a[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x367c7a['model'],_0x367c7a[_0xa8e6('0x47')]);_0x546b97[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x367c7a[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x3521c3['query'][_0xa8e6('0x5c')]));_0x546b97[_0xa8e6('0x4c')]=_0x546b97[_0xa8e6('0x4c')]['length']?_0x546b97['attributes']:_0x367c7a['model'];_0x546b97['order']=qs[_0xa8e6('0xd4')](_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x546b97[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x3521c3[_0xa8e6('0x47')],_0x367c7a['filters']));if(_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x546b97['where']=_[_0xa8e6('0x5e')](_0x546b97[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x546b97[_0xa8e6('0x4c')],function(_0x266a2e){var _0x5becab={};_0x5becab[_0x266a2e]={'$like':'%'+_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x5becab;})});}_0x546b97=_['merge']({},_0x546b97,_0x3521c3[_0xa8e6('0x5f')]);return _0x46518f[_0xa8e6('0xe1')](_0x546b97);}})[_0xa8e6('0x16')](function(_0x349156){if(_0x349156){_0x1f2202=_0x349156[_0xa8e6('0x50')];if(!_0x3521c3['query'][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x546b97[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x3521c3[_0xa8e6('0x47')]['limit']);_0x546b97[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x3521c3[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x46518f[_0xa8e6('0xe1')](_0x546b97);}})[_0xa8e6('0x16')](function(_0x118c54){if(_0x118c54){return _0x118c54?{'count':_0x1f2202,'rows':_0x118c54}:null;}})['then'](respondWithResult(_0x4ffa42,null))[_0xa8e6('0x1e')](handleError(_0x4ffa42,null));};exports['getGroups']=function(_0x44bb4a,_0x5a8f59){var _0x1f5745={};var _0x7f43f3={};var _0x179bcc;var _0x512086;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x44bb4a[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x5a8f59,null))['then'](function(_0x467767){if(_0x467767){_0x179bcc=_0x467767;_0x7f43f3[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0xe2')][_0xa8e6('0x3e')]);_0x7f43f3[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x44bb4a['query']);_0x7f43f3['filters']=_[_0xa8e6('0x5a')](_0x7f43f3[_0xa8e6('0x5b')],_0x7f43f3[_0xa8e6('0x47')]);_0x1f5745[_0xa8e6('0x4c')]=_['intersection'](_0x7f43f3[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x1f5745['attributes']=_0x1f5745['attributes'][_0xa8e6('0x50')]?_0x1f5745[_0xa8e6('0x4c')]:_0x7f43f3['model'];_0x1f5745[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x44bb4a['query']['sort']);_0x1f5745[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x44bb4a['query'],_0x7f43f3[_0xa8e6('0x59')]));if(_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x1f5745[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x1f5745[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x1f5745[_0xa8e6('0x4c')],function(_0x958be1){var _0x2c5dd0={};_0x2c5dd0[_0x958be1]={'$like':'%'+_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x2c5dd0;})});}_0x1f5745=_[_0xa8e6('0x5e')]({},_0x1f5745,_0x44bb4a[_0xa8e6('0x5f')]);return _0x179bcc[_0xa8e6('0xe3')](_0x1f5745);}})[_0xa8e6('0x16')](function(_0x2b138c){if(_0x2b138c){_0x512086=_0x2b138c['length'];if(!_0x44bb4a['query'][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x1f5745[_0xa8e6('0x23')]=qs['limit'](_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x1f5745[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x44bb4a[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x179bcc[_0xa8e6('0xe3')](_0x1f5745);}})[_0xa8e6('0x16')](function(_0x790379){if(_0x790379){return _0x790379?{'count':_0x512086,'rows':_0x790379}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x5a8f59,null))[_0xa8e6('0x1e')](handleError(_0x5a8f59,null));};exports[_0xa8e6('0xe4')]=function(_0x45c04e,_0x4d820f){var _0x19b0e1={'raw':!![],'where':{}};var _0x67142b={};var _0x3218c5={'count':0x0,'rows':[]};return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x45c04e[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x4d820f,null))[_0xa8e6('0x16')](function(_0x49c5bb){if(_0x49c5bb){_0x67142b[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xe5')][_0xa8e6('0x3e')]);_0x67142b[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x45c04e[_0xa8e6('0x47')]);_0x67142b[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x67142b['model'],_0x67142b['query']);_0x19b0e1[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x67142b['model'],qs[_0xa8e6('0x5c')](_0x45c04e['query'][_0xa8e6('0x5c')]));_0x19b0e1['attributes']=_0x19b0e1[_0xa8e6('0x4c')]['length']?_0x19b0e1[_0xa8e6('0x4c')]:_0x67142b[_0xa8e6('0x5b')];if(!_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x19b0e1[_0xa8e6('0x23')]=qs['limit'](_0x45c04e['query']['limit']);_0x19b0e1[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0x21')]);}_0x19b0e1[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x45c04e['query'][_0xa8e6('0xd4')]);_0x19b0e1['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x45c04e[_0xa8e6('0x47')],_0x67142b[_0xa8e6('0x59')]));_0x19b0e1['where']['UserId']=_0x49c5bb['id'];if(_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x19b0e1[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x19b0e1[_0xa8e6('0x45')],{'$or':_['map'](_0x19b0e1[_0xa8e6('0x4c')],function(_0x3e0c5f){var _0x48c28a={};_0x48c28a[_0x3e0c5f]={'$like':'%'+_0x45c04e[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x48c28a;})});}_0x19b0e1=_['merge']({},_0x19b0e1,_0x45c04e[_0xa8e6('0x5f')]);return db[_0xa8e6('0xe5')]['count']({'where':_0x19b0e1[_0xa8e6('0x45')]})[_0xa8e6('0x16')](function(_0x30cb17){_0x3218c5[_0xa8e6('0x24')]=_0x30cb17;if(_0x45c04e['query'][_0xa8e6('0x48')]){_0x19b0e1['include']=[{'all':!![]}];}return db[_0xa8e6('0xe5')][_0xa8e6('0x4e')](_0x19b0e1);})[_0xa8e6('0x16')](function(_0x57d090){_0x3218c5['rows']=_0x57d090;return _0x3218c5;});}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x4d820f,_0x19b0e1))[_0xa8e6('0x1e')](handleError(_0x4d820f,null));};exports['getScreenRecordings']=function(_0x223f5c,_0x14965){var _0x460dde={'raw':!![],'where':{}};var _0x28c899={};var _0x3067bb={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x223f5c['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x14965,null))['then'](function(_0x12755f){if(_0x12755f){_0x28c899[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0xe6')][_0xa8e6('0x3e')]);_0x28c899[_0xa8e6('0x47')]=_['keys'](_0x223f5c[_0xa8e6('0x47')]);_0x28c899[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x28c899[_0xa8e6('0x5b')],_0x28c899[_0xa8e6('0x47')]);_0x460dde[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x28c899['model'],qs[_0xa8e6('0x5c')](_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x460dde[_0xa8e6('0x4c')]=_0x460dde[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x460dde[_0xa8e6('0x4c')]:_0x28c899[_0xa8e6('0x5b')];if(!_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x460dde['limit']=qs['limit'](_0x223f5c[_0xa8e6('0x47')]['limit']);_0x460dde[_0xa8e6('0x21')]=qs['offset'](_0x223f5c['query'][_0xa8e6('0x21')]);}_0x460dde[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x460dde[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x223f5c[_0xa8e6('0x47')],_0x28c899['filters']));_0x460dde[_0xa8e6('0x45')]['UserId']=_0x12755f['id'];if(_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x460dde['where']=_['merge'](_0x460dde['where'],{'$or':_[_0xa8e6('0x34')](_0x460dde[_0xa8e6('0x4c')],function(_0x386a3e){var _0x1fb358={};_0x1fb358[_0x386a3e]={'$like':'%'+_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x1fb358;})});}_0x460dde=_[_0xa8e6('0x5e')]({},_0x460dde,_0x223f5c[_0xa8e6('0x5f')]);return db[_0xa8e6('0xe6')][_0xa8e6('0x24')]({'where':_0x460dde[_0xa8e6('0x45')]})[_0xa8e6('0x16')](function(_0x3fb1e3){_0x3067bb['count']=_0x3fb1e3;if(_0x223f5c[_0xa8e6('0x47')][_0xa8e6('0x48')]){_0x460dde['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xa8e6('0x4e')](_0x460dde);})['then'](function(_0x93dbab){_0x3067bb['rows']=_0x93dbab;return _0x3067bb;});}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x14965,_0x460dde))[_0xa8e6('0x1e')](handleError(_0x14965,null));};exports[_0xa8e6('0xe7')]=function(_0x896a51,_0x54bd73){var _0x2efd8e={};var _0x16d3ee={};var _0x26d07d;var _0x3a0750;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x896a51[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x54bd73,null))[_0xa8e6('0x16')](function(_0x279954){if(_0x279954){_0x26d07d=_0x279954;_0x16d3ee[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xe8')][_0xa8e6('0x3e')]);_0x16d3ee['query']=_[_0xa8e6('0x58')](_0x896a51[_0xa8e6('0x47')]);_0x16d3ee['filters']=_['intersection'](_0x16d3ee[_0xa8e6('0x5b')],_0x16d3ee[_0xa8e6('0x47')]);_0x2efd8e['attributes']=_['intersection'](_0x16d3ee[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x896a51['query'][_0xa8e6('0x5c')]));_0x2efd8e[_0xa8e6('0x4c')]=_0x2efd8e[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x2efd8e['attributes']:_0x16d3ee['model'];_0x2efd8e[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x896a51[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x2efd8e[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x896a51[_0xa8e6('0x47')],_0x16d3ee['filters']));if(_0x896a51[_0xa8e6('0x47')]['filter']){_0x2efd8e[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x2efd8e['where'],{'$or':_[_0xa8e6('0x34')](_0x2efd8e[_0xa8e6('0x4c')],function(_0x4262a6){var _0xbdef0f={};_0xbdef0f[_0x4262a6]={'$like':'%'+_0x896a51[_0xa8e6('0x47')]['filter']+'%'};return _0xbdef0f;})});}_0x2efd8e=_['merge']({},_0x2efd8e,_0x896a51[_0xa8e6('0x5f')]);return _0x26d07d['getChatInteractions'](_0x2efd8e);}})[_0xa8e6('0x16')](function(_0x55f22f){if(_0x55f22f){_0x3a0750=_0x55f22f['length'];if(!_0x896a51[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x2efd8e[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x896a51['query'][_0xa8e6('0x23')]);_0x2efd8e[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x896a51[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x26d07d['getChatInteractions'](_0x2efd8e);}})['then'](function(_0x5e5035){if(_0x5e5035){return _0x5e5035?{'count':_0x3a0750,'rows':_0x5e5035}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x54bd73,null))[_0xa8e6('0x1e')](handleError(_0x54bd73,null));};exports[_0xa8e6('0xe9')]=function(_0x586fa8,_0x19e3ac){var _0xbe5a47={};var _0x225f93={};var _0x38d235;var _0x9f5d92;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x586fa8[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x19e3ac,null))['then'](function(_0x52ff02){if(_0x52ff02){_0x38d235=_0x52ff02;_0x225f93[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xea')][_0xa8e6('0x3e')]);_0x225f93[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x586fa8[_0xa8e6('0x47')]);_0x225f93['filters']=_['intersection'](_0x225f93[_0xa8e6('0x5b')],_0x225f93[_0xa8e6('0x47')]);_0xbe5a47['attributes']=_[_0xa8e6('0x5a')](_0x225f93[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0xbe5a47['attributes']=_0xbe5a47[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0xbe5a47[_0xa8e6('0x4c')]:_0x225f93[_0xa8e6('0x5b')];_0xbe5a47[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x586fa8[_0xa8e6('0x47')]['sort']);_0xbe5a47[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x586fa8[_0xa8e6('0x47')],_0x225f93[_0xa8e6('0x59')]));if(_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0xbe5a47[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0xbe5a47[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0xbe5a47[_0xa8e6('0x4c')],function(_0x53579b){var _0x4d5552={};_0x4d5552[_0x53579b]={'$like':'%'+_0x586fa8[_0xa8e6('0x47')]['filter']+'%'};return _0x4d5552;})});}_0xbe5a47=_['merge']({},_0xbe5a47,_0x586fa8[_0xa8e6('0x5f')]);return _0x38d235[_0xa8e6('0xe9')](_0xbe5a47);}})[_0xa8e6('0x16')](function(_0x5545f8){if(_0x5545f8){_0x9f5d92=_0x5545f8[_0xa8e6('0x50')];if(!_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0xbe5a47[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x586fa8[_0xa8e6('0x47')]['limit']);_0xbe5a47[_0xa8e6('0x21')]=qs['offset'](_0x586fa8[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x38d235[_0xa8e6('0xe9')](_0xbe5a47);}})[_0xa8e6('0x16')](function(_0x54de2f){if(_0x54de2f){return _0x54de2f?{'count':_0x9f5d92,'rows':_0x54de2f}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x19e3ac,null))['catch'](handleError(_0x19e3ac,null));};exports[_0xa8e6('0xeb')]=function(_0x44664b,_0x113396){var _0x56aa21={'raw':!![],'where':{}};var _0x3202ef={};var _0xd84e2b={'count':0x0,'rows':[]};return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x44664b['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x113396,null))[_0xa8e6('0x16')](function(_0x4715e0){if(_0x4715e0){_0x3202ef[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db['MailInteraction'][_0xa8e6('0x3e')]);_0x3202ef[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x44664b['query']);_0x3202ef[_0xa8e6('0x59')]=_['intersection'](_0x3202ef[_0xa8e6('0x5b')],_0x3202ef['query']);_0x56aa21[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x3202ef[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x44664b[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x56aa21[_0xa8e6('0x4c')]=_0x56aa21['attributes']['length']?_0x56aa21[_0xa8e6('0x4c')]:_0x3202ef[_0xa8e6('0x5b')];if(!_0x44664b['query']['hasOwnProperty'](_0xa8e6('0xdb'))){_0x56aa21[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x44664b[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x56aa21[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x44664b['query'][_0xa8e6('0x21')]);}_0x56aa21[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x44664b[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x56aa21[_0xa8e6('0x45')]=qs['filters'](_['pick'](_0x44664b[_0xa8e6('0x47')],_0x3202ef['filters']));_0x56aa21[_0xa8e6('0x45')]['UserId']=_0x4715e0['id'];if(_0x44664b[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x56aa21['where']=_['merge'](_0x56aa21[_0xa8e6('0x45')],{'$or':_['map'](_0x56aa21[_0xa8e6('0x4c')],function(_0x486b02){var _0x1205a6={};_0x1205a6[_0x486b02]={'$like':'%'+_0x44664b[_0xa8e6('0x47')]['filter']+'%'};return _0x1205a6;})});}_0x56aa21=_[_0xa8e6('0x5e')]({},_0x56aa21,_0x44664b[_0xa8e6('0x5f')]);return db['MailInteraction'][_0xa8e6('0x24')]({'where':_0x56aa21[_0xa8e6('0x45')]})[_0xa8e6('0x16')](function(_0x2d07f9){_0xd84e2b[_0xa8e6('0x24')]=_0x2d07f9;if(_0x44664b['query'][_0xa8e6('0x48')]){_0x56aa21[_0xa8e6('0x4b')]=[{'all':!![]}];}return db[_0xa8e6('0xec')][_0xa8e6('0x4e')](_0x56aa21);})['then'](function(_0x4f3580){_0xd84e2b['rows']=_0x4f3580;return _0xd84e2b;});}})[_0xa8e6('0x16')](respondWithFilteredResult(_0x113396,_0x56aa21))['catch'](handleError(_0x113396,null));};exports[_0xa8e6('0xed')]=function(_0x316087,_0x3e706e){var _0x5ae97f={};var _0x522559={};var _0x518d91;var _0x50d63f;return db[_0xa8e6('0x46')]['findOne']({'where':{'id':_0x316087[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x3e706e,null))[_0xa8e6('0x16')](function(_0x11104d){if(_0x11104d){_0x518d91=_0x11104d;_0x522559[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xee')][_0xa8e6('0x3e')]);_0x522559[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x316087[_0xa8e6('0x47')]);_0x522559[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x522559['model'],_0x522559['query']);_0x5ae97f['attributes']=_[_0xa8e6('0x5a')](_0x522559[_0xa8e6('0x5b')],qs['fields'](_0x316087[_0xa8e6('0x47')]['fields']));_0x5ae97f[_0xa8e6('0x4c')]=_0x5ae97f[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x5ae97f['attributes']:_0x522559['model'];_0x5ae97f['order']=qs[_0xa8e6('0xd4')](_0x316087[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x5ae97f[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x316087[_0xa8e6('0x47')],_0x522559[_0xa8e6('0x59')]));if(_0x316087[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x5ae97f['where']=_[_0xa8e6('0x5e')](_0x5ae97f['where'],{'$or':_[_0xa8e6('0x34')](_0x5ae97f[_0xa8e6('0x4c')],function(_0xc98bfe){var _0x2ed9dc={};_0x2ed9dc[_0xc98bfe]={'$like':'%'+_0x316087['query'][_0xa8e6('0x33')]+'%'};return _0x2ed9dc;})});}_0x5ae97f=_[_0xa8e6('0x5e')]({},_0x5ae97f,_0x316087['options']);return _0x518d91['getSmsInteractions'](_0x5ae97f);}})['then'](function(_0x2db1a4){if(_0x2db1a4){_0x50d63f=_0x2db1a4[_0xa8e6('0x50')];if(!_0x316087[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x5ae97f['limit']=qs[_0xa8e6('0x23')](_0x316087[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x5ae97f[_0xa8e6('0x21')]=qs['offset'](_0x316087[_0xa8e6('0x47')]['offset']);}return _0x518d91[_0xa8e6('0xed')](_0x5ae97f);}})[_0xa8e6('0x16')](function(_0x445a41){if(_0x445a41){return _0x445a41?{'count':_0x50d63f,'rows':_0x445a41}:null;}})['then'](respondWithResult(_0x3e706e,null))[_0xa8e6('0x1e')](handleError(_0x3e706e,null));};exports[_0xa8e6('0xef')]=function(_0x4d107f,_0x354c2e){var _0x3bd08a={};var _0x1cafe9={};var _0xe5aed6;var _0x39a374;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x4d107f['params']['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x354c2e,null))[_0xa8e6('0x16')](function(_0x5347d9){if(_0x5347d9){_0xe5aed6=_0x5347d9;_0x1cafe9[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xf0')][_0xa8e6('0x3e')]);_0x1cafe9[_0xa8e6('0x47')]=_[_0xa8e6('0x58')](_0x4d107f['query']);_0x1cafe9['filters']=_[_0xa8e6('0x5a')](_0x1cafe9[_0xa8e6('0x5b')],_0x1cafe9['query']);_0x3bd08a[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x1cafe9[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0x4d107f[_0xa8e6('0x47')]['fields']));_0x3bd08a[_0xa8e6('0x4c')]=_0x3bd08a[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x3bd08a[_0xa8e6('0x4c')]:_0x1cafe9['model'];_0x3bd08a[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x4d107f['query'][_0xa8e6('0xd4')]);_0x3bd08a['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x4d107f[_0xa8e6('0x47')],_0x1cafe9[_0xa8e6('0x59')]));if(_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x3bd08a[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x3bd08a[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x3bd08a[_0xa8e6('0x4c')],function(_0x1b502e){var _0x1306b1={};_0x1306b1[_0x1b502e]={'$like':'%'+_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x1306b1;})});}_0x3bd08a=_[_0xa8e6('0x5e')]({},_0x3bd08a,_0x4d107f[_0xa8e6('0x5f')]);return _0xe5aed6[_0xa8e6('0xef')](_0x3bd08a);}})[_0xa8e6('0x16')](function(_0x419c73){if(_0x419c73){_0x39a374=_0x419c73[_0xa8e6('0x50')];if(!_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x3bd08a[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x23')]);_0x3bd08a['offset']=qs[_0xa8e6('0x21')](_0x4d107f[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0xe5aed6['getFaxInteractions'](_0x3bd08a);}})[_0xa8e6('0x16')](function(_0x5cd008){if(_0x5cd008){return _0x5cd008?{'count':_0x39a374,'rows':_0x5cd008}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x354c2e,null))[_0xa8e6('0x1e')](handleError(_0x354c2e,null));};exports[_0xa8e6('0xf1')]=function(_0xa3409,_0x4bed11){var _0x21a0d9={};var _0x301a47={};var _0x115045;var _0x1c60e9;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0xa3409[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x4bed11,null))[_0xa8e6('0x16')](function(_0x4306a4){if(_0x4306a4){_0x115045=_0x4306a4;_0x301a47[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db[_0xa8e6('0xf2')]['rawAttributes']);_0x301a47['query']=_['keys'](_0xa3409['query']);_0x301a47[_0xa8e6('0x59')]=_['intersection'](_0x301a47[_0xa8e6('0x5b')],_0x301a47[_0xa8e6('0x47')]);_0x21a0d9[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x301a47[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0xa3409[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x21a0d9[_0xa8e6('0x4c')]=_0x21a0d9[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x21a0d9['attributes']:_0x301a47[_0xa8e6('0x5b')];_0x21a0d9['order']=qs['sort'](_0xa3409['query'][_0xa8e6('0xd4')]);_0x21a0d9[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_['pick'](_0xa3409['query'],_0x301a47[_0xa8e6('0x59')]));if(_0xa3409['query'][_0xa8e6('0x33')]){_0x21a0d9[_0xa8e6('0x45')]=_['merge'](_0x21a0d9[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x21a0d9[_0xa8e6('0x4c')],function(_0x13b623){var _0x5f479d={};_0x5f479d[_0x13b623]={'$like':'%'+_0xa3409[_0xa8e6('0x47')]['filter']+'%'};return _0x5f479d;})});}_0x21a0d9=_['merge']({},_0x21a0d9,_0xa3409[_0xa8e6('0x5f')]);return _0x115045[_0xa8e6('0xf1')](_0x21a0d9);}})[_0xa8e6('0x16')](function(_0x3be0ed){if(_0x3be0ed){_0x1c60e9=_0x3be0ed[_0xa8e6('0x50')];if(!_0xa3409[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x21a0d9['limit']=qs[_0xa8e6('0x23')](_0xa3409['query'][_0xa8e6('0x23')]);_0x21a0d9[_0xa8e6('0x21')]=qs['offset'](_0xa3409[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x115045[_0xa8e6('0xf1')](_0x21a0d9);}})['then'](function(_0x1740b6){if(_0x1740b6){return _0x1740b6?{'count':_0x1c60e9,'rows':_0x1740b6}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x4bed11,null))[_0xa8e6('0x1e')](handleError(_0x4bed11,null));};exports['login']=function(_0x584a11,_0x371c14,_0x1edb10){var _0x45c490;var _0x546a09;var _0x48ba62;var _0x579c0d=!_[_0xa8e6('0x6d')](_0x584a11['params']['id'])?_0x584a11['params']['id']:!_[_0xa8e6('0x6d')](_0x584a11[_0xa8e6('0x2e')]['id'])?_0x584a11[_0xa8e6('0x2e')]['id']:null;return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x579c0d,'role':{'$or':['admin',_0xa8e6('0x2e'),_0xa8e6('0x30')]}},'attributes':['id',_0xa8e6('0x37'),'phone',_0xa8e6('0xf3'),_0xa8e6('0x2b'),_0xa8e6('0x68'),'loginInPause']})[_0xa8e6('0x16')](function(_0x2b2694){if(_0x2b2694){if(_0x2b2694[_0xa8e6('0x2b')]===_0xa8e6('0x30')){_0x45c490=_0x2b2694;if(_0x584a11[_0xa8e6('0x62')]['interface']){_0x48ba62=util[_0xa8e6('0xb1')](_0xa8e6('0xf4'),_0x45c490[_0x584a11['body'][_0xa8e6('0xa6')]]);}else if(_0x584a11[_0xa8e6('0x62')][_0xa8e6('0xf5')]){_0x48ba62=util[_0xa8e6('0xb1')](_0xa8e6('0xb2'),_0x584a11[_0xa8e6('0x62')][_0xa8e6('0xf5')]);}else{_0x48ba62=util[_0xa8e6('0xb1')](_0xa8e6('0xb2'),_0x45c490[_0xa8e6('0x37')]);}socket['to'](util[_0xa8e6('0xb1')]('user:%s',_0x45c490['name']))[_0xa8e6('0x28')](_0xa8e6('0xf6'),{'user':{'id':_0x45c490['id'],'name':_0x45c490[_0xa8e6('0x37')]},'ip':_0x584a11[_0xa8e6('0xf7')][_0xa8e6('0xf8')]||_0x584a11[_0xa8e6('0xf9')][_0xa8e6('0xfa')]||_0x584a11[_0xa8e6('0xfb')][_0xa8e6('0xfa')]||_0x584a11[_0xa8e6('0xf9')][_0xa8e6('0xfb')][_0xa8e6('0xfa')]});return db['UserVoiceQueueRt'][_0xa8e6('0x39')]({'where':{'membername':_0x45c490[_0xa8e6('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xa8e6('0x96'))]['ValidationError'](_0xa8e6('0xfc'));}})[_0xa8e6('0x16')](function(){if(_0x45c490){return _0x45c490['getVoiceQueues']({'raw':!![]});}})[_0xa8e6('0x16')](function(_0x277471){if(_0x45c490){if(_0x277471){_0x546a09=_0x277471;if(_0x546a09['length']){var _0x513834=_0x546a09[_0xa8e6('0x34')](function(_0x12a03a){var _0x40f130={'membername':_0x45c490['name'],'UserId':_0x45c490['id'],'queue_name':_0x12a03a['name'],'VoiceQueueId':_0x12a03a['id'],'interface':_0x48ba62,'paused':_0x45c490[_0xa8e6('0xa4')]||![],'penalty':_0x12a03a[_0xa8e6('0xfd')]||0x0};return db[_0xa8e6('0xb4')][_0xa8e6('0xb5')](_0x40f130);});return Promise['all'](_0x513834);}}}})['then'](function(){if(_0x45c490){return db[_0xa8e6('0xfe')][_0xa8e6('0x4e')]({'where':{'membername':_0x45c490[_0xa8e6('0x37')],'exitAt':null}});}})[_0xa8e6('0x16')](function(_0x498ae5){if(_0x45c490){var _0x2fef0d=[];_0x498ae5[_0xa8e6('0xff')](function(_0x154c48){_0x2fef0d[_0xa8e6('0x4d')](_0x154c48[_0xa8e6('0x27')]({'exitAt':moment()[_0xa8e6('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xa8e6('0x61')](_0x2fef0d);}})[_0xa8e6('0x16')](function(){if(_0x45c490){var _0x306fa4=[];var _0x437165=[];var _0x39631d=utils[_0xa8e6('0x100')]();var _0x45453c={'membername':_0x45c490['name'],'interface':_0x48ba62,'enterAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101')),'role':_0x45c490['role'],'internal':_0x45c490['internal']};_0x39631d['forEach'](function(_0x8eb36e){_0x306fa4['push'](_[_0xa8e6('0x5e')]({'channel':_0x8eb36e,'type':_0xa8e6('0x102'),'data1':_0x584a11[_0xa8e6('0x62')][_0xa8e6('0x103')],'data2':_0x48ba62},_0x45453c));if(_0x45c490[_0xa8e6('0xa4')]){_0x437165[_0xa8e6('0x4d')](_[_0xa8e6('0x5e')]({'channel':_0x8eb36e,'type':_0xa8e6('0x104'),'data1':_0xa8e6('0x105')},_0x45453c));}});return db[_0xa8e6('0xfe')][_0xa8e6('0x8d')](_0x306fa4[_0xa8e6('0xd1')](_0x437165),{'individualHooks':!![]});}})[_0xa8e6('0x16')](function(){if(_0x45c490){return _0x45c490[_0xa8e6('0x27')]({'online':!![],'lastLoginAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101')),'voicePause':_0x45c490[_0xa8e6('0xa4')]||![],'mailPause':_0x45c490[_0xa8e6('0xa4')]||![],'chatPause':_0x45c490[_0xa8e6('0xa4')]||![],'faxPause':_0x45c490[_0xa8e6('0xa4')]||![],'smsPause':_0x45c490[_0xa8e6('0xa4')]||![],'openchannelPause':_0x45c490[_0xa8e6('0xa4')]||![],'whatsappPause':_0x45c490[_0xa8e6('0xa4')]||![],'pauseType':_0x45c490['loginInPause']?_0xa8e6('0x105'):null,'interface':_0x48ba62,'lastPauseAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'))});}})[_0xa8e6('0x16')](function(_0x262239){if(_0x584a11[_0xa8e6('0x106')]){return _0x1edb10();}else{return Promise['resolve'](_0x262239)[_0xa8e6('0x16')](respondWithResult(_0x371c14,null));}})[_0xa8e6('0x1e')](handleError(_0x371c14,null));};exports['logout']=function(_0x4a591f,_0x2025c0){var _0x2d8f83;return db[_0xa8e6('0x46')]['find']({'where':{'id':_0x4a591f[_0xa8e6('0x63')]['id'],'role':_0xa8e6('0x30')},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b')]})[_0xa8e6('0x16')](handleEntityNotFound(_0x2025c0,null))['then'](function(_0xc0f16e){if(_0xc0f16e){_0x2d8f83=_0xc0f16e;return db[_0xa8e6('0xb4')][_0xa8e6('0x39')]({'where':{'membername':_0x2d8f83['name']},'individualHooks':!![]});}})[_0xa8e6('0x16')](function(){return db[_0xa8e6('0xfe')][_0xa8e6('0x4e')]({'where':{'membername':_0x2d8f83[_0xa8e6('0x37')],'exitAt':null}});})[_0xa8e6('0x16')](function(_0xb7b279){var _0xf8c009=[];_0xb7b279[_0xa8e6('0xff')](function(_0x3a69c7){_0xf8c009[_0xa8e6('0x4d')](_0x3a69c7[_0xa8e6('0x27')]({'exitAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'))}));});return Promise[_0xa8e6('0x61')](_0xf8c009);})['then'](function(){return _0x2d8f83[_0xa8e6('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa8e6('0x16')](respondWithResult(_0x2025c0,null))[_0xa8e6('0x1e')](handleError(_0x2025c0,null));};exports[_0xa8e6('0x107')]=function(_0x512e74,_0x24a9a5){var _0x23ec35;return db[_0xa8e6('0xb4')][_0xa8e6('0x27')]({'paused':0x1},{'where':{'UserId':_0x512e74['params']['id']},'individualHooks':!![]})[_0xa8e6('0x16')](function(){return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x512e74['params']['id'],'role':_0xa8e6('0x30')},'attributes':['id','name',_0xa8e6('0x2b'),_0xa8e6('0x68'),_0xa8e6('0xa6'),'online']});})[_0xa8e6('0x16')](handleEntityNotFound(_0x24a9a5,null))[_0xa8e6('0x16')](function(_0x582d8e){if(_0x582d8e){_0x23ec35=_0x582d8e;return respondWithRpcPromise('QueuePause',_0xa8e6('0x107'),{'id':_0x23ec35['id'],'name':_0x23ec35['name'],'pause':!![]});}})['then'](function(){if(_0x23ec35){return db[_0xa8e6('0xfe')][_0xa8e6('0x4e')]({'where':{'membername':_0x23ec35[_0xa8e6('0x37')],'type':_0xa8e6('0x104'),'exitAt':null}});}})[_0xa8e6('0x16')](function(_0x2d80b8){if(_0x2d80b8['length']){var _0x206574=moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'));for(var _0x53c9d9=0x0,_0x4210aa=_0x2d80b8[_0xa8e6('0x50')];_0x53c9d9<_0x4210aa;_0x53c9d9++){_0x2d80b8[_0x53c9d9][_0xa8e6('0x108')]({'exitAt':_0x206574});}}})[_0xa8e6('0x16')](function(){var _0x3dfaad=[];var _0x1eed42=utils[_0xa8e6('0x100')]();_0x1eed42['forEach'](function(_0x16590b){_0x3dfaad[_0xa8e6('0x4d')]({'channel':_0x16590b,'membername':_0x23ec35[_0xa8e6('0x37')],'interface':_[_0xa8e6('0x6d')](_0x23ec35[_0xa8e6('0xa6')])?util[_0xa8e6('0xb1')]('SIP/%s',_0x23ec35['name']):_0x23ec35[_0xa8e6('0xa6')],'type':'PAUSE','enterAt':moment()['format'](_0xa8e6('0x101')),'data1':_0x512e74[_0xa8e6('0x62')][_0xa8e6('0x40')]||_0xa8e6('0x109'),'role':_0x23ec35['role'],'internal':_0x23ec35[_0xa8e6('0x68')]});});return db[_0xa8e6('0xfe')][_0xa8e6('0x8d')](_0x3dfaad,{'individualHooks':!![]});})[_0xa8e6('0x16')](function(){return _0x23ec35[_0xa8e6('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x512e74[_0xa8e6('0x62')][_0xa8e6('0x40')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xa8e6('0xb1')](_0xa8e6('0x101'))});})[_0xa8e6('0x16')](respondWithResult(_0x24a9a5,null))['catch'](handleError(_0x24a9a5,null));};exports[_0xa8e6('0x10a')]=function(_0x514658,_0x257d7d){if(_0x514658['body'][_0xa8e6('0xa2')]&&!utils[_0xa8e6('0xa7')](_0x514658[_0xa8e6('0x62')]['channel'])){throw new APIBadRequestError(util[_0xa8e6('0xb1')](_0xa8e6('0x10b'),_0x514658[_0xa8e6('0x62')][_0xa8e6('0xa2')]));}return db[_0xa8e6('0x46')][_0xa8e6('0x60')]({'where':{'id':_0x514658[_0xa8e6('0x63')]['id']},'attributes':['id',_0xa8e6('0x37'),_0xa8e6('0x2b'),_0xa8e6('0x68'),'interface',_0xa8e6('0xa3'),_0xa8e6('0xa5'),'mailPause',_0xa8e6('0x10c'),_0xa8e6('0x10d'),_0xa8e6('0x10e'),_0xa8e6('0x10f'),_0xa8e6('0x110'),'pauseType',_0xa8e6('0x111')]})[_0xa8e6('0x16')](function(_0x54df7e){if(!_0x54df7e){throw new APINotFoundError(util[_0xa8e6('0xb1')](_0xa8e6('0x112'),_0x514658[_0xa8e6('0x63')]['id']));}return _0x54df7e['unpause'](_0x514658[_0xa8e6('0x62')][_0xa8e6('0xa2')]);})[_0xa8e6('0x16')](respondWithResult(_0x257d7d,null))[_0xa8e6('0x1e')](APIHandleError(_0x257d7d));};exports[_0xa8e6('0x113')]=function(_0x2e3fa7,_0x3418a8){var _0x48cb80={};var _0x309463={};var _0x2e6291;var _0x358a8b;return db[_0xa8e6('0x46')]['findOne']({'where':{'id':_0x2e3fa7[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x3418a8,null))[_0xa8e6('0x16')](function(_0xe5c20b){if(_0xe5c20b){_0x2e6291=_0xe5c20b;_0x309463[_0xa8e6('0x5b')]=_['keys'](db[_0xa8e6('0x114')]['rawAttributes']);_0x309463['query']=_[_0xa8e6('0x58')](_0x2e3fa7[_0xa8e6('0x47')]);_0x309463[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x309463[_0xa8e6('0x5b')],_0x309463[_0xa8e6('0x47')]);_0x48cb80[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x309463['model'],qs[_0xa8e6('0x5c')](_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x48cb80[_0xa8e6('0x4c')]=_0x48cb80[_0xa8e6('0x4c')]['length']?_0x48cb80['attributes']:_0x309463[_0xa8e6('0x5b')];_0x48cb80['order']=qs['sort'](_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x48cb80[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x2e3fa7['query'],_0x309463[_0xa8e6('0x59')]));if(_0x2e3fa7['query'][_0xa8e6('0x33')]){_0x48cb80[_0xa8e6('0x45')]=_[_0xa8e6('0x5e')](_0x48cb80['where'],{'$or':_[_0xa8e6('0x34')](_0x48cb80['attributes'],function(_0x5ddbaf){var _0x1a7663={};_0x1a7663[_0x5ddbaf]={'$like':'%'+_0x2e3fa7[_0xa8e6('0x47')]['filter']+'%'};return _0x1a7663;})});}_0x48cb80=_['merge']({},_0x48cb80,_0x2e3fa7[_0xa8e6('0x5f')]);return _0x2e6291['getTeams'](_0x48cb80);}})['then'](function(_0x6d2c19){if(_0x6d2c19){_0x358a8b=_0x6d2c19[_0xa8e6('0x50')];if(!_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x48cb80[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x2e3fa7[_0xa8e6('0x47')]['limit']);_0x48cb80[_0xa8e6('0x21')]=qs[_0xa8e6('0x21')](_0x2e3fa7[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x2e6291[_0xa8e6('0x113')](_0x48cb80);}})['then'](function(_0x4ce64c){if(_0x4ce64c){return _0x4ce64c?{'count':_0x358a8b,'rows':_0x4ce64c}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x3418a8,null))[_0xa8e6('0x1e')](handleError(_0x3418a8,null));};exports[_0xa8e6('0x115')]=function(_0x3348d2,_0xdcf4d4){var _0x1ff07f=_0x3348d2[_0xa8e6('0x63')]['id'];var _0x4312d8=_0x3348d2[_0xa8e6('0x62')]?_0x3348d2[_0xa8e6('0x62')]['ids']:null;var _0x1584eb=[];return Promise[_0xa8e6('0x116')]()[_0xa8e6('0x16')](function(){if(!_0x4312d8)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xa8e6('0x16')](function(){return db['User'][_0xa8e6('0x9c')]({'where':{'id':_0x1ff07f}});})['then'](function(_0x545caa){if(!_0x545caa)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x3348d2[_0xa8e6('0x63')]['id']));return db[_0xa8e6('0x6f')][_0xa8e6('0x117')](function(_0x379377){return _0x545caa[_0xa8e6('0x115')](_0x4312d8,{'transaction':_0x379377})['then'](function(){return db[_0xa8e6('0x114')][_0xa8e6('0x4e')]({'where':{'id':{'$in':_0x4312d8}}});})[_0xa8e6('0x16')](function(_0x4d0782){var _0x3f1cb0=_[_0xa8e6('0x34')](_0x4d0782,function(_0x320d75){return _0x320d75[_0xa8e6('0x118')]();});return Promise[_0xa8e6('0x61')](_0x3f1cb0);})[_0xa8e6('0x16')](function(_0x3765b9){_0x1584eb=_[_0xa8e6('0x119')](_0x3765b9);var _0xc28feb=_[_0xa8e6('0x34')](_0x1584eb,function(_0x4b0ed1){return _0x4b0ed1[_0xa8e6('0x11a')](_0x545caa['id'],{'transaction':_0x379377});});return Promise[_0xa8e6('0x61')](_0xc28feb);})[_0xa8e6('0x16')](function(){if(!_0x545caa['online'])return;var _0x24282e=_[_0xa8e6('0x33')](_0x1584eb,function(_0x19cc6e){return _0x19cc6e['getDataValue'](_0xa8e6('0xa2'))===_0xa8e6('0x11b');});var _0x44b08f=_[_0xa8e6('0x34')](_0x24282e,function(_0x5ad792){return db[_0xa8e6('0xb4')][_0xa8e6('0xb5')]({'membername':_0x545caa[_0xa8e6('0x37')],'UserId':_0x545caa['id'],'queue_name':_0x5ad792[_0xa8e6('0x37')],'VoiceQueueId':_0x5ad792['id'],'interface':_[_0xa8e6('0x6d')](_0x545caa[_0xa8e6('0xa6')])?util[_0xa8e6('0xb1')]('SIP/%s',_0x545caa[_0xa8e6('0x37')]):_0x545caa[_0xa8e6('0xa6')],'paused':_0x545caa[_0xa8e6('0xa5')]||![],'penalty':_0x545caa[_0xa8e6('0xb3')]},{'transaction':_0x379377});});return Promise[_0xa8e6('0x61')](_0x44b08f);})['then'](function(){return db[_0xa8e6('0x11c')][_0xa8e6('0x4e')]({'where':{'teamId':{'$in':_0x4312d8}}});})['then'](function(_0x546782){var _0x36daaf=_[_0xa8e6('0x34')](_0x546782,function(_0x217740){return db[_0xa8e6('0x11d')][_0xa8e6('0x89')]({'UserId':_0x545caa['id'],'VoicePrefixId':_0x217740[_0xa8e6('0x11e')]},{'transaction':_0x379377});});return Promise[_0xa8e6('0x61')](_0x36daaf);});});})[_0xa8e6('0x16')](function(){for(var _0x4234f0=0x0;_0x4234f0<_0x1584eb[_0xa8e6('0x50')];_0x4234f0++){var _0x360926=_0x1584eb[_0x4234f0][_0xa8e6('0x11f')]('channel');var _0x169229=_0x360926+_0xa8e6('0xad');socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_0x360926+_0xa8e6('0xae'),{'UserId':_0x1ff07f,['queueField']:_0x1584eb[_0x4234f0]['id']});}})[_0xa8e6('0x16')](respondWithStatusCode(_0xdcf4d4,null))[_0xa8e6('0x1e')](APIHandleError(_0xdcf4d4));};exports[_0xa8e6('0x120')]=function(_0x5cf8ea,_0x584a81){var _0x344190=_0x5cf8ea[_0xa8e6('0x63')]['id'];var _0x4e358a=null;if(_0x5cf8ea['query'][_0xa8e6('0x67')]){_0x4e358a=_[_0xa8e6('0xb9')](_0x5cf8ea[_0xa8e6('0x47')][_0xa8e6('0x67')])?_0x5cf8ea['query'][_0xa8e6('0x67')]:[_0x5cf8ea[_0xa8e6('0x47')][_0xa8e6('0x67')]];}var _0x1046b6=[];return Promise[_0xa8e6('0x116')]()['then'](function(){if(!_0x4e358a)throw new APIBadRequestError(_0xa8e6('0x121'));})[_0xa8e6('0x16')](function(){return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x344190}});})[_0xa8e6('0x16')](function(_0x485df9){if(!_0x485df9)throw new APINotFoundError(util[_0xa8e6('0xb1')](_0xa8e6('0x112'),_0x5cf8ea[_0xa8e6('0x63')]['id']));return db[_0xa8e6('0x6f')][_0xa8e6('0x117')](function(_0x4af6bd){return _0x485df9[_0xa8e6('0x120')](_0x4e358a,{'transaction':_0x4af6bd})['then'](function(){return db[_0xa8e6('0x114')]['findAll']({'where':{'id':{'$in':_0x4e358a}}});})['then'](function(_0x43f51e){var _0x52e962=_[_0xa8e6('0x34')](_0x43f51e,function(_0x47c414){return _0x47c414['getAssociatedQueues']();});return Promise[_0xa8e6('0x61')](_0x52e962);})[_0xa8e6('0x16')](function(_0x3eba73){_0x1046b6=_[_0xa8e6('0x119')](_0x3eba73);var _0x145e9b=_[_0xa8e6('0x34')](_0x1046b6,function(_0x1974c0){return _0x1974c0[_0xa8e6('0x122')](_0x485df9['id'],{'transaction':_0x4af6bd});});return Promise['all'](_0x145e9b);})[_0xa8e6('0x16')](function(){if(!_0x485df9[_0xa8e6('0xa3')])return;var _0x37f2bb=_['filter'](_0x1046b6,function(_0x2466f9){return _0x2466f9[_0xa8e6('0x11f')](_0xa8e6('0xa2'))===_0xa8e6('0x11b');});var _0x4a88ef=_[_0xa8e6('0x34')](_0x37f2bb,function(_0x500890){return db[_0xa8e6('0xb4')]['destroy']({'where':{'VoiceQueueId':_0x500890['id'],'UserId':_0x485df9['id']},'transaction':_0x4af6bd});});return Promise[_0xa8e6('0x61')](_0x4a88ef);})[_0xa8e6('0x16')](function(){return db['TeamVoicePrefix'][_0xa8e6('0x4e')]({'where':{'teamId':{'$in':_0x4e358a}}});})[_0xa8e6('0x16')](function(_0x5541c0){var _0x42f2a9=_[_0xa8e6('0x34')](_0x5541c0,function(_0x3ed446){return db['UserVoicePrefix'][_0xa8e6('0x39')]({'where':{'UserId':_0x485df9['id'],'VoicePrefixId':_0x3ed446[_0xa8e6('0x11e')]}},{'transaction':_0x4af6bd});});return Promise[_0xa8e6('0x61')](_0x42f2a9);});});})[_0xa8e6('0x16')](function(){for(var _0xbb2969=0x0;_0xbb2969<_0x1046b6[_0xa8e6('0x50')];_0xbb2969++){var _0x7a31=_0x1046b6[_0xbb2969][_0xa8e6('0x11f')](_0xa8e6('0xa2'));var _0x3fc647=_0x7a31+_0xa8e6('0xad');socket[_0xa8e6('0x28')](_0xa8e6('0x2e')+_0x7a31+'Queue:remove',{'UserId':_0x344190,['queueField']:_0x1046b6[_0xbb2969]['id']});}})['then'](respondWithStatusCode(_0x584a81,null))[_0xa8e6('0x1e')](APIHandleError(_0x584a81));};exports[_0xa8e6('0x123')]=function(_0x6235b2,_0x525ec7){var _0x40bfd2={};var _0x3ea49e={};var _0x3d2b79;var _0x4b7a08;return db[_0xa8e6('0x46')][_0xa8e6('0x9c')]({'where':{'id':_0x6235b2[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x525ec7,null))[_0xa8e6('0x16')](function(_0x28fd5e){if(_0x28fd5e){_0x3d2b79=_0x28fd5e;_0x3ea49e[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db['CmList'][_0xa8e6('0x3e')]);_0x3ea49e[_0xa8e6('0x47')]=_['keys'](_0x6235b2['query']);_0x3ea49e[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x3ea49e[_0xa8e6('0x5b')],_0x3ea49e[_0xa8e6('0x47')]);_0x40bfd2['attributes']=_[_0xa8e6('0x5a')](_0x3ea49e['model'],qs[_0xa8e6('0x5c')](_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0x5c')]));_0x40bfd2[_0xa8e6('0x4c')]=_0x40bfd2[_0xa8e6('0x4c')][_0xa8e6('0x50')]?_0x40bfd2[_0xa8e6('0x4c')]:_0x3ea49e[_0xa8e6('0x5b')];_0x40bfd2[_0xa8e6('0xde')]=qs[_0xa8e6('0xd4')](_0x6235b2[_0xa8e6('0x47')]['sort']);_0x40bfd2[_0xa8e6('0x45')]=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0x6235b2['query'],_0x3ea49e[_0xa8e6('0x59')]));if(_0x6235b2['query'][_0xa8e6('0x33')]){_0x40bfd2['where']=_[_0xa8e6('0x5e')](_0x40bfd2[_0xa8e6('0x45')],{'$or':_[_0xa8e6('0x34')](_0x40bfd2['attributes'],function(_0x626a88){var _0x28294d={};_0x28294d[_0x626a88]={'$like':'%'+_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0x33')]+'%'};return _0x28294d;})});}_0x40bfd2=_[_0xa8e6('0x5e')]({},_0x40bfd2,_0x6235b2['options']);return _0x3d2b79[_0xa8e6('0x123')](_0x40bfd2);}})[_0xa8e6('0x16')](function(_0x32d14e){if(_0x32d14e){_0x4b7a08=_0x32d14e[_0xa8e6('0x50')];if(!_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0xe0')](_0xa8e6('0xdb'))){_0x40bfd2[_0xa8e6('0x23')]=qs[_0xa8e6('0x23')](_0x6235b2[_0xa8e6('0x47')]['limit']);_0x40bfd2['offset']=qs[_0xa8e6('0x21')](_0x6235b2[_0xa8e6('0x47')][_0xa8e6('0x21')]);}return _0x3d2b79['getLists'](_0x40bfd2);}})[_0xa8e6('0x16')](function(_0x200afb){if(_0x200afb){return _0x200afb?{'count':_0x4b7a08,'rows':_0x200afb}:null;}})[_0xa8e6('0x16')](respondWithResult(_0x525ec7,null))[_0xa8e6('0x1e')](handleError(_0x525ec7,null));};exports[_0xa8e6('0x124')]=function(_0xf14ec3,_0x1bc6e4){var _0x40a553={};var _0x1446cc={};var _0x4e64e2;return db['User']['findOne']({'where':{'id':_0xf14ec3[_0xa8e6('0x63')]['id']}})[_0xa8e6('0x16')](handleEntityNotFound(_0x1bc6e4,null))[_0xa8e6('0x16')](function(_0x209c63){if(_0x209c63){_0x4e64e2=_0x209c63;_0x1446cc[_0xa8e6('0x5b')]=_[_0xa8e6('0x58')](db['User'][_0xa8e6('0x3e')]);_0x1446cc['query']=_[_0xa8e6('0x58')](_0xf14ec3[_0xa8e6('0x47')]);_0x1446cc[_0xa8e6('0x59')]=_[_0xa8e6('0x5a')](_0x1446cc['model'],_0x1446cc[_0xa8e6('0x47')]);_0x40a553[_0xa8e6('0x4c')]=_[_0xa8e6('0x5a')](_0x1446cc[_0xa8e6('0x5b')],qs[_0xa8e6('0x5c')](_0xf14ec3['query'][_0xa8e6('0x5c')]));_0x40a553[_0xa8e6('0x4c')]=_0x40a553['attributes'][_0xa8e6('0x50')]?_0x40a553['attributes']:_0x1446cc[_0xa8e6('0x5b')];_0x40a553[_0xa8e6('0xde')]=qs['sort'](_0xf14ec3[_0xa8e6('0x47')][_0xa8e6('0xd4')]);_0x40a553['where']=qs[_0xa8e6('0x59')](_[_0xa8e6('0xd5')](_0xf14ec3[_0xa8e6('0x47')],_0x1446cc[_0xa8e6('0x59')]));if(_0xf14ec3[_0xa8e6('0x47')][_0xa8e6('0x33')]){_0x40a553[_0xa8e6('0x45')]=_['merge'](_0x40a553[_0xa8e6('0x45')],{'$or':_['map'](_0x40a553[_0xa8e6('0x4c')],function(_0x3efee0){var _0x1a5c40={};_0x1a5c40[_0x3efee0]={'$like':'%'+_0xf14ec3['query'][_0xa8e6('0x33')]+'%'};return _0x1a5c40;})});}_0x40a553[_0xa8e6('0x5b')]=db['User'];_0x40a553['as']='Agents';_0x40a553=_[_0xa8e6('0x5e')]({},_0x40a553,_0xf14ec3[_0xa8e6('0x5f')]);return _0x4e64e2[_0xa8e6('0x125')]({'include':[_0x40a553]});}})[_0xa8e6('0x16')](function(_0x59b881){if(_0x59b881){var _0x28429a={},_0x32812e=[];for(var _0x2d0138=0x0;_0x2d0138<_0x59b881['length'];_0x2d0138+=0x1){for(var _0x150b64=0x0,_0x23a4c0;_0x150b64<_0x59b881[_0x2d0138][_0xa8e6('0x2f')][_0xa8e6('0x50')];_0x150b64+=0x1){_0x23a4c0=_0x59b881[_0x2d0138][_0xa8e6('0x2f')][_0x150b64][_0xa8e6('0x2a')]({'plain':!![]});_0x28429a[_0x23a4c0['id']]=_0x23a4c0;}}_0x28429a=_[_0xa8e6('0x126')](_0x28429a);for(var _0x420f1b=qs[_0xa8e6('0x21')](_0xf14ec3[_0xa8e6('0x47')][_0xa8e6('0x21')]);_0x420f1b<_0x28429a['length']&&_0x32812e['length']=_0xa8c746){_0x38543d=_0xa8c746;_0x2b27f4=0xc8;}else{_0x2b27f4=0xce;}_0x159302[_0x3920('0x1f')](_0x2b27f4);return _0x159302[_0x3920('0x26')](_0x3920('0x27'),_0x3dba17+'-'+_0x38543d+'/'+_0xa8c746)[_0x3920('0x21')](_0x21556f);}return null;};}function saveUpdates(_0x23b97e){return function(_0x333f60){if(_0x333f60){return _0x333f60['update'](_0x23b97e)[_0x3920('0x14')](function(_0x360fe7){socket[_0x3920('0x28')](_0x3920('0x29')+_0x360fe7['id'],{});return _0x360fe7;});}return null;};}function removeEntity(_0x2752f5){return function(_0x32e7b4){if(_0x32e7b4){return _0x32e7b4[_0x3920('0x2a')]()[_0x3920('0x14')](function(){var _0xea3a66=_0x32e7b4[_0x3920('0x2b')]({'plain':!![]});if(_0xea3a66[_0x3920('0x2c')]===_0x3920('0x2d'))return;var _0x32f6fd=[{'name':'Users','value':_0x3920('0x2e'),'ignore':!![]},{'name':'Agents','value':_0x3920('0x2f'),'ignore':![]},{'name':_0x3920('0x30'),'value':'telephone','ignore':![]}];var _0x2fd734=_(_0x32f6fd)[_0x3920('0x31')](_0x3920('0x32'))[_0x3920('0x33')](_0x3920('0x34'))[_0x3920('0x34')]();if(_[_0x3920('0x35')](_0x2fd734,_0xea3a66[_0x3920('0x2c')])){return;}var _0x1de447=_[_0x3920('0x36')](_0x32f6fd,[_0x3920('0x34'),_0xea3a66['role']])[_0x3920('0x37')];return db['UserProfileResource'][_0x3920('0x2a')]({'where':{'type':_0x1de447,'resourceId':_0xea3a66['id']}})[_0x3920('0x14')](function(){return _0x32e7b4;});})[_0x3920('0x14')](function(){_0x2752f5[_0x3920('0x1f')](0xcc)[_0x3920('0x20')]();});}};}function handleEntityNotFound(_0x2f563b){return function(_0x182a12){if(!_0x182a12){_0x2f563b[_0x3920('0x1e')](0x194);}return _0x182a12;};}function handleError(_0x3d05d7,_0x37145f){_0x37145f=_0x37145f||0x1f4;return function(_0xa4533e){logger['error'](_0xa4533e['stack']);if(_0xa4533e[_0x3920('0x37')]){delete _0xa4533e['name'];}_0x3d05d7[_0x3920('0x1f')](_0x37145f)[_0x3920('0x38')](_0xa4533e);};}exports[_0x3920('0x39')]=function(_0x11ac4f,_0x49e939){var _0x1f4aa7={},_0x679979={'count':0x0,'rows':[]};var _0x5299fd=_(db[_0x3920('0x3a')]['rawAttributes'])[_0x3920('0x33')](function(_0x2a6e11){return{'name':_0x2a6e11[_0x3920('0x3b')],'type':_0x2a6e11[_0x3920('0x3c')][_0x3920('0x3d')]};})[_0x3920('0x31')](function(_0x313003){return!_[_0x3920('0x35')]([_0x3920('0x3e'),_0x3920('0x3f')],_0x313003[_0x3920('0x37')]);})[_0x3920('0x34')]();_0x1f4aa7=qs[_0x3920('0x40')](_0x5299fd,_0x11ac4f);var _0x3009e5={'where':_0x1f4aa7['where']};return db[_0x3920('0x3a')][_0x3920('0x24')](_0x3009e5)[_0x3920('0x14')](function(_0x4e7602){_0x679979[_0x3920('0x24')]=_0x4e7602;if(_0x11ac4f[_0x3920('0x41')]['includeAll']){_0x1f4aa7['include']=[{'all':!![]}];}if(_0x11ac4f[_0x3920('0x41')][_0x3920('0x42')]===_0x3920('0x43')){_0x1f4aa7[_0x3920('0x44')]=[{'model':db[_0x3920('0x45')],'as':_0x3920('0x42')}];}if(!_[_0x3920('0x35')](_0x1f4aa7['attributes'],'id')){_0x1f4aa7[_0x3920('0x46')][_0x3920('0x47')]('id');}return db['User'][_0x3920('0x48')](_0x1f4aa7);})[_0x3920('0x14')](function(_0x4d36d7){_0x679979[_0x3920('0x49')]=_0x4d36d7;if(_0x11ac4f[_0x3920('0x41')]['openTabs']===_0x3920('0x43')){var _0x4797cf=[];for(var _0x2572ce=0x0;_0x2572ce<_0x679979['rows'][_0x3920('0x4a')];_0x2572ce++){_0x4797cf[_0x3920('0x47')](get_open_tabs(_0x3920('0x4b'),_0x679979[_0x3920('0x49')][_0x2572ce][_0x3920('0x4c')]));_0x4797cf[_0x3920('0x47')](get_open_tabs(_0x3920('0x4d'),_0x679979['rows'][_0x2572ce][_0x3920('0x4c')]));_0x4797cf[_0x3920('0x47')](get_open_tabs('fax',_0x679979['rows'][_0x2572ce][_0x3920('0x4c')]));_0x4797cf[_0x3920('0x47')](get_open_tabs(_0x3920('0x4e'),_0x679979['rows'][_0x2572ce][_0x3920('0x4c')]));_0x4797cf[_0x3920('0x47')](get_open_tabs(_0x3920('0x4f'),_0x679979['rows'][_0x2572ce][_0x3920('0x4c')]));_0x4797cf[_0x3920('0x47')](get_open_tabs(_0x3920('0x50'),_0x679979['rows'][_0x2572ce][_0x3920('0x4c')]));}return Promise[_0x3920('0x51')](_0x4797cf)['then'](function(){return _0x679979;});}else{return _0x679979;}})[_0x3920('0x14')](respondWithFilteredResult(_0x49e939,_0x1f4aa7))[_0x3920('0x52')](handleError(_0x49e939,null));};exports[_0x3920('0x53')]=function(_0x2f2508,_0x6520b1){var _0x4ad4db={'raw':![],'where':{'id':_0x2f2508[_0x3920('0x54')]['id']}},_0x2ea542={};_0x2ea542[_0x3920('0x55')]=_[_0x3920('0x56')](_[_0x3920('0x57')](db[_0x3920('0x3a')][_0x3920('0x58')]),[_0x3920('0x3e'),'salt']);_0x2ea542[_0x3920('0x41')]=_[_0x3920('0x57')](_0x2f2508[_0x3920('0x41')]);_0x2ea542[_0x3920('0x59')]=_['intersection'](_0x2ea542[_0x3920('0x55')],_0x2ea542[_0x3920('0x41')]);_0x4ad4db['attributes']=_[_0x3920('0x5a')](_0x2ea542[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x2f2508[_0x3920('0x41')][_0x3920('0x5b')]));_0x4ad4db[_0x3920('0x46')]=_0x4ad4db[_0x3920('0x46')][_0x3920('0x4a')]?_0x4ad4db[_0x3920('0x46')]:_0x2ea542[_0x3920('0x55')];if(_0x2f2508[_0x3920('0x41')]['includeAll']){_0x4ad4db[_0x3920('0x44')]=[{'all':!![]}];}if(_0x2f2508['query'][_0x3920('0x42')]===_0x3920('0x43')){_0x4ad4db[_0x3920('0x44')]=[{'model':db[_0x3920('0x45')],'as':_0x3920('0x42')}];}_0x4ad4db=_[_0x3920('0x5c')]({},_0x4ad4db,_0x2f2508[_0x3920('0x5d')]);if(!_[_0x3920('0x35')](_0x4ad4db[_0x3920('0x46')],'id')){_0x4ad4db[_0x3920('0x46')][_0x3920('0x47')]('id');}return db[_0x3920('0x3a')][_0x3920('0x36')](_0x4ad4db)['then'](handleEntityNotFound(_0x6520b1,null))['then'](function(_0x52ccc1){var _0xff0f45=[];values=_0x52ccc1;if(_0x2f2508[_0x3920('0x41')][_0x3920('0x5e')]==='true'){_0xff0f45['push'](get_open_tabs(_0x3920('0x4b'),_0x52ccc1[_0x3920('0x4c')]));_0xff0f45[_0x3920('0x47')](get_open_tabs(_0x3920('0x4d'),_0x52ccc1[_0x3920('0x4c')]));_0xff0f45[_0x3920('0x47')](get_open_tabs(_0x3920('0x4f'),_0x52ccc1['dataValues']));_0xff0f45['push'](get_open_tabs(_0x3920('0x50'),_0x52ccc1['dataValues']));_0xff0f45[_0x3920('0x47')](get_open_tabs(_0x3920('0x5f'),_0x52ccc1[_0x3920('0x4c')]));_0xff0f45[_0x3920('0x47')](get_open_tabs(_0x3920('0x4e'),_0x52ccc1[_0x3920('0x4c')]));return Promise[_0x3920('0x51')](_0xff0f45);}else{return values;}})[_0x3920('0x14')](function(){return values;})[_0x3920('0x14')](respondWithResult(_0x6520b1,null))[_0x3920('0x52')](handleError(_0x6520b1,null));};exports[_0x3920('0x60')]=function(_0x1707ed,_0x5bc48c){if(_0x1707ed[_0x3920('0x61')]['id']){delete _0x1707ed['body']['id'];}delete _0x1707ed[_0x3920('0x61')][_0x3920('0x2c')];return db[_0x3920('0x3a')]['find']({'where':{'id':_0x1707ed[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x5bc48c,null))[_0x3920('0x14')](saveUpdates(_0x1707ed[_0x3920('0x61')],null))[_0x3920('0x14')](respondWithResult(_0x5bc48c,null))[_0x3920('0x52')](handleError(_0x5bc48c,null));};exports[_0x3920('0x62')]=function(_0x2244dd,_0x234652){return db[_0x3920('0x3a')][_0x3920('0x62')]()['then'](respondWithResult(_0x234652,null))[_0x3920('0x52')](handleError(_0x234652,null));};exports['addContacts']=function(_0x17dda8,_0x165c9c){return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x17dda8[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x165c9c,null))[_0x3920('0x14')](function(_0x33df43){if(_0x33df43){return _0x33df43['addContacts'](_0x17dda8['body'][_0x3920('0x63')],_['omit'](_0x17dda8[_0x3920('0x61')],[_0x3920('0x63'),'id'])||{});}})[_0x3920('0x14')](respondWithResult(_0x165c9c,null))[_0x3920('0x52')](handleError(_0x165c9c,null));};function validateUser(_0x4adfe8){return new Promise(function(_0x50e152,_0x26a1db){if(_0x4adfe8['internal'])return _0x50e152(_0x4adfe8);return db['Setting'][_0x3920('0x64')](0x1)[_0x3920('0x14')](function(_0x39b775){if(_0x39b775[_0x3920('0x65')])authService[_0x3920('0x66')](_0x4adfe8[_0x3920('0x3e')]);db[_0x3920('0x3a')][_0x3920('0x67')]('internal')[_0x3920('0x14')](function(_0x3a3afc){if(_['isNil'](_0x3a3afc)){_0x4adfe8[_0x3920('0x68')]=_0x39b775['min_internal']||0x1;return;}if(_[_0x3920('0x69')](_0x39b775[_0x3920('0x6a')])||_0x39b775['min_internal']===_0x3a3afc){_0x4adfe8['internal']=_0x3a3afc+0x1;return;}if(_0x39b775['min_internal']>_0x3a3afc){_0x4adfe8[_0x3920('0x68')]=_0x39b775[_0x3920('0x6a')];return;}return db[_0x3920('0x6b')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x3920('0x6b')][_0x3920('0x6c')][_0x3920('0x6d')]})[_0x3920('0x14')](function(_0xf97920){if(_0xf97920&&_0xf97920['length']){for(var _0x21b31e=0x0,_0x1c79c9=_0xf97920[_0x3920('0x4a')];_0x21b31e<_0x1c79c9&&_['isNil'](_0x4adfe8['internal']);_0x21b31e++){if(_0x39b775[_0x3920('0x6a')]<=_0xf97920[_0x21b31e][_0x3920('0x6e')]){_0x4adfe8[_0x3920('0x68')]=_0xf97920[_0x21b31e][_0x3920('0x6e')];}else if(_0x39b775['min_internal']>_0xf97920[_0x21b31e][_0x3920('0x6e')]&&_0x39b775[_0x3920('0x6a')]<=_0xf97920[_0x21b31e]['to']){_0x4adfe8[_0x3920('0x68')]=_0x39b775[_0x3920('0x6a')];}}}if(_['isNil'](_0x4adfe8[_0x3920('0x68')])){_0x4adfe8[_0x3920('0x68')]=_0x3a3afc+0x1;}return _0x50e152(_0x4adfe8);});});})['catch'](function(_0x5efd81){_0x26a1db(_0x5efd81);});});}function updateUser(_0x3b40db){return new Promise(function(_0x4c4174,_0x4d2cf4){try{if(_0x3b40db[_0x3920('0x6f')]){_0x3b40db[_0x3920('0x70')]=_0x3b40db[_0x3920('0x68')];_0x3b40db[_0x3920('0x71')]={'mailbox':_0x3b40db[_0x3920('0x68')],'password':_0x3b40db[_0x3920('0x3e')],'fullname':_0x3b40db[_0x3920('0x72')],'email':_0x3b40db[_0x3920('0x73')]};}if(_0x3b40db[_0x3920('0x2c')]===_0x3920('0x2f')){if(!_0x3b40db[_0x3920('0x74')])_0x3b40db[_0x3920('0x74')]=['101',_0x3920('0x75'),_0x3920('0x76'),'113','110','104',_0x3920('0x77'),'106',_0x3920('0x78'),'108',_0x3920('0x79'),_0x3920('0x7a'),_0x3920('0x7b'),_0x3920('0x7c'),'115'];}_0x4c4174(_0x3b40db);}catch(_0x4968a9){_0x4d2cf4(_0x4968a9);}});}exports[_0x3920('0x7d')]=function(_0xaf7a86,_0x372548){if(_0xaf7a86[_0x3920('0x2e')][_0x3920('0x2c')]===_0x3920('0x2f'))throw new Error(_0x3920('0x7e'));if(_0xaf7a86['body'][_0x3920('0x2c')]===_0x3920('0x2e')&&_0xaf7a86[_0x3920('0x2e')]['role']!==_0x3920('0x2d')){throw new Error(_0x3920('0x7f'));}if(_0xaf7a86['body'][_0x3920('0x2c')]==='admin'&&_0xaf7a86['user']['role']!==_0x3920('0x2d')){throw new Error(_0x3920('0x80'));}return licenseUtil[_0x3920('0x81')]([_0xaf7a86[_0x3920('0x61')]])[_0x3920('0x14')](function(){return validateUser(_0xaf7a86[_0x3920('0x61')]);})[_0x3920('0x14')](function(_0x4c7a33){return updateUser(_0x4c7a33)[_0x3920('0x14')](function(_0x8cf4d3){if(_0x8cf4d3[_0x3920('0x2c')]===_0x3920('0x2d')){_0x8cf4d3['settingsEnabled']=_0xaf7a86['user']['settingsEnabled'];delete _0x8cf4d3['userProfileId'];}return _0x8cf4d3;});})[_0x3920('0x14')](function(_0x1d6014){return db[_0x3920('0x3a')]['create'](_0x1d6014,{'include':[{'model':db[_0x3920('0x71')],'as':_0x3920('0x71')}]});})[_0x3920('0x14')](function(_0x401f72){if(_0xaf7a86[_0x3920('0x61')]['role']===_0x3920('0x2e'))return _0x401f72;if(_0xaf7a86[_0x3920('0x2e')][_0x3920('0x2c')]!==_0x3920('0x2e'))return _0x401f72;return db[_0x3920('0x82')][_0x3920('0x36')]({'where':{'name':_0x401f72[_0x3920('0x2c')]==='agent'?_0x3920('0x83'):_0x3920('0x30'),'userProfileId':_0xaf7a86[_0x3920('0x2e')][_0x3920('0x84')]},'raw':!![]})['then'](function(_0x5a659e){if(!_0x5a659e||_0x5a659e[_0x3920('0x85')]!=0x0)return _0x401f72;return db[_0x3920('0x86')][_0x3920('0x7d')]({'name':_0x401f72[_0x3920('0x37')],'resourceId':_0x401f72['id'],'type':_0x5a659e[_0x3920('0x37')],'sectionId':_0x5a659e['id']},{})['then'](function(){return _0x401f72;});})[_0x3920('0x52')](function(_0x144756){logger['error'](_0x3920('0x87'),_0x144756);throw _0x144756;});})[_0x3920('0x14')](respondWithResult(_0x372548,0xc9))[_0x3920('0x52')](handleError(_0x372548,null));};exports['bulkCreate']=function(_0xa16b99,_0x73dee){var _0xbcdb28=_0xa16b99[_0x3920('0x61')];var _0x30567d=[];if(_0xa16b99[_0x3920('0x2e')][_0x3920('0x2c')]===_0x3920('0x2f'))throw new Error(_0x3920('0x7e'));if(_[_0x3920('0x88')](_0xbcdb28,['role','user'])&&_0xa16b99[_0x3920('0x2e')][_0x3920('0x2c')]!==_0x3920('0x2d')){throw new Error(_0x3920('0x7f'));}if(_[_0x3920('0x88')](_0xbcdb28,[_0x3920('0x2c'),_0x3920('0x2d')])&&_0xa16b99[_0x3920('0x2e')][_0x3920('0x2c')]!==_0x3920('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0xbcdb28)[_0x3920('0x14')](function(){return validateUser(_0xbcdb28[0x0]);})[_0x3920('0x14')](function(){for(var _0xc09ea=0x1;_0xc09ea<_0xbcdb28[_0x3920('0x4a')];_0xc09ea++){var _0x592b16=_0xbcdb28[_0xc09ea-0x1]['internal'];if(!_0xbcdb28[_0xc09ea]['internal'])_0xbcdb28[_0xc09ea][_0x3920('0x68')]=_0x592b16+0x1;_0x30567d['push'](validateUser(_0xbcdb28[_0xc09ea]));}return Promise[_0x3920('0x51')](_0x30567d);})[_0x3920('0x14')](function(){_0x30567d=[];for(var _0x861c02=0x0;_0x861c02<_0xbcdb28['length'];_0x861c02++){_0x30567d[_0x3920('0x47')](updateUser(_0xbcdb28[_0x861c02]));}return Promise[_0x3920('0x51')](_0x30567d);})['then'](function(){_0x30567d=_0xbcdb28['map'](function(_0x4d1849){return db[_0x3920('0x3a')][_0x3920('0x7d')](_0x4d1849,{'include':[{'model':db[_0x3920('0x71')],'as':_0x3920('0x71')}]})['then'](function(_0x8ca653){_0x4d1849['id']=_0x8ca653['id'];return _0x4d1849;});});return Promise['all'](_0x30567d);})[_0x3920('0x14')](function(_0x29022a){if(_0xa16b99[_0x3920('0x61')][_0x3920('0x2c')]==='user')return _0x29022a;if(_0xa16b99[_0x3920('0x2e')][_0x3920('0x2c')]!=='user')return _0x29022a;var _0x12ba90=_[_0x3920('0x88')](_0x29022a,function(_0x5ccaa7){return _0x5ccaa7[_0x3920('0x2c')]===_0x3920('0x2f')||_0x5ccaa7['role']==='telephone';});if(!_0x12ba90)return _0x29022a;return db['UserProfileSection'][_0x3920('0x48')]({'where':{'name':{'$or':['Agents',_0x3920('0x30')]},'userProfileId':_0xa16b99[_0x3920('0x2e')][_0x3920('0x84')]},'raw':!![]})[_0x3920('0x14')](function(_0x136aa4){if(_[_0x3920('0x89')](_0x136aa4)||!_['some'](_0x136aa4,[_0x3920('0x85'),0x0]))return _0x29022a;_0x30567d=[];var _0xb6d9d6=_(_0x136aa4)[_0x3920('0x33')](function(_0x1f4d40){if(_0x1f4d40[_0x3920('0x85')]===0x1)return;return _0x1f4d40['name']===_0x3920('0x83')?_0x3920('0x2f'):'telephone';})['compact']()[_0x3920('0x34')]();for(var _0x5dc6b4=0x0;_0x5dc6b4<_0x29022a['length'];_0x5dc6b4++){if(!_[_0x3920('0x35')](_0xb6d9d6,_0x29022a[_0x5dc6b4][_0x3920('0x2c')]))return;var _0x37aa86=_0x29022a[_0x5dc6b4][_0x3920('0x2c')]===_0x3920('0x2f')?'Agents':_0x3920('0x30');_0x30567d[_0x3920('0x47')](db[_0x3920('0x86')]['create']({'name':_0x29022a[_0x5dc6b4]['name'],'resourceId':_0x29022a[_0x5dc6b4]['id'],'type':_0x37aa86,'sectionId':_[_0x3920('0x36')](_0x136aa4,[_0x3920('0x37'),_0x37aa86])['id']},{}));}return Promise[_0x3920('0x51')](_0x30567d);});})[_0x3920('0x14')](respondWithResult(_0x73dee,0xc9))[_0x3920('0x52')](handleError(_0x73dee,null));};exports[_0x3920('0x8a')]=function(_0x4de2cb,_0x1bbbf1){if(_0x4de2cb[_0x3920('0x61')]['id']){delete _0x4de2cb['body']['id'];}return db[_0x3920('0x3a')]['find']({'where':{'id':_0x4de2cb['params']['id']}})[_0x3920('0x14')](function(_0x340267){if(!_0x340267)return null;if(_0x340267['id']===_0x4de2cb['user']['id']){if(!_0x4de2cb['body'][_0x3920('0x8b')]||!_0x4de2cb['body']['newPassword']){throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))](_0x3920('0x8e'));}if(!_0x340267[_0x3920('0x8f')](_0x4de2cb[_0x3920('0x61')]['oldPassword'])){throw new db[(_0x3920('0x8c'))]['ValidationError']('Wrong\x20credentials');}if(_0x4de2cb[_0x3920('0x61')][_0x3920('0x8b')]===_0x4de2cb[_0x3920('0x61')][_0x3920('0x90')]){throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))](_0x3920('0x91'));}}else if(_0x4de2cb[_0x3920('0x2e')]['role']==='admin'){if(!_0x4de2cb[_0x3920('0x61')][_0x3920('0x90')]){throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x4de2cb[_0x3920('0x2e')]['role']===_0x3920('0x2e')){if(!_0x4de2cb['body']['newPassword']){throw new db[(_0x3920('0x8c'))]['ValidationError'](_0x3920('0x92'));}if(_0x340267[_0x3920('0x2c')]!==_0x3920('0x2f')){throw new db['Sequelize'][(_0x3920('0x8d'))](_0x3920('0x7e'));}}else{throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))](_0x3920('0x7e'));}return _0x340267;})[_0x3920('0x14')](handleEntityNotFound(_0x1bbbf1,null))[_0x3920('0x14')](function(_0x35678b){return db['Setting']['findOne']({'attributes':['id',_0x3920('0x65'),_0x3920('0x93'),_0x3920('0x94')]})[_0x3920('0x14')](function(_0x1e78da){if(_0x1e78da[_0x3920('0x65')])authService[_0x3920('0x66')](_0x4de2cb['body']['newPassword']);if(!_0x1e78da['enforcePasswordHistory']||!_0x35678b[_0x3920('0x95')])return _0x35678b;authService[_0x3920('0x96')](_0x4de2cb[_0x3920('0x61')]['newPassword'],_0x35678b[_0x3920('0x95')],_0x1e78da[_0x3920('0x94')]);return _0x35678b;})[_0x3920('0x14')](saveUpdates({'password':_0x4de2cb[_0x3920('0x61')][_0x3920('0x90')],'passwordResetAt':_0x4de2cb['user']['id']==_0x4de2cb[_0x3920('0x54')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4de2cb[_0x3920('0x61')][_0x3920('0x90')],_0x35678b[_0x3920('0x95')])},null));})[_0x3920('0x14')](respondWithResult(_0x1bbbf1,null))[_0x3920('0x52')](handleError(_0x1bbbf1,null));};exports['addQueues']=function(_0x22a3f8,_0x5dab8b){var _0x2660c4=_0x22a3f8[_0x3920('0x61')]['channel'];return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x22a3f8[_0x3920('0x54')]['id']},'attributes':['id',_0x3920('0x37'),'role',_0x3920('0x97'),'loginInPause','voicePause',_0x3920('0x98')]})['then'](handleEntityNotFound(_0x5dab8b,null))[_0x3920('0x14')](function(_0x4b4336){if(_0x4b4336){if(!utils[_0x3920('0x99')](_0x2660c4)){throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))](_0x3920('0x9a'));}return _0x4b4336[_0x3920('0x9b')+_[_0x3920('0x9c')](_0x2660c4[_0x3920('0x9d')]())+_0x3920('0x9e')](_0x22a3f8['body'][_0x3920('0x63')],{'penalty':_0x22a3f8['body'][_0x3920('0x9f')]||0x0})[_0x3920('0xa0')](function(_0x3333a9){for(var _0x21b9a7=0x0;_0x21b9a7<_0x22a3f8[_0x3920('0x61')]['ids']['length'];_0x21b9a7+=0x1){var _0x5474c4={'UserId':Number(_0x22a3f8[_0x3920('0x54')]['id'])};_0x5474c4[_[_0x3920('0x9c')](_0x2660c4['toLowerCase']())+_0x3920('0xa1')]=Number(_0x22a3f8[_0x3920('0x61')][_0x3920('0x63')][_0x21b9a7]);socket[_0x3920('0x28')](_0x3920('0x2e')+_[_0x3920('0x9c')](_0x2660c4[_0x3920('0x9d')]())+_0x3920('0xa2'),_0x5474c4);}return _0x3333a9;})[_0x3920('0x14')](function(){if(_0x2660c4===_0x3920('0xa3')){return db[_0x3920('0xa4')][_0x3920('0x48')]({'where':{'id':_0x22a3f8[_0x3920('0x61')][_0x3920('0x63')]||[]},'raw':!![],'attributes':['id',_0x3920('0x37')]});}})['then'](function(_0x3f4d09){var _0xa52a3b=_0x4b4336[_0x3920('0x2b')]({'plain':!![]});var _0x13612f=[];if(_0x2660c4===_0x3920('0xa3')&&_0xa52a3b[_0x3920('0x2c')]==='agent'&&_0xa52a3b['online']){for(let _0x2c5c7d=0x0;_0x2c5c7d<_0x3f4d09['length'];_0x2c5c7d+=0x1){_0x13612f[_0x3920('0x47')]({'membername':_0xa52a3b[_0x3920('0x37')],'UserId':_0xa52a3b['id'],'queue_name':_0x3f4d09[_0x2c5c7d][_0x3920('0x37')],'VoiceQueueId':_0x3f4d09[_0x2c5c7d]['id'],'interface':_['isNil'](_0xa52a3b[_0x3920('0x98')])?util['format'](_0x3920('0xa5'),_0xa52a3b[_0x3920('0x37')]):_0xa52a3b[_0x3920('0x98')],'paused':_0xa52a3b['voicePause']||![],'penalty':_0x22a3f8[_0x3920('0x61')][_0x3920('0x9f')]||0x0});}return Promise[_0x3920('0x51')](_0x13612f['map'](function(_0x3d7fcd){return db[_0x3920('0xa6')][_0x3920('0xa7')](_0x3d7fcd);}));}return _0x4b4336;});}})[_0x3920('0x14')](respondWithStatusCode(_0x5dab8b,null))[_0x3920('0x52')](handleError(_0x5dab8b,null));};exports[_0x3920('0xa8')]=function(_0x2c2309,_0xdad61c){var _0x2183fb,_0x5707ea;return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x2c2309[_0x3920('0x54')]['id']},'attributes':['id',_0x3920('0x37'),_0x3920('0x2c')]})['then'](handleEntityNotFound(_0xdad61c,null))['then'](function(_0x380727){if(_0x380727){_0x2183fb=_0x380727;if(!_0x2c2309[_0x3920('0x41')][_0x3920('0xa9')]||!utils[_0x3920('0x99')](_0x2c2309[_0x3920('0x41')]['channel'])){throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))](_0x3920('0x9a'));}return _0x380727[_0x3920('0xaa')+_[_0x3920('0x9c')](_0x2c2309[_0x3920('0x41')]['channel'][_0x3920('0x9d')]())+_0x3920('0x9e')](_0x2c2309[_0x3920('0x41')][_0x3920('0x63')]);}})[_0x3920('0x14')](function(_0x8de2bc){if(_[_0x3920('0xab')](_0x2c2309[_0x3920('0x41')][_0x3920('0x63')])){for(var _0x539d4f=0x0;_0x539d4f<_0x2c2309[_0x3920('0x41')][_0x3920('0x63')]['length'];_0x539d4f+=0x1){_0x5707ea={'UserId':Number(_0x2c2309[_0x3920('0x54')]['id'])};_0x5707ea[_[_0x3920('0x9c')](_0x2c2309['query']['channel']['toLowerCase']())+'QueueId']=Number(_0x2c2309[_0x3920('0x41')][_0x3920('0x63')][_0x539d4f]);socket[_0x3920('0x28')](_0x3920('0x2e')+_[_0x3920('0x9c')](_0x2c2309[_0x3920('0x41')]['channel']['toLowerCase']())+_0x3920('0xac'),_0x5707ea);}}else{_0x5707ea={'UserId':Number(_0x2c2309['params']['id'])};_0x5707ea[_[_0x3920('0x9c')](_0x2c2309['query'][_0x3920('0xa9')][_0x3920('0x9d')]())+'QueueId']=Number(_0x2c2309[_0x3920('0x41')][_0x3920('0x63')]);socket[_0x3920('0x28')]('user'+_['capitalize'](_0x2c2309['query']['channel'][_0x3920('0x9d')]())+_0x3920('0xac'),_0x5707ea);}return _0x8de2bc;})[_0x3920('0x14')](function(){if(_0x2c2309[_0x3920('0x41')][_0x3920('0xa9')]==='voice'){return db[_0x3920('0xa6')]['destroy']({'where':{'UserId':_0x2c2309[_0x3920('0x54')]['id'],'VoiceQueueId':_0x2c2309['query'][_0x3920('0x63')]},'individualHooks':!![]})[_0x3920('0x14')](function(){return _0x2183fb;});}return _0x2183fb;})[_0x3920('0x14')](respondWithStatusCode(_0xdad61c,null))[_0x3920('0x52')](handleError(_0xdad61c,null));};exports[_0x3920('0xad')]=function(_0x136cc6,_0x53d764){_0x136cc6[_0x3920('0x61')][_0x3920('0xae')]=_0x136cc6[_0x3920('0xaf')]['filename'];return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x136cc6[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x53d764,null))[_0x3920('0x14')](saveUpdates(_0x136cc6['body'],null))[_0x3920('0x14')](respondWithResult(_0x53d764,null))['catch'](handleError(_0x53d764,null));};exports['getAvatar']=function(_0xd2f5f2,_0x6eef09){var _0x1def63=path['join'](config[_0x3920('0xb0')],_0x3920('0xb1'));return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0xd2f5f2['params']['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x6eef09,null))[_0x3920('0x14')](function(_0x57d48b){if(_0x57d48b){if(_[_0x3920('0x69')](_0x57d48b[_0x3920('0xae')])){return _0x6eef09[_0x3920('0xb2')](_0x1def63);}else{if(!fs['existsSync'](path['join'](config[_0x3920('0xb0')],'server/files/images/',_0x57d48b['userpic']))){return _0x6eef09[_0x3920('0xb2')](_0x1def63);}return _0x6eef09[_0x3920('0xb2')](path[_0x3920('0xb3')](config[_0x3920('0xb0')],_0x3920('0xb4'),_0x57d48b[_0x3920('0xae')]));}}})[_0x3920('0x52')](handleError(_0x6eef09,null));};exports[_0x3920('0xb5')]=function(_0x320367,_0x44fcec){return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x320367[_0x3920('0x54')]['id']},'attributes':['id']})[_0x3920('0x14')](handleEntityNotFound(_0x44fcec,null))['then'](function(_0x20cea0){var _0x208ab8=[];values=_0x20cea0[_0x3920('0x4c')];_0x208ab8[_0x3920('0x47')](get_open_tabs('chat',_0x20cea0[_0x3920('0x4c')]));_0x208ab8[_0x3920('0x47')](get_open_tabs('sms',_0x20cea0['dataValues']));_0x208ab8[_0x3920('0x47')](get_open_tabs(_0x3920('0x4f'),_0x20cea0[_0x3920('0x4c')]));_0x208ab8['push'](get_open_tabs(_0x3920('0x50'),_0x20cea0[_0x3920('0x4c')]));_0x208ab8['push'](get_open_tabs(_0x3920('0x5f'),_0x20cea0[_0x3920('0x4c')]));_0x208ab8['push'](get_open_tabs(_0x3920('0x4e'),_0x20cea0[_0x3920('0x4c')]));return Promise[_0x3920('0x51')](_0x208ab8);})[_0x3920('0x14')](function(_0x257604){if(_0x257604){var _0x219791=_[_0x3920('0x33')](values['ChatOpenTabs'],function(_0x269b42){return{'channel':'CHAT','id':_0x269b42['id'],'createdAt':_0x269b42['createdAt']};});var _0x4cef0d=_[_0x3920('0x33')](values['FaxOpenTabs'],function(_0x53b621){return{'channel':_0x3920('0xb6'),'id':_0x53b621['id'],'createdAt':_0x53b621[_0x3920('0xb7')]};});var _0x213102=_['map'](values[_0x3920('0xb8')],function(_0x549a74){return{'channel':_0x3920('0xb9'),'id':_0x549a74['id'],'createdAt':_0x549a74[_0x3920('0xb7')]};});var _0x1262bb=_[_0x3920('0x33')](values[_0x3920('0xba')],function(_0x4807db){return{'channel':'MAIL','id':_0x4807db['id'],'createdAt':_0x4807db[_0x3920('0xb7')]};});var _0x191ec4=_[_0x3920('0x33')](values[_0x3920('0xbb')],function(_0x15a738){return{'channel':'SMS','id':_0x15a738['id'],'createdAt':_0x15a738[_0x3920('0xb7')]};});var _0x308518=_[_0x3920('0x33')](values[_0x3920('0xbc')],function(_0x551db3){return{'channel':_0x3920('0xbd'),'id':_0x551db3['id'],'createdAt':_0x551db3['createdAt']};});var _0x2de374=_['concat'](_0x219791,_0x4cef0d,_0x213102,_0x1262bb,_0x191ec4,_0x308518);var _0x5926c6={'count':_0x2de374[_0x3920('0x4a')],'rows':_0x2de374};return _0x5926c6;}else return null;})['then'](respondWithResult(_0x44fcec,null))[_0x3920('0x52')](handleError(_0x44fcec,null));};exports[_0x3920('0xbe')]=function(_0x12e570,_0x1c7fa0){var _0xaf91de={};var _0xca10fa={};var _0x5914c1;var _0xcc4fd5;return db[_0x3920('0x3a')]['findOne']({'where':{'id':_0x12e570[_0x3920('0x54')]['id']}})['then'](handleEntityNotFound(_0x1c7fa0,null))[_0x3920('0x14')](function(_0x582364){if(_0x582364){_0x5914c1=_0x582364;_0xca10fa[_0x3920('0x55')]=_[_0x3920('0x57')](db['CmContact']['rawAttributes']);_0xca10fa[_0x3920('0x41')]=_[_0x3920('0x57')](_0x12e570[_0x3920('0x41')]);_0xca10fa['filters']=_[_0x3920('0x5a')](_0xca10fa[_0x3920('0x55')],_0xca10fa[_0x3920('0x41')]);_0xaf91de[_0x3920('0x46')]=_['intersection'](_0xca10fa[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x12e570[_0x3920('0x41')][_0x3920('0x5b')]));_0xaf91de[_0x3920('0x46')]=_0xaf91de[_0x3920('0x46')][_0x3920('0x4a')]?_0xaf91de['attributes']:_0xca10fa['model'];_0xaf91de['order']=qs[_0x3920('0xbf')](_0x12e570[_0x3920('0x41')][_0x3920('0xbf')]);_0xaf91de[_0x3920('0xc0')]=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0x12e570['query'],_0xca10fa[_0x3920('0x59')]));if(_0x12e570[_0x3920('0x41')][_0x3920('0x31')]){_0xaf91de[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0xaf91de[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0xaf91de[_0x3920('0x46')],function(_0x595850){var _0x5beab7={};_0x5beab7[_0x595850]={'$like':'%'+_0x12e570[_0x3920('0x41')][_0x3920('0x31')]+'%'};return _0x5beab7;})});}_0xaf91de=_[_0x3920('0x5c')]({},_0xaf91de,_0x12e570[_0x3920('0x5d')]);return _0x5914c1['getContacts'](_0xaf91de);}})[_0x3920('0x14')](function(_0x229613){if(_0x229613){_0xcc4fd5=_0x229613['length'];if(_0x12e570[_0x3920('0x41')][_0x3920('0xc2')]('includeAll')){_0xaf91de[_0x3920('0x44')]=[{'model':db[_0x3920('0xc3')],'as':_0x3920('0xc4'),'required':![]},{'model':db[_0x3920('0xc5')],'as':'Tags','attributes':['id',_0x3920('0x37'),_0x3920('0xc6')],'where':_0x12e570['query'][_0x3920('0xc7')]?{'id':_0x12e570[_0x3920('0x41')][_0x3920('0xc7')]}:undefined,'required':_0x12e570['query'][_0x3920('0xc7')]?!![]:![]}];}if(!_0x12e570[_0x3920('0x41')][_0x3920('0xc2')](_0x3920('0xc8'))){_0xaf91de[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x12e570['query']['limit']);_0xaf91de['offset']=qs[_0x3920('0x25')](_0x12e570[_0x3920('0x41')]['offset']);}return _0x5914c1[_0x3920('0xbe')](_0xaf91de);}})['then'](function(_0x2bf48f){if(_0x2bf48f){return _0x2bf48f?{'count':_0xcc4fd5,'rows':_0x2bf48f}:null;}})[_0x3920('0x14')](respondWithResult(_0x1c7fa0,null))['catch'](handleError(_0x1c7fa0,null));};exports[_0x3920('0xc9')]=function(_0x4dd6df,_0x1335eb){var _0x3c41e2;var _0x377fe9={};var _0x13fb67;return db[_0x3920('0x3a')][_0x3920('0xca')]({'where':{'id':_0x4dd6df[_0x3920('0x54')]['id']},'attributes':['id',_0x3920('0x37'),'role']})[_0x3920('0x14')](handleEntityNotFound(_0x1335eb,null))[_0x3920('0x14')](function(_0x4e3889){if(!utils[_0x3920('0x99')](_0x4dd6df[_0x3920('0x41')][_0x3920('0xa9')])){throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))](_0x3920('0x9a'));}_0x3c41e2=_0x4e3889;var _0x1ab426={};_0x1ab426[_0x3920('0x55')]=_[_0x3920('0x57')](db[_[_0x3920('0x9c')](_0x4dd6df['query']['channel'])+'Queue'][_0x3920('0x58')]);_0x1ab426[_0x3920('0x41')]=_[_0x3920('0x57')](_0x4dd6df[_0x3920('0x41')]);_0x1ab426[_0x3920('0x59')]=_[_0x3920('0x5a')](_0x1ab426['model'],_0x1ab426[_0x3920('0x41')]);_0x377fe9['attributes']=_[_0x3920('0x5a')](_0x1ab426[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x4dd6df[_0x3920('0x41')][_0x3920('0x5b')]));_0x377fe9['attributes']=_0x377fe9['attributes'][_0x3920('0x4a')]?_0x377fe9[_0x3920('0x46')]:_0x1ab426[_0x3920('0x55')];_0x377fe9[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0x4dd6df[_0x3920('0x41')][_0x3920('0xbf')]);_0x377fe9[_0x3920('0xc0')]=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0x4dd6df[_0x3920('0x41')],_0x1ab426['filters']));if(_0x4dd6df[_0x3920('0x41')][_0x3920('0x31')]){_0x377fe9['where']=_[_0x3920('0x5c')](_0x377fe9[_0x3920('0xc0')],{'$or':_['map'](_0x377fe9[_0x3920('0x46')],function(_0xbeba00){var _0x3ae1eb={};_0x3ae1eb[_0xbeba00]={'$like':'%'+_0x4dd6df[_0x3920('0x41')]['filter']+'%'};return _0x3ae1eb;})});}_0x377fe9=_[_0x3920('0x5c')]({},_0x377fe9,_0x4dd6df['options']);switch(_0x3c41e2[_0x3920('0x2c')]){case'admin':return db[_[_0x3920('0x9c')](_0x4dd6df[_0x3920('0x41')]['channel'])+'Queue'][_0x3920('0x48')](_0x377fe9);case _0x3920('0x2e'):case _0x3920('0x2f'):return _0x3c41e2[_0x3920('0x2b')+_['capitalize'](_0x4dd6df[_0x3920('0x41')][_0x3920('0xa9')])+_0x3920('0x9e')](_0x377fe9);default:throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))]('Unknown\x20role');}})[_0x3920('0x14')](function(_0x156b2f){_0x13fb67=_0x156b2f[_0x3920('0x4a')];if(!_0x4dd6df[_0x3920('0x41')][_0x3920('0xc2')](_0x3920('0xc8'))){_0x377fe9[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x4dd6df[_0x3920('0x41')][_0x3920('0x23')]);_0x377fe9[_0x3920('0x25')]=qs[_0x3920('0x25')](_0x4dd6df[_0x3920('0x41')][_0x3920('0x25')]);}switch(_0x3c41e2[_0x3920('0x2c')]){case _0x3920('0x2d'):return db[_[_0x3920('0x9c')](_0x4dd6df[_0x3920('0x41')]['channel'])+_0x3920('0xcc')][_0x3920('0x48')](_0x377fe9);case _0x3920('0x2e'):case _0x3920('0x2f'):return _0x3c41e2[_0x3920('0x2b')+_[_0x3920('0x9c')](_0x4dd6df['query'][_0x3920('0xa9')])+_0x3920('0x9e')](_0x377fe9);}})[_0x3920('0x14')](function(_0x4d449e){return{'count':_0x13fb67,'rows':_0x4d449e};})[_0x3920('0x14')](respondWithResult(_0x1335eb,null))[_0x3920('0x52')](handleError(_0x1335eb,null));};exports['getVoiceQueuesRt']=function(_0x51b9a0,_0x13dbc7){var _0x412b74={};var _0x5f0d62={};var _0x2034cf;var _0x4fbb2a;return db['User'][_0x3920('0xca')]({'where':{'id':_0x51b9a0[_0x3920('0x54')]['id']}})['then'](handleEntityNotFound(_0x13dbc7,null))[_0x3920('0x14')](function(_0x37bb53){if(_0x37bb53){_0x2034cf=_0x37bb53;_0x5f0d62[_0x3920('0x55')]=_[_0x3920('0x57')](db['UserVoiceQueueRt'][_0x3920('0x58')]);_0x5f0d62['query']=_[_0x3920('0x57')](_0x51b9a0['query']);_0x5f0d62[_0x3920('0x59')]=_[_0x3920('0x5a')](_0x5f0d62[_0x3920('0x55')],_0x5f0d62['query']);_0x412b74['attributes']=_[_0x3920('0x5a')](_0x5f0d62[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x51b9a0['query']['fields']));_0x412b74[_0x3920('0x46')]=_0x412b74[_0x3920('0x46')]['length']?_0x412b74[_0x3920('0x46')]:_0x5f0d62['model'];_0x412b74[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0x51b9a0['query'][_0x3920('0xbf')]);_0x412b74[_0x3920('0xc0')]=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0x51b9a0[_0x3920('0x41')],_0x5f0d62[_0x3920('0x59')]));if(_0x51b9a0[_0x3920('0x41')][_0x3920('0x31')]){_0x412b74[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0x412b74[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x412b74['attributes'],function(_0x2736cf){var _0x42560b={};_0x42560b[_0x2736cf]={'$like':'%'+_0x51b9a0[_0x3920('0x41')]['filter']+'%'};return _0x42560b;})});}_0x412b74=_['merge']({},_0x412b74,_0x51b9a0[_0x3920('0x5d')]);return _0x2034cf[_0x3920('0xcd')](_0x412b74);}})[_0x3920('0x14')](function(_0x1a7b17){if(_0x1a7b17){_0x4fbb2a=_0x1a7b17['length'];if(!_0x51b9a0[_0x3920('0x41')]['hasOwnProperty'](_0x3920('0xc8'))){_0x412b74[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x51b9a0[_0x3920('0x41')][_0x3920('0x23')]);_0x412b74[_0x3920('0x25')]=qs[_0x3920('0x25')](_0x51b9a0[_0x3920('0x41')][_0x3920('0x25')]);}return _0x2034cf[_0x3920('0xcd')](_0x412b74);}})['then'](function(_0x53842f){if(_0x53842f){return _0x53842f?{'count':_0x4fbb2a,'rows':_0x53842f}:null;}})['then'](respondWithResult(_0x13dbc7,null))[_0x3920('0x52')](handleError(_0x13dbc7,null));};exports[_0x3920('0xce')]=function(_0x4e3a66,_0x5b4b5d){var _0x364a2b={};var _0x143f48={};var _0x15f433;var _0x2ac600;return db[_0x3920('0x3a')]['findOne']({'where':{'id':_0x4e3a66['params']['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x5b4b5d,null))['then'](function(_0x16141f){if(_0x16141f){_0x15f433=_0x16141f;_0x143f48[_0x3920('0x55')]=_[_0x3920('0x57')](db[_0x3920('0xcf')][_0x3920('0x58')]);_0x143f48[_0x3920('0x41')]=_['keys'](_0x4e3a66[_0x3920('0x41')]);_0x143f48['filters']=_[_0x3920('0x5a')](_0x143f48[_0x3920('0x55')],_0x143f48[_0x3920('0x41')]);_0x364a2b[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x143f48['model'],qs[_0x3920('0x5b')](_0x4e3a66[_0x3920('0x41')][_0x3920('0x5b')]));_0x364a2b['attributes']=_0x364a2b['attributes'][_0x3920('0x4a')]?_0x364a2b[_0x3920('0x46')]:_0x143f48[_0x3920('0x55')];_0x364a2b[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0x4e3a66[_0x3920('0x41')][_0x3920('0xbf')]);_0x364a2b['where']=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0x4e3a66[_0x3920('0x41')],_0x143f48['filters']));if(_0x4e3a66[_0x3920('0x41')][_0x3920('0x31')]){_0x364a2b[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0x364a2b[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x364a2b['attributes'],function(_0x3ed916){var _0x5215ae={};_0x5215ae[_0x3ed916]={'$like':'%'+_0x4e3a66['query'][_0x3920('0x31')]+'%'};return _0x5215ae;})});}_0x364a2b=_[_0x3920('0x5c')]({},_0x364a2b,_0x4e3a66[_0x3920('0x5d')]);return _0x15f433[_0x3920('0xce')](_0x364a2b);}})['then'](function(_0x4b46d0){if(_0x4b46d0){_0x2ac600=_0x4b46d0[_0x3920('0x4a')];if(!_0x4e3a66[_0x3920('0x41')][_0x3920('0xc2')](_0x3920('0xc8'))){_0x364a2b['limit']=qs[_0x3920('0x23')](_0x4e3a66['query'][_0x3920('0x23')]);_0x364a2b[_0x3920('0x25')]=qs[_0x3920('0x25')](_0x4e3a66[_0x3920('0x41')][_0x3920('0x25')]);}return _0x15f433[_0x3920('0xce')](_0x364a2b);}})[_0x3920('0x14')](function(_0x4db9f1){if(_0x4db9f1){return _0x4db9f1?{'count':_0x2ac600,'rows':_0x4db9f1}:null;}})[_0x3920('0x14')](respondWithResult(_0x5b4b5d,null))[_0x3920('0x52')](handleError(_0x5b4b5d,null));};exports[_0x3920('0xd0')]=function(_0xa35800,_0x2c3f83){var _0x47d28b={'raw':!![],'where':{}};var _0x41249a={};var _0x2a2ba3={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0xa35800[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x2c3f83,null))[_0x3920('0x14')](function(_0x40f6cf){if(_0x40f6cf){_0x41249a[_0x3920('0x55')]=_['keys'](db['VoiceRecording'][_0x3920('0x58')]);_0x41249a['query']=_[_0x3920('0x57')](_0xa35800[_0x3920('0x41')]);_0x41249a['filters']=_[_0x3920('0x5a')](_0x41249a[_0x3920('0x55')],_0x41249a[_0x3920('0x41')]);_0x47d28b['attributes']=_[_0x3920('0x5a')](_0x41249a[_0x3920('0x55')],qs[_0x3920('0x5b')](_0xa35800['query'][_0x3920('0x5b')]));_0x47d28b[_0x3920('0x46')]=_0x47d28b['attributes']['length']?_0x47d28b[_0x3920('0x46')]:_0x41249a[_0x3920('0x55')];if(!_0xa35800['query']['hasOwnProperty'](_0x3920('0xc8'))){_0x47d28b[_0x3920('0x23')]=qs[_0x3920('0x23')](_0xa35800[_0x3920('0x41')][_0x3920('0x23')]);_0x47d28b[_0x3920('0x25')]=qs[_0x3920('0x25')](_0xa35800[_0x3920('0x41')][_0x3920('0x25')]);}_0x47d28b['order']=qs[_0x3920('0xbf')](_0xa35800[_0x3920('0x41')]['sort']);_0x47d28b[_0x3920('0xc0')]=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0xa35800[_0x3920('0x41')],_0x41249a['filters']));_0x47d28b[_0x3920('0xc0')][_0x3920('0xd1')]=_0x40f6cf['id'];if(_0xa35800['query']['filter']){_0x47d28b[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0x47d28b[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x47d28b[_0x3920('0x46')],function(_0x51d5b4){var _0x5942ed={};_0x5942ed[_0x51d5b4]={'$like':'%'+_0xa35800[_0x3920('0x41')]['filter']+'%'};return _0x5942ed;})});}_0x47d28b=_[_0x3920('0x5c')]({},_0x47d28b,_0xa35800[_0x3920('0x5d')]);return db[_0x3920('0xd2')][_0x3920('0x24')]({'where':_0x47d28b['where']})[_0x3920('0x14')](function(_0x45b291){_0x2a2ba3[_0x3920('0x24')]=_0x45b291;if(_0xa35800['query']['includeAll']){_0x47d28b[_0x3920('0x44')]=[{'all':!![]}];}return db[_0x3920('0xd2')]['findAll'](_0x47d28b);})[_0x3920('0x14')](function(_0x764079){_0x2a2ba3[_0x3920('0x49')]=_0x764079;return _0x2a2ba3;});}})[_0x3920('0x14')](respondWithFilteredResult(_0x2c3f83,_0x47d28b))[_0x3920('0x52')](handleError(_0x2c3f83,null));};exports[_0x3920('0xd3')]=function(_0x1084c7,_0x3be839){var _0x148f36={'raw':!![],'where':{}};var _0x11a95c={};var _0x178285={'count':0x0,'rows':[]};return db[_0x3920('0x3a')][_0x3920('0xca')]({'where':{'id':_0x1084c7['params']['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x3be839,null))[_0x3920('0x14')](function(_0x88f132){if(_0x88f132){_0x11a95c['model']=_['keys'](db[_0x3920('0xd4')]['rawAttributes']);_0x11a95c[_0x3920('0x41')]=_[_0x3920('0x57')](_0x1084c7[_0x3920('0x41')]);_0x11a95c[_0x3920('0x59')]=_['intersection'](_0x11a95c[_0x3920('0x55')],_0x11a95c[_0x3920('0x41')]);_0x148f36[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x11a95c[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x1084c7['query'][_0x3920('0x5b')]));_0x148f36[_0x3920('0x46')]=_0x148f36[_0x3920('0x46')][_0x3920('0x4a')]?_0x148f36[_0x3920('0x46')]:_0x11a95c[_0x3920('0x55')];if(!_0x1084c7[_0x3920('0x41')][_0x3920('0xc2')](_0x3920('0xc8'))){_0x148f36[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x1084c7['query'][_0x3920('0x23')]);_0x148f36[_0x3920('0x25')]=qs[_0x3920('0x25')](_0x1084c7[_0x3920('0x41')][_0x3920('0x25')]);}_0x148f36['order']=qs[_0x3920('0xbf')](_0x1084c7[_0x3920('0x41')][_0x3920('0xbf')]);_0x148f36[_0x3920('0xc0')]=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0x1084c7[_0x3920('0x41')],_0x11a95c[_0x3920('0x59')]));_0x148f36['where'][_0x3920('0xd1')]=_0x88f132['id'];if(_0x1084c7[_0x3920('0x41')]['filter']){_0x148f36['where']=_[_0x3920('0x5c')](_0x148f36[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x148f36[_0x3920('0x46')],function(_0x475021){var _0x13b137={};_0x13b137[_0x475021]={'$like':'%'+_0x1084c7[_0x3920('0x41')]['filter']+'%'};return _0x13b137;})});}_0x148f36=_[_0x3920('0x5c')]({},_0x148f36,_0x1084c7['options']);return db['ScreenRecording'][_0x3920('0x24')]({'where':_0x148f36[_0x3920('0xc0')]})[_0x3920('0x14')](function(_0x31f681){_0x178285[_0x3920('0x24')]=_0x31f681;if(_0x1084c7[_0x3920('0x41')]['includeAll']){_0x148f36[_0x3920('0x44')]=[{'all':!![]}];}return db[_0x3920('0xd4')]['findAll'](_0x148f36);})[_0x3920('0x14')](function(_0x2f4a10){_0x178285['rows']=_0x2f4a10;return _0x178285;});}})[_0x3920('0x14')](respondWithFilteredResult(_0x3be839,_0x148f36))['catch'](handleError(_0x3be839,null));};exports[_0x3920('0xd5')]=function(_0x5bb450,_0x16ee34){var _0xf14fa={};var _0x438048={};var _0x2c2915;var _0x2d1eec;return db['User'][_0x3920('0xca')]({'where':{'id':_0x5bb450['params']['id']}})['then'](handleEntityNotFound(_0x16ee34,null))[_0x3920('0x14')](function(_0x2b5b26){if(_0x2b5b26){_0x2c2915=_0x2b5b26;_0x438048[_0x3920('0x55')]=_[_0x3920('0x57')](db[_0x3920('0xd6')][_0x3920('0x58')]);_0x438048[_0x3920('0x41')]=_[_0x3920('0x57')](_0x5bb450['query']);_0x438048['filters']=_[_0x3920('0x5a')](_0x438048[_0x3920('0x55')],_0x438048[_0x3920('0x41')]);_0xf14fa[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x438048[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x5bb450[_0x3920('0x41')][_0x3920('0x5b')]));_0xf14fa['attributes']=_0xf14fa[_0x3920('0x46')][_0x3920('0x4a')]?_0xf14fa[_0x3920('0x46')]:_0x438048[_0x3920('0x55')];_0xf14fa[_0x3920('0xcb')]=qs['sort'](_0x5bb450[_0x3920('0x41')]['sort']);_0xf14fa[_0x3920('0xc0')]=qs['filters'](_[_0x3920('0xc1')](_0x5bb450[_0x3920('0x41')],_0x438048[_0x3920('0x59')]));if(_0x5bb450['query'][_0x3920('0x31')]){_0xf14fa['where']=_[_0x3920('0x5c')](_0xf14fa['where'],{'$or':_[_0x3920('0x33')](_0xf14fa[_0x3920('0x46')],function(_0x390bae){var _0x53ac98={};_0x53ac98[_0x390bae]={'$like':'%'+_0x5bb450[_0x3920('0x41')][_0x3920('0x31')]+'%'};return _0x53ac98;})});}_0xf14fa=_[_0x3920('0x5c')]({},_0xf14fa,_0x5bb450['options']);return _0x2c2915['getChatInteractions'](_0xf14fa);}})[_0x3920('0x14')](function(_0x4e24a3){if(_0x4e24a3){_0x2d1eec=_0x4e24a3['length'];if(!_0x5bb450[_0x3920('0x41')][_0x3920('0xc2')]('nolimit')){_0xf14fa['limit']=qs[_0x3920('0x23')](_0x5bb450[_0x3920('0x41')][_0x3920('0x23')]);_0xf14fa[_0x3920('0x25')]=qs[_0x3920('0x25')](_0x5bb450['query'][_0x3920('0x25')]);}return _0x2c2915[_0x3920('0xd5')](_0xf14fa);}})[_0x3920('0x14')](function(_0x2f4c2f){if(_0x2f4c2f){return _0x2f4c2f?{'count':_0x2d1eec,'rows':_0x2f4c2f}:null;}})[_0x3920('0x14')](respondWithResult(_0x16ee34,null))[_0x3920('0x52')](handleError(_0x16ee34,null));};exports['getOpenchannelInteractions']=function(_0x191b44,_0x245779){var _0x12f73d={};var _0x5f26ca={};var _0x40b85f;var _0x259a47;return db[_0x3920('0x3a')][_0x3920('0xca')]({'where':{'id':_0x191b44['params']['id']}})['then'](handleEntityNotFound(_0x245779,null))[_0x3920('0x14')](function(_0xe568a7){if(_0xe568a7){_0x40b85f=_0xe568a7;_0x5f26ca[_0x3920('0x55')]=_[_0x3920('0x57')](db[_0x3920('0xd7')]['rawAttributes']);_0x5f26ca[_0x3920('0x41')]=_['keys'](_0x191b44[_0x3920('0x41')]);_0x5f26ca['filters']=_[_0x3920('0x5a')](_0x5f26ca[_0x3920('0x55')],_0x5f26ca[_0x3920('0x41')]);_0x12f73d[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x5f26ca['model'],qs['fields'](_0x191b44[_0x3920('0x41')]['fields']));_0x12f73d['attributes']=_0x12f73d[_0x3920('0x46')][_0x3920('0x4a')]?_0x12f73d[_0x3920('0x46')]:_0x5f26ca[_0x3920('0x55')];_0x12f73d[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0x191b44[_0x3920('0x41')][_0x3920('0xbf')]);_0x12f73d[_0x3920('0xc0')]=qs[_0x3920('0x59')](_['pick'](_0x191b44[_0x3920('0x41')],_0x5f26ca[_0x3920('0x59')]));if(_0x191b44[_0x3920('0x41')][_0x3920('0x31')]){_0x12f73d[_0x3920('0xc0')]=_['merge'](_0x12f73d['where'],{'$or':_['map'](_0x12f73d[_0x3920('0x46')],function(_0x5bc4a7){var _0x254040={};_0x254040[_0x5bc4a7]={'$like':'%'+_0x191b44['query']['filter']+'%'};return _0x254040;})});}_0x12f73d=_['merge']({},_0x12f73d,_0x191b44[_0x3920('0x5d')]);return _0x40b85f[_0x3920('0xd8')](_0x12f73d);}})[_0x3920('0x14')](function(_0x315ea8){if(_0x315ea8){_0x259a47=_0x315ea8[_0x3920('0x4a')];if(!_0x191b44['query'][_0x3920('0xc2')](_0x3920('0xc8'))){_0x12f73d[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x191b44['query'][_0x3920('0x23')]);_0x12f73d['offset']=qs[_0x3920('0x25')](_0x191b44[_0x3920('0x41')][_0x3920('0x25')]);}return _0x40b85f[_0x3920('0xd8')](_0x12f73d);}})['then'](function(_0x260aea){if(_0x260aea){return _0x260aea?{'count':_0x259a47,'rows':_0x260aea}:null;}})['then'](respondWithResult(_0x245779,null))[_0x3920('0x52')](handleError(_0x245779,null));};exports['getMailInteractions']=function(_0xbc3e2d,_0x589b32){var _0x4f4221={'raw':!![],'where':{}};var _0x2220a6={};var _0x2fec39={'count':0x0,'rows':[]};return db['User'][_0x3920('0xca')]({'where':{'id':_0xbc3e2d[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x589b32,null))[_0x3920('0x14')](function(_0x4dbd98){if(_0x4dbd98){_0x2220a6[_0x3920('0x55')]=_[_0x3920('0x57')](db[_0x3920('0xd9')][_0x3920('0x58')]);_0x2220a6[_0x3920('0x41')]=_[_0x3920('0x57')](_0xbc3e2d[_0x3920('0x41')]);_0x2220a6[_0x3920('0x59')]=_['intersection'](_0x2220a6[_0x3920('0x55')],_0x2220a6['query']);_0x4f4221[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x2220a6[_0x3920('0x55')],qs['fields'](_0xbc3e2d[_0x3920('0x41')][_0x3920('0x5b')]));_0x4f4221['attributes']=_0x4f4221[_0x3920('0x46')][_0x3920('0x4a')]?_0x4f4221[_0x3920('0x46')]:_0x2220a6[_0x3920('0x55')];if(!_0xbc3e2d[_0x3920('0x41')][_0x3920('0xc2')](_0x3920('0xc8'))){_0x4f4221[_0x3920('0x23')]=qs['limit'](_0xbc3e2d[_0x3920('0x41')]['limit']);_0x4f4221[_0x3920('0x25')]=qs[_0x3920('0x25')](_0xbc3e2d[_0x3920('0x41')][_0x3920('0x25')]);}_0x4f4221[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0xbc3e2d[_0x3920('0x41')][_0x3920('0xbf')]);_0x4f4221[_0x3920('0xc0')]=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0xbc3e2d['query'],_0x2220a6[_0x3920('0x59')]));_0x4f4221[_0x3920('0xc0')]['UserId']=_0x4dbd98['id'];if(_0xbc3e2d[_0x3920('0x41')][_0x3920('0x31')]){_0x4f4221['where']=_[_0x3920('0x5c')](_0x4f4221['where'],{'$or':_[_0x3920('0x33')](_0x4f4221['attributes'],function(_0x4ad841){var _0x39cf96={};_0x39cf96[_0x4ad841]={'$like':'%'+_0xbc3e2d[_0x3920('0x41')][_0x3920('0x31')]+'%'};return _0x39cf96;})});}_0x4f4221=_['merge']({},_0x4f4221,_0xbc3e2d[_0x3920('0x5d')]);return db[_0x3920('0xd9')][_0x3920('0x24')]({'where':_0x4f4221[_0x3920('0xc0')]})['then'](function(_0x1d325e){_0x2fec39[_0x3920('0x24')]=_0x1d325e;if(_0xbc3e2d[_0x3920('0x41')][_0x3920('0xda')]){_0x4f4221[_0x3920('0x44')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x4f4221);})[_0x3920('0x14')](function(_0x5da6a1){_0x2fec39[_0x3920('0x49')]=_0x5da6a1;return _0x2fec39;});}})[_0x3920('0x14')](respondWithFilteredResult(_0x589b32,_0x4f4221))[_0x3920('0x52')](handleError(_0x589b32,null));};exports[_0x3920('0xdb')]=function(_0x25eacd,_0x67d55a){var _0x115aaf={};var _0x43e0e4={};var _0x4031c9;var _0x5cee28;return db['User'][_0x3920('0xca')]({'where':{'id':_0x25eacd['params']['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x67d55a,null))[_0x3920('0x14')](function(_0x469bfb){if(_0x469bfb){_0x4031c9=_0x469bfb;_0x43e0e4[_0x3920('0x55')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x43e0e4['query']=_[_0x3920('0x57')](_0x25eacd['query']);_0x43e0e4[_0x3920('0x59')]=_[_0x3920('0x5a')](_0x43e0e4[_0x3920('0x55')],_0x43e0e4[_0x3920('0x41')]);_0x115aaf[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x43e0e4['model'],qs[_0x3920('0x5b')](_0x25eacd[_0x3920('0x41')][_0x3920('0x5b')]));_0x115aaf[_0x3920('0x46')]=_0x115aaf[_0x3920('0x46')]['length']?_0x115aaf[_0x3920('0x46')]:_0x43e0e4['model'];_0x115aaf[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0x25eacd[_0x3920('0x41')]['sort']);_0x115aaf['where']=qs['filters'](_[_0x3920('0xc1')](_0x25eacd[_0x3920('0x41')],_0x43e0e4['filters']));if(_0x25eacd[_0x3920('0x41')][_0x3920('0x31')]){_0x115aaf[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0x115aaf[_0x3920('0xc0')],{'$or':_['map'](_0x115aaf['attributes'],function(_0x59011d){var _0x405a3a={};_0x405a3a[_0x59011d]={'$like':'%'+_0x25eacd[_0x3920('0x41')][_0x3920('0x31')]+'%'};return _0x405a3a;})});}_0x115aaf=_[_0x3920('0x5c')]({},_0x115aaf,_0x25eacd[_0x3920('0x5d')]);return _0x4031c9[_0x3920('0xdb')](_0x115aaf);}})[_0x3920('0x14')](function(_0x49a66a){if(_0x49a66a){_0x5cee28=_0x49a66a[_0x3920('0x4a')];if(!_0x25eacd[_0x3920('0x41')][_0x3920('0xc2')](_0x3920('0xc8'))){_0x115aaf['limit']=qs[_0x3920('0x23')](_0x25eacd['query'][_0x3920('0x23')]);_0x115aaf[_0x3920('0x25')]=qs['offset'](_0x25eacd['query']['offset']);}return _0x4031c9['getSmsInteractions'](_0x115aaf);}})[_0x3920('0x14')](function(_0x580278){if(_0x580278){return _0x580278?{'count':_0x5cee28,'rows':_0x580278}:null;}})['then'](respondWithResult(_0x67d55a,null))[_0x3920('0x52')](handleError(_0x67d55a,null));};exports['getFaxInteractions']=function(_0x5dabd2,_0x1c8952){var _0x1fa890={};var _0x52849b={};var _0x5ad797;var _0x2a2b17;return db[_0x3920('0x3a')][_0x3920('0xca')]({'where':{'id':_0x5dabd2[_0x3920('0x54')]['id']}})['then'](handleEntityNotFound(_0x1c8952,null))[_0x3920('0x14')](function(_0x49109e){if(_0x49109e){_0x5ad797=_0x49109e;_0x52849b[_0x3920('0x55')]=_[_0x3920('0x57')](db[_0x3920('0xdc')]['rawAttributes']);_0x52849b[_0x3920('0x41')]=_[_0x3920('0x57')](_0x5dabd2[_0x3920('0x41')]);_0x52849b['filters']=_['intersection'](_0x52849b[_0x3920('0x55')],_0x52849b['query']);_0x1fa890[_0x3920('0x46')]=_['intersection'](_0x52849b[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x5dabd2[_0x3920('0x41')][_0x3920('0x5b')]));_0x1fa890['attributes']=_0x1fa890[_0x3920('0x46')]['length']?_0x1fa890['attributes']:_0x52849b[_0x3920('0x55')];_0x1fa890[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0x5dabd2['query'][_0x3920('0xbf')]);_0x1fa890[_0x3920('0xc0')]=qs[_0x3920('0x59')](_['pick'](_0x5dabd2['query'],_0x52849b['filters']));if(_0x5dabd2[_0x3920('0x41')][_0x3920('0x31')]){_0x1fa890[_0x3920('0xc0')]=_['merge'](_0x1fa890[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x1fa890[_0x3920('0x46')],function(_0x2622d0){var _0x22a7e7={};_0x22a7e7[_0x2622d0]={'$like':'%'+_0x5dabd2['query'][_0x3920('0x31')]+'%'};return _0x22a7e7;})});}_0x1fa890=_[_0x3920('0x5c')]({},_0x1fa890,_0x5dabd2[_0x3920('0x5d')]);return _0x5ad797['getFaxInteractions'](_0x1fa890);}})[_0x3920('0x14')](function(_0x1c3d66){if(_0x1c3d66){_0x2a2b17=_0x1c3d66[_0x3920('0x4a')];if(!_0x5dabd2['query'][_0x3920('0xc2')](_0x3920('0xc8'))){_0x1fa890[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x5dabd2['query'][_0x3920('0x23')]);_0x1fa890[_0x3920('0x25')]=qs[_0x3920('0x25')](_0x5dabd2['query'][_0x3920('0x25')]);}return _0x5ad797[_0x3920('0xdd')](_0x1fa890);}})['then'](function(_0x3414b8){if(_0x3414b8){return _0x3414b8?{'count':_0x2a2b17,'rows':_0x3414b8}:null;}})[_0x3920('0x14')](respondWithResult(_0x1c8952,null))[_0x3920('0x52')](handleError(_0x1c8952,null));};exports[_0x3920('0xde')]=function(_0x5ac5f3,_0x59b8cf){var _0x5ec412={};var _0x960422={};var _0x1c014f;var _0x3a32a6;return db['User']['findOne']({'where':{'id':_0x5ac5f3[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x59b8cf,null))[_0x3920('0x14')](function(_0x24343b){if(_0x24343b){_0x1c014f=_0x24343b;_0x960422['model']=_[_0x3920('0x57')](db['WhatsappInteraction'][_0x3920('0x58')]);_0x960422[_0x3920('0x41')]=_[_0x3920('0x57')](_0x5ac5f3[_0x3920('0x41')]);_0x960422['filters']=_[_0x3920('0x5a')](_0x960422[_0x3920('0x55')],_0x960422['query']);_0x5ec412['attributes']=_[_0x3920('0x5a')](_0x960422['model'],qs[_0x3920('0x5b')](_0x5ac5f3['query']['fields']));_0x5ec412['attributes']=_0x5ec412[_0x3920('0x46')][_0x3920('0x4a')]?_0x5ec412[_0x3920('0x46')]:_0x960422[_0x3920('0x55')];_0x5ec412[_0x3920('0xcb')]=qs[_0x3920('0xbf')](_0x5ac5f3['query']['sort']);_0x5ec412[_0x3920('0xc0')]=qs['filters'](_['pick'](_0x5ac5f3[_0x3920('0x41')],_0x960422[_0x3920('0x59')]));if(_0x5ac5f3[_0x3920('0x41')][_0x3920('0x31')]){_0x5ec412[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0x5ec412[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x5ec412[_0x3920('0x46')],function(_0x12f4dd){var _0x474e26={};_0x474e26[_0x12f4dd]={'$like':'%'+_0x5ac5f3[_0x3920('0x41')][_0x3920('0x31')]+'%'};return _0x474e26;})});}_0x5ec412=_[_0x3920('0x5c')]({},_0x5ec412,_0x5ac5f3[_0x3920('0x5d')]);return _0x1c014f[_0x3920('0xde')](_0x5ec412);}})[_0x3920('0x14')](function(_0x4b69c2){if(_0x4b69c2){_0x3a32a6=_0x4b69c2[_0x3920('0x4a')];if(!_0x5ac5f3['query'][_0x3920('0xc2')](_0x3920('0xc8'))){_0x5ec412[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x5ac5f3[_0x3920('0x41')][_0x3920('0x23')]);_0x5ec412['offset']=qs['offset'](_0x5ac5f3[_0x3920('0x41')][_0x3920('0x25')]);}return _0x1c014f['getWhatsappInteractions'](_0x5ec412);}})['then'](function(_0x536b9c){if(_0x536b9c){return _0x536b9c?{'count':_0x3a32a6,'rows':_0x536b9c}:null;}})['then'](respondWithResult(_0x59b8cf,null))['catch'](handleError(_0x59b8cf,null));};exports['login']=function(_0x19eed6,_0x1fa6ff,_0x1efa0a){var _0x5e2a6b;var _0x417657;var _0x5adf74;var _0x27159a=!_[_0x3920('0x69')](_0x19eed6[_0x3920('0x54')]['id'])?_0x19eed6[_0x3920('0x54')]['id']:!_[_0x3920('0x69')](_0x19eed6[_0x3920('0x2e')]['id'])?_0x19eed6['user']['id']:null;return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x27159a,'role':{'$or':['admin','user',_0x3920('0x2f')]}},'attributes':['id',_0x3920('0x37'),_0x3920('0xdf'),_0x3920('0xe0'),_0x3920('0x2c'),_0x3920('0x68'),_0x3920('0xe1')]})[_0x3920('0x14')](function(_0x775c4c){if(_0x775c4c){if(_0x775c4c[_0x3920('0x2c')]==='agent'){_0x5e2a6b=_0x775c4c;if(_0x19eed6['body'][_0x3920('0x98')]){_0x5adf74=util[_0x3920('0xe2')](_0x3920('0xe3'),_0x5e2a6b[_0x19eed6[_0x3920('0x61')][_0x3920('0x98')]]);}else if(_0x19eed6[_0x3920('0x61')]['intrf']){_0x5adf74=util[_0x3920('0xe2')]('SIP/%s',_0x19eed6[_0x3920('0x61')][_0x3920('0xe4')]);}else{_0x5adf74=util['format']('SIP/%s',_0x5e2a6b[_0x3920('0x37')]);}socket['to'](util[_0x3920('0xe2')](_0x3920('0xe5'),_0x5e2a6b[_0x3920('0x37')]))[_0x3920('0x28')](_0x3920('0xe6'),{'user':{'id':_0x5e2a6b['id'],'name':_0x5e2a6b[_0x3920('0x37')]},'ip':_0x19eed6[_0x3920('0xe7')][_0x3920('0xe8')]||_0x19eed6[_0x3920('0xe9')][_0x3920('0xea')]||_0x19eed6[_0x3920('0xeb')][_0x3920('0xea')]||_0x19eed6[_0x3920('0xe9')][_0x3920('0xeb')][_0x3920('0xea')]});return db[_0x3920('0xa6')]['destroy']({'where':{'membername':_0x5e2a6b[_0x3920('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x3920('0x8c'))][(_0x3920('0x8d'))](_0x3920('0xec'));}})['then'](function(){if(_0x5e2a6b){return _0x5e2a6b['getVoiceQueues']({'raw':!![]});}})[_0x3920('0x14')](function(_0x2e94cb){if(_0x5e2a6b){if(_0x2e94cb){_0x417657=_0x2e94cb;if(_0x417657[_0x3920('0x4a')]){var _0x436aa3=_0x417657[_0x3920('0x33')](function(_0x280314){var _0x295025={'membername':_0x5e2a6b[_0x3920('0x37')],'UserId':_0x5e2a6b['id'],'queue_name':_0x280314[_0x3920('0x37')],'VoiceQueueId':_0x280314['id'],'interface':_0x5adf74,'paused':_0x5e2a6b[_0x3920('0xe1')]||![],'penalty':_0x280314[_0x3920('0xed')]||0x0};return db['UserVoiceQueueRt'][_0x3920('0xa7')](_0x295025);});return Promise[_0x3920('0x51')](_0x436aa3);}}}})[_0x3920('0x14')](function(){if(_0x5e2a6b){return db[_0x3920('0xee')][_0x3920('0x48')]({'where':{'membername':_0x5e2a6b[_0x3920('0x37')],'exitAt':null}});}})[_0x3920('0x14')](function(_0x1e9343){if(_0x5e2a6b){var _0x334c1c=[];_0x1e9343['forEach'](function(_0x5df92c){_0x334c1c[_0x3920('0x47')](_0x5df92c[_0x3920('0x60')]({'exitAt':moment()['format'](_0x3920('0xef'))}));});return Promise['all'](_0x334c1c);}})[_0x3920('0x14')](function(){if(_0x5e2a6b){var _0x995492=[];var _0xb954f7=[];var _0x5d57e5=utils['getChannels']();var _0x233565={'membername':_0x5e2a6b[_0x3920('0x37')],'interface':_0x5adf74,'enterAt':moment()[_0x3920('0xe2')](_0x3920('0xef')),'role':_0x5e2a6b[_0x3920('0x2c')],'internal':_0x5e2a6b['internal']};_0x5d57e5['forEach'](function(_0x57d730){_0x995492['push'](_[_0x3920('0x5c')]({'channel':_0x57d730,'type':'LOGIN','data1':_0x19eed6['body'][_0x3920('0xf0')],'data2':_0x5adf74},_0x233565));if(_0x5e2a6b['loginInPause']){_0xb954f7[_0x3920('0x47')](_[_0x3920('0x5c')]({'channel':_0x57d730,'type':_0x3920('0xf1'),'data1':_0x3920('0xf2')},_0x233565));}});return db[_0x3920('0xee')]['bulkCreate'](_0x995492['concat'](_0xb954f7),{'individualHooks':!![]});}})['then'](function(){if(_0x5e2a6b){return _0x5e2a6b[_0x3920('0x60')]({'online':!![],'lastLoginAt':moment()[_0x3920('0xe2')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5e2a6b[_0x3920('0xe1')]||![],'mailPause':_0x5e2a6b[_0x3920('0xe1')]||![],'chatPause':_0x5e2a6b[_0x3920('0xe1')]||![],'faxPause':_0x5e2a6b[_0x3920('0xe1')]||![],'smsPause':_0x5e2a6b[_0x3920('0xe1')]||![],'openchannelPause':_0x5e2a6b[_0x3920('0xe1')]||![],'whatsappPause':_0x5e2a6b[_0x3920('0xe1')]||![],'pauseType':_0x5e2a6b[_0x3920('0xe1')]?'LOGININPAUSE':null,'interface':_0x5adf74,'lastPauseAt':moment()[_0x3920('0xe2')](_0x3920('0xef'))});}})[_0x3920('0x14')](function(_0xc553ec){if(_0x19eed6[_0x3920('0xf3')]){return _0x1efa0a();}else{return Promise[_0x3920('0xf4')](_0xc553ec)[_0x3920('0x14')](respondWithResult(_0x1fa6ff,null));}})[_0x3920('0x52')](handleError(_0x1fa6ff,null));};exports[_0x3920('0xf5')]=function(_0x187895,_0x184dea){var _0x21ae59;return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x187895['params']['id'],'role':_0x3920('0x2f')},'attributes':['id',_0x3920('0x37'),_0x3920('0x2c')]})[_0x3920('0x14')](handleEntityNotFound(_0x184dea,null))[_0x3920('0x14')](function(_0x382307){if(_0x382307){_0x21ae59=_0x382307;return db[_0x3920('0xa6')][_0x3920('0x2a')]({'where':{'membername':_0x21ae59[_0x3920('0x37')]},'individualHooks':!![]});}})[_0x3920('0x14')](function(){return db[_0x3920('0xee')]['findAll']({'where':{'membername':_0x21ae59[_0x3920('0x37')],'exitAt':null}});})[_0x3920('0x14')](function(_0x37218f){var _0x14239b=[];_0x37218f[_0x3920('0xf6')](function(_0x5d6b16){_0x14239b[_0x3920('0x47')](_0x5d6b16['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x3920('0x51')](_0x14239b);})[_0x3920('0x14')](function(){return _0x21ae59[_0x3920('0x60')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x3920('0x14')](respondWithResult(_0x184dea,null))[_0x3920('0x52')](handleError(_0x184dea,null));};exports[_0x3920('0xf7')]=function(_0x2dc7b3,_0x262d34){var _0x238af0;return db[_0x3920('0xa6')][_0x3920('0x60')]({'paused':0x1},{'where':{'UserId':_0x2dc7b3['params']['id']},'individualHooks':!![]})[_0x3920('0x14')](function(){return db[_0x3920('0x3a')][_0x3920('0x36')]({'where':{'id':_0x2dc7b3[_0x3920('0x54')]['id'],'role':_0x3920('0x2f')},'attributes':['id','name',_0x3920('0x2c'),_0x3920('0x68'),_0x3920('0x98'),_0x3920('0x97')]});})[_0x3920('0x14')](handleEntityNotFound(_0x262d34,null))['then'](function(_0x50d2b4){if(_0x50d2b4){_0x238af0=_0x50d2b4;return respondWithRpcPromise(_0x3920('0xf8'),_0x3920('0xf7'),{'id':_0x238af0['id'],'name':_0x238af0[_0x3920('0x37')],'pause':!![]});}})[_0x3920('0x14')](function(){if(_0x238af0){return db['MemberReport'][_0x3920('0x48')]({'where':{'membername':_0x238af0[_0x3920('0x37')],'type':'PAUSE','exitAt':null}});}})[_0x3920('0x14')](function(_0x57471e){if(_0x57471e['length']){var _0x2bcd5d=moment()[_0x3920('0xe2')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4064e7=0x0,_0x38926b=_0x57471e[_0x3920('0x4a')];_0x4064e7<_0x38926b;_0x4064e7++){_0x57471e[_0x4064e7][_0x3920('0xf9')]({'exitAt':_0x2bcd5d});}}})[_0x3920('0x14')](function(){var _0xdd4381=[];var _0x18bf21=utils[_0x3920('0xfa')]();_0x18bf21[_0x3920('0xf6')](function(_0x1e528c){_0xdd4381[_0x3920('0x47')]({'channel':_0x1e528c,'membername':_0x238af0[_0x3920('0x37')],'interface':_[_0x3920('0x69')](_0x238af0['interface'])?util['format'](_0x3920('0xa5'),_0x238af0[_0x3920('0x37')]):_0x238af0[_0x3920('0x98')],'type':_0x3920('0xf1'),'enterAt':moment()[_0x3920('0xe2')](_0x3920('0xef')),'data1':_0x2dc7b3[_0x3920('0x61')][_0x3920('0x3c')]||_0x3920('0xfb'),'role':_0x238af0[_0x3920('0x2c')],'internal':_0x238af0[_0x3920('0x68')]});});return db[_0x3920('0xee')][_0x3920('0xfc')](_0xdd4381,{'individualHooks':!![]});})[_0x3920('0x14')](function(){return _0x238af0['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2dc7b3[_0x3920('0x61')][_0x3920('0x3c')]||_0x3920('0xfb'),'lastPauseAt':moment()[_0x3920('0xe2')](_0x3920('0xef'))});})['then'](respondWithResult(_0x262d34,null))[_0x3920('0x52')](handleError(_0x262d34,null));};exports[_0x3920('0xfd')]=function(_0x10cef5,_0x22cac4){if(_0x10cef5['body'][_0x3920('0xa9')]&&!utils[_0x3920('0x99')](_0x10cef5[_0x3920('0x61')]['channel'])){throw new APIBadRequestError(util['format'](_0x3920('0xfe'),_0x10cef5['body']['channel']));}return db['User'][_0x3920('0x36')]({'where':{'id':_0x10cef5[_0x3920('0x54')]['id']},'attributes':['id',_0x3920('0x37'),_0x3920('0x2c'),_0x3920('0x68'),_0x3920('0x98'),'online',_0x3920('0xff'),_0x3920('0x100'),_0x3920('0x101'),_0x3920('0x102'),_0x3920('0x103'),'smsPause','whatsappPause',_0x3920('0x104'),_0x3920('0x105')]})[_0x3920('0x14')](function(_0x666969){if(!_0x666969){throw new APINotFoundError(util[_0x3920('0xe2')](_0x3920('0x106'),_0x10cef5[_0x3920('0x54')]['id']));}return _0x666969[_0x3920('0xfd')](_0x10cef5['body'][_0x3920('0xa9')]);})[_0x3920('0x14')](respondWithResult(_0x22cac4,null))[_0x3920('0x52')](APIHandleError(_0x22cac4));};exports[_0x3920('0x107')]=function(_0x4d9dd4,_0x57ed49){var _0x50f501={};var _0x10c5de={};var _0x213331;var _0x58d7a0;return db[_0x3920('0x3a')][_0x3920('0xca')]({'where':{'id':_0x4d9dd4[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x57ed49,null))[_0x3920('0x14')](function(_0x2432f2){if(_0x2432f2){_0x213331=_0x2432f2;_0x10c5de[_0x3920('0x55')]=_[_0x3920('0x57')](db['Team']['rawAttributes']);_0x10c5de[_0x3920('0x41')]=_['keys'](_0x4d9dd4[_0x3920('0x41')]);_0x10c5de[_0x3920('0x59')]=_[_0x3920('0x5a')](_0x10c5de[_0x3920('0x55')],_0x10c5de[_0x3920('0x41')]);_0x50f501[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x10c5de[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x4d9dd4[_0x3920('0x41')]['fields']));_0x50f501['attributes']=_0x50f501[_0x3920('0x46')]['length']?_0x50f501[_0x3920('0x46')]:_0x10c5de[_0x3920('0x55')];_0x50f501['order']=qs[_0x3920('0xbf')](_0x4d9dd4[_0x3920('0x41')]['sort']);_0x50f501[_0x3920('0xc0')]=qs['filters'](_['pick'](_0x4d9dd4[_0x3920('0x41')],_0x10c5de[_0x3920('0x59')]));if(_0x4d9dd4[_0x3920('0x41')][_0x3920('0x31')]){_0x50f501[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0x50f501[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x50f501[_0x3920('0x46')],function(_0x2f4ff4){var _0x1ce88e={};_0x1ce88e[_0x2f4ff4]={'$like':'%'+_0x4d9dd4[_0x3920('0x41')][_0x3920('0x31')]+'%'};return _0x1ce88e;})});}_0x50f501=_[_0x3920('0x5c')]({},_0x50f501,_0x4d9dd4[_0x3920('0x5d')]);return _0x213331[_0x3920('0x107')](_0x50f501);}})['then'](function(_0x41514f){if(_0x41514f){_0x58d7a0=_0x41514f[_0x3920('0x4a')];if(!_0x4d9dd4[_0x3920('0x41')][_0x3920('0xc2')](_0x3920('0xc8'))){_0x50f501[_0x3920('0x23')]=qs[_0x3920('0x23')](_0x4d9dd4['query'][_0x3920('0x23')]);_0x50f501['offset']=qs[_0x3920('0x25')](_0x4d9dd4[_0x3920('0x41')][_0x3920('0x25')]);}return _0x213331[_0x3920('0x107')](_0x50f501);}})[_0x3920('0x14')](function(_0xbc8aba){if(_0xbc8aba){return _0xbc8aba?{'count':_0x58d7a0,'rows':_0xbc8aba}:null;}})['then'](respondWithResult(_0x57ed49,null))[_0x3920('0x52')](handleError(_0x57ed49,null));};exports[_0x3920('0x108')]=function(_0x482acb,_0x8dbdeb){var _0xa01773=_0x482acb[_0x3920('0x54')]['id'];var _0x155809=_0x482acb['body']?_0x482acb[_0x3920('0x61')][_0x3920('0x63')]:null;var _0x228298=[];return Promise[_0x3920('0xf4')]()[_0x3920('0x14')](function(){if(!_0x155809)throw new APIBadRequestError(_0x3920('0x109'));})[_0x3920('0x14')](function(){return db['User'][_0x3920('0xca')]({'where':{'id':_0xa01773}});})['then'](function(_0x33fbf9){if(!_0x33fbf9)throw new APINotFoundError(util[_0x3920('0xe2')](_0x3920('0x106'),_0x482acb['params']['id']));return db['sequelize']['transaction'](function(_0x40c960){return _0x33fbf9[_0x3920('0x108')](_0x155809,{'transaction':_0x40c960})[_0x3920('0x14')](function(){return db[_0x3920('0x10a')][_0x3920('0x48')]({'where':{'id':{'$in':_0x155809}}});})[_0x3920('0x14')](function(_0x53a59b){var _0x374556=_[_0x3920('0x33')](_0x53a59b,function(_0x30582c){return _0x30582c[_0x3920('0x10b')]();});return Promise[_0x3920('0x51')](_0x374556);})[_0x3920('0x14')](function(_0x54f369){_0x228298=_['flattenDeep'](_0x54f369);var _0x3c3a60=_['map'](_0x228298,function(_0x146719){return _0x146719[_0x3920('0x10c')](_0x33fbf9['id'],{'transaction':_0x40c960});});return Promise[_0x3920('0x51')](_0x3c3a60);})[_0x3920('0x14')](function(){if(!_0x33fbf9[_0x3920('0x97')])return;var _0x5c9b21=_[_0x3920('0x31')](_0x228298,function(_0x4d9e27){return _0x4d9e27['getDataValue'](_0x3920('0xa9'))===_0x3920('0x10d');});var _0x3244e3=_[_0x3920('0x33')](_0x5c9b21,function(_0x30a814){return db[_0x3920('0xa6')][_0x3920('0xa7')]({'membername':_0x33fbf9[_0x3920('0x37')],'UserId':_0x33fbf9['id'],'queue_name':_0x30a814[_0x3920('0x37')],'VoiceQueueId':_0x30a814['id'],'interface':_[_0x3920('0x69')](_0x33fbf9['interface'])?util[_0x3920('0xe2')](_0x3920('0xa5'),_0x33fbf9[_0x3920('0x37')]):_0x33fbf9[_0x3920('0x98')],'paused':_0x33fbf9[_0x3920('0xff')]||![],'penalty':_0x33fbf9[_0x3920('0x9f')]},{'transaction':_0x40c960});});return Promise[_0x3920('0x51')](_0x3244e3);})[_0x3920('0x14')](function(){return db[_0x3920('0x10e')][_0x3920('0x48')]({'where':{'teamId':{'$in':_0x155809}}});})[_0x3920('0x14')](function(_0x22fcd0){var _0x4ad60d=_[_0x3920('0x33')](_0x22fcd0,function(_0x511233){return db[_0x3920('0x10f')][_0x3920('0x7d')]({'UserId':_0x33fbf9['id'],'VoicePrefixId':_0x511233[_0x3920('0x110')]},{'transaction':_0x40c960});});return Promise[_0x3920('0x51')](_0x4ad60d);});});})['then'](function(){for(var _0x4e3d8f=0x0;_0x4e3d8f<_0x228298[_0x3920('0x4a')];_0x4e3d8f++){var _0x3c8345=_0x228298[_0x4e3d8f]['getDataValue'](_0x3920('0xa9'));var _0x140470=_0x3c8345+_0x3920('0xa1');socket[_0x3920('0x28')](_0x3920('0x2e')+_0x3c8345+_0x3920('0xa2'),{'UserId':_0xa01773,['queueField']:_0x228298[_0x4e3d8f]['id']});}})[_0x3920('0x14')](respondWithStatusCode(_0x8dbdeb,null))[_0x3920('0x52')](APIHandleError(_0x8dbdeb));};exports[_0x3920('0x111')]=function(_0xeb9593,_0x5dc5c1){var _0x2b4f5e=_0xeb9593[_0x3920('0x54')]['id'];var _0x4d31f8=null;if(_0xeb9593[_0x3920('0x41')]['ids']){_0x4d31f8=_[_0x3920('0xab')](_0xeb9593[_0x3920('0x41')][_0x3920('0x63')])?_0xeb9593[_0x3920('0x41')]['ids']:[_0xeb9593['query'][_0x3920('0x63')]];}var _0x54935f=[];return Promise[_0x3920('0xf4')]()[_0x3920('0x14')](function(){if(!_0x4d31f8)throw new APIBadRequestError(_0x3920('0x112'));})['then'](function(){return db['User'][_0x3920('0xca')]({'where':{'id':_0x2b4f5e}});})[_0x3920('0x14')](function(_0x20c8cf){if(!_0x20c8cf)throw new APINotFoundError(util[_0x3920('0xe2')](_0x3920('0x106'),_0xeb9593[_0x3920('0x54')]['id']));return db[_0x3920('0x6b')]['transaction'](function(_0x292bcb){return _0x20c8cf[_0x3920('0x111')](_0x4d31f8,{'transaction':_0x292bcb})[_0x3920('0x14')](function(){return db[_0x3920('0x10a')][_0x3920('0x48')]({'where':{'id':{'$in':_0x4d31f8}}});})[_0x3920('0x14')](function(_0x1295da){var _0x2afb3c=_[_0x3920('0x33')](_0x1295da,function(_0x2cb8f3){return _0x2cb8f3[_0x3920('0x10b')]();});return Promise['all'](_0x2afb3c);})[_0x3920('0x14')](function(_0x1508d9){_0x54935f=_[_0x3920('0x113')](_0x1508d9);var _0x263a75=_[_0x3920('0x33')](_0x54935f,function(_0xeabb11){return _0xeabb11[_0x3920('0x114')](_0x20c8cf['id'],{'transaction':_0x292bcb});});return Promise['all'](_0x263a75);})[_0x3920('0x14')](function(){if(!_0x20c8cf[_0x3920('0x97')])return;var _0x13ce5e=_[_0x3920('0x31')](_0x54935f,function(_0x16dce7){return _0x16dce7[_0x3920('0x115')](_0x3920('0xa9'))===_0x3920('0x10d');});var _0x56fdf8=_[_0x3920('0x33')](_0x13ce5e,function(_0x1fad39){return db[_0x3920('0xa6')][_0x3920('0x2a')]({'where':{'VoiceQueueId':_0x1fad39['id'],'UserId':_0x20c8cf['id']},'transaction':_0x292bcb});});return Promise['all'](_0x56fdf8);})[_0x3920('0x14')](function(){return db[_0x3920('0x10e')][_0x3920('0x48')]({'where':{'teamId':{'$in':_0x4d31f8}}});})[_0x3920('0x14')](function(_0x589563){var _0x5863d9=_['map'](_0x589563,function(_0x383337){return db[_0x3920('0x10f')][_0x3920('0x2a')]({'where':{'UserId':_0x20c8cf['id'],'VoicePrefixId':_0x383337[_0x3920('0x110')]}},{'transaction':_0x292bcb});});return Promise[_0x3920('0x51')](_0x5863d9);});});})[_0x3920('0x14')](function(){for(var _0x4d136e=0x0;_0x4d136e<_0x54935f[_0x3920('0x4a')];_0x4d136e++){var _0xf8eaeb=_0x54935f[_0x4d136e]['getDataValue']('channel');var _0x12ca32=_0xf8eaeb+_0x3920('0xa1');socket[_0x3920('0x28')](_0x3920('0x2e')+_0xf8eaeb+'Queue:remove',{'UserId':_0x2b4f5e,['queueField']:_0x54935f[_0x4d136e]['id']});}})[_0x3920('0x14')](respondWithStatusCode(_0x5dc5c1,null))[_0x3920('0x52')](APIHandleError(_0x5dc5c1));};exports[_0x3920('0x116')]=function(_0xd97f01,_0xdeb8d8){var _0x3912ca={};var _0xdb9043={};var _0x187335;var _0x32da74;return db[_0x3920('0x3a')]['findOne']({'where':{'id':_0xd97f01[_0x3920('0x54')]['id']}})['then'](handleEntityNotFound(_0xdeb8d8,null))[_0x3920('0x14')](function(_0x5ae401){if(_0x5ae401){_0x187335=_0x5ae401;_0xdb9043[_0x3920('0x55')]=_[_0x3920('0x57')](db[_0x3920('0xc3')]['rawAttributes']);_0xdb9043[_0x3920('0x41')]=_[_0x3920('0x57')](_0xd97f01[_0x3920('0x41')]);_0xdb9043[_0x3920('0x59')]=_[_0x3920('0x5a')](_0xdb9043[_0x3920('0x55')],_0xdb9043[_0x3920('0x41')]);_0x3912ca[_0x3920('0x46')]=_[_0x3920('0x5a')](_0xdb9043[_0x3920('0x55')],qs[_0x3920('0x5b')](_0xd97f01[_0x3920('0x41')][_0x3920('0x5b')]));_0x3912ca[_0x3920('0x46')]=_0x3912ca['attributes']['length']?_0x3912ca[_0x3920('0x46')]:_0xdb9043[_0x3920('0x55')];_0x3912ca[_0x3920('0xcb')]=qs['sort'](_0xd97f01[_0x3920('0x41')][_0x3920('0xbf')]);_0x3912ca[_0x3920('0xc0')]=qs[_0x3920('0x59')](_['pick'](_0xd97f01[_0x3920('0x41')],_0xdb9043['filters']));if(_0xd97f01[_0x3920('0x41')][_0x3920('0x31')]){_0x3912ca[_0x3920('0xc0')]=_[_0x3920('0x5c')](_0x3912ca[_0x3920('0xc0')],{'$or':_[_0x3920('0x33')](_0x3912ca['attributes'],function(_0x2fd447){var _0x42ce43={};_0x42ce43[_0x2fd447]={'$like':'%'+_0xd97f01['query'][_0x3920('0x31')]+'%'};return _0x42ce43;})});}_0x3912ca=_['merge']({},_0x3912ca,_0xd97f01['options']);return _0x187335[_0x3920('0x116')](_0x3912ca);}})[_0x3920('0x14')](function(_0x45519b){if(_0x45519b){_0x32da74=_0x45519b['length'];if(!_0xd97f01[_0x3920('0x41')]['hasOwnProperty'](_0x3920('0xc8'))){_0x3912ca[_0x3920('0x23')]=qs[_0x3920('0x23')](_0xd97f01[_0x3920('0x41')][_0x3920('0x23')]);_0x3912ca[_0x3920('0x25')]=qs['offset'](_0xd97f01[_0x3920('0x41')]['offset']);}return _0x187335['getLists'](_0x3912ca);}})['then'](function(_0x3de676){if(_0x3de676){return _0x3de676?{'count':_0x32da74,'rows':_0x3de676}:null;}})[_0x3920('0x14')](respondWithResult(_0xdeb8d8,null))[_0x3920('0x52')](handleError(_0xdeb8d8,null));};exports[_0x3920('0x117')]=function(_0x11377c,_0x435935){var _0x387fe0={};var _0x17f05a={};var _0x35dfa1;return db[_0x3920('0x3a')]['findOne']({'where':{'id':_0x11377c[_0x3920('0x54')]['id']}})[_0x3920('0x14')](handleEntityNotFound(_0x435935,null))[_0x3920('0x14')](function(_0x4cd293){if(_0x4cd293){_0x35dfa1=_0x4cd293;_0x17f05a[_0x3920('0x55')]=_[_0x3920('0x57')](db[_0x3920('0x3a')][_0x3920('0x58')]);_0x17f05a['query']=_[_0x3920('0x57')](_0x11377c[_0x3920('0x41')]);_0x17f05a['filters']=_[_0x3920('0x5a')](_0x17f05a[_0x3920('0x55')],_0x17f05a[_0x3920('0x41')]);_0x387fe0[_0x3920('0x46')]=_[_0x3920('0x5a')](_0x17f05a[_0x3920('0x55')],qs[_0x3920('0x5b')](_0x11377c[_0x3920('0x41')][_0x3920('0x5b')]));_0x387fe0[_0x3920('0x46')]=_0x387fe0[_0x3920('0x46')][_0x3920('0x4a')]?_0x387fe0['attributes']:_0x17f05a[_0x3920('0x55')];_0x387fe0[_0x3920('0xcb')]=qs['sort'](_0x11377c['query']['sort']);_0x387fe0[_0x3920('0xc0')]=qs[_0x3920('0x59')](_[_0x3920('0xc1')](_0x11377c['query'],_0x17f05a[_0x3920('0x59')]));if(_0x11377c[_0x3920('0x41')][_0x3920('0x31')]){_0x387fe0['where']=_[_0x3920('0x5c')](_0x387fe0['where'],{'$or':_[_0x3920('0x33')](_0x387fe0[_0x3920('0x46')],function(_0x57e106){var _0x4690e0={};_0x4690e0[_0x57e106]={'$like':'%'+_0x11377c[_0x3920('0x41')][_0x3920('0x31')]+'%'};return _0x4690e0;})});}_0x387fe0[_0x3920('0x55')]=db['User'];_0x387fe0['as']=_0x3920('0x83');_0x387fe0=_[_0x3920('0x5c')]({},_0x387fe0,_0x11377c[_0x3920('0x5d')]);return _0x35dfa1[_0x3920('0x118')]({'include':[_0x387fe0]});}})[_0x3920('0x14')](function(_0x223c5b){if(_0x223c5b){var _0x10111b={},_0x48e8b6=[];for(var _0xe01adf=0x0;_0xe01adf<_0x223c5b[_0x3920('0x4a')];_0xe01adf+=0x1){for(var _0x1a273b=0x0,_0x4b5dbb;_0x1a273b<_0x223c5b[_0xe01adf][_0x3920('0x83')][_0x3920('0x4a')];_0x1a273b+=0x1){_0x4b5dbb=_0x223c5b[_0xe01adf]['Agents'][_0x1a273b][_0x3920('0x2b')]({'plain':!![]});_0x10111b[_0x4b5dbb['id']]=_0x4b5dbb;}}_0x10111b=_[_0x3920('0x119')](_0x10111b);for(var _0x12dc4e=qs[_0x3920('0x25')](_0x11377c[_0x3920('0x41')][_0x3920('0x25')]);_0x12dc4e<_0x10111b[_0x3920('0x4a')]&&_0x48e8b6['length']=_0x148aa8['agents']){throw new Error(_0xd281('0x4b'));}})[_0xd281('0x17')](function(){if(_0x416b4f){return db[_0xd281('0x4c')]['destroy']({'where':{'membername':_0x416b4f[_0xd281('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x416b4f){return _0x416b4f[_0xd281('0x4d')]({'raw':!![]});}})[_0xd281('0x17')](function(_0x363685){if(_0x416b4f){if(_0x363685){var _0x5c634c=[];_0x4761cf=_0x363685;if(_0x4761cf[_0xd281('0x25')]){for(var _0x58e249=0x0;_0x58e249<_0x4761cf[_0xd281('0x25')];_0x58e249++){_0x5c634c['push'](db[_0xd281('0x4c')]['upsert']({'membername':_0x416b4f['name'],'UserId':_0x416b4f['id'],'queue_name':_0x4761cf[_0x58e249][_0xd281('0x21')],'VoiceQueueId':_0x4761cf[_0x58e249]['id'],'interface':_0x4da403,'paused':_0x416b4f[_0xd281('0x4e')]||![],'penalty':_0x4761cf[_0x58e249][_0xd281('0x4f')]||0x0}));}return BPromise['all'](_0x5c634c);}}}})[_0xd281('0x17')](function(){if(_0x416b4f){return db[_0xd281('0x24')][_0xd281('0xe')]({'where':{'membername':_0x416b4f['name'],'exitAt':null}});}})['then'](function(_0x25fd81){if(_0x416b4f){if(_0x25fd81&&_0x25fd81[_0xd281('0x25')]){var _0x592579=[];_0x25fd81[_0xd281('0x43')](function(_0x41adb1){_0x592579[_0xd281('0x44')](_0x41adb1['update']({'exitAt':moment()[_0xd281('0x26')](_0xd281('0x27'))}));});return BPromise[_0xd281('0x45')](_0x592579);}}})[_0xd281('0x17')](function(){if(_0x416b4f){var _0x57d0a9=[];var _0x4810b6=[];var _0x2aa156=utils[_0xd281('0x50')]();var _0x2b527a={'membername':_0x416b4f[_0xd281('0x21')],'interface':_0x4da403,'enterAt':moment()[_0xd281('0x26')](_0xd281('0x27')),'role':_0x416b4f[_0xd281('0x2e')],'internal':_0x416b4f['internal']};_0x2aa156[_0xd281('0x43')](function(_0x324287){_0x57d0a9[_0xd281('0x44')](_[_0xd281('0x51')]({'channel':_0x324287,'type':'LOGIN','data1':'callysquare','data2':_0x4da403},_0x2b527a));if(_0x416b4f[_0xd281('0x4e')]){_0x4810b6[_0xd281('0x44')](_['merge']({'channel':_0x324287,'type':_0xd281('0x2a'),'data1':'LOGININPAUSE'},_0x2b527a));}});return db[_0xd281('0x24')][_0xd281('0x30')](_0x57d0a9['concat'](_0x4810b6),{'individualHooks':!![]});}})[_0xd281('0x17')](function(){if(_0x416b4f){return _0x416b4f[_0xd281('0x23')]({'online':!![],'lastLoginAt':moment()['format'](_0xd281('0x27')),'voicePause':_0x416b4f[_0xd281('0x4e')]||![],'mailPause':_0x416b4f[_0xd281('0x4e')]||![],'chatPause':_0x416b4f[_0xd281('0x4e')]||![],'faxPause':_0x416b4f[_0xd281('0x4e')]||![],'smsPause':_0x416b4f[_0xd281('0x4e')]||![],'openchannelPause':_0x416b4f[_0xd281('0x4e')]||![],'pauseType':_0x416b4f[_0xd281('0x4e')]?_0xd281('0x52'):null,'lastPauseAt':moment()[_0xd281('0x26')](_0xd281('0x27')),'interface':_0x4da403});}})[_0xd281('0x17')](function(_0x3c4de8){_0x20df6a(_0x3c4de8);})[_0xd281('0x1b')](function(_0x173ab2){_0x3fabc1(_0x467f12[_0xd281('0x1c')](0x1f4,_0x173ab2[_0xd281('0x1f')]));});});}; \ No newline at end of file +var _0x10c3=['push','all','LoginUser','findOne','mobile','phone','loginInPause','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueue.penalty','merge','LOGININPAUSE','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','error','message','ShowUser','find','then','info','name','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','format','length','updateAttributes','getChannels','isNil','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','role','bulkCreate','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','faxPause','smsPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','params','unpause','system','LogoutUser','forEach'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x10c3,0x158));var _0x310c=function(_0x23bd68,_0x2912b0){_0x23bd68=_0x23bd68-0x0;var _0x2f7d4f=_0x10c3[_0x23bd68];return _0x2f7d4f;};'use strict';var _=require(_0x310c('0x0'));var util=require('util');var moment=require(_0x310c('0x1'));var BPromise=require(_0x310c('0x2'));var Redis=require(_0x310c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x310c('0x4'));var logger=require(_0x310c('0x5'))(_0x310c('0x6'));var config=require(_0x310c('0x7'));config[_0x310c('0x8')]=_[_0x310c('0x9')](config[_0x310c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x310c('0xa'))(new Redis(config[_0x310c('0x8')]));require('./user.socket')[_0x310c('0xb')](socket);exports[_0x310c('0xc')]=function(_0x5932a9){var _0x5388e9=this;return new Promise(function(_0xe451f1,_0x5bc131){return db[_0x310c('0xd')][_0x310c('0xe')]({'raw':_0x5932a9[_0x310c('0xf')]?_0x5932a9[_0x310c('0xf')][_0x310c('0x10')]===undefined?!![]:![]:!![],'where':_0x5932a9['options']?_0x5932a9[_0x310c('0xf')][_0x310c('0x11')]||null:null,'attributes':_0x5932a9['options']?_0x5932a9[_0x310c('0xf')][_0x310c('0x12')]||null:null,'limit':_0x5932a9[_0x310c('0xf')]?_0x5932a9[_0x310c('0xf')][_0x310c('0x13')]||null:null,'include':_0x5932a9[_0x310c('0xf')]?_0x5932a9[_0x310c('0xf')][_0x310c('0x14')]?_[_0x310c('0x15')](_0x5932a9[_0x310c('0xf')]['include'],function(_0x581cdc){return{'model':db[_0x581cdc['model']],'as':_0x581cdc['as'],'attributes':_0x581cdc[_0x310c('0x12')],'include':_0x581cdc[_0x310c('0x14')]?_[_0x310c('0x15')](_0x581cdc['include'],function(_0x22f7f4){return{'model':db[_0x22f7f4[_0x310c('0x16')]],'as':_0x22f7f4['as'],'attributes':_0x22f7f4['attributes'],'include':_0x22f7f4['include']?_['map'](_0x22f7f4[_0x310c('0x14')],function(_0xcb927e){return{'model':db[_0xcb927e[_0x310c('0x16')]],'as':_0xcb927e['as'],'attributes':_0xcb927e[_0x310c('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x535fcc){logger['info'](_0x310c('0xc'),_0x5932a9);logger[_0x310c('0x17')](_0x310c('0xc'),_0x5932a9,JSON[_0x310c('0x18')](_0x535fcc));_0xe451f1(_0x535fcc);})[_0x310c('0x19')](function(_0x55f400){logger[_0x310c('0x1a')](_0x310c('0xc'),_0x55f400[_0x310c('0x1b')],_0x5932a9);_0x5bc131(_0x5388e9[_0x310c('0x1a')](0x1f4,_0x55f400[_0x310c('0x1b')]));});});};exports[_0x310c('0x1c')]=function(_0x175eb8){var _0x525c67=this;return new Promise(function(_0x41c2d1,_0x5ecb3e){return db[_0x310c('0xd')][_0x310c('0x1d')]({'raw':_0x175eb8['options']?_0x175eb8[_0x310c('0xf')]['raw']===undefined?!![]:![]:!![],'where':_0x175eb8['options']?_0x175eb8[_0x310c('0xf')][_0x310c('0x11')]||null:null,'attributes':_0x175eb8[_0x310c('0xf')]?_0x175eb8[_0x310c('0xf')][_0x310c('0x12')]||null:null,'include':_0x175eb8['options']?_0x175eb8[_0x310c('0xf')]['include']?_[_0x310c('0x15')](_0x175eb8['options'][_0x310c('0x14')],function(_0x3e818f){return{'model':db[_0x3e818f[_0x310c('0x16')]],'as':_0x3e818f['as'],'attributes':_0x3e818f[_0x310c('0x12')],'include':_0x3e818f[_0x310c('0x14')]?_[_0x310c('0x15')](_0x3e818f[_0x310c('0x14')],function(_0x316a5d){return{'model':db[_0x316a5d[_0x310c('0x16')]],'as':_0x316a5d['as'],'attributes':_0x316a5d['attributes'],'include':_0x316a5d[_0x310c('0x14')]?_[_0x310c('0x15')](_0x316a5d['include'],function(_0x582e7d){return{'model':db[_0x582e7d['model']],'as':_0x582e7d['as'],'attributes':_0x582e7d[_0x310c('0x12')]};}):[]};}):[]};}):[]:[]})[_0x310c('0x1e')](function(_0x4b1198){logger[_0x310c('0x1f')](_0x310c('0x1c'),_0x175eb8);logger[_0x310c('0x17')]('ShowUser',_0x175eb8,JSON[_0x310c('0x18')](_0x4b1198));_0x41c2d1(_0x4b1198);})['catch'](function(_0x579b53){logger[_0x310c('0x1a')](_0x310c('0x1c'),_0x579b53[_0x310c('0x1b')],_0x175eb8);_0x5ecb3e(_0x525c67[_0x310c('0x1a')](0x1f4,_0x579b53[_0x310c('0x1b')]));});});};exports['PauseUser']=function(_0x58b533){var _0x4e78cd=this;return new Promise(function(_0x3904b7,_0x35f9c9){var _0x4ad6f1;return db[_0x310c('0xd')]['find']({'where':_0x58b533[_0x310c('0xf')][_0x310c('0x11')]||{},'attributes':['id',_0x310c('0x20'),'role',_0x310c('0x21'),_0x310c('0x22')]})['then'](function(_0x47bb37){if(_0x47bb37){_0x4ad6f1=_0x47bb37;return db[_0x310c('0x23')][_0x310c('0x24')]({'paused':0x1},{'where':{'UserId':_0x4ad6f1['id']},'individualHooks':!![]});}})[_0x310c('0x1e')](function(){if(_0x4ad6f1){return db[_0x310c('0x25')][_0x310c('0xe')]({'where':{'membername':_0x4ad6f1[_0x310c('0x20')],'type':_0x310c('0x26'),'exitAt':null}});}})[_0x310c('0x1e')](function(_0x43ae6c){if(_0x4ad6f1){if(_0x43ae6c&&_0x43ae6c['length']){var _0xa0fa97=moment()[_0x310c('0x27')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x38dbb5=0x0,_0x4394a2=_0x43ae6c[_0x310c('0x28')];_0x38dbb5<_0x4394a2;_0x38dbb5++){_0x43ae6c[_0x38dbb5][_0x310c('0x29')]({'exitAt':_0xa0fa97});}}}})[_0x310c('0x1e')](function(){if(_0x4ad6f1){var _0x1e9945=[];var _0x3c66ba=utils[_0x310c('0x2a')]();_0x3c66ba['forEach'](function(_0x3475b3){_0x1e9945['push']({'channel':_0x3475b3,'membername':_0x4ad6f1[_0x310c('0x20')],'interface':_[_0x310c('0x2b')](_0x4ad6f1[_0x310c('0x22')])?util['format']('SIP/%s',_0x4ad6f1[_0x310c('0x20')]):_0x4ad6f1[_0x310c('0x22')],'type':_0x310c('0x26'),'enterAt':moment()[_0x310c('0x27')](_0x310c('0x2c')),'data1':_0x58b533[_0x310c('0x2d')][_0x310c('0x2e')]||_0x310c('0x2f'),'role':_0x4ad6f1[_0x310c('0x30')],'internal':_0x4ad6f1[_0x310c('0x21')],'uniqueid':_0x58b533[_0x310c('0x2d')]['uniqueid']||null});});return db[_0x310c('0x25')][_0x310c('0x31')](_0x1e9945,{'individualHooks':!![]});}})['then'](function(){if(_0x4ad6f1){return _0x4ad6f1[_0x310c('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x58b533[_0x310c('0x2d')][_0x310c('0x2e')]||_0x310c('0x2f'),'lastPauseAt':moment()[_0x310c('0x27')](_0x310c('0x2c'))});}})['then'](function(_0x5ca602){_0x3904b7(_0x5ca602);})[_0x310c('0x19')](function(_0x371771){_0x35f9c9(_0x4e78cd[_0x310c('0x1a')](0x1f4,_0x371771[_0x310c('0x1b')]));});});};exports['UnpauseUser']=function(_0xc2cfbd){var _0x384a31=this;return new Promise(function(_0x24edc5,_0x81e112){if(_0xc2cfbd[_0x310c('0x2d')]['channel']&&!utils['isValidChannel'](_0xc2cfbd['body'][_0x310c('0x32')])){throw new Error(util[_0x310c('0x27')](_0x310c('0x33'),_0xc2cfbd['body'][_0x310c('0x32')]));}return db[_0x310c('0xd')]['findOne']({'where':_0xc2cfbd[_0x310c('0xf')][_0x310c('0x11')]||{},'attributes':['id','name','role',_0x310c('0x21'),'interface',_0x310c('0x34'),_0x310c('0x35'),_0x310c('0x36'),_0x310c('0x37'),_0x310c('0x38'),'openchannelPause',_0x310c('0x39'),_0x310c('0x3a'),_0x310c('0x3b'),'lastPauseAt']})['then'](function(_0x571743){if(!_0x571743){throw new Error(util[_0x310c('0x27')](_0x310c('0x3c'),_0xc2cfbd[_0x310c('0x3d')]['id']));}return _0x571743[_0x310c('0x3e')](_0xc2cfbd[_0x310c('0x2d')][_0x310c('0x32')],_0x310c('0x3f'));})[_0x310c('0x1e')](function(_0x2fa6b9){_0x24edc5(_0x2fa6b9);})[_0x310c('0x19')](function(_0x5da911){_0x81e112(_0x384a31[_0x310c('0x1a')](0x1f4,_0x5da911[_0x310c('0x1b')]));});});};exports[_0x310c('0x40')]=function(_0x1c1fef){var _0x15c2ef=this;return new Promise(function(_0xfef816,_0x1fbc46){var _0x3753c9;return db[_0x310c('0xd')]['findOne']({'where':_0x1c1fef[_0x310c('0xf')][_0x310c('0x11')]||{},'attributes':['id','name']})[_0x310c('0x1e')](function(_0x50c2af){if(_0x50c2af){_0x3753c9=_0x50c2af;return db[_0x310c('0x23')]['destroy']({'where':{'membername':_0x3753c9['name']},'individualHooks':!![]});}})[_0x310c('0x1e')](function(){if(_0x3753c9){return db['MemberReport'][_0x310c('0xe')]({'where':{'membername':_0x3753c9['name'],'exitAt':null}});}})[_0x310c('0x1e')](function(_0x2f3b2e){if(_0x3753c9){if(_0x2f3b2e&&_0x2f3b2e['length']){var _0x1e615c=[];_0x2f3b2e[_0x310c('0x41')](function(_0x5ef06a){_0x1e615c[_0x310c('0x42')](_0x5ef06a['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x310c('0x43')](_0x1e615c);}}})[_0x310c('0x1e')](function(){if(_0x3753c9){return _0x3753c9[_0x310c('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x310c('0x1e')](function(_0x14fe87){_0xfef816(_0x14fe87);})['catch'](function(_0x5c3c4b){_0x1fbc46(_0x15c2ef['error'](0x1f4,_0x5c3c4b[_0x310c('0x1b')]));});});};exports[_0x310c('0x44')]=function(_0x1a8c48){var _0x4628c3=this;return new Promise(function(_0x11ddab,_0x4ee975){var _0x225a58;var _0x12d175;var _0x3732f6;var _0x2cf52a;return db[_0x310c('0xd')][_0x310c('0x45')]({'where':_0x1a8c48[_0x310c('0xf')][_0x310c('0x11')]||{},'attributes':['id','name',_0x310c('0x30'),_0x310c('0x46'),_0x310c('0x47'),_0x310c('0x21'),_0x310c('0x48'),_0x310c('0x22')]})[_0x310c('0x1e')](function(_0x416b22){if(_0x416b22){_0x225a58=_0x416b22;_0x2cf52a=_0x1a8c48['body'][_0x310c('0x22')]?_0x1a8c48[_0x310c('0x2d')]['interface']:util[_0x310c('0x27')](_0x310c('0x49'),_0x225a58[_0x310c('0x20')]);return db[_0x310c('0xd')][_0x310c('0x4a')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x225a58['id']}}});}})['then'](function(_0x2864be){if(_0x2864be){_0x3732f6=_0x2864be;return require(_0x310c('0x4b'))[_0x310c('0x4c')]();}})['then'](function(_0xbe8c06){if(_0xbe8c06&&_0xbe8c06[_0x310c('0x4d')]&&_0x3732f6>=_0xbe8c06['agents']){throw new Error(_0x310c('0x4e'));}})[_0x310c('0x1e')](function(){if(_0x225a58){return db[_0x310c('0x23')]['destroy']({'where':{'membername':_0x225a58[_0x310c('0x20')]},'individualHooks':!![]});}})[_0x310c('0x1e')](function(){if(_0x225a58){return _0x225a58['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x433fc3){if(_0x225a58){if(_0x433fc3){var _0x31afc6=[];_0x12d175=_0x433fc3;if(_0x12d175['length']){for(var _0x42f533=0x0;_0x42f533<_0x12d175[_0x310c('0x28')];_0x42f533++){_0x31afc6[_0x310c('0x42')](db[_0x310c('0x23')]['upsert']({'membername':_0x225a58[_0x310c('0x20')],'UserId':_0x225a58['id'],'queue_name':_0x12d175[_0x42f533][_0x310c('0x20')],'VoiceQueueId':_0x12d175[_0x42f533]['id'],'interface':_0x2cf52a,'paused':_0x225a58[_0x310c('0x48')]||![],'penalty':_0x12d175[_0x42f533][_0x310c('0x4f')]||0x0}));}return BPromise['all'](_0x31afc6);}}}})[_0x310c('0x1e')](function(){if(_0x225a58){return db[_0x310c('0x25')][_0x310c('0xe')]({'where':{'membername':_0x225a58[_0x310c('0x20')],'exitAt':null}});}})[_0x310c('0x1e')](function(_0x30d735){if(_0x225a58){if(_0x30d735&&_0x30d735[_0x310c('0x28')]){var _0xd990ac=[];_0x30d735[_0x310c('0x41')](function(_0x53ab57){_0xd990ac[_0x310c('0x42')](_0x53ab57[_0x310c('0x24')]({'exitAt':moment()[_0x310c('0x27')](_0x310c('0x2c'))}));});return BPromise['all'](_0xd990ac);}}})[_0x310c('0x1e')](function(){if(_0x225a58){var _0x2949e1=[];var _0x18e2a3=[];var _0x11d368=utils[_0x310c('0x2a')]();var _0x32d9e7={'membername':_0x225a58[_0x310c('0x20')],'interface':_0x2cf52a,'enterAt':moment()[_0x310c('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x225a58[_0x310c('0x30')],'internal':_0x225a58['internal']};_0x11d368[_0x310c('0x41')](function(_0x1d1a6a){_0x2949e1[_0x310c('0x42')](_['merge']({'channel':_0x1d1a6a,'type':'LOGIN','data1':'callysquare','data2':_0x2cf52a},_0x32d9e7));if(_0x225a58[_0x310c('0x48')]){_0x18e2a3[_0x310c('0x42')](_[_0x310c('0x50')]({'channel':_0x1d1a6a,'type':'PAUSE','data1':_0x310c('0x51')},_0x32d9e7));}});return db[_0x310c('0x25')][_0x310c('0x31')](_0x2949e1['concat'](_0x18e2a3),{'individualHooks':!![]});}})[_0x310c('0x1e')](function(){if(_0x225a58){return _0x225a58[_0x310c('0x24')]({'online':!![],'lastLoginAt':moment()[_0x310c('0x27')](_0x310c('0x2c')),'voicePause':_0x225a58[_0x310c('0x48')]||![],'mailPause':_0x225a58['loginInPause']||![],'chatPause':_0x225a58[_0x310c('0x48')]||![],'faxPause':_0x225a58['loginInPause']||![],'smsPause':_0x225a58['loginInPause']||![],'openchannelPause':_0x225a58[_0x310c('0x48')]||![],'pauseType':_0x225a58[_0x310c('0x48')]?_0x310c('0x51'):null,'lastPauseAt':moment()[_0x310c('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2cf52a});}})['then'](function(_0x67e609){_0x11ddab(_0x67e609);})[_0x310c('0x19')](function(_0x451bc0){_0x4ee975(_0x4628c3['error'](0x1f4,_0x451bc0[_0x310c('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 37be011..0d1ec6b 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 _0xc0b8=['./user.events','save','emit','length','user:'];(function(_0x1a0013,_0x23c6dc){var _0x17474c=function(_0x5f8fd7){while(--_0x5f8fd7){_0x1a0013['push'](_0x1a0013['shift']());}};_0x17474c(++_0x23c6dc);}(_0xc0b8,0x15e));var _0x8c0b=function(_0x113925,_0x3d97d){_0x113925=_0x113925-0x0;var _0x11fa7f=_0xc0b8[_0x113925];return _0x11fa7f;};'use strict';var UserEvents=require(_0x8c0b('0x0'));var events=[_0x8c0b('0x1'),'remove','update'];function createListener(_0x3e811f,_0x375085){return function(_0x2b209c){_0x375085[_0x8c0b('0x2')](_0x3e811f,_0x2b209c);};}function removeListener(_0x4a563d,_0x4f1d46){return function(){UserEvents['removeListener'](_0x4a563d,_0x4f1d46);};}exports['register']=function(_0xc9837d){for(var _0x59a861=0x0,_0x3a857d=events[_0x8c0b('0x3')];_0x59a861<_0x3a857d;_0x59a861++){var _0x26d05c=events[_0x59a861];var _0x457900=createListener(_0x8c0b('0x4')+_0x26d05c,_0xc9837d);UserEvents['on'](_0x26d05c,_0x457900);}}; \ No newline at end of file +var _0x10b7=['save','remove','update','./user.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10b7,0x163));var _0x710b=function(_0x30d4d2,_0xc1e813){_0x30d4d2=_0x30d4d2-0x0;var _0x5155b9=_0x10b7[_0x30d4d2];return _0x5155b9;};'use strict';var UserEvents=require(_0x710b('0x0'));var events=[_0x710b('0x1'),_0x710b('0x2'),_0x710b('0x3')];function createListener(_0x2893d2,_0x4e9702){return function(_0x3789db){_0x4e9702['emit'](_0x2893d2,_0x3789db);};}function removeListener(_0x3d186e,_0xc011b8){return function(){UserEvents['removeListener'](_0x3d186e,_0xc011b8);};}exports['register']=function(_0xc41674){for(var _0x6c223a=0x0,_0x1f3860=events['length'];_0x6c223a<_0x1f3860;_0x6c223a++){var _0x26748b=events[_0x6c223a];var _0x1e9b51=createListener('user:'+_0x26748b,_0xc41674);UserEvents['on'](_0x26748b,_0x1e9b51);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 17a2b85..574f290 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x476bff,_0x2df063){var _0x125c1a=function(_0x35a95b){while(--_0x35a95b){_0x476bff['push'](_0x476bff['shift']());}};_0x125c1a(++_0x2df063);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0xcb91[_0x53b133];return _0x5647e0;};'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(_0x2bab64,_0x80577a){var _0x2c9ea2=function(_0x295ae4){while(--_0x295ae4){_0x2bab64['push'](_0x2bab64['shift']());}};_0x2c9ea2(++_0x80577a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 1943594..8b737ef 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 _0x84a7=['exports','INTEGER','sequelize'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x84a7,0xa1));var _0x784a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x84a7[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x784a('0x0'));module[_0x784a('0x1')]={'penalty':{'type':Sequelize[_0x784a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb807=['exports','INTEGER','sequelize'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xb807,0x17c));var _0x7b80=function(_0x3e8d78,_0xef4524){_0x3e8d78=_0x3e8d78-0x0;var _0x50532d=_0xb807[_0x3e8d78];return _0x50532d;};'use strict';var Sequelize=require(_0x7b80('0x0'));module[_0x7b80('0x1')]={'penalty':{'type':Sequelize[_0x7b80('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 9bd4913..91701cf 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 _0x6eb5=['rimraf','../../config/environment','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0x90f337,_0x6d9d0b){var _0x475b34=function(_0x28bc53){while(--_0x28bc53){_0x90f337['push'](_0x90f337['shift']());}};_0x475b34(++_0x6d9d0b);}(_0x6eb5,0x1a7));var _0x56eb=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x6eb5[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x56eb('0x0'));var util=require(_0x56eb('0x1'));var logger=require(_0x56eb('0x2'))(_0x56eb('0x3'));var moment=require(_0x56eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x56eb('0x5'));var rimraf=require(_0x56eb('0x6'));var config=require(_0x56eb('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x56eb('0x8')]=function(_0xb91477,_0x4ff54f){return _0xb91477[_0x56eb('0x9')]('UserChatQueue',attributes,{'tableName':_0x56eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc71d=['user_has_chat_queues','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x1abd7d,_0x17e2d8){var _0x5923c6=function(_0x3df741){while(--_0x3df741){_0x1abd7d['push'](_0x1abd7d['shift']());}};_0x5923c6(++_0x17e2d8);}(_0xc71d,0x12a));var _0xdc71=function(_0x4232d8,_0x13fd09){_0x4232d8=_0x4232d8-0x0;var _0x324de2=_0xc71d[_0x4232d8];return _0x324de2;};'use strict';var _=require('lodash');var util=require(_0xdc71('0x0'));var logger=require(_0xdc71('0x1'))('api');var moment=require(_0xdc71('0x2'));var BPromise=require('bluebird');var rp=require(_0xdc71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc71('0x4'));var config=require(_0xdc71('0x5'));var attributes=require(_0xdc71('0x6'));module[_0xdc71('0x7')]=function(_0x4a8fd3,_0x4dd55b){return _0x4a8fd3[_0xdc71('0x8')](_0xdc71('0x9'),attributes,{'tableName':_0xdc71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index be6f0de..7592f51 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 _0xacdf=['stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2fffb2,_0x3c476f){var _0x46eb4f=function(_0x283ff2){while(--_0x283ff2){_0x2fffb2['push'](_0x2fffb2['shift']());}};_0x46eb4f(++_0x3c476f);}(_0xacdf,0x15a));var _0xfacd=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xacdf[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require('lodash');var util=require(_0xfacd('0x0'));var moment=require(_0xfacd('0x1'));var BPromise=require('bluebird');var rs=require(_0xfacd('0x2'));var fs=require('fs');var Redis=require(_0xfacd('0x3'));var db=require(_0xfacd('0x4'))['db'];var utils=require(_0xfacd('0x5'));var logger=require(_0xfacd('0x6'))(_0xfacd('0x7'));var config=require(_0xfacd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfacd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5addc0,_0x5d9e7c,_0x3a796c){return new BPromise(function(_0x1677bb,_0xb09719){return client[_0xfacd('0xa')](_0x5addc0,_0x3a796c)[_0xfacd('0xb')](function(_0x3e3ae9){logger['info'](_0xfacd('0xc'),_0x5d9e7c,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5d9e7c,_0xfacd('0xd'),JSON[_0xfacd('0xe')](_0x3e3ae9));if(_0x3e3ae9[_0xfacd('0xf')]){if(_0x3e3ae9['error'][_0xfacd('0x10')]===0x1f4){logger[_0xfacd('0xf')](_0xfacd('0xc'),_0x5d9e7c,_0x3e3ae9['error'][_0xfacd('0x11')]);return _0xb09719(_0x3e3ae9[_0xfacd('0xf')][_0xfacd('0x11')]);}logger['error'](_0xfacd('0xc'),_0x5d9e7c,_0x3e3ae9['error'][_0xfacd('0x11')]);return _0x1677bb(_0x3e3ae9['error'][_0xfacd('0x11')]);}else{logger[_0xfacd('0x12')](_0xfacd('0xc'),_0x5d9e7c,_0xfacd('0xd'));_0x1677bb(_0x3e3ae9[_0xfacd('0x13')][_0xfacd('0x11')]);}})['catch'](function(_0x424a87){logger[_0xfacd('0xf')](_0xfacd('0xc'),_0x5d9e7c,_0x424a87);_0xb09719(_0x424a87);});});} \ No newline at end of file +var _0xaa01=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','debug'];(function(_0x411c1e,_0x2950f7){var _0x5972dc=function(_0x1e0868){while(--_0x1e0868){_0x411c1e['push'](_0x411c1e['shift']());}};_0x5972dc(++_0x2950f7);}(_0xaa01,0x106));var _0x1aa0=function(_0x3b1300,_0xd70424){_0x3b1300=_0x3b1300-0x0;var _0x5aac0c=_0xaa01[_0x3b1300];return _0x5aac0c;};'use strict';var _=require(_0x1aa0('0x0'));var util=require(_0x1aa0('0x1'));var moment=require('moment');var BPromise=require(_0x1aa0('0x2'));var rs=require(_0x1aa0('0x3'));var fs=require('fs');var Redis=require(_0x1aa0('0x4'));var db=require(_0x1aa0('0x5'))['db'];var utils=require(_0x1aa0('0x6'));var logger=require('../../config/logger')(_0x1aa0('0x7'));var config=require('../../config/environment');var jayson=require(_0x1aa0('0x8'));var client=jayson['client'][_0x1aa0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x366656,_0xdc7398,_0x71f55b){return new BPromise(function(_0x206217,_0x5e5922){return client[_0x1aa0('0xa')](_0x366656,_0x71f55b)[_0x1aa0('0xb')](function(_0x35f7e6){logger[_0x1aa0('0xc')]('UserChatQueue,\x20%s,\x20%s',_0xdc7398,'request\x20sent');logger[_0x1aa0('0xd')](_0x1aa0('0xe'),_0xdc7398,'request\x20sent',JSON[_0x1aa0('0xf')](_0x35f7e6));if(_0x35f7e6[_0x1aa0('0x10')]){if(_0x35f7e6[_0x1aa0('0x10')][_0x1aa0('0x11')]===0x1f4){logger[_0x1aa0('0x10')](_0x1aa0('0x12'),_0xdc7398,_0x35f7e6['error'][_0x1aa0('0x13')]);return _0x5e5922(_0x35f7e6[_0x1aa0('0x10')]['message']);}logger[_0x1aa0('0x10')](_0x1aa0('0x12'),_0xdc7398,_0x35f7e6['error'][_0x1aa0('0x13')]);return _0x206217(_0x35f7e6['error'][_0x1aa0('0x13')]);}else{logger[_0x1aa0('0xc')](_0x1aa0('0x12'),_0xdc7398,_0x1aa0('0x14'));_0x206217(_0x35f7e6[_0x1aa0('0x15')][_0x1aa0('0x13')]);}})[_0x1aa0('0x16')](function(_0x60fa00){logger[_0x1aa0('0x10')](_0x1aa0('0x12'),_0xdc7398,_0x60fa00);_0x5e5922(_0x60fa00);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 36c7b82..238bafe 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xfba1ab,_0x275e86){var _0x2f4d70=function(_0x2c3f4d){while(--_0x2c3f4d){_0xfba1ab['push'](_0xfba1ab['shift']());}};_0x2f4d70(++_0x275e86);}(_0xedd9,0xfc));var _0x9edd=function(_0x47e906,_0x4febba){_0x47e906=_0x47e906-0x0;var _0x5704d2=_0xedd9[_0x47e906];return _0x5704d2;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5d5e5a,_0x2f4878){var _0x2ec9c9=function(_0x4b2180){while(--_0x4b2180){_0x5d5e5a['push'](_0x5d5e5a['shift']());}};_0x2ec9c9(++_0x2f4878);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 47c1b8c..a162552 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 _0x3e0d=['exports','INTEGER','STRING','sequelize'];(function(_0xbce99,_0x2c7113){var _0x525793=function(_0x486823){while(--_0x486823){_0xbce99['push'](_0xbce99['shift']());}};_0x525793(++_0x2c7113);}(_0x3e0d,0x11b));var _0xd3e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e0d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd3e0('0x0'));module[_0xd3e0('0x1')]={'penalty':{'type':Sequelize[_0xd3e0('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd3e0('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd3e0('0x3')]}}; \ No newline at end of file +var _0x507f=['STRING','sequelize','exports','INTEGER'];(function(_0x924772,_0x4d7504){var _0x37e7b4=function(_0x11356d){while(--_0x11356d){_0x924772['push'](_0x924772['shift']());}};_0x37e7b4(++_0x4d7504);}(_0x507f,0xed));var _0xf507=function(_0x1238e0,_0x16bd9b){_0x1238e0=_0x1238e0-0x0;var _0x59dfc8=_0x507f[_0x1238e0];return _0x59dfc8;};'use strict';var Sequelize=require(_0xf507('0x0'));module[_0xf507('0x1')]={'penalty':{'type':Sequelize[_0xf507('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf507('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 90d93d0..0d69894 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 _0xf24e=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf24e,0x106));var _0xef24=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xf24e[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xef24('0x0'));var util=require(_0xef24('0x1'));var logger=require(_0xef24('0x2'))(_0xef24('0x3'));var moment=require(_0xef24('0x4'));var BPromise=require(_0xef24('0x5'));var rp=require(_0xef24('0x6'));var fs=require('fs');var path=require(_0xef24('0x7'));var rimraf=require(_0xef24('0x8'));var config=require(_0xef24('0x9'));var attributes=require('./userFaxQueue.attributes');module[_0xef24('0xa')]=function(_0xc636bd,_0x533ce8){return _0xc636bd['define'](_0xef24('0xb'),attributes,{'tableName':_0xef24('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82f4=['util','../../config/logger','bluebird','request-promise','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash'];(function(_0x16a1d7,_0x36d3fe){var _0x219598=function(_0x4d2f2f){while(--_0x4d2f2f){_0x16a1d7['push'](_0x16a1d7['shift']());}};_0x219598(++_0x36d3fe);}(_0x82f4,0x18b));var _0x482f=function(_0x34ff0b,_0x3432a3){_0x34ff0b=_0x34ff0b-0x0;var _0x1b0d1d=_0x82f4[_0x34ff0b];return _0x1b0d1d;};'use strict';var _=require(_0x482f('0x0'));var util=require(_0x482f('0x1'));var logger=require(_0x482f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x482f('0x3'));var rp=require(_0x482f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x482f('0x5'));module[_0x482f('0x6')]=function(_0x5947c3,_0x286f3d){return _0x5947c3[_0x482f('0x7')]('UserFaxQueue',attributes,{'tableName':_0x482f('0x8'),'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 02020ab..3895318 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 _0x45cf=['info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5c4948,_0x4d635f){var _0x36cb2b=function(_0x551a43){while(--_0x551a43){_0x5c4948['push'](_0x5c4948['shift']());}};_0x36cb2b(++_0x4d635f);}(_0x45cf,0x1d7));var _0xf45c=function(_0x5ed8e2,_0x4d1edf){_0x5ed8e2=_0x5ed8e2-0x0;var _0x5056fd=_0x45cf[_0x5ed8e2];return _0x5056fd;};'use strict';var _=require(_0xf45c('0x0'));var util=require(_0xf45c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf45c('0x2'));var fs=require('fs');var Redis=require(_0xf45c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf45c('0x4'));var logger=require(_0xf45c('0x5'))(_0xf45c('0x6'));var config=require(_0xf45c('0x7'));var jayson=require(_0xf45c('0x8'));var client=jayson[_0xf45c('0x9')][_0xf45c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30c867,_0x1abef4,_0x30383c){return new BPromise(function(_0x41f16c,_0xa96d26){return client[_0xf45c('0xb')](_0x30c867,_0x30383c)['then'](function(_0x5927ab){logger[_0xf45c('0xc')](_0xf45c('0xd'),_0x1abef4,'request\x20sent');logger[_0xf45c('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x1abef4,_0xf45c('0xf'),JSON['stringify'](_0x5927ab));if(_0x5927ab[_0xf45c('0x10')]){if(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x11')]===0x1f4){logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x5927ab[_0xf45c('0x10')]['message']);return _0xa96d26(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);}logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);return _0x41f16c(_0x5927ab[_0xf45c('0x10')][_0xf45c('0x12')]);}else{logger['info'](_0xf45c('0xd'),_0x1abef4,_0xf45c('0xf'));_0x41f16c(_0x5927ab[_0xf45c('0x13')][_0xf45c('0x12')]);}})[_0xf45c('0x14')](function(_0x2ee021){logger[_0xf45c('0x10')](_0xf45c('0xd'),_0x1abef4,_0x2ee021);_0xa96d26(_0x2ee021);});});} \ No newline at end of file +var _0x0989=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0989,0x1ee));var _0x9098=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0989[_0x484e36];return _0xafc85d;};'use strict';var _=require('lodash');var util=require(_0x9098('0x0'));var moment=require(_0x9098('0x1'));var BPromise=require(_0x9098('0x2'));var rs=require(_0x9098('0x3'));var fs=require('fs');var Redis=require(_0x9098('0x4'));var db=require(_0x9098('0x5'))['db'];var utils=require(_0x9098('0x6'));var logger=require(_0x9098('0x7'))(_0x9098('0x8'));var config=require(_0x9098('0x9'));var jayson=require(_0x9098('0xa'));var client=jayson[_0x9098('0xb')][_0x9098('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x187e9c,_0x10ba44,_0x58a3f9){return new BPromise(function(_0x2a566a,_0x3f3aaa){return client[_0x9098('0xd')](_0x187e9c,_0x58a3f9)[_0x9098('0xe')](function(_0x54ce97){logger[_0x9098('0xf')](_0x9098('0x10'),_0x10ba44,_0x9098('0x11'));logger[_0x9098('0x12')](_0x9098('0x13'),_0x10ba44,_0x9098('0x11'),JSON[_0x9098('0x14')](_0x54ce97));if(_0x54ce97['error']){if(_0x54ce97[_0x9098('0x15')][_0x9098('0x16')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x10ba44,_0x54ce97[_0x9098('0x15')][_0x9098('0x17')]);return _0x3f3aaa(_0x54ce97[_0x9098('0x15')][_0x9098('0x17')]);}logger[_0x9098('0x15')](_0x9098('0x10'),_0x10ba44,_0x54ce97[_0x9098('0x15')]['message']);return _0x2a566a(_0x54ce97[_0x9098('0x15')][_0x9098('0x17')]);}else{logger['info'](_0x9098('0x10'),_0x10ba44,_0x9098('0x11'));_0x2a566a(_0x54ce97[_0x9098('0x18')][_0x9098('0x17')]);}})[_0x9098('0x19')](function(_0x43a4b2){logger[_0x9098('0x15')](_0x9098('0x10'),_0x10ba44,_0x43a4b2);_0x3f3aaa(_0x43a4b2);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index fc6808d..fc0acae 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1c5037,_0x52e4d0){var _0x1e6ead=function(_0x24ed26){while(--_0x24ed26){_0x1c5037['push'](_0x1c5037['shift']());}};_0x1e6ead(++_0x52e4d0);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xb24a82,_0x1fff3a){var _0x41fcc9=function(_0x4dc90e){while(--_0x4dc90e){_0xb24a82['push'](_0xb24a82['shift']());}};_0x41fcc9(++_0x1fff3a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xcb91[_0x2eb3db];return _0x358f33;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 1c2d6d6..b17ed75 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 _0x149f=['sequelize','exports'];(function(_0xeb568a,_0x53b831){var _0x409c9f=function(_0x3e7dcb){while(--_0x3e7dcb){_0xeb568a['push'](_0xeb568a['shift']());}};_0x409c9f(++_0x53b831);}(_0x149f,0x13e));var _0xf149=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x149f[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0xf149('0x0'));module[_0xf149('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xccc9=['INTEGER','sequelize','exports'];(function(_0x1cf86c,_0x2ce421){var _0x26a8a1=function(_0x5f3767){while(--_0x5f3767){_0x1cf86c['push'](_0x1cf86c['shift']());}};_0x26a8a1(++_0x2ce421);}(_0xccc9,0xf4));var _0x9ccc=function(_0x574d93,_0x234269){_0x574d93=_0x574d93-0x0;var _0x2617c2=_0xccc9[_0x574d93];return _0x2617c2;};'use strict';var Sequelize=require(_0x9ccc('0x0'));module[_0x9ccc('0x1')]={'penalty':{'type':Sequelize[_0x9ccc('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 714c46a..93a953f 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 _0x7c8f=['moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x7c8f,0x69));var _0xf7c8=function(_0x5d1872,_0x268187){_0x5d1872=_0x5d1872-0x0;var _0x3dad1d=_0x7c8f[_0x5d1872];return _0x3dad1d;};'use strict';var _=require(_0xf7c8('0x0'));var util=require('util');var logger=require(_0xf7c8('0x1'))(_0xf7c8('0x2'));var moment=require(_0xf7c8('0x3'));var BPromise=require(_0xf7c8('0x4'));var rp=require(_0xf7c8('0x5'));var fs=require('fs');var path=require(_0xf7c8('0x6'));var rimraf=require('rimraf');var config=require(_0xf7c8('0x7'));var attributes=require(_0xf7c8('0x8'));module['exports']=function(_0x5f090c,_0x232bb6){return _0x5f090c[_0xf7c8('0x9')](_0xf7c8('0xa'),attributes,{'tableName':_0xf7c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46e1=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x4ed762,_0x46e6c7){var _0x1d6dc8=function(_0x47bec5){while(--_0x47bec5){_0x4ed762['push'](_0x4ed762['shift']());}};_0x1d6dc8(++_0x46e6c7);}(_0x46e1,0x1ce));var _0x146e=function(_0x1db8cc,_0xa69714){_0x1db8cc=_0x1db8cc-0x0;var _0x71a679=_0x46e1[_0x1db8cc];return _0x71a679;};'use strict';var _=require('lodash');var util=require(_0x146e('0x0'));var logger=require(_0x146e('0x1'))(_0x146e('0x2'));var moment=require('moment');var BPromise=require(_0x146e('0x3'));var rp=require(_0x146e('0x4'));var fs=require('fs');var path=require(_0x146e('0x5'));var rimraf=require('rimraf');var config=require(_0x146e('0x6'));var attributes=require('./userMailQueue.attributes');module[_0x146e('0x7')]=function(_0x2ca9c7,_0x2ca12c){return _0x2ca9c7[_0x146e('0x8')](_0x146e('0x9'),attributes,{'tableName':_0x146e('0xa'),'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 ced9076..a287a2d 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4448bc,_0xba2c16){var _0x3d460c=function(_0x24e960){while(--_0x24e960){_0x4448bc['push'](_0x4448bc['shift']());}};_0x3d460c(++_0xba2c16);}(_0x00bb,0x1d8));var _0xb00b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00bb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e8db4,_0x12b067){var _0x3e1495=function(_0x3b9e39){while(--_0x3b9e39){_0x1e8db4['push'](_0x1e8db4['shift']());}};_0x3e1495(++_0x12b067);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index dea5c61..282eba0 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 _0xe0d8=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x584457,_0x5b9996){var _0xd070e7=function(_0x2be228){while(--_0x2be228){_0x584457['push'](_0x584457['shift']());}};_0xd070e7(++_0x5b9996);}(_0xe0d8,0xe2));var _0x8e0d=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0xe0d8[_0x48f7cf];return _0xc201c0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8e0d('0x0'));var timeout=require('connect-timeout');var express=require(_0x8e0d('0x1'));var router=express[_0x8e0d('0x2')]();var fs_extra=require(_0x8e0d('0x3'));var auth=require(_0x8e0d('0x4'));var interaction=require(_0x8e0d('0x5'));var config=require(_0x8e0d('0x6'));var controller=require(_0x8e0d('0x7'));router[_0x8e0d('0x8')]('/',auth[_0x8e0d('0x9')](),controller['sendUserNotification']);module[_0x8e0d('0xa')]=router; \ No newline at end of file +var _0x080e=['sendUserNotification','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x46bcbd,_0x2fd740){var _0x4cc94a=function(_0x22c825){while(--_0x22c825){_0x46bcbd['push'](_0x46bcbd['shift']());}};_0x4cc94a(++_0x2fd740);}(_0x080e,0xca));var _0xe080=function(_0x4a0fca,_0xba7712){_0x4a0fca=_0x4a0fca-0x0;var _0x332687=_0x080e[_0x4a0fca];return _0x332687;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe080('0x0'));var timeout=require('connect-timeout');var express=require(_0xe080('0x1'));var router=express[_0xe080('0x2')]();var fs_extra=require(_0xe080('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe080('0x4'));var config=require(_0xe080('0x5'));var controller=require('./userNotification.controller');router['post']('/',auth['isAuthenticated'](),controller[_0xe080('0x6')]);module[_0xe080('0x7')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 9116dda..25230fb 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 _0xbaa7=['TEXT','BOOLEAN','sequelize'];(function(_0x4a6251,_0x15f95a){var _0x1a87ad=function(_0x2cd9b8){while(--_0x2cd9b8){_0x4a6251['push'](_0x4a6251['shift']());}};_0x1a87ad(++_0x15f95a);}(_0xbaa7,0xaa));var _0x7baa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbaa7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7baa('0x0'));module['exports']={'body':{'type':Sequelize[_0x7baa('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x7baa('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x7baa('0x2')]}}; \ No newline at end of file +var _0x9441=['TEXT','STRING','sequelize','exports'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x9441,0xb2));var _0x1944=function(_0xd42691,_0xb9ac44){_0xd42691=_0xd42691-0x0;var _0x33b13c=_0x9441[_0xd42691];return _0x33b13c;};'use strict';var Sequelize=require(_0x1944('0x0'));module[_0x1944('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x1944('0x2')]},'recipientsDescription':{'type':Sequelize[_0x1944('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index a127ca2..989b3b3 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 _0xf9c2=['beep','recipientsId','sortBy','join','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','replace','Queue','push','getAgents','map','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription'];(function(_0x2f6ac1,_0x6ec9d0){var _0x36a38d=function(_0x6377d1){while(--_0x6377d1){_0x2f6ac1['push'](_0x2f6ac1['shift']());}};_0x36a38d(++_0x6ec9d0);}(_0xf9c2,0x14b));var _0x2f9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf9c2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f9c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f9c('0x1'));var rp=require('request-promise');var moment=require(_0x2f9c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2f9c('0x3'));var util=require(_0x2f9c('0x4'));var path=require(_0x2f9c('0x5'));var sox=require(_0x2f9c('0x6'));var csv=require('to-csv');var ejs=require(_0x2f9c('0x7'));var fs=require('fs');var fs_extra=require(_0x2f9c('0x8'));var _=require(_0x2f9c('0x9'));var squel=require(_0x2f9c('0xa'));var crypto=require(_0x2f9c('0xb'));var jsforce=require(_0x2f9c('0xc'));var deskjs=require(_0x2f9c('0xd'));var toCsv=require(_0x2f9c('0xe'));var querystring=require('querystring');var Papa=require(_0x2f9c('0xf'));var Redis=require(_0x2f9c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2f9c('0x11'));var as=require(_0x2f9c('0x12'));var hardwareService=require(_0x2f9c('0x13'));var logger=require(_0x2f9c('0x14'))(_0x2f9c('0x15'));var utils=require(_0x2f9c('0x16'));var config=require(_0x2f9c('0x17'));var licenseUtil=require(_0x2f9c('0x18'));var db=require(_0x2f9c('0x19'))['db'];config[_0x2f9c('0x1a')]=_[_0x2f9c('0x1b')](config['redis'],{'host':_0x2f9c('0x1c'),'port':0x18eb});var socket=require(_0x2f9c('0x1d'))(new Redis(config[_0x2f9c('0x1a')]));require(_0x2f9c('0x1e'))['register'](socket);function respondWithStatusCode(_0x111370,_0x4c1768){_0x4c1768=_0x4c1768||0xcc;return function(_0x466f89){if(_0x466f89){return _0x111370['sendStatus'](_0x4c1768);}return _0x111370[_0x2f9c('0x1f')](_0x4c1768)[_0x2f9c('0x20')]();};}function respondWithResult(_0x407650,_0x1aff05){_0x1aff05=_0x1aff05||0xc8;return function(_0xfe0806){if(_0xfe0806){return _0x407650['status'](_0x1aff05)[_0x2f9c('0x21')](_0xfe0806);}};}function respondWithFilteredResult(_0x5638ac,_0x49e9dc){return function(_0x5820cc){if(_0x5820cc){var _0x7a8d03=typeof _0x49e9dc[_0x2f9c('0x22')]===_0x2f9c('0x23')&&typeof _0x49e9dc[_0x2f9c('0x24')]===_0x2f9c('0x23');var _0xecab50=_0x5820cc[_0x2f9c('0x25')];var _0x100031=_0x7a8d03?0x0:_0x49e9dc['offset'];var _0x254ae8=_0x7a8d03?_0x5820cc['count']:_0x49e9dc['offset']+_0x49e9dc[_0x2f9c('0x24')];var _0x4332a1;if(_0x254ae8>=_0xecab50){_0x254ae8=_0xecab50;_0x4332a1=0xc8;}else{_0x4332a1=0xce;}_0x5638ac[_0x2f9c('0x1f')](_0x4332a1);return _0x5638ac[_0x2f9c('0x26')](_0x2f9c('0x27'),_0x100031+'-'+_0x254ae8+'/'+_0xecab50)[_0x2f9c('0x21')](_0x5820cc);}return null;};}function patchUpdates(_0x3f1011){return function(_0x37535b){try{jsonpatch[_0x2f9c('0x28')](_0x37535b,_0x3f1011,!![]);}catch(_0x47b6a9){return BPromise[_0x2f9c('0x29')](_0x47b6a9);}return _0x37535b[_0x2f9c('0x2a')]();};}function saveUpdates(_0x189a24,_0xff0324){return function(_0x26657e){if(_0x26657e){return _0x26657e[_0x2f9c('0x2b')](_0x189a24)['then'](function(_0x534de6){return _0x534de6;});}return null;};}function removeEntity(_0x464548,_0x579164){return function(_0x1c58f7){if(_0x1c58f7){return _0x1c58f7['destroy']()[_0x2f9c('0x2c')](function(){_0x464548[_0x2f9c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b96e4,_0x5f2841){return function(_0x1fcd50){if(!_0x1fcd50){_0x2b96e4[_0x2f9c('0x2d')](0x194);}return _0x1fcd50;};}function handleError(_0x6fab4e,_0x40ff91){_0x40ff91=_0x40ff91||0x1f4;return function(_0x372fff){logger[_0x2f9c('0x2e')](_0x372fff[_0x2f9c('0x2f')]);if(_0x372fff[_0x2f9c('0x30')]){delete _0x372fff[_0x2f9c('0x30')];}_0x6fab4e[_0x2f9c('0x1f')](_0x40ff91)[_0x2f9c('0x31')](_0x372fff);};}exports[_0x2f9c('0x32')]=function(_0x3fa1ce,_0x306cac,_0x327fc0){if(!_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x35'))&&!_0x3fa1ce['body'][_0x2f9c('0x34')](_0x2f9c('0x36'))){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x3fa1ce[_0x2f9c('0x33')]['hasOwnProperty']('TemplateId')&&!_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x39'))){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x3a'));}if(!_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x3b'))){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x3c'));}else{try{var _0x29bc0d=JSON[_0x2f9c('0x3d')](_0x3fa1ce[_0x2f9c('0x33')]['recipients']);}catch(_0x20ccd2){logger[_0x2f9c('0x2e')](_0x20ccd2);throw new db[(_0x2f9c('0x37'))]['ValidationError'](_0x2f9c('0x3e'));}var _0x47e935=[_0x2f9c('0x3f'),_0x2f9c('0x40'),_0x2f9c('0x41'),_0x2f9c('0x42'),'smsqueue','voicequeue',_0x2f9c('0x43'),_0x2f9c('0x44'),_0x2f9c('0x45')];if(_[_0x2f9c('0x46')](_0x29bc0d,function(_0x573e0f){return!_[_0x2f9c('0x47')](_0x47e935,_0x573e0f[_0x2f9c('0x48')]['toLowerCase']());})){throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x49'));}}}var _0x17f196={};_0x17f196['senderName']=_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x34')](_0x2f9c('0x4a'))?_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4a')]:_0x3fa1ce[_0x2f9c('0x45')]['fullname'];_0x17f196['recipientsDescription']=_[_0x2f9c('0x4b')](_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4c')])?null:_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4c')];_0x17f196[_0x2f9c('0x4d')]=_0x3fa1ce[_0x2f9c('0x33')][_0x2f9c('0x4d')]||![];_0x17f196['SenderId']=_0x3fa1ce[_0x2f9c('0x45')]['id'];return getContent(_0x3fa1ce['body'])[_0x2f9c('0x2c')](function(_0x2dd3cb){_0x17f196[_0x2f9c('0x33')]=_0x2dd3cb;return getRecipients(_0x29bc0d);})[_0x2f9c('0x2c')](function(_0x2d2afa){_0x17f196[_0x2f9c('0x4e')]=_[_0x2f9c('0x4f')](_0x2d2afa)[_0x2f9c('0x50')](',');return db['sequelize'][_0x2f9c('0x51')](function(_0x5ea91e){return db[_0x2f9c('0x52')]['create'](_0x17f196,{'raw':!![],'transaction':_0x5ea91e})['then'](function(_0x38029a){var _0x599a2e={'sender':_0x17f196['senderName'],'description':_0x17f196['recipientsDescription'],'content':_0x17f196[_0x2f9c('0x33')],'beep':_0x17f196[_0x2f9c('0x4d')]};_0x2d2afa[_0x2f9c('0x53')](function(_0xfd2f5f){_0x599a2e[_0x2f9c('0x54')]=_0xfd2f5f;socket[_0x2f9c('0x55')](_0x2f9c('0x56'),_0x599a2e);});return _0x38029a;});});})['then'](respondWithResult(_0x306cac,0xc9))[_0x2f9c('0x57')](handleError(_0x306cac,null));};function getContent(_0x48b248){return new BPromise(function(_0x2a09e7,_0x5e4cae){if(_0x48b248[_0x2f9c('0x35')]){_0x2a09e7(_0x48b248['text']);return;}return db[_0x2f9c('0x58')][_0x2f9c('0x59')]({'attributes':['html'],'where':{'id':_0x48b248['TemplateId']},'raw':!![]})['then'](function(_0x332c51){if(!_0x332c51)throw new db[(_0x2f9c('0x37'))][(_0x2f9c('0x38'))](_0x2f9c('0x5a'));var _0x52e5bf=Mustache[_0x2f9c('0x5b')](_0x332c51[_0x2f9c('0x5c')],_0x48b248[_0x2f9c('0x39')]);_0x2a09e7(_0x52e5bf);})[_0x2f9c('0x57')](function(_0x54a39e){_0x5e4cae(_0x54a39e);});});}function getRecipients(_0x1a013b){return new BPromise(function(_0x11e3ce,_0x3b024e){var _0x4bcf07=[];var _0x587944=[];_0x1a013b[_0x2f9c('0x53')](function(_0x247f97){var _0x52c68e=_[_0x2f9c('0x5d')](_0x247f97[_0x2f9c('0x48')]['toLowerCase']());if(_0x52c68e===_0x2f9c('0x5e')){_0x4bcf07=_[_0x2f9c('0x5f')](_0x4bcf07,_0x247f97[_0x2f9c('0x60')]);}else{if(_[_0x2f9c('0x47')](_0x52c68e,'queue'))_0x52c68e=_0x52c68e[_0x2f9c('0x61')]('queue',_0x2f9c('0x62'));_0x247f97[_0x2f9c('0x60')][_0x2f9c('0x53')](function(_0x150ff8){_0x587944[_0x2f9c('0x63')](getAgents(_0x52c68e,_0x150ff8));});}});return BPromise['all'](_0x587944)[_0x2f9c('0x2c')](function(_0x1fd3be){_0x4bcf07=_[_0x2f9c('0x5f')](_0x4bcf07,_['flatten'](_0x1fd3be));_0x11e3ce(_0x4bcf07);})[_0x2f9c('0x57')](function(_0x285d08){_0x3b024e(_0x285d08);});});}function getAgents(_0x4e1a3c,_0x5a8c4f){return new BPromise(function(_0x260b60,_0x541f38){return db[_0x4e1a3c][_0x2f9c('0x59')]({'where':{'id':_0x5a8c4f}})['then'](function(_0x24ada4){return _0x24ada4[_0x2f9c('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9239db){var _0xa6b5ee=_[_0x2f9c('0x65')](_0x9239db,'id');_0x260b60(_0xa6b5ee);});})[_0x2f9c('0x57')](function(_0x442cba){_0x541f38(_0x442cba);});});} \ No newline at end of file +var _0x2c55=['team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','forEach','recipient','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','ids','queue','replace','Queue','push','all','union','flatten','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','end','error','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue'];(function(_0x3d4917,_0x2ffd10){var _0x49c69b=function(_0x7f4021){while(--_0x7f4021){_0x3d4917['push'](_0x3d4917['shift']());}};_0x49c69b(++_0x2ffd10);}(_0x2c55,0x1a6));var _0x52c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c55[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x52c5('0x0'));var rimraf=require(_0x52c5('0x1'));var zipdir=require(_0x52c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52c5('0x3'));var moment=require(_0x52c5('0x4'));var BPromise=require(_0x52c5('0x5'));var Mustache=require(_0x52c5('0x6'));var util=require('util');var path=require(_0x52c5('0x7'));var sox=require(_0x52c5('0x8'));var csv=require(_0x52c5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52c5('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x52c5('0xb'));var jsforce=require(_0x52c5('0xc'));var deskjs=require(_0x52c5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x52c5('0xe'));var Papa=require('papaparse');var Redis=require(_0x52c5('0xf'));var authService=require(_0x52c5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x52c5('0x11'));var hardwareService=require(_0x52c5('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x52c5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x52c5('0x14'))['db'];config['redis']=_[_0x52c5('0x15')](config[_0x52c5('0x16')],{'host':_0x52c5('0x17'),'port':0x18eb});var socket=require(_0x52c5('0x18'))(new Redis(config[_0x52c5('0x16')]));require(_0x52c5('0x19'))['register'](socket);function respondWithStatusCode(_0x39738a,_0x15341c){_0x15341c=_0x15341c||0xcc;return function(_0x1a44f6){if(_0x1a44f6){return _0x39738a[_0x52c5('0x1a')](_0x15341c);}return _0x39738a[_0x52c5('0x1b')](_0x15341c)['end']();};}function respondWithResult(_0x53b88a,_0x3d7156){_0x3d7156=_0x3d7156||0xc8;return function(_0x515c5c){if(_0x515c5c){return _0x53b88a[_0x52c5('0x1b')](_0x3d7156)[_0x52c5('0x1c')](_0x515c5c);}};}function respondWithFilteredResult(_0x5f369d,_0xea3201){return function(_0x2ed29e){if(_0x2ed29e){var _0x22ad48=typeof _0xea3201[_0x52c5('0x1d')]===_0x52c5('0x1e')&&typeof _0xea3201['limit']==='undefined';var _0x39d59e=_0x2ed29e[_0x52c5('0x1f')];var _0x402578=_0x22ad48?0x0:_0xea3201[_0x52c5('0x1d')];var _0x4869e3=_0x22ad48?_0x2ed29e['count']:_0xea3201[_0x52c5('0x1d')]+_0xea3201[_0x52c5('0x20')];var _0x4aac8e;if(_0x4869e3>=_0x39d59e){_0x4869e3=_0x39d59e;_0x4aac8e=0xc8;}else{_0x4aac8e=0xce;}_0x5f369d[_0x52c5('0x1b')](_0x4aac8e);return _0x5f369d[_0x52c5('0x21')](_0x52c5('0x22'),_0x402578+'-'+_0x4869e3+'/'+_0x39d59e)[_0x52c5('0x1c')](_0x2ed29e);}return null;};}function patchUpdates(_0x550935){return function(_0xd7cf91){try{jsonpatch[_0x52c5('0x23')](_0xd7cf91,_0x550935,!![]);}catch(_0x1793ce){return BPromise['reject'](_0x1793ce);}return _0xd7cf91[_0x52c5('0x24')]();};}function saveUpdates(_0x2e5ad4,_0x582ccd){return function(_0x34e253){if(_0x34e253){return _0x34e253[_0x52c5('0x25')](_0x2e5ad4)[_0x52c5('0x26')](function(_0x1cdc7a){return _0x1cdc7a;});}return null;};}function removeEntity(_0x956a1c,_0xb1a160){return function(_0x126715){if(_0x126715){return _0x126715['destroy']()[_0x52c5('0x26')](function(){_0x956a1c[_0x52c5('0x1b')](0xcc)[_0x52c5('0x27')]();});}};}function handleEntityNotFound(_0x325a69,_0x14165d){return function(_0x1b5dc8){if(!_0x1b5dc8){_0x325a69[_0x52c5('0x1a')](0x194);}return _0x1b5dc8;};}function handleError(_0x380aca,_0x20ae17){_0x20ae17=_0x20ae17||0x1f4;return function(_0x543ac8){logger[_0x52c5('0x28')](_0x543ac8['stack']);if(_0x543ac8['name']){delete _0x543ac8[_0x52c5('0x29')];}_0x380aca[_0x52c5('0x1b')](_0x20ae17)[_0x52c5('0x2a')](_0x543ac8);};}exports[_0x52c5('0x2b')]=function(_0x19edd9,_0x323080,_0x2dfcd6){if(!_0x19edd9[_0x52c5('0x2c')]['hasOwnProperty'](_0x52c5('0x2d'))&&!_0x19edd9[_0x52c5('0x2c')][_0x52c5('0x2e')](_0x52c5('0x2f'))){throw new db[(_0x52c5('0x30'))][(_0x52c5('0x31'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x19edd9[_0x52c5('0x2c')]['hasOwnProperty'](_0x52c5('0x2f'))&&!_0x19edd9[_0x52c5('0x2c')][_0x52c5('0x2e')](_0x52c5('0x32'))){throw new db[(_0x52c5('0x30'))][(_0x52c5('0x31'))](_0x52c5('0x33'));}if(!_0x19edd9[_0x52c5('0x2c')][_0x52c5('0x2e')]('recipients')){throw new db[(_0x52c5('0x30'))][(_0x52c5('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x59373e=JSON[_0x52c5('0x34')](_0x19edd9[_0x52c5('0x2c')]['recipients']);}catch(_0x4eccce){logger['error'](_0x4eccce);throw new db[(_0x52c5('0x30'))][(_0x52c5('0x31'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x389c93=[_0x52c5('0x35'),_0x52c5('0x36'),'mailqueue',_0x52c5('0x37'),_0x52c5('0x38'),'voicequeue',_0x52c5('0x39'),_0x52c5('0x3a'),'user'];if(_[_0x52c5('0x3b')](_0x59373e,function(_0x4d4100){return!_[_0x52c5('0x3c')](_0x389c93,_0x4d4100[_0x52c5('0x3d')][_0x52c5('0x3e')]());})){throw new db['Sequelize'][(_0x52c5('0x31'))](_0x52c5('0x3f'));}}}var _0x1495dc={};_0x1495dc[_0x52c5('0x40')]=_0x19edd9['body'][_0x52c5('0x2e')](_0x52c5('0x40'))?_0x19edd9['body'][_0x52c5('0x40')]:_0x19edd9[_0x52c5('0x41')][_0x52c5('0x42')];_0x1495dc['recipientsDescription']=_[_0x52c5('0x43')](_0x19edd9[_0x52c5('0x2c')][_0x52c5('0x44')])?null:_0x19edd9['body'][_0x52c5('0x44')];_0x1495dc[_0x52c5('0x45')]=_0x19edd9[_0x52c5('0x2c')][_0x52c5('0x45')]||![];_0x1495dc[_0x52c5('0x46')]=_0x19edd9[_0x52c5('0x41')]['id'];return getContent(_0x19edd9[_0x52c5('0x2c')])[_0x52c5('0x26')](function(_0x4c6ed9){_0x1495dc['body']=_0x4c6ed9;return getRecipients(_0x59373e);})['then'](function(_0x1571f8){_0x1495dc[_0x52c5('0x47')]=_[_0x52c5('0x48')](_0x1571f8)['join'](',');return db[_0x52c5('0x49')][_0x52c5('0x4a')](function(_0x15d856){return db['UserNotification']['create'](_0x1495dc,{'raw':!![],'transaction':_0x15d856})['then'](function(_0x58f53b){var _0x39b8bf={'sender':_0x1495dc[_0x52c5('0x40')],'description':_0x1495dc[_0x52c5('0x44')],'content':_0x1495dc[_0x52c5('0x2c')],'beep':_0x1495dc[_0x52c5('0x45')]};_0x1571f8[_0x52c5('0x4b')](function(_0xb5db0d){_0x39b8bf[_0x52c5('0x4c')]=_0xb5db0d;socket[_0x52c5('0x4d')]('userNotification:send',_0x39b8bf);});return _0x58f53b;});});})[_0x52c5('0x26')](respondWithResult(_0x323080,0xc9))[_0x52c5('0x4e')](handleError(_0x323080,null));};function getContent(_0x20435e){return new BPromise(function(_0x229086,_0x4e8fa4){if(_0x20435e[_0x52c5('0x2d')]){_0x229086(_0x20435e[_0x52c5('0x2d')]);return;}return db[_0x52c5('0x4f')][_0x52c5('0x50')]({'attributes':[_0x52c5('0x51')],'where':{'id':_0x20435e[_0x52c5('0x2f')]},'raw':!![]})[_0x52c5('0x26')](function(_0x16a2c6){if(!_0x16a2c6)throw new db[(_0x52c5('0x30'))][(_0x52c5('0x31'))](_0x52c5('0x52'));var _0xc5ae8c=Mustache[_0x52c5('0x53')](_0x16a2c6['html'],_0x20435e[_0x52c5('0x32')]);_0x229086(_0xc5ae8c);})[_0x52c5('0x4e')](function(_0x47025f){_0x4e8fa4(_0x47025f);});});}function getRecipients(_0x1c3307){return new BPromise(function(_0x2bd0bc,_0x36299b){var _0x5093ec=[];var _0x51aa2e=[];_0x1c3307[_0x52c5('0x4b')](function(_0x1c6f48){var _0xa26564=_[_0x52c5('0x54')](_0x1c6f48['model'][_0x52c5('0x3e')]());if(_0xa26564===_0x52c5('0x55')){_0x5093ec=_['union'](_0x5093ec,_0x1c6f48[_0x52c5('0x56')]);}else{if(_['includes'](_0xa26564,_0x52c5('0x57')))_0xa26564=_0xa26564[_0x52c5('0x58')](_0x52c5('0x57'),_0x52c5('0x59'));_0x1c6f48['ids'][_0x52c5('0x4b')](function(_0x49bdff){_0x51aa2e[_0x52c5('0x5a')](getAgents(_0xa26564,_0x49bdff));});}});return BPromise[_0x52c5('0x5b')](_0x51aa2e)[_0x52c5('0x26')](function(_0x1228c9){_0x5093ec=_[_0x52c5('0x5c')](_0x5093ec,_[_0x52c5('0x5d')](_0x1228c9));_0x2bd0bc(_0x5093ec);})[_0x52c5('0x4e')](function(_0x1702cd){_0x36299b(_0x1702cd);});});}function getAgents(_0x323d9b,_0x126c97){return new BPromise(function(_0x6e0910,_0x944012){return db[_0x323d9b][_0x52c5('0x50')]({'where':{'id':_0x126c97}})[_0x52c5('0x26')](function(_0x56efc2){return _0x56efc2[_0x52c5('0x5e')]({'attributes':['id'],'raw':!![]})[_0x52c5('0x26')](function(_0x5db9e5){var _0x3ed5d4=_[_0x52c5('0x5f')](_0x5db9e5,'id');_0x6e0910(_0x3ed5d4);});})[_0x52c5('0x4e')](function(_0x39f6b4){_0x944012(_0x39f6b4);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 6f55e94..ade1175 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 _0x8366=['remove','emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners','save','update'];(function(_0x1b1460,_0x465655){var _0x5eff81=function(_0x24c8bd){while(--_0x24c8bd){_0x1b1460['push'](_0x1b1460['shift']());}};_0x5eff81(++_0x465655);}(_0x8366,0xc3));var _0x6836=function(_0x3d6bdc,_0x3d9cc5){_0x3d6bdc=_0x3d6bdc-0x0;var _0xa62019=_0x8366[_0x3d6bdc];return _0xa62019;};'use strict';var EventEmitter=require(_0x6836('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x6836('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x6836('0x2')](0x0);var events={'afterCreate':_0x6836('0x3'),'afterUpdate':_0x6836('0x4'),'afterDestroy':_0x6836('0x5')};function emitEvent(_0x5b36c4){return function(_0x1c30cd,_0x2d9d54,_0x39d279){UserNotificationEvents[_0x6836('0x6')](_0x5b36c4+':'+_0x1c30cd['id'],_0x1c30cd);UserNotificationEvents['emit'](_0x5b36c4,_0x1c30cd);_0x39d279(null);};}for(var e in events){if(events[_0x6836('0x7')](e)){var event=events[e];UserNotification[_0x6836('0x8')](e,emitEvent(event));}}module[_0x6836('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xba8d=['setMaxListeners','save','update','emit','exports','events','../../mysqldb','UserNotification'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xba8d,0x155));var _0xdba8=function(_0x53cf86,_0x56b23){_0x53cf86=_0x53cf86-0x0;var _0x172367=_0xba8d[_0x53cf86];return _0x172367;};'use strict';var EventEmitter=require(_0xdba8('0x0'));var UserNotification=require(_0xdba8('0x1'))['db'][_0xdba8('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdba8('0x3')](0x0);var events={'afterCreate':_0xdba8('0x4'),'afterUpdate':_0xdba8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58c149){return function(_0x3e4a8d,_0x1a8522,_0x204036){UserNotificationEvents[_0xdba8('0x6')](_0x58c149+':'+_0x3e4a8d['id'],_0x3e4a8d);UserNotificationEvents[_0xdba8('0x6')](_0x58c149,_0x3e4a8d);_0x204036(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xdba8('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index cd0f444..03f08d4 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 _0xa0c4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x1136dc,_0x334a4f){var _0x4850e8=function(_0x28efd5){while(--_0x28efd5){_0x1136dc['push'](_0x1136dc['shift']());}};_0x4850e8(++_0x334a4f);}(_0xa0c4,0x1e1));var _0x4a0c=function(_0x51d393,_0x1a39be){_0x51d393=_0x51d393-0x0;var _0x63bd54=_0xa0c4[_0x51d393];return _0x63bd54;};'use strict';var _=require(_0x4a0c('0x0'));var util=require('util');var logger=require(_0x4a0c('0x1'))(_0x4a0c('0x2'));var moment=require(_0x4a0c('0x3'));var BPromise=require(_0x4a0c('0x4'));var rp=require(_0x4a0c('0x5'));var fs=require('fs');var path=require(_0x4a0c('0x6'));var rimraf=require(_0x4a0c('0x7'));var config=require(_0x4a0c('0x8'));var attributes=require(_0x4a0c('0x9'));module['exports']=function(_0x13920d,_0x561dfe){return _0x13920d['define']('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4a0c('0xa')});}; \ No newline at end of file +var _0x767e=['lodash','util','api','request-promise','path','rimraf','../../config/environment','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x111cc8,_0x16afc3){var _0x172749=function(_0x3ece9a){while(--_0x3ece9a){_0x111cc8['push'](_0x111cc8['shift']());}};_0x172749(++_0x16afc3);}(_0x767e,0x9c));var _0xe767=function(_0x46670c,_0x336e59){_0x46670c=_0x46670c-0x0;var _0x388a34=_0x767e[_0x46670c];return _0x388a34;};'use strict';var _=require(_0xe767('0x0'));var util=require(_0xe767('0x1'));var logger=require('../../config/logger')(_0xe767('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe767('0x3'));var fs=require('fs');var path=require(_0xe767('0x4'));var rimraf=require(_0xe767('0x5'));var config=require(_0xe767('0x6'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x244403,_0x28228e){return _0x244403[_0xe767('0x7')](_0xe767('0x8'),attributes,{'tableName':_0xe767('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe767('0xa'),'collate':_0xe767('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index cf74e63..66db078 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 _0x2fe3=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x2fe3,0x1b6));var _0x32fe=function(_0x49e15e,_0x312977){_0x49e15e=_0x49e15e-0x0;var _0x37fd35=_0x2fe3[_0x49e15e];return _0x37fd35;};'use strict';var _=require(_0x32fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x32fe('0x1'));var rs=require(_0x32fe('0x2'));var fs=require('fs');var Redis=require(_0x32fe('0x3'));var db=require(_0x32fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x32fe('0x5'))(_0x32fe('0x6'));var config=require(_0x32fe('0x7'));var jayson=require(_0x32fe('0x8'));var client=jayson[_0x32fe('0x9')][_0x32fe('0xa')]({'port':0x232a});config[_0x32fe('0xb')]=_['defaults'](config[_0x32fe('0xb')],{'host':_0x32fe('0xc'),'port':0x18eb});var socket=require(_0x32fe('0xd'))(new Redis(config[_0x32fe('0xb')]));require(_0x32fe('0xe'))['register'](socket);function respondWithRpcPromise(_0xa59ac5,_0x25def9,_0x1979c9){return new BPromise(function(_0x124cb6,_0x7a555d){return client[_0x32fe('0xf')](_0xa59ac5,_0x1979c9)[_0x32fe('0x10')](function(_0x25504b){logger[_0x32fe('0x11')](_0x32fe('0x12'),_0x25def9,_0x32fe('0x13'));logger[_0x32fe('0x14')](_0x32fe('0x15'),_0x25def9,_0x32fe('0x13'),JSON['stringify'](_0x25504b));if(_0x25504b[_0x32fe('0x16')]){if(_0x25504b[_0x32fe('0x16')]['code']===0x1f4){logger[_0x32fe('0x16')]('UserNotification,\x20%s,\x20%s',_0x25def9,_0x25504b['error'][_0x32fe('0x17')]);return _0x7a555d(_0x25504b[_0x32fe('0x16')]['message']);}logger[_0x32fe('0x16')](_0x32fe('0x12'),_0x25def9,_0x25504b[_0x32fe('0x16')][_0x32fe('0x17')]);return _0x124cb6(_0x25504b[_0x32fe('0x16')][_0x32fe('0x17')]);}else{logger[_0x32fe('0x11')]('UserNotification,\x20%s,\x20%s',_0x25def9,_0x32fe('0x13'));_0x124cb6(_0x25504b[_0x32fe('0x18')][_0x32fe('0x17')]);}})[_0x32fe('0x19')](function(_0x4783c3){logger[_0x32fe('0x16')](_0x32fe('0x12'),_0x25def9,_0x4783c3);_0x7a555d(_0x4783c3);});});} \ No newline at end of file +var _0xbf77=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x183d0a,_0x55b0c6){var _0x4dda40=function(_0x7701fc){while(--_0x7701fc){_0x183d0a['push'](_0x183d0a['shift']());}};_0x4dda40(++_0x55b0c6);}(_0xbf77,0x114));var _0x7bf7=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xbf77[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x7bf7('0x0'));var util=require(_0x7bf7('0x1'));var moment=require('moment');var BPromise=require(_0x7bf7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf7('0x3'));var db=require(_0x7bf7('0x4'))['db'];var utils=require(_0x7bf7('0x5'));var logger=require(_0x7bf7('0x6'))('rpc');var config=require(_0x7bf7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7bf7('0x8')]['http']({'port':0x232a});config[_0x7bf7('0x9')]=_[_0x7bf7('0xa')](config[_0x7bf7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bf7('0xb'))(new Redis(config[_0x7bf7('0x9')]));require('./userNotification.socket')[_0x7bf7('0xc')](socket);function respondWithRpcPromise(_0x367da6,_0x58bc3b,_0x28192f){return new BPromise(function(_0x52b978,_0x3b5ce2){return client[_0x7bf7('0xd')](_0x367da6,_0x28192f)[_0x7bf7('0xe')](function(_0x4779a5){logger[_0x7bf7('0xf')](_0x7bf7('0x10'),_0x58bc3b,_0x7bf7('0x11'));logger[_0x7bf7('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x58bc3b,_0x7bf7('0x11'),JSON[_0x7bf7('0x13')](_0x4779a5));if(_0x4779a5[_0x7bf7('0x14')]){if(_0x4779a5[_0x7bf7('0x14')][_0x7bf7('0x15')]===0x1f4){logger['error'](_0x7bf7('0x10'),_0x58bc3b,_0x4779a5[_0x7bf7('0x14')][_0x7bf7('0x16')]);return _0x3b5ce2(_0x4779a5[_0x7bf7('0x14')][_0x7bf7('0x16')]);}logger[_0x7bf7('0x14')](_0x7bf7('0x10'),_0x58bc3b,_0x4779a5['error']['message']);return _0x52b978(_0x4779a5[_0x7bf7('0x14')][_0x7bf7('0x16')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x58bc3b,'request\x20sent');_0x52b978(_0x4779a5[_0x7bf7('0x17')]['message']);}})[_0x7bf7('0x18')](function(_0x4d8475){logger[_0x7bf7('0x14')](_0x7bf7('0x10'),_0x58bc3b,_0x4d8475);_0x3b5ce2(_0x4d8475);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index d36006d..dc41a37 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 _0xc2a9=['./userNotification.events','remove','update','emit','removeListener','length'];(function(_0x1a4323,_0x17abee){var _0x5554c5=function(_0x2f0337){while(--_0x2f0337){_0x1a4323['push'](_0x1a4323['shift']());}};_0x5554c5(++_0x17abee);}(_0xc2a9,0x7e));var _0x9c2a=function(_0x393028,_0x528f18){_0x393028=_0x393028-0x0;var _0x331509=_0xc2a9[_0x393028];return _0x331509;};'use strict';var UserNotificationEvents=require(_0x9c2a('0x0'));var events=['save',_0x9c2a('0x1'),_0x9c2a('0x2')];function createListener(_0x4ae90e,_0x48953e){return function(_0x2883ca){_0x48953e[_0x9c2a('0x3')](_0x4ae90e,_0x2883ca);};}function removeListener(_0x3fa23e,_0x4efcb5){return function(){UserNotificationEvents[_0x9c2a('0x4')](_0x3fa23e,_0x4efcb5);};}exports['register']=function(_0x12ae7e){for(var _0x2ac16b=0x0,_0x3fe453=events[_0x9c2a('0x5')];_0x2ac16b<_0x3fe453;_0x2ac16b++){var _0x35f103=events[_0x2ac16b];var _0x114f5f=createListener('userNotification:'+_0x35f103,_0x12ae7e);UserNotificationEvents['on'](_0x35f103,_0x114f5f);}}; \ No newline at end of file +var _0xff6a=['removeListener','register','length','userNotification:','./userNotification.events','save','update'];(function(_0x233811,_0x1283e9){var _0x292f41=function(_0xe78d9d){while(--_0xe78d9d){_0x233811['push'](_0x233811['shift']());}};_0x292f41(++_0x1283e9);}(_0xff6a,0x12a));var _0xaff6=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xff6a[_0x2c7618];return _0x5ce3f0;};'use strict';var UserNotificationEvents=require(_0xaff6('0x0'));var events=[_0xaff6('0x1'),'remove',_0xaff6('0x2')];function createListener(_0x3b7d8f,_0xdd514e){return function(_0x3c7711){_0xdd514e['emit'](_0x3b7d8f,_0x3c7711);};}function removeListener(_0x288c8e,_0x38467e){return function(){UserNotificationEvents[_0xaff6('0x3')](_0x288c8e,_0x38467e);};}exports[_0xaff6('0x4')]=function(_0x3badd6){for(var _0x16f63b=0x0,_0x346372=events[_0xaff6('0x5')];_0x16f63b<_0x346372;_0x16f63b++){var _0x2cf7df=events[_0x16f63b];var _0x9df386=createListener(_0xaff6('0x6')+_0x2cf7df,_0x3badd6);UserNotificationEvents['on'](_0x2cf7df,_0x9df386);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index eb3aebc..336a387 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x31a1ca,_0x519d23){var _0x1985a6=function(_0x315098){while(--_0x315098){_0x31a1ca['push'](_0x31a1ca['shift']());}};_0x1985a6(++_0x519d23);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3a2543,_0x2bccaf){var _0x475fd5=function(_0x489d6b){while(--_0x489d6b){_0x3a2543['push'](_0x3a2543['shift']());}};_0x475fd5(++_0x2bccaf);}(_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 090c56e..14ed793 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 _0x84f7=['sequelize','INTEGER'];(function(_0x1e8f35,_0x3db390){var _0x446c13=function(_0xa1e11e){while(--_0xa1e11e){_0x1e8f35['push'](_0x1e8f35['shift']());}};_0x446c13(++_0x3db390);}(_0x84f7,0x1e0));var _0x784f=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x84f7[_0x424501];return _0xb719af;};'use strict';var Sequelize=require(_0x784f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x784f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xed24=['INTEGER','sequelize','exports'];(function(_0x3f7d68,_0x2d0ec6){var _0x56df93=function(_0x14f833){while(--_0x14f833){_0x3f7d68['push'](_0x3f7d68['shift']());}};_0x56df93(++_0x2d0ec6);}(_0xed24,0xe5));var _0x4ed2=function(_0x29a3d5,_0x33a78c){_0x29a3d5=_0x29a3d5-0x0;var _0x30dc45=_0xed24[_0x29a3d5];return _0x30dc45;};'use strict';var Sequelize=require(_0x4ed2('0x0'));module[_0x4ed2('0x1')]={'penalty':{'type':Sequelize[_0x4ed2('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 70dce6d..2329dd7 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 _0x4c49=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util'];(function(_0x48c0d4,_0x2facad){var _0x47f463=function(_0x5bfd2a){while(--_0x5bfd2a){_0x48c0d4['push'](_0x48c0d4['shift']());}};_0x47f463(++_0x2facad);}(_0x4c49,0x8d));var _0x94c4=function(_0x5c877f,_0x5ab2cd){_0x5c877f=_0x5c877f-0x0;var _0x1dd4bb=_0x4c49[_0x5c877f];return _0x1dd4bb;};'use strict';var _=require(_0x94c4('0x0'));var util=require(_0x94c4('0x1'));var logger=require(_0x94c4('0x2'))(_0x94c4('0x3'));var moment=require(_0x94c4('0x4'));var BPromise=require(_0x94c4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94c4('0x6'));var rimraf=require(_0x94c4('0x7'));var config=require(_0x94c4('0x8'));var attributes=require(_0x94c4('0x9'));module[_0x94c4('0xa')]=function(_0x4b25d0,_0x102108){return _0x4b25d0[_0x94c4('0xb')]('UserOpenchannelQueue',attributes,{'tableName':_0x94c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e2b=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','util','../../config/logger','bluebird','path','../../config/environment'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x7e2b,0x1bd));var _0xb7e2=function(_0x5dc1cb,_0x1dd487){_0x5dc1cb=_0x5dc1cb-0x0;var _0x5df13f=_0x7e2b[_0x5dc1cb];return _0x5df13f;};'use strict';var _=require('lodash');var util=require(_0xb7e2('0x0'));var logger=require(_0xb7e2('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb7e2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7e2('0x3'));var rimraf=require('rimraf');var config=require(_0xb7e2('0x4'));var attributes=require(_0xb7e2('0x5'));module[_0xb7e2('0x6')]=function(_0x517a2c,_0x5755cc){return _0x517a2c[_0xb7e2('0x7')](_0xb7e2('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 3d9e33d..5bbc889 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 _0xf9c7=['result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x519ebf,_0x362a83){var _0x4f72e6=function(_0x557eb7){while(--_0x557eb7){_0x519ebf['push'](_0x519ebf['shift']());}};_0x4f72e6(++_0x362a83);}(_0xf9c7,0xf9));var _0x7f9c=function(_0x517358,_0x347981){_0x517358=_0x517358-0x0;var _0x35cb8c=_0xf9c7[_0x517358];return _0x35cb8c;};'use strict';var _=require(_0x7f9c('0x0'));var util=require(_0x7f9c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f9c('0x2'));var fs=require('fs');var Redis=require(_0x7f9c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f9c('0x4'));var logger=require(_0x7f9c('0x5'))(_0x7f9c('0x6'));var config=require(_0x7f9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7f9c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3190aa,_0x370cbe,_0xdc0fef){return new BPromise(function(_0xad8687,_0x4affd1){return client[_0x7f9c('0x9')](_0x3190aa,_0xdc0fef)[_0x7f9c('0xa')](function(_0x54db77){logger[_0x7f9c('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x370cbe,_0x7f9c('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x370cbe,_0x7f9c('0xc'),JSON[_0x7f9c('0xd')](_0x54db77));if(_0x54db77[_0x7f9c('0xe')]){if(_0x54db77['error']['code']===0x1f4){logger[_0x7f9c('0xe')](_0x7f9c('0xf'),_0x370cbe,_0x54db77['error']['message']);return _0x4affd1(_0x54db77['error']['message']);}logger[_0x7f9c('0xe')](_0x7f9c('0xf'),_0x370cbe,_0x54db77['error'][_0x7f9c('0x10')]);return _0xad8687(_0x54db77[_0x7f9c('0xe')][_0x7f9c('0x10')]);}else{logger['info'](_0x7f9c('0xf'),_0x370cbe,'request\x20sent');_0xad8687(_0x54db77[_0x7f9c('0x11')][_0x7f9c('0x10')]);}})[_0x7f9c('0x12')](function(_0x58a6ec){logger[_0x7f9c('0xe')](_0x7f9c('0xf'),_0x370cbe,_0x58a6ec);_0x4affd1(_0x58a6ec);});});} \ No newline at end of file +var _0x735c=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x21034b,_0x2ec5dd){var _0x5637e4=function(_0x1b00d3){while(--_0x1b00d3){_0x21034b['push'](_0x21034b['shift']());}};_0x5637e4(++_0x2ec5dd);}(_0x735c,0x197));var _0xc735=function(_0x4f90c4,_0x3bc9d4){_0x4f90c4=_0x4f90c4-0x0;var _0x44c184=_0x735c[_0x4f90c4];return _0x44c184;};'use strict';var _=require(_0xc735('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc735('0x1'));var rs=require(_0xc735('0x2'));var fs=require('fs');var Redis=require(_0xc735('0x3'));var db=require(_0xc735('0x4'))['db'];var utils=require(_0xc735('0x5'));var logger=require(_0xc735('0x6'))(_0xc735('0x7'));var config=require(_0xc735('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc735('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6ccd,_0x1891d2,_0x10b035){return new BPromise(function(_0x26bb8b,_0x540787){return client['request'](_0x2d6ccd,_0x10b035)[_0xc735('0xa')](function(_0x2ef9e3){logger['info'](_0xc735('0xb'),_0x1891d2,_0xc735('0xc'));logger[_0xc735('0xd')](_0xc735('0xe'),_0x1891d2,_0xc735('0xc'),JSON[_0xc735('0xf')](_0x2ef9e3));if(_0x2ef9e3[_0xc735('0x10')]){if(_0x2ef9e3[_0xc735('0x10')][_0xc735('0x11')]===0x1f4){logger[_0xc735('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1891d2,_0x2ef9e3[_0xc735('0x10')]['message']);return _0x540787(_0x2ef9e3[_0xc735('0x10')][_0xc735('0x12')]);}logger['error'](_0xc735('0xb'),_0x1891d2,_0x2ef9e3[_0xc735('0x10')][_0xc735('0x12')]);return _0x26bb8b(_0x2ef9e3[_0xc735('0x10')][_0xc735('0x12')]);}else{logger[_0xc735('0x13')](_0xc735('0xb'),_0x1891d2,'request\x20sent');_0x26bb8b(_0x2ef9e3['result']['message']);}})['catch'](function(_0x5cef00){logger[_0xc735('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1891d2,_0x5cef00);_0x540787(_0x5cef00);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 32dde4f..a55df10 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 _0xdb04=['delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id/resources','getResources','post','/:id/clone','clone','/:id/sections','addSections','addResources','put','/:id'];(function(_0x494a8e,_0x5a9d82){var _0x2c65dd=function(_0x34e1c9){while(--_0x34e1c9){_0x494a8e['push'](_0x494a8e['shift']());}};_0x2c65dd(++_0x5a9d82);}(_0xdb04,0xed));var _0x4db0=function(_0x1f806e,_0xf653c1){_0x1f806e=_0x1f806e-0x0;var _0x2d6870=_0xdb04[_0x1f806e];return _0x2d6870;};'use strict';var multer=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var path=require(_0x4db0('0x2'));var timeout=require(_0x4db0('0x3'));var express=require(_0x4db0('0x4'));var router=express[_0x4db0('0x5')]();var fs_extra=require(_0x4db0('0x6'));var auth=require(_0x4db0('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4db0('0x8'));router[_0x4db0('0x9')]('/',auth[_0x4db0('0xa')](),controller[_0x4db0('0xb')]);router[_0x4db0('0x9')](_0x4db0('0xc'),auth[_0x4db0('0xa')](),controller[_0x4db0('0xd')]);router['get']('/:id',auth[_0x4db0('0xa')](),controller['show']);router[_0x4db0('0x9')]('/:id/sections',auth[_0x4db0('0xa')](),controller['getSections']);router[_0x4db0('0x9')](_0x4db0('0xe'),auth['isAuthenticated'](),controller[_0x4db0('0xf')]);router['post']('/',auth[_0x4db0('0xa')](),controller['create']);router[_0x4db0('0x10')](_0x4db0('0x11'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x12')]);router[_0x4db0('0x10')](_0x4db0('0x13'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x14')]);router[_0x4db0('0x10')]('/:id/resources',auth['isAuthenticated'](),controller[_0x4db0('0x15')]);router[_0x4db0('0x16')](_0x4db0('0x17'),auth[_0x4db0('0xa')](),controller['update']);router[_0x4db0('0x18')](_0x4db0('0x17'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x19')]);router['delete'](_0x4db0('0x13'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x1a')]);router['delete'](_0x4db0('0xe'),auth[_0x4db0('0xa')](),controller[_0x4db0('0x1b')]);module[_0x4db0('0x1c')]=router; \ No newline at end of file +var _0xaeda=['removeResources','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','/:id/clone','clone','addSections','/:id/resources','addResources','put','update','delete','destroy','removeSections'];(function(_0x1fb8bd,_0x1db44f){var _0x585ff0=function(_0x48c5e0){while(--_0x48c5e0){_0x1fb8bd['push'](_0x1fb8bd['shift']());}};_0x585ff0(++_0x1db44f);}(_0xaeda,0x1b4));var _0xaaed=function(_0x3c1282,_0x4cac32){_0x3c1282=_0x3c1282-0x0;var _0x557359=_0xaeda[_0x3c1282];return _0x557359;};'use strict';var multer=require(_0xaaed('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaaed('0x1'));var express=require(_0xaaed('0x2'));var router=express[_0xaaed('0x3')]();var fs_extra=require(_0xaaed('0x4'));var auth=require(_0xaaed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaaed('0x6'));var controller=require(_0xaaed('0x7'));router[_0xaaed('0x8')]('/',auth[_0xaaed('0x9')](),controller[_0xaaed('0xa')]);router[_0xaaed('0x8')](_0xaaed('0xb'),auth[_0xaaed('0x9')](),controller[_0xaaed('0xc')]);router[_0xaaed('0x8')](_0xaaed('0xd'),auth['isAuthenticated'](),controller[_0xaaed('0xe')]);router[_0xaaed('0x8')](_0xaaed('0xf'),auth[_0xaaed('0x9')](),controller[_0xaaed('0x10')]);router[_0xaaed('0x8')]('/:id/resources',auth[_0xaaed('0x9')](),controller[_0xaaed('0x11')]);router[_0xaaed('0x12')]('/',auth[_0xaaed('0x9')](),controller['create']);router['post'](_0xaaed('0x13'),auth[_0xaaed('0x9')](),controller[_0xaaed('0x14')]);router[_0xaaed('0x12')](_0xaaed('0xf'),auth[_0xaaed('0x9')](),controller[_0xaaed('0x15')]);router[_0xaaed('0x12')](_0xaaed('0x16'),auth['isAuthenticated'](),controller[_0xaaed('0x17')]);router[_0xaaed('0x18')](_0xaaed('0xd'),auth['isAuthenticated'](),controller[_0xaaed('0x19')]);router[_0xaaed('0x1a')](_0xaaed('0xd'),auth['isAuthenticated'](),controller[_0xaaed('0x1b')]);router[_0xaaed('0x1a')]('/:id/sections',auth['isAuthenticated'](),controller[_0xaaed('0x1c')]);router[_0xaaed('0x1a')](_0xaaed('0x16'),auth[_0xaaed('0x9')](),controller[_0xaaed('0x1d')]);module[_0xaaed('0x1e')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f0f74ba..56c58ef 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 _0x63e1=['name','setDataValue','crudPermissions','join','getDataValue','STRING','BOOLEAN','exports'];(function(_0x5eadb1,_0x3661ad){var _0x46425d=function(_0x563aac){while(--_0x563aac){_0x5eadb1['push'](_0x5eadb1['shift']());}};_0x46425d(++_0x3661ad);}(_0x63e1,0xb7));var _0x163e=function(_0x3028a6,_0x9a5ddc){_0x3028a6=_0x3028a6-0x0;var _0x1a7099=_0x63e1[_0x3028a6];return _0x1a7099;};'use strict';var Sequelize=require('sequelize');module[_0x163e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x163e('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x55fa4c){this[_0x163e('0x2')](_0x163e('0x3'),_0x55fa4c?_0x55fa4c[_0x163e('0x4')](''):[]);},'get':function(){return this[_0x163e('0x5')](_0x163e('0x3'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x163e('0x6')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x163e('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x163e('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcf2c=['sequelize','exports','STRING','name','crudPermissions','join','getDataValue','BOOLEAN'];(function(_0x5a26d5,_0x317a00){var _0x1e6190=function(_0x178b48){while(--_0x178b48){_0x5a26d5['push'](_0x5a26d5['shift']());}};_0x1e6190(++_0x317a00);}(_0xcf2c,0xc8));var _0xccf2=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0xcf2c[_0x263f4c];return _0x3a78d3;};'use strict';var Sequelize=require(_0xccf2('0x0'));module[_0xccf2('0x1')]={'name':{'type':Sequelize[_0xccf2('0x2')],'allowNull':![],'unique':_0xccf2('0x3')},'crudPermissions':{'type':Sequelize[_0xccf2('0x2')],'set':function(_0x119ce0){this['setDataValue'](_0xccf2('0x4'),_0x119ce0?_0x119ce0[_0xccf2('0x5')](''):[]);},'get':function(){return this[_0xccf2('0x6')](_0xccf2('0x4'))?this['getDataValue']('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xccf2('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xccf2('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xccf2('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xccf2('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index e3db5e3..69dc46d 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 _0x4253=['ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','undefined','count','offset','Content-Range','json','apply','save','then','destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','catch','show','includeAll','find','create','body','clone','params','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','get','UserProfileSection','each','findAll','userProfileId','Resources','update','describe','UserProfileResource','push','removeSections','ids','getSections','enabled','includes','sectionId','isEmpty','subsections','autoAssociation','findOne','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x46ff33,_0xfc5d31){var _0x41fbc9=function(_0x4ef401){while(--_0x4ef401){_0x46ff33['push'](_0x46ff33['shift']());}};_0x41fbc9(++_0xfc5d31);}(_0x4253,0x14c));var _0x3425=function(_0x3fd6ba,_0x5b7a00){_0x3fd6ba=_0x3fd6ba-0x0;var _0x4f5ace=_0x4253[_0x3fd6ba];return _0x4f5ace;};'use strict';var emlformat=require(_0x3425('0x0'));var rimraf=require(_0x3425('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3425('0x2'));var rp=require('request-promise');var moment=require(_0x3425('0x3'));var BPromise=require(_0x3425('0x4'));var Mustache=require(_0x3425('0x5'));var util=require(_0x3425('0x6'));var path=require(_0x3425('0x7'));var sox=require(_0x3425('0x8'));var csv=require(_0x3425('0x9'));var ejs=require(_0x3425('0xa'));var fs=require('fs');var fs_extra=require(_0x3425('0xb'));var _=require('lodash');var squel=require(_0x3425('0xc'));var crypto=require(_0x3425('0xd'));var jsforce=require(_0x3425('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3425('0x9'));var querystring=require(_0x3425('0xf'));var Papa=require('papaparse');var Redis=require(_0x3425('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3425('0x11'));var logger=require(_0x3425('0x12'))(_0x3425('0x13'));var utils=require('../../config/utils');var config=require(_0x3425('0x14'));var licenseUtil=require(_0x3425('0x15'));var db=require(_0x3425('0x16'))['db'];config['redis']=_[_0x3425('0x17')](config[_0x3425('0x18')],{'host':_0x3425('0x19'),'port':0x18eb});var socket=require(_0x3425('0x1a'))(new Redis(config[_0x3425('0x18')]));require(_0x3425('0x1b'))[_0x3425('0x1c')](socket);function respondWithStatusCode(_0x4ded18,_0x1b5984){_0x1b5984=_0x1b5984||0xcc;return function(_0x47b584){if(_0x47b584){return _0x4ded18[_0x3425('0x1d')](_0x1b5984);}return _0x4ded18[_0x3425('0x1e')](_0x1b5984)['end']();};}function respondWithResult(_0x169458,_0x1ab174){_0x1ab174=_0x1ab174||0xc8;return function(_0x57fe16){if(_0x57fe16){return _0x169458[_0x3425('0x1e')](_0x1ab174)['json'](_0x57fe16);}};}function respondWithFilteredResult(_0xd43449,_0x2ffce2){return function(_0x1565c8){if(_0x1565c8){var _0x2156c4=typeof _0x2ffce2['offset']===_0x3425('0x1f')&&typeof _0x2ffce2['limit']===_0x3425('0x1f');var _0xe4b66e=_0x1565c8[_0x3425('0x20')];var _0x72df8b=_0x2156c4?0x0:_0x2ffce2[_0x3425('0x21')];var _0x3444b6=_0x2156c4?_0x1565c8[_0x3425('0x20')]:_0x2ffce2[_0x3425('0x21')]+_0x2ffce2['limit'];var _0x4a6131;if(_0x3444b6>=_0xe4b66e){_0x3444b6=_0xe4b66e;_0x4a6131=0xc8;}else{_0x4a6131=0xce;}_0xd43449[_0x3425('0x1e')](_0x4a6131);return _0xd43449['set'](_0x3425('0x22'),_0x72df8b+'-'+_0x3444b6+'/'+_0xe4b66e)[_0x3425('0x23')](_0x1565c8);}return null;};}function patchUpdates(_0x11705a){return function(_0x29abdd){try{jsonpatch[_0x3425('0x24')](_0x29abdd,_0x11705a,!![]);}catch(_0x2f9881){return BPromise['reject'](_0x2f9881);}return _0x29abdd[_0x3425('0x25')]();};}function saveUpdates(_0x34617c,_0x476504){return function(_0x1e6ef0){if(_0x1e6ef0){return _0x1e6ef0['update'](_0x34617c)[_0x3425('0x26')](function(_0x31d4d5){return _0x31d4d5;});}return null;};}function removeEntity(_0x2a2162,_0x407a76){return function(_0x6f3dd7){if(_0x6f3dd7){return _0x6f3dd7[_0x3425('0x27')]()[_0x3425('0x26')](function(){_0x2a2162[_0x3425('0x1e')](0xcc)[_0x3425('0x28')]();});}};}function handleEntityNotFound(_0xd63a3f,_0x354cb8){return function(_0x16c50a){if(!_0x16c50a){_0xd63a3f[_0x3425('0x1d')](0x194);}return _0x16c50a;};}function handleError(_0x3643e5,_0x4d862d){_0x4d862d=_0x4d862d||0x1f4;return function(_0x1ae04f){logger[_0x3425('0x29')](_0x1ae04f[_0x3425('0x2a')]);if(_0x1ae04f[_0x3425('0x2b')]){delete _0x1ae04f[_0x3425('0x2b')];}_0x3643e5[_0x3425('0x1e')](_0x4d862d)[_0x3425('0x2c')](_0x1ae04f);};}exports[_0x3425('0x2d')]=function(_0xc2f4f5,_0x15aca6){var _0x24b353={},_0xf4111={},_0x256a64={'count':0x0,'rows':[]};var _0x425753=_[_0x3425('0x2e')](db[_0x3425('0x2f')][_0x3425('0x30')],function(_0x4001ac){return{'name':_0x4001ac['fieldName'],'type':_0x4001ac[_0x3425('0x31')][_0x3425('0x32')]};});_0xf4111[_0x3425('0x33')]=_['map'](_0x425753,_0x3425('0x2b'));_0xf4111[_0x3425('0x34')]=_[_0x3425('0x35')](_0xc2f4f5[_0x3425('0x34')]);_0xf4111[_0x3425('0x36')]=_[_0x3425('0x37')](_0xf4111[_0x3425('0x33')],_0xf4111[_0x3425('0x34')]);_0x24b353[_0x3425('0x38')]=_[_0x3425('0x37')](_0xf4111[_0x3425('0x33')],qs[_0x3425('0x39')](_0xc2f4f5['query'][_0x3425('0x39')]));_0x24b353[_0x3425('0x38')]=_0x24b353[_0x3425('0x38')][_0x3425('0x3a')]?_0x24b353[_0x3425('0x38')]:_0xf4111[_0x3425('0x33')];if(!_0xc2f4f5[_0x3425('0x34')][_0x3425('0x3b')](_0x3425('0x3c'))){_0x24b353[_0x3425('0x3d')]=qs[_0x3425('0x3d')](_0xc2f4f5[_0x3425('0x34')]['limit']);_0x24b353[_0x3425('0x21')]=qs[_0x3425('0x21')](_0xc2f4f5[_0x3425('0x34')][_0x3425('0x21')]);}_0x24b353[_0x3425('0x3e')]=qs[_0x3425('0x3f')](_0xc2f4f5[_0x3425('0x34')][_0x3425('0x3f')]);_0x24b353[_0x3425('0x40')]=qs[_0x3425('0x36')](_[_0x3425('0x41')](_0xc2f4f5['query'],_0xf4111[_0x3425('0x36')]),_0x425753);if(_0xc2f4f5[_0x3425('0x34')]['filter']){_0x24b353[_0x3425('0x40')]=_[_0x3425('0x42')](_0x24b353[_0x3425('0x40')],{'$or':_[_0x3425('0x2e')](_0x425753,function(_0x4c6efd){if(_0x4c6efd[_0x3425('0x31')]!==_0x3425('0x43')){var _0x3b3d46={};_0x3b3d46[_0x4c6efd['name']]={'$like':'%'+_0xc2f4f5['query'][_0x3425('0x44')]+'%'};return _0x3b3d46;}})});}_0x24b353=_[_0x3425('0x42')]({},_0x24b353,_0xc2f4f5[_0x3425('0x45')]);var _0xd83775={'where':_0x24b353['where']};return db[_0x3425('0x2f')][_0x3425('0x20')](_0xd83775)[_0x3425('0x26')](function(_0x175084){_0x256a64[_0x3425('0x20')]=_0x175084;if(_0xc2f4f5[_0x3425('0x34')]['includeAll']){_0x24b353[_0x3425('0x46')]=[{'all':!![]}];}return db[_0x3425('0x2f')]['findAll'](_0x24b353);})['then'](function(_0x1b8633){_0x256a64['rows']=_0x1b8633;return _0x256a64;})[_0x3425('0x26')](respondWithFilteredResult(_0x15aca6,_0x24b353))[_0x3425('0x47')](handleError(_0x15aca6,null));};exports[_0x3425('0x48')]=function(_0x1435b4,_0x40db42){var _0x660947={'raw':![],'where':{'id':_0x1435b4['params']['id']}},_0x217a16={};_0x217a16['model']=_[_0x3425('0x35')](db[_0x3425('0x2f')][_0x3425('0x30')]);_0x217a16[_0x3425('0x34')]=_[_0x3425('0x35')](_0x1435b4[_0x3425('0x34')]);_0x217a16['filters']=_[_0x3425('0x37')](_0x217a16[_0x3425('0x33')],_0x217a16[_0x3425('0x34')]);_0x660947[_0x3425('0x38')]=_[_0x3425('0x37')](_0x217a16[_0x3425('0x33')],qs['fields'](_0x1435b4[_0x3425('0x34')][_0x3425('0x39')]));_0x660947['attributes']=_0x660947[_0x3425('0x38')]['length']?_0x660947['attributes']:_0x217a16[_0x3425('0x33')];if(_0x1435b4[_0x3425('0x34')][_0x3425('0x49')]){_0x660947['include']=[{'all':!![]}];}_0x660947=_[_0x3425('0x42')]({},_0x660947,_0x1435b4['options']);return db[_0x3425('0x2f')][_0x3425('0x4a')](_0x660947)['then'](handleEntityNotFound(_0x40db42,null))[_0x3425('0x26')](respondWithResult(_0x40db42,null))[_0x3425('0x47')](handleError(_0x40db42,null));};exports[_0x3425('0x4b')]=function(_0x17626f,_0x357312){return db[_0x3425('0x2f')][_0x3425('0x4b')](_0x17626f[_0x3425('0x4c')],{})[_0x3425('0x26')](respondWithResult(_0x357312,0xc9))[_0x3425('0x47')](handleError(_0x357312,null));};exports[_0x3425('0x4d')]=function(_0x511379,_0x7bb1d){var _0x25d92b={'where':{'id':_0x511379[_0x3425('0x4e')]['id']}},_0x567164={};_0x567164[_0x3425('0x33')]=_['keys'](db['UserProfile'][_0x3425('0x30')]);_0x25d92b[_0x3425('0x38')]=_[_0x3425('0x37')](_0x567164['model'],qs[_0x3425('0x39')](_0x511379[_0x3425('0x34')][_0x3425('0x39')]));_0x25d92b['attributes']=_0x25d92b['attributes'][_0x3425('0x3a')]?_0x25d92b[_0x3425('0x38')]:_0x567164[_0x3425('0x33')];if(_0x511379[_0x3425('0x34')][_0x3425('0x49')]){_0x25d92b['include']=[{'all':!![]}];}_0x25d92b=_['merge']({},_0x25d92b,_0x511379[_0x3425('0x45')]);return db[_0x3425('0x2f')][_0x3425('0x4a')](_0x25d92b)['then'](handleEntityNotFound(_0x7bb1d,null))[_0x3425('0x26')](function(_0x4907d6){if(_0x4907d6){var _0x6c3b72=_0x4907d6['get']({'plain':!![]});_0x6c3b72=qs['omit'](_0x6c3b72,['id',_0x3425('0x4f'),_0x3425('0x50'),_0x3425('0x51')]);_0x511379[_0x3425('0x4c')]=_[_0x3425('0x52')](_0x511379[_0x3425('0x4c')],['id',_0x3425('0x4f'),_0x3425('0x50')]);return db[_0x3425('0x53')][_0x3425('0x54')](function(_0x1a3f16){return db[_0x3425('0x2f')][_0x3425('0x4b')](_[_0x3425('0x42')](_0x6c3b72,_0x511379['body']),{'include':_0x511379[_0x3425('0x34')][_0x3425('0x49')]?[{'all':!![]}]:undefined,'transaction':_0x1a3f16})['then'](function(_0x3e0abc){var _0x23e2b9=_0x3e0abc[_0x3425('0x55')]({'plain':!![]});return db[_0x3425('0x56')]['findAll']({'where':{'userProfileId':_0x511379[_0x3425('0x4e')]['id']},'raw':!![]})['then'](function(_0x3ccead){if(_0x3ccead){return BPromise[_0x3425('0x57')](_0x3ccead,function(_0x5a2919){return new BPromise(function(_0x136067,_0x1c6724){if(_0x5a2919['autoAssociation']===null||_0x5a2919['autoAssociation']===0x1)_0x136067(null);return db['UserProfileResource'][_0x3425('0x58')]({'where':{'sectionId':_0x5a2919['id']},'raw':!![]})[_0x3425('0x26')](function(_0x588472){var _0x37a8ce=_['map'](_0x588472,function(_0x2d3513){return qs[_0x3425('0x52')](_0x2d3513,['id',_0x3425('0x4f'),_0x3425('0x50'),'sectionId']);});_0x136067(_0x37a8ce);})[_0x3425('0x47')](function(_0x247ea9){_0x1c6724(_0x247ea9);});})[_0x3425('0x26')](function(_0x3eb74c){var _0x11844b=qs[_0x3425('0x52')](_0x5a2919,['id',_0x3425('0x4f'),_0x3425('0x50')]);_0x11844b[_0x3425('0x59')]=_0x23e2b9['id'];if(_0x3eb74c)_0x11844b[_0x3425('0x5a')]=_0x3eb74c;return _0x11844b;})['then'](function(_0x28682d){return db[_0x3425('0x56')][_0x3425('0x4b')](_0x28682d,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x1a3f16});});})[_0x3425('0x26')](function(){return _0x23e2b9;});}});});});}})['then'](respondWithResult(_0x7bb1d,0xc9))[_0x3425('0x47')](handleError(_0x7bb1d,null));};exports[_0x3425('0x5b')]=function(_0x4e1f18,_0x3492f0){if(_0x4e1f18[_0x3425('0x4c')]['id']){delete _0x4e1f18[_0x3425('0x4c')]['id'];}return db[_0x3425('0x2f')][_0x3425('0x4a')]({'where':{'id':_0x4e1f18[_0x3425('0x4e')]['id']}})[_0x3425('0x26')](handleEntityNotFound(_0x3492f0,null))[_0x3425('0x26')](saveUpdates(_0x4e1f18[_0x3425('0x4c')],null))[_0x3425('0x26')](respondWithResult(_0x3492f0,null))['catch'](handleError(_0x3492f0,null));};exports[_0x3425('0x27')]=function(_0x279b7a,_0x22bdd4){return db['UserProfile']['find']({'where':{'id':_0x279b7a[_0x3425('0x4e')]['id']}})[_0x3425('0x26')](handleEntityNotFound(_0x22bdd4,null))[_0x3425('0x26')](removeEntity(_0x22bdd4,null))['catch'](handleError(_0x22bdd4,null));};exports[_0x3425('0x5c')]=function(_0x3f93f3,_0x653713){return db[_0x3425('0x2f')][_0x3425('0x5c')]()[_0x3425('0x26')](respondWithResult(_0x653713,null))[_0x3425('0x47')](handleError(_0x653713,null));};exports['addSections']=function(_0x118f00,_0x37622f){var _0x37dda2=_0x118f00[_0x3425('0x4c')];return db[_0x3425('0x2f')]['find']({'where':{'id':_0x118f00[_0x3425('0x4e')]['id']}})['then'](handleEntityNotFound(_0x37622f,null))[_0x3425('0x26')](function(_0x491c5c){if(_0x491c5c){return db[_0x3425('0x53')]['transaction'](function(_0x2b584a){return db[_0x3425('0x56')]['destroy']({'where':{'userProfileId':_0x118f00['params']['id'],'sectionId':_[_0x3425('0x2e')](_0x37dda2,function(_0x388ea6){return _0x388ea6['sectionId'];})},'transaction':_0x2b584a})[_0x3425('0x26')](function(){var _0x5d43a=_[_0x3425('0x2e')](_0x37dda2,function(_0x5cd73c){_0x5cd73c[_0x3425('0x59')]=_0x118f00[_0x3425('0x4e')]['id'];return _0x5cd73c;});var _0x3fb9fe=[];return BPromise[_0x3425('0x57')](_0x5d43a,function(_0x582f49){return db['UserProfileSection']['create'](_0x582f49,{'include':[{'model':db[_0x3425('0x5d')],'as':_0x3425('0x5a')}],'raw':!![],'transaction':_0x2b584a})['then'](function(_0x4946bb){_0x3fb9fe[_0x3425('0x5e')](_0x4946bb[_0x3425('0x55')]({'plain':!![]}));});})[_0x3425('0x26')](function(){return _0x3fb9fe;});});});}})['then'](function(_0x4946d3){return _0x4946d3;})[_0x3425('0x26')](respondWithResult(_0x37622f,null))[_0x3425('0x47')](handleError(_0x37622f,null));};exports[_0x3425('0x5f')]=function(_0x1fd540,_0x4c169e){var _0x3b07de;return db[_0x3425('0x2f')][_0x3425('0x4a')]({'where':{'id':_0x1fd540[_0x3425('0x4e')]['id']},'attributes':['id','name']})[_0x3425('0x26')](handleEntityNotFound(_0x4c169e,null))['then'](function(_0x1248d3){if(_0x1248d3){_0x3b07de=_0x1248d3;return db['UserProfileSection'][_0x3425('0x27')]({'where':{'userProfileId':_0x1fd540[_0x3425('0x4e')]['id'],'sectionId':_0x1fd540[_0x3425('0x34')][_0x3425('0x60')]}});}})[_0x3425('0x26')](function(){return _0x3b07de;})[_0x3425('0x26')](respondWithStatusCode(_0x4c169e,null))[_0x3425('0x47')](handleError(_0x4c169e,null));};exports[_0x3425('0x61')]=function(_0x5b2b50,_0x5b53b8){var _0x2de35f=[];var _0x2a15f5=[];return db[_0x3425('0x56')][_0x3425('0x58')]({'where':{'userProfileId':_0x5b2b50[_0x3425('0x4e')]['id']},'raw':!![]})['then'](function(_0x40bf7a){_0x2de35f=_[_0x3425('0x44')](_0x40bf7a,function(_0x544643){return _0x544643[_0x3425('0x62')]===0x1||_[_0x3425('0x63')]([0x3eb,0x709],_0x544643[_0x3425('0x64')]);});if(!_[_0x3425('0x65')](_0x2de35f)){return _[_0x3425('0x2e')](_0x2de35f,function(_0x13b127){return _0x13b127['sectionId'];});}else{return;}})['then'](function(_0x35f4d8){if(_0x35f4d8)_0x2a15f5=_0x35f4d8;if(_[_0x3425('0x63')](_0x2a15f5,0x64)){var _0x2098cf=_[_0x3425('0x4a')](_0x2de35f,{'sectionId':0x64});return hasDefaultDashboard(_0x2098cf)[_0x3425('0x26')](function(_0x10d93f){return _[_0x3425('0x2e')](_0x2de35f,function(_0x544299){if(_0x544299[_0x3425('0x64')]===0x64){_0x544299[_0x3425('0x66')]=_0x10d93f;}return _0x544299;});});}else{return;}})[_0x3425('0x26')](function(_0x2b8671){if(_0x2b8671)_0x2de35f=_0x2b8671;if(_['includes'](_0x2a15f5,0x3eb)){var _0x5bc7ad=_[_0x3425('0x4a')](_0x2de35f,{'sectionId':0x3eb});return getCustomDashboards(_0x5bc7ad)[_0x3425('0x26')](function(_0x47eb35){return _['map'](_0x2de35f,function(_0x1ed036){if(_0x5bc7ad[_0x3425('0x62')]){if(_0x1ed036[_0x3425('0x64')]===0x3eb){_0x1ed036['subsections']=_0x47eb35;}}else{if(_0x1ed036[_0x3425('0x64')]===0x64){_0x1ed036[_0x3425('0x66')]=_0x47eb35;}}return _0x1ed036;});});}else{return;}})[_0x3425('0x26')](function(_0x50f26e){if(_0x50f26e)_0x2de35f=_0x50f26e;if(_[_0x3425('0x63')](_0x2a15f5,0x709)){var _0x358906=_[_0x3425('0x4a')](_0x2de35f,{'sectionId':0x709});return getPlugins(_0x358906)[_0x3425('0x26')](function(_0x2e5001){if(_0x358906[_0x3425('0x62')]){return _[_0x3425('0x2e')](_0x2de35f,function(_0x33641e){if(_0x33641e['sectionId']===0x709){_0x33641e[_0x3425('0x66')]=_0x2e5001;}return _0x33641e;});}else{var _0x44ee53={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2e5001};var _0x13bbea=_[_0x3425('0x2e')](_0x2de35f);_0x13bbea['push'](_0x44ee53);return _0x13bbea;}});}else{return;}})[_0x3425('0x26')](function(_0x48e287){if(_0x48e287)_0x2de35f=_0x48e287;return _['filter'](_0x2de35f,[_0x3425('0x62'),0x1]);})[_0x3425('0x26')](respondWithResult(_0x5b53b8,null))[_0x3425('0x47')](handleError(_0x5b53b8,null));};function hasDefaultDashboard(_0x29922d){var _0x2523db=[0x65];return new BPromise(function(_0xf73d26,_0x55bc9c){try{if(_0x29922d[_0x3425('0x67')]){_0xf73d26(_0x2523db);}else{return db[_0x3425('0x5d')][_0x3425('0x68')]({'where':{'sectionId':_0x29922d['id']},'raw':!![]})[_0x3425('0x26')](function(_0x9043dc){_0x9043dc?_0xf73d26(_0x2523db):_0xf73d26();});}}catch(_0x2f0091){_0x55bc9c(_0x2f0091);}});}function getCustomDashboards(_0x56b9e3){var _0x212e51=[];return new BPromise(function(_0xebd283,_0x111cdd){try{if(_0x56b9e3[_0x3425('0x67')]){return db['Dashboard'][_0x3425('0x58')]({'raw':!![]})['then'](function(_0x29130a){_0x29130a[_0x3425('0x69')](function(_0xa99fe3){_0x212e51[_0x3425('0x5e')](_0xa99fe3['id']+0x1869f);});_0xebd283(_0x212e51);});}else{return db[_0x3425('0x5d')]['findAll']({'where':{'sectionId':_0x56b9e3['id']},'raw':!![]})['then'](function(_0x4268cc){_0x4268cc['forEach'](function(_0x490adf){_0x212e51['push'](_0x490adf['resourceId']+0x1869f);});_0xebd283(_0x212e51);});}}catch(_0x376a08){_0x111cdd(_0x376a08);}});}function getPlugins(_0x5b453f){var _0x493f2c=[];return new BPromise(function(_0x3e2eaf,_0x166da7){try{if(_0x5b453f[_0x3425('0x67')]){return db[_0x3425('0x6a')][_0x3425('0x58')]({'raw':!![]})[_0x3425('0x26')](function(_0x2af420){_0x2af420[_0x3425('0x69')](function(_0x3bf581){_0x493f2c[_0x3425('0x5e')](_0x3bf581['id']+0x15b38);});_0x3e2eaf(_0x493f2c);});}else{return db[_0x3425('0x5d')][_0x3425('0x58')]({'where':{'sectionId':_0x5b453f['id']},'raw':!![]})['then'](function(_0x4c9cb0){_0x4c9cb0[_0x3425('0x69')](function(_0xd4ab0){_0x493f2c[_0x3425('0x5e')](_0xd4ab0[_0x3425('0x6b')]+0x15b38);});_0x3e2eaf(_0x493f2c);});}}catch(_0x13c6d4){_0x166da7(_0x13c6d4);}});}exports['addResources']=function(_0x198ee7,_0x536d8a){return db['UserProfile'][_0x3425('0x4a')]({'where':{'id':_0x198ee7['params']['id']}})[_0x3425('0x26')](handleEntityNotFound(_0x536d8a,null))[_0x3425('0x26')](function(_0x4b8232){if(_0x4b8232){return db['sequelize']['transaction'](function(_0x609d54){return db[_0x3425('0x56')]['findAll']({'where':{'userProfileId':_0x198ee7[_0x3425('0x4e')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x48f3e1){if(_0x48f3e1){return db[_0x3425('0x56')][_0x3425('0x27')]({'where':{'userProfileId':_0x198ee7[_0x3425('0x4e')]['id'],'id':_[_0x3425('0x2e')](_0x48f3e1,function(_0x156e03){return _0x156e03['id'];})},'transaction':_0x609d54});}})[_0x3425('0x26')](function(_0x4f2a8a){var _0x46d743=_['map'](_0x198ee7[_0x3425('0x4c')],function(_0x242625){_0x242625['userProfileId']=_0x198ee7[_0x3425('0x4e')]['id'];return _0x242625;});return db[_0x3425('0x56')][_0x3425('0x6c')](_0x46d743,{'raw':!![],'transaction':_0x609d54});})[_0x3425('0x26')](function(_0x348074){var _0x3701d9=_['filter'](_[_0x3425('0x2e')](_0x348074,function(_0x5095b6){return _0x5095b6['get']({'plain':!![]});}),{'includeAll':![]});if(_0x3701d9){return db[_0x3425('0x56')]['findAll']({'where':{'userProfileId':_0x198ee7[_0x3425('0x4e')]['id'],'sectionId':_[_0x3425('0x2e')](_0x3701d9,function(_0x262e36){return _0x262e36[_0x3425('0x64')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x3425('0x26')](function(_0x36cbc0){var _0x53b9d1=_['map'](_0x198ee7[_0x3425('0x4c')],function(_0x38fe17){_0x38fe17[_0x3425('0x59')]=_0x198ee7[_0x3425('0x4e')]['id'];return _0x38fe17;});return db['UserProfileResource'][_0x3425('0x6c')](_0x53b9d1,{'raw':!![],'transaction':_0x609d54});});}})['catch'](handleError(_0x536d8a,null));});}})[_0x3425('0x26')](function(_0xb35aee){var _0x2c502a=_[_0x3425('0x2e')](_0xb35aee,function(_0x37e605){return _0x37e605['get']({'plain':!![]});});})[_0x3425('0x26')](respondWithResult(_0x536d8a,null))[_0x3425('0x47')](handleError(_0x536d8a,null));};exports[_0x3425('0x6d')]=function(_0x480e50,_0x36508c,_0x339e01){return db[_0x3425('0x2f')][_0x3425('0x4a')]({'where':{'id':_0x480e50['params']['id']}})['then'](handleEntityNotFound(_0x36508c,null))[_0x3425('0x26')](function(_0x14f0ac){if(_0x14f0ac){return _0x14f0ac[_0x3425('0x6d')](_0x480e50['query'][_0x3425('0x60')]);}})[_0x3425('0x26')](respondWithStatusCode(_0x36508c,null))[_0x3425('0x47')](handleError(_0x36508c,null));};exports[_0x3425('0x6e')]=function(_0x137f84,_0x4a7955){var _0x1c8734={};if(!_0x137f84[_0x3425('0x34')][_0x3425('0x6f')])throw new Error(_0x3425('0x70'));if(!_0x137f84[_0x3425('0x34')]['hasOwnProperty'](_0x3425('0x3c'))){_0x1c8734[_0x3425('0x3d')]=qs[_0x3425('0x3d')](_0x137f84[_0x3425('0x34')][_0x3425('0x3d')]);_0x1c8734[_0x3425('0x21')]=qs[_0x3425('0x21')](_0x137f84[_0x3425('0x34')][_0x3425('0x21')]);}return db['UserProfile'][_0x3425('0x4a')]({'where':{'id':_0x137f84['params']['id']}})[_0x3425('0x26')](function(_0x3a4788){if(!_0x3a4788)throw new Error(_0x3425('0x71')+_0x137f84['params']['id']);return db[_0x3425('0x2f')][_0x3425('0x6e')](_0x137f84);})['then'](respondWithFilteredResult(_0x4a7955,_0x1c8734))[_0x3425('0x47')](handleError(_0x4a7955,null));}; \ No newline at end of file +var _0x7af9=['get','omit','createdAt','body','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','find'];(function(_0x54a299,_0x338a6d){var _0x51c368=function(_0x45365c){while(--_0x45365c){_0x54a299['push'](_0x54a299['shift']());}};_0x51c368(++_0x338a6d);}(_0x7af9,0x95));var _0x97af=function(_0xd51fd3,_0x1644b2){_0xd51fd3=_0xd51fd3-0x0;var _0x2d79f6=_0x7af9[_0xd51fd3];return _0x2d79f6;};'use strict';var emlformat=require(_0x97af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x97af('0x1'));var jsonpatch=require(_0x97af('0x2'));var rp=require('request-promise');var moment=require(_0x97af('0x3'));var BPromise=require(_0x97af('0x4'));var Mustache=require(_0x97af('0x5'));var util=require(_0x97af('0x6'));var path=require(_0x97af('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97af('0x8'));var _=require(_0x97af('0x9'));var squel=require(_0x97af('0xa'));var crypto=require(_0x97af('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x97af('0xc'));var toCsv=require(_0x97af('0xd'));var querystring=require(_0x97af('0xe'));var Papa=require('papaparse');var Redis=require(_0x97af('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x97af('0x10'));var as=require(_0x97af('0x11'));var hardwareService=require(_0x97af('0x12'));var logger=require(_0x97af('0x13'))(_0x97af('0x14'));var utils=require(_0x97af('0x15'));var config=require(_0x97af('0x16'));var licenseUtil=require(_0x97af('0x17'));var db=require(_0x97af('0x18'))['db'];config[_0x97af('0x19')]=_[_0x97af('0x1a')](config['redis'],{'host':_0x97af('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x97af('0x1c'))[_0x97af('0x1d')](socket);function respondWithStatusCode(_0x458751,_0xbf7de1){_0xbf7de1=_0xbf7de1||0xcc;return function(_0x43eb12){if(_0x43eb12){return _0x458751[_0x97af('0x1e')](_0xbf7de1);}return _0x458751[_0x97af('0x1f')](_0xbf7de1)['end']();};}function respondWithResult(_0x281f8a,_0x4e679e){_0x4e679e=_0x4e679e||0xc8;return function(_0x277b71){if(_0x277b71){return _0x281f8a['status'](_0x4e679e)[_0x97af('0x20')](_0x277b71);}};}function respondWithFilteredResult(_0x47c57b,_0x1aa3f9){return function(_0x2ae4ce){if(_0x2ae4ce){var _0x3815da=typeof _0x1aa3f9[_0x97af('0x21')]===_0x97af('0x22')&&typeof _0x1aa3f9['limit']===_0x97af('0x22');var _0x4a6bca=_0x2ae4ce['count'];var _0x519297=_0x3815da?0x0:_0x1aa3f9[_0x97af('0x21')];var _0x3447ce=_0x3815da?_0x2ae4ce['count']:_0x1aa3f9[_0x97af('0x21')]+_0x1aa3f9['limit'];var _0x2a77f0;if(_0x3447ce>=_0x4a6bca){_0x3447ce=_0x4a6bca;_0x2a77f0=0xc8;}else{_0x2a77f0=0xce;}_0x47c57b[_0x97af('0x1f')](_0x2a77f0);return _0x47c57b[_0x97af('0x23')](_0x97af('0x24'),_0x519297+'-'+_0x3447ce+'/'+_0x4a6bca)[_0x97af('0x20')](_0x2ae4ce);}return null;};}function patchUpdates(_0x53323a){return function(_0x1a0cde){try{jsonpatch[_0x97af('0x25')](_0x1a0cde,_0x53323a,!![]);}catch(_0xe1679b){return BPromise[_0x97af('0x26')](_0xe1679b);}return _0x1a0cde[_0x97af('0x27')]();};}function saveUpdates(_0x2a7740,_0x275e8c){return function(_0x41122c){if(_0x41122c){return _0x41122c['update'](_0x2a7740)[_0x97af('0x28')](function(_0x651a83){return _0x651a83;});}return null;};}function removeEntity(_0x545b3d,_0xc00f30){return function(_0x677042){if(_0x677042){return _0x677042[_0x97af('0x29')]()['then'](function(){_0x545b3d[_0x97af('0x1f')](0xcc)[_0x97af('0x2a')]();});}};}function handleEntityNotFound(_0x394bf9,_0x444926){return function(_0x465708){if(!_0x465708){_0x394bf9['sendStatus'](0x194);}return _0x465708;};}function handleError(_0x2c86fb,_0x46f503){_0x46f503=_0x46f503||0x1f4;return function(_0x51b9e7){logger[_0x97af('0x2b')](_0x51b9e7[_0x97af('0x2c')]);if(_0x51b9e7[_0x97af('0x2d')]){delete _0x51b9e7[_0x97af('0x2d')];}_0x2c86fb[_0x97af('0x1f')](_0x46f503)[_0x97af('0x2e')](_0x51b9e7);};}exports[_0x97af('0x2f')]=function(_0x26f891,_0x63fe87){var _0x431f41={},_0x4e4127={},_0x32b3c0={'count':0x0,'rows':[]};var _0x564e58=_[_0x97af('0x30')](db[_0x97af('0x31')][_0x97af('0x32')],function(_0x3e7b9a){return{'name':_0x3e7b9a[_0x97af('0x33')],'type':_0x3e7b9a[_0x97af('0x34')][_0x97af('0x35')]};});_0x4e4127[_0x97af('0x36')]=_[_0x97af('0x30')](_0x564e58,_0x97af('0x2d'));_0x4e4127['query']=_[_0x97af('0x37')](_0x26f891[_0x97af('0x38')]);_0x4e4127['filters']=_[_0x97af('0x39')](_0x4e4127['model'],_0x4e4127[_0x97af('0x38')]);_0x431f41['attributes']=_['intersection'](_0x4e4127[_0x97af('0x36')],qs[_0x97af('0x3a')](_0x26f891[_0x97af('0x38')]['fields']));_0x431f41[_0x97af('0x3b')]=_0x431f41[_0x97af('0x3b')][_0x97af('0x3c')]?_0x431f41[_0x97af('0x3b')]:_0x4e4127[_0x97af('0x36')];if(!_0x26f891['query'][_0x97af('0x3d')](_0x97af('0x3e'))){_0x431f41[_0x97af('0x3f')]=qs[_0x97af('0x3f')](_0x26f891['query']['limit']);_0x431f41['offset']=qs[_0x97af('0x21')](_0x26f891[_0x97af('0x38')][_0x97af('0x21')]);}_0x431f41[_0x97af('0x40')]=qs['sort'](_0x26f891['query']['sort']);_0x431f41[_0x97af('0x41')]=qs[_0x97af('0x42')](_[_0x97af('0x43')](_0x26f891[_0x97af('0x38')],_0x4e4127[_0x97af('0x42')]),_0x564e58);if(_0x26f891[_0x97af('0x38')]['filter']){_0x431f41[_0x97af('0x41')]=_['merge'](_0x431f41['where'],{'$or':_[_0x97af('0x30')](_0x564e58,function(_0x1af726){if(_0x1af726[_0x97af('0x34')]!==_0x97af('0x44')){var _0x56d582={};_0x56d582[_0x1af726[_0x97af('0x2d')]]={'$like':'%'+_0x26f891[_0x97af('0x38')][_0x97af('0x45')]+'%'};return _0x56d582;}})});}_0x431f41=_[_0x97af('0x46')]({},_0x431f41,_0x26f891[_0x97af('0x47')]);var _0x3252a5={'where':_0x431f41[_0x97af('0x41')]};return db[_0x97af('0x31')]['count'](_0x3252a5)[_0x97af('0x28')](function(_0x3c709f){_0x32b3c0['count']=_0x3c709f;if(_0x26f891['query'][_0x97af('0x48')]){_0x431f41[_0x97af('0x49')]=[{'all':!![]}];}return db[_0x97af('0x31')][_0x97af('0x4a')](_0x431f41);})[_0x97af('0x28')](function(_0x3b13e2){_0x32b3c0[_0x97af('0x4b')]=_0x3b13e2;return _0x32b3c0;})[_0x97af('0x28')](respondWithFilteredResult(_0x63fe87,_0x431f41))[_0x97af('0x4c')](handleError(_0x63fe87,null));};exports[_0x97af('0x4d')]=function(_0x3e88f9,_0x26d05c){var _0x126c5b={'raw':![],'where':{'id':_0x3e88f9[_0x97af('0x4e')]['id']}},_0x6ff6b={};_0x6ff6b[_0x97af('0x36')]=_[_0x97af('0x37')](db[_0x97af('0x31')][_0x97af('0x32')]);_0x6ff6b[_0x97af('0x38')]=_['keys'](_0x3e88f9[_0x97af('0x38')]);_0x6ff6b[_0x97af('0x42')]=_[_0x97af('0x39')](_0x6ff6b[_0x97af('0x36')],_0x6ff6b[_0x97af('0x38')]);_0x126c5b[_0x97af('0x3b')]=_[_0x97af('0x39')](_0x6ff6b[_0x97af('0x36')],qs[_0x97af('0x3a')](_0x3e88f9[_0x97af('0x38')][_0x97af('0x3a')]));_0x126c5b[_0x97af('0x3b')]=_0x126c5b[_0x97af('0x3b')][_0x97af('0x3c')]?_0x126c5b[_0x97af('0x3b')]:_0x6ff6b[_0x97af('0x36')];if(_0x3e88f9[_0x97af('0x38')][_0x97af('0x48')]){_0x126c5b[_0x97af('0x49')]=[{'all':!![]}];}_0x126c5b=_['merge']({},_0x126c5b,_0x3e88f9[_0x97af('0x47')]);return db[_0x97af('0x31')]['find'](_0x126c5b)[_0x97af('0x28')](handleEntityNotFound(_0x26d05c,null))[_0x97af('0x28')](respondWithResult(_0x26d05c,null))['catch'](handleError(_0x26d05c,null));};exports[_0x97af('0x4f')]=function(_0x8ab790,_0x5bbbe3){return db[_0x97af('0x31')][_0x97af('0x4f')](_0x8ab790['body'],{})['then'](respondWithResult(_0x5bbbe3,0xc9))[_0x97af('0x4c')](handleError(_0x5bbbe3,null));};exports['clone']=function(_0x33c052,_0x52f29c){var _0x5700ba={'where':{'id':_0x33c052[_0x97af('0x4e')]['id']}},_0x590905={};_0x590905[_0x97af('0x36')]=_[_0x97af('0x37')](db['UserProfile'][_0x97af('0x32')]);_0x5700ba['attributes']=_[_0x97af('0x39')](_0x590905['model'],qs[_0x97af('0x3a')](_0x33c052[_0x97af('0x38')][_0x97af('0x3a')]));_0x5700ba[_0x97af('0x3b')]=_0x5700ba[_0x97af('0x3b')][_0x97af('0x3c')]?_0x5700ba['attributes']:_0x590905[_0x97af('0x36')];if(_0x33c052[_0x97af('0x38')][_0x97af('0x48')]){_0x5700ba['include']=[{'all':!![]}];}_0x5700ba=_['merge']({},_0x5700ba,_0x33c052[_0x97af('0x47')]);return db['UserProfile'][_0x97af('0x50')](_0x5700ba)[_0x97af('0x28')](handleEntityNotFound(_0x52f29c,null))[_0x97af('0x28')](function(_0x5457cc){if(_0x5457cc){var _0x46e806=_0x5457cc[_0x97af('0x51')]({'plain':!![]});_0x46e806=qs[_0x97af('0x52')](_0x46e806,['id',_0x97af('0x53'),'updatedAt','crudPermissions']);_0x33c052['body']=_[_0x97af('0x52')](_0x33c052[_0x97af('0x54')],['id','createdAt',_0x97af('0x55')]);return db[_0x97af('0x56')][_0x97af('0x57')](function(_0x95291f){return db[_0x97af('0x31')]['create'](_['merge'](_0x46e806,_0x33c052[_0x97af('0x54')]),{'include':_0x33c052[_0x97af('0x38')][_0x97af('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x95291f})[_0x97af('0x28')](function(_0xe35f28){var _0x1aad11=_0xe35f28[_0x97af('0x51')]({'plain':!![]});return db[_0x97af('0x58')][_0x97af('0x4a')]({'where':{'userProfileId':_0x33c052[_0x97af('0x4e')]['id']},'raw':!![]})[_0x97af('0x28')](function(_0x1b13c8){if(_0x1b13c8){return BPromise[_0x97af('0x59')](_0x1b13c8,function(_0x41a959){return new BPromise(function(_0x1b4a26,_0x424e50){if(_0x41a959[_0x97af('0x5a')]===null||_0x41a959[_0x97af('0x5a')]===0x1)_0x1b4a26(null);return db[_0x97af('0x5b')]['findAll']({'where':{'sectionId':_0x41a959['id']},'raw':!![]})[_0x97af('0x28')](function(_0x50e5c8){var _0x25e570=_[_0x97af('0x30')](_0x50e5c8,function(_0xeceb21){return qs['omit'](_0xeceb21,['id','createdAt',_0x97af('0x55'),_0x97af('0x5c')]);});_0x1b4a26(_0x25e570);})[_0x97af('0x4c')](function(_0x5d89e5){_0x424e50(_0x5d89e5);});})[_0x97af('0x28')](function(_0xb3a15d){var _0x4fd7dd=qs[_0x97af('0x52')](_0x41a959,['id','createdAt',_0x97af('0x55')]);_0x4fd7dd[_0x97af('0x5d')]=_0x1aad11['id'];if(_0xb3a15d)_0x4fd7dd[_0x97af('0x5e')]=_0xb3a15d;return _0x4fd7dd;})[_0x97af('0x28')](function(_0x24c228){return db['UserProfileSection'][_0x97af('0x4f')](_0x24c228,{'include':[{'model':db[_0x97af('0x5b')],'as':_0x97af('0x5e')}],'raw':!![],'transaction':_0x95291f});});})['then'](function(){return _0x1aad11;});}});});});}})['then'](respondWithResult(_0x52f29c,0xc9))[_0x97af('0x4c')](handleError(_0x52f29c,null));};exports['update']=function(_0x5a02e6,_0x531f00){if(_0x5a02e6['body']['id']){delete _0x5a02e6[_0x97af('0x54')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x5a02e6[_0x97af('0x4e')]['id']}})['then'](handleEntityNotFound(_0x531f00,null))[_0x97af('0x28')](saveUpdates(_0x5a02e6[_0x97af('0x54')],null))[_0x97af('0x28')](respondWithResult(_0x531f00,null))[_0x97af('0x4c')](handleError(_0x531f00,null));};exports[_0x97af('0x29')]=function(_0x1c10e7,_0x388598){return db[_0x97af('0x31')][_0x97af('0x50')]({'where':{'id':_0x1c10e7[_0x97af('0x4e')]['id']}})[_0x97af('0x28')](handleEntityNotFound(_0x388598,null))[_0x97af('0x28')](removeEntity(_0x388598,null))[_0x97af('0x4c')](handleError(_0x388598,null));};exports[_0x97af('0x5f')]=function(_0x37ed42,_0xdf4c6d){return db[_0x97af('0x31')][_0x97af('0x5f')]()[_0x97af('0x28')](respondWithResult(_0xdf4c6d,null))[_0x97af('0x4c')](handleError(_0xdf4c6d,null));};exports[_0x97af('0x60')]=function(_0x3b6462,_0x4c5672){var _0x3f2091=_0x3b6462[_0x97af('0x54')];return db[_0x97af('0x31')]['find']({'where':{'id':_0x3b6462[_0x97af('0x4e')]['id']}})[_0x97af('0x28')](handleEntityNotFound(_0x4c5672,null))['then'](function(_0x111786){if(_0x111786){return db[_0x97af('0x56')][_0x97af('0x57')](function(_0x46ebbf){return db[_0x97af('0x58')][_0x97af('0x29')]({'where':{'userProfileId':_0x3b6462['params']['id'],'sectionId':_[_0x97af('0x30')](_0x3f2091,function(_0x272d07){return _0x272d07[_0x97af('0x5c')];})},'transaction':_0x46ebbf})[_0x97af('0x28')](function(){var _0x1eb4c4=_[_0x97af('0x30')](_0x3f2091,function(_0xbb3a46){_0xbb3a46['userProfileId']=_0x3b6462[_0x97af('0x4e')]['id'];return _0xbb3a46;});var _0x2fa4c8=[];return BPromise[_0x97af('0x59')](_0x1eb4c4,function(_0x483c2b){return db[_0x97af('0x58')][_0x97af('0x4f')](_0x483c2b,{'include':[{'model':db[_0x97af('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x46ebbf})[_0x97af('0x28')](function(_0x5eeaa1){_0x2fa4c8[_0x97af('0x61')](_0x5eeaa1['get']({'plain':!![]}));});})[_0x97af('0x28')](function(){return _0x2fa4c8;});});});}})[_0x97af('0x28')](function(_0x1b8cc3){return _0x1b8cc3;})[_0x97af('0x28')](respondWithResult(_0x4c5672,null))[_0x97af('0x4c')](handleError(_0x4c5672,null));};exports[_0x97af('0x62')]=function(_0x97b296,_0x24ef2e){var _0xf7b02a;return db[_0x97af('0x31')][_0x97af('0x50')]({'where':{'id':_0x97b296['params']['id']},'attributes':['id',_0x97af('0x2d')]})[_0x97af('0x28')](handleEntityNotFound(_0x24ef2e,null))['then'](function(_0x361498){if(_0x361498){_0xf7b02a=_0x361498;return db[_0x97af('0x58')][_0x97af('0x29')]({'where':{'userProfileId':_0x97b296[_0x97af('0x4e')]['id'],'sectionId':_0x97b296[_0x97af('0x38')][_0x97af('0x63')]}});}})[_0x97af('0x28')](function(){return _0xf7b02a;})[_0x97af('0x28')](respondWithStatusCode(_0x24ef2e,null))[_0x97af('0x4c')](handleError(_0x24ef2e,null));};exports[_0x97af('0x64')]=function(_0x4a9d6e,_0x2f1719){var _0x54569a=[];var _0x568493=[];return db[_0x97af('0x58')][_0x97af('0x4a')]({'where':{'userProfileId':_0x4a9d6e['params']['id']},'raw':!![]})['then'](function(_0x363754){_0x54569a=_[_0x97af('0x45')](_0x363754,function(_0x20e800){return _0x20e800['enabled']===0x1||_[_0x97af('0x65')]([0x3eb,0x709],_0x20e800[_0x97af('0x5c')]);});if(!_[_0x97af('0x66')](_0x54569a)){return _[_0x97af('0x30')](_0x54569a,function(_0x30190e){return _0x30190e[_0x97af('0x5c')];});}else{return;}})['then'](function(_0x551146){if(_0x551146)_0x568493=_0x551146;if(_[_0x97af('0x65')](_0x568493,0x64)){var _0x1dcda9=_[_0x97af('0x50')](_0x54569a,{'sectionId':0x64});return hasDefaultDashboard(_0x1dcda9)[_0x97af('0x28')](function(_0x5dea3a){return _[_0x97af('0x30')](_0x54569a,function(_0x32deab){if(_0x32deab['sectionId']===0x64){_0x32deab[_0x97af('0x67')]=_0x5dea3a;}return _0x32deab;});});}else{return;}})[_0x97af('0x28')](function(_0x3f2e3a){if(_0x3f2e3a)_0x54569a=_0x3f2e3a;if(_[_0x97af('0x65')](_0x568493,0x3eb)){var _0x2eab04=_[_0x97af('0x50')](_0x54569a,{'sectionId':0x3eb});return getCustomDashboards(_0x2eab04)[_0x97af('0x28')](function(_0x31b54b){return _[_0x97af('0x30')](_0x54569a,function(_0xa55b79){if(_0x2eab04[_0x97af('0x68')]){if(_0xa55b79[_0x97af('0x5c')]===0x3eb){_0xa55b79['subsections']=_0x31b54b;}}else{if(_0xa55b79[_0x97af('0x5c')]===0x64){_0xa55b79[_0x97af('0x67')]=_0x31b54b;}}return _0xa55b79;});});}else{return;}})[_0x97af('0x28')](function(_0xee24fc){if(_0xee24fc)_0x54569a=_0xee24fc;if(_['includes'](_0x568493,0x709)){var _0x4904ac=_[_0x97af('0x50')](_0x54569a,{'sectionId':0x709});return getPlugins(_0x4904ac)[_0x97af('0x28')](function(_0x43dfee){if(_0x4904ac[_0x97af('0x68')]){return _[_0x97af('0x30')](_0x54569a,function(_0x12f88d){if(_0x12f88d[_0x97af('0x5c')]===0x709){_0x12f88d['subsections']=_0x43dfee;}return _0x12f88d;});}else{var _0xbc3d33={'sectionId':0x76c,'enabled':0x1,'subsections':_0x43dfee};var _0x1027b4=_[_0x97af('0x30')](_0x54569a);_0x1027b4[_0x97af('0x61')](_0xbc3d33);return _0x1027b4;}});}else{return;}})[_0x97af('0x28')](function(_0x337168){if(_0x337168)_0x54569a=_0x337168;return _[_0x97af('0x45')](_0x54569a,['enabled',0x1]);})['then'](respondWithResult(_0x2f1719,null))['catch'](handleError(_0x2f1719,null));};function hasDefaultDashboard(_0x466479){var _0x5aaa00=[0x65];return new BPromise(function(_0x4693f4,_0x30a715){try{if(_0x466479[_0x97af('0x5a')]){_0x4693f4(_0x5aaa00);}else{return db[_0x97af('0x5b')][_0x97af('0x69')]({'where':{'sectionId':_0x466479['id']},'raw':!![]})['then'](function(_0x57912c){_0x57912c?_0x4693f4(_0x5aaa00):_0x4693f4();});}}catch(_0x52ab6a){_0x30a715(_0x52ab6a);}});}function getCustomDashboards(_0x49a613){var _0x4f8937=[];return new BPromise(function(_0x5889d8,_0x297d08){try{if(_0x49a613[_0x97af('0x5a')]){return db['Dashboard'][_0x97af('0x4a')]({'raw':!![]})[_0x97af('0x28')](function(_0x24e880){_0x24e880[_0x97af('0x6a')](function(_0x2d785e){_0x4f8937[_0x97af('0x61')](_0x2d785e['id']+0x1869f);});_0x5889d8(_0x4f8937);});}else{return db['UserProfileResource'][_0x97af('0x4a')]({'where':{'sectionId':_0x49a613['id']},'raw':!![]})[_0x97af('0x28')](function(_0x8cfe2c){_0x8cfe2c[_0x97af('0x6a')](function(_0x182c24){_0x4f8937[_0x97af('0x61')](_0x182c24[_0x97af('0x6b')]+0x1869f);});_0x5889d8(_0x4f8937);});}}catch(_0x2cbb97){_0x297d08(_0x2cbb97);}});}function getPlugins(_0x2f692c){var _0x3973f7=[];return new BPromise(function(_0x2ed2f1,_0x1167dc){try{if(_0x2f692c[_0x97af('0x5a')]){return db[_0x97af('0x6c')][_0x97af('0x4a')]({'raw':!![]})[_0x97af('0x28')](function(_0x1fbdac){_0x1fbdac['forEach'](function(_0x240c30){_0x3973f7[_0x97af('0x61')](_0x240c30['id']+0x15b38);});_0x2ed2f1(_0x3973f7);});}else{return db['UserProfileResource'][_0x97af('0x4a')]({'where':{'sectionId':_0x2f692c['id']},'raw':!![]})[_0x97af('0x28')](function(_0x1552ff){_0x1552ff[_0x97af('0x6a')](function(_0x583a48){_0x3973f7[_0x97af('0x61')](_0x583a48[_0x97af('0x6b')]+0x15b38);});_0x2ed2f1(_0x3973f7);});}}catch(_0x5109a8){_0x1167dc(_0x5109a8);}});}exports[_0x97af('0x6d')]=function(_0x4964bd,_0x1ad765){return db['UserProfile'][_0x97af('0x50')]({'where':{'id':_0x4964bd[_0x97af('0x4e')]['id']}})[_0x97af('0x28')](handleEntityNotFound(_0x1ad765,null))['then'](function(_0xb3c9a7){if(_0xb3c9a7){return db['sequelize']['transaction'](function(_0x4af3dd){return db['UserProfileSection'][_0x97af('0x4a')]({'where':{'userProfileId':_0x4964bd[_0x97af('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0x97af('0x28')](function(_0x6a4b59){if(_0x6a4b59){return db[_0x97af('0x58')][_0x97af('0x29')]({'where':{'userProfileId':_0x4964bd[_0x97af('0x4e')]['id'],'id':_[_0x97af('0x30')](_0x6a4b59,function(_0x2e540f){return _0x2e540f['id'];})},'transaction':_0x4af3dd});}})[_0x97af('0x28')](function(_0x2d6b75){var _0x527807=_[_0x97af('0x30')](_0x4964bd[_0x97af('0x54')],function(_0xca2c20){_0xca2c20['userProfileId']=_0x4964bd[_0x97af('0x4e')]['id'];return _0xca2c20;});return db['UserProfileSection'][_0x97af('0x6e')](_0x527807,{'raw':!![],'transaction':_0x4af3dd});})[_0x97af('0x28')](function(_0x3228eb){var _0x33672b=_['filter'](_[_0x97af('0x30')](_0x3228eb,function(_0x3bf107){return _0x3bf107['get']({'plain':!![]});}),{'includeAll':![]});if(_0x33672b){return db[_0x97af('0x58')][_0x97af('0x4a')]({'where':{'userProfileId':_0x4964bd[_0x97af('0x4e')]['id'],'sectionId':_[_0x97af('0x30')](_0x33672b,function(_0x5f25d0){return _0x5f25d0[_0x97af('0x5c')];})},'attributes':['id',_0x97af('0x5c')],'raw':!![]})['then'](function(_0x3fd2f7){var _0x268f32=_[_0x97af('0x30')](_0x4964bd[_0x97af('0x54')],function(_0x37ad5e){_0x37ad5e[_0x97af('0x5d')]=_0x4964bd['params']['id'];return _0x37ad5e;});return db[_0x97af('0x5b')][_0x97af('0x6e')](_0x268f32,{'raw':!![],'transaction':_0x4af3dd});});}})[_0x97af('0x4c')](handleError(_0x1ad765,null));});}})[_0x97af('0x28')](function(_0x421d86){var _0x2d2023=_['map'](_0x421d86,function(_0x1f8374){return _0x1f8374[_0x97af('0x51')]({'plain':!![]});});})[_0x97af('0x28')](respondWithResult(_0x1ad765,null))['catch'](handleError(_0x1ad765,null));};exports['removeResources']=function(_0xfe58f4,_0x477989,_0x5c154c){return db[_0x97af('0x31')][_0x97af('0x50')]({'where':{'id':_0xfe58f4[_0x97af('0x4e')]['id']}})[_0x97af('0x28')](handleEntityNotFound(_0x477989,null))[_0x97af('0x28')](function(_0x3c312a){if(_0x3c312a){return _0x3c312a['removeResources'](_0xfe58f4[_0x97af('0x38')]['ids']);}})[_0x97af('0x28')](respondWithStatusCode(_0x477989,null))[_0x97af('0x4c')](handleError(_0x477989,null));};exports[_0x97af('0x6f')]=function(_0x52c19c,_0x501217){var _0x10836b={};if(!_0x52c19c[_0x97af('0x38')][_0x97af('0x70')])throw new Error(_0x97af('0x71'));if(!_0x52c19c[_0x97af('0x38')][_0x97af('0x3d')](_0x97af('0x3e'))){_0x10836b[_0x97af('0x3f')]=qs['limit'](_0x52c19c['query'][_0x97af('0x3f')]);_0x10836b[_0x97af('0x21')]=qs[_0x97af('0x21')](_0x52c19c['query'][_0x97af('0x21')]);}return db[_0x97af('0x31')][_0x97af('0x50')]({'where':{'id':_0x52c19c[_0x97af('0x4e')]['id']}})[_0x97af('0x28')](function(_0x152566){if(!_0x152566)throw new Error(_0x97af('0x72')+_0x52c19c[_0x97af('0x4e')]['id']);return db[_0x97af('0x31')][_0x97af('0x6f')](_0x52c19c);})[_0x97af('0x28')](respondWithFilteredResult(_0x501217,_0x10836b))[_0x97af('0x4c')](handleError(_0x501217,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 200a2dd..039aa0a 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 _0xcaf2=['hook','exports','events','UserProfile','setMaxListeners','update','remove','emit'];(function(_0x1fdc80,_0x55985a){var _0x500035=function(_0x15f255){while(--_0x15f255){_0x1fdc80['push'](_0x1fdc80['shift']());}};_0x500035(++_0x55985a);}(_0xcaf2,0x8a));var _0x2caf=function(_0xfe4a8d,_0x33d75d){_0xfe4a8d=_0xfe4a8d-0x0;var _0x1bf633=_0xcaf2[_0xfe4a8d];return _0x1bf633;};'use strict';var EventEmitter=require(_0x2caf('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x2caf('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2caf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2caf('0x3'),'afterDestroy':_0x2caf('0x4')};function emitEvent(_0x5b4a90){return function(_0xb4fae,_0x4d046b,_0x335e3c){UserProfileEvents[_0x2caf('0x5')](_0x5b4a90+':'+_0xb4fae['id'],_0xb4fae);UserProfileEvents[_0x2caf('0x5')](_0x5b4a90,_0xb4fae);_0x335e3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x2caf('0x6')](e,emitEvent(event));}}module[_0x2caf('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xac6a=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x1b1604,_0x368535){var _0x57918d=function(_0x176c51){while(--_0x176c51){_0x1b1604['push'](_0x1b1604['shift']());}};_0x57918d(++_0x368535);}(_0xac6a,0xc2));var _0xaac6=function(_0x522ddf,_0x35ba7b){_0x522ddf=_0x522ddf-0x0;var _0x42f494=_0xac6a[_0x522ddf];return _0x42f494;};'use strict';var EventEmitter=require(_0xaac6('0x0'));var UserProfile=require(_0xaac6('0x1'))['db'][_0xaac6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xaac6('0x3')](0x0);var events={'afterCreate':_0xaac6('0x4'),'afterUpdate':'update','afterDestroy':_0xaac6('0x5')};function emitEvent(_0x4c0cf4){return function(_0x9dc043,_0x1a0d76,_0x44259b){UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4+':'+_0x9dc043['id'],_0x9dc043);UserProfileEvents[_0xaac6('0x6')](_0x4c0cf4,_0x9dc043);_0x44259b(null);};}for(var e in events){if(events[_0xaac6('0x7')](e)){var event=events[e];UserProfile[_0xaac6('0x8')](e,emitEvent(event));}}module[_0xaac6('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 4cd9220..7e58e72 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 _0x12e2=['VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','Tag','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','rawAttributes','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filters','merge','key','VIRTUAL','foreignKey','options','autoAssociation','includeAll','include','forEach','default','DefaultReports','count','rows','ids','customSorting','extraQueryConditions','Tags','ThroughTags','color','tag','openTabs','true','sms','dataValues','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','value','findAll','associatedResources','catch','field','model','then','map','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','parentSections','name','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes'];(function(_0x33a2bf,_0xcc5085){var _0x3612c1=function(_0x35f9dd){while(--_0x35f9dd){_0x33a2bf['push'](_0x33a2bf['shift']());}};_0x3612c1(++_0xcc5085);}(_0x12e2,0x9e));var _0x212e=function(_0x19bebd,_0xbdb9eb){_0x19bebd=_0x19bebd-0x0;var _0x243436=_0x12e2[_0x19bebd];return _0x243436;};'use strict';var _=require(_0x212e('0x0'));var attributes=require(_0x212e('0x1'));var qs=require(_0x212e('0x2'));var squel=require(_0x212e('0x3'));module[_0x212e('0x4')]=function(_0x3664d5){var _0x3af1a8=_0x3664d5['models'];function _0x1ac95a(_0x5588c2,_0x2fb828){return new Promise(function(_0x1af8ca,_0x5934aa){if(!_0x2fb828)return _0x1af8ca(null);var _0x346250=_0x2fb828[_0x212e('0x5')]?{[_0x2fb828[_0x212e('0x5')]['field']]:_0x2fb828[_0x212e('0x5')][_0x212e('0x6')]}:undefined;return _0x3af1a8[_0x5588c2][_0x212e('0x7')]({'where':_0x346250,'raw':!![]})['then'](function(_0x4fdc14){_0x2fb828[_0x212e('0x8')]=_['map'](_0x4fdc14,'id');_0x1af8ca(_0x2fb828);})[_0x212e('0x9')](function(_0x39a0f0){_0x5934aa(_0x39a0f0);});});}function _0x17aea0(_0x535cc7,_0x2e412e){return new Promise(function(_0x574208,_0x876626){var _0x17a659=_0x535cc7[_0x212e('0x5')]?{[_0x535cc7[_0x212e('0x5')][_0x212e('0xa')]]:_0x535cc7[_0x212e('0x5')]['value']}:undefined;return _0x3af1a8[_0x535cc7[_0x212e('0xb')]][_0x212e('0x7')]({'where':_0x17a659,'raw':!![]})[_0x212e('0xc')](function(_0x459324){_0x2e412e['associatedResources']=_[_0x212e('0xd')](_0x459324,function(_0x4e3727){return _0x4e3727['name'];});_0x574208(_0x2e412e);})['catch'](function(_0x7216ff){_0x876626(_0x7216ff);});});}function _0x16dea6(_0x37e093,_0x34d2ef,_0x2cb9dc){if(!_0x34d2ef)return Promise[_0x212e('0xe')](null);return new Promise(function(_0x65889a,_0x248cbc){return _0x3af1a8[_0x212e('0xf')][_0x212e('0x7')]({'where':{'sectionId':_0x34d2ef['id']},'raw':!![]})[_0x212e('0xc')](function(_0x4d2c97){if(_0x37e093[_0x212e('0xa')]&&_0x37e093['field']!=='id'){_0x34d2ef[_0x212e('0x8')]=_['map'](_0x4d2c97,function(_0x5c9aea){return _0x5c9aea[_0x37e093[_0x212e('0xa')]];});}else{if(_0x2cb9dc===_0x212e('0x10')){_0x34d2ef[_0x212e('0x8')]=_['map'](_0x4d2c97,function(_0x4a435b){return{'id':_0x4a435b[_0x212e('0x11')],'type':_0x4a435b[_0x212e('0x12')]};});}else{_0x34d2ef[_0x212e('0x8')]=_['map'](_0x4d2c97,function(_0x810fed){return _0x810fed[_0x212e('0x11')];});}}_0x65889a(_0x34d2ef);})['catch'](function(_0x19ab31){_0x248cbc(_0x19ab31);});});}function _0x39e609(_0x1e7d4d,_0x22802a){var _0x27a09b={'parentSections':[]};switch(_0x1e7d4d['toLowerCase']()){case _0x212e('0x13'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x15');break;case _0x212e('0x16'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x17');break;case'squarerecordings':_0x27a09b['childModel']='SquareRecording';_0x27a09b[_0x212e('0x18')]=[{'name':'SquareProjects','field':_0x212e('0x19'),'foreignKey':_0x212e('0x1a')}];break;case _0x212e('0x1b'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x1c');break;case _0x212e('0x1d'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x1e');_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x212e('0x20'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x21');break;case _0x212e('0x22'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x23');break;case _0x212e('0x24'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x25');break;case'chatqueues':_0x27a09b[_0x212e('0x14')]=_0x212e('0x26');break;case _0x212e('0x27'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x28');break;case _0x212e('0x29'):_0x27a09b[_0x212e('0x14')]='FaxQueue';break;case _0x212e('0x2a'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x2b');break;case _0x212e('0x2c'):case _0x212e('0x2d'):case'outboundroutes':_0x27a09b[_0x212e('0x14')]=_0x212e('0x2e');break;case'contexts':_0x27a09b[_0x212e('0x14')]=_0x212e('0x2f');break;case _0x212e('0x30'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x31');break;case _0x212e('0x32'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x33');_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x34'),'field':_0x212e('0x19'),'foreignKey':_0x212e('0x35'),'model':_0x212e('0x36'),'filter':{'field':_0x212e('0x37'),'value':[_0x212e('0x38')]}},{'name':'Telephones','field':_0x212e('0x19'),'foreignKey':_0x212e('0x35'),'model':_0x212e('0x36'),'filter':{'field':'role','value':[_0x212e('0x39')]}},{'name':_0x212e('0x3a'),'field':'name','foreignKey':'queue','model':_0x212e('0x3b'),'filter':{'field':_0x212e('0x12'),'value':[_0x212e('0x3c')]}},{'name':_0x212e('0x3d'),'field':_0x212e('0x19'),'foreignKey':_0x212e('0x3e'),'model':_0x212e('0x3b'),'filter':{'field':_0x212e('0x12'),'value':[_0x212e('0x3f')]}}];break;case _0x212e('0x40'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x41');break;case _0x212e('0x42'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x43');break;case _0x212e('0x44'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x45');break;case _0x212e('0x46'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x47');break;case _0x212e('0x48'):_0x27a09b[_0x212e('0x14')]='MailQueue';break;case _0x212e('0x49'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x4a');break;case _0x212e('0x4b'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x4c');break;case _0x212e('0x4d'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x4e');break;case'openchannelaccounts':_0x27a09b[_0x212e('0x14')]=_0x212e('0x4f');break;case _0x212e('0x50'):_0x27a09b['childModel']=_0x212e('0x51');break;case _0x212e('0x52'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x53');break;case _0x212e('0x54'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x55');break;case'whatsappaccounts':_0x27a09b[_0x212e('0x14')]=_0x212e('0x56');break;case'teams':_0x27a09b[_0x212e('0x14')]=_0x212e('0x57');break;case _0x212e('0x58'):case _0x212e('0x59'):_0x27a09b['childModel']=_0x212e('0x3b');if(_0x22802a){_0x27a09b['parentSections']=[{'name':_0x212e('0x3a')},{'name':_0x212e('0x3d')}];}break;case _0x212e('0x5a'):case _0x212e('0x5b'):case _0x212e('0x5c'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x36');if(_0x22802a){_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x5d'),'filter':{'field':_0x212e('0x37'),'value':[_0x212e('0x5e'),_0x212e('0x5f')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x212e('0x60'):_0x27a09b['childModel']=_0x212e('0x61');break;case _0x212e('0x62'):_0x27a09b['childModel']=_0x212e('0x63');break;case _0x212e('0x64'):_0x27a09b['childModel']=_0x212e('0x65');break;case _0x212e('0x66'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x67');break;case _0x212e('0x68'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x69');break;case _0x212e('0x6a'):_0x27a09b['childModel']=_0x212e('0x6b');break;case _0x212e('0x6c'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x36');break;case'cannedanswers':_0x27a09b[_0x212e('0x14')]=_0x212e('0x6d');break;case _0x212e('0x6e'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x6f');break;case _0x212e('0x70'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x71');break;case _0x212e('0x72'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x73');break;case'pauses':_0x27a09b[_0x212e('0x14')]=_0x212e('0x74');break;case _0x212e('0x75'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x76');break;case _0x212e('0x77'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x78');break;case'tags':_0x27a09b['childModel']=_0x212e('0x79');break;case'templates':_0x27a09b['childModel']='Template';break;case _0x212e('0x7a'):_0x27a09b[_0x212e('0x14')]='Trigger';break;case _0x212e('0x7b'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x7c');break;case _0x212e('0x7d'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x7e');break;case _0x212e('0x7f'):_0x27a09b['childModel']=_0x212e('0x80');break;case _0x212e('0x81'):_0x27a09b[_0x212e('0x14')]=_0x212e('0x10');_0x27a09b[_0x212e('0x18')]=[{'name':_0x212e('0x82'),'field':'id','foreignKey':_0x212e('0x83')}];break;case _0x212e('0x84'):_0x27a09b['childModel']=_0x212e('0x85');break;}return _0x27a09b;}function _0x367888(_0x141676,_0x5ddae0){var _0x184398=_0x141676[_0x212e('0x86')](0x0)[_0x212e('0x87')]()+_0x141676['slice'](0x1);var _0x24ce45={'type':_0x3af1a8[_0x212e('0x88')][_0x212e('0x89')][_0x212e('0x8a')],'raw':!![]};return new Promise(function(_0x237020,_0x382670){var _0x77601e=squel[_0x212e('0x8b')]()[_0x212e('0xa')](_0x212e('0x8c')+_0x184398+_0x212e('0x8d'),'id')[_0x212e('0xa')]('ui.createdAt')[_0x212e('0x8e')](_0x212e('0x8f')+_0x141676+_0x212e('0x90'),'ui')[_0x212e('0x91')](_0x212e('0x92'),_0x5ddae0['id']);return _0x3af1a8[_0x212e('0x93')][_0x212e('0x94')](_0x77601e[_0x212e('0x95')](),_0x24ce45)[_0x212e('0xc')](function(_0x4fd4f8){_0x5ddae0[_0x184398+_0x212e('0x96')]=_0x4fd4f8;_0x237020(_0x4fd4f8);})[_0x212e('0x9')](function(_0x47e053){_0x382670(_0x47e053);});});}return _0x3664d5[_0x212e('0x97')]('UserProfile',attributes,{'tableName':_0x212e('0x98'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x470df7){var _0x5820a9={'raw':_0x470df7[_0x212e('0x94')][_0x212e('0x99')],'where':{}};var _0x35408e={};var _0x261e76={'count':0x0,'rows':[]};var _0x189896=_0x470df7[_0x212e('0x94')][_0x212e('0x9a')];var _0x138f2b=_0x470df7['query'][_0x212e('0x9b')]||![];var _0xe86f0f=_0x39e609(_0x189896,_0x138f2b);if(!_0xe86f0f['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x189896+'\x27');var _0x512e96=[{'name':_0x189896}];if(!_[_0x212e('0x9c')](_0xe86f0f['parentSections']))_0x512e96=_0xe86f0f[_0x212e('0x18')];var _0x39fabb=[];for(var _0x58014e=0x0;_0x58014e<_0x512e96['length'];_0x58014e++){_0x39fabb[_0x212e('0x9d')](_0x3af1a8[_0x212e('0x9e')][_0x212e('0x9f')]({'where':{'userProfileId':_0x470df7[_0x212e('0xa0')]['id'],'name':_0x512e96[_0x58014e][_0x212e('0x19')]},'raw':!![]}));}return Promise[_0x212e('0xa1')](_0x39fabb)[_0x212e('0xc')](function(_0x4c2635){var _0xb47cd0=_['filter'](_0x4c2635,function(_0x4a9d78){return _0x4a9d78?_0x4a9d78:undefined;});var _0x22c921=_[_0x212e('0x5')](_0x512e96,[_0x212e('0xa2'),!![]]);var _0x479a13=_[_0x212e('0x9c')](_0xb47cd0)&&_['isEmpty'](_0x22c921)?null:_[_0x212e('0xa3')](_0x22c921,_0xb47cd0);if(!_0x479a13)return null;var _0xa8cd08=[];for(var _0x372164=0x0;_0x372164<_0x479a13[_0x212e('0xa4')];_0x372164++){var _0x41d3fb=_[_0x212e('0x9f')](_0x512e96,function(_0x5f15ef){return _0x479a13[_0x372164]?_0x5f15ef[_0x212e('0x19')]===_0x479a13[_0x372164][_0x212e('0x19')]:null;});if(_0x41d3fb){if(_0x479a13[_0x372164]['ignore']){_0xa8cd08[_0x212e('0x9d')](_0x1ac95a(_0xe86f0f['childModel'],_0x479a13[_0x372164]));}else{if(!_0x479a13[_0x372164]['autoAssociation']){_0xa8cd08[_0x212e('0x9d')](_0x16dea6(_0x41d3fb,_0x479a13[_0x372164],_0xe86f0f[_0x212e('0x14')]));}else{if(_0x41d3fb[_0x212e('0xb')]){_0xa8cd08[_0x212e('0x9d')](_0x17aea0(_0x41d3fb,_0x479a13[_0x372164]));}}}}}return Promise['all'](_0xa8cd08);})['then'](function(_0x1c0f26){var _0x580914=_0x1c0f26;var _0x2a55cf=null;if(_0x580914){_0x2a55cf=_0x580914[_0x212e('0xa4')]===0x1?_0x580914[0x0]:null;}if(!_0x2a55cf&&!_0x580914)return _0x261e76;var _0x420b1b=_0x3af1a8[_0xe86f0f['childModel']][_0x212e('0xa5')];_0x35408e['model']=_['keys'](_0x420b1b);_0x35408e[_0x212e('0x94')]=_['keys'](_0x470df7[_0x212e('0x94')]);_0x35408e['filters']=_[_0x212e('0xa6')](_0x35408e['model'],_0x35408e[_0x212e('0x94')]);_0x5820a9[_0x212e('0xa7')]=_['intersection'](_0x35408e[_0x212e('0xb')],qs[_0x212e('0xa8')](_0x470df7[_0x212e('0x94')][_0x212e('0xa8')]));_0x5820a9['attributes']=_0x5820a9[_0x212e('0xa7')][_0x212e('0xa4')]?_0x5820a9['attributes']:_0x35408e[_0x212e('0xb')];if(!_0x470df7[_0x212e('0x94')][_0x212e('0xa9')](_0x212e('0xaa'))){_0x5820a9['limit']=qs['limit'](_0x470df7[_0x212e('0x94')][_0x212e('0xab')]);_0x5820a9[_0x212e('0xac')]=qs[_0x212e('0xac')](_0x470df7[_0x212e('0x94')][_0x212e('0xac')]);}_0x5820a9[_0x212e('0xad')]=qs[_0x212e('0xae')](_0x470df7[_0x212e('0x94')][_0x212e('0xae')]);_0x5820a9[_0x212e('0x91')]=qs['filters'](_[_0x212e('0xaf')](_0x470df7['query'],_0x35408e[_0x212e('0xb0')]));if(_0x470df7[_0x212e('0x94')][_0x212e('0x5')]){_0x5820a9[_0x212e('0x91')]=_[_0x212e('0xb1')](_0x5820a9[_0x212e('0x91')],{'$or':_[_0x212e('0xd')](_0x420b1b,function(_0x281afa){if(_0x281afa[_0x212e('0x12')][_0x212e('0xb2')]!==_0x212e('0xb3')){var _0x503509={};_0x503509[_0x281afa[_0x212e('0xa')]]={'$like':'%'+_0x470df7[_0x212e('0x94')][_0x212e('0x5')]+'%'};return _0x503509;}})});}var _0x4306fe=[];var _0x1a9537=null;var _0x84c32f={};if(_0x2a55cf){_0x1a9537=_[_0x212e('0x9f')](_0x512e96,[_0x212e('0x19'),_0x2a55cf[_0x212e('0x19')]]);if(_0x1a9537['field']){_0x84c32f={};if(_0xe86f0f['childModel']===_0x212e('0x10')){_0x84c32f[_0x1a9537['foreignKey']]=_['map'](_0x2a55cf[_0x212e('0x8')],'id');}else{_0x84c32f[_0x1a9537['foreignKey']]=_0x2a55cf[_0x212e('0x8')];}_0x4306fe[_0x212e('0x9d')](_0x84c32f);}else{_0x5820a9[_0x212e('0x91')]['id']=_0x2a55cf[_0x212e('0x8')];}}else{for(var _0x6e4104=0x0;_0x6e4104<_0x580914[_0x212e('0xa4')];_0x6e4104++){_0x1a9537=_[_0x212e('0x9f')](_0x512e96,[_0x212e('0x19'),_0x580914[_0x6e4104][_0x212e('0x19')]]);if(_0x1a9537[_0x212e('0xa')]){_0x84c32f={};_0x84c32f[_0x1a9537[_0x212e('0xb4')]]=_0x580914[_0x6e4104][_0x212e('0x8')];_0x4306fe['push'](_0x84c32f);}else{if(!_0x5820a9[_0x212e('0x91')]['id'])_0x5820a9['where']['id']=[];_0x580914[_0x6e4104][_0x212e('0x8')]['forEach'](function(_0x5542e2){_0x5820a9[_0x212e('0x91')]['id'][_0x212e('0x9d')](_0x5542e2);});}}}if(!_[_0x212e('0x9c')](_0x4306fe)){_0x5820a9[_0x212e('0x91')]=_[_0x212e('0xb1')](_0x5820a9[_0x212e('0x91')],{'$and':{'$or':_0x4306fe}});}_0x5820a9=_[_0x212e('0xb1')]({},_0x5820a9,_0x470df7[_0x212e('0xb5')]);if(_0x2a55cf&&!_0x2a55cf[_0x212e('0xb6')]&&_0xe86f0f[_0x212e('0x14')]===_0x212e('0x10')){if(_0x470df7[_0x212e('0x94')][_0x212e('0xb7')]){_0x5820a9[_0x212e('0xb8')]=[{'all':!![]}];}return _0x3af1a8[_0xe86f0f[_0x212e('0x14')]][_0x212e('0x7')](_0x5820a9)[_0x212e('0xc')](function(_0x1c94e1){var _0x4cfb5d=[];_0x1c94e1[_0x212e('0xb9')](function(_0x4be27d){var _0x5b00a0;switch(_0x4be27d['reportType']){case _0x212e('0xba'):_0x5b00a0=_[_0x212e('0x9f')](_0x2a55cf[_0x212e('0x8')],function(_0x3b23e3){return _0x3b23e3['id']===_0x4be27d['reportId']&&_0x3b23e3[_0x212e('0x12')]===_0x212e('0xbb');});break;case'custom':_0x5b00a0=_[_0x212e('0x9f')](_0x2a55cf[_0x212e('0x8')],function(_0x3a01b8){return _0x3a01b8['id']===_0x4be27d[_0x212e('0x83')]&&_0x3a01b8[_0x212e('0x12')]==='CustomReports';});break;}if(_0x5b00a0)_0x4cfb5d[_0x212e('0x9d')](_0x4be27d);});_0x261e76[_0x212e('0xbc')]=_0x4cfb5d[_0x212e('0xa4')];_0x261e76[_0x212e('0xbd')]=_0x4cfb5d;return _0x261e76;});}else{if(!_['isEmpty'](_0x470df7[_0x212e('0x94')][_0x212e('0xbe')])){_0x5820a9[_0x212e('0x91')]['id']=_0x5820a9[_0x212e('0x91')]['id']?_[_0x212e('0xa6')](_0x5820a9[_0x212e('0x91')]['id'],_0x470df7[_0x212e('0x94')][_0x212e('0xbe')]):_0x470df7[_0x212e('0x94')][_0x212e('0xbe')];if(_0x470df7['query'][_0x212e('0xbf')]){_0x5820a9[_0x212e('0xad')]=_0x470df7[_0x212e('0x94')]['customSorting'];}}if(_0x470df7['query']['extraQueryConditions']){_0x5820a9['where']=_[_0x212e('0xb1')](_0x5820a9[_0x212e('0x91')],{'$and':_0x470df7[_0x212e('0x94')][_0x212e('0xc0')]});}return _0x3af1a8[_0xe86f0f[_0x212e('0x14')]][_0x212e('0xbc')]({'where':_0x5820a9['where']})[_0x212e('0xc')](function(_0x5a9e00){_0x261e76[_0x212e('0xbc')]=_0x5a9e00;if(_0x470df7[_0x212e('0x94')][_0x212e('0xb7')]){if(_0xe86f0f[_0x212e('0x14')]==='CmContact'){_0x5820a9[_0x212e('0xb8')]=[{'model':_0x3af1a8[_0x212e('0x79')],'as':_0x212e('0xc1'),'attributes':['id',_0x212e('0x19'),'color'],'required':_0x470df7[_0x212e('0x94')]['tag']?!![]:![]},{'model':_0x3af1a8[_0x212e('0x79')],'as':_0x212e('0xc2'),'attributes':['id',_0x212e('0x19'),_0x212e('0xc3')],'through':_0x470df7['query']['tag']?{'attributes':[],'where':{'TagId':_0x470df7[_0x212e('0x94')][_0x212e('0xc4')]||undefined}}:{},'required':_0x470df7['query'][_0x212e('0xc4')]?!![]:![]}];}else{_0x5820a9[_0x212e('0xb8')]=[{'all':!![]}];}}return _0x3af1a8[_0xe86f0f[_0x212e('0x14')]][_0x212e('0x7')](_0x5820a9);})[_0x212e('0xc')](function(_0x17c8fa){_0x261e76[_0x212e('0xbd')]=_0x17c8fa;if(_0x189896===_0x212e('0x34')&&_0x470df7[_0x212e('0x94')][_0x212e('0xc5')]===_0x212e('0xc6')){var _0x1b4024=[];for(var _0xbe73d=0x0;_0xbe73d<_0x261e76[_0x212e('0xbd')][_0x212e('0xa4')];_0xbe73d++){_0x1b4024[_0x212e('0x9d')](_0x367888('chat',_0x261e76[_0x212e('0xbd')][_0xbe73d]['dataValues']));_0x1b4024[_0x212e('0x9d')](_0x367888(_0x212e('0xc7'),_0x261e76[_0x212e('0xbd')][_0xbe73d]['dataValues']));_0x1b4024['push'](_0x367888('fax',_0x261e76[_0x212e('0xbd')][_0xbe73d][_0x212e('0xc8')]));_0x1b4024['push'](_0x367888(_0x212e('0xc9'),_0x261e76[_0x212e('0xbd')][_0xbe73d][_0x212e('0xc8')]));_0x1b4024[_0x212e('0x9d')](_0x367888(_0x212e('0xca'),_0x261e76[_0x212e('0xbd')][_0xbe73d]['dataValues']));_0x1b4024['push'](_0x367888(_0x212e('0xcb'),_0x261e76[_0x212e('0xbd')][_0xbe73d][_0x212e('0xc8')]));}return Promise[_0x212e('0xa1')](_0x1b4024)[_0x212e('0xc')](function(){return _0x261e76;});}return _0x261e76;});}});}}});}; \ No newline at end of file +var _0x2ba0=['query','toString','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','model','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','DefaultReports','custom','reportId','CustomReports','rows','ids','customSorting','extraQueryConditions','count','Tags','color','tag','openTabs','true','chat','dataValues','fax','mail','lodash','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','catch','name','resolve','AnalyticExtractedReport','map','resourceId','toLowerCase','squareprojects','SquareProject','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','Telephones','telephone','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','Campaign','MailQueue','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','Team','voicequeues','users','agents','telephones','admin','Agents','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','variables','Variable','Plugin','Reports','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2ba0,0xf2));var _0x02ba=function(_0x2b07c8,_0x24976a){_0x2b07c8=_0x2b07c8-0x0;var _0x113398=_0x2ba0[_0x2b07c8];return _0x113398;};'use strict';var _=require(_0x02ba('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x02ba('0x1'));var squel=require(_0x02ba('0x2'));module['exports']=function(_0x2aaeab){var _0x215b37=_0x2aaeab[_0x02ba('0x3')];function _0x12db04(_0x51f116,_0x2b5eb7){return new Promise(function(_0x34f041,_0x68ab85){if(!_0x2b5eb7)return _0x34f041(null);var _0x570dd7=_0x2b5eb7[_0x02ba('0x4')]?{[_0x2b5eb7[_0x02ba('0x4')][_0x02ba('0x5')]]:_0x2b5eb7['filter'][_0x02ba('0x6')]}:undefined;return _0x215b37[_0x51f116][_0x02ba('0x7')]({'where':_0x570dd7,'raw':!![]})[_0x02ba('0x8')](function(_0x5436d6){_0x2b5eb7[_0x02ba('0x9')]=_['map'](_0x5436d6,'id');_0x34f041(_0x2b5eb7);})[_0x02ba('0xa')](function(_0x35902f){_0x68ab85(_0x35902f);});});}function _0x28d6e2(_0x5ddf40,_0x21a128){return new Promise(function(_0x5c3260,_0x3b624){var _0x52f729=_0x5ddf40['filter']?{[_0x5ddf40[_0x02ba('0x4')][_0x02ba('0x5')]]:_0x5ddf40[_0x02ba('0x4')][_0x02ba('0x6')]}:undefined;return _0x215b37[_0x5ddf40['model']][_0x02ba('0x7')]({'where':_0x52f729,'raw':!![]})[_0x02ba('0x8')](function(_0xd7b701){_0x21a128[_0x02ba('0x9')]=_['map'](_0xd7b701,function(_0x95575d){return _0x95575d[_0x02ba('0xb')];});_0x5c3260(_0x21a128);})[_0x02ba('0xa')](function(_0x1681eb){_0x3b624(_0x1681eb);});});}function _0x20ce1c(_0x1e7927,_0x995af6,_0x4bd45d){if(!_0x995af6)return Promise[_0x02ba('0xc')](null);return new Promise(function(_0xfc30d3,_0x5b722f){return _0x215b37['UserProfileResource']['findAll']({'where':{'sectionId':_0x995af6['id']},'raw':!![]})[_0x02ba('0x8')](function(_0x379790){if(_0x1e7927[_0x02ba('0x5')]&&_0x1e7927['field']!=='id'){_0x995af6[_0x02ba('0x9')]=_['map'](_0x379790,function(_0x15e3b9){return _0x15e3b9[_0x1e7927[_0x02ba('0x5')]];});}else{if(_0x4bd45d===_0x02ba('0xd')){_0x995af6['associatedResources']=_[_0x02ba('0xe')](_0x379790,function(_0x3d7438){return{'id':_0x3d7438['resourceId'],'type':_0x3d7438['type']};});}else{_0x995af6[_0x02ba('0x9')]=_[_0x02ba('0xe')](_0x379790,function(_0x361602){return _0x361602[_0x02ba('0xf')];});}}_0xfc30d3(_0x995af6);})['catch'](function(_0x1e56d1){_0x5b722f(_0x1e56d1);});});}function _0x53d378(_0xc88c82,_0x1f0687){var _0x49e79b={'parentSections':[]};switch(_0xc88c82[_0x02ba('0x10')]()){case _0x02ba('0x11'):_0x49e79b['childModel']=_0x02ba('0x12');break;case'odbc':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x14');break;case _0x02ba('0x15'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x16');_0x49e79b[_0x02ba('0x17')]=[{'name':_0x02ba('0x18'),'field':'name','foreignKey':'projectName'}];break;case _0x02ba('0x19'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x1a');break;case'contacts':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x1b');_0x49e79b[_0x02ba('0x17')]=[{'name':_0x02ba('0x1c'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x1d');break;case'companies':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x1e');break;case _0x02ba('0x1f'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x20');break;case _0x02ba('0x21'):_0x49e79b['childModel']=_0x02ba('0x22');break;case _0x02ba('0x23'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x24');break;case'faxqueues':_0x49e79b['childModel']='FaxQueue';break;case _0x02ba('0x25'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x26');break;case _0x02ba('0x27'):case _0x02ba('0x28'):case'outboundroutes':_0x49e79b['childModel']=_0x02ba('0x29');break;case _0x02ba('0x2a'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x2b');break;case _0x02ba('0x2c'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x2d');break;case _0x02ba('0x2e'):_0x49e79b['childModel']=_0x02ba('0x2f');_0x49e79b[_0x02ba('0x17')]=[{'name':'Agents','field':_0x02ba('0xb'),'foreignKey':_0x02ba('0x30'),'model':_0x02ba('0x31'),'filter':{'field':_0x02ba('0x32'),'value':['agent']}},{'name':_0x02ba('0x33'),'field':_0x02ba('0xb'),'foreignKey':_0x02ba('0x30'),'model':'User','filter':{'field':'role','value':[_0x02ba('0x34')]}},{'name':_0x02ba('0x35'),'field':_0x02ba('0xb'),'foreignKey':'queue','model':_0x02ba('0x36'),'filter':{'field':_0x02ba('0x37'),'value':[_0x02ba('0x38')]}},{'name':_0x02ba('0x39'),'field':_0x02ba('0xb'),'foreignKey':_0x02ba('0x3a'),'model':'VoiceQueue','filter':{'field':_0x02ba('0x37'),'value':[_0x02ba('0x3b')]}}];break;case _0x02ba('0x3c'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x3d');break;case _0x02ba('0x3e'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x3f');break;case _0x02ba('0x40'):_0x49e79b['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x41');break;case'mailqueues':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x42');break;case'mailaccounts':_0x49e79b[_0x02ba('0x13')]='MailAccount';break;case'mailsubstatuses':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x43');break;case _0x02ba('0x44'):_0x49e79b['childModel']='OpenchannelQueue';break;case'openchannelaccounts':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x45');break;case _0x02ba('0x46'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x47');break;case _0x02ba('0x48'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x49');break;case'whatsappqueues':_0x49e79b[_0x02ba('0x13')]='WhatsappQueue';break;case _0x02ba('0x4a'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x4b');break;case'teams':_0x49e79b['childModel']=_0x02ba('0x4c');break;case _0x02ba('0x4d'):case'queuecampaigns':_0x49e79b['childModel']=_0x02ba('0x36');if(_0x1f0687){_0x49e79b[_0x02ba('0x17')]=[{'name':_0x02ba('0x35')},{'name':_0x02ba('0x39')}];}break;case _0x02ba('0x4e'):case _0x02ba('0x4f'):case _0x02ba('0x50'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x31');if(_0x1f0687){_0x49e79b[_0x02ba('0x17')]=[{'name':'Users','filter':{'field':_0x02ba('0x32'),'value':[_0x02ba('0x51'),'user']},'ignore':!![]},{'name':_0x02ba('0x52')},{'name':_0x02ba('0x33')}];}break;case _0x02ba('0x53'):_0x49e79b[_0x02ba('0x13')]='ZendeskAccount';break;case'salesforceaccounts':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x54');break;case _0x02ba('0x55'):_0x49e79b['childModel']=_0x02ba('0x56');break;case'sugarcrmaccounts':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x57');break;case'deskaccounts':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x58');break;case _0x02ba('0x59'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x5a');break;case _0x02ba('0x5b'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x31');break;case _0x02ba('0x5c'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x5d');break;case _0x02ba('0x5e'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x5f');break;case'customdashboards':_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x60');break;case _0x02ba('0x61'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x62');break;case _0x02ba('0x63'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x64');break;case _0x02ba('0x65'):_0x49e79b['childModel']=_0x02ba('0x66');break;case _0x02ba('0x67'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x68');break;case _0x02ba('0x69'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x6a');break;case _0x02ba('0x6b'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x6c');break;case _0x02ba('0x6d'):_0x49e79b[_0x02ba('0x13')]=_0x02ba('0x6e');break;case'trunks':_0x49e79b[_0x02ba('0x13')]='Trunk';break;case _0x02ba('0x6f'):_0x49e79b['childModel']=_0x02ba('0x70');break;case'plugins':_0x49e79b['childModel']=_0x02ba('0x71');break;case'extractedreports':_0x49e79b['childModel']='AnalyticExtractedReport';_0x49e79b['parentSections']=[{'name':_0x02ba('0x72'),'field':'id','foreignKey':'reportId'}];break;case _0x02ba('0x73'):_0x49e79b['childModel']=_0x02ba('0x74');break;}return _0x49e79b;}function _0x573e83(_0x4586f7,_0xc78fcd){var _0x3bc2cc=_0x4586f7[_0x02ba('0x75')](0x0)[_0x02ba('0x76')]()+_0x4586f7['slice'](0x1);var _0x4b3a19={'type':_0x215b37[_0x02ba('0x77')][_0x02ba('0x78')][_0x02ba('0x79')],'raw':!![]};return new Promise(function(_0x598400,_0x392e01){var _0x26b670=squel['select']()[_0x02ba('0x5')](_0x02ba('0x7a')+_0x3bc2cc+'InteractionId','id')['field'](_0x02ba('0x7b'))[_0x02ba('0x7c')](_0x02ba('0x7d')+_0x4586f7+_0x02ba('0x7e'),'ui')[_0x02ba('0x7f')](_0x02ba('0x80'),_0xc78fcd['id']);return _0x215b37[_0x02ba('0x81')][_0x02ba('0x82')](_0x26b670[_0x02ba('0x83')](),_0x4b3a19)[_0x02ba('0x8')](function(_0x128caf){_0xc78fcd[_0x3bc2cc+'OpenTabs']=_0x128caf;_0x598400(_0x128caf);})['catch'](function(_0x142635){_0x392e01(_0x142635);});});}return _0x2aaeab[_0x02ba('0x84')](_0x02ba('0x85'),attributes,{'tableName':_0x02ba('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x330ff7){var _0x2ea78f={'raw':_0x330ff7[_0x02ba('0x82')][_0x02ba('0x87')],'where':{}};var _0x3bd594={};var _0x3d1a89={'count':0x0,'rows':[]};var _0x33520e=_0x330ff7[_0x02ba('0x82')][_0x02ba('0x88')];var _0x32a6e5=_0x330ff7['query'][_0x02ba('0x89')]||![];var _0x5e1efb=_0x53d378(_0x33520e,_0x32a6e5);if(!_0x5e1efb[_0x02ba('0x13')])throw new Error(_0x02ba('0x8a')+_0x33520e+'\x27');var _0x4ad970=[{'name':_0x33520e}];if(!_[_0x02ba('0x8b')](_0x5e1efb['parentSections']))_0x4ad970=_0x5e1efb['parentSections'];var _0x3a885d=[];for(var _0x164571=0x0;_0x164571<_0x4ad970[_0x02ba('0x8c')];_0x164571++){_0x3a885d[_0x02ba('0x8d')](_0x215b37[_0x02ba('0x8e')][_0x02ba('0x8f')]({'where':{'userProfileId':_0x330ff7[_0x02ba('0x90')]['id'],'name':_0x4ad970[_0x164571][_0x02ba('0xb')]},'raw':!![]}));}return Promise[_0x02ba('0x91')](_0x3a885d)[_0x02ba('0x8')](function(_0x1cf507){var _0x312eee=_[_0x02ba('0x4')](_0x1cf507,function(_0x5f3e88){return _0x5f3e88?_0x5f3e88:undefined;});var _0x4b38bf=_[_0x02ba('0x4')](_0x4ad970,[_0x02ba('0x92'),!![]]);var _0x59c93d=_[_0x02ba('0x8b')](_0x312eee)&&_[_0x02ba('0x8b')](_0x4b38bf)?null:_['union'](_0x4b38bf,_0x312eee);if(!_0x59c93d)return null;var _0x2bd0de=[];for(var _0x577ca2=0x0;_0x577ca2<_0x59c93d[_0x02ba('0x8c')];_0x577ca2++){var _0x4ff1eb=_[_0x02ba('0x8f')](_0x4ad970,function(_0x5990dd){return _0x59c93d[_0x577ca2]?_0x5990dd[_0x02ba('0xb')]===_0x59c93d[_0x577ca2][_0x02ba('0xb')]:null;});if(_0x4ff1eb){if(_0x59c93d[_0x577ca2][_0x02ba('0x92')]){_0x2bd0de[_0x02ba('0x8d')](_0x12db04(_0x5e1efb[_0x02ba('0x13')],_0x59c93d[_0x577ca2]));}else{if(!_0x59c93d[_0x577ca2][_0x02ba('0x93')]){_0x2bd0de[_0x02ba('0x8d')](_0x20ce1c(_0x4ff1eb,_0x59c93d[_0x577ca2],_0x5e1efb[_0x02ba('0x13')]));}else{if(_0x4ff1eb[_0x02ba('0x94')]){_0x2bd0de['push'](_0x28d6e2(_0x4ff1eb,_0x59c93d[_0x577ca2]));}}}}}return Promise['all'](_0x2bd0de);})[_0x02ba('0x8')](function(_0x138d2c){var _0x64411b=_0x138d2c;var _0x47c8fb=null;if(_0x64411b){_0x47c8fb=_0x64411b[_0x02ba('0x8c')]===0x1?_0x64411b[0x0]:null;}if(!_0x47c8fb&&!_0x64411b)return _0x3d1a89;var _0x3e3fef=_0x215b37[_0x5e1efb[_0x02ba('0x13')]]['rawAttributes'];_0x3bd594[_0x02ba('0x94')]=_[_0x02ba('0x95')](_0x3e3fef);_0x3bd594[_0x02ba('0x82')]=_[_0x02ba('0x95')](_0x330ff7['query']);_0x3bd594[_0x02ba('0x96')]=_[_0x02ba('0x97')](_0x3bd594['model'],_0x3bd594['query']);_0x2ea78f[_0x02ba('0x98')]=_[_0x02ba('0x97')](_0x3bd594['model'],qs[_0x02ba('0x99')](_0x330ff7['query'][_0x02ba('0x99')]));_0x2ea78f['attributes']=_0x2ea78f[_0x02ba('0x98')][_0x02ba('0x8c')]?_0x2ea78f[_0x02ba('0x98')]:_0x3bd594['model'];if(!_0x330ff7[_0x02ba('0x82')]['hasOwnProperty'](_0x02ba('0x9a'))){_0x2ea78f[_0x02ba('0x9b')]=qs[_0x02ba('0x9b')](_0x330ff7['query'][_0x02ba('0x9b')]);_0x2ea78f[_0x02ba('0x9c')]=qs['offset'](_0x330ff7[_0x02ba('0x82')][_0x02ba('0x9c')]);}_0x2ea78f[_0x02ba('0x9d')]=qs[_0x02ba('0x9e')](_0x330ff7[_0x02ba('0x82')]['sort']);_0x2ea78f[_0x02ba('0x7f')]=qs[_0x02ba('0x96')](_['pick'](_0x330ff7[_0x02ba('0x82')],_0x3bd594[_0x02ba('0x96')]));if(_0x330ff7[_0x02ba('0x82')][_0x02ba('0x4')]){_0x2ea78f['where']=_[_0x02ba('0x9f')](_0x2ea78f[_0x02ba('0x7f')],{'$or':_[_0x02ba('0xe')](_0x3e3fef,function(_0x53df1f){if(_0x53df1f['type'][_0x02ba('0xa0')]!==_0x02ba('0xa1')){var _0x1a6db1={};_0x1a6db1[_0x53df1f['field']]={'$like':'%'+_0x330ff7[_0x02ba('0x82')]['filter']+'%'};return _0x1a6db1;}})});}var _0x66c73b=[];var _0x161bad=null;var _0xee12ce={};if(_0x47c8fb){_0x161bad=_[_0x02ba('0x8f')](_0x4ad970,['name',_0x47c8fb[_0x02ba('0xb')]]);if(_0x161bad[_0x02ba('0x5')]){_0xee12ce={};if(_0x5e1efb['childModel']===_0x02ba('0xd')){_0xee12ce[_0x161bad[_0x02ba('0xa2')]]=_[_0x02ba('0xe')](_0x47c8fb[_0x02ba('0x9')],'id');}else{_0xee12ce[_0x161bad[_0x02ba('0xa2')]]=_0x47c8fb[_0x02ba('0x9')];}_0x66c73b[_0x02ba('0x8d')](_0xee12ce);}else{_0x2ea78f[_0x02ba('0x7f')]['id']=_0x47c8fb[_0x02ba('0x9')];}}else{for(var _0x1a9c81=0x0;_0x1a9c81<_0x64411b[_0x02ba('0x8c')];_0x1a9c81++){_0x161bad=_[_0x02ba('0x8f')](_0x4ad970,[_0x02ba('0xb'),_0x64411b[_0x1a9c81][_0x02ba('0xb')]]);if(_0x161bad[_0x02ba('0x5')]){_0xee12ce={};_0xee12ce[_0x161bad[_0x02ba('0xa2')]]=_0x64411b[_0x1a9c81]['associatedResources'];_0x66c73b[_0x02ba('0x8d')](_0xee12ce);}else{if(!_0x2ea78f[_0x02ba('0x7f')]['id'])_0x2ea78f[_0x02ba('0x7f')]['id']=[];_0x64411b[_0x1a9c81][_0x02ba('0x9')][_0x02ba('0xa3')](function(_0xbe53d){_0x2ea78f[_0x02ba('0x7f')]['id'][_0x02ba('0x8d')](_0xbe53d);});}}}if(!_[_0x02ba('0x8b')](_0x66c73b)){_0x2ea78f['where']=_[_0x02ba('0x9f')](_0x2ea78f[_0x02ba('0x7f')],{'$and':{'$or':_0x66c73b}});}_0x2ea78f=_[_0x02ba('0x9f')]({},_0x2ea78f,_0x330ff7[_0x02ba('0xa4')]);if(_0x47c8fb&&!_0x47c8fb['autoAssociation']&&_0x5e1efb[_0x02ba('0x13')]===_0x02ba('0xd')){if(_0x330ff7[_0x02ba('0x82')][_0x02ba('0xa5')]){_0x2ea78f[_0x02ba('0xa6')]=[{'all':!![]}];}return _0x215b37[_0x5e1efb['childModel']][_0x02ba('0x7')](_0x2ea78f)[_0x02ba('0x8')](function(_0x5fcacf){var _0x160be2=[];_0x5fcacf[_0x02ba('0xa3')](function(_0x53adf8){var _0x56e773;switch(_0x53adf8[_0x02ba('0xa7')]){case'default':_0x56e773=_[_0x02ba('0x8f')](_0x47c8fb[_0x02ba('0x9')],function(_0xffbfd){return _0xffbfd['id']===_0x53adf8['reportId']&&_0xffbfd['type']===_0x02ba('0xa8');});break;case _0x02ba('0xa9'):_0x56e773=_[_0x02ba('0x8f')](_0x47c8fb[_0x02ba('0x9')],function(_0x1e6789){return _0x1e6789['id']===_0x53adf8[_0x02ba('0xaa')]&&_0x1e6789['type']===_0x02ba('0xab');});break;}if(_0x56e773)_0x160be2[_0x02ba('0x8d')](_0x53adf8);});_0x3d1a89['count']=_0x160be2[_0x02ba('0x8c')];_0x3d1a89[_0x02ba('0xac')]=_0x160be2;return _0x3d1a89;});}else{if(!_[_0x02ba('0x8b')](_0x330ff7[_0x02ba('0x82')][_0x02ba('0xad')])){_0x2ea78f[_0x02ba('0x7f')]['id']=_0x2ea78f[_0x02ba('0x7f')]['id']?_['intersection'](_0x2ea78f[_0x02ba('0x7f')]['id'],_0x330ff7[_0x02ba('0x82')][_0x02ba('0xad')]):_0x330ff7[_0x02ba('0x82')][_0x02ba('0xad')];if(_0x330ff7[_0x02ba('0x82')][_0x02ba('0xae')]){_0x2ea78f[_0x02ba('0x9d')]=_0x330ff7[_0x02ba('0x82')]['customSorting'];}}if(_0x330ff7[_0x02ba('0x82')][_0x02ba('0xaf')]){_0x2ea78f[_0x02ba('0x7f')]=_['merge'](_0x2ea78f[_0x02ba('0x7f')],{'$and':_0x330ff7[_0x02ba('0x82')][_0x02ba('0xaf')]});}return _0x215b37[_0x5e1efb[_0x02ba('0x13')]][_0x02ba('0xb0')]({'where':_0x2ea78f[_0x02ba('0x7f')]})[_0x02ba('0x8')](function(_0x323da3){_0x3d1a89['count']=_0x323da3;if(_0x330ff7[_0x02ba('0x82')][_0x02ba('0xa5')]){if(_0x5e1efb[_0x02ba('0x13')]===_0x02ba('0x1b')){_0x2ea78f[_0x02ba('0xa6')]=[{'model':_0x215b37['Tag'],'as':_0x02ba('0xb1'),'attributes':['id',_0x02ba('0xb'),_0x02ba('0xb2')],'required':_0x330ff7[_0x02ba('0x82')][_0x02ba('0xb3')]?!![]:![]},{'model':_0x215b37[_0x02ba('0x6a')],'as':'ThroughTags','attributes':['id',_0x02ba('0xb'),_0x02ba('0xb2')],'through':_0x330ff7[_0x02ba('0x82')][_0x02ba('0xb3')]?{'attributes':[],'where':{'TagId':_0x330ff7[_0x02ba('0x82')][_0x02ba('0xb3')]||undefined}}:{},'required':_0x330ff7[_0x02ba('0x82')][_0x02ba('0xb3')]?!![]:![]}];}else{_0x2ea78f[_0x02ba('0xa6')]=[{'all':!![]}];}}return _0x215b37[_0x5e1efb[_0x02ba('0x13')]][_0x02ba('0x7')](_0x2ea78f);})[_0x02ba('0x8')](function(_0x33e29d){_0x3d1a89[_0x02ba('0xac')]=_0x33e29d;if(_0x33520e==='Agents'&&_0x330ff7['query'][_0x02ba('0xb4')]===_0x02ba('0xb5')){var _0x2ea28f=[];for(var _0x595398=0x0;_0x595398<_0x3d1a89[_0x02ba('0xac')]['length'];_0x595398++){_0x2ea28f[_0x02ba('0x8d')](_0x573e83(_0x02ba('0xb6'),_0x3d1a89[_0x02ba('0xac')][_0x595398][_0x02ba('0xb7')]));_0x2ea28f['push'](_0x573e83('sms',_0x3d1a89[_0x02ba('0xac')][_0x595398][_0x02ba('0xb7')]));_0x2ea28f[_0x02ba('0x8d')](_0x573e83(_0x02ba('0xb8'),_0x3d1a89[_0x02ba('0xac')][_0x595398]['dataValues']));_0x2ea28f[_0x02ba('0x8d')](_0x573e83(_0x02ba('0xb9'),_0x3d1a89['rows'][_0x595398][_0x02ba('0xb7')]));_0x2ea28f[_0x02ba('0x8d')](_0x573e83('openchannel',_0x3d1a89['rows'][_0x595398][_0x02ba('0xb7')]));_0x2ea28f[_0x02ba('0x8d')](_0x573e83('whatsapp',_0x3d1a89[_0x02ba('0xac')][_0x595398][_0x02ba('0xb7')]));}return Promise['all'](_0x2ea28f)['then'](function(){return _0x3d1a89;});}return _0x3d1a89;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index a73a673..47e8919 100644 --- a/server/api/userProfile/userProfile.rpc.js +++ b/server/api/userProfile/userProfile.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0619=['client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0x0619,0x90));var _0x9061=function(_0x1642e9,_0x3f5d4f){_0x1642e9=_0x1642e9-0x0;var _0x508c9f=_0x0619[_0x1642e9];return _0x508c9f;};'use strict';var _=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var moment=require(_0x9061('0x2'));var BPromise=require(_0x9061('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9061('0x4'));var db=require(_0x9061('0x5'))['db'];var utils=require(_0x9061('0x6'));var logger=require(_0x9061('0x7'))(_0x9061('0x8'));var config=require(_0x9061('0x9'));var jayson=require(_0x9061('0xa'));var client=jayson[_0x9061('0xb')][_0x9061('0xc')]({'port':0x232a});config[_0x9061('0xd')]=_[_0x9061('0xe')](config['redis'],{'host':_0x9061('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9061('0x10'))[_0x9061('0x11')](socket);function respondWithRpcPromise(_0x4cf332,_0x502660,_0x3bc693){return new BPromise(function(_0x2fc757,_0x13d226){return client[_0x9061('0x12')](_0x4cf332,_0x3bc693)[_0x9061('0x13')](function(_0x25ce5d){logger[_0x9061('0x14')](_0x9061('0x15'),_0x502660,_0x9061('0x16'));logger[_0x9061('0x17')](_0x9061('0x18'),_0x502660,_0x9061('0x16'),JSON[_0x9061('0x19')](_0x25ce5d));if(_0x25ce5d['error']){if(_0x25ce5d['error'][_0x9061('0x1a')]===0x1f4){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d[_0x9061('0x1b')][_0x9061('0x1c')]);return _0x13d226(_0x25ce5d['error']['message']);}logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d['error'][_0x9061('0x1c')]);return _0x2fc757(_0x25ce5d['error'][_0x9061('0x1c')]);}else{logger['info'](_0x9061('0x15'),_0x502660,'request\x20sent');_0x2fc757(_0x25ce5d[_0x9061('0x1d')][_0x9061('0x1c')]);}})[_0x9061('0x1e')](function(_0x11fc9e){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x11fc9e);_0x13d226(_0x11fc9e);});});} \ No newline at end of file +var _0x96f2=['info','UserProfile,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x1e53f2,_0x5982a6){var _0x5d3c27=function(_0x39a9af){while(--_0x39a9af){_0x1e53f2['push'](_0x1e53f2['shift']());}};_0x5d3c27(++_0x5982a6);}(_0x96f2,0xb0));var _0x296f=function(_0x4a48c2,_0x10d424){_0x4a48c2=_0x4a48c2-0x0;var _0x455c03=_0x96f2[_0x4a48c2];return _0x455c03;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x296f('0x9')]=_[_0x296f('0xa')](config[_0x296f('0x9')],{'host':_0x296f('0xb'),'port':0x18eb});var socket=require(_0x296f('0xc'))(new Redis(config[_0x296f('0x9')]));require(_0x296f('0xd'))[_0x296f('0xe')](socket);function respondWithRpcPromise(_0x2f81ac,_0x3729ab,_0x593fd9){return new BPromise(function(_0xea97f0,_0x1a2a02){return client[_0x296f('0xf')](_0x2f81ac,_0x593fd9)['then'](function(_0x2e2307){logger[_0x296f('0x10')](_0x296f('0x11'),_0x3729ab,_0x296f('0x12'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x3729ab,'request\x20sent',JSON[_0x296f('0x13')](_0x2e2307));if(_0x2e2307[_0x296f('0x14')]){if(_0x2e2307[_0x296f('0x14')][_0x296f('0x15')]===0x1f4){logger['error'](_0x296f('0x11'),_0x3729ab,_0x2e2307['error']['message']);return _0x1a2a02(_0x2e2307[_0x296f('0x14')][_0x296f('0x16')]);}logger[_0x296f('0x14')](_0x296f('0x11'),_0x3729ab,_0x2e2307['error']['message']);return _0xea97f0(_0x2e2307[_0x296f('0x14')]['message']);}else{logger[_0x296f('0x10')](_0x296f('0x11'),_0x3729ab,_0x296f('0x12'));_0xea97f0(_0x2e2307['result'][_0x296f('0x16')]);}})[_0x296f('0x17')](function(_0x57f19d){logger[_0x296f('0x14')](_0x296f('0x11'),_0x3729ab,_0x57f19d);_0x1a2a02(_0x57f19d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 015fdf5..2ad78e0 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 _0x1521=['length','userProfile:','./userProfile.events','remove','removeListener'];(function(_0xa2c2e2,_0x535d90){var _0x3d7867=function(_0x48be46){while(--_0x48be46){_0xa2c2e2['push'](_0xa2c2e2['shift']());}};_0x3d7867(++_0x535d90);}(_0x1521,0x133));var _0x1152=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x1521[_0x4314d7];return _0x5c599b;};'use strict';var UserProfileEvents=require(_0x1152('0x0'));var events=['save',_0x1152('0x1'),'update'];function createListener(_0x475ccc,_0x4ffd36){return function(_0x9f3a1c){_0x4ffd36['emit'](_0x475ccc,_0x9f3a1c);};}function removeListener(_0x2abff2,_0x468a77){return function(){UserProfileEvents[_0x1152('0x2')](_0x2abff2,_0x468a77);};}exports['register']=function(_0x5df607){for(var _0x1046e7=0x0,_0x4c3507=events[_0x1152('0x3')];_0x1046e7<_0x4c3507;_0x1046e7++){var _0xe7c4d3=events[_0x1046e7];var _0x3155e3=createListener(_0x1152('0x4')+_0xe7c4d3,_0x5df607);UserProfileEvents['on'](_0xe7c4d3,_0x3155e3);}}; \ No newline at end of file +var _0xa50e=['emit','removeListener','register','length','userProfile:','save','remove','update'];(function(_0x2d7cb1,_0x24f244){var _0x545754=function(_0x8eee34){while(--_0x8eee34){_0x2d7cb1['push'](_0x2d7cb1['shift']());}};_0x545754(++_0x24f244);}(_0xa50e,0xc5));var _0xea50=function(_0xc61212,_0x285846){_0xc61212=_0xc61212-0x0;var _0x5c8403=_0xa50e[_0xc61212];return _0x5c8403;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xea50('0x0'),_0xea50('0x1'),_0xea50('0x2')];function createListener(_0x2e599c,_0x183b7f){return function(_0x235303){_0x183b7f[_0xea50('0x3')](_0x2e599c,_0x235303);};}function removeListener(_0xba931b,_0x1487e1){return function(){UserProfileEvents[_0xea50('0x4')](_0xba931b,_0x1487e1);};}exports[_0xea50('0x5')]=function(_0x484977){for(var _0x299b31=0x0,_0x5c4eba=events[_0xea50('0x6')];_0x299b31<_0x5c4eba;_0x299b31++){var _0x737376=events[_0x299b31];var _0x2c772e=createListener(_0xea50('0x7')+_0x737376,_0x484977);UserProfileEvents['on'](_0x737376,_0x2c772e);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index c9b12d0..29197be 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 _0x0f83=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x470d01,_0x131881){var _0x2748fd=function(_0x2d986a){while(--_0x2d986a){_0x470d01['push'](_0x470d01['shift']());}};_0x2748fd(++_0x131881);}(_0x0f83,0x1ab));var _0x30f8=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x0f83[_0x5ad07c];return _0x204bae;};'use strict';var multer=require(_0x30f8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x30f8('0x1'));var express=require(_0x30f8('0x2'));var router=express[_0x30f8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x30f8('0x4'));var config=require(_0x30f8('0x5'));var controller=require(_0x30f8('0x6'));router[_0x30f8('0x7')]('/',auth[_0x30f8('0x8')](),controller[_0x30f8('0x9')]);router[_0x30f8('0x7')](_0x30f8('0xa'),auth[_0x30f8('0x8')](),controller['describe']);router['get'](_0x30f8('0xb'),auth[_0x30f8('0x8')](),controller['show']);router[_0x30f8('0xc')]('/',auth[_0x30f8('0x8')](),controller[_0x30f8('0xd')]);router['put'](_0x30f8('0xb'),auth['isAuthenticated'](),controller[_0x30f8('0xe')]);router[_0x30f8('0xf')](_0x30f8('0xb'),auth['isAuthenticated'](),controller[_0x30f8('0x10')]);module[_0x30f8('0x11')]=router; \ No newline at end of file +var _0x95d9=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x24c842,_0x151dda){var _0x42fc89=function(_0x498e57){while(--_0x498e57){_0x24c842['push'](_0x24c842['shift']());}};_0x42fc89(++_0x151dda);}(_0x95d9,0x140));var _0x995d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x95d9[_0xac151d];return _0x111dba;};'use strict';var multer=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var path=require(_0x995d('0x2'));var timeout=require('connect-timeout');var express=require(_0x995d('0x3'));var router=express[_0x995d('0x4')]();var fs_extra=require(_0x995d('0x5'));var auth=require(_0x995d('0x6'));var interaction=require(_0x995d('0x7'));var config=require('../../config/environment');var controller=require(_0x995d('0x8'));router[_0x995d('0x9')]('/',auth[_0x995d('0xa')](),controller['index']);router[_0x995d('0x9')](_0x995d('0xb'),auth[_0x995d('0xa')](),controller['describe']);router[_0x995d('0x9')](_0x995d('0xc'),auth['isAuthenticated'](),controller[_0x995d('0xd')]);router[_0x995d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x995d('0xf')]('/:id',auth[_0x995d('0xa')](),controller[_0x995d('0x10')]);router[_0x995d('0x11')]('/:id',auth[_0x995d('0xa')](),controller[_0x995d('0x12')]);module[_0x995d('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 6fd1102..07d5b23 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 _0x5ef9=['STRING','INTEGER'];(function(_0xbd27dc,_0x90f55c){var _0x27f077=function(_0x4c2aaa){while(--_0x4c2aaa){_0xbd27dc['push'](_0xbd27dc['shift']());}};_0x27f077(++_0x90f55c);}(_0x5ef9,0x18e));var _0x95ef=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x5ef9[_0x2cc569];return _0x1bfc2e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x95ef('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x95ef('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x95ef('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x86da=['exports','STRING','sequelize'];(function(_0x1e36e8,_0x27397c){var _0xba05b0=function(_0x5ed106){while(--_0x5ed106){_0x1e36e8['push'](_0x1e36e8['shift']());}};_0xba05b0(++_0x27397c);}(_0x86da,0x176));var _0xa86d=function(_0x417e0a,_0x446db8){_0x417e0a=_0x417e0a-0x0;var _0x223dab=_0x86da[_0x417e0a];return _0x223dab;};'use strict';var Sequelize=require(_0xa86d('0x0'));module[_0xa86d('0x1')]={'name':{'type':Sequelize[_0xa86d('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xa86d('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 4bd1b0a..5262843 100644 --- a/server/api/userProfileResource/userProfileResource.controller.js +++ b/server/api/userProfileResource/userProfileResource.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x896e,0x1e9));var _0xe896=function(_0x770ba9,_0xbd5d6c){_0x770ba9=_0x770ba9-0x0;var _0x403cc9=_0x896e[_0x770ba9];return _0x403cc9;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['UserProfileResource'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['UserProfileResource'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file +var _0xe3da=['../../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','UserProfileResource','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','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x2dbd51,_0x94cc2f){var _0x25ebc7=function(_0xd33ee8){while(--_0xd33ee8){_0x2dbd51['push'](_0x2dbd51['shift']());}};_0x25ebc7(++_0x94cc2f);}(_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')]['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));};exports['describe']=function(_0x4f4694,_0x4c6dab){return db[_0xae3d('0x2f')][_0xae3d('0x50')]()['then'](respondWithResult(_0x4c6dab,null))[_0xae3d('0x48')](handleError(_0x4c6dab,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index ff30d4d..e2b6c74 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 _0x3f22=['resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex'];(function(_0x5aec67,_0xb2e85){var _0x461761=function(_0x1f888f){while(--_0x1f888f){_0x5aec67['push'](_0x5aec67['shift']());}};_0x461761(++_0xb2e85);}(_0x3f22,0xc6));var _0x23f2=function(_0x16e785,_0x4becf2){_0x16e785=_0x16e785-0x0;var _0x409d26=_0x3f22[_0x16e785];return _0x409d26;};'use strict';var _=require(_0x23f2('0x0'));var util=require(_0x23f2('0x1'));var logger=require(_0x23f2('0x2'))(_0x23f2('0x3'));var moment=require('moment');var BPromise=require(_0x23f2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x23f2('0x5'));var rimraf=require('rimraf');var config=require(_0x23f2('0x6'));var attributes=require(_0x23f2('0x7'));module[_0x23f2('0x8')]=function(_0x5e0bca,_0x3bb19a){return _0x5e0bca[_0x23f2('0x9')](_0x23f2('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x23f2('0xb'),'fields':[_0x23f2('0xc'),_0x23f2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a48=['rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','bluebird','request-promise'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x5a48,0x1b8));var _0x85a4=function(_0x497d6d,_0xff7558){_0x497d6d=_0x497d6d-0x0;var _0x4a1d9a=_0x5a48[_0x497d6d];return _0x4a1d9a;};'use strict';var _=require(_0x85a4('0x0'));var util=require(_0x85a4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85a4('0x2'));var rp=require(_0x85a4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85a4('0x4'));var config=require('../../config/environment');var attributes=require(_0x85a4('0x5'));module[_0x85a4('0x6')]=function(_0x4cdf16,_0x502fab){return _0x4cdf16[_0x85a4('0x7')](_0x85a4('0x8'),attributes,{'tableName':_0x85a4('0x9'),'paranoid':![],'indexes':[{'name':_0x85a4('0xa'),'fields':['resourceId',_0x85a4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0a5563c..ad657ac 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 _0xdfb6=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x44784c,_0x4498c1){var _0x4bbfb1=function(_0x5d5ef7){while(--_0x5d5ef7){_0x44784c['push'](_0x44784c['shift']());}};_0x4bbfb1(++_0x4498c1);}(_0xdfb6,0x192));var _0x6dfb=function(_0x2e76ac,_0x3bc669){_0x2e76ac=_0x2e76ac-0x0;var _0x58ab89=_0xdfb6[_0x2e76ac];return _0x58ab89;};'use strict';var _=require(_0x6dfb('0x0'));var util=require(_0x6dfb('0x1'));var moment=require(_0x6dfb('0x2'));var BPromise=require(_0x6dfb('0x3'));var rs=require(_0x6dfb('0x4'));var fs=require('fs');var Redis=require(_0x6dfb('0x5'));var db=require(_0x6dfb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dfb('0x7'))(_0x6dfb('0x8'));var config=require('../../config/environment');var jayson=require(_0x6dfb('0x9'));var client=jayson['client'][_0x6dfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a132,_0x361612,_0xf0c36a){return new BPromise(function(_0x314f34,_0x487c00){return client[_0x6dfb('0xb')](_0x12a132,_0xf0c36a)[_0x6dfb('0xc')](function(_0x929a19){logger[_0x6dfb('0xd')](_0x6dfb('0xe'),_0x361612,_0x6dfb('0xf'));logger[_0x6dfb('0x10')](_0x6dfb('0x11'),_0x361612,'request\x20sent',JSON['stringify'](_0x929a19));if(_0x929a19['error']){if(_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x13')]===0x1f4){logger[_0x6dfb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x361612,_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);return _0x487c00(_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);}logger[_0x6dfb('0x12')](_0x6dfb('0xe'),_0x361612,_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);return _0x314f34(_0x929a19[_0x6dfb('0x12')][_0x6dfb('0x14')]);}else{logger[_0x6dfb('0xd')](_0x6dfb('0xe'),_0x361612,'request\x20sent');_0x314f34(_0x929a19[_0x6dfb('0x15')][_0x6dfb('0x14')]);}})[_0x6dfb('0x16')](function(_0x3a5d9c){logger[_0x6dfb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x361612,_0x3a5d9c);_0x487c00(_0x3a5d9c);});});} \ No newline at end of file +var _0x7241=['rpc','jayson/promise','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x7241,0x12a));var _0x1724=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7241[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x1724('0x0'));var util=require(_0x1724('0x1'));var moment=require(_0x1724('0x2'));var BPromise=require(_0x1724('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1724('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1724('0x5'));var logger=require('../../config/logger')(_0x1724('0x6'));var config=require('../../config/environment');var jayson=require(_0x1724('0x7'));var client=jayson['client'][_0x1724('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f4ebb,_0x52148c,_0x2b7fa5){return new BPromise(function(_0x142be5,_0x2503a6){return client[_0x1724('0x9')](_0x2f4ebb,_0x2b7fa5)[_0x1724('0xa')](function(_0x5478c3){logger['info'](_0x1724('0xb'),_0x52148c,_0x1724('0xc'));logger['debug'](_0x1724('0xd'),_0x52148c,'request\x20sent',JSON['stringify'](_0x5478c3));if(_0x5478c3[_0x1724('0xe')]){if(_0x5478c3[_0x1724('0xe')][_0x1724('0xf')]===0x1f4){logger[_0x1724('0xe')](_0x1724('0xb'),_0x52148c,_0x5478c3[_0x1724('0xe')]['message']);return _0x2503a6(_0x5478c3[_0x1724('0xe')][_0x1724('0x10')]);}logger['error'](_0x1724('0xb'),_0x52148c,_0x5478c3[_0x1724('0xe')][_0x1724('0x10')]);return _0x142be5(_0x5478c3[_0x1724('0xe')][_0x1724('0x10')]);}else{logger[_0x1724('0x11')](_0x1724('0xb'),_0x52148c,_0x1724('0xc'));_0x142be5(_0x5478c3[_0x1724('0x12')][_0x1724('0x10')]);}})['catch'](function(_0x51fba0){logger['error'](_0x1724('0xb'),_0x52148c,_0x51fba0);_0x2503a6(_0x51fba0);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9049155..d0456d9 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 _0x6991=['multer','util','path','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','create','put','update','destroy','exports'];(function(_0x565d5f,_0x2bf262){var _0x3a3b58=function(_0x3c783f){while(--_0x3c783f){_0x565d5f['push'](_0x565d5f['shift']());}};_0x3a3b58(++_0x2bf262);}(_0x6991,0x9a));var _0x1699=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x6991[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x1699('0x0'));var util=require(_0x1699('0x1'));var path=require(_0x1699('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1699('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1699('0x4'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x1699('0x5')]('/',auth[_0x1699('0x6')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1699('0x7')]);router[_0x1699('0x5')](_0x1699('0x8'),auth[_0x1699('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1699('0x9')]);router[_0x1699('0xa')](_0x1699('0x8'),auth[_0x1699('0x6')](),controller[_0x1699('0xb')]);router['delete'](_0x1699('0x8'),auth[_0x1699('0x6')](),controller[_0x1699('0xc')]);module[_0x1699('0xd')]=router; \ No newline at end of file +var _0x3cf9=['/describe','describe','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated'];(function(_0x9647da,_0x1f7117){var _0x25c414=function(_0x260ce6){while(--_0x260ce6){_0x9647da['push'](_0x9647da['shift']());}};_0x25c414(++_0x1f7117);}(_0x3cf9,0x183));var _0x93cf=function(_0x56fc00,_0x2c963f){_0x56fc00=_0x56fc00-0x0;var _0x409e35=_0x3cf9[_0x56fc00];return _0x409e35;};'use strict';var multer=require(_0x93cf('0x0'));var util=require('util');var path=require(_0x93cf('0x1'));var timeout=require(_0x93cf('0x2'));var express=require(_0x93cf('0x3'));var router=express[_0x93cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x93cf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x93cf('0x6'));router[_0x93cf('0x7')]('/',auth[_0x93cf('0x8')](),controller['index']);router[_0x93cf('0x7')](_0x93cf('0x9'),auth[_0x93cf('0x8')](),controller[_0x93cf('0xa')]);router[_0x93cf('0x7')](_0x93cf('0xb'),auth['isAuthenticated'](),controller[_0x93cf('0xc')]);router[_0x93cf('0xd')]('/',auth[_0x93cf('0x8')](),controller[_0x93cf('0xe')]);router['put'](_0x93cf('0xb'),auth['isAuthenticated'](),controller[_0x93cf('0xf')]);router['delete'](_0x93cf('0xb'),auth[_0x93cf('0x8')](),controller[_0x93cf('0x10')]);module[_0x93cf('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 4c55558..b4428ea 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(_0x5a22bf,_0x3ede6a){var _0x1a7051=function(_0xdac79c){while(--_0xdac79c){_0x5a22bf['push'](_0x5a22bf['shift']());}};_0x1a7051(++_0x3ede6a);}(_0xa478,0x136));var _0x8a47=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0xa478[_0x545a3a];return _0x5a5493;};'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 _0xcf66=['getDataValue','crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join'];(function(_0x2d9e00,_0x309f91){var _0x251aa7=function(_0xb56388){while(--_0xb56388){_0x2d9e00['push'](_0x2d9e00['shift']());}};_0x251aa7(++_0x309f91);}(_0xcf66,0x71));var _0x6cf6=function(_0x415fcb,_0x20f0b2){_0x415fcb=_0x415fcb-0x0;var _0xdd6bb3=_0xcf66[_0x415fcb];return _0xdd6bb3;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'name':{'type':Sequelize[_0x6cf6('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6cf6('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1c599d){this[_0x6cf6('0x5')]('crudPermissions',_0x1c599d?_0x1c599d[_0x6cf6('0x6')](''):[]);},'get':function(){return this[_0x6cf6('0x7')](_0x6cf6('0x8'))?this['getDataValue'](_0x6cf6('0x8'))[_0x6cf6('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e0b1ab0..d613a29 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 _0xd355=['fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','stack','name','UserProfileSection','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','include','rows','catch','params','length','includeAll','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x489e7a,_0x3104eb){var _0xc1d33=function(_0x4277ff){while(--_0x4277ff){_0x489e7a['push'](_0x489e7a['shift']());}};_0xc1d33(++_0x3104eb);}(_0xd355,0x193));var _0x5d35=function(_0x34cafa,_0x251fc9){_0x34cafa=_0x34cafa-0x0;var _0x2741d1=_0xd355[_0x34cafa];return _0x2741d1;};'use strict';var emlformat=require(_0x5d35('0x0'));var rimraf=require(_0x5d35('0x1'));var zipdir=require(_0x5d35('0x2'));var jsonpatch=require(_0x5d35('0x3'));var rp=require(_0x5d35('0x4'));var moment=require(_0x5d35('0x5'));var BPromise=require(_0x5d35('0x6'));var Mustache=require(_0x5d35('0x7'));var util=require('util');var path=require(_0x5d35('0x8'));var sox=require(_0x5d35('0x9'));var csv=require(_0x5d35('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d35('0xb'));var _=require(_0x5d35('0xc'));var squel=require(_0x5d35('0xd'));var crypto=require('crypto');var jsforce=require(_0x5d35('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d35('0xa'));var querystring=require(_0x5d35('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5d35('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d35('0x11'));var logger=require(_0x5d35('0x12'))(_0x5d35('0x13'));var utils=require(_0x5d35('0x14'));var config=require(_0x5d35('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d35('0x16'))['db'];function respondWithStatusCode(_0x107c3a,_0x5dbb98){_0x5dbb98=_0x5dbb98||0xcc;return function(_0x53d302){if(_0x53d302){return _0x107c3a[_0x5d35('0x17')](_0x5dbb98);}return _0x107c3a[_0x5d35('0x18')](_0x5dbb98)[_0x5d35('0x19')]();};}function respondWithResult(_0x54f947,_0x1513ce){_0x1513ce=_0x1513ce||0xc8;return function(_0xe7b436){if(_0xe7b436){return _0x54f947[_0x5d35('0x18')](_0x1513ce)['json'](_0xe7b436);}};}function respondWithFilteredResult(_0x193cd0,_0x434338){return function(_0x5391c2){if(_0x5391c2){var _0x15dd25=typeof _0x434338[_0x5d35('0x1a')]==='undefined'&&typeof _0x434338['limit']===_0x5d35('0x1b');var _0x23d77a=_0x5391c2[_0x5d35('0x1c')];var _0x1626d0=_0x15dd25?0x0:_0x434338[_0x5d35('0x1a')];var _0x11997e=_0x15dd25?_0x5391c2[_0x5d35('0x1c')]:_0x434338[_0x5d35('0x1a')]+_0x434338[_0x5d35('0x1d')];var _0x51a250;if(_0x11997e>=_0x23d77a){_0x11997e=_0x23d77a;_0x51a250=0xc8;}else{_0x51a250=0xce;}_0x193cd0['status'](_0x51a250);return _0x193cd0[_0x5d35('0x1e')](_0x5d35('0x1f'),_0x1626d0+'-'+_0x11997e+'/'+_0x23d77a)[_0x5d35('0x20')](_0x5391c2);}return null;};}function patchUpdates(_0x4bd09d){return function(_0x2838e2){try{jsonpatch[_0x5d35('0x21')](_0x2838e2,_0x4bd09d,!![]);}catch(_0x14c15f){return BPromise['reject'](_0x14c15f);}return _0x2838e2[_0x5d35('0x22')]();};}function saveUpdates(_0x2ae140,_0x4cc9b6){return function(_0x2c2e0c){if(_0x2c2e0c){return _0x2c2e0c['update'](_0x2ae140)[_0x5d35('0x23')](function(_0x439760){return _0x439760;});}return null;};}function removeEntity(_0x5ae77d,_0x31ad1c){return function(_0x516615){if(_0x516615){return _0x516615[_0x5d35('0x24')]()[_0x5d35('0x23')](function(){_0x5ae77d[_0x5d35('0x18')](0xcc)[_0x5d35('0x19')]();});}};}function handleEntityNotFound(_0x553276,_0x2c4c49){return function(_0x5a4622){if(!_0x5a4622){_0x553276[_0x5d35('0x17')](0x194);}return _0x5a4622;};}function handleError(_0x55174c,_0x53b2cb){_0x53b2cb=_0x53b2cb||0x1f4;return function(_0x735606){logger['error'](_0x735606[_0x5d35('0x25')]);if(_0x735606[_0x5d35('0x26')]){delete _0x735606[_0x5d35('0x26')];}_0x55174c[_0x5d35('0x18')](_0x53b2cb)['send'](_0x735606);};}exports['index']=function(_0x5d4704,_0x2d9278){var _0x33feec={},_0x2fce4e={},_0x31cddd={'count':0x0,'rows':[]};var _0x5235d4=_['map'](db[_0x5d35('0x27')][_0x5d35('0x28')],function(_0x38f4c1){return{'name':_0x38f4c1['fieldName'],'type':_0x38f4c1['type']['key']};});_0x2fce4e[_0x5d35('0x29')]=_['map'](_0x5235d4,_0x5d35('0x26'));_0x2fce4e[_0x5d35('0x2a')]=_[_0x5d35('0x2b')](_0x5d4704['query']);_0x2fce4e[_0x5d35('0x2c')]=_[_0x5d35('0x2d')](_0x2fce4e[_0x5d35('0x29')],_0x2fce4e[_0x5d35('0x2a')]);_0x33feec[_0x5d35('0x2e')]=_[_0x5d35('0x2d')](_0x2fce4e[_0x5d35('0x29')],qs[_0x5d35('0x2f')](_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x2f')]));_0x33feec[_0x5d35('0x2e')]=_0x33feec[_0x5d35('0x2e')]['length']?_0x33feec[_0x5d35('0x2e')]:_0x2fce4e[_0x5d35('0x29')];if(!_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x30')](_0x5d35('0x31'))){_0x33feec[_0x5d35('0x1d')]=qs[_0x5d35('0x1d')](_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x1d')]);_0x33feec[_0x5d35('0x1a')]=qs['offset'](_0x5d4704[_0x5d35('0x2a')]['offset']);}_0x33feec['order']=qs[_0x5d35('0x32')](_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x32')]);_0x33feec[_0x5d35('0x33')]=qs[_0x5d35('0x2c')](_[_0x5d35('0x34')](_0x5d4704['query'],_0x2fce4e[_0x5d35('0x2c')]),_0x5235d4);if(_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x35')]){_0x33feec['where']=_['merge'](_0x33feec[_0x5d35('0x33')],{'$or':_[_0x5d35('0x36')](_0x5235d4,function(_0x40ed31){if(_0x40ed31['type']!==_0x5d35('0x37')){var _0x2c6fce={};_0x2c6fce[_0x40ed31['name']]={'$like':'%'+_0x5d4704[_0x5d35('0x2a')][_0x5d35('0x35')]+'%'};return _0x2c6fce;}})});}_0x33feec=_[_0x5d35('0x38')]({},_0x33feec,_0x5d4704[_0x5d35('0x39')]);var _0x58dec0={'where':_0x33feec[_0x5d35('0x33')]};return db['UserProfileSection'][_0x5d35('0x1c')](_0x58dec0)['then'](function(_0x2b58a5){_0x31cddd[_0x5d35('0x1c')]=_0x2b58a5;if(_0x5d4704[_0x5d35('0x2a')]['includeAll']){_0x33feec[_0x5d35('0x3a')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x33feec);})[_0x5d35('0x23')](function(_0x4914ff){_0x31cddd[_0x5d35('0x3b')]=_0x4914ff;return _0x31cddd;})[_0x5d35('0x23')](respondWithFilteredResult(_0x2d9278,_0x33feec))[_0x5d35('0x3c')](handleError(_0x2d9278,null));};exports['show']=function(_0x55a2cb,_0x4f531d){var _0x322f41={'raw':![],'where':{'id':_0x55a2cb[_0x5d35('0x3d')]['id']}},_0x555c2a={};_0x555c2a[_0x5d35('0x29')]=_[_0x5d35('0x2b')](db[_0x5d35('0x27')][_0x5d35('0x28')]);_0x555c2a['query']=_[_0x5d35('0x2b')](_0x55a2cb[_0x5d35('0x2a')]);_0x555c2a['filters']=_[_0x5d35('0x2d')](_0x555c2a['model'],_0x555c2a[_0x5d35('0x2a')]);_0x322f41[_0x5d35('0x2e')]=_[_0x5d35('0x2d')](_0x555c2a['model'],qs[_0x5d35('0x2f')](_0x55a2cb[_0x5d35('0x2a')][_0x5d35('0x2f')]));_0x322f41['attributes']=_0x322f41[_0x5d35('0x2e')][_0x5d35('0x3e')]?_0x322f41[_0x5d35('0x2e')]:_0x555c2a['model'];if(_0x55a2cb[_0x5d35('0x2a')][_0x5d35('0x3f')]){_0x322f41[_0x5d35('0x3a')]=[{'all':!![]}];}_0x322f41=_[_0x5d35('0x38')]({},_0x322f41,_0x55a2cb['options']);return db[_0x5d35('0x27')]['find'](_0x322f41)[_0x5d35('0x23')](handleEntityNotFound(_0x4f531d,null))[_0x5d35('0x23')](respondWithResult(_0x4f531d,null))[_0x5d35('0x3c')](handleError(_0x4f531d,null));};exports[_0x5d35('0x40')]=function(_0x52f937,_0x267a95){return db[_0x5d35('0x27')][_0x5d35('0x40')](_0x52f937[_0x5d35('0x41')],{})[_0x5d35('0x23')](respondWithResult(_0x267a95,0xc9))[_0x5d35('0x3c')](handleError(_0x267a95,null));};exports[_0x5d35('0x42')]=function(_0x728a,_0x5b1a78){if(_0x728a['body']['id']){delete _0x728a[_0x5d35('0x41')]['id'];}return db[_0x5d35('0x27')][_0x5d35('0x43')]({'where':{'id':_0x728a[_0x5d35('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5b1a78,null))[_0x5d35('0x23')](saveUpdates(_0x728a[_0x5d35('0x41')],null))[_0x5d35('0x23')](respondWithResult(_0x5b1a78,null))[_0x5d35('0x3c')](handleError(_0x5b1a78,null));};exports[_0x5d35('0x24')]=function(_0x1df1fe,_0x157484){return db[_0x5d35('0x27')]['find']({'where':{'id':_0x1df1fe[_0x5d35('0x3d')]['id']}})[_0x5d35('0x23')](handleEntityNotFound(_0x157484,null))[_0x5d35('0x23')](removeEntity(_0x157484,null))[_0x5d35('0x3c')](handleError(_0x157484,null));};exports['describe']=function(_0x4477ed,_0x29171a){return db['UserProfileSection'][_0x5d35('0x44')]()[_0x5d35('0x23')](respondWithResult(_0x29171a,null))[_0x5d35('0x3c')](handleError(_0x29171a,null));}; \ No newline at end of file +var _0x3847=['sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','keys','includeAll','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','map','UserProfileSection','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order'];(function(_0xa18fbc,_0x1f5e04){var _0x2002d0=function(_0x47f2ac){while(--_0x47f2ac){_0xa18fbc['push'](_0xa18fbc['shift']());}};_0x2002d0(++_0x1f5e04);}(_0x3847,0xe9));var _0x7384=function(_0x1b5a82,_0xeed50){_0x1b5a82=_0x1b5a82-0x0;var _0x216399=_0x3847[_0x1b5a82];return _0x216399;};'use strict';var emlformat=require(_0x7384('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7384('0x1'));var jsonpatch=require(_0x7384('0x2'));var rp=require(_0x7384('0x3'));var moment=require('moment');var BPromise=require(_0x7384('0x4'));var Mustache=require(_0x7384('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7384('0x6'));var csv=require(_0x7384('0x7'));var ejs=require(_0x7384('0x8'));var fs=require('fs');var fs_extra=require(_0x7384('0x9'));var _=require(_0x7384('0xa'));var squel=require('squel');var crypto=require(_0x7384('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7384('0xc'));var toCsv=require(_0x7384('0x7'));var querystring=require('querystring');var Papa=require(_0x7384('0xd'));var Redis=require(_0x7384('0xe'));var authService=require(_0x7384('0xf'));var qs=require(_0x7384('0x10'));var as=require(_0x7384('0x11'));var hardwareService=require(_0x7384('0x12'));var logger=require(_0x7384('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x7384('0x14'));var licenseUtil=require(_0x7384('0x15'));var db=require(_0x7384('0x16'))['db'];function respondWithStatusCode(_0x3f0abb,_0x13413d){_0x13413d=_0x13413d||0xcc;return function(_0x17fbee){if(_0x17fbee){return _0x3f0abb[_0x7384('0x17')](_0x13413d);}return _0x3f0abb[_0x7384('0x18')](_0x13413d)[_0x7384('0x19')]();};}function respondWithResult(_0x37da33,_0x3fa9bf){_0x3fa9bf=_0x3fa9bf||0xc8;return function(_0x509552){if(_0x509552){return _0x37da33['status'](_0x3fa9bf)[_0x7384('0x1a')](_0x509552);}};}function respondWithFilteredResult(_0x4382f9,_0x47cef5){return function(_0x4e81e1){if(_0x4e81e1){var _0x263008=typeof _0x47cef5['offset']===_0x7384('0x1b')&&typeof _0x47cef5[_0x7384('0x1c')]===_0x7384('0x1b');var _0x3c2ec5=_0x4e81e1[_0x7384('0x1d')];var _0x5cc9a0=_0x263008?0x0:_0x47cef5['offset'];var _0x2653c3=_0x263008?_0x4e81e1['count']:_0x47cef5[_0x7384('0x1e')]+_0x47cef5[_0x7384('0x1c')];var _0x59083a;if(_0x2653c3>=_0x3c2ec5){_0x2653c3=_0x3c2ec5;_0x59083a=0xc8;}else{_0x59083a=0xce;}_0x4382f9[_0x7384('0x18')](_0x59083a);return _0x4382f9[_0x7384('0x1f')]('Content-Range',_0x5cc9a0+'-'+_0x2653c3+'/'+_0x3c2ec5)[_0x7384('0x1a')](_0x4e81e1);}return null;};}function patchUpdates(_0x13b05e){return function(_0x35765e){try{jsonpatch[_0x7384('0x20')](_0x35765e,_0x13b05e,!![]);}catch(_0x5befa7){return BPromise[_0x7384('0x21')](_0x5befa7);}return _0x35765e['save']();};}function saveUpdates(_0x599e65,_0x3aae4b){return function(_0x2c3cca){if(_0x2c3cca){return _0x2c3cca[_0x7384('0x22')](_0x599e65)[_0x7384('0x23')](function(_0x229268){return _0x229268;});}return null;};}function removeEntity(_0x5dcce7,_0x3d663f){return function(_0x4bc521){if(_0x4bc521){return _0x4bc521[_0x7384('0x24')]()[_0x7384('0x23')](function(){_0x5dcce7[_0x7384('0x18')](0xcc)[_0x7384('0x19')]();});}};}function handleEntityNotFound(_0x16f748,_0x192c7d){return function(_0x58e19f){if(!_0x58e19f){_0x16f748[_0x7384('0x17')](0x194);}return _0x58e19f;};}function handleError(_0x3f073d,_0x58c016){_0x58c016=_0x58c016||0x1f4;return function(_0x311fb0){logger[_0x7384('0x25')](_0x311fb0[_0x7384('0x26')]);if(_0x311fb0[_0x7384('0x27')]){delete _0x311fb0[_0x7384('0x27')];}_0x3f073d['status'](_0x58c016)[_0x7384('0x28')](_0x311fb0);};}exports['index']=function(_0x1a2bc1,_0x378cbc){var _0x5803e1={},_0x3ca4c5={},_0x177625={'count':0x0,'rows':[]};var _0x47344e=_[_0x7384('0x29')](db[_0x7384('0x2a')][_0x7384('0x2b')],function(_0xa8e3fa){return{'name':_0xa8e3fa['fieldName'],'type':_0xa8e3fa[_0x7384('0x2c')][_0x7384('0x2d')]};});_0x3ca4c5[_0x7384('0x2e')]=_[_0x7384('0x29')](_0x47344e,_0x7384('0x27'));_0x3ca4c5['query']=_['keys'](_0x1a2bc1[_0x7384('0x2f')]);_0x3ca4c5[_0x7384('0x30')]=_[_0x7384('0x31')](_0x3ca4c5[_0x7384('0x2e')],_0x3ca4c5[_0x7384('0x2f')]);_0x5803e1['attributes']=_[_0x7384('0x31')](_0x3ca4c5[_0x7384('0x2e')],qs[_0x7384('0x32')](_0x1a2bc1['query'][_0x7384('0x32')]));_0x5803e1[_0x7384('0x33')]=_0x5803e1['attributes'][_0x7384('0x34')]?_0x5803e1[_0x7384('0x33')]:_0x3ca4c5[_0x7384('0x2e')];if(!_0x1a2bc1[_0x7384('0x2f')]['hasOwnProperty'](_0x7384('0x35'))){_0x5803e1[_0x7384('0x1c')]=qs['limit'](_0x1a2bc1[_0x7384('0x2f')][_0x7384('0x1c')]);_0x5803e1[_0x7384('0x1e')]=qs[_0x7384('0x1e')](_0x1a2bc1[_0x7384('0x2f')][_0x7384('0x1e')]);}_0x5803e1[_0x7384('0x36')]=qs[_0x7384('0x37')](_0x1a2bc1['query'][_0x7384('0x37')]);_0x5803e1[_0x7384('0x38')]=qs[_0x7384('0x30')](_[_0x7384('0x39')](_0x1a2bc1[_0x7384('0x2f')],_0x3ca4c5['filters']),_0x47344e);if(_0x1a2bc1['query'][_0x7384('0x3a')]){_0x5803e1[_0x7384('0x38')]=_[_0x7384('0x3b')](_0x5803e1[_0x7384('0x38')],{'$or':_['map'](_0x47344e,function(_0x2e8b58){if(_0x2e8b58[_0x7384('0x2c')]!==_0x7384('0x3c')){var _0x17d408={};_0x17d408[_0x2e8b58[_0x7384('0x27')]]={'$like':'%'+_0x1a2bc1['query'][_0x7384('0x3a')]+'%'};return _0x17d408;}})});}_0x5803e1=_[_0x7384('0x3b')]({},_0x5803e1,_0x1a2bc1['options']);var _0x5056a7={'where':_0x5803e1['where']};return db[_0x7384('0x2a')][_0x7384('0x1d')](_0x5056a7)[_0x7384('0x23')](function(_0x12af0c){_0x177625[_0x7384('0x1d')]=_0x12af0c;if(_0x1a2bc1[_0x7384('0x2f')]['includeAll']){_0x5803e1[_0x7384('0x3d')]=[{'all':!![]}];}return db[_0x7384('0x2a')][_0x7384('0x3e')](_0x5803e1);})['then'](function(_0x1b8ef9){_0x177625['rows']=_0x1b8ef9;return _0x177625;})[_0x7384('0x23')](respondWithFilteredResult(_0x378cbc,_0x5803e1))[_0x7384('0x3f')](handleError(_0x378cbc,null));};exports['show']=function(_0x2240ef,_0x404289){var _0x12e9db={'raw':![],'where':{'id':_0x2240ef['params']['id']}},_0x47d3af={};_0x47d3af['model']=_[_0x7384('0x40')](db['UserProfileSection'][_0x7384('0x2b')]);_0x47d3af['query']=_['keys'](_0x2240ef['query']);_0x47d3af[_0x7384('0x30')]=_[_0x7384('0x31')](_0x47d3af['model'],_0x47d3af[_0x7384('0x2f')]);_0x12e9db[_0x7384('0x33')]=_[_0x7384('0x31')](_0x47d3af[_0x7384('0x2e')],qs[_0x7384('0x32')](_0x2240ef[_0x7384('0x2f')]['fields']));_0x12e9db[_0x7384('0x33')]=_0x12e9db[_0x7384('0x33')]['length']?_0x12e9db[_0x7384('0x33')]:_0x47d3af['model'];if(_0x2240ef['query'][_0x7384('0x41')]){_0x12e9db[_0x7384('0x3d')]=[{'all':!![]}];}_0x12e9db=_[_0x7384('0x3b')]({},_0x12e9db,_0x2240ef[_0x7384('0x42')]);return db[_0x7384('0x2a')][_0x7384('0x43')](_0x12e9db)[_0x7384('0x23')](handleEntityNotFound(_0x404289,null))[_0x7384('0x23')](respondWithResult(_0x404289,null))[_0x7384('0x3f')](handleError(_0x404289,null));};exports[_0x7384('0x44')]=function(_0x49f3f2,_0xcaadf9){return db[_0x7384('0x2a')]['create'](_0x49f3f2['body'],{})[_0x7384('0x23')](respondWithResult(_0xcaadf9,0xc9))[_0x7384('0x3f')](handleError(_0xcaadf9,null));};exports['update']=function(_0x534135,_0xce6e73){if(_0x534135['body']['id']){delete _0x534135[_0x7384('0x45')]['id'];}return db[_0x7384('0x2a')][_0x7384('0x43')]({'where':{'id':_0x534135['params']['id']}})[_0x7384('0x23')](handleEntityNotFound(_0xce6e73,null))[_0x7384('0x23')](saveUpdates(_0x534135[_0x7384('0x45')],null))[_0x7384('0x23')](respondWithResult(_0xce6e73,null))[_0x7384('0x3f')](handleError(_0xce6e73,null));};exports['destroy']=function(_0x5b1134,_0x3514ed){return db[_0x7384('0x2a')]['find']({'where':{'id':_0x5b1134[_0x7384('0x46')]['id']}})[_0x7384('0x23')](handleEntityNotFound(_0x3514ed,null))[_0x7384('0x23')](removeEntity(_0x3514ed,null))['catch'](handleError(_0x3514ed,null));};exports[_0x7384('0x47')]=function(_0xff58a4,_0x26c020){return db['UserProfileSection'][_0x7384('0x47')]()[_0x7384('0x23')](respondWithResult(_0x26c020,null))['catch'](handleError(_0x26c020,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 9f925b4..176e777 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 _0x8245=['define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x266033,_0x40acbd){var _0x3d856a=function(_0x20e512){while(--_0x20e512){_0x266033['push'](_0x266033['shift']());}};_0x3d856a(++_0x40acbd);}(_0x8245,0x127));var _0x5824=function(_0x48f5e9,_0x3d1963){_0x48f5e9=_0x48f5e9-0x0;var _0x481616=_0x8245[_0x48f5e9];return _0x481616;};'use strict';var _=require(_0x5824('0x0'));var util=require('util');var logger=require(_0x5824('0x1'))(_0x5824('0x2'));var moment=require(_0x5824('0x3'));var BPromise=require(_0x5824('0x4'));var rp=require(_0x5824('0x5'));var fs=require('fs');var path=require(_0x5824('0x6'));var rimraf=require(_0x5824('0x7'));var config=require(_0x5824('0x8'));var attributes=require(_0x5824('0x9'));module[_0x5824('0xa')]=function(_0x58c2de,_0x2d92e9){return _0x58c2de[_0x5824('0xb')](_0x5824('0xc'),attributes,{'tableName':_0x5824('0xd'),'paranoid':![],'indexes':[{'name':_0x5824('0xe'),'fields':[_0x5824('0xf'),_0x5824('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf688=['../../config/environment','exports','define','user_profile_has_sections','sectionId','userProfileId','lodash','util','api','moment','request-promise','path'];(function(_0x3276bc,_0x6ba4e4){var _0x35089f=function(_0x492907){while(--_0x492907){_0x3276bc['push'](_0x3276bc['shift']());}};_0x35089f(++_0x6ba4e4);}(_0xf688,0x1b6));var _0x8f68=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf688[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8f68('0x0'));var util=require(_0x8f68('0x1'));var logger=require('../../config/logger')(_0x8f68('0x2'));var moment=require(_0x8f68('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f68('0x4'));var fs=require('fs');var path=require(_0x8f68('0x5'));var rimraf=require('rimraf');var config=require(_0x8f68('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x8f68('0x7')]=function(_0x1d233c,_0x45c47b){return _0x1d233c[_0x8f68('0x8')]('UserProfileSection',attributes,{'tableName':_0x8f68('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x8f68('0xa'),_0x8f68('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 1aa4f42..1f8d394 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 _0x5d06=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0xf35bd4,_0x51ff64){var _0x47912b=function(_0x269818){while(--_0x269818){_0xf35bd4['push'](_0xf35bd4['shift']());}};_0x47912b(++_0x51ff64);}(_0x5d06,0x1b2));var _0x65d0=function(_0xdac7dd,_0x59f328){_0xdac7dd=_0xdac7dd-0x0;var _0xe73b94=_0x5d06[_0xdac7dd];return _0xe73b94;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x65d0('0x0'));var BPromise=require(_0x65d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65d0('0x2'))['db'];var utils=require(_0x65d0('0x3'));var logger=require(_0x65d0('0x4'))(_0x65d0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x65d0('0x6')][_0x65d0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x66aa3a,_0x2289b2,_0x31370b){return new BPromise(function(_0x814e4c,_0x5d471a){return client[_0x65d0('0x8')](_0x66aa3a,_0x31370b)[_0x65d0('0x9')](function(_0x21bd91){logger[_0x65d0('0xa')](_0x65d0('0xb'),_0x2289b2,_0x65d0('0xc'));logger[_0x65d0('0xd')](_0x65d0('0xe'),_0x2289b2,_0x65d0('0xc'),JSON[_0x65d0('0xf')](_0x21bd91));if(_0x21bd91[_0x65d0('0x10')]){if(_0x21bd91[_0x65d0('0x10')][_0x65d0('0x11')]===0x1f4){logger['error'](_0x65d0('0xb'),_0x2289b2,_0x21bd91[_0x65d0('0x10')][_0x65d0('0x12')]);return _0x5d471a(_0x21bd91['error']['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2289b2,_0x21bd91[_0x65d0('0x10')][_0x65d0('0x12')]);return _0x814e4c(_0x21bd91[_0x65d0('0x10')][_0x65d0('0x12')]);}else{logger[_0x65d0('0xa')](_0x65d0('0xb'),_0x2289b2,_0x65d0('0xc'));_0x814e4c(_0x21bd91[_0x65d0('0x13')][_0x65d0('0x12')]);}})[_0x65d0('0x14')](function(_0x5e57a5){logger['error'](_0x65d0('0xb'),_0x2289b2,_0x5e57a5);_0x5d471a(_0x5e57a5);});});} \ No newline at end of file +var _0x771a=['message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x771a,0x1e2));var _0xa771=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x771a[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xa771('0x0'));var util=require(_0xa771('0x1'));var moment=require(_0xa771('0x2'));var BPromise=require('bluebird');var rs=require(_0xa771('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa771('0x4'))['db'];var utils=require(_0xa771('0x5'));var logger=require(_0xa771('0x6'))(_0xa771('0x7'));var config=require(_0xa771('0x8'));var jayson=require(_0xa771('0x9'));var client=jayson[_0xa771('0xa')][_0xa771('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x569fc6,_0x332b81,_0x500a46){return new BPromise(function(_0x2fa1be,_0x2e40f9){return client[_0xa771('0xc')](_0x569fc6,_0x500a46)[_0xa771('0xd')](function(_0x55f301){logger[_0xa771('0xe')](_0xa771('0xf'),_0x332b81,'request\x20sent');logger[_0xa771('0x10')](_0xa771('0x11'),_0x332b81,_0xa771('0x12'),JSON[_0xa771('0x13')](_0x55f301));if(_0x55f301[_0xa771('0x14')]){if(_0x55f301[_0xa771('0x14')][_0xa771('0x15')]===0x1f4){logger[_0xa771('0x14')](_0xa771('0xf'),_0x332b81,_0x55f301[_0xa771('0x14')][_0xa771('0x16')]);return _0x2e40f9(_0x55f301[_0xa771('0x14')][_0xa771('0x16')]);}logger[_0xa771('0x14')](_0xa771('0xf'),_0x332b81,_0x55f301[_0xa771('0x14')][_0xa771('0x16')]);return _0x2fa1be(_0x55f301[_0xa771('0x14')][_0xa771('0x16')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x332b81,_0xa771('0x12'));_0x2fa1be(_0x55f301[_0xa771('0x17')][_0xa771('0x16')]);}})['catch'](function(_0x513e0a){logger['error'](_0xa771('0xf'),_0x332b81,_0x513e0a);_0x2e40f9(_0x513e0a);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index f1189a8..61a8482 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x19eccf,_0x53f863){var _0x33f4f3=function(_0x2067fa){while(--_0x2067fa){_0x19eccf['push'](_0x19eccf['shift']());}};_0x33f4f3(++_0x53f863);}(_0xe706,0xa3));var _0x6e70=function(_0x12fe24,_0x4061cd){_0x12fe24=_0x12fe24-0x0;var _0x309501=_0xe706[_0x12fe24];return _0x309501;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xaa0501,_0x43103a){var _0x2f01d3=function(_0x2f362b){while(--_0x2f362b){_0xaa0501['push'](_0xaa0501['shift']());}};_0x2f01d3(++_0x43103a);}(_0x70e0,0x17b));var _0x070e=function(_0x34914b,_0x1e6555){_0x34914b=_0x34914b-0x0;var _0x4cbee1=_0x70e0[_0x34914b];return _0x4cbee1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 3d58184..60a5cf7 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 _0x75fb=['exports','INTEGER','sequelize'];(function(_0x52ac84,_0xdae638){var _0x330000=function(_0x36b31f){while(--_0x36b31f){_0x52ac84['push'](_0x52ac84['shift']());}};_0x330000(++_0xdae638);}(_0x75fb,0x140));var _0xb75f=function(_0x3f10df,_0x3305ed){_0x3f10df=_0x3f10df-0x0;var _0x5bf83f=_0x75fb[_0x3f10df];return _0x5bf83f;};'use strict';var Sequelize=require(_0xb75f('0x0'));module[_0xb75f('0x1')]={'penalty':{'type':Sequelize[_0xb75f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf197=['exports','INTEGER'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf197,0x138));var _0x7f19=function(_0x4798a4,_0x272845){_0x4798a4=_0x4798a4-0x0;var _0x1bb642=_0xf197[_0x4798a4];return _0x1bb642;};'use strict';var Sequelize=require('sequelize');module[_0x7f19('0x0')]={'penalty':{'type':Sequelize[_0x7f19('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 4f2a72e..ec074a5 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 _0x7278=['define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x58143f,_0x3eeee9){var _0x19e659=function(_0x3bcb36){while(--_0x3bcb36){_0x58143f['push'](_0x58143f['shift']());}};_0x19e659(++_0x3eeee9);}(_0x7278,0x161));var _0x8727=function(_0x248872,_0x2def28){_0x248872=_0x248872-0x0;var _0x318ae7=_0x7278[_0x248872];return _0x318ae7;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['../../config/environment','exports','define','UserSmsQueue','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('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 874f445..c8ff6c5 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 _0xdc21=['moment','bluebird','../../mysqldb','../../config/logger','jayson/promise','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x39285d,_0x4e7c32){var _0x5b809b=function(_0x1c0b21){while(--_0x1c0b21){_0x39285d['push'](_0x39285d['shift']());}};_0x5b809b(++_0x4e7c32);}(_0xdc21,0xd7));var _0x1dc2=function(_0x171a17,_0x3b079d){_0x171a17=_0x171a17-0x0;var _0x1d4d5e=_0xdc21[_0x171a17];return _0x1d4d5e;};'use strict';var _=require('lodash');var util=require(_0x1dc2('0x0'));var moment=require(_0x1dc2('0x1'));var BPromise=require(_0x1dc2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dc2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1dc2('0x5'));var client=jayson['client'][_0x1dc2('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x10b8ef,_0x4afbb4,_0x24d2eb){return new BPromise(function(_0x51f59e,_0x573b12){return client[_0x1dc2('0x7')](_0x10b8ef,_0x24d2eb)['then'](function(_0xe37163){logger[_0x1dc2('0x8')](_0x1dc2('0x9'),_0x4afbb4,_0x1dc2('0xa'));logger[_0x1dc2('0xb')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x4afbb4,_0x1dc2('0xa'),JSON[_0x1dc2('0xc')](_0xe37163));if(_0xe37163[_0x1dc2('0xd')]){if(_0xe37163[_0x1dc2('0xd')][_0x1dc2('0xe')]===0x1f4){logger['error'](_0x1dc2('0x9'),_0x4afbb4,_0xe37163[_0x1dc2('0xd')]['message']);return _0x573b12(_0xe37163['error']['message']);}logger[_0x1dc2('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4afbb4,_0xe37163[_0x1dc2('0xd')][_0x1dc2('0xf')]);return _0x51f59e(_0xe37163[_0x1dc2('0xd')][_0x1dc2('0xf')]);}else{logger[_0x1dc2('0x8')](_0x1dc2('0x9'),_0x4afbb4,'request\x20sent');_0x51f59e(_0xe37163[_0x1dc2('0x10')][_0x1dc2('0xf')]);}})[_0x1dc2('0x11')](function(_0x1979b8){logger[_0x1dc2('0xd')](_0x1dc2('0x9'),_0x4afbb4,_0x1979b8);_0x573b12(_0x1979b8);});});} \ No newline at end of file +var _0x4d7c=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0xc877d4,_0x240b3e){var _0x4e851f=function(_0x289e77){while(--_0x289e77){_0xc877d4['push'](_0xc877d4['shift']());}};_0x4e851f(++_0x240b3e);}(_0x4d7c,0x150));var _0xc4d7=function(_0x35ae5d,_0x52912c){_0x35ae5d=_0x35ae5d-0x0;var _0x12f076=_0x4d7c[_0x35ae5d];return _0x12f076;};'use strict';var _=require(_0xc4d7('0x0'));var util=require('util');var moment=require(_0xc4d7('0x1'));var BPromise=require(_0xc4d7('0x2'));var rs=require(_0xc4d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4d7('0x4'))['db'];var utils=require(_0xc4d7('0x5'));var logger=require(_0xc4d7('0x6'))(_0xc4d7('0x7'));var config=require(_0xc4d7('0x8'));var jayson=require(_0xc4d7('0x9'));var client=jayson['client'][_0xc4d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29058b,_0x369088,_0x1ffe34){return new BPromise(function(_0x46b69d,_0x37203c){return client[_0xc4d7('0xb')](_0x29058b,_0x1ffe34)[_0xc4d7('0xc')](function(_0x5988a9){logger[_0xc4d7('0xd')](_0xc4d7('0xe'),_0x369088,_0xc4d7('0xf'));logger[_0xc4d7('0x10')](_0xc4d7('0x11'),_0x369088,_0xc4d7('0xf'),JSON[_0xc4d7('0x12')](_0x5988a9));if(_0x5988a9[_0xc4d7('0x13')]){if(_0x5988a9[_0xc4d7('0x13')][_0xc4d7('0x14')]===0x1f4){logger[_0xc4d7('0x13')](_0xc4d7('0xe'),_0x369088,_0x5988a9['error'][_0xc4d7('0x15')]);return _0x37203c(_0x5988a9[_0xc4d7('0x13')][_0xc4d7('0x15')]);}logger[_0xc4d7('0x13')](_0xc4d7('0xe'),_0x369088,_0x5988a9[_0xc4d7('0x13')][_0xc4d7('0x15')]);return _0x46b69d(_0x5988a9[_0xc4d7('0x13')][_0xc4d7('0x15')]);}else{logger[_0xc4d7('0xd')](_0xc4d7('0xe'),_0x369088,_0xc4d7('0xf'));_0x46b69d(_0x5988a9['result'][_0xc4d7('0x15')]);}})['catch'](function(_0x24c4f0){logger[_0xc4d7('0x13')](_0xc4d7('0xe'),_0x369088,_0x24c4f0);_0x37203c(_0x24c4f0);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 672949c..cd7cb65 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 _0xa571=['INTEGER','exports'];(function(_0x40aaeb,_0x4df561){var _0x20d5e0=function(_0x4d7d4e){while(--_0x4d7d4e){_0x40aaeb['push'](_0x40aaeb['shift']());}};_0x20d5e0(++_0x4df561);}(_0xa571,0x14b));var _0x1a57=function(_0x3aa0ab,_0x236a1b){_0x3aa0ab=_0x3aa0ab-0x0;var _0x58127d=_0xa571[_0x3aa0ab];return _0x58127d;};'use strict';var Sequelize=require('sequelize');module[_0x1a57('0x0')]={'UserId':{'type':Sequelize[_0x1a57('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x1a57('0x1')]}}; \ No newline at end of file +var _0x5a8b=['INTEGER','sequelize','exports'];(function(_0x3f652c,_0x38409f){var _0x13240d=function(_0x23992e){while(--_0x23992e){_0x3f652c['push'](_0x3f652c['shift']());}};_0x13240d(++_0x38409f);}(_0x5a8b,0x184));var _0xb5a8=function(_0x347672,_0x204a29){_0x347672=_0x347672-0x0;var _0x15baf6=_0x5a8b[_0x347672];return _0x15baf6;};'use strict';var Sequelize=require(_0xb5a8('0x0'));module[_0xb5a8('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb5a8('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 64d4ca8..972d86c 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(_0x4fe725,_0x31cd17){var _0x232411=function(_0x14ae2c){while(--_0x14ae2c){_0x4fe725['push'](_0x4fe725['shift']());}};_0x232411(++_0x31cd17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x2cbb86,_0x2770b9){var _0x26caf7=function(_0x4badbe){while(--_0x4badbe){_0x2cbb86['push'](_0x2cbb86['shift']());}};_0x26caf7(++_0x2770b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 5fa336d..dc46b85 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1e8aa9,_0x589c35){var _0x41237f=function(_0x45f474){while(--_0x45f474){_0x1e8aa9['push'](_0x1e8aa9['shift']());}};_0x41237f(++_0x589c35);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xe49a57,_0x564f3c){var _0x54b695=function(_0x29b00a){while(--_0x29b00a){_0xe49a57['push'](_0xe49a57['shift']());}};_0x54b695(++_0x564f3c);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 35518b9..0c10f2e 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 _0x406e=['sequelize'];(function(_0x320e1c,_0x13f38e){var _0x12a6b6=function(_0x568801){while(--_0x568801){_0x320e1c['push'](_0x320e1c['shift']());}};_0x12a6b6(++_0x13f38e);}(_0x406e,0xab));var _0xe406=function(_0x247792,_0x582fff){_0x247792=_0x247792-0x0;var _0x3cfc3d=_0x406e[_0x247792];return _0x3cfc3d;};'use strict';var Sequelize=require(_0xe406('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7e69=['sequelize','INTEGER'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x7e69,0x1b8));var _0x97e6=function(_0x42f687,_0x558724){_0x42f687=_0x42f687-0x0;var _0x108838=_0x7e69[_0x42f687];return _0x108838;};'use strict';var Sequelize=require(_0x97e6('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x97e6('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index ab4c579..abe21a2 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 _0xf25b=['moment','request-promise','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x440ba5,_0x573515){var _0x218106=function(_0x1b9eb6){while(--_0x1b9eb6){_0x440ba5['push'](_0x440ba5['shift']());}};_0x218106(++_0x573515);}(_0xf25b,0x125));var _0xbf25=function(_0x42139b,_0x4e959e){_0x42139b=_0x42139b-0x0;var _0x3779b3=_0xf25b[_0x42139b];return _0x3779b3;};'use strict';var _=require(_0xbf25('0x0'));var util=require(_0xbf25('0x1'));var logger=require(_0xbf25('0x2'))(_0xbf25('0x3'));var moment=require(_0xbf25('0x4'));var BPromise=require('bluebird');var rp=require(_0xbf25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf25('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf25('0x7'));module['exports']=function(_0x3dd579,_0x46a032){return _0x3dd579[_0xbf25('0x8')](_0xbf25('0x9'),attributes,{'tableName':_0xbf25('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ac5=['path','../../config/environment','define','UserVoiceQueue','user_has_voice_queues','util','api','moment','bluebird','request-promise'];(function(_0x30e616,_0x54d51f){var _0x33895b=function(_0x5d2958){while(--_0x5d2958){_0x30e616['push'](_0x30e616['shift']());}};_0x33895b(++_0x54d51f);}(_0x8ac5,0x109));var _0x58ac=function(_0xb3ca4a,_0x1cc12e){_0xb3ca4a=_0xb3ca4a-0x0;var _0x350ef4=_0x8ac5[_0xb3ca4a];return _0x350ef4;};'use strict';var _=require('lodash');var util=require(_0x58ac('0x0'));var logger=require('../../config/logger')(_0x58ac('0x1'));var moment=require(_0x58ac('0x2'));var BPromise=require(_0x58ac('0x3'));var rp=require(_0x58ac('0x4'));var fs=require('fs');var path=require(_0x58ac('0x5'));var rimraf=require('rimraf');var config=require(_0x58ac('0x6'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x1500e8,_0x5e8279){return _0x1500e8[_0x58ac('0x7')](_0x58ac('0x8'),attributes,{'tableName':_0x58ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 015cfe4..508f7d7 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 _0x9f7e=['http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x323d3a,_0x325482){var _0x24847a=function(_0x9b0376){while(--_0x9b0376){_0x323d3a['push'](_0x323d3a['shift']());}};_0x24847a(++_0x325482);}(_0x9f7e,0x1ee));var _0xe9f7=function(_0x52852f,_0x1aef29){_0x52852f=_0x52852f-0x0;var _0x22cda2=_0x9f7e[_0x52852f];return _0x22cda2;};'use strict';var _=require(_0xe9f7('0x0'));var util=require(_0xe9f7('0x1'));var moment=require(_0xe9f7('0x2'));var BPromise=require(_0xe9f7('0x3'));var rs=require(_0xe9f7('0x4'));var fs=require('fs');var Redis=require(_0xe9f7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9f7('0x6'))(_0xe9f7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe9f7('0x8'));var client=jayson[_0xe9f7('0x9')][_0xe9f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xed9f03,_0x172775,_0x170bde){return new BPromise(function(_0x47e931,_0x4f64be){return client[_0xe9f7('0xb')](_0xed9f03,_0x170bde)['then'](function(_0x4ea011){logger['info'](_0xe9f7('0xc'),_0x172775,_0xe9f7('0xd'));logger['debug'](_0xe9f7('0xe'),_0x172775,_0xe9f7('0xd'),JSON[_0xe9f7('0xf')](_0x4ea011));if(_0x4ea011[_0xe9f7('0x10')]){if(_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x11')]===0x1f4){logger[_0xe9f7('0x10')](_0xe9f7('0xc'),_0x172775,_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x12')]);return _0x4f64be(_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x12')]);}logger['error'](_0xe9f7('0xc'),_0x172775,_0x4ea011[_0xe9f7('0x10')]['message']);return _0x47e931(_0x4ea011[_0xe9f7('0x10')][_0xe9f7('0x12')]);}else{logger[_0xe9f7('0x13')](_0xe9f7('0xc'),_0x172775,'request\x20sent');_0x47e931(_0x4ea011['result'][_0xe9f7('0x12')]);}})[_0xe9f7('0x14')](function(_0x364123){logger['error'](_0xe9f7('0xc'),_0x172775,_0x364123);_0x4f64be(_0x364123);});});} \ No newline at end of file +var _0xcfc5=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info'];(function(_0x31b57a,_0x3dddf3){var _0x2df3dd=function(_0x394522){while(--_0x394522){_0x31b57a['push'](_0x31b57a['shift']());}};_0x2df3dd(++_0x3dddf3);}(_0xcfc5,0x159));var _0x5cfc=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xcfc5[_0x67f95e];return _0x538f5a;};'use strict';var _=require(_0x5cfc('0x0'));var util=require(_0x5cfc('0x1'));var moment=require(_0x5cfc('0x2'));var BPromise=require('bluebird');var rs=require(_0x5cfc('0x3'));var fs=require('fs');var Redis=require(_0x5cfc('0x4'));var db=require(_0x5cfc('0x5'))['db'];var utils=require(_0x5cfc('0x6'));var logger=require(_0x5cfc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5cfc('0x8'));var client=jayson[_0x5cfc('0x9')][_0x5cfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7c21d5,_0x2132d8,_0x56da8a){return new BPromise(function(_0x3c03c1,_0x10ef22){return client['request'](_0x7c21d5,_0x56da8a)['then'](function(_0x2e63f6){logger[_0x5cfc('0xb')](_0x5cfc('0xc'),_0x2132d8,_0x5cfc('0xd'));logger['debug'](_0x5cfc('0xe'),_0x2132d8,_0x5cfc('0xd'),JSON[_0x5cfc('0xf')](_0x2e63f6));if(_0x2e63f6['error']){if(_0x2e63f6[_0x5cfc('0x10')][_0x5cfc('0x11')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x2132d8,_0x2e63f6[_0x5cfc('0x10')][_0x5cfc('0x12')]);return _0x10ef22(_0x2e63f6[_0x5cfc('0x10')][_0x5cfc('0x12')]);}logger['error'](_0x5cfc('0xc'),_0x2132d8,_0x2e63f6[_0x5cfc('0x10')][_0x5cfc('0x12')]);return _0x3c03c1(_0x2e63f6['error'][_0x5cfc('0x12')]);}else{logger[_0x5cfc('0xb')](_0x5cfc('0xc'),_0x2132d8,_0x5cfc('0xd'));_0x3c03c1(_0x2e63f6[_0x5cfc('0x13')][_0x5cfc('0x12')]);}})[_0x5cfc('0x14')](function(_0x112b11){logger[_0x5cfc('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x2132d8,_0x112b11);_0x10ef22(_0x112b11);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 477141b..d128763 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x199928,_0x4261ba){var _0x1bdbcc=function(_0x24616d){while(--_0x24616d){_0x199928['push'](_0x199928['shift']());}};_0x1bdbcc(++_0x4261ba);}(_0x70e0,0x17b));var _0x070e=function(_0x197d53,_0x201a20){_0x197d53=_0x197d53-0x0;var _0x22620d=_0x70e0[_0x197d53];return _0x22620d;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17f810,_0x42ae0d){var _0x5988a2=function(_0x1f6c75){while(--_0x1f6c75){_0x17f810['push'](_0x17f810['shift']());}};_0x5988a2(++_0x42ae0d);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index f9381a1..b4c1b16 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 _0x626d=['queue_interface','Required\x20by\x20Asterisk','sequelize','STRING','INTEGER'];(function(_0x533bf7,_0x29485b){var _0x9e4c57=function(_0xe4211f){while(--_0xe4211f){_0x533bf7['push'](_0x533bf7['shift']());}};_0x9e4c57(++_0x29485b);}(_0x626d,0x89));var _0xd626=function(_0x4a400b,_0x330140){_0x4a400b=_0x4a400b-0x0;var _0xe992b6=_0x626d[_0x4a400b];return _0xe992b6;};'use strict';var Sequelize=require(_0xd626('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xd626('0x1')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xd626('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd626('0x1')],'allowNull':![],'unique':_0xd626('0x3'),'comment':_0xd626('0x4')},'VoiceQueueId':{'type':Sequelize[_0xd626('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd626('0x3'),'comment':_0xd626('0x4')},'penalty':{'type':Sequelize[_0xd626('0x2')](0xb),'defaultValue':0x0,'comment':_0xd626('0x4')},'paused':{'type':Sequelize[_0xd626('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xb145=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xb145,0x168));var _0x5b14=function(_0x14b608,_0x295d9b){_0x14b608=_0x14b608-0x0;var _0x50d4ee=_0xb145[_0x14b608];return _0x50d4ee;};'use strict';var Sequelize=require(_0x5b14('0x0'));module[_0x5b14('0x1')]={'uniqueid':{'type':Sequelize[_0x5b14('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x5b14('0x3')},'UserId':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x5b14('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x5b14('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x5b14('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x5b14('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x5b14('0x2')](0xb),'defaultValue':0x0,'comment':_0x5b14('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index def19f7..718e3ce 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 _0x3625=['events','../../mysqldb','setMaxListeners','remove','hook'];(function(_0x358b6b,_0x120a51){var _0x2237f4=function(_0x17184b){while(--_0x17184b){_0x358b6b['push'](_0x358b6b['shift']());}};_0x2237f4(++_0x120a51);}(_0x3625,0x131));var _0x5362=function(_0x246055,_0x439e28){_0x246055=_0x246055-0x0;var _0x14a40f=_0x3625[_0x246055];return _0x14a40f;};'use strict';var EventEmitter=require(_0x5362('0x0'));var UserVoiceQueueRt=require(_0x5362('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5362('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5362('0x3')};function emitEvent(_0x4dae54){return function(_0x108dc1,_0x4610af,_0x49308d){UserVoiceQueueRtEvents['emit'](_0x4dae54+':'+_0x108dc1['id'],_0x108dc1);UserVoiceQueueRtEvents['emit'](_0x4dae54,_0x108dc1);_0x49308d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x5362('0x4')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x1cc5=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x4070b9,_0x346c53){var _0x2d35ae=function(_0x479b1c){while(--_0x479b1c){_0x4070b9['push'](_0x4070b9['shift']());}};_0x2d35ae(++_0x346c53);}(_0x1cc5,0x1b6));var _0x51cc=function(_0x1ee04b,_0x554b3d){_0x1ee04b=_0x1ee04b-0x0;var _0x412848=_0x1cc5[_0x1ee04b];return _0x412848;};'use strict';var EventEmitter=require(_0x51cc('0x0'));var UserVoiceQueueRt=require(_0x51cc('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x51cc('0x2')](0x0);var events={'afterCreate':_0x51cc('0x3'),'afterUpdate':_0x51cc('0x4'),'afterDestroy':_0x51cc('0x5')};function emitEvent(_0x9d22ba){return function(_0x398305,_0x40528a,_0x5af8f3){UserVoiceQueueRtEvents[_0x51cc('0x6')](_0x9d22ba+':'+_0x398305['id'],_0x398305);UserVoiceQueueRtEvents[_0x51cc('0x6')](_0x9d22ba,_0x398305);_0x5af8f3(null);};}for(var e in events){if(events[_0x51cc('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x51cc('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 62600f2..4e3d284 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 _0x42fe=['moment','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','../../config/logger','api'];(function(_0x1befd8,_0x243e88){var _0x112308=function(_0x328d47){while(--_0x328d47){_0x1befd8['push'](_0x1befd8['shift']());}};_0x112308(++_0x243e88);}(_0x42fe,0xc3));var _0xe42f=function(_0x3c9fcf,_0x4f639f){_0x3c9fcf=_0x3c9fcf-0x0;var _0x26d6a5=_0x42fe[_0x3c9fcf];return _0x26d6a5;};'use strict';var _=require(_0xe42f('0x0'));var util=require('util');var logger=require(_0xe42f('0x1'))(_0xe42f('0x2'));var moment=require(_0xe42f('0x3'));var BPromise=require('bluebird');var rp=require(_0xe42f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe42f('0x5'));var config=require(_0xe42f('0x6'));var attributes=require(_0xe42f('0x7'));module[_0xe42f('0x8')]=function(_0x3b925a,_0x13e9bb){return _0x3b925a[_0xe42f('0x9')](_0xe42f('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x839e=['api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger'];(function(_0x25a305,_0x5dc876){var _0x1cf26a=function(_0x129f10){while(--_0x129f10){_0x25a305['push'](_0x25a305['shift']());}};_0x1cf26a(++_0x5dc876);}(_0x839e,0x73));var _0xe839=function(_0x46939d,_0xc1b36d){_0x46939d=_0x46939d-0x0;var _0x5105e8=_0x839e[_0x46939d];return _0x5105e8;};'use strict';var _=require(_0xe839('0x0'));var util=require('util');var logger=require(_0xe839('0x1'))(_0xe839('0x2'));var moment=require(_0xe839('0x3'));var BPromise=require(_0xe839('0x4'));var rp=require(_0xe839('0x5'));var fs=require('fs');var path=require(_0xe839('0x6'));var rimraf=require('rimraf');var config=require(_0xe839('0x7'));var attributes=require(_0xe839('0x8'));module[_0xe839('0x9')]=function(_0x4283d8,_0x36c740){return _0x4283d8[_0xe839('0xa')](_0xe839('0xb'),attributes,{'tableName':_0xe839('0xc'),'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 c384982..3a4fd49 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 _0x3c4e=['jayson/promise','client','defaults','redis','localhost','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x3c4e,0xb5));var _0xe3c4=function(_0x21fe11,_0x52f846){_0x21fe11=_0x21fe11-0x0;var _0x5eb704=_0x3c4e[_0x21fe11];return _0x5eb704;};'use strict';var _=require('lodash');var util=require(_0xe3c4('0x0'));var moment=require(_0xe3c4('0x1'));var BPromise=require(_0xe3c4('0x2'));var rs=require(_0xe3c4('0x3'));var fs=require('fs');var Redis=require(_0xe3c4('0x4'));var db=require(_0xe3c4('0x5'))['db'];var utils=require(_0xe3c4('0x6'));var logger=require('../../config/logger')(_0xe3c4('0x7'));var config=require(_0xe3c4('0x8'));var jayson=require(_0xe3c4('0x9'));var client=jayson[_0xe3c4('0xa')]['http']({'port':0x232a});config['redis']=_[_0xe3c4('0xb')](config[_0xe3c4('0xc')],{'host':_0xe3c4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe3c4('0xe'))[_0xe3c4('0xf')](socket);function respondWithRpcPromise(_0x31fb05,_0x36e458,_0x4df7b1){return new BPromise(function(_0x2c5a90,_0x225334){return client['request'](_0x31fb05,_0x4df7b1)[_0xe3c4('0x10')](function(_0x413cee){logger[_0xe3c4('0x11')](_0xe3c4('0x12'),_0x36e458,'request\x20sent');logger[_0xe3c4('0x13')](_0xe3c4('0x14'),_0x36e458,'request\x20sent',JSON[_0xe3c4('0x15')](_0x413cee));if(_0x413cee['error']){if(_0x413cee[_0xe3c4('0x16')][_0xe3c4('0x17')]===0x1f4){logger[_0xe3c4('0x16')](_0xe3c4('0x12'),_0x36e458,_0x413cee['error'][_0xe3c4('0x18')]);return _0x225334(_0x413cee['error'][_0xe3c4('0x18')]);}logger[_0xe3c4('0x16')](_0xe3c4('0x12'),_0x36e458,_0x413cee[_0xe3c4('0x16')][_0xe3c4('0x18')]);return _0x2c5a90(_0x413cee[_0xe3c4('0x16')][_0xe3c4('0x18')]);}else{logger['info'](_0xe3c4('0x12'),_0x36e458,_0xe3c4('0x19'));_0x2c5a90(_0x413cee[_0xe3c4('0x1a')][_0xe3c4('0x18')]);}})[_0xe3c4('0x1b')](function(_0x257a2c){logger['error'](_0xe3c4('0x12'),_0x36e458,_0x257a2c);_0x225334(_0x257a2c);});});}exports[_0xe3c4('0x1c')]=function(_0x4b9c2e){var _0x583a96=this;return new Promise(function(_0x314cc1,_0x24c9bb){return db[_0xe3c4('0x1d')][_0xe3c4('0x1e')]({'raw':_0x4b9c2e[_0xe3c4('0x1f')]?_0x4b9c2e['options'][_0xe3c4('0x20')]===undefined?!![]:![]:!![],'where':_0x4b9c2e[_0xe3c4('0x1f')]?_0x4b9c2e[_0xe3c4('0x1f')][_0xe3c4('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xe3c4('0x22')]['fn']('IF',db[_0xe3c4('0x22')][_0xe3c4('0x23')](_0xe3c4('0x24')))),_0xe3c4('0x25')]]})[_0xe3c4('0x10')](function(_0x37742f){logger[_0xe3c4('0x11')](_0xe3c4('0x1c'),_0x4b9c2e);logger[_0xe3c4('0x13')](_0xe3c4('0x1c'),_0x4b9c2e,JSON[_0xe3c4('0x15')](_0x37742f));_0x314cc1(_0x37742f);})[_0xe3c4('0x1b')](function(_0x374dee){logger[_0xe3c4('0x16')](_0xe3c4('0x1c'),_0x374dee['message'],_0x4b9c2e);_0x24c9bb(_0x583a96[_0xe3c4('0x16')](0x1f4,_0x374dee[_0xe3c4('0x18')]));});});}; \ No newline at end of file +var _0x60c5=['result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1a0207,_0x4cef7c){var _0x8ae464=function(_0x2ce5c1){while(--_0x2ce5c1){_0x1a0207['push'](_0x1a0207['shift']());}};_0x8ae464(++_0x4cef7c);}(_0x60c5,0x14d));var _0x560c=function(_0x4cb8f4,_0x4b4467){_0x4cb8f4=_0x4cb8f4-0x0;var _0x466fad=_0x60c5[_0x4cb8f4];return _0x466fad;};'use strict';var _=require(_0x560c('0x0'));var util=require(_0x560c('0x1'));var moment=require(_0x560c('0x2'));var BPromise=require(_0x560c('0x3'));var rs=require(_0x560c('0x4'));var fs=require('fs');var Redis=require(_0x560c('0x5'));var db=require(_0x560c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x560c('0x7'))(_0x560c('0x8'));var config=require(_0x560c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x560c('0xa')]['http']({'port':0x232a});config[_0x560c('0xb')]=_[_0x560c('0xc')](config[_0x560c('0xb')],{'host':_0x560c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x560c('0xe'))[_0x560c('0xf')](socket);function respondWithRpcPromise(_0x17efcd,_0x4ada78,_0xec7969){return new BPromise(function(_0x157f01,_0x56046e){return client[_0x560c('0x10')](_0x17efcd,_0xec7969)[_0x560c('0x11')](function(_0xc265be){logger[_0x560c('0x12')](_0x560c('0x13'),_0x4ada78,_0x560c('0x14'));logger[_0x560c('0x15')](_0x560c('0x16'),_0x4ada78,'request\x20sent',JSON[_0x560c('0x17')](_0xc265be));if(_0xc265be[_0x560c('0x18')]){if(_0xc265be[_0x560c('0x18')][_0x560c('0x19')]===0x1f4){logger['error'](_0x560c('0x13'),_0x4ada78,_0xc265be['error'][_0x560c('0x1a')]);return _0x56046e(_0xc265be[_0x560c('0x18')]['message']);}logger[_0x560c('0x18')](_0x560c('0x13'),_0x4ada78,_0xc265be[_0x560c('0x18')][_0x560c('0x1a')]);return _0x157f01(_0xc265be['error'][_0x560c('0x1a')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4ada78,_0x560c('0x14'));_0x157f01(_0xc265be[_0x560c('0x1b')][_0x560c('0x1a')]);}})[_0x560c('0x1c')](function(_0x10a3b4){logger[_0x560c('0x18')](_0x560c('0x13'),_0x4ada78,_0x10a3b4);_0x56046e(_0x10a3b4);});});}exports[_0x560c('0x1d')]=function(_0x14d4fc){var _0xedcf36=this;return new Promise(function(_0x40ba94,_0x3a29d2){return db[_0x560c('0x1e')][_0x560c('0x1f')]({'raw':_0x14d4fc[_0x560c('0x20')]?_0x14d4fc[_0x560c('0x20')][_0x560c('0x21')]===undefined?!![]:![]:!![],'where':_0x14d4fc[_0x560c('0x20')]?_0x14d4fc['options'][_0x560c('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0x560c('0x23'),db[_0x560c('0x24')]['fn']('IF',db['sequelize'][_0x560c('0x25')](_0x560c('0x26')))),_0x560c('0x27')]]})[_0x560c('0x11')](function(_0xe3d5cf){logger[_0x560c('0x12')](_0x560c('0x1d'),_0x14d4fc);logger['debug'](_0x560c('0x1d'),_0x14d4fc,JSON[_0x560c('0x17')](_0xe3d5cf));_0x40ba94(_0xe3d5cf);})[_0x560c('0x1c')](function(_0x41ec6f){logger['error']('GetVoiceQueueRtPauses',_0x41ec6f[_0x560c('0x1a')],_0x14d4fc);_0x3a29d2(_0xedcf36[_0x560c('0x18')](0x1f4,_0x41ec6f[_0x560c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index e3f0968..9c00686 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 _0x4819=['length','userVoiceQueueRt:','save','remove','update','emit','removeListener'];(function(_0xdc616b,_0xa83725){var _0x1d97b2=function(_0x307cff){while(--_0x307cff){_0xdc616b['push'](_0xdc616b['shift']());}};_0x1d97b2(++_0xa83725);}(_0x4819,0xcd));var _0x9481=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x4819[_0x3ce2c4];return _0x4047c1;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x9481('0x0'),_0x9481('0x1'),_0x9481('0x2')];function createListener(_0x12a70c,_0x273a32){return function(_0xfb4034){_0x273a32[_0x9481('0x3')](_0x12a70c,_0xfb4034);};}function removeListener(_0x14dc10,_0xc39edf){return function(){UserVoiceQueueRtEvents[_0x9481('0x4')](_0x14dc10,_0xc39edf);};}exports['register']=function(_0x4d9e3a){for(var _0x5def07=0x0,_0x54cc78=events[_0x9481('0x5')];_0x5def07<_0x54cc78;_0x5def07++){var _0x6c6a08=events[_0x5def07];var _0x27c033=createListener(_0x9481('0x6')+_0x6c6a08,_0x4d9e3a);UserVoiceQueueRtEvents['on'](_0x6c6a08,_0x27c033);}}; \ No newline at end of file +var _0xb715=['update','userVoiceQueueRt:','save'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0xb715,0x16d));var _0x5b71=function(_0x56c376,_0xf783e7){_0x56c376=_0x56c376-0x0;var _0x392f4d=_0xb715[_0x56c376];return _0x392f4d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x5b71('0x0'),'remove',_0x5b71('0x1')];function createListener(_0x142fff,_0x56f938){return function(_0x2ebf52){_0x56f938['emit'](_0x142fff,_0x2ebf52);};}function removeListener(_0x163202,_0x1a6819){return function(){UserVoiceQueueRtEvents['removeListener'](_0x163202,_0x1a6819);};}exports['register']=function(_0x887674){for(var _0x2a2950=0x0,_0x5a66fa=events['length'];_0x2a2950<_0x5a66fa;_0x2a2950++){var _0x4f1d28=events[_0x2a2950];var _0x37c945=createListener(_0x5b71('0x2')+_0x4f1d28,_0x887674);UserVoiceQueueRtEvents['on'](_0x4f1d28,_0x37c945);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d7dc6f9..ee70303 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x45bee0,_0x42bf09){var _0x1fcfd5=function(_0x235b6a){while(--_0x235b6a){_0x45bee0['push'](_0x45bee0['shift']());}};_0x1fcfd5(++_0x42bf09);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2cb1df,_0x4b439c){var _0x30e674=function(_0x532f8b){while(--_0x532f8b){_0x2cb1df['push'](_0x2cb1df['shift']());}};_0x30e674(++_0x4b439c);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index b5b865e..846a5f9 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 _0x2942=['sequelize','exports','INTEGER'];(function(_0x2f6cee,_0x35436e){var _0x12428c=function(_0x3100d5){while(--_0x3100d5){_0x2f6cee['push'](_0x2f6cee['shift']());}};_0x12428c(++_0x35436e);}(_0x2942,0x15f));var _0x2294=function(_0x41d406,_0x5294e6){_0x41d406=_0x41d406-0x0;var _0x170a28=_0x2942[_0x41d406];return _0x170a28;};'use strict';var Sequelize=require(_0x2294('0x0'));module[_0x2294('0x1')]={'penalty':{'type':Sequelize[_0x2294('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xad37=['INTEGER','sequelize','exports'];(function(_0xd87732,_0x10ef4a){var _0x36ec28=function(_0x49e14b){while(--_0x49e14b){_0xd87732['push'](_0xd87732['shift']());}};_0x36ec28(++_0x10ef4a);}(_0xad37,0xaf));var _0x7ad3=function(_0x376d23,_0x1488c1){_0x376d23=_0x376d23-0x0;var _0x5ab8d8=_0xad37[_0x376d23];return _0x5ab8d8;};'use strict';var Sequelize=require(_0x7ad3('0x0'));module[_0x7ad3('0x1')]={'penalty':{'type':Sequelize[_0x7ad3('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index fd5fdc4..9c8a110 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 _0x9d83=['exports','define','UserWhatsappQueue','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x478f24,_0x4ec986){var _0x28c420=function(_0x382bb3){while(--_0x382bb3){_0x478f24['push'](_0x478f24['shift']());}};_0x28c420(++_0x4ec986);}(_0x9d83,0xb7));var _0x39d8=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x9d83[_0x3b7a0c];return _0x3bb70f;};'use strict';var _=require(_0x39d8('0x0'));var util=require('util');var logger=require(_0x39d8('0x1'))(_0x39d8('0x2'));var moment=require(_0x39d8('0x3'));var BPromise=require(_0x39d8('0x4'));var rp=require(_0x39d8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x39d8('0x6')]=function(_0x243fd3,_0x370a9d){return _0x243fd3[_0x39d8('0x7')](_0x39d8('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe44b=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x1e3a7f,_0x1341a8){var _0x2201db=function(_0x2264b5){while(--_0x2264b5){_0x1e3a7f['push'](_0x1e3a7f['shift']());}};_0x2201db(++_0x1341a8);}(_0xe44b,0x142));var _0xbe44=function(_0x194d61,_0x2a1696){_0x194d61=_0x194d61-0x0;var _0x16c05b=_0xe44b[_0x194d61];return _0x16c05b;};'use strict';var _=require(_0xbe44('0x0'));var util=require(_0xbe44('0x1'));var logger=require(_0xbe44('0x2'))(_0xbe44('0x3'));var moment=require(_0xbe44('0x4'));var BPromise=require('bluebird');var rp=require(_0xbe44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe44('0x6'));var attributes=require(_0xbe44('0x7'));module['exports']=function(_0x497eab,_0x1ec95c){return _0x497eab['define'](_0xbe44('0x8'),attributes,{'tableName':_0xbe44('0x9'),'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 754696c..9cdc01a 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 _0x83b2=['../../mysqldb','rpc','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x36db65,_0x2b4af1){var _0x5bea6a=function(_0x513889){while(--_0x513889){_0x36db65['push'](_0x36db65['shift']());}};_0x5bea6a(++_0x2b4af1);}(_0x83b2,0x15b));var _0x283b=function(_0x57129e,_0x41adc0){_0x57129e=_0x57129e-0x0;var _0x313a42=_0x83b2[_0x57129e];return _0x313a42;};'use strict';var _=require('lodash');var util=require(_0x283b('0x0'));var moment=require(_0x283b('0x1'));var BPromise=require(_0x283b('0x2'));var rs=require(_0x283b('0x3'));var fs=require('fs');var Redis=require(_0x283b('0x4'));var db=require(_0x283b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x283b('0x6'));var config=require('../../config/environment');var jayson=require(_0x283b('0x7'));var client=jayson[_0x283b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x527c8e,_0x2cebfb,_0x1a2a57){return new BPromise(function(_0x3cc705,_0x14c784){return client[_0x283b('0x9')](_0x527c8e,_0x1a2a57)[_0x283b('0xa')](function(_0x1d35e4){logger[_0x283b('0xb')](_0x283b('0xc'),_0x2cebfb,_0x283b('0xd'));logger[_0x283b('0xe')](_0x283b('0xf'),_0x2cebfb,_0x283b('0xd'),JSON[_0x283b('0x10')](_0x1d35e4));if(_0x1d35e4['error']){if(_0x1d35e4['error'][_0x283b('0x11')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2cebfb,_0x1d35e4[_0x283b('0x12')][_0x283b('0x13')]);return _0x14c784(_0x1d35e4['error'][_0x283b('0x13')]);}logger[_0x283b('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2cebfb,_0x1d35e4[_0x283b('0x12')][_0x283b('0x13')]);return _0x3cc705(_0x1d35e4[_0x283b('0x12')]['message']);}else{logger[_0x283b('0xb')](_0x283b('0xc'),_0x2cebfb,_0x283b('0xd'));_0x3cc705(_0x1d35e4[_0x283b('0x14')][_0x283b('0x13')]);}})[_0x283b('0x15')](function(_0x3bfda8){logger[_0x283b('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2cebfb,_0x3bfda8);_0x14c784(_0x3bfda8);});});} \ No newline at end of file +var _0xb348=['ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x34c525,_0x5a24f9){var _0x15a9a2=function(_0x33c3ae){while(--_0x33c3ae){_0x34c525['push'](_0x34c525['shift']());}};_0x15a9a2(++_0x5a24f9);}(_0xb348,0xb0));var _0x8b34=function(_0x1e27b2,_0x2abc02){_0x1e27b2=_0x1e27b2-0x0;var _0x2f8696=_0xb348[_0x1e27b2];return _0x2f8696;};'use strict';var _=require(_0x8b34('0x0'));var util=require('util');var moment=require(_0x8b34('0x1'));var BPromise=require(_0x8b34('0x2'));var rs=require(_0x8b34('0x3'));var fs=require('fs');var Redis=require(_0x8b34('0x4'));var db=require(_0x8b34('0x5'))['db'];var utils=require(_0x8b34('0x6'));var logger=require(_0x8b34('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b34('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fda2f,_0x558c7f,_0x37f307){return new BPromise(function(_0x1c7982,_0x111ebe){return client[_0x8b34('0x9')](_0x3fda2f,_0x37f307)[_0x8b34('0xa')](function(_0x479696){logger['info'](_0x8b34('0xb'),_0x558c7f,'request\x20sent');logger['debug'](_0x8b34('0xc'),_0x558c7f,_0x8b34('0xd'),JSON[_0x8b34('0xe')](_0x479696));if(_0x479696[_0x8b34('0xf')]){if(_0x479696['error']['code']===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x558c7f,_0x479696[_0x8b34('0xf')][_0x8b34('0x10')]);return _0x111ebe(_0x479696[_0x8b34('0xf')]['message']);}logger[_0x8b34('0xf')](_0x8b34('0xb'),_0x558c7f,_0x479696[_0x8b34('0xf')][_0x8b34('0x10')]);return _0x1c7982(_0x479696[_0x8b34('0xf')]['message']);}else{logger[_0x8b34('0x11')](_0x8b34('0xb'),_0x558c7f,_0x8b34('0xd'));_0x1c7982(_0x479696[_0x8b34('0x12')][_0x8b34('0x10')]);}})[_0x8b34('0x13')](function(_0x21eec2){logger[_0x8b34('0xf')](_0x8b34('0xb'),_0x558c7f,_0x21eec2);_0x111ebe(_0x21eec2);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ef50b1c..81b04f3 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 _0x455d=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy'];(function(_0x456d15,_0x317a52){var _0x329e41=function(_0x39ea29){while(--_0x39ea29){_0x456d15['push'](_0x456d15['shift']());}};_0x329e41(++_0x317a52);}(_0x455d,0x190));var _0xd455=function(_0x566f48,_0x3d5d87){_0x566f48=_0x566f48-0x0;var _0x2a6b72=_0x455d[_0x566f48];return _0x2a6b72;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd455('0x0'));var timeout=require(_0xd455('0x1'));var express=require(_0xd455('0x2'));var router=express['Router']();var fs_extra=require(_0xd455('0x3'));var auth=require(_0xd455('0x4'));var interaction=require(_0xd455('0x5'));var config=require(_0xd455('0x6'));var controller=require(_0xd455('0x7'));router[_0xd455('0x8')]('/',auth[_0xd455('0x9')](),controller[_0xd455('0xa')]);router[_0xd455('0x8')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0xb')]);router['post']('/',auth[_0xd455('0x9')](),controller[_0xd455('0xc')]);router[_0xd455('0xd')](_0xd455('0xe'),auth['isAuthenticated'](),controller[_0xd455('0xf')]);router[_0xd455('0x10')]('/:id',auth[_0xd455('0x9')](),controller[_0xd455('0x11')]);module[_0xd455('0x12')]=router; \ No newline at end of file +var _0x2137=['update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','/:id'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x2137,0x134));var _0x7213=function(_0x3a6acc,_0x4f51a1){_0x3a6acc=_0x3a6acc-0x0;var _0xeba8db=_0x2137[_0x3a6acc];return _0xeba8db;};'use strict';var multer=require(_0x7213('0x0'));var util=require(_0x7213('0x1'));var path=require(_0x7213('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7213('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7213('0x4'));var interaction=require(_0x7213('0x5'));var config=require(_0x7213('0x6'));var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7213('0x7')]);router[_0x7213('0x8')]('/:id',auth[_0x7213('0x9')](),controller[_0x7213('0xa')]);router['post']('/',auth[_0x7213('0x9')](),controller['create']);router['put'](_0x7213('0xb'),auth['isAuthenticated'](),controller[_0x7213('0xc')]);router[_0x7213('0xd')](_0x7213('0xb'),auth[_0x7213('0x9')](),controller[_0x7213('0xe')]);module[_0x7213('0xf')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 77dde35..3ea0656 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 _0xf774=['sequelize','STRING','name'];(function(_0x587da8,_0x461e3b){var _0x572bdc=function(_0x455ca2){while(--_0x455ca2){_0x587da8['push'](_0x587da8['shift']());}};_0x572bdc(++_0x461e3b);}(_0xf774,0xae));var _0x4f77=function(_0x410339,_0x1c5d6f){_0x410339=_0x410339-0x0;var _0x1600cf=_0xf774[_0x410339];return _0x1600cf;};'use strict';var Sequelize=require(_0x4f77('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f77('0x1')],'unique':_0x4f77('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4f77('0x1')]}}; \ No newline at end of file +var _0xe776=['sequelize','exports','STRING','name'];(function(_0x1286ad,_0x53357b){var _0x9f26bd=function(_0x8deff){while(--_0x8deff){_0x1286ad['push'](_0x1286ad['shift']());}};_0x9f26bd(++_0x53357b);}(_0xe776,0xc4));var _0x6e77=function(_0x2fc143,_0x454926){_0x2fc143=_0x2fc143-0x0;var _0x8ea13d=_0xe776[_0x2fc143];return _0x8ea13d;};'use strict';var Sequelize=require(_0x6e77('0x0'));module[_0x6e77('0x1')]={'name':{'type':Sequelize[_0x6e77('0x2')],'unique':_0x6e77('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6e77('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index ba0055a..ee90571 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 _0xaeef=['catch','show','params','intersection','options','create','body','user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','request-promise','moment','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','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','Variable','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x28c776,_0x32db20){var _0x25ec69=function(_0x479216){while(--_0x479216){_0x28c776['push'](_0x28c776['shift']());}};_0x25ec69(++_0x32db20);}(_0xaeef,0xae));var _0xfaee=function(_0x51bd6b,_0x409463){_0x51bd6b=_0x51bd6b-0x0;var _0x39cf82=_0xaeef[_0x51bd6b];return _0x39cf82;};'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(_0xfaee('0x0'));var moment=require(_0xfaee('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfaee('0x2'));var path=require(_0xfaee('0x3'));var sox=require(_0xfaee('0x4'));var csv=require('to-csv');var ejs=require(_0xfaee('0x5'));var fs=require('fs');var fs_extra=require(_0xfaee('0x6'));var _=require(_0xfaee('0x7'));var squel=require(_0xfaee('0x8'));var crypto=require(_0xfaee('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfaee('0xa'));var querystring=require(_0xfaee('0xb'));var Papa=require(_0xfaee('0xc'));var Redis=require(_0xfaee('0xd'));var authService=require(_0xfaee('0xe'));var qs=require(_0xfaee('0xf'));var as=require(_0xfaee('0x10'));var hardwareService=require(_0xfaee('0x11'));var logger=require(_0xfaee('0x12'))('api');var utils=require(_0xfaee('0x13'));var config=require(_0xfaee('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaee('0x15'))['db'];function respondWithStatusCode(_0x8a0048,_0x207ce1){_0x207ce1=_0x207ce1||0xcc;return function(_0x262bbc){if(_0x262bbc){return _0x8a0048['sendStatus'](_0x207ce1);}return _0x8a0048[_0xfaee('0x16')](_0x207ce1)[_0xfaee('0x17')]();};}function respondWithResult(_0x4ee364,_0x798c5){_0x798c5=_0x798c5||0xc8;return function(_0x58c9d6){if(_0x58c9d6){return _0x4ee364[_0xfaee('0x16')](_0x798c5)[_0xfaee('0x18')](_0x58c9d6);}};}function respondWithFilteredResult(_0x40eb43,_0x4cf216){return function(_0x2103b4){if(_0x2103b4){var _0x49a9c2=typeof _0x4cf216[_0xfaee('0x19')]===_0xfaee('0x1a')&&typeof _0x4cf216[_0xfaee('0x1b')]===_0xfaee('0x1a');var _0x40aa1b=_0x2103b4['count'];var _0x488661=_0x49a9c2?0x0:_0x4cf216[_0xfaee('0x19')];var _0x3e5445=_0x49a9c2?_0x2103b4[_0xfaee('0x1c')]:_0x4cf216[_0xfaee('0x19')]+_0x4cf216[_0xfaee('0x1b')];var _0x338679;if(_0x3e5445>=_0x40aa1b){_0x3e5445=_0x40aa1b;_0x338679=0xc8;}else{_0x338679=0xce;}_0x40eb43['status'](_0x338679);return _0x40eb43[_0xfaee('0x1d')]('Content-Range',_0x488661+'-'+_0x3e5445+'/'+_0x40aa1b)[_0xfaee('0x18')](_0x2103b4);}return null;};}function patchUpdates(_0x16e9f2){return function(_0x5a80ec){try{jsonpatch[_0xfaee('0x1e')](_0x5a80ec,_0x16e9f2,!![]);}catch(_0x591410){return BPromise[_0xfaee('0x1f')](_0x591410);}return _0x5a80ec[_0xfaee('0x20')]();};}function saveUpdates(_0x645ca2,_0x17900f){return function(_0x33c889){if(_0x33c889){return _0x33c889[_0xfaee('0x21')](_0x645ca2)['then'](function(_0x46a908){return _0x46a908;});}return null;};}function removeEntity(_0x1c8961,_0x448313){return function(_0x7ad79a){if(_0x7ad79a){return _0x7ad79a[_0xfaee('0x22')]()[_0xfaee('0x23')](function(){var _0x33de47=_0x7ad79a[_0xfaee('0x24')]({'plain':!![]});var _0x2ee06c=_0xfaee('0x25');return db[_0xfaee('0x26')][_0xfaee('0x22')]({'where':{'type':_0x2ee06c,'resourceId':_0x33de47['id']}})[_0xfaee('0x23')](function(){return _0x7ad79a;});})[_0xfaee('0x23')](function(){_0x1c8961['status'](0xcc)[_0xfaee('0x17')]();});}};}function handleEntityNotFound(_0x4e4973,_0x127817){return function(_0x5809a0){if(!_0x5809a0){_0x4e4973[_0xfaee('0x27')](0x194);}return _0x5809a0;};}function handleError(_0x2065f0,_0x172654){_0x172654=_0x172654||0x1f4;return function(_0x70ef6a){logger[_0xfaee('0x28')](_0x70ef6a[_0xfaee('0x29')]);if(_0x70ef6a['name']){delete _0x70ef6a[_0xfaee('0x2a')];}_0x2065f0[_0xfaee('0x16')](_0x172654)[_0xfaee('0x2b')](_0x70ef6a);};}exports[_0xfaee('0x2c')]=function(_0x129196,_0x509085){var _0x4a4c61={},_0x4f7e7c={},_0x218fdb={'count':0x0,'rows':[]};var _0x23ea2b=_['map'](db[_0xfaee('0x2d')][_0xfaee('0x2e')],function(_0x28b170){return{'name':_0x28b170[_0xfaee('0x2f')],'type':_0x28b170[_0xfaee('0x30')]['key']};});_0x4f7e7c[_0xfaee('0x31')]=_[_0xfaee('0x32')](_0x23ea2b,_0xfaee('0x2a'));_0x4f7e7c[_0xfaee('0x33')]=_[_0xfaee('0x34')](_0x129196[_0xfaee('0x33')]);_0x4f7e7c['filters']=_['intersection'](_0x4f7e7c[_0xfaee('0x31')],_0x4f7e7c['query']);_0x4a4c61[_0xfaee('0x35')]=_['intersection'](_0x4f7e7c[_0xfaee('0x31')],qs[_0xfaee('0x36')](_0x129196[_0xfaee('0x33')]['fields']));_0x4a4c61['attributes']=_0x4a4c61[_0xfaee('0x35')][_0xfaee('0x37')]?_0x4a4c61[_0xfaee('0x35')]:_0x4f7e7c[_0xfaee('0x31')];if(!_0x129196[_0xfaee('0x33')][_0xfaee('0x38')](_0xfaee('0x39'))){_0x4a4c61[_0xfaee('0x1b')]=qs['limit'](_0x129196['query'][_0xfaee('0x1b')]);_0x4a4c61['offset']=qs[_0xfaee('0x19')](_0x129196[_0xfaee('0x33')]['offset']);}_0x4a4c61[_0xfaee('0x3a')]=qs['sort'](_0x129196[_0xfaee('0x33')][_0xfaee('0x3b')]);_0x4a4c61[_0xfaee('0x3c')]=qs[_0xfaee('0x3d')](_[_0xfaee('0x3e')](_0x129196[_0xfaee('0x33')],_0x4f7e7c[_0xfaee('0x3d')]),_0x23ea2b);if(_0x129196[_0xfaee('0x33')][_0xfaee('0x3f')]){_0x4a4c61[_0xfaee('0x3c')]=_[_0xfaee('0x40')](_0x4a4c61['where'],{'$or':_[_0xfaee('0x32')](_0x23ea2b,function(_0x55b54a){if(_0x55b54a[_0xfaee('0x30')]!==_0xfaee('0x41')){var _0x1653fa={};_0x1653fa[_0x55b54a[_0xfaee('0x2a')]]={'$like':'%'+_0x129196[_0xfaee('0x33')][_0xfaee('0x3f')]+'%'};return _0x1653fa;}})});}_0x4a4c61=_[_0xfaee('0x40')]({},_0x4a4c61,_0x129196['options']);var _0x4829f5={'where':_0x4a4c61[_0xfaee('0x3c')]};return db[_0xfaee('0x2d')][_0xfaee('0x1c')](_0x4829f5)[_0xfaee('0x23')](function(_0x214cb5){_0x218fdb[_0xfaee('0x1c')]=_0x214cb5;if(_0x129196['query'][_0xfaee('0x42')]){_0x4a4c61[_0xfaee('0x43')]=[{'all':!![]}];}return db[_0xfaee('0x2d')][_0xfaee('0x44')](_0x4a4c61);})['then'](function(_0x57335e){_0x218fdb['rows']=_0x57335e;return _0x218fdb;})['then'](respondWithFilteredResult(_0x509085,_0x4a4c61))[_0xfaee('0x45')](handleError(_0x509085,null));};exports[_0xfaee('0x46')]=function(_0x2a1020,_0x4b1fb5){var _0x5c4219={'raw':!![],'where':{'id':_0x2a1020[_0xfaee('0x47')]['id']}},_0x4094f7={};_0x4094f7[_0xfaee('0x31')]=_['keys'](db[_0xfaee('0x2d')][_0xfaee('0x2e')]);_0x4094f7[_0xfaee('0x33')]=_[_0xfaee('0x34')](_0x2a1020['query']);_0x4094f7[_0xfaee('0x3d')]=_[_0xfaee('0x48')](_0x4094f7[_0xfaee('0x31')],_0x4094f7['query']);_0x5c4219['attributes']=_[_0xfaee('0x48')](_0x4094f7[_0xfaee('0x31')],qs[_0xfaee('0x36')](_0x2a1020[_0xfaee('0x33')][_0xfaee('0x36')]));_0x5c4219[_0xfaee('0x35')]=_0x5c4219[_0xfaee('0x35')][_0xfaee('0x37')]?_0x5c4219[_0xfaee('0x35')]:_0x4094f7['model'];if(_0x2a1020['query'][_0xfaee('0x42')]){_0x5c4219['include']=[{'all':!![]}];}_0x5c4219=_[_0xfaee('0x40')]({},_0x5c4219,_0x2a1020[_0xfaee('0x49')]);return db[_0xfaee('0x2d')]['find'](_0x5c4219)[_0xfaee('0x23')](handleEntityNotFound(_0x4b1fb5,null))[_0xfaee('0x23')](respondWithResult(_0x4b1fb5,null))[_0xfaee('0x45')](handleError(_0x4b1fb5,null));};exports[_0xfaee('0x4a')]=function(_0x2758af,_0x486ad5){return db[_0xfaee('0x2d')][_0xfaee('0x4a')](_0x2758af[_0xfaee('0x4b')],{})[_0xfaee('0x23')](function(_0x1a77db){var _0x133555=_0x2758af[_0xfaee('0x4c')][_0xfaee('0x24')]({'plain':!![]});if(!_0x133555)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x133555[_0xfaee('0x4d')]==='user'){var _0x10ed38=_0x1a77db[_0xfaee('0x24')]({'plain':!![]});var _0x10bf7d=_0xfaee('0x25');return db['UserProfileSection'][_0xfaee('0x4e')]({'where':{'name':_0x10bf7d,'userProfileId':_0x133555[_0xfaee('0x4f')]},'raw':!![]})[_0xfaee('0x23')](function(_0x127cda){if(_0x127cda&&_0x127cda['autoAssociation']===0x0){return db[_0xfaee('0x26')]['create']({'name':_0x10ed38[_0xfaee('0x2a')],'resourceId':_0x10ed38['id'],'type':_0x127cda[_0xfaee('0x2a')],'sectionId':_0x127cda['id']},{})[_0xfaee('0x23')](function(){return _0x1a77db;});}else{return _0x1a77db;}})[_0xfaee('0x45')](function(_0x19723d){logger[_0xfaee('0x28')](_0xfaee('0x50'),_0x19723d);throw _0x19723d;});}return _0x1a77db;})[_0xfaee('0x23')](respondWithResult(_0x486ad5,0xc9))['catch'](handleError(_0x486ad5,null));};exports[_0xfaee('0x21')]=function(_0x3ac772,_0x54c1ba){if(_0x3ac772['body']['id']){delete _0x3ac772[_0xfaee('0x4b')]['id'];}return db[_0xfaee('0x2d')][_0xfaee('0x4e')]({'where':{'id':_0x3ac772[_0xfaee('0x47')]['id']}})['then'](handleEntityNotFound(_0x54c1ba,null))[_0xfaee('0x23')](saveUpdates(_0x3ac772[_0xfaee('0x4b')],null))[_0xfaee('0x23')](respondWithResult(_0x54c1ba,null))[_0xfaee('0x45')](handleError(_0x54c1ba,null));};exports[_0xfaee('0x22')]=function(_0x2509ab,_0x3f7025){return db[_0xfaee('0x2d')][_0xfaee('0x4e')]({'where':{'id':_0x2509ab['params']['id']}})['then'](handleEntityNotFound(_0x3f7025,null))[_0xfaee('0x23')](removeEntity(_0x3f7025,null))['catch'](handleError(_0x3f7025,null));}; \ No newline at end of file +var _0x8192=['find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','limit','count','offset','set','json','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','send','index','map','Variable','rawAttributes','fieldName','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','findAll','rows','show','params','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Variables','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0x8192,0x1aa));var _0x2819=function(_0x3e11b9,_0x346e8c){_0x3e11b9=_0x3e11b9-0x0;var _0x178dd1=_0x8192[_0x3e11b9];return _0x178dd1;};'use strict';var emlformat=require(_0x2819('0x0'));var rimraf=require(_0x2819('0x1'));var zipdir=require(_0x2819('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2819('0x3'));var moment=require(_0x2819('0x4'));var BPromise=require(_0x2819('0x5'));var Mustache=require(_0x2819('0x6'));var util=require(_0x2819('0x7'));var path=require(_0x2819('0x8'));var sox=require(_0x2819('0x9'));var csv=require(_0x2819('0xa'));var ejs=require(_0x2819('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2819('0xc'));var squel=require(_0x2819('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2819('0xe'));var toCsv=require(_0x2819('0xa'));var querystring=require(_0x2819('0xf'));var Papa=require(_0x2819('0x10'));var Redis=require('ioredis');var authService=require(_0x2819('0x11'));var qs=require(_0x2819('0x12'));var as=require(_0x2819('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2819('0x14'))(_0x2819('0x15'));var utils=require(_0x2819('0x16'));var config=require(_0x2819('0x17'));var licenseUtil=require(_0x2819('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e149f,_0x45e73b){_0x45e73b=_0x45e73b||0xcc;return function(_0x1ee2d3){if(_0x1ee2d3){return _0x2e149f['sendStatus'](_0x45e73b);}return _0x2e149f['status'](_0x45e73b)[_0x2819('0x19')]();};}function respondWithResult(_0x190f5e,_0x2b1c78){_0x2b1c78=_0x2b1c78||0xc8;return function(_0x415c82){if(_0x415c82){return _0x190f5e[_0x2819('0x1a')](_0x2b1c78)['json'](_0x415c82);}};}function respondWithFilteredResult(_0x5c50a2,_0xefe04d){return function(_0x5f2dc5){if(_0x5f2dc5){var _0x55960a=typeof _0xefe04d['offset']===_0x2819('0x1b')&&typeof _0xefe04d[_0x2819('0x1c')]===_0x2819('0x1b');var _0x1b8232=_0x5f2dc5[_0x2819('0x1d')];var _0x27fd55=_0x55960a?0x0:_0xefe04d[_0x2819('0x1e')];var _0x2d8cc4=_0x55960a?_0x5f2dc5[_0x2819('0x1d')]:_0xefe04d[_0x2819('0x1e')]+_0xefe04d[_0x2819('0x1c')];var _0x1b494d;if(_0x2d8cc4>=_0x1b8232){_0x2d8cc4=_0x1b8232;_0x1b494d=0xc8;}else{_0x1b494d=0xce;}_0x5c50a2[_0x2819('0x1a')](_0x1b494d);return _0x5c50a2[_0x2819('0x1f')]('Content-Range',_0x27fd55+'-'+_0x2d8cc4+'/'+_0x1b8232)[_0x2819('0x20')](_0x5f2dc5);}return null;};}function patchUpdates(_0xb008fe){return function(_0x4ca0c8){try{jsonpatch[_0x2819('0x21')](_0x4ca0c8,_0xb008fe,!![]);}catch(_0x254639){return BPromise[_0x2819('0x22')](_0x254639);}return _0x4ca0c8['save']();};}function saveUpdates(_0x4ac9d5,_0x592f52){return function(_0x33cc2f){if(_0x33cc2f){return _0x33cc2f[_0x2819('0x23')](_0x4ac9d5)[_0x2819('0x24')](function(_0x2dbea4){return _0x2dbea4;});}return null;};}function removeEntity(_0x53aa94,_0x10bb69){return function(_0xad93fb){if(_0xad93fb){return _0xad93fb[_0x2819('0x25')]()[_0x2819('0x24')](function(){var _0x556a94=_0xad93fb[_0x2819('0x26')]({'plain':!![]});var _0x5a5d9f='Variables';return db[_0x2819('0x27')][_0x2819('0x25')]({'where':{'type':_0x5a5d9f,'resourceId':_0x556a94['id']}})['then'](function(){return _0xad93fb;});})['then'](function(){_0x53aa94[_0x2819('0x1a')](0xcc)[_0x2819('0x19')]();});}};}function handleEntityNotFound(_0x22da4d,_0x357b54){return function(_0x30eda2){if(!_0x30eda2){_0x22da4d[_0x2819('0x28')](0x194);}return _0x30eda2;};}function handleError(_0x49d46f,_0x1ee019){_0x1ee019=_0x1ee019||0x1f4;return function(_0x56c070){logger[_0x2819('0x29')](_0x56c070[_0x2819('0x2a')]);if(_0x56c070['name']){delete _0x56c070['name'];}_0x49d46f[_0x2819('0x1a')](_0x1ee019)[_0x2819('0x2b')](_0x56c070);};}exports[_0x2819('0x2c')]=function(_0x2ccdaf,_0x2a6f6e){var _0x20d908={},_0x1342ab={},_0x179e95={'count':0x0,'rows':[]};var _0x28ba75=_[_0x2819('0x2d')](db[_0x2819('0x2e')][_0x2819('0x2f')],function(_0x47ee7a){return{'name':_0x47ee7a[_0x2819('0x30')],'type':_0x47ee7a['type'][_0x2819('0x31')]};});_0x1342ab['model']=_[_0x2819('0x2d')](_0x28ba75,_0x2819('0x32'));_0x1342ab[_0x2819('0x33')]=_[_0x2819('0x34')](_0x2ccdaf['query']);_0x1342ab['filters']=_[_0x2819('0x35')](_0x1342ab[_0x2819('0x36')],_0x1342ab['query']);_0x20d908[_0x2819('0x37')]=_[_0x2819('0x35')](_0x1342ab[_0x2819('0x36')],qs[_0x2819('0x38')](_0x2ccdaf['query'][_0x2819('0x38')]));_0x20d908['attributes']=_0x20d908[_0x2819('0x37')][_0x2819('0x39')]?_0x20d908[_0x2819('0x37')]:_0x1342ab['model'];if(!_0x2ccdaf['query'][_0x2819('0x3a')](_0x2819('0x3b'))){_0x20d908['limit']=qs[_0x2819('0x1c')](_0x2ccdaf[_0x2819('0x33')][_0x2819('0x1c')]);_0x20d908[_0x2819('0x1e')]=qs['offset'](_0x2ccdaf[_0x2819('0x33')]['offset']);}_0x20d908['order']=qs[_0x2819('0x3c')](_0x2ccdaf[_0x2819('0x33')][_0x2819('0x3c')]);_0x20d908['where']=qs[_0x2819('0x3d')](_[_0x2819('0x3e')](_0x2ccdaf[_0x2819('0x33')],_0x1342ab[_0x2819('0x3d')]),_0x28ba75);if(_0x2ccdaf[_0x2819('0x33')][_0x2819('0x3f')]){_0x20d908[_0x2819('0x40')]=_[_0x2819('0x41')](_0x20d908[_0x2819('0x40')],{'$or':_[_0x2819('0x2d')](_0x28ba75,function(_0x2d29cf){if(_0x2d29cf[_0x2819('0x42')]!==_0x2819('0x43')){var _0x820185={};_0x820185[_0x2d29cf[_0x2819('0x32')]]={'$like':'%'+_0x2ccdaf[_0x2819('0x33')][_0x2819('0x3f')]+'%'};return _0x820185;}})});}_0x20d908=_[_0x2819('0x41')]({},_0x20d908,_0x2ccdaf[_0x2819('0x44')]);var _0x38573b={'where':_0x20d908[_0x2819('0x40')]};return db[_0x2819('0x2e')][_0x2819('0x1d')](_0x38573b)['then'](function(_0x45d8a6){_0x179e95['count']=_0x45d8a6;if(_0x2ccdaf[_0x2819('0x33')]['includeAll']){_0x20d908['include']=[{'all':!![]}];}return db[_0x2819('0x2e')][_0x2819('0x45')](_0x20d908);})['then'](function(_0x4af61f){_0x179e95[_0x2819('0x46')]=_0x4af61f;return _0x179e95;})['then'](respondWithFilteredResult(_0x2a6f6e,_0x20d908))['catch'](handleError(_0x2a6f6e,null));};exports[_0x2819('0x47')]=function(_0x38d75a,_0x10ba4a){var _0x37b621={'raw':!![],'where':{'id':_0x38d75a[_0x2819('0x48')]['id']}},_0x4678cd={};_0x4678cd[_0x2819('0x36')]=_[_0x2819('0x34')](db[_0x2819('0x2e')][_0x2819('0x2f')]);_0x4678cd[_0x2819('0x33')]=_[_0x2819('0x34')](_0x38d75a[_0x2819('0x33')]);_0x4678cd[_0x2819('0x3d')]=_[_0x2819('0x35')](_0x4678cd[_0x2819('0x36')],_0x4678cd[_0x2819('0x33')]);_0x37b621[_0x2819('0x37')]=_[_0x2819('0x35')](_0x4678cd[_0x2819('0x36')],qs[_0x2819('0x38')](_0x38d75a[_0x2819('0x33')][_0x2819('0x38')]));_0x37b621['attributes']=_0x37b621[_0x2819('0x37')][_0x2819('0x39')]?_0x37b621['attributes']:_0x4678cd[_0x2819('0x36')];if(_0x38d75a[_0x2819('0x33')][_0x2819('0x49')]){_0x37b621['include']=[{'all':!![]}];}_0x37b621=_[_0x2819('0x41')]({},_0x37b621,_0x38d75a[_0x2819('0x44')]);return db[_0x2819('0x2e')]['find'](_0x37b621)[_0x2819('0x24')](handleEntityNotFound(_0x10ba4a,null))[_0x2819('0x24')](respondWithResult(_0x10ba4a,null))[_0x2819('0x4a')](handleError(_0x10ba4a,null));};exports['create']=function(_0x1b9674,_0x5074cb){return db['Variable'][_0x2819('0x4b')](_0x1b9674[_0x2819('0x4c')],{})[_0x2819('0x24')](function(_0x2287a3){var _0x1e854a=_0x1b9674['user']['get']({'plain':!![]});if(!_0x1e854a)throw new Error(_0x2819('0x4d'));if(_0x1e854a[_0x2819('0x4e')]===_0x2819('0x4f')){var _0x61e9cb=_0x2287a3[_0x2819('0x26')]({'plain':!![]});var _0x64a75d=_0x2819('0x50');return db[_0x2819('0x51')]['find']({'where':{'name':_0x64a75d,'userProfileId':_0x1e854a[_0x2819('0x52')]},'raw':!![]})[_0x2819('0x24')](function(_0x1a9d6b){if(_0x1a9d6b&&_0x1a9d6b['autoAssociation']===0x0){return db[_0x2819('0x27')][_0x2819('0x4b')]({'name':_0x61e9cb[_0x2819('0x32')],'resourceId':_0x61e9cb['id'],'type':_0x1a9d6b[_0x2819('0x32')],'sectionId':_0x1a9d6b['id']},{})[_0x2819('0x24')](function(){return _0x2287a3;});}else{return _0x2287a3;}})[_0x2819('0x4a')](function(_0x148500){logger['error'](_0x2819('0x53'),_0x148500);throw _0x148500;});}return _0x2287a3;})[_0x2819('0x24')](respondWithResult(_0x5074cb,0xc9))['catch'](handleError(_0x5074cb,null));};exports[_0x2819('0x23')]=function(_0x2c0c40,_0x3d259e){if(_0x2c0c40[_0x2819('0x4c')]['id']){delete _0x2c0c40[_0x2819('0x4c')]['id'];}return db[_0x2819('0x2e')]['find']({'where':{'id':_0x2c0c40['params']['id']}})['then'](handleEntityNotFound(_0x3d259e,null))[_0x2819('0x24')](saveUpdates(_0x2c0c40[_0x2819('0x4c')],null))[_0x2819('0x24')](respondWithResult(_0x3d259e,null))[_0x2819('0x4a')](handleError(_0x3d259e,null));};exports[_0x2819('0x25')]=function(_0x2b4b5b,_0x1ed76f){return db[_0x2819('0x2e')][_0x2819('0x54')]({'where':{'id':_0x2b4b5b[_0x2819('0x48')]['id']}})[_0x2819('0x24')](handleEntityNotFound(_0x1ed76f,null))['then'](removeEntity(_0x1ed76f,null))['catch'](handleError(_0x1ed76f,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 64896f1..98c4b3f 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 _0x1bb7=['request-promise','rimraf','../../config/environment','exports','Variable','tools_variables','lodash','../../config/logger','api','moment'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x1bb7,0x18c));var _0x71bb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1bb7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x71bb('0x0'));var util=require('util');var logger=require(_0x71bb('0x1'))(_0x71bb('0x2'));var moment=require(_0x71bb('0x3'));var BPromise=require('bluebird');var rp=require(_0x71bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x71bb('0x5'));var config=require(_0x71bb('0x6'));var attributes=require('./variable.attributes');module[_0x71bb('0x7')]=function(_0x369650,_0x39d965){return _0x369650['define'](_0x71bb('0x8'),attributes,{'tableName':_0x71bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6e3=['define','tools_variables','lodash','../../config/logger','api','moment','path','../../config/environment','./variable.attributes','exports'];(function(_0x3500f2,_0x142fb1){var _0x7ad03f=function(_0x2a1a07){while(--_0x2a1a07){_0x3500f2['push'](_0x3500f2['shift']());}};_0x7ad03f(++_0x142fb1);}(_0xd6e3,0x1a6));var _0x3d6e=function(_0x5692b0,_0x2316e8){_0x5692b0=_0x5692b0-0x0;var _0x490327=_0xd6e3[_0x5692b0];return _0x490327;};'use strict';var _=require(_0x3d6e('0x0'));var util=require('util');var logger=require(_0x3d6e('0x1'))(_0x3d6e('0x2'));var moment=require(_0x3d6e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d6e('0x4'));var rimraf=require('rimraf');var config=require(_0x3d6e('0x5'));var attributes=require(_0x3d6e('0x6'));module[_0x3d6e('0x7')]=function(_0x351302,_0x559983){return _0x351302[_0x3d6e('0x8')]('Variable',attributes,{'tableName':_0x3d6e('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 b91f936..85bddfb 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(_0x3671b7,_0x5398bd){var _0x50f41b=function(_0x25dba4){while(--_0x25dba4){_0x3671b7['push'](_0x3671b7['shift']());}};_0x50f41b(++_0x5398bd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0x4b84[_0x1bb812];return _0x372adb;};'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(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x326f,0xd1));var _0xf326=function(_0x4ed57d,_0x3e527f){_0x4ed57d=_0x4ed57d-0x0;var _0x232712=_0x326f[_0x4ed57d];return _0x232712;};'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 ecdb381..b07df3c 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 _0x18d5=['index','isAuthenticated','get','canUpdate','pull','/restart','/migrations','exports','express','../../components/auth/service','./version.controller'];(function(_0x31823c,_0x3e6e4a){var _0xc959f9=function(_0x18178c){while(--_0x18178c){_0x31823c['push'](_0x31823c['shift']());}};_0xc959f9(++_0x3e6e4a);}(_0x18d5,0xfa));var _0x518d=function(_0x5ec13b,_0x3a0097){_0x5ec13b=_0x5ec13b-0x0;var _0x5c82a1=_0x18d5[_0x5ec13b];return _0x5c82a1;};'use strict';var express=require(_0x518d('0x0'));var router=express['Router']();var auth=require(_0x518d('0x1'));var controller=require(_0x518d('0x2'));router['get']('/',controller[_0x518d('0x3')]);router['get']('/fetch',auth[_0x518d('0x4')](),auth['canUpdate'](),controller['fetch']);router[_0x518d('0x5')]('/reset',auth[_0x518d('0x4')](),auth[_0x518d('0x6')](),controller['reset']);router[_0x518d('0x5')]('/pull',auth[_0x518d('0x4')](),auth[_0x518d('0x6')](),controller[_0x518d('0x7')]);router[_0x518d('0x5')](_0x518d('0x8'),auth[_0x518d('0x4')](),controller['restart']);router['get'](_0x518d('0x9'),controller['migrations']);module[_0x518d('0xa')]=router; \ No newline at end of file +var _0x6310=['get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','/migrations','exports','express','Router','../../components/auth/service','./version.controller','index'];(function(_0x5d5821,_0x59c0df){var _0x4d5408=function(_0x30cecb){while(--_0x30cecb){_0x5d5821['push'](_0x5d5821['shift']());}};_0x4d5408(++_0x59c0df);}(_0x6310,0x14f));var _0x0631=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x6310[_0x13b8f3];return _0x1a6d06;};'use strict';var express=require(_0x0631('0x0'));var router=express[_0x0631('0x1')]();var auth=require(_0x0631('0x2'));var controller=require(_0x0631('0x3'));router['get']('/',controller[_0x0631('0x4')]);router[_0x0631('0x5')](_0x0631('0x6'),auth[_0x0631('0x7')](),auth[_0x0631('0x8')](),controller[_0x0631('0x9')]);router['get'](_0x0631('0xa'),auth['isAuthenticated'](),auth[_0x0631('0x8')](),controller[_0x0631('0xb')]);router['get'](_0x0631('0xc'),auth[_0x0631('0x7')](),auth[_0x0631('0x8')](),controller[_0x0631('0xd')]);router[_0x0631('0x5')](_0x0631('0xe'),auth[_0x0631('0x7')](),controller['restart']);router[_0x0631('0x5')](_0x0631('0xf'),controller['migrations']);module[_0x0631('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cdd47c7..d7e5fbf 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 _0x9b8b=['readdirSync','join','root','length','replace','.js','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','exports','version','query','latest','tags','status','json','fetch','master','error','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully'];(function(_0x1181d7,_0x258715){var _0x420c2b=function(_0x5ae97f){while(--_0x5ae97f){_0x1181d7['push'](_0x1181d7['shift']());}};_0x420c2b(++_0x258715);}(_0x9b8b,0x117));var _0xb9b8=function(_0x4823ae,_0x130dc3){_0x4823ae=_0x4823ae-0x0;var _0x50fe9e=_0x9b8b[_0x4823ae];return _0x50fe9e;};'use strict';var Umzug=require(_0xb9b8('0x0'));var path=require(_0xb9b8('0x1'));var fs=require('fs');var _=require(_0xb9b8('0x2'));var pkginfo=require(_0xb9b8('0x3'))(module,'version');var compareVersions=require(_0xb9b8('0x4'));var exec=require(_0xb9b8('0x5'))[_0xb9b8('0x6')];var db=require(_0xb9b8('0x7'))['db'];var config=require(_0xb9b8('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xb9b8('0x9'))(_0xb9b8('0xa'));var git=require(_0xb9b8('0xb'))(config['root']);exports['index']=function(_0xcdd33e,_0x46bec1){var _0x4f41bf={'current':module[_0xb9b8('0xc')][_0xb9b8('0xd')],'phonebar':0x2};if(_0xcdd33e[_0xb9b8('0xe')]&&_0xcdd33e['query'][_0xb9b8('0xf')]){return git['fetch']()[_0xb9b8('0x10')](function(_0x4ee024,_0x2354c9){_0x4f41bf['latest']=(_0x4ee024?module[_0xb9b8('0xc')][_0xb9b8('0xd')]:_0x2354c9[_0xb9b8('0xf')])||'2.0.0';return _0x46bec1[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')](_0x4f41bf);});}else{return _0x46bec1[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')](_0x4f41bf);}};exports[_0xb9b8('0x13')]=function(_0xfc8b47,_0x122116){return git[_0xb9b8('0x13')](['origin',_0xb9b8('0x14')],function(_0x3dd620){if(_0x3dd620){logger[_0xb9b8('0x15')](_0x3dd620);return _0x122116['status'](0x1f4)[_0xb9b8('0x12')](_0x3dd620);}logger[_0xb9b8('0x16')](_0xb9b8('0x17'));return _0x122116[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xb9b8('0x18')]=function(_0x12c430,_0x3644a5){return git['reset'](['--hard',_0xb9b8('0x19')],function(_0x5250db){if(_0x5250db){logger[_0xb9b8('0x15')](_0x5250db);return _0x3644a5[_0xb9b8('0x11')](0x1f4)[_0xb9b8('0x12')](_0x5250db);}logger['info'](_0xb9b8('0x1a'));return _0x3644a5[_0xb9b8('0x11')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xb9b8('0x1b')]=function(_0x2fe38d,_0x5ece9e){exec('npm\x20install\x20--production',function(_0x47e07b,_0x53bdec,_0x43a32d){logger['info'](_0x53bdec);logger[_0xb9b8('0x16')](_0x43a32d);if(_0x47e07b){logger['error'](_0x47e07b);return _0x5ece9e[_0xb9b8('0x11')](0x1f4)['json'](_0x47e07b);}return _0x5ece9e[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0x53bdec});});};exports[_0xb9b8('0x1c')]=function(_0x93d4c7,_0x3fa408){return pm2[_0xb9b8('0x1c')](_0xb9b8('0x1d'))[_0xb9b8('0x1e')](function(_0x522a58){logger[_0xb9b8('0x16')](_0xb9b8('0x1f'),_0x522a58);return _0x3fa408['status'](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x20')});})['catch'](function(_0x8affb8){logger[_0xb9b8('0x15')](_0x8affb8);return _0x3fa408[_0xb9b8('0x11')](0x1f4)['json'](_0x8affb8);});};exports['migrations']=function(_0x325134,_0x4f213c){var _0x575595=fs[_0xb9b8('0x21')](path[_0xb9b8('0x22')](config[_0xb9b8('0x23')],'server','migrations'));var _0x351779=[];for(var _0x416d6c=0x0;_0x416d6c<_0x575595[_0xb9b8('0x24')];_0x416d6c++){var _0x16f4c5=_0x575595[_0x416d6c][_0xb9b8('0x25')](_0xb9b8('0x26'),'');if(compareVersions(module['exports']['version'],_0x16f4c5)===-0x1){_0x351779['push'](_0x16f4c5);}}if(_0x351779[_0xb9b8('0x24')]){var _0x2f0c80=_0x351779[_0xb9b8('0x27')](compareVersions);var _0x8600df=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xb9b8('0x28')],'modelName':_0xb9b8('0x28'),'columnName':'version'},'migrations':{'params':[db[_0xb9b8('0x29')][_0xb9b8('0x2a')](),db['sequelize'][_0xb9b8('0x2b')],function(){throw new Error(_0xb9b8('0x2c'));}],'path':path['join'](config[_0xb9b8('0x23')],'server',_0xb9b8('0x2d')),'pattern':/\.js$/}});_0x8600df['up']({'migrations':_['map'](_0x2f0c80,function(_0x18bb0f){return _0x18bb0f+_0xb9b8('0x26');})})[_0xb9b8('0x1e')](function(){return _0x4f213c[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x2e')+module[_0xb9b8('0xc')]['version']+_0xb9b8('0x2f')+_[_0xb9b8('0x30')](_0x2f0c80),'migrations':_[_0xb9b8('0x22')](_0x2f0c80)});})[_0xb9b8('0x31')](function(_0x471772){if(_0x471772 instanceof db[_0xb9b8('0x29')][_0xb9b8('0x32')]){return _0x4f213c[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x33')});}else{return _0x4f213c[_0xb9b8('0x11')](0x1f4)[_0xb9b8('0x12')](_0x471772);}});}else{return _0x4f213c[_0xb9b8('0x11')](0xc8)[_0xb9b8('0x12')]({'output':_0xb9b8('0x33')});}}; \ No newline at end of file +var _0x2372=['../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','master','error','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','server','.js','push','length','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/pm2'];(function(_0x4dd1a1,_0x57efe1){var _0x2d8c48=function(_0x526a96){while(--_0x526a96){_0x4dd1a1['push'](_0x4dd1a1['shift']());}};_0x2d8c48(++_0x57efe1);}(_0x2372,0xe7));var _0x2237=function(_0x42a14d,_0xf9447c){_0x42a14d=_0x42a14d-0x0;var _0x4abece=_0x2372[_0x42a14d];return _0x4abece;};'use strict';var Umzug=require(_0x2237('0x0'));var path=require(_0x2237('0x1'));var fs=require('fs');var _=require(_0x2237('0x2'));var pkginfo=require(_0x2237('0x3'))(module,_0x2237('0x4'));var compareVersions=require(_0x2237('0x5'));var exec=require('child_process')[_0x2237('0x6')];var db=require(_0x2237('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x2237('0x8'));var logger=require(_0x2237('0x9'))(_0x2237('0xa'));var git=require(_0x2237('0xb'))(config[_0x2237('0xc')]);exports[_0x2237('0xd')]=function(_0x1f51e0,_0x18dd74){var _0x52fe04={'current':module[_0x2237('0xe')][_0x2237('0x4')],'phonebar':0x2};if(_0x1f51e0[_0x2237('0xf')]&&_0x1f51e0[_0x2237('0xf')][_0x2237('0x10')]){return git[_0x2237('0x11')]()[_0x2237('0x12')](function(_0x1359a5,_0x2e63c1){_0x52fe04[_0x2237('0x10')]=(_0x1359a5?module['exports'][_0x2237('0x4')]:_0x2e63c1[_0x2237('0x10')])||_0x2237('0x13');return _0x18dd74['status'](0xc8)[_0x2237('0x14')](_0x52fe04);});}else{return _0x18dd74[_0x2237('0x15')](0xc8)[_0x2237('0x14')](_0x52fe04);}};exports[_0x2237('0x11')]=function(_0xd821ff,_0x3f24e9){return git[_0x2237('0x11')](['origin',_0x2237('0x16')],function(_0x4ffdce){if(_0x4ffdce){logger[_0x2237('0x17')](_0x4ffdce);return _0x3f24e9[_0x2237('0x15')](0x1f4)[_0x2237('0x14')](_0x4ffdce);}logger[_0x2237('0x18')]('git\x20fetch');return _0x3f24e9[_0x2237('0x15')](0xc8)[_0x2237('0x14')]({'output':_0x2237('0x19')});});};exports['reset']=function(_0x121377,_0x1b75ea){return git[_0x2237('0x1a')](['--hard',_0x2237('0x1b')],function(_0x53e42a){if(_0x53e42a){logger[_0x2237('0x17')](_0x53e42a);return _0x1b75ea[_0x2237('0x15')](0x1f4)[_0x2237('0x14')](_0x53e42a);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x1b75ea[_0x2237('0x15')](0xc8)[_0x2237('0x14')]({'output':'git\x20reset\x20--hard'});});};exports[_0x2237('0x1c')]=function(_0x56c774,_0x357483){exec(_0x2237('0x1d'),function(_0xf791c6,_0x31a767,_0xc3976b){logger[_0x2237('0x18')](_0x31a767);logger[_0x2237('0x18')](_0xc3976b);if(_0xf791c6){logger[_0x2237('0x17')](_0xf791c6);return _0x357483[_0x2237('0x15')](0x1f4)[_0x2237('0x14')](_0xf791c6);}return _0x357483['status'](0xc8)[_0x2237('0x14')]({'output':_0x31a767});});};exports['restart']=function(_0x16b964,_0x5cb31f){return pm2['restart'](_0x2237('0x1e'))[_0x2237('0x1f')](function(_0x566ff1){logger[_0x2237('0x18')](_0x2237('0x20'),_0x566ff1);return _0x5cb31f[_0x2237('0x15')](0xc8)['json']({'output':_0x2237('0x21')});})[_0x2237('0x22')](function(_0x335204){logger[_0x2237('0x17')](_0x335204);return _0x5cb31f[_0x2237('0x15')](0x1f4)[_0x2237('0x14')](_0x335204);});};exports[_0x2237('0x23')]=function(_0x4d253b,_0x268dad){var _0x5be07e=fs['readdirSync'](path['join'](config[_0x2237('0xc')],_0x2237('0x24'),_0x2237('0x23')));var _0x375661=[];for(var _0x30b919=0x0;_0x30b919<_0x5be07e['length'];_0x30b919++){var _0x1b71d0=_0x5be07e[_0x30b919]['replace'](_0x2237('0x25'),'');if(compareVersions(module[_0x2237('0xe')][_0x2237('0x4')],_0x1b71d0)===-0x1){_0x375661[_0x2237('0x26')](_0x1b71d0);}}if(_0x375661[_0x2237('0x27')]){var _0x4ac41f=_0x375661['sort'](compareVersions);var _0xb92a97=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x2237('0x28'),'columnName':_0x2237('0x4')},'migrations':{'params':[db[_0x2237('0x29')]['getQueryInterface'](),db[_0x2237('0x29')][_0x2237('0x2a')],function(){throw new Error(_0x2237('0x2b'));}],'path':path[_0x2237('0x2c')](config[_0x2237('0xc')],_0x2237('0x24'),_0x2237('0x23')),'pattern':/\.js$/}});_0xb92a97['up']({'migrations':_[_0x2237('0x2d')](_0x4ac41f,function(_0x3d2d43){return _0x3d2d43+_0x2237('0x25');})})['then'](function(){return _0x268dad[_0x2237('0x15')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x2237('0xe')][_0x2237('0x4')]+'\x20to\x20'+_[_0x2237('0x2e')](_0x4ac41f),'migrations':_[_0x2237('0x2c')](_0x4ac41f)});})[_0x2237('0x22')](function(_0x52331){if(_0x52331 instanceof db[_0x2237('0x29')]['UniqueConstraintError']){return _0x268dad['status'](0xc8)[_0x2237('0x14')]({'output':_0x2237('0x2f')});}else{return _0x268dad[_0x2237('0x15')](0x1f4)[_0x2237('0x14')](_0x52331);}});}else{return _0x268dad['status'](0xc8)[_0x2237('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 840b0f8..9cad2c3 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 _0xba01=['update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put'];(function(_0x5be61e,_0x2c54bb){var _0x43806e=function(_0x2ac9d4){while(--_0x2ac9d4){_0x5be61e['push'](_0x5be61e['shift']());}};_0x43806e(++_0x2c54bb);}(_0xba01,0x9a));var _0x1ba0=function(_0x4ab11b,_0x516f88){_0x4ab11b=_0x4ab11b-0x0;var _0x580eaf=_0xba01[_0x4ab11b];return _0x580eaf;};'use strict';var multer=require(_0x1ba0('0x0'));var util=require('util');var path=require(_0x1ba0('0x1'));var timeout=require('connect-timeout');var express=require(_0x1ba0('0x2'));var router=express[_0x1ba0('0x3')]();var fs_extra=require(_0x1ba0('0x4'));var auth=require(_0x1ba0('0x5'));var interaction=require(_0x1ba0('0x6'));var config=require('../../config/environment');var controller=require(_0x1ba0('0x7'));router['get']('/',auth[_0x1ba0('0x8')](),controller[_0x1ba0('0x9')]);router[_0x1ba0('0xa')](_0x1ba0('0xb'),auth[_0x1ba0('0x8')](),controller[_0x1ba0('0xc')]);router['get'](_0x1ba0('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x1ba0('0xe')]('/',auth[_0x1ba0('0x8')](),controller[_0x1ba0('0xf')]);router[_0x1ba0('0x10')](_0x1ba0('0xd'),auth[_0x1ba0('0x8')](),controller[_0x1ba0('0x11')]);router['delete'](_0x1ba0('0xd'),auth[_0x1ba0('0x8')](),controller['destroy']);module[_0x1ba0('0x12')]=router; \ No newline at end of file +var _0x9549=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9549,0x87));var _0x9954=function(_0x3336b5,_0x1889fc){_0x3336b5=_0x3336b5-0x0;var _0x4a86cd=_0x9549[_0x3336b5];return _0x4a86cd;};'use strict';var multer=require(_0x9954('0x0'));var util=require(_0x9954('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9954('0x2'));var router=express[_0x9954('0x3')]();var fs_extra=require(_0x9954('0x4'));var auth=require(_0x9954('0x5'));var interaction=require(_0x9954('0x6'));var config=require(_0x9954('0x7'));var controller=require(_0x9954('0x8'));router[_0x9954('0x9')]('/',auth[_0x9954('0xa')](),controller[_0x9954('0xb')]);router[_0x9954('0x9')](_0x9954('0xc'),auth[_0x9954('0xa')](),controller[_0x9954('0xd')]);router['get']('/:id',auth[_0x9954('0xa')](),controller['show']);router[_0x9954('0xe')]('/',auth[_0x9954('0xa')](),controller[_0x9954('0xf')]);router[_0x9954('0x10')](_0x9954('0x11'),auth[_0x9954('0xa')](),controller[_0x9954('0x12')]);router[_0x9954('0x13')](_0x9954('0x11'),auth[_0x9954('0xa')](),controller[_0x9954('0x14')]);module[_0x9954('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c0febff..e6ca6d7 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 _0x23a3=['STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x1e890e,_0x4dd6d2){var _0xfb71d8=function(_0x36dad2){while(--_0x36dad2){_0x1e890e['push'](_0x1e890e['shift']());}};_0xfb71d8(++_0x4dd6d2);}(_0x23a3,0x131));var _0x323a=function(_0x4ca92a,_0x4a2b42){_0x4ca92a=_0x4ca92a-0x0;var _0x12a5a8=_0x23a3[_0x4ca92a];return _0x12a5a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x323a('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x323a('0x0')]},'queue':{'type':Sequelize[_0x323a('0x0')]},'interface':{'type':Sequelize[_0x323a('0x0')]},'membername':{'type':Sequelize[_0x323a('0x0')]},'agentcalledAt':{'type':Sequelize[_0x323a('0x1')]},'agentconnectAt':{'type':Sequelize[_0x323a('0x1')]},'agentcompleteAt':{'type':Sequelize[_0x323a('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0x323a('0x1')]},'agentdumpAt':{'type':Sequelize[_0x323a('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x323a('0x2')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x323a('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x323a('0x3')]},'agentacw':{'type':Sequelize[_0x323a('0x2')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x323a('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x323a('0x0')]},'channel':{'type':Sequelize[_0x323a('0x0')]},'channelstate':{'type':Sequelize[_0x323a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x323a('0x0')]},'connectedlinenum':{'type':Sequelize[_0x323a('0x0')]},'connectedlinename':{'type':Sequelize[_0x323a('0x0')]},'language':{'type':Sequelize[_0x323a('0x0')]},'accountcode':{'type':Sequelize[_0x323a('0x0')]},'context':{'type':Sequelize[_0x323a('0x0')]},'exten':{'type':Sequelize[_0x323a('0x0')]},'priority':{'type':Sequelize[_0x323a('0x0')]},'destchannel':{'type':Sequelize[_0x323a('0x0')]},'destchannelstate':{'type':Sequelize[_0x323a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x323a('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x323a('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x323a('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x323a('0x0')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x323a('0x0')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x323a('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0x323a('0x0')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x323a('0x0')],'comment':_0x323a('0x4')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x323a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x28f2=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x28f2,0x193));var _0x228f=function(_0x4c5709,_0x91c2f1){_0x4c5709=_0x4c5709-0x0;var _0x1891d6=_0x28f2[_0x4c5709];return _0x1891d6;};'use strict';var Sequelize=require(_0x228f('0x0'));module[_0x228f('0x1')]={'type':{'type':Sequelize[_0x228f('0x2')]},'uniqueid':{'type':Sequelize[_0x228f('0x2')]},'calleridnum':{'type':Sequelize[_0x228f('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x228f('0x2')]},'interface':{'type':Sequelize[_0x228f('0x2')]},'membername':{'type':Sequelize[_0x228f('0x2')]},'agentcalledAt':{'type':Sequelize[_0x228f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x228f('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x228f('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x228f('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x228f('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x228f('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x228f('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x228f('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x228f('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x228f('0x2')]},'channel':{'type':Sequelize[_0x228f('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x228f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x228f('0x2')]},'connectedlinename':{'type':Sequelize[_0x228f('0x2')]},'language':{'type':Sequelize[_0x228f('0x2')]},'accountcode':{'type':Sequelize[_0x228f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x228f('0x2')]},'priority':{'type':Sequelize[_0x228f('0x2')]},'destchannel':{'type':Sequelize[_0x228f('0x2')]},'destchannelstate':{'type':Sequelize[_0x228f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x228f('0x2')]},'destcalleridnum':{'type':Sequelize[_0x228f('0x2')]},'destcalleridname':{'type':Sequelize[_0x228f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x228f('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x228f('0x2')]},'destaccountcode':{'type':Sequelize[_0x228f('0x2')]},'destcontext':{'type':Sequelize[_0x228f('0x2')]},'destexten':{'type':Sequelize[_0x228f('0x2')]},'destpriority':{'type':Sequelize[_0x228f('0x2')]},'destuniqueid':{'type':Sequelize[_0x228f('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x228f('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x228f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x228f('0x6')},'transferexten':{'type':Sequelize[_0x228f('0x2')]},'transferuniqueid':{'type':Sequelize[_0x228f('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'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 36e4a3f..7c644b7 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 74fcaf2..1f8eb71 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 _0x3f1c=['VoiceAgentReport','report_agent','lodash','api','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define'];(function(_0x443849,_0x153308){var _0x52cb35=function(_0x303798){while(--_0x303798){_0x443849['push'](_0x443849['shift']());}};_0x52cb35(++_0x153308);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x54675a,_0x2f39db){_0x54675a=_0x54675a-0x0;var _0x4cc490=_0x3f1c[_0x54675a];return _0x4cc490;};'use strict';var _=require(_0xc3f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc3f1('0x2'));var fs=require('fs');var path=require(_0xc3f1('0x3'));var rimraf=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var attributes=require(_0xc3f1('0x6'));module['exports']=function(_0x12e78a,_0x4ebd4c){return _0x12e78a[_0xc3f1('0x7')](_0xc3f1('0x8'),attributes,{'tableName':_0xc3f1('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd50=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','VoiceAgentReport','report_agent','lodash'];(function(_0x35dce2,_0x2b138f){var _0x28d157=function(_0x7c265a){while(--_0x7c265a){_0x35dce2['push'](_0x35dce2['shift']());}};_0x28d157(++_0x2b138f);}(_0xbd50,0x196));var _0x0bd5=function(_0xf50434,_0x61b31c){_0xf50434=_0xf50434-0x0;var _0x580ee5=_0xbd50[_0xf50434];return _0x580ee5;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var logger=require(_0x0bd5('0x2'))('api');var moment=require(_0x0bd5('0x3'));var BPromise=require(_0x0bd5('0x4'));var rp=require(_0x0bd5('0x5'));var fs=require('fs');var path=require(_0x0bd5('0x6'));var rimraf=require(_0x0bd5('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x376024,_0x2ef1d0){return _0x376024[_0x0bd5('0x8')](_0x0bd5('0x9'),attributes,{'tableName':_0x0bd5('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 5023ff7..3dc8019 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 _0x2e37=['raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','VoiceAgentReport','options','CreateVoiceAgentReport','debug','catch','UpdateVoiceAgentReport','body'];(function(_0x248764,_0x22e335){var _0x497c52=function(_0xa74f74){while(--_0xa74f74){_0x248764['push'](_0x248764['shift']());}};_0x497c52(++_0x22e335);}(_0x2e37,0x197));var _0x72e3=function(_0x56fb33,_0x37be08){_0x56fb33=_0x56fb33-0x0;var _0x435ee4=_0x2e37[_0x56fb33];return _0x435ee4;};'use strict';var _=require(_0x72e3('0x0'));var util=require('util');var moment=require(_0x72e3('0x1'));var BPromise=require('bluebird');var rs=require(_0x72e3('0x2'));var fs=require('fs');var Redis=require(_0x72e3('0x3'));var db=require(_0x72e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72e3('0x5'));var config=require(_0x72e3('0x6'));var jayson=require(_0x72e3('0x7'));var client=jayson[_0x72e3('0x8')][_0x72e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42cd0c,_0x4e20b4,_0x41c369){return new BPromise(function(_0x30ef9,_0x14935e){return client[_0x72e3('0xa')](_0x42cd0c,_0x41c369)[_0x72e3('0xb')](function(_0x421097){logger[_0x72e3('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x4e20b4,_0x72e3('0xd'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x4e20b4,'request\x20sent',JSON[_0x72e3('0xe')](_0x421097));if(_0x421097['error']){if(_0x421097[_0x72e3('0xf')][_0x72e3('0x10')]===0x1f4){logger[_0x72e3('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x4e20b4,_0x421097[_0x72e3('0xf')]['message']);return _0x14935e(_0x421097[_0x72e3('0xf')][_0x72e3('0x11')]);}logger[_0x72e3('0xf')](_0x72e3('0x12'),_0x4e20b4,_0x421097['error'][_0x72e3('0x11')]);return _0x30ef9(_0x421097[_0x72e3('0xf')][_0x72e3('0x11')]);}else{logger['info'](_0x72e3('0x12'),_0x4e20b4,'request\x20sent');_0x30ef9(_0x421097[_0x72e3('0x13')][_0x72e3('0x11')]);}})['catch'](function(_0x4da9f5){logger[_0x72e3('0xf')](_0x72e3('0x12'),_0x4e20b4,_0x4da9f5);_0x14935e(_0x4da9f5);});});}exports['CreateVoiceAgentReport']=function(_0x1dbd75){var _0x15cff6=this;return new Promise(function(_0x3b86e2,_0x30a409){return db[_0x72e3('0x14')]['create'](_0x1dbd75['body'],{'raw':_0x1dbd75[_0x72e3('0x15')]?_0x1dbd75[_0x72e3('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x72e3('0xb')](function(_0x2551dd){logger[_0x72e3('0xc')](_0x72e3('0x16'),_0x1dbd75);logger[_0x72e3('0x17')](_0x72e3('0x16'),_0x1dbd75,JSON['stringify'](_0x2551dd));_0x3b86e2(_0x2551dd);})[_0x72e3('0x18')](function(_0x13f4d0){logger[_0x72e3('0xf')](_0x72e3('0x16'),_0x13f4d0[_0x72e3('0x11')],_0x1dbd75);_0x30a409(_0x15cff6['error'](0x1f4,_0x13f4d0[_0x72e3('0x11')]));});});};exports[_0x72e3('0x19')]=function(_0xf843be){var _0x378109=this;return new Promise(function(_0x2a77bd,_0xffc83a){return db['VoiceAgentReport']['update'](_0xf843be[_0x72e3('0x1a')],{'raw':_0xf843be[_0x72e3('0x15')]?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf843be['options']?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1c')]||null:null,'attributes':_0xf843be[_0x72e3('0x15')]?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1d')]||null:null,'limit':_0xf843be[_0x72e3('0x15')]?_0xf843be[_0x72e3('0x15')][_0x72e3('0x1e')]||null:null})['then'](function(_0x28ced0){logger[_0x72e3('0xc')]('UpdateVoiceAgentReport',_0xf843be);logger[_0x72e3('0x17')]('UpdateVoiceAgentReport',_0xf843be,JSON[_0x72e3('0xe')](_0x28ced0));_0x2a77bd(_0x28ced0);})['catch'](function(_0x333ff){logger['error'](_0x72e3('0x19'),_0x333ff[_0x72e3('0x11')],_0xf843be);_0xffc83a(_0x378109[_0x72e3('0xf')](0x1f4,_0x333ff[_0x72e3('0x11')]));});});}; \ No newline at end of file +var _0xcfdc=['info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xcfdc,0x15e));var _0xccfd=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcfdc[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xccfd('0x0'));var util=require(_0xccfd('0x1'));var moment=require('moment');var BPromise=require(_0xccfd('0x2'));var rs=require(_0xccfd('0x3'));var fs=require('fs');var Redis=require(_0xccfd('0x4'));var db=require(_0xccfd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xccfd('0x6'))(_0xccfd('0x7'));var config=require(_0xccfd('0x8'));var jayson=require(_0xccfd('0x9'));var client=jayson[_0xccfd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x251431,_0x11ece8,_0x2a27ef){return new BPromise(function(_0x3400a7,_0x42cca6){return client[_0xccfd('0xb')](_0x251431,_0x2a27ef)[_0xccfd('0xc')](function(_0x4d6d3f){logger[_0xccfd('0xd')](_0xccfd('0xe'),_0x11ece8,_0xccfd('0xf'));logger[_0xccfd('0x10')](_0xccfd('0x11'),_0x11ece8,_0xccfd('0xf'),JSON[_0xccfd('0x12')](_0x4d6d3f));if(_0x4d6d3f[_0xccfd('0x13')]){if(_0x4d6d3f[_0xccfd('0x13')][_0xccfd('0x14')]===0x1f4){logger[_0xccfd('0x13')](_0xccfd('0xe'),_0x11ece8,_0x4d6d3f['error']['message']);return _0x42cca6(_0x4d6d3f['error']['message']);}logger[_0xccfd('0x13')](_0xccfd('0xe'),_0x11ece8,_0x4d6d3f['error']['message']);return _0x3400a7(_0x4d6d3f[_0xccfd('0x13')][_0xccfd('0x15')]);}else{logger[_0xccfd('0xd')](_0xccfd('0xe'),_0x11ece8,_0xccfd('0xf'));_0x3400a7(_0x4d6d3f['result'][_0xccfd('0x15')]);}})[_0xccfd('0x16')](function(_0x40b7f6){logger[_0xccfd('0x13')](_0xccfd('0xe'),_0x11ece8,_0x40b7f6);_0x42cca6(_0x40b7f6);});});}exports['CreateVoiceAgentReport']=function(_0xbe906c){var _0x2fe492=this;return new Promise(function(_0x84b911,_0x461a10){return db[_0xccfd('0x17')][_0xccfd('0x18')](_0xbe906c[_0xccfd('0x19')],{'raw':_0xbe906c[_0xccfd('0x1a')]?_0xbe906c['options'][_0xccfd('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x258a32){logger[_0xccfd('0xd')](_0xccfd('0x1c'),_0xbe906c);logger['debug'](_0xccfd('0x1c'),_0xbe906c,JSON['stringify'](_0x258a32));_0x84b911(_0x258a32);})[_0xccfd('0x16')](function(_0x447e61){logger[_0xccfd('0x13')](_0xccfd('0x1c'),_0x447e61['message'],_0xbe906c);_0x461a10(_0x2fe492[_0xccfd('0x13')](0x1f4,_0x447e61['message']));});});};exports[_0xccfd('0x1d')]=function(_0x5b6715){var _0x55aac3=this;return new Promise(function(_0x1ffe26,_0x5b992a){return db[_0xccfd('0x17')][_0xccfd('0x1e')](_0x5b6715[_0xccfd('0x19')],{'raw':_0x5b6715[_0xccfd('0x1a')]?_0x5b6715[_0xccfd('0x1a')][_0xccfd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b6715[_0xccfd('0x1a')]?_0x5b6715[_0xccfd('0x1a')][_0xccfd('0x1f')]||null:null,'attributes':_0x5b6715[_0xccfd('0x1a')]?_0x5b6715['options']['attributes']||null:null,'limit':_0x5b6715[_0xccfd('0x1a')]?_0x5b6715[_0xccfd('0x1a')][_0xccfd('0x20')]||null:null})[_0xccfd('0xc')](function(_0x1cca99){logger[_0xccfd('0xd')](_0xccfd('0x1d'),_0x5b6715);logger['debug'](_0xccfd('0x1d'),_0x5b6715,JSON[_0xccfd('0x12')](_0x1cca99));_0x1ffe26(_0x1cca99);})['catch'](function(_0x21f2e5){logger[_0xccfd('0x13')](_0xccfd('0x1d'),_0x21f2e5[_0xccfd('0x15')],_0x5b6715);_0x5b992a(_0x55aac3['error'](0x1f4,_0x21f2e5['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 3be3470..2f31b77 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 _0x4b19=['index','isAuthenticated','describe','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x4b19,0x195));var _0x94b1=function(_0x1e6c5d,_0x7f354c){_0x1e6c5d=_0x1e6c5d-0x0;var _0x1e314b=_0x4b19[_0x1e6c5d];return _0x1e314b;};'use strict';var multer=require(_0x94b1('0x0'));var util=require('util');var path=require(_0x94b1('0x1'));var timeout=require(_0x94b1('0x2'));var express=require(_0x94b1('0x3'));var router=express['Router']();var fs_extra=require(_0x94b1('0x4'));var auth=require(_0x94b1('0x5'));var interaction=require(_0x94b1('0x6'));var config=require('../../config/environment');var controller=require(_0x94b1('0x7'));router[_0x94b1('0x8')]('/',auth['isAuthenticated'](),controller[_0x94b1('0x9')]);router[_0x94b1('0x8')]('/describe',auth[_0x94b1('0xa')](),controller[_0x94b1('0xb')]);router[_0x94b1('0x8')]('/:id',auth[_0x94b1('0xa')](),controller['show']);router['post']('/',auth[_0x94b1('0xa')](),controller[_0x94b1('0xc')]);router[_0x94b1('0xd')](_0x94b1('0xe'),auth[_0x94b1('0xa')](),controller[_0x94b1('0xf')]);router['delete'](_0x94b1('0xe'),auth[_0x94b1('0xa')](),controller[_0x94b1('0x10')]);module[_0x94b1('0x11')]=router; \ No newline at end of file +var _0x81bd=['../../config/environment','./voiceCallReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x775ff4,_0x14d00f){var _0x2e6abe=function(_0x5ad039){while(--_0x5ad039){_0x775ff4['push'](_0x775ff4['shift']());}};_0x2e6abe(++_0x14d00f);}(_0x81bd,0x7c));var _0xd81b=function(_0x29c2f7,_0x1ffb8b){_0x29c2f7=_0x29c2f7-0x0;var _0x3582e6=_0x81bd[_0x29c2f7];return _0x3582e6;};'use strict';var multer=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var timeout=require(_0xd81b('0x3'));var express=require(_0xd81b('0x4'));var router=express[_0xd81b('0x5')]();var fs_extra=require(_0xd81b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var controller=require(_0xd81b('0x9'));router['get']('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0xb')]);router[_0xd81b('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xd81b('0xd')]);router['get'](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0xf')]);router[_0xd81b('0x10')]('/',auth[_0xd81b('0xa')](),controller[_0xd81b('0x11')]);router[_0xd81b('0x12')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller[_0xd81b('0x13')]);router[_0xd81b('0x14')](_0xd81b('0xe'),auth[_0xd81b('0xa')](),controller['destroy']);module[_0xd81b('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 17eec02..aec104e 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 _0xec58=['internal','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','inbound'];(function(_0x341967,_0x3eea51){var _0x20f414=function(_0x332e11){while(--_0x332e11){_0x341967['push'](_0x341967['shift']());}};_0x20f414(++_0x3eea51);}(_0xec58,0x11c));var _0x8ec5=function(_0x471a85,_0x239e8d){_0x471a85=_0x471a85-0x0;var _0x5f2039=_0xec58[_0x471a85];return _0x5f2039;};'use strict';var Sequelize=require(_0x8ec5('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8ec5('0x1'),_0x8ec5('0x2'),_0x8ec5('0x3'),_0x8ec5('0x4'),_0x8ec5('0x5'),_0x8ec5('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8ec5('0x7')]},'source':{'type':Sequelize[_0x8ec5('0x7')]},'destination':{'type':Sequelize[_0x8ec5('0x7')]},'destinationcontext':{'type':Sequelize[_0x8ec5('0x7')]},'callerid':{'type':Sequelize[_0x8ec5('0x7')]},'channel':{'type':Sequelize[_0x8ec5('0x7')]},'destinationchannel':{'type':Sequelize[_0x8ec5('0x7')]},'lastapplication':{'type':Sequelize[_0x8ec5('0x7')]},'lastdata':{'type':Sequelize[_0x8ec5('0x8')]},'starttime':{'type':Sequelize[_0x8ec5('0x9')]},'systemanswertime':{'type':Sequelize[_0x8ec5('0x9')]},'answertime':{'type':Sequelize[_0x8ec5('0x9')]},'endtime':{'type':Sequelize[_0x8ec5('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8ec5('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8ec5('0x7')]},'userfield':{'type':Sequelize[_0x8ec5('0x7')]},'userDisposition':{'type':Sequelize[_0x8ec5('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x8ec5('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8ec5('0x7')]},'prefix':{'type':Sequelize[_0x8ec5('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x8ec5('0x7')]}}; \ No newline at end of file +var _0x926f=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','outbound-fax','dialer','TEXT'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x926f,0xb6));var _0xf926=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x926f[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xf926('0x0'));module[_0xf926('0x1')]={'uniqueid':{'type':Sequelize[_0xf926('0x2')]},'type':{'type':Sequelize[_0xf926('0x3')](_0xf926('0x4'),_0xf926('0x5'),_0xf926('0x6'),'inbound-fax',_0xf926('0x7'),_0xf926('0x8'))},'tag':{'type':Sequelize[_0xf926('0x2')]},'accountcode':{'type':Sequelize[_0xf926('0x2')]},'source':{'type':Sequelize[_0xf926('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xf926('0x2')]},'callerid':{'type':Sequelize[_0xf926('0x2')]},'channel':{'type':Sequelize[_0xf926('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xf926('0x2')]},'lastdata':{'type':Sequelize[_0xf926('0x9')]},'starttime':{'type':Sequelize[_0xf926('0xa')]},'systemanswertime':{'type':Sequelize[_0xf926('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf926('0xa')]},'duration':{'type':Sequelize[_0xf926('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf926('0x2')]},'amaflags':{'type':Sequelize[_0xf926('0x2')]},'userfield':{'type':Sequelize[_0xf926('0x2')]},'userDisposition':{'type':Sequelize[_0xf926('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xf926('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xf926('0x2')]},'note':{'type':Sequelize[_0xf926('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xf926('0xb')]},'sipcallid':{'type':Sequelize[_0xf926('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 57985e1..b99b714 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b8241,_0x471900){_0x2b8241=_0x2b8241-0x0;var _0x4185fa=_0x2ef3[_0x2b8241];return _0x4185fa;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0xadb5,0xad));var _0x5adb=function(_0x3d8346,_0x35a52c){_0x3d8346=_0x3d8346-0x0;var _0x3e9a8f=_0xadb5[_0x3d8346];return _0x3e9a8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 973ed28..af7c8eb 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 _0x807d=['bluebird','request-promise','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','api','moment'];(function(_0x5d76c3,_0x5eda8b){var _0x547a9e=function(_0x40bf93){while(--_0x40bf93){_0x5d76c3['push'](_0x5d76c3['shift']());}};_0x547a9e(++_0x5eda8b);}(_0x807d,0x126));var _0xd807=function(_0x427a73,_0xb4fc9d){_0x427a73=_0x427a73-0x0;var _0x29f4cc=_0x807d[_0x427a73];return _0x29f4cc;};'use strict';var _=require(_0xd807('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd807('0x1'));var moment=require(_0xd807('0x2'));var BPromise=require(_0xd807('0x3'));var rp=require(_0xd807('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd807('0x5'));module[_0xd807('0x6')]=function(_0x43ed56,_0x5d3b0f){return _0x43ed56[_0xd807('0x7')](_0xd807('0x8'),attributes,{'tableName':_0xd807('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd807('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7205=['moment','bluebird','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','lodash','util','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7205,0xc3));var _0x5720=function(_0x2c93c5,_0xfc1a22){_0x2c93c5=_0x2c93c5-0x0;var _0x5e1cc3=_0x7205[_0x2c93c5];return _0x5e1cc3;};'use strict';var _=require(_0x5720('0x0'));var util=require(_0x5720('0x1'));var logger=require('../../config/logger')(_0x5720('0x2'));var moment=require(_0x5720('0x3'));var BPromise=require(_0x5720('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5720('0x5'));var config=require(_0x5720('0x6'));var attributes=require(_0x5720('0x7'));module[_0x5720('0x8')]=function(_0x4d16e6,_0x415e9a){return _0x4d16e6[_0x5720('0x9')](_0x5720('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 8823b2c..51b2926 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 _0xb821=['body','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceCallReport,\x20%s,\x20%s','result','catch','findAll','options','where','attributes','map','include','model','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','raw','UpdateVoiceCallReport'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0xb821,0x1f0));var _0x1b82=function(_0x22d340,_0x4ae518){_0x22d340=_0x22d340-0x0;var _0x524785=_0xb821[_0x22d340];return _0x524785;};'use strict';var _=require(_0x1b82('0x0'));var util=require(_0x1b82('0x1'));var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b82('0x3'));var fs=require('fs');var Redis=require(_0x1b82('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b82('0x5'));var logger=require('../../config/logger')(_0x1b82('0x6'));var config=require(_0x1b82('0x7'));var jayson=require(_0x1b82('0x8'));var client=jayson[_0x1b82('0x9')][_0x1b82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4868c4,_0x42971d,_0x453c0a){return new BPromise(function(_0x1d49b4,_0x2ac5e5){return client[_0x1b82('0xb')](_0x4868c4,_0x453c0a)[_0x1b82('0xc')](function(_0x1ba16c){logger[_0x1b82('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x42971d,_0x1b82('0xe'));logger[_0x1b82('0xf')](_0x1b82('0x10'),_0x42971d,_0x1b82('0xe'),JSON[_0x1b82('0x11')](_0x1ba16c));if(_0x1ba16c[_0x1b82('0x12')]){if(_0x1ba16c['error']['code']===0x1f4){logger[_0x1b82('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x42971d,_0x1ba16c[_0x1b82('0x12')][_0x1b82('0x13')]);return _0x2ac5e5(_0x1ba16c[_0x1b82('0x12')][_0x1b82('0x13')]);}logger[_0x1b82('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x42971d,_0x1ba16c[_0x1b82('0x12')]['message']);return _0x1d49b4(_0x1ba16c[_0x1b82('0x12')]['message']);}else{logger[_0x1b82('0xd')](_0x1b82('0x14'),_0x42971d,_0x1b82('0xe'));_0x1d49b4(_0x1ba16c[_0x1b82('0x15')]['message']);}})[_0x1b82('0x16')](function(_0x53b7c1){logger[_0x1b82('0x12')](_0x1b82('0x14'),_0x42971d,_0x53b7c1);_0x2ac5e5(_0x53b7c1);});});}exports['GetVoiceCallReport']=function(_0x444747){var _0x4604e1=this;return new Promise(function(_0xba48d,_0x14d954){return db['VoiceCallReport'][_0x1b82('0x17')]({'raw':_0x444747[_0x1b82('0x18')]?_0x444747[_0x1b82('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x444747[_0x1b82('0x18')]?_0x444747['options'][_0x1b82('0x19')]||null:null,'attributes':_0x444747[_0x1b82('0x18')]?_0x444747['options'][_0x1b82('0x1a')]||null:null,'limit':_0x444747[_0x1b82('0x18')]?_0x444747[_0x1b82('0x18')]['limit']||null:null,'include':_0x444747[_0x1b82('0x18')]?_0x444747['options']['include']?_[_0x1b82('0x1b')](_0x444747[_0x1b82('0x18')][_0x1b82('0x1c')],function(_0x1e781c){return{'model':db[_0x1e781c[_0x1b82('0x1d')]],'as':_0x1e781c['as'],'attributes':_0x1e781c['attributes'],'include':_0x1e781c[_0x1b82('0x1c')]?_['map'](_0x1e781c[_0x1b82('0x1c')],function(_0xcf5cfd){return{'model':db[_0xcf5cfd[_0x1b82('0x1d')]],'as':_0xcf5cfd['as'],'attributes':_0xcf5cfd[_0x1b82('0x1a')],'include':_0xcf5cfd['include']?_['map'](_0xcf5cfd['include'],function(_0x601453){return{'model':db[_0x601453['model']],'as':_0x601453['as'],'attributes':_0x601453['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b82('0xc')](function(_0x514bd4){logger['info'](_0x1b82('0x1e'),_0x444747);logger[_0x1b82('0xf')](_0x1b82('0x1e'),_0x444747,JSON[_0x1b82('0x11')](_0x514bd4));_0xba48d(_0x514bd4);})[_0x1b82('0x16')](function(_0x1be1f2){logger[_0x1b82('0x12')]('GetVoiceCallReport',_0x1be1f2[_0x1b82('0x13')],_0x444747);_0x14d954(_0x4604e1[_0x1b82('0x12')](0x1f4,_0x1be1f2['message']));});});};exports[_0x1b82('0x1f')]=function(_0x38890a){var _0x343fa9=this;return new Promise(function(_0x5976c8,_0x33d1b7){return db[_0x1b82('0x20')][_0x1b82('0x21')](_0x38890a['body'],{'raw':_0x38890a[_0x1b82('0x18')]?_0x38890a['options'][_0x1b82('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x584963){logger['info'](_0x1b82('0x1f'),_0x38890a);logger[_0x1b82('0xf')](_0x1b82('0x1f'),_0x38890a,JSON['stringify'](_0x584963));_0x5976c8(_0x584963);})['catch'](function(_0x26afff){logger[_0x1b82('0x12')](_0x1b82('0x1f'),_0x26afff[_0x1b82('0x13')],_0x38890a);_0x33d1b7(_0x343fa9[_0x1b82('0x12')](0x1f4,_0x26afff[_0x1b82('0x13')]));});});};exports[_0x1b82('0x23')]=function(_0x493399){var _0x4e03c1=this;return new Promise(function(_0x22c30b,_0x1a5280){return db[_0x1b82('0x20')]['update'](_0x493399[_0x1b82('0x24')],{'raw':_0x493399[_0x1b82('0x18')]?_0x493399[_0x1b82('0x18')][_0x1b82('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493399[_0x1b82('0x18')]?_0x493399['options'][_0x1b82('0x19')]||null:null,'attributes':_0x493399[_0x1b82('0x18')]?_0x493399[_0x1b82('0x18')][_0x1b82('0x1a')]||null:null,'limit':_0x493399[_0x1b82('0x18')]?_0x493399['options'][_0x1b82('0x25')]||null:null})[_0x1b82('0xc')](function(_0x5f4220){logger[_0x1b82('0xd')](_0x1b82('0x23'),_0x493399);logger[_0x1b82('0xf')]('UpdateVoiceCallReport',_0x493399,JSON[_0x1b82('0x11')](_0x5f4220));_0x22c30b(_0x5f4220);})['catch'](function(_0x26e318){logger[_0x1b82('0x12')](_0x1b82('0x23'),_0x26e318[_0x1b82('0x13')],_0x493399);_0x1a5280(_0x4e03c1['error'](0x1f4,_0x26e318[_0x1b82('0x13')]));});});}; \ No newline at end of file +var _0x7ace=['VoiceCallReport','where','then','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','client','request','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','GetVoiceCallReport','findAll','raw','options','attributes','limit','include','model','stringify','CreateVoiceCallReport','body','UpdateVoiceCallReport'];(function(_0x15781d,_0x215dc4){var _0xf250a1=function(_0x416a26){while(--_0x416a26){_0x15781d['push'](_0x15781d['shift']());}};_0xf250a1(++_0x215dc4);}(_0x7ace,0x1b5));var _0xe7ac=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x7ace[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0xe7ac('0x0'));var moment=require(_0xe7ac('0x1'));var BPromise=require(_0xe7ac('0x2'));var rs=require(_0xe7ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7ac('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe7ac('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe7ac('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6e1277,_0xcba4e7,_0x18abdc){return new BPromise(function(_0x668969,_0x2ff804){return client[_0xe7ac('0x7')](_0x6e1277,_0x18abdc)['then'](function(_0x532f6a){logger['info'](_0xe7ac('0x8'),_0xcba4e7,'request\x20sent');logger[_0xe7ac('0x9')](_0xe7ac('0xa'),_0xcba4e7,_0xe7ac('0xb'),JSON['stringify'](_0x532f6a));if(_0x532f6a['error']){if(_0x532f6a['error']['code']===0x1f4){logger['error'](_0xe7ac('0x8'),_0xcba4e7,_0x532f6a[_0xe7ac('0xc')][_0xe7ac('0xd')]);return _0x2ff804(_0x532f6a['error'][_0xe7ac('0xd')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0xcba4e7,_0x532f6a[_0xe7ac('0xc')][_0xe7ac('0xd')]);return _0x668969(_0x532f6a[_0xe7ac('0xc')][_0xe7ac('0xd')]);}else{logger[_0xe7ac('0xe')](_0xe7ac('0x8'),_0xcba4e7,_0xe7ac('0xb'));_0x668969(_0x532f6a['result'][_0xe7ac('0xd')]);}})[_0xe7ac('0xf')](function(_0x1d304e){logger[_0xe7ac('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0xcba4e7,_0x1d304e);_0x2ff804(_0x1d304e);});});}exports[_0xe7ac('0x10')]=function(_0x7a12f3){var _0xa16a35=this;return new Promise(function(_0x11d18e,_0x24b29b){return db['VoiceCallReport'][_0xe7ac('0x11')]({'raw':_0x7a12f3['options']?_0x7a12f3['options'][_0xe7ac('0x12')]===undefined?!![]:![]:!![],'where':_0x7a12f3[_0xe7ac('0x13')]?_0x7a12f3[_0xe7ac('0x13')]['where']||null:null,'attributes':_0x7a12f3['options']?_0x7a12f3[_0xe7ac('0x13')][_0xe7ac('0x14')]||null:null,'limit':_0x7a12f3[_0xe7ac('0x13')]?_0x7a12f3[_0xe7ac('0x13')][_0xe7ac('0x15')]||null:null,'include':_0x7a12f3[_0xe7ac('0x13')]?_0x7a12f3['options']['include']?_['map'](_0x7a12f3[_0xe7ac('0x13')][_0xe7ac('0x16')],function(_0xb0923e){return{'model':db[_0xb0923e[_0xe7ac('0x17')]],'as':_0xb0923e['as'],'attributes':_0xb0923e[_0xe7ac('0x14')],'include':_0xb0923e['include']?_['map'](_0xb0923e[_0xe7ac('0x16')],function(_0x3891b1){return{'model':db[_0x3891b1[_0xe7ac('0x17')]],'as':_0x3891b1['as'],'attributes':_0x3891b1[_0xe7ac('0x14')],'include':_0x3891b1[_0xe7ac('0x16')]?_['map'](_0x3891b1['include'],function(_0x47dc4a){return{'model':db[_0x47dc4a[_0xe7ac('0x17')]],'as':_0x47dc4a['as'],'attributes':_0x47dc4a[_0xe7ac('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b71e1){logger['info'](_0xe7ac('0x10'),_0x7a12f3);logger[_0xe7ac('0x9')](_0xe7ac('0x10'),_0x7a12f3,JSON[_0xe7ac('0x18')](_0x1b71e1));_0x11d18e(_0x1b71e1);})[_0xe7ac('0xf')](function(_0x56eb3e){logger[_0xe7ac('0xc')](_0xe7ac('0x10'),_0x56eb3e[_0xe7ac('0xd')],_0x7a12f3);_0x24b29b(_0xa16a35[_0xe7ac('0xc')](0x1f4,_0x56eb3e[_0xe7ac('0xd')]));});});};exports[_0xe7ac('0x19')]=function(_0x268028){var _0x2de004=this;return new Promise(function(_0x9f12ad,_0x191251){return db['VoiceCallReport']['create'](_0x268028[_0xe7ac('0x1a')],{'raw':_0x268028[_0xe7ac('0x13')]?_0x268028['options'][_0xe7ac('0x12')]===undefined?!![]:![]:!![]})['then'](function(_0x4d5b1b){logger['info'](_0xe7ac('0x19'),_0x268028);logger[_0xe7ac('0x9')](_0xe7ac('0x19'),_0x268028,JSON['stringify'](_0x4d5b1b));_0x9f12ad(_0x4d5b1b);})[_0xe7ac('0xf')](function(_0x35b16c){logger[_0xe7ac('0xc')](_0xe7ac('0x19'),_0x35b16c[_0xe7ac('0xd')],_0x268028);_0x191251(_0x2de004[_0xe7ac('0xc')](0x1f4,_0x35b16c[_0xe7ac('0xd')]));});});};exports[_0xe7ac('0x1b')]=function(_0x1f1762){var _0x435a4a=this;return new Promise(function(_0x5c5d77,_0x178e34){return db[_0xe7ac('0x1c')]['update'](_0x1f1762[_0xe7ac('0x1a')],{'raw':_0x1f1762[_0xe7ac('0x13')]?_0x1f1762[_0xe7ac('0x13')][_0xe7ac('0x12')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f1762['options']?_0x1f1762[_0xe7ac('0x13')][_0xe7ac('0x1d')]||null:null,'attributes':_0x1f1762[_0xe7ac('0x13')]?_0x1f1762[_0xe7ac('0x13')][_0xe7ac('0x14')]||null:null,'limit':_0x1f1762[_0xe7ac('0x13')]?_0x1f1762['options']['limit']||null:null})[_0xe7ac('0x1e')](function(_0x5576df){logger[_0xe7ac('0xe')](_0xe7ac('0x1b'),_0x1f1762);logger['debug']('UpdateVoiceCallReport',_0x1f1762,JSON[_0xe7ac('0x18')](_0x5576df));_0x5c5d77(_0x5576df);})[_0xe7ac('0xf')](function(_0x3b6e28){logger[_0xe7ac('0xc')](_0xe7ac('0x1b'),_0x3b6e28[_0xe7ac('0xd')],_0x1f1762);_0x178e34(_0x435a4a[_0xe7ac('0xc')](0x1f4,_0x3b6e28[_0xe7ac('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index f27d465..ec771b6 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 _0x3e3f=['put','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get','show','post','create'];(function(_0x46477f,_0xad6785){var _0x59eb9e=function(_0xdc36b0){while(--_0xdc36b0){_0x46477f['push'](_0x46477f['shift']());}};_0x59eb9e(++_0xad6785);}(_0x3e3f,0x1be));var _0xf3e3=function(_0x51246f,_0x206e47){_0x51246f=_0x51246f-0x0;var _0x5c542b=_0x3e3f[_0x51246f];return _0x5c542b;};'use strict';var multer=require('multer');var util=require(_0xf3e3('0x0'));var path=require(_0xf3e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3e3('0x2'));var router=express[_0xf3e3('0x3')]();var fs_extra=require(_0xf3e3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf3e3('0x5'));var config=require('../../config/environment');var controller=require(_0xf3e3('0x6'));router['get']('/',auth[_0xf3e3('0x7')](),controller[_0xf3e3('0x8')]);router[_0xf3e3('0x9')]('/:id',auth[_0xf3e3('0x7')](),controller[_0xf3e3('0xa')]);router[_0xf3e3('0xb')]('/',auth['isAuthenticated'](),controller[_0xf3e3('0xc')]);router[_0xf3e3('0xd')](_0xf3e3('0xe'),auth[_0xf3e3('0x7')](),controller['update']);router['delete'](_0xf3e3('0xe'),auth['isAuthenticated'](),controller[_0xf3e3('0xf')]);module[_0xf3e3('0x10')]=router; \ No newline at end of file +var _0x6e7a=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6e7a,0x194));var _0xa6e7=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0x6e7a[_0x24679e];return _0x291f21;};'use strict';var multer=require(_0xa6e7('0x0'));var util=require(_0xa6e7('0x1'));var path=require(_0xa6e7('0x2'));var timeout=require(_0xa6e7('0x3'));var express=require(_0xa6e7('0x4'));var router=express[_0xa6e7('0x5')]();var fs_extra=require(_0xa6e7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa6e7('0x7'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xa6e7('0x8')]('/',auth[_0xa6e7('0x9')](),controller[_0xa6e7('0xa')]);router[_0xa6e7('0x8')](_0xa6e7('0xb'),auth[_0xa6e7('0x9')](),controller[_0xa6e7('0xc')]);router['post']('/',auth[_0xa6e7('0x9')](),controller[_0xa6e7('0xd')]);router['put'](_0xa6e7('0xb'),auth['isAuthenticated'](),controller[_0xa6e7('0xe')]);router[_0xa6e7('0xf')]('/:id',auth[_0xa6e7('0x9')](),controller['destroy']);module[_0xa6e7('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 26d2038..1b0910c 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 _0x5c2b=['sequelize','exports','STRING','setDataValue','options','getDataValue','BOOLEAN'];(function(_0x1176bf,_0xcf182a){var _0xb2f595=function(_0x3d3aa5){while(--_0x3d3aa5){_0x1176bf['push'](_0x1176bf['shift']());}};_0xb2f595(++_0xcf182a);}(_0x5c2b,0x1ea));var _0xb5c2=function(_0x5732a7,_0x12b0d7){_0x5732a7=_0x5732a7-0x0;var _0x3d2b0a=_0x5c2b[_0x5732a7];return _0x3d2b0a;};'use strict';var Sequelize=require(_0xb5c2('0x0'));module[_0xb5c2('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb5c2('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xb5c2('0x2')],'set':function(_0x1f8a13){this[_0xb5c2('0x3')](_0xb5c2('0x4'),_0x1f8a13?_0x1f8a13['join'](''):[]);},'get':function(){return this[_0xb5c2('0x5')](_0xb5c2('0x4'))?this['getDataValue']('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xb5c2('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xb5c2('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb5c2('0x2')]}}; \ No newline at end of file +var _0x2256=['options','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x2256,0xb9));var _0x6225=function(_0x3f320d,_0x4bee57){_0x3f320d=_0x3f320d-0x0;var _0x32cdd2=_0x2256[_0x3f320d];return _0x32cdd2;};'use strict';var Sequelize=require(_0x6225('0x0'));module[_0x6225('0x1')]={'name':{'type':Sequelize[_0x6225('0x2')]},'prefix':{'type':Sequelize[_0x6225('0x2')],'unique':_0x6225('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x6225('0x2')],'set':function(_0x25233a){this[_0x6225('0x4')](_0x6225('0x5'),_0x25233a?_0x25233a[_0x6225('0x6')](''):[]);},'get':function(){return this[_0x6225('0x7')]('options')?this['getDataValue'](_0x6225('0x5'))[_0x6225('0x8')](''):[];}},'auth':{'type':Sequelize[_0x6225('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x6225('0x2')]},'record':{'type':Sequelize[_0x6225('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x6225('0x2')]},'description':{'type':Sequelize[_0x6225('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 283cd5a..f111621 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 _0xed8a=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','findAll','rows','catch','show','params','keys','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key'];(function(_0x2027c3,_0x2b0cce){var _0x4396b8=function(_0x4f9227){while(--_0x4f9227){_0x2027c3['push'](_0x2027c3['shift']());}};_0x4396b8(++_0x2b0cce);}(_0xed8a,0xc5));var _0xaed8=function(_0x42401d,_0x125c43){_0x42401d=_0x42401d-0x0;var _0x104e6f=_0xed8a[_0x42401d];return _0x104e6f;};'use strict';var emlformat=require(_0xaed8('0x0'));var rimraf=require(_0xaed8('0x1'));var zipdir=require(_0xaed8('0x2'));var jsonpatch=require(_0xaed8('0x3'));var rp=require('request-promise');var moment=require(_0xaed8('0x4'));var BPromise=require(_0xaed8('0x5'));var Mustache=require('mustache');var util=require(_0xaed8('0x6'));var path=require(_0xaed8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaed8('0x8'));var fs=require('fs');var fs_extra=require(_0xaed8('0x9'));var _=require(_0xaed8('0xa'));var squel=require(_0xaed8('0xb'));var crypto=require(_0xaed8('0xc'));var jsforce=require(_0xaed8('0xd'));var deskjs=require(_0xaed8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaed8('0xf'));var Papa=require(_0xaed8('0x10'));var Redis=require(_0xaed8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaed8('0x12'));var as=require(_0xaed8('0x13'));var hardwareService=require(_0xaed8('0x14'));var logger=require(_0xaed8('0x15'))(_0xaed8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaed8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eed24,_0x36c833){_0x36c833=_0x36c833||0xcc;return function(_0x129051){if(_0x129051){return _0x3eed24[_0xaed8('0x18')](_0x36c833);}return _0x3eed24['status'](_0x36c833)[_0xaed8('0x19')]();};}function respondWithResult(_0x273de5,_0x3a7aab){_0x3a7aab=_0x3a7aab||0xc8;return function(_0x248cd7){if(_0x248cd7){return _0x273de5[_0xaed8('0x1a')](_0x3a7aab)[_0xaed8('0x1b')](_0x248cd7);}};}function respondWithFilteredResult(_0x54ae7b,_0xefac0c){return function(_0x4a7448){if(_0x4a7448){var _0x4593c1=typeof _0xefac0c[_0xaed8('0x1c')]==='undefined'&&typeof _0xefac0c[_0xaed8('0x1d')]===_0xaed8('0x1e');var _0x1ef875=_0x4a7448[_0xaed8('0x1f')];var _0x427d37=_0x4593c1?0x0:_0xefac0c[_0xaed8('0x1c')];var _0x42eae7=_0x4593c1?_0x4a7448[_0xaed8('0x1f')]:_0xefac0c[_0xaed8('0x1c')]+_0xefac0c[_0xaed8('0x1d')];var _0x2d32ce;if(_0x42eae7>=_0x1ef875){_0x42eae7=_0x1ef875;_0x2d32ce=0xc8;}else{_0x2d32ce=0xce;}_0x54ae7b[_0xaed8('0x1a')](_0x2d32ce);return _0x54ae7b[_0xaed8('0x20')](_0xaed8('0x21'),_0x427d37+'-'+_0x42eae7+'/'+_0x1ef875)[_0xaed8('0x1b')](_0x4a7448);}return null;};}function patchUpdates(_0x48828f){return function(_0x5cd103){try{jsonpatch[_0xaed8('0x22')](_0x5cd103,_0x48828f,!![]);}catch(_0x5bafaf){return BPromise[_0xaed8('0x23')](_0x5bafaf);}return _0x5cd103[_0xaed8('0x24')]();};}function saveUpdates(_0x2ec32e,_0x344949){return function(_0x5a69aa){if(_0x5a69aa){return _0x5a69aa['update'](_0x2ec32e)['then'](function(_0x1a1acb){return _0x1a1acb;});}return null;};}function removeEntity(_0x4437aa,_0x448ef9){return function(_0x38a3f1){if(_0x38a3f1){return _0x38a3f1[_0xaed8('0x25')]()[_0xaed8('0x26')](function(){var _0x290b32=_0x38a3f1[_0xaed8('0x27')]({'plain':!![]});var _0x10c1fa='ChanSpies';return db[_0xaed8('0x28')][_0xaed8('0x25')]({'where':{'type':_0x10c1fa,'resourceId':_0x290b32['id']}})[_0xaed8('0x26')](function(){return _0x38a3f1;});})[_0xaed8('0x26')](function(){_0x4437aa[_0xaed8('0x1a')](0xcc)[_0xaed8('0x19')]();});}};}function handleEntityNotFound(_0x541662,_0x552555){return function(_0x4c442d){if(!_0x4c442d){_0x541662[_0xaed8('0x18')](0x194);}return _0x4c442d;};}function handleError(_0x5d80c7,_0x34c7ff){_0x34c7ff=_0x34c7ff||0x1f4;return function(_0x4b25d9){logger[_0xaed8('0x29')](_0x4b25d9[_0xaed8('0x2a')]);if(_0x4b25d9[_0xaed8('0x2b')]){delete _0x4b25d9[_0xaed8('0x2b')];}_0x5d80c7[_0xaed8('0x1a')](_0x34c7ff)[_0xaed8('0x2c')](_0x4b25d9);};}exports[_0xaed8('0x2d')]=function(_0xa093be,_0x16263d){var _0x4b1db6={},_0x478bce={},_0x24a703={'count':0x0,'rows':[]};var _0x27dd81=_[_0xaed8('0x2e')](db[_0xaed8('0x2f')][_0xaed8('0x30')],function(_0x539150){return{'name':_0x539150[_0xaed8('0x31')],'type':_0x539150[_0xaed8('0x32')][_0xaed8('0x33')]};});_0x478bce[_0xaed8('0x34')]=_[_0xaed8('0x2e')](_0x27dd81,_0xaed8('0x2b'));_0x478bce['query']=_['keys'](_0xa093be[_0xaed8('0x35')]);_0x478bce[_0xaed8('0x36')]=_[_0xaed8('0x37')](_0x478bce['model'],_0x478bce['query']);_0x4b1db6[_0xaed8('0x38')]=_[_0xaed8('0x37')](_0x478bce[_0xaed8('0x34')],qs['fields'](_0xa093be[_0xaed8('0x35')][_0xaed8('0x39')]));_0x4b1db6[_0xaed8('0x38')]=_0x4b1db6['attributes'][_0xaed8('0x3a')]?_0x4b1db6[_0xaed8('0x38')]:_0x478bce[_0xaed8('0x34')];if(!_0xa093be[_0xaed8('0x35')][_0xaed8('0x3b')](_0xaed8('0x3c'))){_0x4b1db6[_0xaed8('0x1d')]=qs[_0xaed8('0x1d')](_0xa093be[_0xaed8('0x35')]['limit']);_0x4b1db6[_0xaed8('0x1c')]=qs[_0xaed8('0x1c')](_0xa093be[_0xaed8('0x35')][_0xaed8('0x1c')]);}_0x4b1db6['order']=qs[_0xaed8('0x3d')](_0xa093be[_0xaed8('0x35')][_0xaed8('0x3d')]);_0x4b1db6[_0xaed8('0x3e')]=qs[_0xaed8('0x36')](_[_0xaed8('0x3f')](_0xa093be[_0xaed8('0x35')],_0x478bce[_0xaed8('0x36')]),_0x27dd81);if(_0xa093be['query'][_0xaed8('0x40')]){_0x4b1db6[_0xaed8('0x3e')]=_['merge'](_0x4b1db6[_0xaed8('0x3e')],{'$or':_['map'](_0x27dd81,function(_0x3e06b6){if(_0x3e06b6[_0xaed8('0x32')]!=='VIRTUAL'){var _0x21bc95={};_0x21bc95[_0x3e06b6[_0xaed8('0x2b')]]={'$like':'%'+_0xa093be['query'][_0xaed8('0x40')]+'%'};return _0x21bc95;}})});}_0x4b1db6=_[_0xaed8('0x41')]({},_0x4b1db6,_0xa093be['options']);var _0x2d458e={'where':_0x4b1db6[_0xaed8('0x3e')]};return db['VoiceChanSpy'][_0xaed8('0x1f')](_0x2d458e)['then'](function(_0x2aa6da){_0x24a703[_0xaed8('0x1f')]=_0x2aa6da;if(_0xa093be[_0xaed8('0x35')]['includeAll']){_0x4b1db6['include']=[{'all':!![]}];}return db[_0xaed8('0x2f')][_0xaed8('0x42')](_0x4b1db6);})['then'](function(_0x22ddd8){_0x24a703[_0xaed8('0x43')]=_0x22ddd8;return _0x24a703;})[_0xaed8('0x26')](respondWithFilteredResult(_0x16263d,_0x4b1db6))[_0xaed8('0x44')](handleError(_0x16263d,null));};exports[_0xaed8('0x45')]=function(_0x41f0c6,_0x3c05d2){var _0x170de5={'raw':![],'where':{'id':_0x41f0c6[_0xaed8('0x46')]['id']}},_0x1f1eaa={};_0x1f1eaa['model']=_[_0xaed8('0x47')](db['VoiceChanSpy'][_0xaed8('0x30')]);_0x1f1eaa[_0xaed8('0x35')]=_['keys'](_0x41f0c6[_0xaed8('0x35')]);_0x1f1eaa[_0xaed8('0x36')]=_[_0xaed8('0x37')](_0x1f1eaa['model'],_0x1f1eaa[_0xaed8('0x35')]);_0x170de5[_0xaed8('0x38')]=_['intersection'](_0x1f1eaa[_0xaed8('0x34')],qs[_0xaed8('0x39')](_0x41f0c6[_0xaed8('0x35')][_0xaed8('0x39')]));_0x170de5[_0xaed8('0x38')]=_0x170de5[_0xaed8('0x38')]['length']?_0x170de5[_0xaed8('0x38')]:_0x1f1eaa[_0xaed8('0x34')];if(_0x41f0c6[_0xaed8('0x35')][_0xaed8('0x48')]){_0x170de5[_0xaed8('0x49')]=[{'all':!![]}];}_0x170de5=_[_0xaed8('0x41')]({},_0x170de5,_0x41f0c6['options']);return db[_0xaed8('0x2f')][_0xaed8('0x4a')](_0x170de5)[_0xaed8('0x26')](handleEntityNotFound(_0x3c05d2,null))[_0xaed8('0x26')](respondWithResult(_0x3c05d2,null))[_0xaed8('0x44')](handleError(_0x3c05d2,null));};exports[_0xaed8('0x4b')]=function(_0x940feb,_0x26c015){return db[_0xaed8('0x2f')][_0xaed8('0x4b')](_0x940feb['body'],{})[_0xaed8('0x26')](function(_0x3168af){var _0x57e9d1=_0x940feb[_0xaed8('0x4c')][_0xaed8('0x27')]({'plain':!![]});if(!_0x57e9d1)throw new Error(_0xaed8('0x4d'));if(_0x57e9d1['role']===_0xaed8('0x4c')){var _0x3b6a26=_0x3168af['get']({'plain':!![]});var _0x213341=_0xaed8('0x4e');return db[_0xaed8('0x4f')][_0xaed8('0x4a')]({'where':{'name':_0x213341,'userProfileId':_0x57e9d1[_0xaed8('0x50')]},'raw':!![]})[_0xaed8('0x26')](function(_0x116b53){if(_0x116b53&&_0x116b53['autoAssociation']===0x0){return db[_0xaed8('0x28')][_0xaed8('0x4b')]({'name':_0x3b6a26[_0xaed8('0x2b')],'resourceId':_0x3b6a26['id'],'type':_0x116b53[_0xaed8('0x2b')],'sectionId':_0x116b53['id']},{})[_0xaed8('0x26')](function(){return _0x3168af;});}else{return _0x3168af;}})[_0xaed8('0x44')](function(_0x2508fa){logger[_0xaed8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2508fa);throw _0x2508fa;});}return _0x3168af;})[_0xaed8('0x26')](respondWithResult(_0x26c015,0xc9))[_0xaed8('0x44')](handleError(_0x26c015,null));};exports[_0xaed8('0x51')]=function(_0x107dbd,_0x7a404){if(_0x107dbd[_0xaed8('0x52')]['id']){delete _0x107dbd[_0xaed8('0x52')]['id'];}return db[_0xaed8('0x2f')]['find']({'where':{'id':_0x107dbd['params']['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x7a404,null))[_0xaed8('0x26')](saveUpdates(_0x107dbd[_0xaed8('0x52')],null))[_0xaed8('0x26')](respondWithResult(_0x7a404,null))[_0xaed8('0x44')](handleError(_0x7a404,null));};exports[_0xaed8('0x25')]=function(_0x3a5afb,_0x311881){return db[_0xaed8('0x2f')][_0xaed8('0x4a')]({'where':{'id':_0x3a5afb[_0xaed8('0x46')]['id']}})[_0xaed8('0x26')](handleEntityNotFound(_0x311881,null))[_0xaed8('0x26')](removeEntity(_0x311881,null))[_0xaed8('0x44')](handleError(_0x311881,null));}; \ No newline at end of file +var _0x37a4=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','Content-Range','save','update','then','destroy','get','ChanSpies','sendStatus','name','index','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','VoiceChanSpy','includeAll','include','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','find','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x16144a,_0x20cec0){var _0x1354bb=function(_0xcb5bc0){while(--_0xcb5bc0){_0x16144a['push'](_0x16144a['shift']());}};_0x1354bb(++_0x20cec0);}(_0x37a4,0xcb));var _0x437a=function(_0x1a8b35,_0x1ec137){_0x1a8b35=_0x1a8b35-0x0;var _0x91a6e4=_0x37a4[_0x1a8b35];return _0x91a6e4;};'use strict';var emlformat=require(_0x437a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x437a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x437a('0x2'));var moment=require(_0x437a('0x3'));var BPromise=require(_0x437a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x437a('0x5'));var sox=require(_0x437a('0x6'));var csv=require(_0x437a('0x7'));var ejs=require(_0x437a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x437a('0x9'));var squel=require(_0x437a('0xa'));var crypto=require('crypto');var jsforce=require(_0x437a('0xb'));var deskjs=require(_0x437a('0xc'));var toCsv=require(_0x437a('0x7'));var querystring=require(_0x437a('0xd'));var Papa=require(_0x437a('0xe'));var Redis=require(_0x437a('0xf'));var authService=require(_0x437a('0x10'));var qs=require(_0x437a('0x11'));var as=require(_0x437a('0x12'));var hardwareService=require(_0x437a('0x13'));var logger=require(_0x437a('0x14'))('api');var utils=require(_0x437a('0x15'));var config=require(_0x437a('0x16'));var licenseUtil=require(_0x437a('0x17'));var db=require(_0x437a('0x18'))['db'];function respondWithStatusCode(_0x13c3a6,_0x5f3f7f){_0x5f3f7f=_0x5f3f7f||0xcc;return function(_0x2a16bf){if(_0x2a16bf){return _0x13c3a6['sendStatus'](_0x5f3f7f);}return _0x13c3a6[_0x437a('0x19')](_0x5f3f7f)[_0x437a('0x1a')]();};}function respondWithResult(_0x2c60c2,_0x2aa622){_0x2aa622=_0x2aa622||0xc8;return function(_0x1f4756){if(_0x1f4756){return _0x2c60c2[_0x437a('0x19')](_0x2aa622)[_0x437a('0x1b')](_0x1f4756);}};}function respondWithFilteredResult(_0x1a1956,_0x1feebb){return function(_0x23c326){if(_0x23c326){var _0x19cf32=typeof _0x1feebb[_0x437a('0x1c')]==='undefined'&&typeof _0x1feebb[_0x437a('0x1d')]==='undefined';var _0x33804e=_0x23c326[_0x437a('0x1e')];var _0x170ba3=_0x19cf32?0x0:_0x1feebb[_0x437a('0x1c')];var _0x3d1a23=_0x19cf32?_0x23c326[_0x437a('0x1e')]:_0x1feebb['offset']+_0x1feebb[_0x437a('0x1d')];var _0x459284;if(_0x3d1a23>=_0x33804e){_0x3d1a23=_0x33804e;_0x459284=0xc8;}else{_0x459284=0xce;}_0x1a1956[_0x437a('0x19')](_0x459284);return _0x1a1956['set'](_0x437a('0x1f'),_0x170ba3+'-'+_0x3d1a23+'/'+_0x33804e)['json'](_0x23c326);}return null;};}function patchUpdates(_0x2d7088){return function(_0x45e4e9){try{jsonpatch['apply'](_0x45e4e9,_0x2d7088,!![]);}catch(_0x76d5f7){return BPromise['reject'](_0x76d5f7);}return _0x45e4e9[_0x437a('0x20')]();};}function saveUpdates(_0x1c98c9,_0x302ab8){return function(_0x439957){if(_0x439957){return _0x439957[_0x437a('0x21')](_0x1c98c9)[_0x437a('0x22')](function(_0x3f9b10){return _0x3f9b10;});}return null;};}function removeEntity(_0x1b49d8,_0x288faa){return function(_0x3dad6f){if(_0x3dad6f){return _0x3dad6f[_0x437a('0x23')]()[_0x437a('0x22')](function(){var _0x53089f=_0x3dad6f[_0x437a('0x24')]({'plain':!![]});var _0x29ccd0=_0x437a('0x25');return db['UserProfileResource'][_0x437a('0x23')]({'where':{'type':_0x29ccd0,'resourceId':_0x53089f['id']}})['then'](function(){return _0x3dad6f;});})[_0x437a('0x22')](function(){_0x1b49d8[_0x437a('0x19')](0xcc)[_0x437a('0x1a')]();});}};}function handleEntityNotFound(_0x335659,_0x2a22a8){return function(_0x1c00f1){if(!_0x1c00f1){_0x335659[_0x437a('0x26')](0x194);}return _0x1c00f1;};}function handleError(_0x18f15a,_0x1c3bef){_0x1c3bef=_0x1c3bef||0x1f4;return function(_0x484cee){logger['error'](_0x484cee['stack']);if(_0x484cee[_0x437a('0x27')]){delete _0x484cee[_0x437a('0x27')];}_0x18f15a[_0x437a('0x19')](_0x1c3bef)['send'](_0x484cee);};}exports[_0x437a('0x28')]=function(_0x3cbc11,_0x392f4b){var _0x2b886c={},_0x902594={},_0x5b6549={'count':0x0,'rows':[]};var _0x4cf64a=_['map'](db['VoiceChanSpy'][_0x437a('0x29')],function(_0x374d61){return{'name':_0x374d61[_0x437a('0x2a')],'type':_0x374d61[_0x437a('0x2b')]['key']};});_0x902594['model']=_['map'](_0x4cf64a,_0x437a('0x27'));_0x902594[_0x437a('0x2c')]=_[_0x437a('0x2d')](_0x3cbc11['query']);_0x902594['filters']=_[_0x437a('0x2e')](_0x902594['model'],_0x902594[_0x437a('0x2c')]);_0x2b886c[_0x437a('0x2f')]=_[_0x437a('0x2e')](_0x902594[_0x437a('0x30')],qs[_0x437a('0x31')](_0x3cbc11[_0x437a('0x2c')][_0x437a('0x31')]));_0x2b886c[_0x437a('0x2f')]=_0x2b886c['attributes'][_0x437a('0x32')]?_0x2b886c[_0x437a('0x2f')]:_0x902594['model'];if(!_0x3cbc11[_0x437a('0x2c')][_0x437a('0x33')]('nolimit')){_0x2b886c['limit']=qs['limit'](_0x3cbc11[_0x437a('0x2c')][_0x437a('0x1d')]);_0x2b886c[_0x437a('0x1c')]=qs[_0x437a('0x1c')](_0x3cbc11[_0x437a('0x2c')][_0x437a('0x1c')]);}_0x2b886c[_0x437a('0x34')]=qs[_0x437a('0x35')](_0x3cbc11['query'][_0x437a('0x35')]);_0x2b886c[_0x437a('0x36')]=qs[_0x437a('0x37')](_[_0x437a('0x38')](_0x3cbc11[_0x437a('0x2c')],_0x902594[_0x437a('0x37')]),_0x4cf64a);if(_0x3cbc11[_0x437a('0x2c')][_0x437a('0x39')]){_0x2b886c[_0x437a('0x36')]=_['merge'](_0x2b886c[_0x437a('0x36')],{'$or':_['map'](_0x4cf64a,function(_0x397742){if(_0x397742[_0x437a('0x2b')]!==_0x437a('0x3a')){var _0x458967={};_0x458967[_0x397742[_0x437a('0x27')]]={'$like':'%'+_0x3cbc11[_0x437a('0x2c')]['filter']+'%'};return _0x458967;}})});}_0x2b886c=_[_0x437a('0x3b')]({},_0x2b886c,_0x3cbc11[_0x437a('0x3c')]);var _0x3f95ca={'where':_0x2b886c[_0x437a('0x36')]};return db[_0x437a('0x3d')][_0x437a('0x1e')](_0x3f95ca)[_0x437a('0x22')](function(_0x491b3f){_0x5b6549['count']=_0x491b3f;if(_0x3cbc11['query'][_0x437a('0x3e')]){_0x2b886c[_0x437a('0x3f')]=[{'all':!![]}];}return db[_0x437a('0x3d')]['findAll'](_0x2b886c);})[_0x437a('0x22')](function(_0x43a6c1){_0x5b6549[_0x437a('0x40')]=_0x43a6c1;return _0x5b6549;})['then'](respondWithFilteredResult(_0x392f4b,_0x2b886c))['catch'](handleError(_0x392f4b,null));};exports['show']=function(_0x134f7c,_0x448a77){var _0x795b60={'raw':![],'where':{'id':_0x134f7c[_0x437a('0x41')]['id']}},_0x295406={};_0x295406[_0x437a('0x30')]=_[_0x437a('0x2d')](db[_0x437a('0x3d')][_0x437a('0x29')]);_0x295406['query']=_[_0x437a('0x2d')](_0x134f7c[_0x437a('0x2c')]);_0x295406[_0x437a('0x37')]=_[_0x437a('0x2e')](_0x295406['model'],_0x295406[_0x437a('0x2c')]);_0x795b60[_0x437a('0x2f')]=_['intersection'](_0x295406[_0x437a('0x30')],qs[_0x437a('0x31')](_0x134f7c['query'][_0x437a('0x31')]));_0x795b60[_0x437a('0x2f')]=_0x795b60[_0x437a('0x2f')][_0x437a('0x32')]?_0x795b60[_0x437a('0x2f')]:_0x295406[_0x437a('0x30')];if(_0x134f7c[_0x437a('0x2c')]['includeAll']){_0x795b60['include']=[{'all':!![]}];}_0x795b60=_[_0x437a('0x3b')]({},_0x795b60,_0x134f7c['options']);return db[_0x437a('0x3d')]['find'](_0x795b60)[_0x437a('0x22')](handleEntityNotFound(_0x448a77,null))[_0x437a('0x22')](respondWithResult(_0x448a77,null))[_0x437a('0x42')](handleError(_0x448a77,null));};exports[_0x437a('0x43')]=function(_0x503782,_0x5a7b94){return db[_0x437a('0x3d')][_0x437a('0x43')](_0x503782[_0x437a('0x44')],{})[_0x437a('0x22')](function(_0x3bcc85){var _0x9271de=_0x503782[_0x437a('0x45')][_0x437a('0x24')]({'plain':!![]});if(!_0x9271de)throw new Error(_0x437a('0x46'));if(_0x9271de['role']===_0x437a('0x45')){var _0x2d12d8=_0x3bcc85[_0x437a('0x24')]({'plain':!![]});var _0x466f1c=_0x437a('0x25');return db[_0x437a('0x47')]['find']({'where':{'name':_0x466f1c,'userProfileId':_0x9271de[_0x437a('0x48')]},'raw':!![]})[_0x437a('0x22')](function(_0x33c6b1){if(_0x33c6b1&&_0x33c6b1['autoAssociation']===0x0){return db['UserProfileResource'][_0x437a('0x43')]({'name':_0x2d12d8[_0x437a('0x27')],'resourceId':_0x2d12d8['id'],'type':_0x33c6b1[_0x437a('0x27')],'sectionId':_0x33c6b1['id']},{})[_0x437a('0x22')](function(){return _0x3bcc85;});}else{return _0x3bcc85;}})['catch'](function(_0x1b255f){logger[_0x437a('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b255f);throw _0x1b255f;});}return _0x3bcc85;})[_0x437a('0x22')](respondWithResult(_0x5a7b94,0xc9))['catch'](handleError(_0x5a7b94,null));};exports['update']=function(_0x6e447f,_0xa5ba34){if(_0x6e447f[_0x437a('0x44')]['id']){delete _0x6e447f[_0x437a('0x44')]['id'];}return db[_0x437a('0x3d')][_0x437a('0x4a')]({'where':{'id':_0x6e447f[_0x437a('0x41')]['id']}})[_0x437a('0x22')](handleEntityNotFound(_0xa5ba34,null))[_0x437a('0x22')](saveUpdates(_0x6e447f[_0x437a('0x44')],null))[_0x437a('0x22')](respondWithResult(_0xa5ba34,null))[_0x437a('0x42')](handleError(_0xa5ba34,null));};exports[_0x437a('0x23')]=function(_0x1d3d96,_0x91fdad){return db[_0x437a('0x3d')]['find']({'where':{'id':_0x1d3d96['params']['id']}})[_0x437a('0x22')](handleEntityNotFound(_0x91fdad,null))[_0x437a('0x22')](removeEntity(_0x91fdad,null))[_0x437a('0x42')](handleError(_0x91fdad,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a1010f3..7bcf81c 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 _0xdeac=['password','ChanSpy','name','options','join','StopMixMonitor','length','concat','internal','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','lodash','util','bluebird','from-sip','format','prefix','system','push','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','merge','Authenticate'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdeac,0x9f));var _0xcdea=function(_0x5079f5,_0x1ffcc6){_0x5079f5=_0x5079f5-0x0;var _0xce895a=_0xdeac[_0x5079f5];return _0xce895a;};'use strict';var _=require(_0xcdea('0x0'));var util=require(_0xcdea('0x1'));var BPromise=require(_0xcdea('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3cb504,_0x57ecbb,_0x29aafe){var _0x4943f8=0x1;var _0x4d855d=[];var _0x176260={'context':_0x57ecbb['context']||_0xcdea('0x3'),'exten':util[_0xcdea('0x4')]('%s%s',_0x3cb504[_0xcdea('0x5')],_0x29aafe),'type':_0xcdea('0x6'),'isApp':![],'ChanSpyId':_0x3cb504['id'],'UserId':_0x57ecbb['id']};_0x4d855d[_0xcdea('0x7')](_['merge']({'app':'Set','appdata':util[_0xcdea('0x4')](_0xcdea('0x8'),_0xcdea('0x9')),'priority':_0x4943f8++},_0x176260));if(_0x3cb504[_0xcdea('0xa')]){_0x4d855d['push'](_['merge']({'app':_0xcdea('0xb'),'appdata':util[_0xcdea('0x4')]('${UNIQUEID}.%s,a',_0x3cb504[_0xcdea('0xc')]),'priority':_0x4943f8++},_0x176260));}if(_0x3cb504[_0xcdea('0xd')]){_0x4d855d[_0xcdea('0x7')](_[_0xcdea('0xe')]({'app':_0xcdea('0xf'),'appdata':_0x3cb504[_0xcdea('0x10')],'priority':_0x4943f8++},_0x176260));}_0x4d855d[_0xcdea('0x7')](_['merge']({'app':_0xcdea('0x11'),'appdata':util[_0xcdea('0x4')]('SIP/%s,%s',_0x57ecbb[_0xcdea('0x12')],_0x3cb504[_0xcdea('0x13')]?_0x3cb504[_0xcdea('0x13')][_0xcdea('0x14')](''):''),'priority':_0x4943f8++},_0x176260));if(_0x3cb504[_0xcdea('0xa')]){_0x4d855d['push'](_[_0xcdea('0xe')]({'app':_0xcdea('0x15'),'priority':_0x4943f8++},_0x176260));}return _0x4d855d;};var getChanSpyApplications=function(_0x1b6896,_0x51f901){var _0x495c5a=[];for(var _0x25dbd5=0x0,_0x446502=0x1;_0x25dbd5<_0x51f901[_0xcdea('0x16')];_0x25dbd5++,_0x446502=0x1){_0x495c5a=_0x495c5a[_0xcdea('0x17')](getUserApplications(_0x1b6896,_0x51f901[_0x25dbd5],_0x51f901[_0x25dbd5][_0xcdea('0x18')]));if(_0x51f901[_0x25dbd5][_0xcdea('0x18')]!=_0x51f901[_0x25dbd5][_0xcdea('0x12')]){_0x495c5a=_0x495c5a['concat'](getUserApplications(_0x1b6896,_0x51f901[_0x25dbd5],_0x51f901[_0x25dbd5][_0xcdea('0x12')]));}}return _0x495c5a;};var getChanSpyPromise=function(_0x5e7ea2,_0x4681bf){return new BPromise(function(_0x5ea791,_0x486f02){return _0x5e7ea2['User'][_0xcdea('0x19')]({'attributes':['id',_0xcdea('0x12'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xcdea('0x1a')](function(_0x1c6dbe){if(_0x1c6dbe){return _0x5ea791(getChanSpyApplications(_0x4681bf,_0x1c6dbe));}return _0x5ea791([]);})[_0xcdea('0x1b')](function(_0x195d64){_0x486f02(_0x195d64);});});};module[_0xcdea('0x1c')]=function(_0x1887b1,_0x3cbcc9){var _0x12f309=_0x1887b1[_0xcdea('0x1d')];return _0x1887b1[_0xcdea('0x1e')](_0xcdea('0x1f'),attributes,{'tableName':_0xcdea('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e6da4,_0x4f174b,_0x4cb31e){return getChanSpyPromise(_0x12f309,_0x5e6da4)[_0xcdea('0x1a')](function(_0x42b7fc){if(_0x42b7fc&&_0x42b7fc[_0xcdea('0x16')]){return _0x12f309[_0xcdea('0x21')][_0xcdea('0x22')](_0x42b7fc);}})[_0xcdea('0x1a')](function(){_0x4cb31e();})[_0xcdea('0x1b')](function(_0x2cc5be){_0x4cb31e(_0x2cc5be);});},'afterUpdate':function(_0x313811,_0x19ba89,_0x2511f1){return _0x12f309[_0xcdea('0x21')]['destroy']({'where':{'ChanSpyId':_0x313811['id']}})[_0xcdea('0x1a')](function(){return getChanSpyPromise(_0x12f309,_0x313811);})[_0xcdea('0x1a')](function(_0x2eb155){if(_0x2eb155&&_0x2eb155[_0xcdea('0x16')]){return _0x12f309[_0xcdea('0x21')][_0xcdea('0x22')](_0x2eb155);}})[_0xcdea('0x1a')](function(){_0x2511f1();})[_0xcdea('0x1b')](function(_0xd943fc){_0x2511f1(_0xd943fc);});},'afterDestroy':function(_0x2dcd6a,_0x17bbe6,_0x14ce81){return _0x12f309[_0xcdea('0x21')]['destroy']({'where':{'ChanSpyId':_0x2dcd6a['id']}})[_0xcdea('0x1a')](function(){_0x14ce81();})[_0xcdea('0x1b')](function(_0x1a54fa){_0x14ce81(_0x1a54fa);});}}});}; \ No newline at end of file +var _0x1b1b=['options','join','length','concat','internal','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','then','destroy','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name'];(function(_0x4c49ef,_0x2a2ac4){var _0x168b85=function(_0x38daf7){while(--_0x38daf7){_0x4c49ef['push'](_0x4c49ef['shift']());}};_0x168b85(++_0x2a2ac4);}(_0x1b1b,0x1a2));var _0xb1b1=function(_0x29b8c1,_0x20140f){_0x29b8c1=_0x29b8c1-0x0;var _0xda1c47=_0x1b1b[_0x29b8c1];return _0xda1c47;};'use strict';var _=require('lodash');var util=require(_0xb1b1('0x0'));var BPromise=require('bluebird');var attributes=require(_0xb1b1('0x1'));var getUserApplications=function(_0x3b5f2f,_0x185d6f,_0x308c1b){var _0x8c4ac0=0x1;var _0x56fec1=[];var _0x2131c8={'context':_0x185d6f[_0xb1b1('0x2')]||_0xb1b1('0x3'),'exten':util[_0xb1b1('0x4')](_0xb1b1('0x5'),_0x3b5f2f[_0xb1b1('0x6')],_0x308c1b),'type':_0xb1b1('0x7'),'isApp':![],'ChanSpyId':_0x3b5f2f['id'],'UserId':_0x185d6f['id']};_0x56fec1[_0xb1b1('0x8')](_['merge']({'app':_0xb1b1('0x9'),'appdata':util[_0xb1b1('0x4')](_0xb1b1('0xa'),_0xb1b1('0xb')),'priority':_0x8c4ac0++},_0x2131c8));if(_0x3b5f2f[_0xb1b1('0xc')]){_0x56fec1[_0xb1b1('0x8')](_[_0xb1b1('0xd')]({'app':'MixMonitor','appdata':util[_0xb1b1('0x4')](_0xb1b1('0xe'),_0x3b5f2f[_0xb1b1('0xf')]),'priority':_0x8c4ac0++},_0x2131c8));}if(_0x3b5f2f[_0xb1b1('0x10')]){_0x56fec1[_0xb1b1('0x8')](_['merge']({'app':_0xb1b1('0x11'),'appdata':_0x3b5f2f[_0xb1b1('0x12')],'priority':_0x8c4ac0++},_0x2131c8));}_0x56fec1[_0xb1b1('0x8')](_[_0xb1b1('0xd')]({'app':_0xb1b1('0x13'),'appdata':util[_0xb1b1('0x4')](_0xb1b1('0x14'),_0x185d6f[_0xb1b1('0x15')],_0x3b5f2f[_0xb1b1('0x16')]?_0x3b5f2f[_0xb1b1('0x16')][_0xb1b1('0x17')](''):''),'priority':_0x8c4ac0++},_0x2131c8));if(_0x3b5f2f[_0xb1b1('0xc')]){_0x56fec1[_0xb1b1('0x8')](_[_0xb1b1('0xd')]({'app':'StopMixMonitor','priority':_0x8c4ac0++},_0x2131c8));}return _0x56fec1;};var getChanSpyApplications=function(_0x15e262,_0x23f440){var _0x4c6230=[];for(var _0x32b441=0x0,_0x5551e2=0x1;_0x32b441<_0x23f440[_0xb1b1('0x18')];_0x32b441++,_0x5551e2=0x1){_0x4c6230=_0x4c6230[_0xb1b1('0x19')](getUserApplications(_0x15e262,_0x23f440[_0x32b441],_0x23f440[_0x32b441][_0xb1b1('0x1a')]));if(_0x23f440[_0x32b441][_0xb1b1('0x1a')]!=_0x23f440[_0x32b441][_0xb1b1('0x15')]){_0x4c6230=_0x4c6230[_0xb1b1('0x19')](getUserApplications(_0x15e262,_0x23f440[_0x32b441],_0x23f440[_0x32b441]['name']));}}return _0x4c6230;};var getChanSpyPromise=function(_0x3de52b,_0x532a3c){return new BPromise(function(_0x10f89b,_0x50d8cd){return _0x3de52b[_0xb1b1('0x1b')][_0xb1b1('0x1c')]({'attributes':['id',_0xb1b1('0x15'),'internal'],'where':{'role':_0xb1b1('0x1d'),'chanspy':!![]},'raw':!![]})['then'](function(_0x562113){if(_0x562113){return _0x10f89b(getChanSpyApplications(_0x532a3c,_0x562113));}return _0x10f89b([]);})[_0xb1b1('0x1e')](function(_0x377022){_0x50d8cd(_0x377022);});});};module[_0xb1b1('0x1f')]=function(_0x5e4edc,_0x508948){var _0x4e5c18=_0x5e4edc[_0xb1b1('0x20')];return _0x5e4edc[_0xb1b1('0x21')](_0xb1b1('0x22'),attributes,{'tableName':_0xb1b1('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f3948,_0x548ebe,_0x1fd1e6){return getChanSpyPromise(_0x4e5c18,_0x4f3948)['then'](function(_0x53e7b9){if(_0x53e7b9&&_0x53e7b9[_0xb1b1('0x18')]){return _0x4e5c18[_0xb1b1('0x24')][_0xb1b1('0x25')](_0x53e7b9);}})['then'](function(){_0x1fd1e6();})[_0xb1b1('0x1e')](function(_0x415f7){_0x1fd1e6(_0x415f7);});},'afterUpdate':function(_0x8eb6f8,_0x1eed24,_0xa5475c){return _0x4e5c18['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x8eb6f8['id']}})[_0xb1b1('0x26')](function(){return getChanSpyPromise(_0x4e5c18,_0x8eb6f8);})[_0xb1b1('0x26')](function(_0xc58b0f){if(_0xc58b0f&&_0xc58b0f[_0xb1b1('0x18')]){return _0x4e5c18[_0xb1b1('0x24')]['bulkCreate'](_0xc58b0f);}})[_0xb1b1('0x26')](function(){_0xa5475c();})[_0xb1b1('0x1e')](function(_0x5329e7){_0xa5475c(_0x5329e7);});},'afterDestroy':function(_0x51b0de,_0x5d9233,_0x4bea0){return _0x4e5c18[_0xb1b1('0x24')][_0xb1b1('0x27')]({'where':{'ChanSpyId':_0x51b0de['id']}})[_0xb1b1('0x26')](function(){_0x4bea0();})[_0xb1b1('0x1e')](function(_0x4d988d){_0x4bea0(_0x4d988d);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4e69d41..c187637 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 _0x6e6c=['randomstring','../../config/utils','rpc','jayson/promise','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x5ac5d6,_0x51eb3e){var _0x2c8e34=function(_0x5103c7){while(--_0x5103c7){_0x5ac5d6['push'](_0x5ac5d6['shift']());}};_0x2c8e34(++_0x51eb3e);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301f55,_0x30a10b,_0x4da7bd){return new BPromise(function(_0x324706,_0x15d268){return client['request'](_0x301f55,_0x4da7bd)[_0xc6e6('0x8')](function(_0x481799){logger[_0xc6e6('0x9')](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));logger[_0xc6e6('0xc')](_0xc6e6('0xd'),_0x30a10b,_0xc6e6('0xb'),JSON[_0xc6e6('0xe')](_0x481799));if(_0x481799[_0xc6e6('0xf')]){if(_0x481799[_0xc6e6('0xf')]['code']===0x1f4){logger[_0xc6e6('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x15d268(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}logger['error'](_0xc6e6('0xa'),_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x324706(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}else{logger['info'](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));_0x324706(_0x481799['result'][_0xc6e6('0x10')]);}})[_0xc6e6('0x11')](function(_0xedf127){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});} \ No newline at end of file +var _0x1339=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x567cc1,_0x3a215a){var _0x4ef3d6=function(_0x213bc0){while(--_0x213bc0){_0x567cc1['push'](_0x567cc1['shift']());}};_0x4ef3d6(++_0x3a215a);}(_0x1339,0x1ed));var _0x9133=function(_0x5d24e6,_0x5d695c){_0x5d24e6=_0x5d24e6-0x0;var _0x13147e=_0x1339[_0x5d24e6];return _0x13147e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index a92e1e7..058c86c 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 _0xe1a9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x18ea02,_0x45c7fe){var _0x306716=function(_0x336694){while(--_0x336694){_0x18ea02['push'](_0x18ea02['shift']());}};_0x306716(++_0x45c7fe);}(_0xe1a9,0x1ea));var _0x9e1a=function(_0x12baf0,_0x47c818){_0x12baf0=_0x12baf0-0x0;var _0x3a4e71=_0xe1a9[_0x12baf0];return _0x3a4e71;};'use strict';var multer=require(_0x9e1a('0x0'));var util=require(_0x9e1a('0x1'));var path=require('path');var timeout=require(_0x9e1a('0x2'));var express=require(_0x9e1a('0x3'));var router=express[_0x9e1a('0x4')]();var fs_extra=require(_0x9e1a('0x5'));var auth=require(_0x9e1a('0x6'));var interaction=require(_0x9e1a('0x7'));var config=require(_0x9e1a('0x8'));var controller=require(_0x9e1a('0x9'));router[_0x9e1a('0xa')]('/',auth[_0x9e1a('0xb')](),controller[_0x9e1a('0xc')]);router['get'](_0x9e1a('0xd'),auth['isAuthenticated'](),controller[_0x9e1a('0xe')]);router['post']('/',auth[_0x9e1a('0xb')](),controller['create']);router[_0x9e1a('0xf')](_0x9e1a('0xd'),auth[_0x9e1a('0xb')](),controller[_0x9e1a('0x10')]);router['delete'](_0x9e1a('0xd'),auth[_0x9e1a('0xb')](),controller[_0x9e1a('0x11')]);module[_0x9e1a('0x12')]=router; \ No newline at end of file +var _0x6c35=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x6c35,0x120));var _0x56c3=function(_0x361a20,_0x3a9221){_0x361a20=_0x361a20-0x0;var _0x16e3c9=_0x6c35[_0x361a20];return _0x16e3c9;};'use strict';var multer=require(_0x56c3('0x0'));var util=require(_0x56c3('0x1'));var path=require('path');var timeout=require(_0x56c3('0x2'));var express=require(_0x56c3('0x3'));var router=express[_0x56c3('0x4')]();var fs_extra=require(_0x56c3('0x5'));var auth=require(_0x56c3('0x6'));var interaction=require(_0x56c3('0x7'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x56c3('0x8')]('/',auth[_0x56c3('0x9')](),controller[_0x56c3('0xa')]);router[_0x56c3('0x8')](_0x56c3('0xb'),auth[_0x56c3('0x9')](),controller[_0x56c3('0xc')]);router[_0x56c3('0xd')]('/',auth[_0x56c3('0x9')](),controller[_0x56c3('0xe')]);router[_0x56c3('0xf')]('/:id',auth[_0x56c3('0x9')](),controller[_0x56c3('0x10')]);router[_0x56c3('0x11')](_0x56c3('0xb'),auth[_0x56c3('0x9')](),controller['destroy']);module[_0x56c3('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 80330df..cb5ab90 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 _0xa199=['name','STRING','BOOLEAN','sequelize','exports'];(function(_0x3f3b01,_0xfe5797){var _0x228322=function(_0xec48){while(--_0xec48){_0x3f3b01['push'](_0x3f3b01['shift']());}};_0x228322(++_0xfe5797);}(_0xa199,0x175));var _0x9a19=function(_0x1f8f46,_0x3f5ab9){_0x1f8f46=_0x1f8f46-0x0;var _0x41a078=_0xa199[_0x1f8f46];return _0x41a078;};'use strict';var Sequelize=require(_0x9a19('0x0'));module[_0x9a19('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9a19('0x2')},'description':{'type':Sequelize[_0x9a19('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9a19('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1d93=['BOOLEAN','exports','STRING','name'];(function(_0x4c5d13,_0x4738e0){var _0x3c14ae=function(_0x257f04){while(--_0x257f04){_0x4c5d13['push'](_0x4c5d13['shift']());}};_0x3c14ae(++_0x4738e0);}(_0x1d93,0x1e1));var _0x31d9=function(_0x5bca45,_0xcc755d){_0x5bca45=_0x5bca45-0x0;var _0x163b59=_0x1d93[_0x5bca45];return _0x163b59;};'use strict';var Sequelize=require('sequelize');module[_0x31d9('0x0')]={'name':{'type':Sequelize[_0x31d9('0x1')],'unique':_0x31d9('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x31d9('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index ca4a1cb..e2a421d 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 _0x1699=['destroy','then','get','UserProfileResource','end','sendStatus','name','send','index','map','VoiceContext','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','includeAll','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','autoAssociation','update','params','join','render','Reload','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','json','undefined','limit','offset','count','Content-Range'];(function(_0x4507c1,_0xa8d71a){var _0x3d3b03=function(_0x438bca){while(--_0x438bca){_0x4507c1['push'](_0x4507c1['shift']());}};_0x3d3b03(++_0xa8d71a);}(_0x1699,0xfd));var _0x9169=function(_0x4663cf,_0x4045b2){_0x4663cf=_0x4663cf-0x0;var _0x5e7f76=_0x1699[_0x4663cf];return _0x5e7f76;};'use strict';var emlformat=require(_0x9169('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9169('0x1'));var jsonpatch=require(_0x9169('0x2'));var rp=require(_0x9169('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9169('0x4'));var util=require(_0x9169('0x5'));var path=require('path');var sox=require(_0x9169('0x6'));var csv=require(_0x9169('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9169('0x8'));var squel=require(_0x9169('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9169('0xa'));var toCsv=require(_0x9169('0x7'));var querystring=require('querystring');var Papa=require(_0x9169('0xb'));var Redis=require(_0x9169('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9169('0xd'));var as=require(_0x9169('0xe'));var hardwareService=require(_0x9169('0xf'));var logger=require(_0x9169('0x10'))('api');var utils=require(_0x9169('0x11'));var config=require(_0x9169('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9169('0x13'))['db'];var jayson=require(_0x9169('0x14'));var client=jayson[_0x9169('0x15')][_0x9169('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2440dd,_0x4ae0ec,_0x1a583d,_0x4dda35){return new BPromise(function(_0x400fa2,_0x2f07cb){var _0x534a31=_0x4dda35||client;return _0x534a31[_0x9169('0x17')](_0x2440dd,_0x1a583d)['then'](function(_0x2e0ddc){logger[_0x9169('0x18')](_0x9169('0x19'),_0x4ae0ec,'request\x20sent');logger[_0x9169('0x1a')](_0x9169('0x1b'),_0x4ae0ec,_0x9169('0x1c'),JSON[_0x9169('0x1d')](_0x2e0ddc));if(_0x2e0ddc[_0x9169('0x1e')]){if(_0x2e0ddc[_0x9169('0x1e')][_0x9169('0x1f')]===0x1f4){logger[_0x9169('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x4ae0ec,_0x2e0ddc[_0x9169('0x1e')][_0x9169('0x20')]);return _0x2f07cb(_0x2e0ddc[_0x9169('0x1e')][_0x9169('0x20')]);}logger[_0x9169('0x1e')](_0x9169('0x19'),_0x4ae0ec,_0x2e0ddc['error'][_0x9169('0x20')]);return _0x400fa2(_0x2e0ddc[_0x9169('0x1e')]['message']);}else{logger[_0x9169('0x18')](_0x9169('0x19'),_0x4ae0ec,_0x9169('0x1c'));_0x400fa2(_0x2e0ddc[_0x9169('0x21')][_0x9169('0x20')]);}})['catch'](function(_0x580800){logger[_0x9169('0x1e')](_0x9169('0x19'),_0x4ae0ec,_0x580800);_0x2f07cb(_0x580800);});});}function respondWithStatusCode(_0x2c3081,_0xbb69e2){_0xbb69e2=_0xbb69e2||0xcc;return function(_0xcd28d6){if(_0xcd28d6){return _0x2c3081['sendStatus'](_0xbb69e2);}return _0x2c3081[_0x9169('0x22')](_0xbb69e2)['end']();};}function respondWithResult(_0x32ec93,_0x1930a0){_0x1930a0=_0x1930a0||0xc8;return function(_0x501802){if(_0x501802){return _0x32ec93[_0x9169('0x22')](_0x1930a0)[_0x9169('0x23')](_0x501802);}};}function respondWithFilteredResult(_0x5c1bf1,_0x33a533){return function(_0x4bc3a4){if(_0x4bc3a4){var _0x123d64=typeof _0x33a533['offset']===_0x9169('0x24')&&typeof _0x33a533[_0x9169('0x25')]===_0x9169('0x24');var _0x14b287=_0x4bc3a4['count'];var _0x18ae69=_0x123d64?0x0:_0x33a533[_0x9169('0x26')];var _0x575b14=_0x123d64?_0x4bc3a4[_0x9169('0x27')]:_0x33a533[_0x9169('0x26')]+_0x33a533['limit'];var _0x36b59d;if(_0x575b14>=_0x14b287){_0x575b14=_0x14b287;_0x36b59d=0xc8;}else{_0x36b59d=0xce;}_0x5c1bf1[_0x9169('0x22')](_0x36b59d);return _0x5c1bf1['set'](_0x9169('0x28'),_0x18ae69+'-'+_0x575b14+'/'+_0x14b287)[_0x9169('0x23')](_0x4bc3a4);}return null;};}function patchUpdates(_0xa565f5){return function(_0xdf5a48){try{jsonpatch['apply'](_0xdf5a48,_0xa565f5,!![]);}catch(_0xdaebfe){return BPromise['reject'](_0xdaebfe);}return _0xdf5a48['save']();};}function saveUpdates(_0x3592f3,_0x43615a){return function(_0x5ced58){if(_0x5ced58){return _0x5ced58['update'](_0x3592f3)['then'](function(_0x133661){return _0x133661;});}return null;};}function removeEntity(_0x411d5d,_0x3ff148){return function(_0x1644cd){if(_0x1644cd){return _0x1644cd[_0x9169('0x29')]()[_0x9169('0x2a')](function(){var _0x3225ad=_0x1644cd[_0x9169('0x2b')]({'plain':!![]});var _0x3e420e='Contexts';return db[_0x9169('0x2c')][_0x9169('0x29')]({'where':{'type':_0x3e420e,'resourceId':_0x3225ad['id']}})['then'](function(){return _0x1644cd;});})[_0x9169('0x2a')](function(){_0x411d5d[_0x9169('0x22')](0xcc)[_0x9169('0x2d')]();});}};}function handleEntityNotFound(_0x219ff8,_0x47249e){return function(_0x4a7594){if(!_0x4a7594){_0x219ff8[_0x9169('0x2e')](0x194);}return _0x4a7594;};}function handleError(_0x47871a,_0x438331){_0x438331=_0x438331||0x1f4;return function(_0x5c8176){logger[_0x9169('0x1e')](_0x5c8176['stack']);if(_0x5c8176[_0x9169('0x2f')]){delete _0x5c8176['name'];}_0x47871a[_0x9169('0x22')](_0x438331)[_0x9169('0x30')](_0x5c8176);};}exports[_0x9169('0x31')]=function(_0x14e27f,_0x531208){var _0x35dda5={},_0x436b65={},_0x535a99={'count':0x0,'rows':[]};var _0x275b34=_[_0x9169('0x32')](db[_0x9169('0x33')][_0x9169('0x34')],function(_0x1934cc){return{'name':_0x1934cc[_0x9169('0x35')],'type':_0x1934cc['type']['key']};});_0x436b65[_0x9169('0x36')]=_[_0x9169('0x32')](_0x275b34,_0x9169('0x2f'));_0x436b65[_0x9169('0x37')]=_[_0x9169('0x38')](_0x14e27f[_0x9169('0x37')]);_0x436b65[_0x9169('0x39')]=_['intersection'](_0x436b65[_0x9169('0x36')],_0x436b65[_0x9169('0x37')]);_0x35dda5[_0x9169('0x3a')]=_[_0x9169('0x3b')](_0x436b65['model'],qs[_0x9169('0x3c')](_0x14e27f[_0x9169('0x37')][_0x9169('0x3c')]));_0x35dda5[_0x9169('0x3a')]=_0x35dda5[_0x9169('0x3a')]['length']?_0x35dda5[_0x9169('0x3a')]:_0x436b65[_0x9169('0x36')];if(!_0x14e27f[_0x9169('0x37')][_0x9169('0x3d')]('nolimit')){_0x35dda5['limit']=qs[_0x9169('0x25')](_0x14e27f[_0x9169('0x37')][_0x9169('0x25')]);_0x35dda5[_0x9169('0x26')]=qs[_0x9169('0x26')](_0x14e27f['query'][_0x9169('0x26')]);}_0x35dda5[_0x9169('0x3e')]=qs[_0x9169('0x3f')](_0x14e27f[_0x9169('0x37')][_0x9169('0x3f')]);_0x35dda5[_0x9169('0x40')]=qs[_0x9169('0x39')](_[_0x9169('0x41')](_0x14e27f[_0x9169('0x37')],_0x436b65[_0x9169('0x39')]),_0x275b34);if(_0x14e27f[_0x9169('0x37')][_0x9169('0x42')]){_0x35dda5[_0x9169('0x40')]=_[_0x9169('0x43')](_0x35dda5[_0x9169('0x40')],{'$or':_[_0x9169('0x32')](_0x275b34,function(_0x1a8fe1){if(_0x1a8fe1[_0x9169('0x44')]!=='VIRTUAL'){var _0x4a7dde={};_0x4a7dde[_0x1a8fe1[_0x9169('0x2f')]]={'$like':'%'+_0x14e27f['query'][_0x9169('0x42')]+'%'};return _0x4a7dde;}})});}_0x35dda5=_['merge']({},_0x35dda5,_0x14e27f[_0x9169('0x45')]);var _0x34c130={'where':_0x35dda5[_0x9169('0x40')]};return db[_0x9169('0x33')][_0x9169('0x27')](_0x34c130)[_0x9169('0x2a')](function(_0x514524){_0x535a99[_0x9169('0x27')]=_0x514524;if(_0x14e27f[_0x9169('0x37')]['includeAll']){_0x35dda5[_0x9169('0x46')]=[{'all':!![]}];}return db[_0x9169('0x33')][_0x9169('0x47')](_0x35dda5);})[_0x9169('0x2a')](function(_0x692411){_0x535a99[_0x9169('0x48')]=_0x692411;return _0x535a99;})['then'](respondWithFilteredResult(_0x531208,_0x35dda5))[_0x9169('0x49')](handleError(_0x531208,null));};exports[_0x9169('0x4a')]=function(_0x447777,_0xa4ca4e){var _0x1330fa={'raw':![],'where':{'id':_0x447777['params']['id']}},_0x1e7fa9={};_0x1e7fa9['model']=_[_0x9169('0x38')](db[_0x9169('0x33')][_0x9169('0x34')]);_0x1e7fa9['query']=_[_0x9169('0x38')](_0x447777[_0x9169('0x37')]);_0x1e7fa9[_0x9169('0x39')]=_[_0x9169('0x3b')](_0x1e7fa9[_0x9169('0x36')],_0x1e7fa9['query']);_0x1330fa[_0x9169('0x3a')]=_[_0x9169('0x3b')](_0x1e7fa9[_0x9169('0x36')],qs[_0x9169('0x3c')](_0x447777[_0x9169('0x37')][_0x9169('0x3c')]));_0x1330fa[_0x9169('0x3a')]=_0x1330fa[_0x9169('0x3a')]['length']?_0x1330fa[_0x9169('0x3a')]:_0x1e7fa9[_0x9169('0x36')];if(_0x447777[_0x9169('0x37')][_0x9169('0x4b')]){_0x1330fa[_0x9169('0x46')]=[{'all':!![]}];}_0x1330fa=_[_0x9169('0x43')]({},_0x1330fa,_0x447777[_0x9169('0x45')]);return db[_0x9169('0x33')][_0x9169('0x4c')](_0x1330fa)[_0x9169('0x2a')](handleEntityNotFound(_0xa4ca4e,null))['then'](respondWithResult(_0xa4ca4e,null))['catch'](handleError(_0xa4ca4e,null));};exports[_0x9169('0x4d')]=function(_0x33a6c9,_0x2f5187,_0x5464de){var _0x6df7e0;return db[_0x9169('0x33')][_0x9169('0x4d')](_0x33a6c9[_0x9169('0x4e')],{'raw':!![]})[_0x9169('0x2a')](function(_0x2eb533){_0x6df7e0=_0x2eb533;return db['VoiceContext'][_0x9169('0x47')]({'raw':!![]});})[_0x9169('0x2a')](function(_0x3a2efc){var _0x4e07cc=fs[_0x9169('0x4f')](path['join'](config[_0x9169('0x50')],_0x9169('0x51')),_0x9169('0x52'));var _0xf13431=ejs['render'](_0x4e07cc,{'contexts':_0x3a2efc||[]});fs[_0x9169('0x53')](_0x9169('0x54'),_0xf13431);})[_0x9169('0x2a')](function(){return respondWithRpcPromise('Reload',_0x9169('0x4d'),{'module':_0x9169('0x55')});})[_0x9169('0x2a')](function(){var _0x27f226=_0x33a6c9['user'][_0x9169('0x2b')]({'plain':!![]});if(!_0x27f226)throw new Error(_0x9169('0x56'));if(_0x27f226[_0x9169('0x57')]===_0x9169('0x58')){var _0x3315c9=_0x6df7e0[_0x9169('0x2b')]({'plain':!![]});return db[_0x9169('0x59')][_0x9169('0x4c')]({'where':{'name':_0x9169('0x5a'),'userProfileId':_0x27f226[_0x9169('0x5b')]},'raw':!![]})[_0x9169('0x2a')](function(_0x5127e3){if(_0x5127e3&&_0x5127e3[_0x9169('0x5c')]===0x0){return db[_0x9169('0x2c')][_0x9169('0x4d')]({'name':_0x3315c9[_0x9169('0x2f')],'resourceId':_0x3315c9['id'],'type':_0x5127e3[_0x9169('0x2f')],'sectionId':_0x5127e3['id']},{})[_0x9169('0x2a')](function(){return _0x6df7e0;});}else{return _0x6df7e0;}})['catch'](function(_0x2314ee){logger[_0x9169('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2314ee);throw _0x2314ee;});}return _0x6df7e0;})['then'](respondWithResult(_0x2f5187,0xc9))[_0x9169('0x49')](handleError(_0x2f5187,null));};exports[_0x9169('0x5d')]=function(_0x250bc8,_0x38aa47,_0x352b95){var _0x444de1;return db['VoiceContext'][_0x9169('0x4c')]({'where':{'id':_0x250bc8[_0x9169('0x5e')]['id']}})['then'](handleEntityNotFound(_0x38aa47,null))[_0x9169('0x2a')](saveUpdates(_0x250bc8[_0x9169('0x4e')],null))[_0x9169('0x2a')](function(_0x29b22e){if(_0x29b22e){_0x444de1=_0x29b22e;return db[_0x9169('0x33')][_0x9169('0x47')]({'raw':!![]});}})[_0x9169('0x2a')](function(_0x4eb79f){var _0x1e3d6d=fs[_0x9169('0x4f')](path[_0x9169('0x5f')](config[_0x9169('0x50')],_0x9169('0x51')),_0x9169('0x52'));var _0x114619=ejs[_0x9169('0x60')](_0x1e3d6d,{'contexts':_0x4eb79f||[]});fs[_0x9169('0x53')](_0x9169('0x54'),_0x114619);})['then'](function(){return respondWithRpcPromise(_0x9169('0x61'),_0x9169('0x5d'),{'module':_0x9169('0x55')});})[_0x9169('0x2a')](function(){return _0x444de1;})[_0x9169('0x2a')](respondWithResult(_0x38aa47,null))[_0x9169('0x49')](handleError(_0x38aa47,null));};exports[_0x9169('0x29')]=function(_0x51076f,_0x2f09fe,_0x51b424){var _0x246a91;return db[_0x9169('0x33')][_0x9169('0x4c')]({'where':{'id':_0x51076f['params']['id']}})['then'](handleEntityNotFound(_0x2f09fe,null))['then'](removeEntity(_0x2f09fe,null))['then'](function(){return db['VoiceContext'][_0x9169('0x47')]({'raw':!![]});})['then'](function(_0xf25d58){var _0x49e4e1=fs[_0x9169('0x4f')](path[_0x9169('0x5f')](config[_0x9169('0x50')],_0x9169('0x51')),_0x9169('0x52'));var _0x5014ed=ejs['render'](_0x49e4e1,{'contexts':_0xf25d58});fs[_0x9169('0x53')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5014ed);return respondWithRpcPromise(_0x9169('0x61'),_0x9169('0x29'),{'module':_0x9169('0x55')});})['catch'](handleError(_0x2f09fe,null));}; \ No newline at end of file +var _0x86c0=['crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','status','end','json','limit','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','user','get','role','UserProfileSection','autoAssociation','update','/etc/asterisk/extensions_xcally_contexts.conf','utf8','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash'];(function(_0xdcdb81,_0x44da57){var _0x26d3a5=function(_0x5dd20d){while(--_0x5dd20d){_0xdcdb81['push'](_0xdcdb81['shift']());}};_0x26d3a5(++_0x44da57);}(_0x86c0,0x175));var _0x086c=function(_0x5bd049,_0x43d163){_0x5bd049=_0x5bd049-0x0;var _0xc980fa=_0x86c0[_0x5bd049];return _0xc980fa;};'use strict';var emlformat=require(_0x086c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x086c('0x1'));var jsonpatch=require(_0x086c('0x2'));var rp=require(_0x086c('0x3'));var moment=require(_0x086c('0x4'));var BPromise=require(_0x086c('0x5'));var Mustache=require(_0x086c('0x6'));var util=require(_0x086c('0x7'));var path=require(_0x086c('0x8'));var sox=require(_0x086c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x086c('0xa'));var squel=require('squel');var crypto=require(_0x086c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x086c('0xc'));var toCsv=require(_0x086c('0xd'));var querystring=require('querystring');var Papa=require(_0x086c('0xe'));var Redis=require(_0x086c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x086c('0x10'));var as=require(_0x086c('0x11'));var hardwareService=require(_0x086c('0x12'));var logger=require(_0x086c('0x13'))(_0x086c('0x14'));var utils=require(_0x086c('0x15'));var config=require(_0x086c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x086c('0x17'))['db'];var jayson=require(_0x086c('0x18'));var client=jayson[_0x086c('0x19')][_0x086c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x37a10e,_0x33ec81,_0xcb8f1,_0x2d3027){return new BPromise(function(_0x52cfc7,_0x131ce3){var _0x4ebcce=_0x2d3027||client;return _0x4ebcce[_0x086c('0x1b')](_0x37a10e,_0xcb8f1)['then'](function(_0x411178){logger[_0x086c('0x1c')](_0x086c('0x1d'),_0x33ec81,'request\x20sent');logger['debug'](_0x086c('0x1e'),_0x33ec81,_0x086c('0x1f'),JSON[_0x086c('0x20')](_0x411178));if(_0x411178[_0x086c('0x21')]){if(_0x411178['error']['code']===0x1f4){logger['error'](_0x086c('0x1d'),_0x33ec81,_0x411178['error'][_0x086c('0x22')]);return _0x131ce3(_0x411178['error']['message']);}logger[_0x086c('0x21')]('VoiceContext,\x20%s,\x20%s',_0x33ec81,_0x411178[_0x086c('0x21')][_0x086c('0x22')]);return _0x52cfc7(_0x411178[_0x086c('0x21')][_0x086c('0x22')]);}else{logger[_0x086c('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x33ec81,_0x086c('0x1f'));_0x52cfc7(_0x411178['result'][_0x086c('0x22')]);}})['catch'](function(_0x45643a){logger['error'](_0x086c('0x1d'),_0x33ec81,_0x45643a);_0x131ce3(_0x45643a);});});}function respondWithStatusCode(_0x67de9,_0x300cb9){_0x300cb9=_0x300cb9||0xcc;return function(_0x49ed56){if(_0x49ed56){return _0x67de9['sendStatus'](_0x300cb9);}return _0x67de9[_0x086c('0x23')](_0x300cb9)[_0x086c('0x24')]();};}function respondWithResult(_0x30ade0,_0x4ac79f){_0x4ac79f=_0x4ac79f||0xc8;return function(_0x36462a){if(_0x36462a){return _0x30ade0[_0x086c('0x23')](_0x4ac79f)[_0x086c('0x25')](_0x36462a);}};}function respondWithFilteredResult(_0x298b5e,_0xbe365a){return function(_0x4fc64a){if(_0x4fc64a){var _0x27708a=typeof _0xbe365a['offset']==='undefined'&&typeof _0xbe365a[_0x086c('0x26')]==='undefined';var _0x486126=_0x4fc64a[_0x086c('0x27')];var _0x40fe12=_0x27708a?0x0:_0xbe365a[_0x086c('0x28')];var _0x2885b6=_0x27708a?_0x4fc64a[_0x086c('0x27')]:_0xbe365a[_0x086c('0x28')]+_0xbe365a[_0x086c('0x26')];var _0x555707;if(_0x2885b6>=_0x486126){_0x2885b6=_0x486126;_0x555707=0xc8;}else{_0x555707=0xce;}_0x298b5e[_0x086c('0x23')](_0x555707);return _0x298b5e[_0x086c('0x29')](_0x086c('0x2a'),_0x40fe12+'-'+_0x2885b6+'/'+_0x486126)[_0x086c('0x25')](_0x4fc64a);}return null;};}function patchUpdates(_0xeb0189){return function(_0x244951){try{jsonpatch[_0x086c('0x2b')](_0x244951,_0xeb0189,!![]);}catch(_0xffced){return BPromise['reject'](_0xffced);}return _0x244951[_0x086c('0x2c')]();};}function saveUpdates(_0x2fe3ba,_0x14231b){return function(_0x1a7f34){if(_0x1a7f34){return _0x1a7f34['update'](_0x2fe3ba)[_0x086c('0x2d')](function(_0x50e5f2){return _0x50e5f2;});}return null;};}function removeEntity(_0x106439,_0x543320){return function(_0x3f6739){if(_0x3f6739){return _0x3f6739[_0x086c('0x2e')]()[_0x086c('0x2d')](function(){var _0x32a703=_0x3f6739['get']({'plain':!![]});var _0x51d5f5='Contexts';return db['UserProfileResource']['destroy']({'where':{'type':_0x51d5f5,'resourceId':_0x32a703['id']}})['then'](function(){return _0x3f6739;});})[_0x086c('0x2d')](function(){_0x106439['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa03dd0,_0x23908c){return function(_0x360488){if(!_0x360488){_0xa03dd0[_0x086c('0x2f')](0x194);}return _0x360488;};}function handleError(_0x542038,_0x17ad94){_0x17ad94=_0x17ad94||0x1f4;return function(_0x5ba711){logger[_0x086c('0x21')](_0x5ba711['stack']);if(_0x5ba711[_0x086c('0x30')]){delete _0x5ba711['name'];}_0x542038[_0x086c('0x23')](_0x17ad94)[_0x086c('0x31')](_0x5ba711);};}exports[_0x086c('0x32')]=function(_0x3e0fac,_0x489ac8){var _0x7a24f5={},_0x131929={},_0x555c15={'count':0x0,'rows':[]};var _0x28f777=_[_0x086c('0x33')](db[_0x086c('0x34')][_0x086c('0x35')],function(_0x5d7923){return{'name':_0x5d7923[_0x086c('0x36')],'type':_0x5d7923['type'][_0x086c('0x37')]};});_0x131929['model']=_['map'](_0x28f777,_0x086c('0x30'));_0x131929[_0x086c('0x38')]=_[_0x086c('0x39')](_0x3e0fac[_0x086c('0x38')]);_0x131929['filters']=_[_0x086c('0x3a')](_0x131929[_0x086c('0x3b')],_0x131929[_0x086c('0x38')]);_0x7a24f5['attributes']=_[_0x086c('0x3a')](_0x131929[_0x086c('0x3b')],qs['fields'](_0x3e0fac[_0x086c('0x38')][_0x086c('0x3c')]));_0x7a24f5[_0x086c('0x3d')]=_0x7a24f5[_0x086c('0x3d')][_0x086c('0x3e')]?_0x7a24f5['attributes']:_0x131929['model'];if(!_0x3e0fac[_0x086c('0x38')][_0x086c('0x3f')]('nolimit')){_0x7a24f5[_0x086c('0x26')]=qs[_0x086c('0x26')](_0x3e0fac[_0x086c('0x38')][_0x086c('0x26')]);_0x7a24f5[_0x086c('0x28')]=qs[_0x086c('0x28')](_0x3e0fac[_0x086c('0x38')][_0x086c('0x28')]);}_0x7a24f5['order']=qs[_0x086c('0x40')](_0x3e0fac[_0x086c('0x38')][_0x086c('0x40')]);_0x7a24f5[_0x086c('0x41')]=qs[_0x086c('0x42')](_['pick'](_0x3e0fac['query'],_0x131929[_0x086c('0x42')]),_0x28f777);if(_0x3e0fac[_0x086c('0x38')]['filter']){_0x7a24f5[_0x086c('0x41')]=_[_0x086c('0x43')](_0x7a24f5[_0x086c('0x41')],{'$or':_['map'](_0x28f777,function(_0x5f8a7){if(_0x5f8a7[_0x086c('0x44')]!==_0x086c('0x45')){var _0x1fe448={};_0x1fe448[_0x5f8a7[_0x086c('0x30')]]={'$like':'%'+_0x3e0fac[_0x086c('0x38')][_0x086c('0x46')]+'%'};return _0x1fe448;}})});}_0x7a24f5=_[_0x086c('0x43')]({},_0x7a24f5,_0x3e0fac[_0x086c('0x47')]);var _0x4f6355={'where':_0x7a24f5[_0x086c('0x41')]};return db['VoiceContext']['count'](_0x4f6355)['then'](function(_0x5756ce){_0x555c15[_0x086c('0x27')]=_0x5756ce;if(_0x3e0fac[_0x086c('0x38')][_0x086c('0x48')]){_0x7a24f5[_0x086c('0x49')]=[{'all':!![]}];}return db['VoiceContext'][_0x086c('0x4a')](_0x7a24f5);})[_0x086c('0x2d')](function(_0x3e8fc9){_0x555c15['rows']=_0x3e8fc9;return _0x555c15;})[_0x086c('0x2d')](respondWithFilteredResult(_0x489ac8,_0x7a24f5))[_0x086c('0x4b')](handleError(_0x489ac8,null));};exports[_0x086c('0x4c')]=function(_0x240376,_0x4bb31b){var _0x5d7c6a={'raw':![],'where':{'id':_0x240376[_0x086c('0x4d')]['id']}},_0x2f589c={};_0x2f589c[_0x086c('0x3b')]=_['keys'](db[_0x086c('0x34')][_0x086c('0x35')]);_0x2f589c['query']=_[_0x086c('0x39')](_0x240376[_0x086c('0x38')]);_0x2f589c[_0x086c('0x42')]=_[_0x086c('0x3a')](_0x2f589c[_0x086c('0x3b')],_0x2f589c[_0x086c('0x38')]);_0x5d7c6a[_0x086c('0x3d')]=_[_0x086c('0x3a')](_0x2f589c[_0x086c('0x3b')],qs[_0x086c('0x3c')](_0x240376[_0x086c('0x38')]['fields']));_0x5d7c6a['attributes']=_0x5d7c6a['attributes'][_0x086c('0x3e')]?_0x5d7c6a[_0x086c('0x3d')]:_0x2f589c['model'];if(_0x240376[_0x086c('0x38')][_0x086c('0x48')]){_0x5d7c6a[_0x086c('0x49')]=[{'all':!![]}];}_0x5d7c6a=_[_0x086c('0x43')]({},_0x5d7c6a,_0x240376[_0x086c('0x47')]);return db['VoiceContext'][_0x086c('0x4e')](_0x5d7c6a)['then'](handleEntityNotFound(_0x4bb31b,null))['then'](respondWithResult(_0x4bb31b,null))[_0x086c('0x4b')](handleError(_0x4bb31b,null));};exports[_0x086c('0x4f')]=function(_0x472a8e,_0x1df3c0,_0x2aa82b){var _0x49f820;return db[_0x086c('0x34')][_0x086c('0x4f')](_0x472a8e['body'],{'raw':!![]})[_0x086c('0x2d')](function(_0x3a8a5b){_0x49f820=_0x3a8a5b;return db[_0x086c('0x34')][_0x086c('0x4a')]({'raw':!![]});})[_0x086c('0x2d')](function(_0x1241b8){var _0x3e8601=fs[_0x086c('0x50')](path[_0x086c('0x51')](config[_0x086c('0x52')],_0x086c('0x53')),'utf8');var _0x2956c3=ejs[_0x086c('0x54')](_0x3e8601,{'contexts':_0x1241b8||[]});fs[_0x086c('0x55')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2956c3);})['then'](function(){return respondWithRpcPromise(_0x086c('0x56'),'create',{'module':_0x086c('0x57')});})['then'](function(){var _0x5429b4=_0x472a8e[_0x086c('0x58')][_0x086c('0x59')]({'plain':!![]});if(!_0x5429b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5429b4[_0x086c('0x5a')]==='user'){var _0x39da5c=_0x49f820[_0x086c('0x59')]({'plain':!![]});return db[_0x086c('0x5b')][_0x086c('0x4e')]({'where':{'name':'Contexts','userProfileId':_0x5429b4['userProfileId']},'raw':!![]})[_0x086c('0x2d')](function(_0x2a79b5){if(_0x2a79b5&&_0x2a79b5[_0x086c('0x5c')]===0x0){return db['UserProfileResource'][_0x086c('0x4f')]({'name':_0x39da5c[_0x086c('0x30')],'resourceId':_0x39da5c['id'],'type':_0x2a79b5[_0x086c('0x30')],'sectionId':_0x2a79b5['id']},{})[_0x086c('0x2d')](function(){return _0x49f820;});}else{return _0x49f820;}})[_0x086c('0x4b')](function(_0x15dfe0){logger[_0x086c('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15dfe0);throw _0x15dfe0;});}return _0x49f820;})[_0x086c('0x2d')](respondWithResult(_0x1df3c0,0xc9))[_0x086c('0x4b')](handleError(_0x1df3c0,null));};exports[_0x086c('0x5d')]=function(_0x13e4c4,_0x3155cd,_0x214779){var _0x2296cd;return db[_0x086c('0x34')][_0x086c('0x4e')]({'where':{'id':_0x13e4c4['params']['id']}})[_0x086c('0x2d')](handleEntityNotFound(_0x3155cd,null))['then'](saveUpdates(_0x13e4c4['body'],null))[_0x086c('0x2d')](function(_0xa888b3){if(_0xa888b3){_0x2296cd=_0xa888b3;return db[_0x086c('0x34')]['findAll']({'raw':!![]});}})['then'](function(_0x3865aa){var _0x1fe298=fs[_0x086c('0x50')](path['join'](config['root'],_0x086c('0x53')),'utf8');var _0x3d048e=ejs[_0x086c('0x54')](_0x1fe298,{'contexts':_0x3865aa||[]});fs[_0x086c('0x55')](_0x086c('0x5e'),_0x3d048e);})[_0x086c('0x2d')](function(){return respondWithRpcPromise(_0x086c('0x56'),_0x086c('0x5d'),{'module':_0x086c('0x57')});})[_0x086c('0x2d')](function(){return _0x2296cd;})[_0x086c('0x2d')](respondWithResult(_0x3155cd,null))[_0x086c('0x4b')](handleError(_0x3155cd,null));};exports[_0x086c('0x2e')]=function(_0x84c51b,_0x2701d0,_0x524b1a){var _0x5c2865;return db[_0x086c('0x34')]['find']({'where':{'id':_0x84c51b[_0x086c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2701d0,null))[_0x086c('0x2d')](removeEntity(_0x2701d0,null))[_0x086c('0x2d')](function(){return db['VoiceContext'][_0x086c('0x4a')]({'raw':!![]});})[_0x086c('0x2d')](function(_0x1e6e9f){var _0x174316=fs[_0x086c('0x50')](path[_0x086c('0x51')](config[_0x086c('0x52')],_0x086c('0x53')),_0x086c('0x5f'));var _0x1e1685=ejs[_0x086c('0x54')](_0x174316,{'contexts':_0x1e6e9f});fs['writeFileSync'](_0x086c('0x5e'),_0x1e1685);return respondWithRpcPromise('Reload',_0x086c('0x2e'),{'module':_0x086c('0x57')});})[_0x086c('0x4b')](handleError(_0x2701d0,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7945e8b..6062d88 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 _0x2032=['voice_contexts','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x64a79f,_0x336a5b){var _0x54e767=function(_0x53c09e){while(--_0x53c09e){_0x64a79f['push'](_0x64a79f['shift']());}};_0x54e767(++_0x336a5b);}(_0x2032,0xd9));var _0x2203=function(_0x13ae80,_0x2cdcf3){_0x13ae80=_0x13ae80-0x0;var _0x4bf4f2=_0x2032[_0x13ae80];return _0x4bf4f2;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6a1=['../../config/environment','exports','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xb6a1,0x14d));var _0x1b6a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb6a1[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x1b6a('0x0'));var util=require(_0x1b6a('0x1'));var logger=require(_0x1b6a('0x2'))(_0x1b6a('0x3'));var moment=require('moment');var BPromise=require(_0x1b6a('0x4'));var rp=require(_0x1b6a('0x5'));var fs=require('fs');var path=require(_0x1b6a('0x6'));var rimraf=require('rimraf');var config=require(_0x1b6a('0x7'));var attributes=require('./voiceContext.attributes');module[_0x1b6a('0x8')]=function(_0x464307,_0x27ef3d){return _0x464307['define'](_0x1b6a('0x9'),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 df066ac..929b6c5 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 _0x590a=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56ac6a,_0x35ed04){var _0x169575=function(_0x1c5694){while(--_0x1c5694){_0x56ac6a['push'](_0x56ac6a['shift']());}};_0x169575(++_0x35ed04);}(_0x590a,0x159));var _0xa590=function(_0x1be143,_0x2f58ed){_0x1be143=_0x1be143-0x0;var _0xaa3f65=_0x590a[_0x1be143];return _0xaa3f65;};'use strict';var _=require('lodash');var util=require(_0xa590('0x0'));var moment=require(_0xa590('0x1'));var BPromise=require(_0xa590('0x2'));var rs=require(_0xa590('0x3'));var fs=require('fs');var Redis=require(_0xa590('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa590('0x5'))(_0xa590('0x6'));var config=require(_0xa590('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa590('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dcf20,_0x163d19,_0x2ad01a){return new BPromise(function(_0x27a5fa,_0x5d9565){return client['request'](_0x2dcf20,_0x2ad01a)[_0xa590('0x9')](function(_0x486f78){logger[_0xa590('0xa')](_0xa590('0xb'),_0x163d19,_0xa590('0xc'));logger['debug'](_0xa590('0xd'),_0x163d19,_0xa590('0xc'),JSON[_0xa590('0xe')](_0x486f78));if(_0x486f78[_0xa590('0xf')]){if(_0x486f78[_0xa590('0xf')][_0xa590('0x10')]===0x1f4){logger[_0xa590('0xf')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0x486f78['error'][_0xa590('0x11')]);return _0x5d9565(_0x486f78[_0xa590('0xf')][_0xa590('0x11')]);}logger[_0xa590('0xf')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0x486f78[_0xa590('0xf')][_0xa590('0x11')]);return _0x27a5fa(_0x486f78['error']['message']);}else{logger[_0xa590('0xa')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0xa590('0xc'));_0x27a5fa(_0x486f78[_0xa590('0x12')][_0xa590('0x11')]);}})[_0xa590('0x13')](function(_0xfb7055){logger[_0xa590('0xf')](_0xa590('0xb'),_0x163d19,_0xfb7055);_0x5d9565(_0xfb7055);});});} \ No newline at end of file +var _0x1f3c=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x27d7e3,_0x3048d7){var _0x55c1a=function(_0x3ab7b7){while(--_0x3ab7b7){_0x27d7e3['push'](_0x27d7e3['shift']());}};_0x55c1a(++_0x3048d7);}(_0x1f3c,0xd7));var _0xc1f3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1f3c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc1f3('0x0'));var util=require(_0xc1f3('0x1'));var moment=require(_0xc1f3('0x2'));var BPromise=require(_0xc1f3('0x3'));var rs=require(_0xc1f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc1f3('0x5'));var client=jayson['client'][_0xc1f3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x245eff,_0x47949a,_0x1ecd80){return new BPromise(function(_0x3d0978,_0x48c5a7){return client[_0xc1f3('0x7')](_0x245eff,_0x1ecd80)[_0xc1f3('0x8')](function(_0x3ad994){logger[_0xc1f3('0x9')](_0xc1f3('0xa'),_0x47949a,_0xc1f3('0xb'));logger[_0xc1f3('0xc')](_0xc1f3('0xd'),_0x47949a,_0xc1f3('0xb'),JSON[_0xc1f3('0xe')](_0x3ad994));if(_0x3ad994[_0xc1f3('0xf')]){if(_0x3ad994[_0xc1f3('0xf')]['code']===0x1f4){logger[_0xc1f3('0xf')]('VoiceContext,\x20%s,\x20%s',_0x47949a,_0x3ad994[_0xc1f3('0xf')]['message']);return _0x48c5a7(_0x3ad994[_0xc1f3('0xf')][_0xc1f3('0x10')]);}logger[_0xc1f3('0xf')](_0xc1f3('0xa'),_0x47949a,_0x3ad994[_0xc1f3('0xf')][_0xc1f3('0x10')]);return _0x3d0978(_0x3ad994[_0xc1f3('0xf')][_0xc1f3('0x10')]);}else{logger[_0xc1f3('0x9')](_0xc1f3('0xa'),_0x47949a,_0xc1f3('0xb'));_0x3d0978(_0x3ad994[_0xc1f3('0x11')][_0xc1f3('0x10')]);}})[_0xc1f3('0x12')](function(_0x1d0bbf){logger[_0xc1f3('0xf')](_0xc1f3('0xa'),_0x47949a,_0x1d0bbf);_0x48c5a7(_0x1d0bbf);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index e74e763..578d94c 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 _0xc86c=['isAuthenticated','describe','get','/:id','post','put','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','./voiceDialReport.controller','index'];(function(_0x1b7fb0,_0x402878){var _0x39813a=function(_0xa7d0dd){while(--_0xa7d0dd){_0x1b7fb0['push'](_0x1b7fb0['shift']());}};_0x39813a(++_0x402878);}(_0xc86c,0x138));var _0xcc86=function(_0x145c6e,_0x3de6e4){_0x145c6e=_0x145c6e-0x0;var _0x493d47=_0xc86c[_0x145c6e];return _0x493d47;};'use strict';var multer=require(_0xcc86('0x0'));var util=require(_0xcc86('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc86('0x2'));var router=express[_0xcc86('0x3')]();var fs_extra=require(_0xcc86('0x4'));var auth=require(_0xcc86('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcc86('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xcc86('0x7')]);router['get']('/describe',auth[_0xcc86('0x8')](),controller[_0xcc86('0x9')]);router[_0xcc86('0xa')](_0xcc86('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcc86('0xc')]('/',auth[_0xcc86('0x8')](),controller['create']);router[_0xcc86('0xd')]('/:id',auth[_0xcc86('0x8')](),controller[_0xcc86('0xe')]);router['delete'](_0xcc86('0xb'),auth[_0xcc86('0x8')](),controller['destroy']);module[_0xcc86('0xf')]=router; \ No newline at end of file +var _0x9b69=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','describe','/:id','show','post','create','delete','destroy','multer','path'];(function(_0xfd49ed,_0x1272e1){var _0x355f54=function(_0x3fc70f){while(--_0x3fc70f){_0xfd49ed['push'](_0xfd49ed['shift']());}};_0x355f54(++_0x1272e1);}(_0x9b69,0x196));var _0x99b6=function(_0x143154,_0x763cda){_0x143154=_0x143154-0x0;var _0x2b64d6=_0x9b69[_0x143154];return _0x2b64d6;};'use strict';var multer=require(_0x99b6('0x0'));var util=require('util');var path=require(_0x99b6('0x1'));var timeout=require(_0x99b6('0x2'));var express=require(_0x99b6('0x3'));var router=express[_0x99b6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x99b6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x99b6('0x6'));var controller=require(_0x99b6('0x7'));router[_0x99b6('0x8')]('/',auth[_0x99b6('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x99b6('0xa')]);router[_0x99b6('0x8')](_0x99b6('0xb'),auth[_0x99b6('0x9')](),controller[_0x99b6('0xc')]);router[_0x99b6('0xd')]('/',auth[_0x99b6('0x9')](),controller[_0x99b6('0xe')]);router['put'](_0x99b6('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x99b6('0xf')](_0x99b6('0xb'),auth[_0x99b6('0x9')](),controller[_0x99b6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index d558298..496d8bd 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 _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x5386f3,_0x4e825d){var _0x1ee0d6=function(_0x189bb0){while(--_0x189bb0){_0x5386f3['push'](_0x5386f3['shift']());}};_0x1ee0d6(++_0x4e825d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x00bb[_0x56482c];return _0x5aae7a;};'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 +var _0xf2ca=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x474315,_0x459ec3){var _0xc7ad81=function(_0x41d002){while(--_0x41d002){_0x474315['push'](_0x474315['shift']());}};_0xc7ad81(++_0x459ec3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0xf2ca[_0x552fce];return _0x3e27a2;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'privilege':{'type':Sequelize[_0xaf2c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaf2c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'destlinkedid':{'type':Sequelize[_0xaf2c('0x2')]},'dialstring':{'type':Sequelize[_0xaf2c('0x2')]},'dialstatus':{'type':Sequelize[_0xaf2c('0x2')]},'starttime':{'type':Sequelize[_0xaf2c('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x5')},'routeId':{'type':Sequelize[_0xaf2c('0x3')]},'duration':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x3')]},'billableseconds':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index e5f3cfc..2b67930 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 _0xed0f=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filter','merge','map','options','includeAll','rows','catch','show','params','filters','include','find','create','body','describe'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0xed0f,0x92));var _0xfed0=function(_0x52ef49,_0x2f9c31){_0x52ef49=_0x52ef49-0x0;var _0x5f591e=_0xed0f[_0x52ef49];return _0x5f591e;};'use strict';var emlformat=require(_0xfed0('0x0'));var rimraf=require(_0xfed0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfed0('0x2'));var rp=require(_0xfed0('0x3'));var moment=require(_0xfed0('0x4'));var BPromise=require(_0xfed0('0x5'));var Mustache=require(_0xfed0('0x6'));var util=require(_0xfed0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfed0('0x8'));var ejs=require(_0xfed0('0x9'));var fs=require('fs');var fs_extra=require(_0xfed0('0xa'));var _=require(_0xfed0('0xb'));var squel=require(_0xfed0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfed0('0xd'));var deskjs=require(_0xfed0('0xe'));var toCsv=require(_0xfed0('0x8'));var querystring=require(_0xfed0('0xf'));var Papa=require(_0xfed0('0x10'));var Redis=require('ioredis');var authService=require(_0xfed0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfed0('0x12'));var hardwareService=require(_0xfed0('0x13'));var logger=require(_0xfed0('0x14'))(_0xfed0('0x15'));var utils=require('../../config/utils');var config=require(_0xfed0('0x16'));var licenseUtil=require(_0xfed0('0x17'));var db=require(_0xfed0('0x18'))['db'];function respondWithStatusCode(_0x87aa13,_0x595ed2){_0x595ed2=_0x595ed2||0xcc;return function(_0x4d1ac1){if(_0x4d1ac1){return _0x87aa13[_0xfed0('0x19')](_0x595ed2);}return _0x87aa13[_0xfed0('0x1a')](_0x595ed2)[_0xfed0('0x1b')]();};}function respondWithResult(_0x1cb66d,_0x8fc675){_0x8fc675=_0x8fc675||0xc8;return function(_0x540420){if(_0x540420){return _0x1cb66d['status'](_0x8fc675)['json'](_0x540420);}};}function respondWithFilteredResult(_0x58989d,_0x19de32){return function(_0x25b6d4){if(_0x25b6d4){var _0x342d2e=typeof _0x19de32[_0xfed0('0x1c')]==='undefined'&&typeof _0x19de32[_0xfed0('0x1d')]===_0xfed0('0x1e');var _0x3f7dd9=_0x25b6d4['count'];var _0x2b4c07=_0x342d2e?0x0:_0x19de32[_0xfed0('0x1c')];var _0x545da6=_0x342d2e?_0x25b6d4[_0xfed0('0x1f')]:_0x19de32[_0xfed0('0x1c')]+_0x19de32[_0xfed0('0x1d')];var _0x2d8f6c;if(_0x545da6>=_0x3f7dd9){_0x545da6=_0x3f7dd9;_0x2d8f6c=0xc8;}else{_0x2d8f6c=0xce;}_0x58989d['status'](_0x2d8f6c);return _0x58989d[_0xfed0('0x20')](_0xfed0('0x21'),_0x2b4c07+'-'+_0x545da6+'/'+_0x3f7dd9)['json'](_0x25b6d4);}return null;};}function patchUpdates(_0x45d129){return function(_0x48068c){try{jsonpatch['apply'](_0x48068c,_0x45d129,!![]);}catch(_0x2ed4b4){return BPromise[_0xfed0('0x22')](_0x2ed4b4);}return _0x48068c[_0xfed0('0x23')]();};}function saveUpdates(_0x43dca4,_0x54cb11){return function(_0x2aae52){if(_0x2aae52){return _0x2aae52[_0xfed0('0x24')](_0x43dca4)[_0xfed0('0x25')](function(_0x1d35c0){return _0x1d35c0;});}return null;};}function removeEntity(_0x47c243,_0x52e61c){return function(_0xcf8ef0){if(_0xcf8ef0){return _0xcf8ef0[_0xfed0('0x26')]()['then'](function(){_0x47c243['status'](0xcc)[_0xfed0('0x1b')]();});}};}function handleEntityNotFound(_0x69603f,_0xc63b19){return function(_0x20d22a){if(!_0x20d22a){_0x69603f[_0xfed0('0x19')](0x194);}return _0x20d22a;};}function handleError(_0x3235fa,_0xb25d37){_0xb25d37=_0xb25d37||0x1f4;return function(_0x246f41){logger[_0xfed0('0x27')](_0x246f41[_0xfed0('0x28')]);if(_0x246f41[_0xfed0('0x29')]){delete _0x246f41['name'];}_0x3235fa[_0xfed0('0x1a')](_0xb25d37)[_0xfed0('0x2a')](_0x246f41);};}exports['index']=function(_0xfe573a,_0x175c15){var _0x2b8dd3={},_0x117c53={},_0x313216={'count':0x0,'rows':[]};var _0x1cd0dc=_['map'](db[_0xfed0('0x2b')][_0xfed0('0x2c')],function(_0x1bd8e6){return{'name':_0x1bd8e6[_0xfed0('0x2d')],'type':_0x1bd8e6[_0xfed0('0x2e')][_0xfed0('0x2f')]};});_0x117c53['model']=_['map'](_0x1cd0dc,_0xfed0('0x29'));_0x117c53[_0xfed0('0x30')]=_[_0xfed0('0x31')](_0xfe573a[_0xfed0('0x30')]);_0x117c53['filters']=_[_0xfed0('0x32')](_0x117c53[_0xfed0('0x33')],_0x117c53[_0xfed0('0x30')]);_0x2b8dd3['attributes']=_['intersection'](_0x117c53['model'],qs[_0xfed0('0x34')](_0xfe573a[_0xfed0('0x30')]['fields']));_0x2b8dd3[_0xfed0('0x35')]=_0x2b8dd3[_0xfed0('0x35')][_0xfed0('0x36')]?_0x2b8dd3[_0xfed0('0x35')]:_0x117c53[_0xfed0('0x33')];if(!_0xfe573a[_0xfed0('0x30')]['hasOwnProperty']('nolimit')){_0x2b8dd3['limit']=qs['limit'](_0xfe573a[_0xfed0('0x30')][_0xfed0('0x1d')]);_0x2b8dd3[_0xfed0('0x1c')]=qs[_0xfed0('0x1c')](_0xfe573a[_0xfed0('0x30')][_0xfed0('0x1c')]);}_0x2b8dd3[_0xfed0('0x37')]=qs[_0xfed0('0x38')](_0xfe573a[_0xfed0('0x30')][_0xfed0('0x38')]);_0x2b8dd3[_0xfed0('0x39')]=qs['filters'](_['pick'](_0xfe573a['query'],_0x117c53['filters']),_0x1cd0dc);if(_0xfe573a[_0xfed0('0x30')][_0xfed0('0x3a')]){_0x2b8dd3[_0xfed0('0x39')]=_[_0xfed0('0x3b')](_0x2b8dd3['where'],{'$or':_[_0xfed0('0x3c')](_0x1cd0dc,function(_0x863d30){if(_0x863d30[_0xfed0('0x2e')]!=='VIRTUAL'){var _0x26e4d0={};_0x26e4d0[_0x863d30[_0xfed0('0x29')]]={'$like':'%'+_0xfe573a['query'][_0xfed0('0x3a')]+'%'};return _0x26e4d0;}})});}_0x2b8dd3=_[_0xfed0('0x3b')]({},_0x2b8dd3,_0xfe573a[_0xfed0('0x3d')]);var _0x1d32fa={'where':_0x2b8dd3[_0xfed0('0x39')]};return db['VoiceDialReport'][_0xfed0('0x1f')](_0x1d32fa)[_0xfed0('0x25')](function(_0x250989){_0x313216['count']=_0x250989;if(_0xfe573a['query'][_0xfed0('0x3e')]){_0x2b8dd3['include']=[{'all':!![]}];}return db[_0xfed0('0x2b')]['findAll'](_0x2b8dd3);})['then'](function(_0x409fd3){_0x313216[_0xfed0('0x3f')]=_0x409fd3;return _0x313216;})[_0xfed0('0x25')](respondWithFilteredResult(_0x175c15,_0x2b8dd3))[_0xfed0('0x40')](handleError(_0x175c15,null));};exports[_0xfed0('0x41')]=function(_0x507d50,_0x28077a){var _0x32b60b={'raw':!![],'where':{'id':_0x507d50[_0xfed0('0x42')]['id']}},_0x19611a={};_0x19611a[_0xfed0('0x33')]=_[_0xfed0('0x31')](db[_0xfed0('0x2b')][_0xfed0('0x2c')]);_0x19611a[_0xfed0('0x30')]=_[_0xfed0('0x31')](_0x507d50[_0xfed0('0x30')]);_0x19611a[_0xfed0('0x43')]=_[_0xfed0('0x32')](_0x19611a[_0xfed0('0x33')],_0x19611a['query']);_0x32b60b[_0xfed0('0x35')]=_[_0xfed0('0x32')](_0x19611a['model'],qs['fields'](_0x507d50[_0xfed0('0x30')][_0xfed0('0x34')]));_0x32b60b[_0xfed0('0x35')]=_0x32b60b[_0xfed0('0x35')][_0xfed0('0x36')]?_0x32b60b[_0xfed0('0x35')]:_0x19611a[_0xfed0('0x33')];if(_0x507d50[_0xfed0('0x30')][_0xfed0('0x3e')]){_0x32b60b[_0xfed0('0x44')]=[{'all':!![]}];}_0x32b60b=_[_0xfed0('0x3b')]({},_0x32b60b,_0x507d50['options']);return db[_0xfed0('0x2b')][_0xfed0('0x45')](_0x32b60b)['then'](handleEntityNotFound(_0x28077a,null))[_0xfed0('0x25')](respondWithResult(_0x28077a,null))[_0xfed0('0x40')](handleError(_0x28077a,null));};exports['create']=function(_0x286686,_0x4ef3f8){return db[_0xfed0('0x2b')][_0xfed0('0x46')](_0x286686['body'],{})['then'](respondWithResult(_0x4ef3f8,0xc9))[_0xfed0('0x40')](handleError(_0x4ef3f8,null));};exports[_0xfed0('0x24')]=function(_0x38daf8,_0x394204){if(_0x38daf8['body']['id']){delete _0x38daf8[_0xfed0('0x47')]['id'];}return db[_0xfed0('0x2b')][_0xfed0('0x45')]({'where':{'id':_0x38daf8[_0xfed0('0x42')]['id']}})[_0xfed0('0x25')](handleEntityNotFound(_0x394204,null))[_0xfed0('0x25')](saveUpdates(_0x38daf8[_0xfed0('0x47')],null))[_0xfed0('0x25')](respondWithResult(_0x394204,null))[_0xfed0('0x40')](handleError(_0x394204,null));};exports[_0xfed0('0x26')]=function(_0x4d895f,_0x535add){return db['VoiceDialReport'][_0xfed0('0x45')]({'where':{'id':_0x4d895f[_0xfed0('0x42')]['id']}})[_0xfed0('0x25')](handleEntityNotFound(_0x535add,null))[_0xfed0('0x25')](removeEntity(_0x535add,null))[_0xfed0('0x40')](handleError(_0x535add,null));};exports[_0xfed0('0x48')]=function(_0xc13f14,_0x267d12){return db[_0xfed0('0x2b')][_0xfed0('0x48')]()[_0xfed0('0x25')](respondWithResult(_0x267d12,null))[_0xfed0('0x40')](handleError(_0x267d12,null));}; \ No newline at end of file +var _0x110a=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','VoiceDialReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','include','find','catch','create','body','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xfc56d,_0x57c229){var _0x585b3a=function(_0x378493){while(--_0x378493){_0xfc56d['push'](_0xfc56d['shift']());}};_0x585b3a(++_0x57c229);}(_0x110a,0x1b9));var _0xa110=function(_0x485840,_0x122071){_0x485840=_0x485840-0x0;var _0x41ec7d=_0x110a[_0x485840];return _0x41ec7d;};'use strict';var emlformat=require(_0xa110('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa110('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa110('0x2'));var moment=require(_0xa110('0x3'));var BPromise=require(_0xa110('0x4'));var Mustache=require(_0xa110('0x5'));var util=require('util');var path=require(_0xa110('0x6'));var sox=require(_0xa110('0x7'));var csv=require(_0xa110('0x8'));var ejs=require(_0xa110('0x9'));var fs=require('fs');var fs_extra=require(_0xa110('0xa'));var _=require(_0xa110('0xb'));var squel=require(_0xa110('0xc'));var crypto=require(_0xa110('0xd'));var jsforce=require(_0xa110('0xe'));var deskjs=require(_0xa110('0xf'));var toCsv=require(_0xa110('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa110('0x10'));var authService=require(_0xa110('0x11'));var qs=require(_0xa110('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa110('0x13'));var logger=require('../../config/logger')(_0xa110('0x14'));var utils=require(_0xa110('0x15'));var config=require(_0xa110('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa110('0x17'))['db'];function respondWithStatusCode(_0x23ec1d,_0x4eadd8){_0x4eadd8=_0x4eadd8||0xcc;return function(_0x368286){if(_0x368286){return _0x23ec1d[_0xa110('0x18')](_0x4eadd8);}return _0x23ec1d['status'](_0x4eadd8)[_0xa110('0x19')]();};}function respondWithResult(_0x2218ab,_0x33a305){_0x33a305=_0x33a305||0xc8;return function(_0x5579ab){if(_0x5579ab){return _0x2218ab[_0xa110('0x1a')](_0x33a305)[_0xa110('0x1b')](_0x5579ab);}};}function respondWithFilteredResult(_0x29e397,_0x31cd3d){return function(_0x52be31){if(_0x52be31){var _0x444b97=typeof _0x31cd3d[_0xa110('0x1c')]==='undefined'&&typeof _0x31cd3d[_0xa110('0x1d')]==='undefined';var _0x87a033=_0x52be31[_0xa110('0x1e')];var _0x784438=_0x444b97?0x0:_0x31cd3d[_0xa110('0x1c')];var _0x48a4c6=_0x444b97?_0x52be31[_0xa110('0x1e')]:_0x31cd3d['offset']+_0x31cd3d[_0xa110('0x1d')];var _0xae381;if(_0x48a4c6>=_0x87a033){_0x48a4c6=_0x87a033;_0xae381=0xc8;}else{_0xae381=0xce;}_0x29e397['status'](_0xae381);return _0x29e397[_0xa110('0x1f')](_0xa110('0x20'),_0x784438+'-'+_0x48a4c6+'/'+_0x87a033)[_0xa110('0x1b')](_0x52be31);}return null;};}function patchUpdates(_0x469ae7){return function(_0x36023e){try{jsonpatch[_0xa110('0x21')](_0x36023e,_0x469ae7,!![]);}catch(_0x7741fa){return BPromise[_0xa110('0x22')](_0x7741fa);}return _0x36023e[_0xa110('0x23')]();};}function saveUpdates(_0x5525f9,_0x5a936d){return function(_0xf0753b){if(_0xf0753b){return _0xf0753b[_0xa110('0x24')](_0x5525f9)['then'](function(_0x3a9421){return _0x3a9421;});}return null;};}function removeEntity(_0xdeebb9,_0x13d7f4){return function(_0x3e9d57){if(_0x3e9d57){return _0x3e9d57['destroy']()[_0xa110('0x25')](function(){_0xdeebb9[_0xa110('0x1a')](0xcc)[_0xa110('0x19')]();});}};}function handleEntityNotFound(_0x14923f,_0x375808){return function(_0x3dfa96){if(!_0x3dfa96){_0x14923f[_0xa110('0x18')](0x194);}return _0x3dfa96;};}function handleError(_0x2d0965,_0x27f603){_0x27f603=_0x27f603||0x1f4;return function(_0xe22b13){logger[_0xa110('0x26')](_0xe22b13[_0xa110('0x27')]);if(_0xe22b13['name']){delete _0xe22b13[_0xa110('0x28')];}_0x2d0965['status'](_0x27f603)[_0xa110('0x29')](_0xe22b13);};}exports['index']=function(_0x2a22fa,_0x133001){var _0x3b1793={},_0x5d393a={},_0x5c63de={'count':0x0,'rows':[]};var _0x1c6507=_[_0xa110('0x2a')](db[_0xa110('0x2b')]['rawAttributes'],function(_0x5a1d12){return{'name':_0x5a1d12['fieldName'],'type':_0x5a1d12[_0xa110('0x2c')][_0xa110('0x2d')]};});_0x5d393a[_0xa110('0x2e')]=_[_0xa110('0x2a')](_0x1c6507,'name');_0x5d393a[_0xa110('0x2f')]=_[_0xa110('0x30')](_0x2a22fa[_0xa110('0x2f')]);_0x5d393a[_0xa110('0x31')]=_[_0xa110('0x32')](_0x5d393a[_0xa110('0x2e')],_0x5d393a['query']);_0x3b1793[_0xa110('0x33')]=_[_0xa110('0x32')](_0x5d393a['model'],qs[_0xa110('0x34')](_0x2a22fa[_0xa110('0x2f')][_0xa110('0x34')]));_0x3b1793[_0xa110('0x33')]=_0x3b1793[_0xa110('0x33')]['length']?_0x3b1793[_0xa110('0x33')]:_0x5d393a[_0xa110('0x2e')];if(!_0x2a22fa[_0xa110('0x2f')][_0xa110('0x35')](_0xa110('0x36'))){_0x3b1793[_0xa110('0x1d')]=qs['limit'](_0x2a22fa[_0xa110('0x2f')][_0xa110('0x1d')]);_0x3b1793[_0xa110('0x1c')]=qs['offset'](_0x2a22fa['query'][_0xa110('0x1c')]);}_0x3b1793[_0xa110('0x37')]=qs[_0xa110('0x38')](_0x2a22fa['query'][_0xa110('0x38')]);_0x3b1793['where']=qs['filters'](_[_0xa110('0x39')](_0x2a22fa[_0xa110('0x2f')],_0x5d393a[_0xa110('0x31')]),_0x1c6507);if(_0x2a22fa[_0xa110('0x2f')][_0xa110('0x3a')]){_0x3b1793[_0xa110('0x3b')]=_[_0xa110('0x3c')](_0x3b1793[_0xa110('0x3b')],{'$or':_['map'](_0x1c6507,function(_0x30b19a){if(_0x30b19a[_0xa110('0x2c')]!==_0xa110('0x3d')){var _0x35de8d={};_0x35de8d[_0x30b19a[_0xa110('0x28')]]={'$like':'%'+_0x2a22fa['query'][_0xa110('0x3a')]+'%'};return _0x35de8d;}})});}_0x3b1793=_['merge']({},_0x3b1793,_0x2a22fa[_0xa110('0x3e')]);var _0x493bea={'where':_0x3b1793[_0xa110('0x3b')]};return db[_0xa110('0x2b')][_0xa110('0x1e')](_0x493bea)['then'](function(_0x11df22){_0x5c63de[_0xa110('0x1e')]=_0x11df22;if(_0x2a22fa[_0xa110('0x2f')][_0xa110('0x3f')]){_0x3b1793['include']=[{'all':!![]}];}return db[_0xa110('0x2b')][_0xa110('0x40')](_0x3b1793);})[_0xa110('0x25')](function(_0x5dee18){_0x5c63de[_0xa110('0x41')]=_0x5dee18;return _0x5c63de;})['then'](respondWithFilteredResult(_0x133001,_0x3b1793))['catch'](handleError(_0x133001,null));};exports['show']=function(_0xaaadbd,_0x40fcf2){var _0x5c5e41={'raw':!![],'where':{'id':_0xaaadbd[_0xa110('0x42')]['id']}},_0x5c0a39={};_0x5c0a39[_0xa110('0x2e')]=_[_0xa110('0x30')](db[_0xa110('0x2b')][_0xa110('0x43')]);_0x5c0a39[_0xa110('0x2f')]=_['keys'](_0xaaadbd[_0xa110('0x2f')]);_0x5c0a39[_0xa110('0x31')]=_[_0xa110('0x32')](_0x5c0a39['model'],_0x5c0a39['query']);_0x5c5e41[_0xa110('0x33')]=_['intersection'](_0x5c0a39['model'],qs[_0xa110('0x34')](_0xaaadbd[_0xa110('0x2f')]['fields']));_0x5c5e41[_0xa110('0x33')]=_0x5c5e41[_0xa110('0x33')]['length']?_0x5c5e41[_0xa110('0x33')]:_0x5c0a39[_0xa110('0x2e')];if(_0xaaadbd[_0xa110('0x2f')][_0xa110('0x3f')]){_0x5c5e41[_0xa110('0x44')]=[{'all':!![]}];}_0x5c5e41=_['merge']({},_0x5c5e41,_0xaaadbd[_0xa110('0x3e')]);return db[_0xa110('0x2b')][_0xa110('0x45')](_0x5c5e41)[_0xa110('0x25')](handleEntityNotFound(_0x40fcf2,null))['then'](respondWithResult(_0x40fcf2,null))[_0xa110('0x46')](handleError(_0x40fcf2,null));};exports['create']=function(_0x3acb87,_0x9c4546){return db[_0xa110('0x2b')][_0xa110('0x47')](_0x3acb87[_0xa110('0x48')],{})[_0xa110('0x25')](respondWithResult(_0x9c4546,0xc9))[_0xa110('0x46')](handleError(_0x9c4546,null));};exports[_0xa110('0x24')]=function(_0x2303d4,_0x50831a){if(_0x2303d4[_0xa110('0x48')]['id']){delete _0x2303d4['body']['id'];}return db[_0xa110('0x2b')][_0xa110('0x45')]({'where':{'id':_0x2303d4[_0xa110('0x42')]['id']}})[_0xa110('0x25')](handleEntityNotFound(_0x50831a,null))[_0xa110('0x25')](saveUpdates(_0x2303d4['body'],null))[_0xa110('0x25')](respondWithResult(_0x50831a,null))[_0xa110('0x46')](handleError(_0x50831a,null));};exports[_0xa110('0x49')]=function(_0x9bdeec,_0x33d00e){return db[_0xa110('0x2b')][_0xa110('0x45')]({'where':{'id':_0x9bdeec['params']['id']}})['then'](handleEntityNotFound(_0x33d00e,null))['then'](removeEntity(_0x33d00e,null))[_0xa110('0x46')](handleError(_0x33d00e,null));};exports['describe']=function(_0x1a9598,_0x3d059e){return db[_0xa110('0x2b')][_0xa110('0x4a')]()[_0xa110('0x25')](respondWithResult(_0x3d059e,null))[_0xa110('0x46')](handleError(_0x3d059e,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index e7d61ba..266adb9 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 _0x53eb=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x53eb,0x14b));var _0xb53e=function(_0x348c4e,_0x450dfd){_0x348c4e=_0x348c4e-0x0;var _0x4f424f=_0x53eb[_0x348c4e];return _0x4f424f;};'use strict';var _=require(_0xb53e('0x0'));var util=require(_0xb53e('0x1'));var logger=require('../../config/logger')(_0xb53e('0x2'));var moment=require(_0xb53e('0x3'));var BPromise=require(_0xb53e('0x4'));var rp=require(_0xb53e('0x5'));var fs=require('fs');var path=require(_0xb53e('0x6'));var rimraf=require(_0xb53e('0x7'));var config=require(_0xb53e('0x8'));var attributes=require(_0xb53e('0x9'));module[_0xb53e('0xa')]=function(_0x307e30,_0x18c9d){return _0x307e30[_0xb53e('0xb')](_0xb53e('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e6c=['../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xe751f3,_0x56ce48){var _0x464001=function(_0x46411c){while(--_0x46411c){_0xe751f3['push'](_0xe751f3['shift']());}};_0x464001(++_0x56ce48);}(_0x1e6c,0x11a));var _0xc1e6=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x1e6c[_0x13843f];return _0x1063ae;};'use strict';var _=require(_0xc1e6('0x0'));var util=require('util');var logger=require(_0xc1e6('0x1'))(_0xc1e6('0x2'));var moment=require(_0xc1e6('0x3'));var BPromise=require(_0xc1e6('0x4'));var rp=require(_0xc1e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc1e6('0x6'));var attributes=require(_0xc1e6('0x7'));module[_0xc1e6('0x8')]=function(_0x157b8d,_0x36968b){return _0x157b8d[_0xc1e6('0x9')](_0xc1e6('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xc1e6('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 e86da7a..fc91cf7 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 _0x2f8b=['client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','attributes','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2b8cf7,_0x4c8d1d){var _0x5a96ad=function(_0x2a8e02){while(--_0x2a8e02){_0x2b8cf7['push'](_0x2b8cf7['shift']());}};_0x5a96ad(++_0x4c8d1d);}(_0x2f8b,0x96));var _0xb2f8=function(_0x2e6c18,_0x43863d){_0x2e6c18=_0x2e6c18-0x0;var _0x5e3da4=_0x2f8b[_0x2e6c18];return _0x5e3da4;};'use strict';var _=require(_0xb2f8('0x0'));var util=require(_0xb2f8('0x1'));var moment=require('moment');var BPromise=require(_0xb2f8('0x2'));var rs=require(_0xb2f8('0x3'));var fs=require('fs');var Redis=require(_0xb2f8('0x4'));var db=require(_0xb2f8('0x5'))['db'];var utils=require(_0xb2f8('0x6'));var logger=require(_0xb2f8('0x7'))(_0xb2f8('0x8'));var config=require('../../config/environment');var jayson=require(_0xb2f8('0x9'));var client=jayson[_0xb2f8('0xa')][_0xb2f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b9235,_0x5a3755,_0x582b60){return new BPromise(function(_0x23dba6,_0x273476){return client[_0xb2f8('0xc')](_0x5b9235,_0x582b60)[_0xb2f8('0xd')](function(_0x1c053b){logger[_0xb2f8('0xe')](_0xb2f8('0xf'),_0x5a3755,'request\x20sent');logger[_0xb2f8('0x10')](_0xb2f8('0x11'),_0x5a3755,_0xb2f8('0x12'),JSON[_0xb2f8('0x13')](_0x1c053b));if(_0x1c053b[_0xb2f8('0x14')]){if(_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x15')]===0x1f4){logger[_0xb2f8('0x14')](_0xb2f8('0xf'),_0x5a3755,_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x16')]);return _0x273476(_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x16')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5a3755,_0x1c053b[_0xb2f8('0x14')][_0xb2f8('0x16')]);return _0x23dba6(_0x1c053b['error'][_0xb2f8('0x16')]);}else{logger[_0xb2f8('0xe')](_0xb2f8('0xf'),_0x5a3755,_0xb2f8('0x12'));_0x23dba6(_0x1c053b['result']['message']);}})[_0xb2f8('0x17')](function(_0x20ebf9){logger['error'](_0xb2f8('0xf'),_0x5a3755,_0x20ebf9);_0x273476(_0x20ebf9);});});}exports[_0xb2f8('0x18')]=function(_0x56b307){var _0x345a20=this;return new Promise(function(_0x4dae59,_0x4285ed){return db[_0xb2f8('0x19')][_0xb2f8('0x1a')](_0x56b307[_0xb2f8('0x1b')],{'raw':_0x56b307[_0xb2f8('0x1c')]?_0x56b307[_0xb2f8('0x1c')][_0xb2f8('0x1d')]===undefined?!![]:![]:!![]})[_0xb2f8('0xd')](function(_0x3f1efa){logger[_0xb2f8('0xe')]('CreateVoiceDialReport',_0x56b307);logger[_0xb2f8('0x10')]('CreateVoiceDialReport',_0x56b307,JSON[_0xb2f8('0x13')](_0x3f1efa));_0x4dae59(_0x3f1efa);})[_0xb2f8('0x17')](function(_0x46c11a){logger[_0xb2f8('0x14')]('CreateVoiceDialReport',_0x46c11a[_0xb2f8('0x16')],_0x56b307);_0x4285ed(_0x345a20[_0xb2f8('0x14')](0x1f4,_0x46c11a[_0xb2f8('0x16')]));});});};exports['UpdateVoiceDialReport']=function(_0x12d551){var _0x59243d=this;return new Promise(function(_0x4d1a03,_0x184b24){return db[_0xb2f8('0x19')]['update'](_0x12d551[_0xb2f8('0x1b')],{'raw':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')][_0xb2f8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')]['where']||null:null,'attributes':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')][_0xb2f8('0x1e')]||null:null,'limit':_0x12d551[_0xb2f8('0x1c')]?_0x12d551[_0xb2f8('0x1c')]['limit']||null:null})[_0xb2f8('0xd')](function(_0x190115){logger['info'](_0xb2f8('0x1f'),_0x12d551);logger[_0xb2f8('0x10')](_0xb2f8('0x1f'),_0x12d551,JSON[_0xb2f8('0x13')](_0x190115));_0x4d1a03(_0x190115);})['catch'](function(_0x2695e7){logger[_0xb2f8('0x14')](_0xb2f8('0x1f'),_0x2695e7['message'],_0x12d551);_0x184b24(_0x59243d[_0xb2f8('0x14')](0x1f4,_0x2695e7['message']));});});}; \ No newline at end of file +var _0x02cd=['client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','where','limit','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2178e0,_0x485571){var _0x4aeed7=function(_0x352b3e){while(--_0x352b3e){_0x2178e0['push'](_0x2178e0['shift']());}};_0x4aeed7(++_0x485571);}(_0x02cd,0xff));var _0xd02c=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x02cd[_0x372515];return _0xa3bf4e;};'use strict';var _=require(_0xd02c('0x0'));var util=require(_0xd02c('0x1'));var moment=require('moment');var BPromise=require(_0xd02c('0x2'));var rs=require(_0xd02c('0x3'));var fs=require('fs');var Redis=require(_0xd02c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd02c('0x5'))(_0xd02c('0x6'));var config=require(_0xd02c('0x7'));var jayson=require(_0xd02c('0x8'));var client=jayson[_0xd02c('0x9')][_0xd02c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3afc68,_0x44f9db,_0x24858a){return new BPromise(function(_0x55a056,_0x5aaa2a){return client[_0xd02c('0xb')](_0x3afc68,_0x24858a)[_0xd02c('0xc')](function(_0x172a2e){logger[_0xd02c('0xd')](_0xd02c('0xe'),_0x44f9db,_0xd02c('0xf'));logger['debug'](_0xd02c('0x10'),_0x44f9db,_0xd02c('0xf'),JSON[_0xd02c('0x11')](_0x172a2e));if(_0x172a2e[_0xd02c('0x12')]){if(_0x172a2e[_0xd02c('0x12')][_0xd02c('0x13')]===0x1f4){logger[_0xd02c('0x12')](_0xd02c('0xe'),_0x44f9db,_0x172a2e[_0xd02c('0x12')]['message']);return _0x5aaa2a(_0x172a2e['error'][_0xd02c('0x14')]);}logger['error'](_0xd02c('0xe'),_0x44f9db,_0x172a2e[_0xd02c('0x12')]['message']);return _0x55a056(_0x172a2e['error']['message']);}else{logger['info'](_0xd02c('0xe'),_0x44f9db,'request\x20sent');_0x55a056(_0x172a2e[_0xd02c('0x15')][_0xd02c('0x14')]);}})[_0xd02c('0x16')](function(_0x135fef){logger['error'](_0xd02c('0xe'),_0x44f9db,_0x135fef);_0x5aaa2a(_0x135fef);});});}exports[_0xd02c('0x17')]=function(_0x4b0c83){var _0x1fdd2e=this;return new Promise(function(_0x140528,_0x4ef402){return db[_0xd02c('0x18')][_0xd02c('0x19')](_0x4b0c83[_0xd02c('0x1a')],{'raw':_0x4b0c83[_0xd02c('0x1b')]?_0x4b0c83[_0xd02c('0x1b')][_0xd02c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2f7948){logger[_0xd02c('0xd')](_0xd02c('0x17'),_0x4b0c83);logger[_0xd02c('0x1d')](_0xd02c('0x17'),_0x4b0c83,JSON['stringify'](_0x2f7948));_0x140528(_0x2f7948);})['catch'](function(_0x1e1596){logger[_0xd02c('0x12')]('CreateVoiceDialReport',_0x1e1596['message'],_0x4b0c83);_0x4ef402(_0x1fdd2e[_0xd02c('0x12')](0x1f4,_0x1e1596['message']));});});};exports['UpdateVoiceDialReport']=function(_0x55e6fe){var _0x19b503=this;return new Promise(function(_0x422c77,_0x59a326){return db[_0xd02c('0x18')]['update'](_0x55e6fe[_0xd02c('0x1a')],{'raw':_0x55e6fe[_0xd02c('0x1b')]?_0x55e6fe[_0xd02c('0x1b')][_0xd02c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55e6fe['options']?_0x55e6fe[_0xd02c('0x1b')][_0xd02c('0x1e')]||null:null,'attributes':_0x55e6fe[_0xd02c('0x1b')]?_0x55e6fe[_0xd02c('0x1b')]['attributes']||null:null,'limit':_0x55e6fe[_0xd02c('0x1b')]?_0x55e6fe[_0xd02c('0x1b')][_0xd02c('0x1f')]||null:null})['then'](function(_0x53b530){logger['info'](_0xd02c('0x20'),_0x55e6fe);logger[_0xd02c('0x1d')](_0xd02c('0x20'),_0x55e6fe,JSON['stringify'](_0x53b530));_0x422c77(_0x53b530);})[_0xd02c('0x16')](function(_0x4e6e74){logger[_0xd02c('0x12')](_0xd02c('0x20'),_0x4e6e74[_0xd02c('0x14')],_0x55e6fe);_0x59a326(_0x19b503[_0xd02c('0x12')](0x1f4,_0x4e6e74[_0xd02c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index aa4c300..1b12314 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 _0x3537=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','post','create','addApplications','/:id','update','delete','destroy','multer'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0x3537,0x1da));var _0x7353=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x3537[_0x2db12b];return _0x20990b;};'use strict';var multer=require(_0x7353('0x0'));var util=require('util');var path=require(_0x7353('0x1'));var timeout=require(_0x7353('0x2'));var express=require(_0x7353('0x3'));var router=express[_0x7353('0x4')]();var fs_extra=require(_0x7353('0x5'));var auth=require(_0x7353('0x6'));var interaction=require(_0x7353('0x7'));var config=require(_0x7353('0x8'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x7353('0x9')](),controller[_0x7353('0xa')]);router[_0x7353('0xb')]('/:id',auth[_0x7353('0x9')](),controller['show']);router[_0x7353('0xc')]('/',auth['isAuthenticated'](),controller[_0x7353('0xd')]);router[_0x7353('0xc')]('/:id/applications',auth[_0x7353('0x9')](),controller[_0x7353('0xe')]);router['put'](_0x7353('0xf'),auth['isAuthenticated'](),controller[_0x7353('0x10')]);router[_0x7353('0x11')](_0x7353('0xf'),auth['isAuthenticated'](),controller[_0x7353('0x12')]);module['exports']=router; \ No newline at end of file +var _0xaa3b=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','addApplications','put','update','delete','exports','multer','util'];(function(_0x180e70,_0x3620a3){var _0x5d130b=function(_0x3bcdf2){while(--_0x3bcdf2){_0x180e70['push'](_0x180e70['shift']());}};_0x5d130b(++_0x3620a3);}(_0xaa3b,0xb2));var _0xbaa3=function(_0x46f7f0,_0x4ef418){_0x46f7f0=_0x46f7f0-0x0;var _0x783786=_0xaa3b[_0x46f7f0];return _0x783786;};'use strict';var multer=require(_0xbaa3('0x0'));var util=require(_0xbaa3('0x1'));var path=require(_0xbaa3('0x2'));var timeout=require('connect-timeout');var express=require(_0xbaa3('0x3'));var router=express[_0xbaa3('0x4')]();var fs_extra=require(_0xbaa3('0x5'));var auth=require(_0xbaa3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbaa3('0x7'));var controller=require(_0xbaa3('0x8'));router[_0xbaa3('0x9')]('/',auth[_0xbaa3('0xa')](),controller[_0xbaa3('0xb')]);router['get'](_0xbaa3('0xc'),auth[_0xbaa3('0xa')](),controller[_0xbaa3('0xd')]);router['post']('/',auth[_0xbaa3('0xa')](),controller['create']);router[_0xbaa3('0xe')]('/:id/applications',auth[_0xbaa3('0xa')](),controller[_0xbaa3('0xf')]);router[_0xbaa3('0x10')](_0xbaa3('0xc'),auth['isAuthenticated'](),controller[_0xbaa3('0x11')]);router[_0xbaa3('0x12')](_0xbaa3('0xc'),auth[_0xbaa3('0xa')](),controller['destroy']);module[_0xbaa3('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 2c22003..2e96865 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 _0xc6fb=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports'];(function(_0x12a7bd,_0x1f5fdf){var _0x152d32=function(_0x7a2dc1){while(--_0x7a2dc1){_0x12a7bd['push'](_0x12a7bd['shift']());}};_0x152d32(++_0x1f5fdf);}(_0xc6fb,0x1ec));var _0xbc6f=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0xc6fb[_0x837dad];return _0x1d62d3;};'use strict';var Sequelize=require(_0xbc6f('0x0'));module[_0xbc6f('0x1')]={'context':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'unique':_0xbc6f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'unique':_0xbc6f('0x3')},'priority':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xbc6f('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'defaultValue':_0xbc6f('0x4')},'appdata':{'type':Sequelize[_0xbc6f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xbc6f('0x5')](_0xbc6f('0x6'),_0xbc6f('0x7'),_0xbc6f('0x8'),'inbound-fax',_0xbc6f('0x9'),_0xbc6f('0xa'),_0xbc6f('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xbc6f('0x2')]},'interval':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':![],'defaultValue':_0xbc6f('0xc')},'IntervalId':{'type':Sequelize[_0xbc6f('0xd')]},'isApp':{'type':Sequelize[_0xbc6f('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbc6f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbc6f('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xbc6f('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbc6f('0xd')]},'recordingFormat':{'type':Sequelize[_0xbc6f('0x2')],'defaultValue':_0xbc6f('0xf')},'answer':{'type':Sequelize[_0xbc6f('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbc6f('0x10')],'get':function(_0x89d5e){return this[_0xbc6f('0x11')](_0xbc6f('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x6fb9=['exports','STRING','compositeIndex','NoOp','inbound','outbound','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize'];(function(_0x2e13fe,_0x456c80){var _0x4e5176=function(_0x2d7fe4){while(--_0x2d7fe4){_0x2e13fe['push'](_0x2e13fe['shift']());}};_0x4e5176(++_0x456c80);}(_0x6fb9,0x8f));var _0x96fb=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0x6fb9[_0x13b330];return _0x1f666c;};'use strict';var Sequelize=require(_0x96fb('0x0'));module[_0x96fb('0x1')]={'context':{'type':Sequelize[_0x96fb('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x96fb('0x2')],'allowNull':![],'unique':_0x96fb('0x3')},'priority':{'type':Sequelize[_0x96fb('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x96fb('0x3')},'tag':{'type':Sequelize[_0x96fb('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x96fb('0x2')],'allowNull':![],'defaultValue':_0x96fb('0x4')},'appdata':{'type':Sequelize[_0x96fb('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x96fb('0x5'),_0x96fb('0x6'),'internal',_0x96fb('0x7'),_0x96fb('0x8'),_0x96fb('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x96fb('0x2')]},'interval':{'type':Sequelize[_0x96fb('0x2')],'allowNull':![],'defaultValue':_0x96fb('0xa')},'IntervalId':{'type':Sequelize[_0x96fb('0xb')]},'isApp':{'type':Sequelize[_0x96fb('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x96fb('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x96fb('0x2')],'defaultValue':_0x96fb('0xd')},'answer':{'type':Sequelize[_0x96fb('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x96fb('0xe')],'get':function(_0x51721b){return this[_0x96fb('0xf')]('exten');}},'alias':{'type':Sequelize[_0x96fb('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 8d0f4b3..91b4fae 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 _0xf6e3=['UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','alias','context','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','index','rawAttributes','key','query','keys','intersection','model','attributes','fields','nolimit','sort','where','filters','merge','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','length','find','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes'];(function(_0x45df91,_0x59947b){var _0x2faad7=function(_0x5cb743){while(--_0x5cb743){_0x45df91['push'](_0x45df91['shift']());}};_0x2faad7(++_0x59947b);}(_0xf6e3,0x138));var _0x3f6e=function(_0x5998d0,_0x2ca24c){_0x5998d0=_0x5998d0-0x0;var _0x541560=_0xf6e3[_0x5998d0];return _0x541560;};'use strict';var _=require(_0x3f6e('0x0'));var Redis=require(_0x3f6e('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x3f6e('0x2'))(_0x3f6e('0x3'));var config=require(_0x3f6e('0x4'));var db=require(_0x3f6e('0x5'))['db'];config['redis']=_['defaults'](config[_0x3f6e('0x6')],{'host':_0x3f6e('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f6e('0x6')]));require(_0x3f6e('0x8'))[_0x3f6e('0x9')](socket);function respondWithStatusCode(_0x2d6a13,_0x322ada){_0x322ada=_0x322ada||0xcc;return function(_0x47406e){if(_0x47406e){return _0x2d6a13[_0x3f6e('0xa')](_0x322ada);}return _0x2d6a13[_0x3f6e('0xb')](_0x322ada)[_0x3f6e('0xc')]();};}function respondWithResult(_0x5664b7,_0x51cb1c){_0x51cb1c=_0x51cb1c||0xc8;return function(_0x4d9652){if(_0x4d9652){return _0x5664b7['status'](_0x51cb1c)[_0x3f6e('0xd')](_0x4d9652);}};}function respondWithFilteredResult(_0x27355d,_0x53552b){return function(_0x1f83f1){if(_0x1f83f1){var _0x59e600=typeof _0x53552b['offset']===_0x3f6e('0xe')&&typeof _0x53552b[_0x3f6e('0xf')]==='undefined';var _0x204c61=_0x1f83f1[_0x3f6e('0x10')];var _0x5870f3=_0x59e600?0x0:_0x53552b[_0x3f6e('0x11')];var _0xfae168=_0x59e600?_0x1f83f1['count']:_0x53552b[_0x3f6e('0x11')]+_0x53552b[_0x3f6e('0xf')];var _0x52360c;if(_0xfae168>=_0x204c61){_0xfae168=_0x204c61;_0x52360c=0xc8;}else{_0x52360c=0xce;}_0x27355d[_0x3f6e('0xb')](_0x52360c);return _0x27355d[_0x3f6e('0x12')](_0x3f6e('0x13'),_0x5870f3+'-'+_0xfae168+'/'+_0x204c61)[_0x3f6e('0xd')](_0x1f83f1);}return null;};}function removeEntity(_0x2757a8){return function(_0x2b4a80){if(_0x2b4a80){return _0x2b4a80[_0x3f6e('0x14')]()[_0x3f6e('0x15')](function(){var _0x1d4125=_0x2b4a80[_0x3f6e('0x16')]({'plain':!![]});var _0x57351d=[{'name':'InboundRoutes','value':_0x3f6e('0x17'),'ignore':![]},{'name':_0x3f6e('0x18'),'value':_0x3f6e('0x19'),'ignore':![]},{'name':_0x3f6e('0x1a'),'value':_0x3f6e('0x1b'),'ignore':![]}];var _0x41ae58=_(_0x57351d)[_0x3f6e('0x1c')](_0x3f6e('0x1d'))[_0x3f6e('0x1e')](_0x3f6e('0x1f'))[_0x3f6e('0x1f')]();if(_[_0x3f6e('0x20')](_0x41ae58,_0x1d4125['type'])){return;}var _0x4550fa=_['find'](_0x57351d,['value',_0x1d4125[_0x3f6e('0x21')]])[_0x3f6e('0x22')];return db[_0x3f6e('0x23')][_0x3f6e('0x14')]({'where':{'type':_0x4550fa,'resourceId':_0x1d4125['id']}})[_0x3f6e('0x15')](function(){return _0x2b4a80;});})[_0x3f6e('0x15')](function(){_0x2757a8[_0x3f6e('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d6c7){return function(_0x43ebbf){if(!_0x43ebbf){_0x57d6c7['sendStatus'](0x194);}return _0x43ebbf;};}function handleError(_0x2ea2b1,_0x3a70c5){_0x3a70c5=_0x3a70c5||0x1f4;return function(_0x4214cd){logger[_0x3f6e('0x24')](_0x4214cd[_0x3f6e('0x25')]);if(_0x4214cd[_0x3f6e('0x22')]){delete _0x4214cd['name'];}_0x2ea2b1['status'](_0x3a70c5)[_0x3f6e('0x26')](_0x4214cd);};}exports[_0x3f6e('0x27')]=function(_0x427865,_0x1e0317){var _0x5086a4={},_0x399e36={},_0x141a61={'count':0x0,'rows':[]};var _0xb86f8=_[_0x3f6e('0x1e')](db['VoiceExtension'][_0x3f6e('0x28')],function(_0x554dcc){return{'name':_0x554dcc['fieldName'],'type':_0x554dcc[_0x3f6e('0x21')][_0x3f6e('0x29')]};});_0x399e36['model']=_[_0x3f6e('0x1e')](_0xb86f8,'name');_0x399e36[_0x3f6e('0x2a')]=_[_0x3f6e('0x2b')](_0x427865[_0x3f6e('0x2a')]);_0x399e36['filters']=_[_0x3f6e('0x2c')](_0x399e36[_0x3f6e('0x2d')],_0x399e36[_0x3f6e('0x2a')]);_0x5086a4[_0x3f6e('0x2e')]=_[_0x3f6e('0x2c')](_0x399e36[_0x3f6e('0x2d')],qs['fields'](_0x427865[_0x3f6e('0x2a')][_0x3f6e('0x2f')]));_0x5086a4[_0x3f6e('0x2e')]=_0x5086a4['attributes']['length']?_0x5086a4['attributes']:_0x399e36[_0x3f6e('0x2d')];if(!_0x427865['query']['hasOwnProperty'](_0x3f6e('0x30'))){_0x5086a4[_0x3f6e('0xf')]=qs[_0x3f6e('0xf')](_0x427865[_0x3f6e('0x2a')][_0x3f6e('0xf')]);_0x5086a4['offset']=qs[_0x3f6e('0x11')](_0x427865[_0x3f6e('0x2a')]['offset']);}_0x5086a4['order']=qs[_0x3f6e('0x31')](_0x427865[_0x3f6e('0x2a')]['sort']);_0x5086a4[_0x3f6e('0x32')]=qs[_0x3f6e('0x33')](_['pick'](_0x427865[_0x3f6e('0x2a')],_0x399e36[_0x3f6e('0x33')]),_0xb86f8);if(_0x427865['query'][_0x3f6e('0x1c')]){_0x5086a4[_0x3f6e('0x32')]=_[_0x3f6e('0x34')](_0x5086a4[_0x3f6e('0x32')],{'$or':_['map'](_0xb86f8,function(_0x18f654){if(_0x18f654[_0x3f6e('0x21')]!=='VIRTUAL'){var _0x1352d0={};_0x1352d0[_0x18f654[_0x3f6e('0x22')]]={'$like':'%'+_0x427865[_0x3f6e('0x2a')][_0x3f6e('0x1c')]+'%'};return _0x1352d0;}})});}_0x5086a4=_['merge']({},_0x5086a4,_0x427865[_0x3f6e('0x35')]);var _0x11e9b3={'where':_0x5086a4[_0x3f6e('0x32')]};return db[_0x3f6e('0x36')][_0x3f6e('0x10')](_0x11e9b3)[_0x3f6e('0x15')](function(_0x4ad074){_0x141a61[_0x3f6e('0x10')]=_0x4ad074;if(_0x427865[_0x3f6e('0x2a')][_0x3f6e('0x37')]){_0x5086a4[_0x3f6e('0x38')]=[{'all':!![]}];}return db[_0x3f6e('0x36')][_0x3f6e('0x39')](_0x5086a4);})[_0x3f6e('0x15')](function(_0x1581b8){_0x141a61[_0x3f6e('0x3a')]=_0x1581b8;return _0x141a61;})[_0x3f6e('0x15')](respondWithFilteredResult(_0x1e0317,_0x5086a4))[_0x3f6e('0x3b')](handleError(_0x1e0317,null));};exports[_0x3f6e('0x3c')]=function(_0x3c3927,_0x212645){var _0x19b37d={'raw':![],'where':{'id':_0x3c3927[_0x3f6e('0x3d')]['id']}},_0x1fbf90={};_0x1fbf90[_0x3f6e('0x2d')]=_['keys'](db[_0x3f6e('0x36')][_0x3f6e('0x28')]);_0x1fbf90[_0x3f6e('0x2a')]=_[_0x3f6e('0x2b')](_0x3c3927[_0x3f6e('0x2a')]);_0x1fbf90['filters']=_[_0x3f6e('0x2c')](_0x1fbf90[_0x3f6e('0x2d')],_0x1fbf90['query']);_0x19b37d[_0x3f6e('0x2e')]=_[_0x3f6e('0x2c')](_0x1fbf90[_0x3f6e('0x2d')],qs[_0x3f6e('0x2f')](_0x3c3927['query'][_0x3f6e('0x2f')]));_0x19b37d[_0x3f6e('0x2e')]=_0x19b37d[_0x3f6e('0x2e')][_0x3f6e('0x3e')]?_0x19b37d[_0x3f6e('0x2e')]:_0x1fbf90[_0x3f6e('0x2d')];if(_0x3c3927[_0x3f6e('0x2a')][_0x3f6e('0x37')]){_0x19b37d[_0x3f6e('0x38')]=[{'all':!![]}];}_0x19b37d=_[_0x3f6e('0x34')]({},_0x19b37d,_0x3c3927['options']);return db['VoiceExtension'][_0x3f6e('0x3f')](_0x19b37d)[_0x3f6e('0x15')](handleEntityNotFound(_0x212645,null))[_0x3f6e('0x15')](respondWithResult(_0x212645,null))['catch'](handleError(_0x212645,null));};exports[_0x3f6e('0x14')]=function(_0x4864bd,_0x197bb9){return db[_0x3f6e('0x36')]['find']({'where':{'id':_0x4864bd[_0x3f6e('0x3d')]['id']}})[_0x3f6e('0x15')](handleEntityNotFound(_0x197bb9,null))[_0x3f6e('0x15')](removeEntity(_0x197bb9,null))[_0x3f6e('0x3b')](handleError(_0x197bb9,null));};exports['create']=function(_0xd27439,_0x76483a){if(_0xd27439[_0x3f6e('0x40')][_0x3f6e('0x21')]===_0x3f6e('0x19')&&!_[_0x3f6e('0x41')](_0xd27439[_0x3f6e('0x40')][_0x3f6e('0x42')],'_')){_0xd27439[_0x3f6e('0x40')][_0x3f6e('0x42')]='_'[_0x3f6e('0x43')](_0xd27439['body'][_0x3f6e('0x42')]);}return db[_0x3f6e('0x36')]['create'](_0xd27439[_0x3f6e('0x40')],{'raw':![]})[_0x3f6e('0x15')](function(_0x2c6f59){var _0x2d4af0=_0xd27439[_0x3f6e('0x44')]['get']({'plain':!![]});if(!_0x2d4af0)throw new Error(_0x3f6e('0x45'));if(_0x2d4af0[_0x3f6e('0x46')]===_0x3f6e('0x44')){var _0x124ca=_0x2c6f59[_0x3f6e('0x16')]({'plain':!![]});var _0x4d3451=[{'name':_0x3f6e('0x47'),'value':_0x3f6e('0x17')},{'name':_0x3f6e('0x18'),'value':_0x3f6e('0x19')},{'name':_0x3f6e('0x1a'),'value':'internal'}];var _0x30dee5=_['find'](_0x4d3451,[_0x3f6e('0x1f'),_0x124ca[_0x3f6e('0x21')]])[_0x3f6e('0x22')];return db[_0x3f6e('0x48')]['find']({'where':{'name':_0x30dee5,'userProfileId':_0x2d4af0[_0x3f6e('0x49')]},'raw':!![]})['then'](function(_0x4a8589){if(_0x4a8589&&_0x4a8589[_0x3f6e('0x4a')]===0x0){return db[_0x3f6e('0x23')][_0x3f6e('0x4b')]({'name':_0x124ca[_0x3f6e('0x22')],'resourceId':_0x124ca['id'],'type':_0x4a8589[_0x3f6e('0x22')],'sectionId':_0x4a8589['id']},{})[_0x3f6e('0x15')](function(){return _0x2c6f59;});}else{return _0x2c6f59;}})[_0x3f6e('0x3b')](function(_0x4bc93b){logger[_0x3f6e('0x24')](_0x3f6e('0x4c'),_0x4bc93b);throw _0x4bc93b;});}return _0x2c6f59;})[_0x3f6e('0x15')](respondWithResult(_0x76483a,0xc9))[_0x3f6e('0x3b')](handleError(_0x76483a,null));};exports['update']=function(_0x30638a,_0x54026a){if(_0x30638a['body']['id']){delete _0x30638a[_0x3f6e('0x40')]['id'];}return db[_0x3f6e('0x36')]['find']({'where':{'id':_0x30638a[_0x3f6e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x54026a,null))[_0x3f6e('0x15')](function(_0x421d6a){if(_0x421d6a){return db[_0x3f6e('0x36')][_0x3f6e('0x4d')](_['pick'](_0x30638a[_0x3f6e('0x40')],[_0x3f6e('0x42'),'context',_0x3f6e('0x4e'),_0x3f6e('0x4f'),_0x3f6e('0x50'),'mandatoryDisposition',_0x3f6e('0x51')]),{'where':{'context':_0x421d6a[_0x3f6e('0x52')],'exten':_0x421d6a['exten']},'individualHooks':!![]})[_0x3f6e('0x15')](function(_0x17edfc){return _0x17edfc;});}return null;})[_0x3f6e('0x15')](respondWithStatusCode(_0x54026a,null))[_0x3f6e('0x3b')](handleError(_0x54026a,null));};exports[_0x3f6e('0x53')]=function(_0xd7e70c,_0x383e3a){var _0x23a900=_0xd7e70c[_0x3f6e('0x3d')]['id'];var _0x506d01=_0xd7e70c[_0x3f6e('0x40')];var _0x23c895=0xc8;var _0xf1c3c4=null;return db['sequelize'][_0x3f6e('0x54')]({'isolationLevel':db[_0x3f6e('0x55')][_0x3f6e('0x56')][_0x3f6e('0x57')][_0x3f6e('0x58')]},function(_0x2662c2){return db[_0x3f6e('0x36')][_0x3f6e('0x59')]({'where':{'id':_0x23a900},'transaction':_0x2662c2})[_0x3f6e('0x15')](function(_0x5855f4){if(_0x5855f4){return db[_0x3f6e('0x36')][_0x3f6e('0x14')]({'where':{'VoiceExtensionId':_0x23a900},'transaction':_0x2662c2})[_0x3f6e('0x15')](function(){var _0x16ab8c=_[_0x3f6e('0x1e')](_0x506d01,function(_0x24ab6f){_0x24ab6f[_0x3f6e('0x5a')]=_0x23a900;_0x24ab6f[_0x3f6e('0x5b')]=!![];return _0x24ab6f;});return _0x5855f4[_0x3f6e('0x5c')](_0x16ab8c);})[_0x3f6e('0x15')](function(_0x49b61d){return db[_0x3f6e('0x36')][_0x3f6e('0x5d')](_0x49b61d,{'transaction':_0x2662c2});});}else{_0x23c895=0x194;_0xf1c3c4=[];}});})[_0x3f6e('0x15')](function(){if(_0x23c895!==0x194){return db[_0x3f6e('0x36')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x23a900},'order':_0x3f6e('0x5e')})['then'](function(_0x3352a9){_0xf1c3c4=_0x3352a9;});}})[_0x3f6e('0x3b')](function(_0x423871){_0x23c895=0x1f4;logger[_0x3f6e('0x24')](_0x423871['stack']);if(_0x423871[_0x3f6e('0x22')]){delete _0x423871[_0x3f6e('0x22')];}_0xf1c3c4=_0x423871;})[_0x3f6e('0x5f')](function(){if(_0xf1c3c4===null){_0x383e3a[_0x3f6e('0xa')](_0x23c895);}else{if(_0x23c895===0x1f4){_0x383e3a[_0x3f6e('0xb')](_0x23c895)[_0x3f6e('0x26')](_0xf1c3c4);}else{_0x383e3a[_0x3f6e('0xb')](_0x23c895)[_0x3f6e('0xd')](_0xf1c3c4);}}});}; \ No newline at end of file +var _0x7a3f=['filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','options','VoiceExtension','includeAll','include','findAll','rows','catch','params','keys','create','body','outbound','startsWith','exten','concat','user','inbound','OutboundRoutes','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','send','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','then','get','InboundRoutes','internal','filter','map','value','includes','type','find','UserProfileResource','destroy','end','stack','name','index','rawAttributes','key','model','query'];(function(_0x2e48b8,_0x1cb078){var _0x4abeca=function(_0x16df96){while(--_0x16df96){_0x2e48b8['push'](_0x2e48b8['shift']());}};_0x4abeca(++_0x1cb078);}(_0x7a3f,0xdb));var _0xf7a3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7a3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var Redis=require(_0xf7a3('0x0'));var qs=require(_0xf7a3('0x1'));var logger=require(_0xf7a3('0x2'))(_0xf7a3('0x3'));var config=require(_0xf7a3('0x4'));var db=require(_0xf7a3('0x5'))['db'];config[_0xf7a3('0x6')]=_[_0xf7a3('0x7')](config[_0xf7a3('0x6')],{'host':_0xf7a3('0x8'),'port':0x18eb});var socket=require(_0xf7a3('0x9'))(new Redis(config[_0xf7a3('0x6')]));require('./voiceExtension.socket')[_0xf7a3('0xa')](socket);function respondWithStatusCode(_0x550452,_0x50c921){_0x50c921=_0x50c921||0xcc;return function(_0x43b261){if(_0x43b261){return _0x550452[_0xf7a3('0xb')](_0x50c921);}return _0x550452['status'](_0x50c921)['end']();};}function respondWithResult(_0x53590a,_0x5b73ca){_0x5b73ca=_0x5b73ca||0xc8;return function(_0x30b988){if(_0x30b988){return _0x53590a[_0xf7a3('0xc')](_0x5b73ca)[_0xf7a3('0xd')](_0x30b988);}};}function respondWithFilteredResult(_0x1800af,_0x140105){return function(_0x2ed03c){if(_0x2ed03c){var _0x243607=typeof _0x140105[_0xf7a3('0xe')]===_0xf7a3('0xf')&&typeof _0x140105[_0xf7a3('0x10')]===_0xf7a3('0xf');var _0x7f03af=_0x2ed03c[_0xf7a3('0x11')];var _0x3bcd60=_0x243607?0x0:_0x140105['offset'];var _0x2bdd5c=_0x243607?_0x2ed03c[_0xf7a3('0x11')]:_0x140105[_0xf7a3('0xe')]+_0x140105['limit'];var _0x14e6c7;if(_0x2bdd5c>=_0x7f03af){_0x2bdd5c=_0x7f03af;_0x14e6c7=0xc8;}else{_0x14e6c7=0xce;}_0x1800af[_0xf7a3('0xc')](_0x14e6c7);return _0x1800af['set'](_0xf7a3('0x12'),_0x3bcd60+'-'+_0x2bdd5c+'/'+_0x7f03af)[_0xf7a3('0xd')](_0x2ed03c);}return null;};}function removeEntity(_0x53046f){return function(_0x3548ea){if(_0x3548ea){return _0x3548ea['destroy']()[_0xf7a3('0x13')](function(){var _0x47bea5=_0x3548ea[_0xf7a3('0x14')]({'plain':!![]});var _0x20079b=[{'name':_0xf7a3('0x15'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0xf7a3('0x16'),'ignore':![]}];var _0x4ae843=_(_0x20079b)[_0xf7a3('0x17')]('ignore')[_0xf7a3('0x18')](_0xf7a3('0x19'))[_0xf7a3('0x19')]();if(_[_0xf7a3('0x1a')](_0x4ae843,_0x47bea5[_0xf7a3('0x1b')])){return;}var _0x3c4693=_[_0xf7a3('0x1c')](_0x20079b,[_0xf7a3('0x19'),_0x47bea5['type']])['name'];return db[_0xf7a3('0x1d')][_0xf7a3('0x1e')]({'where':{'type':_0x3c4693,'resourceId':_0x47bea5['id']}})['then'](function(){return _0x3548ea;});})[_0xf7a3('0x13')](function(){_0x53046f['status'](0xcc)[_0xf7a3('0x1f')]();});}};}function handleEntityNotFound(_0x590c97){return function(_0x326d19){if(!_0x326d19){_0x590c97['sendStatus'](0x194);}return _0x326d19;};}function handleError(_0x2d672d,_0x125519){_0x125519=_0x125519||0x1f4;return function(_0x25fddd){logger['error'](_0x25fddd[_0xf7a3('0x20')]);if(_0x25fddd[_0xf7a3('0x21')]){delete _0x25fddd[_0xf7a3('0x21')];}_0x2d672d['status'](_0x125519)['send'](_0x25fddd);};}exports[_0xf7a3('0x22')]=function(_0x1d71c9,_0x4006ea){var _0x192cf4={},_0x1c1340={},_0x564473={'count':0x0,'rows':[]};var _0x452dba=_[_0xf7a3('0x18')](db['VoiceExtension'][_0xf7a3('0x23')],function(_0xcede02){return{'name':_0xcede02['fieldName'],'type':_0xcede02[_0xf7a3('0x1b')][_0xf7a3('0x24')]};});_0x1c1340[_0xf7a3('0x25')]=_[_0xf7a3('0x18')](_0x452dba,_0xf7a3('0x21'));_0x1c1340[_0xf7a3('0x26')]=_['keys'](_0x1d71c9[_0xf7a3('0x26')]);_0x1c1340[_0xf7a3('0x27')]=_[_0xf7a3('0x28')](_0x1c1340[_0xf7a3('0x25')],_0x1c1340[_0xf7a3('0x26')]);_0x192cf4[_0xf7a3('0x29')]=_[_0xf7a3('0x28')](_0x1c1340[_0xf7a3('0x25')],qs[_0xf7a3('0x2a')](_0x1d71c9['query'][_0xf7a3('0x2a')]));_0x192cf4[_0xf7a3('0x29')]=_0x192cf4['attributes']['length']?_0x192cf4[_0xf7a3('0x29')]:_0x1c1340[_0xf7a3('0x25')];if(!_0x1d71c9[_0xf7a3('0x26')]['hasOwnProperty'](_0xf7a3('0x2b'))){_0x192cf4['limit']=qs[_0xf7a3('0x10')](_0x1d71c9[_0xf7a3('0x26')]['limit']);_0x192cf4[_0xf7a3('0xe')]=qs[_0xf7a3('0xe')](_0x1d71c9[_0xf7a3('0x26')][_0xf7a3('0xe')]);}_0x192cf4['order']=qs[_0xf7a3('0x2c')](_0x1d71c9[_0xf7a3('0x26')]['sort']);_0x192cf4[_0xf7a3('0x2d')]=qs[_0xf7a3('0x27')](_[_0xf7a3('0x2e')](_0x1d71c9[_0xf7a3('0x26')],_0x1c1340[_0xf7a3('0x27')]),_0x452dba);if(_0x1d71c9[_0xf7a3('0x26')][_0xf7a3('0x17')]){_0x192cf4['where']=_['merge'](_0x192cf4[_0xf7a3('0x2d')],{'$or':_[_0xf7a3('0x18')](_0x452dba,function(_0x5b4b46){if(_0x5b4b46[_0xf7a3('0x1b')]!=='VIRTUAL'){var _0x465d66={};_0x465d66[_0x5b4b46[_0xf7a3('0x21')]]={'$like':'%'+_0x1d71c9['query'][_0xf7a3('0x17')]+'%'};return _0x465d66;}})});}_0x192cf4=_[_0xf7a3('0x2f')]({},_0x192cf4,_0x1d71c9[_0xf7a3('0x30')]);var _0x3c2fd2={'where':_0x192cf4['where']};return db[_0xf7a3('0x31')][_0xf7a3('0x11')](_0x3c2fd2)[_0xf7a3('0x13')](function(_0x551e07){_0x564473['count']=_0x551e07;if(_0x1d71c9[_0xf7a3('0x26')][_0xf7a3('0x32')]){_0x192cf4[_0xf7a3('0x33')]=[{'all':!![]}];}return db[_0xf7a3('0x31')][_0xf7a3('0x34')](_0x192cf4);})[_0xf7a3('0x13')](function(_0x2eeba9){_0x564473[_0xf7a3('0x35')]=_0x2eeba9;return _0x564473;})[_0xf7a3('0x13')](respondWithFilteredResult(_0x4006ea,_0x192cf4))[_0xf7a3('0x36')](handleError(_0x4006ea,null));};exports['show']=function(_0x32ede4,_0x3cf4a2){var _0x2e6e66={'raw':![],'where':{'id':_0x32ede4[_0xf7a3('0x37')]['id']}},_0x367f1b={};_0x367f1b[_0xf7a3('0x25')]=_[_0xf7a3('0x38')](db['VoiceExtension'][_0xf7a3('0x23')]);_0x367f1b['query']=_[_0xf7a3('0x38')](_0x32ede4['query']);_0x367f1b[_0xf7a3('0x27')]=_[_0xf7a3('0x28')](_0x367f1b[_0xf7a3('0x25')],_0x367f1b['query']);_0x2e6e66[_0xf7a3('0x29')]=_[_0xf7a3('0x28')](_0x367f1b[_0xf7a3('0x25')],qs[_0xf7a3('0x2a')](_0x32ede4[_0xf7a3('0x26')][_0xf7a3('0x2a')]));_0x2e6e66[_0xf7a3('0x29')]=_0x2e6e66[_0xf7a3('0x29')]['length']?_0x2e6e66[_0xf7a3('0x29')]:_0x367f1b[_0xf7a3('0x25')];if(_0x32ede4['query'][_0xf7a3('0x32')]){_0x2e6e66['include']=[{'all':!![]}];}_0x2e6e66=_[_0xf7a3('0x2f')]({},_0x2e6e66,_0x32ede4[_0xf7a3('0x30')]);return db[_0xf7a3('0x31')][_0xf7a3('0x1c')](_0x2e6e66)[_0xf7a3('0x13')](handleEntityNotFound(_0x3cf4a2,null))[_0xf7a3('0x13')](respondWithResult(_0x3cf4a2,null))[_0xf7a3('0x36')](handleError(_0x3cf4a2,null));};exports[_0xf7a3('0x1e')]=function(_0x12d714,_0x44cf9f){return db['VoiceExtension'][_0xf7a3('0x1c')]({'where':{'id':_0x12d714[_0xf7a3('0x37')]['id']}})[_0xf7a3('0x13')](handleEntityNotFound(_0x44cf9f,null))[_0xf7a3('0x13')](removeEntity(_0x44cf9f,null))[_0xf7a3('0x36')](handleError(_0x44cf9f,null));};exports[_0xf7a3('0x39')]=function(_0x136a2b,_0x51d88f){if(_0x136a2b[_0xf7a3('0x3a')][_0xf7a3('0x1b')]===_0xf7a3('0x3b')&&!_[_0xf7a3('0x3c')](_0x136a2b[_0xf7a3('0x3a')][_0xf7a3('0x3d')],'_')){_0x136a2b[_0xf7a3('0x3a')]['exten']='_'[_0xf7a3('0x3e')](_0x136a2b['body'][_0xf7a3('0x3d')]);}return db[_0xf7a3('0x31')][_0xf7a3('0x39')](_0x136a2b[_0xf7a3('0x3a')],{'raw':![]})[_0xf7a3('0x13')](function(_0x4187b6){var _0x4e5205=_0x136a2b['user'][_0xf7a3('0x14')]({'plain':!![]});if(!_0x4e5205)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e5205['role']===_0xf7a3('0x3f')){var _0x2018c2=_0x4187b6[_0xf7a3('0x14')]({'plain':!![]});var _0x482f55=[{'name':_0xf7a3('0x15'),'value':_0xf7a3('0x40')},{'name':_0xf7a3('0x41'),'value':_0xf7a3('0x3b')},{'name':'InternalRoutes','value':'internal'}];var _0x59aa92=_[_0xf7a3('0x1c')](_0x482f55,[_0xf7a3('0x19'),_0x2018c2[_0xf7a3('0x1b')]])[_0xf7a3('0x21')];return db[_0xf7a3('0x42')]['find']({'where':{'name':_0x59aa92,'userProfileId':_0x4e5205[_0xf7a3('0x43')]},'raw':!![]})['then'](function(_0xf616fc){if(_0xf616fc&&_0xf616fc['autoAssociation']===0x0){return db['UserProfileResource'][_0xf7a3('0x39')]({'name':_0x2018c2[_0xf7a3('0x21')],'resourceId':_0x2018c2['id'],'type':_0xf616fc[_0xf7a3('0x21')],'sectionId':_0xf616fc['id']},{})['then'](function(){return _0x4187b6;});}else{return _0x4187b6;}})[_0xf7a3('0x36')](function(_0x1afa2b){logger[_0xf7a3('0x44')](_0xf7a3('0x45'),_0x1afa2b);throw _0x1afa2b;});}return _0x4187b6;})[_0xf7a3('0x13')](respondWithResult(_0x51d88f,0xc9))[_0xf7a3('0x36')](handleError(_0x51d88f,null));};exports[_0xf7a3('0x46')]=function(_0x340dd3,_0x4a420e){if(_0x340dd3[_0xf7a3('0x3a')]['id']){delete _0x340dd3[_0xf7a3('0x3a')]['id'];}return db[_0xf7a3('0x31')][_0xf7a3('0x1c')]({'where':{'id':_0x340dd3[_0xf7a3('0x37')]['id']}})[_0xf7a3('0x13')](handleEntityNotFound(_0x4a420e,null))[_0xf7a3('0x13')](function(_0x4eae19){if(_0x4eae19){return db['VoiceExtension']['update'](_[_0xf7a3('0x2e')](_0x340dd3[_0xf7a3('0x3a')],[_0xf7a3('0x3d'),_0xf7a3('0x47'),_0xf7a3('0x48'),_0xf7a3('0x49'),'cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0x4eae19[_0xf7a3('0x47')],'exten':_0x4eae19[_0xf7a3('0x3d')]},'individualHooks':!![]})[_0xf7a3('0x13')](function(_0x553256){return _0x553256;});}return null;})[_0xf7a3('0x13')](respondWithStatusCode(_0x4a420e,null))['catch'](handleError(_0x4a420e,null));};exports[_0xf7a3('0x4a')]=function(_0x529864,_0x3c5dda){var _0x4e649c=_0x529864['params']['id'];var _0x412b63=_0x529864[_0xf7a3('0x3a')];var _0x5a45d3=0xc8;var _0x2047f0=null;return db['sequelize'][_0xf7a3('0x4b')]({'isolationLevel':db['sequelize'][_0xf7a3('0x4c')][_0xf7a3('0x4d')][_0xf7a3('0x4e')]},function(_0x1c025a){return db[_0xf7a3('0x31')][_0xf7a3('0x4f')]({'where':{'id':_0x4e649c},'transaction':_0x1c025a})['then'](function(_0x138b1d){if(_0x138b1d){return db[_0xf7a3('0x31')][_0xf7a3('0x1e')]({'where':{'VoiceExtensionId':_0x4e649c},'transaction':_0x1c025a})['then'](function(){var _0x437740=_[_0xf7a3('0x18')](_0x412b63,function(_0x4cd992){_0x4cd992[_0xf7a3('0x50')]=_0x4e649c;_0x4cd992[_0xf7a3('0x51')]=!![];return _0x4cd992;});return _0x138b1d['createRouting'](_0x437740);})[_0xf7a3('0x13')](function(_0xff5364){return db[_0xf7a3('0x31')][_0xf7a3('0x52')](_0xff5364,{'transaction':_0x1c025a});});}else{_0x5a45d3=0x194;_0x2047f0=[];}});})[_0xf7a3('0x13')](function(){if(_0x5a45d3!==0x194){return db[_0xf7a3('0x31')][_0xf7a3('0x53')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4e649c},'order':_0xf7a3('0x54')})[_0xf7a3('0x13')](function(_0xf08ec8){_0x2047f0=_0xf08ec8;});}})[_0xf7a3('0x36')](function(_0x417dd4){_0x5a45d3=0x1f4;logger[_0xf7a3('0x44')](_0x417dd4[_0xf7a3('0x20')]);if(_0x417dd4[_0xf7a3('0x21')]){delete _0x417dd4[_0xf7a3('0x21')];}_0x2047f0=_0x417dd4;})['finally'](function(){if(_0x2047f0===null){_0x3c5dda['sendStatus'](_0x5a45d3);}else{if(_0x5a45d3===0x1f4){_0x3c5dda[_0xf7a3('0xc')](_0x5a45d3)[_0xf7a3('0x55')](_0x2047f0);}else{_0x3c5dda[_0xf7a3('0xc')](_0x5a45d3)['json'](_0x2047f0);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 8dfbfca..346e545 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 _0x245e=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x511f2b,_0x4c7591){var _0x22db60=function(_0x5d3df8){while(--_0x5d3df8){_0x511f2b['push'](_0x511f2b['shift']());}};_0x22db60(++_0x4c7591);}(_0x245e,0x180));var _0xe245=function(_0xecb87c,_0x87ad1b){_0xecb87c=_0xecb87c-0x0;var _0x3f47bc=_0x245e[_0xecb87c];return _0x3f47bc;};'use strict';var EventEmitter=require(_0xe245('0x0'));var VoiceExtension=require(_0xe245('0x1'))['db'][_0xe245('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe245('0x3'),'afterDestroy':_0xe245('0x4')};function emitEvent(_0x2427be){return function(_0x4451bc,_0x4c194c,_0x30df79){VoiceExtensionEvents[_0xe245('0x5')](_0x2427be+':'+_0x4451bc['id'],_0x4451bc);VoiceExtensionEvents[_0xe245('0x5')](_0x2427be,_0x4451bc);_0x30df79(null);};}for(var e in events){if(events[_0xe245('0x6')](e)){var event=events[e];VoiceExtension[_0xe245('0x7')](e,emitEvent(event));}}module[_0xe245('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd763=['update','emit','hasOwnProperty','hook','exports','setMaxListeners','save'];(function(_0x6d7d58,_0x52801b){var _0x4dfbac=function(_0x45d74d){while(--_0x45d74d){_0x6d7d58['push'](_0x6d7d58['shift']());}};_0x4dfbac(++_0x52801b);}(_0xd763,0x6e));var _0x3d76=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xd763[_0x2235bf];return _0x4c3a64;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3d76('0x0')](0x0);var events={'afterCreate':_0x3d76('0x1'),'afterUpdate':_0x3d76('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5ba57e){return function(_0x420649,_0x53a881,_0x41c304){VoiceExtensionEvents[_0x3d76('0x3')](_0x5ba57e+':'+_0x420649['id'],_0x420649);VoiceExtensionEvents[_0x3d76('0x3')](_0x5ba57e,_0x420649);_0x41c304(null);};}for(var e in events){if(events[_0x3d76('0x4')](e)){var event=events[e];VoiceExtension[_0x3d76('0x5')](e,emitEvent(event));}}module[_0x3d76('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index e9a755b..2192af7 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 _0x00e0=['define','VoiceExtension','Hangup','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','context','exten','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','trunk','timeout','options','url','split','length','name','param','prefix','phone','${EXTEN:','join','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','IntervalId','then','intervals','interval','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch'];(function(_0x286ac9,_0x4cd820){var _0x3e8f8e=function(_0x23e30a){while(--_0x23e30a){_0x286ac9['push'](_0x286ac9['shift']());}};_0x3e8f8e(++_0x4cd820);}(_0x00e0,0x1e3));var _0x000e=function(_0x1e3582,_0x248e63){_0x1e3582=_0x1e3582-0x0;var _0x50a57e=_0x00e0[_0x1e3582];return _0x50a57e;};'use strict';var _=require(_0x000e('0x0'));var attributes=require(_0x000e('0x1'));module[_0x000e('0x2')]=function(_0x580352){var _0x43d554=_0x580352['models'];function _0x9e3bd0(_0x54d3ca){var _0x556ee0=0x2;var _0x54a9c2=[{'type':_0x54d3ca['type'],'app':_0x000e('0x3'),'appdata':_0x000e('0x4')+_0x54d3ca['type'],'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']},{'type':_0x54d3ca[_0x000e('0x7')],'app':_0x54d3ca[_0x000e('0x8')]?'Set':_0x000e('0x9'),'appdata':_0x54d3ca['alias']?_0x000e('0xa')+_0x54d3ca[_0x000e('0x8')]:_0x000e('0xb'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']}];if(_0x54d3ca[_0x000e('0x7')]===_0x000e('0xc')){_0x54a9c2['push']({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x54d3ca['id'],'context':_0x54d3ca['context'],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']});}_0x54a9c2[_0x000e('0xd')]({'type':_0x54d3ca[_0x000e('0x7')],'app':_0x000e('0x3'),'appdata':_0x000e('0xe'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']},{'type':_0x54d3ca[_0x000e('0x7')],'app':_0x000e('0x3'),'appdata':_0x000e('0xf'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']},{'type':_0x54d3ca[_0x000e('0x7')],'app':_0x000e('0x3'),'appdata':_0x000e('0x10'),'context':_0x54d3ca[_0x000e('0x5')],'exten':_0x54d3ca[_0x000e('0x6')],'priority':_0x556ee0++,'VoiceExtensionId':_0x54d3ca['id']});return _0x54a9c2;}function _0x15c337(_0x519c08){var _0xc74b0a=0x2;var _0x9fa272=[{'type':_0x000e('0x11'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x519c08['alias']?'Set':'NoOp','appdata':_0x519c08[_0x000e('0x8')]?_0x000e('0xa')+_0x519c08[_0x000e('0x8')]:_0x000e('0xb'),'context':_0x519c08['context'],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':'outbound','app':_0x000e('0x3'),'appdata':_0x000e('0x12')+(_0x519c08[_0x000e('0x13')]?'${EXTEN:'+_0x519c08['cutdigits']+'}':'${EXTEN}'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0x14')+_0x519c08['id'],'context':_0x519c08['context'],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'ExecIf','appdata':_0x000e('0x15')+(_0xc74b0a+0x2)+'):Goto('+(_0xc74b0a+0x1)+')','context':_0x519c08['context'],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'Set','appdata':_0x519c08[_0x000e('0x13')]?_0x000e('0x16')+_0x519c08[_0x000e('0x13')]+'}':_0x000e('0x17'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x519c08['context'],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0xf'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0x10'),'context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':_0x000e('0x18')+_0x519c08['id'],'context':_0x519c08['context'],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']}];if(_0x519c08['hasOwnProperty']('recordingFormat')&&_0x519c08['recordingFormat']!==_0x000e('0x19')){_0x9fa272['push']({'type':_0x000e('0x11'),'app':_0x000e('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x519c08[_0x000e('0x5')],'exten':_0x519c08[_0x000e('0x6')],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']},{'type':_0x000e('0x11'),'app':'Set','appdata':_0x000e('0x1a')+_0x519c08[_0x000e('0x1b')]||'wav','context':_0x519c08['context'],'exten':_0x519c08['exten'],'priority':_0xc74b0a++,'VoiceExtensionId':_0x519c08['id']});}return _0x9fa272;}function _0x3ff69c(_0x15dfb8,_0x59d762){var _0x93d724=[{'name':_0x000e('0x1c'),'param':0x0},{'name':_0x000e('0x1d'),'param':0x1},{'name':_0x000e('0x1e'),'param':0x2},{'name':_0x000e('0x1f'),'param':0x3}];var _0x4e9883={};var _0x5d36be=_0x59d762[_0x000e('0x20')](',');var _0x52ec7b=[];for(var _0x442da5=0x0;_0x442da5<_0x93d724[_0x000e('0x21')];_0x442da5++){switch(_0x93d724[_0x442da5][_0x000e('0x22')]){case _0x000e('0x1c'):_0x4e9883[_0x000e('0x1c')]=_0x5d36be[_0x93d724[_0x442da5][_0x000e('0x23')]][_0x000e('0x20')]('/')[0x1];_0x4e9883['phone']=_0x5d36be[_0x93d724[_0x442da5][_0x000e('0x23')]][_0x000e('0x20')]('/')[0x2];_0x4e9883[_0x000e('0x24')]=_0x4e9883[_0x000e('0x25')]?_0x4e9883[_0x000e('0x25')][_0x000e('0x20')]('$')[0x0]:undefined;_0x4e9883['phone']=_0x15dfb8[_0x000e('0x13')]?(_0x4e9883[_0x000e('0x24')]||'')+_0x000e('0x26')+_0x15dfb8[_0x000e('0x13')]+'}':(_0x4e9883[_0x000e('0x24')]||'')+'${EXTEN}';_0x52ec7b[_0x93d724[_0x442da5][_0x000e('0x23')]]=['SIP',_0x4e9883[_0x000e('0x1c')],_0x4e9883[_0x000e('0x25')]][_0x000e('0x27')]('/');break;case _0x000e('0x1e'):_0x4e9883[_0x000e('0x1e')]=_0x5d36be[_0x93d724[_0x442da5]['param']];if(_0x15dfb8[_0x000e('0x1b')]!==_0x000e('0x19')){if(_0x4e9883[_0x000e('0x1e')][_0x000e('0x28')](_0x000e('0x29'))<0x0){_0x4e9883[_0x000e('0x1e')]+='U(xcally-mixmonitor-context)';}}else{_0x4e9883['options']=_0x4e9883[_0x000e('0x1e')][_0x000e('0x2a')](_0x000e('0x29'),'');}_0x52ec7b[_0x93d724[_0x442da5][_0x000e('0x23')]]=_0x4e9883[_0x000e('0x1e')];break;default:_0x52ec7b[_0x93d724[_0x442da5][_0x000e('0x23')]]=_0x5d36be[_0x93d724[_0x442da5][_0x000e('0x23')]];}}return _0x52ec7b[_0x000e('0x27')](',');}function _0x44b390(_0x55b038,_0x549bfc,_0x2d36ee){return new Promise(function(_0x19f040,_0x523c1d){var _0xfa4ef7=[];if(_['isEmpty'](_0x549bfc))return _0x19f040(_0xfa4ef7);_0x43d554[_0x000e('0x2b')][_0x000e('0x2c')]({'attributes':['id','interval',_0x000e('0x2d')],'raw':!![]})[_0x000e('0x2e')](function(_0x4b2530){for(var _0x15c14b=0x0,_0x1f408a=0x0;_0x15c14b<_0x549bfc[_0x000e('0x21')];_0x15c14b++,_0x1f408a=0x0){var _0x2ccbe2=_0x549bfc[_0x15c14b];var _0x1c31ba=[];var _0x35374a=[];delete _0x2ccbe2['id'];if(_0x2ccbe2['interval']!=='*,*,*,*'){_0x2ccbe2[_0x000e('0x2f')]=[_0x2ccbe2[_0x000e('0x30')]];}else{_0x2ccbe2['intervals']=_0x2ccbe2['IntervalId']?_[_0x000e('0x31')](_[_0x000e('0x32')](_0x4b2530,{'IntervalId':_0x2ccbe2[_0x000e('0x2d')]}),'interval'):[];}_0x2ccbe2[_0x000e('0x5')]=_0x55b038[_0x000e('0x5')];_0x2ccbe2['exten']=_0x55b038['exten'];if(_0x2ccbe2[_0x000e('0x7')])_0x2ccbe2['type']=_0x2ccbe2['type'][_0x000e('0x33')]();if(_0x55b038[_0x000e('0x7')]==='outbound'){if(_0x2ccbe2[_0x000e('0x34')](_0x000e('0x35'))&&_0x2ccbe2[_0x000e('0x35')]&&_0x2ccbe2[_0x000e('0x35')]!=='--'){_0x1c31ba['push']({'type':_0x2ccbe2['type'][_0x000e('0x33')](),'app':_0x000e('0x3'),'appdata':_0x000e('0x36')+_0x2ccbe2[_0x000e('0x35')],'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')][_0x000e('0x33')](),'app':_0x000e('0x37'),'appdata':_0x000e('0x38')+(_0x2ccbe2[_0x000e('0x39')]?_0x000e('0x3a')+_0x2ccbe2[_0x000e('0x39')]+')':_0x000e('0x3b')),'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038['exten'],'priority':_0x2ccbe2[_0x000e('0x2f')]['length']+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}else{if(_0x2ccbe2[_0x000e('0x34')](_0x000e('0x3c'))){if([_0x000e('0x3d'),_0x000e('0x3e')]['includes'](_0x2ccbe2[_0x000e('0x3f')][_0x000e('0x33')]())&&_0x2ccbe2[_0x000e('0x40')]!==_0x000e('0x41')){if(_0x2ccbe2[_0x000e('0x3c')]){_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2['type'][_0x000e('0x33')](),'app':_0x000e('0x37'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038['exten'],'priority':_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')]['toLowerCase'](),'app':'Set','appdata':_0x000e('0x42'),'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2[_0x000e('0x2f')]['length']+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}else{_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')][_0x000e('0x33')](),'app':_0x000e('0x37'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2['intervals'][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});_0x1c31ba[_0x000e('0xd')]({'type':_0x2ccbe2[_0x000e('0x7')][_0x000e('0x33')](),'app':'Set','appdata':_0x000e('0x43'),'context':_0x55b038[_0x000e('0x5')],'exten':_0x55b038[_0x000e('0x6')],'priority':_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')]+_0x2d36ee+_0x1f408a++,'VoiceExtensionId':_0x55b038['id']});}}}}for(var _0x4f6bda=0x0;_0x4f6bda<_0x2ccbe2[_0x000e('0x2f')][_0x000e('0x21')];_0x4f6bda++){var _0x39d584=_0x2d36ee+_0x2ccbe2[_0x000e('0x2f')]['length'];var _0x14e605=_0x4f6bda===_0x2ccbe2['intervals'][_0x000e('0x21')]-0x1?_0x2d36ee+_0x1c31ba[_0x000e('0x21')]+_0x35374a[_0x000e('0x21')]+0x2:_0x2d36ee+_0x4f6bda+0x1;_0x1c31ba[_0x000e('0x44')](_0x4f6bda,0x0,{'type':_0x55b038[_0x000e('0x7')],'app':_0x000e('0x45'),'appdata':_0x2ccbe2[_0x000e('0x2f')][_0x4f6bda]+'?'+_0x55b038[_0x000e('0x5')]+',${EXTEN},'+_0x39d584+':'+_0x55b038['context']+_0x000e('0x46')+_0x14e605,'exten':_0x55b038[_0x000e('0x6')],'context':_0x55b038[_0x000e('0x5')],'priority':_0x2d36ee+_0x4f6bda,'VoiceExtensionId':_0x55b038['id']});}if(_0x2ccbe2[_0x000e('0x40')]===_0x000e('0x47'))_0x2ccbe2[_0x000e('0x48')]=_0x3ff69c(_0x55b038,_0x2ccbe2[_0x000e('0x48')]);_0x2ccbe2[_0x000e('0x49')]=_0x1c31ba[_0x000e('0x21')]?_[_0x000e('0x4a')](_0x1c31ba)[_0x000e('0x49')]+0x1:_0x2d36ee;_0xfa4ef7=_[_0x000e('0x4b')](_0xfa4ef7,_0x1c31ba,[_0x2ccbe2],_0x35374a);_0x2d36ee=_[_0x000e('0x4a')](_0xfa4ef7)['priority']+0x1;}return _0x19f040(_0xfa4ef7);})[_0x000e('0x4c')](function(_0x22329c){_0x523c1d(_0x22329c);});});}return _0x580352[_0x000e('0x4d')](_0x000e('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1c66df){var _0x50ecf9=this['get']({'plain':!![]});var _0x21cf32=_0x50ecf9['type']==='outbound'?_0x15c337(_0x50ecf9):_0x9e3bd0(_0x50ecf9);return _0x44b390(_0x50ecf9,_0x1c66df,_[_0x000e('0x4a')](_0x21cf32)[_0x000e('0x49')]+0x1)[_0x000e('0x2e')](function(_0x5d96d3){var _0x47dd52=_[_0x000e('0x4b')](_0x21cf32,_0x5d96d3);_0x47dd52[_0x000e('0xd')]({'type':_0x50ecf9['type'],'app':_0x000e('0x4f'),'exten':_0x50ecf9[_0x000e('0x6')],'context':_0x50ecf9['context'],'priority':_[_0x000e('0x4a')](_0x47dd52)[_0x000e('0x49')]+0x1,'VoiceExtensionId':_0x50ecf9['id']});return _0x47dd52;});}}});}; \ No newline at end of file +var _0x06cb=['outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','split','length','name','trunk','param','prefix','phone','join','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','VoiceExtension','lodash','./voiceExtension.attributes','exports','type','Set','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0'];(function(_0x2e8fa0,_0x230e09){var _0x4f5705=function(_0x2487ea){while(--_0x2487ea){_0x2e8fa0['push'](_0x2e8fa0['shift']());}};_0x4f5705(++_0x230e09);}(_0x06cb,0x1c6));var _0xb06c=function(_0x4b7d57,_0x5bc1c5){_0x4b7d57=_0x4b7d57-0x0;var _0x494a0b=_0x06cb[_0x4b7d57];return _0x494a0b;};'use strict';var _=require(_0xb06c('0x0'));var attributes=require(_0xb06c('0x1'));module[_0xb06c('0x2')]=function(_0x2b3aa1){var _0x5ac202=_0x2b3aa1['models'];function _0xaf047b(_0x33526e){var _0x3e31af=0x2;var _0x1e4fd2=[{'type':_0x33526e[_0xb06c('0x3')],'app':_0xb06c('0x4'),'appdata':'CDR(type)='+_0x33526e[_0xb06c('0x3')],'context':_0x33526e[_0xb06c('0x5')],'exten':_0x33526e[_0xb06c('0x6')],'priority':_0x3e31af++,'VoiceExtensionId':_0x33526e['id']},{'type':_0x33526e[_0xb06c('0x3')],'app':_0x33526e[_0xb06c('0x7')]?_0xb06c('0x4'):'NoOp','appdata':_0x33526e['alias']?_0xb06c('0x8')+_0x33526e[_0xb06c('0x7')]:_0xb06c('0x9'),'context':_0x33526e['context'],'exten':_0x33526e['exten'],'priority':_0x3e31af++,'VoiceExtensionId':_0x33526e['id']}];if(_0x33526e[_0xb06c('0x3')]===_0xb06c('0xa')){_0x1e4fd2[_0xb06c('0xb')]({'type':_0xb06c('0xa'),'app':'Set','appdata':'CDR(routeid)='+_0x33526e['id'],'context':_0x33526e['context'],'exten':_0x33526e[_0xb06c('0x6')],'priority':_0x3e31af++,'VoiceExtensionId':_0x33526e['id']});}_0x1e4fd2['push']({'type':_0x33526e[_0xb06c('0x3')],'app':_0xb06c('0x4'),'appdata':_0xb06c('0xc'),'context':_0x33526e['context'],'exten':_0x33526e[_0xb06c('0x6')],'priority':_0x3e31af++,'VoiceExtensionId':_0x33526e['id']},{'type':_0x33526e['type'],'app':_0xb06c('0x4'),'appdata':_0xb06c('0xd'),'context':_0x33526e[_0xb06c('0x5')],'exten':_0x33526e['exten'],'priority':_0x3e31af++,'VoiceExtensionId':_0x33526e['id']},{'type':_0x33526e[_0xb06c('0x3')],'app':_0xb06c('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x33526e[_0xb06c('0x5')],'exten':_0x33526e['exten'],'priority':_0x3e31af++,'VoiceExtensionId':_0x33526e['id']});return _0x1e4fd2;}function _0x21a607(_0x3b3f96){var _0x485531=0x2;var _0x24345d=[{'type':_0xb06c('0xe'),'app':_0xb06c('0x4'),'appdata':'CDR(type)=outbound','context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':'outbound','app':_0x3b3f96[_0xb06c('0x7')]?'Set':_0xb06c('0xf'),'appdata':_0x3b3f96[_0xb06c('0x7')]?_0xb06c('0x8')+_0x3b3f96[_0xb06c('0x7')]:'No\x20alias\x20set','context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':'outbound','app':_0xb06c('0x4'),'appdata':_0xb06c('0x10')+(_0x3b3f96[_0xb06c('0x11')]?_0xb06c('0x12')+_0x3b3f96[_0xb06c('0x11')]+'}':_0xb06c('0x13')),'context':_0x3b3f96['context'],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':_0xb06c('0xe'),'app':_0xb06c('0x4'),'appdata':'CDR(routeid)='+_0x3b3f96['id'],'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96['exten'],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':_0xb06c('0xe'),'app':_0xb06c('0x14'),'appdata':_0xb06c('0x15')+(_0x485531+0x2)+_0xb06c('0x16')+(_0x485531+0x1)+')','context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96['exten'],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':_0xb06c('0xe'),'app':_0xb06c('0x4'),'appdata':_0x3b3f96['cutdigits']?_0xb06c('0x17')+_0x3b3f96[_0xb06c('0x11')]+'}':_0xb06c('0x18'),'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':'outbound','app':_0xb06c('0x4'),'appdata':_0xb06c('0xc'),'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':_0xb06c('0xe'),'app':_0xb06c('0x4'),'appdata':_0xb06c('0xd'),'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':_0xb06c('0xe'),'app':_0xb06c('0x4'),'appdata':_0xb06c('0x19'),'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':_0xb06c('0xe'),'app':_0xb06c('0x4'),'appdata':_0xb06c('0x1a')+_0x3b3f96['id'],'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']}];if(_0x3b3f96[_0xb06c('0x1b')](_0xb06c('0x1c'))&&_0x3b3f96[_0xb06c('0x1c')]!==_0xb06c('0x1d')){_0x24345d[_0xb06c('0xb')]({'type':_0xb06c('0xe'),'app':_0xb06c('0x4'),'appdata':_0xb06c('0x1e'),'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96[_0xb06c('0x6')],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']},{'type':_0xb06c('0xe'),'app':'Set','appdata':_0xb06c('0x1f')+_0x3b3f96['recordingFormat']||_0xb06c('0x20'),'context':_0x3b3f96[_0xb06c('0x5')],'exten':_0x3b3f96['exten'],'priority':_0x485531++,'VoiceExtensionId':_0x3b3f96['id']});}return _0x24345d;}function _0x5535f8(_0x3cf8b3,_0x517cd5){var _0x23eb44=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0xb06c('0x21'),'param':0x2},{'name':_0xb06c('0x22'),'param':0x3}];var _0x454d48={};var _0x46ed4a=_0x517cd5[_0xb06c('0x23')](',');var _0x4b8232=[];for(var _0x47a4d1=0x0;_0x47a4d1<_0x23eb44[_0xb06c('0x24')];_0x47a4d1++){switch(_0x23eb44[_0x47a4d1][_0xb06c('0x25')]){case'trunk':_0x454d48[_0xb06c('0x26')]=_0x46ed4a[_0x23eb44[_0x47a4d1][_0xb06c('0x27')]][_0xb06c('0x23')]('/')[0x1];_0x454d48['phone']=_0x46ed4a[_0x23eb44[_0x47a4d1]['param']]['split']('/')[0x2];_0x454d48[_0xb06c('0x28')]=_0x454d48[_0xb06c('0x29')]?_0x454d48['phone'][_0xb06c('0x23')]('$')[0x0]:undefined;_0x454d48[_0xb06c('0x29')]=_0x3cf8b3[_0xb06c('0x11')]?(_0x454d48[_0xb06c('0x28')]||'')+_0xb06c('0x12')+_0x3cf8b3['cutdigits']+'}':(_0x454d48[_0xb06c('0x28')]||'')+_0xb06c('0x13');_0x4b8232[_0x23eb44[_0x47a4d1][_0xb06c('0x27')]]=['SIP',_0x454d48[_0xb06c('0x26')],_0x454d48[_0xb06c('0x29')]][_0xb06c('0x2a')]('/');break;case _0xb06c('0x21'):_0x454d48[_0xb06c('0x21')]=_0x46ed4a[_0x23eb44[_0x47a4d1][_0xb06c('0x27')]];if(_0x3cf8b3[_0xb06c('0x1c')]!==_0xb06c('0x1d')){if(_0x454d48['options']['indexOf'](_0xb06c('0x2b'))<0x0){_0x454d48[_0xb06c('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x454d48['options']=_0x454d48[_0xb06c('0x21')][_0xb06c('0x2c')](_0xb06c('0x2b'),'');}_0x4b8232[_0x23eb44[_0x47a4d1]['param']]=_0x454d48[_0xb06c('0x21')];break;default:_0x4b8232[_0x23eb44[_0x47a4d1][_0xb06c('0x27')]]=_0x46ed4a[_0x23eb44[_0x47a4d1][_0xb06c('0x27')]];}}return _0x4b8232['join'](',');}function _0x3c816d(_0x54677c,_0x579572,_0x172c6b){return new Promise(function(_0x5dc3c9,_0x1892da){var _0x58a956=[];if(_[_0xb06c('0x2d')](_0x579572))return _0x5dc3c9(_0x58a956);_0x5ac202['Interval'][_0xb06c('0x2e')]({'attributes':['id',_0xb06c('0x2f'),_0xb06c('0x30')],'raw':!![]})[_0xb06c('0x31')](function(_0x2cd8c3){for(var _0x90574c=0x0,_0x2df591=0x0;_0x90574c<_0x579572[_0xb06c('0x24')];_0x90574c++,_0x2df591=0x0){var _0x23cb62=_0x579572[_0x90574c];var _0x1d453=[];var _0x1fe5f2=[];delete _0x23cb62['id'];if(_0x23cb62[_0xb06c('0x2f')]!==_0xb06c('0x32')){_0x23cb62[_0xb06c('0x33')]=[_0x23cb62['interval']];}else{_0x23cb62[_0xb06c('0x33')]=_0x23cb62[_0xb06c('0x30')]?_[_0xb06c('0x34')](_[_0xb06c('0x35')](_0x2cd8c3,{'IntervalId':_0x23cb62[_0xb06c('0x30')]}),_0xb06c('0x2f')):[];}_0x23cb62[_0xb06c('0x5')]=_0x54677c[_0xb06c('0x5')];_0x23cb62[_0xb06c('0x6')]=_0x54677c[_0xb06c('0x6')];if(_0x23cb62['type'])_0x23cb62['type']=_0x23cb62['type'][_0xb06c('0x36')]();if(_0x54677c[_0xb06c('0x3')]===_0xb06c('0xe')){if(_0x23cb62['hasOwnProperty'](_0xb06c('0x37'))&&_0x23cb62[_0xb06c('0x37')]&&_0x23cb62['tag']!=='--'){_0x1d453[_0xb06c('0xb')]({'type':_0x23cb62[_0xb06c('0x3')]['toLowerCase'](),'app':_0xb06c('0x4'),'appdata':_0xb06c('0x38')+_0x23cb62[_0xb06c('0x37')],'context':_0x54677c[_0xb06c('0x5')],'exten':_0x54677c[_0xb06c('0x6')],'priority':_0x23cb62[_0xb06c('0x33')][_0xb06c('0x24')]+_0x172c6b+_0x2df591++,'VoiceExtensionId':_0x54677c['id']});}_0x1d453[_0xb06c('0xb')]({'type':_0x23cb62[_0xb06c('0x3')][_0xb06c('0x36')](),'app':'ExecIf','appdata':_0xb06c('0x39')+(_0x23cb62[_0xb06c('0x3a')]?_0xb06c('0x3b')+_0x23cb62[_0xb06c('0x3a')]+')':'NoOp(No\x20number\x20available)'),'context':_0x54677c[_0xb06c('0x5')],'exten':_0x54677c[_0xb06c('0x6')],'priority':_0x23cb62[_0xb06c('0x33')]['length']+_0x172c6b+_0x2df591++,'VoiceExtensionId':_0x54677c['id']});}else{if(_0x23cb62[_0xb06c('0x1b')]('answer')){if(['queue','playback'][_0xb06c('0x3c')](_0x23cb62[_0xb06c('0x3d')][_0xb06c('0x36')]())&&_0x23cb62[_0xb06c('0x3e')]!==_0xb06c('0x3f')){if(_0x23cb62[_0xb06c('0x40')]){_0x1d453[_0xb06c('0xb')]({'type':_0x23cb62[_0xb06c('0x3')][_0xb06c('0x36')](),'app':_0xb06c('0x14'),'appdata':_0xb06c('0x41'),'context':_0x54677c[_0xb06c('0x5')],'exten':_0x54677c[_0xb06c('0x6')],'priority':_0x23cb62['intervals'][_0xb06c('0x24')]+_0x172c6b+_0x2df591++,'VoiceExtensionId':_0x54677c['id']});_0x1d453[_0xb06c('0xb')]({'type':_0x23cb62['type'][_0xb06c('0x36')](),'app':_0xb06c('0x4'),'appdata':_0xb06c('0x42'),'context':_0x54677c['context'],'exten':_0x54677c[_0xb06c('0x6')],'priority':_0x23cb62[_0xb06c('0x33')][_0xb06c('0x24')]+_0x172c6b+_0x2df591++,'VoiceExtensionId':_0x54677c['id']});}else{_0x1d453[_0xb06c('0xb')]({'type':_0x23cb62[_0xb06c('0x3')]['toLowerCase'](),'app':_0xb06c('0x14'),'appdata':_0xb06c('0x43'),'context':_0x54677c[_0xb06c('0x5')],'exten':_0x54677c['exten'],'priority':_0x23cb62[_0xb06c('0x33')][_0xb06c('0x24')]+_0x172c6b+_0x2df591++,'VoiceExtensionId':_0x54677c['id']});_0x1d453[_0xb06c('0xb')]({'type':_0x23cb62['type'][_0xb06c('0x36')](),'app':_0xb06c('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x54677c[_0xb06c('0x5')],'exten':_0x54677c[_0xb06c('0x6')],'priority':_0x23cb62[_0xb06c('0x33')][_0xb06c('0x24')]+_0x172c6b+_0x2df591++,'VoiceExtensionId':_0x54677c['id']});}}}}for(var _0x35f18d=0x0;_0x35f18d<_0x23cb62[_0xb06c('0x33')][_0xb06c('0x24')];_0x35f18d++){var _0xf3a526=_0x172c6b+_0x23cb62[_0xb06c('0x33')][_0xb06c('0x24')];var _0xaff865=_0x35f18d===_0x23cb62[_0xb06c('0x33')]['length']-0x1?_0x172c6b+_0x1d453[_0xb06c('0x24')]+_0x1fe5f2['length']+0x2:_0x172c6b+_0x35f18d+0x1;_0x1d453[_0xb06c('0x44')](_0x35f18d,0x0,{'type':_0x54677c[_0xb06c('0x3')],'app':_0xb06c('0x45'),'appdata':_0x23cb62[_0xb06c('0x33')][_0x35f18d]+'?'+_0x54677c['context']+_0xb06c('0x46')+_0xf3a526+':'+_0x54677c['context']+_0xb06c('0x46')+_0xaff865,'exten':_0x54677c[_0xb06c('0x6')],'context':_0x54677c[_0xb06c('0x5')],'priority':_0x172c6b+_0x35f18d,'VoiceExtensionId':_0x54677c['id']});}if(_0x23cb62[_0xb06c('0x3e')]===_0xb06c('0x47'))_0x23cb62[_0xb06c('0x48')]=_0x5535f8(_0x54677c,_0x23cb62['appdata']);_0x23cb62[_0xb06c('0x49')]=_0x1d453[_0xb06c('0x24')]?_[_0xb06c('0x4a')](_0x1d453)[_0xb06c('0x49')]+0x1:_0x172c6b;_0x58a956=_[_0xb06c('0x4b')](_0x58a956,_0x1d453,[_0x23cb62],_0x1fe5f2);_0x172c6b=_['last'](_0x58a956)['priority']+0x1;}return _0x5dc3c9(_0x58a956);})['catch'](function(_0x17e2c1){_0x1892da(_0x17e2c1);});});}return _0x2b3aa1[_0xb06c('0x4c')](_0xb06c('0x4d'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x40eb81){var _0x275955=this['get']({'plain':!![]});var _0x5e7a8a=_0x275955[_0xb06c('0x3')]===_0xb06c('0xe')?_0x21a607(_0x275955):_0xaf047b(_0x275955);return _0x3c816d(_0x275955,_0x40eb81,_[_0xb06c('0x4a')](_0x5e7a8a)[_0xb06c('0x49')]+0x1)[_0xb06c('0x31')](function(_0x24f88b){var _0x139ed6=_['concat'](_0x5e7a8a,_0x24f88b);_0x139ed6[_0xb06c('0xb')]({'type':_0x275955[_0xb06c('0x3')],'app':'Hangup','exten':_0x275955['exten'],'context':_0x275955[_0xb06c('0x5')],'priority':_[_0xb06c('0x4a')](_0x139ed6)[_0xb06c('0x49')]+0x1,'VoiceExtensionId':_0x275955['id']});return _0x139ed6;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index d6ddd82..53286f0 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 _0xafb9=['../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','findAll','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0xafb9,0x68));var _0x9afb=function(_0x2819c5,_0x1b3d18){_0x2819c5=_0x2819c5-0x0;var _0x101dea=_0xafb9[_0x2819c5];return _0x101dea;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9afb('0xb')],{'host':_0x9afb('0xc'),'port':0x18eb});var socket=require(_0x9afb('0xd'))(new Redis(config['redis']));require(_0x9afb('0xe'))[_0x9afb('0xf')](socket);function respondWithRpcPromise(_0x2aaefe,_0x27fa71,_0x1e5325){return new BPromise(function(_0x56f477,_0x5bb974){return client[_0x9afb('0x10')](_0x2aaefe,_0x1e5325)[_0x9afb('0x11')](function(_0x3e6a29){logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,_0x9afb('0x14'));logger[_0x9afb('0x15')](_0x9afb('0x16'),_0x27fa71,_0x9afb('0x14'),JSON[_0x9afb('0x17')](_0x3e6a29));if(_0x3e6a29['error']){if(_0x3e6a29[_0x9afb('0x18')]['code']===0x1f4){logger['error'](_0x9afb('0x13'),_0x27fa71,_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);return _0x5bb974(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}logger[_0x9afb('0x18')](_0x9afb('0x13'),_0x27fa71,_0x3e6a29['error'][_0x9afb('0x19')]);return _0x56f477(_0x3e6a29[_0x9afb('0x18')][_0x9afb('0x19')]);}else{logger[_0x9afb('0x12')](_0x9afb('0x13'),_0x27fa71,'request\x20sent');_0x56f477(_0x3e6a29[_0x9afb('0x1a')]['message']);}})[_0x9afb('0x1b')](function(_0x12aa19){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x27fa71,_0x12aa19);_0x5bb974(_0x12aa19);});});}exports[_0x9afb('0x1c')]=function(_0x1217d9){var _0x3d8450=this;return new Promise(function(_0x424692,_0x3bd256){return db['VoiceExtension'][_0x9afb('0x1d')]({'raw':_0x1217d9['options']?_0x1217d9['options'][_0x9afb('0x1e')]===undefined?!![]:![]:!![],'where':_0x1217d9[_0x9afb('0x1f')]?_0x1217d9[_0x9afb('0x1f')][_0x9afb('0x20')]||null:null,'attributes':_0x1217d9['options']?_0x1217d9[_0x9afb('0x1f')][_0x9afb('0x21')]||null:null,'limit':_0x1217d9['options']?_0x1217d9['options']['limit']||null:null,'include':_0x1217d9[_0x9afb('0x1f')]?_0x1217d9['options'][_0x9afb('0x22')]?_[_0x9afb('0x23')](_0x1217d9['options'][_0x9afb('0x22')],function(_0x28beba){return{'model':db[_0x28beba[_0x9afb('0x24')]],'as':_0x28beba['as'],'attributes':_0x28beba[_0x9afb('0x21')],'include':_0x28beba['include']?_[_0x9afb('0x23')](_0x28beba['include'],function(_0x29e092){return{'model':db[_0x29e092['model']],'as':_0x29e092['as'],'attributes':_0x29e092['attributes'],'include':_0x29e092[_0x9afb('0x22')]?_[_0x9afb('0x23')](_0x29e092[_0x9afb('0x22')],function(_0x13a33e){return{'model':db[_0x13a33e[_0x9afb('0x24')]],'as':_0x13a33e['as'],'attributes':_0x13a33e[_0x9afb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0x11')](function(_0x5aabd5){logger['info'](_0x9afb('0x1c'),_0x1217d9);logger[_0x9afb('0x15')]('GetVoiceExtension',_0x1217d9,JSON[_0x9afb('0x17')](_0x5aabd5));_0x424692(_0x5aabd5);})[_0x9afb('0x1b')](function(_0x5560bd){logger[_0x9afb('0x18')](_0x9afb('0x1c'),_0x5560bd[_0x9afb('0x19')],_0x1217d9);_0x3bd256(_0x3d8450[_0x9afb('0x18')](0x1f4,_0x5560bd[_0x9afb('0x19')]));});});}; \ No newline at end of file +var _0x8819=['raw','limit','include','model','attributes','map','stringify','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','VoiceExtension,\x20%s,\x20%s','message','result','GetVoiceExtension','VoiceExtension','findAll','options'];(function(_0x27f294,_0x2e8998){var _0x17c93a=function(_0x4657f){while(--_0x4657f){_0x27f294['push'](_0x27f294['shift']());}};_0x17c93a(++_0x2e8998);}(_0x8819,0x94));var _0x9881=function(_0x6b9350,_0x4f0163){_0x6b9350=_0x6b9350-0x0;var _0x57d771=_0x8819[_0x6b9350];return _0x57d771;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9881('0x0'));var BPromise=require(_0x9881('0x1'));var rs=require(_0x9881('0x2'));var fs=require('fs');var Redis=require(_0x9881('0x3'));var db=require(_0x9881('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9881('0x5'))(_0x9881('0x6'));var config=require(_0x9881('0x7'));var jayson=require(_0x9881('0x8'));var client=jayson[_0x9881('0x9')][_0x9881('0xa')]({'port':0x232a});config['redis']=_[_0x9881('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9881('0xc'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x9881('0xd')](socket);function respondWithRpcPromise(_0x4adf62,_0x2570a3,_0x39122e){return new BPromise(function(_0x1e192a,_0x571947){return client[_0x9881('0xe')](_0x4adf62,_0x39122e)[_0x9881('0xf')](function(_0x2693a6){logger[_0x9881('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x2570a3,_0x9881('0x11'));logger[_0x9881('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2570a3,_0x9881('0x11'),JSON['stringify'](_0x2693a6));if(_0x2693a6['error']){if(_0x2693a6['error']['code']===0x1f4){logger[_0x9881('0x13')](_0x9881('0x14'),_0x2570a3,_0x2693a6[_0x9881('0x13')][_0x9881('0x15')]);return _0x571947(_0x2693a6[_0x9881('0x13')][_0x9881('0x15')]);}logger['error'](_0x9881('0x14'),_0x2570a3,_0x2693a6[_0x9881('0x13')][_0x9881('0x15')]);return _0x1e192a(_0x2693a6['error']['message']);}else{logger['info'](_0x9881('0x14'),_0x2570a3,'request\x20sent');_0x1e192a(_0x2693a6[_0x9881('0x16')]['message']);}})['catch'](function(_0x1f6e20){logger[_0x9881('0x13')](_0x9881('0x14'),_0x2570a3,_0x1f6e20);_0x571947(_0x1f6e20);});});}exports[_0x9881('0x17')]=function(_0x43f8a2){var _0xe97d44=this;return new Promise(function(_0x3ae21d,_0x1243cc){return db[_0x9881('0x18')][_0x9881('0x19')]({'raw':_0x43f8a2[_0x9881('0x1a')]?_0x43f8a2[_0x9881('0x1a')][_0x9881('0x1b')]===undefined?!![]:![]:!![],'where':_0x43f8a2[_0x9881('0x1a')]?_0x43f8a2[_0x9881('0x1a')]['where']||null:null,'attributes':_0x43f8a2['options']?_0x43f8a2[_0x9881('0x1a')]['attributes']||null:null,'limit':_0x43f8a2['options']?_0x43f8a2[_0x9881('0x1a')][_0x9881('0x1c')]||null:null,'include':_0x43f8a2['options']?_0x43f8a2['options'][_0x9881('0x1d')]?_['map'](_0x43f8a2[_0x9881('0x1a')][_0x9881('0x1d')],function(_0x16eeca){return{'model':db[_0x16eeca[_0x9881('0x1e')]],'as':_0x16eeca['as'],'attributes':_0x16eeca[_0x9881('0x1f')],'include':_0x16eeca[_0x9881('0x1d')]?_[_0x9881('0x20')](_0x16eeca[_0x9881('0x1d')],function(_0xc328b7){return{'model':db[_0xc328b7[_0x9881('0x1e')]],'as':_0xc328b7['as'],'attributes':_0xc328b7[_0x9881('0x1f')],'include':_0xc328b7[_0x9881('0x1d')]?_[_0x9881('0x20')](_0xc328b7['include'],function(_0x31956e){return{'model':db[_0x31956e[_0x9881('0x1e')]],'as':_0x31956e['as'],'attributes':_0x31956e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9881('0xf')](function(_0x3d7120){logger['info'](_0x9881('0x17'),_0x43f8a2);logger[_0x9881('0x12')](_0x9881('0x17'),_0x43f8a2,JSON[_0x9881('0x21')](_0x3d7120));_0x3ae21d(_0x3d7120);})[_0x9881('0x22')](function(_0x383ff0){logger[_0x9881('0x13')](_0x9881('0x17'),_0x383ff0['message'],_0x43f8a2);_0x1243cc(_0xe97d44[_0x9881('0x13')](0x1f4,_0x383ff0[_0x9881('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 9819773..b567e35 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 _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x1e3a48,_0x553825){var _0x27b122=function(_0x582f8a){while(--_0x582f8a){_0x1e3a48['push'](_0x1e3a48['shift']());}};_0x27b122(++_0x553825);}(_0x326f,0xd1));var _0xf326=function(_0xf40797,_0x2f256e){_0xf40797=_0xf40797-0x0;var _0x1a0ce7=_0x326f[_0xf40797];return _0x1a0ce7;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x2b679e,_0x3196b9){var _0x5e348a=function(_0x5ca9aa){while(--_0x5ca9aa){_0x2b679e['push'](_0x2b679e['shift']());}};_0x5e348a(++_0x3196b9);}(_0x1261,0x144));var _0x1126=function(_0x3d5aef,_0x64e2d5){_0x3d5aef=_0x3d5aef-0x0;var _0x33e385=_0x1261[_0x3d5aef];return _0x33e385;};'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 e4ff9f2..1e47c69 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 _0xa46e=['delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','/:id/messages','create','put','update'];(function(_0x583e82,_0xbacde1){var _0x2ad34f=function(_0x71024b){while(--_0x71024b){_0x583e82['push'](_0x583e82['shift']());}};_0x2ad34f(++_0xbacde1);}(_0xa46e,0x8a));var _0xea46=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xa46e[_0x412e27];return _0x53da42;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./voiceMail.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xea46('0xc')]);router[_0xea46('0xd')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xe')]);router[_0xea46('0xf')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa46e=['delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','/:id/messages','create','put','update'];(function(_0x435f80,_0x38acb1){var _0x114f41=function(_0x39bfca){while(--_0x39bfca){_0x435f80['push'](_0x435f80['shift']());}};_0x114f41(++_0x38acb1);}(_0xa46e,0x8a));var _0xea46=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0xa46e[_0x133277];return _0x5b4a22;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./voiceMail.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xea46('0xc')]);router[_0xea46('0xd')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xe')]);router[_0xea46('0xf')]('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d650e5e..f9b0dea 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 _0x5727=['sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox'];(function(_0x5b763d,_0x35ce75){var _0x3f504e=function(_0x37e146){while(--_0x37e146){_0x5b763d['push'](_0x5b763d['shift']());}};_0x3f504e(++_0x35ce75);}(_0x5727,0xb4));var _0x7572=function(_0x27c201,_0xd947bf){_0x27c201=_0x27c201-0x0;var _0x3cabde=_0x5727[_0x27c201];return _0x3cabde;};'use strict';var Sequelize=require(_0x7572('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x7572('0x1')]},'context':{'type':Sequelize[_0x7572('0x1')],'defaultValue':_0x7572('0x2'),'unique':_0x7572('0x3')},'mailbox':{'type':Sequelize[_0x7572('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7572('0x1')]},'fullname':{'type':Sequelize[_0x7572('0x1')]},'email':{'type':Sequelize[_0x7572('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4d30dd){this[_0x7572('0x4')](_0x7572('0x5'),typeof _0x4d30dd==='string'&&_0x4d30dd[_0x7572('0x6')]()?_0x4d30dd['trim']():null);}},'pager':{'type':Sequelize[_0x7572('0x1')]},'tz':{'type':Sequelize[_0x7572('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':_0x7572('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7572('0x7')]('yes','no'),'defaultValue':_0x7572('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7572('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x7572('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7572('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7572('0x7')](_0x7572('0x8'),'no'),'defaultValue':_0x7572('0x8'),'allowNull':![]},'stamp':{'type':_0x7572('0x9')},'emailsubject':{'type':Sequelize[_0x7572('0x1')]},'emailbody':{'type':Sequelize[_0x7572('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7572('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7572('0xb')],'get':function(){return this[_0x7572('0xc')]('fullname')+_0x7572('0xd')+this[_0x7572('0xc')](_0x7572('0xe'));}}}; \ No newline at end of file +var _0x942a=['TIMESTAMP','INTEGER','VIRTUAL','fullname','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','central','ENUM','yes'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x942a,0x16d));var _0xa942=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0x942a[_0x5da0d9];return _0x4b6d2f;};'use strict';var Sequelize=require(_0xa942('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa942('0x1')],'defaultValue':_0xa942('0x2'),'unique':_0xa942('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xa942('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xa942('0x1')]},'email':{'type':Sequelize[_0xa942('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3df477){this[_0xa942('0x4')](_0xa942('0x5'),typeof _0x3df477===_0xa942('0x6')&&_0x3df477['trim']()?_0x3df477['trim']():null);}},'pager':{'type':Sequelize[_0xa942('0x1')]},'tz':{'type':Sequelize[_0xa942('0x1')],'defaultValue':_0xa942('0x7')},'attach':{'type':Sequelize[_0xa942('0x8')]('yes','no'),'defaultValue':_0xa942('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xa942('0x8')](_0xa942('0x9'),'no'),'defaultValue':_0xa942('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xa942('0x1')]},'callback':{'type':Sequelize[_0xa942('0x1')]},'review':{'type':Sequelize[_0xa942('0x8')](_0xa942('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xa942('0x8')](_0xa942('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xa942('0x8')](_0xa942('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xa942('0x8')](_0xa942('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xa942('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xa942('0x8')](_0xa942('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xa942('0x8')]('yes','no'),'defaultValue':_0xa942('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xa942('0x8')](_0xa942('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xa942('0x9'),'no'),'defaultValue':_0xa942('0x9'),'allowNull':![]},'stamp':{'type':_0xa942('0xa')},'emailsubject':{'type':Sequelize[_0xa942('0x1')]},'emailbody':{'type':Sequelize[_0xa942('0x1')]},'maxsecs':{'type':Sequelize[_0xa942('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xa942('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xa942('0xc')],'get':function(){return this['getDataValue'](_0xa942('0xd'))+'\x20-\x20'+this['getDataValue'](_0xa942('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f489995..e90a2ce 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 _0x236c=['fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x3f3eda,_0x3885f0){var _0xd4278e=function(_0xdebb9e){while(--_0xdebb9e){_0x3f3eda['push'](_0x3f3eda['shift']());}};_0xd4278e(++_0x3885f0);}(_0x236c,0x155));var _0xc236=function(_0x330885,_0x5abb99){_0x330885=_0x330885-0x0;var _0x2d1c21=_0x236c[_0x330885];return _0x2d1c21;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){var _0x17cb3b=_0xf921e6['get']({'plain':!![]});var _0x308cd6=_0xc236('0x26');return db[_0xc236('0x27')][_0xc236('0x25')]({'where':{'type':_0x308cd6,'resourceId':_0x17cb3b['id']}})['then'](function(){return _0xf921e6;});})[_0xc236('0x24')](function(){_0x21fab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ead8,_0x4eace8){return function(_0x36e578){if(!_0x36e578){_0x15ead8['sendStatus'](0x194);}return _0x36e578;};}function handleError(_0x54365,_0x5c79d6){_0x5c79d6=_0x5c79d6||0x1f4;return function(_0x423842){logger[_0xc236('0x28')](_0x423842['stack']);if(_0x423842['name']){delete _0x423842[_0xc236('0x29')];}_0x54365[_0xc236('0x18')](_0x5c79d6)[_0xc236('0x2a')](_0x423842);};}exports[_0xc236('0x2b')]=function(_0x5f3891,_0x4e3262){var _0x28ffa5={},_0x53b767={},_0x2c756f={'count':0x0,'rows':[]};var _0x4ddc87=_[_0xc236('0x2c')](db[_0xc236('0x2d')]['rawAttributes'],function(_0x5a5ec3){return{'name':_0x5a5ec3[_0xc236('0x2e')],'type':_0x5a5ec3[_0xc236('0x2f')][_0xc236('0x30')]};});_0x53b767[_0xc236('0x31')]=_[_0xc236('0x2c')](_0x4ddc87,_0xc236('0x29'));_0x53b767[_0xc236('0x32')]=_[_0xc236('0x33')](_0x5f3891[_0xc236('0x32')]);_0x53b767['filters']=_['intersection'](_0x53b767['model'],_0x53b767[_0xc236('0x32')]);_0x28ffa5[_0xc236('0x34')]=_[_0xc236('0x35')](_0x53b767[_0xc236('0x31')],qs[_0xc236('0x36')](_0x5f3891[_0xc236('0x32')][_0xc236('0x36')]));_0x28ffa5['attributes']=_0x28ffa5[_0xc236('0x34')][_0xc236('0x37')]?_0x28ffa5[_0xc236('0x34')]:_0x53b767['model'];if(!_0x5f3891[_0xc236('0x32')][_0xc236('0x38')](_0xc236('0x39'))){_0x28ffa5[_0xc236('0x3a')]=qs['limit'](_0x5f3891[_0xc236('0x32')][_0xc236('0x3a')]);_0x28ffa5[_0xc236('0x1a')]=qs[_0xc236('0x1a')](_0x5f3891[_0xc236('0x32')][_0xc236('0x1a')]);}_0x28ffa5[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x5f3891[_0xc236('0x32')][_0xc236('0x3c')]);_0x28ffa5[_0xc236('0x3d')]=qs[_0xc236('0x3e')](_[_0xc236('0x3f')](_0x5f3891[_0xc236('0x32')],_0x53b767[_0xc236('0x3e')]),_0x4ddc87);if(_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]){_0x28ffa5['where']=_['merge'](_0x28ffa5['where'],{'$or':_['map'](_0x4ddc87,function(_0x369a79){if(_0x369a79['type']!==_0xc236('0x41')){var _0x361526={};_0x361526[_0x369a79[_0xc236('0x29')]]={'$like':'%'+_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]+'%'};return _0x361526;}})});}_0x28ffa5=_[_0xc236('0x42')]({},_0x28ffa5,_0x5f3891[_0xc236('0x43')]);var _0x201ba3={'where':_0x28ffa5[_0xc236('0x3d')]};return db[_0xc236('0x2d')][_0xc236('0x1c')](_0x201ba3)[_0xc236('0x24')](function(_0x3b2f2f){_0x2c756f[_0xc236('0x1c')]=_0x3b2f2f;if(_0x5f3891[_0xc236('0x32')]['includeAll']){_0x28ffa5[_0xc236('0x44')]=[{'all':!![]}];}return db[_0xc236('0x2d')]['findAll'](_0x28ffa5);})[_0xc236('0x24')](function(_0x5b0bc5){_0x2c756f[_0xc236('0x45')]=_0x5b0bc5;return _0x2c756f;})['then'](respondWithFilteredResult(_0x4e3262,_0x28ffa5))[_0xc236('0x46')](handleError(_0x4e3262,null));};exports[_0xc236('0x47')]=function(_0x8d04c9,_0x479e02){var _0x11e3dd={'raw':!![],'where':{'id':_0x8d04c9[_0xc236('0x48')]['id']}},_0x429e08={};_0x429e08['model']=_[_0xc236('0x33')](db[_0xc236('0x2d')][_0xc236('0x49')]);_0x429e08[_0xc236('0x32')]=_[_0xc236('0x33')](_0x8d04c9[_0xc236('0x32')]);_0x429e08['filters']=_[_0xc236('0x35')](_0x429e08['model'],_0x429e08[_0xc236('0x32')]);_0x11e3dd[_0xc236('0x34')]=_[_0xc236('0x35')](_0x429e08[_0xc236('0x31')],qs[_0xc236('0x36')](_0x8d04c9[_0xc236('0x32')][_0xc236('0x36')]));_0x11e3dd['attributes']=_0x11e3dd[_0xc236('0x34')]['length']?_0x11e3dd[_0xc236('0x34')]:_0x429e08[_0xc236('0x31')];if(_0x8d04c9['query'][_0xc236('0x4a')]){_0x11e3dd[_0xc236('0x44')]=[{'all':!![]}];}_0x11e3dd=_[_0xc236('0x42')]({},_0x11e3dd,_0x8d04c9[_0xc236('0x43')]);return db[_0xc236('0x2d')][_0xc236('0x4b')](_0x11e3dd)[_0xc236('0x24')](handleEntityNotFound(_0x479e02,null))['then'](respondWithResult(_0x479e02,null))['catch'](handleError(_0x479e02,null));};exports[_0xc236('0x4c')]=function(_0x2afed2,_0x510f7f){return db[_0xc236('0x2d')][_0xc236('0x4c')](_0x2afed2[_0xc236('0x4d')],{})[_0xc236('0x24')](function(_0x45fa20){var _0x1683f4=_0x2afed2[_0xc236('0x4e')][_0xc236('0x4f')]({'plain':!![]});if(!_0x1683f4)throw new Error(_0xc236('0x50'));if(_0x1683f4['role']===_0xc236('0x4e')){var _0x307663=_0x45fa20[_0xc236('0x4f')]({'plain':!![]});var _0x447a83=_0xc236('0x26');return db[_0xc236('0x51')][_0xc236('0x4b')]({'where':{'name':_0x447a83,'userProfileId':_0x1683f4['userProfileId']},'raw':!![]})[_0xc236('0x24')](function(_0x3788ff){if(_0x3788ff&&_0x3788ff[_0xc236('0x52')]===0x0){return db[_0xc236('0x27')]['create']({'name':_0x307663[_0xc236('0x29')],'resourceId':_0x307663['id'],'type':_0x3788ff[_0xc236('0x29')],'sectionId':_0x3788ff['id']},{})[_0xc236('0x24')](function(){return _0x45fa20;});}else{return _0x45fa20;}})[_0xc236('0x46')](function(_0x9d81c8){logger['error'](_0xc236('0x53'),_0x9d81c8);throw _0x9d81c8;});}return _0x45fa20;})['then'](respondWithResult(_0x510f7f,0xc9))[_0xc236('0x46')](handleError(_0x510f7f,null));};exports[_0xc236('0x23')]=function(_0x3f9e85,_0x15defc){if(_0x3f9e85[_0xc236('0x4d')]['id']){delete _0x3f9e85['body']['id'];}return db['VoiceMail'][_0xc236('0x4b')]({'where':{'id':_0x3f9e85[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x15defc,null))[_0xc236('0x24')](saveUpdates(_0x3f9e85[_0xc236('0x4d')],null))[_0xc236('0x24')](respondWithResult(_0x15defc,null))[_0xc236('0x46')](handleError(_0x15defc,null));};exports[_0xc236('0x25')]=function(_0x24af08,_0x2d27e7){return db['VoiceMail']['find']({'where':{'id':_0x24af08[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x2d27e7,null))[_0xc236('0x24')](removeEntity(_0x2d27e7,null))[_0xc236('0x46')](handleError(_0x2d27e7,null));};exports['getMessages']=function(_0x94fc7,_0x460076,_0x56e476){return db[_0xc236('0x2d')][_0xc236('0x54')]({'where':{'id':_0x94fc7[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x460076,null))['then'](function(_0x1558dd){var _0xec00da;var _0x35955c={},_0x2602f8={};_0x2602f8[_0xc236('0x31')]=_[_0xc236('0x33')](db[_0xc236('0x55')]['rawAttributes']);_0x2602f8[_0xc236('0x32')]=_['keys'](_0x94fc7[_0xc236('0x32')]);_0x2602f8[_0xc236('0x3e')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],_0x2602f8['query']);_0x35955c[_0xc236('0x34')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],qs['fields'](_0x94fc7[_0xc236('0x32')][_0xc236('0x36')]));_0x35955c[_0xc236('0x34')]=_0x35955c[_0xc236('0x34')][_0xc236('0x37')]?_0x35955c[_0xc236('0x34')]:_0x2602f8['model'];if(!_0x94fc7['query'][_0xc236('0x38')](_0xc236('0x39'))){_0x35955c[_0xc236('0x3a')]=qs[_0xc236('0x3a')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3a')]);_0x35955c[_0xc236('0x1a')]=qs['offset'](_0x94fc7['query']['offset']);}_0x35955c[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3c')]);_0x35955c['where']=qs['filters'](_['pick'](_0x94fc7['query'],_0x2602f8[_0xc236('0x3e')]));if(_0x94fc7['query'][_0xc236('0x40')]){_0x35955c['where']=_[_0xc236('0x42')](_0x35955c[_0xc236('0x3d')],{'$or':_[_0xc236('0x2c')](_0x35955c[_0xc236('0x34')],function(_0x26d708){var _0x169e73={};_0x169e73[_0x26d708]={'$like':'%'+_0x94fc7[_0xc236('0x32')]['filter']+'%'};return _0x169e73;})});}_0x35955c[_0xc236('0x3d')]=_['merge'](_0x35955c[_0xc236('0x3d')],{'mailboxuser':_0x1558dd[_0xc236('0x56')]});_0x35955c=_[_0xc236('0x42')]({},_0x35955c,_0x94fc7[_0xc236('0x43')]);return db[_0xc236('0x55')][_0xc236('0x57')](_0x35955c)['then'](respondWithFilteredResult(_0x460076,_0x35955c));})[_0xc236('0x46')](handleError(_0x460076,null));}; \ No newline at end of file +var _0xf4eb=['fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','getMessages','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','eml-format','moment','util','path','sox','to-csv','ejs'];(function(_0x167260,_0x38fb1a){var _0x33aa98=function(_0x3a64d5){while(--_0x3a64d5){_0x167260['push'](_0x167260['shift']());}};_0x33aa98(++_0x38fb1a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x233e2f,_0x3fcfad){_0x233e2f=_0x233e2f-0x0;var _0x49c077=_0xf4eb[_0x233e2f];return _0x49c077;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x21');return db[_0xbf4e('0x22')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1f')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x13')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=_[_0xbf4e('0x28')](db[_0xbf4e('0x29')]['rawAttributes'],function(_0x35c82d){return{'name':_0x35c82d[_0xbf4e('0x2a')],'type':_0x35c82d['type'][_0xbf4e('0x2b')]};});_0x362716[_0xbf4e('0x2c')]=_['map'](_0xc7ca87,_0xbf4e('0x25'));_0x362716['query']=_[_0xbf4e('0x2d')](_0xb8b58e['query']);_0x362716[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],qs[_0xbf4e('0x31')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x1d12e2['attributes']=_0x1d12e2[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x1d12e2[_0xbf4e('0x30')]:_0x362716[_0xbf4e('0x2c')];if(!_0xb8b58e[_0xbf4e('0x32')]['hasOwnProperty']('nolimit')){_0x1d12e2['limit']=qs['limit'](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x18')]);_0x1d12e2[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x32')]['sort']);_0x1d12e2['where']=qs[_0xbf4e('0x2e')](_[_0xbf4e('0x36')](_0xb8b58e[_0xbf4e('0x32')],_0x362716['filters']),_0xc7ca87);if(_0xb8b58e[_0xbf4e('0x32')]['filter']){_0x1d12e2[_0xbf4e('0x37')]=_[_0xbf4e('0x38')](_0x1d12e2[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0xc7ca87,function(_0x5ce339){if(_0x5ce339[_0xbf4e('0x39')]!==_0xbf4e('0x3a')){var _0x3aa308={};_0x3aa308[_0x5ce339[_0xbf4e('0x25')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3b')]+'%'};return _0x3aa308;}})});}_0x1d12e2=_[_0xbf4e('0x38')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3c')]);var _0x29fe9d={'where':_0x1d12e2[_0xbf4e('0x37')]};return db[_0xbf4e('0x29')][_0xbf4e('0x19')](_0x29fe9d)['then'](function(_0x176166){_0x2f3cf8[_0xbf4e('0x19')]=_0x176166;if(_0xb8b58e['query']['includeAll']){_0x1d12e2[_0xbf4e('0x3d')]=[{'all':!![]}];}return db[_0xbf4e('0x29')]['findAll'](_0x1d12e2);})['then'](function(_0x2b1bf4){_0x2f3cf8[_0xbf4e('0x3e')]=_0x2b1bf4;return _0x2f3cf8;})[_0xbf4e('0x1f')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))[_0xbf4e('0x3f')](handleError(_0x498dbd,null));};exports[_0xbf4e('0x40')]=function(_0x3ad0a4,_0x5a03c6){var _0x3ecc15={'raw':!![],'where':{'id':_0x3ad0a4['params']['id']}},_0x7bd91={};_0x7bd91['model']=_['keys'](db['VoiceMail'][_0xbf4e('0x41')]);_0x7bd91['query']=_[_0xbf4e('0x2d')](_0x3ad0a4[_0xbf4e('0x32')]);_0x7bd91['filters']=_['intersection'](_0x7bd91[_0xbf4e('0x2c')],_0x7bd91[_0xbf4e('0x32')]);_0x3ecc15[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x7bd91[_0xbf4e('0x2c')],qs['fields'](_0x3ad0a4[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x3ecc15[_0xbf4e('0x30')]=_0x3ecc15[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x3ecc15[_0xbf4e('0x30')]:_0x7bd91[_0xbf4e('0x2c')];if(_0x3ad0a4[_0xbf4e('0x32')]['includeAll']){_0x3ecc15[_0xbf4e('0x3d')]=[{'all':!![]}];}_0x3ecc15=_[_0xbf4e('0x38')]({},_0x3ecc15,_0x3ad0a4[_0xbf4e('0x3c')]);return db[_0xbf4e('0x29')][_0xbf4e('0x42')](_0x3ecc15)[_0xbf4e('0x1f')](handleEntityNotFound(_0x5a03c6,null))[_0xbf4e('0x1f')](respondWithResult(_0x5a03c6,null))[_0xbf4e('0x3f')](handleError(_0x5a03c6,null));};exports[_0xbf4e('0x43')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x29')][_0xbf4e('0x43')](_0x3447ab[_0xbf4e('0x44')],{})[_0xbf4e('0x1f')](function(_0x2892ce){var _0x10bc23=_0x3447ab['user'][_0xbf4e('0x45')]({'plain':!![]});if(!_0x10bc23)throw new Error(_0xbf4e('0x46'));if(_0x10bc23[_0xbf4e('0x47')]==='user'){var _0x33ab9a=_0x2892ce['get']({'plain':!![]});var _0x4a050e=_0xbf4e('0x21');return db[_0xbf4e('0x48')]['find']({'where':{'name':_0x4a050e,'userProfileId':_0x10bc23[_0xbf4e('0x49')]},'raw':!![]})[_0xbf4e('0x1f')](function(_0x31d779){if(_0x31d779&&_0x31d779[_0xbf4e('0x4a')]===0x0){return db[_0xbf4e('0x22')][_0xbf4e('0x43')]({'name':_0x33ab9a[_0xbf4e('0x25')],'resourceId':_0x33ab9a['id'],'type':_0x31d779[_0xbf4e('0x25')],'sectionId':_0x31d779['id']},{})[_0xbf4e('0x1f')](function(){return _0x2892ce;});}else{return _0x2892ce;}})[_0xbf4e('0x3f')](function(_0x271ad2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271ad2);throw _0x271ad2;});}return _0x2892ce;})[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,0xc9))[_0xbf4e('0x3f')](handleError(_0x2fdba9,null));};exports[_0xbf4e('0x4b')]=function(_0x586f5d,_0x339ce6){if(_0x586f5d[_0xbf4e('0x44')]['id']){delete _0x586f5d['body']['id'];}return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x586f5d['params']['id']}})['then'](handleEntityNotFound(_0x339ce6,null))[_0xbf4e('0x1f')](saveUpdates(_0x586f5d[_0xbf4e('0x44')],null))[_0xbf4e('0x1f')](respondWithResult(_0x339ce6,null))[_0xbf4e('0x3f')](handleError(_0x339ce6,null));};exports[_0xbf4e('0x20')]=function(_0x5ec2d9,_0x242a75){return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x5ec2d9['params']['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x242a75,null))['then'](removeEntity(_0x242a75,null))[_0xbf4e('0x3f')](handleError(_0x242a75,null));};exports[_0xbf4e('0x4c')]=function(_0x3e60e7,_0x16592f,_0xfd54c){return db['VoiceMail']['findOne']({'where':{'id':_0x3e60e7['params']['id']}})['then'](handleEntityNotFound(_0x16592f,null))[_0xbf4e('0x1f')](function(_0x453411){var _0x5cfc26;var _0x200096={},_0x23c335={};_0x23c335[_0xbf4e('0x2c')]=_[_0xbf4e('0x2d')](db[_0xbf4e('0x4d')][_0xbf4e('0x41')]);_0x23c335[_0xbf4e('0x32')]=_['keys'](_0x3e60e7[_0xbf4e('0x32')]);_0x23c335[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x23c335['model'],_0x23c335['query']);_0x200096[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x23c335[_0xbf4e('0x2c')],qs['fields'](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x200096[_0xbf4e('0x30')]=_0x200096[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x200096[_0xbf4e('0x30')]:_0x23c335[_0xbf4e('0x2c')];if(!_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x4e')](_0xbf4e('0x4f'))){_0x200096[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x3e60e7['query'][_0xbf4e('0x18')]);_0x200096['offset']=qs[_0xbf4e('0x16')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x200096[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x35')]);_0x200096[_0xbf4e('0x37')]=qs['filters'](_[_0xbf4e('0x36')](_0x3e60e7[_0xbf4e('0x32')],_0x23c335[_0xbf4e('0x2e')]));if(_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x3b')]){_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0x200096[_0xbf4e('0x30')],function(_0x12f19f){var _0x2c606b={};_0x2c606b[_0x12f19f]={'$like':'%'+_0x3e60e7['query'][_0xbf4e('0x3b')]+'%'};return _0x2c606b;})});}_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'mailboxuser':_0x453411[_0xbf4e('0x50')]});_0x200096=_[_0xbf4e('0x38')]({},_0x200096,_0x3e60e7['options']);return db[_0xbf4e('0x4d')]['findAndCountAll'](_0x200096)['then'](respondWithFilteredResult(_0x16592f,_0x200096));})[_0xbf4e('0x3f')](handleError(_0x16592f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 042bcb8..a53c4ad 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 _0xa8be=['mailbox_context','mailbox','context','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','define','VoiceMail'];(function(_0x36a9d4,_0x37f651){var _0x2fe5b4=function(_0x5e2be0){while(--_0x5e2be0){_0x36a9d4['push'](_0x36a9d4['shift']());}};_0x2fe5b4(++_0x37f651);}(_0xa8be,0x1b5));var _0xea8b=function(_0x7a354a,_0x5ad3c2){_0x7a354a=_0x7a354a-0x0;var _0x13e6cb=_0xa8be[_0x7a354a];return _0x13e6cb;};'use strict';var _=require(_0xea8b('0x0'));var util=require(_0xea8b('0x1'));var logger=require('../../config/logger')(_0xea8b('0x2'));var moment=require(_0xea8b('0x3'));var BPromise=require(_0xea8b('0x4'));var rp=require(_0xea8b('0x5'));var fs=require('fs');var path=require(_0xea8b('0x6'));var rimraf=require('rimraf');var config=require(_0xea8b('0x7'));var attributes=require(_0xea8b('0x8'));module['exports']=function(_0x448772,_0x57052a){return _0x448772[_0xea8b('0x9')](_0xea8b('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xea8b('0xb'),'fields':[_0xea8b('0xc'),_0xea8b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc0ad=['rimraf','../../config/environment','./voiceMail.attributes','define','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x70bfbd,_0x40639f){var _0x1a7baa=function(_0x18e33f){while(--_0x18e33f){_0x70bfbd['push'](_0x70bfbd['shift']());}};_0x1a7baa(++_0x40639f);}(_0xc0ad,0x1e8));var _0xdc0a=function(_0x38c22a,_0x52a9cb){_0x38c22a=_0x38c22a-0x0;var _0x54ab7d=_0xc0ad[_0x38c22a];return _0x54ab7d;};'use strict';var _=require(_0xdc0a('0x0'));var util=require(_0xdc0a('0x1'));var logger=require(_0xdc0a('0x2'))(_0xdc0a('0x3'));var moment=require('moment');var BPromise=require(_0xdc0a('0x4'));var rp=require(_0xdc0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc0a('0x6'));var config=require(_0xdc0a('0x7'));var attributes=require(_0xdc0a('0x8'));module['exports']=function(_0x4990a1,_0x2838ae){return _0x4990a1[_0xdc0a('0x9')]('VoiceMail',attributes,{'tableName':_0xdc0a('0xa'),'paranoid':![],'indexes':[{'name':_0xdc0a('0xb'),'fields':[_0xdc0a('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index ed6fc09..9354eac 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 _0x0d06=['client','http','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2ebb38,_0x1ae950){var _0xc4f063=function(_0x2616e0){while(--_0x2616e0){_0x2ebb38['push'](_0x2ebb38['shift']());}};_0xc4f063(++_0x1ae950);}(_0x0d06,0xa8));var _0x60d0=function(_0x49b076,_0x4fb74e){_0x49b076=_0x49b076-0x0;var _0xa3609=_0x0d06[_0x49b076];return _0xa3609;};'use strict';var _=require(_0x60d0('0x0'));var util=require(_0x60d0('0x1'));var moment=require(_0x60d0('0x2'));var BPromise=require(_0x60d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60d0('0x4'))['db'];var utils=require(_0x60d0('0x5'));var logger=require(_0x60d0('0x6'))('rpc');var config=require(_0x60d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x60d0('0x8')][_0x60d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12da81,_0x543eac,_0x1ab0af){return new BPromise(function(_0x1aea2f,_0xc75190){return client['request'](_0x12da81,_0x1ab0af)[_0x60d0('0xa')](function(_0x522a1b){logger['info'](_0x60d0('0xb'),_0x543eac,_0x60d0('0xc'));logger[_0x60d0('0xd')](_0x60d0('0xe'),_0x543eac,'request\x20sent',JSON[_0x60d0('0xf')](_0x522a1b));if(_0x522a1b['error']){if(_0x522a1b['error'][_0x60d0('0x10')]===0x1f4){logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x522a1b['error'][_0x60d0('0x12')]);return _0xc75190(_0x522a1b[_0x60d0('0x11')][_0x60d0('0x12')]);}logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x522a1b[_0x60d0('0x11')][_0x60d0('0x12')]);return _0x1aea2f(_0x522a1b[_0x60d0('0x11')]['message']);}else{logger[_0x60d0('0x13')]('VoiceMail,\x20%s,\x20%s',_0x543eac,_0x60d0('0xc'));_0x1aea2f(_0x522a1b[_0x60d0('0x14')][_0x60d0('0x12')]);}})[_0x60d0('0x15')](function(_0x4fd2e8){logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x4fd2e8);_0xc75190(_0x4fd2e8);});});} \ No newline at end of file +var _0x5f54=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x15c4ed,_0x1c3e6b){var _0x351b0c=function(_0x146094){while(--_0x146094){_0x15c4ed['push'](_0x15c4ed['shift']());}};_0x351b0c(++_0x1c3e6b);}(_0x5f54,0x168));var _0x45f5=function(_0x112e6b,_0x1ad88a){_0x112e6b=_0x112e6b-0x0;var _0x4056aa=_0x5f54[_0x112e6b];return _0x4056aa;};'use strict';var _=require('lodash');var util=require(_0x45f5('0x0'));var moment=require(_0x45f5('0x1'));var BPromise=require(_0x45f5('0x2'));var rs=require(_0x45f5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45f5('0x4'))['db'];var utils=require(_0x45f5('0x5'));var logger=require('../../config/logger')(_0x45f5('0x6'));var config=require('../../config/environment');var jayson=require(_0x45f5('0x7'));var client=jayson[_0x45f5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b79c8,_0x5d4923,_0x5c4f86){return new BPromise(function(_0x43a66e,_0x1cd7e5){return client[_0x45f5('0x9')](_0x5b79c8,_0x5c4f86)['then'](function(_0x53e8d6){logger['info'](_0x45f5('0xa'),_0x5d4923,_0x45f5('0xb'));logger[_0x45f5('0xc')](_0x45f5('0xd'),_0x5d4923,_0x45f5('0xb'),JSON['stringify'](_0x53e8d6));if(_0x53e8d6[_0x45f5('0xe')]){if(_0x53e8d6[_0x45f5('0xe')][_0x45f5('0xf')]===0x1f4){logger[_0x45f5('0xe')](_0x45f5('0xa'),_0x5d4923,_0x53e8d6['error']['message']);return _0x1cd7e5(_0x53e8d6[_0x45f5('0xe')][_0x45f5('0x10')]);}logger['error'](_0x45f5('0xa'),_0x5d4923,_0x53e8d6['error'][_0x45f5('0x10')]);return _0x43a66e(_0x53e8d6[_0x45f5('0xe')][_0x45f5('0x10')]);}else{logger[_0x45f5('0x11')](_0x45f5('0xa'),_0x5d4923,_0x45f5('0xb'));_0x43a66e(_0x53e8d6[_0x45f5('0x12')][_0x45f5('0x10')]);}})[_0x45f5('0x13')](function(_0x5df25b){logger['error'](_0x45f5('0xa'),_0x5d4923,_0x5df25b);_0x1cd7e5(_0x5df25b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 6995548..70663ca 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 _0x5dc0=['index','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x5dc0,0x97));var _0x05dc=function(_0x40f09a,_0x3743b6){_0x40f09a=_0x40f09a-0x0;var _0x2eb96c=_0x5dc0[_0x40f09a];return _0x2eb96c;};'use strict';var multer=require(_0x05dc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x05dc('0x1'));var router=express[_0x05dc('0x2')]();var fs_extra=require(_0x05dc('0x3'));var auth=require(_0x05dc('0x4'));var interaction=require(_0x05dc('0x5'));var config=require(_0x05dc('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x05dc('0x7')]('/',auth[_0x05dc('0x8')](),controller[_0x05dc('0x9')]);router[_0x05dc('0x7')](_0x05dc('0xa'),auth[_0x05dc('0x8')](),controller[_0x05dc('0xb')]);router[_0x05dc('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x05dc('0xc')]);router[_0x05dc('0xd')]('/',auth[_0x05dc('0x8')](),controller[_0x05dc('0xe')]);router[_0x05dc('0xf')](_0x05dc('0xa'),auth['isAuthenticated'](),controller[_0x05dc('0x10')]);router[_0x05dc('0x11')](_0x05dc('0xa'),auth[_0x05dc('0x8')](),controller[_0x05dc('0x12')]);module[_0x05dc('0x13')]=router; \ No newline at end of file +var _0xc5e7=['./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x48dfba,_0x3ad3b5){var _0x2b1e94=function(_0x5d7d29){while(--_0x5d7d29){_0x48dfba['push'](_0x48dfba['shift']());}};_0x2b1e94(++_0x3ad3b5);}(_0xc5e7,0xac));var _0x7c5e=function(_0x422a98,_0x3337f6){_0x422a98=_0x422a98-0x0;var _0x2859b4=_0xc5e7[_0x422a98];return _0x2859b4;};'use strict';var multer=require(_0x7c5e('0x0'));var util=require(_0x7c5e('0x1'));var path=require(_0x7c5e('0x2'));var timeout=require('connect-timeout');var express=require(_0x7c5e('0x3'));var router=express[_0x7c5e('0x4')]();var fs_extra=require(_0x7c5e('0x5'));var auth=require(_0x7c5e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7c5e('0x7'));var controller=require(_0x7c5e('0x8'));router[_0x7c5e('0x9')]('/',auth[_0x7c5e('0xa')](),controller[_0x7c5e('0xb')]);router[_0x7c5e('0x9')](_0x7c5e('0xc'),auth[_0x7c5e('0xa')](),controller[_0x7c5e('0xd')]);router['get'](_0x7c5e('0xe'),auth[_0x7c5e('0xa')](),controller[_0x7c5e('0xf')]);router['post']('/',auth[_0x7c5e('0xa')](),controller[_0x7c5e('0x10')]);router['put'](_0x7c5e('0xc'),auth[_0x7c5e('0xa')](),controller[_0x7c5e('0x11')]);router['delete'](_0x7c5e('0xc'),auth[_0x7c5e('0xa')](),controller[_0x7c5e('0x12')]);module[_0x7c5e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ac288a0..28f2b66 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 _0xa995=['getDataValue','INTEGER','STRING','BLOB','literal','exports','VIRTUAL'];(function(_0x1e0f14,_0xd08932){var _0x13f77e=function(_0x46d187){while(--_0x46d187){_0x1e0f14['push'](_0x1e0f14['shift']());}};_0x13f77e(++_0xd08932);}(_0xa995,0x140));var _0x5a99=function(_0x13353a,_0x9cc572){_0x13353a=_0x13353a-0x0;var _0x100cd4=_0xa995[_0x13353a];return _0x100cd4;};'use strict';var Sequelize=require('sequelize');module[_0x5a99('0x0')]={'name':{'type':Sequelize[_0x5a99('0x1')],'get':function(_0xa6b458){return this[_0x5a99('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x5a99('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x5a99('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5a99('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x5a99('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x6ae3=['VIRTUAL','getDataValue','STRING','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x25f04b,_0x33a755){var _0x2cd5db=function(_0x26bea9){while(--_0x26bea9){_0x25f04b['push'](_0x25f04b['shift']());}};_0x2cd5db(++_0x33a755);}(_0x6ae3,0x19e));var _0x36ae=function(_0x148307,_0x517875){_0x148307=_0x148307-0x0;var _0x92d820=_0x6ae3[_0x148307];return _0x92d820;};'use strict';var Sequelize=require(_0x36ae('0x0'));module[_0x36ae('0x1')]={'name':{'type':Sequelize[_0x36ae('0x2')],'get':function(_0x2347aa){return this[_0x36ae('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x36ae('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x36ae('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x36ae('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x36ae('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x36ae('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x36ae('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x36ae('0x6')](_0x36ae('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index edb54ed..be8e795 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 _0xbffe=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','VoiceMailMessage','rawAttributes','type','model','differenceBy','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbffe,0xe5));var _0xebff=function(_0x371ffd,_0x4571ab){_0x371ffd=_0x371ffd-0x0;var _0x5f1dd3=_0xbffe[_0x371ffd];return _0x5f1dd3;};'use strict';var emlformat=require(_0xebff('0x0'));var rimraf=require(_0xebff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebff('0x2'));var rp=require(_0xebff('0x3'));var moment=require(_0xebff('0x4'));var BPromise=require(_0xebff('0x5'));var Mustache=require(_0xebff('0x6'));var util=require('util');var path=require(_0xebff('0x7'));var sox=require('sox');var csv=require(_0xebff('0x8'));var ejs=require(_0xebff('0x9'));var fs=require('fs');var fs_extra=require(_0xebff('0xa'));var _=require(_0xebff('0xb'));var squel=require(_0xebff('0xc'));var crypto=require('crypto');var jsforce=require(_0xebff('0xd'));var deskjs=require(_0xebff('0xe'));var toCsv=require('to-csv');var querystring=require(_0xebff('0xf'));var Papa=require('papaparse');var Redis=require(_0xebff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xebff('0x11'));var as=require(_0xebff('0x12'));var hardwareService=require(_0xebff('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xebff('0x14'));var config=require(_0xebff('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xebff('0x16'))['db'];function respondWithStatusCode(_0x52a606,_0x225a46){_0x225a46=_0x225a46||0xcc;return function(_0x3490d2){if(_0x3490d2){return _0x52a606[_0xebff('0x17')](_0x225a46);}return _0x52a606['status'](_0x225a46)[_0xebff('0x18')]();};}function respondWithResult(_0x2bc7a7,_0x50d7d3){_0x50d7d3=_0x50d7d3||0xc8;return function(_0x33bf6f){if(_0x33bf6f){return _0x2bc7a7[_0xebff('0x19')](_0x50d7d3)['json'](_0x33bf6f);}};}function respondWithFilteredResult(_0xe31672,_0x4fd78e){return function(_0x4c624b){if(_0x4c624b){var _0x36d575=typeof _0x4fd78e[_0xebff('0x1a')]===_0xebff('0x1b')&&typeof _0x4fd78e[_0xebff('0x1c')]===_0xebff('0x1b');var _0x39c919=_0x4c624b[_0xebff('0x1d')];var _0x5d4871=_0x36d575?0x0:_0x4fd78e[_0xebff('0x1a')];var _0xba8831=_0x36d575?_0x4c624b[_0xebff('0x1d')]:_0x4fd78e['offset']+_0x4fd78e[_0xebff('0x1c')];var _0x558da7;if(_0xba8831>=_0x39c919){_0xba8831=_0x39c919;_0x558da7=0xc8;}else{_0x558da7=0xce;}_0xe31672[_0xebff('0x19')](_0x558da7);return _0xe31672[_0xebff('0x1e')](_0xebff('0x1f'),_0x5d4871+'-'+_0xba8831+'/'+_0x39c919)[_0xebff('0x20')](_0x4c624b);}return null;};}function patchUpdates(_0x51098c){return function(_0x5b4ddd){try{jsonpatch[_0xebff('0x21')](_0x5b4ddd,_0x51098c,!![]);}catch(_0x3524f){return BPromise[_0xebff('0x22')](_0x3524f);}return _0x5b4ddd[_0xebff('0x23')]();};}function saveUpdates(_0xcb9be0,_0x2ee2eb){return function(_0x3a6d1c){if(_0x3a6d1c){return _0x3a6d1c[_0xebff('0x24')](_0xcb9be0)[_0xebff('0x25')](function(_0x2df18a){return _0x2df18a;});}return null;};}function removeEntity(_0x2d08f7,_0x2ae287){return function(_0x56567e){if(_0x56567e){return _0x56567e[_0xebff('0x26')]()['then'](function(){_0x2d08f7[_0xebff('0x19')](0xcc)[_0xebff('0x18')]();});}};}function handleEntityNotFound(_0x4fe095,_0x45ed11){return function(_0x28785a){if(!_0x28785a){_0x4fe095[_0xebff('0x17')](0x194);}return _0x28785a;};}function handleError(_0x21eb8d,_0x1f13ae){_0x1f13ae=_0x1f13ae||0x1f4;return function(_0x588c71){logger['error'](_0x588c71[_0xebff('0x27')]);if(_0x588c71[_0xebff('0x28')]){delete _0x588c71[_0xebff('0x28')];}_0x21eb8d[_0xebff('0x19')](_0x1f13ae)[_0xebff('0x29')](_0x588c71);};}exports['index']=function(_0x4e8c73,_0x11bfeb){var _0x238a23={},_0x31cd6e={},_0x372254={'count':0x0,'rows':[]};var _0x1bfcf0=_[_0xebff('0x2a')](db[_0xebff('0x2b')][_0xebff('0x2c')],function(_0x5d3cfd){return{'name':_0x5d3cfd['fieldName'],'type':_0x5d3cfd[_0xebff('0x2d')]['key']};});_0x31cd6e[_0xebff('0x2e')]=_[_0xebff('0x2f')](_[_0xebff('0x2a')](_0x1bfcf0,_0xebff('0x28')),[_0xebff('0x28')]);_0x31cd6e[_0xebff('0x30')]=_[_0xebff('0x31')](_0x4e8c73['query']);_0x31cd6e[_0xebff('0x32')]=_['intersection'](_0x31cd6e[_0xebff('0x2e')],_0x31cd6e[_0xebff('0x30')]);_0x238a23['attributes']=_['intersection'](_0x31cd6e[_0xebff('0x2e')],qs[_0xebff('0x33')](_0x4e8c73[_0xebff('0x30')]['fields']));_0x238a23[_0xebff('0x34')]=_0x238a23[_0xebff('0x34')][_0xebff('0x35')]?_0x238a23[_0xebff('0x34')]:_0x31cd6e[_0xebff('0x2e')];if(!_0x4e8c73[_0xebff('0x30')][_0xebff('0x36')]('nolimit')){_0x238a23[_0xebff('0x1c')]=qs[_0xebff('0x1c')](_0x4e8c73[_0xebff('0x30')][_0xebff('0x1c')]);_0x238a23[_0xebff('0x1a')]=qs[_0xebff('0x1a')](_0x4e8c73[_0xebff('0x30')][_0xebff('0x1a')]);}_0x238a23['order']=qs[_0xebff('0x37')](_0x4e8c73['query'][_0xebff('0x37')]);_0x238a23[_0xebff('0x38')]=qs[_0xebff('0x32')](_[_0xebff('0x39')](_0x4e8c73[_0xebff('0x30')],_0x31cd6e['filters']),_0x1bfcf0);if(_0x4e8c73['query'][_0xebff('0x3a')]){_0x238a23[_0xebff('0x38')]=_[_0xebff('0x3b')](_0x238a23[_0xebff('0x38')],{'$or':_['map'](_0x1bfcf0,function(_0x2e238b){if(_0x2e238b['type']!==_0xebff('0x3c')){var _0x5e56cc={};_0x5e56cc[_0x2e238b[_0xebff('0x28')]]={'$like':'%'+_0x4e8c73[_0xebff('0x30')][_0xebff('0x3a')]+'%'};return _0x5e56cc;}})});}_0x238a23=_[_0xebff('0x3b')]({},_0x238a23,_0x4e8c73[_0xebff('0x3d')]);var _0x512e63={'where':_0x238a23[_0xebff('0x38')]};return db[_0xebff('0x2b')][_0xebff('0x1d')](_0x512e63)[_0xebff('0x25')](function(_0xe059c4){_0x372254[_0xebff('0x1d')]=_0xe059c4;if(_0x4e8c73[_0xebff('0x30')][_0xebff('0x3e')]){_0x238a23[_0xebff('0x3f')]=[{'all':!![]}];}return db[_0xebff('0x2b')][_0xebff('0x40')](_0x238a23);})[_0xebff('0x25')](function(_0x4cc4e4){_0x372254['rows']=_0x4cc4e4;return _0x372254;})[_0xebff('0x25')](respondWithFilteredResult(_0x11bfeb,_0x238a23))[_0xebff('0x41')](handleError(_0x11bfeb,null));};exports[_0xebff('0x42')]=function(_0x455933,_0xf2e86f){var _0x25b8f2={'raw':!![],'where':{'id':_0x455933[_0xebff('0x43')]['id']}},_0x5bd5c6={};_0x5bd5c6['model']=_['keys'](db[_0xebff('0x2b')][_0xebff('0x2c')]);_0x5bd5c6['query']=_['keys'](_0x455933['query']);_0x5bd5c6[_0xebff('0x32')]=_[_0xebff('0x44')](_0x5bd5c6[_0xebff('0x2e')],_0x5bd5c6[_0xebff('0x30')]);_0x25b8f2[_0xebff('0x34')]=_[_0xebff('0x44')](_0x5bd5c6[_0xebff('0x2e')],qs['fields'](_0x455933[_0xebff('0x30')][_0xebff('0x33')]));_0x25b8f2[_0xebff('0x34')]=_0x25b8f2[_0xebff('0x34')][_0xebff('0x35')]?_0x25b8f2[_0xebff('0x34')]:_0x5bd5c6['model'];if(_0x455933[_0xebff('0x30')][_0xebff('0x3e')]){_0x25b8f2[_0xebff('0x3f')]=[{'all':!![]}];}_0x25b8f2=_[_0xebff('0x3b')]({},_0x25b8f2,_0x455933[_0xebff('0x3d')]);return db['VoiceMailMessage'][_0xebff('0x45')](_0x25b8f2)[_0xebff('0x25')](handleEntityNotFound(_0xf2e86f,null))['then'](respondWithResult(_0xf2e86f,null))[_0xebff('0x41')](handleError(_0xf2e86f,null));};exports['create']=function(_0x3c40ff,_0x7deeff){return db[_0xebff('0x2b')][_0xebff('0x46')](_0x3c40ff['body'],{})['then'](respondWithResult(_0x7deeff,0xc9))[_0xebff('0x41')](handleError(_0x7deeff,null));};exports['update']=function(_0x3a224a,_0x5250d6){if(_0x3a224a['body']['id']){delete _0x3a224a[_0xebff('0x47')]['id'];}return db[_0xebff('0x2b')][_0xebff('0x45')]({'where':{'id':_0x3a224a['params']['id']}})[_0xebff('0x25')](handleEntityNotFound(_0x5250d6,null))['then'](saveUpdates(_0x3a224a[_0xebff('0x47')],null))[_0xebff('0x25')](respondWithResult(_0x5250d6,null))[_0xebff('0x41')](handleError(_0x5250d6,null));};exports[_0xebff('0x26')]=function(_0x3da6a5,_0x17eb82){return db['VoiceMailMessage'][_0xebff('0x45')]({'where':{'id':_0x3da6a5[_0xebff('0x43')]['id']}})[_0xebff('0x25')](handleEntityNotFound(_0x17eb82,null))[_0xebff('0x25')](removeEntity(_0x17eb82,null))[_0xebff('0x41')](handleError(_0x17eb82,null));};exports['download']=function(_0x37e216,_0x294999,_0xe5016f){return db[_0xebff('0x2b')][_0xebff('0x45')]({'where':{'id':_0x37e216['params']['id']},'attributes':['id','recording',_0xebff('0x48')]})[_0xebff('0x25')](handleEntityNotFound(_0x294999,null))[_0xebff('0x25')](function(_0xf9c3e7){if(_0xf9c3e7){if(!_0xf9c3e7[_0xebff('0x49')]){throw new db[(_0xebff('0x4a'))]['ValidationError'](_0xebff('0x4b'));}var _0x4343c1={'Content-Type':'audio/wav','Content-Disposition':_0xebff('0x4c')};if(_0xf9c3e7['msg_id']){_0x4343c1[_0xebff('0x4d')]='attachment;\x20filename=\x22'+_0xf9c3e7[_0xebff('0x48')]+_0xebff('0x4e');}_0x294999[_0xebff('0x1e')](_0x4343c1);return _0x294999[_0xebff('0x29')](new Buffer(_0xf9c3e7[_0xebff('0x49')]));}})[_0xebff('0x41')](handleError(_0x294999,null));}; \ No newline at end of file +var _0xfdd3=['name','send','index','map','VoiceMailMessage','type','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','include','merge','find','catch','body','params','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack'];(function(_0x284d8f,_0x1afc9e){var _0x6acf64=function(_0x1f62fa){while(--_0x1f62fa){_0x284d8f['push'](_0x284d8f['shift']());}};_0x6acf64(++_0x1afc9e);}(_0xfdd3,0x189));var _0x3fdd=function(_0x7ce801,_0x1bb070){_0x7ce801=_0x7ce801-0x0;var _0x57f4ed=_0xfdd3[_0x7ce801];return _0x57f4ed;};'use strict';var emlformat=require(_0x3fdd('0x0'));var rimraf=require(_0x3fdd('0x1'));var zipdir=require(_0x3fdd('0x2'));var jsonpatch=require(_0x3fdd('0x3'));var rp=require(_0x3fdd('0x4'));var moment=require(_0x3fdd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3fdd('0x6'));var util=require('util');var path=require(_0x3fdd('0x7'));var sox=require(_0x3fdd('0x8'));var csv=require('to-csv');var ejs=require(_0x3fdd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fdd('0xa'));var squel=require(_0x3fdd('0xb'));var crypto=require(_0x3fdd('0xc'));var jsforce=require(_0x3fdd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3fdd('0xe'));var querystring=require(_0x3fdd('0xf'));var Papa=require(_0x3fdd('0x10'));var Redis=require(_0x3fdd('0x11'));var authService=require(_0x3fdd('0x12'));var qs=require(_0x3fdd('0x13'));var as=require(_0x3fdd('0x14'));var hardwareService=require(_0x3fdd('0x15'));var logger=require(_0x3fdd('0x16'))(_0x3fdd('0x17'));var utils=require('../../config/utils');var config=require(_0x3fdd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d962f,_0x5ac0c4){_0x5ac0c4=_0x5ac0c4||0xcc;return function(_0x4e8071){if(_0x4e8071){return _0x2d962f[_0x3fdd('0x19')](_0x5ac0c4);}return _0x2d962f['status'](_0x5ac0c4)['end']();};}function respondWithResult(_0x1c30aa,_0x31ec23){_0x31ec23=_0x31ec23||0xc8;return function(_0x229e24){if(_0x229e24){return _0x1c30aa[_0x3fdd('0x1a')](_0x31ec23)[_0x3fdd('0x1b')](_0x229e24);}};}function respondWithFilteredResult(_0x44abbf,_0x54dff8){return function(_0x5c126c){if(_0x5c126c){var _0x3f73a5=typeof _0x54dff8[_0x3fdd('0x1c')]===_0x3fdd('0x1d')&&typeof _0x54dff8[_0x3fdd('0x1e')]===_0x3fdd('0x1d');var _0x519a01=_0x5c126c[_0x3fdd('0x1f')];var _0x194493=_0x3f73a5?0x0:_0x54dff8[_0x3fdd('0x1c')];var _0x3b6cd2=_0x3f73a5?_0x5c126c['count']:_0x54dff8[_0x3fdd('0x1c')]+_0x54dff8[_0x3fdd('0x1e')];var _0x2d7fbe;if(_0x3b6cd2>=_0x519a01){_0x3b6cd2=_0x519a01;_0x2d7fbe=0xc8;}else{_0x2d7fbe=0xce;}_0x44abbf[_0x3fdd('0x1a')](_0x2d7fbe);return _0x44abbf[_0x3fdd('0x20')](_0x3fdd('0x21'),_0x194493+'-'+_0x3b6cd2+'/'+_0x519a01)['json'](_0x5c126c);}return null;};}function patchUpdates(_0x2d15ff){return function(_0x5979d8){try{jsonpatch[_0x3fdd('0x22')](_0x5979d8,_0x2d15ff,!![]);}catch(_0x93af4d){return BPromise[_0x3fdd('0x23')](_0x93af4d);}return _0x5979d8[_0x3fdd('0x24')]();};}function saveUpdates(_0x25a19e,_0x3aa562){return function(_0x185263){if(_0x185263){return _0x185263[_0x3fdd('0x25')](_0x25a19e)[_0x3fdd('0x26')](function(_0x34525b){return _0x34525b;});}return null;};}function removeEntity(_0x49f598,_0x115392){return function(_0x3c03f3){if(_0x3c03f3){return _0x3c03f3['destroy']()[_0x3fdd('0x26')](function(){_0x49f598['status'](0xcc)[_0x3fdd('0x27')]();});}};}function handleEntityNotFound(_0x53b9ea,_0x302d85){return function(_0x2faac1){if(!_0x2faac1){_0x53b9ea['sendStatus'](0x194);}return _0x2faac1;};}function handleError(_0x3b968e,_0x590e2a){_0x590e2a=_0x590e2a||0x1f4;return function(_0x3da11b){logger[_0x3fdd('0x28')](_0x3da11b[_0x3fdd('0x29')]);if(_0x3da11b[_0x3fdd('0x2a')]){delete _0x3da11b['name'];}_0x3b968e[_0x3fdd('0x1a')](_0x590e2a)[_0x3fdd('0x2b')](_0x3da11b);};}exports[_0x3fdd('0x2c')]=function(_0x1e216f,_0x4bde27){var _0x159d47={},_0x4d962d={},_0x26230e={'count':0x0,'rows':[]};var _0x49ba07=_[_0x3fdd('0x2d')](db[_0x3fdd('0x2e')]['rawAttributes'],function(_0x415429){return{'name':_0x415429['fieldName'],'type':_0x415429[_0x3fdd('0x2f')]['key']};});_0x4d962d[_0x3fdd('0x30')]=_[_0x3fdd('0x31')](_[_0x3fdd('0x2d')](_0x49ba07,_0x3fdd('0x2a')),['name']);_0x4d962d[_0x3fdd('0x32')]=_[_0x3fdd('0x33')](_0x1e216f[_0x3fdd('0x32')]);_0x4d962d['filters']=_[_0x3fdd('0x34')](_0x4d962d[_0x3fdd('0x30')],_0x4d962d['query']);_0x159d47[_0x3fdd('0x35')]=_[_0x3fdd('0x34')](_0x4d962d['model'],qs['fields'](_0x1e216f[_0x3fdd('0x32')][_0x3fdd('0x36')]));_0x159d47[_0x3fdd('0x35')]=_0x159d47[_0x3fdd('0x35')][_0x3fdd('0x37')]?_0x159d47['attributes']:_0x4d962d[_0x3fdd('0x30')];if(!_0x1e216f[_0x3fdd('0x32')][_0x3fdd('0x38')](_0x3fdd('0x39'))){_0x159d47[_0x3fdd('0x1e')]=qs[_0x3fdd('0x1e')](_0x1e216f['query']['limit']);_0x159d47[_0x3fdd('0x1c')]=qs[_0x3fdd('0x1c')](_0x1e216f[_0x3fdd('0x32')][_0x3fdd('0x1c')]);}_0x159d47[_0x3fdd('0x3a')]=qs[_0x3fdd('0x3b')](_0x1e216f[_0x3fdd('0x32')][_0x3fdd('0x3b')]);_0x159d47[_0x3fdd('0x3c')]=qs['filters'](_[_0x3fdd('0x3d')](_0x1e216f[_0x3fdd('0x32')],_0x4d962d[_0x3fdd('0x3e')]),_0x49ba07);if(_0x1e216f['query'][_0x3fdd('0x3f')]){_0x159d47['where']=_['merge'](_0x159d47[_0x3fdd('0x3c')],{'$or':_['map'](_0x49ba07,function(_0x5e27c){if(_0x5e27c[_0x3fdd('0x2f')]!==_0x3fdd('0x40')){var _0x1abf3c={};_0x1abf3c[_0x5e27c['name']]={'$like':'%'+_0x1e216f[_0x3fdd('0x32')]['filter']+'%'};return _0x1abf3c;}})});}_0x159d47=_['merge']({},_0x159d47,_0x1e216f[_0x3fdd('0x41')]);var _0x165749={'where':_0x159d47['where']};return db[_0x3fdd('0x2e')][_0x3fdd('0x1f')](_0x165749)[_0x3fdd('0x26')](function(_0x4001e8){_0x26230e[_0x3fdd('0x1f')]=_0x4001e8;if(_0x1e216f['query'][_0x3fdd('0x42')]){_0x159d47['include']=[{'all':!![]}];}return db[_0x3fdd('0x2e')][_0x3fdd('0x43')](_0x159d47);})[_0x3fdd('0x26')](function(_0x1b5ef1){_0x26230e[_0x3fdd('0x44')]=_0x1b5ef1;return _0x26230e;})[_0x3fdd('0x26')](respondWithFilteredResult(_0x4bde27,_0x159d47))['catch'](handleError(_0x4bde27,null));};exports[_0x3fdd('0x45')]=function(_0x6742e2,_0x422648){var _0x5be384={'raw':!![],'where':{'id':_0x6742e2['params']['id']}},_0x194ce1={};_0x194ce1[_0x3fdd('0x30')]=_[_0x3fdd('0x33')](db[_0x3fdd('0x2e')][_0x3fdd('0x46')]);_0x194ce1[_0x3fdd('0x32')]=_[_0x3fdd('0x33')](_0x6742e2[_0x3fdd('0x32')]);_0x194ce1['filters']=_['intersection'](_0x194ce1['model'],_0x194ce1[_0x3fdd('0x32')]);_0x5be384['attributes']=_[_0x3fdd('0x34')](_0x194ce1[_0x3fdd('0x30')],qs[_0x3fdd('0x36')](_0x6742e2[_0x3fdd('0x32')][_0x3fdd('0x36')]));_0x5be384[_0x3fdd('0x35')]=_0x5be384['attributes'][_0x3fdd('0x37')]?_0x5be384['attributes']:_0x194ce1['model'];if(_0x6742e2[_0x3fdd('0x32')]['includeAll']){_0x5be384[_0x3fdd('0x47')]=[{'all':!![]}];}_0x5be384=_[_0x3fdd('0x48')]({},_0x5be384,_0x6742e2[_0x3fdd('0x41')]);return db[_0x3fdd('0x2e')][_0x3fdd('0x49')](_0x5be384)[_0x3fdd('0x26')](handleEntityNotFound(_0x422648,null))['then'](respondWithResult(_0x422648,null))[_0x3fdd('0x4a')](handleError(_0x422648,null));};exports['create']=function(_0x45ce33,_0x14b3fc){return db[_0x3fdd('0x2e')]['create'](_0x45ce33[_0x3fdd('0x4b')],{})[_0x3fdd('0x26')](respondWithResult(_0x14b3fc,0xc9))[_0x3fdd('0x4a')](handleError(_0x14b3fc,null));};exports[_0x3fdd('0x25')]=function(_0x37fe62,_0x52f4e0){if(_0x37fe62['body']['id']){delete _0x37fe62['body']['id'];}return db[_0x3fdd('0x2e')][_0x3fdd('0x49')]({'where':{'id':_0x37fe62[_0x3fdd('0x4c')]['id']}})[_0x3fdd('0x26')](handleEntityNotFound(_0x52f4e0,null))['then'](saveUpdates(_0x37fe62[_0x3fdd('0x4b')],null))['then'](respondWithResult(_0x52f4e0,null))['catch'](handleError(_0x52f4e0,null));};exports[_0x3fdd('0x4d')]=function(_0x220d8c,_0xb5622a){return db[_0x3fdd('0x2e')][_0x3fdd('0x49')]({'where':{'id':_0x220d8c[_0x3fdd('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb5622a,null))[_0x3fdd('0x26')](removeEntity(_0xb5622a,null))['catch'](handleError(_0xb5622a,null));};exports[_0x3fdd('0x4e')]=function(_0x372929,_0x3589e5,_0x1461cf){return db[_0x3fdd('0x2e')]['find']({'where':{'id':_0x372929[_0x3fdd('0x4c')]['id']},'attributes':['id',_0x3fdd('0x4f'),_0x3fdd('0x50')]})[_0x3fdd('0x26')](handleEntityNotFound(_0x3589e5,null))['then'](function(_0x57b7af){if(_0x57b7af){if(!_0x57b7af['recording']){throw new db[(_0x3fdd('0x51'))][(_0x3fdd('0x52'))](_0x3fdd('0x53'));}var _0x3bac52={'Content-Type':_0x3fdd('0x54'),'Content-Disposition':_0x3fdd('0x55')};if(_0x57b7af[_0x3fdd('0x50')]){_0x3bac52['Content-Disposition']='attachment;\x20filename=\x22'+_0x57b7af[_0x3fdd('0x50')]+_0x3fdd('0x56');}_0x3589e5['set'](_0x3bac52);return _0x3589e5[_0x3fdd('0x2b')](new Buffer(_0x57b7af['recording']));}})[_0x3fdd('0x4a')](handleError(_0x3589e5,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 9a3d8d8..d569e60 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 _0x6b2b=['./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','request-promise','../../config/environment'];(function(_0x4d8e1b,_0x5e1d87){var _0x4c0275=function(_0xe8f83a){while(--_0xe8f83a){_0x4d8e1b['push'](_0x4d8e1b['shift']());}};_0x4c0275(++_0x5e1d87);}(_0x6b2b,0xb5));var _0xb6b2=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x6b2b[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xb6b2('0x0'));var util=require(_0xb6b2('0x1'));var logger=require(_0xb6b2('0x2'))('api');var moment=require(_0xb6b2('0x3'));var BPromise=require('bluebird');var rp=require(_0xb6b2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb6b2('0x5'));var attributes=require(_0xb6b2('0x6'));module[_0xb6b2('0x7')]=function(_0x126c2e,_0x9d3116){return _0x126c2e['define'](_0xb6b2('0x8'),attributes,{'tableName':_0xb6b2('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xb6b2('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe373=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','moment'];(function(_0x4f005b,_0x4cc16e){var _0x376c8a=function(_0x7177bb){while(--_0x7177bb){_0x4f005b['push'](_0x4f005b['shift']());}};_0x376c8a(++_0x4cc16e);}(_0xe373,0x183));var _0x3e37=function(_0x2310aa,_0x3b621e){_0x2310aa=_0x2310aa-0x0;var _0x450104=_0xe373[_0x2310aa];return _0x450104;};'use strict';var _=require('lodash');var util=require(_0x3e37('0x0'));var logger=require(_0x3e37('0x1'))('api');var moment=require(_0x3e37('0x2'));var BPromise=require(_0x3e37('0x3'));var rp=require(_0x3e37('0x4'));var fs=require('fs');var path=require(_0x3e37('0x5'));var rimraf=require(_0x3e37('0x6'));var config=require(_0x3e37('0x7'));var attributes=require(_0x3e37('0x8'));module[_0x3e37('0x9')]=function(_0x198822,_0x3fd430){return _0x198822['define'](_0x3e37('0xa'),attributes,{'tableName':_0x3e37('0xb'),'paranoid':![],'indexes':[{'name':_0x3e37('0xc'),'fields':[_0x3e37('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c93871e..131c972 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 _0xa555=['../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0xa555,0x131));var _0x5a55=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0xa555[_0x512c83];return _0x1f7f25;};'use strict';var _=require(_0x5a55('0x0'));var util=require(_0x5a55('0x1'));var moment=require(_0x5a55('0x2'));var BPromise=require(_0x5a55('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a55('0x4'));var db=require(_0x5a55('0x5'))['db'];var utils=require(_0x5a55('0x6'));var logger=require(_0x5a55('0x7'))(_0x5a55('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a55('0x9'));var client=jayson[_0x5a55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d79d,_0x16284b,_0x406726){return new BPromise(function(_0x53c0d0,_0x5a8617){return client[_0x5a55('0xb')](_0x40d79d,_0x406726)[_0x5a55('0xc')](function(_0x49a191){logger[_0x5a55('0xd')](_0x5a55('0xe'),_0x16284b,'request\x20sent');logger[_0x5a55('0xf')](_0x5a55('0x10'),_0x16284b,_0x5a55('0x11'),JSON[_0x5a55('0x12')](_0x49a191));if(_0x49a191[_0x5a55('0x13')]){if(_0x49a191[_0x5a55('0x13')][_0x5a55('0x14')]===0x1f4){logger[_0x5a55('0x13')](_0x5a55('0xe'),_0x16284b,_0x49a191[_0x5a55('0x13')][_0x5a55('0x15')]);return _0x5a8617(_0x49a191['error'][_0x5a55('0x15')]);}logger[_0x5a55('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x16284b,_0x49a191[_0x5a55('0x13')][_0x5a55('0x15')]);return _0x53c0d0(_0x49a191['error'][_0x5a55('0x15')]);}else{logger[_0x5a55('0xd')](_0x5a55('0xe'),_0x16284b,_0x5a55('0x11'));_0x53c0d0(_0x49a191[_0x5a55('0x16')]['message']);}})[_0x5a55('0x17')](function(_0x5b34b8){logger[_0x5a55('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x16284b,_0x5b34b8);_0x5a8617(_0x5b34b8);});});} \ No newline at end of file +var _0x4ff7=['jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4eb5ec,_0x3056f1){var _0x2b936e=function(_0x188bd4){while(--_0x188bd4){_0x4eb5ec['push'](_0x4eb5ec['shift']());}};_0x2b936e(++_0x3056f1);}(_0x4ff7,0xf4));var _0x74ff=function(_0x1699e9,_0x1f2652){_0x1699e9=_0x1699e9-0x0;var _0x14b104=_0x4ff7[_0x1699e9];return _0x14b104;};'use strict';var _=require(_0x74ff('0x0'));var util=require(_0x74ff('0x1'));var moment=require(_0x74ff('0x2'));var BPromise=require(_0x74ff('0x3'));var rs=require(_0x74ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74ff('0x5'))['db'];var utils=require(_0x74ff('0x6'));var logger=require(_0x74ff('0x7'))('rpc');var config=require(_0x74ff('0x8'));var jayson=require(_0x74ff('0x9'));var client=jayson[_0x74ff('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52a6e3,_0x4bbf39,_0x1d2557){return new BPromise(function(_0x5196bb,_0x2391f0){return client['request'](_0x52a6e3,_0x1d2557)[_0x74ff('0xb')](function(_0x1bb042){logger[_0x74ff('0xc')](_0x74ff('0xd'),_0x4bbf39,_0x74ff('0xe'));logger[_0x74ff('0xf')](_0x74ff('0x10'),_0x4bbf39,_0x74ff('0xe'),JSON[_0x74ff('0x11')](_0x1bb042));if(_0x1bb042[_0x74ff('0x12')]){if(_0x1bb042['error'][_0x74ff('0x13')]===0x1f4){logger['error'](_0x74ff('0xd'),_0x4bbf39,_0x1bb042[_0x74ff('0x12')]['message']);return _0x2391f0(_0x1bb042[_0x74ff('0x12')][_0x74ff('0x14')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4bbf39,_0x1bb042[_0x74ff('0x12')][_0x74ff('0x14')]);return _0x5196bb(_0x1bb042[_0x74ff('0x12')]['message']);}else{logger[_0x74ff('0xc')](_0x74ff('0xd'),_0x4bbf39,_0x74ff('0xe'));_0x5196bb(_0x1bb042[_0x74ff('0x15')][_0x74ff('0x14')]);}})[_0x74ff('0x16')](function(_0x43ce15){logger[_0x74ff('0x12')](_0x74ff('0xd'),_0x4bbf39,_0x43ce15);_0x2391f0(_0x43ce15);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c1cc0ed..3c3f0b8 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 _0xd370=['delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./voiceMusicOnHold.controller','index','/:id','isAuthenticated','show','get','/:id/sounds','getSounds','post','create','addSound','update','destroy'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xd370,0x101));var _0x0d37=function(_0x16ee48,_0x4e660d){_0x16ee48=_0x16ee48-0x0;var _0x23f7bf=_0xd370[_0x16ee48];return _0x23f7bf;};'use strict';var multer=require(_0x0d37('0x0'));var util=require(_0x0d37('0x1'));var path=require(_0x0d37('0x2'));var timeout=require(_0x0d37('0x3'));var express=require(_0x0d37('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0d37('0x5'));var config=require('../../config/environment');var controller=require(_0x0d37('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d37('0x7')]);router['get'](_0x0d37('0x8'),auth[_0x0d37('0x9')](),controller[_0x0d37('0xa')]);router[_0x0d37('0xb')](_0x0d37('0xc'),auth[_0x0d37('0x9')](),controller[_0x0d37('0xd')]);router[_0x0d37('0xe')]('/',auth[_0x0d37('0x9')](),controller[_0x0d37('0xf')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x0d37('0x10')]);router['put'](_0x0d37('0x8'),auth[_0x0d37('0x9')](),controller[_0x0d37('0x11')]);router['delete']('/:id',auth[_0x0d37('0x9')](),controller[_0x0d37('0x12')]);router[_0x0d37('0x13')](_0x0d37('0x14'),auth['isAuthenticated'](),controller[_0x0d37('0x15')]);module[_0x0d37('0x16')]=router; \ No newline at end of file +var _0x4a86=['addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','getSounds','post'];(function(_0x2abd81,_0x29987e){var _0x4a2074=function(_0x382d96){while(--_0x382d96){_0x2abd81['push'](_0x2abd81['shift']());}};_0x4a2074(++_0x29987e);}(_0x4a86,0x8d));var _0x64a8=function(_0xf117b9,_0x6c9174){_0xf117b9=_0xf117b9-0x0;var _0x30f1ac=_0x4a86[_0xf117b9];return _0x30f1ac;};'use strict';var multer=require(_0x64a8('0x0'));var util=require(_0x64a8('0x1'));var path=require(_0x64a8('0x2'));var timeout=require(_0x64a8('0x3'));var express=require('express');var router=express[_0x64a8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x64a8('0x5'));var config=require(_0x64a8('0x6'));var controller=require(_0x64a8('0x7'));router['get']('/',auth[_0x64a8('0x8')](),controller[_0x64a8('0x9')]);router['get']('/:id',auth[_0x64a8('0x8')](),controller['show']);router[_0x64a8('0xa')]('/:id/sounds',auth[_0x64a8('0x8')](),controller[_0x64a8('0xb')]);router[_0x64a8('0xc')]('/',auth[_0x64a8('0x8')](),controller['create']);router['post']('/:id/sounds',auth[_0x64a8('0x8')](),controller[_0x64a8('0xd')]);router[_0x64a8('0xe')](_0x64a8('0xf'),auth['isAuthenticated'](),controller[_0x64a8('0x10')]);router[_0x64a8('0x11')](_0x64a8('0xf'),auth[_0x64a8('0x8')](),controller[_0x64a8('0x12')]);router[_0x64a8('0x11')](_0x64a8('0x13'),auth[_0x64a8('0x8')](),controller[_0x64a8('0x14')]);module[_0x64a8('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 17998c2..7b51711 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 _0x5b08=['BOOLEAN','sequelize','exports','STRING','ENUM','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP'];(function(_0x418af3,_0x5c3cd4){var _0x25429a=function(_0x115a26){while(--_0x115a26){_0x418af3['push'](_0x418af3['shift']());}};_0x25429a(++_0x5c3cd4);}(_0x5b08,0xbc));var _0x85b0=function(_0x32d330,_0xe907c8){_0x32d330=_0x32d330-0x0;var _0xe81a43=_0x5b08[_0x32d330];return _0xe81a43;};'use strict';var Sequelize=require(_0x85b0('0x0'));module[_0x85b0('0x1')]={'name':{'type':Sequelize[_0x85b0('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x85b0('0x3')]('custom',_0x85b0('0x4'),_0x85b0('0x5'),_0x85b0('0x6'),'quietmp3',_0x85b0('0x7')),'allowNull':!![],'defaultValue':_0x85b0('0x4')},'directory':{'type':Sequelize[_0x85b0('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x85b0('0x2')],'allowNull':!![],'defaultValue':_0x85b0('0x8')},'format':{'type':Sequelize[_0x85b0('0x2')],'allowNull':!![]},'stamp':{'type':_0x85b0('0x9')},'defaultEntry':{'type':Sequelize[_0x85b0('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9565=['name','custom','files','quietmp3nb','mp3','alpha','TIMESTAMP','sequelize','exports','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9565,0x1ab));var _0x5956=function(_0x5d3a77,_0x1a9ff5){_0x5d3a77=_0x5d3a77-0x0;var _0x454467=_0x9565[_0x5d3a77];return _0x454467;};'use strict';var Sequelize=require(_0x5956('0x0'));module[_0x5956('0x1')]={'name':{'type':Sequelize[_0x5956('0x2')],'allowNull':![],'unique':_0x5956('0x3')},'mode':{'type':Sequelize['ENUM'](_0x5956('0x4'),_0x5956('0x5'),'mp3nb',_0x5956('0x6'),'quietmp3',_0x5956('0x7')),'allowNull':!![],'defaultValue':_0x5956('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x5956('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5956('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5956('0x2')],'allowNull':!![],'defaultValue':_0x5956('0x8')},'format':{'type':Sequelize[_0x5956('0x2')],'allowNull':!![]},'stamp':{'type':_0x5956('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 06268a4..b3488d3 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 _0xc1be=['end','json','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','stack','name','send','map','model','query','keys','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','type','options','VoiceMusicOnHold','include','findAll','rows','catch','show','params','intersection','includeAll','find','body','create','mode','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','Sound','getSounds','filter','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1be,0x1e6));var _0xec1b=function(_0x2ed294,_0x5b3046){_0x2ed294=_0x2ed294-0x0;var _0x1b7697=_0xc1be[_0x2ed294];return _0x1b7697;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec1b('0x0'));var zipdir=require(_0xec1b('0x1'));var jsonpatch=require(_0xec1b('0x2'));var rp=require(_0xec1b('0x3'));var moment=require(_0xec1b('0x4'));var BPromise=require(_0xec1b('0x5'));var Mustache=require(_0xec1b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xec1b('0x7'));var csv=require('to-csv');var ejs=require(_0xec1b('0x8'));var fs=require('fs');var fs_extra=require(_0xec1b('0x9'));var _=require(_0xec1b('0xa'));var squel=require('squel');var crypto=require(_0xec1b('0xb'));var jsforce=require(_0xec1b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xec1b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec1b('0xe'));var authService=require(_0xec1b('0xf'));var qs=require(_0xec1b('0x10'));var as=require(_0xec1b('0x11'));var hardwareService=require(_0xec1b('0x12'));var logger=require(_0xec1b('0x13'))(_0xec1b('0x14'));var utils=require('../../config/utils');var config=require(_0xec1b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4975ee,_0x12ff65){_0x12ff65=_0x12ff65||0xcc;return function(_0x195bb2){if(_0x195bb2){return _0x4975ee[_0xec1b('0x16')](_0x12ff65);}return _0x4975ee[_0xec1b('0x17')](_0x12ff65)[_0xec1b('0x18')]();};}function respondWithResult(_0x3fcea3,_0x188563){_0x188563=_0x188563||0xc8;return function(_0x4e2934){if(_0x4e2934){return _0x3fcea3['status'](_0x188563)[_0xec1b('0x19')](_0x4e2934);}};}function respondWithFilteredResult(_0x4daf37,_0x1b6ef0){return function(_0x192ac0){if(_0x192ac0){var _0x512c5a=typeof _0x1b6ef0['offset']===_0xec1b('0x1a')&&typeof _0x1b6ef0[_0xec1b('0x1b')]===_0xec1b('0x1a');var _0x1d3fbd=_0x192ac0[_0xec1b('0x1c')];var _0x174df1=_0x512c5a?0x0:_0x1b6ef0['offset'];var _0x5c9eff=_0x512c5a?_0x192ac0[_0xec1b('0x1c')]:_0x1b6ef0['offset']+_0x1b6ef0[_0xec1b('0x1b')];var _0x1c9e69;if(_0x5c9eff>=_0x1d3fbd){_0x5c9eff=_0x1d3fbd;_0x1c9e69=0xc8;}else{_0x1c9e69=0xce;}_0x4daf37[_0xec1b('0x17')](_0x1c9e69);return _0x4daf37[_0xec1b('0x1d')](_0xec1b('0x1e'),_0x174df1+'-'+_0x5c9eff+'/'+_0x1d3fbd)[_0xec1b('0x19')](_0x192ac0);}return null;};}function patchUpdates(_0x95e5ae){return function(_0x5c0922){try{jsonpatch['apply'](_0x5c0922,_0x95e5ae,!![]);}catch(_0x2dcaa8){return BPromise[_0xec1b('0x1f')](_0x2dcaa8);}return _0x5c0922['save']();};}function saveUpdates(_0x4059a5,_0x14c2ed){return function(_0x39f2a2){if(_0x39f2a2){return _0x39f2a2[_0xec1b('0x20')](_0x4059a5)[_0xec1b('0x21')](function(_0x3e5868){return _0x3e5868;});}return null;};}function removeEntity(_0x2cc564,_0x398403){return function(_0xe83316){if(_0xe83316){return _0xe83316[_0xec1b('0x22')]()[_0xec1b('0x21')](function(){var _0x80ad6c=_0xe83316[_0xec1b('0x23')]({'plain':!![]});var _0x2ca218='MusicOnHolds';return db['UserProfileResource'][_0xec1b('0x22')]({'where':{'type':_0x2ca218,'resourceId':_0x80ad6c['id']}})[_0xec1b('0x21')](function(){return _0xe83316;});})[_0xec1b('0x21')](function(){_0x2cc564['status'](0xcc)[_0xec1b('0x18')]();});}};}function handleEntityNotFound(_0x5c18b8,_0x19045d){return function(_0xce73af){if(!_0xce73af){_0x5c18b8[_0xec1b('0x16')](0x194);}return _0xce73af;};}function handleError(_0x120243,_0x4770cb){_0x4770cb=_0x4770cb||0x1f4;return function(_0x1300db){logger['error'](_0x1300db[_0xec1b('0x24')]);if(_0x1300db[_0xec1b('0x25')]){delete _0x1300db['name'];}_0x120243['status'](_0x4770cb)[_0xec1b('0x26')](_0x1300db);};}exports['index']=function(_0x5de536,_0x4746c9){var _0x4f0d73={},_0x4ca4a9={},_0x416037={'count':0x0,'rows':[]};var _0x5377aa=_[_0xec1b('0x27')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x2cf33e){return{'name':_0x2cf33e['fieldName'],'type':_0x2cf33e['type']['key']};});_0x4ca4a9[_0xec1b('0x28')]=_[_0xec1b('0x27')](_0x5377aa,_0xec1b('0x25'));_0x4ca4a9[_0xec1b('0x29')]=_[_0xec1b('0x2a')](_0x5de536[_0xec1b('0x29')]);_0x4ca4a9['filters']=_['intersection'](_0x4ca4a9['model'],_0x4ca4a9[_0xec1b('0x29')]);_0x4f0d73[_0xec1b('0x2b')]=_['intersection'](_0x4ca4a9[_0xec1b('0x28')],qs[_0xec1b('0x2c')](_0x5de536[_0xec1b('0x29')][_0xec1b('0x2c')]));_0x4f0d73['attributes']=_0x4f0d73[_0xec1b('0x2b')]['length']?_0x4f0d73[_0xec1b('0x2b')]:_0x4ca4a9[_0xec1b('0x28')];if(!_0x5de536[_0xec1b('0x29')][_0xec1b('0x2d')](_0xec1b('0x2e'))){_0x4f0d73['limit']=qs[_0xec1b('0x1b')](_0x5de536['query'][_0xec1b('0x1b')]);_0x4f0d73[_0xec1b('0x2f')]=qs[_0xec1b('0x2f')](_0x5de536[_0xec1b('0x29')][_0xec1b('0x2f')]);}_0x4f0d73[_0xec1b('0x30')]=qs['sort'](_0x5de536[_0xec1b('0x29')][_0xec1b('0x31')]);delete _0x5de536[_0xec1b('0x29')]['sort'];_0x4f0d73[_0xec1b('0x32')]=qs['filters'](_[_0xec1b('0x33')](_0x5de536['query'],_0x4ca4a9[_0xec1b('0x34')]),_0x5377aa);if(_0x5de536[_0xec1b('0x29')]['filter']){_0x4f0d73['where']=_[_0xec1b('0x35')](_0x4f0d73[_0xec1b('0x32')],{'$or':_[_0xec1b('0x27')](_0x5377aa,function(_0x5e09a0){if(_0x5e09a0[_0xec1b('0x36')]!=='VIRTUAL'){var _0xdeaa23={};_0xdeaa23[_0x5e09a0[_0xec1b('0x25')]]={'$like':'%'+_0x5de536[_0xec1b('0x29')]['filter']+'%'};return _0xdeaa23;}})});}_0x4f0d73=_[_0xec1b('0x35')]({},_0x4f0d73,_0x5de536[_0xec1b('0x37')]);var _0x3b1951={'where':_0x4f0d73[_0xec1b('0x32')]};return db[_0xec1b('0x38')]['count'](_0x3b1951)[_0xec1b('0x21')](function(_0x3638d1){_0x416037[_0xec1b('0x1c')]=_0x3638d1;if(_0x5de536[_0xec1b('0x29')]['includeAll']){_0x4f0d73[_0xec1b('0x39')]=[{'all':!![]}];}return db[_0xec1b('0x38')][_0xec1b('0x3a')](_0x4f0d73);})['then'](function(_0x6b8820){_0x416037[_0xec1b('0x3b')]=_0x6b8820;return _0x416037;})[_0xec1b('0x21')](respondWithFilteredResult(_0x4746c9,_0x4f0d73))[_0xec1b('0x3c')](handleError(_0x4746c9,null));};exports[_0xec1b('0x3d')]=function(_0x335e56,_0x5b399f){var _0x45e09c={'raw':![],'where':{'id':_0x335e56[_0xec1b('0x3e')]['id']}},_0x84f2b0={};_0x84f2b0[_0xec1b('0x28')]=_[_0xec1b('0x2a')](db[_0xec1b('0x38')]['rawAttributes']);_0x84f2b0['query']=_[_0xec1b('0x2a')](_0x335e56[_0xec1b('0x29')]);_0x84f2b0[_0xec1b('0x34')]=_[_0xec1b('0x3f')](_0x84f2b0[_0xec1b('0x28')],_0x84f2b0[_0xec1b('0x29')]);_0x45e09c[_0xec1b('0x2b')]=_['intersection'](_0x84f2b0[_0xec1b('0x28')],qs[_0xec1b('0x2c')](_0x335e56[_0xec1b('0x29')][_0xec1b('0x2c')]));_0x45e09c[_0xec1b('0x2b')]=_0x45e09c[_0xec1b('0x2b')]['length']?_0x45e09c['attributes']:_0x84f2b0['model'];if(_0x335e56[_0xec1b('0x29')][_0xec1b('0x40')]){_0x45e09c[_0xec1b('0x39')]=[{'all':!![]}];}_0x45e09c=_[_0xec1b('0x35')]({},_0x45e09c,_0x335e56['options']);return db[_0xec1b('0x38')][_0xec1b('0x41')](_0x45e09c)[_0xec1b('0x21')](handleEntityNotFound(_0x5b399f,null))['then'](respondWithResult(_0x5b399f,null))['catch'](handleError(_0x5b399f,null));};exports[_0xec1b('0x20')]=function(_0x63bf0d,_0xc562d9){if(_0x63bf0d['body']['id']){delete _0x63bf0d[_0xec1b('0x42')]['id'];}return db[_0xec1b('0x38')][_0xec1b('0x41')]({'where':{'id':_0x63bf0d[_0xec1b('0x3e')]['id']}})[_0xec1b('0x21')](handleEntityNotFound(_0xc562d9,null))[_0xec1b('0x21')](saveUpdates(_0x63bf0d[_0xec1b('0x42')],null))[_0xec1b('0x21')](respondWithResult(_0xc562d9,null))[_0xec1b('0x3c')](handleError(_0xc562d9,null));};exports[_0xec1b('0x43')]=function(_0x57f825,_0x2a1104,_0xf0fb45){return db['sequelize']['transaction'](function(_0x4393d6){if(_0x57f825[_0xec1b('0x42')][_0xec1b('0x44')]==='files'){_0x57f825[_0xec1b('0x42')][_0xec1b('0x45')]=path[_0xec1b('0x46')](config[_0xec1b('0x47')],_0xec1b('0x48'),_0x57f825[_0xec1b('0x42')][_0xec1b('0x25')]);}return db[_0xec1b('0x38')]['create'](_0x57f825[_0xec1b('0x42')],{'transaction':_0x4393d6})[_0xec1b('0x21')](function(_0x3018e){if(_0x57f825[_0xec1b('0x42')][_0xec1b('0x44')]==='files'){fs[_0xec1b('0x49')](_0x3018e[_0xec1b('0x45')],parseInt(_0xec1b('0x4a'),0x8));}var _0xe27984=_0x57f825[_0xec1b('0x4b')]['get']({'plain':!![]});if(!_0xe27984)throw new Error(_0xec1b('0x4c'));if(_0xe27984['role']===_0xec1b('0x4b')){var _0x25c39e=_0x3018e[_0xec1b('0x23')]({'plain':!![]});return db[_0xec1b('0x4d')][_0xec1b('0x41')]({'where':{'name':_0xec1b('0x4e'),'userProfileId':_0xe27984[_0xec1b('0x4f')]},'raw':!![]})[_0xec1b('0x21')](function(_0x571414){if(_0x571414&&_0x571414[_0xec1b('0x50')]===0x0){return db['UserProfileResource'][_0xec1b('0x43')]({'name':_0x25c39e[_0xec1b('0x25')],'resourceId':_0x25c39e['id'],'type':_0x571414[_0xec1b('0x25')],'sectionId':_0x571414['id']},{})[_0xec1b('0x21')](function(){return _0x3018e;});}else{return _0x3018e;}})[_0xec1b('0x3c')](function(_0x2de68e){logger['error'](_0xec1b('0x51'),_0x2de68e);});}return _0x3018e;});})[_0xec1b('0x21')](respondWithResult(_0x2a1104,0xc9))[_0xec1b('0x3c')](handleError(_0x2a1104,null));};exports[_0xec1b('0x22')]=function(_0x69a6bc,_0x2c1b2b,_0x1ec736){var _0x1960b8;return db[_0xec1b('0x38')][_0xec1b('0x41')]({'where':{'id':_0x69a6bc[_0xec1b('0x3e')]['id']}})['then'](function(_0xaa84b7){if(_0xaa84b7){return db[_0xec1b('0x52')][_0xec1b('0x53')](function(_0x42eae9){return _0xaa84b7[_0xec1b('0x22')]({'transaction':_0x42eae9,'raw':!![]})[_0xec1b('0x21')](function(_0x4f8630){if(_0x4f8630[_0xec1b('0x45')]){fs[_0xec1b('0x54')](_0x4f8630[_0xec1b('0x45')])['forEach'](function(_0x320a40){fs[_0xec1b('0x55')](path[_0xec1b('0x46')](_0x4f8630[_0xec1b('0x45')],_0x320a40));});fs[_0xec1b('0x56')](_0x4f8630[_0xec1b('0x45')]);}return _0x4f8630;});})[_0xec1b('0x3c')](function(_0x2413f9){throw new db[(_0xec1b('0x57'))][(_0xec1b('0x58'))](_0x2413f9[_0xec1b('0x59')]);});}})[_0xec1b('0x21')](handleEntityNotFound(_0x2c1b2b,null))[_0xec1b('0x21')](removeEntity(_0x2c1b2b,null))[_0xec1b('0x3c')](handleError(_0x2c1b2b,null));};exports[_0xec1b('0x5a')]=function(_0x4efcb0,_0x3a53bb,_0x12dfb8){return db[_0xec1b('0x52')][_0xec1b('0x53')](function(_0x482f0f){var _0x3b8a01;return db['VoiceMusicOnHold'][_0xec1b('0x41')]({'where':{'id':_0x4efcb0[_0xec1b('0x3e')]['id']}})['then'](function(_0x14f159){if(_0x14f159){_0x3b8a01=_0x14f159;return _0x14f159[_0xec1b('0x5a')](_0x4efcb0[_0xec1b('0x42')]['id'],{'transaction':_0x482f0f});}})[_0xec1b('0x21')](function(_0x438767){if(_0x438767){return db['Sound'][_0xec1b('0x5b')]({'where':{'id':_0x4efcb0['body']['id']},'attributes':['id',_0xec1b('0x25'),_0xec1b('0x5c'),_0xec1b('0x5d'),_0xec1b('0x5e')],'raw':!![]});}})['then'](function(_0x5c461d){if(_0x5c461d){var _0x95f297=path[_0xec1b('0x46')](config[_0xec1b('0x47')],_0xec1b('0x5f'),util[_0xec1b('0x60')](_0xec1b('0x61'),path[_0xec1b('0x62')](_0x5c461d[_0xec1b('0x5c')],path['extname'](_0x5c461d['save_name'])),_0x5c461d['converted_format']));var _0x76e235=path[_0xec1b('0x46')](config['root'],'server/files/moh',_0x3b8a01[_0xec1b('0x25')],util['format'](_0xec1b('0x61'),_0x5c461d[_0xec1b('0x25')],_0x5c461d[_0xec1b('0x5d')]));fs['symlinkSync'](_0x95f297,_0x76e235);return _0x5c461d;}})['catch'](function(_0x24f24e){throw new db[(_0xec1b('0x57'))][(_0xec1b('0x58'))](_0x24f24e[_0xec1b('0x59')]);});})[_0xec1b('0x21')](handleEntityNotFound(_0x3a53bb,null))[_0xec1b('0x21')](respondWithResult(_0x3a53bb,0xc9))[_0xec1b('0x3c')](handleError(_0x3a53bb,null));};exports['removeSound']=function(_0x3254b4,_0x3a0b0e,_0x4ee1b9){return db[_0xec1b('0x52')][_0xec1b('0x53')](function(_0x2c0022){var _0x1b98b0;return db['VoiceMusicOnHold'][_0xec1b('0x5b')]({'where':{'id':_0x3254b4['params']['id']}})['then'](handleEntityNotFound(_0x3a0b0e,null))[_0xec1b('0x21')](function(_0x35681c){if(_0x35681c){_0x1b98b0=_0x35681c;return _0x35681c['removeSound'](_0x3254b4['params']['id2']);}})[_0xec1b('0x21')](function(_0x11fbe1){if(_0x11fbe1){return db[_0xec1b('0x63')][_0xec1b('0x5b')]({'where':{'id':_0x3254b4['params']['id2']},'attributes':['id',_0xec1b('0x25'),_0xec1b('0x5c'),_0xec1b('0x5d'),_0xec1b('0x5e')],'raw':!![]});}})[_0xec1b('0x21')](function(_0x295808){if(_0x295808){fs[_0xec1b('0x55')](path[_0xec1b('0x46')](_0x1b98b0['directory'],util['format'](_0xec1b('0x61'),_0x295808[_0xec1b('0x25')],_0x295808[_0xec1b('0x5d')])));return _0x295808;}})[_0xec1b('0x3c')](function(_0x3d6aef){throw new db[(_0xec1b('0x57'))][(_0xec1b('0x58'))](_0x3d6aef[_0xec1b('0x59')]);});})['then'](handleEntityNotFound(_0x3a0b0e,null))['then'](respondWithStatusCode(_0x3a0b0e,0xcc))[_0xec1b('0x3c')](handleError(_0x3a0b0e,null));};exports[_0xec1b('0x64')]=function(_0x5ca45d,_0x4b4457,_0x4aa7b8){var _0x5c4714={};var _0xd055dd={};var _0x20fc5f;var _0x119e6b;return db[_0xec1b('0x38')][_0xec1b('0x5b')]({'where':{'id':_0x5ca45d[_0xec1b('0x3e')]['id']}})[_0xec1b('0x21')](handleEntityNotFound(_0x4b4457,null))['then'](function(_0x496982){if(_0x496982){_0x20fc5f=_0x496982;_0xd055dd[_0xec1b('0x28')]=_[_0xec1b('0x2a')](db['Sound']['rawAttributes']);_0xd055dd[_0xec1b('0x29')]=_[_0xec1b('0x2a')](_0x5ca45d[_0xec1b('0x29')]);_0xd055dd[_0xec1b('0x34')]=_['intersection'](_0xd055dd[_0xec1b('0x28')],_0xd055dd[_0xec1b('0x29')]);_0x5c4714[_0xec1b('0x2b')]=_[_0xec1b('0x3f')](_0xd055dd['model'],qs[_0xec1b('0x2c')](_0x5ca45d['query'][_0xec1b('0x2c')]));_0x5c4714['attributes']=_0x5c4714[_0xec1b('0x2b')]['length']?_0x5c4714[_0xec1b('0x2b')]:_0xd055dd[_0xec1b('0x28')];_0x5c4714['order']=qs[_0xec1b('0x31')](_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x31')]);_0x5c4714[_0xec1b('0x32')]=qs[_0xec1b('0x34')](_['pick'](_0x5ca45d[_0xec1b('0x29')],_0xd055dd[_0xec1b('0x34')]));if(_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x65')]){_0x5c4714[_0xec1b('0x32')]=_[_0xec1b('0x35')](_0x5c4714[_0xec1b('0x32')],{'$or':_[_0xec1b('0x27')](_0x5c4714[_0xec1b('0x2b')],function(_0x2f786b){var _0x3acb1e={};_0x3acb1e[_0x2f786b]={'$like':'%'+_0x5ca45d['query'][_0xec1b('0x65')]+'%'};return _0x3acb1e;})});}_0x5c4714=_[_0xec1b('0x35')]({},_0x5c4714,_0x5ca45d['options']);return _0x20fc5f['getSounds'](_0x5c4714);}})['then'](function(_0x1946d7){if(_0x1946d7){_0x119e6b=_0x1946d7['length'];if(!_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x2d')](_0xec1b('0x2e'))){_0x5c4714['limit']=qs[_0xec1b('0x1b')](_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x1b')]);_0x5c4714[_0xec1b('0x2f')]=qs[_0xec1b('0x2f')](_0x5ca45d[_0xec1b('0x29')][_0xec1b('0x2f')]);}return _0x20fc5f[_0xec1b('0x64')](_0x5c4714);}})[_0xec1b('0x21')](function(_0x27f0cc){if(_0x27f0cc){return _0x27f0cc?{'count':_0x119e6b,'rows':_0x27f0cc}:null;}})[_0xec1b('0x21')](respondWithResult(_0x4b4457,null))[_0xec1b('0x3c')](handleError(_0x4b4457,null));}; \ No newline at end of file +var _0x8b62=['server/files/moh','mode','files','mkdirSync','directory','0777','get','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','sequelize','addSound','findOne','save_name','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','message','removeSound','Sound','id2','getSounds','fields','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','MusicOnHolds','name','index','map','VoiceMusicOnHold','rawAttributes','type','key','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','body','find','catch','create','transaction','join','root'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8b62,0x103));var _0x28b6=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x8b62[_0x2ca2d0];return _0x521c23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28b6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28b6('0x1'));var rp=require(_0x28b6('0x2'));var moment=require(_0x28b6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x28b6('0x4'));var util=require(_0x28b6('0x5'));var path=require(_0x28b6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x28b6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28b6('0x8'));var squel=require(_0x28b6('0x9'));var crypto=require(_0x28b6('0xa'));var jsforce=require(_0x28b6('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28b6('0xc'));var Papa=require(_0x28b6('0xd'));var Redis=require(_0x28b6('0xe'));var authService=require(_0x28b6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x28b6('0x10'));var hardwareService=require(_0x28b6('0x11'));var logger=require(_0x28b6('0x12'))(_0x28b6('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x28b6('0x14'));var db=require(_0x28b6('0x15'))['db'];function respondWithStatusCode(_0x33e9c9,_0x3f3bcb){_0x3f3bcb=_0x3f3bcb||0xcc;return function(_0x47c90a){if(_0x47c90a){return _0x33e9c9[_0x28b6('0x16')](_0x3f3bcb);}return _0x33e9c9[_0x28b6('0x17')](_0x3f3bcb)[_0x28b6('0x18')]();};}function respondWithResult(_0x52a5a2,_0x2b2138){_0x2b2138=_0x2b2138||0xc8;return function(_0x105c14){if(_0x105c14){return _0x52a5a2[_0x28b6('0x17')](_0x2b2138)[_0x28b6('0x19')](_0x105c14);}};}function respondWithFilteredResult(_0x256fc9,_0x5501da){return function(_0x1191de){if(_0x1191de){var _0xb4c930=typeof _0x5501da[_0x28b6('0x1a')]==='undefined'&&typeof _0x5501da['limit']===_0x28b6('0x1b');var _0x1f2bd5=_0x1191de[_0x28b6('0x1c')];var _0x4eb08a=_0xb4c930?0x0:_0x5501da[_0x28b6('0x1a')];var _0x1820a2=_0xb4c930?_0x1191de[_0x28b6('0x1c')]:_0x5501da['offset']+_0x5501da[_0x28b6('0x1d')];var _0xf568df;if(_0x1820a2>=_0x1f2bd5){_0x1820a2=_0x1f2bd5;_0xf568df=0xc8;}else{_0xf568df=0xce;}_0x256fc9[_0x28b6('0x17')](_0xf568df);return _0x256fc9[_0x28b6('0x1e')]('Content-Range',_0x4eb08a+'-'+_0x1820a2+'/'+_0x1f2bd5)[_0x28b6('0x19')](_0x1191de);}return null;};}function patchUpdates(_0x4b993f){return function(_0x2d2533){try{jsonpatch[_0x28b6('0x1f')](_0x2d2533,_0x4b993f,!![]);}catch(_0x11de3f){return BPromise[_0x28b6('0x20')](_0x11de3f);}return _0x2d2533[_0x28b6('0x21')]();};}function saveUpdates(_0x12626f,_0x32969a){return function(_0x58ef83){if(_0x58ef83){return _0x58ef83[_0x28b6('0x22')](_0x12626f)['then'](function(_0x24f4fb){return _0x24f4fb;});}return null;};}function removeEntity(_0x3ec315,_0x91ec40){return function(_0x157c02){if(_0x157c02){return _0x157c02[_0x28b6('0x23')]()[_0x28b6('0x24')](function(){var _0x1a69a4=_0x157c02['get']({'plain':!![]});var _0x43c21c=_0x28b6('0x25');return db['UserProfileResource'][_0x28b6('0x23')]({'where':{'type':_0x43c21c,'resourceId':_0x1a69a4['id']}})[_0x28b6('0x24')](function(){return _0x157c02;});})[_0x28b6('0x24')](function(){_0x3ec315[_0x28b6('0x17')](0xcc)[_0x28b6('0x18')]();});}};}function handleEntityNotFound(_0x26da69,_0xe224f0){return function(_0x26696f){if(!_0x26696f){_0x26da69['sendStatus'](0x194);}return _0x26696f;};}function handleError(_0x35bbc9,_0x58ab55){_0x58ab55=_0x58ab55||0x1f4;return function(_0x33cdb8){logger['error'](_0x33cdb8['stack']);if(_0x33cdb8['name']){delete _0x33cdb8[_0x28b6('0x26')];}_0x35bbc9[_0x28b6('0x17')](_0x58ab55)['send'](_0x33cdb8);};}exports[_0x28b6('0x27')]=function(_0x321249,_0x43c591){var _0x44e7a1={},_0x3d290c={},_0x588fe1={'count':0x0,'rows':[]};var _0x149b04=_[_0x28b6('0x28')](db[_0x28b6('0x29')][_0x28b6('0x2a')],function(_0x34e86e){return{'name':_0x34e86e['fieldName'],'type':_0x34e86e[_0x28b6('0x2b')][_0x28b6('0x2c')]};});_0x3d290c[_0x28b6('0x2d')]=_[_0x28b6('0x28')](_0x149b04,_0x28b6('0x26'));_0x3d290c['query']=_[_0x28b6('0x2e')](_0x321249[_0x28b6('0x2f')]);_0x3d290c['filters']=_['intersection'](_0x3d290c['model'],_0x3d290c['query']);_0x44e7a1[_0x28b6('0x30')]=_[_0x28b6('0x31')](_0x3d290c['model'],qs['fields'](_0x321249['query']['fields']));_0x44e7a1[_0x28b6('0x30')]=_0x44e7a1[_0x28b6('0x30')][_0x28b6('0x32')]?_0x44e7a1[_0x28b6('0x30')]:_0x3d290c[_0x28b6('0x2d')];if(!_0x321249['query'][_0x28b6('0x33')](_0x28b6('0x34'))){_0x44e7a1[_0x28b6('0x1d')]=qs[_0x28b6('0x1d')](_0x321249['query'][_0x28b6('0x1d')]);_0x44e7a1[_0x28b6('0x1a')]=qs[_0x28b6('0x1a')](_0x321249['query'][_0x28b6('0x1a')]);}_0x44e7a1[_0x28b6('0x35')]=qs[_0x28b6('0x36')](_0x321249[_0x28b6('0x2f')][_0x28b6('0x36')]);delete _0x321249['query'][_0x28b6('0x36')];_0x44e7a1[_0x28b6('0x37')]=qs[_0x28b6('0x38')](_[_0x28b6('0x39')](_0x321249['query'],_0x3d290c[_0x28b6('0x38')]),_0x149b04);if(_0x321249[_0x28b6('0x2f')]['filter']){_0x44e7a1['where']=_[_0x28b6('0x3a')](_0x44e7a1[_0x28b6('0x37')],{'$or':_[_0x28b6('0x28')](_0x149b04,function(_0xd7be31){if(_0xd7be31['type']!==_0x28b6('0x3b')){var _0x24c75a={};_0x24c75a[_0xd7be31[_0x28b6('0x26')]]={'$like':'%'+_0x321249[_0x28b6('0x2f')][_0x28b6('0x3c')]+'%'};return _0x24c75a;}})});}_0x44e7a1=_[_0x28b6('0x3a')]({},_0x44e7a1,_0x321249[_0x28b6('0x3d')]);var _0x4d1ed8={'where':_0x44e7a1['where']};return db[_0x28b6('0x29')][_0x28b6('0x1c')](_0x4d1ed8)['then'](function(_0x4b4700){_0x588fe1['count']=_0x4b4700;if(_0x321249[_0x28b6('0x2f')][_0x28b6('0x3e')]){_0x44e7a1[_0x28b6('0x3f')]=[{'all':!![]}];}return db[_0x28b6('0x29')][_0x28b6('0x40')](_0x44e7a1);})['then'](function(_0x36f00d){_0x588fe1[_0x28b6('0x41')]=_0x36f00d;return _0x588fe1;})[_0x28b6('0x24')](respondWithFilteredResult(_0x43c591,_0x44e7a1))['catch'](handleError(_0x43c591,null));};exports['show']=function(_0x1cccb8,_0x1033e5){var _0x5adce9={'raw':![],'where':{'id':_0x1cccb8[_0x28b6('0x42')]['id']}},_0x206094={};_0x206094[_0x28b6('0x2d')]=_[_0x28b6('0x2e')](db[_0x28b6('0x29')][_0x28b6('0x2a')]);_0x206094[_0x28b6('0x2f')]=_[_0x28b6('0x2e')](_0x1cccb8[_0x28b6('0x2f')]);_0x206094[_0x28b6('0x38')]=_['intersection'](_0x206094['model'],_0x206094[_0x28b6('0x2f')]);_0x5adce9[_0x28b6('0x30')]=_[_0x28b6('0x31')](_0x206094[_0x28b6('0x2d')],qs['fields'](_0x1cccb8[_0x28b6('0x2f')]['fields']));_0x5adce9['attributes']=_0x5adce9[_0x28b6('0x30')][_0x28b6('0x32')]?_0x5adce9[_0x28b6('0x30')]:_0x206094['model'];if(_0x1cccb8[_0x28b6('0x2f')]['includeAll']){_0x5adce9['include']=[{'all':!![]}];}_0x5adce9=_[_0x28b6('0x3a')]({},_0x5adce9,_0x1cccb8[_0x28b6('0x3d')]);return db[_0x28b6('0x29')]['find'](_0x5adce9)[_0x28b6('0x24')](handleEntityNotFound(_0x1033e5,null))['then'](respondWithResult(_0x1033e5,null))['catch'](handleError(_0x1033e5,null));};exports['update']=function(_0x19fc85,_0x1b0612){if(_0x19fc85[_0x28b6('0x43')]['id']){delete _0x19fc85[_0x28b6('0x43')]['id'];}return db[_0x28b6('0x29')][_0x28b6('0x44')]({'where':{'id':_0x19fc85['params']['id']}})[_0x28b6('0x24')](handleEntityNotFound(_0x1b0612,null))[_0x28b6('0x24')](saveUpdates(_0x19fc85['body'],null))[_0x28b6('0x24')](respondWithResult(_0x1b0612,null))[_0x28b6('0x45')](handleError(_0x1b0612,null));};exports[_0x28b6('0x46')]=function(_0x437ed0,_0x4b3e1c,_0x5c21d3){return db['sequelize'][_0x28b6('0x47')](function(_0x3b3985){if(_0x437ed0[_0x28b6('0x43')]['mode']==='files'){_0x437ed0[_0x28b6('0x43')]['directory']=path[_0x28b6('0x48')](config[_0x28b6('0x49')],_0x28b6('0x4a'),_0x437ed0[_0x28b6('0x43')][_0x28b6('0x26')]);}return db[_0x28b6('0x29')][_0x28b6('0x46')](_0x437ed0[_0x28b6('0x43')],{'transaction':_0x3b3985})[_0x28b6('0x24')](function(_0x1446c6){if(_0x437ed0[_0x28b6('0x43')][_0x28b6('0x4b')]===_0x28b6('0x4c')){fs[_0x28b6('0x4d')](_0x1446c6[_0x28b6('0x4e')],parseInt(_0x28b6('0x4f'),0x8));}var _0x360026=_0x437ed0['user'][_0x28b6('0x50')]({'plain':!![]});if(!_0x360026)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x360026[_0x28b6('0x51')]===_0x28b6('0x52')){var _0x4327c6=_0x1446c6[_0x28b6('0x50')]({'plain':!![]});return db[_0x28b6('0x53')]['find']({'where':{'name':_0x28b6('0x25'),'userProfileId':_0x360026[_0x28b6('0x54')]},'raw':!![]})[_0x28b6('0x24')](function(_0x2e4751){if(_0x2e4751&&_0x2e4751[_0x28b6('0x55')]===0x0){return db[_0x28b6('0x56')]['create']({'name':_0x4327c6[_0x28b6('0x26')],'resourceId':_0x4327c6['id'],'type':_0x2e4751[_0x28b6('0x26')],'sectionId':_0x2e4751['id']},{})[_0x28b6('0x24')](function(){return _0x1446c6;});}else{return _0x1446c6;}})[_0x28b6('0x45')](function(_0xb1b81a){logger[_0x28b6('0x57')](_0x28b6('0x58'),_0xb1b81a);});}return _0x1446c6;});})['then'](respondWithResult(_0x4b3e1c,0xc9))['catch'](handleError(_0x4b3e1c,null));};exports[_0x28b6('0x23')]=function(_0x2a5007,_0x32dc86,_0x3fe303){var _0x18afbc;return db[_0x28b6('0x29')][_0x28b6('0x44')]({'where':{'id':_0x2a5007[_0x28b6('0x42')]['id']}})['then'](function(_0x14bde0){if(_0x14bde0){return db['sequelize'][_0x28b6('0x47')](function(_0x118148){return _0x14bde0[_0x28b6('0x23')]({'transaction':_0x118148,'raw':!![]})[_0x28b6('0x24')](function(_0x3d8468){if(_0x3d8468[_0x28b6('0x4e')]){fs['readdirSync'](_0x3d8468[_0x28b6('0x4e')])[_0x28b6('0x59')](function(_0x3198cc){fs[_0x28b6('0x5a')](path[_0x28b6('0x48')](_0x3d8468['directory'],_0x3198cc));});fs[_0x28b6('0x5b')](_0x3d8468[_0x28b6('0x4e')]);}return _0x3d8468;});})[_0x28b6('0x45')](function(_0x13181b){throw new db[(_0x28b6('0x5c'))][(_0x28b6('0x5d'))](_0x13181b['message']);});}})['then'](handleEntityNotFound(_0x32dc86,null))[_0x28b6('0x24')](removeEntity(_0x32dc86,null))[_0x28b6('0x45')](handleError(_0x32dc86,null));};exports['addSound']=function(_0x4739fe,_0xc12146,_0x151c06){return db[_0x28b6('0x5e')][_0x28b6('0x47')](function(_0x4b80fb){var _0x4eb8a0;return db[_0x28b6('0x29')][_0x28b6('0x44')]({'where':{'id':_0x4739fe[_0x28b6('0x42')]['id']}})['then'](function(_0x5b43c1){if(_0x5b43c1){_0x4eb8a0=_0x5b43c1;return _0x5b43c1[_0x28b6('0x5f')](_0x4739fe[_0x28b6('0x43')]['id'],{'transaction':_0x4b80fb});}})[_0x28b6('0x24')](function(_0x59b21b){if(_0x59b21b){return db['Sound'][_0x28b6('0x60')]({'where':{'id':_0x4739fe['body']['id']},'attributes':['id','name',_0x28b6('0x61'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x180f9a){if(_0x180f9a){var _0x5c7ab6=path['join'](config[_0x28b6('0x49')],_0x28b6('0x62'),util[_0x28b6('0x63')](_0x28b6('0x64'),path[_0x28b6('0x65')](_0x180f9a[_0x28b6('0x61')],path[_0x28b6('0x66')](_0x180f9a[_0x28b6('0x61')])),_0x180f9a[_0x28b6('0x67')]));var _0x3fe0f7=path[_0x28b6('0x48')](config[_0x28b6('0x49')],_0x28b6('0x4a'),_0x4eb8a0[_0x28b6('0x26')],util[_0x28b6('0x63')](_0x28b6('0x64'),_0x180f9a[_0x28b6('0x26')],_0x180f9a[_0x28b6('0x67')]));fs[_0x28b6('0x68')](_0x5c7ab6,_0x3fe0f7);return _0x180f9a;}})['catch'](function(_0x4fcd3e){throw new db[(_0x28b6('0x5c'))][(_0x28b6('0x5d'))](_0x4fcd3e[_0x28b6('0x69')]);});})[_0x28b6('0x24')](handleEntityNotFound(_0xc12146,null))['then'](respondWithResult(_0xc12146,0xc9))[_0x28b6('0x45')](handleError(_0xc12146,null));};exports[_0x28b6('0x6a')]=function(_0x5ab322,_0x554010,_0x2723eb){return db[_0x28b6('0x5e')][_0x28b6('0x47')](function(_0x25469a){var _0x3d71b5;return db[_0x28b6('0x29')]['findOne']({'where':{'id':_0x5ab322['params']['id']}})['then'](handleEntityNotFound(_0x554010,null))[_0x28b6('0x24')](function(_0x84d73b){if(_0x84d73b){_0x3d71b5=_0x84d73b;return _0x84d73b['removeSound'](_0x5ab322['params']['id2']);}})['then'](function(_0x63257a){if(_0x63257a){return db[_0x28b6('0x6b')]['findOne']({'where':{'id':_0x5ab322['params'][_0x28b6('0x6c')]},'attributes':['id',_0x28b6('0x26'),_0x28b6('0x61'),'converted_format','createdAt'],'raw':!![]});}})[_0x28b6('0x24')](function(_0x3b256d){if(_0x3b256d){fs[_0x28b6('0x5a')](path['join'](_0x3d71b5[_0x28b6('0x4e')],util[_0x28b6('0x63')]('%s.%s',_0x3b256d[_0x28b6('0x26')],_0x3b256d[_0x28b6('0x67')])));return _0x3b256d;}})[_0x28b6('0x45')](function(_0x3d91b3){throw new db[(_0x28b6('0x5c'))][(_0x28b6('0x5d'))](_0x3d91b3[_0x28b6('0x69')]);});})[_0x28b6('0x24')](handleEntityNotFound(_0x554010,null))[_0x28b6('0x24')](respondWithStatusCode(_0x554010,0xcc))[_0x28b6('0x45')](handleError(_0x554010,null));};exports[_0x28b6('0x6d')]=function(_0xfd15ca,_0x341c32,_0x1871eb){var _0x2df10a={};var _0x5abbd0={};var _0x146f79;var _0x5d64bb;return db[_0x28b6('0x29')][_0x28b6('0x60')]({'where':{'id':_0xfd15ca[_0x28b6('0x42')]['id']}})['then'](handleEntityNotFound(_0x341c32,null))[_0x28b6('0x24')](function(_0x53f024){if(_0x53f024){_0x146f79=_0x53f024;_0x5abbd0[_0x28b6('0x2d')]=_[_0x28b6('0x2e')](db['Sound']['rawAttributes']);_0x5abbd0['query']=_['keys'](_0xfd15ca['query']);_0x5abbd0[_0x28b6('0x38')]=_[_0x28b6('0x31')](_0x5abbd0['model'],_0x5abbd0[_0x28b6('0x2f')]);_0x2df10a[_0x28b6('0x30')]=_[_0x28b6('0x31')](_0x5abbd0[_0x28b6('0x2d')],qs[_0x28b6('0x6e')](_0xfd15ca[_0x28b6('0x2f')][_0x28b6('0x6e')]));_0x2df10a['attributes']=_0x2df10a[_0x28b6('0x30')][_0x28b6('0x32')]?_0x2df10a['attributes']:_0x5abbd0[_0x28b6('0x2d')];_0x2df10a[_0x28b6('0x35')]=qs[_0x28b6('0x36')](_0xfd15ca[_0x28b6('0x2f')]['sort']);_0x2df10a[_0x28b6('0x37')]=qs[_0x28b6('0x38')](_[_0x28b6('0x39')](_0xfd15ca[_0x28b6('0x2f')],_0x5abbd0[_0x28b6('0x38')]));if(_0xfd15ca['query'][_0x28b6('0x3c')]){_0x2df10a[_0x28b6('0x37')]=_[_0x28b6('0x3a')](_0x2df10a[_0x28b6('0x37')],{'$or':_[_0x28b6('0x28')](_0x2df10a[_0x28b6('0x30')],function(_0x47cfc7){var _0x19641f={};_0x19641f[_0x47cfc7]={'$like':'%'+_0xfd15ca[_0x28b6('0x2f')]['filter']+'%'};return _0x19641f;})});}_0x2df10a=_['merge']({},_0x2df10a,_0xfd15ca[_0x28b6('0x3d')]);return _0x146f79[_0x28b6('0x6d')](_0x2df10a);}})[_0x28b6('0x24')](function(_0x2269dd){if(_0x2269dd){_0x5d64bb=_0x2269dd['length'];if(!_0xfd15ca[_0x28b6('0x2f')][_0x28b6('0x33')]('nolimit')){_0x2df10a['limit']=qs[_0x28b6('0x1d')](_0xfd15ca[_0x28b6('0x2f')][_0x28b6('0x1d')]);_0x2df10a[_0x28b6('0x1a')]=qs[_0x28b6('0x1a')](_0xfd15ca['query']['offset']);}return _0x146f79[_0x28b6('0x6d')](_0x2df10a);}})[_0x28b6('0x24')](function(_0x66c3b2){if(_0x66c3b2){return _0x66c3b2?{'count':_0x5d64bb,'rows':_0x66c3b2}:null;}})[_0x28b6('0x24')](respondWithResult(_0x341c32,null))[_0x28b6('0x45')](handleError(_0x341c32,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 3b5b563..4ffdb2c 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 _0x236f=['../../config/environment','./voiceMusicOnHold.attributes','exports','voice_musiconhold','util','api','moment','bluebird','path'];(function(_0xb2318e,_0x32dc9d){var _0x2f7f40=function(_0x25f5fa){while(--_0x25f5fa){_0xb2318e['push'](_0xb2318e['shift']());}};_0x2f7f40(++_0x32dc9d);}(_0x236f,0xdc));var _0xf236=function(_0x5ae19a,_0x28655b){_0x5ae19a=_0x5ae19a-0x0;var _0x33019a=_0x236f[_0x5ae19a];return _0x33019a;};'use strict';var _=require('lodash');var util=require(_0xf236('0x0'));var logger=require('../../config/logger')(_0xf236('0x1'));var moment=require(_0xf236('0x2'));var BPromise=require(_0xf236('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf236('0x4'));var rimraf=require('rimraf');var config=require(_0xf236('0x5'));var attributes=require(_0xf236('0x6'));module[_0xf236('0x7')]=function(_0x30c8ec,_0x491d01){return _0x30c8ec['define']('VoiceMusicOnHold',attributes,{'tableName':_0xf236('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f74=['define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4eadda,_0x4a92e2){var _0x59ed48=function(_0x5ecb11){while(--_0x5ecb11){_0x4eadda['push'](_0x4eadda['shift']());}};_0x59ed48(++_0x4a92e2);}(_0x2f74,0x7b));var _0x42f7=function(_0x5b4a06,_0x2734e7){_0x5b4a06=_0x5b4a06-0x0;var _0x1cf5e5=_0x2f74[_0x5b4a06];return _0x1cf5e5;};'use strict';var _=require(_0x42f7('0x0'));var util=require('util');var logger=require(_0x42f7('0x1'))(_0x42f7('0x2'));var moment=require(_0x42f7('0x3'));var BPromise=require(_0x42f7('0x4'));var rp=require(_0x42f7('0x5'));var fs=require('fs');var path=require(_0x42f7('0x6'));var rimraf=require(_0x42f7('0x7'));var config=require(_0x42f7('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x540e53,_0x250aa9){return _0x540e53[_0x42f7('0x9')](_0x42f7('0xa'),attributes,{'tableName':_0x42f7('0xb'),'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 ccc013e..af0eac7 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(_0x52f8a4,_0x38ea5f){var _0xad87b=function(_0x1daa43){while(--_0x1daa43){_0x52f8a4['push'](_0x52f8a4['shift']());}};_0xad87b(++_0x38ea5f);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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(_0x46fb41,_0x1d5ce3){var _0x4e4076=function(_0xb5556b){while(--_0xb5556b){_0x46fb41['push'](_0x46fb41['shift']());}};_0x4e4076(++_0x1d5ce3);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'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 8bc14e0..b7e4f79 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 _0xe7ad=['addAgents','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','path','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0x286f42,_0x513295){var _0x5e533b=function(_0x43463a){while(--_0x43463a){_0x286f42['push'](_0x286f42['shift']());}};_0x5e533b(++_0x513295);}(_0xe7ad,0x1b1));var _0xde7a=function(_0x50950f,_0x4d95e3){_0x50950f=_0x50950f-0x0;var _0x4be444=_0xe7ad[_0x50950f];return _0x4be444;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde7a('0x0'));var timeout=require('connect-timeout');var express=require(_0xde7a('0x1'));var router=express[_0xde7a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xde7a('0x3'));var config=require(_0xde7a('0x4'));var controller=require(_0xde7a('0x5'));router[_0xde7a('0x6')]('/',auth[_0xde7a('0x7')](),controller[_0xde7a('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xde7a('0x9')]);router[_0xde7a('0x6')](_0xde7a('0xa'),auth[_0xde7a('0x7')](),controller[_0xde7a('0xb')]);router['get'](_0xde7a('0xc'),auth['isAuthenticated'](),controller[_0xde7a('0xd')]);router[_0xde7a('0x6')](_0xde7a('0xe'),auth[_0xde7a('0x7')](),controller[_0xde7a('0xf')]);router[_0xde7a('0x10')]('/',auth[_0xde7a('0x7')](),controller['create']);router['post'](_0xde7a('0xc'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x11')]);router['post'](_0xde7a('0xe'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x12')]);router[_0xde7a('0x13')](_0xde7a('0xa'),auth[_0xde7a('0x7')](),controller['update']);router[_0xde7a('0x14')](_0xde7a('0xa'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x15')]);router['delete'](_0xde7a('0xc'),auth[_0xde7a('0x7')](),controller[_0xde7a('0x16')]);router[_0xde7a('0x14')]('/:id/teams',auth[_0xde7a('0x7')](),controller[_0xde7a('0x17')]);module[_0xde7a('0x18')]=router; \ No newline at end of file +var _0xe36e=['/describe','describe','/:id','show','/:id/teams','getTeams','create','addAgents','post','delete','/:id/users','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xe36e,0xbb));var _0xee36=function(_0x8325ce,_0x339fc3){_0x8325ce=_0x8325ce-0x0;var _0x3cec6b=_0xe36e[_0x8325ce];return _0x3cec6b;};'use strict';var multer=require(_0xee36('0x0'));var util=require('util');var path=require(_0xee36('0x1'));var timeout=require(_0xee36('0x2'));var express=require(_0xee36('0x3'));var router=express[_0xee36('0x4')]();var fs_extra=require(_0xee36('0x5'));var auth=require(_0xee36('0x6'));var interaction=require(_0xee36('0x7'));var config=require(_0xee36('0x8'));var controller=require(_0xee36('0x9'));router['get']('/',auth[_0xee36('0xa')](),controller[_0xee36('0xb')]);router[_0xee36('0xc')](_0xee36('0xd'),auth[_0xee36('0xa')](),controller[_0xee36('0xe')]);router['get'](_0xee36('0xf'),auth['isAuthenticated'](),controller[_0xee36('0x10')]);router[_0xee36('0xc')]('/:id/users',auth[_0xee36('0xa')](),controller['getAgents']);router[_0xee36('0xc')](_0xee36('0x11'),auth[_0xee36('0xa')](),controller[_0xee36('0x12')]);router['post']('/',auth[_0xee36('0xa')](),controller[_0xee36('0x13')]);router['post']('/:id/users',auth[_0xee36('0xa')](),controller[_0xee36('0x14')]);router[_0xee36('0x15')](_0xee36('0x11'),auth['isAuthenticated'](),controller['addTeams']);router['put'](_0xee36('0xf'),auth[_0xee36('0xa')](),controller['update']);router[_0xee36('0x16')]('/:id',auth[_0xee36('0xa')](),controller['destroy']);router[_0xee36('0x16')](_0xee36('0x17'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xee36('0x16')](_0xee36('0x11'),auth[_0xee36('0xa')](),controller['removeTeams']);module[_0xee36('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a5be284..3674af5 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 _0x86a8=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x86a8,0xc0));var _0x886a=function(_0x919f05,_0x4d5ac4){_0x919f05=_0x919f05-0x0;var _0x24c493=_0x86a8[_0x919f05];return _0x24c493;};'use strict';var Sequelize=require(_0x886a('0x0'));module[_0x886a('0x1')]={'name':{'type':Sequelize[_0x886a('0x2')],'allowNull':![],'unique':_0x886a('0x3')},'prefix':{'type':Sequelize[_0x886a('0x4')],'get':function(_0x220b58){return _0x886a('0x5')+this[_0x886a('0x6')](_0x886a('0x3'))+'-';}},'description':{'type':Sequelize[_0x886a('0x2')]},'callerIdAll':{'type':Sequelize[_0x886a('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x886a('0x7')]}}; \ No newline at end of file +var _0x2c50=['VIRTUAL','getDataValue','STRING','INTEGER','sequelize','name'];(function(_0x41232a,_0x20440d){var _0x1ab731=function(_0x5976f2){while(--_0x5976f2){_0x41232a['push'](_0x41232a['shift']());}};_0x1ab731(++_0x20440d);}(_0x2c50,0x8e));var _0x02c5=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x2c50[_0x540dcb];return _0x49353c;};'use strict';var Sequelize=require(_0x02c5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x02c5('0x1')},'prefix':{'type':Sequelize[_0x02c5('0x2')],'get':function(_0x85c16d){return'system-'+this[_0x02c5('0x3')](_0x02c5('0x1'))+'-';}},'description':{'type':Sequelize[_0x02c5('0x4')]},'callerIdAll':{'type':Sequelize[_0x02c5('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x02c5('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 6ecf707..634afc1 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 _0xda2d=['UserProfileResource','destroy','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','VoicePrefix','includeAll','findAll','catch','show','params','rawAttributes','include','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','update','system-','transaction','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','options','getTeams','findOne','Team','online','voicePause','interface','flatMap','Agents','addTeams','each','UserVoicePrefix','forEach','userVoicePrefix:save','removeTeams','field','tq.TeamId','from','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','TeamId','includes','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','VoicePrefixes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xda2d,0x102));var _0xdda2=function(_0x407450,_0xe2faff){_0x407450=_0x407450-0x0;var _0x23b81d=_0xda2d[_0x407450];return _0x23b81d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdda2('0x19')](config[_0xdda2('0x1a')],{'host':_0xdda2('0x1b'),'port':0x18eb});var socket=require(_0xdda2('0x1c'))(new Redis(config[_0xdda2('0x1a')]));require(_0xdda2('0x1d'))[_0xdda2('0x1e')](socket);function respondWithStatusCode(_0x4df902,_0x79c6d4){_0x79c6d4=_0x79c6d4||0xcc;return function(_0x4b0220){if(_0x4b0220){return _0x4df902[_0xdda2('0x1f')](_0x79c6d4);}return _0x4df902[_0xdda2('0x20')](_0x79c6d4)[_0xdda2('0x21')]();};}function respondWithResult(_0x457764,_0x1922b1){_0x1922b1=_0x1922b1||0xc8;return function(_0x5d8a83){if(_0x5d8a83){return _0x457764['status'](_0x1922b1)[_0xdda2('0x22')](_0x5d8a83);}};}function respondWithFilteredResult(_0x518c6d,_0x1a5192){return function(_0x1a3b35){if(_0x1a3b35){var _0x335fb5=typeof _0x1a5192[_0xdda2('0x23')]===_0xdda2('0x24')&&typeof _0x1a5192[_0xdda2('0x25')]===_0xdda2('0x24');var _0x351151=_0x1a3b35[_0xdda2('0x26')];var _0x337b0b=_0x335fb5?0x0:_0x1a5192[_0xdda2('0x23')];var _0x6fdede=_0x335fb5?_0x1a3b35['count']:_0x1a5192[_0xdda2('0x23')]+_0x1a5192['limit'];var _0xc4567c;if(_0x6fdede>=_0x351151){_0x6fdede=_0x351151;_0xc4567c=0xc8;}else{_0xc4567c=0xce;}_0x518c6d[_0xdda2('0x20')](_0xc4567c);return _0x518c6d[_0xdda2('0x27')]('Content-Range',_0x337b0b+'-'+_0x6fdede+'/'+_0x351151)[_0xdda2('0x22')](_0x1a3b35);}return null;};}function patchUpdates(_0x5a9bb8){return function(_0x425489){try{jsonpatch[_0xdda2('0x28')](_0x425489,_0x5a9bb8,!![]);}catch(_0x4ac3eb){return BPromise[_0xdda2('0x29')](_0x4ac3eb);}return _0x425489[_0xdda2('0x2a')]();};}function saveUpdates(_0x2528d7,_0x13b0f3){return function(_0x45ee9d){if(_0x45ee9d){return _0x45ee9d['update'](_0x2528d7)[_0xdda2('0x2b')](function(_0x4be5ea){return _0x4be5ea;});}return null;};}function removeEntity(_0x2391a5,_0x31d48b){return function(_0x5436d1){if(_0x5436d1){return _0x5436d1['destroy']()[_0xdda2('0x2b')](function(){var _0x4567e7=_0x5436d1[_0xdda2('0x2c')]({'plain':!![]});var _0x5e9e74=_0xdda2('0x2d');return db[_0xdda2('0x2e')][_0xdda2('0x2f')]({'where':{'type':_0x5e9e74,'resourceId':_0x4567e7['id']}})[_0xdda2('0x2b')](function(){return _0x5436d1;});})[_0xdda2('0x2b')](function(){_0x2391a5[_0xdda2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c37d,_0x255bbc){return function(_0x53acb5){if(!_0x53acb5){_0x24c37d[_0xdda2('0x1f')](0x194);}return _0x53acb5;};}function handleError(_0x2cfaca,_0x3b18b8){_0x3b18b8=_0x3b18b8||0x1f4;return function(_0x15e511){logger['error'](_0x15e511[_0xdda2('0x30')]);if(_0x15e511[_0xdda2('0x31')]){delete _0x15e511['name'];}_0x2cfaca[_0xdda2('0x20')](_0x3b18b8)['send'](_0x15e511);};}exports[_0xdda2('0x32')]=function(_0x55809a,_0x53ff76){var _0x510b7b={},_0x239c25={},_0x5bfc17={'count':0x0,'rows':[]};var _0x1b13f4=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4637c1){return{'name':_0x4637c1[_0xdda2('0x33')],'type':_0x4637c1[_0xdda2('0x34')][_0xdda2('0x35')]};});_0x239c25[_0xdda2('0x36')]=_[_0xdda2('0x37')](_0x1b13f4,_0xdda2('0x31'));_0x239c25[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x55809a[_0xdda2('0x38')]);_0x239c25['filters']=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],_0x239c25[_0xdda2('0x38')]);_0x510b7b[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],qs[_0xdda2('0x3c')](_0x55809a['query']['fields']));_0x510b7b[_0xdda2('0x3b')]=_0x510b7b[_0xdda2('0x3b')][_0xdda2('0x3d')]?_0x510b7b['attributes']:_0x239c25['model'];if(!_0x55809a[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x510b7b[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x55809a['query'][_0xdda2('0x25')]);_0x510b7b[_0xdda2('0x23')]=qs['offset'](_0x55809a['query'][_0xdda2('0x23')]);}_0x510b7b[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x55809a[_0xdda2('0x38')][_0xdda2('0x41')]);_0x510b7b['where']=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x55809a[_0xdda2('0x38')],_0x239c25[_0xdda2('0x42')]),_0x1b13f4);if(_0x55809a['query']['filter']){_0x510b7b[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x510b7b[_0xdda2('0x44')],{'$or':_['map'](_0x1b13f4,function(_0x1bb2a7){if(_0x1bb2a7['type']!==_0xdda2('0x46')){var _0x4c68d7={};_0x4c68d7[_0x1bb2a7[_0xdda2('0x31')]]={'$like':'%'+_0x55809a[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4c68d7;}})});}_0x510b7b=_[_0xdda2('0x45')]({},_0x510b7b,_0x55809a['options']);var _0x1c5195={'where':_0x510b7b['where']};return db[_0xdda2('0x48')]['count'](_0x1c5195)[_0xdda2('0x2b')](function(_0x12589b){_0x5bfc17[_0xdda2('0x26')]=_0x12589b;if(_0x55809a[_0xdda2('0x38')][_0xdda2('0x49')]){_0x510b7b['include']=[{'all':!![]}];}return db[_0xdda2('0x48')][_0xdda2('0x4a')](_0x510b7b);})['then'](function(_0x2caced){_0x5bfc17['rows']=_0x2caced;return _0x5bfc17;})[_0xdda2('0x2b')](respondWithFilteredResult(_0x53ff76,_0x510b7b))[_0xdda2('0x4b')](handleError(_0x53ff76,null));};exports[_0xdda2('0x4c')]=function(_0x355b6a,_0x3f1f9b){var _0x6718ea={'raw':![],'where':{'id':_0x355b6a[_0xdda2('0x4d')]['id']}},_0x550351={};_0x550351[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x48')][_0xdda2('0x4e')]);_0x550351[_0xdda2('0x38')]=_['keys'](_0x355b6a['query']);_0x550351['filters']=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],_0x550351['query']);_0x6718ea[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],qs['fields'](_0x355b6a[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x6718ea['attributes']=_0x6718ea['attributes'][_0xdda2('0x3d')]?_0x6718ea['attributes']:_0x550351[_0xdda2('0x36')];if(_0x355b6a['query'][_0xdda2('0x49')]){_0x6718ea[_0xdda2('0x4f')]=[{'all':!![]}];}_0x6718ea=_['merge']({},_0x6718ea,_0x355b6a['options']);return db[_0xdda2('0x48')][_0xdda2('0x50')](_0x6718ea)[_0xdda2('0x2b')](handleEntityNotFound(_0x3f1f9b,null))[_0xdda2('0x2b')](respondWithResult(_0x3f1f9b,null))['catch'](handleError(_0x3f1f9b,null));};exports[_0xdda2('0x2f')]=function(_0x3bba94,_0x3d2cb0){return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x3bba94['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x3d2cb0,null))[_0xdda2('0x2b')](removeEntity(_0x3d2cb0,null))['catch'](handleError(_0x3d2cb0,null));};exports[_0xdda2('0x51')]=function(_0x123c2d,_0x143670){return db[_0xdda2('0x48')][_0xdda2('0x51')]()[_0xdda2('0x2b')](respondWithResult(_0x143670,null))['catch'](handleError(_0x143670,null));};exports[_0xdda2('0x52')]=function(_0x4a9814,_0x361038){var _0x4a70ff;return db[_0xdda2('0x53')]['transaction'](function(_0x3b5bbf){return db[_0xdda2('0x48')][_0xdda2('0x52')](_0x4a9814[_0xdda2('0x54')],{'transaction':_0x3b5bbf})[_0xdda2('0x2b')](function(_0x2b45f3){_0x4a70ff=_0x2b45f3[_0xdda2('0x2c')]({'plain':!![]});return db[_0xdda2('0x55')]['find']({'where':{'id':_0x4a70ff[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x1b24f2){return createVoicePrefixExtensions(_0x4a70ff,_0x1b24f2,_0x3b5bbf);});});})['then'](function(){var _0xf380b0=_0x4a9814[_0xdda2('0x57')]['get']({'plain':!![]});if(!_0xf380b0)throw new Error(_0xdda2('0x58'));if(_0xf380b0['role']===_0xdda2('0x57')){var _0x10fbac=_0x4a70ff;return db[_0xdda2('0x59')][_0xdda2('0x50')]({'where':{'name':_0xdda2('0x2d'),'userProfileId':_0xf380b0['userProfileId']},'raw':!![]})['then'](function(_0x5c2cb2){if(_0x5c2cb2&&_0x5c2cb2[_0xdda2('0x5a')]===0x0){return db[_0xdda2('0x2e')]['create']({'name':_0x10fbac[_0xdda2('0x31')],'resourceId':_0x10fbac['id'],'type':_0x5c2cb2[_0xdda2('0x31')],'sectionId':_0x5c2cb2['id']},{})[_0xdda2('0x2b')](function(){return _0x4a70ff;});}else{return _0x4a70ff;}})['catch'](function(_0x3fd76c){logger[_0xdda2('0x5b')](_0xdda2('0x5c'),_0x3fd76c);throw _0x3fd76c;});}return _0x4a70ff;})['then'](respondWithResult(_0x361038,null))[_0xdda2('0x4b')](handleError(_0x361038,null));};function Extension(_0x4495e5,_0x7eb83f,_0x25c9a9,_0x5d8602){this[_0xdda2('0x5d')]='from-sip';this['exten']=_0x4495e5;this['app']=_0x25c9a9;this[_0xdda2('0x34')]=_0xdda2('0x5e');this[_0xdda2('0x5f')]=_0xdda2('0x60');this[_0xdda2('0x61')]=_0x7eb83f;this[_0xdda2('0x62')]=_0x5d8602;}function createVoicePrefixExtensions(_0x29a739,_0x3ac33a,_0x269ad1){return new BPromise(function(_0x138c2f,_0x26e7de){var _0x5e6dcf=new Extension(formatPrefixName(_0x29a739[_0xdda2('0x63')]),0x1,_0xdda2('0x64'),_0xdda2('0x65'));_0x5e6dcf[_0xdda2('0x66')]=_0x29a739['id'];return db[_0xdda2('0x55')][_0xdda2('0x52')](_0x5e6dcf,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x57fb41){var _0x23518f=_0x57fb41[_0xdda2('0x2c')]({'plain':!![]});var _0x19e650=_[_0xdda2('0x37')](addVoicePrefixExtensions(_0x29a739,_0x3ac33a),function(_0x44f619){_0x44f619['VoiceExtensionId']=_0x23518f['id'];_0x44f619[_0xdda2('0x66')]=_0x29a739['id'];return _0x44f619;});return db[_0xdda2('0x55')][_0xdda2('0x67')](_0x19e650,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x21d0e4){if(!_0x21d0e4){return _0x26e7de('Extensions\x20creation\x20failed');}else{return _0x138c2f(_0x21d0e4);}})[_0xdda2('0x4b')](function(_0x18d251){return _0x26e7de(_0x18d251);});});;});};function addVoicePrefixExtensions(_0x3d49e8,_0x4530b7){var _0x1ac15a=[];var _0x5d34d7=formatPrefixName(_0x3d49e8[_0xdda2('0x63')]);_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x2,_0xdda2('0x69'),'CDR(prefix)='+_0x3d49e8[_0xdda2('0x31')]));if(_0x3d49e8['callerIdAll']){_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x69'),_0xdda2('0x6a')+_0x3d49e8['callerIdAll']));}else{_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x64'),'No\x20callerid\x20available'));}_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x4,'goto',_0x4530b7[_0xdda2('0x5d')]+','+_0xdda2('0x6b')+(0x8+_0x3d49e8[_0xdda2('0x31')][_0xdda2('0x3d')])+'}'+','+0x1));return _0x1ac15a;}function formatPrefixName(_0x10d1de){var _0x4a061a='_';for(var _0x586ca1=0x0;_0x586ca1<_0x10d1de[_0xdda2('0x3d')];_0x586ca1++){if(_0x10d1de[_0xdda2('0x6c')](_0x586ca1)=='-'){_0x4a061a+=_0x10d1de['charAt'](_0x586ca1);}else{_0x4a061a+='['+_0x10d1de['charAt'](_0x586ca1)+']';}}_0x4a061a+='.';return _0x4a061a;}exports[_0xdda2('0x6d')]=function(_0x501336,_0x12a052,_0x1a33ba){var _0x4910a6=_0x501336[_0xdda2('0x54')];_0x4910a6[_0xdda2('0x63')]=_0xdda2('0x6e')+_0x4910a6[_0xdda2('0x31')]+'-';return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x4eebb0){return db[_0xdda2('0x48')][_0xdda2('0x6d')](_0x4910a6,{'where':{'id':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension'][_0xdda2('0x2f')]({'where':{'VoicePrefixId':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x4910a6[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x2f03b9){return createVoicePrefixExtensions(_0x4910a6,_0x2f03b9,_0x4eebb0);});});});})['then'](function(){return db['VoicePrefix'][_0xdda2('0x70')](_0x4910a6['id']);})['then'](respondWithResult(_0x12a052,null))[_0xdda2('0x4b')](handleError(_0x12a052,null));};exports[_0xdda2('0x71')]=function(_0x19d92e,_0x12fd67,_0x597b09){return db[_0xdda2('0x48')]['find']({'where':{'id':_0x19d92e['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x12fd67,null))['then'](function(_0x2de01c){if(_0x2de01c){return _0x2de01c[_0xdda2('0x71')](_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')],_[_0xdda2('0x73')](_0x19d92e[_0xdda2('0x54')],[_0xdda2('0x72'),'id'])||{})[_0xdda2('0x74')](function(_0x37c547){for(var _0x495a28=0x0;_0x495a28<_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x495a28+=0x1){socket[_0xdda2('0x75')]('userVoicePrefix:save',{'UserId':Number(_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0x495a28]),'VoicePrefixId':Number(_0x19d92e[_0xdda2('0x4d')]['id'])});}return _0x37c547;});}})[_0xdda2('0x2b')](respondWithResult(_0x12fd67,null))['catch'](handleError(_0x12fd67,null));};exports['removeAgents']=function(_0xe4110b,_0xdef266,_0x423e1f){return db[_0xdda2('0x48')]['find']({'where':{'id':_0xe4110b[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0xdef266,null))[_0xdda2('0x2b')](function(_0x152ba3){if(_0x152ba3){return _0x152ba3[_0xdda2('0x76')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])[_0xdda2('0x2b')](function(){if(_[_0xdda2('0x77')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])){for(var _0x23a80a=0x0;_0x23a80a<_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x23a80a+=0x1){socket['emit'](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')]['ids'][_0x23a80a]),'VoicePrefixId':Number(_0xe4110b['params']['id'])});}}else{socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')]),'VoicePrefixId':Number(_0xe4110b[_0xdda2('0x4d')]['id'])});}});}})[_0xdda2('0x2b')](respondWithStatusCode(_0xdef266,null))['catch'](handleError(_0xdef266,null));};exports[_0xdda2('0x79')]=function(_0x1f3abe,_0x447bd2,_0x2bb4f3){var _0x563be8={};var _0xbf1248={};var _0x5c3d67;var _0x20ebf7;return db[_0xdda2('0x48')]['findOne']({'where':{'id':_0x1f3abe[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x447bd2,null))[_0xdda2('0x2b')](function(_0x1dfe6d){if(_0x1dfe6d){_0x5c3d67=_0x1dfe6d;_0xbf1248[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x7a')][_0xdda2('0x4e')]);_0xbf1248[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x1f3abe[_0xdda2('0x38')]);_0xbf1248['filters']=_[_0xdda2('0x3a')](_0xbf1248[_0xdda2('0x36')],_0xbf1248[_0xdda2('0x38')]);_0x563be8[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xbf1248['model'],qs[_0xdda2('0x3c')](_0x1f3abe[_0xdda2('0x38')]['fields']));_0x563be8[_0xdda2('0x3b')]=_0x563be8[_0xdda2('0x3b')]['length']?_0x563be8['attributes']:_0xbf1248[_0xdda2('0x36')];_0x563be8[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x41')]);_0x563be8[_0xdda2('0x44')]=qs['filters'](_[_0xdda2('0x43')](_0x1f3abe[_0xdda2('0x38')],_0xbf1248['filters']));if(_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]){_0x563be8['where']=_[_0xdda2('0x45')](_0x563be8[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x563be8['attributes'],function(_0xe6f37b){var _0x4a34ee={};_0x4a34ee[_0xe6f37b]={'$like':'%'+_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4a34ee;})});}_0x563be8=_[_0xdda2('0x45')]({},_0x563be8,_0x1f3abe[_0xdda2('0x7b')]);return _0x5c3d67['getAgents'](_0x563be8);}})['then'](function(_0x2b8c0c){if(_0x2b8c0c){_0x20ebf7=_0x2b8c0c[_0xdda2('0x3d')];if(!_0x1f3abe['query'][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x563be8[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x25')]);_0x563be8[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x23')]);}return _0x5c3d67[_0xdda2('0x79')](_0x563be8);}})[_0xdda2('0x2b')](function(_0x528185){if(_0x528185){return _0x528185?{'count':_0x20ebf7,'rows':_0x528185}:null;}})['then'](respondWithResult(_0x447bd2,null))['catch'](handleError(_0x447bd2,null));};exports[_0xdda2('0x7c')]=function(_0x4edf20,_0x2910b0,_0x323af8){var _0x2f18a0={};var _0xe797aa={};var _0x558ab6;var _0x374fc4;return db[_0xdda2('0x48')][_0xdda2('0x7d')]({'where':{'id':_0x4edf20['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x2910b0,null))[_0xdda2('0x2b')](function(_0x2588f5){if(_0x2588f5){_0x558ab6=_0x2588f5;_0xe797aa['model']=_['keys'](db[_0xdda2('0x7e')][_0xdda2('0x4e')]);_0xe797aa[_0xdda2('0x38')]=_['keys'](_0x4edf20[_0xdda2('0x38')]);_0xe797aa[_0xdda2('0x42')]=_[_0xdda2('0x3a')](_0xe797aa[_0xdda2('0x36')],_0xe797aa[_0xdda2('0x38')]);_0x2f18a0[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xe797aa['model'],qs[_0xdda2('0x3c')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x2f18a0[_0xdda2('0x3b')]=_0x2f18a0['attributes'][_0xdda2('0x3d')]?_0x2f18a0[_0xdda2('0x3b')]:_0xe797aa[_0xdda2('0x36')];_0x2f18a0[_0xdda2('0x40')]=qs['sort'](_0x4edf20['query']['sort']);_0x2f18a0[_0xdda2('0x44')]=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x4edf20[_0xdda2('0x38')],_0xe797aa[_0xdda2('0x42')]));if(_0x4edf20[_0xdda2('0x38')]['filter']){_0x2f18a0[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x2f18a0[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x2f18a0[_0xdda2('0x3b')],function(_0x39ee74){var _0xcbf57f={};_0xcbf57f[_0x39ee74]={'$like':'%'+_0x4edf20[_0xdda2('0x38')]['filter']+'%'};return _0xcbf57f;})});}_0x2f18a0=_[_0xdda2('0x45')]({},_0x2f18a0,_0x4edf20['options']);return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x15066f){if(_0x15066f){_0x374fc4=_0x15066f['length'];if(!_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x2f18a0[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x25')]);_0x2f18a0[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x4edf20['query'][_0xdda2('0x23')]);}return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x42db44){if(_0x42db44){return _0x42db44?{'count':_0x374fc4,'rows':_0x42db44}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x2910b0,null))[_0xdda2('0x4b')](handleError(_0x2910b0,null));};exports['addTeams']=function(_0x1702ae,_0x21ade3,_0x251408){var _0x311e34=_0x1702ae[_0xdda2('0x54')][_0xdda2('0x72')];var _0x4124a5;return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x311e34},'attributes':['id'],'include':[{'model':db[_0xdda2('0x7a')],'as':'Agents','attributes':['id',_0xdda2('0x31'),_0xdda2('0x7f'),_0xdda2('0x80'),_0xdda2('0x81')],'raw':!![]}]})[_0xdda2('0x2b')](function(_0x4c540d){if(_0x4c540d){_0x4124a5=_0x4c540d;var _0x320cf1=_[_0xdda2('0x82')](_0x4c540d,function(_0xdd343d){var _0x56cd13=_0xdd343d[_0xdda2('0x2c')]({'plain':!![]});return _0x56cd13[_0xdda2('0x83')];});return db[_0xdda2('0x48')]['find']({'where':{'id':_0x1702ae[_0xdda2('0x4d')]['id']}})['then'](function(_0x579fc9){return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x3752bf){return _0x579fc9[_0xdda2('0x84')](_0x311e34,{'transaction':_0x3752bf})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x4124a5,function(_0x14baa0){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x14baa0['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},{'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x320cf1,function(_0x16b910){return db[_0xdda2('0x86')]['findOrCreate']({'where':{'UserId':_0x16b910['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){_0x320cf1[_0xdda2('0x87')](function(_0x233494){socket[_0xdda2('0x75')](_0xdda2('0x88'),{'UserId':_0x233494['id'],'VoicePrefixId':_0x579fc9['id']});});});});});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x21ade3,null))[_0xdda2('0x4b')](handleError(_0x21ade3,null));};exports[_0xdda2('0x89')]=function(_0x44e93d,_0x2defb2,_0x53c44d){return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdda2('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2defb2,null))[_0xdda2('0x2b')](function(_0x4f2d5c){var _0x240048=_['map'](_0x4f2d5c,'id');var _0x1da0dd=[];var _0xb93d3b=[];var _0x3d59cb=squel['select']();_0x3d59cb[_0xdda2('0x8a')](_0xdda2('0x8b'))[_0xdda2('0x8c')]('team_has_voice_prefixes','tq')['join'](_0xdda2('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdda2('0x44')](_0xdda2('0x8e'),_0x44e93d[_0xdda2('0x4d')]['id']);for(var _0x182570=0x0;_0x182570<_0x4f2d5c['length'];_0x182570+=0x1){let _0x28a217=_0x4f2d5c[_0x182570];for(var _0x54cd55=0x0;_0x54cd55<_0x28a217['Agents']['length'];_0x54cd55+=0x1){let _0x5235d5=_0x28a217[_0xdda2('0x83')][_0x54cd55];var _0x4a6058=_0x3d59cb[_0xdda2('0x8f')]();_0x4a6058[_0xdda2('0x44')]('ut.UserId\x20=\x20?',_0x5235d5['id']);_0xb93d3b['push'](db[_0xdda2('0x53')][_0xdda2('0x38')](_0x4a6058[_0xdda2('0x90')](),{'type':db[_0xdda2('0x53')]['QueryTypes']['SELECT']})[_0xdda2('0x2b')](function(_0x19c1eb){if(_0x19c1eb[_0xdda2('0x3d')]===0x1){return _0x5235d5['id'];}else{var _0x22e01a=_['every'](_[_0xdda2('0x37')](_0x19c1eb,_0xdda2('0x91')),function(_0x3867b3){return _[_0xdda2('0x92')](_0x240048,_0x3867b3);});if(_0x22e01a){return _0x5235d5['id'];}}}));}}return BPromise[_0xdda2('0x93')](_0xb93d3b)[_0xdda2('0x2b')](function(_0xa798dc){_0x1da0dd=_(_0x1da0dd)[_0xdda2('0x94')](_0xa798dc)[_0xdda2('0x95')]()[_0xdda2('0x96')]();return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x44e93d[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](function(_0x3cb988){return db[_0xdda2('0x53')]['transaction'](function(_0xe54b68){return _0x3cb988[_0xdda2('0x89')](_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')],{'transaction':_0xe54b68})[_0xdda2('0x2b')](function(){if(!_[_0xdda2('0x97')](_0x1da0dd)){return _0x3cb988[_0xdda2('0x76')](_0x1da0dd,{'transaction':_0xe54b68});}})[_0xdda2('0x2b')](function(){_0x1da0dd[_0xdda2('0x87')](function(_0x1c008c){socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':_0x1c008c,'VoicePrefixId':_0x3cb988['id']});});});});});});})[_0xdda2('0x2b')](respondWithStatusCode(_0x2defb2,null))[_0xdda2('0x4b')](handleError(_0x2defb2,null));}; \ No newline at end of file +var _0xa30a=['priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','push','PREFIX-CALLERIDALL=','charAt','body','VoiceExtensionId','findById','addAgents','ids','omit','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','order','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','TeamVoicePrefix','upsert','findOrCreate','userVoicePrefix:save','removeTeams','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','map','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','find','params','describe','create','transaction','VoiceExtension','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension'];(function(_0x3a461a,_0x15d5ff){var _0x4b0476=function(_0x15b9d0){while(--_0x15b9d0){_0x3a461a['push'](_0x3a461a['shift']());}};_0x4b0476(++_0x15d5ff);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];config[_0xaa30('0x19')]=_[_0xaa30('0x1a')](config[_0xaa30('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0x1b'))(new Redis(config[_0xaa30('0x19')]));require(_0xaa30('0x1c'))[_0xaa30('0x1d')](socket);function respondWithStatusCode(_0x41f1d9,_0x31aa0b){_0x31aa0b=_0x31aa0b||0xcc;return function(_0x3240e9){if(_0x3240e9){return _0x41f1d9[_0xaa30('0x1e')](_0x31aa0b);}return _0x41f1d9[_0xaa30('0x1f')](_0x31aa0b)[_0xaa30('0x20')]();};}function respondWithResult(_0x519518,_0x91839d){_0x91839d=_0x91839d||0xc8;return function(_0x591478){if(_0x591478){return _0x519518['status'](_0x91839d)[_0xaa30('0x21')](_0x591478);}};}function respondWithFilteredResult(_0x153939,_0x130606){return function(_0x540e36){if(_0x540e36){var _0x54fa49=typeof _0x130606['offset']===_0xaa30('0x22')&&typeof _0x130606['limit']===_0xaa30('0x22');var _0x332a0a=_0x540e36['count'];var _0x4e29f9=_0x54fa49?0x0:_0x130606['offset'];var _0x3cbf92=_0x54fa49?_0x540e36[_0xaa30('0x23')]:_0x130606[_0xaa30('0x24')]+_0x130606[_0xaa30('0x25')];var _0x43a526;if(_0x3cbf92>=_0x332a0a){_0x3cbf92=_0x332a0a;_0x43a526=0xc8;}else{_0x43a526=0xce;}_0x153939['status'](_0x43a526);return _0x153939[_0xaa30('0x26')](_0xaa30('0x27'),_0x4e29f9+'-'+_0x3cbf92+'/'+_0x332a0a)[_0xaa30('0x21')](_0x540e36);}return null;};}function patchUpdates(_0x2d9e35){return function(_0x1ff442){try{jsonpatch['apply'](_0x1ff442,_0x2d9e35,!![]);}catch(_0x325b42){return BPromise[_0xaa30('0x28')](_0x325b42);}return _0x1ff442[_0xaa30('0x29')]();};}function saveUpdates(_0x326f84,_0x57d1ca){return function(_0x14d7fa){if(_0x14d7fa){return _0x14d7fa[_0xaa30('0x2a')](_0x326f84)[_0xaa30('0x2b')](function(_0x12da2f){return _0x12da2f;});}return null;};}function removeEntity(_0x97b038,_0x2a59ce){return function(_0x55cccb){if(_0x55cccb){return _0x55cccb[_0xaa30('0x2c')]()[_0xaa30('0x2b')](function(){var _0x5d4da8=_0x55cccb[_0xaa30('0x2d')]({'plain':!![]});var _0x5b3efb=_0xaa30('0x2e');return db[_0xaa30('0x2f')][_0xaa30('0x2c')]({'where':{'type':_0x5b3efb,'resourceId':_0x5d4da8['id']}})[_0xaa30('0x2b')](function(){return _0x55cccb;});})[_0xaa30('0x2b')](function(){_0x97b038[_0xaa30('0x1f')](0xcc)[_0xaa30('0x20')]();});}};}function handleEntityNotFound(_0x39f708,_0x1f288c){return function(_0x43fb30){if(!_0x43fb30){_0x39f708[_0xaa30('0x1e')](0x194);}return _0x43fb30;};}function handleError(_0x43003f,_0x2038a6){_0x2038a6=_0x2038a6||0x1f4;return function(_0x46abb9){logger[_0xaa30('0x30')](_0x46abb9[_0xaa30('0x31')]);if(_0x46abb9[_0xaa30('0x32')]){delete _0x46abb9[_0xaa30('0x32')];}_0x43003f['status'](_0x2038a6)[_0xaa30('0x33')](_0x46abb9);};}exports[_0xaa30('0x34')]=function(_0x3bc22f,_0x20916f){var _0x2276e0={},_0x1dce4a={},_0x4dae71={'count':0x0,'rows':[]};var _0x5addbf=_['map'](db[_0xaa30('0x35')][_0xaa30('0x36')],function(_0xb48ef3){return{'name':_0xb48ef3[_0xaa30('0x37')],'type':_0xb48ef3[_0xaa30('0x38')]['key']};});_0x1dce4a['model']=_[_0xaa30('0x39')](_0x5addbf,_0xaa30('0x32'));_0x1dce4a['query']=_[_0xaa30('0x3a')](_0x3bc22f['query']);_0x1dce4a[_0xaa30('0x3b')]=_['intersection'](_0x1dce4a[_0xaa30('0x3c')],_0x1dce4a[_0xaa30('0x3d')]);_0x2276e0['attributes']=_[_0xaa30('0x3e')](_0x1dce4a[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x3f')]));_0x2276e0[_0xaa30('0x40')]=_0x2276e0['attributes'][_0xaa30('0x41')]?_0x2276e0[_0xaa30('0x40')]:_0x1dce4a['model'];if(!_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x42')](_0xaa30('0x43'))){_0x2276e0['limit']=qs['limit'](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x25')]);_0x2276e0[_0xaa30('0x24')]=qs[_0xaa30('0x24')](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x24')]);}_0x2276e0['order']=qs['sort'](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x44')]);_0x2276e0[_0xaa30('0x45')]=qs['filters'](_[_0xaa30('0x46')](_0x3bc22f[_0xaa30('0x3d')],_0x1dce4a[_0xaa30('0x3b')]),_0x5addbf);if(_0x3bc22f[_0xaa30('0x3d')]['filter']){_0x2276e0[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0x2276e0[_0xaa30('0x45')],{'$or':_[_0xaa30('0x39')](_0x5addbf,function(_0x1f6f53){if(_0x1f6f53['type']!==_0xaa30('0x48')){var _0x29cf85={};_0x29cf85[_0x1f6f53[_0xaa30('0x32')]]={'$like':'%'+_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x29cf85;}})});}_0x2276e0=_[_0xaa30('0x47')]({},_0x2276e0,_0x3bc22f[_0xaa30('0x4a')]);var _0x17510b={'where':_0x2276e0['where']};return db['VoicePrefix'][_0xaa30('0x23')](_0x17510b)['then'](function(_0x5208f8){_0x4dae71['count']=_0x5208f8;if(_0x3bc22f[_0xaa30('0x3d')]['includeAll']){_0x2276e0[_0xaa30('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0xaa30('0x4c')](_0x2276e0);})[_0xaa30('0x2b')](function(_0x3f530e){_0x4dae71[_0xaa30('0x4d')]=_0x3f530e;return _0x4dae71;})[_0xaa30('0x2b')](respondWithFilteredResult(_0x20916f,_0x2276e0))[_0xaa30('0x4e')](handleError(_0x20916f,null));};exports[_0xaa30('0x4f')]=function(_0xc1ae21,_0x3302ff){var _0x521462={'raw':![],'where':{'id':_0xc1ae21['params']['id']}},_0x334639={};_0x334639[_0xaa30('0x3c')]=_[_0xaa30('0x3a')](db[_0xaa30('0x35')][_0xaa30('0x36')]);_0x334639[_0xaa30('0x3d')]=_['keys'](_0xc1ae21['query']);_0x334639[_0xaa30('0x3b')]=_['intersection'](_0x334639[_0xaa30('0x3c')],_0x334639[_0xaa30('0x3d')]);_0x521462[_0xaa30('0x40')]=_[_0xaa30('0x3e')](_0x334639[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0xc1ae21[_0xaa30('0x3d')]['fields']));_0x521462[_0xaa30('0x40')]=_0x521462[_0xaa30('0x40')][_0xaa30('0x41')]?_0x521462['attributes']:_0x334639[_0xaa30('0x3c')];if(_0xc1ae21[_0xaa30('0x3d')]['includeAll']){_0x521462[_0xaa30('0x4b')]=[{'all':!![]}];}_0x521462=_['merge']({},_0x521462,_0xc1ae21[_0xaa30('0x4a')]);return db['VoicePrefix']['find'](_0x521462)[_0xaa30('0x2b')](handleEntityNotFound(_0x3302ff,null))['then'](respondWithResult(_0x3302ff,null))['catch'](handleError(_0x3302ff,null));};exports[_0xaa30('0x2c')]=function(_0x1083e2,_0x2574f5){return db[_0xaa30('0x35')][_0xaa30('0x50')]({'where':{'id':_0x1083e2[_0xaa30('0x51')]['id']}})['then'](handleEntityNotFound(_0x2574f5,null))[_0xaa30('0x2b')](removeEntity(_0x2574f5,null))[_0xaa30('0x4e')](handleError(_0x2574f5,null));};exports[_0xaa30('0x52')]=function(_0x57a5fa,_0x53bcaa){return db['VoicePrefix']['describe']()[_0xaa30('0x2b')](respondWithResult(_0x53bcaa,null))[_0xaa30('0x4e')](handleError(_0x53bcaa,null));};exports[_0xaa30('0x53')]=function(_0x1d5c15,_0x1cb3f9){var _0x1ed257;return db['sequelize'][_0xaa30('0x54')](function(_0x2db9d5){return db[_0xaa30('0x35')][_0xaa30('0x53')](_0x1d5c15['body'],{'transaction':_0x2db9d5})[_0xaa30('0x2b')](function(_0x2d23f8){_0x1ed257=_0x2d23f8[_0xaa30('0x2d')]({'plain':!![]});return db[_0xaa30('0x55')][_0xaa30('0x50')]({'where':{'id':_0x1ed257['VoiceExtensionId']},'raw':!![]})['then'](function(_0x34ca1c){return createVoicePrefixExtensions(_0x1ed257,_0x34ca1c,_0x2db9d5);});});})[_0xaa30('0x2b')](function(){var _0x3c4f07=_0x1d5c15['user'][_0xaa30('0x2d')]({'plain':!![]});if(!_0x3c4f07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c4f07[_0xaa30('0x56')]===_0xaa30('0x57')){var _0x483a01=_0x1ed257;return db[_0xaa30('0x58')][_0xaa30('0x50')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3c4f07[_0xaa30('0x59')]},'raw':!![]})['then'](function(_0x5b227d){if(_0x5b227d&&_0x5b227d[_0xaa30('0x5a')]===0x0){return db[_0xaa30('0x2f')][_0xaa30('0x53')]({'name':_0x483a01['name'],'resourceId':_0x483a01['id'],'type':_0x5b227d[_0xaa30('0x32')],'sectionId':_0x5b227d['id']},{})[_0xaa30('0x2b')](function(){return _0x1ed257;});}else{return _0x1ed257;}})[_0xaa30('0x4e')](function(_0x949d84){logger[_0xaa30('0x30')](_0xaa30('0x5b'),_0x949d84);throw _0x949d84;});}return _0x1ed257;})[_0xaa30('0x2b')](respondWithResult(_0x1cb3f9,null))[_0xaa30('0x4e')](handleError(_0x1cb3f9,null));};function Extension(_0x242b5a,_0x426b90,_0xb1afa8,_0x2f84fa){this[_0xaa30('0x5c')]='from-sip';this[_0xaa30('0x5d')]=_0x242b5a;this[_0xaa30('0x5e')]=_0xb1afa8;this[_0xaa30('0x38')]='system';this[_0xaa30('0x5f')]=_0xaa30('0x60');this[_0xaa30('0x61')]=_0x426b90;this[_0xaa30('0x62')]=_0x2f84fa;}function createVoicePrefixExtensions(_0x9ee658,_0x2c5959,_0x4f1d54){return new BPromise(function(_0x366205,_0x4f5222){var _0x36242e=new Extension(formatPrefixName(_0x9ee658[_0xaa30('0x63')]),0x1,_0xaa30('0x64'),_0xaa30('0x65'));_0x36242e['VoicePrefixId']=_0x9ee658['id'];return db[_0xaa30('0x55')][_0xaa30('0x53')](_0x36242e,{'transaction':_0x4f1d54})['then'](function(_0x26f6f9){var _0x62b307=_0x26f6f9[_0xaa30('0x2d')]({'plain':!![]});var _0x16097e=_[_0xaa30('0x39')](addVoicePrefixExtensions(_0x9ee658,_0x2c5959),function(_0x13ee8f){_0x13ee8f['VoiceExtensionId']=_0x62b307['id'];_0x13ee8f[_0xaa30('0x66')]=_0x9ee658['id'];return _0x13ee8f;});return db[_0xaa30('0x55')][_0xaa30('0x67')](_0x16097e,{'transaction':_0x4f1d54})[_0xaa30('0x2b')](function(_0x334ef1){if(!_0x334ef1){return _0x4f5222(_0xaa30('0x68'));}else{return _0x366205(_0x334ef1);}})[_0xaa30('0x4e')](function(_0x42da00){return _0x4f5222(_0x42da00);});});;});};function addVoicePrefixExtensions(_0x4318a2,_0x6c968e){var _0x46bdc4=[];var _0x2f4d77=formatPrefixName(_0x4318a2[_0xaa30('0x63')]);_0x46bdc4['push'](new Extension(_0x2f4d77,0x2,_0xaa30('0x69'),'CDR(prefix)='+_0x4318a2[_0xaa30('0x32')]));if(_0x4318a2['callerIdAll']){_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x3,_0xaa30('0x69'),_0xaa30('0x6b')+_0x4318a2['callerIdAll']));}else{_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x3,_0xaa30('0x64'),'No\x20callerid\x20available'));}_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x4,'goto',_0x6c968e[_0xaa30('0x5c')]+','+'${EXTEN:'+(0x8+_0x4318a2['name'][_0xaa30('0x41')])+'}'+','+0x1));return _0x46bdc4;}function formatPrefixName(_0x99d382){var _0xd3e52e='_';for(var _0x313bfa=0x0;_0x313bfa<_0x99d382[_0xaa30('0x41')];_0x313bfa++){if(_0x99d382[_0xaa30('0x6c')](_0x313bfa)=='-'){_0xd3e52e+=_0x99d382[_0xaa30('0x6c')](_0x313bfa);}else{_0xd3e52e+='['+_0x99d382['charAt'](_0x313bfa)+']';}}_0xd3e52e+='.';return _0xd3e52e;}exports[_0xaa30('0x2a')]=function(_0x3f2683,_0x1386a9,_0x4aeb5d){var _0x1f8a61=_0x3f2683[_0xaa30('0x6d')];_0x1f8a61[_0xaa30('0x63')]='system-'+_0x1f8a61[_0xaa30('0x32')]+'-';return db['sequelize'][_0xaa30('0x54')](function(_0x4d2787){return db['VoicePrefix'][_0xaa30('0x2a')](_0x1f8a61,{'where':{'id':_0x1f8a61['id']},'transaction':_0x4d2787})[_0xaa30('0x2b')](function(){return db['VoiceExtension'][_0xaa30('0x2c')]({'where':{'VoicePrefixId':_0x1f8a61['id']},'transaction':_0x4d2787})[_0xaa30('0x2b')](function(){return db[_0xaa30('0x55')]['find']({'where':{'id':_0x1f8a61[_0xaa30('0x6e')]},'raw':!![]})[_0xaa30('0x2b')](function(_0x23daeb){return createVoicePrefixExtensions(_0x1f8a61,_0x23daeb,_0x4d2787);});});});})[_0xaa30('0x2b')](function(){return db[_0xaa30('0x35')][_0xaa30('0x6f')](_0x1f8a61['id']);})[_0xaa30('0x2b')](respondWithResult(_0x1386a9,null))['catch'](handleError(_0x1386a9,null));};exports[_0xaa30('0x70')]=function(_0x37c3ee,_0x112dc3,_0x25977d){return db['VoicePrefix'][_0xaa30('0x50')]({'where':{'id':_0x37c3ee[_0xaa30('0x51')]['id']}})['then'](handleEntityNotFound(_0x112dc3,null))[_0xaa30('0x2b')](function(_0x2d9dd8){if(_0x2d9dd8){return _0x2d9dd8[_0xaa30('0x70')](_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')],_[_0xaa30('0x72')](_0x37c3ee['body'],[_0xaa30('0x71'),'id'])||{})[_0xaa30('0x73')](function(_0x5948b4){for(var _0x2aa0ce=0x0;_0x2aa0ce<_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')][_0xaa30('0x41')];_0x2aa0ce+=0x1){socket[_0xaa30('0x74')]('userVoicePrefix:save',{'UserId':Number(_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')][_0x2aa0ce]),'VoicePrefixId':Number(_0x37c3ee[_0xaa30('0x51')]['id'])});}return _0x5948b4;});}})[_0xaa30('0x2b')](respondWithResult(_0x112dc3,null))[_0xaa30('0x4e')](handleError(_0x112dc3,null));};exports[_0xaa30('0x75')]=function(_0x5d3d83,_0x1e3a19,_0x467134){return db['VoicePrefix']['find']({'where':{'id':_0x5d3d83[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x1e3a19,null))[_0xaa30('0x2b')](function(_0x100f18){if(_0x100f18){return _0x100f18[_0xaa30('0x75')](_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')])['then'](function(){if(_['isArray'](_0x5d3d83['query'][_0xaa30('0x71')])){for(var _0x25ebba=0x0;_0x25ebba<_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')][_0xaa30('0x41')];_0x25ebba+=0x1){socket['emit'](_0xaa30('0x76'),{'UserId':Number(_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')][_0x25ebba]),'VoicePrefixId':Number(_0x5d3d83[_0xaa30('0x51')]['id'])});}}else{socket[_0xaa30('0x74')](_0xaa30('0x76'),{'UserId':Number(_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')]),'VoicePrefixId':Number(_0x5d3d83['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1e3a19,null))['catch'](handleError(_0x1e3a19,null));};exports[_0xaa30('0x77')]=function(_0x408362,_0x541d3b,_0x775047){var _0xe9e4={};var _0x15e3ae={};var _0x33551c;var _0x404f82;return db['VoicePrefix'][_0xaa30('0x78')]({'where':{'id':_0x408362[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x541d3b,null))['then'](function(_0x21b87b){if(_0x21b87b){_0x33551c=_0x21b87b;_0x15e3ae[_0xaa30('0x3c')]=_[_0xaa30('0x3a')](db[_0xaa30('0x79')][_0xaa30('0x36')]);_0x15e3ae[_0xaa30('0x3d')]=_[_0xaa30('0x3a')](_0x408362['query']);_0x15e3ae[_0xaa30('0x3b')]=_[_0xaa30('0x3e')](_0x15e3ae[_0xaa30('0x3c')],_0x15e3ae[_0xaa30('0x3d')]);_0xe9e4[_0xaa30('0x40')]=_[_0xaa30('0x3e')](_0x15e3ae[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0x408362[_0xaa30('0x3d')][_0xaa30('0x3f')]));_0xe9e4[_0xaa30('0x40')]=_0xe9e4[_0xaa30('0x40')][_0xaa30('0x41')]?_0xe9e4['attributes']:_0x15e3ae[_0xaa30('0x3c')];_0xe9e4['order']=qs[_0xaa30('0x44')](_0x408362[_0xaa30('0x3d')][_0xaa30('0x44')]);_0xe9e4[_0xaa30('0x45')]=qs[_0xaa30('0x3b')](_[_0xaa30('0x46')](_0x408362[_0xaa30('0x3d')],_0x15e3ae[_0xaa30('0x3b')]));if(_0x408362[_0xaa30('0x3d')][_0xaa30('0x49')]){_0xe9e4[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0xe9e4[_0xaa30('0x45')],{'$or':_[_0xaa30('0x39')](_0xe9e4[_0xaa30('0x40')],function(_0x3744b3){var _0x35a47f={};_0x35a47f[_0x3744b3]={'$like':'%'+_0x408362[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x35a47f;})});}_0xe9e4=_['merge']({},_0xe9e4,_0x408362[_0xaa30('0x4a')]);return _0x33551c[_0xaa30('0x77')](_0xe9e4);}})[_0xaa30('0x2b')](function(_0x3a67b3){if(_0x3a67b3){_0x404f82=_0x3a67b3[_0xaa30('0x41')];if(!_0x408362[_0xaa30('0x3d')][_0xaa30('0x42')]('nolimit')){_0xe9e4[_0xaa30('0x25')]=qs[_0xaa30('0x25')](_0x408362['query'][_0xaa30('0x25')]);_0xe9e4[_0xaa30('0x24')]=qs['offset'](_0x408362[_0xaa30('0x3d')][_0xaa30('0x24')]);}return _0x33551c[_0xaa30('0x77')](_0xe9e4);}})[_0xaa30('0x2b')](function(_0x5eb209){if(_0x5eb209){return _0x5eb209?{'count':_0x404f82,'rows':_0x5eb209}:null;}})[_0xaa30('0x2b')](respondWithResult(_0x541d3b,null))['catch'](handleError(_0x541d3b,null));};exports[_0xaa30('0x7a')]=function(_0x41480f,_0x24f60f,_0x3fb561){var _0x24a3af={};var _0x4412d4={};var _0x45ffba;var _0x2e73e1;return db[_0xaa30('0x35')]['findOne']({'where':{'id':_0x41480f[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x24f60f,null))['then'](function(_0x1f48c1){if(_0x1f48c1){_0x45ffba=_0x1f48c1;_0x4412d4[_0xaa30('0x3c')]=_['keys'](db[_0xaa30('0x7b')][_0xaa30('0x36')]);_0x4412d4['query']=_[_0xaa30('0x3a')](_0x41480f['query']);_0x4412d4['filters']=_[_0xaa30('0x3e')](_0x4412d4[_0xaa30('0x3c')],_0x4412d4['query']);_0x24a3af['attributes']=_[_0xaa30('0x3e')](_0x4412d4[_0xaa30('0x3c')],qs['fields'](_0x41480f[_0xaa30('0x3d')]['fields']));_0x24a3af['attributes']=_0x24a3af[_0xaa30('0x40')]['length']?_0x24a3af[_0xaa30('0x40')]:_0x4412d4['model'];_0x24a3af[_0xaa30('0x7c')]=qs[_0xaa30('0x44')](_0x41480f[_0xaa30('0x3d')][_0xaa30('0x44')]);_0x24a3af[_0xaa30('0x45')]=qs[_0xaa30('0x3b')](_[_0xaa30('0x46')](_0x41480f[_0xaa30('0x3d')],_0x4412d4[_0xaa30('0x3b')]));if(_0x41480f['query']['filter']){_0x24a3af[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0x24a3af[_0xaa30('0x45')],{'$or':_['map'](_0x24a3af['attributes'],function(_0x46df1d){var _0x554b6b={};_0x554b6b[_0x46df1d]={'$like':'%'+_0x41480f[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x554b6b;})});}_0x24a3af=_[_0xaa30('0x47')]({},_0x24a3af,_0x41480f[_0xaa30('0x4a')]);return _0x45ffba['getTeams'](_0x24a3af);}})[_0xaa30('0x2b')](function(_0x5d061b){if(_0x5d061b){_0x2e73e1=_0x5d061b[_0xaa30('0x41')];if(!_0x41480f[_0xaa30('0x3d')][_0xaa30('0x42')](_0xaa30('0x43'))){_0x24a3af['limit']=qs[_0xaa30('0x25')](_0x41480f[_0xaa30('0x3d')]['limit']);_0x24a3af[_0xaa30('0x24')]=qs['offset'](_0x41480f[_0xaa30('0x3d')]['offset']);}return _0x45ffba[_0xaa30('0x7a')](_0x24a3af);}})[_0xaa30('0x2b')](function(_0x11dd5e){if(_0x11dd5e){return _0x11dd5e?{'count':_0x2e73e1,'rows':_0x11dd5e}:null;}})[_0xaa30('0x2b')](respondWithResult(_0x24f60f,null))[_0xaa30('0x4e')](handleError(_0x24f60f,null));};exports[_0xaa30('0x7d')]=function(_0x2f90db,_0x3f382a,_0x36f739){var _0x5687ef=_0x2f90db[_0xaa30('0x6d')][_0xaa30('0x71')];var _0x21e8c7;return db['Team'][_0xaa30('0x4c')]({'where':{'id':_0x5687ef},'attributes':['id'],'include':[{'model':db[_0xaa30('0x79')],'as':_0xaa30('0x7e'),'attributes':['id',_0xaa30('0x32'),_0xaa30('0x7f'),_0xaa30('0x80'),_0xaa30('0x81')],'raw':!![]}]})[_0xaa30('0x2b')](function(_0x16e95c){if(_0x16e95c){_0x21e8c7=_0x16e95c;var _0x4dc93c=_[_0xaa30('0x82')](_0x16e95c,function(_0x25dca3){var _0x13521a=_0x25dca3['get']({'plain':!![]});return _0x13521a[_0xaa30('0x7e')];});return db[_0xaa30('0x35')]['find']({'where':{'id':_0x2f90db[_0xaa30('0x51')]['id']}})['then'](function(_0x51a37a){return db[_0xaa30('0x83')][_0xaa30('0x54')](function(_0xcf7c59){return _0x51a37a[_0xaa30('0x7d')](_0x5687ef,{'transaction':_0xcf7c59})['then'](function(){return BPromise['each'](_0x21e8c7,function(_0x4240d0){return db[_0xaa30('0x84')][_0xaa30('0x85')]({'TeamId':_0x4240d0['id'],'VoicePrefixId':_0x2f90db[_0xaa30('0x51')]['id']},{'transaction':_0xcf7c59});});})[_0xaa30('0x2b')](function(){return BPromise['each'](_0x4dc93c,function(_0x7db5d7){return db['UserVoicePrefix'][_0xaa30('0x86')]({'where':{'UserId':_0x7db5d7['id'],'VoicePrefixId':_0x2f90db[_0xaa30('0x51')]['id']},'transaction':_0xcf7c59});});})[_0xaa30('0x2b')](function(){_0x4dc93c['forEach'](function(_0x1c25b1){socket[_0xaa30('0x74')](_0xaa30('0x87'),{'UserId':_0x1c25b1['id'],'VoicePrefixId':_0x51a37a['id']});});});});});}})[_0xaa30('0x2b')](respondWithStatusCode(_0x3f382a,null))[_0xaa30('0x4e')](handleError(_0x3f382a,null));};exports[_0xaa30('0x88')]=function(_0x51fb85,_0x133a0f,_0x1bd3c2){return db['Team']['findAll']({'where':{'id':_0x51fb85[_0xaa30('0x3d')][_0xaa30('0x71')]},'attributes':['id'],'include':[{'model':db[_0xaa30('0x79')],'as':_0xaa30('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xaa30('0x2b')](handleEntityNotFound(_0x133a0f,null))[_0xaa30('0x2b')](function(_0x3dd250){var _0x2ec205=_[_0xaa30('0x39')](_0x3dd250,'id');var _0x211916=[];var _0x4bba25=[];var _0x73c665=squel['select']();_0x73c665['field'](_0xaa30('0x89'))[_0xaa30('0x8a')](_0xaa30('0x8b'),'tq')['join'](_0xaa30('0x8c'),'ut',_0xaa30('0x8d'))['where'](_0xaa30('0x8e'),_0x51fb85[_0xaa30('0x51')]['id']);for(var _0x2ebaa0=0x0;_0x2ebaa0<_0x3dd250[_0xaa30('0x41')];_0x2ebaa0+=0x1){let _0x420276=_0x3dd250[_0x2ebaa0];for(var _0x2c48a2=0x0;_0x2c48a2<_0x420276['Agents'][_0xaa30('0x41')];_0x2c48a2+=0x1){let _0x206fc4=_0x420276[_0xaa30('0x7e')][_0x2c48a2];var _0x24fccc=_0x73c665[_0xaa30('0x8f')]();_0x24fccc[_0xaa30('0x45')](_0xaa30('0x90'),_0x206fc4['id']);_0x4bba25['push'](db['sequelize'][_0xaa30('0x3d')](_0x24fccc[_0xaa30('0x91')](),{'type':db[_0xaa30('0x83')][_0xaa30('0x92')][_0xaa30('0x93')]})[_0xaa30('0x2b')](function(_0x162810){if(_0x162810[_0xaa30('0x41')]===0x1){return _0x206fc4['id'];}else{var _0x2ed461=_[_0xaa30('0x94')](_[_0xaa30('0x39')](_0x162810,'TeamId'),function(_0x5c21e){return _[_0xaa30('0x95')](_0x2ec205,_0x5c21e);});if(_0x2ed461){return _0x206fc4['id'];}}}));}}return BPromise[_0xaa30('0x96')](_0x4bba25)[_0xaa30('0x2b')](function(_0x46c9a5){_0x211916=_(_0x211916)[_0xaa30('0x97')](_0x46c9a5)[_0xaa30('0x98')]()[_0xaa30('0x99')]();return db[_0xaa30('0x35')][_0xaa30('0x50')]({'where':{'id':_0x51fb85[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](function(_0x4cc3f0){return db[_0xaa30('0x83')][_0xaa30('0x54')](function(_0x31bdf6){return _0x4cc3f0['removeTeams'](_0x51fb85['query'][_0xaa30('0x71')],{'transaction':_0x31bdf6})['then'](function(){if(!_[_0xaa30('0x9a')](_0x211916)){return _0x4cc3f0['removeAgents'](_0x211916,{'transaction':_0x31bdf6});}})[_0xaa30('0x2b')](function(){_0x211916[_0xaa30('0x9b')](function(_0xb148d9){socket[_0xaa30('0x74')]('userVoicePrefix:remove',{'UserId':_0xb148d9,'VoicePrefixId':_0x4cc3f0['id']});});});});});});})[_0xaa30('0x2b')](respondWithStatusCode(_0x133a0f,null))[_0xaa30('0x4e')](handleError(_0x133a0f,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8664d2f..163815e 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 _0x4b7a=['hasOwnProperty','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x1d7c10,_0x3b5ed7){var _0xb76ec7=function(_0x520c1c){while(--_0x520c1c){_0x1d7c10['push'](_0x1d7c10['shift']());}};_0xb76ec7(++_0x3b5ed7);}(_0x4b7a,0x7f));var _0xa4b7=function(_0x1952ac,_0x5c7345){_0x1952ac=_0x1952ac-0x0;var _0x15abe5=_0x4b7a[_0x1952ac];return _0x15abe5;};'use strict';var EventEmitter=require(_0xa4b7('0x0'));var VoicePrefix=require(_0xa4b7('0x1'))['db'][_0xa4b7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xa4b7('0x3')](0x0);var events={'afterCreate':_0xa4b7('0x4'),'afterUpdate':_0xa4b7('0x5'),'afterDestroy':_0xa4b7('0x6')};function emitEvent(_0x3483b2){return function(_0x149e40,_0x4dcd1b,_0x5878bb){VoicePrefixEvents[_0xa4b7('0x7')](_0x3483b2+':'+_0x149e40['id'],_0x149e40);VoicePrefixEvents[_0xa4b7('0x7')](_0x3483b2,_0x149e40);_0x5878bb(null);};}for(var e in events){if(events[_0xa4b7('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xf0f8=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5ce230,_0x3e301c){var _0x4e1dfe=function(_0x56e2a8){while(--_0x56e2a8){_0x5ce230['push'](_0x5ce230['shift']());}};_0x4e1dfe(++_0x3e301c);}(_0xf0f8,0x6d));var _0x8f0f=function(_0x1e9d7a,_0x400b7a){_0x1e9d7a=_0x1e9d7a-0x0;var _0x390ae4=_0xf0f8[_0x1e9d7a];return _0x390ae4;};'use strict';var EventEmitter=require(_0x8f0f('0x0'));var VoicePrefix=require(_0x8f0f('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8f0f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f0f('0x3'),'afterDestroy':_0x8f0f('0x4')};function emitEvent(_0xe77699){return function(_0x30502d,_0x4776ac,_0x5060db){VoicePrefixEvents[_0x8f0f('0x5')](_0xe77699+':'+_0x30502d['id'],_0x30502d);VoicePrefixEvents['emit'](_0xe77699,_0x30502d);_0x5060db(null);};}for(var e in events){if(events[_0x8f0f('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x8f0f('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index b667414..5d4d878 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 _0x770d=['VoicePrefix','../../config/logger','api','moment','bluebird','path','./voicePrefix.attributes'];(function(_0x35dff2,_0x9abbd1){var _0x1aef69=function(_0x203512){while(--_0x203512){_0x35dff2['push'](_0x35dff2['shift']());}};_0x1aef69(++_0x9abbd1);}(_0x770d,0x6a));var _0xd770=function(_0x2ea2e9,_0x42b62c){_0x2ea2e9=_0x2ea2e9-0x0;var _0x35dccd=_0x770d[_0x2ea2e9];return _0x35dccd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd770('0x0'))(_0xd770('0x1'));var moment=require(_0xd770('0x2'));var BPromise=require(_0xd770('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd770('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd770('0x5'));module['exports']=function(_0x371592,_0x5373ac){return _0x371592['define'](_0xd770('0x6'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26ef=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x5e2c49,_0x3841b2){var _0x2171c9=function(_0x3cf31c){while(--_0x3cf31c){_0x5e2c49['push'](_0x5e2c49['shift']());}};_0x2171c9(++_0x3841b2);}(_0x26ef,0x82));var _0xf26e=function(_0x35bd6d,_0x45f0f9){_0x35bd6d=_0x35bd6d-0x0;var _0x59923e=_0x26ef[_0x35bd6d];return _0x59923e;};'use strict';var _=require(_0xf26e('0x0'));var util=require(_0xf26e('0x1'));var logger=require(_0xf26e('0x2'))(_0xf26e('0x3'));var moment=require(_0xf26e('0x4'));var BPromise=require(_0xf26e('0x5'));var rp=require(_0xf26e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf26e('0x7'));var config=require(_0xf26e('0x8'));var attributes=require(_0xf26e('0x9'));module[_0xf26e('0xa')]=function(_0xfecbfb,_0x131972){return _0xfecbfb[_0xf26e('0xb')](_0xf26e('0xc'),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 b0d7beb..ecdbd09 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 _0x9fe7=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xe7633c,_0x2f63f9){var _0x3ecc86=function(_0x4db9a3){while(--_0x4db9a3){_0xe7633c['push'](_0xe7633c['shift']());}};_0x3ecc86(++_0x2f63f9);}(_0x9fe7,0x1df));var _0x79fe=function(_0x5db66a,_0x4dcead){_0x5db66a=_0x5db66a-0x0;var _0x2404ed=_0x9fe7[_0x5db66a];return _0x2404ed;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var moment=require('moment');var BPromise=require(_0x79fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79fe('0x3'));var db=require(_0x79fe('0x4'))['db'];var utils=require(_0x79fe('0x5'));var logger=require('../../config/logger')(_0x79fe('0x6'));var config=require(_0x79fe('0x7'));var jayson=require(_0x79fe('0x8'));var client=jayson['client'][_0x79fe('0x9')]({'port':0x232a});config[_0x79fe('0xa')]=_[_0x79fe('0xb')](config['redis'],{'host':_0x79fe('0xc'),'port':0x18eb});var socket=require(_0x79fe('0xd'))(new Redis(config[_0x79fe('0xa')]));require(_0x79fe('0xe'))[_0x79fe('0xf')](socket);function respondWithRpcPromise(_0x5b914a,_0x34c217,_0x253f7d){return new BPromise(function(_0x4a3ccf,_0x20cde6){return client[_0x79fe('0x10')](_0x5b914a,_0x253f7d)[_0x79fe('0x11')](function(_0x20607a){logger['info'](_0x79fe('0x12'),_0x34c217,_0x79fe('0x13'));logger[_0x79fe('0x14')](_0x79fe('0x15'),_0x34c217,_0x79fe('0x13'),JSON[_0x79fe('0x16')](_0x20607a));if(_0x20607a[_0x79fe('0x17')]){if(_0x20607a[_0x79fe('0x17')]['code']===0x1f4){logger[_0x79fe('0x17')](_0x79fe('0x12'),_0x34c217,_0x20607a[_0x79fe('0x17')][_0x79fe('0x18')]);return _0x20cde6(_0x20607a[_0x79fe('0x17')][_0x79fe('0x18')]);}logger['error'](_0x79fe('0x12'),_0x34c217,_0x20607a[_0x79fe('0x17')][_0x79fe('0x18')]);return _0x4a3ccf(_0x20607a[_0x79fe('0x17')]['message']);}else{logger[_0x79fe('0x19')](_0x79fe('0x12'),_0x34c217,_0x79fe('0x13'));_0x4a3ccf(_0x20607a[_0x79fe('0x1a')]['message']);}})['catch'](function(_0x132964){logger[_0x79fe('0x17')](_0x79fe('0x12'),_0x34c217,_0x132964);_0x20cde6(_0x132964);});});} \ No newline at end of file +var _0x09d2=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c9453,_0x1d6c8b){var _0x20dd4d=function(_0x1f934a){while(--_0x1f934a){_0x1c9453['push'](_0x1c9453['shift']());}};_0x20dd4d(++_0x1d6c8b);}(_0x09d2,0x1d2));var _0x209d=function(_0x32173e,_0x60e47b){_0x32173e=_0x32173e-0x0;var _0x27fe8f=_0x09d2[_0x32173e];return _0x27fe8f;};'use strict';var _=require(_0x209d('0x0'));var util=require(_0x209d('0x1'));var moment=require(_0x209d('0x2'));var BPromise=require(_0x209d('0x3'));var rs=require(_0x209d('0x4'));var fs=require('fs');var Redis=require(_0x209d('0x5'));var db=require(_0x209d('0x6'))['db'];var utils=require(_0x209d('0x7'));var logger=require(_0x209d('0x8'))(_0x209d('0x9'));var config=require('../../config/environment');var jayson=require(_0x209d('0xa'));var client=jayson[_0x209d('0xb')][_0x209d('0xc')]({'port':0x232a});config[_0x209d('0xd')]=_[_0x209d('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x209d('0xf'))(new Redis(config[_0x209d('0xd')]));require(_0x209d('0x10'))['register'](socket);function respondWithRpcPromise(_0x6b5375,_0x580742,_0x33caba){return new BPromise(function(_0x446eb0,_0x3ee1eb){return client[_0x209d('0x11')](_0x6b5375,_0x33caba)[_0x209d('0x12')](function(_0x30052a){logger[_0x209d('0x13')](_0x209d('0x14'),_0x580742,_0x209d('0x15'));logger[_0x209d('0x16')](_0x209d('0x17'),_0x580742,_0x209d('0x15'),JSON['stringify'](_0x30052a));if(_0x30052a[_0x209d('0x18')]){if(_0x30052a[_0x209d('0x18')][_0x209d('0x19')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x580742,_0x30052a[_0x209d('0x18')]['message']);return _0x3ee1eb(_0x30052a['error'][_0x209d('0x1a')]);}logger[_0x209d('0x18')](_0x209d('0x14'),_0x580742,_0x30052a['error'][_0x209d('0x1a')]);return _0x446eb0(_0x30052a[_0x209d('0x18')][_0x209d('0x1a')]);}else{logger[_0x209d('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x580742,_0x209d('0x15'));_0x446eb0(_0x30052a[_0x209d('0x1b')][_0x209d('0x1a')]);}})['catch'](function(_0x47daf8){logger[_0x209d('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x580742,_0x47daf8);_0x3ee1eb(_0x47daf8);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 959ce4a..abd5065 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 _0x0434=['update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x15c97c,_0x35308c){var _0x21b522=function(_0x5e6863){while(--_0x5e6863){_0x15c97c['push'](_0x15c97c['shift']());}};_0x21b522(++_0x35308c);}(_0x0434,0x1ad));var _0x4043=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x0434[_0x3b3cc6];return _0x1161e4;};'use strict';var VoicePrefixEvents=require(_0x4043('0x0'));var events=[_0x4043('0x1'),_0x4043('0x2'),_0x4043('0x3')];function createListener(_0x425361,_0x56e8f3){return function(_0x4ca779){_0x56e8f3[_0x4043('0x4')](_0x425361,_0x4ca779);};}function removeListener(_0xfa9ae8,_0x3e475f){return function(){VoicePrefixEvents[_0x4043('0x5')](_0xfa9ae8,_0x3e475f);};}exports[_0x4043('0x6')]=function(_0x1dba57){for(var _0x58fca7=0x0,_0x41d0a9=events[_0x4043('0x7')];_0x58fca7<_0x41d0a9;_0x58fca7++){var _0x5080e5=events[_0x58fca7];var _0x56355c=createListener(_0x4043('0x8')+_0x5080e5,_0x1dba57);VoicePrefixEvents['on'](_0x5080e5,_0x56355c);}}; \ No newline at end of file +var _0xc423=['length','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x549876,_0x66473f){var _0x242552=function(_0x368dfb){while(--_0x368dfb){_0x549876['push'](_0x549876['shift']());}};_0x242552(++_0x66473f);}(_0xc423,0x159));var _0x3c42=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc423[_0x2be8c2];return _0x97f531;};'use strict';var VoicePrefixEvents=require(_0x3c42('0x0'));var events=[_0x3c42('0x1'),_0x3c42('0x2'),_0x3c42('0x3')];function createListener(_0x206e02,_0x4c94ff){return function(_0x212d37){_0x4c94ff[_0x3c42('0x4')](_0x206e02,_0x212d37);};}function removeListener(_0x2f1f8b,_0x5e8278){return function(){VoicePrefixEvents[_0x3c42('0x5')](_0x2f1f8b,_0x5e8278);};}exports[_0x3c42('0x6')]=function(_0x14e395){for(var _0x1feba8=0x0,_0x3c3ac4=events[_0x3c42('0x7')];_0x1feba8<_0x3c3ac4;_0x1feba8++){var _0x278430=events[_0x1feba8];var _0x23c503=createListener('voicePrefix:'+_0x278430,_0x14e395);VoicePrefixEvents['on'](_0x278430,_0x23c503);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 01b7573..6eaaabf 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x2e38e2,_0x3442ef){var _0x3c1afb=function(_0x21f62a){while(--_0x21f62a){_0x2e38e2['push'](_0x2e38e2['shift']());}};_0x3c1afb(++_0x3442ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x583121,_0x7a91e6){var _0x4a9736=function(_0x43182c){while(--_0x43182c){_0x583121['push'](_0x583121['shift']());}};_0x4a9736(++_0x7a91e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 63ccc63..151c4bc 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 _0x8579=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','ENUM','inbound','outbound','STRING','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never'];(function(_0x54591f,_0x2dce50){var _0x2a99a6=function(_0x391c15){while(--_0x391c15){_0x54591f['push'](_0x54591f['shift']());}};_0x2a99a6(++_0x2dce50);}(_0x8579,0x6a));var _0x9857=function(_0x491447,_0x2a43ed){_0x491447=_0x491447-0x0;var _0x18e2f5=_0x8579[_0x491447];return _0x18e2f5;};'use strict';var Sequelize=require(_0x9857('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x2'),_0x9857('0x3')),'allowNull':![],'defaultValue':_0x9857('0x2')},'musiconhold':{'type':Sequelize[_0x9857('0x4')],'defaultValue':_0x9857('0x5')},'announce':{'type':Sequelize[_0x9857('0x4')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x9857('0x6'),_0x9857('0x7'),_0x9857('0x8'),_0x9857('0x9'),_0x9857('0xa'),_0x9857('0xb'),_0x9857('0xc')),'allowNull':![],'defaultValue':_0x9857('0xd'),'set':function(_0x41794f){this[_0x9857('0xe')](_0x9857('0xf'),_0x41794f?_0x41794f:_0x9857('0x9'));},'get':function(){var _0x2645fb=this[_0x9857('0x10')](_0x9857('0x11'));var _0x32460d=this[_0x9857('0x10')]('dialMethod');var _0x3dc7c3=this[_0x9857('0x10')](_0x9857('0xf'));if(_0x2645fb===_0x9857('0x2')){return _0x3dc7c3;}if(_0x32460d==='booked'&&_0x3dc7c3==='rrmemory'||_0x32460d===_0x9857('0x12')&&_0x3dc7c3==='roundrobin'){return _0x3dc7c3;}if(_0x32460d===_0x9857('0x13')||_0x32460d===_0x9857('0x14')||_0x32460d===_0x9857('0x15')){return _0x3dc7c3;}return null;}},'servicelevel':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9857('0x16')](0xb)},'timeout':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x9857('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9857('0x17')},'autopause':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no',_0x9857('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9857('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9857('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9857('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no',_0x9857('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9857('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x9857('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9857('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9857('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9857('0x4')]},'queue_youarenext':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9857('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9857('0x4')]},'queue_quantity1':{'type':Sequelize[_0x9857('0x4')]},'queue_quantity2':{'type':Sequelize[_0x9857('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x9857('0x4')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x9857('0x1a')],'set':function(_0x20b84d){this['setDataValue'](_0x9857('0x1b'),_0x20b84d?_0x20b84d[_0x9857('0x1c')](','):[]);},'get':function(){return this[_0x9857('0x10')](_0x9857('0x1b'))?this[_0x9857('0x10')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x1e33f2){this[_0x9857('0xe')]('joinempty',_0x1e33f2?_0x1e33f2[_0x9857('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x9857('0x1d'))?this[_0x9857('0x10')](_0x9857('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9857('0x4')],'defaultValue':'no','set':function(_0x27c59d){this[_0x9857('0xe')]('leavewhenempty',_0x27c59d?_0x27c59d[_0x9857('0x1c')](','):undefined);},'get':function(){return this[_0x9857('0x10')](_0x9857('0x1e'))?this[_0x9857('0x10')](_0x9857('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x9857('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9857('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9857('0x4')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':0x0,'set':function(_0x1acfe7){this['setDataValue'](_0x9857('0x20'),_0x1acfe7);if(_0x1acfe7){if(this['getDataValue'](_0x9857('0x21'))<0x2){this[_0x9857('0xe')](_0x9857('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x9857('0x13'),_0x9857('0x15'),_0x9857('0x14'),_0x9857('0x12')),'defaultValue':'progressive','comment':_0x9857('0x22')},'dialLimitChannel':{'type':Sequelize[_0x9857('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x9857('0x16')](0x4)[_0x9857('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9857('0x24')},'dialPowerLevel':{'type':Sequelize[_0x9857('0x25')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9857('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x9857('0x1')]('agentBusyFactor','dropRate'),'defaultValue':_0x9857('0x27'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9857('0x25')](0x2)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9857('0x28')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9857('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9857('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9857('0x2b'),'comment':_0x9857('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x2d')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x9857('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'comment':_0x9857('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9857('0x34')},'dialTimezone':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9857('0x4')],'defaultValue':_0x9857('0x35')},'dialPrefix':{'type':Sequelize[_0x9857('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9857('0x36'),_0x9857('0x37'),_0x9857('0x38')),'defaultValue':_0x9857('0x36')},'dialAMDActive':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':0x0,'comment':_0x9857('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x9857('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9857('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9857('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9857('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9857('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9857('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9857('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9857('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9857('0x16')](0x9)[_0x9857('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9857('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9857('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9857('0x1')](_0x9857('0x42'),_0x9857('0x43')),'defaultValue':_0x9857('0x42')},'dialQueueProject2':{'type':Sequelize[_0x9857('0x4')],'comment':_0x9857('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9857('0x44')},'dialCutDigit':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9857('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x47')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9857('0x16')](0x5)[_0x9857('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9857('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9857('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9857('0x16')],'allowNull':!![],'comment':_0x9857('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x948f9){if(!_0x948f9)this[_0x9857('0xe')](_0x9857('0x50'),null);this[_0x9857('0xe')]('mandatoryDisposition',_0x948f9);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9857('0x16')](0x3)[_0x9857('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9857('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x9857('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0429=['sequelize','name','inbound','outbound','STRING','random','linear','wrandom','ringall','setDataValue','strategy','rrmemory','type','getDataValue','dialMethod','booked','progressive','predictive','INTEGER','yes','ENUM','all','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#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','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x5e99c1,_0x1edff5){var _0x3c4680=function(_0x58a8cb){while(--_0x58a8cb){_0x5e99c1['push'](_0x5e99c1['shift']());}};_0x3c4680(++_0x1edff5);}(_0x0429,0x1da));var _0x9042=function(_0x586996,_0x1f5045){_0x586996=_0x586996-0x0;var _0x20d448=_0x0429[_0x586996];return _0x20d448;};'use strict';var Sequelize=require(_0x9042('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9042('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x9042('0x2'),_0x9042('0x3')),'allowNull':![],'defaultValue':_0x9042('0x2')},'musiconhold':{'type':Sequelize[_0x9042('0x4')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent','fewestcalls',_0x9042('0x5'),'rrmemory',_0x9042('0x6'),_0x9042('0x7'),'rrordered'),'allowNull':![],'defaultValue':_0x9042('0x8'),'set':function(_0x3616c1){this[_0x9042('0x9')](_0x9042('0xa'),_0x3616c1?_0x3616c1:_0x9042('0xb'));},'get':function(){var _0x7734be=this['getDataValue'](_0x9042('0xc'));var _0x3c6370=this[_0x9042('0xd')](_0x9042('0xe'));var _0x2f7a30=this[_0x9042('0xd')]('strategy');if(_0x7734be===_0x9042('0x2')){return _0x2f7a30;}if(_0x3c6370===_0x9042('0xf')&&_0x2f7a30===_0x9042('0xb')||_0x3c6370===_0x9042('0xf')&&_0x2f7a30==='roundrobin'){return _0x2f7a30;}if(_0x3c6370===_0x9042('0x10')||_0x3c6370===_0x9042('0x11')||_0x3c6370==='power'){return _0x2f7a30;}return null;}},'servicelevel':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9042('0x12')](0xb)},'timeout':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9042('0x4')]},'weight':{'type':Sequelize[_0x9042('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9042('0x13')},'autopause':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no',_0x9042('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x9042('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9042('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9042('0x14')]('yes','no'),'defaultValue':_0x9042('0x13')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x9042('0x13'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9042('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x9042('0x13'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9042('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9042('0x4')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9042('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9042('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9042('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9042('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9042('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9042('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9042('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9042('0x4')]},'queue_quantity1':{'type':Sequelize[_0x9042('0x4')]},'queue_quantity2':{'type':Sequelize[_0x9042('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x9042('0x4')]},'queue_less_than':{'type':Sequelize[_0x9042('0x4')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x48b1f0){this[_0x9042('0x9')](_0x9042('0x16'),_0x48b1f0?_0x48b1f0[_0x9042('0x17')](','):[]);},'get':function(){return this[_0x9042('0xd')](_0x9042('0x16'))?this[_0x9042('0xd')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x9042('0x4')],'defaultValue':'yes','set':function(_0x598e3f){this[_0x9042('0x9')](_0x9042('0x18'),_0x598e3f?_0x598e3f['join'](','):undefined);},'get':function(){return this[_0x9042('0xd')](_0x9042('0x18'))?this[_0x9042('0xd')](_0x9042('0x18'))[_0x9042('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9042('0x4')],'defaultValue':'no','set':function(_0x144cb9){this[_0x9042('0x9')](_0x9042('0x1a'),_0x144cb9?_0x144cb9[_0x9042('0x17')](','):undefined);},'get':function(){return this[_0x9042('0xd')](_0x9042('0x1a'))?this[_0x9042('0xd')](_0x9042('0x1a'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x9042('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9042('0x4')]},'description':{'type':Sequelize[_0x9042('0x4')]},'acw':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':0x0,'set':function(_0x31c68a){this[_0x9042('0x9')](_0x9042('0x1c'),_0x31c68a);if(_0x31c68a){if(this[_0x9042('0xd')](_0x9042('0x1d'))<0x2){this['setDataValue'](_0x9042('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9042('0x12')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9042('0x1e')},'dialMethod':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x1f'),'progressive',_0x9042('0x20'),'predictive',_0x9042('0xf')),'defaultValue':'progressive','comment':_0x9042('0x21')},'dialLimitChannel':{'type':Sequelize[_0x9042('0x12')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9042('0x22')},'dialLimitQueue':{'type':Sequelize[_0x9042('0x12')](0x4)[_0x9042('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9042('0x24')},'dialPowerLevel':{'type':Sequelize[_0x9042('0x25')](0x2)[_0x9042('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9042('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x27'),_0x9042('0x28')),'defaultValue':_0x9042('0x28'),'comment':_0x9042('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9042('0x25')](0x2)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9042('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x9042('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9042('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9042('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9042('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x9042('0x4')],'defaultValue':_0x9042('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9042('0x2d')},'dialQueueProject':{'type':Sequelize[_0x9042('0x4')],'comment':_0x9042('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9042('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9042('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9042('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9042('0x12')](0x5)[_0x9042('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9042('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'defaultValue':0x3,'comment':_0x9042('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9042('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9042('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9042('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9042('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9042('0x4')],'defaultValue':_0x9042('0x35')},'dialPrefix':{'type':Sequelize[_0x9042('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x36'),_0x9042('0x37'),'onlyIfOpen'),'defaultValue':_0x9042('0x36')},'dialAMDActive':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x9042('0x12')](0x9)[_0x9042('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9042('0x12')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9042('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9042('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9042('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9042('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9042('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x9042('0x12')](0x9)[_0x9042('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9042('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9042('0x12')](0x9)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9042('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x9042('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9042('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9042('0x12')](0x9)[_0x9042('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9042('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x9042('0x12')](0x5)[_0x9042('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':0x0,'comment':_0x9042('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9042('0x14')](_0x9042('0x40'),_0x9042('0x41')),'defaultValue':_0x9042('0x40')},'dialQueueProject2':{'type':Sequelize[_0x9042('0x4')],'comment':_0x9042('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9042('0x42')},'dialCutDigit':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9042('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9042('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9042('0x12')](0x5)[_0x9042('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9042('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9042('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9042('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9042('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9042('0x12')](0x5)[_0x9042('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9042('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9042('0x12')](0x5)[_0x9042('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9042('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9042('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9042('0x12')](0x5)[_0x9042('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9042('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9042('0x12')],'allowNull':!![],'comment':_0x9042('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':![],'comment':_0x9042('0x4c'),'set':function(_0x15c27e){if(!_0x15c27e)this[_0x9042('0x9')](_0x9042('0x4d'),null);this[_0x9042('0x9')](_0x9042('0x4e'),_0x15c27e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x9042('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9042('0x12')](0x3)[_0x9042('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9042('0x1b')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index dede28b..2c33709 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 _0x326f=['VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','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','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','destroy','then','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','VoiceQueue','findAll','rows','catch','params','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','userProfileId','clone','options','omit','updatedAt','UserProfileSection','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','UserVoiceQueueRt','isNil','all','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','createdAt','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x375c12,_0x5abc2f){var _0x443cad=function(_0x48d9c7){while(--_0x48d9c7){_0x375c12['push'](_0x375c12['shift']());}};_0x443cad(++_0x5abc2f);}(_0x326f,0xd1));var _0xf326=function(_0x567513,_0x358d59){_0x567513=_0x567513-0x0;var _0x45b034=_0x326f[_0x567513];return _0x45b034;};'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'];config[_0xf326('0x17')]=_[_0xf326('0x18')](config['redis'],{'host':_0xf326('0x19'),'port':0x18eb});var socket=require(_0xf326('0x1a'))(new Redis(config[_0xf326('0x17')]));require(_0xf326('0x1b'))['register'](socket);function respondWithStatusCode(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xcc;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1c')](_0x5204ee);}return _0x45c1b6[_0xf326('0x1d')](_0x5204ee)[_0xf326('0x1e')]();};}function respondWithResult(_0xa63d1a,_0x292f4b){_0x292f4b=_0x292f4b||0xc8;return function(_0x287a2a){if(_0x287a2a){return _0xa63d1a[_0xf326('0x1d')](_0x292f4b)[_0xf326('0x1f')](_0x287a2a);}};}function respondWithFilteredResult(_0x5a682a,_0x3ad7da){return function(_0x453100){if(_0x453100){var _0x18bee3=typeof _0x3ad7da[_0xf326('0x20')]===_0xf326('0x21')&&typeof _0x3ad7da[_0xf326('0x22')]==='undefined';var _0x4a5b6c=_0x453100['count'];var _0x16e605=_0x18bee3?0x0:_0x3ad7da[_0xf326('0x20')];var _0x484cbe=_0x18bee3?_0x453100['count']:_0x3ad7da[_0xf326('0x20')]+_0x3ad7da['limit'];var _0x5b6d3c;if(_0x484cbe>=_0x4a5b6c){_0x484cbe=_0x4a5b6c;_0x5b6d3c=0xc8;}else{_0x5b6d3c=0xce;}_0x5a682a[_0xf326('0x1d')](_0x5b6d3c);return _0x5a682a[_0xf326('0x23')]('Content-Range',_0x16e605+'-'+_0x484cbe+'/'+_0x4a5b6c)['json'](_0x453100);}return null;};}function patchUpdates(_0x19b8ba){return function(_0xb1efcf){try{jsonpatch['apply'](_0xb1efcf,_0x19b8ba,!![]);}catch(_0x337ed5){return BPromise[_0xf326('0x24')](_0x337ed5);}return _0xb1efcf[_0xf326('0x25')]();};}function saveUpdates(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['update'](_0x295752)['then'](function(_0x4f31f6){return _0x4f31f6;});}return null;};}function removeEntity(_0x520d85,_0x1a2c4e){return function(_0x2cd45a){if(_0x2cd45a){return _0x2cd45a[_0xf326('0x26')]()[_0xf326('0x27')](function(){var _0x410237=_0x2cd45a['get']({'plain':!![]});var _0x201d28=[{'name':_0xf326('0x28'),'value':_0xf326('0x29'),'ignore':![]},{'name':'QueueCampaigns','value':_0xf326('0x2a'),'ignore':![]}];var _0x55ad0f=_(_0x201d28)['filter'](_0xf326('0x2b'))[_0xf326('0x2c')](_0xf326('0x2d'))['value']();if(_[_0xf326('0x2e')](_0x55ad0f,_0x410237[_0xf326('0x2f')])){return;}var _0x55790d=_[_0xf326('0x30')](_0x201d28,[_0xf326('0x2d'),_0x410237[_0xf326('0x2f')]])[_0xf326('0x31')];return db[_0xf326('0x32')][_0xf326('0x26')]({'where':{'type':_0x55790d,'resourceId':_0x410237['id']}})[_0xf326('0x27')](function(){return _0x2cd45a;});})[_0xf326('0x27')](function(){_0x520d85[_0xf326('0x1d')](0xcc)[_0xf326('0x1e')]();});}};}function handleEntityNotFound(_0x4b52f2,_0x1035ed){return function(_0x424104){if(!_0x424104){_0x4b52f2[_0xf326('0x1c')](0x194);}return _0x424104;};}function handleError(_0x4792d2,_0x2c0cac){_0x2c0cac=_0x2c0cac||0x1f4;return function(_0x1721fd){logger[_0xf326('0x33')](_0x1721fd['stack']);if(_0x1721fd['name']){delete _0x1721fd[_0xf326('0x31')];}_0x4792d2[_0xf326('0x1d')](_0x2c0cac)[_0xf326('0x34')](_0x1721fd);};}exports[_0xf326('0x35')]=function(_0x30694f,_0x2e8a64){var _0x62585a={},_0x2d5f20={},_0x580374={'count':0x0,'rows':[]};var _0x461e93=_[_0xf326('0x2c')](db['VoiceQueue'][_0xf326('0x36')],function(_0x4e5d7c){return{'name':_0x4e5d7c[_0xf326('0x37')],'type':_0x4e5d7c['type']['key']};});_0x2d5f20[_0xf326('0x38')]=_['map'](_0x461e93,_0xf326('0x31'));_0x2d5f20['query']=_[_0xf326('0x39')](_0x30694f[_0xf326('0x3a')]);_0x2d5f20[_0xf326('0x3b')]=_['intersection'](_0x2d5f20[_0xf326('0x38')],_0x2d5f20[_0xf326('0x3a')]);_0x62585a['attributes']=_[_0xf326('0x3c')](_0x2d5f20[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x30694f[_0xf326('0x3a')]['fields']));_0x62585a[_0xf326('0x3e')]=_0x62585a[_0xf326('0x3e')][_0xf326('0x3f')]?_0x62585a[_0xf326('0x3e')]:_0x2d5f20[_0xf326('0x38')];if(!_0x30694f['query'][_0xf326('0x40')](_0xf326('0x41'))){_0x62585a['limit']=qs['limit'](_0x30694f[_0xf326('0x3a')]['limit']);_0x62585a['offset']=qs[_0xf326('0x20')](_0x30694f['query'][_0xf326('0x20')]);}_0x62585a[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x30694f[_0xf326('0x3a')]['sort']);_0x62585a[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x30694f[_0xf326('0x3a')],_0x2d5f20[_0xf326('0x3b')]),_0x461e93);if(_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]){_0x62585a[_0xf326('0x44')]=_[_0xf326('0x47')](_0x62585a[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x461e93,function(_0x2bab13){if(_0x2bab13['type']!==_0xf326('0x48')){var _0x1637dc={};_0x1637dc[_0x2bab13[_0xf326('0x31')]]={'$like':'%'+_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1637dc;}})});}_0x62585a=_[_0xf326('0x47')]({},_0x62585a,_0x30694f['options']);var _0x28e2d3={'where':_0x62585a[_0xf326('0x44')]};return db['VoiceQueue'][_0xf326('0x49')](_0x28e2d3)[_0xf326('0x27')](function(_0x130c56){_0x580374[_0xf326('0x49')]=_0x130c56;if(_0x30694f[_0xf326('0x3a')]['includeAll']){_0x62585a['include']=[{'all':!![]}];}return db[_0xf326('0x4a')][_0xf326('0x4b')](_0x62585a);})['then'](function(_0x4bd865){_0x580374[_0xf326('0x4c')]=_0x4bd865;return _0x580374;})[_0xf326('0x27')](respondWithFilteredResult(_0x2e8a64,_0x62585a))[_0xf326('0x4d')](handleError(_0x2e8a64,null));};exports['show']=function(_0x301e65,_0xe96e1e){var _0x2180d6={'raw':![],'where':{'id':_0x301e65[_0xf326('0x4e')]['id']}},_0xc43507={};_0xc43507[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xc43507[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x301e65[_0xf326('0x3a')]);_0xc43507[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],_0xc43507['query']);_0x2180d6[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x301e65['query'][_0xf326('0x3d')]));_0x2180d6[_0xf326('0x3e')]=_0x2180d6[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2180d6['attributes']:_0xc43507[_0xf326('0x38')];if(_0x301e65[_0xf326('0x3a')][_0xf326('0x4f')]){_0x2180d6[_0xf326('0x50')]=[{'all':!![]}];}_0x2180d6=_[_0xf326('0x47')]({},_0x2180d6,_0x301e65['options']);return db['VoiceQueue'][_0xf326('0x30')](_0x2180d6)[_0xf326('0x27')](handleEntityNotFound(_0xe96e1e,null))[_0xf326('0x27')](respondWithResult(_0xe96e1e,null))['catch'](handleError(_0xe96e1e,null));};exports[_0xf326('0x51')]=function(_0x4650db,_0x44eab7){return db['VoiceQueue']['create'](_0x4650db[_0xf326('0x52')],{})['then'](function(_0x1cf58f){var _0x554277=_0x4650db[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x554277)throw new Error(_0xf326('0x55'));if(_0x554277[_0xf326('0x56')]===_0xf326('0x53')){var _0x35d3c8=_0x1cf58f[_0xf326('0x54')]({'plain':!![]});var _0x495a16=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':'outbound'}];var _0x208ba4=_[_0xf326('0x30')](_0x495a16,[_0xf326('0x2d'),_0x35d3c8[_0xf326('0x2f')]])[_0xf326('0x31')];return db['UserProfileSection'][_0xf326('0x30')]({'where':{'name':_0x208ba4,'userProfileId':_0x554277[_0xf326('0x58')]},'raw':!![]})[_0xf326('0x27')](function(_0x46a21f){if(_0x46a21f&&_0x46a21f['autoAssociation']===0x0){return db[_0xf326('0x32')][_0xf326('0x51')]({'name':_0x35d3c8[_0xf326('0x31')],'resourceId':_0x35d3c8['id'],'type':_0x46a21f[_0xf326('0x31')],'sectionId':_0x46a21f['id']},{})['then'](function(){return _0x1cf58f;});}else{return _0x1cf58f;}})['catch'](function(_0x18b46e){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18b46e);throw _0x18b46e;});}return _0x1cf58f;})[_0xf326('0x27')](respondWithResult(_0x44eab7,0xc9))[_0xf326('0x4d')](handleError(_0x44eab7,null));};exports[_0xf326('0x59')]=function(_0x1258d1,_0x5765b0){var _0xb1c18c={'where':{'id':_0x1258d1['params']['id']}},_0x5657b7={};_0x5657b7[_0xf326('0x38')]=_['keys'](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xb1c18c[_0xf326('0x3e')]=_['intersection'](_0x5657b7['model'],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x3a')][_0xf326('0x3d')]));_0xb1c18c['attributes']=_0xb1c18c[_0xf326('0x3e')]['length']?_0xb1c18c[_0xf326('0x3e')]:_0x5657b7[_0xf326('0x38')];if(_0x1258d1[_0xf326('0x3a')][_0xf326('0x4f')]){_0xb1c18c[_0xf326('0x50')]=[{'all':!![]}];}_0xb1c18c=_[_0xf326('0x47')]({},_0xb1c18c,_0x1258d1[_0xf326('0x5a')]);return db[_0xf326('0x4a')][_0xf326('0x30')](_0xb1c18c)[_0xf326('0x27')](handleEntityNotFound(_0x5765b0,null))[_0xf326('0x27')](function(_0x1e56fb){if(_0x1e56fb){var _0x40f7cb=_0x1e56fb['get']({'plain':!![]});_0x40f7cb=qs[_0xf326('0x5b')](_0x40f7cb,['id','createdAt',_0xf326('0x5c')]);_0x1258d1[_0xf326('0x52')]=_['omit'](_0x1258d1[_0xf326('0x52')],['id','createdAt',_0xf326('0x5c')]);return db[_0xf326('0x4a')][_0xf326('0x51')](_[_0xf326('0x47')](_0x40f7cb,_0x1258d1[_0xf326('0x52')]),{'include':_0x1258d1['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf326('0x27')](function(_0x32fe3a){var _0x15a538=_0x1258d1[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x15a538)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a538[_0xf326('0x56')]===_0xf326('0x53')){var _0x4aadc9=_0x32fe3a['get']({'plain':!![]});var _0x5b25ca=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':_0xf326('0x2a')}];var _0x240ce5=_[_0xf326('0x30')](_0x5b25ca,[_0xf326('0x2d'),_0x4aadc9['type']])[_0xf326('0x31')];return db[_0xf326('0x5d')][_0xf326('0x30')]({'where':{'name':_0x240ce5,'userProfileId':_0x15a538[_0xf326('0x58')]},'raw':!![]})['then'](function(_0x3717fe){if(_0x3717fe&&_0x3717fe['autoAssociation']===0x0){return db['UserProfileResource'][_0xf326('0x51')]({'name':_0x4aadc9['name'],'resourceId':_0x4aadc9['id'],'type':_0x3717fe[_0xf326('0x31')],'sectionId':_0x3717fe['id']},{})[_0xf326('0x27')](function(){return _0x32fe3a;});}else{return _0x32fe3a;}})[_0xf326('0x4d')](function(_0x2ea5a2){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea5a2);throw _0x2ea5a2;});}return _0x32fe3a;});}})['then'](respondWithResult(_0x5765b0,0xc9))['catch'](handleError(_0x5765b0,null));};exports[_0xf326('0x5e')]=function(_0x307441,_0x229a34){if(_0x307441[_0xf326('0x52')]['id']){delete _0x307441[_0xf326('0x52')]['id'];}return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x307441[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x229a34,null))['then'](saveUpdates(_0x307441['body'],null))[_0xf326('0x27')](respondWithResult(_0x229a34,null))[_0xf326('0x4d')](handleError(_0x229a34,null));};exports['destroy']=function(_0x4bf1bf,_0x2497fd){return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x4bf1bf['params']['id']}})['then'](handleEntityNotFound(_0x2497fd,null))['then'](removeEntity(_0x2497fd,null))[_0xf326('0x4d')](handleError(_0x2497fd,null));};exports[_0xf326('0x5f')]=function(_0xd44071,_0x4838d5,_0x1cf9a8){var _0xdeceb9={'raw':![],'where':{}};var _0x35e34d={};var _0x457f3d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0xd44071[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4838d5,null))[_0xf326('0x27')](function(_0x5290da){if(_0x5290da){_0x35e34d[_0xf326('0x38')]=_['keys'](db[_0xf326('0x61')][_0xf326('0x36')]);_0x35e34d[_0xf326('0x3a')]=_['keys'](_0xd44071[_0xf326('0x3a')]);_0x35e34d[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x35e34d['model'],_0x35e34d[_0xf326('0x3a')]);_0xdeceb9[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x35e34d[_0xf326('0x38')],qs['fields'](_0xd44071[_0xf326('0x3a')]['fields']));_0xdeceb9['attributes']=_0xdeceb9[_0xf326('0x3e')][_0xf326('0x3f')]?_0xdeceb9['attributes']:_0x35e34d['model'];if(!_0xd44071['query'][_0xf326('0x40')]('nolimit')){_0xdeceb9[_0xf326('0x22')]=qs[_0xf326('0x22')](_0xd44071[_0xf326('0x3a')][_0xf326('0x22')]);_0xdeceb9[_0xf326('0x20')]=qs[_0xf326('0x20')](_0xd44071['query'][_0xf326('0x20')]);}_0xdeceb9[_0xf326('0x42')]=qs['sort'](_0xd44071['query'][_0xf326('0x43')]);_0xdeceb9['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0xd44071[_0xf326('0x3a')],_0x35e34d[_0xf326('0x3b')]));_0xdeceb9[_0xf326('0x44')][_0xf326('0x62')]=_0x5290da['id'];if(_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]){_0xdeceb9[_0xf326('0x44')]=_['merge'](_0xdeceb9[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xdeceb9['attributes'],function(_0x3c82cf){var _0x5b0f2d={};_0x5b0f2d[_0x3c82cf]={'$like':'%'+_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5b0f2d;})});}_0xdeceb9=_[_0xf326('0x47')]({},_0xdeceb9,_0xd44071['options']);return db[_0xf326('0x61')][_0xf326('0x49')]({'where':_0xdeceb9[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x30e096){_0x457f3d[_0xf326('0x49')]=_0x30e096;if(_0xd44071[_0xf326('0x3a')][_0xf326('0x4f')]){_0xdeceb9[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x61')][_0xf326('0x4b')](_0xdeceb9);})[_0xf326('0x27')](function(_0x452e28){_0x457f3d[_0xf326('0x4c')]=_0x452e28;return _0x457f3d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4838d5,_0xdeceb9))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x63')]=function(_0x24aaca,_0x4829ae,_0x438daa){var _0x424be4={'raw':!![],'where':{}};var _0x5c1686={};var _0x80fce5={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x24aaca[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4829ae,null))[_0xf326('0x27')](function(_0x1bb7cc){if(_0x1bb7cc){_0x5c1686['model']=_[_0xf326('0x39')](db[_0xf326('0x64')][_0xf326('0x36')]);_0x5c1686[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x24aaca[_0xf326('0x3a')]);_0x5c1686[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5c1686['model'],_0x5c1686[_0xf326('0x3a')]);_0x424be4[_0xf326('0x3e')]=_['intersection'](_0x5c1686[_0xf326('0x38')],qs['fields'](_0x24aaca[_0xf326('0x3a')][_0xf326('0x3d')]));_0x424be4[_0xf326('0x3e')]=_0x424be4[_0xf326('0x3e')][_0xf326('0x3f')]?_0x424be4[_0xf326('0x3e')]:_0x5c1686[_0xf326('0x38')];if(!_0x24aaca[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x424be4[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x22')]);_0x424be4['offset']=qs[_0xf326('0x20')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x20')]);}_0x424be4[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x24aaca['query'][_0xf326('0x43')]);_0x424be4[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x24aaca[_0xf326('0x3a')],_0x5c1686['filters']));_0x424be4['where'][_0xf326('0x62')]=_0x1bb7cc['id'];if(_0x24aaca['query'][_0xf326('0x46')]){_0x424be4[_0xf326('0x44')]=_[_0xf326('0x47')](_0x424be4['where'],{'$or':_['map'](_0x424be4[_0xf326('0x3e')],function(_0x2d92e4){var _0x167ac9={};_0x167ac9[_0x2d92e4]={'$like':'%'+_0x24aaca[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x167ac9;})});}_0x424be4=_['merge']({},_0x424be4,_0x24aaca[_0xf326('0x5a')]);return db[_0xf326('0x64')][_0xf326('0x49')]({'where':_0x424be4['where']})['then'](function(_0x47a35b){_0x80fce5[_0xf326('0x49')]=_0x47a35b;if(_0x24aaca[_0xf326('0x3a')][_0xf326('0x4f')]){_0x424be4[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x64')][_0xf326('0x4b')](_0x424be4);})[_0xf326('0x27')](function(_0x598a93){_0x80fce5['rows']=_0x598a93;return _0x80fce5;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4829ae,_0x424be4))[_0xf326('0x4d')](handleError(_0x4829ae,null));};exports[_0xf326('0x65')]=function(_0x571b8c,_0xd85b34,_0x39bdde){var _0x1746af={'raw':!![],'where':{}};var _0x597005={};var _0x39d16d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x571b8c[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd85b34,null))['then'](function(_0x5a7af3){if(_0x5a7af3){_0x597005[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x66')]['rawAttributes']);_0x597005[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x571b8c[_0xf326('0x3a')]);_0x597005['filters']=_[_0xf326('0x3c')](_0x597005[_0xf326('0x38')],_0x597005[_0xf326('0x3a')]);_0x1746af[_0xf326('0x3e')]=_['intersection'](_0x597005[_0xf326('0x38')],qs['fields'](_0x571b8c[_0xf326('0x3a')][_0xf326('0x3d')]));_0x1746af[_0xf326('0x3e')]=_0x1746af[_0xf326('0x3e')]['length']?_0x1746af[_0xf326('0x3e')]:_0x597005['model'];if(!_0x571b8c[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x1746af[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x571b8c['query']['limit']);_0x1746af[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x571b8c[_0xf326('0x3a')][_0xf326('0x20')]);}_0x1746af['order']=qs[_0xf326('0x43')](_0x571b8c['query'][_0xf326('0x43')]);_0x1746af[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x571b8c[_0xf326('0x3a')],_0x597005[_0xf326('0x3b')]));_0x1746af[_0xf326('0x44')][_0xf326('0x62')]=_0x5a7af3['id'];if(_0x571b8c[_0xf326('0x3a')]['filter']){_0x1746af[_0xf326('0x44')]=_[_0xf326('0x47')](_0x1746af['where'],{'$or':_[_0xf326('0x2c')](_0x1746af[_0xf326('0x3e')],function(_0x306fc9){var _0x6dad26={};_0x6dad26[_0x306fc9]={'$like':'%'+_0x571b8c['query']['filter']+'%'};return _0x6dad26;})});}_0x1746af=_[_0xf326('0x47')]({},_0x1746af,_0x571b8c[_0xf326('0x5a')]);return db['CmHopperFinal'][_0xf326('0x49')]({'where':_0x1746af['where']})['then'](function(_0x4cad0){_0x39d16d[_0xf326('0x49')]=_0x4cad0;if(_0x571b8c[_0xf326('0x3a')][_0xf326('0x4f')]){_0x1746af[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x66')][_0xf326('0x4b')](_0x1746af);})[_0xf326('0x27')](function(_0xc9dead){_0x39d16d['rows']=_0xc9dead;return _0x39d16d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0xd85b34,_0x1746af))[_0xf326('0x4d')](handleError(_0xd85b34,null));};exports[_0xf326('0x67')]=function(_0x1c7f81,_0x59d894,_0x3e6a5d){var _0x20020c={'raw':!![],'where':{}};var _0xc94723={};var _0x750d55={'count':0x0,'rows':[]};return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1c7f81[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59d894,null))[_0xf326('0x27')](function(_0x14d255){if(_0x14d255){_0xc94723[_0xf326('0x38')]=_[_0xf326('0x39')](db['CmHopperBlack'][_0xf326('0x36')]);_0xc94723[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x1c7f81['query']);_0xc94723[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],_0xc94723[_0xf326('0x3a')]);_0x20020c['attributes']=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1c7f81[_0xf326('0x3a')]['fields']));_0x20020c[_0xf326('0x3e')]=_0x20020c[_0xf326('0x3e')][_0xf326('0x3f')]?_0x20020c['attributes']:_0xc94723[_0xf326('0x38')];if(!_0x1c7f81[_0xf326('0x3a')]['hasOwnProperty'](_0xf326('0x41'))){_0x20020c[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x22')]);_0x20020c[_0xf326('0x20')]=qs['offset'](_0x1c7f81['query'][_0xf326('0x20')]);}_0x20020c[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x43')]);_0x20020c[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1c7f81[_0xf326('0x3a')],_0xc94723[_0xf326('0x3b')]));_0x20020c[_0xf326('0x44')][_0xf326('0x62')]=_0x14d255['id'];if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x46')]){_0x20020c[_0xf326('0x44')]=_[_0xf326('0x47')](_0x20020c['where'],{'$or':_[_0xf326('0x2c')](_0x20020c['attributes'],function(_0x590dc0){var _0x32fc6e={};_0x32fc6e[_0x590dc0]={'$like':'%'+_0x1c7f81['query'][_0xf326('0x46')]+'%'};return _0x32fc6e;})});}_0x20020c=_[_0xf326('0x47')]({},_0x20020c,_0x1c7f81[_0xf326('0x5a')]);return db[_0xf326('0x68')][_0xf326('0x49')]({'where':_0x20020c[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x18b3cc){_0x750d55[_0xf326('0x49')]=_0x18b3cc;if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x4f')]){_0x20020c[_0xf326('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf326('0x4b')](_0x20020c);})[_0xf326('0x27')](function(_0x5657){_0x750d55[_0xf326('0x4c')]=_0x5657;return _0x750d55;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x59d894,_0x20020c))[_0xf326('0x4d')](handleError(_0x59d894,null));};exports[_0xf326('0x69')]=function(_0x5429a2,_0x448d10,_0x15f799){var _0x320ab3={};var _0x316877={};var _0x79faa1;var _0x14259b;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x5429a2[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x448d10,null))[_0xf326('0x27')](function(_0x9a0455){if(_0x9a0455){_0x79faa1=_0x9a0455;_0x316877[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x6a')][_0xf326('0x36')]);_0x316877[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x5429a2[_0xf326('0x3a')]);_0x316877[_0xf326('0x3b')]=_['intersection'](_0x316877[_0xf326('0x38')],_0x316877[_0xf326('0x3a')]);_0x320ab3[_0xf326('0x3e')]=_['intersection'](_0x316877['model'],qs[_0xf326('0x3d')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x3d')]));_0x320ab3[_0xf326('0x3e')]=_0x320ab3['attributes'][_0xf326('0x3f')]?_0x320ab3[_0xf326('0x3e')]:_0x316877[_0xf326('0x38')];_0x320ab3['order']=qs['sort'](_0x5429a2['query'][_0xf326('0x43')]);_0x320ab3[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x5429a2[_0xf326('0x3a')],_0x316877['filters']));if(_0x5429a2[_0xf326('0x3a')]['filter']){_0x320ab3[_0xf326('0x44')]=_[_0xf326('0x47')](_0x320ab3[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x320ab3[_0xf326('0x3e')],function(_0x3dcaf9){var _0x1f05a2={};_0x1f05a2[_0x3dcaf9]={'$like':'%'+_0x5429a2[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1f05a2;})});}_0x320ab3=_[_0xf326('0x47')]({},_0x320ab3,_0x5429a2[_0xf326('0x5a')]);return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})[_0xf326('0x27')](function(_0x3dc3c5){if(_0x3dc3c5){_0x14259b=_0x3dc3c5['length'];if(!_0x5429a2[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x320ab3['limit']=qs['limit'](_0x5429a2['query'][_0xf326('0x22')]);_0x320ab3[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})['then'](function(_0x1aeaf9){if(_0x1aeaf9){return _0x1aeaf9?{'count':_0x14259b,'rows':_0x1aeaf9}:null;}})[_0xf326('0x27')](respondWithResult(_0x448d10,null))[_0xf326('0x4d')](handleError(_0x448d10,null));};exports[_0xf326('0x6b')]=function(_0x71e344,_0x5cac48,_0x10f5cb){var _0x44c4bb=_0x71e344[_0xf326('0x52')][_0xf326('0x6c')];var _0x350d76=_['map'](_0x44c4bb,'id');return db['Team'][_0xf326('0x4b')]({'where':{'id':_0x350d76},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf326('0x31'),_0xf326('0x6d'),_0xf326('0x6e'),_0xf326('0x6f')],'raw':!![]}]})[_0xf326('0x27')](function(_0x5aa1ca){if(_0x5aa1ca){var _0x51bfee=_[_0xf326('0x70')](_0x5aa1ca,function(_0x2eaf15){var _0x182080=_0x2eaf15['get']({'plain':!![]});_0x182080[_0xf326('0x71')]['forEach'](function(_0x4df691){_0x4df691['penalty']=_[_0xf326('0x30')](_0x44c4bb,{'id':_0x182080['id']})[_0xf326('0x72')];});return _0x182080[_0xf326('0x71')];});return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x71e344[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](function(_0x3833f9){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0xb4b180){return _0x3833f9['addTeams'](_0x350d76,{'transaction':_0xb4b180})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x44c4bb,function(_0x2a17bf){return db[_0xf326('0x76')][_0xf326('0x77')]({'TeamId':_0x2a17bf['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id'],'penalty':_0x2a17bf[_0xf326('0x72')]},{'transaction':_0xb4b180});});})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x51bfee,function(_0x4d5f64){return db[_0xf326('0x78')][_0xf326('0x79')]({'where':{'UserId':_0x4d5f64['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id']},'defaults':{'penalty':_0x4d5f64['penalty']},'transaction':_0xb4b180});});})['then'](function(){return BPromise[_0xf326('0x75')](_[_0xf326('0x46')](_0x51bfee,{'online':!![]}),function(_0x5efac6){return db['UserVoiceQueueRt'][_0xf326('0x77')]({'membername':_0x5efac6['name'],'UserId':_0x5efac6['id'],'queue_name':_0x3833f9[_0xf326('0x31')],'VoiceQueueId':_0x3833f9['id'],'interface':_['isNil'](_0x5efac6[_0xf326('0x6f')])?util[_0xf326('0x7a')](_0xf326('0x7b'),_0x5efac6[_0xf326('0x31')]):_0x5efac6[_0xf326('0x6f')],'paused':_0x5efac6['voicePause']||![],'penalty':_0x5efac6[_0xf326('0x72')]},{'transaction':_0xb4b180});});})['then'](function(){_0x51bfee[_0xf326('0x7c')](function(_0x3fe546){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':_0x3fe546['id'],'VoiceQueueId':_0x3833f9['id']});});});});});}})[_0xf326('0x27')](respondWithStatusCode(_0x5cac48,null))['catch'](handleError(_0x5cac48,null));};exports['removeTeams']=function(_0x1ad0df,_0x5c913c,_0x53421f){return db['Team']['findAll']({'where':{'id':_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xf326('0x80')],'as':_0xf326('0x71'),'attributes':['id'],'raw':!![]}]})[_0xf326('0x27')](handleEntityNotFound(_0x5c913c,null))[_0xf326('0x27')](function(_0xc5d45e){var _0x4feb3e=_[_0xf326('0x2c')](_0xc5d45e,'id');var _0x3e0bf4=[];var _0x72c3ed=[];var _0x4abe8a=squel[_0xf326('0x81')]();_0x4abe8a[_0xf326('0x82')](_0xf326('0x83'))[_0xf326('0x84')](_0xf326('0x85'),'tq')[_0xf326('0x86')](_0xf326('0x87'),'ut',_0xf326('0x88'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1ad0df[_0xf326('0x4e')]['id']);for(var _0x5e9650=0x0;_0x5e9650<_0xc5d45e[_0xf326('0x3f')];_0x5e9650+=0x1){let _0x500780=_0xc5d45e[_0x5e9650];for(var _0x4b537a=0x0;_0x4b537a<_0x500780[_0xf326('0x71')]['length'];_0x4b537a+=0x1){let _0x3edec1=_0x500780[_0xf326('0x71')][_0x4b537a];var _0x3dfa46=_0x4abe8a[_0xf326('0x59')]();_0x3dfa46['where'](_0xf326('0x89'),_0x3edec1['id']);_0x72c3ed[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x3dfa46['toString'](),{'type':db['sequelize'][_0xf326('0x8b')][_0xf326('0x8c')]})[_0xf326('0x27')](function(_0x160086){if(_0x160086[_0xf326('0x3f')]===0x1){return _0x3edec1['id'];}else{var _0x1acd3b=_[_0xf326('0x8d')](_[_0xf326('0x2c')](_0x160086,_0xf326('0x8e')),function(_0xa5963a){return _[_0xf326('0x2e')](_0x4feb3e,_0xa5963a);});if(_0x1acd3b){return _0x3edec1['id'];}}}));}}return BPromise['all'](_0x72c3ed)[_0xf326('0x27')](function(_0x303b42){_0x3e0bf4=_(_0x3e0bf4)[_0xf326('0x8f')](_0x303b42)['compact']()[_0xf326('0x2d')]();return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x1ad0df[_0xf326('0x4e')]['id']}})['then'](function(_0x1b6d24){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0x2d861a){return _0x1b6d24['removeTeams'](_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')],{'transaction':_0x2d861a})[_0xf326('0x27')](function(){if(!_[_0xf326('0x90')](_0x3e0bf4)){return _0x1b6d24[_0xf326('0x91')](_0x3e0bf4,{'transaction':_0x2d861a})['then'](function(){return db['UserVoiceQueueRt'][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x1ad0df[_0xf326('0x4e')]['id'],'UserId':_0x3e0bf4},'transaction':_0x2d861a});});}})[_0xf326('0x27')](function(){_0x3e0bf4[_0xf326('0x7c')](function(_0x42c8de){socket[_0xf326('0x7d')](_0xf326('0x92'),{'UserId':_0x42c8de,'VoiceQueueId':_0x1b6d24['id']});});});});});});})[_0xf326('0x27')](respondWithStatusCode(_0x5c913c,null))[_0xf326('0x4d')](handleError(_0x5c913c,null));};exports[_0xf326('0x93')]=function(_0x55d67f,_0x550bda,_0x4f14ff){var _0x8fccef,_0x190d3c;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x55d67f[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x550bda,null))[_0xf326('0x27')](function(_0xc94f1e){if(_0xc94f1e){_0x190d3c=_0xc94f1e;return _0xc94f1e[_0xf326('0x93')](_0x55d67f[_0xf326('0x52')]['ids'],_[_0xf326('0x5b')](_0x55d67f['body'],['ids','id'])||{})[_0xf326('0x94')](function(_0x2a9fd1){for(var _0x4086fa=0x0;_0x4086fa<_0x55d67f[_0xf326('0x52')][_0xf326('0x7f')]['length'];_0x4086fa+=0x1){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':Number(_0x55d67f[_0xf326('0x52')]['ids'][_0x4086fa]),'VoiceQueueId':Number(_0x55d67f[_0xf326('0x4e')]['id'])});}return _0x2a9fd1;});}})[_0xf326('0x27')](function(_0x38dbf3){_0x8fccef=_0x38dbf3||[];if(_0x190d3c){return db[_0xf326('0x80')]['findAll']({'where':{'id':_0x55d67f[_0xf326('0x52')]['ids']},'attributes':['id','name',_0xf326('0x6d'),'voicePause','interface'],'raw':!![]});}})[_0xf326('0x27')](function(_0xbd7671){if(!_[_0xf326('0x90')](_0xbd7671)){var _0x1d2611=[];for(var _0x497d2e=0x0;_0x497d2e<_0xbd7671['length'];_0x497d2e++){if(_0xbd7671[_0x497d2e][_0xf326('0x6d')]){_0x1d2611[_0xf326('0x8a')](db[_0xf326('0x95')][_0xf326('0x77')]({'membername':_0xbd7671[_0x497d2e][_0xf326('0x31')],'UserId':_0xbd7671[_0x497d2e]['id'],'queue_name':_0x190d3c[_0xf326('0x31')],'VoiceQueueId':_0x190d3c['id'],'interface':_[_0xf326('0x96')](_0xbd7671[_0x497d2e][_0xf326('0x6f')])?util[_0xf326('0x7a')]('SIP/%s',_0xbd7671[_0x497d2e][_0xf326('0x31')]):_0xbd7671[_0x497d2e][_0xf326('0x6f')],'paused':_0xbd7671[_0x497d2e][_0xf326('0x6e')]||![],'penalty':_0x55d67f['body']['penalty']||0x0}));}}return BPromise[_0xf326('0x97')](_0x1d2611);}})[_0xf326('0x27')](function(){return _0x8fccef;})[_0xf326('0x27')](respondWithResult(_0x550bda,null))[_0xf326('0x4d')](handleError(_0x550bda,null));};exports['removeAgents']=function(_0x4f96aa,_0x5ea5d4,_0x45aae6){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x4f96aa['params']['id']}})['then'](handleEntityNotFound(_0x5ea5d4,null))[_0xf326('0x27')](function(_0x15c66f){if(_0x15c66f){return _0x15c66f[_0xf326('0x91')](_0x4f96aa['query']['ids'])['then'](function(){if(_[_0xf326('0x98')](_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')])){for(var _0x1791dd=0x0;_0x1791dd<_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')][_0xf326('0x3f')];_0x1791dd+=0x1){socket[_0xf326('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x4f96aa['query'][_0xf326('0x7f')][_0x1791dd]),'VoiceQueueId':Number(_0x4f96aa['params']['id'])});}}else{socket['emit'](_0xf326('0x92'),{'UserId':Number(_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]),'VoiceQueueId':Number(_0x4f96aa[_0xf326('0x4e')]['id'])});}});}})[_0xf326('0x27')](function(_0x1307a4){return db[_0xf326('0x95')][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x4f96aa[_0xf326('0x4e')]['id'],'UserId':_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]}})[_0xf326('0x27')](function(){return _0x1307a4;});})['then'](respondWithStatusCode(_0x5ea5d4,null))[_0xf326('0x4d')](handleError(_0x5ea5d4,null));};exports[_0xf326('0x99')]=function(_0x2b6585,_0x3d77af,_0x55e867){var _0x15e405={};var _0x27074a={};var _0x173ea9;var _0x130cbb;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x2b6585[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x3d77af,null))[_0xf326('0x27')](function(_0x28d251){if(_0x28d251){_0x173ea9=_0x28d251;_0x27074a[_0xf326('0x38')]=_['keys'](db['User'][_0xf326('0x36')]);_0x27074a[_0xf326('0x3a')]=_['keys'](_0x2b6585[_0xf326('0x3a')]);_0x27074a[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x27074a[_0xf326('0x38')],_0x27074a['query']);_0x15e405[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x27074a['model'],qs[_0xf326('0x3d')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x3d')]));_0x15e405[_0xf326('0x3e')]=_0x15e405[_0xf326('0x3e')][_0xf326('0x3f')]?_0x15e405[_0xf326('0x3e')]:_0x27074a[_0xf326('0x38')];_0x15e405[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x2b6585[_0xf326('0x3a')]['sort']);_0x15e405[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x2b6585[_0xf326('0x3a')],_0x27074a[_0xf326('0x3b')]));if(_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]){_0x15e405[_0xf326('0x44')]=_['merge'](_0x15e405[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x15e405[_0xf326('0x3e')],function(_0x12cc1d){var _0x5ae8c7={};_0x5ae8c7[_0x12cc1d]={'$like':'%'+_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5ae8c7;})});}_0x15e405=_[_0xf326('0x47')]({},_0x15e405,_0x2b6585['options']);return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x5a0c11){if(_0x5a0c11){_0x130cbb=_0x5a0c11['length'];if(!_0x2b6585[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x15e405[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x22')]);_0x15e405[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x4a0a44){if(_0x4a0a44){return _0x4a0a44?{'count':_0x130cbb,'rows':_0x4a0a44}:null;}})['then'](respondWithResult(_0x3d77af,null))[_0xf326('0x4d')](handleError(_0x3d77af,null));};exports['getMembers']=function(_0x4ab9c0,_0x531d31,_0x878991){var _0xc4aa47={};var _0x4fa6f9={};var _0x17f967;var _0x1639f2;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x4ab9c0[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x531d31,null))['then'](function(_0x38ff4d){if(_0x38ff4d){_0x17f967=_0x38ff4d;_0x4fa6f9[_0xf326('0x38')]=_['keys'](db[_0xf326('0x95')][_0xf326('0x36')]);_0x4fa6f9[_0xf326('0x3a')]=_['keys'](_0x4ab9c0[_0xf326('0x3a')]);_0x4fa6f9[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],_0x4fa6f9[_0xf326('0x3a')]);_0xc4aa47['attributes']=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],qs['fields'](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x3d')]));_0xc4aa47[_0xf326('0x3e')]=_0xc4aa47['attributes']['length']?_0xc4aa47[_0xf326('0x3e')]:_0x4fa6f9[_0xf326('0x38')];_0xc4aa47['order']=qs[_0xf326('0x43')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x43')]);_0xc4aa47[_0xf326('0x44')]=qs['filters'](_['pick'](_0x4ab9c0[_0xf326('0x3a')],_0x4fa6f9[_0xf326('0x3b')]));if(_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]){_0xc4aa47[_0xf326('0x44')]=_[_0xf326('0x47')](_0xc4aa47[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xc4aa47['attributes'],function(_0x511e66){var _0x5d719a={};_0x5d719a[_0x511e66]={'$like':'%'+_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5d719a;})});}_0xc4aa47=_[_0xf326('0x47')]({},_0xc4aa47,_0x4ab9c0['options']);return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})[_0xf326('0x27')](function(_0x30247a){if(_0x30247a){_0x1639f2=_0x30247a[_0xf326('0x3f')];if(!_0x4ab9c0['query']['hasOwnProperty'](_0xf326('0x41'))){_0xc4aa47[_0xf326('0x22')]=qs['limit'](_0x4ab9c0['query'][_0xf326('0x22')]);_0xc4aa47[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})['then'](function(_0xb17fae){return _0xb17fae?{'count':_0x1639f2,'rows':_0xb17fae}:null;})[_0xf326('0x27')](respondWithResult(_0x531d31,null))['catch'](handleError(_0x531d31,null));};exports['getLists']=function(_0x371e52,_0x6a202f,_0x250682){var _0x4069bb={};var _0x1ea2be={};var _0x663019;var _0x2549ab;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x371e52[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x6a202f,null))[_0xf326('0x27')](function(_0x58fdca){if(_0x58fdca){_0x663019=_0x58fdca;_0x1ea2be[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x9b')][_0xf326('0x36')]);_0x1ea2be['query']=_['keys'](_0x371e52[_0xf326('0x3a')]);_0x1ea2be['filters']=_[_0xf326('0x3c')](_0x1ea2be[_0xf326('0x38')],_0x1ea2be[_0xf326('0x3a')]);_0x4069bb['attributes']=_[_0xf326('0x3c')](_0x1ea2be['model'],qs['fields'](_0x371e52['query'][_0xf326('0x3d')]));_0x4069bb['attributes']=_0x4069bb[_0xf326('0x3e')][_0xf326('0x3f')]?_0x4069bb[_0xf326('0x3e')]:_0x1ea2be[_0xf326('0x38')];_0x4069bb[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x371e52[_0xf326('0x3a')]['sort']);_0x4069bb['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x371e52[_0xf326('0x3a')],_0x1ea2be[_0xf326('0x3b')]));if(_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]){_0x4069bb['where']=_[_0xf326('0x47')](_0x4069bb['where'],{'$or':_[_0xf326('0x2c')](_0x4069bb[_0xf326('0x3e')],function(_0x5ba7ef){var _0x2671d5={};_0x2671d5[_0x5ba7ef]={'$like':'%'+_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x2671d5;})});}_0x4069bb=_[_0xf326('0x47')]({},_0x4069bb,_0x371e52[_0xf326('0x5a')]);return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x55d9bd){if(_0x55d9bd){_0x2549ab=_0x55d9bd['length'];if(!_0x371e52[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x4069bb[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x371e52[_0xf326('0x3a')][_0xf326('0x22')]);_0x4069bb[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x371e52[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x4c88c2){if(_0x4c88c2){return _0x4c88c2?{'count':_0x2549ab,'rows':_0x4c88c2}:null;}})['then'](respondWithResult(_0x6a202f,null))['catch'](handleError(_0x6a202f,null));};exports[_0xf326('0x9d')]=function(_0x1af709,_0x3fdfc5,_0xf7df13){var _0x45afd7=moment()['format'](_0xf326('0x9e'));var _0x233857,_0xbc39f5;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x1af709[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0xf326('0x27')](function(_0xfa7c63){if(_0xfa7c63){_0xbc39f5=_0xfa7c63;return _0xfa7c63['addLists'](_0x1af709[_0xf326('0x52')][_0xf326('0x7f')],_['omit'](_0x1af709[_0xf326('0x52')],['ids','id'])||{});}return null;})[_0xf326('0x94')](function(_0x24dd16){var _0x4515c1;_0x233857=_0x24dd16||[];var _0x5100ec=[];if(_0x24dd16){for(var _0x293c16=0x0;_0x293c16<_0x24dd16[_0xf326('0x3f')];_0x293c16+=0x1){var _0x28ba7c=_0x24dd16[_0x293c16][_0xf326('0x54')]({'plain':!![]});_0xbc39f5['dialCheckDuplicateType']=_0x1af709[_0xf326('0x52')][_0xf326('0x9f')]?_0x1af709['body'][_0xf326('0x9f')]:_0xbc39f5['dialCheckDuplicateType'];switch(_0xbc39f5['dialCheckDuplicateType']){case _0xf326('0xa0'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),'phone')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c['CmListId'][_0xf326('0xa8')](),_0xf326('0xa9'))['field'](_0x1af709['params']['id'][_0xf326('0xa8')](),_0xf326('0x62'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','updatedAt')[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')]('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xf326('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xf326('0x82')](_0xf326('0xad'))[_0xf326('0x84')](_0xf326('0xae'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709['params']['id'][_0xf326('0xa8')]()))[_0xf326('0x44')](_0xf326('0xb0'),squel[_0xf326('0x81')]()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;case _0xf326('0xb2'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c[_0xf326('0xac')]['toString'](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),_0xf326('0x62'))['field']('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))['where'](_0xf326('0xab'))['where']('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3'))[_0xf326('0x44')](_0xf326('0xb0'),squel['select']()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1af709['params']['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;default:_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb1'))[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')]('phone',_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0xa5'))[_0xf326('0x82')]('id',_0xf326('0xa6'))['field'](_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))['where'](_0xf326('0xb4'),_0x28ba7c[_0xf326('0xac')]['toString']())[_0xf326('0x44')](_0xf326('0xb3')))[_0xf326('0xa8')]();}_0x5100ec[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4515c1));}return BPromise[_0xf326('0x97')](_0x5100ec);}})[_0xf326('0x27')](function(){var _0x122dfe=[];var _0x39a5f8=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb5'))[_0xf326('0xa3')](['CmHopperId',_0xf326('0xa4'),'OrderBy',_0xf326('0xa7'),'updatedAt'],squel[_0xf326('0x81')]()['field'](_0xf326('0xb6'))['field'](_0xf326('0xb7'))['field']('ci.OrderBy+1')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xb8'),'ci')[_0xf326('0x86')](_0xf326('0xb1'),'h',_0xf326('0xb9'))['where']('h.scheduledat=?',_0x45afd7)[_0xf326('0x44')]('ci.ItemClass=?','PHONE'))['toString']();_0x122dfe[_0xf326('0x8a')](db['sequelize']['query'](_0x39a5f8));return BPromise[_0xf326('0x97')](_0x122dfe);})[_0xf326('0x27')](function(){return _0x233857;})['then'](respondWithResult(_0x3fdfc5,null))[_0xf326('0x4d')](handleError(_0x3fdfc5,null));};exports[_0xf326('0xba')]=function(_0x38ee2f,_0x1ea221,_0x4136f9){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ea221,null))[_0xf326('0x27')](function(_0x424360){if(_0x424360){return _0x424360[_0xf326('0xba')](_0x38ee2f[_0xf326('0x3a')][_0xf326('0x7f')]);}})[_0xf326('0x27')](function(_0x35ff4d){if(_0x35ff4d){return db['CmHopper']['destroy']({'where':{'ListId':_0x38ee2f['query'][_0xf326('0x7f')],'VoiceQueueId':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](function(){return _0x35ff4d;});}})['then'](respondWithStatusCode(_0x1ea221,null))['catch'](handleError(_0x1ea221,null));};exports[_0xf326('0xbb')]=function(_0x1d05b3,_0x36d7c2,_0x1afa71){var _0x2a7789={};var _0x5b1d58={};var _0x5785c9;var _0x4ff3b8;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1d05b3['params']['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x36d7c2,null))[_0xf326('0x27')](function(_0x55e8e6){if(_0x55e8e6){_0x5785c9=_0x55e8e6;_0x5b1d58[_0xf326('0x38')]=_['keys'](db[_0xf326('0x9b')]['rawAttributes']);_0x5b1d58[_0xf326('0x3a')]=_['keys'](_0x1d05b3['query']);_0x5b1d58[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5b1d58['model'],_0x5b1d58[_0xf326('0x3a')]);_0x2a7789[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x5b1d58[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x3d')]));_0x2a7789[_0xf326('0x3e')]=_0x2a7789[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2a7789['attributes']:_0x5b1d58[_0xf326('0x38')];_0x2a7789['order']=qs[_0xf326('0x43')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x43')]);_0x2a7789[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1d05b3[_0xf326('0x3a')],_0x5b1d58[_0xf326('0x3b')]));if(_0x1d05b3[_0xf326('0x3a')][_0xf326('0x46')]){_0x2a7789['where']=_['merge'](_0x2a7789['where'],{'$or':_[_0xf326('0x2c')](_0x2a7789['attributes'],function(_0x173bea){var _0x94eaa1={};_0x94eaa1[_0x173bea]={'$like':'%'+_0x1d05b3[_0xf326('0x3a')]['filter']+'%'};return _0x94eaa1;})});}_0x2a7789=_[_0xf326('0x47')]({},_0x2a7789,_0x1d05b3[_0xf326('0x5a')]);return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})['then'](function(_0x5387af){if(_0x5387af){_0x4ff3b8=_0x5387af[_0xf326('0x3f')];if(!_0x1d05b3[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x2a7789['limit']=qs[_0xf326('0x22')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x22')]);_0x2a7789[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})[_0xf326('0x27')](function(_0x595e28){if(_0x595e28){return _0x595e28?{'count':_0x4ff3b8,'rows':_0x595e28}:null;}})['then'](respondWithResult(_0x36d7c2,null))[_0xf326('0x4d')](handleError(_0x36d7c2,null));};exports['addBlackLists']=function(_0x130b92,_0x1e7099,_0x47b04b){var _0x470e90,_0x5d9653;return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x130b92[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x1e7099,null))[_0xf326('0x27')](function(_0x13ba1a){if(_0x13ba1a){_0x5d9653=_0x13ba1a;return _0x13ba1a[_0xf326('0xbc')](_0x130b92['body'][_0xf326('0x7f')],_['omit'](_0x130b92['body'],['ids','id'])||{});}return null;})['spread'](function(_0xb6e17c){var _0x4d19ed;_0x470e90=_0xb6e17c||[];var _0x7c6644=[];if(_0xb6e17c){for(var _0x4eb5d3=0x0;_0x4eb5d3<_0xb6e17c[_0xf326('0x3f')];_0x4eb5d3+=0x1){var _0x4e2160=_0xb6e17c[_0x4eb5d3]['get']({'plain':!![]});_0x4d19ed=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xbd'))[_0xf326('0xa3')](['phone',_0xf326('0xa6'),_0xf326('0xa9'),_0xf326('0x62'),_0xf326('0xa7'),'updatedAt'],squel['select']()['field']('phone',_0xf326('0xa4'))['field']('id','ContactId')[_0xf326('0x82')](_0x4e2160['CmListId']['toString'](),'ListId')[_0xf326('0x82')](_0x130b92['params']['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('NOW()',_0xf326('0xa7'))[_0xf326('0x82')](_0xf326('0xbe'),_0xf326('0x5c'))['from'](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')](_0xf326('0xb4'),_0x4e2160[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3')))['toString']();_0x7c6644['push'](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4d19ed));}return BPromise[_0xf326('0x97')](_0x7c6644);}})[_0xf326('0x27')](function(){return _0x470e90;})[_0xf326('0x27')](respondWithResult(_0x1e7099,null))['catch'](handleError(_0x1e7099,null));};exports[_0xf326('0xbf')]=function(_0x3e715a,_0x5d2dfa,_0x4fa725){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x3e715a[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x5d2dfa,null))[_0xf326('0x27')](function(_0x4c3be5){if(_0x4c3be5){return _0x4c3be5['removeBlackLists'](_0x3e715a[_0xf326('0x3a')][_0xf326('0x7f')]);}})['then'](function(_0x53beb9){if(_0x53beb9){return db[_0xf326('0x68')]['destroy']({'where':{'ListId':_0x3e715a[_0xf326('0x3a')]['ids'],'VoiceQueueId':_0x3e715a[_0xf326('0x4e')]['id']}})['then'](function(){return _0x53beb9;});}})[_0xf326('0x27')](respondWithStatusCode(_0x5d2dfa,null))[_0xf326('0x4d')](handleError(_0x5d2dfa,null));}; \ No newline at end of file +var _0x07d7=['stack','send','index','VoiceQueue','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','params','length','find','body','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','userProfileId','getHoppers','CmHopper','hasOwnProperty','VoiceQueueId','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','isNil','interface','format','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','online','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','spread','dialCheckDuplicateType','always','cm_hopper','scheduledAt','ContactId','ListId','phone','CmListId','updatedAt','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','insert','into','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','fromQuery','OrderBy','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','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','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error'];(function(_0x2bb05f,_0x28b59d){var _0x10b7a9=function(_0x402826){while(--_0x402826){_0x2bb05f['push'](_0x2bb05f['shift']());}};_0x10b7a9(++_0x28b59d);}(_0x07d7,0x85));var _0x707d=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x07d7[_0x334fea];return _0x3c5829;};'use strict';var emlformat=require(_0x707d('0x0'));var rimraf=require(_0x707d('0x1'));var zipdir=require(_0x707d('0x2'));var jsonpatch=require(_0x707d('0x3'));var rp=require(_0x707d('0x4'));var moment=require(_0x707d('0x5'));var BPromise=require(_0x707d('0x6'));var Mustache=require(_0x707d('0x7'));var util=require(_0x707d('0x8'));var path=require(_0x707d('0x9'));var sox=require(_0x707d('0xa'));var csv=require(_0x707d('0xb'));var ejs=require(_0x707d('0xc'));var fs=require('fs');var fs_extra=require(_0x707d('0xd'));var _=require(_0x707d('0xe'));var squel=require(_0x707d('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x707d('0x10'));var toCsv=require(_0x707d('0xb'));var querystring=require(_0x707d('0x11'));var Papa=require(_0x707d('0x12'));var Redis=require(_0x707d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x707d('0x14'));var as=require(_0x707d('0x15'));var hardwareService=require(_0x707d('0x16'));var logger=require('../../config/logger')(_0x707d('0x17'));var utils=require(_0x707d('0x18'));var config=require(_0x707d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x707d('0x1a')](config[_0x707d('0x1b')],{'host':_0x707d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x707d('0x1b')]));require('./voiceQueue.socket')[_0x707d('0x1d')](socket);function respondWithStatusCode(_0x42e27f,_0x509ec8){_0x509ec8=_0x509ec8||0xcc;return function(_0x4d598e){if(_0x4d598e){return _0x42e27f[_0x707d('0x1e')](_0x509ec8);}return _0x42e27f['status'](_0x509ec8)[_0x707d('0x1f')]();};}function respondWithResult(_0x2c63c9,_0xeed67d){_0xeed67d=_0xeed67d||0xc8;return function(_0x1f4f0e){if(_0x1f4f0e){return _0x2c63c9[_0x707d('0x20')](_0xeed67d)[_0x707d('0x21')](_0x1f4f0e);}};}function respondWithFilteredResult(_0x318251,_0x50869d){return function(_0x1d3fe6){if(_0x1d3fe6){var _0x275a7b=typeof _0x50869d[_0x707d('0x22')]==='undefined'&&typeof _0x50869d[_0x707d('0x23')]===_0x707d('0x24');var _0xf5375f=_0x1d3fe6[_0x707d('0x25')];var _0x81f93f=_0x275a7b?0x0:_0x50869d[_0x707d('0x22')];var _0xb7171a=_0x275a7b?_0x1d3fe6[_0x707d('0x25')]:_0x50869d[_0x707d('0x22')]+_0x50869d[_0x707d('0x23')];var _0x2da0c0;if(_0xb7171a>=_0xf5375f){_0xb7171a=_0xf5375f;_0x2da0c0=0xc8;}else{_0x2da0c0=0xce;}_0x318251[_0x707d('0x20')](_0x2da0c0);return _0x318251[_0x707d('0x26')](_0x707d('0x27'),_0x81f93f+'-'+_0xb7171a+'/'+_0xf5375f)[_0x707d('0x21')](_0x1d3fe6);}return null;};}function patchUpdates(_0x30d175){return function(_0x1ce813){try{jsonpatch['apply'](_0x1ce813,_0x30d175,!![]);}catch(_0x24ba23){return BPromise['reject'](_0x24ba23);}return _0x1ce813[_0x707d('0x28')]();};}function saveUpdates(_0x139ad5,_0x8810fe){return function(_0x1a5e03){if(_0x1a5e03){return _0x1a5e03[_0x707d('0x29')](_0x139ad5)['then'](function(_0x115e5c){return _0x115e5c;});}return null;};}function removeEntity(_0x5b2db7,_0x3760bb){return function(_0x26741e){if(_0x26741e){return _0x26741e[_0x707d('0x2a')]()[_0x707d('0x2b')](function(){var _0x40551d=_0x26741e[_0x707d('0x2c')]({'plain':!![]});var _0x38b4fe=[{'name':_0x707d('0x2d'),'value':_0x707d('0x2e'),'ignore':![]},{'name':_0x707d('0x2f'),'value':_0x707d('0x30'),'ignore':![]}];var _0x4274e9=_(_0x38b4fe)[_0x707d('0x31')](_0x707d('0x32'))[_0x707d('0x33')](_0x707d('0x34'))['value']();if(_[_0x707d('0x35')](_0x4274e9,_0x40551d[_0x707d('0x36')])){return;}var _0x1784ce=_['find'](_0x38b4fe,['value',_0x40551d['type']])[_0x707d('0x37')];return db[_0x707d('0x38')][_0x707d('0x2a')]({'where':{'type':_0x1784ce,'resourceId':_0x40551d['id']}})[_0x707d('0x2b')](function(){return _0x26741e;});})[_0x707d('0x2b')](function(){_0x5b2db7[_0x707d('0x20')](0xcc)[_0x707d('0x1f')]();});}};}function handleEntityNotFound(_0x3734be,_0xd310cc){return function(_0x43ec7a){if(!_0x43ec7a){_0x3734be[_0x707d('0x1e')](0x194);}return _0x43ec7a;};}function handleError(_0x455841,_0x54a0f3){_0x54a0f3=_0x54a0f3||0x1f4;return function(_0x39bb5f){logger[_0x707d('0x39')](_0x39bb5f[_0x707d('0x3a')]);if(_0x39bb5f[_0x707d('0x37')]){delete _0x39bb5f[_0x707d('0x37')];}_0x455841['status'](_0x54a0f3)[_0x707d('0x3b')](_0x39bb5f);};}exports[_0x707d('0x3c')]=function(_0x4d2051,_0x325bd9){var _0x260b2={},_0x299460={},_0x425e2e={'count':0x0,'rows':[]};var _0x247aa8=_[_0x707d('0x33')](db[_0x707d('0x3d')][_0x707d('0x3e')],function(_0x19e6a7){return{'name':_0x19e6a7['fieldName'],'type':_0x19e6a7[_0x707d('0x36')][_0x707d('0x3f')]};});_0x299460[_0x707d('0x40')]=_[_0x707d('0x33')](_0x247aa8,_0x707d('0x37'));_0x299460['query']=_[_0x707d('0x41')](_0x4d2051[_0x707d('0x42')]);_0x299460[_0x707d('0x43')]=_['intersection'](_0x299460[_0x707d('0x40')],_0x299460['query']);_0x260b2[_0x707d('0x44')]=_[_0x707d('0x45')](_0x299460[_0x707d('0x40')],qs[_0x707d('0x46')](_0x4d2051['query']['fields']));_0x260b2[_0x707d('0x44')]=_0x260b2[_0x707d('0x44')]['length']?_0x260b2['attributes']:_0x299460[_0x707d('0x40')];if(!_0x4d2051['query']['hasOwnProperty'](_0x707d('0x47'))){_0x260b2[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x4d2051[_0x707d('0x42')][_0x707d('0x23')]);_0x260b2['offset']=qs[_0x707d('0x22')](_0x4d2051[_0x707d('0x42')][_0x707d('0x22')]);}_0x260b2[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x4d2051[_0x707d('0x42')][_0x707d('0x49')]);_0x260b2[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x4d2051[_0x707d('0x42')],_0x299460['filters']),_0x247aa8);if(_0x4d2051[_0x707d('0x42')][_0x707d('0x31')]){_0x260b2['where']=_[_0x707d('0x4c')](_0x260b2[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x247aa8,function(_0x8183a9){if(_0x8183a9[_0x707d('0x36')]!=='VIRTUAL'){var _0x1f90af={};_0x1f90af[_0x8183a9[_0x707d('0x37')]]={'$like':'%'+_0x4d2051[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x1f90af;}})});}_0x260b2=_[_0x707d('0x4c')]({},_0x260b2,_0x4d2051[_0x707d('0x4d')]);var _0x93aacd={'where':_0x260b2[_0x707d('0x4a')]};return db[_0x707d('0x3d')]['count'](_0x93aacd)[_0x707d('0x2b')](function(_0x59b928){_0x425e2e[_0x707d('0x25')]=_0x59b928;if(_0x4d2051[_0x707d('0x42')][_0x707d('0x4e')]){_0x260b2[_0x707d('0x4f')]=[{'all':!![]}];}return db[_0x707d('0x3d')][_0x707d('0x50')](_0x260b2);})[_0x707d('0x2b')](function(_0x8bf45a){_0x425e2e['rows']=_0x8bf45a;return _0x425e2e;})[_0x707d('0x2b')](respondWithFilteredResult(_0x325bd9,_0x260b2))[_0x707d('0x51')](handleError(_0x325bd9,null));};exports[_0x707d('0x52')]=function(_0x3f9c77,_0xe5c80b){var _0x225dde={'raw':![],'where':{'id':_0x3f9c77[_0x707d('0x53')]['id']}},_0x5d6590={};_0x5d6590[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x3d')][_0x707d('0x3e')]);_0x5d6590[_0x707d('0x42')]=_['keys'](_0x3f9c77['query']);_0x5d6590[_0x707d('0x43')]=_[_0x707d('0x45')](_0x5d6590['model'],_0x5d6590[_0x707d('0x42')]);_0x225dde[_0x707d('0x44')]=_[_0x707d('0x45')](_0x5d6590[_0x707d('0x40')],qs['fields'](_0x3f9c77[_0x707d('0x42')][_0x707d('0x46')]));_0x225dde[_0x707d('0x44')]=_0x225dde['attributes'][_0x707d('0x54')]?_0x225dde[_0x707d('0x44')]:_0x5d6590['model'];if(_0x3f9c77[_0x707d('0x42')]['includeAll']){_0x225dde['include']=[{'all':!![]}];}_0x225dde=_['merge']({},_0x225dde,_0x3f9c77[_0x707d('0x4d')]);return db[_0x707d('0x3d')][_0x707d('0x55')](_0x225dde)[_0x707d('0x2b')](handleEntityNotFound(_0xe5c80b,null))[_0x707d('0x2b')](respondWithResult(_0xe5c80b,null))[_0x707d('0x51')](handleError(_0xe5c80b,null));};exports['create']=function(_0x439281,_0x2f4627){return db['VoiceQueue']['create'](_0x439281[_0x707d('0x56')],{})['then'](function(_0x17c0df){var _0x1582e4=_0x439281['user'][_0x707d('0x2c')]({'plain':!![]});if(!_0x1582e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1582e4[_0x707d('0x57')]===_0x707d('0x58')){var _0x1c540c=_0x17c0df[_0x707d('0x2c')]({'plain':!![]});var _0x32fd36=[{'name':'VoiceQueues','value':_0x707d('0x2e')},{'name':_0x707d('0x2f'),'value':_0x707d('0x30')}];var _0x4f7081=_[_0x707d('0x55')](_0x32fd36,['value',_0x1c540c[_0x707d('0x36')]])[_0x707d('0x37')];return db[_0x707d('0x59')]['find']({'where':{'name':_0x4f7081,'userProfileId':_0x1582e4['userProfileId']},'raw':!![]})[_0x707d('0x2b')](function(_0x211c37){if(_0x211c37&&_0x211c37[_0x707d('0x5a')]===0x0){return db[_0x707d('0x38')][_0x707d('0x5b')]({'name':_0x1c540c[_0x707d('0x37')],'resourceId':_0x1c540c['id'],'type':_0x211c37[_0x707d('0x37')],'sectionId':_0x211c37['id']},{})[_0x707d('0x2b')](function(){return _0x17c0df;});}else{return _0x17c0df;}})['catch'](function(_0x475dbc){logger[_0x707d('0x39')](_0x707d('0x5c'),_0x475dbc);throw _0x475dbc;});}return _0x17c0df;})[_0x707d('0x2b')](respondWithResult(_0x2f4627,0xc9))[_0x707d('0x51')](handleError(_0x2f4627,null));};exports[_0x707d('0x5d')]=function(_0x20ed5f,_0x20c101){var _0x1b8b5a={'where':{'id':_0x20ed5f[_0x707d('0x53')]['id']}},_0x90c5c4={};_0x90c5c4[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x3d')][_0x707d('0x3e')]);_0x1b8b5a[_0x707d('0x44')]=_['intersection'](_0x90c5c4[_0x707d('0x40')],qs[_0x707d('0x46')](_0x20ed5f[_0x707d('0x42')][_0x707d('0x46')]));_0x1b8b5a[_0x707d('0x44')]=_0x1b8b5a['attributes'][_0x707d('0x54')]?_0x1b8b5a[_0x707d('0x44')]:_0x90c5c4[_0x707d('0x40')];if(_0x20ed5f[_0x707d('0x42')][_0x707d('0x4e')]){_0x1b8b5a[_0x707d('0x4f')]=[{'all':!![]}];}_0x1b8b5a=_[_0x707d('0x4c')]({},_0x1b8b5a,_0x20ed5f['options']);return db[_0x707d('0x3d')]['find'](_0x1b8b5a)[_0x707d('0x2b')](handleEntityNotFound(_0x20c101,null))[_0x707d('0x2b')](function(_0x4aaaff){if(_0x4aaaff){var _0x2f8869=_0x4aaaff[_0x707d('0x2c')]({'plain':!![]});_0x2f8869=qs[_0x707d('0x5e')](_0x2f8869,['id',_0x707d('0x5f'),'updatedAt']);_0x20ed5f[_0x707d('0x56')]=_[_0x707d('0x5e')](_0x20ed5f[_0x707d('0x56')],['id',_0x707d('0x5f'),'updatedAt']);return db[_0x707d('0x3d')]['create'](_[_0x707d('0x4c')](_0x2f8869,_0x20ed5f['body']),{'include':_0x20ed5f[_0x707d('0x42')][_0x707d('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x278483){var _0x592953=_0x20ed5f[_0x707d('0x58')][_0x707d('0x2c')]({'plain':!![]});if(!_0x592953)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x592953[_0x707d('0x57')]===_0x707d('0x58')){var _0x4ab11d=_0x278483[_0x707d('0x2c')]({'plain':!![]});var _0x4eba16=[{'name':_0x707d('0x2d'),'value':_0x707d('0x2e')},{'name':_0x707d('0x2f'),'value':_0x707d('0x30')}];var _0x30b5cb=_[_0x707d('0x55')](_0x4eba16,[_0x707d('0x34'),_0x4ab11d[_0x707d('0x36')]])[_0x707d('0x37')];return db[_0x707d('0x59')][_0x707d('0x55')]({'where':{'name':_0x30b5cb,'userProfileId':_0x592953[_0x707d('0x60')]},'raw':!![]})[_0x707d('0x2b')](function(_0x5ea54f){if(_0x5ea54f&&_0x5ea54f['autoAssociation']===0x0){return db[_0x707d('0x38')]['create']({'name':_0x4ab11d[_0x707d('0x37')],'resourceId':_0x4ab11d['id'],'type':_0x5ea54f[_0x707d('0x37')],'sectionId':_0x5ea54f['id']},{})[_0x707d('0x2b')](function(){return _0x278483;});}else{return _0x278483;}})[_0x707d('0x51')](function(_0xfbe3c0){logger[_0x707d('0x39')](_0x707d('0x5c'),_0xfbe3c0);throw _0xfbe3c0;});}return _0x278483;});}})['then'](respondWithResult(_0x20c101,0xc9))['catch'](handleError(_0x20c101,null));};exports['update']=function(_0x7d7fac,_0x5179eb){if(_0x7d7fac[_0x707d('0x56')]['id']){delete _0x7d7fac[_0x707d('0x56')]['id'];}return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x7d7fac[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x5179eb,null))[_0x707d('0x2b')](saveUpdates(_0x7d7fac[_0x707d('0x56')],null))[_0x707d('0x2b')](respondWithResult(_0x5179eb,null))[_0x707d('0x51')](handleError(_0x5179eb,null));};exports[_0x707d('0x2a')]=function(_0x2c4f59,_0x1ff192){return db['VoiceQueue']['find']({'where':{'id':_0x2c4f59[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x1ff192,null))[_0x707d('0x2b')](removeEntity(_0x1ff192,null))[_0x707d('0x51')](handleError(_0x1ff192,null));};exports[_0x707d('0x61')]=function(_0x1c2dcf,_0x4a8fbb,_0xf71ac){var _0x5a15aa={'raw':![],'where':{}};var _0x4d2578={};var _0x424a6e={'count':0x0,'rows':[]};return db[_0x707d('0x3d')]['findOne']({'where':{'id':_0x1c2dcf[_0x707d('0x53')]['id']}})['then'](handleEntityNotFound(_0x4a8fbb,null))['then'](function(_0x11d410){if(_0x11d410){_0x4d2578[_0x707d('0x40')]=_['keys'](db[_0x707d('0x62')][_0x707d('0x3e')]);_0x4d2578[_0x707d('0x42')]=_[_0x707d('0x41')](_0x1c2dcf['query']);_0x4d2578[_0x707d('0x43')]=_[_0x707d('0x45')](_0x4d2578[_0x707d('0x40')],_0x4d2578['query']);_0x5a15aa[_0x707d('0x44')]=_['intersection'](_0x4d2578[_0x707d('0x40')],qs[_0x707d('0x46')](_0x1c2dcf['query'][_0x707d('0x46')]));_0x5a15aa[_0x707d('0x44')]=_0x5a15aa['attributes'][_0x707d('0x54')]?_0x5a15aa[_0x707d('0x44')]:_0x4d2578[_0x707d('0x40')];if(!_0x1c2dcf[_0x707d('0x42')][_0x707d('0x63')]('nolimit')){_0x5a15aa['limit']=qs['limit'](_0x1c2dcf['query']['limit']);_0x5a15aa[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x1c2dcf[_0x707d('0x42')][_0x707d('0x22')]);}_0x5a15aa[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x1c2dcf[_0x707d('0x42')][_0x707d('0x49')]);_0x5a15aa['where']=qs[_0x707d('0x43')](_['pick'](_0x1c2dcf[_0x707d('0x42')],_0x4d2578[_0x707d('0x43')]));_0x5a15aa[_0x707d('0x4a')][_0x707d('0x64')]=_0x11d410['id'];if(_0x1c2dcf[_0x707d('0x42')]['filter']){_0x5a15aa[_0x707d('0x4a')]=_['merge'](_0x5a15aa[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x5a15aa[_0x707d('0x44')],function(_0x2ec5c4){var _0x36c591={};_0x36c591[_0x2ec5c4]={'$like':'%'+_0x1c2dcf[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x36c591;})});}_0x5a15aa=_[_0x707d('0x4c')]({},_0x5a15aa,_0x1c2dcf[_0x707d('0x4d')]);return db['CmHopper'][_0x707d('0x25')]({'where':_0x5a15aa[_0x707d('0x4a')]})['then'](function(_0xa301b3){_0x424a6e[_0x707d('0x25')]=_0xa301b3;if(_0x1c2dcf['query'][_0x707d('0x4e')]){_0x5a15aa[_0x707d('0x4f')]=[{'all':!![]}];}return db[_0x707d('0x62')][_0x707d('0x50')](_0x5a15aa);})['then'](function(_0x206003){_0x424a6e[_0x707d('0x65')]=_0x206003;return _0x424a6e;});}})[_0x707d('0x2b')](respondWithFilteredResult(_0x4a8fbb,_0x5a15aa))['catch'](handleError(_0x4a8fbb,null));};exports[_0x707d('0x66')]=function(_0x6363bd,_0x12f8ec,_0x2c4940){var _0x30023b={'raw':!![],'where':{}};var _0x34ba29={};var _0x580c83={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x707d('0x67')]({'where':{'id':_0x6363bd[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x12f8ec,null))[_0x707d('0x2b')](function(_0x160907){if(_0x160907){_0x34ba29[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x68')]['rawAttributes']);_0x34ba29[_0x707d('0x42')]=_[_0x707d('0x41')](_0x6363bd[_0x707d('0x42')]);_0x34ba29[_0x707d('0x43')]=_[_0x707d('0x45')](_0x34ba29[_0x707d('0x40')],_0x34ba29['query']);_0x30023b['attributes']=_[_0x707d('0x45')](_0x34ba29['model'],qs[_0x707d('0x46')](_0x6363bd[_0x707d('0x42')][_0x707d('0x46')]));_0x30023b[_0x707d('0x44')]=_0x30023b[_0x707d('0x44')][_0x707d('0x54')]?_0x30023b['attributes']:_0x34ba29[_0x707d('0x40')];if(!_0x6363bd[_0x707d('0x42')][_0x707d('0x63')](_0x707d('0x47'))){_0x30023b[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x6363bd[_0x707d('0x42')][_0x707d('0x23')]);_0x30023b[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x6363bd[_0x707d('0x42')][_0x707d('0x22')]);}_0x30023b[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x6363bd[_0x707d('0x42')][_0x707d('0x49')]);_0x30023b[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x6363bd[_0x707d('0x42')],_0x34ba29['filters']));_0x30023b[_0x707d('0x4a')][_0x707d('0x64')]=_0x160907['id'];if(_0x6363bd[_0x707d('0x42')][_0x707d('0x31')]){_0x30023b['where']=_[_0x707d('0x4c')](_0x30023b[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x30023b[_0x707d('0x44')],function(_0x5c7049){var _0x3eb4c7={};_0x3eb4c7[_0x5c7049]={'$like':'%'+_0x6363bd['query'][_0x707d('0x31')]+'%'};return _0x3eb4c7;})});}_0x30023b=_[_0x707d('0x4c')]({},_0x30023b,_0x6363bd[_0x707d('0x4d')]);return db[_0x707d('0x68')][_0x707d('0x25')]({'where':_0x30023b['where']})[_0x707d('0x2b')](function(_0x49704f){_0x580c83[_0x707d('0x25')]=_0x49704f;if(_0x6363bd[_0x707d('0x42')][_0x707d('0x4e')]){_0x30023b['include']=[{'all':!![]}];}return db[_0x707d('0x68')][_0x707d('0x50')](_0x30023b);})['then'](function(_0x4ee0d0){_0x580c83[_0x707d('0x65')]=_0x4ee0d0;return _0x580c83;});}})[_0x707d('0x2b')](respondWithFilteredResult(_0x12f8ec,_0x30023b))[_0x707d('0x51')](handleError(_0x12f8ec,null));};exports[_0x707d('0x69')]=function(_0x18c641,_0xce0ddb,_0x54190e){var _0x22d3e4={'raw':!![],'where':{}};var _0x456e77={};var _0xb15220={'count':0x0,'rows':[]};return db[_0x707d('0x3d')]['findOne']({'where':{'id':_0x18c641[_0x707d('0x53')]['id']}})['then'](handleEntityNotFound(_0xce0ddb,null))[_0x707d('0x2b')](function(_0x3c5621){if(_0x3c5621){_0x456e77['model']=_[_0x707d('0x41')](db[_0x707d('0x6a')][_0x707d('0x3e')]);_0x456e77[_0x707d('0x42')]=_[_0x707d('0x41')](_0x18c641['query']);_0x456e77[_0x707d('0x43')]=_[_0x707d('0x45')](_0x456e77['model'],_0x456e77[_0x707d('0x42')]);_0x22d3e4[_0x707d('0x44')]=_[_0x707d('0x45')](_0x456e77[_0x707d('0x40')],qs['fields'](_0x18c641['query'][_0x707d('0x46')]));_0x22d3e4[_0x707d('0x44')]=_0x22d3e4[_0x707d('0x44')]['length']?_0x22d3e4[_0x707d('0x44')]:_0x456e77[_0x707d('0x40')];if(!_0x18c641['query']['hasOwnProperty'](_0x707d('0x47'))){_0x22d3e4[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x18c641[_0x707d('0x42')][_0x707d('0x23')]);_0x22d3e4[_0x707d('0x22')]=qs['offset'](_0x18c641[_0x707d('0x42')][_0x707d('0x22')]);}_0x22d3e4[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x18c641[_0x707d('0x42')][_0x707d('0x49')]);_0x22d3e4['where']=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x18c641['query'],_0x456e77[_0x707d('0x43')]));_0x22d3e4[_0x707d('0x4a')][_0x707d('0x64')]=_0x3c5621['id'];if(_0x18c641['query']['filter']){_0x22d3e4[_0x707d('0x4a')]=_[_0x707d('0x4c')](_0x22d3e4[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x22d3e4[_0x707d('0x44')],function(_0x1e9db1){var _0x3d7a57={};_0x3d7a57[_0x1e9db1]={'$like':'%'+_0x18c641[_0x707d('0x42')]['filter']+'%'};return _0x3d7a57;})});}_0x22d3e4=_[_0x707d('0x4c')]({},_0x22d3e4,_0x18c641[_0x707d('0x4d')]);return db[_0x707d('0x6a')][_0x707d('0x25')]({'where':_0x22d3e4[_0x707d('0x4a')]})['then'](function(_0x46685a){_0xb15220['count']=_0x46685a;if(_0x18c641[_0x707d('0x42')][_0x707d('0x4e')]){_0x22d3e4['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x707d('0x50')](_0x22d3e4);})['then'](function(_0x1c8879){_0xb15220['rows']=_0x1c8879;return _0xb15220;});}})['then'](respondWithFilteredResult(_0xce0ddb,_0x22d3e4))[_0x707d('0x51')](handleError(_0xce0ddb,null));};exports[_0x707d('0x6b')]=function(_0x2e8763,_0x40bed5,_0x1b26c9){var _0x26bbb1={'raw':!![],'where':{}};var _0x8e725={};var _0x311044={'count':0x0,'rows':[]};return db[_0x707d('0x3d')][_0x707d('0x67')]({'where':{'id':_0x2e8763[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x40bed5,null))[_0x707d('0x2b')](function(_0x35dee7){if(_0x35dee7){_0x8e725[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x6c')][_0x707d('0x3e')]);_0x8e725[_0x707d('0x42')]=_[_0x707d('0x41')](_0x2e8763['query']);_0x8e725[_0x707d('0x43')]=_[_0x707d('0x45')](_0x8e725['model'],_0x8e725[_0x707d('0x42')]);_0x26bbb1[_0x707d('0x44')]=_[_0x707d('0x45')](_0x8e725['model'],qs['fields'](_0x2e8763[_0x707d('0x42')][_0x707d('0x46')]));_0x26bbb1[_0x707d('0x44')]=_0x26bbb1[_0x707d('0x44')][_0x707d('0x54')]?_0x26bbb1['attributes']:_0x8e725['model'];if(!_0x2e8763[_0x707d('0x42')][_0x707d('0x63')](_0x707d('0x47'))){_0x26bbb1['limit']=qs[_0x707d('0x23')](_0x2e8763[_0x707d('0x42')][_0x707d('0x23')]);_0x26bbb1[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x2e8763[_0x707d('0x42')][_0x707d('0x22')]);}_0x26bbb1[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x2e8763[_0x707d('0x42')]['sort']);_0x26bbb1[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x2e8763[_0x707d('0x42')],_0x8e725['filters']));_0x26bbb1[_0x707d('0x4a')]['VoiceQueueId']=_0x35dee7['id'];if(_0x2e8763[_0x707d('0x42')][_0x707d('0x31')]){_0x26bbb1['where']=_[_0x707d('0x4c')](_0x26bbb1['where'],{'$or':_[_0x707d('0x33')](_0x26bbb1['attributes'],function(_0x52fe2e){var _0x54ad2c={};_0x54ad2c[_0x52fe2e]={'$like':'%'+_0x2e8763['query'][_0x707d('0x31')]+'%'};return _0x54ad2c;})});}_0x26bbb1=_['merge']({},_0x26bbb1,_0x2e8763[_0x707d('0x4d')]);return db[_0x707d('0x6c')][_0x707d('0x25')]({'where':_0x26bbb1[_0x707d('0x4a')]})[_0x707d('0x2b')](function(_0xbeba07){_0x311044['count']=_0xbeba07;if(_0x2e8763[_0x707d('0x42')][_0x707d('0x4e')]){_0x26bbb1['include']=[{'all':!![]}];}return db[_0x707d('0x6c')][_0x707d('0x50')](_0x26bbb1);})[_0x707d('0x2b')](function(_0xdaabd1){_0x311044[_0x707d('0x65')]=_0xdaabd1;return _0x311044;});}})[_0x707d('0x2b')](respondWithFilteredResult(_0x40bed5,_0x26bbb1))[_0x707d('0x51')](handleError(_0x40bed5,null));};exports[_0x707d('0x6d')]=function(_0x53cf9a,_0x140685,_0x27ebf0){var _0x589ba7={};var _0x4f20da={};var _0x214517;var _0x5121f9;return db[_0x707d('0x3d')][_0x707d('0x67')]({'where':{'id':_0x53cf9a['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x140685,null))[_0x707d('0x2b')](function(_0x3f0cb0){if(_0x3f0cb0){_0x214517=_0x3f0cb0;_0x4f20da[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x6e')][_0x707d('0x3e')]);_0x4f20da[_0x707d('0x42')]=_[_0x707d('0x41')](_0x53cf9a[_0x707d('0x42')]);_0x4f20da[_0x707d('0x43')]=_[_0x707d('0x45')](_0x4f20da['model'],_0x4f20da[_0x707d('0x42')]);_0x589ba7[_0x707d('0x44')]=_[_0x707d('0x45')](_0x4f20da[_0x707d('0x40')],qs[_0x707d('0x46')](_0x53cf9a[_0x707d('0x42')][_0x707d('0x46')]));_0x589ba7[_0x707d('0x44')]=_0x589ba7[_0x707d('0x44')][_0x707d('0x54')]?_0x589ba7['attributes']:_0x4f20da[_0x707d('0x40')];_0x589ba7[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x53cf9a[_0x707d('0x42')][_0x707d('0x49')]);_0x589ba7[_0x707d('0x4a')]=qs[_0x707d('0x43')](_['pick'](_0x53cf9a[_0x707d('0x42')],_0x4f20da[_0x707d('0x43')]));if(_0x53cf9a['query'][_0x707d('0x31')]){_0x589ba7[_0x707d('0x4a')]=_[_0x707d('0x4c')](_0x589ba7['where'],{'$or':_['map'](_0x589ba7[_0x707d('0x44')],function(_0x27251d){var _0x4952cb={};_0x4952cb[_0x27251d]={'$like':'%'+_0x53cf9a[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x4952cb;})});}_0x589ba7=_['merge']({},_0x589ba7,_0x53cf9a[_0x707d('0x4d')]);return _0x214517[_0x707d('0x6d')](_0x589ba7);}})[_0x707d('0x2b')](function(_0x327304){if(_0x327304){_0x5121f9=_0x327304['length'];if(!_0x53cf9a[_0x707d('0x42')][_0x707d('0x63')](_0x707d('0x47'))){_0x589ba7[_0x707d('0x23')]=qs['limit'](_0x53cf9a[_0x707d('0x42')][_0x707d('0x23')]);_0x589ba7[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x53cf9a[_0x707d('0x42')][_0x707d('0x22')]);}return _0x214517[_0x707d('0x6d')](_0x589ba7);}})[_0x707d('0x2b')](function(_0x530c48){if(_0x530c48){return _0x530c48?{'count':_0x5121f9,'rows':_0x530c48}:null;}})[_0x707d('0x2b')](respondWithResult(_0x140685,null))[_0x707d('0x51')](handleError(_0x140685,null));};exports['addTeams']=function(_0x55eab1,_0x474d48,_0x1993a8){var _0x3c76cb=_0x55eab1['body'][_0x707d('0x6f')];var _0x31c711=_[_0x707d('0x33')](_0x3c76cb,'id');return db[_0x707d('0x6e')]['findAll']({'where':{'id':_0x31c711},'attributes':['id'],'include':[{'model':db[_0x707d('0x70')],'as':'Agents','attributes':['id',_0x707d('0x37'),'online','voicePause','interface'],'raw':!![]}]})[_0x707d('0x2b')](function(_0x515704){if(_0x515704){var _0x37a4ab=_['flatMap'](_0x515704,function(_0x51e554){var _0x162e7a=_0x51e554[_0x707d('0x2c')]({'plain':!![]});_0x162e7a[_0x707d('0x71')]['forEach'](function(_0x4bfb92){_0x4bfb92[_0x707d('0x72')]=_[_0x707d('0x55')](_0x3c76cb,{'id':_0x162e7a['id']})[_0x707d('0x72')];});return _0x162e7a[_0x707d('0x71')];});return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x55eab1[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(_0x5cb102){return db[_0x707d('0x73')][_0x707d('0x74')](function(_0x26b528){return _0x5cb102['addTeams'](_0x31c711,{'transaction':_0x26b528})[_0x707d('0x2b')](function(){return BPromise['each'](_0x3c76cb,function(_0x3ffa80){return db[_0x707d('0x75')][_0x707d('0x76')]({'TeamId':_0x3ffa80['id'],'VoiceQueueId':_0x55eab1[_0x707d('0x53')]['id'],'penalty':_0x3ffa80[_0x707d('0x72')]},{'transaction':_0x26b528});});})[_0x707d('0x2b')](function(){return BPromise[_0x707d('0x77')](_0x37a4ab,function(_0x5f4a92){return db[_0x707d('0x78')][_0x707d('0x79')]({'where':{'UserId':_0x5f4a92['id'],'VoiceQueueId':_0x55eab1[_0x707d('0x53')]['id']},'defaults':{'penalty':_0x5f4a92['penalty']},'transaction':_0x26b528});});})[_0x707d('0x2b')](function(){return BPromise[_0x707d('0x77')](_[_0x707d('0x31')](_0x37a4ab,{'online':!![]}),function(_0x5a4489){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5a4489[_0x707d('0x37')],'UserId':_0x5a4489['id'],'queue_name':_0x5cb102[_0x707d('0x37')],'VoiceQueueId':_0x5cb102['id'],'interface':_[_0x707d('0x7a')](_0x5a4489[_0x707d('0x7b')])?util[_0x707d('0x7c')]('SIP/%s',_0x5a4489[_0x707d('0x37')]):_0x5a4489[_0x707d('0x7b')],'paused':_0x5a4489[_0x707d('0x7d')]||![],'penalty':_0x5a4489[_0x707d('0x72')]},{'transaction':_0x26b528});});})['then'](function(){_0x37a4ab['forEach'](function(_0x254f7b){socket[_0x707d('0x7e')](_0x707d('0x7f'),{'UserId':_0x254f7b['id'],'VoiceQueueId':_0x5cb102['id']});});});});});}})[_0x707d('0x2b')](respondWithStatusCode(_0x474d48,null))[_0x707d('0x51')](handleError(_0x474d48,null));};exports[_0x707d('0x80')]=function(_0x31da99,_0x1e847e,_0x19ba1a){return db['Team'][_0x707d('0x50')]({'where':{'id':_0x31da99[_0x707d('0x42')][_0x707d('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x707d('0x71'),'attributes':['id'],'raw':!![]}]})[_0x707d('0x2b')](handleEntityNotFound(_0x1e847e,null))[_0x707d('0x2b')](function(_0x2f6809){var _0x245ad9=_[_0x707d('0x33')](_0x2f6809,'id');var _0x164a2c=[];var _0x59086f=[];var _0xc3733a=squel[_0x707d('0x82')]();_0xc3733a[_0x707d('0x83')](_0x707d('0x84'))[_0x707d('0x85')](_0x707d('0x86'),'tq')[_0x707d('0x87')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x707d('0x4a')](_0x707d('0x88'),_0x31da99[_0x707d('0x53')]['id']);for(var _0x37a62f=0x0;_0x37a62f<_0x2f6809['length'];_0x37a62f+=0x1){let _0x2bdb10=_0x2f6809[_0x37a62f];for(var _0x4190bc=0x0;_0x4190bc<_0x2bdb10[_0x707d('0x71')]['length'];_0x4190bc+=0x1){let _0x5c710d=_0x2bdb10[_0x707d('0x71')][_0x4190bc];var _0x4970aa=_0xc3733a[_0x707d('0x5d')]();_0x4970aa[_0x707d('0x4a')]('ut.UserId\x20=\x20?',_0x5c710d['id']);_0x59086f[_0x707d('0x89')](db[_0x707d('0x73')]['query'](_0x4970aa[_0x707d('0x8a')](),{'type':db[_0x707d('0x73')]['QueryTypes'][_0x707d('0x8b')]})['then'](function(_0x444965){if(_0x444965['length']===0x1){return _0x5c710d['id'];}else{var _0x2a41aa=_['every'](_['map'](_0x444965,_0x707d('0x8c')),function(_0x4f0e96){return _[_0x707d('0x35')](_0x245ad9,_0x4f0e96);});if(_0x2a41aa){return _0x5c710d['id'];}}}));}}return BPromise[_0x707d('0x8d')](_0x59086f)[_0x707d('0x2b')](function(_0x57601e){_0x164a2c=_(_0x164a2c)[_0x707d('0x8e')](_0x57601e)[_0x707d('0x8f')]()[_0x707d('0x34')]();return db['VoiceQueue']['find']({'where':{'id':_0x31da99[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(_0x360c80){return db[_0x707d('0x73')][_0x707d('0x74')](function(_0x4eff7f){return _0x360c80[_0x707d('0x80')](_0x31da99['query']['ids'],{'transaction':_0x4eff7f})['then'](function(){if(!_[_0x707d('0x90')](_0x164a2c)){return _0x360c80[_0x707d('0x91')](_0x164a2c,{'transaction':_0x4eff7f})[_0x707d('0x2b')](function(){return db[_0x707d('0x92')]['destroy']({'where':{'VoiceQueueId':_0x31da99[_0x707d('0x53')]['id'],'UserId':_0x164a2c},'transaction':_0x4eff7f});});}})[_0x707d('0x2b')](function(){_0x164a2c['forEach'](function(_0x3083d4){socket[_0x707d('0x7e')](_0x707d('0x93'),{'UserId':_0x3083d4,'VoiceQueueId':_0x360c80['id']});});});});});});})[_0x707d('0x2b')](respondWithStatusCode(_0x1e847e,null))['catch'](handleError(_0x1e847e,null));};exports[_0x707d('0x94')]=function(_0x2d0faf,_0x54f6dd,_0x1237f5){var _0x1c7e8c,_0x164f8c;return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x2d0faf[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x54f6dd,null))[_0x707d('0x2b')](function(_0x13c988){if(_0x13c988){_0x164f8c=_0x13c988;return _0x13c988['addAgents'](_0x2d0faf[_0x707d('0x56')]['ids'],_[_0x707d('0x5e')](_0x2d0faf['body'],[_0x707d('0x81'),'id'])||{})['spread'](function(_0x4da240){for(var _0x3dd8b8=0x0;_0x3dd8b8<_0x2d0faf[_0x707d('0x56')][_0x707d('0x81')][_0x707d('0x54')];_0x3dd8b8+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x2d0faf[_0x707d('0x56')][_0x707d('0x81')][_0x3dd8b8]),'VoiceQueueId':Number(_0x2d0faf['params']['id'])});}return _0x4da240;});}})[_0x707d('0x2b')](function(_0x2134c6){_0x1c7e8c=_0x2134c6||[];if(_0x164f8c){return db[_0x707d('0x70')]['findAll']({'where':{'id':_0x2d0faf['body'][_0x707d('0x81')]},'attributes':['id',_0x707d('0x37'),_0x707d('0x95'),'voicePause',_0x707d('0x7b')],'raw':!![]});}})['then'](function(_0x174451){if(!_[_0x707d('0x90')](_0x174451)){var _0x378539=[];for(var _0x2fe9c8=0x0;_0x2fe9c8<_0x174451[_0x707d('0x54')];_0x2fe9c8++){if(_0x174451[_0x2fe9c8][_0x707d('0x95')]){_0x378539['push'](db[_0x707d('0x92')][_0x707d('0x76')]({'membername':_0x174451[_0x2fe9c8][_0x707d('0x37')],'UserId':_0x174451[_0x2fe9c8]['id'],'queue_name':_0x164f8c[_0x707d('0x37')],'VoiceQueueId':_0x164f8c['id'],'interface':_[_0x707d('0x7a')](_0x174451[_0x2fe9c8][_0x707d('0x7b')])?util['format'](_0x707d('0x96'),_0x174451[_0x2fe9c8][_0x707d('0x37')]):_0x174451[_0x2fe9c8][_0x707d('0x7b')],'paused':_0x174451[_0x2fe9c8]['voicePause']||![],'penalty':_0x2d0faf['body'][_0x707d('0x72')]||0x0}));}}return BPromise[_0x707d('0x8d')](_0x378539);}})[_0x707d('0x2b')](function(){return _0x1c7e8c;})[_0x707d('0x2b')](respondWithResult(_0x54f6dd,null))[_0x707d('0x51')](handleError(_0x54f6dd,null));};exports['removeAgents']=function(_0x257edb,_0x1b0edb,_0x3903cd){return db[_0x707d('0x3d')]['find']({'where':{'id':_0x257edb[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x1b0edb,null))['then'](function(_0x39de42){if(_0x39de42){return _0x39de42[_0x707d('0x91')](_0x257edb[_0x707d('0x42')][_0x707d('0x81')])[_0x707d('0x2b')](function(){if(_[_0x707d('0x97')](_0x257edb['query'][_0x707d('0x81')])){for(var _0x17c223=0x0;_0x17c223<_0x257edb['query'][_0x707d('0x81')][_0x707d('0x54')];_0x17c223+=0x1){socket[_0x707d('0x7e')](_0x707d('0x93'),{'UserId':Number(_0x257edb[_0x707d('0x42')][_0x707d('0x81')][_0x17c223]),'VoiceQueueId':Number(_0x257edb[_0x707d('0x53')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x257edb[_0x707d('0x42')][_0x707d('0x81')]),'VoiceQueueId':Number(_0x257edb[_0x707d('0x53')]['id'])});}});}})[_0x707d('0x2b')](function(_0x1a6179){return db[_0x707d('0x92')]['destroy']({'where':{'VoiceQueueId':_0x257edb['params']['id'],'UserId':_0x257edb['query'][_0x707d('0x81')]}})[_0x707d('0x2b')](function(){return _0x1a6179;});})['then'](respondWithStatusCode(_0x1b0edb,null))[_0x707d('0x51')](handleError(_0x1b0edb,null));};exports[_0x707d('0x98')]=function(_0x320171,_0x17e33e,_0x132d8d){var _0x4ac27c={};var _0x4ddc3f={};var _0x3ae4a1;var _0xfbf1e0;return db[_0x707d('0x3d')][_0x707d('0x67')]({'where':{'id':_0x320171['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x17e33e,null))[_0x707d('0x2b')](function(_0x3f5076){if(_0x3f5076){_0x3ae4a1=_0x3f5076;_0x4ddc3f[_0x707d('0x40')]=_[_0x707d('0x41')](db[_0x707d('0x70')][_0x707d('0x3e')]);_0x4ddc3f['query']=_[_0x707d('0x41')](_0x320171['query']);_0x4ddc3f[_0x707d('0x43')]=_['intersection'](_0x4ddc3f[_0x707d('0x40')],_0x4ddc3f[_0x707d('0x42')]);_0x4ac27c[_0x707d('0x44')]=_['intersection'](_0x4ddc3f[_0x707d('0x40')],qs[_0x707d('0x46')](_0x320171['query']['fields']));_0x4ac27c[_0x707d('0x44')]=_0x4ac27c['attributes'][_0x707d('0x54')]?_0x4ac27c[_0x707d('0x44')]:_0x4ddc3f[_0x707d('0x40')];_0x4ac27c[_0x707d('0x48')]=qs['sort'](_0x320171[_0x707d('0x42')]['sort']);_0x4ac27c[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x320171['query'],_0x4ddc3f[_0x707d('0x43')]));if(_0x320171[_0x707d('0x42')]['filter']){_0x4ac27c['where']=_[_0x707d('0x4c')](_0x4ac27c[_0x707d('0x4a')],{'$or':_['map'](_0x4ac27c[_0x707d('0x44')],function(_0x4fd358){var _0x499cdf={};_0x499cdf[_0x4fd358]={'$like':'%'+_0x320171[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x499cdf;})});}_0x4ac27c=_[_0x707d('0x4c')]({},_0x4ac27c,_0x320171[_0x707d('0x4d')]);return _0x3ae4a1[_0x707d('0x98')](_0x4ac27c);}})[_0x707d('0x2b')](function(_0x1683ae){if(_0x1683ae){_0xfbf1e0=_0x1683ae['length'];if(!_0x320171['query'][_0x707d('0x63')](_0x707d('0x47'))){_0x4ac27c[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x320171[_0x707d('0x42')][_0x707d('0x23')]);_0x4ac27c[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x320171['query']['offset']);}return _0x3ae4a1[_0x707d('0x98')](_0x4ac27c);}})[_0x707d('0x2b')](function(_0x496849){if(_0x496849){return _0x496849?{'count':_0xfbf1e0,'rows':_0x496849}:null;}})['then'](respondWithResult(_0x17e33e,null))[_0x707d('0x51')](handleError(_0x17e33e,null));};exports[_0x707d('0x99')]=function(_0x2d99ea,_0x1aadbe,_0x47dd95){var _0x565467={};var _0x599fb4={};var _0xe1e062;var _0x14dcef;return db['VoiceQueue'][_0x707d('0x67')]({'where':{'id':_0x2d99ea[_0x707d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1aadbe,null))[_0x707d('0x2b')](function(_0x35e80a){if(_0x35e80a){_0xe1e062=_0x35e80a;_0x599fb4[_0x707d('0x40')]=_[_0x707d('0x41')](db['UserVoiceQueueRt']['rawAttributes']);_0x599fb4['query']=_[_0x707d('0x41')](_0x2d99ea[_0x707d('0x42')]);_0x599fb4[_0x707d('0x43')]=_['intersection'](_0x599fb4[_0x707d('0x40')],_0x599fb4[_0x707d('0x42')]);_0x565467[_0x707d('0x44')]=_[_0x707d('0x45')](_0x599fb4[_0x707d('0x40')],qs[_0x707d('0x46')](_0x2d99ea[_0x707d('0x42')][_0x707d('0x46')]));_0x565467[_0x707d('0x44')]=_0x565467[_0x707d('0x44')]['length']?_0x565467[_0x707d('0x44')]:_0x599fb4['model'];_0x565467[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x2d99ea[_0x707d('0x42')][_0x707d('0x49')]);_0x565467[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x2d99ea[_0x707d('0x42')],_0x599fb4[_0x707d('0x43')]));if(_0x2d99ea['query'][_0x707d('0x31')]){_0x565467[_0x707d('0x4a')]=_[_0x707d('0x4c')](_0x565467['where'],{'$or':_['map'](_0x565467[_0x707d('0x44')],function(_0x17f9b0){var _0x41ac21={};_0x41ac21[_0x17f9b0]={'$like':'%'+_0x2d99ea['query'][_0x707d('0x31')]+'%'};return _0x41ac21;})});}_0x565467=_[_0x707d('0x4c')]({},_0x565467,_0x2d99ea['options']);return _0xe1e062[_0x707d('0x99')](_0x565467);}})['then'](function(_0x6cbcbd){if(_0x6cbcbd){_0x14dcef=_0x6cbcbd[_0x707d('0x54')];if(!_0x2d99ea['query'][_0x707d('0x63')](_0x707d('0x47'))){_0x565467[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x2d99ea[_0x707d('0x42')]['limit']);_0x565467[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x2d99ea[_0x707d('0x42')][_0x707d('0x22')]);}return _0xe1e062[_0x707d('0x99')](_0x565467);}})[_0x707d('0x2b')](function(_0x5489ca){return _0x5489ca?{'count':_0x14dcef,'rows':_0x5489ca}:null;})[_0x707d('0x2b')](respondWithResult(_0x1aadbe,null))[_0x707d('0x51')](handleError(_0x1aadbe,null));};exports[_0x707d('0x9a')]=function(_0x5c51ea,_0x4f93de,_0x5afcc4){var _0xfe67a5={};var _0x541a7e={};var _0x391d59;var _0x3d215e;return db['VoiceQueue']['findOne']({'where':{'id':_0x5c51ea[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x4f93de,null))[_0x707d('0x2b')](function(_0xa581cf){if(_0xa581cf){_0x391d59=_0xa581cf;_0x541a7e[_0x707d('0x40')]=_['keys'](db[_0x707d('0x9b')][_0x707d('0x3e')]);_0x541a7e[_0x707d('0x42')]=_['keys'](_0x5c51ea[_0x707d('0x42')]);_0x541a7e[_0x707d('0x43')]=_[_0x707d('0x45')](_0x541a7e[_0x707d('0x40')],_0x541a7e['query']);_0xfe67a5[_0x707d('0x44')]=_[_0x707d('0x45')](_0x541a7e[_0x707d('0x40')],qs[_0x707d('0x46')](_0x5c51ea[_0x707d('0x42')][_0x707d('0x46')]));_0xfe67a5[_0x707d('0x44')]=_0xfe67a5[_0x707d('0x44')][_0x707d('0x54')]?_0xfe67a5[_0x707d('0x44')]:_0x541a7e[_0x707d('0x40')];_0xfe67a5[_0x707d('0x48')]=qs[_0x707d('0x49')](_0x5c51ea['query'][_0x707d('0x49')]);_0xfe67a5[_0x707d('0x4a')]=qs[_0x707d('0x43')](_[_0x707d('0x4b')](_0x5c51ea['query'],_0x541a7e['filters']));if(_0x5c51ea[_0x707d('0x42')][_0x707d('0x31')]){_0xfe67a5[_0x707d('0x4a')]=_['merge'](_0xfe67a5[_0x707d('0x4a')],{'$or':_['map'](_0xfe67a5[_0x707d('0x44')],function(_0x280cca){var _0x20c197={};_0x20c197[_0x280cca]={'$like':'%'+_0x5c51ea['query']['filter']+'%'};return _0x20c197;})});}_0xfe67a5=_[_0x707d('0x4c')]({},_0xfe67a5,_0x5c51ea[_0x707d('0x4d')]);return _0x391d59[_0x707d('0x9a')](_0xfe67a5);}})['then'](function(_0x11971d){if(_0x11971d){_0x3d215e=_0x11971d[_0x707d('0x54')];if(!_0x5c51ea[_0x707d('0x42')][_0x707d('0x63')]('nolimit')){_0xfe67a5['limit']=qs[_0x707d('0x23')](_0x5c51ea['query']['limit']);_0xfe67a5['offset']=qs[_0x707d('0x22')](_0x5c51ea['query'][_0x707d('0x22')]);}return _0x391d59[_0x707d('0x9a')](_0xfe67a5);}})['then'](function(_0x369100){if(_0x369100){return _0x369100?{'count':_0x3d215e,'rows':_0x369100}:null;}})['then'](respondWithResult(_0x4f93de,null))[_0x707d('0x51')](handleError(_0x4f93de,null));};exports['addLists']=function(_0xcf6002,_0xe9c38e,_0x40381d){var _0x104709=moment()[_0x707d('0x7c')](_0x707d('0x9c'));var _0x5c67f5,_0x4e985c;return db[_0x707d('0x3d')]['find']({'where':{'id':_0xcf6002[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0xe9c38e,null))['then'](function(_0x3abc79){if(_0x3abc79){_0x4e985c=_0x3abc79;return _0x3abc79[_0x707d('0x9d')](_0xcf6002['body']['ids'],_[_0x707d('0x5e')](_0xcf6002['body'],[_0x707d('0x81'),'id'])||{});}return null;})[_0x707d('0x9e')](function(_0x2acc07){var _0x3d7be0;_0x5c67f5=_0x2acc07||[];var _0x5be04c=[];if(_0x2acc07){for(var _0x4fa015=0x0;_0x4fa015<_0x2acc07[_0x707d('0x54')];_0x4fa015+=0x1){var _0x1cf938=_0x2acc07[_0x4fa015][_0x707d('0x2c')]({'plain':!![]});_0x4e985c['dialCheckDuplicateType']=_0xcf6002[_0x707d('0x56')][_0x707d('0x9f')]?_0xcf6002[_0x707d('0x56')]['dialCheckDuplicateType']:_0x4e985c[_0x707d('0x9f')];switch(_0x4e985c[_0x707d('0x9f')]){case _0x707d('0xa0'):_0x3d7be0=squel['insert']()['into'](_0x707d('0xa1'))['fromQuery'](['phone',_0x707d('0xa2'),_0x707d('0xa3'),_0x707d('0xa4'),_0x707d('0x64'),_0x707d('0x5f'),'updatedAt'],squel[_0x707d('0x82')]()['field'](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27','scheduledAt')['field']('id',_0x707d('0xa3'))['field'](_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')](),_0x707d('0xa4'))[_0x707d('0x83')](_0xcf6002[_0x707d('0x53')]['id']['toString'](),'VoiceQueueId')[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0x5f'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')]('cm_contacts')[_0x707d('0x4a')]('deletedAt\x20IS\x20NULL')[_0x707d('0x4a')](_0x707d('0xa8'),_0x1cf938['CmListId']['toString']())[_0x707d('0x4a')](_0x707d('0xa9'))[_0x707d('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x707d('0x82')]()[_0x707d('0x83')]('COALESCE(calleridnum,\x27\x27)')[_0x707d('0x85')](_0x707d('0xaa'))[_0x707d('0x4a')](_0x707d('0x88'),_0xcf6002['params']['id'][_0x707d('0x8a')]()))[_0x707d('0x4a')](_0x707d('0xab'),squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xac'))[_0x707d('0x85')](_0x707d('0xa1'))[_0x707d('0x4a')](_0x707d('0x88'),_0xcf6002[_0x707d('0x53')]['id'][_0x707d('0x8a')]())))[_0x707d('0x8a')]();break;case'onlyIfOpen':_0x3d7be0=squel[_0x707d('0xad')]()[_0x707d('0xae')](_0x707d('0xa1'))['fromQuery']([_0x707d('0xa5'),'scheduledAt',_0x707d('0xa3'),_0x707d('0xa4'),_0x707d('0x64'),_0x707d('0x5f'),'updatedAt'],squel['select']()['field'](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa2'))[_0x707d('0x83')]('id',_0x707d('0xa3'))[_0x707d('0x83')](_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')](),_0x707d('0xa4'))[_0x707d('0x83')](_0xcf6002['params']['id'][_0x707d('0x8a')](),_0x707d('0x64'))['field']('\x27'+_0x104709+'\x27',_0x707d('0x5f'))['field']('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')](_0x707d('0xaf'))[_0x707d('0x4a')](_0x707d('0xb0'))['where'](_0x707d('0xa8'),_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')]())[_0x707d('0x4a')](_0x707d('0xa9'))[_0x707d('0x4a')](_0x707d('0xab'),squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xac'))['from'](_0x707d('0xa1'))[_0x707d('0x4a')](_0x707d('0x88'),_0xcf6002[_0x707d('0x53')]['id']['toString']())))['toString']();break;default:_0x3d7be0=squel['insert']()['into'](_0x707d('0xa1'))['fromQuery']([_0x707d('0xa5'),'scheduledAt',_0x707d('0xa3'),_0x707d('0xa4'),_0x707d('0x64'),_0x707d('0x5f'),_0x707d('0xa7')],squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa2'))[_0x707d('0x83')]('id',_0x707d('0xa3'))[_0x707d('0x83')](_0x1cf938[_0x707d('0xa6')][_0x707d('0x8a')](),'ListId')[_0x707d('0x83')](_0xcf6002[_0x707d('0x53')]['id'][_0x707d('0x8a')](),_0x707d('0x64'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27','createdAt')[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')]('cm_contacts')[_0x707d('0x4a')](_0x707d('0xb0'))[_0x707d('0x4a')]('ListId\x20=\x20?',_0x1cf938[_0x707d('0xa6')]['toString']())[_0x707d('0x4a')](_0x707d('0xa9')))[_0x707d('0x8a')]();}_0x5be04c[_0x707d('0x89')](db[_0x707d('0x73')][_0x707d('0x42')](_0x3d7be0));}return BPromise[_0x707d('0x8d')](_0x5be04c);}})[_0x707d('0x2b')](function(){var _0x3db3d3=[];var _0x538f5f=squel['insert']()[_0x707d('0xae')](_0x707d('0xb1'))[_0x707d('0xb2')](['CmHopperId',_0x707d('0xa5'),_0x707d('0xb3'),'createdAt',_0x707d('0xa7')],squel[_0x707d('0x82')]()[_0x707d('0x83')]('h.id')[_0x707d('0x83')](_0x707d('0xb4'))[_0x707d('0x83')](_0x707d('0xb5'))[_0x707d('0x83')]('\x27'+_0x104709+'\x27',_0x707d('0x5f'))['field']('\x27'+_0x104709+'\x27',_0x707d('0xa7'))[_0x707d('0x85')]('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x707d('0xb6'))[_0x707d('0x4a')](_0x707d('0xb7'),_0x104709)[_0x707d('0x4a')](_0x707d('0xb8'),'PHONE'))[_0x707d('0x8a')]();_0x3db3d3[_0x707d('0x89')](db[_0x707d('0x73')]['query'](_0x538f5f));return BPromise[_0x707d('0x8d')](_0x3db3d3);})[_0x707d('0x2b')](function(){return _0x5c67f5;})[_0x707d('0x2b')](respondWithResult(_0xe9c38e,null))[_0x707d('0x51')](handleError(_0xe9c38e,null));};exports[_0x707d('0xb9')]=function(_0x207a95,_0x40e36b,_0x37bb7f){return db['VoiceQueue'][_0x707d('0x55')]({'where':{'id':_0x207a95[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x40e36b,null))[_0x707d('0x2b')](function(_0x13a55a){if(_0x13a55a){return _0x13a55a[_0x707d('0xb9')](_0x207a95[_0x707d('0x42')][_0x707d('0x81')]);}})[_0x707d('0x2b')](function(_0x10b9e4){if(_0x10b9e4){return db[_0x707d('0x62')][_0x707d('0x2a')]({'where':{'ListId':_0x207a95[_0x707d('0x42')][_0x707d('0x81')],'VoiceQueueId':_0x207a95[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(){return _0x10b9e4;});}})[_0x707d('0x2b')](respondWithStatusCode(_0x40e36b,null))['catch'](handleError(_0x40e36b,null));};exports[_0x707d('0xba')]=function(_0x1fdc5e,_0xc479ab,_0xb0ab94){var _0x59fa37={};var _0x590278={};var _0x2c28ab;var _0x497c85;return db[_0x707d('0x3d')]['findOne']({'where':{'id':_0x1fdc5e['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0xc479ab,null))[_0x707d('0x2b')](function(_0x4ef445){if(_0x4ef445){_0x2c28ab=_0x4ef445;_0x590278[_0x707d('0x40')]=_['keys'](db[_0x707d('0x9b')]['rawAttributes']);_0x590278['query']=_[_0x707d('0x41')](_0x1fdc5e['query']);_0x590278[_0x707d('0x43')]=_[_0x707d('0x45')](_0x590278[_0x707d('0x40')],_0x590278[_0x707d('0x42')]);_0x59fa37[_0x707d('0x44')]=_['intersection'](_0x590278[_0x707d('0x40')],qs[_0x707d('0x46')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x46')]));_0x59fa37[_0x707d('0x44')]=_0x59fa37[_0x707d('0x44')][_0x707d('0x54')]?_0x59fa37[_0x707d('0x44')]:_0x590278[_0x707d('0x40')];_0x59fa37['order']=qs[_0x707d('0x49')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x49')]);_0x59fa37['where']=qs[_0x707d('0x43')](_['pick'](_0x1fdc5e[_0x707d('0x42')],_0x590278[_0x707d('0x43')]));if(_0x1fdc5e[_0x707d('0x42')]['filter']){_0x59fa37[_0x707d('0x4a')]=_['merge'](_0x59fa37[_0x707d('0x4a')],{'$or':_[_0x707d('0x33')](_0x59fa37[_0x707d('0x44')],function(_0x5647e0){var _0x45b864={};_0x45b864[_0x5647e0]={'$like':'%'+_0x1fdc5e[_0x707d('0x42')][_0x707d('0x31')]+'%'};return _0x45b864;})});}_0x59fa37=_[_0x707d('0x4c')]({},_0x59fa37,_0x1fdc5e['options']);return _0x2c28ab[_0x707d('0xba')](_0x59fa37);}})['then'](function(_0x43a0a7){if(_0x43a0a7){_0x497c85=_0x43a0a7[_0x707d('0x54')];if(!_0x1fdc5e['query'][_0x707d('0x63')](_0x707d('0x47'))){_0x59fa37[_0x707d('0x23')]=qs[_0x707d('0x23')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x23')]);_0x59fa37[_0x707d('0x22')]=qs[_0x707d('0x22')](_0x1fdc5e[_0x707d('0x42')][_0x707d('0x22')]);}return _0x2c28ab['getBlackLists'](_0x59fa37);}})['then'](function(_0x10e0ab){if(_0x10e0ab){return _0x10e0ab?{'count':_0x497c85,'rows':_0x10e0ab}:null;}})['then'](respondWithResult(_0xc479ab,null))[_0x707d('0x51')](handleError(_0xc479ab,null));};exports[_0x707d('0xbb')]=function(_0xdb193,_0x5b6f23,_0x217ab9){var _0x1e8fad,_0x15edf2;return db[_0x707d('0x3d')][_0x707d('0x55')]({'where':{'id':_0xdb193[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x5b6f23,null))[_0x707d('0x2b')](function(_0x455cf4){if(_0x455cf4){_0x15edf2=_0x455cf4;return _0x455cf4[_0x707d('0xbb')](_0xdb193['body'][_0x707d('0x81')],_['omit'](_0xdb193['body'],[_0x707d('0x81'),'id'])||{});}return null;})[_0x707d('0x9e')](function(_0x316bf2){var _0x43475f;_0x1e8fad=_0x316bf2||[];var _0x380bea=[];if(_0x316bf2){for(var _0xd43cd=0x0;_0xd43cd<_0x316bf2[_0x707d('0x54')];_0xd43cd+=0x1){var _0x327559=_0x316bf2[_0xd43cd]['get']({'plain':!![]});_0x43475f=squel['insert']()['into'](_0x707d('0xbc'))[_0x707d('0xb2')]([_0x707d('0xa5'),_0x707d('0xa3'),_0x707d('0xa4'),'VoiceQueueId','createdAt',_0x707d('0xa7')],squel[_0x707d('0x82')]()[_0x707d('0x83')](_0x707d('0xa5'),_0x707d('0xa5'))[_0x707d('0x83')]('id','ContactId')['field'](_0x327559[_0x707d('0xa6')][_0x707d('0x8a')](),'ListId')['field'](_0xdb193['params']['id'][_0x707d('0x8a')](),'VoiceQueueId')[_0x707d('0x83')]('NOW()','createdAt')[_0x707d('0x83')](_0x707d('0xbd'),_0x707d('0xa7'))[_0x707d('0x85')](_0x707d('0xaf'))[_0x707d('0x4a')](_0x707d('0xb0'))['where']('ListId\x20=\x20?',_0x327559[_0x707d('0xa6')]['toString']())[_0x707d('0x4a')](_0x707d('0xa9')))[_0x707d('0x8a')]();_0x380bea[_0x707d('0x89')](db[_0x707d('0x73')][_0x707d('0x42')](_0x43475f));}return BPromise['all'](_0x380bea);}})['then'](function(){return _0x1e8fad;})['then'](respondWithResult(_0x5b6f23,null))[_0x707d('0x51')](handleError(_0x5b6f23,null));};exports[_0x707d('0xbe')]=function(_0x1be10c,_0x264b2f,_0xab81bb){return db[_0x707d('0x3d')][_0x707d('0x55')]({'where':{'id':_0x1be10c['params']['id']}})[_0x707d('0x2b')](handleEntityNotFound(_0x264b2f,null))[_0x707d('0x2b')](function(_0x31f37c){if(_0x31f37c){return _0x31f37c[_0x707d('0xbe')](_0x1be10c[_0x707d('0x42')][_0x707d('0x81')]);}})[_0x707d('0x2b')](function(_0x11d313){if(_0x11d313){return db[_0x707d('0x6c')][_0x707d('0x2a')]({'where':{'ListId':_0x1be10c['query'][_0x707d('0x81')],'VoiceQueueId':_0x1be10c[_0x707d('0x53')]['id']}})[_0x707d('0x2b')](function(){return _0x11d313;});}})[_0x707d('0x2b')](respondWithStatusCode(_0x264b2f,null))[_0x707d('0x51')](handleError(_0x264b2f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0233e9d..48b5319 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 _0x7594=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue'];(function(_0x30de0f,_0x1d67fe){var _0x49fdb8=function(_0x5e043a){while(--_0x5e043a){_0x30de0f['push'](_0x30de0f['shift']());}};_0x49fdb8(++_0x1d67fe);}(_0x7594,0x1c0));var _0x4759=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x7594[_0xa9a245];return _0x2d0eaa;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x4759('0x0'))['db'][_0x4759('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4759('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4759('0x3'),'afterDestroy':_0x4759('0x4')};function emitEvent(_0x1b6871){return function(_0x37ac4d,_0x58e746,_0x55e9d7){VoiceQueueEvents['emit'](_0x1b6871+':'+_0x37ac4d['id'],_0x37ac4d);VoiceQueueEvents[_0x4759('0x5')](_0x1b6871,_0x37ac4d);_0x55e9d7(null);};}for(var e in events){if(events[_0x4759('0x6')](e)){var event=events[e];VoiceQueue[_0x4759('0x7')](e,emitEvent(event));}}module[_0x4759('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x3552=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1bd498,_0x14b925){var _0xb4473e=function(_0x367808){while(--_0x367808){_0x1bd498['push'](_0x1bd498['shift']());}};_0xb4473e(++_0x14b925);}(_0x3552,0x81));var _0x2355=function(_0x46dab5,_0x482784){_0x46dab5=_0x46dab5-0x0;var _0x175c4d=_0x3552[_0x46dab5];return _0x175c4d;};'use strict';var EventEmitter=require(_0x2355('0x0'));var VoiceQueue=require(_0x2355('0x1'))['db'][_0x2355('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2355('0x3')](0x0);var events={'afterCreate':_0x2355('0x4'),'afterUpdate':_0x2355('0x5'),'afterDestroy':_0x2355('0x6')};function emitEvent(_0xfe19df){return function(_0x4d41b3,_0xb5680f,_0x103871){VoiceQueueEvents['emit'](_0xfe19df+':'+_0x4d41b3['id'],_0x4d41b3);VoiceQueueEvents[_0x2355('0x7')](_0xfe19df,_0x4d41b3);_0x103871(null);};}for(var e in events){if(events[_0x2355('0x8')](e)){var event=events[e];VoiceQueue[_0x2355('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index acce2c4..b9c4ef9 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x3e74,0x175));var _0x43e7=function(_0x44de40,_0x10df88){_0x44de40=_0x44de40-0x0;var _0x47010d=_0x3e74[_0x44de40];return _0x47010d;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x403947,_0x3877d9){var _0x2b8e1a=function(_0x2bc7f3){while(--_0x2bc7f3){_0x403947['push'](_0x403947['shift']());}};_0x2b8e1a(++_0x3877d9);}(_0x008c,0x188));var _0xc008=function(_0x1d4c33,_0x30274f){_0x1d4c33=_0x1d4c33-0x0;var _0x3abfa2=_0x008c[_0x1d4c33];return _0x3abfa2;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 1b93e1d..bebd660 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 _0x13a1=['VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueue','VoiceQueue','options','raw','attributes','limit','include','map','model','info','stringify','ShowVoiceQueue','where','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x15c5f4,_0x39ba6d){var _0x34ded6=function(_0x3d8285){while(--_0x3d8285){_0x15c5f4['push'](_0x15c5f4['shift']());}};_0x34ded6(++_0x39ba6d);}(_0x13a1,0x1a9));var _0x113a=function(_0x253fee,_0x4fabdb){_0x253fee=_0x253fee-0x0;var _0x56198b=_0x13a1[_0x253fee];return _0x56198b;};'use strict';var _=require(_0x113a('0x0'));var util=require('util');var moment=require(_0x113a('0x1'));var BPromise=require(_0x113a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x113a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x113a('0x4'))(_0x113a('0x5'));var config=require(_0x113a('0x6'));var jayson=require(_0x113a('0x7'));var client=jayson[_0x113a('0x8')][_0x113a('0x9')]({'port':0x232a});config[_0x113a('0xa')]=_[_0x113a('0xb')](config[_0x113a('0xa')],{'host':_0x113a('0xc'),'port':0x18eb});var socket=require(_0x113a('0xd'))(new Redis(config[_0x113a('0xa')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2fd42e,_0x4ca055,_0x4400c6){return new BPromise(function(_0x33144c,_0x133a4f){return client[_0x113a('0xe')](_0x2fd42e,_0x4400c6)[_0x113a('0xf')](function(_0x43c9b8){logger['info'](_0x113a('0x10'),_0x4ca055,_0x113a('0x11'));logger[_0x113a('0x12')](_0x113a('0x13'),_0x4ca055,_0x113a('0x11'),JSON['stringify'](_0x43c9b8));if(_0x43c9b8[_0x113a('0x14')]){if(_0x43c9b8[_0x113a('0x14')][_0x113a('0x15')]===0x1f4){logger[_0x113a('0x14')](_0x113a('0x10'),_0x4ca055,_0x43c9b8[_0x113a('0x14')]['message']);return _0x133a4f(_0x43c9b8[_0x113a('0x14')][_0x113a('0x16')]);}logger[_0x113a('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x4ca055,_0x43c9b8[_0x113a('0x14')][_0x113a('0x16')]);return _0x33144c(_0x43c9b8[_0x113a('0x14')][_0x113a('0x16')]);}else{logger['info'](_0x113a('0x10'),_0x4ca055,_0x113a('0x11'));_0x33144c(_0x43c9b8['result'][_0x113a('0x16')]);}})[_0x113a('0x17')](function(_0x1cd294){logger[_0x113a('0x14')](_0x113a('0x10'),_0x4ca055,_0x1cd294);_0x133a4f(_0x1cd294);});});}exports[_0x113a('0x18')]=function(_0x2515d0){var _0x207f67=this;return new Promise(function(_0x5def6e,_0x282a8c){return db[_0x113a('0x19')]['findAll']({'raw':_0x2515d0[_0x113a('0x1a')]?_0x2515d0[_0x113a('0x1a')][_0x113a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2515d0[_0x113a('0x1a')]?_0x2515d0['options']['where']||null:null,'attributes':_0x2515d0[_0x113a('0x1a')]?_0x2515d0[_0x113a('0x1a')][_0x113a('0x1c')]||null:null,'limit':_0x2515d0[_0x113a('0x1a')]?_0x2515d0['options'][_0x113a('0x1d')]||null:null,'include':_0x2515d0[_0x113a('0x1a')]?_0x2515d0[_0x113a('0x1a')][_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x2515d0['options'][_0x113a('0x1e')],function(_0x1c99ac){return{'model':db[_0x1c99ac[_0x113a('0x20')]],'as':_0x1c99ac['as'],'attributes':_0x1c99ac[_0x113a('0x1c')],'include':_0x1c99ac[_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x1c99ac[_0x113a('0x1e')],function(_0x2415e1){return{'model':db[_0x2415e1[_0x113a('0x20')]],'as':_0x2415e1['as'],'attributes':_0x2415e1[_0x113a('0x1c')],'include':_0x2415e1[_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x2415e1[_0x113a('0x1e')],function(_0x2ee2a8){return{'model':db[_0x2ee2a8[_0x113a('0x20')]],'as':_0x2ee2a8['as'],'attributes':_0x2ee2a8[_0x113a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x113a('0xf')](function(_0x5abc2d){logger[_0x113a('0x21')]('GetVoiceQueue',_0x2515d0);logger['debug'](_0x113a('0x18'),_0x2515d0,JSON[_0x113a('0x22')](_0x5abc2d));_0x5def6e(_0x5abc2d);})[_0x113a('0x17')](function(_0xfe08e6){logger['error']('GetVoiceQueue',_0xfe08e6['message'],_0x2515d0);_0x282a8c(_0x207f67[_0x113a('0x14')](0x1f4,_0xfe08e6[_0x113a('0x16')]));});});};exports[_0x113a('0x23')]=function(_0x131967){var _0x4fd111=this;return new Promise(function(_0xebeed5,_0xc1b7f2){return db[_0x113a('0x19')]['find']({'raw':_0x131967['options']?_0x131967[_0x113a('0x1a')][_0x113a('0x1b')]===undefined?!![]:![]:!![],'where':_0x131967[_0x113a('0x1a')]?_0x131967[_0x113a('0x1a')][_0x113a('0x24')]||null:null,'attributes':_0x131967[_0x113a('0x1a')]?_0x131967['options'][_0x113a('0x1c')]||null:null,'include':_0x131967[_0x113a('0x1a')]?_0x131967[_0x113a('0x1a')][_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x131967['options']['include'],function(_0x49ac3a){return{'model':db[_0x49ac3a[_0x113a('0x20')]],'as':_0x49ac3a['as'],'attributes':_0x49ac3a[_0x113a('0x1c')],'include':_0x49ac3a[_0x113a('0x1e')]?_[_0x113a('0x1f')](_0x49ac3a[_0x113a('0x1e')],function(_0x562271){return{'model':db[_0x562271[_0x113a('0x20')]],'as':_0x562271['as'],'attributes':_0x562271[_0x113a('0x1c')],'include':_0x562271['include']?_[_0x113a('0x1f')](_0x562271['include'],function(_0x4590bc){return{'model':db[_0x4590bc[_0x113a('0x20')]],'as':_0x4590bc['as'],'attributes':_0x4590bc[_0x113a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x113a('0xf')](function(_0x208dde){logger['info'](_0x113a('0x23'),_0x131967);logger['debug'](_0x113a('0x23'),_0x131967,JSON[_0x113a('0x22')](_0x208dde));_0xebeed5(_0x208dde);})[_0x113a('0x17')](function(_0x383865){logger[_0x113a('0x14')](_0x113a('0x23'),_0x383865[_0x113a('0x16')],_0x131967);_0xc1b7f2(_0x4fd111[_0x113a('0x14')](0x1f4,_0x383865[_0x113a('0x16')]));});});}; \ No newline at end of file +var _0xa887=['request\x20sent','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','map','include','model','then','VoiceQueue','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x190667,_0x1a8d29){var _0x1b640e=function(_0x397d57){while(--_0x397d57){_0x190667['push'](_0x190667['shift']());}};_0x1b640e(++_0x1a8d29);}(_0xa887,0x132));var _0x7a88=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa887[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x7a88('0x0'));var util=require(_0x7a88('0x1'));var moment=require(_0x7a88('0x2'));var BPromise=require(_0x7a88('0x3'));var rs=require(_0x7a88('0x4'));var fs=require('fs');var Redis=require(_0x7a88('0x5'));var db=require(_0x7a88('0x6'))['db'];var utils=require(_0x7a88('0x7'));var logger=require(_0x7a88('0x8'))(_0x7a88('0x9'));var config=require(_0x7a88('0xa'));var jayson=require(_0x7a88('0xb'));var client=jayson[_0x7a88('0xc')][_0x7a88('0xd')]({'port':0x232a});config[_0x7a88('0xe')]=_[_0x7a88('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7a88('0x10'))(new Redis(config[_0x7a88('0xe')]));require('./voiceQueue.socket')[_0x7a88('0x11')](socket);function respondWithRpcPromise(_0x2b8e77,_0x138459,_0x3ba996){return new BPromise(function(_0xeb0f69,_0x407fba){return client[_0x7a88('0x12')](_0x2b8e77,_0x3ba996)['then'](function(_0x16fce6){logger[_0x7a88('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x138459,'request\x20sent');logger[_0x7a88('0x14')](_0x7a88('0x15'),_0x138459,_0x7a88('0x16'),JSON[_0x7a88('0x17')](_0x16fce6));if(_0x16fce6[_0x7a88('0x18')]){if(_0x16fce6['error']['code']===0x1f4){logger[_0x7a88('0x18')](_0x7a88('0x19'),_0x138459,_0x16fce6[_0x7a88('0x18')][_0x7a88('0x1a')]);return _0x407fba(_0x16fce6[_0x7a88('0x18')][_0x7a88('0x1a')]);}logger[_0x7a88('0x18')](_0x7a88('0x19'),_0x138459,_0x16fce6[_0x7a88('0x18')]['message']);return _0xeb0f69(_0x16fce6[_0x7a88('0x18')][_0x7a88('0x1a')]);}else{logger['info'](_0x7a88('0x19'),_0x138459,_0x7a88('0x16'));_0xeb0f69(_0x16fce6[_0x7a88('0x1b')]['message']);}})[_0x7a88('0x1c')](function(_0x36de27){logger[_0x7a88('0x18')](_0x7a88('0x19'),_0x138459,_0x36de27);_0x407fba(_0x36de27);});});}exports[_0x7a88('0x1d')]=function(_0x1f97ec){var _0x32998b=this;return new Promise(function(_0x85c9a7,_0x1a4b2e){return db['VoiceQueue'][_0x7a88('0x1e')]({'raw':_0x1f97ec[_0x7a88('0x1f')]?_0x1f97ec[_0x7a88('0x1f')][_0x7a88('0x20')]===undefined?!![]:![]:!![],'where':_0x1f97ec[_0x7a88('0x1f')]?_0x1f97ec[_0x7a88('0x1f')][_0x7a88('0x21')]||null:null,'attributes':_0x1f97ec[_0x7a88('0x1f')]?_0x1f97ec[_0x7a88('0x1f')][_0x7a88('0x22')]||null:null,'limit':_0x1f97ec[_0x7a88('0x1f')]?_0x1f97ec[_0x7a88('0x1f')]['limit']||null:null,'include':_0x1f97ec[_0x7a88('0x1f')]?_0x1f97ec['options']['include']?_['map'](_0x1f97ec[_0x7a88('0x1f')]['include'],function(_0x139b07){return{'model':db[_0x139b07['model']],'as':_0x139b07['as'],'attributes':_0x139b07[_0x7a88('0x22')],'include':_0x139b07['include']?_[_0x7a88('0x23')](_0x139b07[_0x7a88('0x24')],function(_0x1dd328){return{'model':db[_0x1dd328[_0x7a88('0x25')]],'as':_0x1dd328['as'],'attributes':_0x1dd328[_0x7a88('0x22')],'include':_0x1dd328[_0x7a88('0x24')]?_['map'](_0x1dd328[_0x7a88('0x24')],function(_0x219f39){return{'model':db[_0x219f39[_0x7a88('0x25')]],'as':_0x219f39['as'],'attributes':_0x219f39[_0x7a88('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7a88('0x26')](function(_0x334893){logger[_0x7a88('0x13')]('GetVoiceQueue',_0x1f97ec);logger[_0x7a88('0x14')](_0x7a88('0x1d'),_0x1f97ec,JSON[_0x7a88('0x17')](_0x334893));_0x85c9a7(_0x334893);})[_0x7a88('0x1c')](function(_0x501a06){logger['error'](_0x7a88('0x1d'),_0x501a06[_0x7a88('0x1a')],_0x1f97ec);_0x1a4b2e(_0x32998b[_0x7a88('0x18')](0x1f4,_0x501a06[_0x7a88('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x388239){var _0xb80c40=this;return new Promise(function(_0x1ac7d8,_0x292baa){return db[_0x7a88('0x27')]['find']({'raw':_0x388239['options']?_0x388239['options'][_0x7a88('0x20')]===undefined?!![]:![]:!![],'where':_0x388239[_0x7a88('0x1f')]?_0x388239[_0x7a88('0x1f')]['where']||null:null,'attributes':_0x388239[_0x7a88('0x1f')]?_0x388239[_0x7a88('0x1f')][_0x7a88('0x22')]||null:null,'include':_0x388239[_0x7a88('0x1f')]?_0x388239[_0x7a88('0x1f')]['include']?_['map'](_0x388239[_0x7a88('0x1f')][_0x7a88('0x24')],function(_0x47aeb5){return{'model':db[_0x47aeb5['model']],'as':_0x47aeb5['as'],'attributes':_0x47aeb5['attributes'],'include':_0x47aeb5[_0x7a88('0x24')]?_[_0x7a88('0x23')](_0x47aeb5['include'],function(_0x366110){return{'model':db[_0x366110[_0x7a88('0x25')]],'as':_0x366110['as'],'attributes':_0x366110[_0x7a88('0x22')],'include':_0x366110[_0x7a88('0x24')]?_[_0x7a88('0x23')](_0x366110[_0x7a88('0x24')],function(_0x509689){return{'model':db[_0x509689[_0x7a88('0x25')]],'as':_0x509689['as'],'attributes':_0x509689[_0x7a88('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7a88('0x26')](function(_0x545fb0){logger[_0x7a88('0x13')](_0x7a88('0x28'),_0x388239);logger[_0x7a88('0x14')](_0x7a88('0x28'),_0x388239,JSON[_0x7a88('0x17')](_0x545fb0));_0x1ac7d8(_0x545fb0);})['catch'](function(_0x34eb54){logger[_0x7a88('0x18')](_0x7a88('0x28'),_0x34eb54[_0x7a88('0x1a')],_0x388239);_0x292baa(_0xb80c40[_0x7a88('0x18')](0x1f4,_0x34eb54[_0x7a88('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 8e6c1a0..335b888 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 _0xcbc8=['remove','emit','removeListener','register','voiceQueue:','./voiceQueue.events','save'];(function(_0x3e385c,_0x24e848){var _0x4c6171=function(_0x1825c7){while(--_0x1825c7){_0x3e385c['push'](_0x3e385c['shift']());}};_0x4c6171(++_0x24e848);}(_0xcbc8,0x1da));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0x8cbc('0x0'));var events=[_0x8cbc('0x1'),_0x8cbc('0x2'),'update'];function createListener(_0x20a1a5,_0x528e61){return function(_0xf47d61){_0x528e61[_0x8cbc('0x3')](_0x20a1a5,_0xf47d61);};}function removeListener(_0x3c9cb0,_0x81801b){return function(){VoiceQueueEvents[_0x8cbc('0x4')](_0x3c9cb0,_0x81801b);};}exports[_0x8cbc('0x5')]=function(_0x22c4e3){for(var _0x3cba83=0x0,_0x3a69d9=events['length'];_0x3cba83<_0x3a69d9;_0x3cba83++){var _0x5e9b5c=events[_0x3cba83];var _0x390398=createListener(_0x8cbc('0x6')+_0x5e9b5c,_0x22c4e3);VoiceQueueEvents['on'](_0x5e9b5c,_0x390398);}}; \ No newline at end of file +var _0x3523=['length','voiceQueue:','./voiceQueue.events','update','removeListener','register'];(function(_0x268988,_0x11b770){var _0x1579e5=function(_0x292dd0){while(--_0x292dd0){_0x268988['push'](_0x268988['shift']());}};_0x1579e5(++_0x11b770);}(_0x3523,0x86));var _0x3352=function(_0x4ac6a0,_0x4d28f9){_0x4ac6a0=_0x4ac6a0-0x0;var _0x1d9a5e=_0x3523[_0x4ac6a0];return _0x1d9a5e;};'use strict';var VoiceQueueEvents=require(_0x3352('0x0'));var events=['save','remove',_0x3352('0x1')];function createListener(_0x527a4c,_0x33f55b){return function(_0x5145db){_0x33f55b['emit'](_0x527a4c,_0x5145db);};}function removeListener(_0x14ec01,_0x578327){return function(){VoiceQueueEvents[_0x3352('0x2')](_0x14ec01,_0x578327);};}exports[_0x3352('0x3')]=function(_0x4ac969){for(var _0x58a426=0x0,_0x42e99e=events[_0x3352('0x4')];_0x58a426<_0x42e99e;_0x58a426++){var _0x2f35a1=events[_0x58a426];var _0x5ea0f0=createListener(_0x3352('0x5')+_0x2f35a1,_0x4ac969);VoiceQueueEvents['on'](_0x2f35a1,_0x5ea0f0);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8b62c3d..2298d29 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 _0xd17e=['show','post','create','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','/index','getVoiceQueuesReport','/:id'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xd17e,0xa5));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xed17('0x0'));var util=require(_0xed17('0x1'));var path=require(_0xed17('0x2'));var timeout=require('connect-timeout');var express=require(_0xed17('0x3'));var router=express[_0xed17('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed17('0x5'));var interaction=require(_0xed17('0x6'));var config=require('../../config/environment');var controller=require(_0xed17('0x7'));router[_0xed17('0x8')]('/',auth['isAuthenticated'](),controller[_0xed17('0x9')]);router[_0xed17('0x8')](_0xed17('0xa'),auth[_0xed17('0xb')](),controller['describe']);router[_0xed17('0x8')](_0xed17('0xc'),auth[_0xed17('0xb')](),controller[_0xed17('0xd')]);router[_0xed17('0x8')](_0xed17('0xe'),auth[_0xed17('0xb')](),controller[_0xed17('0xf')]);router[_0xed17('0x10')]('/',auth[_0xed17('0xb')](),controller[_0xed17('0x11')]);router[_0xed17('0x12')]('/:id',auth[_0xed17('0xb')](),controller['update']);router['delete']('/:id',auth[_0xed17('0xb')](),controller[_0xed17('0x13')]);module['exports']=router; \ No newline at end of file +var _0x196a=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','update','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x196a,0x1a1));var _0xa196=function(_0x59719b,_0x2d394f){_0x59719b=_0x59719b-0x0;var _0x2c3c8e=_0x196a[_0x59719b];return _0x2c3c8e;};'use strict';var multer=require('multer');var util=require(_0xa196('0x0'));var path=require(_0xa196('0x1'));var timeout=require(_0xa196('0x2'));var express=require(_0xa196('0x3'));var router=express[_0xa196('0x4')]();var fs_extra=require(_0xa196('0x5'));var auth=require(_0xa196('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa196('0x7'));var controller=require(_0xa196('0x8'));router['get']('/',auth[_0xa196('0x9')](),controller[_0xa196('0xa')]);router[_0xa196('0xb')](_0xa196('0xc'),auth['isAuthenticated'](),controller[_0xa196('0xd')]);router['get']('/index',auth[_0xa196('0x9')](),controller['getVoiceQueuesReport']);router[_0xa196('0xb')]('/:id',auth[_0xa196('0x9')](),controller['show']);router[_0xa196('0xe')]('/',auth[_0xa196('0x9')](),controller[_0xa196('0xf')]);router[_0xa196('0x10')]('/:id',auth[_0xa196('0x9')](),controller[_0xa196('0x11')]);router[_0xa196('0x12')](_0xa196('0x13'),auth[_0xa196('0x9')](),controller[_0xa196('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 0f60bb1..edbcc54 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 _0x2131=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x2131,0x123));var _0x1213=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x2131[_0x20cf8a];return _0x54e165;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1213('0x0'));module['exports']={'type':{'type':Sequelize[_0x1213('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1213('0x1')]},'calleridname':{'type':Sequelize[_0x1213('0x1')]},'queue':{'type':Sequelize[_0x1213('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x1213('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x1213('0x2')],'set':function(_0x757b4f){var _0x3e5742=moment(_0x757b4f);var _0x19b85e=moment(this['getDataValue'](_0x1213('0x3')))[_0x1213('0x4')](_0x1213('0x5'));var _0x3a2743=_0x3e5742[_0x1213('0x6')](_0x19b85e,_0x1213('0x7'));this[_0x1213('0x8')](_0x1213('0x9'),_0x757b4f);this['setDataValue']('holdtime',_0x3a2743||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x1213('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1213('0x2')]},'queuecallerexit':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1213('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x1213('0x1')],'comment':_0x1213('0xc')},'originalposition':{'type':Sequelize[_0x1213('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1213('0x1')]},'connectedlinename':{'type':Sequelize[_0x1213('0x1')]},'accountcode':{'type':Sequelize[_0x1213('0x1')]},'context':{'type':Sequelize[_0x1213('0x1')]},'exten':{'type':Sequelize[_0x1213('0x1')]},'priority':{'type':Sequelize[_0x1213('0x1')]},'holdtime':{'type':Sequelize[_0x1213('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1213('0x1')]},'transfer':{'type':Sequelize[_0x1213('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1213('0x1')],'comment':_0x1213('0xd')},'transferexten':{'type':Sequelize[_0x1213('0x1')]},'transferuniqueid':{'type':Sequelize[_0x1213('0x1')]},'disposition':{'type':Sequelize[_0x1213('0x1')]},'secondDisposition':{'type':Sequelize[_0x1213('0x1')]},'thirdDisposition':{'type':Sequelize[_0x1213('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x1213('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1494=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x478457,_0x33e861){var _0x9d5d95=function(_0xc10b9b){while(--_0xc10b9b){_0x478457['push'](_0x478457['shift']());}};_0x9d5d95(++_0x33e861);}(_0x1494,0x122));var _0x4149=function(_0x239383,_0x5eed33){_0x239383=_0x239383-0x0;var _0x4d5c13=_0x1494[_0x239383];return _0x4d5c13;};'use strict';var Sequelize=require(_0x4149('0x0'));var moment=require(_0x4149('0x1'));module[_0x4149('0x2')]={'type':{'type':Sequelize[_0x4149('0x3')]},'uniqueid':{'type':Sequelize[_0x4149('0x3')]},'calleridnum':{'type':Sequelize[_0x4149('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4149('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x4149('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x4149('0x4')],'set':function(_0x3d7aaf){var _0x8c2d63=moment(_0x3d7aaf);var _0x4d4b7f=moment(this[_0x4149('0x5')]('queuecallerjoinAt'))[_0x4149('0x6')](_0x4149('0x7'));var _0x4b9eb7=_0x8c2d63['diff'](_0x4d4b7f,_0x4149('0x8'));this[_0x4149('0x9')](_0x4149('0xa'),_0x3d7aaf);this[_0x4149('0x9')](_0x4149('0xb'),_0x4b9eb7||null);}},'position':{'type':Sequelize[_0x4149('0xc')]},'count':{'type':Sequelize[_0x4149('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x4149('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x4149('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4149('0x4')]},'queuecallerexit':{'type':Sequelize[_0x4149('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x4149('0x3')],'comment':_0x4149('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x4149('0x3')]},'connectedlinenum':{'type':Sequelize[_0x4149('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4149('0x3')]},'context':{'type':Sequelize[_0x4149('0x3')]},'exten':{'type':Sequelize[_0x4149('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x4149('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4149('0x3')]},'transfer':{'type':Sequelize[_0x4149('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4149('0x3')],'comment':_0x4149('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x4149('0x3')]},'disposition':{'type':Sequelize[_0x4149('0x3')]},'secondDisposition':{'type':Sequelize[_0x4149('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4149('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x4149('0xc')],'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 bd79d09..36090df 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 _0x94ad=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','count','limit','set','save','then','destroy','end','sendStatus','error','stack','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','length','attributes','nolimit','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','VoiceQueueReport','findAll','rows','catch','create','update','body','find','params','describe','hasOwnProperty','order','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis'];(function(_0x3f9a1b,_0x474051){var _0xb419cd=function(_0x5a8633){while(--_0x5a8633){_0x3f9a1b['push'](_0x3f9a1b['shift']());}};_0xb419cd(++_0x474051);}(_0x94ad,0x1e0));var _0xd94a=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x94ad[_0x381589];return _0x2a075d;};'use strict';var emlformat=require(_0xd94a('0x0'));var rimraf=require(_0xd94a('0x1'));var zipdir=require(_0xd94a('0x2'));var jsonpatch=require(_0xd94a('0x3'));var rp=require(_0xd94a('0x4'));var moment=require(_0xd94a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd94a('0x6'));var util=require(_0xd94a('0x7'));var path=require('path');var sox=require(_0xd94a('0x8'));var csv=require('to-csv');var ejs=require(_0xd94a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd94a('0xa'));var squel=require(_0xd94a('0xb'));var crypto=require(_0xd94a('0xc'));var jsforce=require(_0xd94a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd94a('0xe'));var querystring=require(_0xd94a('0xf'));var Papa=require(_0xd94a('0x10'));var Redis=require(_0xd94a('0x11'));var authService=require(_0xd94a('0x12'));var qs=require(_0xd94a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd94a('0x14'));var logger=require(_0xd94a('0x15'))(_0xd94a('0x16'));var utils=require(_0xd94a('0x17'));var config=require(_0xd94a('0x18'));var licenseUtil=require(_0xd94a('0x19'));var db=require(_0xd94a('0x1a'))['db'];config[_0xd94a('0x1b')]=_['defaults'](config['redis'],{'host':_0xd94a('0x1c'),'port':0x18eb});var socket=require(_0xd94a('0x1d'))(new Redis(config['redis']));require(_0xd94a('0x1e'))[_0xd94a('0x1f')](socket);function respondWithStatusCode(_0x1649c3,_0x967673){_0x967673=_0x967673||0xcc;return function(_0x5b8ae2){if(_0x5b8ae2){return _0x1649c3['sendStatus'](_0x967673);}return _0x1649c3['status'](_0x967673)['end']();};}function respondWithResult(_0x2e7448,_0x1133a0){_0x1133a0=_0x1133a0||0xc8;return function(_0x155f19){if(_0x155f19){return _0x2e7448[_0xd94a('0x20')](_0x1133a0)[_0xd94a('0x21')](_0x155f19);}};}function respondWithFilteredResult(_0x5c7f2d,_0x55c9cf){return function(_0x3c59bb){if(_0x3c59bb){var _0x2312d5=typeof _0x55c9cf[_0xd94a('0x22')]==='undefined'&&typeof _0x55c9cf['limit']===_0xd94a('0x23');var _0x4c1a29=_0x3c59bb[_0xd94a('0x24')];var _0x2d42c4=_0x2312d5?0x0:_0x55c9cf[_0xd94a('0x22')];var _0x486501=_0x2312d5?_0x3c59bb[_0xd94a('0x24')]:_0x55c9cf[_0xd94a('0x22')]+_0x55c9cf[_0xd94a('0x25')];var _0x125589;if(_0x486501>=_0x4c1a29){_0x486501=_0x4c1a29;_0x125589=0xc8;}else{_0x125589=0xce;}_0x5c7f2d[_0xd94a('0x20')](_0x125589);return _0x5c7f2d[_0xd94a('0x26')]('Content-Range',_0x2d42c4+'-'+_0x486501+'/'+_0x4c1a29)[_0xd94a('0x21')](_0x3c59bb);}return null;};}function patchUpdates(_0x25a773){return function(_0x5b647b){try{jsonpatch['apply'](_0x5b647b,_0x25a773,!![]);}catch(_0x2f27c0){return BPromise['reject'](_0x2f27c0);}return _0x5b647b[_0xd94a('0x27')]();};}function saveUpdates(_0x1a3b51,_0x2d5639){return function(_0x1ae79b){if(_0x1ae79b){return _0x1ae79b['update'](_0x1a3b51)[_0xd94a('0x28')](function(_0x5889bf){return _0x5889bf;});}return null;};}function removeEntity(_0x34e36c,_0x2bf5e9){return function(_0x375719){if(_0x375719){return _0x375719[_0xd94a('0x29')]()['then'](function(){_0x34e36c[_0xd94a('0x20')](0xcc)[_0xd94a('0x2a')]();});}};}function handleEntityNotFound(_0x2e5e79,_0x5d26ed){return function(_0x3c78be){if(!_0x3c78be){_0x2e5e79[_0xd94a('0x2b')](0x194);}return _0x3c78be;};}function handleError(_0x3f9a29,_0x3e0489){_0x3e0489=_0x3e0489||0x1f4;return function(_0x39a290){logger[_0xd94a('0x2c')](_0x39a290[_0xd94a('0x2d')]);if(_0x39a290['name']){delete _0x39a290['name'];}_0x3f9a29[_0xd94a('0x20')](_0x3e0489)['send'](_0x39a290);};}exports['index']=function(_0x127d90,_0x371e98){var _0x2bb283={},_0x3df9fc={},_0x3216ba={'count':0x0,'rows':[]};var _0x5ea7ed=_['map'](db['VoiceQueueReport'][_0xd94a('0x2e')],function(_0x269176){return{'name':_0x269176[_0xd94a('0x2f')],'type':_0x269176[_0xd94a('0x30')][_0xd94a('0x31')]};});_0x3df9fc[_0xd94a('0x32')]=_['map'](_0x5ea7ed,_0xd94a('0x33'));_0x3df9fc[_0xd94a('0x34')]=_[_0xd94a('0x35')](_0x127d90[_0xd94a('0x34')]);_0x3df9fc['filters']=_[_0xd94a('0x36')](_0x3df9fc[_0xd94a('0x32')],_0x3df9fc[_0xd94a('0x34')]);_0x2bb283['attributes']=_[_0xd94a('0x36')](_0x3df9fc[_0xd94a('0x32')],qs[_0xd94a('0x37')](_0x127d90[_0xd94a('0x34')][_0xd94a('0x37')]));_0x2bb283['attributes']=_0x2bb283['attributes'][_0xd94a('0x38')]?_0x2bb283[_0xd94a('0x39')]:_0x3df9fc[_0xd94a('0x32')];if(!_0x127d90[_0xd94a('0x34')]['hasOwnProperty'](_0xd94a('0x3a'))){_0x2bb283[_0xd94a('0x25')]=qs[_0xd94a('0x25')](_0x127d90[_0xd94a('0x34')]['limit']);_0x2bb283[_0xd94a('0x22')]=qs['offset'](_0x127d90[_0xd94a('0x34')][_0xd94a('0x22')]);}_0x2bb283['order']=qs['sort'](_0x127d90[_0xd94a('0x34')][_0xd94a('0x3b')]);_0x2bb283['where']=qs[_0xd94a('0x3c')](_[_0xd94a('0x3d')](_0x127d90[_0xd94a('0x34')],_0x3df9fc['filters']),_0x5ea7ed);if(_0x127d90[_0xd94a('0x34')][_0xd94a('0x3e')]){_0x2bb283[_0xd94a('0x3f')]=_[_0xd94a('0x40')](_0x2bb283[_0xd94a('0x3f')],{'$or':_[_0xd94a('0x41')](_0x5ea7ed,function(_0xc11af2){if(_0xc11af2['type']!==_0xd94a('0x42')){var _0x49fdbb={};_0x49fdbb[_0xc11af2[_0xd94a('0x33')]]={'$like':'%'+_0x127d90['query'][_0xd94a('0x3e')]+'%'};return _0x49fdbb;}})});}_0x2bb283=_[_0xd94a('0x40')]({},_0x2bb283,_0x127d90[_0xd94a('0x43')]);var _0x40daf1={'where':_0x2bb283[_0xd94a('0x3f')]};return db['VoiceQueueReport'][_0xd94a('0x24')](_0x40daf1)[_0xd94a('0x28')](function(_0x2d2338){_0x3216ba[_0xd94a('0x24')]=_0x2d2338;if(_0x127d90[_0xd94a('0x34')][_0xd94a('0x44')]){_0x2bb283[_0xd94a('0x45')]=[{'all':!![]}];}return db[_0xd94a('0x46')][_0xd94a('0x47')](_0x2bb283);})['then'](function(_0x1488a0){_0x3216ba[_0xd94a('0x48')]=_0x1488a0;return _0x3216ba;})[_0xd94a('0x28')](respondWithFilteredResult(_0x371e98,_0x2bb283))[_0xd94a('0x49')](handleError(_0x371e98,null));};exports['show']=function(_0x28de9b,_0x1ee058){var _0x57f9e1={'raw':![],'where':{'id':_0x28de9b['params']['id']}},_0x49ad47={};_0x49ad47[_0xd94a('0x32')]=_[_0xd94a('0x35')](db[_0xd94a('0x46')][_0xd94a('0x2e')]);_0x49ad47['query']=_[_0xd94a('0x35')](_0x28de9b[_0xd94a('0x34')]);_0x49ad47['filters']=_[_0xd94a('0x36')](_0x49ad47[_0xd94a('0x32')],_0x49ad47[_0xd94a('0x34')]);_0x57f9e1['attributes']=_['intersection'](_0x49ad47[_0xd94a('0x32')],qs['fields'](_0x28de9b[_0xd94a('0x34')]['fields']));_0x57f9e1['attributes']=_0x57f9e1['attributes'][_0xd94a('0x38')]?_0x57f9e1[_0xd94a('0x39')]:_0x49ad47['model'];if(_0x28de9b['query'][_0xd94a('0x44')]){_0x57f9e1[_0xd94a('0x45')]=[{'all':!![]}];}_0x57f9e1=_[_0xd94a('0x40')]({},_0x57f9e1,_0x28de9b[_0xd94a('0x43')]);return db[_0xd94a('0x46')]['find'](_0x57f9e1)[_0xd94a('0x28')](handleEntityNotFound(_0x1ee058,null))[_0xd94a('0x28')](respondWithResult(_0x1ee058,null))[_0xd94a('0x49')](handleError(_0x1ee058,null));};exports[_0xd94a('0x4a')]=function(_0x2ad0e0,_0x54ceba){return db[_0xd94a('0x46')]['create'](_0x2ad0e0['body'],{})['then'](respondWithResult(_0x54ceba,0xc9))[_0xd94a('0x49')](handleError(_0x54ceba,null));};exports[_0xd94a('0x4b')]=function(_0x2f7769,_0x31962b){if(_0x2f7769[_0xd94a('0x4c')]['id']){delete _0x2f7769[_0xd94a('0x4c')]['id'];}return db['VoiceQueueReport'][_0xd94a('0x4d')]({'where':{'id':_0x2f7769[_0xd94a('0x4e')]['id']}})[_0xd94a('0x28')](handleEntityNotFound(_0x31962b,null))[_0xd94a('0x28')](saveUpdates(_0x2f7769[_0xd94a('0x4c')],null))[_0xd94a('0x28')](respondWithResult(_0x31962b,null))[_0xd94a('0x49')](handleError(_0x31962b,null));};exports[_0xd94a('0x29')]=function(_0xac7846,_0x14216c){return db['VoiceQueueReport'][_0xd94a('0x4d')]({'where':{'id':_0xac7846[_0xd94a('0x4e')]['id']}})[_0xd94a('0x28')](handleEntityNotFound(_0x14216c,null))['then'](removeEntity(_0x14216c,null))[_0xd94a('0x49')](handleError(_0x14216c,null));};exports[_0xd94a('0x4f')]=function(_0x5a7ab8,_0x339c3f){return db[_0xd94a('0x46')]['describe']()['then'](respondWithResult(_0x339c3f,null))[_0xd94a('0x49')](handleError(_0x339c3f,null));};exports['getVoiceQueuesReport']=function(_0x3c3fef,_0x269a9d){var _0x4d2a5a={},_0x32c662={},_0x2fdf7b={'count':0x0,'rows':[]};_0x32c662[_0xd94a('0x32')]=_[_0xd94a('0x35')](db[_0xd94a('0x46')]['rawAttributes']);_0x32c662[_0xd94a('0x34')]=_[_0xd94a('0x35')](_0x3c3fef['query']);_0x32c662[_0xd94a('0x3c')]=_[_0xd94a('0x36')](_0x32c662[_0xd94a('0x32')],_0x32c662[_0xd94a('0x34')]);_0x4d2a5a[_0xd94a('0x39')]=_[_0xd94a('0x36')](_0x32c662[_0xd94a('0x32')],qs[_0xd94a('0x37')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x37')]));_0x4d2a5a['attributes']=_0x4d2a5a[_0xd94a('0x39')][_0xd94a('0x38')]?_0x4d2a5a['attributes']:_0x32c662['model'];if(!_0x3c3fef['query'][_0xd94a('0x50')](_0xd94a('0x3a'))){_0x4d2a5a[_0xd94a('0x25')]=qs[_0xd94a('0x25')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x25')]);_0x4d2a5a[_0xd94a('0x22')]=qs[_0xd94a('0x22')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x22')]);}_0x4d2a5a[_0xd94a('0x51')]=qs[_0xd94a('0x3b')](_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x3b')]);_0x4d2a5a[_0xd94a('0x3f')]=qs[_0xd94a('0x3c')](_['pick'](_0x3c3fef[_0xd94a('0x34')],_0x32c662['filters']));if(_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x3e')]){_0x4d2a5a[_0xd94a('0x3f')]=_[_0xd94a('0x40')](_0x4d2a5a[_0xd94a('0x3f')],{'$or':_[_0xd94a('0x41')](_0x4d2a5a[_0xd94a('0x39')],function(_0x4a5b4c){var _0x19eed9={};_0x19eed9[_0x4a5b4c]={'$like':'%'+_0x3c3fef[_0xd94a('0x34')]['filter']+'%'};return _0x19eed9;})});}_0x4d2a5a=_[_0xd94a('0x40')]({},_0x4d2a5a,_0x3c3fef[_0xd94a('0x43')]);var _0x4d5619={'where':_0x4d2a5a[_0xd94a('0x3f')]};return db['VoiceQueueReport']['count'](_0x4d5619)[_0xd94a('0x28')](function(_0xe5d874){_0x2fdf7b['count']=_0xe5d874;if(_0x3c3fef[_0xd94a('0x34')][_0xd94a('0x44')]){_0x4d2a5a[_0xd94a('0x45')]=[{'all':!![]}];}return db[_0xd94a('0x46')][_0xd94a('0x47')](_0x4d2a5a);})[_0xd94a('0x28')](function(_0x2412f0){_0x2fdf7b[_0xd94a('0x48')]=_0x2412f0;return _0x2fdf7b;})[_0xd94a('0x28')](respondWithFilteredResult(_0x269a9d,_0x4d2a5a,_0xd94a('0x52')))[_0xd94a('0x49')](handleError(_0x269a9d,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x62ce=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','error','stack','send','index','map','VoiceQueueReport','rawAttributes','fieldName','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','create','body','update','params','destroy','find','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x13c976,_0x57216f){var _0x342f1f=function(_0xffe87d){while(--_0xffe87d){_0x13c976['push'](_0x13c976['shift']());}};_0x342f1f(++_0x57216f);}(_0x62ce,0xee));var _0xe62c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x62ce[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xe62c('0x0'));var rimraf=require(_0xe62c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe62c('0x2'));var rp=require(_0xe62c('0x3'));var moment=require(_0xe62c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe62c('0x5'));var sox=require('sox');var csv=require(_0xe62c('0x6'));var ejs=require(_0xe62c('0x7'));var fs=require('fs');var fs_extra=require(_0xe62c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe62c('0x9'));var jsforce=require(_0xe62c('0xa'));var deskjs=require(_0xe62c('0xb'));var toCsv=require(_0xe62c('0x6'));var querystring=require(_0xe62c('0xc'));var Papa=require(_0xe62c('0xd'));var Redis=require(_0xe62c('0xe'));var authService=require(_0xe62c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe62c('0x10'));var hardwareService=require(_0xe62c('0x11'));var logger=require(_0xe62c('0x12'))('api');var utils=require(_0xe62c('0x13'));var config=require(_0xe62c('0x14'));var licenseUtil=require(_0xe62c('0x15'));var db=require(_0xe62c('0x16'))['db'];config['redis']=_[_0xe62c('0x17')](config['redis'],{'host':_0xe62c('0x18'),'port':0x18eb});var socket=require(_0xe62c('0x19'))(new Redis(config[_0xe62c('0x1a')]));require(_0xe62c('0x1b'))[_0xe62c('0x1c')](socket);function respondWithStatusCode(_0x20c611,_0x58cde4){_0x58cde4=_0x58cde4||0xcc;return function(_0xbd7f9a){if(_0xbd7f9a){return _0x20c611[_0xe62c('0x1d')](_0x58cde4);}return _0x20c611[_0xe62c('0x1e')](_0x58cde4)[_0xe62c('0x1f')]();};}function respondWithResult(_0x4a1748,_0x50a710){_0x50a710=_0x50a710||0xc8;return function(_0x5271c2){if(_0x5271c2){return _0x4a1748[_0xe62c('0x1e')](_0x50a710)[_0xe62c('0x20')](_0x5271c2);}};}function respondWithFilteredResult(_0x2632f8,_0x1f2667){return function(_0x19139f){if(_0x19139f){var _0x2ee697=typeof _0x1f2667[_0xe62c('0x21')]===_0xe62c('0x22')&&typeof _0x1f2667['limit']===_0xe62c('0x22');var _0x58c391=_0x19139f['count'];var _0x1ca7b3=_0x2ee697?0x0:_0x1f2667[_0xe62c('0x21')];var _0x246a3e=_0x2ee697?_0x19139f[_0xe62c('0x23')]:_0x1f2667[_0xe62c('0x21')]+_0x1f2667[_0xe62c('0x24')];var _0x2fdfd7;if(_0x246a3e>=_0x58c391){_0x246a3e=_0x58c391;_0x2fdfd7=0xc8;}else{_0x2fdfd7=0xce;}_0x2632f8[_0xe62c('0x1e')](_0x2fdfd7);return _0x2632f8[_0xe62c('0x25')](_0xe62c('0x26'),_0x1ca7b3+'-'+_0x246a3e+'/'+_0x58c391)['json'](_0x19139f);}return null;};}function patchUpdates(_0x5b5839){return function(_0x141cb5){try{jsonpatch['apply'](_0x141cb5,_0x5b5839,!![]);}catch(_0x1bf239){return BPromise[_0xe62c('0x27')](_0x1bf239);}return _0x141cb5[_0xe62c('0x28')]();};}function saveUpdates(_0x4a5e17,_0x368057){return function(_0x321b90){if(_0x321b90){return _0x321b90['update'](_0x4a5e17)[_0xe62c('0x29')](function(_0x5c79ca){return _0x5c79ca;});}return null;};}function removeEntity(_0x4ad7c6,_0x26f748){return function(_0x5f3943){if(_0x5f3943){return _0x5f3943['destroy']()[_0xe62c('0x29')](function(){_0x4ad7c6[_0xe62c('0x1e')](0xcc)[_0xe62c('0x1f')]();});}};}function handleEntityNotFound(_0x322498,_0x367256){return function(_0x1a3cc6){if(!_0x1a3cc6){_0x322498['sendStatus'](0x194);}return _0x1a3cc6;};}function handleError(_0x13e955,_0x2584bf){_0x2584bf=_0x2584bf||0x1f4;return function(_0x225f5f){logger[_0xe62c('0x2a')](_0x225f5f[_0xe62c('0x2b')]);if(_0x225f5f['name']){delete _0x225f5f['name'];}_0x13e955['status'](_0x2584bf)[_0xe62c('0x2c')](_0x225f5f);};}exports[_0xe62c('0x2d')]=function(_0x2a70ff,_0x3ae083){var _0x23c6ed={},_0x455b1c={},_0x4b2c06={'count':0x0,'rows':[]};var _0x26dd68=_[_0xe62c('0x2e')](db[_0xe62c('0x2f')][_0xe62c('0x30')],function(_0x20364a){return{'name':_0x20364a[_0xe62c('0x31')],'type':_0x20364a['type']['key']};});_0x455b1c[_0xe62c('0x32')]=_[_0xe62c('0x2e')](_0x26dd68,_0xe62c('0x33'));_0x455b1c[_0xe62c('0x34')]=_[_0xe62c('0x35')](_0x2a70ff['query']);_0x455b1c[_0xe62c('0x36')]=_[_0xe62c('0x37')](_0x455b1c['model'],_0x455b1c[_0xe62c('0x34')]);_0x23c6ed['attributes']=_['intersection'](_0x455b1c['model'],qs['fields'](_0x2a70ff['query'][_0xe62c('0x38')]));_0x23c6ed[_0xe62c('0x39')]=_0x23c6ed['attributes'][_0xe62c('0x3a')]?_0x23c6ed[_0xe62c('0x39')]:_0x455b1c[_0xe62c('0x32')];if(!_0x2a70ff['query'][_0xe62c('0x3b')](_0xe62c('0x3c'))){_0x23c6ed[_0xe62c('0x24')]=qs[_0xe62c('0x24')](_0x2a70ff[_0xe62c('0x34')]['limit']);_0x23c6ed['offset']=qs[_0xe62c('0x21')](_0x2a70ff['query']['offset']);}_0x23c6ed[_0xe62c('0x3d')]=qs[_0xe62c('0x3e')](_0x2a70ff[_0xe62c('0x34')][_0xe62c('0x3e')]);_0x23c6ed[_0xe62c('0x3f')]=qs[_0xe62c('0x36')](_[_0xe62c('0x40')](_0x2a70ff[_0xe62c('0x34')],_0x455b1c['filters']),_0x26dd68);if(_0x2a70ff[_0xe62c('0x34')][_0xe62c('0x41')]){_0x23c6ed[_0xe62c('0x3f')]=_[_0xe62c('0x42')](_0x23c6ed['where'],{'$or':_['map'](_0x26dd68,function(_0x2be2ee){if(_0x2be2ee[_0xe62c('0x43')]!==_0xe62c('0x44')){var _0x2605fd={};_0x2605fd[_0x2be2ee[_0xe62c('0x33')]]={'$like':'%'+_0x2a70ff[_0xe62c('0x34')][_0xe62c('0x41')]+'%'};return _0x2605fd;}})});}_0x23c6ed=_[_0xe62c('0x42')]({},_0x23c6ed,_0x2a70ff['options']);var _0x4b83b0={'where':_0x23c6ed[_0xe62c('0x3f')]};return db[_0xe62c('0x2f')][_0xe62c('0x23')](_0x4b83b0)['then'](function(_0x37489f){_0x4b2c06[_0xe62c('0x23')]=_0x37489f;if(_0x2a70ff[_0xe62c('0x34')][_0xe62c('0x45')]){_0x23c6ed['include']=[{'all':!![]}];}return db[_0xe62c('0x2f')][_0xe62c('0x46')](_0x23c6ed);})[_0xe62c('0x29')](function(_0xcdbccd){_0x4b2c06[_0xe62c('0x47')]=_0xcdbccd;return _0x4b2c06;})['then'](respondWithFilteredResult(_0x3ae083,_0x23c6ed))[_0xe62c('0x48')](handleError(_0x3ae083,null));};exports[_0xe62c('0x49')]=function(_0x16258c,_0xd90b1f){var _0x38aab3={'raw':![],'where':{'id':_0x16258c['params']['id']}},_0x263c1a={};_0x263c1a[_0xe62c('0x32')]=_[_0xe62c('0x35')](db['VoiceQueueReport'][_0xe62c('0x30')]);_0x263c1a[_0xe62c('0x34')]=_['keys'](_0x16258c['query']);_0x263c1a[_0xe62c('0x36')]=_['intersection'](_0x263c1a['model'],_0x263c1a[_0xe62c('0x34')]);_0x38aab3[_0xe62c('0x39')]=_[_0xe62c('0x37')](_0x263c1a[_0xe62c('0x32')],qs[_0xe62c('0x38')](_0x16258c[_0xe62c('0x34')][_0xe62c('0x38')]));_0x38aab3['attributes']=_0x38aab3[_0xe62c('0x39')][_0xe62c('0x3a')]?_0x38aab3[_0xe62c('0x39')]:_0x263c1a[_0xe62c('0x32')];if(_0x16258c[_0xe62c('0x34')]['includeAll']){_0x38aab3[_0xe62c('0x4a')]=[{'all':!![]}];}_0x38aab3=_['merge']({},_0x38aab3,_0x16258c[_0xe62c('0x4b')]);return db[_0xe62c('0x2f')]['find'](_0x38aab3)[_0xe62c('0x29')](handleEntityNotFound(_0xd90b1f,null))['then'](respondWithResult(_0xd90b1f,null))[_0xe62c('0x48')](handleError(_0xd90b1f,null));};exports[_0xe62c('0x4c')]=function(_0x2b6a5c,_0x342ac1){return db['VoiceQueueReport']['create'](_0x2b6a5c[_0xe62c('0x4d')],{})[_0xe62c('0x29')](respondWithResult(_0x342ac1,0xc9))[_0xe62c('0x48')](handleError(_0x342ac1,null));};exports[_0xe62c('0x4e')]=function(_0x145115,_0x28b6e5){if(_0x145115['body']['id']){delete _0x145115[_0xe62c('0x4d')]['id'];}return db[_0xe62c('0x2f')]['find']({'where':{'id':_0x145115[_0xe62c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x28b6e5,null))['then'](saveUpdates(_0x145115['body'],null))[_0xe62c('0x29')](respondWithResult(_0x28b6e5,null))[_0xe62c('0x48')](handleError(_0x28b6e5,null));};exports[_0xe62c('0x50')]=function(_0x41f394,_0x141f4a){return db[_0xe62c('0x2f')][_0xe62c('0x51')]({'where':{'id':_0x41f394['params']['id']}})[_0xe62c('0x29')](handleEntityNotFound(_0x141f4a,null))[_0xe62c('0x29')](removeEntity(_0x141f4a,null))['catch'](handleError(_0x141f4a,null));};exports['describe']=function(_0x4b4065,_0x538a3f){return db['VoiceQueueReport'][_0xe62c('0x52')]()[_0xe62c('0x29')](respondWithResult(_0x538a3f,null))[_0xe62c('0x48')](handleError(_0x538a3f,null));};exports['getVoiceQueuesReport']=function(_0x21c881,_0x416a09){var _0x11b599={},_0x423678={},_0x161a43={'count':0x0,'rows':[]};_0x423678[_0xe62c('0x32')]=_[_0xe62c('0x35')](db[_0xe62c('0x2f')]['rawAttributes']);_0x423678[_0xe62c('0x34')]=_[_0xe62c('0x35')](_0x21c881[_0xe62c('0x34')]);_0x423678[_0xe62c('0x36')]=_[_0xe62c('0x37')](_0x423678[_0xe62c('0x32')],_0x423678[_0xe62c('0x34')]);_0x11b599[_0xe62c('0x39')]=_[_0xe62c('0x37')](_0x423678[_0xe62c('0x32')],qs[_0xe62c('0x38')](_0x21c881[_0xe62c('0x34')][_0xe62c('0x38')]));_0x11b599[_0xe62c('0x39')]=_0x11b599[_0xe62c('0x39')][_0xe62c('0x3a')]?_0x11b599['attributes']:_0x423678[_0xe62c('0x32')];if(!_0x21c881[_0xe62c('0x34')]['hasOwnProperty'](_0xe62c('0x3c'))){_0x11b599['limit']=qs[_0xe62c('0x24')](_0x21c881[_0xe62c('0x34')][_0xe62c('0x24')]);_0x11b599[_0xe62c('0x21')]=qs[_0xe62c('0x21')](_0x21c881[_0xe62c('0x34')]['offset']);}_0x11b599['order']=qs[_0xe62c('0x3e')](_0x21c881[_0xe62c('0x34')][_0xe62c('0x3e')]);_0x11b599[_0xe62c('0x3f')]=qs[_0xe62c('0x36')](_['pick'](_0x21c881[_0xe62c('0x34')],_0x423678[_0xe62c('0x36')]));if(_0x21c881[_0xe62c('0x34')]['filter']){_0x11b599[_0xe62c('0x3f')]=_[_0xe62c('0x42')](_0x11b599['where'],{'$or':_[_0xe62c('0x2e')](_0x11b599['attributes'],function(_0x285fbf){var _0x3aa08b={};_0x3aa08b[_0x285fbf]={'$like':'%'+_0x21c881['query'][_0xe62c('0x41')]+'%'};return _0x3aa08b;})});}_0x11b599=_[_0xe62c('0x42')]({},_0x11b599,_0x21c881[_0xe62c('0x4b')]);var _0x11ad8d={'where':_0x11b599['where']};return db[_0xe62c('0x2f')][_0xe62c('0x23')](_0x11ad8d)[_0xe62c('0x29')](function(_0x18a240){_0x161a43['count']=_0x18a240;if(_0x21c881[_0xe62c('0x34')][_0xe62c('0x45')]){_0x11b599['include']=[{'all':!![]}];}return db[_0xe62c('0x2f')]['findAll'](_0x11b599);})[_0xe62c('0x29')](function(_0x13e022){_0x161a43['rows']=_0x13e022;return _0x161a43;})[_0xe62c('0x29')](respondWithFilteredResult(_0x416a09,_0x11b599,_0xe62c('0x53')))[_0xe62c('0x48')](handleError(_0x416a09,null,_0xe62c('0x53')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 09d4234..2853bc9 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 _0x5246=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x33dc1d,_0xb317a4){var _0x17d90d=function(_0x112f18){while(--_0x112f18){_0x33dc1d['push'](_0x33dc1d['shift']());}};_0x17d90d(++_0xb317a4);}(_0x5246,0xd0));var _0x6524=function(_0x3e740c,_0xb77831){_0x3e740c=_0x3e740c-0x0;var _0x3e40b3=_0x5246[_0x3e740c];return _0x3e40b3;};'use strict';var EventEmitter=require(_0x6524('0x0'));var VoiceQueueReport=require(_0x6524('0x1'))['db'][_0x6524('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6524('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6524('0x4')};function emitEvent(_0x8dc005){return function(_0x36f7ee,_0x4dd19a,_0x542e71){VoiceQueueReportEvents[_0x6524('0x5')](_0x8dc005+':'+_0x36f7ee['id'],_0x36f7ee);VoiceQueueReportEvents[_0x6524('0x5')](_0x8dc005,_0x36f7ee);_0x542e71(null);};}for(var e in events){if(events[_0x6524('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x6524('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xcf5c=['setMaxListeners','save','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueueReport'];(function(_0x2e7d82,_0x3039f7){var _0x52619d=function(_0x1a9cbc){while(--_0x1a9cbc){_0x2e7d82['push'](_0x2e7d82['shift']());}};_0x52619d(++_0x3039f7);}(_0xcf5c,0x10f));var _0xccf5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcf5c[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xccf5('0x0'))['db'][_0xccf5('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xccf5('0x2')](0x0);var events={'afterCreate':_0xccf5('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x393447){return function(_0x2d2e3e,_0x17d6b7,_0x41ac8a){VoiceQueueReportEvents[_0xccf5('0x4')](_0x393447+':'+_0x2d2e3e['id'],_0x2d2e3e);VoiceQueueReportEvents[_0xccf5('0x4')](_0x393447,_0x2d2e3e);_0x41ac8a(null);};}for(var e in events){if(events[_0xccf5('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xccf5('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 70d7f38..7b4aabe 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 _0x3472=['request-promise','rimraf','./voiceQueueReport.attributes','exports','report_queue','util','../../config/logger','moment','bluebird'];(function(_0x3333bb,_0x1df222){var _0x273d39=function(_0x5c411b){while(--_0x5c411b){_0x3333bb['push'](_0x3333bb['shift']());}};_0x273d39(++_0x1df222);}(_0x3472,0xf8));var _0x2347=function(_0x1c8ba3,_0x4cdef6){_0x1c8ba3=_0x1c8ba3-0x0;var _0x2d16bd=_0x3472[_0x1c8ba3];return _0x2d16bd;};'use strict';var _=require('lodash');var util=require(_0x2347('0x0'));var logger=require(_0x2347('0x1'))('api');var moment=require(_0x2347('0x2'));var BPromise=require(_0x2347('0x3'));var rp=require(_0x2347('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2347('0x5'));var config=require('../../config/environment');var attributes=require(_0x2347('0x6'));module[_0x2347('0x7')]=function(_0x48c8ac,_0x6ded3){return _0x48c8ac['define']('VoiceQueueReport',attributes,{'tableName':_0x2347('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa170=['moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x3a0165,_0x453cc9){var _0x3be685=function(_0x240e3e){while(--_0x240e3e){_0x3a0165['push'](_0x3a0165['shift']());}};_0x3be685(++_0x453cc9);}(_0xa170,0xce));var _0x0a17=function(_0xf3bc3,_0x328c8b){_0xf3bc3=_0xf3bc3-0x0;var _0x27d062=_0xa170[_0xf3bc3];return _0x27d062;};'use strict';var _=require(_0x0a17('0x0'));var util=require(_0x0a17('0x1'));var logger=require(_0x0a17('0x2'))(_0x0a17('0x3'));var moment=require(_0x0a17('0x4'));var BPromise=require('bluebird');var rp=require(_0x0a17('0x5'));var fs=require('fs');var path=require(_0x0a17('0x6'));var rimraf=require(_0x0a17('0x7'));var config=require(_0x0a17('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x0a17('0x9')]=function(_0x3b99ee,_0xa93d31){return _0x3b99ee[_0x0a17('0xa')](_0x0a17('0xb'),attributes,{'tableName':_0x0a17('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0a17('0xd')]},{'fields':[_0x0a17('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index c639fbd..6c477a0 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 _0xca2e=['jayson/promise','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','info','UpdateVoiceQueueReport','update','where','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x490c64,_0x8a5cb4){var _0x32111a=function(_0x1e7b24){while(--_0x1e7b24){_0x490c64['push'](_0x490c64['shift']());}};_0x32111a(++_0x8a5cb4);}(_0xca2e,0x1bc));var _0xeca2=function(_0x551fb4,_0x477b9c){_0x551fb4=_0x551fb4-0x0;var _0x23e596=_0xca2e[_0x551fb4];return _0x23e596;};'use strict';var _=require(_0xeca2('0x0'));var util=require('util');var moment=require(_0xeca2('0x1'));var BPromise=require(_0xeca2('0x2'));var rs=require(_0xeca2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeca2('0x4'))(_0xeca2('0x5'));var config=require(_0xeca2('0x6'));var jayson=require(_0xeca2('0x7'));var client=jayson[_0xeca2('0x8')][_0xeca2('0x9')]({'port':0x232a});config[_0xeca2('0xa')]=_['defaults'](config[_0xeca2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xeca2('0xb'))(new Redis(config[_0xeca2('0xa')]));require(_0xeca2('0xc'))[_0xeca2('0xd')](socket);function respondWithRpcPromise(_0x1a4e4c,_0x1bb86d,_0x257402){return new BPromise(function(_0x3941da,_0x378206){return client['request'](_0x1a4e4c,_0x257402)[_0xeca2('0xe')](function(_0x133a74){logger['info'](_0xeca2('0xf'),_0x1bb86d,_0xeca2('0x10'));logger['debug'](_0xeca2('0x11'),_0x1bb86d,_0xeca2('0x10'),JSON[_0xeca2('0x12')](_0x133a74));if(_0x133a74[_0xeca2('0x13')]){if(_0x133a74['error'][_0xeca2('0x14')]===0x1f4){logger[_0xeca2('0x13')](_0xeca2('0xf'),_0x1bb86d,_0x133a74[_0xeca2('0x13')][_0xeca2('0x15')]);return _0x378206(_0x133a74[_0xeca2('0x13')][_0xeca2('0x15')]);}logger[_0xeca2('0x13')](_0xeca2('0xf'),_0x1bb86d,_0x133a74[_0xeca2('0x13')]['message']);return _0x3941da(_0x133a74[_0xeca2('0x13')][_0xeca2('0x15')]);}else{logger['info'](_0xeca2('0xf'),_0x1bb86d,'request\x20sent');_0x3941da(_0x133a74[_0xeca2('0x16')]['message']);}})[_0xeca2('0x17')](function(_0x4cbdd1){logger[_0xeca2('0x13')](_0xeca2('0xf'),_0x1bb86d,_0x4cbdd1);_0x378206(_0x4cbdd1);});});}exports['GetVoiceQueueReport']=function(_0x55ae0b){var _0x394db8=this;return new Promise(function(_0x48621c,_0x53bb79){return db[_0xeca2('0x18')][_0xeca2('0x19')]({'raw':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b[_0xeca2('0x1a')][_0xeca2('0x1b')]===undefined?!![]:![]:!![],'where':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b[_0xeca2('0x1a')]['where']||null:null,'attributes':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b['options'][_0xeca2('0x1c')]||null:null,'limit':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b['options'][_0xeca2('0x1d')]||null:null,'include':_0x55ae0b[_0xeca2('0x1a')]?_0x55ae0b[_0xeca2('0x1a')][_0xeca2('0x1e')]?_['map'](_0x55ae0b[_0xeca2('0x1a')][_0xeca2('0x1e')],function(_0x50fe45){return{'model':db[_0x50fe45[_0xeca2('0x1f')]],'as':_0x50fe45['as'],'attributes':_0x50fe45[_0xeca2('0x1c')],'include':_0x50fe45[_0xeca2('0x1e')]?_['map'](_0x50fe45[_0xeca2('0x1e')],function(_0x46bf45){return{'model':db[_0x46bf45[_0xeca2('0x1f')]],'as':_0x46bf45['as'],'attributes':_0x46bf45[_0xeca2('0x1c')],'include':_0x46bf45[_0xeca2('0x1e')]?_[_0xeca2('0x20')](_0x46bf45[_0xeca2('0x1e')],function(_0x29b69b){return{'model':db[_0x29b69b['model']],'as':_0x29b69b['as'],'attributes':_0x29b69b[_0xeca2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xeca2('0xe')](function(_0x8d70b8){logger['info']('GetVoiceQueueReport',_0x55ae0b);logger['debug'](_0xeca2('0x21'),_0x55ae0b,JSON['stringify'](_0x8d70b8));_0x48621c(_0x8d70b8);})[_0xeca2('0x17')](function(_0x27e73b){logger['error'](_0xeca2('0x21'),_0x27e73b['message'],_0x55ae0b);_0x53bb79(_0x394db8[_0xeca2('0x13')](0x1f4,_0x27e73b['message']));});});};exports[_0xeca2('0x22')]=function(_0x29bf1c){var _0x2b8f96=this;return new Promise(function(_0x17c748,_0x4f6e08){return db[_0xeca2('0x18')][_0xeca2('0x23')](_0x29bf1c[_0xeca2('0x24')],{'raw':_0x29bf1c[_0xeca2('0x1a')]?_0x29bf1c[_0xeca2('0x1a')][_0xeca2('0x1b')]===undefined?!![]:![]:!![]})[_0xeca2('0xe')](function(_0x3fd600){logger[_0xeca2('0x25')](_0xeca2('0x22'),_0x29bf1c);logger['debug'](_0xeca2('0x22'),_0x29bf1c,JSON[_0xeca2('0x12')](_0x3fd600));_0x17c748(_0x3fd600);})['catch'](function(_0x1bf619){logger[_0xeca2('0x13')](_0xeca2('0x22'),_0x1bf619['message'],_0x29bf1c);_0x4f6e08(_0x2b8f96['error'](0x1f4,_0x1bf619[_0xeca2('0x15')]));});});};exports[_0xeca2('0x26')]=function(_0x1584df){var _0x3927e2=this;return new Promise(function(_0x8fef9e,_0x5c6721){return db[_0xeca2('0x18')][_0xeca2('0x27')](_0x1584df['body'],{'raw':_0x1584df['options']?_0x1584df[_0xeca2('0x1a')][_0xeca2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1584df[_0xeca2('0x1a')]?_0x1584df['options'][_0xeca2('0x28')]||null:null,'attributes':_0x1584df[_0xeca2('0x1a')]?_0x1584df[_0xeca2('0x1a')][_0xeca2('0x1c')]||null:null,'limit':_0x1584df['options']?_0x1584df['options'][_0xeca2('0x1d')]||null:null})['then'](function(_0x3fbdbb){logger[_0xeca2('0x25')]('UpdateVoiceQueueReport',_0x1584df);logger['debug']('UpdateVoiceQueueReport',_0x1584df,JSON['stringify'](_0x3fbdbb));_0x8fef9e(_0x3fbdbb);})[_0xeca2('0x17')](function(_0x9c25b0){logger['error'](_0xeca2('0x26'),_0x9c25b0['message'],_0x1584df);_0x5c6721(_0x3927e2['error'](0x1f4,_0x9c25b0[_0xeca2('0x15')]));});});}; \ No newline at end of file +var _0x13fd=['then','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','where','limit','map','include','model','attributes','CreateVoiceQueueReport','create','body','raw'];(function(_0x435705,_0x15306f){var _0x30369c=function(_0x56d38f){while(--_0x56d38f){_0x435705['push'](_0x435705['shift']());}};_0x30369c(++_0x15306f);}(_0x13fd,0x122));var _0xd13f=function(_0x300e1c,_0x480e2f){_0x300e1c=_0x300e1c-0x0;var _0x54d3fe=_0x13fd[_0x300e1c];return _0x54d3fe;};'use strict';var _=require(_0xd13f('0x0'));var util=require(_0xd13f('0x1'));var moment=require('moment');var BPromise=require(_0xd13f('0x2'));var rs=require(_0xd13f('0x3'));var fs=require('fs');var Redis=require(_0xd13f('0x4'));var db=require(_0xd13f('0x5'))['db'];var utils=require(_0xd13f('0x6'));var logger=require(_0xd13f('0x7'))(_0xd13f('0x8'));var config=require(_0xd13f('0x9'));var jayson=require(_0xd13f('0xa'));var client=jayson[_0xd13f('0xb')][_0xd13f('0xc')]({'port':0x232a});config['redis']=_[_0xd13f('0xd')](config['redis'],{'host':_0xd13f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd13f('0xf')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x2e10a8,_0x26e3f3,_0x4bf1c4){return new BPromise(function(_0x525ff9,_0x47a1cc){return client['request'](_0x2e10a8,_0x4bf1c4)['then'](function(_0x49deea){logger['info'](_0xd13f('0x10'),_0x26e3f3,_0xd13f('0x11'));logger[_0xd13f('0x12')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x26e3f3,_0xd13f('0x11'),JSON[_0xd13f('0x13')](_0x49deea));if(_0x49deea[_0xd13f('0x14')]){if(_0x49deea['error']['code']===0x1f4){logger[_0xd13f('0x14')](_0xd13f('0x10'),_0x26e3f3,_0x49deea[_0xd13f('0x14')][_0xd13f('0x15')]);return _0x47a1cc(_0x49deea[_0xd13f('0x14')]['message']);}logger[_0xd13f('0x14')](_0xd13f('0x10'),_0x26e3f3,_0x49deea['error']['message']);return _0x525ff9(_0x49deea[_0xd13f('0x14')][_0xd13f('0x15')]);}else{logger[_0xd13f('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x26e3f3,_0xd13f('0x11'));_0x525ff9(_0x49deea[_0xd13f('0x17')][_0xd13f('0x15')]);}})[_0xd13f('0x18')](function(_0x7f0f31){logger[_0xd13f('0x14')](_0xd13f('0x10'),_0x26e3f3,_0x7f0f31);_0x47a1cc(_0x7f0f31);});});}exports[_0xd13f('0x19')]=function(_0x4ec19a){var _0x3cf886=this;return new Promise(function(_0xd64691,_0xc28ce4){return db[_0xd13f('0x1a')]['findAll']({'raw':_0x4ec19a[_0xd13f('0x1b')]?_0x4ec19a['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ec19a[_0xd13f('0x1b')]?_0x4ec19a[_0xd13f('0x1b')][_0xd13f('0x1c')]||null:null,'attributes':_0x4ec19a[_0xd13f('0x1b')]?_0x4ec19a[_0xd13f('0x1b')]['attributes']||null:null,'limit':_0x4ec19a['options']?_0x4ec19a[_0xd13f('0x1b')][_0xd13f('0x1d')]||null:null,'include':_0x4ec19a[_0xd13f('0x1b')]?_0x4ec19a['options']['include']?_[_0xd13f('0x1e')](_0x4ec19a[_0xd13f('0x1b')][_0xd13f('0x1f')],function(_0x3c5452){return{'model':db[_0x3c5452[_0xd13f('0x20')]],'as':_0x3c5452['as'],'attributes':_0x3c5452[_0xd13f('0x21')],'include':_0x3c5452['include']?_[_0xd13f('0x1e')](_0x3c5452[_0xd13f('0x1f')],function(_0x5d1184){return{'model':db[_0x5d1184['model']],'as':_0x5d1184['as'],'attributes':_0x5d1184[_0xd13f('0x21')],'include':_0x5d1184[_0xd13f('0x1f')]?_[_0xd13f('0x1e')](_0x5d1184[_0xd13f('0x1f')],function(_0x322203){return{'model':db[_0x322203[_0xd13f('0x20')]],'as':_0x322203['as'],'attributes':_0x322203[_0xd13f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c5af6){logger[_0xd13f('0x16')]('GetVoiceQueueReport',_0x4ec19a);logger[_0xd13f('0x12')](_0xd13f('0x19'),_0x4ec19a,JSON[_0xd13f('0x13')](_0x5c5af6));_0xd64691(_0x5c5af6);})[_0xd13f('0x18')](function(_0x50b615){logger[_0xd13f('0x14')]('GetVoiceQueueReport',_0x50b615['message'],_0x4ec19a);_0xc28ce4(_0x3cf886[_0xd13f('0x14')](0x1f4,_0x50b615[_0xd13f('0x15')]));});});};exports[_0xd13f('0x22')]=function(_0x1451ec){var _0x41fb91=this;return new Promise(function(_0x50f432,_0x2a6865){return db[_0xd13f('0x1a')][_0xd13f('0x23')](_0x1451ec[_0xd13f('0x24')],{'raw':_0x1451ec[_0xd13f('0x1b')]?_0x1451ec['options'][_0xd13f('0x25')]===undefined?!![]:![]:!![]})[_0xd13f('0x26')](function(_0x2458fd){logger[_0xd13f('0x16')]('CreateVoiceQueueReport',_0x1451ec);logger[_0xd13f('0x12')](_0xd13f('0x22'),_0x1451ec,JSON[_0xd13f('0x13')](_0x2458fd));_0x50f432(_0x2458fd);})['catch'](function(_0x396d46){logger['error'](_0xd13f('0x22'),_0x396d46[_0xd13f('0x15')],_0x1451ec);_0x2a6865(_0x41fb91[_0xd13f('0x14')](0x1f4,_0x396d46['message']));});});};exports[_0xd13f('0x27')]=function(_0xcb4daf){var _0x356be4=this;return new Promise(function(_0x3c30cc,_0x3321ce){return db[_0xd13f('0x1a')][_0xd13f('0x28')](_0xcb4daf[_0xd13f('0x24')],{'raw':_0xcb4daf[_0xd13f('0x1b')]?_0xcb4daf[_0xd13f('0x1b')][_0xd13f('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb4daf[_0xd13f('0x1b')]?_0xcb4daf[_0xd13f('0x1b')][_0xd13f('0x1c')]||null:null,'attributes':_0xcb4daf[_0xd13f('0x1b')]?_0xcb4daf[_0xd13f('0x1b')][_0xd13f('0x21')]||null:null,'limit':_0xcb4daf[_0xd13f('0x1b')]?_0xcb4daf[_0xd13f('0x1b')][_0xd13f('0x1d')]||null:null})[_0xd13f('0x26')](function(_0x276e58){logger[_0xd13f('0x16')](_0xd13f('0x27'),_0xcb4daf);logger[_0xd13f('0x12')](_0xd13f('0x27'),_0xcb4daf,JSON['stringify'](_0x276e58));_0x3c30cc(_0x276e58);})[_0xd13f('0x18')](function(_0x198077){logger['error'](_0xd13f('0x27'),_0x198077['message'],_0xcb4daf);_0x3321ce(_0x356be4[_0xd13f('0x14')](0x1f4,_0x198077[_0xd13f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index a93c59b..2e32d66 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 _0x8917=['emit','removeListener','length','./voiceQueueReport.events','remove','update'];(function(_0x455745,_0x5a9a82){var _0x29b21b=function(_0x477374){while(--_0x477374){_0x455745['push'](_0x455745['shift']());}};_0x29b21b(++_0x5a9a82);}(_0x8917,0x1d7));var _0x7891=function(_0x464707,_0x4f5da4){_0x464707=_0x464707-0x0;var _0x379110=_0x8917[_0x464707];return _0x379110;};'use strict';var VoiceQueueReportEvents=require(_0x7891('0x0'));var events=['save',_0x7891('0x1'),_0x7891('0x2')];function createListener(_0xfc1628,_0x129608){return function(_0xdf5de1){_0x129608[_0x7891('0x3')](_0xfc1628,_0xdf5de1);};}function removeListener(_0x2b5570,_0x24234b){return function(){VoiceQueueReportEvents[_0x7891('0x4')](_0x2b5570,_0x24234b);};}exports['register']=function(_0x46b52a){for(var _0x43a48e=0x0,_0x442944=events[_0x7891('0x5')];_0x43a48e<_0x442944;_0x43a48e++){var _0x4722b7=events[_0x43a48e];var _0x452a6d=createListener('voiceQueueReport:'+_0x4722b7,_0x46b52a);VoiceQueueReportEvents['on'](_0x4722b7,_0x452a6d);}}; \ No newline at end of file +var _0x26cf=['length','save','remove','register'];(function(_0x25d96d,_0x1e4d72){var _0x5f75ec=function(_0x288887){while(--_0x288887){_0x25d96d['push'](_0x25d96d['shift']());}};_0x5f75ec(++_0x1e4d72);}(_0x26cf,0x135));var _0xf26c=function(_0x42e404,_0x1a108d){_0x42e404=_0x42e404-0x0;var _0x390dcf=_0x26cf[_0x42e404];return _0x390dcf;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xf26c('0x0'),_0xf26c('0x1'),'update'];function createListener(_0x1287d8,_0x5357ce){return function(_0x1a6d9c){_0x5357ce['emit'](_0x1287d8,_0x1a6d9c);};}function removeListener(_0x314cdf,_0xf4a93f){return function(){VoiceQueueReportEvents['removeListener'](_0x314cdf,_0xf4a93f);};}exports[_0xf26c('0x2')]=function(_0x10638a){for(var _0x32d4ef=0x0,_0x325edc=events[_0xf26c('0x3')];_0x32d4ef<_0x325edc;_0x32d4ef++){var _0x32d754=events[_0x32d4ef];var _0x4c1dc7=createListener('voiceQueueReport:'+_0x32d754,_0x10638a);VoiceQueueReportEvents['on'](_0x32d754,_0x4c1dc7);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c660753..525973e 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 _0x1472=['../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x20cf3c,_0x19f86d){var _0x260bc8=function(_0x1ff89d){while(--_0x1ff89d){_0x20cf3c['push'](_0x20cf3c['shift']());}};_0x260bc8(++_0x19f86d);}(_0x1472,0xe9));var _0x2147=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x1472[_0x1168a1];return _0xcc5ad8;};'use strict';var multer=require(_0x2147('0x0'));var util=require('util');var path=require(_0x2147('0x1'));var timeout=require(_0x2147('0x2'));var express=require('express');var router=express[_0x2147('0x3')]();var fs_extra=require(_0x2147('0x4'));var auth=require(_0x2147('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0x2147('0x6')]('/',auth[_0x2147('0x7')](),controller[_0x2147('0x8')]);router['get']('/:id',auth[_0x2147('0x7')](),controller[_0x2147('0x9')]);router[_0x2147('0xa')]('/',auth[_0x2147('0x7')](),controller[_0x2147('0xb')]);router[_0x2147('0xc')](_0x2147('0xd'),auth[_0x2147('0x7')](),controller[_0x2147('0xe')]);router[_0x2147('0xf')](_0x2147('0xd'),auth[_0x2147('0x7')](),controller[_0x2147('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2554=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','util','path','express'];(function(_0x1c315d,_0xb9457d){var _0x5374b4=function(_0x1044a1){while(--_0x1044a1){_0x1c315d['push'](_0x1c315d['shift']());}};_0x5374b4(++_0xb9457d);}(_0x2554,0x141));var _0x4255=function(_0x1c2958,_0x2950a9){_0x1c2958=_0x1c2958-0x0;var _0xfc4df8=_0x2554[_0x1c2958];return _0xfc4df8;};'use strict';var multer=require('multer');var util=require(_0x4255('0x0'));var path=require(_0x4255('0x1'));var timeout=require('connect-timeout');var express=require(_0x4255('0x2'));var router=express[_0x4255('0x3')]();var fs_extra=require(_0x4255('0x4'));var auth=require(_0x4255('0x5'));var interaction=require(_0x4255('0x6'));var config=require('../../config/environment');var controller=require(_0x4255('0x7'));router[_0x4255('0x8')]('/',auth[_0x4255('0x9')](),controller['index']);router[_0x4255('0x8')]('/:id',auth[_0x4255('0x9')](),controller[_0x4255('0xa')]);router[_0x4255('0xb')]('/',auth[_0x4255('0x9')](),controller[_0x4255('0xc')]);router[_0x4255('0xd')](_0x4255('0xe'),auth[_0x4255('0x9')](),controller[_0x4255('0xf')]);router[_0x4255('0x10')](_0x4255('0xe'),auth[_0x4255('0x9')](),controller['destroy']);module[_0x4255('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 adbfc0d..0aab98a 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 _0xfd1b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','exports','STRING'];(function(_0x3ff19b,_0x1903fb){var _0x8286fc=function(_0x5c7fa4){while(--_0x5c7fa4){_0x3ff19b['push'](_0x3ff19b['shift']());}};_0x8286fc(++_0x1903fb);}(_0xfd1b,0x1b1));var _0xbfd1=function(_0x5bedf1,_0x5a8319){_0x5bedf1=_0x5bedf1-0x0;var _0x935a6a=_0xfd1b[_0x5bedf1];return _0x935a6a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xbfd1('0x0')]={'time':{'type':Sequelize[_0xbfd1('0x1')]},'callid':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbfd1('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbfd1('0x2')],'allowNull':![],'defaultValue':moment()[_0xbfd1('0x3')](_0xbfd1('0x4'))}}; \ No newline at end of file +var _0xe0b4=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x59aa72,_0x8eb81b){var _0x465927=function(_0x2cec6e){while(--_0x2cec6e){_0x59aa72['push'](_0x59aa72['shift']());}};_0x465927(++_0x8eb81b);}(_0xe0b4,0x190));var _0x4e0b=function(_0xb1f3d6,_0x50949f){_0xb1f3d6=_0xb1f3d6-0x0;var _0x8d7926=_0xe0b4[_0xb1f3d6];return _0x8d7926;};'use strict';var Sequelize=require(_0x4e0b('0x0'));var moment=require(_0x4e0b('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4e0b('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4e0b('0x3')],'allowNull':![],'defaultValue':moment()[_0x4e0b('0x4')](_0x4e0b('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index cdf7c55..6f18fb6 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 _0xc97e=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceQueuesLog','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x40fdca,_0x2fe232){var _0x1858da=function(_0x8f15b1){while(--_0x8f15b1){_0x40fdca['push'](_0x40fdca['shift']());}};_0x1858da(++_0x2fe232);}(_0xc97e,0x1bf));var _0xec97=function(_0x475305,_0x665f20){_0x475305=_0x475305-0x0;var _0x105bb3=_0xc97e[_0x475305];return _0x105bb3;};'use strict';var emlformat=require(_0xec97('0x0'));var rimraf=require(_0xec97('0x1'));var zipdir=require(_0xec97('0x2'));var jsonpatch=require(_0xec97('0x3'));var rp=require(_0xec97('0x4'));var moment=require(_0xec97('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec97('0x6'));var path=require(_0xec97('0x7'));var sox=require(_0xec97('0x8'));var csv=require(_0xec97('0x9'));var ejs=require(_0xec97('0xa'));var fs=require('fs');var fs_extra=require(_0xec97('0xb'));var _=require(_0xec97('0xc'));var squel=require(_0xec97('0xd'));var crypto=require(_0xec97('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xec97('0xf'));var toCsv=require('to-csv');var querystring=require(_0xec97('0x10'));var Papa=require(_0xec97('0x11'));var Redis=require(_0xec97('0x12'));var authService=require(_0xec97('0x13'));var qs=require(_0xec97('0x14'));var as=require(_0xec97('0x15'));var hardwareService=require(_0xec97('0x16'));var logger=require(_0xec97('0x17'))(_0xec97('0x18'));var utils=require(_0xec97('0x19'));var config=require(_0xec97('0x1a'));var licenseUtil=require(_0xec97('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x352b73,_0x38a148){_0x38a148=_0x38a148||0xcc;return function(_0x529274){if(_0x529274){return _0x352b73[_0xec97('0x1c')](_0x38a148);}return _0x352b73['status'](_0x38a148)[_0xec97('0x1d')]();};}function respondWithResult(_0x2a54c5,_0x4cc97b){_0x4cc97b=_0x4cc97b||0xc8;return function(_0x210f3c){if(_0x210f3c){return _0x2a54c5[_0xec97('0x1e')](_0x4cc97b)[_0xec97('0x1f')](_0x210f3c);}};}function respondWithFilteredResult(_0x22ac86,_0x5a7eab){return function(_0x12587e){if(_0x12587e){var _0x194e93=typeof _0x5a7eab[_0xec97('0x20')]==='undefined'&&typeof _0x5a7eab[_0xec97('0x21')]===_0xec97('0x22');var _0x6acb55=_0x12587e[_0xec97('0x23')];var _0x415dfc=_0x194e93?0x0:_0x5a7eab[_0xec97('0x20')];var _0x279742=_0x194e93?_0x12587e[_0xec97('0x23')]:_0x5a7eab['offset']+_0x5a7eab['limit'];var _0x325297;if(_0x279742>=_0x6acb55){_0x279742=_0x6acb55;_0x325297=0xc8;}else{_0x325297=0xce;}_0x22ac86[_0xec97('0x1e')](_0x325297);return _0x22ac86['set']('Content-Range',_0x415dfc+'-'+_0x279742+'/'+_0x6acb55)[_0xec97('0x1f')](_0x12587e);}return null;};}function patchUpdates(_0x1a0493){return function(_0x50eb0a){try{jsonpatch[_0xec97('0x24')](_0x50eb0a,_0x1a0493,!![]);}catch(_0x1a7cfe){return BPromise[_0xec97('0x25')](_0x1a7cfe);}return _0x50eb0a[_0xec97('0x26')]();};}function saveUpdates(_0x1d9bc5,_0x5032ae){return function(_0x1f322e){if(_0x1f322e){return _0x1f322e[_0xec97('0x27')](_0x1d9bc5)[_0xec97('0x28')](function(_0x59bdf6){return _0x59bdf6;});}return null;};}function removeEntity(_0x4fcc1d,_0x37959a){return function(_0x4a9e5c){if(_0x4a9e5c){return _0x4a9e5c[_0xec97('0x29')]()['then'](function(){_0x4fcc1d[_0xec97('0x1e')](0xcc)[_0xec97('0x1d')]();});}};}function handleEntityNotFound(_0x2b4d56,_0x12da9f){return function(_0x517245){if(!_0x517245){_0x2b4d56[_0xec97('0x1c')](0x194);}return _0x517245;};}function handleError(_0x175ef3,_0x43d750){_0x43d750=_0x43d750||0x1f4;return function(_0x2fd14e){logger['error'](_0x2fd14e[_0xec97('0x2a')]);if(_0x2fd14e['name']){delete _0x2fd14e[_0xec97('0x2b')];}_0x175ef3[_0xec97('0x1e')](_0x43d750)[_0xec97('0x2c')](_0x2fd14e);};}exports[_0xec97('0x2d')]=function(_0x253ca2,_0x5779d7){var _0x5bf022={},_0x84f698={},_0x531fc1={'count':0x0,'rows':[]};var _0x33f8d0=_[_0xec97('0x2e')](db[_0xec97('0x2f')]['rawAttributes'],function(_0x550a86){return{'name':_0x550a86[_0xec97('0x30')],'type':_0x550a86['type']['key']};});_0x84f698[_0xec97('0x31')]=_['map'](_0x33f8d0,_0xec97('0x2b'));_0x84f698[_0xec97('0x32')]=_[_0xec97('0x33')](_0x253ca2[_0xec97('0x32')]);_0x84f698[_0xec97('0x34')]=_[_0xec97('0x35')](_0x84f698[_0xec97('0x31')],_0x84f698[_0xec97('0x32')]);_0x5bf022[_0xec97('0x36')]=_[_0xec97('0x35')](_0x84f698[_0xec97('0x31')],qs[_0xec97('0x37')](_0x253ca2['query']['fields']));_0x5bf022['attributes']=_0x5bf022[_0xec97('0x36')][_0xec97('0x38')]?_0x5bf022[_0xec97('0x36')]:_0x84f698['model'];if(!_0x253ca2[_0xec97('0x32')][_0xec97('0x39')]('nolimit')){_0x5bf022[_0xec97('0x21')]=qs['limit'](_0x253ca2['query'][_0xec97('0x21')]);_0x5bf022['offset']=qs[_0xec97('0x20')](_0x253ca2[_0xec97('0x32')][_0xec97('0x20')]);}_0x5bf022[_0xec97('0x3a')]=qs[_0xec97('0x3b')](_0x253ca2[_0xec97('0x32')][_0xec97('0x3b')]);_0x5bf022[_0xec97('0x3c')]=qs[_0xec97('0x34')](_[_0xec97('0x3d')](_0x253ca2[_0xec97('0x32')],_0x84f698[_0xec97('0x34')]),_0x33f8d0);if(_0x253ca2['query'][_0xec97('0x3e')]){_0x5bf022[_0xec97('0x3c')]=_[_0xec97('0x3f')](_0x5bf022[_0xec97('0x3c')],{'$or':_[_0xec97('0x2e')](_0x33f8d0,function(_0x319348){if(_0x319348['type']!==_0xec97('0x40')){var _0x5154cd={};_0x5154cd[_0x319348[_0xec97('0x2b')]]={'$like':'%'+_0x253ca2[_0xec97('0x32')][_0xec97('0x3e')]+'%'};return _0x5154cd;}})});}_0x5bf022=_[_0xec97('0x3f')]({},_0x5bf022,_0x253ca2[_0xec97('0x41')]);var _0x5a31f7={'where':_0x5bf022[_0xec97('0x3c')]};return db['VoiceQueuesLog']['count'](_0x5a31f7)['then'](function(_0x105433){_0x531fc1[_0xec97('0x23')]=_0x105433;if(_0x253ca2[_0xec97('0x32')][_0xec97('0x42')]){_0x5bf022[_0xec97('0x43')]=[{'all':!![]}];}return db[_0xec97('0x2f')][_0xec97('0x44')](_0x5bf022);})[_0xec97('0x28')](function(_0x30db01){_0x531fc1[_0xec97('0x45')]=_0x30db01;return _0x531fc1;})[_0xec97('0x28')](respondWithFilteredResult(_0x5779d7,_0x5bf022))[_0xec97('0x46')](handleError(_0x5779d7,null));};exports[_0xec97('0x47')]=function(_0x47a6f8,_0x4561a8){var _0x44ce06={'raw':!![],'where':{'id':_0x47a6f8['params']['id']}},_0x3cae96={};_0x3cae96[_0xec97('0x31')]=_[_0xec97('0x33')](db[_0xec97('0x2f')][_0xec97('0x48')]);_0x3cae96[_0xec97('0x32')]=_[_0xec97('0x33')](_0x47a6f8['query']);_0x3cae96[_0xec97('0x34')]=_[_0xec97('0x35')](_0x3cae96[_0xec97('0x31')],_0x3cae96[_0xec97('0x32')]);_0x44ce06[_0xec97('0x36')]=_[_0xec97('0x35')](_0x3cae96[_0xec97('0x31')],qs[_0xec97('0x37')](_0x47a6f8[_0xec97('0x32')][_0xec97('0x37')]));_0x44ce06['attributes']=_0x44ce06[_0xec97('0x36')][_0xec97('0x38')]?_0x44ce06[_0xec97('0x36')]:_0x3cae96[_0xec97('0x31')];if(_0x47a6f8[_0xec97('0x32')]['includeAll']){_0x44ce06[_0xec97('0x43')]=[{'all':!![]}];}_0x44ce06=_['merge']({},_0x44ce06,_0x47a6f8[_0xec97('0x41')]);return db[_0xec97('0x2f')][_0xec97('0x49')](_0x44ce06)[_0xec97('0x28')](handleEntityNotFound(_0x4561a8,null))[_0xec97('0x28')](respondWithResult(_0x4561a8,null))['catch'](handleError(_0x4561a8,null));};exports[_0xec97('0x4a')]=function(_0x3b82a4,_0x565dba){return db[_0xec97('0x2f')][_0xec97('0x4a')](_0x3b82a4[_0xec97('0x4b')],{})['then'](respondWithResult(_0x565dba,0xc9))['catch'](handleError(_0x565dba,null));};exports[_0xec97('0x27')]=function(_0x131f83,_0x43f0e5){if(_0x131f83[_0xec97('0x4b')]['id']){delete _0x131f83[_0xec97('0x4b')]['id'];}return db[_0xec97('0x2f')][_0xec97('0x49')]({'where':{'id':_0x131f83[_0xec97('0x4c')]['id']}})[_0xec97('0x28')](handleEntityNotFound(_0x43f0e5,null))[_0xec97('0x28')](saveUpdates(_0x131f83[_0xec97('0x4b')],null))[_0xec97('0x28')](respondWithResult(_0x43f0e5,null))[_0xec97('0x46')](handleError(_0x43f0e5,null));};exports[_0xec97('0x29')]=function(_0x190ee1,_0x4c9d91){return db[_0xec97('0x2f')][_0xec97('0x49')]({'where':{'id':_0x190ee1['params']['id']}})[_0xec97('0x28')](handleEntityNotFound(_0x4c9d91,null))[_0xec97('0x28')](removeEntity(_0x4c9d91,null))[_0xec97('0x46')](handleError(_0x4c9d91,null));}; \ No newline at end of file +var _0x2c69=['undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','status','stack','name','send','map','VoiceQueuesLog','rawAttributes','type','key','keys','filters','intersection','model','query','fields','attributes','length','order','sort','filter','where','includeAll','findAll','catch','show','params','include','merge','find','create','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','offset'];(function(_0x1f47b0,_0x172368){var _0x467116=function(_0x369ebe){while(--_0x369ebe){_0x1f47b0['push'](_0x1f47b0['shift']());}};_0x467116(++_0x172368);}(_0x2c69,0xa7));var _0x92c6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x2c69[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x92c6('0x0'));var rimraf=require(_0x92c6('0x1'));var zipdir=require(_0x92c6('0x2'));var jsonpatch=require(_0x92c6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x92c6('0x4'));var util=require(_0x92c6('0x5'));var path=require(_0x92c6('0x6'));var sox=require(_0x92c6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x92c6('0x8'));var _=require(_0x92c6('0x9'));var squel=require(_0x92c6('0xa'));var crypto=require(_0x92c6('0xb'));var jsforce=require(_0x92c6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x92c6('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x92c6('0xe'));var as=require(_0x92c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92c6('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x92c6('0x11'));var licenseUtil=require(_0x92c6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b39e2,_0x5d066d){_0x5d066d=_0x5d066d||0xcc;return function(_0x249498){if(_0x249498){return _0x3b39e2[_0x92c6('0x13')](_0x5d066d);}return _0x3b39e2['status'](_0x5d066d)[_0x92c6('0x14')]();};}function respondWithResult(_0x32e0af,_0x514d67){_0x514d67=_0x514d67||0xc8;return function(_0x288fa1){if(_0x288fa1){return _0x32e0af['status'](_0x514d67)['json'](_0x288fa1);}};}function respondWithFilteredResult(_0x3bfd36,_0x46264a){return function(_0xc21de){if(_0xc21de){var _0xf5ee76=typeof _0x46264a[_0x92c6('0x15')]===_0x92c6('0x16')&&typeof _0x46264a[_0x92c6('0x17')]===_0x92c6('0x16');var _0x14340d=_0xc21de['count'];var _0x5a399f=_0xf5ee76?0x0:_0x46264a[_0x92c6('0x15')];var _0x45c3d9=_0xf5ee76?_0xc21de[_0x92c6('0x18')]:_0x46264a[_0x92c6('0x15')]+_0x46264a['limit'];var _0x4b7060;if(_0x45c3d9>=_0x14340d){_0x45c3d9=_0x14340d;_0x4b7060=0xc8;}else{_0x4b7060=0xce;}_0x3bfd36['status'](_0x4b7060);return _0x3bfd36[_0x92c6('0x19')](_0x92c6('0x1a'),_0x5a399f+'-'+_0x45c3d9+'/'+_0x14340d)[_0x92c6('0x1b')](_0xc21de);}return null;};}function patchUpdates(_0x545e7d){return function(_0x518d77){try{jsonpatch['apply'](_0x518d77,_0x545e7d,!![]);}catch(_0x4576a8){return BPromise[_0x92c6('0x1c')](_0x4576a8);}return _0x518d77[_0x92c6('0x1d')]();};}function saveUpdates(_0x85e796,_0x5ac3c3){return function(_0x5919a0){if(_0x5919a0){return _0x5919a0[_0x92c6('0x1e')](_0x85e796)[_0x92c6('0x1f')](function(_0x587a98){return _0x587a98;});}return null;};}function removeEntity(_0x3ae4e4,_0x93ad36){return function(_0x4e76ad){if(_0x4e76ad){return _0x4e76ad[_0x92c6('0x20')]()[_0x92c6('0x1f')](function(){_0x3ae4e4[_0x92c6('0x21')](0xcc)[_0x92c6('0x14')]();});}};}function handleEntityNotFound(_0x17800f,_0xe21e76){return function(_0x6f28cf){if(!_0x6f28cf){_0x17800f[_0x92c6('0x13')](0x194);}return _0x6f28cf;};}function handleError(_0x260531,_0x19cd9e){_0x19cd9e=_0x19cd9e||0x1f4;return function(_0x3fc8fc){logger['error'](_0x3fc8fc[_0x92c6('0x22')]);if(_0x3fc8fc[_0x92c6('0x23')]){delete _0x3fc8fc[_0x92c6('0x23')];}_0x260531[_0x92c6('0x21')](_0x19cd9e)[_0x92c6('0x24')](_0x3fc8fc);};}exports['index']=function(_0x531be0,_0x515425){var _0x11f22d={},_0x4d83dd={},_0x376c86={'count':0x0,'rows':[]};var _0x21b1a0=_[_0x92c6('0x25')](db[_0x92c6('0x26')][_0x92c6('0x27')],function(_0x5d9521){return{'name':_0x5d9521['fieldName'],'type':_0x5d9521[_0x92c6('0x28')][_0x92c6('0x29')]};});_0x4d83dd['model']=_[_0x92c6('0x25')](_0x21b1a0,'name');_0x4d83dd['query']=_[_0x92c6('0x2a')](_0x531be0['query']);_0x4d83dd[_0x92c6('0x2b')]=_[_0x92c6('0x2c')](_0x4d83dd[_0x92c6('0x2d')],_0x4d83dd[_0x92c6('0x2e')]);_0x11f22d['attributes']=_[_0x92c6('0x2c')](_0x4d83dd[_0x92c6('0x2d')],qs[_0x92c6('0x2f')](_0x531be0[_0x92c6('0x2e')][_0x92c6('0x2f')]));_0x11f22d[_0x92c6('0x30')]=_0x11f22d['attributes'][_0x92c6('0x31')]?_0x11f22d['attributes']:_0x4d83dd[_0x92c6('0x2d')];if(!_0x531be0['query']['hasOwnProperty']('nolimit')){_0x11f22d['limit']=qs[_0x92c6('0x17')](_0x531be0[_0x92c6('0x2e')][_0x92c6('0x17')]);_0x11f22d['offset']=qs[_0x92c6('0x15')](_0x531be0[_0x92c6('0x2e')][_0x92c6('0x15')]);}_0x11f22d[_0x92c6('0x32')]=qs[_0x92c6('0x33')](_0x531be0[_0x92c6('0x2e')]['sort']);_0x11f22d['where']=qs[_0x92c6('0x2b')](_['pick'](_0x531be0[_0x92c6('0x2e')],_0x4d83dd['filters']),_0x21b1a0);if(_0x531be0[_0x92c6('0x2e')][_0x92c6('0x34')]){_0x11f22d[_0x92c6('0x35')]=_['merge'](_0x11f22d[_0x92c6('0x35')],{'$or':_[_0x92c6('0x25')](_0x21b1a0,function(_0x208899){if(_0x208899[_0x92c6('0x28')]!=='VIRTUAL'){var _0x55a3d0={};_0x55a3d0[_0x208899[_0x92c6('0x23')]]={'$like':'%'+_0x531be0['query'][_0x92c6('0x34')]+'%'};return _0x55a3d0;}})});}_0x11f22d=_['merge']({},_0x11f22d,_0x531be0['options']);var _0x26c9c3={'where':_0x11f22d[_0x92c6('0x35')]};return db[_0x92c6('0x26')][_0x92c6('0x18')](_0x26c9c3)[_0x92c6('0x1f')](function(_0x41c2a3){_0x376c86[_0x92c6('0x18')]=_0x41c2a3;if(_0x531be0[_0x92c6('0x2e')][_0x92c6('0x36')]){_0x11f22d['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x92c6('0x37')](_0x11f22d);})[_0x92c6('0x1f')](function(_0x1f7827){_0x376c86['rows']=_0x1f7827;return _0x376c86;})[_0x92c6('0x1f')](respondWithFilteredResult(_0x515425,_0x11f22d))[_0x92c6('0x38')](handleError(_0x515425,null));};exports[_0x92c6('0x39')]=function(_0x5805b1,_0xbe4297){var _0x5b877e={'raw':!![],'where':{'id':_0x5805b1[_0x92c6('0x3a')]['id']}},_0x2b6ce8={};_0x2b6ce8['model']=_[_0x92c6('0x2a')](db[_0x92c6('0x26')][_0x92c6('0x27')]);_0x2b6ce8[_0x92c6('0x2e')]=_[_0x92c6('0x2a')](_0x5805b1[_0x92c6('0x2e')]);_0x2b6ce8[_0x92c6('0x2b')]=_[_0x92c6('0x2c')](_0x2b6ce8[_0x92c6('0x2d')],_0x2b6ce8[_0x92c6('0x2e')]);_0x5b877e[_0x92c6('0x30')]=_[_0x92c6('0x2c')](_0x2b6ce8[_0x92c6('0x2d')],qs[_0x92c6('0x2f')](_0x5805b1[_0x92c6('0x2e')][_0x92c6('0x2f')]));_0x5b877e[_0x92c6('0x30')]=_0x5b877e[_0x92c6('0x30')]['length']?_0x5b877e[_0x92c6('0x30')]:_0x2b6ce8[_0x92c6('0x2d')];if(_0x5805b1[_0x92c6('0x2e')]['includeAll']){_0x5b877e[_0x92c6('0x3b')]=[{'all':!![]}];}_0x5b877e=_[_0x92c6('0x3c')]({},_0x5b877e,_0x5805b1['options']);return db[_0x92c6('0x26')][_0x92c6('0x3d')](_0x5b877e)['then'](handleEntityNotFound(_0xbe4297,null))[_0x92c6('0x1f')](respondWithResult(_0xbe4297,null))[_0x92c6('0x38')](handleError(_0xbe4297,null));};exports[_0x92c6('0x3e')]=function(_0x3e4537,_0x4ec2d9){return db[_0x92c6('0x26')]['create'](_0x3e4537['body'],{})[_0x92c6('0x1f')](respondWithResult(_0x4ec2d9,0xc9))['catch'](handleError(_0x4ec2d9,null));};exports[_0x92c6('0x1e')]=function(_0x34ac48,_0x36932c){if(_0x34ac48['body']['id']){delete _0x34ac48['body']['id'];}return db[_0x92c6('0x26')]['find']({'where':{'id':_0x34ac48['params']['id']}})[_0x92c6('0x1f')](handleEntityNotFound(_0x36932c,null))[_0x92c6('0x1f')](saveUpdates(_0x34ac48['body'],null))[_0x92c6('0x1f')](respondWithResult(_0x36932c,null))[_0x92c6('0x38')](handleError(_0x36932c,null));};exports[_0x92c6('0x20')]=function(_0x2e4eb7,_0x4255f9){return db[_0x92c6('0x26')]['find']({'where':{'id':_0x2e4eb7[_0x92c6('0x3a')]['id']}})[_0x92c6('0x1f')](handleEntityNotFound(_0x4255f9,null))['then'](removeEntity(_0x4255f9,null))['catch'](handleError(_0x4255f9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 5db4632..b735b0e 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 _0xf031=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','event_dtm','event','dtm'];(function(_0x11f682,_0x259ef5){var _0x46a0f9=function(_0x16b67e){while(--_0x16b67e){_0x11f682['push'](_0x11f682['shift']());}};_0x46a0f9(++_0x259ef5);}(_0xf031,0xfc));var _0x1f03=function(_0x55b460,_0x27a7b8){_0x55b460=_0x55b460-0x0;var _0x40f22f=_0xf031[_0x55b460];return _0x40f22f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f03('0x0'))(_0x1f03('0x1'));var moment=require(_0x1f03('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f03('0x3'));var rimraf=require(_0x1f03('0x4'));var config=require(_0x1f03('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x1f03('0x6')]=function(_0x2dc000,_0xfef1){return _0x2dc000[_0x1f03('0x7')](_0x1f03('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x1f03('0x9'),'fields':[_0x1f03('0xa'),_0x1f03('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x76a3=['path','rimraf','../../config/environment','define','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2c48df,_0x46e91c){var _0x5f223a=function(_0x11f763){while(--_0x11f763){_0x2c48df['push'](_0x2c48df['shift']());}};_0x5f223a(++_0x46e91c);}(_0x76a3,0xf8));var _0x376a=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x76a3[_0x32b993];return _0x482780;};'use strict';var _=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var logger=require(_0x376a('0x2'))(_0x376a('0x3'));var moment=require(_0x376a('0x4'));var BPromise=require(_0x376a('0x5'));var rp=require(_0x376a('0x6'));var fs=require('fs');var path=require(_0x376a('0x7'));var rimraf=require(_0x376a('0x8'));var config=require(_0x376a('0x9'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x19ea68,_0x22904c){return _0x19ea68[_0x376a('0xa')](_0x376a('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x376a('0xc'),'fields':[_0x376a('0xd'),_0x376a('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 4ad7dfd..e8b353e 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 _0x4c0e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x4c0e,0x128));var _0xe4c0=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x4c0e[_0x3c6ae2];return _0x4edda;};'use strict';var _=require(_0xe4c0('0x0'));var util=require(_0xe4c0('0x1'));var moment=require(_0xe4c0('0x2'));var BPromise=require(_0xe4c0('0x3'));var rs=require(_0xe4c0('0x4'));var fs=require('fs');var Redis=require(_0xe4c0('0x5'));var db=require(_0xe4c0('0x6'))['db'];var utils=require(_0xe4c0('0x7'));var logger=require(_0xe4c0('0x8'))('rpc');var config=require(_0xe4c0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe4c0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4488b0,_0x503cd9,_0x5dee9f){return new BPromise(function(_0x46fcfa,_0x3ab99d){return client['request'](_0x4488b0,_0x5dee9f)[_0xe4c0('0xb')](function(_0x15b3d0){logger[_0xe4c0('0xc')](_0xe4c0('0xd'),_0x503cd9,'request\x20sent');logger[_0xe4c0('0xe')](_0xe4c0('0xf'),_0x503cd9,_0xe4c0('0x10'),JSON[_0xe4c0('0x11')](_0x15b3d0));if(_0x15b3d0[_0xe4c0('0x12')]){if(_0x15b3d0[_0xe4c0('0x12')][_0xe4c0('0x13')]===0x1f4){logger[_0xe4c0('0x12')](_0xe4c0('0xd'),_0x503cd9,_0x15b3d0[_0xe4c0('0x12')][_0xe4c0('0x14')]);return _0x3ab99d(_0x15b3d0['error'][_0xe4c0('0x14')]);}logger[_0xe4c0('0x12')](_0xe4c0('0xd'),_0x503cd9,_0x15b3d0[_0xe4c0('0x12')]['message']);return _0x46fcfa(_0x15b3d0[_0xe4c0('0x12')][_0xe4c0('0x14')]);}else{logger[_0xe4c0('0xc')](_0xe4c0('0xd'),_0x503cd9,'request\x20sent');_0x46fcfa(_0x15b3d0[_0xe4c0('0x15')]['message']);}})[_0xe4c0('0x16')](function(_0x3d3bcf){logger[_0xe4c0('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x503cd9,_0x3d3bcf);_0x3ab99d(_0x3d3bcf);});});} \ No newline at end of file +var _0x52ae=['lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch'];(function(_0x24a7ac,_0x29b1dd){var _0x116889=function(_0x2b88dc){while(--_0x2b88dc){_0x24a7ac['push'](_0x24a7ac['shift']());}};_0x116889(++_0x29b1dd);}(_0x52ae,0x18f));var _0xe52a=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x52ae[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0xe52a('0x0'));var util=require(_0xe52a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe52a('0x2'));var db=require(_0xe52a('0x3'))['db'];var utils=require(_0xe52a('0x4'));var logger=require(_0xe52a('0x5'))(_0xe52a('0x6'));var config=require(_0xe52a('0x7'));var jayson=require(_0xe52a('0x8'));var client=jayson[_0xe52a('0x9')][_0xe52a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570238,_0x55292f,_0x152ce3){return new BPromise(function(_0x29e551,_0x389bb6){return client['request'](_0x570238,_0x152ce3)[_0xe52a('0xb')](function(_0x3a5c31){logger[_0xe52a('0xc')](_0xe52a('0xd'),_0x55292f,'request\x20sent');logger[_0xe52a('0xe')](_0xe52a('0xf'),_0x55292f,'request\x20sent',JSON[_0xe52a('0x10')](_0x3a5c31));if(_0x3a5c31[_0xe52a('0x11')]){if(_0x3a5c31[_0xe52a('0x11')]['code']===0x1f4){logger[_0xe52a('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x55292f,_0x3a5c31['error'][_0xe52a('0x12')]);return _0x389bb6(_0x3a5c31[_0xe52a('0x11')][_0xe52a('0x12')]);}logger[_0xe52a('0x11')](_0xe52a('0xd'),_0x55292f,_0x3a5c31['error'][_0xe52a('0x12')]);return _0x29e551(_0x3a5c31[_0xe52a('0x11')][_0xe52a('0x12')]);}else{logger[_0xe52a('0xc')](_0xe52a('0xd'),_0x55292f,_0xe52a('0x13'));_0x29e551(_0x3a5c31['result'][_0xe52a('0x12')]);}})[_0xe52a('0x14')](function(_0x31763e){logger['error'](_0xe52a('0xd'),_0x55292f,_0x31763e);_0x389bb6(_0x31763e);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 4d3af6c..3ae3447 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 _0xf2f5=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','runTranscribe'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf2f5,0x13d));var _0x5f2f=function(_0x57759b,_0x7c4540){_0x57759b=_0x57759b-0x0;var _0x2717b6=_0xf2f5[_0x57759b];return _0x2717b6;};'use strict';var multer=require(_0x5f2f('0x0'));var util=require('util');var path=require(_0x5f2f('0x1'));var timeout=require(_0x5f2f('0x2'));var express=require(_0x5f2f('0x3'));var router=express[_0x5f2f('0x4')]();var fs_extra=require(_0x5f2f('0x5'));var auth=require(_0x5f2f('0x6'));var interaction=require(_0x5f2f('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x5f2f('0x8')]('/',auth[_0x5f2f('0x9')](),controller[_0x5f2f('0xa')]);router['get']('/describe',auth[_0x5f2f('0x9')](),controller[_0x5f2f('0xb')]);router['get'](_0x5f2f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5f2f('0x8')](_0x5f2f('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x5f2f('0x8')](_0x5f2f('0xe'),controller[_0x5f2f('0xf')]);router[_0x5f2f('0x8')](_0x5f2f('0x10'),auth[_0x5f2f('0x9')](),controller[_0x5f2f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5f2f('0x10'),auth[_0x5f2f('0x9')](),controller[_0x5f2f('0x12')]);router[_0x5f2f('0x13')](_0x5f2f('0xc'),auth['isAuthenticated'](),controller[_0x5f2f('0x14')]);router[_0x5f2f('0x15')]('/:id',auth[_0x5f2f('0x9')](),controller[_0x5f2f('0x16')]);module[_0x5f2f('0x17')]=router; \ No newline at end of file +var _0x20cc=['describe','/:id','show','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','put','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x5e2cdb,_0x5dcd81){var _0x3870cb=function(_0x52c719){while(--_0x52c719){_0x5e2cdb['push'](_0x5e2cdb['shift']());}};_0x3870cb(++_0x5dcd81);}(_0x20cc,0x131));var _0xc20c=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x20cc[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var path=require(_0xc20c('0x2'));var timeout=require(_0xc20c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc20c('0x4'));var auth=require(_0xc20c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc20c('0x6'));var controller=require('./voiceRecording.controller');router[_0xc20c('0x7')]('/',auth[_0xc20c('0x8')](),controller['index']);router[_0xc20c('0x7')](_0xc20c('0x9'),auth[_0xc20c('0x8')](),controller[_0xc20c('0xa')]);router[_0xc20c('0x7')](_0xc20c('0xb'),auth[_0xc20c('0x8')](),controller[_0xc20c('0xc')]);router[_0xc20c('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xc20c('0xd')]);router[_0xc20c('0x7')](_0xc20c('0xe'),controller['downloads']);router[_0xc20c('0x7')]('/:id/transcribe',auth[_0xc20c('0x8')](),controller[_0xc20c('0xf')]);router[_0xc20c('0x10')]('/',auth[_0xc20c('0x8')](),controller[_0xc20c('0x11')]);router[_0xc20c('0x10')](_0xc20c('0x12'),auth[_0xc20c('0x8')](),controller['runTranscribe']);router[_0xc20c('0x13')](_0xc20c('0xb'),auth[_0xc20c('0x8')](),controller['update']);router[_0xc20c('0x14')](_0xc20c('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index afc9f8f..32d0d94 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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 90ca57f..0f2af01 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 _0x054f=['[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','intersection','include','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','sequelize','MD5','col','token','push','ValidationError','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','File:\x20\x22','listBuckets','createBucket','TranscribeService','format','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Name'];(function(_0x21b293,_0x352a44){var _0xd73e84=function(_0x16916b){while(--_0x16916b){_0x21b293['push'](_0x21b293['shift']());}};_0xd73e84(++_0x352a44);}(_0x054f,0x9d));var _0xf054=function(_0x5d08de,_0x44e601){_0x5d08de=_0x5d08de-0x0;var _0x5a2fae=_0x054f[_0x5d08de];return _0x5a2fae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf054('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf054('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf054('0x2'));var Mustache=require(_0xf054('0x3'));var util=require(_0xf054('0x4'));var path=require(_0xf054('0x5'));var sox=require(_0xf054('0x6'));var csv=require(_0xf054('0x7'));var ejs=require(_0xf054('0x8'));var fs=require('fs');var fs_extra=require(_0xf054('0x9'));var _=require('lodash');var squel=require(_0xf054('0xa'));var crypto=require(_0xf054('0xb'));var jsforce=require(_0xf054('0xc'));var deskjs=require(_0xf054('0xd'));var toCsv=require(_0xf054('0x7'));var querystring=require(_0xf054('0xe'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xf054('0xf'));var Redis=require(_0xf054('0x10'));var authService=require(_0xf054('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf054('0x12'));var hardwareService=require(_0xf054('0x13'));var logger=require(_0xf054('0x14'))('api');var utils=require(_0xf054('0x15'));var config=require(_0xf054('0x16'));var licenseUtil=require(_0xf054('0x17'));var db=require(_0xf054('0x18'))['db'];function respondWithStatusCode(_0x40e14b,_0x2eee94){_0x2eee94=_0x2eee94||0xcc;return function(_0x4c52e9){if(_0x4c52e9){return _0x40e14b[_0xf054('0x19')](_0x2eee94);}return _0x40e14b[_0xf054('0x1a')](_0x2eee94)['end']();};}function respondWithResult(_0x2dbf11,_0x27e4fb){_0x27e4fb=_0x27e4fb||0xc8;return function(_0x47e3f4){if(_0x47e3f4){return _0x2dbf11[_0xf054('0x1a')](_0x27e4fb)[_0xf054('0x1b')](_0x47e3f4);}};}function respondWithFilteredResult(_0x56fd0c,_0x1587de){return function(_0xd8ed90){if(_0xd8ed90){var _0x5f4b39=typeof _0x1587de['offset']===_0xf054('0x1c')&&typeof _0x1587de[_0xf054('0x1d')]===_0xf054('0x1c');var _0x49dd81=_0xd8ed90[_0xf054('0x1e')];var _0x1ea90c=_0x5f4b39?0x0:_0x1587de[_0xf054('0x1f')];var _0x306549=_0x5f4b39?_0xd8ed90['count']:_0x1587de[_0xf054('0x1f')]+_0x1587de[_0xf054('0x1d')];var _0x332d20;if(_0x306549>=_0x49dd81){_0x306549=_0x49dd81;_0x332d20=0xc8;}else{_0x332d20=0xce;}_0x56fd0c['status'](_0x332d20);return _0x56fd0c['set'](_0xf054('0x20'),_0x1ea90c+'-'+_0x306549+'/'+_0x49dd81)[_0xf054('0x1b')](_0xd8ed90);}return null;};}function patchUpdates(_0x47791a){return function(_0x7c083){try{jsonpatch[_0xf054('0x21')](_0x7c083,_0x47791a,!![]);}catch(_0x281a94){return BPromise['reject'](_0x281a94);}return _0x7c083[_0xf054('0x22')]();};}function saveUpdates(_0x2e00cb,_0x1e341b){return function(_0x1bf2d0){if(_0x1bf2d0){return _0x1bf2d0[_0xf054('0x23')](_0x2e00cb)[_0xf054('0x24')](function(_0x4c7349){return _0x4c7349;});}return null;};}function removeEntity(_0x598d4f,_0x5d4623){return function(_0x359d59){if(_0x359d59){return _0x359d59[_0xf054('0x25')]()[_0xf054('0x24')](function(){_0x598d4f[_0xf054('0x1a')](0xcc)[_0xf054('0x26')]();});}};}function handleEntityNotFound(_0x437b78,_0x10e631){return function(_0x15817f){if(!_0x15817f){_0x437b78[_0xf054('0x19')](0x194);}return _0x15817f;};}function handleError(_0x13a309,_0x1877de){_0x1877de=_0x1877de||0x1f4;return function(_0x569db1){logger['error'](_0x569db1[_0xf054('0x27')]);if(_0x569db1[_0xf054('0x28')]){delete _0x569db1['name'];}_0x13a309[_0xf054('0x1a')](_0x1877de)[_0xf054('0x29')](_0x569db1);};}exports[_0xf054('0x2a')]=function(_0x197b7d,_0x7c372c){var _0x2df765={},_0xa50096={},_0x16ca4b={'count':0x0,'rows':[]};var _0x4af5fe=_[_0xf054('0x2b')](db[_0xf054('0x2c')][_0xf054('0x2d')],function(_0x25cff6){return{'name':_0x25cff6[_0xf054('0x2e')],'type':_0x25cff6['type'][_0xf054('0x2f')]};});_0xa50096[_0xf054('0x30')]=_['differenceBy'](_['map'](_0x4af5fe,_0xf054('0x28')),['format']);_0xa50096[_0xf054('0x31')]=_[_0xf054('0x32')](_0x197b7d[_0xf054('0x31')]);_0xa50096[_0xf054('0x33')]=_['intersection'](_0xa50096[_0xf054('0x30')],_0xa50096['query']);_0x2df765[_0xf054('0x34')]=_['intersection'](_0xa50096[_0xf054('0x30')],qs['fields'](_0x197b7d[_0xf054('0x31')][_0xf054('0x35')]));_0x2df765[_0xf054('0x34')]=_0x2df765[_0xf054('0x34')][_0xf054('0x36')]?_0x2df765[_0xf054('0x34')]:_0xa50096[_0xf054('0x30')];if(!_0x197b7d['query']['hasOwnProperty'](_0xf054('0x37'))){_0x2df765[_0xf054('0x1d')]=qs['limit'](_0x197b7d[_0xf054('0x31')][_0xf054('0x1d')]);_0x2df765['offset']=qs[_0xf054('0x1f')](_0x197b7d[_0xf054('0x31')][_0xf054('0x1f')]);}_0x2df765[_0xf054('0x38')]=qs[_0xf054('0x39')](_0x197b7d[_0xf054('0x31')]['sort']);_0x2df765[_0xf054('0x3a')]=qs[_0xf054('0x33')](_[_0xf054('0x3b')](_0x197b7d[_0xf054('0x31')],_0xa50096[_0xf054('0x33')]),_0x4af5fe);if(_0x197b7d[_0xf054('0x31')]['filter']){_0x2df765[_0xf054('0x3a')]=_[_0xf054('0x3c')](_0x2df765['where'],{'$or':_[_0xf054('0x2b')](_0x4af5fe,function(_0x47c1c9){if(_0x47c1c9[_0xf054('0x3d')]!==_0xf054('0x3e')){var _0x5b6e2e={};_0x5b6e2e[_0x47c1c9[_0xf054('0x28')]]={'$like':'%'+_0x197b7d[_0xf054('0x31')][_0xf054('0x3f')]+'%'};return _0x5b6e2e;}})});}_0x2df765=_[_0xf054('0x3c')]({},_0x2df765,_0x197b7d[_0xf054('0x40')]);var _0x5b9e1d={'where':_0x2df765[_0xf054('0x3a')]};return db[_0xf054('0x2c')][_0xf054('0x1e')](_0x5b9e1d)[_0xf054('0x24')](function(_0x2265bf){_0x16ca4b[_0xf054('0x1e')]=_0x2265bf;if(_0x197b7d['query'][_0xf054('0x41')]){_0x2df765['include']=[{'all':!![]}];}return db['VoiceRecording'][_0xf054('0x42')](_0x2df765);})[_0xf054('0x24')](function(_0x2a1ff1){_0x16ca4b[_0xf054('0x43')]=_0x2a1ff1;return _0x16ca4b;})[_0xf054('0x24')](respondWithFilteredResult(_0x7c372c,_0x2df765))[_0xf054('0x44')](handleError(_0x7c372c,null));};exports['show']=function(_0x31c3cb,_0x292ff3){var _0x5989e5={'raw':![],'where':{'id':_0x31c3cb[_0xf054('0x45')]['id']}},_0x3e54e6={};_0x3e54e6['model']=_[_0xf054('0x32')](db[_0xf054('0x2c')][_0xf054('0x2d')]);_0x3e54e6['query']=_[_0xf054('0x32')](_0x31c3cb[_0xf054('0x31')]);_0x3e54e6['filters']=_[_0xf054('0x46')](_0x3e54e6['model'],_0x3e54e6[_0xf054('0x31')]);_0x5989e5['attributes']=_[_0xf054('0x46')](_0x3e54e6[_0xf054('0x30')],qs[_0xf054('0x35')](_0x31c3cb[_0xf054('0x31')][_0xf054('0x35')]));_0x5989e5[_0xf054('0x34')]=_0x5989e5[_0xf054('0x34')][_0xf054('0x36')]?_0x5989e5['attributes']:_0x3e54e6[_0xf054('0x30')];if(_0x31c3cb[_0xf054('0x31')][_0xf054('0x41')]){_0x5989e5[_0xf054('0x47')]=[{'all':!![]}];}_0x5989e5=_[_0xf054('0x3c')]({},_0x5989e5,_0x31c3cb[_0xf054('0x40')]);return db[_0xf054('0x2c')][_0xf054('0x48')](_0x5989e5)['then'](handleEntityNotFound(_0x292ff3,null))['then'](respondWithResult(_0x292ff3,null))[_0xf054('0x44')](handleError(_0x292ff3,null));};exports[_0xf054('0x49')]=function(_0x5a5ea0,_0x3ad366){return db[_0xf054('0x2c')][_0xf054('0x49')](_0x5a5ea0[_0xf054('0x4a')],{})[_0xf054('0x24')](respondWithResult(_0x3ad366,0xc9))[_0xf054('0x44')](handleError(_0x3ad366,null));};exports[_0xf054('0x23')]=function(_0x3aa7c4,_0x13e04e){if(_0x3aa7c4['body']['id']){delete _0x3aa7c4[_0xf054('0x4a')]['id'];}return db['VoiceRecording'][_0xf054('0x48')]({'where':{'id':_0x3aa7c4[_0xf054('0x45')]['id']}})['then'](handleEntityNotFound(_0x13e04e,null))[_0xf054('0x24')](saveUpdates(_0x3aa7c4['body'],null))[_0xf054('0x24')](respondWithResult(_0x13e04e,null))[_0xf054('0x44')](handleError(_0x13e04e,null));};exports[_0xf054('0x4b')]=function(_0x3a509b,_0x3d5eb5){return db[_0xf054('0x2c')]['describe']()[_0xf054('0x24')](respondWithResult(_0x3d5eb5,null))[_0xf054('0x44')](handleError(_0x3d5eb5,null));};exports[_0xf054('0x4c')]=function(_0x178bf5,_0x364469,_0x17fc5d){var _0x3bae3c=require(_0xf054('0x4d'));var _0x3ef352=![];var _0xda1b2a={};if(_0x178bf5[_0xf054('0x31')]['type']&&_0x178bf5[_0xf054('0x31')][_0xf054('0x3d')]===_0xf054('0x4e')){_0xda1b2a[_0xf054('0x4e')]=_0x178bf5[_0xf054('0x45')]['id'];}else{_0xda1b2a['id']=_0x178bf5[_0xf054('0x45')]['id'];}return db['VoiceRecording']['find']({'where':_0xda1b2a,'attributes':['id',_0xf054('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x364469,null))['then'](function(_0x75f135){if(_0x75f135){var _0x546de2=_0x75f135[_0xf054('0x4f')];var _0x3f047a=util['format'](_0xf054('0x50'),_0x546de2);if(fs[_0xf054('0x51')](_0x3f047a)){_0x3ef352=!![];return _0x3bae3c[_0xf054('0x52')](_0x3f047a,_0x546de2,config[_0xf054('0x53')][_0xf054('0x54')])['then'](function(){return _0x75f135;});}return _0x75f135;}})[_0xf054('0x24')](function(_0x4a4116){if(_0x4a4116){var _0x1d68d2=_0x4a4116[_0xf054('0x4f')];if(!fs[_0xf054('0x51')](_0x1d68d2)){throw new db[(_0xf054('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x4a4116[_0xf054('0x56')]){return _0x364469[_0xf054('0x4c')](_0x1d68d2,_0x4a4116[_0xf054('0x56')]+path[_0xf054('0x57')](_0x1d68d2),function(){if(_0x3ef352){fs[_0xf054('0x58')](_0x1d68d2);}});}else{return _0x364469[_0xf054('0x4c')](_0x1d68d2,function(_0xf65447){if(_0x3ef352){fs[_0xf054('0x58')](_0x1d68d2);}});}}})['catch'](function(_0x523364){if(_0x523364[_0xf054('0x59')]===_0xf054('0x5a')){_0x364469['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x364469,null);}});};exports['downloads']=function(_0x3b0c88,_0x1419c1,_0x5e6c7e){var _0x4d78c4=require('../../components/encryptor');var _0x45385c=![];var _0x2b31b5={'$and':[db[_0xf054('0x5b')][_0xf054('0x3a')](db[_0xf054('0x5b')]['fn'](_0xf054('0x5c'),db[_0xf054('0x5b')][_0xf054('0x5d')](_0xf054('0x4e'))),_0x3b0c88[_0xf054('0x31')][_0xf054('0x5e')])]};if(_0x3b0c88[_0xf054('0x31')][_0xf054('0x3d')]&&_0x3b0c88[_0xf054('0x31')][_0xf054('0x3d')]===_0xf054('0x4e')){_0x2b31b5['$and'][_0xf054('0x5f')]({'uniqueid':_0x3b0c88[_0xf054('0x45')]['id']});}else{_0x2b31b5['$and'][_0xf054('0x5f')]({'id':_0x3b0c88[_0xf054('0x45')]['id']});}return db[_0xf054('0x2c')][_0xf054('0x48')]({'where':_0x2b31b5,'attributes':['id',_0xf054('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x1419c1,null))[_0xf054('0x24')](function(_0x4c2356){if(_0x4c2356){var _0x1a1efe=util['format'](_0xf054('0x50'),_0x4c2356[_0xf054('0x4f')]);if(fs[_0xf054('0x51')](_0x1a1efe)){_0x45385c=!![];return _0x4d78c4[_0xf054('0x52')](_0x1a1efe,_0x4c2356[_0xf054('0x4f')],config[_0xf054('0x53')][_0xf054('0x54')])[_0xf054('0x24')](function(){return _0x4c2356;});}return _0x4c2356;}})[_0xf054('0x24')](function(_0x4967d1){if(_0x4967d1){if(!fs[_0xf054('0x51')](_0x4967d1['value'])){throw new db[(_0xf054('0x55'))][(_0xf054('0x60'))](_0xf054('0x5a'));}if(_0x4967d1[_0xf054('0x56')]){return _0x1419c1[_0xf054('0x4c')](_0x4967d1['value'],_0x4967d1[_0xf054('0x56')]+path[_0xf054('0x57')](_0x4967d1[_0xf054('0x4f')]),function(){if(_0x45385c){fs[_0xf054('0x58')](_0x4967d1[_0xf054('0x4f')]);}});}else{return _0x1419c1[_0xf054('0x4c')](_0x4967d1[_0xf054('0x4f')],function(_0x13129e){if(_0x45385c){fs['unlink'](_0x4967d1[_0xf054('0x4f')]);}});}}})[_0xf054('0x44')](handleError(_0x1419c1,null));};exports[_0xf054('0x25')]=function(_0x331dde,_0x40c2e2){return db[_0xf054('0x2c')]['find']({'where':{'id':_0x331dde['params']['id']}})[_0xf054('0x24')](function(_0x55a077){if(_['isNil'](_0x55a077)){throw new ReferenceError('Entity\x20not\x20found');}return _0x55a077;})[_0xf054('0x24')](function(_0x3f67eb){var _0x349dde=_0x3f67eb[_0xf054('0x4f')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x349dde);if(!_['isNil'](_0x3f67eb[_0xf054('0x4f')])&&fs[_0xf054('0x51')](_0x349dde)){logger[_0xf054('0x61')]('File:\x20\x22'+_0x349dde+_0xf054('0x62'));fs[_0xf054('0x63')](_0x349dde);}_0x349dde=_0x349dde+'.cypher';if(!_[_0xf054('0x64')](_0x3f67eb['value'])&&fs[_0xf054('0x51')](_0x349dde)){logger['info'](_0xf054('0x65')+_0x349dde+_0xf054('0x62'));fs['unlinkSync'](_0x349dde);}return _0x3f67eb;})[_0xf054('0x24')](function(_0x56456f){if(!_0x56456f)throw new InternalError();return _0x56456f[_0xf054('0x25')]();})[_0xf054('0x24')](function(){_0x40c2e2[_0xf054('0x1a')](0xcc)['end']();})[_0xf054('0x44')](handleError(_0x40c2e2,null));};function getBucketslist(_0x29c1d0,_0x443611,_0x5d7f88){return new Promise(function(_0x27d7ab,_0x1af28e){var _0x32f5b6=new AWS['S3']({'accessKeyId':_0x443611,'secretAccessKey':_0x29c1d0,'region':_0x5d7f88});_0x32f5b6[_0xf054('0x66')]({},function(_0x39cda6,_0xb1f969){if(_0x39cda6){return _0x1af28e(_0x39cda6);}else{return _0x27d7ab(_0xb1f969);}});});}function createBucket(_0x129537,_0x1a5e08,_0x5b8cc6,_0x2133a5){return new Promise(function(_0x5bf143,_0x424836){var _0x52c102=new AWS['S3']({'accessKeyId':_0x1a5e08,'secretAccessKey':_0x129537,'region':_0x5b8cc6});_0x52c102[_0xf054('0x67')]({'Bucket':_0x2133a5},function(_0x28b49e,_0x57b6ad){if(_0x28b49e){return _0x424836(_0x28b49e);}else{return _0x5bf143(_0x57b6ad);}});});}function uploadFile(_0x1c0df8,_0x3e1691,_0x51be99,_0x8318d6,_0x3ca404,_0x1a1457){return new Promise(function(_0x9cc12f,_0x100816){var _0x28d6be=new AWS['S3']({'accessKeyId':_0x3e1691,'secretAccessKey':_0x1c0df8,'region':_0x51be99});_0x28d6be['upload']({'Bucket':_0x8318d6,'Key':_0x3ca404,'Body':_0x1a1457},function(_0x321e46,_0x1c9cc0){if(_0x321e46){return _0x100816(_0x321e46);}else{return _0x9cc12f(_0x1c9cc0);}});});}function startTranscribe(_0x5eed48,_0x1554f8,_0x8b0b83,_0x396432,_0x40de65,_0x3a7fee){return new Promise(function(_0x1fdf87,_0x5db0d8){var _0x2b45f7=new AWS[(_0xf054('0x68'))]({'accessKeyId':_0x1554f8,'secretAccessKey':_0x5eed48,'region':_0x8b0b83});_0x2b45f7['startTranscriptionJob']({'TranscriptionJobName':_0x396432,'LanguageCode':_0x40de65,'Media':{'MediaFileUri':_0x3a7fee}},function(_0x86dfaa,_0x358564){if(_0x86dfaa){return _0x5db0d8(_0x86dfaa);}else{return _0x1fdf87(_0x358564);}});});}function transcribe(_0x32ff8e,_0x50ea15,_0x761057,_0x3bd143,_0x5ef071,_0x45d560,_0x2bff62){return new Promise(function(_0x354204,_0x574606){var _0x3d5b39={};logger[_0xf054('0x61')](util[_0xf054('0x69')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x32ff8e,_0x5ef071));return uploadFile(_0x50ea15,_0x761057,_0x3bd143,_0x5ef071,path[_0xf054('0x6a')](_0x45d560),fs[_0xf054('0x6b')](_0x45d560))[_0xf054('0x24')](function(_0x3d4687){logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x6c'),_0x32ff8e,_0x5ef071,_0x3d4687[_0xf054('0x6d')]));_0x3d5b39[_0xf054('0x6e')]=_0x3d4687[_0xf054('0x6f')];_0x3d5b39['location']=_0x3d4687[_0xf054('0x6d')];logger[_0xf054('0x61')](util[_0xf054('0x69')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x32ff8e));return startTranscribe(_0x50ea15,_0x761057,_0x3bd143,uuidv4(),_0x2bff62,_0x3d4687[_0xf054('0x6d')]);})[_0xf054('0x24')](function(_0x132df0){logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x70'),_0x32ff8e,_0x132df0[_0xf054('0x71')][_0xf054('0x72')]));_0x3d5b39[_0xf054('0x73')]=_0x132df0[_0xf054('0x71')][_0xf054('0x72')];_0x3d5b39['transcribeStatus']=_0x132df0['TranscriptionJob']['TranscriptionJobStatus'];return _0x354204(_0x3d5b39);})[_0xf054('0x44')](function(_0x149924){return _0x574606(_0x149924);});});}exports[_0xf054('0x74')]=function(_0x21bda6,_0x58eb6f,_0x34b96c){var _0x48634c;var _0x25746b;var _0x14b8ed;var _0x3a5637=require(_0xf054('0x4d'));return db[_0xf054('0x2c')][_0xf054('0x75')]({'where':{'id':_0x21bda6[_0xf054('0x45')]['id']}})['then'](function(_0x3fcf90){if(_0x3fcf90){var _0x13c485=util[_0xf054('0x69')](_0xf054('0x50'),_0x3fcf90[_0xf054('0x4f')]);if(fs['existsSync'](_0x13c485)){cypher=!![];return _0x3a5637[_0xf054('0x52')](_0x13c485,_0x3fcf90[_0xf054('0x4f')],config[_0xf054('0x53')][_0xf054('0x54')])[_0xf054('0x24')](function(){return _0x3fcf90;});}return _0x3fcf90;}})[_0xf054('0x24')](function(_0x23b6dd){if(!_0x23b6dd){throw new db['Sequelize'][(_0xf054('0x60'))](_0xf054('0x76'));}_0x25746b=_0x23b6dd;return db['Setting'][_0xf054('0x75')]({'where':{'id':0x1}});})[_0xf054('0x24')](handleEntityNotFound(_0x58eb6f,null))[_0xf054('0x24')](function(_0xa0119c){if(_0xa0119c){_0x48634c=_0xa0119c;if(!_0x48634c[_0xf054('0x77')]||!_0x48634c[_0xf054('0x78')]||!_0x48634c[_0xf054('0x79')]||!_0x48634c['language']||!_0x48634c[_0xf054('0x6e')]){throw new db[(_0xf054('0x55'))]['ValidationError'](_0xf054('0x7a'));}if(_0x21bda6['body']['runSentiment']&&(!_0x48634c[_0xf054('0x7b')]||!_0x48634c[_0xf054('0x7c')]||!_0x48634c[_0xf054('0x7d')]||!_0x48634c[_0xf054('0x7e')]||!_0x48634c['bucket'])){throw new db[(_0xf054('0x55'))][(_0xf054('0x60'))](_0xf054('0x7f'));}return db[_0xf054('0x80')]['findOne']({'where':{'id':_0x48634c['transcribeAccountId']}});}})[_0xf054('0x24')](function(_0xfdef1e){if(!_0xfdef1e){throw new db['Sequelize'][(_0xf054('0x60'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xfdef1e[_0xf054('0x81')]||!_0xfdef1e[_0xf054('0x82')]){throw new db['Sequelize'][(_0xf054('0x60'))](_0xf054('0x83'));}_0x14b8ed=_0xfdef1e;return getBucketslist(_0x14b8ed[_0xf054('0x81')],_0x14b8ed['data2'],_0x48634c['transcribeRegion']);})[_0xf054('0x24')](function(_0x4fa971){if(_0x4fa971&&_0x4fa971['Buckets']){var _0x5251b3=_[_0xf054('0x48')](_0x4fa971['Buckets'],function(_0xd7f1d3){return _0xd7f1d3[_0xf054('0x84')]===_0x48634c[_0xf054('0x6e')];});if(!_0x5251b3){logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x85'),_0x21bda6[_0xf054('0x45')]['id'],_0x48634c['bucket']));return createBucket(_0x14b8ed[_0xf054('0x81')],_0x14b8ed['data2'],_0x48634c['transcribeRegion'],_0x48634c[_0xf054('0x6e')]);}logger[_0xf054('0x61')](util[_0xf054('0x69')](_0xf054('0x86'),_0x21bda6[_0xf054('0x45')]['id'],_0x48634c[_0xf054('0x6e')]));return;}})[_0xf054('0x24')](function(_0x540e7f){if(_0x25746b[_0xf054('0x87')]==='NEW'){return transcribe(_0x21bda6['params']['id'],_0x14b8ed[_0xf054('0x81')],_0x14b8ed[_0xf054('0x82')],_0x48634c[_0xf054('0x79')],_0x48634c[_0xf054('0x6e')],_0x25746b[_0xf054('0x4f')],_0x48634c['language']);}else{logger[_0xf054('0x61')](util[_0xf054('0x69')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x21bda6[_0xf054('0x45')]['id']));return{'transcribeStatus':_0xf054('0x88')};}})['then'](function(_0x5e619b){if(_0x5e619b){_0x5e619b[_0xf054('0x89')]=_0x21bda6[_0xf054('0x4a')]['runSentiment'];return _0x25746b[_0xf054('0x8a')](_0x5e619b);}})['then'](respondWithResult(_0x58eb6f,null))[_0xf054('0x44')](handleError(_0x58eb6f,null));};function writeFile(_0x23f1d4,_0x58dd3f){return new Promise(function(_0xbf316b,_0x5c499b){fs[_0xf054('0x8b')](_0x58dd3f,_0x23f1d4,function(_0x5758d7,_0x4241a6){if(_0x5758d7){return _0x5c499b(_0x5758d7);}else{return _0xbf316b(_0x4241a6);}});});}exports['downloadTranscribe']=function(_0x5ac6f0,_0x3d2014,_0x2bb5f5){return db[_0xf054('0x2c')][_0xf054('0x75')]({'where':{'id':_0x5ac6f0['params']['id']}})[_0xf054('0x24')](handleEntityNotFound(_0x3d2014))[_0xf054('0x24')](function(_0xc4b86b){if(_0xc4b86b&&_0xc4b86b['fileText']){var _0x2d7a96=_0xc4b86b[_0xf054('0x8c')];var _0x1264e6=config[_0xf054('0x8d')]+_0xf054('0x8e')+_0xc4b86b['id']+_0xf054('0x8f');if(fs[_0xf054('0x51')](_0x1264e6)){return _0x1264e6;}return writeFile(_0x2d7a96,_0x1264e6)['then'](function(){return _0x1264e6;});}else{throw new db['Sequelize'][(_0xf054('0x60'))](_0xf054('0x90'));}})[_0xf054('0x24')](function(_0x5b9d2d){return _0x3d2014[_0xf054('0x4c')](_0x5b9d2d);})['catch'](handleError(_0x3d2014));}; \ No newline at end of file +var _0xfd78=['token','$and','push','%s.cypher','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','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','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','update','then','destroy','sendStatus','error','name','send','index','map','VoiceRecording','rawAttributes','type','model','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','describe','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','download','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfd78,0xd6));var _0x8fd7=function(_0x2ee008,_0x2eb506){_0x2ee008=_0x2ee008-0x0;var _0x11d6b9=_0xfd78[_0x2ee008];return _0x11d6b9;};'use strict';var emlformat=require(_0x8fd7('0x0'));var rimraf=require(_0x8fd7('0x1'));var zipdir=require(_0x8fd7('0x2'));var jsonpatch=require(_0x8fd7('0x3'));var rp=require(_0x8fd7('0x4'));var moment=require(_0x8fd7('0x5'));var BPromise=require(_0x8fd7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8fd7('0x7'));var sox=require(_0x8fd7('0x8'));var csv=require(_0x8fd7('0x9'));var ejs=require(_0x8fd7('0xa'));var fs=require('fs');var fs_extra=require(_0x8fd7('0xb'));var _=require(_0x8fd7('0xc'));var squel=require(_0x8fd7('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8fd7('0xe'));var Papa=require(_0x8fd7('0xf'));var AWS=require(_0x8fd7('0x10'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x8fd7('0x11'));var qs=require(_0x8fd7('0x12'));var as=require(_0x8fd7('0x13'));var hardwareService=require(_0x8fd7('0x14'));var logger=require('../../config/logger')(_0x8fd7('0x15'));var utils=require(_0x8fd7('0x16'));var config=require(_0x8fd7('0x17'));var licenseUtil=require(_0x8fd7('0x18'));var db=require(_0x8fd7('0x19'))['db'];function respondWithStatusCode(_0x4c755f,_0x155ef5){_0x155ef5=_0x155ef5||0xcc;return function(_0x5403c7){if(_0x5403c7){return _0x4c755f['sendStatus'](_0x155ef5);}return _0x4c755f[_0x8fd7('0x1a')](_0x155ef5)[_0x8fd7('0x1b')]();};}function respondWithResult(_0x1a7914,_0x286632){_0x286632=_0x286632||0xc8;return function(_0x5372f5){if(_0x5372f5){return _0x1a7914[_0x8fd7('0x1a')](_0x286632)[_0x8fd7('0x1c')](_0x5372f5);}};}function respondWithFilteredResult(_0x101036,_0x13fdda){return function(_0x1db638){if(_0x1db638){var _0x4feff0=typeof _0x13fdda['offset']===_0x8fd7('0x1d')&&typeof _0x13fdda[_0x8fd7('0x1e')]==='undefined';var _0x4a76de=_0x1db638[_0x8fd7('0x1f')];var _0x31a047=_0x4feff0?0x0:_0x13fdda[_0x8fd7('0x20')];var _0xceb78a=_0x4feff0?_0x1db638[_0x8fd7('0x1f')]:_0x13fdda[_0x8fd7('0x20')]+_0x13fdda[_0x8fd7('0x1e')];var _0x23b623;if(_0xceb78a>=_0x4a76de){_0xceb78a=_0x4a76de;_0x23b623=0xc8;}else{_0x23b623=0xce;}_0x101036[_0x8fd7('0x1a')](_0x23b623);return _0x101036['set']('Content-Range',_0x31a047+'-'+_0xceb78a+'/'+_0x4a76de)[_0x8fd7('0x1c')](_0x1db638);}return null;};}function patchUpdates(_0x519498){return function(_0x9b244b){try{jsonpatch[_0x8fd7('0x21')](_0x9b244b,_0x519498,!![]);}catch(_0x50045b){return BPromise['reject'](_0x50045b);}return _0x9b244b['save']();};}function saveUpdates(_0x413d5d,_0x261ea1){return function(_0xb94c5a){if(_0xb94c5a){return _0xb94c5a[_0x8fd7('0x22')](_0x413d5d)[_0x8fd7('0x23')](function(_0x438f3e){return _0x438f3e;});}return null;};}function removeEntity(_0x4a6701,_0x1fee90){return function(_0x58b0bc){if(_0x58b0bc){return _0x58b0bc[_0x8fd7('0x24')]()['then'](function(){_0x4a6701[_0x8fd7('0x1a')](0xcc)[_0x8fd7('0x1b')]();});}};}function handleEntityNotFound(_0x2eb123,_0x40fab0){return function(_0x18e3e9){if(!_0x18e3e9){_0x2eb123[_0x8fd7('0x25')](0x194);}return _0x18e3e9;};}function handleError(_0x5a8830,_0xd2b5ad){_0xd2b5ad=_0xd2b5ad||0x1f4;return function(_0x4813fe){logger[_0x8fd7('0x26')](_0x4813fe['stack']);if(_0x4813fe[_0x8fd7('0x27')]){delete _0x4813fe['name'];}_0x5a8830[_0x8fd7('0x1a')](_0xd2b5ad)[_0x8fd7('0x28')](_0x4813fe);};}exports[_0x8fd7('0x29')]=function(_0xb4441f,_0x5bbf94){var _0x1bcc10={},_0x518e12={},_0xc99617={'count':0x0,'rows':[]};var _0x3078b8=_[_0x8fd7('0x2a')](db[_0x8fd7('0x2b')][_0x8fd7('0x2c')],function(_0x459121){return{'name':_0x459121['fieldName'],'type':_0x459121[_0x8fd7('0x2d')]['key']};});_0x518e12[_0x8fd7('0x2e')]=_['differenceBy'](_[_0x8fd7('0x2a')](_0x3078b8,_0x8fd7('0x27')),[_0x8fd7('0x2f')]);_0x518e12[_0x8fd7('0x30')]=_[_0x8fd7('0x31')](_0xb4441f[_0x8fd7('0x30')]);_0x518e12[_0x8fd7('0x32')]=_[_0x8fd7('0x33')](_0x518e12[_0x8fd7('0x2e')],_0x518e12[_0x8fd7('0x30')]);_0x1bcc10[_0x8fd7('0x34')]=_[_0x8fd7('0x33')](_0x518e12[_0x8fd7('0x2e')],qs[_0x8fd7('0x35')](_0xb4441f[_0x8fd7('0x30')]['fields']));_0x1bcc10[_0x8fd7('0x34')]=_0x1bcc10[_0x8fd7('0x34')][_0x8fd7('0x36')]?_0x1bcc10['attributes']:_0x518e12[_0x8fd7('0x2e')];if(!_0xb4441f[_0x8fd7('0x30')]['hasOwnProperty'](_0x8fd7('0x37'))){_0x1bcc10[_0x8fd7('0x1e')]=qs[_0x8fd7('0x1e')](_0xb4441f[_0x8fd7('0x30')][_0x8fd7('0x1e')]);_0x1bcc10[_0x8fd7('0x20')]=qs['offset'](_0xb4441f[_0x8fd7('0x30')][_0x8fd7('0x20')]);}_0x1bcc10[_0x8fd7('0x38')]=qs['sort'](_0xb4441f['query'][_0x8fd7('0x39')]);_0x1bcc10[_0x8fd7('0x3a')]=qs['filters'](_[_0x8fd7('0x3b')](_0xb4441f['query'],_0x518e12[_0x8fd7('0x32')]),_0x3078b8);if(_0xb4441f[_0x8fd7('0x30')][_0x8fd7('0x3c')]){_0x1bcc10[_0x8fd7('0x3a')]=_[_0x8fd7('0x3d')](_0x1bcc10[_0x8fd7('0x3a')],{'$or':_[_0x8fd7('0x2a')](_0x3078b8,function(_0x296ae5){if(_0x296ae5[_0x8fd7('0x2d')]!==_0x8fd7('0x3e')){var _0x534488={};_0x534488[_0x296ae5[_0x8fd7('0x27')]]={'$like':'%'+_0xb4441f[_0x8fd7('0x30')][_0x8fd7('0x3c')]+'%'};return _0x534488;}})});}_0x1bcc10=_[_0x8fd7('0x3d')]({},_0x1bcc10,_0xb4441f[_0x8fd7('0x3f')]);var _0x31fa56={'where':_0x1bcc10['where']};return db[_0x8fd7('0x2b')][_0x8fd7('0x1f')](_0x31fa56)[_0x8fd7('0x23')](function(_0x5bedba){_0xc99617[_0x8fd7('0x1f')]=_0x5bedba;if(_0xb4441f[_0x8fd7('0x30')][_0x8fd7('0x40')]){_0x1bcc10[_0x8fd7('0x41')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8fd7('0x42')](_0x1bcc10);})[_0x8fd7('0x23')](function(_0x7a31db){_0xc99617[_0x8fd7('0x43')]=_0x7a31db;return _0xc99617;})[_0x8fd7('0x23')](respondWithFilteredResult(_0x5bbf94,_0x1bcc10))[_0x8fd7('0x44')](handleError(_0x5bbf94,null));};exports[_0x8fd7('0x45')]=function(_0x2ab70e,_0x5820c1){var _0x48b694={'raw':![],'where':{'id':_0x2ab70e[_0x8fd7('0x46')]['id']}},_0x3163e6={};_0x3163e6[_0x8fd7('0x2e')]=_[_0x8fd7('0x31')](db[_0x8fd7('0x2b')][_0x8fd7('0x2c')]);_0x3163e6['query']=_['keys'](_0x2ab70e[_0x8fd7('0x30')]);_0x3163e6['filters']=_[_0x8fd7('0x33')](_0x3163e6['model'],_0x3163e6[_0x8fd7('0x30')]);_0x48b694['attributes']=_[_0x8fd7('0x33')](_0x3163e6[_0x8fd7('0x2e')],qs[_0x8fd7('0x35')](_0x2ab70e[_0x8fd7('0x30')][_0x8fd7('0x35')]));_0x48b694[_0x8fd7('0x34')]=_0x48b694[_0x8fd7('0x34')][_0x8fd7('0x36')]?_0x48b694[_0x8fd7('0x34')]:_0x3163e6[_0x8fd7('0x2e')];if(_0x2ab70e['query']['includeAll']){_0x48b694[_0x8fd7('0x41')]=[{'all':!![]}];}_0x48b694=_[_0x8fd7('0x3d')]({},_0x48b694,_0x2ab70e[_0x8fd7('0x3f')]);return db[_0x8fd7('0x2b')]['find'](_0x48b694)[_0x8fd7('0x23')](handleEntityNotFound(_0x5820c1,null))['then'](respondWithResult(_0x5820c1,null))['catch'](handleError(_0x5820c1,null));};exports['create']=function(_0x46d41e,_0x2dc5d1){return db[_0x8fd7('0x2b')]['create'](_0x46d41e[_0x8fd7('0x47')],{})[_0x8fd7('0x23')](respondWithResult(_0x2dc5d1,0xc9))['catch'](handleError(_0x2dc5d1,null));};exports['update']=function(_0x72112c,_0x40ee96){if(_0x72112c[_0x8fd7('0x47')]['id']){delete _0x72112c[_0x8fd7('0x47')]['id'];}return db[_0x8fd7('0x2b')][_0x8fd7('0x48')]({'where':{'id':_0x72112c['params']['id']}})[_0x8fd7('0x23')](handleEntityNotFound(_0x40ee96,null))['then'](saveUpdates(_0x72112c[_0x8fd7('0x47')],null))[_0x8fd7('0x23')](respondWithResult(_0x40ee96,null))['catch'](handleError(_0x40ee96,null));};exports[_0x8fd7('0x49')]=function(_0x449c80,_0x2cb89e){return db[_0x8fd7('0x2b')][_0x8fd7('0x49')]()[_0x8fd7('0x23')](respondWithResult(_0x2cb89e,null))['catch'](handleError(_0x2cb89e,null));};exports['download']=function(_0x2696ac,_0x519e9f,_0x18f083){var _0x237195=require(_0x8fd7('0x4a'));var _0x428305=![];var _0x10be6b={};if(_0x2696ac[_0x8fd7('0x30')]['type']&&_0x2696ac[_0x8fd7('0x30')][_0x8fd7('0x2d')]===_0x8fd7('0x4b')){_0x10be6b[_0x8fd7('0x4b')]=_0x2696ac[_0x8fd7('0x46')]['id'];}else{_0x10be6b['id']=_0x2696ac[_0x8fd7('0x46')]['id'];}return db[_0x8fd7('0x2b')][_0x8fd7('0x48')]({'where':_0x10be6b,'attributes':['id','value'],'raw':!![]})[_0x8fd7('0x23')](handleEntityNotFound(_0x519e9f,null))[_0x8fd7('0x23')](function(_0xca5a50){if(_0xca5a50){var _0x19e20d=_0xca5a50[_0x8fd7('0x4c')];var _0x1ed581=util[_0x8fd7('0x2f')]('%s.cypher',_0x19e20d);if(fs[_0x8fd7('0x4d')](_0x1ed581)){_0x428305=!![];return _0x237195[_0x8fd7('0x4e')](_0x1ed581,_0x19e20d,config[_0x8fd7('0x4f')][_0x8fd7('0x50')])[_0x8fd7('0x23')](function(){return _0xca5a50;});}return _0xca5a50;}})['then'](function(_0x39e66b){if(_0x39e66b){var _0x192b6d=_0x39e66b[_0x8fd7('0x4c')];if(!fs[_0x8fd7('0x4d')](_0x192b6d)){throw new db[(_0x8fd7('0x51'))][(_0x8fd7('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x39e66b[_0x8fd7('0x53')]){return _0x519e9f['download'](_0x192b6d,_0x39e66b[_0x8fd7('0x53')]+path[_0x8fd7('0x54')](_0x192b6d),function(){if(_0x428305){fs[_0x8fd7('0x55')](_0x192b6d);}});}else{return _0x519e9f[_0x8fd7('0x56')](_0x192b6d,function(_0x3e3cf7){if(_0x428305){fs[_0x8fd7('0x55')](_0x192b6d);}});}}})['catch'](function(_0x362295){if(_0x362295[_0x8fd7('0x57')]===_0x8fd7('0x58')){_0x519e9f[_0x8fd7('0x1a')](0x194)[_0x8fd7('0x28')](_0x8fd7('0x59'));}else{return handleError(_0x519e9f,null);}});};exports[_0x8fd7('0x5a')]=function(_0x235b6e,_0x33d9d0,_0x45ad0c){var _0x1d13fc=require(_0x8fd7('0x4a'));var _0x245d40=![];var _0x4de2c3={'$and':[db['sequelize']['where'](db[_0x8fd7('0x5b')]['fn'](_0x8fd7('0x5c'),db[_0x8fd7('0x5b')][_0x8fd7('0x5d')](_0x8fd7('0x4b'))),_0x235b6e[_0x8fd7('0x30')][_0x8fd7('0x5e')])]};if(_0x235b6e[_0x8fd7('0x30')][_0x8fd7('0x2d')]&&_0x235b6e[_0x8fd7('0x30')][_0x8fd7('0x2d')]===_0x8fd7('0x4b')){_0x4de2c3[_0x8fd7('0x5f')][_0x8fd7('0x60')]({'uniqueid':_0x235b6e[_0x8fd7('0x46')]['id']});}else{_0x4de2c3['$and']['push']({'id':_0x235b6e['params']['id']});}return db[_0x8fd7('0x2b')][_0x8fd7('0x48')]({'where':_0x4de2c3,'attributes':['id',_0x8fd7('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x33d9d0,null))[_0x8fd7('0x23')](function(_0x4729dc){if(_0x4729dc){var _0xdff81a=util[_0x8fd7('0x2f')](_0x8fd7('0x61'),_0x4729dc[_0x8fd7('0x4c')]);if(fs[_0x8fd7('0x4d')](_0xdff81a)){_0x245d40=!![];return _0x1d13fc[_0x8fd7('0x4e')](_0xdff81a,_0x4729dc[_0x8fd7('0x4c')],config[_0x8fd7('0x4f')][_0x8fd7('0x50')])['then'](function(){return _0x4729dc;});}return _0x4729dc;}})[_0x8fd7('0x23')](function(_0x30303d){if(_0x30303d){if(!fs[_0x8fd7('0x4d')](_0x30303d[_0x8fd7('0x4c')])){throw new db[(_0x8fd7('0x51'))][(_0x8fd7('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x30303d['filename']){return _0x33d9d0[_0x8fd7('0x56')](_0x30303d[_0x8fd7('0x4c')],_0x30303d[_0x8fd7('0x53')]+path[_0x8fd7('0x54')](_0x30303d[_0x8fd7('0x4c')]),function(){if(_0x245d40){fs[_0x8fd7('0x55')](_0x30303d[_0x8fd7('0x4c')]);}});}else{return _0x33d9d0[_0x8fd7('0x56')](_0x30303d[_0x8fd7('0x4c')],function(_0x2053d3){if(_0x245d40){fs[_0x8fd7('0x55')](_0x30303d[_0x8fd7('0x4c')]);}});}}})[_0x8fd7('0x44')](handleError(_0x33d9d0,null));};exports[_0x8fd7('0x24')]=function(_0x14d20c,_0x41fced){return db[_0x8fd7('0x2b')][_0x8fd7('0x48')]({'where':{'id':_0x14d20c[_0x8fd7('0x46')]['id']}})['then'](function(_0x1a8213){if(_['isNil'](_0x1a8213)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1a8213;})[_0x8fd7('0x23')](function(_0x2d60d9){var _0x151c18=_0x2d60d9[_0x8fd7('0x4c')];logger[_0x8fd7('0x62')](_0x8fd7('0x63'),_0x151c18);if(!_[_0x8fd7('0x64')](_0x2d60d9['value'])&&fs['existsSync'](_0x151c18)){logger[_0x8fd7('0x62')](_0x8fd7('0x65')+_0x151c18+_0x8fd7('0x66'));fs[_0x8fd7('0x67')](_0x151c18);}_0x151c18=_0x151c18+_0x8fd7('0x68');if(!_['isNil'](_0x2d60d9[_0x8fd7('0x4c')])&&fs['existsSync'](_0x151c18)){logger['info'](_0x8fd7('0x65')+_0x151c18+_0x8fd7('0x66'));fs['unlinkSync'](_0x151c18);}return _0x2d60d9;})[_0x8fd7('0x23')](function(_0x358780){if(!_0x358780)throw new InternalError();return _0x358780['destroy']();})[_0x8fd7('0x23')](function(){_0x41fced[_0x8fd7('0x1a')](0xcc)['end']();})['catch'](handleError(_0x41fced,null));};function getBucketslist(_0x31bbac,_0x395d61,_0x5c056f){return new Promise(function(_0x3b9a2a,_0x2e42e3){var _0x89e926=new AWS['S3']({'accessKeyId':_0x395d61,'secretAccessKey':_0x31bbac,'region':_0x5c056f});_0x89e926[_0x8fd7('0x69')]({},function(_0x40e0e0,_0x893282){if(_0x40e0e0){return _0x2e42e3(_0x40e0e0);}else{return _0x3b9a2a(_0x893282);}});});}function createBucket(_0x8fbd0c,_0x492d01,_0x1f73df,_0x19963a){return new Promise(function(_0xde0b90,_0x168aae){var _0x3d6c57=new AWS['S3']({'accessKeyId':_0x492d01,'secretAccessKey':_0x8fbd0c,'region':_0x1f73df});_0x3d6c57[_0x8fd7('0x6a')]({'Bucket':_0x19963a},function(_0x280a97,_0x4d67d2){if(_0x280a97){return _0x168aae(_0x280a97);}else{return _0xde0b90(_0x4d67d2);}});});}function uploadFile(_0x5c1a44,_0x1554b0,_0x257d69,_0x25dfaa,_0x24f10d,_0x41ceab){return new Promise(function(_0x4a821d,_0x741068){var _0x4403d3=new AWS['S3']({'accessKeyId':_0x1554b0,'secretAccessKey':_0x5c1a44,'region':_0x257d69});_0x4403d3[_0x8fd7('0x6b')]({'Bucket':_0x25dfaa,'Key':_0x24f10d,'Body':_0x41ceab},function(_0x374116,_0xe533f7){if(_0x374116){return _0x741068(_0x374116);}else{return _0x4a821d(_0xe533f7);}});});}function startTranscribe(_0x7c97c6,_0x24d4de,_0x1874f8,_0x55a2ef,_0x5c0db4,_0x5843dc){return new Promise(function(_0x819119,_0x10a194){var _0x1ca330=new AWS[(_0x8fd7('0x6c'))]({'accessKeyId':_0x24d4de,'secretAccessKey':_0x7c97c6,'region':_0x1874f8});_0x1ca330[_0x8fd7('0x6d')]({'TranscriptionJobName':_0x55a2ef,'LanguageCode':_0x5c0db4,'Media':{'MediaFileUri':_0x5843dc}},function(_0x3f792b,_0x299a69){if(_0x3f792b){return _0x10a194(_0x3f792b);}else{return _0x819119(_0x299a69);}});});}function transcribe(_0x121008,_0x453a68,_0x40bad3,_0x87d967,_0x1869b1,_0x2d59c2,_0x102124){return new Promise(function(_0x4737de,_0x78dc0a){var _0x3e1066={};logger[_0x8fd7('0x62')](util['format'](_0x8fd7('0x6e'),_0x121008,_0x1869b1));return uploadFile(_0x453a68,_0x40bad3,_0x87d967,_0x1869b1,path[_0x8fd7('0x6f')](_0x2d59c2),fs[_0x8fd7('0x70')](_0x2d59c2))[_0x8fd7('0x23')](function(_0x5ecf8a){logger['info'](util['format'](_0x8fd7('0x71'),_0x121008,_0x1869b1,_0x5ecf8a[_0x8fd7('0x72')]));_0x3e1066[_0x8fd7('0x73')]=_0x5ecf8a[_0x8fd7('0x74')];_0x3e1066[_0x8fd7('0x75')]=_0x5ecf8a[_0x8fd7('0x72')];logger[_0x8fd7('0x62')](util['format'](_0x8fd7('0x76'),_0x121008));return startTranscribe(_0x453a68,_0x40bad3,_0x87d967,uuidv4(),_0x102124,_0x5ecf8a[_0x8fd7('0x72')]);})[_0x8fd7('0x23')](function(_0x23044d){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x121008,_0x23044d[_0x8fd7('0x77')]['TranscriptionJobName']));_0x3e1066['transcribeName']=_0x23044d['TranscriptionJob'][_0x8fd7('0x78')];_0x3e1066[_0x8fd7('0x79')]=_0x23044d[_0x8fd7('0x77')][_0x8fd7('0x7a')];return _0x4737de(_0x3e1066);})['catch'](function(_0x4569fa){return _0x78dc0a(_0x4569fa);});});}exports[_0x8fd7('0x7b')]=function(_0x5896da,_0x3e5d74,_0x3dbcd4){var _0x2d5ef1;var _0x2c06a0;var _0x34eaf3;var _0x30ce4f=require('../../components/encryptor');return db[_0x8fd7('0x2b')][_0x8fd7('0x7c')]({'where':{'id':_0x5896da[_0x8fd7('0x46')]['id']}})[_0x8fd7('0x23')](function(_0x1d7928){if(_0x1d7928){var _0x3db0ae=util[_0x8fd7('0x2f')](_0x8fd7('0x61'),_0x1d7928[_0x8fd7('0x4c')]);if(fs['existsSync'](_0x3db0ae)){cypher=!![];return _0x30ce4f[_0x8fd7('0x4e')](_0x3db0ae,_0x1d7928[_0x8fd7('0x4c')],config[_0x8fd7('0x4f')][_0x8fd7('0x50')])['then'](function(){return _0x1d7928;});}return _0x1d7928;}})[_0x8fd7('0x23')](function(_0x52c7f2){if(!_0x52c7f2){throw new db[(_0x8fd7('0x51'))][(_0x8fd7('0x52'))](_0x8fd7('0x7d'));}_0x2c06a0=_0x52c7f2;return db[_0x8fd7('0x7e')]['findOne']({'where':{'id':0x1}});})[_0x8fd7('0x23')](handleEntityNotFound(_0x3e5d74,null))[_0x8fd7('0x23')](function(_0x57990c){if(_0x57990c){_0x2d5ef1=_0x57990c;if(!_0x2d5ef1[_0x8fd7('0x7f')]||!_0x2d5ef1[_0x8fd7('0x80')]||!_0x2d5ef1[_0x8fd7('0x81')]||!_0x2d5ef1['language']||!_0x2d5ef1[_0x8fd7('0x73')]){throw new db['Sequelize'][(_0x8fd7('0x52'))](_0x8fd7('0x82'));}if(_0x5896da[_0x8fd7('0x47')][_0x8fd7('0x83')]&&(!_0x2d5ef1[_0x8fd7('0x84')]||!_0x2d5ef1[_0x8fd7('0x85')]||!_0x2d5ef1[_0x8fd7('0x86')]||!_0x2d5ef1[_0x8fd7('0x87')]||!_0x2d5ef1[_0x8fd7('0x73')])){throw new db['Sequelize'][(_0x8fd7('0x52'))](_0x8fd7('0x88'));}return db[_0x8fd7('0x89')][_0x8fd7('0x7c')]({'where':{'id':_0x2d5ef1[_0x8fd7('0x80')]}});}})['then'](function(_0x1c2704){if(!_0x1c2704){throw new db[(_0x8fd7('0x51'))][(_0x8fd7('0x52'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1c2704['data1']||!_0x1c2704[_0x8fd7('0x8a')]){throw new db[(_0x8fd7('0x51'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x34eaf3=_0x1c2704;return getBucketslist(_0x34eaf3[_0x8fd7('0x8b')],_0x34eaf3['data2'],_0x2d5ef1[_0x8fd7('0x81')]);})[_0x8fd7('0x23')](function(_0x20a74e){if(_0x20a74e&&_0x20a74e[_0x8fd7('0x8c')]){var _0x6c914b=_[_0x8fd7('0x48')](_0x20a74e['Buckets'],function(_0x455a2b){return _0x455a2b['Name']===_0x2d5ef1[_0x8fd7('0x73')];});if(!_0x6c914b){logger['info'](util['format'](_0x8fd7('0x8d'),_0x5896da[_0x8fd7('0x46')]['id'],_0x2d5ef1[_0x8fd7('0x73')]));return createBucket(_0x34eaf3[_0x8fd7('0x8b')],_0x34eaf3[_0x8fd7('0x8a')],_0x2d5ef1[_0x8fd7('0x81')],_0x2d5ef1['bucket']);}logger[_0x8fd7('0x62')](util[_0x8fd7('0x2f')](_0x8fd7('0x8e'),_0x5896da[_0x8fd7('0x46')]['id'],_0x2d5ef1[_0x8fd7('0x73')]));return;}})[_0x8fd7('0x23')](function(_0x11465c){if(_0x2c06a0[_0x8fd7('0x79')]===_0x8fd7('0x8f')){return transcribe(_0x5896da['params']['id'],_0x34eaf3['data1'],_0x34eaf3[_0x8fd7('0x8a')],_0x2d5ef1[_0x8fd7('0x81')],_0x2d5ef1[_0x8fd7('0x73')],_0x2c06a0[_0x8fd7('0x4c')],_0x2d5ef1['language']);}else{logger[_0x8fd7('0x62')](util[_0x8fd7('0x2f')](_0x8fd7('0x90'),_0x5896da[_0x8fd7('0x46')]['id']));return{'transcribeStatus':_0x8fd7('0x91')};}})[_0x8fd7('0x23')](function(_0x1b8655){if(_0x1b8655){_0x1b8655[_0x8fd7('0x92')]=_0x5896da[_0x8fd7('0x47')][_0x8fd7('0x83')];return _0x2c06a0[_0x8fd7('0x93')](_0x1b8655);}})[_0x8fd7('0x23')](respondWithResult(_0x3e5d74,null))[_0x8fd7('0x44')](handleError(_0x3e5d74,null));};function writeFile(_0x5d6aeb,_0x36bc78){return new Promise(function(_0x3fc5e8,_0x36ad22){fs[_0x8fd7('0x94')](_0x36bc78,_0x5d6aeb,function(_0x5ed0ba,_0x44870d){if(_0x5ed0ba){return _0x36ad22(_0x5ed0ba);}else{return _0x3fc5e8(_0x44870d);}});});}exports[_0x8fd7('0x95')]=function(_0x47df84,_0x31c390,_0x2762c6){return db['VoiceRecording'][_0x8fd7('0x7c')]({'where':{'id':_0x47df84[_0x8fd7('0x46')]['id']}})[_0x8fd7('0x23')](handleEntityNotFound(_0x31c390))[_0x8fd7('0x23')](function(_0x37b58b){if(_0x37b58b&&_0x37b58b['fileText']){var _0x2c9b05=_0x37b58b[_0x8fd7('0x96')];var _0x405f2f=config[_0x8fd7('0x97')]+_0x8fd7('0x98')+_0x37b58b['id']+_0x8fd7('0x99');if(fs[_0x8fd7('0x4d')](_0x405f2f)){return _0x405f2f;}return writeFile(_0x2c9b05,_0x405f2f)['then'](function(){return _0x405f2f;});}else{throw new db['Sequelize'][(_0x8fd7('0x52'))]('Transcript\x20not\x20available');}})[_0x8fd7('0x23')](function(_0x1618b1){return _0x31c390['download'](_0x1618b1);})['catch'](handleError(_0x31c390));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 9c7a553..2308531 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 _0x9de3=['define','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0xb47186,_0x34f69e){var _0x561e94=function(_0x3332cb){while(--_0x3332cb){_0xb47186['push'](_0xb47186['shift']());}};_0x561e94(++_0x34f69e);}(_0x9de3,0xea));var _0x39de=function(_0x2d0a75,_0xa69252){_0x2d0a75=_0x2d0a75-0x0;var _0x35b065=_0x9de3[_0x2d0a75];return _0x35b065;};'use strict';var attributes=require(_0x39de('0x0'));module['exports']=function(_0x15cb04,_0x43fb06){return _0x15cb04[_0x39de('0x1')]('VoiceRecording',attributes,{'tableName':_0x39de('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x39de('0x3')]},{'name':_0x39de('0x4'),'fields':[_0x39de('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe02=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings'];(function(_0x5424be,_0x5709a2){var _0x41cf6e=function(_0x4c177c){while(--_0x4c177c){_0x5424be['push'](_0x5424be['shift']());}};_0x41cf6e(++_0x5709a2);}(_0xbe02,0x146));var _0x2be0=function(_0x4d6978,_0x17420d){_0x4d6978=_0x4d6978-0x0;var _0x373d38=_0xbe02[_0x4d6978];return _0x373d38;};'use strict';var attributes=require(_0x2be0('0x0'));module[_0x2be0('0x1')]=function(_0x20d2b7,_0x9d341f){return _0x20d2b7['define'](_0x2be0('0x2'),attributes,{'tableName':_0x2be0('0x3'),'paranoid':![],'indexes':[{'name':_0x2be0('0x4'),'fields':[_0x2be0('0x4')]},{'name':_0x2be0('0x5'),'fields':[_0x2be0('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index e90fd62..d9ea6c2 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 _0x5f2f=['UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x520b61,_0x4fdba9){var _0x328ae4=function(_0x18c4d7){while(--_0x18c4d7){_0x520b61['push'](_0x520b61['shift']());}};_0x328ae4(++_0x4fdba9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x581522,_0x28b40d){_0x581522=_0x581522-0x0;var _0x160ae5=_0x5f2f[_0x581522];return _0x160ae5;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x21')]=function(_0x13a3be){var _0x281ec8=this;return new Promise(function(_0x294414,_0x4ab014){var _0xaa2602=require(_0xf5f2('0x22'));var _0x375ca8;return db[_0xf5f2('0x23')][_0xf5f2('0x24')]({'attributes':['id',_0xf5f2('0x25')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x53cb96){_0x375ca8=_0x53cb96;return db[_0xf5f2('0x18')][_0xf5f2('0x26')](_0x13a3be[_0xf5f2('0x1a')]);})['then'](function(_0x5a2c7e){if(_0x375ca8[_0xf5f2('0x25')]&&fs[_0xf5f2('0x27')](_0x5a2c7e[_0xf5f2('0x28')])){var _0x153924=util[_0xf5f2('0x29')]('%s.cypher',_0x5a2c7e['value']);return _0xaa2602[_0xf5f2('0x2a')](_0x5a2c7e['value'],_0x153924,config[_0xf5f2('0x2b')]['recording'])[_0xf5f2('0x20')](function(){fs[_0xf5f2('0x2c')](_0x5a2c7e[_0xf5f2('0x28')]);logger[_0xf5f2('0xd')](_0xf5f2('0x2d'));return _0x5a2c7e;});}return _0x5a2c7e;})[_0xf5f2('0x20')](function(_0x2ac089){logger[_0xf5f2('0xd')]('CreateVoiceRecording',_0x13a3be);logger[_0xf5f2('0xf')](_0xf5f2('0x21'),_0x13a3be,JSON[_0xf5f2('0x10')](_0x2ac089));_0x294414(_0x2ac089);})[_0xf5f2('0x16')](function(_0x1408b9){logger[_0xf5f2('0x11')](_0xf5f2('0x21'),_0x1408b9['message'],_0x13a3be);_0x4ab014(_0x281ec8[_0xf5f2('0x11')](0x1f4,_0x1408b9[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _0x2a07=['body','options','raw','where','attributes','limit','UpdateVoiceRecording','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','VoiceRecording','update'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x2a07,0x74));var _0x72a0=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0x2a07[_0x4828b1];return _0x1fec1b;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}exports['UpdateVoiceRecording']=function(_0x100d8f){var _0x42e9ec=this;return new Promise(function(_0x131b73,_0x5b63c8){return db[_0x72a0('0x17')][_0x72a0('0x18')](_0x100d8f[_0x72a0('0x19')],{'raw':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f['options'][_0x72a0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x100d8f['options']?_0x100d8f[_0x72a0('0x1a')][_0x72a0('0x1c')]||null:null,'attributes':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f['options'][_0x72a0('0x1d')]||null:null,'limit':_0x100d8f[_0x72a0('0x1a')]?_0x100d8f[_0x72a0('0x1a')][_0x72a0('0x1e')]||null:null})['then'](function(_0x38a7ba){logger[_0x72a0('0x15')](_0x72a0('0x1f'),_0x100d8f);logger[_0x72a0('0x20')](_0x72a0('0x1f'),_0x100d8f,JSON[_0x72a0('0x12')](_0x38a7ba));_0x131b73(_0x38a7ba);})['catch'](function(_0x4dd1a6){logger[_0x72a0('0x13')](_0x72a0('0x1f'),_0x4dd1a6[_0x72a0('0x14')],_0x100d8f);_0x5b63c8(_0x42e9ec[_0x72a0('0x13')](0x1f4,_0x4dd1a6[_0x72a0('0x14')]));});});};exports[_0x72a0('0x21')]=function(_0xa5bda0){var _0x15922a=this;return new Promise(function(_0xee99e2,_0x12dcc9){var _0x4f9718=require(_0x72a0('0x22'));var _0x553641;return db[_0x72a0('0x23')][_0x72a0('0x24')]({'attributes':['id',_0x72a0('0x25')],'where':{'id':0x1},'raw':!![]})[_0x72a0('0xe')](function(_0x432179){_0x553641=_0x432179;return db[_0x72a0('0x17')][_0x72a0('0x26')](_0xa5bda0[_0x72a0('0x19')]);})['then'](function(_0x41efc1){if(_0x553641[_0x72a0('0x25')]&&fs[_0x72a0('0x27')](_0x41efc1[_0x72a0('0x28')])){var _0x13c04=util[_0x72a0('0x29')](_0x72a0('0x2a'),_0x41efc1['value']);return _0x4f9718[_0x72a0('0x2b')](_0x41efc1[_0x72a0('0x28')],_0x13c04,config[_0x72a0('0x2c')][_0x72a0('0x2d')])[_0x72a0('0xe')](function(){fs[_0x72a0('0x2e')](_0x41efc1[_0x72a0('0x28')]);logger[_0x72a0('0x15')]('CreateVoiceRecording\x20file\x20encrypted');return _0x41efc1;});}return _0x41efc1;})[_0x72a0('0xe')](function(_0x1fb485){logger[_0x72a0('0x15')]('CreateVoiceRecording',_0xa5bda0);logger[_0x72a0('0x20')]('CreateVoiceRecording',_0xa5bda0,JSON[_0x72a0('0x12')](_0x1fb485));_0xee99e2(_0x1fb485);})[_0x72a0('0x16')](function(_0x1d02c4){logger[_0x72a0('0x13')](_0x72a0('0x21'),_0x1d02c4[_0x72a0('0x14')],_0xa5bda0);_0x12dcc9(_0x15922a[_0x72a0('0x13')](0x1f4,_0x1d02c4[_0x72a0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 4e53148..73ae456 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 _0x0c77=['/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','create','put'];(function(_0x4aa7ef,_0x43f4d1){var _0x468214=function(_0x52bb81){while(--_0x52bb81){_0x4aa7ef['push'](_0x4aa7ef['shift']());}};_0x468214(++_0x43f4d1);}(_0x0c77,0xec));var _0x70c7=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x0c77[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x70c7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x70c7('0x1'));var express=require(_0x70c7('0x2'));var router=express[_0x70c7('0x3')]();var fs_extra=require(_0x70c7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x70c7('0x5'));var config=require(_0x70c7('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x70c7('0x7')](),controller[_0x70c7('0x8')]);router[_0x70c7('0x9')](_0x70c7('0xa'),auth['isAuthenticated'](),controller[_0x70c7('0xb')]);router[_0x70c7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x70c7('0xc')]);router[_0x70c7('0xd')]('/',auth[_0x70c7('0x7')](),controller[_0x70c7('0xe')]);router[_0x70c7('0xf')](_0x70c7('0x10'),auth[_0x70c7('0x7')](),controller[_0x70c7('0x11')]);router[_0x70c7('0x12')](_0x70c7('0x10'),auth[_0x70c7('0x7')](),controller[_0x70c7('0x13')]);module[_0x70c7('0x14')]=router; \ No newline at end of file +var _0xb7ed=['./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e685f,_0x3676e9){var _0x39918c=function(_0x538bb0){while(--_0x538bb0){_0x1e685f['push'](_0x1e685f['shift']());}};_0x39918c(++_0x3676e9);}(_0xb7ed,0x7b));var _0xdb7e=function(_0x12605e,_0x3d8305){_0x12605e=_0x12605e-0x0;var _0x35fb69=_0xb7ed[_0x12605e];return _0x35fb69;};'use strict';var multer=require(_0xdb7e('0x0'));var util=require(_0xdb7e('0x1'));var path=require('path');var timeout=require(_0xdb7e('0x2'));var express=require(_0xdb7e('0x3'));var router=express[_0xdb7e('0x4')]();var fs_extra=require(_0xdb7e('0x5'));var auth=require(_0xdb7e('0x6'));var interaction=require(_0xdb7e('0x7'));var config=require(_0xdb7e('0x8'));var controller=require(_0xdb7e('0x9'));router[_0xdb7e('0xa')]('/',auth[_0xdb7e('0xb')](),controller[_0xdb7e('0xc')]);router['get'](_0xdb7e('0xd'),auth[_0xdb7e('0xb')](),controller[_0xdb7e('0xe')]);router[_0xdb7e('0xa')](_0xdb7e('0xf'),auth[_0xdb7e('0xb')](),controller[_0xdb7e('0x10')]);router[_0xdb7e('0x11')]('/',auth['isAuthenticated'](),controller[_0xdb7e('0x12')]);router[_0xdb7e('0x13')](_0xdb7e('0xf'),auth[_0xdb7e('0xb')](),controller[_0xdb7e('0x14')]);router['delete'](_0xdb7e('0xf'),auth[_0xdb7e('0xb')](),controller['destroy']);module[_0xdb7e('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 6d5a580..1fca8cd 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 _0xe240=['ENUM','Yes','sequelize','moment','exports','blind','attended','STRING'];(function(_0x50459c,_0x694c63){var _0x378186=function(_0x50ca73){while(--_0x50ca73){_0x50459c['push'](_0x50459c['shift']());}};_0x378186(++_0x694c63);}(_0xe240,0x112));var _0x0e24=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xe240[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0x0e24('0x0'));var moment=require(_0x0e24('0x1'));module[_0x0e24('0x2')]={'type':{'type':Sequelize['ENUM'](_0x0e24('0x3'),_0x0e24('0x4'))},'result':{'type':Sequelize[_0x0e24('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x0e24('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x0e24('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x0e24('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x0e24('0x5')]},'transfererexten':{'type':Sequelize[_0x0e24('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x0e24('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x0e24('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0e24('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x0e24('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x0e24('0x5')]},'transfereecontext':{'type':Sequelize[_0x0e24('0x5')]},'transfereeexten':{'type':Sequelize[_0x0e24('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x0e24('0x5')]},'isexternal':{'type':Sequelize[_0x0e24('0x6')](_0x0e24('0x7'),'No')},'context':{'type':Sequelize[_0x0e24('0x5')]},'extension':{'type':Sequelize[_0x0e24('0x5')]}}; \ No newline at end of file +var _0xe9b5=['ENUM','blind','STRING','Yes','sequelize','moment','exports'];(function(_0x5b684d,_0x4149a3){var _0x17bd4a=function(_0x558234){while(--_0x558234){_0x5b684d['push'](_0x5b684d['shift']());}};_0x17bd4a(++_0x4149a3);}(_0xe9b5,0xc1));var _0x5e9b=function(_0x3ff05f,_0x3ee2f5){_0x3ff05f=_0x3ff05f-0x0;var _0x5e479c=_0xe9b5[_0x3ff05f];return _0x5e479c;};'use strict';var Sequelize=require(_0x5e9b('0x0'));var moment=require(_0x5e9b('0x1'));module[_0x5e9b('0x2')]={'type':{'type':Sequelize[_0x5e9b('0x3')](_0x5e9b('0x4'),'attended')},'result':{'type':Sequelize[_0x5e9b('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x5e9b('0x5')]},'transferercalleridname':{'type':Sequelize[_0x5e9b('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5e9b('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x5e9b('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x5e9b('0x5')]},'transferercontext':{'type':Sequelize[_0x5e9b('0x5')]},'transfererexten':{'type':Sequelize[_0x5e9b('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x5e9b('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x5e9b('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x5e9b('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x5e9b('0x5')]},'transfereeexten':{'type':Sequelize[_0x5e9b('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x5e9b('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x5e9b('0x6'),'No')},'context':{'type':Sequelize[_0x5e9b('0x5')]},'extension':{'type':Sequelize[_0x5e9b('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index edaee9b..3b306ab 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 _0x66c9=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x3a5b7e,_0x519dbe){var _0x4f3cac=function(_0x58c694){while(--_0x58c694){_0x3a5b7e['push'](_0x3a5b7e['shift']());}};_0x4f3cac(++_0x519dbe);}(_0x66c9,0x100));var _0x966c=function(_0x9cb365,_0x1403ae){_0x9cb365=_0x9cb365-0x0;var _0x464ce9=_0x66c9[_0x9cb365];return _0x464ce9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x966c('0x0'));var zipdir=require(_0x966c('0x1'));var jsonpatch=require(_0x966c('0x2'));var rp=require('request-promise');var moment=require(_0x966c('0x3'));var BPromise=require(_0x966c('0x4'));var Mustache=require(_0x966c('0x5'));var util=require(_0x966c('0x6'));var path=require(_0x966c('0x7'));var sox=require(_0x966c('0x8'));var csv=require(_0x966c('0x9'));var ejs=require(_0x966c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x966c('0xb'));var squel=require(_0x966c('0xc'));var crypto=require(_0x966c('0xd'));var jsforce=require(_0x966c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x966c('0xf'));var Papa=require('papaparse');var Redis=require(_0x966c('0x10'));var authService=require(_0x966c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x966c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x966c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x966c('0x14'));var licenseUtil=require(_0x966c('0x15'));var db=require(_0x966c('0x16'))['db'];function respondWithStatusCode(_0x59efa3,_0x51f2de){_0x51f2de=_0x51f2de||0xcc;return function(_0x31a028){if(_0x31a028){return _0x59efa3[_0x966c('0x17')](_0x51f2de);}return _0x59efa3[_0x966c('0x18')](_0x51f2de)[_0x966c('0x19')]();};}function respondWithResult(_0x7ecdd4,_0x378357){_0x378357=_0x378357||0xc8;return function(_0x580a4c){if(_0x580a4c){return _0x7ecdd4[_0x966c('0x18')](_0x378357)[_0x966c('0x1a')](_0x580a4c);}};}function respondWithFilteredResult(_0x1cfe8c,_0x359572){return function(_0x4231c3){if(_0x4231c3){var _0x4f3107=typeof _0x359572[_0x966c('0x1b')]==='undefined'&&typeof _0x359572['limit']===_0x966c('0x1c');var _0xaca45b=_0x4231c3[_0x966c('0x1d')];var _0x3cc2ca=_0x4f3107?0x0:_0x359572[_0x966c('0x1b')];var _0x5a49a0=_0x4f3107?_0x4231c3[_0x966c('0x1d')]:_0x359572[_0x966c('0x1b')]+_0x359572[_0x966c('0x1e')];var _0x51918f;if(_0x5a49a0>=_0xaca45b){_0x5a49a0=_0xaca45b;_0x51918f=0xc8;}else{_0x51918f=0xce;}_0x1cfe8c[_0x966c('0x18')](_0x51918f);return _0x1cfe8c[_0x966c('0x1f')](_0x966c('0x20'),_0x3cc2ca+'-'+_0x5a49a0+'/'+_0xaca45b)['json'](_0x4231c3);}return null;};}function patchUpdates(_0x2d5871){return function(_0x3a5250){try{jsonpatch[_0x966c('0x21')](_0x3a5250,_0x2d5871,!![]);}catch(_0x7cdadb){return BPromise[_0x966c('0x22')](_0x7cdadb);}return _0x3a5250[_0x966c('0x23')]();};}function saveUpdates(_0x29bba2,_0x5e8fbd){return function(_0x505831){if(_0x505831){return _0x505831[_0x966c('0x24')](_0x29bba2)[_0x966c('0x25')](function(_0x4587ab){return _0x4587ab;});}return null;};}function removeEntity(_0x3a3ad5,_0x478818){return function(_0x223e5d){if(_0x223e5d){return _0x223e5d[_0x966c('0x26')]()[_0x966c('0x25')](function(){_0x3a3ad5[_0x966c('0x18')](0xcc)[_0x966c('0x19')]();});}};}function handleEntityNotFound(_0x4f68b1,_0x24e0ec){return function(_0x5baf73){if(!_0x5baf73){_0x4f68b1[_0x966c('0x17')](0x194);}return _0x5baf73;};}function handleError(_0x9c97e1,_0x33b605){_0x33b605=_0x33b605||0x1f4;return function(_0xc6f35c){logger[_0x966c('0x27')](_0xc6f35c['stack']);if(_0xc6f35c['name']){delete _0xc6f35c[_0x966c('0x28')];}_0x9c97e1['status'](_0x33b605)[_0x966c('0x29')](_0xc6f35c);};}exports[_0x966c('0x2a')]=function(_0x3f694c,_0x2329c9){var _0x204d4e={},_0x1236e4={},_0x30096f={'count':0x0,'rows':[]};var _0x3e6577=_[_0x966c('0x2b')](db['VoiceTransferReport'][_0x966c('0x2c')],function(_0x2532c6){return{'name':_0x2532c6[_0x966c('0x2d')],'type':_0x2532c6[_0x966c('0x2e')][_0x966c('0x2f')]};});_0x1236e4[_0x966c('0x30')]=_[_0x966c('0x2b')](_0x3e6577,_0x966c('0x28'));_0x1236e4[_0x966c('0x31')]=_[_0x966c('0x32')](_0x3f694c[_0x966c('0x31')]);_0x1236e4['filters']=_[_0x966c('0x33')](_0x1236e4[_0x966c('0x30')],_0x1236e4[_0x966c('0x31')]);_0x204d4e[_0x966c('0x34')]=_['intersection'](_0x1236e4[_0x966c('0x30')],qs[_0x966c('0x35')](_0x3f694c[_0x966c('0x31')][_0x966c('0x35')]));_0x204d4e['attributes']=_0x204d4e['attributes']['length']?_0x204d4e[_0x966c('0x34')]:_0x1236e4['model'];if(!_0x3f694c[_0x966c('0x31')][_0x966c('0x36')](_0x966c('0x37'))){_0x204d4e[_0x966c('0x1e')]=qs[_0x966c('0x1e')](_0x3f694c['query'][_0x966c('0x1e')]);_0x204d4e[_0x966c('0x1b')]=qs[_0x966c('0x1b')](_0x3f694c[_0x966c('0x31')][_0x966c('0x1b')]);}_0x204d4e[_0x966c('0x38')]=qs[_0x966c('0x39')](_0x3f694c[_0x966c('0x31')][_0x966c('0x39')]);_0x204d4e[_0x966c('0x3a')]=qs[_0x966c('0x3b')](_[_0x966c('0x3c')](_0x3f694c[_0x966c('0x31')],_0x1236e4[_0x966c('0x3b')]),_0x3e6577);if(_0x3f694c['query'][_0x966c('0x3d')]){_0x204d4e['where']=_[_0x966c('0x3e')](_0x204d4e[_0x966c('0x3a')],{'$or':_[_0x966c('0x2b')](_0x3e6577,function(_0x92c702){if(_0x92c702[_0x966c('0x2e')]!==_0x966c('0x3f')){var _0x58795b={};_0x58795b[_0x92c702[_0x966c('0x28')]]={'$like':'%'+_0x3f694c[_0x966c('0x31')]['filter']+'%'};return _0x58795b;}})});}_0x204d4e=_[_0x966c('0x3e')]({},_0x204d4e,_0x3f694c[_0x966c('0x40')]);var _0x1d7433={'where':_0x204d4e['where']};return db[_0x966c('0x41')]['count'](_0x1d7433)[_0x966c('0x25')](function(_0x53de43){_0x30096f[_0x966c('0x1d')]=_0x53de43;if(_0x3f694c[_0x966c('0x31')][_0x966c('0x42')]){_0x204d4e[_0x966c('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x966c('0x44')](_0x204d4e);})['then'](function(_0x4b6521){_0x30096f[_0x966c('0x45')]=_0x4b6521;return _0x30096f;})[_0x966c('0x25')](respondWithFilteredResult(_0x2329c9,_0x204d4e))['catch'](handleError(_0x2329c9,null));};exports[_0x966c('0x46')]=function(_0xa4ff5e,_0x171d85){var _0x4a9118={'raw':!![],'where':{'id':_0xa4ff5e[_0x966c('0x47')]['id']}},_0x5ecca4={};_0x5ecca4['model']=_[_0x966c('0x32')](db[_0x966c('0x41')][_0x966c('0x2c')]);_0x5ecca4['query']=_[_0x966c('0x32')](_0xa4ff5e['query']);_0x5ecca4[_0x966c('0x3b')]=_[_0x966c('0x33')](_0x5ecca4['model'],_0x5ecca4[_0x966c('0x31')]);_0x4a9118[_0x966c('0x34')]=_['intersection'](_0x5ecca4[_0x966c('0x30')],qs[_0x966c('0x35')](_0xa4ff5e['query'][_0x966c('0x35')]));_0x4a9118[_0x966c('0x34')]=_0x4a9118[_0x966c('0x34')]['length']?_0x4a9118['attributes']:_0x5ecca4[_0x966c('0x30')];if(_0xa4ff5e['query'][_0x966c('0x42')]){_0x4a9118[_0x966c('0x43')]=[{'all':!![]}];}_0x4a9118=_[_0x966c('0x3e')]({},_0x4a9118,_0xa4ff5e['options']);return db[_0x966c('0x41')][_0x966c('0x48')](_0x4a9118)[_0x966c('0x25')](handleEntityNotFound(_0x171d85,null))['then'](respondWithResult(_0x171d85,null))[_0x966c('0x49')](handleError(_0x171d85,null));};exports[_0x966c('0x4a')]=function(_0xe74abb,_0x5c809a){return db[_0x966c('0x41')][_0x966c('0x4a')](_0xe74abb[_0x966c('0x4b')],{})['then'](respondWithResult(_0x5c809a,0xc9))[_0x966c('0x49')](handleError(_0x5c809a,null));};exports[_0x966c('0x24')]=function(_0x4ff58c,_0x5f23e4){if(_0x4ff58c[_0x966c('0x4b')]['id']){delete _0x4ff58c[_0x966c('0x4b')]['id'];}return db['VoiceTransferReport'][_0x966c('0x48')]({'where':{'id':_0x4ff58c[_0x966c('0x47')]['id']}})[_0x966c('0x25')](handleEntityNotFound(_0x5f23e4,null))[_0x966c('0x25')](saveUpdates(_0x4ff58c[_0x966c('0x4b')],null))['then'](respondWithResult(_0x5f23e4,null))['catch'](handleError(_0x5f23e4,null));};exports[_0x966c('0x26')]=function(_0x32267c,_0x10f282){return db[_0x966c('0x41')][_0x966c('0x48')]({'where':{'id':_0x32267c[_0x966c('0x47')]['id']}})[_0x966c('0x25')](handleEntityNotFound(_0x10f282,null))['then'](removeEntity(_0x10f282,null))[_0x966c('0x49')](handleError(_0x10f282,null));};exports['describe']=function(_0xc0236b,_0x5495fd){return db['VoiceTransferReport']['describe']()[_0x966c('0x25')](respondWithResult(_0x5495fd,null))[_0x966c('0x49')](handleError(_0x5495fd,null));}; \ No newline at end of file +var _0xb9c3=['sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','error','name','send','index','map','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','VoiceTransferReport','findAll','rows','catch','params','keys','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0xb9c3,0xc6));var _0x3b9c=function(_0x469592,_0x35036b){_0x469592=_0x469592-0x0;var _0xd0207=_0xb9c3[_0x469592];return _0xd0207;};'use strict';var emlformat=require(_0x3b9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b9c('0x1'));var jsonpatch=require(_0x3b9c('0x2'));var rp=require('request-promise');var moment=require(_0x3b9c('0x3'));var BPromise=require(_0x3b9c('0x4'));var Mustache=require(_0x3b9c('0x5'));var util=require(_0x3b9c('0x6'));var path=require(_0x3b9c('0x7'));var sox=require(_0x3b9c('0x8'));var csv=require(_0x3b9c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b9c('0xa'));var _=require('lodash');var squel=require(_0x3b9c('0xb'));var crypto=require(_0x3b9c('0xc'));var jsforce=require(_0x3b9c('0xd'));var deskjs=require(_0x3b9c('0xe'));var toCsv=require(_0x3b9c('0x9'));var querystring=require('querystring');var Papa=require(_0x3b9c('0xf'));var Redis=require(_0x3b9c('0x10'));var authService=require(_0x3b9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3b9c('0x12'));var hardwareService=require(_0x3b9c('0x13'));var logger=require(_0x3b9c('0x14'))(_0x3b9c('0x15'));var utils=require(_0x3b9c('0x16'));var config=require(_0x3b9c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f3a8,_0x3ca570){_0x3ca570=_0x3ca570||0xcc;return function(_0x3998d8){if(_0x3998d8){return _0x38f3a8[_0x3b9c('0x18')](_0x3ca570);}return _0x38f3a8[_0x3b9c('0x19')](_0x3ca570)[_0x3b9c('0x1a')]();};}function respondWithResult(_0x10d215,_0x9d623e){_0x9d623e=_0x9d623e||0xc8;return function(_0x16d5f6){if(_0x16d5f6){return _0x10d215[_0x3b9c('0x19')](_0x9d623e)[_0x3b9c('0x1b')](_0x16d5f6);}};}function respondWithFilteredResult(_0x5b445c,_0x5c87c6){return function(_0x1cd684){if(_0x1cd684){var _0x52a196=typeof _0x5c87c6['offset']===_0x3b9c('0x1c')&&typeof _0x5c87c6[_0x3b9c('0x1d')]===_0x3b9c('0x1c');var _0x56d9dc=_0x1cd684[_0x3b9c('0x1e')];var _0x1aea64=_0x52a196?0x0:_0x5c87c6[_0x3b9c('0x1f')];var _0xd4d1fa=_0x52a196?_0x1cd684[_0x3b9c('0x1e')]:_0x5c87c6[_0x3b9c('0x1f')]+_0x5c87c6['limit'];var _0x1af136;if(_0xd4d1fa>=_0x56d9dc){_0xd4d1fa=_0x56d9dc;_0x1af136=0xc8;}else{_0x1af136=0xce;}_0x5b445c['status'](_0x1af136);return _0x5b445c[_0x3b9c('0x20')]('Content-Range',_0x1aea64+'-'+_0xd4d1fa+'/'+_0x56d9dc)['json'](_0x1cd684);}return null;};}function patchUpdates(_0x4e42b4){return function(_0x5b9eb3){try{jsonpatch['apply'](_0x5b9eb3,_0x4e42b4,!![]);}catch(_0x24f094){return BPromise[_0x3b9c('0x21')](_0x24f094);}return _0x5b9eb3[_0x3b9c('0x22')]();};}function saveUpdates(_0x35c2d3,_0x4e26d4){return function(_0x311706){if(_0x311706){return _0x311706[_0x3b9c('0x23')](_0x35c2d3)[_0x3b9c('0x24')](function(_0x198e99){return _0x198e99;});}return null;};}function removeEntity(_0x59e63c,_0x51256a){return function(_0x36aaa8){if(_0x36aaa8){return _0x36aaa8['destroy']()[_0x3b9c('0x24')](function(){_0x59e63c['status'](0xcc)[_0x3b9c('0x1a')]();});}};}function handleEntityNotFound(_0x36698f,_0x9e753c){return function(_0x500fec){if(!_0x500fec){_0x36698f['sendStatus'](0x194);}return _0x500fec;};}function handleError(_0x67c70c,_0x4a5e4f){_0x4a5e4f=_0x4a5e4f||0x1f4;return function(_0x12be84){logger[_0x3b9c('0x25')](_0x12be84['stack']);if(_0x12be84[_0x3b9c('0x26')]){delete _0x12be84[_0x3b9c('0x26')];}_0x67c70c[_0x3b9c('0x19')](_0x4a5e4f)[_0x3b9c('0x27')](_0x12be84);};}exports[_0x3b9c('0x28')]=function(_0x8e14b9,_0x1246f7){var _0x1d807a={},_0x2c51a3={},_0x5404d6={'count':0x0,'rows':[]};var _0x2ddd36=_[_0x3b9c('0x29')](db['VoiceTransferReport'][_0x3b9c('0x2a')],function(_0x2ae8ca){return{'name':_0x2ae8ca['fieldName'],'type':_0x2ae8ca[_0x3b9c('0x2b')][_0x3b9c('0x2c')]};});_0x2c51a3['model']=_[_0x3b9c('0x29')](_0x2ddd36,'name');_0x2c51a3[_0x3b9c('0x2d')]=_['keys'](_0x8e14b9[_0x3b9c('0x2d')]);_0x2c51a3['filters']=_[_0x3b9c('0x2e')](_0x2c51a3[_0x3b9c('0x2f')],_0x2c51a3['query']);_0x1d807a['attributes']=_[_0x3b9c('0x2e')](_0x2c51a3[_0x3b9c('0x2f')],qs[_0x3b9c('0x30')](_0x8e14b9[_0x3b9c('0x2d')][_0x3b9c('0x30')]));_0x1d807a['attributes']=_0x1d807a[_0x3b9c('0x31')][_0x3b9c('0x32')]?_0x1d807a['attributes']:_0x2c51a3[_0x3b9c('0x2f')];if(!_0x8e14b9[_0x3b9c('0x2d')][_0x3b9c('0x33')](_0x3b9c('0x34'))){_0x1d807a[_0x3b9c('0x1d')]=qs[_0x3b9c('0x1d')](_0x8e14b9[_0x3b9c('0x2d')][_0x3b9c('0x1d')]);_0x1d807a[_0x3b9c('0x1f')]=qs[_0x3b9c('0x1f')](_0x8e14b9[_0x3b9c('0x2d')][_0x3b9c('0x1f')]);}_0x1d807a[_0x3b9c('0x35')]=qs[_0x3b9c('0x36')](_0x8e14b9['query']['sort']);_0x1d807a[_0x3b9c('0x37')]=qs['filters'](_['pick'](_0x8e14b9[_0x3b9c('0x2d')],_0x2c51a3[_0x3b9c('0x38')]),_0x2ddd36);if(_0x8e14b9['query'][_0x3b9c('0x39')]){_0x1d807a[_0x3b9c('0x37')]=_[_0x3b9c('0x3a')](_0x1d807a[_0x3b9c('0x37')],{'$or':_[_0x3b9c('0x29')](_0x2ddd36,function(_0x1fe8d5){if(_0x1fe8d5[_0x3b9c('0x2b')]!==_0x3b9c('0x3b')){var _0x4a7993={};_0x4a7993[_0x1fe8d5[_0x3b9c('0x26')]]={'$like':'%'+_0x8e14b9[_0x3b9c('0x2d')][_0x3b9c('0x39')]+'%'};return _0x4a7993;}})});}_0x1d807a=_[_0x3b9c('0x3a')]({},_0x1d807a,_0x8e14b9[_0x3b9c('0x3c')]);var _0x41103f={'where':_0x1d807a[_0x3b9c('0x37')]};return db['VoiceTransferReport'][_0x3b9c('0x1e')](_0x41103f)[_0x3b9c('0x24')](function(_0x5885ab){_0x5404d6[_0x3b9c('0x1e')]=_0x5885ab;if(_0x8e14b9[_0x3b9c('0x2d')][_0x3b9c('0x3d')]){_0x1d807a[_0x3b9c('0x3e')]=[{'all':!![]}];}return db[_0x3b9c('0x3f')][_0x3b9c('0x40')](_0x1d807a);})[_0x3b9c('0x24')](function(_0x59434d){_0x5404d6[_0x3b9c('0x41')]=_0x59434d;return _0x5404d6;})[_0x3b9c('0x24')](respondWithFilteredResult(_0x1246f7,_0x1d807a))[_0x3b9c('0x42')](handleError(_0x1246f7,null));};exports['show']=function(_0x4f0982,_0x5af015){var _0x548064={'raw':!![],'where':{'id':_0x4f0982[_0x3b9c('0x43')]['id']}},_0x429e42={};_0x429e42['model']=_[_0x3b9c('0x44')](db['VoiceTransferReport'][_0x3b9c('0x2a')]);_0x429e42['query']=_[_0x3b9c('0x44')](_0x4f0982[_0x3b9c('0x2d')]);_0x429e42[_0x3b9c('0x38')]=_[_0x3b9c('0x2e')](_0x429e42['model'],_0x429e42['query']);_0x548064['attributes']=_['intersection'](_0x429e42[_0x3b9c('0x2f')],qs[_0x3b9c('0x30')](_0x4f0982[_0x3b9c('0x2d')]['fields']));_0x548064[_0x3b9c('0x31')]=_0x548064[_0x3b9c('0x31')][_0x3b9c('0x32')]?_0x548064[_0x3b9c('0x31')]:_0x429e42[_0x3b9c('0x2f')];if(_0x4f0982[_0x3b9c('0x2d')]['includeAll']){_0x548064[_0x3b9c('0x3e')]=[{'all':!![]}];}_0x548064=_['merge']({},_0x548064,_0x4f0982[_0x3b9c('0x3c')]);return db[_0x3b9c('0x3f')][_0x3b9c('0x45')](_0x548064)[_0x3b9c('0x24')](handleEntityNotFound(_0x5af015,null))[_0x3b9c('0x24')](respondWithResult(_0x5af015,null))[_0x3b9c('0x42')](handleError(_0x5af015,null));};exports['create']=function(_0x3d6ff6,_0x4901aa){return db[_0x3b9c('0x3f')][_0x3b9c('0x46')](_0x3d6ff6[_0x3b9c('0x47')],{})['then'](respondWithResult(_0x4901aa,0xc9))[_0x3b9c('0x42')](handleError(_0x4901aa,null));};exports[_0x3b9c('0x23')]=function(_0x589617,_0xeadd10){if(_0x589617[_0x3b9c('0x47')]['id']){delete _0x589617[_0x3b9c('0x47')]['id'];}return db[_0x3b9c('0x3f')][_0x3b9c('0x45')]({'where':{'id':_0x589617['params']['id']}})[_0x3b9c('0x24')](handleEntityNotFound(_0xeadd10,null))['then'](saveUpdates(_0x589617[_0x3b9c('0x47')],null))['then'](respondWithResult(_0xeadd10,null))[_0x3b9c('0x42')](handleError(_0xeadd10,null));};exports[_0x3b9c('0x48')]=function(_0xfba9,_0x5d56dd){return db[_0x3b9c('0x3f')][_0x3b9c('0x45')]({'where':{'id':_0xfba9[_0x3b9c('0x43')]['id']}})[_0x3b9c('0x24')](handleEntityNotFound(_0x5d56dd,null))[_0x3b9c('0x24')](removeEntity(_0x5d56dd,null))[_0x3b9c('0x42')](handleError(_0x5d56dd,null));};exports[_0x3b9c('0x49')]=function(_0x40b0ea,_0x502690){return db[_0x3b9c('0x3f')][_0x3b9c('0x49')]()[_0x3b9c('0x24')](respondWithResult(_0x502690,null))[_0x3b9c('0x42')](handleError(_0x502690,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c161ca1..3d95d88 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 _0xa73e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0xa73e,0xfa));var _0xea73=function(_0x24c36b,_0xa88d2e){_0x24c36b=_0x24c36b-0x0;var _0x4b7827=_0xa73e[_0x24c36b];return _0x4b7827;};'use strict';var _=require('lodash');var util=require(_0xea73('0x0'));var logger=require(_0xea73('0x1'))(_0xea73('0x2'));var moment=require(_0xea73('0x3'));var BPromise=require(_0xea73('0x4'));var rp=require(_0xea73('0x5'));var fs=require('fs');var path=require(_0xea73('0x6'));var rimraf=require(_0xea73('0x7'));var config=require(_0xea73('0x8'));var attributes=require(_0xea73('0x9'));module[_0xea73('0xa')]=function(_0x41047c,_0x3cb199){return _0x41047c[_0xea73('0xb')](_0xea73('0xc'),attributes,{'tableName':_0xea73('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc718=['request-promise','path','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','bluebird'];(function(_0xfd73c7,_0x45c872){var _0xee572=function(_0x207bb6){while(--_0x207bb6){_0xfd73c7['push'](_0xfd73c7['shift']());}};_0xee572(++_0x45c872);}(_0xc718,0x1ed));var _0x8c71=function(_0x582c45,_0x5e643e){_0x582c45=_0x582c45-0x0;var _0x3d50e4=_0xc718[_0x582c45];return _0x3d50e4;};'use strict';var _=require(_0x8c71('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8c71('0x1'));var rp=require(_0x8c71('0x2'));var fs=require('fs');var path=require(_0x8c71('0x3'));var rimraf=require(_0x8c71('0x4'));var config=require('../../config/environment');var attributes=require(_0x8c71('0x5'));module[_0x8c71('0x6')]=function(_0x779f5b,_0x53c040){return _0x779f5b[_0x8c71('0x7')]('VoiceTransferReport',attributes,{'tableName':_0x8c71('0x8'),'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 73e89fd..ce2716c 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 _0x0fe3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','lodash','bluebird','randomstring'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0fe3,0x129));var _0x30fe=function(_0x1449ed,_0x5293b0){_0x1449ed=_0x1449ed-0x0;var _0x5ea2aa=_0x0fe3[_0x1449ed];return _0x5ea2aa;};'use strict';var _=require(_0x30fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30fe('0x1'));var rs=require(_0x30fe('0x2'));var fs=require('fs');var Redis=require(_0x30fe('0x3'));var db=require(_0x30fe('0x4'))['db'];var utils=require(_0x30fe('0x5'));var logger=require(_0x30fe('0x6'))(_0x30fe('0x7'));var config=require(_0x30fe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x30fe('0x9')][_0x30fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2be850,_0x86a2ac,_0x16c489){return new BPromise(function(_0x2cdcef,_0x408b2c){return client[_0x30fe('0xb')](_0x2be850,_0x16c489)['then'](function(_0x479722){logger[_0x30fe('0xc')](_0x30fe('0xd'),_0x86a2ac,_0x30fe('0xe'));logger[_0x30fe('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x86a2ac,_0x30fe('0xe'),JSON[_0x30fe('0x10')](_0x479722));if(_0x479722[_0x30fe('0x11')]){if(_0x479722['error']['code']===0x1f4){logger[_0x30fe('0x11')](_0x30fe('0xd'),_0x86a2ac,_0x479722[_0x30fe('0x11')][_0x30fe('0x12')]);return _0x408b2c(_0x479722[_0x30fe('0x11')][_0x30fe('0x12')]);}logger[_0x30fe('0x11')](_0x30fe('0xd'),_0x86a2ac,_0x479722[_0x30fe('0x11')]['message']);return _0x2cdcef(_0x479722['error'][_0x30fe('0x12')]);}else{logger[_0x30fe('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x86a2ac,'request\x20sent');_0x2cdcef(_0x479722[_0x30fe('0x13')]['message']);}})[_0x30fe('0x14')](function(_0x6847b3){logger['error'](_0x30fe('0xd'),_0x86a2ac,_0x6847b3);_0x408b2c(_0x6847b3);});});}exports[_0x30fe('0x15')]=function(_0x57788d){var _0x5870bf=this;return new Promise(function(_0x467f9d,_0x5b6caf){return db[_0x30fe('0x16')]['create'](_0x57788d['body'],{'raw':_0x57788d[_0x30fe('0x17')]?_0x57788d[_0x30fe('0x17')][_0x30fe('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1aafa2){logger[_0x30fe('0xc')](_0x30fe('0x15'),_0x57788d);logger[_0x30fe('0xf')]('CreateVoiceTransferReport',_0x57788d,JSON[_0x30fe('0x10')](_0x1aafa2));_0x467f9d(_0x1aafa2);})[_0x30fe('0x14')](function(_0x70cf2d){logger['error']('CreateVoiceTransferReport',_0x70cf2d[_0x30fe('0x12')],_0x57788d);_0x5b6caf(_0x5870bf[_0x30fe('0x11')](0x1f4,_0x70cf2d[_0x30fe('0x12')]));});});}; \ No newline at end of file +var _0xca76=['then','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','body','options','raw'];(function(_0x39691f,_0x24849b){var _0xbf563b=function(_0x3b942d){while(--_0x3b942d){_0x39691f['push'](_0x39691f['shift']());}};_0xbf563b(++_0x24849b);}(_0xca76,0x1b5));var _0x6ca7=function(_0x5b7ce8,_0x596ff7){_0x5b7ce8=_0x5b7ce8-0x0;var _0x1d5354=_0xca76[_0x5b7ce8];return _0x1d5354;};'use strict';var _=require(_0x6ca7('0x0'));var util=require(_0x6ca7('0x1'));var moment=require(_0x6ca7('0x2'));var BPromise=require(_0x6ca7('0x3'));var rs=require(_0x6ca7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ca7('0x5'))['db'];var utils=require(_0x6ca7('0x6'));var logger=require(_0x6ca7('0x7'))(_0x6ca7('0x8'));var config=require(_0x6ca7('0x9'));var jayson=require(_0x6ca7('0xa'));var client=jayson[_0x6ca7('0xb')][_0x6ca7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x110c67,_0xb380e5,_0x4fc5de){return new BPromise(function(_0x664f96,_0x32dad1){return client[_0x6ca7('0xd')](_0x110c67,_0x4fc5de)['then'](function(_0x218e46){logger[_0x6ca7('0xe')](_0x6ca7('0xf'),_0xb380e5,'request\x20sent');logger[_0x6ca7('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xb380e5,_0x6ca7('0x11'),JSON[_0x6ca7('0x12')](_0x218e46));if(_0x218e46[_0x6ca7('0x13')]){if(_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x14')]===0x1f4){logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);return _0x32dad1(_0x218e46[_0x6ca7('0x13')]['message']);}logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);return _0x664f96(_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);}else{logger[_0x6ca7('0xe')](_0x6ca7('0xf'),_0xb380e5,_0x6ca7('0x11'));_0x664f96(_0x218e46[_0x6ca7('0x16')][_0x6ca7('0x15')]);}})['catch'](function(_0x3b9418){logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x3b9418);_0x32dad1(_0x3b9418);});});}exports[_0x6ca7('0x17')]=function(_0x59ff3f){var _0x2e17e8=this;return new Promise(function(_0x164701,_0x2c0c42){return db['VoiceTransferReport']['create'](_0x59ff3f[_0x6ca7('0x18')],{'raw':_0x59ff3f[_0x6ca7('0x19')]?_0x59ff3f['options'][_0x6ca7('0x1a')]===undefined?!![]:![]:!![]})[_0x6ca7('0x1b')](function(_0x58c51f){logger[_0x6ca7('0xe')](_0x6ca7('0x17'),_0x59ff3f);logger[_0x6ca7('0x10')](_0x6ca7('0x17'),_0x59ff3f,JSON[_0x6ca7('0x12')](_0x58c51f));_0x164701(_0x58c51f);})[_0x6ca7('0x1c')](function(_0x32da96){logger['error'](_0x6ca7('0x17'),_0x32da96[_0x6ca7('0x15')],_0x59ff3f);_0x2c0c42(_0x2e17e8[_0x6ca7('0x13')](0x1f4,_0x32da96[_0x6ca7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 003bc4e..0e13594 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 _0x54ef=['unhold','/calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/hold','hold','/unhold'];(function(_0x505838,_0x34b6fc){var _0x114754=function(_0x50fbdd){while(--_0x50fbdd){_0x505838['push'](_0x505838['shift']());}};_0x114754(++_0x34b6fc);}(_0x54ef,0x112));var _0xf54e=function(_0x5093eb,_0x532331){_0x5093eb=_0x5093eb-0x0;var _0x2d31d4=_0x54ef[_0x5093eb];return _0x2d31d4;};'use strict';var express=require(_0xf54e('0x0'));var router=express[_0xf54e('0x1')]();var auth=require(_0xf54e('0x2'));var controller=require('./webbar.controller');router[_0xf54e('0x3')](_0xf54e('0x4'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x7')]);router[_0xf54e('0x3')](_0xf54e('0x8'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xf54e('0x9')]);router[_0xf54e('0x3')](_0xf54e('0xa'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['answer']);router[_0xf54e('0x3')](_0xf54e('0xb'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xc')]);router[_0xf54e('0x3')](_0xf54e('0xd'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller[_0xf54e('0xe')]);router[_0xf54e('0x3')](_0xf54e('0xf'),auth['isAuthenticated'](),auth[_0xf54e('0x6')](),controller['calls']);router['post'](_0xf54e('0x10'),auth[_0xf54e('0x5')](),auth[_0xf54e('0x6')](),controller[_0xf54e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb43b,0x1b2));var _0xbb43=function(_0x20fb5d,_0x48b0e3){_0x20fb5d=_0x20fb5d-0x0;var _0xb60cf5=_0xb43b[_0x20fb5d];return _0xb60cf5;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index dcb70a5..59bb18b 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 _0xe14d=['callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','send','NotFound','request','then','message','result','catch','User','findOne','VoiceChannels','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','length','status','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','hangup','hangup\x20fired:','json','webbar:hangup','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string'];(function(_0x26c55e,_0x21b57b){var _0x1f2ae2=function(_0x3cc027){while(--_0x3cc027){_0x26c55e['push'](_0x26c55e['shift']());}};_0x1f2ae2(++_0x21b57b);}(_0xe14d,0x1ee));var _0xde14=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe14d[_0x3b380d];return _0x54502b;};'use strict';var path=require(_0xde14('0x0'));var fs=require('fs');var _=require(_0xde14('0x1'));var db=require(_0xde14('0x2'))['db'];var config=require(_0xde14('0x3'));var util=require('util');var BPromise=require(_0xde14('0x4'));var jayson=require(_0xde14('0x5'));var amiClient=jayson['client'][_0xde14('0x6')]({'port':0x232a});var logger=require(_0xde14('0x7'))(_0xde14('0x8'));var Redis=require(_0xde14('0x9'));config[_0xde14('0xa')]=_[_0xde14('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xde14('0xc'))(new Redis(config[_0xde14('0xa')]));var Schema=require(_0xde14('0xd'));var originateValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'callNumber':{'type':_0xde14('0x10'),'required':[!![],_0xde14('0x11')]},'callerId':{'type':_0xde14('0x10')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':[!![],_0xde14('0x12')]},'transferNumber':{'type':_0xde14('0x10'),'required':[!![],_0xde14('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xde14('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xde14('0xe'),'required':[!![],_0xde14('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xde14('0xf')]}});function emit(_0x31adb3,_0x257390,_0x31902a){logger[_0xde14('0x14')](_0x31adb3,_0x257390,JSON[_0xde14('0x15')](_0x31902a));io['to'](_0x31adb3)[_0xde14('0x16')](_0x257390,_0x31902a);}function handleError(_0x6f6eea){return function(_0x3cc317){console[_0xde14('0x17')]('handleError:',_0x3cc317,_0x3cc317 instanceof RangeError);logger[_0xde14('0x18')](_0x3cc317[_0xde14('0x19')]);if(_0x3cc317 instanceof RangeError){if(_0x3cc317[_0xde14('0x1a')]){delete _0x3cc317[_0xde14('0x1a')];}_0x6f6eea['status'](0x194)[_0xde14('0x1b')](_0x3cc317);}else{if(_0x3cc317['name']){delete _0x3cc317[_0xde14('0x1a')];}_0x6f6eea['status'](0x1f4)[_0xde14('0x1b')](_0x3cc317);}};}function checkError(){return function(_0x30fcf1){if(!_0x30fcf1){throw new RangeError(_0xde14('0x1c'));}return _0x30fcf1;};}function respondWithRpcPromise(_0x1949ab,_0x39bdc5){return new BPromise(function(_0x11a4d9,_0x40b648){var _0x2dd9e7=amiClient;return _0x2dd9e7[_0xde14('0x1d')](_0x1949ab,_0x39bdc5)[_0xde14('0x1e')](function(_0x475f2f){if(_0x475f2f[_0xde14('0x18')]){if(_0x475f2f[_0xde14('0x18')]['code']===0x1f4){return _0x40b648(_0x475f2f[_0xde14('0x18')][_0xde14('0x1f')]);}return _0x11a4d9(_0x475f2f[_0xde14('0x18')][_0xde14('0x1f')]);}else{_0x11a4d9(_0x475f2f[_0xde14('0x20')]);}})[_0xde14('0x21')](function(_0x310d75){_0x40b648(_0x310d75);});});}function getAgent(_0x23c735){return db[_0xde14('0x22')][_0xde14('0x23')]({'where':{'id':_0x23c735,'role':'agent'}})[_0xde14('0x1e')](checkError());}function getAgentCheckSession(_0x1696ee,_0x3eaee5){return new BPromise(function(_0xf8279a,_0x5d8b4b){var _0x3fc2a4=respondWithRpcPromise(_0xde14('0x24'));var _0x30c4a8=getAgent(_0x1696ee);Promise['all']([_0x3fc2a4,_0x30c4a8])[_0xde14('0x1e')](function(_0x582537){var _0x2760f9=_0x582537[0x0];var _0x361b2c=_0x582537[0x1];var _0x3bb1da=_[_0xde14('0x25')](_0x2760f9[_0xde14('0x26')],function(_0x237d3f){return _0x237d3f[_0xde14('0x27')]==_0x361b2c['id']&&_0x237d3f[_0xde14('0x28')]==_0x3eaee5;});if(_0x3bb1da['length']==0x1){_0xf8279a(_0x361b2c);}else{_0x5d8b4b(new RangeError(_0xde14('0x29')+_0x3eaee5+_0xde14('0x2a')));}});});}exports['originate']=function(_0xf25a9e,_0x4c9b15){logger[_0xde14('0x14')](_0xde14('0x2b'),_0xf25a9e[_0xde14('0x2c')]);var _0x21a916=originateValidation[_0xde14('0xd')](_0xf25a9e['body']);if(_0x21a916[_0xde14('0x2d')]>0x0){return _0x4c9b15[_0xde14('0x2e')](0x190)['json'](_0x21a916);}var _0x280238=_0xf25a9e[_0xde14('0x2c')][_0xde14('0x2f')];var _0x319136=_0xf25a9e[_0xde14('0x2c')][_0xde14('0x30')];var _0xd75bb2=_0xf25a9e[_0xde14('0x2c')][_0xde14('0x31')];var _0x48d587=_0xf25a9e['body'][_0xde14('0x32')];return getAgent(_0x280238)[_0xde14('0x1e')](function(_0x20913d){logger[_0xde14('0x14')](_0xde14('0x33'),_0x20913d[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x20913d[_0xde14('0x1a')]),'webbar:originate',{'callNumber':_0x319136,'callerId':_0xd75bb2,'callbackUrl':_0x48d587});return _0x4c9b15[_0xde14('0x2e')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x4c9b15));};exports[_0xde14('0x36')]=function(_0x258759,_0x398f63){logger[_0xde14('0x14')](_0xde14('0x37'),_0x258759[_0xde14('0x2c')]);var _0x1e89b6=hangupValidation[_0xde14('0xd')](_0x258759['body']);if(_0x1e89b6[_0xde14('0x2d')]>0x0){return _0x398f63[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x1e89b6);}var _0x2b3004=_0x258759[_0xde14('0x2c')][_0xde14('0x2f')];var _0x2ec2f3=_0x258759[_0xde14('0x2c')]['sessionId'];return getAgent(_0x2b3004)[_0xde14('0x1e')](function(_0xb6b2ee){logger[_0xde14('0x14')](_0xde14('0x33'),_0xb6b2ee['name']);emit(util['format'](_0xde14('0x35'),_0xb6b2ee[_0xde14('0x1a')]),_0xde14('0x39'),{'sessionId':_0x2ec2f3});return _0x398f63[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':'hangup\x20executed!'});})[_0xde14('0x21')](handleError(_0x398f63));};exports[_0xde14('0x3a')]=function(_0x1d3cc1,_0x595fd5){logger[_0xde14('0x14')]('answer\x20fired:',_0x1d3cc1[_0xde14('0x2c')]);var _0x51ace9=answerValidation[_0xde14('0xd')](_0x1d3cc1[_0xde14('0x2c')]);if(_0x51ace9[_0xde14('0x2d')]>0x0){return _0x595fd5[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x51ace9);}var _0x22f75a=_0x1d3cc1[_0xde14('0x2c')][_0xde14('0x2f')];var _0x5b18b0=_0x1d3cc1[_0xde14('0x2c')]['sessionId'];return getAgent(_0x22f75a)[_0xde14('0x1e')](function(_0x5ac3f3){logger[_0xde14('0x14')](_0xde14('0x33'),_0x5ac3f3[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x5ac3f3[_0xde14('0x1a')]),_0xde14('0x3b'),{'sessionId':_0x5b18b0});return _0x595fd5[_0xde14('0x2e')](0xc8)['json']({'error':![],'message':_0xde14('0x3c')});})[_0xde14('0x21')](handleError(_0x595fd5));};exports[_0xde14('0x3d')]=function(_0x4b1ef7,_0x5ab2de){logger[_0xde14('0x14')](_0xde14('0x3e'),_0x4b1ef7[_0xde14('0x2c')]);var _0xdbdab8=holdValidation[_0xde14('0xd')](_0x4b1ef7[_0xde14('0x2c')]);if(_0xdbdab8['length']>0x0){return _0x5ab2de[_0xde14('0x2e')](0x190)['json'](_0xdbdab8);}var _0xa408ec=_0x4b1ef7[_0xde14('0x2c')]['userId'];var _0x33e120=_0x4b1ef7[_0xde14('0x2c')][_0xde14('0x28')];return getAgent(_0xa408ec)[_0xde14('0x1e')](function(_0x2d05c7){logger[_0xde14('0x14')](_0xde14('0x33'),_0x2d05c7['name']);emit(util[_0xde14('0x34')]('user:%s',_0x2d05c7[_0xde14('0x1a')]),_0xde14('0x3f'),{'sessionId':_0x33e120});return _0x5ab2de[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':_0xde14('0x40')});})[_0xde14('0x21')](handleError(_0x5ab2de));};exports[_0xde14('0x41')]=function(_0x1f7316,_0x3495d1){logger[_0xde14('0x14')]('unhold\x20fired:',_0x1f7316[_0xde14('0x2c')]);var _0x1688c6=unholdValidation[_0xde14('0xd')](_0x1f7316[_0xde14('0x2c')]);if(_0x1688c6[_0xde14('0x2d')]>0x0){return _0x3495d1['status'](0x190)[_0xde14('0x38')](_0x1688c6);}var _0x4dc2e3=_0x1f7316[_0xde14('0x2c')][_0xde14('0x2f')];var _0x3fce2c=_0x1f7316[_0xde14('0x2c')][_0xde14('0x28')];return getAgent(_0x4dc2e3)['then'](function(_0x5356fe){logger[_0xde14('0x14')]('entityFound:',_0x5356fe[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x5356fe[_0xde14('0x1a')]),_0xde14('0x42'),{'sessionId':_0x3fce2c});return _0x3495d1[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':_0xde14('0x43')});})[_0xde14('0x21')](handleError(_0x3495d1));};exports['calls']=function(_0x205a94,_0x2c972b){logger[_0xde14('0x14')](_0xde14('0x44'),_0x2c972b[_0xde14('0x2c')]);var _0x5965e1=callsValidation[_0xde14('0xd')](_0x205a94['body']);if(_0x5965e1[_0xde14('0x2d')]>0x0){return _0x2c972b[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x5965e1);}var _0x4dbeaf=_0x205a94[_0xde14('0x2c')][_0xde14('0x2f')];var _0x27ab1a=respondWithRpcPromise(_0xde14('0x24'));var _0x525c64=getAgent(_0x4dbeaf);return Promise['all']([_0x27ab1a,_0x525c64])['then'](function(_0x475671){var _0x508f25=_0x475671[0x0];var _0x596cd3=_0x475671[0x1];var _0xc10000=_[_0xde14('0x25')](_0x508f25[_0xde14('0x26')],function(_0x34da32){return _0x34da32[_0xde14('0x27')]==_0x596cd3['id'];});return _0x2c972b[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'count':_0xc10000[_0xde14('0x2d')],'rows':_0xc10000});})[_0xde14('0x21')](handleError(_0x2c972b));};exports['conference']=function(_0x6be331,_0x1cfc98){logger[_0xde14('0x14')]('conference\x20fired:',_0x6be331[_0xde14('0x2c')]);var _0x599adc=conferenceValidation[_0xde14('0xd')](_0x6be331[_0xde14('0x2c')]);if(_0x599adc[_0xde14('0x2d')]>0x0){return _0x1cfc98[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x599adc);}var _0x10e06e=_0x6be331[_0xde14('0x2c')]['userId'];return getAgent(_0x10e06e)[_0xde14('0x1e')](function(_0x25ba7e){logger[_0xde14('0x14')](_0xde14('0x33'),_0x25ba7e[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x25ba7e['name']),'webbar:conference');return _0x1cfc98[_0xde14('0x2e')](0xc8)[_0xde14('0x38')]({'error':![],'message':_0xde14('0x45')});})['catch'](handleError(_0x1cfc98));};exports[_0xde14('0x46')]=function(_0x2bfb4f,_0x3a5b06){logger[_0xde14('0x14')]('transfer\x20fired:',_0x2bfb4f['body']);var _0x2395e1=transferValidation[_0xde14('0xd')](_0x2bfb4f[_0xde14('0x2c')]);if(_0x2395e1[_0xde14('0x2d')]>0x0){return _0x3a5b06[_0xde14('0x2e')](0x190)[_0xde14('0x38')](_0x2395e1);}var _0x1bfe9b=_0x2bfb4f[_0xde14('0x2c')][_0xde14('0x2f')];var _0x4657d1=_0x2bfb4f[_0xde14('0x2c')][_0xde14('0x28')];var _0x1ff577=_0x2bfb4f[_0xde14('0x2c')][_0xde14('0x47')];return getAgent(_0x1bfe9b)[_0xde14('0x1e')](function(_0x2656c7){logger[_0xde14('0x14')](_0xde14('0x33'),_0x2656c7[_0xde14('0x1a')]);emit(util[_0xde14('0x34')](_0xde14('0x35'),_0x2656c7[_0xde14('0x1a')]),'webbar:transfer',{'sessionId':_0x4657d1,'transferNumber':_0x1ff577});return _0x3a5b06[_0xde14('0x2e')](0xc8)['json']({'error':![],'message':_0xde14('0x48')});})['catch'](handleError(_0x3a5b06));}; \ No newline at end of file +var _0x2f68=['conference\x20fired:','conference\x20executed!','transferNumber','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','ioredis','redis','localhost','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','message','result','catch','User','agent','then','all','filter','rows','UserId','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','VoiceChannels','conference'];(function(_0x23f12f,_0x48f457){var _0x563de4=function(_0x41f95e){while(--_0x41f95e){_0x23f12f['push'](_0x23f12f['shift']());}};_0x563de4(++_0x48f457);}(_0x2f68,0x9a));var _0x82f6=function(_0x3b4879,_0x2c809f){_0x3b4879=_0x3b4879-0x0;var _0x5a91e7=_0x2f68[_0x3b4879];return _0x5a91e7;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x82f6('0x0'));var db=require(_0x82f6('0x1'))['db'];var config=require(_0x82f6('0x2'));var util=require(_0x82f6('0x3'));var BPromise=require('bluebird');var jayson=require(_0x82f6('0x4'));var amiClient=jayson['client'][_0x82f6('0x5')]({'port':0x232a});var logger=require(_0x82f6('0x6'))('webbarapi');var Redis=require(_0x82f6('0x7'));config[_0x82f6('0x8')]=_['defaults'](config['redis'],{'host':_0x82f6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x82f6('0xa'));var originateValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'callNumber':{'type':'string','required':[!![],_0x82f6('0xd')]},'callerId':{'type':_0x82f6('0xe')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x82f6('0xe'),'required':[!![],_0x82f6('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],_0x82f6('0xc')]},'sessionId':{'type':_0x82f6('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x82f6('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x249222,_0x1d0263,_0x31b4fb){logger[_0x82f6('0x10')](_0x249222,_0x1d0263,JSON[_0x82f6('0x11')](_0x31b4fb));io['to'](_0x249222)[_0x82f6('0x12')](_0x1d0263,_0x31b4fb);}function handleError(_0x326378){return function(_0xcbc95f){console[_0x82f6('0x13')](_0x82f6('0x14'),_0xcbc95f,_0xcbc95f instanceof RangeError);logger[_0x82f6('0x15')](_0xcbc95f[_0x82f6('0x16')]);if(_0xcbc95f instanceof RangeError){if(_0xcbc95f[_0x82f6('0x17')]){delete _0xcbc95f[_0x82f6('0x17')];}_0x326378[_0x82f6('0x18')](0x194)['send'](_0xcbc95f);}else{if(_0xcbc95f[_0x82f6('0x17')]){delete _0xcbc95f[_0x82f6('0x17')];}_0x326378['status'](0x1f4)[_0x82f6('0x19')](_0xcbc95f);}};}function checkError(){return function(_0x4b9f0){if(!_0x4b9f0){throw new RangeError(_0x82f6('0x1a'));}return _0x4b9f0;};}function respondWithRpcPromise(_0x25cae6,_0x4bfeb8){return new BPromise(function(_0xdc4dea,_0x4beccf){var _0x8668bb=amiClient;return _0x8668bb[_0x82f6('0x1b')](_0x25cae6,_0x4bfeb8)['then'](function(_0x516deb){if(_0x516deb[_0x82f6('0x15')]){if(_0x516deb[_0x82f6('0x15')]['code']===0x1f4){return _0x4beccf(_0x516deb['error'][_0x82f6('0x1c')]);}return _0xdc4dea(_0x516deb[_0x82f6('0x15')]['message']);}else{_0xdc4dea(_0x516deb[_0x82f6('0x1d')]);}})[_0x82f6('0x1e')](function(_0x5037f8){_0x4beccf(_0x5037f8);});});}function getAgent(_0x57ac0d){return db[_0x82f6('0x1f')]['findOne']({'where':{'id':_0x57ac0d,'role':_0x82f6('0x20')}})[_0x82f6('0x21')](checkError());}function getAgentCheckSession(_0x54ce11,_0x3795ef){return new BPromise(function(_0x15c9b7,_0x33ef08){var _0x1125a0=respondWithRpcPromise('VoiceChannels');var _0x40a071=getAgent(_0x54ce11);Promise[_0x82f6('0x22')]([_0x1125a0,_0x40a071])[_0x82f6('0x21')](function(_0x400137){var _0x271c28=_0x400137[0x0];var _0x328707=_0x400137[0x1];var _0x27e473=_[_0x82f6('0x23')](_0x271c28[_0x82f6('0x24')],function(_0x402449){return _0x402449[_0x82f6('0x25')]==_0x328707['id']&&_0x402449[_0x82f6('0x26')]==_0x3795ef;});if(_0x27e473[_0x82f6('0x27')]==0x1){_0x15c9b7(_0x328707);}else{_0x33ef08(new RangeError(_0x82f6('0x28')+_0x3795ef+'\x20not\x20found!'));}});});}exports[_0x82f6('0x29')]=function(_0x2c764f,_0x418f34){logger['info'](_0x82f6('0x2a'),_0x2c764f[_0x82f6('0x2b')]);var _0x831131=originateValidation[_0x82f6('0xa')](_0x2c764f[_0x82f6('0x2b')]);if(_0x831131[_0x82f6('0x27')]>0x0){return _0x418f34[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x831131);}var _0x4756ee=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x31df71=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2e')];var _0x4c45a4=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x2f')];var _0x1c6ce4=_0x2c764f[_0x82f6('0x2b')][_0x82f6('0x30')];return getAgent(_0x4756ee)[_0x82f6('0x21')](function(_0x34c2f1){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x34c2f1[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x34c2f1[_0x82f6('0x17')]),_0x82f6('0x34'),{'callNumber':_0x31df71,'callerId':_0x4c45a4,'callbackUrl':_0x1c6ce4});return _0x418f34['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x418f34));};exports[_0x82f6('0x35')]=function(_0x18c81e,_0x5e8828){logger[_0x82f6('0x10')](_0x82f6('0x36'),_0x18c81e[_0x82f6('0x2b')]);var _0x56e5f1=hangupValidation[_0x82f6('0xa')](_0x18c81e['body']);if(_0x56e5f1[_0x82f6('0x27')]>0x0){return _0x5e8828['status'](0x190)[_0x82f6('0x2c')](_0x56e5f1);}var _0x47ef9e=_0x18c81e[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x5ad42c=_0x18c81e[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x47ef9e)[_0x82f6('0x21')](function(_0x43dcd1){logger['info'](_0x82f6('0x31'),_0x43dcd1[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x43dcd1['name']),_0x82f6('0x37'),{'sessionId':_0x5ad42c});return _0x5e8828[_0x82f6('0x18')](0xc8)['json']({'error':![],'message':_0x82f6('0x38')});})[_0x82f6('0x1e')](handleError(_0x5e8828));};exports[_0x82f6('0x39')]=function(_0x23662f,_0xc3e250){logger['info'](_0x82f6('0x3a'),_0x23662f['body']);var _0x139614=answerValidation[_0x82f6('0xa')](_0x23662f[_0x82f6('0x2b')]);if(_0x139614[_0x82f6('0x27')]>0x0){return _0xc3e250[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x139614);}var _0x43fefc=_0x23662f['body'][_0x82f6('0x2d')];var _0x297cda=_0x23662f[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x43fefc)['then'](function(_0x408dce){logger['info'](_0x82f6('0x31'),_0x408dce[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x408dce[_0x82f6('0x17')]),_0x82f6('0x3b'),{'sessionId':_0x297cda});return _0xc3e250['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x3c')});})[_0x82f6('0x1e')](handleError(_0xc3e250));};exports[_0x82f6('0x3d')]=function(_0x10ae6e,_0x95c1fa){logger[_0x82f6('0x10')](_0x82f6('0x3e'),_0x10ae6e['body']);var _0x43b92e=holdValidation[_0x82f6('0xa')](_0x10ae6e['body']);if(_0x43b92e[_0x82f6('0x27')]>0x0){return _0x95c1fa['status'](0x190)[_0x82f6('0x2c')](_0x43b92e);}var _0x5e3321=_0x10ae6e[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0xbcc26b=_0x10ae6e[_0x82f6('0x2b')][_0x82f6('0x26')];return getAgent(_0x5e3321)[_0x82f6('0x21')](function(_0x53f7d4){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x53f7d4['name']);emit(util['format'](_0x82f6('0x33'),_0x53f7d4[_0x82f6('0x17')]),_0x82f6('0x3f'),{'sessionId':_0xbcc26b});return _0x95c1fa['status'](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x40')});})[_0x82f6('0x1e')](handleError(_0x95c1fa));};exports[_0x82f6('0x41')]=function(_0x4e9e13,_0x495400){logger[_0x82f6('0x10')](_0x82f6('0x42'),_0x4e9e13[_0x82f6('0x2b')]);var _0x5231bb=unholdValidation[_0x82f6('0xa')](_0x4e9e13[_0x82f6('0x2b')]);if(_0x5231bb['length']>0x0){return _0x495400['status'](0x190)['json'](_0x5231bb);}var _0x2e6b03=_0x4e9e13['body'][_0x82f6('0x2d')];var _0x57c023=_0x4e9e13[_0x82f6('0x2b')]['sessionId'];return getAgent(_0x2e6b03)[_0x82f6('0x21')](function(_0x58f89b){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x58f89b[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x58f89b[_0x82f6('0x17')]),'webbar:unhold',{'sessionId':_0x57c023});return _0x495400[_0x82f6('0x18')](0xc8)[_0x82f6('0x2c')]({'error':![],'message':_0x82f6('0x43')});})['catch'](handleError(_0x495400));};exports['calls']=function(_0x13406f,_0x81e595){logger[_0x82f6('0x10')](_0x82f6('0x44'),_0x81e595['body']);var _0x2c1c0e=callsValidation[_0x82f6('0xa')](_0x13406f[_0x82f6('0x2b')]);if(_0x2c1c0e['length']>0x0){return _0x81e595['status'](0x190)['json'](_0x2c1c0e);}var _0x44218c=_0x13406f[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x59176d=respondWithRpcPromise(_0x82f6('0x45'));var _0x26c1d8=getAgent(_0x44218c);return Promise[_0x82f6('0x22')]([_0x59176d,_0x26c1d8])[_0x82f6('0x21')](function(_0x51791c){var _0x255da2=_0x51791c[0x0];var _0x94aed4=_0x51791c[0x1];var _0x12a5b9=_[_0x82f6('0x23')](_0x255da2['rows'],function(_0x53c715){return _0x53c715[_0x82f6('0x25')]==_0x94aed4['id'];});return _0x81e595[_0x82f6('0x18')](0xc8)['json']({'count':_0x12a5b9[_0x82f6('0x27')],'rows':_0x12a5b9});})[_0x82f6('0x1e')](handleError(_0x81e595));};exports[_0x82f6('0x46')]=function(_0x5b3aaa,_0x32fa83){logger[_0x82f6('0x10')](_0x82f6('0x47'),_0x5b3aaa[_0x82f6('0x2b')]);var _0x169aa3=conferenceValidation[_0x82f6('0xa')](_0x5b3aaa['body']);if(_0x169aa3[_0x82f6('0x27')]>0x0){return _0x32fa83[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x169aa3);}var _0x2d57e3=_0x5b3aaa[_0x82f6('0x2b')]['userId'];return getAgent(_0x2d57e3)[_0x82f6('0x21')](function(_0x3cc579){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x3cc579[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x3cc579[_0x82f6('0x17')]),'webbar:conference');return _0x32fa83[_0x82f6('0x18')](0xc8)['json']({'error':![],'message':_0x82f6('0x48')});})[_0x82f6('0x1e')](handleError(_0x32fa83));};exports['transfer']=function(_0x843458,_0x32e43d){logger[_0x82f6('0x10')]('transfer\x20fired:',_0x843458['body']);var _0x140dcd=transferValidation[_0x82f6('0xa')](_0x843458['body']);if(_0x140dcd['length']>0x0){return _0x32e43d[_0x82f6('0x18')](0x190)[_0x82f6('0x2c')](_0x140dcd);}var _0x1c37d2=_0x843458[_0x82f6('0x2b')][_0x82f6('0x2d')];var _0x11581c=_0x843458[_0x82f6('0x2b')][_0x82f6('0x26')];var _0x2d0d7c=_0x843458[_0x82f6('0x2b')][_0x82f6('0x49')];return getAgent(_0x1c37d2)[_0x82f6('0x21')](function(_0x53d931){logger[_0x82f6('0x10')](_0x82f6('0x31'),_0x53d931[_0x82f6('0x17')]);emit(util[_0x82f6('0x32')](_0x82f6('0x33'),_0x53d931['name']),_0x82f6('0x4a'),{'sessionId':_0x11581c,'transferNumber':_0x2d0d7c});return _0x32e43d[_0x82f6('0x18')](0xc8)[_0x82f6('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x82f6('0x1e')](handleError(_0x32e43d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index dc4a431..60ba59c 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','put','/:id'];(function(_0x3df7b7,_0x2b6aca){var _0x2c5bf2=function(_0x31e679){while(--_0x31e679){_0x3df7b7['push'](_0x3df7b7['shift']());}};_0x2c5bf2(++_0x2b6aca);}(_0x14a0,0x8e));var _0x014a=function(_0x565faf,_0x5f3718){_0x565faf=_0x565faf-0x0;var _0x42292f=_0x14a0[_0x565faf];return _0x42292f;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['getAnswers']);router[_0x014a('0x8')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0x8')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0x13')]);router[_0x014a('0x12')]('/:id/dispositions',auth[_0x014a('0x9')](),controller[_0x014a('0x14')]);router['post'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['addAnswer']);router[_0x014a('0x12')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x15')]);router[_0x014a('0x12')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x16')]);router[_0x014a('0x12')](_0x014a('0x17'),controller[_0x014a('0x18')]);router[_0x014a('0x12')](_0x014a('0x19'),auth[_0x014a('0x9')](),controller['send']);router[_0x014a('0x1a')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1c')]);router[_0x014a('0x1d')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1e')]);router[_0x014a('0x1d')]('/:id/dispositions',auth[_0x014a('0x9')](),controller['removeDispositions']);router[_0x014a('0x1d')](_0x014a('0xd'),auth[_0x014a('0x9')](),controller[_0x014a('0x1f')]);router[_0x014a('0x1d')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x20')]);module[_0x014a('0x21')]=router; \ No newline at end of file +var _0x8952=['getAgents','/:id/applications','create','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getAnswers'];(function(_0x113bef,_0x21a1a1){var _0x2e0ce4=function(_0x5b0861){while(--_0x5b0861){_0x113bef['push'](_0x113bef['shift']());}};_0x2e0ce4(++_0x21a1a1);}(_0x8952,0x17e));var _0x2895=function(_0x279816,_0x1afb50){_0x279816=_0x279816-0x0;var _0x5ee978=_0x8952[_0x279816];return _0x5ee978;};'use strict';var multer=require('multer');var util=require(_0x2895('0x0'));var path=require(_0x2895('0x1'));var timeout=require(_0x2895('0x2'));var express=require(_0x2895('0x3'));var router=express[_0x2895('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2895('0x5'));var interaction=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var controller=require('./whatsappAccount.controller');router[_0x2895('0x8')]('/',auth[_0x2895('0x9')](),controller[_0x2895('0xa')]);router['get']('/describe',auth[_0x2895('0x9')](),controller[_0x2895('0xb')]);router[_0x2895('0x8')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller['show']);router[_0x2895('0x8')]('/:id/dispositions',auth[_0x2895('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x2895('0x9')](),controller[_0x2895('0xd')]);router[_0x2895('0x8')]('/:id/users',auth[_0x2895('0x9')](),controller[_0x2895('0xe')]);router['get'](_0x2895('0xf'),auth[_0x2895('0x9')](),controller['getApplications']);router['post']('/',auth[_0x2895('0x9')](),controller[_0x2895('0x10')]);router['post'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller[_0x2895('0x12')]);router[_0x2895('0x13')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller[_0x2895('0x15')]);router[_0x2895('0x13')](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x17')]);router[_0x2895('0x13')](_0x2895('0xf'),auth[_0x2895('0x9')](),controller[_0x2895('0x18')]);router[_0x2895('0x13')](_0x2895('0x19'),controller[_0x2895('0x1a')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x2895('0x1b')]);router[_0x2895('0x1c')](_0x2895('0xc'),auth['isAuthenticated'](),controller[_0x2895('0x1d')]);router[_0x2895('0x1e')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller[_0x2895('0x1f')]);router['delete'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller['removeDispositions']);router[_0x2895('0x1e')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller['removeAnswers']);router['delete'](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 8782421..f918e21 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 _0x4ba9=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x32201f,_0x5c1eef){var _0x619b64=function(_0x2bc8e9){while(--_0x2bc8e9){_0x32201f['push'](_0x32201f['shift']());}};_0x619b64(++_0x5c1eef);}(_0x4ba9,0x99));var _0x94ba=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0x4ba9[_0x12aaee];return _0x37c350;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x94ba('0x0'));module[_0x94ba('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x94ba('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x94ba('0x3')],'defaultValue':function(){return rs[_0x94ba('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x94ba('0x5')](_0x94ba('0x6'),_0x94ba('0x7'))},'accountSid':{'type':Sequelize[_0x94ba('0x3')]},'baseUrl':{'type':Sequelize[_0x94ba('0x3')]},'authToken':{'type':Sequelize[_0x94ba('0x3')]},'notificationTemplate':{'type':Sequelize[_0x94ba('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x94ba('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x94ba('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x94ba('0xa')],'comment':_0x94ba('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x94ba('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x458e22){if(!_0x458e22){this[_0x94ba('0xc')](_0x94ba('0xd'),null);}this[_0x94ba('0xc')](_0x94ba('0xe'),_0x458e22);}},'description':{'type':Sequelize[_0x94ba('0x3')]}}; \ No newline at end of file +var _0xddc1=['name','STRING','twilio','sinch','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','mandatoryDisposition','sequelize','exports'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xddc1,0x191));var _0x1ddc=function(_0x3bc304,_0x1dd725){_0x3bc304=_0x3bc304-0x0;var _0x29124e=_0xddc1[_0x3bc304];return _0x29124e;};'use strict';var Sequelize=require(_0x1ddc('0x0'));var rs=require('randomstring');module[_0x1ddc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1ddc('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x1ddc('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x1ddc('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1ddc('0x4'),_0x1ddc('0x5'))},'accountSid':{'type':Sequelize[_0x1ddc('0x3')]},'baseUrl':{'type':Sequelize[_0x1ddc('0x3')]},'authToken':{'type':Sequelize[_0x1ddc('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1ddc('0x6');}},'notificationSound':{'type':Sequelize[_0x1ddc('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1ddc('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1ddc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1ddc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1ddc('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1ddc('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x1ddc('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1ddc('0xa'),'set':function(_0x1ad042){if(!_0x1ad042){this[_0x1ddc('0xb')]('mandatoryDispositionPauseId',null);}this[_0x1ddc('0xb')](_0x1ddc('0xc'),_0x1ad042);}},'description':{'type':Sequelize[_0x1ddc('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 310b266..aa32ea6 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 _0x3955=['Messages','spread','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','client','http','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','WhatsappAccount','includeAll','include','findAll','rows','show','params','keys','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','Transaction','WhatsappApplication','findAndCountAll','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','twilio','from','From','replace','MessageSid','notifications','messageId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','ListId','list','Contacts','defaults','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','entity\x20found','text/xml','to\x20is\x20mandatory','List','DESC'];(function(_0x34ee93,_0x104121){var _0x320308=function(_0x21974c){while(--_0x21974c){_0x34ee93['push'](_0x34ee93['shift']());}};_0x320308(++_0x104121);}(_0x3955,0x17b));var _0x5395=function(_0x3db721,_0x5c945d){_0x3db721=_0x3db721-0x0;var _0x587319=_0x3955[_0x3db721];return _0x587319;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5395('0x0'));var zipdir=require(_0x5395('0x1'));var jsonpatch=require(_0x5395('0x2'));var rp=require(_0x5395('0x3'));var moment=require(_0x5395('0x4'));var BPromise=require(_0x5395('0x5'));var Mustache=require(_0x5395('0x6'));var util=require(_0x5395('0x7'));var path=require('path');var sox=require(_0x5395('0x8'));var csv=require(_0x5395('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5395('0xa'));var _=require(_0x5395('0xb'));var squel=require(_0x5395('0xc'));var crypto=require(_0x5395('0xd'));var jsforce=require(_0x5395('0xe'));var deskjs=require(_0x5395('0xf'));var toCsv=require(_0x5395('0x9'));var querystring=require(_0x5395('0x10'));var Papa=require(_0x5395('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5395('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5395('0x13'));var logger=require(_0x5395('0x14'))(_0x5395('0x15'));var utils=require(_0x5395('0x16'));var config=require(_0x5395('0x17'));var licenseUtil=require(_0x5395('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5395('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5395('0x1a'))(new Redis(config[_0x5395('0x19')]));require('./whatsappAccount.socket')[_0x5395('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5395('0x1c')][_0x5395('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x107818,_0x1e7602,_0x1b7f08,_0x173d04){return new BPromise(function(_0x2e7d1e,_0x582df5){var _0x3e079d=_0x173d04||client;return _0x3e079d['request'](_0x107818,_0x1b7f08)[_0x5395('0x1e')](function(_0x4bbbb8){logger['info'](_0x5395('0x1f'),_0x1e7602,'request\x20sent');logger[_0x5395('0x20')](_0x5395('0x21'),_0x1e7602,_0x5395('0x22'),JSON[_0x5395('0x23')](_0x4bbbb8));if(_0x4bbbb8[_0x5395('0x24')]){if(_0x4bbbb8[_0x5395('0x24')]['code']===0x1f4){logger[_0x5395('0x24')](_0x5395('0x1f'),_0x1e7602,_0x4bbbb8[_0x5395('0x24')]['message']);return _0x582df5(_0x4bbbb8[_0x5395('0x24')][_0x5395('0x25')]);}logger['error'](_0x5395('0x1f'),_0x1e7602,_0x4bbbb8[_0x5395('0x24')][_0x5395('0x25')]);return _0x2e7d1e(_0x4bbbb8[_0x5395('0x24')][_0x5395('0x25')]);}else{logger[_0x5395('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x1e7602,_0x5395('0x22'));_0x2e7d1e(_0x4bbbb8[_0x5395('0x27')][_0x5395('0x25')]);}})[_0x5395('0x28')](function(_0x3288e8){logger[_0x5395('0x24')](_0x5395('0x1f'),_0x1e7602,_0x3288e8);_0x582df5(_0x3288e8);});});}function respondWithStatusCode(_0x113aa3,_0x41c3ca){_0x41c3ca=_0x41c3ca||0xcc;return function(_0x59e965){if(_0x59e965){return _0x113aa3[_0x5395('0x29')](_0x41c3ca);}return _0x113aa3[_0x5395('0x2a')](_0x41c3ca)[_0x5395('0x2b')]();};}function respondWithResult(_0x4ae127,_0x15e5ea){_0x15e5ea=_0x15e5ea||0xc8;return function(_0x133157){if(_0x133157){return _0x4ae127[_0x5395('0x2a')](_0x15e5ea)[_0x5395('0x2c')](_0x133157);}};}function respondWithFilteredResult(_0x412b1a,_0xf37df4){return function(_0x44bb72){if(_0x44bb72){var _0x50b3bd=typeof _0xf37df4[_0x5395('0x2d')]==='undefined'&&typeof _0xf37df4[_0x5395('0x2e')]==='undefined';var _0x51ada1=_0x44bb72[_0x5395('0x2f')];var _0x4820a0=_0x50b3bd?0x0:_0xf37df4[_0x5395('0x2d')];var _0x2fbf82=_0x50b3bd?_0x44bb72['count']:_0xf37df4['offset']+_0xf37df4[_0x5395('0x2e')];var _0x2e9a1b;if(_0x2fbf82>=_0x51ada1){_0x2fbf82=_0x51ada1;_0x2e9a1b=0xc8;}else{_0x2e9a1b=0xce;}_0x412b1a[_0x5395('0x2a')](_0x2e9a1b);return _0x412b1a[_0x5395('0x30')](_0x5395('0x31'),_0x4820a0+'-'+_0x2fbf82+'/'+_0x51ada1)[_0x5395('0x2c')](_0x44bb72);}return null;};}function patchUpdates(_0x523ee1){return function(_0x2f460f){try{jsonpatch['apply'](_0x2f460f,_0x523ee1,!![]);}catch(_0x31b54f){return BPromise[_0x5395('0x32')](_0x31b54f);}return _0x2f460f[_0x5395('0x33')]();};}function saveUpdates(_0x573734,_0x29b913){return function(_0x365295){if(_0x365295){return _0x365295[_0x5395('0x34')](_0x573734)[_0x5395('0x1e')](function(_0x40e642){return _0x40e642;});}return null;};}function removeEntity(_0x3a5b53,_0x13d20d){return function(_0x12225c){if(_0x12225c){return _0x12225c[_0x5395('0x35')]()[_0x5395('0x1e')](function(){var _0x5ea281=_0x12225c['get']({'plain':!![]});var _0x5afa56='WhatsappAccounts';return db[_0x5395('0x36')][_0x5395('0x35')]({'where':{'type':_0x5afa56,'resourceId':_0x5ea281['id']}})[_0x5395('0x1e')](function(){return _0x12225c;});})[_0x5395('0x1e')](function(){_0x3a5b53['status'](0xcc)[_0x5395('0x2b')]();});}};}function handleEntityNotFound(_0x2e6c15,_0x337697){return function(_0x158d64){if(!_0x158d64){_0x2e6c15[_0x5395('0x29')](0x194);}return _0x158d64;};}function handleError(_0x52abda,_0x4bb49c){_0x4bb49c=_0x4bb49c||0x1f4;return function(_0x16be5c){logger[_0x5395('0x24')](_0x16be5c[_0x5395('0x37')]);if(_0x16be5c[_0x5395('0x38')]){delete _0x16be5c[_0x5395('0x38')];}_0x52abda[_0x5395('0x2a')](_0x4bb49c)[_0x5395('0x39')](_0x16be5c);};}exports[_0x5395('0x3a')]=function(_0xa5abf2,_0x1d78c9){var _0x5c1d3e={'include':[{'model':db[_0x5395('0x3b')],'as':_0x5395('0x3c')}]},_0x49d239={},_0xc021fc={'count':0x0,'rows':[]};var _0x586065=_['map'](db['WhatsappAccount'][_0x5395('0x3d')],function(_0x5c2130){return{'name':_0x5c2130[_0x5395('0x3e')],'type':_0x5c2130[_0x5395('0x3f')][_0x5395('0x40')]};});_0x49d239[_0x5395('0x41')]=_['map'](_0x586065,_0x5395('0x38'));_0x49d239[_0x5395('0x42')]=_['keys'](_0xa5abf2[_0x5395('0x42')]);_0x49d239[_0x5395('0x43')]=_[_0x5395('0x44')](_0x49d239[_0x5395('0x41')],_0x49d239[_0x5395('0x42')]);_0x5c1d3e[_0x5395('0x45')]=_[_0x5395('0x44')](_0x49d239['model'],qs[_0x5395('0x46')](_0xa5abf2[_0x5395('0x42')][_0x5395('0x46')]));_0x5c1d3e['attributes']=_0x5c1d3e[_0x5395('0x45')][_0x5395('0x47')]?_0x5c1d3e['attributes']:_0x49d239['model'];if(!_0xa5abf2[_0x5395('0x42')][_0x5395('0x48')]('nolimit')){_0x5c1d3e[_0x5395('0x2e')]=qs['limit'](_0xa5abf2[_0x5395('0x42')][_0x5395('0x2e')]);_0x5c1d3e['offset']=qs[_0x5395('0x2d')](_0xa5abf2['query']['offset']);}_0x5c1d3e[_0x5395('0x49')]=qs[_0x5395('0x4a')](_0xa5abf2[_0x5395('0x42')][_0x5395('0x4a')]);_0x5c1d3e[_0x5395('0x4b')]=qs['filters'](_[_0x5395('0x4c')](_0xa5abf2[_0x5395('0x42')],_0x49d239[_0x5395('0x43')]),_0x586065);if(_0xa5abf2['query'][_0x5395('0x4d')]){_0x5c1d3e[_0x5395('0x4b')]=_[_0x5395('0x4e')](_0x5c1d3e[_0x5395('0x4b')],{'$or':_[_0x5395('0x4f')](_0x586065,function(_0xf63dcf){if(_0xf63dcf[_0x5395('0x3f')]!=='VIRTUAL'){var _0x399239={};_0x399239[_0xf63dcf[_0x5395('0x38')]]={'$like':'%'+_0xa5abf2[_0x5395('0x42')][_0x5395('0x4d')]+'%'};return _0x399239;}})});}_0x5c1d3e=_['merge']({},_0x5c1d3e,_0xa5abf2[_0x5395('0x50')]);var _0x320a11={'where':_0x5c1d3e[_0x5395('0x4b')]};return db[_0x5395('0x51')][_0x5395('0x2f')](_0x320a11)[_0x5395('0x1e')](function(_0x30efc2){_0xc021fc[_0x5395('0x2f')]=_0x30efc2;if(_0xa5abf2[_0x5395('0x42')][_0x5395('0x52')]){_0x5c1d3e[_0x5395('0x53')]=[{'all':!![]}];}return db[_0x5395('0x51')][_0x5395('0x54')](_0x5c1d3e);})[_0x5395('0x1e')](function(_0x5f3d45){_0xc021fc[_0x5395('0x55')]=_0x5f3d45;return _0xc021fc;})[_0x5395('0x1e')](respondWithFilteredResult(_0x1d78c9,_0x5c1d3e))[_0x5395('0x28')](handleError(_0x1d78c9,null));};exports[_0x5395('0x56')]=function(_0x1face1,_0x19931c){var _0x5c5b60={'raw':![],'where':{'id':_0x1face1[_0x5395('0x57')]['id']},'include':[{'model':db[_0x5395('0x3b')],'as':_0x5395('0x3c')}]},_0x1fb9b0={};_0x1fb9b0[_0x5395('0x41')]=_[_0x5395('0x58')](db[_0x5395('0x51')][_0x5395('0x3d')]);_0x1fb9b0[_0x5395('0x42')]=_[_0x5395('0x58')](_0x1face1[_0x5395('0x42')]);_0x1fb9b0[_0x5395('0x43')]=_[_0x5395('0x44')](_0x1fb9b0['model'],_0x1fb9b0['query']);_0x5c5b60['attributes']=_[_0x5395('0x44')](_0x1fb9b0[_0x5395('0x41')],qs[_0x5395('0x46')](_0x1face1[_0x5395('0x42')][_0x5395('0x46')]));_0x5c5b60[_0x5395('0x45')]=_0x5c5b60[_0x5395('0x45')][_0x5395('0x47')]?_0x5c5b60[_0x5395('0x45')]:_0x1fb9b0['model'];if(_0x1face1[_0x5395('0x42')][_0x5395('0x52')]){_0x5c5b60[_0x5395('0x53')]=[{'all':!![]}];}_0x5c5b60=_[_0x5395('0x4e')]({},_0x5c5b60,_0x1face1['options']);return db['WhatsappAccount'][_0x5395('0x59')](_0x5c5b60)[_0x5395('0x1e')](handleEntityNotFound(_0x19931c,null))[_0x5395('0x1e')](respondWithResult(_0x19931c,null))['catch'](handleError(_0x19931c,null));};exports['create']=function(_0x37cbc2,_0xbc38f3){return db[_0x5395('0x51')]['create'](_0x37cbc2[_0x5395('0x5a')],{})[_0x5395('0x1e')](function(_0xdf2b4){var _0x99a055=_0x37cbc2[_0x5395('0x5b')][_0x5395('0x5c')]({'plain':!![]});if(!_0x99a055)throw new Error(_0x5395('0x5d'));if(_0x99a055[_0x5395('0x5e')]===_0x5395('0x5b')){var _0x61bf46=_0xdf2b4['get']({'plain':!![]});var _0x5a086b='WhatsappAccounts';return db[_0x5395('0x5f')][_0x5395('0x59')]({'where':{'name':_0x5a086b,'userProfileId':_0x99a055[_0x5395('0x60')]},'raw':!![]})[_0x5395('0x1e')](function(_0x307599){if(_0x307599&&_0x307599[_0x5395('0x61')]===0x0){return db[_0x5395('0x36')][_0x5395('0x62')]({'name':_0x61bf46['name'],'resourceId':_0x61bf46['id'],'type':_0x307599[_0x5395('0x38')],'sectionId':_0x307599['id']},{})[_0x5395('0x1e')](function(){return _0xdf2b4;});}else{return _0xdf2b4;}})[_0x5395('0x28')](function(_0x1fdd44){logger['error'](_0x5395('0x63'),_0x1fdd44);throw _0x1fdd44;});}return _0xdf2b4;})[_0x5395('0x1e')](respondWithResult(_0xbc38f3,0xc9))[_0x5395('0x28')](handleError(_0xbc38f3,null));};exports[_0x5395('0x34')]=function(_0x9e8210,_0xd32673){if(_0x9e8210[_0x5395('0x5a')]['id']){delete _0x9e8210['body']['id'];}return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x9e8210[_0x5395('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5395('0x1e')](handleEntityNotFound(_0xd32673,null))['then'](saveUpdates(_0x9e8210[_0x5395('0x5a')],null))['then'](respondWithResult(_0xd32673,null))[_0x5395('0x28')](handleError(_0xd32673,null));};exports['destroy']=function(_0x30e4a5,_0x36983a){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x30e4a5[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x36983a,null))['then'](removeEntity(_0x36983a,null))['catch'](handleError(_0x36983a,null));};exports[_0x5395('0x64')]=function(_0x1de0c6,_0x51506d){return db['WhatsappAccount']['describe']()[_0x5395('0x1e')](respondWithResult(_0x51506d,null))[_0x5395('0x28')](handleError(_0x51506d,null));};exports[_0x5395('0x65')]=function(_0x3b26aa,_0x210bb8,_0x5e6d73){if(_0x3b26aa[_0x5395('0x5a')]['id']){delete _0x3b26aa[_0x5395('0x5a')]['id'];}return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x3b26aa[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x210bb8,null))[_0x5395('0x1e')](function(_0x29e5d5){if(_0x29e5d5){_0x3b26aa[_0x5395('0x5a')][_0x5395('0x66')]=_0x29e5d5['id'];return db[_0x5395('0x67')]['create'](_0x3b26aa[_0x5395('0x5a')]);}})['then'](respondWithResult(_0x210bb8,null))[_0x5395('0x28')](handleError(_0x210bb8,null));};exports[_0x5395('0x68')]=function(_0x2eac51,_0xc2bc68,_0x41fc16){var _0x381e5c={'raw':![],'where':{}};var _0x3ef5da={};var _0x207e0a={'count':0x0,'rows':[]};return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0x2eac51[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0xc2bc68,null))[_0x5395('0x1e')](function(_0x34aae9){if(_0x34aae9){_0x3ef5da[_0x5395('0x41')]=_['keys'](db[_0x5395('0x67')][_0x5395('0x3d')]);_0x3ef5da['query']=_[_0x5395('0x58')](_0x2eac51[_0x5395('0x42')]);_0x3ef5da[_0x5395('0x43')]=_[_0x5395('0x44')](_0x3ef5da[_0x5395('0x41')],_0x3ef5da[_0x5395('0x42')]);_0x381e5c[_0x5395('0x45')]=_[_0x5395('0x44')](_0x3ef5da['model'],qs['fields'](_0x2eac51[_0x5395('0x42')][_0x5395('0x46')]));_0x381e5c[_0x5395('0x45')]=_0x381e5c[_0x5395('0x45')]['length']?_0x381e5c['attributes']:_0x3ef5da[_0x5395('0x41')];if(!_0x2eac51[_0x5395('0x42')][_0x5395('0x48')](_0x5395('0x6a'))){_0x381e5c[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x2eac51['query'][_0x5395('0x2e')]);_0x381e5c['offset']=qs[_0x5395('0x2d')](_0x2eac51['query']['offset']);}_0x381e5c[_0x5395('0x49')]=qs[_0x5395('0x4a')](_0x2eac51[_0x5395('0x42')][_0x5395('0x4a')]);_0x381e5c[_0x5395('0x4b')]=qs[_0x5395('0x43')](_[_0x5395('0x4c')](_0x2eac51[_0x5395('0x42')],_0x3ef5da[_0x5395('0x43')]));_0x381e5c['where'][_0x5395('0x66')]=_0x34aae9['id'];if(_0x2eac51[_0x5395('0x42')][_0x5395('0x4d')]){_0x381e5c[_0x5395('0x4b')]=_[_0x5395('0x4e')](_0x381e5c[_0x5395('0x4b')],{'$or':_[_0x5395('0x4f')](_0x381e5c[_0x5395('0x45')],function(_0x4745c6){var _0x19d22c={};_0x19d22c[_0x4745c6]={'$like':'%'+_0x2eac51['query'][_0x5395('0x4d')]+'%'};return _0x19d22c;})});}_0x381e5c=_[_0x5395('0x4e')]({},_0x381e5c,_0x2eac51['options']);return db['Disposition']['count']({'where':_0x381e5c[_0x5395('0x4b')]})[_0x5395('0x1e')](function(_0x3b9831){_0x207e0a[_0x5395('0x2f')]=_0x3b9831;if(_0x2eac51[_0x5395('0x42')][_0x5395('0x52')]){_0x381e5c[_0x5395('0x53')]=[{'all':!![]}];}return db[_0x5395('0x67')][_0x5395('0x54')](_0x381e5c);})['then'](function(_0x11351e){_0x207e0a[_0x5395('0x55')]=_0x11351e;return _0x207e0a;});}})[_0x5395('0x1e')](respondWithFilteredResult(_0xc2bc68,_0x381e5c))[_0x5395('0x28')](handleError(_0xc2bc68,null));};exports[_0x5395('0x6b')]=function(_0xdf7455,_0x3f2b29,_0x21620c){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0xdf7455[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x3f2b29,null))[_0x5395('0x1e')](function(_0x3abccd){if(_0x3abccd){return _0x3abccd[_0x5395('0x6b')](_0xdf7455[_0x5395('0x42')][_0x5395('0x6c')]);}})['then'](respondWithStatusCode(_0x3f2b29,null))['catch'](handleError(_0x3f2b29,null));};exports[_0x5395('0x6d')]=function(_0x100ea8,_0x5ae462,_0x48fccf){if(_0x100ea8[_0x5395('0x5a')]['id']){delete _0x100ea8['body']['id'];}return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x100ea8[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x5ae462,null))[_0x5395('0x1e')](function(_0x364649){if(_0x364649){_0x100ea8['body'][_0x5395('0x66')]=_0x364649['id'];return db[_0x5395('0x6e')][_0x5395('0x62')](_0x100ea8[_0x5395('0x5a')]);}})[_0x5395('0x1e')](respondWithResult(_0x5ae462,null))[_0x5395('0x28')](handleError(_0x5ae462,null));};exports['getAnswers']=function(_0x4a2706,_0x383faa,_0x3e5e88){var _0x49b9a9={'raw':![],'where':{}};var _0x46d21a={};var _0x2e0bda={'count':0x0,'rows':[]};return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0x4a2706[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x383faa,null))[_0x5395('0x1e')](function(_0x447618){if(_0x447618){_0x46d21a['model']=_[_0x5395('0x58')](db[_0x5395('0x6e')]['rawAttributes']);_0x46d21a[_0x5395('0x42')]=_['keys'](_0x4a2706[_0x5395('0x42')]);_0x46d21a[_0x5395('0x43')]=_['intersection'](_0x46d21a[_0x5395('0x41')],_0x46d21a['query']);_0x49b9a9[_0x5395('0x45')]=_['intersection'](_0x46d21a[_0x5395('0x41')],qs['fields'](_0x4a2706[_0x5395('0x42')][_0x5395('0x46')]));_0x49b9a9[_0x5395('0x45')]=_0x49b9a9[_0x5395('0x45')][_0x5395('0x47')]?_0x49b9a9['attributes']:_0x46d21a[_0x5395('0x41')];if(!_0x4a2706[_0x5395('0x42')][_0x5395('0x48')](_0x5395('0x6a'))){_0x49b9a9[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x4a2706[_0x5395('0x42')][_0x5395('0x2e')]);_0x49b9a9[_0x5395('0x2d')]=qs[_0x5395('0x2d')](_0x4a2706[_0x5395('0x42')][_0x5395('0x2d')]);}_0x49b9a9[_0x5395('0x49')]=qs['sort'](_0x4a2706['query'][_0x5395('0x4a')]);_0x49b9a9[_0x5395('0x4b')]=qs[_0x5395('0x43')](_[_0x5395('0x4c')](_0x4a2706[_0x5395('0x42')],_0x46d21a[_0x5395('0x43')]));_0x49b9a9['where'][_0x5395('0x66')]=_0x447618['id'];if(_0x4a2706[_0x5395('0x42')]['filter']){_0x49b9a9[_0x5395('0x4b')]=_[_0x5395('0x4e')](_0x49b9a9['where'],{'$or':_[_0x5395('0x4f')](_0x49b9a9[_0x5395('0x45')],function(_0x3feb8f){var _0x1233ea={};_0x1233ea[_0x3feb8f]={'$like':'%'+_0x4a2706['query'][_0x5395('0x4d')]+'%'};return _0x1233ea;})});}_0x49b9a9=_[_0x5395('0x4e')]({},_0x49b9a9,_0x4a2706[_0x5395('0x50')]);return db[_0x5395('0x6e')][_0x5395('0x2f')]({'where':_0x49b9a9[_0x5395('0x4b')]})['then'](function(_0x24659d){_0x2e0bda[_0x5395('0x2f')]=_0x24659d;if(_0x4a2706[_0x5395('0x42')][_0x5395('0x52')]){_0x49b9a9[_0x5395('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5395('0x54')](_0x49b9a9);})[_0x5395('0x1e')](function(_0x4578f5){_0x2e0bda[_0x5395('0x55')]=_0x4578f5;return _0x2e0bda;});}})[_0x5395('0x1e')](respondWithFilteredResult(_0x383faa,_0x49b9a9))[_0x5395('0x28')](handleError(_0x383faa,null));};exports['removeAnswers']=function(_0x47c54b,_0x161eb7,_0x45e639){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x47c54b[_0x5395('0x57')]['id']}})['then'](handleEntityNotFound(_0x161eb7,null))[_0x5395('0x1e')](function(_0x3f7d4d){if(_0x3f7d4d){return _0x3f7d4d[_0x5395('0x6f')](_0x47c54b[_0x5395('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x161eb7,null))[_0x5395('0x28')](handleError(_0x161eb7,null));};exports['addAgents']=function(_0x3340b2,_0x42da35,_0x51bad8){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x3340b2[_0x5395('0x57')]['id']}})['then'](handleEntityNotFound(_0x42da35,null))[_0x5395('0x1e')](function(_0x3d4dfc){if(_0x3d4dfc){return _0x3d4dfc[_0x5395('0x70')](_0x3340b2[_0x5395('0x5a')][_0x5395('0x6c')],_[_0x5395('0x71')](_0x3340b2[_0x5395('0x5a')],['ids','id'])||{})['spread'](function(_0x5cc967){for(var _0x5cdfa2=0x0;_0x5cdfa2<_0x3340b2[_0x5395('0x5a')][_0x5395('0x6c')][_0x5395('0x47')];_0x5cdfa2+=0x1){socket[_0x5395('0x72')](_0x5395('0x73'),{'UserId':Number(_0x3340b2[_0x5395('0x5a')][_0x5395('0x6c')][_0x5cdfa2]),'WhatsappAccountId':Number(_0x3340b2[_0x5395('0x57')]['id'])});}return _0x5cc967;});}})['then'](respondWithResult(_0x42da35,null))[_0x5395('0x28')](handleError(_0x42da35,null));};exports['removeAgents']=function(_0x136e03,_0x41ad63,_0xd26b3e){return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x136e03['params']['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x41ad63,null))[_0x5395('0x1e')](function(_0x1aa578){if(_0x1aa578){return _0x1aa578['removeAgents'](_0x136e03['query'][_0x5395('0x6c')])['then'](function(){if(_[_0x5395('0x74')](_0x136e03[_0x5395('0x42')]['ids'])){for(var _0x3e66d3=0x0;_0x3e66d3<_0x136e03[_0x5395('0x42')]['ids']['length'];_0x3e66d3+=0x1){socket['emit'](_0x5395('0x75'),{'UserId':Number(_0x136e03[_0x5395('0x42')][_0x5395('0x6c')][_0x3e66d3]),'WhatsappAccountId':Number(_0x136e03['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x136e03[_0x5395('0x42')][_0x5395('0x6c')]),'WhatsappAccountId':Number(_0x136e03[_0x5395('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x41ad63,null))[_0x5395('0x28')](handleError(_0x41ad63,null));};exports[_0x5395('0x76')]=function(_0x5a827a,_0x50df82,_0x1e8a03){var _0x3b87b1={};var _0x71cf64={};var _0x56c905;var _0x54e066;return db['WhatsappAccount'][_0x5395('0x69')]({'where':{'id':_0x5a827a[_0x5395('0x57')]['id']}})[_0x5395('0x1e')](handleEntityNotFound(_0x50df82,null))[_0x5395('0x1e')](function(_0x64ea11){if(_0x64ea11){_0x56c905=_0x64ea11;_0x71cf64[_0x5395('0x41')]=_[_0x5395('0x58')](db[_0x5395('0x77')][_0x5395('0x3d')]);_0x71cf64[_0x5395('0x42')]=_[_0x5395('0x58')](_0x5a827a[_0x5395('0x42')]);_0x71cf64[_0x5395('0x43')]=_['intersection'](_0x71cf64['model'],_0x71cf64[_0x5395('0x42')]);_0x3b87b1['attributes']=_[_0x5395('0x44')](_0x71cf64['model'],qs[_0x5395('0x46')](_0x5a827a[_0x5395('0x42')]['fields']));_0x3b87b1[_0x5395('0x45')]=_0x3b87b1[_0x5395('0x45')][_0x5395('0x47')]?_0x3b87b1[_0x5395('0x45')]:_0x71cf64['model'];_0x3b87b1['order']=qs['sort'](_0x5a827a[_0x5395('0x42')][_0x5395('0x4a')]);_0x3b87b1[_0x5395('0x4b')]=qs[_0x5395('0x43')](_[_0x5395('0x4c')](_0x5a827a[_0x5395('0x42')],_0x71cf64[_0x5395('0x43')]));if(_0x5a827a[_0x5395('0x42')][_0x5395('0x4d')]){_0x3b87b1['where']=_[_0x5395('0x4e')](_0x3b87b1['where'],{'$or':_[_0x5395('0x4f')](_0x3b87b1[_0x5395('0x45')],function(_0x18dafc){var _0x17569e={};_0x17569e[_0x18dafc]={'$like':'%'+_0x5a827a[_0x5395('0x42')]['filter']+'%'};return _0x17569e;})});}_0x3b87b1=_['merge']({},_0x3b87b1,_0x5a827a[_0x5395('0x50')]);return _0x56c905[_0x5395('0x76')](_0x3b87b1);}})['then'](function(_0x2e32d2){if(_0x2e32d2){_0x54e066=_0x2e32d2['length'];if(!_0x5a827a[_0x5395('0x42')]['hasOwnProperty'](_0x5395('0x6a'))){_0x3b87b1[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x5a827a['query'][_0x5395('0x2e')]);_0x3b87b1['offset']=qs[_0x5395('0x2d')](_0x5a827a['query'][_0x5395('0x2d')]);}return _0x56c905[_0x5395('0x76')](_0x3b87b1);}})[_0x5395('0x1e')](function(_0x3c77a9){if(_0x3c77a9){return _0x3c77a9?{'count':_0x54e066,'rows':_0x3c77a9}:null;}})[_0x5395('0x1e')](respondWithResult(_0x50df82,null))[_0x5395('0x28')](handleError(_0x50df82,null));};exports[_0x5395('0x78')]=function(_0x5cb4a8,_0x1f9f61){var _0x551e89=_0x5cb4a8['params']['id'];var _0x3dc5c5=_0x5cb4a8[_0x5395('0x5a')];var _0x1e9fc3=0xc8;var _0x22f0fb=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x5395('0x79')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3e6f53){return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0x551e89},'transaction':_0x3e6f53})[_0x5395('0x1e')](function(_0x1e7330){if(_0x1e7330){return db[_0x5395('0x7a')][_0x5395('0x35')]({'where':{'WhatsappAccountId':_0x551e89},'transaction':_0x3e6f53})[_0x5395('0x1e')](function(){var _0x407505=_[_0x5395('0x4f')](_0x3dc5c5,function(_0x1dd1be){_0x1dd1be[_0x5395('0x66')]=_0x551e89;return _0x1dd1be;});return db['WhatsappApplication']['bulkCreate'](_0x407505,{'transaction':_0x3e6f53});});}else{_0x1e9fc3=0x194;_0x22f0fb=[];}});})[_0x5395('0x1e')](function(){if(_0x1e9fc3!==0x194){return db[_0x5395('0x7a')][_0x5395('0x7b')]({'where':{'WhatsappAccountId':_0x551e89},'order':'priority'})['then'](function(_0x398447){_0x22f0fb=_0x398447;});}})[_0x5395('0x28')](function(_0x1231c2){_0x1e9fc3=0x1f4;logger[_0x5395('0x24')](_0x1231c2[_0x5395('0x37')]);if(_0x1231c2[_0x5395('0x38')]){delete _0x1231c2['name'];}_0x22f0fb=_0x1231c2;})[_0x5395('0x7c')](function(){if(_0x22f0fb===null){_0x1f9f61[_0x5395('0x29')](_0x1e9fc3);}else{if(_0x1e9fc3===0x1f4){_0x1f9f61[_0x5395('0x2a')](_0x1e9fc3)[_0x5395('0x39')](_0x22f0fb);}else{_0x1f9f61[_0x5395('0x2a')](_0x1e9fc3)[_0x5395('0x2c')](_0x22f0fb);}}});};exports[_0x5395('0x7d')]=function(_0xfc362b,_0x12f904,_0x154430){var _0x4c07ec={};var _0x362b42={};var _0x52793d;var _0x1c5f12;return db[_0x5395('0x51')][_0x5395('0x69')]({'where':{'id':_0xfc362b[_0x5395('0x57')]['id']}})['then'](handleEntityNotFound(_0x12f904,null))['then'](function(_0x2fa7f3){if(_0x2fa7f3){_0x52793d=_0x2fa7f3;_0x362b42[_0x5395('0x41')]=_[_0x5395('0x58')](db[_0x5395('0x7a')][_0x5395('0x3d')]);_0x362b42[_0x5395('0x42')]=_[_0x5395('0x58')](_0xfc362b[_0x5395('0x42')]);_0x362b42['filters']=_[_0x5395('0x44')](_0x362b42[_0x5395('0x41')],_0x362b42[_0x5395('0x42')]);_0x4c07ec[_0x5395('0x45')]=_[_0x5395('0x44')](_0x362b42[_0x5395('0x41')],qs[_0x5395('0x46')](_0xfc362b[_0x5395('0x42')]['fields']));_0x4c07ec[_0x5395('0x45')]=_0x4c07ec[_0x5395('0x45')][_0x5395('0x47')]?_0x4c07ec[_0x5395('0x45')]:_0x362b42[_0x5395('0x41')];_0x4c07ec[_0x5395('0x49')]=qs['sort'](_0xfc362b[_0x5395('0x42')][_0x5395('0x4a')]);_0x4c07ec[_0x5395('0x4b')]=qs['filters'](_[_0x5395('0x4c')](_0xfc362b[_0x5395('0x42')],_0x362b42[_0x5395('0x43')]));if(_0xfc362b[_0x5395('0x42')][_0x5395('0x4d')]){_0x4c07ec['where']=_['merge'](_0x4c07ec[_0x5395('0x4b')],{'$or':_['map'](_0x4c07ec[_0x5395('0x45')],function(_0x28f3c8){var _0x1ad7f1={};_0x1ad7f1[_0x28f3c8]={'$like':'%'+_0xfc362b[_0x5395('0x42')]['filter']+'%'};return _0x1ad7f1;})});}_0x4c07ec=_[_0x5395('0x4e')]({},_0x4c07ec,_0xfc362b[_0x5395('0x50')]);return _0x52793d[_0x5395('0x7d')](_0x4c07ec);}})[_0x5395('0x1e')](function(_0x3948f1){if(_0x3948f1){_0x1c5f12=_0x3948f1['length'];if(!_0xfc362b[_0x5395('0x42')][_0x5395('0x48')](_0x5395('0x6a'))){_0x4c07ec['limit']=qs['limit'](_0xfc362b[_0x5395('0x42')][_0x5395('0x2e')]);_0x4c07ec['offset']=qs[_0x5395('0x2d')](_0xfc362b['query'][_0x5395('0x2d')]);}return _0x52793d[_0x5395('0x7d')](_0x4c07ec);}})[_0x5395('0x1e')](function(_0x414fa7){if(_0x414fa7){return _0x414fa7?{'count':_0x1c5f12,'rows':_0x414fa7}:null;}})[_0x5395('0x1e')](respondWithResult(_0x12f904,null))[_0x5395('0x28')](handleError(_0x12f904,null));};exports[_0x5395('0x7e')]=function(_0x196483,_0x1b1a73,_0x565492){var _0x43ccd9={'channel':_0x5395('0x7f')};var _0x3ae910=[];var _0x48c89f=[];var _0x10824f={};return db[_0x5395('0x51')][_0x5395('0x59')]({'where':{'id':_0x196483[_0x5395('0x57')]['id']},'include':[{'model':db[_0x5395('0x7a')],'as':_0x5395('0x80')}]})[_0x5395('0x1e')](handleEntityNotFound(_0x1b1a73,null))[_0x5395('0x1e')](function(_0x42a6e7){_0x43ccd9['account']=_0x42a6e7;if(_0x43ccd9[_0x5395('0x81')]&&_0x43ccd9[_0x5395('0x81')][_0x5395('0x3f')]===_0x5395('0x82')&&_0x196483[_0x5395('0x5a')][_0x5395('0x83')]){if(_0x196483['body']['statuses'][_0x5395('0x47')]===0x0)return;if(_0x196483[_0x5395('0x5a')][_0x5395('0x83')][0x0]['state']!==_0x5395('0x84'))return;return db[_0x5395('0x85')][_0x5395('0x34')]({'read':!![],'readAt':_0x196483[_0x5395('0x5a')]['statuses'][0x0][_0x5395('0x86')]},{'where':{'messageId':_0x196483[_0x5395('0x5a')][_0x5395('0x83')][0x0][_0x5395('0x87')]},'individualHooks':!![]})[_0x5395('0x1e')](function(_0x3bbbaf){return _0x1b1a73[_0x5395('0x2a')](0xc8)['json'](_0x3bbbaf);});}_0x43ccd9[_0x5395('0x88')]=_[_0x5395('0x89')](_0x42a6e7['Applications'],[_0x5395('0x8a')],[_0x5395('0x8b')]);if(_0x43ccd9[_0x5395('0x81')][_0x5395('0x80')]){delete _0x43ccd9[_0x5395('0x81')][_0x5395('0x80')];}return db[_0x5395('0x8c')]['describe']()[_0x5395('0x1e')](function(_0x428796){if(!_0x428796){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x8f'));}_0x3ae910=_[_0x5395('0x90')](_[_0x5395('0x58')](_0x428796),[_0x5395('0x91'),_0x5395('0x92')]);_0x48c89f=_[_0x5395('0x90')](_[_0x5395('0x58')](_0x428796),[_0x5395('0x91'),_0x5395('0x92'),'CompanyId','ListId']);_0x43ccd9['body']={'mapKey':'mobile'};if(_0x43ccd9[_0x5395('0x81')]&&_0x43ccd9[_0x5395('0x81')][_0x5395('0x3f')]===_0x5395('0x93')){_0x43ccd9[_0x5395('0x5a')][_0x5395('0x94')]=_0x196483[_0x5395('0x5a')][_0x5395('0x95')][_0x5395('0x96')]('whatsapp:','');_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')]=_0x196483[_0x5395('0x5a')]['Body'];_0x43ccd9[_0x5395('0x5a')]['messageId']=_0x196483[_0x5395('0x5a')][_0x5395('0x97')];}if(_0x43ccd9[_0x5395('0x81')]&&_0x43ccd9['account']['type']==='sinch'){_0x43ccd9['body'][_0x5395('0x94')]=_0x196483[_0x5395('0x5a')][_0x5395('0x98')][0x0][_0x5395('0x94')];_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')]=_0x196483[_0x5395('0x5a')][_0x5395('0x98')][0x0][_0x5395('0x25')][_0x5395('0x5a')];_0x43ccd9[_0x5395('0x5a')][_0x5395('0x99')]=_0x196483[_0x5395('0x5a')][_0x5395('0x98')][0x0][_0x5395('0x87')];}if(_0x43ccd9[_0x5395('0x5a')]['id']){delete _0x43ccd9[_0x5395('0x5a')]['id'];}if(_['isNil'](_0x43ccd9[_0x5395('0x5a')][_0x5395('0x94')])){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9a'));}if(_[_0x5395('0x9b')](_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')])||_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')]===''){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9c'));}if(_[_0x5395('0x9b')](_0x43ccd9[_0x5395('0x5a')]['mapKey'])){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9d')+_0x48c89f);}if(!_[_0x5395('0x9e')](_0x48c89f,_0x43ccd9['body']['mapKey'])){throw new db[(_0x5395('0x8d'))][(_0x5395('0x8e'))](_0x5395('0x9f')+_0x48c89f);}_0x10824f[_0x43ccd9['body'][_0x5395('0xa0')]]=_0x43ccd9[_0x5395('0x5a')]['from'];return db[_0x5395('0xa1')][_0x5395('0x59')]({'where':{'id':_0x43ccd9[_0x5395('0x81')][_0x5395('0xa2')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x10824f,'limit':0x1,'order':[[_0x5395('0x92'),'DESC']]}]});})[_0x5395('0x1e')](handleEntityNotFound(_0x1b1a73,null))['then'](function(_0x568c6f){if(_0x568c6f){_0x43ccd9[_0x5395('0xa3')]=_[_0x5395('0x71')](_0x568c6f,['Contacts']);if(_0x568c6f[_0x5395('0xa4')][_0x5395('0x47')]){return _0x568c6f[_0x5395('0xa4')][0x0];}var _0x16d926=_[_0x5395('0xa5')](_0x43ccd9[_0x5395('0x5a')],{'firstName':_0x43ccd9['body'][_0x5395('0x94')],'ListId':_0x568c6f['id']});_0x16d926[_0x43ccd9['body'][_0x5395('0xa0')]]=_0x43ccd9[_0x5395('0x5a')][_0x5395('0x94')];return db['CmContact'][_0x5395('0x62')](_0x16d926,{'fields':_0x3ae910,'raw':!![]});}})[_0x5395('0x1e')](handleEntityNotFound(_0x1b1a73,null))[_0x5395('0x1e')](function(_0x50cada){if(_0x50cada){_0x43ccd9[_0x5395('0xa6')]=_0x50cada;var _0xe63483={'ContactId':_0x50cada['id'],'phone':_0x43ccd9['body'][_0x5395('0x94')],'WhatsappAccountId':_0x196483[_0x5395('0x57')]['id']};var _0x593daf={'ContactId':_0x50cada['id'],'WhatsappAccountId':_0x196483['params']['id'],'closed':![]};return db[_0x5395('0xa7')][_0x5395('0x59')]({'where':_0x593daf})[_0x5395('0x1e')](function(_0x4e2191){if(_0x4e2191){return[_0x4e2191,![]];}return db['WhatsappInteraction']['create'](_0xe63483)[_0x5395('0x1e')](function(_0x71cab5){return[_0x71cab5,!![]];});});}})['spread'](function(_0x39e0d9,_0x591f98){_0x43ccd9[_0x5395('0xa8')]=_0x39e0d9[_0x5395('0x5c')]({'plain':!![]});_0x43ccd9[_0x5395('0xa8')][_0x5395('0xa9')]=![];if(_0x591f98){if(_0x43ccd9[_0x5395('0x81')]['autoclose']){_0x43ccd9[_0x5395('0x88')][_0x5395('0xaa')]({'id':0x0,'priority':_0x43ccd9[_0x5395('0x88')][_0x5395('0x47')]+0x1,'app':'close','appdata':_0x5395('0xab'),'interval':_0x5395('0xac')});}_0x43ccd9['interaction'][_0x5395('0xa9')]=!![];}return db[_0x5395('0x85')]['create']({'phone':_0x43ccd9[_0x5395('0x5a')]['from'],'messageId':_0x43ccd9[_0x5395('0x5a')][_0x5395('0x99')],'body':_0x43ccd9[_0x5395('0x5a')][_0x5395('0x5a')],'WhatsappAccountId':_0x196483['params']['id'],'WhatsappInteractionId':_0x39e0d9['id'],'direction':'in','ContactId':_0x39e0d9[_0x5395('0xad')],'AttachmentId':_0x43ccd9[_0x5395('0x5a')][_0x5395('0xae')]});})['then'](function(_0x10b897){_0x43ccd9[_0x5395('0x25')]=_0x10b897;if(_0x43ccd9[_0x5395('0xa8')][_0x5395('0xaf')]){return db[_0x5395('0x77')]['find']({'attributes':['id','name'],'where':{'id':_0x43ccd9[_0x5395('0xa8')][_0x5395('0xaf')]}})[_0x5395('0x1e')](function(_0x3fc49e){if(_0x3fc49e){_0x43ccd9[_0x5395('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5395('0xb0'),'appdata':_0x3fc49e[_0x5395('0x38')]+','+(_0x43ccd9['account'][_0x5395('0xb1')]||0xa),'interval':_0x5395('0xac')});}return respondWithRpcPromise('Start',_0x5395('0xb2'),_0x43ccd9);});}return respondWithRpcPromise(_0x5395('0xb3'),_0x5395('0xb2'),_0x43ccd9);})[_0x5395('0x1e')](function(_0x5ee450){if(_0x5ee450){var _0x1fbcca=0xc8;var _0x2f4f91='receiveMessage';logger[_0x5395('0x26')](_0x5395('0x21'),_0x2f4f91,_0x1fbcca,_0x5395('0xb4'));logger[_0x5395('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2f4f91,_0x1fbcca,_0x5395('0xb4'),JSON[_0x5395('0x23')](_0x5ee450));if(_0x43ccd9[_0x5395('0x81')][_0x5395('0x3f')]==='twilio'){return _0x1b1a73[_0x5395('0x2a')](_0x1fbcca)['set']('Content-Type',_0x5395('0xb5'))['send']('\x0a');}else{return _0x1b1a73[_0x5395('0x2a')](_0x1fbcca)['json'](_0x5ee450);}}});})[_0x5395('0x28')](handleError(_0x1b1a73,null));};exports['send']=function(_0x5659da,_0x1a1d9b,_0x278f8f){var _0x29f2fa,_0x156a88,_0x21baa6;if(_['isNil'](_0x5659da[_0x5395('0x5a')][_0x5395('0x5a')])||_0x5659da[_0x5395('0x5a')]['body']===''){throw new db['Sequelize'][(_0x5395('0x8e'))](_0x5395('0x9c'));}if(_[_0x5395('0x9b')](_0x5659da[_0x5395('0x5a')]['to'])){throw new db[(_0x5395('0x8d'))]['ValidationError'](_0x5395('0xb6'));}_0x29f2fa=_0x5659da[_0x5395('0x5a')]['to'];return db['WhatsappAccount'][_0x5395('0x59')]({'where':{'id':_0x5659da[_0x5395('0x57')]['id']},'include':[{'model':db[_0x5395('0xa1')],'as':_0x5395('0xb7'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x29f2fa},'limit':0x1,'order':[[_0x5395('0x92'),_0x5395('0xb8')]]}]}]})[_0x5395('0x1e')](handleEntityNotFound(_0x1a1d9b,null))['then'](function(_0x23ff9e){if(_0x23ff9e&&_0x23ff9e[_0x5395('0xb7')]){_0x156a88=_0x23ff9e[_0x5395('0x5c')]({'plain':!![]});if(_0x156a88[_0x5395('0xb7')]&&_0x156a88[_0x5395('0xb7')][_0x5395('0xa4')]['length']){return _0x156a88[_0x5395('0xb7')][_0x5395('0xa4')][0x0];}return db[_0x5395('0x8c')][_0x5395('0x62')](_[_0x5395('0xa5')](_0x5659da[_0x5395('0x5a')],{'firstName':_0x29f2fa,'mobile':_0x29f2fa,'phone':_0x29f2fa,'ListId':_0x156a88[_0x5395('0xa2')]}));}})[_0x5395('0x1e')](handleEntityNotFound(_0x1a1d9b,null))[_0x5395('0x1e')](function(_0x5167ec){if(_0x5167ec){_0x21baa6=_0x5167ec;return db[_0x5395('0xa7')][_0x5395('0x59')]({'where':{'ContactId':_0x21baa6['id'],'closed':![],'WhatsappAccountId':_0x156a88['id']}})[_0x5395('0x1e')](function(_0x7c9866){if(_0x7c9866){return[_0x7c9866,![]];}return db[_0x5395('0xa7')][_0x5395('0x62')]({'UserId':_0x5659da[_0x5395('0x5b')]['id'],'ContactId':_0x21baa6['id'],'WhatsappAccountId':_0x156a88['id'],'phone':_0x29f2fa,'firstMsgDirection':'out','Messages':[_['merge'](_0x5659da[_0x5395('0x5a')],{'read':![],'body':_0x5659da[_0x5395('0x5a')][_0x5395('0x5a')],'phone':_0x29f2fa,'WhatsappAccountId':_0x156a88['id'],'UserId':_0x5659da['user']['id'],'ContactId':_0x21baa6['id']})]},{'include':[{'model':db[_0x5395('0x85')],'as':_0x5395('0xb9')}]})[_0x5395('0x1e')](function(_0x15d775){return[_0x15d775,!![]];});});}})[_0x5395('0xba')](function(_0x7f398,_0x2aac3f){if(_0x2aac3f){return _0x7f398;}return db[_0x5395('0x85')][_0x5395('0x62')](_['merge'](_0x5659da[_0x5395('0x5a')],{'read':![],'body':_0x5659da[_0x5395('0x5a')]['body'],'phone':_0x29f2fa,'WhatsappAccountId':_0x156a88['id'],'WhatsappInteractionId':_0x7f398['id'],'UserId':_0x5659da[_0x5395('0x5b')]['id'],'ContactId':_0x21baa6['id']}))[_0x5395('0x1e')](function(_0x240a8b){_0x7f398[_0x5395('0xbb')]['Messages']=[];_0x7f398[_0x5395('0xbb')][_0x5395('0xb9')][_0x5395('0xaa')](_0x240a8b[_0x5395('0xbb')]);return _0x7f398;});})[_0x5395('0x1e')](respondWithResult(_0x1a1d9b,null))[_0x5395('0x28')](handleError(_0x1a1d9b,null));}; \ No newline at end of file +var _0xc71b=['includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','push','close','unmanaged','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','entity\x20found','stringify','text/xml','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','name','send','index','Pause','map','WhatsappAccount','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','mandatoryDispositionPause','rawAttributes','filters','find','create','body','role','user','WhatsappAccounts','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','order','findAll','removeDispositions','ids','addAnswer','getAnswers','hasOwnProperty','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x466f9f,_0x4d1211){var _0x30761a=function(_0x141e6b){while(--_0x141e6b){_0x466f9f['push'](_0x466f9f['shift']());}};_0x30761a(++_0x4d1211);}(_0xc71b,0xe6));var _0xbc71=function(_0x565723,_0x3d5753){_0x565723=_0x565723-0x0;var _0x50e24d=_0xc71b[_0x565723];return _0x50e24d;};'use strict';var emlformat=require(_0xbc71('0x0'));var rimraf=require(_0xbc71('0x1'));var zipdir=require(_0xbc71('0x2'));var jsonpatch=require(_0xbc71('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbc71('0x4'));var path=require(_0xbc71('0x5'));var sox=require(_0xbc71('0x6'));var csv=require(_0xbc71('0x7'));var ejs=require(_0xbc71('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc71('0x9'));var squel=require(_0xbc71('0xa'));var crypto=require(_0xbc71('0xb'));var jsforce=require(_0xbc71('0xc'));var deskjs=require(_0xbc71('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbc71('0xe'));var Papa=require(_0xbc71('0xf'));var Redis=require(_0xbc71('0x10'));var authService=require(_0xbc71('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbc71('0x12'));var hardwareService=require(_0xbc71('0x13'));var logger=require(_0xbc71('0x14'))(_0xbc71('0x15'));var utils=require(_0xbc71('0x16'));var config=require(_0xbc71('0x17'));var licenseUtil=require(_0xbc71('0x18'));var db=require(_0xbc71('0x19'))['db'];config['redis']=_[_0xbc71('0x1a')](config[_0xbc71('0x1b')],{'host':_0xbc71('0x1c'),'port':0x18eb});var socket=require(_0xbc71('0x1d'))(new Redis(config[_0xbc71('0x1b')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xbc71('0x1e'));var client=jayson[_0xbc71('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1289b9,_0x597f90,_0x1bd6fd,_0x4cfc48){return new BPromise(function(_0x325511,_0x3cc13a){var _0x35c6bb=_0x4cfc48||client;return _0x35c6bb[_0xbc71('0x20')](_0x1289b9,_0x1bd6fd)[_0xbc71('0x21')](function(_0x420ece){logger[_0xbc71('0x22')](_0xbc71('0x23'),_0x597f90,_0xbc71('0x24'));logger[_0xbc71('0x25')](_0xbc71('0x26'),_0x597f90,_0xbc71('0x24'),JSON['stringify'](_0x420ece));if(_0x420ece[_0xbc71('0x27')]){if(_0x420ece['error'][_0xbc71('0x28')]===0x1f4){logger[_0xbc71('0x27')](_0xbc71('0x23'),_0x597f90,_0x420ece[_0xbc71('0x27')][_0xbc71('0x29')]);return _0x3cc13a(_0x420ece['error'][_0xbc71('0x29')]);}logger['error'](_0xbc71('0x23'),_0x597f90,_0x420ece['error'][_0xbc71('0x29')]);return _0x325511(_0x420ece[_0xbc71('0x27')]['message']);}else{logger[_0xbc71('0x22')](_0xbc71('0x23'),_0x597f90,_0xbc71('0x24'));_0x325511(_0x420ece[_0xbc71('0x2a')][_0xbc71('0x29')]);}})[_0xbc71('0x2b')](function(_0x9a44d5){logger[_0xbc71('0x27')](_0xbc71('0x23'),_0x597f90,_0x9a44d5);_0x3cc13a(_0x9a44d5);});});}function respondWithStatusCode(_0x4d27c9,_0x4387a9){_0x4387a9=_0x4387a9||0xcc;return function(_0x28c000){if(_0x28c000){return _0x4d27c9[_0xbc71('0x2c')](_0x4387a9);}return _0x4d27c9[_0xbc71('0x2d')](_0x4387a9)[_0xbc71('0x2e')]();};}function respondWithResult(_0x37a55f,_0x1fc358){_0x1fc358=_0x1fc358||0xc8;return function(_0x50099a){if(_0x50099a){return _0x37a55f[_0xbc71('0x2d')](_0x1fc358)['json'](_0x50099a);}};}function respondWithFilteredResult(_0x2c2d35,_0x5d9c62){return function(_0x4ea327){if(_0x4ea327){var _0x1141db=typeof _0x5d9c62[_0xbc71('0x2f')]===_0xbc71('0x30')&&typeof _0x5d9c62[_0xbc71('0x31')]===_0xbc71('0x30');var _0x12a98d=_0x4ea327['count'];var _0xf70b9c=_0x1141db?0x0:_0x5d9c62['offset'];var _0x50786d=_0x1141db?_0x4ea327[_0xbc71('0x32')]:_0x5d9c62[_0xbc71('0x2f')]+_0x5d9c62[_0xbc71('0x31')];var _0x268259;if(_0x50786d>=_0x12a98d){_0x50786d=_0x12a98d;_0x268259=0xc8;}else{_0x268259=0xce;}_0x2c2d35['status'](_0x268259);return _0x2c2d35[_0xbc71('0x33')](_0xbc71('0x34'),_0xf70b9c+'-'+_0x50786d+'/'+_0x12a98d)[_0xbc71('0x35')](_0x4ea327);}return null;};}function patchUpdates(_0x49dda7){return function(_0x5ba23f){try{jsonpatch[_0xbc71('0x36')](_0x5ba23f,_0x49dda7,!![]);}catch(_0x5eaebd){return BPromise[_0xbc71('0x37')](_0x5eaebd);}return _0x5ba23f[_0xbc71('0x38')]();};}function saveUpdates(_0x47a662,_0x4530e6){return function(_0x43422f){if(_0x43422f){return _0x43422f['update'](_0x47a662)[_0xbc71('0x21')](function(_0x3b06d3){return _0x3b06d3;});}return null;};}function removeEntity(_0x3224ae,_0x46411c){return function(_0x2d645f){if(_0x2d645f){return _0x2d645f[_0xbc71('0x39')]()[_0xbc71('0x21')](function(){var _0x47a60e=_0x2d645f[_0xbc71('0x3a')]({'plain':!![]});var _0x340482='WhatsappAccounts';return db['UserProfileResource'][_0xbc71('0x39')]({'where':{'type':_0x340482,'resourceId':_0x47a60e['id']}})[_0xbc71('0x21')](function(){return _0x2d645f;});})[_0xbc71('0x21')](function(){_0x3224ae[_0xbc71('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fe14f,_0x1968bb){return function(_0x837848){if(!_0x837848){_0x3fe14f[_0xbc71('0x2c')](0x194);}return _0x837848;};}function handleError(_0x24fd49,_0x2d799f){_0x2d799f=_0x2d799f||0x1f4;return function(_0x2845f6){logger[_0xbc71('0x27')](_0x2845f6['stack']);if(_0x2845f6[_0xbc71('0x3b')]){delete _0x2845f6[_0xbc71('0x3b')];}_0x24fd49[_0xbc71('0x2d')](_0x2d799f)[_0xbc71('0x3c')](_0x2845f6);};}exports[_0xbc71('0x3d')]=function(_0xc8882d,_0x411fdf){var _0x5acd01={'include':[{'model':db[_0xbc71('0x3e')],'as':'mandatoryDispositionPause'}]},_0x324ab7={},_0x281fc5={'count':0x0,'rows':[]};var _0x3c7153=_[_0xbc71('0x3f')](db[_0xbc71('0x40')]['rawAttributes'],function(_0x4a0748){return{'name':_0x4a0748['fieldName'],'type':_0x4a0748[_0xbc71('0x41')][_0xbc71('0x42')]};});_0x324ab7[_0xbc71('0x43')]=_[_0xbc71('0x3f')](_0x3c7153,'name');_0x324ab7[_0xbc71('0x44')]=_[_0xbc71('0x45')](_0xc8882d[_0xbc71('0x44')]);_0x324ab7['filters']=_['intersection'](_0x324ab7[_0xbc71('0x43')],_0x324ab7[_0xbc71('0x44')]);_0x5acd01[_0xbc71('0x46')]=_[_0xbc71('0x47')](_0x324ab7[_0xbc71('0x43')],qs['fields'](_0xc8882d[_0xbc71('0x44')][_0xbc71('0x48')]));_0x5acd01[_0xbc71('0x46')]=_0x5acd01[_0xbc71('0x46')][_0xbc71('0x49')]?_0x5acd01[_0xbc71('0x46')]:_0x324ab7[_0xbc71('0x43')];if(!_0xc8882d[_0xbc71('0x44')]['hasOwnProperty'](_0xbc71('0x4a'))){_0x5acd01[_0xbc71('0x31')]=qs['limit'](_0xc8882d[_0xbc71('0x44')][_0xbc71('0x31')]);_0x5acd01['offset']=qs[_0xbc71('0x2f')](_0xc8882d[_0xbc71('0x44')]['offset']);}_0x5acd01['order']=qs[_0xbc71('0x4b')](_0xc8882d[_0xbc71('0x44')]['sort']);_0x5acd01[_0xbc71('0x4c')]=qs['filters'](_[_0xbc71('0x4d')](_0xc8882d[_0xbc71('0x44')],_0x324ab7['filters']),_0x3c7153);if(_0xc8882d[_0xbc71('0x44')][_0xbc71('0x4e')]){_0x5acd01['where']=_[_0xbc71('0x4f')](_0x5acd01[_0xbc71('0x4c')],{'$or':_[_0xbc71('0x3f')](_0x3c7153,function(_0x174b9a){if(_0x174b9a[_0xbc71('0x41')]!==_0xbc71('0x50')){var _0x48c56b={};_0x48c56b[_0x174b9a[_0xbc71('0x3b')]]={'$like':'%'+_0xc8882d[_0xbc71('0x44')][_0xbc71('0x4e')]+'%'};return _0x48c56b;}})});}_0x5acd01=_['merge']({},_0x5acd01,_0xc8882d[_0xbc71('0x51')]);var _0x53749d={'where':_0x5acd01[_0xbc71('0x4c')]};return db['WhatsappAccount']['count'](_0x53749d)['then'](function(_0x24a8a1){_0x281fc5[_0xbc71('0x32')]=_0x24a8a1;if(_0xc8882d[_0xbc71('0x44')][_0xbc71('0x52')]){_0x5acd01[_0xbc71('0x53')]=[{'all':!![]}];}return db[_0xbc71('0x40')]['findAll'](_0x5acd01);})[_0xbc71('0x21')](function(_0x378fe2){_0x281fc5[_0xbc71('0x54')]=_0x378fe2;return _0x281fc5;})[_0xbc71('0x21')](respondWithFilteredResult(_0x411fdf,_0x5acd01))['catch'](handleError(_0x411fdf,null));};exports[_0xbc71('0x55')]=function(_0x3a3c54,_0xaf1657){var _0x35920e={'raw':![],'where':{'id':_0x3a3c54['params']['id']},'include':[{'model':db['Pause'],'as':_0xbc71('0x56')}]},_0x4fecc7={};_0x4fecc7[_0xbc71('0x43')]=_[_0xbc71('0x45')](db['WhatsappAccount'][_0xbc71('0x57')]);_0x4fecc7[_0xbc71('0x44')]=_[_0xbc71('0x45')](_0x3a3c54[_0xbc71('0x44')]);_0x4fecc7[_0xbc71('0x58')]=_[_0xbc71('0x47')](_0x4fecc7[_0xbc71('0x43')],_0x4fecc7[_0xbc71('0x44')]);_0x35920e[_0xbc71('0x46')]=_[_0xbc71('0x47')](_0x4fecc7[_0xbc71('0x43')],qs['fields'](_0x3a3c54[_0xbc71('0x44')][_0xbc71('0x48')]));_0x35920e[_0xbc71('0x46')]=_0x35920e['attributes'][_0xbc71('0x49')]?_0x35920e[_0xbc71('0x46')]:_0x4fecc7[_0xbc71('0x43')];if(_0x3a3c54[_0xbc71('0x44')][_0xbc71('0x52')]){_0x35920e[_0xbc71('0x53')]=[{'all':!![]}];}_0x35920e=_['merge']({},_0x35920e,_0x3a3c54[_0xbc71('0x51')]);return db[_0xbc71('0x40')][_0xbc71('0x59')](_0x35920e)['then'](handleEntityNotFound(_0xaf1657,null))['then'](respondWithResult(_0xaf1657,null))['catch'](handleError(_0xaf1657,null));};exports[_0xbc71('0x5a')]=function(_0x59d942,_0x16070a){return db[_0xbc71('0x40')][_0xbc71('0x5a')](_0x59d942[_0xbc71('0x5b')],{})['then'](function(_0x6dc3a){var _0x2202b8=_0x59d942['user'][_0xbc71('0x3a')]({'plain':!![]});if(!_0x2202b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2202b8[_0xbc71('0x5c')]===_0xbc71('0x5d')){var _0x3e4935=_0x6dc3a[_0xbc71('0x3a')]({'plain':!![]});var _0x4aae7b=_0xbc71('0x5e');return db[_0xbc71('0x5f')]['find']({'where':{'name':_0x4aae7b,'userProfileId':_0x2202b8['userProfileId']},'raw':!![]})[_0xbc71('0x21')](function(_0x18c641){if(_0x18c641&&_0x18c641[_0xbc71('0x60')]===0x0){return db[_0xbc71('0x61')][_0xbc71('0x5a')]({'name':_0x3e4935[_0xbc71('0x3b')],'resourceId':_0x3e4935['id'],'type':_0x18c641[_0xbc71('0x3b')],'sectionId':_0x18c641['id']},{})[_0xbc71('0x21')](function(){return _0x6dc3a;});}else{return _0x6dc3a;}})[_0xbc71('0x2b')](function(_0x4833a7){logger[_0xbc71('0x27')](_0xbc71('0x62'),_0x4833a7);throw _0x4833a7;});}return _0x6dc3a;})['then'](respondWithResult(_0x16070a,0xc9))[_0xbc71('0x2b')](handleError(_0x16070a,null));};exports[_0xbc71('0x63')]=function(_0x372a91,_0x1c0725){if(_0x372a91['body']['id']){delete _0x372a91['body']['id'];}return db['WhatsappAccount'][_0xbc71('0x59')]({'where':{'id':_0x372a91[_0xbc71('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xbc71('0x56')}]})[_0xbc71('0x21')](handleEntityNotFound(_0x1c0725,null))[_0xbc71('0x21')](saveUpdates(_0x372a91[_0xbc71('0x5b')],null))[_0xbc71('0x21')](respondWithResult(_0x1c0725,null))[_0xbc71('0x2b')](handleError(_0x1c0725,null));};exports[_0xbc71('0x39')]=function(_0x4e955a,_0x28be8e){return db[_0xbc71('0x40')]['find']({'where':{'id':_0x4e955a[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x28be8e,null))[_0xbc71('0x21')](removeEntity(_0x28be8e,null))['catch'](handleError(_0x28be8e,null));};exports[_0xbc71('0x65')]=function(_0xd5b647,_0x42a49e){return db[_0xbc71('0x40')][_0xbc71('0x65')]()[_0xbc71('0x21')](respondWithResult(_0x42a49e,null))[_0xbc71('0x2b')](handleError(_0x42a49e,null));};exports[_0xbc71('0x66')]=function(_0xaac54f,_0x2bbfbf,_0x22a24d){if(_0xaac54f[_0xbc71('0x5b')]['id']){delete _0xaac54f[_0xbc71('0x5b')]['id'];}return db[_0xbc71('0x40')][_0xbc71('0x59')]({'where':{'id':_0xaac54f[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x2bbfbf,null))[_0xbc71('0x21')](function(_0x7c7642){if(_0x7c7642){_0xaac54f[_0xbc71('0x5b')][_0xbc71('0x67')]=_0x7c7642['id'];return db['Disposition'][_0xbc71('0x5a')](_0xaac54f[_0xbc71('0x5b')]);}})[_0xbc71('0x21')](respondWithResult(_0x2bbfbf,null))[_0xbc71('0x2b')](handleError(_0x2bbfbf,null));};exports[_0xbc71('0x68')]=function(_0x4d443e,_0x6989ea,_0x19e75f){var _0x1a174c={'raw':![],'where':{}};var _0xb0d903={};var _0x27a682={'count':0x0,'rows':[]};return db[_0xbc71('0x40')][_0xbc71('0x69')]({'where':{'id':_0x4d443e[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x6989ea,null))[_0xbc71('0x21')](function(_0x3c2970){if(_0x3c2970){_0xb0d903[_0xbc71('0x43')]=_[_0xbc71('0x45')](db[_0xbc71('0x6a')]['rawAttributes']);_0xb0d903[_0xbc71('0x44')]=_[_0xbc71('0x45')](_0x4d443e[_0xbc71('0x44')]);_0xb0d903[_0xbc71('0x58')]=_[_0xbc71('0x47')](_0xb0d903[_0xbc71('0x43')],_0xb0d903[_0xbc71('0x44')]);_0x1a174c['attributes']=_[_0xbc71('0x47')](_0xb0d903[_0xbc71('0x43')],qs[_0xbc71('0x48')](_0x4d443e[_0xbc71('0x44')][_0xbc71('0x48')]));_0x1a174c[_0xbc71('0x46')]=_0x1a174c[_0xbc71('0x46')][_0xbc71('0x49')]?_0x1a174c[_0xbc71('0x46')]:_0xb0d903[_0xbc71('0x43')];if(!_0x4d443e['query']['hasOwnProperty'](_0xbc71('0x4a'))){_0x1a174c[_0xbc71('0x31')]=qs[_0xbc71('0x31')](_0x4d443e['query']['limit']);_0x1a174c[_0xbc71('0x2f')]=qs[_0xbc71('0x2f')](_0x4d443e[_0xbc71('0x44')][_0xbc71('0x2f')]);}_0x1a174c[_0xbc71('0x6b')]=qs[_0xbc71('0x4b')](_0x4d443e['query'][_0xbc71('0x4b')]);_0x1a174c[_0xbc71('0x4c')]=qs[_0xbc71('0x58')](_['pick'](_0x4d443e['query'],_0xb0d903[_0xbc71('0x58')]));_0x1a174c[_0xbc71('0x4c')][_0xbc71('0x67')]=_0x3c2970['id'];if(_0x4d443e['query']['filter']){_0x1a174c['where']=_[_0xbc71('0x4f')](_0x1a174c['where'],{'$or':_[_0xbc71('0x3f')](_0x1a174c[_0xbc71('0x46')],function(_0x2d2f77){var _0x50529f={};_0x50529f[_0x2d2f77]={'$like':'%'+_0x4d443e[_0xbc71('0x44')][_0xbc71('0x4e')]+'%'};return _0x50529f;})});}_0x1a174c=_[_0xbc71('0x4f')]({},_0x1a174c,_0x4d443e[_0xbc71('0x51')]);return db['Disposition'][_0xbc71('0x32')]({'where':_0x1a174c[_0xbc71('0x4c')]})[_0xbc71('0x21')](function(_0xa5fe6c){_0x27a682[_0xbc71('0x32')]=_0xa5fe6c;if(_0x4d443e[_0xbc71('0x44')]['includeAll']){_0x1a174c[_0xbc71('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xbc71('0x6c')](_0x1a174c);})['then'](function(_0x19e5da){_0x27a682[_0xbc71('0x54')]=_0x19e5da;return _0x27a682;});}})[_0xbc71('0x21')](respondWithFilteredResult(_0x6989ea,_0x1a174c))[_0xbc71('0x2b')](handleError(_0x6989ea,null));};exports['removeDispositions']=function(_0x1e3b73,_0x416686,_0xb9fdd6){return db[_0xbc71('0x40')]['find']({'where':{'id':_0x1e3b73['params']['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x416686,null))[_0xbc71('0x21')](function(_0x476209){if(_0x476209){return _0x476209[_0xbc71('0x6d')](_0x1e3b73[_0xbc71('0x44')][_0xbc71('0x6e')]);}})[_0xbc71('0x21')](respondWithStatusCode(_0x416686,null))[_0xbc71('0x2b')](handleError(_0x416686,null));};exports[_0xbc71('0x6f')]=function(_0x1cf424,_0x55d02d,_0x44857c){if(_0x1cf424[_0xbc71('0x5b')]['id']){delete _0x1cf424[_0xbc71('0x5b')]['id'];}return db['WhatsappAccount'][_0xbc71('0x59')]({'where':{'id':_0x1cf424[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x55d02d,null))[_0xbc71('0x21')](function(_0x55f614){if(_0x55f614){_0x1cf424[_0xbc71('0x5b')][_0xbc71('0x67')]=_0x55f614['id'];return db['CannedAnswer']['create'](_0x1cf424['body']);}})[_0xbc71('0x21')](respondWithResult(_0x55d02d,null))[_0xbc71('0x2b')](handleError(_0x55d02d,null));};exports[_0xbc71('0x70')]=function(_0x24248f,_0x254945,_0x2d47dd){var _0x1ed3b4={'raw':![],'where':{}};var _0x210f1e={};var _0x3bfa04={'count':0x0,'rows':[]};return db[_0xbc71('0x40')]['findOne']({'where':{'id':_0x24248f[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x254945,null))[_0xbc71('0x21')](function(_0x461515){if(_0x461515){_0x210f1e[_0xbc71('0x43')]=_['keys'](db['CannedAnswer'][_0xbc71('0x57')]);_0x210f1e[_0xbc71('0x44')]=_[_0xbc71('0x45')](_0x24248f[_0xbc71('0x44')]);_0x210f1e['filters']=_[_0xbc71('0x47')](_0x210f1e['model'],_0x210f1e['query']);_0x1ed3b4['attributes']=_[_0xbc71('0x47')](_0x210f1e['model'],qs[_0xbc71('0x48')](_0x24248f[_0xbc71('0x44')][_0xbc71('0x48')]));_0x1ed3b4[_0xbc71('0x46')]=_0x1ed3b4[_0xbc71('0x46')][_0xbc71('0x49')]?_0x1ed3b4[_0xbc71('0x46')]:_0x210f1e[_0xbc71('0x43')];if(!_0x24248f[_0xbc71('0x44')][_0xbc71('0x71')](_0xbc71('0x4a'))){_0x1ed3b4[_0xbc71('0x31')]=qs[_0xbc71('0x31')](_0x24248f[_0xbc71('0x44')][_0xbc71('0x31')]);_0x1ed3b4[_0xbc71('0x2f')]=qs[_0xbc71('0x2f')](_0x24248f[_0xbc71('0x44')]['offset']);}_0x1ed3b4[_0xbc71('0x6b')]=qs['sort'](_0x24248f[_0xbc71('0x44')][_0xbc71('0x4b')]);_0x1ed3b4[_0xbc71('0x4c')]=qs[_0xbc71('0x58')](_[_0xbc71('0x4d')](_0x24248f[_0xbc71('0x44')],_0x210f1e[_0xbc71('0x58')]));_0x1ed3b4['where'][_0xbc71('0x67')]=_0x461515['id'];if(_0x24248f[_0xbc71('0x44')][_0xbc71('0x4e')]){_0x1ed3b4[_0xbc71('0x4c')]=_[_0xbc71('0x4f')](_0x1ed3b4['where'],{'$or':_[_0xbc71('0x3f')](_0x1ed3b4[_0xbc71('0x46')],function(_0x24d033){var _0x12d887={};_0x12d887[_0x24d033]={'$like':'%'+_0x24248f[_0xbc71('0x44')][_0xbc71('0x4e')]+'%'};return _0x12d887;})});}_0x1ed3b4=_['merge']({},_0x1ed3b4,_0x24248f[_0xbc71('0x51')]);return db['CannedAnswer'][_0xbc71('0x32')]({'where':_0x1ed3b4['where']})[_0xbc71('0x21')](function(_0x254cf9){_0x3bfa04[_0xbc71('0x32')]=_0x254cf9;if(_0x24248f[_0xbc71('0x44')][_0xbc71('0x52')]){_0x1ed3b4[_0xbc71('0x53')]=[{'all':!![]}];}return db[_0xbc71('0x72')][_0xbc71('0x6c')](_0x1ed3b4);})[_0xbc71('0x21')](function(_0x3e86de){_0x3bfa04[_0xbc71('0x54')]=_0x3e86de;return _0x3bfa04;});}})['then'](respondWithFilteredResult(_0x254945,_0x1ed3b4))[_0xbc71('0x2b')](handleError(_0x254945,null));};exports['removeAnswers']=function(_0x77b7f9,_0x5cd514,_0x1d4bcb){return db['WhatsappAccount'][_0xbc71('0x59')]({'where':{'id':_0x77b7f9[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x5cd514,null))[_0xbc71('0x21')](function(_0xfb9a76){if(_0xfb9a76){return _0xfb9a76[_0xbc71('0x73')](_0x77b7f9[_0xbc71('0x44')][_0xbc71('0x6e')]);}})[_0xbc71('0x21')](respondWithStatusCode(_0x5cd514,null))[_0xbc71('0x2b')](handleError(_0x5cd514,null));};exports[_0xbc71('0x74')]=function(_0x4afb78,_0x2ab4c5,_0x8fe571){return db[_0xbc71('0x40')][_0xbc71('0x59')]({'where':{'id':_0x4afb78[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x2ab4c5,null))['then'](function(_0x30fbb5){if(_0x30fbb5){return _0x30fbb5[_0xbc71('0x74')](_0x4afb78[_0xbc71('0x5b')][_0xbc71('0x6e')],_[_0xbc71('0x75')](_0x4afb78['body'],[_0xbc71('0x6e'),'id'])||{})['spread'](function(_0x4f46f3){for(var _0x532c8c=0x0;_0x532c8c<_0x4afb78[_0xbc71('0x5b')][_0xbc71('0x6e')][_0xbc71('0x49')];_0x532c8c+=0x1){socket[_0xbc71('0x76')](_0xbc71('0x77'),{'UserId':Number(_0x4afb78[_0xbc71('0x5b')]['ids'][_0x532c8c]),'WhatsappAccountId':Number(_0x4afb78['params']['id'])});}return _0x4f46f3;});}})[_0xbc71('0x21')](respondWithResult(_0x2ab4c5,null))[_0xbc71('0x2b')](handleError(_0x2ab4c5,null));};exports[_0xbc71('0x78')]=function(_0x451078,_0x417f2b,_0x173b53){return db[_0xbc71('0x40')]['find']({'where':{'id':_0x451078[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x417f2b,null))[_0xbc71('0x21')](function(_0x3a3049){if(_0x3a3049){return _0x3a3049[_0xbc71('0x78')](_0x451078[_0xbc71('0x44')][_0xbc71('0x6e')])['then'](function(){if(_['isArray'](_0x451078['query'][_0xbc71('0x6e')])){for(var _0x7de6b4=0x0;_0x7de6b4<_0x451078[_0xbc71('0x44')][_0xbc71('0x6e')]['length'];_0x7de6b4+=0x1){socket[_0xbc71('0x76')](_0xbc71('0x79'),{'UserId':Number(_0x451078['query'][_0xbc71('0x6e')][_0x7de6b4]),'WhatsappAccountId':Number(_0x451078[_0xbc71('0x64')]['id'])});}}else{socket[_0xbc71('0x76')](_0xbc71('0x79'),{'UserId':Number(_0x451078[_0xbc71('0x44')][_0xbc71('0x6e')]),'WhatsappAccountId':Number(_0x451078[_0xbc71('0x64')]['id'])});}});}})[_0xbc71('0x21')](respondWithStatusCode(_0x417f2b,null))[_0xbc71('0x2b')](handleError(_0x417f2b,null));};exports[_0xbc71('0x7a')]=function(_0x188a07,_0x4f233e,_0x533365){var _0x4fc2c1={};var _0x4bea8b={};var _0x36e8cf;var _0x1a85ef;return db[_0xbc71('0x40')][_0xbc71('0x69')]({'where':{'id':_0x188a07[_0xbc71('0x64')]['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x4f233e,null))[_0xbc71('0x21')](function(_0x54085a){if(_0x54085a){_0x36e8cf=_0x54085a;_0x4bea8b['model']=_[_0xbc71('0x45')](db['User'][_0xbc71('0x57')]);_0x4bea8b[_0xbc71('0x44')]=_['keys'](_0x188a07[_0xbc71('0x44')]);_0x4bea8b[_0xbc71('0x58')]=_[_0xbc71('0x47')](_0x4bea8b[_0xbc71('0x43')],_0x4bea8b[_0xbc71('0x44')]);_0x4fc2c1[_0xbc71('0x46')]=_['intersection'](_0x4bea8b[_0xbc71('0x43')],qs[_0xbc71('0x48')](_0x188a07[_0xbc71('0x44')][_0xbc71('0x48')]));_0x4fc2c1[_0xbc71('0x46')]=_0x4fc2c1[_0xbc71('0x46')][_0xbc71('0x49')]?_0x4fc2c1[_0xbc71('0x46')]:_0x4bea8b[_0xbc71('0x43')];_0x4fc2c1[_0xbc71('0x6b')]=qs[_0xbc71('0x4b')](_0x188a07[_0xbc71('0x44')][_0xbc71('0x4b')]);_0x4fc2c1[_0xbc71('0x4c')]=qs[_0xbc71('0x58')](_[_0xbc71('0x4d')](_0x188a07[_0xbc71('0x44')],_0x4bea8b['filters']));if(_0x188a07[_0xbc71('0x44')]['filter']){_0x4fc2c1[_0xbc71('0x4c')]=_['merge'](_0x4fc2c1[_0xbc71('0x4c')],{'$or':_[_0xbc71('0x3f')](_0x4fc2c1[_0xbc71('0x46')],function(_0x41e60d){var _0x5d8dd1={};_0x5d8dd1[_0x41e60d]={'$like':'%'+_0x188a07[_0xbc71('0x44')][_0xbc71('0x4e')]+'%'};return _0x5d8dd1;})});}_0x4fc2c1=_[_0xbc71('0x4f')]({},_0x4fc2c1,_0x188a07['options']);return _0x36e8cf[_0xbc71('0x7a')](_0x4fc2c1);}})[_0xbc71('0x21')](function(_0x15da1d){if(_0x15da1d){_0x1a85ef=_0x15da1d[_0xbc71('0x49')];if(!_0x188a07[_0xbc71('0x44')][_0xbc71('0x71')](_0xbc71('0x4a'))){_0x4fc2c1[_0xbc71('0x31')]=qs[_0xbc71('0x31')](_0x188a07['query'][_0xbc71('0x31')]);_0x4fc2c1[_0xbc71('0x2f')]=qs['offset'](_0x188a07['query']['offset']);}return _0x36e8cf[_0xbc71('0x7a')](_0x4fc2c1);}})[_0xbc71('0x21')](function(_0x5abe55){if(_0x5abe55){return _0x5abe55?{'count':_0x1a85ef,'rows':_0x5abe55}:null;}})[_0xbc71('0x21')](respondWithResult(_0x4f233e,null))['catch'](handleError(_0x4f233e,null));};exports['addApplications']=function(_0x2be68e,_0x215ef8){var _0x43d1b8=_0x2be68e[_0xbc71('0x64')]['id'];var _0x50daa1=_0x2be68e[_0xbc71('0x5b')];var _0x3d2c46=0xc8;var _0x4b369b=null;return db[_0xbc71('0x7b')][_0xbc71('0x7c')]({'isolationLevel':db['sequelize'][_0xbc71('0x7d')][_0xbc71('0x7e')][_0xbc71('0x7f')]},function(_0x27364f){return db['WhatsappAccount'][_0xbc71('0x69')]({'where':{'id':_0x43d1b8},'transaction':_0x27364f})['then'](function(_0x3c8b99){if(_0x3c8b99){return db[_0xbc71('0x80')]['destroy']({'where':{'WhatsappAccountId':_0x43d1b8},'transaction':_0x27364f})[_0xbc71('0x21')](function(){var _0x241b49=_['map'](_0x50daa1,function(_0x536854){_0x536854['WhatsappAccountId']=_0x43d1b8;return _0x536854;});return db[_0xbc71('0x80')][_0xbc71('0x81')](_0x241b49,{'transaction':_0x27364f});});}else{_0x3d2c46=0x194;_0x4b369b=[];}});})[_0xbc71('0x21')](function(){if(_0x3d2c46!==0x194){return db[_0xbc71('0x80')][_0xbc71('0x82')]({'where':{'WhatsappAccountId':_0x43d1b8},'order':_0xbc71('0x83')})['then'](function(_0x5a5dda){_0x4b369b=_0x5a5dda;});}})[_0xbc71('0x2b')](function(_0x23cb7d){_0x3d2c46=0x1f4;logger[_0xbc71('0x27')](_0x23cb7d[_0xbc71('0x84')]);if(_0x23cb7d[_0xbc71('0x3b')]){delete _0x23cb7d[_0xbc71('0x3b')];}_0x4b369b=_0x23cb7d;})[_0xbc71('0x85')](function(){if(_0x4b369b===null){_0x215ef8[_0xbc71('0x2c')](_0x3d2c46);}else{if(_0x3d2c46===0x1f4){_0x215ef8[_0xbc71('0x2d')](_0x3d2c46)[_0xbc71('0x3c')](_0x4b369b);}else{_0x215ef8[_0xbc71('0x2d')](_0x3d2c46)[_0xbc71('0x35')](_0x4b369b);}}});};exports[_0xbc71('0x86')]=function(_0x235bb8,_0x9ae2f6,_0x593b06){var _0x4931ed={};var _0x2c27d0={};var _0x729beb;var _0x3fed8e;return db[_0xbc71('0x40')]['findOne']({'where':{'id':_0x235bb8['params']['id']}})[_0xbc71('0x21')](handleEntityNotFound(_0x9ae2f6,null))[_0xbc71('0x21')](function(_0x15d192){if(_0x15d192){_0x729beb=_0x15d192;_0x2c27d0[_0xbc71('0x43')]=_[_0xbc71('0x45')](db[_0xbc71('0x80')][_0xbc71('0x57')]);_0x2c27d0[_0xbc71('0x44')]=_['keys'](_0x235bb8[_0xbc71('0x44')]);_0x2c27d0[_0xbc71('0x58')]=_['intersection'](_0x2c27d0[_0xbc71('0x43')],_0x2c27d0[_0xbc71('0x44')]);_0x4931ed['attributes']=_[_0xbc71('0x47')](_0x2c27d0[_0xbc71('0x43')],qs['fields'](_0x235bb8[_0xbc71('0x44')][_0xbc71('0x48')]));_0x4931ed['attributes']=_0x4931ed[_0xbc71('0x46')][_0xbc71('0x49')]?_0x4931ed['attributes']:_0x2c27d0['model'];_0x4931ed[_0xbc71('0x6b')]=qs['sort'](_0x235bb8[_0xbc71('0x44')][_0xbc71('0x4b')]);_0x4931ed[_0xbc71('0x4c')]=qs[_0xbc71('0x58')](_[_0xbc71('0x4d')](_0x235bb8['query'],_0x2c27d0[_0xbc71('0x58')]));if(_0x235bb8[_0xbc71('0x44')][_0xbc71('0x4e')]){_0x4931ed['where']=_[_0xbc71('0x4f')](_0x4931ed[_0xbc71('0x4c')],{'$or':_['map'](_0x4931ed[_0xbc71('0x46')],function(_0x26e5be){var _0x498045={};_0x498045[_0x26e5be]={'$like':'%'+_0x235bb8['query'][_0xbc71('0x4e')]+'%'};return _0x498045;})});}_0x4931ed=_[_0xbc71('0x4f')]({},_0x4931ed,_0x235bb8[_0xbc71('0x51')]);return _0x729beb[_0xbc71('0x86')](_0x4931ed);}})[_0xbc71('0x21')](function(_0x3c568a){if(_0x3c568a){_0x3fed8e=_0x3c568a[_0xbc71('0x49')];if(!_0x235bb8[_0xbc71('0x44')]['hasOwnProperty'](_0xbc71('0x4a'))){_0x4931ed[_0xbc71('0x31')]=qs[_0xbc71('0x31')](_0x235bb8[_0xbc71('0x44')]['limit']);_0x4931ed['offset']=qs[_0xbc71('0x2f')](_0x235bb8['query'][_0xbc71('0x2f')]);}return _0x729beb['getApplications'](_0x4931ed);}})[_0xbc71('0x21')](function(_0x7a2338){if(_0x7a2338){return _0x7a2338?{'count':_0x3fed8e,'rows':_0x7a2338}:null;}})['then'](respondWithResult(_0x9ae2f6,null))['catch'](handleError(_0x9ae2f6,null));};exports['notify']=function(_0x17b87c,_0x317cea,_0x3f4d25){var _0x231fc0={'channel':_0xbc71('0x87')};var _0x5323a5=[];var _0x764381=[];var _0x26e88a={};return db[_0xbc71('0x40')][_0xbc71('0x59')]({'where':{'id':_0x17b87c[_0xbc71('0x64')]['id']},'include':[{'model':db[_0xbc71('0x80')],'as':_0xbc71('0x88')}]})[_0xbc71('0x21')](handleEntityNotFound(_0x317cea,null))[_0xbc71('0x21')](function(_0xbf20fc){_0x231fc0[_0xbc71('0x89')]=_0xbf20fc;if(_0x231fc0[_0xbc71('0x89')]&&_0x231fc0[_0xbc71('0x89')][_0xbc71('0x41')]===_0xbc71('0x8a')&&_0x17b87c[_0xbc71('0x5b')]['statuses']){if(_0x17b87c['body'][_0xbc71('0x8b')]['length']===0x0)return;if(_0x17b87c[_0xbc71('0x5b')][_0xbc71('0x8b')][0x0][_0xbc71('0x8c')]!==_0xbc71('0x8d'))return;return db[_0xbc71('0x8e')]['update']({'read':!![],'readAt':_0x17b87c[_0xbc71('0x5b')][_0xbc71('0x8b')][0x0][_0xbc71('0x8f')]},{'where':{'messageId':_0x17b87c['body']['statuses'][0x0][_0xbc71('0x90')]},'individualHooks':!![]})[_0xbc71('0x21')](function(_0x147ec8){return _0x317cea[_0xbc71('0x2d')](0xc8)[_0xbc71('0x35')](_0x147ec8);});}_0x231fc0[_0xbc71('0x91')]=_[_0xbc71('0x92')](_0xbf20fc['Applications'],['priority'],[_0xbc71('0x93')]);if(_0x231fc0[_0xbc71('0x89')]['Applications']){delete _0x231fc0['account'][_0xbc71('0x88')];}return db[_0xbc71('0x94')]['describe']()[_0xbc71('0x21')](function(_0x4ddf0f){if(!_0x4ddf0f){throw new db[(_0xbc71('0x95'))]['ValidationError'](_0xbc71('0x96'));}_0x5323a5=_[_0xbc71('0x97')](_[_0xbc71('0x45')](_0x4ddf0f),[_0xbc71('0x98'),'updatedAt']);_0x764381=_[_0xbc71('0x97')](_[_0xbc71('0x45')](_0x4ddf0f),[_0xbc71('0x98'),_0xbc71('0x99'),_0xbc71('0x9a'),_0xbc71('0x9b')]);_0x231fc0[_0xbc71('0x5b')]={'mapKey':_0xbc71('0x9c')};if(_0x231fc0[_0xbc71('0x89')]&&_0x231fc0['account'][_0xbc71('0x41')]===_0xbc71('0x9d')){_0x231fc0[_0xbc71('0x5b')]['from']=_0x17b87c[_0xbc71('0x5b')][_0xbc71('0x9e')][_0xbc71('0x9f')](_0xbc71('0xa0'),'');_0x231fc0['body'][_0xbc71('0x5b')]=_0x17b87c[_0xbc71('0x5b')][_0xbc71('0xa1')];_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa2')]=_0x17b87c[_0xbc71('0x5b')][_0xbc71('0xa3')];}if(_0x231fc0['account']&&_0x231fc0[_0xbc71('0x89')]['type']==='sinch'){_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa4')]=_0x17b87c[_0xbc71('0x5b')]['notifications'][0x0]['from'];_0x231fc0[_0xbc71('0x5b')][_0xbc71('0x5b')]=_0x17b87c[_0xbc71('0x5b')]['notifications'][0x0][_0xbc71('0x29')]['body'];_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa2')]=_0x17b87c['body'][_0xbc71('0xa5')][0x0]['message_id'];}if(_0x231fc0['body']['id']){delete _0x231fc0['body']['id'];}if(_['isNil'](_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa4')])){throw new db[(_0xbc71('0x95'))]['ValidationError'](_0xbc71('0xa6'));}if(_[_0xbc71('0xa7')](_0x231fc0[_0xbc71('0x5b')]['body'])||_0x231fc0['body']['body']===''){throw new db[(_0xbc71('0x95'))][(_0xbc71('0xa8'))](_0xbc71('0xa9'));}if(_[_0xbc71('0xa7')](_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xaa')])){throw new db[(_0xbc71('0x95'))][(_0xbc71('0xa8'))](_0xbc71('0xab')+_0x764381);}if(!_[_0xbc71('0xac')](_0x764381,_0x231fc0[_0xbc71('0x5b')]['mapKey'])){throw new db[(_0xbc71('0x95'))]['ValidationError'](_0xbc71('0xad')+_0x764381);}_0x26e88a[_0x231fc0['body'][_0xbc71('0xaa')]]=_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa4')];return db[_0xbc71('0xae')][_0xbc71('0x59')]({'where':{'id':_0x231fc0[_0xbc71('0x89')][_0xbc71('0x9b')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x26e88a,'limit':0x1,'order':[[_0xbc71('0x99'),_0xbc71('0xaf')]]}]});})[_0xbc71('0x21')](handleEntityNotFound(_0x317cea,null))[_0xbc71('0x21')](function(_0x30604b){if(_0x30604b){_0x231fc0[_0xbc71('0xb0')]=_[_0xbc71('0x75')](_0x30604b,[_0xbc71('0xb1')]);if(_0x30604b[_0xbc71('0xb1')][_0xbc71('0x49')]){return _0x30604b[_0xbc71('0xb1')][0x0];}var _0x2f1776=_[_0xbc71('0x1a')](_0x231fc0['body'],{'firstName':_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa4')],'ListId':_0x30604b['id']});_0x2f1776[_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xaa')]]=_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa4')];return db['CmContact'][_0xbc71('0x5a')](_0x2f1776,{'fields':_0x5323a5,'raw':!![]});}})[_0xbc71('0x21')](handleEntityNotFound(_0x317cea,null))[_0xbc71('0x21')](function(_0x3c0c8f){if(_0x3c0c8f){_0x231fc0[_0xbc71('0xb2')]=_0x3c0c8f;var _0x5ed80d={'ContactId':_0x3c0c8f['id'],'phone':_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa4')],'WhatsappAccountId':_0x17b87c[_0xbc71('0x64')]['id']};var _0x478757={'ContactId':_0x3c0c8f['id'],'WhatsappAccountId':_0x17b87c[_0xbc71('0x64')]['id'],'closed':![]};return db[_0xbc71('0xb3')][_0xbc71('0x59')]({'where':_0x478757})[_0xbc71('0x21')](function(_0x1ecd06){if(_0x1ecd06){return[_0x1ecd06,![]];}return db[_0xbc71('0xb3')][_0xbc71('0x5a')](_0x5ed80d)['then'](function(_0x15b373){return[_0x15b373,!![]];});});}})[_0xbc71('0xb4')](function(_0xc23dac,_0x178ffd){_0x231fc0[_0xbc71('0xb5')]=_0xc23dac[_0xbc71('0x3a')]({'plain':!![]});_0x231fc0[_0xbc71('0xb5')][_0xbc71('0xb6')]=![];if(_0x178ffd){if(_0x231fc0['account']['autoclose']){_0x231fc0['applications'][_0xbc71('0xb7')]({'id':0x0,'priority':_0x231fc0[_0xbc71('0x91')]['length']+0x1,'app':_0xbc71('0xb8'),'appdata':_0xbc71('0xb9'),'interval':'*,*,*,*'});}_0x231fc0[_0xbc71('0xb5')][_0xbc71('0xb6')]=!![];}return db[_0xbc71('0x8e')][_0xbc71('0x5a')]({'phone':_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa4')],'messageId':_0x231fc0[_0xbc71('0x5b')][_0xbc71('0xa2')],'body':_0x231fc0[_0xbc71('0x5b')]['body'],'WhatsappAccountId':_0x17b87c[_0xbc71('0x64')]['id'],'WhatsappInteractionId':_0xc23dac['id'],'direction':'in','ContactId':_0xc23dac['ContactId'],'AttachmentId':_0x231fc0['body']['AttachmentId']});})['then'](function(_0x232213){_0x231fc0[_0xbc71('0x29')]=_0x232213;if(_0x231fc0[_0xbc71('0xb5')][_0xbc71('0xba')]){return db[_0xbc71('0xbb')][_0xbc71('0x59')]({'attributes':['id','name'],'where':{'id':_0x231fc0[_0xbc71('0xb5')][_0xbc71('0xba')]}})[_0xbc71('0x21')](function(_0x4bf4da){if(_0x4bf4da){_0x231fc0['applications'][_0xbc71('0xbc')]({'id':0x0,'priority':0x0,'app':_0xbc71('0xbd'),'appdata':_0x4bf4da[_0xbc71('0x3b')]+','+(_0x231fc0[_0xbc71('0x89')]['waitForTheAssignedAgent']||0xa),'interval':_0xbc71('0xbe')});}return respondWithRpcPromise(_0xbc71('0xbf'),'startRouting',_0x231fc0);});}return respondWithRpcPromise(_0xbc71('0xbf'),_0xbc71('0xc0'),_0x231fc0);})[_0xbc71('0x21')](function(_0x6576da){if(_0x6576da){var _0x7b79d2=0xc8;var _0x446ccb='receiveMessage';logger['info'](_0xbc71('0x26'),_0x446ccb,_0x7b79d2,'entity\x20found');logger[_0xbc71('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x446ccb,_0x7b79d2,_0xbc71('0xc1'),JSON[_0xbc71('0xc2')](_0x6576da));if(_0x231fc0[_0xbc71('0x89')][_0xbc71('0x41')]===_0xbc71('0x9d')){return _0x317cea[_0xbc71('0x2d')](_0x7b79d2)[_0xbc71('0x33')]('Content-Type',_0xbc71('0xc3'))[_0xbc71('0x3c')](_0xbc71('0xc4'));}else{return _0x317cea[_0xbc71('0x2d')](_0x7b79d2)[_0xbc71('0x35')](_0x6576da);}}});})[_0xbc71('0x2b')](handleError(_0x317cea,null));};exports[_0xbc71('0x3c')]=function(_0x203a88,_0x5d0ba6,_0x4f12f7){var _0x598ad5,_0x4faa91,_0x32bafa;if(_[_0xbc71('0xa7')](_0x203a88[_0xbc71('0x5b')]['body'])||_0x203a88['body'][_0xbc71('0x5b')]===''){throw new db[(_0xbc71('0x95'))][(_0xbc71('0xa8'))](_0xbc71('0xa9'));}if(_[_0xbc71('0xa7')](_0x203a88[_0xbc71('0x5b')]['to'])){throw new db['Sequelize'][(_0xbc71('0xa8'))](_0xbc71('0xc5'));}_0x598ad5=_0x203a88[_0xbc71('0x5b')]['to'];return db[_0xbc71('0x40')][_0xbc71('0x59')]({'where':{'id':_0x203a88[_0xbc71('0x64')]['id']},'include':[{'model':db[_0xbc71('0xae')],'as':_0xbc71('0xc6'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x598ad5},'limit':0x1,'order':[[_0xbc71('0x99'),_0xbc71('0xaf')]]}]}]})[_0xbc71('0x21')](handleEntityNotFound(_0x5d0ba6,null))[_0xbc71('0x21')](function(_0x50df56){if(_0x50df56&&_0x50df56[_0xbc71('0xc6')]){_0x4faa91=_0x50df56[_0xbc71('0x3a')]({'plain':!![]});if(_0x4faa91['List']&&_0x4faa91[_0xbc71('0xc6')][_0xbc71('0xb1')]['length']){return _0x4faa91['List'][_0xbc71('0xb1')][0x0];}return db['CmContact'][_0xbc71('0x5a')](_[_0xbc71('0x1a')](_0x203a88[_0xbc71('0x5b')],{'firstName':_0x598ad5,'mobile':_0x598ad5,'phone':_0x598ad5,'ListId':_0x4faa91[_0xbc71('0x9b')]}));}})['then'](handleEntityNotFound(_0x5d0ba6,null))['then'](function(_0x5242d8){if(_0x5242d8){_0x32bafa=_0x5242d8;return db[_0xbc71('0xb3')][_0xbc71('0x59')]({'where':{'ContactId':_0x32bafa['id'],'closed':![],'WhatsappAccountId':_0x4faa91['id']}})[_0xbc71('0x21')](function(_0x3440b6){if(_0x3440b6){return[_0x3440b6,![]];}return db[_0xbc71('0xb3')]['create']({'UserId':_0x203a88[_0xbc71('0x5d')]['id'],'ContactId':_0x32bafa['id'],'WhatsappAccountId':_0x4faa91['id'],'phone':_0x598ad5,'firstMsgDirection':'out','Messages':[_[_0xbc71('0x4f')](_0x203a88[_0xbc71('0x5b')],{'read':![],'body':_0x203a88[_0xbc71('0x5b')][_0xbc71('0x5b')],'phone':_0x598ad5,'WhatsappAccountId':_0x4faa91['id'],'UserId':_0x203a88[_0xbc71('0x5d')]['id'],'ContactId':_0x32bafa['id']})]},{'include':[{'model':db[_0xbc71('0x8e')],'as':_0xbc71('0xc7')}]})[_0xbc71('0x21')](function(_0x57a15b){return[_0x57a15b,!![]];});});}})['spread'](function(_0xb4ee7c,_0xc9800b){if(_0xc9800b){return _0xb4ee7c;}return db[_0xbc71('0x8e')]['create'](_[_0xbc71('0x4f')](_0x203a88[_0xbc71('0x5b')],{'read':![],'body':_0x203a88[_0xbc71('0x5b')][_0xbc71('0x5b')],'phone':_0x598ad5,'WhatsappAccountId':_0x4faa91['id'],'WhatsappInteractionId':_0xb4ee7c['id'],'UserId':_0x203a88[_0xbc71('0x5d')]['id'],'ContactId':_0x32bafa['id']}))[_0xbc71('0x21')](function(_0xd6d404){_0xb4ee7c[_0xbc71('0xc8')][_0xbc71('0xc7')]=[];_0xb4ee7c[_0xbc71('0xc8')][_0xbc71('0xc7')][_0xbc71('0xb7')](_0xd6d404[_0xbc71('0xc8')]);return _0xb4ee7c;});})[_0xbc71('0x21')](respondWithResult(_0x5d0ba6,null))['catch'](handleError(_0x5d0ba6,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 9312b0d..fd6f2a5 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 _0x5f28=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x2562ce,_0x46066d){var _0x5f399a=function(_0x40f782){while(--_0x40f782){_0x2562ce['push'](_0x2562ce['shift']());}};_0x5f399a(++_0x46066d);}(_0x5f28,0xaa));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x85f2('0x0'));var WhatsappAccount=require(_0x85f2('0x1'))['db'][_0x85f2('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x85f2('0x3')](0x0);var events={'afterCreate':_0x85f2('0x4'),'afterUpdate':_0x85f2('0x5'),'afterDestroy':_0x85f2('0x6')};function emitEvent(_0x5a4daa){return function(_0x3bbbce,_0x2ccf42,_0x14174e){WhatsappAccountEvents[_0x85f2('0x7')](_0x5a4daa+':'+_0x3bbbce['id'],_0x3bbbce);WhatsappAccountEvents[_0x85f2('0x7')](_0x5a4daa,_0x3bbbce);_0x14174e(null);};}for(var e in events){if(events[_0x85f2('0x8')](e)){var event=events[e];WhatsappAccount[_0x85f2('0x9')](e,emitEvent(event));}}module[_0x85f2('0xa')]=WhatsappAccountEvents; \ No newline at end of file +var _0x60da=['remove','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xf5155a,_0x1f11cc){var _0x3c844e=function(_0x3bfc55){while(--_0x3bfc55){_0xf5155a['push'](_0xf5155a['shift']());}};_0x3c844e(++_0x1f11cc);}(_0x60da,0x107));var _0xa60d=function(_0x420a3e,_0x6ef787){_0x420a3e=_0x420a3e-0x0;var _0x1e8d53=_0x60da[_0x420a3e];return _0x1e8d53;};'use strict';var EventEmitter=require(_0xa60d('0x0'));var WhatsappAccount=require(_0xa60d('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa60d('0x2')};function emitEvent(_0x31485c){return function(_0x51c9a5,_0x11ae90,_0x20e74c){WhatsappAccountEvents['emit'](_0x31485c+':'+_0x51c9a5['id'],_0x51c9a5);WhatsappAccountEvents['emit'](_0x31485c,_0x51c9a5);_0x20e74c(null);};}for(var e in events){if(events[_0xa60d('0x3')](e)){var event=events[e];WhatsappAccount[_0xa60d('0x4')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index e260f7c..b549747 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 _0x1b39=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x1c5ba5,_0x53ce01){var _0x4fafd8=function(_0x4567bc){while(--_0x4567bc){_0x1c5ba5['push'](_0x1c5ba5['shift']());}};_0x4fafd8(++_0x53ce01);}(_0x1b39,0xbd));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 logger=require('../../config/logger')(_0x91b3('0x1'));var moment=require(_0x91b3('0x2'));var BPromise=require(_0x91b3('0x3'));var rp=require(_0x91b3('0x4'));var fs=require('fs');var path=require(_0x91b3('0x5'));var rimraf=require(_0x91b3('0x6'));var config=require(_0x91b3('0x7'));var attributes=require(_0x91b3('0x8'));module[_0x91b3('0x9')]=function(_0x53561d,_0xee7543){return _0x53561d[_0x91b3('0xa')](_0x91b3('0xb'),attributes,{'tableName':_0x91b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4ad=['../../config/environment','./whatsappAccount.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f0fcc,_0x361581){var _0x1f9ba3=function(_0x1ff30c){while(--_0x1ff30c){_0x1f0fcc['push'](_0x1f0fcc['shift']());}};_0x1f9ba3(++_0x361581);}(_0xd4ad,0x1bf));var _0xdd4a=function(_0x459439,_0x51f289){_0x459439=_0x459439-0x0;var _0x103251=_0xd4ad[_0x459439];return _0x103251;};'use strict';var _=require(_0xdd4a('0x0'));var util=require(_0xdd4a('0x1'));var logger=require(_0xdd4a('0x2'))(_0xdd4a('0x3'));var moment=require(_0xdd4a('0x4'));var BPromise=require(_0xdd4a('0x5'));var rp=require(_0xdd4a('0x6'));var fs=require('fs');var path=require(_0xdd4a('0x7'));var rimraf=require(_0xdd4a('0x8'));var config=require(_0xdd4a('0x9'));var attributes=require(_0xdd4a('0xa'));module['exports']=function(_0x5e218b,_0x66e20b){return _0x5e218b[_0xdd4a('0xb')]('WhatsappAccount',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 7ccd660..618e128 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 _0x5eef=['../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','attributes','include','map','model','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x5eef,0x9c));var _0xf5ee=function(_0x442cb8,_0x3cd762){_0x442cb8=_0x442cb8-0x0;var _0x39f337=_0x5eef[_0x442cb8];return _0x39f337;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5ee('0x0'));var BPromise=require('bluebird');var rs=require(_0xf5ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5ee('0x2'))['db'];var utils=require(_0xf5ee('0x3'));var logger=require(_0xf5ee('0x4'))(_0xf5ee('0x5'));var config=require(_0xf5ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xf5ee('0x7')]=_[_0xf5ee('0x8')](config['redis'],{'host':_0xf5ee('0x9'),'port':0x18eb});var socket=require(_0xf5ee('0xa'))(new Redis(config[_0xf5ee('0x7')]));require(_0xf5ee('0xb'))[_0xf5ee('0xc')](socket);function respondWithRpcPromise(_0x3cd91c,_0xc0669c,_0x24d0e8){return new BPromise(function(_0x94a2b3,_0x118c7a){return client['request'](_0x3cd91c,_0x24d0e8)[_0xf5ee('0xd')](function(_0x52c7b7){logger[_0xf5ee('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0xc0669c,_0xf5ee('0xf'));logger[_0xf5ee('0x10')](_0xf5ee('0x11'),_0xc0669c,_0xf5ee('0xf'),JSON['stringify'](_0x52c7b7));if(_0x52c7b7[_0xf5ee('0x12')]){if(_0x52c7b7[_0xf5ee('0x12')][_0xf5ee('0x13')]===0x1f4){logger[_0xf5ee('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0xc0669c,_0x52c7b7['error'][_0xf5ee('0x14')]);return _0x118c7a(_0x52c7b7[_0xf5ee('0x12')][_0xf5ee('0x14')]);}logger[_0xf5ee('0x12')](_0xf5ee('0x15'),_0xc0669c,_0x52c7b7['error'][_0xf5ee('0x14')]);return _0x94a2b3(_0x52c7b7[_0xf5ee('0x12')]['message']);}else{logger[_0xf5ee('0xe')](_0xf5ee('0x15'),_0xc0669c,_0xf5ee('0xf'));_0x94a2b3(_0x52c7b7[_0xf5ee('0x16')]['message']);}})[_0xf5ee('0x17')](function(_0xbff68a){logger[_0xf5ee('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0xc0669c,_0xbff68a);_0x118c7a(_0xbff68a);});});}exports[_0xf5ee('0x18')]=function(_0x207578){var _0xe97125=this;return new Promise(function(_0x21a2e3,_0x192d0c){return db[_0xf5ee('0x19')]['find']({'raw':_0x207578['options']?_0x207578[_0xf5ee('0x1a')][_0xf5ee('0x1b')]===undefined?!![]:![]:!![],'where':_0x207578[_0xf5ee('0x1a')]?_0x207578[_0xf5ee('0x1a')]['where']||null:null,'attributes':_0x207578[_0xf5ee('0x1a')]?_0x207578['options'][_0xf5ee('0x1c')]||null:null,'include':_0x207578[_0xf5ee('0x1a')]?_0x207578[_0xf5ee('0x1a')][_0xf5ee('0x1d')]?_[_0xf5ee('0x1e')](_0x207578['options'][_0xf5ee('0x1d')],function(_0x4f46f){return{'model':db[_0x4f46f['model']],'as':_0x4f46f['as'],'attributes':_0x4f46f[_0xf5ee('0x1c')],'include':_0x4f46f[_0xf5ee('0x1d')]?_[_0xf5ee('0x1e')](_0x4f46f[_0xf5ee('0x1d')],function(_0xe647a5){return{'model':db[_0xe647a5[_0xf5ee('0x1f')]],'as':_0xe647a5['as'],'attributes':_0xe647a5[_0xf5ee('0x1c')],'include':_0xe647a5[_0xf5ee('0x1d')]?_[_0xf5ee('0x1e')](_0xe647a5['include'],function(_0x4b1c0c){return{'model':db[_0x4b1c0c[_0xf5ee('0x1f')]],'as':_0x4b1c0c['as'],'attributes':_0x4b1c0c[_0xf5ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf5ee('0xd')](function(_0x54d5d8){logger[_0xf5ee('0xe')](_0xf5ee('0x18'),_0x207578);logger[_0xf5ee('0x10')](_0xf5ee('0x18'),_0x207578,JSON['stringify'](_0x54d5d8));_0x21a2e3(_0x54d5d8);})['catch'](function(_0x1242a5){logger['error'](_0xf5ee('0x18'),_0x1242a5['message'],_0x207578);_0x192d0c(_0xe97125[_0xf5ee('0x12')](0x1f4,_0x1242a5['message']));});});}; \ No newline at end of file +var _0x3ed4=['defaults','localhost','./whatsappAccount.socket','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','model','attributes','map','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','http','redis'];(function(_0x7012e6,_0x47b241){var _0x580e77=function(_0xea09f6){while(--_0xea09f6){_0x7012e6['push'](_0x7012e6['shift']());}};_0x580e77(++_0x47b241);}(_0x3ed4,0xdf));var _0x43ed=function(_0x1d5fe7,_0x26e644){_0x1d5fe7=_0x1d5fe7-0x0;var _0x328d6e=_0x3ed4[_0x1d5fe7];return _0x328d6e;};'use strict';var _=require(_0x43ed('0x0'));var util=require('util');var moment=require(_0x43ed('0x1'));var BPromise=require(_0x43ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43ed('0x3'));var logger=require(_0x43ed('0x4'))(_0x43ed('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x43ed('0x6')]({'port':0x232a});config[_0x43ed('0x7')]=_[_0x43ed('0x8')](config[_0x43ed('0x7')],{'host':_0x43ed('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43ed('0x7')]));require(_0x43ed('0xa'))['register'](socket);function respondWithRpcPromise(_0x40afa6,_0x286ccf,_0x5c8980){return new BPromise(function(_0x222cff,_0x23d12f){return client['request'](_0x40afa6,_0x5c8980)[_0x43ed('0xb')](function(_0x17a972){logger[_0x43ed('0xc')]('WhatsappAccount,\x20%s,\x20%s',_0x286ccf,_0x43ed('0xd'));logger[_0x43ed('0xe')](_0x43ed('0xf'),_0x286ccf,'request\x20sent',JSON[_0x43ed('0x10')](_0x17a972));if(_0x17a972[_0x43ed('0x11')]){if(_0x17a972[_0x43ed('0x11')][_0x43ed('0x12')]===0x1f4){logger[_0x43ed('0x11')](_0x43ed('0x13'),_0x286ccf,_0x17a972[_0x43ed('0x11')][_0x43ed('0x14')]);return _0x23d12f(_0x17a972[_0x43ed('0x11')]['message']);}logger[_0x43ed('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x286ccf,_0x17a972[_0x43ed('0x11')][_0x43ed('0x14')]);return _0x222cff(_0x17a972[_0x43ed('0x11')][_0x43ed('0x14')]);}else{logger['info'](_0x43ed('0x13'),_0x286ccf,'request\x20sent');_0x222cff(_0x17a972[_0x43ed('0x15')]['message']);}})[_0x43ed('0x16')](function(_0x442f49){logger['error'](_0x43ed('0x13'),_0x286ccf,_0x442f49);_0x23d12f(_0x442f49);});});}exports[_0x43ed('0x17')]=function(_0x1d8422){var _0x392f79=this;return new Promise(function(_0xdcaad0,_0x396456){return db[_0x43ed('0x18')][_0x43ed('0x19')]({'raw':_0x1d8422[_0x43ed('0x1a')]?_0x1d8422[_0x43ed('0x1a')][_0x43ed('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d8422[_0x43ed('0x1a')]?_0x1d8422[_0x43ed('0x1a')][_0x43ed('0x1c')]||null:null,'attributes':_0x1d8422[_0x43ed('0x1a')]?_0x1d8422['options']['attributes']||null:null,'include':_0x1d8422['options']?_0x1d8422['options'][_0x43ed('0x1d')]?_['map'](_0x1d8422[_0x43ed('0x1a')][_0x43ed('0x1d')],function(_0x111d1b){return{'model':db[_0x111d1b[_0x43ed('0x1e')]],'as':_0x111d1b['as'],'attributes':_0x111d1b[_0x43ed('0x1f')],'include':_0x111d1b['include']?_[_0x43ed('0x20')](_0x111d1b[_0x43ed('0x1d')],function(_0xaeddf8){return{'model':db[_0xaeddf8[_0x43ed('0x1e')]],'as':_0xaeddf8['as'],'attributes':_0xaeddf8['attributes'],'include':_0xaeddf8[_0x43ed('0x1d')]?_['map'](_0xaeddf8[_0x43ed('0x1d')],function(_0x4ae9d4){return{'model':db[_0x4ae9d4['model']],'as':_0x4ae9d4['as'],'attributes':_0x4ae9d4[_0x43ed('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x542b02){logger[_0x43ed('0xc')](_0x43ed('0x17'),_0x1d8422);logger[_0x43ed('0xe')](_0x43ed('0x17'),_0x1d8422,JSON['stringify'](_0x542b02));_0xdcaad0(_0x542b02);})[_0x43ed('0x16')](function(_0xd52826){logger[_0x43ed('0x11')](_0x43ed('0x17'),_0xd52826[_0x43ed('0x14')],_0x1d8422);_0x396456(_0x392f79[_0x43ed('0x11')](0x1f4,_0xd52826[_0x43ed('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index ec20de7..a656f34 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 _0x1b3f=['register','remove','emit','removeListener'];(function(_0x42813c,_0x40b1c7){var _0x544cf2=function(_0x17d2bd){while(--_0x17d2bd){_0x42813c['push'](_0x42813c['shift']());}};_0x544cf2(++_0x40b1c7);}(_0x1b3f,0x1ed));var _0xf1b3=function(_0x26682c,_0x453d86){_0x26682c=_0x26682c-0x0;var _0x803612=_0x1b3f[_0x26682c];return _0x803612;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0xf1b3('0x0'),'update'];function createListener(_0x2354b2,_0x50fb9c){return function(_0x4ae2b2){_0x50fb9c[_0xf1b3('0x1')](_0x2354b2,_0x4ae2b2);};}function removeListener(_0x879865,_0x224667){return function(){WhatsappAccountEvents[_0xf1b3('0x2')](_0x879865,_0x224667);};}exports[_0xf1b3('0x3')]=function(_0x44aa84){for(var _0x5e9645=0x0,_0x397089=events['length'];_0x5e9645<_0x397089;_0x5e9645++){var _0x59dcfa=events[_0x5e9645];var _0x2fec48=createListener('whatsappAccount:'+_0x59dcfa,_0x44aa84);WhatsappAccountEvents['on'](_0x59dcfa,_0x2fec48);}}; \ No newline at end of file +var _0x903f=['emit','removeListener','length','whatsappAccount:','save','update'];(function(_0x216008,_0x2d1023){var _0x4d384f=function(_0x3fd7e2){while(--_0x3fd7e2){_0x216008['push'](_0x216008['shift']());}};_0x4d384f(++_0x2d1023);}(_0x903f,0x64));var _0xf903=function(_0x99fb43,_0x2994b0){_0x99fb43=_0x99fb43-0x0;var _0x5bfe3e=_0x903f[_0x99fb43];return _0x5bfe3e;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xf903('0x0'),'remove',_0xf903('0x1')];function createListener(_0x32726f,_0x4606c9){return function(_0x55b615){_0x4606c9[_0xf903('0x2')](_0x32726f,_0x55b615);};}function removeListener(_0x4803c2,_0x195af9){return function(){WhatsappAccountEvents[_0xf903('0x3')](_0x4803c2,_0x195af9);};}exports['register']=function(_0x36fdac){for(var _0x20333c=0x0,_0x1a9a45=events[_0xf903('0x4')];_0x20333c<_0x1a9a45;_0x20333c++){var _0x13b508=events[_0x20333c];var _0x56da4d=createListener(_0xf903('0x5')+_0x13b508,_0x36fdac);WhatsappAccountEvents['on'](_0x13b508,_0x56da4d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 5e7beae..e7bb164 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 _0x5390=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','delete','exports','multer','util','connect-timeout'];(function(_0x133f09,_0x26c800){var _0x47126a=function(_0xb47025){while(--_0xb47025){_0x133f09['push'](_0x133f09['shift']());}};_0x47126a(++_0x26c800);}(_0x5390,0x1cd));var _0x0539=function(_0x8cb059,_0xb527bb){_0x8cb059=_0x8cb059-0x0;var _0x16a605=_0x5390[_0x8cb059];return _0x16a605;};'use strict';var multer=require(_0x0539('0x0'));var util=require(_0x0539('0x1'));var path=require('path');var timeout=require(_0x0539('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0539('0x3'));var auth=require(_0x0539('0x4'));var interaction=require(_0x0539('0x5'));var config=require(_0x0539('0x6'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x0539('0x7')](),controller[_0x0539('0x8')]);router[_0x0539('0x9')](_0x0539('0xa'),auth[_0x0539('0x7')](),controller[_0x0539('0xb')]);router[_0x0539('0xc')]('/',auth[_0x0539('0x7')](),controller[_0x0539('0xd')]);router['put'](_0x0539('0xa'),auth[_0x0539('0x7')](),controller['update']);router[_0x0539('0xe')](_0x0539('0xa'),auth[_0x0539('0x7')](),controller['destroy']);module[_0x0539('0xf')]=router; \ No newline at end of file +var _0x9cfe=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','update','exports','util','connect-timeout','express'];(function(_0x2d2aeb,_0x2ac620){var _0xc6ce7d=function(_0x113751){while(--_0x113751){_0x2d2aeb['push'](_0x2d2aeb['shift']());}};_0xc6ce7d(++_0x2ac620);}(_0x9cfe,0xbd));var _0xe9cf=function(_0xb78f36,_0x496a58){_0xb78f36=_0xb78f36-0x0;var _0x567c15=_0x9cfe[_0xb78f36];return _0x567c15;};'use strict';var multer=require('multer');var util=require(_0xe9cf('0x0'));var path=require('path');var timeout=require(_0xe9cf('0x1'));var express=require(_0xe9cf('0x2'));var router=express[_0xe9cf('0x3')]();var fs_extra=require(_0xe9cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe9cf('0x5'));var config=require(_0xe9cf('0x6'));var controller=require('./whatsappApplication.controller');router[_0xe9cf('0x7')]('/',auth[_0xe9cf('0x8')](),controller[_0xe9cf('0x9')]);router[_0xe9cf('0x7')]('/:id',auth[_0xe9cf('0x8')](),controller[_0xe9cf('0xa')]);router[_0xe9cf('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9cf('0xc')](_0xe9cf('0xd'),auth[_0xe9cf('0x8')](),controller[_0xe9cf('0xe')]);router['delete'](_0xe9cf('0xd'),auth[_0xe9cf('0x8')](),controller['destroy']);module[_0xe9cf('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 44ad850..aa31861 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 _0x34b8=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x34b8,0x178));var _0x834b=function(_0x5611b7,_0x5fd304){_0x5611b7=_0x5611b7-0x0;var _0x8cb5a0=_0x34b8[_0x5611b7];return _0x8cb5a0;};'use strict';var Sequelize=require(_0x834b('0x0'));module[_0x834b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x834b('0x2')],'allowNull':![],'defaultValue':_0x834b('0x3')},'appdata':{'type':Sequelize[_0x834b('0x4')]()},'description':{'type':Sequelize[_0x834b('0x2')]},'interval':{'type':Sequelize[_0x834b('0x2')],'defaultValue':_0x834b('0x5')}}; \ No newline at end of file +var _0xaa5b=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3ba3b8,_0x24a377){var _0x4011c1=function(_0x2fdb71){while(--_0x2fdb71){_0x3ba3b8['push'](_0x3ba3b8['shift']());}};_0x4011c1(++_0x24a377);}(_0xaa5b,0x1a7));var _0xbaa5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa5b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa5('0x0'));module[_0xbaa5('0x1')]={'priority':{'type':Sequelize[_0xbaa5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbaa5('0x3')],'allowNull':![],'defaultValue':_0xbaa5('0x4')},'appdata':{'type':Sequelize[_0xbaa5('0x5')]()},'description':{'type':Sequelize[_0xbaa5('0x3')]},'interval':{'type':Sequelize[_0xbaa5('0x3')],'defaultValue':_0xbaa5('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 360914e..3bad53c 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 _0x323f=['send','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','show','params','keys','create','body','find','rimraf','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','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name'];(function(_0x2a3a73,_0x964fbe){var _0x2cdc58=function(_0xd15e69){while(--_0xd15e69){_0x2a3a73['push'](_0x2a3a73['shift']());}};_0x2cdc58(++_0x964fbe);}(_0x323f,0x1ee));var _0xf323=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x323f[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf323('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf323('0x1'));var rp=require(_0xf323('0x2'));var moment=require(_0xf323('0x3'));var BPromise=require(_0xf323('0x4'));var Mustache=require(_0xf323('0x5'));var util=require(_0xf323('0x6'));var path=require(_0xf323('0x7'));var sox=require(_0xf323('0x8'));var csv=require(_0xf323('0x9'));var ejs=require(_0xf323('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf323('0xb'));var squel=require(_0xf323('0xc'));var crypto=require(_0xf323('0xd'));var jsforce=require(_0xf323('0xe'));var deskjs=require(_0xf323('0xf'));var toCsv=require(_0xf323('0x9'));var querystring=require(_0xf323('0x10'));var Papa=require(_0xf323('0x11'));var Redis=require(_0xf323('0x12'));var authService=require(_0xf323('0x13'));var qs=require(_0xf323('0x14'));var as=require(_0xf323('0x15'));var hardwareService=require(_0xf323('0x16'));var logger=require(_0xf323('0x17'))(_0xf323('0x18'));var utils=require(_0xf323('0x19'));var config=require(_0xf323('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf323('0x1b'))['db'];function respondWithStatusCode(_0x7dbd26,_0x26eddb){_0x26eddb=_0x26eddb||0xcc;return function(_0x56b916){if(_0x56b916){return _0x7dbd26[_0xf323('0x1c')](_0x26eddb);}return _0x7dbd26[_0xf323('0x1d')](_0x26eddb)[_0xf323('0x1e')]();};}function respondWithResult(_0x3a829f,_0x22672e){_0x22672e=_0x22672e||0xc8;return function(_0x144db9){if(_0x144db9){return _0x3a829f['status'](_0x22672e)['json'](_0x144db9);}};}function respondWithFilteredResult(_0x874219,_0x447517){return function(_0x38fd4c){if(_0x38fd4c){var _0x3858ee=typeof _0x447517[_0xf323('0x1f')]==='undefined'&&typeof _0x447517[_0xf323('0x20')]===_0xf323('0x21');var _0xb9859f=_0x38fd4c[_0xf323('0x22')];var _0x49b115=_0x3858ee?0x0:_0x447517[_0xf323('0x1f')];var _0x272aec=_0x3858ee?_0x38fd4c[_0xf323('0x22')]:_0x447517[_0xf323('0x1f')]+_0x447517['limit'];var _0x409b16;if(_0x272aec>=_0xb9859f){_0x272aec=_0xb9859f;_0x409b16=0xc8;}else{_0x409b16=0xce;}_0x874219[_0xf323('0x1d')](_0x409b16);return _0x874219['set'](_0xf323('0x23'),_0x49b115+'-'+_0x272aec+'/'+_0xb9859f)[_0xf323('0x24')](_0x38fd4c);}return null;};}function patchUpdates(_0x32a942){return function(_0x183ce0){try{jsonpatch['apply'](_0x183ce0,_0x32a942,!![]);}catch(_0xdc7891){return BPromise[_0xf323('0x25')](_0xdc7891);}return _0x183ce0[_0xf323('0x26')]();};}function saveUpdates(_0x52305d,_0x43e467){return function(_0x375473){if(_0x375473){return _0x375473[_0xf323('0x27')](_0x52305d)[_0xf323('0x28')](function(_0x13ec1f){return _0x13ec1f;});}return null;};}function removeEntity(_0xa3362c,_0x189b23){return function(_0x43bc05){if(_0x43bc05){return _0x43bc05[_0xf323('0x29')]()['then'](function(){_0xa3362c[_0xf323('0x1d')](0xcc)[_0xf323('0x1e')]();});}};}function handleEntityNotFound(_0x33dc52,_0x292ce0){return function(_0x87ec45){if(!_0x87ec45){_0x33dc52[_0xf323('0x1c')](0x194);}return _0x87ec45;};}function handleError(_0x4d737d,_0x30ed93){_0x30ed93=_0x30ed93||0x1f4;return function(_0x56ce33){logger[_0xf323('0x2a')](_0x56ce33[_0xf323('0x2b')]);if(_0x56ce33['name']){delete _0x56ce33[_0xf323('0x2c')];}_0x4d737d[_0xf323('0x1d')](_0x30ed93)[_0xf323('0x2d')](_0x56ce33);};}exports[_0xf323('0x2e')]=function(_0x46e3b1,_0x5b8b60){var _0x44c944={},_0x34b536={},_0x12c7d5={'count':0x0,'rows':[]};var _0x30a5d7=_[_0xf323('0x2f')](db[_0xf323('0x30')][_0xf323('0x31')],function(_0x1723b7){return{'name':_0x1723b7[_0xf323('0x32')],'type':_0x1723b7['type'][_0xf323('0x33')]};});_0x34b536[_0xf323('0x34')]=_[_0xf323('0x2f')](_0x30a5d7,_0xf323('0x2c'));_0x34b536[_0xf323('0x35')]=_['keys'](_0x46e3b1[_0xf323('0x35')]);_0x34b536[_0xf323('0x36')]=_[_0xf323('0x37')](_0x34b536[_0xf323('0x34')],_0x34b536[_0xf323('0x35')]);_0x44c944['attributes']=_[_0xf323('0x37')](_0x34b536[_0xf323('0x34')],qs[_0xf323('0x38')](_0x46e3b1[_0xf323('0x35')]['fields']));_0x44c944[_0xf323('0x39')]=_0x44c944['attributes'][_0xf323('0x3a')]?_0x44c944[_0xf323('0x39')]:_0x34b536['model'];if(!_0x46e3b1[_0xf323('0x35')]['hasOwnProperty'](_0xf323('0x3b'))){_0x44c944['limit']=qs[_0xf323('0x20')](_0x46e3b1['query'][_0xf323('0x20')]);_0x44c944[_0xf323('0x1f')]=qs['offset'](_0x46e3b1['query']['offset']);}_0x44c944[_0xf323('0x3c')]=qs[_0xf323('0x3d')](_0x46e3b1[_0xf323('0x35')][_0xf323('0x3d')]);_0x44c944[_0xf323('0x3e')]=qs['filters'](_['pick'](_0x46e3b1['query'],_0x34b536[_0xf323('0x36')]),_0x30a5d7);if(_0x46e3b1['query'][_0xf323('0x3f')]){_0x44c944['where']=_[_0xf323('0x40')](_0x44c944[_0xf323('0x3e')],{'$or':_[_0xf323('0x2f')](_0x30a5d7,function(_0x325fa9){if(_0x325fa9[_0xf323('0x41')]!=='VIRTUAL'){var _0x3d8ddb={};_0x3d8ddb[_0x325fa9[_0xf323('0x2c')]]={'$like':'%'+_0x46e3b1[_0xf323('0x35')][_0xf323('0x3f')]+'%'};return _0x3d8ddb;}})});}_0x44c944=_[_0xf323('0x40')]({},_0x44c944,_0x46e3b1[_0xf323('0x42')]);var _0x288428={'where':_0x44c944[_0xf323('0x3e')]};return db[_0xf323('0x30')][_0xf323('0x22')](_0x288428)[_0xf323('0x28')](function(_0x45287b){_0x12c7d5[_0xf323('0x22')]=_0x45287b;if(_0x46e3b1[_0xf323('0x35')][_0xf323('0x43')]){_0x44c944[_0xf323('0x44')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x44c944);})[_0xf323('0x28')](function(_0x16ac6d){_0x12c7d5[_0xf323('0x45')]=_0x16ac6d;return _0x12c7d5;})[_0xf323('0x28')](respondWithFilteredResult(_0x5b8b60,_0x44c944))[_0xf323('0x46')](handleError(_0x5b8b60,null));};exports[_0xf323('0x47')]=function(_0x2746e3,_0x125047){var _0x1c0136={'raw':!![],'where':{'id':_0x2746e3[_0xf323('0x48')]['id']}},_0x320592={};_0x320592[_0xf323('0x34')]=_[_0xf323('0x49')](db['WhatsappApplication'][_0xf323('0x31')]);_0x320592['query']=_['keys'](_0x2746e3[_0xf323('0x35')]);_0x320592['filters']=_['intersection'](_0x320592[_0xf323('0x34')],_0x320592[_0xf323('0x35')]);_0x1c0136[_0xf323('0x39')]=_[_0xf323('0x37')](_0x320592[_0xf323('0x34')],qs[_0xf323('0x38')](_0x2746e3[_0xf323('0x35')][_0xf323('0x38')]));_0x1c0136[_0xf323('0x39')]=_0x1c0136[_0xf323('0x39')][_0xf323('0x3a')]?_0x1c0136['attributes']:_0x320592[_0xf323('0x34')];if(_0x2746e3['query'][_0xf323('0x43')]){_0x1c0136[_0xf323('0x44')]=[{'all':!![]}];}_0x1c0136=_[_0xf323('0x40')]({},_0x1c0136,_0x2746e3[_0xf323('0x42')]);return db['WhatsappApplication']['find'](_0x1c0136)[_0xf323('0x28')](handleEntityNotFound(_0x125047,null))['then'](respondWithResult(_0x125047,null))[_0xf323('0x46')](handleError(_0x125047,null));};exports['create']=function(_0x2204f5,_0x8980f){return db['WhatsappApplication'][_0xf323('0x4a')](_0x2204f5[_0xf323('0x4b')],{})[_0xf323('0x28')](respondWithResult(_0x8980f,0xc9))[_0xf323('0x46')](handleError(_0x8980f,null));};exports[_0xf323('0x27')]=function(_0x950009,_0x34268e){if(_0x950009[_0xf323('0x4b')]['id']){delete _0x950009[_0xf323('0x4b')]['id'];}return db[_0xf323('0x30')][_0xf323('0x4c')]({'where':{'id':_0x950009[_0xf323('0x48')]['id']}})[_0xf323('0x28')](handleEntityNotFound(_0x34268e,null))['then'](saveUpdates(_0x950009[_0xf323('0x4b')],null))[_0xf323('0x28')](respondWithResult(_0x34268e,null))[_0xf323('0x46')](handleError(_0x34268e,null));};exports[_0xf323('0x29')]=function(_0x190e85,_0x1288b3){return db['WhatsappApplication'][_0xf323('0x4c')]({'where':{'id':_0x190e85[_0xf323('0x48')]['id']}})['then'](handleEntityNotFound(_0x1288b3,null))[_0xf323('0x28')](removeEntity(_0x1288b3,null))[_0xf323('0x46')](handleError(_0x1288b3,null));}; \ No newline at end of file +var _0xcefd=['show','params','intersection','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','query','keys','filters','model','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x484ff8,_0x7d3587){var _0xac2f79=function(_0x468089){while(--_0x468089){_0x484ff8['push'](_0x484ff8['shift']());}};_0xac2f79(++_0x7d3587);}(_0xcefd,0x1bd));var _0xdcef=function(_0xa80908,_0x1fbb08){_0xa80908=_0xa80908-0x0;var _0x1e8bed=_0xcefd[_0xa80908];return _0x1e8bed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdcef('0x0'));var zipdir=require(_0xdcef('0x1'));var jsonpatch=require(_0xdcef('0x2'));var rp=require(_0xdcef('0x3'));var moment=require(_0xdcef('0x4'));var BPromise=require(_0xdcef('0x5'));var Mustache=require(_0xdcef('0x6'));var util=require('util');var path=require(_0xdcef('0x7'));var sox=require(_0xdcef('0x8'));var csv=require(_0xdcef('0x9'));var ejs=require(_0xdcef('0xa'));var fs=require('fs');var fs_extra=require(_0xdcef('0xb'));var _=require('lodash');var squel=require(_0xdcef('0xc'));var crypto=require(_0xdcef('0xd'));var jsforce=require(_0xdcef('0xe'));var deskjs=require(_0xdcef('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdcef('0x10'));var Papa=require(_0xdcef('0x11'));var Redis=require(_0xdcef('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdcef('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcef('0x14'));var logger=require(_0xdcef('0x15'))(_0xdcef('0x16'));var utils=require(_0xdcef('0x17'));var config=require(_0xdcef('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcef('0x19'))['db'];function respondWithStatusCode(_0x1f4bb2,_0x4accb4){_0x4accb4=_0x4accb4||0xcc;return function(_0x16e151){if(_0x16e151){return _0x1f4bb2['sendStatus'](_0x4accb4);}return _0x1f4bb2[_0xdcef('0x1a')](_0x4accb4)[_0xdcef('0x1b')]();};}function respondWithResult(_0xe6164a,_0x1dcc1d){_0x1dcc1d=_0x1dcc1d||0xc8;return function(_0x5a20f2){if(_0x5a20f2){return _0xe6164a[_0xdcef('0x1a')](_0x1dcc1d)[_0xdcef('0x1c')](_0x5a20f2);}};}function respondWithFilteredResult(_0x518d03,_0x270f4d){return function(_0x2c8eeb){if(_0x2c8eeb){var _0x20d127=typeof _0x270f4d['offset']==='undefined'&&typeof _0x270f4d[_0xdcef('0x1d')]===_0xdcef('0x1e');var _0x61eebb=_0x2c8eeb['count'];var _0x1a79f8=_0x20d127?0x0:_0x270f4d[_0xdcef('0x1f')];var _0x4d97ae=_0x20d127?_0x2c8eeb['count']:_0x270f4d[_0xdcef('0x1f')]+_0x270f4d['limit'];var _0x16c2bd;if(_0x4d97ae>=_0x61eebb){_0x4d97ae=_0x61eebb;_0x16c2bd=0xc8;}else{_0x16c2bd=0xce;}_0x518d03[_0xdcef('0x1a')](_0x16c2bd);return _0x518d03[_0xdcef('0x20')](_0xdcef('0x21'),_0x1a79f8+'-'+_0x4d97ae+'/'+_0x61eebb)[_0xdcef('0x1c')](_0x2c8eeb);}return null;};}function patchUpdates(_0x13ac84){return function(_0x466faa){try{jsonpatch[_0xdcef('0x22')](_0x466faa,_0x13ac84,!![]);}catch(_0x2200b5){return BPromise['reject'](_0x2200b5);}return _0x466faa[_0xdcef('0x23')]();};}function saveUpdates(_0x4855cf,_0x1b0ab0){return function(_0x697abf){if(_0x697abf){return _0x697abf['update'](_0x4855cf)[_0xdcef('0x24')](function(_0x407fa6){return _0x407fa6;});}return null;};}function removeEntity(_0x548718,_0x32eeac){return function(_0x19ba1b){if(_0x19ba1b){return _0x19ba1b[_0xdcef('0x25')]()[_0xdcef('0x24')](function(){_0x548718['status'](0xcc)[_0xdcef('0x1b')]();});}};}function handleEntityNotFound(_0x4dc915,_0x5a7f8e){return function(_0xf9b6a5){if(!_0xf9b6a5){_0x4dc915[_0xdcef('0x26')](0x194);}return _0xf9b6a5;};}function handleError(_0x362e09,_0x30d715){_0x30d715=_0x30d715||0x1f4;return function(_0x27b6bb){logger[_0xdcef('0x27')](_0x27b6bb[_0xdcef('0x28')]);if(_0x27b6bb[_0xdcef('0x29')]){delete _0x27b6bb[_0xdcef('0x29')];}_0x362e09[_0xdcef('0x1a')](_0x30d715)['send'](_0x27b6bb);};}exports[_0xdcef('0x2a')]=function(_0x5413fe,_0xc8693c){var _0x5e72f2={},_0x3dfcc8={},_0x565a31={'count':0x0,'rows':[]};var _0x598973=_[_0xdcef('0x2b')](db[_0xdcef('0x2c')][_0xdcef('0x2d')],function(_0x2ee1a3){return{'name':_0x2ee1a3[_0xdcef('0x2e')],'type':_0x2ee1a3['type']['key']};});_0x3dfcc8['model']=_[_0xdcef('0x2b')](_0x598973,_0xdcef('0x29'));_0x3dfcc8[_0xdcef('0x2f')]=_[_0xdcef('0x30')](_0x5413fe[_0xdcef('0x2f')]);_0x3dfcc8[_0xdcef('0x31')]=_['intersection'](_0x3dfcc8[_0xdcef('0x32')],_0x3dfcc8[_0xdcef('0x2f')]);_0x5e72f2[_0xdcef('0x33')]=_['intersection'](_0x3dfcc8[_0xdcef('0x32')],qs[_0xdcef('0x34')](_0x5413fe['query'][_0xdcef('0x34')]));_0x5e72f2['attributes']=_0x5e72f2[_0xdcef('0x33')][_0xdcef('0x35')]?_0x5e72f2[_0xdcef('0x33')]:_0x3dfcc8[_0xdcef('0x32')];if(!_0x5413fe[_0xdcef('0x2f')]['hasOwnProperty']('nolimit')){_0x5e72f2['limit']=qs[_0xdcef('0x1d')](_0x5413fe[_0xdcef('0x2f')][_0xdcef('0x1d')]);_0x5e72f2[_0xdcef('0x1f')]=qs['offset'](_0x5413fe[_0xdcef('0x2f')][_0xdcef('0x1f')]);}_0x5e72f2[_0xdcef('0x36')]=qs[_0xdcef('0x37')](_0x5413fe[_0xdcef('0x2f')][_0xdcef('0x37')]);_0x5e72f2[_0xdcef('0x38')]=qs[_0xdcef('0x31')](_[_0xdcef('0x39')](_0x5413fe['query'],_0x3dfcc8[_0xdcef('0x31')]),_0x598973);if(_0x5413fe[_0xdcef('0x2f')][_0xdcef('0x3a')]){_0x5e72f2[_0xdcef('0x38')]=_['merge'](_0x5e72f2[_0xdcef('0x38')],{'$or':_['map'](_0x598973,function(_0x305cd3){if(_0x305cd3[_0xdcef('0x3b')]!==_0xdcef('0x3c')){var _0x36a569={};_0x36a569[_0x305cd3[_0xdcef('0x29')]]={'$like':'%'+_0x5413fe[_0xdcef('0x2f')][_0xdcef('0x3a')]+'%'};return _0x36a569;}})});}_0x5e72f2=_['merge']({},_0x5e72f2,_0x5413fe[_0xdcef('0x3d')]);var _0x28212b={'where':_0x5e72f2[_0xdcef('0x38')]};return db['WhatsappApplication']['count'](_0x28212b)[_0xdcef('0x24')](function(_0x15bda4){_0x565a31['count']=_0x15bda4;if(_0x5413fe[_0xdcef('0x2f')][_0xdcef('0x3e')]){_0x5e72f2[_0xdcef('0x3f')]=[{'all':!![]}];}return db[_0xdcef('0x2c')][_0xdcef('0x40')](_0x5e72f2);})[_0xdcef('0x24')](function(_0x207467){_0x565a31['rows']=_0x207467;return _0x565a31;})['then'](respondWithFilteredResult(_0xc8693c,_0x5e72f2))[_0xdcef('0x41')](handleError(_0xc8693c,null));};exports[_0xdcef('0x42')]=function(_0x555836,_0x5e525f){var _0x216f46={'raw':!![],'where':{'id':_0x555836[_0xdcef('0x43')]['id']}},_0x4bb109={};_0x4bb109[_0xdcef('0x32')]=_[_0xdcef('0x30')](db[_0xdcef('0x2c')]['rawAttributes']);_0x4bb109[_0xdcef('0x2f')]=_[_0xdcef('0x30')](_0x555836[_0xdcef('0x2f')]);_0x4bb109[_0xdcef('0x31')]=_[_0xdcef('0x44')](_0x4bb109[_0xdcef('0x32')],_0x4bb109['query']);_0x216f46[_0xdcef('0x33')]=_[_0xdcef('0x44')](_0x4bb109['model'],qs[_0xdcef('0x34')](_0x555836[_0xdcef('0x2f')]['fields']));_0x216f46[_0xdcef('0x33')]=_0x216f46['attributes'][_0xdcef('0x35')]?_0x216f46[_0xdcef('0x33')]:_0x4bb109['model'];if(_0x555836[_0xdcef('0x2f')]['includeAll']){_0x216f46[_0xdcef('0x3f')]=[{'all':!![]}];}_0x216f46=_['merge']({},_0x216f46,_0x555836[_0xdcef('0x3d')]);return db[_0xdcef('0x2c')][_0xdcef('0x45')](_0x216f46)[_0xdcef('0x24')](handleEntityNotFound(_0x5e525f,null))[_0xdcef('0x24')](respondWithResult(_0x5e525f,null))[_0xdcef('0x41')](handleError(_0x5e525f,null));};exports['create']=function(_0x552fce,_0x444986){return db['WhatsappApplication'][_0xdcef('0x46')](_0x552fce['body'],{})[_0xdcef('0x24')](respondWithResult(_0x444986,0xc9))['catch'](handleError(_0x444986,null));};exports[_0xdcef('0x47')]=function(_0x44c68b,_0x16eaaa){if(_0x44c68b['body']['id']){delete _0x44c68b['body']['id'];}return db[_0xdcef('0x2c')][_0xdcef('0x45')]({'where':{'id':_0x44c68b[_0xdcef('0x43')]['id']}})[_0xdcef('0x24')](handleEntityNotFound(_0x16eaaa,null))[_0xdcef('0x24')](saveUpdates(_0x44c68b[_0xdcef('0x48')],null))[_0xdcef('0x24')](respondWithResult(_0x16eaaa,null))['catch'](handleError(_0x16eaaa,null));};exports[_0xdcef('0x25')]=function(_0x2b1cce,_0x38ce1d){return db['WhatsappApplication'][_0xdcef('0x45')]({'where':{'id':_0x2b1cce[_0xdcef('0x43')]['id']}})[_0xdcef('0x24')](handleEntityNotFound(_0x38ce1d,null))['then'](removeEntity(_0x38ce1d,null))[_0xdcef('0x41')](handleError(_0x38ce1d,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 459785e..e02bd8a 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 _0xfc76=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappApplication.attributes','define','whatsapp_applications','utf8mb4'];(function(_0x264f02,_0x3f80a2){var _0x302576=function(_0x2ad0d6){while(--_0x2ad0d6){_0x264f02['push'](_0x264f02['shift']());}};_0x302576(++_0x3f80a2);}(_0xfc76,0xb5));var _0x6fc7=function(_0x157b61,_0x4a493b){_0x157b61=_0x157b61-0x0;var _0x1ef3cd=_0xfc76[_0x157b61];return _0x1ef3cd;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var logger=require(_0x6fc7('0x1'))(_0x6fc7('0x2'));var moment=require(_0x6fc7('0x3'));var BPromise=require(_0x6fc7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fc7('0x5'));var rimraf=require(_0x6fc7('0x6'));var config=require('../../config/environment');var attributes=require(_0x6fc7('0x7'));module['exports']=function(_0xe8177b,_0x82a35a){return _0xe8177b[_0x6fc7('0x8')]('WhatsappApplication',attributes,{'tableName':_0x6fc7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6fc7('0xa'),'collate':_0x6fc7('0xb')});}; \ No newline at end of file +var _0x19da=['exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4b052d,_0x4955d5){var _0x4a1c33=function(_0xd353c8){while(--_0xd353c8){_0x4b052d['push'](_0x4b052d['shift']());}};_0x4a1c33(++_0x4955d5);}(_0x19da,0x9f));var _0xa19d=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x19da[_0x1809c5];return _0x5254a4;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var logger=require('../../config/logger')(_0xa19d('0x1'));var moment=require('moment');var BPromise=require(_0xa19d('0x2'));var rp=require(_0xa19d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa19d('0x4'));var config=require(_0xa19d('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0xa19d('0x6')]=function(_0x330adb,_0x1f6e10){return _0x330adb[_0xa19d('0x7')](_0xa19d('0x8'),attributes,{'tableName':_0xa19d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa19d('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 184727b..19d7c7c 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 _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x436595,_0xaabd13){var _0xb037f9=function(_0x167be6){while(--_0x167be6){_0x436595['push'](_0x436595['shift']());}};_0xb037f9(++_0xaabd13);}(_0x54ef,0x112));var _0xf54e=function(_0x4dfa92,_0x3aa064){_0x4dfa92=_0x4dfa92-0x0;var _0x44d71a=_0x54ef[_0x4dfa92];return _0x44d71a;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file +var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x12de2a,_0x82b054){var _0x429db4=function(_0x4ab6f6){while(--_0x4ab6f6){_0x12de2a['push'](_0x12de2a['shift']());}};_0x429db4(++_0x82b054);}(_0xac9d,0x14d));var _0xdac9=function(_0x20edcb,_0x4d49a8){_0x20edcb=_0x20edcb-0x0;var _0x1ced78=_0xac9d[_0x20edcb];return _0x1ced78;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 20d6c2e..809b8f6 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 _0xda19=['/:id/tags','removeTags','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','whatsappinteraction:addtags','put','/:id','tracked','whatsapp','update','delete'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xda19,0xd5));var _0x9da1=function(_0x4c7182,_0x2db9e4){_0x4c7182=_0x4c7182-0x0;var _0x335cd5=_0xda19[_0x4c7182];return _0x335cd5;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')]('/',auth[_0x9da1('0x8')](),controller[_0x9da1('0x9')]);router[_0x9da1('0x7')](_0x9da1('0xa'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router['get'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xe')]);router[_0x9da1('0x7')](_0x9da1('0xf'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9da1('0x11')]);router['post'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x12')]);router[_0x9da1('0x13')]('/:id/tags',auth[_0x9da1('0x8')](),interaction['tracked']('whatsapp',_0x9da1('0x14')),controller['addTags']);router[_0x9da1('0x15')](_0x9da1('0x16'),auth[_0x9da1('0x8')](),interaction[_0x9da1('0x17')](_0x9da1('0x18'),'whatsappinteraction:update'),controller[_0x9da1('0x19')]);router[_0x9da1('0x1a')](_0x9da1('0x16'),auth[_0x9da1('0x8')](),interaction[_0x9da1('0x17')](_0x9da1('0x18'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x9da1('0x1a')](_0x9da1('0x1b'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x1c')]);module[_0x9da1('0x1d')]=router; \ No newline at end of file +var _0x4c60=['update','delete','destroy','/:id/tags','multer','util','path','connect-timeout','Router','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','/:id/download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update'];(function(_0x1fa0d4,_0x34ce95){var _0x42aaae=function(_0x1cfbd7){while(--_0x1cfbd7){_0x1fa0d4['push'](_0x1fa0d4['shift']());}};_0x42aaae(++_0x34ce95);}(_0x4c60,0xc1));var _0x04c6=function(_0x52ac11,_0xd95e8a){_0x52ac11=_0x52ac11-0x0;var _0x3e8ffb=_0x4c60[_0x52ac11];return _0x3e8ffb;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['describe']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x04c6('0xc')]);router['get'](_0x04c6('0xd'),auth[_0x04c6('0x7')](),controller['download']);router[_0x04c6('0xe')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0xf')]);router[_0x04c6('0xe')]('/:id/messages',auth[_0x04c6('0x7')](),controller[_0x04c6('0x10')]);router[_0x04c6('0xe')]('/:id/tags',auth[_0x04c6('0x7')](),interaction[_0x04c6('0x11')](_0x04c6('0x12'),_0x04c6('0x13')),controller[_0x04c6('0x14')]);router[_0x04c6('0x15')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),interaction['tracked'](_0x04c6('0x12'),_0x04c6('0x16')),controller[_0x04c6('0x17')]);router[_0x04c6('0x18')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),interaction[_0x04c6('0x11')](_0x04c6('0x12'),'whatsappinteraction:destroy'),controller[_0x04c6('0x19')]);router[_0x04c6('0x18')](_0x04c6('0x1a'),auth['isAuthenticated'](),controller['removeTags']);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 345b423..3023263 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 _0x6688=['DATE','STRING','out','BOOLEAN','sequelize','moment','exports'];(function(_0x22e4a5,_0x4b1dc1){var _0x2b3e4a=function(_0x4738d3){while(--_0x4738d3){_0x22e4a5['push'](_0x22e4a5['shift']());}};_0x2b3e4a(++_0x4b1dc1);}(_0x6688,0x10e));var _0x8668=function(_0x1e4817,_0xc9a546){_0x1e4817=_0x1e4817-0x0;var _0x94b227=_0x6688[_0x1e4817];return _0x94b227;};'use strict';var Sequelize=require(_0x8668('0x0'));var moment=require(_0x8668('0x1'));module[_0x8668('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8668('0x3')]},'disposition':{'type':Sequelize[_0x8668('0x4')]},'secondDisposition':{'type':Sequelize[_0x8668('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8668('0x4')]},'note':{'type':Sequelize[_0x8668('0x4')]},'phone':{'type':Sequelize[_0x8668('0x4')]},'read1stAt':{'type':Sequelize[_0x8668('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8668('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8668('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8668('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8668('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xea03=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x242465,_0x1cacea){var _0xd1a501=function(_0x547877){while(--_0x547877){_0x242465['push'](_0x242465['shift']());}};_0xd1a501(++_0x1cacea);}(_0xea03,0x1ba));var _0x3ea0=function(_0x3e6ead,_0x61f91a){_0x3e6ead=_0x3e6ead-0x0;var _0x28f590=_0xea03[_0x3e6ead];return _0x28f590;};'use strict';var Sequelize=require(_0x3ea0('0x0'));var moment=require('moment');module[_0x3ea0('0x1')]={'closed':{'type':Sequelize[_0x3ea0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3ea0('0x3')]},'disposition':{'type':Sequelize[_0x3ea0('0x4')]},'secondDisposition':{'type':Sequelize[_0x3ea0('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3ea0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3ea0('0x5')]('in',_0x3ea0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3ea0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3ea0('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3ea0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 3ea9faf..4ebb251 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 _0x0b3a=['transcript-%d-%s.zip','User','fullname','push','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','Owner','get','mkdirSync','Whatsapp','Account','toString','closed','disposition','Attachment','basename','existsSync','createReadStream','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','offset','undefined','count','Content-Range','json','update','then','stack','name','send','rawAttributes','getOptions','findAll','whatsapp','query','catch','show','params','keys','WhatsappInteraction','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','destroy','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','tmp','files','attachments','join'];(function(_0x238733,_0x3d9dc5){var _0x269f89=function(_0x47d16d){while(--_0x47d16d){_0x238733['push'](_0x238733['shift']());}};_0x269f89(++_0x3d9dc5);}(_0x0b3a,0x114));var _0xa0b3=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x0b3a[_0x217ff6];return _0x417c93;};'use strict';var rimraf=require(_0xa0b3('0x0'));var zipdir=require('zip-dir');var moment=require(_0xa0b3('0x1'));var BPromise=require(_0xa0b3('0x2'));var util=require(_0xa0b3('0x3'));var path=require(_0xa0b3('0x4'));var ejs=require(_0xa0b3('0x5'));var fs=require('fs');var _=require(_0xa0b3('0x6'));var Redis=require(_0xa0b3('0x7'));var interaction=require(_0xa0b3('0x8'));var qs=require(_0xa0b3('0x9'));var pdf=require(_0xa0b3('0xa'));var logger=require('../../config/logger')(_0xa0b3('0xb'));var config=require(_0xa0b3('0xc'));var db=require('../../mysqldb')['db'];config[_0xa0b3('0xd')]=_[_0xa0b3('0xe')](config['redis'],{'host':_0xa0b3('0xf'),'port':0x18eb});var socket=require(_0xa0b3('0x10'))(new Redis(config[_0xa0b3('0xd')]));require(_0xa0b3('0x11'))[_0xa0b3('0x12')](socket);function respondWithStatusCode(_0x469f98,_0x11a0fc){_0x11a0fc=_0x11a0fc||0xcc;return function(_0x226bf4){if(_0x226bf4){return _0x469f98[_0xa0b3('0x13')](_0x11a0fc);}return _0x469f98['status'](_0x11a0fc)[_0xa0b3('0x14')]();};}function respondWithResult(_0x3c1242,_0x405c69){_0x405c69=_0x405c69||0xc8;return function(_0x5eac01){if(_0x5eac01){return _0x3c1242[_0xa0b3('0x15')](_0x405c69)['json'](_0x5eac01);}};}function respondWithFilteredResult(_0x279c95,_0x317c05){return function(_0x3debf1){if(_0x3debf1){var _0xe258ac=typeof _0x317c05[_0xa0b3('0x16')]===_0xa0b3('0x17')&&typeof _0x317c05['limit']===_0xa0b3('0x17');var _0x3f23a8=_0x3debf1['count'];var _0x568007=_0xe258ac?0x0:_0x317c05[_0xa0b3('0x16')];var _0x6a79f2=_0xe258ac?_0x3debf1[_0xa0b3('0x18')]:_0x317c05[_0xa0b3('0x16')]+_0x317c05['limit'];var _0x7b079;if(_0x6a79f2>=_0x3f23a8){_0x6a79f2=_0x3f23a8;_0x7b079=0xc8;}else{_0x7b079=0xce;}_0x279c95[_0xa0b3('0x15')](_0x7b079);return _0x279c95['set'](_0xa0b3('0x19'),_0x568007+'-'+_0x6a79f2+'/'+_0x3f23a8)[_0xa0b3('0x1a')](_0x3debf1);}return null;};}function saveUpdates(_0x1e3c39){return function(_0x23e490){if(_0x23e490){return _0x23e490[_0xa0b3('0x1b')](_0x1e3c39)[_0xa0b3('0x1c')](function(_0x4b21a0){return _0x4b21a0;});}return null;};}function removeEntity(_0x426b91){return function(_0x1a6e0b){if(_0x1a6e0b){return _0x1a6e0b['destroy']()[_0xa0b3('0x1c')](function(){_0x426b91[_0xa0b3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d28c5){return function(_0x42e7e0){if(!_0x42e7e0){_0x4d28c5['sendStatus'](0x194);}return _0x42e7e0;};}function handleError(_0x354be1,_0x3f3560){_0x3f3560=_0x3f3560||0x1f4;return function(_0x394a04){logger['error'](_0x394a04[_0xa0b3('0x1d')]);if(_0x394a04[_0xa0b3('0x1e')]){delete _0x394a04[_0xa0b3('0x1e')];}_0x354be1[_0xa0b3('0x15')](_0x3f3560)[_0xa0b3('0x1f')](_0x394a04);};}exports['index']=function(_0x43db5c,_0xca2546){var _0x5f08f0={};var _0x3e8ff0=_['map'](db['WhatsappInteraction'][_0xa0b3('0x20')],function(_0x491638){return{'name':_0x491638['fieldName'],'type':_0x491638['type']['key']};});_0x5f08f0=qs[_0xa0b3('0x21')](_0x3e8ff0,_0x43db5c);return interaction[_0xa0b3('0x22')](_0xa0b3('0x23'),_0x43db5c[_0xa0b3('0x24')],_0x43db5c['user'],_0x5f08f0,_0x3e8ff0)[_0xa0b3('0x1c')](respondWithFilteredResult(_0xca2546,_0x5f08f0))[_0xa0b3('0x25')](handleError(_0xca2546,null));};exports[_0xa0b3('0x26')]=function(_0x383eb2,_0x81fd75){var _0x48ca71={'raw':![],'where':{'id':_0x383eb2[_0xa0b3('0x27')]['id']}},_0x272464={};_0x272464['model']=_[_0xa0b3('0x28')](db[_0xa0b3('0x29')][_0xa0b3('0x20')]);_0x272464['query']=_['keys'](_0x383eb2[_0xa0b3('0x24')]);_0x272464[_0xa0b3('0x2a')]=_[_0xa0b3('0x2b')](_0x272464[_0xa0b3('0x2c')],_0x272464['query']);_0x48ca71[_0xa0b3('0x2d')]=_[_0xa0b3('0x2b')](_0x272464[_0xa0b3('0x2c')],qs[_0xa0b3('0x2e')](_0x383eb2[_0xa0b3('0x24')]['fields']));_0x48ca71[_0xa0b3('0x2d')]=_0x48ca71['attributes'][_0xa0b3('0x2f')]?_0x48ca71[_0xa0b3('0x2d')]:_0x272464[_0xa0b3('0x2c')];if(_0x383eb2[_0xa0b3('0x24')][_0xa0b3('0x30')]){_0x48ca71['include']=[{'all':!![]}];}_0x48ca71=_[_0xa0b3('0x31')]({},_0x48ca71,_0x383eb2[_0xa0b3('0x32')]);return db[_0xa0b3('0x29')][_0xa0b3('0x33')](_0x48ca71)[_0xa0b3('0x1c')](handleEntityNotFound(_0x81fd75,null))[_0xa0b3('0x1c')](respondWithResult(_0x81fd75,null))[_0xa0b3('0x25')](handleError(_0x81fd75,null));};exports[_0xa0b3('0x34')]=function(_0x4b1a73,_0x2b0395){return db['WhatsappInteraction'][_0xa0b3('0x34')](_0x4b1a73[_0xa0b3('0x35')],{})[_0xa0b3('0x1c')](respondWithResult(_0x2b0395,0xc9))[_0xa0b3('0x25')](handleError(_0x2b0395,null));};exports[_0xa0b3('0x1b')]=function(_0x4e7483,_0x4a9361){if(_0x4e7483[_0xa0b3('0x35')]['id']){delete _0x4e7483[_0xa0b3('0x35')]['id'];}return db[_0xa0b3('0x29')][_0xa0b3('0x33')]({'where':{'id':_0x4e7483[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x4a9361,null))[_0xa0b3('0x1c')](saveUpdates(_0x4e7483[_0xa0b3('0x35')],null))['then'](respondWithResult(_0x4a9361,null))[_0xa0b3('0x25')](handleError(_0x4a9361,null));};exports[_0xa0b3('0x36')]=function(_0xb768c9,_0x3c75fb){return db[_0xa0b3('0x29')][_0xa0b3('0x33')]({'where':{'id':_0xb768c9[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x3c75fb,null))[_0xa0b3('0x1c')](removeEntity(_0x3c75fb,null))[_0xa0b3('0x25')](handleError(_0x3c75fb,null));};exports['describe']=function(_0x1ed751,_0x3fc197){return db['WhatsappInteraction']['describe']()[_0xa0b3('0x1c')](respondWithResult(_0x3fc197,null))[_0xa0b3('0x25')](handleError(_0x3fc197,null));};exports[_0xa0b3('0x37')]=function(_0x10495c,_0x58aad4){return db[_0xa0b3('0x38')][_0xa0b3('0x33')]({'where':{'id':_0x10495c[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x58aad4,null))[_0xa0b3('0x1c')](function(_0x3c788c){if(_0x3c788c){return _0x3c788c[_0xa0b3('0x37')](_0x10495c[_0xa0b3('0x35')][_0xa0b3('0x39')],_[_0xa0b3('0x3a')](_0x10495c[_0xa0b3('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x58aad4,null))[_0xa0b3('0x25')](handleError(_0x58aad4,null));};exports[_0xa0b3('0x3b')]=function(_0x58393c,_0x347c87){var _0x4af8ee={'raw':![],'where':{}};var _0x3c240a={};var _0x245323={'count':0x0,'rows':[]};return db[_0xa0b3('0x29')][_0xa0b3('0x3c')]({'where':{'id':_0x58393c[_0xa0b3('0x27')]['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x347c87,null))[_0xa0b3('0x1c')](function(_0x58db75){if(_0x58db75){_0x3c240a['model']=_[_0xa0b3('0x28')](db[_0xa0b3('0x38')][_0xa0b3('0x20')]);_0x3c240a[_0xa0b3('0x24')]=_['keys'](_0x58393c[_0xa0b3('0x24')]);_0x3c240a['filters']=_[_0xa0b3('0x2b')](_0x3c240a['model'],_0x3c240a['query']);_0x4af8ee[_0xa0b3('0x2d')]=_[_0xa0b3('0x2b')](_0x3c240a[_0xa0b3('0x2c')],qs[_0xa0b3('0x2e')](_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x2e')]));_0x4af8ee[_0xa0b3('0x2d')]=_0x4af8ee[_0xa0b3('0x2d')]['length']?_0x4af8ee[_0xa0b3('0x2d')]:_0x3c240a['model'];if(!_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x3d')](_0xa0b3('0x3e'))){_0x4af8ee[_0xa0b3('0x3f')]=qs[_0xa0b3('0x3f')](_0x58393c[_0xa0b3('0x24')]['limit']);_0x4af8ee[_0xa0b3('0x16')]=qs[_0xa0b3('0x16')](_0x58393c['query'][_0xa0b3('0x16')]);}_0x4af8ee[_0xa0b3('0x40')]=qs['sort'](_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x41')]);_0x4af8ee['where']=qs[_0xa0b3('0x2a')](_['pick'](_0x58393c[_0xa0b3('0x24')],_0x3c240a[_0xa0b3('0x2a')]));_0x4af8ee[_0xa0b3('0x42')]['WhatsappInteractionId']=_0x58db75['id'];if(_0x58393c['query'][_0xa0b3('0x43')]){_0x4af8ee[_0xa0b3('0x42')]=_[_0xa0b3('0x31')](_0x4af8ee[_0xa0b3('0x42')],{'$or':_[_0xa0b3('0x44')](_0x4af8ee[_0xa0b3('0x2d')],function(_0x21b565){var _0x36da16={};_0x36da16[_0x21b565]={'$like':'%'+_0x58393c[_0xa0b3('0x24')]['filter']+'%'};return _0x36da16;})});}if(_0x58393c[_0xa0b3('0x24')]['$gte']){var _0x1c6c1b=_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x45')][_0xa0b3('0x46')](',');var _0x4c752d={};_0x4c752d[_0x1c6c1b[0x0]]={'$gte':moment(_0x1c6c1b[0x1])[_0xa0b3('0x47')](_0xa0b3('0x48'))};_0x4af8ee[_0xa0b3('0x42')]=_[_0xa0b3('0x31')](_0x4af8ee[_0xa0b3('0x42')],_0x4c752d);}_0x4af8ee=_['merge']({},_0x4af8ee,_0x58393c[_0xa0b3('0x32')]);return db[_0xa0b3('0x38')]['count']({'where':_0x4af8ee['where']})[_0xa0b3('0x1c')](function(_0x1f61a4){_0x245323[_0xa0b3('0x18')]=_0x1f61a4;if(_0x58393c[_0xa0b3('0x24')][_0xa0b3('0x30')]){_0x4af8ee[_0xa0b3('0x49')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x4af8ee);})[_0xa0b3('0x1c')](function(_0x1d8c1b){_0x245323['rows']=_0x1d8c1b;return _0x245323;});}})['then'](respondWithFilteredResult(_0x347c87,_0x4af8ee))[_0xa0b3('0x25')](handleError(_0x347c87,null));};exports[_0xa0b3('0x4a')]=function(_0x9fc589,_0x4125d4){return db[_0xa0b3('0x29')]['find']({'where':{'id':_0x9fc589['params']['id']}})[_0xa0b3('0x1c')](handleEntityNotFound(_0x4125d4,null))['then'](function(_0x5799d3){if(_0x5799d3){return _0x5799d3['setTags'](_0x9fc589[_0xa0b3('0x35')]['ids'],_[_0xa0b3('0x3a')](_0x9fc589[_0xa0b3('0x35')],[_0xa0b3('0x39'),'id'])||{})['spread'](function(){return db[_0xa0b3('0x4b')]['findAll']({'attributes':['id',_0xa0b3('0x1e'),'color'],'where':{'id':_0x9fc589[_0xa0b3('0x35')][_0xa0b3('0x39')]}});})[_0xa0b3('0x1c')](function(_0x4b76fb){socket[_0xa0b3('0x4c')](_0xa0b3('0x4d'),{'id':Number(_0x9fc589[_0xa0b3('0x27')]['id']),'tags':_0x4b76fb||[]});return{'id':Number(_0x9fc589[_0xa0b3('0x27')]['id']),'tags':_0x4b76fb||[]};});}})[_0xa0b3('0x1c')](respondWithResult(_0x4125d4,null))[_0xa0b3('0x25')](handleError(_0x4125d4,null));};exports[_0xa0b3('0x4e')]=function(_0x19f2ff,_0x6ee749){return db['WhatsappInteraction']['find']({'where':{'id':_0x19f2ff['params']['id']}})['then'](handleEntityNotFound(_0x6ee749,null))[_0xa0b3('0x1c')](function(_0x3787fa){if(_0x3787fa){return _0x3787fa[_0xa0b3('0x4e')](_0x19f2ff[_0xa0b3('0x24')][_0xa0b3('0x39')]);}})[_0xa0b3('0x1c')](respondWithStatusCode(_0x6ee749,null))[_0xa0b3('0x25')](handleError(_0x6ee749,null));};exports[_0xa0b3('0x4f')]=function(_0x27dd76,_0x19bfd2){var _0x47e32a=moment()[_0xa0b3('0x50')]()['toString']();var _0x151b63=path['join'](config[_0xa0b3('0x51')],_0xa0b3('0x52'),'files',_0xa0b3('0x53'));var _0x25693d=path['join'](config[_0xa0b3('0x51')],_0xa0b3('0x52'),_0xa0b3('0x54'),_0xa0b3('0x55'));var _0x2d5651=path[_0xa0b3('0x56')](_0x151b63,_0x47e32a);var _0x891b96=util['format'](_0xa0b3('0x57'),_0x27dd76[_0xa0b3('0x27')]['id'],_0x47e32a);var _0x2a2441=path[_0xa0b3('0x56')](_0x151b63,_0x891b96);var _0x2dc31e=[];_0x2dc31e['push']({'model':db[_0xa0b3('0x58')],'as':'User','attributes':['id',_0xa0b3('0x59')],'raw':!![]});_0x2dc31e[_0xa0b3('0x5a')]({'model':db['CmContact'],'as':_0xa0b3('0x5b'),'attributes':['id',_0xa0b3('0x5c'),_0xa0b3('0x5d')],'raw':!![]});if(_0x27dd76[_0xa0b3('0x24')]['attachments']){_0x2dc31e[_0xa0b3('0x5a')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x348cfc=[{'model':db['WhatsappMessage'],'as':_0xa0b3('0x5e'),'attributes':['id',_0xa0b3('0x35'),_0xa0b3('0x5f'),_0xa0b3('0x60'),_0xa0b3('0x61'),_0xa0b3('0x62')],'include':_0x2dc31e}];_0x348cfc[_0xa0b3('0x5a')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xa0b3('0x1e')]});_0x348cfc[_0xa0b3('0x5a')]({'model':db[_0xa0b3('0x58')],'as':_0xa0b3('0x63'),'attributes':['id',_0xa0b3('0x59')]});return db[_0xa0b3('0x29')]['find']({'where':{'id':_0x27dd76[_0xa0b3('0x27')]['id']},'include':_0x348cfc})[_0xa0b3('0x1c')](handleEntityNotFound(_0x19bfd2,null))[_0xa0b3('0x1c')](function(_0x4d4589){if(_0x4d4589){var _0x4cb3a8=_0x4d4589[_0xa0b3('0x64')]({'plain':!![]});fs[_0xa0b3('0x65')](_0x2d5651);var _0x309a23={'channel':_0xa0b3('0x66'),'account':_0x4cb3a8[_0xa0b3('0x67')][_0xa0b3('0x1e')],'agent':_0x4cb3a8[_0xa0b3('0x63')]?_0x4cb3a8[_0xa0b3('0x63')][_0xa0b3('0x59')]:'N.A.','createdAt':moment(_0x4cb3a8[_0xa0b3('0x5f')])[_0xa0b3('0x47')](_0xa0b3('0x48'))[_0xa0b3('0x68')](),'closedAt':_0x4cb3a8[_0xa0b3('0x69')]?moment(_0x4cb3a8['closedAt'])[_0xa0b3('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa0b3('0x68')]():'','disposition':_0x4cb3a8[_0xa0b3('0x6a')],'messages':_(_0x4cb3a8[_0xa0b3('0x5e')])['filter']({'secret':![]})[_0xa0b3('0x44')](function(_0x64fb06){if(_0x64fb06[_0xa0b3('0x6b')]){var _0x610ad2=path[_0xa0b3('0x56')](_0x25693d,_0x64fb06[_0xa0b3('0x6b')][_0xa0b3('0x6c')]);if(fs[_0xa0b3('0x6d')](_0x610ad2)){fs[_0xa0b3('0x6e')](_0x610ad2)['pipe'](fs[_0xa0b3('0x6f')](path['join'](_0x2d5651,_0x64fb06[_0xa0b3('0x6b')]['basename'])));}}return{'date':moment(_0x64fb06[_0xa0b3('0x5f')])[_0xa0b3('0x47')](_0xa0b3('0x48'))[_0xa0b3('0x68')](),'sender':_0x64fb06[_0xa0b3('0x60')]===_0xa0b3('0x70')?_0x64fb06[_0xa0b3('0x58')]?_0x64fb06[_0xa0b3('0x58')][_0xa0b3('0x59')]:_0xa0b3('0x71'):_0x64fb06[_0xa0b3('0x5b')][_0xa0b3('0x5c')]+(_0x64fb06[_0xa0b3('0x5b')][_0xa0b3('0x5d')]?'\x20'+_0x64fb06[_0xa0b3('0x5b')]['lastName']:''),'body':_0x64fb06[_0xa0b3('0x6b')]?_0x64fb06[_0xa0b3('0x6b')][_0xa0b3('0x6c')]:_0x64fb06[_0xa0b3('0x35')],'direction':_0x64fb06['direction']===_0xa0b3('0x70')?'A':'C','secret':_0x64fb06['secret'],'read':_0x64fb06[_0xa0b3('0x62')],'attachment':_0x64fb06[_0xa0b3('0x6b')]};})['value']()};return ejs[_0xa0b3('0x72')](path[_0xa0b3('0x56')](config[_0xa0b3('0x51')],_0xa0b3('0x52'),_0xa0b3('0x73'),_0xa0b3('0x74')),{'interaction':_0x309a23})[_0xa0b3('0x1c')](function(_0x44361b){var _0x4e2a14=path[_0xa0b3('0x56')](_0x2d5651,_0xa0b3('0x75')+_0x4cb3a8['id']+'-'+_0x47e32a+'.pdf');var _0x37e32f={'path':_0x4e2a14,'channel':_0xa0b3('0x66'),'interactionId':_0x4cb3a8['id']};return pdf[_0xa0b3('0x76')](_0x44361b,_0x37e32f);})[_0xa0b3('0x1c')](function(){return new BPromise(function(_0x281ce9,_0x21fa8e){zipdir(_0x2d5651,{'saveTo':_0x2a2441},function(_0x127274,_0x313797){if(_0x127274)return _0x21fa8e(_0x127274);return _0x281ce9(_0x313797);});})[_0xa0b3('0x1c')](function(){return new BPromise(function(_0x2aee52,_0x169598){rimraf(_0x2d5651,function(_0x6f7a4){if(_0x6f7a4)_0x169598(_0x6f7a4);return _0x2aee52();});});})[_0xa0b3('0x1c')](function(){return _0x19bfd2['download'](_0x2a2441,_0x891b96,function(_0x2f548a){if(_0x2f548a){console['log'](_0xa0b3('0x77'),_0x2f548a);}else{fs[_0xa0b3('0x78')](_0x2a2441);}});});});}else{return _0x19bfd2[_0xa0b3('0x13')](0xc8);}})[_0xa0b3('0x25')](handleError(_0x19bfd2,null));}; \ No newline at end of file +var _0xf7f5=['../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','catch','params','model','keys','WhatsappInteraction','filters','intersection','attributes','fields','length','merge','options','create','body','update','find','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','sort','where','pick','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','push','User','fullname','CmContact','Contact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','Account','get','Whatsapp','Owner','format','closed','closedAt','disposition','existsSync','createWriteStream','basename','out','System','lastName','value','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs'];(function(_0x4b3637,_0x3657ea){var _0x2fcb89=function(_0x4ed7c3){while(--_0x4ed7c3){_0x4b3637['push'](_0x4b3637['shift']());}};_0x2fcb89(++_0x3657ea);}(_0xf7f5,0xf2));var _0x5f7f=function(_0x3362b8,_0x590609){_0x3362b8=_0x3362b8-0x0;var _0x5e5e03=_0xf7f5[_0x3362b8];return _0x5e5e03;};'use strict';var rimraf=require(_0x5f7f('0x0'));var zipdir=require(_0x5f7f('0x1'));var moment=require(_0x5f7f('0x2'));var BPromise=require(_0x5f7f('0x3'));var util=require(_0x5f7f('0x4'));var path=require(_0x5f7f('0x5'));var ejs=require(_0x5f7f('0x6'));var fs=require('fs');var _=require(_0x5f7f('0x7'));var Redis=require('ioredis');var interaction=require(_0x5f7f('0x8'));var qs=require(_0x5f7f('0x9'));var pdf=require(_0x5f7f('0xa'));var logger=require('../../config/logger')(_0x5f7f('0xb'));var config=require(_0x5f7f('0xc'));var db=require(_0x5f7f('0xd'))['db'];config['redis']=_[_0x5f7f('0xe')](config[_0x5f7f('0xf')],{'host':_0x5f7f('0x10'),'port':0x18eb});var socket=require(_0x5f7f('0x11'))(new Redis(config[_0x5f7f('0xf')]));require(_0x5f7f('0x12'))[_0x5f7f('0x13')](socket);function respondWithStatusCode(_0xc48511,_0x20a85b){_0x20a85b=_0x20a85b||0xcc;return function(_0x424331){if(_0x424331){return _0xc48511[_0x5f7f('0x14')](_0x20a85b);}return _0xc48511[_0x5f7f('0x15')](_0x20a85b)['end']();};}function respondWithResult(_0xf8882f,_0x1ec5ec){_0x1ec5ec=_0x1ec5ec||0xc8;return function(_0x361f29){if(_0x361f29){return _0xf8882f[_0x5f7f('0x15')](_0x1ec5ec)[_0x5f7f('0x16')](_0x361f29);}};}function respondWithFilteredResult(_0xfa5de1,_0x437f1d){return function(_0x493bf3){if(_0x493bf3){var _0x392526=typeof _0x437f1d[_0x5f7f('0x17')]===_0x5f7f('0x18')&&typeof _0x437f1d[_0x5f7f('0x19')]==='undefined';var _0x2aa30e=_0x493bf3[_0x5f7f('0x1a')];var _0x3e83f1=_0x392526?0x0:_0x437f1d[_0x5f7f('0x17')];var _0xea9304=_0x392526?_0x493bf3[_0x5f7f('0x1a')]:_0x437f1d[_0x5f7f('0x17')]+_0x437f1d[_0x5f7f('0x19')];var _0x4c49df;if(_0xea9304>=_0x2aa30e){_0xea9304=_0x2aa30e;_0x4c49df=0xc8;}else{_0x4c49df=0xce;}_0xfa5de1[_0x5f7f('0x15')](_0x4c49df);return _0xfa5de1['set'](_0x5f7f('0x1b'),_0x3e83f1+'-'+_0xea9304+'/'+_0x2aa30e)['json'](_0x493bf3);}return null;};}function saveUpdates(_0x142d4a){return function(_0x43f001){if(_0x43f001){return _0x43f001['update'](_0x142d4a)['then'](function(_0x5c04fa){return _0x5c04fa;});}return null;};}function removeEntity(_0x2418b6){return function(_0x283cb8){if(_0x283cb8){return _0x283cb8[_0x5f7f('0x1c')]()[_0x5f7f('0x1d')](function(){_0x2418b6[_0x5f7f('0x15')](0xcc)[_0x5f7f('0x1e')]();});}};}function handleEntityNotFound(_0x1ff47f){return function(_0x47593f){if(!_0x47593f){_0x1ff47f['sendStatus'](0x194);}return _0x47593f;};}function handleError(_0x544faa,_0x512381){_0x512381=_0x512381||0x1f4;return function(_0x406987){logger[_0x5f7f('0x1f')](_0x406987['stack']);if(_0x406987[_0x5f7f('0x20')]){delete _0x406987['name'];}_0x544faa[_0x5f7f('0x15')](_0x512381)[_0x5f7f('0x21')](_0x406987);};}exports[_0x5f7f('0x22')]=function(_0x150934,_0x4e5c07){var _0x43b4d3={};var _0x5cad68=_[_0x5f7f('0x23')](db['WhatsappInteraction'][_0x5f7f('0x24')],function(_0x499b76){return{'name':_0x499b76[_0x5f7f('0x25')],'type':_0x499b76[_0x5f7f('0x26')][_0x5f7f('0x27')]};});_0x43b4d3=qs[_0x5f7f('0x28')](_0x5cad68,_0x150934);return interaction[_0x5f7f('0x29')](_0x5f7f('0x2a'),_0x150934[_0x5f7f('0x2b')],_0x150934['user'],_0x43b4d3,_0x5cad68)[_0x5f7f('0x1d')](respondWithFilteredResult(_0x4e5c07,_0x43b4d3))[_0x5f7f('0x2c')](handleError(_0x4e5c07,null));};exports['show']=function(_0x31ba90,_0x500a3f){var _0x49161b={'raw':![],'where':{'id':_0x31ba90[_0x5f7f('0x2d')]['id']}},_0x58e4e3={};_0x58e4e3[_0x5f7f('0x2e')]=_[_0x5f7f('0x2f')](db[_0x5f7f('0x30')][_0x5f7f('0x24')]);_0x58e4e3['query']=_[_0x5f7f('0x2f')](_0x31ba90[_0x5f7f('0x2b')]);_0x58e4e3[_0x5f7f('0x31')]=_[_0x5f7f('0x32')](_0x58e4e3['model'],_0x58e4e3[_0x5f7f('0x2b')]);_0x49161b[_0x5f7f('0x33')]=_[_0x5f7f('0x32')](_0x58e4e3['model'],qs[_0x5f7f('0x34')](_0x31ba90['query'][_0x5f7f('0x34')]));_0x49161b[_0x5f7f('0x33')]=_0x49161b[_0x5f7f('0x33')][_0x5f7f('0x35')]?_0x49161b[_0x5f7f('0x33')]:_0x58e4e3['model'];if(_0x31ba90[_0x5f7f('0x2b')]['includeAll']){_0x49161b['include']=[{'all':!![]}];}_0x49161b=_[_0x5f7f('0x36')]({},_0x49161b,_0x31ba90[_0x5f7f('0x37')]);return db[_0x5f7f('0x30')]['find'](_0x49161b)[_0x5f7f('0x1d')](handleEntityNotFound(_0x500a3f,null))[_0x5f7f('0x1d')](respondWithResult(_0x500a3f,null))[_0x5f7f('0x2c')](handleError(_0x500a3f,null));};exports[_0x5f7f('0x38')]=function(_0x36ad27,_0x55598b){return db['WhatsappInteraction'][_0x5f7f('0x38')](_0x36ad27[_0x5f7f('0x39')],{})[_0x5f7f('0x1d')](respondWithResult(_0x55598b,0xc9))['catch'](handleError(_0x55598b,null));};exports[_0x5f7f('0x3a')]=function(_0x4106d5,_0x5b8a0a){if(_0x4106d5[_0x5f7f('0x39')]['id']){delete _0x4106d5[_0x5f7f('0x39')]['id'];}return db[_0x5f7f('0x30')][_0x5f7f('0x3b')]({'where':{'id':_0x4106d5[_0x5f7f('0x2d')]['id']}})[_0x5f7f('0x1d')](handleEntityNotFound(_0x5b8a0a,null))['then'](saveUpdates(_0x4106d5[_0x5f7f('0x39')],null))[_0x5f7f('0x1d')](respondWithResult(_0x5b8a0a,null))['catch'](handleError(_0x5b8a0a,null));};exports[_0x5f7f('0x1c')]=function(_0x20c776,_0x561ca2){return db[_0x5f7f('0x30')][_0x5f7f('0x3b')]({'where':{'id':_0x20c776[_0x5f7f('0x2d')]['id']}})[_0x5f7f('0x1d')](handleEntityNotFound(_0x561ca2,null))[_0x5f7f('0x1d')](removeEntity(_0x561ca2,null))['catch'](handleError(_0x561ca2,null));};exports['describe']=function(_0x1c5685,_0x1b2c40){return db[_0x5f7f('0x30')][_0x5f7f('0x3c')]()[_0x5f7f('0x1d')](respondWithResult(_0x1b2c40,null))['catch'](handleError(_0x1b2c40,null));};exports[_0x5f7f('0x3d')]=function(_0xd281f6,_0x3a70c6){return db[_0x5f7f('0x3e')][_0x5f7f('0x3b')]({'where':{'id':_0xd281f6[_0x5f7f('0x2d')]['id']}})[_0x5f7f('0x1d')](handleEntityNotFound(_0x3a70c6,null))[_0x5f7f('0x1d')](function(_0x30cbbe){if(_0x30cbbe){return _0x30cbbe[_0x5f7f('0x3d')](_0xd281f6[_0x5f7f('0x39')]['ids'],_[_0x5f7f('0x3f')](_0xd281f6[_0x5f7f('0x39')],[_0x5f7f('0x40'),'id'])||{});}})[_0x5f7f('0x1d')](respondWithResult(_0x3a70c6,null))[_0x5f7f('0x2c')](handleError(_0x3a70c6,null));};exports[_0x5f7f('0x41')]=function(_0x23b42c,_0x3e22f6){var _0x37c5e4={'raw':![],'where':{}};var _0xf9161c={};var _0x594f56={'count':0x0,'rows':[]};return db[_0x5f7f('0x30')][_0x5f7f('0x42')]({'where':{'id':_0x23b42c['params']['id']}})['then'](handleEntityNotFound(_0x3e22f6,null))[_0x5f7f('0x1d')](function(_0x4fdd6c){if(_0x4fdd6c){_0xf9161c['model']=_[_0x5f7f('0x2f')](db[_0x5f7f('0x3e')][_0x5f7f('0x24')]);_0xf9161c[_0x5f7f('0x2b')]=_['keys'](_0x23b42c[_0x5f7f('0x2b')]);_0xf9161c[_0x5f7f('0x31')]=_['intersection'](_0xf9161c['model'],_0xf9161c[_0x5f7f('0x2b')]);_0x37c5e4[_0x5f7f('0x33')]=_[_0x5f7f('0x32')](_0xf9161c['model'],qs['fields'](_0x23b42c[_0x5f7f('0x2b')][_0x5f7f('0x34')]));_0x37c5e4['attributes']=_0x37c5e4['attributes']['length']?_0x37c5e4[_0x5f7f('0x33')]:_0xf9161c[_0x5f7f('0x2e')];if(!_0x23b42c['query'][_0x5f7f('0x43')](_0x5f7f('0x44'))){_0x37c5e4[_0x5f7f('0x19')]=qs[_0x5f7f('0x19')](_0x23b42c[_0x5f7f('0x2b')][_0x5f7f('0x19')]);_0x37c5e4[_0x5f7f('0x17')]=qs[_0x5f7f('0x17')](_0x23b42c[_0x5f7f('0x2b')][_0x5f7f('0x17')]);}_0x37c5e4['order']=qs[_0x5f7f('0x45')](_0x23b42c[_0x5f7f('0x2b')][_0x5f7f('0x45')]);_0x37c5e4[_0x5f7f('0x46')]=qs[_0x5f7f('0x31')](_[_0x5f7f('0x47')](_0x23b42c['query'],_0xf9161c['filters']));_0x37c5e4[_0x5f7f('0x46')][_0x5f7f('0x48')]=_0x4fdd6c['id'];if(_0x23b42c[_0x5f7f('0x2b')]['filter']){_0x37c5e4[_0x5f7f('0x46')]=_[_0x5f7f('0x36')](_0x37c5e4[_0x5f7f('0x46')],{'$or':_[_0x5f7f('0x23')](_0x37c5e4[_0x5f7f('0x33')],function(_0x1efabb){var _0x1a57f9={};_0x1a57f9[_0x1efabb]={'$like':'%'+_0x23b42c['query'][_0x5f7f('0x49')]+'%'};return _0x1a57f9;})});}if(_0x23b42c[_0x5f7f('0x2b')]['$gte']){var _0x1e3124=_0x23b42c['query'][_0x5f7f('0x4a')]['split'](',');var _0x222629={};_0x222629[_0x1e3124[0x0]]={'$gte':moment(_0x1e3124[0x1])['format'](_0x5f7f('0x4b'))};_0x37c5e4[_0x5f7f('0x46')]=_[_0x5f7f('0x36')](_0x37c5e4[_0x5f7f('0x46')],_0x222629);}_0x37c5e4=_[_0x5f7f('0x36')]({},_0x37c5e4,_0x23b42c['options']);return db[_0x5f7f('0x3e')][_0x5f7f('0x1a')]({'where':_0x37c5e4[_0x5f7f('0x46')]})[_0x5f7f('0x1d')](function(_0x9a61f9){_0x594f56['count']=_0x9a61f9;if(_0x23b42c[_0x5f7f('0x2b')][_0x5f7f('0x4c')]){_0x37c5e4[_0x5f7f('0x4d')]=[{'all':!![]}];}return db[_0x5f7f('0x3e')][_0x5f7f('0x29')](_0x37c5e4);})[_0x5f7f('0x1d')](function(_0x3a686b){_0x594f56[_0x5f7f('0x4e')]=_0x3a686b;return _0x594f56;});}})[_0x5f7f('0x1d')](respondWithFilteredResult(_0x3e22f6,_0x37c5e4))[_0x5f7f('0x2c')](handleError(_0x3e22f6,null));};exports['addTags']=function(_0x3f7b9c,_0x32ab1c){return db[_0x5f7f('0x30')]['find']({'where':{'id':_0x3f7b9c[_0x5f7f('0x2d')]['id']}})[_0x5f7f('0x1d')](handleEntityNotFound(_0x32ab1c,null))[_0x5f7f('0x1d')](function(_0x1c1568){if(_0x1c1568){return _0x1c1568[_0x5f7f('0x4f')](_0x3f7b9c[_0x5f7f('0x39')]['ids'],_[_0x5f7f('0x3f')](_0x3f7b9c['body'],[_0x5f7f('0x40'),'id'])||{})[_0x5f7f('0x50')](function(){return db[_0x5f7f('0x51')][_0x5f7f('0x29')]({'attributes':['id',_0x5f7f('0x20'),'color'],'where':{'id':_0x3f7b9c[_0x5f7f('0x39')][_0x5f7f('0x40')]}});})[_0x5f7f('0x1d')](function(_0x402a1b){socket[_0x5f7f('0x52')](_0x5f7f('0x53'),{'id':Number(_0x3f7b9c['params']['id']),'tags':_0x402a1b||[]});return{'id':Number(_0x3f7b9c[_0x5f7f('0x2d')]['id']),'tags':_0x402a1b||[]};});}})[_0x5f7f('0x1d')](respondWithResult(_0x32ab1c,null))[_0x5f7f('0x2c')](handleError(_0x32ab1c,null));};exports[_0x5f7f('0x54')]=function(_0x336295,_0x2be8a6){return db[_0x5f7f('0x30')][_0x5f7f('0x3b')]({'where':{'id':_0x336295[_0x5f7f('0x2d')]['id']}})[_0x5f7f('0x1d')](handleEntityNotFound(_0x2be8a6,null))['then'](function(_0xb82cd0){if(_0xb82cd0){return _0xb82cd0[_0x5f7f('0x54')](_0x336295[_0x5f7f('0x2b')][_0x5f7f('0x40')]);}})[_0x5f7f('0x1d')](respondWithStatusCode(_0x2be8a6,null))[_0x5f7f('0x2c')](handleError(_0x2be8a6,null));};exports[_0x5f7f('0x55')]=function(_0x195b74,_0x4f0434){var _0x39c64f=moment()['unix']()[_0x5f7f('0x56')]();var _0x79f023=path[_0x5f7f('0x57')](config[_0x5f7f('0x58')],_0x5f7f('0x59'),_0x5f7f('0x5a'),_0x5f7f('0x5b'));var _0x5db61b=path[_0x5f7f('0x57')](config['root'],_0x5f7f('0x59'),'files','attachments');var _0x2e090d=path['join'](_0x79f023,_0x39c64f);var _0x5b96fa=util['format']('transcript-%d-%s.zip',_0x195b74[_0x5f7f('0x2d')]['id'],_0x39c64f);var _0x43625d=path[_0x5f7f('0x57')](_0x79f023,_0x5b96fa);var _0x1b4c5f=[];_0x1b4c5f[_0x5f7f('0x5c')]({'model':db[_0x5f7f('0x5d')],'as':_0x5f7f('0x5d'),'attributes':['id',_0x5f7f('0x5e')],'raw':!![]});_0x1b4c5f['push']({'model':db[_0x5f7f('0x5f')],'as':_0x5f7f('0x60'),'attributes':['id',_0x5f7f('0x61'),'lastName'],'raw':!![]});if(_0x195b74['query'][_0x5f7f('0x62')]){_0x1b4c5f['push']({'model':db[_0x5f7f('0x63')],'as':'Attachment','raw':!![]});}var _0x2d319b=[{'model':db[_0x5f7f('0x3e')],'as':_0x5f7f('0x64'),'attributes':['id',_0x5f7f('0x39'),_0x5f7f('0x65'),_0x5f7f('0x66'),_0x5f7f('0x67'),'read'],'include':_0x1b4c5f}];_0x2d319b[_0x5f7f('0x5c')]({'model':db['WhatsappAccount'],'as':_0x5f7f('0x68'),'attributes':['id',_0x5f7f('0x20')]});_0x2d319b[_0x5f7f('0x5c')]({'model':db[_0x5f7f('0x5d')],'as':'Owner','attributes':['id',_0x5f7f('0x5e')]});return db[_0x5f7f('0x30')][_0x5f7f('0x3b')]({'where':{'id':_0x195b74[_0x5f7f('0x2d')]['id']},'include':_0x2d319b})[_0x5f7f('0x1d')](handleEntityNotFound(_0x4f0434,null))[_0x5f7f('0x1d')](function(_0xfbd0b){if(_0xfbd0b){var _0x430e49=_0xfbd0b[_0x5f7f('0x69')]({'plain':!![]});fs['mkdirSync'](_0x2e090d);var _0x28116e={'channel':_0x5f7f('0x6a'),'account':_0x430e49[_0x5f7f('0x68')][_0x5f7f('0x20')],'agent':_0x430e49[_0x5f7f('0x6b')]?_0x430e49['Owner']['fullname']:'N.A.','createdAt':moment(_0x430e49[_0x5f7f('0x65')])[_0x5f7f('0x6c')](_0x5f7f('0x4b'))[_0x5f7f('0x56')](),'closedAt':_0x430e49[_0x5f7f('0x6d')]?moment(_0x430e49[_0x5f7f('0x6e')])[_0x5f7f('0x6c')](_0x5f7f('0x4b'))[_0x5f7f('0x56')]():'','disposition':_0x430e49[_0x5f7f('0x6f')],'messages':_(_0x430e49[_0x5f7f('0x64')])[_0x5f7f('0x49')]({'secret':![]})[_0x5f7f('0x23')](function(_0x1ff770){if(_0x1ff770['Attachment']){var _0x355561=path['join'](_0x5db61b,_0x1ff770[_0x5f7f('0x63')]['basename']);if(fs[_0x5f7f('0x70')](_0x355561)){fs['createReadStream'](_0x355561)['pipe'](fs[_0x5f7f('0x71')](path['join'](_0x2e090d,_0x1ff770[_0x5f7f('0x63')][_0x5f7f('0x72')])));}}return{'date':moment(_0x1ff770[_0x5f7f('0x65')])[_0x5f7f('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5f7f('0x56')](),'sender':_0x1ff770[_0x5f7f('0x66')]===_0x5f7f('0x73')?_0x1ff770[_0x5f7f('0x5d')]?_0x1ff770[_0x5f7f('0x5d')][_0x5f7f('0x5e')]:_0x5f7f('0x74'):_0x1ff770[_0x5f7f('0x60')][_0x5f7f('0x61')]+(_0x1ff770[_0x5f7f('0x60')][_0x5f7f('0x75')]?'\x20'+_0x1ff770['Contact'][_0x5f7f('0x75')]:''),'body':_0x1ff770[_0x5f7f('0x63')]?_0x1ff770['Attachment'][_0x5f7f('0x72')]:_0x1ff770[_0x5f7f('0x39')],'direction':_0x1ff770[_0x5f7f('0x66')]==='out'?'A':'C','secret':_0x1ff770[_0x5f7f('0x67')],'read':_0x1ff770['read'],'attachment':_0x1ff770['Attachment']};})[_0x5f7f('0x76')]()};return ejs[_0x5f7f('0x77')](path[_0x5f7f('0x57')](config['root'],_0x5f7f('0x59'),'views',_0x5f7f('0x78')),{'interaction':_0x28116e})[_0x5f7f('0x1d')](function(_0x1445d8){var _0x59deb1=path[_0x5f7f('0x57')](_0x2e090d,_0x5f7f('0x79')+_0x430e49['id']+'-'+_0x39c64f+'.pdf');var _0x4a705a={'path':_0x59deb1,'channel':_0x5f7f('0x6a'),'interactionId':_0x430e49['id']};return pdf[_0x5f7f('0x7a')](_0x1445d8,_0x4a705a);})[_0x5f7f('0x1d')](function(){return new BPromise(function(_0x5e6555,_0x1f40e2){zipdir(_0x2e090d,{'saveTo':_0x43625d},function(_0x5f5c4a,_0x1ff649){if(_0x5f5c4a)return _0x1f40e2(_0x5f5c4a);return _0x5e6555(_0x1ff649);});})['then'](function(){return new BPromise(function(_0x39558e,_0x30c941){rimraf(_0x2e090d,function(_0x4be301){if(_0x4be301)_0x30c941(_0x4be301);return _0x39558e();});});})[_0x5f7f('0x1d')](function(){return _0x4f0434['download'](_0x43625d,_0x5b96fa,function(_0x14d699){if(_0x14d699){console[_0x5f7f('0x7b')](_0x5f7f('0x7c'),_0x14d699);}else{fs[_0x5f7f('0x7d')](_0x43625d);}});});});}else{return _0x4f0434[_0x5f7f('0x14')](0xc8);}})[_0x5f7f('0x2c')](handleError(_0x4f0434,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index eee7e5a..e66bbb0 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 _0x6e16=['catch','exports','WhatsappInteraction','WhatsappMessage','save','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x1aea4,_0x568625){var _0x1e399d=function(_0x2e6643){while(--_0x2e6643){_0x1aea4['push'](_0x1aea4['shift']());}};_0x1e399d(++_0x568625);}(_0x6e16,0x1d3));var _0x66e1=function(_0x1a3d95,_0x34af19){_0x1a3d95=_0x1a3d95-0x0;var _0x23ea57=_0x6e16[_0x1a3d95];return _0x23ea57;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x66e1('0x0')];var WhatsappMessage=require('../../mysqldb')['db'][_0x66e1('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66e1('0x2'),'afterUpdate':_0x66e1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x892e60){return function(_0x59d328,_0x46894a,_0x204db8){_0x59d328[_0x66e1('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x37dd64){_0x59d328[_0x66e1('0x5')](_0x66e1('0x6'),_0x37dd64[_0x66e1('0x7')](function(_0x376592){return{'id':_0x376592['id']};}));return WhatsappMessage[_0x66e1('0x8')]({'where':{'WhatsappInteractionId':_0x59d328['id'],'direction':'in','read':![]},'raw':!![]});})[_0x66e1('0x9')](function(_0x216b29){_0x59d328[_0x66e1('0x5')](_0x66e1('0xa'),_0x216b29[_0x66e1('0xb')]);WhatsappInteractionEvents[_0x66e1('0xc')](_0x892e60+':'+_0x59d328['id'],_0x59d328);WhatsappInteractionEvents[_0x66e1('0xc')](_0x892e60,_0x59d328);_0x204db8(null);})[_0x66e1('0xd')](_0x204db8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x66e1('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x18e0=['findAll','then','length','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','setDataValue','map'];(function(_0x280e06,_0x1dc5e7){var _0x1e3cb7=function(_0x54d8c3){while(--_0x54d8c3){_0x280e06['push'](_0x280e06['shift']());}};_0x1e3cb7(++_0x1dc5e7);}(_0x18e0,0xa2));var _0x018e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x18e0[_0x263a74];return _0x2aa86c;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x018e('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x018e('0x0'))['db'][_0x018e('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x018e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x018e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x504293){return function(_0xcd2d04,_0x467ed8,_0x1b90dd){_0xcd2d04['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x36aac8){_0xcd2d04[_0x018e('0x4')]('Users',_0x36aac8[_0x018e('0x5')](function(_0x1dba25){return{'id':_0x1dba25['id']};}));return WhatsappMessage[_0x018e('0x6')]({'where':{'WhatsappInteractionId':_0xcd2d04['id'],'direction':'in','read':![]},'raw':!![]});})[_0x018e('0x7')](function(_0x20c76c){_0xcd2d04[_0x018e('0x4')]('unreadMessages',_0x20c76c[_0x018e('0x8')]);WhatsappInteractionEvents['emit'](_0x504293+':'+_0xcd2d04['id'],_0xcd2d04);WhatsappInteractionEvents['emit'](_0x504293,_0xcd2d04);_0x1b90dd(null);})['catch'](_0x1b90dd(null));};}for(var e in events){if(events[_0x018e('0x9')](e)){var event=events[e];WhatsappInteraction[_0x018e('0xa')](e,emitEvent(event));}}module[_0x018e('0xb')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index d303cb8..8214ca5 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 _0x5e23=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappInteraction','changed','format','lodash','util','../../config/logger'];(function(_0x2bde97,_0x5bc2e7){var _0x4fde78=function(_0x57e7c){while(--_0x57e7c){_0x2bde97['push'](_0x2bde97['shift']());}};_0x4fde78(++_0x5bc2e7);}(_0x5e23,0x169));var _0x35e2=function(_0x1c8a1e,_0x58717d){_0x1c8a1e=_0x1c8a1e-0x0;var _0x5815b3=_0x5e23[_0x1c8a1e];return _0x5815b3;};'use strict';var _=require(_0x35e2('0x0'));var util=require(_0x35e2('0x1'));var logger=require(_0x35e2('0x2'))('api');var moment=require(_0x35e2('0x3'));var BPromise=require(_0x35e2('0x4'));var rp=require(_0x35e2('0x5'));var fs=require('fs');var path=require(_0x35e2('0x6'));var rimraf=require(_0x35e2('0x7'));var config=require(_0x35e2('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0x35e2('0x9')]=function(_0x11e10d,_0x1e355b){return _0x11e10d['define'](_0x35e2('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x281d0f,_0x362e30,_0x34f46a){if(_0x281d0f[_0x35e2('0xb')]('closed')){_0x281d0f['closedAt']=moment()[_0x35e2('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x34f46a(null,_0x281d0f);}}});}; \ No newline at end of file +var _0xb6a2=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3772a8,_0x3ff97e){var _0x253666=function(_0x2ff8e5){while(--_0x2ff8e5){_0x3772a8['push'](_0x3772a8['shift']());}};_0x253666(++_0x3ff97e);}(_0xb6a2,0x170));var _0x2b6a=function(_0x130ac7,_0x10b492){_0x130ac7=_0x130ac7-0x0;var _0x69fef2=_0xb6a2[_0x130ac7];return _0x69fef2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b6a('0x0'))(_0x2b6a('0x1'));var moment=require(_0x2b6a('0x2'));var BPromise=require(_0x2b6a('0x3'));var rp=require(_0x2b6a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b6a('0x5'));var config=require(_0x2b6a('0x6'));var attributes=require(_0x2b6a('0x7'));module[_0x2b6a('0x8')]=function(_0x1eabc2,_0x4867ed){return _0x1eabc2[_0x2b6a('0x9')](_0x2b6a('0xa'),attributes,{'tableName':_0x2b6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c2b77,_0x2d7d4f,_0x3e03bf){if(_0x2c2b77[_0x2b6a('0xc')]('closed')){_0x2c2b77[_0x2b6a('0xd')]=moment()[_0x2b6a('0xe')](_0x2b6a('0xf'));}_0x3e03bf(null,_0x2c2b77);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index d04518e..105f6ff 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 _0xb7df=['catch','AddTagsToWhatsappInteraction','find','then','addTags','body','ids','AddTags','bluebird','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','raw','options','where','attributes','limit','stringify'];(function(_0x553bc8,_0x481382){var _0xc45407=function(_0x1831ac){while(--_0x1831ac){_0x553bc8['push'](_0x553bc8['shift']());}};_0xc45407(++_0x481382);}(_0xb7df,0x128));var _0xfb7d=function(_0x11eed3,_0x11d4fa){_0x11eed3=_0x11eed3-0x0;var _0x3566da=_0xb7df[_0x11eed3];return _0x3566da;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfb7d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfb7d('0x1'));var config=require('../../config/environment');var jayson=require(_0xfb7d('0x2'));var client=jayson[_0xfb7d('0x3')]['http']({'port':0x232a});config[_0xfb7d('0x4')]=_[_0xfb7d('0x5')](config[_0xfb7d('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb7d('0x6'))(new Redis(config['redis']));require(_0xfb7d('0x7'))[_0xfb7d('0x8')](socket);function respondWithRpcPromise(_0x2dfa6d,_0x5ea676,_0x5ddd59){return new BPromise(function(_0x53f20c,_0x2050be){return client[_0xfb7d('0x9')](_0x2dfa6d,_0x5ddd59)['then'](function(_0x53e79c){logger[_0xfb7d('0xa')](_0xfb7d('0xb'),_0x5ea676,'request\x20sent');logger[_0xfb7d('0xc')](_0xfb7d('0xd'),_0x5ea676,_0xfb7d('0xe'),JSON['stringify'](_0x53e79c));if(_0x53e79c[_0xfb7d('0xf')]){if(_0x53e79c[_0xfb7d('0xf')][_0xfb7d('0x10')]===0x1f4){logger[_0xfb7d('0xf')](_0xfb7d('0xb'),_0x5ea676,_0x53e79c[_0xfb7d('0xf')][_0xfb7d('0x11')]);return _0x2050be(_0x53e79c[_0xfb7d('0xf')]['message']);}logger[_0xfb7d('0xf')](_0xfb7d('0xb'),_0x5ea676,_0x53e79c[_0xfb7d('0xf')]['message']);return _0x53f20c(_0x53e79c[_0xfb7d('0xf')][_0xfb7d('0x11')]);}else{logger[_0xfb7d('0xa')](_0xfb7d('0xb'),_0x5ea676,'request\x20sent');_0x53f20c(_0x53e79c[_0xfb7d('0x12')][_0xfb7d('0x11')]);}})['catch'](function(_0x3ecf8d){logger[_0xfb7d('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x5ea676,_0x3ecf8d);_0x2050be(_0x3ecf8d);});});}exports[_0xfb7d('0x13')]=function(_0x4a9022){var _0x4a5fce=this;return new Promise(function(_0x274de8,_0x5dfadb){return db[_0xfb7d('0x14')][_0xfb7d('0x15')](_0x4a9022['body'],{'raw':_0x4a9022['options']?_0x4a9022['options'][_0xfb7d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a9022[_0xfb7d('0x17')]?_0x4a9022[_0xfb7d('0x17')][_0xfb7d('0x18')]||null:null,'attributes':_0x4a9022['options']?_0x4a9022[_0xfb7d('0x17')][_0xfb7d('0x19')]||null:null,'limit':_0x4a9022[_0xfb7d('0x17')]?_0x4a9022[_0xfb7d('0x17')][_0xfb7d('0x1a')]||null:null})['then'](function(_0x707d89){logger[_0xfb7d('0xa')](_0xfb7d('0x13'),_0x4a9022);logger[_0xfb7d('0xc')](_0xfb7d('0x13'),_0x4a9022,JSON[_0xfb7d('0x1b')](_0x707d89));_0x274de8(_0x707d89);})[_0xfb7d('0x1c')](function(_0x3650b1){logger['error']('UpdateWhatsappInteraction',_0x3650b1['message'],_0x4a9022);_0x5dfadb(_0x4a5fce[_0xfb7d('0xf')](0x1f4,_0x3650b1['message']));});});};exports[_0xfb7d('0x1d')]=function(_0x45eeb8){return new Promise(function(_0x270583,_0x4729f3){return db['WhatsappInteraction'][_0xfb7d('0x1e')]({'where':_0x45eeb8[_0xfb7d('0x17')]?_0x45eeb8[_0xfb7d('0x17')][_0xfb7d('0x18')]||null:null})[_0xfb7d('0x1f')](function(_0x177e0c){if(_0x177e0c){return _0x177e0c[_0xfb7d('0x20')](_0x45eeb8[_0xfb7d('0x21')][_0xfb7d('0x22')],_['omit'](_0x45eeb8[_0xfb7d('0x21')],['ids','id'])||{});}})['spread'](function(_0x47b504){logger[_0xfb7d('0xa')](_0xfb7d('0x23'),_0x45eeb8);logger['debug'](_0xfb7d('0x23'),_0x45eeb8,JSON[_0xfb7d('0x1b')](_0x47b504));_0x270583(_0x47b504);})['catch'](function(_0x406a7a){logger[_0xfb7d('0xf')](_0xfb7d('0x23'),_0x406a7a[_0xfb7d('0x11')],_0x45eeb8);_0x4729f3(_this[_0xfb7d('0xf')](0x1f4,_0x406a7a[_0xfb7d('0x11')]));});});}; \ No newline at end of file +var _0xd0c8=['UpdateWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','where','attributes','limit'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xd0c8,0xd9));var _0x8d0c=function(_0x5bc25b,_0x11c021){_0x5bc25b=_0x5bc25b-0x0;var _0x575743=_0xd0c8[_0x5bc25b];return _0x575743;};'use strict';var _=require(_0x8d0c('0x0'));var util=require(_0x8d0c('0x1'));var moment=require('moment');var BPromise=require(_0x8d0c('0x2'));var rs=require(_0x8d0c('0x3'));var fs=require('fs');var Redis=require(_0x8d0c('0x4'));var db=require(_0x8d0c('0x5'))['db'];var utils=require(_0x8d0c('0x6'));var logger=require(_0x8d0c('0x7'))('rpc');var config=require(_0x8d0c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8d0c('0x9')][_0x8d0c('0xa')]({'port':0x232a});config[_0x8d0c('0xb')]=_['defaults'](config[_0x8d0c('0xb')],{'host':_0x8d0c('0xc'),'port':0x18eb});var socket=require(_0x8d0c('0xd'))(new Redis(config[_0x8d0c('0xb')]));require(_0x8d0c('0xe'))[_0x8d0c('0xf')](socket);function respondWithRpcPromise(_0x4317a1,_0x118ca4,_0x21cacc){return new BPromise(function(_0x203318,_0x6e9cec){return client[_0x8d0c('0x10')](_0x4317a1,_0x21cacc)[_0x8d0c('0x11')](function(_0x36f113){logger[_0x8d0c('0x12')](_0x8d0c('0x13'),_0x118ca4,_0x8d0c('0x14'));logger[_0x8d0c('0x15')](_0x8d0c('0x16'),_0x118ca4,_0x8d0c('0x14'),JSON[_0x8d0c('0x17')](_0x36f113));if(_0x36f113[_0x8d0c('0x18')]){if(_0x36f113[_0x8d0c('0x18')][_0x8d0c('0x19')]===0x1f4){logger['error'](_0x8d0c('0x13'),_0x118ca4,_0x36f113['error'][_0x8d0c('0x1a')]);return _0x6e9cec(_0x36f113[_0x8d0c('0x18')][_0x8d0c('0x1a')]);}logger[_0x8d0c('0x18')](_0x8d0c('0x13'),_0x118ca4,_0x36f113[_0x8d0c('0x18')][_0x8d0c('0x1a')]);return _0x203318(_0x36f113[_0x8d0c('0x18')][_0x8d0c('0x1a')]);}else{logger[_0x8d0c('0x12')](_0x8d0c('0x13'),_0x118ca4,_0x8d0c('0x14'));_0x203318(_0x36f113[_0x8d0c('0x1b')][_0x8d0c('0x1a')]);}})[_0x8d0c('0x1c')](function(_0x34d764){logger[_0x8d0c('0x18')](_0x8d0c('0x13'),_0x118ca4,_0x34d764);_0x6e9cec(_0x34d764);});});}exports['UpdateWhatsappInteraction']=function(_0x1fe480){var _0x365df1=this;return new Promise(function(_0x5bc578,_0x275112){return db['WhatsappInteraction'][_0x8d0c('0x1d')](_0x1fe480[_0x8d0c('0x1e')],{'raw':_0x1fe480['options']?_0x1fe480['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fe480[_0x8d0c('0x1f')]?_0x1fe480[_0x8d0c('0x1f')][_0x8d0c('0x20')]||null:null,'attributes':_0x1fe480['options']?_0x1fe480[_0x8d0c('0x1f')][_0x8d0c('0x21')]||null:null,'limit':_0x1fe480[_0x8d0c('0x1f')]?_0x1fe480[_0x8d0c('0x1f')][_0x8d0c('0x22')]||null:null})[_0x8d0c('0x11')](function(_0x22800b){logger[_0x8d0c('0x12')](_0x8d0c('0x23'),_0x1fe480);logger['debug'](_0x8d0c('0x23'),_0x1fe480,JSON[_0x8d0c('0x17')](_0x22800b));_0x5bc578(_0x22800b);})[_0x8d0c('0x1c')](function(_0x45b26d){logger[_0x8d0c('0x18')](_0x8d0c('0x23'),_0x45b26d[_0x8d0c('0x1a')],_0x1fe480);_0x275112(_0x365df1[_0x8d0c('0x18')](0x1f4,_0x45b26d[_0x8d0c('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4ba526){return new Promise(function(_0x2085cb,_0x166cdc){return db['WhatsappInteraction'][_0x8d0c('0x24')]({'where':_0x4ba526[_0x8d0c('0x1f')]?_0x4ba526['options'][_0x8d0c('0x20')]||null:null})[_0x8d0c('0x11')](function(_0x50efff){if(_0x50efff){return _0x50efff[_0x8d0c('0x25')](_0x4ba526[_0x8d0c('0x1e')][_0x8d0c('0x26')],_[_0x8d0c('0x27')](_0x4ba526[_0x8d0c('0x1e')],[_0x8d0c('0x26'),'id'])||{});}})[_0x8d0c('0x28')](function(_0x2f1ac0){logger[_0x8d0c('0x12')](_0x8d0c('0x29'),_0x4ba526);logger[_0x8d0c('0x15')](_0x8d0c('0x29'),_0x4ba526,JSON[_0x8d0c('0x17')](_0x2f1ac0));_0x2085cb(_0x2f1ac0);})[_0x8d0c('0x1c')](function(_0x296e9b){logger[_0x8d0c('0x18')](_0x8d0c('0x29'),_0x296e9b[_0x8d0c('0x1a')],_0x4ba526);_0x166cdc(_this['error'](0x1f4,_0x296e9b['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ed7a5e2..34344ac 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 _0x0f64=['./whatsappInteraction.events','update','removeListener','length','whatsappInteraction:'];(function(_0x1aa88f,_0x3b186f){var _0x3e0b82=function(_0x1ce00d){while(--_0x1ce00d){_0x1aa88f['push'](_0x1aa88f['shift']());}};_0x3e0b82(++_0x3b186f);}(_0x0f64,0x122));var _0x40f6=function(_0x490c06,_0x45c211){_0x490c06=_0x490c06-0x0;var _0x8cf552=_0x0f64[_0x490c06];return _0x8cf552;};'use strict';var WhatsappInteractionEvents=require(_0x40f6('0x0'));var events=['save','remove',_0x40f6('0x1')];function createListener(_0xab4846,_0x4a417f){return function(_0x3d3f6f){_0x4a417f['emit'](_0xab4846,_0x3d3f6f);};}function removeListener(_0x1fd0b9,_0x423fef){return function(){WhatsappInteractionEvents[_0x40f6('0x2')](_0x1fd0b9,_0x423fef);};}exports['register']=function(_0x254595){for(var _0x2799c4=0x0,_0x11ea14=events[_0x40f6('0x3')];_0x2799c4<_0x11ea14;_0x2799c4++){var _0xfe02f3=events[_0x2799c4];var _0x4e4f5b=createListener(_0x40f6('0x4')+_0xfe02f3,_0x254595);WhatsappInteractionEvents['on'](_0xfe02f3,_0x4e4f5b);}}; \ No newline at end of file +var _0x5f93=['save','update','emit','removeListener','length'];(function(_0x2e3b63,_0x2bae6c){var _0x3824c8=function(_0x21c230){while(--_0x21c230){_0x2e3b63['push'](_0x2e3b63['shift']());}};_0x3824c8(++_0x2bae6c);}(_0x5f93,0x172));var _0x35f9=function(_0x80314b,_0x1459b0){_0x80314b=_0x80314b-0x0;var _0x5490f3=_0x5f93[_0x80314b];return _0x5490f3;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x35f9('0x0'),'remove',_0x35f9('0x1')];function createListener(_0x562cf0,_0x502463){return function(_0x5bb2e1){_0x502463[_0x35f9('0x2')](_0x562cf0,_0x5bb2e1);};}function removeListener(_0x897511,_0x3045b9){return function(){WhatsappInteractionEvents[_0x35f9('0x3')](_0x897511,_0x3045b9);};}exports['register']=function(_0xe3e791){for(var _0x5090a5=0x0,_0x408c3c=events[_0x35f9('0x4')];_0x5090a5<_0x408c3c;_0x5090a5++){var _0x19aaae=events[_0x5090a5];var _0x23b704=createListener('whatsappInteraction:'+_0x19aaae,_0xe3e791);WhatsappInteractionEvents['on'](_0x19aaae,_0x23b704);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9a39324..bfb6e5a 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 _0x0264=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','post','tracked','create','/:id/status','put','/:id','/:id/accept','/:id/reject','reject','delete','exports'];(function(_0x1280b,_0x73d22){var _0x48f4c8=function(_0x498c45){while(--_0x498c45){_0x1280b['push'](_0x1280b['shift']());}};_0x48f4c8(++_0x73d22);}(_0x0264,0xa8));var _0x4026=function(_0x1650b4,_0x4be91d){_0x1650b4=_0x1650b4-0x0;var _0x3ae2ba=_0x0264[_0x1650b4];return _0x3ae2ba;};'use strict';var multer=require(_0x4026('0x0'));var util=require(_0x4026('0x1'));var path=require(_0x4026('0x2'));var timeout=require(_0x4026('0x3'));var express=require(_0x4026('0x4'));var router=express[_0x4026('0x5')]();var fs_extra=require(_0x4026('0x6'));var auth=require(_0x4026('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4026('0x8'));var controller=require('./whatsappMessage.controller');router[_0x4026('0x9')]('/',auth[_0x4026('0xa')](),controller[_0x4026('0xb')]);router[_0x4026('0x9')]('/describe',auth[_0x4026('0xa')](),controller[_0x4026('0xc')]);router['get']('/:id',auth[_0x4026('0xa')](),controller['show']);router[_0x4026('0xd')]('/',auth['isAuthenticated'](),interaction[_0x4026('0xe')]('whatsapp','whatsappmessage:create'),controller[_0x4026('0xf')]);router[_0x4026('0xd')](_0x4026('0x10'),controller['status']);router[_0x4026('0x11')](_0x4026('0x12'),auth[_0x4026('0xa')](),controller['update']);router[_0x4026('0x11')](_0x4026('0x13'),auth[_0x4026('0xa')](),controller['accept']);router[_0x4026('0x11')](_0x4026('0x14'),auth['isAuthenticated'](),controller[_0x4026('0x15')]);router[_0x4026('0x16')](_0x4026('0x12'),auth[_0x4026('0xa')](),controller['destroy']);module[_0x4026('0x17')]=router; \ No newline at end of file +var _0x09b4=['get','index','describe','isAuthenticated','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller'];(function(_0x4beb27,_0x25756c){var _0x146f03=function(_0x503ac3){while(--_0x503ac3){_0x4beb27['push'](_0x4beb27['shift']());}};_0x146f03(++_0x25756c);}(_0x09b4,0xdf));var _0x409b=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x09b4[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require('multer');var util=require(_0x409b('0x0'));var path=require(_0x409b('0x1'));var timeout=require(_0x409b('0x2'));var express=require(_0x409b('0x3'));var router=express[_0x409b('0x4')]();var fs_extra=require(_0x409b('0x5'));var auth=require(_0x409b('0x6'));var interaction=require(_0x409b('0x7'));var config=require('../../config/environment');var controller=require(_0x409b('0x8'));router[_0x409b('0x9')]('/',auth['isAuthenticated'](),controller[_0x409b('0xa')]);router[_0x409b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x409b('0xb')]);router[_0x409b('0x9')]('/:id',auth[_0x409b('0xc')](),controller[_0x409b('0xd')]);router[_0x409b('0xe')]('/',auth[_0x409b('0xc')](),interaction[_0x409b('0xf')](_0x409b('0x10'),_0x409b('0x11')),controller[_0x409b('0x12')]);router[_0x409b('0xe')](_0x409b('0x13'),controller['status']);router[_0x409b('0x14')](_0x409b('0x15'),auth[_0x409b('0xc')](),controller[_0x409b('0x16')]);router[_0x409b('0x14')](_0x409b('0x17'),auth[_0x409b('0xc')](),controller[_0x409b('0x18')]);router[_0x409b('0x14')](_0x409b('0x19'),auth[_0x409b('0xc')](),controller['reject']);router[_0x409b('0x1a')]('/:id',auth[_0x409b('0xc')](),controller[_0x409b('0x1b')]);module[_0x409b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 3441c7f..a550f63 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 _0x3ca4=['ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT'];(function(_0x38a56d,_0x228eae){var _0x1335bc=function(_0x4d10ed){while(--_0x4d10ed){_0x38a56d['push'](_0x38a56d['shift']());}};_0x1335bc(++_0x228eae);}(_0x3ca4,0x17d));var _0x43ca=function(_0x5d953f,_0xa4e0e1){_0x5d953f=_0x5d953f-0x0;var _0x59101b=_0x3ca4[_0x5d953f];return _0x59101b;};'use strict';var Sequelize=require(_0x43ca('0x0'));module[_0x43ca('0x1')]={'body':{'type':Sequelize[_0x43ca('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x43ca('0x3')]('in',_0x43ca('0x4')),'defaultValue':_0x43ca('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x43ca('0x5')](0xbe)},'phone':{'type':Sequelize[_0x43ca('0x5')]},'readAt':{'type':Sequelize[_0x43ca('0x6')]},'secret':{'type':Sequelize[_0x43ca('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x43ca('0x2')]}}; \ No newline at end of file +var _0xb5bb=['TEXT','BOOLEAN','ENUM','STRING','sequelize','exports'];(function(_0x59aa00,_0x30e1f7){var _0x2a3bf0=function(_0x201803){while(--_0x201803){_0x59aa00['push'](_0x59aa00['shift']());}};_0x2a3bf0(++_0x30e1f7);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x49605a,_0x2c05a2){_0x49605a=_0x49605a-0x0;var _0x4effc1=_0xb5bb[_0x49605a];return _0x4effc1;};'use strict';var Sequelize=require(_0xbb5b('0x0'));module[_0xbb5b('0x1')]={'body':{'type':Sequelize[_0xbb5b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbb5b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbb5b('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbb5b('0x5')]},'providerResponse':{'type':Sequelize[_0xbb5b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index baaed05..d58115c 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 _0x84d3=['client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','map','WhatsappMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','readAt','format','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','ContactId','contact','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise'];(function(_0x4df434,_0x56ed52){var _0x517013=function(_0x504ad8){while(--_0x504ad8){_0x4df434['push'](_0x4df434['shift']());}};_0x517013(++_0x56ed52);}(_0x84d3,0xfc));var _0x384d=function(_0x2938b5,_0x409ed3){_0x2938b5=_0x2938b5-0x0;var _0x594a7a=_0x84d3[_0x2938b5];return _0x594a7a;};'use strict';var emlformat=require(_0x384d('0x0'));var rimraf=require(_0x384d('0x1'));var zipdir=require(_0x384d('0x2'));var jsonpatch=require(_0x384d('0x3'));var rp=require(_0x384d('0x4'));var moment=require(_0x384d('0x5'));var BPromise=require(_0x384d('0x6'));var Mustache=require(_0x384d('0x7'));var util=require('util');var path=require(_0x384d('0x8'));var sox=require(_0x384d('0x9'));var csv=require('to-csv');var ejs=require(_0x384d('0xa'));var fs=require('fs');var fs_extra=require(_0x384d('0xb'));var _=require('lodash');var squel=require(_0x384d('0xc'));var crypto=require(_0x384d('0xd'));var jsforce=require(_0x384d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x384d('0xf'));var querystring=require(_0x384d('0x10'));var Papa=require(_0x384d('0x11'));var Redis=require(_0x384d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x384d('0x13'));var as=require(_0x384d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x384d('0x15'))(_0x384d('0x16'));var utils=require(_0x384d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x384d('0x18'));var db=require(_0x384d('0x19'))['db'];config[_0x384d('0x1a')]=_[_0x384d('0x1b')](config[_0x384d('0x1a')],{'host':_0x384d('0x1c'),'port':0x18eb});var socket=require(_0x384d('0x1d'))(new Redis(config['redis']));require(_0x384d('0x1e'))['register'](socket);var jayson=require(_0x384d('0x1f'));var client=jayson[_0x384d('0x20')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d781e,_0xc9c247,_0x58e0e6,_0x5cb78e){return new BPromise(function(_0x3e450d,_0x4f0d87){var _0x46509e=_0x5cb78e||client;return _0x46509e[_0x384d('0x21')](_0x1d781e,_0x58e0e6)[_0x384d('0x22')](function(_0x16cb45){logger[_0x384d('0x23')](_0x384d('0x24'),_0xc9c247,'request\x20sent');logger[_0x384d('0x25')](_0x384d('0x26'),_0xc9c247,_0x384d('0x27'),JSON['stringify'](_0x16cb45));if(_0x16cb45['error']){if(_0x16cb45[_0x384d('0x28')]['code']===0x1f4){logger[_0x384d('0x28')](_0x384d('0x24'),_0xc9c247,_0x16cb45[_0x384d('0x28')][_0x384d('0x29')]);return _0x4f0d87(_0x16cb45[_0x384d('0x28')]['message']);}logger['error'](_0x384d('0x24'),_0xc9c247,_0x16cb45[_0x384d('0x28')]['message']);return _0x3e450d(_0x16cb45['error'][_0x384d('0x29')]);}else{logger[_0x384d('0x23')](_0x384d('0x24'),_0xc9c247,_0x384d('0x27'));_0x3e450d(_0x16cb45[_0x384d('0x2a')][_0x384d('0x29')]);}})[_0x384d('0x2b')](function(_0x4168a4){logger[_0x384d('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0xc9c247,_0x4168a4);_0x4f0d87(_0x4168a4);});});}function respondWithStatusCode(_0x1a5f99,_0x5e8598){_0x5e8598=_0x5e8598||0xcc;return function(_0x321df9){if(_0x321df9){return _0x1a5f99[_0x384d('0x2c')](_0x5e8598);}return _0x1a5f99[_0x384d('0x2d')](_0x5e8598)[_0x384d('0x2e')]();};}function respondWithResult(_0x45efca,_0x2d06ca){_0x2d06ca=_0x2d06ca||0xc8;return function(_0x5cbb1c){if(_0x5cbb1c){return _0x45efca[_0x384d('0x2d')](_0x2d06ca)[_0x384d('0x2f')](_0x5cbb1c);}};}function respondWithFilteredResult(_0x53cefe,_0x71dad9){return function(_0x438318){if(_0x438318){var _0x2b4511=typeof _0x71dad9[_0x384d('0x30')]===_0x384d('0x31')&&typeof _0x71dad9[_0x384d('0x32')]===_0x384d('0x31');var _0x341c6c=_0x438318[_0x384d('0x33')];var _0x54c4a3=_0x2b4511?0x0:_0x71dad9[_0x384d('0x30')];var _0xbcfc6=_0x2b4511?_0x438318[_0x384d('0x33')]:_0x71dad9[_0x384d('0x30')]+_0x71dad9['limit'];var _0x55b1a5;if(_0xbcfc6>=_0x341c6c){_0xbcfc6=_0x341c6c;_0x55b1a5=0xc8;}else{_0x55b1a5=0xce;}_0x53cefe[_0x384d('0x2d')](_0x55b1a5);return _0x53cefe[_0x384d('0x34')](_0x384d('0x35'),_0x54c4a3+'-'+_0xbcfc6+'/'+_0x341c6c)[_0x384d('0x2f')](_0x438318);}return null;};}function patchUpdates(_0x364194){return function(_0x3059ec){try{jsonpatch[_0x384d('0x36')](_0x3059ec,_0x364194,!![]);}catch(_0x5d215c){return BPromise[_0x384d('0x37')](_0x5d215c);}return _0x3059ec[_0x384d('0x38')]();};}function saveUpdates(_0x32c7ac,_0x569514){return function(_0x57d3a6){if(_0x57d3a6){return _0x57d3a6[_0x384d('0x39')](_0x32c7ac)[_0x384d('0x22')](function(_0x361ed2){return _0x361ed2;});}return null;};}function removeEntity(_0x288116,_0x3cf7ae){return function(_0x6effda){if(_0x6effda){return _0x6effda['destroy']()['then'](function(){_0x288116[_0x384d('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361178,_0x2c3a92){return function(_0x116906){if(!_0x116906){_0x361178[_0x384d('0x2c')](0x194);}return _0x116906;};}function handleError(_0xfd670a,_0x1108e0){_0x1108e0=_0x1108e0||0x1f4;return function(_0x4441bc){logger[_0x384d('0x28')](_0x4441bc[_0x384d('0x3a')]);if(_0x4441bc[_0x384d('0x3b')]){delete _0x4441bc['name'];}_0xfd670a['status'](_0x1108e0)[_0x384d('0x3c')](_0x4441bc);};}exports['index']=function(_0x2289da,_0x27588c){var _0x249ede={},_0x3998bf={},_0x410088={'count':0x0,'rows':[]};var _0x2dca46=_[_0x384d('0x3d')](db[_0x384d('0x3e')]['rawAttributes'],function(_0x500986){return{'name':_0x500986['fieldName'],'type':_0x500986[_0x384d('0x3f')][_0x384d('0x40')]};});_0x3998bf[_0x384d('0x41')]=_[_0x384d('0x3d')](_0x2dca46,'name');_0x3998bf[_0x384d('0x42')]=_[_0x384d('0x43')](_0x2289da['query']);_0x3998bf[_0x384d('0x44')]=_[_0x384d('0x45')](_0x3998bf['model'],_0x3998bf[_0x384d('0x42')]);_0x249ede[_0x384d('0x46')]=_[_0x384d('0x45')](_0x3998bf[_0x384d('0x41')],qs[_0x384d('0x47')](_0x2289da['query']['fields']));_0x249ede[_0x384d('0x46')]=_0x249ede[_0x384d('0x46')][_0x384d('0x48')]?_0x249ede[_0x384d('0x46')]:_0x3998bf[_0x384d('0x41')];if(!_0x2289da['query'][_0x384d('0x49')](_0x384d('0x4a'))){_0x249ede[_0x384d('0x32')]=qs[_0x384d('0x32')](_0x2289da[_0x384d('0x42')]['limit']);_0x249ede[_0x384d('0x30')]=qs['offset'](_0x2289da[_0x384d('0x42')][_0x384d('0x30')]);}_0x249ede[_0x384d('0x4b')]=qs[_0x384d('0x4c')](_0x2289da[_0x384d('0x42')][_0x384d('0x4c')]);_0x249ede['where']=qs[_0x384d('0x44')](_[_0x384d('0x4d')](_0x2289da['query'],_0x3998bf[_0x384d('0x44')]),_0x2dca46);if(_0x2289da[_0x384d('0x42')][_0x384d('0x4e')]){_0x249ede[_0x384d('0x4f')]=_[_0x384d('0x50')](_0x249ede[_0x384d('0x4f')],{'$or':_[_0x384d('0x3d')](_0x2dca46,function(_0x26683d){if(_0x26683d[_0x384d('0x3f')]!=='VIRTUAL'){var _0x290da4={};_0x290da4[_0x26683d['name']]={'$like':'%'+_0x2289da[_0x384d('0x42')]['filter']+'%'};return _0x290da4;}})});}_0x249ede=_[_0x384d('0x50')]({},_0x249ede,_0x2289da[_0x384d('0x51')]);var _0x4ee5a4={'where':_0x249ede['where']};return db[_0x384d('0x3e')][_0x384d('0x33')](_0x4ee5a4)[_0x384d('0x22')](function(_0x159196){_0x410088['count']=_0x159196;if(_0x2289da[_0x384d('0x42')][_0x384d('0x52')]){_0x249ede[_0x384d('0x53')]=[{'all':!![]}];}return db[_0x384d('0x3e')][_0x384d('0x54')](_0x249ede);})['then'](function(_0x381d8c){_0x410088['rows']=_0x381d8c;return _0x410088;})['then'](respondWithFilteredResult(_0x27588c,_0x249ede))[_0x384d('0x2b')](handleError(_0x27588c,null));};exports[_0x384d('0x55')]=function(_0x4a3fa5,_0x13e019){var _0x5579bb={'raw':!![],'where':{'id':_0x4a3fa5[_0x384d('0x56')]['id']}},_0x5ba58a={};_0x5ba58a[_0x384d('0x41')]=_[_0x384d('0x43')](db[_0x384d('0x3e')]['rawAttributes']);_0x5ba58a[_0x384d('0x42')]=_[_0x384d('0x43')](_0x4a3fa5[_0x384d('0x42')]);_0x5ba58a[_0x384d('0x44')]=_[_0x384d('0x45')](_0x5ba58a[_0x384d('0x41')],_0x5ba58a['query']);_0x5579bb['attributes']=_['intersection'](_0x5ba58a[_0x384d('0x41')],qs['fields'](_0x4a3fa5[_0x384d('0x42')][_0x384d('0x47')]));_0x5579bb['attributes']=_0x5579bb['attributes'][_0x384d('0x48')]?_0x5579bb[_0x384d('0x46')]:_0x5ba58a[_0x384d('0x41')];if(_0x4a3fa5[_0x384d('0x42')][_0x384d('0x52')]){_0x5579bb[_0x384d('0x53')]=[{'all':!![]}];}_0x5579bb=_[_0x384d('0x50')]({},_0x5579bb,_0x4a3fa5[_0x384d('0x51')]);return db['WhatsappMessage'][_0x384d('0x57')](_0x5579bb)['then'](handleEntityNotFound(_0x13e019,null))[_0x384d('0x22')](respondWithResult(_0x13e019,null))[_0x384d('0x2b')](handleError(_0x13e019,null));};exports['create']=function(_0x3c06f4,_0x3818c3){return db[_0x384d('0x3e')][_0x384d('0x58')](_0x3c06f4[_0x384d('0x59')],{})[_0x384d('0x22')](respondWithResult(_0x3818c3,0xc9))[_0x384d('0x2b')](handleError(_0x3818c3,null));};exports[_0x384d('0x39')]=function(_0x3afbe3,_0x559e78){if(_0x3afbe3[_0x384d('0x59')]['id']){delete _0x3afbe3[_0x384d('0x59')]['id'];}return db[_0x384d('0x3e')]['find']({'where':{'id':_0x3afbe3['params']['id']}})[_0x384d('0x22')](handleEntityNotFound(_0x559e78,null))[_0x384d('0x22')](saveUpdates(_0x3afbe3[_0x384d('0x59')],null))[_0x384d('0x22')](respondWithResult(_0x559e78,null))['catch'](handleError(_0x559e78,null));};exports[_0x384d('0x5a')]=function(_0x4fb1cd,_0x23bf61){return db['WhatsappMessage'][_0x384d('0x57')]({'where':{'id':_0x4fb1cd[_0x384d('0x56')]['id']}})[_0x384d('0x22')](handleEntityNotFound(_0x23bf61,null))[_0x384d('0x22')](removeEntity(_0x23bf61,null))[_0x384d('0x2b')](handleError(_0x23bf61,null));};exports[_0x384d('0x5b')]=function(_0x2e546c,_0x3b84ce){return db[_0x384d('0x3e')][_0x384d('0x5b')]()[_0x384d('0x22')](respondWithResult(_0x3b84ce,null))[_0x384d('0x2b')](handleError(_0x3b84ce,null));};var interaction_log=require(_0x384d('0x15'))(_0x384d('0x5c'));exports[_0x384d('0x5d')]=function(_0x1aba7a,_0x6e3df5,_0xb563df){var _0x219b5a={'agent':{},'channel':_0x384d('0x5e')};if(_0x1aba7a[_0x384d('0x59')]['id']){delete _0x1aba7a[_0x384d('0x59')]['id'];}_0x1aba7a[_0x384d('0x59')]['read']=!![];_0x1aba7a[_0x384d('0x59')][_0x384d('0x5f')]=moment()[_0x384d('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')]=_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')]||_0x1aba7a['user']['id'];_0x219b5a[_0x384d('0x62')]['id']=_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')];return db[_0x384d('0x3e')][_0x384d('0x57')]({'where':{'id':_0x1aba7a[_0x384d('0x56')]['id'],'UserId':null}})[_0x384d('0x22')](handleEntityNotFound(_0x6e3df5,null))[_0x384d('0x22')](saveUpdates(_0x1aba7a[_0x384d('0x59')],null))[_0x384d('0x22')](function(_0x14eaac){if(_0x14eaac){_0x219b5a['message']=_0x14eaac[_0x384d('0x63')]({'plain':!![]});return db[_0x384d('0x64')][_0x384d('0x57')]({'where':{'id':_0x14eaac[_0x384d('0x65')]}});}return null;})[_0x384d('0x22')](handleEntityNotFound(_0x6e3df5,null))['then'](function(_0x3b2ec8){if(_0x3b2ec8){return _0x3b2ec8[_0x384d('0x39')]({'UserId':_0x1aba7a['body'][_0x384d('0x61')],'read1stAt':_[_0x384d('0x66')](_0x3b2ec8[_0x384d('0x67')])?moment()[_0x384d('0x60')](_0x384d('0x68')):undefined});}return null;})[_0x384d('0x22')](function(_0x24414e){if(_0x24414e){_0x219b5a[_0x384d('0x69')]=_0x24414e[_0x384d('0x63')]({'plain':!![]});interaction_log[_0x384d('0x23')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1aba7a[_0x384d('0x6a')]['id'],_0x1aba7a['user'][_0x384d('0x3b')],_0x1aba7a[_0x384d('0x6a')]['role'],_0x219b5a[_0x384d('0x69')]['id'],_0x1aba7a[_0x384d('0x59')]?JSON['stringify'](_0x1aba7a[_0x384d('0x59')]):_0x384d('0x6b'));return respondWithRpcPromise(_0x384d('0x6c'),_0x384d('0x6d'),_0x219b5a);}return null;})['then'](function(_0x4bccc1){var _0x569378=_0x384d('0x6e')+_0x4bccc1[_0x384d('0x29')]['ContactId'];return db[_0x384d('0x6f')][_0x384d('0x42')](_0x569378,{'type':db[_0x384d('0x70')][_0x384d('0x71')][_0x384d('0x72')],'raw':!![]})[_0x384d('0x22')](function(_0x152fba){return _0x152fba;});})[_0x384d('0x22')](function(_0xad6089){if(_0xad6089){_0x219b5a['message']['contact']=_0xad6089[0x0];if(!_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')])return;return db[_0x384d('0x73')]['find']({'where':{'id':_0x1aba7a[_0x384d('0x59')][_0x384d('0x61')],'role':_0x384d('0x62')},'attributes':['id',_0x384d('0x3b'),_0x384d('0x74'),_0x384d('0x75'),_0x384d('0x76')],'raw':!![]});}return null;})[_0x384d('0x22')](function(_0x44fd17){if(!_0x44fd17)return null;_0x219b5a[_0x384d('0x29')]['agent']=_0x44fd17;return _0x219b5a;})['then'](function(_0x263709){if(_0x263709){if(_0x1aba7a[_0x384d('0x59')][_0x384d('0x77')]){_0x219b5a[_0x384d('0x29')][_0x384d('0x78')]=util[_0x384d('0x60')](_0x384d('0x79'),_0x1aba7a[_0x384d('0x6a')][_0x384d('0x3b')]);_0x219b5a[_0x384d('0x29')]['channel']=_0x219b5a[_0x384d('0x7a')];_0x219b5a[_0x384d('0x29')]['motionChannel']=_0x219b5a['channel'];_0x219b5a[_0x384d('0x29')][_0x384d('0x7b')]=_0x384d('0x5d');return respondWithRpcPromise(_0x384d('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x219b5a[_0x384d('0x29')]},client9002)['then'](function(){return _0x219b5a;});}return _0x219b5a;}return null;})[_0x384d('0x22')](respondWithResult(_0x6e3df5,null))['catch'](handleError(_0x6e3df5,null));};var interaction_log=require(_0x384d('0x15'))(_0x384d('0x5c'));exports['reject']=function(_0x387ab5,_0x3731b5,_0x3e17a0){var _0x3e1334={'agent':{},'channel':'whatsapp'};if(_0x387ab5['body']['id']){delete _0x387ab5[_0x384d('0x59')]['id'];}_0x387ab5[_0x384d('0x59')]['UserId']=_0x387ab5[_0x384d('0x59')][_0x384d('0x61')]||_0x387ab5[_0x384d('0x6a')]['id'];_0x3e1334[_0x384d('0x62')]['id']=_0x387ab5['body'][_0x384d('0x61')];return db[_0x384d('0x3e')][_0x384d('0x57')]({'where':{'id':_0x387ab5['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3731b5,null))[_0x384d('0x22')](function(_0x565ed1){if(_0x565ed1){_0x3e1334[_0x384d('0x29')]=_0x565ed1['get']({'plain':!![]});return db[_0x384d('0x64')][_0x384d('0x57')]({'where':{'id':_0x565ed1['WhatsappInteractionId']}});}return null;})[_0x384d('0x22')](handleEntityNotFound(_0x3731b5,null))['then'](function(_0x162dd2){if(_0x162dd2){_0x3e1334['interaction']=_0x162dd2[_0x384d('0x63')]({'plain':!![]});interaction_log[_0x384d('0x23')](_0x384d('0x7d'),_0x387ab5['user']['id'],_0x387ab5[_0x384d('0x6a')]['name'],_0x387ab5[_0x384d('0x6a')][_0x384d('0x7e')],_0x3e1334['interaction']['id'],_0x387ab5['body']?JSON[_0x384d('0x7f')](_0x387ab5[_0x384d('0x59')]):_0x384d('0x6b'));return respondWithRpcPromise(_0x384d('0x80'),_0x384d('0x81'),_0x3e1334);}return null;})[_0x384d('0x22')](function(_0x18d5b7){var _0x5e2dd6=_0x384d('0x6e')+_0x18d5b7['message'][_0x384d('0x82')];return db[_0x384d('0x6f')]['query'](_0x5e2dd6,{'type':db['Sequelize'][_0x384d('0x71')]['SELECT'],'raw':!![]})[_0x384d('0x22')](function(_0x5e6ac8){return _0x5e6ac8;});})[_0x384d('0x22')](function(_0x20bbd5){if(_0x20bbd5){_0x3e1334[_0x384d('0x29')][_0x384d('0x83')]=_0x20bbd5[0x0];if(!_0x387ab5['body']['UserId'])return;return db[_0x384d('0x73')][_0x384d('0x57')]({'where':{'id':_0x387ab5[_0x384d('0x59')]['UserId'],'role':_0x384d('0x62')},'attributes':['id',_0x384d('0x3b'),_0x384d('0x74'),_0x384d('0x75'),'internal'],'raw':!![]});}return null;})[_0x384d('0x22')](function(_0x3df03b){if(!_0x3df03b)return null;_0x3e1334[_0x384d('0x29')][_0x384d('0x62')]=_0x3df03b;return _0x3e1334;})[_0x384d('0x22')](function(_0x44f3fc){if(_0x44f3fc){_0x44f3fc[_0x384d('0x29')][_0x384d('0x78')]=util[_0x384d('0x60')](_0x384d('0x79'),_0x387ab5[_0x384d('0x6a')][_0x384d('0x3b')]);_0x44f3fc[_0x384d('0x29')][_0x384d('0x7a')]=_0x3e1334[_0x384d('0x7a')];_0x44f3fc[_0x384d('0x29')][_0x384d('0x84')]=_0x3e1334['channel'];_0x44f3fc[_0x384d('0x29')][_0x384d('0x7b')]=_0x384d('0x37');respondWithRpcPromise(_0x384d('0x7c'),'EventManager',{'event':_0x384d('0x85'),'message':_0x44f3fc[_0x384d('0x29')]},client9002);return _0x3e1334;}return null;})[_0x384d('0x22')](respondWithResult(_0x3731b5,null))[_0x384d('0x2b')](handleError(_0x3731b5,null));};exports['status']=function(_0xeb7c0f,_0x3648af,_0x2ea8af){if(_0xeb7c0f[_0x384d('0x59')]['id']){delete _0xeb7c0f['body']['id'];}var _0x425d59;return db[_0x384d('0x3e')][_0x384d('0x57')]({'where':{'id':_0xeb7c0f[_0x384d('0x56')]['id']}})['then'](handleEntityNotFound(_0x3648af,null))[_0x384d('0x22')](function(_0x703656){if(_0x703656){_0x425d59=_0x703656;return db[_0x384d('0x86')][_0x384d('0x57')]({'where':{'id':_0x703656[_0x384d('0x87')]}});}})['then'](handleEntityNotFound(_0x3648af,null))[_0x384d('0x22')](function(_0x20d290){if(_0x20d290){logger['debug'](_0x384d('0x88'),_0x384d('0x2d'),'received\x20delivery\x20report\x20from',_0x20d290[_0x384d('0x3f')],util[_0x384d('0x89')](_0xeb7c0f[_0x384d('0x59')],{'showHidden':![],'depth':null}));switch(_0x20d290[_0x384d('0x3f')]){case _0x384d('0x8a'):if(_0xeb7c0f[_0x384d('0x59')][_0x384d('0x8b')]&&_0xeb7c0f[_0x384d('0x59')][_0x384d('0x8b')]===_0x425d59['messageId']&&_0xeb7c0f[_0x384d('0x59')][_0x384d('0x8c')]&&_0xeb7c0f['body']['MessageStatus']==='read'){return _0x425d59['update']({'read':!![]});}else{logger[_0x384d('0x28')](_0x384d('0x8d'),'status',_0x384d('0x8a'),util[_0x384d('0x89')](_0xeb7c0f[_0x384d('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x425d59;}})[_0x384d('0x22')](respondWithResult(_0x3648af,null))[_0x384d('0x2b')](handleError(_0x3648af,null));}; \ No newline at end of file +var _0xed67=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','contact','internal','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x3ed487,_0x4b477a){var _0x370b89=function(_0x3b5df9){while(--_0x3b5df9){_0x3ed487['push'](_0x3ed487['shift']());}};_0x370b89(++_0x4b477a);}(_0xed67,0xd2));var _0x7ed6=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0xed67[_0x5fa520];return _0x1bf6c4;};'use strict';var emlformat=require(_0x7ed6('0x0'));var rimraf=require(_0x7ed6('0x1'));var zipdir=require(_0x7ed6('0x2'));var jsonpatch=require(_0x7ed6('0x3'));var rp=require(_0x7ed6('0x4'));var moment=require(_0x7ed6('0x5'));var BPromise=require(_0x7ed6('0x6'));var Mustache=require(_0x7ed6('0x7'));var util=require(_0x7ed6('0x8'));var path=require(_0x7ed6('0x9'));var sox=require(_0x7ed6('0xa'));var csv=require(_0x7ed6('0xb'));var ejs=require(_0x7ed6('0xc'));var fs=require('fs');var fs_extra=require(_0x7ed6('0xd'));var _=require(_0x7ed6('0xe'));var squel=require(_0x7ed6('0xf'));var crypto=require(_0x7ed6('0x10'));var jsforce=require(_0x7ed6('0x11'));var deskjs=require(_0x7ed6('0x12'));var toCsv=require(_0x7ed6('0xb'));var querystring=require(_0x7ed6('0x13'));var Papa=require('papaparse');var Redis=require(_0x7ed6('0x14'));var authService=require(_0x7ed6('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x7ed6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ed6('0x17'))(_0x7ed6('0x18'));var utils=require(_0x7ed6('0x19'));var config=require(_0x7ed6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7ed6('0x1b'))['db'];config[_0x7ed6('0x1c')]=_[_0x7ed6('0x1d')](config['redis'],{'host':_0x7ed6('0x1e'),'port':0x18eb});var socket=require(_0x7ed6('0x1f'))(new Redis(config[_0x7ed6('0x1c')]));require(_0x7ed6('0x20'))['register'](socket);var jayson=require(_0x7ed6('0x21'));var client=jayson[_0x7ed6('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x7ed6('0x22')][_0x7ed6('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x4dd7ce,_0x4793ac,_0x541a80,_0x57a011){return new BPromise(function(_0x5b841e,_0x8299af){var _0x11ebd9=_0x57a011||client;return _0x11ebd9[_0x7ed6('0x24')](_0x4dd7ce,_0x541a80)['then'](function(_0x7d050){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4793ac,'request\x20sent');logger[_0x7ed6('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4793ac,_0x7ed6('0x26'),JSON[_0x7ed6('0x27')](_0x7d050));if(_0x7d050['error']){if(_0x7d050[_0x7ed6('0x28')]['code']===0x1f4){logger[_0x7ed6('0x28')](_0x7ed6('0x29'),_0x4793ac,_0x7d050[_0x7ed6('0x28')]['message']);return _0x8299af(_0x7d050[_0x7ed6('0x28')]['message']);}logger['error'](_0x7ed6('0x29'),_0x4793ac,_0x7d050[_0x7ed6('0x28')][_0x7ed6('0x2a')]);return _0x5b841e(_0x7d050[_0x7ed6('0x28')]['message']);}else{logger[_0x7ed6('0x2b')](_0x7ed6('0x29'),_0x4793ac,'request\x20sent');_0x5b841e(_0x7d050[_0x7ed6('0x2c')]['message']);}})[_0x7ed6('0x2d')](function(_0x4d9331){logger['error'](_0x7ed6('0x29'),_0x4793ac,_0x4d9331);_0x8299af(_0x4d9331);});});}function respondWithStatusCode(_0x5287b3,_0x5ad6dd){_0x5ad6dd=_0x5ad6dd||0xcc;return function(_0x417017){if(_0x417017){return _0x5287b3[_0x7ed6('0x2e')](_0x5ad6dd);}return _0x5287b3[_0x7ed6('0x2f')](_0x5ad6dd)['end']();};}function respondWithResult(_0x4fd51a,_0x3fafce){_0x3fafce=_0x3fafce||0xc8;return function(_0x4d6081){if(_0x4d6081){return _0x4fd51a[_0x7ed6('0x2f')](_0x3fafce)['json'](_0x4d6081);}};}function respondWithFilteredResult(_0x32119d,_0x384788){return function(_0x100783){if(_0x100783){var _0x1e4040=typeof _0x384788[_0x7ed6('0x30')]===_0x7ed6('0x31')&&typeof _0x384788[_0x7ed6('0x32')]===_0x7ed6('0x31');var _0x1bfa50=_0x100783[_0x7ed6('0x33')];var _0x39e071=_0x1e4040?0x0:_0x384788[_0x7ed6('0x30')];var _0x14f4a7=_0x1e4040?_0x100783[_0x7ed6('0x33')]:_0x384788[_0x7ed6('0x30')]+_0x384788[_0x7ed6('0x32')];var _0x1ae60b;if(_0x14f4a7>=_0x1bfa50){_0x14f4a7=_0x1bfa50;_0x1ae60b=0xc8;}else{_0x1ae60b=0xce;}_0x32119d[_0x7ed6('0x2f')](_0x1ae60b);return _0x32119d[_0x7ed6('0x34')]('Content-Range',_0x39e071+'-'+_0x14f4a7+'/'+_0x1bfa50)[_0x7ed6('0x35')](_0x100783);}return null;};}function patchUpdates(_0x577731){return function(_0x12c3a7){try{jsonpatch[_0x7ed6('0x36')](_0x12c3a7,_0x577731,!![]);}catch(_0x5de1ef){return BPromise[_0x7ed6('0x37')](_0x5de1ef);}return _0x12c3a7[_0x7ed6('0x38')]();};}function saveUpdates(_0x4eace4,_0xd9ab18){return function(_0x3e28d0){if(_0x3e28d0){return _0x3e28d0[_0x7ed6('0x39')](_0x4eace4)[_0x7ed6('0x3a')](function(_0x27d914){return _0x27d914;});}return null;};}function removeEntity(_0x5089d2,_0x2ee3a1){return function(_0x33f906){if(_0x33f906){return _0x33f906[_0x7ed6('0x3b')]()[_0x7ed6('0x3a')](function(){_0x5089d2[_0x7ed6('0x2f')](0xcc)[_0x7ed6('0x3c')]();});}};}function handleEntityNotFound(_0x4a6123,_0x49aa57){return function(_0x4da3e2){if(!_0x4da3e2){_0x4a6123[_0x7ed6('0x2e')](0x194);}return _0x4da3e2;};}function handleError(_0x454f91,_0x338b09){_0x338b09=_0x338b09||0x1f4;return function(_0x1ffcfd){logger[_0x7ed6('0x28')](_0x1ffcfd['stack']);if(_0x1ffcfd[_0x7ed6('0x3d')]){delete _0x1ffcfd[_0x7ed6('0x3d')];}_0x454f91[_0x7ed6('0x2f')](_0x338b09)[_0x7ed6('0x3e')](_0x1ffcfd);};}exports[_0x7ed6('0x3f')]=function(_0x4d4bbc,_0x144344){var _0x157918={},_0x474a06={},_0x1cdc17={'count':0x0,'rows':[]};var _0x36142e=_[_0x7ed6('0x40')](db[_0x7ed6('0x41')][_0x7ed6('0x42')],function(_0x5bed25){return{'name':_0x5bed25[_0x7ed6('0x43')],'type':_0x5bed25[_0x7ed6('0x44')]['key']};});_0x474a06[_0x7ed6('0x45')]=_[_0x7ed6('0x40')](_0x36142e,'name');_0x474a06['query']=_[_0x7ed6('0x46')](_0x4d4bbc[_0x7ed6('0x47')]);_0x474a06[_0x7ed6('0x48')]=_[_0x7ed6('0x49')](_0x474a06[_0x7ed6('0x45')],_0x474a06[_0x7ed6('0x47')]);_0x157918[_0x7ed6('0x4a')]=_['intersection'](_0x474a06[_0x7ed6('0x45')],qs[_0x7ed6('0x4b')](_0x4d4bbc['query'][_0x7ed6('0x4b')]));_0x157918[_0x7ed6('0x4a')]=_0x157918['attributes']['length']?_0x157918[_0x7ed6('0x4a')]:_0x474a06[_0x7ed6('0x45')];if(!_0x4d4bbc['query'][_0x7ed6('0x4c')]('nolimit')){_0x157918[_0x7ed6('0x32')]=qs[_0x7ed6('0x32')](_0x4d4bbc[_0x7ed6('0x47')][_0x7ed6('0x32')]);_0x157918[_0x7ed6('0x30')]=qs[_0x7ed6('0x30')](_0x4d4bbc[_0x7ed6('0x47')][_0x7ed6('0x30')]);}_0x157918['order']=qs['sort'](_0x4d4bbc[_0x7ed6('0x47')][_0x7ed6('0x4d')]);_0x157918[_0x7ed6('0x4e')]=qs[_0x7ed6('0x48')](_[_0x7ed6('0x4f')](_0x4d4bbc[_0x7ed6('0x47')],_0x474a06[_0x7ed6('0x48')]),_0x36142e);if(_0x4d4bbc[_0x7ed6('0x47')][_0x7ed6('0x50')]){_0x157918['where']=_[_0x7ed6('0x51')](_0x157918[_0x7ed6('0x4e')],{'$or':_[_0x7ed6('0x40')](_0x36142e,function(_0x306e01){if(_0x306e01[_0x7ed6('0x44')]!==_0x7ed6('0x52')){var _0x54250e={};_0x54250e[_0x306e01[_0x7ed6('0x3d')]]={'$like':'%'+_0x4d4bbc[_0x7ed6('0x47')][_0x7ed6('0x50')]+'%'};return _0x54250e;}})});}_0x157918=_['merge']({},_0x157918,_0x4d4bbc[_0x7ed6('0x53')]);var _0x1b09d1={'where':_0x157918['where']};return db[_0x7ed6('0x41')][_0x7ed6('0x33')](_0x1b09d1)[_0x7ed6('0x3a')](function(_0x4da386){_0x1cdc17['count']=_0x4da386;if(_0x4d4bbc[_0x7ed6('0x47')][_0x7ed6('0x54')]){_0x157918[_0x7ed6('0x55')]=[{'all':!![]}];}return db[_0x7ed6('0x41')][_0x7ed6('0x56')](_0x157918);})[_0x7ed6('0x3a')](function(_0x530475){_0x1cdc17[_0x7ed6('0x57')]=_0x530475;return _0x1cdc17;})[_0x7ed6('0x3a')](respondWithFilteredResult(_0x144344,_0x157918))[_0x7ed6('0x2d')](handleError(_0x144344,null));};exports['show']=function(_0x2c43b5,_0x1dd546){var _0x41667e={'raw':!![],'where':{'id':_0x2c43b5[_0x7ed6('0x58')]['id']}},_0x503074={};_0x503074['model']=_['keys'](db['WhatsappMessage'][_0x7ed6('0x42')]);_0x503074[_0x7ed6('0x47')]=_['keys'](_0x2c43b5[_0x7ed6('0x47')]);_0x503074[_0x7ed6('0x48')]=_['intersection'](_0x503074[_0x7ed6('0x45')],_0x503074[_0x7ed6('0x47')]);_0x41667e[_0x7ed6('0x4a')]=_['intersection'](_0x503074['model'],qs['fields'](_0x2c43b5[_0x7ed6('0x47')][_0x7ed6('0x4b')]));_0x41667e[_0x7ed6('0x4a')]=_0x41667e[_0x7ed6('0x4a')][_0x7ed6('0x59')]?_0x41667e['attributes']:_0x503074[_0x7ed6('0x45')];if(_0x2c43b5[_0x7ed6('0x47')][_0x7ed6('0x54')]){_0x41667e[_0x7ed6('0x55')]=[{'all':!![]}];}_0x41667e=_['merge']({},_0x41667e,_0x2c43b5[_0x7ed6('0x53')]);return db[_0x7ed6('0x41')][_0x7ed6('0x5a')](_0x41667e)['then'](handleEntityNotFound(_0x1dd546,null))[_0x7ed6('0x3a')](respondWithResult(_0x1dd546,null))[_0x7ed6('0x2d')](handleError(_0x1dd546,null));};exports[_0x7ed6('0x5b')]=function(_0x2b9cb3,_0x325f23){return db[_0x7ed6('0x41')][_0x7ed6('0x5b')](_0x2b9cb3[_0x7ed6('0x5c')],{})['then'](respondWithResult(_0x325f23,0xc9))['catch'](handleError(_0x325f23,null));};exports[_0x7ed6('0x39')]=function(_0x1ed37f,_0xf01efb){if(_0x1ed37f[_0x7ed6('0x5c')]['id']){delete _0x1ed37f[_0x7ed6('0x5c')]['id'];}return db[_0x7ed6('0x41')][_0x7ed6('0x5a')]({'where':{'id':_0x1ed37f['params']['id']}})[_0x7ed6('0x3a')](handleEntityNotFound(_0xf01efb,null))['then'](saveUpdates(_0x1ed37f[_0x7ed6('0x5c')],null))[_0x7ed6('0x3a')](respondWithResult(_0xf01efb,null))['catch'](handleError(_0xf01efb,null));};exports[_0x7ed6('0x3b')]=function(_0x1b7fec,_0x38bc79){return db[_0x7ed6('0x41')][_0x7ed6('0x5a')]({'where':{'id':_0x1b7fec['params']['id']}})[_0x7ed6('0x3a')](handleEntityNotFound(_0x38bc79,null))[_0x7ed6('0x3a')](removeEntity(_0x38bc79,null))[_0x7ed6('0x2d')](handleError(_0x38bc79,null));};exports[_0x7ed6('0x5d')]=function(_0x30173a,_0x48fb7b){return db['WhatsappMessage'][_0x7ed6('0x5d')]()[_0x7ed6('0x3a')](respondWithResult(_0x48fb7b,null))[_0x7ed6('0x2d')](handleError(_0x48fb7b,null));};var interaction_log=require(_0x7ed6('0x17'))(_0x7ed6('0x5e'));exports[_0x7ed6('0x5f')]=function(_0x52572c,_0x185b3f,_0x496b38){var _0xde0eee={'agent':{},'channel':_0x7ed6('0x60')};if(_0x52572c[_0x7ed6('0x5c')]['id']){delete _0x52572c[_0x7ed6('0x5c')]['id'];}_0x52572c['body'][_0x7ed6('0x61')]=!![];_0x52572c[_0x7ed6('0x5c')][_0x7ed6('0x62')]=moment()[_0x7ed6('0x63')](_0x7ed6('0x64'));_0x52572c[_0x7ed6('0x5c')][_0x7ed6('0x65')]=_0x52572c[_0x7ed6('0x5c')][_0x7ed6('0x65')]||_0x52572c[_0x7ed6('0x66')]['id'];_0xde0eee[_0x7ed6('0x67')]['id']=_0x52572c[_0x7ed6('0x5c')][_0x7ed6('0x65')];return db[_0x7ed6('0x41')][_0x7ed6('0x5a')]({'where':{'id':_0x52572c[_0x7ed6('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x185b3f,null))['then'](saveUpdates(_0x52572c[_0x7ed6('0x5c')],null))[_0x7ed6('0x3a')](function(_0xd0ac09){if(_0xd0ac09){_0xde0eee[_0x7ed6('0x2a')]=_0xd0ac09[_0x7ed6('0x68')]({'plain':!![]});return db['WhatsappInteraction'][_0x7ed6('0x5a')]({'where':{'id':_0xd0ac09[_0x7ed6('0x69')]}});}return null;})[_0x7ed6('0x3a')](handleEntityNotFound(_0x185b3f,null))['then'](function(_0x56dae2){if(_0x56dae2){return _0x56dae2['update']({'UserId':_0x52572c[_0x7ed6('0x5c')][_0x7ed6('0x65')],'read1stAt':_['isNil'](_0x56dae2[_0x7ed6('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xd0cf5){if(_0xd0cf5){_0xde0eee[_0x7ed6('0x6b')]=_0xd0cf5[_0x7ed6('0x68')]({'plain':!![]});interaction_log[_0x7ed6('0x2b')](_0x7ed6('0x6c'),_0x52572c[_0x7ed6('0x66')]['id'],_0x52572c['user'][_0x7ed6('0x3d')],_0x52572c[_0x7ed6('0x66')]['role'],_0xde0eee[_0x7ed6('0x6b')]['id'],_0x52572c[_0x7ed6('0x5c')]?JSON['stringify'](_0x52572c[_0x7ed6('0x5c')]):_0x7ed6('0x6d'));return respondWithRpcPromise(_0x7ed6('0x6e'),_0x7ed6('0x6f'),_0xde0eee);}return null;})['then'](function(_0x5e87a1){var _0x510277=_0x7ed6('0x70')+_0x5e87a1[_0x7ed6('0x2a')][_0x7ed6('0x71')];return db[_0x7ed6('0x72')]['query'](_0x510277,{'type':db[_0x7ed6('0x73')][_0x7ed6('0x74')]['SELECT'],'raw':!![]})[_0x7ed6('0x3a')](function(_0x8d0f46){return _0x8d0f46;});})[_0x7ed6('0x3a')](function(_0x88ec66){if(_0x88ec66){_0xde0eee[_0x7ed6('0x2a')]['contact']=_0x88ec66[0x0];if(!_0x52572c[_0x7ed6('0x5c')][_0x7ed6('0x65')])return;return db[_0x7ed6('0x75')][_0x7ed6('0x5a')]({'where':{'id':_0x52572c['body'][_0x7ed6('0x65')],'role':_0x7ed6('0x67')},'attributes':['id',_0x7ed6('0x3d'),_0x7ed6('0x76'),_0x7ed6('0x77'),'internal'],'raw':!![]});}return null;})[_0x7ed6('0x3a')](function(_0x28b1fd){if(!_0x28b1fd)return null;_0xde0eee[_0x7ed6('0x2a')][_0x7ed6('0x67')]=_0x28b1fd;return _0xde0eee;})['then'](function(_0x16817f){if(_0x16817f){if(_0x52572c[_0x7ed6('0x5c')]['manual']){_0xde0eee[_0x7ed6('0x2a')]['interface']=util[_0x7ed6('0x63')](_0x7ed6('0x78'),_0x52572c[_0x7ed6('0x66')][_0x7ed6('0x3d')]);_0xde0eee['message'][_0x7ed6('0x79')]=_0xde0eee[_0x7ed6('0x79')];_0xde0eee[_0x7ed6('0x2a')][_0x7ed6('0x7a')]=_0xde0eee[_0x7ed6('0x79')];_0xde0eee[_0x7ed6('0x2a')][_0x7ed6('0x7b')]=_0x7ed6('0x5f');return respondWithRpcPromise(_0x7ed6('0x7c'),'EventManager',{'event':_0x7ed6('0x7d'),'message':_0xde0eee['message']},client9002)[_0x7ed6('0x3a')](function(){return _0xde0eee;});}return _0xde0eee;}return null;})[_0x7ed6('0x3a')](respondWithResult(_0x185b3f,null))[_0x7ed6('0x2d')](handleError(_0x185b3f,null));};var interaction_log=require(_0x7ed6('0x17'))(_0x7ed6('0x5e'));exports[_0x7ed6('0x37')]=function(_0x37ca43,_0x371af2,_0x1aca9d){var _0x265f2b={'agent':{},'channel':_0x7ed6('0x60')};if(_0x37ca43[_0x7ed6('0x5c')]['id']){delete _0x37ca43[_0x7ed6('0x5c')]['id'];}_0x37ca43['body'][_0x7ed6('0x65')]=_0x37ca43[_0x7ed6('0x5c')][_0x7ed6('0x65')]||_0x37ca43[_0x7ed6('0x66')]['id'];_0x265f2b[_0x7ed6('0x67')]['id']=_0x37ca43[_0x7ed6('0x5c')][_0x7ed6('0x65')];return db[_0x7ed6('0x41')][_0x7ed6('0x5a')]({'where':{'id':_0x37ca43[_0x7ed6('0x58')]['id'],'UserId':null}})[_0x7ed6('0x3a')](handleEntityNotFound(_0x371af2,null))[_0x7ed6('0x3a')](function(_0x2a796b){if(_0x2a796b){_0x265f2b[_0x7ed6('0x2a')]=_0x2a796b['get']({'plain':!![]});return db['WhatsappInteraction'][_0x7ed6('0x5a')]({'where':{'id':_0x2a796b[_0x7ed6('0x69')]}});}return null;})[_0x7ed6('0x3a')](handleEntityNotFound(_0x371af2,null))[_0x7ed6('0x3a')](function(_0x4161a0){if(_0x4161a0){_0x265f2b['interaction']=_0x4161a0[_0x7ed6('0x68')]({'plain':!![]});interaction_log[_0x7ed6('0x2b')](_0x7ed6('0x7e'),_0x37ca43[_0x7ed6('0x66')]['id'],_0x37ca43[_0x7ed6('0x66')][_0x7ed6('0x3d')],_0x37ca43[_0x7ed6('0x66')][_0x7ed6('0x7f')],_0x265f2b[_0x7ed6('0x6b')]['id'],_0x37ca43[_0x7ed6('0x5c')]?JSON[_0x7ed6('0x27')](_0x37ca43['body']):'null');return respondWithRpcPromise(_0x7ed6('0x80'),_0x7ed6('0x81'),_0x265f2b);}return null;})[_0x7ed6('0x3a')](function(_0x12c1bf){var _0x114994=_0x7ed6('0x70')+_0x12c1bf['message'][_0x7ed6('0x71')];return db['sequelize'][_0x7ed6('0x47')](_0x114994,{'type':db[_0x7ed6('0x73')][_0x7ed6('0x74')][_0x7ed6('0x82')],'raw':!![]})['then'](function(_0x587388){return _0x587388;});})['then'](function(_0x264c68){if(_0x264c68){_0x265f2b[_0x7ed6('0x2a')][_0x7ed6('0x83')]=_0x264c68[0x0];if(!_0x37ca43[_0x7ed6('0x5c')][_0x7ed6('0x65')])return;return db[_0x7ed6('0x75')][_0x7ed6('0x5a')]({'where':{'id':_0x37ca43['body']['UserId'],'role':_0x7ed6('0x67')},'attributes':['id',_0x7ed6('0x3d'),_0x7ed6('0x76'),'email',_0x7ed6('0x84')],'raw':!![]});}return null;})[_0x7ed6('0x3a')](function(_0x105121){if(!_0x105121)return null;_0x265f2b['message'][_0x7ed6('0x67')]=_0x105121;return _0x265f2b;})[_0x7ed6('0x3a')](function(_0x2e5427){if(_0x2e5427){_0x2e5427[_0x7ed6('0x2a')][_0x7ed6('0x85')]=util[_0x7ed6('0x63')](_0x7ed6('0x78'),_0x37ca43[_0x7ed6('0x66')][_0x7ed6('0x3d')]);_0x2e5427[_0x7ed6('0x2a')][_0x7ed6('0x79')]=_0x265f2b[_0x7ed6('0x79')];_0x2e5427['message'][_0x7ed6('0x7a')]=_0x265f2b['channel'];_0x2e5427[_0x7ed6('0x2a')]['event']='reject';respondWithRpcPromise(_0x7ed6('0x7c'),'EventManager',{'event':_0x7ed6('0x86'),'message':_0x2e5427[_0x7ed6('0x2a')]},client9002);return _0x265f2b;}return null;})[_0x7ed6('0x3a')](respondWithResult(_0x371af2,null))[_0x7ed6('0x2d')](handleError(_0x371af2,null));};exports[_0x7ed6('0x2f')]=function(_0x3ee30b,_0x5466f0,_0x26b54c){if(_0x3ee30b['body']['id']){delete _0x3ee30b['body']['id'];}var _0x25e32c;return db[_0x7ed6('0x41')][_0x7ed6('0x5a')]({'where':{'id':_0x3ee30b[_0x7ed6('0x58')]['id']}})[_0x7ed6('0x3a')](handleEntityNotFound(_0x5466f0,null))[_0x7ed6('0x3a')](function(_0x3aab62){if(_0x3aab62){_0x25e32c=_0x3aab62;return db[_0x7ed6('0x87')][_0x7ed6('0x5a')]({'where':{'id':_0x3aab62[_0x7ed6('0x88')]}});}})[_0x7ed6('0x3a')](handleEntityNotFound(_0x5466f0,null))[_0x7ed6('0x3a')](function(_0x1e2f47){if(_0x1e2f47){logger[_0x7ed6('0x25')](_0x7ed6('0x89'),_0x7ed6('0x2f'),_0x7ed6('0x8a'),_0x1e2f47[_0x7ed6('0x44')],util[_0x7ed6('0x8b')](_0x3ee30b[_0x7ed6('0x5c')],{'showHidden':![],'depth':null}));switch(_0x1e2f47[_0x7ed6('0x44')]){case _0x7ed6('0x8c'):if(_0x3ee30b[_0x7ed6('0x5c')]['MessageSid']&&_0x3ee30b[_0x7ed6('0x5c')][_0x7ed6('0x8d')]===_0x25e32c[_0x7ed6('0x8e')]&&_0x3ee30b[_0x7ed6('0x5c')][_0x7ed6('0x8f')]&&_0x3ee30b[_0x7ed6('0x5c')][_0x7ed6('0x8f')]===_0x7ed6('0x61')){return _0x25e32c[_0x7ed6('0x39')]({'read':!![]});}else{logger[_0x7ed6('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x7ed6('0x8c'),util[_0x7ed6('0x8b')](_0x3ee30b[_0x7ed6('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x25e32c;}})['then'](respondWithResult(_0x5466f0,null))[_0x7ed6('0x2d')](handleError(_0x5466f0,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d5e722c..535a5c7 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 _0x58a4=['emit','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1e23bd,_0x3072cb){var _0x5e0f24=function(_0x1f9c1a){while(--_0x1f9c1a){_0x1e23bd['push'](_0x1e23bd['shift']());}};_0x5e0f24(++_0x3072cb);}(_0x58a4,0xbf));var _0x458a=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x58a4[_0x10dc64];return _0x9cf98d;};'use strict';var EventEmitter=require(_0x458a('0x0'));var WhatsappMessage=require(_0x458a('0x1'))['db'][_0x458a('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x458a('0x3')](0x0);var events={'afterCreate':_0x458a('0x4'),'afterUpdate':_0x458a('0x5'),'afterDestroy':_0x458a('0x6')};function emitEvent(_0xacd5b3){return function(_0x362079,_0x1b4d2e,_0x2fde72){WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3+':'+_0x362079['id'],_0x362079);WhatsappMessageEvents[_0x458a('0x7')](_0xacd5b3,_0x362079);_0x2fde72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x458a('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xd4f4=['update','remove','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x4ebc8b,_0x107b0d){_0x4ebc8b=_0x4ebc8b-0x0;var _0x4ab844=_0xd4f4[_0x4ebc8b];return _0x4ab844;};'use strict';var EventEmitter=require(_0x4d4f('0x0'));var WhatsappMessage=require(_0x4d4f('0x1'))['db'][_0x4d4f('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4d4f('0x3')](0x0);var events={'afterCreate':_0x4d4f('0x4'),'afterUpdate':_0x4d4f('0x5'),'afterDestroy':_0x4d4f('0x6')};function emitEvent(_0x2c43da){return function(_0x25087a,_0xa53cb8,_0x15585){WhatsappMessageEvents['emit'](_0x2c43da+':'+_0x25087a['id'],_0x25087a);WhatsappMessageEvents['emit'](_0x2c43da,_0x25087a);_0x15585(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x4d4f('0x7')](e,emitEvent(event));}}module[_0x4d4f('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 42965b8..fd9d0fb 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 _0x34e7=['../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','authToken','baseUrl','/whatsapp/v1/','/messages/','text','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf'];(function(_0x36ef48,_0x5e0395){var _0x191fe8=function(_0x1bd1b1){while(--_0x1bd1b1){_0x36ef48['push'](_0x36ef48['shift']());}};_0x191fe8(++_0x5e0395);}(_0x34e7,0x164));var _0x734e=function(_0x2d8d12,_0x5ec696){_0x2d8d12=_0x2d8d12-0x0;var _0x3c2473=_0x34e7[_0x2d8d12];return _0x3c2473;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var logger=require(_0x734e('0x2'))(_0x734e('0x3'));var moment=require(_0x734e('0x4'));var BPromise=require(_0x734e('0x5'));var rp=require(_0x734e('0x6'));var fetch=require(_0x734e('0x7'));var fs=require('fs');var path=require(_0x734e('0x8'));var rimraf=require(_0x734e('0x9'));var config=require(_0x734e('0xa'));var attributes=require(_0x734e('0xb'));module[_0x734e('0xc')]=function(_0x192562,_0x4f49aa){return _0x192562[_0x734e('0xd')](_0x734e('0xe'),attributes,{'tableName':_0x734e('0xf'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x734e('0x10')]},{'name':'fti_whatsapp_messages','fields':[_0x734e('0x11')],'type':_0x734e('0x12')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3eee26,_0x4161e2,_0x37350f){var _0x3d117e=_0x192562['models'];var _0x49be19=_0x3eee26[_0x734e('0x13')]({'plain':!![]});if(_0x49be19[_0x734e('0x14')][_0x734e('0x15')]()==='in'||_0x49be19[_0x734e('0x14')]['toLowerCase']()===_0x734e('0x16')&&!_0x49be19[_0x734e('0x17')]&&!_['isNil'](_0x49be19[_0x734e('0x18')])){_0x3d117e[_0x734e('0x19')][_0x734e('0x1a')]({'where':{'id':_0x49be19[_0x734e('0x1b')]}})[_0x734e('0x1c')](function(_0x4e22b5){if(_0x4e22b5){_0x4e22b5[_0x734e('0x1d')]({'lastMsgAt':_0x49be19[_0x734e('0x1e')],'lastMsgDirection':_0x49be19[_0x734e('0x14')]['toLowerCase']()});}})[_0x734e('0x1f')](function(_0x4cb595){console[_0x734e('0x20')](_0x4cb595);});}if(_0x49be19[_0x734e('0x14')]==='out'&&!_0x49be19[_0x734e('0x17')]){var _0x52b432;_0x3d117e[_0x734e('0x21')]['find']({'where':{'id':_0x49be19[_0x734e('0x22')]},'raw':!![]})[_0x734e('0x1c')](function(_0x207a8f){_0x52b432=_0x207a8f;if(_0x52b432&&_0x52b432[_0x734e('0x23')]){switch(_0x52b432[_0x734e('0x23')]){case _0x734e('0x24'):var _0x138b29=require(_0x734e('0x24'));if(_0x52b432[_0x734e('0x25')]&&_0x52b432['authToken']&&_0x52b432[_0x734e('0x26')]){var _0x47bc5e=new _0x138b29(_0x52b432[_0x734e('0x25')],_0x52b432['authToken']);_0x47bc5e['messages'][_0x734e('0x27')]({'body':_0x49be19['body'],'to':_0x734e('0x28')+_0x49be19['phone'],'from':_0x734e('0x28')+_0x52b432[_0x734e('0x26')],'statusCallback':_0x52b432[_0x734e('0x29')]+_0x734e('0x2a')+_0x49be19['id']+_0x734e('0x2b')+_0x52b432[_0x734e('0x2c')]})[_0x734e('0x1c')](function(_0x3170c5){if(_0x3170c5[_0x734e('0x2d')]){return _0x3eee26['update']({'messageId':_0x3170c5['sid']});}})[_0x734e('0x1f')](function(_0x417961){logger[_0x734e('0x20')](_0x734e('0x2e'),_0x734e('0x2f'),_0x734e('0x24'),util[_0x734e('0x30')](_0x417961,{'showHidden':![],'depth':null}));});}else{logger[_0x734e('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x734e('0x2f'),'twilio',_0x734e('0x31'));}break;case _0x734e('0x32'):var _0x710b4=_0x52b432[_0x734e('0x25')];var _0x50e64c=_0x52b432[_0x734e('0x33')];var _0x273438=_0x52b432[_0x734e('0x34')]+_0x734e('0x35')+_0x710b4+_0x734e('0x36');var _0x51ef7e={'to':[_0x49be19[_0x734e('0x26')]],'message':{'type':_0x734e('0x37'),'text':_0x49be19[_0x734e('0x11')]}};var _0xf9deb1={'method':'POST','uri':_0x273438,'headers':{'Authorization':'Bearer\x20'+_0x50e64c,'Content-Type':'application/json'},'body':_0x51ef7e,'json':!![]};rp(_0xf9deb1)[_0x734e('0x1c')](function(_0xbf389e){if(_0xbf389e[_0x734e('0x38')][0x0][_0x734e('0x39')]){return _0x3eee26[_0x734e('0x1d')]({'messageId':_0xbf389e[_0x734e('0x38')][0x0][_0x734e('0x39')]});}})[_0x734e('0x1f')](function(_0x2a0409){logger['err']('WhatsappMessage,\x20%s',_0x2a0409);});break;}}})[_0x734e('0x3a')](function(){_0x37350f();});}else{_0x37350f();}}},'charset':_0x734e('0x3b'),'collate':_0x734e('0x3c')});}; \ No newline at end of file +var _0xb315=['../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','error','out','secret','WhatsappAccount','find','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1a08db,_0x29eeeb){var _0x5d2f16=function(_0x3524e4){while(--_0x3524e4){_0x1a08db['push'](_0x1a08db['shift']());}};_0x5d2f16(++_0x29eeeb);}(_0xb315,0x1a2));var _0x5b31=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0xb315[_0xdd827a];return _0x2f46f1;};'use strict';var _=require(_0x5b31('0x0'));var util=require(_0x5b31('0x1'));var logger=require(_0x5b31('0x2'))(_0x5b31('0x3'));var moment=require(_0x5b31('0x4'));var BPromise=require(_0x5b31('0x5'));var rp=require(_0x5b31('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x5b31('0x7'));var rimraf=require(_0x5b31('0x8'));var config=require(_0x5b31('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0x5b31('0xa')]=function(_0xd6cfb7,_0x2866c0){return _0xd6cfb7[_0x5b31('0xb')]('WhatsappMessage',attributes,{'tableName':_0x5b31('0xc'),'paranoid':![],'indexes':[{'name':_0x5b31('0xd'),'fields':['messageId']},{'name':_0x5b31('0xe'),'fields':[_0x5b31('0xf')],'type':_0x5b31('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x465020,_0x26f59c,_0xd35b45){var _0x14cc1e=_0xd6cfb7[_0x5b31('0x11')];var _0x5cecde=_0x465020['get']({'plain':!![]});if(_0x5cecde[_0x5b31('0x12')][_0x5b31('0x13')]()==='in'||_0x5cecde[_0x5b31('0x12')][_0x5b31('0x13')]()==='out'&&!_0x5cecde['secret']&&!_[_0x5b31('0x14')](_0x5cecde[_0x5b31('0x15')])){_0x14cc1e['WhatsappInteraction'][_0x5b31('0x16')]({'where':{'id':_0x5cecde[_0x5b31('0x17')]}})[_0x5b31('0x18')](function(_0x4801ba){if(_0x4801ba){_0x4801ba[_0x5b31('0x19')]({'lastMsgAt':_0x5cecde[_0x5b31('0x1a')],'lastMsgDirection':_0x5cecde[_0x5b31('0x12')][_0x5b31('0x13')]()});}})['catch'](function(_0x3e1b40){console[_0x5b31('0x1b')](_0x3e1b40);});}if(_0x5cecde[_0x5b31('0x12')]===_0x5b31('0x1c')&&!_0x5cecde[_0x5b31('0x1d')]){var _0x36c50f;_0x14cc1e[_0x5b31('0x1e')][_0x5b31('0x1f')]({'where':{'id':_0x5cecde['WhatsappAccountId']},'raw':!![]})[_0x5b31('0x18')](function(_0x51ab9c){_0x36c50f=_0x51ab9c;if(_0x36c50f&&_0x36c50f['type']){switch(_0x36c50f['type']){case _0x5b31('0x20'):var _0x51d6f3=require(_0x5b31('0x20'));if(_0x36c50f[_0x5b31('0x21')]&&_0x36c50f[_0x5b31('0x22')]&&_0x36c50f[_0x5b31('0x23')]){var _0x2d44d3=new _0x51d6f3(_0x36c50f['accountSid'],_0x36c50f[_0x5b31('0x22')]);_0x2d44d3[_0x5b31('0x24')][_0x5b31('0x25')]({'body':_0x5cecde[_0x5b31('0xf')],'to':'whatsapp:'+_0x5cecde[_0x5b31('0x23')],'from':_0x5b31('0x26')+_0x36c50f[_0x5b31('0x23')],'statusCallback':_0x36c50f[_0x5b31('0x27')]+_0x5b31('0x28')+_0x5cecde['id']+_0x5b31('0x29')+_0x36c50f['token']})[_0x5b31('0x18')](function(_0x31c9f4){if(_0x31c9f4[_0x5b31('0x2a')]){return _0x465020['update']({'messageId':_0x31c9f4[_0x5b31('0x2a')]});}})[_0x5b31('0x2b')](function(_0x332eb1){logger[_0x5b31('0x1b')](_0x5b31('0x2c'),_0x5b31('0x2d'),_0x5b31('0x20'),util[_0x5b31('0x2e')](_0x332eb1,{'showHidden':![],'depth':null}));});}else{logger[_0x5b31('0x1b')](_0x5b31('0x2c'),_0x5b31('0x2d'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x5b31('0x2f'):var _0x1d9a57=_0x36c50f[_0x5b31('0x21')];var _0x3caa38=_0x36c50f[_0x5b31('0x22')];var _0x4c5d50=_0x36c50f[_0x5b31('0x30')]+_0x5b31('0x31')+_0x1d9a57+_0x5b31('0x32');var _0x255c1e={'to':[_0x5cecde[_0x5b31('0x23')]],'message':{'type':_0x5b31('0x33'),'text':_0x5cecde['body']}};var _0x3b8b22={'method':_0x5b31('0x34'),'uri':_0x4c5d50,'headers':{'Authorization':_0x5b31('0x35')+_0x3caa38,'Content-Type':'application/json'},'body':_0x255c1e,'json':!![]};rp(_0x3b8b22)[_0x5b31('0x18')](function(_0x5973b9){if(_0x5973b9[_0x5b31('0x36')][0x0][_0x5b31('0x37')]){return _0x465020[_0x5b31('0x19')]({'messageId':_0x5973b9[_0x5b31('0x36')][0x0][_0x5b31('0x37')]});}})[_0x5b31('0x2b')](function(_0x1b7da1){logger[_0x5b31('0x38')](_0x5b31('0x39'),_0x1b7da1);});break;}}})[_0x5b31('0x3a')](function(){_0xd35b45();});}else{_0xd35b45();}}},'charset':_0x5b31('0x3b'),'collate':_0x5b31('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 44406e8..cdef49f 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 _0x40b4=['request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','WhatsappMessage,\x20%s,\x20%s'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0x40b4,0x10d));var _0x440b=function(_0x3dd3ee,_0x3dbf50){_0x3dd3ee=_0x3dd3ee-0x0;var _0x59b7a9=_0x40b4[_0x3dd3ee];return _0x59b7a9;};'use strict';var _=require(_0x440b('0x0'));var util=require(_0x440b('0x1'));var moment=require(_0x440b('0x2'));var BPromise=require(_0x440b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x440b('0x4'));var db=require(_0x440b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x440b('0x6'))(_0x440b('0x7'));var config=require(_0x440b('0x8'));var jayson=require(_0x440b('0x9'));var client=jayson['client'][_0x440b('0xa')]({'port':0x232a});config['redis']=_[_0x440b('0xb')](config[_0x440b('0xc')],{'host':_0x440b('0xd'),'port':0x18eb});var socket=require(_0x440b('0xe'))(new Redis(config['redis']));require(_0x440b('0xf'))[_0x440b('0x10')](socket);function respondWithRpcPromise(_0x172904,_0x10c3d6,_0x16c0de){return new BPromise(function(_0x22ef2c,_0x5a77b9){return client['request'](_0x172904,_0x16c0de)[_0x440b('0x11')](function(_0x16507e){logger['info'](_0x440b('0x12'),_0x10c3d6,_0x440b('0x13'));logger['debug'](_0x440b('0x14'),_0x10c3d6,'request\x20sent',JSON[_0x440b('0x15')](_0x16507e));if(_0x16507e[_0x440b('0x16')]){if(_0x16507e[_0x440b('0x16')]['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x10c3d6,_0x16507e[_0x440b('0x16')][_0x440b('0x17')]);return _0x5a77b9(_0x16507e[_0x440b('0x16')][_0x440b('0x17')]);}logger[_0x440b('0x16')](_0x440b('0x12'),_0x10c3d6,_0x16507e['error'][_0x440b('0x17')]);return _0x22ef2c(_0x16507e[_0x440b('0x16')][_0x440b('0x17')]);}else{logger[_0x440b('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x10c3d6,_0x440b('0x13'));_0x22ef2c(_0x16507e['result'][_0x440b('0x17')]);}})[_0x440b('0x19')](function(_0x497023){logger[_0x440b('0x16')](_0x440b('0x12'),_0x10c3d6,_0x497023);_0x5a77b9(_0x497023);});});}exports[_0x440b('0x1a')]=function(_0x37abcd){var _0xe892e2=this;return new Promise(function(_0x655c0a,_0x326af1){return db[_0x440b('0x1b')][_0x440b('0x1c')](_0x37abcd[_0x440b('0x1d')],{'raw':_0x37abcd['options']?_0x37abcd[_0x440b('0x1e')][_0x440b('0x1f')]===undefined?!![]:![]:!![]})[_0x440b('0x11')](function(_0x597b63){logger['info'](_0x440b('0x1a'),_0x37abcd);logger['debug'](_0x440b('0x1a'),_0x37abcd,JSON[_0x440b('0x15')](_0x597b63));_0x655c0a(_0x597b63);})['catch'](function(_0x24a791){logger['error'](_0x440b('0x1a'),_0x24a791[_0x440b('0x17')],_0x37abcd);_0x326af1(_0xe892e2['error'](0x1f4,_0x24a791[_0x440b('0x17')]));});});}; \ No newline at end of file +var _0x7d91=['WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','debug'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x7d91,0x99));var _0x17d9=function(_0x5da8db,_0x5c2103){_0x5da8db=_0x5da8db-0x0;var _0x1eb753=_0x7d91[_0x5da8db];return _0x1eb753;};'use strict';var _=require(_0x17d9('0x0'));var util=require(_0x17d9('0x1'));var moment=require(_0x17d9('0x2'));var BPromise=require(_0x17d9('0x3'));var rs=require(_0x17d9('0x4'));var fs=require('fs');var Redis=require(_0x17d9('0x5'));var db=require(_0x17d9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x17d9('0x7'))(_0x17d9('0x8'));var config=require(_0x17d9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x17d9('0xa')][_0x17d9('0xb')]({'port':0x232a});config[_0x17d9('0xc')]=_[_0x17d9('0xd')](config[_0x17d9('0xc')],{'host':_0x17d9('0xe'),'port':0x18eb});var socket=require(_0x17d9('0xf'))(new Redis(config[_0x17d9('0xc')]));require(_0x17d9('0x10'))[_0x17d9('0x11')](socket);function respondWithRpcPromise(_0x3dd0f9,_0x26ca86,_0x117e43){return new BPromise(function(_0x153e70,_0x46b3c1){return client['request'](_0x3dd0f9,_0x117e43)[_0x17d9('0x12')](function(_0x52083d){logger[_0x17d9('0x13')](_0x17d9('0x14'),_0x26ca86,'request\x20sent');logger[_0x17d9('0x15')](_0x17d9('0x16'),_0x26ca86,_0x17d9('0x17'),JSON[_0x17d9('0x18')](_0x52083d));if(_0x52083d[_0x17d9('0x19')]){if(_0x52083d['error'][_0x17d9('0x1a')]===0x1f4){logger[_0x17d9('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x26ca86,_0x52083d[_0x17d9('0x19')][_0x17d9('0x1b')]);return _0x46b3c1(_0x52083d[_0x17d9('0x19')][_0x17d9('0x1b')]);}logger[_0x17d9('0x19')](_0x17d9('0x14'),_0x26ca86,_0x52083d[_0x17d9('0x19')][_0x17d9('0x1b')]);return _0x153e70(_0x52083d[_0x17d9('0x19')][_0x17d9('0x1b')]);}else{logger['info'](_0x17d9('0x14'),_0x26ca86,_0x17d9('0x17'));_0x153e70(_0x52083d['result'][_0x17d9('0x1b')]);}})[_0x17d9('0x1c')](function(_0x165a10){logger[_0x17d9('0x19')](_0x17d9('0x14'),_0x26ca86,_0x165a10);_0x46b3c1(_0x165a10);});});}exports['CreateWhatsappMessage']=function(_0x2efeeb){var _0x3c0319=this;return new Promise(function(_0x329b58,_0x488a78){return db[_0x17d9('0x1d')][_0x17d9('0x1e')](_0x2efeeb[_0x17d9('0x1f')],{'raw':_0x2efeeb[_0x17d9('0x20')]?_0x2efeeb[_0x17d9('0x20')][_0x17d9('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x2f91a7){logger[_0x17d9('0x13')](_0x17d9('0x22'),_0x2efeeb);logger[_0x17d9('0x15')](_0x17d9('0x22'),_0x2efeeb,JSON['stringify'](_0x2f91a7));_0x329b58(_0x2f91a7);})[_0x17d9('0x1c')](function(_0x45de62){logger[_0x17d9('0x19')](_0x17d9('0x22'),_0x45de62[_0x17d9('0x1b')],_0x2efeeb);_0x488a78(_0x3c0319[_0x17d9('0x19')](0x1f4,_0x45de62[_0x17d9('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ae955c9..99f3718 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 _0x10ff=['./whatsappMessage.events','save','remove','update','emit','removeListener','register','whatsappMessage:'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x10ff,0xe8));var _0xf10f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x10ff[_0x40a045];return _0x1a687c;};'use strict';var WhatsappMessageEvents=require(_0xf10f('0x0'));var events=[_0xf10f('0x1'),_0xf10f('0x2'),_0xf10f('0x3')];function createListener(_0x125dae,_0x188dbe){return function(_0x21955e){_0x188dbe[_0xf10f('0x4')](_0x125dae,_0x21955e);};}function removeListener(_0x1aa458,_0x11e1e6){return function(){WhatsappMessageEvents[_0xf10f('0x5')](_0x1aa458,_0x11e1e6);};}exports[_0xf10f('0x6')]=function(_0x57f0e6){for(var _0x5d3f63=0x0,_0x37e143=events['length'];_0x5d3f63<_0x37e143;_0x5d3f63++){var _0x369c4b=events[_0x5d3f63];var _0x126618=createListener(_0xf10f('0x7')+_0x369c4b,_0x57f0e6);WhatsappMessageEvents['on'](_0x369c4b,_0x126618);}}; \ No newline at end of file +var _0x9f58=['save','remove','update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events'];(function(_0x53c7b8,_0x5df100){var _0x1421c2=function(_0x4be500){while(--_0x4be500){_0x53c7b8['push'](_0x53c7b8['shift']());}};_0x1421c2(++_0x5df100);}(_0x9f58,0x182));var _0x89f5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9f58[_0xa464c9];return _0x3d73c4;};'use strict';var WhatsappMessageEvents=require(_0x89f5('0x0'));var events=[_0x89f5('0x1'),_0x89f5('0x2'),_0x89f5('0x3')];function createListener(_0x1bb1b2,_0x5868d2){return function(_0x5d293c){_0x5868d2[_0x89f5('0x4')](_0x1bb1b2,_0x5d293c);};}function removeListener(_0x46506d,_0xaffaa0){return function(){WhatsappMessageEvents[_0x89f5('0x5')](_0x46506d,_0xaffaa0);};}exports[_0x89f5('0x6')]=function(_0x18b31b){for(var _0x35b5be=0x0,_0x2872b5=events[_0x89f5('0x7')];_0x35b5be<_0x2872b5;_0x35b5be++){var _0x34847a=events[_0x35b5be];var _0x1fc48e=createListener(_0x89f5('0x8')+_0x34847a,_0x18b31b);WhatsappMessageEvents['on'](_0x34847a,_0x1fc48e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 2b2dd49..f8250e6 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 _0x4135=['post','create','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents'];(function(_0x380c7f,_0x234003){var _0x57f3c2=function(_0x5b0848){while(--_0x5b0848){_0x380c7f['push'](_0x380c7f['shift']());}};_0x57f3c2(++_0x234003);}(_0x4135,0x1b9));var _0x5413=function(_0x22ed33,_0x30116f){_0x22ed33=_0x22ed33-0x0;var _0x2c4cf2=_0x4135[_0x22ed33];return _0x2c4cf2;};'use strict';var multer=require(_0x5413('0x0'));var util=require(_0x5413('0x1'));var path=require(_0x5413('0x2'));var timeout=require(_0x5413('0x3'));var express=require(_0x5413('0x4'));var router=express[_0x5413('0x5')]();var fs_extra=require(_0x5413('0x6'));var auth=require(_0x5413('0x7'));var interaction=require(_0x5413('0x8'));var config=require(_0x5413('0x9'));var controller=require('./whatsappQueue.controller');router[_0x5413('0xa')]('/',auth[_0x5413('0xb')](),controller['index']);router[_0x5413('0xa')](_0x5413('0xc'),auth[_0x5413('0xb')](),controller[_0x5413('0xd')]);router['get'](_0x5413('0xe'),auth['isAuthenticated'](),controller[_0x5413('0xf')]);router[_0x5413('0xa')](_0x5413('0x10'),auth[_0x5413('0xb')](),controller[_0x5413('0x11')]);router[_0x5413('0xa')]('/:id/teams',auth[_0x5413('0xb')](),controller[_0x5413('0x12')]);router['get'](_0x5413('0x13'),auth[_0x5413('0xb')](),controller[_0x5413('0x14')]);router[_0x5413('0x15')]('/',auth[_0x5413('0xb')](),controller[_0x5413('0x16')]);router[_0x5413('0x15')](_0x5413('0x17'),auth[_0x5413('0xb')](),controller[_0x5413('0x18')]);router[_0x5413('0x15')]('/:id/users',auth[_0x5413('0xb')](),controller[_0x5413('0x19')]);router[_0x5413('0x1a')](_0x5413('0xe'),auth[_0x5413('0xb')](),controller[_0x5413('0x1b')]);router['delete']('/:id',auth[_0x5413('0xb')](),controller[_0x5413('0x1c')]);router[_0x5413('0x1d')](_0x5413('0x17'),auth[_0x5413('0xb')](),controller[_0x5413('0x1e')]);router[_0x5413('0x1d')](_0x5413('0x13'),auth[_0x5413('0xb')](),controller[_0x5413('0x1f')]);module[_0x5413('0x20')]=router; \ No newline at end of file +var _0xa0bd=['/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post'];(function(_0x1d90ca,_0x3bab16){var _0x28872b=function(_0x3ea71b){while(--_0x3ea71b){_0x1d90ca['push'](_0x1d90ca['shift']());}};_0x28872b(++_0x3bab16);}(_0xa0bd,0x1c9));var _0xda0b=function(_0x48c371,_0x4ae797){_0x48c371=_0x48c371-0x0;var _0x310f17=_0xa0bd[_0x48c371];return _0x310f17;};'use strict';var multer=require(_0xda0b('0x0'));var util=require('util');var path=require(_0xda0b('0x1'));var timeout=require('connect-timeout');var express=require(_0xda0b('0x2'));var router=express[_0xda0b('0x3')]();var fs_extra=require(_0xda0b('0x4'));var auth=require(_0xda0b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0xda0b('0x6')](),controller[_0xda0b('0x7')]);router['get'](_0xda0b('0x8'),auth['isAuthenticated'](),controller[_0xda0b('0x9')]);router[_0xda0b('0xa')](_0xda0b('0xb'),auth['isAuthenticated'](),controller[_0xda0b('0xc')]);router[_0xda0b('0xa')](_0xda0b('0xd'),auth[_0xda0b('0x6')](),controller[_0xda0b('0xe')]);router[_0xda0b('0xa')]('/:id/teams',auth[_0xda0b('0x6')](),controller[_0xda0b('0xf')]);router['get'](_0xda0b('0x10'),auth[_0xda0b('0x6')](),controller[_0xda0b('0x11')]);router[_0xda0b('0x12')]('/',auth[_0xda0b('0x6')](),controller['create']);router[_0xda0b('0x12')](_0xda0b('0x13'),auth['isAuthenticated'](),controller[_0xda0b('0x14')]);router[_0xda0b('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xda0b('0x15')]);router['put'](_0xda0b('0xb'),auth['isAuthenticated'](),controller[_0xda0b('0x16')]);router[_0xda0b('0x17')](_0xda0b('0xb'),auth[_0xda0b('0x6')](),controller[_0xda0b('0x18')]);router['delete'](_0xda0b('0x13'),auth[_0xda0b('0x6')](),controller[_0xda0b('0x19')]);router[_0xda0b('0x17')](_0xda0b('0x10'),auth[_0xda0b('0x6')](),controller[_0xda0b('0x1a')]);module[_0xda0b('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 bf1cce7..98156cc 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 _0x668b=['name','INTEGER','rrmemory','roundrobin','STRING','sequelize','exports'];(function(_0x395fa6,_0x2696f3){var _0x3f9bdb=function(_0x12bb0e){while(--_0x12bb0e){_0x395fa6['push'](_0x395fa6['shift']());}};_0x3f9bdb(++_0x2696f3);}(_0x668b,0x140));var _0xb668=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0x668b[_0x5caf7e];return _0x5c3435;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb668('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb668('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb668('0x4'),'beepall',_0xb668('0x5'))},'description':{'type':Sequelize[_0xb668('0x6')]}}; \ No newline at end of file +var _0xf197=['sequelize','exports','STRING','ENUM'];(function(_0x99c2dd,_0x1d32eb){var _0x173349=function(_0x211a30){while(--_0x211a30){_0x99c2dd['push'](_0x99c2dd['shift']());}};_0x173349(++_0x1d32eb);}(_0xf197,0x130));var _0x7f19=function(_0x1f9af7,_0x3613d2){_0x1f9af7=_0x1f9af7-0x0;var _0x17e9eb=_0xf197[_0x1f9af7];return _0x17e9eb;};'use strict';var Sequelize=require(_0x7f19('0x0'));module[_0x7f19('0x1')]={'name':{'type':Sequelize[_0x7f19('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f19('0x3')]('rrmemory','beepall','roundrobin')},'description':{'type':Sequelize[_0x7f19('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 03baecf..258d1de 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 _0x9b0d=['to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','map','rawAttributes','fieldName','key','filters','model','fields','query','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','WhatsappQueue','includeAll','findAll','rows','catch','params','keys','intersection','include','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','update','describe','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','select','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','removeTeams','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x4e518d,_0x32a45d){var _0x458ff2=function(_0xc96c49){while(--_0xc96c49){_0x4e518d['push'](_0x4e518d['shift']());}};_0x458ff2(++_0x32a45d);}(_0x9b0d,0x82));var _0xd9b0=function(_0x1cadcd,_0x7dabc5){_0x1cadcd=_0x1cadcd-0x0;var _0xfbbb2d=_0x9b0d[_0x1cadcd];return _0xfbbb2d;};'use strict';var emlformat=require(_0xd9b0('0x0'));var rimraf=require(_0xd9b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9b0('0x2'));var rp=require('request-promise');var moment=require(_0xd9b0('0x3'));var BPromise=require(_0xd9b0('0x4'));var Mustache=require(_0xd9b0('0x5'));var util=require('util');var path=require(_0xd9b0('0x6'));var sox=require('sox');var csv=require(_0xd9b0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9b0('0x8'));var _=require(_0xd9b0('0x9'));var squel=require('squel');var crypto=require(_0xd9b0('0xa'));var jsforce=require(_0xd9b0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd9b0('0x7'));var querystring=require(_0xd9b0('0xc'));var Papa=require('papaparse');var Redis=require(_0xd9b0('0xd'));var authService=require(_0xd9b0('0xe'));var qs=require(_0xd9b0('0xf'));var as=require(_0xd9b0('0x10'));var hardwareService=require(_0xd9b0('0x11'));var logger=require(_0xd9b0('0x12'))(_0xd9b0('0x13'));var utils=require(_0xd9b0('0x14'));var config=require(_0xd9b0('0x15'));var licenseUtil=require(_0xd9b0('0x16'));var db=require(_0xd9b0('0x17'))['db'];config[_0xd9b0('0x18')]=_[_0xd9b0('0x19')](config[_0xd9b0('0x18')],{'host':_0xd9b0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd9b0('0x18')]));require(_0xd9b0('0x1b'))[_0xd9b0('0x1c')](socket);function respondWithStatusCode(_0x5239f7,_0x2d321f){_0x2d321f=_0x2d321f||0xcc;return function(_0x174170){if(_0x174170){return _0x5239f7[_0xd9b0('0x1d')](_0x2d321f);}return _0x5239f7[_0xd9b0('0x1e')](_0x2d321f)[_0xd9b0('0x1f')]();};}function respondWithResult(_0x1d332c,_0x2c32a6){_0x2c32a6=_0x2c32a6||0xc8;return function(_0x13db66){if(_0x13db66){return _0x1d332c[_0xd9b0('0x1e')](_0x2c32a6)[_0xd9b0('0x20')](_0x13db66);}};}function respondWithFilteredResult(_0x33aa88,_0x235750){return function(_0xe301f1){if(_0xe301f1){var _0x82db68=typeof _0x235750[_0xd9b0('0x21')]===_0xd9b0('0x22')&&typeof _0x235750[_0xd9b0('0x23')]===_0xd9b0('0x22');var _0x5c9893=_0xe301f1[_0xd9b0('0x24')];var _0x287174=_0x82db68?0x0:_0x235750[_0xd9b0('0x21')];var _0x1f6a62=_0x82db68?_0xe301f1[_0xd9b0('0x24')]:_0x235750['offset']+_0x235750[_0xd9b0('0x23')];var _0x4f05f0;if(_0x1f6a62>=_0x5c9893){_0x1f6a62=_0x5c9893;_0x4f05f0=0xc8;}else{_0x4f05f0=0xce;}_0x33aa88['status'](_0x4f05f0);return _0x33aa88[_0xd9b0('0x25')]('Content-Range',_0x287174+'-'+_0x1f6a62+'/'+_0x5c9893)[_0xd9b0('0x20')](_0xe301f1);}return null;};}function patchUpdates(_0x504de7){return function(_0x3e376b){try{jsonpatch[_0xd9b0('0x26')](_0x3e376b,_0x504de7,!![]);}catch(_0x1e6f12){return BPromise['reject'](_0x1e6f12);}return _0x3e376b['save']();};}function saveUpdates(_0x580ce7,_0x426618){return function(_0x369168){if(_0x369168){return _0x369168['update'](_0x580ce7)[_0xd9b0('0x27')](function(_0x56874b){return _0x56874b;});}return null;};}function removeEntity(_0x17012f,_0x1fae62){return function(_0x797db2){if(_0x797db2){return _0x797db2[_0xd9b0('0x28')]()[_0xd9b0('0x27')](function(){var _0x3d40e2=_0x797db2[_0xd9b0('0x29')]({'plain':!![]});var _0x4aae32=_0xd9b0('0x2a');return db[_0xd9b0('0x2b')][_0xd9b0('0x28')]({'where':{'type':_0x4aae32,'resourceId':_0x3d40e2['id']}})[_0xd9b0('0x27')](function(){return _0x797db2;});})[_0xd9b0('0x27')](function(){_0x17012f['status'](0xcc)[_0xd9b0('0x1f')]();});}};}function handleEntityNotFound(_0x21d876,_0x3944b8){return function(_0x36396e){if(!_0x36396e){_0x21d876[_0xd9b0('0x1d')](0x194);}return _0x36396e;};}function handleError(_0x5800c4,_0x5853f9){_0x5853f9=_0x5853f9||0x1f4;return function(_0xe14269){logger[_0xd9b0('0x2c')](_0xe14269['stack']);if(_0xe14269[_0xd9b0('0x2d')]){delete _0xe14269[_0xd9b0('0x2d')];}_0x5800c4[_0xd9b0('0x1e')](_0x5853f9)['send'](_0xe14269);};}exports['index']=function(_0x350238,_0x59fca3){var _0x5e1735={},_0x44b7b5={},_0x41393e={'count':0x0,'rows':[]};var _0x514e24=_[_0xd9b0('0x2e')](db['WhatsappQueue'][_0xd9b0('0x2f')],function(_0x12696c){return{'name':_0x12696c[_0xd9b0('0x30')],'type':_0x12696c['type'][_0xd9b0('0x31')]};});_0x44b7b5['model']=_[_0xd9b0('0x2e')](_0x514e24,'name');_0x44b7b5['query']=_['keys'](_0x350238['query']);_0x44b7b5[_0xd9b0('0x32')]=_['intersection'](_0x44b7b5[_0xd9b0('0x33')],_0x44b7b5['query']);_0x5e1735['attributes']=_['intersection'](_0x44b7b5[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x350238[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x5e1735[_0xd9b0('0x36')]=_0x5e1735[_0xd9b0('0x36')][_0xd9b0('0x37')]?_0x5e1735['attributes']:_0x44b7b5[_0xd9b0('0x33')];if(!_0x350238[_0xd9b0('0x35')][_0xd9b0('0x38')]('nolimit')){_0x5e1735['limit']=qs[_0xd9b0('0x23')](_0x350238[_0xd9b0('0x35')][_0xd9b0('0x23')]);_0x5e1735['offset']=qs[_0xd9b0('0x21')](_0x350238[_0xd9b0('0x35')]['offset']);}_0x5e1735[_0xd9b0('0x39')]=qs[_0xd9b0('0x3a')](_0x350238[_0xd9b0('0x35')][_0xd9b0('0x3a')]);_0x5e1735[_0xd9b0('0x3b')]=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x350238[_0xd9b0('0x35')],_0x44b7b5[_0xd9b0('0x32')]),_0x514e24);if(_0x350238[_0xd9b0('0x35')]['filter']){_0x5e1735['where']=_[_0xd9b0('0x3d')](_0x5e1735['where'],{'$or':_[_0xd9b0('0x2e')](_0x514e24,function(_0x3b19d5){if(_0x3b19d5[_0xd9b0('0x3e')]!==_0xd9b0('0x3f')){var _0x4340f8={};_0x4340f8[_0x3b19d5[_0xd9b0('0x2d')]]={'$like':'%'+_0x350238[_0xd9b0('0x35')][_0xd9b0('0x40')]+'%'};return _0x4340f8;}})});}_0x5e1735=_['merge']({},_0x5e1735,_0x350238['options']);var _0xba1c7c={'where':_0x5e1735[_0xd9b0('0x3b')]};return db[_0xd9b0('0x41')]['count'](_0xba1c7c)['then'](function(_0x282dfc){_0x41393e[_0xd9b0('0x24')]=_0x282dfc;if(_0x350238[_0xd9b0('0x35')][_0xd9b0('0x42')]){_0x5e1735['include']=[{'all':!![]}];}return db[_0xd9b0('0x41')][_0xd9b0('0x43')](_0x5e1735);})['then'](function(_0x213a8f){_0x41393e[_0xd9b0('0x44')]=_0x213a8f;return _0x41393e;})[_0xd9b0('0x27')](respondWithFilteredResult(_0x59fca3,_0x5e1735))[_0xd9b0('0x45')](handleError(_0x59fca3,null));};exports['show']=function(_0x1f499a,_0x3ff62a){var _0x4abc71={'raw':!![],'where':{'id':_0x1f499a[_0xd9b0('0x46')]['id']}},_0x241e47={};_0x241e47['model']=_[_0xd9b0('0x47')](db['WhatsappQueue'][_0xd9b0('0x2f')]);_0x241e47[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x1f499a[_0xd9b0('0x35')]);_0x241e47['filters']=_[_0xd9b0('0x48')](_0x241e47['model'],_0x241e47[_0xd9b0('0x35')]);_0x4abc71['attributes']=_[_0xd9b0('0x48')](_0x241e47[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x1f499a[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x4abc71[_0xd9b0('0x36')]=_0x4abc71[_0xd9b0('0x36')][_0xd9b0('0x37')]?_0x4abc71[_0xd9b0('0x36')]:_0x241e47[_0xd9b0('0x33')];if(_0x1f499a['query'][_0xd9b0('0x42')]){_0x4abc71[_0xd9b0('0x49')]=[{'all':!![]}];}_0x4abc71=_[_0xd9b0('0x3d')]({},_0x4abc71,_0x1f499a[_0xd9b0('0x4a')]);return db['WhatsappQueue'][_0xd9b0('0x4b')](_0x4abc71)[_0xd9b0('0x27')](handleEntityNotFound(_0x3ff62a,null))[_0xd9b0('0x27')](respondWithResult(_0x3ff62a,null))['catch'](handleError(_0x3ff62a,null));};exports[_0xd9b0('0x4c')]=function(_0x3d8ee0,_0x3857fe){return db['WhatsappQueue'][_0xd9b0('0x4c')](_0x3d8ee0[_0xd9b0('0x4d')],{})[_0xd9b0('0x27')](function(_0x2f66b4){var _0x738dc6=_0x3d8ee0[_0xd9b0('0x4e')][_0xd9b0('0x29')]({'plain':!![]});if(!_0x738dc6)throw new Error(_0xd9b0('0x4f'));if(_0x738dc6['role']==='user'){var _0x2a6d57=_0x2f66b4[_0xd9b0('0x29')]({'plain':!![]});var _0x44251c=_0xd9b0('0x2a');return db[_0xd9b0('0x50')][_0xd9b0('0x4b')]({'where':{'name':_0x44251c,'userProfileId':_0x738dc6[_0xd9b0('0x51')]},'raw':!![]})[_0xd9b0('0x27')](function(_0x4d30fb){if(_0x4d30fb&&_0x4d30fb[_0xd9b0('0x52')]===0x0){return db[_0xd9b0('0x2b')][_0xd9b0('0x4c')]({'name':_0x2a6d57[_0xd9b0('0x2d')],'resourceId':_0x2a6d57['id'],'type':_0x4d30fb[_0xd9b0('0x2d')],'sectionId':_0x4d30fb['id']},{})[_0xd9b0('0x27')](function(){return _0x2f66b4;});}else{return _0x2f66b4;}})['catch'](function(_0x2ea886){logger[_0xd9b0('0x2c')](_0xd9b0('0x53'),_0x2ea886);throw _0x2ea886;});}return _0x2f66b4;})[_0xd9b0('0x27')](respondWithResult(_0x3857fe,0xc9))[_0xd9b0('0x45')](handleError(_0x3857fe,null));};exports[_0xd9b0('0x54')]=function(_0x39a0a3,_0x980692){if(_0x39a0a3['body']['id']){delete _0x39a0a3[_0xd9b0('0x4d')]['id'];}return db[_0xd9b0('0x41')][_0xd9b0('0x4b')]({'where':{'id':_0x39a0a3[_0xd9b0('0x46')]['id']}})['then'](handleEntityNotFound(_0x980692,null))['then'](saveUpdates(_0x39a0a3['body'],null))[_0xd9b0('0x27')](respondWithResult(_0x980692,null))[_0xd9b0('0x45')](handleError(_0x980692,null));};exports[_0xd9b0('0x28')]=function(_0x584921,_0x5d1724){return db[_0xd9b0('0x41')][_0xd9b0('0x4b')]({'where':{'id':_0x584921[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x5d1724,null))[_0xd9b0('0x27')](removeEntity(_0x5d1724,null))[_0xd9b0('0x45')](handleError(_0x5d1724,null));};exports[_0xd9b0('0x55')]=function(_0x157ec0,_0x5a68e1){return db[_0xd9b0('0x41')][_0xd9b0('0x55')]()[_0xd9b0('0x27')](respondWithResult(_0x5a68e1,null))[_0xd9b0('0x45')](handleError(_0x5a68e1,null));};exports['getMembers']=function(_0x458fd2,_0x5b169c,_0x9fecd2){var _0x51a689={'raw':!![],'where':{}},_0x5ef333={},_0x50f5f1;return db[_0xd9b0('0x41')]['findOne']({'where':{'id':_0x458fd2[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x5b169c,null))[_0xd9b0('0x27')](function(_0x5db130){if(_0x5db130){_0x50f5f1=_0x5db130[_0xd9b0('0x29')]({'plain':!![]});_0x5ef333[_0xd9b0('0x33')]=_[_0xd9b0('0x47')](db[_0xd9b0('0x56')][_0xd9b0('0x2f')]);_0x5ef333[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x458fd2[_0xd9b0('0x35')]);_0x5ef333['filters']=_[_0xd9b0('0x48')](_0x5ef333[_0xd9b0('0x33')],_0x5ef333[_0xd9b0('0x35')]);_0x51a689[_0xd9b0('0x36')]=_[_0xd9b0('0x48')](_0x5ef333[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x458fd2['query']['fields']));_0x51a689[_0xd9b0('0x36')]=_0x51a689[_0xd9b0('0x36')][_0xd9b0('0x37')]?_0x51a689[_0xd9b0('0x36')]:_0x5ef333['model'];if(!_0x458fd2[_0xd9b0('0x35')][_0xd9b0('0x38')](_0xd9b0('0x57'))){_0x51a689[_0xd9b0('0x23')]=qs[_0xd9b0('0x23')](_0x458fd2[_0xd9b0('0x35')]['limit']);_0x51a689[_0xd9b0('0x21')]=qs['offset'](_0x458fd2[_0xd9b0('0x35')][_0xd9b0('0x21')]);}_0x51a689[_0xd9b0('0x39')]=qs[_0xd9b0('0x3a')](_0x458fd2[_0xd9b0('0x35')][_0xd9b0('0x3a')]);_0x51a689['where']=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x458fd2[_0xd9b0('0x35')],_0x5ef333[_0xd9b0('0x32')]));_0x51a689[_0xd9b0('0x3b')][_0xd9b0('0x58')]=_0x5db130['id'];if(_0x458fd2['query']['filter']){_0x51a689[_0xd9b0('0x3b')]=_[_0xd9b0('0x3d')](_0x51a689[_0xd9b0('0x3b')],{'$or':_[_0xd9b0('0x2e')](_0x51a689[_0xd9b0('0x36')],function(_0x5116f1){var _0x182a53={};_0x182a53[_0x5116f1]={'$like':'%'+_0x458fd2[_0xd9b0('0x35')]['filter']+'%'};return _0x182a53;})});}_0x51a689=_[_0xd9b0('0x3d')]({},_0x51a689,_0x458fd2[_0xd9b0('0x4a')]);return db[_0xd9b0('0x56')][_0xd9b0('0x43')](_0x51a689);}})[_0xd9b0('0x27')](function(_0x4c9fbd){if(_0x4c9fbd){return db[_0xd9b0('0x59')][_0xd9b0('0x5a')]({'where':{'id':_[_0xd9b0('0x2e')](_0x4c9fbd,_0xd9b0('0x5b')),'role':_0xd9b0('0x5c')},'attributes':['id',_0xd9b0('0x2d'),_0xd9b0('0x5d'),_0xd9b0('0x5e'),_0xd9b0('0x5f')]});}})[_0xd9b0('0x27')](function(_0x230bb7){if(_0x230bb7){return{'count':_0x230bb7[_0xd9b0('0x24')],'rows':_['map'](_0x230bb7[_0xd9b0('0x44')],function(_0x1b5429){return{'membername':_0x1b5429[_0xd9b0('0x2d')],'UserId':_0x1b5429['id'],'queue_name':_0x50f5f1[_0xd9b0('0x2d')],'WhatsappQueueId':_0x50f5f1['id'],'interface':util[_0xd9b0('0x60')](_0xd9b0('0x61'),_0xd9b0('0x62'),_0x1b5429[_0xd9b0('0x2d')]),'penalty':0x0,'paused':_0x1b5429['whatsappPause'],'createdAt':_0x1b5429[_0xd9b0('0x5f')],'updatedAt':_0x1b5429[_0xd9b0('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9b0('0x27')](respondWithFilteredResult(_0x5b169c,_0x51a689))[_0xd9b0('0x45')](handleError(_0x5b169c,null));};exports['getTeams']=function(_0x5d71e8,_0x11d8c9,_0x1f9ae1){var _0x4d80e0={};var _0xcd810a={};var _0x41bfa9;var _0x3e9366;return db['WhatsappQueue'][_0xd9b0('0x63')]({'where':{'id':_0x5d71e8['params']['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x11d8c9,null))[_0xd9b0('0x27')](function(_0x38cc0a){if(_0x38cc0a){_0x41bfa9=_0x38cc0a;_0xcd810a[_0xd9b0('0x33')]=_['keys'](db[_0xd9b0('0x64')][_0xd9b0('0x2f')]);_0xcd810a[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x5d71e8[_0xd9b0('0x35')]);_0xcd810a['filters']=_[_0xd9b0('0x48')](_0xcd810a[_0xd9b0('0x33')],_0xcd810a[_0xd9b0('0x35')]);_0x4d80e0[_0xd9b0('0x36')]=_[_0xd9b0('0x48')](_0xcd810a[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x5d71e8[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x4d80e0[_0xd9b0('0x36')]=_0x4d80e0['attributes'][_0xd9b0('0x37')]?_0x4d80e0[_0xd9b0('0x36')]:_0xcd810a[_0xd9b0('0x33')];_0x4d80e0[_0xd9b0('0x39')]=qs['sort'](_0x5d71e8[_0xd9b0('0x35')]['sort']);_0x4d80e0[_0xd9b0('0x3b')]=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x5d71e8['query'],_0xcd810a[_0xd9b0('0x32')]));if(_0x5d71e8['query'][_0xd9b0('0x40')]){_0x4d80e0[_0xd9b0('0x3b')]=_[_0xd9b0('0x3d')](_0x4d80e0[_0xd9b0('0x3b')],{'$or':_[_0xd9b0('0x2e')](_0x4d80e0[_0xd9b0('0x36')],function(_0x33b370){var _0x3c3314={};_0x3c3314[_0x33b370]={'$like':'%'+_0x5d71e8['query'][_0xd9b0('0x40')]+'%'};return _0x3c3314;})});}_0x4d80e0=_[_0xd9b0('0x3d')]({},_0x4d80e0,_0x5d71e8[_0xd9b0('0x4a')]);return _0x41bfa9[_0xd9b0('0x65')](_0x4d80e0);}})['then'](function(_0x3340a4){if(_0x3340a4){_0x3e9366=_0x3340a4[_0xd9b0('0x37')];if(!_0x5d71e8[_0xd9b0('0x35')]['hasOwnProperty'](_0xd9b0('0x57'))){_0x4d80e0['limit']=qs[_0xd9b0('0x23')](_0x5d71e8[_0xd9b0('0x35')]['limit']);_0x4d80e0['offset']=qs[_0xd9b0('0x21')](_0x5d71e8[_0xd9b0('0x35')][_0xd9b0('0x21')]);}return _0x41bfa9['getTeams'](_0x4d80e0);}})[_0xd9b0('0x27')](function(_0x8669a5){if(_0x8669a5){return _0x8669a5?{'count':_0x3e9366,'rows':_0x8669a5}:null;}})[_0xd9b0('0x27')](respondWithResult(_0x11d8c9,null))[_0xd9b0('0x45')](handleError(_0x11d8c9,null));};exports[_0xd9b0('0x66')]=function(_0x44fb86,_0x22c93a,_0x1f38bb){var _0x1fccef=_0x44fb86['body'][_0xd9b0('0x67')];return db['Team']['findAll']({'where':{'id':_0x1fccef},'attributes':['id'],'include':[{'model':db[_0xd9b0('0x59')],'as':_0xd9b0('0x68'),'attributes':['id',_0xd9b0('0x2d'),_0xd9b0('0x69'),_0xd9b0('0x6a'),_0xd9b0('0x6b')],'raw':!![]}]})[_0xd9b0('0x27')](function(_0x4bb2fb){if(_0x4bb2fb){var _0x576cf4=_[_0xd9b0('0x6c')](_0x4bb2fb,function(_0x5c2e7a){var _0x1343c1=_0x5c2e7a[_0xd9b0('0x29')]({'plain':!![]});return _0x1343c1['Agents'];});return db[_0xd9b0('0x41')]['find']({'where':{'id':_0x44fb86[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](function(_0x2d8c43){return db[_0xd9b0('0x6d')][_0xd9b0('0x6e')](function(_0xc90ad9){return _0x2d8c43['addTeams'](_0x1fccef,{'transaction':_0xc90ad9})[_0xd9b0('0x27')](function(){return BPromise[_0xd9b0('0x6f')](_0x576cf4,function(_0xd185b7){return db[_0xd9b0('0x56')][_0xd9b0('0x70')]({'where':{'UserId':_0xd185b7['id'],'WhatsappQueueId':_0x44fb86[_0xd9b0('0x46')]['id']},'transaction':_0xc90ad9});});})[_0xd9b0('0x27')](function(){_0x576cf4[_0xd9b0('0x71')](function(_0x4edbc0){socket['emit'](_0xd9b0('0x72'),{'UserId':_0x4edbc0['id'],'WhatsappQueueId':_0x2d8c43['id']});});});});});}})[_0xd9b0('0x27')](respondWithStatusCode(_0x22c93a,null))[_0xd9b0('0x45')](handleError(_0x22c93a,null));};exports['removeTeams']=function(_0x413a46,_0x36611b,_0x1045e4){return db[_0xd9b0('0x64')][_0xd9b0('0x43')]({'where':{'id':_0x413a46[_0xd9b0('0x35')][_0xd9b0('0x67')]},'attributes':['id'],'include':[{'model':db[_0xd9b0('0x59')],'as':_0xd9b0('0x68'),'attributes':['id'],'raw':!![]}]})[_0xd9b0('0x27')](handleEntityNotFound(_0x36611b,null))[_0xd9b0('0x27')](function(_0x357634){var _0x10075a=_[_0xd9b0('0x2e')](_0x357634,'id');var _0x421fd7=[];var _0x2266d3=[];var _0x1140ac=squel[_0xd9b0('0x73')]();_0x1140ac['field']('tq.TeamId')[_0xd9b0('0x74')]('team_has_whatsapp_queues','tq')[_0xd9b0('0x75')](_0xd9b0('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd9b0('0x3b')](_0xd9b0('0x77'),_0x413a46[_0xd9b0('0x46')]['id']);for(var _0x531c3d=0x0;_0x531c3d<_0x357634[_0xd9b0('0x37')];_0x531c3d+=0x1){let _0x4fc15a=_0x357634[_0x531c3d];for(var _0x4bbb3e=0x0;_0x4bbb3e<_0x4fc15a[_0xd9b0('0x68')][_0xd9b0('0x37')];_0x4bbb3e+=0x1){let _0xaff62d=_0x4fc15a[_0xd9b0('0x68')][_0x4bbb3e];var _0x2a442c=_0x1140ac[_0xd9b0('0x78')]();_0x2a442c[_0xd9b0('0x3b')](_0xd9b0('0x79'),_0xaff62d['id']);_0x2266d3[_0xd9b0('0x7a')](db[_0xd9b0('0x6d')][_0xd9b0('0x35')](_0x2a442c[_0xd9b0('0x7b')](),{'type':db[_0xd9b0('0x6d')][_0xd9b0('0x7c')]['SELECT']})[_0xd9b0('0x27')](function(_0x1dd55b){if(_0x1dd55b[_0xd9b0('0x37')]===0x1){return _0xaff62d['id'];}else{var _0x3044a1=_[_0xd9b0('0x7d')](_[_0xd9b0('0x2e')](_0x1dd55b,'TeamId'),function(_0x38ab78){return _['includes'](_0x10075a,_0x38ab78);});if(_0x3044a1){return _0xaff62d['id'];}}}));}}return BPromise[_0xd9b0('0x7e')](_0x2266d3)[_0xd9b0('0x27')](function(_0xebe953){_0x421fd7=_(_0x421fd7)[_0xd9b0('0x7f')](_0xebe953)['compact']()['value']();return db[_0xd9b0('0x41')][_0xd9b0('0x4b')]({'where':{'id':_0x413a46[_0xd9b0('0x46')]['id']}})[_0xd9b0('0x27')](function(_0x316121){return db[_0xd9b0('0x6d')][_0xd9b0('0x6e')](function(_0x464e50){return _0x316121[_0xd9b0('0x80')](_0x413a46['query']['ids'],{'transaction':_0x464e50})[_0xd9b0('0x27')](function(){if(!_[_0xd9b0('0x81')](_0x421fd7)){return _0x316121[_0xd9b0('0x82')](_0x421fd7,{'transaction':_0x464e50});}})[_0xd9b0('0x27')](function(){_0x421fd7['forEach'](function(_0x2e6b58){socket[_0xd9b0('0x83')](_0xd9b0('0x84'),{'UserId':_0x2e6b58,'WhatsappQueueId':_0x316121['id']});});});});});});})[_0xd9b0('0x27')](respondWithStatusCode(_0x36611b,null))[_0xd9b0('0x45')](handleError(_0x36611b,null));};exports['addAgents']=function(_0x12ddce,_0x2737de,_0x35b71f){return db['WhatsappQueue']['find']({'where':{'id':_0x12ddce['params']['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x2737de,null))[_0xd9b0('0x27')](function(_0x3dff3c){if(_0x3dff3c){return _0x3dff3c[_0xd9b0('0x85')](_0x12ddce[_0xd9b0('0x4d')]['ids'],_[_0xd9b0('0x86')](_0x12ddce['body'],[_0xd9b0('0x67'),'id'])||{})['spread'](function(_0x432917){for(var _0x534275=0x0;_0x534275<_0x12ddce[_0xd9b0('0x4d')][_0xd9b0('0x67')][_0xd9b0('0x37')];_0x534275+=0x1){socket[_0xd9b0('0x83')](_0xd9b0('0x72'),{'UserId':Number(_0x12ddce['body']['ids'][_0x534275]),'WhatsappQueueId':Number(_0x12ddce['params']['id'])});}return _0x432917;});}})[_0xd9b0('0x27')](respondWithResult(_0x2737de,null))[_0xd9b0('0x45')](handleError(_0x2737de,null));};exports['removeAgents']=function(_0x53df13,_0x3b44c4,_0x59bb3b){return db[_0xd9b0('0x41')]['find']({'where':{'id':_0x53df13['params']['id']}})['then'](handleEntityNotFound(_0x3b44c4,null))[_0xd9b0('0x27')](function(_0x15e630){if(_0x15e630){return _0x15e630[_0xd9b0('0x82')](_0x53df13[_0xd9b0('0x35')][_0xd9b0('0x67')])[_0xd9b0('0x27')](function(){if(_[_0xd9b0('0x87')](_0x53df13['query']['ids'])){for(var _0x2353b3=0x0;_0x2353b3<_0x53df13[_0xd9b0('0x35')][_0xd9b0('0x67')][_0xd9b0('0x37')];_0x2353b3+=0x1){socket[_0xd9b0('0x83')](_0xd9b0('0x84'),{'UserId':Number(_0x53df13[_0xd9b0('0x35')]['ids'][_0x2353b3]),'WhatsappQueueId':Number(_0x53df13[_0xd9b0('0x46')]['id'])});}}else{socket[_0xd9b0('0x83')](_0xd9b0('0x84'),{'UserId':Number(_0x53df13[_0xd9b0('0x35')]['ids']),'WhatsappQueueId':Number(_0x53df13[_0xd9b0('0x46')]['id'])});}});}})[_0xd9b0('0x27')](respondWithStatusCode(_0x3b44c4,null))[_0xd9b0('0x45')](handleError(_0x3b44c4,null));};exports[_0xd9b0('0x88')]=function(_0x1432db,_0x1949b1,_0x2b05d2){var _0x130cb6={};var _0x1398a6={};var _0x5aed69;var _0x31ba4c;return db[_0xd9b0('0x41')][_0xd9b0('0x63')]({'where':{'id':_0x1432db['params']['id']}})[_0xd9b0('0x27')](handleEntityNotFound(_0x1949b1,null))['then'](function(_0xd94abd){if(_0xd94abd){_0x5aed69=_0xd94abd;_0x1398a6[_0xd9b0('0x33')]=_[_0xd9b0('0x47')](db[_0xd9b0('0x59')][_0xd9b0('0x2f')]);_0x1398a6[_0xd9b0('0x35')]=_[_0xd9b0('0x47')](_0x1432db[_0xd9b0('0x35')]);_0x1398a6[_0xd9b0('0x32')]=_['intersection'](_0x1398a6[_0xd9b0('0x33')],_0x1398a6['query']);_0x130cb6['attributes']=_['intersection'](_0x1398a6[_0xd9b0('0x33')],qs[_0xd9b0('0x34')](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x34')]));_0x130cb6[_0xd9b0('0x36')]=_0x130cb6['attributes']['length']?_0x130cb6[_0xd9b0('0x36')]:_0x1398a6[_0xd9b0('0x33')];_0x130cb6[_0xd9b0('0x39')]=qs['sort'](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x3a')]);_0x130cb6[_0xd9b0('0x3b')]=qs[_0xd9b0('0x32')](_[_0xd9b0('0x3c')](_0x1432db[_0xd9b0('0x35')],_0x1398a6[_0xd9b0('0x32')]));if(_0x1432db[_0xd9b0('0x35')]['filter']){_0x130cb6[_0xd9b0('0x3b')]=_[_0xd9b0('0x3d')](_0x130cb6[_0xd9b0('0x3b')],{'$or':_[_0xd9b0('0x2e')](_0x130cb6[_0xd9b0('0x36')],function(_0x1dc194){var _0x39f3ec={};_0x39f3ec[_0x1dc194]={'$like':'%'+_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x40')]+'%'};return _0x39f3ec;})});}_0x130cb6=_[_0xd9b0('0x3d')]({},_0x130cb6,_0x1432db[_0xd9b0('0x4a')]);return _0x5aed69['getAgents'](_0x130cb6);}})[_0xd9b0('0x27')](function(_0x35fce5){if(_0x35fce5){_0x31ba4c=_0x35fce5['length'];if(!_0x1432db['query'][_0xd9b0('0x38')](_0xd9b0('0x57'))){_0x130cb6['limit']=qs[_0xd9b0('0x23')](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x23')]);_0x130cb6[_0xd9b0('0x21')]=qs[_0xd9b0('0x21')](_0x1432db[_0xd9b0('0x35')][_0xd9b0('0x21')]);}return _0x5aed69[_0xd9b0('0x88')](_0x130cb6);}})[_0xd9b0('0x27')](function(_0x3e41bd){if(_0x3e41bd){return _0x3e41bd?{'count':_0x31ba4c,'rows':_0x3e41bd}:null;}})['then'](respondWithResult(_0x1949b1,null))[_0xd9b0('0x45')](handleError(_0x1949b1,null));}; \ No newline at end of file +var _0xd8ef=['rows','show','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','params','destroy','describe','getMembers','findOne','UserWhatsappQueue','order','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./whatsappQueue.socket','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','get','WhatsappQueues','end','sendStatus','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd8ef,0x15b));var _0xfd8e=function(_0x3124f4,_0x114714){_0x3124f4=_0x3124f4-0x0;var _0x3aa839=_0xd8ef[_0x3124f4];return _0x3aa839;};'use strict';var emlformat=require(_0xfd8e('0x0'));var rimraf=require(_0xfd8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd8e('0x2'));var rp=require(_0xfd8e('0x3'));var moment=require(_0xfd8e('0x4'));var BPromise=require(_0xfd8e('0x5'));var Mustache=require(_0xfd8e('0x6'));var util=require('util');var path=require(_0xfd8e('0x7'));var sox=require(_0xfd8e('0x8'));var csv=require('to-csv');var ejs=require(_0xfd8e('0x9'));var fs=require('fs');var fs_extra=require(_0xfd8e('0xa'));var _=require(_0xfd8e('0xb'));var squel=require(_0xfd8e('0xc'));var crypto=require('crypto');var jsforce=require(_0xfd8e('0xd'));var deskjs=require(_0xfd8e('0xe'));var toCsv=require(_0xfd8e('0xf'));var querystring=require('querystring');var Papa=require(_0xfd8e('0x10'));var Redis=require(_0xfd8e('0x11'));var authService=require(_0xfd8e('0x12'));var qs=require(_0xfd8e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd8e('0x14'));var logger=require('../../config/logger')(_0xfd8e('0x15'));var utils=require(_0xfd8e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfd8e('0x17'));var db=require(_0xfd8e('0x18'))['db'];config['redis']=_[_0xfd8e('0x19')](config[_0xfd8e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd8e('0x1a')]));require(_0xfd8e('0x1b'))['register'](socket);function respondWithStatusCode(_0x374654,_0x4b4ff3){_0x4b4ff3=_0x4b4ff3||0xcc;return function(_0x89b1f0){if(_0x89b1f0){return _0x374654['sendStatus'](_0x4b4ff3);}return _0x374654[_0xfd8e('0x1c')](_0x4b4ff3)['end']();};}function respondWithResult(_0x1f15df,_0x26b374){_0x26b374=_0x26b374||0xc8;return function(_0x300c10){if(_0x300c10){return _0x1f15df['status'](_0x26b374)['json'](_0x300c10);}};}function respondWithFilteredResult(_0x4012cd,_0xb45cb6){return function(_0x23560f){if(_0x23560f){var _0x1f2121=typeof _0xb45cb6[_0xfd8e('0x1d')]===_0xfd8e('0x1e')&&typeof _0xb45cb6[_0xfd8e('0x1f')]===_0xfd8e('0x1e');var _0x315504=_0x23560f[_0xfd8e('0x20')];var _0x2bffd9=_0x1f2121?0x0:_0xb45cb6[_0xfd8e('0x1d')];var _0x370c60=_0x1f2121?_0x23560f[_0xfd8e('0x20')]:_0xb45cb6['offset']+_0xb45cb6[_0xfd8e('0x1f')];var _0x41f5b6;if(_0x370c60>=_0x315504){_0x370c60=_0x315504;_0x41f5b6=0xc8;}else{_0x41f5b6=0xce;}_0x4012cd[_0xfd8e('0x1c')](_0x41f5b6);return _0x4012cd[_0xfd8e('0x21')](_0xfd8e('0x22'),_0x2bffd9+'-'+_0x370c60+'/'+_0x315504)[_0xfd8e('0x23')](_0x23560f);}return null;};}function patchUpdates(_0x58ee75){return function(_0x1c1463){try{jsonpatch['apply'](_0x1c1463,_0x58ee75,!![]);}catch(_0x55e7b3){return BPromise[_0xfd8e('0x24')](_0x55e7b3);}return _0x1c1463[_0xfd8e('0x25')]();};}function saveUpdates(_0x2b6b31,_0x182e05){return function(_0x48e846){if(_0x48e846){return _0x48e846[_0xfd8e('0x26')](_0x2b6b31)[_0xfd8e('0x27')](function(_0x14d36b){return _0x14d36b;});}return null;};}function removeEntity(_0x554526,_0xee69f3){return function(_0x41b931){if(_0x41b931){return _0x41b931['destroy']()['then'](function(){var _0x782d65=_0x41b931[_0xfd8e('0x28')]({'plain':!![]});var _0x14978e=_0xfd8e('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x14978e,'resourceId':_0x782d65['id']}})[_0xfd8e('0x27')](function(){return _0x41b931;});})[_0xfd8e('0x27')](function(){_0x554526['status'](0xcc)[_0xfd8e('0x2a')]();});}};}function handleEntityNotFound(_0x556fca,_0x466b1b){return function(_0x377689){if(!_0x377689){_0x556fca[_0xfd8e('0x2b')](0x194);}return _0x377689;};}function handleError(_0x22864f,_0xdac2ab){_0xdac2ab=_0xdac2ab||0x1f4;return function(_0x2bc187){logger['error'](_0x2bc187[_0xfd8e('0x2c')]);if(_0x2bc187[_0xfd8e('0x2d')]){delete _0x2bc187[_0xfd8e('0x2d')];}_0x22864f[_0xfd8e('0x1c')](_0xdac2ab)[_0xfd8e('0x2e')](_0x2bc187);};}exports[_0xfd8e('0x2f')]=function(_0x2c1539,_0x2f1e99){var _0x104a69={},_0x3beaae={},_0x4ea762={'count':0x0,'rows':[]};var _0x4b9cbc=_['map'](db[_0xfd8e('0x30')][_0xfd8e('0x31')],function(_0x1d563b){return{'name':_0x1d563b[_0xfd8e('0x32')],'type':_0x1d563b[_0xfd8e('0x33')]['key']};});_0x3beaae[_0xfd8e('0x34')]=_[_0xfd8e('0x35')](_0x4b9cbc,_0xfd8e('0x2d'));_0x3beaae['query']=_[_0xfd8e('0x36')](_0x2c1539['query']);_0x3beaae[_0xfd8e('0x37')]=_['intersection'](_0x3beaae['model'],_0x3beaae[_0xfd8e('0x38')]);_0x104a69[_0xfd8e('0x39')]=_[_0xfd8e('0x3a')](_0x3beaae[_0xfd8e('0x34')],qs[_0xfd8e('0x3b')](_0x2c1539[_0xfd8e('0x38')][_0xfd8e('0x3b')]));_0x104a69[_0xfd8e('0x39')]=_0x104a69[_0xfd8e('0x39')][_0xfd8e('0x3c')]?_0x104a69[_0xfd8e('0x39')]:_0x3beaae[_0xfd8e('0x34')];if(!_0x2c1539[_0xfd8e('0x38')][_0xfd8e('0x3d')](_0xfd8e('0x3e'))){_0x104a69[_0xfd8e('0x1f')]=qs[_0xfd8e('0x1f')](_0x2c1539[_0xfd8e('0x38')]['limit']);_0x104a69[_0xfd8e('0x1d')]=qs[_0xfd8e('0x1d')](_0x2c1539[_0xfd8e('0x38')]['offset']);}_0x104a69['order']=qs[_0xfd8e('0x3f')](_0x2c1539[_0xfd8e('0x38')]['sort']);_0x104a69[_0xfd8e('0x40')]=qs[_0xfd8e('0x37')](_[_0xfd8e('0x41')](_0x2c1539[_0xfd8e('0x38')],_0x3beaae[_0xfd8e('0x37')]),_0x4b9cbc);if(_0x2c1539[_0xfd8e('0x38')][_0xfd8e('0x42')]){_0x104a69['where']=_['merge'](_0x104a69[_0xfd8e('0x40')],{'$or':_[_0xfd8e('0x35')](_0x4b9cbc,function(_0x502129){if(_0x502129[_0xfd8e('0x33')]!==_0xfd8e('0x43')){var _0x37455f={};_0x37455f[_0x502129[_0xfd8e('0x2d')]]={'$like':'%'+_0x2c1539['query'][_0xfd8e('0x42')]+'%'};return _0x37455f;}})});}_0x104a69=_[_0xfd8e('0x44')]({},_0x104a69,_0x2c1539[_0xfd8e('0x45')]);var _0x418875={'where':_0x104a69[_0xfd8e('0x40')]};return db[_0xfd8e('0x30')][_0xfd8e('0x20')](_0x418875)[_0xfd8e('0x27')](function(_0x25ba04){_0x4ea762[_0xfd8e('0x20')]=_0x25ba04;if(_0x2c1539[_0xfd8e('0x38')][_0xfd8e('0x46')]){_0x104a69[_0xfd8e('0x47')]=[{'all':!![]}];}return db[_0xfd8e('0x30')][_0xfd8e('0x48')](_0x104a69);})[_0xfd8e('0x27')](function(_0x4f4228){_0x4ea762[_0xfd8e('0x49')]=_0x4f4228;return _0x4ea762;})['then'](respondWithFilteredResult(_0x2f1e99,_0x104a69))['catch'](handleError(_0x2f1e99,null));};exports[_0xfd8e('0x4a')]=function(_0x5c199b,_0xeb7374){var _0x41769a={'raw':!![],'where':{'id':_0x5c199b['params']['id']}},_0x3e8c0a={};_0x3e8c0a[_0xfd8e('0x34')]=_[_0xfd8e('0x36')](db[_0xfd8e('0x30')][_0xfd8e('0x31')]);_0x3e8c0a[_0xfd8e('0x38')]=_[_0xfd8e('0x36')](_0x5c199b[_0xfd8e('0x38')]);_0x3e8c0a[_0xfd8e('0x37')]=_[_0xfd8e('0x3a')](_0x3e8c0a['model'],_0x3e8c0a[_0xfd8e('0x38')]);_0x41769a[_0xfd8e('0x39')]=_['intersection'](_0x3e8c0a['model'],qs['fields'](_0x5c199b[_0xfd8e('0x38')]['fields']));_0x41769a[_0xfd8e('0x39')]=_0x41769a[_0xfd8e('0x39')][_0xfd8e('0x3c')]?_0x41769a['attributes']:_0x3e8c0a['model'];if(_0x5c199b[_0xfd8e('0x38')][_0xfd8e('0x46')]){_0x41769a[_0xfd8e('0x47')]=[{'all':!![]}];}_0x41769a=_[_0xfd8e('0x44')]({},_0x41769a,_0x5c199b['options']);return db[_0xfd8e('0x30')][_0xfd8e('0x4b')](_0x41769a)[_0xfd8e('0x27')](handleEntityNotFound(_0xeb7374,null))[_0xfd8e('0x27')](respondWithResult(_0xeb7374,null))[_0xfd8e('0x4c')](handleError(_0xeb7374,null));};exports['create']=function(_0x31c9d7,_0x10d48b){return db[_0xfd8e('0x30')]['create'](_0x31c9d7[_0xfd8e('0x4d')],{})[_0xfd8e('0x27')](function(_0x4eff45){var _0xcfd0ec=_0x31c9d7[_0xfd8e('0x4e')]['get']({'plain':!![]});if(!_0xcfd0ec)throw new Error(_0xfd8e('0x4f'));if(_0xcfd0ec[_0xfd8e('0x50')]==='user'){var _0x568f93=_0x4eff45[_0xfd8e('0x28')]({'plain':!![]});var _0x4e096c=_0xfd8e('0x29');return db[_0xfd8e('0x51')][_0xfd8e('0x4b')]({'where':{'name':_0x4e096c,'userProfileId':_0xcfd0ec[_0xfd8e('0x52')]},'raw':!![]})['then'](function(_0x1e2807){if(_0x1e2807&&_0x1e2807['autoAssociation']===0x0){return db[_0xfd8e('0x53')]['create']({'name':_0x568f93[_0xfd8e('0x2d')],'resourceId':_0x568f93['id'],'type':_0x1e2807[_0xfd8e('0x2d')],'sectionId':_0x1e2807['id']},{})[_0xfd8e('0x27')](function(){return _0x4eff45;});}else{return _0x4eff45;}})[_0xfd8e('0x4c')](function(_0x1a3c7e){logger[_0xfd8e('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a3c7e);throw _0x1a3c7e;});}return _0x4eff45;})[_0xfd8e('0x27')](respondWithResult(_0x10d48b,0xc9))[_0xfd8e('0x4c')](handleError(_0x10d48b,null));};exports['update']=function(_0x727d0f,_0x44c395){if(_0x727d0f[_0xfd8e('0x4d')]['id']){delete _0x727d0f[_0xfd8e('0x4d')]['id'];}return db[_0xfd8e('0x30')][_0xfd8e('0x4b')]({'where':{'id':_0x727d0f[_0xfd8e('0x55')]['id']}})[_0xfd8e('0x27')](handleEntityNotFound(_0x44c395,null))[_0xfd8e('0x27')](saveUpdates(_0x727d0f[_0xfd8e('0x4d')],null))['then'](respondWithResult(_0x44c395,null))[_0xfd8e('0x4c')](handleError(_0x44c395,null));};exports[_0xfd8e('0x56')]=function(_0x30c4bf,_0x541077){return db['WhatsappQueue'][_0xfd8e('0x4b')]({'where':{'id':_0x30c4bf[_0xfd8e('0x55')]['id']}})['then'](handleEntityNotFound(_0x541077,null))['then'](removeEntity(_0x541077,null))[_0xfd8e('0x4c')](handleError(_0x541077,null));};exports[_0xfd8e('0x57')]=function(_0x56a9d2,_0x211f6f){return db[_0xfd8e('0x30')]['describe']()[_0xfd8e('0x27')](respondWithResult(_0x211f6f,null))[_0xfd8e('0x4c')](handleError(_0x211f6f,null));};exports[_0xfd8e('0x58')]=function(_0x3ac299,_0x30f939,_0x25d02f){var _0x28ebf7={'raw':!![],'where':{}},_0x49bc1c={},_0x209237;return db[_0xfd8e('0x30')][_0xfd8e('0x59')]({'where':{'id':_0x3ac299[_0xfd8e('0x55')]['id']}})[_0xfd8e('0x27')](handleEntityNotFound(_0x30f939,null))['then'](function(_0x3bd463){if(_0x3bd463){_0x209237=_0x3bd463['get']({'plain':!![]});_0x49bc1c[_0xfd8e('0x34')]=_['keys'](db[_0xfd8e('0x5a')][_0xfd8e('0x31')]);_0x49bc1c[_0xfd8e('0x38')]=_[_0xfd8e('0x36')](_0x3ac299[_0xfd8e('0x38')]);_0x49bc1c['filters']=_[_0xfd8e('0x3a')](_0x49bc1c[_0xfd8e('0x34')],_0x49bc1c[_0xfd8e('0x38')]);_0x28ebf7[_0xfd8e('0x39')]=_['intersection'](_0x49bc1c[_0xfd8e('0x34')],qs['fields'](_0x3ac299[_0xfd8e('0x38')][_0xfd8e('0x3b')]));_0x28ebf7[_0xfd8e('0x39')]=_0x28ebf7[_0xfd8e('0x39')][_0xfd8e('0x3c')]?_0x28ebf7[_0xfd8e('0x39')]:_0x49bc1c['model'];if(!_0x3ac299[_0xfd8e('0x38')][_0xfd8e('0x3d')](_0xfd8e('0x3e'))){_0x28ebf7[_0xfd8e('0x1f')]=qs['limit'](_0x3ac299[_0xfd8e('0x38')][_0xfd8e('0x1f')]);_0x28ebf7[_0xfd8e('0x1d')]=qs[_0xfd8e('0x1d')](_0x3ac299[_0xfd8e('0x38')][_0xfd8e('0x1d')]);}_0x28ebf7[_0xfd8e('0x5b')]=qs['sort'](_0x3ac299[_0xfd8e('0x38')][_0xfd8e('0x3f')]);_0x28ebf7[_0xfd8e('0x40')]=qs[_0xfd8e('0x37')](_[_0xfd8e('0x41')](_0x3ac299[_0xfd8e('0x38')],_0x49bc1c['filters']));_0x28ebf7[_0xfd8e('0x40')]['WhatsappQueueId']=_0x3bd463['id'];if(_0x3ac299[_0xfd8e('0x38')][_0xfd8e('0x42')]){_0x28ebf7['where']=_[_0xfd8e('0x44')](_0x28ebf7[_0xfd8e('0x40')],{'$or':_[_0xfd8e('0x35')](_0x28ebf7[_0xfd8e('0x39')],function(_0x3a4269){var _0x2093c6={};_0x2093c6[_0x3a4269]={'$like':'%'+_0x3ac299[_0xfd8e('0x38')][_0xfd8e('0x42')]+'%'};return _0x2093c6;})});}_0x28ebf7=_[_0xfd8e('0x44')]({},_0x28ebf7,_0x3ac299['options']);return db[_0xfd8e('0x5a')][_0xfd8e('0x48')](_0x28ebf7);}})[_0xfd8e('0x27')](function(_0x5ea8b6){if(_0x5ea8b6){return db[_0xfd8e('0x5c')][_0xfd8e('0x5d')]({'where':{'id':_[_0xfd8e('0x35')](_0x5ea8b6,_0xfd8e('0x5e')),'role':_0xfd8e('0x5f')},'attributes':['id',_0xfd8e('0x2d'),_0xfd8e('0x60'),_0xfd8e('0x61'),'createdAt']});}})[_0xfd8e('0x27')](function(_0x5fe7b8){if(_0x5fe7b8){return{'count':_0x5fe7b8[_0xfd8e('0x20')],'rows':_['map'](_0x5fe7b8[_0xfd8e('0x49')],function(_0x3ece10){return{'membername':_0x3ece10[_0xfd8e('0x2d')],'UserId':_0x3ece10['id'],'queue_name':_0x209237[_0xfd8e('0x2d')],'WhatsappQueueId':_0x209237['id'],'interface':util['format'](_0xfd8e('0x62'),_0xfd8e('0x63'),_0x3ece10[_0xfd8e('0x2d')]),'penalty':0x0,'paused':_0x3ece10[_0xfd8e('0x60')],'createdAt':_0x3ece10[_0xfd8e('0x64')],'updatedAt':_0x3ece10[_0xfd8e('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfd8e('0x27')](respondWithFilteredResult(_0x30f939,_0x28ebf7))['catch'](handleError(_0x30f939,null));};exports[_0xfd8e('0x65')]=function(_0x555e8f,_0x331207,_0x114a70){var _0x11d266={};var _0x40c041={};var _0x556e55;var _0x1d09df;return db[_0xfd8e('0x30')]['findOne']({'where':{'id':_0x555e8f[_0xfd8e('0x55')]['id']}})[_0xfd8e('0x27')](handleEntityNotFound(_0x331207,null))['then'](function(_0xeb1d8){if(_0xeb1d8){_0x556e55=_0xeb1d8;_0x40c041[_0xfd8e('0x34')]=_[_0xfd8e('0x36')](db[_0xfd8e('0x66')]['rawAttributes']);_0x40c041['query']=_[_0xfd8e('0x36')](_0x555e8f['query']);_0x40c041[_0xfd8e('0x37')]=_[_0xfd8e('0x3a')](_0x40c041['model'],_0x40c041[_0xfd8e('0x38')]);_0x11d266[_0xfd8e('0x39')]=_[_0xfd8e('0x3a')](_0x40c041[_0xfd8e('0x34')],qs[_0xfd8e('0x3b')](_0x555e8f[_0xfd8e('0x38')][_0xfd8e('0x3b')]));_0x11d266[_0xfd8e('0x39')]=_0x11d266[_0xfd8e('0x39')][_0xfd8e('0x3c')]?_0x11d266[_0xfd8e('0x39')]:_0x40c041['model'];_0x11d266['order']=qs[_0xfd8e('0x3f')](_0x555e8f[_0xfd8e('0x38')][_0xfd8e('0x3f')]);_0x11d266[_0xfd8e('0x40')]=qs['filters'](_['pick'](_0x555e8f[_0xfd8e('0x38')],_0x40c041[_0xfd8e('0x37')]));if(_0x555e8f[_0xfd8e('0x38')]['filter']){_0x11d266['where']=_['merge'](_0x11d266[_0xfd8e('0x40')],{'$or':_[_0xfd8e('0x35')](_0x11d266[_0xfd8e('0x39')],function(_0x462b7c){var _0x23846d={};_0x23846d[_0x462b7c]={'$like':'%'+_0x555e8f[_0xfd8e('0x38')][_0xfd8e('0x42')]+'%'};return _0x23846d;})});}_0x11d266=_[_0xfd8e('0x44')]({},_0x11d266,_0x555e8f[_0xfd8e('0x45')]);return _0x556e55[_0xfd8e('0x65')](_0x11d266);}})[_0xfd8e('0x27')](function(_0x282986){if(_0x282986){_0x1d09df=_0x282986[_0xfd8e('0x3c')];if(!_0x555e8f[_0xfd8e('0x38')][_0xfd8e('0x3d')]('nolimit')){_0x11d266['limit']=qs[_0xfd8e('0x1f')](_0x555e8f[_0xfd8e('0x38')][_0xfd8e('0x1f')]);_0x11d266[_0xfd8e('0x1d')]=qs[_0xfd8e('0x1d')](_0x555e8f[_0xfd8e('0x38')]['offset']);}return _0x556e55[_0xfd8e('0x65')](_0x11d266);}})['then'](function(_0xfc43d1){if(_0xfc43d1){return _0xfc43d1?{'count':_0x1d09df,'rows':_0xfc43d1}:null;}})[_0xfd8e('0x27')](respondWithResult(_0x331207,null))[_0xfd8e('0x4c')](handleError(_0x331207,null));};exports['addTeams']=function(_0x2ae2de,_0x54af0e,_0x55fc17){var _0x1aaa0b=_0x2ae2de['body'][_0xfd8e('0x67')];return db[_0xfd8e('0x66')][_0xfd8e('0x48')]({'where':{'id':_0x1aaa0b},'attributes':['id'],'include':[{'model':db[_0xfd8e('0x5c')],'as':_0xfd8e('0x68'),'attributes':['id',_0xfd8e('0x2d'),_0xfd8e('0x69'),_0xfd8e('0x6a'),_0xfd8e('0x6b')],'raw':!![]}]})[_0xfd8e('0x27')](function(_0x226601){if(_0x226601){var _0x578f71=_[_0xfd8e('0x6c')](_0x226601,function(_0x42b5c5){var _0x590b8a=_0x42b5c5['get']({'plain':!![]});return _0x590b8a[_0xfd8e('0x68')];});return db['WhatsappQueue']['find']({'where':{'id':_0x2ae2de['params']['id']}})['then'](function(_0x49d296){return db[_0xfd8e('0x6d')][_0xfd8e('0x6e')](function(_0x4618ad){return _0x49d296[_0xfd8e('0x6f')](_0x1aaa0b,{'transaction':_0x4618ad})[_0xfd8e('0x27')](function(){return BPromise[_0xfd8e('0x70')](_0x578f71,function(_0xde99ee){return db[_0xfd8e('0x5a')][_0xfd8e('0x71')]({'where':{'UserId':_0xde99ee['id'],'WhatsappQueueId':_0x2ae2de[_0xfd8e('0x55')]['id']},'transaction':_0x4618ad});});})[_0xfd8e('0x27')](function(){_0x578f71[_0xfd8e('0x72')](function(_0x2c9fb0){socket[_0xfd8e('0x73')](_0xfd8e('0x74'),{'UserId':_0x2c9fb0['id'],'WhatsappQueueId':_0x49d296['id']});});});});});}})[_0xfd8e('0x27')](respondWithStatusCode(_0x54af0e,null))[_0xfd8e('0x4c')](handleError(_0x54af0e,null));};exports[_0xfd8e('0x75')]=function(_0x126388,_0x4d599c,_0x42d669){return db[_0xfd8e('0x66')][_0xfd8e('0x48')]({'where':{'id':_0x126388[_0xfd8e('0x38')][_0xfd8e('0x67')]},'attributes':['id'],'include':[{'model':db[_0xfd8e('0x5c')],'as':_0xfd8e('0x68'),'attributes':['id'],'raw':!![]}]})[_0xfd8e('0x27')](handleEntityNotFound(_0x4d599c,null))['then'](function(_0x163284){var _0x5763fb=_[_0xfd8e('0x35')](_0x163284,'id');var _0xe8f44=[];var _0x32c19e=[];var _0x41222d=squel[_0xfd8e('0x76')]();_0x41222d[_0xfd8e('0x77')](_0xfd8e('0x78'))[_0xfd8e('0x79')]('team_has_whatsapp_queues','tq')[_0xfd8e('0x7a')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfd8e('0x40')]('WhatsappQueueId\x20=\x20?',_0x126388[_0xfd8e('0x55')]['id']);for(var _0x382663=0x0;_0x382663<_0x163284[_0xfd8e('0x3c')];_0x382663+=0x1){let _0x3e6384=_0x163284[_0x382663];for(var _0x65b7fd=0x0;_0x65b7fd<_0x3e6384[_0xfd8e('0x68')][_0xfd8e('0x3c')];_0x65b7fd+=0x1){let _0x2b9a4c=_0x3e6384[_0xfd8e('0x68')][_0x65b7fd];var _0x14e0f9=_0x41222d[_0xfd8e('0x7b')]();_0x14e0f9[_0xfd8e('0x40')](_0xfd8e('0x7c'),_0x2b9a4c['id']);_0x32c19e['push'](db['sequelize'][_0xfd8e('0x38')](_0x14e0f9[_0xfd8e('0x7d')](),{'type':db[_0xfd8e('0x6d')][_0xfd8e('0x7e')][_0xfd8e('0x7f')]})[_0xfd8e('0x27')](function(_0x43a401){if(_0x43a401[_0xfd8e('0x3c')]===0x1){return _0x2b9a4c['id'];}else{var _0x5d723a=_['every'](_['map'](_0x43a401,_0xfd8e('0x80')),function(_0x245942){return _[_0xfd8e('0x81')](_0x5763fb,_0x245942);});if(_0x5d723a){return _0x2b9a4c['id'];}}}));}}return BPromise['all'](_0x32c19e)[_0xfd8e('0x27')](function(_0x230f9e){_0xe8f44=_(_0xe8f44)[_0xfd8e('0x82')](_0x230f9e)[_0xfd8e('0x83')]()[_0xfd8e('0x84')]();return db[_0xfd8e('0x30')][_0xfd8e('0x4b')]({'where':{'id':_0x126388['params']['id']}})['then'](function(_0x30d61b){return db[_0xfd8e('0x6d')][_0xfd8e('0x6e')](function(_0x44b720){return _0x30d61b[_0xfd8e('0x75')](_0x126388[_0xfd8e('0x38')][_0xfd8e('0x67')],{'transaction':_0x44b720})['then'](function(){if(!_[_0xfd8e('0x85')](_0xe8f44)){return _0x30d61b[_0xfd8e('0x86')](_0xe8f44,{'transaction':_0x44b720});}})['then'](function(){_0xe8f44[_0xfd8e('0x72')](function(_0x18077d){socket['emit'](_0xfd8e('0x87'),{'UserId':_0x18077d,'WhatsappQueueId':_0x30d61b['id']});});});});});});})['then'](respondWithStatusCode(_0x4d599c,null))[_0xfd8e('0x4c')](handleError(_0x4d599c,null));};exports['addAgents']=function(_0xd05180,_0x669839,_0x565d9f){return db['WhatsappQueue'][_0xfd8e('0x4b')]({'where':{'id':_0xd05180[_0xfd8e('0x55')]['id']}})['then'](handleEntityNotFound(_0x669839,null))[_0xfd8e('0x27')](function(_0x469639){if(_0x469639){return _0x469639['addAgents'](_0xd05180[_0xfd8e('0x4d')][_0xfd8e('0x67')],_[_0xfd8e('0x88')](_0xd05180['body'],['ids','id'])||{})[_0xfd8e('0x89')](function(_0x273638){for(var _0x759e51=0x0;_0x759e51<_0xd05180[_0xfd8e('0x4d')][_0xfd8e('0x67')][_0xfd8e('0x3c')];_0x759e51+=0x1){socket[_0xfd8e('0x73')](_0xfd8e('0x74'),{'UserId':Number(_0xd05180[_0xfd8e('0x4d')]['ids'][_0x759e51]),'WhatsappQueueId':Number(_0xd05180[_0xfd8e('0x55')]['id'])});}return _0x273638;});}})[_0xfd8e('0x27')](respondWithResult(_0x669839,null))[_0xfd8e('0x4c')](handleError(_0x669839,null));};exports[_0xfd8e('0x86')]=function(_0xa2b96f,_0x2ddd57,_0x787b7e){return db[_0xfd8e('0x30')][_0xfd8e('0x4b')]({'where':{'id':_0xa2b96f[_0xfd8e('0x55')]['id']}})[_0xfd8e('0x27')](handleEntityNotFound(_0x2ddd57,null))[_0xfd8e('0x27')](function(_0x5821fc){if(_0x5821fc){return _0x5821fc[_0xfd8e('0x86')](_0xa2b96f[_0xfd8e('0x38')][_0xfd8e('0x67')])[_0xfd8e('0x27')](function(){if(_[_0xfd8e('0x8a')](_0xa2b96f[_0xfd8e('0x38')]['ids'])){for(var _0x1b52f7=0x0;_0x1b52f7<_0xa2b96f[_0xfd8e('0x38')]['ids'][_0xfd8e('0x3c')];_0x1b52f7+=0x1){socket[_0xfd8e('0x73')](_0xfd8e('0x87'),{'UserId':Number(_0xa2b96f[_0xfd8e('0x38')]['ids'][_0x1b52f7]),'WhatsappQueueId':Number(_0xa2b96f[_0xfd8e('0x55')]['id'])});}}else{socket[_0xfd8e('0x73')](_0xfd8e('0x87'),{'UserId':Number(_0xa2b96f[_0xfd8e('0x38')][_0xfd8e('0x67')]),'WhatsappQueueId':Number(_0xa2b96f[_0xfd8e('0x55')]['id'])});}});}})[_0xfd8e('0x27')](respondWithStatusCode(_0x2ddd57,null))[_0xfd8e('0x4c')](handleError(_0x2ddd57,null));};exports['getAgents']=function(_0x2ef156,_0x209220,_0x4a3154){var _0x37195b={};var _0x341233={};var _0x52804b;var _0x138398;return db[_0xfd8e('0x30')][_0xfd8e('0x59')]({'where':{'id':_0x2ef156[_0xfd8e('0x55')]['id']}})[_0xfd8e('0x27')](handleEntityNotFound(_0x209220,null))[_0xfd8e('0x27')](function(_0x52030f){if(_0x52030f){_0x52804b=_0x52030f;_0x341233[_0xfd8e('0x34')]=_['keys'](db[_0xfd8e('0x5c')]['rawAttributes']);_0x341233[_0xfd8e('0x38')]=_[_0xfd8e('0x36')](_0x2ef156[_0xfd8e('0x38')]);_0x341233['filters']=_[_0xfd8e('0x3a')](_0x341233[_0xfd8e('0x34')],_0x341233[_0xfd8e('0x38')]);_0x37195b['attributes']=_[_0xfd8e('0x3a')](_0x341233[_0xfd8e('0x34')],qs[_0xfd8e('0x3b')](_0x2ef156['query'][_0xfd8e('0x3b')]));_0x37195b[_0xfd8e('0x39')]=_0x37195b[_0xfd8e('0x39')][_0xfd8e('0x3c')]?_0x37195b['attributes']:_0x341233[_0xfd8e('0x34')];_0x37195b['order']=qs[_0xfd8e('0x3f')](_0x2ef156[_0xfd8e('0x38')][_0xfd8e('0x3f')]);_0x37195b[_0xfd8e('0x40')]=qs[_0xfd8e('0x37')](_[_0xfd8e('0x41')](_0x2ef156[_0xfd8e('0x38')],_0x341233[_0xfd8e('0x37')]));if(_0x2ef156['query'][_0xfd8e('0x42')]){_0x37195b[_0xfd8e('0x40')]=_[_0xfd8e('0x44')](_0x37195b[_0xfd8e('0x40')],{'$or':_[_0xfd8e('0x35')](_0x37195b[_0xfd8e('0x39')],function(_0x4ba45c){var _0x3b3fb9={};_0x3b3fb9[_0x4ba45c]={'$like':'%'+_0x2ef156[_0xfd8e('0x38')][_0xfd8e('0x42')]+'%'};return _0x3b3fb9;})});}_0x37195b=_[_0xfd8e('0x44')]({},_0x37195b,_0x2ef156[_0xfd8e('0x45')]);return _0x52804b[_0xfd8e('0x8b')](_0x37195b);}})['then'](function(_0x34444a){if(_0x34444a){_0x138398=_0x34444a[_0xfd8e('0x3c')];if(!_0x2ef156[_0xfd8e('0x38')][_0xfd8e('0x3d')](_0xfd8e('0x3e'))){_0x37195b[_0xfd8e('0x1f')]=qs['limit'](_0x2ef156[_0xfd8e('0x38')][_0xfd8e('0x1f')]);_0x37195b[_0xfd8e('0x1d')]=qs['offset'](_0x2ef156[_0xfd8e('0x38')][_0xfd8e('0x1d')]);}return _0x52804b[_0xfd8e('0x8b')](_0x37195b);}})['then'](function(_0x2300d3){if(_0x2300d3){return _0x2300d3?{'count':_0x138398,'rows':_0x2300d3}:null;}})[_0xfd8e('0x27')](respondWithResult(_0x209220,null))['catch'](handleError(_0x209220,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b8609c4..aab7a71 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 _0xcdc4=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x3f5fb6,_0x2f16b1){var _0x2ca27f=function(_0x486cc9){while(--_0x486cc9){_0x3f5fb6['push'](_0x3f5fb6['shift']());}};_0x2ca27f(++_0x2f16b1);}(_0xcdc4,0x14d));var _0x4cdc=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xcdc4[_0x2df724];return _0x1b2504;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x4cdc('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4cdc('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4cdc('0x2'),'afterDestroy':_0x4cdc('0x3')};function emitEvent(_0x54f34e){return function(_0x1831ec,_0x4586f0,_0x5ec9b2){WhatsappQueueEvents['emit'](_0x54f34e+':'+_0x1831ec['id'],_0x1831ec);WhatsappQueueEvents[_0x4cdc('0x4')](_0x54f34e,_0x1831ec);_0x5ec9b2(null);};}for(var e in events){if(events[_0x4cdc('0x5')](e)){var event=events[e];WhatsappQueue[_0x4cdc('0x6')](e,emitEvent(event));}}module[_0x4cdc('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xa47b=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue'];(function(_0x2a9c1f,_0x50ff2c){var _0x3af502=function(_0x7f31d2){while(--_0x7f31d2){_0x2a9c1f['push'](_0x2a9c1f['shift']());}};_0x3af502(++_0x50ff2c);}(_0xa47b,0x176));var _0xba47=function(_0x30e7b6,_0x5ebe4d){_0x30e7b6=_0x30e7b6-0x0;var _0x5d9839=_0xa47b[_0x30e7b6];return _0x5d9839;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xba47('0x0'))['db'][_0xba47('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xba47('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xba47('0x3'),'afterDestroy':_0xba47('0x4')};function emitEvent(_0x25c4c1){return function(_0x33033b,_0x3d3cf7,_0x1f4bcf){WhatsappQueueEvents['emit'](_0x25c4c1+':'+_0x33033b['id'],_0x33033b);WhatsappQueueEvents[_0xba47('0x5')](_0x25c4c1,_0x33033b);_0x1f4bcf(null);};}for(var e in events){if(events[_0xba47('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xba47('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 16ca78a..f0532c8 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 _0x744e=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','WhatsappQueue','whatsapp_queues'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x744e,0x190));var _0xe744=function(_0xf68806,_0x5edb76){_0xf68806=_0xf68806-0x0;var _0x59720d=_0x744e[_0xf68806];return _0x59720d;};'use strict';var _=require(_0xe744('0x0'));var util=require(_0xe744('0x1'));var logger=require(_0xe744('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe744('0x3'));var rp=require(_0xe744('0x4'));var fs=require('fs');var path=require(_0xe744('0x5'));var rimraf=require(_0xe744('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0xe744('0x7')]=function(_0xf0ac12,_0xea0dc6){return _0xf0ac12['define'](_0xe744('0x8'),attributes,{'tableName':_0xe744('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf50e=['../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','util','api','bluebird','request-promise','rimraf'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf50e,0x87));var _0xef50=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0xf50e[_0x20b29c];return _0x20d81b;};'use strict';var _=require('lodash');var util=require(_0xef50('0x0'));var logger=require('../../config/logger')(_0xef50('0x1'));var moment=require('moment');var BPromise=require(_0xef50('0x2'));var rp=require(_0xef50('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef50('0x4'));var config=require(_0xef50('0x5'));var attributes=require(_0xef50('0x6'));module['exports']=function(_0xfa516e,_0x2d543a){return _0xfa516e[_0xef50('0x7')](_0xef50('0x8'),attributes,{'tableName':_0xef50('0x9'),'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 301e237..a6ce0b6 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 _0xaf48=['register','request','info','debug','request\x20sent','stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowWhatsappQueue','find','moment','bluebird','randomstring','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x43aa7f,_0x9ee684){var _0x140b3f=function(_0x5b9d41){while(--_0x5b9d41){_0x43aa7f['push'](_0x43aa7f['shift']());}};_0x140b3f(++_0x9ee684);}(_0xaf48,0x1ca));var _0x8af4=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xaf48[_0x1762b4];return _0x29beda;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8af4('0x0'));var BPromise=require(_0x8af4('0x1'));var rs=require(_0x8af4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8af4('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x8af4('0x4')][_0x8af4('0x5')]({'port':0x232a});config[_0x8af4('0x6')]=_[_0x8af4('0x7')](config[_0x8af4('0x6')],{'host':_0x8af4('0x8'),'port':0x18eb});var socket=require(_0x8af4('0x9'))(new Redis(config[_0x8af4('0x6')]));require('./whatsappQueue.socket')[_0x8af4('0xa')](socket);function respondWithRpcPromise(_0x2b0bee,_0x530520,_0x11e7d9){return new BPromise(function(_0x179ddb,_0x2efd64){return client[_0x8af4('0xb')](_0x2b0bee,_0x11e7d9)['then'](function(_0x96bdea){logger[_0x8af4('0xc')]('WhatsappQueue,\x20%s,\x20%s',_0x530520,'request\x20sent');logger[_0x8af4('0xd')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x530520,_0x8af4('0xe'),JSON[_0x8af4('0xf')](_0x96bdea));if(_0x96bdea[_0x8af4('0x10')]){if(_0x96bdea[_0x8af4('0x10')][_0x8af4('0x11')]===0x1f4){logger[_0x8af4('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x530520,_0x96bdea[_0x8af4('0x10')][_0x8af4('0x12')]);return _0x2efd64(_0x96bdea[_0x8af4('0x10')][_0x8af4('0x12')]);}logger[_0x8af4('0x10')](_0x8af4('0x13'),_0x530520,_0x96bdea[_0x8af4('0x10')]['message']);return _0x179ddb(_0x96bdea[_0x8af4('0x10')][_0x8af4('0x12')]);}else{logger[_0x8af4('0xc')]('WhatsappQueue,\x20%s,\x20%s',_0x530520,'request\x20sent');_0x179ddb(_0x96bdea[_0x8af4('0x14')][_0x8af4('0x12')]);}})[_0x8af4('0x15')](function(_0x3cdc7a){logger[_0x8af4('0x10')](_0x8af4('0x13'),_0x530520,_0x3cdc7a);_0x2efd64(_0x3cdc7a);});});}exports[_0x8af4('0x16')]=function(_0x2f562b){var _0x492f58=this;return new Promise(function(_0x3d5aa1,_0x40cdff){return db[_0x8af4('0x17')][_0x8af4('0x18')]({'raw':_0x2f562b[_0x8af4('0x19')]?_0x2f562b['options'][_0x8af4('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f562b[_0x8af4('0x19')]?_0x2f562b[_0x8af4('0x19')][_0x8af4('0x1b')]||null:null,'attributes':_0x2f562b[_0x8af4('0x19')]?_0x2f562b['options']['attributes']||null:null,'limit':_0x2f562b[_0x8af4('0x19')]?_0x2f562b[_0x8af4('0x19')][_0x8af4('0x1c')]||null:null,'include':_0x2f562b['options']?_0x2f562b[_0x8af4('0x19')][_0x8af4('0x1d')]?_[_0x8af4('0x1e')](_0x2f562b['options'][_0x8af4('0x1d')],function(_0x4f8997){return{'model':db[_0x4f8997[_0x8af4('0x1f')]],'as':_0x4f8997['as'],'attributes':_0x4f8997[_0x8af4('0x20')],'include':_0x4f8997[_0x8af4('0x1d')]?_['map'](_0x4f8997['include'],function(_0x10f353){return{'model':db[_0x10f353[_0x8af4('0x1f')]],'as':_0x10f353['as'],'attributes':_0x10f353[_0x8af4('0x20')],'include':_0x10f353[_0x8af4('0x1d')]?_['map'](_0x10f353['include'],function(_0x46ef2b){return{'model':db[_0x46ef2b['model']],'as':_0x46ef2b['as'],'attributes':_0x46ef2b[_0x8af4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8af4('0x21')](function(_0x144b71){logger[_0x8af4('0xc')](_0x8af4('0x16'),_0x2f562b);logger['debug'](_0x8af4('0x16'),_0x2f562b,JSON[_0x8af4('0xf')](_0x144b71));_0x3d5aa1(_0x144b71);})[_0x8af4('0x15')](function(_0x2c4482){logger[_0x8af4('0x10')](_0x8af4('0x16'),_0x2c4482[_0x8af4('0x12')],_0x2f562b);_0x40cdff(_0x492f58['error'](0x1f4,_0x2c4482[_0x8af4('0x12')]));});});};exports[_0x8af4('0x22')]=function(_0xc3559b){var _0x493c45=this;return new Promise(function(_0x90c6be,_0x55be1c){return db['WhatsappQueue'][_0x8af4('0x23')]({'raw':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1a')]===undefined?!![]:![]:!![],'where':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1b')]||null:null,'attributes':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x20')]||null:null,'include':_0xc3559b[_0x8af4('0x19')]?_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1d')]?_['map'](_0xc3559b[_0x8af4('0x19')][_0x8af4('0x1d')],function(_0x57decb){return{'model':db[_0x57decb[_0x8af4('0x1f')]],'as':_0x57decb['as'],'attributes':_0x57decb[_0x8af4('0x20')],'include':_0x57decb['include']?_['map'](_0x57decb[_0x8af4('0x1d')],function(_0x3cc49a){return{'model':db[_0x3cc49a['model']],'as':_0x3cc49a['as'],'attributes':_0x3cc49a[_0x8af4('0x20')],'include':_0x3cc49a[_0x8af4('0x1d')]?_['map'](_0x3cc49a[_0x8af4('0x1d')],function(_0x1c5f59){return{'model':db[_0x1c5f59[_0x8af4('0x1f')]],'as':_0x1c5f59['as'],'attributes':_0x1c5f59['attributes']};}):[]};}):[]};}):[]:[]})[_0x8af4('0x21')](function(_0x3ab90d){logger['info']('ShowWhatsappQueue',_0xc3559b);logger[_0x8af4('0xd')](_0x8af4('0x22'),_0xc3559b,JSON[_0x8af4('0xf')](_0x3ab90d));_0x90c6be(_0x3ab90d);})['catch'](function(_0x50f838){logger[_0x8af4('0x10')]('ShowWhatsappQueue',_0x50f838[_0x8af4('0x12')],_0xc3559b);_0x55be1c(_0x493c45['error'](0x1f4,_0x50f838[_0x8af4('0x12')]));});});}; \ No newline at end of file +var _0x3c15=['ShowWhatsappQueue','WhatsappQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model'];(function(_0x3a5564,_0x265701){var _0x843b0a=function(_0x3a58aa){while(--_0x3a58aa){_0x3a5564['push'](_0x3a5564['shift']());}};_0x843b0a(++_0x265701);}(_0x3c15,0x100));var _0x53c1=function(_0x27a1e0,_0x3ff2cb){_0x27a1e0=_0x27a1e0-0x0;var _0x1ca624=_0x3c15[_0x27a1e0];return _0x1ca624;};'use strict';var _=require(_0x53c1('0x0'));var util=require(_0x53c1('0x1'));var moment=require(_0x53c1('0x2'));var BPromise=require(_0x53c1('0x3'));var rs=require(_0x53c1('0x4'));var fs=require('fs');var Redis=require(_0x53c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x53c1('0x6'));var logger=require(_0x53c1('0x7'))(_0x53c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x53c1('0x9'));var client=jayson[_0x53c1('0xa')][_0x53c1('0xb')]({'port':0x232a});config[_0x53c1('0xc')]=_['defaults'](config[_0x53c1('0xc')],{'host':_0x53c1('0xd'),'port':0x18eb});var socket=require(_0x53c1('0xe'))(new Redis(config[_0x53c1('0xc')]));require(_0x53c1('0xf'))[_0x53c1('0x10')](socket);function respondWithRpcPromise(_0x5001b6,_0x31ac7f,_0x4299c9){return new BPromise(function(_0x310822,_0x2ecdbe){return client[_0x53c1('0x11')](_0x5001b6,_0x4299c9)[_0x53c1('0x12')](function(_0x555f44){logger['info'](_0x53c1('0x13'),_0x31ac7f,_0x53c1('0x14'));logger['debug'](_0x53c1('0x15'),_0x31ac7f,_0x53c1('0x14'),JSON[_0x53c1('0x16')](_0x555f44));if(_0x555f44['error']){if(_0x555f44[_0x53c1('0x17')]['code']===0x1f4){logger[_0x53c1('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x31ac7f,_0x555f44[_0x53c1('0x17')][_0x53c1('0x18')]);return _0x2ecdbe(_0x555f44[_0x53c1('0x17')][_0x53c1('0x18')]);}logger[_0x53c1('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x31ac7f,_0x555f44[_0x53c1('0x17')][_0x53c1('0x18')]);return _0x310822(_0x555f44[_0x53c1('0x17')][_0x53c1('0x18')]);}else{logger[_0x53c1('0x19')](_0x53c1('0x13'),_0x31ac7f,'request\x20sent');_0x310822(_0x555f44[_0x53c1('0x1a')][_0x53c1('0x18')]);}})[_0x53c1('0x1b')](function(_0x1bc51d){logger[_0x53c1('0x17')](_0x53c1('0x13'),_0x31ac7f,_0x1bc51d);_0x2ecdbe(_0x1bc51d);});});}exports[_0x53c1('0x1c')]=function(_0x13e661){var _0x4488aa=this;return new Promise(function(_0x3eb7b8,_0xd60f79){return db['WhatsappQueue'][_0x53c1('0x1d')]({'raw':_0x13e661[_0x53c1('0x1e')]?_0x13e661[_0x53c1('0x1e')][_0x53c1('0x1f')]===undefined?!![]:![]:!![],'where':_0x13e661[_0x53c1('0x1e')]?_0x13e661[_0x53c1('0x1e')][_0x53c1('0x20')]||null:null,'attributes':_0x13e661[_0x53c1('0x1e')]?_0x13e661[_0x53c1('0x1e')][_0x53c1('0x21')]||null:null,'limit':_0x13e661[_0x53c1('0x1e')]?_0x13e661['options'][_0x53c1('0x22')]||null:null,'include':_0x13e661[_0x53c1('0x1e')]?_0x13e661[_0x53c1('0x1e')]['include']?_[_0x53c1('0x23')](_0x13e661[_0x53c1('0x1e')][_0x53c1('0x24')],function(_0x1c32ff){return{'model':db[_0x1c32ff['model']],'as':_0x1c32ff['as'],'attributes':_0x1c32ff['attributes'],'include':_0x1c32ff[_0x53c1('0x24')]?_[_0x53c1('0x23')](_0x1c32ff[_0x53c1('0x24')],function(_0x5a4050){return{'model':db[_0x5a4050[_0x53c1('0x25')]],'as':_0x5a4050['as'],'attributes':_0x5a4050['attributes'],'include':_0x5a4050[_0x53c1('0x24')]?_['map'](_0x5a4050[_0x53c1('0x24')],function(_0x4921fb){return{'model':db[_0x4921fb[_0x53c1('0x25')]],'as':_0x4921fb['as'],'attributes':_0x4921fb[_0x53c1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x53c1('0x12')](function(_0x11728d){logger[_0x53c1('0x19')](_0x53c1('0x1c'),_0x13e661);logger['debug']('GetWhatsappQueue',_0x13e661,JSON[_0x53c1('0x16')](_0x11728d));_0x3eb7b8(_0x11728d);})[_0x53c1('0x1b')](function(_0x4162fd){logger['error'](_0x53c1('0x1c'),_0x4162fd['message'],_0x13e661);_0xd60f79(_0x4488aa[_0x53c1('0x17')](0x1f4,_0x4162fd[_0x53c1('0x18')]));});});};exports[_0x53c1('0x26')]=function(_0x213b4f){var _0x482b77=this;return new Promise(function(_0x40f0bd,_0x504899){return db[_0x53c1('0x27')][_0x53c1('0x28')]({'raw':_0x213b4f[_0x53c1('0x1e')]?_0x213b4f['options'][_0x53c1('0x1f')]===undefined?!![]:![]:!![],'where':_0x213b4f[_0x53c1('0x1e')]?_0x213b4f[_0x53c1('0x1e')]['where']||null:null,'attributes':_0x213b4f[_0x53c1('0x1e')]?_0x213b4f[_0x53c1('0x1e')]['attributes']||null:null,'include':_0x213b4f['options']?_0x213b4f[_0x53c1('0x1e')][_0x53c1('0x24')]?_[_0x53c1('0x23')](_0x213b4f[_0x53c1('0x1e')][_0x53c1('0x24')],function(_0x1e2f1f){return{'model':db[_0x1e2f1f[_0x53c1('0x25')]],'as':_0x1e2f1f['as'],'attributes':_0x1e2f1f[_0x53c1('0x21')],'include':_0x1e2f1f[_0x53c1('0x24')]?_[_0x53c1('0x23')](_0x1e2f1f[_0x53c1('0x24')],function(_0x546ee4){return{'model':db[_0x546ee4['model']],'as':_0x546ee4['as'],'attributes':_0x546ee4[_0x53c1('0x21')],'include':_0x546ee4[_0x53c1('0x24')]?_['map'](_0x546ee4[_0x53c1('0x24')],function(_0x381dc9){return{'model':db[_0x381dc9[_0x53c1('0x25')]],'as':_0x381dc9['as'],'attributes':_0x381dc9[_0x53c1('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x381ef2){logger[_0x53c1('0x19')](_0x53c1('0x26'),_0x213b4f);logger[_0x53c1('0x29')]('ShowWhatsappQueue',_0x213b4f,JSON['stringify'](_0x381ef2));_0x40f0bd(_0x381ef2);})[_0x53c1('0x1b')](function(_0x251466){logger[_0x53c1('0x17')](_0x53c1('0x26'),_0x251466[_0x53c1('0x18')],_0x213b4f);_0x504899(_0x482b77[_0x53c1('0x17')](0x1f4,_0x251466['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index b37e1b3..bcc272c 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 _0xc60e=['update','emit','removeListener','register','length','./whatsappQueue.events','save','remove'];(function(_0x481ffc,_0x4acb82){var _0x51d09a=function(_0x2d73e0){while(--_0x2d73e0){_0x481ffc['push'](_0x481ffc['shift']());}};_0x51d09a(++_0x4acb82);}(_0xc60e,0x11d));var _0xec60=function(_0x1b5125,_0x30d5c9){_0x1b5125=_0x1b5125-0x0;var _0x2bf0a8=_0xc60e[_0x1b5125];return _0x2bf0a8;};'use strict';var WhatsappQueueEvents=require(_0xec60('0x0'));var events=[_0xec60('0x1'),_0xec60('0x2'),_0xec60('0x3')];function createListener(_0x4d58bf,_0x22216e){return function(_0x3398b4){_0x22216e[_0xec60('0x4')](_0x4d58bf,_0x3398b4);};}function removeListener(_0x64309,_0x4242f8){return function(){WhatsappQueueEvents[_0xec60('0x5')](_0x64309,_0x4242f8);};}exports[_0xec60('0x6')]=function(_0x1ad8d9){for(var _0x55e550=0x0,_0x248f7=events[_0xec60('0x7')];_0x55e550<_0x248f7;_0x55e550++){var _0x8a3430=events[_0x55e550];var _0xa23689=createListener('whatsappQueue:'+_0x8a3430,_0x1ad8d9);WhatsappQueueEvents['on'](_0x8a3430,_0xa23689);}}; \ No newline at end of file +var _0x7711=['whatsappQueue:','save','remove','update','emit','register','length'];(function(_0x1a2a30,_0x5c98fa){var _0x1e7047=function(_0x59bd9b){while(--_0x59bd9b){_0x1a2a30['push'](_0x1a2a30['shift']());}};_0x1e7047(++_0x5c98fa);}(_0x7711,0xfd));var _0x1771=function(_0x17d382,_0x5ae511){_0x17d382=_0x17d382-0x0;var _0x1ef1cd=_0x7711[_0x17d382];return _0x1ef1cd;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x1771('0x0'),_0x1771('0x1'),_0x1771('0x2')];function createListener(_0x2e6464,_0x5ce0c9){return function(_0x53e07f){_0x5ce0c9[_0x1771('0x3')](_0x2e6464,_0x53e07f);};}function removeListener(_0x33ab46,_0x135e8d){return function(){WhatsappQueueEvents['removeListener'](_0x33ab46,_0x135e8d);};}exports[_0x1771('0x4')]=function(_0x452be2){for(var _0x39ef9e=0x0,_0x38d63f=events[_0x1771('0x5')];_0x39ef9e<_0x38d63f;_0x39ef9e++){var _0x9a1849=events[_0x39ef9e];var _0x318053=createListener(_0x1771('0x6')+_0x9a1849,_0x452be2);WhatsappQueueEvents['on'](_0x9a1849,_0x318053);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 622eba4..fb2e8de 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 _0x4ca0=['get','isAuthenticated','index','/describe','show','post','put','/:id','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46f31f,_0x125f19){var _0x10764c=function(_0x309d58){while(--_0x309d58){_0x46f31f['push'](_0x46f31f['shift']());}};_0x10764c(++_0x125f19);}(_0x4ca0,0x16f));var _0x04ca=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x4ca0[_0x1e3671];return _0x48d5f5;};'use strict';var multer=require('multer');var util=require(_0x04ca('0x0'));var path=require(_0x04ca('0x1'));var timeout=require('connect-timeout');var express=require(_0x04ca('0x2'));var router=express['Router']();var fs_extra=require(_0x04ca('0x3'));var auth=require(_0x04ca('0x4'));var interaction=require(_0x04ca('0x5'));var config=require(_0x04ca('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0x04ca('0x7')]('/',auth[_0x04ca('0x8')](),controller[_0x04ca('0x9')]);router['get'](_0x04ca('0xa'),auth[_0x04ca('0x8')](),controller['describe']);router['get']('/:id',auth[_0x04ca('0x8')](),controller[_0x04ca('0xb')]);router[_0x04ca('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x04ca('0xd')](_0x04ca('0xe'),auth[_0x04ca('0x8')](),controller['update']);router[_0x04ca('0xf')]('/:id',auth[_0x04ca('0x8')](),controller[_0x04ca('0x10')]);module['exports']=router; \ No newline at end of file +var _0x94cf=['describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94cf,0x158));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf94c('0x0'));var util=require(_0xf94c('0x1'));var path=require(_0xf94c('0x2'));var timeout=require(_0xf94c('0x3'));var express=require(_0xf94c('0x4'));var router=express['Router']();var fs_extra=require(_0xf94c('0x5'));var auth=require(_0xf94c('0x6'));var interaction=require(_0xf94c('0x7'));var config=require(_0xf94c('0x8'));var controller=require(_0xf94c('0x9'));router['get']('/',auth[_0xf94c('0xa')](),controller[_0xf94c('0xb')]);router[_0xf94c('0xc')]('/describe',auth[_0xf94c('0xa')](),controller[_0xf94c('0xd')]);router[_0xf94c('0xc')](_0xf94c('0xe'),auth[_0xf94c('0xa')](),controller[_0xf94c('0xf')]);router['post']('/',auth[_0xf94c('0xa')](),controller[_0xf94c('0x10')]);router[_0xf94c('0x11')]('/:id',auth[_0xf94c('0xa')](),controller[_0xf94c('0x12')]);router['delete']('/:id',auth[_0xf94c('0xa')](),controller[_0xf94c('0x13')]);module[_0xf94c('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 06aa781..b86c1ec 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x413aa6,_0x44290b){var _0x35cc6d=function(_0x1a9e9b){while(--_0x1a9e9b){_0x413aa6['push'](_0x413aa6['shift']());}};_0x35cc6d(++_0x44290b);}(_0x7a54,0x106));var _0x47a5=function(_0x53e734,_0x4ea68b){_0x53e734=_0x53e734-0x0;var _0x45ac70=_0x7a54[_0x53e734];return _0x45ac70;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x204eef,_0xa0cd60){var _0x1804c4=function(_0x58dc7b){while(--_0x58dc7b){_0x204eef['push'](_0x204eef['shift']());}};_0x1804c4(++_0xa0cd60);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 2cf3f02..4e15270 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 _0xda3f=['fields','nolimit','sort','filter','where','merge','type','VIRTUAL','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','destroy','describe','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','map','key','model','query','keys','filters','intersection','attributes'];(function(_0x20af5d,_0x16b78f){var _0x11e122=function(_0x2dabb7){while(--_0x2dabb7){_0x20af5d['push'](_0x20af5d['shift']());}};_0x11e122(++_0x16b78f);}(_0xda3f,0xec));var _0xfda3=function(_0x2cbb42,_0xa7a6d){_0x2cbb42=_0x2cbb42-0x0;var _0x4dc7b5=_0xda3f[_0x2cbb42];return _0x4dc7b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['index']=function(_0x3c1549,_0x4101b1){var _0x301509={},_0x474992={},_0xe21ec6={'count':0x0,'rows':[]};var _0x3cfeb2=_[_0xfda3('0x28')](db['WhatsappQueueReport']['rawAttributes'],function(_0x3aef3c){return{'name':_0x3aef3c['fieldName'],'type':_0x3aef3c['type'][_0xfda3('0x29')]};});_0x474992[_0xfda3('0x2a')]=_[_0xfda3('0x28')](_0x3cfeb2,_0xfda3('0x26'));_0x474992[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x3c1549[_0xfda3('0x2b')]);_0x474992[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x474992['model'],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2f')]=_[_0xfda3('0x2e')](_0x474992[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x301509[_0xfda3('0x2f')]=_0x301509[_0xfda3('0x2f')]['length']?_0x301509['attributes']:_0x474992[_0xfda3('0x2a')];if(!_0x3c1549[_0xfda3('0x2b')]['hasOwnProperty'](_0xfda3('0x31'))){_0x301509[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3c1549['query'][_0xfda3('0x1b')]);_0x301509[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x19')]);}_0x301509['order']=qs[_0xfda3('0x32')](_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x32')]);_0x301509['where']=qs[_0xfda3('0x2d')](_['pick'](_0x3c1549[_0xfda3('0x2b')],_0x474992[_0xfda3('0x2d')]),_0x3cfeb2);if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x33')]){_0x301509[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x301509[_0xfda3('0x34')],{'$or':_[_0xfda3('0x28')](_0x3cfeb2,function(_0x577be8){if(_0x577be8[_0xfda3('0x36')]!==_0xfda3('0x37')){var _0xd2dde0={};_0xd2dde0[_0x577be8[_0xfda3('0x26')]]={'$like':'%'+_0x3c1549['query'][_0xfda3('0x33')]+'%'};return _0xd2dde0;}})});}_0x301509=_[_0xfda3('0x35')]({},_0x301509,_0x3c1549[_0xfda3('0x38')]);var _0x5bad90={'where':_0x301509['where']};return db[_0xfda3('0x39')][_0xfda3('0x1c')](_0x5bad90)[_0xfda3('0x23')](function(_0x1aaa6c){_0xe21ec6[_0xfda3('0x1c')]=_0x1aaa6c;if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x301509[_0xfda3('0x3b')]=[{'all':!![]}];}return db[_0xfda3('0x39')][_0xfda3('0x3c')](_0x301509);})['then'](function(_0x27200f){_0xe21ec6[_0xfda3('0x3d')]=_0x27200f;return _0xe21ec6;})['then'](respondWithFilteredResult(_0x4101b1,_0x301509))[_0xfda3('0x3e')](handleError(_0x4101b1,null));};exports['show']=function(_0x51a314,_0x4e6886){var _0x2208bc={'raw':!![],'where':{'id':_0x51a314[_0xfda3('0x3f')]['id']}},_0x107fb1={};_0x107fb1[_0xfda3('0x2a')]=_['keys'](db[_0xfda3('0x39')][_0xfda3('0x40')]);_0x107fb1[_0xfda3('0x2b')]=_[_0xfda3('0x2c')](_0x51a314['query']);_0x107fb1[_0xfda3('0x2d')]=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],_0x107fb1['query']);_0x2208bc['attributes']=_[_0xfda3('0x2e')](_0x107fb1[_0xfda3('0x2a')],qs[_0xfda3('0x30')](_0x51a314[_0xfda3('0x2b')][_0xfda3('0x30')]));_0x2208bc[_0xfda3('0x2f')]=_0x2208bc[_0xfda3('0x2f')][_0xfda3('0x41')]?_0x2208bc[_0xfda3('0x2f')]:_0x107fb1[_0xfda3('0x2a')];if(_0x51a314[_0xfda3('0x2b')][_0xfda3('0x3a')]){_0x2208bc[_0xfda3('0x3b')]=[{'all':!![]}];}_0x2208bc=_[_0xfda3('0x35')]({},_0x2208bc,_0x51a314['options']);return db['WhatsappQueueReport'][_0xfda3('0x42')](_0x2208bc)[_0xfda3('0x23')](handleEntityNotFound(_0x4e6886,null))[_0xfda3('0x23')](respondWithResult(_0x4e6886,null))[_0xfda3('0x3e')](handleError(_0x4e6886,null));};exports[_0xfda3('0x43')]=function(_0x60a89d,_0x192133){return db[_0xfda3('0x39')][_0xfda3('0x43')](_0x60a89d[_0xfda3('0x44')],{})['then'](respondWithResult(_0x192133,0xc9))[_0xfda3('0x3e')](handleError(_0x192133,null));};exports[_0xfda3('0x22')]=function(_0x481356,_0x36aa3a){if(_0x481356[_0xfda3('0x44')]['id']){delete _0x481356['body']['id'];}return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x481356[_0xfda3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36aa3a,null))[_0xfda3('0x23')](saveUpdates(_0x481356[_0xfda3('0x44')],null))[_0xfda3('0x23')](respondWithResult(_0x36aa3a,null))['catch'](handleError(_0x36aa3a,null));};exports[_0xfda3('0x45')]=function(_0x33565d,_0x2f54eb){return db[_0xfda3('0x39')][_0xfda3('0x42')]({'where':{'id':_0x33565d['params']['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2f54eb,null))['then'](removeEntity(_0x2f54eb,null))[_0xfda3('0x3e')](handleError(_0x2f54eb,null));};exports['describe']=function(_0x1b5e89,_0x6447){return db[_0xfda3('0x39')][_0xfda3('0x46')]()['then'](respondWithResult(_0x6447,null))[_0xfda3('0x3e')](handleError(_0x6447,null));}; \ No newline at end of file +var _0x1775=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x569718,_0x44bed3){var _0x476b3d=function(_0x2d17de){while(--_0x2d17de){_0x569718['push'](_0x569718['shift']());}};_0x476b3d(++_0x44bed3);}(_0x1775,0x1db));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x564139,_0x19a0c2){return function(_0x15cb93){if(!_0x15cb93){_0x564139['sendStatus'](0x194);}return _0x15cb93;};}function handleError(_0x3285b3,_0x4eba3a){_0x4eba3a=_0x4eba3a||0x1f4;return function(_0x231d35){logger[_0x5177('0x2a')](_0x231d35['stack']);if(_0x231d35[_0x5177('0x2b')]){delete _0x231d35[_0x5177('0x2b')];}_0x3285b3[_0x5177('0x1d')](_0x4eba3a)[_0x5177('0x2c')](_0x231d35);};}exports[_0x5177('0x2d')]=function(_0x1cef5d,_0x5577bb){var _0x498fcd={},_0x45cf20={},_0x1c660e={'count':0x0,'rows':[]};var _0x7dae59=_[_0x5177('0x2e')](db[_0x5177('0x2f')][_0x5177('0x30')],function(_0x31eb9f){return{'name':_0x31eb9f[_0x5177('0x31')],'type':_0x31eb9f['type'][_0x5177('0x32')]};});_0x45cf20[_0x5177('0x33')]=_['map'](_0x7dae59,_0x5177('0x2b'));_0x45cf20['query']=_[_0x5177('0x34')](_0x1cef5d[_0x5177('0x35')]);_0x45cf20[_0x5177('0x36')]=_['intersection'](_0x45cf20['model'],_0x45cf20[_0x5177('0x35')]);_0x498fcd[_0x5177('0x37')]=_[_0x5177('0x38')](_0x45cf20[_0x5177('0x33')],qs[_0x5177('0x39')](_0x1cef5d[_0x5177('0x35')][_0x5177('0x39')]));_0x498fcd[_0x5177('0x37')]=_0x498fcd['attributes'][_0x5177('0x3a')]?_0x498fcd[_0x5177('0x37')]:_0x45cf20['model'];if(!_0x1cef5d[_0x5177('0x35')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x498fcd[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x1cef5d[_0x5177('0x35')]['limit']);_0x498fcd[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x1cef5d[_0x5177('0x35')][_0x5177('0x20')]);}_0x498fcd[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x1cef5d[_0x5177('0x35')]['sort']);_0x498fcd[_0x5177('0x40')]=qs[_0x5177('0x36')](_['pick'](_0x1cef5d['query'],_0x45cf20[_0x5177('0x36')]),_0x7dae59);if(_0x1cef5d[_0x5177('0x35')][_0x5177('0x41')]){_0x498fcd[_0x5177('0x40')]=_[_0x5177('0x42')](_0x498fcd[_0x5177('0x40')],{'$or':_[_0x5177('0x2e')](_0x7dae59,function(_0x24fd92){if(_0x24fd92[_0x5177('0x43')]!==_0x5177('0x44')){var _0x16fabc={};_0x16fabc[_0x24fd92[_0x5177('0x2b')]]={'$like':'%'+_0x1cef5d[_0x5177('0x35')]['filter']+'%'};return _0x16fabc;}})});}_0x498fcd=_[_0x5177('0x42')]({},_0x498fcd,_0x1cef5d[_0x5177('0x45')]);var _0x4e3677={'where':_0x498fcd[_0x5177('0x40')]};return db['WhatsappQueueReport'][_0x5177('0x22')](_0x4e3677)[_0x5177('0x28')](function(_0x3f02f1){_0x1c660e['count']=_0x3f02f1;if(_0x1cef5d['query'][_0x5177('0x46')]){_0x498fcd[_0x5177('0x47')]=[{'all':!![]}];}return db[_0x5177('0x2f')][_0x5177('0x48')](_0x498fcd);})[_0x5177('0x28')](function(_0x3e710d){_0x1c660e[_0x5177('0x49')]=_0x3e710d;return _0x1c660e;})[_0x5177('0x28')](respondWithFilteredResult(_0x5577bb,_0x498fcd))['catch'](handleError(_0x5577bb,null));};exports[_0x5177('0x4a')]=function(_0x51ecc0,_0x5e3d30){var _0x30e4f3={'raw':!![],'where':{'id':_0x51ecc0['params']['id']}},_0x17dc98={};_0x17dc98[_0x5177('0x33')]=_['keys'](db['WhatsappQueueReport'][_0x5177('0x30')]);_0x17dc98[_0x5177('0x35')]=_[_0x5177('0x34')](_0x51ecc0[_0x5177('0x35')]);_0x17dc98[_0x5177('0x36')]=_[_0x5177('0x38')](_0x17dc98[_0x5177('0x33')],_0x17dc98['query']);_0x30e4f3['attributes']=_[_0x5177('0x38')](_0x17dc98['model'],qs[_0x5177('0x39')](_0x51ecc0[_0x5177('0x35')][_0x5177('0x39')]));_0x30e4f3[_0x5177('0x37')]=_0x30e4f3['attributes'][_0x5177('0x3a')]?_0x30e4f3[_0x5177('0x37')]:_0x17dc98[_0x5177('0x33')];if(_0x51ecc0[_0x5177('0x35')][_0x5177('0x46')]){_0x30e4f3[_0x5177('0x47')]=[{'all':!![]}];}_0x30e4f3=_[_0x5177('0x42')]({},_0x30e4f3,_0x51ecc0[_0x5177('0x45')]);return db[_0x5177('0x2f')][_0x5177('0x4b')](_0x30e4f3)[_0x5177('0x28')](handleEntityNotFound(_0x5e3d30,null))['then'](respondWithResult(_0x5e3d30,null))[_0x5177('0x4c')](handleError(_0x5e3d30,null));};exports['create']=function(_0x58a4e6,_0x5bda8a){return db[_0x5177('0x2f')][_0x5177('0x4d')](_0x58a4e6['body'],{})[_0x5177('0x28')](respondWithResult(_0x5bda8a,0xc9))[_0x5177('0x4c')](handleError(_0x5bda8a,null));};exports[_0x5177('0x4e')]=function(_0x4891fe,_0x1d4ae4){if(_0x4891fe['body']['id']){delete _0x4891fe['body']['id'];}return db['WhatsappQueueReport'][_0x5177('0x4b')]({'where':{'id':_0x4891fe[_0x5177('0x4f')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x1d4ae4,null))['then'](saveUpdates(_0x4891fe['body'],null))[_0x5177('0x28')](respondWithResult(_0x1d4ae4,null))['catch'](handleError(_0x1d4ae4,null));};exports[_0x5177('0x29')]=function(_0x9dd7a2,_0x430e8e){return db[_0x5177('0x2f')][_0x5177('0x4b')]({'where':{'id':_0x9dd7a2[_0x5177('0x4f')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x430e8e,null))[_0x5177('0x28')](removeEntity(_0x430e8e,null))[_0x5177('0x4c')](handleError(_0x430e8e,null));};exports[_0x5177('0x50')]=function(_0x89fe3a,_0xb08267){return db[_0x5177('0x2f')]['describe']()['then'](respondWithResult(_0xb08267,null))[_0x5177('0x4c')](handleError(_0xb08267,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a4a6790..793153e 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 _0x4fb0=['../../config/logger','moment','request-promise','path','./whatsappQueueReport.attributes','WhatsappQueueReport','uniqueid','lodash','util'];(function(_0x597f7f,_0x587160){var _0x35d5fb=function(_0x5ccb80){while(--_0x5ccb80){_0x597f7f['push'](_0x597f7f['shift']());}};_0x35d5fb(++_0x587160);}(_0x4fb0,0x1ae));var _0x04fb=function(_0x6dd04b,_0xadfde8){_0x6dd04b=_0x6dd04b-0x0;var _0x3d6ff2=_0x4fb0[_0x6dd04b];return _0x3d6ff2;};'use strict';var _=require(_0x04fb('0x0'));var util=require(_0x04fb('0x1'));var logger=require(_0x04fb('0x2'))('api');var moment=require(_0x04fb('0x3'));var BPromise=require('bluebird');var rp=require(_0x04fb('0x4'));var fs=require('fs');var path=require(_0x04fb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04fb('0x6'));module['exports']=function(_0x4d2a50,_0x14a080){return _0x4d2a50['define'](_0x04fb('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x04fb('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x69bf=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','moment','path','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x69bf,0x139));var _0xf69b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x69bf[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf69b('0x0'));var util=require(_0xf69b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf69b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf69b('0x3'));var rimraf=require('rimraf');var config=require(_0xf69b('0x4'));var attributes=require(_0xf69b('0x5'));module[_0xf69b('0x6')]=function(_0x3b0071,_0x4268b1){return _0x3b0071[_0xf69b('0x7')](_0xf69b('0x8'),attributes,{'tableName':_0xf69b('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf69b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 032c830..518e296 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 _0x215c=['attributes','UpdateWhatsappQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','update','raw','where'];(function(_0x1eed90,_0x36df41){var _0x4671b9=function(_0x6d42c6){while(--_0x6d42c6){_0x1eed90['push'](_0x1eed90['shift']());}};_0x4671b9(++_0x36df41);}(_0x215c,0x107));var _0xc215=function(_0x3d3098,_0x3d9b8a){_0x3d3098=_0x3d3098-0x0;var _0x3a95e9=_0x215c[_0x3d3098];return _0x3a95e9;};'use strict';var _=require('lodash');var util=require(_0xc215('0x0'));var moment=require(_0xc215('0x1'));var BPromise=require(_0xc215('0x2'));var rs=require(_0xc215('0x3'));var fs=require('fs');var Redis=require(_0xc215('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc215('0x5'));var logger=require(_0xc215('0x6'))(_0xc215('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc215('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4745d5,_0x6b7060,_0x2e096b){return new BPromise(function(_0x358c38,_0x33a70e){return client[_0xc215('0x9')](_0x4745d5,_0x2e096b)[_0xc215('0xa')](function(_0x5d5189){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x6b7060,'request\x20sent');logger[_0xc215('0xb')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x6b7060,'request\x20sent',JSON[_0xc215('0xc')](_0x5d5189));if(_0x5d5189[_0xc215('0xd')]){if(_0x5d5189['error'][_0xc215('0xe')]===0x1f4){logger[_0xc215('0xd')](_0xc215('0xf'),_0x6b7060,_0x5d5189['error'][_0xc215('0x10')]);return _0x33a70e(_0x5d5189[_0xc215('0xd')]['message']);}logger[_0xc215('0xd')](_0xc215('0xf'),_0x6b7060,_0x5d5189['error'][_0xc215('0x10')]);return _0x358c38(_0x5d5189[_0xc215('0xd')][_0xc215('0x10')]);}else{logger[_0xc215('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x6b7060,'request\x20sent');_0x358c38(_0x5d5189[_0xc215('0x12')][_0xc215('0x10')]);}})[_0xc215('0x13')](function(_0x5e8302){logger[_0xc215('0xd')](_0xc215('0xf'),_0x6b7060,_0x5e8302);_0x33a70e(_0x5e8302);});});}exports[_0xc215('0x14')]=function(_0x4c13ee){var _0x1fbaff=this;return new Promise(function(_0x1da22e,_0x410779){return db[_0xc215('0x15')][_0xc215('0x16')](_0x4c13ee['body'],{'raw':_0x4c13ee[_0xc215('0x17')]?_0x4c13ee[_0xc215('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc215('0xa')](function(_0x36df0a){logger['info']('CreateWhatsappQueueReport',_0x4c13ee);logger['debug'](_0xc215('0x14'),_0x4c13ee,JSON[_0xc215('0xc')](_0x36df0a));_0x1da22e(_0x36df0a);})[_0xc215('0x13')](function(_0x2bc288){logger[_0xc215('0xd')](_0xc215('0x14'),_0x2bc288['message'],_0x4c13ee);_0x410779(_0x1fbaff['error'](0x1f4,_0x2bc288['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x440424){var _0x268eb6=this;return new Promise(function(_0x3f5e9e,_0x357feb){return db[_0xc215('0x15')][_0xc215('0x18')](_0x440424['body'],{'raw':_0x440424[_0xc215('0x17')]?_0x440424[_0xc215('0x17')][_0xc215('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x440424[_0xc215('0x17')]?_0x440424[_0xc215('0x17')][_0xc215('0x1a')]||null:null,'attributes':_0x440424['options']?_0x440424[_0xc215('0x17')][_0xc215('0x1b')]||null:null,'limit':_0x440424[_0xc215('0x17')]?_0x440424[_0xc215('0x17')]['limit']||null:null})[_0xc215('0xa')](function(_0x3a67e4){logger[_0xc215('0x11')]('UpdateWhatsappQueueReport',_0x440424);logger[_0xc215('0xb')](_0xc215('0x1c'),_0x440424,JSON[_0xc215('0xc')](_0x3a67e4));_0x3f5e9e(_0x3a67e4);})[_0xc215('0x13')](function(_0xa7e506){logger['error'](_0xc215('0x1c'),_0xa7e506[_0xc215('0x10')],_0x440424);_0x357feb(_0x268eb6[_0xc215('0xd')](0x1f4,_0xa7e506[_0xc215('0x10')]));});});}; \ No newline at end of file +var _0x4133=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','where','attributes'];(function(_0x9188f6,_0x1516bc){var _0x33492a=function(_0x1708fb){while(--_0x1708fb){_0x9188f6['push'](_0x9188f6['shift']());}};_0x33492a(++_0x1516bc);}(_0x4133,0x10e));var _0x3413=function(_0x26aee1,_0x34fcd7){_0x26aee1=_0x26aee1-0x0;var _0x26f918=_0x4133[_0x26aee1];return _0x26f918;};'use strict';var _=require(_0x3413('0x0'));var util=require(_0x3413('0x1'));var moment=require(_0x3413('0x2'));var BPromise=require('bluebird');var rs=require(_0x3413('0x3'));var fs=require('fs');var Redis=require(_0x3413('0x4'));var db=require(_0x3413('0x5'))['db'];var utils=require(_0x3413('0x6'));var logger=require('../../config/logger')(_0x3413('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3413('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3183e4,_0x4b2d68,_0x4e5c0a){return new BPromise(function(_0x4c6190,_0x711520){return client[_0x3413('0x9')](_0x3183e4,_0x4e5c0a)[_0x3413('0xa')](function(_0xb1bca){logger[_0x3413('0xb')](_0x3413('0xc'),_0x4b2d68,_0x3413('0xd'));logger[_0x3413('0xe')](_0x3413('0xf'),_0x4b2d68,_0x3413('0xd'),JSON[_0x3413('0x10')](_0xb1bca));if(_0xb1bca['error']){if(_0xb1bca[_0x3413('0x11')][_0x3413('0x12')]===0x1f4){logger['error'](_0x3413('0xc'),_0x4b2d68,_0xb1bca[_0x3413('0x11')][_0x3413('0x13')]);return _0x711520(_0xb1bca['error'][_0x3413('0x13')]);}logger[_0x3413('0x11')](_0x3413('0xc'),_0x4b2d68,_0xb1bca['error'][_0x3413('0x13')]);return _0x4c6190(_0xb1bca[_0x3413('0x11')]['message']);}else{logger[_0x3413('0xb')](_0x3413('0xc'),_0x4b2d68,_0x3413('0xd'));_0x4c6190(_0xb1bca[_0x3413('0x14')][_0x3413('0x13')]);}})[_0x3413('0x15')](function(_0xa13e93){logger['error'](_0x3413('0xc'),_0x4b2d68,_0xa13e93);_0x711520(_0xa13e93);});});}exports[_0x3413('0x16')]=function(_0x476fca){var _0x59fcbf=this;return new Promise(function(_0x1a9e88,_0x3fd3ec){return db['WhatsappQueueReport']['create'](_0x476fca[_0x3413('0x17')],{'raw':_0x476fca[_0x3413('0x18')]?_0x476fca[_0x3413('0x18')][_0x3413('0x19')]===undefined?!![]:![]:!![]})[_0x3413('0xa')](function(_0xbbb91a){logger[_0x3413('0xb')](_0x3413('0x16'),_0x476fca);logger[_0x3413('0xe')](_0x3413('0x16'),_0x476fca,JSON[_0x3413('0x10')](_0xbbb91a));_0x1a9e88(_0xbbb91a);})[_0x3413('0x15')](function(_0x1f5287){logger[_0x3413('0x11')](_0x3413('0x16'),_0x1f5287['message'],_0x476fca);_0x3fd3ec(_0x59fcbf['error'](0x1f4,_0x1f5287[_0x3413('0x13')]));});});};exports[_0x3413('0x1a')]=function(_0x143191){var _0x36a41f=this;return new Promise(function(_0xe869bd,_0x20c555){return db[_0x3413('0x1b')]['update'](_0x143191['body'],{'raw':_0x143191[_0x3413('0x18')]?_0x143191[_0x3413('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x143191[_0x3413('0x18')]?_0x143191[_0x3413('0x18')][_0x3413('0x1c')]||null:null,'attributes':_0x143191[_0x3413('0x18')]?_0x143191[_0x3413('0x18')][_0x3413('0x1d')]||null:null,'limit':_0x143191['options']?_0x143191['options']['limit']||null:null})[_0x3413('0xa')](function(_0x4695b3){logger[_0x3413('0xb')](_0x3413('0x1a'),_0x143191);logger[_0x3413('0xe')](_0x3413('0x1a'),_0x143191,JSON[_0x3413('0x10')](_0x4695b3));_0xe869bd(_0x4695b3);})['catch'](function(_0x5d5e54){logger[_0x3413('0x11')]('UpdateWhatsappQueueReport',_0x5d5e54[_0x3413('0x13')],_0x143191);_0x20c555(_0x36a41f[_0x3413('0x11')](0x1f4,_0x5d5e54['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index a256f75..17d37fd 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 _0x8194=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x2fdb17,_0x2784c4){var _0x1b61e1=function(_0x2daea9){while(--_0x2daea9){_0x2fdb17['push'](_0x2fdb17['shift']());}};_0x1b61e1(++_0x2784c4);}(_0x8194,0x1c9));var _0x4819=function(_0x264e1e,_0x3af804){_0x264e1e=_0x264e1e-0x0;var _0x4b1840=_0x8194[_0x264e1e];return _0x4b1840;};'use strict';var multer=require(_0x4819('0x0'));var util=require(_0x4819('0x1'));var path=require(_0x4819('0x2'));var timeout=require(_0x4819('0x3'));var express=require(_0x4819('0x4'));var router=express[_0x4819('0x5')]();var fs_extra=require(_0x4819('0x6'));var auth=require(_0x4819('0x7'));var interaction=require(_0x4819('0x8'));var config=require(_0x4819('0x9'));var controller=require(_0x4819('0xa'));router[_0x4819('0xb')]('/',auth['isAuthenticated'](),controller[_0x4819('0xc')]);router[_0x4819('0xb')](_0x4819('0xd'),auth[_0x4819('0xe')](),controller[_0x4819('0xf')]);router[_0x4819('0xb')]('/:id',auth[_0x4819('0xe')](),controller[_0x4819('0x10')]);router['post']('/',auth[_0x4819('0xe')](),controller[_0x4819('0x11')]);router[_0x4819('0x12')](_0x4819('0x13'),auth[_0x4819('0xe')](),controller['update']);router[_0x4819('0x14')]('/:id',auth[_0x4819('0xe')](),controller[_0x4819('0x15')]);module[_0x4819('0x16')]=router; \ No newline at end of file +var _0x84fa=['express','fs-extra','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84fa,0x75));var _0xa84f=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x84fa[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require('multer');var util=require(_0xa84f('0x0'));var path=require(_0xa84f('0x1'));var timeout=require('connect-timeout');var express=require(_0xa84f('0x2'));var router=express['Router']();var fs_extra=require(_0xa84f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa84f('0x4'));var controller=require('./whatsappTransferReport.controller');router[_0xa84f('0x5')]('/',auth[_0xa84f('0x6')](),controller['index']);router['get']('/describe',auth[_0xa84f('0x6')](),controller[_0xa84f('0x7')]);router[_0xa84f('0x5')](_0xa84f('0x8'),auth[_0xa84f('0x6')](),controller[_0xa84f('0x9')]);router[_0xa84f('0xa')]('/',auth[_0xa84f('0x6')](),controller[_0xa84f('0xb')]);router[_0xa84f('0xc')]('/:id',auth[_0xa84f('0x6')](),controller[_0xa84f('0xd')]);router[_0xa84f('0xe')](_0xa84f('0x8'),auth['isAuthenticated'](),controller[_0xa84f('0xf')]);module[_0xa84f('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index d61d811..cf128d4 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 _0x85cf=['STRING','ENUM','account','agent','queue','DATE','exports'];(function(_0x45a38e,_0x55fbad){var _0x2924a1=function(_0x5f2a23){while(--_0x5f2a23){_0x45a38e['push'](_0x45a38e['shift']());}};_0x2924a1(++_0x55fbad);}(_0x85cf,0x76));var _0xf85c=function(_0x1765fa,_0x209fb3){_0x1765fa=_0x1765fa-0x0;var _0x4ea20e=_0x85cf[_0x1765fa];return _0x4ea20e;};'use strict';var Sequelize=require('sequelize');module[_0xf85c('0x0')]={'uniqueid':{'type':Sequelize[_0xf85c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf85c('0x2')](_0xf85c('0x3'),_0xf85c('0x4'),_0xf85c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf85c('0x6')]}}; \ No newline at end of file +var _0xdbc6=['STRING','account','agent','queue','DATE'];(function(_0x43f9c2,_0x29529e){var _0x37ae84=function(_0x3ec53b){while(--_0x3ec53b){_0x43f9c2['push'](_0x43f9c2['shift']());}};_0x37ae84(++_0x29529e);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x4e546d,_0x45c281){_0x4e546d=_0x4e546d-0x0;var _0xb14dc3=_0xdbc6[_0x4e546d];return _0xb14dc3;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6dbc('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6dbc('0x1'),_0x6dbc('0x2'),_0x6dbc('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6dbc('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 861ae44..78dc312 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 _0x2d6d=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','WhatsappTransferReport','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','type','key'];(function(_0x225df9,_0x2c7568){var _0x314f41=function(_0x456f1a){while(--_0x456f1a){_0x225df9['push'](_0x225df9['shift']());}};_0x314f41(++_0x2c7568);}(_0x2d6d,0x66));var _0xd2d6=function(_0x3cf5a3,_0x5a4492){_0x3cf5a3=_0x3cf5a3-0x0;var _0x39ba2d=_0x2d6d[_0x3cf5a3];return _0x39ba2d;};'use strict';var emlformat=require(_0xd2d6('0x0'));var rimraf=require(_0xd2d6('0x1'));var zipdir=require(_0xd2d6('0x2'));var jsonpatch=require(_0xd2d6('0x3'));var rp=require(_0xd2d6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd2d6('0x5'));var util=require(_0xd2d6('0x6'));var path=require(_0xd2d6('0x7'));var sox=require(_0xd2d6('0x8'));var csv=require(_0xd2d6('0x9'));var ejs=require(_0xd2d6('0xa'));var fs=require('fs');var fs_extra=require(_0xd2d6('0xb'));var _=require(_0xd2d6('0xc'));var squel=require(_0xd2d6('0xd'));var crypto=require('crypto');var jsforce=require(_0xd2d6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd2d6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd2d6('0xf'));var authService=require(_0xd2d6('0x10'));var qs=require(_0xd2d6('0x11'));var as=require(_0xd2d6('0x12'));var hardwareService=require(_0xd2d6('0x13'));var logger=require(_0xd2d6('0x14'))(_0xd2d6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd2d6('0x16'));var db=require(_0xd2d6('0x17'))['db'];function respondWithStatusCode(_0x43dbae,_0x199206){_0x199206=_0x199206||0xcc;return function(_0x38a8be){if(_0x38a8be){return _0x43dbae[_0xd2d6('0x18')](_0x199206);}return _0x43dbae['status'](_0x199206)[_0xd2d6('0x19')]();};}function respondWithResult(_0x1ed2e8,_0xb0a34){_0xb0a34=_0xb0a34||0xc8;return function(_0x439e3d){if(_0x439e3d){return _0x1ed2e8['status'](_0xb0a34)['json'](_0x439e3d);}};}function respondWithFilteredResult(_0x37a6bc,_0x352619){return function(_0x2a4b1a){if(_0x2a4b1a){var _0x8ba7fb=typeof _0x352619[_0xd2d6('0x1a')]===_0xd2d6('0x1b')&&typeof _0x352619['limit']===_0xd2d6('0x1b');var _0x57a7ea=_0x2a4b1a['count'];var _0x568aff=_0x8ba7fb?0x0:_0x352619[_0xd2d6('0x1a')];var _0x322a52=_0x8ba7fb?_0x2a4b1a[_0xd2d6('0x1c')]:_0x352619[_0xd2d6('0x1a')]+_0x352619['limit'];var _0x2d3bcb;if(_0x322a52>=_0x57a7ea){_0x322a52=_0x57a7ea;_0x2d3bcb=0xc8;}else{_0x2d3bcb=0xce;}_0x37a6bc[_0xd2d6('0x1d')](_0x2d3bcb);return _0x37a6bc['set'](_0xd2d6('0x1e'),_0x568aff+'-'+_0x322a52+'/'+_0x57a7ea)[_0xd2d6('0x1f')](_0x2a4b1a);}return null;};}function patchUpdates(_0x4313ae){return function(_0x5666e9){try{jsonpatch[_0xd2d6('0x20')](_0x5666e9,_0x4313ae,!![]);}catch(_0x213e96){return BPromise[_0xd2d6('0x21')](_0x213e96);}return _0x5666e9['save']();};}function saveUpdates(_0x39d3f0,_0x2422c0){return function(_0x5d4f17){if(_0x5d4f17){return _0x5d4f17[_0xd2d6('0x22')](_0x39d3f0)[_0xd2d6('0x23')](function(_0x485ea5){return _0x485ea5;});}return null;};}function removeEntity(_0x47f7a1,_0x1f296e){return function(_0x50544a){if(_0x50544a){return _0x50544a[_0xd2d6('0x24')]()[_0xd2d6('0x23')](function(){_0x47f7a1[_0xd2d6('0x1d')](0xcc)[_0xd2d6('0x19')]();});}};}function handleEntityNotFound(_0x4f52bb,_0x270934){return function(_0x36c70c){if(!_0x36c70c){_0x4f52bb[_0xd2d6('0x18')](0x194);}return _0x36c70c;};}function handleError(_0xb0550d,_0x4ef679){_0x4ef679=_0x4ef679||0x1f4;return function(_0x2e18fd){logger[_0xd2d6('0x25')](_0x2e18fd[_0xd2d6('0x26')]);if(_0x2e18fd[_0xd2d6('0x27')]){delete _0x2e18fd['name'];}_0xb0550d[_0xd2d6('0x1d')](_0x4ef679)['send'](_0x2e18fd);};}exports[_0xd2d6('0x28')]=function(_0x4c1828,_0x8f3083){var _0x88566d={},_0x3b3f81={},_0x3138ad={'count':0x0,'rows':[]};var _0x7784c9=_[_0xd2d6('0x29')](db['WhatsappTransferReport']['rawAttributes'],function(_0x26c198){return{'name':_0x26c198['fieldName'],'type':_0x26c198[_0xd2d6('0x2a')][_0xd2d6('0x2b')]};});_0x3b3f81[_0xd2d6('0x2c')]=_['map'](_0x7784c9,'name');_0x3b3f81[_0xd2d6('0x2d')]=_[_0xd2d6('0x2e')](_0x4c1828['query']);_0x3b3f81[_0xd2d6('0x2f')]=_[_0xd2d6('0x30')](_0x3b3f81[_0xd2d6('0x2c')],_0x3b3f81['query']);_0x88566d['attributes']=_['intersection'](_0x3b3f81[_0xd2d6('0x2c')],qs[_0xd2d6('0x31')](_0x4c1828['query'][_0xd2d6('0x31')]));_0x88566d[_0xd2d6('0x32')]=_0x88566d[_0xd2d6('0x32')][_0xd2d6('0x33')]?_0x88566d[_0xd2d6('0x32')]:_0x3b3f81[_0xd2d6('0x2c')];if(!_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x34')](_0xd2d6('0x35'))){_0x88566d[_0xd2d6('0x36')]=qs[_0xd2d6('0x36')](_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x36')]);_0x88566d[_0xd2d6('0x1a')]=qs[_0xd2d6('0x1a')](_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x1a')]);}_0x88566d[_0xd2d6('0x37')]=qs[_0xd2d6('0x38')](_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x38')]);_0x88566d[_0xd2d6('0x39')]=qs[_0xd2d6('0x2f')](_['pick'](_0x4c1828[_0xd2d6('0x2d')],_0x3b3f81['filters']),_0x7784c9);if(_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x3a')]){_0x88566d[_0xd2d6('0x39')]=_['merge'](_0x88566d[_0xd2d6('0x39')],{'$or':_[_0xd2d6('0x29')](_0x7784c9,function(_0x3252c8){if(_0x3252c8[_0xd2d6('0x2a')]!=='VIRTUAL'){var _0x3d2414={};_0x3d2414[_0x3252c8[_0xd2d6('0x27')]]={'$like':'%'+_0x4c1828[_0xd2d6('0x2d')][_0xd2d6('0x3a')]+'%'};return _0x3d2414;}})});}_0x88566d=_[_0xd2d6('0x3b')]({},_0x88566d,_0x4c1828['options']);var _0x9e0db2={'where':_0x88566d['where']};return db[_0xd2d6('0x3c')]['count'](_0x9e0db2)['then'](function(_0x1e2f05){_0x3138ad[_0xd2d6('0x1c')]=_0x1e2f05;if(_0x4c1828['query'][_0xd2d6('0x3d')]){_0x88566d[_0xd2d6('0x3e')]=[{'all':!![]}];}return db[_0xd2d6('0x3c')]['findAll'](_0x88566d);})[_0xd2d6('0x23')](function(_0x5baf88){_0x3138ad[_0xd2d6('0x3f')]=_0x5baf88;return _0x3138ad;})[_0xd2d6('0x23')](respondWithFilteredResult(_0x8f3083,_0x88566d))[_0xd2d6('0x40')](handleError(_0x8f3083,null));};exports[_0xd2d6('0x41')]=function(_0x4feac5,_0x55b19a){var _0x28f2a6={'raw':!![],'where':{'id':_0x4feac5[_0xd2d6('0x42')]['id']}},_0x18ed22={};_0x18ed22['model']=_['keys'](db[_0xd2d6('0x3c')][_0xd2d6('0x43')]);_0x18ed22[_0xd2d6('0x2d')]=_['keys'](_0x4feac5['query']);_0x18ed22['filters']=_[_0xd2d6('0x30')](_0x18ed22[_0xd2d6('0x2c')],_0x18ed22['query']);_0x28f2a6['attributes']=_[_0xd2d6('0x30')](_0x18ed22['model'],qs[_0xd2d6('0x31')](_0x4feac5[_0xd2d6('0x2d')][_0xd2d6('0x31')]));_0x28f2a6[_0xd2d6('0x32')]=_0x28f2a6[_0xd2d6('0x32')][_0xd2d6('0x33')]?_0x28f2a6['attributes']:_0x18ed22[_0xd2d6('0x2c')];if(_0x4feac5[_0xd2d6('0x2d')]['includeAll']){_0x28f2a6[_0xd2d6('0x3e')]=[{'all':!![]}];}_0x28f2a6=_[_0xd2d6('0x3b')]({},_0x28f2a6,_0x4feac5[_0xd2d6('0x44')]);return db[_0xd2d6('0x3c')][_0xd2d6('0x45')](_0x28f2a6)[_0xd2d6('0x23')](handleEntityNotFound(_0x55b19a,null))[_0xd2d6('0x23')](respondWithResult(_0x55b19a,null))[_0xd2d6('0x40')](handleError(_0x55b19a,null));};exports[_0xd2d6('0x46')]=function(_0x48e7c9,_0x2720b0){return db['WhatsappTransferReport']['create'](_0x48e7c9[_0xd2d6('0x47')],{})[_0xd2d6('0x23')](respondWithResult(_0x2720b0,0xc9))[_0xd2d6('0x40')](handleError(_0x2720b0,null));};exports[_0xd2d6('0x22')]=function(_0x3c3db5,_0x1e30b2){if(_0x3c3db5[_0xd2d6('0x47')]['id']){delete _0x3c3db5[_0xd2d6('0x47')]['id'];}return db[_0xd2d6('0x3c')][_0xd2d6('0x45')]({'where':{'id':_0x3c3db5[_0xd2d6('0x42')]['id']}})[_0xd2d6('0x23')](handleEntityNotFound(_0x1e30b2,null))[_0xd2d6('0x23')](saveUpdates(_0x3c3db5[_0xd2d6('0x47')],null))[_0xd2d6('0x23')](respondWithResult(_0x1e30b2,null))[_0xd2d6('0x40')](handleError(_0x1e30b2,null));};exports['destroy']=function(_0x1ae825,_0x268e50){return db[_0xd2d6('0x3c')][_0xd2d6('0x45')]({'where':{'id':_0x1ae825['params']['id']}})[_0xd2d6('0x23')](handleEntityNotFound(_0x268e50,null))[_0xd2d6('0x23')](removeEntity(_0x268e50,null))[_0xd2d6('0x40')](handleError(_0x268e50,null));};exports[_0xd2d6('0x48')]=function(_0x570d20,_0xdb268d){return db[_0xd2d6('0x3c')][_0xd2d6('0x48')]()[_0xd2d6('0x23')](respondWithResult(_0xdb268d,null))['catch'](handleError(_0xdb268d,null));}; \ No newline at end of file +var _0x458d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x1f2a24,_0x551eae){var _0x1a9f5f=function(_0x3af021){while(--_0x3af021){_0x1f2a24['push'](_0x1f2a24['shift']());}};_0x1a9f5f(++_0x551eae);}(_0x458d,0xe2));var _0xd458=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x458d[_0x47aa64];return _0x549c7a;};'use strict';var emlformat=require(_0xd458('0x0'));var rimraf=require(_0xd458('0x1'));var zipdir=require(_0xd458('0x2'));var jsonpatch=require(_0xd458('0x3'));var rp=require(_0xd458('0x4'));var moment=require('moment');var BPromise=require(_0xd458('0x5'));var Mustache=require(_0xd458('0x6'));var util=require(_0xd458('0x7'));var path=require(_0xd458('0x8'));var sox=require(_0xd458('0x9'));var csv=require(_0xd458('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd458('0xb'));var _=require(_0xd458('0xc'));var squel=require('squel');var crypto=require(_0xd458('0xd'));var jsforce=require(_0xd458('0xe'));var deskjs=require(_0xd458('0xf'));var toCsv=require(_0xd458('0xa'));var querystring=require(_0xd458('0x10'));var Papa=require(_0xd458('0x11'));var Redis=require('ioredis');var authService=require(_0xd458('0x12'));var qs=require(_0xd458('0x13'));var as=require(_0xd458('0x14'));var hardwareService=require(_0xd458('0x15'));var logger=require(_0xd458('0x16'))(_0xd458('0x17'));var utils=require(_0xd458('0x18'));var config=require(_0xd458('0x19'));var licenseUtil=require(_0xd458('0x1a'));var db=require(_0xd458('0x1b'))['db'];function respondWithStatusCode(_0x140b64,_0x4abdc1){_0x4abdc1=_0x4abdc1||0xcc;return function(_0x2cbc2c){if(_0x2cbc2c){return _0x140b64[_0xd458('0x1c')](_0x4abdc1);}return _0x140b64[_0xd458('0x1d')](_0x4abdc1)['end']();};}function respondWithResult(_0x3f6e24,_0x1f2f10){_0x1f2f10=_0x1f2f10||0xc8;return function(_0x46f273){if(_0x46f273){return _0x3f6e24[_0xd458('0x1d')](_0x1f2f10)['json'](_0x46f273);}};}function respondWithFilteredResult(_0x1532ad,_0x553e8c){return function(_0x4701d0){if(_0x4701d0){var _0x37fb1e=typeof _0x553e8c[_0xd458('0x1e')]===_0xd458('0x1f')&&typeof _0x553e8c[_0xd458('0x20')]===_0xd458('0x1f');var _0x176cca=_0x4701d0[_0xd458('0x21')];var _0x3056de=_0x37fb1e?0x0:_0x553e8c[_0xd458('0x1e')];var _0x40ec7b=_0x37fb1e?_0x4701d0[_0xd458('0x21')]:_0x553e8c[_0xd458('0x1e')]+_0x553e8c['limit'];var _0x85957d;if(_0x40ec7b>=_0x176cca){_0x40ec7b=_0x176cca;_0x85957d=0xc8;}else{_0x85957d=0xce;}_0x1532ad['status'](_0x85957d);return _0x1532ad[_0xd458('0x22')](_0xd458('0x23'),_0x3056de+'-'+_0x40ec7b+'/'+_0x176cca)[_0xd458('0x24')](_0x4701d0);}return null;};}function patchUpdates(_0x59355f){return function(_0x460d4b){try{jsonpatch[_0xd458('0x25')](_0x460d4b,_0x59355f,!![]);}catch(_0x1fcb5c){return BPromise['reject'](_0x1fcb5c);}return _0x460d4b[_0xd458('0x26')]();};}function saveUpdates(_0x155489,_0x3ff7f6){return function(_0x35b0ce){if(_0x35b0ce){return _0x35b0ce['update'](_0x155489)['then'](function(_0x37f74c){return _0x37f74c;});}return null;};}function removeEntity(_0x476b45,_0x1ab4ca){return function(_0x5fec86){if(_0x5fec86){return _0x5fec86['destroy']()[_0xd458('0x27')](function(){_0x476b45[_0xd458('0x1d')](0xcc)[_0xd458('0x28')]();});}};}function handleEntityNotFound(_0x80304f,_0x177065){return function(_0x1af804){if(!_0x1af804){_0x80304f['sendStatus'](0x194);}return _0x1af804;};}function handleError(_0x3bcf27,_0x22bb0f){_0x22bb0f=_0x22bb0f||0x1f4;return function(_0x39c13f){logger[_0xd458('0x29')](_0x39c13f[_0xd458('0x2a')]);if(_0x39c13f[_0xd458('0x2b')]){delete _0x39c13f['name'];}_0x3bcf27[_0xd458('0x1d')](_0x22bb0f)[_0xd458('0x2c')](_0x39c13f);};}exports[_0xd458('0x2d')]=function(_0x1832e1,_0x379b55){var _0x2dbe13={},_0x5b0f4b={},_0x3f0835={'count':0x0,'rows':[]};var _0x6808e5=_[_0xd458('0x2e')](db[_0xd458('0x2f')][_0xd458('0x30')],function(_0x1a989f){return{'name':_0x1a989f[_0xd458('0x31')],'type':_0x1a989f[_0xd458('0x32')][_0xd458('0x33')]};});_0x5b0f4b[_0xd458('0x34')]=_[_0xd458('0x2e')](_0x6808e5,_0xd458('0x2b'));_0x5b0f4b[_0xd458('0x35')]=_[_0xd458('0x36')](_0x1832e1['query']);_0x5b0f4b[_0xd458('0x37')]=_[_0xd458('0x38')](_0x5b0f4b['model'],_0x5b0f4b[_0xd458('0x35')]);_0x2dbe13['attributes']=_['intersection'](_0x5b0f4b[_0xd458('0x34')],qs['fields'](_0x1832e1['query'][_0xd458('0x39')]));_0x2dbe13[_0xd458('0x3a')]=_0x2dbe13['attributes'][_0xd458('0x3b')]?_0x2dbe13[_0xd458('0x3a')]:_0x5b0f4b['model'];if(!_0x1832e1['query'][_0xd458('0x3c')](_0xd458('0x3d'))){_0x2dbe13[_0xd458('0x20')]=qs[_0xd458('0x20')](_0x1832e1['query'][_0xd458('0x20')]);_0x2dbe13[_0xd458('0x1e')]=qs[_0xd458('0x1e')](_0x1832e1[_0xd458('0x35')][_0xd458('0x1e')]);}_0x2dbe13['order']=qs[_0xd458('0x3e')](_0x1832e1[_0xd458('0x35')][_0xd458('0x3e')]);_0x2dbe13['where']=qs[_0xd458('0x37')](_[_0xd458('0x3f')](_0x1832e1[_0xd458('0x35')],_0x5b0f4b[_0xd458('0x37')]),_0x6808e5);if(_0x1832e1[_0xd458('0x35')][_0xd458('0x40')]){_0x2dbe13[_0xd458('0x41')]=_[_0xd458('0x42')](_0x2dbe13['where'],{'$or':_[_0xd458('0x2e')](_0x6808e5,function(_0x91c49c){if(_0x91c49c[_0xd458('0x32')]!==_0xd458('0x43')){var _0x389690={};_0x389690[_0x91c49c[_0xd458('0x2b')]]={'$like':'%'+_0x1832e1[_0xd458('0x35')][_0xd458('0x40')]+'%'};return _0x389690;}})});}_0x2dbe13=_['merge']({},_0x2dbe13,_0x1832e1[_0xd458('0x44')]);var _0x5313e1={'where':_0x2dbe13['where']};return db[_0xd458('0x2f')]['count'](_0x5313e1)[_0xd458('0x27')](function(_0x2a4748){_0x3f0835[_0xd458('0x21')]=_0x2a4748;if(_0x1832e1[_0xd458('0x35')][_0xd458('0x45')]){_0x2dbe13[_0xd458('0x46')]=[{'all':!![]}];}return db[_0xd458('0x2f')][_0xd458('0x47')](_0x2dbe13);})[_0xd458('0x27')](function(_0x36e102){_0x3f0835[_0xd458('0x48')]=_0x36e102;return _0x3f0835;})[_0xd458('0x27')](respondWithFilteredResult(_0x379b55,_0x2dbe13))[_0xd458('0x49')](handleError(_0x379b55,null));};exports[_0xd458('0x4a')]=function(_0x124a69,_0x21a5a5){var _0x24520c={'raw':!![],'where':{'id':_0x124a69[_0xd458('0x4b')]['id']}},_0x2443a5={};_0x2443a5['model']=_[_0xd458('0x36')](db[_0xd458('0x2f')]['rawAttributes']);_0x2443a5[_0xd458('0x35')]=_[_0xd458('0x36')](_0x124a69['query']);_0x2443a5[_0xd458('0x37')]=_['intersection'](_0x2443a5['model'],_0x2443a5[_0xd458('0x35')]);_0x24520c[_0xd458('0x3a')]=_[_0xd458('0x38')](_0x2443a5[_0xd458('0x34')],qs[_0xd458('0x39')](_0x124a69[_0xd458('0x35')][_0xd458('0x39')]));_0x24520c[_0xd458('0x3a')]=_0x24520c[_0xd458('0x3a')][_0xd458('0x3b')]?_0x24520c[_0xd458('0x3a')]:_0x2443a5[_0xd458('0x34')];if(_0x124a69[_0xd458('0x35')]['includeAll']){_0x24520c[_0xd458('0x46')]=[{'all':!![]}];}_0x24520c=_[_0xd458('0x42')]({},_0x24520c,_0x124a69[_0xd458('0x44')]);return db['WhatsappTransferReport']['find'](_0x24520c)['then'](handleEntityNotFound(_0x21a5a5,null))[_0xd458('0x27')](respondWithResult(_0x21a5a5,null))[_0xd458('0x49')](handleError(_0x21a5a5,null));};exports[_0xd458('0x4c')]=function(_0x5846bc,_0xc21678){return db['WhatsappTransferReport'][_0xd458('0x4c')](_0x5846bc[_0xd458('0x4d')],{})['then'](respondWithResult(_0xc21678,0xc9))['catch'](handleError(_0xc21678,null));};exports[_0xd458('0x4e')]=function(_0x1c2046,_0x4fcca2){if(_0x1c2046[_0xd458('0x4d')]['id']){delete _0x1c2046[_0xd458('0x4d')]['id'];}return db[_0xd458('0x2f')][_0xd458('0x4f')]({'where':{'id':_0x1c2046[_0xd458('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fcca2,null))[_0xd458('0x27')](saveUpdates(_0x1c2046[_0xd458('0x4d')],null))[_0xd458('0x27')](respondWithResult(_0x4fcca2,null))[_0xd458('0x49')](handleError(_0x4fcca2,null));};exports[_0xd458('0x50')]=function(_0x2a4570,_0x1035ff){return db[_0xd458('0x2f')][_0xd458('0x4f')]({'where':{'id':_0x2a4570[_0xd458('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1035ff,null))[_0xd458('0x27')](removeEntity(_0x1035ff,null))[_0xd458('0x49')](handleError(_0x1035ff,null));};exports[_0xd458('0x51')]=function(_0x182bdc,_0x8e27de){return db['WhatsappTransferReport']['describe']()['then'](respondWithResult(_0x8e27de,null))[_0xd458('0x49')](handleError(_0x8e27de,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 56136e6..eb334e3 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 _0x02b4=['uniqueid','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x294985,_0x4171d8){var _0x14494b=function(_0x8cc2a5){while(--_0x8cc2a5){_0x294985['push'](_0x294985['shift']());}};_0x14494b(++_0x4171d8);}(_0x02b4,0x91));var _0x402b=function(_0x317f80,_0x2ec2b3){_0x317f80=_0x317f80-0x0;var _0x13b391=_0x02b4[_0x317f80];return _0x13b391;};'use strict';var _=require('lodash');var util=require(_0x402b('0x0'));var logger=require('../../config/logger')(_0x402b('0x1'));var moment=require(_0x402b('0x2'));var BPromise=require(_0x402b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x402b('0x4'));var rimraf=require(_0x402b('0x5'));var config=require(_0x402b('0x6'));var attributes=require(_0x402b('0x7'));module[_0x402b('0x8')]=function(_0x5f3946,_0x3b1153){return _0x5f3946[_0x402b('0x9')](_0x402b('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x402b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31ac=['uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappTransferReport'];(function(_0x560b33,_0x54a69c){var _0x15c35e=function(_0x58d087){while(--_0x58d087){_0x560b33['push'](_0x560b33['shift']());}};_0x15c35e(++_0x54a69c);}(_0x31ac,0x64));var _0xc31a=function(_0x32171e,_0x2a2a78){_0x32171e=_0x32171e-0x0;var _0x396dd3=_0x31ac[_0x32171e];return _0x396dd3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc31a('0x0'))(_0xc31a('0x1'));var moment=require(_0xc31a('0x2'));var BPromise=require(_0xc31a('0x3'));var rp=require(_0xc31a('0x4'));var fs=require('fs');var path=require(_0xc31a('0x5'));var rimraf=require(_0xc31a('0x6'));var config=require(_0xc31a('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xc31a('0x8')]=function(_0x59eeab,_0x329daf){return _0x59eeab['define'](_0xc31a('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xc31a('0xa'),'fields':[_0xc31a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8579d47..98709b3 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 _0x78bc=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird'];(function(_0x539840,_0x55c212){var _0x245439=function(_0x1bc4da){while(--_0x1bc4da){_0x539840['push'](_0x539840['shift']());}};_0x245439(++_0x55c212);}(_0x78bc,0xee));var _0xc78b=function(_0x79ea1e,_0x21c274){_0x79ea1e=_0x79ea1e-0x0;var _0x1845e5=_0x78bc[_0x79ea1e];return _0x1845e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc78b('0x0'));var BPromise=require(_0xc78b('0x1'));var rs=require(_0xc78b('0x2'));var fs=require('fs');var Redis=require(_0xc78b('0x3'));var db=require(_0xc78b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc78b('0x5'))(_0xc78b('0x6'));var config=require(_0xc78b('0x7'));var jayson=require(_0xc78b('0x8'));var client=jayson[_0xc78b('0x9')][_0xc78b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x256da8,_0x900c46,_0x8d1c04){return new BPromise(function(_0x9b9d62,_0x48ed46){return client[_0xc78b('0xb')](_0x256da8,_0x8d1c04)[_0xc78b('0xc')](function(_0x43967e){logger[_0xc78b('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0xc78b('0xe'));logger[_0xc78b('0xf')](_0xc78b('0x10'),_0x900c46,_0xc78b('0xe'),JSON[_0xc78b('0x11')](_0x43967e));if(_0x43967e[_0xc78b('0x12')]){if(_0x43967e['error'][_0xc78b('0x13')]===0x1f4){logger[_0xc78b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);return _0x48ed46(_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);}logger[_0xc78b('0x12')](_0xc78b('0x15'),_0x900c46,_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);return _0x9b9d62(_0x43967e[_0xc78b('0x12')][_0xc78b('0x14')]);}else{logger[_0xc78b('0xd')](_0xc78b('0x15'),_0x900c46,_0xc78b('0xe'));_0x9b9d62(_0x43967e[_0xc78b('0x16')]['message']);}})[_0xc78b('0x17')](function(_0x474608){logger[_0xc78b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x900c46,_0x474608);_0x48ed46(_0x474608);});});} \ No newline at end of file +var _0x71bd=['client','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52bfa5,_0x42cf21){var _0x26f80b=function(_0x73c5b0){while(--_0x73c5b0){_0x52bfa5['push'](_0x52bfa5['shift']());}};_0x26f80b(++_0x42cf21);}(_0x71bd,0x185));var _0xd71b=function(_0x17e284,_0x4f32c6){_0x17e284=_0x17e284-0x0;var _0x51581d=_0x71bd[_0x17e284];return _0x51581d;};'use strict';var _=require(_0xd71b('0x0'));var util=require(_0xd71b('0x1'));var moment=require('moment');var BPromise=require(_0xd71b('0x2'));var rs=require(_0xd71b('0x3'));var fs=require('fs');var Redis=require(_0xd71b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd71b('0x5'));var logger=require(_0xd71b('0x6'))(_0xd71b('0x7'));var config=require(_0xd71b('0x8'));var jayson=require(_0xd71b('0x9'));var client=jayson[_0xd71b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43c095,_0xcbb112,_0x41eb4e){return new BPromise(function(_0x2a8abe,_0x2556cb){return client['request'](_0x43c095,_0x41eb4e)[_0xd71b('0xb')](function(_0x5cf70e){logger[_0xd71b('0xc')](_0xd71b('0xd'),_0xcbb112,_0xd71b('0xe'));logger['debug'](_0xd71b('0xf'),_0xcbb112,_0xd71b('0xe'),JSON[_0xd71b('0x10')](_0x5cf70e));if(_0x5cf70e[_0xd71b('0x11')]){if(_0x5cf70e[_0xd71b('0x11')]['code']===0x1f4){logger[_0xd71b('0x11')](_0xd71b('0xd'),_0xcbb112,_0x5cf70e[_0xd71b('0x11')][_0xd71b('0x12')]);return _0x2556cb(_0x5cf70e[_0xd71b('0x11')]['message']);}logger['error'](_0xd71b('0xd'),_0xcbb112,_0x5cf70e[_0xd71b('0x11')][_0xd71b('0x12')]);return _0x2a8abe(_0x5cf70e['error'][_0xd71b('0x12')]);}else{logger[_0xd71b('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0xcbb112,_0xd71b('0xe'));_0x2a8abe(_0x5cf70e[_0xd71b('0x13')][_0xd71b('0x12')]);}})[_0xd71b('0x14')](function(_0x399312){logger['error'](_0xd71b('0xd'),_0xcbb112,_0x399312);_0x2556cb(_0x399312);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index ea3eac2..fe10af0 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5294=['map','pm2_env','name','Online\x20apps:','filter','join','Offline\x20apps:','status','online','None','log','catch','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20'];(function(_0x2e11ab,_0x4e146e){var _0x1dd724=function(_0x4c6abb){while(--_0x4c6abb){_0x2e11ab['push'](_0x2e11ab['shift']());}};_0x1dd724(++_0x4e146e);}(_0x5294,0x111));var _0x4529=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x5294[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x4529('0x0'));var db=require(_0x4529('0x1'))['db'];var seedDb=require(_0x4529('0x2'));var checkLicense=require(_0x4529('0x3'));var rpc=require(_0x4529('0x4'));var config=require(_0x4529('0x5'));var logger=require('./config/logger')(_0x4529('0x6'));var pm2=require(_0x4529('0x7'));var pm2Config=require(_0x4529('0x8'));var schedule=require('./config/schedule');var chat=require(_0x4529('0x9'));var whatsapp=require(_0x4529('0xa'));var transcribe=require(_0x4529('0xb'));var provider=require(_0x4529('0xc'));function main(){return db['sequelize'][_0x4529('0xd')]()[_0x4529('0xe')](function(){if(config[_0x4529('0xf')]){return seedDb['default']();}})['then'](function(){return checkLicense['default']();})[_0x4529('0xe')](function(){return rpc[_0x4529('0x10')]();})[_0x4529('0xe')](function(_0x579574){logger[_0x4529('0x11')](_0x579574);return chat[_0x4529('0x12')]();})[_0x4529('0xe')](function(){return whatsapp[_0x4529('0x12')]();})[_0x4529('0xe')](function(){return schedule[_0x4529('0x12')]();})['then'](function(){return transcribe['start']();})[_0x4529('0xe')](function(){return provider[_0x4529('0x12')]();})['then'](function(_0x2539ea){logger['info'](_0x2539ea);return pm2[_0x4529('0x12')](pm2Config);})[_0x4529('0xe')](function(_0x19dff1){var _0x3313e0=_0x19dff1['filter'](function(_0x3fa1a0){return typeof _0x3fa1a0[_0x4529('0x13')]===_0x4529('0x14')&&_0x3fa1a0['exitCode']>=0x0;});if(_0x3313e0[_0x4529('0x15')]>0x0){throw new Error(_0x3313e0[_0x4529('0x15')]+_0x4529('0x16')+_[_0x4529('0x17')](_0x3313e0,function(_0x4e17dd){return'\x22'+_0x4e17dd[_0x4529('0x18')][_0x4529('0x19')]+'\x22';}));}logger['info'](_0x4529('0x1a'),_[_0x4529('0x17')](_[_0x4529('0x1b')](_0x19dff1,{'status':'online'}),'name')[_0x4529('0x1c')]());logger[_0x4529('0x11')](_0x4529('0x1d'),_[_0x4529('0x17')](_[_0x4529('0x1b')](_0x19dff1,function(_0x5c7e39){return _0x5c7e39[_0x4529('0x1e')]!==_0x4529('0x1f');}),_0x4529('0x19'))[_0x4529('0x1c')]()||_0x4529('0x20'));console[_0x4529('0x21')]('App\x20Ready!');})[_0x4529('0x22')](function(_0xee9870){console[_0x4529('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0xee9870);logger[_0x4529('0x23')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xee9870);process[_0x4529('0x24')](0x1);});}main(); \ No newline at end of file +var _0x818f=['App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','join','status','online','None'];(function(_0x578718,_0x2ee959){var _0x972321=function(_0x3eba64){while(--_0x3eba64){_0x578718['push'](_0x578718['shift']());}};_0x972321(++_0x2ee959);}(_0x818f,0x1da));var _0xf818=function(_0x250347,_0x1c1403){_0x250347=_0x250347-0x0;var _0x5e5d40=_0x818f[_0x250347];return _0x5e5d40;};'use strict';var _=require(_0xf818('0x0'));var db=require(_0xf818('0x1'))['db'];var seedDb=require(_0xf818('0x2'));var checkLicense=require(_0xf818('0x3'));var rpc=require(_0xf818('0x4'));var config=require(_0xf818('0x5'));var logger=require('./config/logger')(_0xf818('0x6'));var pm2=require(_0xf818('0x7'));var pm2Config=require(_0xf818('0x8'));var schedule=require(_0xf818('0x9'));var chat=require(_0xf818('0xa'));var whatsapp=require(_0xf818('0xb'));var transcribe=require(_0xf818('0xc'));var provider=require(_0xf818('0xd'));function main(){return db[_0xf818('0xe')]['sync']()[_0xf818('0xf')](function(){if(config[_0xf818('0x10')]){return seedDb[_0xf818('0x11')]();}})['then'](function(){return checkLicense['default']();})[_0xf818('0xf')](function(){return rpc[_0xf818('0x12')]();})[_0xf818('0xf')](function(_0x3386f9){logger[_0xf818('0x13')](_0x3386f9);return chat['start']();})[_0xf818('0xf')](function(){return whatsapp[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return schedule[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return transcribe['start']();})['then'](function(){return provider[_0xf818('0x14')]();})[_0xf818('0xf')](function(_0x950109){logger[_0xf818('0x13')](_0x950109);return pm2['start'](pm2Config);})[_0xf818('0xf')](function(_0x3234c5){var _0xbc3568=_0x3234c5[_0xf818('0x15')](function(_0xbfdd71){return typeof _0xbfdd71['exitCode']==='number'&&_0xbfdd71[_0xf818('0x16')]>=0x0;});if(_0xbc3568['length']>0x0){throw new Error(_0xbc3568[_0xf818('0x17')]+_0xf818('0x18')+_['map'](_0xbc3568,function(_0x2bf9f3){return'\x22'+_0x2bf9f3[_0xf818('0x19')][_0xf818('0x1a')]+'\x22';}));}logger['info'](_0xf818('0x1b'),_[_0xf818('0x1c')](_[_0xf818('0x15')](_0x3234c5,{'status':'online'}),'name')[_0xf818('0x1d')]());logger[_0xf818('0x13')]('Offline\x20apps:',_[_0xf818('0x1c')](_['filter'](_0x3234c5,function(_0x1849bf){return _0x1849bf[_0xf818('0x1e')]!==_0xf818('0x1f');}),'name')[_0xf818('0x1d')]()||_0xf818('0x20'));console['log'](_0xf818('0x21'));})[_0xf818('0x22')](function(_0x1160f4){console[_0xf818('0x23')](_0xf818('0x24'),_0x1160f4);logger[_0xf818('0x25')](_0xf818('0x26'),_0x1160f4);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 e3a3fc3..df618bb 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 _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x56e2f4,_0x1b6fd1){var _0x12d567=function(_0x1195c4){while(--_0x1195c4){_0x56e2f4['push'](_0x56e2f4['shift']());}};_0x12d567(++_0x1b6fd1);}(_0xa41a,0x6b));var _0xaa41=function(_0x120a9d,_0x3352f4){_0x120a9d=_0x120a9d-0x0;var _0x5b6951=_0xa41a[_0x120a9d];return _0x5b6951;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file +var _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x13bde9,_0x978600){var _0x4c0f0c=function(_0x43007a){while(--_0x43007a){_0x13bde9['push'](_0x13bde9['shift']());}};_0x4c0f0c(++_0x978600);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4c9f70,_0x53990b){_0x4c9f70=_0x4c9f70-0x0;var _0x3b1dd9=_0xf3cd[_0x4c9f70];return _0x3b1dd9;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index c9c8826..d0449a8 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x55485f,_0x5a6bf5){var _0x220ee1=function(_0x345b08){while(--_0x345b08){_0x55485f['push'](_0x55485f['shift']());}};_0x220ee1(++_0x5a6bf5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x614ef4,_0x28a060){_0x614ef4=_0x614ef4-0x0;var _0x35e8e2=_0x0b0e[_0x614ef4];return _0x35e8e2;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file +var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x18a0df,_0x2f7150){var _0x5438f1=function(_0x1f33b5){while(--_0x1f33b5){_0x18a0df['push'](_0x18a0df['shift']());}};_0x5438f1(++_0x2f7150);}(_0x0b0e,0x187));var _0xe0b0=function(_0x38b8c6,_0x541f91){_0x38b8c6=_0x38b8c6-0x0;var _0x3104d6=_0x0b0e[_0x38b8c6];return _0x3104d6;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 62af393..e46e5ec 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa588=['QueryTypes','SELECT','CmContact','query','Tags','push','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','toString','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','CompanyId','deletedAt','TagIds','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','type','default','text','value','end','Tag','tags','ids','User','user','and','uc.UserId\x20=\x20?','keys','map','some','Contact','forEach','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','fields','clause','filter','then','agent','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','subqry.','DESC','findAll','color','keyBy'];(function(_0x54fda0,_0x15a3a7){var _0x1367da=function(_0x56e6d0){while(--_0x56e6d0){_0x54fda0['push'](_0x54fda0['shift']());}};_0x1367da(++_0x15a3a7);}(_0xa588,0xe1));var _0x8a58=function(_0x2ffad6,_0x137196){_0x2ffad6=_0x2ffad6-0x0;var _0x31cfaa=_0xa588[_0x2ffad6];return _0x31cfaa;};'use strict';var _=require('lodash');var squel=require(_0x8a58('0x0'));var as=require(_0x8a58('0x1'));var qs=require(_0x8a58('0x2'));var utils=require(_0x8a58('0x3'));var db=require(_0x8a58('0x4'))['db'];function skipContactsQuery(_0x2f8787,_0x40bfe3){var _0x88d792=![];if(_0x2f8787[_0x8a58('0x5')]==='agent'&&!_0x40bfe3[_0x8a58('0x6')]&&!_0x40bfe3[_0x8a58('0x7')]&&_0x40bfe3[_0x8a58('0x8')]!==_0x8a58('0x9')){_0x88d792=!![];}return _0x88d792;}function getContactsSubquery(){return squel[_0x8a58('0xa')]()[_0x8a58('0xb')](_0x8a58('0xc'),'c')[_0x8a58('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x336276,_0x39a20e){var _0x3e3cf0=_0x39a20e?'c':_0x8a58('0xe');_0x336276[_0x8a58('0xf')]('cm_user_has_contacts','uc',_0x8a58('0x10')+_0x3e3cf0+_0x8a58('0x11'))[_0x8a58('0xf')](_0x8a58('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x3e3cf0+'.id')[_0x8a58('0xf')]('tools_tags','t',_0x8a58('0x13'));return _0x336276;}function addFieldsToQuery(_0xc5d2fa,_0x4af5a9,_0xf98b8d,_0x15b0d2,_0x56a61d){var _0x3d40a5=_0x56a61d?'c':_0x8a58('0xe');if(!_0x4af5a9){_0x4af5a9=['id','firstName',_0x8a58('0x14'),_0x8a58('0x15'),_0x8a58('0x16'),_0x8a58('0x17'),_0x8a58('0x18'),_0x8a58('0x7'),_0x8a58('0x19'),'createdAt','updatedAt',_0x8a58('0x1a'),_0x8a58('0x1b')];}var _0x18a14d=_0xf98b8d&&_0x56a61d||!_0xf98b8d&&!_0x56a61d;if(_0x15b0d2){_0x18a14d=_0x15b0d2&&_0x56a61d||!_0x15b0d2&&!_0x56a61d;}_0x4af5a9['forEach'](function(_0x282f2d){if(_0x282f2d===_0x8a58('0x1b')){if(_0x18a14d){_0xc5d2fa['field'](_0x8a58('0x1c'),_0x282f2d);}else if(_0xf98b8d||_0x15b0d2){_0xc5d2fa[_0x8a58('0x1d')](_0x3d40a5+'.'+_0x282f2d);}}else{_0xc5d2fa[_0x8a58('0x1d')](_0x3d40a5+'.'+_0x282f2d);}});return _0xc5d2fa;}function getSqlClauses(){var _0x4038f8={'default':squel[_0x8a58('0x1e')](),'fields':squel[_0x8a58('0x1e')](),'filter':squel[_0x8a58('0x1e')](),'tags':{'clause':squel[_0x8a58('0x1e')](),'ids':null},'user':{'clause':squel[_0x8a58('0x1e')](),'skip':![]}};return _0x4038f8;}function parseTagParameter(_0xbf556a){var _0xb20cfe=squel[_0x8a58('0x1e')]();if(_0xbf556a){var _0x3758fa=utils[_0x8a58('0x1f')](_0xbf556a);_0x3758fa['forEach'](function(_0x2fdf20){_0xb20cfe['or'](_0x8a58('0x20'),'%,'+_0x2fdf20+',%');});}return _0xb20cfe;}function parseSearchFilter(_0x20a6c5){var _0x3f07ab=squel[_0x8a58('0x1e')]();if(_0x20a6c5){var _0x415946=_0x20a6c5[_0x8a58('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x415946[_0x8a58('0x22')]('\x20')[_0x8a58('0x23')]>0x1){_0x3f07ab['or'](_0x8a58('0x24'),qs[_0x8a58('0x25')](_0x415946),null);}else{if(qs['isNumeric'](_0x415946)){_0x3f07ab['or'](_0x8a58('0x26'),_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x27'),_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x28'),_0x415946+'%');_0x3f07ab['or']('c.fax\x20LIKE\x20?',_0x415946+'%');}else if(qs[_0x8a58('0x29')](_0x415946)){_0x3f07ab['or'](_0x8a58('0x2a'),_0x415946+'%');}else{_0x3f07ab['or'](_0x8a58('0x2b'),'%'+_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x2c'),'%'+_0x415946+'%');_0x3f07ab['or'](_0x8a58('0x2a'),'%'+_0x415946+'%');}}}return _0x3f07ab;}function parseAdvancedSearchFilter(_0x3e317f,_0x1a411a){var _0x4d5041=getSqlClauses();var _0x433060=as['parseSearch'](_0x3e317f);var _0x501aa1=_0x433060['sqlOperator'];for(var _0x4cfc96=0x0;_0x4cfc96<_0x433060['conditions'][_0x8a58('0x23')];_0x4cfc96++){var _0x175235=_0x433060[_0x8a58('0x2d')][_0x4cfc96];var _0x205b41='c';var _0x5dc010=_[_0x8a58('0x2e')](_0x1a411a,[_0x8a58('0x2f'),_0x175235[_0x8a58('0x1d')]]);if(_0x5dc010){if(_0x175235[_0x8a58('0x1d')]===_0x8a58('0x30')||_0x5dc010[_0x8a58('0x31')]===_0x8a58('0x32')){_0x175235[_0x8a58('0x33')]='DATE';}var _0x330e8a=as[_0x8a58('0x34')](_0x205b41,_0x5dc010[_0x8a58('0x35')],_0x175235);_0x4d5041[_0x8a58('0x36')][_0x501aa1](_0x330e8a[_0x8a58('0x37')],_0x330e8a[_0x8a58('0x38')]['start'],_0x330e8a[_0x8a58('0x38')][_0x8a58('0x39')]);}else{if(_0x175235[_0x8a58('0x1d')]===_0x8a58('0x3a')){var _0x21a9dd=_0x175235[_0x8a58('0x38')][_0x8a58('0x22')](',')['map'](function(_0x3d1fb0){return Number(_0x3d1fb0);});var _0x1692ef=parseTagParameter(_0x21a9dd);_0x4d5041[_0x8a58('0x3b')]['clause']['and'](_0x1692ef);_0x4d5041['tags'][_0x8a58('0x3c')]=_0x21a9dd;}else if(_0x175235[_0x8a58('0x1d')]===_0x8a58('0x3d')){_0x4d5041[_0x8a58('0x3e')]['clause'][_0x8a58('0x3f')](_0x8a58('0x40'),_0x175235[_0x8a58('0x38')]);_0x4d5041[_0x8a58('0x3e')]['skip']=!![];}}}return _0x4d5041;}function parseModelFields(_0x31463f,_0x2a7c70){var _0x5aad83=squel[_0x8a58('0x1e')]();var _0x196fee=_(_0x31463f)[_0x8a58('0x41')]()[_0x8a58('0x42')](function(_0x3ead70){return _[_0x8a58('0x43')](_0x2a7c70,['name',_0x3ead70])?_0x3ead70:undefined;})['compact']()[_0x8a58('0x38')]();if(_0x31463f[_0x8a58('0x44')]){_0x196fee['push'](_0x8a58('0x44'));}if(_0x196fee[_0x8a58('0x23')]>0x0){_0x196fee[_0x8a58('0x45')](function(_0x3dfd34){if(_0x3dfd34===_0x8a58('0x7')){_0x5aad83['and'](_0x8a58('0x46'),[]['concat'](_0x31463f[_0x3dfd34]));}else if(_0x3dfd34===_0x8a58('0x44')){var _0x1ef283='%'+_0x31463f[_0x3dfd34]+'%';_0x5aad83[_0x8a58('0x3f')](_0x8a58('0x47'),_0x1ef283);}else{_0x5aad83[_0x8a58('0x3f')]('c.'+_0x3dfd34+_0x8a58('0x48'),_0x31463f[_0x3dfd34]);}});}return _0x5aad83;}function parseQueryParameters(_0x126a4e,_0x4b2e04){var _0x5cd9d8=getSqlClauses();return Promise[_0x8a58('0x49')]()['then'](function(){return parseModelFields(_0x126a4e,_0x4b2e04);})['then'](function(_0xb9a9ba){_0x5cd9d8[_0x8a58('0x4a')][_0x8a58('0x3f')](_0xb9a9ba);return parseTagParameter(_0x126a4e['tag']);})['then'](function(_0x38357e){_0x5cd9d8['tags'][_0x8a58('0x4b')][_0x8a58('0x3f')](_0x38357e);return parseSearchFilter(_0x126a4e[_0x8a58('0x4c')]);})[_0x8a58('0x4d')](function(_0x4c9c56){_0x5cd9d8[_0x8a58('0x4c')]=_0x4c9c56;return _0x5cd9d8;});}function checkListsRestrictions(_0x42c89e,_0x4cd092,_0x39af37){var _0xba52de=squel[_0x8a58('0x1e')]();return Promise[_0x8a58('0x49')]()['then'](function(){if(_0x4cd092[_0x8a58('0x6')]&&_0x42c89e['role']===_0x8a58('0x4e')&&!_0x39af37){return _0x42c89e[_0x8a58('0x4f')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x218634){if(_0x218634){if(_0x218634['length']===0x0){_0xba52de['and'](_0x8a58('0x50'));}else{_0xba52de[_0x8a58('0x3f')](_0x8a58('0x46'),_[_0x8a58('0x42')](_0x218634,'id'));}}})[_0x8a58('0x4d')](function(){return _0xba52de;});}function buildContactsQuery(_0x44c8df,_0x507423,_0x4bfd66,_0x424207,_0x54e9db,_0x29c5f7){if(_0x507423){_0x507423=_0x4bfd66[_0x8a58('0x51')];}_0x44c8df=addFieldsToQuery(_0x44c8df,_0x507423,_0x424207,_0x29c5f7,!![]);var _0x1ec51b=squel[_0x8a58('0xa')]();_0x1ec51b=addFieldsToQuery(_0x1ec51b,_0x507423,_0x424207,_0x29c5f7,![]);if(_0x424207||_0x29c5f7){_0x44c8df=applyJoinClauses(_0x44c8df,!![]);_0x44c8df[_0x8a58('0x52')](_0x8a58('0x53'));if(_0x4bfd66[_0x8a58('0x54')]){_0x1ec51b[_0x8a58('0x54')](_0x4bfd66[_0x8a58('0x54')]);}if(_0x4bfd66[_0x8a58('0x55')]){_0x1ec51b[_0x8a58('0x55')](_0x4bfd66[_0x8a58('0x55')]);}}else{_0x1ec51b=applyJoinClauses(_0x1ec51b,![]);_0x1ec51b['group'](_0x8a58('0x56'));if(_0x4bfd66[_0x8a58('0x54')]){_0x44c8df[_0x8a58('0x54')](_0x4bfd66[_0x8a58('0x54')]);}if(_0x4bfd66[_0x8a58('0x55')]){_0x44c8df[_0x8a58('0x55')](_0x4bfd66[_0x8a58('0x55')]);}}_0x1ec51b['having'](_0x54e9db);if(_0x4bfd66['order']){_0x4bfd66['order'][_0x8a58('0x45')](function(_0xe0ed75){_0x44c8df[_0x8a58('0x57')]('c.'+_0xe0ed75[0x0],_0xe0ed75[0x1]==='DESC'?![]:!![]);_0x1ec51b[_0x8a58('0x57')](_0x8a58('0x58')+_0xe0ed75[0x0],_0xe0ed75[0x1]===_0x8a58('0x59')?![]:!![]);});}_0x1ec51b[_0x8a58('0xb')](_0x44c8df,_0x8a58('0xe'));return _0x1ec51b;}function getFilteredContacts(_0x1e3f5d){var _0x22f5aa=[];return db[_0x8a58('0x3a')][_0x8a58('0x5a')]({'attributes':['id',_0x8a58('0x2f'),_0x8a58('0x5b')],'raw':!![]})[_0x8a58('0x4d')](function(_0x5c5eee){_0x22f5aa=_[_0x8a58('0x5c')](_0x5c5eee,'id');var _0x2d49d5={'type':db['Sequelize'][_0x8a58('0x5d')][_0x8a58('0x5e')],'model':db[_0x8a58('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x8a58('0x60')](_0x1e3f5d['toString'](),_0x2d49d5);})[_0x8a58('0x4d')](function(_0x3c58e9){_0x3c58e9[_0x8a58('0x45')](function(_0x11566d){if(_0x11566d[_0x8a58('0x1b')]){_0x11566d[_0x8a58('0x61')]=[];_0x11566d[_0x8a58('0x1b')][_0x8a58('0x22')](',')[_0x8a58('0x45')](function(_0x53fbde){_0x11566d[_0x8a58('0x61')][_0x8a58('0x62')](_0x22f5aa[_0x53fbde]);});}delete _0x11566d[_0x8a58('0x1b')];});return _0x3c58e9;});}function countFilteredContacts(_0x3ff9ee,_0x41009d){var _0x57adf4=_0x3ff9ee[_0x8a58('0x63')]();_0x57adf4[_0x8a58('0x1d')](_0x8a58('0x64'));_0x57adf4=applyJoinClauses(_0x57adf4,!![]);_0x3ff9ee[_0x8a58('0x52')](_0x8a58('0x53'));var _0x30a0b0=utils[_0x8a58('0x1f')](_0x41009d);if(!_[_0x8a58('0x65')](_0x30a0b0)){_0x57adf4['where'](_0x8a58('0x66'),_0x30a0b0);}var _0xbf6332={'type':db[_0x8a58('0x67')]['QueryTypes'][_0x8a58('0x5e')],'raw':!![]};return db['sequelize'][_0x8a58('0x60')](_0x57adf4[_0x8a58('0x68')](),_0xbf6332)[_0x8a58('0x4d')](function(_0x19dea6){return _0x19dea6[0x0][_0x8a58('0x64')];});}module[_0x8a58('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x222f=['role','search','autocomplete','true','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','mobile','fax','email','ListId','CompanyId','createdAt','deletedAt','TagIds','forEach','field','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','buildExpression','type','default','text','value','end','tags','and','ids','User','clause','uc.UserId\x20=\x20?','user','keys','map','compact','Contact','push','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','filter','agent','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','toString','Tags','clone','COUNT(*)','getSelectedTags','isEmpty','where','t.id\x20IN\x20?','sequelize','query','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x222f,0x1a4));var _0xf222=function(_0x303d9d,_0x363884){_0x303d9d=_0x303d9d-0x0;var _0x4ccd15=_0x222f[_0x303d9d];return _0x4ccd15;};'use strict';var _=require(_0xf222('0x0'));var squel=require(_0xf222('0x1'));var as=require(_0xf222('0x2'));var qs=require(_0xf222('0x3'));var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x195de1,_0x233e95){var _0x307791=![];if(_0x195de1[_0xf222('0x4')]==='agent'&&!_0x233e95[_0xf222('0x5')]&&!_0x233e95['ListId']&&_0x233e95[_0xf222('0x6')]!==_0xf222('0x7')){_0x307791=!![];}return _0x307791;}function getContactsSubquery(){return squel['select']()[_0xf222('0x8')](_0xf222('0x9'),'c')['where'](_0xf222('0xa'));}function applyJoinClauses(_0x32d6d3,_0x878804){var _0x2eb41f=_0x878804?'c':_0xf222('0xb');_0x32d6d3[_0xf222('0xc')]('cm_user_has_contacts','uc',_0xf222('0xd')+_0x2eb41f+_0xf222('0xe'))[_0xf222('0xc')](_0xf222('0xf'),'ct','ct.CmContactId\x20=\x20'+_0x2eb41f+_0xf222('0xe'))[_0xf222('0xc')](_0xf222('0x10'),'t',_0xf222('0x11'));return _0x32d6d3;}function addFieldsToQuery(_0x12f968,_0x334017,_0x11fca0,_0x17df25,_0x52a003){var _0x5b8f97=_0x52a003?'c':_0xf222('0xb');if(!_0x334017){_0x334017=['id',_0xf222('0x12'),'lastName',_0xf222('0x13'),_0xf222('0x14'),_0xf222('0x15'),_0xf222('0x16'),_0xf222('0x17'),_0xf222('0x18'),_0xf222('0x19'),'updatedAt',_0xf222('0x1a'),_0xf222('0x1b')];}var _0x8783ab=_0x11fca0&&_0x52a003||!_0x11fca0&&!_0x52a003;if(_0x17df25){_0x8783ab=_0x17df25&&_0x52a003||!_0x17df25&&!_0x52a003;}_0x334017[_0xf222('0x1c')](function(_0x12a2e4){if(_0x12a2e4===_0xf222('0x1b')){if(_0x8783ab){_0x12f968[_0xf222('0x1d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x12a2e4);}else if(_0x11fca0||_0x17df25){_0x12f968[_0xf222('0x1d')](_0x5b8f97+'.'+_0x12a2e4);}}else{_0x12f968[_0xf222('0x1d')](_0x5b8f97+'.'+_0x12a2e4);}});return _0x12f968;}function getSqlClauses(){var _0x2b0d92={'default':squel[_0xf222('0x1e')](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0xf222('0x1e')](),'ids':null},'user':{'clause':squel[_0xf222('0x1e')](),'skip':![]}};return _0x2b0d92;}function parseTagParameter(_0x201cf0){var _0x33406d=squel[_0xf222('0x1e')]();if(_0x201cf0){var _0x151a89=utils['getSelectedTags'](_0x201cf0);_0x151a89[_0xf222('0x1c')](function(_0x589e20){_0x33406d['or'](_0xf222('0x1f'),'%,'+_0x589e20+',%');});}return _0x33406d;}function parseSearchFilter(_0x12d443){var _0x2c48ce=squel[_0xf222('0x1e')]();if(_0x12d443){var _0x4616de=_0x12d443[_0xf222('0x20')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x4616de[_0xf222('0x21')]('\x20')[_0xf222('0x22')]>0x1){_0x2c48ce['or'](_0xf222('0x23'),qs[_0xf222('0x24')](_0x4616de),null);}else{if(qs[_0xf222('0x25')](_0x4616de)){_0x2c48ce['or'](_0xf222('0x26'),_0x4616de+'%');_0x2c48ce['or'](_0xf222('0x27'),_0x4616de+'%');_0x2c48ce['or'](_0xf222('0x28'),_0x4616de+'%');_0x2c48ce['or'](_0xf222('0x29'),_0x4616de+'%');}else if(qs[_0xf222('0x2a')](_0x4616de)){_0x2c48ce['or'](_0xf222('0x2b'),_0x4616de+'%');}else{_0x2c48ce['or']('c.firstName\x20LIKE\x20?','%'+_0x4616de+'%');_0x2c48ce['or'](_0xf222('0x2c'),'%'+_0x4616de+'%');_0x2c48ce['or'](_0xf222('0x2b'),'%'+_0x4616de+'%');}}}return _0x2c48ce;}function parseAdvancedSearchFilter(_0x3d5508,_0x2f04bf){var _0xe41039=getSqlClauses();var _0x40a715=as[_0xf222('0x2d')](_0x3d5508);var _0x1b928b=_0x40a715[_0xf222('0x2e')];for(var _0x59721a=0x0;_0x59721a<_0x40a715[_0xf222('0x2f')][_0xf222('0x22')];_0x59721a++){var _0x3ffc30=_0x40a715['conditions'][_0x59721a];var _0x3ccc9e='c';var _0x5d5963=_[_0xf222('0x30')](_0x2f04bf,[_0xf222('0x31'),_0x3ffc30[_0xf222('0x1d')]]);if(_0x5d5963){if(_0x3ffc30[_0xf222('0x1d')]===_0xf222('0x32')||_0x5d5963[_0xf222('0x33')]===_0xf222('0x34')){_0x3ffc30['castTo']='DATE';}var _0x439c2f=as[_0xf222('0x35')](_0x3ccc9e,_0x5d5963[_0xf222('0x36')],_0x3ffc30);_0xe41039[_0xf222('0x37')][_0x1b928b](_0x439c2f[_0xf222('0x38')],_0x439c2f[_0xf222('0x39')]['start'],_0x439c2f[_0xf222('0x39')][_0xf222('0x3a')]);}else{if(_0x3ffc30[_0xf222('0x1d')]==='Tag'){var _0x2c97cd=_0x3ffc30[_0xf222('0x39')][_0xf222('0x21')](',')['map'](function(_0x226d84){return Number(_0x226d84);});var _0x21e20a=parseTagParameter(_0x2c97cd);_0xe41039[_0xf222('0x3b')]['clause'][_0xf222('0x3c')](_0x21e20a);_0xe41039[_0xf222('0x3b')][_0xf222('0x3d')]=_0x2c97cd;}else if(_0x3ffc30[_0xf222('0x1d')]===_0xf222('0x3e')){_0xe41039['user'][_0xf222('0x3f')]['and'](_0xf222('0x40'),_0x3ffc30[_0xf222('0x39')]);_0xe41039[_0xf222('0x41')]['skip']=!![];}}}return _0xe41039;}function parseModelFields(_0x39784b,_0x3d70b0){var _0x54a10d=squel[_0xf222('0x1e')]();var _0x4b7b15=_(_0x39784b)[_0xf222('0x42')]()[_0xf222('0x43')](function(_0x769510){return _['some'](_0x3d70b0,[_0xf222('0x31'),_0x769510])?_0x769510:undefined;})[_0xf222('0x44')]()[_0xf222('0x39')]();if(_0x39784b[_0xf222('0x45')]){_0x4b7b15[_0xf222('0x46')](_0xf222('0x45'));}if(_0x4b7b15['length']>0x0){_0x4b7b15[_0xf222('0x1c')](function(_0x24e8a5){if(_0x24e8a5==='ListId'){_0x54a10d['and'](_0xf222('0x47'),[]['concat'](_0x39784b[_0x24e8a5]));}else if(_0x24e8a5===_0xf222('0x45')){var _0x281126='%'+_0x39784b[_0x24e8a5]+'%';_0x54a10d[_0xf222('0x3c')](_0xf222('0x48'),_0x281126);}else{_0x54a10d['and']('c.'+_0x24e8a5+'\x20=\x20?',_0x39784b[_0x24e8a5]);}});}return _0x54a10d;}function parseQueryParameters(_0x205895,_0x545464){var _0x522a9e=getSqlClauses();return Promise[_0xf222('0x49')]()[_0xf222('0x4a')](function(){return parseModelFields(_0x205895,_0x545464);})[_0xf222('0x4a')](function(_0x428ee6){_0x522a9e[_0xf222('0x4b')][_0xf222('0x3c')](_0x428ee6);return parseTagParameter(_0x205895['tag']);})[_0xf222('0x4a')](function(_0x1a0eaa){_0x522a9e['tags'][_0xf222('0x3f')][_0xf222('0x3c')](_0x1a0eaa);return parseSearchFilter(_0x205895['filter']);})[_0xf222('0x4a')](function(_0x51ed52){_0x522a9e[_0xf222('0x4c')]=_0x51ed52;return _0x522a9e;});}function checkListsRestrictions(_0x4169a0,_0x136f8b,_0x42d92e){var _0x3a3185=squel[_0xf222('0x1e')]();return Promise[_0xf222('0x49')]()[_0xf222('0x4a')](function(){if(_0x136f8b[_0xf222('0x5')]&&_0x4169a0[_0xf222('0x4')]===_0xf222('0x4d')&&!_0x42d92e){return _0x4169a0['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4bc643){if(_0x4bc643){if(_0x4bc643[_0xf222('0x22')]===0x0){_0x3a3185[_0xf222('0x3c')](_0xf222('0x4e'));}else{_0x3a3185[_0xf222('0x3c')]('c.ListId\x20IN\x20?',_[_0xf222('0x43')](_0x4bc643,'id'));}}})[_0xf222('0x4a')](function(){return _0x3a3185;});}function buildContactsQuery(_0x18d9f7,_0x2841a2,_0x59974f,_0x2bd5b1,_0x9c17be,_0x38117a){if(_0x2841a2){_0x2841a2=_0x59974f[_0xf222('0x4f')];}_0x18d9f7=addFieldsToQuery(_0x18d9f7,_0x2841a2,_0x2bd5b1,_0x38117a,!![]);var _0x1d60e5=squel[_0xf222('0x50')]();_0x1d60e5=addFieldsToQuery(_0x1d60e5,_0x2841a2,_0x2bd5b1,_0x38117a,![]);if(_0x2bd5b1||_0x38117a){_0x18d9f7=applyJoinClauses(_0x18d9f7,!![]);_0x18d9f7[_0xf222('0x51')](_0xf222('0x52'));if(_0x59974f[_0xf222('0x53')]){_0x1d60e5[_0xf222('0x53')](_0x59974f['limit']);}if(_0x59974f['offset']){_0x1d60e5[_0xf222('0x54')](_0x59974f['offset']);}}else{_0x1d60e5=applyJoinClauses(_0x1d60e5,![]);_0x1d60e5[_0xf222('0x51')]('subqry.id');if(_0x59974f[_0xf222('0x53')]){_0x18d9f7['limit'](_0x59974f[_0xf222('0x53')]);}if(_0x59974f[_0xf222('0x54')]){_0x18d9f7[_0xf222('0x54')](_0x59974f[_0xf222('0x54')]);}}_0x1d60e5['having'](_0x9c17be);if(_0x59974f[_0xf222('0x55')]){_0x59974f[_0xf222('0x55')][_0xf222('0x1c')](function(_0x2dc8d2){_0x18d9f7[_0xf222('0x55')]('c.'+_0x2dc8d2[0x0],_0x2dc8d2[0x1]===_0xf222('0x56')?![]:!![]);_0x1d60e5[_0xf222('0x55')](_0xf222('0x57')+_0x2dc8d2[0x0],_0x2dc8d2[0x1]===_0xf222('0x56')?![]:!![]);});}_0x1d60e5[_0xf222('0x8')](_0x18d9f7,_0xf222('0xb'));return _0x1d60e5;}function getFilteredContacts(_0x72af0b){var _0x4aa98c=[];return db['Tag'][_0xf222('0x58')]({'attributes':['id',_0xf222('0x31'),_0xf222('0x59')],'raw':!![]})[_0xf222('0x4a')](function(_0x214976){_0x4aa98c=_[_0xf222('0x5a')](_0x214976,'id');var _0x284495={'type':db[_0xf222('0x5b')][_0xf222('0x5c')][_0xf222('0x5d')],'model':db[_0xf222('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x72af0b[_0xf222('0x5f')](),_0x284495);})[_0xf222('0x4a')](function(_0x3e2e8d){_0x3e2e8d[_0xf222('0x1c')](function(_0x43dac3){if(_0x43dac3[_0xf222('0x1b')]){_0x43dac3[_0xf222('0x60')]=[];_0x43dac3[_0xf222('0x1b')][_0xf222('0x21')](',')[_0xf222('0x1c')](function(_0x32ec77){_0x43dac3[_0xf222('0x60')][_0xf222('0x46')](_0x4aa98c[_0x32ec77]);});}delete _0x43dac3[_0xf222('0x1b')];});return _0x3e2e8d;});}function countFilteredContacts(_0x564f7f,_0x43f492){var _0x5ee917=_0x564f7f[_0xf222('0x61')]();_0x5ee917[_0xf222('0x1d')](_0xf222('0x62'));_0x5ee917=applyJoinClauses(_0x5ee917,!![]);_0x564f7f[_0xf222('0x51')]('c.id');var _0x51443f=utils[_0xf222('0x63')](_0x43f492);if(!_[_0xf222('0x64')](_0x51443f)){_0x5ee917[_0xf222('0x65')](_0xf222('0x66'),_0x51443f);}var _0x356746={'type':db['Sequelize'][_0xf222('0x5c')]['SELECT'],'raw':!![]};return db[_0xf222('0x67')][_0xf222('0x68')](_0x5ee917['toString'](),_0x356746)[_0xf222('0x4a')](function(_0x5e8349){return _0x5e8349[0x0][_0xf222('0x62')];});}module[_0xf222('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 051d7fd..e79a8ca 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 _0xb442=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','encryptString','utf8','base64','createDecipher','crypto','lodash','../../config/environment','secrets','session','aes192','encrypt','algorithm','join','error'];(function(_0x3327e2,_0x251554){var _0x59fb5c=function(_0xf092ac){while(--_0xf092ac){_0x3327e2['push'](_0x3327e2['shift']());}};_0x59fb5c(++_0x251554);}(_0xb442,0x1b6));var _0x2b44=function(_0x357386,_0x40d104){_0x357386=_0x357386-0x0;var _0x3a7fa3=_0xb442[_0x357386];return _0x3a7fa3;};'use strict';var crypto=require(_0x2b44('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x2b44('0x1'));var config=require(_0x2b44('0x2'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2b44('0x3')][_0x2b44('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x2b44('0x5')};if(config[_0x2b44('0x6')]&&config[_0x2b44('0x6')][_0x2b44('0x7')]){var isSupported=isAlgorithmSupported(config[_0x2b44('0x6')][_0x2b44('0x7')]);if(isSupported){fileOptions[_0x2b44('0x7')]=config[_0x2b44('0x6')][_0x2b44('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2b44('0x8')](',\x20');logger[_0x2b44('0x9')](config[_0x2b44('0x6')][_0x2b44('0x7')],_0x2b44('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0xaf790f){return AES_SUPPORTED_RX[_0x2b44('0xb')](_0xaf790f);}function getSupportedCiphers(){return crypto[_0x2b44('0xc')]()[_0x2b44('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x2aa4ef){return getSupportedCiphers()['indexOf'](_0x2aa4ef)>-0x1;}function combineOptions(_0x1ecdbb){var _0xaa7e95={};for(var _0x1aa080 in fileOptions){if(fileOptions[_0x2b44('0xe')](_0x1aa080)){_0xaa7e95[_0x1aa080]=fileOptions[_0x1aa080];}}if(_0x1ecdbb){for(var _0x517be5 in _0x1ecdbb){if(_0x1ecdbb[_0x2b44('0xe')](_0x517be5)){_0xaa7e95[_0x517be5]=_0x1ecdbb[_0x517be5];}}}return _0xaa7e95;}exports[_0x2b44('0xf')]=function(_0x41d4e8,_0x1f1e8e,_0x4d1da2,_0x466162){return new BPromise(function(_0x4b4655,_0x3f55c4){_0x466162=combineOptions(_0x466162);var _0x457346=new Buffer(_0x4d1da2);var _0x143143=fs['createReadStream'](_0x41d4e8);var _0x1d773f=fs[_0x2b44('0x10')](_0x1f1e8e);var _0x76970=crypto[_0x2b44('0x11')](_0x466162[_0x2b44('0x7')],_0x457346);_0x143143['on'](_0x2b44('0x12'),function(_0xd70769){var _0x457faa=new Buffer(_0x76970[_0x2b44('0x13')](_0xd70769),_0x2b44('0x14'));_0x1d773f[_0x2b44('0x15')](_0x457faa);});_0x143143['on'](_0x2b44('0x16'),function(){try{var _0x30df42=new Buffer(_0x76970[_0x2b44('0x17')](_0x2b44('0x14')),_0x2b44('0x14'));_0x1d773f['write'](_0x30df42);_0x1d773f[_0x2b44('0x16')]();_0x1d773f['on'](_0x2b44('0x18'),function(){return _0x4b4655(_0x1f1e8e);});}catch(_0xf3143a){fs[_0x2b44('0x19')](_0x1f1e8e);return _0x3f55c4(_0xf3143a);}});});};exports[_0x2b44('0x1a')]=function(_0x496002,_0x422a6c,_0x516047,_0x5b80bb){return new BPromise(function(_0x41d669,_0x53db43){_0x5b80bb=combineOptions(_0x5b80bb);var _0x56d560=new Buffer(_0x516047);var _0x6b2000=fs[_0x2b44('0x1b')](_0x496002);var _0x5d2287=fs['createWriteStream'](_0x422a6c);var _0x4022bd=crypto['createDecipher'](_0x5b80bb[_0x2b44('0x7')],_0x56d560);_0x6b2000['on'](_0x2b44('0x12'),function(_0x14405f){var _0x5d272d=new Buffer(_0x4022bd['update'](_0x14405f),_0x2b44('0x14'));_0x5d2287[_0x2b44('0x15')](_0x5d272d);});_0x6b2000['on'](_0x2b44('0x16'),function(){try{var _0x5cfba4=new Buffer(_0x4022bd['final'](_0x2b44('0x14')),'binary');_0x5d2287['write'](_0x5cfba4);_0x5d2287[_0x2b44('0x16')]();_0x5d2287['on'](_0x2b44('0x18'),function(){return _0x41d669(_0x422a6c);});}catch(_0x5d069d){fs[_0x2b44('0x19')](_0x422a6c);return _0x53db43(_0x5d069d);}});});};exports[_0x2b44('0x1c')]=function(_0xdeef7a,_0x392904,_0x5313c1){var _0x3c0107=_0x5313c1||stringOptions['algorithm'];var _0x571885=_0x392904||stringOptions['secret'];var _0x3ef763=crypto[_0x2b44('0x11')](_0x3c0107,_0x571885);var _0x348c92=_0x3ef763[_0x2b44('0x13')](_0xdeef7a,_0x2b44('0x1d'),_0x2b44('0x1e'));_0x348c92+=_0x3ef763['final']('base64');return _0x348c92;};exports['decryptString']=function(_0x3a0ac3,_0x4791ad,_0x2e4ea9){var _0x376538=_0x2e4ea9||stringOptions[_0x2b44('0x7')];var _0x567c53=_0x4791ad||stringOptions['secret'];var _0x534d27=crypto[_0x2b44('0x1f')](_0x376538,_0x567c53);var _0x448791=_0x534d27[_0x2b44('0x13')](_0x3a0ac3,_0x2b44('0x1e'),_0x2b44('0x1d'));_0x448791+=_0x534d27[_0x2b44('0x17')](_0x2b44('0x1d'));return _0x448791;}; \ No newline at end of file +var _0x942d=['decryptFile','createDecipher','update','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','app','secrets','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','write','final','binary','end','close','unlink'];(function(_0x41a93b,_0x2fc19d){var _0x220a7e=function(_0x5ecb05){while(--_0x5ecb05){_0x41a93b['push'](_0x41a93b['shift']());}};_0x220a7e(++_0x2fc19d);}(_0x942d,0xad));var _0xd942=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x942d[_0x4a53d];return _0x27410e;};'use strict';var crypto=require(_0xd942('0x0'));var fs=require('fs');var BPromise=require(_0xd942('0x1'));var _=require(_0xd942('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xd942('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xd942('0x4')]['session'],'algorithm':_0xd942('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0xd942('0x6')]&&config[_0xd942('0x6')][_0xd942('0x7')]){var isSupported=isAlgorithmSupported(config[_0xd942('0x6')][_0xd942('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0xd942('0x6')][_0xd942('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xd942('0x8')](',\x20');logger[_0xd942('0x9')](config[_0xd942('0x6')][_0xd942('0x7')],_0xd942('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x2273bc){return AES_SUPPORTED_RX[_0xd942('0xb')](_0x2273bc);}function getSupportedCiphers(){return crypto[_0xd942('0xc')]()[_0xd942('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0xa3213c){return getSupportedCiphers()['indexOf'](_0xa3213c)>-0x1;}function combineOptions(_0x343bdc){var _0x59ac04={};for(var _0x14240e in fileOptions){if(fileOptions[_0xd942('0xe')](_0x14240e)){_0x59ac04[_0x14240e]=fileOptions[_0x14240e];}}if(_0x343bdc){for(var _0x948366 in _0x343bdc){if(_0x343bdc[_0xd942('0xe')](_0x948366)){_0x59ac04[_0x948366]=_0x343bdc[_0x948366];}}}return _0x59ac04;}exports[_0xd942('0xf')]=function(_0x2f9f1f,_0x3981f7,_0x5f1134,_0x530558){return new BPromise(function(_0x1c0474,_0x25cba9){_0x530558=combineOptions(_0x530558);var _0x1a5f80=new Buffer(_0x5f1134);var _0x4effef=fs[_0xd942('0x10')](_0x2f9f1f);var _0x3e1a16=fs[_0xd942('0x11')](_0x3981f7);var _0x2760bd=crypto['createCipher'](_0x530558[_0xd942('0x7')],_0x1a5f80);_0x4effef['on'](_0xd942('0x12'),function(_0x535927){var _0x18ac53=new Buffer(_0x2760bd['update'](_0x535927),'binary');_0x3e1a16[_0xd942('0x13')](_0x18ac53);});_0x4effef['on']('end',function(){try{var _0x5245ae=new Buffer(_0x2760bd[_0xd942('0x14')](_0xd942('0x15')),'binary');_0x3e1a16[_0xd942('0x13')](_0x5245ae);_0x3e1a16[_0xd942('0x16')]();_0x3e1a16['on'](_0xd942('0x17'),function(){return _0x1c0474(_0x3981f7);});}catch(_0x3eb767){fs[_0xd942('0x18')](_0x3981f7);return _0x25cba9(_0x3eb767);}});});};exports[_0xd942('0x19')]=function(_0x1585ee,_0x4d3b51,_0x3d782a,_0x310074){return new BPromise(function(_0x1eabb1,_0x36a4a6){_0x310074=combineOptions(_0x310074);var _0x4e5352=new Buffer(_0x3d782a);var _0x52b0d7=fs[_0xd942('0x10')](_0x1585ee);var _0x276396=fs['createWriteStream'](_0x4d3b51);var _0x4041dd=crypto[_0xd942('0x1a')](_0x310074[_0xd942('0x7')],_0x4e5352);_0x52b0d7['on'](_0xd942('0x12'),function(_0x26509d){var _0x3b0d43=new Buffer(_0x4041dd[_0xd942('0x1b')](_0x26509d),'binary');_0x276396[_0xd942('0x13')](_0x3b0d43);});_0x52b0d7['on'](_0xd942('0x16'),function(){try{var _0x374fad=new Buffer(_0x4041dd['final'](_0xd942('0x15')),_0xd942('0x15'));_0x276396[_0xd942('0x13')](_0x374fad);_0x276396['end']();_0x276396['on'](_0xd942('0x17'),function(){return _0x1eabb1(_0x4d3b51);});}catch(_0x33a6c9){fs[_0xd942('0x18')](_0x4d3b51);return _0x36a4a6(_0x33a6c9);}});});};exports[_0xd942('0x1c')]=function(_0x212e91,_0x4bb610,_0xf74cf5){var _0x476f3a=_0xf74cf5||stringOptions[_0xd942('0x7')];var _0x54d4d6=_0x4bb610||stringOptions[_0xd942('0x1d')];var _0x5bd0a0=crypto['createCipher'](_0x476f3a,_0x54d4d6);var _0x46108f=_0x5bd0a0[_0xd942('0x1b')](_0x212e91,_0xd942('0x1e'),_0xd942('0x1f'));_0x46108f+=_0x5bd0a0['final'](_0xd942('0x1f'));return _0x46108f;};exports[_0xd942('0x20')]=function(_0x283aa3,_0x3e5eeb,_0x344c01){var _0x4dad09=_0x344c01||stringOptions[_0xd942('0x7')];var _0x14cb20=_0x3e5eeb||stringOptions[_0xd942('0x1d')];var _0x23a118=crypto[_0xd942('0x1a')](_0x4dad09,_0x14cb20);var _0x52f35a=_0x23a118['update'](_0x283aa3,_0xd942('0x1f'),'utf8');_0x52f35a+=_0x23a118[_0xd942('0x14')](_0xd942('0x1e'));return _0x52f35a;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 88dcf9b..a7033c8 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 _0x0db5=['split','splitSizeCsv','then','sequelize','query','SELECT','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.csv','length','join','each','%s%d.%s','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find'];(function(_0x3d9f68,_0x95d6ce){var _0x4a6db6=function(_0xa3160a){while(--_0xa3160a){_0x3d9f68['push'](_0x3d9f68['shift']());}};_0x4a6db6(++_0x95d6ce);}(_0x0db5,0x15d));var _0x50db=function(_0x1cc89a,_0x176f51){_0x1cc89a=_0x1cc89a-0x0;var _0x7e69d3=_0x0db5[_0x1cc89a];return _0x7e69d3;};'use strict';var util=require(_0x50db('0x0'));var path=require(_0x50db('0x1'));var _=require(_0x50db('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x50db('0x3'));var zipdir=require(_0x50db('0x4'));var rimraf=require(_0x50db('0x5'));var db=require(_0x50db('0x6'))['db'];var dbH=require('../../mysqldb')[_0x50db('0x7')];var logger=require(_0x50db('0x8'))(_0x50db('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x50db('0xa')][0x2]);var QUERY=process[_0x50db('0xa')][0x3];var PATH=process[_0x50db('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3b9146,_0x37fac4){var _0x3ff92b={'status':_0x3b9146};var _0x3a7aec={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x37fac4){_0x3ff92b['savename']=_0x37fac4;}return db[_0x50db('0xb')][_0x50db('0xc')](_0x3ff92b,_0x3a7aec);}function main(){var _0x3321ef=0x1388;var _0x2b862d;logger[_0x50db('0xd')](util[_0x50db('0xe')](_0x50db('0xf'),EXTRACTED_REPORT_ID,_0x50db('0x10')));return db[_0x50db('0x11')][_0x50db('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x50db('0x13'),_0x50db('0x14')]})[_0x50db('0x15')](function(_0x38cc5d){if(_0x38cc5d){_0x2b862d=_0x38cc5d;_0x3321ef=_0x2b862d[_0x50db('0x14')]||0x1388;}})[_0x50db('0x15')](function(){return dbH[_0x50db('0x16')][_0x50db('0x17')](util[_0x50db('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x50db('0x18')]});})[_0x50db('0x15')](function(_0x133f9d){if(!_0x133f9d[0x0][_0x50db('0x19')]){return analyticExtractedReport(_0x50db('0x1a'));}var _0x14779e=[];var _0x513826=0x0;if(_0x2b862d[_0x50db('0x13')]){if(_0x133f9d&&_0x133f9d['length']){var _0xfe207e=_[_0x50db('0x1b')](_0x133f9d[0x0][_0x50db('0x19')]/_0x3321ef);var _0x5d622b=Number[_0x50db('0x1c')](_0x133f9d[0x0]['num']/_0x3321ef)?_0x133f9d[0x0][_0x50db('0x19')]%_0x3321ef:0x0;_0xfe207e[_0x50db('0x1d')](function(_0xbdca16){if(_0xbdca16>0x0){_0x513826+=_0x3321ef;}_0x14779e[_0x50db('0x1e')](dbH[_0x50db('0x16')]['query'](util[_0x50db('0xe')](_0x50db('0x1f'),QUERY,_0x3321ef,_0x513826),{'type':dbH[_0x50db('0x16')][_0x50db('0x20')][_0x50db('0x18')]}));});if(_0x5d622b>0x0){_0x513826+=_0x3321ef;_0x14779e[_0x50db('0x1e')](dbH[_0x50db('0x16')][_0x50db('0x17')](util[_0x50db('0xe')](_0x50db('0x1f'),QUERY,_0x5d622b,_0x513826),{'type':dbH[_0x50db('0x16')][_0x50db('0x20')][_0x50db('0x18')]}));}}}else{_0x14779e[_0x50db('0x1e')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x50db('0x16')][_0x50db('0x20')][_0x50db('0x18')]}));}var _0x4e4ecb=path[_0x50db('0x21')](PATH);var _0x1acbec=path['basename'](PATH,_0x50db('0x22'));var _0x30c816=_0x2b862d['split']&&_0x14779e[_0x50db('0x23')]>0x1;var _0xd6e605=[];if(!fs['existsSync'](path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec))&&_0x30c816){fs['mkdirSync'](path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec));}return BPromise[_0x50db('0x25')](_0x14779e,function(_0x52bf81){_0xd6e605[_0x50db('0x1e')](_0x52bf81);})[_0x50db('0x15')](function(){for(var _0xf6d957=0x0;_0xf6d957<_0xd6e605[_0x50db('0x23')];_0xf6d957+=0x1){var _0x2ccf4e;var _0x2320d1=_0xd6e605[_0xf6d957];if(_0x30c816){_0x2ccf4e=path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec,util[_0x50db('0xe')](_0x50db('0x26'),_0x1acbec,_0xf6d957,'csv'));}else{_0x2ccf4e=path[_0x50db('0x24')](_0x4e4ecb,util[_0x50db('0xe')](_0x50db('0x27'),_0x1acbec,'csv'));}fs['writeFileSync'](_0x2ccf4e,csv(_0x2320d1));}})[_0x50db('0x15')](function(){if(_0x30c816){return new Promise(function(_0x5b1eb5){zipdir(path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec),{'saveTo':path[_0x50db('0x24')](_0x4e4ecb,util[_0x50db('0xe')]('%s.%s',_0x1acbec,_0x50db('0x28')))},function(_0x18b357,_0x39c79a){rimraf(path[_0x50db('0x24')](_0x4e4ecb,_0x1acbec),function(){});_0x5b1eb5(_0x50db('0x29'));});});}})['then'](function(){logger[_0x50db('0xd')](util[_0x50db('0xe')](_0x50db('0x2a'),EXTRACTED_REPORT_ID,_0x50db('0x10')));return analyticExtractedReport(_0x50db('0x2b'),_0x30c816?util[_0x50db('0xe')](_0x50db('0x27'),_0x1acbec,_0x30c816?_0x50db('0x28'):'csv'):null);});})[_0x50db('0x2c')](function(_0xafe3d0){logger['info'](util[_0x50db('0xe')](_0x50db('0x2d'),EXTRACTED_REPORT_ID,_0x50db('0x10')),util['inspect'](_0xafe3d0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x16b3=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeCsv','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','%s.%s','csv','writeFileSync','zip','zip\x20finished','info','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x16b3,0x1c6));var _0x316b=function(_0x13e550,_0x2eb102){_0x13e550=_0x13e550-0x0;var _0x4f9a14=_0x16b3[_0x13e550];return _0x4f9a14;};'use strict';var util=require(_0x316b('0x0'));var path=require(_0x316b('0x1'));var _=require(_0x316b('0x2'));var csv=require(_0x316b('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x316b('0x4'));var rimraf=require(_0x316b('0x5'));var db=require(_0x316b('0x6'))['db'];var dbH=require(_0x316b('0x6'))[_0x316b('0x7')];var logger=require(_0x316b('0x8'))(_0x316b('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x316b('0xa')][0x2]);var QUERY=process[_0x316b('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2c5062,_0x3ddf82){var _0x217824={'status':_0x2c5062};var _0x38736b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ddf82){_0x217824[_0x316b('0xb')]=_0x3ddf82;}return db[_0x316b('0xc')][_0x316b('0xd')](_0x217824,_0x38736b);}function main(){var _0x249778=0x1388;var _0x4bf4c7;logger['info'](util['format'](_0x316b('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x316b('0xf')][_0x316b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x316b('0x11'),'splitSizeCsv']})[_0x316b('0x12')](function(_0x226bf2){if(_0x226bf2){_0x4bf4c7=_0x226bf2;_0x249778=_0x4bf4c7[_0x316b('0x13')]||0x1388;}})[_0x316b('0x12')](function(){return dbH['sequelize'][_0x316b('0x14')](util[_0x316b('0x15')](_0x316b('0x16'),QUERY),{'type':dbH[_0x316b('0x17')][_0x316b('0x18')][_0x316b('0x19')]});})['then'](function(_0x460897){if(!_0x460897[0x0][_0x316b('0x1a')]){return analyticExtractedReport(_0x316b('0x1b'));}var _0x5667d5=[];var _0x5f3601=0x0;if(_0x4bf4c7['split']){if(_0x460897&&_0x460897[_0x316b('0x1c')]){var _0x5cf684=_[_0x316b('0x1d')](_0x460897[0x0]['num']/_0x249778);var _0x18e19f=Number[_0x316b('0x1e')](_0x460897[0x0][_0x316b('0x1a')]/_0x249778)?_0x460897[0x0][_0x316b('0x1a')]%_0x249778:0x0;_0x5cf684[_0x316b('0x1f')](function(_0x13ab31){if(_0x13ab31>0x0){_0x5f3601+=_0x249778;}_0x5667d5[_0x316b('0x20')](dbH[_0x316b('0x17')][_0x316b('0x14')](util[_0x316b('0x15')](_0x316b('0x21'),QUERY,_0x249778,_0x5f3601),{'type':dbH[_0x316b('0x17')][_0x316b('0x18')][_0x316b('0x19')]}));});if(_0x18e19f>0x0){_0x5f3601+=_0x249778;_0x5667d5[_0x316b('0x20')](dbH[_0x316b('0x17')][_0x316b('0x14')](util['format'](_0x316b('0x21'),QUERY,_0x18e19f,_0x5f3601),{'type':dbH['sequelize'][_0x316b('0x18')][_0x316b('0x19')]}));}}}else{_0x5667d5[_0x316b('0x20')](dbH['sequelize'][_0x316b('0x14')](QUERY,{'type':dbH[_0x316b('0x17')][_0x316b('0x18')][_0x316b('0x19')]}));}var _0x5bc1ee=path[_0x316b('0x22')](PATH);var _0x4f7bbf=path[_0x316b('0x23')](PATH,'.csv');var _0x430c98=_0x4bf4c7['split']&&_0x5667d5[_0x316b('0x1c')]>0x1;var _0x35c8a0=[];if(!fs[_0x316b('0x24')](path[_0x316b('0x25')](_0x5bc1ee,_0x4f7bbf))&&_0x430c98){fs[_0x316b('0x26')](path['join'](_0x5bc1ee,_0x4f7bbf));}return BPromise['each'](_0x5667d5,function(_0xe98720){_0x35c8a0[_0x316b('0x20')](_0xe98720);})['then'](function(){for(var _0x1d9825=0x0;_0x1d9825<_0x35c8a0[_0x316b('0x1c')];_0x1d9825+=0x1){var _0x137eb5;var _0x1c15ae=_0x35c8a0[_0x1d9825];if(_0x430c98){_0x137eb5=path[_0x316b('0x25')](_0x5bc1ee,_0x4f7bbf,util[_0x316b('0x15')]('%s%d.%s',_0x4f7bbf,_0x1d9825,'csv'));}else{_0x137eb5=path[_0x316b('0x25')](_0x5bc1ee,util[_0x316b('0x15')](_0x316b('0x27'),_0x4f7bbf,_0x316b('0x28')));}fs[_0x316b('0x29')](_0x137eb5,csv(_0x1c15ae));}})['then'](function(){if(_0x430c98){return new Promise(function(_0x5257f4){zipdir(path[_0x316b('0x25')](_0x5bc1ee,_0x4f7bbf),{'saveTo':path['join'](_0x5bc1ee,util[_0x316b('0x15')](_0x316b('0x27'),_0x4f7bbf,_0x316b('0x2a')))},function(_0x331698,_0x1e0e65){rimraf(path['join'](_0x5bc1ee,_0x4f7bbf),function(){});_0x5257f4(_0x316b('0x2b'));});});}})[_0x316b('0x12')](function(){logger[_0x316b('0x2c')](util[_0x316b('0x15')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x316b('0x2d')));return analyticExtractedReport(_0x316b('0x2e'),_0x430c98?util[_0x316b('0x15')]('%s.%s',_0x4f7bbf,_0x430c98?_0x316b('0x2a'):_0x316b('0x28')):null);});})[_0x316b('0x2f')](function(_0x31c90f){logger[_0x316b('0x2c')](util[_0x316b('0x15')](_0x316b('0x30'),EXTRACTED_REPORT_ID,'CSV'),util[_0x316b('0x31')](_0x31c90f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x316b('0x32')](function(){process[_0x316b('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 22bbdaf..ad65a78 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 _0xe1a8=['map','tableHeader','value','length','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','Empty','find','split','splitSizePdf','then','isInteger','num','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','window','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x1a165f,_0xaf7889){var _0x17d3ae=function(_0x392130){while(--_0x392130){_0x1a165f['push'](_0x1a165f['shift']());}};_0x17d3ae(++_0xaf7889);}(_0xe1a8,0x161));var _0x8e1a=function(_0x552102,_0x522dfb){_0x552102=_0x552102-0x0;var _0x4c7422=_0xe1a8[_0x552102];return _0x4c7422;};'use strict';var _=require(_0x8e1a('0x0'));var fs=require('fs');var util=require(_0x8e1a('0x1'));var path=require('path');var moment=require(_0x8e1a('0x2'));var htmlToPdfmake=require(_0x8e1a('0x3'));var PdfPrinter=require(_0x8e1a('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x8e1a('0x5'));var JSDOM=require(_0x8e1a('0x6'))['JSDOM'];var window=new JSDOM('')[_0x8e1a('0x7')];var BPromise=require('bluebird');var db=require(_0x8e1a('0x8'))['db'];var dbH=require(_0x8e1a('0x8'))[_0x8e1a('0x9')];var logger=require('../../config/logger')(_0x8e1a('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x8e1a('0xb')][0x2]);var QUERY=process[_0x8e1a('0xb')][0x3];var PATH=process[_0x8e1a('0xb')][0x4];var NAME=process[_0x8e1a('0xb')][0x5];var FORMAT=_0x8e1a('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x553cec,_0x5bda72){var _0x563fcb={'status':_0x553cec};var _0x312d33={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5bda72){_0x563fcb[_0x8e1a('0xd')]=_0x5bda72;}return db[_0x8e1a('0xe')]['update'](_0x563fcb,_0x312d33);}function getHeaders(_0x1c69dd){return _[_0x8e1a('0xf')](_0x1c69dd,function(_0x4dd7ea){return{'text':_0x4dd7ea,'style':_0x8e1a('0x10')};});}function getRows(_0x3e64ea,_0x11b870){return _['map'](_0x11b870,function(_0x568eba){return _(_0x568eba)['pick'](_0x3e64ea)[_0x8e1a('0xf')](function(_0x484407){return _0x484407?_['toString'](_0x484407):'';})[_0x8e1a('0x11')]();});}function createTable(_0x2ee4e8,_0x4c5604){var _0x56f633={'widths':_['fill'](Array(_0x2ee4e8[_0x8e1a('0x12')]),0x91),'heights':function(_0x523e07){return _0x523e07===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x128a70=getHeaders(_0x2ee4e8);_0x56f633[_0x8e1a('0x13')][_0x8e1a('0x14')](_0x128a70);var _0x3f7b9f=getRows(_0x2ee4e8,_0x4c5604);_0x56f633['body']=_0x56f633[_0x8e1a('0x13')]['concat'](_0x3f7b9f);return _0x56f633;}function createTables(_0x110507){var _0x158a64=[];var _0x51fa1e=_[_0x8e1a('0x15')](Object[_0x8e1a('0x16')](_0x110507[0x0]),0x5);_0x51fa1e[_0x8e1a('0x17')](function(_0x119ce9){_0x158a64[_0x8e1a('0x14')](createTable(_0x119ce9,_0x110507));});return _0x158a64;}function getPDFDocDefinition(_0x2232df){var _0x2ba57=util[_0x8e1a('0x18')](_0x8e1a('0x19'),NAME,EXTRACTED_REPORT[_0x8e1a('0x1a')],moment(EXTRACTED_REPORT[_0x8e1a('0x1b')])[_0x8e1a('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x8e1a('0x1c')])[_0x8e1a('0x18')](FORMAT));var _0x2e07b6=[];for(var _0x3bc8da=0x0;_0x3bc8da<_0x2232df[_0x8e1a('0x12')];_0x3bc8da++){var _0x18cc47=[];if(_0x3bc8da===0x0){_0x18cc47[_0x8e1a('0x14')]({'text':_0x2ba57,'style':_0x8e1a('0x1d')});}var _0x3e47ff={'table':_0x2232df[_0x3bc8da]};if(_0x3bc8da>0x0){_0x3e47ff[_0x8e1a('0x1e')]=_0x8e1a('0x1f');_0x3e47ff[_0x8e1a('0x20')]=[0x0,0x46,0x0,0x0];}_0x18cc47[_0x8e1a('0x14')](_0x3e47ff);_0x2e07b6[_0x8e1a('0x14')](_0x18cc47);}return{'pageSize':'A4','pageOrientation':_0x8e1a('0x21'),'content':_0x2e07b6,'footer':function(_0x3e357d,_0x37a1bf){return{'text':_0x3e357d[_0x8e1a('0x22')]()+_0x8e1a('0x23')+_0x37a1bf,'style':_0x8e1a('0x24')};},'defaultStyle':{'font':_0x8e1a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8e1a('0x26')},'footer':{'alignment':_0x8e1a('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4bf27c){var _0x406a34=0x1388;var _0x2295fb;if(!_0x4bf27c[0x0]['num']){return analyticExtractedReport(_0x8e1a('0x28'));}return db['Setting'][_0x8e1a('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8e1a('0x2a'),_0x8e1a('0x2b')]})[_0x8e1a('0x2c')](function(_0xb9d083){if(_0xb9d083){_0x2295fb=_0xb9d083;_0x406a34=_0x2295fb[_0x8e1a('0x2b')]||0x3e8;}})[_0x8e1a('0x2c')](function(){var _0x16f96d=[];var _0x4d48f5=0x0;if(_0x2295fb[_0x8e1a('0x2a')]){if(_0x4bf27c&&_0x4bf27c[_0x8e1a('0x12')]){var _0x545884=_['range'](_0x4bf27c[0x0]['num']/_0x406a34);var _0x1bb995=Number[_0x8e1a('0x2d')](_0x4bf27c[0x0][_0x8e1a('0x2e')]/_0x406a34)?_0x4bf27c[0x0][_0x8e1a('0x2e')]%_0x406a34:0x0;_0x545884[_0x8e1a('0x17')](function(_0x356b7a){if(_0x356b7a>0x0){_0x4d48f5+=_0x406a34;}_0x16f96d[_0x8e1a('0x14')](dbH[_0x8e1a('0x2f')]['query'](util[_0x8e1a('0x18')](_0x8e1a('0x30'),QUERY,_0x406a34,_0x4d48f5),{'type':dbH[_0x8e1a('0x2f')][_0x8e1a('0x31')]['SELECT']}));});if(_0x1bb995>0x0){_0x4d48f5+=_0x406a34;_0x16f96d[_0x8e1a('0x14')](dbH['sequelize'][_0x8e1a('0x32')](util[_0x8e1a('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1bb995,_0x4d48f5),{'type':dbH['sequelize'][_0x8e1a('0x31')][_0x8e1a('0x33')]}));}}}else{_0x16f96d['push'](dbH[_0x8e1a('0x2f')][_0x8e1a('0x32')](QUERY,{'type':dbH[_0x8e1a('0x2f')][_0x8e1a('0x31')]['SELECT']}));}var _0x1c4b8f=path[_0x8e1a('0x34')](PATH);var _0x19d48e=path[_0x8e1a('0x35')](PATH,_0x8e1a('0x36'));var _0x7aaa1a=_0x2295fb['split']&&_0x16f96d[_0x8e1a('0x12')]>0x1;var _0x2f902d=[];if(!fs[_0x8e1a('0x37')](path['join'](_0x1c4b8f,_0x19d48e))&&_0x7aaa1a){fs[_0x8e1a('0x38')](path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e));}return BPromise[_0x8e1a('0x3a')](_0x16f96d,function(_0x45cd9d){_0x2f902d[_0x8e1a('0x14')](_0x45cd9d);})[_0x8e1a('0x2c')](function(){var _0x54557b=[];for(var _0x2f85a9=0x0;_0x2f85a9<_0x2f902d['length'];_0x2f85a9+=0x1){var _0x103b5c=_0x2f902d[_0x2f85a9];var _0x56c28c=createTables(_[_0x8e1a('0x3b')](_0x103b5c));var _0x5a33cc;var _0x5e6a91=getPDFDocDefinition(_0x56c28c);var _0x1dc8f3=getPDFPrinter();var _0x54bd78=_0x1dc8f3['createPdfKitDocument'](_0x5e6a91);if(_0x7aaa1a){_0x5a33cc=path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e,util[_0x8e1a('0x18')](_0x8e1a('0x3c'),_0x19d48e,_0x2f85a9,_0x8e1a('0x3d')));}else{_0x5a33cc=path[_0x8e1a('0x39')](_0x1c4b8f,util[_0x8e1a('0x18')](_0x8e1a('0x3e'),_0x19d48e,_0x8e1a('0x3d')));}_0x54557b[_0x8e1a('0x14')](writePDFDocument(_0x54bd78,_0x5a33cc));}return Promise[_0x8e1a('0x3f')](_0x54557b);})[_0x8e1a('0x2c')](function(){if(_0x7aaa1a){return new Promise(function(_0x10b857){zipdir(path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e),{'saveTo':path['join'](_0x1c4b8f,util[_0x8e1a('0x18')](_0x8e1a('0x3e'),_0x19d48e,_0x8e1a('0x40')))},function(){rimraf(path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e),function(){});_0x10b857('zip\x20finished');});});}})[_0x8e1a('0x2c')](function(){if(!_0x7aaa1a)return;rimraf(path[_0x8e1a('0x39')](_0x1c4b8f,_0x19d48e),function(){});})[_0x8e1a('0x2c')](function(){logger[_0x8e1a('0x41')](util[_0x8e1a('0x18')](_0x8e1a('0x42'),EXTRACTED_REPORT_ID,_0x8e1a('0x43')));return analyticExtractedReport(_0x8e1a('0x44'),_0x7aaa1a?util['format']('%s.%s',_0x19d48e,_0x7aaa1a?_0x8e1a('0x40'):_0x8e1a('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8e1a('0x41')](util['format'](_0x8e1a('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x8e1a('0xe')][_0x8e1a('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2b4dd9){EXTRACTED_REPORT=_0x2b4dd9;return dbH[_0x8e1a('0x2f')][_0x8e1a('0x32')](util[_0x8e1a('0x18')](_0x8e1a('0x47'),QUERY),{'type':dbH[_0x8e1a('0x2f')]['QueryTypes'][_0x8e1a('0x33')]});})['then'](extractReport)[_0x8e1a('0x48')](function(_0x38f9f1){logger[_0x8e1a('0x41')](util[_0x8e1a('0x18')](_0x8e1a('0x49'),EXTRACTED_REPORT_ID,_0x8e1a('0x43')),util[_0x8e1a('0x4a')](_0x38f9f1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x8e1a('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3846a1=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x8e1a('0x4c'),'italics':__dirname+_0x8e1a('0x4d'),'bolditalics':__dirname+_0x8e1a('0x4e')}});return _0x3846a1;}function getPDFDocDefinitionFromHTML(_0x388271,_0x3bb16d){var _0x4414a1=util[_0x8e1a('0x18')](_0x8e1a('0x4f'),_0x3bb16d['channel'],_0x3bb16d[_0x8e1a('0x50')]);var _0x9bff92=moment()[_0x8e1a('0x18')](_0x8e1a('0x51'))[_0x8e1a('0x22')]();var _0xe8da5f=htmlToPdfmake(_0x388271,{'window':window,'tableAutoSize':!![]});return{'content':[_0xe8da5f],'defaultStyle':{'font':_0x8e1a('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8e1a('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8e1a('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x8e1a('0x53'),'style':_0x8e1a('0x1d')}];},'footer':function(_0x1d3819,_0x31479d){return[{'text':util[_0x8e1a('0x18')](_0x8e1a('0x54'),_0x4414a1,_0x1d3819,_0x31479d,_0x9bff92),'style':_0x8e1a('0x24')}];}};}function writePDFDocument(_0xf2558b,_0x1b6076){return new Promise(function(_0x1afbcb,_0x592c13){var _0x486b19=_0xf2558b[_0x8e1a('0x55')](fs[_0x8e1a('0x56')](_0x1b6076));_0x486b19['on'](_0x8e1a('0x57'),function(){_0x1afbcb(_0x8e1a('0x57'));});_0x486b19['on'](_0x8e1a('0x58'),function(_0x22ff74){_0x592c13(_0x22ff74);});_0xf2558b[_0x8e1a('0x59')]();});}exports[_0x8e1a('0x5a')]=function(_0x1490cd,_0x159421){var _0x4062ef=getPDFPrinter();var _0xf54943=getPDFDocDefinitionFromHTML(_0x1490cd,_0x159421);var _0x595c40=_0x4062ef[_0x8e1a('0x5b')](_0xf54943);return writePDFDocument(_0x595c40,_0x159421['path'])[_0x8e1a('0x48')](function(_0x3e251d){throw _0x3e251d;});}; \ No newline at end of file +var _0x5001=['flatten','%s%d.%s','%s.%s','all','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','\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','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','fill','auto','push','body','keys','forEach','format','startDate','endDate','length','header','pageBreak','before','margin','\x20/\x20','footer','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each'];(function(_0x384cbb,_0xcb6be6){var _0x27609d=function(_0x336274){while(--_0x336274){_0x384cbb['push'](_0x384cbb['shift']());}};_0x27609d(++_0xcb6be6);}(_0x5001,0xdd));var _0x1500=function(_0x1dc221,_0x47cc81){_0x1dc221=_0x1dc221-0x0;var _0x1f753e=_0x5001[_0x1dc221];return _0x1f753e;};'use strict';var _=require(_0x1500('0x0'));var fs=require('fs');var util=require(_0x1500('0x1'));var path=require(_0x1500('0x2'));var moment=require(_0x1500('0x3'));var htmlToPdfmake=require(_0x1500('0x4'));var PdfPrinter=require(_0x1500('0x5'));var zipdir=require(_0x1500('0x6'));var rimraf=require(_0x1500('0x7'));var JSDOM=require(_0x1500('0x8'))[_0x1500('0x9')];var window=new JSDOM('')[_0x1500('0xa')];var BPromise=require(_0x1500('0xb'));var db=require(_0x1500('0xc'))['db'];var dbH=require('../../mysqldb')[_0x1500('0xd')];var logger=require(_0x1500('0xe'))(_0x1500('0xf'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1500('0x10')][0x3];var PATH=process[_0x1500('0x10')][0x4];var NAME=process[_0x1500('0x10')][0x5];var FORMAT=_0x1500('0x11');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x55c742,_0xd6780f){var _0x1b7916={'status':_0x55c742};var _0x5ced6c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xd6780f){_0x1b7916[_0x1500('0x12')]=_0xd6780f;}return db[_0x1500('0x13')]['update'](_0x1b7916,_0x5ced6c);}function getHeaders(_0x364b7a){return _[_0x1500('0x14')](_0x364b7a,function(_0x27e090){return{'text':_0x27e090,'style':_0x1500('0x15')};});}function getRows(_0x25c126,_0x5197ee){return _['map'](_0x5197ee,function(_0x253cae){return _(_0x253cae)[_0x1500('0x16')](_0x25c126)['map'](function(_0xdc7040){return _0xdc7040?_[_0x1500('0x17')](_0xdc7040):'';})['value']();});}function createTable(_0x59ae44,_0x4ac76e){var _0x3a9cf3={'widths':_[_0x1500('0x18')](Array(_0x59ae44['length']),0x91),'heights':function(_0x4b1a69){return _0x4b1a69===0x0?_0x1500('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x561eb2=getHeaders(_0x59ae44);_0x3a9cf3['body'][_0x1500('0x1a')](_0x561eb2);var _0xbdc68f=getRows(_0x59ae44,_0x4ac76e);_0x3a9cf3[_0x1500('0x1b')]=_0x3a9cf3[_0x1500('0x1b')]['concat'](_0xbdc68f);return _0x3a9cf3;}function createTables(_0x4b090b){var _0x1073e0=[];var _0x44f45=_['chunk'](Object[_0x1500('0x1c')](_0x4b090b[0x0]),0x5);_0x44f45[_0x1500('0x1d')](function(_0x3a7002){_0x1073e0[_0x1500('0x1a')](createTable(_0x3a7002,_0x4b090b));});return _0x1073e0;}function getPDFDocDefinition(_0x17a590){var _0x36aefc=util[_0x1500('0x1e')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x1500('0x1f')])[_0x1500('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x1500('0x20')])[_0x1500('0x1e')](FORMAT));var _0x4917b4=[];for(var _0x45634e=0x0;_0x45634e<_0x17a590[_0x1500('0x21')];_0x45634e++){var _0x57a239=[];if(_0x45634e===0x0){_0x57a239['push']({'text':_0x36aefc,'style':_0x1500('0x22')});}var _0x1fd1ed={'table':_0x17a590[_0x45634e]};if(_0x45634e>0x0){_0x1fd1ed[_0x1500('0x23')]=_0x1500('0x24');_0x1fd1ed[_0x1500('0x25')]=[0x0,0x46,0x0,0x0];}_0x57a239[_0x1500('0x1a')](_0x1fd1ed);_0x4917b4[_0x1500('0x1a')](_0x57a239);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x4917b4,'footer':function(_0x5b70dc,_0x278326){return{'text':_0x5b70dc[_0x1500('0x17')]()+_0x1500('0x26')+_0x278326,'style':_0x1500('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x1500('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ba920){var _0x3eee3a=0x1388;var _0x455a4e;if(!_0x2ba920[0x0][_0x1500('0x29')]){return analyticExtractedReport(_0x1500('0x2a'));}return db[_0x1500('0x2b')][_0x1500('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1500('0x2d'),_0x1500('0x2e')]})[_0x1500('0x2f')](function(_0x144ad){if(_0x144ad){_0x455a4e=_0x144ad;_0x3eee3a=_0x455a4e['splitSizePdf']||0x3e8;}})[_0x1500('0x2f')](function(){var _0x539410=[];var _0x542320=0x0;if(_0x455a4e[_0x1500('0x2d')]){if(_0x2ba920&&_0x2ba920['length']){var _0x4f4441=_[_0x1500('0x30')](_0x2ba920[0x0][_0x1500('0x29')]/_0x3eee3a);var _0x1ca4a1=Number[_0x1500('0x31')](_0x2ba920[0x0][_0x1500('0x29')]/_0x3eee3a)?_0x2ba920[0x0][_0x1500('0x29')]%_0x3eee3a:0x0;_0x4f4441[_0x1500('0x1d')](function(_0x263d4e){if(_0x263d4e>0x0){_0x542320+=_0x3eee3a;}_0x539410[_0x1500('0x1a')](dbH[_0x1500('0x32')][_0x1500('0x33')](util[_0x1500('0x1e')](_0x1500('0x34'),QUERY,_0x3eee3a,_0x542320),{'type':dbH['sequelize'][_0x1500('0x35')][_0x1500('0x36')]}));});if(_0x1ca4a1>0x0){_0x542320+=_0x3eee3a;_0x539410[_0x1500('0x1a')](dbH[_0x1500('0x32')][_0x1500('0x33')](util['format'](_0x1500('0x34'),QUERY,_0x1ca4a1,_0x542320),{'type':dbH[_0x1500('0x32')]['QueryTypes']['SELECT']}));}}}else{_0x539410[_0x1500('0x1a')](dbH[_0x1500('0x32')]['query'](QUERY,{'type':dbH[_0x1500('0x32')][_0x1500('0x35')]['SELECT']}));}var _0x493b87=path[_0x1500('0x37')](PATH);var _0xe17f42=path[_0x1500('0x38')](PATH,'.pdf');var _0x2b2266=_0x455a4e[_0x1500('0x2d')]&&_0x539410[_0x1500('0x21')]>0x1;var _0x59fe6e=[];if(!fs[_0x1500('0x39')](path[_0x1500('0x3a')](_0x493b87,_0xe17f42))&&_0x2b2266){fs[_0x1500('0x3b')](path[_0x1500('0x3a')](_0x493b87,_0xe17f42));}return BPromise[_0x1500('0x3c')](_0x539410,function(_0x127e1d){_0x59fe6e[_0x1500('0x1a')](_0x127e1d);})['then'](function(){var _0x53dc23=[];for(var _0x175a8f=0x0;_0x175a8f<_0x59fe6e['length'];_0x175a8f+=0x1){var _0x2f8ecf=_0x59fe6e[_0x175a8f];var _0x4537b0=createTables(_[_0x1500('0x3d')](_0x2f8ecf));var _0x3c548b;var _0x5507cf=getPDFDocDefinition(_0x4537b0);var _0xfc2fec=getPDFPrinter();var _0x39eb4c=_0xfc2fec['createPdfKitDocument'](_0x5507cf);if(_0x2b2266){_0x3c548b=path['join'](_0x493b87,_0xe17f42,util[_0x1500('0x1e')](_0x1500('0x3e'),_0xe17f42,_0x175a8f,'pdf'));}else{_0x3c548b=path[_0x1500('0x3a')](_0x493b87,util[_0x1500('0x1e')](_0x1500('0x3f'),_0xe17f42,'pdf'));}_0x53dc23[_0x1500('0x1a')](writePDFDocument(_0x39eb4c,_0x3c548b));}return Promise[_0x1500('0x40')](_0x53dc23);})[_0x1500('0x2f')](function(){if(_0x2b2266){return new Promise(function(_0x42a1f3){zipdir(path[_0x1500('0x3a')](_0x493b87,_0xe17f42),{'saveTo':path['join'](_0x493b87,util[_0x1500('0x1e')](_0x1500('0x3f'),_0xe17f42,'zip'))},function(){rimraf(path[_0x1500('0x3a')](_0x493b87,_0xe17f42),function(){});_0x42a1f3(_0x1500('0x41'));});});}})['then'](function(){if(!_0x2b2266)return;rimraf(path[_0x1500('0x3a')](_0x493b87,_0xe17f42),function(){});})[_0x1500('0x2f')](function(){logger['info'](util[_0x1500('0x1e')](_0x1500('0x42'),EXTRACTED_REPORT_ID,_0x1500('0x43')));return analyticExtractedReport(_0x1500('0x44'),_0x2b2266?util[_0x1500('0x1e')](_0x1500('0x3f'),_0xe17f42,_0x2b2266?_0x1500('0x45'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x1500('0x1e')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x1500('0x13')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x3a0c8c){EXTRACTED_REPORT=_0x3a0c8c;return dbH['sequelize'][_0x1500('0x33')](util['format'](_0x1500('0x46'),QUERY),{'type':dbH[_0x1500('0x32')][_0x1500('0x35')][_0x1500('0x36')]});})[_0x1500('0x2f')](extractReport)[_0x1500('0x47')](function(_0x1dea15){logger[_0x1500('0x48')](util['format'](_0x1500('0x49'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x1dea15,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1500('0x4a'));})[_0x1500('0x4b')](function(){process[_0x1500('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x306329=new PdfPrinter({'Arial':{'normal':__dirname+_0x1500('0x4d'),'bold':__dirname+_0x1500('0x4e'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x1500('0x4f')}});return _0x306329;}function getPDFDocDefinitionFromHTML(_0x1d543f,_0x1965a5){var _0x4b2103=util[_0x1500('0x1e')](_0x1500('0x50'),_0x1965a5[_0x1500('0x51')],_0x1965a5[_0x1500('0x52')]);var _0x1b9220=moment()[_0x1500('0x1e')](_0x1500('0x53'))[_0x1500('0x17')]();var _0x231ca3=htmlToPdfmake(_0x1d543f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x231ca3],'defaultStyle':{'font':_0x1500('0x54')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x1500('0x55'),'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':_0x1500('0x55')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x1500('0x22')}];},'footer':function(_0x1f8753,_0x299afc){return[{'text':util[_0x1500('0x1e')](_0x1500('0x56'),_0x4b2103,_0x1f8753,_0x299afc,_0x1b9220),'style':_0x1500('0x27')}];}};}function writePDFDocument(_0x449b82,_0x30b0cb){return new Promise(function(_0x51c30d,_0x47b4ac){var _0x3fef14=_0x449b82[_0x1500('0x57')](fs[_0x1500('0x58')](_0x30b0cb));_0x3fef14['on']('finish',function(){_0x51c30d(_0x1500('0x59'));});_0x3fef14['on'](_0x1500('0x5a'),function(_0x21e981){_0x47b4ac(_0x21e981);});_0x449b82[_0x1500('0x5b')]();});}exports[_0x1500('0x5c')]=function(_0x41372e,_0x16ed26){var _0x39bd76=getPDFPrinter();var _0x26517a=getPDFDocDefinitionFromHTML(_0x41372e,_0x16ed26);var _0x12c9db=_0x39bd76[_0x1500('0x5d')](_0x26517a);return writePDFDocument(_0x12c9db,_0x16ed26['path'])[_0x1500('0x47')](function(_0x6e662a){throw _0x6e662a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 15012fe..71c54e0 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 _0xc283=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','sequelize','SELECT','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','zip'];(function(_0x45c459,_0x3b760a){var _0x2af29a=function(_0x2f7791){while(--_0x2f7791){_0x45c459['push'](_0x45c459['shift']());}};_0x2af29a(++_0x3b760a);}(_0xc283,0x17f));var _0x3c28=function(_0x3bf798,_0x240070){_0x3bf798=_0x3bf798-0x0;var _0x536c6d=_0xc283[_0x3bf798];return _0x536c6d;};'use strict';var util=require(_0x3c28('0x0'));var path=require(_0x3c28('0x1'));var _=require(_0x3c28('0x2'));var fs=require('fs');var json2xls=require(_0x3c28('0x3'));var BPromise=require(_0x3c28('0x4'));var zipdir=require(_0x3c28('0x5'));var rimraf=require(_0x3c28('0x6'));var db=require(_0x3c28('0x7'))['db'];var dbH=require('../../mysqldb')[_0x3c28('0x8')];var logger=require('../../config/logger')(_0x3c28('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x3c28('0xa')][0x2]);var QUERY=process[_0x3c28('0xa')][0x3];var PATH=process[_0x3c28('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x585fb8,_0x51cce0){var _0x44ae7b={'status':_0x585fb8};var _0x21062e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51cce0){_0x44ae7b[_0x3c28('0xb')]=_0x51cce0;}return db[_0x3c28('0xc')]['update'](_0x44ae7b,_0x21062e);}function main(){var _0x1a2542=0x1388;var _0x279672;logger['info'](util[_0x3c28('0xd')](_0x3c28('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x3c28('0xf')][_0x3c28('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3c28('0x11'),'splitSizeXlsx']})[_0x3c28('0x12')](function(_0x5386ca){if(_0x5386ca){_0x279672=_0x5386ca;_0x1a2542=_0x279672[_0x3c28('0x13')]||0x1388;}})[_0x3c28('0x12')](function(){return dbH['sequelize'][_0x3c28('0x14')](util[_0x3c28('0xd')](_0x3c28('0x15'),QUERY),{'type':dbH['sequelize'][_0x3c28('0x16')]['SELECT']});})[_0x3c28('0x12')](function(_0x4b9636){if(!_0x4b9636[0x0][_0x3c28('0x17')]){return analyticExtractedReport(_0x3c28('0x18'));}var _0x1aa6e6=[];var _0x4e1b0e=0x0;if(_0x279672['split']){if(_0x4b9636&&_0x4b9636[_0x3c28('0x19')]){var _0x364aed=_[_0x3c28('0x1a')](_0x4b9636[0x0]['num']/_0x1a2542);var _0x3e967e=Number[_0x3c28('0x1b')](_0x4b9636[0x0][_0x3c28('0x17')]/_0x1a2542)?_0x4b9636[0x0]['num']%_0x1a2542:0x0;_0x364aed[_0x3c28('0x1c')](function(_0x26503d){if(_0x26503d>0x0){_0x4e1b0e+=_0x1a2542;}_0x1aa6e6['push'](dbH[_0x3c28('0x1d')][_0x3c28('0x14')](util[_0x3c28('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1a2542,_0x4e1b0e),{'type':dbH[_0x3c28('0x1d')]['QueryTypes'][_0x3c28('0x1e')]}));});if(_0x3e967e>0x0){_0x4e1b0e+=_0x1a2542;_0x1aa6e6[_0x3c28('0x1f')](dbH[_0x3c28('0x1d')][_0x3c28('0x14')](util[_0x3c28('0xd')](_0x3c28('0x20'),QUERY,_0x3e967e,_0x4e1b0e),{'type':dbH[_0x3c28('0x1d')]['QueryTypes'][_0x3c28('0x1e')]}));}}}else{_0x1aa6e6[_0x3c28('0x1f')](dbH[_0x3c28('0x1d')][_0x3c28('0x14')](QUERY,{'type':dbH[_0x3c28('0x1d')]['QueryTypes'][_0x3c28('0x1e')]}));}var _0xbe8df=path[_0x3c28('0x21')](PATH);var _0x232a88=path[_0x3c28('0x22')](PATH,_0x3c28('0x23'));var _0x57a09e=_0x279672['split']&&_0x1aa6e6[_0x3c28('0x19')]>0x1;var _0x1b70df=[];if(!fs['existsSync'](path[_0x3c28('0x24')](_0xbe8df,_0x232a88))&&_0x57a09e){fs[_0x3c28('0x25')](path['join'](_0xbe8df,_0x232a88));}return BPromise[_0x3c28('0x26')](_0x1aa6e6,function(_0x57d3aa){_0x1b70df[_0x3c28('0x1f')](_0x57d3aa);})[_0x3c28('0x12')](function(){for(var _0x21d343=0x0;_0x21d343<_0x1b70df['length'];_0x21d343+=0x1){var _0x3a9047;var _0x4f25ea=_0x1b70df[_0x21d343];if(_0x57a09e){_0x3a9047=path[_0x3c28('0x24')](_0xbe8df,_0x232a88,util[_0x3c28('0xd')](_0x3c28('0x27'),_0x232a88,_0x21d343,_0x3c28('0x28')));}else{_0x3a9047=path[_0x3c28('0x24')](_0xbe8df,util[_0x3c28('0xd')](_0x3c28('0x29'),_0x232a88,'xlsx'));}fs[_0x3c28('0x2a')](_0x3a9047,json2xls(_0x4f25ea),_0x3c28('0x2b'));}})[_0x3c28('0x12')](function(){if(_0x57a09e){return new Promise(function(_0x451824){zipdir(path[_0x3c28('0x24')](_0xbe8df,_0x232a88),{'saveTo':path[_0x3c28('0x24')](_0xbe8df,util[_0x3c28('0xd')](_0x3c28('0x29'),_0x232a88,'zip'))},function(_0x2ddbb7,_0x324a6a){rimraf(path[_0x3c28('0x24')](_0xbe8df,_0x232a88),function(){});_0x451824('zip\x20finished');});});}})[_0x3c28('0x12')](function(){logger[_0x3c28('0x2c')](util['format'](_0x3c28('0x2d'),EXTRACTED_REPORT_ID,_0x3c28('0x2e')));return analyticExtractedReport(_0x3c28('0x2f'),_0x57a09e?util['format'](_0x3c28('0x29'),_0x232a88,_0x57a09e?_0x3c28('0x30'):_0x3c28('0x28')):null);});})['catch'](function(_0x1f67bd){logger[_0x3c28('0x2c')](util[_0x3c28('0xd')](_0x3c28('0x31'),EXTRACTED_REPORT_ID,_0x3c28('0x2e')),util[_0x3c28('0x32')](_0x1f67bd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3c28('0x33'));})[_0x3c28('0x34')](function(){process[_0x3c28('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x43b1=['argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','split','existsSync','join','mkdirSync','each','push','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x43b1,0x94));var _0x143b=function(_0x301efc,_0x1ada57){_0x301efc=_0x301efc-0x0;var _0x199cb9=_0x43b1[_0x301efc];return _0x199cb9;};'use strict';var util=require(_0x143b('0x0'));var path=require(_0x143b('0x1'));var _=require(_0x143b('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x143b('0x3'));var zipdir=require(_0x143b('0x4'));var rimraf=require('rimraf');var db=require(_0x143b('0x5'))['db'];var dbH=require(_0x143b('0x5'))[_0x143b('0x6')];var logger=require(_0x143b('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x143b('0x8')][0x2]);var QUERY=process[_0x143b('0x8')][0x3];var PATH=process[_0x143b('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1c62b7,_0x4cae90){var _0x15b9fd={'status':_0x1c62b7};var _0x37fad1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4cae90){_0x15b9fd[_0x143b('0x9')]=_0x4cae90;}return db['AnalyticExtractedReport'][_0x143b('0xa')](_0x15b9fd,_0x37fad1);}function main(){var _0x398a98=0x1388;var _0x22c78b;logger[_0x143b('0xb')](util[_0x143b('0xc')](_0x143b('0xd'),EXTRACTED_REPORT_ID,_0x143b('0xe')));return db[_0x143b('0xf')][_0x143b('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x143b('0x11')]})[_0x143b('0x12')](function(_0x4bda6d){if(_0x4bda6d){_0x22c78b=_0x4bda6d;_0x398a98=_0x22c78b[_0x143b('0x11')]||0x1388;}})[_0x143b('0x12')](function(){return dbH[_0x143b('0x13')]['query'](util[_0x143b('0xc')](_0x143b('0x14'),QUERY),{'type':dbH['sequelize'][_0x143b('0x15')][_0x143b('0x16')]});})[_0x143b('0x12')](function(_0x10ce95){if(!_0x10ce95[0x0][_0x143b('0x17')]){return analyticExtractedReport('Empty');}var _0x345345=[];var _0x178ca0=0x0;if(_0x22c78b['split']){if(_0x10ce95&&_0x10ce95[_0x143b('0x18')]){var _0x33fbe3=_[_0x143b('0x19')](_0x10ce95[0x0][_0x143b('0x17')]/_0x398a98);var _0x3a0baa=Number[_0x143b('0x1a')](_0x10ce95[0x0][_0x143b('0x17')]/_0x398a98)?_0x10ce95[0x0]['num']%_0x398a98:0x0;_0x33fbe3[_0x143b('0x1b')](function(_0x270f89){if(_0x270f89>0x0){_0x178ca0+=_0x398a98;}_0x345345['push'](dbH['sequelize'][_0x143b('0x1c')](util[_0x143b('0xc')](_0x143b('0x1d'),QUERY,_0x398a98,_0x178ca0),{'type':dbH[_0x143b('0x13')]['QueryTypes'][_0x143b('0x16')]}));});if(_0x3a0baa>0x0){_0x178ca0+=_0x398a98;_0x345345['push'](dbH[_0x143b('0x13')][_0x143b('0x1c')](util['format'](_0x143b('0x1d'),QUERY,_0x3a0baa,_0x178ca0),{'type':dbH[_0x143b('0x13')][_0x143b('0x15')][_0x143b('0x16')]}));}}}else{_0x345345['push'](dbH[_0x143b('0x13')][_0x143b('0x1c')](QUERY,{'type':dbH[_0x143b('0x13')][_0x143b('0x15')]['SELECT']}));}var _0x1b5cfb=path[_0x143b('0x1e')](PATH);var _0x3b7e9a=path['basename'](PATH,_0x143b('0x1f'));var _0x675bcf=_0x22c78b[_0x143b('0x20')]&&_0x345345[_0x143b('0x18')]>0x1;var _0x4abde2=[];if(!fs[_0x143b('0x21')](path[_0x143b('0x22')](_0x1b5cfb,_0x3b7e9a))&&_0x675bcf){fs[_0x143b('0x23')](path[_0x143b('0x22')](_0x1b5cfb,_0x3b7e9a));}return BPromise[_0x143b('0x24')](_0x345345,function(_0x358a85){_0x4abde2[_0x143b('0x25')](_0x358a85);})['then'](function(){for(var _0x1918c6=0x0;_0x1918c6<_0x4abde2[_0x143b('0x18')];_0x1918c6+=0x1){var _0x540dcd;var _0x1e7e00=_0x4abde2[_0x1918c6];if(_0x675bcf){_0x540dcd=path[_0x143b('0x22')](_0x1b5cfb,_0x3b7e9a,util[_0x143b('0xc')](_0x143b('0x26'),_0x3b7e9a,_0x1918c6,'xlsx'));}else{_0x540dcd=path['join'](_0x1b5cfb,util[_0x143b('0xc')](_0x143b('0x27'),_0x3b7e9a,_0x143b('0x28')));}fs[_0x143b('0x29')](_0x540dcd,json2xls(_0x1e7e00),_0x143b('0x2a'));}})[_0x143b('0x12')](function(){if(_0x675bcf){return new Promise(function(_0x4f4d82){zipdir(path[_0x143b('0x22')](_0x1b5cfb,_0x3b7e9a),{'saveTo':path[_0x143b('0x22')](_0x1b5cfb,util['format'](_0x143b('0x27'),_0x3b7e9a,'zip'))},function(_0x34649e,_0x5d8e52){rimraf(path[_0x143b('0x22')](_0x1b5cfb,_0x3b7e9a),function(){});_0x4f4d82(_0x143b('0x2b'));});});}})[_0x143b('0x12')](function(){logger[_0x143b('0xb')](util[_0x143b('0xc')](_0x143b('0x2c'),EXTRACTED_REPORT_ID,_0x143b('0xe')));return analyticExtractedReport(_0x143b('0x2d'),_0x675bcf?util[_0x143b('0xc')](_0x143b('0x27'),_0x3b7e9a,_0x675bcf?'zip':_0x143b('0x28')):null);});})[_0x143b('0x2e')](function(_0x42465b){logger['info'](util[_0x143b('0xc')](_0x143b('0x2f'),EXTRACTED_REPORT_ID,_0x143b('0xe')),util[_0x143b('0x30')](_0x42465b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x143b('0x31'));})[_0x143b('0x32')](function(){process[_0x143b('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 62d9bdb..0b6debd 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 _0x6764=['exten','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','type','format','CDR(type)=%s','context','priority','inbound','Set','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','createdAt','updatedAt','interval','*,*,*,*','map','IntervalId','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','error','rewrite','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq'];(function(_0x29eae1,_0x263fec){var _0x5aac45=function(_0x3121ec){while(--_0x3121ec){_0x29eae1['push'](_0x29eae1['shift']());}};_0x5aac45(++_0x263fec);}(_0x6764,0x196));var _0x4676=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6764[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x4676('0x0'));function rewrite(_0x45018c,_0x13eff4){var _0x510a7a=this;return _0x45018c[_0x4676('0x1')][_0x4676('0x2')][_0x4676('0x3')]({'raw':!![]})[_0x4676('0x4')](function(_0x45157d){_0x510a7a[_0x4676('0x5')]=_0x45157d;return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x3')]({'where':{'IntervalId':_0x13eff4['IntervalId']},'raw':!![]});})[_0x4676('0x4')](function(_0x88c364){return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x3')]({'where':{'exten':{'$in':_[_0x4676('0x7')](_['map'](_0x88c364,_0x4676('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x4676('0x4')](function(_0x28682d){var _0x50159b=_[_0x4676('0x9')](_0x28682d,{'priority':'1'});var _0x9584cf=_[_0x4676('0x9')](_0x28682d,{'isApp':0x1});var _0x39c83c=_[_0x4676('0xa')](_0x9584cf,'exten');var _0x3c5f36=[_0x4676('0xb'),_0x4676('0xc')];var _0x140d76=[];var _0x335ff7=[];for(var _0x57dbda in _0x39c83c){if(_0x39c83c[_0x4676('0xd')](_0x57dbda)){_0x510a7a['priority']=0x2;_0x510a7a[_0x4676('0xe')]=[];_0x510a7a[_0x4676('0xf')]=_[_0x4676('0x10')](_0x50159b,{'exten':_0x39c83c[_0x57dbda][0x0]['exten']});_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Set','appdata':util[_0x4676('0x13')](_0x4676('0x14'),_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')]),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']});if(_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')]===_0x4676('0x17')){_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':'CDR(routeid)='+_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a['priority']++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}else if(_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')]===_0x4676('0x1a')){if(_0x510a7a[_0x4676('0xf')]){_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':_0x4676('0x1b')+(_0x510a7a[_0x4676('0xf')]['cutdigits']?_0x4676('0x1c')+_0x510a7a[_0x4676('0xf')][_0x4676('0x1d')]+'}':_0x4676('0x1e')),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Set','appdata':_0x4676('0x1f')+_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId'],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});var _0x5850ac=_0x510a7a[_0x4676('0x16')]++;_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5850ac+0x2)+_0x4676('0x21')+(_0x5850ac+0x1)+')','context':_0x39c83c[_0x57dbda][0x0]['context'],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x5850ac,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']});if(_0x510a7a[_0x4676('0xf')]){_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':_0x510a7a['extension'][_0x4676('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x510a7a[_0x4676('0xf')]['cutdigits']+'}':_0x4676('0x22'),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':'outboundrouteid='+_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId'],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a['priority']++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});if(_0x510a7a['extension']&&_0x510a7a[_0x4676('0xf')]['hasOwnProperty'](_0x4676('0x23'))&&_0x510a7a[_0x4676('0xf')][_0x4676('0x23')]!==_0x4676('0x24')){_0x510a7a['extensions'][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':'Set','appdata':_0x4676('0x25'),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']});_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0]['type'],'app':_0x4676('0x18'),'appdata':_0x4676('0x26')+_0x510a7a['extension'][_0x4676('0x23')]||'wav','context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a['priority']++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}}_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':_0x4676('0x27'),'context':_0x39c83c[_0x57dbda][0x0]['context'],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});_0x510a7a[_0x4676('0xe')][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Set','appdata':_0x4676('0x28'),'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0]['exten'],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});_0x510a7a['extensions'][_0x4676('0x11')]({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':'MONITOR_OPTIONS=ab','context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'priority':_0x510a7a[_0x4676('0x16')]++,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});for(var _0x58d2fe=0x0,_0x4eaa7b=0x0;_0x58d2fe<_0x39c83c[_0x57dbda]['length'];_0x58d2fe+=0x1,_0x4eaa7b=0x0){var _0x4a65f8=_0x39c83c[_0x57dbda][_0x58d2fe];if(_0x4a65f8[_0x4676('0x12')]){_0x4a65f8[_0x4676('0x12')]=_0x4a65f8[_0x4676('0x12')]['toLowerCase']();}var _0x413a20=[];var _0x3d04b5=[];delete _0x4a65f8['id'];delete _0x4a65f8[_0x4676('0x29')];delete _0x4a65f8[_0x4676('0x2a')];var _0x2c9390=_0x4a65f8[_0x4676('0x2b')]!==_0x4676('0x2c')?[_0x4a65f8[_0x4676('0x2b')]]:_0x4a65f8['IntervalId']?_[_0x4676('0x2d')](_[_0x4676('0x9')](_0x510a7a['intervals'],{'IntervalId':_0x4a65f8[_0x4676('0x2e')]}),_0x4676('0x2b')):[];if(_0x4a65f8[_0x4676('0xd')](_0x4676('0x2f'))){if(_0x4a65f8[_0x4676('0x2f')]&&_0x4a65f8['tag']!=='--'){_0x413a20['push']({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x18'),'appdata':_0x4676('0x30')+_0x4a65f8[_0x4676('0x2f')],'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}}if(_0x4a65f8[_0x4676('0x12')]===_0x4676('0x1a')&&_0x4a65f8[_0x4676('0xd')]('callerID')){if(_0x4a65f8['callerID']){_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x4a65f8[_0x4676('0x32')]+')','context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8['exten'],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}else{_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':_0x4676('0x33'),'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8[_0x4676('0x19')]});}}if(_0x4a65f8[_0x4676('0xd')](_0x4676('0x34'))){if(_0x3c5f36['indexOf'](_0x4a65f8['app'][_0x4676('0x35')]())>=0x0&&_0x4a65f8[_0x4676('0x36')]!==_0x4676('0x37')){if(_0x4a65f8[_0x4676('0x34')]){_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':_0x4676('0x38'),'context':_0x4a65f8['context'],'exten':_0x4a65f8['exten'],'priority':_0x2c9390['length']+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8[_0x4676('0x19')]});_0x413a20['push']({'type':_0x4a65f8['type'],'app':_0x4676('0x18'),'appdata':_0x4676('0x39'),'context':_0x4a65f8['context'],'exten':_0x4a65f8['exten'],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}else{_0x413a20['push']({'type':_0x4a65f8[_0x4676('0x12')],'app':_0x4676('0x20'),'appdata':_0x4676('0x3a'),'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390['length']+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});_0x413a20[_0x4676('0x11')]({'type':_0x4a65f8['type'],'app':'Set','appdata':_0x4676('0x3b'),'context':_0x4a65f8[_0x4676('0x15')],'exten':_0x4a65f8[_0x4676('0x8')],'priority':_0x2c9390[_0x4676('0x31')]+_0x510a7a[_0x4676('0x16')]+_0x4eaa7b++,'VoiceExtensionId':_0x4a65f8['VoiceExtensionId']});}}}for(var _0x5e8b5=0x0;_0x5e8b5<_0x2c9390[_0x4676('0x31')];_0x5e8b5+=0x1){var _0x49db4f=_0x510a7a[_0x4676('0x16')]+_0x2c9390['length'];var _0x587692=_0x5e8b5===_0x2c9390[_0x4676('0x31')]-0x1?_0x510a7a[_0x4676('0x16')]+_0x413a20[_0x4676('0x31')]+_0x3d04b5[_0x4676('0x31')]+0x2:_0x510a7a[_0x4676('0x16')]+_0x5e8b5+0x1;_0x413a20[_0x4676('0x3c')](_0x5e8b5,0x0,{'type':_0x4a65f8['type'],'app':'GotoIfTime','appdata':_0x2c9390[_0x5e8b5]+'?'+_0x4a65f8[_0x4676('0x15')]+_0x4676('0x3d')+_0x49db4f+':'+_0x4a65f8[_0x4676('0x15')]+_0x4676('0x3d')+_0x587692,'exten':_0x4a65f8[_0x4676('0x8')],'context':_0x4a65f8[_0x4676('0x15')],'priority':_0x510a7a[_0x4676('0x16')]+_0x5e8b5,'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});}_0x4a65f8[_0x4676('0x16')]=_0x413a20[_0x4676('0x31')]?_[_0x4676('0x3e')](_0x413a20)['priority']+0x1:_0x510a7a['priority'];_0x510a7a[_0x4676('0x16')]=(_0x3d04b5[_0x4676('0x31')]?_['last'](_0x3d04b5)[_0x4676('0x16')]:_0x4a65f8['priority'])+0x1;_0x510a7a[_0x4676('0xe')]=_[_0x4676('0x3f')](_0x510a7a[_0x4676('0xe')],_0x413a20,[_0x4a65f8],_0x3d04b5);}_0x510a7a[_0x4676('0xe')]['push']({'type':_0x39c83c[_0x57dbda][0x0][_0x4676('0x12')],'app':'Hangup','exten':_0x39c83c[_0x57dbda][0x0][_0x4676('0x8')],'context':_0x39c83c[_0x57dbda][0x0][_0x4676('0x15')],'priority':_0x510a7a['priority'],'VoiceExtensionId':_0x39c83c[_0x57dbda][0x0][_0x4676('0x19')]});_0x140d76[_0x4676('0x11')](_0x39c83c[_0x57dbda][0x0]['VoiceExtensionId']);_0x335ff7=_[_0x4676('0x3f')](_0x335ff7,_0x510a7a[_0x4676('0xe')]);}}return _0x45018c['transaction'](function(_0x5cf00e){return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x140d76}},'transaction':_0x5cf00e})[_0x4676('0x4')](function(_0x2fa3b2){return _0x45018c[_0x4676('0x1')][_0x4676('0x6')][_0x4676('0x41')](_[_0x4676('0x42')](_0x335ff7,'priority'),{'transaction':_0x5cf00e});});});})['catch'](function(_0x40ffb1){console[_0x4676('0x43')](_0x40ffb1);});}exports[_0x4676('0x44')]=rewrite; \ No newline at end of file +var _0x7fe0=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','IntervalId','map','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','models','bulkCreate','sortBy','catch','lodash','util','findAll','intervals','then','VoiceExtension','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','Set','type','context','VoiceExtensionId','inbound','CDR(routeid)=','priority','CDR(destination)=','cutdigits','ExecIf'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7fe0,0x101));var _0x07fe=function(_0x4b5af9,_0x799ba3){_0x4b5af9=_0x4b5af9-0x0;var _0xe36f01=_0x7fe0[_0x4b5af9];return _0xe36f01;};'use strict';var _=require(_0x07fe('0x0'));var util=require(_0x07fe('0x1'));function rewrite(_0x12b470,_0x17754d){var _0x5d9702=this;return _0x12b470['models']['Interval'][_0x07fe('0x2')]({'raw':!![]})['then'](function(_0x49f473){_0x5d9702[_0x07fe('0x3')]=_0x49f473;return _0x12b470['models']['VoiceExtension']['findAll']({'where':{'IntervalId':_0x17754d['IntervalId']},'raw':!![]});})[_0x07fe('0x4')](function(_0x76ad6f){return _0x12b470['models'][_0x07fe('0x5')][_0x07fe('0x2')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x76ad6f,_0x07fe('0x6')))}},'order':[{'raw':_0x07fe('0x7')}],'raw':!![]});})[_0x07fe('0x4')](function(_0x2a3356){var _0x52ba4e=_[_0x07fe('0x8')](_0x2a3356,{'priority':'1'});var _0x1727f3=_[_0x07fe('0x8')](_0x2a3356,{'isApp':0x1});var _0x58cc6e=_[_0x07fe('0x9')](_0x1727f3,_0x07fe('0x6'));var _0x25f150=[_0x07fe('0xa'),_0x07fe('0xb')];var _0x51f59c=[];var _0x9c0f84=[];for(var _0xaa24de in _0x58cc6e){if(_0x58cc6e[_0x07fe('0xc')](_0xaa24de)){_0x5d9702['priority']=0x2;_0x5d9702[_0x07fe('0xd')]=[];_0x5d9702[_0x07fe('0xe')]=_[_0x07fe('0xf')](_0x52ba4e,{'exten':_0x58cc6e[_0xaa24de][0x0]['exten']});_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0]['type'],'app':_0x07fe('0x11'),'appdata':util['format']('CDR(type)=%s',_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')]),'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0]['exten'],'priority':_0x5d9702['priority']++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});if(_0x58cc6e[_0xaa24de][0x0]['type']===_0x07fe('0x15')){_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x16')+_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')],'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});}else if(_0x58cc6e[_0xaa24de][0x0]['type']==='outbound'){if(_0x5d9702['extension']){_0x5d9702[_0x07fe('0xd')]['push']({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x18')+(_0x5d9702[_0x07fe('0xe')][_0x07fe('0x19')]?'${EXTEN:'+_0x5d9702[_0x07fe('0xe')]['cutdigits']+'}':'${EXTEN}'),'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0]['exten'],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});}_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0]['type'],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x16')+_0x58cc6e[_0xaa24de][0x0]['VoiceExtensionId'],'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});var _0x51a6ea=_0x5d9702['priority']++;_0x5d9702['extensions'][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':_0x07fe('0x1a'),'appdata':_0x07fe('0x1b')+(_0x51a6ea+0x2)+_0x07fe('0x1c')+(_0x51a6ea+0x1)+')','context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x51a6ea,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0]['VoiceExtensionId']});if(_0x5d9702[_0x07fe('0xe')]){_0x5d9702['extensions']['push']({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x5d9702[_0x07fe('0xe')][_0x07fe('0x19')]?_0x07fe('0x1d')+_0x5d9702[_0x07fe('0xe')][_0x07fe('0x19')]+'}':_0x07fe('0x1e'),'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});}_0x5d9702['extensions']['push']({'type':_0x58cc6e[_0xaa24de][0x0]['type'],'app':'Set','appdata':_0x07fe('0x1f')+_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')],'context':_0x58cc6e[_0xaa24de][0x0]['context'],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702['priority']++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0]['VoiceExtensionId']});if(_0x5d9702[_0x07fe('0xe')]&&_0x5d9702[_0x07fe('0xe')][_0x07fe('0xc')](_0x07fe('0x20'))&&_0x5d9702['extension'][_0x07fe('0x20')]!=='none'){_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0]['type'],'app':_0x07fe('0x11'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702['priority']++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0]['VoiceExtensionId']});_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x21')+_0x5d9702['extension']['recordingFormat']||_0x07fe('0x22'),'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});}}_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':'Set','appdata':_0x07fe('0x23'),'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x24'),'context':_0x58cc6e[_0xaa24de][0x0]['context'],'exten':_0x58cc6e[_0xaa24de][0x0]['exten'],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x25'),'context':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x13')],'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'priority':_0x5d9702[_0x07fe('0x17')]++,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});for(var _0x288a8d=0x0,_0x48e905=0x0;_0x288a8d<_0x58cc6e[_0xaa24de][_0x07fe('0x26')];_0x288a8d+=0x1,_0x48e905=0x0){var _0x2e5be0=_0x58cc6e[_0xaa24de][_0x288a8d];if(_0x2e5be0['type']){_0x2e5be0[_0x07fe('0x12')]=_0x2e5be0[_0x07fe('0x12')]['toLowerCase']();}var _0x4d616d=[];var _0x5d325c=[];delete _0x2e5be0['id'];delete _0x2e5be0[_0x07fe('0x27')];delete _0x2e5be0[_0x07fe('0x28')];var _0x20eca3=_0x2e5be0[_0x07fe('0x29')]!=='*,*,*,*'?[_0x2e5be0[_0x07fe('0x29')]]:_0x2e5be0[_0x07fe('0x2a')]?_[_0x07fe('0x2b')](_[_0x07fe('0x8')](_0x5d9702['intervals'],{'IntervalId':_0x2e5be0[_0x07fe('0x2a')]}),_0x07fe('0x29')):[];if(_0x2e5be0['hasOwnProperty'](_0x07fe('0x2c'))){if(_0x2e5be0[_0x07fe('0x2c')]&&_0x2e5be0[_0x07fe('0x2c')]!=='--'){_0x4d616d[_0x07fe('0x10')]({'type':_0x2e5be0[_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x2d')+_0x2e5be0[_0x07fe('0x2c')],'context':_0x2e5be0[_0x07fe('0x13')],'exten':_0x2e5be0['exten'],'priority':_0x20eca3[_0x07fe('0x26')]+_0x5d9702[_0x07fe('0x17')]+_0x48e905++,'VoiceExtensionId':_0x2e5be0[_0x07fe('0x14')]});}}if(_0x2e5be0['type']===_0x07fe('0x2e')&&_0x2e5be0[_0x07fe('0xc')](_0x07fe('0x2f'))){if(_0x2e5be0[_0x07fe('0x2f')]){_0x4d616d[_0x07fe('0x10')]({'type':_0x2e5be0[_0x07fe('0x12')],'app':_0x07fe('0x1a'),'appdata':_0x07fe('0x30')+_0x2e5be0[_0x07fe('0x2f')]+')','context':_0x2e5be0[_0x07fe('0x13')],'exten':_0x2e5be0['exten'],'priority':_0x20eca3[_0x07fe('0x26')]+_0x5d9702[_0x07fe('0x17')]+_0x48e905++,'VoiceExtensionId':_0x2e5be0['VoiceExtensionId']});}else{_0x4d616d[_0x07fe('0x10')]({'type':_0x2e5be0[_0x07fe('0x12')],'app':_0x07fe('0x1a'),'appdata':_0x07fe('0x31'),'context':_0x2e5be0[_0x07fe('0x13')],'exten':_0x2e5be0[_0x07fe('0x6')],'priority':_0x20eca3[_0x07fe('0x26')]+_0x5d9702[_0x07fe('0x17')]+_0x48e905++,'VoiceExtensionId':_0x2e5be0[_0x07fe('0x14')]});}}if(_0x2e5be0[_0x07fe('0xc')]('answer')){if(_0x25f150[_0x07fe('0x32')](_0x2e5be0[_0x07fe('0x33')][_0x07fe('0x34')]())>=0x0&&_0x2e5be0['appType']!==_0x07fe('0x35')){if(_0x2e5be0[_0x07fe('0x36')]){_0x4d616d['push']({'type':_0x2e5be0[_0x07fe('0x12')],'app':'ExecIf','appdata':_0x07fe('0x37'),'context':_0x2e5be0[_0x07fe('0x13')],'exten':_0x2e5be0['exten'],'priority':_0x20eca3[_0x07fe('0x26')]+_0x5d9702[_0x07fe('0x17')]+_0x48e905++,'VoiceExtensionId':_0x2e5be0[_0x07fe('0x14')]});_0x4d616d[_0x07fe('0x10')]({'type':_0x2e5be0[_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x38'),'context':_0x2e5be0[_0x07fe('0x13')],'exten':_0x2e5be0[_0x07fe('0x6')],'priority':_0x20eca3[_0x07fe('0x26')]+_0x5d9702[_0x07fe('0x17')]+_0x48e905++,'VoiceExtensionId':_0x2e5be0[_0x07fe('0x14')]});}else{_0x4d616d[_0x07fe('0x10')]({'type':_0x2e5be0[_0x07fe('0x12')],'app':_0x07fe('0x1a'),'appdata':_0x07fe('0x39'),'context':_0x2e5be0['context'],'exten':_0x2e5be0['exten'],'priority':_0x20eca3[_0x07fe('0x26')]+_0x5d9702[_0x07fe('0x17')]+_0x48e905++,'VoiceExtensionId':_0x2e5be0[_0x07fe('0x14')]});_0x4d616d['push']({'type':_0x2e5be0[_0x07fe('0x12')],'app':_0x07fe('0x11'),'appdata':_0x07fe('0x3a'),'context':_0x2e5be0[_0x07fe('0x13')],'exten':_0x2e5be0['exten'],'priority':_0x20eca3['length']+_0x5d9702[_0x07fe('0x17')]+_0x48e905++,'VoiceExtensionId':_0x2e5be0['VoiceExtensionId']});}}}for(var _0x21352c=0x0;_0x21352c<_0x20eca3[_0x07fe('0x26')];_0x21352c+=0x1){var _0x2bfdd3=_0x5d9702[_0x07fe('0x17')]+_0x20eca3[_0x07fe('0x26')];var _0x15b29f=_0x21352c===_0x20eca3[_0x07fe('0x26')]-0x1?_0x5d9702['priority']+_0x4d616d[_0x07fe('0x26')]+_0x5d325c['length']+0x2:_0x5d9702[_0x07fe('0x17')]+_0x21352c+0x1;_0x4d616d[_0x07fe('0x3b')](_0x21352c,0x0,{'type':_0x2e5be0[_0x07fe('0x12')],'app':_0x07fe('0x3c'),'appdata':_0x20eca3[_0x21352c]+'?'+_0x2e5be0[_0x07fe('0x13')]+_0x07fe('0x3d')+_0x2bfdd3+':'+_0x2e5be0[_0x07fe('0x13')]+',${EXTEN},'+_0x15b29f,'exten':_0x2e5be0[_0x07fe('0x6')],'context':_0x2e5be0[_0x07fe('0x13')],'priority':_0x5d9702[_0x07fe('0x17')]+_0x21352c,'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});}_0x2e5be0[_0x07fe('0x17')]=_0x4d616d[_0x07fe('0x26')]?_['last'](_0x4d616d)[_0x07fe('0x17')]+0x1:_0x5d9702[_0x07fe('0x17')];_0x5d9702['priority']=(_0x5d325c[_0x07fe('0x26')]?_[_0x07fe('0x3e')](_0x5d325c)[_0x07fe('0x17')]:_0x2e5be0[_0x07fe('0x17')])+0x1;_0x5d9702[_0x07fe('0xd')]=_['concat'](_0x5d9702[_0x07fe('0xd')],_0x4d616d,[_0x2e5be0],_0x5d325c);}_0x5d9702[_0x07fe('0xd')][_0x07fe('0x10')]({'type':_0x58cc6e[_0xaa24de][0x0]['type'],'app':_0x07fe('0x3f'),'exten':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x6')],'context':_0x58cc6e[_0xaa24de][0x0]['context'],'priority':_0x5d9702[_0x07fe('0x17')],'VoiceExtensionId':_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]});_0x51f59c['push'](_0x58cc6e[_0xaa24de][0x0][_0x07fe('0x14')]);_0x9c0f84=_[_0x07fe('0x40')](_0x9c0f84,_0x5d9702['extensions']);}}return _0x12b470[_0x07fe('0x41')](function(_0x5026c4){return _0x12b470['models'][_0x07fe('0x5')][_0x07fe('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x51f59c}},'transaction':_0x5026c4})[_0x07fe('0x4')](function(_0xd7e69){return _0x12b470[_0x07fe('0x43')][_0x07fe('0x5')][_0x07fe('0x44')](_[_0x07fe('0x45')](_0x9c0f84,_0x07fe('0x17')),{'transaction':_0x5026c4});});});})[_0x07fe('0x46')](function(_0x12f527){console['error'](_0x12f527);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index f390cf8..5942e04 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 _0xe3ca=['id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','query','VoiceQueueId','sequelize','VoiceQueue','BlackLists','all','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0x3979bf,_0x167bfc){var _0x238dfa=function(_0x2cf3a0){while(--_0x2cf3a0){_0x3979bf['push'](_0x3979bf['shift']());}};_0x238dfa(++_0x167bfc);}(_0xe3ca,0x17f));var _0xae3c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xe3ca[_0x36eaaa];return _0x461349;};'use strict';var BPromise=require('bluebird');var util=require(_0xae3c('0x0'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xae3c('0x1'));var Redis=require(_0xae3c('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xae3c('0x3'));var logger=require(_0xae3c('0x4'))(_0xae3c('0x5'));config[_0xae3c('0x6')]=_[_0xae3c('0x7')](config[_0xae3c('0x6')],{'host':_0xae3c('0x8'),'port':0x18eb});var socket=require(_0xae3c('0x9'))(new Redis(config[_0xae3c('0x6')]));require(_0xae3c('0xa'))[_0xae3c('0xb')](socket);try{if(!process['argv'][0x2]||process[_0xae3c('0xc')][0x2]==='undefined'||process[_0xae3c('0xc')][0x2]==='null'){throw new Error(_0xae3c('0xd'));}var FILEPATH=process[_0xae3c('0xc')][0x2];if(!process[_0xae3c('0xc')][0x3]||process[_0xae3c('0xc')][0x3]===_0xae3c('0xe')||process[_0xae3c('0xc')][0x3]===_0xae3c('0xf')||!process[_0xae3c('0xc')][0x4]||process['argv'][0x4]===_0xae3c('0xe')||process[_0xae3c('0xc')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xae3c('0x10')](process['argv'][0x3]['split'](','),process[_0xae3c('0xc')][0x4][_0xae3c('0x11')](','));if(!process[_0xae3c('0xc')][0x5]||process['argv'][0x5]===_0xae3c('0xe')||process[_0xae3c('0xc')][0x5]===_0xae3c('0xf')){throw new Error(_0xae3c('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xae3c('0xc')][0x6]&&process[_0xae3c('0xc')][0x6]!=='undefined'&&process[_0xae3c('0xc')][0x6]!==_0xae3c('0xf')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xae3c('0xc')][0x7]!=='undefined'&&process[_0xae3c('0xc')][0x7]!==_0xae3c('0xf')?process[_0xae3c('0xc')][0x7]:null;if(!process[_0xae3c('0xc')][0x8]||process[_0xae3c('0xc')][0x8]===_0xae3c('0xe')||process['argv'][0x8]===_0xae3c('0xf')){throw new Error(_0xae3c('0x13'));}var SOCKET_TIMESTAMP=process[_0xae3c('0xc')][0x8];}catch(_0x473f3b){logger[_0xae3c('0x14')](_0x473f3b);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(_0x343b03,_0x13e14,_0x18d676,_0x1c4abb){var _0x1b2391={'message':_0x13e14};_0x1b2391[_0x343b03]=!![];if(_0x18d676){_0x1b2391['contact']=_0x18d676;}if(_0x1c4abb){_0x1b2391[_0xae3c('0x15')]=_0x1c4abb;}return _0x1b2391;}function isEmail(_0x229b05){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))*$/[_0xae3c('0x16')](_0x229b05);}function checkRow(_0x4031f2,_0x520576,_0x1b200b){return new BPromise(function(_0x3aaa05,_0x32a718){if(_[_0xae3c('0x17')](_0x4031f2)){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x18'),null,_0x1b200b));}if(_0x4031f2[_0xae3c('0x19')]&&_0x4031f2['errors'][_0xae3c('0x1a')]){var _0x509aea=_[_0xae3c('0x1b')](_0x4031f2[_0xae3c('0x19')],_0xae3c('0x1c'))[_0xae3c('0x1d')](';');return _0x32a718(handleCheckRowError('error',_0x509aea,null,_0x1b200b));}var _0x362247={};for(var _0x46150f in FIELDS){if(FIELDS[_0xae3c('0x1e')](_0x46150f)&&FIELDS[_0x46150f]){_0x362247[_0x46150f]=_0x4031f2[_0xae3c('0x1f')][0x0][FIELDS[_0x46150f]]||_0x4031f2[_0xae3c('0x1f')][0x0]['\ufeff'+FIELDS[_0x46150f]];}}if(!_0x362247[_0xae3c('0x20')]){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),'firstName\x20not\x20specified!',null,_0x1b200b));}if(!_0x362247[_0xae3c('0x21')]){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x22'),null,_0x1b200b));}if(_0x362247['birthDate']){var _0x1b97bb=moment(_0x362247['birthDate'],_0xae3c('0x23'));if(!_0x1b97bb[_0xae3c('0x24')]()){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x25'),null,_0x1b200b));}}if(_0x362247[_0xae3c('0x26')]){if(!isEmail(_0x362247[_0xae3c('0x26')])){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x27'),null,_0x1b200b));}}_0x362247[_0xae3c('0x28')]=LISTID;_0x362247[_0xae3c('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xae3c('0x1a')]&&_0x520576){var _0x5f2620={};for(var _0x4063ac=0x0,_0x12e138=DUPLICATES[_0xae3c('0x1a')];_0x4063ac<_0x12e138;_0x4063ac+=0x1){_0x5f2620[DUPLICATES[_0x4063ac]]=_0x362247[DUPLICATES[_0x4063ac]];}var _0x9e4ada=_[_0xae3c('0x2a')](_0x520576,_0x5f2620);if(_0x9e4ada){return _0x32a718(handleCheckRowError(_0xae3c('0x2b'),_0xae3c('0x2c'),_0x9e4ada,_0x1b200b));}}return db['CmContact']['create'](_0x362247,{'raw':!![],'hooks':![],'fields':_[_0xae3c('0x2d')](_0x362247)})[_0xae3c('0x2e')](function(_0x44b120){if(DUPLICATES&&DUPLICATES[_0xae3c('0x1a')]&&_0x520576){_0x520576['push'](_[_0xae3c('0x2f')](_0x362247,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x44b120['id'];return _0x3aaa05();})[_0xae3c('0x30')](function(_0x513d67){return _0x32a718(handleCheckRowError(_0xae3c('0x14'),_0xae3c('0x31')+(_0x513d67[_0xae3c('0x1c')]||JSON[_0xae3c('0x32')](_0x513d67)),null,_0x1b200b));});});}function checkHopper(){function _0x5a6beb(){return function(_0x16104e){logger[_0xae3c('0x14')](_0xae3c('0x33'),_0xae3c('0x34'),util[_0xae3c('0x35')](_0x16104e,{'showHidden':![],'depth':null}));};}var _0x309434=function(_0x4468ff,_0x574017){var _0x4f0fa8=squel[_0xae3c('0x36')]()[_0xae3c('0x37')](_0xae3c('0x38'))[_0xae3c('0x39')](['phone','scheduledAt',_0xae3c('0x3a'),'ListId',_0x574017,_0xae3c('0x3b'),_0xae3c('0x3c')],squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x21'),_0xae3c('0x21'))['field'](_0xae3c('0x3f'),_0xae3c('0x40'))[_0xae3c('0x3e')]('id','ContactId')[_0xae3c('0x3e')](LISTID[_0xae3c('0x41')](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x4468ff['id']['toString'](),_0x574017)[_0xae3c('0x3e')](_0xae3c('0x3f'),'createdAt')[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3c'))[_0xae3c('0x42')](_0xae3c('0x43'))[_0xae3c('0x44')](_0xae3c('0x45'))['where'](_0xae3c('0x46'),LISTID['toString']())['where'](_0xae3c('0x47'))['where'](_0xae3c('0x48'),squel[_0xae3c('0x3d')]()['field']('phone')[_0xae3c('0x42')](_0xae3c('0x38'))[_0xae3c('0x44')](_0x574017+'\x20=\x20?',_0x4468ff['id'][_0xae3c('0x41')]())))[_0xae3c('0x41')]();return _0x4f0fa8;};var _0x17635b=function(_0x50fe8e,_0x7563b7){var _0x14a12c=squel['insert']()['into'](_0xae3c('0x38'))[_0xae3c('0x39')]([_0xae3c('0x21'),_0xae3c('0x40'),'ContactId','ListId',_0x7563b7,_0xae3c('0x3b'),_0xae3c('0x3c')],squel[_0xae3c('0x3d')]()['field']('phone',_0xae3c('0x21'))[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x40'))[_0xae3c('0x3e')]('id',_0xae3c('0x3a'))[_0xae3c('0x3e')](LISTID[_0xae3c('0x41')](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x50fe8e['id'][_0xae3c('0x41')](),_0x7563b7)[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3b'))[_0xae3c('0x3e')](_0xae3c('0x3f'),'updatedAt')[_0xae3c('0x42')](_0xae3c('0x43'))['where'](_0xae3c('0x45'))['where']('ListId\x20=\x20?',LISTID[_0xae3c('0x41')]())[_0xae3c('0x44')](_0xae3c('0x49'),squel[_0xae3c('0x4a')](hopperContacts))[_0xae3c('0x44')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x4b'))[_0xae3c('0x42')](_0xae3c('0x4c'))['where'](_0x7563b7+'\x20=\x20?',_0x50fe8e['id'][_0xae3c('0x41')]()))[_0xae3c('0x44')](_0xae3c('0x48'),squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x21'))[_0xae3c('0x42')]('cm_hopper')['where'](_0x7563b7+_0xae3c('0x4d'),_0x50fe8e['id'][_0xae3c('0x41')]())))[_0xae3c('0x41')]();return _0x14a12c;};function _0x1a0bd5(_0x365517,_0x28cab0){var _0xf67276=squel[_0xae3c('0x36')]()[_0xae3c('0x37')](_0xae3c('0x38'))[_0xae3c('0x39')](['phone',_0xae3c('0x40'),_0xae3c('0x3a'),_0xae3c('0x28'),_0x28cab0,_0xae3c('0x3b'),'updatedAt'],squel[_0xae3c('0x3d')]()[_0xae3c('0x3e')](_0xae3c('0x21'),'phone')[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x40'))[_0xae3c('0x3e')]('id',_0xae3c('0x3a'))[_0xae3c('0x3e')](LISTID['toString'](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x365517['id'][_0xae3c('0x41')](),_0x28cab0)[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3b'))[_0xae3c('0x3e')](_0xae3c('0x3f'),_0xae3c('0x3c'))[_0xae3c('0x42')]('cm_contacts')[_0xae3c('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0xae3c('0x46'),LISTID[_0xae3c('0x41')]())[_0xae3c('0x44')](_0xae3c('0x49'),squel[_0xae3c('0x4a')](hopperContacts))[_0xae3c('0x44')](_0xae3c('0x47')))['toString']();return _0xf67276;}function _0x5ebd84(_0x311077,_0x3d43a5){var _0x56a024=squel['insert']()[_0xae3c('0x37')](_0xae3c('0x4e'))[_0xae3c('0x39')](['phone',_0xae3c('0x3a'),_0xae3c('0x28'),_0x3d43a5,_0xae3c('0x3b'),_0xae3c('0x3c')],squel['select']()[_0xae3c('0x3e')](_0xae3c('0x21'),_0xae3c('0x21'))['field']('id',_0xae3c('0x3a'))[_0xae3c('0x3e')](LISTID['toString'](),_0xae3c('0x28'))[_0xae3c('0x3e')](_0x311077['id']['toString'](),_0x3d43a5)['field'](_0xae3c('0x3f'),_0xae3c('0x3b'))[_0xae3c('0x3e')](_0xae3c('0x3f'),'updatedAt')[_0xae3c('0x42')]('cm_contacts')[_0xae3c('0x44')](_0xae3c('0x45'))[_0xae3c('0x44')]('ListId\x20=\x20?',LISTID[_0xae3c('0x41')]())[_0xae3c('0x44')](_0xae3c('0x49'),squel['str'](hopperContacts))['where'](_0xae3c('0x47')))[_0xae3c('0x41')]();return _0x56a024;}return db['VoiceQueue'][_0xae3c('0x4f')]({'where':{'type':_0xae3c('0x50')},'attributes':['id',_0xae3c('0x51')],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x53'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x14f385){var _0xfa85d9=[];if(_0x14f385){var _0x5bd0c9;for(var _0x5167f1=0x0,_0x569286;_0x5167f1<_0x14f385[_0xae3c('0x1a')];_0x5167f1+=0x1){_0x569286=_0x14f385[_0x5167f1][_0xae3c('0x54')]({'plain':!![]});switch(_0x569286['dialCheckDuplicateType']){case _0xae3c('0x55'):_0xfa85d9[_0xae3c('0x56')](db['sequelize'][_0xae3c('0x57')](_0x17635b(_0x569286,_0xae3c('0x58')))['then'](function(){})[_0xae3c('0x30')](_0x5a6beb()));break;case'onlyIfOpen':_0xfa85d9[_0xae3c('0x56')](db[_0xae3c('0x59')]['query'](_0x309434(_0x569286,_0xae3c('0x58')))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));break;default:_0xfa85d9[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x1a0bd5(_0x569286,_0xae3c('0x58')))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));}}}return _0xfa85d9;})['all']()[_0xae3c('0x2e')](function(){return db[_0xae3c('0x5a')][_0xae3c('0x4f')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x5b'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x32c753){var _0x5a89f1=[];if(_0x32c753){var _0x287d38;for(var _0x2b6ee3=0x0,_0x5738e0;_0x2b6ee3<_0x32c753[_0xae3c('0x1a')];_0x2b6ee3+=0x1){_0x5738e0=_0x32c753[_0x2b6ee3][_0xae3c('0x54')]({'plain':!![]});_0x5a89f1[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x5ebd84(_0x5738e0,_0xae3c('0x58')))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));}}return _0x5a89f1;})[_0xae3c('0x5c')]();})[_0xae3c('0x2e')](function(){return db[_0xae3c('0x5d')][_0xae3c('0x4f')]({'attributes':['id',_0xae3c('0x51')],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x53'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x1c9e97){var _0x186caf=[];if(_0x1c9e97){for(var _0x7d7820=0x0,_0xbfd122;_0x7d7820<_0x1c9e97['length'];_0x7d7820+=0x1){_0xbfd122=_0x1c9e97[_0x7d7820][_0xae3c('0x54')]({'plain':!![]});switch(_0xbfd122['dialCheckDuplicateType']){case _0xae3c('0x55'):_0x186caf[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x17635b(_0xbfd122,_0xae3c('0x5e')))[_0xae3c('0x2e')](function(){})['catch'](_0x5a6beb()));break;case _0xae3c('0x5f'):_0x186caf[_0xae3c('0x56')](db[_0xae3c('0x59')]['query'](_0x309434(_0xbfd122,'CampaignId'))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));break;default:_0x186caf[_0xae3c('0x56')](db[_0xae3c('0x59')][_0xae3c('0x57')](_0x1a0bd5(_0xbfd122,'CampaignId'))[_0xae3c('0x2e')](function(){})[_0xae3c('0x30')](_0x5a6beb()));}}}return _0x186caf;})[_0xae3c('0x5c')]();})[_0xae3c('0x2e')](function(){return db[_0xae3c('0x5d')][_0xae3c('0x4f')]({'attributes':['id'],'include':[{'model':db[_0xae3c('0x52')],'as':_0xae3c('0x5b'),'where':{'id':LISTID}}]})[_0xae3c('0x2e')](function(_0x534010){var _0x32e5e0=[];if(_0x534010){for(var _0x3539aa=0x0,_0x3fc627;_0x3539aa<_0x534010['length'];_0x3539aa+=0x1){_0x3fc627=_0x534010[_0x3539aa][_0xae3c('0x54')]({'plain':!![]});_0x32e5e0[_0xae3c('0x56')](db['sequelize'][_0xae3c('0x57')](_0x5ebd84(_0x3fc627,_0xae3c('0x5e')))[_0xae3c('0x2e')](function(){})['catch'](_0x5a6beb()));}}return _0x32e5e0;})[_0xae3c('0x5c')]();})[_0xae3c('0x30')](function(_0x1902b6){logger[_0xae3c('0x14')](_0xae3c('0x60'),'generalCheckHopper',_0x1902b6['message']);});}var processPromises=function(_0xe34e10){return BPromise[_0xae3c('0x5c')](promises)[_0xae3c('0x2e')](function(_0x55fad2){})['catch'](function(_0x164f88){logger[_0xae3c('0x14')](_0xae3c('0x61'),JSON['stringify'](_0x164f88));})[_0xae3c('0x62')](function(){socket[_0xae3c('0x63')](_0xae3c('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xe34e10){return _0xe34e10[_0xae3c('0x65')]();}});};var endCsv=function(){return BPromise[_0xae3c('0x66')]()[_0xae3c('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xae3c('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xae3c('0x67')](FILEPATH);}catch(_0xf3db41){logger[_0xae3c('0x14')](_0xae3c('0x68'),JSON[_0xae3c('0x32')](_0xf3db41));}finally{process['exit'](0x0);}});};process['on'](_0xae3c('0x69'),function(){logger[_0xae3c('0x6a')](_0xae3c('0x6b'));endCsv();});function main(){return BPromise[_0xae3c('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xae3c('0x11')](',');return db[_0xae3c('0x6c')][_0xae3c('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xae3c('0x2e')](function(_0xe426d){var _0x3ffdbb=fs[_0xae3c('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xae3c('0x6e')](_0x3ffdbb,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1636bc,_0x31952b){total+=0x1;var _0x595a7f=total;promises[_0xae3c('0x56')](checkRow(_0x1636bc,_0xe426d,_0x595a7f)[_0xae3c('0x2e')](function(){success+=0x1;})['catch'](function(_0x5a5301){if(_0x5a5301['error']){errors+=0x1;delete _0x5a5301['error'];}else if(_0x5a5301[_0xae3c('0x2b')]){duplicates+=0x1;delete _0x5a5301[_0xae3c('0x2b')];}rows[_0xae3c('0x56')](_0x5a5301);}));if(total%0xc8===0x0){_0x31952b[_0xae3c('0x6f')]();return processPromises(_0x31952b);}},'complete':function(){return processPromises()[_0xae3c('0x2e')](function(){logger[_0xae3c('0x6a')](_0xae3c('0x70'));endCsv();});},'error':function(_0x3d0293,_0x1c1252){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x3d0293));endCsv();}});})[_0xae3c('0x30')](function(_0xbbaabb){logger[_0xae3c('0x14')](_0xae3c('0x71'),JSON[_0xae3c('0x32')](_0xbbaabb));});}main(); \ No newline at end of file +var _0x5767=['cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','error','data','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','outbound','CmList','Lists','dialCheckDuplicateType','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','get','always','CampaignId','Campaign'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5767,0x162));var _0x7576=function(_0x44058c,_0x45c37b){_0x44058c=_0x44058c-0x0;var _0x334ff0=_0x5767[_0x44058c];return _0x334ff0;};'use strict';var BPromise=require(_0x7576('0x0'));var util=require(_0x7576('0x1'));var _=require(_0x7576('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x7576('0x3'));var Redis=require(_0x7576('0x4'));var db=require(_0x7576('0x5'))['db'];var config=require(_0x7576('0x6'));var logger=require(_0x7576('0x7'))(_0x7576('0x8'));config[_0x7576('0x9')]=_[_0x7576('0xa')](config[_0x7576('0x9')],{'host':_0x7576('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7576('0x9')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x7576('0xc')][0x2]||process[_0x7576('0xc')][0x2]===_0x7576('0xd')||process[_0x7576('0xc')][0x2]===_0x7576('0xe')){throw new Error(_0x7576('0xf'));}var FILEPATH=process[_0x7576('0xc')][0x2];if(!process[_0x7576('0xc')][0x3]||process[_0x7576('0xc')][0x3]===_0x7576('0xd')||process[_0x7576('0xc')][0x3]===_0x7576('0xe')||!process[_0x7576('0xc')][0x4]||process[_0x7576('0xc')][0x4]===_0x7576('0xd')||process[_0x7576('0xc')][0x4]==='null'){throw new Error(_0x7576('0x10'));}var FIELDS=_[_0x7576('0x11')](process['argv'][0x3]['split'](','),process[_0x7576('0xc')][0x4][_0x7576('0x12')](','));if(!process[_0x7576('0xc')][0x5]||process[_0x7576('0xc')][0x5]===_0x7576('0xd')||process[_0x7576('0xc')][0x5]==='null'){throw new Error(_0x7576('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x7576('0xc')][0x6]&&process[_0x7576('0xc')][0x6]!==_0x7576('0xd')&&process[_0x7576('0xc')][0x6]!==_0x7576('0xe')?process[_0x7576('0xc')][0x6]:null;var DUPLICATES=process[_0x7576('0xc')][0x7]&&process[_0x7576('0xc')][0x7]!==_0x7576('0xd')&&process[_0x7576('0xc')][0x7]!=='null'?process[_0x7576('0xc')][0x7]:null;if(!process[_0x7576('0xc')][0x8]||process['argv'][0x8]==='undefined'||process[_0x7576('0xc')][0x8]===_0x7576('0xe')){throw new Error(_0x7576('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x3e22e1){logger['error'](_0x3e22e1);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(_0x39f842,_0xdf5529,_0x29bba0,_0x2467d4){var _0x22fba1={'message':_0xdf5529};_0x22fba1[_0x39f842]=!![];if(_0x29bba0){_0x22fba1[_0x7576('0x15')]=_0x29bba0;}if(_0x2467d4){_0x22fba1['index']=_0x2467d4;}return _0x22fba1;}function isEmail(_0x114039){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))*$/[_0x7576('0x16')](_0x114039);}function checkRow(_0x18f2c7,_0x4b5c46,_0x2c5f61){return new BPromise(function(_0x2d3e37,_0x1d25dd){if(_[_0x7576('0x17')](_0x18f2c7)){return _0x1d25dd(handleCheckRowError('error',_0x7576('0x18'),null,_0x2c5f61));}if(_0x18f2c7['errors']&&_0x18f2c7[_0x7576('0x19')][_0x7576('0x1a')]){var _0x54b636=_[_0x7576('0x1b')](_0x18f2c7[_0x7576('0x19')],'message')[_0x7576('0x1c')](';');return _0x1d25dd(handleCheckRowError(_0x7576('0x1d'),_0x54b636,null,_0x2c5f61));}var _0x45133e={};for(var _0x5ac9d4 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5ac9d4)&&FIELDS[_0x5ac9d4]){_0x45133e[_0x5ac9d4]=_0x18f2c7['data'][0x0][FIELDS[_0x5ac9d4]]||_0x18f2c7[_0x7576('0x1e')][0x0]['\ufeff'+FIELDS[_0x5ac9d4]];}}if(!_0x45133e['firstName']){return _0x1d25dd(handleCheckRowError(_0x7576('0x1d'),'firstName\x20not\x20specified!',null,_0x2c5f61));}if(!_0x45133e[_0x7576('0x1f')]){return _0x1d25dd(handleCheckRowError(_0x7576('0x1d'),'phone\x20not\x20specified!',null,_0x2c5f61));}if(_0x45133e[_0x7576('0x20')]){var _0x3acfa9=moment(_0x45133e[_0x7576('0x20')],_0x7576('0x21'));if(!_0x3acfa9['isValid']()){return _0x1d25dd(handleCheckRowError(_0x7576('0x1d'),_0x7576('0x22'),null,_0x2c5f61));}}if(_0x45133e[_0x7576('0x23')]){if(!isEmail(_0x45133e['email'])){return _0x1d25dd(handleCheckRowError(_0x7576('0x1d'),'email\x20format\x20is\x20not\x20valid!',null,_0x2c5f61));}}_0x45133e[_0x7576('0x24')]=LISTID;_0x45133e[_0x7576('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7576('0x1a')]&&_0x4b5c46){var _0x67ca1b={};for(var _0x46bea0=0x0,_0x568a18=DUPLICATES[_0x7576('0x1a')];_0x46bea0<_0x568a18;_0x46bea0+=0x1){_0x67ca1b[DUPLICATES[_0x46bea0]]=_0x45133e[DUPLICATES[_0x46bea0]];}var _0x15518a=_[_0x7576('0x26')](_0x4b5c46,_0x67ca1b);if(_0x15518a){return _0x1d25dd(handleCheckRowError(_0x7576('0x27'),_0x7576('0x28'),_0x15518a,_0x2c5f61));}}return db[_0x7576('0x29')][_0x7576('0x2a')](_0x45133e,{'raw':!![],'hooks':![],'fields':_[_0x7576('0x2b')](_0x45133e)})[_0x7576('0x2c')](function(_0x391274){if(DUPLICATES&&DUPLICATES[_0x7576('0x1a')]&&_0x4b5c46){_0x4b5c46[_0x7576('0x2d')](_[_0x7576('0x2e')](_0x45133e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x391274['id'];return _0x2d3e37();})[_0x7576('0x2f')](function(_0x3757a9){return _0x1d25dd(handleCheckRowError(_0x7576('0x1d'),_0x7576('0x30')+(_0x3757a9[_0x7576('0x31')]||JSON[_0x7576('0x32')](_0x3757a9)),null,_0x2c5f61));});});}function checkHopper(){function _0x660034(){return function(_0x471600){logger[_0x7576('0x1d')](_0x7576('0x33'),_0x7576('0x34'),util['inspect'](_0x471600,{'showHidden':![],'depth':null}));};}var _0x3e6a8f=function(_0xc13695,_0x4b8acc){var _0x4ae105=squel[_0x7576('0x35')]()[_0x7576('0x36')]('cm_hopper')[_0x7576('0x37')]([_0x7576('0x1f'),_0x7576('0x38'),_0x7576('0x39'),_0x7576('0x24'),_0x4b8acc,_0x7576('0x3a'),_0x7576('0x3b')],squel[_0x7576('0x3c')]()[_0x7576('0x3d')](_0x7576('0x1f'),_0x7576('0x1f'))['field']('NOW()','scheduledAt')[_0x7576('0x3d')]('id',_0x7576('0x39'))['field'](LISTID[_0x7576('0x3e')](),_0x7576('0x24'))[_0x7576('0x3d')](_0xc13695['id'][_0x7576('0x3e')](),_0x4b8acc)[_0x7576('0x3d')](_0x7576('0x3f'),_0x7576('0x3a'))[_0x7576('0x3d')](_0x7576('0x3f'),_0x7576('0x3b'))[_0x7576('0x40')](_0x7576('0x41'))['where'](_0x7576('0x42'))['where'](_0x7576('0x43'),LISTID[_0x7576('0x3e')]())[_0x7576('0x44')](_0x7576('0x45'))[_0x7576('0x44')](_0x7576('0x46'),squel[_0x7576('0x3c')]()['field']('phone')[_0x7576('0x40')](_0x7576('0x47'))[_0x7576('0x44')](_0x4b8acc+_0x7576('0x48'),_0xc13695['id'][_0x7576('0x3e')]())))['toString']();return _0x4ae105;};var _0x31f067=function(_0x5a02ce,_0x1ab0d2){var _0x4878c7=squel[_0x7576('0x35')]()[_0x7576('0x36')](_0x7576('0x47'))[_0x7576('0x37')](['phone',_0x7576('0x38'),_0x7576('0x39'),'ListId',_0x1ab0d2,_0x7576('0x3a'),_0x7576('0x3b')],squel[_0x7576('0x3c')]()['field'](_0x7576('0x1f'),'phone')[_0x7576('0x3d')](_0x7576('0x3f'),_0x7576('0x38'))['field']('id',_0x7576('0x39'))[_0x7576('0x3d')](LISTID[_0x7576('0x3e')](),'ListId')['field'](_0x5a02ce['id'][_0x7576('0x3e')](),_0x1ab0d2)[_0x7576('0x3d')](_0x7576('0x3f'),_0x7576('0x3a'))[_0x7576('0x3d')]('NOW()',_0x7576('0x3b'))['from'](_0x7576('0x41'))['where'](_0x7576('0x42'))[_0x7576('0x44')](_0x7576('0x43'),LISTID[_0x7576('0x3e')]())[_0x7576('0x44')](_0x7576('0x49'),squel[_0x7576('0x4a')](hopperContacts))['where'](_0x7576('0x45'))[_0x7576('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7576('0x3c')]()[_0x7576('0x3d')](_0x7576('0x4b'))[_0x7576('0x40')](_0x7576('0x4c'))[_0x7576('0x44')](_0x1ab0d2+_0x7576('0x48'),_0x5a02ce['id']['toString']()))[_0x7576('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7576('0x3c')]()[_0x7576('0x3d')]('phone')['from']('cm_hopper')['where'](_0x1ab0d2+_0x7576('0x48'),_0x5a02ce['id'][_0x7576('0x3e')]())))[_0x7576('0x3e')]();return _0x4878c7;};function _0x565390(_0x292cbe,_0x1cc95b){var _0x5381d8=squel['insert']()[_0x7576('0x36')](_0x7576('0x47'))[_0x7576('0x37')]([_0x7576('0x1f'),_0x7576('0x38'),_0x7576('0x39'),_0x7576('0x24'),_0x1cc95b,_0x7576('0x3a'),_0x7576('0x3b')],squel[_0x7576('0x3c')]()['field']('phone',_0x7576('0x1f'))[_0x7576('0x3d')](_0x7576('0x3f'),_0x7576('0x38'))[_0x7576('0x3d')]('id',_0x7576('0x39'))[_0x7576('0x3d')](LISTID[_0x7576('0x3e')](),_0x7576('0x24'))[_0x7576('0x3d')](_0x292cbe['id'][_0x7576('0x3e')](),_0x1cc95b)[_0x7576('0x3d')](_0x7576('0x3f'),_0x7576('0x3a'))[_0x7576('0x3d')]('NOW()',_0x7576('0x3b'))[_0x7576('0x40')](_0x7576('0x41'))[_0x7576('0x44')](_0x7576('0x42'))[_0x7576('0x44')](_0x7576('0x43'),LISTID[_0x7576('0x3e')]())[_0x7576('0x44')](_0x7576('0x49'),squel[_0x7576('0x4a')](hopperContacts))['where'](_0x7576('0x45')))[_0x7576('0x3e')]();return _0x5381d8;}function _0x3a19a5(_0x3c9b3a,_0x45d06e){var _0x5a42d3=squel[_0x7576('0x35')]()[_0x7576('0x36')](_0x7576('0x4d'))[_0x7576('0x37')]([_0x7576('0x1f'),_0x7576('0x39'),'ListId',_0x45d06e,_0x7576('0x3a'),_0x7576('0x3b')],squel[_0x7576('0x3c')]()[_0x7576('0x3d')](_0x7576('0x1f'),_0x7576('0x1f'))[_0x7576('0x3d')]('id',_0x7576('0x39'))[_0x7576('0x3d')](LISTID[_0x7576('0x3e')](),_0x7576('0x24'))[_0x7576('0x3d')](_0x3c9b3a['id'][_0x7576('0x3e')](),_0x45d06e)['field'](_0x7576('0x3f'),_0x7576('0x3a'))[_0x7576('0x3d')]('NOW()',_0x7576('0x3b'))[_0x7576('0x40')](_0x7576('0x41'))[_0x7576('0x44')]('deletedAt\x20IS\x20NULL')[_0x7576('0x44')](_0x7576('0x43'),LISTID[_0x7576('0x3e')]())['where'](_0x7576('0x49'),squel[_0x7576('0x4a')](hopperContacts))['where'](_0x7576('0x45')))[_0x7576('0x3e')]();return _0x5a42d3;}return db[_0x7576('0x4e')]['findAll']({'where':{'type':_0x7576('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x7576('0x50')],'as':_0x7576('0x51'),'where':{'id':LISTID}}]})[_0x7576('0x2c')](function(_0x26185a){var _0x4aaddc=[];if(_0x26185a){var _0x172fe8;for(var _0x35eed9=0x0,_0x58518e;_0x35eed9<_0x26185a[_0x7576('0x1a')];_0x35eed9+=0x1){_0x58518e=_0x26185a[_0x35eed9]['get']({'plain':!![]});switch(_0x58518e[_0x7576('0x52')]){case'always':_0x4aaddc[_0x7576('0x2d')](db[_0x7576('0x53')][_0x7576('0x54')](_0x31f067(_0x58518e,_0x7576('0x55')))['then'](function(){})[_0x7576('0x2f')](_0x660034()));break;case _0x7576('0x56'):_0x4aaddc[_0x7576('0x2d')](db['sequelize'][_0x7576('0x54')](_0x3e6a8f(_0x58518e,_0x7576('0x55')))[_0x7576('0x2c')](function(){})[_0x7576('0x2f')](_0x660034()));break;default:_0x4aaddc[_0x7576('0x2d')](db[_0x7576('0x53')][_0x7576('0x54')](_0x565390(_0x58518e,_0x7576('0x55')))[_0x7576('0x2c')](function(){})['catch'](_0x660034()));}}}return _0x4aaddc;})[_0x7576('0x57')]()[_0x7576('0x2c')](function(){return db[_0x7576('0x4e')][_0x7576('0x58')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x7576('0x50')],'as':_0x7576('0x59'),'where':{'id':LISTID}}]})[_0x7576('0x2c')](function(_0x4f71f3){var _0x3c4b4e=[];if(_0x4f71f3){var _0x5338ea;for(var _0x4d50e2=0x0,_0x1ec03c;_0x4d50e2<_0x4f71f3[_0x7576('0x1a')];_0x4d50e2+=0x1){_0x1ec03c=_0x4f71f3[_0x4d50e2][_0x7576('0x5a')]({'plain':!![]});_0x3c4b4e['push'](db[_0x7576('0x53')][_0x7576('0x54')](_0x3a19a5(_0x1ec03c,_0x7576('0x55')))[_0x7576('0x2c')](function(){})[_0x7576('0x2f')](_0x660034()));}}return _0x3c4b4e;})[_0x7576('0x57')]();})['then'](function(){return db['Campaign'][_0x7576('0x58')]({'attributes':['id',_0x7576('0x52')],'include':[{'model':db[_0x7576('0x50')],'as':_0x7576('0x51'),'where':{'id':LISTID}}]})['then'](function(_0xe7e9f0){var _0x6cce62=[];if(_0xe7e9f0){for(var _0x3cc80d=0x0,_0x5c7c28;_0x3cc80d<_0xe7e9f0['length'];_0x3cc80d+=0x1){_0x5c7c28=_0xe7e9f0[_0x3cc80d][_0x7576('0x5a')]({'plain':!![]});switch(_0x5c7c28['dialCheckDuplicateType']){case _0x7576('0x5b'):_0x6cce62[_0x7576('0x2d')](db[_0x7576('0x53')][_0x7576('0x54')](_0x31f067(_0x5c7c28,_0x7576('0x5c')))[_0x7576('0x2c')](function(){})['catch'](_0x660034()));break;case'onlyIfOpen':_0x6cce62[_0x7576('0x2d')](db[_0x7576('0x53')]['query'](_0x3e6a8f(_0x5c7c28,_0x7576('0x5c')))[_0x7576('0x2c')](function(){})[_0x7576('0x2f')](_0x660034()));break;default:_0x6cce62[_0x7576('0x2d')](db[_0x7576('0x53')][_0x7576('0x54')](_0x565390(_0x5c7c28,_0x7576('0x5c')))[_0x7576('0x2c')](function(){})[_0x7576('0x2f')](_0x660034()));}}}return _0x6cce62;})['all']();})[_0x7576('0x2c')](function(){return db[_0x7576('0x5d')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x7576('0x50')],'as':_0x7576('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x2d9edf){var _0x182f49=[];if(_0x2d9edf){for(var _0x47405f=0x0,_0x182a82;_0x47405f<_0x2d9edf['length'];_0x47405f+=0x1){_0x182a82=_0x2d9edf[_0x47405f][_0x7576('0x5a')]({'plain':!![]});_0x182f49['push'](db[_0x7576('0x53')][_0x7576('0x54')](_0x3a19a5(_0x182a82,_0x7576('0x5c')))[_0x7576('0x2c')](function(){})['catch'](_0x660034()));}}return _0x182f49;})[_0x7576('0x57')]();})[_0x7576('0x2f')](function(_0x5bc1a9){logger[_0x7576('0x1d')](_0x7576('0x5e'),_0x7576('0x5f'),_0x5bc1a9[_0x7576('0x31')]);});}var processPromises=function(_0x913d05){return BPromise['all'](promises)[_0x7576('0x2c')](function(_0x864968){})[_0x7576('0x2f')](function(_0x4403c4){logger[_0x7576('0x1d')](_0x7576('0x60'),JSON[_0x7576('0x32')](_0x4403c4));})[_0x7576('0x61')](function(){socket[_0x7576('0x62')](_0x7576('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x913d05){return _0x913d05[_0x7576('0x64')]();}});};var endCsv=function(){return BPromise[_0x7576('0x65')]()[_0x7576('0x2c')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x7576('0x62')](_0x7576('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7576('0x66')](FILEPATH);}catch(_0x295a83){logger[_0x7576('0x1d')](_0x7576('0x67'),JSON[_0x7576('0x32')](_0x295a83));}finally{process['exit'](0x0);}});};process['on'](_0x7576('0x68'),function(){logger[_0x7576('0x69')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x7576('0x65')]()[_0x7576('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7576('0x12')](',');return db[_0x7576('0x29')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1b372e){var _0x3cf54f=fs[_0x7576('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7576('0x6b')](_0x3cf54f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x7c86a8,_0x24ee7c){total+=0x1;var _0x25dfba=total;promises['push'](checkRow(_0x7c86a8,_0x1b372e,_0x25dfba)[_0x7576('0x2c')](function(){success+=0x1;})[_0x7576('0x2f')](function(_0xff316f){if(_0xff316f[_0x7576('0x1d')]){errors+=0x1;delete _0xff316f[_0x7576('0x1d')];}else if(_0xff316f[_0x7576('0x27')]){duplicates+=0x1;delete _0xff316f[_0x7576('0x27')];}rows[_0x7576('0x2d')](_0xff316f);}));if(total%0xc8===0x0){_0x24ee7c[_0x7576('0x6c')]();return processPromises(_0x24ee7c);}},'complete':function(){return processPromises()[_0x7576('0x2c')](function(){logger['info'](_0x7576('0x6d'));endCsv();});},'error':function(_0x36a893,_0x3119ad){logger[_0x7576('0x69')](_0x7576('0x6e'),JSON['stringify'](_0x36a893));endCsv();}});})[_0x7576('0x2f')](function(_0x31c38e){logger[_0x7576('0x1d')](_0x7576('0x6f'),JSON[_0x7576('0x32')](_0x31c38e));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index cfed003..7639bef 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 _0x85f6=['CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues','campaigns','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','root','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','then','split','length','all','isNil','push','findOne','update','CmContactHasItem','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','updatedAt','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','cm_contacts.createdAt','phone','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','createdAt','priority','UserId','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','errors','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','query','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','main','stringify','send','start','clone','socket_timestamp','server/files/tmp','findAll','name','_description','AdditionalPhones','header','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x85f6,0xdf));var _0x685f=function(_0x519d6c,_0x9092c4){_0x519d6c=_0x519d6c-0x0;var _0x40ec69=_0x85f6[_0x519d6c];return _0x40ec69;};'use strict';var fs=require('fs');var path=require(_0x685f('0x0'));var _=require(_0x685f('0x1'));var Papa=require(_0x685f('0x2'));var util=require(_0x685f('0x3'));var BPromise=require(_0x685f('0x4'));var moment=require(_0x685f('0x5'));var squel=require(_0x685f('0x6'));var Redis=require(_0x685f('0x7'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require(_0x685f('0x8'));var logger=require('../../../config/logger')(_0x685f('0x9'));config[_0x685f('0xa')]=_[_0x685f('0xb')](config[_0x685f('0xa')],{'host':_0x685f('0xc'),'port':0x18eb});var socket=require(_0x685f('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x685f('0xe')](_0x685f('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x685f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x553134){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))*$/[_0x685f('0x10')](_0x553134);}function selectNotIn(_0x3660f6,_0x213aed,_0x732254,_0x8e6ba3,_0x54f1c6){return squel[_0x685f('0x11')]()[_0x685f('0x12')]('phone')[_0x685f('0x13')](_0x8e6ba3)[_0x685f('0x14')](_0x213aed,null,_0x213aed+'.id\x20=\x20'+_0x8e6ba3+'.'+_0x732254)['where'](_0x8e6ba3+'.'+_0x732254+_0x685f('0x15')+_0x3660f6+'.'+_0x732254)['where'](_0x213aed+_0x685f('0x16')+_0x54f1c6[_0x685f('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2510d9,_0x46446f){promisesAdditionalPhones=[];return db[_0x685f('0x17')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x685f('0x18')](function(_0x72f849){if(_0x72f849!==null){var _0x1b0b35=[];for(var _0x35c4c8=0x0;_0x35c4c8<_0x72f849['length'];_0x35c4c8++){var _0x284f33=_0x72f849[_0x35c4c8];_0x1b0b35['push'](insertAdditionalPhones(_0x284f33));}}Promise['all'](_0x1b0b35)[_0x685f('0x18')](function(){_0x2510d9({'val':0x1});});});});}function insertAdditionalPhones(_0x31d01e){return new Promise(function(_0x5d5046,_0x3d5904){var _0x550744=_0x31d01e['AdditionalPhones'];var _0x4140f9=_0x550744[_0x685f('0x19')](';');var _0x3efcff=[];orderBy=0x0;for(var _0x34bd0b=0x0;_0x34bd0b<_0x4140f9[_0x685f('0x1a')];_0x34bd0b++){_0x3efcff['push'](splitAdditionalPhone(_0x31d01e['id'],_0x4140f9[_0x34bd0b]));}Promise[_0x685f('0x1b')](_0x3efcff)[_0x685f('0x18')](function(){_0x5d5046({'val':_0x4140f9[_0x685f('0x1a')]});});});}function splitAdditionalPhone(_0x47cbd4,_0x222045){return new Promise(function(_0x2df8b1,_0x3ea42e){var _0x43395d=_0x222045[_0x685f('0x19')](':');var _0x264a11=_0x43395d[0x0];var _0x5f2c5a=_0x43395d[0x1];if(!_[_0x685f('0x1c')](_0x5f2c5a)){var _0x4ebc28=_0x5f2c5a['split']('|');var _0x7d6680=[];for(var _0x2415eb=0x0;_0x2415eb<_0x4ebc28[_0x685f('0x1a')];_0x2415eb++){if(_0x4ebc28[_0x2415eb]!==''){var _0x56f5b5=_['filter'](promisesAdditionalPhones,{'contactId':_0x47cbd4,'phone':_0x4ebc28[_0x2415eb]});if(_0x56f5b5[_0x685f('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x685f('0x1d')]({'contactId':_0x47cbd4,'contactTypeId':_0x264a11,'phone':_0x4ebc28[_0x2415eb],'orderBy':orderBy});}}}_0x2df8b1({'ok':0x1});}else _0x2df8b1({'res':0x0});});}function createAdditionalPhone(_0x337b06,_0x5707fd,_0x5ffa0e,_0x9e9f16){var _0x2f1a09='';var _0x2ee580='';var _0x19af62=_0x5ffa0e['split']('§');_0x2f1a09=_0x19af62[0x0];if(_0x19af62[_0x685f('0x1a')]==0x2)_0x2ee580=_0x19af62[0x1];return new Promise(function(_0x19c0ff,_0x32b800){return db['CmContactHasItem'][_0x685f('0x1e')]({'where':{'CmContactId':_0x337b06,'item':_0x2f1a09}})[_0x685f('0x18')](function(_0x34ac21){if(_0x34ac21){return db['CmContactHasItem'][_0x685f('0x1f')]({'ItemTypeId':_0x5707fd,'description':_0x2ee580,'OrderBy':_0x9e9f16},{'where':{'CmContactId':_0x337b06,'item':_0x2f1a09}})['then'](function(_0x113653){_0x19c0ff({'res':'updated'});});}else{return db[_0x685f('0x20')][_0x685f('0x21')]({'CmContactId':_0x337b06,'item':_0x2f1a09,'description':_0x2ee580,'ItemTypeId':_0x5707fd,'OrderBy':_0x9e9f16,'ItemClass':_0x685f('0x22')})['then'](function(_0x2af19e){_0x19c0ff({'res':_0x685f('0x23')});});}});});}function insertCmHopper(_0x12cda5,_0x47dadd,_0x262539,_0x40f646,_0x4ed673){var _0x2fd824=[_0x685f('0x24'),'cm_contacts.scheduledat',_0x685f('0x25'),'cm_contacts.ListId',_0x47dadd+'.'+_0x40f646,'cm_contacts.createdAt',_0x685f('0x26'),'cm_contacts.priority',_0x685f('0x27'),'\x22'+_0x4ed673+'\x22'];return squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x2a'))[_0x685f('0x2b')](['phone','scheduledat',_0x685f('0x2c'),_0x685f('0x2d'),_0x40f646,'createdAt',_0x685f('0x2e'),'priority','UserId','recallme'],squel[_0x685f('0x11')]()[_0x685f('0x2f')](_0x2fd824)[_0x685f('0x13')](_0x47dadd)[_0x685f('0x14')](_0x685f('0x30'),null,_0x685f('0x31')+_0x47dadd+_0x685f('0x32'))[_0x685f('0x14')](_0x262539,null,_0x262539+_0x685f('0x33')+_0x47dadd+'.'+_0x40f646)[_0x685f('0x34')](_0x47dadd+_0x685f('0x35'),_0x12cda5)[_0x685f('0x34')](_0x685f('0x36'),NOW)[_0x685f('0x34')](_0x685f('0x37'),selectNotIn(_0x47dadd,_0x262539,_0x40f646,_0x685f('0x2a'),[_0x685f('0x38'),_0x685f('0x39')]))['where'](_0x685f('0x37'),selectNotIn(_0x47dadd,_0x262539,_0x40f646,_0x685f('0x2a'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x1b2030,_0x3ee29d,_0x1db800,_0x440859){var _0x354636=[_0x685f('0x24'),_0x685f('0x25'),_0x685f('0x3a'),_0x3ee29d+'.'+_0x440859,_0x685f('0x3b'),_0x685f('0x26')];return squel[_0x685f('0x28')]()[_0x685f('0x29')]('cm_hopper_black')[_0x685f('0x2b')]([_0x685f('0x3c'),_0x685f('0x2c'),_0x685f('0x2d'),_0x440859,'createdAt','updatedAt'],squel['select']()['fields'](_0x354636)[_0x685f('0x13')](_0x3ee29d)['join'](_0x685f('0x30'),null,_0x685f('0x31')+_0x3ee29d+_0x685f('0x32'))['join'](_0x1db800,null,_0x1db800+_0x685f('0x33')+_0x3ee29d+'.'+_0x440859)['where'](_0x3ee29d+_0x685f('0x35'),_0x1b2030)[_0x685f('0x34')](_0x685f('0x36'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x685f('0x3c'))['from'](_0x685f('0x3d'))[_0x685f('0x34')](_0x685f('0x3e'),_0x1b2030)[_0x685f('0x34')](_0x440859+_0x685f('0x15')+_0x3ee29d+'.'+_0x440859)))['toString']();}function insertTzCmHopper(_0x11e6c2,_0x26304b,_0x34db4e,_0x1ad71f,_0x5351f0,_0x48c0ca){var _0xa5b1a0=[_0x685f('0x24'),_0x685f('0x3f')+_0x48c0ca+_0x685f('0x40'),_0x685f('0x25'),_0x685f('0x3a'),_0x26304b+'.'+_0x1ad71f,'cm_contacts.createdAt',_0x685f('0x26'),_0x685f('0x41'),'cm_contacts.UserId','\x22'+_0x5351f0+'\x22'];var _0xf850bc=squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x2a'))['fromQuery'](['phone','scheduledat','ContactId',_0x685f('0x2d'),_0x1ad71f,_0x685f('0x42'),'updatedAt',_0x685f('0x43'),_0x685f('0x44'),'recallme'],squel[_0x685f('0x11')]()[_0x685f('0x2f')](_0xa5b1a0)[_0x685f('0x13')](_0x26304b)[_0x685f('0x14')](_0x685f('0x30'),null,_0x685f('0x31')+_0x26304b+_0x685f('0x32'))['join'](_0x34db4e,null,_0x34db4e+'.id\x20=\x20'+_0x26304b+'.'+_0x1ad71f)['join'](_0x48c0ca,null,_0x48c0ca+_0x685f('0x33')+_0x26304b+'.'+_0x1ad71f)[_0x685f('0x34')](_0x26304b+'.CmListId\x20=\x20?',_0x11e6c2)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x685f('0x34')](_0x685f('0x37'),selectNotIn(_0x26304b,_0x34db4e,_0x1ad71f,_0x685f('0x2a'),[_0x685f('0x38'),_0x685f('0x39')]))[_0x685f('0x34')](_0x685f('0x37'),selectNotIn(_0x26304b,_0x34db4e,_0x1ad71f,_0x685f('0x2a'),['\x22always\x22'])))[_0x685f('0x45')]();return _0xf850bc;}function insertTzCmHopperBlack(_0x29eda6,_0x169526,_0x5576f8,_0x20c1b9){var _0x2393e3=['cm_contacts.phone',_0x685f('0x25'),_0x685f('0x3a'),_0x169526+'.'+_0x20c1b9,_0x685f('0x3b'),_0x685f('0x26')];return squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x3d'))[_0x685f('0x2b')]([_0x685f('0x3c'),_0x685f('0x2c'),_0x685f('0x2d'),_0x20c1b9,_0x685f('0x42'),_0x685f('0x2e')],squel[_0x685f('0x11')]()[_0x685f('0x2f')](_0x2393e3)[_0x685f('0x13')](_0x169526)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x169526+_0x685f('0x32'))[_0x685f('0x14')](_0x5576f8,null,_0x5576f8+_0x685f('0x33')+_0x169526+'.'+_0x20c1b9)[_0x685f('0x34')](_0x169526+_0x685f('0x35'),_0x29eda6)[_0x685f('0x34')](_0x685f('0x36'),NOW)[_0x685f('0x34')](_0x685f('0x37'),squel[_0x685f('0x11')]()[_0x685f('0x12')]('phone')['from'](_0x685f('0x3d'))[_0x685f('0x34')]('ListId\x20=\x20?',_0x29eda6)['where'](_0x20c1b9+_0x685f('0x15')+_0x169526+'.'+_0x20c1b9)))[_0x685f('0x45')]();}function insertCmHopperAdditionalPhones(_0x5060ed){var _0x4b1c75=[_0x685f('0x46'),_0x685f('0x47'),_0x685f('0x48'),_0x685f('0x49'),_0x685f('0x4a')];return squel[_0x685f('0x28')]()['into'](_0x685f('0x4b'))['fromQuery']([_0x685f('0x4c'),_0x685f('0x3c'),_0x685f('0x4d'),_0x685f('0x42'),_0x685f('0x2e')],squel['select']()[_0x685f('0x2f')](_0x4b1c75)[_0x685f('0x13')]('cm_hopper')[_0x685f('0x14')](_0x685f('0x30'),null,_0x685f('0x4e'))[_0x685f('0x14')](_0x685f('0x4f'),null,_0x685f('0x50'))['where'](_0x685f('0x51'),_0x5060ed)[_0x685f('0x34')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x685f('0x45')]();}function insertCmContact(_0x57d437,_0x2b7e62,_0x239038,_0x47e5c2){var _0x51deaa=_[_0x685f('0x52')](_[_0x685f('0x53')](_0x47e5c2),[_0x685f('0x2d'),_0x685f('0x54'),_0x685f('0x42'),_0x685f('0x2e')]);return squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x685f('0x30'))[_0x685f('0x2b')](_0x51deaa,squel[_0x685f('0x11')]()['fields'](_0x51deaa)[_0x685f('0x13')](_0x2b7e62)[_0x685f('0x34')]('('+_0x239038[_0x685f('0x14')](',')+_0x685f('0x55'),squel['select']()[_0x685f('0x2f')](_0x239038)[_0x685f('0x13')](_0x685f('0x30'))['where'](_0x685f('0x3e'),_0x57d437)[_0x685f('0x34')](_0x685f('0x56')))['where'](_0x685f('0x57'),squel['select']()[_0x685f('0x12')](_0x685f('0x58'),_0x685f('0x59'))['from'](_0x2b7e62)[_0x685f('0x5a')](_0x239038['join'](','))))[_0x685f('0x45')]();}function handleStop(){logger[_0x685f('0x5b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xb7bd13){logger[_0x685f('0x5c')](_0xb7bd13[_0x685f('0x5d')]);process['exit'](0x1);}function handleError(_0x189914,_0x42837e){stats[_0x685f('0x5e')]['push']({'name':_0x42837e['code'],'message':_0x42837e[_0x685f('0x5d')],'row':_0x189914});}function handleQuery(_0x1ba1cd){logger[_0x685f('0x5b')](_0x1ba1cd);return db[_0x685f('0x5f')]['query'](_0x1ba1cd)[_0x685f('0x60')](function(_0x54f79e){results[_0x685f('0x1d')](_0x54f79e);})[_0x685f('0x61')](function(_0x45d143){logger[_0x685f('0x5c')](_0x45d143[_0x685f('0x5d')]);});}function updateTzCampaigns(_0x77a61f){return new Promise(function(_0x354b36,_0x5e02e2){var _0x350452=squel[_0x685f('0x11')]()['fields']([_0x685f('0x62'),_0x685f('0x63')])[_0x685f('0x13')]('campaigns')[_0x685f('0x14')](_0x685f('0x64'),null,_0x685f('0x65'))[_0x685f('0x34')]('campaigns_has_cm_lists.CmListId='+_0x77a61f);db['sequelize'][_0x685f('0x66')](_0x350452[_0x685f('0x45')]())[_0x685f('0x60')](function(_0x41b04a){var _0x3dfe01=[];for(var _0x40d215=0x0;_0x40d215<_0x41b04a['length'];_0x40d215++){_0x3dfe01[_0x685f('0x1d')](getTimezoneData(_0x41b04a[_0x40d215],tmp_campaigns));}BPromise[_0x685f('0x1b')](_0x3dfe01)[_0x685f('0x18')](function(){_0x354b36({'val':0x1});});})[_0x685f('0x61')](function(_0xb5eb1d){logger[_0x685f('0x5c')](_0xb5eb1d[_0x685f('0x5d')]);_0x354b36({'val':0x0});});});}function updateTzVoiceQueues(_0x5992eb){return new Promise(function(_0x2f9e96,_0x2ac062){var _0x37a16b=squel[_0x685f('0x11')]()[_0x685f('0x2f')]([_0x685f('0x67'),_0x685f('0x68')])[_0x685f('0x13')]('voice_queues')[_0x685f('0x14')]('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x685f('0x34')](_0x685f('0x69')+_0x5992eb);db[_0x685f('0x5f')][_0x685f('0x66')](_0x37a16b['toString']())['spread'](function(_0x1ad013){var _0x32de99=[];for(var _0x2318c4=0x0;_0x2318c4<_0x1ad013[_0x685f('0x1a')];_0x2318c4++){_0x32de99['push'](getTimezoneData(_0x1ad013[_0x2318c4],tmp_voice_queues));}BPromise[_0x685f('0x1b')](_0x32de99)[_0x685f('0x18')](function(){_0x2f9e96({'val':0x1});});})['catch'](function(_0xb3be3c){logger['error'](_0xb3be3c['message']);_0x2f9e96({'val':0x0});});});}function getTimezoneData(_0xbe119c,_0x493a3e){return new Promise(function(_0x5e785c,_0xd8a295){var _0x526bf5=shared[_0x685f('0x6a')];var _0x1e6b62=_0x526bf5[_0xbe119c[_0x685f('0x6b')]];if(_[_0x685f('0x1c')](_0x1e6b62)){_0x5e785c({'ret':0x1});}else{var _0x52ac0f=_0x1e6b62['utcOffset'];var _0x48f85e=squel[_0x685f('0x28')]()[_0x685f('0x29')](_0x493a3e)[_0x685f('0x6c')]('id',_0xbe119c['id'])[_0x685f('0x6c')]('offset',_0x52ac0f)[_0x685f('0x6c')](_0x685f('0x6b'),_0xbe119c['dialTimezone'])[_0x685f('0x45')]();return db['sequelize'][_0x685f('0x66')](_0x48f85e)[_0x685f('0x60')](function(_0x203f7a){_0x5e785c({'ret':0x1});})[_0x685f('0x61')](function(_0x40479b){logger['error'](_0x40479b[_0x685f('0x5d')]);_0xd8a295({'ret':0x1});});}});}function handleTZQuery(_0x3db970){logger[_0x685f('0x5b')](_0x3db970);return db['sequelize'][_0x685f('0x66')](_0x3db970)[_0x685f('0x60')](function(_0x4931d2){})[_0x685f('0x61')](function(_0x5e2662){logger[_0x685f('0x5c')](_0x5e2662[_0x685f('0x5d')]);});}function main(_0x3ae9c3,_0xf4958c,_0xa79254,_0x4bf260){logger[_0x685f('0x5b')](_0x685f('0x6d'),_0x3ae9c3,JSON[_0x685f('0x6e')](_0xf4958c));process[_0x685f('0x6f')](_0x685f('0x70'));var _0x445b05=_0xf4958c['binding'];var _0x3fe932=_[_0x685f('0x71')](_0x445b05);var _0x831c1a=_0xf4958c[_0x685f('0x72')];var _0x7de203=path['join'](config['root'],_0x685f('0x73'),_0x831c1a+'.csv');hasTZ=_[_0x685f('0x53')](_0x445b05)['includes'](_0x685f('0x6b'));var _0x4f6ff5=_[_0x685f('0x53')](_0x445b05)[_0x685f('0x14')]();logger['info']('header',_0x4f6ff5);db['ContactItemType'][_0x685f('0x74')]({'raw':!![],'attributes':['id',_0x685f('0x75')]})[_0x685f('0x18')](function(_0x3ad2b7){for(var _0x427cef=0x0;_0x427cef<_0x3ad2b7['length'];_0x427cef++){if(_0x3ad2b7[_0x427cef][_0x685f('0x75')]in _0x445b05){contactItemTypes[_0x685f('0x1d')](_0x3ad2b7[_0x427cef]);delete _0x3fe932[_0x3ad2b7[_0x427cef]['name']];hasAdditionalPhones=!![];}for(var _0x24d4c0 in _0x445b05){if(_0x3ad2b7[_0x427cef]['name']+_0x685f('0x76')===_0x24d4c0){phoneDescriptions[_0x685f('0x1d')]({'itemTypeId':_0x3ad2b7[_0x427cef]['id'],'description':_0x24d4c0});delete _0x3fe932[_0x24d4c0];}}}if(hasAdditionalPhones)_0x3fe932[_0x685f('0x77')]='';var _0xe606eb=_['keys'](_0x3fe932)[_0x685f('0x14')]();logger[_0x685f('0x5b')](_0x685f('0x78'),_0xe606eb);fs['writeFileSync'](_0x7de203,_0xe606eb+'\x0a');Papa[_0x685f('0x79')](fs[_0x685f('0x7a')](_0x3ae9c3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x536610,_0x491097){try{for(var _0x5d8b14=0x0,_0xee5b40=[];_0x5d8b14<_0x536610[_0x685f('0x7b')][_0x685f('0x1a')];_0x5d8b14++){stats[_0x685f('0x7c')]+=0x1;if(_0x536610[_0x685f('0x5e')][_0x5d8b14]){handleError(_0x536610[_0x685f('0x7b')][_0x5d8b14],_0x536610[_0x685f('0x5e')][_0x5d8b14]);}else{var _0x296799=[];var _0x364877=[];var _0x504ab2={};for(var _0x56767a in _0x445b05){let _0x64633e=contactItemTypes[_0x685f('0x7d')](_0x2969c6=>_0x2969c6[_0x685f('0x75')]===_0x56767a);let _0x24a8f3=contactItemTypes[_0x685f('0x7d')](_0x34f373=>_0x34f373[_0x685f('0x75')]+'_description'===_0x56767a);if(_[_0x685f('0x1c')](_0x64633e)&&_['isNil'](_0x24a8f3)){if(_0x445b05[_0x685f('0x7e')](_0x56767a)){if(_0x536610[_0x685f('0x7b')][_0x5d8b14][_0x445b05[_0x56767a]]){var _0x23a3b9=_[_0x685f('0x7f')](_0x536610['data'][_0x5d8b14][_0x445b05[_0x56767a]][_0x685f('0x80')](/"/g,'\x27'));switch(_0x56767a){case _0x685f('0x81'):var _0x31c44b=moment(_0x23a3b9,_0x685f('0xf'),!![]);if(_0x31c44b[_0x685f('0x82')]()){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}else{_0x296799[_0x685f('0x1d')](_0x685f('0x83'));}break;case _0x685f('0x43'):var _0x2343c2=parseInt(_0x23a3b9);_0x23a3b9=_[_0x685f('0x84')](_0x2343c2)||_0x2343c2<0x0||_0x2343c2>0x4?_0x4bf260?0x3:0x2:_0x2343c2;_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');break;case _0x685f('0x44'):var _0x30cf94=parseInt(_0x23a3b9);if(_[_0x685f('0x85')](_0x30cf94)&&_[_0x685f('0x86')](_0xa79254,_0x30cf94)){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x30cf94+'\x22');}else{_0x296799[_0x685f('0x1d')]('agent\x20not\x20exists');}break;case _0x685f('0x87'):if(isEmail(_0x23a3b9)){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}else{_0x296799['push'](_0x685f('0x88'));}break;case _0x685f('0x89'):var _0x376d27=moment(_0x23a3b9,_0x685f('0x8a'),!![]);if(_0x376d27[_0x685f('0x82')]()){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}else{_0x296799['push'](_0x685f('0x8b'));}break;case _0x685f('0x6b'):var _0x5d79a6=shared[_0x685f('0x6a')];var _0x638f8c=_0x5d79a6[_0x23a3b9];if(!_[_0x685f('0x1c')](_0x638f8c)){var _0x21a72e=_0x638f8c[_0x685f('0x8c')];_0xee5b40['push']('\x22'+_0x23a3b9+'\x22');_0xee5b40[_0x685f('0x1d')]('\x22'+_0x21a72e+'\x22');}break;default:_0xee5b40[_0x685f('0x1d')]('\x22'+_0x23a3b9+'\x22');}}else{switch(_0x56767a){case _0x685f('0x8d'):case'phone':_0x296799[_0x685f('0x1d')](_0x56767a+_0x685f('0x8e'));break;default:_0xee5b40[_0x685f('0x1d')]('\x22\x22');}}}}else{var _0x1e18f1='';if(!_[_0x685f('0x1c')](_0x64633e)){if(!_0x504ab2['hasOwnProperty'](_0x64633e['id'])){if(!_[_0x685f('0x1c')](_0x536610['data'][_0x5d8b14][_0x445b05[_0x56767a]])){var _0x23a3b9=_[_0x685f('0x7f')](_0x536610[_0x685f('0x7b')][_0x5d8b14][_0x445b05[_0x56767a]][_0x685f('0x80')](/"/g,'\x27'));var _0x24287c=phoneDescriptions[_0x685f('0x7d')](_0x3ab8f4=>_0x3ab8f4[_0x685f('0x8f')]===_0x64633e['id']);if(!_[_0x685f('0x1c')](_0x24287c)){var _0x211541=_['trim'](_0x536610[_0x685f('0x7b')][_0x5d8b14][_0x445b05[_0x24287c[_0x685f('0x90')]]][_0x685f('0x80')](/"/g,'\x27'));if(!_['isNil'](_0x211541))_0x23a3b9=_0x23a3b9+'§'+_0x211541;}if(_0x1e18f1=='')_0x1e18f1=_0x23a3b9;else _0x1e18f1+='|'+_0x23a3b9;}_0x364877[_0x685f('0x1d')](_0x64633e['id']+':'+_0x1e18f1);_0x504ab2[_0x64633e['id']]=0x1;}}}}if(hasAdditionalPhones){_0xee5b40[_0x685f('0x1d')]('\x22'+_0x364877[_0x685f('0x14')](';')+'\x22');}if(_0x296799['length']){handleError(_0x536610[_0x685f('0x7b')][_0x5d8b14],{'code':_0x685f('0x91'),'message':_0x296799['join']()});}else{fs['appendFileSync'](_0x7de203,_0xee5b40[_0x685f('0x14')]()+'\x0a');}_0xee5b40=[];}if(!(stats[_0x685f('0x7c')]%0xc8)){socket[_0x685f('0x92')](_0x685f('0x93')+_0x831c1a,stats);stats[_0x685f('0x5e')]=[];}}if(stopped){logger[_0x685f('0x5b')](_0x685f('0x94'));_0x491097[_0x685f('0x95')]();}}catch(_0x493fde){handleError(_0x536610[_0x685f('0x7b')][_0x5d8b14],{'code':_0x685f('0x96'),'message':_0x493fde['message']});logger[_0x685f('0x5c')](_0x685f('0x97'),_0x493fde['message']);}},'complete':function(){try{var _0x5f2286=[];var _0x1ee614=[];var _0x264cf2='cm_contacts';if(_0xf4958c[_0x685f('0x98')]&&_0xf4958c['duplicates'][_0x685f('0x1a')]){_0x264cf2='cm_contacts_'+_0x831c1a;_0x5f2286[_0x685f('0x1d')](_0x685f('0x99')+_0x264cf2+_0x685f('0x9a'));}tmp_campaigns=_0x685f('0x9b')+_0x831c1a;tmp_voice_queues='voice_queues_'+_0x831c1a;_0x1ee614[_0x685f('0x1d')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x685f('0x9c'));_0x1ee614['push'](_0x685f('0x99')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x1ee614,handleTZQuery)[_0x685f('0x18')](function(_0x1f2aba){updateTzCampaigns(_0xf4958c[_0x685f('0x2d')])[_0x685f('0x18')](function(_0x34872e){updateTzVoiceQueues(_0xf4958c[_0x685f('0x2d')])[_0x685f('0x18')](function(_0x44383e){if(hasTZ)_0xe606eb=_0xe606eb['replace']('dialTimezone',_0x685f('0x9d'));var _0x4f5d0f=util[_0x685f('0xe')](_0x685f('0x9e'),_0x7de203,_0x264cf2,_0xe606eb,_0xf4958c[_0x685f('0x2d')],_0xf4958c['CompanyId']||null,NOW,NOW);if(_[_0x685f('0x1c')](_0x445b05[_0x685f('0x81')])){_0x4f5d0f+=',\x20scheduledAt\x20=\x20NOW()';}_0x5f2286[_0x685f('0x1d')](_0x4f5d0f);if(_0xf4958c[_0x685f('0x98')]&&_0xf4958c[_0x685f('0x98')][_0x685f('0x1a')]){_0x5f2286['push'](insertCmContact(_0xf4958c['ListId'],_0x264cf2,_0xf4958c['duplicates'],_0x445b05));_0x5f2286[_0x685f('0x1d')](_0x685f('0x9f')+_0x264cf2+';');}BPromise[_0x685f('0xa0')](_0x5f2286,handleQuery)[_0x685f('0x18')](function(_0x49ccba){BPromise[_0x685f('0x1b')]([handleAdditionalPhones()])[_0x685f('0x18')](function(){_0x5f2286=[];for(var _0x4af3e6=0x0;_0x4af3e6\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','CmContact','push','all','then','AdditionalPhones','length','split','filter','findOne','CmContactHasItem','updated','create','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','toString','cm_contacts.id','ListId','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.ListId','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)'];(function(_0x40bea2,_0x3023e1){var _0x3d4a78=function(_0x192968){while(--_0x192968){_0x40bea2['push'](_0x40bea2['shift']());}};_0x3d4a78(++_0x3023e1);}(_0xfd4a,0x10a));var _0xafd4=function(_0x22e6ff,_0x2b8b4f){_0x22e6ff=_0x22e6ff-0x0;var _0x243f44=_0xfd4a[_0x22e6ff];return _0x243f44;};'use strict';var fs=require('fs');var path=require(_0xafd4('0x0'));var _=require('lodash');var Papa=require(_0xafd4('0x1'));var util=require(_0xafd4('0x2'));var BPromise=require(_0xafd4('0x3'));var moment=require('moment');var squel=require(_0xafd4('0x4'));var Redis=require('ioredis');var db=require(_0xafd4('0x5'))['db'];var config=require(_0xafd4('0x6'));var shared=require(_0xafd4('0x7'));var logger=require('../../../config/logger')(_0xafd4('0x8'));config[_0xafd4('0x9')]=_[_0xafd4('0xa')](config[_0xafd4('0x9')],{'host':_0xafd4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafd4('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xafd4('0xc')](_0xafd4('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x5c3104){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))*$/[_0xafd4('0xe')](_0x5c3104);}function selectNotIn(_0x16037a,_0x13e386,_0x5dc2c6,_0x4535e9,_0x262ab0){return squel[_0xafd4('0xf')]()[_0xafd4('0x10')](_0xafd4('0x11'))[_0xafd4('0x12')](_0x4535e9)[_0xafd4('0x13')](_0x13e386,null,_0x13e386+_0xafd4('0x14')+_0x4535e9+'.'+_0x5dc2c6)[_0xafd4('0x15')](_0x4535e9+'.'+_0x5dc2c6+'\x20=\x20'+_0x16037a+'.'+_0x5dc2c6)[_0xafd4('0x15')](_0x13e386+'.dialCheckDuplicateType\x20IN\x20('+_0x262ab0['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5a0c1e,_0x17b1ba){promisesAdditionalPhones=[];return db[_0xafd4('0x16')]['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0xf08203){if(_0xf08203!==null){var _0xbff16c=[];for(var _0x490067=0x0;_0x490067<_0xf08203['length'];_0x490067++){var _0x5e1262=_0xf08203[_0x490067];_0xbff16c[_0xafd4('0x17')](insertAdditionalPhones(_0x5e1262));}}Promise[_0xafd4('0x18')](_0xbff16c)[_0xafd4('0x19')](function(){_0x5a0c1e({'val':0x1});});});});}function insertAdditionalPhones(_0x1db03b){return new Promise(function(_0x3bb0ef,_0x39c6c1){var _0x6506eb=_0x1db03b[_0xafd4('0x1a')];var _0x350ae6=_0x6506eb['split'](';');var _0x418669=[];orderBy=0x0;for(var _0xff3615=0x0;_0xff3615<_0x350ae6[_0xafd4('0x1b')];_0xff3615++){_0x418669[_0xafd4('0x17')](splitAdditionalPhone(_0x1db03b['id'],_0x350ae6[_0xff3615]));}Promise[_0xafd4('0x18')](_0x418669)['then'](function(){_0x3bb0ef({'val':_0x350ae6[_0xafd4('0x1b')]});});});}function splitAdditionalPhone(_0x14f8fc,_0xdb40a0){return new Promise(function(_0x3aaeb7,_0x333d96){var _0x3d36d=_0xdb40a0[_0xafd4('0x1c')](':');var _0x216a51=_0x3d36d[0x0];var _0x241bce=_0x3d36d[0x1];if(!_['isNil'](_0x241bce)){var _0x3550bb=_0x241bce['split']('|');var _0x442ce0=[];for(var _0x68bc14=0x0;_0x68bc14<_0x3550bb[_0xafd4('0x1b')];_0x68bc14++){if(_0x3550bb[_0x68bc14]!==''){var _0x3466d9=_[_0xafd4('0x1d')](promisesAdditionalPhones,{'contactId':_0x14f8fc,'phone':_0x3550bb[_0x68bc14]});if(_0x3466d9[_0xafd4('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xafd4('0x17')]({'contactId':_0x14f8fc,'contactTypeId':_0x216a51,'phone':_0x3550bb[_0x68bc14],'orderBy':orderBy});}}}_0x3aaeb7({'ok':0x1});}else _0x3aaeb7({'res':0x0});});}function createAdditionalPhone(_0x336e1f,_0x38f8eb,_0x5946ff,_0x65422c){var _0x3bd250='';var _0x3039f6='';var _0x7c0086=_0x5946ff[_0xafd4('0x1c')]('§');_0x3bd250=_0x7c0086[0x0];if(_0x7c0086[_0xafd4('0x1b')]==0x2)_0x3039f6=_0x7c0086[0x1];return new Promise(function(_0x35a6c1,_0x59ca18){return db['CmContactHasItem'][_0xafd4('0x1e')]({'where':{'CmContactId':_0x336e1f,'item':_0x3bd250}})[_0xafd4('0x19')](function(_0x4de2c8){if(_0x4de2c8){return db[_0xafd4('0x1f')]['update']({'ItemTypeId':_0x38f8eb,'description':_0x3039f6,'OrderBy':_0x65422c},{'where':{'CmContactId':_0x336e1f,'item':_0x3bd250}})[_0xafd4('0x19')](function(_0xdfcded){_0x35a6c1({'res':_0xafd4('0x20')});});}else{return db['CmContactHasItem'][_0xafd4('0x21')]({'CmContactId':_0x336e1f,'item':_0x3bd250,'description':_0x3039f6,'ItemTypeId':_0x38f8eb,'OrderBy':_0x65422c,'ItemClass':'PHONE'})['then'](function(_0x18f324){_0x35a6c1({'res':'inserted'});});}});});}function insertCmHopper(_0x41d83e,_0x567f91,_0x5966de,_0x2ddbc4,_0x4a7168){var _0x3de5f2=[_0xafd4('0x22'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x567f91+'.'+_0x2ddbc4,_0xafd4('0x23'),_0xafd4('0x24'),_0xafd4('0x25'),_0xafd4('0x26'),'\x22'+_0x4a7168+'\x22'];return squel[_0xafd4('0x27')]()[_0xafd4('0x28')]('cm_hopper')[_0xafd4('0x29')]([_0xafd4('0x11'),_0xafd4('0x2a'),_0xafd4('0x2b'),'ListId',_0x2ddbc4,_0xafd4('0x2c'),_0xafd4('0x2d'),_0xafd4('0x2e'),_0xafd4('0x2f'),_0xafd4('0x30')],squel[_0xafd4('0xf')]()[_0xafd4('0x31')](_0x3de5f2)[_0xafd4('0x12')](_0x567f91)[_0xafd4('0x13')](_0xafd4('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x567f91+_0xafd4('0x33'))['join'](_0x5966de,null,_0x5966de+_0xafd4('0x14')+_0x567f91+'.'+_0x2ddbc4)[_0xafd4('0x15')](_0x567f91+_0xafd4('0x34'),_0x41d83e)[_0xafd4('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xafd4('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x567f91,_0x5966de,_0x2ddbc4,'cm_hopper',['\x22always\x22',_0xafd4('0x35')]))[_0xafd4('0x15')](_0xafd4('0x36'),selectNotIn(_0x567f91,_0x5966de,_0x2ddbc4,_0xafd4('0x37'),[_0xafd4('0x38')])))[_0xafd4('0x39')]();}function insertCmHopperBlack(_0x56b217,_0x3ab9b8,_0x547437,_0x331def){var _0x481d2b=[_0xafd4('0x22'),_0xafd4('0x3a'),'cm_contacts.ListId',_0x3ab9b8+'.'+_0x331def,'cm_contacts.createdAt',_0xafd4('0x24')];return squel[_0xafd4('0x27')]()[_0xafd4('0x28')]('cm_hopper_black')[_0xafd4('0x29')](['phone',_0xafd4('0x2b'),_0xafd4('0x3b'),_0x331def,_0xafd4('0x2c'),_0xafd4('0x2d')],squel[_0xafd4('0xf')]()[_0xafd4('0x31')](_0x481d2b)['from'](_0x3ab9b8)['join'](_0xafd4('0x32'),null,_0xafd4('0x3c')+_0x3ab9b8+_0xafd4('0x33'))[_0xafd4('0x13')](_0x547437,null,_0x547437+_0xafd4('0x14')+_0x3ab9b8+'.'+_0x331def)[_0xafd4('0x15')](_0x3ab9b8+_0xafd4('0x34'),_0x56b217)['where'](_0xafd4('0x3d'),NOW)[_0xafd4('0x15')](_0xafd4('0x36'),squel[_0xafd4('0xf')]()[_0xafd4('0x10')](_0xafd4('0x11'))[_0xafd4('0x12')](_0xafd4('0x3e'))[_0xafd4('0x15')](_0xafd4('0x3f'),_0x56b217)[_0xafd4('0x15')](_0x331def+_0xafd4('0x40')+_0x3ab9b8+'.'+_0x331def)))[_0xafd4('0x39')]();}function insertTzCmHopper(_0x40afcb,_0x311e12,_0x1e7e9e,_0x10b793,_0x44c182,_0x4b462a){var _0x19b8b4=[_0xafd4('0x22'),_0xafd4('0x41')+_0x4b462a+_0xafd4('0x42'),_0xafd4('0x3a'),_0xafd4('0x43'),_0x311e12+'.'+_0x10b793,_0xafd4('0x23'),_0xafd4('0x24'),_0xafd4('0x25'),_0xafd4('0x26'),'\x22'+_0x44c182+'\x22'];var _0x89d452=squel[_0xafd4('0x27')]()[_0xafd4('0x28')](_0xafd4('0x37'))[_0xafd4('0x29')]([_0xafd4('0x11'),_0xafd4('0x2a'),_0xafd4('0x2b'),_0xafd4('0x3b'),_0x10b793,_0xafd4('0x2c'),_0xafd4('0x2d'),_0xafd4('0x2e'),_0xafd4('0x2f'),'recallme'],squel['select']()[_0xafd4('0x31')](_0x19b8b4)[_0xafd4('0x12')](_0x311e12)[_0xafd4('0x13')](_0xafd4('0x32'),null,_0xafd4('0x3c')+_0x311e12+_0xafd4('0x33'))[_0xafd4('0x13')](_0x1e7e9e,null,_0x1e7e9e+_0xafd4('0x14')+_0x311e12+'.'+_0x10b793)['join'](_0x4b462a,null,_0x4b462a+_0xafd4('0x14')+_0x311e12+'.'+_0x10b793)[_0xafd4('0x15')](_0x311e12+_0xafd4('0x34'),_0x40afcb)[_0xafd4('0x15')](_0xafd4('0x3d'),NOW)[_0xafd4('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x311e12,_0x1e7e9e,_0x10b793,_0xafd4('0x37'),[_0xafd4('0x38'),_0xafd4('0x35')]))[_0xafd4('0x15')](_0xafd4('0x36'),selectNotIn(_0x311e12,_0x1e7e9e,_0x10b793,_0xafd4('0x37'),[_0xafd4('0x38')])))[_0xafd4('0x39')]();return _0x89d452;}function insertTzCmHopperBlack(_0x228b96,_0xb3d666,_0x460c86,_0xee075){var _0x14a163=[_0xafd4('0x22'),_0xafd4('0x3a'),_0xafd4('0x43'),_0xb3d666+'.'+_0xee075,_0xafd4('0x23'),'cm_contacts.updatedAt'];return squel[_0xafd4('0x27')]()[_0xafd4('0x28')]('cm_hopper_black')[_0xafd4('0x29')]([_0xafd4('0x11'),_0xafd4('0x2b'),_0xafd4('0x3b'),_0xee075,_0xafd4('0x2c'),_0xafd4('0x2d')],squel['select']()[_0xafd4('0x31')](_0x14a163)['from'](_0xb3d666)[_0xafd4('0x13')](_0xafd4('0x32'),null,_0xafd4('0x3c')+_0xb3d666+'.CmListId')[_0xafd4('0x13')](_0x460c86,null,_0x460c86+_0xafd4('0x14')+_0xb3d666+'.'+_0xee075)[_0xafd4('0x15')](_0xb3d666+'.CmListId\x20=\x20?',_0x228b96)[_0xafd4('0x15')](_0xafd4('0x3d'),NOW)[_0xafd4('0x15')](_0xafd4('0x36'),squel[_0xafd4('0xf')]()[_0xafd4('0x10')]('phone')['from'](_0xafd4('0x3e'))[_0xafd4('0x15')](_0xafd4('0x3f'),_0x228b96)[_0xafd4('0x15')](_0xee075+_0xafd4('0x40')+_0xb3d666+'.'+_0xee075)))[_0xafd4('0x39')]();}function insertCmHopperAdditionalPhones(_0x584cca){var _0x5ee4b7=['cm_hopper.id','cm_contact_has_items.item',_0xafd4('0x44'),_0xafd4('0x45'),_0xafd4('0x46')];return squel['insert']()[_0xafd4('0x28')](_0xafd4('0x47'))[_0xafd4('0x29')]([_0xafd4('0x48'),_0xafd4('0x11'),'OrderBy',_0xafd4('0x2c'),_0xafd4('0x2d')],squel[_0xafd4('0xf')]()[_0xafd4('0x31')](_0x5ee4b7)['from']('cm_hopper')[_0xafd4('0x13')](_0xafd4('0x32'),null,_0xafd4('0x49'))[_0xafd4('0x13')](_0xafd4('0x4a'),null,_0xafd4('0x4b'))['where']('cm_hopper.ListId\x20=\x20?',_0x584cca)[_0xafd4('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xafd4('0x39')]();}function insertCmContact(_0x3b318e,_0x5150ca,_0x5da6f3,_0x58f994){var _0x2cf553=_[_0xafd4('0x4c')](_[_0xafd4('0x4d')](_0x58f994),[_0xafd4('0x3b'),_0xafd4('0x4e'),_0xafd4('0x2c'),_0xafd4('0x2d')]);return squel[_0xafd4('0x27')]()[_0xafd4('0x28')](_0xafd4('0x32'))[_0xafd4('0x29')](_0x2cf553,squel[_0xafd4('0xf')]()['fields'](_0x2cf553)['from'](_0x5150ca)[_0xafd4('0x15')]('('+_0x5da6f3[_0xafd4('0x13')](',')+_0xafd4('0x4f'),squel[_0xafd4('0xf')]()['fields'](_0x5da6f3)[_0xafd4('0x12')](_0xafd4('0x32'))[_0xafd4('0x15')](_0xafd4('0x3f'),_0x3b318e)[_0xafd4('0x15')](_0xafd4('0x50')))['where']('id\x20IN\x20?',squel['select']()['field'](_0xafd4('0x51'),'min_id')[_0xafd4('0x12')](_0x5150ca)[_0xafd4('0x52')](_0x5da6f3[_0xafd4('0x13')](','))))[_0xafd4('0x39')]();}function handleStop(){logger[_0xafd4('0x53')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x756f20){logger[_0xafd4('0x54')](_0x756f20[_0xafd4('0x55')]);process[_0xafd4('0x56')](0x1);}function handleError(_0x5239c5,_0x3729cc){stats[_0xafd4('0x57')][_0xafd4('0x17')]({'name':_0x3729cc[_0xafd4('0x58')],'message':_0x3729cc[_0xafd4('0x55')],'row':_0x5239c5});}function handleQuery(_0x58f88c){logger[_0xafd4('0x53')](_0x58f88c);return db[_0xafd4('0x59')][_0xafd4('0x5a')](_0x58f88c)[_0xafd4('0x5b')](function(_0x4d4175){results[_0xafd4('0x17')](_0x4d4175);})[_0xafd4('0x5c')](function(_0x38007e){logger[_0xafd4('0x54')](_0x38007e[_0xafd4('0x55')]);});}function updateTzCampaigns(_0x16b83d){return new Promise(function(_0x302508,_0x534ded){var _0x7d31a8=squel[_0xafd4('0xf')]()[_0xafd4('0x31')]([_0xafd4('0x5d'),_0xafd4('0x5e')])[_0xafd4('0x12')](_0xafd4('0x5f'))[_0xafd4('0x13')](_0xafd4('0x60'),null,_0xafd4('0x61'))[_0xafd4('0x15')](_0xafd4('0x62')+_0x16b83d);db[_0xafd4('0x59')]['query'](_0x7d31a8[_0xafd4('0x39')]())[_0xafd4('0x5b')](function(_0xfc1070){var _0x2ca0ec=[];for(var _0xe701f0=0x0;_0xe701f0<_0xfc1070[_0xafd4('0x1b')];_0xe701f0++){_0x2ca0ec['push'](getTimezoneData(_0xfc1070[_0xe701f0],tmp_campaigns));}BPromise[_0xafd4('0x18')](_0x2ca0ec)['then'](function(){_0x302508({'val':0x1});});})['catch'](function(_0x4cb97b){logger['error'](_0x4cb97b[_0xafd4('0x55')]);_0x302508({'val':0x0});});});}function updateTzVoiceQueues(_0x2c9ab3){return new Promise(function(_0x174da6,_0x4dedff){var _0xdfb9ae=squel[_0xafd4('0xf')]()[_0xafd4('0x31')]([_0xafd4('0x63'),_0xafd4('0x64')])[_0xafd4('0x12')](_0xafd4('0x65'))[_0xafd4('0x13')](_0xafd4('0x66'),null,_0xafd4('0x67'))[_0xafd4('0x15')](_0xafd4('0x68')+_0x2c9ab3);db[_0xafd4('0x59')][_0xafd4('0x5a')](_0xdfb9ae[_0xafd4('0x39')]())['spread'](function(_0x4b0050){var _0x4b9e77=[];for(var _0x1df391=0x0;_0x1df391<_0x4b0050[_0xafd4('0x1b')];_0x1df391++){_0x4b9e77[_0xafd4('0x17')](getTimezoneData(_0x4b0050[_0x1df391],tmp_voice_queues));}BPromise['all'](_0x4b9e77)[_0xafd4('0x19')](function(){_0x174da6({'val':0x1});});})['catch'](function(_0x57ffe0){logger['error'](_0x57ffe0['message']);_0x174da6({'val':0x0});});});}function getTimezoneData(_0xe2b1bb,_0x17273c){return new Promise(function(_0x3ca07d,_0x27489a){var _0x501103=shared[_0xafd4('0x69')];var _0x48e747=_0x501103[_0xe2b1bb['dialTimezone']];if(_['isNil'](_0x48e747)){_0x3ca07d({'ret':0x1});}else{var _0x4974ea=_0x48e747[_0xafd4('0x6a')];var _0x422675=squel['insert']()[_0xafd4('0x28')](_0x17273c)[_0xafd4('0x6b')]('id',_0xe2b1bb['id'])[_0xafd4('0x6b')](_0xafd4('0x6c'),_0x4974ea)[_0xafd4('0x6b')]('dialTimezone',_0xe2b1bb['dialTimezone'])[_0xafd4('0x39')]();return db[_0xafd4('0x59')][_0xafd4('0x5a')](_0x422675)[_0xafd4('0x5b')](function(_0x28ba7b){_0x3ca07d({'ret':0x1});})[_0xafd4('0x5c')](function(_0x45b7a9){logger['error'](_0x45b7a9[_0xafd4('0x55')]);_0x27489a({'ret':0x1});});}});}function handleTZQuery(_0xf951cc){logger['info'](_0xf951cc);return db[_0xafd4('0x59')][_0xafd4('0x5a')](_0xf951cc)['spread'](function(_0x51cb82){})[_0xafd4('0x5c')](function(_0x4d16b3){logger['error'](_0x4d16b3['message']);});}function main(_0x4ef776,_0x480668,_0x32cfed,_0x4d67d6){logger[_0xafd4('0x53')](_0xafd4('0x6d'),_0x4ef776,JSON['stringify'](_0x480668));process[_0xafd4('0x6e')]('start');var _0x77b301=_0x480668['binding'];var _0x3be0e3=_[_0xafd4('0x6f')](_0x77b301);var _0x323e21=_0x480668['socket_timestamp'];var _0x50e1be=path[_0xafd4('0x13')](config['root'],_0xafd4('0x70'),_0x323e21+'.csv');hasTZ=_[_0xafd4('0x4d')](_0x77b301)[_0xafd4('0x71')](_0xafd4('0x72'));var _0x1806fa=_[_0xafd4('0x4d')](_0x77b301)[_0xafd4('0x13')]();logger['info'](_0xafd4('0x73'),_0x1806fa);db[_0xafd4('0x74')][_0xafd4('0x75')]({'raw':!![],'attributes':['id',_0xafd4('0x76')]})[_0xafd4('0x19')](function(_0x386104){for(var _0x1099c7=0x0;_0x1099c7<_0x386104[_0xafd4('0x1b')];_0x1099c7++){if(_0x386104[_0x1099c7][_0xafd4('0x76')]in _0x77b301){contactItemTypes['push'](_0x386104[_0x1099c7]);delete _0x3be0e3[_0x386104[_0x1099c7]['name']];hasAdditionalPhones=!![];}for(var _0x5ce038 in _0x77b301){if(_0x386104[_0x1099c7][_0xafd4('0x76')]+_0xafd4('0x77')===_0x5ce038){phoneDescriptions['push']({'itemTypeId':_0x386104[_0x1099c7]['id'],'description':_0x5ce038});delete _0x3be0e3[_0x5ce038];}}}if(hasAdditionalPhones)_0x3be0e3['AdditionalPhones']='';var _0x4c8abd=_['keys'](_0x3be0e3)[_0xafd4('0x13')]();logger[_0xafd4('0x53')](_0xafd4('0x73'),_0x4c8abd);fs[_0xafd4('0x78')](_0x50e1be,_0x4c8abd+'\x0a');Papa[_0xafd4('0x79')](fs[_0xafd4('0x7a')](_0x4ef776),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a63ca,_0x20c0c9){try{for(var _0x232dd5=0x0,_0x2a4071=[];_0x232dd5<_0x1a63ca[_0xafd4('0x7b')][_0xafd4('0x1b')];_0x232dd5++){stats[_0xafd4('0x7c')]+=0x1;if(_0x1a63ca[_0xafd4('0x57')][_0x232dd5]){handleError(_0x1a63ca[_0xafd4('0x7b')][_0x232dd5],_0x1a63ca['errors'][_0x232dd5]);}else{var _0x15da8c=[];var _0x1df6ea=[];var _0x523082={};for(var _0xb63cc9 in _0x77b301){let _0x48c7a3=contactItemTypes['find'](_0x29e2f9=>_0x29e2f9['name']===_0xb63cc9);let _0x2c176b=contactItemTypes[_0xafd4('0x7d')](_0x5998b3=>_0x5998b3[_0xafd4('0x76')]+'_description'===_0xb63cc9);if(_['isNil'](_0x48c7a3)&&_[_0xafd4('0x7e')](_0x2c176b)){if(_0x77b301[_0xafd4('0x7f')](_0xb63cc9)){if(_0x1a63ca[_0xafd4('0x7b')][_0x232dd5][_0x77b301[_0xb63cc9]]){var _0x374569=_[_0xafd4('0x80')](_0x1a63ca[_0xafd4('0x7b')][_0x232dd5][_0x77b301[_0xb63cc9]][_0xafd4('0x81')](/"/g,'\x27'));switch(_0xb63cc9){case'scheduledat':var _0x55c152=moment(_0x374569,_0xafd4('0xd'),!![]);if(_0x55c152['isValid']()){_0x2a4071[_0xafd4('0x17')]('\x22'+_0x374569+'\x22');}else{_0x15da8c['push'](_0xafd4('0x82'));}break;case _0xafd4('0x2e'):var _0x5dcc17=parseInt(_0x374569);_0x374569=_['isNaN'](_0x5dcc17)||_0x5dcc17<0x0||_0x5dcc17>0x4?_0x4d67d6?0x3:0x2:_0x5dcc17;_0x2a4071[_0xafd4('0x17')]('\x22'+_0x374569+'\x22');break;case'UserId':var _0x2dc84d=parseInt(_0x374569);if(_['isNumber'](_0x2dc84d)&&_[_0xafd4('0x71')](_0x32cfed,_0x2dc84d)){_0x2a4071[_0xafd4('0x17')]('\x22'+_0x2dc84d+'\x22');}else{_0x15da8c[_0xafd4('0x17')]('agent\x20not\x20exists');}break;case _0xafd4('0x83'):if(isEmail(_0x374569)){_0x2a4071[_0xafd4('0x17')]('\x22'+_0x374569+'\x22');}else{_0x15da8c[_0xafd4('0x17')]('email\x20wrong\x20format');}break;case _0xafd4('0x84'):var _0x4b6b59=moment(_0x374569,_0xafd4('0x85'),!![]);if(_0x4b6b59['isValid']()){_0x2a4071[_0xafd4('0x17')]('\x22'+_0x374569+'\x22');}else{_0x15da8c[_0xafd4('0x17')](_0xafd4('0x86'));}break;case _0xafd4('0x72'):var _0x3ea48f=shared[_0xafd4('0x69')];var _0x1dbbff=_0x3ea48f[_0x374569];if(!_[_0xafd4('0x7e')](_0x1dbbff)){var _0xd84658=_0x1dbbff[_0xafd4('0x6a')];_0x2a4071[_0xafd4('0x17')]('\x22'+_0x374569+'\x22');_0x2a4071['push']('\x22'+_0xd84658+'\x22');}break;default:_0x2a4071[_0xafd4('0x17')]('\x22'+_0x374569+'\x22');}}else{switch(_0xb63cc9){case'firstName':case'phone':_0x15da8c[_0xafd4('0x17')](_0xb63cc9+_0xafd4('0x87'));break;default:_0x2a4071[_0xafd4('0x17')]('\x22\x22');}}}}else{var _0x5e673f='';if(!_[_0xafd4('0x7e')](_0x48c7a3)){if(!_0x523082[_0xafd4('0x7f')](_0x48c7a3['id'])){if(!_[_0xafd4('0x7e')](_0x1a63ca[_0xafd4('0x7b')][_0x232dd5][_0x77b301[_0xb63cc9]])){var _0x374569=_[_0xafd4('0x80')](_0x1a63ca[_0xafd4('0x7b')][_0x232dd5][_0x77b301[_0xb63cc9]]['replace'](/"/g,'\x27'));var _0x372c0a=phoneDescriptions[_0xafd4('0x7d')](_0x5816f7=>_0x5816f7[_0xafd4('0x88')]===_0x48c7a3['id']);if(!_['isNil'](_0x372c0a)){var _0x261420=_[_0xafd4('0x80')](_0x1a63ca[_0xafd4('0x7b')][_0x232dd5][_0x77b301[_0x372c0a['description']]][_0xafd4('0x81')](/"/g,'\x27'));if(!_[_0xafd4('0x7e')](_0x261420))_0x374569=_0x374569+'§'+_0x261420;}if(_0x5e673f=='')_0x5e673f=_0x374569;else _0x5e673f+='|'+_0x374569;}_0x1df6ea[_0xafd4('0x17')](_0x48c7a3['id']+':'+_0x5e673f);_0x523082[_0x48c7a3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2a4071['push']('\x22'+_0x1df6ea['join'](';')+'\x22');}if(_0x15da8c[_0xafd4('0x1b')]){handleError(_0x1a63ca['data'][_0x232dd5],{'code':'SystemRow','message':_0x15da8c[_0xafd4('0x13')]()});}else{fs[_0xafd4('0x89')](_0x50e1be,_0x2a4071[_0xafd4('0x13')]()+'\x0a');}_0x2a4071=[];}if(!(stats[_0xafd4('0x7c')]%0xc8)){socket[_0xafd4('0x8a')](_0xafd4('0x8b')+_0x323e21,stats);stats[_0xafd4('0x57')]=[];}}if(stopped){logger[_0xafd4('0x53')](_0xafd4('0x8c'));_0x20c0c9[_0xafd4('0x8d')]();}}catch(_0x4e6d8c){handleError(_0x1a63ca[_0xafd4('0x7b')][_0x232dd5],{'code':_0xafd4('0x8e'),'message':_0x4e6d8c['message']});logger[_0xafd4('0x54')](_0xafd4('0x8f'),_0x4e6d8c[_0xafd4('0x55')]);}},'complete':function(){try{var _0x3fef2c=[];var _0x5062f8=[];var _0x4012e4=_0xafd4('0x32');if(_0x480668['duplicates']&&_0x480668[_0xafd4('0x90')][_0xafd4('0x1b')]){_0x4012e4=_0xafd4('0x91')+_0x323e21;_0x3fef2c[_0xafd4('0x17')]('CREATE\x20TABLE\x20'+_0x4012e4+_0xafd4('0x92'));}tmp_campaigns=_0xafd4('0x93')+_0x323e21;tmp_voice_queues=_0xafd4('0x94')+_0x323e21;_0x5062f8[_0xafd4('0x17')](_0xafd4('0x95')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x5062f8[_0xafd4('0x17')](_0xafd4('0x95')+tmp_voice_queues+_0xafd4('0x96'));BPromise['each'](_0x5062f8,handleTZQuery)['then'](function(_0x261685){updateTzCampaigns(_0x480668[_0xafd4('0x3b')])[_0xafd4('0x19')](function(_0x47ca20){updateTzVoiceQueues(_0x480668[_0xafd4('0x3b')])[_0xafd4('0x19')](function(_0x37051c){if(hasTZ)_0x4c8abd=_0x4c8abd[_0xafd4('0x81')](_0xafd4('0x72'),'dialTimezone,utcOffset');var _0x475bfe=util[_0xafd4('0xc')]('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',_0x50e1be,_0x4012e4,_0x4c8abd,_0x480668[_0xafd4('0x3b')],_0x480668['CompanyId']||null,NOW,NOW);if(_[_0xafd4('0x7e')](_0x77b301[_0xafd4('0x2a')])){_0x475bfe+=_0xafd4('0x97');}_0x3fef2c[_0xafd4('0x17')](_0x475bfe);if(_0x480668[_0xafd4('0x90')]&&_0x480668['duplicates'][_0xafd4('0x1b')]){_0x3fef2c[_0xafd4('0x17')](insertCmContact(_0x480668[_0xafd4('0x3b')],_0x4012e4,_0x480668[_0xafd4('0x90')],_0x77b301));_0x3fef2c['push']('DROP\x20TABLE\x20'+_0x4012e4+';');}BPromise[_0xafd4('0x98')](_0x3fef2c,handleQuery)['then'](function(_0x3ffbbd){BPromise[_0xafd4('0x18')]([handleAdditionalPhones()])[_0xafd4('0x19')](function(){_0x3fef2c=[];for(var _0x4ca0eb=0x0;_0x4ca0eb\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf643,0x122));var _0x3f64=function(_0x54e631,_0x3b8396){_0x54e631=_0x54e631-0x0;var _0x3c6b6a=_0xf643[_0x54e631];return _0x3c6b6a;};'use strict';var fs=require('fs');var path=require(_0x3f64('0x0'));var _=require(_0x3f64('0x1'));var Papa=require(_0x3f64('0x2'));var util=require(_0x3f64('0x3'));var BPromise=require('bluebird');var moment=require(_0x3f64('0x4'));var squel=require(_0x3f64('0x5'));var Redis=require('ioredis');var db=require(_0x3f64('0x6'))['db'];var config=require(_0x3f64('0x7'));var logger=require(_0x3f64('0x8'))(_0x3f64('0x9'));config[_0x3f64('0xa')]=_[_0x3f64('0xb')](config[_0x3f64('0xa')],{'host':_0x3f64('0xc'),'port':0x18eb});var socket=require(_0x3f64('0xd'))(new Redis(config[_0x3f64('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x3f64('0xe')](_0x3f64('0xf'));var tempTableName=_0x3f64('0x10')+moment()[_0x3f64('0xe')](_0x3f64('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4ff35e){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))*$/[_0x3f64('0x12')](_0x4ff35e);}function selectNotIn(_0x3edbce,_0x8aa885,_0x506f2a,_0x3a2c7d,_0x42fb23){return squel[_0x3f64('0x13')]()[_0x3f64('0x14')](_0x3f64('0x15'))[_0x3f64('0x16')](_0x3a2c7d)[_0x3f64('0x17')](_0x8aa885,null,_0x8aa885+_0x3f64('0x18')+_0x3a2c7d+'.'+_0x506f2a)[_0x3f64('0x19')](_0x3a2c7d+'.'+_0x506f2a+_0x3f64('0x1a')+_0x3edbce+'.'+_0x506f2a)[_0x3f64('0x19')](_0x8aa885+_0x3f64('0x1b')+_0x42fb23['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x84d3a9,_0x1af45b){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3f64('0x1c')][_0x3f64('0x1d')]('select\x20*\x20from\x20'+tempTableName)[_0x3f64('0x1e')](function(_0x1c17bb){if(_0x1c17bb!==null){var _0x2650a1=[];for(var _0x3e9c46=0x0;_0x3e9c46<_0x1c17bb[_0x3f64('0x1f')];_0x3e9c46++){var _0x26e807=_0x1c17bb[_0x3e9c46];if(!_[_0x3f64('0x20')](_0x26e807['phone'])){if(!_[_0x3f64('0x20')](_0x26e807[_0x3f64('0x21')]))_0x2650a1[_0x3f64('0x22')](insertAdditionalPhones(_0x26e807));promisesContact['push']({'contact':_0x26e807});}}}Promise[_0x3f64('0x23')](_0x2650a1)['then'](function(){_0x84d3a9({'val':0x1});});})['catch'](function(_0xe904d9){logger[_0x3f64('0x24')](_0xe904d9[_0x3f64('0x25')]);});});}function insertAdditionalPhones(_0x5b5d10){return new Promise(function(_0x40e9e8,_0x301d72){var _0x211c91=_0x5b5d10['AdditionalPhones'];if(_[_0x3f64('0x20')](_0x211c91))_0x301d72({'val':0x0});else{var _0xbf2f1=_0x211c91['split'](';');var _0xc72655=[];orderBy=0x0;for(var _0x3faf46=0x0;_0x3faf46<_0xbf2f1['length'];_0x3faf46++){_0xc72655['push'](splitAdditionalPhone(_0x5b5d10['id'],_0xbf2f1[_0x3faf46]));}Promise['all'](_0xc72655)[_0x3f64('0x26')](function(){_0x40e9e8({'val':_0xbf2f1[_0x3f64('0x1f')]});});}});}function splitAdditionalPhone(_0x336b98,_0x1b49fe){return new Promise(function(_0x112906,_0x48be0c){var _0x222097=_0x1b49fe[_0x3f64('0x27')](':');var _0x151f1e=_0x222097[0x0];var _0x142fe5=_0x222097[0x1];if(_0x142fe5!==''){var _0x383780=_0x142fe5[_0x3f64('0x27')]('|');var _0x1f0f91=[];for(var _0x3499ff=0x0;_0x3499ff<_0x383780['length'];_0x3499ff++){if(_0x383780[_0x3499ff]!==''){var _0x8d8f36=_['filter'](promisesAdditionalPhones,{'contactId':_0x336b98,'phone':_0x383780[_0x3499ff]});if(_0x8d8f36[_0x3f64('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0x3f64('0x22')]({'contactId':_0x336b98,'contactTypeId':_0x151f1e,'phone':_0x383780[_0x3499ff],'orderBy':orderBy});}}}_0x112906({'ok':0x1});}else _0x112906({'res':0x0});});}function createAdditionalPhone(_0x43f349,_0x2fac90,_0x191a2d,_0x307efc){var _0x286b2a='';var _0x1bcefe='';var _0x36b338=_0x191a2d[_0x3f64('0x27')]('§');_0x286b2a=_0x36b338[0x0];if(_0x36b338['length']==0x2)_0x1bcefe=_0x36b338[0x1];return new Promise(function(_0x584a48,_0x25ec96){return db['CmContactHasItem'][_0x3f64('0x28')]({'where':{'CmContactId':_0x43f349,'item':_0x286b2a}})[_0x3f64('0x26')](function(_0x211da2){if(_0x211da2){return db[_0x3f64('0x29')]['update']({'ItemTypeId':_0x2fac90,'description':_0x1bcefe,'OrderBy':_0x307efc},{'where':{'CmContactId':_0x43f349,'item':_0x286b2a}})['then'](function(_0x824232){_0x584a48({'res':_0x3f64('0x2a')});});}else{return db[_0x3f64('0x29')][_0x3f64('0x2b')]({'CmContactId':_0x43f349,'item':_0x286b2a,'ItemTypeId':_0x2fac90,'description':_0x1bcefe,'OrderBy':_0x307efc,'ItemClass':'PHONE'})[_0x3f64('0x26')](function(_0x547e46){_0x584a48({'res':'inserted'});});}});});}function updateContact(_0x5d5ce2){return new Promise(function(_0x28989e,_0x581e5f){var _0x320094=_0x5d5ce2['id'];delete _0x5d5ce2['id'];return db['CmContact'][_0x3f64('0x2c')](_0x5d5ce2,{'where':{'id':_0x320094}})[_0x3f64('0x26')](function(_0x22bf5f){updatedRows+=0x1;return db[_0x3f64('0x2d')]['update']({'phone':_0x5d5ce2[_0x3f64('0x15')]},{'where':{'ContactId':_0x320094}})[_0x3f64('0x26')](function(_0x2fe6b5){_0x28989e({'ret':'OK'});});});});}function insertCmHopper(_0x53787a,_0x54648f,_0x275bcf,_0x4a0800,_0xfc1e23){var _0x112940=[_0x3f64('0x2e'),'cm_contacts.scheduledat',_0x3f64('0x2f'),_0x3f64('0x30'),_0x54648f+'.'+_0x4a0800,_0x3f64('0x31'),_0x3f64('0x32'),_0x3f64('0x33'),_0x3f64('0x34'),'\x22'+_0xfc1e23+'\x22'];return squel[_0x3f64('0x35')]()[_0x3f64('0x36')](_0x3f64('0x37'))[_0x3f64('0x38')]([_0x3f64('0x15'),_0x3f64('0x39'),_0x3f64('0x3a'),_0x3f64('0x3b'),_0x4a0800,'createdAt',_0x3f64('0x3c'),_0x3f64('0x3d'),_0x3f64('0x3e'),'recallme'],squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x112940)[_0x3f64('0x16')](_0x54648f)[_0x3f64('0x17')](_0x3f64('0x40'),null,_0x3f64('0x41')+_0x54648f+'.CmListId')[_0x3f64('0x17')](_0x275bcf,null,_0x275bcf+'.id\x20=\x20'+_0x54648f+'.'+_0x4a0800)[_0x3f64('0x19')](_0x54648f+_0x3f64('0x42'),_0x53787a)[_0x3f64('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3f64('0x19')](_0x3f64('0x43'),selectNotIn(_0x54648f,_0x275bcf,_0x4a0800,_0x3f64('0x37'),[_0x3f64('0x44'),'\x22onlyIfOpen\x22']))[_0x3f64('0x19')](_0x3f64('0x43'),selectNotIn(_0x54648f,_0x275bcf,_0x4a0800,_0x3f64('0x37'),[_0x3f64('0x44')])))['toString']();}function insertCmHopperBlack(_0x5c6a22,_0x38b32c,_0x291f70,_0x4f3ddd){var _0x36ad87=[_0x3f64('0x2e'),_0x3f64('0x2f'),'cm_contacts.ListId',_0x38b32c+'.'+_0x4f3ddd,_0x3f64('0x31'),_0x3f64('0x32')];return squel['insert']()[_0x3f64('0x36')](_0x3f64('0x45'))[_0x3f64('0x38')]([_0x3f64('0x15'),_0x3f64('0x3a'),_0x3f64('0x3b'),_0x4f3ddd,_0x3f64('0x46'),_0x3f64('0x3c')],squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x36ad87)[_0x3f64('0x16')](_0x38b32c)[_0x3f64('0x17')](_0x3f64('0x40'),null,'cm_contacts.ListId\x20=\x20'+_0x38b32c+'.CmListId')[_0x3f64('0x17')](_0x291f70,null,_0x291f70+_0x3f64('0x18')+_0x38b32c+'.'+_0x4f3ddd)[_0x3f64('0x19')](_0x38b32c+_0x3f64('0x42'),_0x5c6a22)['where'](_0x3f64('0x47'),NOW)[_0x3f64('0x19')](_0x3f64('0x43'),squel[_0x3f64('0x13')]()[_0x3f64('0x14')](_0x3f64('0x15'))[_0x3f64('0x16')](_0x3f64('0x45'))[_0x3f64('0x19')]('ListId\x20=\x20?',_0x5c6a22)[_0x3f64('0x19')](_0x4f3ddd+_0x3f64('0x48'),_0x38b32c+'.'+_0x4f3ddd)))[_0x3f64('0x49')]();}function insertCmHopperAdditionalPhones(_0xfcbff0){var _0x51b047=[_0x3f64('0x4a'),_0x3f64('0x4b'),'cm_contact_has_items.OrderBy',_0x3f64('0x4c'),_0x3f64('0x4d')];return squel[_0x3f64('0x35')]()[_0x3f64('0x36')](_0x3f64('0x4e'))['fromQuery'](['CmHopperId',_0x3f64('0x15'),'OrderBy',_0x3f64('0x46'),_0x3f64('0x3c')],squel[_0x3f64('0x13')]()['fields'](_0x51b047)[_0x3f64('0x16')](_0x3f64('0x37'))[_0x3f64('0x17')](_0x3f64('0x40'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x3f64('0x17')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x3f64('0x19')](_0x3f64('0x4f'),_0xfcbff0)[_0x3f64('0x19')](_0x3f64('0x47'),NOW))['toString']();}function insertCmContact(_0x36826b,_0x59d824,_0x3a2fb9,_0x52132b){var _0x569613=_[_0x3f64('0x50')](_[_0x3f64('0x51')](_0x52132b),[_0x3f64('0x3b'),_0x3f64('0x52'),_0x3f64('0x46'),_0x3f64('0x3c')]);return squel[_0x3f64('0x35')]()[_0x3f64('0x36')]('cm_contacts')[_0x3f64('0x38')](_0x569613,squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x569613)[_0x3f64('0x16')](_0x59d824)[_0x3f64('0x19')]('('+_0x3a2fb9['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x3f64('0x13')]()[_0x3f64('0x3f')](_0x3a2fb9)[_0x3f64('0x16')](_0x3f64('0x40'))['where'](_0x3f64('0x53'),_0x36826b))[_0x3f64('0x19')](_0x3f64('0x54'),squel[_0x3f64('0x13')]()[_0x3f64('0x14')]('MIN(id)',_0x3f64('0x55'))['from'](_0x59d824)[_0x3f64('0x56')](_0x3a2fb9[_0x3f64('0x17')](','))))[_0x3f64('0x49')]();}function handleStop(){logger['info'](_0x3f64('0x57'));stopped=!![];}function handleUncaughtException(_0x16bf10){logger[_0x3f64('0x24')](_0x16bf10['message']);process[_0x3f64('0x58')](0x1);}function handleError(_0x4321ca,_0x2373ba){stats['errors'][_0x3f64('0x22')]({'name':_0x2373ba[_0x3f64('0x59')],'message':_0x2373ba['message'],'row':_0x4321ca});}function handleQuery(_0x350c5f){logger[_0x3f64('0x5a')](_0x350c5f);return db[_0x3f64('0x1c')]['query'](_0x350c5f)[_0x3f64('0x1e')](function(_0x54c3c9){results['push'](_0x54c3c9);})[_0x3f64('0x5b')](function(_0x125e9b){logger[_0x3f64('0x24')](_0x125e9b[_0x3f64('0x25')]);});}function main(_0x340117,_0x23cd05,_0x24d382,_0x16ccab){logger[_0x3f64('0x5a')]('main',_0x340117,JSON['stringify'](_0x23cd05));process[_0x3f64('0x5c')](_0x3f64('0x5d'));var _0x53e5af=_0x23cd05[_0x3f64('0x5e')];var _0x4ad862=_[_0x3f64('0x5f')](_0x53e5af);var _0x301d3f=_0x23cd05[_0x3f64('0x60')];var _0x356da9=path[_0x3f64('0x17')](config[_0x3f64('0x61')],_0x3f64('0x62'),_0x301d3f+'.csv');logger[_0x3f64('0x5a')](_0x3f64('0x63'),_0x23cd05);db[_0x3f64('0x64')][_0x3f64('0x65')]({'raw':!![],'attributes':['id',_0x3f64('0x66')]})[_0x3f64('0x26')](function(_0x517f40){for(var _0x530197=0x0;_0x530197<_0x517f40[_0x3f64('0x1f')];_0x530197++){if(_0x517f40[_0x530197][_0x3f64('0x66')]in _0x53e5af){contactItemTypes[_0x3f64('0x22')](_0x517f40[_0x530197]);delete _0x4ad862[_0x517f40[_0x530197]['name']];hasAdditionalPhones=!![];}for(var _0x28a021 in _0x53e5af){if(_0x517f40[_0x530197][_0x3f64('0x66')]+_0x3f64('0x67')===_0x28a021){phoneDescriptions[_0x3f64('0x22')]({'itemTypeId':_0x517f40[_0x530197]['id'],'description':_0x28a021});delete _0x4ad862[_0x28a021];}}}if(hasAdditionalPhones)_0x4ad862[_0x3f64('0x21')]='';var _0x5af1ee=_[_0x3f64('0x51')](_0x4ad862)[_0x3f64('0x17')]();logger['info'](_0x3f64('0x68'),_0x5af1ee);fs[_0x3f64('0x69')](_0x356da9,_0x5af1ee+'\x0a');Papa[_0x3f64('0x6a')](fs['createReadStream'](_0x340117),{'header':!![],'skipEmptyLines':!![],'step':function(_0x11efc3,_0x5608a5){try{for(var _0x3c064a=0x0,_0x12611b=[];_0x3c064a<_0x11efc3[_0x3f64('0x6b')][_0x3f64('0x1f')];_0x3c064a++){stats[_0x3f64('0x6c')]+=0x1;if(_0x11efc3[_0x3f64('0x6d')][_0x3c064a]){handleError(_0x11efc3[_0x3f64('0x6b')][_0x3c064a],_0x11efc3['errors'][_0x3c064a]);}else{var _0x4c0949=[];var _0x50d3cf=[];var _0x42acd0={};for(var _0xcf5dd4 in _0x53e5af){let _0x292e83=contactItemTypes[_0x3f64('0x6e')](_0x39c8c2=>_0x39c8c2['name']===_0xcf5dd4);let _0x1c3c8c=contactItemTypes[_0x3f64('0x6e')](_0xac57c6=>_0xac57c6[_0x3f64('0x66')]+'_description'===_0xcf5dd4);if(_[_0x3f64('0x20')](_0x292e83)&&_[_0x3f64('0x20')](_0x1c3c8c)){if(_0x53e5af[_0x3f64('0x6f')](_0xcf5dd4)){if(_0x11efc3['data'][_0x3c064a][_0x53e5af[_0xcf5dd4]]){var _0x4914be=_[_0x3f64('0x70')](_0x11efc3[_0x3f64('0x6b')][_0x3c064a][_0x53e5af[_0xcf5dd4]][_0x3f64('0x71')](/"/g,'\x27'));switch(_0xcf5dd4){case _0x3f64('0x39'):var _0x1d6611=moment(_0x4914be,_0x3f64('0xf'),!![]);if(_0x1d6611[_0x3f64('0x72')]()){_0x12611b['push']('\x22'+_0x4914be+'\x22');}else{_0x4c0949['push'](_0x3f64('0x73'));}break;case _0x3f64('0x3d'):var _0x559399=parseInt(_0x4914be);_0x4914be=_[_0x3f64('0x74')](_0x559399)||_0x559399<0x0||_0x559399>0x4?_0x16ccab?0x3:0x2:_0x559399;_0x12611b[_0x3f64('0x22')]('\x22'+_0x4914be+'\x22');break;case _0x3f64('0x3e'):var _0x4a0274=parseInt(_0x4914be);if(_[_0x3f64('0x75')](_0x4a0274)&&_[_0x3f64('0x76')](_0x24d382,_0x4a0274)){_0x12611b[_0x3f64('0x22')]('\x22'+_0x4a0274+'\x22');}else{_0x4c0949[_0x3f64('0x22')](_0x3f64('0x77'));}break;case _0x3f64('0x78'):if(isEmail(_0x4914be)){_0x12611b[_0x3f64('0x22')]('\x22'+_0x4914be+'\x22');}else{_0x4c0949[_0x3f64('0x22')](_0x3f64('0x79'));}break;case _0x3f64('0x7a'):var _0x5736b1=moment(_0x4914be,'YYYY-MM-DD',!![]);if(_0x5736b1['isValid']()){_0x12611b['push']('\x22'+_0x4914be+'\x22');}else{_0x4c0949[_0x3f64('0x22')](_0x3f64('0x7b'));}break;default:_0x12611b['push']('\x22'+_0x4914be+'\x22');}}else{switch(_0xcf5dd4){case _0x3f64('0x7c'):case _0x3f64('0x15'):_0x4c0949[_0x3f64('0x22')](_0xcf5dd4+_0x3f64('0x7d'));break;default:_0x12611b['push']('\x22\x22');}}}}else{var _0x4f51d5='';if(!_[_0x3f64('0x20')](_0x292e83)){if(!_0x42acd0['hasOwnProperty'](_0x292e83['id'])){for(var _0x6f0dc=0x0;_0x6f0dc<_0x53e5af[_0xcf5dd4]['length'];_0x6f0dc++){var _0x4914be=_[_0x3f64('0x70')](_0x11efc3[_0x3f64('0x6b')][_0x3c064a][_0x53e5af[_0xcf5dd4][_0x6f0dc]][_0x3f64('0x71')](/"/g,'\x27'));var _0x8e8a38=phoneDescriptions[_0x3f64('0x6e')](_0x5d6718=>_0x5d6718[_0x3f64('0x7e')]===_0x292e83['id']);if(!_[_0x3f64('0x20')](_0x8e8a38)){var _0x10d1fc=_[_0x3f64('0x70')](_0x11efc3[_0x3f64('0x6b')][_0x3c064a][_0x53e5af[_0x8e8a38[_0x3f64('0x7f')]][0x0]][_0x3f64('0x71')](/"/g,'\x27'));if(!_[_0x3f64('0x20')](_0x10d1fc))_0x4914be=_0x4914be+'§'+_0x10d1fc;}if(_0x4f51d5=='')_0x4f51d5=_0x4914be;else _0x4f51d5+='|'+_0x4914be;}_0x50d3cf[_0x3f64('0x22')](_0x292e83['id']+':'+_0x4f51d5);_0x42acd0[_0x292e83['id']]=0x1;}}}}if(hasAdditionalPhones){_0x12611b[_0x3f64('0x22')]('\x22'+_0x50d3cf['join'](';')+'\x22');}if(_0x4c0949['length']){handleError(_0x11efc3[_0x3f64('0x6b')][_0x3c064a],{'code':_0x3f64('0x80'),'message':_0x4c0949['join']()});}else{fs['appendFileSync'](_0x356da9,_0x12611b[_0x3f64('0x17')]()+'\x0a');}_0x12611b=[];}if(!(stats[_0x3f64('0x6c')]%0xc8)){socket[_0x3f64('0x81')](_0x3f64('0x82')+_0x301d3f,stats);stats[_0x3f64('0x6d')]=[];}}if(stopped){logger['info'](_0x3f64('0x83'));_0x5608a5[_0x3f64('0x84')]();}}catch(_0x6d6fc7){handleError(_0x11efc3['data'][_0x3c064a],{'code':'SystemError','message':_0x6d6fc7['message']});logger[_0x3f64('0x24')]('step',_0x6d6fc7['message']);}},'complete':function(){try{var _0x5003e5=[];var _0x193b33=tempTableName;_0x5003e5[_0x3f64('0x22')](_0x3f64('0x85')+_0x193b33+_0x3f64('0x86'));logger['info']('CIS\x20len',contactItemTypes[_0x3f64('0x1f')]);var _0x4d2ac7=util['format'](_0x3f64('0x87'),_0x356da9,_0x193b33,_0x5af1ee,_0x23cd05['ListId'],_0x23cd05[_0x3f64('0x52')]||null,NOW,NOW);if(_[_0x3f64('0x20')](_0x53e5af[_0x3f64('0x39')])){_0x4d2ac7+=_0x3f64('0x88');}_0x5003e5[_0x3f64('0x22')](_0x4d2ac7);BPromise[_0x3f64('0x89')](_0x5003e5,handleQuery)[_0x3f64('0x26')](function(_0x5d8b44){BPromise[_0x3f64('0x23')]([handleAdditionalPhones()])[_0x3f64('0x26')](function(){_0x5003e5=[];for(var _0x136c54=0x0;_0x136c54\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','YYYYMMDDHHmmss','select','field','phone','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','query','spread','length','isNil','AdditionalPhones','push','then','catch','error','message','split','filter','CmContactHasItem','findOne','update','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','UserId','recallme','from','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_contacts.ListId','cm_hopper_black','ListId','createdAt','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','toString','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','exit','code','main','stringify','send','start','clone','socket_timestamp','server/files/tmp','.csv','body','ContactItemType','name','_description','header','parse','createReadStream','data','rows','errors','find','hasOwnProperty','replace','scheduledat','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','description','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId'];(function(_0x29378d,_0x3fdd12){var _0x4c9a81=function(_0x57e538){while(--_0x57e538){_0x29378d['push'](_0x29378d['shift']());}};_0x4c9a81(++_0x3fdd12);}(_0x85eb,0x150));var _0xb85e=function(_0x54ade4,_0x103485){_0x54ade4=_0x54ade4-0x0;var _0x45e947=_0x85eb[_0x54ade4];return _0x45e947;};'use strict';var fs=require('fs');var path=require(_0xb85e('0x0'));var _=require('lodash');var Papa=require(_0xb85e('0x1'));var util=require(_0xb85e('0x2'));var BPromise=require('bluebird');var moment=require(_0xb85e('0x3'));var squel=require(_0xb85e('0x4'));var Redis=require(_0xb85e('0x5'));var db=require(_0xb85e('0x6'))['db'];var config=require(_0xb85e('0x7'));var logger=require(_0xb85e('0x8'))(_0xb85e('0x9'));config[_0xb85e('0xa')]=_[_0xb85e('0xb')](config[_0xb85e('0xa')],{'host':_0xb85e('0xc'),'port':0x18eb});var socket=require(_0xb85e('0xd'))(new Redis(config[_0xb85e('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xb85e('0xe'));var tempTableName='cm_contacts_temp_'+moment()[_0xb85e('0xf')](_0xb85e('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1d4515){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'](_0x1d4515);}function selectNotIn(_0x4199f2,_0x3b5999,_0x1562a3,_0x2b9566,_0x188042){return squel[_0xb85e('0x11')]()[_0xb85e('0x12')](_0xb85e('0x13'))['from'](_0x2b9566)['join'](_0x3b5999,null,_0x3b5999+_0xb85e('0x14')+_0x2b9566+'.'+_0x1562a3)[_0xb85e('0x15')](_0x2b9566+'.'+_0x1562a3+_0xb85e('0x16')+_0x4199f2+'.'+_0x1562a3)[_0xb85e('0x15')](_0x3b5999+_0xb85e('0x17')+_0x188042[_0xb85e('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5b8d6e,_0x60ab45){promisesAdditionalPhones=[];promisesContact=[];return db[_0xb85e('0x19')][_0xb85e('0x1a')]('select\x20*\x20from\x20'+tempTableName)[_0xb85e('0x1b')](function(_0x153662){if(_0x153662!==null){var _0xd19f54=[];for(var _0x57fd07=0x0;_0x57fd07<_0x153662[_0xb85e('0x1c')];_0x57fd07++){var _0x452d39=_0x153662[_0x57fd07];if(!_[_0xb85e('0x1d')](_0x452d39[_0xb85e('0x13')])){if(!_[_0xb85e('0x1d')](_0x452d39[_0xb85e('0x1e')]))_0xd19f54[_0xb85e('0x1f')](insertAdditionalPhones(_0x452d39));promisesContact['push']({'contact':_0x452d39});}}}Promise['all'](_0xd19f54)[_0xb85e('0x20')](function(){_0x5b8d6e({'val':0x1});});})[_0xb85e('0x21')](function(_0x5b6237){logger[_0xb85e('0x22')](_0x5b6237[_0xb85e('0x23')]);});});}function insertAdditionalPhones(_0x196408){return new Promise(function(_0x44fc86,_0x59a3c5){var _0x5aecde=_0x196408[_0xb85e('0x1e')];if(_['isNil'](_0x5aecde))_0x59a3c5({'val':0x0});else{var _0x69400b=_0x5aecde[_0xb85e('0x24')](';');var _0x3e4bf0=[];orderBy=0x0;for(var _0x3d06dc=0x0;_0x3d06dc<_0x69400b[_0xb85e('0x1c')];_0x3d06dc++){_0x3e4bf0[_0xb85e('0x1f')](splitAdditionalPhone(_0x196408['id'],_0x69400b[_0x3d06dc]));}Promise['all'](_0x3e4bf0)['then'](function(){_0x44fc86({'val':_0x69400b[_0xb85e('0x1c')]});});}});}function splitAdditionalPhone(_0x1e6399,_0x4c3b53){return new Promise(function(_0x390d56,_0x2320c1){var _0x2e2d97=_0x4c3b53[_0xb85e('0x24')](':');var _0x37a072=_0x2e2d97[0x0];var _0x2d5322=_0x2e2d97[0x1];if(_0x2d5322!==''){var _0x21ee8d=_0x2d5322[_0xb85e('0x24')]('|');var _0x2ff5cf=[];for(var _0x361bc7=0x0;_0x361bc7<_0x21ee8d[_0xb85e('0x1c')];_0x361bc7++){if(_0x21ee8d[_0x361bc7]!==''){var _0x50cffe=_[_0xb85e('0x25')](promisesAdditionalPhones,{'contactId':_0x1e6399,'phone':_0x21ee8d[_0x361bc7]});if(_0x50cffe[_0xb85e('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0xb85e('0x1f')]({'contactId':_0x1e6399,'contactTypeId':_0x37a072,'phone':_0x21ee8d[_0x361bc7],'orderBy':orderBy});}}}_0x390d56({'ok':0x1});}else _0x390d56({'res':0x0});});}function createAdditionalPhone(_0xda4ec0,_0x4fb7df,_0x422f3b,_0x54b261){var _0x179413='';var _0x287524='';var _0x35e1fc=_0x422f3b[_0xb85e('0x24')]('§');_0x179413=_0x35e1fc[0x0];if(_0x35e1fc[_0xb85e('0x1c')]==0x2)_0x287524=_0x35e1fc[0x1];return new Promise(function(_0x1231d3,_0x237c99){return db[_0xb85e('0x26')][_0xb85e('0x27')]({'where':{'CmContactId':_0xda4ec0,'item':_0x179413}})[_0xb85e('0x20')](function(_0x59f653){if(_0x59f653){return db['CmContactHasItem'][_0xb85e('0x28')]({'ItemTypeId':_0x4fb7df,'description':_0x287524,'OrderBy':_0x54b261},{'where':{'CmContactId':_0xda4ec0,'item':_0x179413}})['then'](function(_0x11d2a4){_0x1231d3({'res':'updated'});});}else{return db[_0xb85e('0x26')]['create']({'CmContactId':_0xda4ec0,'item':_0x179413,'ItemTypeId':_0x4fb7df,'description':_0x287524,'OrderBy':_0x54b261,'ItemClass':'PHONE'})[_0xb85e('0x20')](function(_0x5c0ec1){_0x1231d3({'res':_0xb85e('0x29')});});}});});}function updateContact(_0x57ef95){return new Promise(function(_0x420dad,_0x39c87f){var _0x54ed4a=_0x57ef95['id'];delete _0x57ef95['id'];return db['CmContact'][_0xb85e('0x28')](_0x57ef95,{'where':{'id':_0x54ed4a}})[_0xb85e('0x20')](function(_0x54c34c){updatedRows+=0x1;return db['CmHopper'][_0xb85e('0x28')]({'phone':_0x57ef95[_0xb85e('0x13')]},{'where':{'ContactId':_0x54ed4a}})[_0xb85e('0x20')](function(_0x5dced0){_0x420dad({'ret':'OK'});});});});}function insertCmHopper(_0x16bca4,_0x5bec7d,_0x3e4092,_0x15f353,_0x41d144){var _0x335805=[_0xb85e('0x2a'),_0xb85e('0x2b'),_0xb85e('0x2c'),'cm_contacts.ListId',_0x5bec7d+'.'+_0x15f353,_0xb85e('0x2d'),_0xb85e('0x2e'),_0xb85e('0x2f'),_0xb85e('0x30'),'\x22'+_0x41d144+'\x22'];return squel[_0xb85e('0x31')]()[_0xb85e('0x32')](_0xb85e('0x33'))[_0xb85e('0x34')]([_0xb85e('0x13'),'scheduledat',_0xb85e('0x35'),'ListId',_0x15f353,'createdAt',_0xb85e('0x36'),_0xb85e('0x37'),_0xb85e('0x38'),_0xb85e('0x39')],squel[_0xb85e('0x11')]()['fields'](_0x335805)[_0xb85e('0x3a')](_0x5bec7d)['join']('cm_contacts',null,_0xb85e('0x3b')+_0x5bec7d+'.CmListId')[_0xb85e('0x18')](_0x3e4092,null,_0x3e4092+_0xb85e('0x14')+_0x5bec7d+'.'+_0x15f353)['where'](_0x5bec7d+'.CmListId\x20=\x20?',_0x16bca4)[_0xb85e('0x15')](_0xb85e('0x3c'),NOW)['where'](_0xb85e('0x3d'),selectNotIn(_0x5bec7d,_0x3e4092,_0x15f353,_0xb85e('0x33'),['\x22always\x22',_0xb85e('0x3e')]))[_0xb85e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5bec7d,_0x3e4092,_0x15f353,'cm_hopper',[_0xb85e('0x3f')])))['toString']();}function insertCmHopperBlack(_0x41dc2e,_0xd59445,_0x235dd4,_0x5af836){var _0x3070c2=[_0xb85e('0x2a'),'cm_contacts.id',_0xb85e('0x40'),_0xd59445+'.'+_0x5af836,_0xb85e('0x2d'),_0xb85e('0x2e')];return squel[_0xb85e('0x31')]()['into'](_0xb85e('0x41'))[_0xb85e('0x34')]([_0xb85e('0x13'),_0xb85e('0x35'),_0xb85e('0x42'),_0x5af836,_0xb85e('0x43'),_0xb85e('0x36')],squel['select']()[_0xb85e('0x44')](_0x3070c2)[_0xb85e('0x3a')](_0xd59445)['join'](_0xb85e('0x45'),null,_0xb85e('0x3b')+_0xd59445+_0xb85e('0x46'))['join'](_0x235dd4,null,_0x235dd4+_0xb85e('0x14')+_0xd59445+'.'+_0x5af836)['where'](_0xd59445+_0xb85e('0x47'),_0x41dc2e)['where'](_0xb85e('0x3c'),NOW)[_0xb85e('0x15')](_0xb85e('0x3d'),squel[_0xb85e('0x11')]()[_0xb85e('0x12')](_0xb85e('0x13'))['from'](_0xb85e('0x41'))[_0xb85e('0x15')](_0xb85e('0x48'),_0x41dc2e)[_0xb85e('0x15')](_0x5af836+_0xb85e('0x49'),_0xd59445+'.'+_0x5af836)))['toString']();}function insertCmHopperAdditionalPhones(_0x312a10){var _0x1e3d76=['cm_hopper.id',_0xb85e('0x4a'),'cm_contact_has_items.OrderBy',_0xb85e('0x4b'),_0xb85e('0x4c')];return squel['insert']()[_0xb85e('0x32')](_0xb85e('0x4d'))[_0xb85e('0x34')](['CmHopperId',_0xb85e('0x13'),_0xb85e('0x4e'),'createdAt',_0xb85e('0x36')],squel[_0xb85e('0x11')]()[_0xb85e('0x44')](_0x1e3d76)[_0xb85e('0x3a')](_0xb85e('0x33'))[_0xb85e('0x18')](_0xb85e('0x45'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xb85e('0x18')](_0xb85e('0x4f'),null,_0xb85e('0x50'))[_0xb85e('0x15')]('cm_hopper.ListId\x20=\x20?',_0x312a10)[_0xb85e('0x15')](_0xb85e('0x3c'),NOW))[_0xb85e('0x51')]();}function insertCmContact(_0xfbdca0,_0x111202,_0x687a3c,_0x1aafff){var _0x228d3=_[_0xb85e('0x52')](_[_0xb85e('0x53')](_0x1aafff),[_0xb85e('0x42'),'CompanyId','createdAt','updatedAt']);return squel['insert']()[_0xb85e('0x32')](_0xb85e('0x45'))[_0xb85e('0x34')](_0x228d3,squel[_0xb85e('0x11')]()[_0xb85e('0x44')](_0x228d3)[_0xb85e('0x3a')](_0x111202)['where']('('+_0x687a3c[_0xb85e('0x18')](',')+_0xb85e('0x54'),squel[_0xb85e('0x11')]()[_0xb85e('0x44')](_0x687a3c)[_0xb85e('0x3a')](_0xb85e('0x45'))[_0xb85e('0x15')](_0xb85e('0x48'),_0xfbdca0))[_0xb85e('0x15')](_0xb85e('0x55'),squel['select']()[_0xb85e('0x12')]('MIN(id)',_0xb85e('0x56'))['from'](_0x111202)[_0xb85e('0x57')](_0x687a3c[_0xb85e('0x18')](','))))[_0xb85e('0x51')]();}function handleStop(){logger[_0xb85e('0x58')](_0xb85e('0x59'));stopped=!![];}function handleUncaughtException(_0x277b0d){logger['error'](_0x277b0d['message']);process[_0xb85e('0x5a')](0x1);}function handleError(_0x25ef74,_0x3e56e1){stats['errors'][_0xb85e('0x1f')]({'name':_0x3e56e1[_0xb85e('0x5b')],'message':_0x3e56e1['message'],'row':_0x25ef74});}function handleQuery(_0x25f722){logger[_0xb85e('0x58')](_0x25f722);return db[_0xb85e('0x19')][_0xb85e('0x1a')](_0x25f722)['spread'](function(_0x3fadfb){results[_0xb85e('0x1f')](_0x3fadfb);})[_0xb85e('0x21')](function(_0x1385b9){logger['error'](_0x1385b9[_0xb85e('0x23')]);});}function main(_0x365d2b,_0x82820,_0x10b20e,_0x5dfe6d){logger[_0xb85e('0x58')](_0xb85e('0x5c'),_0x365d2b,JSON[_0xb85e('0x5d')](_0x82820));process[_0xb85e('0x5e')](_0xb85e('0x5f'));var _0x26c39d=_0x82820['binding'];var _0x66670f=_[_0xb85e('0x60')](_0x26c39d);var _0x1cc241=_0x82820[_0xb85e('0x61')];var _0x1518e1=path['join'](config['root'],_0xb85e('0x62'),_0x1cc241+_0xb85e('0x63'));logger[_0xb85e('0x58')](_0xb85e('0x64'),_0x82820);db[_0xb85e('0x65')]['findAll']({'raw':!![],'attributes':['id','name']})[_0xb85e('0x20')](function(_0x2f524d){for(var _0x252e0f=0x0;_0x252e0f<_0x2f524d[_0xb85e('0x1c')];_0x252e0f++){if(_0x2f524d[_0x252e0f][_0xb85e('0x66')]in _0x26c39d){contactItemTypes[_0xb85e('0x1f')](_0x2f524d[_0x252e0f]);delete _0x66670f[_0x2f524d[_0x252e0f][_0xb85e('0x66')]];hasAdditionalPhones=!![];}for(var _0x5168c1 in _0x26c39d){if(_0x2f524d[_0x252e0f][_0xb85e('0x66')]+_0xb85e('0x67')===_0x5168c1){phoneDescriptions['push']({'itemTypeId':_0x2f524d[_0x252e0f]['id'],'description':_0x5168c1});delete _0x66670f[_0x5168c1];}}}if(hasAdditionalPhones)_0x66670f[_0xb85e('0x1e')]='';var _0x2bb04c=_['keys'](_0x66670f)[_0xb85e('0x18')]();logger[_0xb85e('0x58')](_0xb85e('0x68'),_0x2bb04c);fs['writeFileSync'](_0x1518e1,_0x2bb04c+'\x0a');Papa[_0xb85e('0x69')](fs[_0xb85e('0x6a')](_0x365d2b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e75db,_0x195a14){try{for(var _0x4bfd27=0x0,_0x102454=[];_0x4bfd27<_0x3e75db[_0xb85e('0x6b')][_0xb85e('0x1c')];_0x4bfd27++){stats[_0xb85e('0x6c')]+=0x1;if(_0x3e75db[_0xb85e('0x6d')][_0x4bfd27]){handleError(_0x3e75db[_0xb85e('0x6b')][_0x4bfd27],_0x3e75db['errors'][_0x4bfd27]);}else{var _0xb91dcf=[];var _0xf73f45=[];var _0x109a60={};for(var _0x10ddc4 in _0x26c39d){let _0x1fce2d=contactItemTypes['find'](_0x3d3554=>_0x3d3554['name']===_0x10ddc4);let _0x1ce225=contactItemTypes[_0xb85e('0x6e')](_0x41be22=>_0x41be22[_0xb85e('0x66')]+_0xb85e('0x67')===_0x10ddc4);if(_['isNil'](_0x1fce2d)&&_[_0xb85e('0x1d')](_0x1ce225)){if(_0x26c39d[_0xb85e('0x6f')](_0x10ddc4)){if(_0x3e75db['data'][_0x4bfd27][_0x26c39d[_0x10ddc4]]){var _0x2b3910=_['trim'](_0x3e75db[_0xb85e('0x6b')][_0x4bfd27][_0x26c39d[_0x10ddc4]][_0xb85e('0x70')](/"/g,'\x27'));switch(_0x10ddc4){case _0xb85e('0x71'):var _0x4c14a4=moment(_0x2b3910,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4c14a4[_0xb85e('0x72')]()){_0x102454[_0xb85e('0x1f')]('\x22'+_0x2b3910+'\x22');}else{_0xb91dcf['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xb85e('0x37'):var _0x39125f=parseInt(_0x2b3910);_0x2b3910=_[_0xb85e('0x73')](_0x39125f)||_0x39125f<0x0||_0x39125f>0x4?_0x5dfe6d?0x3:0x2:_0x39125f;_0x102454[_0xb85e('0x1f')]('\x22'+_0x2b3910+'\x22');break;case _0xb85e('0x38'):var _0x793207=parseInt(_0x2b3910);if(_[_0xb85e('0x74')](_0x793207)&&_[_0xb85e('0x75')](_0x10b20e,_0x793207)){_0x102454['push']('\x22'+_0x793207+'\x22');}else{_0xb91dcf[_0xb85e('0x1f')](_0xb85e('0x76'));}break;case _0xb85e('0x77'):if(isEmail(_0x2b3910)){_0x102454[_0xb85e('0x1f')]('\x22'+_0x2b3910+'\x22');}else{_0xb91dcf[_0xb85e('0x1f')](_0xb85e('0x78'));}break;case _0xb85e('0x79'):var _0x59fd94=moment(_0x2b3910,'YYYY-MM-DD',!![]);if(_0x59fd94[_0xb85e('0x72')]()){_0x102454[_0xb85e('0x1f')]('\x22'+_0x2b3910+'\x22');}else{_0xb91dcf['push'](_0xb85e('0x7a'));}break;default:_0x102454[_0xb85e('0x1f')]('\x22'+_0x2b3910+'\x22');}}else{switch(_0x10ddc4){case _0xb85e('0x7b'):case'phone':_0xb91dcf[_0xb85e('0x1f')](_0x10ddc4+_0xb85e('0x7c'));break;default:_0x102454[_0xb85e('0x1f')]('\x22\x22');}}}}else{var _0x240f1a='';if(!_[_0xb85e('0x1d')](_0x1fce2d)){if(!_0x109a60['hasOwnProperty'](_0x1fce2d['id'])){for(var _0x4ea438=0x0;_0x4ea438<_0x26c39d[_0x10ddc4][_0xb85e('0x1c')];_0x4ea438++){var _0x2b3910=_[_0xb85e('0x7d')](_0x3e75db[_0xb85e('0x6b')][_0x4bfd27][_0x26c39d[_0x10ddc4][_0x4ea438]]['replace'](/"/g,'\x27'));var _0x2b9df5=phoneDescriptions['find'](_0x5cc8be=>_0x5cc8be['itemTypeId']===_0x1fce2d['id']);if(!_[_0xb85e('0x1d')](_0x2b9df5)){var _0x4bc560=_[_0xb85e('0x7d')](_0x3e75db[_0xb85e('0x6b')][_0x4bfd27][_0x26c39d[_0x2b9df5[_0xb85e('0x7e')]][0x0]][_0xb85e('0x70')](/"/g,'\x27'));if(!_[_0xb85e('0x1d')](_0x4bc560))_0x2b3910=_0x2b3910+'§'+_0x4bc560;}if(_0x240f1a=='')_0x240f1a=_0x2b3910;else _0x240f1a+='|'+_0x2b3910;}_0xf73f45['push'](_0x1fce2d['id']+':'+_0x240f1a);_0x109a60[_0x1fce2d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x102454['push']('\x22'+_0xf73f45[_0xb85e('0x18')](';')+'\x22');}if(_0xb91dcf[_0xb85e('0x1c')]){handleError(_0x3e75db['data'][_0x4bfd27],{'code':'SystemRow','message':_0xb91dcf[_0xb85e('0x18')]()});}else{fs[_0xb85e('0x7f')](_0x1518e1,_0x102454[_0xb85e('0x18')]()+'\x0a');}_0x102454=[];}if(!(stats[_0xb85e('0x6c')]%0xc8)){socket['emit'](_0xb85e('0x80')+_0x1cc241,stats);stats[_0xb85e('0x6d')]=[];}}if(stopped){logger[_0xb85e('0x58')](_0xb85e('0x81'));_0x195a14[_0xb85e('0x82')]();}}catch(_0x346a5a){handleError(_0x3e75db['data'][_0x4bfd27],{'code':_0xb85e('0x83'),'message':_0x346a5a[_0xb85e('0x23')]});logger[_0xb85e('0x22')](_0xb85e('0x84'),_0x346a5a['message']);}},'complete':function(){try{var _0x29db78=[];var _0x28ffee=tempTableName;_0x29db78['push'](_0xb85e('0x85')+_0x28ffee+_0xb85e('0x86'));logger[_0xb85e('0x58')](_0xb85e('0x87'),contactItemTypes[_0xb85e('0x1c')]);var _0x5d646b=util[_0xb85e('0xf')](_0xb85e('0x88'),_0x1518e1,_0x28ffee,_0x2bb04c,_0x82820['ListId'],_0x82820[_0xb85e('0x89')]||null,NOW,NOW);if(_['isNil'](_0x26c39d[_0xb85e('0x71')])){_0x5d646b+=_0xb85e('0x8a');}_0x29db78['push'](_0x5d646b);BPromise[_0xb85e('0x8b')](_0x29db78,handleQuery)['then'](function(_0x1f506d){BPromise['all']([handleAdditionalPhones()])[_0xb85e('0x20')](function(){_0x29db78=[];for(var _0x54022e=0x0;_0x54022e\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.to','i.ContactId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','groupBy','Setting','all','clone','isEmpty','Sequelize','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','color','tools_tags','user_has_','_interactions','u.id','u.fullname','from','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','getInteractionFK','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','mail','isEmail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.from\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','text','value','start','end','unreadMessages','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','Tag','clause','tags','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','body','keys','some','compact','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','resolve','then','read','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','QueryTypes','sequelize','toString','keyBy'];(function(_0x4683d2,_0x5c26b2){var _0x552b38=function(_0x15952b){while(--_0x15952b){_0x4683d2['push'](_0x4683d2['shift']());}};_0x552b38(++_0x5c26b2);}(_0xa086,0xd2));var _0x6a08=function(_0x5ee5f2,_0x5b979b){_0x5ee5f2=_0x5ee5f2-0x0;var _0x523a24=_0xa086[_0x5ee5f2];return _0x523a24;};'use strict';var _=require(_0x6a08('0x0'));var squel=require(_0x6a08('0x1'));var as=require(_0x6a08('0x2'));var qs=require(_0x6a08('0x3'));var updateInteraction=require(_0x6a08('0x4'))['updateInteraction'];var utils=require(_0x6a08('0x5'));var db=require(_0x6a08('0x6'))['db'];function skipInteractionsQuery(_0x55b1e8,_0x29bbb7,_0x9d002b){var _0x4d9854=![];var _0x553ed1=utils[_0x6a08('0x7')](_0x55b1e8);if(_0x29bbb7[_0x6a08('0x8')]===_0x6a08('0x9')&&!_0x9d002b[_0x6a08('0xa')]&&!_0x9d002b[_0x553ed1]){_0x4d9854=!![];}return _0x4d9854;}function getTagsQuery(){return squel[_0x6a08('0xb')]()[_0x6a08('0xc')]('id')[_0x6a08('0xc')]('name')[_0x6a08('0xc')](_0x6a08('0xd'))['from'](_0x6a08('0xe'));}function getUsersQuery(_0x77ff6d,_0x104913){var _0x331607=utils['getInteractionFK'](_0x77ff6d);var _0x5715a2=_0x6a08('0xf')+_0x77ff6d+_0x6a08('0x10');var _0x386544=squel['select']()[_0x6a08('0xc')](_0x6a08('0x11'))[_0x6a08('0xc')](_0x6a08('0x12'))[_0x6a08('0xc')]('ui.'+_0x331607)[_0x6a08('0x13')](_0x5715a2,'ui')['left_join'](_0x6a08('0x14'),'u',_0x6a08('0x15'));if(_0x104913[_0x6a08('0x16')]>0x0){_0x386544[_0x6a08('0x17')](_0x6a08('0x18')+_0x331607+_0x6a08('0x19'),_[_0x6a08('0x1a')](_0x104913,'id'));}return _0x386544;}function getInteractionsQuery(_0x581606){var _0x3ad15b=utils[_0x6a08('0x1b')](_0x581606);var _0x3bdccf=utils[_0x6a08('0x7')](_0x581606);var _0x3a9a42=utils[_0x6a08('0x1c')](_0x581606);return squel['select']()[_0x6a08('0x13')](_0x3ad15b['interactions'],'i')[_0x6a08('0x1d')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6a08('0x1d')]('users','o',_0x6a08('0x1e'))[_0x6a08('0x1d')](_0x3ad15b['accounts'],'a',_0x6a08('0x1f')+_0x3bdccf)[_0x6a08('0x1d')](_0x3ad15b[_0x6a08('0x20')],'me','me.'+_0x3a9a42+'\x20=\x20i.id')[_0x6a08('0x1d')](_0x3ad15b[_0x6a08('0x21')],'it',_0x6a08('0x22')+_0x3a9a42+'\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x1db052={'body':squel[_0x6a08('0x23')](),'contact':squel['expr'](),'default':squel[_0x6a08('0x23')](),'fields':squel[_0x6a08('0x23')](),'filter':squel[_0x6a08('0x23')](),'read':squel[_0x6a08('0x23')](),'tags':{'clause':squel[_0x6a08('0x23')](),'ids':null},'user':squel['expr']()};return _0x1db052;}function parseTagParameter(_0x366d30){var _0x2a099e=squel[_0x6a08('0x23')]();if(_0x366d30){var _0x55874b=utils[_0x6a08('0x24')](_0x366d30);_0x55874b[_0x6a08('0x25')](function(_0x2d0526){_0x2a099e['or'](_0x6a08('0x26'),'%,'+_0x2d0526+',%');});}return _0x2a099e;}function parseReadParameter(_0x380b9d){var _0x7de2cc='';if(_0x380b9d){_0x7de2cc=_0x6a08('0x27');if(_0x380b9d==='1'){_0x7de2cc=_0x7de2cc['replace'](_0x6a08('0x28'),'=');}else{_0x7de2cc=_0x7de2cc[_0x6a08('0x29')]('{OPERATOR}','>');}}return _0x7de2cc;}function parseSearchFilter(_0x19c3c1,_0x2fc159){var _0x1066a0=squel[_0x6a08('0x23')]();if(_0x2fc159){var _0x2e4e7a=_0x2fc159[_0x6a08('0x29')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x6a08('0x2a')](_0x2e4e7a)){_0x1066a0['or'](_0x6a08('0x2b'),_0x2e4e7a+'%');if([_0x6a08('0x2c'),_0x6a08('0x2d')][_0x6a08('0x2e')](_0x19c3c1)){_0x1066a0['or'](_0x6a08('0x2f'),_0x2e4e7a+'%');}else if(_0x19c3c1===_0x6a08('0x30')){_0x1066a0['or'](_0x6a08('0x31'),_0x2e4e7a+'%');}}else if(_0x19c3c1===_0x6a08('0x32')&&qs[_0x6a08('0x33')](_0x2e4e7a)){_0x1066a0['or']('c.email\x20LIKE\x20?',_0x2e4e7a+'%');}else{if(_0x19c3c1==='mail'){_0x1066a0['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6a08('0x34')](_0x2e4e7a))['or'](_0x6a08('0x35'),qs[_0x6a08('0x34')](_0x2e4e7a));}else{if(_0x19c3c1!==_0x6a08('0x30')){_0x1066a0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6a08('0x34')](_0x2e4e7a));}_0x1066a0['or'](_0x6a08('0x36'),_0x2e4e7a+'%');if(_0x19c3c1==='openchannel'){_0x1066a0['or'](_0x6a08('0x37'),_0x2e4e7a+'%');}}}}return _0x1066a0;}function parseAdvancedSearchFilter(_0xb95193,_0x47c9dd){var _0x46ac15=getSqlClauses();var _0x349adc=as[_0x6a08('0x38')](_0xb95193);var _0x70b59c=_0x349adc[_0x6a08('0x39')];for(var _0x23d2d2=0x0;_0x23d2d2<_0x349adc[_0x6a08('0x3a')][_0x6a08('0x16')];_0x23d2d2++){var _0x5974d8=_0x349adc['conditions'][_0x23d2d2];var _0x2d9cf7='i';var _0x5646e3=_[_0x6a08('0x3b')](_0x47c9dd,[_0x6a08('0x3c'),_0x5974d8['field']]);if(_0x5646e3){var _0x21d8e4=as['buildExpression'](_0x2d9cf7,_0x5646e3['type'],_0x5974d8);_0x46ac15['default'][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x3f')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x40')]);}else{switch(_0x5974d8[_0x6a08('0xc')]){case _0x6a08('0x41'):var _0x200655=parseReadParameter(_0x5974d8['value']);_0x46ac15['read'][_0x6a08('0x42')](_0x200655);break;case _0x6a08('0x43'):if(_0x5974d8[_0x6a08('0x44')]===_0x6a08('0x45')){if(_0x5974d8[_0x6a08('0x3e')][_0x6a08('0x46')]('\x20')[_0x6a08('0x16')]>0x1){_0x46ac15[_0x6a08('0x47')][_0x70b59c](_0x6a08('0x48'),qs[_0x6a08('0x34')](_0x5974d8[_0x6a08('0x3e')]),null);}else{var _0x598d74='%'+_0x5974d8[_0x6a08('0x3e')]+'%';_0x46ac15[_0x6a08('0x47')][_0x70b59c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x598d74,_0x598d74,_0x598d74);}}else{_0x5646e3=_[_0x6a08('0x3b')](_0x47c9dd,[_0x6a08('0x3c'),_0x6a08('0x49')]);_0x5974d8[_0x6a08('0xc')]=_0x6a08('0x49');_0x21d8e4=as[_0x6a08('0x4a')](_0x2d9cf7,_0x5646e3[_0x6a08('0x4b')],_0x5974d8);_0x46ac15[_0x6a08('0x47')][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x3f')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x40')]);}break;case _0x6a08('0x4c'):var _0x49d12c=_0x5974d8[_0x6a08('0x3e')][_0x6a08('0x46')](',')[_0x6a08('0x1a')](function(_0x51a834){return Number(_0x51a834);});var _0x417f2b=parseTagParameter(_0x49d12c);_0x46ac15['tags'][_0x6a08('0x4d')]['and'](_0x417f2b);_0x46ac15[_0x6a08('0x4e')]['ids']=_0x49d12c;break;case _0x6a08('0x4f'):if(_0x5974d8[_0x6a08('0x44')]==='$substring'){_0x46ac15[_0x6a08('0x50')][_0x70b59c](_0x6a08('0x51'),'%'+_0x5974d8['value']+'%',null);}else{_0x5646e3=_[_0x6a08('0x3b')](_0x47c9dd,[_0x6a08('0x3c'),_0x6a08('0x52')]);_0x5974d8[_0x6a08('0xc')]=_0x6a08('0x52');_0x21d8e4=as['buildExpression'](_0x2d9cf7,_0x5646e3[_0x6a08('0x4b')],_0x5974d8);_0x46ac15[_0x6a08('0x50')][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')]['start'],_0x21d8e4['value'][_0x6a08('0x40')]);}break;case'body':case _0x6a08('0x53'):_0x21d8e4=as[_0x6a08('0x4a')]('me',null,_0x5974d8);_0x46ac15[_0x6a08('0x54')][_0x70b59c](_0x21d8e4[_0x6a08('0x3d')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x3f')],_0x21d8e4[_0x6a08('0x3e')][_0x6a08('0x40')]);break;}}}return _0x46ac15;}function parseModelFields(_0x428262,_0x9f13f4,_0x1872eb){var _0x515e58=utils['getAccountFK'](_0x428262);var _0x5ac0ac=squel[_0x6a08('0x23')]();var _0x22ea51=_(_0x9f13f4)[_0x6a08('0x55')]()['map'](function(_0xde423){return _[_0x6a08('0x56')](_0x1872eb,[_0x6a08('0x3c'),_0xde423])?_0xde423:undefined;})[_0x6a08('0x57')]()['value']();if(_0x22ea51['length']>0x0){_0x22ea51[_0x6a08('0x25')](function(_0x195d78){if(_0x195d78===_0x515e58){_0x5ac0ac[_0x6a08('0x42')]('i.'+_0x515e58+_0x6a08('0x19'),[][_0x6a08('0x58')](_0x9f13f4[_0x195d78]));}else if(_0x195d78===_0x6a08('0x59')){var _0x1a72fe=JSON['parse'](_0x9f13f4[_0x195d78])[_0x6a08('0x5a')];var _0x1b6bfe=JSON[_0x6a08('0x5b')](_0x9f13f4[_0x195d78])[_0x6a08('0x5c')];_0x5ac0ac[_0x6a08('0x42')](_0x6a08('0x5d'),_0x1a72fe,_0x1b6bfe);}else{if(_0x9f13f4[_0x195d78]===_0x6a08('0x5e')){_0x5ac0ac[_0x6a08('0x42')]('i.'+_0x195d78+'\x20IS\x20NULL');}else{_0x5ac0ac[_0x6a08('0x42')]('i.'+_0x195d78+_0x6a08('0x5f'),_0x9f13f4[_0x195d78]);}}});}return _0x5ac0ac;}function parseQueryParameters(_0x33acfb,_0x717283,_0x2d27f4){var _0x313903=getSqlClauses();return Promise[_0x6a08('0x60')]()['then'](function(){return parseModelFields(_0x33acfb,_0x717283,_0x2d27f4);})[_0x6a08('0x61')](function(_0x27f3f1){_0x313903['fields']['and'](_0x27f3f1);return parseReadParameter(_0x717283[_0x6a08('0x62')]);})[_0x6a08('0x61')](function(_0x5c2058){_0x313903[_0x6a08('0x62')]['and'](_0x5c2058);return parseTagParameter(_0x717283[_0x6a08('0x63')]);})['then'](function(_0x2629ec){_0x313903['tags'][_0x6a08('0x4d')]['and'](_0x2629ec);return parseSearchFilter(_0x33acfb,_0x717283[_0x6a08('0x64')]);})['then'](function(_0x5d0c76){_0x313903[_0x6a08('0x64')]=_0x5d0c76;return _0x313903;});}function checkAccountsRestrictions(_0x2e9f05,_0x51c531,_0x4c304b){var _0x570754=utils[_0x6a08('0x7')](_0x2e9f05);var _0x4a13a1=_0x6a08('0x65')+_[_0x6a08('0x66')](_0x2e9f05)+(_0x2e9f05===_0x6a08('0x67')?_0x6a08('0x68'):_0x6a08('0x69'));var _0x197f45=squel['expr']();return Promise[_0x6a08('0x60')]()['then'](function(){if(_0x4c304b[_0x6a08('0xa')]&&_0x51c531[_0x6a08('0x8')]==='agent'){return _0x51c531[_0x4a13a1]({'attributes':['id'],'raw':!![]});}})[_0x6a08('0x61')](function(_0x31b60f){if(_0x31b60f){if(_0x31b60f[_0x6a08('0x16')]===0x0){_0x197f45[_0x6a08('0x42')]('i.'+_0x570754+_0x6a08('0x6a'));}else{_0x197f45['and']('i.'+_0x570754+_0x6a08('0x19'),_[_0x6a08('0x1a')](_0x31b60f,'id'));}}else if(!_0x4c304b[_0x570754]){_0x197f45[_0x6a08('0x42')]('i.'+_0x570754+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x197f45;});}function getClosedOrderClause(_0x12b81d,_0x197a3f){var _0x2a4e95='';var _0x50d711=[_0x6a08('0x6b'),_0x6a08('0x6c'),_0x6a08('0x6d')];if(_0x12b81d==='mail'){_0x50d711[_0x6a08('0x6e')](_0x6a08('0x6f'));}if(_0x197a3f['closed']==='0'&&_0x12b81d===_0x6a08('0x32')){_0x2a4e95=_0x6a08('0x6f');}else{if(_0x197a3f[_0x6a08('0x70')]==='1'){_0x50d711['shift']();}_0x2a4e95=_0x6a08('0x71')+_0x50d711[_0x6a08('0x72')](',\x20')+')';}return _0x2a4e95;}function getFilteredInteractions(_0x5124be,_0x277986,_0x149c80,_0x10dc86){var _0x38c0d7=utils[_0x6a08('0x1c')](_0x5124be);var _0x150447=_[_0x6a08('0x66')](_0x5124be)+_0x6a08('0x73');var _0x5505d4=[];var _0x4f6dad=getTagsQuery();var _0x31b557={'type':db['Sequelize'][_0x6a08('0x74')]['SELECT'],'raw':!![]};var _0x4d3f79=[];var _0x3578d2=[];return db[_0x6a08('0x75')]['query'](_0x4f6dad[_0x6a08('0x76')](),_0x31b557)[_0x6a08('0x61')](function(_0x2567d0){_0x5505d4=_[_0x6a08('0x77')](_0x2567d0,'id');_0x31b557=_[_0x6a08('0x78')](_0x31b557,{'model':db[_0x150447],'mapToModel':!![],'nest':!![]});if(_0x149c80['fields']){_0x10dc86['attributes'][_0x6a08('0x25')](function(_0x5a2160){_0x277986[_0x6a08('0xc')]('i.'+_0x5a2160);});}else{_0x277986[_0x6a08('0xc')](_0x6a08('0x79'),_0x6a08('0x41'));_0x277986[_0x6a08('0xc')](_0x6a08('0x7a'),'Account.key');_0x277986['field'](_0x6a08('0x7b'),_0x6a08('0x7c'));if(_0x5124be===_0x6a08('0x32')){_0x277986['field'](_0x6a08('0x7d'),_0x6a08('0x7e'));_0x277986[_0x6a08('0xc')](_0x6a08('0x7f'),_0x6a08('0x80'));_0x277986[_0x6a08('0xc')]('i.id');_0x277986[_0x6a08('0xc')](_0x6a08('0x81'));_0x277986['field'](_0x6a08('0x82'));_0x277986[_0x6a08('0xc')](_0x6a08('0x83'));_0x277986['field'](_0x6a08('0x84'));_0x277986[_0x6a08('0xc')]('i.attach');_0x277986[_0x6a08('0xc')]('i.lastMsgAt');_0x277986['field'](_0x6a08('0x85'));_0x277986['field']('i.subject');_0x277986[_0x6a08('0xc')](_0x6a08('0x6d'));_0x277986['field'](_0x6a08('0x6c'));_0x277986[_0x6a08('0xc')](_0x6a08('0x6b'));_0x277986['field'](_0x6a08('0x6f'));_0x277986[_0x6a08('0xc')](_0x6a08('0x86'));_0x277986[_0x6a08('0xc')](_0x6a08('0x87'));_0x277986['field']('i.MailAccountId');_0x277986['field']('i.UserId');}else if(_0x5124be==='openchannel'){_0x277986[_0x6a08('0xc')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x277986[_0x6a08('0xc')](_0x6a08('0x88'),_0x6a08('0x80'));}if(_0x5124be!==_0x6a08('0x32')){_0x277986[_0x6a08('0xc')](_0x6a08('0x89'));}_0x277986[_0x6a08('0xc')](_0x6a08('0x8a'),_0x6a08('0x8b'));_0x277986[_0x6a08('0xc')](_0x6a08('0x8c'),_0x6a08('0x8d'));_0x277986['field']('c.email',_0x6a08('0x8e'));_0x277986[_0x6a08('0xc')](_0x6a08('0x8f'),_0x6a08('0x90'));_0x277986['field'](_0x6a08('0x91'),_0x6a08('0x92'));_0x277986['field'](_0x6a08('0x93'),_0x6a08('0x94'));_0x277986[_0x6a08('0xc')](_0x6a08('0x95'),_0x6a08('0x96'));_0x277986[_0x6a08('0xc')](_0x6a08('0x97'),_0x6a08('0x98'));_0x277986[_0x6a08('0xc')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6a08('0x99'));}if(_0x10dc86[_0x6a08('0x9a')]){_0x277986[_0x6a08('0x9a')](_0x10dc86[_0x6a08('0x9a')]);}if(_0x10dc86['offset']){_0x277986[_0x6a08('0x9b')](_0x10dc86[_0x6a08('0x9b')]);}return db[_0x6a08('0x75')][_0x6a08('0x9c')](_0x277986['toString'](),_0x31b557);})[_0x6a08('0x61')](function(_0x4423e3){_0x4d3f79=_0x4423e3;var _0x2caa09=getUsersQuery(_0x5124be,_0x4d3f79);return db['sequelize'][_0x6a08('0x9c')](_0x2caa09[_0x6a08('0x76')](),_0x31b557);})[_0x6a08('0x61')](function(_0x15d0af){_0x3578d2=_[_0x6a08('0x9d')](_0x15d0af,_0x38c0d7);if(_0x5124be===_0x6a08('0x32')){return db[_0x6a08('0x9e')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x140b1c){var _0x4ed8fa=_0x140b1c?_0x140b1c['enableEmailPreview']:undefined;var _0x14065a=_0x4d3f79['map'](function(_0x2fd73e){return updateInteraction(_0x2fd73e,_0x5505d4,_0x3578d2,_0x4ed8fa);});return Promise[_0x6a08('0x9f')](_0x14065a);});}function countFilteredInteractions(_0x414d7e,_0x59a95d){var _0x1a6a7d=_0x414d7e[_0x6a08('0xa0')]();_0x1a6a7d[_0x6a08('0xc')]('COUNT(*)');_0x1a6a7d[_0x6a08('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6a08('0x41'));var _0x4d6177=utils[_0x6a08('0x24')](_0x59a95d);if(!_[_0x6a08('0xa1')](_0x4d6177)){_0x1a6a7d['where']('t.id\x20IN\x20?',_0x4d6177);}var _0x27d3c8={'type':db[_0x6a08('0xa2')]['QueryTypes'][_0x6a08('0xa3')],'raw':!![]};return db[_0x6a08('0x75')][_0x6a08('0x9c')](_0x1a6a7d[_0x6a08('0x76')](),_0x27d3c8);}module[_0x6a08('0xa4')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xdb5e=['search','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','map','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','mail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','text','start','value','and','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','clause','user','UserId','end','body','keys','\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','resolve','then','fields','read','tag','tags','filter','get','capitalize','Websites','Accounts','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','QueryTypes','SELECT','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','openchannel','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','query','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','t.id\x20IN\x20?','lodash','squel','../parsers/qs','./update-interaction','../../mysqldb','getAccountFK','role'];(function(_0x1a2127,_0x11047f){var _0x507b09=function(_0x332160){while(--_0x332160){_0x1a2127['push'](_0x1a2127['shift']());}};_0x507b09(++_0x11047f);}(_0xdb5e,0x1d3));var _0xedb5=function(_0x181b7d,_0x391a13){_0x181b7d=_0x181b7d-0x0;var _0x170727=_0xdb5e[_0x181b7d];return _0x170727;};'use strict';var _=require(_0xedb5('0x0'));var squel=require(_0xedb5('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xedb5('0x2'));var updateInteraction=require(_0xedb5('0x3'))['updateInteraction'];var utils=require('./utils');var db=require(_0xedb5('0x4'))['db'];function skipInteractionsQuery(_0x88494f,_0x5719af,_0x420434){var _0x3ae5ec=![];var _0x1a42fb=utils[_0xedb5('0x5')](_0x88494f);if(_0x5719af[_0xedb5('0x6')]==='agent'&&!_0x420434[_0xedb5('0x7')]&&!_0x420434[_0x1a42fb]){_0x3ae5ec=!![];}return _0x3ae5ec;}function getTagsQuery(){return squel[_0xedb5('0x8')]()[_0xedb5('0x9')]('id')[_0xedb5('0x9')](_0xedb5('0xa'))[_0xedb5('0x9')](_0xedb5('0xb'))['from'](_0xedb5('0xc'));}function getUsersQuery(_0x44f491,_0x5b1b95){var _0x5279ae=utils[_0xedb5('0xd')](_0x44f491);var _0x1f1886=_0xedb5('0xe')+_0x44f491+_0xedb5('0xf');var _0x428906=squel['select']()[_0xedb5('0x9')](_0xedb5('0x10'))[_0xedb5('0x9')](_0xedb5('0x11'))['field']('ui.'+_0x5279ae)['from'](_0x1f1886,'ui')[_0xedb5('0x12')](_0xedb5('0x13'),'u',_0xedb5('0x14'));if(_0x5b1b95[_0xedb5('0x15')]>0x0){_0x428906[_0xedb5('0x16')](_0xedb5('0x17')+_0x5279ae+'\x20IN\x20?',_[_0xedb5('0x18')](_0x5b1b95,'id'));}return _0x428906;}function getInteractionsQuery(_0x4354c9){var _0x1bd3b2=utils['getInteractionsTables'](_0x4354c9);var _0x1b3d50=utils[_0xedb5('0x5')](_0x4354c9);var _0x546074=utils[_0xedb5('0xd')](_0x4354c9);return squel['select']()[_0xedb5('0x19')](_0x1bd3b2['interactions'],'i')[_0xedb5('0x12')](_0xedb5('0x1a'),'c',_0xedb5('0x1b'))[_0xedb5('0x12')](_0xedb5('0x13'),'o',_0xedb5('0x1c'))['left_join'](_0x1bd3b2[_0xedb5('0x1d')],'a',_0xedb5('0x1e')+_0x1b3d50)[_0xedb5('0x12')](_0x1bd3b2[_0xedb5('0x1f')],'me',_0xedb5('0x20')+_0x546074+_0xedb5('0x21'))['left_join'](_0x1bd3b2[_0xedb5('0x22')],'it','it.'+_0x546074+_0xedb5('0x21'))[_0xedb5('0x12')](_0xedb5('0xc'),'t',_0xedb5('0x23'));}function getSqlClauses(){var _0x48df57={'body':squel[_0xedb5('0x24')](),'contact':squel[_0xedb5('0x24')](),'default':squel[_0xedb5('0x24')](),'fields':squel[_0xedb5('0x24')](),'filter':squel['expr'](),'read':squel[_0xedb5('0x24')](),'tags':{'clause':squel[_0xedb5('0x24')](),'ids':null},'user':squel[_0xedb5('0x24')]()};return _0x48df57;}function parseTagParameter(_0x3ef193){var _0x36be1=squel['expr']();if(_0x3ef193){var _0x113f8a=utils[_0xedb5('0x25')](_0x3ef193);_0x113f8a[_0xedb5('0x26')](function(_0x2acfc0){_0x36be1['or'](_0xedb5('0x27'),'%,'+_0x2acfc0+',%');});}return _0x36be1;}function parseReadParameter(_0x41f4fb){var _0x15bee5='';if(_0x41f4fb){_0x15bee5='unreadMessages\x20{OPERATOR}\x200';if(_0x41f4fb==='1'){_0x15bee5=_0x15bee5[_0xedb5('0x28')](_0xedb5('0x29'),'=');}else{_0x15bee5=_0x15bee5[_0xedb5('0x28')]('{OPERATOR}','>');}}return _0x15bee5;}function parseSearchFilter(_0x155035,_0x587f38){var _0x25632f=squel[_0xedb5('0x24')]();if(_0x587f38){var _0x2dab10=_0x587f38['replace']('\x5c','\x5c\x5c')[_0xedb5('0x28')](/'/g,'\x27\x27');if(qs[_0xedb5('0x2a')](_0x2dab10)){_0x25632f['or'](_0xedb5('0x2b'),_0x2dab10+'%');if([_0xedb5('0x2c'),_0xedb5('0x2d')][_0xedb5('0x2e')](_0x155035)){_0x25632f['or'](_0xedb5('0x2f'),_0x2dab10+'%');}else if(_0x155035==='fax'){_0x25632f['or'](_0xedb5('0x30'),_0x2dab10+'%');}}else if(_0x155035===_0xedb5('0x31')&&qs['isEmail'](_0x2dab10)){_0x25632f['or']('c.email\x20LIKE\x20?',_0x2dab10+'%');}else{if(_0x155035===_0xedb5('0x31')){_0x25632f['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2dab10))['or'](_0xedb5('0x32'),qs[_0xedb5('0x33')](_0x2dab10));}else{if(_0x155035!==_0xedb5('0x34')){_0x25632f['or'](_0xedb5('0x35'),qs[_0xedb5('0x33')](_0x2dab10));}_0x25632f['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2dab10+'%');if(_0x155035==='openchannel'){_0x25632f['or'](_0xedb5('0x36'),_0x2dab10+'%');}}}}return _0x25632f;}function parseAdvancedSearchFilter(_0x22b793,_0x263856){var _0x357a56=getSqlClauses();var _0x47c1a3=as[_0xedb5('0x37')](_0x22b793);var _0x109cf4=_0x47c1a3[_0xedb5('0x38')];for(var _0x46fda6=0x0;_0x46fda6<_0x47c1a3[_0xedb5('0x39')]['length'];_0x46fda6++){var _0x2ba6d7=_0x47c1a3[_0xedb5('0x39')][_0x46fda6];var _0x4a2ee2='i';var _0x2ee6de=_[_0xedb5('0x3a')](_0x263856,[_0xedb5('0xa'),_0x2ba6d7[_0xedb5('0x9')]]);if(_0x2ee6de){var _0x4b3f26=as['buildExpression'](_0x4a2ee2,_0x2ee6de['type'],_0x2ba6d7);_0x357a56['default'][_0x109cf4](_0x4b3f26[_0xedb5('0x3b')],_0x4b3f26['value'][_0xedb5('0x3c')],_0x4b3f26['value']['end']);}else{switch(_0x2ba6d7['field']){case'unreadMessages':var _0x4d31ae=parseReadParameter(_0x2ba6d7[_0xedb5('0x3d')]);_0x357a56['read'][_0xedb5('0x3e')](_0x4d31ae);break;case'Contact':if(_0x2ba6d7[_0xedb5('0x3f')]===_0xedb5('0x40')){if(_0x2ba6d7[_0xedb5('0x3d')][_0xedb5('0x41')]('\x20')[_0xedb5('0x15')]>0x1){_0x357a56['contact'][_0x109cf4](_0xedb5('0x42'),qs[_0xedb5('0x33')](_0x2ba6d7[_0xedb5('0x3d')]),null);}else{var _0x2d1d46='%'+_0x2ba6d7[_0xedb5('0x3d')]+'%';_0x357a56['contact'][_0x109cf4](_0xedb5('0x43'),_0x2d1d46,_0x2d1d46,_0x2d1d46);}}else{_0x2ee6de=_[_0xedb5('0x3a')](_0x263856,[_0xedb5('0xa'),'ContactId']);_0x2ba6d7[_0xedb5('0x9')]=_0xedb5('0x44');_0x4b3f26=as[_0xedb5('0x45')](_0x4a2ee2,_0x2ee6de[_0xedb5('0x46')],_0x2ba6d7);_0x357a56['contact'][_0x109cf4](_0x4b3f26[_0xedb5('0x3b')],_0x4b3f26['value'][_0xedb5('0x3c')],_0x4b3f26[_0xedb5('0x3d')]['end']);}break;case'Tag':var _0x4358f4=_0x2ba6d7[_0xedb5('0x3d')][_0xedb5('0x41')](',')[_0xedb5('0x18')](function(_0x8b391b){return Number(_0x8b391b);});var _0x18b996=parseTagParameter(_0x4358f4);_0x357a56['tags'][_0xedb5('0x47')][_0xedb5('0x3e')](_0x18b996);_0x357a56['tags']['ids']=_0x4358f4;break;case'User':if(_0x2ba6d7['operator']===_0xedb5('0x40')){_0x357a56[_0xedb5('0x48')][_0x109cf4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2ba6d7[_0xedb5('0x3d')]+'%',null);}else{_0x2ee6de=_['find'](_0x263856,[_0xedb5('0xa'),_0xedb5('0x49')]);_0x2ba6d7['field']='UserId';_0x4b3f26=as[_0xedb5('0x45')](_0x4a2ee2,_0x2ee6de[_0xedb5('0x46')],_0x2ba6d7);_0x357a56[_0xedb5('0x48')][_0x109cf4](_0x4b3f26[_0xedb5('0x3b')],_0x4b3f26['value'][_0xedb5('0x3c')],_0x4b3f26[_0xedb5('0x3d')][_0xedb5('0x4a')]);}break;case _0xedb5('0x4b'):case'plainBody':_0x4b3f26=as[_0xedb5('0x45')]('me',null,_0x2ba6d7);_0x357a56[_0xedb5('0x4b')][_0x109cf4](_0x4b3f26['text'],_0x4b3f26[_0xedb5('0x3d')][_0xedb5('0x3c')],_0x4b3f26[_0xedb5('0x3d')][_0xedb5('0x4a')]);break;}}}return _0x357a56;}function parseModelFields(_0x54ddc0,_0x5f3795,_0x1ac4b7){var _0x343f42=utils['getAccountFK'](_0x54ddc0);var _0x3406d5=squel['expr']();var _0x40ca8b=_(_0x5f3795)[_0xedb5('0x4c')]()['map'](function(_0x57a9c0){return _['some'](_0x1ac4b7,['name',_0x57a9c0])?_0x57a9c0:undefined;})['compact']()[_0xedb5('0x3d')]();if(_0x40ca8b[_0xedb5('0x15')]>0x0){_0x40ca8b[_0xedb5('0x26')](function(_0x3c64e4){if(_0x3c64e4===_0x343f42){_0x3406d5[_0xedb5('0x3e')]('i.'+_0x343f42+_0xedb5('0x4d'),[]['concat'](_0x5f3795[_0x3c64e4]));}else if(_0x3c64e4==='createdAt'){var _0xff87=JSON[_0xedb5('0x4e')](_0x5f3795[_0x3c64e4])[_0xedb5('0x4f')];var _0x22b4a3=JSON[_0xedb5('0x4e')](_0x5f3795[_0x3c64e4])[_0xedb5('0x50')];_0x3406d5[_0xedb5('0x3e')](_0xedb5('0x51'),_0xff87,_0x22b4a3);}else{if(_0x5f3795[_0x3c64e4]===_0xedb5('0x52')){_0x3406d5[_0xedb5('0x3e')]('i.'+_0x3c64e4+'\x20IS\x20NULL');}else{_0x3406d5[_0xedb5('0x3e')]('i.'+_0x3c64e4+'\x20=\x20?',_0x5f3795[_0x3c64e4]);}}});}return _0x3406d5;}function parseQueryParameters(_0x186a9e,_0xace394,_0x3dd6e2){var _0x2759cd=getSqlClauses();return Promise[_0xedb5('0x53')]()[_0xedb5('0x54')](function(){return parseModelFields(_0x186a9e,_0xace394,_0x3dd6e2);})['then'](function(_0x49aacb){_0x2759cd[_0xedb5('0x55')][_0xedb5('0x3e')](_0x49aacb);return parseReadParameter(_0xace394['read']);})[_0xedb5('0x54')](function(_0x3769a0){_0x2759cd[_0xedb5('0x56')][_0xedb5('0x3e')](_0x3769a0);return parseTagParameter(_0xace394[_0xedb5('0x57')]);})[_0xedb5('0x54')](function(_0x3304cc){_0x2759cd[_0xedb5('0x58')][_0xedb5('0x47')][_0xedb5('0x3e')](_0x3304cc);return parseSearchFilter(_0x186a9e,_0xace394['filter']);})[_0xedb5('0x54')](function(_0x25f34b){_0x2759cd[_0xedb5('0x59')]=_0x25f34b;return _0x2759cd;});}function checkAccountsRestrictions(_0x554eed,_0x298310,_0x38806e){var _0x5527f0=utils[_0xedb5('0x5')](_0x554eed);var _0xac2d62=_0xedb5('0x5a')+_[_0xedb5('0x5b')](_0x554eed)+(_0x554eed==='chat'?_0xedb5('0x5c'):_0xedb5('0x5d'));var _0x237c5f=squel[_0xedb5('0x24')]();return Promise[_0xedb5('0x53')]()[_0xedb5('0x54')](function(){if(_0x38806e[_0xedb5('0x7')]&&_0x298310[_0xedb5('0x6')]==='agent'){return _0x298310[_0xac2d62]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x116169){if(_0x116169){if(_0x116169[_0xedb5('0x15')]===0x0){_0x237c5f[_0xedb5('0x3e')]('i.'+_0x5527f0+_0xedb5('0x5e'));}else{_0x237c5f['and']('i.'+_0x5527f0+_0xedb5('0x4d'),_[_0xedb5('0x18')](_0x116169,'id'));}}else if(!_0x38806e[_0x5527f0]){_0x237c5f[_0xedb5('0x3e')]('i.'+_0x5527f0+_0xedb5('0x5f'));}})[_0xedb5('0x54')](function(){return _0x237c5f;});}function getClosedOrderClause(_0x3ea543,_0x5e4ca6){var _0x21ebeb='';var _0x2b4754=[_0xedb5('0x60'),_0xedb5('0x61'),_0xedb5('0x62')];if(_0x3ea543===_0xedb5('0x31')){_0x2b4754[_0xedb5('0x63')](_0xedb5('0x64'));}if(_0x5e4ca6[_0xedb5('0x65')]==='0'&&_0x3ea543===_0xedb5('0x31')){_0x21ebeb=_0xedb5('0x64');}else{if(_0x5e4ca6[_0xedb5('0x65')]==='1'){_0x2b4754[_0xedb5('0x66')]();}_0x21ebeb=_0xedb5('0x67')+_0x2b4754[_0xedb5('0x68')](',\x20')+')';}return _0x21ebeb;}function getFilteredInteractions(_0x50af35,_0x433eb8,_0x139838,_0x3bb8df){var _0x34b73d=utils[_0xedb5('0xd')](_0x50af35);var _0x4715ab=_['capitalize'](_0x50af35)+'Interaction';var _0x3e7669=[];var _0x256c2f=getTagsQuery();var _0x59566b={'type':db['Sequelize'][_0xedb5('0x69')][_0xedb5('0x6a')],'raw':!![]};var _0x1a6656=[];var _0x5ef89c=[];return db[_0xedb5('0x6b')]['query'](_0x256c2f[_0xedb5('0x6c')](),_0x59566b)[_0xedb5('0x54')](function(_0x3157f2){_0x3e7669=_[_0xedb5('0x6d')](_0x3157f2,'id');_0x59566b=_['merge'](_0x59566b,{'model':db[_0x4715ab],'mapToModel':!![],'nest':!![]});if(_0x139838[_0xedb5('0x55')]){_0x3bb8df['attributes']['forEach'](function(_0x3d4968){_0x433eb8[_0xedb5('0x9')]('i.'+_0x3d4968);});}else{_0x433eb8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x433eb8[_0xedb5('0x9')](_0xedb5('0x6e'),_0xedb5('0x6f'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x70'),_0xedb5('0x71'));if(_0x50af35===_0xedb5('0x31')){_0x433eb8[_0xedb5('0x9')]('a.email',_0xedb5('0x72'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x73'),_0xedb5('0x74'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x75'));_0x433eb8[_0xedb5('0x9')]('i.createdAt');_0x433eb8['field']('i.updatedAt');_0x433eb8[_0xedb5('0x9')]('i.closed');_0x433eb8['field'](_0xedb5('0x76'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x77'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x78'));_0x433eb8[_0xedb5('0x9')]('i.lastMsgDirection');_0x433eb8[_0xedb5('0x9')](_0xedb5('0x79'));_0x433eb8[_0xedb5('0x9')]('i.disposition');_0x433eb8['field'](_0xedb5('0x61'));_0x433eb8[_0xedb5('0x9')]('i.thirdDisposition');_0x433eb8[_0xedb5('0x9')](_0xedb5('0x64'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x7a'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x7b'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x7c'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x7d'));}else if(_0x50af35===_0xedb5('0x7e')){_0x433eb8[_0xedb5('0x9')](_0xedb5('0x7f'),_0xedb5('0x74'));}else{_0x433eb8['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',_0xedb5('0x74'));}if(_0x50af35!==_0xedb5('0x31')){_0x433eb8['field']('i.*');}_0x433eb8[_0xedb5('0x9')](_0xedb5('0x80'),_0xedb5('0x81'));_0x433eb8['field'](_0xedb5('0x82'),_0xedb5('0x83'));_0x433eb8['field'](_0xedb5('0x84'),_0xedb5('0x85'));_0x433eb8['field'](_0xedb5('0x86'),_0xedb5('0x87'));_0x433eb8[_0xedb5('0x9')]('c.mobile',_0xedb5('0x88'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x89'),_0xedb5('0x8a'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x8b'),_0xedb5('0x8c'));_0x433eb8[_0xedb5('0x9')](_0xedb5('0x8d'),_0xedb5('0x8e'));_0x433eb8[_0xedb5('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xedb5('0x8f'));}if(_0x3bb8df[_0xedb5('0x90')]){_0x433eb8['limit'](_0x3bb8df[_0xedb5('0x90')]);}if(_0x3bb8df['offset']){_0x433eb8['offset'](_0x3bb8df[_0xedb5('0x91')]);}return db['sequelize'][_0xedb5('0x92')](_0x433eb8['toString'](),_0x59566b);})[_0xedb5('0x54')](function(_0x5b5d67){_0x1a6656=_0x5b5d67;var _0x8b3bf2=getUsersQuery(_0x50af35,_0x1a6656);return db[_0xedb5('0x6b')]['query'](_0x8b3bf2[_0xedb5('0x6c')](),_0x59566b);})[_0xedb5('0x54')](function(_0x3978b5){_0x5ef89c=_[_0xedb5('0x93')](_0x3978b5,_0x34b73d);if(_0x50af35===_0xedb5('0x31')){return db[_0xedb5('0x94')][_0xedb5('0x95')]({'attributes':[_0xedb5('0x96')],'raw':!![]});}})[_0xedb5('0x54')](function(_0x39bb2e){var _0x51e43e=_0x39bb2e?_0x39bb2e[_0xedb5('0x96')]:undefined;var _0x42ab41=_0x1a6656[_0xedb5('0x18')](function(_0x4fb2cb){return updateInteraction(_0x4fb2cb,_0x3e7669,_0x5ef89c,_0x51e43e);});return Promise[_0xedb5('0x97')](_0x42ab41);});}function countFilteredInteractions(_0x2fe8ff,_0x4aea5f){var _0x69305c=_0x2fe8ff[_0xedb5('0x98')]();_0x69305c[_0xedb5('0x9')](_0xedb5('0x99'));_0x69305c['field'](_0xedb5('0x9a'),_0xedb5('0x9b'));var _0x3eb2d5=utils['getSelectedTags'](_0x4aea5f);if(!_[_0xedb5('0x9c')](_0x3eb2d5)){_0x69305c['where'](_0xedb5('0x9d'),_0x3eb2d5);}var _0x36ea13={'type':db['Sequelize'][_0xedb5('0x69')]['SELECT'],'raw':!![]};return db[_0xedb5('0x6b')][_0xedb5('0x92')](_0x69305c[_0xedb5('0x6c')](),_0x36ea13);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index c06ffa4..762897a 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f37=['Tags','lodash','map','fullname','forEach','waiting','answered','unmanaged','total','closed','disposition','abandoned','talking','UserId','MailMessage','plainBody','-id','then','lastMsgText','Users','TagIds'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x9f37,0x166));var _0x79f3=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9f37[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x79f3('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x423429,_0x34eded){return new Promise(function(_0x164cc4,_0x467936){try{var _0x5c300f=[];if(_0x34eded[_0x423429]){_0x5c300f=_0x34eded[_0x423429][_0x79f3('0x1')](function(_0x565068){return{'id':_0x565068['id'],'fullname':_0x565068[_0x79f3('0x2')]};});}return _0x164cc4(_0x5c300f);}catch(_0x2af4be){_0x467936(_0x2af4be);}});}function getInteractionTags(_0x16d0e2,_0x50bef7){var _0x1c81ff=[];if(_0x16d0e2){_0x16d0e2['split'](',')[_0x79f3('0x3')](function(_0x406bfb){_0x1c81ff['push'](_0x50bef7[_0x406bfb]);});}return _0x1c81ff;}function updateWaitingCounter(_0x5b96f1){if(_0x5b96f1[_0x79f3('0x4')]){_0x5b96f1[_0x79f3('0x4')]-=0x1;}}function updateInteractionCounters(_0x51605e){_0x51605e[_0x79f3('0x4')]=0x0;_0x51605e['talking']=0x0;_0x51605e[_0x79f3('0x5')]=0x0;_0x51605e[_0x79f3('0x6')]=0x0;_0x51605e['abandoned']=0x0;_0x51605e[_0x79f3('0x7')]=0x0;if(_0x51605e[_0x79f3('0x8')]){if(_0x51605e[_0x79f3('0x9')]==='abandoned'){_0x51605e[_0x79f3('0xa')]+=0x1;updateWaitingCounter(_0x51605e);}if(_0x51605e['UserId']){_0x51605e[_0x79f3('0x5')]+=0x1;if(_0x51605e[_0x79f3('0xb')]){_0x51605e[_0x79f3('0xb')]-=0x1;}}else{if(_0x51605e['disposition']){_0x51605e[_0x79f3('0x6')]+=0x1;updateWaitingCounter(_0x51605e);}}}else{if(!_0x51605e[_0x79f3('0xc')]){_0x51605e[_0x79f3('0x4')]+=0x1;}if(_0x51605e[_0x79f3('0xc')]){_0x51605e['talking']+=0x1;updateWaitingCounter(_0x51605e);}}_0x51605e[_0x79f3('0x7')]+=0x1;return _0x51605e;}function getLastMessageText(_0x12f73c){return db[_0x79f3('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x12f73c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x79f3('0xe')],'order':_0x79f3('0xf'),'raw':!![]})[_0x79f3('0x10')](function(_0x516095){if(_0x516095&&_0x516095[_0x79f3('0xe')]){_0x12f73c[_0x79f3('0x11')]=_['trimStart'](_0x516095['plainBody']);}return _0x12f73c;})['catch'](function(_0x48e93f){throw _0x48e93f;});}exports['updateInteraction']=function(_0x4e9b8b,_0x4c1f85,_0x98b8cc,_0x1e9768){return new Promise(function(_0x2a64f6,_0x2074f5){return getInteractionUsers(_0x4e9b8b['id'],_0x98b8cc)[_0x79f3('0x10')](function(_0x11191e){_0x4e9b8b[_0x79f3('0x12')]=_0x11191e;return getInteractionTags(_0x4e9b8b[_0x79f3('0x13')],_0x4c1f85);})['then'](function(_0x3de11a){_0x4e9b8b[_0x79f3('0x14')]=_0x3de11a;delete _0x4e9b8b[_0x79f3('0x13')];return updateInteractionCounters(_0x4e9b8b);})[_0x79f3('0x10')](function(_0x51fef8){if(_0x1e9768){return getLastMessageText(_0x51fef8);}else{return _0x51fef8;}})[_0x79f3('0x10')](function(_0x594dc2){_0x2a64f6(_0x594dc2);})['catch'](function(_0x5db024){_0x2074f5(_0x5db024);});});}; \ No newline at end of file +var _0xdb5a=['../../mysqldb','fullname','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','-id','then','lastMsgText','trimStart','updateInteraction','Users','TagIds'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xdb5a,0x176));var _0xadb5=function(_0x1209d3,_0x2435d5){_0x1209d3=_0x1209d3-0x0;var _0x35339e=_0xdb5a[_0x1209d3];return _0x35339e;};'use strict';var _=require('lodash');var db=require(_0xadb5('0x0'))['db'];function getInteractionUsers(_0x3dfa39,_0x403635){return new Promise(function(_0x243092,_0x52d5eb){try{var _0x27caef=[];if(_0x403635[_0x3dfa39]){_0x27caef=_0x403635[_0x3dfa39]['map'](function(_0x174adb){return{'id':_0x174adb['id'],'fullname':_0x174adb[_0xadb5('0x1')]};});}return _0x243092(_0x27caef);}catch(_0xa02cd6){_0x52d5eb(_0xa02cd6);}});}function getInteractionTags(_0x553320,_0x423ecb){var _0x20fe87=[];if(_0x553320){_0x553320['split'](',')[_0xadb5('0x2')](function(_0x51c12f){_0x20fe87[_0xadb5('0x3')](_0x423ecb[_0x51c12f]);});}return _0x20fe87;}function updateWaitingCounter(_0x5ca23e){if(_0x5ca23e['waiting']){_0x5ca23e[_0xadb5('0x4')]-=0x1;}}function updateInteractionCounters(_0x1606ef){_0x1606ef[_0xadb5('0x4')]=0x0;_0x1606ef[_0xadb5('0x5')]=0x0;_0x1606ef[_0xadb5('0x6')]=0x0;_0x1606ef[_0xadb5('0x7')]=0x0;_0x1606ef[_0xadb5('0x8')]=0x0;_0x1606ef[_0xadb5('0x9')]=0x0;if(_0x1606ef[_0xadb5('0xa')]){if(_0x1606ef[_0xadb5('0xb')]===_0xadb5('0x8')){_0x1606ef[_0xadb5('0x8')]+=0x1;updateWaitingCounter(_0x1606ef);}if(_0x1606ef['UserId']){_0x1606ef[_0xadb5('0x6')]+=0x1;if(_0x1606ef[_0xadb5('0x5')]){_0x1606ef[_0xadb5('0x5')]-=0x1;}}else{if(_0x1606ef[_0xadb5('0xb')]){_0x1606ef[_0xadb5('0x7')]+=0x1;updateWaitingCounter(_0x1606ef);}}}else{if(!_0x1606ef['UserId']){_0x1606ef[_0xadb5('0x4')]+=0x1;}if(_0x1606ef[_0xadb5('0xc')]){_0x1606ef[_0xadb5('0x5')]+=0x1;updateWaitingCounter(_0x1606ef);}}_0x1606ef[_0xadb5('0x9')]+=0x1;return _0x1606ef;}function getLastMessageText(_0x58184f){return db[_0xadb5('0xd')][_0xadb5('0xe')]({'where':{'$and':[{'MailInteractionId':_0x58184f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xadb5('0xf'),'raw':!![]})[_0xadb5('0x10')](function(_0x491fdf){if(_0x491fdf&&_0x491fdf['plainBody']){_0x58184f[_0xadb5('0x11')]=_[_0xadb5('0x12')](_0x491fdf['plainBody']);}return _0x58184f;})['catch'](function(_0x8f8a83){throw _0x8f8a83;});}exports[_0xadb5('0x13')]=function(_0x58cf19,_0x5aaa83,_0xf60f7e,_0x3e62cc){return new Promise(function(_0x14cd86,_0x258c43){return getInteractionUsers(_0x58cf19['id'],_0xf60f7e)['then'](function(_0x24b6e2){_0x58cf19[_0xadb5('0x14')]=_0x24b6e2;return getInteractionTags(_0x58cf19[_0xadb5('0x15')],_0x5aaa83);})[_0xadb5('0x10')](function(_0x3e7df7){_0x58cf19['Tags']=_0x3e7df7;delete _0x58cf19['TagIds'];return updateInteractionCounters(_0x58cf19);})['then'](function(_0x523c29){if(_0x3e62cc){return getLastMessageText(_0x523c29);}else{return _0x523c29;}})[_0xadb5('0x10')](function(_0x5b94d9){_0x14cd86(_0x5b94d9);})['catch'](function(_0x1a8c7a){_0x258c43(_0x1a8c7a);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 33cbfa3..1f344ac 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10d2=['fax-interactions','sms-interactions','whatsapp-interactions','chat','Account','InteractionId','upperFirst','unknown','accounts','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','exports','../../config/logger'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x10d2,0x77));var _0x210d=function(_0x502ee2,_0x20d426){_0x502ee2=_0x502ee2-0x0;var _0x1bac51=_0x10d2[_0x502ee2];return _0x1bac51;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x210d('0x0'))('openchannel-interactions'),'mail':require(_0x210d('0x0'))('mail-interactions'),'fax':require(_0x210d('0x0'))(_0x210d('0x1')),'sms':require(_0x210d('0x0'))(_0x210d('0x2')),'chat':require(_0x210d('0x0'))('chat-interactions'),'whatsapp':require(_0x210d('0x0'))(_0x210d('0x3'))};function getAccountFK(_0x533bb5){return _['capitalize'](_0x533bb5)+(_0x533bb5===_0x210d('0x4')?'Website':_0x210d('0x5'))+'Id';}function getInteractionFK(_0xd284cc){return _['capitalize'](_0xd284cc)+_0x210d('0x6');}function getInteractionId(_0x250aef,_0x2ef719,_0x1db66b){if(_0x250aef&&_0x250aef[_[_0x210d('0x7')](_0x1db66b)+'InteractionId']){return _0x250aef[_[_0x210d('0x7')](_0x1db66b)+_0x210d('0x6')];}else if(_0x250aef&&_0x250aef['id']){return _0x250aef['id'];}else if(_0x2ef719&&_0x2ef719['id']){return _0x2ef719['id'];}else{return _0x210d('0x8');}}function getInteractionsTables(_0x4625c7){return{'accounts':_0x4625c7+'_'+(_0x4625c7===_0x210d('0x4')?'websites':_0x210d('0x9')),'interactions':_0x4625c7+'_interactions','interactionsTags':_0x4625c7+_0x210d('0xa'),'messages':_0x4625c7+_0x210d('0xb'),'userInteractions':_0x210d('0xc')+_0x4625c7+_0x210d('0xd')};}function getSelectedTags(_0x495165){var _0x4a341f=[];if(_0x495165){_0x4a341f=Array[_0x210d('0xe')](_0x495165)?_0x495165:[_0x495165];}return _0x4a341f;}function log(_0x4e22b9,_0x3bf882,_0x1b3cf,_0x212ffa,_0x5d0585,_0x3d9bb0){loggers[_0x5d0585[_0x210d('0xf')]()][_0x4e22b9](_0x210d('0x10'),_0x3d9bb0[_0x210d('0x11')](),_0x3bf882?_0x3bf882['id']:null,_0x3bf882?_0x3bf882[_0x210d('0x12')]:null,_0x3bf882?_0x3bf882[_0x210d('0x13')]:null,getInteractionId(_0x1b3cf,_0x212ffa,_0x5d0585),_0x1b3cf?JSON[_0x210d('0x14')](_0x1b3cf):_0x210d('0x15'));}function updateUser(_0x43ffe6,_0x12a005,_0xfef854,_0x3108c6,_0x45b075){db[_[_0x210d('0x7')](_0x3108c6)+_0x210d('0x16')][_0x210d('0x17')]({'where':{'id':getInteractionId(_0x12a005,_0xfef854,_0x3108c6)}})[_0x210d('0x18')](function(_0x320526){if(_0x320526){return _0x320526[_0x210d('0x19')]({'UserId':_0x43ffe6?_0x43ffe6['id']:null});}})[_0x210d('0x18')](function(_0x567fa8){if(_0x567fa8){log(_0x210d('0x1a'),_0x43ffe6,_0x12a005,_0xfef854,_0x3108c6,_0x45b075);}})[_0x210d('0x1b')](function(){log(_0x210d('0x1c'),_0x43ffe6,_0x12a005,_0xfef854,_0x3108c6,_0x45b075);});}module[_0x210d('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x4443=['../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','then','update','info','catch','error'];(function(_0x24dd14,_0x307d6f){var _0x30befd=function(_0x367db1){while(--_0x367db1){_0x24dd14['push'](_0x24dd14['shift']());}};_0x30befd(++_0x307d6f);}(_0x4443,0x13f));var _0x3444=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4443[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var db=require(_0x3444('0x0'))['db'];var loggers={'openchannel':require(_0x3444('0x1'))(_0x3444('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x3444('0x1'))(_0x3444('0x3')),'chat':require('../../config/logger')(_0x3444('0x4')),'whatsapp':require(_0x3444('0x1'))(_0x3444('0x5'))};function getAccountFK(_0x1158a4){return _[_0x3444('0x6')](_0x1158a4)+(_0x1158a4===_0x3444('0x7')?_0x3444('0x8'):_0x3444('0x9'))+'Id';}function getInteractionFK(_0x1c3fde){return _[_0x3444('0x6')](_0x1c3fde)+_0x3444('0xa');}function getInteractionId(_0x22d27a,_0x3786d3,_0x5943e5){if(_0x22d27a&&_0x22d27a[_[_0x3444('0xb')](_0x5943e5)+_0x3444('0xa')]){return _0x22d27a[_['upperFirst'](_0x5943e5)+_0x3444('0xa')];}else if(_0x22d27a&&_0x22d27a['id']){return _0x22d27a['id'];}else if(_0x3786d3&&_0x3786d3['id']){return _0x3786d3['id'];}else{return _0x3444('0xc');}}function getInteractionsTables(_0x40d014){return{'accounts':_0x40d014+'_'+(_0x40d014==='chat'?_0x3444('0xd'):_0x3444('0xe')),'interactions':_0x40d014+_0x3444('0xf'),'interactionsTags':_0x40d014+'_interaction_has_tags','messages':_0x40d014+_0x3444('0x10'),'userInteractions':'user_has_'+_0x40d014+_0x3444('0xf')};}function getSelectedTags(_0x3aa853){var _0x5e0623=[];if(_0x3aa853){_0x5e0623=Array['isArray'](_0x3aa853)?_0x3aa853:[_0x3aa853];}return _0x5e0623;}function log(_0x5e2388,_0xe48277,_0x42e054,_0x3fb16c,_0x5b7909,_0x18c043){loggers[_0x5b7909[_0x3444('0x11')]()][_0x5e2388](_0x3444('0x12'),_0x18c043[_0x3444('0x13')](),_0xe48277?_0xe48277['id']:null,_0xe48277?_0xe48277[_0x3444('0x14')]:null,_0xe48277?_0xe48277[_0x3444('0x15')]:null,getInteractionId(_0x42e054,_0x3fb16c,_0x5b7909),_0x42e054?JSON[_0x3444('0x16')](_0x42e054):'null');}function updateUser(_0x437119,_0xcf34da,_0x5c7464,_0x7c54db,_0x52a15e){db[_[_0x3444('0xb')](_0x7c54db)+_0x3444('0x17')]['findOne']({'where':{'id':getInteractionId(_0xcf34da,_0x5c7464,_0x7c54db)}})[_0x3444('0x18')](function(_0x52877c){if(_0x52877c){return _0x52877c[_0x3444('0x19')]({'UserId':_0x437119?_0x437119['id']:null});}})['then'](function(_0x4105ba){if(_0x4105ba){log(_0x3444('0x1a'),_0x437119,_0xcf34da,_0x5c7464,_0x7c54db,_0x52a15e);}})[_0x3444('0x1b')](function(){log(_0x3444('0x1c'),_0x437119,_0xcf34da,_0x5c7464,_0x7c54db,_0x52a15e);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index f380e1e..05386a2 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 _0x60a8=['../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','crypto','util','composable-middleware'];(function(_0x735297,_0x5cb20b){var _0x32c47d=function(_0x5f18cc){while(--_0x5f18cc){_0x735297['push'](_0x735297['shift']());}};_0x32c47d(++_0x5cb20b);}(_0x60a8,0xfa));var _0x860a=function(_0x52dc72,_0x3401a6){_0x52dc72=_0x52dc72-0x0;var _0x4ad3b4=_0x60a8[_0x52dc72];return _0x4ad3b4;};'use strict';var crypto=require(_0x860a('0x0'));var util=require(_0x860a('0x1'));var compose=require(_0x860a('0x2'));var db=require(_0x860a('0x3'))['db'];var config=require(_0x860a('0x4'));function getValueFromLicense(_0x5ed4bd,_0x217636){if(_0x5ed4bd&&_0x217636){if(_0x217636[_0x860a('0x5')]&&_0x217636[_0x860a('0x6')]){var _0x433719=_0x217636['data1'];var _0x2ce445=_0x217636['license'];var _0x109ee4=_0x433719['split']('-')[0x4];var _0x5eaa6a=_0x433719['split']('-')[0x0];var _0x17e69e=crypto['createDecipher'](_0x860a('0x7'),util[_0x860a('0x8')](_0x860a('0x9'),_0x109ee4,_0x433719,_0x5eaa6a));var _0x1d1fb7=_0x17e69e[_0x860a('0xa')](_0x2ce445,'base64',_0x860a('0xb'));_0x1d1fb7+=_0x17e69e[_0x860a('0xc')](_0x860a('0xb'));var _0x1efb90=JSON[_0x860a('0xd')](_0x1d1fb7);return _0x1efb90['hasOwnProperty'](_0x5ed4bd)?_0x1efb90[_0x5ed4bd]:null;}}return null;}function isLimit(_0x165c89,_0x3eb5f2,_0xe56b5,_0x5c3413){var _0x4f0793=_0x3eb5f2;return compose()['use'](function(_0xa457da,_0x1c67ce,_0x54e4c5){return db['License'][_0x860a('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x860a('0xf')](function(_0x163a16){var _0xf16eb6=getValueFromLicense(_0x165c89,_0x163a16);return _0xf16eb6?_0xf16eb6:_0x4f0793;})[_0x860a('0xf')](function(_0x321854){_0x4f0793=_0x321854;return _0xe56b5['count'](_0x5c3413);})[_0x860a('0xf')](function(_0x382318){if(_0x382318>=_0x4f0793){return _0x1c67ce[_0x860a('0x10')](0x193)[_0x860a('0x11')]({'message':util[_0x860a('0x8')](_0x860a('0x12'),_0x165c89)});}_0x54e4c5();})[_0x860a('0x13')](function(_0x42ef0d){_0x54e4c5(_0x42ef0d);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x860a('0x14')],{'where':{'$or':[{'role':_0x860a('0x15')},{'role':_0x860a('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x5626=['count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','../../mysqldb','../../config/environment','data1','split','createDecipher','format','%s:%s:%s','base64','utf8','final','parse','License','then'];(function(_0x349ac1,_0x443243){var _0x77840a=function(_0x3e6a60){while(--_0x3e6a60){_0x349ac1['push'](_0x349ac1['shift']());}};_0x77840a(++_0x443243);}(_0x5626,0x1c1));var _0x6562=function(_0x1103d1,_0x1f980b){_0x1103d1=_0x1103d1-0x0;var _0x197597=_0x5626[_0x1103d1];return _0x197597;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0x6562('0x0'))['db'];var config=require(_0x6562('0x1'));function getValueFromLicense(_0x28b9ba,_0x371989){if(_0x28b9ba&&_0x371989){if(_0x371989[_0x6562('0x2')]&&_0x371989['license']){var _0x251308=_0x371989[_0x6562('0x2')];var _0x3a6e98=_0x371989['license'];var _0x35fe29=_0x251308[_0x6562('0x3')]('-')[0x4];var _0x25ddac=_0x251308[_0x6562('0x3')]('-')[0x0];var _0x5f00dc=crypto[_0x6562('0x4')]('aes-256-ctr',util[_0x6562('0x5')](_0x6562('0x6'),_0x35fe29,_0x251308,_0x25ddac));var _0x4ecc88=_0x5f00dc['update'](_0x3a6e98,_0x6562('0x7'),_0x6562('0x8'));_0x4ecc88+=_0x5f00dc[_0x6562('0x9')]('utf8');var _0x23c185=JSON[_0x6562('0xa')](_0x4ecc88);return _0x23c185['hasOwnProperty'](_0x28b9ba)?_0x23c185[_0x28b9ba]:null;}}return null;}function isLimit(_0x549b11,_0x3df2ac,_0x12a956,_0x367637){var _0x2370dc=_0x3df2ac;return compose()['use'](function(_0x551d8c,_0x18dc76,_0x5659ab){return db[_0x6562('0xb')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x6562('0xc')](function(_0x4f5ec3){var _0x4f7464=getValueFromLicense(_0x549b11,_0x4f5ec3);return _0x4f7464?_0x4f7464:_0x2370dc;})['then'](function(_0x3ae603){_0x2370dc=_0x3ae603;return _0x12a956[_0x6562('0xd')](_0x367637);})[_0x6562('0xc')](function(_0x1b70c7){if(_0x1b70c7>=_0x2370dc){return _0x18dc76[_0x6562('0xe')](0x193)['json']({'message':util[_0x6562('0x5')](_0x6562('0xf'),_0x549b11)});}_0x5659ab();})[_0x6562('0x10')](function(_0x23d402){_0x5659ab(_0x23d402);});});}function isUserLimit(){return isLimit(_0x6562('0x11'),0x1,db[_0x6562('0x12')],{'where':{'$or':[{'role':_0x6562('0x13')},{'role':_0x6562('0x14')}]}});}exports[_0x6562('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 89354ef..29d9dc1 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 _0x9433=['operator','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','DATE','utcOffset','add','hours','lodash','startsWith','[$or]','replace','[$and]','split','length','forEach','shift','match','filter','indexOf','map','conditions','push','$eq'];(function(_0x864a12,_0x25ba1e){var _0x2af0b1=function(_0xb64868){while(--_0xb64868){_0x864a12['push'](_0x864a12['shift']());}};_0x2af0b1(++_0x25ba1e);}(_0x9433,0xc0));var _0x3943=function(_0x1fbc1c,_0x3e353f){_0x1fbc1c=_0x1fbc1c-0x0;var _0x43f984=_0x9433[_0x1fbc1c];return _0x43f984;};'use strict';var _=require(_0x3943('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x394d6a){var _0x18e6eb={'conditions':[]};_0x18e6eb['sqlOperator']=_[_0x3943('0x1')](_0x394d6a,_0x3943('0x2'))?'or':'and';var _0x2ba547=_0x394d6a[_0x3943('0x3')](_0x3943('0x4'),'')[_0x3943('0x3')](_0x3943('0x2'),'')[_0x3943('0x5')]('||');for(var _0x3c08bf=0x0;_0x3c08bf<_0x2ba547[_0x3943('0x6')];_0x3c08bf++){var _0x28b19e=_0x2ba547[_0x3c08bf][_0x3943('0x5')](':=');var _0x26af98=_0x28b19e[0x0];var _0x40ea77=_0x28b19e['slice'](0x1);_0x40ea77[_0x3943('0x7')](function(_0x301bd2){var _0x425635=_0x301bd2[_0x3943('0x5')]('[')[_0x3943('0x8')]();var _0x8cdf98=_0x301bd2[_0x3943('0x9')](/\[(.*?)\]/g);_0x8cdf98[_0x3943('0x7')](function(_0x5ea439){var _0x2888c7=_0x5ea439[_0x3943('0x5')]('[')[_0x3943('0xa')](function(_0x223fb4){return _0x223fb4[_0x3943('0xb')](']')>-0x1;})[_0x3943('0xc')](function(_0x5cd9b5){return _0x5cd9b5[_0x3943('0x5')](']')[0x0];})[0x0];_0x18e6eb[_0x3943('0xd')][_0x3943('0xe')]({'field':_0x26af98,'operator':_0x425635,'value':_0x2888c7});});});}return _0x18e6eb;};exports['buildExpression']=function(_0x4cf390,_0x557934,_0x5011c7){var _0x581e8c={};if(_0x557934==='DATE'){if(_0x5011c7['operator']===_0x3943('0xf')){_0x5011c7[_0x3943('0x10')]=_0x3943('0x11');_0x5011c7['value']+=','+_0x5011c7[_0x3943('0x12')];}else if(_[_0x3943('0x13')]([_0x3943('0x14'),_0x3943('0x15')],_0x5011c7[_0x3943('0x10')])){_0x5011c7[_0x3943('0x12')]=moment(_0x5011c7['value'])['add'](0x1,_0x3943('0x16'))[_0x3943('0x17')](_0x3943('0x18'));}}if(_0x5011c7[_0x3943('0x19')]){_0x557934=_0x5011c7[_0x3943('0x19')];_0x581e8c['text']=_0x3943('0x1a')+_0x4cf390+'.'+_0x5011c7[_0x3943('0x1b')]+_0x3943('0x1c')+_0x5011c7['castTo']+')\x20'+parseOperator(_0x5011c7['operator']);}else{_0x581e8c[_0x3943('0x1d')]=_0x4cf390+'.'+_0x5011c7['field']+'\x20'+parseOperator(_0x5011c7['operator']);}if(_[_0x3943('0x13')]([_0x3943('0x1e'),_0x3943('0x1f')],_0x5011c7[_0x3943('0x10')]))_0x581e8c[_0x3943('0x1d')]='('+_0x581e8c[_0x3943('0x1d')]+_0x3943('0x20')+_0x4cf390+'.'+_0x5011c7[_0x3943('0x1b')]+_0x3943('0x21');_0x581e8c[_0x3943('0x12')]=parseValue(_0x557934,_0x5011c7['operator'],_0x5011c7[_0x3943('0x12')]);return _0x581e8c;};function parseOperator(_0x16a31d){var _0x47e82d;switch(_0x16a31d){case _0x3943('0x22'):_0x47e82d='IN\x20?';break;case _0x3943('0x1f'):_0x47e82d=_0x3943('0x23');break;case'$eq':_0x47e82d='=\x20?';break;case'$ne':_0x47e82d=_0x3943('0x24');break;case'$substring':case _0x3943('0x25'):case _0x3943('0x26'):_0x47e82d=_0x3943('0x27');break;case _0x3943('0x28'):_0x47e82d=_0x3943('0x29');break;case _0x3943('0x14'):_0x47e82d='>\x20?';break;case _0x3943('0x15'):_0x47e82d=_0x3943('0x2a');break;case _0x3943('0x2b'):_0x47e82d='>=\x20?';break;case _0x3943('0x11'):_0x47e82d=_0x3943('0x2c');break;}return _0x47e82d;}function parseValue(_0x508ef9,_0x4ba363,_0x19d1dc){var _0x158760={'start':undefined,'end':undefined};switch(_0x4ba363){case'$in':case _0x3943('0x1f'):_0x158760[_0x3943('0x2d')]=_0x19d1dc['split'](',');break;case _0x3943('0x2e'):_0x158760[_0x3943('0x2d')]='%'+_0x19d1dc+'%';break;case'$startsWith':_0x158760[_0x3943('0x2d')]=_0x19d1dc+'%';break;case _0x3943('0x26'):_0x158760[_0x3943('0x2d')]='%'+_0x19d1dc;break;case _0x3943('0x11'):var _0x1cf1dd=_0x19d1dc['split'](',');var _0x19d1dc=_0x1cf1dd[_0x3943('0x8')]();var _0x579ddb=_0x1cf1dd[_0x3943('0x2f')]();if(_0x508ef9===_0x3943('0x30')){_0x19d1dc=moment(_0x19d1dc)[_0x3943('0x31')](0x0,!![])['format']();_0x579ddb=moment(_0x579ddb)['utcOffset'](0x0,!![])[_0x3943('0x32')](0x17,_0x3943('0x33'))[_0x3943('0x32')](0x3b,'minutes')[_0x3943('0x32')](0x3b,'seconds')['format']();}_0x158760={'start':_0x19d1dc,'end':_0x579ddb};break;default:_0x158760[_0x3943('0x2d')]=_0x19d1dc;break;}return _0x158760;} \ No newline at end of file +var _0xc962=['replace','split','length','forEach','conditions','push','buildExpression','DATE','$eq','operator','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','hours','add','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc962,0x66));var _0x2c96=function(_0x1b626f,_0x3ec9de){_0x1b626f=_0x1b626f-0x0;var _0xb91df7=_0xc962[_0x1b626f];return _0xb91df7;};'use strict';var _=require(_0x2c96('0x0'));var moment=require(_0x2c96('0x1'));exports[_0x2c96('0x2')]=function(_0x1867df){var _0x16f1d4={'conditions':[]};_0x16f1d4[_0x2c96('0x3')]=_['startsWith'](_0x1867df,_0x2c96('0x4'))?'or':_0x2c96('0x5');var _0x307e6c=_0x1867df[_0x2c96('0x6')]('[$and]','')[_0x2c96('0x6')](_0x2c96('0x4'),'')[_0x2c96('0x7')]('||');for(var _0x5f28bc=0x0;_0x5f28bc<_0x307e6c[_0x2c96('0x8')];_0x5f28bc++){var _0x2219d1=_0x307e6c[_0x5f28bc]['split'](':=');var _0x324b6d=_0x2219d1[0x0];var _0x11b6a3=_0x2219d1['slice'](0x1);_0x11b6a3[_0x2c96('0x9')](function(_0x58932e){var _0x15378d=_0x58932e[_0x2c96('0x7')]('[')['shift']();var _0x393322=_0x58932e['match'](/\[(.*?)\]/g);_0x393322[_0x2c96('0x9')](function(_0x29f30e){var _0x7e0db1=_0x29f30e[_0x2c96('0x7')]('[')['filter'](function(_0x26f192){return _0x26f192['indexOf'](']')>-0x1;})['map'](function(_0x47d8d0){return _0x47d8d0[_0x2c96('0x7')](']')[0x0];})[0x0];_0x16f1d4[_0x2c96('0xa')][_0x2c96('0xb')]({'field':_0x324b6d,'operator':_0x15378d,'value':_0x7e0db1});});});}return _0x16f1d4;};exports[_0x2c96('0xc')]=function(_0x287825,_0x152770,_0x14eee5){var _0x2452f8={};if(_0x152770===_0x2c96('0xd')){if(_0x14eee5['operator']===_0x2c96('0xe')){_0x14eee5[_0x2c96('0xf')]='$between';_0x14eee5[_0x2c96('0x10')]+=','+_0x14eee5['value'];}else if(_[_0x2c96('0x11')](['$gt',_0x2c96('0x12')],_0x14eee5[_0x2c96('0xf')])){_0x14eee5[_0x2c96('0x10')]=moment(_0x14eee5['value'])['add'](0x1,_0x2c96('0x13'))[_0x2c96('0x14')](_0x2c96('0x15'));}}if(_0x14eee5[_0x2c96('0x16')]){_0x152770=_0x14eee5['castTo'];_0x2452f8[_0x2c96('0x17')]=_0x2c96('0x18')+_0x287825+'.'+_0x14eee5[_0x2c96('0x19')]+_0x2c96('0x1a')+_0x14eee5[_0x2c96('0x16')]+')\x20'+parseOperator(_0x14eee5[_0x2c96('0xf')]);}else{_0x2452f8[_0x2c96('0x17')]=_0x287825+'.'+_0x14eee5['field']+'\x20'+parseOperator(_0x14eee5[_0x2c96('0xf')]);}if(_[_0x2c96('0x11')]([_0x2c96('0x1b'),_0x2c96('0x1c')],_0x14eee5[_0x2c96('0xf')]))_0x2452f8[_0x2c96('0x17')]='('+_0x2452f8[_0x2c96('0x17')]+_0x2c96('0x1d')+_0x287825+'.'+_0x14eee5[_0x2c96('0x19')]+_0x2c96('0x1e');_0x2452f8[_0x2c96('0x10')]=parseValue(_0x152770,_0x14eee5[_0x2c96('0xf')],_0x14eee5[_0x2c96('0x10')]);return _0x2452f8;};function parseOperator(_0x5e9fc0){var _0x19bb06;switch(_0x5e9fc0){case _0x2c96('0x1f'):_0x19bb06=_0x2c96('0x20');break;case _0x2c96('0x1c'):_0x19bb06=_0x2c96('0x21');break;case _0x2c96('0xe'):_0x19bb06='=\x20?';break;case _0x2c96('0x1b'):_0x19bb06=_0x2c96('0x22');break;case _0x2c96('0x23'):case _0x2c96('0x24'):case _0x2c96('0x25'):_0x19bb06=_0x2c96('0x26');break;case _0x2c96('0x27'):_0x19bb06=_0x2c96('0x28');break;case _0x2c96('0x29'):_0x19bb06=_0x2c96('0x2a');break;case'$lte':_0x19bb06=_0x2c96('0x2b');break;case'$gte':_0x19bb06=_0x2c96('0x2c');break;case _0x2c96('0x2d'):_0x19bb06=_0x2c96('0x2e');break;}return _0x19bb06;}function parseValue(_0x37f5e7,_0x4efe72,_0x214e60){var _0x52e8f2={'start':undefined,'end':undefined};switch(_0x4efe72){case _0x2c96('0x1f'):case _0x2c96('0x1c'):_0x52e8f2[_0x2c96('0x2f')]=_0x214e60[_0x2c96('0x7')](',');break;case _0x2c96('0x23'):_0x52e8f2['start']='%'+_0x214e60+'%';break;case'$startsWith':_0x52e8f2[_0x2c96('0x2f')]=_0x214e60+'%';break;case'$endsWith':_0x52e8f2['start']='%'+_0x214e60;break;case _0x2c96('0x2d'):var _0x276db6=_0x214e60[_0x2c96('0x7')](',');var _0x214e60=_0x276db6[_0x2c96('0x30')]();var _0x29a607=_0x276db6[_0x2c96('0x31')]();if(_0x37f5e7===_0x2c96('0xd')){_0x214e60=moment(_0x214e60)[_0x2c96('0x32')](0x0,!![])['format']();_0x29a607=moment(_0x29a607)[_0x2c96('0x32')](0x0,!![])['add'](0x17,_0x2c96('0x33'))[_0x2c96('0x34')](0x3b,'minutes')[_0x2c96('0x34')](0x3b,_0x2c96('0x35'))['format']();}_0x52e8f2={'start':_0x214e60,'end':_0x29a607};break;default:_0x52e8f2[_0x2c96('0x2f')]=_0x214e60;break;}return _0x52e8f2;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 60d2626..c991dc7 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 _0xcca7=['filter','columns','value','merge','VIRTUAL','lower','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','find','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','isArray','limit','sort','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','name','intersection','model','attributes','hasOwnProperty','offset','order','where'];(function(_0x6a10fa,_0x1712fe){var _0x3b703a=function(_0x47c98d){while(--_0x47c98d){_0x6a10fa['push'](_0x6a10fa['shift']());}};_0x3b703a(++_0x1712fe);}(_0xcca7,0x1aa));var _0x7cca=function(_0x31472c,_0x20f729){_0x31472c=_0x31472c-0x0;var _0x29a615=_0xcca7[_0x31472c];return _0x29a615;};'use strict';var _=require(_0x7cca('0x0'));var sequelize=require(_0x7cca('0x1'));var moment=require(_0x7cca('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x33db4f){var _0x5cfce5=['ne'];try{var _0x4c311e=JSON[_0x7cca('0x3')](_0x33db4f);var _0x533b00=Object[_0x7cca('0x4')](_0x4c311e)[0x0];return _0x5cfce5[_0x7cca('0x5')](_0x533b00);}catch(_0x2126f7){return![];}}function getOperatorValue(_0x312e98){var _0x1c6c95=JSON[_0x7cca('0x3')](_0x312e98);var _0x5aec51=Object['keys'](_0x1c6c95)[0x0];var _0x937fad=_0x1c6c95[_0x5aec51];return{['$'+_0x5aec51]:_0x937fad};}exports[_0x7cca('0x6')]=function(_0x1aed1b){var _0x1e8cb9=null;if(_0x1aed1b){_0x1e8cb9=_0x1aed1b[_0x7cca('0x7')](',');}return _0x1e8cb9;};exports[_0x7cca('0x8')]=function(_0x20ffa9,_0x2b8b62){var _0x27323a={};if(!_[_0x7cca('0x9')](_0x20ffa9)){_['forOwn'](_0x20ffa9,function(_0x302367,_0x464911){try{if(_0x2b8b62){var _0x275ab2=_[_0x7cca('0xa')](_0x2b8b62,{'name':_0x464911})||{};if(hasSequelizeOperator(_0x302367)){_0x27323a[_0x464911]=getOperatorValue(_0x302367);}else if(_0x275ab2[_0x7cca('0xb')]==='DATE'&&_[_0x7cca('0xc')](_0x302367)){var _0x41e0a2=JSON[_0x7cca('0x3')](_0x302367);var _0x4d0d6d={'$gte':moment(moment(_0x41e0a2['$gte'])[_0x7cca('0xd')](_0x7cca('0xe')))[_0x7cca('0xf')]()[_0x7cca('0xd')](),'$lte':moment(moment(_0x41e0a2[_0x7cca('0x10')])[_0x7cca('0xd')](_0x7cca('0xe')))['utc']()[_0x7cca('0x11')](0x1,'s')['format']()};_0x27323a[_0x464911]=_0x4d0d6d;}else if(_0x275ab2['name']==='uniqueid'){_0x27323a[_0x464911]=_0x302367;}else{_0x27323a[_0x464911]=_[_0x7cca('0x12')](_0x302367)?_0x302367:JSON[_0x7cca('0x3')](_0x302367);}}else{_0x27323a[_0x464911]=_[_0x7cca('0x12')](_0x302367)?_0x302367:JSON[_0x7cca('0x3')](_0x302367);}}catch(_0x44294b){_0x27323a[_0x464911]=_0x302367['split'](',');}});}return _0x27323a;};exports[_0x7cca('0x13')]=function(_0x4fba9e){_0x4fba9e=parseInt(_0x4fba9e,0xa);if(!_0x4fba9e||_0x4fba9e<0x0){_0x4fba9e=LIMIT_VALUE;}return _0x4fba9e;};exports['offset']=function(_0x5d7ac6){_0x5d7ac6=parseInt(_0x5d7ac6,0xa);if(!_0x5d7ac6||_0x5d7ac6<0x0){_0x5d7ac6=0x0;}return _0x5d7ac6;};exports[_0x7cca('0x14')]=function(_0x25297b){var _0x2beb6c,_0x1a20be=null;if(_0x25297b){_0x2beb6c=_0x25297b[_0x7cca('0x7')](',');_0x1a20be=_[_0x7cca('0x15')](_0x2beb6c,function(_0x2e023c){if(_0x2e023c[_0x7cca('0x16')]('-')===0x0){return[_0x2e023c==='priority'?sequelize[_0x7cca('0x17')](sequelize[_0x7cca('0x18')](_0x7cca('0x19')),_0x7cca('0x1a')):_0x2e023c['substr'](0x1),_0x7cca('0x1b')];}else{return[_0x2e023c===_0x7cca('0x19')?sequelize[_0x7cca('0x17')](sequelize[_0x7cca('0x18')](_0x7cca('0x19')),_0x7cca('0x1a')):_0x2e023c,_0x7cca('0x1c')];}});}return _0x1a20be;};exports[_0x7cca('0x1d')]=function(_0x4b99b6,_0xfe121c){if(_[_0x7cca('0x9')](_0x4b99b6)){return _0x4b99b6;}if(_[_0x7cca('0x12')](_0x4b99b6)){for(var _0xdaf07f=0x0;_0xdaf07f<_0x4b99b6[_0x7cca('0x1e')];_0xdaf07f+=0x1){_0x4b99b6[_0xdaf07f]=this[_0x7cca('0x1d')](_0x4b99b6[_0xdaf07f],_0xfe121c);}return _0x4b99b6;}if(!_[_0x7cca('0x1f')](_0x4b99b6)){return _0x4b99b6;}if(_[_0x7cca('0x20')](_0xfe121c)){_0xfe121c=[_0xfe121c];}if(!_['isArray'](_0xfe121c)){return _0x4b99b6;}for(var _0x2cafe1=0x0;_0x2cafe1<_0xfe121c['length'];_0x2cafe1+=0x1){_[_0x7cca('0x21')](_0x4b99b6,_0xfe121c[_0x2cafe1]);}for(var _0x201fbb in _0x4b99b6){if(_0x4b99b6['hasOwnProperty'](_0x201fbb)){_0x4b99b6[_0x201fbb]=this[_0x7cca('0x1d')](_0x4b99b6[_0x201fbb],_0xfe121c);}}return _0x4b99b6;};exports[_0x7cca('0x22')]=function(_0x5533fb){return _0x5533fb[_0x7cca('0x23')](RegExp(_0x7cca('0x24')))?!![]:![];};exports[_0x7cca('0x25')]=function(_0x52fb40){return _0x52fb40['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7cca('0x26')]=function(_0x13d217){var _0x3797f4=[];_0x13d217[_0x7cca('0x7')](/[ ,]+/)[_0x7cca('0x27')](function(_0xe1ee18){_0xe1ee18=_0xe1ee18[_0x7cca('0x28')](/([^:]")"+/g,'$1');_0xe1ee18='+'+_0xe1ee18+'*';var _0x5a2c7c=/[ `!@#$%^&*()_\-?~]/;if(_0xe1ee18['match'](_0x5a2c7c))_0xe1ee18='\x22'+_0xe1ee18+'\x22';_0x3797f4[_0x7cca('0x29')](_0xe1ee18);});return _0x3797f4[_0x7cca('0x2a')]('\x20');};exports[_0x7cca('0x2b')]=function(_0x4f5fd2,_0x2c4f63,_0x4f8e75){var _0x2061fe={},_0x10558a={};if(_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x2d')]){_0x2c4f63['query']['id']=_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x2d')];delete _0x2c4f63[_0x7cca('0x2c')]['$id'];}_0x2061fe['model']=_['map'](_0x4f5fd2,_0x7cca('0x2e'));_0x2061fe[_0x7cca('0x2c')]=_['keys'](_0x2c4f63[_0x7cca('0x2c')]);_0x2061fe[_0x7cca('0x8')]=_[_0x7cca('0x2f')](_0x2061fe[_0x7cca('0x30')],_0x2061fe[_0x7cca('0x2c')]);_0x10558a[_0x7cca('0x31')]=_[_0x7cca('0x2f')](_0x2061fe['model'],this[_0x7cca('0x6')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x6')]));_0x10558a[_0x7cca('0x31')]=_0x10558a['attributes'][_0x7cca('0x1e')]?_0x10558a[_0x7cca('0x31')]:_0x2061fe[_0x7cca('0x30')];if(!_0x2c4f63['query'][_0x7cca('0x32')]('nolimit')){_0x10558a[_0x7cca('0x13')]=this[_0x7cca('0x13')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x13')]);_0x10558a[_0x7cca('0x33')]=this[_0x7cca('0x33')](_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x33')]);}_0x10558a[_0x7cca('0x34')]=this['sort'](_0x2c4f63['query'][_0x7cca('0x14')]);_0x10558a[_0x7cca('0x35')]=this['filters'](_['pick'](_0x2c4f63[_0x7cca('0x2c')],_0x2061fe[_0x7cca('0x8')]),_0x4f5fd2);if(_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x36')]){var _0x371c67=_0x4f5fd2;var _0x4cd159=_0x2c4f63[_0x7cca('0x2c')]['filter'];if(typeof _0x4cd159==='object'){_0x371c67=_[_0x7cca('0x36')](_0x4f5fd2,function(_0x33d069){return _['includes'](_0x4cd159[_0x7cca('0x37')],_0x33d069['name']);});_0x4cd159=_0x4cd159[_0x7cca('0x38')];}_0x10558a[_0x7cca('0x35')]=_[_0x7cca('0x39')](_0x10558a['where'],{'$or':_[_0x7cca('0x15')](_0x371c67,function(_0x207250){if(_0x207250[_0x7cca('0xb')]!==_0x7cca('0x3a')){if(_0x4f8e75){return sequelize['where'](sequelize['fn'](_0x7cca('0x3b'),sequelize[_0x7cca('0x18')](_0x207250[_0x7cca('0x2e')])),{'$like':sequelize['fn'](_0x7cca('0x3b'),'%'+_0x2c4f63[_0x7cca('0x2c')][_0x7cca('0x36')]+'%')});}else{var _0x57f440={};_0x57f440[_0x207250['name']]={'$like':'%'+_0x2c4f63['query']['filter']+'%'};return _0x57f440;}}})});}_0x10558a=_[_0x7cca('0x39')]({},_0x10558a,_0x2c4f63['options']);return _0x10558a;}; \ No newline at end of file +var _0xe0ae=['isArray','split','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','ASC','omit','length','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','join','query','$id','model','intersection','attributes','fields','nolimit','limit','order','where','pick','filter','object','includes','columns','value','VIRTUAL','lower','moment','keys','parse','filters','isEmpty','forOwn','find','type','isPlainObject','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xe0ae,0xa1));var _0xee0a=function(_0x512973,_0x564e8b){_0x512973=_0x512973-0x0;var _0x32f2e1=_0xe0ae[_0x512973];return _0x32f2e1;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xee0a('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x401526){var _0x49a5e2=['ne'];try{var _0x42f3f6=JSON['parse'](_0x401526);var _0x32cc3e=Object[_0xee0a('0x1')](_0x42f3f6)[0x0];return _0x49a5e2['includes'](_0x32cc3e);}catch(_0x13a94a){return![];}}function getOperatorValue(_0x4d393b){var _0x5bef07=JSON[_0xee0a('0x2')](_0x4d393b);var _0x1c5071=Object[_0xee0a('0x1')](_0x5bef07)[0x0];var _0x344355=_0x5bef07[_0x1c5071];return{['$'+_0x1c5071]:_0x344355};}exports['fields']=function(_0x2296b9){var _0x49d436=null;if(_0x2296b9){_0x49d436=_0x2296b9['split'](',');}return _0x49d436;};exports[_0xee0a('0x3')]=function(_0x3d0b3f,_0xbd4483){var _0x57d190={};if(!_[_0xee0a('0x4')](_0x3d0b3f)){_[_0xee0a('0x5')](_0x3d0b3f,function(_0x548eb7,_0x305987){try{if(_0xbd4483){var _0x4b3e49=_[_0xee0a('0x6')](_0xbd4483,{'name':_0x305987})||{};if(hasSequelizeOperator(_0x548eb7)){_0x57d190[_0x305987]=getOperatorValue(_0x548eb7);}else if(_0x4b3e49[_0xee0a('0x7')]==='DATE'&&_[_0xee0a('0x8')](_0x548eb7)){var _0x5c56d9=JSON[_0xee0a('0x2')](_0x548eb7);var _0x1f2e57={'$gte':moment(moment(_0x5c56d9['$gte'])['format'](_0xee0a('0x9')))[_0xee0a('0xa')]()[_0xee0a('0xb')](),'$lte':moment(moment(_0x5c56d9[_0xee0a('0xc')])[_0xee0a('0xb')]('YYYY-MM-DD'))[_0xee0a('0xa')]()[_0xee0a('0xd')](0x1,'s')['format']()};_0x57d190[_0x305987]=_0x1f2e57;}else if(_0x4b3e49[_0xee0a('0xe')]===_0xee0a('0xf')){_0x57d190[_0x305987]=_0x548eb7;}else{_0x57d190[_0x305987]=_[_0xee0a('0x10')](_0x548eb7)?_0x548eb7:JSON[_0xee0a('0x2')](_0x548eb7);}}else{_0x57d190[_0x305987]=_['isArray'](_0x548eb7)?_0x548eb7:JSON[_0xee0a('0x2')](_0x548eb7);}}catch(_0x1d7a8a){_0x57d190[_0x305987]=_0x548eb7[_0xee0a('0x11')](',');}});}return _0x57d190;};exports['limit']=function(_0x1c1be5){_0x1c1be5=parseInt(_0x1c1be5,0xa);if(!_0x1c1be5||_0x1c1be5<0x0){_0x1c1be5=LIMIT_VALUE;}return _0x1c1be5;};exports[_0xee0a('0x12')]=function(_0xe1f346){_0xe1f346=parseInt(_0xe1f346,0xa);if(!_0xe1f346||_0xe1f346<0x0){_0xe1f346=0x0;}return _0xe1f346;};exports[_0xee0a('0x13')]=function(_0x5d29e0){var _0xe9d5d4,_0x10c224=null;if(_0x5d29e0){_0xe9d5d4=_0x5d29e0[_0xee0a('0x11')](',');_0x10c224=_[_0xee0a('0x14')](_0xe9d5d4,function(_0x5c981e){if(_0x5c981e[_0xee0a('0x15')]('-')===0x0){return[_0x5c981e===_0xee0a('0x16')?sequelize[_0xee0a('0x17')](sequelize[_0xee0a('0x18')](_0xee0a('0x16')),_0xee0a('0x19')):_0x5c981e[_0xee0a('0x1a')](0x1),'DESC'];}else{return[_0x5c981e===_0xee0a('0x16')?sequelize[_0xee0a('0x17')](sequelize[_0xee0a('0x18')](_0xee0a('0x16')),'unsigned'):_0x5c981e,_0xee0a('0x1b')];}});}return _0x10c224;};exports[_0xee0a('0x1c')]=function(_0x1fe1a3,_0x2c414d){if(_['isEmpty'](_0x1fe1a3)){return _0x1fe1a3;}if(_['isArray'](_0x1fe1a3)){for(var _0x578ecf=0x0;_0x578ecf<_0x1fe1a3[_0xee0a('0x1d')];_0x578ecf+=0x1){_0x1fe1a3[_0x578ecf]=this['omit'](_0x1fe1a3[_0x578ecf],_0x2c414d);}return _0x1fe1a3;}if(!_['isObject'](_0x1fe1a3)){return _0x1fe1a3;}if(_[_0xee0a('0x1e')](_0x2c414d)){_0x2c414d=[_0x2c414d];}if(!_[_0xee0a('0x10')](_0x2c414d)){return _0x1fe1a3;}for(var _0xe5365f=0x0;_0xe5365f<_0x2c414d['length'];_0xe5365f+=0x1){_[_0xee0a('0x1f')](_0x1fe1a3,_0x2c414d[_0xe5365f]);}for(var _0xe14449 in _0x1fe1a3){if(_0x1fe1a3[_0xee0a('0x20')](_0xe14449)){_0x1fe1a3[_0xe14449]=this[_0xee0a('0x1c')](_0x1fe1a3[_0xe14449],_0x2c414d);}}return _0x1fe1a3;};exports[_0xee0a('0x21')]=function(_0x45538d){return _0x45538d[_0xee0a('0x22')](RegExp(_0xee0a('0x23')))?!![]:![];};exports[_0xee0a('0x24')]=function(_0x7b472b){return _0x7b472b['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xee0a('0x25')]=function(_0x1a97e0){var _0x284be5=[];_0x1a97e0[_0xee0a('0x11')](/[ ,]+/)[_0xee0a('0x26')](function(_0x3faad3){_0x3faad3=_0x3faad3['replace'](/([^:]")"+/g,'$1');_0x3faad3='+'+_0x3faad3+'*';var _0x339a0=/[ `!@#$%^&*()_\-?~]/;if(_0x3faad3[_0xee0a('0x22')](_0x339a0))_0x3faad3='\x22'+_0x3faad3+'\x22';_0x284be5[_0xee0a('0x27')](_0x3faad3);});return _0x284be5[_0xee0a('0x28')]('\x20');};exports['getOptions']=function(_0x354dff,_0x55e328,_0x192bc6){var _0x2419d7={},_0x3d6de4={};if(_0x55e328[_0xee0a('0x29')][_0xee0a('0x2a')]){_0x55e328[_0xee0a('0x29')]['id']=_0x55e328[_0xee0a('0x29')][_0xee0a('0x2a')];delete _0x55e328['query'][_0xee0a('0x2a')];}_0x2419d7[_0xee0a('0x2b')]=_['map'](_0x354dff,_0xee0a('0xe'));_0x2419d7[_0xee0a('0x29')]=_[_0xee0a('0x1')](_0x55e328['query']);_0x2419d7[_0xee0a('0x3')]=_[_0xee0a('0x2c')](_0x2419d7[_0xee0a('0x2b')],_0x2419d7['query']);_0x3d6de4[_0xee0a('0x2d')]=_[_0xee0a('0x2c')](_0x2419d7[_0xee0a('0x2b')],this['fields'](_0x55e328['query'][_0xee0a('0x2e')]));_0x3d6de4[_0xee0a('0x2d')]=_0x3d6de4[_0xee0a('0x2d')][_0xee0a('0x1d')]?_0x3d6de4[_0xee0a('0x2d')]:_0x2419d7[_0xee0a('0x2b')];if(!_0x55e328[_0xee0a('0x29')][_0xee0a('0x20')](_0xee0a('0x2f'))){_0x3d6de4['limit']=this[_0xee0a('0x30')](_0x55e328[_0xee0a('0x29')]['limit']);_0x3d6de4[_0xee0a('0x12')]=this[_0xee0a('0x12')](_0x55e328['query'][_0xee0a('0x12')]);}_0x3d6de4[_0xee0a('0x31')]=this[_0xee0a('0x13')](_0x55e328[_0xee0a('0x29')][_0xee0a('0x13')]);_0x3d6de4[_0xee0a('0x32')]=this[_0xee0a('0x3')](_[_0xee0a('0x33')](_0x55e328[_0xee0a('0x29')],_0x2419d7['filters']),_0x354dff);if(_0x55e328[_0xee0a('0x29')][_0xee0a('0x34')]){var _0x41eba8=_0x354dff;var _0xf3efee=_0x55e328['query']['filter'];if(typeof _0xf3efee===_0xee0a('0x35')){_0x41eba8=_[_0xee0a('0x34')](_0x354dff,function(_0x581c64){return _[_0xee0a('0x36')](_0xf3efee[_0xee0a('0x37')],_0x581c64[_0xee0a('0xe')]);});_0xf3efee=_0xf3efee[_0xee0a('0x38')];}_0x3d6de4['where']=_['merge'](_0x3d6de4[_0xee0a('0x32')],{'$or':_[_0xee0a('0x14')](_0x41eba8,function(_0x587ee3){if(_0x587ee3[_0xee0a('0x7')]!==_0xee0a('0x39')){if(_0x192bc6){return sequelize['where'](sequelize['fn'](_0xee0a('0x3a'),sequelize[_0xee0a('0x18')](_0x587ee3[_0xee0a('0xe')])),{'$like':sequelize['fn'](_0xee0a('0x3a'),'%'+_0x55e328[_0xee0a('0x29')][_0xee0a('0x34')]+'%')});}else{var _0xfe45={};_0xfe45[_0x587ee3['name']]={'$like':'%'+_0x55e328['query'][_0xee0a('0x34')]+'%'};return _0xfe45;}}})});}_0x3d6de4=_['merge']({},_0x3d6de4,_0x55e328['options']);return _0x3d6de4;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index d51d852..8083963 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41df=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','map','findOne','all','flatten','uniq','value','filter','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','faxPause','find','globalStatus','catch','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','lodash','jayson/promise','client','http','chatPause','mailPause','openchannelPause','smsPause','whatsappPause','every','length','idle','isNil','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result'];(function(_0x3dc06d,_0x34ec1b){var _0x560f2b=function(_0x22a3d7){while(--_0x22a3d7){_0x3dc06d['push'](_0x3dc06d['shift']());}};_0x560f2b(++_0x34ec1b);}(_0x41df,0x14a));var _0xf41d=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x41df[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0xf41d('0x0'));var jayson=require(_0xf41d('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf41d('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xf41d('0x2')][_0xf41d('0x3')]({'port':0x232c});function isAgentPaused(_0x2dc4a3,_0x3149d6){var _0x33fad3=[_0x2dc4a3[_0xf41d('0x4')],_0x2dc4a3['faxPause'],_0x2dc4a3[_0xf41d('0x5')],_0x2dc4a3[_0xf41d('0x6')],_0x2dc4a3[_0xf41d('0x7')],_0x2dc4a3['voicePause'],_0x2dc4a3[_0xf41d('0x8')]];if(!_0x3149d6)return _[_0xf41d('0x9')](_0x33fad3);var _0x5e9546=_['filter'](_0x33fad3);return _0x5e9546[_0xf41d('0xa')]>0x0&&_0x5e9546[_0xf41d('0xa')]<_0x33fad3[_0xf41d('0xa')]?!![]:![];}function isIdle(_0x50e303){return _0x50e303===_0xf41d('0xb')||_0x50e303==='unknown'||_0x50e303==='unavailable'||_0x50e303==='ringing'||_[_0xf41d('0xc')](_0x50e303);}function isAgentIdle(_0x4b53d9){if(_0x4b53d9[_0xf41d('0xd')]!==_0xf41d('0xb')&&_0x4b53d9[_0xf41d('0xe')]){_0x4b53d9[_0xf41d('0xd')]=_0xf41d('0xf');return![];}return _['every']([_0x4b53d9[_0xf41d('0x10')],_0x4b53d9[_0xf41d('0x11')],_0x4b53d9[_0xf41d('0x12')],_0x4b53d9[_0xf41d('0x13')],_0x4b53d9[_0xf41d('0x14')],_0x4b53d9['voiceStatus'],_0x4b53d9['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xf41d('0x15')]('Agents',{})[_0xf41d('0x16')](function(_0x4b32da){if(_0x4b32da[_0xf41d('0x17')]){throw new Error(_0xf41d('0x18'));}var _0x165c3d=_0x4b32da[_0xf41d('0x19')];return routingClient[_0xf41d('0x15')]('Agents',{})['then'](function(_0xf22aff){if(_0xf22aff[_0xf41d('0x17')]){throw new Error(_0xf41d('0x1a'));}var _0x2b0a91=_0xf22aff[_0xf41d('0x19')];return _[_0xf41d('0x1b')]({},_0x165c3d,_0x2b0a91);});})['catch'](function(_0x58e4f6){throw _0x58e4f6;});}exports[_0xf41d('0x1c')]=getRealtimeAgents;function getAgentStatus(_0xa8f7ee){var _0x49be93='unknown';if(isAgentPaused(_0xa8f7ee))_0x49be93=_0xf41d('0xf');else if(isAgentPaused(_0xa8f7ee,!![]))_0x49be93=_0xf41d('0x1d');else if(isAgentIdle(_0xa8f7ee))_0x49be93='idle';else _0x49be93=_0xf41d('0x1e');return _0x49be93;}exports[_0xf41d('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x19a2bb,_0x558b13){var _0x15647d=_[_0xf41d('0x20')](_0x19a2bb)?_0x19a2bb:[_0x19a2bb];var _0x5818c9=_[_0xf41d('0x21')](_0x558b13)+'Queue';var _0x33601c=_[_0xf41d('0x22')](_0x15647d,function(_0x5ea24f){return db[_0x5818c9][_0xf41d('0x23')]({'where':{'id':_0x5ea24f}})[_0xf41d('0x16')](function(_0x7e0418){if(!_0x7e0418)return[];return _0x7e0418['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf41d('0x24')](_0x33601c)['then'](function(_0x414a38){var _0x399029=_(_0x414a38)[_0xf41d('0x25')]()[_0xf41d('0x22')]('id')[_0xf41d('0x26')]()[_0xf41d('0x27')]();return _0x399029;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x55166c,_0x31637c,_0x3a6a84){try{if(_0x31637c[_0xf41d('0xa')]>0x0){_0x55166c=_0x55166c[_0xf41d('0x28')](function(_0x38146e){return _0x31637c['includes'](_0x38146e['id']);});}var _0x3bedf1=_0x55166c[_0xf41d('0x28')](function(_0x43da87){var _0x38e479=_0xf41d('0x1e');if(isAgentIdle(_0x43da87)){_0x38e479=_0xf41d('0xb');}return _0x38e479===_0x3a6a84;});return _[_0xf41d('0x22')](_0x3bedf1,'id');}catch(_0x47ec05){throw _0x47ec05;}}exports[_0xf41d('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4a5a6e,_0x5bcae4,_0x431942){return Promise[_0xf41d('0x2a')]()[_0xf41d('0x16')](function(){if(_0x5bcae4[_0xf41d('0xa')]>0x0){_0x4a5a6e=_0x4a5a6e['filter'](function(_0x4e96e5){return _0x5bcae4[_0xf41d('0x2b')](_0x4e96e5['id']);});}return _0x4a5a6e;})[_0xf41d('0x16')](function(){return db[_0xf41d('0x2c')][_0xf41d('0x2d')]({'attributes':['id',_0xf41d('0x2e'),_0xf41d('0x2f'),_0xf41d('0x4'),_0xf41d('0x30'),'mailPause','openchannelPause','smsPause',_0xf41d('0xe'),_0xf41d('0x8'),'pauseType'],'where':{'id':{'$in':_['map'](_0x4a5a6e,'id')}},'raw':!![]});})[_0xf41d('0x16')](function(_0x26c733){return _0x26c733[_0xf41d('0x22')](function(_0xc26ba8){var _0x593953=_[_0xf41d('0x31')](_0x4a5a6e,['id',_0xc26ba8['id']]);var _0x9e3be3=filterAgentAttributes(_0x593953);_[_0xf41d('0x1b')](_0xc26ba8,_0x9e3be3);_0xc26ba8[_0xf41d('0x32')]=getAgentStatus(_0xc26ba8);return _0xc26ba8;});})[_0xf41d('0x16')](function(_0x52d8d7){var _0x12ed67=sortAgentsByStatus(_0x52d8d7,_0x431942);return _[_0xf41d('0x22')](_0x12ed67,'id');})[_0xf41d('0x33')](function(_0x499eaf){throw _0x499eaf;});}exports[_0xf41d('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x101511){var _0x3ece78={'fields':[],'order':null};var _0x28a875=_0x101511['split'](',');_0x3ece78[_0xf41d('0x35')]=_[_0xf41d('0x28')](_0x28a875,function(_0x2b60bf){if(!_0x2b60bf[_0xf41d('0x2b')]('globalStatus')){return!![];}_0x3ece78[_0xf41d('0x36')]=_[_0xf41d('0x37')](_0x2b60bf,'-')?_0xf41d('0x38'):'ASC';return![];});return _0x3ece78;}exports[_0xf41d('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x26f9b9){if(_0x26f9b9[_0xf41d('0x2b')]('fullname')&&!_0x26f9b9[_0xf41d('0x2b')](_0xf41d('0x3a'))){var _0x9cadc4=_0x26f9b9['substring'](0x0,_0x26f9b9[_0xf41d('0x3b')](_0xf41d('0x2f')));_0x26f9b9+=','+_0x9cadc4+'internal';}return _0x26f9b9;}exports[_0xf41d('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x17fee3,_0x42d268){var _0x2d6bbc=_0x17fee3[_0xf41d('0x3d')](function(_0x4425b7,_0x45fb64){if(_0x4425b7['globalStatus']===_0x45fb64['globalStatus']){if(_0x4425b7['globalStatus']==='pause'){if(_0x42d268===_0xf41d('0x38')){return(_0x4425b7[_0xf41d('0x3e')]||'')<(_0x45fb64[_0xf41d('0x3e')]||'')||_0x4425b7[_0xf41d('0x2f')][_0xf41d('0x3f')]()>_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?0x1:-0x1;}else{return(_0x4425b7[_0xf41d('0x3e')]||'')<(_0x45fb64['pauseType']||'')||_0x4425b7[_0xf41d('0x2f')]['toLowerCase']()>_0x45fb64[_0xf41d('0x2f')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x42d268===_0xf41d('0x38')){return _0x4425b7[_0xf41d('0x2f')]['toLowerCase']()<_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?0x1:-0x1;}else{return _0x4425b7[_0xf41d('0x2f')][_0xf41d('0x3f')]()<_0x45fb64[_0xf41d('0x2f')][_0xf41d('0x3f')]()?-0x1:0x1;}}}else{if(_0x42d268===_0xf41d('0x38')){return _0x4425b7[_0xf41d('0x32')]<_0x45fb64[_0xf41d('0x32')]?0x1:-0x1;}else{return _0x4425b7[_0xf41d('0x32')]<_0x45fb64[_0xf41d('0x32')]?-0x1:0x1;}}});return _0x2d6bbc;}exports[_0xf41d('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x207154){var _0x142cda=['userpic',_0xf41d('0x41'),_0xf41d('0x42'),'lastPauseAt','pauseType',_0xf41d('0x43'),_0xf41d('0x3a'),'address',_0xf41d('0x4'),_0xf41d('0x6'),'mailPause',_0xf41d('0x7'),_0xf41d('0x8'),_0xf41d('0x30'),_0xf41d('0xe'),_0xf41d('0x44'),_0xf41d('0x45'),'mailCapacity',_0xf41d('0x46'),_0xf41d('0x47'),_0xf41d('0x48'),_0xf41d('0x49'),'openchannelCurrentCapacity','mailCurrentCapacity',_0xf41d('0x4a'),_0xf41d('0x4b'),_0xf41d('0x4c'),_0xf41d('0x10'),_0xf41d('0x13'),_0xf41d('0x12'),'smsStatus',_0xf41d('0x4d'),_0xf41d('0x11'),_0xf41d('0xd'),'chatStatusTime',_0xf41d('0x4e'),_0xf41d('0x4f'),_0xf41d('0x50'),_0xf41d('0x51'),_0xf41d('0x52'),_0xf41d('0x53'),_0xf41d('0x54'),'destconnectedlinenum',_0xf41d('0x55'),_0xf41d('0x56'),_0xf41d('0x57'),_0xf41d('0x58')];var _0x25a2d4=[_0xf41d('0x4'),'openchannelPause',_0xf41d('0x5'),_0xf41d('0x7'),_0xf41d('0x8'),_0xf41d('0x30'),_0xf41d('0xe'),_0xf41d('0x41')];var _0x709cbf=_(_0x207154)['omit'](_0x25a2d4)['pick'](_0x142cda)[_0xf41d('0x27')]();return _0x709cbf;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x0164=['faxPause','mailPause','openchannelPause','voicePause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','result','request','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','map','findOne','getAgents','all','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','chatPause','smsPause','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','whatsappPause','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','http'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0164,0x160));var _0x4016=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x0164[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x4016('0x0'));var jayson=require(_0x4016('0x1'));var db=require(_0x4016('0x2'))['db'];var amiClient=jayson['client'][_0x4016('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x4016('0x3')]({'port':0x232c});function isAgentPaused(_0x407b78,_0x42c678){var _0x216d60=[_0x407b78['chatPause'],_0x407b78[_0x4016('0x4')],_0x407b78[_0x4016('0x5')],_0x407b78[_0x4016('0x6')],_0x407b78['smsPause'],_0x407b78[_0x4016('0x7')],_0x407b78['whatsappPause']];if(!_0x42c678)return _['every'](_0x216d60);var _0x34f543=_[_0x4016('0x8')](_0x216d60);return _0x34f543[_0x4016('0x9')]>0x0&&_0x34f543[_0x4016('0x9')]<_0x216d60[_0x4016('0x9')]?!![]:![];}function isIdle(_0x5382a0){return _0x5382a0===_0x4016('0xa')||_0x5382a0===_0x4016('0xb')||_0x5382a0===_0x4016('0xc')||_0x5382a0===_0x4016('0xd')||_[_0x4016('0xe')](_0x5382a0);}function isAgentIdle(_0x3a8bfa){if(_0x3a8bfa[_0x4016('0xf')]!==_0x4016('0xa')&&_0x3a8bfa[_0x4016('0x7')]){_0x3a8bfa[_0x4016('0xf')]=_0x4016('0x10');return![];}return _['every']([_0x3a8bfa['chatStatus'],_0x3a8bfa[_0x4016('0x11')],_0x3a8bfa[_0x4016('0x12')],_0x3a8bfa[_0x4016('0x13')],_0x3a8bfa[_0x4016('0x14')],_0x3a8bfa['voiceStatus'],_0x3a8bfa[_0x4016('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x4016('0x16'),{})[_0x4016('0x17')](function(_0x5ea5c9){if(_0x5ea5c9[_0x4016('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0xf1ca1a=_0x5ea5c9[_0x4016('0x19')];return routingClient[_0x4016('0x1a')](_0x4016('0x16'),{})[_0x4016('0x17')](function(_0x38891e){if(_0x38891e[_0x4016('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x43c96b=_0x38891e[_0x4016('0x19')];return _[_0x4016('0x1b')]({},_0xf1ca1a,_0x43c96b);});})[_0x4016('0x1c')](function(_0x2fc52f){throw _0x2fc52f;});}exports[_0x4016('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x22d184){var _0x3b8921=_0x4016('0xb');if(isAgentPaused(_0x22d184))_0x3b8921=_0x4016('0x10');else if(isAgentPaused(_0x22d184,!![]))_0x3b8921='*pause';else if(isAgentIdle(_0x22d184))_0x3b8921='idle';else _0x3b8921=_0x4016('0x1e');return _0x3b8921;}exports[_0x4016('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x5c357d,_0x1fd797){var _0x262af6=_[_0x4016('0x20')](_0x5c357d)?_0x5c357d:[_0x5c357d];var _0x3124bf=_[_0x4016('0x21')](_0x1fd797)+'Queue';var _0x5772e0=_[_0x4016('0x22')](_0x262af6,function(_0x26d710){return db[_0x3124bf][_0x4016('0x23')]({'where':{'id':_0x26d710}})[_0x4016('0x17')](function(_0x240bc1){if(!_0x240bc1)return[];return _0x240bc1[_0x4016('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x4016('0x25')](_0x5772e0)[_0x4016('0x17')](function(_0xf190dd){var _0x591bce=_(_0xf190dd)['flatten']()['map']('id')[_0x4016('0x26')]()[_0x4016('0x27')]();return _0x591bce;});}exports[_0x4016('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x37273c,_0x19ac7,_0x190a57){try{if(_0x19ac7[_0x4016('0x9')]>0x0){_0x37273c=_0x37273c['filter'](function(_0x1a5de2){return _0x19ac7[_0x4016('0x29')](_0x1a5de2['id']);});}var _0x525d7e=_0x37273c['filter'](function(_0x5b9230){var _0x42dee8=_0x4016('0x1e');if(isAgentIdle(_0x5b9230)){_0x42dee8=_0x4016('0xa');}return _0x42dee8===_0x190a57;});return _['map'](_0x525d7e,'id');}catch(_0x5212e6){throw _0x5212e6;}}exports[_0x4016('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2bd7a3,_0xfcfa7,_0x15d0f1){return Promise[_0x4016('0x2b')]()['then'](function(){if(_0xfcfa7[_0x4016('0x9')]>0x0){_0x2bd7a3=_0x2bd7a3[_0x4016('0x8')](function(_0x497976){return _0xfcfa7[_0x4016('0x29')](_0x497976['id']);});}return _0x2bd7a3;})[_0x4016('0x17')](function(){return db[_0x4016('0x2c')][_0x4016('0x2d')]({'attributes':['id',_0x4016('0x2e'),_0x4016('0x2f'),_0x4016('0x30'),'faxPause','mailPause',_0x4016('0x6'),_0x4016('0x31'),'voicePause','whatsappPause','pauseType'],'where':{'id':{'$in':_[_0x4016('0x22')](_0x2bd7a3,'id')}},'raw':!![]});})[_0x4016('0x17')](function(_0x138185){return _0x138185[_0x4016('0x22')](function(_0x26b213){var _0x279c15=_[_0x4016('0x32')](_0x2bd7a3,['id',_0x26b213['id']]);var _0x91a0ee=filterAgentAttributes(_0x279c15);_['merge'](_0x26b213,_0x91a0ee);_0x26b213[_0x4016('0x33')]=getAgentStatus(_0x26b213);return _0x26b213;});})['then'](function(_0x8e4517){var _0x436adb=sortAgentsByStatus(_0x8e4517,_0x15d0f1);return _[_0x4016('0x22')](_0x436adb,'id');})[_0x4016('0x1c')](function(_0x2490b5){throw _0x2490b5;});}exports[_0x4016('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x22b9c0){var _0x15d845={'fields':[],'order':null};var _0x4e7473=_0x22b9c0[_0x4016('0x35')](',');_0x15d845[_0x4016('0x36')]=_[_0x4016('0x8')](_0x4e7473,function(_0x46b105){if(!_0x46b105[_0x4016('0x29')](_0x4016('0x33'))){return!![];}_0x15d845[_0x4016('0x37')]=_[_0x4016('0x38')](_0x46b105,'-')?_0x4016('0x39'):_0x4016('0x3a');return![];});return _0x15d845;}exports[_0x4016('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x5ee115){if(_0x5ee115[_0x4016('0x29')]('fullname')&&!_0x5ee115[_0x4016('0x29')](_0x4016('0x3c'))){var _0x5b597e=_0x5ee115[_0x4016('0x3d')](0x0,_0x5ee115[_0x4016('0x3e')](_0x4016('0x2f')));_0x5ee115+=','+_0x5b597e+_0x4016('0x3c');}return _0x5ee115;}exports[_0x4016('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x4e7370,_0x404301){var _0x4af13d=_0x4e7370['sort'](function(_0x4b2d49,_0x2876f9){if(_0x4b2d49['globalStatus']===_0x2876f9[_0x4016('0x33')]){if(_0x4b2d49[_0x4016('0x33')]===_0x4016('0x10')){if(_0x404301===_0x4016('0x39')){return(_0x4b2d49[_0x4016('0x40')]||'')<(_0x2876f9['pauseType']||'')||_0x4b2d49['fullname'][_0x4016('0x41')]()>_0x2876f9[_0x4016('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return(_0x4b2d49['pauseType']||'')<(_0x2876f9[_0x4016('0x40')]||'')||_0x4b2d49[_0x4016('0x2f')][_0x4016('0x41')]()>_0x2876f9['fullname'][_0x4016('0x41')]()?-0x1:0x1;}}else{if(_0x404301==='DESC'){return _0x4b2d49[_0x4016('0x2f')][_0x4016('0x41')]()<_0x2876f9[_0x4016('0x2f')][_0x4016('0x41')]()?0x1:-0x1;}else{return _0x4b2d49[_0x4016('0x2f')][_0x4016('0x41')]()<_0x2876f9[_0x4016('0x2f')][_0x4016('0x41')]()?-0x1:0x1;}}}else{if(_0x404301==='DESC'){return _0x4b2d49['globalStatus']<_0x2876f9[_0x4016('0x33')]?0x1:-0x1;}else{return _0x4b2d49[_0x4016('0x33')]<_0x2876f9[_0x4016('0x33')]?-0x1:0x1;}}});return _0x4af13d;}exports[_0x4016('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x86db59){var _0x230205=[_0x4016('0x43'),_0x4016('0x44'),_0x4016('0x45'),'lastPauseAt','pauseType',_0x4016('0x46'),'internal','address',_0x4016('0x30'),'openchannelPause','mailPause',_0x4016('0x31'),_0x4016('0x47'),_0x4016('0x4'),_0x4016('0x7'),'chatCapacity','openchannelCapacity',_0x4016('0x48'),_0x4016('0x49'),_0x4016('0x4a'),'faxCapacity',_0x4016('0x4b'),'openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity',_0x4016('0x4c'),_0x4016('0x13'),'mailStatus','smsStatus',_0x4016('0x15'),'faxStatus',_0x4016('0xf'),_0x4016('0x4d'),_0x4016('0x4e'),_0x4016('0x4f'),'smsStatusTime',_0x4016('0x50'),_0x4016('0x51'),_0x4016('0x52'),'queue',_0x4016('0x53'),_0x4016('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x4016('0x55'),'routealias'];var _0x1508c7=[_0x4016('0x30'),_0x4016('0x6'),_0x4016('0x5'),_0x4016('0x31'),_0x4016('0x47'),_0x4016('0x4'),_0x4016('0x7'),_0x4016('0x44')];var _0x144522=_(_0x86db59)[_0x4016('0x56')](_0x1508c7)[_0x4016('0x57')](_0x230205)['value']();return _0x144522;}exports[_0x4016('0x58')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index e35301d..ec282d6 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5d6725,_0x3f6ef9){var _0x275399=function(_0x133ac1){while(--_0x133ac1){_0x5d6725['push'](_0x5d6725['shift']());}};_0x275399(++_0x3f6ef9);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index ac7e4d1..09053bc 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 _0x7ce6=['platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','md5','update','digest','hex','getUuid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ce6,0x109));var _0x67ce=function(_0x49a59d,_0x494d0d){_0x49a59d=_0x49a59d-0x0;var _0x255d19=_0x7ce6[_0x49a59d];return _0x255d19;};'use strict';var _=require(_0x67ce('0x0'));var os=require('os');var crypto=require(_0x67ce('0x1'));var machine=require(_0x67ce('0x2'));var exec=require(_0x67ce('0x3'))[_0x67ce('0x4')];var config=require(_0x67ce('0x5'));function getInterfaces(){var _0x68b49c=[];var _0x44bc18=os[_0x67ce('0x6')]();var _0x4d5176=_['orderBy'](_['keys'](_0x44bc18));for(var _0x43ed18=0x0;_0x43ed18<_0x4d5176['length'];_0x43ed18++){var _0x1b94bf=_0x44bc18[_0x4d5176[_0x43ed18]]['filter'](function(_0x1cf318){return _0x1cf318['family']==='IPv4'&&_0x1cf318[_0x67ce('0x7')]===![];});_0x68b49c=_0x68b49c[_0x67ce('0x8')](_0x1b94bf);}return _0x68b49c;}function getFirstInterface(){var _0x3d5206=_['head'](getInterfaces());return{'macAddress':_0x3d5206&&_0x3d5206[_0x67ce('0x9')]?_0x3d5206['mac']:_0x67ce('0xa'),'ipAddress':_0x3d5206&&_0x3d5206[_0x67ce('0xb')]?_0x3d5206[_0x67ce('0xb')]:'127.0.0.1'};}exports[_0x67ce('0xc')]=getFirstInterface;function getCPUhash(){var _0x192986=_[_0x67ce('0xd')](os[_0x67ce('0xe')]()[_0x67ce('0xf')](function(_0x29adee){return _0x29adee[_0x67ce('0x10')];}))[_0x67ce('0x11')](':');return crypto['createHash'](_0x67ce('0x12'))[_0x67ce('0x13')](_0x192986)[_0x67ce('0x14')](_0x67ce('0x15'));}exports[_0x67ce('0x16')]=function(){var _0x5dbf73=os[_0x67ce('0x17')]();var _0x100209=/[0-9a-f-]{36}/;if(config[_0x67ce('0x18')]&&_0x100209[_0x67ce('0x19')](config['licenseToken'])){return config[_0x67ce('0x18')];}else if(_0x5dbf73===_0x67ce('0x1a')){return exec(_0x67ce('0x1b'),{'encoding':_0x67ce('0x1c')})[_0x67ce('0x1d')]('\x0d\x0a','');}else{var _0x526a7d=getFirstInterface();var _0x154453=getCPUhash();var _0xe5cdf=_0x154453+'|'+os['hostname']()+'|'+_0x526a7d['macAddress']+'|'+_0x526a7d['ipAddress'];var _0x238060=crypto[_0x67ce('0x1e')](_0x67ce('0x12'))[_0x67ce('0x13')](_0xe5cdf)[_0x67ce('0x14')](_0x67ce('0x15'));return _0x238060['substring'](0x0,0x8)+'-'+_0x238060[_0x67ce('0x1f')](0x8,0xc)+'-'+_0x238060[_0x67ce('0x1f')](0xc,0x10)+'-'+_0x238060[_0x67ce('0x1f')](0x10,0x14)+'-'+_0x238060['substring'](0x14);}}; \ No newline at end of file +var _0x540a=['cpus','map','model','createHash','md5','update','hex','licenseToken','win32','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','child_process','../environment','orderBy','length','filter','family','internal','concat','head','mac','address','getFirstInterface'];(function(_0x165ecd,_0xc5fb40){var _0x4db9be=function(_0x2edf56){while(--_0x2edf56){_0x165ecd['push'](_0x165ecd['shift']());}};_0x4db9be(++_0xc5fb40);}(_0x540a,0x10a));var _0xa540=function(_0x19a1e4,_0x1de22f){_0x19a1e4=_0x19a1e4-0x0;var _0x4c2e2b=_0x540a[_0x19a1e4];return _0x4c2e2b;};'use strict';var _=require(_0xa540('0x0'));var os=require('os');var crypto=require(_0xa540('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xa540('0x2'))['execSync'];var config=require(_0xa540('0x3'));function getInterfaces(){var _0x505b2e=[];var _0x349f16=os['networkInterfaces']();var _0x2cd715=_[_0xa540('0x4')](_['keys'](_0x349f16));for(var _0x1ad965=0x0;_0x1ad965<_0x2cd715[_0xa540('0x5')];_0x1ad965++){var _0xac5ca3=_0x349f16[_0x2cd715[_0x1ad965]][_0xa540('0x6')](function(_0x4f6154){return _0x4f6154[_0xa540('0x7')]==='IPv4'&&_0x4f6154[_0xa540('0x8')]===![];});_0x505b2e=_0x505b2e[_0xa540('0x9')](_0xac5ca3);}return _0x505b2e;}function getFirstInterface(){var _0xece7a0=_[_0xa540('0xa')](getInterfaces());return{'macAddress':_0xece7a0&&_0xece7a0[_0xa540('0xb')]?_0xece7a0[_0xa540('0xb')]:'00:00:00:00:00:00','ipAddress':_0xece7a0&&_0xece7a0[_0xa540('0xc')]?_0xece7a0['address']:'127.0.0.1'};}exports[_0xa540('0xd')]=getFirstInterface;function getCPUhash(){var _0xaa435e=_[_0xa540('0x4')](os[_0xa540('0xe')]()[_0xa540('0xf')](function(_0x4e2372){return _0x4e2372[_0xa540('0x10')];}))['join'](':');return crypto[_0xa540('0x11')](_0xa540('0x12'))[_0xa540('0x13')](_0xaa435e)['digest'](_0xa540('0x14'));}exports['getUuid']=function(){var _0x248be9=os['platform']();var _0x6eebc9=/[0-9a-f-]{36}/;if(config[_0xa540('0x15')]&&_0x6eebc9['test'](config[_0xa540('0x15')])){return config[_0xa540('0x15')];}else if(_0x248be9===_0xa540('0x16')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xa540('0x17')]('\x0d\x0a','');}else{var _0x41df9e=getFirstInterface();var _0x45f2d6=getCPUhash();var _0x2de28b=_0x45f2d6+'|'+os[_0xa540('0x18')]()+'|'+_0x41df9e[_0xa540('0x19')]+'|'+_0x41df9e[_0xa540('0x1a')];var _0x593c15=crypto[_0xa540('0x11')](_0xa540('0x12'))['update'](_0x2de28b)['digest'](_0xa540('0x14'));return _0x593c15[_0xa540('0x1b')](0x0,0x8)+'-'+_0x593c15[_0xa540('0x1b')](0x8,0xc)+'-'+_0x593c15[_0xa540('0x1b')](0xc,0x10)+'-'+_0x593c15[_0xa540('0x1b')](0x10,0x14)+'-'+_0x593c15['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 6b946bc..9e8cfa3 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 _0x65c2=['exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid','License','spread','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','license'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x65c2,0x108));var _0x265c=function(_0x3f4683,_0x4062f9){_0x3f4683=_0x3f4683-0x0;var _0x1a80aa=_0x65c2[_0x3f4683];return _0x1a80aa;};'use strict';var util=require(_0x265c('0x0'));var moment=require(_0x265c('0x1'));var rp=require(_0x265c('0x2'));var BPromise=require(_0x265c('0x3'));var pkginfo=require(_0x265c('0x4'))(module,_0x265c('0x5'));var db=require(_0x265c('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x265c('0x7'));var logger=require('../logger')(_0x265c('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4eb61d){return new BPromise(function(_0x406468,_0x250ad4){var _0x1ce50a=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x4eb61d,module[_0x265c('0x9')]['version']);if(oldToken){_0x1ce50a=util[_0x265c('0xa')](_0x265c('0xb'),HOST,_0x4eb61d,module['exports'][_0x265c('0x5')],oldToken);}var _0x461f83={'uri':_0x1ce50a,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x461f83)['then'](function(_0x1eeb3b){_0x406468(_0x1eeb3b);})[_0x265c('0xc')](function(_0x1da2ec){_0x250ad4(_0x1da2ec);});});}function manageLicense(_0x213e21,_0x59f7a6){var _0x499af1=_0x59f7a6[_0x265c('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x499af1[_0x265c('0xe')]!==_0x213e21&&!_0x499af1[_0x265c('0xf')]){oldToken=_0x499af1[_0x265c('0xe')];}httpRequest(_0x213e21)[_0x265c('0x10')](function(_0x46c1e9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x46c1e9[_0x265c('0x11')]){isOldTokenSent=![];if(!_0x499af1['license']&&_0x499af1[_0x265c('0x8')]!=_0x46c1e9[_0x265c('0x8')]||_0x499af1[_0x265c('0x8')]&&_0x499af1[_0x265c('0xf')]){logger[_0x265c('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x499af1[_0x265c('0x8')]&&!_0x499af1['data2']&&_0x499af1[_0x265c('0x8')]!=_0x46c1e9[_0x265c('0x8')]){logger[_0x265c('0x12')](_0x265c('0x13'));}if(_0x499af1[_0x265c('0x8')]&&!_0x499af1[_0x265c('0xf')]&&_0x499af1[_0x265c('0x8')]==_0x46c1e9[_0x265c('0x8')]){return _0x59f7a6;}return _0x59f7a6[_0x265c('0x14')]({'data1':_0x213e21,'data2':null,'license':_0x46c1e9[_0x265c('0x8')]});}else{if(_0x46c1e9[_0x265c('0x8')]||_0x499af1[_0x265c('0x8')]){if(!_0x499af1[_0x265c('0xf')]){if(_0x499af1['data1']==_0x213e21){GRAY_PERIOD_REASON=_0x265c('0x15');logger[_0x265c('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x265c('0x16');logger[_0x265c('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x499af1['data1'],_0x213e21);}logger['info'](_0x265c('0x17'),GRAY_PERIOD_REASON[_0x265c('0x18')](),moment()[_0x265c('0xa')](_0x265c('0x19')));return _0x59f7a6[_0x265c('0x14')]({'data2':encryptor[_0x265c('0x1a')](moment()[_0x265c('0xa')](_0x265c('0x19')))});}else{if(moment()[_0x265c('0x1b')](encryptor[_0x265c('0x1c')](_0x499af1['data2']),_0x265c('0x1d'))>DAYS){logger[_0x265c('0x12')](_0x265c('0x1e'),moment()[_0x265c('0xa')](_0x265c('0x19')));isOldTokenSent=![];return _0x59f7a6[_0x265c('0x14')]({'data1':_0x213e21,'data2':null,'license':null});}}}else{if(_0x499af1[_0x265c('0xe')]!=_0x213e21){logger[_0x265c('0x12')](_0x265c('0x1f'),_0x499af1[_0x265c('0xe')],_0x213e21);return _0x59f7a6[_0x265c('0x14')]({'data1':_0x213e21,'data2':null,'license':null});}}}return _0x59f7a6;})[_0x265c('0x10')](function(_0x102a09){_0x59f7a6=_0x102a09;})[_0x265c('0xc')](function(_0x14f677){logger[_0x265c('0x20')](_0x14f677['message']);})[_0x265c('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x59f7a6);},TIME);});}function defaultLicense(){var _0x2478cf=hardware[_0x265c('0x22')]();if(_0x2478cf){return db[_0x265c('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2478cf}})[_0x265c('0x24')](function(_0x1874fd,_0x346d87){logger[_0x265c('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2478cf);manageLicense(_0x2478cf,_0x1874fd);})[_0x265c('0xc')](function(_0x9bc5cd){logger['error'](_0x9bc5cd[_0x265c('0x25')]);});}}exports[_0x265c('0x26')]=defaultLicense; \ No newline at end of file +var _0x7357=['update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','bluebird','version','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7357,0x12b));var _0x7735=function(_0x5412d4,_0x398b70){_0x5412d4=_0x5412d4-0x0;var _0x25be83=_0x7357[_0x5412d4];return _0x25be83;};'use strict';var util=require(_0x7735('0x0'));var moment=require(_0x7735('0x1'));var rp=require('request-promise');var BPromise=require(_0x7735('0x2'));var pkginfo=require('pkginfo')(module,_0x7735('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x7735('0x4'));var hardware=require(_0x7735('0x5'));var logger=require('../logger')(_0x7735('0x6'));var HOST=_0x7735('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3f2eb8){return new BPromise(function(_0x24fd10,_0x579a70){var _0x43baa7=util[_0x7735('0x8')](_0x7735('0x9'),HOST,_0x3f2eb8,module[_0x7735('0xa')][_0x7735('0x3')]);if(oldToken){_0x43baa7=util[_0x7735('0x8')](_0x7735('0xb'),HOST,_0x3f2eb8,module[_0x7735('0xa')][_0x7735('0x3')],oldToken);}var _0xe4976d={'uri':_0x43baa7,'method':_0x7735('0xc'),'timeout':0xea60,'json':!![]};return rp(_0xe4976d)[_0x7735('0xd')](function(_0x588aed){_0x24fd10(_0x588aed);})[_0x7735('0xe')](function(_0x17f83f){_0x579a70(_0x17f83f);});});}function manageLicense(_0x2bbf36,_0x1600ff){var _0x6c28e=_0x1600ff[_0x7735('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x6c28e[_0x7735('0x10')]!==_0x2bbf36&&!_0x6c28e[_0x7735('0x11')]){oldToken=_0x6c28e['data1'];}httpRequest(_0x2bbf36)[_0x7735('0xd')](function(_0x24b6b2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x24b6b2[_0x7735('0x12')]){isOldTokenSent=![];if(!_0x6c28e[_0x7735('0x6')]&&_0x6c28e[_0x7735('0x6')]!=_0x24b6b2[_0x7735('0x6')]||_0x6c28e[_0x7735('0x6')]&&_0x6c28e['data2']){logger['info'](_0x7735('0x13'));}if(_0x6c28e['license']&&!_0x6c28e[_0x7735('0x11')]&&_0x6c28e[_0x7735('0x6')]!=_0x24b6b2[_0x7735('0x6')]){logger[_0x7735('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x6c28e[_0x7735('0x6')]&&!_0x6c28e['data2']&&_0x6c28e[_0x7735('0x6')]==_0x24b6b2[_0x7735('0x6')]){return _0x1600ff;}return _0x1600ff[_0x7735('0x15')]({'data1':_0x2bbf36,'data2':null,'license':_0x24b6b2[_0x7735('0x6')]});}else{if(_0x24b6b2[_0x7735('0x6')]||_0x6c28e[_0x7735('0x6')]){if(!_0x6c28e[_0x7735('0x11')]){if(_0x6c28e[_0x7735('0x10')]==_0x2bbf36){GRAY_PERIOD_REASON=_0x7735('0x16');logger[_0x7735('0x14')](_0x7735('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x7735('0x14')](_0x7735('0x18'),_0x6c28e[_0x7735('0x10')],_0x2bbf36);}logger[_0x7735('0x14')](_0x7735('0x19'),GRAY_PERIOD_REASON[_0x7735('0x1a')](),moment()[_0x7735('0x8')](_0x7735('0x1b')));return _0x1600ff[_0x7735('0x15')]({'data2':encryptor[_0x7735('0x1c')](moment()[_0x7735('0x8')](_0x7735('0x1b')))});}else{if(moment()[_0x7735('0x1d')](encryptor[_0x7735('0x1e')](_0x6c28e['data2']),'days')>DAYS){logger[_0x7735('0x14')](_0x7735('0x1f'),moment()[_0x7735('0x8')](_0x7735('0x1b')));isOldTokenSent=![];return _0x1600ff[_0x7735('0x15')]({'data1':_0x2bbf36,'data2':null,'license':null});}}}else{if(_0x6c28e[_0x7735('0x10')]!=_0x2bbf36){logger[_0x7735('0x14')](_0x7735('0x18'),_0x6c28e[_0x7735('0x10')],_0x2bbf36);return _0x1600ff[_0x7735('0x15')]({'data1':_0x2bbf36,'data2':null,'license':null});}}}return _0x1600ff;})[_0x7735('0xd')](function(_0x4bc587){_0x1600ff=_0x4bc587;})['catch'](function(_0x360c3e){logger['error'](_0x360c3e[_0x7735('0x20')]);})[_0x7735('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1600ff);},TIME);});}function defaultLicense(){var _0x338c7d=hardware[_0x7735('0x22')]();if(_0x338c7d){return db[_0x7735('0x23')][_0x7735('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x338c7d}})['spread'](function(_0x421c64,_0x5f2566){logger['info'](_0x7735('0x25'),_0x338c7d);manageLicense(_0x338c7d,_0x421c64);})[_0x7735('0xe')](function(_0x5b42b8){logger[_0x7735('0x26')](_0x5b42b8[_0x7735('0x20')]);});}}exports[_0x7735('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 983069f..f2da10a 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 _0x0293=['format','%s:%s:%s','parse','demo','uuid','machineUuid','decryptString','add','grayReason','changed','disabled','message','User','findAll','COUNT','sequelize','col','role','count','user','telephones','forEach','admin','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','exports','lodash','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','find','then','catch','data1','license','isEmpty','data2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0293,0x18d));var _0x3029=function(_0x231d36,_0x13e42f){_0x231d36=_0x231d36-0x0;var _0x25ed4f=_0x0293[_0x231d36];return _0x25ed4f;};'use strict';var util=require('util');var _=require(_0x3029('0x0'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x3029('0x1'));var encryptor=require(_0x3029('0x2'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3029('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x3029('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3029('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x3029('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5b7339){return new BPromise(function(_0x6c1643,_0x48f838){return db[_0x3029('0x5')][_0x3029('0x6')](_['defaults'](_0x5b7339,{'raw':!![],'where':{'id':0x1}}))[_0x3029('0x7')](function(_0x5c358e){return checkLicense(_0x5c358e,null);})[_0x3029('0x7')](function(_0x3b6d32){_0x6c1643(_0x3b6d32);return;})[_0x3029('0x8')](function(_0x1701f9){_0x48f838(_0x1701f9);});});}function checkLicense(_0x492b32,_0x5a22ce){if(!_0x492b32){demoLicense['uuid']=_0x492b32[_0x3029('0x9')];return demoLicense;}try{var _0x3cfff8=_0x5a22ce||_0x492b32[_0x3029('0xa')];if(_[_0x3029('0xb')](_0x3cfff8)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x359bbb=_0x492b32[_0x3029('0x9')];var _0x50a0ff=_0x492b32[_0x3029('0xc')];var _0x1e06f9=_0x359bbb['split']('-')[0x4];var _0x10df35=_0x359bbb['split']('-')[0x0];var _0x12918d=encryptor['decryptString'](_0x3cfff8,util[_0x3029('0xd')](_0x3029('0xe'),_0x1e06f9,_0x359bbb,_0x10df35));var _0x4c7410=JSON[_0x3029('0xf')](_0x12918d);_0x4c7410[_0x3029('0x10')]=![];_0x4c7410[_0x3029('0x11')]=_0x359bbb;_0x4c7410[_0x3029('0x12')]=hardware[_0x3029('0x4')]();if(_0x50a0ff){var _0x1163f3=encryptor[_0x3029('0x13')](_0x50a0ff);_0x4c7410['gray']=_0x1163f3;_0x4c7410['deadline']=moment(_0x1163f3)[_0x3029('0x14')](0x7,'days')[_0x3029('0xd')]();_0x4c7410[_0x3029('0x15')]=_0x4c7410[_0x3029('0x11')]!=_0x4c7410['machineUuid']?_0x3029('0x16'):_0x3029('0x17');}return _0x4c7410;}catch(_0x1eaf60){breakingLicense[_0x3029('0x11')]=_0x492b32['data1'];breakingLicense[_0x3029('0x18')]=_0x1eaf60['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xf55622,_0x2223a0){getLicense()[_0x3029('0x7')](function(_0x45ebd2){return db[_0x3029('0x19')][_0x3029('0x1a')]({'attributes':['role',[db['sequelize']['fn'](_0x3029('0x1b'),db[_0x3029('0x1c')][_0x3029('0x1d')](_0x3029('0x1e'))),_0x3029('0x1f')]],'group':_0x3029('0x1e'),'where':{'role':{'$or':['admin',_0x3029('0x20'),'telephone']}},'raw':!![]})['then'](function(_0x3f0491){var _0x167c56={'user':_0x45ebd2['users']||0x0,'telephone':_0x45ebd2[_0x3029('0x21')]||0x0};_0x3f0491[_0x3029('0x22')](function(_0xb240ae){var _0x1105b2=_0xb240ae[_0x3029('0x1e')]===_0x3029('0x23')?_0x3029('0x20'):_0xb240ae[_0x3029('0x1e')];_0x167c56[_0x1105b2]-=_0xb240ae[_0x3029('0x1f')];if(_0x167c56[_0x1105b2]<0x0)_0x167c56[_0x1105b2]=0x0;});_0xf55622(_0x167c56);return;});})[_0x3029('0x8')](function(_0x101a14){_0x2223a0(_0x101a14);});});}function checkUserLimits(_0x556d31){return new BPromise(function(_0x3bfee0,_0x4b4e5f){getLimits()[_0x3029('0x7')](function(_0x5bd840){var _0x2d2435=_[_0x3029('0x24')](_[_0x3029('0x25')](_0x556d31,_0x3029('0x1e')),[_0x3029('0x23'),_0x3029('0x20'),_0x3029('0x26')]);var _0x440a16=(_0x2d2435[_0x3029('0x23')]||0x0)+(_0x2d2435[_0x3029('0x20')]||0x0);var _0x68e6ea=_0x2d2435[_0x3029('0x26')]||0x0;if(_0x440a16>_0x5bd840[_0x3029('0x20')])return _0x4b4e5f(_0x3029('0x27'));if(_0x68e6ea>_0x5bd840[_0x3029('0x26')])return _0x4b4e5f('License\x20limit\x20reached\x20for\x20telephones');return _0x3bfee0();})['catch'](function(_0x6ce0b1){_0x4b4e5f(_0x6ce0b1);});});}module[_0x3029('0x28')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x33c1=['User','findAll','role','col','count','admin','user','telephone','telephones','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','decryptString','deadline','add','days','grayReason','machineUuid','changed','disabled','message'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x33c1,0x175));var _0x133c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x33c1[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x133c('0x0'));var _=require(_0x133c('0x1'));var moment=require('moment');var BPromise=require(_0x133c('0x2'));var hardware=require(_0x133c('0x3'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x133c('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x133c('0x5'),'machineUuid':hardware[_0x133c('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x133c('0x7'),'machineUuid':hardware[_0x133c('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4634f3){return new BPromise(function(_0x5f05c3,_0x20125a){return db[_0x133c('0x8')]['find'](_[_0x133c('0x9')](_0x4634f3,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x25c80d){return checkLicense(_0x25c80d,null);})[_0x133c('0xa')](function(_0x2f7f88){_0x5f05c3(_0x2f7f88);return;})[_0x133c('0xb')](function(_0x222776){_0x20125a(_0x222776);});});}function checkLicense(_0x36edab,_0x56b77d){if(!_0x36edab){demoLicense[_0x133c('0xc')]=_0x36edab[_0x133c('0xd')];return demoLicense;}try{var _0x2d535e=_0x56b77d||_0x36edab[_0x133c('0xe')];if(_[_0x133c('0xf')](_0x2d535e)){throw new Error(_0x133c('0x10'));}var _0x12f88d=_0x36edab[_0x133c('0xd')];var _0xf2bc3e=_0x36edab[_0x133c('0x11')];var _0x49e7d4=_0x12f88d[_0x133c('0x12')]('-')[0x4];var _0x472be9=_0x12f88d['split']('-')[0x0];var _0xc484d6=encryptor['decryptString'](_0x2d535e,util[_0x133c('0x13')](_0x133c('0x14'),_0x49e7d4,_0x12f88d,_0x472be9));var _0x1b9a75=JSON[_0x133c('0x15')](_0xc484d6);_0x1b9a75[_0x133c('0x16')]=![];_0x1b9a75[_0x133c('0xc')]=_0x12f88d;_0x1b9a75['machineUuid']=hardware[_0x133c('0x6')]();if(_0xf2bc3e){var _0x3a01d8=encryptor[_0x133c('0x17')](_0xf2bc3e);_0x1b9a75['gray']=_0x3a01d8;_0x1b9a75[_0x133c('0x18')]=moment(_0x3a01d8)[_0x133c('0x19')](0x7,_0x133c('0x1a'))[_0x133c('0x13')]();_0x1b9a75[_0x133c('0x1b')]=_0x1b9a75[_0x133c('0xc')]!=_0x1b9a75[_0x133c('0x1c')]?_0x133c('0x1d'):_0x133c('0x1e');}return _0x1b9a75;}catch(_0x3796fb){breakingLicense['uuid']=_0x36edab[_0x133c('0xd')];breakingLicense[_0x133c('0x1f')]=_0x3796fb['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2632fb,_0x1f7203){getLicense()[_0x133c('0xa')](function(_0x546c4f){return db[_0x133c('0x20')][_0x133c('0x21')]({'attributes':[_0x133c('0x22'),[db['sequelize']['fn']('COUNT',db['sequelize'][_0x133c('0x23')]('role')),_0x133c('0x24')]],'group':_0x133c('0x22'),'where':{'role':{'$or':[_0x133c('0x25'),_0x133c('0x26'),_0x133c('0x27')]}},'raw':!![]})[_0x133c('0xa')](function(_0x43b9ec){var _0x146f82={'user':_0x546c4f['users']||0x0,'telephone':_0x546c4f[_0x133c('0x28')]||0x0};_0x43b9ec['forEach'](function(_0x5f39ab){var _0x427faf=_0x5f39ab[_0x133c('0x22')]===_0x133c('0x25')?_0x133c('0x26'):_0x5f39ab[_0x133c('0x22')];_0x146f82[_0x427faf]-=_0x5f39ab['count'];if(_0x146f82[_0x427faf]<0x0)_0x146f82[_0x427faf]=0x0;});_0x2632fb(_0x146f82);return;});})[_0x133c('0xb')](function(_0x4e207){_0x1f7203(_0x4e207);});});}function checkUserLimits(_0x4e334d){return new BPromise(function(_0x3341d2,_0x559500){getLimits()[_0x133c('0xa')](function(_0x188e6c){var _0x41419a=_['pick'](_[_0x133c('0x29')](_0x4e334d,'role'),[_0x133c('0x25'),_0x133c('0x26'),_0x133c('0x27')]);var _0x57349c=(_0x41419a[_0x133c('0x25')]||0x0)+(_0x41419a[_0x133c('0x26')]||0x0);var _0x5907c3=_0x41419a[_0x133c('0x27')]||0x0;if(_0x57349c>_0x188e6c[_0x133c('0x26')])return _0x559500(_0x133c('0x2a'));if(_0x5907c3>_0x188e6c[_0x133c('0x27')])return _0x559500(_0x133c('0x2b'));return _0x3341d2();})['catch'](function(_0x568a62){_0x559500(_0x568a62);});});}module[_0x133c('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 17b50b8..247e126 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 _0xeb3b=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x414b63,_0x2b5bcf){var _0x50748e=function(_0x59b9e0){while(--_0x59b9e0){_0x414b63['push'](_0x414b63['shift']());}};_0x50748e(++_0x2b5bcf);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0xeb3b[_0x1f27df];return _0x286ee2;};'use strict';module[_0xbeb3('0x0')]={'DOMAIN':_0xbeb3('0x1'),'SESSION_SECRET':_0xbeb3('0x2'),'GOOGLE_ID':_0xbeb3('0x3'),'GOOGLE_SECRET':_0xbeb3('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x351d=['exports','myappanuglar-secret','app-id','secret'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x351d,0x90));var _0xd351=function(_0x4d5bf2,_0x5ad50e){_0x4d5bf2=_0x4d5bf2-0x0;var _0x2cfdb1=_0x351d[_0x4d5bf2];return _0x2cfdb1;};'use strict';module[_0xd351('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xd351('0x1'),'GOOGLE_ID':_0xd351('0x2'),'GOOGLE_SECRET':_0xd351('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index cbe06ca..63b1a46 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05b2=['fileLogger','exports','../utils/loggers'];(function(_0x201a0e,_0x1463c9){var _0x4e3225=function(_0x27247a){while(--_0x27247a){_0x201a0e['push'](_0x201a0e['shift']());}};_0x4e3225(++_0x1463c9);}(_0x05b2,0x13d));var _0x205b=function(_0x432bc9,_0xf2146c){_0x432bc9=_0x432bc9-0x0;var _0x69a3ad=_0x05b2[_0x432bc9];return _0x69a3ad;};'use strict';var fileLogger=require(_0x205b('0x0'))[_0x205b('0x1')];module[_0x205b('0x2')]=fileLogger; \ No newline at end of file +var _0xc690=['exports','../utils/loggers'];(function(_0x292b9d,_0x123322){var _0x33621e=function(_0x49cd9e){while(--_0x49cd9e){_0x292b9d['push'](_0x292b9d['shift']());}};_0x33621e(++_0x123322);}(_0xc690,0x17b));var _0x0c69=function(_0x9aa306,_0x2f5525){_0x9aa306=_0x9aa306-0x0;var _0x4a471f=_0xc690[_0x9aa306];return _0x4a471f;};'use strict';var fileLogger=require(_0x0c69('0x0'))['fileLogger'];module[_0x0c69('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 132fd57..44bb97f 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 _0x1f2c=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','express','ami','../../services/ami/index.js','agi','../../services/agi/index.js','join'];(function(_0x3a28e0,_0x38c8c3){var _0x585188=function(_0x5a3b2d){while(--_0x5a3b2d){_0x3a28e0['push'](_0x3a28e0['shift']());}};_0x585188(++_0x38c8c3);}(_0x1f2c,0x1e9));var _0xc1f2=function(_0x5ced8e,_0x1fe4ab){_0x5ced8e=_0x5ced8e-0x0;var _0x16c346=_0x1f2c[_0x5ced8e];return _0x16c346;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xc1f2('0x0'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xc1f2('0x1'),'script':path['join'](__dirname,_0xc1f2('0x2'))},{'name':_0xc1f2('0x3'),'script':path['join'](__dirname,_0xc1f2('0x4'))},{'name':'email','script':path[_0xc1f2('0x5')](__dirname,_0xc1f2('0x6'))},{'name':_0xc1f2('0x7'),'script':path[_0xc1f2('0x5')](__dirname,_0xc1f2('0x8'))},{'name':_0xc1f2('0x9'),'script':path[_0xc1f2('0x5')](__dirname,'../../services/xdr/index.js')}]};module[_0xc1f2('0xa')]=config; \ No newline at end of file +var _0x1562=['join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express'];(function(_0x5e0fbd,_0xab3706){var _0x469c88=function(_0xc1d4c7){while(--_0xc1d4c7){_0x5e0fbd['push'](_0x5e0fbd['shift']());}};_0x469c88(++_0xab3706);}(_0x1562,0xd0));var _0x2156=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x1562[_0x3f2228];return _0x285ae4;};'use strict';var path=require(_0x2156('0x0'));var os=require('os');var config={'apps':[{'name':_0x2156('0x1'),'script':path[_0x2156('0x2')](__dirname,_0x2156('0x3'))},{'name':_0x2156('0x4'),'script':path['join'](__dirname,_0x2156('0x5'))},{'name':_0x2156('0x6'),'script':path[_0x2156('0x2')](__dirname,_0x2156('0x7'))},{'name':_0x2156('0x8'),'script':path[_0x2156('0x2')](__dirname,_0x2156('0x9'))},{'name':_0x2156('0xa'),'script':path[_0x2156('0x2')](__dirname,_0x2156('0xb'))},{'name':_0x2156('0xc'),'script':path['join'](__dirname,_0x2156('0xd'))}]};module[_0x2156('0xe')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index c606890..b5d520a 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 _0xff14=['pm2','bluebird','./config','connect','connected','then','start','stop','disconnect','restart','list','describe','delete','dump'];(function(_0x10670e,_0xd94269){var _0x4e4f40=function(_0x464c72){while(--_0x464c72){_0x10670e['push'](_0x10670e['shift']());}};_0x4e4f40(++_0xd94269);}(_0xff14,0x1a4));var _0x4ff1=function(_0x5f4f17,_0x4a5909){_0x5f4f17=_0x5f4f17-0x0;var _0x1d9fe8=_0xff14[_0x5f4f17];return _0x1d9fe8;};'use strict';var pm2=require(_0x4ff1('0x0'));var BPromise=require(_0x4ff1('0x1'));var config=require(_0x4ff1('0x2'));function connect(){return new BPromise(function(_0x288143,_0x2e35c0){return pm2[_0x4ff1('0x3')](function(_0x1c3f1f){if(_0x1c3f1f){return _0x2e35c0(_0x1c3f1f);}return _0x288143(_0x4ff1('0x4'));});});};exports['start']=function(_0x348ed0){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x184ff1,_0x394c95){return pm2[_0x4ff1('0x6')](_0x348ed0,function(_0x19e3d3,_0xd5a54b){if(_0x19e3d3){return _0x394c95(_0x19e3d3);}pm2['disconnect']();return _0x184ff1(_0xd5a54b);});});});};exports[_0x4ff1('0x7')]=function(_0x29fabe){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x2300d5,_0x30e0d2){return pm2['stop'](_0x29fabe,function(_0x29e28f,_0x172873){if(_0x29e28f){return _0x30e0d2(_0x29e28f);}pm2[_0x4ff1('0x8')]();return _0x2300d5(_0x172873);});});});};exports[_0x4ff1('0x9')]=function(_0x39e985){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x32fa87,_0x3552b6){return pm2[_0x4ff1('0x9')](_0x39e985,function(_0x1bf0be,_0x3297a1){if(_0x1bf0be){return _0x3552b6(_0x1bf0be);}pm2[_0x4ff1('0x8')]();return _0x32fa87(_0x3297a1);});});});};exports[_0x4ff1('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5ea2a8,_0x514caa){return pm2[_0x4ff1('0xa')](function(_0x17d2ac,_0x1a3c56){if(_0x17d2ac){return _0x514caa(_0x17d2ac);}pm2[_0x4ff1('0x8')]();return _0x5ea2a8(_0x1a3c56);});});});};exports[_0x4ff1('0xb')]=function(_0x313599){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x1cfa8b,_0x12e501){return pm2[_0x4ff1('0xb')](_0x313599,function(_0x367527,_0xe9b5a7){if(_0x367527){return _0x12e501(_0x367527);}pm2[_0x4ff1('0x8')]();return _0x1cfa8b(_0xe9b5a7);});});});};exports[_0x4ff1('0xc')]=function(_0x11168a){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x3f54a9,_0x203715){return pm2['delete'](_0x11168a,function(_0x26f4fc,_0x5ec72d){if(_0x26f4fc){return _0x203715(_0x26f4fc);}pm2[_0x4ff1('0x8')]();return _0x3f54a9(_0x5ec72d);});});});};exports[_0x4ff1('0xd')]=function(){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x1d3cff,_0x3420e3){return pm2[_0x4ff1('0xd')](function(_0x35f6d8){if(_0x35f6d8){return _0x3420e3(_0x35f6d8);}return _0x1d3cff('saved');});});});}; \ No newline at end of file +var _0x4038=['start','then','stop','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connect'];(function(_0xf3fea9,_0xc841a0){var _0x535e2b=function(_0x2f006b){while(--_0x2f006b){_0xf3fea9['push'](_0xf3fea9['shift']());}};_0x535e2b(++_0xc841a0);}(_0x4038,0x99));var _0x8403=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x4038[_0x295314];return _0x584b0c;};'use strict';var pm2=require('pm2');var BPromise=require(_0x8403('0x0'));var config=require(_0x8403('0x1'));function connect(){return new BPromise(function(_0x2faebb,_0x21d71b){return pm2[_0x8403('0x2')](function(_0x17b4f6){if(_0x17b4f6){return _0x21d71b(_0x17b4f6);}return _0x2faebb('connected');});});};exports[_0x8403('0x3')]=function(_0x426641){return connect()[_0x8403('0x4')](function(){return new BPromise(function(_0x28b307,_0x4f87db){return pm2[_0x8403('0x3')](_0x426641,function(_0xe282f8,_0x2dd690){if(_0xe282f8){return _0x4f87db(_0xe282f8);}pm2['disconnect']();return _0x28b307(_0x2dd690);});});});};exports['stop']=function(_0x2aa087){return connect()[_0x8403('0x4')](function(){return new BPromise(function(_0x207a0b,_0xaa3c5b){return pm2[_0x8403('0x5')](_0x2aa087,function(_0x4ef7e6,_0x5a8848){if(_0x4ef7e6){return _0xaa3c5b(_0x4ef7e6);}pm2[_0x8403('0x6')]();return _0x207a0b(_0x5a8848);});});});};exports[_0x8403('0x7')]=function(_0x14766f){return connect()[_0x8403('0x4')](function(){return new BPromise(function(_0x128c02,_0x15586d){return pm2[_0x8403('0x7')](_0x14766f,function(_0x3528ef,_0x6b8f47){if(_0x3528ef){return _0x15586d(_0x3528ef);}pm2[_0x8403('0x6')]();return _0x128c02(_0x6b8f47);});});});};exports['list']=function(){return connect()[_0x8403('0x4')](function(){return new BPromise(function(_0x57e5d9,_0x11a2be){return pm2[_0x8403('0x8')](function(_0x7f4272,_0x4b2cde){if(_0x7f4272){return _0x11a2be(_0x7f4272);}pm2[_0x8403('0x6')]();return _0x57e5d9(_0x4b2cde);});});});};exports[_0x8403('0x9')]=function(_0x59cd3c){return connect()['then'](function(){return new BPromise(function(_0x15784f,_0x405bbe){return pm2['describe'](_0x59cd3c,function(_0x555cbb,_0x1c8adb){if(_0x555cbb){return _0x405bbe(_0x555cbb);}pm2[_0x8403('0x6')]();return _0x15784f(_0x1c8adb);});});});};exports[_0x8403('0xa')]=function(_0x4f2208){return connect()['then'](function(){return new BPromise(function(_0x289b6e,_0x46f927){return pm2[_0x8403('0xa')](_0x4f2208,function(_0x3c085f,_0x21a4c6){if(_0x3c085f){return _0x46f927(_0x3c085f);}pm2[_0x8403('0x6')]();return _0x289b6e(_0x21a4c6);});});});};exports[_0x8403('0xb')]=function(){return connect()[_0x8403('0x4')](function(){return new BPromise(function(_0x1f280b,_0x1cd2f5){return pm2[_0x8403('0xb')](function(_0x398073){if(_0x398073){return _0x1cd2f5(_0x398073);}return _0x1f280b(_0x8403('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index a7b30f4..9953454 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 _0x1fca=['ChatInteraction','update','system','timeout','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','subtract','map','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fca,0x1b2));var _0xa1fc=function(_0x19f04e,_0x48d52a){_0x19f04e=_0x19f04e-0x0;var _0x3206ed=_0x1fca[_0x19f04e];return _0x3206ed;};'use strict';var _=require(_0xa1fc('0x0'));var moment=require(_0xa1fc('0x1'));var Redis=require(_0xa1fc('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xa1fc('0x3'));config[_0xa1fc('0x4')]=_[_0xa1fc('0x5')](config[_0xa1fc('0x4')],{'host':_0xa1fc('0x6'),'port':0x18eb});var io=require(_0xa1fc('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0xade6d2=0x0;var _0x2a0b2c=[];return db[_0xa1fc('0x8')][_0xa1fc('0x9')]({'raw':!![],'attributes':['id',_0xa1fc('0xa')],'where':{'id':0x1}})[_0xa1fc('0xb')](function(_0x71f612){_0xade6d2=_0x71f612[_0xa1fc('0xa')];if(_0xade6d2){return db['ChatInteraction'][_0xa1fc('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa1fc('0xd')](_0x71f612['chatTimeout'],'minutes')}}});}else{return[];}})[_0xa1fc('0xb')](function(_0x3123a1){if(_0x3123a1&&_0x3123a1['length']){_0x2a0b2c=_[_0xa1fc('0xe')](_0x3123a1||[],'id');logger[_0xa1fc('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x2a0b2c['join']());return db[_0xa1fc('0x10')][_0xa1fc('0x11')]({'closeReason':_0xa1fc('0x12'),'disposition':_0xa1fc('0x13'),'closed':!![],'closedAt':moment()[_0xa1fc('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x2a0b2c}});}})[_0xa1fc('0xb')](function(){if(_0x2a0b2c&&_0x2a0b2c[_0xa1fc('0x15')]){logger['info'](_0xa1fc('0x16'),_0x2a0b2c[_0xa1fc('0x17')]());for(var _0x418b22=0x0;_0x418b22<_0x2a0b2c[_0xa1fc('0x15')];_0x418b22++){io[_0xa1fc('0x18')](_0xa1fc('0x19'),{'id':_0x2a0b2c[_0x418b22],'closed':!![]});}}})[_0xa1fc('0x1a')](function(_0x24b4f2){logger[_0xa1fc('0x1b')](_0xa1fc('0x1c'),_0x24b4f2?util['inspect'](_0x24b4f2,{'showHidden':![],'depth':null}):'');});}exports[_0xa1fc('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x808f=['then','length','map','[CHAT]\x20Interactions\x20to\x20close:','update','timeout','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch','error','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','localhost','Setting','chatTimeout','ChatInteraction','lastMsgAt','subtract'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x808f,0xeb));var _0xf808=function(_0x1c479a,_0x2d4fb2){_0x1c479a=_0x1c479a-0x0;var _0x94bde3=_0x808f[_0x1c479a];return _0x94bde3;};'use strict';var _=require(_0xf808('0x0'));var moment=require(_0xf808('0x1'));var Redis=require(_0xf808('0x2'));var util=require(_0xf808('0x3'));var config=require(_0xf808('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xf808('0x5'))(_0xf808('0x6'));config[_0xf808('0x7')]=_[_0xf808('0x8')](config['redis'],{'host':_0xf808('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf808('0x7')]));function closeInteractions(){var _0x39deb0=0x0;var _0x336fb0=[];return db[_0xf808('0xa')]['find']({'raw':!![],'attributes':['id',_0xf808('0xb')],'where':{'id':0x1}})['then'](function(_0x3fe642){_0x39deb0=_0x3fe642[_0xf808('0xb')];if(_0x39deb0){return db[_0xf808('0xc')]['findAll']({'raw':!![],'attributes':['id',_0xf808('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf808('0xe')](_0x3fe642[_0xf808('0xb')],'minutes')}}});}else{return[];}})[_0xf808('0xf')](function(_0x49de42){if(_0x49de42&&_0x49de42[_0xf808('0x10')]){_0x336fb0=_[_0xf808('0x11')](_0x49de42||[],'id');logger['info'](_0xf808('0x12'),_0x336fb0['join']());return db[_0xf808('0xc')][_0xf808('0x13')]({'closeReason':'system','disposition':_0xf808('0x14'),'closed':!![],'closedAt':moment()['format'](_0xf808('0x15'))},{'where':{'id':_0x336fb0}});}})[_0xf808('0xf')](function(){if(_0x336fb0&&_0x336fb0['length']){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x336fb0['join']());for(var _0x4f7110=0x0;_0x4f7110<_0x336fb0[_0xf808('0x10')];_0x4f7110++){io['emit'](_0xf808('0x16'),{'id':_0x336fb0[_0x4f7110],'closed':!![]});}}})[_0xf808('0x17')](function(_0xaaf99f){logger[_0xf808('0x18')]('[CHAT]\x20Error\x20closing\x20interactions',_0xaaf99f?util['inspect'](_0xaaf99f,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index c45b1c6..00a95dd 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6049=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0xe27895,_0x5a07e4){var _0x1656c4=function(_0x54d35d){while(--_0x54d35d){_0xe27895['push'](_0xe27895['shift']());}};_0x1656c4(++_0x5a07e4);}(_0x6049,0x146));var _0x9604=function(_0x6e5708,_0x50a5b2){_0x6e5708=_0x6e5708-0x0;var _0x1468ee=_0x6049[_0x6e5708];return _0x1468ee;};'use strict';function start(){var _0x212248=require(_0x9604('0x0'));return _0x212248['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xf137=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0xf137,0x150));var _0x7f13=function(_0x5e99af,_0x29f8c1){_0x5e99af=_0x5e99af-0x0;var _0x546f21=_0xf137[_0x5e99af];return _0x546f21;};'use strict';function start(){var _0x3dea1e=require(_0x7f13('0x0'));return _0x3dea1e[_0x7f13('0x1')]();}module[_0x7f13('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 1af8e2e..a3bb654 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 _0x13a0=['extname','zip','existsSync','status','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','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','Smtp','isNil','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','catch','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','cron','active','isBetween','startAt','add','start','endAt','update\x20cron','stop\x20cron','run','util','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','\x22%s\x22\x20<%s>','MailAccount','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','format','%s.%s'];(function(_0x47e691,_0x450beb){var _0x14380e=function(_0x2d39d1){while(--_0x2d39d1){_0x47e691['push'](_0x47e691['shift']());}};_0x14380e(++_0x450beb);}(_0x13a0,0x128));var _0x013a=function(_0x2d92d0,_0x512de7){_0x2d92d0=_0x2d92d0-0x0;var _0x5752e4=_0x13a0[_0x2d92d0];return _0x5752e4;};'use strict';var fs=require('fs');var util=require(_0x013a('0x0'));var path=require('path');var _=require(_0x013a('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x013a('0x2'));var BPromise=require(_0x013a('0x3'));var logger=require(_0x013a('0x4'))(_0x013a('0x5'));var db=require(_0x013a('0x6'))['db'];var analyticCustomReportController=require(_0x013a('0x7'));var analyticDefaultReportController=require(_0x013a('0x8'));var client=jayson[_0x013a('0x9')][_0x013a('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4c926b,_0x13aeca){return function(){logger[_0x013a('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x4c926b[_0x013a('0xc')]);var _0x151c42=!![];var _0x5ad311=_0x4c926b['MailAccount']['getSmtpOptions']();var _0x2d08ce={'account':_0x5ad311,'message':{'from':util['format'](_0x013a('0xd'),_0x4c926b[_0x013a('0xe')][_0x013a('0xf')],_0x4c926b[_0x013a('0xe')][_0x013a('0xc')]||_0x4c926b[_0x013a('0xe')]['Smtp']['user']),'to':_0x4c926b[_0x013a('0xc')],'cc':_0x4c926b['cc'],'bcc':_0x4c926b['bcc'],'subject':util['format'](_0x013a('0x10'),_0x13aeca[_0x013a('0xf')],_0x4c926b[_0x013a('0x11')],_0x4c926b[_0x013a('0x12')])}};var _0x1742d0=path[_0x013a('0x13')](__dirname,_0x013a('0x14'));var _0x320504=_0x13aeca[_0x013a('0x15')];var _0x3889ec=util[_0x013a('0x16')](_0x013a('0x17'),path['basename'](_0x13aeca[_0x013a('0x15')],path[_0x013a('0x18')](_0x13aeca[_0x013a('0x15')])),_0x013a('0x19'));var _0xbb0599=path[_0x013a('0x13')](_0x1742d0,_0x320504);var _0x38153d=path[_0x013a('0x13')](_0x1742d0,_0x3889ec);if(fs[_0x013a('0x1a')](_0xbb0599)){_0x13aeca[_0x013a('0x1b')]='Sent';_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1d')]=[{'filename':_0x320504,'path':_0xbb0599}];_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1e')]=util[_0x013a('0x16')](_0x013a('0x1f'),JSON[_0x013a('0x20')](_0x13aeca,null,0x2));}else if(fs[_0x013a('0x1a')](_0x38153d)){_0x13aeca[_0x013a('0x1b')]=_0x013a('0x21');_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1d')]=[{'filename':_0x3889ec,'path':_0x38153d}];}else{_0x2d08ce[_0x013a('0x1c')][_0x013a('0x1e')]=_0x013a('0x22');if(!_0x4c926b['sendIfEmpty']){_0x151c42=![];logger['info'](_0x013a('0x23'));}}if(_0x151c42){return client[_0x013a('0x24')](_0x013a('0x25'),_0x2d08ce)[_0x013a('0x26')](function(_0x3ff0f3){if(_0x3ff0f3[_0x013a('0x27')]){return logger[_0x013a('0x27')](_0x013a('0x28'),JSON['stringify'](_0x3ff0f3));}return logger[_0x013a('0xb')](_0x013a('0x29'));})['catch'](function(_0x11191f){return logger[_0x013a('0x27')](_0x013a('0x28'),JSON[_0x013a('0x20')](_0x11191f));});}};}function handleError(){return function(_0x121662){return logger['error'](JSON['stringify'](_0x121662));};}function handleResult(_0x12281a){return function(_0x399411){logger['info']('data',JSON[_0x013a('0x20')](_0x399411));if(_0x12281a[_0x013a('0xe')]&&_0x12281a[_0x013a('0xe')][_0x013a('0x2a')]&&!_[_0x013a('0x2b')](_0x12281a[_0x013a('0xc')])){setTimeout(handleSendEmail(_0x12281a,_0x399411),0x3c*0x3e8);}};}function handleJob(_0x57c2b9){return function(){try{if(_['isNil'](_0x57c2b9['subtractNumber'])){return logger[_0x013a('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x013a('0x2b')](_0x57c2b9[_0x013a('0x12')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x209656={'startDate':moment()['subtract'](_0x57c2b9[_0x013a('0x11')],_0x57c2b9[_0x013a('0x12')])['format'](_0x013a('0x2c')),'endDate':moment()[_0x013a('0x16')](_0x013a('0x2c')),'type':'scheduled','output':_0x57c2b9[_0x013a('0x2d')],'name':_0x57c2b9[_0x013a('0xf')]};if(!_[_0x013a('0x2b')](_0x57c2b9['DefaultReportId'])){logger[_0x013a('0xb')](_0x013a('0x2e'),_0x57c2b9[_0x013a('0x2f')]);return analyticDefaultReportController[_0x013a('0x30')]({'id':_0x57c2b9[_0x013a('0x2f')]},_0x209656)[_0x013a('0x26')](handleResult(_0x57c2b9))['catch'](handleError());}if(!_[_0x013a('0x2b')](_0x57c2b9['CustomReportId'])){logger[_0x013a('0xb')](_0x013a('0x31'),_0x57c2b9[_0x013a('0x32')]);return analyticCustomReportController['runReport']({'id':_0x57c2b9[_0x013a('0x32')]},_0x209656)[_0x013a('0x26')](handleResult(_0x57c2b9))[_0x013a('0x33')](handleError());}}catch(_0x77d2c2){logger[_0x013a('0x27')](JSON[_0x013a('0x20')](_0x77d2c2));}return logger[_0x013a('0xb')](_0x013a('0x34'));};}function getJobs(_0x1b068c){var _0xcfb601={};if(_0x1b068c){_0xcfb601['id']=_0x1b068c;}return db[_0x013a('0x35')]['findAll']({'where':_0xcfb601,'include':[{'model':db['MailAccount'],'attributes':['id',_0x013a('0xf'),_0x013a('0xc')],'include':[{'model':db[_0x013a('0x36')],'as':_0x013a('0x2a'),'include':[{'model':db['CloudProvider'],'as':_0x013a('0x37')}]}]}]})['then'](function(_0x503d62){var _0x13ceb8=_[_0x013a('0x38')](manager['jobs']);var _0xf7938c=_[_0x013a('0x39')](_0x503d62,function(_0xa5e243){return _0xa5e243['id'][_0x013a('0x3a')]();});var _0x21a091=_[_0x013a('0x3b')](_0x503d62,function(_0x2b6edb){return _0x2b6edb['id'][_0x013a('0x3a')]();});var _0x10caa7=_0x1b068c?_0xf7938c:_[_0x013a('0x3c')](_0xf7938c,_0x13ceb8);var _0x5949cd=_[_0x013a('0x3d')](_0xf7938c,_0x13ceb8);var _0x1a43b4=_['difference'](_0x13ceb8,_0xf7938c);var _0x143fdf;var _0x9e5408;for(_0x143fdf=0x0;_0x143fdf<_0x1a43b4[_0x013a('0x3e')]&&!_0x1b068c;_0x143fdf+=0x1){_0x9e5408=_0x1a43b4[_0x143fdf][_0x013a('0x3a')]();if(manager[_0x013a('0x3f')](_0x9e5408)){manager[_0x013a('0x40')](_0x9e5408);manager[_0x013a('0x41')](_0x9e5408);logger[_0x013a('0xb')](_0x013a('0x42'),_0x9e5408);}}logger[_0x013a('0xb')](_0x013a('0x43'),JSON['stringify'](_0x10caa7));for(_0x143fdf=0x0;_0x143fdf<_0x10caa7[_0x013a('0x3e')];_0x143fdf+=0x1){_0x9e5408=_0x10caa7[_0x143fdf][_0x013a('0x3a')]();logger[_0x013a('0xb')](_0x013a('0x44'),_0x9e5408);if(_0x1b068c){logger[_0x013a('0xb')](_0x013a('0x45'),_0x1b068c);logger[_0x013a('0xb')](JSON['stringify'](_0x21a091[_0x9e5408]));BPromise['resolve']()[_0x013a('0x26')](handleJob(_0x21a091[_0x9e5408]));logger['info']('run\x20job',_0x21a091[_0x9e5408]['name'],_0x21a091[_0x9e5408]['cron']);}else if(_0x21a091[_0x9e5408][_0x013a('0x46')]&&_0x21a091[_0x9e5408][_0x013a('0x47')]&&moment()[_0x013a('0x48')](_0x21a091[_0x9e5408][_0x013a('0x49')],_0x21a091[_0x9e5408]['endAt'])){manager[_0x013a('0x4a')](_0x9e5408,_0x21a091[_0x9e5408][_0x013a('0x46')],handleJob(_0x21a091[_0x9e5408]));manager[_0x013a('0x4b')](_0x9e5408);logger['info']('add\x20cron',_0x21a091[_0x9e5408][_0x013a('0xf')],_0x21a091[_0x9e5408][_0x013a('0x46')]);}else if(manager['exists'](_0x9e5408)){manager[_0x013a('0x40')](_0x9e5408);manager[_0x013a('0x41')](_0x9e5408);logger[_0x013a('0xb')]('stop\x20cron',_0x21a091[_0x9e5408][_0x013a('0xf')],_0x21a091[_0x9e5408]['cron']);}}for(_0x143fdf=0x0,_0x9e5408;_0x143fdf<_0x5949cd[_0x013a('0x3e')]&&!_0x1b068c;_0x143fdf+=0x1){_0x9e5408=_0x5949cd[_0x143fdf][_0x013a('0x3a')]();if(manager[_0x013a('0x3f')](_0x9e5408)){if(_0x21a091[_0x9e5408][_0x013a('0x46')]&&_0x21a091[_0x9e5408][_0x013a('0x47')]&&moment()[_0x013a('0x48')](_0x21a091[_0x9e5408][_0x013a('0x49')],_0x21a091[_0x9e5408][_0x013a('0x4c')])){manager['update'](_0x9e5408,_0x21a091[_0x9e5408][_0x013a('0x46')],handleJob(_0x21a091[_0x9e5408]));logger[_0x013a('0xb')](_0x013a('0x4d'),_0x21a091[_0x9e5408]['name'],_0x21a091[_0x9e5408]['cron']);}else{manager[_0x013a('0x40')](_0x9e5408);manager[_0x013a('0x41')](_0x9e5408);logger[_0x013a('0xb')](_0x013a('0x4e'),_0x21a091[_0x9e5408][_0x013a('0xf')],_0x21a091[_0x9e5408][_0x013a('0x46')]);}}}})[_0x013a('0x33')](function(_0x548583){logger[_0x013a('0x27')](JSON[_0x013a('0x20')](_0x548583));});}exports[_0x013a('0x4f')]=function(_0x2e94a5){return getJobs(_0x2e94a5);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x8ade=['schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','%s.%s','basename','savename','extname','zip','join','existsSync','Sent','message','attachments','text','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error\x20mail','email\x20sent','catch','error','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','length','toString','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','exists','stop','stop\x20cron','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','../logger'];(function(_0x59d369,_0x56a533){var _0x58c3eb=function(_0x2acb03){while(--_0x2acb03){_0x59d369['push'](_0x59d369['shift']());}};_0x58c3eb(++_0x56a533);}(_0x8ade,0x1a8));var _0xe8ad=function(_0x268e10,_0x264870){_0x268e10=_0x268e10-0x0;var _0x3fb95d=_0x8ade[_0x268e10];return _0x3fb95d;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xe8ad('0x0'));var _=require(_0xe8ad('0x1'));var moment=require(_0xe8ad('0x2'));var CronJobManager=require(_0xe8ad('0x3'));var jayson=require(_0xe8ad('0x4'));var BPromise=require('bluebird');var logger=require(_0xe8ad('0x5'))(_0xe8ad('0x6'));var db=require(_0xe8ad('0x7'))['db'];var analyticCustomReportController=require(_0xe8ad('0x8'));var analyticDefaultReportController=require(_0xe8ad('0x9'));var client=jayson['client'][_0xe8ad('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x88ace4,_0x3011db){return function(){logger['info'](_0xe8ad('0xb'),_0x88ace4[_0xe8ad('0xc')]);var _0x1c8dfe=!![];var _0x35633c=_0x88ace4[_0xe8ad('0xd')][_0xe8ad('0xe')]();var _0x583027={'account':_0x35633c,'message':{'from':util[_0xe8ad('0xf')](_0xe8ad('0x10'),_0x88ace4['MailAccount']['name'],_0x88ace4[_0xe8ad('0xd')][_0xe8ad('0xc')]||_0x88ace4[_0xe8ad('0xd')]['Smtp'][_0xe8ad('0x11')]),'to':_0x88ace4['email'],'cc':_0x88ace4['cc'],'bcc':_0x88ace4[_0xe8ad('0x12')],'subject':util['format'](_0xe8ad('0x13'),_0x3011db[_0xe8ad('0x14')],_0x88ace4[_0xe8ad('0x15')],_0x88ace4['subtractUnit'])}};var _0x2a4fb8=path['join'](__dirname,'../../files/reports');var _0x2678e4=_0x3011db['savename'];var _0x11c414=util[_0xe8ad('0xf')](_0xe8ad('0x16'),path[_0xe8ad('0x17')](_0x3011db[_0xe8ad('0x18')],path[_0xe8ad('0x19')](_0x3011db[_0xe8ad('0x18')])),_0xe8ad('0x1a'));var _0xa38b29=path[_0xe8ad('0x1b')](_0x2a4fb8,_0x2678e4);var _0x171e59=path[_0xe8ad('0x1b')](_0x2a4fb8,_0x11c414);if(fs[_0xe8ad('0x1c')](_0xa38b29)){_0x3011db['status']=_0xe8ad('0x1d');_0x583027[_0xe8ad('0x1e')][_0xe8ad('0x1f')]=[{'filename':_0x2678e4,'path':_0xa38b29}];_0x583027[_0xe8ad('0x1e')][_0xe8ad('0x20')]=util[_0xe8ad('0xf')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xe8ad('0x21')](_0x3011db,null,0x2));}else if(fs[_0xe8ad('0x1c')](_0x171e59)){_0x3011db[_0xe8ad('0x22')]=_0xe8ad('0x1d');_0x583027[_0xe8ad('0x1e')][_0xe8ad('0x1f')]=[{'filename':_0x11c414,'path':_0x171e59}];}else{_0x583027[_0xe8ad('0x1e')][_0xe8ad('0x20')]=_0xe8ad('0x23');if(!_0x88ace4['sendIfEmpty']){_0x1c8dfe=![];logger[_0xe8ad('0x24')](_0xe8ad('0x25'));}}if(_0x1c8dfe){return client[_0xe8ad('0x26')](_0xe8ad('0x27'),_0x583027)[_0xe8ad('0x28')](function(_0x4f1017){if(_0x4f1017['error']){return logger['error'](_0xe8ad('0x29'),JSON[_0xe8ad('0x21')](_0x4f1017));}return logger[_0xe8ad('0x24')](_0xe8ad('0x2a'));})[_0xe8ad('0x2b')](function(_0x286cb0){return logger[_0xe8ad('0x2c')](_0xe8ad('0x29'),JSON['stringify'](_0x286cb0));});}};}function handleError(){return function(_0x566eb8){return logger[_0xe8ad('0x2c')](JSON[_0xe8ad('0x21')](_0x566eb8));};}function handleResult(_0x2ea636){return function(_0x42bcb1){logger['info'](_0xe8ad('0x2d'),JSON[_0xe8ad('0x21')](_0x42bcb1));if(_0x2ea636[_0xe8ad('0xd')]&&_0x2ea636[_0xe8ad('0xd')][_0xe8ad('0x2e')]&&!_[_0xe8ad('0x2f')](_0x2ea636[_0xe8ad('0xc')])){setTimeout(handleSendEmail(_0x2ea636,_0x42bcb1),0x3c*0x3e8);}};}function handleJob(_0x119825){return function(){try{if(_[_0xe8ad('0x2f')](_0x119825['subtractNumber'])){return logger[_0xe8ad('0x24')](_0xe8ad('0x30'));}if(_[_0xe8ad('0x2f')](_0x119825[_0xe8ad('0x31')])){return logger[_0xe8ad('0x24')](_0xe8ad('0x32'));}var _0x2307a3={'startDate':moment()[_0xe8ad('0x33')](_0x119825['subtractNumber'],_0x119825[_0xe8ad('0x31')])['format'](_0xe8ad('0x34')),'endDate':moment()[_0xe8ad('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x119825[_0xe8ad('0x35')],'name':_0x119825['name']};if(!_[_0xe8ad('0x2f')](_0x119825[_0xe8ad('0x36')])){logger['info'](_0xe8ad('0x37'),_0x119825['DefaultReportId']);return analyticDefaultReportController[_0xe8ad('0x38')]({'id':_0x119825[_0xe8ad('0x36')]},_0x2307a3)[_0xe8ad('0x28')](handleResult(_0x119825))[_0xe8ad('0x2b')](handleError());}if(!_[_0xe8ad('0x2f')](_0x119825['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x119825['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x119825[_0xe8ad('0x39')]},_0x2307a3)[_0xe8ad('0x28')](handleResult(_0x119825))[_0xe8ad('0x2b')](handleError());}}catch(_0x1d2cd0){logger[_0xe8ad('0x2c')](JSON[_0xe8ad('0x21')](_0x1d2cd0));}return logger[_0xe8ad('0x24')](_0xe8ad('0x3a'));};}function getJobs(_0x2da84c){var _0x1047a4={};if(_0x2da84c){_0x1047a4['id']=_0x2da84c;}return db[_0xe8ad('0x3b')][_0xe8ad('0x3c')]({'where':_0x1047a4,'include':[{'model':db['MailAccount'],'attributes':['id','name',_0xe8ad('0xc')],'include':[{'model':db[_0xe8ad('0x3d')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xe8ad('0x3e')}]}]}]})['then'](function(_0x1e0ca3){var _0x366227=_['keys'](manager[_0xe8ad('0x3f')]);var _0x5eb5fd=_[_0xe8ad('0x40')](_0x1e0ca3,function(_0x23a486){return _0x23a486['id']['toString']();});var _0x388fbc=_['keyBy'](_0x1e0ca3,function(_0x4dfdda){return _0x4dfdda['id']['toString']();});var _0x141aa1=_0x2da84c?_0x5eb5fd:_['difference'](_0x5eb5fd,_0x366227);var _0xb504a=_['intersection'](_0x5eb5fd,_0x366227);var _0x17ff32=_['difference'](_0x366227,_0x5eb5fd);var _0x2046c0;var _0xb8bf55;for(_0x2046c0=0x0;_0x2046c0<_0x17ff32[_0xe8ad('0x41')]&&!_0x2da84c;_0x2046c0+=0x1){_0xb8bf55=_0x17ff32[_0x2046c0][_0xe8ad('0x42')]();if(manager['exists'](_0xb8bf55)){manager['stop'](_0xb8bf55);manager[_0xe8ad('0x43')](_0xb8bf55);logger[_0xe8ad('0x24')]('delete\x20cron',_0xb8bf55);}}logger[_0xe8ad('0x24')](_0xe8ad('0x44'),JSON[_0xe8ad('0x21')](_0x141aa1));for(_0x2046c0=0x0;_0x2046c0<_0x141aa1[_0xe8ad('0x41')];_0x2046c0+=0x1){_0xb8bf55=_0x141aa1[_0x2046c0]['toString']();logger[_0xe8ad('0x24')](_0xe8ad('0x45'),_0xb8bf55);if(_0x2da84c){logger[_0xe8ad('0x24')](_0xe8ad('0x46'),_0x2da84c);logger[_0xe8ad('0x24')](JSON[_0xe8ad('0x21')](_0x388fbc[_0xb8bf55]));BPromise[_0xe8ad('0x47')]()[_0xe8ad('0x28')](handleJob(_0x388fbc[_0xb8bf55]));logger[_0xe8ad('0x24')](_0xe8ad('0x48'),_0x388fbc[_0xb8bf55][_0xe8ad('0x14')],_0x388fbc[_0xb8bf55][_0xe8ad('0x49')]);}else if(_0x388fbc[_0xb8bf55][_0xe8ad('0x49')]&&_0x388fbc[_0xb8bf55][_0xe8ad('0x4a')]&&moment()[_0xe8ad('0x4b')](_0x388fbc[_0xb8bf55][_0xe8ad('0x4c')],_0x388fbc[_0xb8bf55]['endAt'])){manager[_0xe8ad('0x4d')](_0xb8bf55,_0x388fbc[_0xb8bf55][_0xe8ad('0x49')],handleJob(_0x388fbc[_0xb8bf55]));manager[_0xe8ad('0x4e')](_0xb8bf55);logger[_0xe8ad('0x24')](_0xe8ad('0x4f'),_0x388fbc[_0xb8bf55][_0xe8ad('0x14')],_0x388fbc[_0xb8bf55][_0xe8ad('0x49')]);}else if(manager[_0xe8ad('0x50')](_0xb8bf55)){manager[_0xe8ad('0x51')](_0xb8bf55);manager[_0xe8ad('0x43')](_0xb8bf55);logger[_0xe8ad('0x24')](_0xe8ad('0x52'),_0x388fbc[_0xb8bf55][_0xe8ad('0x14')],_0x388fbc[_0xb8bf55]['cron']);}}for(_0x2046c0=0x0,_0xb8bf55;_0x2046c0<_0xb504a[_0xe8ad('0x41')]&&!_0x2da84c;_0x2046c0+=0x1){_0xb8bf55=_0xb504a[_0x2046c0][_0xe8ad('0x42')]();if(manager[_0xe8ad('0x50')](_0xb8bf55)){if(_0x388fbc[_0xb8bf55]['cron']&&_0x388fbc[_0xb8bf55][_0xe8ad('0x4a')]&&moment()['isBetween'](_0x388fbc[_0xb8bf55][_0xe8ad('0x4c')],_0x388fbc[_0xb8bf55]['endAt'])){manager[_0xe8ad('0x53')](_0xb8bf55,_0x388fbc[_0xb8bf55][_0xe8ad('0x49')],handleJob(_0x388fbc[_0xb8bf55]));logger['info'](_0xe8ad('0x54'),_0x388fbc[_0xb8bf55][_0xe8ad('0x14')],_0x388fbc[_0xb8bf55][_0xe8ad('0x49')]);}else{manager['stop'](_0xb8bf55);manager[_0xe8ad('0x43')](_0xb8bf55);logger[_0xe8ad('0x24')](_0xe8ad('0x52'),_0x388fbc[_0xb8bf55]['name'],_0x388fbc[_0xb8bf55][_0xe8ad('0x49')]);}}}})[_0xe8ad('0x2b')](function(_0x8b844a){logger[_0xe8ad('0x2c')](JSON[_0xe8ad('0x21')](_0x8b844a));});}exports[_0xe8ad('0x55')]=function(_0x44b0fc){return getJobs(_0x44b0fc);};exports[_0xe8ad('0x4e')]=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 0ab356a..c8679b7 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 _0x1eba=['Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','resolve','Cloud\x20Provider\x20not\x20configured','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','CloudProvider','forEach','push','start','lodash','aws-sdk','request-promise','util','bluebird','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','format','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured'];(function(_0x370ca5,_0x14f56a){var _0x17c044=function(_0x2d1c12){while(--_0x2d1c12){_0x370ca5['push'](_0x370ca5['shift']());}};_0x17c044(++_0x14f56a);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1eba[_0x311c35];return _0x5cc50c;};var _=require(_0xa1eb('0x0'));var AWS=require(_0xa1eb('0x1'));var rp=require(_0xa1eb('0x2'));var util=require(_0xa1eb('0x3'));var BPromise=require(_0xa1eb('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xa1eb('0x5'));function getTranscriptionJob(_0x34be5a,_0x16a13a,_0xf9d704,_0x138789){return new Promise(function(_0x2933d0,_0x1d0d67){var _0x2bfbb0=new AWS[(_0xa1eb('0x6'))]({'accessKeyId':_0x16a13a,'secretAccessKey':_0x34be5a,'region':_0xf9d704});_0x2bfbb0[_0xa1eb('0x7')]({'TranscriptionJobName':_0x138789},function(_0x2aebb6,_0x9d7113){if(_0x2aebb6){return _0x1d0d67(_0x2aebb6);}else{return _0x2933d0(_0x9d7113);}});});}function sentiment(_0x54d235,_0x1ecd20,_0x4d4aaf,_0x219802,_0x54cdad){return new Promise(function(_0x3f53ff,_0x5d7101){var _0x41a7bc=new AWS['Comprehend']({'accessKeyId':_0x1ecd20,'secretAccessKey':_0x54d235,'region':_0x4d4aaf});_0x41a7bc[_0xa1eb('0x8')]({'Text':_0x219802,'LanguageCode':_0x54cdad[_0xa1eb('0x9')](0x0,0x2)},function(_0x151580,_0x5839d3){if(_0x151580){return _0x5d7101(_0x151580);}else{return _0x3f53ff(_0x5839d3);}});});}function checkTranscribeJob(_0x1e28e7,_0x39b4a3,_0x5df92d){var _0x16a623;return new BPromise(function(_0x4a3774,_0x4e65dc){logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0xb'),_0x1e28e7['id'],_0x1e28e7[_0xa1eb('0xc')]));return getTranscriptionJob(_0x5df92d[_0xa1eb('0xd')],_0x5df92d[_0xa1eb('0xe')],_0x39b4a3[_0xa1eb('0xf')],_0x1e28e7[_0xa1eb('0xc')])[_0xa1eb('0x10')](function(_0x45d6dd){logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0x11'),_0x1e28e7['id'],_0x1e28e7['transcribeName'],_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x13')]));if(!_0x1e28e7[_0xa1eb('0x14')]){switch(_0x45d6dd[_0xa1eb('0x12')]['TranscriptionJobStatus']){case _0xa1eb('0x15'):var _0x22cd44={'transcribeStatus':_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x13')],'fileUri':_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x16')][_0xa1eb('0x17')]};logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0x18'),_0x1e28e7['id']));return rp({'uri':_0x45d6dd['TranscriptionJob'][_0xa1eb('0x16')][_0xa1eb('0x17')],'json':!![]})[_0xa1eb('0x10')](function(_0x250f99){logger['info'](util['format'](_0xa1eb('0x19'),_0x1e28e7['id']));if(_0x250f99&&_0x250f99[_0xa1eb('0x1a')]&&_0x250f99['results'][_0xa1eb('0x1b')]&&_0x250f99[_0xa1eb('0x1a')][_0xa1eb('0x1b')][_0xa1eb('0x1c')]){_0x22cd44[_0xa1eb('0x14')]='';for(var _0x1c59e1=0x0;_0x1c59e1<_0x250f99[_0xa1eb('0x1a')][_0xa1eb('0x1b')][_0xa1eb('0x1c')];_0x1c59e1++){_0x22cd44[_0xa1eb('0x14')]+=_0x250f99[_0xa1eb('0x1a')][_0xa1eb('0x1b')][_0x1c59e1]['transcript']+'';}}return _0x1e28e7[_0xa1eb('0x1d')](_0x22cd44);})[_0xa1eb('0x10')](function(){logger['info'](util[_0xa1eb('0x1e')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1e28e7['id']));if(!_0x1e28e7[_0xa1eb('0x1f')]){throw new db[(_0xa1eb('0x20'))]['ValidationError'](_0xa1eb('0x21'));}if(!_0x39b4a3[_0xa1eb('0x22')]||!_0x39b4a3[_0xa1eb('0x23')]||!_0x39b4a3['sentimentRegion']||!_0x39b4a3[_0xa1eb('0x24')]||!_0x39b4a3[_0xa1eb('0x25')]){throw new db['Sequelize'][(_0xa1eb('0x26'))](_0xa1eb('0x27'));}if(!_0x22cd44[_0xa1eb('0x14')]){throw new Error(_0xa1eb('0x28'));}if(_0x39b4a3[_0xa1eb('0x23')]===_0x5df92d['id']){return _0x5df92d;}else{return db['CloudProvider'][_0xa1eb('0x29')]({'where':{'id':_settings[_0xa1eb('0x23')]}});}})[_0xa1eb('0x10')](function(_0x2ae21d){if(!_0x2ae21d){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x2a'));}if(!_0x2ae21d[_0xa1eb('0xd')]||!_0x2ae21d[_0xa1eb('0xe')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x16a623=_0x2ae21d;logger['info'](util[_0xa1eb('0x1e')](_0xa1eb('0x2b'),_0x1e28e7['id']));return sentiment(_0x16a623[_0xa1eb('0xd')],_0x16a623[_0xa1eb('0xe')],_0x39b4a3[_0xa1eb('0x2c')],_0x22cd44['fileText'],_0x39b4a3['language']);})[_0xa1eb('0x10')](function(_0x2d2890){logger['info'](util['format'](_0xa1eb('0x2d'),_0x1e28e7['id']));return _0x1e28e7['update']({'sentiment':_0x2d2890[_0xa1eb('0x2e')],'sPositive':_0x2d2890['SentimentScore'][_0xa1eb('0x2f')],'sNegative':_0x2d2890[_0xa1eb('0x30')][_0xa1eb('0x31')],'sMixed':_0x2d2890['SentimentScore'][_0xa1eb('0x32')],'sNeutral':_0x2d2890[_0xa1eb('0x30')][_0xa1eb('0x33')]});})['then'](function(){logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x34'),_0x1e28e7['id']));_0x4a3774();});case _0xa1eb('0x35'):return _0x1e28e7[_0xa1eb('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x45d6dd[_0xa1eb('0x12')][_0xa1eb('0x36')]})[_0xa1eb('0x10')](function(){logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x34'),_0x1e28e7['id']));_0x4a3774();});default:logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1e28e7['id']));break;}}else{return BPromise[_0xa1eb('0x37')]()[_0xa1eb('0x10')](function(){if(!_0x1e28e7[_0xa1eb('0x1f')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x39b4a3[_0xa1eb('0x22')]||!_0x39b4a3[_0xa1eb('0x23')]||!_0x39b4a3[_0xa1eb('0x2c')]||!_0x39b4a3['language']||!_0x39b4a3[_0xa1eb('0x25')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x27'));}if(!_0x1e28e7[_0xa1eb('0x14')]){throw new Error(_0xa1eb('0x28'));}if(_0x39b4a3[_0xa1eb('0x23')]===_0x5df92d['id']){return _0x5df92d;}else{return db['CloudProvider'][_0xa1eb('0x29')]({'where':{'id':_settings[_0xa1eb('0x23')]}});}})['then'](function(_0xf6c04b){if(!_0xf6c04b){throw new db['Sequelize'][(_0xa1eb('0x26'))](_0xa1eb('0x2a'));}if(!_0xf6c04b[_0xa1eb('0xd')]||!_0xf6c04b[_0xa1eb('0xe')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x38'));}_0x16a623=_0xf6c04b;logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x2b'),_0x1e28e7['id']));return sentiment(_0x16a623[_0xa1eb('0xd')],_0x16a623[_0xa1eb('0xe')],_0x39b4a3[_0xa1eb('0x2c')],_0x1e28e7[_0xa1eb('0x14')],_0x39b4a3[_0xa1eb('0x24')]);})[_0xa1eb('0x10')](function(_0x4e068d){logger[_0xa1eb('0xa')](util['format'](_0xa1eb('0x2d'),_0x1e28e7['id']));return _0x1e28e7[_0xa1eb('0x1d')]({'sentiment':_0x4e068d['Sentiment'],'sPositive':_0x4e068d['SentimentScore'][_0xa1eb('0x2f')],'sNegative':_0x4e068d[_0xa1eb('0x30')][_0xa1eb('0x31')],'sMixed':_0x4e068d['SentimentScore'][_0xa1eb('0x32')],'sNeutral':_0x4e068d[_0xa1eb('0x30')][_0xa1eb('0x33')],'transcribeStatus':_0xa1eb('0x15')});})[_0xa1eb('0x10')](function(){logger[_0xa1eb('0xa')](util[_0xa1eb('0x1e')](_0xa1eb('0x34'),_0x1e28e7['id']));_0x4a3774();});}})[_0xa1eb('0x39')](function(_0x20c910){if(_0x20c910){if(!_0x20c910[_0xa1eb('0x3a')]||_0x20c910[_0xa1eb('0x3a')]!==_0xa1eb('0x3b')){logger[_0xa1eb('0x3c')](util['format'](_0xa1eb('0x3d'),_0x1e28e7['id']),util[_0xa1eb('0x3e')](_0x20c910,{'showHidden':![],'depth':null}));}}_0x4a3774();});});}function checkTranscribe(){var _0x1c94bc;var _0x977d00;var _0x2b0cbf;return db[_0xa1eb('0x3f')][_0xa1eb('0x40')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xa1eb('0x10')](function(_0x4144cf){if(!_0x4144cf||!_0x4144cf[_0xa1eb('0x1c')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x41'));}_0x1c94bc=_0x4144cf;return db[_0xa1eb('0x42')][_0xa1eb('0x29')]({'where':{'id':0x1}});})[_0xa1eb('0x10')](function(_0x4f7c05){if(!_0x4f7c05){throw new db[(_0xa1eb('0x20'))]['ValidationError'](_0xa1eb('0x43'));}_0x977d00=_0x4f7c05;if(!_0x977d00['transcribe']||!_0x977d00[_0xa1eb('0x44')]||!_0x977d00[_0xa1eb('0xf')]||!_0x977d00[_0xa1eb('0x24')]||!_0x977d00['bucket']){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))]('Transcribe\x20not\x20configured');}return db[_0xa1eb('0x45')][_0xa1eb('0x29')]({'where':{'id':_0x977d00[_0xa1eb('0x44')]}});})[_0xa1eb('0x10')](function(_0x11cc84){if(!_0x11cc84){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x2a'));}if(!_0x11cc84[_0xa1eb('0xd')]||!_0x11cc84[_0xa1eb('0xe')]){throw new db[(_0xa1eb('0x20'))][(_0xa1eb('0x26'))](_0xa1eb('0x38'));}_0x2b0cbf=_0x11cc84;var _0x260c4a=[];_0x1c94bc[_0xa1eb('0x46')](function(_0x2ba6c0){_0x260c4a[_0xa1eb('0x47')](checkTranscribeJob(_0x2ba6c0,_0x977d00,_0x2b0cbf));});return BPromise['all'](_0x260c4a);})[_0xa1eb('0x39')](function(_0x51ce91){if(_0x51ce91){if(!_0x51ce91[_0xa1eb('0x3a')]||_0x51ce91[_0xa1eb('0x3a')]!==_0xa1eb('0x3b')){logger[_0xa1eb('0x3c')](util['inspect'](_0x51ce91,{'showHidden':![],'depth':null}));}}});}exports[_0xa1eb('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xddb8=['request-promise','util','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','length','transcripts','fileText','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','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','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk'];(function(_0x1e8eea,_0x2452fb){var _0x225263=function(_0x47393d){while(--_0x47393d){_0x1e8eea['push'](_0x1e8eea['shift']());}};_0x225263(++_0x2452fb);}(_0xddb8,0xd7));var _0x8ddb=function(_0x49f8a7,_0x2f06fa){_0x49f8a7=_0x49f8a7-0x0;var _0x551496=_0xddb8[_0x49f8a7];return _0x551496;};var _=require('lodash');var AWS=require(_0x8ddb('0x0'));var rp=require(_0x8ddb('0x1'));var util=require(_0x8ddb('0x2'));var BPromise=require('bluebird');var db=require(_0x8ddb('0x3'))['db'];var logger=require(_0x8ddb('0x4'))(_0x8ddb('0x5'));function getTranscriptionJob(_0xb61e9,_0x173cb3,_0x110046,_0x505f57){return new Promise(function(_0x5a52ec,_0x2ebc4b){var _0x1dcf86=new AWS['TranscribeService']({'accessKeyId':_0x173cb3,'secretAccessKey':_0xb61e9,'region':_0x110046});_0x1dcf86['getTranscriptionJob']({'TranscriptionJobName':_0x505f57},function(_0x27b901,_0x2af85c){if(_0x27b901){return _0x2ebc4b(_0x27b901);}else{return _0x5a52ec(_0x2af85c);}});});}function sentiment(_0x729998,_0x49b77e,_0x459f24,_0x21d488,_0x24d7af){return new Promise(function(_0x20ab58,_0x258ac4){var _0x53173f=new AWS[(_0x8ddb('0x6'))]({'accessKeyId':_0x49b77e,'secretAccessKey':_0x729998,'region':_0x459f24});_0x53173f[_0x8ddb('0x7')]({'Text':_0x21d488,'LanguageCode':_0x24d7af['substring'](0x0,0x2)},function(_0x2d743d,_0x14e699){if(_0x2d743d){return _0x258ac4(_0x2d743d);}else{return _0x20ab58(_0x14e699);}});});}function checkTranscribeJob(_0x36498f,_0x8f1670,_0x3f2832){var _0x2376a5;return new BPromise(function(_0xf567ca,_0x37277e){logger[_0x8ddb('0x8')](util['format'](_0x8ddb('0x9'),_0x36498f['id'],_0x36498f[_0x8ddb('0xa')]));return getTranscriptionJob(_0x3f2832[_0x8ddb('0xb')],_0x3f2832[_0x8ddb('0xc')],_0x8f1670[_0x8ddb('0xd')],_0x36498f[_0x8ddb('0xa')])[_0x8ddb('0xe')](function(_0x799e41){logger['info'](util[_0x8ddb('0xf')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x36498f['id'],_0x36498f[_0x8ddb('0xa')],_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x11')]));if(!_0x36498f['fileText']){switch(_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x11')]){case _0x8ddb('0x12'):var _0x26cee6={'transcribeStatus':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x11')],'fileUri':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x13')][_0x8ddb('0x14')]};logger[_0x8ddb('0x8')](util['format'](_0x8ddb('0x15'),_0x36498f['id']));return rp({'uri':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x13')][_0x8ddb('0x14')],'json':!![]})['then'](function(_0x42b978){logger[_0x8ddb('0x8')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x36498f['id']));if(_0x42b978&&_0x42b978[_0x8ddb('0x16')]&&_0x42b978[_0x8ddb('0x16')]['transcripts']&&_0x42b978[_0x8ddb('0x16')]['transcripts'][_0x8ddb('0x17')]){_0x26cee6['fileText']='';for(var _0x53b199=0x0;_0x53b199<_0x42b978['results'][_0x8ddb('0x18')][_0x8ddb('0x17')];_0x53b199++){_0x26cee6[_0x8ddb('0x19')]+=_0x42b978[_0x8ddb('0x16')][_0x8ddb('0x18')][_0x53b199]['transcript']+'';}}return _0x36498f[_0x8ddb('0x1a')](_0x26cee6);})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x1b'),_0x36498f['id']));if(!_0x36498f['tempSentiment']){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x1d'));}if(!_0x8f1670['sentiment']||!_0x8f1670['sentimentAccountId']||!_0x8f1670[_0x8ddb('0x1e')]||!_0x8f1670[_0x8ddb('0x1f')]||!_0x8f1670[_0x8ddb('0x20')]){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x22'));}if(!_0x26cee6[_0x8ddb('0x19')]){throw new Error(_0x8ddb('0x23'));}if(_0x8f1670[_0x8ddb('0x24')]===_0x3f2832['id']){return _0x3f2832;}else{return db['CloudProvider'][_0x8ddb('0x25')]({'where':{'id':_settings[_0x8ddb('0x24')]}});}})['then'](function(_0x46f47a){if(!_0x46f47a){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x26'));}if(!_0x46f47a[_0x8ddb('0xb')]||!_0x46f47a[_0x8ddb('0xc')]){throw new db['Sequelize'][(_0x8ddb('0x21'))](_0x8ddb('0x27'));}_0x2376a5=_0x46f47a;logger['info'](util[_0x8ddb('0xf')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x36498f['id']));return sentiment(_0x2376a5['data1'],_0x2376a5[_0x8ddb('0xc')],_0x8f1670['sentimentRegion'],_0x26cee6['fileText'],_0x8f1670[_0x8ddb('0x1f')]);})['then'](function(_0x4a1772){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x36498f['id']));return _0x36498f[_0x8ddb('0x1a')]({'sentiment':_0x4a1772['Sentiment'],'sPositive':_0x4a1772[_0x8ddb('0x28')][_0x8ddb('0x29')],'sNegative':_0x4a1772['SentimentScore'][_0x8ddb('0x2a')],'sMixed':_0x4a1772['SentimentScore'][_0x8ddb('0x2b')],'sNeutral':_0x4a1772[_0x8ddb('0x28')][_0x8ddb('0x2c')]});})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x1b'),_0x36498f['id']));_0xf567ca();});case _0x8ddb('0x2d'):return _0x36498f['update']({'transcribeStatus':_0x8ddb('0x2d'),'failureReason':_0x799e41[_0x8ddb('0x10')][_0x8ddb('0x2e')]})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x36498f['id']));_0xf567ca();});default:logger[_0x8ddb('0x8')](util['format'](_0x8ddb('0x2f'),_0x36498f['id']));break;}}else{return BPromise[_0x8ddb('0x30')]()[_0x8ddb('0xe')](function(){if(!_0x36498f[_0x8ddb('0x31')]){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x1d'));}if(!_0x8f1670[_0x8ddb('0x32')]||!_0x8f1670[_0x8ddb('0x24')]||!_0x8f1670['sentimentRegion']||!_0x8f1670[_0x8ddb('0x1f')]||!_0x8f1670[_0x8ddb('0x20')]){throw new db['Sequelize'][(_0x8ddb('0x21'))](_0x8ddb('0x22'));}if(!_0x36498f[_0x8ddb('0x19')]){throw new Error(_0x8ddb('0x23'));}if(_0x8f1670[_0x8ddb('0x24')]===_0x3f2832['id']){return _0x3f2832;}else{return db[_0x8ddb('0x33')][_0x8ddb('0x25')]({'where':{'id':_settings[_0x8ddb('0x24')]}});}})[_0x8ddb('0xe')](function(_0x502f63){if(!_0x502f63){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x26'));}if(!_0x502f63['data1']||!_0x502f63[_0x8ddb('0xc')]){throw new db['Sequelize'][(_0x8ddb('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x2376a5=_0x502f63;logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x34'),_0x36498f['id']));return sentiment(_0x2376a5[_0x8ddb('0xb')],_0x2376a5['data2'],_0x8f1670[_0x8ddb('0x1e')],_0x36498f[_0x8ddb('0x19')],_0x8f1670['language']);})['then'](function(_0x234ade){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x35'),_0x36498f['id']));return _0x36498f[_0x8ddb('0x1a')]({'sentiment':_0x234ade[_0x8ddb('0x36')],'sPositive':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x29')],'sNegative':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x2a')],'sMixed':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x2b')],'sNeutral':_0x234ade[_0x8ddb('0x28')][_0x8ddb('0x2c')],'transcribeStatus':_0x8ddb('0x12')});})[_0x8ddb('0xe')](function(){logger[_0x8ddb('0x8')](util[_0x8ddb('0xf')](_0x8ddb('0x1b'),_0x36498f['id']));_0xf567ca();});}})[_0x8ddb('0x37')](function(_0x50a68e){if(_0x50a68e){if(!_0x50a68e[_0x8ddb('0x38')]||_0x50a68e[_0x8ddb('0x38')]!==_0x8ddb('0x39')){logger[_0x8ddb('0x3a')](util[_0x8ddb('0xf')](_0x8ddb('0x3b'),_0x36498f['id']),util[_0x8ddb('0x3c')](_0x50a68e,{'showHidden':![],'depth':null}));}}_0xf567ca();});});}function checkTranscribe(){var _0x5dd670;var _0xd619b6;var _0x2d6e6c;return db['VoiceRecording'][_0x8ddb('0x3d')]({'where':{'transcribeStatus':_0x8ddb('0x3e')}})[_0x8ddb('0xe')](function(_0x174b87){if(!_0x174b87||!_0x174b87['length']){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x3f'));}_0x5dd670=_0x174b87;return db[_0x8ddb('0x40')][_0x8ddb('0x25')]({'where':{'id':0x1}});})[_0x8ddb('0xe')](function(_0x451b4b){if(!_0x451b4b){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))](_0x8ddb('0x41'));}_0xd619b6=_0x451b4b;if(!_0xd619b6[_0x8ddb('0x5')]||!_0xd619b6[_0x8ddb('0x42')]||!_0xd619b6[_0x8ddb('0xd')]||!_0xd619b6[_0x8ddb('0x1f')]||!_0xd619b6['bucket']){throw new db[(_0x8ddb('0x1c'))]['ValidationError'](_0x8ddb('0x43'));}return db[_0x8ddb('0x33')][_0x8ddb('0x25')]({'where':{'id':_0xd619b6[_0x8ddb('0x42')]}});})[_0x8ddb('0xe')](function(_0x5bb8c6){if(!_0x5bb8c6){throw new db['Sequelize'][(_0x8ddb('0x21'))](_0x8ddb('0x26'));}if(!_0x5bb8c6['data1']||!_0x5bb8c6['data2']){throw new db[(_0x8ddb('0x1c'))][(_0x8ddb('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x2d6e6c=_0x5bb8c6;var _0x26b448=[];_0x5dd670[_0x8ddb('0x44')](function(_0x9ae800){_0x26b448[_0x8ddb('0x45')](checkTranscribeJob(_0x9ae800,_0xd619b6,_0x2d6e6c));});return BPromise[_0x8ddb('0x46')](_0x26b448);})[_0x8ddb('0x37')](function(_0x4220b5){if(_0x4220b5){if(!_0x4220b5[_0x8ddb('0x38')]||_0x4220b5['name']!==_0x8ddb('0x39')){logger[_0x8ddb('0x3a')](util[_0x8ddb('0x3c')](_0x4220b5,{'showHidden':![],'depth':null}));}}});}exports[_0x8ddb('0x47')]=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 c57b874..a4d1555 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 _0x13a5=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length'];(function(_0x173a89,_0x101586){var _0x144daa=function(_0x145197){while(--_0x145197){_0x173a89['push'](_0x173a89['shift']());}};_0x144daa(++_0x101586);}(_0x13a5,0x13b));var _0x513a=function(_0xc1d1e7,_0x66bca7){_0xc1d1e7=_0xc1d1e7-0x0;var _0x59d67b=_0x13a5[_0xc1d1e7];return _0x59d67b;};'use strict';var _=require(_0x513a('0x0'));var moment=require(_0x513a('0x1'));var Redis=require('ioredis');var util=require(_0x513a('0x2'));var config=require(_0x513a('0x3'));var db=require(_0x513a('0x4'))['db'];var logger=require(_0x513a('0x5'))('schedule');config[_0x513a('0x6')]=_[_0x513a('0x7')](config[_0x513a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x513a('0x8'))(new Redis(config[_0x513a('0x6')]));function closeInteractions(){var _0x1c925c=[];return db[_0x513a('0x9')][_0x513a('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x513a('0xb')](0x18,_0x513a('0xc'))}}})[_0x513a('0xd')](function(_0x401245){if(_0x401245&&_0x401245[_0x513a('0xe')]){_0x1c925c=_[_0x513a('0xf')](_0x401245||[],'id');logger[_0x513a('0x10')](_0x513a('0x11'),_0x1c925c[_0x513a('0x12')]());return db[_0x513a('0x9')][_0x513a('0x13')]({'closeReason':_0x513a('0x14'),'disposition':_0x513a('0x15'),'closed':!![],'closedAt':moment()[_0x513a('0x16')](_0x513a('0x17'))},{'where':{'id':_0x1c925c}});}})[_0x513a('0xd')](function(){if(_0x1c925c&&_0x1c925c[_0x513a('0xe')]){logger['info'](_0x513a('0x18'),_0x1c925c['join']());for(var _0x1a4f7b=0x0;_0x1a4f7b<_0x1c925c[_0x513a('0xe')];_0x1a4f7b++){io[_0x513a('0x19')](_0x513a('0x1a'),{'id':_0x1c925c[_0x1a4f7b],'closed':!![]});}}})[_0x513a('0x1b')](function(_0x468a60){logger[_0x513a('0x1c')](_0x513a('0x1d'),_0x468a60?util['inspect'](_0x468a60,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x968c=['WhatsappInteraction','findAll','lastMsgAt','subtract','length','info','join','update','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','start','lodash','moment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter'];(function(_0x690346,_0x40dc57){var _0x5e4dab=function(_0x52ef75){while(--_0x52ef75){_0x690346['push'](_0x690346['shift']());}};_0x5e4dab(++_0x40dc57);}(_0x968c,0xd9));var _0xc968=function(_0x3aca1e,_0x5233f6){_0x3aca1e=_0x3aca1e-0x0;var _0x3f63c9=_0x968c[_0x3aca1e];return _0x3f63c9;};'use strict';var _=require(_0xc968('0x0'));var moment=require(_0xc968('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require(_0xc968('0x2'))['db'];var logger=require(_0xc968('0x3'))(_0xc968('0x4'));config['redis']=_['defaults'](config[_0xc968('0x5')],{'host':_0xc968('0x6'),'port':0x18eb});var io=require(_0xc968('0x7'))(new Redis(config[_0xc968('0x5')]));function closeInteractions(){var _0x3648ba=[];return db[_0xc968('0x8')][_0xc968('0x9')]({'raw':!![],'attributes':['id',_0xc968('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xc968('0xb')](0x18,'hours')}}})['then'](function(_0x431b0c){if(_0x431b0c&&_0x431b0c[_0xc968('0xc')]){_0x3648ba=_['map'](_0x431b0c||[],'id');logger[_0xc968('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x3648ba[_0xc968('0xe')]());return db[_0xc968('0x8')][_0xc968('0xf')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xc968('0x10')](_0xc968('0x11'))},{'where':{'id':_0x3648ba}});}})[_0xc968('0x12')](function(){if(_0x3648ba&&_0x3648ba[_0xc968('0xc')]){logger[_0xc968('0xd')](_0xc968('0x13'),_0x3648ba['join']());for(var _0x1bf905=0x0;_0x1bf905<_0x3648ba[_0xc968('0xc')];_0x1bf905++){io[_0xc968('0x14')](_0xc968('0x15'),{'id':_0x3648ba[_0x1bf905],'closed':!![]});}}})[_0xc968('0x16')](function(_0x4c0161){logger[_0xc968('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4c0161?util['inspect'](_0x4c0161,{'showHidden':![],'depth':null}):'');});}exports[_0xc968('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index e09251c..449eb48 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b6e=['bulkCreate','log','finished\x20populating','CmHopper','then','hopper1','hopper2','util','Biondo','innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','destroy'];(function(_0x1c188c,_0x2dd749){var _0x51fa0e=function(_0x2b7a91){while(--_0x2b7a91){_0x1c188c['push'](_0x1c188c['shift']());}};_0x51fa0e(++_0x2dd749);}(_0x6b6e,0x197));var _0xe6b6=function(_0x3aa0f5,_0x3dc956){_0x3aa0f5=_0x3aa0f5-0x0;var _0x121862=_0x6b6e[_0x3aa0f5];return _0x121862;};'use strict';var util=require(_0xe6b6('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xe6b6('0x1')+i,'phone':0xf879fb460+i,'email':_0xe6b6('0x2')+i+_0xe6b6('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe6b6('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe6b6('0x5')](),'updatedAt':Date[_0xe6b6('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe6b6('0x4')]({'id':i,'firstName':_0xe6b6('0x6')+i,'lastName':_0xe6b6('0x1')+i,'phone':0xf879fb460+i,'email':_0xe6b6('0x2')+i+_0xe6b6('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe6b6('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xe6b6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xe6b6('0x7')][_0xe6b6('0x8')]({'where':{}})['then'](function(){return db[_0xe6b6('0x7')][_0xe6b6('0x9')](contacts);})['then'](function(){console[_0xe6b6('0xa')](_0xe6b6('0xb'),'contacts1');return db[_0xe6b6('0xc')][_0xe6b6('0x8')]({'where':{}});})[_0xe6b6('0xd')](function(){return db[_0xe6b6('0xc')]['bulkCreate'](hopper);})[_0xe6b6('0xd')](function(){console[_0xe6b6('0xa')](_0xe6b6('0xb'),_0xe6b6('0xe'));return db[_0xe6b6('0x7')]['bulkCreate'](contacts2);})[_0xe6b6('0xd')](function(){console[_0xe6b6('0xa')]('finished\x20populating','contacts2');return db['CmHopper'][_0xe6b6('0x9')](hopper2);})[_0xe6b6('0xd')](function(){console[_0xe6b6('0xa')](_0xe6b6('0xb'),_0xe6b6('0xf'));})['catch'](function(_0x269936){console['log'](_0x269936);}); \ No newline at end of file +var _0xf5a4=['../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','CmContact','bulkCreate','log','contacts1','CmHopper','then','finished\x20populating','hopper1','hopper2'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xf5a4,0x165));var _0x4f5a=function(_0x2c3eb3,_0x5ddecb){_0x2c3eb3=_0x2c3eb3-0x0;var _0x367243=_0xf5a4[_0x2c3eb3];return _0x367243;};'use strict';var util=require('util');var db=require(_0x4f5a('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4f5a('0x1')]({'id':i,'firstName':_0x4f5a('0x2')+i,'lastName':_0x4f5a('0x3')+i,'phone':0xf879fb460+i,'email':_0x4f5a('0x4')+i+_0x4f5a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x4f5a('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x4f5a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x4f5a('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x4f5a('0x1')]({'id':i,'firstName':_0x4f5a('0x2')+i,'lastName':_0x4f5a('0x3')+i,'phone':0xf879fb460+i,'email':_0x4f5a('0x4')+i+_0x4f5a('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x4f5a('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4f5a('0x6')](),'updatedAt':Date[_0x4f5a('0x6')]()});}db['CmContact'][_0x4f5a('0x7')]({'where':{}})['then'](function(){return db[_0x4f5a('0x8')][_0x4f5a('0x9')](contacts);})['then'](function(){console[_0x4f5a('0xa')]('finished\x20populating',_0x4f5a('0xb'));return db[_0x4f5a('0xc')][_0x4f5a('0x7')]({'where':{}});})[_0x4f5a('0xd')](function(){return db[_0x4f5a('0xc')][_0x4f5a('0x9')](hopper);})[_0x4f5a('0xd')](function(){console['log'](_0x4f5a('0xe'),_0x4f5a('0xf'));return db[_0x4f5a('0x8')][_0x4f5a('0x9')](contacts2);})['then'](function(){console[_0x4f5a('0xa')](_0x4f5a('0xe'),'contacts2');return db[_0x4f5a('0xc')][_0x4f5a('0x9')](hopper2);})['then'](function(){console[_0x4f5a('0xa')](_0x4f5a('0xe'),_0x4f5a('0x10'));})['catch'](function(_0x27eb61){console[_0x4f5a('0xa')](_0x27eb61);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 5e6ad6b..abb00ae 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53c3=['util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x53c3,0xa8));var _0x353c=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x53c3[_0x4a7631];return _0x1a5a6f;};'use strict';var util=require(_0x353c('0x0'));var db=require(_0x353c('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x353c('0x2')]({'name':util['format'](_0x353c('0x3'),_0x353c('0x4'),i),'fullname':util['format'](_0x353c('0x3'),_0x353c('0x4'),i),'email':util[_0x353c('0x5')](_0x353c('0x6'),_0x353c('0x4'),i),'role':_0x353c('0x4'),'password':_0x353c('0x7'),'internal':0xfa0+i,'type':_0x353c('0x8'),'transport':['udp','ws',_0x353c('0x9')],'disallow':[_0x353c('0xa')],'allow':[_0x353c('0xb')],'defaultuser':util[_0x353c('0x5')](_0x353c('0x3'),_0x353c('0x4'),i),'encryption':'yes','avpf':_0x353c('0xc'),'force_avp':_0x353c('0xc'),'icesupport':_0x353c('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x353c('0xd'),'dtlsprivatekey':_0x353c('0xe'),'dtlssetup':_0x353c('0xf'),'callerid':util[_0x353c('0x5')](_0x353c('0x10'),util[_0x353c('0x5')](_0x353c('0x3'),_0x353c('0x4'),i),0xfa0+i)});}db[_0x353c('0x11')][_0x353c('0x12')](users)[_0x353c('0x13')](function(){console[_0x353c('0x14')]('add\x20user');})['catch'](function(_0x7fa671){console[_0x353c('0x14')](_0x7fa671);}); \ No newline at end of file +var _0xb59c=['../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','util'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xb59c,0x1a3));var _0xcb59=function(_0x266297,_0x21cb17){_0x266297=_0x266297-0x0;var _0x203ae0=_0xb59c[_0x266297];return _0x203ae0;};'use strict';var util=require(_0xcb59('0x0'));var db=require(_0xcb59('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xcb59('0x2')]('%s%s','agent',i),'fullname':util[_0xcb59('0x2')](_0xcb59('0x3'),_0xcb59('0x4'),i),'email':util[_0xcb59('0x2')](_0xcb59('0x5'),_0xcb59('0x4'),i),'role':'agent','password':_0xcb59('0x6'),'internal':0xfa0+i,'type':_0xcb59('0x7'),'transport':[_0xcb59('0x8'),'ws',_0xcb59('0x9')],'disallow':[_0xcb59('0xa')],'allow':[_0xcb59('0xb')],'defaultuser':util['format'](_0xcb59('0x3'),_0xcb59('0x4'),i),'encryption':_0xcb59('0xc'),'avpf':_0xcb59('0xc'),'force_avp':'yes','icesupport':_0xcb59('0xc'),'dtlsenable':_0xcb59('0xc'),'dtlsverify':'no','dtlscertfile':_0xcb59('0xd'),'dtlsprivatekey':_0xcb59('0xe'),'dtlssetup':_0xcb59('0xf'),'callerid':util[_0xcb59('0x2')]('\x22%s\x22\x20<%s>',util[_0xcb59('0x2')](_0xcb59('0x3'),_0xcb59('0x4'),i),0xfa0+i)});}db[_0xcb59('0x10')][_0xcb59('0x11')](users)[_0xcb59('0x12')](function(){console[_0xcb59('0x13')](_0xcb59('0x14'));})['catch'](function(_0x4fc1a1){console[_0xcb59('0x13')](_0x4fc1a1);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index a320ab7..69698c2 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f83=['user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','format','%s:queue:%s','user:%s','query','find','userProfileId','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','ChatQueue','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','length','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions'];(function(_0x548135,_0x13138f){var _0x34b35c=function(_0x88fe33){while(--_0x88fe33){_0x548135['push'](_0x548135['shift']());}};_0x34b35c(++_0x13138f);}(_0x6f83,0x72));var _0x36f8=function(_0x32207f,_0x205a28){_0x32207f=_0x32207f-0x0;var _0x392735=_0x6f83[_0x32207f];return _0x392735;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var BPromise=require(_0x36f8('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x36f8('0x2'));var queryQueues={'attributes':['id',_0x36f8('0x3')],'include':[{'as':_0x36f8('0x4'),'model':db[_0x36f8('0x5')],'attributes':['id',_0x36f8('0x3'),_0x36f8('0x6')],'raw':!![],'where':{'role':_0x36f8('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x36f8('0x3')],'where':{'role':_0x36f8('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x36f8('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x36f8('0x3')],'where':{'role':_0x36f8('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x36f8('0x3'),_0x36f8('0x9')],'where':{'type':_0x36f8('0xa')}};function getAssociatedResources(_0x2c9c6f,_0x496f32,_0x48c7b2){return db['UserProfileSection'][_0x36f8('0xb')]({'where':{'name':_0x2c9c6f,'userProfileId':_0x496f32},'raw':!![]})[_0x36f8('0xc')](function(_0x29a8f8){if(_0x29a8f8){if(_0x29a8f8[_0x36f8('0xd')]){switch(_0x2c9c6f){case _0x36f8('0xe'):case _0x36f8('0xf'):case _0x36f8('0x10'):case _0x36f8('0x11'):case _0x36f8('0x12'):case'OpenchannelQueues':case _0x36f8('0x13'):return db[_0x48c7b2][_0x36f8('0x14')](queryQueues);case _0x36f8('0x15'):return db[_0x48c7b2][_0x36f8('0x14')](queryTelephones);case'Trunks':return db[_0x48c7b2][_0x36f8('0x14')](queryTrunks);case _0x36f8('0x16'):return db[_0x48c7b2][_0x36f8('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0x36f8('0x14')]({'attributes':[_0x36f8('0x17')],'where':{'sectionId':_0x29a8f8['id']},'raw':!![]})[_0x36f8('0xc')](function(_0x5048e0){if(_0x5048e0){var _0x429efc={'where':{'id':_[_0x36f8('0x18')](_0x5048e0,_0x36f8('0x17'))},'raw':!![]};switch(_0x48c7b2){case _0x36f8('0x5'):_0x429efc['where']['role']=_0x36f8('0x8');break;case'Campaign':_0x429efc['where'][_0x36f8('0x9')]=_0x36f8('0xa');break;}return db[_0x48c7b2]['findAll'](_0x429efc);}else{return[];}});}}else{return[];}})[_0x36f8('0xc')](function(_0x320be2){return _0x320be2;});}function joinOrLeaveQueues(_0x290e63,_0x337cbb,_0x19d6ce,_0x1086ce){_0x290e63[_0x337cbb](util[_0x36f8('0x19')](_0x36f8('0x1a'),_0x19d6ce,_0x1086ce[_0x36f8('0x3')]));if(_0x1086ce[_0x36f8('0x4')]){for(var _0x26fc64=0x0;_0x26fc64<_0x1086ce[_0x36f8('0x4')]['length'];_0x26fc64+=0x1){_0x290e63[_0x337cbb](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x1086ce[_0x36f8('0x4')][_0x26fc64]['name']));}}}function joinOrLeave(_0x3917f1,_0x52b5ac,_0x362eae){var _0x206075;if(_0x3917f1['handshake'][_0x36f8('0x1c')]['id']){db['User'][_0x36f8('0x1d')]({'attributes':['id',_0x36f8('0x3'),_0x36f8('0x6'),_0x36f8('0x1e')],'where':{'id':_0x3917f1[_0x36f8('0x1f')][_0x36f8('0x1c')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x36f8('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x21')],'as':_0x36f8('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x23')],'as':_0x36f8('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x25')],'as':_0x36f8('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x36f8('0x27')],'as':_0x36f8('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x36f8('0x29'),'attributes':['id'],'raw':!![]}]})[_0x36f8('0xc')](function(_0x3f01a6){if(_0x3f01a6){_0x206075=_0x3f01a6;_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x3f01a6[_0x36f8('0x3')]));var _0x4fedf6=[];switch(_0x3f01a6[_0x36f8('0x6')]){case _0x36f8('0x2a'):_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));if(queryQueues[_0x36f8('0x2d')](_0x36f8('0x2e'))){delete queryQueues[_0x36f8('0x2e')];}_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x30')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db['ChatQueue']['findAll'](queryQueues));_0x4fedf6['push'](db[_0x36f8('0x31')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db['SmsQueue'][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x32')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x33')][_0x36f8('0x14')](queryQueues));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x34')][_0x36f8('0x14')](queryQueues));_0x4fedf6['push'](db[_0x36f8('0x5')][_0x36f8('0x14')](queryTelephones));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x35')][_0x36f8('0x14')](queryTrunks));_0x4fedf6['push'](db[_0x36f8('0x36')][_0x36f8('0x14')](queryCampaigns));_0x4fedf6[_0x36f8('0x2f')](db['User'][_0x36f8('0x14')](queryAgents));break;case _0x36f8('0x37'):_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));_0x4fedf6['push'](getAssociatedResources('VoiceQueues',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x30')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0xf'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x38')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('FaxQueues',_0x3f01a6[_0x36f8('0x1e')],'FaxQueue'));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x11'),_0x3f01a6[_0x36f8('0x1e')],'SmsQueue'));_0x4fedf6['push'](getAssociatedResources(_0x36f8('0x12'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x32')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x39'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x33')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x13'),_0x3f01a6[_0x36f8('0x1e')],'WhatsappQueue'));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources(_0x36f8('0x15'),_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x5')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('Trunks',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x35')));_0x4fedf6[_0x36f8('0x2f')](getAssociatedResources('IvrCampaigns',_0x3f01a6[_0x36f8('0x1e')],_0x36f8('0x36')));_0x4fedf6[_0x36f8('0x2f')](db[_0x36f8('0x5')][_0x36f8('0x14')](queryAgents));break;case'agent':_0x3917f1[_0x52b5ac](_0x36f8('0x2b'));_0x3917f1[_0x52b5ac](_0x36f8('0x2c'));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3a')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3b')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6['push'](_0x3f01a6[_0x36f8('0x3c')]({'attributes':['id','name']}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3d')]({'attributes':['id','name']}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x3e')]({'attributes':['id','name']}));_0x4fedf6['push'](_0x3f01a6[_0x36f8('0x3f')]({'attributes':['id',_0x36f8('0x3')]}));_0x4fedf6[_0x36f8('0x2f')](_0x3f01a6[_0x36f8('0x40')]({'attributes':['id',_0x36f8('0x3')]}));break;}return BPromise['all'](_0x4fedf6);}})['then'](function(_0x116a18){if(_0x116a18&&_0x116a18[_0x36f8('0x41')]){for(var _0x142ec2=0x0;_0x142ec2<_0x116a18[_0x36f8('0x41')];_0x142ec2+=0x1){for(var _0x3925c7=0x0;_0x3925c7<_0x116a18[_0x142ec2]['length'];_0x3925c7+=0x1){switch(_0x142ec2){case 0x0:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,'voice',_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x1:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x42'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x2:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x43'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x3:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x44'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x4:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x45'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x5:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,_0x36f8('0x46'),_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x6:joinOrLeaveQueues(_0x3917f1,_0x52b5ac,'whatsapp',_0x116a18[_0x142ec2][_0x3925c7]);break;case 0x7:if(_0x206075[_0x36f8('0x6')]!=='agent')_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x47'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;case 0x8:if(_0x206075['role']!==_0x36f8('0x7'))_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x48'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;case 0x9:if(_0x206075[_0x36f8('0x6')]!=='agent')_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')]('campaign:%s:%s',_0x116a18[_0x142ec2][_0x3925c7]['type'],_0x116a18[_0x142ec2][_0x3925c7]['name']));break;case 0xa:_0x3917f1[_0x52b5ac](util[_0x36f8('0x19')](_0x36f8('0x1b'),_0x116a18[_0x142ec2][_0x3925c7][_0x36f8('0x3')]));break;}}}}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x52ad3a=_['map'](_0x206075[_0x36f8('0x20')],'id');return _0x206075[_0x36f8('0x4a')](_0x52ad3a)[_0x36f8('0xc')](function(){for(var _0x1af88d=0x0;_0x1af88d<_0x52ad3a['length'];_0x1af88d+=0x1){_0x362eae['emit'](_0x36f8('0x4b'),{'ChatInteractionId':Number(_0x52ad3a[_0x1af88d]),'UserId':Number(_0x206075['id'])});}});}})['then'](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x38aecc=_['map'](_0x206075[_0x36f8('0x22')],'id');return _0x206075['removeMailInteractions'](_0x38aecc)['then'](function(){for(var _0x34a2f5=0x0;_0x34a2f5<_0x38aecc['length'];_0x34a2f5+=0x1){_0x362eae[_0x36f8('0x4c')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x38aecc[_0x34a2f5]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x2c0e9b=_['map'](_0x206075[_0x36f8('0x24')],'id');return _0x206075[_0x36f8('0x4d')](_0x2c0e9b)[_0x36f8('0xc')](function(){for(var _0x5eeb0e=0x0;_0x5eeb0e<_0x2c0e9b[_0x36f8('0x41')];_0x5eeb0e+=0x1){_0x362eae['emit'](_0x36f8('0x4e'),{'FaxInteractionId':Number(_0x2c0e9b[_0x5eeb0e]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x3e275a=_[_0x36f8('0x18')](_0x206075[_0x36f8('0x26')],'id');return _0x206075[_0x36f8('0x4f')](_0x3e275a)[_0x36f8('0xc')](function(){for(var _0x272d66=0x0;_0x272d66<_0x3e275a[_0x36f8('0x41')];_0x272d66+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x50'),{'SmsInteractionId':Number(_0x3e275a[_0x272d66]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x97feac=_[_0x36f8('0x18')](_0x206075['OpenchannelInteractions'],'id');return _0x206075[_0x36f8('0x51')](_0x97feac)['then'](function(){for(var _0x505e4=0x0;_0x505e4<_0x97feac[_0x36f8('0x41')];_0x505e4+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x52'),{'OpenchannelInteractionId':Number(_0x97feac[_0x505e4]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0xc')](function(){if(_0x52b5ac===_0x36f8('0x49')){var _0x65b81c=_[_0x36f8('0x18')](_0x206075[_0x36f8('0x29')],'id');return _0x206075[_0x36f8('0x53')](_0x65b81c)['then'](function(){for(var _0x40bcb7=0x0;_0x40bcb7<_0x65b81c[_0x36f8('0x41')];_0x40bcb7+=0x1){_0x362eae[_0x36f8('0x4c')](_0x36f8('0x54'),{'WhatsappInteractionId':Number(_0x65b81c[_0x40bcb7]),'UserId':Number(_0x206075['id'])});}});}})[_0x36f8('0x55')](function(_0x122ef3){_0x3917f1[_0x36f8('0x56')](_0x122ef3);});}}function onDisconnect(_0x16cc7a,_0x5d3edd){joinOrLeave(_0x16cc7a,_0x36f8('0x49'),_0x5d3edd);}function onConnect(_0x10ca57){joinOrLeave(_0x10ca57,'join');}exports[_0x36f8('0x57')]=function(_0x1c8713){_0x1c8713['on'](_0x36f8('0x58'),function(_0x3fe1e2){_0x3fe1e2[_0x36f8('0x59')](0x0);_0x3fe1e2[_0x36f8('0x5a')]=_0x3fe1e2[_0x36f8('0x5b')][_0x36f8('0x58')][_0x36f8('0x5c')]+':'+_0x3fe1e2['request'][_0x36f8('0x58')]['remotePort'];_0x3fe1e2[_0x36f8('0x5d')]=new Date();_0x3fe1e2[_0x36f8('0x56')]=function(_0x947aae){console[_0x36f8('0x56')](_0x36f8('0x5e')+_0x3fe1e2['nsp']['name']+'['+_0x3fe1e2['address']+']',_0x947aae);};_0x3fe1e2['on'](_0x36f8('0x5f'),function(){onDisconnect(_0x3fe1e2,_0x1c8713);_0x3fe1e2['log'](_0x36f8('0x60'));});onConnect(_0x3fe1e2);_0x3fe1e2[_0x36f8('0x56')]('CONNECTED');});}; \ No newline at end of file +var _0xc110=['SmsQueue','WhatsappQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','map','ChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','leave','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','join','default','connection','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','../mysqldb','./environment','name','User','role','telephone','agent','type','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','Campaign','ivr','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','VoiceQueue','ChatQueue','push','MailQueue','WhatsappQueue','Trunk','user'];(function(_0x1109c0,_0x4afa5c){var _0x438b0a=function(_0xb44eee){while(--_0xb44eee){_0x1109c0['push'](_0x1109c0['shift']());}};_0x438b0a(++_0x4afa5c);}(_0xc110,0x1c1));var _0x0c11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc110[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c11('0x0'));var util=require(_0x0c11('0x1'));var BPromise=require('bluebird');var db=require(_0x0c11('0x2'))['db'];var config=require(_0x0c11('0x3'));var queryQueues={'attributes':['id',_0x0c11('0x4')],'include':[{'as':'Agents','model':db[_0x0c11('0x5')],'attributes':['id',_0x0c11('0x4'),_0x0c11('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x0c11('0x4')],'where':{'role':_0x0c11('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x0c11('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x0c11('0x4')],'where':{'role':_0x0c11('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x0c11('0x4'),_0x0c11('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x414a03,_0x3683b0,_0x3f18a6){return db[_0x0c11('0xa')]['findOne']({'where':{'name':_0x414a03,'userProfileId':_0x3683b0},'raw':!![]})[_0x0c11('0xb')](function(_0xeb5ef3){if(_0xeb5ef3){if(_0xeb5ef3[_0x0c11('0xc')]){switch(_0x414a03){case _0x0c11('0xd'):case _0x0c11('0xe'):case _0x0c11('0xf'):case _0x0c11('0x10'):case _0x0c11('0x11'):case _0x0c11('0x12'):case'WhatsappQueues':return db[_0x3f18a6]['findAll'](queryQueues);case _0x0c11('0x13'):return db[_0x3f18a6][_0x0c11('0x14')](queryTelephones);case _0x0c11('0x15'):return db[_0x3f18a6][_0x0c11('0x14')](queryTrunks);case _0x0c11('0x16'):return db[_0x3f18a6][_0x0c11('0x14')](queryCampaigns);}}else{return db[_0x0c11('0x17')][_0x0c11('0x14')]({'attributes':[_0x0c11('0x18')],'where':{'sectionId':_0xeb5ef3['id']},'raw':!![]})[_0x0c11('0xb')](function(_0xbe6cf2){if(_0xbe6cf2){var _0x5e059e={'where':{'id':_['map'](_0xbe6cf2,'resourceId')},'raw':!![]};switch(_0x3f18a6){case'User':_0x5e059e['where'][_0x0c11('0x6')]='telephone';break;case _0x0c11('0x19'):_0x5e059e['where'][_0x0c11('0x9')]=_0x0c11('0x1a');break;}return db[_0x3f18a6][_0x0c11('0x14')](_0x5e059e);}else{return[];}});}}else{return[];}})[_0x0c11('0xb')](function(_0x43df79){return _0x43df79;});}function joinOrLeaveQueues(_0x58887c,_0x58ef13,_0x4cb85f,_0x56019e){_0x58887c[_0x58ef13](util[_0x0c11('0x1b')](_0x0c11('0x1c'),_0x4cb85f,_0x56019e[_0x0c11('0x4')]));if(_0x56019e[_0x0c11('0x1d')]){for(var _0x1866c9=0x0;_0x1866c9<_0x56019e[_0x0c11('0x1d')]['length'];_0x1866c9+=0x1){_0x58887c[_0x58ef13](util[_0x0c11('0x1b')](_0x0c11('0x1e'),_0x56019e[_0x0c11('0x1d')][_0x1866c9]['name']));}}}function joinOrLeave(_0x10a857,_0x40dedd,_0x203a99){var _0x10b53b;if(_0x10a857[_0x0c11('0x1f')][_0x0c11('0x20')]['id']){db[_0x0c11('0x5')][_0x0c11('0x21')]({'attributes':['id',_0x0c11('0x4'),_0x0c11('0x6'),_0x0c11('0x22')],'where':{'id':_0x10a857[_0x0c11('0x1f')][_0x0c11('0x20')]['id']},'include':[{'model':db[_0x0c11('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x0c11('0x24')],'as':_0x0c11('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x0c11('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x0c11('0x27')],'as':_0x0c11('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x0c11('0x29')],'as':_0x0c11('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x0c11('0x2b')],'as':_0x0c11('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x0c11('0xb')](function(_0xaf81ac){if(_0xaf81ac){_0x10b53b=_0xaf81ac;_0x10a857[_0x40dedd](util[_0x0c11('0x1b')](_0x0c11('0x1e'),_0xaf81ac[_0x0c11('0x4')]));var _0x8d7957=[];switch(_0xaf81ac['role']){case _0x0c11('0x2d'):_0x10a857[_0x40dedd](_0x0c11('0x2e'));_0x10a857[_0x40dedd](_0x0c11('0x2f'));if(queryQueues['hasOwnProperty'](_0x0c11('0x30'))){delete queryQueues[_0x0c11('0x30')];}_0x8d7957['push'](db[_0x0c11('0x31')]['findAll'](queryQueues));_0x8d7957['push'](db[_0x0c11('0x32')]['findAll'](queryQueues));_0x8d7957[_0x0c11('0x33')](db['FaxQueue'][_0x0c11('0x14')](queryQueues));_0x8d7957[_0x0c11('0x33')](db['SmsQueue']['findAll'](queryQueues));_0x8d7957['push'](db[_0x0c11('0x34')][_0x0c11('0x14')](queryQueues));_0x8d7957['push'](db['OpenchannelQueue'][_0x0c11('0x14')](queryQueues));_0x8d7957[_0x0c11('0x33')](db[_0x0c11('0x35')][_0x0c11('0x14')](queryQueues));_0x8d7957[_0x0c11('0x33')](db[_0x0c11('0x5')][_0x0c11('0x14')](queryTelephones));_0x8d7957['push'](db[_0x0c11('0x36')][_0x0c11('0x14')](queryTrunks));_0x8d7957['push'](db[_0x0c11('0x19')]['findAll'](queryCampaigns));_0x8d7957[_0x0c11('0x33')](db['User'][_0x0c11('0x14')](queryAgents));break;case _0x0c11('0x37'):_0x10a857[_0x40dedd](_0x0c11('0x2e'));_0x10a857[_0x40dedd]('voice:outbound');_0x8d7957['push'](getAssociatedResources(_0x0c11('0xd'),_0xaf81ac[_0x0c11('0x22')],_0x0c11('0x31')));_0x8d7957[_0x0c11('0x33')](getAssociatedResources(_0x0c11('0xe'),_0xaf81ac[_0x0c11('0x22')],_0x0c11('0x32')));_0x8d7957[_0x0c11('0x33')](getAssociatedResources(_0x0c11('0xf'),_0xaf81ac[_0x0c11('0x22')],'FaxQueue'));_0x8d7957['push'](getAssociatedResources(_0x0c11('0x10'),_0xaf81ac['userProfileId'],_0x0c11('0x38')));_0x8d7957[_0x0c11('0x33')](getAssociatedResources(_0x0c11('0x11'),_0xaf81ac[_0x0c11('0x22')],'MailQueue'));_0x8d7957[_0x0c11('0x33')](getAssociatedResources('OpenchannelQueues',_0xaf81ac[_0x0c11('0x22')],'OpenchannelQueue'));_0x8d7957[_0x0c11('0x33')](getAssociatedResources(_0x0c11('0x39'),_0xaf81ac[_0x0c11('0x22')],_0x0c11('0x35')));_0x8d7957[_0x0c11('0x33')](getAssociatedResources('Telephones',_0xaf81ac['userProfileId'],_0x0c11('0x5')));_0x8d7957['push'](getAssociatedResources(_0x0c11('0x15'),_0xaf81ac[_0x0c11('0x22')],'Trunk'));_0x8d7957['push'](getAssociatedResources('IvrCampaigns',_0xaf81ac[_0x0c11('0x22')],_0x0c11('0x19')));_0x8d7957[_0x0c11('0x33')](db[_0x0c11('0x5')]['findAll'](queryAgents));break;case'agent':_0x10a857[_0x40dedd](_0x0c11('0x2e'));_0x10a857[_0x40dedd](_0x0c11('0x2f'));_0x8d7957['push'](_0xaf81ac[_0x0c11('0x3a')]({'attributes':['id',_0x0c11('0x4')]}));_0x8d7957[_0x0c11('0x33')](_0xaf81ac[_0x0c11('0x3b')]({'attributes':['id',_0x0c11('0x4')]}));_0x8d7957[_0x0c11('0x33')](_0xaf81ac[_0x0c11('0x3c')]({'attributes':['id',_0x0c11('0x4')]}));_0x8d7957[_0x0c11('0x33')](_0xaf81ac[_0x0c11('0x3d')]({'attributes':['id',_0x0c11('0x4')]}));_0x8d7957[_0x0c11('0x33')](_0xaf81ac[_0x0c11('0x3e')]({'attributes':['id',_0x0c11('0x4')]}));_0x8d7957[_0x0c11('0x33')](_0xaf81ac[_0x0c11('0x3f')]({'attributes':['id',_0x0c11('0x4')]}));_0x8d7957[_0x0c11('0x33')](_0xaf81ac[_0x0c11('0x40')]({'attributes':['id',_0x0c11('0x4')]}));break;}return BPromise[_0x0c11('0x41')](_0x8d7957);}})[_0x0c11('0xb')](function(_0xf5a283){if(_0xf5a283&&_0xf5a283['length']){for(var _0x47a64d=0x0;_0x47a64d<_0xf5a283['length'];_0x47a64d+=0x1){for(var _0x5286e3=0x0;_0x5286e3<_0xf5a283[_0x47a64d][_0x0c11('0x42')];_0x5286e3+=0x1){switch(_0x47a64d){case 0x0:joinOrLeaveQueues(_0x10a857,_0x40dedd,'voice',_0xf5a283[_0x47a64d][_0x5286e3]);break;case 0x1:joinOrLeaveQueues(_0x10a857,_0x40dedd,_0x0c11('0x43'),_0xf5a283[_0x47a64d][_0x5286e3]);break;case 0x2:joinOrLeaveQueues(_0x10a857,_0x40dedd,_0x0c11('0x44'),_0xf5a283[_0x47a64d][_0x5286e3]);break;case 0x3:joinOrLeaveQueues(_0x10a857,_0x40dedd,_0x0c11('0x45'),_0xf5a283[_0x47a64d][_0x5286e3]);break;case 0x4:joinOrLeaveQueues(_0x10a857,_0x40dedd,_0x0c11('0x46'),_0xf5a283[_0x47a64d][_0x5286e3]);break;case 0x5:joinOrLeaveQueues(_0x10a857,_0x40dedd,_0x0c11('0x47'),_0xf5a283[_0x47a64d][_0x5286e3]);break;case 0x6:joinOrLeaveQueues(_0x10a857,_0x40dedd,_0x0c11('0x48'),_0xf5a283[_0x47a64d][_0x5286e3]);break;case 0x7:if(_0x10b53b[_0x0c11('0x6')]!==_0x0c11('0x8'))_0x10a857[_0x40dedd](util[_0x0c11('0x1b')](_0x0c11('0x49'),_0xf5a283[_0x47a64d][_0x5286e3][_0x0c11('0x4')]));break;case 0x8:if(_0x10b53b[_0x0c11('0x6')]!==_0x0c11('0x8'))_0x10a857[_0x40dedd](util[_0x0c11('0x1b')]('trunk:%s',_0xf5a283[_0x47a64d][_0x5286e3][_0x0c11('0x4')]));break;case 0x9:if(_0x10b53b[_0x0c11('0x6')]!==_0x0c11('0x8'))_0x10a857[_0x40dedd](util[_0x0c11('0x1b')](_0x0c11('0x4a'),_0xf5a283[_0x47a64d][_0x5286e3][_0x0c11('0x9')],_0xf5a283[_0x47a64d][_0x5286e3]['name']));break;case 0xa:_0x10a857[_0x40dedd](util[_0x0c11('0x1b')](_0x0c11('0x1e'),_0xf5a283[_0x47a64d][_0x5286e3][_0x0c11('0x4')]));break;}}}}})[_0x0c11('0xb')](function(){if(_0x40dedd==='leave'){var _0x506339=_[_0x0c11('0x4b')](_0x10b53b[_0x0c11('0x4c')],'id');return _0x10b53b['removeChatInteractions'](_0x506339)[_0x0c11('0xb')](function(){for(var _0x353909=0x0;_0x353909<_0x506339[_0x0c11('0x42')];_0x353909+=0x1){_0x203a99[_0x0c11('0x4d')](_0x0c11('0x4e'),{'ChatInteractionId':Number(_0x506339[_0x353909]),'UserId':Number(_0x10b53b['id'])});}});}})[_0x0c11('0xb')](function(){if(_0x40dedd==='leave'){var _0x37db6a=_[_0x0c11('0x4b')](_0x10b53b[_0x0c11('0x25')],'id');return _0x10b53b[_0x0c11('0x4f')](_0x37db6a)['then'](function(){for(var _0x2f50af=0x0;_0x2f50af<_0x37db6a[_0x0c11('0x42')];_0x2f50af+=0x1){_0x203a99['emit'](_0x0c11('0x50'),{'MailInteractionId':Number(_0x37db6a[_0x2f50af]),'UserId':Number(_0x10b53b['id'])});}});}})[_0x0c11('0xb')](function(){if(_0x40dedd==='leave'){var _0x1335f0=_['map'](_0x10b53b['FaxInteractions'],'id');return _0x10b53b[_0x0c11('0x51')](_0x1335f0)[_0x0c11('0xb')](function(){for(var _0x4f3570=0x0;_0x4f3570<_0x1335f0[_0x0c11('0x42')];_0x4f3570+=0x1){_0x203a99[_0x0c11('0x4d')](_0x0c11('0x52'),{'FaxInteractionId':Number(_0x1335f0[_0x4f3570]),'UserId':Number(_0x10b53b['id'])});}});}})['then'](function(){if(_0x40dedd===_0x0c11('0x53')){var _0x134b57=_['map'](_0x10b53b[_0x0c11('0x28')],'id');return _0x10b53b[_0x0c11('0x54')](_0x134b57)[_0x0c11('0xb')](function(){for(var _0x3454e9=0x0;_0x3454e9<_0x134b57[_0x0c11('0x42')];_0x3454e9+=0x1){_0x203a99[_0x0c11('0x4d')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x134b57[_0x3454e9]),'UserId':Number(_0x10b53b['id'])});}});}})[_0x0c11('0xb')](function(){if(_0x40dedd==='leave'){var _0x2bf338=_[_0x0c11('0x4b')](_0x10b53b[_0x0c11('0x2a')],'id');return _0x10b53b[_0x0c11('0x55')](_0x2bf338)[_0x0c11('0xb')](function(){for(var _0x4f9ecb=0x0;_0x4f9ecb<_0x2bf338[_0x0c11('0x42')];_0x4f9ecb+=0x1){_0x203a99[_0x0c11('0x4d')](_0x0c11('0x56'),{'OpenchannelInteractionId':Number(_0x2bf338[_0x4f9ecb]),'UserId':Number(_0x10b53b['id'])});}});}})[_0x0c11('0xb')](function(){if(_0x40dedd===_0x0c11('0x53')){var _0x20648e=_[_0x0c11('0x4b')](_0x10b53b[_0x0c11('0x2c')],'id');return _0x10b53b['removeWhatsappInteractions'](_0x20648e)[_0x0c11('0xb')](function(){for(var _0x15e613=0x0;_0x15e613<_0x20648e[_0x0c11('0x42')];_0x15e613+=0x1){_0x203a99[_0x0c11('0x4d')](_0x0c11('0x57'),{'WhatsappInteractionId':Number(_0x20648e[_0x15e613]),'UserId':Number(_0x10b53b['id'])});}});}})[_0x0c11('0x58')](function(_0x4773cc){_0x10a857['log'](_0x4773cc);});}}function onDisconnect(_0x513cd3,_0x4fae1f){joinOrLeave(_0x513cd3,_0x0c11('0x53'),_0x4fae1f);}function onConnect(_0x4aec36){joinOrLeave(_0x4aec36,_0x0c11('0x59'));}exports[_0x0c11('0x5a')]=function(_0x35b506){_0x35b506['on'](_0x0c11('0x5b'),function(_0x509eda){_0x509eda['setMaxListeners'](0x0);_0x509eda['address']=_0x509eda[_0x0c11('0x5c')]['connection'][_0x0c11('0x5d')]+':'+_0x509eda[_0x0c11('0x5c')][_0x0c11('0x5b')][_0x0c11('0x5e')];_0x509eda[_0x0c11('0x5f')]=new Date();_0x509eda['log']=function(_0x46f581){console[_0x0c11('0x60')](_0x0c11('0x61')+_0x509eda[_0x0c11('0x62')][_0x0c11('0x4')]+'['+_0x509eda['address']+']',_0x46f581);};_0x509eda['on'](_0x0c11('0x63'),function(){onDisconnect(_0x509eda,_0x35b506);_0x509eda[_0x0c11('0x60')](_0x0c11('0x64'));});onConnect(_0x509eda);_0x509eda[_0x0c11('0x60')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 716e9ea..e70d64d 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 _0x3a9e=['closedinteraction','newmessage','ChatOfflineMessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','then','info','EventManager','error','catch','Trigger,\x20%s','get','motionChannel','event','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','contact','UserId','interface','format','SIP/%s','name','channel','outgoingmessage','AfterCreateMessage','offlineMessage','AfterCreate','closed','changed','substatus','SELECT','agent','AfterUpdate','User','find','fullname','default','length','hasOwnProperty','model','hook','callback','condition','../../mysqldb','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate'];(function(_0x3c26cb,_0x2f0bd5){var _0xf5ef93=function(_0x2b58fb){while(--_0x2b58fb){_0x3c26cb['push'](_0x3c26cb['shift']());}};_0xf5ef93(++_0x2f0bd5);}(_0x3a9e,0x19a));var _0xe3a9=function(_0xdf56aa,_0x4d9c15){_0xdf56aa=_0xdf56aa-0x0;var _0x82768=_0x3a9e[_0xdf56aa];return _0x82768;};'use strict';var util=require('util');var db=require(_0xe3a9('0x0'))['db'];var jayson=require(_0xe3a9('0x1'));var logger=require('../logger')(_0xe3a9('0x2'));var client=jayson[_0xe3a9('0x3')][_0xe3a9('0x4')]({'port':0x232a});var triggers=[{'channel':_0xe3a9('0x5'),'model':_0xe3a9('0x6'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0x8'),'callback':afterCreate},{'channel':_0xe3a9('0x5'),'model':_0xe3a9('0x6'),'event':_0xe3a9('0x9'),'condition':_0xe3a9('0xa'),'callback':afterUpdate},{'channel':_0xe3a9('0x5'),'model':'ChatMessage','event':_0xe3a9('0x7'),'condition':_0xe3a9('0xb'),'callback':afterCreateMessage},{'channel':_0xe3a9('0x5'),'model':_0xe3a9('0xc'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xe3a9('0xd'),'model':_0xe3a9('0xe'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0x8'),'callback':afterCreate},{'channel':_0xe3a9('0xd'),'model':_0xe3a9('0xe'),'event':_0xe3a9('0x9'),'condition':_0xe3a9('0xa'),'callback':afterUpdate},{'channel':_0xe3a9('0xd'),'model':'SmsMessage','event':_0xe3a9('0x7'),'condition':_0xe3a9('0xb'),'callback':afterCreateMessage},{'channel':_0xe3a9('0xf'),'model':_0xe3a9('0x10'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0x8'),'callback':afterCreate},{'channel':_0xe3a9('0xf'),'model':_0xe3a9('0x10'),'event':'afterUpdate','condition':_0xe3a9('0xa'),'callback':afterUpdate},{'channel':_0xe3a9('0xf'),'model':_0xe3a9('0x11'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0xb'),'callback':afterCreateMessage},{'channel':_0xe3a9('0x12'),'model':_0xe3a9('0x13'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0x8'),'callback':afterCreate},{'channel':_0xe3a9('0x12'),'model':_0xe3a9('0x13'),'event':_0xe3a9('0x9'),'condition':_0xe3a9('0xa'),'callback':afterUpdate},{'channel':_0xe3a9('0x12'),'model':_0xe3a9('0x14'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0xb'),'callback':afterCreateMessage},{'channel':_0xe3a9('0x15'),'model':_0xe3a9('0x16'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0x8'),'callback':afterCreate},{'channel':_0xe3a9('0x15'),'model':'MailInteraction','event':_0xe3a9('0x9'),'condition':_0xe3a9('0xa'),'callback':afterUpdate},{'channel':_0xe3a9('0x15'),'model':_0xe3a9('0x17'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0xb'),'callback':afterCreateMessage},{'channel':_0xe3a9('0x18'),'model':_0xe3a9('0x19'),'event':_0xe3a9('0x7'),'condition':_0xe3a9('0x8'),'callback':afterCreate},{'channel':_0xe3a9('0x18'),'model':_0xe3a9('0x19'),'event':_0xe3a9('0x9'),'condition':_0xe3a9('0xa'),'callback':afterUpdate},{'channel':_0xe3a9('0x18'),'model':'OpenchannelMessage','event':_0xe3a9('0x7'),'condition':_0xe3a9('0xb'),'callback':afterCreateMessage}];function request(_0x408cb8){return client['request']('EventManager',_0x408cb8)[_0xe3a9('0x1a')](function(_0x2999d0){logger[_0xe3a9('0x1b')]('Trigger,\x20%s',_0xe3a9('0x1c'),_0x2999d0);if(_0x2999d0[_0xe3a9('0x1d')]){if(_0x2999d0[_0xe3a9('0x1d')]['code']===0x1f4){logger[_0xe3a9('0x1d')]('Trigger,\x20%s',_0xe3a9('0x1c'),_0x2999d0[_0xe3a9('0x1d')]);}}})[_0xe3a9('0x1e')](function(_0xe43046){logger['error'](_0xe3a9('0x1f'),'EventManager',_0xe43046);});}function afterCreateMessage(_0x30f02d){return function(_0x15cba0){_0x15cba0=_0x15cba0[_0xe3a9('0x20')]({'plain':!![]});_0x15cba0['channel']=_0x30f02d;_0x15cba0[_0xe3a9('0x21')]=_0x30f02d;_0x15cba0[_0xe3a9('0x22')]=_0x15cba0['direction'];Promise[_0xe3a9('0x23')]()[_0xe3a9('0x1a')](function(){if(typeof _0x15cba0[_0xe3a9('0x24')]===_0xe3a9('0x25'))return null;var _0x22fe4d=_0xe3a9('0x26')+_0x15cba0[_0xe3a9('0x24')];return db[_0xe3a9('0x27')][_0xe3a9('0x28')](_0x22fe4d,{'type':db[_0xe3a9('0x29')][_0xe3a9('0x2a')]['SELECT'],'raw':!![]});})[_0xe3a9('0x1a')](function(_0x2b0b12){if(_0x2b0b12){_0x15cba0[_0xe3a9('0x2b')]=_0x2b0b12[0x0];}if(typeof _0x15cba0['UserId']===_0xe3a9('0x25'))return;return getAgent(_0x15cba0[_0xe3a9('0x2c')]);})[_0xe3a9('0x1a')](function(_0x3f2958){if(_0x3f2958){_0x15cba0[_0xe3a9('0x2d')]=util[_0xe3a9('0x2e')](_0xe3a9('0x2f'),_0x3f2958[_0xe3a9('0x30')]);_0x15cba0['agent']=_0x3f2958;_0x15cba0[_0xe3a9('0x31')]=_0x30f02d;return request({'event':'incomingmessage','message':_0x15cba0});}else{return request({'event':_0xe3a9('0x32'),'message':_0x15cba0});}})['catch'](function(_0x4c8c91){logger[_0xe3a9('0x1d')](_0xe3a9('0x1f'),_0xe3a9('0x33'),_0x4c8c91);});};}function afterCreateOfflineMessage(_0x2f42bd){return function(_0x3827b0){_0x3827b0=_0x3827b0[_0xe3a9('0x20')]({'plain':!![]});_0x3827b0[_0xe3a9('0x31')]=_0x2f42bd;_0x3827b0['motionChannel']=_0x2f42bd;_0x3827b0[_0xe3a9('0x22')]=_0xe3a9('0x34');return request({'event':_0x3827b0[_0xe3a9('0x22')],'message':_0x3827b0});};}function afterCreate(_0x30efdb,_0x309739){return function(_0x5c9b28){_0x5c9b28=_0x5c9b28[_0xe3a9('0x20')]({'plain':!![]});_0x5c9b28[_0xe3a9('0x31')]=_0x30efdb;_0x5c9b28[_0xe3a9('0x21')]=_0x30efdb;_0x5c9b28[_0xe3a9('0x22')]='opened';Promise[_0xe3a9('0x23')]()['then'](function(){var _0x34e0e2=_0xe3a9('0x26')+_0x5c9b28[_0xe3a9('0x24')];return db[_0xe3a9('0x27')][_0xe3a9('0x28')](_0x34e0e2,{'type':db['Sequelize'][_0xe3a9('0x2a')]['SELECT'],'raw':!![]});})['then'](function(_0x30f03d){if(_0x30f03d){_0x5c9b28[_0xe3a9('0x2b')]=_0x30f03d[0x0];}if(typeof _0x5c9b28[_0xe3a9('0x2c')]===_0xe3a9('0x25'))return;return getAgent(_0x5c9b28[_0xe3a9('0x2c')]);})[_0xe3a9('0x1a')](function(_0x4d8d46){if(_0x4d8d46){_0x5c9b28[_0xe3a9('0x2d')]=util[_0xe3a9('0x2e')]('SIP/%s',_0x4d8d46[_0xe3a9('0x30')]);_0x5c9b28['agent']=_0x4d8d46;}return request({'event':_0x309739,'message':_0x5c9b28});})[_0xe3a9('0x1e')](function(_0x55a0f3){logger[_0xe3a9('0x1d')](_0xe3a9('0x1f'),_0xe3a9('0x35'),_0x55a0f3);});};}function afterUpdate(_0x1275a0){return function(_0x4507f3){var _0x3c4e14=_0x4507f3['changed'](_0xe3a9('0x36'))&&_0x4507f3[_0xe3a9('0x36')];var _0xb5f7c6=_0x4507f3[_0xe3a9('0x37')](_0xe3a9('0x38'));if(_0x3c4e14||_0xb5f7c6){var _0x88e380=_0x3c4e14?_0xe3a9('0xa'):_0xe3a9('0x38');var _0x140417=_0x4507f3[_0xe3a9('0x20')]({'plain':!![]});_0x140417[_0xe3a9('0x31')]=_0x1275a0;_0x140417[_0xe3a9('0x21')]=_0x1275a0;_0x140417[_0xe3a9('0x22')]=_0x3c4e14?_0xe3a9('0x36'):_0xe3a9('0x38');var _0x19a19b=_0xe3a9('0x26')+_0x140417[_0xe3a9('0x24')];return db[_0xe3a9('0x27')][_0xe3a9('0x28')](_0x19a19b,{'type':db['Sequelize'][_0xe3a9('0x2a')][_0xe3a9('0x39')],'raw':!![]})[_0xe3a9('0x1a')](function(_0x470c5f){if(_0x470c5f){_0x140417['contact']=_0x470c5f[0x0];}if(typeof _0x140417[_0xe3a9('0x2c')]===_0xe3a9('0x25'))return;return getAgent(_0x140417[_0xe3a9('0x2c')]);})[_0xe3a9('0x1a')](function(_0x57719d){if(_0x57719d){_0x140417['interface']=util[_0xe3a9('0x2e')](_0xe3a9('0x2f'),_0x57719d[_0xe3a9('0x30')]);_0x140417[_0xe3a9('0x3a')]=_0x57719d;}return request({'event':_0x88e380,'message':_0x140417});})[_0xe3a9('0x1e')](function(_0x2791a0){logger[_0xe3a9('0x1d')](_0xe3a9('0x1f'),_0xe3a9('0x3b'),_0x2791a0);});}};}function getAgent(_0x125e6f){return db[_0xe3a9('0x3c')][_0xe3a9('0x3d')]({'where':{'id':_0x125e6f},'attributes':['id',_0xe3a9('0x30'),_0xe3a9('0x3e'),'email','internal'],'raw':!![]})[_0xe3a9('0x1a')](function(_0x52dee9){return _0x52dee9;});}exports[_0xe3a9('0x3f')]=function(){for(var _0x1e79f2=0x0;_0x1e79f2=_0x40d2cb[_0x5b8d('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x20630c(_0x436e9a);})[_0x5b8d('0x15')](function(_0x104076){_0xf6d68d(_0x104076);});});}; \ No newline at end of file +var _0xf841=['then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','getChannels','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','role','User','count','agent'];(function(_0x199ac7,_0x5ac733){var _0x41f2b9=function(_0x4dc3b3){while(--_0x4dc3b3){_0x199ac7['push'](_0x199ac7['shift']());}};_0x41f2b9(++_0x5ac733);}(_0xf841,0x89));var _0x1f84=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xf841[_0x4dab14];return _0xf41aa;};'use strict';var _=require(_0x1f84('0x0'));var BPromise=require(_0x1f84('0x1'));var db=require(_0x1f84('0x2'))['db'];var util=require(_0x1f84('0x3'));var channels=[_0x1f84('0x4'),'mail',_0x1f84('0x5'),_0x1f84('0x6'),'sms','whatsapp','openchannel'];exports[_0x1f84('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x472070){_0x472070=_0x472070[_0x1f84('0x8')]();return _[_0x1f84('0x9')](channels,_0x472070);};exports['clearBlockUser']=function(_0x241286,_0x4261f0,_0x181891,_0x28b101){var _0x432f9b={'loginAttempts':_0x4261f0,'blocked':_0x181891};if(!_[_0x1f84('0xa')](_0x28b101)){_0x432f9b[_0x1f84('0xb')]=_0x28b101;}return _0x241286[_0x1f84('0xc')](_0x432f9b);};exports['getLicense']=function(_0x4323ac){return new BPromise(function(_0x29c071,_0x42b28c){var _0x573c85=0x0;if(_0x4323ac[_0x1f84('0xd')]!=='agent'){_0x29c071(_0x4323ac);}db[_0x1f84('0xe')][_0x1f84('0xf')]({'where':{'role':_0x1f84('0x10'),'online':!![],'id':{'$ne':_0x4323ac['id']}}})[_0x1f84('0x11')](function(_0x15ccd4){_0x573c85=_0x15ccd4;return util[_0x1f84('0x12')]();})[_0x1f84('0x11')](function(_0x58891d){if(_0x58891d&&_0x58891d[_0x1f84('0x13')]&&_0x573c85>=_0x58891d[_0x1f84('0x13')]){throw Error(_0x1f84('0x14'));}_0x29c071(_0x4323ac);})[_0x1f84('0x15')](function(_0x191b7e){_0x42b28c(_0x191b7e);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index c4cd454..1dceb82 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','stack','name','status','send','exports','util','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x212776,_0x38666e){var _0x46b217=function(_0x2f8365){while(--_0x2f8365){_0x212776['push'](_0x212776['shift']());}};_0x46b217(++_0x38666e);}(_0x5b02,0xe9));var _0x25b0=function(_0x1c99eb,_0x25fed7){_0x1c99eb=_0x1c99eb-0x0;var _0x50febd=_0x5b02[_0x1c99eb];return _0x50febd;};'use strict';var util=require(_0x25b0('0x0'));var logger=require(_0x25b0('0x1'))(_0x25b0('0x2'));var APIError=function(_0x1c3295,_0x4ef71c){this['message']=_0x1c3295||_0x25b0('0x3');this['name']=_0x4ef71c||_0x25b0('0x4');util[_0x25b0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x38dc14){this[_0x25b0('0x6')]=_0x38dc14||_0x25b0('0x7');this['name']=_0x25b0('0x7');util[_0x25b0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x49ef3a){this[_0x25b0('0x6')]=_0x49ef3a||'Entity\x20not\x20found';this['name']=_0x25b0('0x8');util[_0x25b0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x358af0){switch(_0x358af0){case'Bad\x20Request':return 0x190;case _0x25b0('0x9'),_0x25b0('0xa'):return 0x193;case _0x25b0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x250d31){return function(_0x2c72f3){logger[_0x25b0('0xb')](_0x2c72f3[_0x25b0('0xc')]);var _0x10c3fb=getStatusCode(_0x2c72f3[_0x25b0('0xd')]);if(_0x2c72f3[_0x25b0('0xd')])delete _0x2c72f3[_0x25b0('0xd')];return _0x250d31[_0x25b0('0xe')](_0x10c3fb)[_0x25b0('0xf')](_0x2c72f3);};}module[_0x25b0('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xe5b5=['name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error'];(function(_0xc636c8,_0x5a4709){var _0x3db044=function(_0x26265b){while(--_0x26265b){_0xc636c8['push'](_0xc636c8['shift']());}};_0x3db044(++_0x5a4709);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0xe5b5[_0x4629ed];return _0x52ca04;};'use strict';var util=require(_0x5e5b('0x0'));var logger=require(_0x5e5b('0x1'))(_0x5e5b('0x2'));var APIError=function(_0x3b3efd,_0x208070){this[_0x5e5b('0x3')]=_0x3b3efd||_0x5e5b('0x4');this[_0x5e5b('0x5')]=_0x208070||_0x5e5b('0x6');util[_0x5e5b('0x7')](APIError,Error);};var APIBadRequestError=function(_0xdc6616){this[_0x5e5b('0x3')]=_0xdc6616||_0x5e5b('0x8');this[_0x5e5b('0x5')]=_0x5e5b('0x8');util[_0x5e5b('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0xe089b1){this[_0x5e5b('0x3')]=_0xe089b1||_0x5e5b('0x9');this[_0x5e5b('0x5')]=_0x5e5b('0xa');util[_0x5e5b('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x3f8534){switch(_0x3f8534){case'Bad\x20Request':return 0x190;case _0x5e5b('0xb'),'OutOfInterval':return 0x193;case _0x5e5b('0xa'):return 0x194;default:return 0x1f4;}}function handleError(_0x58185){return function(_0x23e667){logger[_0x5e5b('0xc')](_0x23e667['stack']);var _0x4a1424=getStatusCode(_0x23e667['name']);if(_0x23e667[_0x5e5b('0x5')])delete _0x23e667[_0x5e5b('0x5')];return _0x58185[_0x5e5b('0xd')](_0x4a1424)[_0x5e5b('0xe')](_0x23e667);};}module[_0x5e5b('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 1cb4700..109155c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa2b1=['status','render','json','send','exports','404'];(function(_0x598aca,_0x1c6f8f){var _0x38a1a9=function(_0x53af82){while(--_0x53af82){_0x598aca['push'](_0x598aca['shift']());}};_0x38a1a9(++_0x1c6f8f);}(_0xa2b1,0x184));var _0x1a2b=function(_0x553142,_0x5c4d48){_0x553142=_0x553142-0x0;var _0x5fb437=_0xa2b1[_0x553142];return _0x5fb437;};'use strict';module[_0x1a2b('0x0')][0x194]=function pageNotFound(_0x16cd59,_0x1ed141){var _0x4c69a6=_0x1a2b('0x1');var _0x89f229=0x194;var _0x419931={'status':_0x89f229};_0x1ed141[_0x1a2b('0x2')](_0x419931[_0x1a2b('0x2')]);_0x1ed141[_0x1a2b('0x3')](_0x4c69a6,{},function(_0xd28231,_0x539a8a){if(_0xd28231){return _0x1ed141[_0x1a2b('0x2')](_0x419931[_0x1a2b('0x2')])[_0x1a2b('0x4')](_0x419931);}_0x1ed141[_0x1a2b('0x5')](_0x539a8a);});}; \ No newline at end of file +var _0x8109=['status','render','json','send','exports'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x8109,0xa9));var _0x9810=function(_0x4c4f9c,_0x22e8c2){_0x4c4f9c=_0x4c4f9c-0x0;var _0x2038a1=_0x8109[_0x4c4f9c];return _0x2038a1;};'use strict';module[_0x9810('0x0')][0x194]=function pageNotFound(_0x5a3842,_0x128cce){var _0x42c4e0='404';var _0x2ba8af=0x194;var _0x1a0705={'status':_0x2ba8af};_0x128cce[_0x9810('0x1')](_0x1a0705[_0x9810('0x1')]);_0x128cce[_0x9810('0x2')](_0x42c4e0,{},function(_0xf73940,_0x4435be){if(_0xf73940){return _0x128cce[_0x9810('0x1')](_0x1a0705[_0x9810('0x1')])[_0x9810('0x3')](_0x1a0705);}_0x128cce[_0x9810('0x4')](_0x4435be);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index a51f9cb..a044041 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e0a=['../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','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','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','cascade','hasOne','UserSetting','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','UserVoicePrefix','UserMailQueue','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','SpiedAgents','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','UserVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','CloudProviderId','restrict','MailAccountId','Imap','Smtp','Answers','Messages','Interactions','Applications','List','Template','TemplateId','Pause','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Teams','Account','ContactId','Tag','Tags','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','ListId','Dispositions','FaxAccountId','FaxApplication','Exntensions','FaxInteractionId','Owner','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','IntervalId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatApplication','ChatMessage','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Action','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','SugarcrmAccount','VariableId','DeskField','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZohoField','Subjects','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','FromId','SessionId','JscriptyAnswerReport','ProjectId','JscriptyProject','user_has_square_projects','TeamVoiceQueue','VoiceQueues','MailQueues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromAgent','ToUserId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToQueue','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','database','username','password','options','User','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','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','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue'];(function(_0xde93b5,_0x4a8b84){var _0x1e91f5=function(_0x1a3ebb){while(--_0x1a3ebb){_0xde93b5['push'](_0xde93b5['shift']());}};_0x1e91f5(++_0x4a8b84);}(_0x0e0a,0x1b5));var _0xa0e0=function(_0x2264b7,_0x5a3536){_0x2264b7=_0x2264b7-0x0;var _0x22680e=_0x0e0a[_0x2264b7];return _0x22680e;};'use strict';var config=require(_0xa0e0('0x0'));var Sequelize=require(_0xa0e0('0x1'));var _=require(_0xa0e0('0x2'));var jstz=require(_0xa0e0('0x3'));var timezone=jstz['determine']();config[_0xa0e0('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0xa0e0('0x4'),'username':_0xa0e0('0x5'),'password':_0xa0e0('0x6'),'options':{'host':_0xa0e0('0x7'),'port':0xcea,'dialect':_0xa0e0('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xa0e0('0x9')](),'define':{'charset':_0xa0e0('0xa'),'collate':_0xa0e0('0xb')}}});config[_0xa0e0('0xc')]=_['defaultsDeep'](config[_0xa0e0('0xc')],{'database':'motion2','username':_0xa0e0('0x5'),'password':_0xa0e0('0x6'),'options':{'host':_0xa0e0('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xa0e0('0xd')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0xa0e0('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa0e0('0x1')][_0xa0e0('0xe')],config[_0xa0e0('0x1')][_0xa0e0('0xf')],config[_0xa0e0('0x1')][_0xa0e0('0x10')],config[_0xa0e0('0x1')][_0xa0e0('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa0e0('0xc')]['database'],config[_0xa0e0('0xc')][_0xa0e0('0xf')],config[_0xa0e0('0xc')][_0xa0e0('0x10')],config[_0xa0e0('0xc')][_0xa0e0('0x11')])};db[_0xa0e0('0x12')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/user/user.model');db[_0xa0e0('0x14')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xa0e0('0x15')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x16'));db[_0xa0e0('0x17')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0xa0e0('0x18')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x19'));db[_0xa0e0('0x1a')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x1b'));db[_0xa0e0('0x1c')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x1d'));db[_0xa0e0('0x1e')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x1f'));db[_0xa0e0('0x20')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x21'));db[_0xa0e0('0x22')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x23'));db[_0xa0e0('0x24')]=db['sequelize']['import'](_0xa0e0('0x25'));db[_0xa0e0('0x26')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x27'));db[_0xa0e0('0x28')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x29'));db['Trunk']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x2a'));db[_0xa0e0('0x2b')]=db['sequelize'][_0xa0e0('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0xa0e0('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xa0e0('0x2c')]=db['sequelize']['import'](_0xa0e0('0x2d'));db['UserMailQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x2e'));db[_0xa0e0('0x2f')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/userFaxQueue/userFaxQueue.model');db[_0xa0e0('0x30')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x31'));db['UserOpenchannelQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x32'));db['UserWhatsappQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x33'));db[_0xa0e0('0x34')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x35'));db[_0xa0e0('0x36')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x37'));db[_0xa0e0('0x38')]=db['sequelize'][_0xa0e0('0x13')]('../api/mailAccount/mailAccount.model');db[_0xa0e0('0x39')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x3a'));db[_0xa0e0('0x3b')]=db[_0xa0e0('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xa0e0('0x3c')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x3d'));db[_0xa0e0('0x3e')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x3f'));db[_0xa0e0('0x40')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x41'));db[_0xa0e0('0x42')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x43'));db[_0xa0e0('0x44')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/dashboard/dashboard.model');db[_0xa0e0('0x45')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x46'));db[_0xa0e0('0x47')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x48'));db['FaxApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/faxApplication/faxApplication.model');db[_0xa0e0('0x49')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x4a'));db[_0xa0e0('0x4b')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x4c'));db['FaxQueue']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x4d'));db['FaxQueueReport']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x4e'));db[_0xa0e0('0x4f')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x50'));db[_0xa0e0('0x51')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/smsApplication/smsApplication.model');db[_0xa0e0('0x52')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x53'));db[_0xa0e0('0x54')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x55'));db[_0xa0e0('0x56')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x57'));db['OpenchannelAccount']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x58'));db['OpenchannelApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x59'));db[_0xa0e0('0x5a')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x5b'));db[_0xa0e0('0x5c')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xa0e0('0x5d')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x5e'));db[_0xa0e0('0x5f')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x60'));db['ChatApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/chatApplication/chatApplication.model');db[_0xa0e0('0x61')]=db[_0xa0e0('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x62'));db[_0xa0e0('0x63')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x64'));db[_0xa0e0('0x65')]=db['sequelize']['import'](_0xa0e0('0x66'));db[_0xa0e0('0x67')]=db['sequelize'][_0xa0e0('0x13')]('../api/chatGroup/chatGroup.model');db[_0xa0e0('0x68')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x69'));db[_0xa0e0('0x6a')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x6b'));db[_0xa0e0('0x6c')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x6d'));db[_0xa0e0('0x6e')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x6f'));db[_0xa0e0('0x70')]=db['sequelize'][_0xa0e0('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xa0e0('0x71')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x72'));db[_0xa0e0('0x73')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x74'));db['ReportAgentPreview']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x75'));db[_0xa0e0('0x76')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x77'));db['Action']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x78'));db[_0xa0e0('0x79')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x7a'));db[_0xa0e0('0x7b')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x7c'));db[_0xa0e0('0x7d')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x7e'));db[_0xa0e0('0x7f')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/condition/condition.model');db[_0xa0e0('0x80')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x81'));db['Pause']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/pause/pause.model');db[_0xa0e0('0x82')]=db['sequelize']['import'](_0xa0e0('0x83'));db[_0xa0e0('0x84')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x85'));db[_0xa0e0('0x86')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x87'));db[_0xa0e0('0x88')]=db[_0xa0e0('0x1')]['import']('../api/sound/sound.model');db['Tag']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x89'));db[_0xa0e0('0x8a')]=db['sequelize'][_0xa0e0('0x13')]('../api/contactItemType/contactItemType.model');db[_0xa0e0('0x8b')]=db['sequelize'][_0xa0e0('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x8c'));db['Template']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x8d'));db['Trigger']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x8e'));db[_0xa0e0('0x8f')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x90'));db['Integration']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x91'));db[_0xa0e0('0x92')]=db['sequelize'][_0xa0e0('0x13')]('../api/integrationReport/integrationReport.model');db[_0xa0e0('0x93')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x94'));db[_0xa0e0('0x95')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x96'));db['AnalyticExtractedReport']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x97'));db['AnalyticMetric']=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x98'));db[_0xa0e0('0x99')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x9a'));db[_0xa0e0('0x9b')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x9c'));db[_0xa0e0('0x9d')]=db['sequelize']['import'](_0xa0e0('0x9e'));db[_0xa0e0('0x9f')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xa0'));db[_0xa0e0('0xa1')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xa2'));db['SugarcrmAccount']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xa0e0('0xa3')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xa4'));db[_0xa0e0('0xa5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xa0e0('0xa6')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xa7'));db[_0xa0e0('0xa8')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xa9'));db['DeskField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xaa'));db[_0xa0e0('0xab')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xac'));db['ZohoConfiguration']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xad'));db['ZohoField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intZohoField/intZohoField.model');db[_0xa0e0('0xae')]=db['sequelize']['import'](_0xa0e0('0xaf'));db['ZendeskConfiguration']=db['sequelize']['import'](_0xa0e0('0xb0'));db['ZendeskField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xb1'));db[_0xa0e0('0xb2')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xb3'));db[_0xa0e0('0xb4')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xa0e0('0xb5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xa0e0('0xb6')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xb7'));db[_0xa0e0('0xb8')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xb9'));db['VtigerField']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xba'));db[_0xa0e0('0xbb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xbc'));db[_0xa0e0('0xbd')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xa0e0('0xbe')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xbf'));db[_0xa0e0('0xc0')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xc1'));db[_0xa0e0('0xc2')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xc3'));db[_0xa0e0('0xc4')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xa0e0('0xc5')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xc6'));db[_0xa0e0('0xc7')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xc8'));db[_0xa0e0('0xc9')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xca'));db[_0xa0e0('0xcb')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x91'));db[_0xa0e0('0xcc')]=db[_0xa0e0('0x1')]['import']('../api/network/network.model');db[_0xa0e0('0xcd')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xce'));db['ChatInternalMessage']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xcf'));db['JscriptyAnswerReport']=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xd0'));db[_0xa0e0('0xd1')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd2'));db[_0xa0e0('0xd3')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd4'));db[_0xa0e0('0xd5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0xa0e0('0xd6')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd7'));db[_0xa0e0('0xd8')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xd9'));db['JscriptyProject']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xda'));db[_0xa0e0('0xdb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xdc'));db[_0xa0e0('0xdd')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xde'));db[_0xa0e0('0xdf')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xe0'));db[_0xa0e0('0xe1')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xe2'));db[_0xa0e0('0xe3')]=db[_0xa0e0('0x1')]['import']('../api/squareMessage/squareMessage.model');db[_0xa0e0('0xe4')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/team/team.model');db[_0xa0e0('0xe5')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xe6'));db[_0xa0e0('0xe7')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xe8'));db[_0xa0e0('0xe9')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0xea'));db[_0xa0e0('0xeb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xec'));db[_0xa0e0('0xed')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xee'));db['MailTransferReport']=db['sequelize']['import'](_0xa0e0('0xef'));db['ChatTransferReport']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0xa0e0('0xf0')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0xa0e0('0xf1')]=db[_0xa0e0('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xa0e0('0xf2')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xf3'));db[_0xa0e0('0xf4')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xf5'));db[_0xa0e0('0xf6')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xf7'));db[_0xa0e0('0xf8')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xf9'));db[_0xa0e0('0xfa')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0xa0e0('0xfb')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0xfc'));db[_0xa0e0('0xfd')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0xfe'));db[_0xa0e0('0xff')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x100'));db['WhatsappApplication']=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0xa0e0('0x101')]=db['sequelize']['import'](_0xa0e0('0x102'));db[_0xa0e0('0x103')]=db[_0xa0e0('0x1')]['import'](_0xa0e0('0x104'));db[_0xa0e0('0x105')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x106'));db[_0xa0e0('0x107')]=db['sequelize'][_0xa0e0('0x13')](_0xa0e0('0x108'));db[_0xa0e0('0x109')]=db['sequelize'][_0xa0e0('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0xa0e0('0x10a')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10b'));db['TeamVoiceQueue']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10c'));db[_0xa0e0('0x10d')]=db[_0xa0e0('0x1')][_0xa0e0('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10e'));db['UserSetting']=db[_0xa0e0('0x1')][_0xa0e0('0x13')](_0xa0e0('0x10f'));db[_0xa0e0('0x12')]['hasOne'](db[_0xa0e0('0x1e')],{'as':_0xa0e0('0x1e'),'onDelete':_0xa0e0('0x110'),'foreignKey':'UserId'});db[_0xa0e0('0x12')][_0xa0e0('0x111')](db[_0xa0e0('0x112')],{'as':'userSetting','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x113')});db['User'][_0xa0e0('0x114')](db['VoiceRecording'],{'as':'Recordings','foreignKey':'UserId'});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x115')],{'as':_0xa0e0('0x116'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db['VoiceExtension'],{'as':_0xa0e0('0x117'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db['User'][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x73')],{'as':_0xa0e0('0x119'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x11b')],{'as':_0xa0e0('0x11c'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')][_0xa0e0('0x114')](db[_0xa0e0('0x61')],{'as':_0xa0e0('0x11d'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db[_0xa0e0('0x52')],{'as':_0xa0e0('0x11e'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xa0e0('0x113')});db['User'][_0xa0e0('0x114')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x11f'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x12')]['hasMany'](db[_0xa0e0('0x101')],{'as':_0xa0e0('0x120'),'foreignKey':_0xa0e0('0x113')});db['User'][_0xa0e0('0x114')](db[_0xa0e0('0xfd')],{'as':_0xa0e0('0x121'),'foreignKey':_0xa0e0('0x122')});db[_0xa0e0('0x12')][_0xa0e0('0x123')](db[_0xa0e0('0xf8')],{'as':_0xa0e0('0xf8'),'foreignKey':_0xa0e0('0x124')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['ChatGroup'],{'as':_0xa0e0('0x126'),'through':_0xa0e0('0x127')});db[_0xa0e0('0x12')]['belongsToMany'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x128'),'through':_0xa0e0('0x129')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['CmList'],{'as':'Lists','through':_0xa0e0('0x12a')});db['User'][_0xa0e0('0x125')](db['Team'],{'through':_0xa0e0('0x12b')});db['User'][_0xa0e0('0x125')](db['MailInteraction'],{'as':_0xa0e0('0x11f'),'through':_0xa0e0('0x12c')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x61')],{'as':_0xa0e0('0x11d'),'through':_0xa0e0('0x12d')});db[_0xa0e0('0x12')]['belongsToMany'](db[_0xa0e0('0x49')],{'as':_0xa0e0('0x12e'),'through':'user_has_fax_interactions'});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x52')],{'as':_0xa0e0('0x11e'),'through':_0xa0e0('0x12f')});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x11b')],{'as':_0xa0e0('0x11c'),'through':_0xa0e0('0x130')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0xa0e0('0x131')});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x132')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db['User'][_0xa0e0('0x125')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xa0e0('0x133'),'required':![]});db[_0xa0e0('0x12')]['belongsToMany'](db['MailQueue'],{'as':'MailQueues','through':_0xa0e0('0x134'),'required':![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x65')],{'as':_0xa0e0('0x135'),'through':_0xa0e0('0x2c'),'required':![],'hooks':!![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x136')],{'as':_0xa0e0('0x137'),'through':_0xa0e0('0x2f'),'required':![]});db[_0xa0e0('0x12')]['belongsToMany'](db['SmsQueue'],{'as':_0xa0e0('0x138'),'through':_0xa0e0('0x30'),'required':![]});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x5c')],{'as':_0xa0e0('0x139'),'through':_0xa0e0('0x13a'),'required':![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x109')],{'as':_0xa0e0('0x13b'),'through':_0xa0e0('0x13c'),'required':![]});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'through':'cm_user_has_lists'});db['User'][_0xa0e0('0x125')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x13d'),'through':_0xa0e0('0x13e')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db['FaxAccount'],{'as':_0xa0e0('0x13f'),'through':_0xa0e0('0x140')});db['User']['belongsToMany'](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x141'),'through':'user_has_mail_accounts'});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0x142')],{'as':_0xa0e0('0x143'),'through':_0xa0e0('0x144')});db[_0xa0e0('0x12')]['belongsToMany'](db[_0xa0e0('0x4f')],{'as':'SmsAccounts','through':_0xa0e0('0x145')});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0xff')],{'as':_0xa0e0('0x146'),'through':'user_has_whatsapp_accounts'});db[_0xa0e0('0x12')][_0xa0e0('0x125')](db[_0xa0e0('0xdf')],{'as':_0xa0e0('0x147'),'through':'user_has_square_projects'});db[_0xa0e0('0x14')][_0xa0e0('0x114')](db[_0xa0e0('0x17')],{'as':_0xa0e0('0x148'),'onDelete':_0xa0e0('0x110'),'foreignKey':'ChanSpyId'});db[_0xa0e0('0x15')]['hasMany'](db[_0xa0e0('0x17')],{'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x17')][_0xa0e0('0x114')](db[_0xa0e0('0x17')],{'as':'Applications','onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x18')][_0xa0e0('0x125')](db[_0xa0e0('0x88')],{'as':_0xa0e0('0x149'),'through':_0xa0e0('0x14a')});db[_0xa0e0('0x132')][_0xa0e0('0x114')](db[_0xa0e0('0x115')],{'as':'Members','foreignKey':_0xa0e0('0x14b')});db[_0xa0e0('0x132')]['hasMany'](db['CmHopper'],{'as':_0xa0e0('0x14c'),'foreignKey':_0xa0e0('0x14b')});db[_0xa0e0('0x132')]['hasMany'](db['CmHopperFinal'],{'as':_0xa0e0('0x118'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xa0e0('0x114')](db[_0xa0e0('0x73')],{'as':_0xa0e0('0x14d'),'foreignKey':'VoiceQueueId'});db[_0xa0e0('0x132')]['hasMany'](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':_0xa0e0('0x14b')});db['VoiceQueue']['hasMany'](db[_0xa0e0('0x70')],{'as':_0xa0e0('0x14e'),'foreignKey':_0xa0e0('0x14b')});db[_0xa0e0('0x132')][_0xa0e0('0x114')](db['JscriptySessionReport'],{'as':_0xa0e0('0x14f'),'foreignKey':'VoiceQueueId'});db[_0xa0e0('0x132')][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x150'),'foreignKey':_0xa0e0('0x151')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0xa0e0('0x152'),'foreignKey':'TrunkBackupId'});db[_0xa0e0('0x132')][_0xa0e0('0x123')](db[_0xa0e0('0x80')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xa0e0('0x132')]['belongsTo'](db['Pause'],{'as':_0xa0e0('0x153'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x154'),'through':_0xa0e0('0x155')});db[_0xa0e0('0x132')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x157')});db[_0xa0e0('0x132')][_0xa0e0('0x125')](db[_0xa0e0('0xe4')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0xa0e0('0x132')][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x158'),'through':_0xa0e0('0x159')});db[_0xa0e0('0x1a')]['belongsTo'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x1c')]['belongsTo'](db[_0xa0e0('0x12')],{'as':'User','foreignKey':'UserId'});db[_0xa0e0('0x1e')]['hasMany'](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x15a'),'sourceKey':_0xa0e0('0x15b')});db[_0xa0e0('0x20')][_0xa0e0('0x123')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xa0e0('0x15b')});db[_0xa0e0('0x15c')][_0xa0e0('0x114')](db[_0xa0e0('0x26')],{'as':_0xa0e0('0x15d'),'foreignKey':_0xa0e0('0x15e'),'constraints':![]});db[_0xa0e0('0x15c')]['hasMany'](db[_0xa0e0('0x24')],{'as':_0xa0e0('0x15f'),'foreignKey':_0xa0e0('0x15e'),'constraints':![]});db[_0xa0e0('0x15c')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x15c')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x38'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x34')][_0xa0e0('0x123')](db['CloudProvider'],{'as':_0xa0e0('0x10a'),'foreignKey':_0xa0e0('0x161'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x36')][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x38'),'foreignKey':_0xa0e0('0x163')});db[_0xa0e0('0x36')][_0xa0e0('0x123')](db[_0xa0e0('0x10a')],{'as':_0xa0e0('0x10a'),'foreignKey':_0xa0e0('0x161'),'onDelete':'restrict'});db['MailAccount']['hasOne'](db[_0xa0e0('0x34')],{'as':_0xa0e0('0x164'),'onDelete':_0xa0e0('0x110')});db['MailAccount'][_0xa0e0('0x111')](db[_0xa0e0('0x36')],{'as':_0xa0e0('0x165'),'onDelete':'cascade'});db[_0xa0e0('0x38')]['hasMany'](db[_0xa0e0('0x7d')],{'as':'Dispositions','foreignKey':_0xa0e0('0x163'),'onDelete':'cascade'});db[_0xa0e0('0x38')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x38')][_0xa0e0('0x114')](db['MailMessage'],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x163')});db[_0xa0e0('0x38')][_0xa0e0('0x114')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x168')});db['MailAccount'][_0xa0e0('0x114')](db['MailApplication'],{'as':_0xa0e0('0x169')});db[_0xa0e0('0x38')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':'ListId'});db[_0xa0e0('0x38')]['belongsTo'](db[_0xa0e0('0x16b')],{'as':'Template','foreignKey':_0xa0e0('0x16c')});db[_0xa0e0('0x38')]['belongsTo'](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x38')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x16f')});db['MailQueue'][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x134')});db['MailQueue'][_0xa0e0('0x125')](db[_0xa0e0('0xe4')],{'through':_0xa0e0('0x170'),'as':_0xa0e0('0x171')});db['MailInteraction'][_0xa0e0('0x114')](db[_0xa0e0('0x3e')],{'as':_0xa0e0('0x167'),'onDelete':_0xa0e0('0x110'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x172'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x3c')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x3c')]['belongsTo'](db[_0xa0e0('0x12')],{'as':'Owner','foreignKey':_0xa0e0('0x113')});db['MailInteraction'][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':'mail_interaction_has_tags','as':_0xa0e0('0x175')});db[_0xa0e0('0x3c')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x176'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x3c')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':'user_has_mail_interactions','foreignKey':_0xa0e0('0x179')});db[_0xa0e0('0x3e')]['hasMany'](db[_0xa0e0('0xeb')],{'as':_0xa0e0('0x17a'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x160')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x179')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'as':_0xa0e0('0x172'),'foreignKey':'MailAccountId'});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x5d'),'foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x3e')][_0xa0e0('0x123')](db[_0xa0e0('0x63')],{'as':_0xa0e0('0x63'),'foreignKey':_0xa0e0('0x17d')});db[_0xa0e0('0x40')][_0xa0e0('0x123')](db['User'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x40')][_0xa0e0('0x123')](db[_0xa0e0('0x39')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x40')][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{'onDelete':'restrict'});db[_0xa0e0('0x40')]['belongsTo'](db[_0xa0e0('0x80')],{'onDelete':_0xa0e0('0x162'),'foreignKey':'IntervalId'});db[_0xa0e0('0x40')]['belongsTo'](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x17e')});db['MailQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x38')],{});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x42')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0x3c')],{});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0x3e')],{});db[_0xa0e0('0x42')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db['MailQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x39')],{});db[_0xa0e0('0x44')][_0xa0e0('0x114')](db[_0xa0e0('0x45')],{'as':'Items','onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x47')][_0xa0e0('0x114')](db['Disposition'],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x181'),'onDelete':'cascade'});db[_0xa0e0('0x47')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x181')});db['FaxAccount']['hasMany'](db[_0xa0e0('0x49')],{'as':_0xa0e0('0x168')});db['FaxAccount']['hasMany'](db[_0xa0e0('0x182')],{'as':_0xa0e0('0x169')});db[_0xa0e0('0x47')]['hasMany'](db[_0xa0e0('0x17')],{'as':_0xa0e0('0x183'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x47')][_0xa0e0('0x114')](db[_0xa0e0('0x4b')],{'as':_0xa0e0('0x167')});db['FaxAccount'][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x150')});db[_0xa0e0('0x47')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db['FaxAccount'][_0xa0e0('0x123')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x47')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x140')});db[_0xa0e0('0x182')][_0xa0e0('0x123')](db['User'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x182')][_0xa0e0('0x123')](db[_0xa0e0('0x136')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x182')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x182')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa0e0('0x17e')});db[_0xa0e0('0x49')][_0xa0e0('0x114')](db['FaxMessage'],{'as':_0xa0e0('0x167'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x184')});db[_0xa0e0('0x49')][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x181')});db['FaxInteraction'][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':'ContactId'});db[_0xa0e0('0x49')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x49')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':'fax_interaction_has_tags','as':_0xa0e0('0x175')});db[_0xa0e0('0x49')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x186'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x49')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x187'),'foreignKey':_0xa0e0('0x184')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':'cascade','as':_0xa0e0('0x12')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0x49')],{'as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x184')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':'cascade','as':_0xa0e0('0x160')});db[_0xa0e0('0x4b')][_0xa0e0('0x123')](db[_0xa0e0('0xeb')],{'as':'Attachment','foreignKey':_0xa0e0('0x188')});db['FaxMessage'][_0xa0e0('0x123')](db['FaxAccount'],{'as':'Account','foreignKey':_0xa0e0('0x181')});db[_0xa0e0('0x136')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':'Agents','through':_0xa0e0('0x2f')});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0xa0e0('0x189'),'as':'Teams'});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{});db['FaxQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':'ListId'});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x49')],{});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x4b')],{});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db[_0xa0e0('0x18a')][_0xa0e0('0x123')](db['FaxQueue'],{});db['SmsAccount'][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x18b'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x4f')]['hasMany'](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x18b')});db[_0xa0e0('0x4f')]['hasMany'](db[_0xa0e0('0x54')],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x18b')});db[_0xa0e0('0x4f')]['hasMany'](db[_0xa0e0('0x52')],{'as':'Interactions'});db['SmsAccount']['hasMany'](db[_0xa0e0('0x51')],{'as':_0xa0e0('0x169')});db[_0xa0e0('0x4f')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x4f')][_0xa0e0('0x123')](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x4f')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x145')});db['SmsApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x162')});db['SmsApplication'][_0xa0e0('0x123')](db['SmsQueue'],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x51')]['belongsTo'](db[_0xa0e0('0x4f')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x51')][_0xa0e0('0x123')](db[_0xa0e0('0x80')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0x51')][_0xa0e0('0x123')](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x17e')});db['SmsInteraction']['hasMany'](db['SmsMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x4f')],{'as':_0xa0e0('0x172'),'foreignKey':'SmsAccountId'});db[_0xa0e0('0x52')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x52')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':'UserId'});db[_0xa0e0('0x52')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x18d'),'as':_0xa0e0('0x175')});db[_0xa0e0('0x52')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x18d'),'as':_0xa0e0('0x177')});db['SmsInteraction'][_0xa0e0('0x125')](db['User'],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0xa0e0('0x18e')});db[_0xa0e0('0x54')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x12')});db[_0xa0e0('0x54')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x160')});db['SmsMessage']['belongsTo'](db[_0xa0e0('0x52')],{'onDelete':'cascade','as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x18e')});db[_0xa0e0('0x54')]['belongsTo'](db[_0xa0e0('0x4f')],{'as':_0xa0e0('0x172'),'foreignKey':'SmsAccountId'});db[_0xa0e0('0x56')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x30'),'foreignKey':_0xa0e0('0x18f')});db[_0xa0e0('0x56')][_0xa0e0('0x125')](db['Team'],{'through':_0xa0e0('0x190'),'as':'Teams'});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x191'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x142')]['hasMany'](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db[_0xa0e0('0x11b')],{'as':_0xa0e0('0x168'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x114')](db[_0xa0e0('0x192')],{'as':_0xa0e0('0x169'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x142')][_0xa0e0('0x123')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xa0e0('0x142')][_0xa0e0('0x123')](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x142')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0xa0e0('0x162')});db['OpenchannelApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x5c')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x193')});db['OpenchannelApplication'][_0xa0e0('0x123')](db['OpenchannelAccount'],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x192')]['belongsTo'](db[_0xa0e0('0x80')],{'onDelete':_0xa0e0('0x162'),'foreignKey':'IntervalId'});db[_0xa0e0('0x192')][_0xa0e0('0x123')](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':_0xa0e0('0x17e')});db[_0xa0e0('0x11b')]['hasMany'](db[_0xa0e0('0x5a')],{'as':_0xa0e0('0x167'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xa0e0('0x11b')][_0xa0e0('0x123')](db[_0xa0e0('0x142')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x11b')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':'Contact','foreignKey':'ContactId'});db[_0xa0e0('0x11b')][_0xa0e0('0x123')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xa0e0('0x11b')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x194'),'as':_0xa0e0('0x175')});db[_0xa0e0('0x11b')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xa0e0('0x11b')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x130'),'foreignKey':_0xa0e0('0x195')});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db['User'],{'onDelete':_0xa0e0('0x110'),'as':'User'});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db['CmContact'],{'onDelete':'cascade','as':_0xa0e0('0x160')});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db[_0xa0e0('0x11b')],{'onDelete':_0xa0e0('0x110'),'as':'Interaction','foreignKey':_0xa0e0('0x195')});db[_0xa0e0('0x5a')][_0xa0e0('0x123')](db[_0xa0e0('0xeb')],{'as':_0xa0e0('0xeb'),'foreignKey':_0xa0e0('0x188')});db['OpenchannelMessage'][_0xa0e0('0x123')](db[_0xa0e0('0x142')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x191')});db[_0xa0e0('0x5c')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x13a'),'foreignKey':_0xa0e0('0x193')});db[_0xa0e0('0x5c')][_0xa0e0('0x125')](db[_0xa0e0('0xe4')],{'through':_0xa0e0('0x196'),'as':_0xa0e0('0x171')});db[_0xa0e0('0x5d')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x5d')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x5d')]['hasMany'](db['ChatProactiveAction'],{'as':_0xa0e0('0x197')});db['ChatWebsite'][_0xa0e0('0x114')](db[_0xa0e0('0x61')],{'as':_0xa0e0('0x168')});db['ChatWebsite']['hasMany'](db[_0xa0e0('0x198')],{'as':_0xa0e0('0x169')});db['ChatWebsite'][_0xa0e0('0x114')](db[_0xa0e0('0x199')],{'as':_0xa0e0('0x167')});db[_0xa0e0('0x5d')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x5d')][_0xa0e0('0x123')](db[_0xa0e0('0x80')],{'as':_0xa0e0('0x80'),'foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0x5d')]['belongsTo'](db[_0xa0e0('0x38')],{'as':'MailAccount','foreignKey':_0xa0e0('0x163')});db[_0xa0e0('0x5d')]['belongsTo'](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0x5d')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':'Agents','through':_0xa0e0('0x13e')});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db[_0xa0e0('0x142')],{});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db['CmList'],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x5f')]['belongsTo'](db[_0xa0e0('0x11b')],{});db['OpenchannelQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x5a')],{});db['OpenchannelQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db[_0xa0e0('0x5f')][_0xa0e0('0x123')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x19a'),'foreignKey':_0xa0e0('0x113'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x198')][_0xa0e0('0x123')](db['ChatQueue'],{'as':_0xa0e0('0x19b'),'foreignKey':_0xa0e0('0x19c'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x198')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0xa0e0('0x17c'),'onDelete':_0xa0e0('0x162')});db['ChatApplication'][_0xa0e0('0x123')](db[_0xa0e0('0x174')],{'onDelete':_0xa0e0('0x162'),'foreignKey':'TagId'});db[_0xa0e0('0x61')][_0xa0e0('0x114')](db[_0xa0e0('0x199')],{'as':_0xa0e0('0x167'),'onDelete':'cascade','foreignKey':_0xa0e0('0x19d')});db['ChatInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':'Account','foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x61')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x61')][_0xa0e0('0x123')](db['User'],{'as':_0xa0e0('0x185'),'foreignKey':_0xa0e0('0x113')});db[_0xa0e0('0x61')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x19e'),'as':_0xa0e0('0x175')});db[_0xa0e0('0x61')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x19e'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x61')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':'user_has_chat_interactions','foreignKey':_0xa0e0('0x19d')});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':'cascade','as':_0xa0e0('0x12')});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':'cascade','as':_0xa0e0('0x160'),'foreignKey':'ContactId'});db['ChatMessage']['belongsTo'](db[_0xa0e0('0x61')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x17b'),'foreignKey':_0xa0e0('0x19d')});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db['Attachment'],{'as':_0xa0e0('0xeb'),'foreignKey':'AttachmentId'});db[_0xa0e0('0x199')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x17c')});db[_0xa0e0('0x63')][_0xa0e0('0x114')](db['Attachment'],{'as':_0xa0e0('0x17a'),'foreignKey':_0xa0e0('0x17d'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x63')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'onDelete':_0xa0e0('0x110'),'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x63')]['belongsTo'](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x172'),'foreignKey':'ChatWebsiteId'});db[_0xa0e0('0x65')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x2c'),'hooks':!![]});db[_0xa0e0('0x65')]['belongsToMany'](db['Team'],{'through':_0xa0e0('0x19f'),'as':_0xa0e0('0x171')});db['ChatGroup']['hasMany'](db[_0xa0e0('0x1a0')],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x1a1'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x67')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':'Members','through':_0xa0e0('0x127')});db[_0xa0e0('0x68')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'as':_0xa0e0('0x1a2'),'foreignKey':_0xa0e0('0x17c')});db['CmCompany']['hasMany'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x128'),'foreignKey':_0xa0e0('0x1a3')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x8b')],{'as':_0xa0e0('0x1a4'),'foreignKey':_0xa0e0('0x1a5')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x6e')],{'as':_0xa0e0('0x14c'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':'ContactId'});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x73')],{'as':_0xa0e0('0x14d'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':'ContactId'});db[_0xa0e0('0x6c')]['hasMany'](db[_0xa0e0('0xd3')],{'as':_0xa0e0('0x14f'),'foreignKey':'ContactId'});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db['OpenchannelInteraction'],{'as':_0xa0e0('0x11c'),'foreignKey':'ContactId','onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x162')});db['CmContact'][_0xa0e0('0x114')](db[_0xa0e0('0x52')],{'as':_0xa0e0('0x11e'),'foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x162')});db['CmContact'][_0xa0e0('0x114')](db[_0xa0e0('0x49')],{'as':'FaxInteractions','foreignKey':_0xa0e0('0x173'),'onDelete':'restrict'});db[_0xa0e0('0x6c')][_0xa0e0('0x114')](db[_0xa0e0('0x3c')],{'as':_0xa0e0('0x11f'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa0e0('0x6c')][_0xa0e0('0x123')](db[_0xa0e0('0x6a')],{'as':_0xa0e0('0x1a6'),'foreignKey':_0xa0e0('0x1a3')});db[_0xa0e0('0x6c')]['belongsTo'](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db['CmContact']['belongsToMany'](db['User'],{'as':'Users','through':_0xa0e0('0x129')});db[_0xa0e0('0x6c')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'as':_0xa0e0('0x175'),'through':_0xa0e0('0x1a7')});db[_0xa0e0('0x6c')]['belongsToMany'](db[_0xa0e0('0x174')],{'through':'cm_contact_has_tags','as':_0xa0e0('0x177')});db[_0xa0e0('0x6e')][_0xa0e0('0x114')](db[_0xa0e0('0x1a8')],{'as':'AdditionalPhones','foreignKey':_0xa0e0('0x1a9')});db[_0xa0e0('0x6e')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x6e')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f'),'onDelete':_0xa0e0('0x110')});db['CmHopper'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x19a'),'foreignKey':_0xa0e0('0x113')});db['CmHopper'][_0xa0e0('0x123')](db[_0xa0e0('0x132')],{'as':_0xa0e0('0x19b'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xa0e0('0x6e')][_0xa0e0('0x123')](db[_0xa0e0('0xe7')],{'as':_0xa0e0('0xe7'),'foreignKey':_0xa0e0('0x1aa'),'onDelete':_0xa0e0('0x110')});db['CmHopper'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':_0xa0e0('0x1ab')});db[_0xa0e0('0x70')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173'),'onDelete':_0xa0e0('0x110')});db['CmHopperBlack'][_0xa0e0('0x123')](db['CmList'],{'as':_0xa0e0('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xa0e0('0x70')]['belongsTo'](db[_0xa0e0('0x132')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xa0e0('0x70')][_0xa0e0('0x123')](db[_0xa0e0('0xe7')],{'as':_0xa0e0('0xe7'),'foreignKey':_0xa0e0('0x1aa'),'onDelete':'cascade'});db['Automation'][_0xa0e0('0x114')](db[_0xa0e0('0x7f')],{'as':{'plural':'All','singular':_0xa0e0('0x1ac')},'foreignKey':_0xa0e0('0x1ad'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x79')]['hasMany'](db[_0xa0e0('0x7f')],{'as':{'plural':_0xa0e0('0x1ae'),'singular':_0xa0e0('0x1af')},'foreignKey':_0xa0e0('0x1b0'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x79')][_0xa0e0('0x114')](db['Action'],{'as':_0xa0e0('0x1b1'),'foreignKey':_0xa0e0('0x1b2'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x7d')][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x1b3'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0x80')][_0xa0e0('0x114')](db[_0xa0e0('0x80')],{'as':_0xa0e0('0x1b4'),'foreignKey':_0xa0e0('0x18c'),'onDelete':_0xa0e0('0x110'),'hooks':!![],'required':![]});db['Interval'][_0xa0e0('0x114')](db[_0xa0e0('0x17')],{'as':'Extensions','foreignKey':_0xa0e0('0x18c'),'onDelete':_0xa0e0('0x162')});db['Interval'][_0xa0e0('0x114')](db[_0xa0e0('0x40')],{'as':_0xa0e0('0x1b5'),'foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0x80')]['hasMany'](db[_0xa0e0('0x198')],{'as':_0xa0e0('0x1b6'),'foreignKey':_0xa0e0('0x18c')});db['Interval'][_0xa0e0('0x114')](db[_0xa0e0('0x182')],{'as':_0xa0e0('0x1b7'),'foreignKey':'IntervalId'});db['Interval'][_0xa0e0('0x114')](db['SmsApplication'],{'as':_0xa0e0('0x1b8'),'foreignKey':'IntervalId'});db[_0xa0e0('0x86')]['belongsTo'](db['MailAccount'],{});db['Schedule'][_0xa0e0('0x123')](db['AnalyticDefaultReport'],{'foreignKey':_0xa0e0('0x1b9')});db[_0xa0e0('0x86')]['belongsTo'](db[_0xa0e0('0x93')],{'foreignKey':_0xa0e0('0x1ba')});db[_0xa0e0('0x88')][_0xa0e0('0x125')](db[_0xa0e0('0x18')],{'as':_0xa0e0('0x1bb'),'through':_0xa0e0('0x14a'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x174')][_0xa0e0('0x125')](db[_0xa0e0('0x6c')],{'through':_0xa0e0('0x1a7')});db['Tag']['belongsToMany'](db[_0xa0e0('0x61')],{'through':_0xa0e0('0x19e')});db[_0xa0e0('0x174')]['belongsToMany'](db[_0xa0e0('0x3c')],{'through':_0xa0e0('0x176')});db['Tag'][_0xa0e0('0x125')](db[_0xa0e0('0x52')],{'through':_0xa0e0('0x18d')});db[_0xa0e0('0x174')][_0xa0e0('0x125')](db[_0xa0e0('0x49')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xa0e0('0x125')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xa0e0('0x174')][_0xa0e0('0x125')](db[_0xa0e0('0x101')],{'through':_0xa0e0('0x1bc')});db[_0xa0e0('0x8b')]['belongsTo'](db[_0xa0e0('0x8a')],{'as':'ItemType','foreignKey':_0xa0e0('0x1bd')});db[_0xa0e0('0x1a8')]['belongsTo'](db['CmHopper'],{'as':_0xa0e0('0x1be'),'foreignKey':_0xa0e0('0x1a9')});db[_0xa0e0('0x8b')][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x1a5')});db[_0xa0e0('0x1bf')][_0xa0e0('0x114')](db[_0xa0e0('0x7f')],{'as':{'plural':'AllConditions','singular':_0xa0e0('0x1c0')},'foreignKey':_0xa0e0('0x1c1'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x1bf')][_0xa0e0('0x114')](db[_0xa0e0('0x7f')],{'as':{'plural':_0xa0e0('0x1c2'),'singular':_0xa0e0('0x1c3')},'foreignKey':'TriggerAnyId','onDelete':_0xa0e0('0x110'),'hooks':!![]});db['Trigger'][_0xa0e0('0x114')](db[_0xa0e0('0x1c4')],{'as':_0xa0e0('0x1b1'),'foreignKey':_0xa0e0('0x1c5'),'onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x93')][_0xa0e0('0x114')](db[_0xa0e0('0x99')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0xa0e0('0x114')](db[_0xa0e0('0x99')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':'DefaultReportId'});db[_0xa0e0('0x1c7')][_0xa0e0('0x114')](db['AnalyticFieldReport'],{'as':_0xa0e0('0x1c6'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1c8')});db[_0xa0e0('0x99')][_0xa0e0('0x123')](db[_0xa0e0('0x1c7')],{'foreignKey':_0xa0e0('0x1c8')});db[_0xa0e0('0x9d')][_0xa0e0('0x114')](db['SalesforceConfiguration'],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db['SalesforceConfiguration'][_0xa0e0('0x114')](db['SalesforceField'],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cb')});db['SalesforceConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1cc'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x9f')]['hasMany'](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0x9f')]['belongsTo'](db[_0xa0e0('0x9d')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db['SalesforceField']['hasMany'](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xa1')][_0xa0e0('0x114')](db[_0xa0e0('0xa1')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xa1')][_0xa0e0('0x114')](db[_0xa0e0('0xa1')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db['SalesforceField'][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':'VariableId'});db[_0xa0e0('0x1d1')][_0xa0e0('0x114')](db[_0xa0e0('0xa3')],{'as':'Configurations','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xa3')][_0xa0e0('0x114')](db[_0xa0e0('0xa5')],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xa3')]['hasMany'](db['SugarcrmField'],{'as':_0xa0e0('0x1cc'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xa3')][_0xa0e0('0x114')](db[_0xa0e0('0xa5')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xa3')][_0xa0e0('0x123')](db[_0xa0e0('0x1d1')],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db[_0xa0e0('0xa5')][_0xa0e0('0x114')](db['SugarcrmField'],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xa5')][_0xa0e0('0x114')](db[_0xa0e0('0xa5')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xa5')]['hasMany'](db[_0xa0e0('0xa5')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xa5')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xa0e0('0x1d2')});db['DeskAccount'][_0xa0e0('0x114')](db[_0xa0e0('0xa8')],{'as':'Configurations','onDelete':_0xa0e0('0x110'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':'SubjectId'});db[_0xa0e0('0xa8')][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':_0xa0e0('0x1cc'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1cd')});db['DeskConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xa8')][_0xa0e0('0x123')](db[_0xa0e0('0xa6')],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db[_0xa0e0('0xa8')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1d4')});db[_0xa0e0('0x1d3')][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa0e0('0x1d3')][_0xa0e0('0x114')](db['DeskField'],{'as':'Description','foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x1d3')][_0xa0e0('0x114')](db[_0xa0e0('0x1d3')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0x1d3')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':'Variable','foreignKey':'VariableId'});db['ZohoAccount'][_0xa0e0('0x114')](db['ZohoConfiguration'],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1d6')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1d8'),'onDelete':_0xa0e0('0x110'),'foreignKey':'SubjectId'});db[_0xa0e0('0x1d6')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1cc'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x1d6')][_0xa0e0('0x114')](db['ZohoField'],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0x1d6')][_0xa0e0('0x123')](db[_0xa0e0('0xab')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1d7')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0x1d7')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1d0'),'foreignKey':'DescriptionId'});db[_0xa0e0('0x1d7')][_0xa0e0('0x114')](db[_0xa0e0('0x1d7')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0x1d7')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db['ZendeskAccount'][_0xa0e0('0x114')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1d9')]['hasMany'](db[_0xa0e0('0x1da')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xa0e0('0x1d9')][_0xa0e0('0x114')](db['ZendeskField'],{'as':_0xa0e0('0x1cc'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0x1d9')][_0xa0e0('0x114')](db[_0xa0e0('0x1da')],{'as':_0xa0e0('0x1c6'),'foreignKey':'FieldId'});db[_0xa0e0('0x1d9')][_0xa0e0('0x123')](db['ZendeskAccount'],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db['ZendeskConfiguration']['belongsToMany'](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1db')});db[_0xa0e0('0x1da')]['hasMany'](db[_0xa0e0('0x1da')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0x1da')][_0xa0e0('0x114')](db[_0xa0e0('0x1da')],{'as':_0xa0e0('0x1d0'),'foreignKey':'DescriptionId'});db[_0xa0e0('0x1da')][_0xa0e0('0x114')](db[_0xa0e0('0x1da')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db['ZendeskField'][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db[_0xa0e0('0xb2')][_0xa0e0('0x114')](db[_0xa0e0('0xb4')],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':_0xa0e0('0x110'),'foreignKey':'SubjectId'});db[_0xa0e0('0xb4')][_0xa0e0('0x114')](db[_0xa0e0('0xb5')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xb4')]['hasMany'](db[_0xa0e0('0xb5')],{'as':_0xa0e0('0x1c6'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xb4')][_0xa0e0('0x123')](db[_0xa0e0('0xb2')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xb4')][_0xa0e0('0x125')](db['Tag'],{'through':_0xa0e0('0x1dc')});db['FreshdeskField'][_0xa0e0('0x114')](db[_0xa0e0('0xb5')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xb5')][_0xa0e0('0x114')](db[_0xa0e0('0xb5')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xb5')][_0xa0e0('0x114')](db['FreshdeskField'],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0xb5')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':'Variable','foreignKey':_0xa0e0('0x1d2')});db['VtigerAccount'][_0xa0e0('0x114')](db[_0xa0e0('0xb8')],{'as':_0xa0e0('0x1c9'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1ca')});db['VtigerConfiguration'][_0xa0e0('0x114')](db['VtigerField'],{'as':_0xa0e0('0x1d8'),'foreignKey':'SubjectId'});db['VtigerConfiguration']['hasMany'](db[_0xa0e0('0x1dd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xa0e0('0xb8')]['hasMany'](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1c6'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xb8')][_0xa0e0('0x123')](db['VtigerAccount'],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0x1dd')][_0xa0e0('0x114')](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db['VtigerField'][_0xa0e0('0x114')](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db['VtigerField'][_0xa0e0('0x114')](db[_0xa0e0('0x1dd')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0x1dd')][_0xa0e0('0x123')](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db[_0xa0e0('0xbb')][_0xa0e0('0x114')](db[_0xa0e0('0xbd')],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xbd')]['hasMany'](db[_0xa0e0('0xbe')],{'as':'Subjects','foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xbd')][_0xa0e0('0x114')](db[_0xa0e0('0xbe')],{'as':_0xa0e0('0x1cc'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xbd')][_0xa0e0('0x114')](db['ServicenowField'],{'as':'Fields','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xbd')][_0xa0e0('0x123')](db[_0xa0e0('0xbb')],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xbe')][_0xa0e0('0x114')](db['ServicenowField'],{'as':_0xa0e0('0x1cf'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xbe')][_0xa0e0('0x114')](db[_0xa0e0('0xbe')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db[_0xa0e0('0xbe')][_0xa0e0('0x114')](db[_0xa0e0('0xbe')],{'as':_0xa0e0('0x1d5'),'foreignKey':'FieldId'});db[_0xa0e0('0xbe')]['belongsTo'](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':'VariableId'});db[_0xa0e0('0xc0')][_0xa0e0('0x114')](db['Dynamics365Configuration'],{'as':_0xa0e0('0x1c9'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xc0')][_0xa0e0('0x123')](db['CloudProvider'],{'as':_0xa0e0('0x10a'),'foreignKey':'CloudProviderId'});db[_0xa0e0('0xc2')][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1d8'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xc2')][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1cc'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1cd')});db['Dynamics365Configuration'][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1c6'),'onDelete':'cascade','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xc2')]['belongsTo'](db[_0xa0e0('0xc0')],{'as':_0xa0e0('0x172'),'foreignKey':'AccountId'});db['Dynamics365Field']['hasMany'](db[_0xa0e0('0xc4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa0e0('0xc4')]['hasMany'](db[_0xa0e0('0xc4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa0e0('0xc4')][_0xa0e0('0x114')](db[_0xa0e0('0xc4')],{'as':_0xa0e0('0x1d5'),'foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xc4')]['belongsTo'](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':_0xa0e0('0x1d2')});db[_0xa0e0('0xc5')][_0xa0e0('0x114')](db[_0xa0e0('0xc7')],{'as':_0xa0e0('0x1c9'),'onDelete':_0xa0e0('0x110'),'foreignKey':'AccountId'});db[_0xa0e0('0xc7')][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':_0xa0e0('0x1d8'),'foreignKey':'SubjectId'});db[_0xa0e0('0xc7')][_0xa0e0('0x114')](db['FreshsalesField'],{'as':_0xa0e0('0x1cc'),'foreignKey':_0xa0e0('0x1cd')});db['FreshsalesConfiguration'][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':_0xa0e0('0x1c6'),'foreignKey':'FieldId'});db[_0xa0e0('0xc7')][_0xa0e0('0x123')](db['FreshsalesAccount'],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x1ca')});db[_0xa0e0('0xc9')][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':'Subject','foreignKey':_0xa0e0('0x1cb')});db[_0xa0e0('0xc9')][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':_0xa0e0('0x1d0'),'foreignKey':_0xa0e0('0x1cd')});db['FreshsalesField'][_0xa0e0('0x114')](db[_0xa0e0('0xc9')],{'as':'Field','foreignKey':_0xa0e0('0x1ce')});db[_0xa0e0('0xc9')]['belongsTo'](db[_0xa0e0('0x8f')],{'as':_0xa0e0('0x8f'),'foreignKey':'VariableId'});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{});db[_0xa0e0('0xcd')]['belongsTo'](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db[_0xa0e0('0x61')],{});db[_0xa0e0('0xcd')][_0xa0e0('0x123')](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db[_0xa0e0('0x12')],{});db['ChatQueueReport']['belongsTo'](db[_0xa0e0('0x65')],{});db[_0xa0e0('0x1a0')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x1de')});db[_0xa0e0('0x1a0')]['belongsTo'](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x110'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0xa0e0('0x114')](db[_0xa0e0('0xd1')],{'foreignKey':_0xa0e0('0x1df'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0xd3')][_0xa0e0('0x114')](db[_0xa0e0('0x1e0')],{'foreignKey':_0xa0e0('0x1df'),'onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db[_0xa0e0('0x4f')],{});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db['CmContact'],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db[_0xa0e0('0x52')],{});db['SmsQueueReport'][_0xa0e0('0x123')](db['SmsMessage'],{});db[_0xa0e0('0xd5')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{});db['SmsQueueReport']['belongsTo'](db[_0xa0e0('0x56')],{});db['JscriptyProject'][_0xa0e0('0x114')](db[_0xa0e0('0xd3')],{'foreignKey':_0xa0e0('0x1e1')});db[_0xa0e0('0x1e2')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xa0e0('0x1e2')][_0xa0e0('0x114')](db[_0xa0e0('0x1e0')],{'foreignKey':_0xa0e0('0x1e1')});db[_0xa0e0('0xdf')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x1e3')});db['Team']['belongsToMany'](db['User'],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x12b')});db[_0xa0e0('0xe4')]['belongsToMany'](db[_0xa0e0('0x132')],{'through':_0xa0e0('0x1e4'),'as':_0xa0e0('0x1e5')});db[_0xa0e0('0xe4')]['belongsToMany'](db[_0xa0e0('0x39')],{'through':_0xa0e0('0x170'),'as':_0xa0e0('0x1e6')});db['Team']['belongsToMany'](db[_0xa0e0('0x65')],{'through':'team_has_chat_queues','as':_0xa0e0('0x135')});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x136')],{'through':'team_has_fax_queues','as':_0xa0e0('0x137')});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x56')],{'through':_0xa0e0('0x190'),'as':'SmsQueues'});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x5c')],{'through':_0xa0e0('0x196'),'as':'OpenchannelQueues'});db[_0xa0e0('0xe4')][_0xa0e0('0x125')](db[_0xa0e0('0x109')],{'through':_0xa0e0('0x1e7'),'as':'WhatsappQueues'});db[_0xa0e0('0xe4')]['belongsToMany'](db[_0xa0e0('0xf6')],{'through':_0xa0e0('0x10d'),'as':'VoicePrefixes'});db[_0xa0e0('0xe7')][_0xa0e0('0x114')](db['CmHopper'],{'as':_0xa0e0('0x14c'),'foreignKey':'CampaignId'});db[_0xa0e0('0xe7')][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':_0xa0e0('0x1aa')});db[_0xa0e0('0xe7')][_0xa0e0('0x114')](db['CmHopperHistory'],{'as':_0xa0e0('0x14d'),'foreignKey':_0xa0e0('0x1aa')});db[_0xa0e0('0xe7')]['hasMany'](db[_0xa0e0('0x70')],{'as':_0xa0e0('0x14e'),'foreignKey':'CampaignId'});db[_0xa0e0('0xe7')][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x150'),'foreignKey':_0xa0e0('0x151')});db[_0xa0e0('0xe7')][_0xa0e0('0x123')](db[_0xa0e0('0x150')],{'as':_0xa0e0('0x152'),'foreignKey':_0xa0e0('0x1e8')});db[_0xa0e0('0xe7')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0xa0e0('0x18c')});db[_0xa0e0('0xe7')]['belongsTo'](db[_0xa0e0('0xdf')],{'as':_0xa0e0('0xdf'),'foreignKey':_0xa0e0('0x1e9')});db['Campaign'][_0xa0e0('0x125')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x154'),'through':_0xa0e0('0x1ea')});db['Campaign'][_0xa0e0('0x125')](db['CmList'],{'as':_0xa0e0('0x158'),'through':_0xa0e0('0x1eb')});db['Attachment'][_0xa0e0('0x123')](db[_0xa0e0('0x63')],{'as':_0xa0e0('0x63'),'foreignKey':_0xa0e0('0x17d')});db['MailTransferReport'][_0xa0e0('0x123')](db['MailMessage'],{});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0xa0e0('0x38')],{'foreignKey':'FromMailAccountId','as':_0xa0e0('0x1ed')});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':'FromUserId','as':_0xa0e0('0x1ee')});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1ef'),'as':'ToAgent'});db[_0xa0e0('0x1ec')][_0xa0e0('0x123')](db[_0xa0e0('0x39')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport']['belongsTo'](db[_0xa0e0('0x38')],{'foreignKey':'ToMailAccountId','as':_0xa0e0('0x1f0')});db[_0xa0e0('0x1f1')][_0xa0e0('0x123')](db[_0xa0e0('0x199')],{});db[_0xa0e0('0x1f1')][_0xa0e0('0x123')](db[_0xa0e0('0x61')],{});db['ChatTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x5d')],{'foreignKey':_0xa0e0('0x1f2'),'as':_0xa0e0('0x1ed')});db[_0xa0e0('0x1f1')]['belongsTo'](db[_0xa0e0('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db['ChatTransferReport'][_0xa0e0('0x123')](db['User'],{'foreignKey':_0xa0e0('0x1ef'),'as':'ToAgent'});db[_0xa0e0('0x1f1')][_0xa0e0('0x123')](db[_0xa0e0('0x65')],{'foreignKey':_0xa0e0('0x1f3'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db[_0xa0e0('0x5d')],{'foreignKey':_0xa0e0('0x1f4'),'as':_0xa0e0('0x1f0')});db['FaxTransferReport'][_0xa0e0('0x123')](db['FaxMessage'],{});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x49')],{});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{'foreignKey':_0xa0e0('0x1f5'),'as':_0xa0e0('0x1ed')});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1f6'),'as':_0xa0e0('0x1ee')});db[_0xa0e0('0xf0')]['belongsTo'](db[_0xa0e0('0x12')],{'foreignKey':'ToUserId','as':_0xa0e0('0x1f7')});db[_0xa0e0('0xf0')][_0xa0e0('0x123')](db[_0xa0e0('0x136')],{'foreignKey':_0xa0e0('0x1f8'),'as':'ToQueue'});db['FaxTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x47')],{'foreignKey':_0xa0e0('0x1f9'),'as':_0xa0e0('0x1f0')});db[_0xa0e0('0xf1')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xa0e0('0xf1')][_0xa0e0('0x123')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0xa0e0('0x123')](db['OpenchannelAccount'],{'foreignKey':_0xa0e0('0x1fa'),'as':_0xa0e0('0x1ed')});db['OpenchannelTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa0e0('0xf1')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1ef'),'as':_0xa0e0('0x1f7')});db[_0xa0e0('0xf1')][_0xa0e0('0x123')](db[_0xa0e0('0x5c')],{'foreignKey':_0xa0e0('0x1fb'),'as':_0xa0e0('0x1fc')});db[_0xa0e0('0xf1')]['belongsTo'](db[_0xa0e0('0x142')],{'foreignKey':_0xa0e0('0x1fd'),'as':_0xa0e0('0x1f0')});db[_0xa0e0('0xf2')]['belongsTo'](db[_0xa0e0('0x54')],{});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x52')],{});db[_0xa0e0('0xf2')]['belongsTo'](db[_0xa0e0('0x4f')],{'foreignKey':_0xa0e0('0x1fe'),'as':_0xa0e0('0x1ed')});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1f6'),'as':'FromAgent'});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db['User'],{'foreignKey':_0xa0e0('0x1ef'),'as':_0xa0e0('0x1f7')});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x56')],{'foreignKey':'ToSmsQueueId','as':_0xa0e0('0x1fc')});db[_0xa0e0('0xf2')][_0xa0e0('0x123')](db[_0xa0e0('0x4f')],{'foreignKey':_0xa0e0('0x1ff'),'as':_0xa0e0('0x1f0')});db['CmList'][_0xa0e0('0x114')](db['Disposition'],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x17f'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db[_0xa0e0('0x76')],{'as':_0xa0e0('0x200'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db[_0xa0e0('0x6c')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db[_0xa0e0('0x71')],{'as':_0xa0e0('0x118'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')][_0xa0e0('0x114')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xa0e0('0x17f')});db['CmList'][_0xa0e0('0x114')](db[_0xa0e0('0x11a')],{'as':_0xa0e0('0x11a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xf4')]['belongsToMany'](db['VoiceQueue'],{'as':_0xa0e0('0x201'),'through':_0xa0e0('0x155')});db[_0xa0e0('0xf4')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':_0xa0e0('0x12a')});db[_0xa0e0('0xf6')]['hasMany'](db['VoiceExtension'],{'as':_0xa0e0('0x117'),'onDelete':'cascade'});db[_0xa0e0('0xf6')][_0xa0e0('0x125')](db[_0xa0e0('0x12')],{'as':'Agents','through':_0xa0e0('0x133')});db[_0xa0e0('0xf6')]['belongsToMany'](db[_0xa0e0('0xe4')],{'through':'TeamVoicePrefix','as':_0xa0e0('0x171')});db[_0xa0e0('0xf8')][_0xa0e0('0x114')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x178'),'foreignKey':_0xa0e0('0x124')});db[_0xa0e0('0xf8')][_0xa0e0('0x114')](db[_0xa0e0('0xfa')],{'as':'UserProfileSections','foreignKey':_0xa0e0('0x124'),'onDelete':_0xa0e0('0x110')});db['UserProfileSection'][_0xa0e0('0x114')](db[_0xa0e0('0xfb')],{'as':'Resources','foreignKey':_0xa0e0('0x202'),'onDelete':_0xa0e0('0x110')});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x7d')],{'as':_0xa0e0('0x180'),'foreignKey':_0xa0e0('0x203'),'onDelete':'cascade'});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x7b')],{'as':_0xa0e0('0x166'),'foreignKey':_0xa0e0('0x203')});db[_0xa0e0('0xff')]['hasMany'](db[_0xa0e0('0x103')],{'as':_0xa0e0('0x167'),'foreignKey':_0xa0e0('0x203')});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x101')],{'as':_0xa0e0('0x168')});db[_0xa0e0('0xff')][_0xa0e0('0x114')](db[_0xa0e0('0x204')],{'as':_0xa0e0('0x169')});db[_0xa0e0('0xff')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':_0xa0e0('0x16a'),'foreignKey':_0xa0e0('0x17f')});db[_0xa0e0('0xff')][_0xa0e0('0x123')](db[_0xa0e0('0x16d')],{'as':_0xa0e0('0x153'),'foreignKey':_0xa0e0('0x16e')});db[_0xa0e0('0xff')]['belongsToMany'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x156'),'through':'user_has_whatsapp_accounts'});db[_0xa0e0('0x204')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'onDelete':_0xa0e0('0x162')});db['WhatsappApplication']['belongsTo'](db[_0xa0e0('0x109')],{'onDelete':'restrict'});db[_0xa0e0('0x204')][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x204')]['belongsTo'](db['Interval'],{'onDelete':_0xa0e0('0x162'),'foreignKey':'IntervalId'});db[_0xa0e0('0x204')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa0e0('0x17e')});db[_0xa0e0('0x101')][_0xa0e0('0x114')](db[_0xa0e0('0x103')],{'as':_0xa0e0('0x167'),'onDelete':_0xa0e0('0x110'),'foreignKey':_0xa0e0('0x205')});db['WhatsappInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xa0e0('0x101')]['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db['WhatsappInteraction'][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x185'),'foreignKey':'UserId'});db[_0xa0e0('0x101')]['belongsToMany'](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1bc'),'as':'Tags'});db[_0xa0e0('0x101')][_0xa0e0('0x125')](db[_0xa0e0('0x174')],{'through':_0xa0e0('0x1bc'),'as':_0xa0e0('0x177')});db[_0xa0e0('0x101')][_0xa0e0('0x125')](db['User'],{'as':_0xa0e0('0x178'),'through':_0xa0e0('0x131'),'foreignKey':'WhatsappInteractionId'});db[_0xa0e0('0x103')][_0xa0e0('0x123')](db['User'],{'as':_0xa0e0('0x12')});db[_0xa0e0('0x103')]['belongsTo'](db[_0xa0e0('0x6c')],{'onDelete':'cascade','as':_0xa0e0('0x160')});db['WhatsappMessage'][_0xa0e0('0x123')](db['WhatsappInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xa0e0('0x205')});db[_0xa0e0('0x103')]['belongsTo'](db['WhatsappAccount'],{'as':_0xa0e0('0x172'),'foreignKey':_0xa0e0('0x203')});db['WhatsappQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{});db[_0xa0e0('0x105')][_0xa0e0('0x123')](db[_0xa0e0('0xf4')],{'as':'List','foreignKey':_0xa0e0('0x17f')});db['WhatsappQueueReport']['belongsTo'](db[_0xa0e0('0x6c')],{'as':_0xa0e0('0x160'),'foreignKey':_0xa0e0('0x173')});db[_0xa0e0('0x105')][_0xa0e0('0x123')](db[_0xa0e0('0x101')],{});db['WhatsappQueueReport'][_0xa0e0('0x123')](db[_0xa0e0('0x109')],{});db[_0xa0e0('0x105')][_0xa0e0('0x123')](db[_0xa0e0('0x103')],{});db[_0xa0e0('0x105')]['belongsTo'](db[_0xa0e0('0x12')],{});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0x103')],{});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db['WhatsappInteraction'],{});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0xff')],{'foreignKey':_0xa0e0('0x206'),'as':_0xa0e0('0x1ed')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xa0e0('0x207'),'as':_0xa0e0('0x1f0')});db['WhatsappTransferReport'][_0xa0e0('0x123')](db[_0xa0e0('0x109')],{'foreignKey':_0xa0e0('0x208'),'as':'ToQueue'});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1f6'),'as':_0xa0e0('0x1ee')});db[_0xa0e0('0x107')][_0xa0e0('0x123')](db[_0xa0e0('0x12')],{'foreignKey':_0xa0e0('0x1ef'),'as':'ToAgent'});db[_0xa0e0('0x109')][_0xa0e0('0x125')](db['User'],{'as':_0xa0e0('0x156'),'through':'UserWhatsappQueue','foreignKey':_0xa0e0('0x209')});db['WhatsappQueue']['belongsToMany'](db['Team'],{'through':_0xa0e0('0x1e7'),'as':_0xa0e0('0x171')});db[_0xa0e0('0x112')]['belongsTo'](db[_0xa0e0('0x12')],{'as':_0xa0e0('0x20a'),'foreignKey':'UserId','onDelete':_0xa0e0('0x110'),'hooks':!![]});db[_0xa0e0('0x10a')][_0xa0e0('0x111')](db[_0xa0e0('0xc0')],{'as':'Dynamics365Account','onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x10a')][_0xa0e0('0x111')](db[_0xa0e0('0x34')],{'as':_0xa0e0('0x164'),'onDelete':_0xa0e0('0x162')});db[_0xa0e0('0x10a')]['hasOne'](db[_0xa0e0('0x36')],{'as':_0xa0e0('0x165'),'onDelete':_0xa0e0('0x162')});module[_0xa0e0('0x20b')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xd7a9=['../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','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','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','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/setting/setting.model','SquareOdbc','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','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','VoiceRecording','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','FaxQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceMailMessage','mailboxuser','VoiceCallReport','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','restrict','MailAccountId','CloudProviderId','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','List','ListId','TemplateId','user_has_mail_accounts','MailQueue','team_has_mail_queues','MailInteractionId','ContactId','Owner','mail_interaction_has_tags','Tags','Users','Attachment','Attachments','Interaction','Account','ChatOfflineMessage','TagId','MailQueueReport','FaxAccountId','FaxInteraction','FaxApplication','Exntensions','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','sms_interaction_has_tags','ThroughTags','user_has_sms_interactions','SmsInteractionId','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','ChatWebsiteId','Agent','Queue','ChatQueueId','Website','ChatInteraction','chat_interaction_has_tags','ChatInteractionId','ChatGroupId','CompanyId','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','Configurations','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','FreshsalesAccount','FromId','ToId','SessionId','JscriptyAnswerReport','SmsQueueReport','ProjectId','JscriptyProject','user_has_square_projects','user_has_teams','VoiceQueues','team_has_chat_queues','team_has_sms_queues','SmsQueues','team_has_openchannel_queues','team_has_whatsapp_queues','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','ChatOfflineMessageId','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToUserId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8_general_ci','sequelizeHistory','utf8mb4','utf8','database','username','options','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport'];(function(_0x1d2a20,_0x5f015d){var _0x323443=function(_0xadbe66){while(--_0xadbe66){_0x1d2a20['push'](_0x1d2a20['shift']());}};_0x323443(++_0x5f015d);}(_0xd7a9,0x1e8));var _0x9d7a=function(_0x378f75,_0x13a8ed){_0x378f75=_0x378f75-0x0;var _0x90addc=_0xd7a9[_0x378f75];return _0x90addc;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x9d7a('0x0'));var _=require(_0x9d7a('0x1'));var jstz=require(_0x9d7a('0x2'));var timezone=jstz[_0x9d7a('0x3')]();config['sequelize']=_[_0x9d7a('0x4')](config[_0x9d7a('0x0')],{'database':_0x9d7a('0x5'),'username':_0x9d7a('0x6'),'password':_0x9d7a('0x7'),'options':{'host':_0x9d7a('0x8'),'port':0xcea,'dialect':_0x9d7a('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x9d7a('0xa')](),'define':{'charset':'utf8','collate':_0x9d7a('0xb')}}});config[_0x9d7a('0xc')]=_[_0x9d7a('0x4')](config[_0x9d7a('0xc')],{'database':_0x9d7a('0x5'),'username':_0x9d7a('0x6'),'password':_0x9d7a('0x7'),'options':{'host':_0x9d7a('0x8'),'port':0xcea,'dialect':_0x9d7a('0x9'),'dialectOptions':{'charset':_0x9d7a('0xd')},'logging':![],'timezone':timezone[_0x9d7a('0xa')](),'define':{'charset':_0x9d7a('0xe'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x9d7a('0xf')],config[_0x9d7a('0x0')][_0x9d7a('0x10')],config[_0x9d7a('0x0')]['password'],config[_0x9d7a('0x0')][_0x9d7a('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9d7a('0xc')][_0x9d7a('0xf')],config[_0x9d7a('0xc')][_0x9d7a('0x10')],config[_0x9d7a('0xc')][_0x9d7a('0x12')],config[_0x9d7a('0xc')]['options'])};db[_0x9d7a('0x13')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x15'));db[_0x9d7a('0x16')]=db['sequelize']['import'](_0x9d7a('0x17'));db['VoiceContext']=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/voiceContext/voiceContext.model');db[_0x9d7a('0x18')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x19'));db[_0x9d7a('0x1a')]=db[_0x9d7a('0x0')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x9d7a('0x1b')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x1c'));db['VoiceRecording']=db[_0x9d7a('0x0')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x9d7a('0x1d')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x1e'));db[_0x9d7a('0x1f')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x20'));db['VoiceMailMessage']=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x21'));db[_0x9d7a('0x22')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x23'));db['VoiceQueueReport']=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x9d7a('0x24')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x25'));db[_0x9d7a('0x26')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x27'));db[_0x9d7a('0x28')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x29'));db[_0x9d7a('0x2a')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x2b'));db[_0x9d7a('0x2c')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x2d'));db[_0x9d7a('0x2e')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x2f'));db[_0x9d7a('0x30')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x31'));db[_0x9d7a('0x32')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x33'));db[_0x9d7a('0x34')]=db['sequelize']['import'](_0x9d7a('0x35'));db['UserWhatsappQueue']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x36'));db[_0x9d7a('0x37')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x38'));db[_0x9d7a('0x39')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x3a'));db[_0x9d7a('0x3b')]=db['sequelize']['import'](_0x9d7a('0x3c'));db['MailQueue']=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x3d'));db[_0x9d7a('0x3e')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x3f'));db[_0x9d7a('0x40')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x41'));db[_0x9d7a('0x42')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x43'));db[_0x9d7a('0x44')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x45'));db['MailQueueReport']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x46'));db[_0x9d7a('0x47')]=db['sequelize']['import'](_0x9d7a('0x48'));db[_0x9d7a('0x49')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/dashboardItem/dashboardItem.model');db[_0x9d7a('0x4a')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x4b'));db['FaxApplication']=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x4c'));db['FaxInteraction']=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x4d'));db[_0x9d7a('0x4e')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x4f'));db[_0x9d7a('0x50')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/faxQueue/faxQueue.model');db[_0x9d7a('0x51')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x9d7a('0x52')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x53'));db['SmsApplication']=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/smsApplication/smsApplication.model');db[_0x9d7a('0x54')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x55'));db['SmsMessage']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x56'));db[_0x9d7a('0x57')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x58'));db[_0x9d7a('0x59')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x5a'));db[_0x9d7a('0x5b')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x5c'));db[_0x9d7a('0x5d')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x9d7a('0x5e')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x5f'));db[_0x9d7a('0x60')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x61'));db[_0x9d7a('0x62')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x63'));db[_0x9d7a('0x64')]=db['sequelize'][_0x9d7a('0x14')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x65'));db[_0x9d7a('0x66')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x67'));db['ChatOfflineMessage']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x68'));db[_0x9d7a('0x69')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x6a'));db[_0x9d7a('0x6b')]=db[_0x9d7a('0x0')]['import']('../api/chatGroup/chatGroup.model');db[_0x9d7a('0x6c')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x6d'));db[_0x9d7a('0x6e')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x6f'));db[_0x9d7a('0x70')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x71'));db[_0x9d7a('0x72')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x73'));db[_0x9d7a('0x74')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x75'));db[_0x9d7a('0x76')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x77'));db[_0x9d7a('0x78')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x79'));db[_0x9d7a('0x7a')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x9d7a('0x7b')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x7c'));db[_0x9d7a('0x7d')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x7e'));db[_0x9d7a('0x7f')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/automation/automation.model');db[_0x9d7a('0x80')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x81'));db['Disposition']=db['sequelize'][_0x9d7a('0x14')]('../api/disposition/disposition.model');db[_0x9d7a('0x82')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x83'));db['Interval']=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/interval/interval.model');db[_0x9d7a('0x84')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x85'));db[_0x9d7a('0x86')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x87'));db[_0x9d7a('0x88')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x89'));db[_0x9d7a('0x8a')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x8b'));db['Sound']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x8c'));db[_0x9d7a('0x8d')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/tag/tag.model');db[_0x9d7a('0x8e')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x8f'));db[_0x9d7a('0x90')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x91'));db[_0x9d7a('0x92')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x93'));db['Template']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x94'));db[_0x9d7a('0x95')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/trigger/trigger.model');db['Variable']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x96'));db['Integration']=db['sequelize'][_0x9d7a('0x14')]('../api/integration/integration.model');db[_0x9d7a('0x97')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x98'));db[_0x9d7a('0x99')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0x9a'));db[_0x9d7a('0x9b')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x9d7a('0x9c')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x9d'));db[_0x9d7a('0x9e')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x9f'));db[_0x9d7a('0xa0')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xa1'));db[_0x9d7a('0xa2')]=db['sequelize'][_0x9d7a('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x9d7a('0xa3')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xa4'));db['SalesforceConfiguration']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xa5'));db['SalesforceField']=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0xa6'));db[_0x9d7a('0xa7')]=db[_0x9d7a('0x0')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x9d7a('0xa8')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xa9'));db[_0x9d7a('0xaa')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xab'));db[_0x9d7a('0xac')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xad'));db[_0x9d7a('0xae')]=db['sequelize']['import'](_0x9d7a('0xaf'));db[_0x9d7a('0xb0')]=db['sequelize']['import'](_0x9d7a('0xb1'));db[_0x9d7a('0xb2')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xb3'));db[_0x9d7a('0xb4')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xb5'));db[_0x9d7a('0xb6')]=db[_0x9d7a('0x0')]['import']('../api/intZohoField/intZohoField.model');db[_0x9d7a('0xb7')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xb8'));db[_0x9d7a('0xb9')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xba'));db[_0x9d7a('0xbb')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xbc'));db['FreshdeskAccount']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xbd'));db[_0x9d7a('0xbe')]=db['sequelize'][_0x9d7a('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x9d7a('0xbf')]=db[_0x9d7a('0x0')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xc0'));db[_0x9d7a('0xc1')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0xc2'));db[_0x9d7a('0xc3')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0xc4'));db[_0x9d7a('0xc5')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xc6'));db[_0x9d7a('0xc7')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xc8'));db[_0x9d7a('0xc9')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xca'));db[_0x9d7a('0xcb')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xcc'));db[_0x9d7a('0xcd')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xce'));db[_0x9d7a('0xcf')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xd0'));db['FreshsalesAccount']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xd1'));db[_0x9d7a('0xd2')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0xd3'));db[_0x9d7a('0xd4')]=db[_0x9d7a('0x0')]['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0x9d7a('0xd5')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xd6'));db[_0x9d7a('0xd7')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0xd8'));db[_0x9d7a('0xd9')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x9d7a('0xda')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xdb'));db['JscriptyAnswerReport']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xdc'));db[_0x9d7a('0xdd')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xde'));db['JscriptySessionReport']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xdf'));db['SmsQueueReport']=db[_0x9d7a('0x0')]['import']('../api/smsQueueReport/smsQueueReport.model');db[_0x9d7a('0xe0')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xe1'));db[_0x9d7a('0xe2')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db['sequelize'][_0x9d7a('0x14')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xe3'));db[_0x9d7a('0xe4')]=db[_0x9d7a('0x0')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x9d7a('0xe5')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xe6'));db[_0x9d7a('0xe7')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xe8'));db[_0x9d7a('0xe9')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xea'));db[_0x9d7a('0xeb')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xec'));db[_0x9d7a('0xed')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xee'));db['Campaign']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xef'));db[_0x9d7a('0xf0')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/migration/migration.model');db['Attachment']=db['sequelize']['import'](_0x9d7a('0xf1'));db[_0x9d7a('0xf2')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xf3'));db['MailTransferReport']=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xf4'));db[_0x9d7a('0xf5')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xf6'));db[_0x9d7a('0xf7')]=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x9d7a('0xf8')]=db['sequelize']['import'](_0x9d7a('0xf9'));db['SmsTransferReport']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0xfa'));db[_0x9d7a('0xfb')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xfc'));db[_0x9d7a('0xfd')]=db[_0x9d7a('0x0')]['import'](_0x9d7a('0xfe'));db[_0x9d7a('0xff')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x100'));db[_0x9d7a('0x101')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/userNotification/userNotification.model');db[_0x9d7a('0x102')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x103'));db[_0x9d7a('0x104')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x105'));db[_0x9d7a('0x106')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x107'));db[_0x9d7a('0x108')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0x9d7a('0x109')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x10a'));db['WhatsappTransferReport']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x10b'));db['WhatsappQueue']=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x10c'));db[_0x9d7a('0x10d')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x10e'));db[_0x9d7a('0x10f')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x110'));db[_0x9d7a('0x111')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x9d7a('0x112')]=db[_0x9d7a('0x0')][_0x9d7a('0x14')](_0x9d7a('0x113'));db[_0x9d7a('0x114')]=db['sequelize'][_0x9d7a('0x14')](_0x9d7a('0x115'));db[_0x9d7a('0x13')][_0x9d7a('0x116')](db[_0x9d7a('0x1f')],{'as':_0x9d7a('0x1f'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x118')});db['User'][_0x9d7a('0x116')](db[_0x9d7a('0x114')],{'as':_0x9d7a('0x119'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')]['hasMany'](db[_0x9d7a('0x11a')],{'as':'Recordings','foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')][_0x9d7a('0x11b')](db[_0x9d7a('0x11c')],{'as':_0x9d7a('0x11d'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')][_0x9d7a('0x11b')](db['VoiceExtension'],{'as':_0x9d7a('0x11e'),'onDelete':_0x9d7a('0x117'),'hooks':!![]});db['User'][_0x9d7a('0x11b')](db[_0x9d7a('0x76')],{'as':'HopperFinals','foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')][_0x9d7a('0x11b')](db[_0x9d7a('0x78')],{'as':_0x9d7a('0x11f'),'foreignKey':_0x9d7a('0x118')});db['User'][_0x9d7a('0x11b')](db[_0x9d7a('0x7a')],{'as':_0x9d7a('0x7a'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')]['hasMany'](db[_0x9d7a('0x5d')],{'as':_0x9d7a('0x120'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')][_0x9d7a('0x11b')](db['ChatInteraction'],{'as':_0x9d7a('0x121'),'foreignKey':'UserId'});db[_0x9d7a('0x13')][_0x9d7a('0x11b')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'UserId'});db['User'][_0x9d7a('0x11b')](db['FaxInteraction'],{'as':_0x9d7a('0x122'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')][_0x9d7a('0x11b')](db[_0x9d7a('0x40')],{'as':_0x9d7a('0x123'),'foreignKey':_0x9d7a('0x118')});db['User'][_0x9d7a('0x11b')](db['WhatsappInteraction'],{'as':_0x9d7a('0x124'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x13')][_0x9d7a('0x11b')](db[_0x9d7a('0x125')],{'as':_0x9d7a('0x126'),'foreignKey':_0x9d7a('0x127')});db[_0x9d7a('0x13')][_0x9d7a('0x128')](db[_0x9d7a('0xff')],{'as':'UserProfile','foreignKey':_0x9d7a('0x129')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0x6b')],{'as':_0x9d7a('0x12b'),'through':_0x9d7a('0x12c')});db['User'][_0x9d7a('0x12a')](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x12d'),'through':_0x9d7a('0x12e')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x12f'),'through':'cm_user_has_lists'});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0xeb')],{'through':'user_has_teams'});db['User'][_0x9d7a('0x12a')](db[_0x9d7a('0x40')],{'as':_0x9d7a('0x123'),'through':_0x9d7a('0x130')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db['ChatInteraction'],{'as':_0x9d7a('0x121'),'through':_0x9d7a('0x131')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db['FaxInteraction'],{'as':_0x9d7a('0x122'),'through':'user_has_fax_interactions'});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db['SmsInteraction'],{'as':_0x9d7a('0x132'),'through':'user_has_sms_interactions'});db['User'][_0x9d7a('0x12a')](db[_0x9d7a('0x5d')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db['User'][_0x9d7a('0x12a')](db[_0x9d7a('0x106')],{'as':_0x9d7a('0x124'),'through':_0x9d7a('0x133')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0x1b')],{'as':'VoiceQueues','through':_0x9d7a('0x2a'),'required':![]});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0xfd')],{'as':_0x9d7a('0x134'),'through':_0x9d7a('0x112'),'required':![]});db['User'][_0x9d7a('0x12a')](db['MailQueue'],{'as':_0x9d7a('0x135'),'through':_0x9d7a('0x2e'),'required':![]});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db['ChatQueue'],{'as':'ChatQueues','through':_0x9d7a('0x2c'),'required':![],'hooks':!![]});db[_0x9d7a('0x13')]['belongsToMany'](db['FaxQueue'],{'as':_0x9d7a('0x136'),'through':_0x9d7a('0x30'),'required':![]});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db['SmsQueue'],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0x60')],{'as':_0x9d7a('0x137'),'through':'UserOpenchannelQueue','required':![]});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0x138')],{'as':_0x9d7a('0x139'),'through':_0x9d7a('0x13a'),'required':![]});db[_0x9d7a('0x13')]['belongsToMany'](db[_0x9d7a('0xfb')],{'through':_0x9d7a('0x13b')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0x13c')],{'as':_0x9d7a('0x13d'),'through':_0x9d7a('0x13e')});db['User']['belongsToMany'](db[_0x9d7a('0x4a')],{'as':_0x9d7a('0x13f'),'through':_0x9d7a('0x140')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0x3b')],{'as':_0x9d7a('0x141'),'through':'user_has_mail_accounts'});db['User'][_0x9d7a('0x12a')](db[_0x9d7a('0x59')],{'as':_0x9d7a('0x142'),'through':_0x9d7a('0x143')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db['SmsAccount'],{'as':_0x9d7a('0x144'),'through':_0x9d7a('0x145')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0x102')],{'as':_0x9d7a('0x146'),'through':_0x9d7a('0x147')});db[_0x9d7a('0x13')][_0x9d7a('0x12a')](db[_0x9d7a('0xe5')],{'as':_0x9d7a('0x148'),'through':'user_has_square_projects'});db[_0x9d7a('0x16')][_0x9d7a('0x11b')](db['VoiceExtension'],{'as':_0x9d7a('0x149'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x14a')});db[_0x9d7a('0x14b')][_0x9d7a('0x11b')](db['VoiceExtension'],{'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x18')][_0x9d7a('0x11b')](db[_0x9d7a('0x18')],{'as':_0x9d7a('0x14c'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x1a')][_0x9d7a('0x12a')](db[_0x9d7a('0x14d')],{'as':'Sounds','through':_0x9d7a('0x14e')});db[_0x9d7a('0x1b')][_0x9d7a('0x11b')](db[_0x9d7a('0x11c')],{'as':_0x9d7a('0x14f'),'foreignKey':_0x9d7a('0x150')});db[_0x9d7a('0x1b')]['hasMany'](db[_0x9d7a('0x72')],{'as':_0x9d7a('0x151'),'foreignKey':_0x9d7a('0x150')});db['VoiceQueue'][_0x9d7a('0x11b')](db['CmHopperFinal'],{'as':_0x9d7a('0x152'),'foreignKey':_0x9d7a('0x150')});db[_0x9d7a('0x1b')]['hasMany'](db[_0x9d7a('0x78')],{'as':_0x9d7a('0x153'),'foreignKey':_0x9d7a('0x150')});db['VoiceQueue']['hasMany'](db[_0x9d7a('0x7a')],{'as':_0x9d7a('0x7a'),'foreignKey':_0x9d7a('0x150')});db[_0x9d7a('0x1b')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x9d7a('0x150')});db[_0x9d7a('0x1b')]['hasMany'](db[_0x9d7a('0x154')],{'as':_0x9d7a('0x155'),'foreignKey':_0x9d7a('0x150')});db[_0x9d7a('0x1b')][_0x9d7a('0x128')](db['Trunk'],{'as':'Trunk','foreignKey':_0x9d7a('0x156')});db[_0x9d7a('0x1b')][_0x9d7a('0x128')](db[_0x9d7a('0x26')],{'as':_0x9d7a('0x157'),'foreignKey':_0x9d7a('0x158')});db['VoiceQueue'][_0x9d7a('0x128')](db['Interval'],{'as':_0x9d7a('0x159'),'foreignKey':_0x9d7a('0x15a')});db[_0x9d7a('0x1b')]['belongsTo'](db[_0x9d7a('0x84')],{'as':_0x9d7a('0x15b'),'foreignKey':_0x9d7a('0x15c')});db['VoiceQueue'][_0x9d7a('0x12a')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x12f'),'through':'voice_queues_has_cm_lists'});db[_0x9d7a('0x1b')][_0x9d7a('0x12a')](db['User'],{'as':_0x9d7a('0x15d'),'through':'UserVoiceQueue'});db[_0x9d7a('0x1b')][_0x9d7a('0x12a')](db[_0x9d7a('0xeb')],{'as':_0x9d7a('0x15e'),'through':'TeamVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x15f'),'through':_0x9d7a('0x160')});db[_0x9d7a('0x11a')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':'User','foreignKey':_0x9d7a('0x118')});db['ScreenRecording'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x13'),'foreignKey':'UserId'});db['VoiceMail'][_0x9d7a('0x11b')](db['VoiceMailMessage'],{'as':_0x9d7a('0x161'),'onDelete':_0x9d7a('0x117'),'foreignKey':'mailboxuser','sourceKey':_0x9d7a('0x162')});db[_0x9d7a('0x163')][_0x9d7a('0x128')](db['VoiceMail'],{'foreignKey':_0x9d7a('0x164'),'targetKey':_0x9d7a('0x162')});db[_0x9d7a('0x165')]['hasMany'](db[_0x9d7a('0x166')],{'as':_0x9d7a('0x167'),'foreignKey':_0x9d7a('0x168'),'constraints':![]});db[_0x9d7a('0x165')][_0x9d7a('0x11b')](db[_0x9d7a('0x22')],{'as':_0x9d7a('0x169'),'foreignKey':_0x9d7a('0x168'),'constraints':![]});db[_0x9d7a('0x165')][_0x9d7a('0x128')](db['User'],{'as':_0x9d7a('0x13'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x165')][_0x9d7a('0x128')](db['CmContact'],{'as':_0x9d7a('0x16a'),'foreignKey':'ContactId'});db['MailServerIn']['belongsTo'](db[_0x9d7a('0x3b')],{'as':_0x9d7a('0x3b'),'foreignKey':'MailAccountId'});db['MailServerIn'][_0x9d7a('0x128')](db['CloudProvider'],{'as':_0x9d7a('0x10d'),'foreignKey':'CloudProviderId','onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x39')][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{'as':_0x9d7a('0x3b'),'foreignKey':_0x9d7a('0x16c')});db[_0x9d7a('0x39')][_0x9d7a('0x128')](db[_0x9d7a('0x10d')],{'as':_0x9d7a('0x10d'),'foreignKey':_0x9d7a('0x16d'),'onDelete':'restrict'});db[_0x9d7a('0x3b')][_0x9d7a('0x116')](db[_0x9d7a('0x37')],{'as':_0x9d7a('0x16e'),'onDelete':_0x9d7a('0x117')});db['MailAccount'][_0x9d7a('0x116')](db[_0x9d7a('0x39')],{'as':_0x9d7a('0x16f'),'onDelete':'cascade'});db[_0x9d7a('0x3b')][_0x9d7a('0x11b')](db[_0x9d7a('0x170')],{'as':_0x9d7a('0x171'),'foreignKey':_0x9d7a('0x16c'),'onDelete':'cascade'});db[_0x9d7a('0x3b')][_0x9d7a('0x11b')](db[_0x9d7a('0x80')],{'as':_0x9d7a('0x172'),'foreignKey':'MailAccountId'});db[_0x9d7a('0x3b')][_0x9d7a('0x11b')](db[_0x9d7a('0x42')],{'as':_0x9d7a('0x161'),'foreignKey':_0x9d7a('0x16c')});db[_0x9d7a('0x3b')][_0x9d7a('0x11b')](db[_0x9d7a('0x40')],{'as':_0x9d7a('0x173')});db['MailAccount'][_0x9d7a('0x11b')](db[_0x9d7a('0x44')],{'as':'Applications'});db[_0x9d7a('0x3b')]['belongsTo'](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0x3b')]['belongsTo'](db['Template'],{'as':'Template','foreignKey':_0x9d7a('0x176')});db[_0x9d7a('0x3b')][_0x9d7a('0x128')](db[_0x9d7a('0x84')],{'as':_0x9d7a('0x15b'),'foreignKey':_0x9d7a('0x15c')});db[_0x9d7a('0x3b')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x177')});db[_0x9d7a('0x178')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x2e')});db[_0x9d7a('0x178')][_0x9d7a('0x12a')](db[_0x9d7a('0xeb')],{'through':_0x9d7a('0x179'),'as':_0x9d7a('0x15e')});db['MailInteraction'][_0x9d7a('0x11b')](db[_0x9d7a('0x42')],{'as':_0x9d7a('0x161'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x17a')});db[_0x9d7a('0x40')][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{'as':'Account','foreignKey':_0x9d7a('0x16c')});db['MailInteraction'][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b')});db['MailInteraction']['belongsTo'](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17c'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x40')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x17d'),'as':_0x9d7a('0x17e')});db['MailInteraction'][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x17d'),'as':'ThroughTags'});db[_0x9d7a('0x40')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17f'),'through':_0x9d7a('0x130'),'foreignKey':'MailInteractionId'});db[_0x9d7a('0x42')][_0x9d7a('0x11b')](db[_0x9d7a('0x180')],{'as':_0x9d7a('0x181'),'onDelete':'cascade'});db['MailMessage'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x13')});db[_0x9d7a('0x42')][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'onDelete':_0x9d7a('0x117'),'as':_0x9d7a('0x16a')});db[_0x9d7a('0x42')]['belongsTo'](db[_0x9d7a('0x40')],{'as':_0x9d7a('0x182'),'foreignKey':_0x9d7a('0x17a')});db[_0x9d7a('0x42')][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x16c')});db[_0x9d7a('0x42')]['belongsTo'](db[_0x9d7a('0x13c')],{'as':_0x9d7a('0x13c'),'foreignKey':'ChatWebsiteId'});db[_0x9d7a('0x42')]['belongsTo'](db[_0x9d7a('0x184')],{'as':_0x9d7a('0x184'),'foreignKey':'ChatOfflineMessageId'});db[_0x9d7a('0x44')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x44')][_0x9d7a('0x128')](db[_0x9d7a('0x178')],{'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x44')][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{'onDelete':_0x9d7a('0x16b')});db['MailApplication'][_0x9d7a('0x128')](db[_0x9d7a('0x159')],{'onDelete':_0x9d7a('0x16b'),'foreignKey':'IntervalId'});db[_0x9d7a('0x44')][_0x9d7a('0x128')](db[_0x9d7a('0x8d')],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x185')});db['MailQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{});db[_0x9d7a('0x186')][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0x186')]['belongsTo'](db[_0x9d7a('0x70')],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport']['belongsTo'](db[_0x9d7a('0x40')],{});db[_0x9d7a('0x186')]['belongsTo'](db[_0x9d7a('0x42')],{});db['MailQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{});db[_0x9d7a('0x186')][_0x9d7a('0x128')](db[_0x9d7a('0x178')],{});db['Dashboard']['hasMany'](db[_0x9d7a('0x49')],{'as':'Items','onDelete':'cascade'});db['FaxAccount'][_0x9d7a('0x11b')](db[_0x9d7a('0x170')],{'as':_0x9d7a('0x171'),'foreignKey':_0x9d7a('0x187'),'onDelete':'cascade'});db[_0x9d7a('0x4a')][_0x9d7a('0x11b')](db[_0x9d7a('0x80')],{'as':'Answers','foreignKey':_0x9d7a('0x187')});db[_0x9d7a('0x4a')]['hasMany'](db[_0x9d7a('0x188')],{'as':_0x9d7a('0x173')});db['FaxAccount'][_0x9d7a('0x11b')](db[_0x9d7a('0x189')],{'as':'Applications'});db[_0x9d7a('0x4a')][_0x9d7a('0x11b')](db[_0x9d7a('0x18')],{'as':_0x9d7a('0x18a'),'onDelete':'cascade'});db['FaxAccount'][_0x9d7a('0x11b')](db[_0x9d7a('0x4e')],{'as':_0x9d7a('0x161')});db['FaxAccount'][_0x9d7a('0x128')](db[_0x9d7a('0x26')],{'as':_0x9d7a('0x26')});db['FaxAccount'][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0x4a')][_0x9d7a('0x128')](db[_0x9d7a('0x84')],{'as':_0x9d7a('0x15b'),'foreignKey':_0x9d7a('0x15c')});db[_0x9d7a('0x4a')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0x9d7a('0x128')](db['User'],{'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x189')][_0x9d7a('0x128')](db[_0x9d7a('0x50')],{'onDelete':_0x9d7a('0x16b')});db['FaxApplication']['belongsTo'](db[_0x9d7a('0x4a')],{'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x189')][_0x9d7a('0x128')](db[_0x9d7a('0x8d')],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x185')});db[_0x9d7a('0x188')][_0x9d7a('0x11b')](db[_0x9d7a('0x4e')],{'as':'Messages','onDelete':_0x9d7a('0x117'),'foreignKey':'FaxInteractionId'});db[_0x9d7a('0x188')][_0x9d7a('0x128')](db[_0x9d7a('0x4a')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x187')});db['FaxInteraction'][_0x9d7a('0x128')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x9d7a('0x188')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17c'),'foreignKey':_0x9d7a('0x118')});db['FaxInteraction'][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':'fax_interaction_has_tags','as':_0x9d7a('0x17e')});db['FaxInteraction']['belongsToMany'](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x18b'),'as':'ThroughTags'});db[_0x9d7a('0x188')]['belongsToMany'](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17f'),'through':'user_has_fax_interactions','foreignKey':_0x9d7a('0x18c')});db[_0x9d7a('0x4e')][_0x9d7a('0x128')](db['User'],{'onDelete':_0x9d7a('0x117'),'as':'User'});db[_0x9d7a('0x4e')][_0x9d7a('0x128')](db[_0x9d7a('0x188')],{'as':_0x9d7a('0x182'),'foreignKey':_0x9d7a('0x18c')});db['FaxMessage'][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'onDelete':_0x9d7a('0x117'),'as':_0x9d7a('0x16a')});db['FaxMessage'][_0x9d7a('0x128')](db[_0x9d7a('0x180')],{'as':_0x9d7a('0x180'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db[_0x9d7a('0x4a')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x187')});db[_0x9d7a('0x50')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0x9d7a('0x50')][_0x9d7a('0x12a')](db['Team'],{'through':_0x9d7a('0x18d'),'as':_0x9d7a('0x15e')});db[_0x9d7a('0x51')][_0x9d7a('0x128')](db[_0x9d7a('0x4a')],{});db['FaxQueueReport']['belongsTo'](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db['FaxQueueReport']['belongsTo'](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x51')]['belongsTo'](db[_0x9d7a('0x188')],{});db[_0x9d7a('0x51')][_0x9d7a('0x128')](db['FaxMessage'],{});db[_0x9d7a('0x51')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{});db['FaxQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x50')],{});db[_0x9d7a('0x52')]['hasMany'](db[_0x9d7a('0x170')],{'as':_0x9d7a('0x171'),'foreignKey':_0x9d7a('0x18e'),'onDelete':_0x9d7a('0x117')});db['SmsAccount'][_0x9d7a('0x11b')](db[_0x9d7a('0x80')],{'as':_0x9d7a('0x172'),'foreignKey':_0x9d7a('0x18e')});db[_0x9d7a('0x52')][_0x9d7a('0x11b')](db[_0x9d7a('0x18f')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0x9d7a('0x54')],{'as':'Interactions'});db[_0x9d7a('0x52')][_0x9d7a('0x11b')](db[_0x9d7a('0x190')],{'as':'Applications'});db[_0x9d7a('0x52')][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':'List','foreignKey':'ListId'});db[_0x9d7a('0x52')]['belongsTo'](db[_0x9d7a('0x84')],{'as':_0x9d7a('0x15b'),'foreignKey':_0x9d7a('0x15c')});db['SmsAccount'][_0x9d7a('0x12a')](db['User'],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x145')});db['SmsApplication'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'onDelete':_0x9d7a('0x16b')});db['SmsApplication'][_0x9d7a('0x128')](db[_0x9d7a('0x57')],{'onDelete':_0x9d7a('0x16b')});db['SmsApplication']['belongsTo'](db['SmsAccount'],{'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x190')][_0x9d7a('0x128')](db[_0x9d7a('0x159')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x9d7a('0x190')]['belongsTo'](db['Tag'],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x185')});db[_0x9d7a('0x54')][_0x9d7a('0x11b')](db[_0x9d7a('0x18f')],{'as':_0x9d7a('0x161'),'onDelete':_0x9d7a('0x117'),'foreignKey':'SmsInteractionId'});db[_0x9d7a('0x54')][_0x9d7a('0x128')](db[_0x9d7a('0x52')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x18e')});db['SmsInteraction'][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b')});db['SmsInteraction'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17c'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x54')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':'sms_interaction_has_tags','as':_0x9d7a('0x17e')});db['SmsInteraction']['belongsToMany'](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x191'),'as':_0x9d7a('0x192')});db[_0x9d7a('0x54')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17f'),'through':_0x9d7a('0x193'),'foreignKey':'SmsInteractionId'});db[_0x9d7a('0x18f')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x13')});db[_0x9d7a('0x18f')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0x9d7a('0x128')](db['SmsInteraction'],{'onDelete':_0x9d7a('0x117'),'as':'Interaction','foreignKey':_0x9d7a('0x194')});db[_0x9d7a('0x18f')][_0x9d7a('0x128')](db[_0x9d7a('0x52')],{'as':'Account','foreignKey':_0x9d7a('0x18e')});db[_0x9d7a('0x57')]['belongsToMany'](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x32'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x9d7a('0x12a')](db[_0x9d7a('0xeb')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x9d7a('0x59')]['hasMany'](db[_0x9d7a('0x170')],{'as':_0x9d7a('0x171'),'foreignKey':_0x9d7a('0x195'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x59')][_0x9d7a('0x11b')](db[_0x9d7a('0x80')],{'as':_0x9d7a('0x172'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x9d7a('0x11b')](db['OpenchannelInteraction'],{'as':_0x9d7a('0x173'),'foreignKey':_0x9d7a('0x195')});db['OpenchannelAccount'][_0x9d7a('0x11b')](db[_0x9d7a('0x5e')],{'as':'Messages','foreignKey':_0x9d7a('0x195')});db[_0x9d7a('0x59')][_0x9d7a('0x11b')](db[_0x9d7a('0x5b')],{'as':_0x9d7a('0x14c'),'foreignKey':_0x9d7a('0x195')});db[_0x9d7a('0x59')][_0x9d7a('0x128')](db['CmList'],{'as':_0x9d7a('0x174'),'foreignKey':'ListId'});db[_0x9d7a('0x59')][_0x9d7a('0x128')](db['Pause'],{'as':_0x9d7a('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9d7a('0x59')][_0x9d7a('0x12a')](db['User'],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x143')});db[_0x9d7a('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x5b')][_0x9d7a('0x128')](db[_0x9d7a('0x60')],{'onDelete':_0x9d7a('0x16b'),'foreignKey':'OpenchannelQueueId'});db[_0x9d7a('0x5b')]['belongsTo'](db[_0x9d7a('0x59')],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x195')});db[_0x9d7a('0x5b')][_0x9d7a('0x128')](db['Interval'],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x15a')});db[_0x9d7a('0x5b')][_0x9d7a('0x128')](db['Tag'],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x185')});db[_0x9d7a('0x5d')][_0x9d7a('0x11b')](db[_0x9d7a('0x5e')],{'as':_0x9d7a('0x161'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x196')});db['OpenchannelInteraction']['belongsTo'](db[_0x9d7a('0x59')],{'as':_0x9d7a('0x183'),'foreignKey':'OpenchannelAccountId'});db[_0x9d7a('0x5d')][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x5d')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17c'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x5d')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x197'),'as':'Tags'});db['OpenchannelInteraction']['belongsToMany'](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x197'),'as':_0x9d7a('0x192')});db[_0x9d7a('0x5d')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17f'),'through':_0x9d7a('0x198'),'foreignKey':_0x9d7a('0x196')});db[_0x9d7a('0x5e')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'onDelete':_0x9d7a('0x117'),'as':_0x9d7a('0x13')});db[_0x9d7a('0x5e')][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'onDelete':'cascade','as':_0x9d7a('0x16a')});db[_0x9d7a('0x5e')]['belongsTo'](db[_0x9d7a('0x5d')],{'onDelete':_0x9d7a('0x117'),'as':_0x9d7a('0x182'),'foreignKey':_0x9d7a('0x196')});db[_0x9d7a('0x5e')]['belongsTo'](db[_0x9d7a('0x180')],{'as':_0x9d7a('0x180'),'foreignKey':_0x9d7a('0x199')});db[_0x9d7a('0x5e')][_0x9d7a('0x128')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x9d7a('0x60')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x34'),'foreignKey':'OpenchannelQueueId'});db[_0x9d7a('0x60')][_0x9d7a('0x12a')](db[_0x9d7a('0xeb')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite'][_0x9d7a('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x9d7a('0x19a'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x13c')]['hasMany'](db[_0x9d7a('0x80')],{'as':_0x9d7a('0x172'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x9d7a('0x11b')](db[_0x9d7a('0x6c')],{'as':'ProactiveActions'});db[_0x9d7a('0x13c')][_0x9d7a('0x11b')](db['ChatInteraction'],{'as':_0x9d7a('0x173')});db[_0x9d7a('0x13c')][_0x9d7a('0x11b')](db['ChatApplication'],{'as':_0x9d7a('0x14c')});db[_0x9d7a('0x13c')]['hasMany'](db[_0x9d7a('0x66')],{'as':_0x9d7a('0x161')});db['ChatWebsite'][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0x13c')][_0x9d7a('0x128')](db['Interval'],{'as':_0x9d7a('0x159'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{'as':_0x9d7a('0x3b'),'foreignKey':'MailAccountId'});db[_0x9d7a('0x13c')][_0x9d7a('0x128')](db[_0x9d7a('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0x9d7a('0x15c')});db[_0x9d7a('0x13c')]['belongsToMany'](db[_0x9d7a('0x13')],{'as':'Agents','through':_0x9d7a('0x13e')});db[_0x9d7a('0x62')][_0x9d7a('0x128')](db[_0x9d7a('0x59')],{});db[_0x9d7a('0x62')]['belongsTo'](db[_0x9d7a('0xfb')],{'as':'List','foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0x62')]['belongsTo'](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':'ContactId'});db[_0x9d7a('0x62')][_0x9d7a('0x128')](db['OpenchannelInteraction'],{});db[_0x9d7a('0x62')]['belongsTo'](db[_0x9d7a('0x5e')],{});db[_0x9d7a('0x62')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{});db['OpenchannelQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x60')],{});db[_0x9d7a('0x64')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x19b'),'foreignKey':_0x9d7a('0x118'),'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x64')]['belongsTo'](db[_0x9d7a('0x69')],{'as':_0x9d7a('0x19c'),'foreignKey':_0x9d7a('0x19d'),'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x64')]['belongsTo'](db[_0x9d7a('0x13c')],{'as':_0x9d7a('0x19e'),'foreignKey':_0x9d7a('0x19a'),'onDelete':'restrict'});db[_0x9d7a('0x64')][_0x9d7a('0x128')](db['Tag'],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x185')});db[_0x9d7a('0x19f')]['hasMany'](db[_0x9d7a('0x66')],{'as':'Messages','onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x9d7a('0x19f')][_0x9d7a('0x128')](db['ChatWebsite'],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x19a')});db[_0x9d7a('0x19f')][_0x9d7a('0x128')](db['CmContact'],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x19f')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17c'),'foreignKey':_0x9d7a('0x118')});db['ChatInteraction'][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x1a0'),'as':_0x9d7a('0x17e')});db['ChatInteraction']['belongsToMany'](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x1a0'),'as':_0x9d7a('0x192')});db[_0x9d7a('0x19f')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17f'),'through':'user_has_chat_interactions','foreignKey':_0x9d7a('0x1a1')});db[_0x9d7a('0x66')]['belongsTo'](db[_0x9d7a('0x13')],{'onDelete':_0x9d7a('0x117'),'as':_0x9d7a('0x13')});db[_0x9d7a('0x66')]['belongsTo'](db[_0x9d7a('0x70')],{'onDelete':_0x9d7a('0x117'),'as':'Contact','foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x66')][_0x9d7a('0x128')](db[_0x9d7a('0x19f')],{'onDelete':_0x9d7a('0x117'),'as':'Interaction','foreignKey':_0x9d7a('0x1a1')});db[_0x9d7a('0x66')][_0x9d7a('0x128')](db['Attachment'],{'as':_0x9d7a('0x180'),'foreignKey':_0x9d7a('0x199')});db[_0x9d7a('0x66')][_0x9d7a('0x128')](db['ChatWebsite'],{'as':_0x9d7a('0x183'),'foreignKey':'ChatWebsiteId'});db[_0x9d7a('0x184')]['hasMany'](db[_0x9d7a('0x180')],{'as':_0x9d7a('0x181'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x9d7a('0x117'),'hooks':!![]});db[_0x9d7a('0x184')][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'onDelete':_0x9d7a('0x117'),'as':'Contact','foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x184')][_0x9d7a('0x128')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue']['belongsToMany'](db['User'],{'as':_0x9d7a('0x15d'),'through':'UserChatQueue','hooks':!![]});db[_0x9d7a('0x69')][_0x9d7a('0x12a')](db[_0x9d7a('0xeb')],{'through':'team_has_chat_queues','as':_0x9d7a('0x15e')});db['ChatGroup'][_0x9d7a('0x11b')](db[_0x9d7a('0xda')],{'as':_0x9d7a('0x161'),'foreignKey':_0x9d7a('0x1a2'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x6b')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x14f'),'through':'chat_group_has_users'});db[_0x9d7a('0x6c')][_0x9d7a('0x128')](db['ChatWebsite'],{'as':_0x9d7a('0x19e'),'foreignKey':_0x9d7a('0x19a')});db[_0x9d7a('0x6e')][_0x9d7a('0x11b')](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x12d'),'foreignKey':_0x9d7a('0x1a3')});db[_0x9d7a('0x70')]['hasMany'](db[_0x9d7a('0x90')],{'as':'Phones','foreignKey':_0x9d7a('0x1a4')});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db[_0x9d7a('0x72')],{'as':_0x9d7a('0x151'),'foreignKey':'ContactId'});db['CmContact'][_0x9d7a('0x11b')](db[_0x9d7a('0x76')],{'as':_0x9d7a('0x152'),'foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db['CmHopperHistory'],{'as':_0x9d7a('0x153'),'foreignKey':'ContactId'});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db[_0x9d7a('0x7a')],{'as':_0x9d7a('0x7a'),'foreignKey':'ContactId'});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db['JscriptySessionReport'],{'as':_0x9d7a('0x155'),'foreignKey':'ContactId'});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db['OpenchannelInteraction'],{'as':_0x9d7a('0x120'),'foreignKey':_0x9d7a('0x17b'),'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db[_0x9d7a('0x19f')],{'as':'ChatInteractions','foreignKey':_0x9d7a('0x17b'),'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db[_0x9d7a('0x54')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x70')][_0x9d7a('0x11b')](db[_0x9d7a('0x188')],{'as':_0x9d7a('0x122'),'foreignKey':_0x9d7a('0x17b'),'onDelete':_0x9d7a('0x16b')});db['CmContact']['hasMany'](db[_0x9d7a('0x40')],{'as':'MailInteractions','foreignKey':_0x9d7a('0x17b'),'onDelete':_0x9d7a('0x16b')});db['CmContact']['belongsTo'](db[_0x9d7a('0x6e')],{'as':_0x9d7a('0x1a5'),'foreignKey':_0x9d7a('0x1a3')});db['CmContact'][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':'List','foreignKey':_0x9d7a('0x175'),'onDelete':'cascade'});db[_0x9d7a('0x70')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17f'),'through':_0x9d7a('0x12e')});db[_0x9d7a('0x70')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'as':_0x9d7a('0x17e'),'through':'cm_contact_has_tags'});db[_0x9d7a('0x70')][_0x9d7a('0x12a')](db['Tag'],{'through':_0x9d7a('0x1a6'),'as':'ThroughTags'});db[_0x9d7a('0x72')][_0x9d7a('0x11b')](db[_0x9d7a('0x92')],{'as':_0x9d7a('0x1a7'),'foreignKey':_0x9d7a('0x1a8')});db[_0x9d7a('0x72')][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b'),'onDelete':_0x9d7a('0x117')});db['CmHopper'][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175'),'onDelete':'cascade'});db[_0x9d7a('0x72')][_0x9d7a('0x128')](db['User'],{'as':_0x9d7a('0x19b'),'foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x72')][_0x9d7a('0x128')](db[_0x9d7a('0x1b')],{'as':_0x9d7a('0x19c'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x9d7a('0x72')][_0x9d7a('0x128')](db[_0x9d7a('0x1a9')],{'as':_0x9d7a('0x1a9'),'foreignKey':'CampaignId','onDelete':_0x9d7a('0x117')});db['CmHopper']['belongsTo'](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17c'),'foreignKey':_0x9d7a('0x1aa')});db['CmHopperBlack'][_0x9d7a('0x128')](db['CmContact'],{'as':_0x9d7a('0x16a'),'foreignKey':'ContactId','onDelete':_0x9d7a('0x117')});db['CmHopperBlack'][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x74')][_0x9d7a('0x128')](db['VoiceQueue'],{'as':_0x9d7a('0x19c'),'foreignKey':_0x9d7a('0x150'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x74')][_0x9d7a('0x128')](db[_0x9d7a('0x1a9')],{'as':'Campaign','foreignKey':_0x9d7a('0x1ab'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x7f')]['hasMany'](db[_0x9d7a('0x82')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0x9d7a('0x1ac'),'onDelete':_0x9d7a('0x117'),'hooks':!![]});db['Automation'][_0x9d7a('0x11b')](db[_0x9d7a('0x82')],{'as':{'plural':_0x9d7a('0x1ad'),'singular':_0x9d7a('0x1ae')},'foreignKey':_0x9d7a('0x1af'),'onDelete':_0x9d7a('0x117'),'hooks':!![]});db[_0x9d7a('0x7f')]['hasMany'](db[_0x9d7a('0x7d')],{'as':_0x9d7a('0x1b0'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x9d7a('0x170')][_0x9d7a('0x11b')](db[_0x9d7a('0x170')],{'as':_0x9d7a('0x171'),'foreignKey':_0x9d7a('0x1b1'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x159')][_0x9d7a('0x11b')](db[_0x9d7a('0x159')],{'as':'Intervals','foreignKey':_0x9d7a('0x15a'),'onDelete':_0x9d7a('0x117'),'hooks':!![],'required':![]});db[_0x9d7a('0x159')][_0x9d7a('0x11b')](db[_0x9d7a('0x18')],{'as':'Extensions','foreignKey':_0x9d7a('0x15a'),'onDelete':'restrict'});db[_0x9d7a('0x159')][_0x9d7a('0x11b')](db[_0x9d7a('0x44')],{'as':'MailApplications','foreignKey':_0x9d7a('0x15a')});db['Interval'][_0x9d7a('0x11b')](db['ChatApplication'],{'as':_0x9d7a('0x1b2'),'foreignKey':'IntervalId'});db[_0x9d7a('0x159')][_0x9d7a('0x11b')](db[_0x9d7a('0x189')],{'as':_0x9d7a('0x1b3'),'foreignKey':'IntervalId'});db['Interval'][_0x9d7a('0x11b')](db['SmsApplication'],{'as':_0x9d7a('0x1b4'),'foreignKey':_0x9d7a('0x15a')});db['Schedule']['belongsTo'](db[_0x9d7a('0x3b')],{});db['Schedule'][_0x9d7a('0x128')](db['AnalyticDefaultReport'],{'foreignKey':_0x9d7a('0x1b5')});db[_0x9d7a('0x8a')][_0x9d7a('0x128')](db[_0x9d7a('0x99')],{'foreignKey':_0x9d7a('0x1b6')});db['Sound'][_0x9d7a('0x12a')](db[_0x9d7a('0x1a')],{'as':'Mohs','through':_0x9d7a('0x14e'),'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x8d')][_0x9d7a('0x12a')](db[_0x9d7a('0x70')],{'through':_0x9d7a('0x1a6')});db[_0x9d7a('0x8d')][_0x9d7a('0x12a')](db[_0x9d7a('0x19f')],{'through':_0x9d7a('0x1a0')});db[_0x9d7a('0x8d')][_0x9d7a('0x12a')](db[_0x9d7a('0x40')],{'through':'mail_interaction_has_tags'});db[_0x9d7a('0x8d')][_0x9d7a('0x12a')](db[_0x9d7a('0x54')],{'through':_0x9d7a('0x191')});db[_0x9d7a('0x8d')]['belongsToMany'](db[_0x9d7a('0x188')],{'through':'fax_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x9d7a('0x5d')],{'through':_0x9d7a('0x197')});db[_0x9d7a('0x8d')][_0x9d7a('0x12a')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem'][_0x9d7a('0x128')](db[_0x9d7a('0x8e')],{'as':_0x9d7a('0x1b7'),'foreignKey':_0x9d7a('0x1b8')});db[_0x9d7a('0x92')][_0x9d7a('0x128')](db[_0x9d7a('0x72')],{'as':_0x9d7a('0x1b9'),'foreignKey':_0x9d7a('0x1a8')});db[_0x9d7a('0x90')]['belongsTo'](db[_0x9d7a('0x70')],{'as':'Contact','foreignKey':'CmContactId'});db['Trigger']['hasMany'](db['Condition'],{'as':{'plural':_0x9d7a('0x1ba'),'singular':_0x9d7a('0x1bb')},'foreignKey':_0x9d7a('0x1bc'),'onDelete':_0x9d7a('0x117'),'hooks':!![]});db[_0x9d7a('0x95')][_0x9d7a('0x11b')](db[_0x9d7a('0x82')],{'as':{'plural':_0x9d7a('0x1bd'),'singular':_0x9d7a('0x1be')},'foreignKey':_0x9d7a('0x1bf'),'onDelete':_0x9d7a('0x117'),'hooks':!![]});db['Trigger'][_0x9d7a('0x11b')](db['Action'],{'as':_0x9d7a('0x1b0'),'foreignKey':_0x9d7a('0x1c0'),'onDelete':_0x9d7a('0x117'),'hooks':!![]});db[_0x9d7a('0x99')][_0x9d7a('0x11b')](db[_0x9d7a('0xa0')],{'as':_0x9d7a('0x1c1'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1b6'),'hooks':!![]});db[_0x9d7a('0x9b')][_0x9d7a('0x11b')](db[_0x9d7a('0xa0')],{'as':_0x9d7a('0x1c1'),'onDelete':'cascade','foreignKey':_0x9d7a('0x1b5')});db[_0x9d7a('0x9e')][_0x9d7a('0x11b')](db[_0x9d7a('0xa0')],{'as':_0x9d7a('0x1c1'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c2')});db[_0x9d7a('0xa0')]['belongsTo'](db[_0x9d7a('0x9e')],{'foreignKey':_0x9d7a('0x1c2')});db[_0x9d7a('0xa3')][_0x9d7a('0x11b')](db[_0x9d7a('0x1c3')],{'as':'Configurations','onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c4')});db['SalesforceConfiguration'][_0x9d7a('0x11b')](db[_0x9d7a('0x1c5')],{'as':_0x9d7a('0x1c6'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0x1c3')][_0x9d7a('0x11b')](db[_0x9d7a('0x1c5')],{'as':_0x9d7a('0x1c8'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c9')});db['SalesforceConfiguration'][_0x9d7a('0x11b')](db['SalesforceField'],{'as':_0x9d7a('0x1c1'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0x1c3')][_0x9d7a('0x128')](db[_0x9d7a('0xa3')],{'as':_0x9d7a('0x183'),'foreignKey':'AccountId'});db[_0x9d7a('0x1c5')][_0x9d7a('0x11b')](db[_0x9d7a('0x1c5')],{'as':_0x9d7a('0x1cb'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0x1c5')][_0x9d7a('0x11b')](db[_0x9d7a('0x1c5')],{'as':_0x9d7a('0x1cc'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0x1c5')][_0x9d7a('0x11b')](db[_0x9d7a('0x1c5')],{'as':_0x9d7a('0x1cd'),'foreignKey':'FieldId'});db[_0x9d7a('0x1c5')][_0x9d7a('0x128')](db[_0x9d7a('0x1ce')],{'as':'Variable','foreignKey':_0x9d7a('0x1cf')});db[_0x9d7a('0xa7')][_0x9d7a('0x11b')](db[_0x9d7a('0xa8')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9d7a('0x1c4')});db['SugarcrmConfiguration'][_0x9d7a('0x11b')](db[_0x9d7a('0xaa')],{'as':_0x9d7a('0x1c6'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xa8')][_0x9d7a('0x11b')](db[_0x9d7a('0xaa')],{'as':_0x9d7a('0x1c8'),'onDelete':_0x9d7a('0x117'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x9d7a('0x11b')](db[_0x9d7a('0xaa')],{'as':_0x9d7a('0x1c1'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xa8')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xaa')][_0x9d7a('0x11b')](db[_0x9d7a('0xaa')],{'as':'Subject','foreignKey':_0x9d7a('0x1c7')});db['SugarcrmField']['hasMany'](db[_0x9d7a('0xaa')],{'as':_0x9d7a('0x1cc'),'foreignKey':_0x9d7a('0x1c9')});db['SugarcrmField'][_0x9d7a('0x11b')](db[_0x9d7a('0xaa')],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xaa')][_0x9d7a('0x128')](db[_0x9d7a('0x1ce')],{'as':'Variable','foreignKey':_0x9d7a('0x1cf')});db[_0x9d7a('0xac')]['hasMany'](db[_0x9d7a('0xae')],{'as':_0x9d7a('0x1d0'),'onDelete':_0x9d7a('0x117'),'foreignKey':'AccountId'});db[_0x9d7a('0xae')]['hasMany'](db[_0x9d7a('0xb0')],{'as':_0x9d7a('0x1c6'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xae')]['hasMany'](db['DeskField'],{'as':_0x9d7a('0x1c8'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c9')});db['DeskConfiguration'][_0x9d7a('0x11b')](db[_0x9d7a('0xb0')],{'as':'Fields','onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xae')][_0x9d7a('0x128')](db[_0x9d7a('0xac')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xae')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':'int_desk_configuration_has_tags'});db[_0x9d7a('0xb0')][_0x9d7a('0x11b')](db['DeskField'],{'as':'Subject','foreignKey':_0x9d7a('0x1c7')});db['DeskField'][_0x9d7a('0x11b')](db[_0x9d7a('0xb0')],{'as':_0x9d7a('0x1cc'),'foreignKey':_0x9d7a('0x1c9')});db['DeskField'][_0x9d7a('0x11b')](db[_0x9d7a('0xb0')],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xb0')][_0x9d7a('0x128')](db['Variable'],{'as':_0x9d7a('0x1ce'),'foreignKey':'VariableId'});db[_0x9d7a('0xb2')][_0x9d7a('0x11b')](db['ZohoConfiguration'],{'as':_0x9d7a('0x1d0'),'onDelete':_0x9d7a('0x117'),'foreignKey':'AccountId'});db[_0x9d7a('0xb4')][_0x9d7a('0x11b')](db[_0x9d7a('0xb6')],{'as':'Subjects','onDelete':_0x9d7a('0x117'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x9d7a('0x11b')](db[_0x9d7a('0xb6')],{'as':'Descriptions','onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xb4')][_0x9d7a('0x11b')](db[_0x9d7a('0xb6')],{'as':'Fields','onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xb4')][_0x9d7a('0x128')](db[_0x9d7a('0xb2')],{'as':_0x9d7a('0x183'),'foreignKey':'AccountId'});db['ZohoField'][_0x9d7a('0x11b')](db[_0x9d7a('0xb6')],{'as':_0x9d7a('0x1cb'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xb6')]['hasMany'](db['ZohoField'],{'as':_0x9d7a('0x1cc'),'foreignKey':'DescriptionId'});db[_0x9d7a('0xb6')][_0x9d7a('0x11b')](db[_0x9d7a('0xb6')],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xb6')][_0x9d7a('0x128')](db['Variable'],{'as':_0x9d7a('0x1ce'),'foreignKey':'VariableId'});db[_0x9d7a('0xb7')][_0x9d7a('0x11b')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xb9')][_0x9d7a('0x11b')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xb9')][_0x9d7a('0x11b')](db[_0x9d7a('0xbb')],{'as':'Descriptions','foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xb9')]['hasMany'](db[_0x9d7a('0xbb')],{'as':'Fields','foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xb9')][_0x9d7a('0x128')](db[_0x9d7a('0xb7')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xb9')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x1d1')});db[_0x9d7a('0xbb')]['hasMany'](db[_0x9d7a('0xbb')],{'as':_0x9d7a('0x1cb'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xbb')][_0x9d7a('0x11b')](db[_0x9d7a('0xbb')],{'as':_0x9d7a('0x1cc'),'foreignKey':'DescriptionId'});db[_0x9d7a('0xbb')][_0x9d7a('0x11b')](db[_0x9d7a('0xbb')],{'as':'Field','foreignKey':'FieldId'});db[_0x9d7a('0xbb')]['belongsTo'](db[_0x9d7a('0x1ce')],{'as':_0x9d7a('0x1ce'),'foreignKey':'VariableId'});db[_0x9d7a('0x1d2')][_0x9d7a('0x11b')](db[_0x9d7a('0xbe')],{'as':_0x9d7a('0x1d0'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xbe')][_0x9d7a('0x11b')](db[_0x9d7a('0xbf')],{'as':_0x9d7a('0x1c6'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c7')});db['FreshdeskConfiguration'][_0x9d7a('0x11b')](db[_0x9d7a('0xbf')],{'as':_0x9d7a('0x1c8'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xbe')][_0x9d7a('0x11b')](db[_0x9d7a('0xbf')],{'as':_0x9d7a('0x1c1'),'onDelete':'cascade','foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xbe')][_0x9d7a('0x128')](db[_0x9d7a('0x1d2')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xbe')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x1d3')});db[_0x9d7a('0xbf')][_0x9d7a('0x11b')](db[_0x9d7a('0xbf')],{'as':_0x9d7a('0x1cb'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xbf')][_0x9d7a('0x11b')](db[_0x9d7a('0xbf')],{'as':_0x9d7a('0x1cc'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xbf')][_0x9d7a('0x11b')](db['FreshdeskField'],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xbf')][_0x9d7a('0x128')](db[_0x9d7a('0x1ce')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9d7a('0x1d4')][_0x9d7a('0x11b')](db['VtigerConfiguration'],{'as':_0x9d7a('0x1d0'),'onDelete':'cascade','foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xc1')][_0x9d7a('0x11b')](db[_0x9d7a('0xc3')],{'as':_0x9d7a('0x1c6'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xc1')][_0x9d7a('0x11b')](db[_0x9d7a('0xc3')],{'as':_0x9d7a('0x1c8'),'foreignKey':'DescriptionId'});db[_0x9d7a('0xc1')][_0x9d7a('0x11b')](db['VtigerField'],{'as':_0x9d7a('0x1c1'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xc1')][_0x9d7a('0x128')](db[_0x9d7a('0x1d4')],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x1c4')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0x9d7a('0x1cb'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xc3')][_0x9d7a('0x11b')](db['VtigerField'],{'as':_0x9d7a('0x1cc'),'foreignKey':_0x9d7a('0x1c9')});db['VtigerField'][_0x9d7a('0x11b')](db[_0x9d7a('0xc3')],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xc3')][_0x9d7a('0x128')](db[_0x9d7a('0x1ce')],{'as':'Variable','foreignKey':_0x9d7a('0x1cf')});db[_0x9d7a('0xc5')][_0x9d7a('0x11b')](db[_0x9d7a('0xc7')],{'as':_0x9d7a('0x1d0'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xc7')]['hasMany'](db[_0x9d7a('0xc9')],{'as':_0x9d7a('0x1c6'),'foreignKey':_0x9d7a('0x1c7')});db['ServicenowConfiguration'][_0x9d7a('0x11b')](db[_0x9d7a('0xc9')],{'as':_0x9d7a('0x1c8'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xc7')][_0x9d7a('0x11b')](db['ServicenowField'],{'as':_0x9d7a('0x1c1'),'foreignKey':'FieldId'});db[_0x9d7a('0xc7')][_0x9d7a('0x128')](db[_0x9d7a('0xc5')],{'as':'Account','foreignKey':_0x9d7a('0x1c4')});db['ServicenowField'][_0x9d7a('0x11b')](db['ServicenowField'],{'as':_0x9d7a('0x1cb'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xc9')][_0x9d7a('0x11b')](db[_0x9d7a('0xc9')],{'as':_0x9d7a('0x1cc'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xc9')][_0x9d7a('0x11b')](db[_0x9d7a('0xc9')],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xc9')]['belongsTo'](db[_0x9d7a('0x1ce')],{'as':_0x9d7a('0x1ce'),'foreignKey':'VariableId'});db[_0x9d7a('0xcb')][_0x9d7a('0x11b')](db[_0x9d7a('0xcd')],{'as':_0x9d7a('0x1d0'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xcb')][_0x9d7a('0x128')](db['CloudProvider'],{'as':_0x9d7a('0x10d'),'foreignKey':_0x9d7a('0x16d')});db[_0x9d7a('0xcd')][_0x9d7a('0x11b')](db[_0x9d7a('0xcf')],{'as':'Subjects','onDelete':_0x9d7a('0x117'),'foreignKey':'SubjectId'});db[_0x9d7a('0xcd')][_0x9d7a('0x11b')](db[_0x9d7a('0xcf')],{'as':_0x9d7a('0x1c8'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xcd')][_0x9d7a('0x11b')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1ca')});db['Dynamics365Configuration'][_0x9d7a('0x128')](db[_0x9d7a('0xcb')],{'as':'Account','foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xcf')][_0x9d7a('0x11b')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xcf')][_0x9d7a('0x11b')](db[_0x9d7a('0xcf')],{'as':_0x9d7a('0x1cc'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xcf')][_0x9d7a('0x11b')](db['Dynamics365Field'],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xcf')][_0x9d7a('0x128')](db[_0x9d7a('0x1ce')],{'as':_0x9d7a('0x1ce'),'foreignKey':_0x9d7a('0x1cf')});db[_0x9d7a('0x1d5')]['hasMany'](db[_0x9d7a('0xd2')],{'as':_0x9d7a('0x1d0'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1c4')});db[_0x9d7a('0xd2')]['hasMany'](db['FreshsalesField'],{'as':_0x9d7a('0x1c6'),'foreignKey':_0x9d7a('0x1c7')});db[_0x9d7a('0xd2')][_0x9d7a('0x11b')](db[_0x9d7a('0xd4')],{'as':_0x9d7a('0x1c8'),'foreignKey':_0x9d7a('0x1c9')});db[_0x9d7a('0xd2')][_0x9d7a('0x11b')](db[_0x9d7a('0xd4')],{'as':_0x9d7a('0x1c1'),'foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0x9d7a('0x1d5')],{'as':_0x9d7a('0x183'),'foreignKey':'AccountId'});db[_0x9d7a('0xd4')][_0x9d7a('0x11b')](db[_0x9d7a('0xd4')],{'as':_0x9d7a('0x1cb'),'foreignKey':'SubjectId'});db[_0x9d7a('0xd4')][_0x9d7a('0x11b')](db[_0x9d7a('0xd4')],{'as':_0x9d7a('0x1cc'),'foreignKey':'DescriptionId'});db[_0x9d7a('0xd4')][_0x9d7a('0x11b')](db[_0x9d7a('0xd4')],{'as':_0x9d7a('0x1cd'),'foreignKey':_0x9d7a('0x1ca')});db[_0x9d7a('0xd4')][_0x9d7a('0x128')](db['Variable'],{'as':_0x9d7a('0x1ce'),'foreignKey':'VariableId'});db[_0x9d7a('0xd9')][_0x9d7a('0x128')](db[_0x9d7a('0x13c')],{});db['ChatQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':'ListId'});db[_0x9d7a('0xd9')]['belongsTo'](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0xd9')][_0x9d7a('0x128')](db[_0x9d7a('0x19f')],{});db['ChatQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x66')],{});db[_0x9d7a('0xd9')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{});db[_0x9d7a('0xd9')][_0x9d7a('0x128')](db[_0x9d7a('0x69')],{});db['ChatInternalMessage'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1d6')});db['ChatInternalMessage'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x1d7')});db[_0x9d7a('0x154')]['hasMany'](db[_0x9d7a('0xdd')],{'foreignKey':_0x9d7a('0x1d8'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x154')][_0x9d7a('0x11b')](db[_0x9d7a('0x1d9')],{'foreignKey':_0x9d7a('0x1d8'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x1da')][_0x9d7a('0x128')](db[_0x9d7a('0x52')],{});db[_0x9d7a('0x1da')][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0x1da')][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'as':'Contact','foreignKey':_0x9d7a('0x17b')});db['SmsQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x54')],{});db['SmsQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x18f')],{});db[_0x9d7a('0x1da')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{});db[_0x9d7a('0x1da')][_0x9d7a('0x128')](db[_0x9d7a('0x57')],{});db['JscriptyProject']['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x9d7a('0x1db')});db['JscriptyProject'][_0x9d7a('0x11b')](db[_0x9d7a('0xdd')],{'foreignKey':_0x9d7a('0x1db')});db[_0x9d7a('0x1dc')][_0x9d7a('0x11b')](db[_0x9d7a('0x1d9')],{'foreignKey':_0x9d7a('0x1db')});db[_0x9d7a('0xe5')][_0x9d7a('0x12a')](db['User'],{'as':_0x9d7a('0x17f'),'through':_0x9d7a('0x1dd')});db[_0x9d7a('0xeb')]['belongsToMany'](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x1de')});db[_0x9d7a('0xeb')]['belongsToMany'](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x9d7a('0x1df')});db[_0x9d7a('0xeb')]['belongsToMany'](db[_0x9d7a('0x178')],{'through':_0x9d7a('0x179'),'as':_0x9d7a('0x135')});db[_0x9d7a('0xeb')][_0x9d7a('0x12a')](db[_0x9d7a('0x69')],{'through':_0x9d7a('0x1e0'),'as':'ChatQueues'});db['Team']['belongsToMany'](db['FaxQueue'],{'through':_0x9d7a('0x18d'),'as':_0x9d7a('0x136')});db[_0x9d7a('0xeb')][_0x9d7a('0x12a')](db[_0x9d7a('0x57')],{'through':_0x9d7a('0x1e1'),'as':_0x9d7a('0x1e2')});db[_0x9d7a('0xeb')][_0x9d7a('0x12a')](db[_0x9d7a('0x60')],{'through':_0x9d7a('0x1e3'),'as':_0x9d7a('0x137')});db[_0x9d7a('0xeb')][_0x9d7a('0x12a')](db[_0x9d7a('0x138')],{'through':_0x9d7a('0x1e4'),'as':_0x9d7a('0x139')});db[_0x9d7a('0xeb')][_0x9d7a('0x12a')](db[_0x9d7a('0xfd')],{'through':'TeamVoicePrefix','as':_0x9d7a('0x134')});db['Campaign'][_0x9d7a('0x11b')](db['CmHopper'],{'as':_0x9d7a('0x151'),'foreignKey':_0x9d7a('0x1ab')});db[_0x9d7a('0x1a9')][_0x9d7a('0x11b')](db[_0x9d7a('0x76')],{'as':_0x9d7a('0x152'),'foreignKey':'CampaignId'});db[_0x9d7a('0x1a9')][_0x9d7a('0x11b')](db[_0x9d7a('0x78')],{'as':'HopperHistories','foreignKey':_0x9d7a('0x1ab')});db[_0x9d7a('0x1a9')][_0x9d7a('0x11b')](db[_0x9d7a('0x74')],{'as':_0x9d7a('0x1e5'),'foreignKey':_0x9d7a('0x1ab')});db[_0x9d7a('0x1a9')][_0x9d7a('0x128')](db['Trunk'],{'as':'Trunk','foreignKey':_0x9d7a('0x156')});db[_0x9d7a('0x1a9')]['belongsTo'](db['Trunk'],{'as':_0x9d7a('0x157'),'foreignKey':_0x9d7a('0x158')});db[_0x9d7a('0x1a9')][_0x9d7a('0x128')](db['Interval'],{'as':_0x9d7a('0x159'),'foreignKey':_0x9d7a('0x15a')});db[_0x9d7a('0x1a9')][_0x9d7a('0x128')](db['SquareProject'],{'as':_0x9d7a('0xe5'),'foreignKey':_0x9d7a('0x1e6')});db['Campaign'][_0x9d7a('0x12a')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x12f'),'through':_0x9d7a('0x1e7')});db['Campaign'][_0x9d7a('0x12a')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x15f'),'through':_0x9d7a('0x1e8')});db[_0x9d7a('0x180')][_0x9d7a('0x128')](db[_0x9d7a('0x184')],{'as':_0x9d7a('0x184'),'foreignKey':_0x9d7a('0x1e9')});db[_0x9d7a('0x1ea')][_0x9d7a('0x128')](db[_0x9d7a('0x42')],{});db['MailTransferReport'][_0x9d7a('0x128')](db[_0x9d7a('0x40')],{});db[_0x9d7a('0x1ea')][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{'foreignKey':_0x9d7a('0x1eb'),'as':_0x9d7a('0x1ec')});db[_0x9d7a('0x1ea')]['belongsTo'](db[_0x9d7a('0x13')],{'foreignKey':_0x9d7a('0x1ed'),'as':_0x9d7a('0x1ee')});db[_0x9d7a('0x1ea')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'foreignKey':'ToUserId','as':_0x9d7a('0x1ef')});db[_0x9d7a('0x1ea')]['belongsTo'](db[_0x9d7a('0x178')],{'foreignKey':_0x9d7a('0x1f0'),'as':_0x9d7a('0x1f1')});db[_0x9d7a('0x1ea')][_0x9d7a('0x128')](db[_0x9d7a('0x3b')],{'foreignKey':_0x9d7a('0x1f2'),'as':_0x9d7a('0x1f3')});db[_0x9d7a('0xf5')][_0x9d7a('0x128')](db[_0x9d7a('0x66')],{});db['ChatTransferReport']['belongsTo'](db[_0x9d7a('0x19f')],{});db[_0x9d7a('0xf5')]['belongsTo'](db[_0x9d7a('0x13c')],{'foreignKey':_0x9d7a('0x1f4'),'as':'FromAccount'});db[_0x9d7a('0xf5')]['belongsTo'](db[_0x9d7a('0x13')],{'foreignKey':_0x9d7a('0x1ed'),'as':'FromAgent'});db[_0x9d7a('0xf5')][_0x9d7a('0x128')](db['User'],{'foreignKey':'ToUserId','as':_0x9d7a('0x1ef')});db[_0x9d7a('0xf5')][_0x9d7a('0x128')](db[_0x9d7a('0x69')],{'foreignKey':'ToChatQueueId','as':_0x9d7a('0x1f1')});db[_0x9d7a('0xf5')][_0x9d7a('0x128')](db[_0x9d7a('0x13c')],{'foreignKey':_0x9d7a('0x1f5'),'as':_0x9d7a('0x1f3')});db['FaxTransferReport'][_0x9d7a('0x128')](db[_0x9d7a('0x4e')],{});db[_0x9d7a('0xf7')][_0x9d7a('0x128')](db[_0x9d7a('0x188')],{});db['FaxTransferReport'][_0x9d7a('0x128')](db['FaxAccount'],{'foreignKey':_0x9d7a('0x1f6'),'as':'FromAccount'});db[_0x9d7a('0xf7')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'foreignKey':_0x9d7a('0x1ed'),'as':'FromAgent'});db[_0x9d7a('0xf7')]['belongsTo'](db[_0x9d7a('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9d7a('0xf7')][_0x9d7a('0x128')](db['FaxQueue'],{'foreignKey':_0x9d7a('0x1f7'),'as':'ToQueue'});db[_0x9d7a('0xf7')][_0x9d7a('0x128')](db[_0x9d7a('0x4a')],{'foreignKey':_0x9d7a('0x1f8'),'as':_0x9d7a('0x1f3')});db['OpenchannelTransferReport'][_0x9d7a('0x128')](db[_0x9d7a('0x5e')],{});db[_0x9d7a('0xf8')]['belongsTo'](db[_0x9d7a('0x5d')],{});db[_0x9d7a('0xf8')][_0x9d7a('0x128')](db[_0x9d7a('0x59')],{'foreignKey':_0x9d7a('0x1f9'),'as':_0x9d7a('0x1ec')});db[_0x9d7a('0xf8')]['belongsTo'](db[_0x9d7a('0x13')],{'foreignKey':_0x9d7a('0x1ed'),'as':_0x9d7a('0x1ee')});db[_0x9d7a('0xf8')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'foreignKey':_0x9d7a('0x1fa'),'as':_0x9d7a('0x1ef')});db[_0x9d7a('0xf8')][_0x9d7a('0x128')](db['OpenchannelQueue'],{'foreignKey':_0x9d7a('0x1fb'),'as':_0x9d7a('0x1f1')});db[_0x9d7a('0xf8')]['belongsTo'](db[_0x9d7a('0x59')],{'foreignKey':_0x9d7a('0x1fc'),'as':_0x9d7a('0x1f3')});db[_0x9d7a('0x1fd')][_0x9d7a('0x128')](db['SmsMessage'],{});db[_0x9d7a('0x1fd')]['belongsTo'](db[_0x9d7a('0x54')],{});db['SmsTransferReport'][_0x9d7a('0x128')](db[_0x9d7a('0x52')],{'foreignKey':_0x9d7a('0x1fe'),'as':'FromAccount'});db['SmsTransferReport'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'foreignKey':_0x9d7a('0x1ed'),'as':_0x9d7a('0x1ee')});db[_0x9d7a('0x1fd')][_0x9d7a('0x128')](db['User'],{'foreignKey':_0x9d7a('0x1fa'),'as':_0x9d7a('0x1ef')});db[_0x9d7a('0x1fd')]['belongsTo'](db[_0x9d7a('0x57')],{'foreignKey':_0x9d7a('0x1ff'),'as':_0x9d7a('0x1f1')});db[_0x9d7a('0x1fd')][_0x9d7a('0x128')](db['SmsAccount'],{'foreignKey':_0x9d7a('0x200'),'as':_0x9d7a('0x1f3')});db[_0x9d7a('0xfb')]['hasMany'](db[_0x9d7a('0x170')],{'as':_0x9d7a('0x171'),'foreignKey':'ListId','onDelete':_0x9d7a('0x117')});db[_0x9d7a('0xfb')][_0x9d7a('0x11b')](db[_0x9d7a('0x7b')],{'as':_0x9d7a('0x201'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0xfb')][_0x9d7a('0x11b')](db[_0x9d7a('0x70')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x9d7a('0x175')});db['CmList'][_0x9d7a('0x11b')](db[_0x9d7a('0x76')],{'as':_0x9d7a('0x152'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0xfb')][_0x9d7a('0x11b')](db[_0x9d7a('0x78')],{'as':'HopperHistory','foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0xfb')]['hasMany'](db[_0x9d7a('0x7a')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x9d7a('0xfb')][_0x9d7a('0x12a')](db[_0x9d7a('0x1b')],{'as':_0x9d7a('0x202'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':_0x9d7a('0x13b')});db[_0x9d7a('0xfd')]['hasMany'](db[_0x9d7a('0x18')],{'as':_0x9d7a('0x11e'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0xfd')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0x9d7a('0xfd')][_0x9d7a('0x12a')](db['Team'],{'through':_0x9d7a('0x111'),'as':_0x9d7a('0x15e')});db[_0x9d7a('0xff')]['hasMany'](db[_0x9d7a('0x13')],{'as':'Users','foreignKey':_0x9d7a('0x129')});db[_0x9d7a('0xff')][_0x9d7a('0x11b')](db[_0x9d7a('0x203')],{'as':_0x9d7a('0x204'),'foreignKey':_0x9d7a('0x129'),'onDelete':_0x9d7a('0x117')});db['UserProfileSection'][_0x9d7a('0x11b')](db['UserProfileResource'],{'as':_0x9d7a('0x205'),'foreignKey':_0x9d7a('0x206'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x102')][_0x9d7a('0x11b')](db[_0x9d7a('0x170')],{'as':_0x9d7a('0x171'),'foreignKey':_0x9d7a('0x207'),'onDelete':_0x9d7a('0x117')});db[_0x9d7a('0x102')]['hasMany'](db[_0x9d7a('0x80')],{'as':_0x9d7a('0x172'),'foreignKey':_0x9d7a('0x207')});db[_0x9d7a('0x102')]['hasMany'](db[_0x9d7a('0x108')],{'as':'Messages','foreignKey':_0x9d7a('0x207')});db[_0x9d7a('0x102')][_0x9d7a('0x11b')](db['WhatsappInteraction'],{'as':_0x9d7a('0x173')});db[_0x9d7a('0x102')][_0x9d7a('0x11b')](db[_0x9d7a('0x104')],{'as':'Applications'});db['WhatsappAccount'][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db[_0x9d7a('0x102')][_0x9d7a('0x128')](db['Pause'],{'as':_0x9d7a('0x15b'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x15d'),'through':'user_has_whatsapp_accounts'});db[_0x9d7a('0x104')]['belongsTo'](db[_0x9d7a('0x13')],{'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x104')][_0x9d7a('0x128')](db['WhatsappQueue'],{'onDelete':_0x9d7a('0x16b')});db['WhatsappApplication']['belongsTo'](db[_0x9d7a('0x102')],{'onDelete':'restrict'});db[_0x9d7a('0x104')][_0x9d7a('0x128')](db[_0x9d7a('0x159')],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x15a')});db[_0x9d7a('0x104')][_0x9d7a('0x128')](db['Tag'],{'onDelete':_0x9d7a('0x16b'),'foreignKey':_0x9d7a('0x185')});db[_0x9d7a('0x106')]['hasMany'](db[_0x9d7a('0x108')],{'as':_0x9d7a('0x161'),'onDelete':_0x9d7a('0x117'),'foreignKey':_0x9d7a('0x208')});db[_0x9d7a('0x106')][_0x9d7a('0x128')](db['WhatsappAccount'],{'as':_0x9d7a('0x183'),'foreignKey':_0x9d7a('0x207')});db['WhatsappInteraction'][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'as':_0x9d7a('0x16a'),'foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x106')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':'Owner','foreignKey':_0x9d7a('0x118')});db[_0x9d7a('0x106')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x209'),'as':_0x9d7a('0x17e')});db[_0x9d7a('0x106')][_0x9d7a('0x12a')](db[_0x9d7a('0x8d')],{'through':_0x9d7a('0x209'),'as':_0x9d7a('0x192')});db[_0x9d7a('0x106')]['belongsToMany'](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x17f'),'through':_0x9d7a('0x133'),'foreignKey':_0x9d7a('0x208')});db['WhatsappMessage'][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'as':_0x9d7a('0x13')});db['WhatsappMessage'][_0x9d7a('0x128')](db['CmContact'],{'onDelete':_0x9d7a('0x117'),'as':_0x9d7a('0x16a')});db[_0x9d7a('0x108')][_0x9d7a('0x128')](db[_0x9d7a('0x106')],{'onDelete':'cascade','as':_0x9d7a('0x182'),'foreignKey':_0x9d7a('0x208')});db[_0x9d7a('0x108')][_0x9d7a('0x128')](db[_0x9d7a('0x102')],{'as':'Account','foreignKey':_0x9d7a('0x207')});db[_0x9d7a('0x109')][_0x9d7a('0x128')](db[_0x9d7a('0x102')],{});db[_0x9d7a('0x109')][_0x9d7a('0x128')](db[_0x9d7a('0xfb')],{'as':_0x9d7a('0x174'),'foreignKey':_0x9d7a('0x175')});db['WhatsappQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x70')],{'as':'Contact','foreignKey':_0x9d7a('0x17b')});db[_0x9d7a('0x109')]['belongsTo'](db[_0x9d7a('0x106')],{});db['WhatsappQueueReport'][_0x9d7a('0x128')](db[_0x9d7a('0x138')],{});db[_0x9d7a('0x109')][_0x9d7a('0x128')](db['WhatsappMessage'],{});db[_0x9d7a('0x109')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{});db[_0x9d7a('0x20a')][_0x9d7a('0x128')](db[_0x9d7a('0x108')],{});db[_0x9d7a('0x20a')][_0x9d7a('0x128')](db[_0x9d7a('0x106')],{});db[_0x9d7a('0x20a')][_0x9d7a('0x128')](db[_0x9d7a('0x102')],{'foreignKey':_0x9d7a('0x20b'),'as':_0x9d7a('0x1ec')});db[_0x9d7a('0x20a')][_0x9d7a('0x128')](db[_0x9d7a('0x102')],{'foreignKey':_0x9d7a('0x20c'),'as':_0x9d7a('0x1f3')});db[_0x9d7a('0x20a')][_0x9d7a('0x128')](db[_0x9d7a('0x138')],{'foreignKey':_0x9d7a('0x20d'),'as':_0x9d7a('0x1f1')});db[_0x9d7a('0x20a')]['belongsTo'](db['User'],{'foreignKey':_0x9d7a('0x1ed'),'as':_0x9d7a('0x1ee')});db[_0x9d7a('0x20a')][_0x9d7a('0x128')](db[_0x9d7a('0x13')],{'foreignKey':_0x9d7a('0x1fa'),'as':_0x9d7a('0x1ef')});db[_0x9d7a('0x138')][_0x9d7a('0x12a')](db[_0x9d7a('0x13')],{'as':'Agents','through':_0x9d7a('0x13a'),'foreignKey':_0x9d7a('0x20e')});db['WhatsappQueue'][_0x9d7a('0x12a')](db[_0x9d7a('0xeb')],{'through':_0x9d7a('0x1e4'),'as':'Teams'});db[_0x9d7a('0x114')][_0x9d7a('0x128')](db['User'],{'as':_0x9d7a('0x20f'),'foreignKey':_0x9d7a('0x118'),'onDelete':'cascade','hooks':!![]});db[_0x9d7a('0x10d')][_0x9d7a('0x116')](db['Dynamics365Account'],{'as':_0x9d7a('0xcb'),'onDelete':'restrict'});db[_0x9d7a('0x10d')][_0x9d7a('0x116')](db['MailServerIn'],{'as':_0x9d7a('0x16e'),'onDelete':_0x9d7a('0x16b')});db[_0x9d7a('0x10d')][_0x9d7a('0x116')](db['MailServerOut'],{'as':_0x9d7a('0x16f'),'onDelete':_0x9d7a('0x16b')});module[_0x9d7a('0x210')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8ec0ba3..ad0e8b4 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9c7=['./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/cmContactHasItem','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./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/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authActiveDirectory','/api/rpc','./api/rpc','./api/version','./api/system','/api/pm2','/api/webbar','/apidoc','static','join','/www','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','default','then','/api/users','use','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/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/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals'];(function(_0x23df26,_0x37c0e9){var _0x21a6fc=function(_0x30b976){while(--_0x30b976){_0x23df26['push'](_0x23df26['shift']());}};_0x21a6fc(++_0x37c0e9);}(_0xb9c7,0x19c));var _0x7b9c=function(_0x439f4c,_0x47891a){_0x439f4c=_0x439f4c-0x0;var _0x431d55=_0xb9c7[_0x439f4c];return _0x431d55;};'use strict';var path=require(_0x7b9c('0x0'));var express=require(_0x7b9c('0x1'));var errors=require(_0x7b9c('0x2'));var config=require(_0x7b9c('0x3'));var setupLoggers=require(_0x7b9c('0x4'))['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x7b9c('0x5')]=function(_0x5b071d){return setupLoggers(_0x5b071d)[_0x7b9c('0x6')](function(){_0x5b071d['use'](_0x7b9c('0x7'),require('./api/user'));_0x5b071d[_0x7b9c('0x8')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9'),require('./api/voiceContext'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xa'),require(_0x7b9c('0xb')));_0x5b071d['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc'),require(_0x7b9c('0xd')));_0x5b071d[_0x7b9c('0x8')]('/api/voice/recordings',require(_0x7b9c('0xe')));_0x5b071d['use'](_0x7b9c('0xf'),require('./api/screenRecording'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x10'),require(_0x7b9c('0x11')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x12'),require(_0x7b9c('0x13')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x14'),require('./api/voiceCallReport'));_0x5b071d[_0x7b9c('0x8')]('/api/voice/dials/reports',require(_0x7b9c('0x15')));_0x5b071d['use'](_0x7b9c('0x16'),require(_0x7b9c('0x17')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x18'),require(_0x7b9c('0x19')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x1a'),require(_0x7b9c('0x1b')));_0x5b071d['use'](_0x7b9c('0x1c'),require(_0x7b9c('0x1d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x1e'),require(_0x7b9c('0x1f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x20'),require('./api/mailServerOut'));_0x5b071d[_0x7b9c('0x8')]('/api/mail/accounts',require(_0x7b9c('0x21')));_0x5b071d[_0x7b9c('0x8')]('/api/mail/queues',require(_0x7b9c('0x22')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x23'),require(_0x7b9c('0x24')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x25'),require(_0x7b9c('0x26')));_0x5b071d[_0x7b9c('0x8')]('/api/mail/messages',require(_0x7b9c('0x27')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x28'),require('./api/mailApplication'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x29'),require(_0x7b9c('0x2a')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x2b'),require(_0x7b9c('0x2c')));_0x5b071d['use'](_0x7b9c('0x2d'),require(_0x7b9c('0x2e')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x2f'),require(_0x7b9c('0x30')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x31'),require(_0x7b9c('0x32')));_0x5b071d[_0x7b9c('0x8')]('/api/fax/interactions',require('./api/faxInteraction'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x33'),require(_0x7b9c('0x34')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x35'),require(_0x7b9c('0x36')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x37'),require(_0x7b9c('0x38')));_0x5b071d['use'](_0x7b9c('0x39'),require(_0x7b9c('0x3a')));_0x5b071d['use']('/api/sms/applications',require(_0x7b9c('0x3b')));_0x5b071d[_0x7b9c('0x8')]('/api/sms/interactions',require(_0x7b9c('0x3c')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x3d'),require(_0x7b9c('0x3e')));_0x5b071d['use'](_0x7b9c('0x3f'),require('./api/smsQueue'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x40'),require('./api/openchannelAccount'));_0x5b071d[_0x7b9c('0x8')]('/api/openchannel/applications',require(_0x7b9c('0x41')));_0x5b071d['use'](_0x7b9c('0x42'),require(_0x7b9c('0x43')));_0x5b071d['use'](_0x7b9c('0x44'),require('./api/openchannelMessage'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x45'),require(_0x7b9c('0x46')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x47'),require(_0x7b9c('0x48')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x49'),require('./api/openchannelQueueReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x4a'),require(_0x7b9c('0x4b')));_0x5b071d['use']('/api/chat/interactions',require(_0x7b9c('0x4c')));_0x5b071d['use']('/api/chat/messages',require(_0x7b9c('0x4d')));_0x5b071d['use'](_0x7b9c('0x4e'),require('./api/chatOfflineMessage'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x4f'),require('./api/chatQueue'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x50'),require('./api/chatGroup'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x51'),require(_0x7b9c('0x52')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x53'),require('./api/cmCompany'));_0x5b071d['use'](_0x7b9c('0x54'),require(_0x7b9c('0x55')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x56'),require('./api/cmHopper'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x57'),require('./api/cmHopperBlack'));_0x5b071d[_0x7b9c('0x8')]('/api/cm/hopper_final',require(_0x7b9c('0x58')));_0x5b071d['use']('/api/cm/hopper_history',require(_0x7b9c('0x59')));_0x5b071d['use']('/api/cm/custom_fields',require(_0x7b9c('0x5a')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x5b'),require('./api/action'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x5c'),require(_0x7b9c('0x5d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x5e'),require(_0x7b9c('0x5f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x60'),require('./api/disposition'));_0x5b071d['use'](_0x7b9c('0x61'),require(_0x7b9c('0x62')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x63'),require(_0x7b9c('0x64')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x65'),require('./api/pause'));_0x5b071d['use'](_0x7b9c('0x66'),require(_0x7b9c('0x67')));_0x5b071d['use'](_0x7b9c('0x68'),require(_0x7b9c('0x69')));_0x5b071d['use'](_0x7b9c('0x6a'),require(_0x7b9c('0x6b')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x6c'),require(_0x7b9c('0x6d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x6e'),require(_0x7b9c('0x6f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x70'),require('./api/contactItemType'));_0x5b071d['use']('/api/cm_contact_has_items',require(_0x7b9c('0x71')));_0x5b071d[_0x7b9c('0x8')]('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x5b071d['use']('/api/templates',require('./api/template'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x72'),require(_0x7b9c('0x73')));_0x5b071d['use'](_0x7b9c('0x74'),require(_0x7b9c('0x75')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations',require(_0x7b9c('0x76')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x77'),require(_0x7b9c('0x78')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x79'),require(_0x7b9c('0x7a')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x7b'),require('./api/analyticDefaultReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x7c'),require(_0x7b9c('0x7d')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x7e'),require(_0x7b9c('0x7f')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x80'),require(_0x7b9c('0x81')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x82'),require(_0x7b9c('0x83')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/salesforce/accounts',require(_0x7b9c('0x84')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x85'),require('./api/intSalesforceConfiguration'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x86'),require(_0x7b9c('0x87')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x7b9c('0x88')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x89'),require(_0x7b9c('0x8a')));_0x5b071d['use'](_0x7b9c('0x8b'),require(_0x7b9c('0x8c')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x8d'),require(_0x7b9c('0x8e')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x8f'),require(_0x7b9c('0x90')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x91'),require(_0x7b9c('0x92')));_0x5b071d['use'](_0x7b9c('0x93'),require('./api/intZohoAccount'));_0x5b071d['use'](_0x7b9c('0x94'),require(_0x7b9c('0x95')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/zoho/fields',require(_0x7b9c('0x96')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/zendesk/accounts',require(_0x7b9c('0x97')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x98'),require(_0x7b9c('0x99')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9a'),require(_0x7b9c('0x9b')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/freshdesk/accounts',require(_0x7b9c('0x9c')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9d'),require('./api/intFreshdeskConfiguration'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9e'),require('./api/intFreshdeskField'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0x9f'),require(_0x7b9c('0xa0')));_0x5b071d['use']('/api/integrations/vtiger/configurations',require(_0x7b9c('0xa1')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xa2'),require(_0x7b9c('0xa3')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/servicenow/accounts',require(_0x7b9c('0xa4')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/servicenow/configurations',require(_0x7b9c('0xa5')));_0x5b071d['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x5b071d['use'](_0x7b9c('0xa6'),require(_0x7b9c('0xa7')));_0x5b071d[_0x7b9c('0x8')]('/api/integrations/dynamics365/configurations',require(_0x7b9c('0xa8')));_0x5b071d['use'](_0x7b9c('0xa9'),require(_0x7b9c('0xaa')));_0x5b071d['use'](_0x7b9c('0xab'),require('./api/intFreshsalesAccount'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xac'),require('./api/intFreshsalesConfiguration'));_0x5b071d['use']('/api/integrations/freshsales/fields',require(_0x7b9c('0xad')));_0x5b071d[_0x7b9c('0x8')]('/api/networks',require('./api/network'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xae'),require(_0x7b9c('0xaf')));_0x5b071d[_0x7b9c('0x8')]('/api/chat/internal/messages',require(_0x7b9c('0xb0')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xb1'),require(_0x7b9c('0xb2')));_0x5b071d[_0x7b9c('0x8')]('/api/jscripty/questions/reports',require(_0x7b9c('0xb3')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xb4'),require(_0x7b9c('0xb5')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xb6'),require(_0x7b9c('0xb7')));_0x5b071d[_0x7b9c('0x8')]('/api/square/reports',require(_0x7b9c('0xb8')));_0x5b071d[_0x7b9c('0x8')]('/api/square/details/reports',require(_0x7b9c('0xb9')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xba'),require(_0x7b9c('0xbb')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xbc'),require('./api/setting'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xbd'),require(_0x7b9c('0xbe')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xbf'),require(_0x7b9c('0xc0')));_0x5b071d[_0x7b9c('0x8')]('/api/square/recordings',require(_0x7b9c('0xc1')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc2'),require('./api/squareMessage'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc3'),require(_0x7b9c('0xc4')));_0x5b071d[_0x7b9c('0x8')]('/api/license',require('./api/license'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc5'),require(_0x7b9c('0xc6')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc7'),require(_0x7b9c('0xc8')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xc9'),require(_0x7b9c('0xca')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xcb'),require('./api/plugin'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xcc'),require(_0x7b9c('0xcd')));_0x5b071d['use'](_0x7b9c('0xce'),require('./api/chatTransferReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xcf'),require(_0x7b9c('0xd0')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd1'),require('./api/openchannelTransferReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd2'),require(_0x7b9c('0xd3')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd4'),require('./api/cmList'));_0x5b071d['use']('/api/voice/prefixes',require(_0x7b9c('0xd5')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xd6'),require(_0x7b9c('0xd7')));_0x5b071d['use'](_0x7b9c('0xd8'),require('./api/userProfileSection'));_0x5b071d[_0x7b9c('0x8')]('/api/userProfile/resources',require(_0x7b9c('0xd9')));_0x5b071d['use'](_0x7b9c('0xda'),require('./api/userNotification'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xdb'),require('./api/whatsappAccount'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xdc'),require('./api/whatsappApplication'));_0x5b071d[_0x7b9c('0x8')]('/api/whatsapp/interactions',require(_0x7b9c('0xdd')));_0x5b071d['use']('/api/whatsapp/messages',require(_0x7b9c('0xde')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xdf'),require(_0x7b9c('0xe0')));_0x5b071d[_0x7b9c('0x8')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xe1'),require(_0x7b9c('0xe2')));_0x5b071d['use']('/api/cloudProviders',require(_0x7b9c('0xe3')));_0x5b071d[_0x7b9c('0x8')]('/api/realtime',require(_0x7b9c('0xe4')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xe5'),require(_0x7b9c('0xe6')));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xe7'),require('./api/authLocal'));_0x5b071d[_0x7b9c('0x8')]('/api/auth/google',require('./api/authGoogle'));_0x5b071d[_0x7b9c('0x8')]('/api/auth/activedirectory',require(_0x7b9c('0xe8')));_0x5b071d[_0x7b9c('0x8')]('/api/jira',require('./api/jira'));_0x5b071d['use'](_0x7b9c('0xe9'),require(_0x7b9c('0xea')));_0x5b071d['use']('/api/version',require(_0x7b9c('0xeb')));_0x5b071d[_0x7b9c('0x8')]('/api/system',require(_0x7b9c('0xec')));_0x5b071d['use'](_0x7b9c('0xed'),require('./api/pm2'));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xee'),require('./api/webbar'));_0x5b071d[_0x7b9c('0x8')]('/api/logs',clientSideLogs);_0x5b071d['use'](_0x7b9c('0xef'),express[_0x7b9c('0xf0')](path[_0x7b9c('0xf1')](config['root'],_0x7b9c('0xef'))));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xf2'),express['static'](path[_0x7b9c('0xf1')](config[_0x7b9c('0xf3')],_0x7b9c('0xf2'))));_0x5b071d['use'](_0x7b9c('0xf4'),express['static'](path[_0x7b9c('0xf1')](config['root'],_0x7b9c('0xf4'))));_0x5b071d[_0x7b9c('0x8')](_0x7b9c('0xf5'),express[_0x7b9c('0xf0')](path[_0x7b9c('0xf1')](config[_0x7b9c('0xf3')],_0x7b9c('0xf6'),_0x7b9c('0xf7'))));_0x5b071d['use'](_0x7b9c('0xf8'),express[_0x7b9c('0xf0')](path[_0x7b9c('0xf1')](config[_0x7b9c('0xf3')],_0x7b9c('0xf9'))));_0x5b071d[_0x7b9c('0xfa')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x7b9c('0xfb')](errors[0x194]);_0x5b071d[_0x7b9c('0xfa')]('/*')['get'](function(_0x414c7d,_0x1ba434){_0x1ba434[_0x7b9c('0xfc')](path[_0x7b9c('0xfd')](_0x5b071d[_0x7b9c('0xfb')](_0x7b9c('0xfe'))+_0x7b9c('0xff')));});return _0x5b071d;});}; \ No newline at end of file +var _0x90cf=['./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatProactiveAction','./api/cmContact','/api/cm/hopper','./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/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','./api/trigger','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/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/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','/api/system','./api/pm2','/api/webbar','/apidoc','join','root','/www','static','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','path','express','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','./api/user','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x90cf,0xca));var _0xf90c=function(_0x4204fc,_0x3b62aa){_0x4204fc=_0x4204fc-0x0;var _0x1c3ca3=_0x90cf[_0x4204fc];return _0x1c3ca3;};'use strict';var path=require(_0xf90c('0x0'));var express=require(_0xf90c('0x1'));var errors=require('./errors');var config=require(_0xf90c('0x2'));var setupLoggers=require(_0xf90c('0x3'))[_0xf90c('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0xf90c('0x5')]=function(_0x30ee21){return setupLoggers(_0x30ee21)[_0xf90c('0x6')](function(){_0x30ee21[_0xf90c('0x7')](_0xf90c('0x8'),require(_0xf90c('0x9')));_0x30ee21[_0xf90c('0x7')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xa'),require(_0xf90c('0xb')));_0x30ee21['use']('/api/voice/extensions',require(_0xf90c('0xc')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xd'),require(_0xf90c('0xe')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xf'),require('./api/voiceQueue'));_0x30ee21['use'](_0xf90c('0x10'),require('./api/voiceRecording'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x11'),require(_0xf90c('0x12')));_0x30ee21['use'](_0xf90c('0x13'),require(_0xf90c('0x14')));_0x30ee21['use']('/api/voice/mails/messages',require(_0xf90c('0x15')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x16'),require('./api/voiceCallReport'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x17'),require(_0xf90c('0x18')));_0x30ee21['use'](_0xf90c('0x19'),require(_0xf90c('0x1a')));_0x30ee21['use'](_0xf90c('0x1b'),require('./api/voiceQueueReport'));_0x30ee21['use'](_0xf90c('0x1c'),require(_0xf90c('0x1d')));_0x30ee21['use']('/api/trunks',require(_0xf90c('0x1e')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x1f'),require(_0xf90c('0x20')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x21'),require(_0xf90c('0x22')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x23'),require('./api/mailAccount'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x24'),require('./api/mailQueue'));_0x30ee21[_0xf90c('0x7')]('/api/mail/substatuses',require(_0xf90c('0x25')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x26'),require(_0xf90c('0x27')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x28'),require(_0xf90c('0x29')));_0x30ee21[_0xf90c('0x7')]('/api/mail/applications',require(_0xf90c('0x2a')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x2b'),require(_0xf90c('0x2c')));_0x30ee21[_0xf90c('0x7')]('/api/dashboards',require(_0xf90c('0x2d')));_0x30ee21[_0xf90c('0x7')]('/api/dashboards/items',require(_0xf90c('0x2e')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x2f'),require('./api/faxAccount'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x30'),require('./api/faxApplication'));_0x30ee21['use'](_0xf90c('0x31'),require('./api/faxInteraction'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x32'),require(_0xf90c('0x33')));_0x30ee21[_0xf90c('0x7')]('/api/fax/queues',require(_0xf90c('0x34')));_0x30ee21[_0xf90c('0x7')]('/api/fax/reports/queue',require(_0xf90c('0x35')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x36'),require(_0xf90c('0x37')));_0x30ee21['use']('/api/sms/applications',require(_0xf90c('0x38')));_0x30ee21[_0xf90c('0x7')]('/api/sms/interactions',require(_0xf90c('0x39')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x3a'),require(_0xf90c('0x3b')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x3c'),require(_0xf90c('0x3d')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x3e'),require(_0xf90c('0x3f')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x40'),require(_0xf90c('0x41')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x42'),require(_0xf90c('0x43')));_0x30ee21['use']('/api/openchannel/messages',require(_0xf90c('0x44')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x45'),require(_0xf90c('0x46')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x47'),require(_0xf90c('0x48')));_0x30ee21[_0xf90c('0x7')]('/api/openchannel/reports/queue',require(_0xf90c('0x49')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x4a'),require(_0xf90c('0x4b')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x4c'),require(_0xf90c('0x4d')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x4e'),require(_0xf90c('0x4f')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x50'),require(_0xf90c('0x51')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x52'),require('./api/chatQueue'));_0x30ee21[_0xf90c('0x7')]('/api/chat/groups',require('./api/chatGroup'));_0x30ee21[_0xf90c('0x7')]('/api/chat/proactive_actions',require(_0xf90c('0x53')));_0x30ee21[_0xf90c('0x7')]('/api/cm/companies',require('./api/cmCompany'));_0x30ee21['use']('/api/cm/contacts',require(_0xf90c('0x54')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x55'),require(_0xf90c('0x56')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x57'),require(_0xf90c('0x58')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x59'),require(_0xf90c('0x5a')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x5b'),require(_0xf90c('0x5c')));_0x30ee21['use'](_0xf90c('0x5d'),require(_0xf90c('0x5e')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x5f'),require(_0xf90c('0x60')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x61'),require(_0xf90c('0x62')));_0x30ee21['use'](_0xf90c('0x63'),require('./api/cannedAnswer'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x64'),require('./api/disposition'));_0x30ee21['use'](_0xf90c('0x65'),require('./api/condition'));_0x30ee21['use'](_0xf90c('0x66'),require(_0xf90c('0x67')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x68'),require(_0xf90c('0x69')));_0x30ee21['use'](_0xf90c('0x6a'),require(_0xf90c('0x6b')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x6c'),require('./api/voiceQueuesLog'));_0x30ee21['use'](_0xf90c('0x6d'),require(_0xf90c('0x6e')));_0x30ee21[_0xf90c('0x7')]('/api/sounds',require(_0xf90c('0x6f')));_0x30ee21['use'](_0xf90c('0x70'),require('./api/tag'));_0x30ee21[_0xf90c('0x7')]('/api/contact_item_types',require(_0xf90c('0x71')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x72'),require(_0xf90c('0x73')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x74'),require(_0xf90c('0x75')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x76'),require('./api/template'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x77'),require(_0xf90c('0x78')));_0x30ee21[_0xf90c('0x7')]('/api/variables',require(_0xf90c('0x79')));_0x30ee21[_0xf90c('0x7')]('/api/integrations',require(_0xf90c('0x7a')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x7b'),require(_0xf90c('0x7c')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x7d'),require(_0xf90c('0x7e')));_0x30ee21[_0xf90c('0x7')]('/api/analytics/default_reports',require(_0xf90c('0x7f')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x80'),require(_0xf90c('0x81')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x82'),require('./api/analyticMetric'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x83'),require('./api/analyticFieldReport'));_0x30ee21['use'](_0xf90c('0x84'),require('./api/analyticTreeReport'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x85'),require(_0xf90c('0x86')));_0x30ee21['use'](_0xf90c('0x87'),require(_0xf90c('0x88')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x89'),require(_0xf90c('0x8a')));_0x30ee21['use'](_0xf90c('0x8b'),require(_0xf90c('0x8c')));_0x30ee21['use']('/api/integrations/sugarcrm/configurations',require(_0xf90c('0x8d')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x8e'),require(_0xf90c('0x8f')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x90'),require('./api/intDeskAccount'));_0x30ee21[_0xf90c('0x7')]('/api/integrations/desk/configurations',require(_0xf90c('0x91')));_0x30ee21['use']('/api/integrations/desk/fields',require('./api/intDeskField'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x92'),require(_0xf90c('0x93')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x94'),require(_0xf90c('0x95')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x96'),require(_0xf90c('0x97')));_0x30ee21[_0xf90c('0x7')]('/api/integrations/zendesk/accounts',require(_0xf90c('0x98')));_0x30ee21[_0xf90c('0x7')]('/api/integrations/zendesk/configurations',require(_0xf90c('0x99')));_0x30ee21['use'](_0xf90c('0x9a'),require(_0xf90c('0x9b')));_0x30ee21[_0xf90c('0x7')]('/api/integrations/freshdesk/accounts',require(_0xf90c('0x9c')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x9d'),require('./api/intFreshdeskConfiguration'));_0x30ee21['use'](_0xf90c('0x9e'),require('./api/intFreshdeskField'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x9f'),require('./api/intVtigerAccount'));_0x30ee21[_0xf90c('0x7')]('/api/integrations/vtiger/configurations',require(_0xf90c('0xa0')));_0x30ee21['use'](_0xf90c('0xa1'),require(_0xf90c('0xa2')));_0x30ee21[_0xf90c('0x7')]('/api/integrations/servicenow/accounts',require(_0xf90c('0xa3')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xa4'),require(_0xf90c('0xa5')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xa6'),require(_0xf90c('0xa7')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xa8'),require(_0xf90c('0xa9')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xaa'),require(_0xf90c('0xab')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xac'),require(_0xf90c('0xad')));_0x30ee21[_0xf90c('0x7')]('/api/integrations/freshsales/accounts',require(_0xf90c('0xae')));_0x30ee21['use'](_0xf90c('0xaf'),require(_0xf90c('0xb0')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xb1'),require(_0xf90c('0xb2')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xb3'),require(_0xf90c('0xb4')));_0x30ee21[_0xf90c('0x7')]('/api/chat/reports/queue',require(_0xf90c('0xb5')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xb6'),require(_0xf90c('0xb7')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xb8'),require(_0xf90c('0xb9')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xba'),require(_0xf90c('0xbb')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xbc'),require(_0xf90c('0xbd')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xbe'),require('./api/smsQueueReport'));_0x30ee21['use'](_0xf90c('0xbf'),require('./api/squareReport'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xc0'),require(_0xf90c('0xc1')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xc2'),require(_0xf90c('0xc3')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xc4'),require('./api/setting'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xc5'),require('./api/squareOdbc'));_0x30ee21[_0xf90c('0x7')]('/api/square/projects',require(_0xf90c('0xc6')));_0x30ee21['use'](_0xf90c('0xc7'),require(_0xf90c('0xc8')));_0x30ee21[_0xf90c('0x7')]('/api/square/messages',require(_0xf90c('0xc9')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xca'),require(_0xf90c('0xcb')));_0x30ee21['use'](_0xf90c('0xcc'),require(_0xf90c('0xcd')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xce'),require(_0xf90c('0xcf')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xd0'),require('./api/migration'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xd1'),require(_0xf90c('0xd2')));_0x30ee21['use']('/api/plugins',require(_0xf90c('0xd3')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xd4'),require(_0xf90c('0xd5')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xd6'),require(_0xf90c('0xd7')));_0x30ee21['use'](_0xf90c('0xd8'),require(_0xf90c('0xd9')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xda'),require(_0xf90c('0xdb')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xdc'),require('./api/smsTransferReport'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xdd'),require(_0xf90c('0xde')));_0x30ee21['use'](_0xf90c('0xdf'),require(_0xf90c('0xe0')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xe1'),require(_0xf90c('0xe2')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xe3'),require(_0xf90c('0xe4')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xe5'),require(_0xf90c('0xe6')));_0x30ee21['use'](_0xf90c('0xe7'),require(_0xf90c('0xe8')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xe9'),require(_0xf90c('0xea')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xeb'),require(_0xf90c('0xec')));_0x30ee21[_0xf90c('0x7')]('/api/whatsapp/interactions',require(_0xf90c('0xed')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xee'),require(_0xf90c('0xef')));_0x30ee21['use'](_0xf90c('0xf0'),require('./api/whatsappQueueReport'));_0x30ee21['use'](_0xf90c('0xf1'),require(_0xf90c('0xf2')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xf3'),require(_0xf90c('0xf4')));_0x30ee21['use']('/api/cloudProviders',require(_0xf90c('0xf5')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xf6'),require(_0xf90c('0xf7')));_0x30ee21['use'](_0xf90c('0xf8'),require('./api/user-setting'));_0x30ee21['use'](_0xf90c('0xf9'),require('./api/authLocal'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xfa'),require(_0xf90c('0xfb')));_0x30ee21['use']('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xfc'),require('./api/jira'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xfd'),require('./api/rpc'));_0x30ee21[_0xf90c('0x7')]('/api/version',require('./api/version'));_0x30ee21[_0xf90c('0x7')](_0xf90c('0xfe'),require('./api/system'));_0x30ee21[_0xf90c('0x7')]('/api/pm2',require(_0xf90c('0xff')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x100'),require('./api/webbar'));_0x30ee21['use']('/api/logs',clientSideLogs);_0x30ee21['use'](_0xf90c('0x101'),express['static'](path[_0xf90c('0x102')](config[_0xf90c('0x103')],'/apidoc')));_0x30ee21[_0xf90c('0x7')](_0xf90c('0x104'),express[_0xf90c('0x105')](path[_0xf90c('0x102')](config[_0xf90c('0x103')],_0xf90c('0x104'))));_0x30ee21[_0xf90c('0x7')]('/demo',express['static'](path['join'](config[_0xf90c('0x103')],'/demo')));_0x30ee21[_0xf90c('0x7')]('/snippet',express[_0xf90c('0x105')](path[_0xf90c('0x102')](config[_0xf90c('0x103')],_0xf90c('0x106'),'3.0.0')));_0x30ee21['use'](_0xf90c('0x107'),express[_0xf90c('0x105')](path[_0xf90c('0x102')](config[_0xf90c('0x103')],_0xf90c('0x108'))));_0x30ee21[_0xf90c('0x109')](_0xf90c('0x10a'))[_0xf90c('0x10b')](errors[0x194]);_0x30ee21[_0xf90c('0x109')]('/*')[_0xf90c('0x10b')](function(_0x10c178,_0x1ec4e1){_0x1ec4e1['sendFile'](path[_0xf90c('0x10c')](_0x30ee21['get'](_0xf90c('0x10d'))+'/index.html'));});return _0x30ee21;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 779ca10..a65b77a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb815=['../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/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/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/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','rpc','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/user/user.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/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb815,0x160));var _0x5b81=function(_0x2e1810,_0x38e361){_0x2e1810=_0x2e1810-0x0;var _0x80139f=_0xb815[_0x2e1810];return _0x80139f;};'use strict';var jayson=require(_0x5b81('0x0'));var _=require(_0x5b81('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x2ec5d4,_0x5ae6ff){var _0x3cab0b={};_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/voiceExtension/voiceExtension.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x4')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x5')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x6')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x7')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x8')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x9')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/memberReport/memberReport.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xa')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0xb')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xc')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0xd')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xe')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0xf')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x10')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x11')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x12')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x13')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x14')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x15')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x16')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x17')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x18')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x19')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x1a')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x1b')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1c')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1d')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1e')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x1f')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x20')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x21')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x22')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/chatInteraction/chatInteraction.rpc'));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x23')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x24')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x25')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x26')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x27')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x28')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x29')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x2a')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2b')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2c')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2d')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2e')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x2f')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x30')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x31')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x32')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x33')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x34')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x35')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x36')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x37')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x38')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x39')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3a')));_0x3cab0b=_['merge'](_0x3cab0b,require(_0x5b81('0x3b')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3c')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3d')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3e')));_0x3cab0b=_['merge'](_0x3cab0b,require('../api/attachment/attachment.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x3f')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x40')));_0x3cab0b=_['merge'](_0x3cab0b,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x41')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require(_0x5b81('0x42')));_0x3cab0b=_[_0x5b81('0x2')](_0x3cab0b,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x301280=jayson[_0x5b81('0x43')](_0x3cab0b)['http']();var _0x486035=config['rpc']['port']||config['port']+0x1;var _0x8e449c=config[_0x5b81('0x44')]['ip']||'localhost';_0x301280['on']('error',function(_0x367ee9){return _0x5ae6ff(_0x367ee9);});_0x301280[_0x5b81('0x45')](_0x486035,_0x8e449c,function(){console['log'](_0x5b81('0x46'),_0x8e449c,_0x486035);require(_0x5b81('0x47'))['default']();return _0x2ec5d4(_0x5b81('0x48')+_0x8e449c+':'+_0x486035);});});}; \ No newline at end of file +var _0x3831=['../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../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/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','rpc','port','localhost','error','../config/triggers','default','jayson/promise','../config/environment','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','merge'];(function(_0x69ea92,_0x14506b){var _0x45b8ea=function(_0x2a33c0){while(--_0x2a33c0){_0x69ea92['push'](_0x69ea92['shift']());}};_0x45b8ea(++_0x14506b);}(_0x3831,0x14c));var _0x1383=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3831[_0x4ff09b];return _0x3f5c2e;};'use strict';var jayson=require(_0x1383('0x0'));var _=require('lodash');var config=require(_0x1383('0x1'));exports[_0x1383('0x2')]=function(){return new Promise(function(_0x3a25fd,_0x15e6b5){var _0x391bef={};_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x3')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x4')));_0x391bef=_['merge'](_0x391bef,require('../api/voiceQueue/voiceQueue.rpc'));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x5')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x6')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x8')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x9')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0xa')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/memberReport/memberReport.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0xb')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0xc')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0xd')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/mailAccount/mailAccount.rpc'));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0xe')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0xf')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x10')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x11')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x12')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x13')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x14')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/faxMessage/faxMessage.rpc'));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x15')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x16')));_0x391bef=_['merge'](_0x391bef,require('../api/smsAccount/smsAccount.rpc'));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x17')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x18')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x19')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x1a')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x1b')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x1c')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x1d')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x1e')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x1f')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x20')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x21')));_0x391bef=_['merge'](_0x391bef,require('../api/cmContact/cmContact.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x22')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x23')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x391bef=_['merge'](_0x391bef,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x24')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x25')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x26')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x27')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x28')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x29')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x2a')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x2b')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x2c')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x2d')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x2e')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x2f')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x30')));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x31')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x32')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x33')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x34')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x35')));_0x391bef=_['merge'](_0x391bef,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x391bef=_['merge'](_0x391bef,require(_0x1383('0x36')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x37')));_0x391bef=_['merge'](_0x391bef,require('../api/squareProject/squareProject.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x38')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x39')));_0x391bef=_['merge'](_0x391bef,require('../api/campaign/campaign.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x3a')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x3b')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x3c')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x391bef=_[_0x1383('0x7')](_0x391bef,require(_0x1383('0x3d')));_0x391bef=_[_0x1383('0x7')](_0x391bef,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x277689=jayson['server'](_0x391bef)['http']();var _0x1ff9ab=config[_0x1383('0x3e')][_0x1383('0x3f')]||config['port']+0x1;var _0xe55c3e=config[_0x1383('0x3e')]['ip']||_0x1383('0x40');_0x277689['on'](_0x1383('0x41'),function(_0x56c269){return _0x15e6b5(_0x56c269);});_0x277689[_0x1383('0x2')](_0x1ff9ab,_0xe55c3e,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0xe55c3e,_0x1ff9ab);require(_0x1383('0x42'))[_0x1383('0x43')]();return _0x3a25fd('RPC\x20listening\x20on\x20'+_0xe55c3e+':'+_0x1ff9ab);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index ff59f11..d0eb759 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 _0x09b7=['./reply','./error','call','setEncoding','utf8','headers','emit','hangup','substring','search','520\x20End\x20of\x20proper','replace','substr','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','sendRequest','command','ANSWER','prototype','getData','beep','format','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter'];(function(_0x26ab19,_0xc94520){var _0x13bf7b=function(_0x2310d8){while(--_0x2310d8){_0x26ab19['push'](_0x26ab19['shift']());}};_0x13bf7b(++_0xc94520);}(_0x09b7,0x121));var _0x709b=function(_0x2f6c3e,_0x579279){_0x2f6c3e=_0x2f6c3e-0x0;var _0x5bd3b0=_0x09b7[_0x2f6c3e];return _0x5bd3b0;};'use strict';var util=require(_0x709b('0x0'));var _=require('lodash');var EventEmitter=require(_0x709b('0x1'))[_0x709b('0x2')];var AGIReply=require(_0x709b('0x3'));var AGIError=require(_0x709b('0x4'));function AGIChannel(_0x24418a){var _0x5041e4=this,_0x1f84dd=new AGIReply(),_0xff2fd7=![],_0x2fc4e2={};EventEmitter[_0x709b('0x5')](_0x5041e4);_0x24418a['setEncoding']('utf8');_0x24418a['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1f84dd[_0x709b('0x6')](_0x709b('0x7'));_0x1f84dd['on'](_0x709b('0x8'),function(_0x14b0b9){for(var _0xb67fd9 in _0x14b0b9){_0x5041e4[_0xb67fd9]=_0x14b0b9[_0xb67fd9];}_0x5041e4[_0x709b('0x9')]('ready');});_0x1f84dd['on']('line',function(_0x609904){if(_0x609904['toLowerCase']()==_0x709b('0xa')){_0x5041e4[_0x709b('0x9')](_0x709b('0xa'));return;}if(_0x609904[_0x709b('0xb')](0x0,0xb)=='520-Invalid'){_0xff2fd7=!![];}if(_0xff2fd7){_0x2fc4e2['rx']+=_0x609904+'\x0a';if(_0x609904[_0x709b('0xc')](_0x709b('0xd'))!=-0x1){_0xff2fd7=![];}}else{_0x2fc4e2['rx']=_0x609904;}if(_0xff2fd7){return;}if(typeof _0x2fc4e2['cb']=='function'){var _0x1dbf71=_0x2fc4e2['rx'][_0x709b('0xb')](0x0,0x3),_0x352f32=null,_0x164173=null;_0x1dbf71=parseInt(_0x1dbf71);if(isNaN(_0x1dbf71)){_0x2fc4e2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1dbf71!=0xc8){_0x2fc4e2['cb'](null,{'code':_0x1dbf71,'result':-0x1,'extra':'KO'});return;}_0x352f32=_0x2fc4e2['rx'][_0x709b('0xb')](0x4)[_0x709b('0xe')]('result=','');if(_0x352f32['indexOf']('\x20')!=-0x1){_0x352f32=_0x352f32[_0x709b('0xf')](0x0,_0x352f32[_0x709b('0x10')]('\x20'));}if(_['startsWith'](_0x352f32,'-1')){_0x352f32=parseInt(_0x352f32);}_0x164173=_0x2fc4e2['rx'][_0x709b('0x11')]('\x20');if(_0x164173[_0x709b('0x12')]==0x3){_0x164173=_0x164173[0x2]['substring'](0x1,_0x164173[0x2][_0x709b('0x12')]-0x1);}else if(_0x164173[_0x709b('0x12')]>0x3){var _0x6dacbe=/\((.+)\)/;var _0x451096=_0x2fc4e2['rx'][_0x709b('0x13')](_0x6dacbe);if(_0x451096){_0x164173=_0x451096[0x1];}else{_0x164173=null;}}else{_0x164173=null;}_0x2fc4e2['cb'](null,{'code':_0x1dbf71,'result':_0x352f32,'extra':_0x164173});}});_0x24418a['on'](_0x709b('0x14'),function(_0x157306){_0x5041e4[_0x709b('0x9')]('error',new AGIError(_0x709b('0x15'),_0x157306[_0x709b('0x16')]));});_0x24418a['on'](_0x709b('0x17'),function(){_0x5041e4[_0x709b('0x9')](_0x709b('0x17'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x24418a['on'](_0x709b('0x18'),function(){_0x5041e4[_0x709b('0x9')](_0x709b('0x18'),new AGIError(_0x709b('0x19')));_0x24418a[_0x709b('0x1a')]();});_0x24418a[_0x709b('0x1b')](_0x1f84dd);this['command']=function(_0x301951,_0x2a4269){var _0x301951=_0x301951||'',_0x2a4269=typeof _0x2a4269==_0x709b('0x1c')?_0x2a4269:new Function();_0x2fc4e2={'tx':_0x301951,'rx':'','cb':_0x2a4269};_0x24418a[_0x709b('0x1d')](_0x301951+'\x0a');},this[_0x709b('0x17')]=function(){_0x24418a['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x709b('0x1e')]=function(_0x3c5ea0){return this[_0x709b('0x1f')]['sync'](this,_0x3c5ea0);};AGIChannel['prototype']['answer']=function(){return this[_0x709b('0x1e')](_0x709b('0x20'));};AGIChannel[_0x709b('0x21')][_0x709b('0x22')]=function(_0x392519,_0x482cea,_0x126880){_0x392519=_0x392519===undefined?_0x709b('0x23'):_0x392519;_0x482cea=_0x482cea===undefined?'5':_0x482cea;_0x126880=_0x126880===undefined?'1':_0x126880;return this[_0x709b('0x1e')](util[_0x709b('0x24')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x392519,_0x482cea*0x3e8,_0x126880));};AGIChannel[_0x709b('0x21')]['noop']=function(_0x2ceebd){_0x2ceebd=_0x2ceebd||_0x709b('0x25');return this[_0x709b('0x1e')](util[_0x709b('0x24')]('VERBOSE\x20\x22%s\x22',_0x2ceebd));};AGIChannel[_0x709b('0x21')]['exec']=function(_0x2acdad,_0x5d11a7){if(_[_0x709b('0x26')](_0x5d11a7)){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x27'),_0x2acdad,_0x5d11a7[_0x709b('0x28')](',')));}return this['sendRequest'](util[_0x709b('0x24')]('EXEC\x20%s\x20%s',_0x2acdad,_0x5d11a7));};AGIChannel['prototype']['setContext']=function(_0x37c741){return this['sendRequest'](util['format'](_0x709b('0x29'),_0x37c741));};AGIChannel[_0x709b('0x21')][_0x709b('0x2a')]=function(_0x5a327f){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x2b'),_0x5a327f));};AGIChannel[_0x709b('0x21')][_0x709b('0x2c')]=function(_0x59d1a3){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x2d'),_0x59d1a3));};AGIChannel[_0x709b('0x21')]['hangup']=function(){return this[_0x709b('0x1e')]('HANGUP');};AGIChannel[_0x709b('0x21')][_0x709b('0x2e')]=function(_0x48cd6e,_0x20d68c){var _0x1c2f1e=_[_0x709b('0x2f')](_0x20d68c)||_['isNumber'](_0x20d68c)?_0x20d68c['toString']():_0x20d68c;return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x30'),_0x48cd6e,_0x1c2f1e?_0x1c2f1e[_0x709b('0x31')]()[_0x709b('0xe')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x709b('0x21')][_0x709b('0x32')]=function(_0x4516c4,_0x515afa){return this[_0x709b('0x1e')](util['format'](_0x709b('0x33'),_0x4516c4,_0x515afa));};AGIChannel[_0x709b('0x21')][_0x709b('0x34')]=function(_0x10bde1,_0x5b9388){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x35'),_0x10bde1,_0x5b9388));};AGIChannel['prototype'][_0x709b('0x36')]=function(_0x3726e1,_0x4a5fb4){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x37'),_0x3726e1,_0x4a5fb4));};AGIChannel[_0x709b('0x21')][_0x709b('0x38')]=function(_0x120a8d,_0x4b0300,_0x3bd059){_0x4b0300=_0x4b0300||this[_0x709b('0x39')];_0x3bd059=_0x3bd059||0x1;this['setContext'](_0x120a8d);this[_0x709b('0x2a')](_0x4b0300);this[_0x709b('0x2c')](_0x3bd059);return this[_0x709b('0x3a')](util[_0x709b('0x24')](_0x709b('0x3b'),_0x120a8d,_0x4b0300,_0x3bd059));};AGIChannel[_0x709b('0x21')]['getVariable']=function(_0x167c3c){return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x3c'),_0x167c3c));};AGIChannel[_0x709b('0x21')][_0x709b('0x3d')]=function(_0xe60291,_0x119e51,_0x2f530a,_0x4b9a71,_0x1f4fc1,_0xbdf0df){_0x119e51=_0x119e51||_0x709b('0x3e');_0x2f530a=_0x2f530a||'';_0x4b9a71=_0x4b9a71===undefined?-0x1:_0x4b9a71==='-1'?-0x1:_0x4b9a71*0x3e8;_0x1f4fc1=_0x1f4fc1===undefined?'':'s='+_0x1f4fc1;_0xbdf0df=_0xbdf0df?'BEEP':'';return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x3f'),_0xe60291,_0x119e51,_0x2f530a,_0x4b9a71,_0xbdf0df,_0x1f4fc1));};AGIChannel[_0x709b('0x21')][_0x709b('0x40')]=function(_0x12d703,_0x49e86f){_0x49e86f=_0x49e86f||'';return this[_0x709b('0x1e')](util[_0x709b('0x24')](_0x709b('0x41'),_0x12d703,_0x49e86f));};AGIChannel[_0x709b('0x21')][_0x709b('0x42')]=function(_0x30f0d0){return this[_0x709b('0x43')](_0x709b('0x44'),_0x30f0d0);};AGIChannel['prototype'][_0x709b('0x45')]=function(_0x2c56eb){return this['exec']('WAIT',_0x2c56eb);};AGIChannel[_0x709b('0x21')][_0x709b('0x14')]=function(_0x19eda0,_0x5d3c51){this[_0x709b('0x3a')](util['format'](_0x709b('0x46'),_0x19eda0['id'],_0x19eda0[_0x709b('0x47')],_0x5d3c51));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x709b('0x48')]=AGIChannel; \ No newline at end of file +var _0xe382=['sendRequest','sync','answer','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','format','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','call','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','prototype'];(function(_0x204148,_0x2d30a4){var _0x35c982=function(_0x5cac91){while(--_0x5cac91){_0x204148['push'](_0x204148['shift']());}};_0x35c982(++_0x2d30a4);}(_0xe382,0x1b6));var _0x2e38=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xe382[_0x2faddb];return _0x273c05;};'use strict';var util=require('util');var _=require(_0x2e38('0x0'));var EventEmitter=require(_0x2e38('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x3d38f1){var _0x597e9a=this,_0x2a7110=new AGIReply(),_0xc068f0=![],_0x5e69dc={};EventEmitter[_0x2e38('0x2')](_0x597e9a);_0x3d38f1['setEncoding']('utf8');_0x3d38f1[_0x2e38('0x3')](0x8*0x3c*0x3c*0x3e8);_0x2a7110['setEncoding'](_0x2e38('0x4'));_0x2a7110['on'](_0x2e38('0x5'),function(_0x5ca553){for(var _0x5a4664 in _0x5ca553){_0x597e9a[_0x5a4664]=_0x5ca553[_0x5a4664];}_0x597e9a[_0x2e38('0x6')](_0x2e38('0x7'));});_0x2a7110['on'](_0x2e38('0x8'),function(_0x58344c){if(_0x58344c[_0x2e38('0x9')]()==_0x2e38('0xa')){_0x597e9a[_0x2e38('0x6')](_0x2e38('0xa'));return;}if(_0x58344c[_0x2e38('0xb')](0x0,0xb)==_0x2e38('0xc')){_0xc068f0=!![];}if(_0xc068f0){_0x5e69dc['rx']+=_0x58344c+'\x0a';if(_0x58344c['search'](_0x2e38('0xd'))!=-0x1){_0xc068f0=![];}}else{_0x5e69dc['rx']=_0x58344c;}if(_0xc068f0){return;}if(typeof _0x5e69dc['cb']==_0x2e38('0xe')){var _0x298f44=_0x5e69dc['rx'][_0x2e38('0xb')](0x0,0x3),_0x1d1d96=null,_0xf7d743=null;_0x298f44=parseInt(_0x298f44);if(isNaN(_0x298f44)){_0x5e69dc['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2e38('0xf')});return;}if(_0x298f44!=0xc8){_0x5e69dc['cb'](null,{'code':_0x298f44,'result':-0x1,'extra':'KO'});return;}_0x1d1d96=_0x5e69dc['rx']['substring'](0x4)[_0x2e38('0x10')](_0x2e38('0x11'),'');if(_0x1d1d96[_0x2e38('0x12')]('\x20')!=-0x1){_0x1d1d96=_0x1d1d96[_0x2e38('0x13')](0x0,_0x1d1d96[_0x2e38('0x12')]('\x20'));}if(_[_0x2e38('0x14')](_0x1d1d96,'-1')){_0x1d1d96=parseInt(_0x1d1d96);}_0xf7d743=_0x5e69dc['rx'][_0x2e38('0x15')]('\x20');if(_0xf7d743['length']==0x3){_0xf7d743=_0xf7d743[0x2][_0x2e38('0xb')](0x1,_0xf7d743[0x2][_0x2e38('0x16')]-0x1);}else if(_0xf7d743[_0x2e38('0x16')]>0x3){var _0x359ac0=/\((.+)\)/;var _0x406857=_0x5e69dc['rx'][_0x2e38('0x17')](_0x359ac0);if(_0x406857){_0xf7d743=_0x406857[0x1];}else{_0xf7d743=null;}}else{_0xf7d743=null;}_0x5e69dc['cb'](null,{'code':_0x298f44,'result':_0x1d1d96,'extra':_0xf7d743});}});_0x3d38f1['on'](_0x2e38('0x18'),function(_0x3ba62d){_0x597e9a[_0x2e38('0x6')]('error',new AGIError(_0x2e38('0x19'),_0x3ba62d['code']));});_0x3d38f1['on'](_0x2e38('0x1a'),function(){_0x597e9a[_0x2e38('0x6')]('close',new AGIError(_0x2e38('0x1b')));});_0x3d38f1['on'](_0x2e38('0x1c'),function(){_0x597e9a[_0x2e38('0x6')]('timeout',new AGIError(_0x2e38('0x1d')));_0x3d38f1['destroy']();});_0x3d38f1[_0x2e38('0x1e')](_0x2a7110);this[_0x2e38('0x1f')]=function(_0x5a6e18,_0xd84d02){var _0x5a6e18=_0x5a6e18||'',_0xd84d02=typeof _0xd84d02=='function'?_0xd84d02:new Function();_0x5e69dc={'tx':_0x5a6e18,'rx':'','cb':_0xd84d02};_0x3d38f1[_0x2e38('0x20')](_0x5a6e18+'\x0a');},this[_0x2e38('0x1a')]=function(){_0x3d38f1[_0x2e38('0x21')]();};}util[_0x2e38('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x2e38('0x23')][_0x2e38('0x24')]=function(_0x297176){return this[_0x2e38('0x1f')][_0x2e38('0x25')](this,_0x297176);};AGIChannel[_0x2e38('0x23')][_0x2e38('0x26')]=function(){return this[_0x2e38('0x24')]('ANSWER');};AGIChannel[_0x2e38('0x23')][_0x2e38('0x27')]=function(_0x4b8289,_0x57c541,_0x4abd3e){_0x4b8289=_0x4b8289===undefined?'beep':_0x4b8289;_0x57c541=_0x57c541===undefined?'5':_0x57c541;_0x4abd3e=_0x4abd3e===undefined?'1':_0x4abd3e;return this[_0x2e38('0x24')](util['format'](_0x2e38('0x28'),_0x4b8289,_0x57c541*0x3e8,_0x4abd3e));};AGIChannel['prototype'][_0x2e38('0x29')]=function(_0x531feb){_0x531feb=_0x531feb||'NO\x20MESSAGE';return this['sendRequest'](util['format'](_0x2e38('0x2a'),_0x531feb));};AGIChannel[_0x2e38('0x23')]['exec']=function(_0x5abe21,_0x575243){if(_[_0x2e38('0x2b')](_0x575243)){return this[_0x2e38('0x24')](util['format'](_0x2e38('0x2c'),_0x5abe21,_0x575243['join'](',')));}return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x2c'),_0x5abe21,_0x575243));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x2e')]=function(_0xdaed2f){return this['sendRequest'](util[_0x2e38('0x2d')](_0x2e38('0x2f'),_0xdaed2f));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x30')]=function(_0xf852d2){return this[_0x2e38('0x24')](util['format'](_0x2e38('0x31'),_0xf852d2));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x32')]=function(_0x252cb3){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x33'),_0x252cb3));};AGIChannel[_0x2e38('0x23')][_0x2e38('0xa')]=function(){return this['sendRequest'](_0x2e38('0x34'));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x35')]=function(_0xeed3e4,_0x5b090d){var _0x4f9cf7=_[_0x2e38('0x36')](_0x5b090d)||_[_0x2e38('0x37')](_0x5b090d)?_0x5b090d[_0x2e38('0x38')]():_0x5b090d;return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x39'),_0xeed3e4,_0x4f9cf7?_0x4f9cf7[_0x2e38('0x38')]()[_0x2e38('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x2e38('0x3a')]=function(_0x573050,_0x3c11b6){return this['sendRequest'](util['format'](_0x2e38('0x3b'),_0x573050,_0x3c11b6));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x3c')]=function(_0x320ce7,_0xaf06e6){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')]('SAY\x20DIGITS\x20%s\x20%s',_0x320ce7,_0xaf06e6));};AGIChannel['prototype']['sayPhonetic']=function(_0x32361b,_0x30a871){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x3d'),_0x32361b,_0x30a871));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x3e')]=function(_0x498f42,_0x24aeb3,_0x410226){_0x24aeb3=_0x24aeb3||this[_0x2e38('0x3f')];_0x410226=_0x410226||0x1;this[_0x2e38('0x2e')](_0x498f42);this['setExtension'](_0x24aeb3);this['setPriority'](_0x410226);return this['noop'](util[_0x2e38('0x2d')]('GOTO\x20%s\x20%s\x20%s',_0x498f42,_0x24aeb3,_0x410226));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x40')]=function(_0x2dd1f8){return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x41'),_0x2dd1f8));};AGIChannel[_0x2e38('0x23')]['recordFile']=function(_0x1b0187,_0x54087f,_0x251352,_0x5956e1,_0x331ffc,_0x4144e0){_0x54087f=_0x54087f||_0x2e38('0x42');_0x251352=_0x251352||'';_0x5956e1=_0x5956e1===undefined?-0x1:_0x5956e1==='-1'?-0x1:_0x5956e1*0x3e8;_0x331ffc=_0x331ffc===undefined?'':'s='+_0x331ffc;_0x4144e0=_0x4144e0?_0x2e38('0x43'):'';return this[_0x2e38('0x24')](util['format'](_0x2e38('0x44'),_0x1b0187,_0x54087f,_0x251352,_0x5956e1,_0x4144e0,_0x331ffc));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x45')]=function(_0x50abdc,_0x505a0e){_0x505a0e=_0x505a0e||'';return this[_0x2e38('0x24')](util[_0x2e38('0x2d')](_0x2e38('0x46'),_0x50abdc,_0x505a0e));};AGIChannel[_0x2e38('0x23')][_0x2e38('0x47')]=function(_0x39f59d){return this[_0x2e38('0x48')](_0x2e38('0x49'),_0x39f59d);};AGIChannel[_0x2e38('0x23')][_0x2e38('0x4a')]=function(_0x3f4e1e){return this[_0x2e38('0x48')](_0x2e38('0x4b'),_0x3f4e1e);};AGIChannel['prototype']['error']=function(_0x5e2681,_0x53557){this[_0x2e38('0x29')](util[_0x2e38('0x2d')](_0x2e38('0x4c'),_0x5e2681['id'],_0x5e2681[_0x2e38('0x4d')],_0x53557));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2e38('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 97353e7..74af212 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 _0x06f3=['name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','push','format','message'];(function(_0x3433c9,_0x2b0d80){var _0x2d7c5e=function(_0x4bf79a){while(--_0x4bf79a){_0x3433c9['push'](_0x3433c9['shift']());}};_0x2d7c5e(++_0x2b0d80);}(_0x06f3,0x113));var _0x306f=function(_0x3b9149,_0x2f93ab){_0x3b9149=_0x3b9149-0x0;var _0x2067f4=_0x06f3[_0x3b9149];return _0x2067f4;};'use strict';var util=require(_0x306f('0x0'));var error={'E_AGI_UNDEFINED':_0x306f('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x306f('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x306f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x306f('0x4'),'E_AGI_SOCKET_ERROR':_0x306f('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x306f('0x6'),'E_AGI_COMMAND_EMPTY':_0x306f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2f3791){var _0x2f3791=_0x2f3791||null,_0x56c889=_0x56c889||[],_0x503181=0x1,_0x25bbde='';if(!error[_0x2f3791]){_0x2f3791='E_AGI_UNDEFINED';}_0x56c889[_0x306f('0x8')](error[_0x2f3791]);while(arguments[_0x503181]){_0x56c889['push'](arguments[_0x503181]);_0x503181++;}_0x25bbde=util[_0x306f('0x9')]['apply'](util,_0x56c889);this[_0x306f('0xa')]=_0x25bbde;this[_0x306f('0xb')]=_0x2f3791;}module[_0x306f('0xc')]=AGIError; \ No newline at end of file +var _0x9087=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x1e4e5e,_0x4210e6){var _0xbae2d3=function(_0x240d74){while(--_0x240d74){_0x1e4e5e['push'](_0x1e4e5e['shift']());}};_0xbae2d3(++_0x4210e6);}(_0x9087,0xa1));var _0x7908=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9087[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7908('0x0'));var error={'E_AGI_UNDEFINED':_0x7908('0x1'),'E_AGI_ARGUMENT_PORT':_0x7908('0x2'),'E_AGI_SERVER_ERROR':_0x7908('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x7908('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x7908('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x7908('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x7908('0x7'),'E_AGI_COMMAND_EMPTY':_0x7908('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7908('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0xf2142f){var _0xf2142f=_0xf2142f||null,_0x28c98b=_0x28c98b||[],_0x1a9627=0x1,_0x250add='';if(!error[_0xf2142f]){_0xf2142f=_0x7908('0xa');}_0x28c98b['push'](error[_0xf2142f]);while(arguments[_0x1a9627]){_0x28c98b[_0x7908('0xb')](arguments[_0x1a9627]);_0x1a9627++;}_0x250add=util['format'][_0x7908('0xc')](util,_0x28c98b);this[_0x7908('0xd')]=_0x250add;this[_0x7908('0xe')]=_0xf2142f;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 3595f0e..1b2057e 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c0d=['agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','error','lodash','./error','../../config/environment','redis','defaults','localhost','subscribe'];(function(_0x5eff27,_0x239a53){var _0x1b1f23=function(_0x2e82a7){while(--_0x2e82a7){_0x5eff27['push'](_0x5eff27['shift']());}};_0x1b1f23(++_0x239a53);}(_0x8c0d,0xd9));var _0xd8c0=function(_0x5c8b4a,_0x1b5045){_0x5c8b4a=_0x5c8b4a-0x0;var _0x2abbba=_0x8c0d[_0x5c8b4a];return _0x2abbba;};'use strict';var _=require(_0xd8c0('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0xd8c0('0x1'));var config=require(_0xd8c0('0x2'));config[_0xd8c0('0x3')]=_[_0xd8c0('0x4')](config[_0xd8c0('0x3')],{'host':_0xd8c0('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xd8c0('0x3')]);sub[_0xd8c0('0x6')](_0xd8c0('0x7'),function(_0x394c0b){if(_0x394c0b)return eventEmitter[_0xd8c0('0x8')]('error',new AGIError(_0xd8c0('0x9'),_0x394c0b));});sub['on'](_0xd8c0('0xa'),function(_0x1af864,_0x577a81){if(_0x1af864!==_0xd8c0('0x7'))return;try{var _0x4757b7=JSON[_0xd8c0('0xb')](_0x577a81);eventEmitter['emit'](_0xd8c0('0xc'),_0x4757b7);}catch(_0x2e44d7){eventEmitter[_0xd8c0('0x8')](_0xd8c0('0xd'),new AGIError(_0xd8c0('0x9'),_0x2e44d7));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xa21f=['defaults','localhost','subscribe','error','E_AGI_SERVER_ERROR','agi','parse','emit','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x1496c1,_0x23cf40){var _0x48abc0=function(_0x5337d6){while(--_0x5337d6){_0x1496c1['push'](_0x1496c1['shift']());}};_0x48abc0(++_0x23cf40);}(_0xa21f,0x1c4));var _0xfa21=function(_0x30d85a,_0x53a4db){_0x30d85a=_0x30d85a-0x0;var _0x4ee80b=_0xa21f[_0x30d85a];return _0x4ee80b;};'use strict';var _=require(_0xfa21('0x0'));var EventEmitter=require(_0xfa21('0x1'))[_0xfa21('0x2')];var Redis=require(_0xfa21('0x3'));var AGIError=require(_0xfa21('0x4'));var config=require(_0xfa21('0x5'));config[_0xfa21('0x6')]=_[_0xfa21('0x7')](config['redis'],{'host':_0xfa21('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xfa21('0x6')]);sub[_0xfa21('0x9')]('agi',function(_0x4a011a){if(_0x4a011a)return eventEmitter['emit'](_0xfa21('0xa'),new AGIError(_0xfa21('0xb'),_0x4a011a));});sub['on']('message',function(_0x1fc190,_0x5e44bb){if(_0x1fc190!==_0xfa21('0xc'))return;try{var _0x5563d5=JSON[_0xfa21('0xd')](_0x5e44bb);eventEmitter[_0xfa21('0xe')](_0xfa21('0xf'),_0x5563d5);}catch(_0x402222){eventEmitter[_0xfa21('0xe')](_0xfa21('0xa'),new AGIError(_0xfa21('0xb'),_0x402222));}});module[_0xfa21('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 9bc1189..921d900 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 _0x9a31=['getsecretdigits','vertices','edges','prototype','addVertex','addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','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','getdigits'];(function(_0x234515,_0x46700e){var _0x5bdd8f=function(_0x56e5b3){while(--_0x56e5b3){_0x234515['push'](_0x234515['shift']());}};_0x5bdd8f(++_0x46700e);}(_0x9a31,0x1a1));var _0x19a3=function(_0x27c24e,_0x5db1c7){_0x27c24e=_0x27c24e-0x0;var _0x39004a=_0x9a31[_0x27c24e];return _0x39004a;};'use strict';var _=require(_0x19a3('0x0'));var logger=require(_0x19a3('0x1'))('agi');var verticesWithRetry=['menu',_0x19a3('0x2'),_0x19a3('0x3')];var Graph=function(){this[_0x19a3('0x4')]={};this[_0x19a3('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x19a3('0x6')][_0x19a3('0x7')]=function(_0x401994){this[_0x19a3('0x4')][_0x401994['id']]=_0x401994;this[_0x19a3('0x5')][_0x401994['id']]=[];};Graph[_0x19a3('0x6')][_0x19a3('0x8')]=function(_0x5ac212,_0x4c0291,_0x4d3833){this[_0x19a3('0x5')][_0x5ac212][_0x19a3('0x9')]({'target':_0x4c0291,'condition':_0x4d3833});this[_0x19a3('0xa')]+=0x1;};Graph[_0x19a3('0x6')][_0x19a3('0xb')]=function(){return _[_0x19a3('0xb')](this['vertices']);};Graph[_0x19a3('0x6')][_0x19a3('0xc')]=function(){return this[_0x19a3('0xa')];};Graph[_0x19a3('0x6')][_0x19a3('0xd')]=function(_0x50e26c){return this[_0x19a3('0x4')][_0x50e26c];};Graph[_0x19a3('0x6')][_0x19a3('0xe')]=function(_0x37c05f,_0x35d835){if(!this[_0x19a3('0x4')][_0x37c05f]){return logger['info'](_0x19a3('0xf'));}var _0x1b67ca=_0x35d835(this[_0x19a3('0x4')][_0x37c05f]);if(!_0x1b67ca){return logger[_0x19a3('0x10')]('stop\x20traverse');}if(this[_0x19a3('0x5')][_0x37c05f][_0x19a3('0x11')]===0x0){return logger[_0x19a3('0x10')](_0x19a3('0x12'));}for(var _0x498f3b=0x0,_0xb348cf=[],_0x2dfd18=![];_0x498f3b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','connection','syncho','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','findIndex','deleted','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','name','format','[%s]\x20%s','[ERROR]\x20%s','stack','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x2a7059,_0x5b40b9){var _0x1913b1=function(_0x5a5924){while(--_0x5a5924){_0x2a7059['push'](_0x2a7059['shift']());}};_0x1913b1(++_0x5b40b9);}(_0x7de7,0x162));var _0x77de=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0x7de7[_0x3b90ab];return _0x206e92;};'use strict';var _=require('lodash');var syncho=require(_0x77de('0x0'));var util=require('util');var config=require(_0x77de('0x1'));var logger=require(_0x77de('0x2'))(_0x77de('0x3'));var utilLicense=require(_0x77de('0x4'));var rpc=require('./rpc');var Project=require(_0x77de('0x5'));var AGIEmitter=require(_0x77de('0x6'))[_0x77de('0x7')];var projects=[];config[_0x77de('0x3')]=_[_0x77de('0x8')](config[_0x77de('0x3')],{'ip':_0x77de('0x9'),'port':0x11dd});AGIEmitter['on'](_0x77de('0xa'),projectUpdateHandler);function connectionHandler(_0x31096f){process[_0x77de('0xb')](function(){syncho(function(){try{setChannelVariables(_0x31096f);agiHandler(_0x31096f);}catch(_0x3e6fbf){logger['error'](_0x3e6fbf['stack']);}});});}function projectUpdateHandler(_0x575a50){try{var _0x4d3c26=_[_0x77de('0xc')](projects,['id',_0x575a50['id']]);if(_0x4d3c26>-0x1){if(_0x575a50[_0x77de('0xd')]===!![]){projects['splice'](_0x4d3c26,0x1);}else{projects[_0x4d3c26]=_0x575a50;}}else{projects[_0x77de('0xe')](_0x575a50);}}catch(_0x5ac3f5){logger[_0x77de('0xf')](_0x5ac3f5['stack']);}}function listeningHandler(){console[_0x77de('0x10')](_0x77de('0x11'),config[_0x77de('0x3')][_0x77de('0x12')]);logger['info'](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x428db6){if(_0x428db6&&_0x428db6[_0x77de('0x13')]&&_0x428db6['message']){logger[_0x77de('0xf')](util[_0x77de('0x14')](_0x77de('0x15'),_0x428db6['name'],_0x428db6['message']));}else{logger[_0x77de('0xf')](util[_0x77de('0x14')](_0x77de('0x16'),_0x428db6[_0x77de('0x17')]));}}function closeHandler(){logger[_0x77de('0x18')](util[_0x77de('0x14')](_0x77de('0x19'),this['arg_1'],this[_0x77de('0x1a')],this[_0x77de('0x1b')],this[_0x77de('0x1c')],this[_0x77de('0x1d')]));try{createSquareReport(this);}catch(_0x508b10){logger['error'](_0x508b10[_0x77de('0x17')]);}}function timeoutHandler(){logger[_0x77de('0x18')](util[_0x77de('0x14')](_0x77de('0x1e'),this[_0x77de('0x1f')],this['calleridname'],this[_0x77de('0x1b')],this[_0x77de('0x1c')],this[_0x77de('0x1d')]));}function hangupHandler(){logger['info'](util['format'](_0x77de('0x20'),this[_0x77de('0x1f')],this[_0x77de('0x1a')],this['callerid'],this[_0x77de('0x1c')],this[_0x77de('0x1d')]));this['evtHangup']=!![];}function createSquareReport(_0x4b9210,_0x1833ae){rpc['createSquareReport'](_0x4b9210)[_0x77de('0x21')](function(_0x3e775b){if(_0x1833ae){_0x1833ae(null,_0x3e775b);}})[_0x77de('0x22')](function(_0x260684){if(_0x1833ae){_0x1833ae(null,_0x260684);}});}function setChannelVariables(_0x2e82e7){for(var _0x4bd2c1 in _0x2e82e7){if(_0x2e82e7[_0x77de('0x23')](_0x4bd2c1)){if(_0x4bd2c1[_0x77de('0x24')](_0x77de('0x25'))===0x0){_0x2e82e7[_0x4bd2c1[_0x77de('0x26')](0x4)]=_0x2e82e7[_0x4bd2c1];delete _0x2e82e7[_0x4bd2c1];}}}}function agiHandler(_0x38d012){logger[_0x77de('0x27')](_0x77de('0x28'),JSON['stringify'](_0x38d012,null,0x2));logger[_0x77de('0x18')](util['format'](_0x77de('0x29'),_0x38d012[_0x77de('0x1f')],_0x38d012[_0x77de('0x1a')],_0x38d012[_0x77de('0x1b')],_0x38d012[_0x77de('0x1c')],_0x38d012[_0x77de('0x1d')]));_0x38d012['on'](_0x77de('0xf'),errorHandler);_0x38d012['on'](_0x77de('0x2a'),closeHandler);_0x38d012['on'](_0x77de('0x2b'),timeoutHandler);_0x38d012[_0x77de('0x2c')]=![];_0x38d012['on']('hangup',hangupHandler);var _0x20f96b=_['find'](projects,['name',_0x38d012[_0x77de('0x1f')]]);if(!_0x20f96b)return Project['handleNotFound'](_0x38d012);if(!_0x20f96b['production'])return Project['handleUnpublished'](_0x38d012);return Project[_0x77de('0x2d')](_0x20f96b,_0x38d012);}function main(){var _0x4e59d0;return utilLicense['getLicense']()[_0x77de('0x21')](function(_0x3fd31e){if(!_0x3fd31e)return;if(_0x3fd31e[_0x77de('0x2e')]){if(_0x3fd31e['callysquare']&&_0x3fd31e[_0x77de('0x2f')]>0x0){logger[_0x77de('0x18')](util[_0x77de('0x14')](_0x77de('0x30'),_0x3fd31e[_0x77de('0x2f')]));_0x4e59d0=_0x3fd31e[_0x77de('0x2f')];}else{logger[_0x77de('0x18')](_0x77de('0x31'));}}else{logger['info'](_0x77de('0x32'));_0x4e59d0=-0x1;}})[_0x77de('0x21')](function(){return Project['getAll']();})[_0x77de('0x21')](function(_0x1a400a){projects=_0x1a400a;return;})['catch'](function(_0x8fcdbc){logger['error'](_0x77de('0x33'),_0x8fcdbc['stack']);})[_0x77de('0x34')](function(){var _0x5ea783=require(_0x77de('0x35'))(config[_0x77de('0x3')]['port'],config[_0x77de('0x3')]['ip'],_0x4e59d0);_0x5ea783['on'](_0x77de('0xf'),errorHandler);_0x5ea783['on']('listening',listeningHandler);_0x5ea783['on'](_0x77de('0x36'),connectionHandler);_0x5ea783['on'](_0x77de('0x2a'),closeHandler);});}main(); \ No newline at end of file +var _0x4b6d=['evtHangup','then','catch','hasOwnProperty','indexOf','agi_','debug','variables','stringify','close','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','nextTick','error','findIndex','deleted','splice','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','info'];(function(_0x22ed97,_0xc271a6){var _0x4be4de=function(_0x53261e){while(--_0x53261e){_0x22ed97['push'](_0x22ed97['shift']());}};_0x4be4de(++_0xc271a6);}(_0x4b6d,0xed));var _0xd4b6=function(_0xfd7228,_0x3d68d4){_0xfd7228=_0xfd7228-0x0;var _0x531edb=_0x4b6d[_0xfd7228];return _0x531edb;};'use strict';var _=require(_0xd4b6('0x0'));var syncho=require('syncho');var util=require(_0xd4b6('0x1'));var config=require(_0xd4b6('0x2'));var logger=require(_0xd4b6('0x3'))(_0xd4b6('0x4'));var utilLicense=require(_0xd4b6('0x5'));var rpc=require(_0xd4b6('0x6'));var Project=require(_0xd4b6('0x7'));var AGIEmitter=require(_0xd4b6('0x8'))[_0xd4b6('0x9')];var projects=[];config[_0xd4b6('0x4')]=_[_0xd4b6('0xa')](config[_0xd4b6('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x5f01f5){process[_0xd4b6('0xb')](function(){syncho(function(){try{setChannelVariables(_0x5f01f5);agiHandler(_0x5f01f5);}catch(_0x80a201){logger[_0xd4b6('0xc')](_0x80a201['stack']);}});});}function projectUpdateHandler(_0x855c19){try{var _0xbc7da2=_[_0xd4b6('0xd')](projects,['id',_0x855c19['id']]);if(_0xbc7da2>-0x1){if(_0x855c19[_0xd4b6('0xe')]===!![]){projects[_0xd4b6('0xf')](_0xbc7da2,0x1);}else{projects[_0xbc7da2]=_0x855c19;}}else{projects['push'](_0x855c19);}}catch(_0xce8b54){logger[_0xd4b6('0xc')](_0xce8b54[_0xd4b6('0x10')]);}}function listeningHandler(){console['log'](_0xd4b6('0x11'),config['agi']['port']);logger['info'](util[_0xd4b6('0x12')](_0xd4b6('0x13'),config['agi']['ip'],config[_0xd4b6('0x4')][_0xd4b6('0x14')]));}function errorHandler(_0x41afea){if(_0x41afea&&_0x41afea[_0xd4b6('0x15')]&&_0x41afea[_0xd4b6('0x16')]){logger[_0xd4b6('0xc')](util['format'](_0xd4b6('0x17'),_0x41afea[_0xd4b6('0x15')],_0x41afea['message']));}else{logger['error'](util[_0xd4b6('0x12')](_0xd4b6('0x18'),_0x41afea['stack']));}}function closeHandler(){logger['info'](util[_0xd4b6('0x12')](_0xd4b6('0x19'),this['arg_1'],this['calleridname'],this[_0xd4b6('0x1a')],this[_0xd4b6('0x1b')],this[_0xd4b6('0x1c')]));try{createSquareReport(this);}catch(_0x2788ce){logger['error'](_0x2788ce[_0xd4b6('0x10')]);}}function timeoutHandler(){logger['info'](util[_0xd4b6('0x12')](_0xd4b6('0x1d'),this[_0xd4b6('0x1e')],this[_0xd4b6('0x1f')],this[_0xd4b6('0x1a')],this[_0xd4b6('0x1b')],this[_0xd4b6('0x1c')]));}function hangupHandler(){logger[_0xd4b6('0x20')](util[_0xd4b6('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xd4b6('0x1e')],this[_0xd4b6('0x1f')],this[_0xd4b6('0x1a')],this[_0xd4b6('0x1b')],this[_0xd4b6('0x1c')]));this[_0xd4b6('0x21')]=!![];}function createSquareReport(_0x3df895,_0x469ac7){rpc['createSquareReport'](_0x3df895)[_0xd4b6('0x22')](function(_0x591a9a){if(_0x469ac7){_0x469ac7(null,_0x591a9a);}})[_0xd4b6('0x23')](function(_0x2308f5){if(_0x469ac7){_0x469ac7(null,_0x2308f5);}});}function setChannelVariables(_0x4fb20e){for(var _0x624c1e in _0x4fb20e){if(_0x4fb20e[_0xd4b6('0x24')](_0x624c1e)){if(_0x624c1e[_0xd4b6('0x25')](_0xd4b6('0x26'))===0x0){_0x4fb20e[_0x624c1e['substring'](0x4)]=_0x4fb20e[_0x624c1e];delete _0x4fb20e[_0x624c1e];}}}}function agiHandler(_0x421e1a){logger[_0xd4b6('0x27')](_0xd4b6('0x28'),JSON[_0xd4b6('0x29')](_0x421e1a,null,0x2));logger['info'](util[_0xd4b6('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x421e1a[_0xd4b6('0x1e')],_0x421e1a[_0xd4b6('0x1f')],_0x421e1a[_0xd4b6('0x1a')],_0x421e1a[_0xd4b6('0x1b')],_0x421e1a[_0xd4b6('0x1c')]));_0x421e1a['on'](_0xd4b6('0xc'),errorHandler);_0x421e1a['on'](_0xd4b6('0x2a'),closeHandler);_0x421e1a['on']('timeout',timeoutHandler);_0x421e1a['evtHangup']=![];_0x421e1a['on'](_0xd4b6('0x2b'),hangupHandler);var _0x50b773=_[_0xd4b6('0x2c')](projects,[_0xd4b6('0x15'),_0x421e1a[_0xd4b6('0x1e')]]);if(!_0x50b773)return Project[_0xd4b6('0x2d')](_0x421e1a);if(!_0x50b773[_0xd4b6('0x2e')])return Project[_0xd4b6('0x2f')](_0x421e1a);return Project[_0xd4b6('0x30')](_0x50b773,_0x421e1a);}function main(){var _0x1a6d8a;return utilLicense[_0xd4b6('0x31')]()['then'](function(_0x35c92d){if(!_0x35c92d)return;if(_0x35c92d['voice']){if(_0x35c92d[_0xd4b6('0x32')]&&_0x35c92d[_0xd4b6('0x32')]>0x0){logger['info'](util[_0xd4b6('0x12')](_0xd4b6('0x33'),_0x35c92d['callysquare']));_0x1a6d8a=_0x35c92d[_0xd4b6('0x32')];}else{logger[_0xd4b6('0x20')](_0xd4b6('0x34'));}}else{logger[_0xd4b6('0x20')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1a6d8a=-0x1;}})[_0xd4b6('0x22')](function(){return Project[_0xd4b6('0x35')]();})['then'](function(_0x2b63c4){projects=_0x2b63c4;return;})[_0xd4b6('0x23')](function(_0x5ab246){logger[_0xd4b6('0xc')]('[LICENSE]',_0x5ab246[_0xd4b6('0x10')]);})['finally'](function(){var _0x42bf08=require('./server')(config[_0xd4b6('0x4')][_0xd4b6('0x14')],config['agi']['ip'],_0x1a6d8a);_0x42bf08['on'](_0xd4b6('0xc'),errorHandler);_0x42bf08['on']('listening',listeningHandler);_0x42bf08['on']('connection',connectionHandler);_0x42bf08['on'](_0xd4b6('0x2a'),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 572f954..de4168d 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 _0xae82=['result','catch','sendMailMessage','SendMail','bluebird','client','http','request','then','error','message'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xae82,0x93));var _0x2ae8=function(_0x543b7e,_0x3e1448){_0x543b7e=_0x543b7e-0x0;var _0x49e0d1=_0xae82[_0x543b7e];return _0x49e0d1;};'use strict';var BPromise=require(_0x2ae8('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x2ae8('0x1')][_0x2ae8('0x2')]({'port':0x232b});function request(_0x3b87be,_0x506bf5){return new BPromise(function(_0x588874,_0x57837d){return client[_0x2ae8('0x3')](_0x3b87be,_0x506bf5)[_0x2ae8('0x4')](function(_0x4a5a3a){if(_0x4a5a3a[_0x2ae8('0x5')]){return _0x57837d(_0x4a5a3a[_0x2ae8('0x5')][_0x2ae8('0x6')]);}else{return _0x588874(_0x4a5a3a[_0x2ae8('0x7')]);}})[_0x2ae8('0x8')](function(_0x4f241c){return _0x57837d(_0x4f241c);});});}exports[_0x2ae8('0x9')]=function(_0x4caaf5,_0x4edc6d){return request(_0x2ae8('0xa'),{'account':_0x4caaf5,'message':_0x4edc6d});}; \ No newline at end of file +var _0xbf1a=['request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0xbf1a,0x11c));var _0xabf1=function(_0x9618cc,_0x16cc5e){_0x9618cc=_0x9618cc-0x0;var _0x55a1f9=_0xbf1a[_0x9618cc];return _0x55a1f9;};'use strict';var BPromise=require(_0xabf1('0x0'));var jayson=require(_0xabf1('0x1'));var client=jayson[_0xabf1('0x2')][_0xabf1('0x3')]({'port':0x232b});function request(_0x8db232,_0x349fdd){return new BPromise(function(_0xb8088f,_0x5b8500){return client[_0xabf1('0x4')](_0x8db232,_0x349fdd)[_0xabf1('0x5')](function(_0x2f981e){if(_0x2f981e['error']){return _0x5b8500(_0x2f981e[_0xabf1('0x6')][_0xabf1('0x7')]);}else{return _0xb8088f(_0x2f981e[_0xabf1('0x8')]);}})[_0xabf1('0x9')](function(_0x147e72){return _0x5b8500(_0x147e72);});});}exports[_0xabf1('0xa')]=function(_0x360621,_0xa6f47c){return request(_0xabf1('0xb'),{'account':_0x360621,'message':_0xa6f47c});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 017fed0..d9ea42c 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa97d=['root','inspect','production','start','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','arg_1','calleridname','callerid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','evtHangup','debug','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','dnid','[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\x20found','close','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel'];(function(_0x2afdfa,_0x42acad){var _0x56c624=function(_0x386bad){while(--_0x386bad){_0x2afdfa['push'](_0x2afdfa['shift']());}};_0x56c624(++_0x42acad);}(_0xa97d,0x122));var _0xda97=function(_0x565610,_0x1a4085){_0x565610=_0x565610-0x0;var _0x89951f=_0xa97d[_0x565610];return _0x89951f;};'use strict';var _=require(_0xda97('0x0'));var moment=require(_0xda97('0x1'));var parser=require('xml2json');var util=require(_0xda97('0x2'));var logger=require(_0xda97('0x3'))('agi');var rpc=require('./rpc');var mailRpc=require(_0xda97('0x4'));var Graph=require(_0xda97('0x5'));var Vertices=require(_0xda97('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xda97('0x7')]()[_0xda97('0x8')](function(_0x5c57de){logger[_0xda97('0x9')](_0xda97('0xa'),_0x5c57de[_0xda97('0xb')]);return[];});}function addVertex(_0x2a37a6,_0x17152c,_0x1cb16e){_0x17152c['agicommand']=_0x1cb16e;if(_0x17152c[_0xda97('0xc')](_0xda97('0xd'))){_0x17152c[_0xda97('0xe')]=parseInt(_0x17152c[_0xda97('0xd')],0xa);}_0x2a37a6[_0xda97('0xf')](_['omit'](_0x17152c,_0xda97('0x10')));}function initGraph(_0x41035b,_0x777c2d){var _0x18c934=new Graph();for(var _0x169888 in _0x41035b){if(_0x41035b['hasOwnProperty'](_0x169888)){if(_[_0xda97('0x11')](_0x41035b[_0x169888])){for(var _0x79b7c=0x0;_0x79b7c<_0x41035b[_0x169888][_0xda97('0x12')];_0x79b7c+=0x1){addVertex(_0x18c934,_0x41035b[_0x169888][_0x79b7c],_0x169888);}}else{addVertex(_0x18c934,_0x41035b[_0x169888],_0x169888);}}}for(var _0x4fbd2f=0x0;_0x4fbd2f<_0x777c2d[_0xda97('0x12')];_0x4fbd2f+=0x1){if(_0x777c2d[_0x4fbd2f][_0xda97('0x13')]&&_0x777c2d[_0x4fbd2f][_0xda97('0x14')]){_0x18c934[_0xda97('0x15')](_0x777c2d[_0x4fbd2f][_0xda97('0x13')],_0x777c2d[_0x4fbd2f][_0xda97('0x14')],_0x777c2d[_0x4fbd2f][_0xda97('0x16')]);}}return _0x18c934;}function getRoot(_0x22e630){return parser[_0xda97('0x17')](_0x22e630,{'object':!![]})[_0xda97('0x18')][_0xda97('0x19')];}function inspect(_0xc4ff5b){return util[_0xda97('0x1a')](_0xc4ff5b,{'showHidden':![],'depth':null});}function initialize(_0x13cca2,_0x4d19c2){var _0x57aef8=getRoot(_0x13cca2[_0xda97('0x1b')]);if(!_0x57aef8||!_0x57aef8[_0xda97('0x1c')])return;var _0x1ae6cc,_0x239470,_0x3d5472;logger['debug'](_0xda97('0x19'),JSON[_0xda97('0x1d')](_0x57aef8,null,0x2));_0x4d19c2[_0xda97('0x1e')]=moment()[_0xda97('0x1f')](_0xda97('0x20'));_0x1ae6cc=initGraph(_[_0xda97('0x21')](_0x57aef8,'mxCell'),_0x57aef8['mxCell']);_0x239470=new Vertices(_0x4d19c2,rpc,mailRpc);logger[_0xda97('0x22')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d19c2[_0xda97('0x23')],_0x4d19c2[_0xda97('0x24')],_0x4d19c2[_0xda97('0x25')],_0x4d19c2['dnid'],_0x4d19c2[_0xda97('0x26')]));_0x1ae6cc[_0xda97('0x27')](_0x57aef8[_0xda97('0x1c')]['id'],function(_0x16ad49){try{_0x16ad49=_0x239470[_0xda97('0x28')](_0x16ad49);logger['debug'](_0xda97('0x29'),JSON[_0xda97('0x1d')](_0x16ad49,null,0x2));if(_0x16ad49[_0xda97('0x2a')]==='gotoc'){logger[_0xda97('0x22')](_0xda97('0x2b'));_0x4d19c2[_0xda97('0x2c')]=_0x16ad49['context']||_0x4d19c2[_0xda97('0x2c')];_0x4d19c2[_0xda97('0x2d')]=_0x16ad49['extension'];_0x4d19c2[_0xda97('0x2e')]=_0x16ad49[_0xda97('0x2e')]?_0x16ad49[_0xda97('0x2e')]-0x1:0x1;return null;}else if(_0x16ad49&&_0x239470[_0x16ad49[_0xda97('0x2a')]]){_0x3d5472=_0x239470[_0x16ad49[_0xda97('0x2a')]](_0x16ad49);logger[_0xda97('0x22')]('response',JSON['stringify'](_0x3d5472,null,0x2));if(_0x3d5472&&_0x3d5472['code']===AGI_CODE_SUCCESS&&_0x3d5472['result']!==AGI_RESULT_ERROR&&!_0x4d19c2[_0xda97('0x2f')]){logger[_0xda97('0x30')](_0xda97('0x31'),inspect(_0x3d5472));return _[_0xda97('0x32')](_0x3d5472[_0xda97('0x33')])?null:_0x3d5472[_0xda97('0x33')][_0xda97('0x34')]();}else{logger[_0xda97('0x9')]('response',inspect(_0x3d5472));return null;}}else{logger['error'](_0xda97('0x35'));return null;}}catch(_0x48544a){logger[_0xda97('0x9')](_0x48544a['stack']);return null;}});if(_0x57aef8[_0xda97('0x36')]){logger[_0xda97('0x22')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d19c2['arg_1'],_0x4d19c2[_0xda97('0x24')],_0x4d19c2[_0xda97('0x25')],_0x4d19c2[_0xda97('0x37')],_0x4d19c2['uniqueid']));_0x1ae6cc[_0xda97('0x27')](_0x57aef8[_0xda97('0x36')]['id'],function(_0x62a9d){try{_0x62a9d=_0x239470[_0xda97('0x28')](_0x62a9d);logger[_0xda97('0x30')](_0xda97('0x29'),JSON[_0xda97('0x1d')](_0x62a9d,null,0x2));if(_0x62a9d&&_0x239470[_0x62a9d[_0xda97('0x2a')]]){_0x3d5472=_0x239470[_0x62a9d[_0xda97('0x2a')]](_0x62a9d);if(_0x3d5472){logger[_0xda97('0x30')]('response',inspect(_0x3d5472));return _[_0xda97('0x32')](_0x3d5472[_0xda97('0x33')])?null:_0x3d5472[_0xda97('0x33')][_0xda97('0x34')]();}else{logger['error'](_0xda97('0x31'),inspect(_0x3d5472));return null;}}else{logger[_0xda97('0x9')](_0xda97('0x35'));return null;}}catch(_0x3c22b5){logger[_0xda97('0x9')](_0x3c22b5[_0xda97('0xb')]);return null;}});}logger[_0xda97('0x22')](util[_0xda97('0x1f')](_0xda97('0x38'),_0x4d19c2[_0xda97('0x23')],_0x4d19c2['calleridname'],_0x4d19c2[_0xda97('0x25')],_0x4d19c2[_0xda97('0x37')],_0x4d19c2['uniqueid']));logger[_0xda97('0x22')](util['format'](_0xda97('0x39'),_0x4d19c2[_0xda97('0x2c')],_0x4d19c2[_0xda97('0x2d')],parseInt(_0x4d19c2[_0xda97('0x2e')],0xa)+0x1));_0x4d19c2[_0xda97('0x3a')](_0x4d19c2['context'],_0x4d19c2[_0xda97('0x2d')],parseInt(_0x4d19c2[_0xda97('0x2e')],0xa)+0x1);_0x4d19c2['close']();}function handleNotFound(_0x11cc4f){logger[_0xda97('0x9')](util[_0xda97('0x1f')](_0xda97('0x3b'),_0x11cc4f[_0xda97('0x23')]));_0x11cc4f[_0xda97('0x3a')](_0x11cc4f[_0xda97('0x2c')],_0x11cc4f[_0xda97('0x2d')],parseInt(_0x11cc4f['priority'],0xa)+0x1);_0x11cc4f[_0xda97('0x3c')]();}function handleUnpublished(_0x3537a2){logger['error'](util[_0xda97('0x1f')](_0xda97('0x3d'),_0x3537a2['arg_1']));_0x3537a2[_0xda97('0x3a')](_0x3537a2[_0xda97('0x2c')],_0x3537a2[_0xda97('0x2d')],parseInt(_0x3537a2['priority'],0xa)+0x1);_0x3537a2[_0xda97('0x3c')]();}module[_0xda97('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xcfb3=['calleridname','callerid','dnid','uniqueid','traverseBFS','clear','debug','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','stack','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','continueAt','exports','lodash','moment','xml2json','agi','./mailRpc','./graph','getSquareProjects','catch','error','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','target','addEdge','source','value','toJson','mxGraphModel','inspect','start','root','stringify','format','YYYY-MM-DD\x20HH:mm:ss','info','arg_1'];(function(_0x3d58fb,_0xef01de){var _0x301a03=function(_0x31c1eb){while(--_0x31c1eb){_0x3d58fb['push'](_0x3d58fb['shift']());}};_0x301a03(++_0xef01de);}(_0xcfb3,0x1b1));var _0x3cfb=function(_0x5c97ac,_0x525764){_0x5c97ac=_0x5c97ac-0x0;var _0x1f447e=_0xcfb3[_0x5c97ac];return _0x1f447e;};'use strict';var _=require(_0x3cfb('0x0'));var moment=require(_0x3cfb('0x1'));var parser=require(_0x3cfb('0x2'));var util=require('util');var logger=require('../../config/logger')(_0x3cfb('0x3'));var rpc=require('./rpc');var mailRpc=require(_0x3cfb('0x4'));var Graph=require(_0x3cfb('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3cfb('0x6')]()[_0x3cfb('0x7')](function(_0x3af3a8){logger[_0x3cfb('0x8')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x3af3a8['stack']);return[];});}function addVertex(_0x380fcb,_0x5109a7,_0x1943be){_0x5109a7[_0x3cfb('0x9')]=_0x1943be;if(_0x5109a7[_0x3cfb('0xa')](_0x3cfb('0xb'))){_0x5109a7[_0x3cfb('0xc')]=parseInt(_0x5109a7[_0x3cfb('0xb')],0xa);}_0x380fcb[_0x3cfb('0xd')](_[_0x3cfb('0xe')](_0x5109a7,_0x3cfb('0xf')));}function initGraph(_0x3b1102,_0x5c4dec){var _0x54836f=new Graph();for(var _0x5a27e5 in _0x3b1102){if(_0x3b1102[_0x3cfb('0xa')](_0x5a27e5)){if(_['isArray'](_0x3b1102[_0x5a27e5])){for(var _0x17771d=0x0;_0x17771d<_0x3b1102[_0x5a27e5][_0x3cfb('0x10')];_0x17771d+=0x1){addVertex(_0x54836f,_0x3b1102[_0x5a27e5][_0x17771d],_0x5a27e5);}}else{addVertex(_0x54836f,_0x3b1102[_0x5a27e5],_0x5a27e5);}}}for(var _0x30026b=0x0;_0x30026b<_0x5c4dec[_0x3cfb('0x10')];_0x30026b+=0x1){if(_0x5c4dec[_0x30026b]['source']&&_0x5c4dec[_0x30026b][_0x3cfb('0x11')]){_0x54836f[_0x3cfb('0x12')](_0x5c4dec[_0x30026b][_0x3cfb('0x13')],_0x5c4dec[_0x30026b][_0x3cfb('0x11')],_0x5c4dec[_0x30026b][_0x3cfb('0x14')]);}}return _0x54836f;}function getRoot(_0x1c5b0d){return parser[_0x3cfb('0x15')](_0x1c5b0d,{'object':!![]})[_0x3cfb('0x16')]['root'];}function inspect(_0x4d6236){return util[_0x3cfb('0x17')](_0x4d6236,{'showHidden':![],'depth':null});}function initialize(_0x43684b,_0x48d803){var _0x1d46da=getRoot(_0x43684b['production']);if(!_0x1d46da||!_0x1d46da[_0x3cfb('0x18')])return;var _0x293ea4,_0x251826,_0x55a1b1;logger['debug'](_0x3cfb('0x19'),JSON[_0x3cfb('0x1a')](_0x1d46da,null,0x2));_0x48d803['joinAt']=moment()[_0x3cfb('0x1b')](_0x3cfb('0x1c'));_0x293ea4=initGraph(_[_0x3cfb('0xe')](_0x1d46da,_0x3cfb('0xf')),_0x1d46da[_0x3cfb('0xf')]);_0x251826=new Vertices(_0x48d803,rpc,mailRpc);logger[_0x3cfb('0x1d')](util[_0x3cfb('0x1b')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x48d803[_0x3cfb('0x1e')],_0x48d803[_0x3cfb('0x1f')],_0x48d803[_0x3cfb('0x20')],_0x48d803[_0x3cfb('0x21')],_0x48d803[_0x3cfb('0x22')]));_0x293ea4[_0x3cfb('0x23')](_0x1d46da[_0x3cfb('0x18')]['id'],function(_0x4875a5){try{_0x4875a5=_0x251826[_0x3cfb('0x24')](_0x4875a5);logger[_0x3cfb('0x25')]('vertex',JSON[_0x3cfb('0x1a')](_0x4875a5,null,0x2));if(_0x4875a5[_0x3cfb('0x9')]==='gotoc'){logger['info'](_0x3cfb('0x26'));_0x48d803[_0x3cfb('0x27')]=_0x4875a5['context']||_0x48d803[_0x3cfb('0x27')];_0x48d803['extension']=_0x4875a5['extension'];_0x48d803[_0x3cfb('0x28')]=_0x4875a5[_0x3cfb('0x28')]?_0x4875a5[_0x3cfb('0x28')]-0x1:0x1;return null;}else if(_0x4875a5&&_0x251826[_0x4875a5[_0x3cfb('0x9')]]){_0x55a1b1=_0x251826[_0x4875a5[_0x3cfb('0x9')]](_0x4875a5);logger['info'](_0x3cfb('0x29'),JSON[_0x3cfb('0x1a')](_0x55a1b1,null,0x2));if(_0x55a1b1&&_0x55a1b1[_0x3cfb('0x2a')]===AGI_CODE_SUCCESS&&_0x55a1b1[_0x3cfb('0x2b')]!==AGI_RESULT_ERROR&&!_0x48d803[_0x3cfb('0x2c')]){logger[_0x3cfb('0x25')](_0x3cfb('0x29'),inspect(_0x55a1b1));return _[_0x3cfb('0x2d')](_0x55a1b1[_0x3cfb('0x2b')])?null:_0x55a1b1[_0x3cfb('0x2b')][_0x3cfb('0x2e')]();}else{logger['error']('response',inspect(_0x55a1b1));return null;}}else{logger[_0x3cfb('0x8')](_0x3cfb('0x2f'));return null;}}catch(_0x13d6f0){logger[_0x3cfb('0x8')](_0x13d6f0['stack']);return null;}});if(_0x1d46da[_0x3cfb('0x30')]){logger[_0x3cfb('0x1d')](util[_0x3cfb('0x1b')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x48d803['arg_1'],_0x48d803[_0x3cfb('0x1f')],_0x48d803[_0x3cfb('0x20')],_0x48d803[_0x3cfb('0x21')],_0x48d803[_0x3cfb('0x22')]));_0x293ea4[_0x3cfb('0x23')](_0x1d46da['finally']['id'],function(_0x53139c){try{_0x53139c=_0x251826[_0x3cfb('0x24')](_0x53139c);logger[_0x3cfb('0x25')]('vertex',JSON[_0x3cfb('0x1a')](_0x53139c,null,0x2));if(_0x53139c&&_0x251826[_0x53139c[_0x3cfb('0x9')]]){_0x55a1b1=_0x251826[_0x53139c[_0x3cfb('0x9')]](_0x53139c);if(_0x55a1b1){logger[_0x3cfb('0x25')](_0x3cfb('0x29'),inspect(_0x55a1b1));return _[_0x3cfb('0x2d')](_0x55a1b1['result'])?null:_0x55a1b1[_0x3cfb('0x2b')][_0x3cfb('0x2e')]();}else{logger[_0x3cfb('0x8')](_0x3cfb('0x29'),inspect(_0x55a1b1));return null;}}else{logger[_0x3cfb('0x8')](_0x3cfb('0x2f'));return null;}}catch(_0x3b09ac){logger[_0x3cfb('0x8')](_0x3b09ac[_0x3cfb('0x31')]);return null;}});}logger[_0x3cfb('0x1d')](util[_0x3cfb('0x1b')](_0x3cfb('0x32'),_0x48d803[_0x3cfb('0x1e')],_0x48d803[_0x3cfb('0x1f')],_0x48d803['callerid'],_0x48d803[_0x3cfb('0x21')],_0x48d803[_0x3cfb('0x22')]));logger[_0x3cfb('0x1d')](util[_0x3cfb('0x1b')](_0x3cfb('0x33'),_0x48d803[_0x3cfb('0x27')],_0x48d803[_0x3cfb('0x34')],parseInt(_0x48d803['priority'],0xa)+0x1));_0x48d803['continueAt'](_0x48d803['context'],_0x48d803[_0x3cfb('0x34')],parseInt(_0x48d803[_0x3cfb('0x28')],0xa)+0x1);_0x48d803['close']();}function handleNotFound(_0x597821){logger[_0x3cfb('0x8')](util[_0x3cfb('0x1b')](_0x3cfb('0x35'),_0x597821['arg_1']));_0x597821['continueAt'](_0x597821['context'],_0x597821['extension'],parseInt(_0x597821[_0x3cfb('0x28')],0xa)+0x1);_0x597821[_0x3cfb('0x36')]();}function handleUnpublished(_0x5d446a){logger[_0x3cfb('0x8')](util[_0x3cfb('0x1b')](_0x3cfb('0x37'),_0x5d446a[_0x3cfb('0x1e')]));_0x5d446a[_0x3cfb('0x38')](_0x5d446a[_0x3cfb('0x27')],_0x5d446a[_0x3cfb('0x34')],parseInt(_0x5d446a[_0x3cfb('0x28')],0xa)+0x1);_0x5d446a['close']();}module[_0x3cfb('0x39')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 9aea36f..6cc25bb 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 _0x93f1=['\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','util','stream','Transform','call','_localBuffer','inherits','_transform'];(function(_0x1f8923,_0x9b9d55){var _0x1b9bc3=function(_0x5016f4){while(--_0x5016f4){_0x1f8923['push'](_0x1f8923['shift']());}};_0x1b9bc3(++_0x9b9d55);}(_0x93f1,0x1b1));var _0x193f=function(_0x82234a,_0xa94c50){_0x82234a=_0x82234a-0x0;var _0x54702e=_0x93f1[_0x82234a];return _0x54702e;};'use strict';var util=require(_0x193f('0x0'));var Transform=require(_0x193f('0x1'))[_0x193f('0x2')];function AGIReply(_0x537c90){Transform[_0x193f('0x3')](this,_0x537c90);this[_0x193f('0x4')]='';this['_inBody']=![];}util[_0x193f('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x193f('0x6')]=function(_0x54529c,_0x31af60,_0x5670ea){var _0xd9bc2d='\x0a',_0xddcb90=['\x0a\x0a',_0x193f('0x7')],_0x21c670=-0x1,_0xf6027d=-0x1,_0x186e72='',_0x56059d=0x0,_0x269aa2='',_0x2ee15b='';this[_0x193f('0x4')]+=_0x54529c[_0x193f('0x8')]();_0x269aa2=this[_0x193f('0x4')];if(!this[_0x193f('0x9')]){_0x56059d=0x0;while(_0xddcb90[_0x56059d]){while((_0xf6027d=_0x269aa2[_0x193f('0xa')](_0xddcb90[_0x56059d]))!=-0x1){_0x186e72=_0xddcb90[_0x56059d];_0x2ee15b=_0x269aa2[_0x193f('0xb')](0x0,_0xf6027d);_0x269aa2=_0x269aa2[_0x193f('0xb')](_0xf6027d+_0x186e72[_0x193f('0xc')]);var _0xa9fc53=_0x2ee15b[_0x193f('0xd')](_0xd9bc2d),_0x34268f=0x0,_0x197fe3={},_0xa04d4e='',_0x1187c7='',_0x1765bd=-0x1;while(_0xa9fc53[_0x34268f]){_0x1765bd=_0xa9fc53[_0x34268f][_0x193f('0xa')](':');if(_0x1765bd!=-0x1){_0xa04d4e=_0xa9fc53[_0x34268f][_0x193f('0xe')](0x0,_0x1765bd)['trim']();_0x1187c7=_0xa9fc53[_0x34268f][_0x193f('0xe')](_0x1765bd+0x1)[_0x193f('0xf')]();if(_0xa04d4e['length']>0x0){_0x197fe3[_0xa04d4e]=_0x1187c7;}}else{}_0x34268f++;}this[_0x193f('0x10')](_0x193f('0x11'),_0x197fe3);this[_0x193f('0x9')]=!![];}_0x56059d++;}this[_0x193f('0x4')]=_0x269aa2;}else{while((_0x21c670=_0x269aa2[_0x193f('0xa')](_0xd9bc2d))!=-0x1){_0x2ee15b=_0x269aa2[_0x193f('0xb')](0x0,_0x21c670);this[_0x193f('0x10')](_0x193f('0x12'),_0x2ee15b);_0x269aa2=_0x269aa2[_0x193f('0xb')](_0x21c670+_0xd9bc2d[_0x193f('0xc')]);}this['_localBuffer']=_0x269aa2;}_0x5670ea();};module[_0x193f('0x13')]=AGIReply; \ No newline at end of file +var _0x407f=['split','indexOf','slice','trim','emit','line','exports','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','length'];(function(_0x1927ed,_0x160277){var _0x1e363a=function(_0x21022b){while(--_0x21022b){_0x1927ed['push'](_0x1927ed['shift']());}};_0x1e363a(++_0x160277);}(_0x407f,0xc2));var _0xf407=function(_0x3316a8,_0x429f76){_0x3316a8=_0x3316a8-0x0;var _0x495662=_0x407f[_0x3316a8];return _0x495662;};'use strict';var util=require('util');var Transform=require('stream')['Transform'];function AGIReply(_0x34f89a){Transform[_0xf407('0x0')](this,_0x34f89a);this[_0xf407('0x1')]='';this[_0xf407('0x2')]=![];}util[_0xf407('0x3')](AGIReply,Transform);AGIReply[_0xf407('0x4')][_0xf407('0x5')]=function(_0x2bb1e4,_0x14df0c,_0x160f5c){var _0x438076='\x0a',_0x2bce9d=['\x0a\x0a',_0xf407('0x6')],_0x2d4ec6=-0x1,_0x3ac774=-0x1,_0x38ee37='',_0x3ab539=0x0,_0x5dc169='',_0x2291a7='';this[_0xf407('0x1')]+=_0x2bb1e4[_0xf407('0x7')]();_0x5dc169=this['_localBuffer'];if(!this['_inBody']){_0x3ab539=0x0;while(_0x2bce9d[_0x3ab539]){while((_0x3ac774=_0x5dc169['indexOf'](_0x2bce9d[_0x3ab539]))!=-0x1){_0x38ee37=_0x2bce9d[_0x3ab539];_0x2291a7=_0x5dc169[_0xf407('0x8')](0x0,_0x3ac774);_0x5dc169=_0x5dc169[_0xf407('0x8')](_0x3ac774+_0x38ee37[_0xf407('0x9')]);var _0x8f126=_0x2291a7[_0xf407('0xa')](_0x438076),_0x261ac2=0x0,_0x5637a5={},_0x2ee485='',_0x3f4ca0='',_0x3b26ae=-0x1;while(_0x8f126[_0x261ac2]){_0x3b26ae=_0x8f126[_0x261ac2][_0xf407('0xb')](':');if(_0x3b26ae!=-0x1){_0x2ee485=_0x8f126[_0x261ac2][_0xf407('0xc')](0x0,_0x3b26ae)[_0xf407('0xd')]();_0x3f4ca0=_0x8f126[_0x261ac2][_0xf407('0xc')](_0x3b26ae+0x1)['trim']();if(_0x2ee485['length']>0x0){_0x5637a5[_0x2ee485]=_0x3f4ca0;}}else{}_0x261ac2++;}this[_0xf407('0xe')]('headers',_0x5637a5);this[_0xf407('0x2')]=!![];}_0x3ab539++;}this['_localBuffer']=_0x5dc169;}else{while((_0x2d4ec6=_0x5dc169['indexOf'](_0x438076))!=-0x1){_0x2291a7=_0x5dc169[_0xf407('0x8')](0x0,_0x2d4ec6);this[_0xf407('0xe')](_0xf407('0xf'),_0x2291a7);_0x5dc169=_0x5dc169[_0xf407('0x8')](_0x2d4ec6+_0x438076[_0xf407('0x9')]);}this[_0xf407('0x1')]=_0x5dc169;}_0x160f5c();};module[_0xf407('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 60dbe91..d49cf3d 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 _0xcb81=['createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','request','then','error','message','catch','getSquareProjects','name','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xcb81,0x154));var _0x1cb8=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0xcb81[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x1cb8('0x0'));var moment=require(_0x1cb8('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x1cb8('0x2')]['http']({'port':0x2329});function request(_0x5e8697,_0x55f3a0){return new Promise(function(_0x38c3ea,_0x33a8f2){return client[_0x1cb8('0x3')](_0x5e8697,_0x55f3a0)[_0x1cb8('0x4')](function(_0x41b867){if(_0x41b867['error']){return _0x33a8f2(_0x41b867[_0x1cb8('0x5')][_0x1cb8('0x6')]);}else{return _0x38c3ea(_0x41b867['result']);}})[_0x1cb8('0x7')](function(_0x39b4ad){return _0x33a8f2(_0x39b4ad);});});}exports[_0x1cb8('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x1cb8('0x9'),'production']}});};exports['getSquareProject']=function(_0x29e901){return request(_0x1cb8('0xa'),{'options':{'raw':![],'where':{'name':_0x29e901},'attributes':[_0x1cb8('0xb')]}});};exports[_0x1cb8('0xc')]=function(_0x267dde){return request(_0x1cb8('0xd'),{'options':{'raw':![],'where':{'id':_0x267dde},'include':[{'model':_0x1cb8('0xe'),'as':_0x1cb8('0xf'),'include':[{'model':'CloudProvider','as':_0x1cb8('0x10')}]}],'attributes':['id',_0x1cb8('0x9'),_0x1cb8('0x11')],'smtp':!![]}});};exports[_0x1cb8('0x12')]=function(_0x1371cb){return request('ShowSquareProject',{'options':{'where':{'id':_0x1371cb},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x13')]=function(_0xcb6ad1){return request(_0x1cb8('0x14'),{'options':{'where':{'id':_0xcb6ad1},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x15')]=function(_0x339ad0){return request(_0x1cb8('0x16'),{'options':{'where':{'id':_0x339ad0},'attributes':['name']}});};exports[_0x1cb8('0x17')]=function(_0x4b4917){return request(_0x1cb8('0x18'),{'options':{'where':{'id':_0x4b4917},'attributes':[_0x1cb8('0x19')]}});};exports[_0x1cb8('0x1a')]=function(_0x46abd0){return request(_0x1cb8('0x1b'),{'options':{'where':{'id':_0x46abd0},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x1c')]=function(_0x9f0adb){return request(_0x1cb8('0x1d'),{'options':{'where':{'phone':_0x9f0adb[_0x1cb8('0x1e')]},'attributes':['id']}});};exports[_0x1cb8('0x1f')]=function(_0x3cda27){return request('ShowTrunk',{'options':{'where':{'id':_0x3cda27},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x20')]=function(_0x170f34){return request(_0x1cb8('0x21'),{'options':{'where':{'id':_0x170f34},'attributes':['save_name']}});};exports[_0x1cb8('0x22')]=function(_0x4f9220){return request(_0x1cb8('0x23'),{'options':{'raw':![],'where':{'id':_0x4f9220},'include':[{'model':_0x1cb8('0x24'),'as':_0x1cb8('0x25')}]}});};exports[_0x1cb8('0x26')]=function(_0x559916){return request('ShowSmsAccount',{'options':{'where':{'id':_0x559916},'attributes':['id',_0x1cb8('0x9')]}});};exports[_0x1cb8('0x27')]=function(_0x22dafe){return request(_0x1cb8('0x28'),{'body':_0x22dafe});};exports[_0x1cb8('0x29')]=function(_0x30985c){return request(_0x1cb8('0x2a'),{'body':_0x30985c});};exports['createSquareReport']=function(_0x1ec384){return request(_0x1cb8('0x2b'),{'body':_[_0x1cb8('0x2c')](_0x1ec384,{'project_name':_0x1ec384[_0x1cb8('0x2d')],'prev_project_name':_0x1ec384[_0x1cb8('0x2e')]||'','is_subproject':_0x1ec384[_0x1cb8('0x2e')]?!![]:![],'leaveAt':moment()['format'](_0x1cb8('0x2f'))})});};exports[_0x1cb8('0x30')]=function(_0xfdfb31){return request(_0x1cb8('0x31'),{'body':_0xfdfb31});};exports[_0x1cb8('0x32')]=function(_0x4a9b74){return request(_0x1cb8('0x33'),{'body':_0x4a9b74});};exports[_0x1cb8('0x34')]=function(_0x3a8b53){return request(_0x1cb8('0x35'),{'options':{'raw':![],'where':{'phone':_0x3a8b53['phone'],'ListId':_0x3a8b53[_0x1cb8('0x36')]}}})[_0x1cb8('0x4')](function(_0x3a6a67){if(_0x3a6a67){return _0x3a6a67;}return request('CreateCmContact',{'body':_0x3a8b53});});};exports[_0x1cb8('0x37')]=function(_0x2a6da9){return request(_0x1cb8('0x38'),{'options':{'where':{'id':_0x2a6da9},'attributes':['name']}});};exports[_0x1cb8('0x39')]=function(_0x3e2af4,_0x239c62){return request(_0x1cb8('0x3a'),{'body':{'interface':_0x239c62},'options':{'where':_0x3e2af4}});};exports[_0x1cb8('0x3b')]=function(_0x54278d,_0x2607f0,_0x1de806){return request(_0x1cb8('0x3c'),{'body':{'type':_0x2607f0,'uniqueid':_0x1de806},'options':{'where':_0x54278d}});};exports[_0x1cb8('0x3d')]=function(_0x18fe1b){return request(_0x1cb8('0x3e'),{'body':{},'options':{'where':_0x18fe1b}});};exports[_0x1cb8('0x3f')]=function(_0x18cc99){return request(_0x1cb8('0x40'),{'body':{},'options':{'where':_0x18cc99}});}; \ No newline at end of file +var _0x891b=['Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ListId','CreateCmContact','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','jayson/promise','client','then','error','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','save_name','getIntervalById','ShowInterval'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x891b,0xc5));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0xb891('0x0'));var client=jayson[_0xb891('0x1')]['http']({'port':0x2329});function request(_0x31870f,_0xca3e82){return new Promise(function(_0x1c519f,_0x467558){return client['request'](_0x31870f,_0xca3e82)[_0xb891('0x2')](function(_0x44ca2e){if(_0x44ca2e['error']){return _0x467558(_0x44ca2e[_0xb891('0x3')]['message']);}else{return _0x1c519f(_0x44ca2e['result']);}})['catch'](function(_0x134dc0){return _0x467558(_0x134dc0);});});}exports[_0xb891('0x4')]=function(){return request(_0xb891('0x5'),{'options':{'raw':![],'attributes':['id',_0xb891('0x6'),_0xb891('0x7')]}});};exports[_0xb891('0x8')]=function(_0x119686){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x119686},'attributes':[_0xb891('0x7')]}});};exports[_0xb891('0x9')]=function(_0x2dd7d4){return request(_0xb891('0xa'),{'options':{'raw':![],'where':{'id':_0x2dd7d4},'include':[{'model':_0xb891('0xb'),'as':_0xb891('0xc'),'include':[{'model':_0xb891('0xd'),'as':_0xb891('0xd')}]}],'attributes':['id',_0xb891('0x6'),_0xb891('0xe')],'smtp':!![]}});};exports[_0xb891('0xf')]=function(_0x5ecb30){return request(_0xb891('0x10'),{'options':{'where':{'id':_0x5ecb30},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x11')]=function(_0x57c76b){return request(_0xb891('0x12'),{'options':{'where':{'id':_0x57c76b},'attributes':[_0xb891('0x6')]}});};exports['getVariableById']=function(_0xca0294){return request('ShowVariable',{'options':{'where':{'id':_0xca0294},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x13')]=function(_0x1a028b){return request(_0xb891('0x14'),{'options':{'where':{'id':_0x1a028b},'attributes':[_0xb891('0x15')]}});};exports[_0xb891('0x16')]=function(_0x592f48){return request('ShowUser',{'options':{'where':{'id':_0x592f48},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x17')]=function(_0x10a1b3){return request(_0xb891('0x18'),{'options':{'where':{'phone':_0x10a1b3[_0xb891('0x19')]},'attributes':['id']}});};exports[_0xb891('0x1a')]=function(_0x2b1afa){return request(_0xb891('0x1b'),{'options':{'where':{'id':_0x2b1afa},'attributes':['name']}});};exports['getSoundById']=function(_0x245a64){return request('ShowSound',{'options':{'where':{'id':_0x245a64},'attributes':[_0xb891('0x1c')]}});};exports[_0xb891('0x1d')]=function(_0x5cd70a){return request(_0xb891('0x1e'),{'options':{'raw':![],'where':{'id':_0x5cd70a},'include':[{'model':'Interval','as':_0xb891('0x1f')}]}});};exports[_0xb891('0x20')]=function(_0x46ad5b){return request(_0xb891('0x21'),{'options':{'where':{'id':_0x46ad5b},'attributes':['id',_0xb891('0x6')]}});};exports[_0xb891('0x22')]=function(_0x14e936){return request(_0xb891('0x23'),{'body':_0x14e936});};exports[_0xb891('0x24')]=function(_0x2b50a7){return request(_0xb891('0x25'),{'body':_0x2b50a7});};exports[_0xb891('0x26')]=function(_0x5f5731){return request(_0xb891('0x27'),{'body':_[_0xb891('0x28')](_0x5f5731,{'project_name':_0x5f5731[_0xb891('0x29')],'prev_project_name':_0x5f5731['arg_2']||'','is_subproject':_0x5f5731[_0xb891('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0xb891('0x2b'))})});};exports[_0xb891('0x2c')]=function(_0x210ea4){return request(_0xb891('0x2d'),{'body':_0x210ea4});};exports[_0xb891('0x2e')]=function(_0x519f0c){return request('CreateSquareMessage',{'body':_0x519f0c});};exports[_0xb891('0x2f')]=function(_0x54f690){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x54f690[_0xb891('0x19')],'ListId':_0x54f690[_0xb891('0x30')]}}})[_0xb891('0x2')](function(_0x600154){if(_0x600154){return _0x600154;}return request(_0xb891('0x31'),{'body':_0x54f690});});};exports['getPauseById']=function(_0x2af0eb){return request('ShowPause',{'options':{'where':{'id':_0x2af0eb},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x32')]=function(_0x1f6bc8,_0x5adcbe){return request(_0xb891('0x33'),{'body':{'interface':_0x5adcbe},'options':{'where':_0x1f6bc8}});};exports['agentPause']=function(_0x489a73,_0x1d5e51,_0x3b0aeb){return request(_0xb891('0x34'),{'body':{'type':_0x1d5e51,'uniqueid':_0x3b0aeb},'options':{'where':_0x489a73}});};exports[_0xb891('0x35')]=function(_0x5a200d){return request(_0xb891('0x36'),{'body':{},'options':{'where':_0x5a200d}});};exports[_0xb891('0x37')]=function(_0x257f6e){return request(_0xb891('0x38'),{'body':{},'options':{'where':_0x257f6e}});}; \ 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 245f0d5..3dffaa3 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8be8=['./polly','./lex','exports'];(function(_0xa39e0a,_0x25f6a5){var _0x1f036a=function(_0x293cff){while(--_0x293cff){_0xa39e0a['push'](_0xa39e0a['shift']());}};_0x1f036a(++_0x25f6a5);}(_0x8be8,0xf6));var _0x88be=function(_0x45d9f1,_0x282339){_0x45d9f1=_0x45d9f1-0x0;var _0x421048=_0x8be8[_0x45d9f1];return _0x421048;};var polly=require(_0x88be('0x0'));var lex=require(_0x88be('0x1'));module[_0x88be('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x46e1=['./lex','exports','./polly'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x46e1,0x155));var _0x146e=function(_0x2af0f7,_0x420bff){_0x2af0f7=_0x2af0f7-0x0;var _0x22b6fb=_0x46e1[_0x2af0f7];return _0x22b6fb;};var polly=require(_0x146e('0x0'));var lex=require(_0x146e('0x1'));module[_0x146e('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index abfdc3d..22515b4 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 _0x4483=['exports','./lib/api'];(function(_0x502fda,_0x464a03){var _0x3aa971=function(_0x13b3dd){while(--_0x13b3dd){_0x502fda['push'](_0x502fda['shift']());}};_0x3aa971(++_0x464a03);}(_0x4483,0x1a3));var _0x3448=function(_0x379f13,_0x4e544a){_0x379f13=_0x379f13-0x0;var _0xac314e=_0x4483[_0x379f13];return _0xac314e;};'use strict';var lex=require(_0x3448('0x0'));module[_0x3448('0x1')]=function(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178){return lex(_0x229c0c,_0x481d0c,_0x202d3d,_0x1fe72d,_0x27ef60,_0x3a7178);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb){return lex(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb);}; \ 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 beb7c2e..99956f5 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(_0x10fc38,_0x55bb49){var _0x207c54=function(_0x259aab){while(--_0x259aab){_0x10fc38['push'](_0x10fc38['shift']());}};_0x207c54(++_0x55bb49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x454835,_0x1b784b){var _0x13264a=function(_0x2058aa){while(--_0x2058aa){_0x454835['push'](_0x454835['shift']());}};_0x13264a(++_0x1b784b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 2a2c709..e4981ab 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 _0x069b=['./lib/api'];(function(_0x21afd3,_0x299177){var _0x504a2f=function(_0x384d29){while(--_0x384d29){_0x21afd3['push'](_0x21afd3['shift']());}};_0x504a2f(++_0x299177);}(_0x069b,0x177));var _0xb069=function(_0x190c7f,_0x2f1129){_0x190c7f=_0x190c7f-0x0;var _0x12c1f6=_0x069b[_0x190c7f];return _0x12c1f6;};'use strict';var polly=require(_0xb069('0x0'));module['exports']=function(_0x518af5,_0x486547,_0x1d5038,_0x2e6e2d,_0x18438e,_0x3ff48b,_0x179f69){return polly(_0x518af5,_0x486547,_0x1d5038,_0x2e6e2d,_0x18438e,_0x3ff48b,_0x179f69);}; \ No newline at end of file +var _0x4da1=['exports','./lib/api'];(function(_0x51ab00,_0x3b4227){var _0x13ef94=function(_0xc33ddd){while(--_0xc33ddd){_0x51ab00['push'](_0x51ab00['shift']());}};_0x13ef94(++_0x3b4227);}(_0x4da1,0x85));var _0x14da=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4da1[_0x321bb2];return _0x9c12ed;};'use strict';var polly=require(_0x14da('0x0'));module[_0x14da('0x1')]=function(_0x58d65e,_0x2877ad,_0x58fafa,_0x22b72a,_0x54b337,_0x153298,_0x182fff){return polly(_0x58d65e,_0x2877ad,_0x58fafa,_0x22b72a,_0x54b337,_0x153298,_0x182fff);}; \ 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 6edad69..92a1f4d 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 _0xf42b=['aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0xf42b,0x80));var _0xbf42=function(_0x294ba2,_0x17be38){_0x294ba2=_0x294ba2-0x0;var _0xd857e6=_0xf42b[_0x294ba2];return _0xd857e6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xbf42('0x0'));var rs=require(_0xbf42('0x1'));var AWS=require(_0xbf42('0x2'));function pollyResult(_0x4d45f5,_0x189519,_0x151ecf){return new BPromise(function(_0x1e772f,_0x3e5375){_0x4d45f5['synthesizeSpeech'](_0x189519,function(_0x2fb637,_0x121f38){if(_0x2fb637){_0x3e5375(_0x2fb637);}else if(_0x121f38){if(_0x121f38[_0xbf42('0x3')]instanceof Buffer){fs[_0xbf42('0x4')](_0x151ecf,_0x121f38['AudioStream'],function(_0xdb6436){if(_0xdb6436){_0x3e5375(_0xdb6436);}else{_0x1e772f();}});}else{_0x3e5375(new Error(_0xbf42('0x5')));}}else{_0x3e5375(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xbf42('0x6')]=function(_0x444bac,_0x5332a0,_0x5864e5,_0x220dd3,_0x52360f,_0x1cfd1f,_0x4b9ba7){var _0x348649=new AWS[(_0xbf42('0x7'))]({'accessKeyId':_0x444bac,'secretAccessKey':_0x5332a0,'region':_0x5864e5});var _0x29588c={'Text':_0x52360f,'TextType':_0x1cfd1f||_0xbf42('0x8'),'OutputFormat':_0xbf42('0x9'),'VoiceId':_0x220dd3};return pollyResult(_0x348649,_0x29588c,_0x4b9ba7);}; \ No newline at end of file +var _0xf2f7=['mp3','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text'];(function(_0x1115f5,_0x137af2){var _0x20029b=function(_0x45698f){while(--_0x45698f){_0x1115f5['push'](_0x1115f5['shift']());}};_0x20029b(++_0x137af2);}(_0xf2f7,0x13c));var _0x7f2f=function(_0x27a5dd,_0x35cde6){_0x27a5dd=_0x27a5dd-0x0;var _0x523a2d=_0xf2f7[_0x27a5dd];return _0x523a2d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x7f2f('0x0'));var AWS=require('aws-sdk');function pollyResult(_0x266b55,_0x45cb0b,_0x8dd364){return new BPromise(function(_0x1d62db,_0x4bb232){_0x266b55[_0x7f2f('0x1')](_0x45cb0b,function(_0x140c29,_0x12469b){if(_0x140c29){_0x4bb232(_0x140c29);}else if(_0x12469b){if(_0x12469b[_0x7f2f('0x2')]instanceof Buffer){fs[_0x7f2f('0x3')](_0x8dd364,_0x12469b['AudioStream'],function(_0x52b580){if(_0x52b580){_0x4bb232(_0x52b580);}else{_0x1d62db();}});}else{_0x4bb232(new Error(_0x7f2f('0x4')));}}else{_0x4bb232(new Error(_0x7f2f('0x5')));}});});}module['exports']=function(_0x209441,_0x2926e7,_0x11d63f,_0x169cc9,_0x31a34f,_0x1c1ae2,_0x411efb){var _0x294fab=new AWS[(_0x7f2f('0x6'))]({'accessKeyId':_0x209441,'secretAccessKey':_0x2926e7,'region':_0x11d63f});var _0x18cdd2={'Text':_0x31a34f,'TextType':_0x1c1ae2||_0x7f2f('0x7'),'OutputFormat':_0x7f2f('0x8'),'VoiceId':_0x169cc9};return pollyResult(_0x294fab,_0x18cdd2,_0x411efb);}; \ 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 ee88bef..e35dfcd 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 _0x73ec=['./lib/api','exports'];(function(_0x16c1d9,_0x2a1270){var _0x85293b=function(_0x2c3479){while(--_0x2c3479){_0x16c1d9['push'](_0x16c1d9['shift']());}};_0x85293b(++_0x2a1270);}(_0x73ec,0x1a2));var _0xc73e=function(_0x1747b8,_0x29720f){_0x1747b8=_0x1747b8-0x0;var _0x39b3d6=_0x73ec[_0x1747b8];return _0x39b3d6;};'use strict';var asr=require(_0xc73e('0x0'));module[_0xc73e('0x1')]=function(_0x3d004b,_0x90b349,_0x32b091,_0x40efd4){return asr(_0x3d004b,_0x90b349,_0x32b091);}; \ No newline at end of file +var _0xe27f=['exports','./lib/api'];(function(_0x44f974,_0x4db616){var _0x805dbd=function(_0x1a56b7){while(--_0x1a56b7){_0x44f974['push'](_0x44f974['shift']());}};_0x805dbd(++_0x4db616);}(_0xe27f,0xbd));var _0xfe27=function(_0x4b4874,_0x230560){_0x4b4874=_0x4b4874-0x0;var _0x55b4a1=_0xe27f[_0x4b4874];return _0x55b4a1;};'use strict';var asr=require(_0xfe27('0x0'));module[_0xfe27('0x1')]=function(_0x3ec140,_0x1565b4,_0x4e378d,_0x254a0a){return asr(_0x3ec140,_0x1565b4,_0x4e378d);}; \ 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 2fb5982..dda54d2 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 _0xbd3b=['POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x455fea,_0x51f808){_0x455fea=_0x455fea-0x0;var _0x32f39b=_0xbd3b[_0x455fea];return _0x32f39b;};'use strict';var url=require(_0xbbd3('0x0'));var BPromise=require(_0xbbd3('0x1'));var fs=require('fs');var host=_0xbbd3('0x2');module['exports']=function(_0x5e9577,_0xe94b7b,_0x1cf5ef){return new BPromise(function(_0x13b296,_0x4e911b){var _0x173684;if(typeof _0x5e9577!==_0xbbd3('0x3')||_0x5e9577['length']===0x0){return _0x4e911b(_0xbbd3('0x4'));}if(typeof _0xe94b7b!=='string'||_0xe94b7b[_0xbbd3('0x5')]===0x0){return _0x4e911b(_0xbbd3('0x6'));}if(typeof _0x1cf5ef!==_0xbbd3('0x7')&&(typeof _0x1cf5ef!=='string'||_0x1cf5ef[_0xbbd3('0x5')]===0x0)){return _0x4e911b(_0xbbd3('0x8'));}try{_0x173684=fs[_0xbbd3('0x9')](_0x5e9577)[_0xbbd3('0xa')]('base64');}catch(_0xeade3a){return _0x4e911b(_0xeade3a);}return _0x13b296({'method':_0xbbd3('0xb'),'uri':host+_0xbbd3('0xc')+_0xe94b7b,'body':{'config':{'encoding':_0xbbd3('0xd'),'sampleRateHertz':'8000','languageCode':_0x1cf5ef},'audio':{'content':_0x173684}},'json':!![]});});}; \ No newline at end of file +var _0x9aea=['toString','base64','POST','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x9aea,0xdd));var _0xa9ae=function(_0x29d1f1,_0x53a1e7){_0x29d1f1=_0x29d1f1-0x0;var _0x4633d8=_0x9aea[_0x29d1f1];return _0x4633d8;};'use strict';var url=require(_0xa9ae('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xa9ae('0x1');module['exports']=function(_0x2b5e0c,_0x13679e,_0x563a24){return new BPromise(function(_0x414638,_0x115593){var _0x41fb71;if(typeof _0x2b5e0c!==_0xa9ae('0x2')||_0x2b5e0c[_0xa9ae('0x3')]===0x0){return _0x115593('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x13679e!==_0xa9ae('0x2')||_0x13679e[_0xa9ae('0x3')]===0x0){return _0x115593(_0xa9ae('0x4'));}if(typeof _0x563a24!=='undefined'&&(typeof _0x563a24!==_0xa9ae('0x2')||_0x563a24[_0xa9ae('0x3')]===0x0)){return _0x115593(_0xa9ae('0x5'));}try{_0x41fb71=fs[_0xa9ae('0x6')](_0x2b5e0c)[_0xa9ae('0x7')](_0xa9ae('0x8'));}catch(_0x1816c2){return _0x115593(_0x1816c2);}return _0x414638({'method':_0xa9ae('0x9'),'uri':host+_0xa9ae('0xa')+_0x13679e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa9ae('0xb'),'languageCode':_0x563a24},'audio':{'content':_0x41fb71}},'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 d90cc9c..4f5dbbe 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 _0xe3cd=['./asr','exports'];(function(_0x23f416,_0x402a72){var _0x572b5a=function(_0x3b1300){while(--_0x3b1300){_0x23f416['push'](_0x23f416['shift']());}};_0x572b5a(++_0x402a72);}(_0xe3cd,0x136));var _0xde3c=function(_0x101dcc,_0x2a3cf9){_0x101dcc=_0x101dcc-0x0;var _0x24ac96=_0xe3cd[_0x101dcc];return _0x24ac96;};var asr=require(_0xde3c('0x0'));module[_0xde3c('0x1')]={'asr':asr}; \ No newline at end of file +var _0x45bf=['exports','./asr'];(function(_0xcdf809,_0x2881f0){var _0x4d4d70=function(_0x277c61){while(--_0x277c61){_0xcdf809['push'](_0xcdf809['shift']());}};_0x4d4d70(++_0x2881f0);}(_0x45bf,0x16b));var _0xf45b=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x45bf[_0x587fb5];return _0x551105;};var asr=require(_0xf45b('0x0'));module[_0xf45b('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 252f8b5..a22aa64 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 _0xa42b=['error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','finish\x20download\x20file','close','unlink','pipe','end','host','transcode','finish\x20to\x20convert','start','resolve','tmp','.wav','base64','then','chmodSync','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','generate','.mp3','from','audioContent','writeFile','777','split','googleTTS','POST','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','textRequest','result','source','action','fulfillment','speech','score','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','CustomAction','channelData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','get','statusCode'];(function(_0x7f1f41,_0xe619cb){var _0x3cb836=function(_0x98ea5b){while(--_0x98ea5b){_0x7f1f41['push'](_0x7f1f41['shift']());}};_0x3cb836(++_0xe619cb);}(_0xa42b,0x16e));var _0xba42=function(_0x307bba,_0xa8d407){_0x307bba=_0x307bba-0x0;var _0x1cd54=_0xa42b[_0x307bba];return _0x1cd54;};'use strict';var apiai=require(_0xba42('0x0'));var BPromise=require(_0xba42('0x1'));var dialogflow=require(_0xba42('0x2'));var fs=require('fs');var http=require(_0xba42('0x3'));var https=require(_0xba42('0x4'));var md5=require('md5');var path=require(_0xba42('0x5'));var querystring=require(_0xba42('0x6'));var rp=require(_0xba42('0x7'));var rs=require(_0xba42('0x8'));var sox=require(_0xba42('0x9'));var tts=require(_0xba42('0xa'));var urlParse=require(_0xba42('0xb'))[_0xba42('0xc')];var util=require(_0xba42('0xd'));var aws=require(_0xba42('0xe'));var google=require('./google');var sestek=require(_0xba42('0xf'));var tilde=require(_0xba42('0x10'));var logger=require(_0xba42('0x11'))(_0xba42('0x12'));var ISPEECH_API=_0xba42('0x13');function downloadFile(_0x5c69f2,_0x3cc6d7){return new BPromise(function(_0x177dc1,_0x215e55){var _0x5b73cf=urlParse(_0x5c69f2);var _0x4d659b=_0x5b73cf[_0xba42('0x14')]===_0xba42('0x15')?https:http;var _0x2d63d2={'host':_0x5b73cf['host'],'path':_0x5b73cf[_0xba42('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4d659b[_0xba42('0x16')](_0x2d63d2,function(_0x400385){if(_0x400385[_0xba42('0x17')]!==0xc8){logger[_0xba42('0x18')](_0xba42('0x19')+_0x5c69f2+'\x20failed,\x20status\x20code\x20=\x20'+_0x400385['statusCode']+'\x20('+_0x400385[_0xba42('0x1a')]+')');_0x215e55(new Error('request\x20to\x20'+_0x5c69f2+_0xba42('0x1b')+_0x400385[_0xba42('0x17')]+'\x20('+_0x400385[_0xba42('0x1a')]+')'));return;}var _0x366fc5=fs['createWriteStream'](_0x3cc6d7);_0x366fc5['on'](_0xba42('0x1c'),function(){logger[_0xba42('0x1d')](_0xba42('0x1e'));_0x366fc5[_0xba42('0x1f')](_0x177dc1);});_0x366fc5['on'](_0xba42('0x18'),function(_0x4ac67c){fs[_0xba42('0x20')](_0x3cc6d7);logger[_0xba42('0x18')]('download\x20error',_0x4ac67c);_0x215e55(_0x4ac67c);});_0x400385[_0xba42('0x21')](_0x366fc5);})['on']('error',function(_0xc4ad72){logger['error'](_0xc4ad72);_0x215e55(_0xc4ad72);})[_0xba42('0x22')]();});}function uploadFile(_0x2ac4d0){return new BPromise(function(_0x44e3be,_0x4015a7){var _0x1cdda7=urlParse(_0x2ac4d0);var _0x5d8be5=_0x1cdda7[_0xba42('0x14')]===_0xba42('0x15')?https:http;var _0x1b367f={'host':_0x1cdda7[_0xba42('0x23')],'path':_0x1cdda7['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x5d8be5[_0xba42('0x16')](_0x1b367f,function(_0xe06562){if(_0xe06562[_0xba42('0x17')]!==0xc8){_0x4015a7(new Error(_0xba42('0x19')+_0x2ac4d0+_0xba42('0x1b')+_0xe06562['statusCode']+'\x20('+_0xe06562[_0xba42('0x1a')]+')'));return;}var _0xe12b66='';_0xe06562['on']('data',function(_0xedf2b0){_0xe12b66+=_0xedf2b0;});_0xe06562['on'](_0xba42('0x22'),function(){_0x44e3be(_0xe12b66);});})['on'](_0xba42('0x18'),function(_0x4b4204){_0x4015a7(_0x4b4204);})[_0xba42('0x22')]();});}function convertFile(_0x3e749f,_0x650511){return new BPromise(function(_0xe8baeb,_0x511ab5){var _0x137d49=sox[_0xba42('0x24')](_0x3e749f,_0x650511,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x137d49['on'](_0xba42('0x18'),function(_0x2f8c52){logger[_0xba42('0x18')]('error\x20convert',_0x2f8c52);_0x511ab5(_0x2f8c52);});_0x137d49['on'](_0xba42('0x22'),function(){logger[_0xba42('0x1d')](_0xba42('0x25'));_0xe8baeb();});_0x137d49[_0xba42('0x26')]();});}function base64Decode(_0x1435d0,_0x1993e3){var _0x1b93c7=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs['generate'](0x4)+_0xba42('0x29'));fs['writeFileSync'](_0x1b93c7,_0x1435d0,_0xba42('0x2a'));return convertFile(_0x1b93c7,_0x1993e3)[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x1b93c7);fs[_0xba42('0x2c')](_0x1993e3,'777');}catch(_0x182d0f){logger['error'](_0x182d0f);}return _0x1993e3['split']('.')[0x0];});}function base64Encode(_0x333076){var _0x12bf52=fs[_0xba42('0x2d')](_0x333076);return new Buffer(_0x12bf52)[_0xba42('0x2e')](_0xba42('0x2a'));}exports[_0xba42('0x2f')]=function(_0xf6125a,_0x26eb09,_0x28c331,_0x38a76b,_0x241b7c,_0x2d198b){var _0x4408b2,_0x57974c;var _0x366814=_0xba42('0x30');var _0x5d3f5d=_0xba42('0x31')+_0xf6125a;var _0x3284af={};if(_0x26eb09===_0xba42('0x32')){_0x3284af[_0xba42('0x33')]={'ssml':_0x28c331};}else{_0x3284af['input']={'text':_0x28c331};};_0x3284af[_0xba42('0x34')]={'languageCode':_0x38a76b,'ssmlGender':_0x241b7c};_0x3284af[_0xba42('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x1b8662={'url':_0x366814+'text:synthesize'+_0x5d3f5d,'method':'POST','json':!![],'body':_0x3284af};return rp(_0x1b8662)['then'](function(_0x257068){return new BPromise(function(_0x5169ca,_0x302eda){_0x4408b2=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x37'));var _0x4dc2d8=Buffer[_0xba42('0x38')](_0x257068[_0xba42('0x39')],'base64');return fs[_0xba42('0x3a')](_0x4408b2,_0x4dc2d8,function(_0x1cbeb4){_0x302eda(_0x1cbeb4);},function(_0x17c9bd){fs['chmodSync'](_0x4408b2,_0xba42('0x3b'));_0x5169ca(_0x17c9bd);});});})[_0xba42('0x2b')](function(_0x4d3ac5){_0x57974c=path['resolve'](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x29'));return convertFile(_0x4408b2,_0x57974c);})[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x4408b2);fs['chmodSync'](_0x57974c,_0xba42('0x3b'));}catch(_0x5903b3){logger[_0xba42('0x18')](_0x5903b3);}logger[_0xba42('0x1d')]('googleCloudTTS\x20path',_0x57974c[_0xba42('0x3c')]('.')[0x0]);return _0x57974c[_0xba42('0x3c')]('.')[0x0];});};exports[_0xba42('0x3d')]=function(_0x2b1ba2,_0x5c4264){var _0xf0d8b8='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x413c40,_0x1295d6;var _0x1e7fd4;var _0x44d89a={'encoding':'utf8','method':_0xba42('0x3e'),'timeout':0x2710,'url':_0xf0d8b8,'headers':{'Content-Type':_0xba42('0x3f')},'body':_0xba42('0x40')+encodeURIComponent(JSON[_0xba42('0x41')]([[['jQ1olc',JSON[_0xba42('0x41')]([_0x2b1ba2,_0x5c4264||'en',![],_0xba42('0x42')]),null,_0xba42('0x43')]]]))};return rp(_0x44d89a)[_0xba42('0x2b')](function(_0x14ad35){try{_0x1e7fd4=eval(_0x14ad35[_0xba42('0x44')](0x5))[0x0][0x2];}catch(_0x3b421a){throw new Error('parse\x20response\x20failed:\x0a'+_0x14ad35[_0xba42('0x45')]);}if(!_0x1e7fd4){if(_0x2b1ba2[_0xba42('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xba42('0x47')+_0x5c4264+_0xba42('0x48'));}}try{_0x1e7fd4=eval(_0x1e7fd4)[0x0];}catch(_0x43f452){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0xb53620=_0x1e7fd4;_0x413c40=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x37'));fs[_0xba42('0x49')](_0x413c40,_0x1e7fd4,{'encoding':'base64'});_0x1295d6=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xba42('0x29'));return convertFile(_0x413c40,_0x1295d6);})[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x413c40);fs[_0xba42('0x2c')](_0x1295d6,_0xba42('0x3b'));}catch(_0x16d028){logger[_0xba42('0x18')](_0x16d028);}logger[_0xba42('0x1d')](_0xba42('0x4a'),_0x1295d6[_0xba42('0x3c')]('.')[0x0]);return _0x1295d6[_0xba42('0x3c')]('.')[0x0];});};exports[_0xba42('0x4b')]=function(_0x58e61c,_0x1075c3,_0x59c661){return google[_0xba42('0x4c')](_0x58e61c,_0x1075c3,_0x59c661)['then'](function(_0x4e71cc){logger[_0xba42('0x1d')](_0x4e71cc['uri']);return rp(_0x4e71cc);})[_0xba42('0x2b')](function(_0x27723a){var _0x18b3da='';var _0x27e83b=0x0;try{fs[_0xba42('0x20')](_0x58e61c);}catch(_0x27323d){logger['error'](_0x27323d);}if(_0x27723a&&_0x27723a['results']){_0x18b3da=_0x27723a[_0xba42('0x4d')]['map'](function(_0x3a2cf8){return _0x3a2cf8&&_0x3a2cf8[_0xba42('0x4e')][0x0]&&_0x3a2cf8[_0xba42('0x4e')][0x0][_0xba42('0x4f')]?_0x3a2cf8['alternatives'][0x0][_0xba42('0x4f')]:'';})['join']('\x0a');_0x27e83b=_0x27723a['results']['map'](function(_0x428cc9){return _0x428cc9&&_0x428cc9[_0xba42('0x4e')][0x0]&&_0x428cc9[_0xba42('0x4e')][0x0][_0xba42('0x50')]?_0x428cc9['alternatives'][0x0]['confidence']:0x0;})[_0xba42('0x51')]('\x0a');}logger[_0xba42('0x1d')](_0xba42('0x52'),_0x18b3da);logger[_0xba42('0x1d')](_0xba42('0x53'),_0x27e83b);return{'transcript':_0x18b3da,'confidence':_0x27e83b};})[_0xba42('0x54')](function(_0x39f134){logger[_0xba42('0x18')]('[%s]\x20%s:%s',_0x39f134['statusCode'],_0x39f134[_0xba42('0x55')],_0x39f134[_0xba42('0x56')]);});};exports['googleDialogflow']=function(_0xff4649,_0x34c7de,_0x82ca9,_0x1844ae){var _0x1b3219=apiai(_0x34c7de,{'language':_0x1844ae||'en'});return _0x1b3219[_0xba42('0x57')](_0x82ca9,{'sessionId':md5(_0xff4649)})['then'](function(_0x132330){logger['info'](JSON['stringify'](_0x132330));return{'source':_0x132330[_0xba42('0x58')][_0xba42('0x59')],'resolvedQuery':_0x132330[_0xba42('0x58')]['resolvedQuery'],'action':_0x132330[_0xba42('0x58')][_0xba42('0x5a')],'actionIncomplete':_0x132330[_0xba42('0x58')]['actionIncomplete'],'speech':_0x132330['result'][_0xba42('0x5b')][_0xba42('0x5c')],'score':_0x132330['result'][_0xba42('0x5d')],'statusCode':_0x132330['status']['code'],'endConversation':_0x132330[_0xba42('0x58')][_0xba42('0x5e')][_0xba42('0x5f')]||![],'isFallbackIntent':_0x132330['result']['metadata'][_0xba42('0x60')]};});};exports[_0xba42('0x61')]=function(_0x17c2d1,_0x2c6db5,_0xd48009,_0x270bfe,_0x9f30dc,_0x54dd22){var _0x1bbdb7=_0x270bfe[_0xba42('0x62')](/\\n/g,'\x0a');var _0x1b512f={'credentials':{'private_key':_0x1bbdb7,'client_email':_0xd48009}};var _0xea878a=new dialogflow[(_0xba42('0x63'))](_0x1b512f);var _0x5d7ed3=_0xea878a[_0xba42('0x64')](_0x2c6db5,md5(_0x17c2d1));var _0xd73c57={'session':_0x5d7ed3,'queryInput':{'text':{'text':_0x9f30dc,'languageCode':_0x54dd22}}};return _0xea878a[_0xba42('0x65')](_0xd73c57)[_0xba42('0x2b')](function(_0x501e2a){if(_0x501e2a&&_0x501e2a[_0xba42('0x46')]){logger[_0xba42('0x1d')]('Dialogflow\x20V2\x20response:',JSON[_0xba42('0x41')](_0x501e2a));var _0xb4ec76=_0x501e2a[0x0];if(_0xb4ec76){var _0x9a0502={'action':_0xb4ec76[_0xba42('0x66')][_0xba42('0x5a')],'allRequiredParamsPresent':_0xb4ec76[_0xba42('0x66')]['allRequiredParamsPresent'],'endConversation':_0xb4ec76[_0xba42('0x66')]['diagnosticInfo']&&_0xb4ec76[_0xba42('0x66')][_0xba42('0x67')][_0xba42('0x68')]?_0xb4ec76[_0xba42('0x66')][_0xba42('0x67')][_0xba42('0x68')][_0xba42('0x69')][_0xba42('0x6a')]:![],'fulfillmentText':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6b')],'intentName':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6c')][_0xba42('0x55')],'intentDisplayName':_0xb4ec76[_0xba42('0x66')]['intent'][_0xba42('0x6d')],'isFallbackIntent':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6c')]['isFallback'],'languageCode':_0xb4ec76['queryResult'][_0xba42('0x6e')],'queryText':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6f')],'responseId':_0xb4ec76['responseId'],'score':_0xb4ec76['queryResult'][_0xba42('0x70')],'speech':_0xb4ec76[_0xba42('0x66')][_0xba42('0x6b')],'providerResponse':JSON['stringify'](_0x501e2a)};return _0x9a0502;}}});};exports[_0xba42('0x71')]=function(_0x586670,_0x2ad7f9,_0x21bf74,_0x1637d0){return tilde[_0xba42('0x4c')](_0x586670,_0x2ad7f9,_0x21bf74,_0x1637d0)[_0xba42('0x2b')](function(_0x25686f){try{fs[_0xba42('0x20')](_0x586670);}catch(_0x5ae693){logger[_0xba42('0x18')](_0x5ae693);}logger['info'](_0xba42('0x72'),_0x25686f[_0xba42('0x4f')]);logger[_0xba42('0x1d')](_0xba42('0x73'),_0x25686f['confidence']);return _0x25686f;});};exports[_0xba42('0x74')]=function(_0x51d5b3,_0x428906,_0x1d0de0,_0x4bf36f,_0x4c3831,_0x4e37f4){var _0x453176=path[_0xba42('0x27')](__dirname,'tmp',rs[_0xba42('0x36')](0x4)+_0xba42('0x37'));var _0x40ceb1;return aws['polly'](_0x51d5b3,_0x428906,_0x1d0de0,_0x4bf36f,_0x4c3831,_0x4e37f4,_0x453176)[_0xba42('0x2b')](function(){_0x40ceb1=path[_0xba42('0x27')](__dirname,_0xba42('0x28'),rs[_0xba42('0x36')](0x4)+_0xba42('0x29'));return convertFile(_0x453176,_0x40ceb1);})[_0xba42('0x2b')](function(){try{fs[_0xba42('0x20')](_0x453176);fs[_0xba42('0x2c')](_0x40ceb1,'777');}catch(_0x1824b9){logger[_0xba42('0x18')](_0x1824b9);}return _0x40ceb1[_0xba42('0x3c')]('.')[0x0];});};exports[_0xba42('0x75')]=function(_0x328feb,_0x199a35,_0x28678d,_0x5b7333,_0x16bd61,_0x1d8437){return aws[_0xba42('0x76')](_0x328feb,_0x199a35,_0x28678d,_0x5b7333,_0x16bd61,_0x1d8437)['then'](function(_0x177f59){logger['info'](JSON[_0xba42('0x41')](_0x177f59));return _0x177f59;});};exports[_0xba42('0x77')]=function(_0x521a21,_0x413f6e,_0x299b33,_0x5303a6){var _0x4f30f9=util[_0xba42('0x78')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x521a21,encodeURIComponent(_0x413f6e),_0x299b33,_0x5303a6);var _0x3eb054=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xba42('0x37'));var _0x341195;return downloadFile(_0x4f30f9,_0x3eb054)[_0xba42('0x2b')](function(){_0x341195=path[_0xba42('0x27')](__dirname,'tmp',rs[_0xba42('0x36')](0x4)+_0xba42('0x29'));return convertFile(_0x3eb054,_0x341195);})[_0xba42('0x2b')](function(){try{fs['unlink'](_0x3eb054);fs[_0xba42('0x2c')](_0x341195,_0xba42('0x3b'));}catch(_0x480f50){logger[_0xba42('0x18')](_0x480f50);}return _0x341195['split']('.')[0x0];});};exports['ispeechASR']=function(_0x25853b,_0x17dbcb,_0x255ae5,_0xc6a7e){var _0x3f1467=util[_0xba42('0x78')](_0xba42('0x79'),ISPEECH_API,_0x17dbcb,_0x255ae5,base64Encode(_0x25853b),_0xc6a7e?util[_0xba42('0x78')](_0xba42('0x7a'),encodeURIComponent(_0xc6a7e)):'freeform=3');return uploadFile(_0x3f1467)['then'](function(_0x2dcef6){return querystring[_0xba42('0xc')](_0x2dcef6);});};exports[_0xba42('0x7b')]=function(_0x1ab3df,_0x223ac6){return sestek['nda'](_0x1ab3df,_0x223ac6)[_0xba42('0x2b')](function(_0x45ca41){logger[_0xba42('0x1d')](JSON[_0xba42('0x41')](_0x45ca41));var _0x10dc4e={'speech':_0x45ca41[_0xba42('0x7c')],'action':_0x45ca41['channelData']?_0x45ca41['channelData'][_0xba42('0x7d')]:undefined,'actiondata':_0x45ca41[_0xba42('0x7e')]?_0x45ca41['channelData']['CustomActionData']:undefined};if(_0x45ca41[_0xba42('0x7e')]&&_0x45ca41[_0xba42('0x7e')][_0xba42('0x7f')]){return base64Decode(_0x45ca41[_0xba42('0x7e')]['AudioFromTts'][_0xba42('0x80')],path[_0xba42('0x27')](__dirname,'tmp',rs[_0xba42('0x36')](0x4)+'.wav'))[_0xba42('0x2b')](function(_0x54cd11){_0x10dc4e['audiofile']=_0x54cd11;return _0x10dc4e;});}return _0x10dc4e;});};exports[_0xba42('0x81')]=function(){return __dirname;}; \ No newline at end of file +var _0x143d=['util','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','pipe','end','protocol','https:','host','statusMessage','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','input','audioConfig','MP3','text:synthesize','.mp3','from','writeFile','then','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','catch','name','message','googleDialogflow','textRequest','source','result','fulfillment','speech','code','metadata','endConversation','googleDialogflowV2','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','request-promise','randomstring','sox','google-tts-api','url'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x143d,0x103));var _0xd143=function(_0x210b93,_0x133e6d){_0x210b93=_0x210b93-0x0;var _0x2b020f=_0x143d[_0x210b93];return _0x2b020f;};'use strict';var apiai=require(_0xd143('0x0'));var BPromise=require(_0xd143('0x1'));var dialogflow=require(_0xd143('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xd143('0x3'));var md5=require(_0xd143('0x4'));var path=require(_0xd143('0x5'));var querystring=require('querystring');var rp=require(_0xd143('0x6'));var rs=require(_0xd143('0x7'));var sox=require(_0xd143('0x8'));var tts=require(_0xd143('0x9'));var urlParse=require(_0xd143('0xa'))['parse'];var util=require(_0xd143('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0xd143('0xc'));var tilde=require(_0xd143('0xd'));var logger=require(_0xd143('0xe'))('agi');var ISPEECH_API=_0xd143('0xf');function downloadFile(_0xbc00f6,_0x4eae2f){return new BPromise(function(_0x37ec6a,_0x3f268a){var _0x13e6fb=urlParse(_0xbc00f6);var _0x532cc0=_0x13e6fb['protocol']==='https:'?https:http;var _0x1c2a23={'host':_0x13e6fb['host'],'path':_0x13e6fb['path'],'headers':{'user-agent':_0xd143('0x10')}};_0x532cc0[_0xd143('0x11')](_0x1c2a23,function(_0x12ec6c){if(_0x12ec6c[_0xd143('0x12')]!==0xc8){logger[_0xd143('0x13')](_0xd143('0x14')+_0xbc00f6+_0xd143('0x15')+_0x12ec6c[_0xd143('0x12')]+'\x20('+_0x12ec6c['statusMessage']+')');_0x3f268a(new Error(_0xd143('0x14')+_0xbc00f6+'\x20failed,\x20status\x20code\x20=\x20'+_0x12ec6c[_0xd143('0x12')]+'\x20('+_0x12ec6c['statusMessage']+')'));return;}var _0x507c03=fs[_0xd143('0x16')](_0x4eae2f);_0x507c03['on'](_0xd143('0x17'),function(){logger[_0xd143('0x18')](_0xd143('0x19'));_0x507c03['close'](_0x37ec6a);});_0x507c03['on']('error',function(_0x425812){fs['unlink'](_0x4eae2f);logger['error']('download\x20error',_0x425812);_0x3f268a(_0x425812);});_0x12ec6c[_0xd143('0x1a')](_0x507c03);})['on']('error',function(_0x2ce283){logger[_0xd143('0x13')](_0x2ce283);_0x3f268a(_0x2ce283);})[_0xd143('0x1b')]();});}function uploadFile(_0x1c34ec){return new BPromise(function(_0x42b5dd,_0x1571ae){var _0x2d4a6d=urlParse(_0x1c34ec);var _0x2331ff=_0x2d4a6d[_0xd143('0x1c')]===_0xd143('0x1d')?https:http;var _0x50b61a={'host':_0x2d4a6d[_0xd143('0x1e')],'path':_0x2d4a6d[_0xd143('0x5')],'headers':{'user-agent':_0xd143('0x10')}};_0x2331ff[_0xd143('0x11')](_0x50b61a,function(_0x46724b){if(_0x46724b[_0xd143('0x12')]!==0xc8){_0x1571ae(new Error('request\x20to\x20'+_0x1c34ec+'\x20failed,\x20status\x20code\x20=\x20'+_0x46724b[_0xd143('0x12')]+'\x20('+_0x46724b[_0xd143('0x1f')]+')'));return;}var _0x4ee72f='';_0x46724b['on'](_0xd143('0x20'),function(_0x244cc3){_0x4ee72f+=_0x244cc3;});_0x46724b['on']('end',function(){_0x42b5dd(_0x4ee72f);});})['on'](_0xd143('0x13'),function(_0x4a418e){_0x1571ae(_0x4a418e);})['end']();});}function convertFile(_0x3ad51e,_0x108c0f){return new BPromise(function(_0x127554,_0x35c424){var _0x36a2e0=sox['transcode'](_0x3ad51e,_0x108c0f,{'sampleRate':0x1f40,'format':_0xd143('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36a2e0['on']('error',function(_0x527795){logger[_0xd143('0x13')](_0xd143('0x22'),_0x527795);_0x35c424(_0x527795);});_0x36a2e0['on'](_0xd143('0x1b'),function(){logger['info'](_0xd143('0x23'));_0x127554();});_0x36a2e0[_0xd143('0x24')]();});}function base64Decode(_0x95763a,_0x21100d){var _0x4a26a3=path[_0xd143('0x25')](__dirname,_0xd143('0x26'),rs[_0xd143('0x27')](0x4)+_0xd143('0x28'));fs[_0xd143('0x29')](_0x4a26a3,_0x95763a,_0xd143('0x2a'));return convertFile(_0x4a26a3,_0x21100d)['then'](function(){try{fs[_0xd143('0x2b')](_0x4a26a3);fs[_0xd143('0x2c')](_0x21100d,_0xd143('0x2d'));}catch(_0x45ed56){logger[_0xd143('0x13')](_0x45ed56);}return _0x21100d[_0xd143('0x2e')]('.')[0x0];});}function base64Encode(_0x4ff1ba){var _0x29683d=fs[_0xd143('0x2f')](_0x4ff1ba);return new Buffer(_0x29683d)[_0xd143('0x30')]('base64');}exports[_0xd143('0x31')]=function(_0x2dbae0,_0x775a49,_0x15ed64,_0x87fd32,_0x33df08,_0x3aaf33){var _0x263abd,_0x560e8c;var _0x235cb4='https://texttospeech.googleapis.com/v1/';var _0x9076d4=_0xd143('0x32')+_0x2dbae0;var _0x3d70da={};if(_0x775a49==='ssml'){_0x3d70da[_0xd143('0x33')]={'ssml':_0x15ed64};}else{_0x3d70da[_0xd143('0x33')]={'text':_0x15ed64};};_0x3d70da['voice']={'languageCode':_0x87fd32,'ssmlGender':_0x33df08};_0x3d70da[_0xd143('0x34')]={'audioEncoding':_0xd143('0x35'),'sampleRateHertz':0x1f40};var _0x331f34={'url':_0x235cb4+_0xd143('0x36')+_0x9076d4,'method':'POST','json':!![],'body':_0x3d70da};return rp(_0x331f34)['then'](function(_0xca0458){return new BPromise(function(_0x78c384,_0x5bf594){_0x263abd=path[_0xd143('0x25')](__dirname,_0xd143('0x26'),rs['generate'](0x4)+_0xd143('0x37'));var _0x321e4a=Buffer[_0xd143('0x38')](_0xca0458['audioContent'],_0xd143('0x2a'));return fs[_0xd143('0x39')](_0x263abd,_0x321e4a,function(_0x359ae5){_0x5bf594(_0x359ae5);},function(_0x199579){fs[_0xd143('0x2c')](_0x263abd,_0xd143('0x2d'));_0x78c384(_0x199579);});});})[_0xd143('0x3a')](function(_0x574516){_0x560e8c=path[_0xd143('0x25')](__dirname,'tmp',rs[_0xd143('0x27')](0x4)+_0xd143('0x28'));return convertFile(_0x263abd,_0x560e8c);})['then'](function(){try{fs[_0xd143('0x2b')](_0x263abd);fs['chmodSync'](_0x560e8c,_0xd143('0x2d'));}catch(_0x203f6a){logger[_0xd143('0x13')](_0x203f6a);}logger[_0xd143('0x18')](_0xd143('0x3b'),_0x560e8c[_0xd143('0x2e')]('.')[0x0]);return _0x560e8c[_0xd143('0x2e')]('.')[0x0];});};exports['googleTTS']=function(_0x5cb153,_0x50321a){var _0x144a32=_0xd143('0x3c');var _0x1e2167,_0x3c4a9b;var _0x68e0fb;var _0x293f4d={'encoding':_0xd143('0x3d'),'method':_0xd143('0x3e'),'timeout':0x2710,'url':_0x144a32,'headers':{'Content-Type':_0xd143('0x3f')},'body':_0xd143('0x40')+encodeURIComponent(JSON[_0xd143('0x41')]([[[_0xd143('0x42'),JSON[_0xd143('0x41')]([_0x5cb153,_0x50321a||'en',![],_0xd143('0x43')]),null,_0xd143('0x44')]]]))};return rp(_0x293f4d)[_0xd143('0x3a')](function(_0xfc12fa){try{_0x68e0fb=eval(_0xfc12fa['slice'](0x5))[0x0][0x2];}catch(_0x34a947){throw new Error(_0xd143('0x45')+_0xfc12fa[_0xd143('0x20')]);}if(!_0x68e0fb){if(_0x5cb153[_0xd143('0x46')]>0xc8){throw new Error(_0xd143('0x47'));}else{throw new Error(_0xd143('0x48')+_0x50321a+_0xd143('0x49'));}}try{_0x68e0fb=eval(_0x68e0fb)[0x0];}catch(_0x32bb54){throw new Error(_0xd143('0x45')+res['data']);}const _0x78489a=_0x68e0fb;_0x1e2167=path[_0xd143('0x25')](__dirname,_0xd143('0x26'),rs['generate'](0x4)+_0xd143('0x37'));fs['writeFileSync'](_0x1e2167,_0x68e0fb,{'encoding':_0xd143('0x2a')});_0x3c4a9b=path[_0xd143('0x25')](__dirname,'tmp',rs[_0xd143('0x27')](0x4)+_0xd143('0x28'));return convertFile(_0x1e2167,_0x3c4a9b);})['then'](function(){try{fs['unlink'](_0x1e2167);fs['chmodSync'](_0x3c4a9b,_0xd143('0x2d'));}catch(_0x264ee6){logger[_0xd143('0x13')](_0x264ee6);}logger['info']('goggleTTS\x20path',_0x3c4a9b[_0xd143('0x2e')]('.')[0x0]);return _0x3c4a9b[_0xd143('0x2e')]('.')[0x0];});};exports[_0xd143('0x4a')]=function(_0x73b9bd,_0x88c1f7,_0x53feb3){return google[_0xd143('0x4b')](_0x73b9bd,_0x88c1f7,_0x53feb3)[_0xd143('0x3a')](function(_0x33cb39){logger[_0xd143('0x18')](_0x33cb39[_0xd143('0x4c')]);return rp(_0x33cb39);})['then'](function(_0x3fa550){var _0x86342a='';var _0x2053bf=0x0;try{fs[_0xd143('0x2b')](_0x73b9bd);}catch(_0x12fbb7){logger[_0xd143('0x13')](_0x12fbb7);}if(_0x3fa550&&_0x3fa550[_0xd143('0x4d')]){_0x86342a=_0x3fa550[_0xd143('0x4d')][_0xd143('0x4e')](function(_0x32c151){return _0x32c151&&_0x32c151[_0xd143('0x4f')][0x0]&&_0x32c151[_0xd143('0x4f')][0x0][_0xd143('0x50')]?_0x32c151['alternatives'][0x0][_0xd143('0x50')]:'';})[_0xd143('0x51')]('\x0a');_0x2053bf=_0x3fa550[_0xd143('0x4d')]['map'](function(_0xc93404){return _0xc93404&&_0xc93404[_0xd143('0x4f')][0x0]&&_0xc93404[_0xd143('0x4f')][0x0][_0xd143('0x52')]?_0xc93404['alternatives'][0x0][_0xd143('0x52')]:0x0;})['join']('\x0a');}logger[_0xd143('0x18')]('googleASR\x20transcription',_0x86342a);logger[_0xd143('0x18')]('googleASR\x20confidence',_0x2053bf);return{'transcript':_0x86342a,'confidence':_0x2053bf};})[_0xd143('0x53')](function(_0x5623e2){logger[_0xd143('0x13')]('[%s]\x20%s:%s',_0x5623e2['statusCode'],_0x5623e2[_0xd143('0x54')],_0x5623e2[_0xd143('0x55')]);});};exports[_0xd143('0x56')]=function(_0x24b2b4,_0x349337,_0x396a32,_0x27a324){var _0x3cdc7d=apiai(_0x349337,{'language':_0x27a324||'en'});return _0x3cdc7d[_0xd143('0x57')](_0x396a32,{'sessionId':md5(_0x24b2b4)})[_0xd143('0x3a')](function(_0x1f32dd){logger['info'](JSON[_0xd143('0x41')](_0x1f32dd));return{'source':_0x1f32dd['result'][_0xd143('0x58')],'resolvedQuery':_0x1f32dd[_0xd143('0x59')]['resolvedQuery'],'action':_0x1f32dd[_0xd143('0x59')]['action'],'actionIncomplete':_0x1f32dd[_0xd143('0x59')]['actionIncomplete'],'speech':_0x1f32dd[_0xd143('0x59')][_0xd143('0x5a')][_0xd143('0x5b')],'score':_0x1f32dd[_0xd143('0x59')]['score'],'statusCode':_0x1f32dd['status'][_0xd143('0x5c')],'endConversation':_0x1f32dd[_0xd143('0x59')][_0xd143('0x5d')][_0xd143('0x5e')]||![],'isFallbackIntent':_0x1f32dd['result'][_0xd143('0x5d')]['isFallbackIntent']};});};exports[_0xd143('0x5f')]=function(_0x2ab314,_0x222ab2,_0x275ccb,_0x4f8fa8,_0x44b82d,_0x1ceaea){var _0x50e95a=_0x4f8fa8['replace'](/\\n/g,'\x0a');var _0x14edfe={'credentials':{'private_key':_0x50e95a,'client_email':_0x275ccb}};var _0x41db2f=new dialogflow['SessionsClient'](_0x14edfe);var _0x3d28a5=_0x41db2f['sessionPath'](_0x222ab2,md5(_0x2ab314));var _0x1482dd={'session':_0x3d28a5,'queryInput':{'text':{'text':_0x44b82d,'languageCode':_0x1ceaea}}};return _0x41db2f[_0xd143('0x60')](_0x1482dd)[_0xd143('0x3a')](function(_0xefa7e7){if(_0xefa7e7&&_0xefa7e7[_0xd143('0x46')]){logger[_0xd143('0x18')](_0xd143('0x61'),JSON[_0xd143('0x41')](_0xefa7e7));var _0x44e948=_0xefa7e7[0x0];if(_0x44e948){var _0x49bd76={'action':_0x44e948[_0xd143('0x62')][_0xd143('0x63')],'allRequiredParamsPresent':_0x44e948['queryResult'][_0xd143('0x64')],'endConversation':_0x44e948[_0xd143('0x62')][_0xd143('0x65')]&&_0x44e948[_0xd143('0x62')][_0xd143('0x65')]['fields']?_0x44e948[_0xd143('0x62')]['diagnosticInfo'][_0xd143('0x66')][_0xd143('0x67')][_0xd143('0x68')]:![],'fulfillmentText':_0x44e948['queryResult'][_0xd143('0x69')],'intentName':_0x44e948['queryResult'][_0xd143('0x6a')][_0xd143('0x54')],'intentDisplayName':_0x44e948[_0xd143('0x62')]['intent'][_0xd143('0x6b')],'isFallbackIntent':_0x44e948['queryResult'][_0xd143('0x6a')][_0xd143('0x6c')],'languageCode':_0x44e948[_0xd143('0x62')][_0xd143('0x6d')],'queryText':_0x44e948[_0xd143('0x62')][_0xd143('0x6e')],'responseId':_0x44e948[_0xd143('0x6f')],'score':_0x44e948['queryResult'][_0xd143('0x70')],'speech':_0x44e948[_0xd143('0x62')][_0xd143('0x69')],'providerResponse':JSON[_0xd143('0x41')](_0xefa7e7)};return _0x49bd76;}}});};exports[_0xd143('0x71')]=function(_0x4df534,_0x1bb673,_0x20f9e3,_0x43f203){return tilde[_0xd143('0x4b')](_0x4df534,_0x1bb673,_0x20f9e3,_0x43f203)[_0xd143('0x3a')](function(_0x5e432a){try{fs[_0xd143('0x2b')](_0x4df534);}catch(_0x78ddf5){logger[_0xd143('0x13')](_0x78ddf5);}logger['info'](_0xd143('0x72'),_0x5e432a[_0xd143('0x50')]);logger[_0xd143('0x18')](_0xd143('0x73'),_0x5e432a[_0xd143('0x52')]);return _0x5e432a;});};exports[_0xd143('0x74')]=function(_0x3a942f,_0x310f7e,_0x5a9211,_0x404341,_0x374b86,_0x549394){var _0x5552a5=path[_0xd143('0x25')](__dirname,'tmp',rs[_0xd143('0x27')](0x4)+_0xd143('0x37'));var _0x346630;return aws['polly'](_0x3a942f,_0x310f7e,_0x5a9211,_0x404341,_0x374b86,_0x549394,_0x5552a5)[_0xd143('0x3a')](function(){_0x346630=path['resolve'](__dirname,_0xd143('0x26'),rs[_0xd143('0x27')](0x4)+_0xd143('0x28'));return convertFile(_0x5552a5,_0x346630);})[_0xd143('0x3a')](function(){try{fs['unlink'](_0x5552a5);fs[_0xd143('0x2c')](_0x346630,_0xd143('0x2d'));}catch(_0x915da8){logger[_0xd143('0x13')](_0x915da8);}return _0x346630[_0xd143('0x2e')]('.')[0x0];});};exports[_0xd143('0x75')]=function(_0x1f91b9,_0x4d1886,_0x531bd1,_0x1ee463,_0xc288cb,_0xa22d13){return aws[_0xd143('0x76')](_0x1f91b9,_0x4d1886,_0x531bd1,_0x1ee463,_0xc288cb,_0xa22d13)[_0xd143('0x3a')](function(_0x1a52d8){logger[_0xd143('0x18')](JSON['stringify'](_0x1a52d8));return _0x1a52d8;});};exports['ispeechTTS']=function(_0x5d2992,_0x500c5e,_0x3a236e,_0x1289b0){var _0x3a843c=util['format'](_0xd143('0x77'),ISPEECH_API,_0x5d2992,encodeURIComponent(_0x500c5e),_0x3a236e,_0x1289b0);var _0x12a08c=path[_0xd143('0x25')](__dirname,_0xd143('0x26'),rs['generate'](0x4)+_0xd143('0x37'));var _0x5a0f02;return downloadFile(_0x3a843c,_0x12a08c)[_0xd143('0x3a')](function(){_0x5a0f02=path[_0xd143('0x25')](__dirname,_0xd143('0x26'),rs[_0xd143('0x27')](0x4)+'.wav');return convertFile(_0x12a08c,_0x5a0f02);})[_0xd143('0x3a')](function(){try{fs['unlink'](_0x12a08c);fs[_0xd143('0x2c')](_0x5a0f02,_0xd143('0x2d'));}catch(_0x597371){logger[_0xd143('0x13')](_0x597371);}return _0x5a0f02['split']('.')[0x0];});};exports['ispeechASR']=function(_0x1009a9,_0x4afecd,_0x499778,_0x4a0b1e){var _0x5691a9=util[_0xd143('0x78')](_0xd143('0x79'),ISPEECH_API,_0x4afecd,_0x499778,base64Encode(_0x1009a9),_0x4a0b1e?util[_0xd143('0x78')](_0xd143('0x7a'),encodeURIComponent(_0x4a0b1e)):_0xd143('0x7b'));return uploadFile(_0x5691a9)[_0xd143('0x3a')](function(_0x526eb5){return querystring[_0xd143('0x7c')](_0x526eb5);});};exports[_0xd143('0x7d')]=function(_0x2b4f10,_0x1ec79c){return sestek[_0xd143('0x7e')](_0x2b4f10,_0x1ec79c)[_0xd143('0x3a')](function(_0x508752){logger[_0xd143('0x18')](JSON[_0xd143('0x41')](_0x508752));var _0x2ba0b6={'speech':_0x508752[_0xd143('0x7f')],'action':_0x508752[_0xd143('0x80')]?_0x508752['channelData'][_0xd143('0x81')]:undefined,'actiondata':_0x508752['channelData']?_0x508752['channelData'][_0xd143('0x82')]:undefined};if(_0x508752[_0xd143('0x80')]&&_0x508752[_0xd143('0x80')][_0xd143('0x83')]){return base64Decode(_0x508752[_0xd143('0x80')]['AudioFromTts'][_0xd143('0x84')],path[_0xd143('0x25')](__dirname,_0xd143('0x26'),rs[_0xd143('0x27')](0x4)+_0xd143('0x28')))['then'](function(_0x59590c){_0x2ba0b6[_0xd143('0x85')]=_0x59590c;return _0x2ba0b6;});}return _0x2ba0b6;});};exports[_0xd143('0x86')]=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 42bf175..54df426 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 _0x3dee=['exports','./nda'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x3dee,0xe5));var _0xe3de=function(_0x1aa9b6,_0x4a3719){_0x1aa9b6=_0x1aa9b6-0x0;var _0x4434f2=_0x3dee[_0x1aa9b6];return _0x4434f2;};var nda=require(_0xe3de('0x0'));module[_0xe3de('0x1')]={'nda':nda}; \ No newline at end of file +var _0xdc72=['exports','./nda'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc72,0x195));var _0x2dc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc72[_0x3dd15e];return _0x231fd0;};var nda=require(_0x2dc7('0x0'));module[_0x2dc7('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 039378f..e51c68d 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 _0xb98f=['ndaactivity_type','message','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password'];(function(_0x1a4f6e,_0x15cf08){var _0x12f84b=function(_0x10af9b){while(--_0x10af9b){_0x1a4f6e['push'](_0x1a4f6e['shift']());}};_0x12f84b(++_0x15cf08);}(_0xb98f,0xce));var _0xfb98=function(_0x2000c6,_0x2485ec){_0x2000c6=_0x2000c6-0x0;var _0x4509b9=_0xb98f[_0x2000c6];return _0x4509b9;};'use strict';var rp=require(_0xfb98('0x0'));var url=require(_0xfb98('0x1'));var logger=require(_0xfb98('0x2'))(_0xfb98('0x3'));module[_0xfb98('0x4')]=function(_0x4f16b2,_0x5570ce){var _0x593d54={'method':_0xfb98('0x5'),'uri':url[_0xfb98('0x6')](_0x5570ce[_0xfb98('0x7')],_0xfb98('0x8')),'form':{'grant_type':'password','username':_0x5570ce[_0xfb98('0x9')],'password':_0x5570ce[_0xfb98('0xa')]},'json':!![]};return rp(_0x593d54)['then'](function(_0x27b394){var _0x4d06fc={'method':'POST','uri':url['resolve'](_0x5570ce['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5570ce[_0xfb98('0xb')]||_0xfb98('0xc'),'channelId':'Nda','conversation':{'id':_0x4f16b2['uniqueid']},'from':{'id':_0x4f16b2[_0xfb98('0xd')],'name':_0x4f16b2['calleridname']},'recipient':{'id':_0x4f16b2[_0xfb98('0xe')],'name':_0x4f16b2[_0xfb98('0xf')]},'text':_0x5570ce[_0xfb98('0x10')],'channelData':{}},'headers':{'Authorization':_0xfb98('0x11')+_0x27b394[_0xfb98('0x12')]},'json':!![]};if(_0x5570ce[_0xfb98('0x13')]){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x16')]=_0x5570ce[_0xfb98('0x13')];}if(_0x5570ce[_0xfb98('0x17')]=='1'){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5570ce[_0xfb98('0x19')]){_0x4d06fc['body'][_0xfb98('0x15')][_0xfb98('0x1a')]=_0x5570ce[_0xfb98('0x19')];if(_0x5570ce[_0xfb98('0x1b')]){_0x4d06fc[_0xfb98('0x14')]['channelData'][_0xfb98('0x1c')]=_0x5570ce[_0xfb98('0x1b')];}}logger[_0xfb98('0x1d')](JSON[_0xfb98('0x1e')](_0x4d06fc));return rp(_0x4d06fc);});}; \ No newline at end of file +var _0x8ec7=['stringify','request-promise','url','agi','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info'];(function(_0x9ff1c0,_0x207afc){var _0x3e6c23=function(_0x11ad15){while(--_0x11ad15){_0x9ff1c0['push'](_0x9ff1c0['shift']());}};_0x3e6c23(++_0x207afc);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x8ec7[_0x1305e3];return _0x1068e9;};'use strict';var rp=require(_0x78ec('0x0'));var url=require(_0x78ec('0x1'));var logger=require('../../../../../config/logger')(_0x78ec('0x2'));module['exports']=function(_0x47d4c9,_0x1271a1){var _0x3b9496={'method':'POST','uri':url[_0x78ec('0x3')](_0x1271a1[_0x78ec('0x4')],_0x78ec('0x5')),'form':{'grant_type':_0x78ec('0x6'),'username':_0x1271a1[_0x78ec('0x7')],'password':_0x1271a1['password']},'json':!![]};return rp(_0x3b9496)[_0x78ec('0x8')](function(_0x4ca55e){var _0x372108={'method':_0x78ec('0x9'),'uri':url[_0x78ec('0x3')](_0x1271a1['ndassistant_url'],_0x78ec('0xa')),'body':{'type':_0x1271a1[_0x78ec('0xb')]||_0x78ec('0xc'),'channelId':_0x78ec('0xd'),'conversation':{'id':_0x47d4c9[_0x78ec('0xe')]},'from':{'id':_0x47d4c9['callerid'],'name':_0x47d4c9['calleridname']},'recipient':{'id':_0x47d4c9[_0x78ec('0xf')],'name':_0x47d4c9[_0x78ec('0x10')]},'text':_0x1271a1[_0x78ec('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x4ca55e[_0x78ec('0x12')]},'json':!![]};if(_0x1271a1[_0x78ec('0x13')]){_0x372108[_0x78ec('0x14')][_0x78ec('0x15')][_0x78ec('0x16')]=_0x1271a1[_0x78ec('0x13')];}if(_0x1271a1[_0x78ec('0x17')]=='1'){_0x372108[_0x78ec('0x14')][_0x78ec('0x15')][_0x78ec('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x78ec('0x19')};}if(_0x1271a1['custom_action']){_0x372108[_0x78ec('0x14')][_0x78ec('0x15')][_0x78ec('0x1a')]=_0x1271a1[_0x78ec('0x1b')];if(_0x1271a1[_0x78ec('0x1c')]){_0x372108['body']['channelData']['CustomActionData']=_0x1271a1['custom_action_data'];}}logger[_0x78ec('0x1d')](JSON[_0x78ec('0x1e')](_0x372108));return rp(_0x372108);});}; \ 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 81aa20c..4290169 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 _0x6cfd=['exports','./lib/api'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x6cfd,0x12f));var _0xd6cf=function(_0x1dd9dc,_0x2ebff9){_0x1dd9dc=_0x1dd9dc-0x0;var _0x87961a=_0x6cfd[_0x1dd9dc];return _0x87961a;};'use strict';var asr=require(_0xd6cf('0x0'));module[_0xd6cf('0x1')]=function(_0x5218b4,_0x39438c,_0x427373,_0x500287){return asr(_0x5218b4,_0x39438c,_0x427373,_0x500287);}; \ No newline at end of file +var _0x56b9=['exports'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x56b9,0x1c7));var _0x956b=function(_0x3f8684,_0x1d1801){_0x3f8684=_0x3f8684-0x0;var _0x442c7e=_0x56b9[_0x3f8684];return _0x442c7e;};'use strict';var asr=require('./lib/api');module[_0x956b('0x0')]=function(_0x2f5f22,_0x120499,_0x3e256e,_0x309db5){return asr(_0x2f5f22,_0x120499,_0x3e256e,_0x309db5);}; \ 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 33ef209..1968d59 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 _0xf80b=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','unix','stringify','createReadStream','data','close','send','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','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.','isNil','open','message','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xf80b,0x19a));var _0xbf80=function(_0x4f223c,_0x360f21){_0x4f223c=_0x4f223c-0x0;var _0x452058=_0xf80b[_0x4f223c];return _0x452058;};'use strict';var BPromise=require(_0xbf80('0x0'));var _=require(_0xbf80('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xbf80('0x2'));var crypto=require('crypto');var logger=require(_0xbf80('0x3'))(_0xbf80('0x4'));module[_0xbf80('0x5')]=function(_0x4a1ec5,_0x368a82,_0x46a883,_0x4f7dae){return new BPromise(function(_0x41c5f8,_0x3933ed){logger['info'](_0xbf80('0x6'),_0x4f7dae||_0xbf80('0x7'));var _0x41ea05=new WebSocket(_0x4f7dae||_0xbf80('0x7'),{'perMessageDeflate':![]});var _0x1ddc43='';var _0x3cdaf8='0';var _0xca97d0='1';var _0x1800d5=_0xbf80('0x8');function _0x339035(_0x5cc00f){var _0x21815b=crypto[_0xbf80('0x9')](_0xbf80('0xa'));_0x21815b[_0xbf80('0xb')](_0x5cc00f);return _0x21815b[_0xbf80('0xc')](_0xbf80('0xd'));}function _0x3b1d9d(){try{logger[_0xbf80('0xe')]('Open\x20Tilde\x20ASR\x20socket');var _0x252892=moment()[_0xbf80('0xf')]();var _0x4086ad=_0x339035(_0x252892+_0x368a82+_0x46a883);_0x41ea05['send'](JSON[_0xbf80('0x10')]({'appID':_0x368a82,'timestamp':_0x252892,'appKey':_0x4086ad}));var _0x374879=fs[_0xbf80('0x11')](_0x4a1ec5);_0x374879['on'](_0xbf80('0x12'),function(_0x55744a){_0x41ea05['send'](_0x55744a);});_0x374879['on'](_0xbf80('0x13'),function(){_0x41ea05[_0xbf80('0x14')](_0xbf80('0x15'));});}catch(_0x15674f){logger[_0xbf80('0x16')](_0xbf80('0x17'),JSON['stringify'](_0x15674f));_0x41ea05[_0xbf80('0x18')]();}}function _0x4380db(_0x15d08c){try{if(_0x15d08c){var _0x5ad3ce=JSON[_0xbf80('0x19')](_0x15d08c);switch(_0x5ad3ce[_0xbf80('0x1a')]){case 0x0:if(_0x5ad3ce[_0xbf80('0x1b')]){if(_0x5ad3ce[_0xbf80('0x1b')][_0xbf80('0x1c')]){logger[_0xbf80('0xe')](_0xbf80('0x1d'),JSON['stringify'](_0x5ad3ce[_0xbf80('0x1b')]['hypotheses']));_0x1ddc43=_0x5ad3ce[_0xbf80('0x1b')]['hypotheses'][0x0][_0xbf80('0x1e')];_0x3cdaf8=_0x5ad3ce[_0xbf80('0x1b')]['hypotheses'][0x0][_0xbf80('0x1f')];_0xca97d0='0';_0x1800d5='Success.';_0x41ea05[_0xbf80('0x18')]();}}break;case 0x1:logger['info'](_0xbf80('0x8'));_0xca97d0='1';_0x1800d5=_0xbf80('0x8');break;case 0x2:logger[_0xbf80('0xe')](_0xbf80('0x20'));_0xca97d0='2';_0x1800d5='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xbf80('0x21'));_0xca97d0='9';_0x1800d5=_0xbf80('0x21');break;case 0xa:logger[_0xbf80('0xe')]('Authentication\x20failed.');_0xca97d0='10';_0x1800d5='Authentication\x20failed.';break;case 0xb:logger['info'](_0xbf80('0x22'));_0xca97d0='11';_0x1800d5=_0xbf80('0x22');}}}catch(_0x560036){logger[_0xbf80('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xbf80('0x10')](_0x560036));_0x41ea05[_0xbf80('0x18')]();}}function _0x1147dc(){logger[_0xbf80('0xe')]('Close\x20Tilde\x20ASR\x20socket');_0x41c5f8({'transcript':_0x1ddc43,'confidence':_0x3cdaf8,'status':_0xca97d0,'status_message':_0x1800d5});}function _0x1a4618(_0x54f25c){logger[_0xbf80('0x16')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xbf80('0x23')](_0x54f25c)){logger[_0xbf80('0x16')](_['isObject'](_0x54f25c)?JSON['stringify'](_0x54f25c):_0x54f25c);}}_0x41ea05['on'](_0xbf80('0x24'),_0x3b1d9d);_0x41ea05['on'](_0xbf80('0x25'),_0x4380db);_0x41ea05['on'](_0xbf80('0x13'),_0x1147dc);_0x41ea05['on'](_0xbf80('0x16'),_0x1a4618);});}; \ No newline at end of file +var _0x547a=['terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify'];(function(_0x13fa7f,_0x33addd){var _0x2ae46d=function(_0x1b9ba0){while(--_0x1b9ba0){_0x13fa7f['push'](_0x13fa7f['shift']());}};_0x2ae46d(++_0x33addd);}(_0x547a,0x1e6));var _0xa547=function(_0x9908e1,_0x4ef18e){_0x9908e1=_0x9908e1-0x0;var _0xedff05=_0x547a[_0x9908e1];return _0xedff05;};'use strict';var BPromise=require(_0xa547('0x0'));var _=require(_0xa547('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xa547('0x2'));var logger=require(_0xa547('0x3'))(_0xa547('0x4'));module[_0xa547('0x5')]=function(_0xead64f,_0x3038f1,_0x35ab3b,_0x986de9){return new BPromise(function(_0x58695e,_0x4463b8){logger[_0xa547('0x6')](_0xa547('0x7'),_0x986de9||_0xa547('0x8'));var _0xd59e12=new WebSocket(_0x986de9||_0xa547('0x8'),{'perMessageDeflate':![]});var _0x3bbb7e='';var _0x586555='0';var _0x5683b1='1';var _0xcbeb5c=_0xa547('0x9');function _0x16fc4f(_0x35705c){var _0x3861b3=crypto[_0xa547('0xa')](_0xa547('0xb'));_0x3861b3['update'](_0x35705c);return _0x3861b3[_0xa547('0xc')]('hex');}function _0x1bc125(){try{logger[_0xa547('0x6')](_0xa547('0xd'));var _0x3558cd=moment()[_0xa547('0xe')]();var _0x243fc6=_0x16fc4f(_0x3558cd+_0x3038f1+_0x35ab3b);_0xd59e12['send'](JSON['stringify']({'appID':_0x3038f1,'timestamp':_0x3558cd,'appKey':_0x243fc6}));var _0x16e5c4=fs['createReadStream'](_0xead64f);_0x16e5c4['on']('data',function(_0x56e4c6){_0xd59e12[_0xa547('0xf')](_0x56e4c6);});_0x16e5c4['on'](_0xa547('0x10'),function(){_0xd59e12[_0xa547('0xf')](_0xa547('0x11'));});}catch(_0x48a759){logger[_0xa547('0x12')](_0xa547('0x13'),JSON[_0xa547('0x14')](_0x48a759));_0xd59e12[_0xa547('0x15')]();}}function _0x48b682(_0x494695){try{if(_0x494695){var _0x2c677a=JSON[_0xa547('0x16')](_0x494695);switch(_0x2c677a[_0xa547('0x17')]){case 0x0:if(_0x2c677a[_0xa547('0x18')]){if(_0x2c677a[_0xa547('0x18')][_0xa547('0x19')]){logger[_0xa547('0x6')](_0xa547('0x1a'),JSON[_0xa547('0x14')](_0x2c677a[_0xa547('0x18')]['hypotheses']));_0x3bbb7e=_0x2c677a[_0xa547('0x18')][_0xa547('0x1b')][0x0][_0xa547('0x1c')];_0x586555=_0x2c677a[_0xa547('0x18')][_0xa547('0x1b')][0x0][_0xa547('0x1d')];_0x5683b1='0';_0xcbeb5c=_0xa547('0x1e');_0xd59e12[_0xa547('0x15')]();}}break;case 0x1:logger['info'](_0xa547('0x9'));_0x5683b1='1';_0xcbeb5c=_0xa547('0x9');break;case 0x2:logger[_0xa547('0x6')](_0xa547('0x1f'));_0x5683b1='2';_0xcbeb5c='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xa547('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x5683b1='9';_0xcbeb5c='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xa547('0x20'));_0x5683b1='10';_0xcbeb5c=_0xa547('0x20');break;case 0xb:logger[_0xa547('0x6')](_0xa547('0x21'));_0x5683b1='11';_0xcbeb5c=_0xa547('0x21');}}}catch(_0x52a093){logger[_0xa547('0x12')](_0xa547('0x22'),JSON[_0xa547('0x14')](_0x52a093));_0xd59e12[_0xa547('0x15')]();}}function _0x49588b(){logger['info'](_0xa547('0x23'));_0x58695e({'transcript':_0x3bbb7e,'confidence':_0x586555,'status':_0x5683b1,'status_message':_0xcbeb5c});}function _0x29ee9a(_0x275a48){logger[_0xa547('0x12')](_0xa547('0x24'));if(!_[_0xa547('0x25')](_0x275a48)){logger[_0xa547('0x12')](_['isObject'](_0x275a48)?JSON[_0xa547('0x14')](_0x275a48):_0x275a48);}}_0xd59e12['on'](_0xa547('0x26'),_0x1bc125);_0xd59e12['on']('message',_0x48b682);_0xd59e12['on'](_0xa547('0x10'),_0x49588b);_0xd59e12['on'](_0xa547('0x12'),_0x29ee9a);});}; \ 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 10cb4be..fdb07d0 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x13a5=['exports','./asr'];(function(_0x158a0c,_0x3897fb){var _0xd8c6cb=function(_0x43864c){while(--_0x43864c){_0x158a0c['push'](_0x158a0c['shift']());}};_0xd8c6cb(++_0x3897fb);}(_0x13a5,0x1e1));var _0x513a=function(_0x4c0e68,_0x3ded50){_0x4c0e68=_0x4c0e68-0x0;var _0x2dbd15=_0x13a5[_0x4c0e68];return _0x2dbd15;};var asr=require(_0x513a('0x0'));module[_0x513a('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5bbeb7a..c238ef7 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 5456c29..3d33201 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 _0xe6d7=['getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','getIntervals','IntervalId','map','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','arg_1','createSquareMessage','uniqueid','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','error','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','url','method','timeout','POST','PUT','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','parse','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_bot_name','googleASR','tildeASR','appid','clear','includes','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','split','getAndSetVariable','result','extra','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','scheduledAt','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query','query:\x20%s','variable_id','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','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','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','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','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','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','ispeechasr','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','math\x20%s','operation','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','no\x20file\x20audio\x20found','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','recordingFormat','%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','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','exports','lodash','odbc','randomstring','moment','mustache','../../config/logger','../../config/environment/shared','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc'];(function(_0x1f02bc,_0x4cdada){var _0x378387=function(_0x1e89c5){while(--_0x1e89c5){_0x1f02bc['push'](_0x1f02bc['shift']());}};_0x378387(++_0x4cdada);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x4ec328,_0x31e00c){_0x4ec328=_0x4ec328-0x0;var _0x565272=_0xe6d7[_0x4ec328];return _0x565272;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x7e6d('0x0'));var sh=require('shelljs');var odbc=require(_0x7e6d('0x1'))();var rs=require(_0x7e6d('0x2'));var moment=require(_0x7e6d('0x3'));var Mustache=require(_0x7e6d('0x4'));var rp=require('request-promise');var logger=require(_0x7e6d('0x5'))('agi');var config=require('../../config/environment');var shared=require(_0x7e6d('0x6'));var scripts=require(_0x7e6d('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x7e6d('0x8'),_0x7e6d('0x9')];var verticesWithRetry=[_0x7e6d('0xa'),_0x7e6d('0xb'),_0x7e6d('0xc')];var AGIVertices=function(_0x285e8e,_0x215c69,_0x2ffe91){this[_0x7e6d('0xd')]=_0x285e8e;this[_0x7e6d('0xe')]=_0x215c69;this['mailRpc']=_0x2ffe91;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x10')]=function(_0x2baeba,_0x28f390){this['rpc'][_0x7e6d('0x11')](_0x2baeba)[_0x7e6d('0x12')](function(_0x5bc7b5){_0x28f390(null,_0x5bc7b5?_0x5bc7b5[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x39fc7d){_0x28f390(_0x39fc7d);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x15')]=function(_0x2bab2e,_0x38c3e4){this[_0x7e6d('0xe')][_0x7e6d('0x16')](_0x2bab2e)[_0x7e6d('0x12')](function(_0x5cad83){_0x38c3e4(null,_0x5cad83?_0x5cad83['name']:![]);})[_0x7e6d('0x14')](function(_0x265a56){_0x38c3e4(_0x265a56);});};AGIVertices['prototype'][_0x7e6d('0x17')]=function(_0x52596b,_0x169144){this[_0x7e6d('0xe')][_0x7e6d('0x18')](_0x52596b)[_0x7e6d('0x12')](function(_0x5b154b){_0x169144(null,_0x5b154b?_0x5b154b[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x534e9d){_0x169144(_0x534e9d);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x19')]=function(_0x3d3d1b,_0x287b1d){this['rpc'][_0x7e6d('0x1a')](_0x3d3d1b)[_0x7e6d('0x12')](function(_0x21dd03){_0x287b1d(null,_0x21dd03?_0x21dd03['dsn']:![]);})[_0x7e6d('0x14')](function(_0x42a000){_0x287b1d(_0x42a000);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1b')]=function(_0x554768,_0x18168e){this[_0x7e6d('0xe')][_0x7e6d('0x1c')](_0x554768)['then'](function(_0x1ce7bb){_0x18168e(null,_0x1ce7bb?_0x1ce7bb[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x188739){_0x18168e(_0x188739);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1d')]=function(_0x3edbef,_0x2a7cca){this[_0x7e6d('0xe')][_0x7e6d('0x1e')](_0x3edbef)[_0x7e6d('0x12')](function(_0x20dfe2){_0x2a7cca(null,_0x20dfe2?_0x20dfe2[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x1004f4){_0x2a7cca(_0x1004f4);});};AGIVertices[_0x7e6d('0xf')]['getSound']=function(_0x5a23ab,_0x477394){var _0x31977d=this;this['rpc'][_0x7e6d('0x1f')](_0x5a23ab)[_0x7e6d('0x12')](function(_0x19933d){_0x477394(null,_0x19933d?_0x31977d[_0x7e6d('0x20')](_0x19933d['save_name']):![]);})[_0x7e6d('0x14')](function(_0x8602fb){_0x477394(_0x8602fb);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x21')]=function(_0x113d27,_0x31f642){this[_0x7e6d('0xe')][_0x7e6d('0x22')](_0x113d27)[_0x7e6d('0x12')](function(_0x5b79ea){_0x31f642(null,_0x5b79ea?_0x5b79ea:![]);})['catch'](function(_0x2f8fb6){_0x31f642(_0x2f8fb6);});};AGIVertices[_0x7e6d('0xf')]['sendMailMessage']=function(_0x56599c,_0x2acac9,_0x3ac54d){this['mailRpc']['sendMailMessage'](_0x56599c,_0x2acac9)['then'](function(){_0x3ac54d(null);})[_0x7e6d('0x14')](function(_0x297439){_0x3ac54d(_0x297439);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x23')]=function(_0x16ccc5,_0xbadd1f){this['rpc']['getIntervalById'](_0x16ccc5)[_0x7e6d('0x12')](function(_0x3f9e52){if(_0x3f9e52){if(_0x3f9e52[_0x7e6d('0x24')]){_0xbadd1f(null,[_0x3f9e52['interval']]);}else{_0xbadd1f(null,_[_0x7e6d('0x25')](_0x3f9e52['Intervals'],_0x7e6d('0x26')));}}else{_0xbadd1f(null,![]);}})[_0x7e6d('0x14')](function(_0x3c3e59){_0xbadd1f(_0x3c3e59);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x20')]=function(_0x338f68){return util[_0x7e6d('0x27')](_0x7e6d('0x28'),FILES_PATH,_0x338f68);};AGIVertices['prototype'][_0x7e6d('0x29')]=function(_0x386e01,_0x145f53,_0x2597a7){odbc[_0x7e6d('0x2a')](_0x386e01,function(_0x15abd3){if(_0x15abd3){logger['error'](_0x7e6d('0x2b'),_0x15abd3);_0x2597a7(_0x15abd3);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x145f53,function(_0x539143,_0x113b8d){if(_0x539143){logger[_0x7e6d('0x2c')](_0x7e6d('0x2d'),_0x145f53);_0x2597a7(_0x539143);}else{logger['info'](_0x7e6d('0x2e'),_0x145f53);odbc[_0x7e6d('0x2f')](function(_0x4a49a3){if(_0x4a49a3){logger['error'](_0x7e6d('0x30'),_0x4a49a3);}_0x2597a7(null,_0x113b8d);});}});}});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x31')]=function(_0x21e47a,_0x25beea){this[_0x7e6d('0xe')]['getSmsAccountById'](_0x21e47a)['then'](function(_0x38ea0c){_0x25beea(null,_0x38ea0c?_0x38ea0c:![]);})[_0x7e6d('0x14')](function(_0x18fb13){_0x25beea(_0x18fb13);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x32')]=function(_0x3d9122,_0x4c5fab){this['rpc'][_0x7e6d('0x32')](_0x3d9122)[_0x7e6d('0x12')](function(_0x4d6953){_0x4c5fab(null,_0x4d6953);})['catch'](function(_0x3d2b89){_0x4c5fab(_0x3d2b89);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x33')]=function(_0x126f10,_0x202d00,_0x852eeb){this[_0x7e6d('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x7e6d('0xd')]['uniqueid'],'node':_0x126f10[_0x7e6d('0x34')],'application':_0x126f10[_0x7e6d('0x35')],'data':_0x202d00||null,'project_name':this[_0x7e6d('0xd')]['arg_1'],'callerid':this[_0x7e6d('0xd')][_0x7e6d('0x36')]})[_0x7e6d('0x12')](function(_0xb3157e){if(_0x852eeb){_0x852eeb(null,_0xb3157e);}})[_0x7e6d('0x14')](function(_0x5c30e1){if(_0x852eeb){_0x852eeb(_0x5c30e1);}});};AGIVertices[_0x7e6d('0xf')]['createSquareRecording']=function(_0x5a65d9,_0x1fd849,_0x5dadea,_0x135470){this['rpc'][_0x7e6d('0x37')]({'uniqueid':this[_0x7e6d('0xd')]['uniqueid'],'callerid':this['channel'][_0x7e6d('0x36')],'calleridname':this['channel'][_0x7e6d('0x38')],'context':this[_0x7e6d('0xd')][_0x7e6d('0x39')],'extension':this['channel'][_0x7e6d('0x3a')],'priority':this[_0x7e6d('0xd')]['priority'],'accountcode':this[_0x7e6d('0xd')][_0x7e6d('0x3b')],'dnid':this[_0x7e6d('0xd')][_0x7e6d('0x3c')],'projectName':this[_0x7e6d('0xd')][_0x7e6d('0x3d')],'saveName':_0x1fd849,'filename':_0x5a65d9['file']||_0x1fd849,'savePath':_0x5dadea})[_0x7e6d('0x12')](function(_0x189d7a){_0x135470(null,_0x189d7a);})[_0x7e6d('0x14')](function(_0x1e9d5b){_0x135470(_0x1e9d5b);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3f84f0,_0x118edf,_0x2f60cb,_0x577823,_0x375f78){this[_0x7e6d('0xe')][_0x7e6d('0x3e')]({'uniqueid':this['channel'][_0x7e6d('0x3f')],'body':_0x3f84f0,'direction':_0x118edf,'providerName':_0x2f60cb,'providerResponse':_0x577823})['then'](function(_0x5de709){if(_0x375f78){_0x375f78(null,_0x5de709);}})[_0x7e6d('0x14')](function(_0xcf1c5f){if(_0x375f78){_0x375f78(_0xcf1c5f);}});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x40')]=function(_0x64f4ab,_0x396d3b){this['rpc'][_0x7e6d('0x40')]({'firstName':_[_0x7e6d('0x41')](_0x64f4ab[_0x7e6d('0x13')])||_[_0x7e6d('0x42')](_0x64f4ab['name'])?_0x7e6d('0x43')+Math[_0x7e6d('0x44')]():_0x64f4ab[_0x7e6d('0x13')],'lastName':_[_0x7e6d('0x41')](_0x64f4ab[_0x7e6d('0x45')])||_[_0x7e6d('0x42')](_0x64f4ab['lastName'])?null:_0x64f4ab[_0x7e6d('0x45')],'phone':_0x64f4ab[_0x7e6d('0x46')],'ListId':_0x64f4ab[_0x7e6d('0x47')],'scheduledat':_0x64f4ab['scheduledAt'],'callbackUniqueid':this[_0x7e6d('0xd')][_0x7e6d('0x3f')],'tags':_0x7e6d('0x48'),'description':_0x7e6d('0x49')+_0x64f4ab['scheduledAt'][_0x7e6d('0x4a')](),'priority':_0x64f4ab[_0x7e6d('0x4b')]})['then'](function(_0x249a61){_0x396d3b(null,_0x249a61);})[_0x7e6d('0x14')](function(_0x2522b9){_0x396d3b(_0x2522b9);});};AGIVertices['prototype'][_0x7e6d('0x4c')]=function(_0x1b4a0a,_0x2db212){this['rpc'][_0x7e6d('0x4d')](_0x1b4a0a)[_0x7e6d('0x12')](function(_0x56f4b4){_0x2db212(null,_0x56f4b4?_0x56f4b4[_0x7e6d('0x13')]:![]);})[_0x7e6d('0x14')](function(_0x18632c){_0x2db212(_0x18632c);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x4e')]=function(_0xb71d53,_0x22dae4,_0x32b15a){var _0x1fb1dd={'role':_0x7e6d('0x4f')};_0x1fb1dd[_0xb71d53]=this['channel'][_0x7e6d('0x36')];this[_0x7e6d('0xe')][_0x7e6d('0x4e')](_0x1fb1dd,_0x22dae4,this['channel'][_0x7e6d('0x3f')])[_0x7e6d('0x12')](function(_0x5cad18){_0x32b15a(null,_[_0x7e6d('0x42')](_0x5cad18)?![]:!![]);})[_0x7e6d('0x14')](function(_0x3c0f3a){logger[_0x7e6d('0x50')](_0x3c0f3a);_0x32b15a(null,![]);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x51')]=function(_0x49103f,_0xdae377){var _0x4b4b8c={'role':_0x7e6d('0x4f')};_0x4b4b8c[_0x49103f]=this[_0x7e6d('0xd')][_0x7e6d('0x36')];this[_0x7e6d('0xe')]['agentUnpause'](_0x4b4b8c)[_0x7e6d('0x12')](function(_0x2e576a){_0xdae377(null,_[_0x7e6d('0x42')](_0x2e576a)?![]:!![]);})['catch'](function(_0x1d159d){logger['error'](_0x1d159d);_0xdae377(null,![]);});};AGIVertices['prototype'][_0x7e6d('0x52')]=function(_0xb22d8c,_0x4ad6e2){var _0x266a0f={'role':_0x7e6d('0x4f')};_0x266a0f[_0xb22d8c]=this[_0x7e6d('0xd')][_0x7e6d('0x36')];this[_0x7e6d('0xe')][_0x7e6d('0x52')](_0x266a0f)[_0x7e6d('0x12')](function(_0x3843c9){_0x4ad6e2(null,_[_0x7e6d('0x42')](_0x3843c9)?![]:!![]);})[_0x7e6d('0x14')](function(_0x4313ae){logger[_0x7e6d('0x50')](_0x4313ae);_0x4ad6e2(null,![]);});};AGIVertices[_0x7e6d('0xf')]['agentLogin']=function(_0x1e65f6,_0x12891f){var _0x5c81bf={'role':_0x7e6d('0x4f')};_0x5c81bf[_0x1e65f6]=this[_0x7e6d('0xd')]['callerid'];var _0x1d0406=_0x1e65f6!=_0x7e6d('0x53')?util['format'](_0x7e6d('0x54'),_0x7e6d('0x55'),this['channel']['callerid']):undefined;this[_0x7e6d('0xe')][_0x7e6d('0x56')](_0x5c81bf,_0x1d0406)[_0x7e6d('0x12')](function(_0x5db9e0){_0x12891f(null,_['isNil'](_0x5db9e0)?![]:!![]);})[_0x7e6d('0x14')](function(_0x27ac69){logger[_0x7e6d('0x50')](_0x27ac69);_0x12891f(null,![]);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x57')]=function(_0x4c36b8,_0x1a3640){sh[_0x7e6d('0x58')](_[_0x7e6d('0x59')](_0x4c36b8),function(_0x36be81,_0x449139){var _0x176880=_0x449139[_0x7e6d('0x5a')](/(\r\n|\n|\r)/gm,'');_0x1a3640(null,_0x176880);});};AGIVertices[_0x7e6d('0xf')]['googleCloudTTS']=function(_0xf235e0,_0x3e33ff){scripts[_0x7e6d('0x5b')](_0xf235e0['apiKey'],_0xf235e0['google_cloud_tts_text_type']||_0x7e6d('0x5c'),_0xf235e0[_0x7e6d('0x5c')],_0xf235e0[_0x7e6d('0x5d')]||_0x7e6d('0x5e'),_0xf235e0[_0x7e6d('0x5f')]||'MALE',_0xf235e0[_0x7e6d('0x60')]||_0x7e6d('0x61'))['then'](function(_0x26d979){_0x3e33ff(null,_0x26d979);})[_0x7e6d('0x14')](function(_0x3e4443){_0x3e33ff(_0x3e4443);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x62')]=function(_0x360203,_0x19d44a){scripts['googleTTS'](_0x360203[_0x7e6d('0x5c')],_0x360203['google_tts_language']||'en',0x1)[_0x7e6d('0x12')](function(_0xfbfd2e){_0x19d44a(null,_0xfbfd2e);})['catch'](function(_0x48dbbc){_0x19d44a(_0x48dbbc);});};AGIVertices[_0x7e6d('0xf')]['restAPI']=function(_0x42f968,_0x55103f){var _0x410715={'uri':_0x42f968[_0x7e6d('0x63')],'method':_0x42f968[_0x7e6d('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x42f968['timeout'])==='number'&&parseInt(_0x42f968[_0x7e6d('0x65')])>=0x1?parseInt(_0x42f968[_0x7e6d('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x7e6d('0x66'),_0x7e6d('0x67')],_0x410715[_0x7e6d('0x64')]['toUpperCase']())){try{_0x410715[_0x7e6d('0x68')]=_0x42f968[_0x7e6d('0x9')]?JSON['parse'](_0x42f968[_0x7e6d('0x9')]):{};}catch(_0x57b698){logger[_0x7e6d('0x50')](_0x7e6d('0x69'),_0x57b698);}}try{_0x410715[_0x7e6d('0x6a')]=_0x42f968[_0x7e6d('0x8')]?JSON['parse'](_0x42f968[_0x7e6d('0x8')]):{};}catch(_0x3b0597){logger[_0x7e6d('0x50')](_0x7e6d('0x6b'),_0x3b0597);}if(_0x42f968['computedVariables']){try{var _0x127149=require(_0x42f968[_0x7e6d('0x6c')])[_0x7e6d('0x6d')](this,_0x410715);_0x410715[_0x7e6d('0x6e')]=Mustache['render'](_0x42f968[_0x7e6d('0x63')],_0x127149,{},['$$','$$']);if(_0x410715[_0x7e6d('0x6a')]){_0x410715[_0x7e6d('0x6a')]=JSON[_0x7e6d('0x6f')](Mustache[_0x7e6d('0x70')](JSON['stringify'](_0x410715[_0x7e6d('0x6a')]),_0x127149,{},['$$','$$']));}if(_0x410715[_0x7e6d('0x68')]){_0x410715['body']=JSON[_0x7e6d('0x6f')](Mustache['render'](JSON[_0x7e6d('0x71')](_0x410715['body']),_0x127149,{},['$$','$$']));}}catch(_0x3d22e1){logger[_0x7e6d('0x50')](_0x7e6d('0x72'),_0x3d22e1);}}rp(_0x410715)[_0x7e6d('0x12')](function(_0x33f2ed){var _0x4843be={'statusCode':_0x33f2ed[_0x7e6d('0x73')]||0xc8,'statusMessage':_0x33f2ed[_0x7e6d('0x74')]||'OK','headers':_0x33f2ed[_0x7e6d('0x6a')]||{},'body':_0x33f2ed[_0x7e6d('0x68')]||{}};_0x55103f(null,_0x4843be);})[_0x7e6d('0x14')](function(_0x314e81){var _0x3613c7={'statusCode':_0x314e81[_0x7e6d('0x73')]||0x1f4,'statusMessage':_0x314e81['message']||_0x7e6d('0x75'),'headers':_0x314e81[_0x7e6d('0x76')][_0x7e6d('0x6a')]||{},'body':_0x314e81['options']['body']||{}};_0x55103f(null,_0x3613c7);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x77')]=function(_0x2b5c64,_0x691a59){scripts[_0x7e6d('0x77')](this['channel'][_0x7e6d('0x3f')],_0x2b5c64[_0x7e6d('0x78')],_0x2b5c64['text'],_0x2b5c64[_0x7e6d('0x79')]||'en')[_0x7e6d('0x12')](function(_0x579dc9){_0x691a59(null,_0x579dc9);})[_0x7e6d('0x14')](function(_0x29e7b2){_0x691a59(_0x29e7b2);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x7a')]=function(_0x33eccf,_0x4be346){scripts[_0x7e6d('0x7a')](this[_0x7e6d('0xd')][_0x7e6d('0x3f')],_0x33eccf['dialogflowV2_project_id'],_0x33eccf['client_email'],_0x33eccf[_0x7e6d('0x7b')],_0x33eccf[_0x7e6d('0x5c')],_0x33eccf[_0x7e6d('0x7c')]||'en')['then'](function(_0x6cd645){_0x4be346(null,_0x6cd645);})[_0x7e6d('0x14')](function(_0x312fde){_0x4be346(_0x312fde);});};AGIVertices['prototype']['sestekNDA']=function(_0x462b8b,_0x42d17d){scripts['sestekNDA'](this['channel'],_0x462b8b)[_0x7e6d('0x12')](function(_0x3fc4f5){_0x42d17d(null,_0x3fc4f5);})[_0x7e6d('0x14')](function(_0x45ff7f){_0x42d17d(_0x45ff7f);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x7d')]=function(_0x1a5461,_0x441cb1){scripts[_0x7e6d('0x7d')](_0x1a5461[_0x7e6d('0x78')],_0x1a5461[_0x7e6d('0x5c')],_0x1a5461[_0x7e6d('0x7e')]||_0x7e6d('0x5e'),_0x1a5461[_0x7e6d('0x7f')])[_0x7e6d('0x12')](function(_0x5fd26a){_0x441cb1(null,_0x5fd26a);})[_0x7e6d('0x14')](function(_0xe192c){_0x441cb1(_0xe192c);});};AGIVertices['prototype'][_0x7e6d('0x80')]=function(_0x27e5fc,_0x22722e,_0x35e3d0){scripts[_0x7e6d('0x80')](_0x22722e,_0x27e5fc[_0x7e6d('0x78')],_0x27e5fc[_0x7e6d('0x81')]||'en-US',this[_0x7e6d('0x82')](_0x27e5fc['model'])?_0x27e5fc[_0x7e6d('0x83')]:undefined)['then'](function(_0x4929d8){_0x35e3d0(null,_0x4929d8);})[_0x7e6d('0x14')](function(_0x55831e){_0x35e3d0(_0x55831e);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x84')]=function(_0x261d62,_0x328ded){scripts['awsPolly'](_0x261d62[_0x7e6d('0x85')],_0x261d62[_0x7e6d('0x86')],_0x261d62[_0x7e6d('0x87')],_0x261d62[_0x7e6d('0x88')]||_0x7e6d('0x89'),_0x261d62['text'],_0x261d62['aws_text_type']||_0x7e6d('0x5c'))[_0x7e6d('0x12')](function(_0x2867af){_0x328ded(null,_0x2867af);})[_0x7e6d('0x14')](function(_0x5311b1){_0x328ded(_0x5311b1);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x8a')]=function(_0x8f5496,_0x4c0a2f){scripts[_0x7e6d('0x8a')](this[_0x7e6d('0xd')][_0x7e6d('0x3f')],_0x8f5496[_0x7e6d('0x85')],_0x8f5496[_0x7e6d('0x86')],_0x8f5496['aws_lex_region'],_0x8f5496[_0x7e6d('0x5c')],_0x8f5496[_0x7e6d('0x8b')])[_0x7e6d('0x12')](function(_0x41a9fe){_0x4c0a2f(null,_0x41a9fe);})[_0x7e6d('0x14')](function(_0x5813ee){_0x4c0a2f(_0x5813ee);});};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x8c')]=function(_0x44af27,_0x36d1f2,_0x3a9b6b){scripts['googleASR'](_0x36d1f2,_0x44af27[_0x7e6d('0x78')],_0x44af27['google_asr_language']||_0x7e6d('0x5e'))[_0x7e6d('0x12')](function(_0x32ecb8){_0x3a9b6b(null,_0x32ecb8);})[_0x7e6d('0x14')](function(_0x4895b4){_0x3a9b6b(_0x4895b4);});};AGIVertices['prototype']['tildeASR']=function(_0x2d7622,_0xcb4e38,_0x270e50){scripts[_0x7e6d('0x8d')](_0xcb4e38,_0x2d7622[_0x7e6d('0x8e')],_0x2d7622['appsecret'],_0x2d7622[_0x7e6d('0x6e')])['then'](function(_0x2aa57d){_0x270e50(null,_0x2aa57d);})[_0x7e6d('0x14')](function(_0x3960a2){_0x270e50(_0x3960a2);});};AGIVertices['prototype'][_0x7e6d('0x8f')]=function(_0xb4102a){var _0xbf5b17=_[_0x7e6d('0x90')](verticesWithRetry,_0xb4102a['agicommand'])?_0xb4102a:_[_0x7e6d('0x91')](_0xb4102a);for(var _0x41d527 in _0xbf5b17){if(_0xbf5b17[_0x7e6d('0x92')](_0x41d527)){if(_0xbf5b17[_0x41d527]&&_['isString'](_0xbf5b17[_0x41d527])){if(_['includes'](recursiveMapAttributes,_0x41d527)){_0xbf5b17[_0x41d527]=this[_0x7e6d('0x93')](_0xbf5b17[_0x41d527]);}else{_0xbf5b17[_0x41d527]=this[_0x7e6d('0x94')](_0xbf5b17[_0x41d527]);}}}}return _0xbf5b17;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x95')]=function(_0x952d8a){for(var _0x12df3e in _0x952d8a){if(_0x952d8a[_0x7e6d('0x92')](_0x12df3e)){if(_[_0x7e6d('0x96')](_0x952d8a[_0x12df3e])){this[_0x7e6d('0x95')](_0x952d8a[_0x12df3e]);}else if(_[_0x7e6d('0x97')](_0x952d8a[_0x12df3e])){for(var _0x39c5b6=0x0;_0x39c5b6<_0x952d8a[_0x12df3e][_0x7e6d('0x98')];_0x39c5b6++){this[_0x7e6d('0x95')](_0x952d8a[_0x12df3e][_0x39c5b6]);}}else if(_[_0x7e6d('0x99')](_0x952d8a[_0x12df3e])){_0x952d8a[_0x12df3e]=this[_0x7e6d('0x94')](_0x952d8a[_0x12df3e]);}}}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x9a')]=function(_0x4b6417,_0x361072){for(var _0x2f8eb1 in _0x4b6417){if(_0x4b6417[_0x7e6d('0x92')](_0x2f8eb1)){if(_[_0x7e6d('0x96')](_0x4b6417[_0x2f8eb1])){if(!_[_0x7e6d('0x41')](_0x4b6417[_0x2f8eb1])){this['saveRestApiResult'](_0x4b6417[_0x2f8eb1],util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x361072,_0x2f8eb1));}}else if(_[_0x7e6d('0x97')](_0x4b6417[_0x2f8eb1])){for(var _0x54f01e=0x0;_0x54f01e<_0x4b6417[_0x2f8eb1][_0x7e6d('0x98')];_0x54f01e++){this[_0x7e6d('0x9a')](_0x4b6417[_0x2f8eb1][_0x54f01e],util[_0x7e6d('0x27')]('%s.%s',_0x361072,_0x2f8eb1+'['+_0x54f01e+']'));}}else{if(!_[_0x7e6d('0x42')](_0x4b6417[_0x2f8eb1])){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x361072,_0x2f8eb1),_0x4b6417[_0x2f8eb1]);}}}}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x93')]=function(_0x2920d2){try{var _0x16988f=JSON[_0x7e6d('0x6f')](_0x2920d2);this[_0x7e6d('0x95')](_0x16988f);return JSON[_0x7e6d('0x71')](_0x16988f);}catch(_0x1cf61a){return this[_0x7e6d('0x94')](_0x2920d2);}};AGIVertices['prototype'][_0x7e6d('0x94')]=function(_0x56ac3d){var _0x2cd475=_0x56ac3d['split']('{');for(var _0x124d3f=0x1;_0x124d3f<_0x2cd475['length'];_0x124d3f+=0x1){var _0x6d5e11=_0x2cd475[_0x124d3f][_0x7e6d('0x9d')]('}');if(_0x6d5e11[_0x7e6d('0x98')]>0x1){_0x56ac3d=_0x56ac3d['replaceAll']('{'+_0x6d5e11[0x0]+'}',this[_0x7e6d('0xd')][_0x7e6d('0x10')](_0x6d5e11[0x0])['extra']||_0x6d5e11[0x0]);}}if(_0x2cd475[_0x7e6d('0x98')]===0x1){return _0x56ac3d[_0x7e6d('0x4a')]();}return this[_0x7e6d('0x94')](_0x56ac3d);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x9e')]=function(_0x420aca,_0x468e2c){var _0x178502=this[_0x7e6d('0xd')][_0x7e6d('0x10')](_0x420aca);if(_0x178502[_0x7e6d('0x9f')]===-0x1){return _0x178502;}logger['info'](util[_0x7e6d('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x468e2c,_0x178502[_0x7e6d('0xa0')]));return this[_0x7e6d('0xd')]['setVariable'](_0x468e2c,_0x178502[_0x7e6d('0xa0')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x82')]=function(_0x536a3e){return _0x536a3e&&_0x536a3e!=='0'&&_0x536a3e!=='-1'&&_0x536a3e!=='';};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xa1')]=function(_0x3d9fb7){this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d9fb7,'-');_0x3d9fb7[_0x7e6d('0xa2')]=_0x3d9fb7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x3b6bf4){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xa3'),_0x3b6bf4['label']));if(!this[_0x7e6d('0x82')](_0x3b6bf4[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}var _0x40543d='\x22'+_0x3b6bf4[_0x7e6d('0x5c')]+'\x22';if(this[_0x7e6d('0x82')](_0x3b6bf4[_0x7e6d('0x76')])){_0x40543d+=','+_0x3b6bf4[_0x7e6d('0x76')];}var _0x35e20d=this[_0x7e6d('0xd')]['exec'](_0x7e6d('0xa6'),_0x40543d);if(_0x35e20d['result']===-0x1){return _0x35e20d;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xa7'),_0x40543d));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xa8')]=function(_0x4d6d67){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xa9'),_0x4d6d67['label']));if(!this[_0x7e6d('0x82')](_0x4d6d67[_0x7e6d('0xaa')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20grammar\x20configured');}var _0x48ba6d=_0x4d6d67['grammar'];if(this[_0x7e6d('0x82')](_0x4d6d67[_0x7e6d('0x76')])){_0x48ba6d+=','+_0x4d6d67['options'];}var _0x434987=this[_0x7e6d('0xd')][_0x7e6d('0x58')]('MRCPRecog',_0x48ba6d);if(_0x434987['result']===-0x1){return _0x434987;}var _0x43682d=this[_0x7e6d('0x9e')](_0x7e6d('0xab'),_0x7e6d('0xac'));if(_0x43682d[_0x7e6d('0x9f')]===-0x1){return _0x43682d;}var _0x408a4e=this[_0x7e6d('0x9e')](_0x7e6d('0xad'),_0x7e6d('0xae'));if(_0x408a4e[_0x7e6d('0x9f')]===-0x1){return _0x408a4e;}var _0x1835a9=this[_0x7e6d('0x9e')](_0x7e6d('0xaf'),_0x7e6d('0xb0'));if(_0x1835a9[_0x7e6d('0x9f')]===-0x1){return _0x1835a9;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xb1'),_0x48ba6d));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xb2')]=function(_0x246c44){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xb3'),_0x246c44[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['agi']([_0x246c44[_0x7e6d('0xb4')],_0x246c44['args']]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xb5')]=function(_0x349ae8){logger[_0x7e6d('0x2c')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x349ae8[_0x7e6d('0x34')]));if(this['isConfigured'](_0x349ae8[_0x7e6d('0x65')])){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x349ae8[_0x7e6d('0x65')]));var _0xf2bcc=this[_0x7e6d('0xd')][_0x7e6d('0xb6')](_0x349ae8[_0x7e6d('0x65')]);if(_0xf2bcc[_0x7e6d('0x9f')]===-0x1){return _0xf2bcc;}}return this[_0x7e6d('0xd')]['answer']();};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x48')]=function(_0x113dc7){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xb7'),_0x113dc7[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x113dc7[_0x7e6d('0x47')])){return this[_0x7e6d('0xd')]['error'](_0x113dc7,_0x7e6d('0xb8'));}_0x113dc7['scheduledAt']=moment();if(this[_0x7e6d('0x82')](_0x113dc7[_0x7e6d('0xb9')])){_0x113dc7[_0x7e6d('0xba')]=moment()[_0x7e6d('0xbb')](_0x113dc7[_0x7e6d('0xb9')],'minutes');}if(!this['isConfigured'](_0x113dc7[_0x7e6d('0x4b')])){_0x113dc7['callback_priority']=0x2;}this[_0x7e6d('0x40')][_0x7e6d('0x6d')](this,_0x113dc7);return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xbc'),_0x113dc7[_0x7e6d('0x46')],_0x113dc7[_0x7e6d('0x47')],_0x113dc7[_0x7e6d('0xba')]));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xbd')]=function(_0x2b1faa){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xbe'),_0x2b1faa[_0x7e6d('0x34')]));var _0x513800=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x2b1faa[_0x7e6d('0xbf')],_0x2b1faa[_0x7e6d('0x76')]);if(_0x513800[_0x7e6d('0x9f')]===-0x1){return _0x513800;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),_0x2b1faa[_0x7e6d('0xbf')],_0x2b1faa[_0x7e6d('0x76')]));};AGIVertices['prototype'][_0x7e6d('0xc1')]=function(_0x118f0f){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xc2'),_0x118f0f['label']));if(!this[_0x7e6d('0x82')](_0x118f0f['text'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}var _0x11ceca='\x22'+_0x118f0f['text']+'\x22';if(this[_0x7e6d('0x82')](_0x118f0f['options'])){_0x11ceca+=','+_0x118f0f[_0x7e6d('0x76')];}var _0x5b6e35=this[_0x7e6d('0xd')][_0x7e6d('0x58')]('MRCPSynth',_0x11ceca);if(_0x5b6e35[_0x7e6d('0x9f')]===-0x1){return _0x5b6e35;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xa7'),_0x11ceca));};AGIVertices['prototype'][_0x7e6d('0xc3')]=function(_0x1b5980){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xc4'),_0x1b5980['label']));if(!this[_0x7e6d('0x82')](_0x1b5980[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}var _0x3a1675='\x22'+_0x1b5980[_0x7e6d('0x5c')]+'\x22';if(this['isConfigured'](_0x1b5980[_0x7e6d('0x76')])){_0x3a1675+=','+_0x1b5980[_0x7e6d('0x76')];}var _0x20f6c1=this['channel'][_0x7e6d('0x58')](_0x7e6d('0xa6'),_0x3a1675);if(_0x20f6c1[_0x7e6d('0x9f')]===-0x1){return _0x20f6c1;}return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xa7'),_0x3a1675));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xc5')]=function(_0x5b704f){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xc6'),_0x5b704f['label']));if(!this[_0x7e6d('0x82')](_0x5b704f[_0x7e6d('0xaa')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xc7'));}var _0x1d07bf=_0x5b704f[_0x7e6d('0xaa')];if(this[_0x7e6d('0x82')](_0x5b704f['options'])){_0x1d07bf+=','+_0x5b704f['options'];}var _0x42189d=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0xc8'),_0x1d07bf);if(_0x42189d[_0x7e6d('0x9f')]===-0x1){return _0x42189d;}var _0x56d3c9=this[_0x7e6d('0x9e')](_0x7e6d('0xab'),_0x7e6d('0xc9'));if(_0x56d3c9[_0x7e6d('0x9f')]===-0x1){return _0x56d3c9;}var _0x2a6228=this[_0x7e6d('0x9e')](_0x7e6d('0xad'),_0x7e6d('0xca'));if(_0x2a6228[_0x7e6d('0x9f')]===-0x1){return _0x2a6228;}var _0x3fa03=this[_0x7e6d('0x9e')](_0x7e6d('0xaf'),_0x7e6d('0xcb'));if(_0x3fa03[_0x7e6d('0x9f')]===-0x1){return _0x3fa03;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xb1'),_0x1d07bf));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xcc')]=function(_0x5612fe){logger[_0x7e6d('0x2c')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5612fe[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x5612fe[_0x7e6d('0xaa')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xc7'));}var _0xe7b4be=_0x5612fe[_0x7e6d('0xaa')];if(this[_0x7e6d('0x82')](_0x5612fe[_0x7e6d('0x76')])){_0xe7b4be+=','+_0x5612fe[_0x7e6d('0x76')];}var _0x1cb51f=this[_0x7e6d('0xd')][_0x7e6d('0x58')]('MRCPRecog',_0xe7b4be);if(_0x1cb51f[_0x7e6d('0x9f')]===-0x1){return _0x1cb51f;}var _0x2aa267=this['getAndSetVariable']('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x2aa267[_0x7e6d('0x9f')]===-0x1){return _0x2aa267;}var _0xf10c14=this[_0x7e6d('0x9e')](_0x7e6d('0xad'),_0x7e6d('0xcd'));if(_0xf10c14[_0x7e6d('0x9f')]===-0x1){return _0xf10c14;}var _0x4f8c7f=this[_0x7e6d('0x9e')](_0x7e6d('0xaf'),'SESTEK_ASR_INSTANCE');if(_0x4f8c7f[_0x7e6d('0x9f')]===-0x1){return _0x4f8c7f;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0xe7b4be));};AGIVertices['prototype'][_0x7e6d('0xce')]=function(_0x254a8f){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xcf'),_0x254a8f['label']));if(!this[_0x7e6d('0x82')](_0x254a8f[_0x7e6d('0xd0')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x254a8f,_0x7e6d('0xd1'));}var _0x2d3672=this[_0x7e6d('0x19')][_0x7e6d('0x6d')](this,_0x254a8f['odbc_id']);if(!_0x2d3672){return this['channel'][_0x7e6d('0x50')](_0x254a8f,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x254a8f[_0x7e6d('0xd2')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x254a8f,'no\x20query\x20configured');}var _0x761089=_0x254a8f[_0x7e6d('0xd2')][_0x7e6d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xd3'),_0x761089));var _0x3eefd8=this['getQueryOdbc'][_0x7e6d('0x6d')](this,_0x2d3672,_0x761089);this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x254a8f,_0x761089);if(!this[_0x7e6d('0x82')](_0x254a8f[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x44b185=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x254a8f[_0x7e6d('0xd4')]);if(!_0x44b185){return this['channel'][_0x7e6d('0x50')](_0x254a8f,'no\x20variable\x20found');}var _0x4c89a3=this;_0x3eefd8[_0x7e6d('0xd5')](function(_0x424bbe,_0x10ae78){Object[_0x7e6d('0xd6')](_0x424bbe)[_0x7e6d('0xd5')](function(_0x23d1e9){_0x4c89a3['channel'][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0xd7'),_0x44b185,_0x10ae78,_0x23d1e9),_0x424bbe[_0x23d1e9]);});});this[_0x7e6d('0xd')]['setVariable'](util[_0x7e6d('0x27')](_0x7e6d('0xd8'),_0x44b185),_0x3eefd8[_0x7e6d('0x98')]);return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0xd9'),_0x44b185));};AGIVertices['prototype'][_0x7e6d('0xda')]=function(_0x5aeeb0){logger[_0x7e6d('0xdb')](util[_0x7e6d('0x27')](_0x7e6d('0xdc'),_0x5aeeb0[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x5aeeb0[_0x7e6d('0xdd')])){return this['channel']['error'](_0x5aeeb0,_0x7e6d('0xde'));}var _0x3e34e4=this['getUser'][_0x7e6d('0x6d')](this,_0x5aeeb0[_0x7e6d('0xdd')]);if(!_0x3e34e4){return this['channel'][_0x7e6d('0x50')](_0x5aeeb0,_0x7e6d('0xdf'));}var _0x118b85=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0xe0'),[util[_0x7e6d('0x27')](_0x7e6d('0xe1'),_0x3e34e4),_0x5aeeb0['timeout'],_0x5aeeb0[_0x7e6d('0xe2')],_0x5aeeb0[_0x7e6d('0x63')]]);if(_0x118b85[_0x7e6d('0x9f')]===-0x1){return _0x118b85;}return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('Executed\x20command\x20%s',_0x7e6d('0xe0')));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xe3')]=function(_0x262908){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0xe4'),_0x262908['label']));if(!this[_0x7e6d('0x82')](_0x262908[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20key\x20configured');}if(!this[_0x7e6d('0x82')](_0x262908[_0x7e6d('0x5c')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this['channel'][_0x7e6d('0xe5')]=!![];this[_0x7e6d('0x33')](_0x262908);this[_0x7e6d('0x3e')](_0x262908[_0x7e6d('0x5c')],'in','','');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xe6'),_0x262908[_0x7e6d('0x5c')]));var _0x5b16e4=this[_0x7e6d('0x77')]['sync'](this,_0x262908);if(_0x5b16e4){for(var _0x867770 in _0x5b16e4){if(_0x5b16e4['hasOwnProperty'](_0x867770)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0xe7'),_0x867770[_0x7e6d('0xe8')]()),_0x5b16e4[_0x867770]);}}this[_0x7e6d('0x3e')](_0x5b16e4[_0x7e6d('0xe9')],_0x7e6d('0xea'),_0x7e6d('0xe3'),'');return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xeb'),_0x5b16e4['speech']));}return this['channel'][_0x7e6d('0x50')](_0x262908,_0x7e6d('0xec'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xed')]=function(_0xbc9ee3){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0xee'),_0xbc9ee3[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0xef')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xf0'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0xf1')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xf2'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3['private_key'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xf3'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0x7c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xf4'));}if(!this[_0x7e6d('0x82')](_0xbc9ee3[_0x7e6d('0x5c')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xe5')]=!![];this[_0x7e6d('0x33')](_0xbc9ee3);this[_0x7e6d('0x3e')](_0xbc9ee3[_0x7e6d('0x5c')],'in','','');this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xf5'),_0xbc9ee3[_0x7e6d('0x5c')]));var _0x5e04b8=this[_0x7e6d('0x7a')][_0x7e6d('0x6d')](this,_0xbc9ee3);if(_0x5e04b8){for(var _0x41a77f in _0x5e04b8){if(_0x5e04b8[_0x7e6d('0x92')](_0x41a77f)){if(_0x41a77f!=='providerResponse'){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0xe7'),_0x41a77f[_0x7e6d('0xe8')]()),_0x5e04b8[_0x41a77f]);}}}this[_0x7e6d('0x3e')](_0x5e04b8[_0x7e6d('0xe9')],_0x7e6d('0xea'),'dialogflowV2',_0x5e04b8['providerResponse']);return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xf6'),_0x5e04b8[_0x7e6d('0xe9')]));}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0xbc9ee3,_0x7e6d('0xf7'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xf8')]=function(_0x125bfc){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0xf9'),_0x125bfc[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x125bfc['ndauth_url'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xfa'));}if(!this['isConfigured'](_0x125bfc[_0x7e6d('0xfb')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xfc'));}if(!this['isConfigured'](_0x125bfc['password'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xfd'));}if(!this[_0x7e6d('0x82')](_0x125bfc[_0x7e6d('0xfe')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')]['bot']=!![];this[_0x7e6d('0x33')](_0x125bfc);this[_0x7e6d('0x3e')](_0x125bfc[_0x7e6d('0x5c')],'in','','');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xff'),_0x125bfc['text']));var _0x23f808=this['sestekNDA'][_0x7e6d('0x6d')](this,_0x125bfc);if(_0x23f808){for(var _0x34547c in _0x23f808){if(_0x23f808['hasOwnProperty'](_0x34547c)){this[_0x7e6d('0xd')]['setVariable'](util[_0x7e6d('0x27')](_0x7e6d('0x100'),_0x34547c['toUpperCase']()),_0x23f808[_0x34547c]);}}this['createSquareMessage'](_0x23f808['speech'],'out',_0x7e6d('0xf8'),'');if(_0x23f808[_0x7e6d('0x101')]){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x102'),_0x23f808[_0x7e6d('0x101')]));var _0x4b0fc1=this[_0x7e6d('0xd')]['streamFile'](_0x23f808[_0x7e6d('0x101')]);try{fs[_0x7e6d('0x103')](_0x23f808[_0x7e6d('0x101')]+_0x7e6d('0x104'));}catch(_0x221bba){logger[_0x7e6d('0x50')](_0x221bba);}return _0x4b0fc1;}else{return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x105'),_0x23f808[_0x7e6d('0xe9')]));}}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x125bfc,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x106')]=function(_0x4741ae){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x107'),_0x4741ae[_0x7e6d('0x34')]));return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x106'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x108')]=function(_0x233bdc){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x109'),_0x233bdc[_0x7e6d('0x34')]));var _0xaeb6c5='';if(_0x233bdc[_0x7e6d('0x10a')]){if(!this[_0x7e6d('0x82')](_0x233bdc[_0x7e6d('0x10a')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x233bdc,_0x7e6d('0x10b'));}else{var _0x40286=parseInt(_0x233bdc[_0x7e6d('0x10a')],0xa);if(isNaN(_0x40286)){_0xaeb6c5=_0x233bdc[_0x7e6d('0x10a')];}else{_0xaeb6c5=this[_0x7e6d('0x1d')][_0x7e6d('0x6d')](this,_0x233bdc[_0x7e6d('0x10a')]);if(!_0xaeb6c5){return this[_0x7e6d('0xd')]['error'](_0x233bdc,_0x7e6d('0x10c'));}}}}else if(_0x233bdc[_0x7e6d('0x10d')]){_0xaeb6c5=_0x233bdc[_0x7e6d('0x10d')];}else{return this[_0x7e6d('0xd')]['error'](_0x233bdc,_0x7e6d('0x10b'));}var _0xbbaf3c=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0xe0'),[util[_0x7e6d('0x27')]('SIP/%s/%s',_0xaeb6c5,_0x233bdc[_0x7e6d('0x46')]),_0x233bdc['timeout'],_0x233bdc[_0x7e6d('0xe2')],_0x233bdc[_0x7e6d('0x63')]]);if(_0xbbaf3c[_0x7e6d('0x9f')]===-0x1){return _0xbbaf3c;}return this[_0x7e6d('0xd')]['noop'](util['format'](_0x7e6d('0x10e'),'DIAL'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x10f')]=function(_0x357f6b){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x110'),_0x357f6b[_0x7e6d('0x34')]));return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x10f'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xb')]=function(_0x3d0795){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x111'),_0x3d0795['label']));if(_0x3d0795['retry']===0x0){return this['maxRetry'](_0x3d0795);}_0x3d0795[_0x7e6d('0xa2')]-=0x1;if(!this[_0x7e6d('0x82')](_0x3d0795[_0x7e6d('0x112')])){return this['channel'][_0x7e6d('0x50')](_0x3d0795,_0x7e6d('0x113'));}var _0x57e68b=this[_0x7e6d('0x114')][_0x7e6d('0x6d')](this,_0x3d0795['file_id']);if(!_0x57e68b){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x3d0795,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x3d0795[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x7e6d('0x115'));}var _0xd51ff5=this['channel'][_0x7e6d('0x116')](_0x57e68b,_0x3d0795[_0x7e6d('0x117')],_0x3d0795[_0x7e6d('0x118')]);var _0x121808=_0xd51ff5[_0x7e6d('0x9f')]?_0xd51ff5[_0x7e6d('0x9f')][_0x7e6d('0x4a')]():'';logger['info'](_0x7e6d('0x119'),JSON[_0x7e6d('0x71')](_0xd51ff5));if(_0xd51ff5[_0x7e6d('0x9f')]===-0x1){this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d0795,_0x121808);return _0xd51ff5;}else if(_0xd51ff5[_0x7e6d('0xa0')]===_0x7e6d('0x65')){_0xd51ff5[_0x7e6d('0x9f')]=_0x121808[_0x7e6d('0x98')]>=parseInt(_0x3d0795[_0x7e6d('0x11a')])?'x':'i';}else{_0xd51ff5['result']=_0x121808[_0x7e6d('0x98')]>=parseInt(_0x3d0795[_0x7e6d('0x11a')])&&_0x121808[_0x7e6d('0x98')]<=parseInt(_0x3d0795['maxdigit'])?'x':'i';}var _0x6d480b=this[_0x7e6d('0x10')]['sync'](this,_0x3d0795[_0x7e6d('0xd4')]);if(!_0x6d480b){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x3d0795,_0x7e6d('0x11b'));}this['channel'][_0x7e6d('0x9c')](_0x6d480b,_0x121808);if(this[_0x7e6d('0x82')](_0x3d0795[_0x7e6d('0x11c')])){var _0x52f9a7=parseInt(_0x3d0795[_0x7e6d('0x11c')],0xa);var _0x5586d9=rs[_0x7e6d('0x11d')]({'charset':'*','length':_0x52f9a7});var _0x4c33a1=_0x121808['length'];if(_0x4c33a1>0x0){if(_0x4c33a1>_0x52f9a7){this['createSquareDetailsReport'][_0x7e6d('0x6d')](this,_0x3d0795,_0x3d0795['hiddendigitspos']===_0x7e6d('0x11e')?_0x5586d9+_0x121808[_0x7e6d('0x11f')](_0x52f9a7):_0x121808[_0x7e6d('0x11f')](0x0,_0x4c33a1-_0x52f9a7)+_0x5586d9);}else{this['createSquareDetailsReport']['sync'](this,_0x3d0795,rs[_0x7e6d('0x11d')]({'charset':'*','length':_0x4c33a1}));}}else{this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d0795,'');}}else{this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3d0795,_0x121808);}return _0xd51ff5;};AGIVertices['prototype'][_0x7e6d('0xc')]=function(_0x3c06cb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x3c06cb[_0x7e6d('0x34')]));return this['getdigits'](_0x3c06cb);};AGIVertices['prototype'][_0x7e6d('0x120')]=function(_0x3fd659){logger['info'](util['format'](_0x7e6d('0x121'),_0x3fd659['label']));this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x3fd659,_0x3fd659['goalname']);return this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x122'),_0x3fd659['goalname']));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x123')]=function(_0x32e4e5){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x32e4e5['label']));if(!this[_0x7e6d('0x82')](_0x32e4e5[_0x7e6d('0x85')])||!this[_0x7e6d('0x82')](_0x32e4e5['aws_secret_access_key'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x124'));}if(!this[_0x7e6d('0x82')](_0x32e4e5[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20text\x20configured');}this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x125'),_0x32e4e5['text']));var _0x221b68=this[_0x7e6d('0x84')][_0x7e6d('0x6d')](this,_0x32e4e5);if(_0x221b68){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0x126'),_0x221b68));var _0x545bab=this[_0x7e6d('0xd')][_0x7e6d('0x127')](_0x221b68);try{fs[_0x7e6d('0x103')](_0x221b68+_0x7e6d('0x104'));}catch(_0x4a9a6a){logger[_0x7e6d('0x50')](_0x4a9a6a);}return _0x545bab;}return this['channel']['error'](_0x32e4e5,_0x7e6d('0x128'));};AGIVertices[_0x7e6d('0xf')]['awslex']=function(_0xd308bb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0xd308bb['label']));if(!this[_0x7e6d('0x82')](_0xd308bb[_0x7e6d('0x85')])||!this[_0x7e6d('0x82')](_0xd308bb[_0x7e6d('0x86')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x124'));}if(!this['isConfigured'](_0xd308bb['aws_bot_name'])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x129'));}if(!this[_0x7e6d('0x82')](_0xd308bb['text'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xe5')]=!![];this['createSquareDetailsReport'](_0xd308bb);this[_0x7e6d('0x3e')](_0xd308bb[_0x7e6d('0x5c')],'in','','');this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('Trying\x20Amazon\x20Lex:\x20%s',_0xd308bb[_0x7e6d('0x5c')]));var _0x470308=this[_0x7e6d('0x8a')][_0x7e6d('0x6d')](this,_0xd308bb);if(_0x470308){for(var _0x149ecc in _0x470308){if(_0x470308['hasOwnProperty'](_0x149ecc)&&_['isString'](_0x470308[_0x149ecc])){this['channel']['setVariable'](util['format'](_0x7e6d('0x12a'),_0x149ecc['toUpperCase']()),_0x470308[_0x149ecc]);}}if(_[_0x7e6d('0x42')](_0x470308[_0x7e6d('0x12b')])){return this['channel']['noop'](_0x7e6d('0x12c'));}else{this[_0x7e6d('0x3e')](_0x470308[_0x7e6d('0x12b')],_0x7e6d('0xea'),'amazonlex','');return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x12d'),_0x470308[_0x7e6d('0x12b')]));}}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0xd308bb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x7e6d('0x12e')]=function(_0x16f707){logger['info'](util['format'](_0x7e6d('0x12f'),_0x16f707[_0x7e6d('0x34')],_0x16f707['timeout']));if(!this['isConfigured'](_0x16f707[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x130'));}var _0x404bfb=_0x7e6d('0x131');var _0x5f5826=util[_0x7e6d('0x27')](_0x7e6d('0x132'),FILES_PATH,rs[_0x7e6d('0x11d')](0x4));var _0x290644=util['format'](_0x7e6d('0x9b'),_0x5f5826,_0x404bfb);var _0xa008b=!![];if(_0x16f707[_0x7e6d('0x133')]===_0x7e6d('0x134')){_0xa008b=![];}var _0x32bf0f=this[_0x7e6d('0xd')]['recordFile'](_0x5f5826,_0x404bfb,_0x16f707[_0x7e6d('0x135')],_0x16f707[_0x7e6d('0x65')],undefined,_0xa008b);if(_0x32bf0f['result']!==-0x1){this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('google\x20%s\x20file\x20created',_0x290644));var _0x41ed5e=this[_0x7e6d('0x8c')]['sync'](this,_0x16f707,_0x290644);if(_0x41ed5e){for(var _0x142799 in _0x41ed5e){if(_0x41ed5e[_0x7e6d('0x92')](_0x142799)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util['format'](_0x7e6d('0x136'),_0x142799[_0x7e6d('0xe8')]()),_0x41ed5e[_0x142799]);}}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x137'),JSON[_0x7e6d('0x71')](_0x41ed5e)));}}return _0x32bf0f;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x138')]=function(_0x107732){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x139'),_0x107732[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x107732[_0x7e6d('0x8e')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x13a'));}if(!this[_0x7e6d('0x82')](_0x107732['appsecret'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x13b'));}var _0x223e4a=_0x7e6d('0x131');var _0x1541c2=util[_0x7e6d('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x7e6d('0x11d')](0x4));var _0x1aeb94=util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x1541c2,_0x223e4a);var _0x1ec370=!![];if(_0x107732['beep']==='NOBEEP'){_0x1ec370=![];}var _0x16907e=this[_0x7e6d('0xd')][_0x7e6d('0x13c')](_0x1541c2,_0x223e4a,_0x107732['intKey'],_0x107732[_0x7e6d('0x65')],undefined,_0x1ec370);if(_0x16907e[_0x7e6d('0x9f')]!==-0x1){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x13d'),_0x1aeb94));var _0x3343b0=this[_0x7e6d('0x8d')][_0x7e6d('0x6d')](this,_0x107732,_0x1aeb94);if(_0x3343b0){for(var _0x3d8efc in _0x3343b0){if(_0x3343b0[_0x7e6d('0x92')](_0x3d8efc)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')]('TILDE_ASR_%s',_0x3d8efc['toUpperCase']()),_0x3343b0[_0x3d8efc]);}}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x13e'),JSON['stringify'](_0x3343b0)));}}return _0x16907e;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x13f')]=function(_0x267695){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x140'),_0x267695[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['continueAt'](_0x267695[_0x7e6d('0x39')],_0x267695['extension'],_0x267695[_0x7e6d('0x141')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x142')]=function(_0x57c51b){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x143'),_0x57c51b[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x57c51b[_0x7e6d('0x144')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x57c51b,_0x7e6d('0x145'));}try{var _0x5c396f=eval(_0x57c51b['condition'])?_0x7e6d('0x146'):_0x7e6d('0x147');this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x148'),_0x57c51b[_0x7e6d('0x144')],_0x5c396f));return{'code':0xc8,'result':_0x5c396f};}catch(_0x402603){return{'code':0xc8,'result':_0x7e6d('0x147')};}};AGIVertices['prototype'][_0x7e6d('0x149')]=function(_0x17e526){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x14a'),_0x17e526['label']));if(!this[_0x7e6d('0x82')](_0x17e526[_0x7e6d('0x14b')])){return this[_0x7e6d('0xd')]['error'](_0x17e526,_0x7e6d('0x14c'));}var _0x346fda=this[_0x7e6d('0x23')]['sync'](this,_0x17e526[_0x7e6d('0x14b')]);if(!_0x346fda){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x17e526,_0x7e6d('0x14d'));}for(var _0x1916ed=0x0;_0x1916ed<_0x346fda[_0x7e6d('0x98')];_0x1916ed+=0x1){var _0x2d0e24=this[_0x7e6d('0xd')][_0x7e6d('0x10')](util[_0x7e6d('0x27')]('IFTIME(%s?true:false)',_0x346fda[_0x1916ed]));if(_0x2d0e24[_0x7e6d('0x9f')]===-0x1){return _0x2d0e24;}logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('IFTIME\x20%s\x20%s',_0x346fda[_0x1916ed],_0x2d0e24[_0x7e6d('0xa0')]));if(_0x2d0e24[_0x7e6d('0xa0')]===_0x7e6d('0x146')){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x14e'),_0x346fda[_0x1916ed],'true'));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('IFTIME\x20%s\x20%s',_0x346fda[_0x1916ed],'true'));return{'code':0xc8,'result':_0x7e6d('0x146')};}else{logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x14e'),_0x346fda[_0x1916ed],'false'));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x14e'),_0x346fda[_0x1916ed],'false'));}}return{'code':0xc8,'result':_0x7e6d('0x147')};};AGIVertices['prototype']['hangup']=function(_0x447a01){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x447a01[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')][_0x7e6d('0x14f')]();};AGIVertices['prototype'][_0x7e6d('0x150')]=function(_0x27b05b){logger['info'](util[_0x7e6d('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x27b05b[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x27b05b[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x130'));}var _0x3f8d53='wav';var _0x147e82=util[_0x7e6d('0x27')](_0x7e6d('0x132'),FILES_PATH,rs[_0x7e6d('0x11d')](0x4));var _0x1278d7=util[_0x7e6d('0x27')](_0x7e6d('0x9b'),_0x147e82,_0x3f8d53);var _0x27c8cb=!![];if(_0x27b05b[_0x7e6d('0x133')]==='NOBEEP'){_0x27c8cb=![];}var _0x29ce46=this[_0x7e6d('0xd')][_0x7e6d('0x13c')](_0x147e82,_0x3f8d53,_0x27b05b[_0x7e6d('0x135')],_0x27b05b[_0x7e6d('0x65')],undefined,_0x27c8cb);if(_0x29ce46[_0x7e6d('0x9f')]!==-0x1){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format']('ispeech\x20%s\x20file\x20created',_0x1278d7));var _0x1437f4=this[_0x7e6d('0x80')][_0x7e6d('0x6d')](this,_0x27b05b,_0x1278d7);if(_0x1437f4){for(var _0x52b039 in _0x1437f4){if(_0x1437f4['hasOwnProperty'](_0x52b039)){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')]('ISPEECH_ASR_%s',_0x52b039[_0x7e6d('0xe8')]()),_0x1437f4[_0x52b039]);}}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x151'),JSON[_0x7e6d('0x71')](_0x1437f4)));}}return _0x29ce46;};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x152')]=function(_0x2b8934){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x153'),_0x2b8934['label']));if(!this[_0x7e6d('0x82')](_0x2b8934[_0x7e6d('0x78')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x130'));}if(!this[_0x7e6d('0x82')](_0x2b8934['text'])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x154'),_0x2b8934[_0x7e6d('0x5c')]));var _0x20fd8a=this[_0x7e6d('0x7d')][_0x7e6d('0x6d')](this,_0x2b8934);if(_0x20fd8a){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('ispeech\x20%s\x20file\x20created',_0x20fd8a));var _0x379e2c=this[_0x7e6d('0xd')]['streamFile'](_0x20fd8a,_0x2b8934['intKey']);try{fs[_0x7e6d('0x103')](_0x20fd8a+'.wav');}catch(_0x1b0a06){logger[_0x7e6d('0x50')](_0x1b0a06);}return _0x379e2c;}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x2b8934,_0x7e6d('0x155'));};AGIVertices['prototype'][_0x7e6d('0x156')]=function(_0x59520d){logger['info'](util[_0x7e6d('0x27')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x59520d['label']));if(!this['isConfigured'](_0x59520d['findBy'])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x59520d,_0x7e6d('0x157'));}logger[_0x7e6d('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7e6d('0xd')]['callerid'],_0x59520d['findBy']));var _0x40f548=this[_0x7e6d('0x56')][_0x7e6d('0x6d')](this,_0x59520d[_0x7e6d('0x158')]);if(_0x40f548){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x159'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x59520d['findBy']));this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this['channel'][_0x7e6d('0x36')],_0x59520d[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger['info'](util[_0x7e6d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x59520d[_0x7e6d('0x158')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this['channel'][_0x7e6d('0x36')],_0x59520d[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices['prototype'][_0x7e6d('0x15d')]=function(_0x5430f5){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15e'),_0x5430f5[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x5430f5[_0x7e6d('0x158')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x5430f5,_0x7e6d('0x157'));}logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15f'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x5430f5[_0x7e6d('0x158')]));var _0x472773=this[_0x7e6d('0x52')][_0x7e6d('0x6d')](this,_0x5430f5[_0x7e6d('0x158')]);if(_0x472773){logger[_0x7e6d('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7e6d('0xd')]['callerid'],_0x5430f5[_0x7e6d('0x158')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x5430f5[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x5430f5['findBy']));this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this['channel']['callerid'],_0x5430f5[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices['prototype'][_0x7e6d('0x160')]=function(_0x5fbca2){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5fbca2[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x5fbca2['operation'])){return this[_0x7e6d('0xd')]['error'](_0x5fbca2,'no\x20operation\x20configured');}this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x161'),_0x5fbca2[_0x7e6d('0x162')]));var _0xa5fef5=eval(_0x5fbca2['operation']);if(!this['isConfigured'](_0x5fbca2[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x115'));}var _0x53c86a=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x5fbca2['variable_id']);if(!_0x53c86a){return this['channel'][_0x7e6d('0x50')](_0x5fbca2,_0x7e6d('0x11b'));}if(_[_0x7e6d('0x97')](_0xa5fef5)){var _0x3966dc=this;_0xa5fef5['forEach'](function(_0x5e6ee4,_0x5abc67){_0x3966dc['channel'][_0x7e6d('0x9c')](util[_0x7e6d('0x27')]('%s[%s]',_0x53c86a,_0x5abc67),_0x5e6ee4);});return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')]('variable\x20%s[key]\x20set',_0x53c86a));}else{return this[_0x7e6d('0xd')][_0x7e6d('0x9c')](_0x53c86a,_0xa5fef5);}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0xa')]=function(_0x19c2e1){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x163'),_0x19c2e1['label']));if(_0x19c2e1[_0x7e6d('0xa2')]===0x0){return this[_0x7e6d('0xa1')](_0x19c2e1);}_0x19c2e1[_0x7e6d('0xa2')]-=0x1;if(!this['isConfigured'](_0x19c2e1[_0x7e6d('0x112')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x19c2e1,_0x7e6d('0x113'));}var _0x403c71=this[_0x7e6d('0x114')]['sync'](this,_0x19c2e1[_0x7e6d('0x112')]);if(!_0x403c71){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x19c2e1,'no\x20file\x20audio\x20found');}var _0x3b3cab=this[_0x7e6d('0xd')][_0x7e6d('0x116')](_0x403c71,_0x19c2e1[_0x7e6d('0x117')],_0x19c2e1[_0x7e6d('0x164')]);var _0xe07ec3=_0x3b3cab[_0x7e6d('0x9f')];if(_0x3b3cab[_0x7e6d('0x9f')]===-0x1){this[_0x7e6d('0x33')]['sync'](this,_0x19c2e1,'-1');return _0x3b3cab;}else if(_0x3b3cab[_0x7e6d('0xa0')]==='timeout'){_0x3b3cab['result']=_0x3b3cab[_0x7e6d('0x9f')]['length']>0x0?_0x3b3cab[_0x7e6d('0x9f')]:'t';}else if(_['isEmpty'](_0x3b3cab[_0x7e6d('0x9f')])){_0x3b3cab[_0x7e6d('0x9f')]='#';_0xe07ec3='#';}if(!this[_0x7e6d('0x82')](_0x19c2e1['variable_id'])){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x115'));}else{var _0x30c9b3=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x19c2e1[_0x7e6d('0xd4')]);if(!_0x30c9b3){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x19c2e1,_0x7e6d('0x11b'));}this[_0x7e6d('0xd')]['setVariable'](_0x30c9b3,_0xe07ec3);}this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x19c2e1,_0xe07ec3);return _0x3b3cab;};AGIVertices[_0x7e6d('0xf')]['noop']=function(_0x505718){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x165'),_0x505718[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['noop'](_0x505718[_0x7e6d('0x166')]||_0x505718[_0x7e6d('0x34')]);};AGIVertices[_0x7e6d('0xf')]['pause']=function(_0x43dd39){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x167'),_0x43dd39[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x43dd39[_0x7e6d('0x158')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x43dd39,_0x7e6d('0x157'));}logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x15f'),this['channel']['callerid'],_0x43dd39[_0x7e6d('0x158')]));var _0x38fc53=this[_0x7e6d('0x4c')][_0x7e6d('0x6d')](this,_0x43dd39[_0x7e6d('0x168')]);var _0x148fbb=this[_0x7e6d('0x4e')]['sync'](this,_0x43dd39[_0x7e6d('0x158')],_0x38fc53);if(_0x148fbb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this['channel'][_0x7e6d('0x36')],_0x43dd39['findBy']));this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this[_0x7e6d('0xd')]['callerid'],_0x43dd39[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x43dd39[_0x7e6d('0x158')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0x159'),this['channel'][_0x7e6d('0x36')],_0x43dd39[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x169')]=function(_0x4b6994){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4b6994['label']));if(!this['isConfigured'](_0x4b6994[_0x7e6d('0x112')])){return this['channel'][_0x7e6d('0x50')](_0x4b6994,_0x7e6d('0x113'));}var _0x23cca4=this['getSound'][_0x7e6d('0x6d')](this,_0x4b6994[_0x7e6d('0x112')]);if(!_0x23cca4){return this['channel'][_0x7e6d('0x50')](_0x4b6994,_0x7e6d('0x16a'));}var _0x22f349=this[_0x7e6d('0xd')]['exec'](_0x7e6d('0x16b'),[_0x23cca4,_0x4b6994[_0x7e6d('0xe2')]]);if(_0x22f349[_0x7e6d('0x9f')]===-0x1){return _0x22f349;}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),'PLAYBACK',_0x23cca4));};AGIVertices[_0x7e6d('0xf')]['queue']=function(_0x42e495){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x16c'),_0x42e495[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x42e495[_0x7e6d('0x16d')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x42e495,'no\x20queue\x20selected');}var _0x3d3f5e='';var _0x52009f=parseInt(_0x42e495[_0x7e6d('0x16d')],0xa);if(isNaN(_0x52009f)){_0x3d3f5e=_0x42e495[_0x7e6d('0x16d')];}else{_0x3d3f5e=this[_0x7e6d('0x15')]['sync'](this,_0x42e495[_0x7e6d('0x16d')]);if(!_0x3d3f5e){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x42e495,_0x7e6d('0x16e'));}}var _0x42e2a4='';if(this[_0x7e6d('0x82')](_0x42e495['file_id'])){var _0x4b1033=this['getSound'][_0x7e6d('0x6d')](this,_0x42e495[_0x7e6d('0x112')]);if(_0x4b1033){_0x42e2a4=_0x4b1033;}}this['createSquareDetailsReport'][_0x7e6d('0x6d')](this,_0x42e495,_0x3d3f5e);if(_0x42e495['opts'][_0x7e6d('0x16f')]('x')<0x0){_0x42e495[_0x7e6d('0xe2')]+='x';}if(_0x42e495[_0x7e6d('0xe2')][_0x7e6d('0x16f')]('X')<0x0){_0x42e495[_0x7e6d('0xe2')]+='X';}this['channel'][_0x7e6d('0x9c')](_0x7e6d('0x170'),_0x3d3f5e?_0x3d3f5e[_0x7e6d('0x171')]():'');var _0x18ec22=this['channel']['exec'](_0x7e6d('0x172'),[_0x3d3f5e,_0x42e495['opts'],_0x42e495[_0x7e6d('0x63')],_0x42e2a4,_0x42e495['timeout'],_0x42e495[_0x7e6d('0xb2')],_0x42e495[_0x7e6d('0x173')],_0x42e495['gosub'],'',_0x42e495[_0x7e6d('0x174')]]);if(_0x18ec22[_0x7e6d('0x9f')]===-0x1){return _0x18ec22;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),'QUEUE',_0x3d3f5e));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x175')]=function(_0x5e15eb){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5e15eb[_0x7e6d('0x34')]));var _0x180ab5=_0x5e15eb[_0x7e6d('0x176')]||'wav';var _0x2161da=util['format'](_0x7e6d('0x177'),this[_0x7e6d('0xd')]['uniqueid'],rs[_0x7e6d('0x11d')](0x5));var _0x5a350f=util[_0x7e6d('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x2161da,_0x180ab5);var _0x22a86f=util[_0x7e6d('0x27')]('%s/recordings/%s',FILES_PATH,_0x2161da);this[_0x7e6d('0x37')][_0x7e6d('0x6d')](this,_0x5e15eb,_0x2161da,_0x5a350f);this[_0x7e6d('0xd')][_0x7e6d('0x9c')](_0x7e6d('0x178'),_0x2161da);logger['info'](_0x7e6d('0x179'),_0x22a86f,_0x180ab5,_0x5e15eb[_0x7e6d('0x17a')],_0x5e15eb[_0x7e6d('0x65')]);return this[_0x7e6d('0xd')][_0x7e6d('0x13c')](_0x22a86f,_0x180ab5,_0x5e15eb[_0x7e6d('0x17a')],_0x5e15eb[_0x7e6d('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x7e6d('0x17b')]=function(_0x1a6a69){logger['info'](util[_0x7e6d('0x27')](_0x7e6d('0x17c'),_0x1a6a69[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x1a6a69[_0x7e6d('0x63')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x17d'));}var _0x311138=this[_0x7e6d('0x17e')][_0x7e6d('0x6d')](this,_0x1a6a69);logger['info'](util['format'](_0x7e6d('0x17f'),util['inspect'](_0x311138,{'showHidden':![],'depth':null})));if(!this[_0x7e6d('0x82')](_0x1a6a69[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0x180'));}var _0x22e222=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x1a6a69[_0x7e6d('0xd4')]);if(!_0x22e222){return this[_0x7e6d('0xd')]['error'](_0x1a6a69,_0x7e6d('0x11b'));}this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util[_0x7e6d('0x27')](_0x7e6d('0x181'),_0x22e222),_0x311138[_0x7e6d('0x73')]?_0x311138[_0x7e6d('0x73')]:_0x7e6d('0x182'));this[_0x7e6d('0xd')][_0x7e6d('0x9c')](util['format']('%s_STATUS_MESSAGE',_0x22e222),_0x311138[_0x7e6d('0x74')]?_0x311138[_0x7e6d('0x74')]:'OK');if(_0x311138['body']){try{this[_0x7e6d('0x9a')](_0x311138[_0x7e6d('0x68')],_0x22e222);}catch(_0x3abf97){logger[_0x7e6d('0x50')](util[_0x7e6d('0x27')](_0x7e6d('0x183'),_0x22e222));}}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')]('variable\x20%s\x20set',_0x22e222));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x184')]=function(_0xe8bc0b){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x185'),_0xe8bc0b[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')]['sayDigits'](_0xe8bc0b[_0x7e6d('0x186')][_0x7e6d('0x5a')](/\s+/g,''),_0xe8bc0b[_0x7e6d('0x17a')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x187')]=function(_0x51a5dd){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x188'),_0x51a5dd[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')][_0x7e6d('0x189')](_0x51a5dd[_0x7e6d('0x18a')][_0x7e6d('0x5a')](/\s+/g,''),_0x51a5dd[_0x7e6d('0x17a')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x18b')]=function(_0x5ad7d0){logger['info'](util[_0x7e6d('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5ad7d0[_0x7e6d('0x34')]));return this[_0x7e6d('0xd')][_0x7e6d('0x18c')](_0x5ad7d0[_0x7e6d('0x5c')],_0x5ad7d0[_0x7e6d('0x17a')]);};AGIVertices['prototype']['sendMail']=function(_0x57dbb1){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x18d'),_0x57dbb1[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x57dbb1[_0x7e6d('0x18e')])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x18f'));}var _0x301659=this['getMailAccount'][_0x7e6d('0x6d')](this,_0x57dbb1[_0x7e6d('0x18e')]);if(!_0x301659||!_0x301659[_0x7e6d('0x190')]){return this['channel'][_0x7e6d('0x50')](_0x57dbb1,_0x7e6d('0x191'));}var _0x3e0125={'from':util[_0x7e6d('0x27')]('\x22%s\x22\x20<%s>',_0x301659[_0x7e6d('0x13')],_0x301659[_0x7e6d('0x192')]||_0x301659[_0x7e6d('0x190')][_0x7e6d('0x193')]),'to':_0x57dbb1['to']||'','cc':_0x57dbb1['cc']||'','bcc':_0x57dbb1['bcc']||'','subject':_0x57dbb1[_0x7e6d('0x194')],'html':_0x57dbb1[_0x7e6d('0x5c')],'text':_0x57dbb1['text']};if(this['isConfigured'](_0x57dbb1[_0x7e6d('0x195')])){}logger['debug'](_0x7e6d('0x196'),JSON[_0x7e6d('0x71')](_0x3e0125));this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x57dbb1,_0x57dbb1[_0x7e6d('0x18e')]);this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x197'),_0x301659[_0x7e6d('0x13')]));this[_0x7e6d('0x198')][_0x7e6d('0x6d')](this,_0x301659[_0x7e6d('0x199')],_0x3e0125);return this['channel']['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x19a')]=function(_0x438779){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x19b'),_0x438779[_0x7e6d('0x34')]));return this['channel'][_0x7e6d('0xa4')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x19c')]=function(_0x34d109){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x19d'),_0x34d109[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x34d109['sms_account_id'])){return this['channel'][_0x7e6d('0xa4')](_0x7e6d('0x19e'));}var _0x18a8cd=this[_0x7e6d('0x31')][_0x7e6d('0x6d')](this,_0x34d109[_0x7e6d('0x19f')]);if(!_0x18a8cd){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x34d109,_0x7e6d('0x1a0'));}var _0x466929={'body':_0x34d109[_0x7e6d('0x1a1')],'phone':_0x34d109['to']||'','SmsAccountId':_0x18a8cd['id']};logger['debug']('sendSMS\x20message',JSON['stringify'](_0x466929));this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x34d109,_0x34d109[_0x7e6d('0x19f')]);this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1a2'),_0x18a8cd[_0x7e6d('0x13')]));this[_0x7e6d('0x32')]['sync'](this,_0x466929);return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x7e6d('0xf')]['set']=function(_0x437375){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1a3'),_0x437375[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x437375[_0x7e6d('0xd4')])){return this['channel']['error'](_0x437375,'no\x20variable\x20selected');}var _0x526c2e=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x437375[_0x7e6d('0xd4')]);if(!_0x526c2e){return this['channel'][_0x7e6d('0x50')](_0x437375,_0x7e6d('0x11b'));}return this[_0x7e6d('0xd')]['setVariable'](_0x526c2e,_0x437375[_0x7e6d('0x1a4')]);};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1a5')]=function(_0x2a80d1){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1a6'),_0x2a80d1[_0x7e6d('0x34')]));this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x1a7'));if(_0x2a80d1[_0x7e6d('0xb5')]===_0x7e6d('0x1a8')){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x1a9'));return this[_0x7e6d('0xd')][_0x7e6d('0xb5')]();}return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](_0x7e6d('0x1aa'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1ab')]=function(_0x2cda56){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1ac'),_0x2cda56[_0x7e6d('0x34')]));if(!this[_0x7e6d('0x82')](_0x2cda56[_0x7e6d('0x1ad')])){return this['channel'][_0x7e6d('0x50')](_0x2cda56,_0x7e6d('0x1ae'));}var _0x659956=this[_0x7e6d('0x17')][_0x7e6d('0x6d')](this,_0x2cda56['project_id']);if(!this['isConfigured'](_0x659956)){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x2cda56,util[_0x7e6d('0x27')](_0x7e6d('0x1af'),_0x2cda56[_0x7e6d('0x1ad')]));}if(_0x659956===this['channel'][_0x7e6d('0x3d')]){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x2cda56,_0x7e6d('0x1b0'));}this['createSquareDetailsReport']['sync'](this,_0x2cda56,_0x659956);var _0x25994d=this['channel']['exec'](_0x7e6d('0x1b1'),util[_0x7e6d('0x27')](_0x7e6d('0x1b2'),config[_0x7e6d('0xb2')]['host']||_0x7e6d('0x1b3'),_0x659956,this['channel'][_0x7e6d('0x3d')]));if(_0x25994d['result']===-0x1){return _0x25994d;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),'AGI',_0x659956));};AGIVertices[_0x7e6d('0xf')]['system']=function(_0x37c613){logger['info'](util['format'](_0x7e6d('0x1b4'),_0x37c613[_0x7e6d('0x34')]));var _0x3b72d7=this[_0x7e6d('0x57')][_0x7e6d('0x6d')](this,_0x37c613[_0x7e6d('0xb4')]);this[_0x7e6d('0x33')][_0x7e6d('0x6d')](this,_0x37c613,_0x37c613[_0x7e6d('0xb4')]);if(this[_0x7e6d('0x82')](_0x37c613[_0x7e6d('0xd4')])){var _0x2084a3=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x37c613[_0x7e6d('0xd4')]);if(_0x2084a3){this[_0x7e6d('0xd')][_0x7e6d('0x9c')](_0x2084a3,_0x3b72d7);return this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util['format'](_0x7e6d('0x1b5'),_0x37c613[_0x7e6d('0xb4')],_0x2084a3));}}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x1b6'),_0x37c613[_0x7e6d('0xb4')]));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1b7')]=function(_0x284fb3){logger[_0x7e6d('0x2c')](util['format'](_0x7e6d('0x1b8'),_0x284fb3[_0x7e6d('0x34')]));_0x284fb3[_0x7e6d('0x5c')]=_0x284fb3[_0x7e6d('0x5c')][_0x7e6d('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7e6d('0x82')](_0x284fb3['apiKey'])){return this[_0x7e6d('0xd')][_0x7e6d('0xa4')]('no\x20apiKey\x20configured');}if(!this[_0x7e6d('0x82')](_0x284fb3[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1b9'),_0x284fb3[_0x7e6d('0x5c')]));var _0x5bfacc=this[_0x7e6d('0x5b')][_0x7e6d('0x6d')](this,_0x284fb3);if(_0x5bfacc){this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1ba'),_0x5bfacc));var _0x335fc3=this[_0x7e6d('0xd')][_0x7e6d('0x127')](_0x5bfacc);try{fs['unlink'](_0x5bfacc+'.wav');}catch(_0xfd8d8f){logger[_0x7e6d('0x50')](_0xfd8d8f);}return _0x335fc3;}return this[_0x7e6d('0xd')]['error'](_0x284fb3,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1bb')]=function(_0x52fee5){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1bc'),_0x52fee5[_0x7e6d('0x34')]));_0x52fee5[_0x7e6d('0x5c')]=_0x52fee5[_0x7e6d('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7e6d('0x82')](_0x52fee5[_0x7e6d('0x5c')])){return this[_0x7e6d('0xd')]['noop'](_0x7e6d('0xa5'));}this[_0x7e6d('0xd')][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x1bd'),_0x52fee5[_0x7e6d('0x5c')]));var _0x35147f=this[_0x7e6d('0x62')][_0x7e6d('0x6d')](this,_0x52fee5);if(_0x35147f){this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x35147f));var _0x6f5600=this[_0x7e6d('0xd')][_0x7e6d('0x127')](_0x35147f);try{fs[_0x7e6d('0x103')](_0x35147f+_0x7e6d('0x104'));}catch(_0x22279c){logger['error'](_0x22279c);}return _0x6f5600;}return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x52fee5,_0x7e6d('0x1be'));};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1bf')]=function(_0x3c8ac0){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1c0'),_0x3c8ac0[_0x7e6d('0x34')]));if(!this['isConfigured'](_0x3c8ac0['findBy'])){return this['channel'][_0x7e6d('0x50')](_0x3c8ac0,_0x7e6d('0x157'));}logger['info'](util['format'](_0x7e6d('0x15f'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x3c8ac0['findBy']));var _0x5289ef=this['agentUnpause'][_0x7e6d('0x6d')](this,_0x3c8ac0[_0x7e6d('0x158')]);if(_0x5289ef){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7e6d('0x36')],_0x3c8ac0[_0x7e6d('0x158')]));this['channel'][_0x7e6d('0xa4')](util[_0x7e6d('0x27')](_0x7e6d('0x159'),this['channel']['callerid'],_0x3c8ac0[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15a')};}else{logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x3c8ac0['findBy']));this['channel']['noop'](util[_0x7e6d('0x27')](_0x7e6d('0x15b'),this[_0x7e6d('0xd')][_0x7e6d('0x36')],_0x3c8ac0[_0x7e6d('0x158')]));return{'code':0xc8,'result':_0x7e6d('0x15c')};}};AGIVertices[_0x7e6d('0xf')][_0x7e6d('0x1c1')]=function(_0x15041b){logger['info'](util['format'](_0x7e6d('0x1c2'),_0x15041b['label']));var _0x35beec=this[_0x7e6d('0xd')][_0x7e6d('0x58')](_0x7e6d('0x1c3'),[_0x15041b[_0x7e6d('0x1c4')],_0x15041b[_0x7e6d('0x76')]]);if(_0x35beec['result']===-0x1){return _0x35beec;}return this[_0x7e6d('0xd')]['noop'](util[_0x7e6d('0x27')](_0x7e6d('0xc0'),_0x7e6d('0x1c3'),_0x15041b[_0x7e6d('0x1c4')]));};AGIVertices[_0x7e6d('0xf')]['vswitch']=function(_0x5d3cdd){logger[_0x7e6d('0x2c')](util[_0x7e6d('0x27')](_0x7e6d('0x1c5'),_0x5d3cdd['label']));if(!this[_0x7e6d('0x82')](_0x5d3cdd[_0x7e6d('0xd4')])){return this[_0x7e6d('0xd')][_0x7e6d('0x50')](_0x5d3cdd,'no\x20variable\x20selected');}var _0x18f9c0=this[_0x7e6d('0x10')][_0x7e6d('0x6d')](this,_0x5d3cdd[_0x7e6d('0xd4')]);if(!_0x18f9c0){return this['channel'][_0x7e6d('0x50')](_0x5d3cdd,_0x7e6d('0x11b'));}var _0x1fe23e=this[_0x7e6d('0xd')]['getVariable'](_0x18f9c0);return{'code':0xc8,'result':_0x1fe23e[_0x7e6d('0xa0')]?_0x1fe23e['extra']:'-'};};String[_0x7e6d('0xf')][_0x7e6d('0x1c6')]=function(_0x207b92,_0x35786d){return this[_0x7e6d('0x9d')](_0x207b92)['join'](_0x35786d);};module[_0x7e6d('0x1c7')]=AGIVertices; \ No newline at end of file +var _0x6170=['LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','google_tts_language','restAPI','url','number','timeout','includes','POST','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','isConfigured','model','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','aws_access_key_id','googleASR','google_asr_language','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','replaceAllVariables','split','replaceAll','extra','toString','getAndSetVariable','result','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','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','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','NOBEEP','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','no\x20key\x20configured','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','failure','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','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:','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','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','getMailAccount','account_id','no\x20mail\x20account\x20found','email','Smtp','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','streamFile','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/environment/shared','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','mailRpc','sendMailMessage','getIntervals','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x6170,0x17d));var _0x0617=function(_0x151b3c,_0x1f8289){_0x151b3c=_0x151b3c-0x0;var _0x1f30e1=_0x6170[_0x151b3c];return _0x1f30e1;};'use strict';var fs=require('fs');var util=require(_0x0617('0x0'));var _=require(_0x0617('0x1'));var sh=require(_0x0617('0x2'));var odbc=require(_0x0617('0x3'))();var rs=require('randomstring');var moment=require(_0x0617('0x4'));var Mustache=require(_0x0617('0x5'));var rp=require(_0x0617('0x6'));var logger=require('../../config/logger')('agi');var config=require('../../config/environment');var shared=require(_0x0617('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x0617('0x8');var recursiveMapAttributes=[_0x0617('0x9'),_0x0617('0xa')];var verticesWithRetry=[_0x0617('0xb'),_0x0617('0xc'),_0x0617('0xd')];var AGIVertices=function(_0x8de8b3,_0x2dd590,_0x3a98a6){this[_0x0617('0xe')]=_0x8de8b3;this[_0x0617('0xf')]=_0x2dd590;this['mailRpc']=_0x3a98a6;};AGIVertices[_0x0617('0x10')][_0x0617('0x11')]=function(_0x310e85,_0x5c6c2b){this[_0x0617('0xf')][_0x0617('0x12')](_0x310e85)[_0x0617('0x13')](function(_0x576250){_0x5c6c2b(null,_0x576250?_0x576250[_0x0617('0x14')]:![]);})[_0x0617('0x15')](function(_0x39436e){_0x5c6c2b(_0x39436e);});};AGIVertices[_0x0617('0x10')][_0x0617('0x16')]=function(_0x330864,_0x9229fc){this['rpc'][_0x0617('0x17')](_0x330864)['then'](function(_0x4a2fcc){_0x9229fc(null,_0x4a2fcc?_0x4a2fcc[_0x0617('0x14')]:![]);})[_0x0617('0x15')](function(_0x188b26){_0x9229fc(_0x188b26);});};AGIVertices[_0x0617('0x10')][_0x0617('0x18')]=function(_0x5d4c03,_0x4b0a56){this[_0x0617('0xf')][_0x0617('0x19')](_0x5d4c03)[_0x0617('0x13')](function(_0x3177d3){_0x4b0a56(null,_0x3177d3?_0x3177d3[_0x0617('0x14')]:![]);})[_0x0617('0x15')](function(_0x200428){_0x4b0a56(_0x200428);});};AGIVertices[_0x0617('0x10')][_0x0617('0x1a')]=function(_0x5605be,_0x2a4b86){this[_0x0617('0xf')][_0x0617('0x1b')](_0x5605be)['then'](function(_0x1c1e6f){_0x2a4b86(null,_0x1c1e6f?_0x1c1e6f[_0x0617('0x1c')]:![]);})['catch'](function(_0xd33c73){_0x2a4b86(_0xd33c73);});};AGIVertices[_0x0617('0x10')]['getUser']=function(_0x212191,_0x32e10a){this['rpc'][_0x0617('0x1d')](_0x212191)[_0x0617('0x13')](function(_0x1cb0bb){_0x32e10a(null,_0x1cb0bb?_0x1cb0bb[_0x0617('0x14')]:![]);})['catch'](function(_0x5989b8){_0x32e10a(_0x5989b8);});};AGIVertices[_0x0617('0x10')][_0x0617('0x1e')]=function(_0x4ebe42,_0x193b81){this[_0x0617('0xf')]['getTrunkById'](_0x4ebe42)[_0x0617('0x13')](function(_0x485711){_0x193b81(null,_0x485711?_0x485711[_0x0617('0x14')]:![]);})[_0x0617('0x15')](function(_0xaba0f8){_0x193b81(_0xaba0f8);});};AGIVertices[_0x0617('0x10')][_0x0617('0x1f')]=function(_0x269238,_0x32ef28){var _0x2080dd=this;this[_0x0617('0xf')][_0x0617('0x20')](_0x269238)['then'](function(_0x2c92c6){_0x32ef28(null,_0x2c92c6?_0x2080dd[_0x0617('0x21')](_0x2c92c6[_0x0617('0x22')]):![]);})[_0x0617('0x15')](function(_0x94815c){_0x32ef28(_0x94815c);});};AGIVertices[_0x0617('0x10')]['getMailAccount']=function(_0x351b37,_0x1b478b){this['rpc']['getMailAccountById'](_0x351b37)[_0x0617('0x13')](function(_0x3388b7){_0x1b478b(null,_0x3388b7?_0x3388b7:![]);})[_0x0617('0x15')](function(_0x3cfeb3){_0x1b478b(_0x3cfeb3);});};AGIVertices['prototype']['sendMailMessage']=function(_0x4ff00f,_0x2dded3,_0x3eadce){this[_0x0617('0x23')][_0x0617('0x24')](_0x4ff00f,_0x2dded3)[_0x0617('0x13')](function(){_0x3eadce(null);})[_0x0617('0x15')](function(_0x56cc43){_0x3eadce(_0x56cc43);});};AGIVertices[_0x0617('0x10')][_0x0617('0x25')]=function(_0x19663d,_0x19cd31){this[_0x0617('0xf')]['getIntervalById'](_0x19663d)[_0x0617('0x13')](function(_0x148405){if(_0x148405){if(_0x148405['IntervalId']){_0x19cd31(null,[_0x148405[_0x0617('0x26')]]);}else{_0x19cd31(null,_[_0x0617('0x27')](_0x148405[_0x0617('0x28')],_0x0617('0x26')));}}else{_0x19cd31(null,![]);}})[_0x0617('0x15')](function(_0x29af55){_0x19cd31(_0x29af55);});};AGIVertices['prototype']['getSoundPath']=function(_0xa68d3d){return util[_0x0617('0x29')](_0x0617('0x2a'),FILES_PATH,_0xa68d3d);};AGIVertices['prototype'][_0x0617('0x2b')]=function(_0x175777,_0x5bd03b,_0x4fa32d){odbc[_0x0617('0x2c')](_0x175777,function(_0xf7562){if(_0xf7562){logger[_0x0617('0x2d')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0xf7562);_0x4fa32d(_0xf7562);}else{logger[_0x0617('0x2e')]('ODBC\x20connection\x20successfully');odbc[_0x0617('0x2f')](_0x5bd03b,function(_0xdf73af,_0x5b279){if(_0xdf73af){logger[_0x0617('0x2e')](_0x0617('0x30'),_0x5bd03b);_0x4fa32d(_0xdf73af);}else{logger[_0x0617('0x2e')](_0x0617('0x31'),_0x5bd03b);odbc[_0x0617('0x32')](function(_0x26bff4){if(_0x26bff4){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x26bff4);}_0x4fa32d(null,_0x5b279);});}});}});};AGIVertices[_0x0617('0x10')][_0x0617('0x33')]=function(_0xf6b9d0,_0x2c98b2){this[_0x0617('0xf')][_0x0617('0x34')](_0xf6b9d0)['then'](function(_0x408079){_0x2c98b2(null,_0x408079?_0x408079:![]);})[_0x0617('0x15')](function(_0x5b0b60){_0x2c98b2(_0x5b0b60);});};AGIVertices[_0x0617('0x10')][_0x0617('0x35')]=function(_0x32c454,_0x54d830){this[_0x0617('0xf')][_0x0617('0x35')](_0x32c454)[_0x0617('0x13')](function(_0x3acee6){_0x54d830(null,_0x3acee6);})[_0x0617('0x15')](function(_0x3a1da1){_0x54d830(_0x3a1da1);});};AGIVertices['prototype'][_0x0617('0x36')]=function(_0x4912d9,_0x4651d3,_0x3a4755){this[_0x0617('0xf')][_0x0617('0x36')]({'uniqueid':this['channel'][_0x0617('0x37')],'node':_0x4912d9[_0x0617('0x38')],'application':_0x4912d9[_0x0617('0x39')],'data':_0x4651d3||null,'project_name':this[_0x0617('0xe')][_0x0617('0x3a')],'callerid':this[_0x0617('0xe')][_0x0617('0x3b')]})['then'](function(_0x32a394){if(_0x3a4755){_0x3a4755(null,_0x32a394);}})[_0x0617('0x15')](function(_0x44cfab){if(_0x3a4755){_0x3a4755(_0x44cfab);}});};AGIVertices[_0x0617('0x10')][_0x0617('0x3c')]=function(_0x6b44f0,_0xa8230f,_0x45307f,_0x468883){this[_0x0617('0xf')][_0x0617('0x3c')]({'uniqueid':this[_0x0617('0xe')]['uniqueid'],'callerid':this[_0x0617('0xe')][_0x0617('0x3b')],'calleridname':this[_0x0617('0xe')][_0x0617('0x3d')],'context':this[_0x0617('0xe')][_0x0617('0x3e')],'extension':this[_0x0617('0xe')]['extension'],'priority':this[_0x0617('0xe')]['priority'],'accountcode':this[_0x0617('0xe')][_0x0617('0x3f')],'dnid':this[_0x0617('0xe')][_0x0617('0x40')],'projectName':this['channel']['arg_1'],'saveName':_0xa8230f,'filename':_0x6b44f0['file']||_0xa8230f,'savePath':_0x45307f})[_0x0617('0x13')](function(_0x1f83cc){_0x468883(null,_0x1f83cc);})[_0x0617('0x15')](function(_0x169502){_0x468883(_0x169502);});};AGIVertices[_0x0617('0x10')]['createSquareMessage']=function(_0x1f149a,_0x2f784c,_0x4a56c5,_0xabe7b6,_0x25160e){this[_0x0617('0xf')][_0x0617('0x41')]({'uniqueid':this[_0x0617('0xe')][_0x0617('0x37')],'body':_0x1f149a,'direction':_0x2f784c,'providerName':_0x4a56c5,'providerResponse':_0xabe7b6})[_0x0617('0x13')](function(_0x1817ea){if(_0x25160e){_0x25160e(null,_0x1817ea);}})[_0x0617('0x15')](function(_0x5da9d7){if(_0x25160e){_0x25160e(_0x5da9d7);}});};AGIVertices[_0x0617('0x10')]['createCmContact']=function(_0x142582,_0x374dde){this[_0x0617('0xf')][_0x0617('0x42')]({'firstName':_[_0x0617('0x43')](_0x142582['name'])||_[_0x0617('0x44')](_0x142582[_0x0617('0x14')])?_0x0617('0x45')+Math[_0x0617('0x46')]():_0x142582['name'],'lastName':_[_0x0617('0x43')](_0x142582['lastName'])||_[_0x0617('0x44')](_0x142582['lastName'])?null:_0x142582[_0x0617('0x47')],'phone':_0x142582[_0x0617('0x48')],'ListId':_0x142582['list_id'],'scheduledat':_0x142582[_0x0617('0x49')],'callbackUniqueid':this['channel'][_0x0617('0x37')],'tags':'callback','description':_0x0617('0x4a')+_0x142582['scheduledAt']['toString'](),'priority':_0x142582[_0x0617('0x4b')]})[_0x0617('0x13')](function(_0x1f2199){_0x374dde(null,_0x1f2199);})[_0x0617('0x15')](function(_0x1d42f1){_0x374dde(_0x1d42f1);});};AGIVertices['prototype']['getPause']=function(_0x546d55,_0x204b50){this[_0x0617('0xf')][_0x0617('0x4c')](_0x546d55)[_0x0617('0x13')](function(_0x9e3c44){_0x204b50(null,_0x9e3c44?_0x9e3c44[_0x0617('0x14')]:![]);})[_0x0617('0x15')](function(_0x17eab4){_0x204b50(_0x17eab4);});};AGIVertices[_0x0617('0x10')][_0x0617('0x4d')]=function(_0x88132a,_0x49d306,_0x5cf37f){var _0x3a9690={'role':_0x0617('0x4e')};_0x3a9690[_0x88132a]=this[_0x0617('0xe')][_0x0617('0x3b')];this['rpc']['agentPause'](_0x3a9690,_0x49d306,this[_0x0617('0xe')][_0x0617('0x37')])[_0x0617('0x13')](function(_0x31cb64){_0x5cf37f(null,_[_0x0617('0x44')](_0x31cb64)?![]:!![]);})[_0x0617('0x15')](function(_0x46986c){logger[_0x0617('0x2d')](_0x46986c);_0x5cf37f(null,![]);});};AGIVertices[_0x0617('0x10')][_0x0617('0x4f')]=function(_0x35b853,_0x5e7a67){var _0xf23ea9={'role':'agent'};_0xf23ea9[_0x35b853]=this[_0x0617('0xe')][_0x0617('0x3b')];this[_0x0617('0xf')][_0x0617('0x4f')](_0xf23ea9)[_0x0617('0x13')](function(_0x79ac67){_0x5e7a67(null,_['isNil'](_0x79ac67)?![]:!![]);})[_0x0617('0x15')](function(_0x5ef573){logger[_0x0617('0x2d')](_0x5ef573);_0x5e7a67(null,![]);});};AGIVertices[_0x0617('0x10')][_0x0617('0x50')]=function(_0xc4330d,_0x2604cc){var _0x352c1c={'role':_0x0617('0x4e')};_0x352c1c[_0xc4330d]=this[_0x0617('0xe')][_0x0617('0x3b')];this[_0x0617('0xf')][_0x0617('0x50')](_0x352c1c)['then'](function(_0x59cbd9){_0x2604cc(null,_[_0x0617('0x44')](_0x59cbd9)?![]:!![]);})[_0x0617('0x15')](function(_0x5b53f9){logger[_0x0617('0x2d')](_0x5b53f9);_0x2604cc(null,![]);});};AGIVertices[_0x0617('0x10')][_0x0617('0x51')]=function(_0x2d03f3,_0x401643){var _0x372682={'role':_0x0617('0x4e')};_0x372682[_0x2d03f3]=this[_0x0617('0xe')]['callerid'];var _0x5d7966=_0x2d03f3!='internal'?util[_0x0617('0x29')]('%s/%s@from-sip/n',_0x0617('0x52'),this[_0x0617('0xe')]['callerid']):undefined;this[_0x0617('0xf')][_0x0617('0x51')](_0x372682,_0x5d7966)[_0x0617('0x13')](function(_0x5368cd){_0x401643(null,_[_0x0617('0x44')](_0x5368cd)?![]:!![]);})[_0x0617('0x15')](function(_0x202567){logger[_0x0617('0x2d')](_0x202567);_0x401643(null,![]);});};AGIVertices['prototype'][_0x0617('0x53')]=function(_0x56a086,_0x4a20b8){sh[_0x0617('0x54')](_[_0x0617('0x55')](_0x56a086),function(_0x1abf7a,_0x183a85){var _0x1ce44c=_0x183a85[_0x0617('0x56')](/(\r\n|\n|\r)/gm,'');_0x4a20b8(null,_0x1ce44c);});};AGIVertices[_0x0617('0x10')][_0x0617('0x57')]=function(_0x56aa81,_0xb8ab15){scripts[_0x0617('0x57')](_0x56aa81[_0x0617('0x58')],_0x56aa81[_0x0617('0x59')]||_0x0617('0x5a'),_0x56aa81[_0x0617('0x5a')],_0x56aa81[_0x0617('0x5b')]||_0x0617('0x5c'),_0x56aa81[_0x0617('0x5d')]||_0x0617('0x5e'),_0x56aa81[_0x0617('0x5f')]||'MP3')[_0x0617('0x13')](function(_0x360644){_0xb8ab15(null,_0x360644);})['catch'](function(_0x2d4ad8){_0xb8ab15(_0x2d4ad8);});};AGIVertices[_0x0617('0x10')]['googleTTS']=function(_0x548f3b,_0x31a6e4){scripts['googleTTS'](_0x548f3b[_0x0617('0x5a')],_0x548f3b[_0x0617('0x60')]||'en',0x1)[_0x0617('0x13')](function(_0x46a2f7){_0x31a6e4(null,_0x46a2f7);})[_0x0617('0x15')](function(_0x149847){_0x31a6e4(_0x149847);});};AGIVertices[_0x0617('0x10')][_0x0617('0x61')]=function(_0x35add5,_0xad302e){var _0x122e8f={'uri':_0x35add5[_0x0617('0x62')],'method':_0x35add5['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x35add5['timeout'])===_0x0617('0x63')&&parseInt(_0x35add5[_0x0617('0x64')])>=0x1?parseInt(_0x35add5[_0x0617('0x64')])*0x3e8:0x5*0x3e8};if(_[_0x0617('0x65')]([_0x0617('0x66'),_0x0617('0x67')],_0x122e8f[_0x0617('0x68')][_0x0617('0x69')]())){try{_0x122e8f[_0x0617('0x6a')]=_0x35add5[_0x0617('0xa')]?JSON[_0x0617('0x6b')](_0x35add5[_0x0617('0xa')]):{};}catch(_0x3738d4){logger['error'](_0x0617('0x6c'),_0x3738d4);}}try{_0x122e8f[_0x0617('0x6d')]=_0x35add5[_0x0617('0x9')]?JSON['parse'](_0x35add5[_0x0617('0x9')]):{};}catch(_0x1e3781){logger[_0x0617('0x2d')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1e3781);}if(_0x35add5[_0x0617('0x6e')]){try{var _0x12c595=require(_0x35add5[_0x0617('0x6e')])[_0x0617('0x6f')](this,_0x122e8f);_0x122e8f[_0x0617('0x70')]=Mustache[_0x0617('0x71')](_0x35add5[_0x0617('0x62')],_0x12c595,{},['$$','$$']);if(_0x122e8f[_0x0617('0x6d')]){_0x122e8f['headers']=JSON[_0x0617('0x6b')](Mustache[_0x0617('0x71')](JSON['stringify'](_0x122e8f[_0x0617('0x6d')]),_0x12c595,{},['$$','$$']));}if(_0x122e8f[_0x0617('0x6a')]){_0x122e8f[_0x0617('0x6a')]=JSON[_0x0617('0x6b')](Mustache[_0x0617('0x71')](JSON[_0x0617('0x72')](_0x122e8f[_0x0617('0x6a')]),_0x12c595,{},['$$','$$']));}}catch(_0x2d9f3c){logger[_0x0617('0x2d')](_0x0617('0x73'),_0x2d9f3c);}}rp(_0x122e8f)[_0x0617('0x13')](function(_0x5b890e){var _0x17fe45={'statusCode':_0x5b890e[_0x0617('0x74')]||0xc8,'statusMessage':_0x5b890e[_0x0617('0x75')]||'OK','headers':_0x5b890e['headers']||{},'body':_0x5b890e['body']||{}};_0xad302e(null,_0x17fe45);})['catch'](function(_0x539a14){var _0x7e6fe={'statusCode':_0x539a14[_0x0617('0x74')]||0x1f4,'statusMessage':_0x539a14[_0x0617('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x539a14[_0x0617('0x77')][_0x0617('0x6d')]||{},'body':_0x539a14[_0x0617('0x77')][_0x0617('0x6a')]||{}};_0xad302e(null,_0x7e6fe);});};AGIVertices[_0x0617('0x10')][_0x0617('0x78')]=function(_0x105697,_0x54a145){scripts[_0x0617('0x78')](this[_0x0617('0xe')][_0x0617('0x37')],_0x105697[_0x0617('0x79')],_0x105697[_0x0617('0x5a')],_0x105697[_0x0617('0x7a')]||'en')['then'](function(_0x27e137){_0x54a145(null,_0x27e137);})[_0x0617('0x15')](function(_0x21e19c){_0x54a145(_0x21e19c);});};AGIVertices[_0x0617('0x10')]['googleDialogflowV2']=function(_0x53083e,_0x1f3373){scripts['googleDialogflowV2'](this[_0x0617('0xe')]['uniqueid'],_0x53083e['dialogflowV2_project_id'],_0x53083e[_0x0617('0x7b')],_0x53083e[_0x0617('0x7c')],_0x53083e[_0x0617('0x5a')],_0x53083e[_0x0617('0x7d')]||'en')['then'](function(_0x519d8e){_0x1f3373(null,_0x519d8e);})[_0x0617('0x15')](function(_0x6f5d7c){_0x1f3373(_0x6f5d7c);});};AGIVertices['prototype'][_0x0617('0x7e')]=function(_0x11bb02,_0xaec249){scripts[_0x0617('0x7e')](this[_0x0617('0xe')],_0x11bb02)[_0x0617('0x13')](function(_0x5d48e4){_0xaec249(null,_0x5d48e4);})[_0x0617('0x15')](function(_0x286272){_0xaec249(_0x286272);});};AGIVertices[_0x0617('0x10')][_0x0617('0x7f')]=function(_0x2b7a75,_0x241f61){scripts[_0x0617('0x7f')](_0x2b7a75[_0x0617('0x79')],_0x2b7a75[_0x0617('0x5a')],_0x2b7a75['ispeech_tts_language']||_0x0617('0x5c'),_0x2b7a75[_0x0617('0x80')])[_0x0617('0x13')](function(_0x11f057){_0x241f61(null,_0x11f057);})[_0x0617('0x15')](function(_0x14271e){_0x241f61(_0x14271e);});};AGIVertices[_0x0617('0x10')][_0x0617('0x81')]=function(_0x171c6c,_0x30bbb6,_0x4e2502){scripts[_0x0617('0x81')](_0x30bbb6,_0x171c6c[_0x0617('0x79')],_0x171c6c['ispeech_asr_language']||_0x0617('0x5c'),this[_0x0617('0x82')](_0x171c6c[_0x0617('0x83')])?_0x171c6c['model']:undefined)[_0x0617('0x13')](function(_0x4cb6d0){_0x4e2502(null,_0x4cb6d0);})[_0x0617('0x15')](function(_0x350068){_0x4e2502(_0x350068);});};AGIVertices[_0x0617('0x10')]['awsPolly']=function(_0x19e1f8,_0x513331){scripts['awsPolly'](_0x19e1f8['aws_access_key_id'],_0x19e1f8[_0x0617('0x84')],_0x19e1f8[_0x0617('0x85')],_0x19e1f8['aws_polly_voice']||_0x0617('0x86'),_0x19e1f8[_0x0617('0x5a')],_0x19e1f8[_0x0617('0x87')]||_0x0617('0x5a'))[_0x0617('0x13')](function(_0x39520e){_0x513331(null,_0x39520e);})[_0x0617('0x15')](function(_0xb61e8a){_0x513331(_0xb61e8a);});};AGIVertices[_0x0617('0x10')]['awsLex']=function(_0x138393,_0x2d08bd){scripts['awsLex'](this[_0x0617('0xe')]['uniqueid'],_0x138393[_0x0617('0x88')],_0x138393[_0x0617('0x84')],_0x138393['aws_lex_region'],_0x138393[_0x0617('0x5a')],_0x138393['aws_bot_name'])[_0x0617('0x13')](function(_0x45974e){_0x2d08bd(null,_0x45974e);})[_0x0617('0x15')](function(_0x33383f){_0x2d08bd(_0x33383f);});};AGIVertices[_0x0617('0x10')][_0x0617('0x89')]=function(_0x3c3559,_0xcb6f99,_0x348d9f){scripts[_0x0617('0x89')](_0xcb6f99,_0x3c3559['key'],_0x3c3559[_0x0617('0x8a')]||_0x0617('0x5c'))[_0x0617('0x13')](function(_0x14e773){_0x348d9f(null,_0x14e773);})[_0x0617('0x15')](function(_0x15da69){_0x348d9f(_0x15da69);});};AGIVertices[_0x0617('0x10')]['tildeASR']=function(_0x5e7f3e,_0x1c00f1,_0xd3f687){scripts['tildeASR'](_0x1c00f1,_0x5e7f3e['appid'],_0x5e7f3e['appsecret'],_0x5e7f3e[_0x0617('0x70')])['then'](function(_0x1277cf){_0xd3f687(null,_0x1277cf);})['catch'](function(_0x4b58f5){_0xd3f687(_0x4b58f5);});};AGIVertices[_0x0617('0x10')]['clear']=function(_0x3c3d21){var _0x3d81a9=_[_0x0617('0x65')](verticesWithRetry,_0x3c3d21[_0x0617('0x39')])?_0x3c3d21:_['clone'](_0x3c3d21);for(var _0x31afe4 in _0x3d81a9){if(_0x3d81a9['hasOwnProperty'](_0x31afe4)){if(_0x3d81a9[_0x31afe4]&&_['isString'](_0x3d81a9[_0x31afe4])){if(_[_0x0617('0x65')](recursiveMapAttributes,_0x31afe4)){_0x3d81a9[_0x31afe4]=this[_0x0617('0x8b')](_0x3d81a9[_0x31afe4]);}else{_0x3d81a9[_0x31afe4]=this['replaceAllVariables'](_0x3d81a9[_0x31afe4]);}}}}return _0x3d81a9;};AGIVertices['prototype'][_0x0617('0x8c')]=function(_0x464511){for(var _0x365c36 in _0x464511){if(_0x464511[_0x0617('0x8d')](_0x365c36)){if(_[_0x0617('0x8e')](_0x464511[_0x365c36])){this[_0x0617('0x8c')](_0x464511[_0x365c36]);}else if(_[_0x0617('0x8f')](_0x464511[_0x365c36])){for(var _0x3fe8a6=0x0;_0x3fe8a6<_0x464511[_0x365c36][_0x0617('0x90')];_0x3fe8a6++){this[_0x0617('0x8c')](_0x464511[_0x365c36][_0x3fe8a6]);}}else if(_[_0x0617('0x91')](_0x464511[_0x365c36])){_0x464511[_0x365c36]=this['replaceAllVariables'](_0x464511[_0x365c36]);}}}};AGIVertices[_0x0617('0x10')][_0x0617('0x92')]=function(_0x12f210,_0x4a18d2){for(var _0x52f8f7 in _0x12f210){if(_0x12f210[_0x0617('0x8d')](_0x52f8f7)){if(_[_0x0617('0x8e')](_0x12f210[_0x52f8f7])){if(!_['isEmpty'](_0x12f210[_0x52f8f7])){this[_0x0617('0x92')](_0x12f210[_0x52f8f7],util[_0x0617('0x29')](_0x0617('0x93'),_0x4a18d2,_0x52f8f7));}}else if(_[_0x0617('0x8f')](_0x12f210[_0x52f8f7])){for(var _0x1d3d1d=0x0;_0x1d3d1d<_0x12f210[_0x52f8f7]['length'];_0x1d3d1d++){this[_0x0617('0x92')](_0x12f210[_0x52f8f7][_0x1d3d1d],util['format'](_0x0617('0x93'),_0x4a18d2,_0x52f8f7+'['+_0x1d3d1d+']'));}}else{if(!_[_0x0617('0x44')](_0x12f210[_0x52f8f7])){this[_0x0617('0xe')][_0x0617('0x94')](util['format'](_0x0617('0x93'),_0x4a18d2,_0x52f8f7),_0x12f210[_0x52f8f7]);}}}}};AGIVertices[_0x0617('0x10')]['replaceObjectAllVariables']=function(_0x28e6ea){try{var _0x415fbc=JSON[_0x0617('0x6b')](_0x28e6ea);this[_0x0617('0x8c')](_0x415fbc);return JSON[_0x0617('0x72')](_0x415fbc);}catch(_0x43344a){return this['replaceAllVariables'](_0x28e6ea);}};AGIVertices[_0x0617('0x10')][_0x0617('0x95')]=function(_0x1ade57){var _0x36f1e4=_0x1ade57[_0x0617('0x96')]('{');for(var _0x376cc7=0x1;_0x376cc7<_0x36f1e4[_0x0617('0x90')];_0x376cc7+=0x1){var _0x120a9d=_0x36f1e4[_0x376cc7][_0x0617('0x96')]('}');if(_0x120a9d[_0x0617('0x90')]>0x1){_0x1ade57=_0x1ade57[_0x0617('0x97')]('{'+_0x120a9d[0x0]+'}',this[_0x0617('0xe')][_0x0617('0x11')](_0x120a9d[0x0])[_0x0617('0x98')]||_0x120a9d[0x0]);}}if(_0x36f1e4[_0x0617('0x90')]===0x1){return _0x1ade57[_0x0617('0x99')]();}return this[_0x0617('0x95')](_0x1ade57);};AGIVertices[_0x0617('0x10')][_0x0617('0x9a')]=function(_0x4dd7c9,_0x1565f3){var _0x3b45f1=this[_0x0617('0xe')][_0x0617('0x11')](_0x4dd7c9);if(_0x3b45f1[_0x0617('0x9b')]===-0x1){return _0x3b45f1;}logger[_0x0617('0x2e')](util[_0x0617('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1565f3,_0x3b45f1['extra']));return this[_0x0617('0xe')]['setVariable'](_0x1565f3,_0x3b45f1['extra']);};AGIVertices[_0x0617('0x10')][_0x0617('0x82')]=function(_0xe3a0ff){return _0xe3a0ff&&_0xe3a0ff!=='0'&&_0xe3a0ff!=='-1'&&_0xe3a0ff!=='';};AGIVertices['prototype'][_0x0617('0x9c')]=function(_0x3384e2){this[_0x0617('0x36')][_0x0617('0x6f')](this,_0x3384e2,'-');_0x3384e2[_0x0617('0x9d')]=_0x3384e2[_0x0617('0x9c')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0617('0x10')]['mrcpsynth']=function(_0x8cbde6){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x9e'),_0x8cbde6[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x8cbde6['text'])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20text\x20configured');}var _0x2947ed='\x22'+_0x8cbde6[_0x0617('0x5a')]+'\x22';if(this[_0x0617('0x82')](_0x8cbde6[_0x0617('0x77')])){_0x2947ed+=','+_0x8cbde6['options'];}var _0x379703=this[_0x0617('0xe')]['exec'](_0x0617('0xa0'),_0x2947ed);if(_0x379703['result']===-0x1){return _0x379703;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xa1'),_0x2947ed));};AGIVertices['prototype'][_0x0617('0xa2')]=function(_0x347016){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xa3'),_0x347016[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x347016['grammar'])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0xa4'));}var _0x5122b4=_0x347016['grammar'];if(this[_0x0617('0x82')](_0x347016[_0x0617('0x77')])){_0x5122b4+=','+_0x347016[_0x0617('0x77')];}var _0xef2a47=this[_0x0617('0xe')][_0x0617('0x54')](_0x0617('0xa5'),_0x5122b4);if(_0xef2a47[_0x0617('0x9b')]===-0x1){return _0xef2a47;}var _0x590d97=this[_0x0617('0x9a')]('RECOG_CONFIDENCE()',_0x0617('0xa6'));if(_0x590d97[_0x0617('0x9b')]===-0x1){return _0x590d97;}var _0x4cea08=this['getAndSetVariable']('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x4cea08[_0x0617('0x9b')]===-0x1){return _0x4cea08;}var _0x24c190=this['getAndSetVariable']('RECOG_INSTANCE()',_0x0617('0xa7'));if(_0x24c190[_0x0617('0x9b')]===-0x1){return _0x24c190;}return this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xa8'),_0x5122b4));};AGIVertices['prototype'][_0x0617('0xa9')]=function(_0x244296){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xaa'),_0x244296[_0x0617('0x38')]));return this[_0x0617('0xe')]['agi']([_0x244296['command'],_0x244296[_0x0617('0xab')]]);};AGIVertices[_0x0617('0x10')][_0x0617('0xac')]=function(_0x5d503a){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xad'),_0x5d503a[_0x0617('0x38')]));if(this['isConfigured'](_0x5d503a[_0x0617('0x64')])){logger[_0x0617('0x2e')](util['format'](_0x0617('0xae'),_0x5d503a[_0x0617('0x64')]));var _0x5ad766=this[_0x0617('0xe')][_0x0617('0xaf')](_0x5d503a[_0x0617('0x64')]);if(_0x5ad766[_0x0617('0x9b')]===-0x1){return _0x5ad766;}}return this[_0x0617('0xe')][_0x0617('0xac')]();};AGIVertices['prototype'][_0x0617('0xb0')]=function(_0xe49998){logger['info'](util[_0x0617('0x29')](_0x0617('0xb1'),_0xe49998[_0x0617('0x38')]));if(!this['isConfigured'](_0xe49998[_0x0617('0xb2')])){return this['channel'][_0x0617('0x2d')](_0xe49998,_0x0617('0xb3'));}_0xe49998['scheduledAt']=moment();if(this[_0x0617('0x82')](_0xe49998[_0x0617('0xb4')])){_0xe49998[_0x0617('0x49')]=moment()[_0x0617('0xb5')](_0xe49998['delay'],'minutes');}if(!this[_0x0617('0x82')](_0xe49998[_0x0617('0x4b')])){_0xe49998['callback_priority']=0x2;}this[_0x0617('0x42')][_0x0617('0x6f')](this,_0xe49998);return this[_0x0617('0xe')]['noop'](util[_0x0617('0x29')](_0x0617('0xb6'),_0xe49998[_0x0617('0x48')],_0xe49998['list_id'],_0xe49998['scheduledAt']));};AGIVertices[_0x0617('0x10')][_0x0617('0xb7')]=function(_0x138643){logger[_0x0617('0x2e')](util['format'](_0x0617('0xb8'),_0x138643['label']));var _0x58d1a2=this[_0x0617('0xe')]['exec'](_0x138643['application'],_0x138643[_0x0617('0x77')]);if(_0x58d1a2['result']===-0x1){return _0x58d1a2;}return this[_0x0617('0xe')]['noop'](util[_0x0617('0x29')](_0x0617('0xb9'),_0x138643[_0x0617('0xba')],_0x138643['options']));};AGIVertices[_0x0617('0x10')][_0x0617('0xbb')]=function(_0x4981de){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xbc'),_0x4981de[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x4981de[_0x0617('0x5a')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0xbd'));}var _0xeae226='\x22'+_0x4981de[_0x0617('0x5a')]+'\x22';if(this[_0x0617('0x82')](_0x4981de[_0x0617('0x77')])){_0xeae226+=','+_0x4981de[_0x0617('0x77')];}var _0x211ee1=this[_0x0617('0xe')]['exec'](_0x0617('0xa0'),_0xeae226);if(_0x211ee1[_0x0617('0x9b')]===-0x1){return _0x211ee1;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xa1'),_0xeae226));};AGIVertices[_0x0617('0x10')][_0x0617('0xbe')]=function(_0x341bf1){logger['info'](util[_0x0617('0x29')](_0x0617('0xbf'),_0x341bf1[_0x0617('0x38')]));if(!this['isConfigured'](_0x341bf1[_0x0617('0x5a')])){return this['channel'][_0x0617('0x9f')](_0x0617('0xbd'));}var _0x165221='\x22'+_0x341bf1[_0x0617('0x5a')]+'\x22';if(this['isConfigured'](_0x341bf1[_0x0617('0x77')])){_0x165221+=','+_0x341bf1[_0x0617('0x77')];}var _0x1c0d1b=this[_0x0617('0xe')][_0x0617('0x54')](_0x0617('0xa0'),_0x165221);if(_0x1c0d1b[_0x0617('0x9b')]===-0x1){return _0x1c0d1b;}return this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xa1'),_0x165221));};AGIVertices[_0x0617('0x10')]['lumenvoxasr']=function(_0xbd3d77){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xc0'),_0xbd3d77[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0xbd3d77[_0x0617('0xc1')])){return this['channel']['noop'](_0x0617('0xa4'));}var _0x59de3b=_0xbd3d77[_0x0617('0xc1')];if(this[_0x0617('0x82')](_0xbd3d77[_0x0617('0x77')])){_0x59de3b+=','+_0xbd3d77[_0x0617('0x77')];}var _0x13c352=this[_0x0617('0xe')][_0x0617('0x54')](_0x0617('0xa5'),_0x59de3b);if(_0x13c352['result']===-0x1){return _0x13c352;}var _0x38a3fa=this['getAndSetVariable'](_0x0617('0xc2'),_0x0617('0xc3'));if(_0x38a3fa['result']===-0x1){return _0x38a3fa;}var _0x4b28d0=this[_0x0617('0x9a')](_0x0617('0xc4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x4b28d0[_0x0617('0x9b')]===-0x1){return _0x4b28d0;}var _0x59a7b6=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x59a7b6[_0x0617('0x9b')]===-0x1){return _0x59a7b6;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xa8'),_0x59de3b));};AGIVertices[_0x0617('0x10')]['sestekasr']=function(_0x43cbf4){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xc5'),_0x43cbf4[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x43cbf4[_0x0617('0xc1')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0xa4'));}var _0x16d4b6=_0x43cbf4[_0x0617('0xc1')];if(this[_0x0617('0x82')](_0x43cbf4[_0x0617('0x77')])){_0x16d4b6+=','+_0x43cbf4[_0x0617('0x77')];}var _0x4b3ba8=this['channel'][_0x0617('0x54')](_0x0617('0xa5'),_0x16d4b6);if(_0x4b3ba8[_0x0617('0x9b')]===-0x1){return _0x4b3ba8;}var _0x2bd9b2=this[_0x0617('0x9a')](_0x0617('0xc2'),_0x0617('0xc6'));if(_0x2bd9b2[_0x0617('0x9b')]===-0x1){return _0x2bd9b2;}var _0x465556=this['getAndSetVariable'](_0x0617('0xc4'),_0x0617('0xc7'));if(_0x465556[_0x0617('0x9b')]===-0x1){return _0x465556;}var _0xe585f1=this[_0x0617('0x9a')](_0x0617('0xc8'),_0x0617('0xc9'));if(_0xe585f1[_0x0617('0x9b')]===-0x1){return _0xe585f1;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xa8'),_0x16d4b6));};AGIVertices[_0x0617('0x10')][_0x0617('0xca')]=function(_0xf81708){logger['info'](util[_0x0617('0x29')](_0x0617('0xcb'),_0xf81708[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0xf81708['odbc_id'])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0xf81708,_0x0617('0xcc'));}var _0x37332c=this[_0x0617('0x1a')][_0x0617('0x6f')](this,_0xf81708[_0x0617('0xcd')]);if(!_0x37332c){return this[_0x0617('0xe')][_0x0617('0x2d')](_0xf81708,'no\x20odbc\x20database\x20found');}if(!this[_0x0617('0x82')](_0xf81708[_0x0617('0x2f')])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0xf81708,_0x0617('0xce'));}var _0x246f9a=_0xf81708['query'][_0x0617('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xcf'),_0x246f9a));var _0x538e4f=this[_0x0617('0x2b')][_0x0617('0x6f')](this,_0x37332c,_0x246f9a);this[_0x0617('0x36')][_0x0617('0x6f')](this,_0xf81708,_0x246f9a);if(!this['isConfigured'](_0xf81708[_0x0617('0xd0')])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x54e27c=this[_0x0617('0x11')][_0x0617('0x6f')](this,_0xf81708[_0x0617('0xd0')]);if(!_0x54e27c){return this['channel'][_0x0617('0x2d')](_0xf81708,'no\x20variable\x20found');}var _0x5e8227=this;_0x538e4f[_0x0617('0xd1')](function(_0x37c793,_0x26b554){Object[_0x0617('0xd2')](_0x37c793)[_0x0617('0xd1')](function(_0x55968a){_0x5e8227['channel'][_0x0617('0x94')](util[_0x0617('0x29')](_0x0617('0xd3'),_0x54e27c,_0x26b554,_0x55968a),_0x37c793[_0x55968a]);});});this['channel'][_0x0617('0x94')](util[_0x0617('0x29')](_0x0617('0xd4'),_0x54e27c),_0x538e4f['length']);return this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0xd5'),_0x54e27c));};AGIVertices[_0x0617('0x10')][_0x0617('0xd6')]=function(_0x25fff0){logger[_0x0617('0xd7')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x25fff0[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x25fff0['sip_id'])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x25fff0,_0x0617('0xd8'));}var _0x1beaec=this[_0x0617('0xd9')][_0x0617('0x6f')](this,_0x25fff0['sip_id']);if(!_0x1beaec){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x25fff0,_0x0617('0xda'));}var _0x4e0301=this[_0x0617('0xe')][_0x0617('0x54')](_0x0617('0xdb'),[util[_0x0617('0x29')]('SIP/%s',_0x1beaec),_0x25fff0['timeout'],_0x25fff0[_0x0617('0xdc')],_0x25fff0[_0x0617('0x62')]]);if(_0x4e0301[_0x0617('0x9b')]===-0x1){return _0x4e0301;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xdd'),_0x0617('0xdb')));};AGIVertices[_0x0617('0x10')][_0x0617('0xde')]=function(_0x497ff4){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xdf'),_0x497ff4[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x497ff4[_0x0617('0x79')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x497ff4[_0x0617('0x5a')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0xbd'));}this[_0x0617('0xe')][_0x0617('0xe0')]=!![];this[_0x0617('0x36')](_0x497ff4);this[_0x0617('0x41')](_0x497ff4[_0x0617('0x5a')],'in','','');this[_0x0617('0xe')]['noop'](util[_0x0617('0x29')]('Trying\x20Dialogflow:\x20%s',_0x497ff4[_0x0617('0x5a')]));var _0x1371b4=this[_0x0617('0x78')][_0x0617('0x6f')](this,_0x497ff4);if(_0x1371b4){for(var _0x5bcbad in _0x1371b4){if(_0x1371b4[_0x0617('0x8d')](_0x5bcbad)){this['channel'][_0x0617('0x94')](util[_0x0617('0x29')]('DIALOGFLOW_%s',_0x5bcbad[_0x0617('0x69')]()),_0x1371b4[_0x5bcbad]);}}this[_0x0617('0x41')](_0x1371b4[_0x0617('0xe1')],_0x0617('0xe2'),_0x0617('0xde'),'');return this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0xe3'),_0x1371b4['speech']));}return this['channel'][_0x0617('0x2d')](_0x497ff4,_0x0617('0xe4'));};AGIVertices[_0x0617('0x10')][_0x0617('0xe5')]=function(_0x3b4141){logger['info'](util[_0x0617('0x29')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3b4141[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x3b4141[_0x0617('0xe6')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0xe7'));}if(!this[_0x0617('0x82')](_0x3b4141['client_email'])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20client_email\x20configured');}if(!this[_0x0617('0x82')](_0x3b4141[_0x0617('0x7c')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0xe8'));}if(!this[_0x0617('0x82')](_0x3b4141[_0x0617('0x7d')])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20anguage\x20configured');}if(!this[_0x0617('0x82')](_0x3b4141[_0x0617('0x5a')])){return this['channel'][_0x0617('0x9f')](_0x0617('0xbd'));}this[_0x0617('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x3b4141);this['createSquareMessage'](_0x3b4141[_0x0617('0x5a')],'in','','');this[_0x0617('0xe')]['noop'](util[_0x0617('0x29')](_0x0617('0xe9'),_0x3b4141[_0x0617('0x5a')]));var _0x1a82dd=this[_0x0617('0xea')][_0x0617('0x6f')](this,_0x3b4141);if(_0x1a82dd){for(var _0x4eaea7 in _0x1a82dd){if(_0x1a82dd[_0x0617('0x8d')](_0x4eaea7)){if(_0x4eaea7!==_0x0617('0xeb')){this['channel'][_0x0617('0x94')](util['format']('DIALOGFLOW_%s',_0x4eaea7[_0x0617('0x69')]()),_0x1a82dd[_0x4eaea7]);}}}this[_0x0617('0x41')](_0x1a82dd['speech'],_0x0617('0xe2'),'dialogflowV2',_0x1a82dd[_0x0617('0xeb')]);return this[_0x0617('0xe')]['noop'](util[_0x0617('0x29')](_0x0617('0xec'),_0x1a82dd[_0x0617('0xe1')]));}return this[_0x0617('0xe')][_0x0617('0x2d')](_0x3b4141,_0x0617('0xed'));};AGIVertices[_0x0617('0x10')][_0x0617('0xee')]=function(_0x5df814){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0xef'),_0x5df814[_0x0617('0x38')]));if(!this['isConfigured'](_0x5df814[_0x0617('0xf0')])){return this[_0x0617('0xe')]['noop'](_0x0617('0xf1'));}if(!this['isConfigured'](_0x5df814[_0x0617('0xf2')])){return this[_0x0617('0xe')]['noop'](_0x0617('0xf3'));}if(!this[_0x0617('0x82')](_0x5df814['password'])){return this[_0x0617('0xe')]['noop'](_0x0617('0xf4'));}if(!this[_0x0617('0x82')](_0x5df814[_0x0617('0xf5')])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20text\x20configured');}this[_0x0617('0xe')][_0x0617('0xe0')]=!![];this[_0x0617('0x36')](_0x5df814);this[_0x0617('0x41')](_0x5df814[_0x0617('0x5a')],'in','','');this[_0x0617('0xe')]['noop'](util[_0x0617('0x29')](_0x0617('0xf6'),_0x5df814[_0x0617('0x5a')]));var _0x22e60b=this[_0x0617('0x7e')]['sync'](this,_0x5df814);if(_0x22e60b){for(var _0x566774 in _0x22e60b){if(_0x22e60b['hasOwnProperty'](_0x566774)){this[_0x0617('0xe')]['setVariable'](util['format'](_0x0617('0xf7'),_0x566774[_0x0617('0x69')]()),_0x22e60b[_0x566774]);}}this['createSquareMessage'](_0x22e60b[_0x0617('0xe1')],_0x0617('0xe2'),_0x0617('0xee'),'');if(_0x22e60b[_0x0617('0xf8')]){this[_0x0617('0xe')]['noop'](util[_0x0617('0x29')](_0x0617('0xf9'),_0x22e60b[_0x0617('0xf8')]));var _0x4de754=this[_0x0617('0xe')]['streamFile'](_0x22e60b[_0x0617('0xf8')]);try{fs[_0x0617('0xfa')](_0x22e60b['audiofile']+_0x0617('0xfb'));}catch(_0x2dbbd2){logger[_0x0617('0x2d')](_0x2dbbd2);}return _0x4de754;}else{return this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xfc'),_0x22e60b[_0x0617('0xe1')]));}}return this['channel'][_0x0617('0x2d')](_0x5df814,_0x0617('0xfd'));};AGIVertices[_0x0617('0x10')]['end']=function(_0xf2e6d9){logger['info'](util['format'](_0x0617('0xfe'),_0xf2e6d9['label']));return this[_0x0617('0xe')]['noop'](_0x0617('0xff'));};AGIVertices['prototype'][_0x0617('0x100')]=function(_0x406f95){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x101'),_0x406f95[_0x0617('0x38')]));var _0x22d641='';if(_0x406f95[_0x0617('0x102')]){if(!this[_0x0617('0x82')](_0x406f95['trunk_id'])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x406f95,_0x0617('0x103'));}else{var _0xc130d9=parseInt(_0x406f95['trunk_id'],0xa);if(isNaN(_0xc130d9)){_0x22d641=_0x406f95[_0x0617('0x102')];}else{_0x22d641=this[_0x0617('0x1e')][_0x0617('0x6f')](this,_0x406f95[_0x0617('0x102')]);if(!_0x22d641){return this['channel'][_0x0617('0x2d')](_0x406f95,'no\x20trunk\x20found');}}}}else if(_0x406f95['trunk_name']){_0x22d641=_0x406f95['trunk_name'];}else{return this['channel']['error'](_0x406f95,'no\x20trunk\x20selected');}var _0xb57be1=this['channel']['exec']('DIAL',[util[_0x0617('0x29')](_0x0617('0x104'),_0x22d641,_0x406f95[_0x0617('0x48')]),_0x406f95[_0x0617('0x64')],_0x406f95[_0x0617('0xdc')],_0x406f95[_0x0617('0x62')]]);if(_0xb57be1[_0x0617('0x9b')]===-0x1){return _0xb57be1;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xdd'),_0x0617('0xdb')));};AGIVertices[_0x0617('0x10')][_0x0617('0x105')]=function(_0x5aa6a5){logger[_0x0617('0x2e')](util[_0x0617('0x29')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5aa6a5[_0x0617('0x38')]));return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x105'));};AGIVertices[_0x0617('0x10')][_0x0617('0xc')]=function(_0x4415db){logger[_0x0617('0x2e')](util['format'](_0x0617('0x106'),_0x4415db[_0x0617('0x38')]));if(_0x4415db[_0x0617('0x9d')]===0x0){return this['maxRetry'](_0x4415db);}_0x4415db[_0x0617('0x9d')]-=0x1;if(!this['isConfigured'](_0x4415db['file_id'])){return this[_0x0617('0xe')]['error'](_0x4415db,'no\x20file\x20audio\x20selected');}var _0x22c9cb=this[_0x0617('0x1f')][_0x0617('0x6f')](this,_0x4415db[_0x0617('0x107')]);if(!_0x22c9cb){return this['channel'][_0x0617('0x2d')](_0x4415db,_0x0617('0x108'));}if(!this[_0x0617('0x82')](_0x4415db[_0x0617('0xd0')])){return this['channel']['error'](_0x0617('0x109'));}var _0x32f444=this[_0x0617('0xe')][_0x0617('0x10a')](_0x22c9cb,_0x4415db[_0x0617('0x10b')],_0x4415db[_0x0617('0x10c')]);var _0x3e65ed=_0x32f444[_0x0617('0x9b')]?_0x32f444[_0x0617('0x9b')]['toString']():'';logger['info']('test',JSON[_0x0617('0x72')](_0x32f444));if(_0x32f444[_0x0617('0x9b')]===-0x1){this[_0x0617('0x36')][_0x0617('0x6f')](this,_0x4415db,_0x3e65ed);return _0x32f444;}else if(_0x32f444[_0x0617('0x98')]===_0x0617('0x64')){_0x32f444[_0x0617('0x9b')]=_0x3e65ed[_0x0617('0x90')]>=parseInt(_0x4415db[_0x0617('0x10d')])?'x':'i';}else{_0x32f444[_0x0617('0x9b')]=_0x3e65ed[_0x0617('0x90')]>=parseInt(_0x4415db['mindigit'])&&_0x3e65ed['length']<=parseInt(_0x4415db['maxdigit'])?'x':'i';}var _0x4928f9=this[_0x0617('0x11')]['sync'](this,_0x4415db[_0x0617('0xd0')]);if(!_0x4928f9){return this[_0x0617('0xe')]['error'](_0x4415db,_0x0617('0x10e'));}this[_0x0617('0xe')]['setVariable'](_0x4928f9,_0x3e65ed);if(this[_0x0617('0x82')](_0x4415db['hiddendigitsnum'])){var _0x1d3302=parseInt(_0x4415db[_0x0617('0x10f')],0xa);var _0x52aaa8=rs[_0x0617('0x110')]({'charset':'*','length':_0x1d3302});var _0x40ba1c=_0x3e65ed[_0x0617('0x90')];if(_0x40ba1c>0x0){if(_0x40ba1c>_0x1d3302){this[_0x0617('0x36')][_0x0617('0x6f')](this,_0x4415db,_0x4415db[_0x0617('0x111')]===_0x0617('0x112')?_0x52aaa8+_0x3e65ed[_0x0617('0x113')](_0x1d3302):_0x3e65ed[_0x0617('0x113')](0x0,_0x40ba1c-_0x1d3302)+_0x52aaa8);}else{this[_0x0617('0x36')][_0x0617('0x6f')](this,_0x4415db,rs['generate']({'charset':'*','length':_0x40ba1c}));}}else{this['createSquareDetailsReport'][_0x0617('0x6f')](this,_0x4415db,'');}}else{this[_0x0617('0x36')][_0x0617('0x6f')](this,_0x4415db,_0x3e65ed);}return _0x32f444;};AGIVertices[_0x0617('0x10')][_0x0617('0xd')]=function(_0x2b8e22){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x114'),_0x2b8e22[_0x0617('0x38')]));return this['getdigits'](_0x2b8e22);};AGIVertices[_0x0617('0x10')]['goal']=function(_0x5f0c01){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x115'),_0x5f0c01['label']));this['createSquareDetailsReport'][_0x0617('0x6f')](this,_0x5f0c01,_0x5f0c01[_0x0617('0x116')]);return this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0x117'),_0x5f0c01[_0x0617('0x116')]));};AGIVertices['prototype'][_0x0617('0x118')]=function(_0x5423d6){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x119'),_0x5423d6['label']));if(!this['isConfigured'](_0x5423d6['aws_access_key_id'])||!this['isConfigured'](_0x5423d6[_0x0617('0x84')])){return this[_0x0617('0xe')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x0617('0x82')](_0x5423d6[_0x0617('0x5a')])){return this['channel'][_0x0617('0x9f')](_0x0617('0xbd'));}this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x11a'),_0x5423d6[_0x0617('0x5a')]));var _0x117d62=this[_0x0617('0x11b')][_0x0617('0x6f')](this,_0x5423d6);if(_0x117d62){this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x11c'),_0x117d62));var _0xf53656=this[_0x0617('0xe')]['streamFile'](_0x117d62);try{fs[_0x0617('0xfa')](_0x117d62+_0x0617('0xfb'));}catch(_0x41c928){logger['error'](_0x41c928);}return _0xf53656;}return this['channel'][_0x0617('0x2d')](_0x5423d6,_0x0617('0x11d'));};AGIVertices['prototype']['awslex']=function(_0x124726){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x11e'),_0x124726[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x124726[_0x0617('0x88')])||!this[_0x0617('0x82')](_0x124726[_0x0617('0x84')])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x124726[_0x0617('0x11f')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x120'));}if(!this['isConfigured'](_0x124726['text'])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0xbd'));}this['channel'][_0x0617('0xe0')]=!![];this[_0x0617('0x36')](_0x124726);this[_0x0617('0x41')](_0x124726[_0x0617('0x5a')],'in','','');this['channel'][_0x0617('0x9f')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x124726['text']));var _0x26e9ae=this['awsLex'][_0x0617('0x6f')](this,_0x124726);if(_0x26e9ae){for(var _0x5d2033 in _0x26e9ae){if(_0x26e9ae[_0x0617('0x8d')](_0x5d2033)&&_[_0x0617('0x91')](_0x26e9ae[_0x5d2033])){this[_0x0617('0xe')][_0x0617('0x94')](util[_0x0617('0x29')](_0x0617('0x121'),_0x5d2033['toUpperCase']()),_0x26e9ae[_0x5d2033]);}}if(_['isNil'](_0x26e9ae['message'])){return this['channel'][_0x0617('0x9f')](_0x0617('0x122'));}else{this[_0x0617('0x41')](_0x26e9ae['message'],_0x0617('0xe2'),_0x0617('0x123'),'');return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x124'),_0x26e9ae['message']));}}return this['channel'][_0x0617('0x2d')](_0x124726,_0x0617('0x125'));};AGIVertices['prototype'][_0x0617('0x126')]=function(_0xba5cdc){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x127'),_0xba5cdc['label'],_0xba5cdc[_0x0617('0x64')]));if(!this[_0x0617('0x82')](_0xba5cdc[_0x0617('0x79')])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20key\x20configured');}var _0xe82947=_0x0617('0x128');var _0x16c20f=util[_0x0617('0x29')](_0x0617('0x129'),FILES_PATH,rs[_0x0617('0x110')](0x4));var _0x36c87c=util[_0x0617('0x29')]('%s.%s',_0x16c20f,_0xe82947);var _0x2f1244=!![];if(_0xba5cdc[_0x0617('0x12a')]==='NOBEEP'){_0x2f1244=![];}var _0x310c05=this['channel'][_0x0617('0x12b')](_0x16c20f,_0xe82947,_0xba5cdc['intKey'],_0xba5cdc['timeout'],undefined,_0x2f1244);if(_0x310c05[_0x0617('0x9b')]!==-0x1){this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x12c'),_0x36c87c));var _0x3f1b58=this[_0x0617('0x89')]['sync'](this,_0xba5cdc,_0x36c87c);if(_0x3f1b58){for(var _0x57e7e7 in _0x3f1b58){if(_0x3f1b58[_0x0617('0x8d')](_0x57e7e7)){this['channel']['setVariable'](util[_0x0617('0x29')](_0x0617('0x12d'),_0x57e7e7['toUpperCase']()),_0x3f1b58[_0x57e7e7]);}}return this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x12e'),JSON['stringify'](_0x3f1b58)));}}return _0x310c05;};AGIVertices[_0x0617('0x10')][_0x0617('0x12f')]=function(_0x1f5103){logger[_0x0617('0x2e')](util['format'](_0x0617('0x130'),_0x1f5103[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x1f5103[_0x0617('0x131')])){return this[_0x0617('0xe')]['noop'](_0x0617('0x132'));}if(!this[_0x0617('0x82')](_0x1f5103[_0x0617('0x133')])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20appsecret\x20configured');}var _0x2ea794='wav';var _0x368909=util[_0x0617('0x29')](_0x0617('0x129'),FILES_PATH,rs[_0x0617('0x110')](0x4));var _0x4fca6d=util[_0x0617('0x29')](_0x0617('0x93'),_0x368909,_0x2ea794);var _0x554fcf=!![];if(_0x1f5103[_0x0617('0x12a')]===_0x0617('0x134')){_0x554fcf=![];}var _0x3b9f35=this[_0x0617('0xe')][_0x0617('0x12b')](_0x368909,_0x2ea794,_0x1f5103[_0x0617('0x135')],_0x1f5103['timeout'],undefined,_0x554fcf);if(_0x3b9f35[_0x0617('0x9b')]!==-0x1){this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x136'),_0x4fca6d));var _0xeee606=this[_0x0617('0x137')]['sync'](this,_0x1f5103,_0x4fca6d);if(_0xeee606){for(var _0x33ccf2 in _0xeee606){if(_0xeee606[_0x0617('0x8d')](_0x33ccf2)){this[_0x0617('0xe')][_0x0617('0x94')](util['format'](_0x0617('0x138'),_0x33ccf2[_0x0617('0x69')]()),_0xeee606[_0x33ccf2]);}}return this['channel'][_0x0617('0x9f')](util['format'](_0x0617('0x139'),JSON[_0x0617('0x72')](_0xeee606)));}}return _0x3b9f35;};AGIVertices['prototype'][_0x0617('0x13a')]=function(_0x29f21a){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x13b'),_0x29f21a[_0x0617('0x38')]));return this['channel'][_0x0617('0x13c')](_0x29f21a[_0x0617('0x3e')],_0x29f21a[_0x0617('0x13d')],_0x29f21a[_0x0617('0x13e')]);};AGIVertices[_0x0617('0x10')][_0x0617('0x13f')]=function(_0x324ef9){logger['info'](util['format'](_0x0617('0x140'),_0x324ef9['label']));if(!this['isConfigured'](_0x324ef9[_0x0617('0x141')])){return this['channel']['error'](_0x324ef9,_0x0617('0x142'));}try{var _0x48e6fa=eval(_0x324ef9[_0x0617('0x141')])?_0x0617('0x143'):'false';this[_0x0617('0xe')]['noop'](util['format'](_0x0617('0x144'),_0x324ef9[_0x0617('0x141')],_0x48e6fa));return{'code':0xc8,'result':_0x48e6fa};}catch(_0x58b95e){return{'code':0xc8,'result':_0x0617('0x145')};}};AGIVertices[_0x0617('0x10')][_0x0617('0x146')]=function(_0x4f8485){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x147'),_0x4f8485['label']));if(!this[_0x0617('0x82')](_0x4f8485['interval_id'])){return this['channel'][_0x0617('0x2d')](_0x4f8485,_0x0617('0x148'));}var _0x543391=this[_0x0617('0x25')][_0x0617('0x6f')](this,_0x4f8485[_0x0617('0x149')]);if(!_0x543391){return this['channel'][_0x0617('0x2d')](_0x4f8485,_0x0617('0x14a'));}for(var _0x4275c3=0x0;_0x4275c3<_0x543391[_0x0617('0x90')];_0x4275c3+=0x1){var _0x232357=this[_0x0617('0xe')][_0x0617('0x11')](util[_0x0617('0x29')]('IFTIME(%s?true:false)',_0x543391[_0x4275c3]));if(_0x232357[_0x0617('0x9b')]===-0x1){return _0x232357;}logger[_0x0617('0x2e')](util[_0x0617('0x29')]('IFTIME\x20%s\x20%s',_0x543391[_0x4275c3],_0x232357[_0x0617('0x98')]));if(_0x232357['extra']===_0x0617('0x143')){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x14b'),_0x543391[_0x4275c3],_0x0617('0x143')));this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x14b'),_0x543391[_0x4275c3],_0x0617('0x143')));return{'code':0xc8,'result':'true'};}else{logger[_0x0617('0x2e')](util['format'](_0x0617('0x14b'),_0x543391[_0x4275c3],_0x0617('0x145')));this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0x14b'),_0x543391[_0x4275c3],_0x0617('0x145')));}}return{'code':0xc8,'result':_0x0617('0x145')};};AGIVertices[_0x0617('0x10')][_0x0617('0x14c')]=function(_0x3a78a6){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x14d'),_0x3a78a6[_0x0617('0x38')]));return this['channel']['hangup']();};AGIVertices[_0x0617('0x10')][_0x0617('0x14e')]=function(_0x704765){logger[_0x0617('0x2e')](util[_0x0617('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x704765[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x704765['key'])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x14f'));}var _0x11c684=_0x0617('0x128');var _0x10645d=util[_0x0617('0x29')](_0x0617('0x129'),FILES_PATH,rs[_0x0617('0x110')](0x4));var _0x2435e1=util['format'](_0x0617('0x93'),_0x10645d,_0x11c684);var _0x42b65f=!![];if(_0x704765[_0x0617('0x12a')]==='NOBEEP'){_0x42b65f=![];}var _0x52075f=this[_0x0617('0xe')][_0x0617('0x12b')](_0x10645d,_0x11c684,_0x704765[_0x0617('0x135')],_0x704765[_0x0617('0x64')],undefined,_0x42b65f);if(_0x52075f[_0x0617('0x9b')]!==-0x1){this[_0x0617('0xe')]['noop'](util['format'](_0x0617('0x150'),_0x2435e1));var _0x57634a=this['ispeechASR']['sync'](this,_0x704765,_0x2435e1);if(_0x57634a){for(var _0x78dcbe in _0x57634a){if(_0x57634a['hasOwnProperty'](_0x78dcbe)){this[_0x0617('0xe')]['setVariable'](util[_0x0617('0x29')](_0x0617('0x151'),_0x78dcbe[_0x0617('0x69')]()),_0x57634a[_0x78dcbe]);}}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x152'),JSON[_0x0617('0x72')](_0x57634a)));}}return _0x52075f;};AGIVertices['prototype'][_0x0617('0x153')]=function(_0x30a026){logger[_0x0617('0x2e')](util['format'](_0x0617('0x154'),_0x30a026[_0x0617('0x38')]));if(!this['isConfigured'](_0x30a026[_0x0617('0x79')])){return this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x30a026['text'])){return this['channel'][_0x0617('0x9f')]('no\x20text\x20configured');}this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')]('Trying\x20ispeech\x20TTS\x20%s',_0x30a026['text']));var _0x3c38fd=this[_0x0617('0x7f')][_0x0617('0x6f')](this,_0x30a026);if(_0x3c38fd){this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x150'),_0x3c38fd));var _0x5540a4=this[_0x0617('0xe')]['streamFile'](_0x3c38fd,_0x30a026['intKey']);try{fs[_0x0617('0xfa')](_0x3c38fd+_0x0617('0xfb'));}catch(_0x36a5e4){logger[_0x0617('0x2d')](_0x36a5e4);}return _0x5540a4;}return this[_0x0617('0xe')][_0x0617('0x2d')](_0x30a026,_0x0617('0x155'));};AGIVertices[_0x0617('0x10')][_0x0617('0x156')]=function(_0xf2157d){logger[_0x0617('0x2e')](util[_0x0617('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0xf2157d[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0xf2157d[_0x0617('0x157')])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0xf2157d,_0x0617('0x158'));}logger[_0x0617('0x2e')](util['format'](_0x0617('0x159'),this[_0x0617('0xe')][_0x0617('0x3b')],_0xf2157d[_0x0617('0x157')]));var _0xc6262c=this['agentLogin'][_0x0617('0x6f')](this,_0xf2157d['findBy']);if(_0xc6262c){logger['info'](util[_0x0617('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0617('0xe')][_0x0617('0x3b')],_0xf2157d[_0x0617('0x157')]));this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x15a'),this[_0x0617('0xe')][_0x0617('0x3b')],_0xf2157d[_0x0617('0x157')]));return{'code':0xc8,'result':_0x0617('0x15b')};}else{logger[_0x0617('0x2e')](util['format'](_0x0617('0x15c'),this['channel'][_0x0617('0x3b')],_0xf2157d[_0x0617('0x157')]));this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0x15c'),this['channel'][_0x0617('0x3b')],_0xf2157d[_0x0617('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0617('0x10')]['logout']=function(_0x512394){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x15d'),_0x512394[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x512394['findBy'])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x512394,'no\x20find\x20by\x20configured');}logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x159'),this[_0x0617('0xe')][_0x0617('0x3b')],_0x512394['findBy']));var _0x4c13db=this['agentLogout'][_0x0617('0x6f')](this,_0x512394[_0x0617('0x157')]);if(_0x4c13db){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x15a'),this['channel'][_0x0617('0x3b')],_0x512394[_0x0617('0x157')]));this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0x15a'),this['channel'][_0x0617('0x3b')],_0x512394[_0x0617('0x157')]));return{'code':0xc8,'result':_0x0617('0x15b')};}else{logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x15c'),this[_0x0617('0xe')][_0x0617('0x3b')],_0x512394[_0x0617('0x157')]));this[_0x0617('0xe')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0617('0xe')]['callerid'],_0x512394[_0x0617('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x0617('0x15e')]=function(_0x205a0b){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x15f'),_0x205a0b[_0x0617('0x38')]));if(!this['isConfigured'](_0x205a0b[_0x0617('0x160')])){return this['channel'][_0x0617('0x2d')](_0x205a0b,_0x0617('0x161'));}this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')]('math\x20%s',_0x205a0b['operation']));var _0x2e85c2=eval(_0x205a0b[_0x0617('0x160')]);if(!this[_0x0617('0x82')](_0x205a0b[_0x0617('0xd0')])){return this[_0x0617('0xe')]['noop'](_0x0617('0x109'));}var _0x38a747=this[_0x0617('0x11')][_0x0617('0x6f')](this,_0x205a0b[_0x0617('0xd0')]);if(!_0x38a747){return this['channel'][_0x0617('0x2d')](_0x205a0b,_0x0617('0x10e'));}if(_[_0x0617('0x8f')](_0x2e85c2)){var _0x364678=this;_0x2e85c2[_0x0617('0xd1')](function(_0x25f9a2,_0x107ebb){_0x364678['channel'][_0x0617('0x94')](util['format'](_0x0617('0x162'),_0x38a747,_0x107ebb),_0x25f9a2);});return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x163'),_0x38a747));}else{return this[_0x0617('0xe')][_0x0617('0x94')](_0x38a747,_0x2e85c2);}};AGIVertices[_0x0617('0x10')][_0x0617('0xb')]=function(_0x675d77){logger['info'](util['format'](_0x0617('0x164'),_0x675d77[_0x0617('0x38')]));if(_0x675d77[_0x0617('0x9d')]===0x0){return this[_0x0617('0x9c')](_0x675d77);}_0x675d77[_0x0617('0x9d')]-=0x1;if(!this[_0x0617('0x82')](_0x675d77['file_id'])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x675d77,_0x0617('0x165'));}var _0xcfc8b2=this[_0x0617('0x1f')]['sync'](this,_0x675d77['file_id']);if(!_0xcfc8b2){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x675d77,_0x0617('0x108'));}var _0x3cfccd=this['channel']['getData'](_0xcfc8b2,_0x675d77['response'],_0x675d77[_0x0617('0x166')]);var _0x10cb13=_0x3cfccd['result'];if(_0x3cfccd[_0x0617('0x9b')]===-0x1){this['createSquareDetailsReport'][_0x0617('0x6f')](this,_0x675d77,'-1');return _0x3cfccd;}else if(_0x3cfccd[_0x0617('0x98')]===_0x0617('0x64')){_0x3cfccd[_0x0617('0x9b')]=_0x3cfccd[_0x0617('0x9b')][_0x0617('0x90')]>0x0?_0x3cfccd[_0x0617('0x9b')]:'t';}else if(_[_0x0617('0x43')](_0x3cfccd[_0x0617('0x9b')])){_0x3cfccd[_0x0617('0x9b')]='#';_0x10cb13='#';}if(!this['isConfigured'](_0x675d77[_0x0617('0xd0')])){this[_0x0617('0xe')][_0x0617('0x9f')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1a4d5a=this['getVariable']['sync'](this,_0x675d77['variable_id']);if(!_0x1a4d5a){return this[_0x0617('0xe')]['error'](_0x675d77,_0x0617('0x10e'));}this[_0x0617('0xe')][_0x0617('0x94')](_0x1a4d5a,_0x10cb13);}this[_0x0617('0x36')]['sync'](this,_0x675d77,_0x10cb13);return _0x3cfccd;};AGIVertices['prototype'][_0x0617('0x9f')]=function(_0x17eb0){logger['info'](util[_0x0617('0x29')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x17eb0[_0x0617('0x38')]));return this[_0x0617('0xe')][_0x0617('0x9f')](_0x17eb0[_0x0617('0x167')]||_0x17eb0['label']);};AGIVertices[_0x0617('0x10')]['pause']=function(_0x153e45){logger['info'](util[_0x0617('0x29')](_0x0617('0x168'),_0x153e45[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x153e45['findBy'])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x153e45,_0x0617('0x158'));}logger[_0x0617('0x2e')](util['format'](_0x0617('0x159'),this[_0x0617('0xe')][_0x0617('0x3b')],_0x153e45[_0x0617('0x157')]));var _0xc9e65a=this[_0x0617('0x169')][_0x0617('0x6f')](this,_0x153e45[_0x0617('0x16a')]);var _0x5e6fa5=this[_0x0617('0x4d')][_0x0617('0x6f')](this,_0x153e45[_0x0617('0x157')],_0xc9e65a);if(_0x5e6fa5){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x15a'),this['channel'][_0x0617('0x3b')],_0x153e45[_0x0617('0x157')]));this['channel'][_0x0617('0x9f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0617('0xe')][_0x0617('0x3b')],_0x153e45[_0x0617('0x157')]));return{'code':0xc8,'result':_0x0617('0x15b')};}else{logger[_0x0617('0x2e')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0617('0xe')][_0x0617('0x3b')],_0x153e45['findBy']));this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x15a'),this[_0x0617('0xe')]['callerid'],_0x153e45[_0x0617('0x157')]));return{'code':0xc8,'result':_0x0617('0x16b')};}};AGIVertices[_0x0617('0x10')]['playback']=function(_0x2450df){logger['info'](util[_0x0617('0x29')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2450df[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x2450df[_0x0617('0x107')])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x2450df,_0x0617('0x165'));}var _0x258d62=this[_0x0617('0x1f')]['sync'](this,_0x2450df[_0x0617('0x107')]);if(!_0x258d62){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x2450df,'no\x20file\x20audio\x20found');}var _0x12550c=this[_0x0617('0xe')][_0x0617('0x54')](_0x0617('0x16c'),[_0x258d62,_0x2450df['opts']]);if(_0x12550c[_0x0617('0x9b')]===-0x1){return _0x12550c;}return this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0xb9'),'PLAYBACK',_0x258d62));};AGIVertices['prototype'][_0x0617('0x16d')]=function(_0x5581e9){logger[_0x0617('0x2e')](util['format'](_0x0617('0x16e'),_0x5581e9['label']));if(!this[_0x0617('0x82')](_0x5581e9[_0x0617('0x16f')])){return this[_0x0617('0xe')]['error'](_0x5581e9,_0x0617('0x170'));}var _0x484c8e='';var _0x2ea3f4=parseInt(_0x5581e9['queue_id'],0xa);if(isNaN(_0x2ea3f4)){_0x484c8e=_0x5581e9[_0x0617('0x16f')];}else{_0x484c8e=this[_0x0617('0x16')][_0x0617('0x6f')](this,_0x5581e9[_0x0617('0x16f')]);if(!_0x484c8e){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x5581e9,_0x0617('0x171'));}}var _0x34f899='';if(this[_0x0617('0x82')](_0x5581e9['file_id'])){var _0x669716=this[_0x0617('0x1f')][_0x0617('0x6f')](this,_0x5581e9[_0x0617('0x107')]);if(_0x669716){_0x34f899=_0x669716;}}this['createSquareDetailsReport']['sync'](this,_0x5581e9,_0x484c8e);if(_0x5581e9[_0x0617('0xdc')][_0x0617('0x172')]('x')<0x0){_0x5581e9['opts']+='x';}if(_0x5581e9[_0x0617('0xdc')][_0x0617('0x172')]('X')<0x0){_0x5581e9[_0x0617('0xdc')]+='X';}this[_0x0617('0xe')][_0x0617('0x94')]('XMCS-QUEUE',_0x484c8e?_0x484c8e[_0x0617('0x173')]():'');var _0x3fd5d8=this[_0x0617('0xe')]['exec'](_0x0617('0x174'),[_0x484c8e,_0x5581e9[_0x0617('0xdc')],_0x5581e9[_0x0617('0x62')],_0x34f899,_0x5581e9[_0x0617('0x64')],_0x5581e9['agi'],_0x5581e9[_0x0617('0x175')],_0x5581e9[_0x0617('0x176')],'',_0x5581e9[_0x0617('0x177')]]);if(_0x3fd5d8[_0x0617('0x9b')]===-0x1){return _0x3fd5d8;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xb9'),_0x0617('0x174'),_0x484c8e));};AGIVertices[_0x0617('0x10')][_0x0617('0x178')]=function(_0x4e1396){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x179'),_0x4e1396[_0x0617('0x38')]));var _0x2b9d03=_0x4e1396[_0x0617('0x17a')]||'wav';var _0x87cea0=util[_0x0617('0x29')](_0x0617('0x17b'),this[_0x0617('0xe')][_0x0617('0x37')],rs[_0x0617('0x110')](0x5));var _0x51fdb7=util[_0x0617('0x29')](_0x0617('0x17c'),FILES_PATH,_0x87cea0,_0x2b9d03);var _0x5f21f0=util[_0x0617('0x29')]('%s/recordings/%s',FILES_PATH,_0x87cea0);this[_0x0617('0x3c')][_0x0617('0x6f')](this,_0x4e1396,_0x87cea0,_0x51fdb7);this['channel'][_0x0617('0x94')](_0x0617('0x17d'),_0x87cea0);logger[_0x0617('0x2e')](_0x0617('0x17e'),_0x5f21f0,_0x2b9d03,_0x4e1396[_0x0617('0x17f')],_0x4e1396[_0x0617('0x64')]);return this['channel'][_0x0617('0x12b')](_0x5f21f0,_0x2b9d03,_0x4e1396[_0x0617('0x17f')],_0x4e1396['timeout'],undefined,!![]);};AGIVertices[_0x0617('0x10')][_0x0617('0x180')]=function(_0x561ea2){logger[_0x0617('0x2e')](util['format'](_0x0617('0x181'),_0x561ea2[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x561ea2[_0x0617('0x62')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x182'));}var _0x74797c=this[_0x0617('0x61')]['sync'](this,_0x561ea2);logger['info'](util[_0x0617('0x29')](_0x0617('0x183'),util['inspect'](_0x74797c,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x561ea2[_0x0617('0xd0')])){return this[_0x0617('0xe')]['noop'](_0x0617('0x184'));}var _0x5db850=this[_0x0617('0x11')]['sync'](this,_0x561ea2['variable_id']);if(!_0x5db850){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x561ea2,_0x0617('0x10e'));}this[_0x0617('0xe')]['setVariable'](util[_0x0617('0x29')](_0x0617('0x185'),_0x5db850),_0x74797c[_0x0617('0x74')]?_0x74797c[_0x0617('0x74')]:_0x0617('0x186'));this['channel']['setVariable'](util[_0x0617('0x29')](_0x0617('0x187'),_0x5db850),_0x74797c[_0x0617('0x75')]?_0x74797c['statusMessage']:'OK');if(_0x74797c['body']){try{this[_0x0617('0x92')](_0x74797c[_0x0617('0x6a')],_0x5db850);}catch(_0xbdb22b){logger[_0x0617('0x2d')](util[_0x0617('0x29')](_0x0617('0x188'),_0x5db850));}}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')]('variable\x20%s\x20set',_0x5db850));};AGIVertices[_0x0617('0x10')][_0x0617('0x189')]=function(_0x19c061){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x18a'),_0x19c061[_0x0617('0x38')]));return this[_0x0617('0xe')]['sayDigits'](_0x19c061[_0x0617('0x18b')][_0x0617('0x56')](/\s+/g,''),_0x19c061['escape_digits']);};AGIVertices[_0x0617('0x10')]['saynumber']=function(_0x614b7e){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x18c'),_0x614b7e[_0x0617('0x38')]));return this['channel'][_0x0617('0x18d')](_0x614b7e[_0x0617('0x63')][_0x0617('0x56')](/\s+/g,''),_0x614b7e[_0x0617('0x17f')]);};AGIVertices[_0x0617('0x10')][_0x0617('0x18e')]=function(_0x84501c){logger['info'](util['format'](_0x0617('0x18f'),_0x84501c[_0x0617('0x38')]));return this['channel'][_0x0617('0x190')](_0x84501c['text'],_0x84501c[_0x0617('0x17f')]);};AGIVertices[_0x0617('0x10')][_0x0617('0x191')]=function(_0x4046fe){logger['info'](util[_0x0617('0x29')](_0x0617('0x192'),_0x4046fe[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x4046fe['account_id'])){return this[_0x0617('0xe')]['noop'](_0x0617('0x193'));}var _0xee4288=this[_0x0617('0x194')]['sync'](this,_0x4046fe[_0x0617('0x195')]);if(!_0xee4288||!_0xee4288['Smtp']){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x4046fe,_0x0617('0x196'));}var _0x2800fd={'from':util[_0x0617('0x29')]('\x22%s\x22\x20<%s>',_0xee4288[_0x0617('0x14')],_0xee4288[_0x0617('0x197')]||_0xee4288[_0x0617('0x198')][_0x0617('0x199')]),'to':_0x4046fe['to']||'','cc':_0x4046fe['cc']||'','bcc':_0x4046fe[_0x0617('0x19a')]||'','subject':_0x4046fe[_0x0617('0x19b')],'html':_0x4046fe[_0x0617('0x5a')],'text':_0x4046fe[_0x0617('0x5a')]};if(this[_0x0617('0x82')](_0x4046fe[_0x0617('0x19c')])){}logger[_0x0617('0xd7')]('sendMail\x20message',JSON[_0x0617('0x72')](_0x2800fd));this['createSquareDetailsReport']['sync'](this,_0x4046fe,_0x4046fe[_0x0617('0x195')]);this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x19d'),_0xee4288[_0x0617('0x14')]));this[_0x0617('0x24')]['sync'](this,_0xee4288[_0x0617('0x19e')],_0x2800fd);return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x19f'));};AGIVertices[_0x0617('0x10')]['sendFax']=function(_0xd002a3){logger['info'](util[_0x0617('0x29')](_0x0617('0x1a0'),_0xd002a3[_0x0617('0x38')]));return this['channel'][_0x0617('0x9f')](_0x0617('0x1a1'));};AGIVertices[_0x0617('0x10')]['sendSMS']=function(_0x2e2791){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x1a2'),_0x2e2791[_0x0617('0x38')]));if(!this['isConfigured'](_0x2e2791[_0x0617('0x1a3')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x1a4'));}var _0x5d97ed=this['getSmsAccount']['sync'](this,_0x2e2791[_0x0617('0x1a3')]);if(!_0x5d97ed){return this[_0x0617('0xe')]['error'](_0x2e2791,'no\x20sms\x20account\x20found');}var _0x4b0bd0={'body':_0x2e2791[_0x0617('0x1a5')],'phone':_0x2e2791['to']||'','SmsAccountId':_0x5d97ed['id']};logger[_0x0617('0xd7')](_0x0617('0x1a6'),JSON[_0x0617('0x72')](_0x4b0bd0));this[_0x0617('0x36')][_0x0617('0x6f')](this,_0x2e2791,_0x2e2791[_0x0617('0x1a3')]);this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5d97ed[_0x0617('0x14')]));this[_0x0617('0x35')][_0x0617('0x6f')](this,_0x4b0bd0);return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x1a7'));};AGIVertices[_0x0617('0x10')]['set']=function(_0x37a2e0){logger[_0x0617('0x2e')](util[_0x0617('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x37a2e0[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x37a2e0[_0x0617('0xd0')])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x37a2e0,_0x0617('0x1a8'));}var _0x561b1d=this['getVariable'][_0x0617('0x6f')](this,_0x37a2e0[_0x0617('0xd0')]);if(!_0x561b1d){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x37a2e0,_0x0617('0x10e'));}return this['channel'][_0x0617('0x94')](_0x561b1d,_0x37a2e0[_0x0617('0x1a9')]);};AGIVertices[_0x0617('0x10')][_0x0617('0x1aa')]=function(_0x3a5746){logger['info'](util[_0x0617('0x29')](_0x0617('0x1ab'),_0x3a5746[_0x0617('0x38')]));this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x1ac'));if(_0x3a5746[_0x0617('0xac')]==='yes'){this[_0x0617('0xe')]['noop'](_0x0617('0x1ad'));return this[_0x0617('0xe')][_0x0617('0xac')]();}return this['channel'][_0x0617('0x9f')]('Skipped\x20Answer');};AGIVertices[_0x0617('0x10')][_0x0617('0x1ae')]=function(_0x3a3e9b){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x1af'),_0x3a3e9b[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x3a3e9b[_0x0617('0x1b0')])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x3a3e9b,_0x0617('0x1b1'));}var _0x1acc58=this[_0x0617('0x18')][_0x0617('0x6f')](this,_0x3a3e9b['project_id']);if(!this[_0x0617('0x82')](_0x1acc58)){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x3a3e9b,util[_0x0617('0x29')](_0x0617('0x1b2'),_0x3a3e9b[_0x0617('0x1b0')]));}if(_0x1acc58===this[_0x0617('0xe')][_0x0617('0x3a')]){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x3a3e9b,_0x0617('0x1b3'));}this[_0x0617('0x36')][_0x0617('0x6f')](this,_0x3a3e9b,_0x1acc58);var _0x5f15fb=this['channel'][_0x0617('0x54')](_0x0617('0x1b4'),util[_0x0617('0x29')](_0x0617('0x1b5'),config[_0x0617('0xa9')][_0x0617('0x1b6')]||_0x0617('0x1b7'),_0x1acc58,this[_0x0617('0xe')][_0x0617('0x3a')]));if(_0x5f15fb['result']===-0x1){return _0x5f15fb;}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0xb9'),_0x0617('0x1b4'),_0x1acc58));};AGIVertices[_0x0617('0x10')][_0x0617('0x1b8')]=function(_0x384ab3){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x1b9'),_0x384ab3['label']));var _0xaf44fe=this['shellCommand'][_0x0617('0x6f')](this,_0x384ab3['command']);this['createSquareDetailsReport'][_0x0617('0x6f')](this,_0x384ab3,_0x384ab3[_0x0617('0x1ba')]);if(this[_0x0617('0x82')](_0x384ab3['variable_id'])){var _0x35b247=this[_0x0617('0x11')][_0x0617('0x6f')](this,_0x384ab3[_0x0617('0xd0')]);if(_0x35b247){this[_0x0617('0xe')][_0x0617('0x94')](_0x35b247,_0xaf44fe);return this[_0x0617('0xe')]['noop'](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x384ab3[_0x0617('0x1ba')],_0x35b247));}}return this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x1bb'),_0x384ab3[_0x0617('0x1ba')]));};AGIVertices[_0x0617('0x10')][_0x0617('0x1bc')]=function(_0xe6efe4){logger[_0x0617('0x2e')](util[_0x0617('0x29')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xe6efe4[_0x0617('0x38')]));_0xe6efe4[_0x0617('0x5a')]=_0xe6efe4[_0x0617('0x5a')][_0x0617('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xe6efe4[_0x0617('0x58')])){return this[_0x0617('0xe')][_0x0617('0x9f')](_0x0617('0x1bd'));}if(!this[_0x0617('0x82')](_0xe6efe4['text'])){return this['channel'][_0x0617('0x9f')](_0x0617('0xbd'));}this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x1be'),_0xe6efe4['text']));var _0x223b10=this[_0x0617('0x57')]['sync'](this,_0xe6efe4);if(_0x223b10){this['channel'][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x1bf'),_0x223b10));var _0x292640=this[_0x0617('0xe')][_0x0617('0x1c0')](_0x223b10);try{fs[_0x0617('0xfa')](_0x223b10+_0x0617('0xfb'));}catch(_0x26c258){logger[_0x0617('0x2d')](_0x26c258);}return _0x292640;}return this[_0x0617('0xe')][_0x0617('0x2d')](_0xe6efe4,_0x0617('0x1c1'));};AGIVertices[_0x0617('0x10')][_0x0617('0x1c2')]=function(_0x1c1668){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x1c3'),_0x1c1668[_0x0617('0x38')]));_0x1c1668[_0x0617('0x5a')]=_0x1c1668['text'][_0x0617('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0617('0x82')](_0x1c1668['text'])){return this['channel'][_0x0617('0x9f')](_0x0617('0xbd'));}this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x1c4'),_0x1c1668[_0x0617('0x5a')]));var _0x3dc9c7=this[_0x0617('0x1c5')][_0x0617('0x6f')](this,_0x1c1668);if(_0x3dc9c7){this[_0x0617('0xe')][_0x0617('0x9f')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x3dc9c7));var _0x318e2b=this[_0x0617('0xe')][_0x0617('0x1c0')](_0x3dc9c7);try{fs[_0x0617('0xfa')](_0x3dc9c7+_0x0617('0xfb'));}catch(_0x153d96){logger[_0x0617('0x2d')](_0x153d96);}return _0x318e2b;}return this[_0x0617('0xe')][_0x0617('0x2d')](_0x1c1668,_0x0617('0x1c6'));};AGIVertices[_0x0617('0x10')][_0x0617('0x1c7')]=function(_0x121063){logger[_0x0617('0x2e')](util[_0x0617('0x29')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x121063[_0x0617('0x38')]));if(!this['isConfigured'](_0x121063[_0x0617('0x157')])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x121063,_0x0617('0x158'));}logger[_0x0617('0x2e')](util['format'](_0x0617('0x159'),this[_0x0617('0xe')][_0x0617('0x3b')],_0x121063[_0x0617('0x157')]));var _0x27cd91=this[_0x0617('0x4f')][_0x0617('0x6f')](this,_0x121063[_0x0617('0x157')]);if(_0x27cd91){logger[_0x0617('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0617('0xe')][_0x0617('0x3b')],_0x121063[_0x0617('0x157')]));this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x15a'),this[_0x0617('0xe')]['callerid'],_0x121063[_0x0617('0x157')]));return{'code':0xc8,'result':_0x0617('0x15b')};}else{logger['info'](util[_0x0617('0x29')](_0x0617('0x15c'),this['channel'][_0x0617('0x3b')],_0x121063[_0x0617('0x157')]));this[_0x0617('0xe')][_0x0617('0x9f')](util[_0x0617('0x29')](_0x0617('0x15c'),this[_0x0617('0xe')][_0x0617('0x3b')],_0x121063['findBy']));return{'code':0xc8,'result':_0x0617('0x16b')};}};AGIVertices[_0x0617('0x10')][_0x0617('0x1c8')]=function(_0x4ba110){logger[_0x0617('0x2e')](util[_0x0617('0x29')](_0x0617('0x1c9'),_0x4ba110[_0x0617('0x38')]));var _0x40d051=this[_0x0617('0xe')][_0x0617('0x54')](_0x0617('0x1ca'),[_0x4ba110[_0x0617('0x1cb')],_0x4ba110[_0x0617('0x77')]]);if(_0x40d051[_0x0617('0x9b')]===-0x1){return _0x40d051;}return this[_0x0617('0xe')][_0x0617('0x9f')](util['format'](_0x0617('0xb9'),_0x0617('0x1ca'),_0x4ba110[_0x0617('0x1cb')]));};AGIVertices['prototype'][_0x0617('0x1cc')]=function(_0x55f136){logger[_0x0617('0x2e')](util['format'](_0x0617('0x1cd'),_0x55f136[_0x0617('0x38')]));if(!this[_0x0617('0x82')](_0x55f136[_0x0617('0xd0')])){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x55f136,_0x0617('0x1a8'));}var _0x51d3cc=this[_0x0617('0x11')][_0x0617('0x6f')](this,_0x55f136[_0x0617('0xd0')]);if(!_0x51d3cc){return this[_0x0617('0xe')][_0x0617('0x2d')](_0x55f136,_0x0617('0x10e'));}var _0x42e8b6=this[_0x0617('0xe')][_0x0617('0x11')](_0x51d3cc);return{'code':0xc8,'result':_0x42e8b6['extra']?_0x42e8b6[_0x0617('0x98')]:'-'};};String[_0x0617('0x10')][_0x0617('0x97')]=function(_0x213288,_0xea4c64){return this[_0x0617('0x96')](_0x213288)['join'](_0xea4c64);};module[_0x0617('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index b201513..0ac9e12 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 _0x5fb1=['update','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','acwTimeout','timer','stopAcw','lastPauseAt','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause'];(function(_0x393ad5,_0x2a7a68){var _0x31f723=function(_0x4877c){while(--_0x4877c){_0x393ad5['push'](_0x393ad5['shift']());}};_0x31f723(++_0x2a7a68);}(_0x5fb1,0x74));var _0x15fb=function(_0x3cae69,_0x233c38){_0x3cae69=_0x3cae69-0x0;var _0x3128eb=_0x5fb1[_0x3cae69];return _0x3128eb;};'use strict';var util=require(_0x15fb('0x0'));var _=require(_0x15fb('0x1'));var moment=require(_0x15fb('0x2'));var ami=require('../ami');var logger=require(_0x15fb('0x3'))(_0x15fb('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x15fb('0x5'));function Acw(_0x9be408){this[_0x15fb('0x6')]=_0x9be408[_0x15fb('0x6')];this['agents']=_0x9be408[_0x15fb('0x7')];this[_0x15fb('0x8')]=_0x9be408[_0x15fb('0x8')];this[_0x15fb('0x9')]={};ami['on'](_0x15fb('0xa'),this[_0x15fb('0xb')][_0x15fb('0xc')](this));ami['on'](_0x15fb('0xd'),this[_0x15fb('0xe')][_0x15fb('0xc')](this));ami['on'](_0x15fb('0xf'),this[_0x15fb('0x10')]['bind'](this));ami['on'](_0x15fb('0x11'),this[_0x15fb('0x12')][_0x15fb('0xc')](this));ami['on'](_0x15fb('0x13'),this[_0x15fb('0x14')][_0x15fb('0xc')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on'](_0x15fb('0x15'),this[_0x15fb('0x16')][_0x15fb('0xc')](this));}function getDiff(_0x11e111){var _0x122ef0=moment()['milliseconds'](0x0);var _0x2430ec=moment(_0x11e111)[_0x15fb('0x17')](0x0);return _0x122ef0[_0x15fb('0x18')](_0x2430ec,_0x15fb('0x19'));}Acw[_0x15fb('0x1a')][_0x15fb('0x1b')]=function(_0x2f461b){try{var _0x200f44=this;var _0x31c714=this[_0x15fb('0x9')][_0x2f461b][_0x15fb('0x1c')];var _0x5e6ca1=this['channels'][_0x2f461b][_0x15fb('0x1d')];var _0xffe5cc=this['voiceQueues'][_0x5e6ca1];var _0x425526=![];var _0x9f0e82='ACW';if(_0xffe5cc[_0x15fb('0x1e')]){if(_0xffe5cc[_0x15fb('0x1f')][_0x15fb('0x20')]){_0x425526=!![];_0x9f0e82=_0xffe5cc[_0x15fb('0x1f')]['name'];}}ami[_0x15fb('0x21')]({'action':_0x15fb('0x22'),'interface':_0x31c714,'paused':!![],'reason':_0x9f0e82})[_0x15fb('0x23')](function(_0x59a7c9){if(_0x200f44[_0x15fb('0x7')][_0x31c714]){return RpcUser[_0x15fb('0x24')](_0x200f44[_0x15fb('0x7')][_0x31c714]['id'])[_0x15fb('0x23')](function(_0x4477e4){if(_0x4477e4&&!_0x4477e4['voicePause']){logger[_0x15fb('0x25')](_0x15fb('0x26'),_0x2f461b,_0x31c714,_0x5e6ca1);var _0x53d50a=_0x200f44[_0x15fb('0x9')][_0x2f461b][_0x15fb('0x27')]&&_0x200f44['channels'][_0x2f461b]['destlinkedid']?_0x200f44[_0x15fb('0x9')][_0x2f461b]['destlinkedid']:_0x2f461b;return RpcUser[_0x15fb('0x28')](_0x200f44[_0x15fb('0x7')][_0x31c714],_0x9f0e82,_0x53d50a)[_0x15fb('0x23')](function(_0x27f64e){if(!_0x425526){_0x200f44[_0x15fb('0x8')][_0x31c714]={};logger[_0x15fb('0x25')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2f461b,_0x200f44[_0x15fb('0x6')][_0x5e6ca1][_0x15fb('0x29')],_0x31c714,_0x5e6ca1);_0x200f44['timers'][_0x31c714][_0x15fb('0x2a')]=setTimeout(_0x200f44[_0x15fb('0x2b')][_0x15fb('0xc')](_0x200f44,_0x31c714),_0x200f44['voiceQueues'][_0x5e6ca1][_0x15fb('0x29')]*0x3e8);_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x200f44['timers'][_0x31c714][_0x15fb('0x2d')]=_0x2f461b;_0x200f44['timers'][_0x31c714][_0x15fb('0x1d')]=_0x5e6ca1;_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2e')]=function(){var _0xd8cbde=getDiff(_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2c')]);clearTimeout(_0x200f44[_0x15fb('0x8')][_0x31c714][_0x15fb('0x2a')]);_0x200f44['timers'][_0x31c714]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0xd8cbde},_0x200f44[_0x15fb('0x8')][_0x31c714]['uniqueid'],_0x31c714)[_0x15fb('0x23')](function(_0x467ae1){logger[_0x15fb('0x25')](_0x15fb('0x2f'),_0x2f461b,_0xd8cbde,_0x467ae1);})['catch'](function(_0x16c73e){logger[_0x15fb('0x30')](_0x15fb('0x31'),_0x2f461b,_0x16c73e);});delete _0x200f44[_0x15fb('0x8')][_0x31c714];};}});}else{logger[_0x15fb('0x25')](_0x15fb('0x32'),_0x2f461b,_0x31c714,_0x5e6ca1);}});}})['catch'](function(_0x18aca4){logger[_0x15fb('0x30')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2f461b,_0x200f44[_0x15fb('0x6')][_0x5e6ca1][_0x15fb('0x29')],_0x31c714,_0x5e6ca1);})[_0x15fb('0x33')](function(){delete _0x200f44[_0x15fb('0x9')][_0x2f461b];});}catch(_0x512059){logger['error'](_0x15fb('0x34'),_0x512059[_0x15fb('0x35')]);}};Acw[_0x15fb('0x1a')][_0x15fb('0x2b')]=function(_0x4a32b9){try{var _0x50759b=this;if(_0x50759b[_0x15fb('0x8')][_0x4a32b9]){_0x50759b['timers'][_0x4a32b9]['timer']=![];var _0x48b53a=_0x50759b[_0x15fb('0x8')][_0x4a32b9][_0x15fb('0x2d')];var _0x286218=_0x50759b[_0x15fb('0x8')][_0x4a32b9][_0x15fb('0x1d')];var _0x564eb9=_0x50759b[_0x15fb('0x6')][_0x286218]['acwTimeout'];logger[_0x15fb('0x25')](_0x15fb('0x36'),_0x48b53a,_0x4a32b9);RpcUser[_0x15fb('0x37')](this[_0x15fb('0x7')][_0x4a32b9]);RpcVoiceAgentReport[_0x15fb('0x38')]({'acwtime':_0x564eb9,'agentacw':!![]},_0x48b53a,_0x4a32b9)[_0x15fb('0x23')](function(_0x33c9ea){logger[_0x15fb('0x25')](_0x15fb('0x2f'),_0x48b53a,_0x564eb9,_0x33c9ea);})[_0x15fb('0x39')](function(_0x41cdbb){logger[_0x15fb('0x30')](_0x15fb('0x31'),_0x48b53a,_0x41cdbb);});}else{logger[_0x15fb('0x30')](_0x15fb('0x3a'),_0x4a32b9);if(_0x50759b[_0x15fb('0x8')]){logger['info'](_0x15fb('0x3b'),JSON[_0x15fb('0x3c')](_0x50759b[_0x15fb('0x8')]));}}}catch(_0x350469){logger['error']('[ACW][STOP]\x20%s',_0x350469[_0x15fb('0x35')]);}};Acw['prototype']['syncAgentConnect']=function(_0x4094ba){try{if(this[_0x15fb('0x6')][_0x4094ba[_0x15fb('0x1d')]]&&(this[_0x15fb('0x6')][_0x4094ba[_0x15fb('0x1d')]][_0x15fb('0x4')]||this[_0x15fb('0x6')][_0x4094ba[_0x15fb('0x1d')]]['mandatoryDisposition'])){if(this['agents'][_0x4094ba[_0x15fb('0x1c')]]){this['channels'][_0x4094ba[_0x15fb('0x2d')]]={'queue':_0x4094ba['queue'],'interface':_0x4094ba[_0x15fb('0x1c')],'destlinkedid':_0x4094ba['destlinkedid']};}}}catch(_0x36cfce){logger[_0x15fb('0x30')](_0x15fb('0x3d'),_0x36cfce[_0x15fb('0x35')]);}};Acw[_0x15fb('0x1a')][_0x15fb('0x16')]=function(_0x5da583){try{if(this[_0x15fb('0x6')][_0x5da583[_0x15fb('0x1d')]]&&(this['voiceQueues'][_0x5da583['queue']][_0x15fb('0x4')]||this[_0x15fb('0x6')][_0x5da583[_0x15fb('0x1d')]][_0x15fb('0x1e')])){if(this[_0x15fb('0x7')][_0x5da583[_0x15fb('0x1c')]]){this[_0x15fb('0x9')][_0x5da583[_0x15fb('0x2d')]]={'queue':_0x5da583[_0x15fb('0x1d')],'interface':_0x5da583[_0x15fb('0x1c')]};}}}catch(_0x448a22){logger[_0x15fb('0x30')]('[ACW][syncAgentConnectPreview]\x20%s',_0x448a22['message']);}};Acw[_0x15fb('0x1a')][_0x15fb('0xe')]=function(_0x25742b){try{if(this[_0x15fb('0x9')][_0x25742b[_0x15fb('0x2d')]]&&_['isUndefined'](this['channels'][_0x25742b['uniqueid']][_0x15fb('0x27')])){logger[_0x15fb('0x25')](_0x15fb('0x3e'),_0x25742b[_0x15fb('0x2d')]);this[_0x15fb('0x1b')](_0x25742b[_0x15fb('0x2d')]);}else if(this[_0x15fb('0x9')][_0x25742b[_0x15fb('0x3f')]]&&_[_0x15fb('0x40')](this[_0x15fb('0x9')][_0x25742b[_0x15fb('0x3f')]][_0x15fb('0x27')])){logger[_0x15fb('0x25')](_0x15fb('0x41'),_0x25742b[_0x15fb('0x3f')]);this[_0x15fb('0x1b')](_0x25742b[_0x15fb('0x3f')]);}}catch(_0x3d0e23){logger[_0x15fb('0x30')](_0x15fb('0x42'),_0x3d0e23[_0x15fb('0x35')]);}};Acw['prototype']['syncHangup']=function(_0x77d71){try{if(this[_0x15fb('0x9')][_0x77d71['uniqueid']]&&this['channels'][_0x77d71['uniqueid']][_0x15fb('0x27')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x77d71['uniqueid']);this[_0x15fb('0x1b')](_0x77d71[_0x15fb('0x2d')]);}else if(this['channels'][_0x77d71[_0x15fb('0x3f')]]&&this['channels'][_0x77d71['linkedid']][_0x15fb('0x27')]){logger['info'](_0x15fb('0x43'),_0x77d71[_0x15fb('0x3f')]);this['startAcw'](_0x77d71[_0x15fb('0x3f')]);}}catch(_0xacf362){logger[_0x15fb('0x30')](_0x15fb('0x44'),_0xacf362['message']);}};Acw['prototype'][_0x15fb('0x14')]=function(_0x51d382){try{if(!_[_0x15fb('0x45')](this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x46')]])){this[_0x15fb('0x1b')](_0x51d382[_0x15fb('0x46')]);if(this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]]){this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]]['attended']=!![];this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x48')]]=this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]];delete this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x47')]];}}else if(!_[_0x15fb('0x45')](this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x48')]])){this[_0x15fb('0x1b')](_0x51d382[_0x15fb('0x48')]);if(this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]]){this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]][_0x15fb('0x27')]=!![];this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x46')]]=this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]];delete this[_0x15fb('0x9')][_0x51d382[_0x15fb('0x49')]];}}}catch(_0x408aa4){logger['error'](_0x15fb('0x4a'),_0x408aa4['message']);}};Acw[_0x15fb('0x1a')][_0x15fb('0x4b')]=function(_0x5d5a6c){try{if(this[_0x15fb('0x9')][_0x5d5a6c[_0x15fb('0x4c')]]){logger[_0x15fb('0x25')](_0x15fb('0x4d'),JSON[_0x15fb('0x3c')](_0x5d5a6c[_0x15fb('0x4c')]));this[_0x15fb('0x1b')](_0x5d5a6c[_0x15fb('0x4c')]);}else if(this[_0x15fb('0x9')][_0x5d5a6c[_0x15fb('0x4e')]]){logger['info'](_0x15fb('0x4f'),JSON[_0x15fb('0x3c')](_0x5d5a6c[_0x15fb('0x4e')]));this['startAcw'](_0x5d5a6c[_0x15fb('0x4e')]);}}catch(_0x2afd30){logger[_0x15fb('0x30')](_0x15fb('0x50'),_0x2afd30[_0x15fb('0x35')]);}};Acw[_0x15fb('0x1a')][_0x15fb('0x12')]=function(_0x1c1abd){try{if(this[_0x15fb('0x6')][_0x1c1abd[_0x15fb('0x1d')]]&&this[_0x15fb('0x6')][_0x1c1abd[_0x15fb('0x1d')]][_0x15fb('0x51')]==='all'){if(this['agents'][_0x1c1abd['interface']]){logger[_0x15fb('0x25')](_0x15fb('0x52'),_0x1c1abd[_0x15fb('0x2d')],_0x1c1abd[_0x15fb('0x1c')],_0x1c1abd[_0x15fb('0x1d')]);return RpcUser[_0x15fb('0x28')](this[_0x15fb('0x7')][_0x1c1abd[_0x15fb('0x1c')]],_0x15fb('0x53'),_0x1c1abd[_0x15fb('0x2d')]);}}}catch(_0x5edd93){logger[_0x15fb('0x30')](_0x15fb('0x54'),_0x5edd93['message']);}};module[_0x15fb('0x55')]=Acw; \ No newline at end of file +var _0x368e=['[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','info','acwTimeout','timer','lastPauseAt','format','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','stopAcw','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','attended','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','milliseconds','seconds','startAcw','interface','queue','mandatoryDispositionPause','Action','QueuePause','then','getAgent'];(function(_0x2cec77,_0x3d9a50){var _0x4f777d=function(_0x10754c){while(--_0x10754c){_0x2cec77['push'](_0x2cec77['shift']());}};_0x4f777d(++_0x3d9a50);}(_0x368e,0xc9));var _0xe368=function(_0x2b1cdd,_0x1c47ef){_0x2b1cdd=_0x2b1cdd-0x0;var _0xc554f2=_0x368e[_0x2b1cdd];return _0xc554f2;};'use strict';var util=require(_0xe368('0x0'));var _=require(_0xe368('0x1'));var moment=require(_0xe368('0x2'));var ami=require(_0xe368('0x3'));var logger=require('../../../config/logger')(_0xe368('0x4'));var RpcUser=require(_0xe368('0x5'));var RpcVoiceAgentReport=require(_0xe368('0x6'));function Acw(_0xfd380e){this[_0xe368('0x7')]=_0xfd380e[_0xe368('0x7')];this[_0xe368('0x8')]=_0xfd380e[_0xe368('0x8')];this['timers']=_0xfd380e[_0xe368('0x9')];this[_0xe368('0xa')]={};ami['on']('agentconnect',this[_0xe368('0xb')][_0xe368('0xc')](this));ami['on'](_0xe368('0xd'),this[_0xe368('0xe')][_0xe368('0xc')](this));ami['on']('hangup',this['syncHangup'][_0xe368('0xc')](this));ami['on'](_0xe368('0xf'),this[_0xe368('0x10')]['bind'](this));ami['on'](_0xe368('0x11'),this[_0xe368('0x12')][_0xe368('0xc')](this));ami['on']('blindtransfer',this[_0xe368('0x13')][_0xe368('0xc')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xe368('0xc')](this));}function getDiff(_0x323b83){var _0xa9d705=moment()[_0xe368('0x14')](0x0);var _0xa76244=moment(_0x323b83)[_0xe368('0x14')](0x0);return _0xa9d705['diff'](_0xa76244,_0xe368('0x15'));}Acw['prototype'][_0xe368('0x16')]=function(_0x36ec62){try{var _0x2753ac=this;var _0x2d6d29=this[_0xe368('0xa')][_0x36ec62][_0xe368('0x17')];var _0x548317=this[_0xe368('0xa')][_0x36ec62][_0xe368('0x18')];var _0x123ec0=this[_0xe368('0x7')][_0x548317];var _0x346bb7=![];var _0x1d59d4='ACW';if(_0x123ec0['mandatoryDisposition']){if(_0x123ec0['mandatoryDispositionPause']['name']){_0x346bb7=!![];_0x1d59d4=_0x123ec0[_0xe368('0x19')]['name'];}}ami[_0xe368('0x1a')]({'action':_0xe368('0x1b'),'interface':_0x2d6d29,'paused':!![],'reason':_0x1d59d4})[_0xe368('0x1c')](function(_0x2055e5){if(_0x2753ac[_0xe368('0x8')][_0x2d6d29]){return RpcUser[_0xe368('0x1d')](_0x2753ac[_0xe368('0x8')][_0x2d6d29]['id'])[_0xe368('0x1c')](function(_0x50de31){if(_0x50de31&&!_0x50de31['voicePause']){logger['info'](_0xe368('0x1e'),_0x36ec62,_0x2d6d29,_0x548317);var _0x447ffa=_0x2753ac['channels'][_0x36ec62]['attended']&&_0x2753ac['channels'][_0x36ec62]['destlinkedid']?_0x2753ac['channels'][_0x36ec62][_0xe368('0x1f')]:_0x36ec62;return RpcUser['savePause'](_0x2753ac[_0xe368('0x8')][_0x2d6d29],_0x1d59d4,_0x447ffa)[_0xe368('0x1c')](function(_0x169aed){if(!_0x346bb7){_0x2753ac[_0xe368('0x9')][_0x2d6d29]={};logger[_0xe368('0x20')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x36ec62,_0x2753ac[_0xe368('0x7')][_0x548317][_0xe368('0x21')],_0x2d6d29,_0x548317);_0x2753ac[_0xe368('0x9')][_0x2d6d29][_0xe368('0x22')]=setTimeout(_0x2753ac['stopAcw'][_0xe368('0xc')](_0x2753ac,_0x2d6d29),_0x2753ac[_0xe368('0x7')][_0x548317][_0xe368('0x21')]*0x3e8);_0x2753ac['timers'][_0x2d6d29][_0xe368('0x23')]=moment()[_0xe368('0x24')]('YYYY-MM-DD\x20HH:mm:ss');_0x2753ac[_0xe368('0x9')][_0x2d6d29][_0xe368('0x25')]=_0x36ec62;_0x2753ac[_0xe368('0x9')][_0x2d6d29][_0xe368('0x18')]=_0x548317;_0x2753ac[_0xe368('0x9')][_0x2d6d29]['updateAcw']=function(){var _0x4d3486=getDiff(_0x2753ac[_0xe368('0x9')][_0x2d6d29]['lastPauseAt']);clearTimeout(_0x2753ac[_0xe368('0x9')][_0x2d6d29]['timer']);_0x2753ac[_0xe368('0x9')][_0x2d6d29]['timer']=![];RpcVoiceAgentReport[_0xe368('0x26')]({'acwtime':_0x4d3486},_0x2753ac['timers'][_0x2d6d29][_0xe368('0x25')],_0x2d6d29)['then'](function(_0x155237){logger[_0xe368('0x20')](_0xe368('0x27'),_0x36ec62,_0x4d3486,_0x155237);})[_0xe368('0x28')](function(_0x240a3b){logger[_0xe368('0x29')](_0xe368('0x2a'),_0x36ec62,_0x240a3b);});delete _0x2753ac[_0xe368('0x9')][_0x2d6d29];};}});}else{logger[_0xe368('0x20')](_0xe368('0x2b'),_0x36ec62,_0x2d6d29,_0x548317);}});}})[_0xe368('0x28')](function(_0x4a128c){logger['error'](_0xe368('0x2c'),_0x36ec62,_0x2753ac['voiceQueues'][_0x548317][_0xe368('0x21')],_0x2d6d29,_0x548317);})[_0xe368('0x2d')](function(){delete _0x2753ac[_0xe368('0xa')][_0x36ec62];});}catch(_0x4c65c6){logger[_0xe368('0x29')](_0xe368('0x2e'),_0x4c65c6[_0xe368('0x2f')]);}};Acw[_0xe368('0x30')][_0xe368('0x31')]=function(_0x40c6a6){try{var _0x59af88=this;if(_0x59af88[_0xe368('0x9')][_0x40c6a6]){_0x59af88['timers'][_0x40c6a6][_0xe368('0x22')]=![];var _0x39b67d=_0x59af88[_0xe368('0x9')][_0x40c6a6][_0xe368('0x25')];var _0x1016d8=_0x59af88[_0xe368('0x9')][_0x40c6a6][_0xe368('0x18')];var _0x12703c=_0x59af88[_0xe368('0x7')][_0x1016d8][_0xe368('0x21')];logger[_0xe368('0x20')]('[%s][TIMER][STOP][AGENT:%s]',_0x39b67d,_0x40c6a6);RpcUser['saveUnpause'](this['agents'][_0x40c6a6]);RpcVoiceAgentReport[_0xe368('0x26')]({'acwtime':_0x12703c,'agentacw':!![]},_0x39b67d,_0x40c6a6)[_0xe368('0x1c')](function(_0x31e06e){logger[_0xe368('0x20')](_0xe368('0x27'),_0x39b67d,_0x12703c,_0x31e06e);})[_0xe368('0x28')](function(_0x155c3a){logger['error'](_0xe368('0x2a'),_0x39b67d,_0x155c3a);});}else{logger[_0xe368('0x29')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x40c6a6);if(_0x59af88[_0xe368('0x9')]){logger[_0xe368('0x20')](_0xe368('0x32'),JSON[_0xe368('0x33')](_0x59af88[_0xe368('0x9')]));}}}catch(_0xea5660){logger[_0xe368('0x29')](_0xe368('0x34'),_0xea5660[_0xe368('0x2f')]);}};Acw[_0xe368('0x30')][_0xe368('0xb')]=function(_0x385338){try{if(this['voiceQueues'][_0x385338[_0xe368('0x18')]]&&(this['voiceQueues'][_0x385338[_0xe368('0x18')]][_0xe368('0x4')]||this[_0xe368('0x7')][_0x385338[_0xe368('0x18')]][_0xe368('0x35')])){if(this['agents'][_0x385338[_0xe368('0x17')]]){this['channels'][_0x385338[_0xe368('0x25')]]={'queue':_0x385338[_0xe368('0x18')],'interface':_0x385338['interface'],'destlinkedid':_0x385338['destlinkedid']};}}}catch(_0x2bebfb){logger['error'](_0xe368('0x36'),_0x2bebfb['message']);}};Acw['prototype'][_0xe368('0x37')]=function(_0x2275da){try{if(this[_0xe368('0x7')][_0x2275da[_0xe368('0x18')]]&&(this[_0xe368('0x7')][_0x2275da[_0xe368('0x18')]][_0xe368('0x4')]||this['voiceQueues'][_0x2275da[_0xe368('0x18')]][_0xe368('0x35')])){if(this[_0xe368('0x8')][_0x2275da[_0xe368('0x17')]]){this[_0xe368('0xa')][_0x2275da['uniqueid']]={'queue':_0x2275da[_0xe368('0x18')],'interface':_0x2275da['interface']};}}}catch(_0x1a824d){logger[_0xe368('0x29')]('[ACW][syncAgentConnectPreview]\x20%s',_0x1a824d['message']);}};Acw[_0xe368('0x30')][_0xe368('0xe')]=function(_0x3bad85){try{if(this[_0xe368('0xa')][_0x3bad85[_0xe368('0x25')]]&&_[_0xe368('0x38')](this[_0xe368('0xa')][_0x3bad85['uniqueid']]['attended'])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x3bad85[_0xe368('0x25')]);this['startAcw'](_0x3bad85[_0xe368('0x25')]);}else if(this[_0xe368('0xa')][_0x3bad85[_0xe368('0x39')]]&&_[_0xe368('0x38')](this[_0xe368('0xa')][_0x3bad85[_0xe368('0x39')]]['attended'])){logger[_0xe368('0x20')](_0xe368('0x3a'),_0x3bad85[_0xe368('0x39')]);this[_0xe368('0x16')](_0x3bad85[_0xe368('0x39')]);}}catch(_0x39b75a){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x39b75a[_0xe368('0x2f')]);}};Acw['prototype'][_0xe368('0x3b')]=function(_0x434223){try{if(this[_0xe368('0xa')][_0x434223[_0xe368('0x25')]]&&this[_0xe368('0xa')][_0x434223[_0xe368('0x25')]][_0xe368('0x3c')]){logger[_0xe368('0x20')](_0xe368('0x3d'),_0x434223[_0xe368('0x25')]);this[_0xe368('0x16')](_0x434223['uniqueid']);}else if(this[_0xe368('0xa')][_0x434223[_0xe368('0x39')]]&&this[_0xe368('0xa')][_0x434223[_0xe368('0x39')]][_0xe368('0x3c')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x434223['linkedid']);this[_0xe368('0x16')](_0x434223[_0xe368('0x39')]);}}catch(_0x162864){logger[_0xe368('0x29')](_0xe368('0x3e'),_0x162864[_0xe368('0x2f')]);}};Acw[_0xe368('0x30')][_0xe368('0x12')]=function(_0x1c437f){try{if(!_[_0xe368('0x3f')](this[_0xe368('0xa')][_0x1c437f[_0xe368('0x40')]])){this[_0xe368('0x16')](_0x1c437f[_0xe368('0x40')]);if(this['channels'][_0x1c437f[_0xe368('0x41')]]){this[_0xe368('0xa')][_0x1c437f[_0xe368('0x41')]]['attended']=!![];this[_0xe368('0xa')][_0x1c437f['transfertargetuniqueid']]=this[_0xe368('0xa')][_0x1c437f[_0xe368('0x41')]];delete this[_0xe368('0xa')][_0x1c437f[_0xe368('0x41')]];}}else if(!_['isNil'](this[_0xe368('0xa')][_0x1c437f[_0xe368('0x42')]])){this['startAcw'](_0x1c437f['transfertargetuniqueid']);if(this['channels'][_0x1c437f[_0xe368('0x43')]]){this[_0xe368('0xa')][_0x1c437f[_0xe368('0x43')]][_0xe368('0x3c')]=!![];this[_0xe368('0xa')][_0x1c437f['transfereeuniqueid']]=this[_0xe368('0xa')][_0x1c437f['origtransfereruniqueid']];delete this[_0xe368('0xa')][_0x1c437f[_0xe368('0x43')]];}}}catch(_0x15fca2){logger[_0xe368('0x29')](_0xe368('0x44'),_0x15fca2[_0xe368('0x2f')]);}};Acw[_0xe368('0x30')]['syncBlindTransfer']=function(_0x3098ac){try{if(this[_0xe368('0xa')][_0x3098ac[_0xe368('0x45')]]){logger['info'](_0xe368('0x46'),JSON[_0xe368('0x33')](_0x3098ac[_0xe368('0x45')]));this['startAcw'](_0x3098ac[_0xe368('0x45')]);}else if(this[_0xe368('0xa')][_0x3098ac[_0xe368('0x47')]]){logger[_0xe368('0x20')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xe368('0x33')](_0x3098ac[_0xe368('0x47')]));this['startAcw'](_0x3098ac[_0xe368('0x47')]);}}catch(_0x598a4c){logger[_0xe368('0x29')](_0xe368('0x48'),_0x598a4c[_0xe368('0x2f')]);}};Acw[_0xe368('0x30')][_0xe368('0x10')]=function(_0x32c52b){try{if(this[_0xe368('0x7')][_0x32c52b[_0xe368('0x18')]]&&this['voiceQueues'][_0x32c52b[_0xe368('0x18')]]['autopause']===_0xe368('0x49')){if(this[_0xe368('0x8')][_0x32c52b[_0xe368('0x17')]]){logger[_0xe368('0x20')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x32c52b[_0xe368('0x25')],_0x32c52b[_0xe368('0x17')],_0x32c52b[_0xe368('0x18')]);return RpcUser[_0xe368('0x4a')](this[_0xe368('0x8')][_0x32c52b[_0xe368('0x17')]],'Auto-Pause',_0x32c52b['uniqueid']);}}}catch(_0x3323ee){logger[_0xe368('0x29')](_0xe368('0x4b'),_0x3323ee[_0xe368('0x2f')]);}};module[_0xe368('0x4c')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 0d14d99..05c79c1 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 _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x4e6708,_0x161453){var _0x44264e=function(_0x48c4ae){while(--_0x48c4ae){_0x4e6708['push'](_0x4e6708['shift']());}};_0x44264e(++_0x161453);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x462fb7,_0x2e8ea8){var _0x50f37a=function(_0x2d3098){while(--_0x2d3098){_0x462fb7['push'](_0x462fb7['shift']());}};_0x50f37a(++_0x2e8ea8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 6ef3a9a..a8e143b 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x114af6,_0x1817cf){var _0xe19601=function(_0x2e3d4a){while(--_0x2e3d4a){_0x114af6['push'](_0x114af6['shift']());}};_0xe19601(++_0x1817cf);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x57fc06,_0x127721){_0x57fc06=_0x57fc06-0x0;var _0x2162a9=_0xbdb7[_0x57fc06];return _0x2162a9;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x3dae38,_0x49fa3d){var _0x3d6a2f=function(_0x19561d){while(--_0x19561d){_0x3dae38['push'](_0x3dae38['shift']());}};_0x3d6a2f(++_0x49fa3d);}(_0xaa88,0x137));var _0x8aa8=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0xaa88[_0x1f239e];return _0x826971;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 0fb205f..f84cc6c 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 _0x9a89=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','string','voiceQueue','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9a89,0xb4));var _0x99a8=function(_0x4dd980,_0x2f9a68){_0x4dd980=_0x4dd980-0x0;var _0x3340ae=_0x9a89[_0x4dd980];return _0x3340ae;};'use strict';var util=require(_0x99a8('0x0'));var _=require(_0x99a8('0x1'));var moment=require('moment');function checkNameSurname(_0x2b1a30,_0x33f4c2,_0x2c8806){var _0x290f42='';if(!_['isNil'](_0x33f4c2)&&_0x99a8('0x2')===typeof _0x33f4c2){_0x290f42+=_0x33f4c2;}if(!_['isNil'](_0x2c8806)&&_0x99a8('0x2')===typeof _0x2c8806){_0x290f42+='\x20'+_0x2c8806;}if(_0x290f42!==''){return _0x290f42;}return _0x2b1a30;}function Action(_0x104104,_0x39e8e6,_0x21e0e6){this[_0x99a8('0x3')]=_0x104104;this['uniqueid']=_0x21e0e6||undefined;this[_0x99a8('0x4')]=checkNameSurname(_0x39e8e6[_0x99a8('0x5')][_0x99a8('0x6')],_0x39e8e6[_0x99a8('0x5')]['firstName'],_0x39e8e6[_0x99a8('0x5')][_0x99a8('0x7')]);this['number']=_0x39e8e6['phone'];this[_0x99a8('0x8')]=_0x104104[_0x99a8('0x4')];this[_0x99a8('0x9')]=_0x39e8e6[_0x99a8('0x9')]||![];this['type']=_0x104104[_0x99a8('0xa')];this[_0x99a8('0xb')]=_0x104104[_0x99a8('0xb')]||0x3;this[_0x99a8('0xc')]=_0x39e8e6[_0x99a8('0xc')];this[_0x99a8('0xd')]=_0x39e8e6[_0x99a8('0xd')];this['countcongestionretry']=_0x39e8e6['countcongestionretry'];this['countnoanswerretry']=_0x39e8e6[_0x99a8('0xe')];this['countnosuchnumberretry']=_0x39e8e6[_0x99a8('0xf')];this[_0x99a8('0x10')]=_0x39e8e6[_0x99a8('0x10')];this['countabandonedretry']=_0x39e8e6[_0x99a8('0x11')];this[_0x99a8('0x12')]=_0x39e8e6[_0x99a8('0x12')];this[_0x99a8('0x13')]=_0x39e8e6[_0x99a8('0x13')];this[_0x99a8('0x14')]=_0x39e8e6[_0x99a8('0x14')];this[_0x99a8('0x15')]=_0x39e8e6[_0x99a8('0x15')];this[_0x99a8('0x16')]=_0x39e8e6['UserId'];this[_0x99a8('0x17')]=_0x39e8e6['VoiceQueueId'];this[_0x99a8('0x18')]=_0x39e8e6[_0x99a8('0x18')];this[_0x99a8('0x19')]=_0x39e8e6['id'];this[_0x99a8('0x1a')]=_0x39e8e6[_0x99a8('0x5')][_0x99a8('0x1b')]||'';this[_0x99a8('0x1c')]=moment()[_0x99a8('0x1d')](_0x99a8('0x1e'));this[_0x99a8('0x1f')]=_0x39e8e6[_0x99a8('0x1f')];this[_0x99a8('0x20')]=_0x39e8e6[_0x99a8('0x20')];this[_0x99a8('0x21')]=_0x39e8e6[_0x99a8('0x21')];this[_0x99a8('0x22')]=_0x39e8e6[_0x99a8('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x99a8('0x23')]['getCaller']=function(){return util[_0x99a8('0x1d')](_0x99a8('0x24'),this[_0x99a8('0x4')],this['voiceQueue'][_0x99a8('0x25')]>0x0?this[_0x99a8('0x26')][_0x99a8('0x27')](this[_0x99a8('0x3')]['dialCutDigit']):this[_0x99a8('0x26')]);};Action[_0x99a8('0x23')][_0x99a8('0x28')]=function(){return this[_0x99a8('0x8')];};module[_0x99a8('0x29')]=Action; \ No newline at end of file +var _0x08c8=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','number','prototype','exports','moment','isNil','string','voiceQueue','name','phone','Contact','queue','type','dialQueueTimeout','scheduledat'];(function(_0x4abc04,_0x536d38){var _0x2a4095=function(_0xb3aeda){while(--_0xb3aeda){_0x4abc04['push'](_0x4abc04['shift']());}};_0x2a4095(++_0x536d38);}(_0x08c8,0x1e1));var _0x808c=function(_0x243183,_0x2d7b66){_0x243183=_0x243183-0x0;var _0x1fc70b=_0x08c8[_0x243183];return _0x1fc70b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x808c('0x0'));function checkNameSurname(_0x3fb860,_0x1f67c1,_0x3bc4a1){var _0x3261d1='';if(!_[_0x808c('0x1')](_0x1f67c1)&&'string'===typeof _0x1f67c1){_0x3261d1+=_0x1f67c1;}if(!_[_0x808c('0x1')](_0x3bc4a1)&&_0x808c('0x2')===typeof _0x3bc4a1){_0x3261d1+='\x20'+_0x3bc4a1;}if(_0x3261d1!==''){return _0x3261d1;}return _0x3fb860;}function Action(_0x5f2926,_0x839cd5,_0x26d118){this[_0x808c('0x3')]=_0x5f2926;this['uniqueid']=_0x26d118||undefined;this[_0x808c('0x4')]=checkNameSurname(_0x839cd5['Contact'][_0x808c('0x5')],_0x839cd5[_0x808c('0x6')]['firstName'],_0x839cd5[_0x808c('0x6')]['lastName']);this['number']=_0x839cd5['phone'];this[_0x808c('0x7')]=_0x5f2926[_0x808c('0x4')];this['active']=_0x839cd5['active']||![];this[_0x808c('0x8')]=_0x5f2926[_0x808c('0x8')];this['dialQueueTimeout']=_0x5f2926[_0x808c('0x9')]||0x3;this[_0x808c('0xa')]=_0x839cd5[_0x808c('0xa')];this[_0x808c('0xb')]=_0x839cd5[_0x808c('0xb')];this['countcongestionretry']=_0x839cd5[_0x808c('0xc')];this[_0x808c('0xd')]=_0x839cd5[_0x808c('0xd')];this[_0x808c('0xe')]=_0x839cd5[_0x808c('0xe')];this[_0x808c('0xf')]=_0x839cd5[_0x808c('0xf')];this[_0x808c('0x10')]=_0x839cd5['countabandonedretry'];this[_0x808c('0x11')]=_0x839cd5['countmachineretry'];this['countagentrejectretry']=_0x839cd5[_0x808c('0x12')];this[_0x808c('0x13')]=_0x839cd5[_0x808c('0x13')];this[_0x808c('0x14')]=_0x839cd5[_0x808c('0x14')];this[_0x808c('0x15')]=_0x839cd5[_0x808c('0x15')];this[_0x808c('0x16')]=_0x839cd5['VoiceQueueId'];this[_0x808c('0x17')]=_0x839cd5[_0x808c('0x17')];this[_0x808c('0x18')]=_0x839cd5['id'];this[_0x808c('0x19')]=_0x839cd5[_0x808c('0x6')]['firstName']||'';this[_0x808c('0x1a')]=moment()['format'](_0x808c('0x1b'));this[_0x808c('0x1c')]=_0x839cd5[_0x808c('0x1c')];this[_0x808c('0x1d')]=_0x839cd5[_0x808c('0x1d')];this[_0x808c('0x1e')]=_0x839cd5[_0x808c('0x1e')];this['recallme']=_0x839cd5[_0x808c('0x1f')];this[_0x808c('0x20')]='';this['originatecalleridname']='';}Action['prototype'][_0x808c('0x21')]=function(){return util[_0x808c('0x22')](_0x808c('0x23'),this['name'],this[_0x808c('0x3')][_0x808c('0x24')]>0x0?this['number'][_0x808c('0x25')](this[_0x808c('0x3')][_0x808c('0x24')]):this[_0x808c('0x26')]);};Action[_0x808c('0x27')]['getQueue']=function(){return this['queue'];};module[_0x808c('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 21e0b02..9c761f8 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 _0x9b97=['answertime','endtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','diff','seconds','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','starttime','responsetime'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0x9b97,0xe7));var _0x79b9=function(_0x49325d,_0x171f5e){_0x49325d=_0x49325d-0x0;var _0x5c80d3=_0x9b97[_0x49325d];return _0x5c80d3;};'use strict';var util=require('util');var _=require(_0x79b9('0x0'));var moment=require('moment');function getSeconds(_0x357587,_0x4406d7){var _0x299454=moment(_0x357587)['milliseconds'](0x0);var _0x3fdc4c=moment(_0x4406d7)['milliseconds'](0x0);return _0x299454[_0x79b9('0x1')](_0x3fdc4c,_0x79b9('0x2'));}function AgentComplete(_0x19e196,_0x5eb57d){this['state']=0x4;this[_0x79b9('0x3')]='Answer';this['scheduledat']=_0x19e196[_0x79b9('0x4')];this[_0x79b9('0x5')]=_0x19e196['type'];this['campaigntype']=_0x19e196[_0x79b9('0x5')]===_0x79b9('0x6')?_0x79b9('0x7'):_0x19e196[_0x79b9('0x5')];this[_0x79b9('0x8')]=_0x19e196[_0x79b9('0x8')];this[_0x79b9('0x9')]=_0x19e196[_0x79b9('0x9')];this[_0x79b9('0xa')]=_0x19e196[_0x79b9('0xa')];this[_0x79b9('0xb')]=_0x19e196['countbusyretry']+_0x19e196['countcongestionretry']+_0x19e196['countnoanswerretry']+_0x19e196[_0x79b9('0xc')]+_0x19e196[_0x79b9('0xd')]+_0x19e196[_0x79b9('0xe')]+_0x19e196[_0x79b9('0xf')]+_0x19e196[_0x79b9('0x10')];this['countnosuchnumberretry']=_0x19e196[_0x79b9('0xc')];this[_0x79b9('0xd')]=_0x19e196[_0x79b9('0xd')];this[_0x79b9('0xe')]=_0x19e196[_0x79b9('0xe')];this['countmachineretry']=_0x19e196[_0x79b9('0xf')];this[_0x79b9('0x10')]=_0x19e196[_0x79b9('0x10')];this[_0x79b9('0x11')]=_0x5eb57d[_0x79b9('0x11')];this['calleridname']=_0x19e196[_0x79b9('0x12')];this['calleridnum']=_0x19e196['number'];this[_0x79b9('0x13')]=_0x19e196[_0x79b9('0x13')];this['responsetime']=_0x19e196[_0x79b9('0x14')];this[_0x79b9('0x15')]=_0x19e196[_0x79b9('0x15')];this[_0x79b9('0x16')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x19e196['responsetime'],_0x19e196[_0x79b9('0x13')]);this['holdtime']=getSeconds(_0x19e196[_0x79b9('0x15')],_0x19e196[_0x79b9('0x14')]);this[_0x79b9('0x17')]=getSeconds(this[_0x79b9('0x16')],_0x19e196[_0x79b9('0x15')]);this[_0x79b9('0x7')]=_0x5eb57d[_0x79b9('0x7')];this['membername']=_0x5eb57d['membername'];this['reason']=_0x5eb57d['reason'];this['callback']=_0x19e196[_0x79b9('0x18')];this[_0x79b9('0x19')]=_0x19e196[_0x79b9('0x19')];this[_0x79b9('0x1a')]=_0x19e196['callbackat'];this[_0x79b9('0x1b')]=_0x19e196['recallme'];this[_0x79b9('0x1c')]=_0x19e196[_0x79b9('0x1c')];this[_0x79b9('0x1d')]=_0x19e196[_0x79b9('0x1d')];this[_0x79b9('0x1e')]=_0x19e196[_0x79b9('0x1e')];this[_0x79b9('0x1f')]=_0x19e196[_0x79b9('0x1f')];this['CampaignId']=_0x19e196[_0x79b9('0x20')];this[_0x79b9('0x21')]=_0x19e196['originatecalleridnum']||'';this[_0x79b9('0x22')]=_0x19e196['originatecalleridname']||'';}module[_0x79b9('0x23')]=AgentComplete; \ No newline at end of file +var _0x4600=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','moment','milliseconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime'];(function(_0x38d5d2,_0x24ae9b){var _0x3b15b0=function(_0x3e3378){while(--_0x3e3378){_0x38d5d2['push'](_0x38d5d2['shift']());}};_0x3b15b0(++_0x24ae9b);}(_0x4600,0x9e));var _0x0460=function(_0x5bf595,_0x3dcc0b){_0x5bf595=_0x5bf595-0x0;var _0x3026a4=_0x4600[_0x5bf595];return _0x3026a4;};'use strict';var util=require(_0x0460('0x0'));var _=require('lodash');var moment=require(_0x0460('0x1'));function getSeconds(_0x302974,_0x1dde99){var _0x24d807=moment(_0x302974)['milliseconds'](0x0);var _0x20c195=moment(_0x1dde99)[_0x0460('0x2')](0x0);return _0x24d807['diff'](_0x20c195,'seconds');}function AgentComplete(_0x34d6f9,_0x1c8441){this[_0x0460('0x3')]=0x4;this[_0x0460('0x4')]=_0x0460('0x5');this[_0x0460('0x6')]=_0x34d6f9[_0x0460('0x6')];this[_0x0460('0x7')]=_0x34d6f9[_0x0460('0x7')];this[_0x0460('0x8')]=_0x34d6f9['type']===_0x0460('0x9')?'queue':_0x34d6f9['type'];this[_0x0460('0xa')]=_0x34d6f9['countbusyretry'];this['countcongestionretry']=_0x34d6f9[_0x0460('0xb')];this[_0x0460('0xc')]=_0x34d6f9[_0x0460('0xc')];this[_0x0460('0xd')]=_0x34d6f9['countbusyretry']+_0x34d6f9[_0x0460('0xb')]+_0x34d6f9[_0x0460('0xc')]+_0x34d6f9[_0x0460('0xe')]+_0x34d6f9[_0x0460('0xf')]+_0x34d6f9[_0x0460('0x10')]+_0x34d6f9[_0x0460('0x11')]+_0x34d6f9[_0x0460('0x12')];this[_0x0460('0xe')]=_0x34d6f9[_0x0460('0xe')];this['countdropretry']=_0x34d6f9[_0x0460('0xf')];this[_0x0460('0x10')]=_0x34d6f9[_0x0460('0x10')];this[_0x0460('0x11')]=_0x34d6f9[_0x0460('0x11')];this[_0x0460('0x12')]=_0x34d6f9[_0x0460('0x12')];this[_0x0460('0x13')]=_0x1c8441[_0x0460('0x13')];this[_0x0460('0x14')]=_0x34d6f9[_0x0460('0x15')];this['calleridnum']=_0x34d6f9[_0x0460('0x16')];this['starttime']=_0x34d6f9[_0x0460('0x17')];this[_0x0460('0x18')]=_0x34d6f9[_0x0460('0x18')];this[_0x0460('0x19')]=_0x34d6f9[_0x0460('0x19')];this[_0x0460('0x1a')]=moment()[_0x0460('0x1b')](_0x0460('0x1c'));this[_0x0460('0x1d')]=getSeconds(_0x34d6f9[_0x0460('0x18')],_0x34d6f9[_0x0460('0x17')]);this[_0x0460('0x1e')]=getSeconds(_0x34d6f9[_0x0460('0x19')],_0x34d6f9['responsetime']);this[_0x0460('0x1f')]=getSeconds(this[_0x0460('0x1a')],_0x34d6f9[_0x0460('0x19')]);this['queue']=_0x1c8441[_0x0460('0x20')];this[_0x0460('0x21')]=_0x1c8441[_0x0460('0x21')];this[_0x0460('0x22')]=_0x1c8441[_0x0460('0x22')];this[_0x0460('0x23')]=_0x34d6f9[_0x0460('0x23')];this['callbackuniqueid']=_0x34d6f9[_0x0460('0x24')];this[_0x0460('0x25')]=_0x34d6f9[_0x0460('0x25')];this[_0x0460('0x26')]=_0x34d6f9[_0x0460('0x26')];this['ContactId']=_0x34d6f9[_0x0460('0x27')];this[_0x0460('0x28')]=_0x34d6f9['ListId'];this[_0x0460('0x29')]=_0x34d6f9[_0x0460('0x29')];this[_0x0460('0x2a')]=_0x34d6f9[_0x0460('0x2a')];this[_0x0460('0x2b')]=_0x34d6f9[_0x0460('0x2b')];this['originatecalleridnum']=_0x34d6f9['originatecalleridnum']||'';this[_0x0460('0x2c')]=_0x34d6f9[_0x0460('0x2c')]||'';}module[_0x0460('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index c9c334e..e3ae474 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 _0x202c=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','ContactId','ListId'];(function(_0x3e25c7,_0x12b983){var _0x1208c5=function(_0x458119){while(--_0x458119){_0x3e25c7['push'](_0x3e25c7['shift']());}};_0x1208c5(++_0x12b983);}(_0x202c,0x178));var _0xc202=function(_0x4c96e4,_0x2fe2ea){_0x4c96e4=_0x4c96e4-0x0;var _0x2dd5d2=_0x202c[_0x4c96e4];return _0x2dd5d2;};'use strict';var util=require(_0xc202('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1cf3fd,_0x1ab6a1){var _0x27b3b2=moment(_0x1cf3fd)['milliseconds'](0x0);var _0x215161=moment(_0x1ab6a1)[_0xc202('0x1')](0x0);return _0x27b3b2[_0xc202('0x2')](_0x215161,_0xc202('0x3'));}function Final(_0x4b4368){this[_0xc202('0x4')]=_0x4b4368[_0xc202('0x4')];this['scheduledat']=_0x4b4368[_0xc202('0x5')];this['type']=_0x4b4368[_0xc202('0x6')];this[_0xc202('0x7')]=_0x4b4368[_0xc202('0x6')]===_0xc202('0x8')?_0xc202('0x9'):_0x4b4368[_0xc202('0x6')];this[_0xc202('0xa')]=_0x4b4368[_0xc202('0xa')];this[_0xc202('0xb')]=_0x4b4368[_0xc202('0xb')];this[_0xc202('0xc')]=_0x4b4368[_0xc202('0xc')];this[_0xc202('0xd')]=_0x4b4368['countbusyretry']+_0x4b4368[_0xc202('0xb')]+_0x4b4368[_0xc202('0xc')]+_0x4b4368[_0xc202('0xe')]+_0x4b4368[_0xc202('0xf')]+_0x4b4368[_0xc202('0x10')]+_0x4b4368[_0xc202('0x11')]+_0x4b4368[_0xc202('0x12')];this['countnosuchnumberretry']=_0x4b4368[_0xc202('0xe')];this[_0xc202('0xf')]=_0x4b4368['countdropretry'];this['countabandonedretry']=_0x4b4368['countabandonedretry'];this[_0xc202('0x11')]=_0x4b4368['countmachineretry'];this[_0xc202('0x12')]=_0x4b4368['countagentrejectretry'];this[_0xc202('0x9')]=_0x4b4368[_0xc202('0x9')];this[_0xc202('0x13')]=_0x4b4368[_0xc202('0x13')];this[_0xc202('0x14')]=_0x4b4368[_0xc202('0x14')];this[_0xc202('0x15')]=_0x4b4368['starttime'];this[_0xc202('0x16')]=_0x4b4368[_0xc202('0x16')];this[_0xc202('0x17')]=_0x4b4368['responsetime'];this['ringtime']=_0x4b4368[_0xc202('0x18')]||0x0;this[_0xc202('0x19')]=_0x4b4368[_0xc202('0x19')]||0x0;this[_0xc202('0x1a')]=_0x4b4368[_0xc202('0x1a')]||0x0;this['callback']=_0x4b4368['callback'];this[_0xc202('0x1b')]=_0x4b4368['callbackuniqueid'];this[_0xc202('0x1c')]=_0x4b4368[_0xc202('0x1c')];this['recallme']=_0x4b4368['recallme'];this[_0xc202('0x1d')]=_0x4b4368['ContactId'];this[_0xc202('0x1e')]=_0x4b4368[_0xc202('0x1e')];this[_0xc202('0x1f')]=_0x4b4368[_0xc202('0x1f')];this[_0xc202('0x20')]=_0x4b4368['VoiceQueueId'];this['CampaignId']=_0x4b4368[_0xc202('0x21')];this[_0xc202('0x22')]=_0x4b4368[_0xc202('0x22')]||'';this['originatecalleridname']=_0x4b4368[_0xc202('0x23')]||'';}module[_0xc202('0x24')]=Final; \ No newline at end of file +var _0x106f=['scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid'];(function(_0x38c6d1,_0x2fd9f5){var _0xfa4656=function(_0xe99894){while(--_0xe99894){_0x38c6d1['push'](_0x38c6d1['shift']());}};_0xfa4656(++_0x2fd9f5);}(_0x106f,0x162));var _0xf106=function(_0x29d1cc,_0x5b7b56){_0x29d1cc=_0x29d1cc-0x0;var _0x429200=_0x106f[_0x29d1cc];return _0x429200;};'use strict';var util=require(_0xf106('0x0'));var _=require(_0xf106('0x1'));var moment=require('moment');function getSeconds(_0x4014dd,_0x6d8236){var _0x59bc3a=moment(_0x4014dd)[_0xf106('0x2')](0x0);var _0x4ab04f=moment(_0x6d8236)[_0xf106('0x2')](0x0);return _0x59bc3a[_0xf106('0x3')](_0x4ab04f,_0xf106('0x4'));}function Final(_0x318376){this[_0xf106('0x5')]=_0x318376[_0xf106('0x5')];this[_0xf106('0x6')]=_0x318376['scheduledat'];this[_0xf106('0x7')]=_0x318376[_0xf106('0x7')];this['campaigntype']=_0x318376['type']==='outbound'?'queue':_0x318376['type'];this[_0xf106('0x8')]=_0x318376[_0xf106('0x8')];this[_0xf106('0x9')]=_0x318376[_0xf106('0x9')];this[_0xf106('0xa')]=_0x318376[_0xf106('0xa')];this[_0xf106('0xb')]=_0x318376[_0xf106('0x8')]+_0x318376[_0xf106('0x9')]+_0x318376[_0xf106('0xa')]+_0x318376[_0xf106('0xc')]+_0x318376['countdropretry']+_0x318376[_0xf106('0xd')]+_0x318376[_0xf106('0xe')]+_0x318376['countagentrejectretry'];this['countnosuchnumberretry']=_0x318376[_0xf106('0xc')];this[_0xf106('0xf')]=_0x318376[_0xf106('0xf')];this['countabandonedretry']=_0x318376[_0xf106('0xd')];this[_0xf106('0xe')]=_0x318376[_0xf106('0xe')];this['countagentrejectretry']=_0x318376[_0xf106('0x10')];this[_0xf106('0x11')]=_0x318376['queue'];this[_0xf106('0x12')]=_0x318376[_0xf106('0x12')];this[_0xf106('0x13')]=_0x318376['calleridnum'];this['starttime']=_0x318376[_0xf106('0x14')];this[_0xf106('0x15')]=_0x318376[_0xf106('0x15')];this['endtime']=_0x318376[_0xf106('0x15')];this[_0xf106('0x16')]=_0x318376[_0xf106('0x16')]||0x0;this[_0xf106('0x17')]=_0x318376[_0xf106('0x17')]||0x0;this[_0xf106('0x18')]=_0x318376[_0xf106('0x18')]||0x0;this[_0xf106('0x19')]=_0x318376[_0xf106('0x19')];this['callbackuniqueid']=_0x318376['callbackuniqueid'];this[_0xf106('0x1a')]=_0x318376['callbackat'];this[_0xf106('0x1b')]=_0x318376[_0xf106('0x1b')];this[_0xf106('0x1c')]=_0x318376[_0xf106('0x1c')];this[_0xf106('0x1d')]=_0x318376['ListId'];this['UserId']=_0x318376[_0xf106('0x1e')];this[_0xf106('0x1f')]=_0x318376[_0xf106('0x1f')];this[_0xf106('0x20')]=_0x318376[_0xf106('0x20')];this[_0xf106('0x21')]=_0x318376[_0xf106('0x21')]||'';this[_0xf106('0x22')]=_0x318376[_0xf106('0x22')]||'';}module[_0xf106('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index c1d5b16..9ad979d 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 _0x0986=['callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','reason','cause-txt','callback'];(function(_0x2cb8a1,_0x3c31e8){var _0xb5638=function(_0x3a00b9){while(--_0x3a00b9){_0x2cb8a1['push'](_0x2cb8a1['shift']());}};_0xb5638(++_0x3c31e8);}(_0x0986,0x194));var _0x6098=function(_0x5098c2,_0x240233){_0x5098c2=_0x5098c2-0x0;var _0x80f752=_0x0986[_0x5098c2];return _0x80f752;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6098('0x0'));function getSeconds(_0x225426,_0x48849a){var _0x32a408=moment(_0x225426)['milliseconds'](0x0);var _0x9eb457=moment(_0x48849a)[_0x6098('0x1')](0x0);return _0x32a408[_0x6098('0x2')](_0x9eb457,_0x6098('0x3'));}function Hangup(_0x288d86,_0x1d23e8){this[_0x6098('0x4')]=0x4;this[_0x6098('0x5')]=_0x6098('0x6');this['scheduledat']=_0x288d86[_0x6098('0x7')];this['type']=_0x288d86[_0x6098('0x8')];this[_0x6098('0x9')]=_0x288d86[_0x6098('0x8')]===_0x6098('0xa')?_0x6098('0xb'):_0x288d86[_0x6098('0x8')];this[_0x6098('0xc')]=_0x288d86[_0x6098('0xc')];this[_0x6098('0xd')]=_0x288d86[_0x6098('0xd')];this['countnoanswerretry']=_0x288d86['countnoanswerretry'];this['countglobal']=_0x288d86['countbusyretry']+_0x288d86[_0x6098('0xd')]+_0x288d86[_0x6098('0xe')]+_0x288d86['countnosuchnumberretry']+_0x288d86['countdropretry']+_0x288d86['countabandonedretry']+_0x288d86[_0x6098('0xf')]+_0x288d86['countagentrejectretry'];this[_0x6098('0x10')]=_0x288d86['countnosuchnumberretry'];this['countdropretry']=_0x288d86[_0x6098('0x11')];this[_0x6098('0x12')]=_0x288d86[_0x6098('0x12')];this[_0x6098('0xf')]=_0x288d86['countmachineretry'];this['countagentrejectretry']=_0x288d86[_0x6098('0x13')];this[_0x6098('0x14')]=_0x1d23e8['uniqueid'];this['calleridname']=_0x288d86[_0x6098('0x15')];this[_0x6098('0x16')]=_0x288d86[_0x6098('0x17')];this['starttime']=_0x288d86[_0x6098('0x18')];this[_0x6098('0x19')]=_0x288d86['responsetime'];this[_0x6098('0x1a')]=moment()[_0x6098('0x1b')](_0x6098('0x1c'));this['ringtime']=getSeconds(_0x288d86[_0x6098('0x19')],_0x288d86['starttime']);this[_0x6098('0x1d')]=0x0;this[_0x6098('0x1e')]=getSeconds(this['endtime'],_0x288d86[_0x6098('0x19')]);this['queue']=_0x288d86[_0x6098('0xb')];this[_0x6098('0x1f')]=_0x6098('0x20');this[_0x6098('0x21')]=_0x1d23e8[_0x6098('0x22')];this[_0x6098('0x23')]=_0x288d86['callback'];this[_0x6098('0x24')]=_0x288d86[_0x6098('0x24')];this[_0x6098('0x25')]=_0x288d86['callbackat'];this['recallme']=_0x288d86[_0x6098('0x26')];this[_0x6098('0x27')]=_0x288d86['ContactId'];this[_0x6098('0x28')]=_0x288d86[_0x6098('0x28')];this['UserId']=_0x288d86['UserId'];this[_0x6098('0x29')]=_0x288d86[_0x6098('0x29')];this[_0x6098('0x2a')]=_0x288d86[_0x6098('0x2a')];}module[_0x6098('0x2b')]=Hangup; \ No newline at end of file +var _0x97dc=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x97dc,0x16a));var _0xc97d=function(_0xf9ad24,_0x411644){_0xf9ad24=_0xf9ad24-0x0;var _0x11d9ff=_0x97dc[_0xf9ad24];return _0x11d9ff;};'use strict';var util=require(_0xc97d('0x0'));var _=require(_0xc97d('0x1'));var moment=require(_0xc97d('0x2'));function getSeconds(_0x29c3a7,_0x5bee74){var _0x2b5806=moment(_0x29c3a7)[_0xc97d('0x3')](0x0);var _0x426f3d=moment(_0x5bee74)[_0xc97d('0x3')](0x0);return _0x2b5806[_0xc97d('0x4')](_0x426f3d,_0xc97d('0x5'));}function Hangup(_0x1b4861,_0x19dcd2){this[_0xc97d('0x6')]=0x4;this[_0xc97d('0x7')]=_0xc97d('0x8');this[_0xc97d('0x9')]=_0x1b4861[_0xc97d('0x9')];this[_0xc97d('0xa')]=_0x1b4861[_0xc97d('0xa')];this[_0xc97d('0xb')]=_0x1b4861[_0xc97d('0xa')]===_0xc97d('0xc')?_0xc97d('0xd'):_0x1b4861['type'];this[_0xc97d('0xe')]=_0x1b4861[_0xc97d('0xe')];this['countcongestionretry']=_0x1b4861[_0xc97d('0xf')];this[_0xc97d('0x10')]=_0x1b4861[_0xc97d('0x10')];this[_0xc97d('0x11')]=_0x1b4861['countbusyretry']+_0x1b4861['countcongestionretry']+_0x1b4861['countnoanswerretry']+_0x1b4861[_0xc97d('0x12')]+_0x1b4861[_0xc97d('0x13')]+_0x1b4861[_0xc97d('0x14')]+_0x1b4861['countmachineretry']+_0x1b4861['countagentrejectretry'];this[_0xc97d('0x12')]=_0x1b4861[_0xc97d('0x12')];this['countdropretry']=_0x1b4861[_0xc97d('0x13')];this[_0xc97d('0x14')]=_0x1b4861[_0xc97d('0x14')];this['countmachineretry']=_0x1b4861[_0xc97d('0x15')];this[_0xc97d('0x16')]=_0x1b4861[_0xc97d('0x16')];this['uniqueid']=_0x19dcd2['uniqueid'];this['calleridname']=_0x1b4861['name'];this[_0xc97d('0x17')]=_0x1b4861[_0xc97d('0x18')];this[_0xc97d('0x19')]=_0x1b4861[_0xc97d('0x19')];this[_0xc97d('0x1a')]=_0x1b4861[_0xc97d('0x1a')];this['endtime']=moment()[_0xc97d('0x1b')](_0xc97d('0x1c'));this[_0xc97d('0x1d')]=getSeconds(_0x1b4861[_0xc97d('0x1a')],_0x1b4861['starttime']);this[_0xc97d('0x1e')]=0x0;this[_0xc97d('0x1f')]=getSeconds(this['endtime'],_0x1b4861[_0xc97d('0x1a')]);this[_0xc97d('0xd')]=_0x1b4861[_0xc97d('0xd')];this['membername']=_0xc97d('0x20');this[_0xc97d('0x21')]=_0x19dcd2[_0xc97d('0x22')];this[_0xc97d('0x23')]=_0x1b4861['callback'];this[_0xc97d('0x24')]=_0x1b4861[_0xc97d('0x24')];this['callbackat']=_0x1b4861[_0xc97d('0x25')];this[_0xc97d('0x26')]=_0x1b4861['recallme'];this[_0xc97d('0x27')]=_0x1b4861[_0xc97d('0x27')];this[_0xc97d('0x28')]=_0x1b4861[_0xc97d('0x28')];this[_0xc97d('0x29')]=_0x1b4861[_0xc97d('0x29')];this[_0xc97d('0x2a')]=_0x1b4861[_0xc97d('0x2a')];this[_0xc97d('0x2b')]=_0x1b4861[_0xc97d('0x2b')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 7498b2b..88e72d1 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 _0xd561=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime'];(function(_0x10f735,_0x25c954){var _0x1ae684=function(_0x162196){while(--_0x162196){_0x10f735['push'](_0x10f735['shift']());}};_0x1ae684(++_0x25c954);}(_0xd561,0xc7));var _0x1d56=function(_0x3884c4,_0x49e5c4){_0x3884c4=_0x3884c4-0x0;var _0x4ffe67=_0xd561[_0x3884c4];return _0x4ffe67;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x5cf740,_0x2aad12){var _0x55fe14=moment(_0x5cf740)[_0x1d56('0x0')](0x0);var _0x1f3ee0=moment(_0x2aad12)[_0x1d56('0x0')](0x0);return _0x55fe14['diff'](_0x1f3ee0,_0x1d56('0x1'));}function History(_0xa1c5e9){this['uniqueid']=_0xa1c5e9[_0x1d56('0x2')];this[_0x1d56('0x3')]=_0xa1c5e9[_0x1d56('0x3')]||undefined;this[_0x1d56('0x4')]=_0xa1c5e9[_0x1d56('0x4')];this['campaigntype']=_0xa1c5e9[_0x1d56('0x4')]===_0x1d56('0x5')?'queue':_0xa1c5e9[_0x1d56('0x4')];this['countbusyretry']=_0xa1c5e9[_0x1d56('0x6')];this['countcongestionretry']=_0xa1c5e9[_0x1d56('0x7')];this[_0x1d56('0x8')]=_0xa1c5e9[_0x1d56('0x8')];this['countglobal']=_0xa1c5e9[_0x1d56('0x6')]+_0xa1c5e9[_0x1d56('0x7')]+_0xa1c5e9[_0x1d56('0x8')]+_0xa1c5e9[_0x1d56('0x9')]+_0xa1c5e9[_0x1d56('0xa')]+_0xa1c5e9[_0x1d56('0xb')]+_0xa1c5e9[_0x1d56('0xc')]+_0xa1c5e9[_0x1d56('0xd')];this[_0x1d56('0x9')]=_0xa1c5e9[_0x1d56('0x9')];this[_0x1d56('0xa')]=_0xa1c5e9[_0x1d56('0xa')];this[_0x1d56('0xb')]=_0xa1c5e9[_0x1d56('0xb')];this[_0x1d56('0xc')]=_0xa1c5e9['countmachineretry'];this[_0x1d56('0xd')]=_0xa1c5e9['countagentrejectretry'];this['queue']=_0xa1c5e9[_0x1d56('0xe')];this[_0x1d56('0xf')]=_0xa1c5e9[_0x1d56('0x10')];this[_0x1d56('0x11')]=_0xa1c5e9[_0x1d56('0x12')];this[_0x1d56('0x13')]=_0xa1c5e9['starttime'];this[_0x1d56('0x14')]=_0xa1c5e9[_0x1d56('0x14')];this[_0x1d56('0x15')]=_0xa1c5e9['responsetime'];this[_0x1d56('0x16')]=getSeconds(_0xa1c5e9[_0x1d56('0x14')],_0xa1c5e9[_0x1d56('0x13')]);this[_0x1d56('0x17')]=0x0;this[_0x1d56('0x18')]=0x0;this[_0x1d56('0x19')]=_0xa1c5e9['callback'];this[_0x1d56('0x1a')]=_0xa1c5e9[_0x1d56('0x1a')];this['callbackat']=_0xa1c5e9[_0x1d56('0x1b')];this[_0x1d56('0x1c')]=_0xa1c5e9[_0x1d56('0x1c')];this[_0x1d56('0x1d')]=_0xa1c5e9['ContactId'];this[_0x1d56('0x1e')]=_0xa1c5e9[_0x1d56('0x1e')];this[_0x1d56('0x1f')]=_0xa1c5e9[_0x1d56('0x1f')];this['VoiceQueueId']=_0xa1c5e9[_0x1d56('0x20')];this[_0x1d56('0x21')]=_0xa1c5e9[_0x1d56('0x21')];this['originatecalleridnum']=_0xa1c5e9[_0x1d56('0x22')]||'';this[_0x1d56('0x23')]=_0xa1c5e9[_0x1d56('0x23')]||'';}module[_0x1d56('0x24')]=History; \ No newline at end of file +var _0xd159=['countdropretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countnosuchnumberretry'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd159,0x118));var _0x9d15=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd159[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var _=require(_0x9d15('0x0'));var moment=require(_0x9d15('0x1'));function getSeconds(_0x6afb62,_0x379432){var _0x4e4626=moment(_0x6afb62)[_0x9d15('0x2')](0x0);var _0x5561a0=moment(_0x379432)[_0x9d15('0x2')](0x0);return _0x4e4626[_0x9d15('0x3')](_0x5561a0,_0x9d15('0x4'));}function History(_0x394232){this['uniqueid']=_0x394232[_0x9d15('0x5')];this['scheduledat']=_0x394232[_0x9d15('0x6')]||undefined;this[_0x9d15('0x7')]=_0x394232[_0x9d15('0x7')];this['campaigntype']=_0x394232[_0x9d15('0x7')]===_0x9d15('0x8')?_0x9d15('0x9'):_0x394232[_0x9d15('0x7')];this[_0x9d15('0xa')]=_0x394232['countbusyretry'];this[_0x9d15('0xb')]=_0x394232[_0x9d15('0xb')];this[_0x9d15('0xc')]=_0x394232['countnoanswerretry'];this['countglobal']=_0x394232[_0x9d15('0xa')]+_0x394232['countcongestionretry']+_0x394232[_0x9d15('0xc')]+_0x394232['countnosuchnumberretry']+_0x394232['countdropretry']+_0x394232[_0x9d15('0xd')]+_0x394232[_0x9d15('0xe')]+_0x394232['countagentrejectretry'];this['countnosuchnumberretry']=_0x394232[_0x9d15('0xf')];this[_0x9d15('0x10')]=_0x394232[_0x9d15('0x10')];this[_0x9d15('0xd')]=_0x394232[_0x9d15('0xd')];this[_0x9d15('0xe')]=_0x394232['countmachineretry'];this[_0x9d15('0x11')]=_0x394232['countagentrejectretry'];this[_0x9d15('0x9')]=_0x394232[_0x9d15('0x9')];this['calleridname']=_0x394232[_0x9d15('0x12')];this[_0x9d15('0x13')]=_0x394232[_0x9d15('0x14')];this[_0x9d15('0x15')]=_0x394232['starttime'];this[_0x9d15('0x16')]=_0x394232[_0x9d15('0x16')];this['endtime']=_0x394232[_0x9d15('0x16')];this[_0x9d15('0x17')]=getSeconds(_0x394232[_0x9d15('0x16')],_0x394232[_0x9d15('0x15')]);this['holdtime']=0x0;this[_0x9d15('0x18')]=0x0;this[_0x9d15('0x19')]=_0x394232['callback'];this[_0x9d15('0x1a')]=_0x394232[_0x9d15('0x1a')];this[_0x9d15('0x1b')]=_0x394232[_0x9d15('0x1b')];this['recallme']=_0x394232[_0x9d15('0x1c')];this[_0x9d15('0x1d')]=_0x394232[_0x9d15('0x1d')];this[_0x9d15('0x1e')]=_0x394232[_0x9d15('0x1e')];this[_0x9d15('0x1f')]=_0x394232['UserId'];this['VoiceQueueId']=_0x394232[_0x9d15('0x20')];this[_0x9d15('0x21')]=_0x394232[_0x9d15('0x21')];this[_0x9d15('0x22')]=_0x394232[_0x9d15('0x22')]||'';this[_0x9d15('0x23')]=_0x394232[_0x9d15('0x23')]||'';}module[_0x9d15('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 d6f9f70..5aaf743 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 _0x3d01=['[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','add','dialMachineRetryFrequency','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','TIMEOUT','voiceQueue','additional','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','locked','stateinterface','rrmemory','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','Agent:\x20','contactAgent-idHopper:\x20','unlockRR','[booked][RR][finaly]','stringify','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','reachable','map','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','createdAt','%s%s','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','originate','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','Error','responsetime','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','reason','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','[CatchErlangB]','outboundQueuePauses','check\x20failure','erlangCallToSecond','one\x20call\x20every:','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','uuid','moment','ioredis','../preview/util/util','dialer','../../../config/logger','booked','predictive','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INTERVAL_IS_NULL','[ifTime][Action]','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','erlangCalls','erlangBusyFactor','Trunk','active','md5','format','voice:queue:%s','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','\x22%s\x22\x20<%s>','debug','inspect','stack','error','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','[uniqueid]','clearZombieChannels','actions','[actions]','enqueue','isNil','status','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','resolve','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','SIP/%s','unmonitored','createHistory','amdstatus','exten','value','HANGUP','uniqueid','outboundAnswerAgiCallsDay','membername','AMD','buildObj','amd','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','HangupInAMD','custom:amd'];(function(_0xf3108c,_0x17b335){var _0xc9dd76=function(_0x4b1cbb){while(--_0x4b1cbb){_0xf3108c['push'](_0xf3108c['shift']());}};_0xc9dd76(++_0x17b335);}(_0x3d01,0x128));var _0x13d0=function(_0x9f8611,_0x14a3cb){_0x9f8611=_0x9f8611-0x0;var _0x18695b=_0x3d01[_0x9f8611];return _0x18695b;};'use strict';var util=require(_0x13d0('0x0'));var _=require('lodash');var uuid=require(_0x13d0('0x1'));var moment=require(_0x13d0('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x13d0('0x3'));var ut=require(_0x13d0('0x4'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x13d0('0x5'));var loggerBooked=require(_0x13d0('0x6'))(_0x13d0('0x7'));var loggerPredictive=require(_0x13d0('0x6'))(_0x13d0('0x8'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x13d0('0x6'))(_0x13d0('0x9'));var ami=require('../ami');config[_0x13d0('0xa')]=_[_0x13d0('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x13d0('0xc'))(new Redis(config[_0x13d0('0xa')]));var cmHopper=require(_0x13d0('0xd'));var cmHopperHistory=require(_0x13d0('0xe'));var cmHopperAdditionalPhone=require(_0x13d0('0xf'));var cmHopperBlack=require(_0x13d0('0x10'));var voiceQueueRt=require(_0x13d0('0x11'));var RpcSetting=require(_0x13d0('0x12'));var Action=require(_0x13d0('0x13'));var History=require(_0x13d0('0x14'));var Final=require(_0x13d0('0x15'));var AgentComplete=require(_0x13d0('0x16'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x13d0('0x17')][_0x13d0('0x18')]||_0x13d0('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0x13d0('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x13d0('0x1b')]['enqueue']=function(_0x1ba77c){this[_0x13d0('0x1c')]=this[_0x13d0('0x1c')]?this[_0x13d0('0x1c')][_0x13d0('0x1d')](_0x1ba77c):_0x1ba77c();};function Dialer(_0x22966b,_0x2b061a){this[_0x13d0('0x1e')]=new Sequence();this[_0x13d0('0x1f')]=_0x2b061a;this[_0x13d0('0x20')]=_0x22966b[_0x13d0('0x20')];this[_0x13d0('0x21')]=_0x22966b['campaigns'];this[_0x13d0('0x22')]=_0x22966b[_0x13d0('0x22')];this[_0x13d0('0x23')]=_0x22966b[_0x13d0('0x23')];this['maxNumberOriginate']=config[_0x13d0('0x24')]||0x2;this[_0x13d0('0x25')]={};this['actions']={};this['contactsId']={};this[_0x13d0('0x26')]={};this[_0x13d0('0x27')]={};this[_0x13d0('0x28')]={};this[_0x13d0('0x29')]={};this[_0x13d0('0x2a')]={};this[_0x13d0('0x2b')]={};this[_0x13d0('0x2c')]={};ami['on'](_0x13d0('0x2d'),this['syncAgentConnect'][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x2f'),this[_0x13d0('0x30')][_0x13d0('0x2e')](this));ami['on']('originateresponse',this[_0x13d0('0x31')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x32'),this[_0x13d0('0x33')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x34'),this[_0x13d0('0x9')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x35'),this[_0x13d0('0x36')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x37'),this[_0x13d0('0x38')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x39'),this[_0x13d0('0x3a')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x3b'),this[_0x13d0('0x3c')][_0x13d0('0x2e')](this));ami['on']('queuemember',this[_0x13d0('0x3d')][_0x13d0('0x2e')](this));ami['on'](_0x13d0('0x3e'),this[_0x13d0('0x3f')]['bind'](this));this['loopCampaigns']();this[_0x13d0('0x40')]();RpcSetting[_0x13d0('0x41')]()[_0x13d0('0x42')](function(_0x538bb1){previewRecallmeReminderInterval=_0x538bb1[_0x13d0('0x43')];});}function isNotNull(_0x39b670){return _0x39b670!==null&&!_[_0x13d0('0x44')](_0x39b670);}function checkIsLoggedIn(_0x267dfb,_0x5239dc){return function(){if(_0x5239dc<=0x0){_0x267dfb[_0x13d0('0x45')]=_0x13d0('0x46');throw _0x267dfb['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3c1098){return _0x3c1098;}function checkIsActive(_0x353bd1,_0x30040d){return function(){if(!isActive(_0x30040d)){_0x353bd1[_0x13d0('0x45')]=_0x13d0('0x47');throw _0x353bd1[_0x13d0('0x48')]+_0x13d0('0x49');}};}function checkInterval(_0x4282fd){return function(){if(!isNotNull(_0x4282fd[_0x13d0('0x4a')])){_0x4282fd[_0x13d0('0x45')]='INTERVAL_IS_NULL';throw _0x4282fd['name']+_0x13d0('0x4b');}if(!isNotNull(_0x4282fd['Interval'][_0x13d0('0x4c')])){_0x4282fd['message']='INTERVAL_IS_NULL';throw _0x4282fd[_0x13d0('0x48')]+_0x13d0('0x4b');}if(!isNotNull(_[_0x13d0('0x4d')](_0x4282fd[_0x13d0('0x4a')][_0x13d0('0x4c')]))){_0x4282fd['message']=_0x13d0('0x4e');throw _0x4282fd['name']+_0x13d0('0x4b');}};}function msgResponse(_0x460ff1,_0x36aa20,_0x5a50da){return{'action':_0x460ff1,'response':_0x36aa20,'message':_0x5a50da,'stack':_0x5a50da};}function myreject(_0x3fd74c){return function(_0x45f812){return _0x3fd74c(msgResponse(_0x13d0('0x4f'),'Error',JSON['stringify'](_0x45f812)));};}function getSeconds(_0x2a9347,_0x28c8fc){var _0x2998c9=moment(_0x2a9347)[_0x13d0('0x50')](0x0);var _0x573839=moment(_0x28c8fc)[_0x13d0('0x50')](0x0);return _0x2998c9[_0x13d0('0x51')](_0x573839,_0x13d0('0x52'));}function emit(_0x280d9c,_0x50c2e4,_0x2d4900){io['to'](_0x280d9c)[_0x13d0('0x53')](_0x50c2e4,_0x2d4900);}function emitVoiceQueueSummary(_0x5a2b03){if(_0x5a2b03[_0x13d0('0x54')]===_0x13d0('0x55')){var _0x2622d8={'id':_0x5a2b03['id'],'name':_0x5a2b03[_0x13d0('0x48')],'strategy':_0x5a2b03[_0x13d0('0x56')],'answered':_0x5a2b03[_0x13d0('0x57')],'available':_0x5a2b03[_0x13d0('0x58')],'loggedIn':_0x5a2b03[_0x13d0('0x59')],'pTalking':_0x5a2b03[_0x13d0('0x5a')],'sumBillable':_0x5a2b03[_0x13d0('0x5b')],'sumDuration':_0x5a2b03[_0x13d0('0x5c')],'sumHoldTime':_0x5a2b03[_0x13d0('0x5d')]||0x0,'talking':_0x5a2b03['talking'],'total':_0x5a2b03[_0x13d0('0x5e')],'type':_0x5a2b03[_0x13d0('0x54')],'unmanaged':_0x5a2b03[_0x13d0('0x5f')],'abandoned':_0x5a2b03[_0x13d0('0x60')],'waiting':_0x5a2b03['waiting'],'loggedInDb':_0x5a2b03[_0x13d0('0x61')],'dialActive':_0x5a2b03[_0x13d0('0x62')],'dialMethod':_0x5a2b03[_0x13d0('0x63')],'dialOriginateCallerIdName':_0x5a2b03['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5a2b03[_0x13d0('0x64')],'dialOriginateTimeout':_0x5a2b03[_0x13d0('0x65')],'dialPrefix':_0x5a2b03[_0x13d0('0x66')],'outboundAnswerAgiCallsDay':_0x5a2b03['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5a2b03[_0x13d0('0x67')],'outboundBlacklistCallsDay':_0x5a2b03[_0x13d0('0x68')],'outboundBusyCallsDay':_0x5a2b03['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5a2b03[_0x13d0('0x69')],'outboundDropCallsDayACS':_0x5a2b03[_0x13d0('0x6a')],'outboundDropCallsDayCallersExit':_0x5a2b03[_0x13d0('0x6b')],'outboundDropCallsDayTimeout':_0x5a2b03[_0x13d0('0x6c')],'outboundNoAnswerCallsDay':_0x5a2b03[_0x13d0('0x6d')],'outboundNoSuchCallsDay':_0x5a2b03[_0x13d0('0x6e')],'outboundOriginateFailureCallsDay':_0x5a2b03[_0x13d0('0x6f')],'outboundReCallsDay':_0x5a2b03['outboundReCallsDay'],'outboundRejectCallsDay':_0x5a2b03[_0x13d0('0x70')],'outboundUnknownCallsDay':_0x5a2b03[_0x13d0('0x71')],'predictiveIntervalAnsweredCalls':_0x5a2b03[_0x13d0('0x72')],'predictiveIntervalAvgHoldtime':_0x5a2b03[_0x13d0('0x73')],'predictiveIntervalAvgTalktime':_0x5a2b03[_0x13d0('0x74')],'predictiveIntervalDroppedCallsCallersExit':_0x5a2b03['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5a2b03['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5a2b03[_0x13d0('0x75')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a2b03[_0x13d0('0x76')],'predictiveIntervalHitRate':_0x5a2b03[_0x13d0('0x77')],'predictiveIntervalMultiplicativeFactor':_0x5a2b03[_0x13d0('0x78')],'predictiveIntervalPauses':_0x5a2b03[_0x13d0('0x79')],'predictiveIntervalAvailable':_0x5a2b03['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5a2b03['predictiveIntervalTotalCalls'],'message':_0x5a2b03[_0x13d0('0x45')],'originated':_0x5a2b03['originated'],'erlangCalls':_0x5a2b03[_0x13d0('0x7a')],'erlangCallToSecond':_0x5a2b03['erlangCallToSecond'],'erlangAbandonmentRate':_0x5a2b03['erlangAbandonmentRate'],'erlangBusyFactor':_0x5a2b03[_0x13d0('0x7b')],'startPredictive':_0x5a2b03[_0x13d0('0x28')],'startProgressive':_0x5a2b03[_0x13d0('0x29')]};if(_0x5a2b03[_0x13d0('0x7c')]){_0x2622d8[_0x13d0('0x7c')]={'id':_0x5a2b03[_0x13d0('0x7c')]['id'],'name':_0x5a2b03[_0x13d0('0x7c')][_0x13d0('0x48')],'active':_0x5a2b03[_0x13d0('0x7c')][_0x13d0('0x7d')],'callerid':_0x5a2b03[_0x13d0('0x7c')]['callerid']};}if(_0x5a2b03[_0x13d0('0x4a')]){_0x2622d8[_0x13d0('0x4a')]={'id':_0x5a2b03[_0x13d0('0x4a')]['id'],'name':_0x5a2b03[_0x13d0('0x4a')]['name']};}var _0x219160=md5(JSON['stringify'](_0x2622d8));if(_0x5a2b03[_0x13d0('0x7e')]!==_0x219160){_0x5a2b03[_0x13d0('0x7e')]=_0x219160;emit(util[_0x13d0('0x7f')](_0x13d0('0x80'),_0x2622d8[_0x13d0('0x48')]),'voice_queue:save',_0x2622d8);}}}function emitCampaignSummary(_0x5245f3){if(_0x5245f3['type']==='ivr'){emit(util['format'](_0x13d0('0x81'),_0x5245f3['name']),_0x13d0('0x82'),_0x5245f3);}}function checkGetDataPredictive(_0x4641f8){if(isNotNull(_0x4641f8)&&!_[_0x13d0('0x4d')](_0x4641f8)){loggerPredictive['info'](_0x13d0('0x83'));loggerPredictive[_0x13d0('0x84')](_0x13d0('0x85'),_0x4641f8[_0x13d0('0x86')]);loggerPredictive['info'](_0x13d0('0x87'),_0x4641f8[_0x13d0('0x72')]);loggerPredictive[_0x13d0('0x84')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4641f8[_0x13d0('0x88')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x89'),_0x4641f8[_0x13d0('0x8a')]);loggerPredictive['info'](_0x13d0('0x8b'),_0x4641f8[_0x13d0('0x73')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x8c'),_0x4641f8[_0x13d0('0x74')]);loggerPredictive['info']('---------------------------');if(_0x4641f8['predictiveIntervalTotalCalls']>0x0){if(!_[_0x13d0('0x44')](_0x4641f8[_0x13d0('0x74')])&&_0x4641f8['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x13d0('0x84')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x4641f8[_0x13d0('0x73')])&&_0x4641f8[_0x13d0('0x73')]>0x0){return!![];}loggerPredictive[_0x13d0('0x84')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x13d0('0x8d'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x28e930){return function(_0x3451bb){loggerPredictive[_0x13d0('0x84')](_0x13d0('0x8e'));loggerPredictive[_0x13d0('0x84')](_0x13d0('0x8f'),_0x3451bb[_0x13d0('0x7a')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x90'),_0x3451bb['erlangCallToSecond']);loggerPredictive['info'](_0x13d0('0x91'),_0x3451bb[_0x13d0('0x92')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x93'),_0x3451bb[_0x13d0('0x7b')]);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x91'),_0x3451bb[_0x13d0('0x92')]);loggerPredictive['info'](_0x13d0('0x94'));_[_0x13d0('0x95')](_0x28e930,_0x3451bb);};}function getDiff(_0x528fdc){var _0x2be806=moment()['milliseconds'](0x0);var _0xef733=moment(_0x528fdc)[_0x13d0('0x50')](0x0);return _0x2be806[_0x13d0('0x51')](_0xef733,_0x13d0('0x52'));}function ifInterval(_0x4e636e,_0x3f624e){if(_['isUndefined'](_0x3f624e)){return![];}return getDiff(_0x3f624e)<_0x4e636e*0x3c;}function freeVariablesPredictive(_0x312f46){if(isNotNull(_0x312f46)){if(!_[_0x13d0('0x44')](_0x312f46[_0x13d0('0x29')])){_0x312f46['startProgressive']=undefined;loggerPredictive['info'](_0x312f46['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x13d0('0x44')](_0x312f46[_0x13d0('0x28')])){_0x312f46[_0x13d0('0x28')]=undefined;loggerPredictive[_0x13d0('0x84')](_0x312f46[_0x13d0('0x48')],_0x13d0('0x96'));}if(!_['isUndefined'](_0x312f46[_0x13d0('0x97')])){clearInterval(_0x312f46[_0x13d0('0x97')]);_0x312f46[_0x13d0('0x97')]=undefined;loggerPredictive['info'](_0x312f46[_0x13d0('0x48')],_0x13d0('0x98'));}}}function erlangb(_0x4f1e81,_0x1d963d){if(_0x1d963d===0x0){return 0x0;}var _0x672724=0x1;for(var _0x13c4ca=0x1;_0x13c4ca<=_0x1d963d;_0x13c4ca+=0x1){_0x672724=0x1+_0x672724*_0x13c4ca/_0x4f1e81;}return 0x1/_0x672724;}function isVoiceQueueOutbound(_0x590657){return _0x590657===_0x13d0('0x55');}function isNotPreview(_0x1825a2){return _0x1825a2!==_0x13d0('0x1f');}function isCampaignIvr(_0x426ee1){return _0x426ee1===_0x13d0('0x99');}function getCallerId(_0x389993,_0x4ac689,_0x248aeb){if(!_['isUndefined'](_0x248aeb)&&typeof _0x248aeb==='string'&&!_[_0x13d0('0x4d')](_0x248aeb)){if(!_[_0x13d0('0x44')](_0x4ac689)&&typeof _0x4ac689==='string'&&!_[_0x13d0('0x4d')](_0x4ac689)){return util['format'](_0x13d0('0x9a'),_0x4ac689,_0x248aeb);}return util[_0x13d0('0x7f')](_0x13d0('0x9a'),_0x248aeb,_0x248aeb);}if(!_[_0x13d0('0x44')](_0x389993)&&typeof _0x389993==='string'&&!_[_0x13d0('0x4d')](_0x389993)){return _0x389993;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x87ef14,_0x34fa17){return function(_0x13a5b8){freeVariablesPredictive(_0x34fa17);emitVoiceQueueSummary(_0x34fa17);emitCampaignSummary(_0x34fa17);loggerSyncQueueSummary[_0x13d0('0x9b')](_0x87ef14,util[_0x13d0('0x9c')](_0x13a5b8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3507a6,_0x3aed52){return function(_0x3f1afd){loggerPredictive['error'](_0x3aed52['name'],_0x3507a6);loggerPredictive['error'](_0x3f1afd[_0x13d0('0x9d')]);freeVariablesPredictive(_0x3aed52);};}function loggerCatch(_0x40beee){return function(_0x4d167c){logger[_0x13d0('0x9e')](_0x40beee,util[_0x13d0('0x9c')](_0x4d167c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1ee509){return _0x1ee509&&!_[_0x13d0('0x44')](_0x1ee509)&&_0x1ee509[_0x13d0('0x9f')]>0x0;}function decremetOriginate(_0x4cfb03){if(!_[_0x13d0('0x44')](_0x4cfb03)&&_0x4cfb03!==null){if(typeof _0x4cfb03[_0x13d0('0xa0')]!==_0x13d0('0xa1')){if(_0x4cfb03[_0x13d0('0xa0')]>0x0){_0x4cfb03['originated']-=0x1;}else{logger[_0x13d0('0x9e')](_0x13d0('0xa2'));}}}else{logger[_0x13d0('0x9e')](_0x13d0('0xa3'));}}function checkContactLowerLimitOriginate(_0x461dfd,_0x2f4e2d,_0xf304f){if(_0x2f4e2d>_0xf304f){for(var _0x503987=0x0;_0x503987<_0x2f4e2d-_0xf304f;_0x503987+=0x1){decremetOriginate(_0x461dfd);}}}function loggerGetContactDialer(_0x27f147,_0x3e547c,_0x351989){return function(_0xcecc4c){checkContactLowerLimitOriginate(_0x3e547c,_0x351989,0x0);logger['error'](_0x27f147,util[_0x13d0('0x9c')](_0xcecc4c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x526c40){return function(_0x1011eb){if(isNotNull(_0x1011eb)&&isNotNull(_0x1011eb[0x0])){if(_0x1011eb[0x0][_0x13d0('0xa4')]>0x0){_0x526c40['message']=_0x13d0('0xa5');logger['info'](_0x13d0('0xa6')+_0x526c40[_0x13d0('0x48')],_0x1011eb[0x0][_0x13d0('0xa4')],'contacts');}else{_0x526c40['message']=_0x13d0('0xa7');logger[_0x13d0('0x84')](_0x13d0('0xa8')+_0x526c40['name']);}}};}function notSendMessagesQueue(_0x51eec9){if(_0x51eec9[_0x13d0('0xa9')]){freeVariablesPredictive(_0x51eec9);if(_0x51eec9[_0x13d0('0xa0')]===0x0&&_0x51eec9[_0x13d0('0xaa')]===0x0&&_0x51eec9[_0x13d0('0xab')]===0x0&&(_0x51eec9[_0x13d0('0x5a')]||0x0)===0x0){_0x51eec9[_0x13d0('0xa9')]=![];_0x51eec9[_0x13d0('0x58')]=0x0;_0x51eec9['message']=_0x13d0('0x47');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xac'),_0x51eec9['name'],_0x13d0('0xad'));}else{_0x51eec9['message']=_0x13d0('0xae');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xac'),_0x51eec9[_0x13d0('0x48')],_0x13d0('0xaf'));}emitVoiceQueueSummary(_0x51eec9);}}function notSendMessagesCampaign(_0x4f515f){if(_0x4f515f[_0x13d0('0xa9')]){if(_0x4f515f[_0x13d0('0xa0')]===0x0){_0x4f515f[_0x13d0('0xa9')]=![];_0x4f515f[_0x13d0('0x45')]=_0x13d0('0x47');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xb0'),_0x4f515f['name'],_0x13d0('0xad'));}else{_0x4f515f['message']=_0x13d0('0xae');loggerSyncQueueSummary[_0x13d0('0x9b')](_0x13d0('0xb0'),_0x4f515f[_0x13d0('0x48')],_0x13d0('0xaf'));}emitCampaignSummary(_0x4f515f);}}function createObjHistory(_0x3685d9,_0x468f8d,_0x3776fe,_0x81faeb,_0x5bb142){_0x3685d9[_0x13d0('0x45')]=_0x3776fe;var _0x3143f1=new Action(_0x3685d9,_0x468f8d);var _0x3159ab=new History(_0x3143f1);_0x3159ab[_0x13d0('0xb1')]=_0x81faeb;_0x3159ab[_0x13d0('0xb2')]=_0x5bb142;_0x3159ab['endtime']=_0x3143f1[_0x13d0('0xb3')];return _0x3159ab;}Dialer['prototype'][_0x13d0('0x40')]=function(){var _0x32071c=this;setInterval(function(){_0x32071c['clearZombieChannels'](_0x32071c[_0x13d0('0x26')],_0x13d0('0xb4'));_0x32071c[_0x13d0('0xb5')](_0x32071c[_0x13d0('0xb6')],_0x13d0('0xb7'));},0x32c8);};Dialer[_0x13d0('0x1b')][_0x13d0('0xb5')]=function(_0x5ab305,_0x2c301a){var _0x52c7be=this;for(var _0x460558 in _0x5ab305){if(typeof _0x5ab305[_0x460558]!==_0x13d0('0xa1')){this['sequence'][_0x13d0('0xb8')](function(){if(!_[_0x13d0('0xb9')](_0x5ab305[_0x460558])){return ami['Action']({'action':_0x13d0('0xba'),'channel':_0x5ab305[_0x460558][_0x13d0('0xbb')]})['catch'](function(_0x3bad04){if(_0x3bad04[_0x13d0('0x45')]===_0x13d0('0xbc')){setTimeout(function(){if(_0x5ab305[_0x460558]&&_0x5ab305[_0x460558][_0x13d0('0x54')]!==_0x13d0('0x99')){_0x52c7be['updateOriginated'](_0x52c7be[_0x13d0('0x20')][_0x5ab305[_0x460558][_0x13d0('0xbd')]]);logger[_0x13d0('0x9e')](_0x13d0('0xbe'),_0x2c301a,_0x460558,_0x5ab305[_0x460558][_0x13d0('0xbd')]);delete _0x5ab305[_0x460558];}if(_0x5ab305[_0x460558]&&_0x5ab305[_0x460558][_0x13d0('0x54')]===_0x13d0('0x99')){_0x52c7be[_0x13d0('0xbf')](_0x52c7be[_0x13d0('0x21')][_0x5ab305[_0x460558][_0x13d0('0xbd')]]);logger[_0x13d0('0x9e')](_0x13d0('0xc0'),_0x2c301a,_0x460558,_0x5ab305[_0x460558][_0x13d0('0xbd')]);delete _0x5ab305[_0x460558];}},0x2328);}});}});}}};Dialer[_0x13d0('0x1b')]['countReScheduled']=function(_0x211940){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopper[_0x13d0('0xc2')](_0x211940))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xc4')));};Dialer['prototype'][_0x13d0('0xc5')]=function(_0x49d02f){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperBlack['checkIsBlackList'](_0x49d02f))['catch'](loggerCatch(_0x13d0('0xc6')));};Dialer['prototype']['verifyAdditionalPhones']=function(_0x1b7c4d,_0x3a7b93,_0x19fd0b){return Promise[_0x13d0('0xc1')]()['then'](cmHopperAdditionalPhone[_0x13d0('0xc7')](_0x1b7c4d,_0x3a7b93,_0x19fd0b))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xc8')));};Dialer[_0x13d0('0x1b')]['swapAdditionalPhones']=function(_0x117678,_0x2dd6c2,_0x2c977a){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperAdditionalPhone[_0x13d0('0xc9')](_0x117678,_0x2dd6c2,_0x2c977a))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xca')));};Dialer[_0x13d0('0x1b')][_0x13d0('0xcb')]=function(_0x188709){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperBlack['checkIsBlackListIvr'](_0x188709))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xcc')));};Dialer['prototype'][_0x13d0('0xcd')]=function(_0x21006f){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperHistory[_0x13d0('0xce')](_0x21006f))['catch'](loggerCatch(_0x13d0('0xcf')));};Dialer[_0x13d0('0x1b')][_0x13d0('0xd0')]=function(_0xa32f8f){return Promise['resolve']()[_0x13d0('0x42')](cmHopper[_0x13d0('0xd0')](_0xa32f8f))[_0x13d0('0xc3')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x13d0('0xd1')]=function(_0x1385fe,_0x30d4e0,_0x57db17){return Promise[_0x13d0('0xc1')]()['then'](cmHopper[_0x13d0('0xd1')](_0x1385fe,_0x30d4e0,_0x57db17))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xd2')));};Dialer[_0x13d0('0x1b')][_0x13d0('0xd3')]=function(_0x5c608c,_0x644dc,_0x2aaf24,_0x233efc,_0x2bc2cc){return Promise['resolve']()[_0x13d0('0x42')](cmHopper[_0x13d0('0xd3')](_0x5c608c,_0x644dc,_0x2aaf24,_0x233efc))[_0x13d0('0xc3')](function(_0x452ab9){_0x2bc2cc[_0x13d0('0xd4')]-=_0x2aaf24;_0x2bc2cc[_0x13d0('0xd4')]=_0x2bc2cc[_0x13d0('0xd4')]>0x0?_0x2bc2cc[_0x13d0('0xd4')]:0x0;loggerCatch(_0x13d0('0xd5'))(_0x452ab9);});};Dialer[_0x13d0('0x1b')][_0x13d0('0xd6')]=function(_0x2873bd,_0x5507bb,_0x1ca352,_0x39c174){return Promise[_0x13d0('0xc1')]()['then'](cmHopper['getContactDialerIvr'](_0x2873bd,_0x5507bb,_0x1ca352))[_0x13d0('0xc3')](function(_0x4db323){_0x39c174['temp']-=_0x5507bb;_0x39c174[_0x13d0('0xd4')]=_0x39c174[_0x13d0('0xd4')]>0x0?_0x39c174[_0x13d0('0xd4')]:0x0;loggerCatch(_0x13d0('0xd7'))(_0x4db323);});};Dialer['prototype'][_0x13d0('0xd8')]=function(_0x41a164){return Promise['resolve']()[_0x13d0('0x42')](voiceQueueRt['getVoiceQueueRtPauses'](_0x41a164))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xd9')));};Dialer['prototype'][_0x13d0('0xda')]=function(_0x5a6a05){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopper[_0x13d0('0xda')](_0x5a6a05))[_0x13d0('0xc3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x13d0('0x1b')]['createHistory']=function(_0xdef186){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopperHistory['createHistory'](_0xdef186))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xdb')));};Dialer[_0x13d0('0x1b')]['updateOriginated']=function(_0x412307){if(!_[_0x13d0('0x44')](_0x412307)&&_0x412307!==null){if(typeof _0x412307[_0x13d0('0xa0')]!==_0x13d0('0xa1')){if(_0x412307[_0x13d0('0xa0')]>0x0){_0x412307[_0x13d0('0xa0')]-=0x1;}else{logger[_0x13d0('0x9e')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x13d0('0xdc'));}};Dialer[_0x13d0('0x1b')][_0x13d0('0xdd')]=function(_0x2ff38b,_0x4480be){var _0x3fd591=this;return function(_0x575745){_0x3fd591['updateOriginated'](_0x4480be);logger[_0x13d0('0x9e')](_0x2ff38b,util[_0x13d0('0x9c')](_0x575745,{'showHidden':![],'depth':null}));};};Dialer[_0x13d0('0x1b')][_0x13d0('0xde')]=function(_0x46ed44,_0x1ea178,_0x25bde2){var _0x56b233={'state':0x19,'statedesc':_0x13d0('0xdf')};this[_0x13d0('0xbf')](_0x1ea178);this[_0x13d0('0xe0')](_[_0x13d0('0x95')](_0x56b233,_[_0x13d0('0xe1')](_0x25bde2,[_0x13d0('0xe2'),'ListId',_0x13d0('0xe3'),_0x13d0('0xe4'),_0x13d0('0xe5')])),_0x13d0('0xe6'),_0x13d0('0xe7'));logger['error'](_0x46ed44);};Dialer['prototype']['isSuccess']=function(_0x2763ba){return _0x2763ba===_0x13d0('0xe8');};Dialer['prototype']['isTrunkReachable']=function(_0x5eacf1){return!_['isUndefined'](_0x5eacf1)&&_0x5eacf1&&!_[_0x13d0('0x44')](_0x5eacf1[_0x13d0('0x48')])&&!_[_0x13d0('0x44')](_0x5eacf1[_0x13d0('0x7d')])&&_0x5eacf1[_0x13d0('0x7d')]&&(this[_0x13d0('0x23')][util[_0x13d0('0x7f')](_0x13d0('0xe9'),_0x5eacf1[_0x13d0('0x48')])][_0x13d0('0xba')]==='reachable'||this[_0x13d0('0x23')][util[_0x13d0('0x7f')](_0x13d0('0xe9'),_0x5eacf1[_0x13d0('0x48')])]['status']===_0x13d0('0xea'));};Dialer[_0x13d0('0x1b')]['saveInDb']=function(_0x4d0311,_0x5df6f4,_0x35e26c){this[_0x13d0('0xeb')](_0x4d0311)[_0x13d0('0xc3')](loggerCatch(_0x5df6f4));this[_0x13d0('0xda')](_0x4d0311)[_0x13d0('0xc3')](loggerCatch(_0x35e26c));};Dialer[_0x13d0('0x1b')][_0x13d0('0x3c')]=function(_0x33c511){var _0x23ca49=this;var _0x304389=this[_0x13d0('0x26')][_0x33c511['uniqueid']];var _0x5b9feb;if(!_[_0x13d0('0xb9')](_0x33c511)&&!_['isNil'](_0x33c511['variable'])&&!_[_0x13d0('0xb9')](_0x33c511['variable'][_0x13d0('0xec')])&&_0x33c511[_0x13d0('0xed')]==='xcally-motion-dialer'&&_0x304389){if(_0x304389['type']!==_0x13d0('0x99')&&this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]]['dialAMDActive']&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xef')){delete this['uniqueId'][_0x33c511[_0x13d0('0xf0')]];this['updateOriginated'](this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]]);this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0x67')]+=0x1;this[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf1')]+=0x1;_0x5b9feb=new Hangup(_0x304389,_0x33c511);_0x5b9feb[_0x13d0('0xb1')]=0x12;_0x5b9feb['statedesc']='HangupInAMD';_0x5b9feb[_0x13d0('0xf2')]=_0x13d0('0xf3');ami[_0x13d0('0x53')]('custom:amd',ut[_0x13d0('0xf4')](_0x5b9feb,_0x13d0('0xf5')));this['saveInDb'](_0x5b9feb,'[syncHangupInAMD][createHistory]',_0x13d0('0xf6'));}if(_0x304389[_0x13d0('0x54')]!==_0x13d0('0x99')&&this['voiceQueues'][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf7')]&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xf8')){return new Promise(function(_0x4aef4f,_0xebc040){delete _0x23ca49[_0x13d0('0x26')][_0x33c511['uniqueid']];_0x23ca49['updateOriginated'](_0x23ca49['voiceQueues'][_0x304389[_0x13d0('0xbd')]]);_0x23ca49[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0x67')]+=0x1;_0x23ca49[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xef91a2=_0x23ca49[_0x13d0('0x20')][_0x304389[_0x13d0('0xbd')]];var _0x78ea1c=new Hangup(_0x304389,_0x33c511);_0x78ea1c[_0x13d0('0xb1')]=0x13;_0x78ea1c['statedesc']=_0x13d0('0xf9');_0x78ea1c['membername']=_0x13d0('0xf3');_0x78ea1c['countmachineretry']+=0x1;_0x78ea1c[_0x13d0('0xfa')]+=0x1;_0x78ea1c['amd']=!![];ami[_0x13d0('0x53')]('custom:amd',ut[_0x13d0('0xf4')](_0x78ea1c,'amd'));_0x23ca49[_0x13d0('0xeb')](_0x78ea1c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xfb')));if(_0x78ea1c[_0x13d0('0xfc')]+_0x78ea1c[_0x13d0('0xfd')]+_0x78ea1c[_0x13d0('0xfe')]+_0x78ea1c[_0x13d0('0xff')]+_0x78ea1c[_0x13d0('0x100')]+_0x78ea1c[_0x13d0('0x101')]+_0x78ea1c[_0x13d0('0x102')]+_0x78ea1c[_0x13d0('0x103')]>=_0xef91a2['dialGlobalMaxRetry']){_0x23ca49[_0x13d0('0x104')](_0x78ea1c,_0x4aef4f,_0xebc040,_0x13d0('0x105'));}else{if(_0x78ea1c[_0x13d0('0x102')]>=_0xef91a2[_0x13d0('0x106')]){_0x23ca49[_0x13d0('0x107')](_0x78ea1c,_0x4aef4f,_0xebc040,_0x13d0('0x108'));}else{_0x23ca49[_0x13d0('0xd0')]({'active':![],'countmachineretry':_0x78ea1c[_0x13d0('0x102')],'scheduledat':moment()['add'](_0xef91a2['dialMachineRetryFrequency'],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x78ea1c[_0x13d0('0xe2')],'ListId':_0x78ea1c[_0x13d0('0x10b')],'VoiceQueueId':_0x78ea1c[_0x13d0('0xe4')]||undefined,'CampaignId':_0x78ea1c['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x10c')));_0x4aef4f({'reschedule':0x1});}}});}if(_0x304389[_0x13d0('0x54')]==='ivr'&&this['campaigns'][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf7')]&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xef')){delete this['uniqueId'][_0x33c511['uniqueid']];this[_0x13d0('0xbf')](this[_0x13d0('0x21')][_0x304389['queue']]);_0x5b9feb=new Hangup(_0x304389,_0x33c511);_0x5b9feb[_0x13d0('0xb1')]=0x12;_0x5b9feb[_0x13d0('0xb2')]=_0x13d0('0x10d');_0x5b9feb[_0x13d0('0xf2')]=_0x13d0('0xf3');ami[_0x13d0('0x53')](_0x13d0('0x10e'),ut[_0x13d0('0xf4')](_0x5b9feb,_0x13d0('0xf5')));this[_0x13d0('0xe0')](_0x5b9feb,_0x13d0('0x10f'),_0x13d0('0x110'));}if(_0x304389[_0x13d0('0x54')]===_0x13d0('0x99')&&this[_0x13d0('0x21')][_0x304389[_0x13d0('0xbd')]][_0x13d0('0xf7')]&&_0x33c511[_0x13d0('0xee')]===_0x13d0('0xf8')){return new Promise(function(_0x1f59e0,_0x837b18){delete _0x23ca49[_0x13d0('0x26')][_0x33c511['uniqueid']];_0x23ca49[_0x13d0('0xbf')](_0x23ca49[_0x13d0('0x21')][_0x304389[_0x13d0('0xbd')]]);_0x23ca49['campaigns'][_0x304389['queue']][_0x13d0('0x67')]+=0x1;_0x23ca49[_0x13d0('0x21')][_0x304389[_0x13d0('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xf3405f=_0x23ca49[_0x13d0('0x21')][_0x304389['queue']];var _0x21109a=new Hangup(_0x304389,_0x33c511);_0x21109a['state']=0x13;_0x21109a[_0x13d0('0xb2')]=_0x13d0('0xf9');_0x21109a[_0x13d0('0xf2')]=_0x13d0('0xf3');_0x21109a[_0x13d0('0x102')]+=0x1;_0x21109a[_0x13d0('0xfa')]+=0x1;_0x21109a[_0x13d0('0xf5')]=!![];ami[_0x13d0('0x53')](_0x13d0('0x10e'),ut[_0x13d0('0xf4')](_0x21109a,_0x13d0('0xf5')));_0x23ca49['createHistory'](_0x21109a)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xfb')));if(_0x21109a[_0x13d0('0xfc')]+_0x21109a[_0x13d0('0xfd')]+_0x21109a[_0x13d0('0xfe')]+_0x21109a[_0x13d0('0xff')]+_0x21109a['countdropretry']+_0x21109a['countabandonedretry']+_0x21109a[_0x13d0('0x102')]+_0x21109a[_0x13d0('0x103')]>=_0xf3405f['dialGlobalMaxRetry']){_0x23ca49[_0x13d0('0x104')](_0x21109a,_0x1f59e0,_0x837b18,_0x13d0('0x105'));}else{if(_0x21109a[_0x13d0('0x102')]>=_0xf3405f['dialMachineMaxRetry']){_0x23ca49[_0x13d0('0x107')](_0x21109a,_0x1f59e0,_0x837b18,_0x13d0('0x108'));}else{_0x23ca49[_0x13d0('0xd0')]({'active':![],'countmachineretry':_0x21109a['countmachineretry'],'scheduledat':moment()[_0x13d0('0x111')](_0xf3405f[_0x13d0('0x112')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x21109a['ContactId'],'ListId':_0x21109a['ListId'],'VoiceQueueId':_0x21109a[_0x13d0('0xe4')]||undefined,'CampaignId':_0x21109a[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x10c')));_0x1f59e0({'reschedule':0x1});}}});}}};Dialer[_0x13d0('0x1b')][_0x13d0('0x38')]=function(_0x5e5a82){var _0x3aaf52=this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];var _0x57d86c;if(_0x3aaf52&&_0x3aaf52['type']===_0x13d0('0x99')){delete this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this[_0x13d0('0x21')][_0x3aaf52[_0x13d0('0xbd')]]);this[_0x13d0('0x21')][_0x3aaf52[_0x13d0('0xbd')]]['ivrAnswerCallsDay']+=0x1;_0x57d86c=new Hangup(_0x3aaf52,_0x5e5a82);this[_0x13d0('0xeb')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x113')));this[_0x13d0('0xda')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x114')));}if(_0x3aaf52&&_0x3aaf52[_0x13d0('0x54')]!==_0x13d0('0x99')&&isNotNull(this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]][_0x13d0('0x115')])){delete this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this['voiceQueues'][_0x3aaf52[_0x13d0('0xbd')]]);this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]][_0x13d0('0x67')]+=0x1;this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;_0x57d86c=new Hangup(_0x3aaf52,_0x5e5a82);_0x57d86c['state']=0x10;_0x57d86c[_0x13d0('0xb2')]=_0x13d0('0x116');_0x57d86c[_0x13d0('0xf2')]='AGI';this[_0x13d0('0xeb')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x113')));this[_0x13d0('0xda')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch('[syncHangupIvr]'));}if(_0x3aaf52&&_0x3aaf52[_0x13d0('0x54')]!==_0x13d0('0x99')&&!isNotNull(this[_0x13d0('0x20')][_0x3aaf52['queue']]['dialQueueProject'])){delete this[_0x13d0('0x26')][_0x5e5a82[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this['voiceQueues'][_0x3aaf52[_0x13d0('0xbd')]]);this[_0x13d0('0x20')][_0x3aaf52[_0x13d0('0xbd')]][_0x13d0('0x71')]+=0x1;_0x57d86c=new Hangup(_0x3aaf52,_0x5e5a82);_0x57d86c[_0x13d0('0xb1')]=0xc;_0x57d86c[_0x13d0('0xb2')]=_0x5e5a82[_0x13d0('0x117')];_0x57d86c['membername']=_0x13d0('0x118');this[_0x13d0('0xeb')](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x113')));this['moveContactManagedDialer'](_0x57d86c)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x114')));}};Dialer[_0x13d0('0x1b')]['syncAgentComplete']=function(_0x506e66){var _0x138150=this[_0x13d0('0x26')][_0x506e66[_0x13d0('0xf0')]];if(this[_0x13d0('0x20')][_0x506e66[_0x13d0('0xbd')]]){if(_0x138150&&_0x138150['type']!==_0x13d0('0x99')){delete this[_0x13d0('0x26')][_0x506e66['uniqueid']];this[_0x13d0('0x20')][_0x506e66['queue']][_0x13d0('0x67')]+=0x1;var _0x18817e=new AgentComplete(_0x138150,_0x506e66);if(_0x506e66['reason']==='agent'){_0x18817e[_0x13d0('0x119')]=this[_0x13d0('0x20')][_0x506e66[_0x13d0('0xbd')]][_0x13d0('0x11a')]&&this['voiceQueues'][_0x506e66[_0x13d0('0xbd')]][_0x13d0('0x11b')]?moment()[_0x13d0('0x7f')](_0x13d0('0x10a')):undefined;}this[_0x13d0('0xeb')](_0x18817e)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x11c')));this[_0x13d0('0xda')](_0x18817e)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x13d0('0x1b')][_0x13d0('0x11d')]=function(_0x423417){if(this[_0x13d0('0x20')][_0x423417[_0x13d0('0xbd')]]){if(this['uniqueId'][_0x423417[_0x13d0('0xf0')]]&&this[_0x13d0('0x26')][_0x423417[_0x13d0('0xf0')]][_0x13d0('0x54')]!=='ivr'){this[_0x13d0('0xbf')](this[_0x13d0('0x20')][_0x423417[_0x13d0('0xbd')]]);this[_0x13d0('0x26')][_0x423417[_0x13d0('0xf0')]][_0x13d0('0x11e')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));}}};Dialer[_0x13d0('0x1b')][_0x13d0('0x11f')]=function(_0x161f24,_0x5edc36){this['createHistory'](_0x161f24)['catch'](loggerCatch(_0x13d0('0x11c')));if(_0x5edc36==0x0){this[_0x13d0('0xda')](_0x161f24)['catch'](loggerCatch(_0x13d0('0x120')));}};Dialer['prototype'][_0x13d0('0x30')]=function(_0x7307e1){var _0x15f0c3=this[_0x13d0('0x26')][_0x7307e1[_0x13d0('0xf0')]];var _0x3ce5de=this;var _0x504040=![];var _0x2f44a0;var _0x5d942a;if(this['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]){if(_0x15f0c3&&_0x15f0c3[_0x13d0('0x54')]!==_0x13d0('0x99')){delete this[_0x13d0('0x26')][_0x7307e1[_0x13d0('0xf0')]];this[_0x13d0('0xbf')](this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]]);_0x15f0c3[_0x13d0('0x121')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));var _0x44ec82=new QueueCallerAbandon(_0x15f0c3,_0x7307e1);if(getSeconds(_0x15f0c3[_0x13d0('0x121')],_0x15f0c3['responsetime'])>=_0x15f0c3[_0x13d0('0x122')]){this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x88')]+=0x1;this[_0x13d0('0x20')][_0x7307e1['queue']][_0x13d0('0x6c')]+=0x1;this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x76')]+=0x1;_0x44ec82[_0x13d0('0xb1')]=0xa;_0x44ec82['statedesc']='Drop';_0x44ec82['dropreason']=_0x13d0('0x123');_0x44ec82[_0x13d0('0x119')]=this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x11a')]?moment()[_0x13d0('0x7f')](_0x13d0('0x10a')):undefined;_0x44ec82['countdropretry']+=0x1;_0x44ec82['countglobal']+=0x1;_0x2f44a0=this[_0x13d0('0x20')][_0x7307e1['queue']]['dialDropRetryFrequency'];_0x5d942a=this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]]['callAdditionalPhoneAfterMin'];_0x3ce5de[_0x13d0('0xc7')](_0x44ec82,_0x44ec82[_0x13d0('0xb1')],_0x15f0c3[_0x13d0('0x124')])[_0x13d0('0x42')](function(_0x2c2ef9){_0x504040=_0x2c2ef9['additional']==0x1;if(_0x44ec82['countdropretry']>=_0x3ce5de['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]['dialDropMaxRetry']){_0x3ce5de[_0x13d0('0x11f')](_0x44ec82,_0x2c2ef9[_0x13d0('0x125')]);}else{_0x3ce5de[_0x13d0('0xd0')]({'active':![],'countdropretry':_0x44ec82[_0x13d0('0x100')],'scheduledat':moment()[_0x13d0('0x111')](_0x3ce5de['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x126')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x15f0c3[_0x13d0('0xe2')],'ListId':_0x15f0c3['ListId'],'VoiceQueueId':_0x15f0c3[_0x13d0('0xe4')]||undefined,'CampaignId':_0x15f0c3[_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x127')));var _0x25d5dc=new History(_0x44ec82);_0x25d5dc[_0x13d0('0xb1')]=0xa;_0x25d5dc[_0x13d0('0xb2')]='Drop';_0x25d5dc[_0x13d0('0xb3')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));_0x25d5dc[_0x13d0('0x128')]=_0x25d5dc['starttime'];_0x25d5dc[_0x13d0('0x129')]=_0x44ec82['calleridname'];_0x25d5dc[_0x13d0('0x12a')]=_0x44ec82[_0x13d0('0x12a')];_0x3ce5de['createHistory'](_0x25d5dc)['catch'](loggerCatch(_0x13d0('0x12b')));}})[_0x13d0('0x42')](function(){if(_0x504040)_0x3ce5de['swapAdditionalPhones'](_0x44ec82,_0x2f44a0,_0x5d942a)[_0x13d0('0x42')](function(){return 0x1;});});}else{this['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x13d0('0x20')][_0x7307e1['queue']][_0x13d0('0x6b')]+=0x1;_0x44ec82[_0x13d0('0xb1')]=0xb;_0x44ec82[_0x13d0('0xb2')]=_0x13d0('0x12c');_0x44ec82[_0x13d0('0x12d')]=_0x13d0('0x12e');_0x44ec82[_0x13d0('0x101')]+=0x1;_0x44ec82['countglobal']+=0x1;_0x2f44a0=this['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]]['dialAbandonedRetryFrequency'];_0x5d942a=this[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x12f')];_0x3ce5de[_0x13d0('0xc7')](_0x44ec82,_0x44ec82[_0x13d0('0xb1')],_0x15f0c3[_0x13d0('0x124')])['then'](function(_0x53e014){if(_0x44ec82[_0x13d0('0x101')]>=_0x3ce5de['voiceQueues'][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x130')]){_0x3ce5de[_0x13d0('0x11f')](_0x44ec82,_0x53e014[_0x13d0('0x125')]);}else{_0x3ce5de['rescheduleContact']({'active':![],'countabandonedretry':_0x44ec82[_0x13d0('0x101')],'scheduledat':moment()['add'](_0x3ce5de[_0x13d0('0x20')][_0x7307e1[_0x13d0('0xbd')]][_0x13d0('0x131')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x15f0c3['ContactId'],'ListId':_0x15f0c3[_0x13d0('0x10b')],'VoiceQueueId':_0x15f0c3[_0x13d0('0xe4')]||undefined,'CampaignId':_0x15f0c3[_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x132')));var _0x3b162e=new History(_0x44ec82);_0x3b162e[_0x13d0('0xb1')]=0xb;_0x3b162e['statedesc']=_0x13d0('0x12c');_0x3b162e[_0x13d0('0xb3')]=moment()[_0x13d0('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b162e['endtime']=_0x3b162e[_0x13d0('0xb3')];_0x3b162e['calleridname']=_0x44ec82['calleridname'];_0x3b162e[_0x13d0('0x12a')]=_0x44ec82[_0x13d0('0x12a')];_0x3ce5de['createHistory'](_0x3b162e)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x133')));}})[_0x13d0('0x42')](function(){if(_0x504040)_0x3ce5de[_0x13d0('0xc9')](_0x44ec82,_0x2f44a0,_0x5d942a)[_0x13d0('0x42')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0xec184a){if(this[_0x13d0('0xb6')][_0xec184a[_0x13d0('0xf0')]]){this[_0x13d0('0xb6')][_0xec184a[_0x13d0('0xf0')]][_0x13d0('0xbb')]=_0xec184a[_0x13d0('0xbb')];}if(this[_0x13d0('0x26')][_0xec184a[_0x13d0('0xf0')]]){this[_0x13d0('0x26')][_0xec184a[_0x13d0('0xf0')]]['channel']=_0xec184a[_0x13d0('0xbb')];}};Dialer[_0x13d0('0x1b')][_0x13d0('0x3d')]=function(_0x1dfd1c){if(strategy[this['voiceQueues'][this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0xbd')]][_0x13d0('0x56')]]===_0x13d0('0x1a')){if(this['actions'][_0x1dfd1c['actionid']]&&_[_0x13d0('0xb9')](this['actions'][_0x1dfd1c[_0x13d0('0x134')]]['locked'])&&_0x1dfd1c[_0x13d0('0xba')]==='1'&&_0x1dfd1c[_0x13d0('0x135')]==='0'){if(this[_0x13d0('0x22')][_0x1dfd1c['stateinterface']]){if(!this['agents'][_0x1dfd1c['stateinterface']][_0x13d0('0x136')]){this[_0x13d0('0x22')][_0x1dfd1c[_0x13d0('0x137')]][_0x13d0('0x136')]=!![];this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0x136')]=!![];this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0x137')]=_0x1dfd1c[_0x13d0('0x137')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0xbd')]]['strategy']]||'rrmemory')===_0x13d0('0x138')){if(this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]]){if(this[_0x13d0('0x22')][_0x1dfd1c[_0x13d0('0x137')]]){this['actions'][_0x1dfd1c[_0x13d0('0x134')]][_0x13d0('0x137')]=_0x1dfd1c[_0x13d0('0x137')];if(_[_0x13d0('0xb9')](this['queueBooked'][this['actions'][_0x1dfd1c['actionid']][_0x13d0('0xbd')]])){this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]]['queue']]=[];}this[_0x13d0('0x2b')][this['actions'][_0x1dfd1c['actionid']]['queue']]['push'](_['merge'](_[_0x13d0('0xe1')](this[_0x13d0('0xb6')][_0x1dfd1c[_0x13d0('0x134')]],[_0x13d0('0x139'),'stateinterface']),{'status':_0x1dfd1c[_0x13d0('0xba')],'paused':_0x1dfd1c[_0x13d0('0x135')]}));}}}};function unlockQueueStatus(_0x229404,_0x2be965){setTimeout(function(){if(_[_0x13d0('0x44')](_0x229404[_0x13d0('0x13a')])){loggerBooked['error'](_0x13d0('0x13b'),_0x2be965);}_0x229404[_0x13d0('0x13a')]=!![];loggerBooked[_0x13d0('0x84')](_0x13d0('0x13c'),_0x2be965,JSON['stringify'](_['pick'](_0x229404,['name',_0x13d0('0x13a')])));},0x1f3);}Dialer['prototype'][_0x13d0('0x3f')]=function(_0x18f02e){var _0x6ebdd2=this;var _0x58eb88=_0x6ebdd2[_0x13d0('0x20')][_0x6ebdd2['actions'][_0x18f02e['actionid']][_0x13d0('0xbd')]];if(strategy[this[_0x13d0('0x20')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]][_0x13d0('0x56')]]===_0x13d0('0x1a')){if(this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]]&&this[_0x13d0('0xb6')][_0x18f02e['actionid']][_0x13d0('0x137')]){this['preview'][_0x13d0('0x13d')](this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0x139')],this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0x137')])['catch'](function(_0x456bf1){logger[_0x13d0('0x9e')](_0x13d0('0x13e'),util[_0x13d0('0x9c')](_0x456bf1,{'showHidden':![],'depth':null}));})[_0x13d0('0x1d')](function(){_0x6ebdd2[_0x13d0('0xbf')](_0x6ebdd2[_0x13d0('0x20')][_0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]);_0x6ebdd2[_0x13d0('0x22')][_0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0x137')]]['locked']=![];delete _0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]];unlockQueueStatus(_0x58eb88);});}else{this[_0x13d0('0xbf')](this['voiceQueues'][this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xe2')],'ListId':this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]]['ListId'],'VoiceQueueId':this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xe4')]||undefined,'CampaignId':this['actions'][_0x18f02e['actionid']][_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x13f')));delete this['actions'][_0x18f02e[_0x13d0('0x134')]];unlockQueueStatus(_0x58eb88);}}else if((strategy[this[_0x13d0('0x20')][this[_0x13d0('0xb6')][_0x18f02e['actionid']]['queue']][_0x13d0('0x56')]]||'rrmemory')===_0x13d0('0x138')){var _0x4f583c;if(this[_0x13d0('0xb6')][_0x18f02e['actionid']]&&!_[_0x13d0('0x4d')](this[_0x13d0('0x2b')][this['actions'][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]])){if(this[_0x13d0('0x2c')][_0x6ebdd2[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]]['queue']]){this[_0x13d0('0x2c')][_0x6ebdd2['actions'][_0x18f02e['actionid']][_0x13d0('0xbd')]]=this[_0x13d0('0x2c')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]?this[_0x13d0('0x2c')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]:this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]]?this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]][_0x13d0('0x140')]||0x0:0x0;}this[_0x13d0('0x2b')][this[_0x13d0('0xb6')][_0x18f02e['actionid']][_0x13d0('0xbd')]][_0x13d0('0x140')]=this[_0x13d0('0x2c')][this[_0x13d0('0xb6')][_0x18f02e[_0x13d0('0x134')]][_0x13d0('0xbd')]];for(var _0x4b6780=0x0;_0x4b6780=0x0;})[_0x13d0('0xc3')](myreject(_0x11aa2b)));}}else{_0x1e139c[_0x13d0('0x159')](ami['Action']({'action':_0x13d0('0x15b'),'command':util[_0x13d0('0x7f')](_0x13d0('0x15c'),_0x1f42c5,!_[_0x13d0('0x44')](config[_0x13d0('0x156')][_0x20527f])?_0x20527f:'')})['then'](function(_0xf7e0da){return _0xf7e0da['content']['indexOf']('true')>=0x0;})[_0x13d0('0xc3')](myreject(_0x11aa2b)));}Promise[_0x13d0('0x161')](_0x1e139c)['then'](function(_0x5560fb){var _0x3ac60d=_[_0x13d0('0x162')](_0x5560fb);if(_0x3ac60d){return _0x2961c8(_0x3ac60d);}else{_0x49e622[_0x13d0('0x45')]=_0x57eb01?_0x13d0('0x163'):'INTERVAL_IS_OVERTIME';return _0x11aa2b(msgResponse(_0x13d0('0x164'),_0x13d0('0x152'),_0x13d0('0x165')+_0x57eb01+'\x20'+_0x182497+_0x13d0('0x166')+util[_0x13d0('0x9c')](_0x1f42c5,{'showHidden':![],'depth':null})+_0x13d0('0x167')+_0x20527f));}})[_0x13d0('0xc3')](function(_0x23180d){return _0x11aa2b(msgResponse(_0x13d0('0x151'),_0x13d0('0x152'),JSON[_0x13d0('0x145')](_0x23180d)));});});};Dialer[_0x13d0('0x1b')][_0x13d0('0x168')]=function(_0x5dd2fd){var _0x1c311e=this;return function(){switch(_0x5dd2fd[_0x13d0('0x63')]){case _0x13d0('0x169'):freeVariablesPredictive(_0x5dd2fd);_0x1c311e[_0x13d0('0x16a')](_0x5dd2fd,0x1);break;case'power':freeVariablesPredictive(_0x5dd2fd);_0x1c311e[_0x13d0('0x16a')](_0x5dd2fd,_0x5dd2fd[_0x13d0('0x16b')]);break;case _0x13d0('0x8'):_0x1c311e['predictive'](_0x5dd2fd);break;case'booked':freeVariablesPredictive(_0x5dd2fd);_0x1c311e[_0x13d0('0x16a')](_0x5dd2fd,0x1);break;default:freeVariablesPredictive(_0x5dd2fd);logger[_0x13d0('0x9e')](_0x13d0('0x16c'),_0x5dd2fd[_0x13d0('0x48')],_0x13d0('0x16d'));}};};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x5b7f10){return Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](cmHopper[_0x13d0('0x16e')](_0x5b7f10['id'],previewRecallmeReminderInterval))[_0x13d0('0x42')](function(_0x1362b0){for(var _0x4d1913=0x0;_0x4d1913<_0x1362b0[_0x13d0('0x9f')];_0x4d1913++){var _0x5a7fd1=_0x1362b0[_0x4d1913][_0x13d0('0x16f')][_0x13d0('0x48')];if(_0x5a7fd1)io['to'](util['format'](_0x13d0('0x170'),_0x5a7fd1))[_0x13d0('0x53')](_0x13d0('0x171'),{'hopper':_0x1362b0[_0x4d1913]});}})[_0x13d0('0xc3')](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0x330c49){var _0x17910b=this;return function(){_0x17910b['handleIvr'](_0x330c49);};};Dialer[_0x13d0('0x1b')][_0x13d0('0x9')]=function(_0x381c70){var _0x5d7f5e=this;if(isNotPreview(_0x381c70[_0x13d0('0x63')])){if(isVoiceQueueOutbound(_0x381c70['type'])&&isActive(_0x381c70[_0x13d0('0x62')])){_0x381c70[_0x13d0('0xa9')]=!![];Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](checkIsLoggedIn(_0x381c70,_0x381c70['loggedIn']))[_0x13d0('0x42')](checkIsActive(_0x381c70,_0x381c70['dialActive']))[_0x13d0('0x42')](checkInterval(_0x381c70))['then'](_0x5d7f5e[_0x13d0('0x14b')](_0x381c70))['then'](_0x5d7f5e[_0x13d0('0x14f')](_0x381c70[_0x13d0('0x172')],_0x381c70['dialTimezone'],_0x381c70['name'],_0x381c70))[_0x13d0('0x42')](_0x5d7f5e[_0x13d0('0x150')](_0x381c70['Interval'],_0x381c70[_0x13d0('0x173')],_0x381c70[_0x13d0('0x48')],_0x381c70))[_0x13d0('0x42')](_0x5d7f5e[_0x13d0('0x168')](_0x381c70))['catch'](loggerCatchQueueSummary(_0x13d0('0x174'),_0x381c70));}else{notSendMessagesQueue(_0x381c70);}}else{freeVariablesPredictive(_0x381c70);}};Dialer[_0x13d0('0x1b')][_0x13d0('0x36')]=_[_0x13d0('0x175')](function(){var _0x473993=_['filter'](this[_0x13d0('0x20')],function(_0x75b7f5){return _0x75b7f5[_0x13d0('0x176')];});var _0x57490c=_[_0x13d0('0x177')](this[_0x13d0('0x22')],function(_0x516d08){return _0x516d08[_0x13d0('0x178')]&&_0x516d08[_0x13d0('0xba')]===_0x13d0('0x179');});if(_0x473993['length']>0x0&&_0x57490c['length']>0x0){return Promise[_0x13d0('0xc1')]()['then'](cmHopper[_0x13d0('0x16e')](_['map'](_0x473993,'id'),previewRecallmeReminderInterval,_[_0x13d0('0x17a')](_0x57490c,'id')))['then'](function(_0x5b2f38){for(var _0x1ef21e=0x0;_0x1ef21e<_0x5b2f38[_0x13d0('0x9f')];_0x1ef21e++){var _0x14d3fd=_0x5b2f38[_0x1ef21e][_0x13d0('0x16f')][_0x13d0('0x48')];if(_0x14d3fd)io['to'](util[_0x13d0('0x7f')](_0x13d0('0x170'),_0x14d3fd))[_0x13d0('0x53')](_0x13d0('0x171'),{'hopper':_0x5b2f38[_0x1ef21e]});}})[_0x13d0('0xc3')](function(_0x269b5e){logger[_0x13d0('0x9e')]('checkPreviewRecallReminder',_0x269b5e);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x13d0('0x1b')][_0x13d0('0x14a')]=function(){var _0x4ce7ec=this;var _0x1490d8;for(var _0xdd9173 in this[_0x13d0('0x21')]){if(typeof this[_0x13d0('0x21')][_0xdd9173]!==_0x13d0('0xa1')){_0x1490d8=this[_0x13d0('0x21')][_0xdd9173];if(isCampaignIvr(_0x1490d8[_0x13d0('0x54')])&&isActive(_0x1490d8['active'])){_0x1490d8[_0x13d0('0xa9')]=!![];Promise[_0x13d0('0xc1')]()[_0x13d0('0x42')](checkIsActive(_0x1490d8,_0x1490d8[_0x13d0('0x7d')]))[_0x13d0('0x42')](checkInterval(_0x1490d8))[_0x13d0('0x42')](_0x4ce7ec['checkIsTrunkReachable'](_0x1490d8))[_0x13d0('0x42')](_0x4ce7ec['checkIfTime'](_0x1490d8[_0x13d0('0x172')],_0x1490d8[_0x13d0('0x173')],_0x1490d8['name'],_0x1490d8))['then'](_0x4ce7ec[_0x13d0('0x150')](_0x1490d8[_0x13d0('0x4a')],_0x1490d8['dialTimezone'],_0x1490d8[_0x13d0('0x48')],_0x1490d8))[_0x13d0('0x42')](_0x4ce7ec[_0x13d0('0x17b')](_0x1490d8))['catch'](loggerCatchQueueSummary(_0x13d0('0x17c'),_0x1490d8));}else{notSendMessagesCampaign(_0x1490d8);}}}};function getCallerIdRandom(_0x488a57,_0x487011){var _0x130679;var _0x4f2075;var _0x43292d;if(_0x487011<=0x0){_0x487011=0x1;}_0x130679=new RegExp(_0x13d0('0x17d')+_0x487011+'}$');_0x4f2075=Math[_0x13d0('0x17e')](0xa,_0x487011-0x1);_0x43292d=Math[_0x13d0('0x17e')](0xa,_0x487011)-0x1;return util[_0x13d0('0x7f')]('%s',_['replace'](_0x488a57,_0x130679,_[_0x13d0('0x17f')](_0x4f2075,_0x43292d)));}function extractCalleridName(_0x30f98){var _0x1fbb10=_0x30f98[_0x13d0('0x180')](/"(.*?)"/);return _0x1fbb10?_0x1fbb10[0x1]:_0x30f98;}Dialer[_0x13d0('0x1b')][_0x13d0('0x181')]=function(_0x4b924a,_0x32e661){var _0x1092a3=this;var _0xd1dfe6=uuid['v4']();this[_0x13d0('0xb6')][_0xd1dfe6]=new Action(_0x4b924a,_0x32e661,_0xd1dfe6);return new Promise(function(_0xf5ffc3,_0x506936){if(_[_0x13d0('0x44')](_0x4b924a)&&typeof _0x4b924a!==_0x13d0('0x182')){return _0x506936(msgResponse('originate',_0x13d0('0x152'),_0x13d0('0x183')));}if(_[_0x13d0('0x44')](_0x32e661[_0x13d0('0x184')])||_0x32e661[_0x13d0('0x184')]===null){return _0x506936(msgResponse('originate',_0x13d0('0x152'),_0x13d0('0x185')));}var _0x14b434={'XMD-CALLERID':_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6]['getCaller'](),'XMD-AGI':_0x4b924a[_0x13d0('0x115')]?util[_0x13d0('0x7f')](_0x13d0('0x186'),ipAgi,_0x4b924a[_0x13d0('0x115')]):_0x13d0('0x187'),'XMD-AGIAFTER':_0x4b924a[_0x13d0('0x11a')]?util[_0x13d0('0x7f')](_0x13d0('0x186'),ipAgi,_0x4b924a['dialQueueProject2']):_0x13d0('0x187'),'XMD-QUEUE':_0x4b924a[_0x13d0('0x54')]===_0x13d0('0x55')?util[_0x13d0('0x7f')]('\x22%s,%s%s,,,%s\x22',_0x4b924a[_0x13d0('0x48')],_0x4b924a[_0x13d0('0x188')]||'',_0x4b924a[_0x13d0('0x11b')]?'c':'',_0x4b924a[_0x13d0('0x122')]||0x3):_0x13d0('0x187'),'XMD-CONTACTID':_0x32e661[_0x13d0('0xe2')],'XMD-CDRTYPE':_0x13d0('0x5'),'CALLERID(all)':_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6]['getCaller'](),'XMD-AMD':_0x4b924a[_0x13d0('0xf7')]?_0x13d0('0x189'):_0x13d0('0x187'),'XMD-DESTINATION':_0x13d0('0x18a')};if(_0x4b924a['dialAMDActive']){_0x14b434[_0x13d0('0x18b')]=_0x4b924a[_0x13d0('0x18c')]||0x9c4;_0x14b434['XMD-AMDGREETING']=_0x4b924a[_0x13d0('0x18d')]||0x5dc;_0x14b434['XMD-AMDAFTERGREETINGSILENCE']=_0x4b924a[_0x13d0('0x18e')]||0x320;_0x14b434[_0x13d0('0x18f')]=_0x4b924a['dialAMDTotalAnalysisTime']||0x1388;_0x14b434['XMD-AMDMINWORDLENGTH']=_0x4b924a[_0x13d0('0x190')]||0x64;_0x14b434[_0x13d0('0x191')]=_0x4b924a['dialAMDBetweenWordsSilence']||0x32;_0x14b434[_0x13d0('0x192')]=_0x4b924a[_0x13d0('0x193')]||0x3;_0x14b434[_0x13d0('0x194')]=_0x4b924a[_0x13d0('0x195')]||0x100;_0x14b434['XMD-AMDMAXIMUMWORDLENGTH']=_0x4b924a[_0x13d0('0x196')]||0x1388;}if(_0x4b924a['type']===_0x13d0('0x55')){_0x14b434[_0x13d0('0x197')]=_0x32e661[_0x13d0('0xe4')];}else{_0x14b434[_0x13d0('0x198')]=_0x32e661['CampaignId'];}for(var _0xe5d02c in _0x32e661[_0x13d0('0x199')]){if(typeof _0x32e661[_0x13d0('0x199')][_0xe5d02c]!==_0x13d0('0xa1')){if(isNotNull(_0x32e661[_0x13d0('0x199')][_0xe5d02c])&&_0xe5d02c!=='id'&&_0xe5d02c!=='tags'&&_0xe5d02c!==_0x13d0('0x19a')&&_0xe5d02c!=='updatedAt'){_0x14b434[util[_0x13d0('0x7f')](_0x13d0('0x19b'),'XMD-',_[_0x13d0('0x19c')](_0xe5d02c))]=_0x32e661[_0x13d0('0x199')][_0xe5d02c];}}}var _0x26f68e=_0x1092a3[_0x13d0('0x14c')](_0x4b924a[_0x13d0('0x7c')])?getCallerId(_0x4b924a['Trunk'][_0x13d0('0x19d')],_0x4b924a[_0x13d0('0x19e')],_0x4b924a[_0x13d0('0x19f')]>0x0?getCallerIdRandom(_0x4b924a[_0x13d0('0x64')],_0x4b924a[_0x13d0('0x19f')]):_0x4b924a[_0x13d0('0x64')]):getCallerId(_[_0x13d0('0xb9')](_0x4b924a[_0x13d0('0x14d')])?_0x4b924a['Trunk'][_0x13d0('0x19d')]:_0x4b924a[_0x13d0('0x14d')][_0x13d0('0x19d')],_0x4b924a['dialOriginateCallerIdName'],_0x4b924a[_0x13d0('0x19f')]>0x0?getCallerIdRandom(_0x4b924a[_0x13d0('0x64')],_0x4b924a['dialRandomLastDigitCallerIdNumber']):_0x4b924a['dialOriginateCallerIdNumber']);if(_0x26f68e){_0x14b434[_0x13d0('0x1a0')]=_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6][_0x13d0('0x1a1')]=extractCalleridName(_0x26f68e);_0x14b434[_0x13d0('0x1a2')]=_0x32e661['phone'];}_0x4b924a[_0x13d0('0x1a3')]=_0x14b434;return ami[_0x13d0('0x15a')]({'actionid':_0xd1dfe6,'action':_0x13d0('0x1a4'),'channel':_0x1092a3['isTrunkReachable'](_0x4b924a[_0x13d0('0x7c')])?util['format']('SIP/%s/%s%s',_0x4b924a['Trunk'][_0x13d0('0x48')],isNotNull(_0x4b924a['dialPrefix'])?_0x4b924a['dialPrefix'][_0x13d0('0x1a5')]()||'':'',_0x4b924a['dialCutDigit']>0x0?_0x32e661['phone'][_0x13d0('0x1a6')](_0x4b924a[_0x13d0('0x1a7')]):_0x32e661[_0x13d0('0x184')]):util[_0x13d0('0x7f')]('SIP/%s/%s%s',_['isNil'](_0x4b924a['TrunkBackup'])?_0x4b924a['Trunk'][_0x13d0('0x48')]:_0x4b924a[_0x13d0('0x14d')][_0x13d0('0x48')],isNotNull(_0x4b924a[_0x13d0('0x66')])?_0x4b924a[_0x13d0('0x66')][_0x13d0('0x1a5')]()||'':'',_0x4b924a[_0x13d0('0x1a7')]>0x0?_0x32e661[_0x13d0('0x184')]['substring'](_0x4b924a[_0x13d0('0x1a7')]):_0x32e661['phone']),'callerid':_0x26f68e,'Exten':_0x13d0('0x18a'),'Context':_0x13d0('0x1a8'),'Priority':'1','variable':_0x14b434,'timeout':(_0x4b924a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xd1dfe6})['then'](function(_0x46431c){return _0xf5ffc3(_0x46431c);})[_0x13d0('0xc3')](function(_0x365d62){_0x4b924a[_0x13d0('0x6f')]+=0x1;var _0x191dff=new History(_0x1092a3[_0x13d0('0xb6')][_0xd1dfe6]);logger['error'](util[_0x13d0('0x7f')](_0x13d0('0x1a9'),JSON[_0x13d0('0x145')](_0x365d62)));_0x191dff[_0x13d0('0xb1')]=0xe;_0x191dff[_0x13d0('0xb2')]='OriginateError';_0x191dff['starttime']=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));_0x191dff['endtime']=_0x191dff['starttime'];_0x1092a3['createHistory'](_0x191dff)[_0x13d0('0xc3')](loggerCatch('[originate][error]'));_0x1092a3[_0x13d0('0xda')](_0x191dff)[_0x13d0('0xc3')](loggerCatch('[originate][error]'))[_0x13d0('0x1d')](function(){delete _0x1092a3[_0x13d0('0xb6')][_0xd1dfe6];return _0x506936(msgResponse(_0x13d0('0x1a4'),_0x13d0('0x1aa'),'originate\x20action\x20Error'));});});});};Dialer[_0x13d0('0x1b')]['syncOriginateResponse']=function(_0x174537){var _0x20664d=this[_0x13d0('0xb6')][_0x174537['actionid']];if(_0x20664d){delete this[_0x13d0('0xb6')][_0x174537[_0x13d0('0x134')]];_0x20664d[_0x13d0('0x1ab')]=moment()[_0x13d0('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2999d1=_0x20664d[_0x13d0('0x54')]===_0x13d0('0x99')?this['campaigns'][_0x20664d['queue']]:this[_0x13d0('0x20')][_0x20664d[_0x13d0('0x1ac')]()];if(!this[_0x13d0('0x1ad')](_0x174537[_0x13d0('0x1ae')])){this[_0x13d0('0xbf')](_0x2999d1);return this[_0x13d0('0x1af')](_0x20664d,_0x2999d1,_0x174537)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1b0')));}this[_0x13d0('0x26')][_0x174537[_0x13d0('0xf0')]]=_0x20664d;}};Dialer[_0x13d0('0x1b')][_0x13d0('0x1b1')]=function(_0x441705,_0x3a946a,_0x2cb1b1){var _0x3fe17d=new History(_0x3a946a);if(_0x3fe17d['countbusyretry']+_0x3fe17d[_0x13d0('0xfd')]+_0x3fe17d[_0x13d0('0xfe')]+_0x3fe17d[_0x13d0('0xff')]+_0x3fe17d[_0x13d0('0x100')]+_0x3fe17d['countabandonedretry']+_0x3fe17d[_0x13d0('0x102')]+_0x3fe17d[_0x13d0('0x103')]>=_0x2cb1b1[_0x13d0('0x1b2')]-0x1){return!![];}switch(_0x441705){case 0x3:if(_0x3fe17d[_0x13d0('0xfe')]>=_0x2cb1b1[_0x13d0('0x1b3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3fe17d[_0x13d0('0xfe')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1b4')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d['VoiceQueueId']||undefined,'CampaignId':_0x3fe17d[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1b5')));break;case 0x5:if(_0x3fe17d[_0x13d0('0xfc')]>=_0x2cb1b1[_0x13d0('0x1b6')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countbusyretry':_0x3fe17d[_0x13d0('0xfc')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1b7')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d['ListId'],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1b8')));break;case 0x8:if(_0x3fe17d[_0x13d0('0xfd')]>=_0x2cb1b1[_0x13d0('0x1b9')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countcongestionretry':_0x3fe17d[_0x13d0('0xfd')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1ba')],_0x13d0('0x109'))[_0x13d0('0x7f')](_0x13d0('0x10a')),'ContactId':_0x3fe17d['ContactId'],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1bb')));break;case 0x0:if(_0x3fe17d[_0x13d0('0xff')]>=_0x2cb1b1['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x3fe17d['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x2cb1b1['dialNoSuchNumberRetryFrequency'],_0x13d0('0x109'))['format'](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d['ListId'],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3fe17d['countdropretry']>=_0x2cb1b1[_0x13d0('0x1bc')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x3fe17d[_0x13d0('0x100')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x126')],_0x13d0('0x109'))['format'](_0x13d0('0x10a')),'ContactId':_0x3fe17d['ContactId'],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d['VoiceQueueId']||undefined,'CampaignId':_0x3fe17d[_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x127')));break;case 0xb:if(_0x3fe17d[_0x13d0('0x101')]>=_0x2cb1b1[_0x13d0('0x130')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countabandonedretry':_0x3fe17d[_0x13d0('0x101')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x131')],_0x13d0('0x109'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d['ListId'],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x132')));break;case 0x13:if(_0x3fe17d['countmachineretry']>=_0x2cb1b1[_0x13d0('0x106')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3fe17d[_0x13d0('0x102')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x112')],_0x13d0('0x109'))[_0x13d0('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x10c')));break;case 0x14:if(_0x3fe17d[_0x13d0('0x103')]>=_0x2cb1b1[_0x13d0('0x1bd')]-0x1){return!![];}this[_0x13d0('0xd0')]({'active':![],'countagentrejectretry':_0x3fe17d[_0x13d0('0x103')]+=0x1,'scheduledat':moment()[_0x13d0('0x111')](_0x2cb1b1[_0x13d0('0x1be')],_0x13d0('0x109'))['format'](_0x13d0('0x10a')),'ContactId':_0x3fe17d[_0x13d0('0xe2')],'ListId':_0x3fe17d[_0x13d0('0x10b')],'VoiceQueueId':_0x3fe17d[_0x13d0('0xe4')]||undefined,'CampaignId':_0x3fe17d['CampaignId']||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1bf')));break;default:return!![];}};Dialer[_0x13d0('0x1b')][_0x13d0('0x1af')]=function(_0x29324d,_0x434e19,_0xc7e69d){var _0x30df4b=this;var _0x66dda6=new History(_0x29324d);var _0x17cfe6=![];var _0x5bfb1d;var _0x510a77;return new Promise(function(_0x26c465,_0x5b70aa){if(_[_0x13d0('0x44')](_0x434e19)&&typeof _0x434e19!=='object'){return _0x5b70aa(msgResponse('[callProgressDetecting]',_0x13d0('0x152'),_0x13d0('0x1c0')));}if(_[_0x13d0('0x44')](_0xc7e69d)&&typeof _0xc7e69d!=='object'){return _0x5b70aa(msgResponse(_0x13d0('0x1c1'),'Failure',_0x13d0('0x1c2')));}_0x30df4b[_0x13d0('0xc7')](_0x66dda6,_0xc7e69d['reason'],_0x434e19)[_0x13d0('0x42')](function(_0x4f27d9){if(_0x4f27d9['additional']==0x1)_0x17cfe6=!![];switch(_0xc7e69d['reason']){case'0':_0x434e19[_0x13d0('0x6e')]+=0x1;_0x66dda6[_0x13d0('0xb1')]=0x0;_0x66dda6['statedesc']='NoSuchNumber';_0x66dda6[_0x13d0('0xff')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;ami[_0x13d0('0x53')](_0x13d0('0x1c3'),ut[_0x13d0('0xf4')](_0x29324d,_0x13d0('0x1c4')));_0x5bfb1d=_0x434e19[_0x13d0('0x1c5')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0xfb')));if(_0x30df4b[_0x13d0('0x1b1')](0x0,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xff')]>=_0x434e19[_0x13d0('0x1c6')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1c7'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1c7'));}}break;case'3':_0x434e19[_0x13d0('0x6d')]+=0x1;_0x66dda6['state']=0x3;_0x66dda6[_0x13d0('0xb2')]=_0x13d0('0x1c8');_0x66dda6[_0x13d0('0xfe')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;var _0x2881e4=ut['buildNoAnswerEventPayload'](_0x29324d,_0x434e19);ami[_0x13d0('0x53')](_0x13d0('0x1c9'),_0x2881e4);_0x5bfb1d=_0x434e19[_0x13d0('0x1b4')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b['createHistory'](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1ca')));if(_0x30df4b[_0x13d0('0x1b1')](0x3,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6['countnoanswerretry']>=_0x434e19[_0x13d0('0x1b3')]){_0x30df4b['createStateFinal'](_0x66dda6,_0x26c465,_0x5b70aa,'reason\x203\x20ringing\x20no\x20answer');}else{_0x30df4b['stateGlobal'](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1cb'));}}break;case'5':_0x434e19[_0x13d0('0x1cc')]+=0x1;_0x66dda6[_0x13d0('0xb1')]=0x5;_0x66dda6[_0x13d0('0xb2')]='Busy';_0x66dda6[_0x13d0('0xfc')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;ami[_0x13d0('0x53')](_0x13d0('0x1cd'),ut[_0x13d0('0xf4')](_0x29324d,'busy'));_0x5bfb1d=_0x434e19[_0x13d0('0x1b7')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)['catch'](loggerCatch(_0x13d0('0x1ce')));if(_0x30df4b[_0x13d0('0x1b1')](0x5,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xfc')]>=_0x434e19[_0x13d0('0x1b6')]){_0x30df4b['createStateFinal'](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1cf'));}else{_0x30df4b['stateGlobal'](_0x66dda6,_0x26c465,_0x5b70aa,'reason\x205\x20busy');}}break;case'8':_0x434e19['outboundCongestionCallsDay']+=0x1;_0x66dda6['state']=0x8;_0x66dda6['statedesc']=_0x13d0('0x1d0');_0x66dda6['countcongestionretry']+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;_0x5bfb1d=_0x434e19[_0x13d0('0x1ba')];_0x510a77=_0x434e19[_0x13d0('0x12f')];ami[_0x13d0('0x53')](_0x13d0('0x1d1'),ut[_0x13d0('0xf4')](_0x29324d,_0x13d0('0x1d2')));_0x30df4b[_0x13d0('0xeb')](_0x66dda6)['catch'](loggerCatch(_0x13d0('0x1d3')));if(_0x30df4b[_0x13d0('0x1b1')](0x8,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xfd')]>=_0x434e19[_0x13d0('0x1b9')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d4'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d4'));}}break;case'11':_0x434e19[_0x13d0('0x1d5')]+=0x1;_0x66dda6['state']=0xb;_0x66dda6[_0x13d0('0xb2')]=_0x13d0('0x12c');_0x66dda6[_0x13d0('0x101')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;_0x5bfb1d=_0x434e19[_0x13d0('0x131')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x133')));if(_0x30df4b['checkRetriveMax'](0xb,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0x101')]>=_0x434e19[_0x13d0('0x130')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d6'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1d6'));}}break;case'20':_0x434e19[_0x13d0('0x70')]+=0x1;_0x66dda6[_0x13d0('0xb1')]=0x14;_0x66dda6[_0x13d0('0xb2')]=_0x13d0('0x1d7');_0x66dda6[_0x13d0('0x103')]+=0x1;_0x66dda6[_0x13d0('0xfa')]+=0x1;_0x5bfb1d=_0x434e19[_0x13d0('0x1be')];_0x510a77=_0x434e19[_0x13d0('0x12f')];ami[_0x13d0('0x53')](_0x13d0('0x1d8'),ut[_0x13d0('0xf4')](_0x29324d,_0x13d0('0x1d9')));_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x30df4b[_0x13d0('0x1b1')](0x14,_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6['countagentrejectretry']>=_0x434e19[_0x13d0('0x1bd')]){_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1da'));}else{_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0x13d0('0x1da'));}}break;default:_0x434e19[_0x13d0('0x71')]+=0x1;_0x66dda6['state']=0xc;_0x66dda6[_0x13d0('0xb2')]=_0xc7e69d[_0x13d0('0x1db')];_0x5bfb1d=_0x434e19[_0x13d0('0x1be')];_0x510a77=_0x434e19[_0x13d0('0x12f')];_0x30df4b[_0x13d0('0xeb')](_0x66dda6)[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x1dc')));if(_0x30df4b[_0x13d0('0x1b1')](_0xc7e69d[_0x13d0('0x1db')],_0x29324d,_0x434e19)&&!_0x17cfe6){if(_0x66dda6[_0x13d0('0xfc')]+_0x66dda6[_0x13d0('0xfd')]+_0x66dda6[_0x13d0('0xfe')]+_0x66dda6[_0x13d0('0xff')]+_0x66dda6[_0x13d0('0x100')]+_0x66dda6[_0x13d0('0x101')]+_0x66dda6[_0x13d0('0x102')]+_0x66dda6[_0x13d0('0x103')]>=_0x434e19['dialGlobalMaxRetry']){_0x30df4b[_0x13d0('0x104')](_0x66dda6,_0x26c465,_0x5b70aa,_0xc7e69d[_0x13d0('0x1db')]);}else{_0x30df4b[_0x13d0('0x107')](_0x66dda6,_0x26c465,_0x5b70aa,_0xc7e69d[_0x13d0('0x1db')]);}}}})[_0x13d0('0x42')](function(){if(_0x17cfe6){_0x30df4b[_0x13d0('0xc9')](_0x66dda6,_0x5bfb1d,_0x510a77)['then'](function(){return _0x26c465(0x1);});}});});};Dialer[_0x13d0('0x1b')]['stateGlobal']=function(_0x3eda2,_0x58ad36,_0x34be72,_0x2478c2){var _0x475b89=new Final(_0x3eda2);_0x475b89['state']=0xf;_0x475b89[_0x13d0('0xb2')]=_0x13d0('0x1dd');this['createStateFinal'](_0x475b89,_0x58ad36,_0x34be72,_0x2478c2);};Dialer[_0x13d0('0x1b')]['createStateFinal']=function(_0x4e6699,_0x2c39f6,_0x6ba8bf,_0x1ebb2c){this[_0x13d0('0xda')](_0x4e6699)[_0x13d0('0x42')](function(){return _0x2c39f6(msgResponse(_0x13d0('0x1c1'),_0x13d0('0xe8'),_0x1ebb2c));})[_0x13d0('0xc3')](function(){return _0x6ba8bf(msgResponse(_0x13d0('0x1de'),_0x13d0('0x152'),_0x13d0('0x1df')));});};Dialer[_0x13d0('0x1b')][_0x13d0('0x8')]=function(_0x447b4f){var _0x149bb0=_0x447b4f[_0x13d0('0x1e0')]/0x64;var _0x4d808f=_0x447b4f[_0x13d0('0x6c')]/(_0x447b4f['outboundDropCallsDayTimeout']+_0x447b4f['outboundAnswerCallsDay']);var _0x2c36f1=Math[_0x13d0('0x1e1')](_0x447b4f[_0x13d0('0x1e2')]*(_0x447b4f[_0x13d0('0x1e3')]/0x64));var _0x4ce835=Math[_0x13d0('0x1e1')](_0x447b4f[_0x13d0('0x1e2')]*(_0x447b4f[_0x13d0('0x1e4')]/0x64));var _0x3b66c5=_0x447b4f[_0x13d0('0x58')]+_0x447b4f[_0x13d0('0xaa')];var _0x591208=Math[_0x13d0('0x1e5')](_0x447b4f['erlangCalls']*_0x447b4f['erlangAbandonmentRate']*_0x447b4f[_0x13d0('0x77')]*_0x447b4f[_0x13d0('0x78')]);if(_['isUndefined'](_0x447b4f[_0x13d0('0x29')])){if(!_['isUndefined'](_0x447b4f[_0x13d0('0x28')])){_0x447b4f[_0x13d0('0x28')]=undefined;loggerPredictive['error'](_0x13d0('0x1e6'),_0x13d0('0x1e7'));}if(!_[_0x13d0('0x44')](_0x447b4f['handlePredictive'])){loggerPredictive[_0x13d0('0x9e')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x447b4f['handlePredictive']);_0x447b4f[_0x13d0('0x97')]=undefined;}_0x447b4f['startProgressive']=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));loggerPredictive[_0x13d0('0x84')](_0x447b4f['name'],'collection\x20data\x20in\x20progressive\x20at',_0x447b4f[_0x13d0('0x29')]);this['handlePower'](_0x447b4f,0x1);}else if(ifInterval(_0x447b4f[_0x13d0('0x1e8')],_0x447b4f[_0x13d0('0x29')])){this[_0x13d0('0x16a')](_0x447b4f,0x1);loggerPredictiveCalls['info'](_0x13d0('0x1e9'),_0x447b4f[_0x13d0('0x29')],_0x447b4f[_0x13d0('0x48')]);_0x447b4f['erlangCalls']=0x0;_0x447b4f[_0x13d0('0x76')]=0x0;}else if(_0x149bb0<_0x4d808f&&_0x447b4f[_0x13d0('0x1ea')]===_0x13d0('0x1eb')){freeVariablesPredictive(_0x447b4f);loggerPredictive[_0x13d0('0x84')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x13d0('0x1ec'),_0x4d808f,'startProgressive',_0x447b4f[_0x13d0('0x48')]);}else if(_0x591208<_0x447b4f[_0x13d0('0x76')]&&_0x447b4f[_0x13d0('0x1ea')]===_0x13d0('0x1eb')){freeVariablesPredictive(_0x447b4f);loggerPredictive['info'](_0x13d0('0x1ed'),_0x13d0('0x1ee'),_0x591208,_0x13d0('0x1ef'),_0x447b4f[_0x13d0('0x76')],_0x13d0('0x29'),_0x447b4f[_0x13d0('0x48')]);}else if(!ifInterval(_0x447b4f[_0x13d0('0x1e8')],_0x447b4f[_0x13d0('0x29')])&&_['isUndefined'](_0x447b4f[_0x13d0('0x28')])&&!_['isUndefined'](_0x447b4f[_0x13d0('0x29')])){_0x447b4f['startPredictive']=moment()['format'](_0x13d0('0x10a'));loggerPredictive['info'](_0x447b4f[_0x13d0('0x48')],'started\x20in\x20predictive\x20at',_0x447b4f['startPredictive']);this[_0x13d0('0xcd')](_0x447b4f['dialPredictiveInterval'])[_0x13d0('0x42')](this[_0x13d0('0x1f0')](_0x447b4f))[_0x13d0('0x42')](mergeDataErlangB(_0x447b4f))[_0x13d0('0x42')](this[_0x13d0('0x1f1')](_0x447b4f))[_0x13d0('0xc3')](loggerCatchPredictive(_0x13d0('0x1f2'),_0x447b4f));}else if(!ifInterval(_0x447b4f[_0x13d0('0x1e8')],_0x447b4f[_0x13d0('0x28')])){_0x447b4f[_0x13d0('0x76')]=0x0;_0x447b4f[_0x13d0('0x28')]=moment()[_0x13d0('0x7f')](_0x13d0('0x10a'));loggerPredictive[_0x13d0('0x84')](_0x447b4f[_0x13d0('0x48')],_0x13d0('0x1f3'),_0x447b4f[_0x13d0('0x28')]);clearInterval(_0x447b4f[_0x13d0('0x97')]);_0x447b4f[_0x13d0('0x97')]=undefined;this['averageHandleTime'](_0x447b4f['dialPredictiveInterval'])[_0x13d0('0x42')](this[_0x13d0('0x1f0')](_0x447b4f))[_0x13d0('0x42')](mergeDataErlangB(_0x447b4f))[_0x13d0('0x42')](this[_0x13d0('0x1f1')](_0x447b4f))[_0x13d0('0xc3')](loggerCatchPredictive(_0x13d0('0x1f4'),_0x447b4f));}else if(_0x447b4f[_0x13d0('0x1e2')]&&_0x3b66c5<_0x447b4f[_0x13d0('0x1e2')]-_0x4ce835){freeVariablesPredictive(_0x447b4f);loggerPredictive[_0x13d0('0x84')](_0x447b4f[_0x13d0('0x48')],_0x13d0('0x1f5'),_0x3b66c5,_0x13d0('0x1f6'),_0x447b4f['predictiveIntervalAvailable'],'-',_0x4ce835,'=',_0x447b4f[_0x13d0('0x1e2')]-_0x4ce835,')');}else if(_0x447b4f[_0x13d0('0x1e2')]&&_0x3b66c5>_0x447b4f[_0x13d0('0x1e2')]+_0x2c36f1){freeVariablesPredictive(_0x447b4f);loggerPredictive[_0x13d0('0x84')](_0x447b4f[_0x13d0('0x48')],_0x13d0('0x1f5'),_0x3b66c5,')\x20are\x20more\x20than\x20threshold\x20(',_0x447b4f['predictiveIntervalAvailable'],'+',_0x2c36f1,'=',_0x447b4f[_0x13d0('0x1e2')]+_0x2c36f1,')');}};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f0')]=function(_0x11c0df){var _0x2106c0=this;return function(_0x3fcc03){return new Promise(function(_0x53402e,_0x5bb337){_['merge'](_0x11c0df,_0x3fcc03[0x0]);if(checkGetDataPredictive(_0x3fcc03[0x0])){var _0x1428e4=_0x11c0df[_0x13d0('0x1e2')]=_0x11c0df[_0x13d0('0xaa')]+_0x11c0df[_0x13d0('0x58')];var _0x51ea5f=_0x11c0df['dialPredictiveInterval']*0x3c;var _0x5ce963=_0x3fcc03[0x0]['predictiveIntervalAvgTalktime']+_0x3fcc03[0x0]['predictiveIntervalAvgHoldtime'];var _0x312be8=(_0x3fcc03[0x0][_0x13d0('0x72')]+_0x3fcc03[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3fcc03[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3fcc03[0x0][_0x13d0('0x86')];_0x11c0df[_0x13d0('0x77')]=_0x312be8>0x0?_0x312be8:0x1;switch(_0x11c0df[_0x13d0('0x1ea')]){case _0x13d0('0x1eb'):var _0x1493a7=_0x11c0df[_0x13d0('0x1e0')]/0x64;return _0x2106c0[_0x13d0('0x1f7')](_0x1428e4,_0x51ea5f,_0x5ce963,_0x312be8,_0x1493a7)['then'](function(_0x1ec26d){return _0x53402e(_0x1ec26d);});case _0x13d0('0x1f8'):var _0x4e14e0=_0x11c0df['dialPredictiveOptimizationPercentage']/0x64;return _0x2106c0[_0x13d0('0x1f9')](_0x1428e4,_0x51ea5f,_0x5ce963,_0x312be8,_0x4e14e0)[_0x13d0('0x42')](function(_0x5c849b){return _0x53402e(_0x5c849b);});default:return _0x5bb337(msgResponse(_0x13d0('0x1fa'),_0x13d0('0x152'),'Unknown\x20Predictive'));}}else{return _0x5bb337(msgResponse(_0x13d0('0x1fa'),'Failure','check\x20failure'));}});};};Dialer[_0x13d0('0x1b')]['getDataPredictiveOld']=function(_0x9bc516){var _0xfd7970=this;return function(_0x31b772){return new Promise(function(_0x5a9922,_0x3aeb8f){_[_0x13d0('0x95')](_0x9bc516,_0x31b772[0x0]);if(checkGetDataPredictive(_0x31b772[0x0])){loggerPredictive[_0x13d0('0x84')](JSON['stringify'](_0x31b772[0x0]));if(_0x9bc516[_0x13d0('0x1ea')]===_0x13d0('0x1eb')){return _0xfd7970[_0x13d0('0xd8')](_0x9bc516['id'])[_0x13d0('0x42')](function(_0x5389e8){var _0x43d1b4=_0x9bc516[_0x13d0('0x59')]-_0x5389e8[0x0]['outboundQueuePauses'];var _0x1418af=_0x9bc516[_0x13d0('0x1e8')]*0x3c;var _0x47b6af=_0x31b772[0x0]['predictiveIntervalAvgTalktime']+_0x31b772[0x0][_0x13d0('0x73')];var _0x5b2ce3=(_0x31b772[0x0]['predictiveIntervalAnsweredCalls']+_0x31b772[0x0][_0x13d0('0x88')]+_0x31b772[0x0][_0x13d0('0x8a')])/_0x31b772[0x0]['predictiveIntervalTotalCalls'];var _0x31484a=_0x9bc516['dialPredictiveOptimizationPercentage']/0x64;_0x9bc516[_0x13d0('0x79')]=_0x5389e8[0x0]['outboundQueuePauses']||0x0;_0x9bc516['predictiveIntervalHitRate']=_0x5b2ce3>0x0?_0x5b2ce3:0x1;return _0xfd7970[_0x13d0('0x1f7')](_0x43d1b4,_0x1418af,_0x47b6af,_0x5b2ce3,_0x31484a);})[_0x13d0('0x42')](function(_0x23f393){return _0x5a9922(_0x23f393);})[_0x13d0('0xc3')](function(_0x522c66){return _0x3aeb8f(msgResponse(_0x13d0('0x1fb'),_0x13d0('0x152'),JSON[_0x13d0('0x145')](_0x522c66)));});}if(_0x9bc516[_0x13d0('0x1ea')]===_0x13d0('0x1f8')){return _0xfd7970['getVoiceQueueRtPauses'](_0x9bc516['id'])['then'](function(_0x51650d){var _0x455ee8=_0x9bc516['loggedIn']-_0x51650d[0x0][_0x13d0('0x1fc')];var _0x28451a=_0x9bc516['dialPredictiveInterval']*0x3c;var _0x3d2702=_0x31b772[0x0][_0x13d0('0x74')]+_0x31b772[0x0][_0x13d0('0x73')];var _0x9d14cb=(_0x31b772[0x0][_0x13d0('0x72')]+_0x31b772[0x0][_0x13d0('0x88')]+_0x31b772[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x31b772[0x0][_0x13d0('0x86')];var _0x5b654b=_0x9bc516['dialPredictiveOptimizationPercentage']/0x64;_0x9bc516[_0x13d0('0x79')]=_0x51650d[0x0]['outboundQueuePauses']||0x0;_0x9bc516['predictiveIntervalHitRate']=_0x9d14cb>0x0?_0x9d14cb:0x1;return _0xfd7970['busyFactor'](_0x455ee8,_0x28451a,_0x3d2702,_0x9d14cb,_0x5b654b);})[_0x13d0('0x42')](function(_0x298a17){return _0x5a9922(_0x298a17);})[_0x13d0('0xc3')](function(_0x2e7efb){return _0x3aeb8f(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x2e7efb)));});}}else{return _0x3aeb8f(msgResponse(_0x13d0('0x1fa'),_0x13d0('0x152'),_0x13d0('0x1fd')));}});};};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f1')]=function(_0xad5784){var _0x270e96=this;return function(){var _0x398f88=0x0;var _0x14a369=Math[_0x13d0('0x1e5')](_0xad5784[_0x13d0('0x1fe')]*0x3e8);if(_0x14a369>0x0){_0x14a369=_0x14a369<0x64?0x64:_0x14a369;loggerPredictive['info'](_0xad5784[_0x13d0('0x48')],_0x13d0('0x1ff'),_0x14a369,_0x13d0('0x50'));_0xad5784[_0x13d0('0x97')]=setInterval(function(){_0x270e96[_0x13d0('0x97')](_0xad5784);loggerPredictiveCalls[_0x13d0('0x84')]('[handlePredictive]',_0x398f88+=0x1);},_0x14a369);}else{loggerPredictive['info'](_0xad5784[_0x13d0('0x48')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x13d0('0x200')]=function(_0x3d8e16,_0x4d790b){var _0x18cca5=this;return function(_0x4e7546){if(_[_0x13d0('0x4d')](_0x4e7546)){if(_['isNil'](_0x4d790b[_0x13d0('0xe3')])||!_0x4d790b[_0x13d0('0x201')]){if(_0x3d8e16[_0x13d0('0x63')]===_0x13d0('0x7')){_0x3d8e16[_0x13d0('0x13a')]=_['isUndefined'](_0x3d8e16[_0x13d0('0x13a')])?!![]:_0x3d8e16[_0x13d0('0x13a')];var _0x4bd823=uuid['v4']();_0x18cca5[_0x13d0('0xb6')][_0x4bd823]=new Action(_0x3d8e16,_0x4d790b,_0x4bd823);loggerBooked[_0x13d0('0x84')](_0x13d0('0x202'),_0x4bd823,'queueStatusComplete:\x20',JSON[_0x13d0('0x145')](_0x3d8e16[_0x13d0('0x13a')]),_0x13d0('0x203'),_0x3d8e16['name']);if(_0x3d8e16[_0x13d0('0x13a')]){_0x3d8e16[_0x13d0('0x13a')]=![];_0x18cca5[_0x13d0('0x2b')][_0x18cca5['actions'][_0x4bd823][_0x13d0('0xbd')]]=[];ami[_0x13d0('0x15a')]({'actionid':_0x4bd823,'action':'queuestatus','queue':_0x3d8e16[_0x13d0('0x48')]})[_0x13d0('0xc3')](function(){_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);_0x18cca5[_0x13d0('0xd0')]({'active':![],'ContactId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823]['ContactId'],'ListId':_0x18cca5['actions'][_0x4bd823]['ListId'],'VoiceQueueId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe4')]||undefined,'CampaignId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x204')));delete _0x18cca5['actions'][_0x4bd823];});}else{loggerBooked[_0x13d0('0x84')](_0x13d0('0x205'),JSON['stringify'](_0x3d8e16['queueStatusComplete']),_0x13d0('0x203'),_0x3d8e16[_0x13d0('0x48')]);_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);_0x18cca5[_0x13d0('0xd0')]({'active':![],'ContactId':_0x18cca5['actions'][_0x4bd823][_0x13d0('0xe2')],'ListId':_0x18cca5['actions'][_0x4bd823][_0x13d0('0x10b')],'VoiceQueueId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe4')]||undefined,'CampaignId':_0x18cca5[_0x13d0('0xb6')][_0x4bd823][_0x13d0('0xe5')]||undefined})['catch'](loggerCatch(_0x13d0('0x204')));delete _0x18cca5['actions'][_0x4bd823];}}else{return _0x18cca5[_0x13d0('0x181')](_0x3d8e16,_0x4d790b);}}else{if(getDiff(_0x4d790b[_0x13d0('0x206')])<_0x3d8e16['dialRecallMeTimeout']*0x3c){if(_0x4d790b[_0x13d0('0x16f')]&&!_0x4d790b[_0x13d0('0x16f')][_0x13d0('0x207')]){_0x18cca5[_0x13d0('0x1f')][_0x13d0('0x13d')](_0x4d790b['id'])['finally'](function(){_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);});}else{_0x18cca5[_0x13d0('0xd1')]({'active':![]},_0x4d790b['id'],0x1)['finally'](function(){_0x18cca5[_0x13d0('0xbf')](_0x3d8e16);});}}else{_0x3d8e16[_0x13d0('0x208')]+=0x1;_0x18cca5['updateOriginated'](_0x3d8e16);if(_0x3d8e16[_0x13d0('0x209')]){_0x18cca5[_0x13d0('0xd0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d790b[_0x13d0('0xe2')],'ListId':_0x4d790b['ListId'],'VoiceQueueId':_0x4d790b['VoiceQueueId']||undefined,'CampaignId':_0x4d790b[_0x13d0('0xe5')]||undefined})[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x20a')));_0x18cca5[_0x13d0('0xeb')](createObjHistory(_0x3d8e16,_0x4d790b,'RECALLINQUEUE',0x17,_0x13d0('0x20b')))[_0x13d0('0xc3')](loggerCatch(_0x13d0('0x20c')));}else{_0x18cca5[_0x13d0('0xe0')](createObjHistory(_0x3d8e16,_0x4d790b,_0x13d0('0x20d'),0x16,_0x13d0('0x20e')),_0x13d0('0x20f'),_0x13d0('0x210'));}}}}else{_0x3d8e16['outboundBlacklistCallsDay']+=0x1;_0x18cca5[_0x13d0('0xe0')](createObjHistory(_0x3d8e16,_0x4d790b,_0x13d0('0x211'),0xd,_0x13d0('0x212')),_0x13d0('0x213'),_0x13d0('0x214'));throw _0x13d0('0x215');}};};Dialer[_0x13d0('0x1b')][_0x13d0('0x216')]=function(_0x32baf2){var _0x3c2053=this;var _0x187e8d=_0x32baf2[_0x13d0('0x217')]-_0x32baf2[_0x13d0('0xa0')]-_0x32baf2[_0x13d0('0xd4')];emitCampaignSummary(_0x32baf2);if(_0x187e8d>0x0){if(_0x187e8d>this[_0x13d0('0x24')]){_0x187e8d=this[_0x13d0('0x24')];}_0x32baf2[_0x13d0('0xd4')]+=_0x187e8d;this[_0x13d0('0xd6')](_0x32baf2['id'],_0x187e8d,_0x32baf2[_0x13d0('0x218')],_0x32baf2)[_0x13d0('0x42')](function(_0x2abd1c){_0x32baf2[_0x13d0('0xd4')]-=_0x187e8d;_0x32baf2[_0x13d0('0xd4')]=_0x32baf2[_0x13d0('0xd4')]>0x0?_0x32baf2[_0x13d0('0xd4')]:0x0;if(!checkContactEmpty(_0x2abd1c)){_0x32baf2[_0x13d0('0x45')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x13d0('0x84')](_0x13d0('0x219')+_0x32baf2[_0x13d0('0x48')]);}else{_0x32baf2['originated']+=_0x2abd1c['length'];_0x32baf2[_0x13d0('0x45')]=_0x13d0('0x21a');for(var _0xef6482=0x0;_0xef6482<_0x2abd1c[_0x13d0('0x9f')];_0xef6482+=0x1){_0x32baf2[_0x13d0('0x21b')]+=0x1;if(_['isNil'](_0x2abd1c[_0xef6482])||_[_0x13d0('0xb9')](_0x2abd1c[_0xef6482][_0x13d0('0x199')])||_[_0x13d0('0xb9')](_0x2abd1c[_0xef6482][_0x13d0('0x184')])){_0x3c2053['emptyContact'](_0x13d0('0x21c'),_0x32baf2,_0x2abd1c[_0xef6482]);}else{_0x3c2053['checkIsBlackListIvr'](_['pick'](_0x2abd1c[_0xef6482],[_0x13d0('0xe5'),_0x13d0('0x21d')]))[_0x13d0('0x42')](_0x3c2053[_0x13d0('0x200')](_0x32baf2,_0x2abd1c[_0xef6482]))[_0x13d0('0xc3')](_0x3c2053[_0x13d0('0xdd')](_0x13d0('0x21e'),_0x32baf2));}}}})[_0x13d0('0xc3')](loggerGetContactDialer(_0x13d0('0x21f'),_0x32baf2,_0x187e8d));}};Dialer[_0x13d0('0x1b')][_0x13d0('0x16a')]=function(_0x1976cc,_0x27e104){var _0x3eccb3=this;var _0x4ef7f2=[];var _0x42274b=_0x27e104>=0x1?_0x27e104:0x1;if(_0x1976cc[_0x13d0('0x63')]===_0x13d0('0x7')){_0x42274b=0x1;}var _0x2c1afd=Math['floor'](_0x1976cc[_0x13d0('0x58')]*_0x42274b)-_0x1976cc[_0x13d0('0xa0')]-_0x1976cc[_0x13d0('0xd4')];emitVoiceQueueSummary(_0x1976cc);if(_0x1976cc['dialLimitQueue']>0x0){var _0x31c178=_0x1976cc[_0x13d0('0x220')]-_0x1976cc[_0x13d0('0xa0')]-_0x1976cc[_0x13d0('0xaa')]-_0x1976cc[_0x13d0('0xd4')]-_0x1976cc['pTalking'];if(_0x2c1afd>_0x31c178){_0x2c1afd=_0x31c178;}}if(_0x2c1afd>0x0){if(_0x1976cc[_0x13d0('0x63')]===_0x13d0('0x7')){_0x2c1afd=0x1;}if(_0x2c1afd>this['maxNumberOriginate']){_0x2c1afd=this[_0x13d0('0x24')];}_0x1976cc[_0x13d0('0xd4')]+=_0x2c1afd;for(var _0x45b37c in this[_0x13d0('0x22')]){if(typeof this['agents'][_0x45b37c]!==_0x13d0('0xa1')){if(this[_0x13d0('0x22')][_0x45b37c][_0x13d0('0xb1')]===_0x13d0('0x221')&&this[_0x13d0('0x22')][_0x45b37c]['status']===_0x13d0('0x179')){_0x4ef7f2[_0x13d0('0x159')](this['agents'][_0x45b37c]['id']);}}}this['getContactDialer'](_0x1976cc['id'],_0x4ef7f2,_0x2c1afd,_0x1976cc[_0x13d0('0x218')],_0x1976cc)['then'](function(_0x17ba86){_0x1976cc[_0x13d0('0xd4')]-=_0x2c1afd;_0x1976cc[_0x13d0('0xd4')]=_0x1976cc[_0x13d0('0xd4')]>0x0?_0x1976cc['temp']:0x0;if(!checkContactEmpty(_0x17ba86)){_0x3eccb3['countReScheduled'](_0x1976cc)[_0x13d0('0x42')](sendMessageReschedule(_0x1976cc))[_0x13d0('0xc3')](loggerCatch('[countReScheduled]\x20'));}else{_0x1976cc['originated']+=_0x17ba86[_0x13d0('0x9f')];_0x1976cc['message']=_0x1976cc[_0x13d0('0x63')]===_0x13d0('0x7')?'ACTIVE':'RUNNING';for(var _0x565147=0x0;_0x565147<_0x17ba86['length'];_0x565147+=0x1){if(_['isNil'](_0x17ba86[_0x565147])||_['isNil'](_0x17ba86[_0x565147]['Contact'])||_[_0x13d0('0xb9')](_0x17ba86[_0x565147][_0x13d0('0x184')])){_0x3eccb3[_0x13d0('0xde')]('[actionOriginate]\x20',_0x1976cc,_0x17ba86[_0x565147]);}else{_0x3eccb3[_0x13d0('0xc5')](_[_0x13d0('0xe1')](_0x17ba86[_0x565147],[_0x13d0('0xe4'),_0x13d0('0x21d')]))[_0x13d0('0x42')](_0x3eccb3[_0x13d0('0x200')](_0x1976cc,_0x17ba86[_0x565147]))[_0x13d0('0xc3')](_0x3eccb3[_0x13d0('0xdd')](_0x13d0('0x21c'),_0x1976cc));}}}})[_0x13d0('0xc3')](loggerGetContactDialer(_0x13d0('0x222'),_0x1976cc,_0x2c1afd));}};Dialer[_0x13d0('0x1b')]['handlePredictive']=function(_0x431705){if(_0x431705[_0x13d0('0x220')]>0x0){var _0x2a50fe=_0x431705[_0x13d0('0x220')]-_0x431705[_0x13d0('0xa0')]-_0x431705['talking'];if(_0x2a50fe>0x0){this[_0x13d0('0x223')](_0x431705);}else{loggerPredictiveCalls[_0x13d0('0x84')](_0x13d0('0x224'));}}else{this['tryOriginatePredictive'](_0x431705);}};Dialer[_0x13d0('0x1b')][_0x13d0('0x223')]=function(_0x35a1d1){var _0x38a2f1=this;var _0x46f054=[];_0x35a1d1[_0x13d0('0xa0')]+=0x1;for(var _0xaf9af1 in this[_0x13d0('0x22')]){if(typeof this[_0x13d0('0x22')][_0xaf9af1]!=='undefined'){if(this[_0x13d0('0x22')][_0xaf9af1][_0x13d0('0xb1')]===_0x13d0('0x221')&&this[_0x13d0('0x22')][_0xaf9af1][_0x13d0('0xba')]===_0x13d0('0x179')){_0x46f054[_0x13d0('0x159')](this[_0x13d0('0x22')][_0xaf9af1]['id']);}}}this['getContactDialer'](_0x35a1d1['id'],_0x46f054,0x1,_0x35a1d1[_0x13d0('0x218')],_0x35a1d1)[_0x13d0('0x42')](function(_0x47ffcb){if(!checkContactEmpty(_0x47ffcb)){checkContactLowerLimitOriginate(_0x35a1d1,0x1,0x0);_0x38a2f1[_0x13d0('0xc2')](_0x35a1d1)[_0x13d0('0x42')](sendMessageReschedule(_0x35a1d1))[_0x13d0('0xc3')](loggerCatch('[countReScheduled]\x20'));}else{_0x35a1d1[_0x13d0('0x45')]='RUNNING';if(_[_0x13d0('0xb9')](_0x47ffcb[0x0])||_[_0x13d0('0xb9')](_0x47ffcb[0x0][_0x13d0('0x199')])||_['isNil'](_0x47ffcb[0x0][_0x13d0('0x184')])){_0x38a2f1[_0x13d0('0xde')](_0x13d0('0x21c'),_0x35a1d1,_0x47ffcb[0x0]);}else{_0x38a2f1[_0x13d0('0xc5')](_[_0x13d0('0xe1')](_0x47ffcb[0x0],['VoiceQueueId',_0x13d0('0x21d')]))[_0x13d0('0x42')](_0x38a2f1[_0x13d0('0x200')](_0x35a1d1,_0x47ffcb[0x0]))[_0x13d0('0xc3')](_0x38a2f1[_0x13d0('0xdd')](_0x13d0('0x225'),_0x35a1d1));}}})['catch'](loggerGetContactDialer(_0x13d0('0x226'),_0x35a1d1,0x1));emitVoiceQueueSummary(_0x35a1d1);};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f7')]=function(_0x3ef584,_0x389d35,_0x5bfc40,_0x5969f6,_0x142b1a,_0x7d8551){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x13d0('0x84')](_0x13d0('0x227'),_0x3ef584);loggerPredictive[_0x13d0('0x84')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x389d35);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x228'),_0x5bfc40);loggerPredictive[_0x13d0('0x84')]('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',_0x5969f6);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x229'),_0x142b1a);loggerPredictive[_0x13d0('0x84')]('---------------------------');return new Promise(function(_0x4e7617,_0x51c2e2){if(_0x3ef584<=0x0||isNaN(_0x3ef584)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22b')+_0x3ef584));}if(_0x5bfc40<=0x0||isNaN(_0x5bfc40)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22c')+_0x5bfc40));}if(_0x5969f6<=0x0||isNaN(_0x5969f6)){return _0x51c2e2(msgResponse('[abandonmentRate]',_0x13d0('0x1aa'),'p\x20=\x20'+_0x5969f6));}if(_0x389d35<=0x0||isNaN(_0x389d35)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22d')+_0x389d35));}if(_0x142b1a<=0x0||isNaN(_0x142b1a)){return _0x51c2e2(msgResponse(_0x13d0('0x22a'),_0x13d0('0x1aa'),_0x13d0('0x22e')+_0x142b1a));}_0x7d8551=_0x7d8551||0x0;var _0x576092=0x1/_0x5bfc40;var _0x56bc42=0x0;var _0x41bd0b=0x0;var _0x40cbbe=0x0;var _0x3151eb=0x0;for(var _0x58b495=0x0;_0x40cbbe<_0x142b1a;_0x58b495+=0x1){_0x41bd0b=_0x58b495/_0x389d35;_0x56bc42=(_0x5969f6*_0x41bd0b+_0x7d8551)/_0x576092;_0x40cbbe=erlangb(_0x56bc42,_0x3ef584);_0x3151eb=_0x56bc42/_0x3ef584*(0x1-erlangb(_0x56bc42,_0x3ef584));}return _0x4e7617({'erlangCalls':_0x58b495,'erlangCallToSecond':_0x389d35/_0x58b495,'erlangAbandonmentRate':_0x40cbbe,'erlangBusyFactor':_0x3151eb});});};Dialer[_0x13d0('0x1b')][_0x13d0('0x1f9')]=function(_0x8acd8c,_0x18c5e2,_0xb26e47,_0x3fbbb3,_0x4c07af,_0x31881d){loggerPredictive['info'](_0x13d0('0x22f'));loggerPredictive[_0x13d0('0x84')](_0x13d0('0x227'),_0x8acd8c);loggerPredictive['info'](_0x13d0('0x230'),_0x18c5e2);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x228'),_0xb26e47);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x231'),_0x3fbbb3);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x232'),_0x4c07af);loggerPredictive[_0x13d0('0x84')](_0x13d0('0x94'));return new Promise(function(_0x54fb1b,_0xc62303){if(_0x8acd8c<=0x0||isNaN(_0x8acd8c)){return _0xc62303(msgResponse(_0x13d0('0x233'),'Error',_0x13d0('0x22b')+_0x8acd8c));}if(_0xb26e47<=0x0||isNaN(_0xb26e47)){return _0xc62303(msgResponse('[busyFactor]',_0x13d0('0x1aa'),_0x13d0('0x22c')+_0xb26e47));}if(_0x3fbbb3<=0x0||isNaN(_0x3fbbb3)){return _0xc62303(msgResponse('[busyFactor]',_0x13d0('0x1aa'),_0x13d0('0x234')+_0x3fbbb3));}if(_0x18c5e2<=0x0||isNaN(_0x18c5e2)){return _0xc62303(msgResponse('[busyFactor]',_0x13d0('0x1aa'),'interval\x20=\x20'+_0x18c5e2));}if(_0x4c07af<=0x0||isNaN(_0x4c07af)){return _0xc62303(msgResponse('[busyFactor]','Error',_0x13d0('0x235')+_0x4c07af));}_0x31881d=_0x31881d||0x0;var _0x231084=0x1/_0xb26e47;var _0x5286be=0x0;var _0x21e297=0x0;var _0x18907c=0x0;var _0x119479=0x0;for(var _0x2ecaa1=0x0;_0x119479<_0x4c07af;_0x2ecaa1+=0x1){_0x21e297=_0x2ecaa1/_0x18c5e2;_0x5286be=(_0x3fbbb3*_0x21e297+_0x31881d)/_0x231084;_0x18907c=erlangb(_0x5286be,_0x8acd8c);_0x119479=_0x5286be/_0x8acd8c*(0x1-erlangb(_0x5286be,_0x8acd8c));}return _0x54fb1b({'erlangCalls':_0x2ecaa1,'erlangCallToSecond':_0x18c5e2/_0x2ecaa1,'erlangAbandonmentRate':_0x18907c,'erlangBusyFactor':_0x119479});});};module[_0x13d0('0x236')]=Dialer; \ No newline at end of file +var _0xf6ca=['ivrAnswerCallsDay','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','queueBooked','push','pick','idHopper','paused','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','indexOf','true','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','dialPreviewRecallmeReminder','filter','online','map','Agent','checkPreviewRecallReminder','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','countnosuchnumberretry','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','predictiveIntervalTotalCalls','outboundQueuePauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete','[booked][checkContactBlack]','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','maxNumberOriginate','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','tryOriginatePredictive','not_inuse','loggerHandler','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','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','Umin:\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','p\x20=\x20','exports','util','lodash','uuid','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','available','loggedIn','pTalking','sumDuration','sumHoldTime','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','originated','undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','loopClearZombieChannels','uniqueId','clearZombieChannels','isNil','Action','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','catch','[verifyAdditionalPhone]\x20','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','status','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','uniqueid','membername','emit','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','countglobal','custom:amd','buildObj','countcongestionretry','countnoanswerretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','VoiceQueueId','dialAMDActive','HangupInAMD','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countbusyretry','countabandonedretry','reason19\x20machine....','dialMachineRetryFrequency'];(function(_0x279f6d,_0x122316){var _0x5874a5=function(_0x4823ae){while(--_0x4823ae){_0x279f6d['push'](_0x279f6d['shift']());}};_0x5874a5(++_0x122316);}(_0xf6ca,0x122));var _0xaf6c=function(_0x51a6e4,_0x1dbcee){_0x51a6e4=_0x51a6e4-0x0;var _0xbed624=_0xf6ca[_0x51a6e4];return _0xbed624;};'use strict';var util=require(_0xaf6c('0x0'));var _=require(_0xaf6c('0x1'));var uuid=require(_0xaf6c('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0xaf6c('0x3'));var config=require(_0xaf6c('0x4'));var logger=require(_0xaf6c('0x5'))(_0xaf6c('0x6'));var loggerBooked=require(_0xaf6c('0x5'))(_0xaf6c('0x7'));var loggerPredictive=require(_0xaf6c('0x5'))(_0xaf6c('0x8'));var loggerPredictiveCalls=require(_0xaf6c('0x5'))(_0xaf6c('0x9'));var loggerSyncQueueSummary=require(_0xaf6c('0x5'))(_0xaf6c('0xa'));var ami=require(_0xaf6c('0xb'));config[_0xaf6c('0xc')]=_[_0xaf6c('0xd')](config[_0xaf6c('0xc')],{'host':_0xaf6c('0xe'),'port':0x18eb});var io=require(_0xaf6c('0xf'))(new Redis(config[_0xaf6c('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xaf6c('0x10'));var cmHopperAdditionalPhone=require(_0xaf6c('0x11'));var cmHopperBlack=require(_0xaf6c('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0xaf6c('0x13'));var History=require(_0xaf6c('0x14'));var Final=require(_0xaf6c('0x15'));var AgentComplete=require(_0xaf6c('0x16'));var QueueCallerAbandon=require(_0xaf6c('0x17'));var Hangup=require(_0xaf6c('0x18'));var ipAgi=process[_0xaf6c('0x19')][_0xaf6c('0x1a')]||'127.0.0.1';var strategy={'rrmemory':_0xaf6c('0x1b'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xaf6c('0x1c')][_0xaf6c('0x1d')]=function(_0x5347f1){this[_0xaf6c('0x1e')]=this[_0xaf6c('0x1e')]?this[_0xaf6c('0x1e')]['finally'](_0x5347f1):_0x5347f1();};function Dialer(_0x494c12,_0x4c719d){this[_0xaf6c('0x1f')]=new Sequence();this['preview']=_0x4c719d;this[_0xaf6c('0x20')]=_0x494c12['voiceQueues'];this[_0xaf6c('0x21')]=_0x494c12[_0xaf6c('0x21')];this[_0xaf6c('0x22')]=_0x494c12['agents'];this[_0xaf6c('0x23')]=_0x494c12[_0xaf6c('0x23')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0xaf6c('0x24')]={};this[_0xaf6c('0x25')]={};this[_0xaf6c('0x26')]={};this['uniqueId']={};this[_0xaf6c('0x27')]={};this[_0xaf6c('0x28')]={};this[_0xaf6c('0x29')]={};this[_0xaf6c('0x2a')]={};this['queueBooked']={};this[_0xaf6c('0x2b')]={};ami['on']('agentconnect',this[_0xaf6c('0x2c')][_0xaf6c('0x2d')](this));ami['on'](_0xaf6c('0x2e'),this[_0xaf6c('0x2f')][_0xaf6c('0x2d')](this));ami['on'](_0xaf6c('0x30'),this['syncOriginateResponse'][_0xaf6c('0x2d')](this));ami['on'](_0xaf6c('0x31'),this[_0xaf6c('0x32')][_0xaf6c('0x2d')](this));ami['on'](_0xaf6c('0x33'),this[_0xaf6c('0xa')]['bind'](this));ami['on'](_0xaf6c('0x34'),this[_0xaf6c('0x35')][_0xaf6c('0x2d')](this));ami['on'](_0xaf6c('0x36'),this[_0xaf6c('0x37')][_0xaf6c('0x2d')](this));ami['on']('newexten',this[_0xaf6c('0x38')][_0xaf6c('0x2d')](this));ami['on'](_0xaf6c('0x39'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0xaf6c('0x3a')][_0xaf6c('0x2d')](this));ami['on'](_0xaf6c('0x3b'),this[_0xaf6c('0x3c')][_0xaf6c('0x2d')](this));this[_0xaf6c('0x3d')]();this['loopClearZombieChannels']();RpcSetting[_0xaf6c('0x3e')]()[_0xaf6c('0x3f')](function(_0x39371a){previewRecallmeReminderInterval=_0x39371a[_0xaf6c('0x40')];});}function isNotNull(_0x22adcf){return _0x22adcf!==null&&!_[_0xaf6c('0x41')](_0x22adcf);}function checkIsLoggedIn(_0xbb4da6,_0x5c682a){return function(){if(_0x5c682a<=0x0){_0xbb4da6[_0xaf6c('0x42')]=_0xaf6c('0x43');throw _0xbb4da6[_0xaf6c('0x44')]+_0xaf6c('0x45');}};}function isActive(_0x55ec67){return _0x55ec67;}function checkIsActive(_0x4ac424,_0x2bccc6){return function(){if(!isActive(_0x2bccc6)){_0x4ac424[_0xaf6c('0x42')]=_0xaf6c('0x46');throw _0x4ac424[_0xaf6c('0x44')]+_0xaf6c('0x47');}};}function checkInterval(_0x3f2fb7){return function(){if(!isNotNull(_0x3f2fb7[_0xaf6c('0x48')])){_0x3f2fb7[_0xaf6c('0x42')]='INTERVAL_IS_NULL';throw _0x3f2fb7[_0xaf6c('0x44')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3f2fb7[_0xaf6c('0x48')][_0xaf6c('0x49')])){_0x3f2fb7[_0xaf6c('0x42')]=_0xaf6c('0x4a');throw _0x3f2fb7[_0xaf6c('0x44')]+_0xaf6c('0x4b');}if(!isNotNull(_[_0xaf6c('0x4c')](_0x3f2fb7[_0xaf6c('0x48')][_0xaf6c('0x49')]))){_0x3f2fb7[_0xaf6c('0x42')]=_0xaf6c('0x4a');throw _0x3f2fb7[_0xaf6c('0x44')]+_0xaf6c('0x4b');}};}function msgResponse(_0x48c46e,_0x3fffb9,_0x10b371){return{'action':_0x48c46e,'response':_0x3fffb9,'message':_0x10b371,'stack':_0x10b371};}function myreject(_0x2c45d1){return function(_0x15ef3c){return _0x2c45d1(msgResponse('[ifTime][Action]',_0xaf6c('0x4d'),JSON[_0xaf6c('0x4e')](_0x15ef3c)));};}function getSeconds(_0x3c872e,_0x3e8c29){var _0x138ac1=moment(_0x3c872e)[_0xaf6c('0x4f')](0x0);var _0x109cd6=moment(_0x3e8c29)['milliseconds'](0x0);return _0x138ac1[_0xaf6c('0x50')](_0x109cd6,_0xaf6c('0x51'));}function emit(_0x1f01db,_0x1072b3,_0x3b21e6){io['to'](_0x1f01db)['emit'](_0x1072b3,_0x3b21e6);}function emitVoiceQueueSummary(_0x3429e2){if(_0x3429e2[_0xaf6c('0x52')]===_0xaf6c('0x53')){var _0x51a8ad={'id':_0x3429e2['id'],'name':_0x3429e2['name'],'strategy':_0x3429e2[_0xaf6c('0x54')],'answered':_0x3429e2['answered'],'available':_0x3429e2[_0xaf6c('0x55')],'loggedIn':_0x3429e2[_0xaf6c('0x56')],'pTalking':_0x3429e2[_0xaf6c('0x57')],'sumBillable':_0x3429e2['sumBillable'],'sumDuration':_0x3429e2[_0xaf6c('0x58')],'sumHoldTime':_0x3429e2[_0xaf6c('0x59')]||0x0,'talking':_0x3429e2['talking'],'total':_0x3429e2['total'],'type':_0x3429e2[_0xaf6c('0x52')],'unmanaged':_0x3429e2[_0xaf6c('0x5a')],'abandoned':_0x3429e2[_0xaf6c('0x5b')],'waiting':_0x3429e2['waiting'],'loggedInDb':_0x3429e2[_0xaf6c('0x5c')],'dialActive':_0x3429e2[_0xaf6c('0x5d')],'dialMethod':_0x3429e2[_0xaf6c('0x5e')],'dialOriginateCallerIdName':_0x3429e2[_0xaf6c('0x5f')],'dialOriginateCallerIdNumber':_0x3429e2['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3429e2[_0xaf6c('0x60')],'dialPrefix':_0x3429e2[_0xaf6c('0x61')],'outboundAnswerAgiCallsDay':_0x3429e2[_0xaf6c('0x62')],'outboundAnswerCallsDay':_0x3429e2[_0xaf6c('0x63')],'outboundBlacklistCallsDay':_0x3429e2['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3429e2[_0xaf6c('0x64')],'outboundCongestionCallsDay':_0x3429e2[_0xaf6c('0x65')],'outboundDropCallsDayACS':_0x3429e2[_0xaf6c('0x66')],'outboundDropCallsDayCallersExit':_0x3429e2[_0xaf6c('0x67')],'outboundDropCallsDayTimeout':_0x3429e2['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3429e2[_0xaf6c('0x68')],'outboundNoSuchCallsDay':_0x3429e2[_0xaf6c('0x69')],'outboundOriginateFailureCallsDay':_0x3429e2[_0xaf6c('0x6a')],'outboundReCallsDay':_0x3429e2['outboundReCallsDay'],'outboundRejectCallsDay':_0x3429e2[_0xaf6c('0x6b')],'outboundUnknownCallsDay':_0x3429e2[_0xaf6c('0x6c')],'predictiveIntervalAnsweredCalls':_0x3429e2[_0xaf6c('0x6d')],'predictiveIntervalAvgHoldtime':_0x3429e2['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3429e2[_0xaf6c('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x3429e2[_0xaf6c('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x3429e2['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3429e2[_0xaf6c('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x3429e2['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3429e2[_0xaf6c('0x71')],'predictiveIntervalMultiplicativeFactor':_0x3429e2[_0xaf6c('0x72')],'predictiveIntervalPauses':_0x3429e2[_0xaf6c('0x73')],'predictiveIntervalAvailable':_0x3429e2[_0xaf6c('0x74')],'predictiveIntervalTotalCalls':_0x3429e2['predictiveIntervalTotalCalls'],'message':_0x3429e2[_0xaf6c('0x42')],'originated':_0x3429e2['originated'],'erlangCalls':_0x3429e2['erlangCalls'],'erlangCallToSecond':_0x3429e2['erlangCallToSecond'],'erlangAbandonmentRate':_0x3429e2[_0xaf6c('0x75')],'erlangBusyFactor':_0x3429e2[_0xaf6c('0x76')],'startPredictive':_0x3429e2[_0xaf6c('0x28')],'startProgressive':_0x3429e2[_0xaf6c('0x29')]};if(_0x3429e2[_0xaf6c('0x77')]){_0x51a8ad[_0xaf6c('0x77')]={'id':_0x3429e2[_0xaf6c('0x77')]['id'],'name':_0x3429e2[_0xaf6c('0x77')][_0xaf6c('0x44')],'active':_0x3429e2[_0xaf6c('0x77')][_0xaf6c('0x78')],'callerid':_0x3429e2[_0xaf6c('0x77')][_0xaf6c('0x79')]};}if(_0x3429e2[_0xaf6c('0x48')]){_0x51a8ad[_0xaf6c('0x48')]={'id':_0x3429e2[_0xaf6c('0x48')]['id'],'name':_0x3429e2[_0xaf6c('0x48')][_0xaf6c('0x44')]};}var _0x230a35=md5(JSON[_0xaf6c('0x4e')](_0x51a8ad));if(_0x3429e2[_0xaf6c('0x7a')]!==_0x230a35){_0x3429e2[_0xaf6c('0x7a')]=_0x230a35;emit(util['format'](_0xaf6c('0x7b'),_0x51a8ad[_0xaf6c('0x44')]),_0xaf6c('0x7c'),_0x51a8ad);}}}function emitCampaignSummary(_0x184292){if(_0x184292[_0xaf6c('0x52')]===_0xaf6c('0x7d')){emit(util[_0xaf6c('0x7e')](_0xaf6c('0x7f'),_0x184292[_0xaf6c('0x44')]),_0xaf6c('0x80'),_0x184292);}}function checkGetDataPredictive(_0x2cda1c){if(isNotNull(_0x2cda1c)&&!_[_0xaf6c('0x4c')](_0x2cda1c)){loggerPredictive['info'](_0xaf6c('0x81'));loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x83'),_0x2cda1c['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0xaf6c('0x84'),_0x2cda1c[_0xaf6c('0x6d')]);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x85'),_0x2cda1c[_0xaf6c('0x86')]);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x87'),_0x2cda1c[_0xaf6c('0x6f')]);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x88'),_0x2cda1c['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xaf6c('0x82')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2cda1c[_0xaf6c('0x6e')]);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x89'));if(_0x2cda1c['predictiveIntervalTotalCalls']>0x0){if(!_[_0xaf6c('0x41')](_0x2cda1c[_0xaf6c('0x6e')])&&_0x2cda1c[_0xaf6c('0x6e')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xaf6c('0x41')](_0x2cda1c['predictiveIntervalAvgHoldtime'])&&_0x2cda1c[_0xaf6c('0x8a')]>0x0){return!![];}loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x8b'));}else{loggerPredictive[_0xaf6c('0x82')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x8c'));}return![];}function mergeDataErlangB(_0xfaf4d1){return function(_0x57c857){loggerPredictive[_0xaf6c('0x82')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x8d'),_0x57c857[_0xaf6c('0x8e')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57c857['erlangCallToSecond']);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x8f'),_0x57c857[_0xaf6c('0x75')]);loggerPredictive[_0xaf6c('0x82')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57c857[_0xaf6c('0x76')]);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x8f'),_0x57c857[_0xaf6c('0x75')]);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x89'));_[_0xaf6c('0x90')](_0xfaf4d1,_0x57c857);};}function getDiff(_0x463a10){var _0x1b997a=moment()[_0xaf6c('0x4f')](0x0);var _0x15ac92=moment(_0x463a10)[_0xaf6c('0x4f')](0x0);return _0x1b997a['diff'](_0x15ac92,_0xaf6c('0x51'));}function ifInterval(_0x4c0ccf,_0x23c037){if(_[_0xaf6c('0x41')](_0x23c037)){return![];}return getDiff(_0x23c037)<_0x4c0ccf*0x3c;}function freeVariablesPredictive(_0x125b70){if(isNotNull(_0x125b70)){if(!_['isUndefined'](_0x125b70[_0xaf6c('0x29')])){_0x125b70['startProgressive']=undefined;loggerPredictive[_0xaf6c('0x82')](_0x125b70['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xaf6c('0x41')](_0x125b70[_0xaf6c('0x28')])){_0x125b70[_0xaf6c('0x28')]=undefined;loggerPredictive[_0xaf6c('0x82')](_0x125b70[_0xaf6c('0x44')],_0xaf6c('0x91'));}if(!_['isUndefined'](_0x125b70[_0xaf6c('0x92')])){clearInterval(_0x125b70[_0xaf6c('0x92')]);_0x125b70[_0xaf6c('0x92')]=undefined;loggerPredictive[_0xaf6c('0x82')](_0x125b70[_0xaf6c('0x44')],_0xaf6c('0x93'));}}}function erlangb(_0x1364e5,_0x17a7d9){if(_0x17a7d9===0x0){return 0x0;}var _0x6ff22=0x1;for(var _0x549a5b=0x1;_0x549a5b<=_0x17a7d9;_0x549a5b+=0x1){_0x6ff22=0x1+_0x6ff22*_0x549a5b/_0x1364e5;}return 0x1/_0x6ff22;}function isVoiceQueueOutbound(_0x34d96d){return _0x34d96d===_0xaf6c('0x53');}function isNotPreview(_0x59d14d){return _0x59d14d!==_0xaf6c('0x94');}function isCampaignIvr(_0x4dd9c9){return _0x4dd9c9===_0xaf6c('0x7d');}function getCallerId(_0x3e03e4,_0x2060d7,_0xafe530){if(!_[_0xaf6c('0x41')](_0xafe530)&&typeof _0xafe530===_0xaf6c('0x95')&&!_[_0xaf6c('0x4c')](_0xafe530)){if(!_['isUndefined'](_0x2060d7)&&typeof _0x2060d7==='string'&&!_[_0xaf6c('0x4c')](_0x2060d7)){return util[_0xaf6c('0x7e')](_0xaf6c('0x96'),_0x2060d7,_0xafe530);}return util[_0xaf6c('0x7e')](_0xaf6c('0x96'),_0xafe530,_0xafe530);}if(!_[_0xaf6c('0x41')](_0x3e03e4)&&typeof _0x3e03e4===_0xaf6c('0x95')&&!_[_0xaf6c('0x4c')](_0x3e03e4)){return _0x3e03e4;}return _0xaf6c('0x97');}function loggerCatchQueueSummary(_0x410f8d,_0x41ec00){return function(_0x26f546){freeVariablesPredictive(_0x41ec00);emitVoiceQueueSummary(_0x41ec00);emitCampaignSummary(_0x41ec00);loggerSyncQueueSummary[_0xaf6c('0x98')](_0x410f8d,util[_0xaf6c('0x99')](_0x26f546,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x542d12,_0x3715f0){return function(_0xf30438){loggerPredictive[_0xaf6c('0x9a')](_0x3715f0[_0xaf6c('0x44')],_0x542d12);loggerPredictive[_0xaf6c('0x9a')](_0xf30438[_0xaf6c('0x9b')]);freeVariablesPredictive(_0x3715f0);};}function loggerCatch(_0x3e1bd6){return function(_0x25af41){logger[_0xaf6c('0x9a')](_0x3e1bd6,util[_0xaf6c('0x99')](_0x25af41,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xecb926){return _0xecb926&&!_[_0xaf6c('0x41')](_0xecb926)&&_0xecb926[_0xaf6c('0x9c')]>0x0;}function decremetOriginate(_0x32a15d){if(!_['isUndefined'](_0x32a15d)&&_0x32a15d!==null){if(typeof _0x32a15d[_0xaf6c('0x9d')]!==_0xaf6c('0x9e')){if(_0x32a15d['originated']>0x0){_0x32a15d['originated']-=0x1;}else{logger[_0xaf6c('0x9a')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x28b6b3,_0xcf87b2,_0x3a5869){if(_0xcf87b2>_0x3a5869){for(var _0x2b5d4a=0x0;_0x2b5d4a<_0xcf87b2-_0x3a5869;_0x2b5d4a+=0x1){decremetOriginate(_0x28b6b3);}}}function loggerGetContactDialer(_0x37c87a,_0xc7614c,_0x4c5671){return function(_0xc88fd7){checkContactLowerLimitOriginate(_0xc7614c,_0x4c5671,0x0);logger['error'](_0x37c87a,util['inspect'](_0xc88fd7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5a9315){return function(_0x35997c){if(isNotNull(_0x35997c)&&isNotNull(_0x35997c[0x0])){if(_0x35997c[0x0][_0xaf6c('0x9f')]>0x0){_0x5a9315[_0xaf6c('0x42')]=_0xaf6c('0xa0');logger['info'](_0xaf6c('0xa1')+_0x5a9315[_0xaf6c('0x44')],_0x35997c[0x0][_0xaf6c('0x9f')],_0xaf6c('0xa2'));}else{_0x5a9315['message']=_0xaf6c('0xa3');logger[_0xaf6c('0x82')](_0xaf6c('0xa4')+_0x5a9315[_0xaf6c('0x44')]);}}};}function notSendMessagesQueue(_0x28090c){if(_0x28090c[_0xaf6c('0xa5')]){freeVariablesPredictive(_0x28090c);if(_0x28090c['originated']===0x0&&_0x28090c['talking']===0x0&&_0x28090c[_0xaf6c('0xa6')]===0x0&&(_0x28090c[_0xaf6c('0x57')]||0x0)===0x0){_0x28090c['sendMessageOneNotActive']=![];_0x28090c[_0xaf6c('0x55')]=0x0;_0x28090c[_0xaf6c('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary['debug'](_0xaf6c('0xa7'),_0x28090c[_0xaf6c('0x44')],_0xaf6c('0xa8'));}else{_0x28090c[_0xaf6c('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xaf6c('0x98')](_0xaf6c('0xa7'),_0x28090c[_0xaf6c('0x44')],_0xaf6c('0xa9'));}emitVoiceQueueSummary(_0x28090c);}}function notSendMessagesCampaign(_0x18ce4f){if(_0x18ce4f[_0xaf6c('0xa5')]){if(_0x18ce4f['originated']===0x0){_0x18ce4f[_0xaf6c('0xa5')]=![];_0x18ce4f[_0xaf6c('0x42')]=_0xaf6c('0x46');loggerSyncQueueSummary['debug'](_0xaf6c('0xaa'),_0x18ce4f['name'],'is\x20not\x20active');}else{_0x18ce4f[_0xaf6c('0x42')]=_0xaf6c('0xab');loggerSyncQueueSummary[_0xaf6c('0x98')](_0xaf6c('0xaa'),_0x18ce4f[_0xaf6c('0x44')],'is\x20disactive');}emitCampaignSummary(_0x18ce4f);}}function createObjHistory(_0x5c80e0,_0x3d50c5,_0xe007d3,_0x1d46ea,_0x2d13f3){_0x5c80e0[_0xaf6c('0x42')]=_0xe007d3;var _0x392ee1=new Action(_0x5c80e0,_0x3d50c5);var _0x32dd1f=new History(_0x392ee1);_0x32dd1f[_0xaf6c('0xac')]=_0x1d46ea;_0x32dd1f[_0xaf6c('0xad')]=_0x2d13f3;_0x32dd1f[_0xaf6c('0xae')]=_0x392ee1[_0xaf6c('0xaf')];return _0x32dd1f;}Dialer[_0xaf6c('0x1c')][_0xaf6c('0xb0')]=function(){var _0x12c962=this;setInterval(function(){_0x12c962['clearZombieChannels'](_0x12c962[_0xaf6c('0xb1')],'[uniqueid]');_0x12c962['clearZombieChannels'](_0x12c962[_0xaf6c('0x25')],'[actions]');},0x32c8);};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xb2')]=function(_0x1fd1d0,_0x546719){var _0x3a1d96=this;for(var _0xb5e758 in _0x1fd1d0){if(typeof _0x1fd1d0[_0xb5e758]!==_0xaf6c('0x9e')){this[_0xaf6c('0x1f')][_0xaf6c('0x1d')](function(){if(!_[_0xaf6c('0xb3')](_0x1fd1d0[_0xb5e758])){return ami[_0xaf6c('0xb4')]({'action':'status','channel':_0x1fd1d0[_0xb5e758][_0xaf6c('0xb5')]})['catch'](function(_0x32616b){if(_0x32616b[_0xaf6c('0x42')]===_0xaf6c('0xb6')){setTimeout(function(){if(_0x1fd1d0[_0xb5e758]&&_0x1fd1d0[_0xb5e758][_0xaf6c('0x52')]!==_0xaf6c('0x7d')){_0x3a1d96['updateOriginated'](_0x3a1d96[_0xaf6c('0x20')][_0x1fd1d0[_0xb5e758][_0xaf6c('0xb7')]]);logger[_0xaf6c('0x9a')](_0xaf6c('0xb8'),_0x546719,_0xb5e758,_0x1fd1d0[_0xb5e758][_0xaf6c('0xb7')]);delete _0x1fd1d0[_0xb5e758];}if(_0x1fd1d0[_0xb5e758]&&_0x1fd1d0[_0xb5e758][_0xaf6c('0x52')]===_0xaf6c('0x7d')){_0x3a1d96[_0xaf6c('0xb9')](_0x3a1d96[_0xaf6c('0x21')][_0x1fd1d0[_0xb5e758][_0xaf6c('0xb7')]]);logger[_0xaf6c('0x9a')](_0xaf6c('0xba'),_0x546719,_0xb5e758,_0x1fd1d0[_0xb5e758][_0xaf6c('0xb7')]);delete _0x1fd1d0[_0xb5e758];}},0x2328);}});}});}}};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xbb')]=function(_0x2d6531){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopper['countReScheduled'](_0x2d6531))['catch'](loggerCatch(_0xaf6c('0xbd')));};Dialer['prototype'][_0xaf6c('0xbe')]=function(_0x36b669){return Promise['resolve']()[_0xaf6c('0x3f')](cmHopperBlack[_0xaf6c('0xbe')](_0x36b669))['catch'](loggerCatch(_0xaf6c('0xbf')));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xc0')]=function(_0x88aca8,_0x47fb24,_0x51234b){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x88aca8,_0x47fb24,_0x51234b))[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0xc2')));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xc3')]=function(_0x18b4da,_0x319613,_0x27be93){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopperAdditionalPhone[_0xaf6c('0xc3')](_0x18b4da,_0x319613,_0x27be93))[_0xaf6c('0xc1')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xaf6c('0x1c')]['checkIsBlackListIvr']=function(_0x53a4b8){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopperBlack[_0xaf6c('0xc4')](_0x53a4b8))[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0xc5')));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xc6')]=function(_0x408bd7){return Promise['resolve']()[_0xaf6c('0x3f')](cmHopperHistory[_0xaf6c('0xc7')](_0x408bd7))['catch'](loggerCatch(_0xaf6c('0xc8')));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xc9')]=function(_0x479b31){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopper['rescheduleContact'](_0x479b31))[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0xca')));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xcb')]=function(_0x25a540,_0xf280a0,_0x22c408){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopper[_0xaf6c('0xcb')](_0x25a540,_0xf280a0,_0x22c408))[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0xcc')));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xcd')]=function(_0xaa9584,_0x1a0ba9,_0x54a553,_0x2f8f2f,_0x58fbf6){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopper[_0xaf6c('0xcd')](_0xaa9584,_0x1a0ba9,_0x54a553,_0x2f8f2f))[_0xaf6c('0xc1')](function(_0x350d30){_0x58fbf6[_0xaf6c('0xce')]-=_0x54a553;_0x58fbf6[_0xaf6c('0xce')]=_0x58fbf6[_0xaf6c('0xce')]>0x0?_0x58fbf6[_0xaf6c('0xce')]:0x0;loggerCatch(_0xaf6c('0xcf'))(_0x350d30);});};Dialer[_0xaf6c('0x1c')]['getContactDialerIvr']=function(_0x1b3c6b,_0x221a48,_0x19d496,_0x4e5cd4){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopper[_0xaf6c('0xd0')](_0x1b3c6b,_0x221a48,_0x19d496))[_0xaf6c('0xc1')](function(_0x5d0936){_0x4e5cd4['temp']-=_0x221a48;_0x4e5cd4['temp']=_0x4e5cd4[_0xaf6c('0xce')]>0x0?_0x4e5cd4['temp']:0x0;loggerCatch(_0xaf6c('0xd1'))(_0x5d0936);});};Dialer['prototype'][_0xaf6c('0xd2')]=function(_0x8524d3){return Promise[_0xaf6c('0xbc')]()['then'](voiceQueueRt[_0xaf6c('0xd2')](_0x8524d3))[_0xaf6c('0xc1')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xaf6c('0x1c')]['moveContactManagedDialer']=function(_0x564a52){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopper[_0xaf6c('0xd3')](_0x564a52))[_0xaf6c('0xc1')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xd4')]=function(_0x147b7f){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopperHistory[_0xaf6c('0xd4')](_0x147b7f))[_0xaf6c('0xc1')](loggerCatch('[createHistory]\x20'));};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xb9')]=function(_0x48fd36){if(!_[_0xaf6c('0x41')](_0x48fd36)&&_0x48fd36!==null){if(typeof _0x48fd36[_0xaf6c('0x9d')]!==_0xaf6c('0x9e')){if(_0x48fd36[_0xaf6c('0x9d')]>0x0){_0x48fd36[_0xaf6c('0x9d')]-=0x1;}else{logger[_0xaf6c('0x9a')](_0xaf6c('0xd5'));}}}else{logger[_0xaf6c('0x9a')](_0xaf6c('0xd6'));}};Dialer[_0xaf6c('0x1c')]['loggerHandler']=function(_0x4bff5d,_0x5d7b88){var _0x424eb7=this;return function(_0x38ba8d){_0x424eb7['updateOriginated'](_0x5d7b88);logger[_0xaf6c('0x9a')](_0x4bff5d,util[_0xaf6c('0x99')](_0x38ba8d,{'showHidden':![],'depth':null}));};};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xd7')]=function(_0x20f1c3,_0x34ddac,_0x26d6ae){var _0x98d1c0={'state':0x19,'statedesc':_0xaf6c('0xd8')};this[_0xaf6c('0xb9')](_0x34ddac);this[_0xaf6c('0xd9')](_[_0xaf6c('0x90')](_0x98d1c0,_['pick'](_0x26d6ae,['ContactId','ListId',_0xaf6c('0xda'),'VoiceQueueId',_0xaf6c('0xdb')])),_0xaf6c('0xdc'),_0xaf6c('0xdd'));logger[_0xaf6c('0x9a')](_0x20f1c3);};Dialer['prototype'][_0xaf6c('0xde')]=function(_0x434635){return _0x434635===_0xaf6c('0xdf');};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xe0')]=function(_0x53cc1f){return!_[_0xaf6c('0x41')](_0x53cc1f)&&_0x53cc1f&&!_[_0xaf6c('0x41')](_0x53cc1f[_0xaf6c('0x44')])&&!_[_0xaf6c('0x41')](_0x53cc1f['active'])&&_0x53cc1f['active']&&(this[_0xaf6c('0x23')][util['format'](_0xaf6c('0xe1'),_0x53cc1f[_0xaf6c('0x44')])]['status']===_0xaf6c('0xe2')||this[_0xaf6c('0x23')][util[_0xaf6c('0x7e')]('SIP/%s',_0x53cc1f[_0xaf6c('0x44')])][_0xaf6c('0xe3')]==='unmonitored');};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xd9')]=function(_0x5d4dc8,_0x2e3588,_0x2292ef){this[_0xaf6c('0xd4')](_0x5d4dc8)[_0xaf6c('0xc1')](loggerCatch(_0x2e3588));this['moveContactManagedDialer'](_0x5d4dc8)['catch'](loggerCatch(_0x2292ef));};Dialer['prototype'][_0xaf6c('0xe4')]=function(_0x57e9e4){var _0x2bdc44=this;var _0x2002a0=this[_0xaf6c('0xb1')][_0x57e9e4['uniqueid']];var _0xb2f681;if(!_[_0xaf6c('0xb3')](_0x57e9e4)&&!_[_0xaf6c('0xb3')](_0x57e9e4[_0xaf6c('0xe5')])&&!_['isNil'](_0x57e9e4[_0xaf6c('0xe5')][_0xaf6c('0xe6')])&&_0x57e9e4[_0xaf6c('0xe7')]===_0xaf6c('0xe8')&&_0x2002a0){if(_0x2002a0[_0xaf6c('0x52')]!==_0xaf6c('0x7d')&&this[_0xaf6c('0x20')][_0x2002a0[_0xaf6c('0xb7')]]['dialAMDActive']&&_0x57e9e4[_0xaf6c('0xe9')]===_0xaf6c('0xea')){delete this[_0xaf6c('0xb1')][_0x57e9e4[_0xaf6c('0xeb')]];this['updateOriginated'](this[_0xaf6c('0x20')][_0x2002a0['queue']]);this['voiceQueues'][_0x2002a0['queue']][_0xaf6c('0x63')]+=0x1;this[_0xaf6c('0x20')][_0x2002a0[_0xaf6c('0xb7')]][_0xaf6c('0x62')]+=0x1;_0xb2f681=new Hangup(_0x2002a0,_0x57e9e4);_0xb2f681[_0xaf6c('0xac')]=0x12;_0xb2f681['statedesc']='HangupInAMD';_0xb2f681[_0xaf6c('0xec')]='AMD';ami[_0xaf6c('0xed')]('custom:amd',ut['buildObj'](_0xb2f681,_0xaf6c('0xee')));this[_0xaf6c('0xd9')](_0xb2f681,_0xaf6c('0xef'),_0xaf6c('0xf0'));}if(_0x2002a0[_0xaf6c('0x52')]!==_0xaf6c('0x7d')&&this['voiceQueues'][_0x2002a0[_0xaf6c('0xb7')]]['dialAMDActive']&&_0x57e9e4[_0xaf6c('0xe9')]===_0xaf6c('0xf1')){return new Promise(function(_0x4c7d68,_0x43f6b5){delete _0x2bdc44[_0xaf6c('0xb1')][_0x57e9e4[_0xaf6c('0xeb')]];_0x2bdc44[_0xaf6c('0xb9')](_0x2bdc44[_0xaf6c('0x20')][_0x2002a0[_0xaf6c('0xb7')]]);_0x2bdc44[_0xaf6c('0x20')][_0x2002a0[_0xaf6c('0xb7')]]['outboundAnswerCallsDay']+=0x1;_0x2bdc44[_0xaf6c('0x20')][_0x2002a0['queue']][_0xaf6c('0x62')]+=0x1;var _0x9e6a53=_0x2bdc44[_0xaf6c('0x20')][_0x2002a0[_0xaf6c('0xb7')]];var _0x1c945f=new Hangup(_0x2002a0,_0x57e9e4);_0x1c945f[_0xaf6c('0xac')]=0x13;_0x1c945f[_0xaf6c('0xad')]=_0xaf6c('0xf2');_0x1c945f['membername']=_0xaf6c('0xf3');_0x1c945f[_0xaf6c('0xf4')]+=0x1;_0x1c945f[_0xaf6c('0xf5')]+=0x1;_0x1c945f['amd']=!![];ami[_0xaf6c('0xed')](_0xaf6c('0xf6'),ut[_0xaf6c('0xf7')](_0x1c945f,'amd'));_0x2bdc44[_0xaf6c('0xd4')](_0x1c945f)[_0xaf6c('0xc1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1c945f['countbusyretry']+_0x1c945f[_0xaf6c('0xf8')]+_0x1c945f[_0xaf6c('0xf9')]+_0x1c945f['countnosuchnumberretry']+_0x1c945f[_0xaf6c('0xfa')]+_0x1c945f['countabandonedretry']+_0x1c945f[_0xaf6c('0xf4')]+_0x1c945f[_0xaf6c('0xfb')]>=_0x9e6a53[_0xaf6c('0xfc')]){_0x2bdc44[_0xaf6c('0xfd')](_0x1c945f,_0x4c7d68,_0x43f6b5,'reason19\x20machine....');}else{if(_0x1c945f['countmachineretry']>=_0x9e6a53[_0xaf6c('0xfe')]){_0x2bdc44[_0xaf6c('0xff')](_0x1c945f,_0x4c7d68,_0x43f6b5,_0xaf6c('0x100'));}else{_0x2bdc44['rescheduleContact']({'active':![],'countmachineretry':_0x1c945f[_0xaf6c('0xf4')],'scheduledat':moment()[_0xaf6c('0x101')](_0x9e6a53['dialMachineRetryFrequency'],_0xaf6c('0x102'))['format'](_0xaf6c('0x103')),'ContactId':_0x1c945f[_0xaf6c('0x104')],'ListId':_0x1c945f[_0xaf6c('0x105')],'VoiceQueueId':_0x1c945f[_0xaf6c('0x106')]||undefined,'CampaignId':_0x1c945f[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch('[rescheduleContact][Machine]'));_0x4c7d68({'reschedule':0x1});}}});}if(_0x2002a0['type']===_0xaf6c('0x7d')&&this[_0xaf6c('0x21')][_0x2002a0[_0xaf6c('0xb7')]][_0xaf6c('0x107')]&&_0x57e9e4[_0xaf6c('0xe9')]===_0xaf6c('0xea')){delete this[_0xaf6c('0xb1')][_0x57e9e4['uniqueid']];this[_0xaf6c('0xb9')](this[_0xaf6c('0x21')][_0x2002a0[_0xaf6c('0xb7')]]);_0xb2f681=new Hangup(_0x2002a0,_0x57e9e4);_0xb2f681[_0xaf6c('0xac')]=0x12;_0xb2f681[_0xaf6c('0xad')]=_0xaf6c('0x108');_0xb2f681[_0xaf6c('0xec')]=_0xaf6c('0xf3');ami[_0xaf6c('0xed')](_0xaf6c('0xf6'),ut['buildObj'](_0xb2f681,_0xaf6c('0xee')));this[_0xaf6c('0xd9')](_0xb2f681,'[syncHangupInAMDIvr][createHistory]',_0xaf6c('0x109'));}if(_0x2002a0[_0xaf6c('0x52')]===_0xaf6c('0x7d')&&this[_0xaf6c('0x21')][_0x2002a0[_0xaf6c('0xb7')]][_0xaf6c('0x107')]&&_0x57e9e4[_0xaf6c('0xe9')]==='MACHINE'){return new Promise(function(_0x565b59,_0x3e6db2){delete _0x2bdc44[_0xaf6c('0xb1')][_0x57e9e4[_0xaf6c('0xeb')]];_0x2bdc44['updateOriginated'](_0x2bdc44[_0xaf6c('0x21')][_0x2002a0[_0xaf6c('0xb7')]]);_0x2bdc44[_0xaf6c('0x21')][_0x2002a0[_0xaf6c('0xb7')]][_0xaf6c('0x63')]+=0x1;_0x2bdc44['campaigns'][_0x2002a0['queue']][_0xaf6c('0x62')]+=0x1;var _0x9c56f5=_0x2bdc44['campaigns'][_0x2002a0[_0xaf6c('0xb7')]];var _0x946e38=new Hangup(_0x2002a0,_0x57e9e4);_0x946e38[_0xaf6c('0xac')]=0x13;_0x946e38[_0xaf6c('0xad')]=_0xaf6c('0xf2');_0x946e38[_0xaf6c('0xec')]=_0xaf6c('0xf3');_0x946e38[_0xaf6c('0xf4')]+=0x1;_0x946e38[_0xaf6c('0xf5')]+=0x1;_0x946e38[_0xaf6c('0xee')]=!![];ami[_0xaf6c('0xed')](_0xaf6c('0xf6'),ut[_0xaf6c('0xf7')](_0x946e38,'amd'));_0x2bdc44[_0xaf6c('0xd4')](_0x946e38)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x10a')));if(_0x946e38[_0xaf6c('0x10b')]+_0x946e38['countcongestionretry']+_0x946e38[_0xaf6c('0xf9')]+_0x946e38['countnosuchnumberretry']+_0x946e38[_0xaf6c('0xfa')]+_0x946e38[_0xaf6c('0x10c')]+_0x946e38['countmachineretry']+_0x946e38['countagentrejectretry']>=_0x9c56f5[_0xaf6c('0xfc')]){_0x2bdc44[_0xaf6c('0xfd')](_0x946e38,_0x565b59,_0x3e6db2,_0xaf6c('0x10d'));}else{if(_0x946e38[_0xaf6c('0xf4')]>=_0x9c56f5['dialMachineMaxRetry']){_0x2bdc44[_0xaf6c('0xff')](_0x946e38,_0x565b59,_0x3e6db2,_0xaf6c('0x100'));}else{_0x2bdc44[_0xaf6c('0xc9')]({'active':![],'countmachineretry':_0x946e38[_0xaf6c('0xf4')],'scheduledat':moment()[_0xaf6c('0x101')](_0x9c56f5[_0xaf6c('0x10e')],_0xaf6c('0x102'))['format'](_0xaf6c('0x103')),'ContactId':_0x946e38[_0xaf6c('0x104')],'ListId':_0x946e38['ListId'],'VoiceQueueId':_0x946e38[_0xaf6c('0x106')]||undefined,'CampaignId':_0x946e38['CampaignId']||undefined})[_0xaf6c('0xc1')](loggerCatch('[rescheduleContact][Machine]'));_0x565b59({'reschedule':0x1});}}});}}};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x37')]=function(_0x18e3d7){var _0x1c01d5=this[_0xaf6c('0xb1')][_0x18e3d7[_0xaf6c('0xeb')]];var _0x595dde;if(_0x1c01d5&&_0x1c01d5[_0xaf6c('0x52')]===_0xaf6c('0x7d')){delete this[_0xaf6c('0xb1')][_0x18e3d7[_0xaf6c('0xeb')]];this[_0xaf6c('0xb9')](this['campaigns'][_0x1c01d5[_0xaf6c('0xb7')]]);this[_0xaf6c('0x21')][_0x1c01d5['queue']][_0xaf6c('0x10f')]+=0x1;_0x595dde=new Hangup(_0x1c01d5,_0x18e3d7);this[_0xaf6c('0xd4')](_0x595dde)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xaf6c('0xd3')](_0x595dde)[_0xaf6c('0xc1')](loggerCatch('[syncHangupIvr]'));}if(_0x1c01d5&&_0x1c01d5[_0xaf6c('0x52')]!==_0xaf6c('0x7d')&&isNotNull(this[_0xaf6c('0x20')][_0x1c01d5[_0xaf6c('0xb7')]][_0xaf6c('0x110')])){delete this['uniqueId'][_0x18e3d7[_0xaf6c('0xeb')]];this[_0xaf6c('0xb9')](this[_0xaf6c('0x20')][_0x1c01d5[_0xaf6c('0xb7')]]);this[_0xaf6c('0x20')][_0x1c01d5[_0xaf6c('0xb7')]][_0xaf6c('0x63')]+=0x1;this[_0xaf6c('0x20')][_0x1c01d5[_0xaf6c('0xb7')]][_0xaf6c('0x62')]+=0x1;_0x595dde=new Hangup(_0x1c01d5,_0x18e3d7);_0x595dde[_0xaf6c('0xac')]=0x10;_0x595dde[_0xaf6c('0xad')]=_0xaf6c('0x111');_0x595dde['membername']=_0xaf6c('0x112');this[_0xaf6c('0xd4')](_0x595dde)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x113')));this['moveContactManagedDialer'](_0x595dde)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x114')));}if(_0x1c01d5&&_0x1c01d5[_0xaf6c('0x52')]!==_0xaf6c('0x7d')&&!isNotNull(this[_0xaf6c('0x20')][_0x1c01d5[_0xaf6c('0xb7')]]['dialQueueProject'])){delete this[_0xaf6c('0xb1')][_0x18e3d7['uniqueid']];this['updateOriginated'](this[_0xaf6c('0x20')][_0x1c01d5[_0xaf6c('0xb7')]]);this[_0xaf6c('0x20')][_0x1c01d5[_0xaf6c('0xb7')]][_0xaf6c('0x6c')]+=0x1;_0x595dde=new Hangup(_0x1c01d5,_0x18e3d7);_0x595dde[_0xaf6c('0xac')]=0xc;_0x595dde[_0xaf6c('0xad')]=_0x18e3d7[_0xaf6c('0x115')];_0x595dde[_0xaf6c('0xec')]='Unknow';this[_0xaf6c('0xd4')](_0x595dde)[_0xaf6c('0xc1')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xaf6c('0xd3')](_0x595dde)[_0xaf6c('0xc1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x32')]=function(_0x20f16e){var _0x4753e1=this[_0xaf6c('0xb1')][_0x20f16e[_0xaf6c('0xeb')]];if(this['voiceQueues'][_0x20f16e[_0xaf6c('0xb7')]]){if(_0x4753e1&&_0x4753e1[_0xaf6c('0x52')]!==_0xaf6c('0x7d')){delete this[_0xaf6c('0xb1')][_0x20f16e[_0xaf6c('0xeb')]];this[_0xaf6c('0x20')][_0x20f16e[_0xaf6c('0xb7')]][_0xaf6c('0x63')]+=0x1;var _0x1406c9=new AgentComplete(_0x4753e1,_0x20f16e);if(_0x20f16e[_0xaf6c('0x116')]===_0xaf6c('0x117')){_0x1406c9[_0xaf6c('0x118')]=this[_0xaf6c('0x20')][_0x20f16e['queue']]['dialQueueProject2']&&this[_0xaf6c('0x20')][_0x20f16e[_0xaf6c('0xb7')]][_0xaf6c('0x119')]?moment()['format'](_0xaf6c('0x103')):undefined;}this[_0xaf6c('0xd4')](_0x1406c9)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x11a')));this[_0xaf6c('0xd3')](_0x1406c9)['catch'](loggerCatch(_0xaf6c('0x11b')));}}};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x2c')]=function(_0x15eb90){if(this[_0xaf6c('0x20')][_0x15eb90['queue']]){if(this[_0xaf6c('0xb1')][_0x15eb90['uniqueid']]&&this[_0xaf6c('0xb1')][_0x15eb90[_0xaf6c('0xeb')]]['type']!==_0xaf6c('0x7d')){this[_0xaf6c('0xb9')](this[_0xaf6c('0x20')][_0x15eb90[_0xaf6c('0xb7')]]);this[_0xaf6c('0xb1')][_0x15eb90[_0xaf6c('0xeb')]]['answertime']=moment()[_0xaf6c('0x7e')](_0xaf6c('0x103'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x42a4b7,_0x5d4af4){this[_0xaf6c('0xd4')](_0x42a4b7)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x11a')));if(_0x5d4af4==0x0){this[_0xaf6c('0xd3')](_0x42a4b7)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x11c')));}};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x2f')]=function(_0x21d14c){var _0x27db4f=this[_0xaf6c('0xb1')][_0x21d14c[_0xaf6c('0xeb')]];var _0x27f8a5=this;var _0x50166a=![];var _0x5f574f;var _0x1aba7f;if(this[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]]){if(_0x27db4f&&_0x27db4f['type']!==_0xaf6c('0x7d')){delete this[_0xaf6c('0xb1')][_0x21d14c[_0xaf6c('0xeb')]];this[_0xaf6c('0xb9')](this[_0xaf6c('0x20')][_0x21d14c['queue']]);_0x27db4f[_0xaf6c('0x11d')]=moment()[_0xaf6c('0x7e')](_0xaf6c('0x103'));var _0x1409ba=new QueueCallerAbandon(_0x27db4f,_0x21d14c);if(getSeconds(_0x27db4f[_0xaf6c('0x11d')],_0x27db4f[_0xaf6c('0x11e')])>=_0x27db4f[_0xaf6c('0x11f')]){this['voiceQueues'][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x86')]+=0x1;this['voiceQueues'][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x120')]+=0x1;this[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x121')]+=0x1;_0x1409ba[_0xaf6c('0xac')]=0xa;_0x1409ba[_0xaf6c('0xad')]=_0xaf6c('0x122');_0x1409ba[_0xaf6c('0x123')]=_0xaf6c('0x124');_0x1409ba[_0xaf6c('0x118')]=this[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]]['dialQueueProject2']?moment()[_0xaf6c('0x7e')](_0xaf6c('0x103')):undefined;_0x1409ba[_0xaf6c('0xfa')]+=0x1;_0x1409ba[_0xaf6c('0xf5')]+=0x1;_0x5f574f=this[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x125')];_0x1aba7f=this[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x126')];_0x27f8a5[_0xaf6c('0xc0')](_0x1409ba,_0x1409ba[_0xaf6c('0xac')],_0x27db4f[_0xaf6c('0x127')])[_0xaf6c('0x3f')](function(_0x4c9d2b){_0x50166a=_0x4c9d2b['additional']==0x1;if(_0x1409ba[_0xaf6c('0xfa')]>=_0x27f8a5[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x128')]){_0x27f8a5[_0xaf6c('0x129')](_0x1409ba,_0x4c9d2b[_0xaf6c('0x12a')]);}else{_0x27f8a5['rescheduleContact']({'active':![],'countdropretry':_0x1409ba['countdropretry'],'scheduledat':moment()[_0xaf6c('0x101')](_0x27f8a5['voiceQueues'][_0x21d14c[_0xaf6c('0xb7')]]['dialDropRetryFrequency'],'minutes')[_0xaf6c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x27db4f[_0xaf6c('0x104')],'ListId':_0x27db4f[_0xaf6c('0x105')],'VoiceQueueId':_0x27db4f['VoiceQueueId']||undefined,'CampaignId':_0x27db4f[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x12b')));var _0x44710b=new History(_0x1409ba);_0x44710b[_0xaf6c('0xac')]=0xa;_0x44710b[_0xaf6c('0xad')]='Drop';_0x44710b[_0xaf6c('0xaf')]=moment()[_0xaf6c('0x7e')](_0xaf6c('0x103'));_0x44710b['endtime']=_0x44710b[_0xaf6c('0xaf')];_0x44710b[_0xaf6c('0x12c')]=_0x1409ba[_0xaf6c('0x12c')];_0x44710b[_0xaf6c('0x12d')]=_0x1409ba[_0xaf6c('0x12d')];_0x27f8a5[_0xaf6c('0xd4')](_0x44710b)[_0xaf6c('0xc1')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xaf6c('0x3f')](function(){if(_0x50166a)_0x27f8a5['swapAdditionalPhones'](_0x1409ba,_0x5f574f,_0x1aba7f)[_0xaf6c('0x3f')](function(){return 0x1;});});}else{this[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x6f')]+=0x1;this['voiceQueues'][_0x21d14c['queue']][_0xaf6c('0x67')]+=0x1;_0x1409ba[_0xaf6c('0xac')]=0xb;_0x1409ba[_0xaf6c('0xad')]=_0xaf6c('0x12e');_0x1409ba[_0xaf6c('0x123')]='CALLEREXIT';_0x1409ba[_0xaf6c('0x10c')]+=0x1;_0x1409ba[_0xaf6c('0xf5')]+=0x1;_0x5f574f=this['voiceQueues'][_0x21d14c['queue']][_0xaf6c('0x12f')];_0x1aba7f=this[_0xaf6c('0x20')][_0x21d14c[_0xaf6c('0xb7')]][_0xaf6c('0x126')];_0x27f8a5[_0xaf6c('0xc0')](_0x1409ba,_0x1409ba[_0xaf6c('0xac')],_0x27db4f[_0xaf6c('0x127')])['then'](function(_0x49131f){if(_0x1409ba[_0xaf6c('0x10c')]>=_0x27f8a5['voiceQueues'][_0x21d14c[_0xaf6c('0xb7')]]['dialAbandonedMaxRetry']){_0x27f8a5[_0xaf6c('0x129')](_0x1409ba,_0x49131f[_0xaf6c('0x12a')]);}else{_0x27f8a5[_0xaf6c('0xc9')]({'active':![],'countabandonedretry':_0x1409ba[_0xaf6c('0x10c')],'scheduledat':moment()[_0xaf6c('0x101')](_0x27f8a5[_0xaf6c('0x20')][_0x21d14c['queue']][_0xaf6c('0x12f')],_0xaf6c('0x102'))['format'](_0xaf6c('0x103')),'ContactId':_0x27db4f[_0xaf6c('0x104')],'ListId':_0x27db4f[_0xaf6c('0x105')],'VoiceQueueId':_0x27db4f['VoiceQueueId']||undefined,'CampaignId':_0x27db4f[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x130')));var _0x2d9085=new History(_0x1409ba);_0x2d9085[_0xaf6c('0xac')]=0xb;_0x2d9085[_0xaf6c('0xad')]=_0xaf6c('0x12e');_0x2d9085['starttime']=moment()[_0xaf6c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d9085[_0xaf6c('0xae')]=_0x2d9085[_0xaf6c('0xaf')];_0x2d9085['calleridname']=_0x1409ba[_0xaf6c('0x12c')];_0x2d9085['calleridnum']=_0x1409ba[_0xaf6c('0x12d')];_0x27f8a5[_0xaf6c('0xd4')](_0x2d9085)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x131')));}})['then'](function(){if(_0x50166a)_0x27f8a5[_0xaf6c('0xc3')](_0x1409ba,_0x5f574f,_0x1aba7f)[_0xaf6c('0x3f')](function(){return 0x1;});});}}}};Dialer[_0xaf6c('0x1c')]['syncNewExten']=function(_0x6d691a){if(this[_0xaf6c('0x25')][_0x6d691a[_0xaf6c('0xeb')]]){this[_0xaf6c('0x25')][_0x6d691a['uniqueid']][_0xaf6c('0xb5')]=_0x6d691a[_0xaf6c('0xb5')];}if(this['uniqueId'][_0x6d691a['uniqueid']]){this[_0xaf6c('0xb1')][_0x6d691a[_0xaf6c('0xeb')]]['channel']=_0x6d691a[_0xaf6c('0xb5')];}};Dialer['prototype']['syncQueueMember']=function(_0x1e1a60){if(strategy[this[_0xaf6c('0x20')][this['actions'][_0x1e1a60[_0xaf6c('0x132')]][_0xaf6c('0xb7')]][_0xaf6c('0x54')]]==='roundrobin'){if(this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]]&&_['isNil'](this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]][_0xaf6c('0x133')])&&_0x1e1a60[_0xaf6c('0xe3')]==='1'&&_0x1e1a60['paused']==='0'){if(this[_0xaf6c('0x22')][_0x1e1a60[_0xaf6c('0x134')]]){if(!this[_0xaf6c('0x22')][_0x1e1a60['stateinterface']][_0xaf6c('0x133')]){this[_0xaf6c('0x22')][_0x1e1a60[_0xaf6c('0x134')]][_0xaf6c('0x133')]=!![];this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]]['locked']=!![];this['actions'][_0x1e1a60[_0xaf6c('0x132')]][_0xaf6c('0x134')]=_0x1e1a60[_0xaf6c('0x134')];}}}}else if((strategy[this[_0xaf6c('0x20')][this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]][_0xaf6c('0xb7')]][_0xaf6c('0x54')]]||'rrmemory')===_0xaf6c('0x1b')){if(this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]]){if(this[_0xaf6c('0x22')][_0x1e1a60[_0xaf6c('0x134')]]){this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]][_0xaf6c('0x134')]=_0x1e1a60[_0xaf6c('0x134')];if(_[_0xaf6c('0xb3')](this['queueBooked'][this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]]['queue']])){this[_0xaf6c('0x135')][this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]][_0xaf6c('0xb7')]]=[];}this['queueBooked'][this[_0xaf6c('0x25')][_0x1e1a60['actionid']][_0xaf6c('0xb7')]][_0xaf6c('0x136')](_[_0xaf6c('0x90')](_[_0xaf6c('0x137')](this[_0xaf6c('0x25')][_0x1e1a60[_0xaf6c('0x132')]],[_0xaf6c('0x138'),_0xaf6c('0x134')]),{'status':_0x1e1a60[_0xaf6c('0xe3')],'paused':_0x1e1a60[_0xaf6c('0x139')]}));}}}};function unlockQueueStatus(_0x43c57b,_0x5f2163){setTimeout(function(){if(_[_0xaf6c('0x41')](_0x43c57b['queueStatusComplete'])){loggerBooked[_0xaf6c('0x9a')](_0xaf6c('0x13a'),_0x5f2163);}_0x43c57b['queueStatusComplete']=!![];loggerBooked[_0xaf6c('0x82')](_0xaf6c('0x13b'),_0x5f2163,JSON[_0xaf6c('0x4e')](_[_0xaf6c('0x137')](_0x43c57b,['name','queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x5ec2e4){var _0x1c345d=this;var _0x322c5b=_0x1c345d[_0xaf6c('0x20')][_0x1c345d[_0xaf6c('0x25')][_0x5ec2e4['actionid']][_0xaf6c('0xb7')]];if(strategy[this[_0xaf6c('0x20')][this[_0xaf6c('0x25')][_0x5ec2e4['actionid']]['queue']]['strategy']]===_0xaf6c('0x13c')){if(this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]]&&this['actions'][_0x5ec2e4[_0xaf6c('0x132')]]['stateinterface']){this[_0xaf6c('0x94')][_0xaf6c('0x13d')](this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0x138')],this['actions'][_0x5ec2e4[_0xaf6c('0x132')]]['stateinterface'])[_0xaf6c('0xc1')](function(_0x108789){logger[_0xaf6c('0x9a')](_0xaf6c('0x13e'),util['inspect'](_0x108789,{'showHidden':![],'depth':null}));})[_0xaf6c('0x13f')](function(){_0x1c345d['updateOriginated'](_0x1c345d[_0xaf6c('0x20')][_0x1c345d[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]]['queue']]);_0x1c345d[_0xaf6c('0x22')][_0x1c345d[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0x134')]][_0xaf6c('0x133')]=![];delete _0x1c345d['actions'][_0x5ec2e4[_0xaf6c('0x132')]];unlockQueueStatus(_0x322c5b);});}else{this[_0xaf6c('0xb9')](this[_0xaf6c('0x20')][this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0xb7')]]);this[_0xaf6c('0xc9')]({'active':![],'ContactId':this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0x104')],'ListId':this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0x105')],'VoiceQueueId':this[_0xaf6c('0x25')][_0x5ec2e4['actionid']][_0xaf6c('0x106')]||undefined,'CampaignId':this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]];unlockQueueStatus(_0x322c5b);}}else if((strategy[this[_0xaf6c('0x20')][this['actions'][_0x5ec2e4[_0xaf6c('0x132')]]['queue']][_0xaf6c('0x54')]]||_0xaf6c('0x1b'))===_0xaf6c('0x1b')){var _0x111d0f;if(this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]]&&!_[_0xaf6c('0x4c')](this[_0xaf6c('0x135')][this[_0xaf6c('0x25')][_0x5ec2e4['actionid']][_0xaf6c('0xb7')]])){if(this[_0xaf6c('0x2b')][_0x1c345d[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0xb7')]]){this[_0xaf6c('0x2b')][_0x1c345d[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]]['queue']]=this['queueBookedRR'][this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0xb7')]]?this[_0xaf6c('0x2b')][this[_0xaf6c('0x25')][_0x5ec2e4['actionid']][_0xaf6c('0xb7')]]:this['queueBooked'][this[_0xaf6c('0x25')][_0x5ec2e4['actionid']]['queue']]?this['queueBooked'][this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0xb7')]][_0xaf6c('0x140')]||0x0:0x0;}this[_0xaf6c('0x135')][this['actions'][_0x5ec2e4['actionid']][_0xaf6c('0xb7')]]['_rr']=this[_0xaf6c('0x2b')][this[_0xaf6c('0x25')][_0x5ec2e4[_0xaf6c('0x132')]][_0xaf6c('0xb7')]];for(var _0x158233=0x0;_0x158233=0x0;})[_0xaf6c('0xc1')](myreject(_0x486864)));}}else{_0x5d1756[_0xaf6c('0x136')](ami[_0xaf6c('0xb4')]({'action':_0xaf6c('0x155'),'command':util[_0xaf6c('0x7e')](_0xaf6c('0x156'),_0x3f7eb4,!_[_0xaf6c('0x41')](config[_0xaf6c('0x158')][_0x3a1ba2])?_0x3a1ba2:'')})[_0xaf6c('0x3f')](function(_0xc7562d){return _0xc7562d[_0xaf6c('0x15b')][_0xaf6c('0x159')](_0xaf6c('0x15a'))>=0x0;})[_0xaf6c('0xc1')](myreject(_0x486864)));}Promise[_0xaf6c('0x15c')](_0x5d1756)[_0xaf6c('0x3f')](function(_0x5a9050){var _0x5f0099=_[_0xaf6c('0x15d')](_0x5a9050);if(_0x5f0099){return _0x5cbad5(_0x5f0099);}else{_0x58faab[_0xaf6c('0x42')]=_0x3dceb7?_0xaf6c('0x15e'):'INTERVAL_IS_OVERTIME';return _0x486864(msgResponse(_0xaf6c('0x15f'),_0xaf6c('0x150'),'Global:\x20'+_0x3dceb7+'\x20'+_0x5ae3cb+_0xaf6c('0x160')+util[_0xaf6c('0x99')](_0x3f7eb4,{'showHidden':![],'depth':null})+_0xaf6c('0x161')+_0x3a1ba2));}})[_0xaf6c('0xc1')](function(_0x59f19f){return _0x486864(msgResponse(_0xaf6c('0x14f'),_0xaf6c('0x150'),JSON[_0xaf6c('0x4e')](_0x59f19f)));});});};Dialer['prototype']['checkDialMethod']=function(_0x728874){var _0x5b2c1c=this;return function(){switch(_0x728874[_0xaf6c('0x5e')]){case _0xaf6c('0x162'):freeVariablesPredictive(_0x728874);_0x5b2c1c['handlePower'](_0x728874,0x1);break;case'power':freeVariablesPredictive(_0x728874);_0x5b2c1c[_0xaf6c('0x163')](_0x728874,_0x728874['dialPowerLevel']);break;case _0xaf6c('0x8'):_0x5b2c1c['predictive'](_0x728874);break;case _0xaf6c('0x7'):freeVariablesPredictive(_0x728874);_0x5b2c1c[_0xaf6c('0x163')](_0x728874,0x1);break;default:freeVariablesPredictive(_0x728874);logger['error'](_0xaf6c('0x164'),_0x728874['name'],_0xaf6c('0x165'));}};};Dialer[_0xaf6c('0x1c')]['checkPreviewRecallReminder']=function(_0x1fc50b){return Promise[_0xaf6c('0xbc')]()['then'](cmHopper[_0xaf6c('0x166')](_0x1fc50b['id'],previewRecallmeReminderInterval))['then'](function(_0x55d679){for(var _0x4c4959=0x0;_0x4c4959<_0x55d679[_0xaf6c('0x9c')];_0x4c4959++){var _0x5d19a1=_0x55d679[_0x4c4959]['Agent'][_0xaf6c('0x44')];if(_0x5d19a1)io['to'](util[_0xaf6c('0x7e')]('user:%s',_0x5d19a1))['emit'](_0xaf6c('0x167'),{'hopper':_0x55d679[_0x4c4959]});}})[_0xaf6c('0xc1')](function(){});};Dialer['prototype'][_0xaf6c('0x168')]=function(_0x1682b9){var _0x5813d5=this;return function(){_0x5813d5[_0xaf6c('0x169')](_0x1682b9);};};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xa')]=function(_0x96d7dd){var _0xe5708a=this;if(isNotPreview(_0x96d7dd[_0xaf6c('0x5e')])){if(isVoiceQueueOutbound(_0x96d7dd[_0xaf6c('0x52')])&&isActive(_0x96d7dd['dialActive'])){_0x96d7dd[_0xaf6c('0xa5')]=!![];Promise[_0xaf6c('0xbc')]()['then'](checkIsLoggedIn(_0x96d7dd,_0x96d7dd[_0xaf6c('0x56')]))[_0xaf6c('0x3f')](checkIsActive(_0x96d7dd,_0x96d7dd[_0xaf6c('0x5d')]))[_0xaf6c('0x3f')](checkInterval(_0x96d7dd))[_0xaf6c('0x3f')](_0xe5708a[_0xaf6c('0x16a')](_0x96d7dd))[_0xaf6c('0x3f')](_0xe5708a[_0xaf6c('0x14d')](_0x96d7dd[_0xaf6c('0x16b')],_0x96d7dd[_0xaf6c('0x16c')],_0x96d7dd['name'],_0x96d7dd))[_0xaf6c('0x3f')](_0xe5708a[_0xaf6c('0x14e')](_0x96d7dd[_0xaf6c('0x48')],_0x96d7dd['dialTimezone'],_0x96d7dd[_0xaf6c('0x44')],_0x96d7dd))['then'](_0xe5708a[_0xaf6c('0x16d')](_0x96d7dd))[_0xaf6c('0xc1')](loggerCatchQueueSummary('[syncQueueSummary]',_0x96d7dd));}else{notSendMessagesQueue(_0x96d7dd);}}else{freeVariablesPredictive(_0x96d7dd);}};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x35')]=_['throttle'](function(){var _0x450181=_['filter'](this['voiceQueues'],function(_0x3916c9){return _0x3916c9[_0xaf6c('0x16e')];});var _0x511826=_[_0xaf6c('0x16f')](this[_0xaf6c('0x22')],function(_0x5c92ea){return _0x5c92ea[_0xaf6c('0x170')]&&_0x5c92ea['status']===_0xaf6c('0xe2');});if(_0x450181[_0xaf6c('0x9c')]>0x0&&_0x511826[_0xaf6c('0x9c')]>0x0){return Promise[_0xaf6c('0xbc')]()[_0xaf6c('0x3f')](cmHopper[_0xaf6c('0x166')](_[_0xaf6c('0x171')](_0x450181,'id'),previewRecallmeReminderInterval,_[_0xaf6c('0x171')](_0x511826,'id')))[_0xaf6c('0x3f')](function(_0x5ce68a){for(var _0x18fbfb=0x0;_0x18fbfb<_0x5ce68a[_0xaf6c('0x9c')];_0x18fbfb++){var _0x4f9ddc=_0x5ce68a[_0x18fbfb][_0xaf6c('0x172')][_0xaf6c('0x44')];if(_0x4f9ddc)io['to'](util[_0xaf6c('0x7e')]('user:%s',_0x4f9ddc))['emit'](_0xaf6c('0x167'),{'hopper':_0x5ce68a[_0x18fbfb]});}})[_0xaf6c('0xc1')](function(_0x1f1b86){logger[_0xaf6c('0x9a')](_0xaf6c('0x173'),_0x1f1b86);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xaf6c('0x1c')]['syncCampaigns']=function(){var _0x777a8d=this;var _0x524913;for(var _0x2cc0c5 in this[_0xaf6c('0x21')]){if(typeof this[_0xaf6c('0x21')][_0x2cc0c5]!==_0xaf6c('0x9e')){_0x524913=this[_0xaf6c('0x21')][_0x2cc0c5];if(isCampaignIvr(_0x524913['type'])&&isActive(_0x524913[_0xaf6c('0x78')])){_0x524913['sendMessageOneNotActive']=!![];Promise[_0xaf6c('0xbc')]()['then'](checkIsActive(_0x524913,_0x524913[_0xaf6c('0x78')]))[_0xaf6c('0x3f')](checkInterval(_0x524913))['then'](_0x777a8d[_0xaf6c('0x16a')](_0x524913))[_0xaf6c('0x3f')](_0x777a8d[_0xaf6c('0x14d')](_0x524913[_0xaf6c('0x16b')],_0x524913[_0xaf6c('0x16c')],_0x524913[_0xaf6c('0x44')],_0x524913))[_0xaf6c('0x3f')](_0x777a8d[_0xaf6c('0x14e')](_0x524913[_0xaf6c('0x48')],_0x524913[_0xaf6c('0x16c')],_0x524913[_0xaf6c('0x44')],_0x524913))['then'](_0x777a8d[_0xaf6c('0x168')](_0x524913))[_0xaf6c('0xc1')](loggerCatchQueueSummary('[syncCampaigns]',_0x524913));}else{notSendMessagesCampaign(_0x524913);}}}};function getCallerIdRandom(_0xdd7f9a,_0x5efe79){var _0x2dce0f;var _0x362ff4;var _0x4c2813;if(_0x5efe79<=0x0){_0x5efe79=0x1;}_0x2dce0f=new RegExp(_0xaf6c('0x174')+_0x5efe79+'}$');_0x362ff4=Math[_0xaf6c('0x175')](0xa,_0x5efe79-0x1);_0x4c2813=Math['pow'](0xa,_0x5efe79)-0x1;return util[_0xaf6c('0x7e')]('%s',_[_0xaf6c('0x176')](_0xdd7f9a,_0x2dce0f,_[_0xaf6c('0x177')](_0x362ff4,_0x4c2813)));}function extractCalleridName(_0x45637f){var _0x182013=_0x45637f[_0xaf6c('0x178')](/"(.*?)"/);return _0x182013?_0x182013[0x1]:_0x45637f;}Dialer[_0xaf6c('0x1c')][_0xaf6c('0x179')]=function(_0x4293fd,_0x2fbbf3){var _0x305d68=this;var _0x2b2d4c=uuid['v4']();this[_0xaf6c('0x25')][_0x2b2d4c]=new Action(_0x4293fd,_0x2fbbf3,_0x2b2d4c);return new Promise(function(_0x1a7723,_0x171aa3){if(_[_0xaf6c('0x41')](_0x4293fd)&&typeof _0x4293fd!==_0xaf6c('0x17a')){return _0x171aa3(msgResponse(_0xaf6c('0x17b'),_0xaf6c('0x150'),'voiceQueue\x20is\x20undefine'));}if(_[_0xaf6c('0x41')](_0x2fbbf3[_0xaf6c('0x17c')])||_0x2fbbf3[_0xaf6c('0x17c')]===null){return _0x171aa3(msgResponse('originate',_0xaf6c('0x150'),_0xaf6c('0x17d')));}var _0x29a720={'XMD-CALLERID':_0x305d68[_0xaf6c('0x25')][_0x2b2d4c][_0xaf6c('0x17e')](),'XMD-AGI':_0x4293fd[_0xaf6c('0x110')]?util['format'](_0xaf6c('0x17f'),ipAgi,_0x4293fd[_0xaf6c('0x110')]):_0xaf6c('0x180'),'XMD-AGIAFTER':_0x4293fd['dialQueueProject2']?util['format'](_0xaf6c('0x17f'),ipAgi,_0x4293fd['dialQueueProject2']):_0xaf6c('0x180'),'XMD-QUEUE':_0x4293fd['type']===_0xaf6c('0x53')?util[_0xaf6c('0x7e')]('\x22%s,%s%s,,,%s\x22',_0x4293fd[_0xaf6c('0x44')],_0x4293fd['dialQueueOptions']||'',_0x4293fd[_0xaf6c('0x119')]?'c':'',_0x4293fd[_0xaf6c('0x11f')]||0x3):_0xaf6c('0x180'),'XMD-CONTACTID':_0x2fbbf3[_0xaf6c('0x104')],'XMD-CDRTYPE':_0xaf6c('0x6'),'CALLERID(all)':_0x305d68['actions'][_0x2b2d4c][_0xaf6c('0x17e')](),'XMD-AMD':_0x4293fd[_0xaf6c('0x107')]?_0xaf6c('0x181'):_0xaf6c('0x180'),'XMD-DESTINATION':_0xaf6c('0xe8')};if(_0x4293fd[_0xaf6c('0x107')]){_0x29a720[_0xaf6c('0x182')]=_0x4293fd[_0xaf6c('0x183')]||0x9c4;_0x29a720[_0xaf6c('0x184')]=_0x4293fd['dialAMDGreeting']||0x5dc;_0x29a720['XMD-AMDAFTERGREETINGSILENCE']=_0x4293fd[_0xaf6c('0x185')]||0x320;_0x29a720[_0xaf6c('0x186')]=_0x4293fd[_0xaf6c('0x187')]||0x1388;_0x29a720['XMD-AMDMINWORDLENGTH']=_0x4293fd[_0xaf6c('0x188')]||0x64;_0x29a720[_0xaf6c('0x189')]=_0x4293fd['dialAMDBetweenWordsSilence']||0x32;_0x29a720[_0xaf6c('0x18a')]=_0x4293fd['dialAMDMaximumNumberOfWords']||0x3;_0x29a720['XMD-AMDSILENCETHRESHOLD']=_0x4293fd[_0xaf6c('0x18b')]||0x100;_0x29a720['XMD-AMDMAXIMUMWORDLENGTH']=_0x4293fd[_0xaf6c('0x18c')]||0x1388;}if(_0x4293fd[_0xaf6c('0x52')]===_0xaf6c('0x53')){_0x29a720[_0xaf6c('0x18d')]=_0x2fbbf3[_0xaf6c('0x106')];}else{_0x29a720[_0xaf6c('0x18e')]=_0x2fbbf3[_0xaf6c('0xdb')];}for(var _0x3a5436 in _0x2fbbf3[_0xaf6c('0x18f')]){if(typeof _0x2fbbf3['Contact'][_0x3a5436]!==_0xaf6c('0x9e')){if(isNotNull(_0x2fbbf3['Contact'][_0x3a5436])&&_0x3a5436!=='id'&&_0x3a5436!==_0xaf6c('0x190')&&_0x3a5436!==_0xaf6c('0x191')&&_0x3a5436!==_0xaf6c('0x192')){_0x29a720[util[_0xaf6c('0x7e')]('%s%s',_0xaf6c('0x193'),_[_0xaf6c('0x194')](_0x3a5436))]=_0x2fbbf3[_0xaf6c('0x18f')][_0x3a5436];}}}var _0x45457e=_0x305d68[_0xaf6c('0xe0')](_0x4293fd['Trunk'])?getCallerId(_0x4293fd['Trunk'][_0xaf6c('0x79')],_0x4293fd[_0xaf6c('0x5f')],_0x4293fd[_0xaf6c('0x195')]>0x0?getCallerIdRandom(_0x4293fd[_0xaf6c('0x196')],_0x4293fd['dialRandomLastDigitCallerIdNumber']):_0x4293fd[_0xaf6c('0x196')]):getCallerId(_['isNil'](_0x4293fd[_0xaf6c('0x197')])?_0x4293fd[_0xaf6c('0x77')][_0xaf6c('0x79')]:_0x4293fd['TrunkBackup'][_0xaf6c('0x79')],_0x4293fd[_0xaf6c('0x5f')],_0x4293fd[_0xaf6c('0x195')]>0x0?getCallerIdRandom(_0x4293fd[_0xaf6c('0x196')],_0x4293fd['dialRandomLastDigitCallerIdNumber']):_0x4293fd[_0xaf6c('0x196')]);if(_0x45457e){_0x29a720['XMD-ORIGINATECALLERIDNAME']=_0x305d68[_0xaf6c('0x25')][_0x2b2d4c][_0xaf6c('0x198')]=extractCalleridName(_0x45457e);_0x29a720[_0xaf6c('0x199')]=_0x2fbbf3[_0xaf6c('0x17c')];}_0x4293fd[_0xaf6c('0x19a')]=_0x29a720;return ami['Action']({'actionid':_0x2b2d4c,'action':_0xaf6c('0x17b'),'channel':_0x305d68[_0xaf6c('0xe0')](_0x4293fd[_0xaf6c('0x77')])?util[_0xaf6c('0x7e')](_0xaf6c('0x19b'),_0x4293fd['Trunk'][_0xaf6c('0x44')],isNotNull(_0x4293fd['dialPrefix'])?_0x4293fd[_0xaf6c('0x61')][_0xaf6c('0x19c')]()||'':'',_0x4293fd[_0xaf6c('0x19d')]>0x0?_0x2fbbf3[_0xaf6c('0x17c')][_0xaf6c('0x19e')](_0x4293fd[_0xaf6c('0x19d')]):_0x2fbbf3[_0xaf6c('0x17c')]):util[_0xaf6c('0x7e')]('SIP/%s/%s%s',_['isNil'](_0x4293fd[_0xaf6c('0x197')])?_0x4293fd['Trunk'][_0xaf6c('0x44')]:_0x4293fd[_0xaf6c('0x197')][_0xaf6c('0x44')],isNotNull(_0x4293fd[_0xaf6c('0x61')])?_0x4293fd[_0xaf6c('0x61')]['trim']()||'':'',_0x4293fd[_0xaf6c('0x19d')]>0x0?_0x2fbbf3['phone']['substring'](_0x4293fd[_0xaf6c('0x19d')]):_0x2fbbf3[_0xaf6c('0x17c')]),'callerid':_0x45457e,'Exten':_0xaf6c('0xe8'),'Context':_0xaf6c('0x19f'),'Priority':'1','variable':_0x29a720,'timeout':(_0x4293fd[_0xaf6c('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2b2d4c})[_0xaf6c('0x3f')](function(_0x5e1750){return _0x1a7723(_0x5e1750);})[_0xaf6c('0xc1')](function(_0x584903){_0x4293fd['outboundOriginateFailureCallsDay']+=0x1;var _0x5f23d1=new History(_0x305d68[_0xaf6c('0x25')][_0x2b2d4c]);logger[_0xaf6c('0x9a')](util[_0xaf6c('0x7e')](_0xaf6c('0x1a0'),JSON[_0xaf6c('0x4e')](_0x584903)));_0x5f23d1[_0xaf6c('0xac')]=0xe;_0x5f23d1[_0xaf6c('0xad')]='OriginateError';_0x5f23d1['starttime']=moment()['format'](_0xaf6c('0x103'));_0x5f23d1[_0xaf6c('0xae')]=_0x5f23d1[_0xaf6c('0xaf')];_0x305d68['createHistory'](_0x5f23d1)['catch'](loggerCatch(_0xaf6c('0x1a1')));_0x305d68[_0xaf6c('0xd3')](_0x5f23d1)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1a1')))[_0xaf6c('0x13f')](function(){delete _0x305d68[_0xaf6c('0x25')][_0x2b2d4c];return _0x171aa3(msgResponse(_0xaf6c('0x17b'),_0xaf6c('0x4d'),_0xaf6c('0x1a2')));});});});};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x1a3')]=function(_0x531ddc){var _0x101ea9=this[_0xaf6c('0x25')][_0x531ddc['actionid']];if(_0x101ea9){delete this['actions'][_0x531ddc[_0xaf6c('0x132')]];_0x101ea9[_0xaf6c('0x11e')]=moment()[_0xaf6c('0x7e')](_0xaf6c('0x103'));var _0x129360=_0x101ea9[_0xaf6c('0x52')]===_0xaf6c('0x7d')?this['campaigns'][_0x101ea9['queue']]:this[_0xaf6c('0x20')][_0x101ea9[_0xaf6c('0x1a4')]()];if(!this[_0xaf6c('0xde')](_0x531ddc[_0xaf6c('0x1a5')])){this['updateOriginated'](_0x129360);return this[_0xaf6c('0x1a6')](_0x101ea9,_0x129360,_0x531ddc)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x531ddc[_0xaf6c('0xeb')]]=_0x101ea9;}};Dialer[_0xaf6c('0x1c')]['checkRetriveMax']=function(_0x43df6d,_0x170e1e,_0xb10b9f){var _0x56b260=new History(_0x170e1e);if(_0x56b260[_0xaf6c('0x10b')]+_0x56b260[_0xaf6c('0xf8')]+_0x56b260[_0xaf6c('0xf9')]+_0x56b260['countnosuchnumberretry']+_0x56b260[_0xaf6c('0xfa')]+_0x56b260[_0xaf6c('0x10c')]+_0x56b260[_0xaf6c('0xf4')]+_0x56b260[_0xaf6c('0xfb')]>=_0xb10b9f[_0xaf6c('0xfc')]-0x1){return!![];}switch(_0x43df6d){case 0x3:if(_0x56b260['countnoanswerretry']>=_0xb10b9f[_0xaf6c('0x1a7')]-0x1){return!![];}this[_0xaf6c('0xc9')]({'active':![],'countnoanswerretry':_0x56b260[_0xaf6c('0xf9')]+=0x1,'scheduledat':moment()['add'](_0xb10b9f[_0xaf6c('0x1a8')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x56b260['ContactId'],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260[_0xaf6c('0x106')]||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x56b260['countbusyretry']>=_0xb10b9f[_0xaf6c('0x1a9')]-0x1){return!![];}this[_0xaf6c('0xc9')]({'active':![],'countbusyretry':_0x56b260[_0xaf6c('0x10b')]+=0x1,'scheduledat':moment()[_0xaf6c('0x101')](_0xb10b9f[_0xaf6c('0x1aa')],'minutes')[_0xaf6c('0x7e')](_0xaf6c('0x103')),'ContactId':_0x56b260[_0xaf6c('0x104')],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260[_0xaf6c('0x106')]||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1ab')));break;case 0x8:if(_0x56b260['countcongestionretry']>=_0xb10b9f['dialCongestionMaxRetry']-0x1){return!![];}this[_0xaf6c('0xc9')]({'active':![],'countcongestionretry':_0x56b260['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0xb10b9f['dialCongestionRetryFrequency'],_0xaf6c('0x102'))[_0xaf6c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x56b260[_0xaf6c('0x104')],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260[_0xaf6c('0x106')]||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})['catch'](loggerCatch(_0xaf6c('0x1ac')));break;case 0x0:if(_0x56b260['countnosuchnumberretry']>=_0xb10b9f[_0xaf6c('0x1ad')]-0x1){return!![];}else{this[_0xaf6c('0xc9')]({'active':![],'countnosuchnumberretry':_0x56b260['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xaf6c('0x101')](_0xb10b9f[_0xaf6c('0x1ae')],_0xaf6c('0x102'))['format'](_0xaf6c('0x103')),'ContactId':_0x56b260[_0xaf6c('0x104')],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260['VoiceQueueId']||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})['catch'](loggerCatch(_0xaf6c('0x1af')));}break;case 0xa:if(_0x56b260[_0xaf6c('0xfa')]>=_0xb10b9f[_0xaf6c('0x128')]-0x1){return!![];}this[_0xaf6c('0xc9')]({'active':![],'countdropretry':_0x56b260[_0xaf6c('0xfa')]+=0x1,'scheduledat':moment()[_0xaf6c('0x101')](_0xb10b9f[_0xaf6c('0x125')],_0xaf6c('0x102'))[_0xaf6c('0x7e')](_0xaf6c('0x103')),'ContactId':_0x56b260[_0xaf6c('0x104')],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260[_0xaf6c('0x106')]||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x12b')));break;case 0xb:if(_0x56b260[_0xaf6c('0x10c')]>=_0xb10b9f['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x56b260[_0xaf6c('0x10c')]+=0x1,'scheduledat':moment()[_0xaf6c('0x101')](_0xb10b9f['dialAbandonedRetryFrequency'],_0xaf6c('0x102'))[_0xaf6c('0x7e')](_0xaf6c('0x103')),'ContactId':_0x56b260[_0xaf6c('0x104')],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260[_0xaf6c('0x106')]||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x130')));break;case 0x13:if(_0x56b260[_0xaf6c('0xf4')]>=_0xb10b9f[_0xaf6c('0xfe')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x56b260[_0xaf6c('0xf4')]+=0x1,'scheduledat':moment()[_0xaf6c('0x101')](_0xb10b9f[_0xaf6c('0x10e')],_0xaf6c('0x102'))[_0xaf6c('0x7e')](_0xaf6c('0x103')),'ContactId':_0x56b260[_0xaf6c('0x104')],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260[_0xaf6c('0x106')]||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1b0')));break;case 0x14:if(_0x56b260[_0xaf6c('0xfb')]>=_0xb10b9f[_0xaf6c('0x1b1')]-0x1){return!![];}this[_0xaf6c('0xc9')]({'active':![],'countagentrejectretry':_0x56b260[_0xaf6c('0xfb')]+=0x1,'scheduledat':moment()[_0xaf6c('0x101')](_0xb10b9f[_0xaf6c('0x1b2')],'minutes')[_0xaf6c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x56b260[_0xaf6c('0x104')],'ListId':_0x56b260[_0xaf6c('0x105')],'VoiceQueueId':_0x56b260[_0xaf6c('0x106')]||undefined,'CampaignId':_0x56b260[_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1b3')));break;default:return!![];}};Dialer['prototype'][_0xaf6c('0x1a6')]=function(_0xa37120,_0x54fac7,_0x5b5dce){var _0x2bb5b8=this;var _0x42aef5=new History(_0xa37120);var _0x42d6e9=![];var _0x520d58;var _0x1f0d4e;return new Promise(function(_0x2c332a,_0x4c5b5f){if(_['isUndefined'](_0x54fac7)&&typeof _0x54fac7!=='object'){return _0x4c5b5f(msgResponse(_0xaf6c('0x1b4'),_0xaf6c('0x150'),_0xaf6c('0x1b5')));}if(_['isUndefined'](_0x5b5dce)&&typeof _0x5b5dce!==_0xaf6c('0x17a')){return _0x4c5b5f(msgResponse(_0xaf6c('0x1b4'),_0xaf6c('0x150'),_0xaf6c('0x1b6')));}_0x2bb5b8[_0xaf6c('0xc0')](_0x42aef5,_0x5b5dce[_0xaf6c('0x116')],_0x54fac7)[_0xaf6c('0x3f')](function(_0x632a86){if(_0x632a86[_0xaf6c('0x12a')]==0x1)_0x42d6e9=!![];switch(_0x5b5dce['reason']){case'0':_0x54fac7[_0xaf6c('0x69')]+=0x1;_0x42aef5[_0xaf6c('0xac')]=0x0;_0x42aef5[_0xaf6c('0xad')]=_0xaf6c('0x1b7');_0x42aef5[_0xaf6c('0x1b8')]+=0x1;_0x42aef5['countglobal']+=0x1;ami[_0xaf6c('0xed')](_0xaf6c('0x1b9'),ut[_0xaf6c('0xf7')](_0xa37120,_0xaf6c('0x1ba')));_0x520d58=_0x54fac7[_0xaf6c('0x1ae')];_0x1f0d4e=_0x54fac7['callAdditionalPhoneAfterMin'];_0x2bb5b8[_0xaf6c('0xd4')](_0x42aef5)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x10a')));if(_0x2bb5b8[_0xaf6c('0x1bb')](0x0,_0xa37120,_0x54fac7)&&!_0x42d6e9){if(_0x42aef5[_0xaf6c('0x1b8')]>=_0x54fac7[_0xaf6c('0x1ad')]){_0x2bb5b8['createStateFinal'](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1bc'));}else{_0x2bb5b8[_0xaf6c('0xfd')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1bc'));}}break;case'3':_0x54fac7[_0xaf6c('0x68')]+=0x1;_0x42aef5[_0xaf6c('0xac')]=0x3;_0x42aef5[_0xaf6c('0xad')]='NoAnswer';_0x42aef5[_0xaf6c('0xf9')]+=0x1;_0x42aef5['countglobal']+=0x1;var _0x2e2718=ut[_0xaf6c('0x1bd')](_0xa37120,_0x54fac7);ami['emit'](_0xaf6c('0x1be'),_0x2e2718);_0x520d58=_0x54fac7[_0xaf6c('0x1a8')];_0x1f0d4e=_0x54fac7['callAdditionalPhoneAfterMin'];_0x2bb5b8[_0xaf6c('0xd4')](_0x42aef5)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1bf')));if(_0x2bb5b8[_0xaf6c('0x1bb')](0x3,_0xa37120,_0x54fac7)&&!_0x42d6e9){if(_0x42aef5[_0xaf6c('0xf9')]>=_0x54fac7[_0xaf6c('0x1a7')]){_0x2bb5b8[_0xaf6c('0xff')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1c0'));}else{_0x2bb5b8['stateGlobal'](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1c0'));}}break;case'5':_0x54fac7[_0xaf6c('0x64')]+=0x1;_0x42aef5['state']=0x5;_0x42aef5[_0xaf6c('0xad')]=_0xaf6c('0x1c1');_0x42aef5[_0xaf6c('0x10b')]+=0x1;_0x42aef5[_0xaf6c('0xf5')]+=0x1;ami[_0xaf6c('0xed')](_0xaf6c('0x1c2'),ut[_0xaf6c('0xf7')](_0xa37120,'busy'));_0x520d58=_0x54fac7[_0xaf6c('0x1aa')];_0x1f0d4e=_0x54fac7[_0xaf6c('0x126')];_0x2bb5b8[_0xaf6c('0xd4')](_0x42aef5)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1c3')));if(_0x2bb5b8[_0xaf6c('0x1bb')](0x5,_0xa37120,_0x54fac7)&&!_0x42d6e9){if(_0x42aef5[_0xaf6c('0x10b')]>=_0x54fac7['dialBusyMaxRetry']){_0x2bb5b8[_0xaf6c('0xff')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1c4'));}else{_0x2bb5b8[_0xaf6c('0xfd')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1c4'));}}break;case'8':_0x54fac7[_0xaf6c('0x65')]+=0x1;_0x42aef5[_0xaf6c('0xac')]=0x8;_0x42aef5['statedesc']=_0xaf6c('0x1c5');_0x42aef5[_0xaf6c('0xf8')]+=0x1;_0x42aef5[_0xaf6c('0xf5')]+=0x1;_0x520d58=_0x54fac7[_0xaf6c('0x1c6')];_0x1f0d4e=_0x54fac7['callAdditionalPhoneAfterMin'];ami[_0xaf6c('0xed')](_0xaf6c('0x1c7'),ut[_0xaf6c('0xf7')](_0xa37120,_0xaf6c('0x1c8')));_0x2bb5b8[_0xaf6c('0xd4')](_0x42aef5)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1c9')));if(_0x2bb5b8[_0xaf6c('0x1bb')](0x8,_0xa37120,_0x54fac7)&&!_0x42d6e9){if(_0x42aef5['countcongestionretry']>=_0x54fac7[_0xaf6c('0x1ca')]){_0x2bb5b8[_0xaf6c('0xff')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1cb'));}else{_0x2bb5b8[_0xaf6c('0xfd')](_0x42aef5,_0x2c332a,_0x4c5b5f,'reason\x208\x20congestion');}}break;case'11':_0x54fac7[_0xaf6c('0x1cc')]+=0x1;_0x42aef5[_0xaf6c('0xac')]=0xb;_0x42aef5[_0xaf6c('0xad')]=_0xaf6c('0x12e');_0x42aef5[_0xaf6c('0x10c')]+=0x1;_0x42aef5[_0xaf6c('0xf5')]+=0x1;_0x520d58=_0x54fac7[_0xaf6c('0x12f')];_0x1f0d4e=_0x54fac7[_0xaf6c('0x126')];_0x2bb5b8[_0xaf6c('0xd4')](_0x42aef5)[_0xaf6c('0xc1')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x2bb5b8['checkRetriveMax'](0xb,_0xa37120,_0x54fac7)&&!_0x42d6e9){if(_0x42aef5[_0xaf6c('0x10c')]>=_0x54fac7[_0xaf6c('0x1cd')]){_0x2bb5b8[_0xaf6c('0xff')](_0x42aef5,_0x2c332a,_0x4c5b5f,'reason\x2011\x20abandoned');}else{_0x2bb5b8[_0xaf6c('0xfd')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1ce'));}}break;case'20':_0x54fac7[_0xaf6c('0x6b')]+=0x1;_0x42aef5[_0xaf6c('0xac')]=0x14;_0x42aef5[_0xaf6c('0xad')]='AgentReject';_0x42aef5['countagentrejectretry']+=0x1;_0x42aef5[_0xaf6c('0xf5')]+=0x1;_0x520d58=_0x54fac7[_0xaf6c('0x1b2')];_0x1f0d4e=_0x54fac7[_0xaf6c('0x126')];ami[_0xaf6c('0xed')](_0xaf6c('0x1cf'),ut[_0xaf6c('0xf7')](_0xa37120,_0xaf6c('0x1d0')));_0x2bb5b8[_0xaf6c('0xd4')](_0x42aef5)['catch'](loggerCatch(_0xaf6c('0x1d1')));if(_0x2bb5b8[_0xaf6c('0x1bb')](0x14,_0xa37120,_0x54fac7)&&!_0x42d6e9){if(_0x42aef5[_0xaf6c('0xfb')]>=_0x54fac7['dialAgentRejectMaxRetry']){_0x2bb5b8[_0xaf6c('0xff')](_0x42aef5,_0x2c332a,_0x4c5b5f,'reason\x2020\x20agentreject');}else{_0x2bb5b8['stateGlobal'](_0x42aef5,_0x2c332a,_0x4c5b5f,_0xaf6c('0x1d2'));}}break;default:_0x54fac7['outboundUnknownCallsDay']+=0x1;_0x42aef5[_0xaf6c('0xac')]=0xc;_0x42aef5['statedesc']=_0x5b5dce[_0xaf6c('0x116')];_0x520d58=_0x54fac7[_0xaf6c('0x1b2')];_0x1f0d4e=_0x54fac7[_0xaf6c('0x126')];_0x2bb5b8[_0xaf6c('0xd4')](_0x42aef5)[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x1d3')));if(_0x2bb5b8[_0xaf6c('0x1bb')](_0x5b5dce[_0xaf6c('0x116')],_0xa37120,_0x54fac7)&&!_0x42d6e9){if(_0x42aef5[_0xaf6c('0x10b')]+_0x42aef5[_0xaf6c('0xf8')]+_0x42aef5[_0xaf6c('0xf9')]+_0x42aef5[_0xaf6c('0x1b8')]+_0x42aef5[_0xaf6c('0xfa')]+_0x42aef5[_0xaf6c('0x10c')]+_0x42aef5[_0xaf6c('0xf4')]+_0x42aef5[_0xaf6c('0xfb')]>=_0x54fac7['dialGlobalMaxRetry']){_0x2bb5b8[_0xaf6c('0xfd')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0x5b5dce[_0xaf6c('0x116')]);}else{_0x2bb5b8[_0xaf6c('0xff')](_0x42aef5,_0x2c332a,_0x4c5b5f,_0x5b5dce[_0xaf6c('0x116')]);}}}})['then'](function(){if(_0x42d6e9){_0x2bb5b8['swapAdditionalPhones'](_0x42aef5,_0x520d58,_0x1f0d4e)[_0xaf6c('0x3f')](function(){return _0x2c332a(0x1);});}});});};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xfd')]=function(_0x58d7f3,_0x4c0770,_0x51fe44,_0x3113b0){var _0xbf11a3=new Final(_0x58d7f3);_0xbf11a3[_0xaf6c('0xac')]=0xf;_0xbf11a3[_0xaf6c('0xad')]=_0xaf6c('0x1d4');this['createStateFinal'](_0xbf11a3,_0x4c0770,_0x51fe44,_0x3113b0);};Dialer[_0xaf6c('0x1c')][_0xaf6c('0xff')]=function(_0x2230dc,_0x4a86f7,_0x19826b,_0x52d1a){this[_0xaf6c('0xd3')](_0x2230dc)[_0xaf6c('0x3f')](function(){return _0x4a86f7(msgResponse(_0xaf6c('0x1b4'),_0xaf6c('0xdf'),_0x52d1a));})[_0xaf6c('0xc1')](function(){return _0x19826b(msgResponse(_0xaf6c('0x1d5'),_0xaf6c('0x150'),_0xaf6c('0x1d6')));});};Dialer[_0xaf6c('0x1c')]['predictive']=function(_0x19c8fc){var _0x319be9=_0x19c8fc['dialPredictiveOptimizationPercentage']/0x64;var _0x474f3e=_0x19c8fc[_0xaf6c('0x120')]/(_0x19c8fc['outboundDropCallsDayTimeout']+_0x19c8fc['outboundAnswerCallsDay']);var _0x40eff9=Math[_0xaf6c('0x1d7')](_0x19c8fc[_0xaf6c('0x74')]*(_0x19c8fc[_0xaf6c('0x1d8')]/0x64));var _0x3c237d=Math[_0xaf6c('0x1d7')](_0x19c8fc['predictiveIntervalAvailable']*(_0x19c8fc[_0xaf6c('0x1d9')]/0x64));var _0x31eab9=_0x19c8fc[_0xaf6c('0x55')]+_0x19c8fc[_0xaf6c('0x1da')];var _0x57cc63=Math[_0xaf6c('0x1db')](_0x19c8fc[_0xaf6c('0x8e')]*_0x19c8fc[_0xaf6c('0x75')]*_0x19c8fc[_0xaf6c('0x71')]*_0x19c8fc[_0xaf6c('0x72')]);if(_[_0xaf6c('0x41')](_0x19c8fc['startProgressive'])){if(!_[_0xaf6c('0x41')](_0x19c8fc[_0xaf6c('0x28')])){_0x19c8fc[_0xaf6c('0x28')]=undefined;loggerPredictive[_0xaf6c('0x9a')](_0xaf6c('0x1dc'),_0xaf6c('0x1dd'));}if(!_[_0xaf6c('0x41')](_0x19c8fc[_0xaf6c('0x92')])){loggerPredictive[_0xaf6c('0x9a')](_0xaf6c('0x1dc'),_0xaf6c('0x1de'));clearInterval(_0x19c8fc[_0xaf6c('0x92')]);_0x19c8fc[_0xaf6c('0x92')]=undefined;}_0x19c8fc[_0xaf6c('0x29')]=moment()['format'](_0xaf6c('0x103'));loggerPredictive['info'](_0x19c8fc[_0xaf6c('0x44')],_0xaf6c('0x1df'),_0x19c8fc[_0xaf6c('0x29')]);this[_0xaf6c('0x163')](_0x19c8fc,0x1);}else if(ifInterval(_0x19c8fc[_0xaf6c('0x1e0')],_0x19c8fc['startProgressive'])){this[_0xaf6c('0x163')](_0x19c8fc,0x1);loggerPredictiveCalls[_0xaf6c('0x82')](_0xaf6c('0x1e1'),_0x19c8fc['startProgressive'],_0x19c8fc[_0xaf6c('0x44')]);_0x19c8fc[_0xaf6c('0x8e')]=0x0;_0x19c8fc[_0xaf6c('0x121')]=0x0;}else if(_0x319be9<_0x474f3e&&_0x19c8fc[_0xaf6c('0x1e2')]===_0xaf6c('0x1e3')){freeVariablesPredictive(_0x19c8fc);loggerPredictive[_0xaf6c('0x82')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xaf6c('0x1e4'),_0x474f3e,_0xaf6c('0x29'),_0x19c8fc['name']);}else if(_0x57cc63<_0x19c8fc['predictiveIntervalErlangCallsDroppedCalls']&&_0x19c8fc[_0xaf6c('0x1e2')]===_0xaf6c('0x1e3')){freeVariablesPredictive(_0x19c8fc);loggerPredictive['info'](_0xaf6c('0x1e5'),_0xaf6c('0x1e6'),_0x57cc63,_0xaf6c('0x1e7'),_0x19c8fc[_0xaf6c('0x121')],_0xaf6c('0x29'),_0x19c8fc['name']);}else if(!ifInterval(_0x19c8fc[_0xaf6c('0x1e0')],_0x19c8fc[_0xaf6c('0x29')])&&_[_0xaf6c('0x41')](_0x19c8fc[_0xaf6c('0x28')])&&!_[_0xaf6c('0x41')](_0x19c8fc['startProgressive'])){_0x19c8fc['startPredictive']=moment()[_0xaf6c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xaf6c('0x82')](_0x19c8fc['name'],_0xaf6c('0x1e8'),_0x19c8fc[_0xaf6c('0x28')]);this[_0xaf6c('0xc6')](_0x19c8fc[_0xaf6c('0x1e0')])['then'](this[_0xaf6c('0x1e9')](_0x19c8fc))['then'](mergeDataErlangB(_0x19c8fc))[_0xaf6c('0x3f')](this[_0xaf6c('0x1ea')](_0x19c8fc))[_0xaf6c('0xc1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x19c8fc));}else if(!ifInterval(_0x19c8fc[_0xaf6c('0x1e0')],_0x19c8fc['startPredictive'])){_0x19c8fc['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x19c8fc[_0xaf6c('0x28')]=moment()['format'](_0xaf6c('0x103'));loggerPredictive[_0xaf6c('0x82')](_0x19c8fc[_0xaf6c('0x44')],_0xaf6c('0x1eb'),_0x19c8fc['startPredictive']);clearInterval(_0x19c8fc[_0xaf6c('0x92')]);_0x19c8fc[_0xaf6c('0x92')]=undefined;this[_0xaf6c('0xc6')](_0x19c8fc[_0xaf6c('0x1e0')])[_0xaf6c('0x3f')](this[_0xaf6c('0x1e9')](_0x19c8fc))[_0xaf6c('0x3f')](mergeDataErlangB(_0x19c8fc))[_0xaf6c('0x3f')](this[_0xaf6c('0x1ea')](_0x19c8fc))['catch'](loggerCatchPredictive(_0xaf6c('0x1ec'),_0x19c8fc));}else if(_0x19c8fc[_0xaf6c('0x74')]&&_0x31eab9<_0x19c8fc[_0xaf6c('0x74')]-_0x3c237d){freeVariablesPredictive(_0x19c8fc);loggerPredictive['info'](_0x19c8fc['name'],_0xaf6c('0x1ed'),_0x31eab9,')\x20are\x20less\x20than\x20threshold\x20(',_0x19c8fc[_0xaf6c('0x74')],'-',_0x3c237d,'=',_0x19c8fc[_0xaf6c('0x74')]-_0x3c237d,')');}else if(_0x19c8fc[_0xaf6c('0x74')]&&_0x31eab9>_0x19c8fc[_0xaf6c('0x74')]+_0x40eff9){freeVariablesPredictive(_0x19c8fc);loggerPredictive[_0xaf6c('0x82')](_0x19c8fc[_0xaf6c('0x44')],_0xaf6c('0x1ed'),_0x31eab9,_0xaf6c('0x1ee'),_0x19c8fc[_0xaf6c('0x74')],'+',_0x40eff9,'=',_0x19c8fc[_0xaf6c('0x74')]+_0x40eff9,')');}};Dialer[_0xaf6c('0x1c')]['getDataPredictive']=function(_0x3922bd){var _0x3d6b05=this;return function(_0x3b91e8){return new Promise(function(_0x42e711,_0x4aa880){_[_0xaf6c('0x90')](_0x3922bd,_0x3b91e8[0x0]);if(checkGetDataPredictive(_0x3b91e8[0x0])){var _0x191f67=_0x3922bd[_0xaf6c('0x74')]=_0x3922bd['talking']+_0x3922bd['available'];var _0x565eec=_0x3922bd[_0xaf6c('0x1e0')]*0x3c;var _0x2975ed=_0x3b91e8[0x0][_0xaf6c('0x6e')]+_0x3b91e8[0x0][_0xaf6c('0x8a')];var _0xbcf95d=(_0x3b91e8[0x0][_0xaf6c('0x6d')]+_0x3b91e8[0x0][_0xaf6c('0x86')]+_0x3b91e8[0x0][_0xaf6c('0x6f')])/_0x3b91e8[0x0]['predictiveIntervalTotalCalls'];_0x3922bd['predictiveIntervalHitRate']=_0xbcf95d>0x0?_0xbcf95d:0x1;switch(_0x3922bd[_0xaf6c('0x1e2')]){case _0xaf6c('0x1e3'):var _0x1daef7=_0x3922bd[_0xaf6c('0x1ef')]/0x64;return _0x3d6b05[_0xaf6c('0x1f0')](_0x191f67,_0x565eec,_0x2975ed,_0xbcf95d,_0x1daef7)[_0xaf6c('0x3f')](function(_0xb93696){return _0x42e711(_0xb93696);});case _0xaf6c('0x1f1'):var _0x407232=_0x3922bd[_0xaf6c('0x1ef')]/0x64;return _0x3d6b05[_0xaf6c('0x1f2')](_0x191f67,_0x565eec,_0x2975ed,_0xbcf95d,_0x407232)[_0xaf6c('0x3f')](function(_0x3970e3){return _0x42e711(_0x3970e3);});default:return _0x4aa880(msgResponse('[getDataPredictive]','Failure',_0xaf6c('0x1f3')));}}else{return _0x4aa880(msgResponse(_0xaf6c('0x1f4'),_0xaf6c('0x150'),_0xaf6c('0x1f5')));}});};};Dialer['prototype'][_0xaf6c('0x1f6')]=function(_0x46a31e){var _0x5e51d8=this;return function(_0xc8305){return new Promise(function(_0x62d2d7,_0x4dcf7a){_[_0xaf6c('0x90')](_0x46a31e,_0xc8305[0x0]);if(checkGetDataPredictive(_0xc8305[0x0])){loggerPredictive[_0xaf6c('0x82')](JSON[_0xaf6c('0x4e')](_0xc8305[0x0]));if(_0x46a31e[_0xaf6c('0x1e2')]===_0xaf6c('0x1e3')){return _0x5e51d8[_0xaf6c('0xd2')](_0x46a31e['id'])[_0xaf6c('0x3f')](function(_0x55cd8c){var _0x55148e=_0x46a31e[_0xaf6c('0x56')]-_0x55cd8c[0x0]['outboundQueuePauses'];var _0x32c7dc=_0x46a31e[_0xaf6c('0x1e0')]*0x3c;var _0x2933ec=_0xc8305[0x0][_0xaf6c('0x6e')]+_0xc8305[0x0][_0xaf6c('0x8a')];var _0x4449b8=(_0xc8305[0x0][_0xaf6c('0x6d')]+_0xc8305[0x0][_0xaf6c('0x86')]+_0xc8305[0x0][_0xaf6c('0x6f')])/_0xc8305[0x0][_0xaf6c('0x1f7')];var _0x26554a=_0x46a31e['dialPredictiveOptimizationPercentage']/0x64;_0x46a31e[_0xaf6c('0x73')]=_0x55cd8c[0x0][_0xaf6c('0x1f8')]||0x0;_0x46a31e[_0xaf6c('0x71')]=_0x4449b8>0x0?_0x4449b8:0x1;return _0x5e51d8[_0xaf6c('0x1f0')](_0x55148e,_0x32c7dc,_0x2933ec,_0x4449b8,_0x26554a);})[_0xaf6c('0x3f')](function(_0x3bfbf9){return _0x62d2d7(_0x3bfbf9);})[_0xaf6c('0xc1')](function(_0x528117){return _0x4dcf7a(msgResponse('[CatchErlangB]',_0xaf6c('0x150'),JSON[_0xaf6c('0x4e')](_0x528117)));});}if(_0x46a31e[_0xaf6c('0x1e2')]===_0xaf6c('0x1f1')){return _0x5e51d8['getVoiceQueueRtPauses'](_0x46a31e['id'])['then'](function(_0x2a7edf){var _0x3b1fd5=_0x46a31e['loggedIn']-_0x2a7edf[0x0]['outboundQueuePauses'];var _0x5c638c=_0x46a31e['dialPredictiveInterval']*0x3c;var _0x24a5b7=_0xc8305[0x0]['predictiveIntervalAvgTalktime']+_0xc8305[0x0]['predictiveIntervalAvgHoldtime'];var _0x5c99d5=(_0xc8305[0x0][_0xaf6c('0x6d')]+_0xc8305[0x0][_0xaf6c('0x86')]+_0xc8305[0x0][_0xaf6c('0x6f')])/_0xc8305[0x0][_0xaf6c('0x1f7')];var _0x2f6d50=_0x46a31e[_0xaf6c('0x1ef')]/0x64;_0x46a31e['predictiveIntervalPauses']=_0x2a7edf[0x0][_0xaf6c('0x1f8')]||0x0;_0x46a31e[_0xaf6c('0x71')]=_0x5c99d5>0x0?_0x5c99d5:0x1;return _0x5e51d8[_0xaf6c('0x1f2')](_0x3b1fd5,_0x5c638c,_0x24a5b7,_0x5c99d5,_0x2f6d50);})[_0xaf6c('0x3f')](function(_0x2c3d14){return _0x62d2d7(_0x2c3d14);})[_0xaf6c('0xc1')](function(_0xc141af){return _0x4dcf7a(msgResponse(_0xaf6c('0x1f9'),_0xaf6c('0x150'),JSON[_0xaf6c('0x4e')](_0xc141af)));});}}else{return _0x4dcf7a(msgResponse(_0xaf6c('0x1f4'),'Failure',_0xaf6c('0x1f5')));}});};};Dialer[_0xaf6c('0x1c')]['startMethodPredictive']=function(_0x2a8f44){var _0x271499=this;return function(){var _0x2af4dd=0x0;var _0x10ab80=Math[_0xaf6c('0x1db')](_0x2a8f44[_0xaf6c('0x1fa')]*0x3e8);if(_0x10ab80>0x0){_0x10ab80=_0x10ab80<0x64?0x64:_0x10ab80;loggerPredictive['info'](_0x2a8f44[_0xaf6c('0x44')],_0xaf6c('0x1fb'),_0x10ab80,_0xaf6c('0x4f'));_0x2a8f44[_0xaf6c('0x92')]=setInterval(function(){_0x271499[_0xaf6c('0x92')](_0x2a8f44);loggerPredictiveCalls[_0xaf6c('0x82')](_0xaf6c('0x1fc'),_0x2af4dd+=0x1);},_0x10ab80);}else{loggerPredictive[_0xaf6c('0x82')](_0x2a8f44['name'],_0xaf6c('0x1fd'));}};};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x1fe')]=function(_0x4bb05e,_0x26b3b0){var _0x9bdb90=this;return function(_0x367357){if(_[_0xaf6c('0x4c')](_0x367357)){if(_[_0xaf6c('0xb3')](_0x26b3b0[_0xaf6c('0xda')])||!_0x26b3b0[_0xaf6c('0x1ff')]){if(_0x4bb05e['dialMethod']==='booked'){_0x4bb05e['queueStatusComplete']=_[_0xaf6c('0x41')](_0x4bb05e[_0xaf6c('0x200')])?!![]:_0x4bb05e[_0xaf6c('0x200')];var _0x5788c6=uuid['v4']();_0x9bdb90['actions'][_0x5788c6]=new Action(_0x4bb05e,_0x26b3b0,_0x5788c6);loggerBooked[_0xaf6c('0x82')](_0xaf6c('0x201'),_0x5788c6,'queueStatusComplete:\x20',JSON[_0xaf6c('0x4e')](_0x4bb05e['queueStatusComplete']),'Queue:\x20',_0x4bb05e['name']);if(_0x4bb05e[_0xaf6c('0x200')]){_0x4bb05e['queueStatusComplete']=![];_0x9bdb90[_0xaf6c('0x135')][_0x9bdb90[_0xaf6c('0x25')][_0x5788c6][_0xaf6c('0xb7')]]=[];ami[_0xaf6c('0xb4')]({'actionid':_0x5788c6,'action':_0xaf6c('0x202'),'queue':_0x4bb05e[_0xaf6c('0x44')]})['catch'](function(){_0x9bdb90[_0xaf6c('0xb9')](_0x4bb05e);_0x9bdb90[_0xaf6c('0xc9')]({'active':![],'ContactId':_0x9bdb90['actions'][_0x5788c6][_0xaf6c('0x104')],'ListId':_0x9bdb90[_0xaf6c('0x25')][_0x5788c6]['ListId'],'VoiceQueueId':_0x9bdb90['actions'][_0x5788c6]['VoiceQueueId']||undefined,'CampaignId':_0x9bdb90[_0xaf6c('0x25')][_0x5788c6]['CampaignId']||undefined})[_0xaf6c('0xc1')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x9bdb90['actions'][_0x5788c6];});}else{loggerBooked[_0xaf6c('0x82')](_0xaf6c('0x203'),JSON['stringify'](_0x4bb05e[_0xaf6c('0x200')]),_0xaf6c('0x204'),_0x4bb05e[_0xaf6c('0x44')]);_0x9bdb90[_0xaf6c('0xb9')](_0x4bb05e);_0x9bdb90[_0xaf6c('0xc9')]({'active':![],'ContactId':_0x9bdb90[_0xaf6c('0x25')][_0x5788c6][_0xaf6c('0x104')],'ListId':_0x9bdb90[_0xaf6c('0x25')][_0x5788c6]['ListId'],'VoiceQueueId':_0x9bdb90[_0xaf6c('0x25')][_0x5788c6][_0xaf6c('0x106')]||undefined,'CampaignId':_0x9bdb90[_0xaf6c('0x25')][_0x5788c6][_0xaf6c('0xdb')]||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x205')));delete _0x9bdb90[_0xaf6c('0x25')][_0x5788c6];}}else{return _0x9bdb90[_0xaf6c('0x179')](_0x4bb05e,_0x26b3b0);}}else{if(getDiff(_0x26b3b0[_0xaf6c('0x206')])<_0x4bb05e[_0xaf6c('0x207')]*0x3c){if(_0x26b3b0[_0xaf6c('0x172')]&&!_0x26b3b0[_0xaf6c('0x172')]['voicePause']){_0x9bdb90[_0xaf6c('0x94')][_0xaf6c('0x13d')](_0x26b3b0['id'])[_0xaf6c('0x13f')](function(){_0x9bdb90[_0xaf6c('0xb9')](_0x4bb05e);});}else{_0x9bdb90['unlockContact']({'active':![]},_0x26b3b0['id'],0x1)[_0xaf6c('0x13f')](function(){_0x9bdb90['updateOriginated'](_0x4bb05e);});}}else{_0x4bb05e[_0xaf6c('0x208')]+=0x1;_0x9bdb90[_0xaf6c('0xb9')](_0x4bb05e);if(_0x4bb05e[_0xaf6c('0x209')]){_0x9bdb90['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x26b3b0['ContactId'],'ListId':_0x26b3b0[_0xaf6c('0x105')],'VoiceQueueId':_0x26b3b0[_0xaf6c('0x106')]||undefined,'CampaignId':_0x26b3b0['CampaignId']||undefined})[_0xaf6c('0xc1')](loggerCatch(_0xaf6c('0x20a')));_0x9bdb90['createHistory'](createObjHistory(_0x4bb05e,_0x26b3b0,_0xaf6c('0x20b'),0x17,_0xaf6c('0x20c')))[_0xaf6c('0xc1')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x9bdb90['saveInDb'](createObjHistory(_0x4bb05e,_0x26b3b0,_0xaf6c('0x20d'),0x16,_0xaf6c('0x20e')),_0xaf6c('0x20f'),_0xaf6c('0x210'));}}}}else{_0x4bb05e[_0xaf6c('0x211')]+=0x1;_0x9bdb90[_0xaf6c('0xd9')](createObjHistory(_0x4bb05e,_0x26b3b0,_0xaf6c('0x212'),0xd,_0xaf6c('0x213')),'[Originate][historyBlacklist]',_0xaf6c('0x214'));throw _0xaf6c('0x215');}};};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x169')]=function(_0xb9d982){var _0x4e4864=this;var _0x4c0b46=_0xb9d982['limitCalls']-_0xb9d982[_0xaf6c('0x9d')]-_0xb9d982[_0xaf6c('0xce')];emitCampaignSummary(_0xb9d982);if(_0x4c0b46>0x0){if(_0x4c0b46>this[_0xaf6c('0x216')]){_0x4c0b46=this[_0xaf6c('0x216')];}_0xb9d982['temp']+=_0x4c0b46;this[_0xaf6c('0xd0')](_0xb9d982['id'],_0x4c0b46,_0xb9d982[_0xaf6c('0x217')],_0xb9d982)[_0xaf6c('0x3f')](function(_0x309c4b){_0xb9d982['temp']-=_0x4c0b46;_0xb9d982[_0xaf6c('0xce')]=_0xb9d982[_0xaf6c('0xce')]>0x0?_0xb9d982[_0xaf6c('0xce')]:0x0;if(!checkContactEmpty(_0x309c4b)){_0xb9d982['message']=_0xaf6c('0xa3');logger['info'](_0xaf6c('0x218')+_0xb9d982[_0xaf6c('0x44')]);}else{_0xb9d982[_0xaf6c('0x9d')]+=_0x309c4b[_0xaf6c('0x9c')];_0xb9d982[_0xaf6c('0x42')]=_0xaf6c('0x219');for(var _0x13786d=0x0;_0x13786d<_0x309c4b['length'];_0x13786d+=0x1){_0xb9d982[_0xaf6c('0x21a')]+=0x1;if(_[_0xaf6c('0xb3')](_0x309c4b[_0x13786d])||_['isNil'](_0x309c4b[_0x13786d]['Contact'])||_[_0xaf6c('0xb3')](_0x309c4b[_0x13786d][_0xaf6c('0x17c')])){_0x4e4864['emptyContact'](_0xaf6c('0x21b'),_0xb9d982,_0x309c4b[_0x13786d]);}else{_0x4e4864[_0xaf6c('0xc4')](_['pick'](_0x309c4b[_0x13786d],['CampaignId',_0xaf6c('0x21c')]))[_0xaf6c('0x3f')](_0x4e4864[_0xaf6c('0x1fe')](_0xb9d982,_0x309c4b[_0x13786d]))['catch'](_0x4e4864['loggerHandler']('[actionOriginateIvr]\x20',_0xb9d982));}}}})[_0xaf6c('0xc1')](loggerGetContactDialer(_0xaf6c('0x21d'),_0xb9d982,_0x4c0b46));}};Dialer['prototype'][_0xaf6c('0x163')]=function(_0x4a5d69,_0x46567c){var _0x23f61f=this;var _0x4a1906=[];var _0x10acb4=_0x46567c>=0x1?_0x46567c:0x1;if(_0x4a5d69['dialMethod']==='booked'){_0x10acb4=0x1;}var _0x525afc=Math[_0xaf6c('0x1db')](_0x4a5d69[_0xaf6c('0x55')]*_0x10acb4)-_0x4a5d69['originated']-_0x4a5d69[_0xaf6c('0xce')];emitVoiceQueueSummary(_0x4a5d69);if(_0x4a5d69[_0xaf6c('0x21e')]>0x0){var _0x3f3d6d=_0x4a5d69['dialLimitQueue']-_0x4a5d69[_0xaf6c('0x9d')]-_0x4a5d69['talking']-_0x4a5d69[_0xaf6c('0xce')]-_0x4a5d69[_0xaf6c('0x57')];if(_0x525afc>_0x3f3d6d){_0x525afc=_0x3f3d6d;}}if(_0x525afc>0x0){if(_0x4a5d69[_0xaf6c('0x5e')]===_0xaf6c('0x7')){_0x525afc=0x1;}if(_0x525afc>this['maxNumberOriginate']){_0x525afc=this[_0xaf6c('0x216')];}_0x4a5d69[_0xaf6c('0xce')]+=_0x525afc;for(var _0x2eed5c in this['agents']){if(typeof this[_0xaf6c('0x22')][_0x2eed5c]!=='undefined'){if(this[_0xaf6c('0x22')][_0x2eed5c][_0xaf6c('0xac')]==='not_inuse'&&this['agents'][_0x2eed5c][_0xaf6c('0xe3')]===_0xaf6c('0xe2')){_0x4a1906['push'](this['agents'][_0x2eed5c]['id']);}}}this[_0xaf6c('0xcd')](_0x4a5d69['id'],_0x4a1906,_0x525afc,_0x4a5d69['dialOrderByScheduledAt'],_0x4a5d69)[_0xaf6c('0x3f')](function(_0x3c9e05){_0x4a5d69[_0xaf6c('0xce')]-=_0x525afc;_0x4a5d69['temp']=_0x4a5d69[_0xaf6c('0xce')]>0x0?_0x4a5d69[_0xaf6c('0xce')]:0x0;if(!checkContactEmpty(_0x3c9e05)){_0x23f61f[_0xaf6c('0xbb')](_0x4a5d69)[_0xaf6c('0x3f')](sendMessageReschedule(_0x4a5d69))['catch'](loggerCatch(_0xaf6c('0xbd')));}else{_0x4a5d69['originated']+=_0x3c9e05[_0xaf6c('0x9c')];_0x4a5d69['message']=_0x4a5d69[_0xaf6c('0x5e')]===_0xaf6c('0x7')?_0xaf6c('0x181'):_0xaf6c('0x219');for(var _0x2fa3d1=0x0;_0x2fa3d1<_0x3c9e05[_0xaf6c('0x9c')];_0x2fa3d1+=0x1){if(_['isNil'](_0x3c9e05[_0x2fa3d1])||_[_0xaf6c('0xb3')](_0x3c9e05[_0x2fa3d1][_0xaf6c('0x18f')])||_[_0xaf6c('0xb3')](_0x3c9e05[_0x2fa3d1][_0xaf6c('0x17c')])){_0x23f61f['emptyContact']('[actionOriginate]\x20',_0x4a5d69,_0x3c9e05[_0x2fa3d1]);}else{_0x23f61f[_0xaf6c('0xbe')](_[_0xaf6c('0x137')](_0x3c9e05[_0x2fa3d1],['VoiceQueueId',_0xaf6c('0x21c')]))['then'](_0x23f61f[_0xaf6c('0x1fe')](_0x4a5d69,_0x3c9e05[_0x2fa3d1]))[_0xaf6c('0xc1')](_0x23f61f['loggerHandler'](_0xaf6c('0x21b'),_0x4a5d69));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x4a5d69,_0x525afc));}};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x92')]=function(_0x58ada0){if(_0x58ada0[_0xaf6c('0x21e')]>0x0){var _0x3ca7ca=_0x58ada0[_0xaf6c('0x21e')]-_0x58ada0[_0xaf6c('0x9d')]-_0x58ada0[_0xaf6c('0x1da')];if(_0x3ca7ca>0x0){this[_0xaf6c('0x21f')](_0x58ada0);}else{loggerPredictiveCalls[_0xaf6c('0x82')]('[handlePredictive][limitChannel]');}}else{this[_0xaf6c('0x21f')](_0x58ada0);}};Dialer[_0xaf6c('0x1c')]['tryOriginatePredictive']=function(_0x588b07){var _0x2dee29=this;var _0x38bb9b=[];_0x588b07[_0xaf6c('0x9d')]+=0x1;for(var _0x1272fe in this['agents']){if(typeof this[_0xaf6c('0x22')][_0x1272fe]!==_0xaf6c('0x9e')){if(this[_0xaf6c('0x22')][_0x1272fe][_0xaf6c('0xac')]===_0xaf6c('0x220')&&this['agents'][_0x1272fe]['status']===_0xaf6c('0xe2')){_0x38bb9b[_0xaf6c('0x136')](this['agents'][_0x1272fe]['id']);}}}this[_0xaf6c('0xcd')](_0x588b07['id'],_0x38bb9b,0x1,_0x588b07['dialOrderByScheduledAt'],_0x588b07)[_0xaf6c('0x3f')](function(_0x1b35d5){if(!checkContactEmpty(_0x1b35d5)){checkContactLowerLimitOriginate(_0x588b07,0x1,0x0);_0x2dee29[_0xaf6c('0xbb')](_0x588b07)[_0xaf6c('0x3f')](sendMessageReschedule(_0x588b07))[_0xaf6c('0xc1')](loggerCatch('[countReScheduled]\x20'));}else{_0x588b07[_0xaf6c('0x42')]='RUNNING';if(_['isNil'](_0x1b35d5[0x0])||_['isNil'](_0x1b35d5[0x0]['Contact'])||_['isNil'](_0x1b35d5[0x0][_0xaf6c('0x17c')])){_0x2dee29[_0xaf6c('0xd7')](_0xaf6c('0x21b'),_0x588b07,_0x1b35d5[0x0]);}else{_0x2dee29[_0xaf6c('0xbe')](_[_0xaf6c('0x137')](_0x1b35d5[0x0],['VoiceQueueId',_0xaf6c('0x21c')]))[_0xaf6c('0x3f')](_0x2dee29[_0xaf6c('0x1fe')](_0x588b07,_0x1b35d5[0x0]))[_0xaf6c('0xc1')](_0x2dee29[_0xaf6c('0x221')]('[actionOriginatePredictive]\x20',_0x588b07));}}})['catch'](loggerGetContactDialer(_0xaf6c('0x222'),_0x588b07,0x1));emitVoiceQueueSummary(_0x588b07);};Dialer[_0xaf6c('0x1c')][_0xaf6c('0x1f0')]=function(_0x460107,_0x33a69b,_0x3b2bea,_0x418789,_0x46a621,_0x3a85da){loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x223'));loggerPredictive[_0xaf6c('0x82')]('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',_0x460107);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x224'),_0x33a69b);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x225'),_0x3b2bea);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x226'),_0x418789);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46a621);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x89'));return new Promise(function(_0x26ea03,_0x4692ec){if(_0x460107<=0x0||isNaN(_0x460107)){return _0x4692ec(msgResponse('[abandonmentRate]','Error','m\x20=\x20'+_0x460107));}if(_0x3b2bea<=0x0||isNaN(_0x3b2bea)){return _0x4692ec(msgResponse('[abandonmentRate]',_0xaf6c('0x4d'),'Ts\x20=\x20'+_0x3b2bea));}if(_0x418789<=0x0||isNaN(_0x418789)){return _0x4692ec(msgResponse(_0xaf6c('0x227'),'Error','p\x20=\x20'+_0x418789));}if(_0x33a69b<=0x0||isNaN(_0x33a69b)){return _0x4692ec(msgResponse(_0xaf6c('0x227'),_0xaf6c('0x4d'),_0xaf6c('0x228')+_0x33a69b));}if(_0x46a621<=0x0||isNaN(_0x46a621)){return _0x4692ec(msgResponse('[abandonmentRate]',_0xaf6c('0x4d'),_0xaf6c('0x229')+_0x46a621));}_0x3a85da=_0x3a85da||0x0;var _0x46d722=0x1/_0x3b2bea;var _0x1855a0=0x0;var _0x2ec4bf=0x0;var _0x3138e2=0x0;var _0x30a65d=0x0;for(var _0x59320a=0x0;_0x3138e2<_0x46a621;_0x59320a+=0x1){_0x2ec4bf=_0x59320a/_0x33a69b;_0x1855a0=(_0x418789*_0x2ec4bf+_0x3a85da)/_0x46d722;_0x3138e2=erlangb(_0x1855a0,_0x460107);_0x30a65d=_0x1855a0/_0x460107*(0x1-erlangb(_0x1855a0,_0x460107));}return _0x26ea03({'erlangCalls':_0x59320a,'erlangCallToSecond':_0x33a69b/_0x59320a,'erlangAbandonmentRate':_0x3138e2,'erlangBusyFactor':_0x30a65d});});};Dialer['prototype'][_0xaf6c('0x1f2')]=function(_0x34ff79,_0x490b76,_0x482ada,_0x548512,_0x45e440,_0x10ac48){loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x22a'));loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x22b'),_0x34ff79);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x224'),_0x490b76);loggerPredictive['info'](_0xaf6c('0x225'),_0x482ada);loggerPredictive['info'](_0xaf6c('0x226'),_0x548512);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x22c'),_0x45e440);loggerPredictive[_0xaf6c('0x82')](_0xaf6c('0x89'));return new Promise(function(_0x365678,_0x3ba2f1){if(_0x34ff79<=0x0||isNaN(_0x34ff79)){return _0x3ba2f1(msgResponse(_0xaf6c('0x22d'),'Error','m\x20=\x20'+_0x34ff79));}if(_0x482ada<=0x0||isNaN(_0x482ada)){return _0x3ba2f1(msgResponse(_0xaf6c('0x22d'),_0xaf6c('0x4d'),_0xaf6c('0x22e')+_0x482ada));}if(_0x548512<=0x0||isNaN(_0x548512)){return _0x3ba2f1(msgResponse(_0xaf6c('0x22d'),_0xaf6c('0x4d'),_0xaf6c('0x22f')+_0x548512));}if(_0x490b76<=0x0||isNaN(_0x490b76)){return _0x3ba2f1(msgResponse('[busyFactor]','Error',_0xaf6c('0x228')+_0x490b76));}if(_0x45e440<=0x0||isNaN(_0x45e440)){return _0x3ba2f1(msgResponse(_0xaf6c('0x22d'),'Error','Umin\x20=\x20'+_0x45e440));}_0x10ac48=_0x10ac48||0x0;var _0x1d7603=0x1/_0x482ada;var _0x2a7f20=0x0;var _0x1ab078=0x0;var _0x578136=0x0;var _0x43d3f2=0x0;for(var _0xbee746=0x0;_0x43d3f2<_0x45e440;_0xbee746+=0x1){_0x1ab078=_0xbee746/_0x490b76;_0x2a7f20=(_0x548512*_0x1ab078+_0x10ac48)/_0x1d7603;_0x578136=erlangb(_0x2a7f20,_0x34ff79);_0x43d3f2=_0x2a7f20/_0x34ff79*(0x1-erlangb(_0x2a7f20,_0x34ff79));}return _0x365678({'erlangCalls':_0xbee746,'erlangCallToSecond':_0x490b76/_0xbee746,'erlangAbandonmentRate':_0x578136,'erlangBusyFactor':_0x43d3f2});});};module[_0xaf6c('0x230')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index b017292..61b4d9b 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 _0x2fa9=['calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid'];(function(_0x23423f,_0x59858f){var _0x3b4572=function(_0x3cce35){while(--_0x3cce35){_0x23423f['push'](_0x23423f['shift']());}};_0x3b4572(++_0x59858f);}(_0x2fa9,0x1e9));var _0x92fa=function(_0x179c43,_0x1d3e72){_0x179c43=_0x179c43-0x0;var _0x4df92b=_0x2fa9[_0x179c43];return _0x4df92b;};'use strict';var util=require(_0x92fa('0x0'));var _=require(_0x92fa('0x1'));var moment=require('moment');function getSeconds(_0x4f9102,_0x123f1f){var _0x2c4883=moment(_0x4f9102)[_0x92fa('0x2')](0x0);var _0x2a8f40=moment(_0x123f1f)[_0x92fa('0x2')](0x0);return _0x2c4883[_0x92fa('0x3')](_0x2a8f40,'seconds');}function QueueCallerAbandon(_0x31d87c,_0x58e34e){this[_0x92fa('0x4')]=_0x31d87c['scheduledat'];this[_0x92fa('0x5')]=_0x31d87c[_0x92fa('0x5')];this['campaigntype']=_0x31d87c['type']===_0x92fa('0x6')?_0x92fa('0x7'):_0x31d87c[_0x92fa('0x5')];this[_0x92fa('0x8')]=_0x31d87c[_0x92fa('0x8')];this[_0x92fa('0x9')]=_0x31d87c[_0x92fa('0x9')];this[_0x92fa('0xa')]=_0x31d87c['countnoanswerretry'];this[_0x92fa('0xb')]=_0x31d87c[_0x92fa('0x8')]+_0x31d87c[_0x92fa('0x9')]+_0x31d87c[_0x92fa('0xa')]+_0x31d87c['countnosuchnumberretry']+_0x31d87c['countdropretry']+_0x31d87c[_0x92fa('0xc')]+_0x31d87c[_0x92fa('0xd')]+_0x31d87c[_0x92fa('0xe')];this['countnosuchnumberretry']=_0x31d87c[_0x92fa('0xf')];this[_0x92fa('0x10')]=_0x31d87c[_0x92fa('0x10')];this[_0x92fa('0xc')]=_0x31d87c['countabandonedretry'];this[_0x92fa('0xd')]=_0x31d87c[_0x92fa('0xd')];this[_0x92fa('0xe')]=_0x31d87c['countagentrejectretry'];this[_0x92fa('0x11')]=_0x58e34e[_0x92fa('0x11')];this[_0x92fa('0x12')]=_0x31d87c[_0x92fa('0x13')];this['calleridnum']=_0x31d87c[_0x92fa('0x14')];this[_0x92fa('0x15')]=_0x31d87c[_0x92fa('0x15')];this[_0x92fa('0x16')]=_0x31d87c['responsetime'];this['droptime']=_0x31d87c[_0x92fa('0x17')];this[_0x92fa('0x18')]=this[_0x92fa('0x17')];this[_0x92fa('0x19')]=getSeconds(_0x31d87c['responsetime'],_0x31d87c[_0x92fa('0x15')]);this[_0x92fa('0x1a')]=getSeconds(this['droptime'],_0x31d87c[_0x92fa('0x16')]);this['talktime']=0x0;this[_0x92fa('0x7')]=_0x58e34e[_0x92fa('0x7')];this['membername']=_0x58e34e[_0x92fa('0x1b')];this[_0x92fa('0x1c')]=_0x58e34e[_0x92fa('0x1c')];this['callback']=_0x31d87c['callback'];this[_0x92fa('0x1d')]=_0x31d87c[_0x92fa('0x1d')];this[_0x92fa('0x1e')]=_0x31d87c[_0x92fa('0x1e')];this[_0x92fa('0x1f')]=_0x31d87c[_0x92fa('0x1f')];this[_0x92fa('0x20')]=_0x31d87c['ContactId'];this['ListId']=_0x31d87c[_0x92fa('0x21')];this[_0x92fa('0x22')]=_0x31d87c[_0x92fa('0x22')];this[_0x92fa('0x23')]=_0x31d87c[_0x92fa('0x23')];this['CampaignId']=_0x31d87c[_0x92fa('0x24')];this['originatecalleridnum']=_0x31d87c['originatecalleridnum']||'';this[_0x92fa('0x25')]=_0x31d87c['originatecalleridname']||'';}module[_0x92fa('0x26')]=QueueCallerAbandon; \ No newline at end of file +var _0x4771=['starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x544089,_0x617853){var _0x39e73f=function(_0x200b46){while(--_0x200b46){_0x544089['push'](_0x544089['shift']());}};_0x39e73f(++_0x617853);}(_0x4771,0x150));var _0x1477=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x4771[_0x5f0089];return _0x193892;};'use strict';var util=require(_0x1477('0x0'));var _=require(_0x1477('0x1'));var moment=require(_0x1477('0x2'));function getSeconds(_0xa5e1bc,_0x24068f){var _0x35a577=moment(_0xa5e1bc)[_0x1477('0x3')](0x0);var _0x5ba5e9=moment(_0x24068f)['milliseconds'](0x0);return _0x35a577[_0x1477('0x4')](_0x5ba5e9,_0x1477('0x5'));}function QueueCallerAbandon(_0x5579e2,_0x3e2a87){this[_0x1477('0x6')]=_0x5579e2[_0x1477('0x6')];this[_0x1477('0x7')]=_0x5579e2[_0x1477('0x7')];this[_0x1477('0x8')]=_0x5579e2[_0x1477('0x7')]===_0x1477('0x9')?_0x1477('0xa'):_0x5579e2[_0x1477('0x7')];this[_0x1477('0xb')]=_0x5579e2[_0x1477('0xb')];this[_0x1477('0xc')]=_0x5579e2[_0x1477('0xc')];this[_0x1477('0xd')]=_0x5579e2[_0x1477('0xd')];this[_0x1477('0xe')]=_0x5579e2['countbusyretry']+_0x5579e2['countcongestionretry']+_0x5579e2[_0x1477('0xd')]+_0x5579e2[_0x1477('0xf')]+_0x5579e2[_0x1477('0x10')]+_0x5579e2[_0x1477('0x11')]+_0x5579e2['countmachineretry']+_0x5579e2[_0x1477('0x12')];this[_0x1477('0xf')]=_0x5579e2[_0x1477('0xf')];this[_0x1477('0x10')]=_0x5579e2[_0x1477('0x10')];this[_0x1477('0x11')]=_0x5579e2[_0x1477('0x11')];this['countmachineretry']=_0x5579e2['countmachineretry'];this[_0x1477('0x12')]=_0x5579e2['countagentrejectretry'];this['uniqueid']=_0x3e2a87[_0x1477('0x13')];this[_0x1477('0x14')]=_0x5579e2[_0x1477('0x15')];this[_0x1477('0x16')]=_0x5579e2[_0x1477('0x17')];this['starttime']=_0x5579e2[_0x1477('0x18')];this['responsetime']=_0x5579e2[_0x1477('0x19')];this[_0x1477('0x1a')]=_0x5579e2[_0x1477('0x1a')];this[_0x1477('0x1b')]=this[_0x1477('0x1a')];this[_0x1477('0x1c')]=getSeconds(_0x5579e2[_0x1477('0x19')],_0x5579e2['starttime']);this[_0x1477('0x1d')]=getSeconds(this[_0x1477('0x1a')],_0x5579e2[_0x1477('0x19')]);this[_0x1477('0x1e')]=0x0;this[_0x1477('0xa')]=_0x3e2a87['queue'];this[_0x1477('0x1f')]=_0x3e2a87[_0x1477('0x20')];this['reason']=_0x3e2a87[_0x1477('0x21')];this[_0x1477('0x22')]=_0x5579e2[_0x1477('0x22')];this[_0x1477('0x23')]=_0x5579e2[_0x1477('0x23')];this['callbackat']=_0x5579e2['callbackat'];this['recallme']=_0x5579e2[_0x1477('0x24')];this[_0x1477('0x25')]=_0x5579e2['ContactId'];this[_0x1477('0x26')]=_0x5579e2[_0x1477('0x26')];this[_0x1477('0x27')]=_0x5579e2[_0x1477('0x27')];this['VoiceQueueId']=_0x5579e2[_0x1477('0x28')];this[_0x1477('0x29')]=_0x5579e2[_0x1477('0x29')];this[_0x1477('0x2a')]=_0x5579e2[_0x1477('0x2a')]||'';this[_0x1477('0x2b')]=_0x5579e2['originatecalleridname']||'';}module[_0x1477('0x2c')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 01643fd..885e4de 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(_0x2084b6,_0x2f9ed6){var _0x17f293=function(_0x257df1){while(--_0x257df1){_0x2084b6['push'](_0x2084b6['shift']());}};_0x17f293(++_0x2f9ed6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2357fd,_0x448d7d){var _0x306c00=function(_0x44b387){while(--_0x44b387){_0x2357fd['push'](_0x2357fd['shift']());}};_0x306c00(++_0x448d7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 574ac71..11d8616 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 _0x26c2=['path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','prototype','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','actions','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','message','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','moment'];(function(_0x3d0a87,_0x5654a0){var _0xe5659e=function(_0x2ef050){while(--_0x2ef050){_0x3d0a87['push'](_0x3d0a87['shift']());}};_0xe5659e(++_0x5654a0);}(_0x26c2,0x74));var _0x226c=function(_0x37d805,_0x3ff049){_0x37d805=_0x37d805-0x0;var _0x3d7cb8=_0x26c2[_0x37d805];return _0x3d7cb8;};'use strict';var util=require('util');var _=require(_0x226c('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x226c('0x1'));var path=require(_0x226c('0x2'));var tiff2pdf=require(_0x226c('0x3'));var gs=require('./util/gs');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var ami=require(_0x226c('0x6'));var rpcDb=require(_0x226c('0x7'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x226c('0x8'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x226c('0x9'));var faxMessage=require(_0x226c('0xa'));function Fax(_0x4e4944){this[_0x226c('0xb')]={};this[_0x226c('0xc')]=_0x4e4944[_0x226c('0xc')];this[_0x226c('0xd')]=_0x4e4944['trunks'];this['actions']={};ami['on'](_0x226c('0xe'),this[_0x226c('0xf')]['bind'](this));ami['on'](_0x226c('0x10'),this[_0x226c('0x11')][_0x226c('0x12')](this));ami['on'](_0x226c('0x13'),this['syncNewState'][_0x226c('0x12')](this));ami['on']('newexten',this[_0x226c('0x14')]['bind'](this));ami['on']('faxstatus',this[_0x226c('0x15')][_0x226c('0x12')](this));ami['on'](_0x226c('0x16'),this[_0x226c('0x17')]['bind'](this));ami['on'](_0x226c('0x18'),this[_0x226c('0x19')][_0x226c('0x12')](this));ami['on'](_0x226c('0x1a'),this[_0x226c('0x1b')][_0x226c('0x12')](this));}Fax['prototype'][_0x226c('0xf')]=function(_0x22e34d){if(_0x22e34d[_0x226c('0x1c')]===_0x226c('0x1d')){for(var _0x4069e7 in this[_0x226c('0xc')]){if(this[_0x226c('0xc')]['hasOwnProperty'](_0x4069e7)){if(_0x22e34d[_0x226c('0x1e')]===this[_0x226c('0xc')][_0x4069e7][_0x226c('0x1f')]){this[_0x226c('0xb')][_0x22e34d[_0x226c('0x20')]]={};this['channels'][_0x22e34d[_0x226c('0x20')]][_0x226c('0x21')]=_0x22e34d[_0x226c('0x21')];this['channels'][_0x22e34d[_0x226c('0x20')]]['id']=this[_0x226c('0xc')][_0x4069e7]['id'];this[_0x226c('0xb')][_0x22e34d[_0x226c('0x20')]][_0x226c('0x22')]=this[_0x226c('0xc')][_0x4069e7]['name'];logger[_0x226c('0x23')](_0x22e34d[_0x226c('0x20')],_0x226c('0x24'));}}}}if(this['actions'][_0x22e34d['uniqueid']]){this[_0x226c('0xb')][_0x22e34d[_0x226c('0x20')]]={};this['channels'][_0x22e34d[_0x226c('0x20')]][_0x226c('0x21')]=_0x22e34d['channel'];logger[_0x226c('0x23')](_0x22e34d['uniqueid'],_0x226c('0x24'));}};Fax['prototype'][_0x226c('0x11')]=function(_0x9ab765){if(this['channels'][_0x9ab765['uniqueid']]){for(var _0x1688b1 in _0x9ab765[_0x226c('0x25')]){if(_0x9ab765[_0x226c('0x25')][_0x226c('0x26')](_0x1688b1)){this[_0x226c('0xb')][_0x9ab765[_0x226c('0x20')]][_0x1688b1]=_0x9ab765[_0x226c('0x27')];}}}};Fax[_0x226c('0x28')][_0x226c('0x29')]=function(_0x424644){if(this[_0x226c('0xb')][_0x424644[_0x226c('0x20')]]){this[_0x226c('0xb')][_0x424644['uniqueid']][_0x226c('0x2a')]=_0x424644[_0x226c('0x2a')];this[_0x226c('0xb')][_0x424644[_0x226c('0x20')]][_0x226c('0x2b')]=_0x424644[_0x226c('0x2b')];}};Fax[_0x226c('0x28')][_0x226c('0x14')]=function(_0x47381f){if(this[_0x226c('0xb')][_0x47381f['uniqueid']]){for(var _0x3743d6 in _0x47381f[_0x226c('0x25')]){if(_0x47381f[_0x226c('0x25')]['hasOwnProperty'](_0x3743d6)){this[_0x226c('0xb')][_0x47381f[_0x226c('0x20')]][_0x3743d6]=_0x47381f[_0x226c('0x27')];}}}};Fax[_0x226c('0x28')][_0x226c('0x15')]=function(_0x4cf454){if(this[_0x226c('0xb')][_0x4cf454[_0x226c('0x20')]]){this['channels'][_0x4cf454[_0x226c('0x20')]][_0x226c('0x2c')]=_0x4cf454[_0x226c('0x2c')];this[_0x226c('0xb')][_0x4cf454['uniqueid']][_0x226c('0x2d')]=_0x4cf454[_0x226c('0x2d')];this[_0x226c('0xb')][_0x4cf454[_0x226c('0x20')]]['localstationid']=_0x4cf454[_0x226c('0x1f')];this['channels'][_0x4cf454['uniqueid']][_0x226c('0x2e')]=_0x4cf454[_0x226c('0x2e')];logger[_0x226c('0x23')](_0x4cf454[_0x226c('0x20')],_0x226c('0x2f'));}};Fax[_0x226c('0x28')][_0x226c('0x17')]=function(_0x4192b4){var _0x26497f=this;if(this[_0x226c('0xb')][_0x4192b4[_0x226c('0x20')]]){var _0x53d221=this[_0x226c('0xb')][_0x4192b4['uniqueid']]['id'];this['channels'][_0x4192b4[_0x226c('0x20')]][_0x226c('0x30')]=_0x4192b4[_0x226c('0x30')];this[_0x226c('0xb')][_0x4192b4['uniqueid']][_0x226c('0x31')]=_0x4192b4[_0x226c('0x31')];this['channels'][_0x4192b4[_0x226c('0x20')]][_0x226c('0x1f')]=_0x4192b4[_0x226c('0x1f')];this[_0x226c('0xb')][_0x4192b4[_0x226c('0x20')]]['resolution']=_0x4192b4[_0x226c('0x32')];this['channels'][_0x4192b4['uniqueid']][_0x226c('0x33')]=_0x4192b4['transferrate'];this[_0x226c('0xb')][_0x4192b4['uniqueid']][_0x226c('0x2e')]=_0x4192b4[_0x226c('0x2e')];this[_0x226c('0xb')][_0x4192b4[_0x226c('0x20')]][_0x226c('0x34')]=_0x4192b4[_0x226c('0x34')];if(this[_0x226c('0xb')][_0x4192b4['uniqueid']][_0x226c('0x31')]>0x0){tiff2pdf(_0x4192b4[_0x226c('0x2e')],_0x226c('0x35'),function(_0x335c1c){logger[_0x226c('0x23')](_0x4192b4[_0x226c('0x20')],'\x20result\x20conversion\x20file\x20',_0x335c1c['message']);attachment[_0x226c('0x36')]({'name':path['parse'](_0x4192b4['filename'])[_0x226c('0x22')],'basename':path[_0x226c('0x37')](_0x4192b4['filename'])[_0x226c('0x22')]+_0x226c('0x38'),'type':_0x226c('0x39')})[_0x226c('0x3a')](function(_0x52ae1a){faxAccount[_0x226c('0x3b')](_0x53d221,{'from':_0x4192b4['calleridnum'],'mapKey':'fax','body':path[_0x226c('0x37')](_0x4192b4[_0x226c('0x2e')])['name']+_0x226c('0x38'),'AttachmentId':_0x52ae1a['id']})[_0x226c('0x3c')](function(_0x59f11f){logger[_0x226c('0x3d')](_0x4192b4[_0x226c('0x20')],_0x226c('0x3e'),JSON[_0x226c('0x3f')](_0x59f11f));});})[_0x226c('0x3c')](function(_0x42294a){logger[_0x226c('0x3d')](_0x4192b4[_0x226c('0x20')],'\x20receiveFax\x20',JSON['stringify'](_0x42294a));});});}logger[_0x226c('0x23')](_0x4192b4[_0x226c('0x20')],_0x226c('0x40'));}};Fax['prototype'][_0x226c('0x1b')]=function(_0x31f1e0){if(this[_0x226c('0x41')][_0x31f1e0[_0x226c('0x20')]]){_[_0x226c('0x42')](this[_0x226c('0xb')][_0x31f1e0[_0x226c('0x20')]],_[_0x226c('0x43')](_0x31f1e0,[_0x226c('0x44'),_0x226c('0x45')]));}};function updateStatus(_0x4a81fe){if(_0x4a81fe[_0x226c('0x46')]){faxMessage[_0x226c('0x47')](_0x4a81fe['AttachmentId'],{'failMessage':_0x226c('0x48')})['then'](function(_0x1c981c){ut[_0x226c('0x49')]('[Fax][Message][Error][Updated]',_0x1c981c);})[_0x226c('0x3c')](function(_0x44e14c){ut[_0x226c('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x44e14c);});}else{ut[_0x226c('0x49')](_0x226c('0x4a'));}}Fax[_0x226c('0x28')][_0x226c('0x4b')]=function(_0x14d24b,_0x55fba3,_0x5eedaf){var _0x3541b1=this;var _0x2e9955={};if(_0x55fba3){_0x2e9955={'read':_0x55fba3};}else{_0x2e9955={'failMessage':_0x5eedaf};}if(this[_0x226c('0x41')][_0x14d24b][_0x226c('0x46')]){faxMessage[_0x226c('0x47')](this[_0x226c('0x41')][_0x14d24b][_0x226c('0x46')],_0x2e9955)[_0x226c('0x3a')](function(_0xb9fd8c){ut['logger'](_0x226c('0x4c'),_0xb9fd8c);})[_0x226c('0x3c')](function(_0x4e430b){ut['logger'](_0x226c('0x4d'),_0x4e430b);})[_0x226c('0x4e')](function(){delete _0x3541b1[_0x226c('0xb')][_0x14d24b];delete _0x3541b1[_0x226c('0x41')][_0x14d24b];});}else{ut[_0x226c('0x49')](_0x226c('0x4f'));delete this[_0x226c('0xb')][_0x14d24b];delete this[_0x226c('0x41')][_0x14d24b];}};Fax[_0x226c('0x28')][_0x226c('0x19')]=function(_0x4b5d8a){var _0x47e235=this;if(this['channels'][_0x4b5d8a[_0x226c('0x20')]]){if(this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]){this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]]['id']=this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]['id'];this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]][_0x226c('0x22')]=this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]['name'];}logger['info'](_0x4b5d8a['uniqueid'],this[_0x226c('0x41')][_0x4b5d8a['uniqueid']]?_0x226c('0x50'):_0x226c('0x51'),JSON['stringify'](this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]]));if(this[_0x226c('0x41')][_0x4b5d8a[_0x226c('0x20')]]){if(this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]][_0x226c('0x52')]>0x0&&this['channels'][_0x4b5d8a['uniqueid']][_0x226c('0x53')]===_0x226c('0x54')){this[_0x226c('0x4b')](_0x4b5d8a[_0x226c('0x20')],!![]);}else{this['updateStatus'](_0x4b5d8a[_0x226c('0x20')],![],this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]][_0x226c('0x55')]?_0x226c('0x56')+this[_0x226c('0xb')][_0x4b5d8a[_0x226c('0x20')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x226c('0x28')][_0x226c('0x57')]=function(_0x38d43b){var _0x37377d=this;return new BPromise(function(_0x300866,_0x19b6b1){_0x37377d[_0x226c('0x58')](_0x38d43b,_0x37377d[_0x226c('0xc')][_0x38d43b[_0x226c('0x59')]])[_0x226c('0x3a')](function(_0x4d6b97){ut[_0x226c('0x49')](_0x226c('0x5a'),_0x4d6b97);_0x300866(ut['message']('Fax\x20received'));})[_0x226c('0x3c')](function(_0x1ba17d){ut['logger'](_0x226c('0x5b'),_0x1ba17d);updateStatus(_0x38d43b);_0x19b6b1(ut[_0x226c('0x5c')](_0x226c('0x5d')));});});};Fax['prototype'][_0x226c('0x5e')]=function(_0x240eaf){var _0x46bcd7=this;return new BPromise(function(_0x14ab10,_0x4ccb9f){var _0x26e47e=_0x46bcd7[_0x226c('0x5f')](_0x46bcd7[_0x226c('0xc')][_0x240eaf[_0x226c('0x59')]][_0x226c('0x60')],_0x240eaf);if(_0x26e47e[_0x226c('0x61')]){_0x14ab10(ut[_0x226c('0x5c')]('Trunk\x20Reachable'));}else{_0x4ccb9f(ut[_0x226c('0x5c')](_0x26e47e[_0x226c('0x5c')]));}});};function originate(_0x304fc3,_0x122ef1,_0xbf902b){return new BPromise(function(_0x341b29,_0x4d38df){if(_0xbf902b){var _0x494ade=util[_0x226c('0x62')](_0x226c('0x63'),path[_0x226c('0x37')](_0x304fc3[_0x226c('0x2')])[_0x226c('0x22')],_0x304fc3[_0x226c('0x2')]);gs[_0x226c('0x64')](_0x494ade)['then'](function(){_0x304fc3['path']=util[_0x226c('0x62')](_0x226c('0x65'),path[_0x226c('0x37')](_0x304fc3[_0x226c('0x2')])['dir'],path[_0x226c('0x37')](_0x304fc3[_0x226c('0x2')])['name']);_0x122ef1[_0x226c('0x66')]=_0x304fc3[_0x226c('0x2')];ut[_0x226c('0x49')](_0x226c('0x67'),'');ami[_0x226c('0x68')](ut[_0x226c('0x69')](_0x304fc3,_0x122ef1))['then'](function(_0x3c7913){_0x341b29(_0x3c7913);})[_0x226c('0x3c')](function(_0x41dcb5){_0x4d38df(_0x41dcb5);});})[_0x226c('0x3c')](function(_0x20cf7a){_0x4d38df(_0x20cf7a);});}else{ami[_0x226c('0x68')](ut[_0x226c('0x69')](_0x304fc3,_0x122ef1))[_0x226c('0x3a')](function(_0x5d649f){_0x341b29(_0x5d649f);})[_0x226c('0x3c')](function(_0x1df225){_0x4d38df(_0x1df225);});}});}Fax[_0x226c('0x28')][_0x226c('0x58')]=function(_0x555f2c,_0x24f588){var _0x3e47d1=this;return new BPromise(function(_0x1704f9,_0x79311d){var _0x12e35b=uuid['v4']();var _0x5bc65f=ut[_0x226c('0x6a')](_0x555f2c,_0x24f588);_0x3e47d1['actions'][_0x12e35b]=new Action(_0x12e35b,_0x24f588,_0x555f2c);var _0x311d7f=_0x3e47d1[_0x226c('0x41')][_0x12e35b];if(path[_0x226c('0x37')](_0x555f2c[_0x226c('0x2')])[_0x226c('0x6b')]===_0x226c('0x38')){originate(_0x311d7f,_0x5bc65f,!![])[_0x226c('0x3a')](function(_0x308b79){_0x1704f9(_0x308b79);})[_0x226c('0x3c')](function(_0x4e25fa){_0x79311d(_0x4e25fa);});}else{originate(_0x311d7f,_0x5bc65f,![])['then'](function(_0xcb8ee0){_0x1704f9(_0xcb8ee0);})[_0x226c('0x3c')](function(_0x438dea){_0x79311d(_0x438dea);});}});};Fax[_0x226c('0x28')][_0x226c('0x6c')]=function(_0x58e9a4){return!_['isNil'](_0x58e9a4)&&!_[_0x226c('0x6d')](_0x58e9a4[_0x226c('0x22')])&&!_[_0x226c('0x6d')](_0x58e9a4['active'])&&_0x58e9a4['active']&&!_[_0x226c('0x6d')](this['trunks'][util[_0x226c('0x62')](_0x226c('0x6e'),_0x58e9a4['name'])])&&!_['isNil'](this[_0x226c('0xd')][util['format'](_0x226c('0x6e'),_0x58e9a4[_0x226c('0x22')])][_0x226c('0x2d')])&&(this[_0x226c('0xd')][util[_0x226c('0x62')](_0x226c('0x6e'),_0x58e9a4['name'])][_0x226c('0x2d')]===_0x226c('0x6f')||this[_0x226c('0xd')][util[_0x226c('0x62')]('SIP/%s',_0x58e9a4[_0x226c('0x22')])][_0x226c('0x2d')]===_0x226c('0x70'));};Fax[_0x226c('0x28')][_0x226c('0x5f')]=function(_0x49c61d,_0xaf1996){if(!this['isTrunkReachable'](_0x49c61d)){ut[_0x226c('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x226c('0x6d')](_0x49c61d)?'':_0x49c61d[_0x226c('0x22')]+_0x226c('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0xaf1996[_0x226c('0x5')])){ut[_0x226c('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x226c('0x3f')](_0xaf1996));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x226c('0x6d')](_0xaf1996[_0x226c('0x2')])){ut[_0x226c('0x49')](_0x226c('0x72'),JSON[_0x226c('0x3f')](_0xaf1996));return{'isValid':![],'message':_0x226c('0x73')};}return{'isValid':!![],'message':_0x226c('0x74')};};module[_0x226c('0x75')]=Fax; \ No newline at end of file +var _0x77fe=['AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','moment','path','./util/gs','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','status','filename','remotestationid','pagestransferred','localstationid','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','.pdf','application/pdf','parse','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason'];(function(_0x67a753,_0x5aed39){var _0x127d95=function(_0x5843ba){while(--_0x5843ba){_0x67a753['push'](_0x67a753['shift']());}};_0x127d95(++_0x5aed39);}(_0x77fe,0x115));var _0xe77f=function(_0x30219f,_0x51fe1f){_0x30219f=_0x30219f-0x0;var _0x51c835=_0x77fe[_0x30219f];return _0x51c835;};'use strict';var util=require(_0xe77f('0x0'));var _=require(_0xe77f('0x1'));var BPromise=require(_0xe77f('0x2'));var uuid=require('uuid');var moment=require(_0xe77f('0x3'));var path=require(_0xe77f('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xe77f('0x5'));var logger=require('../../../config/logger')(_0xe77f('0x6'));var ami=require(_0xe77f('0x7'));var rpcDb=require(_0xe77f('0x8'));var Channel=require(_0xe77f('0x9'));var ut=require('./util/util');var Action=require(_0xe77f('0xa'));var faxAccount=require(_0xe77f('0xb'));var attachment=require(_0xe77f('0xc'));var faxMessage=require(_0xe77f('0xd'));function Fax(_0x402304){this[_0xe77f('0xe')]={};this[_0xe77f('0xf')]=_0x402304[_0xe77f('0xf')];this[_0xe77f('0x10')]=_0x402304[_0xe77f('0x10')];this[_0xe77f('0x11')]={};ami['on'](_0xe77f('0x12'),this[_0xe77f('0x13')][_0xe77f('0x14')](this));ami['on'](_0xe77f('0x15'),this[_0xe77f('0x16')]['bind'](this));ami['on']('newstate',this[_0xe77f('0x17')][_0xe77f('0x14')](this));ami['on']('newexten',this[_0xe77f('0x18')]['bind'](this));ami['on'](_0xe77f('0x19'),this['syncFaxStatus'][_0xe77f('0x14')](this));ami['on'](_0xe77f('0x1a'),this[_0xe77f('0x1b')][_0xe77f('0x14')](this));ami['on'](_0xe77f('0x1c'),this[_0xe77f('0x1d')][_0xe77f('0x14')](this));ami['on']('originateresponse',this[_0xe77f('0x1e')]['bind'](this));}Fax[_0xe77f('0x1f')][_0xe77f('0x13')]=function(_0x3cfab4){if(_0x3cfab4[_0xe77f('0x20')]===_0xe77f('0x21')){for(var _0x48f0a7 in this[_0xe77f('0xf')]){if(this[_0xe77f('0xf')][_0xe77f('0x22')](_0x48f0a7)){if(_0x3cfab4[_0xe77f('0x23')]===this[_0xe77f('0xf')][_0x48f0a7]['localstationid']){this[_0xe77f('0xe')][_0x3cfab4[_0xe77f('0x24')]]={};this['channels'][_0x3cfab4[_0xe77f('0x24')]]['channel']=_0x3cfab4[_0xe77f('0x25')];this['channels'][_0x3cfab4['uniqueid']]['id']=this['faxAccounts'][_0x48f0a7]['id'];this[_0xe77f('0xe')][_0x3cfab4[_0xe77f('0x24')]]['name']=this['faxAccounts'][_0x48f0a7][_0xe77f('0x26')];logger[_0xe77f('0x27')](_0x3cfab4[_0xe77f('0x24')],_0xe77f('0x28'));}}}}if(this[_0xe77f('0x11')][_0x3cfab4['uniqueid']]){this[_0xe77f('0xe')][_0x3cfab4['uniqueid']]={};this['channels'][_0x3cfab4[_0xe77f('0x24')]]['channel']=_0x3cfab4[_0xe77f('0x25')];logger[_0xe77f('0x27')](_0x3cfab4['uniqueid'],_0xe77f('0x28'));}};Fax[_0xe77f('0x1f')][_0xe77f('0x16')]=function(_0x22c52f){if(this[_0xe77f('0xe')][_0x22c52f[_0xe77f('0x24')]]){for(var _0x38d780 in _0x22c52f[_0xe77f('0x29')]){if(_0x22c52f[_0xe77f('0x29')][_0xe77f('0x22')](_0x38d780)){this[_0xe77f('0xe')][_0x22c52f[_0xe77f('0x24')]][_0x38d780]=_0x22c52f[_0xe77f('0x2a')];}}}};Fax[_0xe77f('0x1f')][_0xe77f('0x17')]=function(_0x3a0d7e){if(this['channels'][_0x3a0d7e[_0xe77f('0x24')]]){this['channels'][_0x3a0d7e[_0xe77f('0x24')]][_0xe77f('0x2b')]=_0x3a0d7e[_0xe77f('0x2b')];this[_0xe77f('0xe')][_0x3a0d7e[_0xe77f('0x24')]][_0xe77f('0x2c')]=_0x3a0d7e[_0xe77f('0x2c')];}};Fax['prototype'][_0xe77f('0x18')]=function(_0x4337be){if(this['channels'][_0x4337be['uniqueid']]){for(var _0x1842dd in _0x4337be[_0xe77f('0x29')]){if(_0x4337be[_0xe77f('0x29')][_0xe77f('0x22')](_0x1842dd)){this['channels'][_0x4337be[_0xe77f('0x24')]][_0x1842dd]=_0x4337be[_0xe77f('0x2a')];}}}};Fax[_0xe77f('0x1f')][_0xe77f('0x2d')]=function(_0x309ebf){if(this[_0xe77f('0xe')][_0x309ebf[_0xe77f('0x24')]]){this[_0xe77f('0xe')][_0x309ebf[_0xe77f('0x24')]]['operation']=_0x309ebf['operation'];this[_0xe77f('0xe')][_0x309ebf[_0xe77f('0x24')]]['status']=_0x309ebf[_0xe77f('0x2e')];this['channels'][_0x309ebf['uniqueid']]['localstationid']=_0x309ebf['localstationid'];this[_0xe77f('0xe')][_0x309ebf['uniqueid']][_0xe77f('0x2f')]=_0x309ebf['filename'];logger['info'](_0x309ebf[_0xe77f('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0xe77f('0x1f')][_0xe77f('0x1b')]=function(_0x81508c){var _0x43893d=this;if(this[_0xe77f('0xe')][_0x81508c[_0xe77f('0x24')]]){var _0xd28990=this[_0xe77f('0xe')][_0x81508c['uniqueid']]['id'];this[_0xe77f('0xe')][_0x81508c[_0xe77f('0x24')]][_0xe77f('0x30')]=_0x81508c[_0xe77f('0x30')];this[_0xe77f('0xe')][_0x81508c['uniqueid']][_0xe77f('0x31')]=_0x81508c[_0xe77f('0x31')];this[_0xe77f('0xe')][_0x81508c[_0xe77f('0x24')]][_0xe77f('0x32')]=_0x81508c[_0xe77f('0x32')];this[_0xe77f('0xe')][_0x81508c['uniqueid']][_0xe77f('0x33')]=_0x81508c[_0xe77f('0x33')];this['channels'][_0x81508c[_0xe77f('0x24')]][_0xe77f('0x34')]=_0x81508c[_0xe77f('0x34')];this[_0xe77f('0xe')][_0x81508c[_0xe77f('0x24')]][_0xe77f('0x2f')]=_0x81508c[_0xe77f('0x2f')];this['channels'][_0x81508c['uniqueid']][_0xe77f('0x35')]=_0x81508c[_0xe77f('0x35')];if(this[_0xe77f('0xe')][_0x81508c['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x81508c[_0xe77f('0x2f')],_0xe77f('0x36'),function(_0x2838e4){logger[_0xe77f('0x27')](_0x81508c[_0xe77f('0x24')],_0xe77f('0x37'),_0x2838e4[_0xe77f('0x38')]);attachment[_0xe77f('0x39')]({'name':path['parse'](_0x81508c[_0xe77f('0x2f')])[_0xe77f('0x26')],'basename':path['parse'](_0x81508c['filename'])[_0xe77f('0x26')]+_0xe77f('0x3a'),'type':_0xe77f('0x3b')})['then'](function(_0xdfb13f){faxAccount['notify'](_0xd28990,{'from':_0x81508c[_0xe77f('0x35')],'mapKey':_0xe77f('0x6'),'body':path[_0xe77f('0x3c')](_0x81508c['filename'])['name']+_0xe77f('0x3a'),'AttachmentId':_0xdfb13f['id']})[_0xe77f('0x3d')](function(_0xdd7326){logger[_0xe77f('0x3e')](_0x81508c[_0xe77f('0x24')],_0xe77f('0x3f'),JSON[_0xe77f('0x40')](_0xdd7326));});})[_0xe77f('0x3d')](function(_0x254256){logger[_0xe77f('0x3e')](_0x81508c['uniqueid'],'\x20receiveFax\x20',JSON[_0xe77f('0x40')](_0x254256));});});}logger[_0xe77f('0x27')](_0x81508c[_0xe77f('0x24')],_0xe77f('0x41'));}};Fax[_0xe77f('0x1f')][_0xe77f('0x1e')]=function(_0x3d0c40){if(this[_0xe77f('0x11')][_0x3d0c40[_0xe77f('0x24')]]){_['merge'](this[_0xe77f('0xe')][_0x3d0c40[_0xe77f('0x24')]],_['pick'](_0x3d0c40,[_0xe77f('0x42'),_0xe77f('0x43')]));}};function updateStatus(_0x5b2110){if(_0x5b2110[_0xe77f('0x44')]){faxMessage[_0xe77f('0x45')](_0x5b2110[_0xe77f('0x44')],{'failMessage':_0xe77f('0x46')})[_0xe77f('0x47')](function(_0x580151){ut['logger']('[Fax][Message][Error][Updated]',_0x580151);})[_0xe77f('0x3d')](function(_0x189cf7){ut[_0xe77f('0x48')](_0xe77f('0x49'),_0x189cf7);});}else{ut[_0xe77f('0x48')](_0xe77f('0x4a'));}}Fax[_0xe77f('0x1f')][_0xe77f('0x4b')]=function(_0x1b7629,_0x12e35b,_0x47c84e){var _0x30fbe1=this;var _0x4f7f01={};if(_0x12e35b){_0x4f7f01={'read':_0x12e35b};}else{_0x4f7f01={'failMessage':_0x47c84e};}if(this[_0xe77f('0x11')][_0x1b7629][_0xe77f('0x44')]){faxMessage[_0xe77f('0x45')](this[_0xe77f('0x11')][_0x1b7629][_0xe77f('0x44')],_0x4f7f01)[_0xe77f('0x47')](function(_0x1e0f7c){ut['logger']('[Fax][Message][Updated]',_0x1e0f7c);})[_0xe77f('0x3d')](function(_0x104e28){ut[_0xe77f('0x48')](_0xe77f('0x4c'),_0x104e28);})['finally'](function(){delete _0x30fbe1[_0xe77f('0xe')][_0x1b7629];delete _0x30fbe1[_0xe77f('0x11')][_0x1b7629];});}else{ut[_0xe77f('0x48')](_0xe77f('0x4d'));delete this[_0xe77f('0xe')][_0x1b7629];delete this['actions'][_0x1b7629];}};Fax[_0xe77f('0x1f')]['syncHangup']=function(_0x289091){var _0x425010=this;if(this[_0xe77f('0xe')][_0x289091[_0xe77f('0x24')]]){if(this[_0xe77f('0x11')][_0x289091['uniqueid']]){this[_0xe77f('0xe')][_0x289091[_0xe77f('0x24')]]['id']=this[_0xe77f('0x11')][_0x289091['uniqueid']]['id'];this['channels'][_0x289091[_0xe77f('0x24')]][_0xe77f('0x26')]=this[_0xe77f('0x11')][_0x289091[_0xe77f('0x24')]][_0xe77f('0x26')];}logger[_0xe77f('0x27')](_0x289091['uniqueid'],this['actions'][_0x289091[_0xe77f('0x24')]]?_0xe77f('0x4e'):_0xe77f('0x4f'),JSON[_0xe77f('0x40')](this[_0xe77f('0xe')][_0x289091['uniqueid']]));if(this[_0xe77f('0x11')][_0x289091['uniqueid']]){if(this[_0xe77f('0xe')][_0x289091[_0xe77f('0x24')]][_0xe77f('0x50')]>0x0&&this['channels'][_0x289091[_0xe77f('0x24')]][_0xe77f('0x19')]==='SUCCESS'){this['updateStatus'](_0x289091[_0xe77f('0x24')],!![]);}else{this[_0xe77f('0x4b')](_0x289091['uniqueid'],![],this[_0xe77f('0xe')][_0x289091[_0xe77f('0x24')]][_0xe77f('0x51')]?_0xe77f('0x52')+this[_0xe77f('0xe')][_0x289091[_0xe77f('0x24')]][_0xe77f('0x51')]:_0xe77f('0x53'));}}}};Fax[_0xe77f('0x1f')][_0xe77f('0x54')]=function(_0x3f28e7){var _0x159b06=this;return new BPromise(function(_0x499e2d,_0x2a0a00){_0x159b06['execOriginate'](_0x3f28e7,_0x159b06['faxAccounts'][_0x3f28e7[_0xe77f('0x55')]])[_0xe77f('0x47')](function(_0xd0aeb3){ut[_0xe77f('0x48')](_0xe77f('0x56'),_0xd0aeb3);_0x499e2d(ut['message']('Fax\x20received'));})[_0xe77f('0x3d')](function(_0xdc3bf2){ut[_0xe77f('0x48')](_0xe77f('0x57'),_0xdc3bf2);updateStatus(_0x3f28e7);_0x2a0a00(ut['message'](_0xe77f('0x58')));});});};Fax[_0xe77f('0x1f')][_0xe77f('0x59')]=function(_0x5bb865){var _0x2566a6=this;return new BPromise(function(_0x5664c4,_0x8b29a){var _0x4de94d=_0x2566a6[_0xe77f('0x5a')](_0x2566a6[_0xe77f('0xf')][_0x5bb865['FaxAccountId']][_0xe77f('0x5b')],_0x5bb865);if(_0x4de94d[_0xe77f('0x5c')]){_0x5664c4(ut['message'](_0xe77f('0x5d')));}else{_0x8b29a(ut[_0xe77f('0x38')](_0x4de94d[_0xe77f('0x38')]));}});};function originate(_0x2ac7cd,_0x293b7d,_0x41f72c){return new BPromise(function(_0x3c5ae8,_0xcc0246){if(_0x41f72c){var _0x58f0c5=util[_0xe77f('0x5e')](_0xe77f('0x5f'),path['parse'](_0x2ac7cd[_0xe77f('0x4')])[_0xe77f('0x26')],_0x2ac7cd['path']);gs[_0xe77f('0x60')](_0x58f0c5)['then'](function(){_0x2ac7cd[_0xe77f('0x4')]=util['format'](_0xe77f('0x61'),path['parse'](_0x2ac7cd[_0xe77f('0x4')])[_0xe77f('0x62')],path[_0xe77f('0x3c')](_0x2ac7cd[_0xe77f('0x4')])[_0xe77f('0x26')]);_0x293b7d[_0xe77f('0x63')]=_0x2ac7cd[_0xe77f('0x4')];ut[_0xe77f('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0xe77f('0x64')](ut[_0xe77f('0x65')](_0x2ac7cd,_0x293b7d))[_0xe77f('0x47')](function(_0x16245a){_0x3c5ae8(_0x16245a);})[_0xe77f('0x3d')](function(_0x1eddda){_0xcc0246(_0x1eddda);});})[_0xe77f('0x3d')](function(_0x6f4aca){_0xcc0246(_0x6f4aca);});}else{ami['Action'](ut[_0xe77f('0x65')](_0x2ac7cd,_0x293b7d))[_0xe77f('0x47')](function(_0x691fc5){_0x3c5ae8(_0x691fc5);})[_0xe77f('0x3d')](function(_0x34d1c5){_0xcc0246(_0x34d1c5);});}});}Fax[_0xe77f('0x1f')]['execOriginate']=function(_0x524e5c,_0x567173){var _0x183fa3=this;return new BPromise(function(_0x50f3df,_0x2bfce4){var _0x2bf64d=uuid['v4']();var _0xbebb52=ut[_0xe77f('0x66')](_0x524e5c,_0x567173);_0x183fa3['actions'][_0x2bf64d]=new Action(_0x2bf64d,_0x567173,_0x524e5c);var _0x59abca=_0x183fa3[_0xe77f('0x11')][_0x2bf64d];if(path['parse'](_0x524e5c[_0xe77f('0x4')])[_0xe77f('0x67')]==='.pdf'){originate(_0x59abca,_0xbebb52,!![])[_0xe77f('0x47')](function(_0x1aa203){_0x50f3df(_0x1aa203);})[_0xe77f('0x3d')](function(_0x20e198){_0x2bfce4(_0x20e198);});}else{originate(_0x59abca,_0xbebb52,![])[_0xe77f('0x47')](function(_0xbd0959){_0x50f3df(_0xbd0959);})[_0xe77f('0x3d')](function(_0x141de7){_0x2bfce4(_0x141de7);});}});};Fax[_0xe77f('0x1f')][_0xe77f('0x68')]=function(_0x26610a){return!_[_0xe77f('0x69')](_0x26610a)&&!_[_0xe77f('0x69')](_0x26610a[_0xe77f('0x26')])&&!_[_0xe77f('0x69')](_0x26610a['active'])&&_0x26610a[_0xe77f('0x6a')]&&!_['isNil'](this[_0xe77f('0x10')][util[_0xe77f('0x5e')](_0xe77f('0x6b'),_0x26610a[_0xe77f('0x26')])])&&!_[_0xe77f('0x69')](this[_0xe77f('0x10')][util['format'](_0xe77f('0x6b'),_0x26610a[_0xe77f('0x26')])][_0xe77f('0x2e')])&&(this['trunks'][util[_0xe77f('0x5e')](_0xe77f('0x6b'),_0x26610a[_0xe77f('0x26')])][_0xe77f('0x2e')]==='reachable'||this['trunks'][util[_0xe77f('0x5e')](_0xe77f('0x6b'),_0x26610a['name'])][_0xe77f('0x2e')]==='unmonitored');};Fax[_0xe77f('0x1f')][_0xe77f('0x5a')]=function(_0x5e76ad,_0x4d0f8b){if(!this[_0xe77f('0x68')](_0x5e76ad)){ut[_0xe77f('0x48')](_0xe77f('0x6c'),_[_0xe77f('0x69')](_0x5e76ad)?'':_0x5e76ad[_0xe77f('0x26')]+_0xe77f('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x4d0f8b[_0xe77f('0x6')])){ut['logger'](_0xe77f('0x6e'),JSON[_0xe77f('0x40')](_0x4d0f8b));return{'isValid':![],'message':_0xe77f('0x6f')};}if(_['isNil'](_0x4d0f8b['path'])){ut[_0xe77f('0x48')](_0xe77f('0x70'),JSON[_0xe77f('0x40')](_0x4d0f8b));return{'isValid':![],'message':_0xe77f('0x71')};}return{'isValid':!![],'message':_0xe77f('0x72')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index de107f4..ab141fa 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 _0x9f38=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger'];(function(_0x3786bd,_0x2bb68b){var _0x2a43c5=function(_0x1218b5){while(--_0x1218b5){_0x3786bd['push'](_0x3786bd['shift']());}};_0x2a43c5(++_0x2bb68b);}(_0x9f38,0x169));var _0x89f3=function(_0x4db2ee,_0x249f7f){_0x4db2ee=_0x4db2ee-0x0;var _0x1ceb42=_0x9f38[_0x4db2ee];return _0x1ceb42;};'use strict';var util=require('util');var BPromise=require(_0x89f3('0x0'));var logger=require(_0x89f3('0x1'))('preview');var _=require(_0x89f3('0x2'));var faxAccount=require(_0x89f3('0x3'));function loggerCatch(_0x1b549a){return function(_0x102648){logger[_0x89f3('0x4')](_0x1b549a,util[_0x89f3('0x5')](_0x102648,{'showHidden':![],'depth':null}));};}exports[_0x89f3('0x6')]=function(_0x2ad375,_0xeb5668){return BPromise[_0x89f3('0x7')]()[_0x89f3('0x8')](faxAccount['notify'](_0x2ad375,_0xeb5668))[_0x89f3('0x9')](loggerCatch(_0x89f3('0xa')));}; \ No newline at end of file +var _0xcdf8=['../rpc/faxAccount','error','notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x3ee0f3,_0x449298){var _0x432aff=function(_0x2337a7){while(--_0x2337a7){_0x3ee0f3['push'](_0x3ee0f3['shift']());}};_0x432aff(++_0x449298);}(_0xcdf8,0x146));var _0x8cdf=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xcdf8[_0x3c8e9a];return _0x2d4c57;};'use strict';var util=require(_0x8cdf('0x0'));var BPromise=require(_0x8cdf('0x1'));var logger=require(_0x8cdf('0x2'))(_0x8cdf('0x3'));var _=require('lodash');var faxAccount=require(_0x8cdf('0x4'));function loggerCatch(_0x2b7367){return function(_0x305f25){logger[_0x8cdf('0x5')](_0x2b7367,util['inspect'](_0x305f25,{'showHidden':![],'depth':null}));};}exports[_0x8cdf('0x6')]=function(_0x27e0c3,_0xff7b8f){return BPromise[_0x8cdf('0x7')]()[_0x8cdf('0x8')](faxAccount[_0x8cdf('0x6')](_0x27e0c3,_0xff7b8f))['catch'](loggerCatch(_0x8cdf('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 96f7677..e7e95a4 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 _0x59f8=['child_process','info','Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x3b6c03,_0x5a8aa7){var _0x5ccad9=function(_0xb5d4e4){while(--_0xb5d4e4){_0x3b6c03['push'](_0x3b6c03['shift']());}};_0x5ccad9(++_0x5a8aa7);}(_0x59f8,0x164));var _0x859f=function(_0x2509f1,_0x14deca){_0x2509f1=_0x2509f1-0x0;var _0x1953cf=_0x59f8[_0x2509f1];return _0x1953cf;};'use strict';var util=require(_0x859f('0x0'));var logger=require(_0x859f('0x1'))(_0x859f('0x2'));var BPromise=require(_0x859f('0x3'));var exec=require(_0x859f('0x4'))['exec'];exports['execute']=function(_0x114a2c){return new BPromise(function(_0x3b5e7d,_0x295ee6){exec(_0x114a2c,function(_0x403152,_0x37d572,_0x19f334){logger[_0x859f('0x5')](_0x859f('0x6'),_0x37d572);if(_0x403152){logger['info']('Exec\x20gs','\x20Error\x20:',util[_0x859f('0x7')](_0x403152,{'showHidden':![],'depth':null}),_0x37d572,_0x19f334);_0x295ee6(_0x403152);}_0x3b5e7d(_0x37d572);});});}; \ No newline at end of file +var _0x6ebb=['child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','../../../../config/logger','fax'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0x6ebb,0x73));var _0xb6eb=function(_0x30f6b0,_0x1a2d08){_0x30f6b0=_0x30f6b0-0x0;var _0x2b4fba=_0x6ebb[_0x30f6b0];return _0x2b4fba;};'use strict';var util=require('util');var logger=require(_0xb6eb('0x0'))(_0xb6eb('0x1'));var BPromise=require('bluebird');var exec=require(_0xb6eb('0x2'))[_0xb6eb('0x3')];exports[_0xb6eb('0x4')]=function(_0x51497d){return new BPromise(function(_0x3c02d5,_0xef47ff){exec(_0x51497d,function(_0x2d5b42,_0x22e1d4,_0x39fc42){logger['info'](_0xb6eb('0x5'),_0x22e1d4);if(_0x2d5b42){logger[_0xb6eb('0x6')](_0xb6eb('0x5'),_0xb6eb('0x7'),util[_0xb6eb('0x8')](_0x2d5b42,{'showHidden':![],'depth':null}),_0x22e1d4,_0x39fc42);_0xef47ff(_0x2d5b42);}_0x3c02d5(_0x22e1d4);});});}; \ 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 77a795d..624da2b 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 _0xd773=['inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','moment','../../../../config/logger','message','logger','info'];(function(_0x56ba8b,_0x5f0021){var _0x528ea2=function(_0x23fb86){while(--_0x23fb86){_0x56ba8b['push'](_0x56ba8b['shift']());}};_0x528ea2(++_0x5f0021);}(_0xd773,0xd2));var _0x3d77=function(_0x57bb5a,_0x30e3c6){_0x57bb5a=_0x57bb5a-0x0;var _0x351ac2=_0xd773[_0x57bb5a];return _0x351ac2;};'use strict';var util=require(_0x3d77('0x0'));var _=require('lodash');var moment=require(_0x3d77('0x1'));var logger=require(_0x3d77('0x2'))('fax');exports[_0x3d77('0x3')]=function(_0xdb9b14){return{'message':_0xdb9b14};};exports[_0x3d77('0x4')]=function(_0x21447b,_0x3d89a7){logger[_0x3d77('0x5')](_0x21447b,util[_0x3d77('0x6')](_0x3d89a7,{'showHidden':![],'depth':null}));};exports[_0x3d77('0x7')]=function(_0x4e54f5,_0x3a1ec5){var _0xc17fc7={'XMF-ECM':_0x3a1ec5[_0x3d77('0x8')],'XMF-HEADERINFO':_0x3a1ec5[_0x3d77('0x9')],'XMF-MINRATE':_0x3a1ec5[_0x3d77('0xa')],'XMF-MAXRATE':_0x3a1ec5[_0x3d77('0xb')],'XMF-MODEM':util[_0x3d77('0xc')](_0x3d77('0xd'),_0x3a1ec5[_0x3d77('0xe')]),'XMF-GATEWAY':_0x3a1ec5[_0x3d77('0xf')],'XMF-FAXDETECT':_0x3a1ec5[_0x3d77('0x10')],'XMF-T38TIMEOUT':_0x3a1ec5[_0x3d77('0x11')],'XMF-LOCALSTATIONID':_0x3a1ec5[_0x3d77('0x12')],'XMF-PATH':_0x4e54f5[_0x3d77('0x13')]};return _0xc17fc7;};exports[_0x3d77('0x14')]=function(_0x1676e1,_0x2d80c7){return{'actionid':_0x1676e1['uniqueid'],'action':_0x3d77('0x15'),'channel':_0x1676e1[_0x3d77('0x16')],'Exten':_0x3d77('0x17'),'Context':_0x3d77('0x18'),'Priority':'1','callerid':util[_0x3d77('0xc')](_0x3d77('0x19'),_0x1676e1[_0x3d77('0x9')]?_0x1676e1[_0x3d77('0x9')]:'',_0x1676e1['localstationid']),'variable':_0x2d80c7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1676e1[_0x3d77('0x1a')]};}; \ No newline at end of file +var _0x7ea4=['lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x7ea4,0x177));var _0x47ea=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0x7ea4[_0xd1c39b];return _0x58f5bc;};'use strict';var util=require('util');var _=require(_0x47ea('0x0'));var moment=require(_0x47ea('0x1'));var logger=require(_0x47ea('0x2'))(_0x47ea('0x3'));exports[_0x47ea('0x4')]=function(_0x3a117f){return{'message':_0x3a117f};};exports[_0x47ea('0x5')]=function(_0x39f44a,_0x59f46d){logger[_0x47ea('0x6')](_0x39f44a,util[_0x47ea('0x7')](_0x59f46d,{'showHidden':![],'depth':null}));};exports[_0x47ea('0x8')]=function(_0x14c5e7,_0x4af8c3){var _0x2f6e4a={'XMF-ECM':_0x4af8c3[_0x47ea('0x9')],'XMF-HEADERINFO':_0x4af8c3[_0x47ea('0xa')],'XMF-MINRATE':_0x4af8c3[_0x47ea('0xb')],'XMF-MAXRATE':_0x4af8c3[_0x47ea('0xc')],'XMF-MODEM':util['format'](_0x47ea('0xd'),_0x4af8c3[_0x47ea('0xe')]),'XMF-GATEWAY':_0x4af8c3[_0x47ea('0xf')],'XMF-FAXDETECT':_0x4af8c3[_0x47ea('0x10')],'XMF-T38TIMEOUT':_0x4af8c3['t38timeout'],'XMF-LOCALSTATIONID':_0x4af8c3[_0x47ea('0x11')],'XMF-PATH':_0x14c5e7[_0x47ea('0x12')]};return _0x2f6e4a;};exports[_0x47ea('0x13')]=function(_0x4b86c8,_0x2c4592){return{'actionid':_0x4b86c8[_0x47ea('0x14')],'action':_0x47ea('0x15'),'channel':_0x4b86c8['channel'],'Exten':_0x47ea('0x16'),'Context':_0x47ea('0x17'),'Priority':'1','callerid':util['format'](_0x47ea('0x18'),_0x4b86c8[_0x47ea('0xa')]?_0x4b86c8['headerinfo']:'',_0x4b86c8[_0x47ea('0x11')]),'variable':_0x2c4592,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4b86c8[_0x47ea('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 35de835..2e249b2 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 _0x12b1=['initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','bluebird','util','moment','./server','./report','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory'];(function(_0x348069,_0x415153){var _0x7bfaa8=function(_0x1bff06){while(--_0x1bff06){_0x348069['push'](_0x348069['shift']());}};_0x7bfaa8(++_0x415153);}(_0x12b1,0x90));var _0x112b=function(_0x1e4d78,_0x4460cd){_0x1e4d78=_0x1e4d78-0x0;var _0x595a6b=_0x12b1[_0x1e4d78];return _0x595a6b;};'use strict';var BPromise=require(_0x112b('0x0'));var util=require(_0x112b('0x1'));var moment=require(_0x112b('0x2'));var server=require(_0x112b('0x3'));var Realtime=require('./realtime');var Report=require(_0x112b('0x4'));var Acw=require(_0x112b('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x112b('0x6'));var Preview=require(_0x112b('0x7'));var Fax=require('./fax');var user=require(_0x112b('0x8'));var voiceQueue=require(_0x112b('0x9'));var voiceQueueReport=require(_0x112b('0xa'));var voiceCallReport=require(_0x112b('0xb'));var trunk=require(_0x112b('0xc'));var trigger=require(_0x112b('0xd'));var template=require(_0x112b('0xe'));var cmHopperHistory=require(_0x112b('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x112b('0x10'));var zendesk=require(_0x112b('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x112b('0x12'));var freshdesk=require(_0x112b('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x112b('0x14'));var vtiger=require(_0x112b('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x112b('0x16'));var dynamics365=require(_0x112b('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x112b('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x112b('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x112b('0x19')](_0x112b('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x112b('0x1b')]()[_0x112b('0x1c')](user[_0x112b('0x1d')]())[_0x112b('0x1c')](realtime[_0x112b('0x1e')]())[_0x112b('0x1c')](user[_0x112b('0x1f')]())['then'](realtime[_0x112b('0x20')]())['then'](trunk[_0x112b('0x21')]())[_0x112b('0x1c')](realtime[_0x112b('0x22')]())[_0x112b('0x1c')](voiceQueue[_0x112b('0x23')]())[_0x112b('0x1c')](realtime['initVoiceQueues']())[_0x112b('0x1c')](trigger[_0x112b('0x24')]())[_0x112b('0x1c')](realtime[_0x112b('0x25')]())[_0x112b('0x1c')](template[_0x112b('0x26')]())[_0x112b('0x1c')](realtime[_0x112b('0x27')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0x112b('0x28')]())['then'](salesforce[_0x112b('0x29')]())[_0x112b('0x1c')](realtime['initSalesforceAccounts']())[_0x112b('0x1c')](sugarcrm[_0x112b('0x2a')]())[_0x112b('0x1c')](realtime[_0x112b('0x2b')]())[_0x112b('0x1c')](freshdesk[_0x112b('0x2c')]())[_0x112b('0x1c')](realtime[_0x112b('0x2d')]())[_0x112b('0x1c')](desk[_0x112b('0x2e')]())['then'](realtime['initDeskAccounts']())[_0x112b('0x1c')](zoho[_0x112b('0x2f')]())[_0x112b('0x1c')](realtime[_0x112b('0x30')]())[_0x112b('0x1c')](vtiger[_0x112b('0x31')]())[_0x112b('0x1c')](realtime['initVtigerAccounts']())[_0x112b('0x1c')](freshsales[_0x112b('0x32')]())[_0x112b('0x1c')](realtime['initFreshsalesAccounts']())['then'](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x112b('0x33')]())['then'](realtime['initDynamics365Accounts']())[_0x112b('0x1c')](campaign[_0x112b('0x34')]())[_0x112b('0x1c')](realtime[_0x112b('0x35')]())[_0x112b('0x1c')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0x112b('0x36')]())['then'](faxAccount['getFaxAccounts']())[_0x112b('0x1c')](realtime[_0x112b('0x37')]())[_0x112b('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x112b('0x1b')]()[_0x112b('0x1c')](voiceQueueReport[_0x112b('0x38')]())[_0x112b('0x1c')](realtime[_0x112b('0x39')]())[_0x112b('0x1c')](cmHopperHistory[_0x112b('0x3a')]())[_0x112b('0x1c')](realtime[_0x112b('0x3b')]())[_0x112b('0x1c')](cmHopperHistory['getCampaignHopperHistory']())[_0x112b('0x1c')](realtime[_0x112b('0x3c')]())['then'](voiceCallReport[_0x112b('0x3d')]())[_0x112b('0x1c')](realtime['initVoiceCallReports']())[_0x112b('0x3e')](function(_0x4f1cd7){logger[_0x112b('0x3f')](_0x112b('0x40'),util['inspect'](_0x4f1cd7,{'showHidden':![],'depth':null}));});}function main(){return server[_0x112b('0x41')](realtime,preview,fax)['then'](function(_0x49591d){return initRealtime();})[_0x112b('0x1c')](function(){return initParams();})[_0x112b('0x1c')](function(){report[_0x112b('0x42')]();setInterval(initRealtime,0x1388);})[_0x112b('0x3e')](function(_0x3ae72b){logger[_0x112b('0x3f')](_0x112b('0x43'),util['inspect'](_0x3ae72b,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x6248=['./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','[index.js][main]','util','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce'];(function(_0x1090e3,_0x23528e){var _0x158b21=function(_0x4f9f78){while(--_0x4f9f78){_0x1090e3['push'](_0x1090e3['shift']());}};_0x158b21(++_0x23528e);}(_0x6248,0x176));var _0x8624=function(_0x3a35f2,_0x6a65d4){_0x3a35f2=_0x3a35f2-0x0;var _0x3f43a5=_0x6248[_0x3a35f2];return _0x3f43a5;};'use strict';var BPromise=require('bluebird');var util=require(_0x8624('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x8624('0x1'));var Acw=require(_0x8624('0x2'));var Trigger=require(_0x8624('0x3'));var Dialer=require(_0x8624('0x4'));var Preview=require('./preview');var Fax=require(_0x8624('0x5'));var user=require(_0x8624('0x6'));var voiceQueue=require(_0x8624('0x7'));var voiceQueueReport=require(_0x8624('0x8'));var voiceCallReport=require(_0x8624('0x9'));var trunk=require(_0x8624('0xa'));var trigger=require(_0x8624('0xb'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x8624('0xc'));var voiceExtension=require(_0x8624('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x8624('0xe'));var salesforce=require(_0x8624('0xf'));var sugarcrm=require(_0x8624('0x10'));var freshdesk=require(_0x8624('0x11'));var desk=require(_0x8624('0x12'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x8624('0x13'));var servicenow=require(_0x8624('0x14'));var dynamics365=require(_0x8624('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x8624('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8624('0x17')](_0x8624('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8624('0x17')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8624('0x19')]()[_0x8624('0x1a')](user[_0x8624('0x1b')]())[_0x8624('0x1a')](realtime[_0x8624('0x1c')]())[_0x8624('0x1a')](user[_0x8624('0x1d')]())[_0x8624('0x1a')](realtime[_0x8624('0x1e')]())[_0x8624('0x1a')](trunk['getTrunks']())[_0x8624('0x1a')](realtime[_0x8624('0x1f')]())[_0x8624('0x1a')](voiceQueue['getVoiceQueues']())[_0x8624('0x1a')](realtime[_0x8624('0x20')]())[_0x8624('0x1a')](trigger[_0x8624('0x21')]())[_0x8624('0x1a')](realtime[_0x8624('0x22')]())['then'](template['getTemplates']())[_0x8624('0x1a')](realtime[_0x8624('0x23')]())['then'](zendesk['getZendeskAccounts']())[_0x8624('0x1a')](realtime[_0x8624('0x24')]())[_0x8624('0x1a')](salesforce[_0x8624('0x25')]())[_0x8624('0x1a')](realtime[_0x8624('0x26')]())[_0x8624('0x1a')](sugarcrm[_0x8624('0x27')]())[_0x8624('0x1a')](realtime[_0x8624('0x28')]())[_0x8624('0x1a')](freshdesk[_0x8624('0x29')]())['then'](realtime['initFreshdeskAccounts']())[_0x8624('0x1a')](desk['getDeskAccounts']())[_0x8624('0x1a')](realtime[_0x8624('0x2a')]())[_0x8624('0x1a')](zoho[_0x8624('0x2b')]())[_0x8624('0x1a')](realtime[_0x8624('0x2c')]())[_0x8624('0x1a')](vtiger[_0x8624('0x2d')]())['then'](realtime[_0x8624('0x2e')]())[_0x8624('0x1a')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x8624('0x2f')]())[_0x8624('0x1a')](servicenow[_0x8624('0x30')]())['then'](realtime[_0x8624('0x31')]())['then'](dynamics365[_0x8624('0x32')]())[_0x8624('0x1a')](realtime[_0x8624('0x33')]())[_0x8624('0x1a')](campaign[_0x8624('0x34')]())['then'](realtime[_0x8624('0x35')]())['then'](voiceExtension['getVoiceExtensions']())[_0x8624('0x1a')](realtime['initVoiceExtensions']())[_0x8624('0x1a')](faxAccount[_0x8624('0x36')]())['then'](realtime[_0x8624('0x37')]())[_0x8624('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x8624('0x19')]()[_0x8624('0x1a')](voiceQueueReport[_0x8624('0x38')]())[_0x8624('0x1a')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x8624('0x39')]())[_0x8624('0x1a')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x8624('0x1a')](realtime['initCampaignHopperHistory']())[_0x8624('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x8624('0x1a')](realtime[_0x8624('0x3a')]())[_0x8624('0x3b')](function(_0x1717b8){logger[_0x8624('0x3c')](_0x8624('0x3d'),util[_0x8624('0x3e')](_0x1717b8,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8624('0x3f')](realtime,preview,fax)[_0x8624('0x1a')](function(_0x20ad23){return initRealtime();})['then'](function(){return initParams();})[_0x8624('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x4a7680){logger['error'](_0x8624('0x40'),util[_0x8624('0x3e')](_0x4a7680,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index e3d006c..55cd4cb 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x40f4a7,_0x232f9d){var _0x4f4f53=function(_0x3515c4){while(--_0x3515c4){_0x40f4a7['push'](_0x40f4a7['shift']());}};_0x4f4f53(++_0x232f9d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x3422e6,_0xcf51e3){var _0x448c56=function(_0x3b730a){while(--_0x3b730a){_0x3422e6['push'](_0x3422e6['shift']());}};_0x448c56(++_0xcf51e3);}(_0x70e0,0x17b));var _0x070e=function(_0x327020,_0x5bf559){_0x327020=_0x327020-0x0;var _0x5e43e5=_0x70e0[_0x327020];return _0x5e43e5;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 23cc676..9ec6f28 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 _0x7300=['dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x5e2185,_0x44f71c){var _0x452750=function(_0x41bbdd){while(--_0x41bbdd){_0x5e2185['push'](_0x5e2185['shift']());}};_0x452750(++_0x44f71c);}(_0x7300,0xfc));var _0x0730=function(_0x530967,_0x18eb1c){_0x530967=_0x530967-0x0;var _0x2e964e=_0x7300[_0x530967];return _0x2e964e;};'use strict';function Campaign(_0x2f915e){this['id']=_0x2f915e['id']||0x0;this[_0x0730('0x0')]=_0x2f915e[_0x0730('0x0')]||'';this[_0x0730('0x1')]=_0x2f915e[_0x0730('0x1')]||_0x0730('0x2');this[_0x0730('0x3')]=0x0;this[_0x0730('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x0730('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x0730('0x6')]=_0x2f915e[_0x0730('0x6')];this[_0x0730('0x7')]=_0x2f915e['limitCalls'];this[_0x0730('0x8')]=_0x2f915e[_0x0730('0x8')]||null;this['dialGlobalInterval']=_0x2f915e['dialGlobalInterval']?_0x2f915e[_0x0730('0x9')]:null;this['dialOriginateCallerIdName']=_0x2f915e['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x2f915e[_0x0730('0xa')];this[_0x0730('0xb')]=_0x2f915e[_0x0730('0xb')]||0x1e;this[_0x0730('0xc')]=_0x2f915e[_0x0730('0xc')];this['dialCongestionRetryFrequency']=_0x2f915e['dialCongestionRetryFrequency'];this[_0x0730('0xd')]=_0x2f915e[_0x0730('0xd')];this[_0x0730('0xe')]=_0x2f915e[_0x0730('0xe')];this[_0x0730('0xf')]=_0x2f915e['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x2f915e[_0x0730('0x10')];this[_0x0730('0x11')]=_0x2f915e[_0x0730('0x11')];this['dialNoSuchNumberMaxRetry']=_0x2f915e[_0x0730('0x12')]||0x3;this[_0x0730('0x13')]=_0x2f915e[_0x0730('0x13')]||0x96;this[_0x0730('0x14')]=_0x2f915e[_0x0730('0x14')]||0x3;this[_0x0730('0x15')]=_0x2f915e[_0x0730('0x15')]||0x96;this[_0x0730('0x16')]=_0x2f915e['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x2f915e[_0x0730('0x17')]||0x96;this[_0x0730('0x18')]=_0x2f915e[_0x0730('0x18')]||0x3;this[_0x0730('0x19')]=_0x2f915e['dialMachineRetryFrequency']||0x96;this[_0x0730('0x1a')]=_0x2f915e[_0x0730('0x1a')]||0x3;this[_0x0730('0x1b')]=_0x2f915e[_0x0730('0x1b')]||0x96;this[_0x0730('0x1c')]=_0x2f915e[_0x0730('0x1c')]||'DESC';this['dialPrefix']=_0x2f915e[_0x0730('0x1d')]||undefined;this[_0x0730('0x1e')]=_0x2f915e[_0x0730('0x1e')]||undefined;this[_0x0730('0x1f')]=_0x2f915e[_0x0730('0x1f')]||undefined;this['TrunkBackup']=_0x2f915e[_0x0730('0x20')]?_0x2f915e[_0x0730('0x20')]:undefined;this[_0x0730('0x21')]=_0x2f915e[_0x0730('0x21')]?_0x2f915e['Trunk']:undefined;this[_0x0730('0x22')]=_0x2f915e[_0x0730('0x22')]?_0x2f915e[_0x0730('0x22')]:undefined;this[_0x0730('0x23')]=_0x2f915e[_0x0730('0x23')]?_0x2f915e[_0x0730('0x23')]:undefined;this[_0x0730('0x24')]=_0x2f915e[_0x0730('0x23')]?_0x2f915e[_0x0730('0x23')][_0x0730('0x0')]:undefined;this[_0x0730('0x25')]=_0x2f915e[_0x0730('0x25')]||![];this[_0x0730('0x26')]=_0x2f915e['dialAMDInitialSilence'];this[_0x0730('0x27')]=_0x2f915e[_0x0730('0x27')];this[_0x0730('0x28')]=_0x2f915e[_0x0730('0x28')];this[_0x0730('0x29')]=_0x2f915e['dialAMDTotalAnalysisTime'];this[_0x0730('0x2a')]=_0x2f915e['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x2f915e[_0x0730('0x2b')];this[_0x0730('0x2c')]=_0x2f915e[_0x0730('0x2c')];this[_0x0730('0x2d')]=_0x2f915e['dialAMDSilenceThreshold'];this[_0x0730('0x2e')]=_0x2f915e[_0x0730('0x2e')];}module[_0x0730('0x2f')]=Campaign; \ No newline at end of file +var _0xa0d5=['dialAgentRejectRetryFrequency','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa0d5,0x1b0));var _0x5a0d=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0xa0d5[_0x35387d];return _0x3aba56;};'use strict';function Campaign(_0x265a31){this['id']=_0x265a31['id']||0x0;this['name']=_0x265a31[_0x5a0d('0x0')]||'';this[_0x5a0d('0x1')]=_0x265a31[_0x5a0d('0x1')]||_0x5a0d('0x2');this[_0x5a0d('0x3')]=0x0;this[_0x5a0d('0x4')]=0x0;this[_0x5a0d('0x5')]=0x0;this[_0x5a0d('0x6')]=0x0;this[_0x5a0d('0x7')]='';this['sendMessageOneNotActive']=!![];this[_0x5a0d('0x8')]=_0x265a31[_0x5a0d('0x8')];this[_0x5a0d('0x9')]=_0x265a31[_0x5a0d('0x9')];this['dialTimezone']=_0x265a31[_0x5a0d('0xa')]||null;this[_0x5a0d('0xb')]=_0x265a31['dialGlobalInterval']?_0x265a31[_0x5a0d('0xb')]:null;this['dialOriginateCallerIdName']=_0x265a31[_0x5a0d('0xc')];this[_0x5a0d('0xd')]=_0x265a31[_0x5a0d('0xd')];this[_0x5a0d('0xe')]=_0x265a31[_0x5a0d('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x265a31[_0x5a0d('0xf')];this[_0x5a0d('0x10')]=_0x265a31[_0x5a0d('0x10')];this[_0x5a0d('0x11')]=_0x265a31[_0x5a0d('0x11')];this[_0x5a0d('0x12')]=_0x265a31['dialBusyRetryFrequency'];this[_0x5a0d('0x13')]=_0x265a31[_0x5a0d('0x13')];this[_0x5a0d('0x14')]=_0x265a31['dialNoAnswerRetryFrequency'];this[_0x5a0d('0x15')]=_0x265a31[_0x5a0d('0x15')];this[_0x5a0d('0x16')]=_0x265a31['dialNoSuchNumberMaxRetry']||0x3;this[_0x5a0d('0x17')]=_0x265a31[_0x5a0d('0x17')]||0x96;this[_0x5a0d('0x18')]=_0x265a31[_0x5a0d('0x18')]||0x3;this[_0x5a0d('0x19')]=_0x265a31[_0x5a0d('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x265a31['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x265a31['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x265a31[_0x5a0d('0x1a')]||0x3;this[_0x5a0d('0x1b')]=_0x265a31['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x265a31['dialAgentRejectMaxRetry']||0x3;this[_0x5a0d('0x1c')]=_0x265a31[_0x5a0d('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x265a31['dialOrderByScheduledAt']||_0x5a0d('0x1d');this['dialPrefix']=_0x265a31[_0x5a0d('0x1e')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x265a31['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5a0d('0x1f')]=_0x265a31[_0x5a0d('0x1f')]||undefined;this[_0x5a0d('0x20')]=_0x265a31[_0x5a0d('0x20')]?_0x265a31['TrunkBackup']:undefined;this[_0x5a0d('0x21')]=_0x265a31[_0x5a0d('0x21')]?_0x265a31['Trunk']:undefined;this[_0x5a0d('0x22')]=_0x265a31['Interval']?_0x265a31[_0x5a0d('0x22')]:undefined;this[_0x5a0d('0x23')]=_0x265a31[_0x5a0d('0x23')]?_0x265a31[_0x5a0d('0x23')]:undefined;this['dialQueueProject']=_0x265a31[_0x5a0d('0x23')]?_0x265a31[_0x5a0d('0x23')][_0x5a0d('0x0')]:undefined;this[_0x5a0d('0x24')]=_0x265a31[_0x5a0d('0x24')]||![];this['dialAMDInitialSilence']=_0x265a31[_0x5a0d('0x25')];this[_0x5a0d('0x26')]=_0x265a31['dialAMDGreeting'];this[_0x5a0d('0x27')]=_0x265a31[_0x5a0d('0x27')];this['dialAMDTotalAnalysisTime']=_0x265a31['dialAMDTotalAnalysisTime'];this[_0x5a0d('0x28')]=_0x265a31[_0x5a0d('0x28')];this[_0x5a0d('0x29')]=_0x265a31[_0x5a0d('0x29')];this['dialAMDMaximumNumberOfWords']=_0x265a31[_0x5a0d('0x2a')];this[_0x5a0d('0x2b')]=_0x265a31[_0x5a0d('0x2b')];this['dialAMDMaximumWordLength']=_0x265a31[_0x5a0d('0x2c')];}module[_0x5a0d('0x2d')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 3b0cbf9..8fa25de 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 _0xa775=['exten','answered','answertime','endtime','duration','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','starttime','destinationchannel','connectedlinenum','connectedlinename','accountcode','context','linkedid'];(function(_0x2a1a8e,_0x181eb2){var _0x2f4b25=function(_0x5e56e9){while(--_0x5e56e9){_0x2a1a8e['push'](_0x2a1a8e['shift']());}};_0x2f4b25(++_0x181eb2);}(_0xa775,0xf6));var _0x5a77=function(_0x27ed2f,_0x431d77){_0x27ed2f=_0x27ed2f-0x0;var _0x515fb7=_0xa775[_0x27ed2f];return _0x515fb7;};'use strict';function Channel(){this[_0x5a77('0x0')]=null;this['channel']='';this[_0x5a77('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x5a77('0x2')]=undefined;this[_0x5a77('0x3')]=undefined;this[_0x5a77('0x4')]=0x0;this[_0x5a77('0x5')]='';this['uniqueid']=0x0;this[_0x5a77('0x6')]=0x0;this[_0x5a77('0x7')]=0x0;this[_0x5a77('0x8')]=![];this[_0x5a77('0x9')]=null;this[_0x5a77('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0x5a77('0xb')]=0x0;this[_0x5a77('0xc')]=0x0;this[_0x5a77('0xd')]=0x0;this[_0x5a77('0xe')]=null;this[_0x5a77('0xf')]=null;this[_0x5a77('0x10')]=null;this['monitor']=![];this[_0x5a77('0x11')]=null;this[_0x5a77('0x12')]=null;this['monitors']=[];this[_0x5a77('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x5a77('0x14')]=undefined;this[_0x5a77('0x15')]=0x0;}module[_0x5a77('0x16')]=Channel; \ No newline at end of file +var _0x151b=['starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','linkedid','exten','answertime','endtime','abandoned','lastapplication','duration','billableseconds','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime'];(function(_0x179bcf,_0x4d12bc){var _0x17bc5f=function(_0x329f69){while(--_0x329f69){_0x179bcf['push'](_0x179bcf['shift']());}};_0x17bc5f(++_0x4d12bc);}(_0x151b,0x152));var _0xb151=function(_0x1c4c1a,_0x312ef6){_0x1c4c1a=_0x1c4c1a-0x0;var _0x1712b1=_0x151b[_0x1c4c1a];return _0x1712b1;};'use strict';function Channel(){this[_0xb151('0x0')]=null;this[_0xb151('0x1')]='';this[_0xb151('0x2')]='';this[_0xb151('0x3')]=0x0;this[_0xb151('0x4')]='';this[_0xb151('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xb151('0x6')]=0x0;this['context']='';this[_0xb151('0x7')]=0x0;this[_0xb151('0x8')]=0x0;this[_0xb151('0x9')]=0x0;this['answered']=![];this[_0xb151('0xa')]=null;this[_0xb151('0xb')]=null;this['unmanaged']=![];this[_0xb151('0xc')]=![];this[_0xb151('0xd')]='';this['lastdata']='';this[_0xb151('0xe')]=0x0;this[_0xb151('0xf')]=0x0;this['holdtime']=0x0;this[_0xb151('0x10')]=null;this[_0xb151('0x11')]=null;this[_0xb151('0x12')]=null;this[_0xb151('0x13')]=![];this[_0xb151('0x14')]=null;this['queue']=null;this[_0xb151('0x15')]=[];this[_0xb151('0x16')]=undefined;this[_0xb151('0x17')]=undefined;this[_0xb151('0x18')]=undefined;this[_0xb151('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 6d2a2e7..3c2b800 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 _0xac25=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x97d5ff,_0x5317a7){var _0x198f0c=function(_0x1f7cd5){while(--_0x1f7cd5){_0x97d5ff['push'](_0x97d5ff['shift']());}};_0x198f0c(++_0x5317a7);}(_0xac25,0x10c));var _0x5ac2=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0xac25[_0x53b53e];return _0xbb6179;};'use strict';function DeskAccount(_0x2fc2e){this['id']=_0x2fc2e['id']||0x0;this[_0x5ac2('0x0')]=_0x2fc2e[_0x5ac2('0x0')]||'';this[_0x5ac2('0x1')]=_0x2fc2e[_0x5ac2('0x1')]||'';this[_0x5ac2('0x2')]=_0x2fc2e[_0x5ac2('0x2')]||'';this[_0x5ac2('0x3')]=_0x2fc2e['authType']||'';this[_0x5ac2('0x4')]=_0x2fc2e[_0x5ac2('0x4')]||'';this[_0x5ac2('0x5')]=_0x2fc2e[_0x5ac2('0x5')]||'';this[_0x5ac2('0x6')]=_0x2fc2e[_0x5ac2('0x6')]||'';this[_0x5ac2('0x7')]=_0x2fc2e[_0x5ac2('0x7')]||'';this[_0x5ac2('0x8')]=_0x2fc2e['tokenSecret']||'';this[_0x5ac2('0x9')]=_0x2fc2e[_0x5ac2('0x9')]||'';this[_0x5ac2('0xa')]=_0x2fc2e[_0x5ac2('0xa')]||'';this[_0x5ac2('0xb')]=_0x2fc2e['Configurations']||{};}module[_0x5ac2('0xc')]=DeskAccount; \ No newline at end of file +var _0x5507=['serverUrl','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x4b5f1f,_0x1fee93){var _0x3bb747=function(_0x235c2b){while(--_0x235c2b){_0x4b5f1f['push'](_0x4b5f1f['shift']());}};_0x3bb747(++_0x1fee93);}(_0x5507,0x1e5));var _0x7550=function(_0x4817ef,_0x1d494){_0x4817ef=_0x4817ef-0x0;var _0x43431d=_0x5507[_0x4817ef];return _0x43431d;};'use strict';function DeskAccount(_0x4dc3cf){this['id']=_0x4dc3cf['id']||0x0;this[_0x7550('0x0')]=_0x4dc3cf[_0x7550('0x0')]||'';this[_0x7550('0x1')]=_0x4dc3cf[_0x7550('0x1')]||'';this[_0x7550('0x2')]=_0x4dc3cf[_0x7550('0x2')]||'';this[_0x7550('0x3')]=_0x4dc3cf[_0x7550('0x3')]||'';this[_0x7550('0x4')]=_0x4dc3cf['password']||'';this['consumerKey']=_0x4dc3cf[_0x7550('0x5')]||'';this['consumerSecret']=_0x4dc3cf[_0x7550('0x6')]||'';this[_0x7550('0x7')]=_0x4dc3cf[_0x7550('0x7')]||'';this[_0x7550('0x8')]=_0x4dc3cf['tokenSecret']||'';this[_0x7550('0x9')]=_0x4dc3cf['type']||'';this[_0x7550('0xa')]=_0x4dc3cf[_0x7550('0xa')]||'';this['Configurations']=_0x4dc3cf['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 36263f7..07dba32 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 _0x65bc=['exports','name','username','password','remoteUri','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x65bc,0x85));var _0xc65b=function(_0x38d287,_0x1c1354){_0x38d287=_0x38d287-0x0;var _0x217893=_0x65bc[_0x38d287];return _0x217893;};'use strict';function Dynamics365Account(_0x5bb2d8){this['id']=_0x5bb2d8['id']||0x0;this['name']=_0x5bb2d8[_0xc65b('0x0')]||'';this[_0xc65b('0x1')]=_0x5bb2d8[_0xc65b('0x1')]||'';this[_0xc65b('0x2')]=_0x5bb2d8['password']||'';this['remoteUri']=_0x5bb2d8[_0xc65b('0x3')]||'';this['tenantId']=_0x5bb2d8['tenantId']||'';this[_0xc65b('0x4')]=_0x5bb2d8[_0xc65b('0x4')]||'';this[_0xc65b('0x5')]=_0x5bb2d8[_0xc65b('0x5')]||{};this[_0xc65b('0x6')]=_0x5bb2d8[_0xc65b('0x6')]||'';this['modernAuthentication']=_0x5bb2d8[_0xc65b('0x7')]||![];this[_0xc65b('0x8')]=_0x5bb2d8[_0xc65b('0x8')]||{};this['CloudProvider']=_0x5bb2d8[_0xc65b('0x9')]||{};}module[_0xc65b('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x17dc=['tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','password','remoteUri'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x17dc,0x1d3));var _0xc17d=function(_0x560b3e,_0x5dfd95){_0x560b3e=_0x560b3e-0x0;var _0x843ac2=_0x17dc[_0x560b3e];return _0x843ac2;};'use strict';function Dynamics365Account(_0x15db2c){this['id']=_0x15db2c['id']||0x0;this['name']=_0x15db2c[_0xc17d('0x0')]||'';this['username']=_0x15db2c['username']||'';this[_0xc17d('0x1')]=_0x15db2c[_0xc17d('0x1')]||'';this[_0xc17d('0x2')]=_0x15db2c[_0xc17d('0x2')]||'';this[_0xc17d('0x3')]=_0x15db2c['tenantId']||'';this[_0xc17d('0x4')]=_0x15db2c[_0xc17d('0x4')]||'';this['clientSecret']=_0x15db2c[_0xc17d('0x5')]||{};this[_0xc17d('0x6')]=_0x15db2c[_0xc17d('0x6')]||'';this['modernAuthentication']=_0x15db2c[_0xc17d('0x7')]||![];this[_0xc17d('0x8')]=_0x15db2c[_0xc17d('0x8')]||{};this[_0xc17d('0x9')]=_0x15db2c['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 0053015..9d52d83 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 _0x047d=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x5c50dd,_0x9b43aa){var _0x426767=function(_0x23b10a){while(--_0x23b10a){_0x5c50dd['push'](_0x5c50dd['shift']());}};_0x426767(++_0x9b43aa);}(_0x047d,0x16d));var _0xd047=function(_0x107b16,_0x21c460){_0x107b16=_0x107b16-0x0;var _0x56d2e5=_0x047d[_0x107b16];return _0x56d2e5;};'use strict';function FaxAccount(_0x134afd){this['id']=_0x134afd['id']||0x0;this[_0xd047('0x0')]=_0x134afd[_0xd047('0x0')]||'';this[_0xd047('0x1')]=_0x134afd[_0xd047('0x1')];this[_0xd047('0x2')]=_0x134afd[_0xd047('0x2')];this[_0xd047('0x3')]=_0x134afd['headerinfo'];this['localstationid']=_0x134afd[_0xd047('0x4')];this[_0xd047('0x5')]=_0x134afd['minrate']||0x960;this[_0xd047('0x6')]=_0x134afd[_0xd047('0x6')]||0x3840;this[_0xd047('0x7')]=_0x134afd[_0xd047('0x7')]||_0xd047('0x8');this['gateway']=_0x134afd[_0xd047('0x9')]||'no';this[_0xd047('0xa')]=_0x134afd[_0xd047('0xa')]||'no';this['t38timeout']=_0x134afd[_0xd047('0xb')]||0x1388;this[_0xd047('0xc')]=_0x134afd[_0xd047('0xc')]||_0xd047('0xd');this[_0xd047('0xe')]=_0x134afd['Trunk']?_0x134afd[_0xd047('0xe')]:undefined;this['ListId']=_0x134afd[_0xd047('0xf')];this['key']=_0x134afd['key'];}module[_0xd047('0x10')]=FaxAccount; \ No newline at end of file +var _0xf250=['name','description','ecm','headerinfo','localstationid','modem','v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports'];(function(_0x2e030a,_0x8e4c48){var _0x597df6=function(_0x3da9ce){while(--_0x3da9ce){_0x2e030a['push'](_0x2e030a['shift']());}};_0x597df6(++_0x8e4c48);}(_0xf250,0x10e));var _0x0f25=function(_0x58e09b,_0x6ef44c){_0x58e09b=_0x58e09b-0x0;var _0x243038=_0xf250[_0x58e09b];return _0x243038;};'use strict';function FaxAccount(_0x583c98){this['id']=_0x583c98['id']||0x0;this[_0x0f25('0x0')]=_0x583c98[_0x0f25('0x0')]||'';this[_0x0f25('0x1')]=_0x583c98['description'];this[_0x0f25('0x2')]=_0x583c98['ecm'];this[_0x0f25('0x3')]=_0x583c98['headerinfo'];this[_0x0f25('0x4')]=_0x583c98[_0x0f25('0x4')];this['minrate']=_0x583c98['minrate']||0x960;this['maxrate']=_0x583c98['maxrate']||0x3840;this[_0x0f25('0x5')]=_0x583c98[_0x0f25('0x5')]||_0x0f25('0x6');this[_0x0f25('0x7')]=_0x583c98[_0x0f25('0x7')]||'no';this[_0x0f25('0x8')]=_0x583c98[_0x0f25('0x8')]||'no';this['t38timeout']=_0x583c98[_0x0f25('0x9')]||0x1388;this['tech']=_0x583c98['tech']||_0x0f25('0xa');this[_0x0f25('0xb')]=_0x583c98['Trunk']?_0x583c98[_0x0f25('0xb')]:undefined;this[_0x0f25('0xc')]=_0x583c98[_0x0f25('0xc')];this[_0x0f25('0xd')]=_0x583c98[_0x0f25('0xd')];}module[_0x0f25('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 72734d8..b18ea15 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 _0x6b24=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0x6b24,0x155));var _0x46b2=function(_0x448ae2,_0x1676f5){_0x448ae2=_0x448ae2-0x0;var _0x4fdd34=_0x6b24[_0x448ae2];return _0x4fdd34;};'use strict';function FreshdeskAccount(_0xc470db){this['id']=_0xc470db['id']||0x0;this[_0x46b2('0x0')]=_0xc470db['name']||'';this[_0x46b2('0x1')]=_0xc470db[_0x46b2('0x1')]||'';this['apiKey']=_0xc470db[_0x46b2('0x2')]||'';this[_0x46b2('0x3')]=_0xc470db[_0x46b2('0x3')]||'';this[_0x46b2('0x4')]=_0xc470db[_0x46b2('0x4')]||'';this[_0x46b2('0x5')]=_0xc470db[_0x46b2('0x5')]||{};}module[_0x46b2('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xf4db=['Configurations','name','username','apiKey','token','serverUrl'];(function(_0x5a558e,_0x2c0473){var _0x44eb26=function(_0x1841b4){while(--_0x1841b4){_0x5a558e['push'](_0x5a558e['shift']());}};_0x44eb26(++_0x2c0473);}(_0xf4db,0x7f));var _0xbf4d=function(_0x1a2455,_0xdaa32e){_0x1a2455=_0x1a2455-0x0;var _0xd2286c=_0xf4db[_0x1a2455];return _0xd2286c;};'use strict';function FreshdeskAccount(_0x365b99){this['id']=_0x365b99['id']||0x0;this[_0xbf4d('0x0')]=_0x365b99['name']||'';this[_0xbf4d('0x1')]=_0x365b99[_0xbf4d('0x1')]||'';this[_0xbf4d('0x2')]=_0x365b99[_0xbf4d('0x3')]||'';this['remoteUri']=_0x365b99['remoteUri']||'';this[_0xbf4d('0x4')]=_0x365b99[_0xbf4d('0x4')]||'';this[_0xbf4d('0x5')]=_0x365b99[_0xbf4d('0x5')]||{};}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 c5cec1a..e5d6376 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 _0xfd87=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x12f7d1,_0xea85b3){var _0x17a408=function(_0x38e09a){while(--_0x38e09a){_0x12f7d1['push'](_0x12f7d1['shift']());}};_0x17a408(++_0xea85b3);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x27cbac){this['id']=_0x27cbac['id']||0x0;this[_0x7fd8('0x0')]=_0x27cbac[_0x7fd8('0x0')]||'';this[_0x7fd8('0x1')]=_0x27cbac[_0x7fd8('0x1')]||'';this[_0x7fd8('0x2')]=_0x27cbac[_0x7fd8('0x3')]||'';this[_0x7fd8('0x4')]=_0x27cbac[_0x7fd8('0x4')]||'';this[_0x7fd8('0x5')]=_0x27cbac[_0x7fd8('0x5')]||'';this['Configurations']=_0x27cbac[_0x7fd8('0x6')]||{};}module[_0x7fd8('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x8403=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x27e72d,_0x2ded3d){var _0x528537=function(_0x3935a4){while(--_0x3935a4){_0x27e72d['push'](_0x27e72d['shift']());}};_0x528537(++_0x2ded3d);}(_0x8403,0x1a5));var _0x3840=function(_0x54d11b,_0x4b6e5c){_0x54d11b=_0x54d11b-0x0;var _0x1e0611=_0x8403[_0x54d11b];return _0x1e0611;};'use strict';function FreshsalesAccount(_0x1abd33){this['id']=_0x1abd33['id']||0x0;this[_0x3840('0x0')]=_0x1abd33[_0x3840('0x0')]||'';this[_0x3840('0x1')]=_0x1abd33[_0x3840('0x1')]||'';this[_0x3840('0x2')]=_0x1abd33[_0x3840('0x3')]||'';this[_0x3840('0x4')]=_0x1abd33[_0x3840('0x4')]||'';this['serverUrl']=_0x1abd33[_0x3840('0x5')]||'';this[_0x3840('0x6')]=_0x1abd33[_0x3840('0x6')]||{};}module[_0x3840('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 4c2670c..b5f4096 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 _0x56e3=['queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','accountcode','exten','priority','holdtime','assigned','motionChannel','voice','uniqueid','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x906a86,_0x31c843){var _0x19bc61=function(_0x5cf0ab){while(--_0x5cf0ab){_0x906a86['push'](_0x906a86['shift']());}};_0x19bc61(++_0x31c843);}(_0x56e3,0xf0));var _0x356e=function(_0x3c878b,_0x3054bb){_0x3c878b=_0x3c878b-0x0;var _0x4540c2=_0x56e3[_0x3c878b];return _0x4540c2;};'use strict';function QueueReport(){this['type']='inbound';this[_0x356e('0x0')]='';this[_0x356e('0x1')]='';this['calleridname']='';this[_0x356e('0x2')]='';this['queuecallerjoinAt']=null;this[_0x356e('0x3')]=null;this[_0x356e('0x4')]=0x1;this[_0x356e('0x5')]=0x1;this[_0x356e('0x6')]=![];this[_0x356e('0x7')]=null;this[_0x356e('0x8')]=![];this['queuecallercompleteAt']=null;this[_0x356e('0x9')]=![];this[_0x356e('0xa')]=null;this[_0x356e('0xb')]=0x1;this['channel']='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x356e('0xc')]='';this['context']='';this[_0x356e('0xd')]='';this[_0x356e('0xe')]='';this[_0x356e('0xf')]=0x0;this[_0x356e('0x10')]=![];this['lastAssignedTo']='';this[_0x356e('0x11')]=_0x356e('0x12');this['mohtime']=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x927e=['queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','channel','connectedlinenum','accountcode','context','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x5059f0,_0x26e0a7){var _0x2450e7=function(_0x5e8c9f){while(--_0x5e8c9f){_0x5059f0['push'](_0x5059f0['shift']());}};_0x2450e7(++_0x26e0a7);}(_0x927e,0x66));var _0xe927=function(_0x4a1835,_0xe4a237){_0x4a1835=_0x4a1835-0x0;var _0x203f1b=_0x927e[_0x4a1835];return _0x203f1b;};'use strict';function QueueReport(){this[_0xe927('0x0')]=_0xe927('0x1');this[_0xe927('0x2')]='';this[_0xe927('0x3')]='';this['calleridname']='';this['queue']='';this['queuecallerjoinAt']=null;this[_0xe927('0x4')]=null;this[_0xe927('0x5')]=0x1;this[_0xe927('0x6')]=0x1;this[_0xe927('0x7')]=![];this['queuecallerabandonAt']=null;this[_0xe927('0x8')]=![];this[_0xe927('0x9')]=null;this['queuecallerexit']=![];this[_0xe927('0xa')]=null;this['originalposition']=0x1;this[_0xe927('0xb')]='';this[_0xe927('0xc')]='';this['connectedlinename']='';this[_0xe927('0xd')]='';this[_0xe927('0xe')]='';this['exten']='';this['priority']='';this[_0xe927('0xf')]=0x0;this[_0xe927('0x10')]=![];this[_0xe927('0x11')]='';this['motionChannel']=_0xe927('0x12');this[_0xe927('0x13')]=0x0;this[_0xe927('0x14')]={};}module[_0xe927('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index fb3e5ac..15a33d0 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 _0x810f=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations'];(function(_0x1701c4,_0x165e94){var _0x8e537b=function(_0x1c4e0c){while(--_0x1c4e0c){_0x1701c4['push'](_0x1701c4['shift']());}};_0x8e537b(++_0x165e94);}(_0x810f,0x114));var _0xf810=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x810f[_0x455c6c];return _0x488242;};'use strict';function SalesforceAccount(_0x52b903){this['id']=_0x52b903['id']||0x0;this[_0xf810('0x0')]=_0x52b903[_0xf810('0x0')]||'';this['username']=_0x52b903[_0xf810('0x1')]||'';this[_0xf810('0x2')]=_0x52b903['remoteUri']||'';this[_0xf810('0x3')]=_0x52b903[_0xf810('0x3')]||'';this[_0xf810('0x4')]=_0x52b903['clientId']||'';this[_0xf810('0x5')]=_0x52b903[_0xf810('0x5')]||'';this[_0xf810('0x6')]=_0x52b903['securityToken']||'';this[_0xf810('0x7')]=_0x52b903[_0xf810('0x7')]||'integrationTab';this[_0xf810('0x8')]=_0x52b903['serverUrl']||'';this['Configurations']=_0x52b903[_0xf810('0x9')]||{};}module[_0xf810('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x2adc=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x23d74a,_0x14f49f){var _0x269c83=function(_0x324123){while(--_0x324123){_0x23d74a['push'](_0x23d74a['shift']());}};_0x269c83(++_0x14f49f);}(_0x2adc,0x135));var _0xc2ad=function(_0xc835aa,_0x5c26d5){_0xc835aa=_0xc835aa-0x0;var _0xbafcb8=_0x2adc[_0xc835aa];return _0xbafcb8;};'use strict';function SalesforceAccount(_0x301c6c){this['id']=_0x301c6c['id']||0x0;this[_0xc2ad('0x0')]=_0x301c6c[_0xc2ad('0x0')]||'';this[_0xc2ad('0x1')]=_0x301c6c[_0xc2ad('0x1')]||'';this[_0xc2ad('0x2')]=_0x301c6c[_0xc2ad('0x2')]||'';this[_0xc2ad('0x3')]=_0x301c6c['password']||'';this[_0xc2ad('0x4')]=_0x301c6c[_0xc2ad('0x4')]||'';this[_0xc2ad('0x5')]=_0x301c6c[_0xc2ad('0x5')]||'';this[_0xc2ad('0x6')]=_0x301c6c[_0xc2ad('0x6')]||'';this[_0xc2ad('0x7')]=_0x301c6c[_0xc2ad('0x7')]||_0xc2ad('0x8');this['serverUrl']=_0x301c6c[_0xc2ad('0x9')]||'';this[_0xc2ad('0xa')]=_0x301c6c[_0xc2ad('0xa')]||{};}module[_0xc2ad('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 52ea5df..f90b481 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 _0xfe5c=['password','remoteUri','serverUrl','name','username'];(function(_0x5b476d,_0x35716e){var _0xe589fe=function(_0x17fe8e){while(--_0x17fe8e){_0x5b476d['push'](_0x5b476d['shift']());}};_0xe589fe(++_0x35716e);}(_0xfe5c,0xa8));var _0xcfe5=function(_0x4b82c4,_0x56abbc){_0x4b82c4=_0x4b82c4-0x0;var _0x2db142=_0xfe5c[_0x4b82c4];return _0x2db142;};'use strict';function ServicenowAccount(_0x8041e9){this['id']=_0x8041e9['id']||0x0;this[_0xcfe5('0x0')]=_0x8041e9['name']||'';this['username']=_0x8041e9[_0xcfe5('0x1')]||'';this['password']=_0x8041e9[_0xcfe5('0x2')]||'';this[_0xcfe5('0x3')]=_0x8041e9['remoteUri']||'';this[_0xcfe5('0x4')]=_0x8041e9['serverUrl']||'';this['Configurations']=_0x8041e9['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xdf9b=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdf9b,0x1cb));var _0xbdf9=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xdf9b[_0x486f4a];return _0x135d99;};'use strict';function ServicenowAccount(_0x322788){this['id']=_0x322788['id']||0x0;this[_0xbdf9('0x0')]=_0x322788[_0xbdf9('0x0')]||'';this[_0xbdf9('0x1')]=_0x322788['username']||'';this[_0xbdf9('0x2')]=_0x322788['password']||'';this[_0xbdf9('0x3')]=_0x322788[_0xbdf9('0x3')]||'';this['serverUrl']=_0x322788[_0xbdf9('0x4')]||'';this[_0xbdf9('0x5')]=_0x322788['Configurations']||{};}module[_0xbdf9('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 a7b499c..62fea60 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 _0xa67a=['exports','name','username','password','remoteUri','serverUrl'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0xa67a,0x91));var _0xaa67=function(_0x32b5bc,_0x2e47ea){_0x32b5bc=_0x32b5bc-0x0;var _0x1f2cce=_0xa67a[_0x32b5bc];return _0x1f2cce;};'use strict';function SugarcrmAccount(_0x28ba73){this['id']=_0x28ba73['id']||0x0;this[_0xaa67('0x0')]=_0x28ba73[_0xaa67('0x0')]||'';this[_0xaa67('0x1')]=_0x28ba73[_0xaa67('0x1')]||'';this[_0xaa67('0x2')]=_0x28ba73[_0xaa67('0x2')]||'';this[_0xaa67('0x3')]=_0x28ba73[_0xaa67('0x3')]||'';this['serverUrl']=_0x28ba73[_0xaa67('0x4')]||'';this['Configurations']=_0x28ba73['Configurations']||{};}module[_0xaa67('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xacfe=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xacfe,0x93));var _0xeacf=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xacfe[_0x50a0c2];return _0x5ebadd;};'use strict';function SugarcrmAccount(_0x5cf291){this['id']=_0x5cf291['id']||0x0;this[_0xeacf('0x0')]=_0x5cf291['name']||'';this[_0xeacf('0x1')]=_0x5cf291[_0xeacf('0x1')]||'';this[_0xeacf('0x2')]=_0x5cf291[_0xeacf('0x2')]||'';this[_0xeacf('0x3')]=_0x5cf291[_0xeacf('0x3')]||'';this[_0xeacf('0x4')]=_0x5cf291[_0xeacf('0x4')]||'';this[_0xeacf('0x5')]=_0x5cf291[_0xeacf('0x5')]||{};}module[_0xeacf('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 551b231..c580048 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 _0xb9f0=['name','accountcode','stateTime','status','exports'];(function(_0xafe711,_0x21ef56){var _0x1a89a2=function(_0x318c84){while(--_0x318c84){_0xafe711['push'](_0xafe711['shift']());}};_0x1a89a2(++_0x21ef56);}(_0xb9f0,0xc8));var _0x0b9f=function(_0x52be4c,_0x5ef24f){_0x52be4c=_0x52be4c-0x0;var _0x477943=_0xb9f0[_0x52be4c];return _0x477943;};'use strict';function Telephone(_0x565d76){this['id']=_0x565d76['id']||0x0;this['name']=_0x565d76[_0x0b9f('0x0')]||'';this[_0x0b9f('0x1')]=_0x565d76[_0x0b9f('0x1')]||'';this['state']='unknown';this[_0x0b9f('0x2')]=0x0;this[_0x0b9f('0x3')]='unknown';this['address']='';}module[_0x0b9f('0x4')]=Telephone; \ No newline at end of file +var _0x9563=['unknown','exports','name','accountcode','state'];(function(_0x1e1e30,_0x1f588b){var _0x37505a=function(_0x31ec00){while(--_0x31ec00){_0x1e1e30['push'](_0x1e1e30['shift']());}};_0x37505a(++_0x1f588b);}(_0x9563,0x1e7));var _0x3956=function(_0x5a8112,_0x1c1502){_0x5a8112=_0x5a8112-0x0;var _0x5a64a1=_0x9563[_0x5a8112];return _0x5a64a1;};'use strict';function Telephone(_0x1eb54d){this['id']=_0x1eb54d['id']||0x0;this[_0x3956('0x0')]=_0x1eb54d['name']||'';this[_0x3956('0x1')]=_0x1eb54d[_0x3956('0x1')]||'';this[_0x3956('0x2')]=_0x3956('0x3');this['stateTime']=0x0;this['status']=_0x3956('0x3');this['address']='';}module[_0x3956('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index e9ce37d..f71c97b 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x50f720,_0x1f1b15){var _0x1d4392=function(_0x3c930f){while(--_0x3c930f){_0x50f720['push'](_0x50f720['shift']());}};_0x1d4392(++_0x1f1b15);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c67a2,_0x599648){_0x1c67a2=_0x1c67a2-0x0;var _0x4fbd8e=_0xb10b[_0x1c67a2];return _0x4fbd8e;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x3ca955,_0x1cb58e){var _0x26c072=function(_0x192187){while(--_0x192187){_0x3ca955['push'](_0x3ca955['shift']());}};_0x26c072(++_0x1cb58e);}(_0xb10b,0x12a));var _0xbb10=function(_0x39aedf,_0x2f5df8){_0x39aedf=_0x39aedf-0x0;var _0x39356c=_0xb10b[_0x39aedf];return _0x39356c;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index cf01d5c..3a12c13 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 _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x5eb8[_0x3238ea];return _0x4aaac2;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x1cd844,_0x41e3b2){var _0x5b5271=function(_0xbdf97e){while(--_0xbdf97e){_0x1cd844['push'](_0x1cd844['shift']());}};_0x5b5271(++_0x41e3b2);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4b9c3d,_0x29301a){_0x4b9c3d=_0x4b9c3d-0x0;var _0x173310=_0x9ffd[_0x4b9c3d];return _0x173310;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 2accdb6..e97416c 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 _0x4c7a=['defaultuser','exports','active','name','state','unknown','stateTime','registry','split','port','domain','domainport','stateRegistry','registrationtime','address'];(function(_0x326d37,_0x19e1cf){var _0x5db059=function(_0x1fad39){while(--_0x1fad39){_0x326d37['push'](_0x326d37['shift']());}};_0x5db059(++_0x19e1cf);}(_0x4c7a,0x1e2));var _0xa4c7=function(_0x2bf0de,_0x47edd0){_0x2bf0de=_0x2bf0de-0x0;var _0x51158b=_0x4c7a[_0x2bf0de];return _0x51158b;};'use strict';function Trunk(_0x514898){this['id']=_0x514898['id']||0x0;this[_0xa4c7('0x0')]=_0x514898['active']||![];this[_0xa4c7('0x1')]=_0x514898['name']||'';this[_0xa4c7('0x2')]=_0xa4c7('0x3');this[_0xa4c7('0x4')]=0x0;this['status']=_0xa4c7('0x3');this['registry']=_0x514898[_0xa4c7('0x5')]&&_0x514898['registry']['indexOf'](':')?_0x514898['registry'][_0xa4c7('0x6')](':')[0x0]:'';this['host']='';this[_0xa4c7('0x7')]='';this[_0xa4c7('0x8')]='';this[_0xa4c7('0x9')]='';this['refresh']='';this[_0xa4c7('0xa')]=_0xa4c7('0x3');this[_0xa4c7('0xb')]='';this[_0xa4c7('0xc')]='';this[_0xa4c7('0xd')]=_0x514898[_0xa4c7('0xd')]||'';}module[_0xa4c7('0xe')]=Trunk; \ No newline at end of file +var _0x970f=['host','port','domain','domainport','refresh','stateRegistry','address','active','name','unknown','stateTime','status','registry','indexOf','split'];(function(_0x4288e2,_0x39fd9d){var _0x2abb3a=function(_0x47da6f){while(--_0x47da6f){_0x4288e2['push'](_0x4288e2['shift']());}};_0x2abb3a(++_0x39fd9d);}(_0x970f,0x70));var _0xf970=function(_0x388b7b,_0x52c9dd){_0x388b7b=_0x388b7b-0x0;var _0x5ccd8d=_0x970f[_0x388b7b];return _0x5ccd8d;};'use strict';function Trunk(_0x476120){this['id']=_0x476120['id']||0x0;this[_0xf970('0x0')]=_0x476120[_0xf970('0x0')]||![];this[_0xf970('0x1')]=_0x476120[_0xf970('0x1')]||'';this['state']=_0xf970('0x2');this[_0xf970('0x3')]=0x0;this[_0xf970('0x4')]=_0xf970('0x2');this[_0xf970('0x5')]=_0x476120[_0xf970('0x5')]&&_0x476120[_0xf970('0x5')][_0xf970('0x6')](':')?_0x476120[_0xf970('0x5')][_0xf970('0x7')](':')[0x0]:'';this[_0xf970('0x8')]='';this[_0xf970('0x9')]='';this[_0xf970('0xa')]='';this[_0xf970('0xb')]='';this[_0xf970('0xc')]='';this[_0xf970('0xd')]=_0xf970('0x2');this['registrationtime']='';this[_0xf970('0xe')]='';this['defaultuser']=_0x476120['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index ac39e9f..84ede32 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 _0x4b8b=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4b8b,0x10a));var _0xb4b8=function(_0x1c8bb1,_0x5621e8){_0x1c8bb1=_0x1c8bb1-0x0;var _0x1f5c9f=_0x4b8b[_0x1c8bb1];return _0x1f5c9f;};'use strict';function voiceExtension(_0x517cd8){this['id']=_0x517cd8['id']||0x0;this[_0xb4b8('0x0')]=_0x517cd8['exten']||'';this[_0xb4b8('0x1')]=_0x517cd8['recordingFormat']||_0xb4b8('0x2');this[_0xb4b8('0x3')]=_0x517cd8['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xe043=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x5daa87,_0x17d1f6){var _0x37e9af=function(_0x4b1b06){while(--_0x4b1b06){_0x5daa87['push'](_0x5daa87['shift']());}};_0x37e9af(++_0x17d1f6);}(_0xe043,0x1df));var _0x3e04=function(_0x2cec77,_0x1fa267){_0x2cec77=_0x2cec77-0x0;var _0x5a549f=_0xe043[_0x2cec77];return _0x5a549f;};'use strict';function voiceExtension(_0x528f9b){this['id']=_0x528f9b['id']||0x0;this[_0x3e04('0x0')]=_0x528f9b[_0x3e04('0x0')]||'';this['recordingFormat']=_0x528f9b[_0x3e04('0x1')]||_0x3e04('0x2');this[_0x3e04('0x3')]=_0x528f9b[_0x3e04('0x3')]||![];}module[_0x3e04('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 500f443..99db048 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 _0xdac1=['wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','exports','unknown','not_inuse','inuse','invalid','ringinuse','onhold'];(function(_0xe116d2,_0x2a6d46){var _0x3e4d69=function(_0x259744){while(--_0x259744){_0xe116d2['push'](_0xe116d2['shift']());}};_0x3e4d69(++_0x2a6d46);}(_0xdac1,0x1ce));var _0x1dac=function(_0x3647ce,_0x30febf){_0x3647ce=_0x3647ce-0x0;var _0x17397e=_0xdac1[_0x3647ce];return _0x17397e;};'use strict';var statusDesc=[_0x1dac('0x0'),_0x1dac('0x1'),_0x1dac('0x2'),'busy',_0x1dac('0x3'),'unavailable','ringing',_0x1dac('0x4'),_0x1dac('0x5')];var monitorFormat={'wav':_0x1dac('0x6'),'wav49':'wav49','gsm':_0x1dac('0x7')};var strategy={'rrmemory':_0x1dac('0x8'),'roundrobin':_0x1dac('0x9')};function VoiceQueue(_0x45b02f){this['id']=_0x45b02f['id']||0x0;this[_0x1dac('0xa')]=_0x45b02f['name']||'';this['monitor_format']=_0x45b02f[_0x1dac('0xb')]||'';this[_0x1dac('0xc')]=_0x45b02f[_0x1dac('0xc')]||_0x1dac('0xd');this['waiting']=0x0;this['talking']=0x0;this['total']=0x0;this[_0x1dac('0xe')]=0x0;this[_0x1dac('0xf')]=0x0;this['sumHoldTime']=0x0;this[_0x1dac('0x10')]=0x0;this[_0x1dac('0x11')]=0x0;this[_0x1dac('0x12')]=0x0;this[_0x1dac('0x13')]=0x0;this[_0x1dac('0x14')]=0x0;this[_0x1dac('0x15')]=_0x45b02f[_0x1dac('0x15')]||![];this[_0x1dac('0x16')]=_0x45b02f['acwTimeout']||0xa;this[_0x1dac('0x17')]=_0x45b02f[_0x1dac('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0x1dac('0x18')]='';this[_0x1dac('0x19')]=0x0;this[_0x1dac('0x1a')]=0x0;this[_0x1dac('0x1b')]=_0x45b02f['dialTimezone']||null;this[_0x1dac('0x1c')]=_0x45b02f['dialGlobalInterval']?_0x45b02f['dialGlobalInterval']:null;this['dialActive']=_0x45b02f['dialActive'];this['dialMethod']=_0x45b02f['dialMethod']||_0x1dac('0x1d');this[_0x1dac('0x1e')]=_0x45b02f['dialLimitChannel']||0x0;this[_0x1dac('0x1f')]=_0x45b02f[_0x1dac('0x1f')]||0x0;this['dialPowerLevel']=_0x45b02f[_0x1dac('0x20')]||0x1;this[_0x1dac('0x21')]=_0x45b02f['dialPredictiveOptimization']||_0x1dac('0x22');this[_0x1dac('0x23')]=_0x45b02f[_0x1dac('0x23')]||0.03;this[_0x1dac('0x24')]=_0x45b02f[_0x1dac('0x24')]||0x258;this[_0x1dac('0x25')]=_0x45b02f[_0x1dac('0x25')]||_0x1dac('0x26');this['dialOriginateCallerIdNumber']=_0x45b02f[_0x1dac('0x27')]||_0x1dac('0x26');this['dialOriginateTimeout']=_0x45b02f[_0x1dac('0x28')]||0x1e;this['dialQueueOptions']=_0x45b02f[_0x1dac('0x29')]||_0x1dac('0x2a');this[_0x1dac('0x2b')]=_0x45b02f[_0x1dac('0x2b')]||0x3;this[_0x1dac('0x2c')]=_0x45b02f[_0x1dac('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x45b02f['dialCongestionMaxRetry']||0x3;this[_0x1dac('0x2d')]=_0x45b02f[_0x1dac('0x2d')]||0x96;this[_0x1dac('0x2e')]=_0x45b02f[_0x1dac('0x2e')]||0x3;this[_0x1dac('0x2f')]=_0x45b02f[_0x1dac('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x45b02f[_0x1dac('0x30')]||0x3;this[_0x1dac('0x31')]=_0x45b02f[_0x1dac('0x31')]||0x96;this[_0x1dac('0x32')]=_0x45b02f[_0x1dac('0x32')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x45b02f[_0x1dac('0x33')]||0x96;this[_0x1dac('0x34')]=_0x45b02f[_0x1dac('0x34')]||0x3;this[_0x1dac('0x35')]=_0x45b02f[_0x1dac('0x35')]||0x96;this[_0x1dac('0x36')]=_0x45b02f[_0x1dac('0x36')]||0x3;this[_0x1dac('0x37')]=_0x45b02f[_0x1dac('0x37')]||0x96;this['dialMachineMaxRetry']=_0x45b02f['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x45b02f[_0x1dac('0x38')]||0x96;this[_0x1dac('0x39')]=_0x45b02f[_0x1dac('0x39')]||0x3;this[_0x1dac('0x3a')]=_0x45b02f[_0x1dac('0x3a')]||0x96;this[_0x1dac('0x3b')]=_0x45b02f['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x45b02f['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x45b02f[_0x1dac('0x3c')]?_0x45b02f[_0x1dac('0x3c')]:undefined;this[_0x1dac('0x3d')]=_0x45b02f[_0x1dac('0x3d')]?_0x45b02f[_0x1dac('0x3d')]:undefined;this[_0x1dac('0x3e')]=_0x45b02f[_0x1dac('0x3e')]||undefined;this[_0x1dac('0x3f')]=_0x45b02f['Interval']?_0x45b02f['Interval']:undefined;this['dialOrderByScheduledAt']=_0x45b02f[_0x1dac('0x40')]||_0x1dac('0x41');this[_0x1dac('0x42')]=_0x45b02f[_0x1dac('0x42')]||undefined;this[_0x1dac('0x43')]=_0x45b02f['dialCutDigit']||undefined;this[_0x1dac('0x44')]=strategy[_0x45b02f['strategy']]||_0x1dac('0x8');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x45b02f[_0x1dac('0x45')]||![];this['dialAMDInitialSilence']=_0x45b02f[_0x1dac('0x46')];this['dialAMDGreeting']=_0x45b02f[_0x1dac('0x47')];this[_0x1dac('0x48')]=_0x45b02f['dialAMDAfterGreetingSilence'];this[_0x1dac('0x49')]=_0x45b02f[_0x1dac('0x49')];this[_0x1dac('0x4a')]=_0x45b02f['dialAMDMinWordLength'];this[_0x1dac('0x4b')]=_0x45b02f[_0x1dac('0x4b')];this[_0x1dac('0x4c')]=_0x45b02f['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x45b02f['dialAMDSilenceThreshold'];this[_0x1dac('0x4d')]=_0x45b02f[_0x1dac('0x4d')];this['outboundRejectCallsDay']=0x0;this[_0x1dac('0x4e')]=0x0;this['timeout']=_0x45b02f[_0x1dac('0x4f')];this[_0x1dac('0x50')]=0x0;this[_0x1dac('0x51')]=0x0;this[_0x1dac('0x52')]=0x0;this[_0x1dac('0x53')]=0x0;this[_0x1dac('0x54')]=0x0;this[_0x1dac('0x55')]=0x0;this[_0x1dac('0x56')]=0x0;this[_0x1dac('0x57')]=0x0;this[_0x1dac('0x58')]=0x0;this[_0x1dac('0x59')]=0x0;this[_0x1dac('0x5a')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x1dac('0x5b')]=0x0;this[_0x1dac('0x5c')]=0x0;this[_0x1dac('0x5d')]=undefined;this[_0x1dac('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x1dac('0x5f')]=1.05;this[_0x1dac('0x60')]=0x0;this[_0x1dac('0x61')]=0x0;this[_0x1dac('0x62')]=0x0;this[_0x1dac('0x63')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x1dac('0x64')]=_0x45b02f['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x1dac('0x65')]=_0x45b02f['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x1dac('0x66')]=0x0;this[_0x1dac('0x67')]=0x0;this[_0x1dac('0x68')]=0x1;this[_0x1dac('0x69')]=0x0;this[_0x1dac('0x6a')]=0x0;this[_0x1dac('0x6b')]=0x0;this[_0x1dac('0x6c')]=0x0;this[_0x1dac('0x6d')]=_0x45b02f[_0x1dac('0x6d')]||0x1e;this[_0x1dac('0x6e')]=_0x45b02f['dialRecallInQueue']||![];this[_0x1dac('0x6f')]=!!_0x45b02f[_0x1dac('0x6f')]||![];this[_0x1dac('0x70')]=!!_0x45b02f[_0x1dac('0x70')]||![];this[_0x1dac('0x71')]=_0x45b02f[_0x1dac('0x71')]||undefined;this[_0x1dac('0x72')]=_0x45b02f['dialAgiAfterHangupClient']||![];this[_0x1dac('0x73')]=_0x45b02f[_0x1dac('0x73')]||![];this[_0x1dac('0xb')]=monitorFormat[_0x45b02f[_0x1dac('0xb')]]?monitorFormat[_0x45b02f['monitor_format']]:undefined;this['mandatoryDisposition']=_0x45b02f['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x45b02f['mandatoryDispositionPause']?_0x45b02f['mandatoryDispositionPause']:undefined;}module[_0x1dac('0x74')]=VoiceQueue; \ No newline at end of file +var _0xf4d2=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','unavailable','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','available','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x4d7ef5,_0x291b5c){var _0x1c8220=function(_0x27d544){while(--_0x27d544){_0x4d7ef5['push'](_0x4d7ef5['shift']());}};_0x1c8220(++_0x291b5c);}(_0xf4d2,0x1ae));var _0x2f4d=function(_0x5bc853,_0x1a952b){_0x5bc853=_0x5bc853-0x0;var _0x2aa497=_0xf4d2[_0x5bc853];return _0x2aa497;};'use strict';var statusDesc=[_0x2f4d('0x0'),_0x2f4d('0x1'),'inuse',_0x2f4d('0x2'),'invalid',_0x2f4d('0x3'),'ringing',_0x2f4d('0x4'),_0x2f4d('0x5')];var monitorFormat={'wav':_0x2f4d('0x6'),'wav49':'wav49','gsm':_0x2f4d('0x7')};var strategy={'rrmemory':_0x2f4d('0x8'),'roundrobin':_0x2f4d('0x9')};function VoiceQueue(_0x52699f){this['id']=_0x52699f['id']||0x0;this[_0x2f4d('0xa')]=_0x52699f[_0x2f4d('0xa')]||'';this[_0x2f4d('0xb')]=_0x52699f[_0x2f4d('0xb')]||'';this[_0x2f4d('0xc')]=_0x52699f[_0x2f4d('0xc')]||_0x2f4d('0xd');this['waiting']=0x0;this[_0x2f4d('0xe')]=0x0;this[_0x2f4d('0xf')]=0x0;this[_0x2f4d('0x10')]=0x0;this[_0x2f4d('0x11')]=0x0;this[_0x2f4d('0x12')]=0x0;this[_0x2f4d('0x13')]=0x0;this['unmanaged']=0x0;this[_0x2f4d('0x14')]=0x0;this['loggedIn']=0x0;this[_0x2f4d('0x15')]=0x0;this[_0x2f4d('0x16')]=_0x52699f[_0x2f4d('0x16')]||![];this[_0x2f4d('0x17')]=_0x52699f[_0x2f4d('0x17')]||0xa;this['autopause']=_0x52699f['autopause']||'no';this[_0x2f4d('0x18')]=!![];this[_0x2f4d('0x19')]='';this[_0x2f4d('0x1a')]=0x0;this[_0x2f4d('0x1b')]=0x0;this[_0x2f4d('0x1c')]=_0x52699f[_0x2f4d('0x1c')]||null;this[_0x2f4d('0x1d')]=_0x52699f[_0x2f4d('0x1d')]?_0x52699f[_0x2f4d('0x1d')]:null;this[_0x2f4d('0x1e')]=_0x52699f[_0x2f4d('0x1e')];this[_0x2f4d('0x1f')]=_0x52699f[_0x2f4d('0x1f')]||_0x2f4d('0x20');this[_0x2f4d('0x21')]=_0x52699f[_0x2f4d('0x21')]||0x0;this[_0x2f4d('0x22')]=_0x52699f['dialLimitQueue']||0x0;this[_0x2f4d('0x23')]=_0x52699f[_0x2f4d('0x23')]||0x1;this['dialPredictiveOptimization']=_0x52699f['dialPredictiveOptimization']||'dropRate';this[_0x2f4d('0x24')]=_0x52699f['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x52699f['dialPredictiveInterval']||0x258;this[_0x2f4d('0x25')]=_0x52699f[_0x2f4d('0x25')]||_0x2f4d('0x26');this[_0x2f4d('0x27')]=_0x52699f['dialOriginateCallerIdNumber']||_0x2f4d('0x26');this[_0x2f4d('0x28')]=_0x52699f[_0x2f4d('0x28')]||0x1e;this[_0x2f4d('0x29')]=_0x52699f[_0x2f4d('0x29')]||_0x2f4d('0x2a');this[_0x2f4d('0x2b')]=_0x52699f['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x52699f[_0x2f4d('0x2c')]||undefined;this[_0x2f4d('0x2d')]=_0x52699f[_0x2f4d('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x52699f[_0x2f4d('0x2e')]||0x96;this[_0x2f4d('0x2f')]=_0x52699f['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x52699f[_0x2f4d('0x30')]||0x96;this[_0x2f4d('0x31')]=_0x52699f[_0x2f4d('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x52699f[_0x2f4d('0x32')]||0x96;this[_0x2f4d('0x33')]=_0x52699f[_0x2f4d('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x52699f[_0x2f4d('0x34')]||0x96;this[_0x2f4d('0x35')]=_0x52699f[_0x2f4d('0x35')]||0x3;this[_0x2f4d('0x36')]=_0x52699f[_0x2f4d('0x36')]||0x96;this[_0x2f4d('0x37')]=_0x52699f[_0x2f4d('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x52699f['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x52699f[_0x2f4d('0x38')]||0x3;this[_0x2f4d('0x39')]=_0x52699f[_0x2f4d('0x39')]||0x96;this[_0x2f4d('0x3a')]=_0x52699f['dialAgentRejectMaxRetry']||0x3;this[_0x2f4d('0x3b')]=_0x52699f['dialAgentRejectRetryFrequency']||0x96;this[_0x2f4d('0x3c')]=_0x52699f[_0x2f4d('0x3c')]||0x3;this[_0x2f4d('0x3d')]=_0x52699f[_0x2f4d('0x3d')]||0x4;this['Trunk']=_0x52699f[_0x2f4d('0x3e')]?_0x52699f[_0x2f4d('0x3e')]:undefined;this[_0x2f4d('0x3f')]=_0x52699f[_0x2f4d('0x3f')]?_0x52699f[_0x2f4d('0x3f')]:undefined;this[_0x2f4d('0x40')]=_0x52699f[_0x2f4d('0x40')]||undefined;this[_0x2f4d('0x41')]=_0x52699f[_0x2f4d('0x41')]?_0x52699f['Interval']:undefined;this[_0x2f4d('0x42')]=_0x52699f[_0x2f4d('0x42')]||_0x2f4d('0x43');this['dialRandomLastDigitCallerIdNumber']=_0x52699f[_0x2f4d('0x44')]||undefined;this['dialCutDigit']=_0x52699f[_0x2f4d('0x45')]||undefined;this[_0x2f4d('0x46')]=strategy[_0x52699f[_0x2f4d('0x46')]]||_0x2f4d('0x8');this['queueStatusComplete']=!![];this[_0x2f4d('0x47')]=_0x52699f[_0x2f4d('0x47')]||![];this[_0x2f4d('0x48')]=_0x52699f['dialAMDInitialSilence'];this[_0x2f4d('0x49')]=_0x52699f['dialAMDGreeting'];this[_0x2f4d('0x4a')]=_0x52699f[_0x2f4d('0x4a')];this[_0x2f4d('0x4b')]=_0x52699f['dialAMDTotalAnalysisTime'];this[_0x2f4d('0x4c')]=_0x52699f['dialAMDMinWordLength'];this[_0x2f4d('0x4d')]=_0x52699f[_0x2f4d('0x4d')];this[_0x2f4d('0x4e')]=_0x52699f[_0x2f4d('0x4e')];this[_0x2f4d('0x4f')]=_0x52699f[_0x2f4d('0x4f')];this[_0x2f4d('0x50')]=_0x52699f[_0x2f4d('0x50')];this[_0x2f4d('0x51')]=0x0;this['pTalking']=0x0;this[_0x2f4d('0x52')]=_0x52699f[_0x2f4d('0x52')];this[_0x2f4d('0x53')]=0x0;this[_0x2f4d('0x54')]=0x0;this[_0x2f4d('0x55')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x2f4d('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x2f4d('0x57')]=0x0;this[_0x2f4d('0x58')]=0x0;this[_0x2f4d('0x59')]=0x0;this[_0x2f4d('0x5a')]=0x0;this[_0x2f4d('0x5b')]=0x0;this[_0x2f4d('0x5c')]=0x0;this[_0x2f4d('0x5d')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x2f4d('0x5e')]=undefined;this[_0x2f4d('0x5f')]=undefined;this[_0x2f4d('0x60')]=undefined;this[_0x2f4d('0x61')]=1.05;this[_0x2f4d('0x62')]=0x0;this[_0x2f4d('0x63')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x2f4d('0x64')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x2f4d('0x65')]=0x0;this[_0x2f4d('0x66')]=0x0;this[_0x2f4d('0x67')]=0x0;this[_0x2f4d('0x68')]=_0x52699f[_0x2f4d('0x69')]||0x14;this[_0x2f4d('0x6a')]=_0x52699f[_0x2f4d('0x69')]||0xa;this[_0x2f4d('0x6b')]=0x0;this[_0x2f4d('0x6c')]=0x0;this[_0x2f4d('0x6d')]=0x1;this[_0x2f4d('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this[_0x2f4d('0x6f')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x52699f[_0x2f4d('0x70')]||0x1e;this[_0x2f4d('0x71')]=_0x52699f[_0x2f4d('0x71')]||![];this[_0x2f4d('0x72')]=!!_0x52699f[_0x2f4d('0x72')]||![];this['dialPreviewRecallmeReminder']=!!_0x52699f['dialPreviewRecallmeReminder']||![];this[_0x2f4d('0x73')]=_0x52699f[_0x2f4d('0x73')]||undefined;this[_0x2f4d('0x74')]=_0x52699f[_0x2f4d('0x74')]||![];this[_0x2f4d('0x75')]=_0x52699f[_0x2f4d('0x75')]||![];this[_0x2f4d('0xb')]=monitorFormat[_0x52699f['monitor_format']]?monitorFormat[_0x52699f['monitor_format']]:undefined;this[_0x2f4d('0x76')]=_0x52699f[_0x2f4d('0x76')]||![];this[_0x2f4d('0x77')]=_0x52699f[_0x2f4d('0x77')]?_0x52699f['mandatoryDispositionPause']:undefined;}module[_0x2f4d('0x78')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 7efc596..01f1b0a 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 _0xc122=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x1f809e,_0x1040bb){var _0x4f96ab=function(_0x2611f7){while(--_0x2611f7){_0x1f809e['push'](_0x1f809e['shift']());}};_0x4f96ab(++_0x1040bb);}(_0xc122,0x1cf));var _0x2c12=function(_0x9606be,_0x2dcfff){_0x9606be=_0x9606be-0x0;var _0x4be344=_0xc122[_0x9606be];return _0x4be344;};'use strict';function VtigerAccount(_0x4dac9e){this['id']=_0x4dac9e['id']||0x0;this[_0x2c12('0x0')]=_0x4dac9e[_0x2c12('0x0')]||'';this['username']=_0x4dac9e[_0x2c12('0x1')]||'';this[_0x2c12('0x2')]=_0x4dac9e[_0x2c12('0x2')]||'';this[_0x2c12('0x3')]=_0x4dac9e[_0x2c12('0x3')]||'';this[_0x2c12('0x4')]=_0x4dac9e[_0x2c12('0x4')]||'';this[_0x2c12('0x5')]=_0x4dac9e[_0x2c12('0x5')]||{};}module[_0x2c12('0x6')]=VtigerAccount; \ No newline at end of file +var _0x8eb5=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x2e761b,_0x330f3b){var _0x100f42=function(_0x191126){while(--_0x191126){_0x2e761b['push'](_0x2e761b['shift']());}};_0x100f42(++_0x330f3b);}(_0x8eb5,0xe3));var _0x58eb=function(_0x1f7c7f,_0x114b5d){_0x1f7c7f=_0x1f7c7f-0x0;var _0x33c1c0=_0x8eb5[_0x1f7c7f];return _0x33c1c0;};'use strict';function VtigerAccount(_0x535bc3){this['id']=_0x535bc3['id']||0x0;this[_0x58eb('0x0')]=_0x535bc3[_0x58eb('0x0')]||'';this[_0x58eb('0x1')]=_0x535bc3[_0x58eb('0x1')]||'';this[_0x58eb('0x2')]=_0x535bc3[_0x58eb('0x2')]||'';this[_0x58eb('0x3')]=_0x535bc3[_0x58eb('0x3')]||'';this[_0x58eb('0x4')]=_0x535bc3['serverUrl']||'';this[_0x58eb('0x5')]=_0x535bc3[_0x58eb('0x5')]||{};}module[_0x58eb('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5ba10ff..ad30f2f 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 _0xea0a=['remoteUri','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x4cce67,_0x219de4){var _0x453e03=function(_0x2f99d2){while(--_0x2f99d2){_0x4cce67['push'](_0x4cce67['shift']());}};_0x453e03(++_0x219de4);}(_0xea0a,0x128));var _0xaea0=function(_0x42d825,_0x1045d0){_0x42d825=_0x42d825-0x0;var _0x417c63=_0xea0a[_0x42d825];return _0x417c63;};'use strict';function ZendeskAccount(_0x69efa0){this['id']=_0x69efa0['id']||0x0;this[_0xaea0('0x0')]=_0x69efa0[_0xaea0('0x0')]||'';this[_0xaea0('0x1')]=_0x69efa0[_0xaea0('0x1')]||'';this['password']=_0x69efa0[_0xaea0('0x2')]||'';this[_0xaea0('0x3')]=_0x69efa0[_0xaea0('0x3')]||'';this[_0xaea0('0x4')]=_0x69efa0['remoteUri']||'';this['authType']=_0x69efa0['authType']||'';this['type']=_0x69efa0[_0xaea0('0x5')]||_0xaea0('0x6');this[_0xaea0('0x7')]=_0x69efa0[_0xaea0('0x7')]||'';this['Configurations']=_0x69efa0[_0xaea0('0x8')]||{};}module[_0xaea0('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xa9f4=['token','remoteUri','authType','serverUrl','Configurations','exports','name','username','password'];(function(_0x1ab80d,_0x18b3c5){var _0x257c93=function(_0x47f5d7){while(--_0x47f5d7){_0x1ab80d['push'](_0x1ab80d['shift']());}};_0x257c93(++_0x18b3c5);}(_0xa9f4,0x1d1));var _0x4a9f=function(_0x1dc20e,_0x42c247){_0x1dc20e=_0x1dc20e-0x0;var _0x1b1158=_0xa9f4[_0x1dc20e];return _0x1b1158;};'use strict';function ZendeskAccount(_0xe95878){this['id']=_0xe95878['id']||0x0;this[_0x4a9f('0x0')]=_0xe95878[_0x4a9f('0x0')]||'';this['username']=_0xe95878[_0x4a9f('0x1')]||'';this[_0x4a9f('0x2')]=_0xe95878[_0x4a9f('0x2')]||'';this['token']=_0xe95878[_0x4a9f('0x3')]||'';this[_0x4a9f('0x4')]=_0xe95878[_0x4a9f('0x4')]||'';this['authType']=_0xe95878[_0x4a9f('0x5')]||'';this['type']=_0xe95878['type']||'integrationTab';this[_0x4a9f('0x6')]=_0xe95878['serverUrl']||'';this[_0x4a9f('0x7')]=_0xe95878[_0x4a9f('0x7')]||{};}module[_0x4a9f('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index aa6bd2b..4ac8192 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 _0x3861=['name','description','host','zone','clientId','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x5a4cd2,_0x15cd81){var _0x4e7207=function(_0x2cdce4){while(--_0x2cdce4){_0x5a4cd2['push'](_0x5a4cd2['shift']());}};_0x4e7207(++_0x15cd81);}(_0x3861,0xdc));var _0x1386=function(_0x153eb6,_0x149a99){_0x153eb6=_0x153eb6-0x0;var _0x4a636c=_0x3861[_0x153eb6];return _0x4a636c;};'use strict';function ZohoAccount(_0x2c3159){this['id']=_0x2c3159['id']||0x0;this[_0x1386('0x0')]=_0x2c3159[_0x1386('0x0')]||'';this['description']=_0x2c3159[_0x1386('0x1')]||'';this['host']=_0x2c3159[_0x1386('0x2')]||'';this[_0x1386('0x3')]=_0x2c3159[_0x1386('0x3')]||'';this[_0x1386('0x4')]=_0x2c3159[_0x1386('0x4')]||'';this['clientSecret']=_0x2c3159['clientSecret']||'';this[_0x1386('0x5')]=_0x2c3159[_0x1386('0x5')]||'';this[_0x1386('0x6')]=_0x2c3159['code']||'';this[_0x1386('0x7')]=_0x2c3159[_0x1386('0x7')]||'';this[_0x1386('0x8')]=_0x2c3159[_0x1386('0x8')]||{};}module[_0x1386('0x9')]=ZohoAccount; \ No newline at end of file +var _0x8652=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x407a7f,_0x1abd2a){var _0x416179=function(_0x2e117e){while(--_0x2e117e){_0x407a7f['push'](_0x407a7f['shift']());}};_0x416179(++_0x1abd2a);}(_0x8652,0x1f0));var _0x2865=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x8652[_0x1e2080];return _0x260111;};'use strict';function ZohoAccount(_0x54f7cd){this['id']=_0x54f7cd['id']||0x0;this['name']=_0x54f7cd[_0x2865('0x0')]||'';this[_0x2865('0x1')]=_0x54f7cd['description']||'';this[_0x2865('0x2')]=_0x54f7cd[_0x2865('0x2')]||'';this[_0x2865('0x3')]=_0x54f7cd[_0x2865('0x3')]||'';this[_0x2865('0x4')]=_0x54f7cd[_0x2865('0x4')]||'';this[_0x2865('0x5')]=_0x54f7cd['clientSecret']||'';this[_0x2865('0x6')]=_0x54f7cd[_0x2865('0x6')]||'';this[_0x2865('0x7')]=_0x54f7cd['code']||'';this[_0x2865('0x8')]=_0x54f7cd[_0x2865('0x8')]||'';this['Configurations']=_0x54f7cd[_0x2865('0x9')]||{};}module[_0x2865('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 1793568..abca63d 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 _0x2da6=['queue','type','campaigntype','membername','Agent','name','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact'];(function(_0x2c7900,_0x44f3b6){var _0x35c02f=function(_0x343749){while(--_0x343749){_0x2c7900['push'](_0x2c7900['shift']());}};_0x35c02f(++_0x44f3b6);}(_0x2da6,0x1dd));var _0x62da=function(_0x5e75f2,_0x32c033){_0x5e75f2=_0x5e75f2-0x0;var _0x526f38=_0x2da6[_0x5e75f2];return _0x526f38;};'use strict';var util=require(_0x62da('0x0'));var _=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));function checkNameSurname(_0xbbb39b,_0xd62c5c,_0x12b8ad){var _0x19081e='';if(!_[_0x62da('0x3')](_0xd62c5c)&&'string'===typeof _0xd62c5c){_0x19081e+=_0xd62c5c;}if(!_['isNil'](_0x12b8ad)&&_0x62da('0x4')===typeof _0x12b8ad){_0x19081e+='\x20'+_0x12b8ad;}if(_0x19081e!==''){return _0x19081e;}return _0xbbb39b;}function Action(_0x3163df,_0x3a59f8,_0x30437f,_0x100e73,_0x9d9139){this[_0x62da('0x5')]=_0x30437f||undefined;this[_0x62da('0x6')]=_0x3163df['id'];this[_0x62da('0x7')]=_0x3a59f8['name'];this[_0x62da('0x8')]=_0x3a59f8[_0x62da('0x8')];this[_0x62da('0x9')]=_0x62da('0x7');this['dialAnswer']=![];this[_0x62da('0xa')]=_[_0x62da('0x3')](_0x3163df[_0x62da('0xb')])?undefined:_0x3163df[_0x62da('0xb')][_0x62da('0xc')];this['channelAgent']=this[_0x62da('0xa')]?util[_0x62da('0xd')](_0x62da('0xe'),this[_0x62da('0xa')]):_0x100e73||undefined;this[_0x62da('0xf')]=checkNameSurname(_0x3163df['Contact']['phone'],_0x3163df[_0x62da('0x10')][_0x62da('0x11')],_0x3163df[_0x62da('0x10')][_0x62da('0x12')]);this[_0x62da('0x13')]=_0x3163df[_0x62da('0x13')]||![];this[_0x62da('0x14')]=_0x3163df[_0x62da('0x15')];this[_0x62da('0x16')]=_0x3163df[_0x62da('0x16')];this[_0x62da('0x17')]=_0x3163df[_0x62da('0x17')]||0x0;this[_0x62da('0x18')]=_0x3163df[_0x62da('0x18')]||0x0;this['countnoanswerretry']=_0x3163df['countnoanswerretry']||0x0;this[_0x62da('0x19')]=(_0x3163df['countbusyretry']||0x0)+(_0x3163df[_0x62da('0x18')]||0x0)+(_0x3163df[_0x62da('0x1a')]||0x0)+(_0x3163df[_0x62da('0x1b')]||0x0)+(_0x3163df['countdropretry']||0x0)+(_0x3163df[_0x62da('0x1c')]||0x0)+(_0x3163df['countmachineretry']||0x0)+(_0x3163df[_0x62da('0x1d')]||0x0);this[_0x62da('0x1b')]=_0x3163df[_0x62da('0x1b')]||0x0;this[_0x62da('0x1e')]=_0x3163df[_0x62da('0x1e')]||0x0;this[_0x62da('0x1c')]=_0x3163df[_0x62da('0x1c')]||0x0;this[_0x62da('0x1f')]=_0x3163df[_0x62da('0x1f')]||0x0;this['countagentrejectretry']=_0x3163df[_0x62da('0x1d')]||0x0;this[_0x62da('0x20')]=_0x3163df[_0x62da('0x20')];this[_0x62da('0x21')]=_0x3163df[_0x62da('0x21')];this[_0x62da('0x22')]=_0x3163df[_0x62da('0x22')];this['recallme']=_0x3163df['recallme'];this['ContactId']=_0x3163df[_0x62da('0x23')];this[_0x62da('0x24')]=_0x3163df[_0x62da('0x24')];this[_0x62da('0x25')]=_['isNil'](_0x3163df[_0x62da('0xb')])?_0x3163df[_0x62da('0x25')]:_0x3163df['Agent']['id'];this[_0x62da('0x26')]=_0x3163df[_0x62da('0x26')];this[_0x62da('0x27')]='';this['originatecalleridname']='';}Action[_0x62da('0x28')][_0x62da('0x29')]=function(){return util[_0x62da('0xd')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x62da('0x2a')]);};module[_0x62da('0x2b')]=Action; \ No newline at end of file +var _0x1c9a=['countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','util','moment','string','isNil','uniqueid','idContact','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x306619,_0x14bc67){var _0x3ed7cb=function(_0x4bb95a){while(--_0x4bb95a){_0x306619['push'](_0x306619['shift']());}};_0x3ed7cb(++_0x14bc67);}(_0x1c9a,0x98));var _0xa1c9=function(_0x5851a5,_0x5b2c55){_0x5851a5=_0x5851a5-0x0;var _0x5d4a51=_0x1c9a[_0x5851a5];return _0x5d4a51;};'use strict';var util=require(_0xa1c9('0x0'));var _=require('lodash');var moment=require(_0xa1c9('0x1'));function checkNameSurname(_0x5c45c5,_0x1a771d,_0x1d631b){var _0x1a05a3='';if(!_['isNil'](_0x1a771d)&&_0xa1c9('0x2')===typeof _0x1a771d){_0x1a05a3+=_0x1a771d;}if(!_[_0xa1c9('0x3')](_0x1d631b)&&_0xa1c9('0x2')===typeof _0x1d631b){_0x1a05a3+='\x20'+_0x1d631b;}if(_0x1a05a3!==''){return _0x1a05a3;}return _0x5c45c5;}function Action(_0x3a4387,_0x572229,_0x144e91,_0x5448f2,_0x222624){this[_0xa1c9('0x4')]=_0x144e91||undefined;this[_0xa1c9('0x5')]=_0x3a4387['id'];this['queue']=_0x572229[_0xa1c9('0x6')];this[_0xa1c9('0x7')]=_0x572229[_0xa1c9('0x7')];this[_0xa1c9('0x8')]='queue';this[_0xa1c9('0x9')]=![];this[_0xa1c9('0xa')]=_[_0xa1c9('0x3')](_0x3a4387[_0xa1c9('0xb')])?undefined:_0x3a4387[_0xa1c9('0xb')][_0xa1c9('0x6')];this[_0xa1c9('0xc')]=this[_0xa1c9('0xa')]?util[_0xa1c9('0xd')](_0xa1c9('0xe'),this['membername']):_0x5448f2||undefined;this[_0xa1c9('0xf')]=checkNameSurname(_0x3a4387[_0xa1c9('0x10')][_0xa1c9('0x11')],_0x3a4387[_0xa1c9('0x10')][_0xa1c9('0x12')],_0x3a4387['Contact'][_0xa1c9('0x13')]);this[_0xa1c9('0x14')]=_0x3a4387[_0xa1c9('0x14')]||![];this[_0xa1c9('0x15')]=_0x3a4387[_0xa1c9('0x11')];this[_0xa1c9('0x16')]=_0x3a4387[_0xa1c9('0x16')];this[_0xa1c9('0x17')]=_0x3a4387[_0xa1c9('0x17')]||0x0;this[_0xa1c9('0x18')]=_0x3a4387['countcongestionretry']||0x0;this[_0xa1c9('0x19')]=_0x3a4387[_0xa1c9('0x19')]||0x0;this[_0xa1c9('0x1a')]=(_0x3a4387['countbusyretry']||0x0)+(_0x3a4387[_0xa1c9('0x18')]||0x0)+(_0x3a4387['countnoanswerretry']||0x0)+(_0x3a4387[_0xa1c9('0x1b')]||0x0)+(_0x3a4387[_0xa1c9('0x1c')]||0x0)+(_0x3a4387[_0xa1c9('0x1d')]||0x0)+(_0x3a4387['countmachineretry']||0x0)+(_0x3a4387[_0xa1c9('0x1e')]||0x0);this[_0xa1c9('0x1b')]=_0x3a4387[_0xa1c9('0x1b')]||0x0;this['countdropretry']=_0x3a4387[_0xa1c9('0x1c')]||0x0;this[_0xa1c9('0x1d')]=_0x3a4387['countabandonedretry']||0x0;this[_0xa1c9('0x1f')]=_0x3a4387[_0xa1c9('0x1f')]||0x0;this[_0xa1c9('0x1e')]=_0x3a4387['countagentrejectretry']||0x0;this[_0xa1c9('0x20')]=_0x3a4387[_0xa1c9('0x20')];this[_0xa1c9('0x21')]=_0x3a4387[_0xa1c9('0x21')];this[_0xa1c9('0x22')]=_0x3a4387['callbackat'];this['recallme']=_0x3a4387[_0xa1c9('0x23')];this['ContactId']=_0x3a4387[_0xa1c9('0x24')];this[_0xa1c9('0x25')]=_0x3a4387[_0xa1c9('0x25')];this[_0xa1c9('0x26')]=_[_0xa1c9('0x3')](_0x3a4387['Agent'])?_0x3a4387[_0xa1c9('0x26')]:_0x3a4387[_0xa1c9('0xb')]['id'];this[_0xa1c9('0x27')]=_0x3a4387['VoiceQueueId'];this[_0xa1c9('0x28')]='';this[_0xa1c9('0x29')]='';}Action[_0xa1c9('0x2a')]['getCaller']=function(){return util[_0xa1c9('0xd')](_0xa1c9('0x2b'),this['calleridname'],this[_0xa1c9('0x2c')]);};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 f2721d2..5a9e995 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 _0x0330=['outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','logger','syncCampaigns','hasOwnProperty','dialMethod','preview','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','SIP/%s','reachable','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridNumber','merge','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','unlockContact','disableContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay'];(function(_0x5516c7,_0x3d46e4){var _0x314076=function(_0x3e3b38){while(--_0x3e3b38){_0x5516c7['push'](_0x5516c7['shift']());}};_0x314076(++_0x3d46e4);}(_0x0330,0x11f));var _0x0033=function(_0x5dcd6a,_0x484a00){_0x5dcd6a=_0x5dcd6a-0x0;var _0x135b5e=_0x0330[_0x5dcd6a];return _0x135b5e;};'use strict';var util=require(_0x0033('0x0'));var _=require(_0x0033('0x1'));var uuid=require('uuid');var moment=require(_0x0033('0x2'));var md5=require(_0x0033('0x3'));var Redis=require(_0x0033('0x4'));var config=require(_0x0033('0x5'));var logger=require(_0x0033('0x6'))('preview');var loggerAction=require('../../../config/logger')(_0x0033('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require('./util/util');config['redis']=_['defaults'](config[_0x0033('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0033('0x8')]));var Sequence=function(){};Sequence[_0x0033('0x9')][_0x0033('0xa')]=function(_0x1bb335){this[_0x0033('0xb')]=this[_0x0033('0xb')]?this[_0x0033('0xb')][_0x0033('0xc')](_0x1bb335):_0x1bb335();};function Preview(_0x16f251){this[_0x0033('0xd')]=new Sequence();this[_0x0033('0xe')]=_0x16f251[_0x0033('0xf')];this[_0x0033('0x10')]=_0x16f251['trunks'];this[_0x0033('0x11')]={};this[_0x0033('0x12')]=_0x16f251['agents'];this[_0x0033('0x13')]=0x0;ami['on'](_0x0033('0x14'),this[_0x0033('0x15')]['bind'](this));ami['on']('hangup',this[_0x0033('0x16')][_0x0033('0x17')](this));ami['on'](_0x0033('0x18'),this[_0x0033('0x19')][_0x0033('0x17')](this));ami['on'](_0x0033('0x1a'),this[_0x0033('0x1b')][_0x0033('0x17')](this));ami['on'](_0x0033('0x1c'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0x0033('0x1d')][_0x0033('0x17')](this));ami['on']('attendedtransfer',this[_0x0033('0x1e')][_0x0033('0x17')](this));ami['on'](_0x0033('0x1f'),this[_0x0033('0x20')]['bind'](this));this[_0x0033('0x21')](this['campaignsPreview']);}function emit(_0x3e638a,_0x5902e4,_0x3240d1){io['to'](_0x3e638a)[_0x0033('0x22')](_0x5902e4,_0x3240d1);}function emitCampaignPreview(_0x1b8127){if(_0x1b8127[_0x0033('0x23')]===_0x0033('0x24')){var _0x27bd37={'id':_0x1b8127['id'],'name':_0x1b8127[_0x0033('0x25')],'strategy':_0x1b8127[_0x0033('0x26')],'answered':_0x1b8127[_0x0033('0x27')],'available':_0x1b8127[_0x0033('0x28')],'loggedIn':_0x1b8127[_0x0033('0x29')],'pTalking':_0x1b8127['pTalking'],'sumBillable':_0x1b8127['sumBillable'],'sumDuration':_0x1b8127[_0x0033('0x2a')],'sumHoldTime':_0x1b8127[_0x0033('0x2b')]||0x0,'talking':_0x1b8127[_0x0033('0x2c')],'total':_0x1b8127[_0x0033('0x2d')],'type':_0x1b8127['type'],'unmanaged':_0x1b8127[_0x0033('0x2e')],'abandoned':_0x1b8127[_0x0033('0x2f')],'waiting':_0x1b8127[_0x0033('0x30')],'loggedInDb':_0x1b8127[_0x0033('0x31')],'dialActive':_0x1b8127[_0x0033('0x32')],'dialMethod':_0x1b8127['dialMethod'],'dialOriginateCallerIdName':_0x1b8127['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1b8127[_0x0033('0x33')],'dialOriginateTimeout':_0x1b8127[_0x0033('0x34')],'dialPrefix':_0x1b8127['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1b8127[_0x0033('0x35')],'outboundAnswerCallsDay':_0x1b8127[_0x0033('0x36')],'outboundBlacklistCallsDay':_0x1b8127[_0x0033('0x37')],'outboundBusyCallsDay':_0x1b8127['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1b8127['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1b8127[_0x0033('0x38')],'outboundDropCallsDayCallersExit':_0x1b8127['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1b8127[_0x0033('0x39')],'outboundNoAnswerCallsDay':_0x1b8127['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1b8127[_0x0033('0x3a')],'outboundOriginateFailureCallsDay':_0x1b8127[_0x0033('0x3b')],'outboundReCallsDay':_0x1b8127[_0x0033('0x3c')],'outboundRejectCallsDay':_0x1b8127[_0x0033('0x3d')],'outboundUnknownCallsDay':_0x1b8127[_0x0033('0x3e')],'outboundAbandonedCallsDay':_0x1b8127[_0x0033('0x3f')],'predictiveIntervalAnsweredCalls':_0x1b8127[_0x0033('0x40')],'predictiveIntervalAvgHoldtime':_0x1b8127[_0x0033('0x41')],'predictiveIntervalAvgTalktime':_0x1b8127[_0x0033('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x1b8127[_0x0033('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x1b8127[_0x0033('0x44')],'predictiveIntervalErlangCalls':_0x1b8127[_0x0033('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x1b8127['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1b8127[_0x0033('0x46')],'predictiveIntervalMultiplicativeFactor':_0x1b8127[_0x0033('0x47')],'predictiveIntervalPauses':_0x1b8127['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1b8127[_0x0033('0x48')],'predictiveIntervalTotalCalls':_0x1b8127[_0x0033('0x49')],'message':_0x1b8127[_0x0033('0x4a')],'originated':_0x1b8127[_0x0033('0x4b')],'erlangCalls':_0x1b8127[_0x0033('0x4c')],'erlangCallToSecond':_0x1b8127[_0x0033('0x4d')],'erlangAbandonmentRate':_0x1b8127['erlangAbandonmentRate'],'erlangBusyFactor':_0x1b8127['erlangBusyFactor'],'startPredictive':_0x1b8127[_0x0033('0x4e')],'startProgressive':_0x1b8127[_0x0033('0x4f')]};if(_0x1b8127['Trunk']){_0x27bd37['Trunk']={'id':_0x1b8127['Trunk']['id'],'name':_0x1b8127[_0x0033('0x50')][_0x0033('0x25')],'active':_0x1b8127[_0x0033('0x50')][_0x0033('0x51')],'callerid':_0x1b8127[_0x0033('0x50')]['callerid']};}if(_0x1b8127[_0x0033('0x52')]){_0x27bd37['Interval']={'id':_0x1b8127['Interval']['id'],'name':_0x1b8127['Interval'][_0x0033('0x25')]};}var _0x3b8654=md5(JSON[_0x0033('0x53')](_0x27bd37));if(_0x1b8127[_0x0033('0x3')]!==_0x3b8654){_0x1b8127[_0x0033('0x3')]=_0x3b8654;emit(util[_0x0033('0x54')](_0x0033('0x55'),_0x27bd37[_0x0033('0x25')]),_0x0033('0x56'),_0x27bd37);}}}function emitVoiceQueueChannelRemove(_0x28df01){logger['info'](_0x0033('0x57'),JSON[_0x0033('0x53')](_0x28df01));emit(util['format']('voice:queue:%s',_0x28df01['name']),_0x0033('0x58'),_0x28df01);io['emit']('voice_queue_presence:remove',_0x28df01);}function notSendMessagesQueue(_0x21225d){if(_0x21225d[_0x0033('0x59')]){if(_0x21225d[_0x0033('0x4b')]===0x0&&_0x21225d[_0x0033('0x5a')]===0x0){_0x21225d[_0x0033('0x59')]=![];_0x21225d[_0x0033('0x28')]=0x0;_0x21225d[_0x0033('0x5b')]=0x0;_0x21225d[_0x0033('0x4a')]='NOT_ACTIVE';ut['logger'](_0x0033('0x5c'),_0x21225d[_0x0033('0x25')]+_0x0033('0x5d'));}else{_0x21225d[_0x0033('0x4a')]=_0x0033('0x5e');ut[_0x0033('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x21225d['name']+'\x20is\x20deactivated');}emitCampaignPreview(_0x21225d);}}Preview[_0x0033('0x9')][_0x0033('0x21')]=function(){var _0x357a0a=this;setInterval(function(){_0x357a0a[_0x0033('0x60')]();},0x7cf);};Preview[_0x0033('0x9')][_0x0033('0x60')]=function(){var _0x1477ff=this[_0x0033('0xe')];this[_0x0033('0x13')]+=0x1;for(var _0x5b4a64 in _0x1477ff){if(_0x1477ff[_0x0033('0x61')](_0x5b4a64)&&(_0x1477ff[_0x5b4a64][_0x0033('0x62')]===_0x0033('0x63')||_0x1477ff[_0x5b4a64][_0x0033('0x62')]===_0x0033('0x64'))&&_0x1477ff[_0x5b4a64][_0x0033('0x23')]===_0x0033('0x24')){if(this['clockClearZombieChannels']>0x7){this[_0x0033('0x13')]=0x0;this[_0x0033('0x65')]();}}if(_0x1477ff[_0x0033('0x61')](_0x5b4a64)&&_0x1477ff[_0x5b4a64][_0x0033('0x62')]===_0x0033('0x63')&&_0x1477ff[_0x5b4a64][_0x0033('0x23')]===_0x0033('0x24')){if(_0x1477ff[_0x5b4a64][_0x0033('0x32')]){this[_0x0033('0x66')](_0x1477ff[_0x5b4a64]);if(_0x1477ff[_0x5b4a64][_0x0033('0x67')])this[_0x0033('0x68')](_0x1477ff[_0x5b4a64]);}else{notSendMessagesQueue(_0x1477ff[_0x5b4a64]);}}}};Preview[_0x0033('0x9')][_0x0033('0x69')]=function(_0x33af12){var _0x2ce825=this;this[_0x0033('0xd')][_0x0033('0xa')](function(){if(!_[_0x0033('0x6a')](_0x2ce825[_0x0033('0x11')][_0x33af12])){loggerAction[_0x0033('0x6b')]('[clearZombieChannels][talking]',_0x33af12,_0x0033('0x6c'),_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')],_0x0033('0x6e'),JSON[_0x0033('0x53')](_0x2ce825['campaignsPreview'][_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]][_0x0033('0x4b')]),_0x0033('0x6f'),JSON[_0x0033('0x53')](_0x2ce825[_0x0033('0xe')][_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]][_0x0033('0x5a')]),JSON[_0x0033('0x53')](_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x70')]),JSON['stringify'](_[_0x0033('0x71')](_0x2ce825['actions'][_0x33af12],[_0x0033('0x72'),_0x0033('0x73'),'VoiceQueueId','ListId'])));return ami[_0x0033('0x74')]({'action':_0x0033('0x75'),'channel':_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x76')]})[_0x0033('0x77')](function(_0x39de18){if(_0x39de18[_0x0033('0x4a')]===_0x0033('0x78')){setTimeout(function(){if(_0x2ce825['actions'][_0x33af12]){ut[_0x0033('0x79')](_0x2ce825['campaignsPreview'][_0x2ce825['actions'][_0x33af12]['queue']],_0x0033('0x7a'));if(_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x70')]===!![]){ut[_0x0033('0x7b')](_0x2ce825[_0x0033('0xe')][_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]],'[clearZombieChannel]');ut['loggerError'](_0x0033('0x7c')+_0x33af12,_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]);}ut['loggerError'](_0x0033('0x7d')+_0x33af12,_0x2ce825[_0x0033('0x11')][_0x33af12][_0x0033('0x6d')]);delete _0x2ce825[_0x0033('0x11')][_0x33af12];}},0x2328);}});}});};Preview[_0x0033('0x9')]['clearZombieChannels']=function(){var _0x298c78=this;loggerAction[_0x0033('0x6b')](_0x0033('0x7e'),_[_0x0033('0x7f')](this['actions']));for(var _0xa29bb9 in this[_0x0033('0x11')]){if(_0x298c78['actions'][_0x0033('0x61')](_0xa29bb9)){_0x298c78[_0x0033('0x69')](_0xa29bb9);}}};Preview[_0x0033('0x9')][_0x0033('0x68')]=function(_0x5e9a60){var _0xb8912c=this;rpcDb['getContactRecallMe'](_0x5e9a60['id'],ut[_0x0033('0x80')](this[_0x0033('0x12')]))[_0x0033('0x81')](function(_0x4f95af){if(!_['isNil'](_0x4f95af)){for(var _0x4df190=0x0;_0x4df190<_0x4f95af[_0x0033('0x82')];_0x4df190+=0x1){if(ut[_0x0033('0x83')](_0x4f95af[_0x4df190]['scheduledat'])<_0x5e9a60[_0x0033('0x84')]*0x3c){if(_0x4f95af[_0x4df190][_0x0033('0x85')]&&!_0x4f95af[_0x4df190]['Agent'][_0x0033('0x86')]){_0xb8912c[_0x0033('0x87')](_0x4f95af[_0x4df190]['id'])[_0x0033('0x81')](ut[_0x0033('0x88')](_0x0033('0x89')))[_0x0033('0x77')](ut[_0x0033('0x88')](_0x0033('0x89')));}else{rpcDb['disableContact'](_0x4f95af[_0x4df190]['id']);}}else{var _0x2ce61c=new Action(_0x4f95af[_0x4df190],_0x5e9a60);_0x2ce61c[_0x0033('0x8a')]=moment()[_0x0033('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e9a60[_0x0033('0x3c')]+=0x1;ut[_0x0033('0x8b')](_0x2ce61c,0x17,_0x0033('0x8c'));if(_0x5e9a60[_0x0033('0x8d')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x4f95af[_0x4df190]));rpcDb['createCustomerHistory'](_0x2ce61c,_0x0033('0x8e'));}else{ut[_0x0033('0x8b')](_0x2ce61c,0x16,_0x0033('0x8f'));rpcDb[_0x0033('0x90')](_0x2ce61c,'[HistoryRecallClose]');rpcDb[_0x0033('0x91')](_0x2ce61c,_0x0033('0x92'));}}}}})[_0x0033('0x77')](ut[_0x0033('0x88')](_0x0033('0x93')));};Preview[_0x0033('0x9')]['setMessage']=function(_0x2ff3b4){_0x2ff3b4['sendMessageOneNotActive']=!![];if(ut[_0x0033('0x94')](_0x2ff3b4[_0x0033('0x29')])){_0x2ff3b4[_0x0033('0x4a')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x2ff3b4[_0x0033('0x32')])){_0x2ff3b4[_0x0033('0x4a')]=_0x0033('0x95');}else if(!this['isTrunkReachable'](_0x2ff3b4[_0x0033('0x50')])){if(!this[_0x0033('0x96')](_0x2ff3b4[_0x0033('0x97')])){_0x2ff3b4[_0x0033('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2ff3b4['message']=_0x0033('0x98');}}else{_0x2ff3b4[_0x0033('0x4a')]=_0x0033('0x98');}emitCampaignPreview(_0x2ff3b4);};Preview['prototype'][_0x0033('0x99')]=function(_0x43561a,_0x15e9fb,_0x4f8a25){var _0x5004ba=this;var _0x61d585=this[_0x0033('0x11')][_0x15e9fb];var _0x46462b=this['campaignsPreview'][_0x61d585['queue']];var _0x564f43;var _0x1ec947=![];var _0xdba9e0=0x2;var _0x4dce31=0x3;if(_0x46462b){switch(_0x4f8a25){case'1':_0x46462b[_0x0033('0x3a')]+=0x1;_0x61d585[_0x0033('0x9a')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut['totalGlobal'](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x0,_0x0033('0x9c'));ami[_0x0033('0x22')]('custom:agentnosuchnumber',ut[_0x0033('0x9d')](_0x61d585,_0x0033('0x9e')));rpcDb[_0x0033('0x90')](_0x61d585,'[callProgressDetectingCustomer][logNoSuch]');_0x5004ba['verifyAdditionalPhones'](_0x61d585,'0',_0x46462b)[_0x0033('0x81')](function(_0x55e224){_0x1ec947=_0x55e224[_0x0033('0x9f')]==0x1;_0xdba9e0=_0x46462b[_0x0033('0xa0')];_0x4dce31=_0x46462b[_0x0033('0xa1')];if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut['cloneAction'](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x61d585[_0x0033('0x9a')]>=_0x46462b['dialNoSuchNumberMaxRetry']){rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xa5'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0x9a'),_0x46462b[_0x0033('0xa0')]),_0x61d585[_0x0033('0xa8')],_0x61d585['activeContact']);}}delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];}else{_0x61d585[_0x0033('0x9a')]++;logger[_0x0033('0x6b')](_0x0033('0xaa'),_0x61d585[_0x0033('0x9a')]);logger[_0x0033('0x6b')]('id',_0x61d585[_0x0033('0xab')]);_0x5004ba[_0x0033('0xac')]({'id':_0x61d585[_0x0033('0xab')],'field':{'countnosuchnumberretry':_0x61d585[_0x0033('0x9a')]}})['then'](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xad'):var _0x54565d=moment()[_0x0033('0x54')](_0x0033('0xae'));_0x61d585[_0x0033('0xaf')]=_0x54565d;_0x61d585[_0x0033('0xb0')]=_0x54565d;_0x61d585[_0x0033('0x70')]=!![];_0x46462b[_0x0033('0x5a')]+=0x1;logger[_0x0033('0x6b')](_0x0033('0xb1'),_0x61d585[_0x0033('0xb2')],_0x0033('0xb3'),_0x46462b[_0x0033('0x25')],_0x0033('0x6f'),_0x46462b['pTalking']);ami[_0x0033('0x22')](_0x0033('0xb4'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xb5'),this[_0x0033('0xe')][_0x61d585[_0x0033('0x6d')]]));if(_0x46462b['acw']){ami[_0x0033('0x22')](_0x0033('0xb6'),ut[_0x0033('0xb7')](_0x61d585));}break;case'16':ami[_0x0033('0x22')](_0x0033('0xb8'),ut['buildObj'](_0x61d585,_0x0033('0xb9'),this['campaignsPreview'][_0x61d585[_0x0033('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x0033('0x9d')](_0x61d585,'complete'));_0x46462b['outboundAnswerCallsDay']+=0x1;_0x46462b[_0x0033('0x2d')]+=0x1;_0x46462b[_0x0033('0x27')]+=0x1;ut['decrementTalkink'](_0x46462b,_0x0033('0xba'));_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x4,_0x0033('0xbb'));rpcDb[_0x0033('0x90')](_0x61d585,_0x0033('0xbc'));rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xbd'));rpcDb[_0x0033('0xbe')](_0x61d585);_0x46462b['sumDuration']+=_0x61d585[_0x0033('0xbf')];_0x46462b['sumBillable']+=_0x61d585[_0x0033('0xbf')];logger['info'](_0x0033('0xc0'),_0x61d585[_0x0033('0xb2')],_0x0033('0xb3'),_0x46462b[_0x0033('0x25')],_0x0033('0x6f'),_0x46462b[_0x0033('0x5a')]);delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];break;case'BUSY':_0x46462b[_0x0033('0xc1')]+=0x1;_0x61d585[_0x0033('0xc2')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x5,_0x0033('0xc3'));_0xdba9e0=_0x46462b[_0x0033('0xc4')];_0x4dce31=_0x46462b[_0x0033('0xa1')];ami[_0x0033('0x22')]('custom:agentbusy',ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xc5')));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xc6'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'5',_0x46462b)[_0x0033('0x81')](function(_0x181634){_0x1ec947=_0x181634[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,'Global');rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xc9'));}else{if(_0x61d585[_0x0033('0xc2')]>=_0x46462b[_0x0033('0xca')]){rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xc6'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0xc2'),_0x46462b[_0x0033('0xc4')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xc2')]++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585[_0x0033('0xab')],'field':{'countbusyretry':_0x61d585['countbusyretry']}})['then'](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xcd'):_0x46462b[_0x0033('0xce')]+=0x1;_0x61d585[_0x0033('0xcf')]+=0x1;_0x61d585['countglobal']=ut[_0x0033('0xa2')](_0x61d585);ut['logCustomer'](_0x61d585,0x3,_0x0033('0xd0'));_0xdba9e0=_0x46462b[_0x0033('0xd1')];_0x4dce31=_0x46462b[_0x0033('0xa1')];var _0x107f91=ut[_0x0033('0xd2')](_0x61d585,_0x46462b);ami[_0x0033('0x22')]('custom:agentnoanswer',_0x107f91);rpcDb[_0x0033('0x90')](_0x61d585,_0x0033('0xd3'));_0x5004ba['verifyAdditionalPhones'](_0x61d585,'3',_0x46462b)[_0x0033('0x81')](function(_0x525749){_0x1ec947=_0x525749[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut['cloneAction'](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xd4'));}else{if(_0x61d585['countnoanswerretry']>=_0x46462b[_0x0033('0xd5')]){rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xd3'));}else{rpcDb[_0x0033('0xa6')](ut['scheduledAt'](_0x61d585,_0x0033('0xcf'),_0x46462b[_0x0033('0xd1')]),_0x61d585['unlockAgent'],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba[_0x0033('0xac')]({'id':_0x61d585['idContact'],'field':{'countnoanswerretry':_0x61d585[_0x0033('0xcf')]}})['then'](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xd6'):_0x46462b['outboundCongestionCallsDay']+=0x1;_0x61d585[_0x0033('0xd7')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut['totalGlobal'](_0x61d585);ut['logCustomer'](_0x61d585,0x8,_0x0033('0xd8'));_0xdba9e0=_0x46462b[_0x0033('0xd9')];_0x4dce31=_0x46462b[_0x0033('0xa1')];ami[_0x0033('0x22')](_0x0033('0xda'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xdb')));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xdc'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'8',_0x46462b)[_0x0033('0x81')](function(_0x5bf83b){_0x1ec947=_0x5bf83b[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xdd'));}else{if(_0x61d585['countcongestionretry']>=_0x46462b[_0x0033('0xde')]){rpcDb['createCustomerFinal'](_0x61d585,_0x0033('0xdc'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,'countcongestionretry',_0x46462b[_0x0033('0xc4')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585['countcongestionretry']++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585[_0x0033('0xab')],'field':{'countcongestionretry':_0x61d585['countcongestionretry']}})[_0x0033('0x81')](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)['then'](function(){});});}});break;case'CANCEL':_0x46462b['outboundRejectCallsDay']+=0x1;_0x61d585[_0x0033('0xdf')]+=0x1;_0x61d585['countglobal']=ut['totalGlobal'](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x14,'AgentReject');_0xdba9e0=_0x46462b[_0x0033('0xe0')];_0x4dce31=_0x46462b[_0x0033('0xa1')];ami[_0x0033('0x22')](_0x0033('0xe1'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xe2')));rpcDb[_0x0033('0x90')](_0x61d585,_0x0033('0xe3'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'20',_0x46462b)['then'](function(_0x3ea5e7){_0x1ec947=_0x3ea5e7[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0x14,'AgentReject');rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xe4'));}else{if(_0x61d585['countagentrejectretry']>=_0x46462b[_0x0033('0xe5')]){rpcDb['createCustomerFinal'](_0x61d585,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0xdf'),_0x46462b[_0x0033('0xe0')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba[_0x0033('0xac')]({'id':_0x61d585[_0x0033('0xab')],'field':{'countnoanswerretry':_0x61d585['countnoanswerretry']}})['then'](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case _0x0033('0xe6'):_0x46462b[_0x0033('0x3f')]+=0x1;_0x61d585['countabandonedretry']+=0x1;_0x61d585['countglobal']=ut['totalGlobal'](_0x61d585);ut['logCustomer'](_0x61d585,0xb,_0x0033('0xe7'));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xe8'));_0x5004ba['verifyAdditionalPhones'](_0x61d585,'11',_0x46462b)[_0x0033('0x81')](function(_0x594451){_0x1ec947=_0x594451[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut['totalGlobal'](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xe8'));}else{if(_0x61d585[_0x0033('0xe9')]>=_0x46462b[_0x0033('0xea')]){rpcDb['createCustomerFinal'](_0x61d585,_0x0033('0xe8'));}else{rpcDb[_0x0033('0xa6')](ut[_0x0033('0xa7')](_0x61d585,_0x0033('0xeb'),_0x46462b[_0x0033('0xec')]),_0x61d585[_0x0033('0xa8')],_0x61d585[_0x0033('0xcb')]);}}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585[_0x0033('0xab')],'field':{'countnoanswerretry':_0x61d585[_0x0033('0xcf')]}})[_0x0033('0x81')](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});break;case'18':_0x46462b[_0x0033('0x3e')]+=0x1;_0x61d585[_0x0033('0xed')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut['totalGlobal'](_0x61d585);ut['logCustomer'](_0x61d585,0x12,_0x43561a['cause-txt']||_0x43561a[_0x0033('0xee')]);ami[_0x0033('0x22')](_0x0033('0xef'),ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xf0')));rpcDb[_0x0033('0x90')](_0x61d585,'[callProgressDetectingCustomer][hangupInAMD]');_0x5004ba[_0x0033('0xc7')](_0x61d585,'18',_0x46462b)[_0x0033('0x81')](function(_0x5bc70e){_0x1ec947=_0x5bc70e[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0x12,_0x0033('0xa4'));rpcDb['createCustomerFinal'](_0x564f43,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xf1'));}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba[_0x0033('0xac')]({'id':_0x61d585[_0x0033('0xab')],'field':{'countnoanswerretry':_0x61d585['countnoanswerretry']}})[_0x0033('0x81')](function(){_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});});}});delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];break;case'19':_0x46462b[_0x0033('0x3e')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut[_0x0033('0x8b')](_0x61d585,0x13,_0x43561a[_0x0033('0xf2')]||_0x43561a[_0x0033('0xee')]);ami[_0x0033('0x22')]('custom:amd',ut[_0x0033('0x9d')](_0x61d585,_0x0033('0xf0')));rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xf3'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'18',_0x46462b)[_0x0033('0x81')](function(_0x2ad279){_0x1ec947=_0x2ad279[_0x0033('0x9f')]==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b['dialGlobalMaxRetry']){_0x564f43=ut['cloneAction'](_0x61d585,0xf,_0x0033('0xa4'));rpcDb['createCustomerFinal'](_0x564f43,_0x0033('0xf3'));}else{rpcDb['createCustomerFinal'](_0x61d585,_0x0033('0xf3'));}}else{_0x61d585[_0x0033('0xcf')]++;_0x5004ba['incrementPreviewCounters']({'id':_0x61d585['idContact'],'field':{'countnoanswerretry':_0x61d585[_0x0033('0xcf')]}})[_0x0033('0x81')](function(){_0x5004ba['swapAdditionalPhones'](_0x61d585,_0xdba9e0,_0x4dce31)['then'](function(){});});}});delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xa9')]];break;default:if(_0x61d585[_0x0033('0x70')]){ut[_0x0033('0x7b')](_0x46462b,_0x0033('0xf4'));ut[_0x0033('0xf5')](_0x0033('0xf6')+_0x46462b['name'],_0x43561a);}_0x46462b[_0x0033('0x3e')]+=0x1;_0x61d585[_0x0033('0x9b')]=ut[_0x0033('0xa2')](_0x61d585);ut['logCustomer'](_0x61d585,0xc,_0x43561a['cause-txt']||_0x43561a[_0x0033('0xee')]);_0xdba9e0=_0x46462b['dialAgentRejectRetryFrequency'];_0x4dce31=_0x46462b[_0x0033('0xa1')];rpcDb['createCustomerHistory'](_0x61d585,_0x0033('0xf7'));_0x5004ba[_0x0033('0xc7')](_0x61d585,'20',_0x46462b)[_0x0033('0x81')](function(_0x280969){_0x1ec947=_0x280969['additional']==0x1;if(!_0x1ec947){if(ut[_0x0033('0xa2')](_0x61d585)>=_0x46462b[_0x0033('0xa3')]){_0x564f43=ut[_0x0033('0xc8')](_0x61d585,0xf,_0x0033('0xa4'));rpcDb[_0x0033('0x91')](_0x564f43,_0x0033('0xf8'));}else{rpcDb[_0x0033('0x91')](_0x61d585,_0x0033('0xf8'));}delete this['actions'][_0x43561a[_0x0033('0xa9')]];}else{_0x5004ba[_0x0033('0xcc')](_0x61d585,_0xdba9e0,_0x4dce31)[_0x0033('0x81')](function(){});}});}if(!(_0x61d585[_0x0033('0x70')]&&_0x4f8a25==='16')){ut[_0x0033('0x79')](_0x46462b,_0x0033('0xf9'));logger[_0x0033('0x6b')](_0x0033('0xfa'),_0x61d585[_0x0033('0xb2')],_0x0033('0xb3'),_0x46462b[_0x0033('0x25')],_0x0033('0x6e'),_0x46462b['originated']);}if(_0x4f8a25!==_0x0033('0xad')){delete this['actions'][_0x43561a[_0x0033('0xa9')]];delete this[_0x0033('0x11')][_0x43561a[_0x0033('0xfb')]];}}};Preview[_0x0033('0x9')]['callProgressDetectingAgent']=function(_0x198e83,_0x5aac98,_0x488559){if(_[_0x0033('0xfc')](_0x5aac98)&&'object'!==typeof _0x5aac98){return;}if(_[_0x0033('0xfc')](_0x488559)&&_0x0033('0xfd')!==typeof _0x488559){return;}switch(_0x488559[_0x0033('0xfe')]){case'0':ut[_0x0033('0xff')](_0x198e83,0x0,'NoSuchNumber');rpcDb[_0x0033('0x100')](_0x198e83,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0033('0xff')](_0x198e83,0x3,_0x0033('0xd0'));rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x101'));break;case'5':ut[_0x0033('0xff')](_0x198e83,0x5,_0x0033('0xc3'));rpcDb[_0x0033('0x100')](_0x198e83,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x0033('0xff')](_0x198e83,0x8,'Congestion');rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x102'));break;case'22':ut[_0x0033('0xff')](_0x198e83,0x16,_0x0033('0x103'));rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x104'));break;default:ut[_0x0033('0xff')](_0x198e83,0xc,_0x488559['reason']);rpcDb[_0x0033('0x100')](_0x198e83,_0x0033('0x102'));}ut[_0x0033('0x79')](_0x5aac98,_0x0033('0x105'));logger[_0x0033('0x6b')]('[originated][decrement][callProgressDetectingAgent]',_0x198e83[_0x0033('0xb2')],'\x20Queue',_0x5aac98['name'],_0x0033('0x6e'),_0x5aac98['originated']);delete this[_0x0033('0x11')][_0x198e83[_0x0033('0xb2')]];};Preview[_0x0033('0x9')][_0x0033('0xc7')]=function(_0x38c749,_0x4d98b9,_0x59020b){return Promise[_0x0033('0x106')]()[_0x0033('0x81')](cmHopperAdditionalPhone[_0x0033('0xc7')](_0x38c749,_0x4d98b9,_0x59020b))[_0x0033('0x77')](logger[_0x0033('0x6b')](_0x0033('0x107')));};Preview[_0x0033('0x9')][_0x0033('0xcc')]=function(_0x3bb179,_0x4ca4b0,_0x241207){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x0033('0xcc')](_0x3bb179,_0x4ca4b0,_0x241207))[_0x0033('0x77')](logger[_0x0033('0x6b')](_0x0033('0x108')));};Preview[_0x0033('0x9')][_0x0033('0xac')]=function(_0x3f1eec){return Promise[_0x0033('0x106')]()[_0x0033('0x81')](cmHopperAdditionalPhone[_0x0033('0xac')](_0x3f1eec))[_0x0033('0x77')](logger[_0x0033('0x6b')](_0x0033('0x109')));};Preview[_0x0033('0x9')][_0x0033('0x10a')]=function(_0x2223bd,_0x4ed7c8,_0x2465e6,_0x4749cf,_0x59fa55){var _0x4be0ea=this;return new Promise(function(_0x5b5349,_0x3fd6f3){if(_['isNil'](_0x4ed7c8)||_[_0x0033('0x6a')](_0x4ed7c8['Contact'])||_['isNil'](_0x4ed7c8['phone'])||_[_0x0033('0x6a')](_0x4ed7c8[_0x0033('0x10b')])){_0x3fd6f3(ut[_0x0033('0x4a')](_0x0033('0x10c'),_0x4749cf,_0x59fa55));return;}var _0x5b8c2b=uuid['v4']();var _0x17efb9=_0x4be0ea[_0x0033('0xe')][_0x4ed7c8[_0x0033('0x6c')][_0x0033('0x25')]];var _0x7fa88c=_0x2465e6?_0x4be0ea[_0x0033('0x12')][_0x2465e6]['id']:undefined;_0x4be0ea[_0x0033('0x11')][_0x5b8c2b]=new Action(_0x4ed7c8,_0x17efb9,_0x5b8c2b,_0x2465e6,_0x7fa88c);var _0x1c82c3=_0x4be0ea[_0x0033('0x11')][_0x5b8c2b];_0x1c82c3[_0x0033('0xa8')]=_0x4749cf;_0x1c82c3[_0x0033('0xcb')]=_0x59fa55;_0x1c82c3[_0x0033('0x10d')]=_0x2465e6;if(_[_0x0033('0x10e')](_0x2223bd)){_0x4be0ea['execCall'](_0x1c82c3,_0x17efb9,_0x4ed7c8,_0x2465e6)[_0x0033('0x81')](function(_0x117f64){logger['info'](_0x0033('0x10f'),_0x0033('0x110')+_0x1c82c3[_0x0033('0x6d')]+_0x0033('0x111')+_0x1c82c3[_0x0033('0xab')],JSON[_0x0033('0x53')](_0x117f64));ami[_0x0033('0x22')](_0x0033('0x112'),ut[_0x0033('0x9d')](_0x1c82c3,_0x0033('0x113'),_0x4be0ea[_0x0033('0xe')][_0x1c82c3[_0x0033('0x6d')]]));_0x5b5349(ut[_0x0033('0x4a')](_0x0033('0x114')));})[_0x0033('0x77')](function(_0x50716b){ut[_0x0033('0x5f')](_0x0033('0x115'),_0x50716b);_0x3fd6f3(ut[_0x0033('0x4a')]('Call\x20failed',_0x4749cf,_0x59fa55));});}else{_0x17efb9[_0x0033('0x37')]+=0x1;ut[_0x0033('0x116')](_0x1c82c3);rpcDb[_0x0033('0x117')](_0x1c82c3,'[Blacklist][error]');delete _0x4be0ea[_0x0033('0x11')][_0x5b8c2b];_0x3fd6f3(ut[_0x0033('0x4a')]('Contact\x20in\x20black\x20List',_0x4749cf,_0x59fa55));}});};Preview[_0x0033('0x9')][_0x0033('0x96')]=function(_0x1ad5d2){return!_[_0x0033('0x6a')](_0x1ad5d2)&&!_['isNil'](_0x1ad5d2[_0x0033('0x25')])&&!_[_0x0033('0x6a')](_0x1ad5d2[_0x0033('0x51')])&&_0x1ad5d2[_0x0033('0x51')]&&!_[_0x0033('0x6a')](this[_0x0033('0x10')][util['format']('SIP/%s',_0x1ad5d2[_0x0033('0x25')])])&&!_[_0x0033('0x6a')](this['trunks'][util[_0x0033('0x54')]('SIP/%s',_0x1ad5d2['name'])][_0x0033('0x75')])&&(this[_0x0033('0x10')][util[_0x0033('0x54')](_0x0033('0x118'),_0x1ad5d2[_0x0033('0x25')])][_0x0033('0x75')]===_0x0033('0x119')||this['trunks'][util[_0x0033('0x54')](_0x0033('0x118'),_0x1ad5d2[_0x0033('0x25')])][_0x0033('0x75')]==='unmonitored');};Preview[_0x0033('0x9')][_0x0033('0x87')]=function(_0x3baafe,_0x229f89){var _0x3f5452=this;return new Promise(function(_0x134bde,_0x5e8774){_0x3f5452[_0x0033('0x11a')](_0x3baafe,_0x229f89)[_0x0033('0x81')](function(_0x59dc3a){_0x134bde(_[_0x0033('0x71')](_0x59dc3a,[_0x0033('0x4a')]));})[_0x0033('0x77')](function(_0x2c90c9){if(_0x2c90c9['unlock']){rpcDb['unlockContact'](_0x3baafe);}if(_0x2c90c9['active']){rpcDb['disableContact'](_0x3baafe);}_0x5e8774(_[_0x0033('0x71')](_0x2c90c9,[_0x0033('0x4a')]));});});};Preview[_0x0033('0x9')]['execRun']=function(_0x30b062,_0x47d18c){var _0x2f50c9=this;return new Promise(function(_0x163b55,_0x8aa5b0){var _0x327169,_0x51ffb1;rpcDb[_0x0033('0x11b')](_0x30b062)['then'](function(_0x408e93){if(!_[_0x0033('0x6a')](_0x408e93[0x0])){_0x51ffb1=_0x408e93[0x0][_0x0033('0x11c')]?![]:!![];_0x327169=_0x408e93[0x0]['recallme']?!![]:![];_0x327169=_0x47d18c?!![]:_0x327169;}var _0x1af52a=_0x2f50c9[_0x0033('0x11d')](_0x408e93);if(_0x1af52a[_0x0033('0x11e')]){rpcDb[_0x0033('0x11f')](_[_0x0033('0x71')](_0x408e93[0x0],['VoiceQueueId',_0x0033('0x120')]))[_0x0033('0x81')](function(_0x92f025){_0x2f50c9[_0x0033('0x10a')](_0x92f025,_0x408e93[0x0],_0x47d18c,_0x51ffb1,_0x327169)[_0x0033('0x81')](function(_0x456b1f){_0x163b55(_0x456b1f);})['catch'](function(_0x21b526){_0x8aa5b0(_0x21b526);});})['catch'](function(_0x106e65){ut[_0x0033('0x5f')](_0x0033('0x121'),_0x106e65);_0x8aa5b0(ut[_0x0033('0x4a')](_0x0033('0x122'),_0x51ffb1,_0x327169));});}else{_0x8aa5b0(ut[_0x0033('0x4a')](_0x1af52a[_0x0033('0x4a')],_0x51ffb1,_0x327169));}})['catch'](function(_0x4f4462){ut[_0x0033('0x5f')](_0x0033('0x123'),_0x4f4462);_0x8aa5b0(ut['message'](_0x0033('0x122'),![],!![]));});});};Preview[_0x0033('0x9')][_0x0033('0x11d')]=function(_0x183b04){if(_[_0x0033('0x6a')](_0x183b04)||_[_0x0033('0x10e')](_0x183b04)||!_[_0x0033('0x6a')](_0x183b04[0x0]['Agent'])&&_[_0x0033('0x6a')](_0x183b04[0x0][_0x0033('0x85')]['name'])){ut['logger'](_0x0033('0x124'),_0x183b04);return{'isValid':![],'message':_0x0033('0x125')};}var _0x19c704=this[_0x0033('0xe')][_0x183b04[0x0][_0x0033('0x6c')][_0x0033('0x25')]];_0x19c704[_0x0033('0x4a')]=_0x0033('0x98');if(_['isNil'](_0x19c704)){ut[_0x0033('0x5f')](_0x0033('0x126'),_0x19c704);return{'isValid':![],'message':_0x0033('0x127')};}if(!this['isTrunkReachable'](_0x19c704[_0x0033('0x50')])){ut[_0x0033('0x5f')](_0x0033('0x128'),_0x0033('0x129')+_0x19c704[_0x0033('0x25')]+_0x0033('0x12a'));if(!this['isTrunkReachable'](_0x19c704[_0x0033('0x97')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x19c704[_0x0033('0x25')]+_0x0033('0x12b'));return{'isValid':![],'message':_0x0033('0x12c')};}}if(!ut['isActive'](_0x19c704[_0x0033('0x32')])){ut[_0x0033('0x5f')]('[Preview][validateContact][Campaign\x20Active]',_0x19c704[_0x0033('0x25')]+_0x0033('0x12d'));return{'isValid':![],'message':_0x0033('0x129')+_0x19c704[_0x0033('0x25')]+_0x0033('0x12d')};}return{'isValid':!![],'message':_0x0033('0x12e')};};Preview['prototype']['execCall']=function(_0x2d3681,_0x1d6734,_0xd8945a,_0x46fb4d){var _0x304602=this;return new Promise(function(_0x3ed6f5,_0x2b1e05){var _0x3e3220=_0x2d3681[_0x0033('0xb2')];var _0xfe92f3=_0x304602[_0x0033('0x96')](_0x1d6734[_0x0033('0x50')])?util['format'](_0x0033('0x12f'),_0x1d6734['Trunk'][_0x0033('0x25')],_[_0x0033('0x6a')](_0x1d6734[_0x0033('0x130')])?'':_0x1d6734['dialPrefix'][_0x0033('0x131')]()||'',_0x1d6734[_0x0033('0x132')]>0x0?_0xd8945a[_0x0033('0x120')][_0x0033('0x133')](_0x1d6734[_0x0033('0x132')]):_0xd8945a[_0x0033('0x120')]):util[_0x0033('0x54')](_0x0033('0x12f'),_[_0x0033('0x6a')](_0x1d6734[_0x0033('0x97')])?_0x1d6734[_0x0033('0x50')][_0x0033('0x25')]:_0x1d6734[_0x0033('0x97')][_0x0033('0x25')],_['isNil'](_0x1d6734[_0x0033('0x130')])?'':_0x1d6734[_0x0033('0x130')][_0x0033('0x131')]()||'',_0x1d6734[_0x0033('0x132')]>0x0?_0xd8945a[_0x0033('0x120')]['substring'](_0x1d6734[_0x0033('0x132')]):_0xd8945a[_0x0033('0x120')]);var _0x24fcd3=_0x304602[_0x0033('0x96')](_0x1d6734[_0x0033('0x50')])?ut[_0x0033('0x134')](_0x1d6734[_0x0033('0x50')][_0x0033('0x135')],_0x1d6734[_0x0033('0x136')],_0x1d6734['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0033('0x137')](_0x1d6734[_0x0033('0x33')],_0x1d6734[_0x0033('0x138')]):_0x1d6734['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x0033('0x6a')](_0x1d6734[_0x0033('0x97')])?_0x1d6734[_0x0033('0x50')][_0x0033('0x135')]:_0x1d6734[_0x0033('0x97')][_0x0033('0x135')],_0x1d6734[_0x0033('0x136')],_0x1d6734[_0x0033('0x138')]>0x0?ut[_0x0033('0x137')](_0x1d6734[_0x0033('0x33')],_0x1d6734[_0x0033('0x138')]):_0x1d6734[_0x0033('0x33')]);if(_0x24fcd3){_0x2d3681[_0x0033('0x139')]=ut['extractCalleridName'](_0x24fcd3);_0x2d3681['originatecalleridnum']=ut[_0x0033('0x13a')](_0x24fcd3);}var _0x58c4f6=ut['addVariables'](_0x1d6734,_0xd8945a,_0xfe92f3,_0x24fcd3,_0x3e3220,_0x2d3681);_[_0x0033('0x13b')](_0x2d3681,ut['toLowerVariables'](_0x58c4f6));_0x2d3681[_0x0033('0x8a')]=moment()['format'](_0x0033('0xae'));_0x1d6734[_0x0033('0x13c')]=_0x58c4f6;ami['Action'](ut['variablesAction'](_0x2d3681,_0x1d6734,_0x58c4f6,_0x2d3681[_0x0033('0xcb')],_0x46fb4d))['then'](function(_0x19a8e3){_0x1d6734[_0x0033('0x4b')]+=0x1;logger[_0x0033('0x6b')](_0x0033('0x13d'),_0x3e3220,_0x0033('0xb3'),_0x1d6734['name'],_0x0033('0x6e'),_0x1d6734['originated']);_0x3ed6f5(_0x19a8e3);})[_0x0033('0x77')](function(_0x393afc){ut[_0x0033('0xff')](_0x2d3681,0xe,_0x0033('0x13e'));rpcDb[_0x0033('0x100')](_0x2d3681,_0x0033('0x13f'));_0x2b1e05(_0x393afc);});});};Preview[_0x0033('0x9')][_0x0033('0x140')]=function(_0x444c66){if(this[_0x0033('0x11')][_0x444c66[_0x0033('0xa9')]]){this[_0x0033('0x11')][_0x444c66[_0x0033('0xa9')]][_0x0033('0x76')]=_0x444c66[_0x0033('0x76')];}};Preview[_0x0033('0x9')]['syncOriginateResponse']=function(_0x1c3ccb){var _0x1c24de=this;var _0x15163d=this[_0x0033('0x11')][_0x1c3ccb[_0x0033('0x141')]];if(_0x15163d){if(_0x15163d[_0x0033('0x10d')]&&this[_0x0033('0x12')][_0x15163d['lookAgent']]){ut[_0x0033('0x142')](_0x15163d,this[_0x0033('0x12')][_0x15163d[_0x0033('0x10d')]][_0x0033('0x25')],this[_0x0033('0x12')][_0x15163d['lookAgent']]['id']);}var _0x56fb21=_[_0x0033('0x143')](_0x15163d);_0x56fb21[_0x0033('0xaf')]=moment()['format'](_0x0033('0xae'));var _0x5dd4ac=_0x1c24de[_0x0033('0xe')][_0x15163d['queue']];if(ut[_0x0033('0x144')](_0x1c3ccb[_0x0033('0x145')])){if(_0x15163d[_0x0033('0xa8')]){rpcDb[_0x0033('0x146')](_0x15163d[_0x0033('0xab')]);}if(_0x15163d[_0x0033('0xcb')]){rpcDb[_0x0033('0x147')](_0x15163d[_0x0033('0xab')]);}ami[_0x0033('0x22')](_0x0033('0x148'),ut['buildObj'](_0x15163d,_0x0033('0x149'),this['campaignsPreview'][_0x15163d[_0x0033('0x6d')]]));this[_0x0033('0x14a')](_0x56fb21,_0x5dd4ac,_0x1c3ccb);}else{_0x15163d['starttime']=moment()[_0x0033('0x54')](_0x0033('0xae'));ut[_0x0033('0xff')](_0x56fb21,0x4,_0x0033('0xbb'));rpcDb['createAgentHistory'](_0x56fb21,_0x0033('0x14b'));}}};Preview[_0x0033('0x9')][_0x0033('0x16')]=function(_0x1653c9){var _0x49e464=this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]];var _0x2d5f4d;if(_0x49e464){_0x2d5f4d=this[_0x0033('0xe')][_0x49e464[_0x0033('0x6d')]];logger[_0x0033('0x6b')]('[syncHangup][talking]',_0x1653c9[_0x0033('0xa9')],'\x20Queue',_0x2d5f4d['name'],'pTalking:\x20',_0x2d5f4d[_0x0033('0x5a')]);}if(this[_0x0033('0x11')][_0x1653c9['linkedid']]&&_0x1653c9[_0x0033('0xa9')]!==_0x1653c9[_0x0033('0xb2')]){if(_0x1653c9['cause']==='16'&&this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]][_0x0033('0x70')]){this['callProgressDetectingCustomer'](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}else if(this['actions'][_0x1653c9['linkedid']]['dialAnswer']){logger[_0x0033('0x6b')]('[syncHangup][talking][cause]',_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')],_0x0033('0xb3'),_0x2d5f4d['name'],_0x0033('0x6f'),_0x2d5f4d[_0x0033('0x5a')]);this[_0x0033('0x99')](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}}else if(_0x49e464&&_[_0x0033('0x6a')](_0x49e464['statedesc'])&&_0x2d5f4d[_0x0033('0x14d')]&&_0x1653c9['linkedid']===_0x1653c9[_0x0033('0xb2')]&&_[_0x0033('0x6a')](_0x1653c9[_0x0033('0xfe')])&&_0x1653c9['cause']==='16'&&_0x1653c9[_0x0033('0x14e')]==='6'&&_[_0x0033('0xfc')](_0x49e464[_0x0033('0x14f')])){if(_0x49e464[_0x0033('0xa8')]){rpcDb['unlockContact'](_0x49e464[_0x0033('0xab')]);}if(_0x49e464[_0x0033('0xcb')]){rpcDb['disableContact'](_0x49e464['idContact']);}_0x1653c9[_0x0033('0xfe')]='22';this[_0x0033('0x14a')](_0x49e464,_0x2d5f4d,_0x1653c9);}else if(_0x49e464&&_0x49e464['transfer']){if(_0x1653c9['cause']==='16'&&this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]]['dialAnswer']){logger[_0x0033('0x6b')](_0x0033('0x150'),_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')],_0x0033('0xb3'),_0x2d5f4d['name'],_0x0033('0x6f'),_0x2d5f4d['pTalking']);this[_0x0033('0x99')](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}else if(this[_0x0033('0x11')][_0x1653c9[_0x0033('0xa9')]]['dialAnswer']){logger[_0x0033('0x6b')]('[syncHangup][talking][cause]',_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')],'\x20Queue',_0x2d5f4d[_0x0033('0x25')],_0x0033('0x6f'),_0x2d5f4d['pTalking']);this[_0x0033('0x99')](_0x1653c9,_0x1653c9[_0x0033('0xa9')],_0x1653c9[_0x0033('0x14c')]);}}};Preview[_0x0033('0x9')][_0x0033('0x1b')]=function(_0x5abf4d){if(this[_0x0033('0x11')][_0x5abf4d[_0x0033('0xfb')]]&&_0x5abf4d['destlinkedid']!==_0x5abf4d[_0x0033('0x151')]){this[_0x0033('0x99')](_0x5abf4d,_0x5abf4d[_0x0033('0xfb')],_0x5abf4d['dialstatus']);}};Preview[_0x0033('0x9')]['syncHangupRequest']=function(_0x3e4d06){if(this['actions'][_0x3e4d06['linkedid']]&&_0x3e4d06['linkedid']!==_0x3e4d06['uniqueid']&&!this[_0x0033('0x11')][_0x3e4d06[_0x0033('0xa9')]][_0x0033('0x70')]){if(_0x3e4d06[_0x0033('0x14c')]==='1'){this[_0x0033('0x99')](_0x3e4d06,_0x3e4d06['linkedid'],_0x3e4d06[_0x0033('0x14c')]);}}};Preview[_0x0033('0x9')][_0x0033('0x152')]=function(_0x597359,_0x29b573,_0xf5ecfa){if(this[_0x0033('0x11')][_0x597359]){if(_[_0x0033('0x6a')](this[_0x0033('0x11')][_0x597359][_0x0033('0x13c')])){this[_0x0033('0x11')][_0x597359][_0x0033('0x13c')]={};}this[_0x0033('0x11')][_0x597359][_0x0033('0x13c')][_0x29b573]=_0xf5ecfa;}};Preview[_0x0033('0x9')][_0x0033('0x1d')]=function(_0x38f648){try{if(!_[_0x0033('0x6a')](_0x38f648)){if(ut['filterKey'](_[_0x0033('0x153')](_0x38f648['variable'])[0x0])){this[_0x0033('0x152')](_0x38f648[_0x0033('0xb2')],_[_0x0033('0x153')](_0x38f648['variable'])[0x0],_0x38f648[_0x0033('0x154')]);}}}catch(_0x4c571b){logger[_0x0033('0x155')](_0x0033('0x156'),util[_0x0033('0x157')](_0x4c571b,{'showHidden':![],'depth':null}));}};Preview[_0x0033('0x9')][_0x0033('0x1e')]=function(_0x35a1a9){if(_0x35a1a9){if(this['actions'][_0x35a1a9[_0x0033('0x158')]]){this[_0x0033('0x11')][_0x35a1a9['transfertargetlinkedid']][_0x0033('0x14f')]=!![];}}};Preview[_0x0033('0x9')][_0x0033('0x20')]=function(_0x10fe2c){if(_0x10fe2c){if(this['actions'][_0x10fe2c[_0x0033('0x159')]]){this['actions'][_0x10fe2c[_0x0033('0x159')]][_0x0033('0x14f')]=!![];}}};module[_0x0033('0x15a')]=Preview; \ No newline at end of file +var _0x5e4a=['[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialAgentRejectRetryFrequency','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Congestion','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','run','execRun','unlock','unlockContact','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','\x20Not\x20Active','trim','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','callerid','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','toLowerVariables','starttime','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','defaults','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','startPredictive','startProgressive','Trunk','Interval','stringify','md5','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','\x20is\x20not\x20active','DEACTIVATED','logger','syncCampaigns','hasOwnProperty','booked','setMessage','recallMe','clearZombieChannel','isNil','Queue','queue','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','updateOriginated','dialAnswer','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]'];(function(_0x4d2fb3,_0x2f78ac){var _0x120b33=function(_0x33449f){while(--_0x33449f){_0x4d2fb3['push'](_0x4d2fb3['shift']());}};_0x120b33(++_0x2f78ac);}(_0x5e4a,0x1ef));var _0xa5e4=function(_0x1ce91c,_0xdd3b2b){_0x1ce91c=_0x1ce91c-0x0;var _0x4663de=_0x5e4a[_0x1ce91c];return _0x4663de;};'use strict';var util=require(_0xa5e4('0x0'));var _=require(_0xa5e4('0x1'));var uuid=require(_0xa5e4('0x2'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xa5e4('0x3'));var config=require('../../../config/environment');var logger=require(_0xa5e4('0x4'))(_0xa5e4('0x5'));var loggerAction=require(_0xa5e4('0x4'))(_0xa5e4('0x6'));var ami=require(_0xa5e4('0x7'));var rpcDb=require(_0xa5e4('0x8'));var cmHopperAdditionalPhone=require(_0xa5e4('0x9'));var Action=require('./action');var ut=require(_0xa5e4('0xa'));config['redis']=_[_0xa5e4('0xb')](config[_0xa5e4('0xc')],{'host':_0xa5e4('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa5e4('0xc')]));var Sequence=function(){};Sequence[_0xa5e4('0xe')][_0xa5e4('0xf')]=function(_0x2cfc6b){this[_0xa5e4('0x10')]=this[_0xa5e4('0x10')]?this[_0xa5e4('0x10')][_0xa5e4('0x11')](_0x2cfc6b):_0x2cfc6b();};function Preview(_0x2b141e){this[_0xa5e4('0x12')]=new Sequence();this[_0xa5e4('0x13')]=_0x2b141e[_0xa5e4('0x14')];this[_0xa5e4('0x15')]=_0x2b141e[_0xa5e4('0x15')];this[_0xa5e4('0x16')]={};this[_0xa5e4('0x17')]=_0x2b141e[_0xa5e4('0x17')];this[_0xa5e4('0x18')]=0x0;ami['on'](_0xa5e4('0x19'),this[_0xa5e4('0x1a')][_0xa5e4('0x1b')](this));ami['on']('hangup',this['syncHangup'][_0xa5e4('0x1b')](this));ami['on'](_0xa5e4('0x1c'),this[_0xa5e4('0x1d')][_0xa5e4('0x1b')](this));ami['on']('dialend',this[_0xa5e4('0x1e')][_0xa5e4('0x1b')](this));ami['on']('newexten',this[_0xa5e4('0x1f')][_0xa5e4('0x1b')](this));ami['on'](_0xa5e4('0x20'),this['syncVarSet'][_0xa5e4('0x1b')](this));ami['on'](_0xa5e4('0x21'),this['syncAttendedTransfer'][_0xa5e4('0x1b')](this));ami['on'](_0xa5e4('0x22'),this[_0xa5e4('0x23')][_0xa5e4('0x1b')](this));this[_0xa5e4('0x24')](this[_0xa5e4('0x13')]);}function emit(_0x362aee,_0x129f96,_0x289c1b){io['to'](_0x362aee)[_0xa5e4('0x25')](_0x129f96,_0x289c1b);}function emitCampaignPreview(_0x1bdca2){if(_0x1bdca2['type']===_0xa5e4('0x26')){var _0x382829={'id':_0x1bdca2['id'],'name':_0x1bdca2[_0xa5e4('0x27')],'strategy':_0x1bdca2[_0xa5e4('0x28')],'answered':_0x1bdca2[_0xa5e4('0x29')],'available':_0x1bdca2[_0xa5e4('0x2a')],'loggedIn':_0x1bdca2[_0xa5e4('0x2b')],'pTalking':_0x1bdca2[_0xa5e4('0x2c')],'sumBillable':_0x1bdca2[_0xa5e4('0x2d')],'sumDuration':_0x1bdca2[_0xa5e4('0x2e')],'sumHoldTime':_0x1bdca2[_0xa5e4('0x2f')]||0x0,'talking':_0x1bdca2[_0xa5e4('0x30')],'total':_0x1bdca2[_0xa5e4('0x31')],'type':_0x1bdca2[_0xa5e4('0x32')],'unmanaged':_0x1bdca2[_0xa5e4('0x33')],'abandoned':_0x1bdca2[_0xa5e4('0x34')],'waiting':_0x1bdca2[_0xa5e4('0x35')],'loggedInDb':_0x1bdca2['loggedInDb'],'dialActive':_0x1bdca2[_0xa5e4('0x36')],'dialMethod':_0x1bdca2[_0xa5e4('0x37')],'dialOriginateCallerIdName':_0x1bdca2[_0xa5e4('0x38')],'dialOriginateCallerIdNumber':_0x1bdca2[_0xa5e4('0x39')],'dialOriginateTimeout':_0x1bdca2['dialOriginateTimeout'],'dialPrefix':_0x1bdca2[_0xa5e4('0x3a')],'outboundAnswerAgiCallsDay':_0x1bdca2[_0xa5e4('0x3b')],'outboundAnswerCallsDay':_0x1bdca2[_0xa5e4('0x3c')],'outboundBlacklistCallsDay':_0x1bdca2[_0xa5e4('0x3d')],'outboundBusyCallsDay':_0x1bdca2[_0xa5e4('0x3e')],'outboundCongestionCallsDay':_0x1bdca2[_0xa5e4('0x3f')],'outboundDropCallsDayACS':_0x1bdca2[_0xa5e4('0x40')],'outboundDropCallsDayCallersExit':_0x1bdca2['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1bdca2['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1bdca2[_0xa5e4('0x41')],'outboundNoSuchCallsDay':_0x1bdca2['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1bdca2['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1bdca2[_0xa5e4('0x42')],'outboundRejectCallsDay':_0x1bdca2[_0xa5e4('0x43')],'outboundUnknownCallsDay':_0x1bdca2['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1bdca2[_0xa5e4('0x44')],'predictiveIntervalAnsweredCalls':_0x1bdca2[_0xa5e4('0x45')],'predictiveIntervalAvgHoldtime':_0x1bdca2['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1bdca2[_0xa5e4('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x1bdca2[_0xa5e4('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x1bdca2['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1bdca2[_0xa5e4('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x1bdca2[_0xa5e4('0x49')],'predictiveIntervalHitRate':_0x1bdca2[_0xa5e4('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x1bdca2[_0xa5e4('0x4b')],'predictiveIntervalPauses':_0x1bdca2[_0xa5e4('0x4c')],'predictiveIntervalAvailable':_0x1bdca2[_0xa5e4('0x4d')],'predictiveIntervalTotalCalls':_0x1bdca2[_0xa5e4('0x4e')],'message':_0x1bdca2[_0xa5e4('0x4f')],'originated':_0x1bdca2[_0xa5e4('0x50')],'erlangCalls':_0x1bdca2['erlangCalls'],'erlangCallToSecond':_0x1bdca2[_0xa5e4('0x51')],'erlangAbandonmentRate':_0x1bdca2['erlangAbandonmentRate'],'erlangBusyFactor':_0x1bdca2['erlangBusyFactor'],'startPredictive':_0x1bdca2[_0xa5e4('0x52')],'startProgressive':_0x1bdca2[_0xa5e4('0x53')]};if(_0x1bdca2['Trunk']){_0x382829[_0xa5e4('0x54')]={'id':_0x1bdca2['Trunk']['id'],'name':_0x1bdca2[_0xa5e4('0x54')]['name'],'active':_0x1bdca2['Trunk']['active'],'callerid':_0x1bdca2[_0xa5e4('0x54')]['callerid']};}if(_0x1bdca2[_0xa5e4('0x55')]){_0x382829[_0xa5e4('0x55')]={'id':_0x1bdca2['Interval']['id'],'name':_0x1bdca2[_0xa5e4('0x55')][_0xa5e4('0x27')]};}var _0x32276b=md5(JSON[_0xa5e4('0x56')](_0x382829));if(_0x1bdca2['md5']!==_0x32276b){_0x1bdca2[_0xa5e4('0x57')]=_0x32276b;emit(util['format'](_0xa5e4('0x58'),_0x382829[_0xa5e4('0x27')]),'voice_queue:save',_0x382829);}}}function emitVoiceQueueChannelRemove(_0x30cab6){logger[_0xa5e4('0x59')](_0xa5e4('0x5a'),JSON[_0xa5e4('0x56')](_0x30cab6));emit(util[_0xa5e4('0x5b')](_0xa5e4('0x58'),_0x30cab6['name']),_0xa5e4('0x5c'),_0x30cab6);io[_0xa5e4('0x25')](_0xa5e4('0x5d'),_0x30cab6);}function notSendMessagesQueue(_0x55ab64){if(_0x55ab64[_0xa5e4('0x5e')]){if(_0x55ab64[_0xa5e4('0x50')]===0x0&&_0x55ab64['pTalking']===0x0){_0x55ab64[_0xa5e4('0x5e')]=![];_0x55ab64[_0xa5e4('0x2a')]=0x0;_0x55ab64['paused']=0x0;_0x55ab64[_0xa5e4('0x4f')]='NOT_ACTIVE';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x55ab64[_0xa5e4('0x27')]+_0xa5e4('0x5f'));}else{_0x55ab64['message']=_0xa5e4('0x60');ut[_0xa5e4('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x55ab64[_0xa5e4('0x27')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x55ab64);}}Preview[_0xa5e4('0xe')]['loopCampaigns']=function(){var _0x193613=this;setInterval(function(){_0x193613[_0xa5e4('0x62')]();},0x7cf);};Preview[_0xa5e4('0xe')][_0xa5e4('0x62')]=function(){var _0x3f3e2e=this[_0xa5e4('0x13')];this['clockClearZombieChannels']+=0x1;for(var _0x488092 in _0x3f3e2e){if(_0x3f3e2e[_0xa5e4('0x63')](_0x488092)&&(_0x3f3e2e[_0x488092][_0xa5e4('0x37')]==='preview'||_0x3f3e2e[_0x488092]['dialMethod']===_0xa5e4('0x64'))&&_0x3f3e2e[_0x488092][_0xa5e4('0x32')]===_0xa5e4('0x26')){if(this[_0xa5e4('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x3f3e2e['hasOwnProperty'](_0x488092)&&_0x3f3e2e[_0x488092]['dialMethod']===_0xa5e4('0x5')&&_0x3f3e2e[_0x488092][_0xa5e4('0x32')]==='outbound'){if(_0x3f3e2e[_0x488092][_0xa5e4('0x36')]){this[_0xa5e4('0x65')](_0x3f3e2e[_0x488092]);if(_0x3f3e2e[_0x488092]['dialPreviewAutoRecallMe'])this[_0xa5e4('0x66')](_0x3f3e2e[_0x488092]);}else{notSendMessagesQueue(_0x3f3e2e[_0x488092]);}}}};Preview[_0xa5e4('0xe')][_0xa5e4('0x67')]=function(_0x408c81){var _0x219903=this;this[_0xa5e4('0x12')][_0xa5e4('0xf')](function(){if(!_[_0xa5e4('0x68')](_0x219903[_0xa5e4('0x16')][_0x408c81])){loggerAction[_0xa5e4('0x59')]('[clearZombieChannels][talking]',_0x408c81,_0xa5e4('0x69'),_0x219903[_0xa5e4('0x16')][_0x408c81]['queue'],'originated:\x20',JSON[_0xa5e4('0x56')](_0x219903[_0xa5e4('0x13')][_0x219903['actions'][_0x408c81][_0xa5e4('0x6a')]][_0xa5e4('0x50')]),_0xa5e4('0x6b'),JSON[_0xa5e4('0x56')](_0x219903['campaignsPreview'][_0x219903[_0xa5e4('0x16')][_0x408c81][_0xa5e4('0x6a')]][_0xa5e4('0x2c')]),JSON[_0xa5e4('0x56')](_0x219903[_0xa5e4('0x16')][_0x408c81]['dialAnswer']),JSON[_0xa5e4('0x56')](_['pick'](_0x219903[_0xa5e4('0x16')][_0x408c81],[_0xa5e4('0x6c'),_0xa5e4('0x6d'),_0xa5e4('0x6e'),_0xa5e4('0x6f')])));return ami[_0xa5e4('0x70')]({'action':'status','channel':_0x219903[_0xa5e4('0x16')][_0x408c81][_0xa5e4('0x71')]})[_0xa5e4('0x72')](function(_0x544514){if(_0x544514['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x219903['actions'][_0x408c81]){ut[_0xa5e4('0x73')](_0x219903[_0xa5e4('0x13')][_0x219903[_0xa5e4('0x16')][_0x408c81][_0xa5e4('0x6a')]],'[clearZombieChannel]');if(_0x219903[_0xa5e4('0x16')][_0x408c81][_0xa5e4('0x74')]===!![]){ut['decrementTalkink'](_0x219903[_0xa5e4('0x13')][_0x219903[_0xa5e4('0x16')][_0x408c81][_0xa5e4('0x6a')]],'[clearZombieChannel]');ut[_0xa5e4('0x75')](_0xa5e4('0x76')+_0x408c81,_0x219903[_0xa5e4('0x16')][_0x408c81]['queue']);}ut['loggerError'](_0xa5e4('0x77')+_0x408c81,_0x219903[_0xa5e4('0x16')][_0x408c81][_0xa5e4('0x6a')]);delete _0x219903['actions'][_0x408c81];}},0x2328);}});}});};Preview['prototype'][_0xa5e4('0x78')]=function(){var _0x251b53=this;loggerAction['info'](_0xa5e4('0x79'),_[_0xa5e4('0x7a')](this[_0xa5e4('0x16')]));for(var _0x411251 in this[_0xa5e4('0x16')]){if(_0x251b53[_0xa5e4('0x16')]['hasOwnProperty'](_0x411251)){_0x251b53[_0xa5e4('0x67')](_0x411251);}}};Preview[_0xa5e4('0xe')][_0xa5e4('0x66')]=function(_0x40da8d){var _0x78cefc=this;rpcDb[_0xa5e4('0x7b')](_0x40da8d['id'],ut[_0xa5e4('0x7c')](this[_0xa5e4('0x17')]))[_0xa5e4('0x7d')](function(_0x1f3ccc){if(!_[_0xa5e4('0x68')](_0x1f3ccc)){for(var _0x2a7e94=0x0;_0x2a7e94<_0x1f3ccc[_0xa5e4('0x7e')];_0x2a7e94+=0x1){if(ut['getDiff'](_0x1f3ccc[_0x2a7e94][_0xa5e4('0x7f')])<_0x40da8d[_0xa5e4('0x80')]*0x3c){if(_0x1f3ccc[_0x2a7e94]['Agent']&&!_0x1f3ccc[_0x2a7e94][_0xa5e4('0x81')][_0xa5e4('0x82')]){_0x78cefc['run'](_0x1f3ccc[_0x2a7e94]['id'])[_0xa5e4('0x7d')](ut[_0xa5e4('0x83')](_0xa5e4('0x84')))['catch'](ut['logger2'](_0xa5e4('0x84')));}else{rpcDb[_0xa5e4('0x85')](_0x1f3ccc[_0x2a7e94]['id']);}}else{var _0x2f7215=new Action(_0x1f3ccc[_0x2a7e94],_0x40da8d);_0x2f7215['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x40da8d[_0xa5e4('0x42')]+=0x1;ut['logCustomer'](_0x2f7215,0x17,_0xa5e4('0x86'));if(_0x40da8d[_0xa5e4('0x87')]){rpcDb[_0xa5e4('0x88')](ut[_0xa5e4('0x89')](_0x1f3ccc[_0x2a7e94]));rpcDb['createCustomerHistory'](_0x2f7215,_0xa5e4('0x8a'));}else{ut[_0xa5e4('0x8b')](_0x2f7215,0x16,'RecallFailedTimeout');rpcDb[_0xa5e4('0x8c')](_0x2f7215,_0xa5e4('0x8d'));rpcDb['createCustomerFinal'](_0x2f7215,_0xa5e4('0x8d'));}}}}})[_0xa5e4('0x72')](ut[_0xa5e4('0x83')](_0xa5e4('0x8e')));};Preview[_0xa5e4('0xe')][_0xa5e4('0x65')]=function(_0x3f4190){_0x3f4190[_0xa5e4('0x5e')]=!![];if(ut[_0xa5e4('0x8f')](_0x3f4190[_0xa5e4('0x2b')])){_0x3f4190[_0xa5e4('0x4f')]=_0xa5e4('0x90');}else if(!ut[_0xa5e4('0x91')](_0x3f4190['dialActive'])){_0x3f4190[_0xa5e4('0x4f')]=_0xa5e4('0x92');}else if(!this[_0xa5e4('0x93')](_0x3f4190[_0xa5e4('0x54')])){if(!this['isTrunkReachable'](_0x3f4190[_0xa5e4('0x94')])){_0x3f4190[_0xa5e4('0x4f')]=_0xa5e4('0x95');}else{_0x3f4190[_0xa5e4('0x4f')]=_0xa5e4('0x96');}}else{_0x3f4190['message']=_0xa5e4('0x96');}emitCampaignPreview(_0x3f4190);};Preview[_0xa5e4('0xe')][_0xa5e4('0x97')]=function(_0x41a834,_0x262466,_0x435f64){var _0x371401=this;var _0x2d1979=this['actions'][_0x262466];var _0x1fd278=this[_0xa5e4('0x13')][_0x2d1979[_0xa5e4('0x6a')]];var _0x125846;var _0x241f55=![];var _0x57552b=0x2;var _0x58ac3c=0x3;if(_0x1fd278){switch(_0x435f64){case'1':_0x1fd278[_0xa5e4('0x98')]+=0x1;_0x2d1979[_0xa5e4('0x99')]+=0x1;_0x2d1979['countglobal']=ut[_0xa5e4('0x9a')](_0x2d1979);ut[_0xa5e4('0x8b')](_0x2d1979,0x0,_0xa5e4('0x9b'));ami[_0xa5e4('0x25')]('custom:agentnosuchnumber',ut[_0xa5e4('0x9c')](_0x2d1979,_0xa5e4('0x9d')));rpcDb[_0xa5e4('0x8c')](_0x2d1979,_0xa5e4('0x9e'));_0x371401['verifyAdditionalPhones'](_0x2d1979,'0',_0x1fd278)[_0xa5e4('0x7d')](function(_0x503f84){_0x241f55=_0x503f84[_0xa5e4('0x9f')]==0x1;_0x57552b=_0x1fd278['dialNoSuchNumberRetryFrequency'];_0x58ac3c=_0x1fd278[_0xa5e4('0xa0')];if(!_0x241f55){if(ut[_0xa5e4('0x9a')](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut[_0xa5e4('0xa2')](_0x2d1979,0xf,_0xa5e4('0xa3'));rpcDb[_0xa5e4('0xa4')](_0x125846,_0xa5e4('0xa5'));}else{if(_0x2d1979[_0xa5e4('0x99')]>=_0x1fd278['dialNoSuchNumberMaxRetry']){rpcDb[_0xa5e4('0xa4')](_0x2d1979,_0xa5e4('0xa5'));}else{rpcDb[_0xa5e4('0xa6')](ut[_0xa5e4('0xa7')](_0x2d1979,_0xa5e4('0x99'),_0x1fd278['dialNoSuchNumberRetryFrequency']),_0x2d1979[_0xa5e4('0xa8')],_0x2d1979[_0xa5e4('0xa9')]);}}delete this[_0xa5e4('0x16')][_0x41a834[_0xa5e4('0xaa')]];}else{_0x2d1979[_0xa5e4('0x99')]++;logger[_0xa5e4('0x59')](_0xa5e4('0xab'),_0x2d1979['countnosuchnumberretry']);logger['info']('id',_0x2d1979[_0xa5e4('0xac')]);_0x371401[_0xa5e4('0xad')]({'id':_0x2d1979[_0xa5e4('0xac')],'field':{'countnosuchnumberretry':_0x2d1979[_0xa5e4('0x99')]}})[_0xa5e4('0x7d')](function(){_0x371401[_0xa5e4('0xae')](_0x2d1979,_0x57552b,_0x58ac3c)[_0xa5e4('0x7d')](function(){});});}});break;case _0xa5e4('0xaf'):var _0x5e588e=moment()[_0xa5e4('0x5b')](_0xa5e4('0xb0'));_0x2d1979[_0xa5e4('0xb1')]=_0x5e588e;_0x2d1979[_0xa5e4('0xb2')]=_0x5e588e;_0x2d1979[_0xa5e4('0x74')]=!![];_0x1fd278[_0xa5e4('0x2c')]+=0x1;logger[_0xa5e4('0x59')](_0xa5e4('0xb3'),_0x2d1979[_0xa5e4('0xb4')],_0xa5e4('0xb5'),_0x1fd278[_0xa5e4('0x27')],_0xa5e4('0x6b'),_0x1fd278[_0xa5e4('0x2c')]);ami[_0xa5e4('0x25')](_0xa5e4('0xb6'),ut['buildObj'](_0x2d1979,_0xa5e4('0xb7'),this[_0xa5e4('0x13')][_0x2d1979[_0xa5e4('0x6a')]]));if(_0x1fd278['acw']){ami[_0xa5e4('0x25')](_0xa5e4('0xb8'),ut[_0xa5e4('0xb9')](_0x2d1979));}break;case'16':ami[_0xa5e4('0x25')](_0xa5e4('0xba'),ut['buildObj'](_0x2d1979,_0xa5e4('0xbb'),this['campaignsPreview'][_0x2d1979['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d1979,_0xa5e4('0xbb')));_0x1fd278['outboundAnswerCallsDay']+=0x1;_0x1fd278[_0xa5e4('0x31')]+=0x1;_0x1fd278[_0xa5e4('0x29')]+=0x1;ut[_0xa5e4('0xbc')](_0x1fd278,_0xa5e4('0xbd'));_0x2d1979[_0xa5e4('0xbe')]=ut[_0xa5e4('0x9a')](_0x2d1979);ut['logCustomer'](_0x2d1979,0x4,_0xa5e4('0xbf'));rpcDb[_0xa5e4('0x8c')](_0x2d1979,_0xa5e4('0xc0'));rpcDb['createCustomerFinal'](_0x2d1979,_0xa5e4('0xc1'));rpcDb[_0xa5e4('0xc2')](_0x2d1979);_0x1fd278[_0xa5e4('0x2e')]+=_0x2d1979['talktime'];_0x1fd278['sumBillable']+=_0x2d1979[_0xa5e4('0xc3')];logger['info'](_0xa5e4('0xc4'),_0x2d1979[_0xa5e4('0xb4')],_0xa5e4('0xb5'),_0x1fd278['name'],'pTalking:\x20',_0x1fd278[_0xa5e4('0x2c')]);delete this['actions'][_0x41a834[_0xa5e4('0xaa')]];break;case _0xa5e4('0xc5'):_0x1fd278[_0xa5e4('0x3e')]+=0x1;_0x2d1979[_0xa5e4('0xc6')]+=0x1;_0x2d1979[_0xa5e4('0xbe')]=ut[_0xa5e4('0x9a')](_0x2d1979);ut[_0xa5e4('0x8b')](_0x2d1979,0x5,'Busy');_0x57552b=_0x1fd278[_0xa5e4('0xc7')];_0x58ac3c=_0x1fd278[_0xa5e4('0xa0')];ami['emit']('custom:agentbusy',ut[_0xa5e4('0x9c')](_0x2d1979,_0xa5e4('0xc8')));rpcDb['createCustomerHistory'](_0x2d1979,_0xa5e4('0xc9'));_0x371401[_0xa5e4('0xca')](_0x2d1979,'5',_0x1fd278)[_0xa5e4('0x7d')](function(_0x33fea5){_0x241f55=_0x33fea5['additional']==0x1;if(!_0x241f55){if(ut[_0xa5e4('0x9a')](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut[_0xa5e4('0xa2')](_0x2d1979,0xf,_0xa5e4('0xa3'));rpcDb[_0xa5e4('0xa4')](_0x125846,_0xa5e4('0xcb'));}else{if(_0x2d1979[_0xa5e4('0xc6')]>=_0x1fd278[_0xa5e4('0xcc')]){rpcDb['createCustomerFinal'](_0x2d1979,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0xa5e4('0xa7')](_0x2d1979,_0xa5e4('0xc6'),_0x1fd278['dialBusyRetryFrequency']),_0x2d1979[_0xa5e4('0xa8')],_0x2d1979[_0xa5e4('0xa9')]);}}}else{_0x2d1979[_0xa5e4('0xc6')]++;_0x371401['incrementPreviewCounters']({'id':_0x2d1979[_0xa5e4('0xac')],'field':{'countbusyretry':_0x2d1979[_0xa5e4('0xc6')]}})[_0xa5e4('0x7d')](function(){_0x371401['swapAdditionalPhones'](_0x2d1979,_0x57552b,_0x58ac3c)[_0xa5e4('0x7d')](function(){});});}});break;case _0xa5e4('0xcd'):_0x1fd278[_0xa5e4('0x41')]+=0x1;_0x2d1979['countnoanswerretry']+=0x1;_0x2d1979[_0xa5e4('0xbe')]=ut[_0xa5e4('0x9a')](_0x2d1979);ut[_0xa5e4('0x8b')](_0x2d1979,0x3,'NoAnswer');_0x57552b=_0x1fd278[_0xa5e4('0xce')];_0x58ac3c=_0x1fd278[_0xa5e4('0xa0')];var _0x449d66=ut[_0xa5e4('0xcf')](_0x2d1979,_0x1fd278);ami[_0xa5e4('0x25')](_0xa5e4('0xd0'),_0x449d66);rpcDb['createCustomerHistory'](_0x2d1979,_0xa5e4('0xd1'));_0x371401['verifyAdditionalPhones'](_0x2d1979,'3',_0x1fd278)[_0xa5e4('0x7d')](function(_0x5d67a0){_0x241f55=_0x5d67a0[_0xa5e4('0x9f')]==0x1;if(!_0x241f55){if(ut['totalGlobal'](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut[_0xa5e4('0xa2')](_0x2d1979,0xf,_0xa5e4('0xa3'));rpcDb[_0xa5e4('0xa4')](_0x125846,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x2d1979[_0xa5e4('0xd2')]>=_0x1fd278['dialNoAnswerMaxRetry']){rpcDb[_0xa5e4('0xa4')](_0x2d1979,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xa5e4('0xa6')](ut['scheduledAt'](_0x2d1979,_0xa5e4('0xd2'),_0x1fd278[_0xa5e4('0xce')]),_0x2d1979[_0xa5e4('0xa8')],_0x2d1979['activeContact']);}}}else{_0x2d1979['countnoanswerretry']++;_0x371401[_0xa5e4('0xad')]({'id':_0x2d1979[_0xa5e4('0xac')],'field':{'countnoanswerretry':_0x2d1979['countnoanswerretry']}})[_0xa5e4('0x7d')](function(){_0x371401['swapAdditionalPhones'](_0x2d1979,_0x57552b,_0x58ac3c)[_0xa5e4('0x7d')](function(){});});}});break;case _0xa5e4('0xd3'):_0x1fd278[_0xa5e4('0x3f')]+=0x1;_0x2d1979[_0xa5e4('0xd4')]+=0x1;_0x2d1979[_0xa5e4('0xbe')]=ut[_0xa5e4('0x9a')](_0x2d1979);ut[_0xa5e4('0x8b')](_0x2d1979,0x8,'Congestion');_0x57552b=_0x1fd278[_0xa5e4('0xd5')];_0x58ac3c=_0x1fd278[_0xa5e4('0xa0')];ami[_0xa5e4('0x25')](_0xa5e4('0xd6'),ut[_0xa5e4('0x9c')](_0x2d1979,_0xa5e4('0xd7')));rpcDb['createCustomerHistory'](_0x2d1979,_0xa5e4('0xd8'));_0x371401[_0xa5e4('0xca')](_0x2d1979,'8',_0x1fd278)[_0xa5e4('0x7d')](function(_0x4db510){_0x241f55=_0x4db510[_0xa5e4('0x9f')]==0x1;if(!_0x241f55){if(ut['totalGlobal'](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut[_0xa5e4('0xa2')](_0x2d1979,0xf,'Global');rpcDb[_0xa5e4('0xa4')](_0x125846,_0xa5e4('0xd9'));}else{if(_0x2d1979[_0xa5e4('0xd4')]>=_0x1fd278[_0xa5e4('0xda')]){rpcDb[_0xa5e4('0xa4')](_0x2d1979,_0xa5e4('0xd8'));}else{rpcDb['rescheduleContact'](ut[_0xa5e4('0xa7')](_0x2d1979,_0xa5e4('0xd4'),_0x1fd278[_0xa5e4('0xc7')]),_0x2d1979[_0xa5e4('0xa8')],_0x2d1979[_0xa5e4('0xa9')]);}}}else{_0x2d1979[_0xa5e4('0xd4')]++;_0x371401[_0xa5e4('0xad')]({'id':_0x2d1979[_0xa5e4('0xac')],'field':{'countcongestionretry':_0x2d1979[_0xa5e4('0xd4')]}})[_0xa5e4('0x7d')](function(){_0x371401[_0xa5e4('0xae')](_0x2d1979,_0x57552b,_0x58ac3c)['then'](function(){});});}});break;case _0xa5e4('0xdb'):_0x1fd278[_0xa5e4('0x43')]+=0x1;_0x2d1979[_0xa5e4('0xdc')]+=0x1;_0x2d1979[_0xa5e4('0xbe')]=ut[_0xa5e4('0x9a')](_0x2d1979);ut[_0xa5e4('0x8b')](_0x2d1979,0x14,_0xa5e4('0xdd'));_0x57552b=_0x1fd278['dialAgentRejectRetryFrequency'];_0x58ac3c=_0x1fd278[_0xa5e4('0xa0')];ami[_0xa5e4('0x25')](_0xa5e4('0xde'),ut['buildObj'](_0x2d1979,_0xa5e4('0xdf')));rpcDb[_0xa5e4('0x8c')](_0x2d1979,_0xa5e4('0xe0'));_0x371401['verifyAdditionalPhones'](_0x2d1979,'20',_0x1fd278)[_0xa5e4('0x7d')](function(_0x56f9e0){_0x241f55=_0x56f9e0[_0xa5e4('0x9f')]==0x1;if(!_0x241f55){if(ut['totalGlobal'](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut[_0xa5e4('0xa2')](_0x2d1979,0x14,_0xa5e4('0xdd'));rpcDb[_0xa5e4('0xa4')](_0x125846,_0xa5e4('0xe1'));}else{if(_0x2d1979[_0xa5e4('0xdc')]>=_0x1fd278[_0xa5e4('0xe2')]){rpcDb['createCustomerFinal'](_0x2d1979,_0xa5e4('0xe1'));}else{rpcDb['rescheduleContact'](ut[_0xa5e4('0xa7')](_0x2d1979,_0xa5e4('0xdc'),_0x1fd278['dialAgentRejectRetryFrequency']),_0x2d1979[_0xa5e4('0xa8')],_0x2d1979[_0xa5e4('0xa9')]);}}}else{_0x2d1979['countnoanswerretry']++;_0x371401[_0xa5e4('0xad')]({'id':_0x2d1979['idContact'],'field':{'countnoanswerretry':_0x2d1979[_0xa5e4('0xd2')]}})['then'](function(){_0x371401[_0xa5e4('0xae')](_0x2d1979,_0x57552b,_0x58ac3c)[_0xa5e4('0x7d')](function(){});});}});break;case _0xa5e4('0xe3'):_0x1fd278[_0xa5e4('0x44')]+=0x1;_0x2d1979[_0xa5e4('0xe4')]+=0x1;_0x2d1979[_0xa5e4('0xbe')]=ut['totalGlobal'](_0x2d1979);ut['logCustomer'](_0x2d1979,0xb,_0xa5e4('0xe5'));rpcDb[_0xa5e4('0x8c')](_0x2d1979,'[callProgressDetectingCustomer][logAbandoned]');_0x371401[_0xa5e4('0xca')](_0x2d1979,'11',_0x1fd278)[_0xa5e4('0x7d')](function(_0x5e4d30){_0x241f55=_0x5e4d30[_0xa5e4('0x9f')]==0x1;if(!_0x241f55){if(ut['totalGlobal'](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut[_0xa5e4('0xa2')](_0x2d1979,0xf,_0xa5e4('0xa3'));rpcDb['createCustomerFinal'](_0x125846,_0xa5e4('0xe6'));}else{if(_0x2d1979[_0xa5e4('0xe7')]>=_0x1fd278[_0xa5e4('0xe8')]){rpcDb[_0xa5e4('0xa4')](_0x2d1979,_0xa5e4('0xe6'));}else{rpcDb[_0xa5e4('0xa6')](ut[_0xa5e4('0xa7')](_0x2d1979,_0xa5e4('0xe4'),_0x1fd278[_0xa5e4('0xe9')]),_0x2d1979[_0xa5e4('0xa8')],_0x2d1979[_0xa5e4('0xa9')]);}}}else{_0x2d1979[_0xa5e4('0xd2')]++;_0x371401[_0xa5e4('0xad')]({'id':_0x2d1979[_0xa5e4('0xac')],'field':{'countnoanswerretry':_0x2d1979['countnoanswerretry']}})[_0xa5e4('0x7d')](function(){_0x371401['swapAdditionalPhones'](_0x2d1979,_0x57552b,_0x58ac3c)[_0xa5e4('0x7d')](function(){});});}});break;case'18':_0x1fd278[_0xa5e4('0xea')]+=0x1;_0x2d1979[_0xa5e4('0xeb')]+=0x1;_0x2d1979[_0xa5e4('0xbe')]=ut['totalGlobal'](_0x2d1979);ut['logCustomer'](_0x2d1979,0x12,_0x41a834[_0xa5e4('0xec')]||_0x41a834[_0xa5e4('0xed')]);ami[_0xa5e4('0x25')](_0xa5e4('0xee'),ut[_0xa5e4('0x9c')](_0x2d1979,'amd'));rpcDb[_0xa5e4('0x8c')](_0x2d1979,'[callProgressDetectingCustomer][hangupInAMD]');_0x371401[_0xa5e4('0xca')](_0x2d1979,'18',_0x1fd278)[_0xa5e4('0x7d')](function(_0x152d62){_0x241f55=_0x152d62[_0xa5e4('0x9f')]==0x1;if(!_0x241f55){if(ut['totalGlobal'](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut[_0xa5e4('0xa2')](_0x2d1979,0x12,_0xa5e4('0xa3'));rpcDb['createCustomerFinal'](_0x125846,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xa5e4('0xa4')](_0x2d1979,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x2d1979['countnoanswerretry']++;_0x371401[_0xa5e4('0xad')]({'id':_0x2d1979[_0xa5e4('0xac')],'field':{'countnoanswerretry':_0x2d1979['countnoanswerretry']}})['then'](function(){_0x371401['swapAdditionalPhones'](_0x2d1979,_0x57552b,_0x58ac3c)['then'](function(){});});}});delete this['actions'][_0x41a834[_0xa5e4('0xaa')]];break;case'19':_0x1fd278[_0xa5e4('0xea')]+=0x1;_0x2d1979['countglobal']=ut[_0xa5e4('0x9a')](_0x2d1979);ut[_0xa5e4('0x8b')](_0x2d1979,0x13,_0x41a834[_0xa5e4('0xec')]||_0x41a834[_0xa5e4('0xed')]);ami[_0xa5e4('0x25')](_0xa5e4('0xee'),ut[_0xa5e4('0x9c')](_0x2d1979,'amd'));rpcDb[_0xa5e4('0x8c')](_0x2d1979,'[callProgressDetectingCustomer][machine]');_0x371401[_0xa5e4('0xca')](_0x2d1979,'18',_0x1fd278)['then'](function(_0x458ab){_0x241f55=_0x458ab['additional']==0x1;if(!_0x241f55){if(ut[_0xa5e4('0x9a')](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut['cloneAction'](_0x2d1979,0xf,_0xa5e4('0xa3'));rpcDb[_0xa5e4('0xa4')](_0x125846,_0xa5e4('0xef'));}else{rpcDb[_0xa5e4('0xa4')](_0x2d1979,_0xa5e4('0xef'));}}else{_0x2d1979[_0xa5e4('0xd2')]++;_0x371401[_0xa5e4('0xad')]({'id':_0x2d1979[_0xa5e4('0xac')],'field':{'countnoanswerretry':_0x2d1979[_0xa5e4('0xd2')]}})[_0xa5e4('0x7d')](function(){_0x371401[_0xa5e4('0xae')](_0x2d1979,_0x57552b,_0x58ac3c)[_0xa5e4('0x7d')](function(){});});}});delete this[_0xa5e4('0x16')][_0x41a834[_0xa5e4('0xaa')]];break;default:if(_0x2d1979['dialAnswer']){ut[_0xa5e4('0xbc')](_0x1fd278,_0xa5e4('0xf0'));ut[_0xa5e4('0x75')](_0xa5e4('0xf1')+_0x1fd278['name'],_0x41a834);}_0x1fd278[_0xa5e4('0xea')]+=0x1;_0x2d1979['countglobal']=ut[_0xa5e4('0x9a')](_0x2d1979);ut['logCustomer'](_0x2d1979,0xc,_0x41a834[_0xa5e4('0xec')]||_0x41a834['dialstatus']);_0x57552b=_0x1fd278[_0xa5e4('0xf2')];_0x58ac3c=_0x1fd278['callAdditionalPhoneAfterMin'];rpcDb[_0xa5e4('0x8c')](_0x2d1979,'[callProgressDetectingCustomer][logUnknown]');_0x371401[_0xa5e4('0xca')](_0x2d1979,'20',_0x1fd278)[_0xa5e4('0x7d')](function(_0x1333e1){_0x241f55=_0x1333e1[_0xa5e4('0x9f')]==0x1;if(!_0x241f55){if(ut[_0xa5e4('0x9a')](_0x2d1979)>=_0x1fd278[_0xa5e4('0xa1')]){_0x125846=ut['cloneAction'](_0x2d1979,0xf,_0xa5e4('0xa3'));rpcDb[_0xa5e4('0xa4')](_0x125846,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x2d1979,_0xa5e4('0xf3'));}delete this['actions'][_0x41a834[_0xa5e4('0xaa')]];}else{_0x371401[_0xa5e4('0xae')](_0x2d1979,_0x57552b,_0x58ac3c)['then'](function(){});}});}if(!(_0x2d1979[_0xa5e4('0x74')]&&_0x435f64==='16')){ut[_0xa5e4('0x73')](_0x1fd278,_0xa5e4('0xf4'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x2d1979['uniqueid'],_0xa5e4('0xb5'),_0x1fd278['name'],_0xa5e4('0xf5'),_0x1fd278[_0xa5e4('0x50')]);}if(_0x435f64!==_0xa5e4('0xaf')){delete this['actions'][_0x41a834[_0xa5e4('0xaa')]];delete this[_0xa5e4('0x16')][_0x41a834[_0xa5e4('0xf6')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x278cdd,_0x5dac30,_0x2a4200){if(_[_0xa5e4('0xf7')](_0x5dac30)&&_0xa5e4('0xf8')!==typeof _0x5dac30){return;}if(_[_0xa5e4('0xf7')](_0x2a4200)&&'object'!==typeof _0x2a4200){return;}switch(_0x2a4200[_0xa5e4('0xf9')]){case'0':ut[_0xa5e4('0xfa')](_0x278cdd,0x0,_0xa5e4('0x9b'));rpcDb[_0xa5e4('0xfb')](_0x278cdd,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xa5e4('0xfa')](_0x278cdd,0x3,'NoAnswer');rpcDb[_0xa5e4('0xfb')](_0x278cdd,_0xa5e4('0xfc'));break;case'5':ut[_0xa5e4('0xfa')](_0x278cdd,0x5,'Busy');rpcDb[_0xa5e4('0xfb')](_0x278cdd,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xa5e4('0xfa')](_0x278cdd,0x8,_0xa5e4('0xfd'));rpcDb[_0xa5e4('0xfb')](_0x278cdd,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x278cdd,0x16,_0xa5e4('0xfe'));rpcDb[_0xa5e4('0xfb')](_0x278cdd,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xa5e4('0xfa')](_0x278cdd,0xc,_0x2a4200[_0xa5e4('0xf9')]);rpcDb[_0xa5e4('0xfb')](_0x278cdd,_0xa5e4('0xff'));}ut[_0xa5e4('0x73')](_0x5dac30,_0xa5e4('0x100'));logger['info'](_0xa5e4('0x101'),_0x278cdd[_0xa5e4('0xb4')],_0xa5e4('0xb5'),_0x5dac30['name'],'originated:\x20',_0x5dac30[_0xa5e4('0x50')]);delete this['actions'][_0x278cdd[_0xa5e4('0xb4')]];};Preview['prototype']['verifyAdditionalPhones']=function(_0x4622d6,_0x4ed1d5,_0x13112d){return Promise['resolve']()[_0xa5e4('0x7d')](cmHopperAdditionalPhone[_0xa5e4('0xca')](_0x4622d6,_0x4ed1d5,_0x13112d))['catch'](logger[_0xa5e4('0x59')]('[verifyAdditionalPhone]\x20'));};Preview[_0xa5e4('0xe')][_0xa5e4('0xae')]=function(_0x4f0e67,_0x10202d,_0x53d78e){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xa5e4('0xae')](_0x4f0e67,_0x10202d,_0x53d78e))[_0xa5e4('0x72')](logger[_0xa5e4('0x59')]('[swapAdditionalPhone]\x20'));};Preview[_0xa5e4('0xe')]['incrementPreviewCounters']=function(_0x43301e){return Promise[_0xa5e4('0x102')]()['then'](cmHopperAdditionalPhone[_0xa5e4('0xad')](_0x43301e))[_0xa5e4('0x72')](logger[_0xa5e4('0x59')]('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0xa5e4('0x103')]=function(_0x2a2520,_0x4da889,_0x1f53a9,_0x252d46,_0x18f3f5){var _0x113704=this;return new Promise(function(_0x2717f6,_0x51bb45){if(_[_0xa5e4('0x68')](_0x4da889)||_['isNil'](_0x4da889[_0xa5e4('0x104')])||_[_0xa5e4('0x68')](_0x4da889[_0xa5e4('0x105')])||_[_0xa5e4('0x68')](_0x4da889[_0xa5e4('0x6e')])){_0x51bb45(ut['message'](_0xa5e4('0x106'),_0x252d46,_0x18f3f5));return;}var _0x176eef=uuid['v4']();var _0x5ea173=_0x113704['campaignsPreview'][_0x4da889['Queue'][_0xa5e4('0x27')]];var _0x2b4c23=_0x1f53a9?_0x113704[_0xa5e4('0x17')][_0x1f53a9]['id']:undefined;_0x113704[_0xa5e4('0x16')][_0x176eef]=new Action(_0x4da889,_0x5ea173,_0x176eef,_0x1f53a9,_0x2b4c23);var _0x475011=_0x113704[_0xa5e4('0x16')][_0x176eef];_0x475011[_0xa5e4('0xa8')]=_0x252d46;_0x475011[_0xa5e4('0xa9')]=_0x18f3f5;_0x475011[_0xa5e4('0x107')]=_0x1f53a9;if(_[_0xa5e4('0x108')](_0x2a2520)){_0x113704[_0xa5e4('0x109')](_0x475011,_0x5ea173,_0x4da889,_0x1f53a9)[_0xa5e4('0x7d')](function(_0x4b513a){logger['info']('[Preview][execCall][success]',_0xa5e4('0x10a')+_0x475011['queue']+'\x20IdHopper:\x20'+_0x475011[_0xa5e4('0xac')],JSON[_0xa5e4('0x56')](_0x4b513a));ami[_0xa5e4('0x25')]('custom:agentcalled',ut[_0xa5e4('0x9c')](_0x475011,_0xa5e4('0x10b'),_0x113704[_0xa5e4('0x13')][_0x475011[_0xa5e4('0x6a')]]));_0x2717f6(ut[_0xa5e4('0x4f')](_0xa5e4('0x10c')));})['catch'](function(_0x3292f7){ut[_0xa5e4('0x61')](_0xa5e4('0x10d'),_0x3292f7);_0x51bb45(ut[_0xa5e4('0x4f')]('Call\x20failed',_0x252d46,_0x18f3f5));});}else{_0x5ea173[_0xa5e4('0x3d')]+=0x1;ut[_0xa5e4('0x10e')](_0x475011);rpcDb[_0xa5e4('0x10f')](_0x475011,_0xa5e4('0x110'));delete _0x113704[_0xa5e4('0x16')][_0x176eef];_0x51bb45(ut[_0xa5e4('0x4f')](_0xa5e4('0x111'),_0x252d46,_0x18f3f5));}});};Preview['prototype'][_0xa5e4('0x93')]=function(_0x3166cd){return!_[_0xa5e4('0x68')](_0x3166cd)&&!_[_0xa5e4('0x68')](_0x3166cd['name'])&&!_[_0xa5e4('0x68')](_0x3166cd[_0xa5e4('0x112')])&&_0x3166cd[_0xa5e4('0x112')]&&!_[_0xa5e4('0x68')](this[_0xa5e4('0x15')][util[_0xa5e4('0x5b')](_0xa5e4('0x113'),_0x3166cd['name'])])&&!_[_0xa5e4('0x68')](this[_0xa5e4('0x15')][util[_0xa5e4('0x5b')]('SIP/%s',_0x3166cd['name'])]['status'])&&(this[_0xa5e4('0x15')][util[_0xa5e4('0x5b')](_0xa5e4('0x113'),_0x3166cd[_0xa5e4('0x27')])][_0xa5e4('0x114')]===_0xa5e4('0x115')||this['trunks'][util['format'](_0xa5e4('0x113'),_0x3166cd['name'])][_0xa5e4('0x114')]===_0xa5e4('0x116'));};Preview[_0xa5e4('0xe')][_0xa5e4('0x117')]=function(_0x33d989,_0x49fd27){var _0x16cf8d=this;return new Promise(function(_0x5671a5,_0x53e3e1){_0x16cf8d[_0xa5e4('0x118')](_0x33d989,_0x49fd27)['then'](function(_0x2528a3){_0x5671a5(_['pick'](_0x2528a3,['message']));})[_0xa5e4('0x72')](function(_0x34eb3e){if(_0x34eb3e[_0xa5e4('0x119')]){rpcDb[_0xa5e4('0x11a')](_0x33d989);}if(_0x34eb3e[_0xa5e4('0x112')]){rpcDb['disableContact'](_0x33d989);}_0x53e3e1(_[_0xa5e4('0x11b')](_0x34eb3e,['message']));});});};Preview[_0xa5e4('0xe')]['execRun']=function(_0x280923,_0x260e6c){var _0x530e1e=this;return new Promise(function(_0x9d619e,_0x5bf890){var _0x425b10,_0x365e7f;rpcDb[_0xa5e4('0x11c')](_0x280923)[_0xa5e4('0x7d')](function(_0x562ff3){if(!_[_0xa5e4('0x68')](_0x562ff3[0x0])){_0x365e7f=_0x562ff3[0x0][_0xa5e4('0x11d')]?![]:!![];_0x425b10=_0x562ff3[0x0][_0xa5e4('0x11d')]?!![]:![];_0x425b10=_0x260e6c?!![]:_0x425b10;}var _0x1f4702=_0x530e1e[_0xa5e4('0x11e')](_0x562ff3);if(_0x1f4702[_0xa5e4('0x11f')]){rpcDb[_0xa5e4('0x120')](_[_0xa5e4('0x11b')](_0x562ff3[0x0],[_0xa5e4('0x6e'),_0xa5e4('0x105')]))['then'](function(_0x20cf81){_0x530e1e[_0xa5e4('0x103')](_0x20cf81,_0x562ff3[0x0],_0x260e6c,_0x365e7f,_0x425b10)['then'](function(_0x4f25ce){_0x9d619e(_0x4f25ce);})[_0xa5e4('0x72')](function(_0x3eeeca){_0x5bf890(_0x3eeeca);});})[_0xa5e4('0x72')](function(_0x2c6380){ut[_0xa5e4('0x61')]('[Preview][checkIsBlackList]',_0x2c6380);_0x5bf890(ut[_0xa5e4('0x4f')](_0xa5e4('0x121'),_0x365e7f,_0x425b10));});}else{_0x5bf890(ut[_0xa5e4('0x4f')](_0x1f4702['message'],_0x365e7f,_0x425b10));}})[_0xa5e4('0x72')](function(_0x22766f){ut[_0xa5e4('0x61')]('[Preview][getContactPreview]',_0x22766f);_0x5bf890(ut['message'](_0xa5e4('0x121'),![],!![]));});});};Preview[_0xa5e4('0xe')]['validateContact']=function(_0x11b5c7){if(_[_0xa5e4('0x68')](_0x11b5c7)||_[_0xa5e4('0x108')](_0x11b5c7)||!_['isNil'](_0x11b5c7[0x0][_0xa5e4('0x81')])&&_['isNil'](_0x11b5c7[0x0][_0xa5e4('0x81')]['name'])){ut[_0xa5e4('0x61')]('[Preview][validateContact][Empty\x20Contact]',_0x11b5c7);return{'isValid':![],'message':_0xa5e4('0x122')};}var _0x4c9624=this[_0xa5e4('0x13')][_0x11b5c7[0x0][_0xa5e4('0x69')][_0xa5e4('0x27')]];_0x4c9624['message']=_0xa5e4('0x96');if(_[_0xa5e4('0x68')](_0x4c9624)){ut['logger'](_0xa5e4('0x123'),_0x4c9624);return{'isValid':![],'message':_0xa5e4('0x124')};}if(!this[_0xa5e4('0x93')](_0x4c9624['Trunk'])){ut[_0xa5e4('0x61')](_0xa5e4('0x125'),_0xa5e4('0x126')+_0x4c9624[_0xa5e4('0x27')]+_0xa5e4('0x127'));if(!this[_0xa5e4('0x93')](_0x4c9624[_0xa5e4('0x94')])){ut[_0xa5e4('0x61')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4c9624['name']+_0xa5e4('0x128'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xa5e4('0x91')](_0x4c9624[_0xa5e4('0x36')])){ut[_0xa5e4('0x61')]('[Preview][validateContact][Campaign\x20Active]',_0x4c9624[_0xa5e4('0x27')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4c9624['name']+_0xa5e4('0x129')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xa5e4('0xe')][_0xa5e4('0x109')]=function(_0x24db5e,_0x350723,_0x1ecf44,_0x568f98){var _0x4d03b0=this;return new Promise(function(_0x35aef3,_0x57bea7){var _0xc4b9cc=_0x24db5e['uniqueid'];var _0x4d43c7=_0x4d03b0['isTrunkReachable'](_0x350723['Trunk'])?util[_0xa5e4('0x5b')]('SIP/%s/%s%s',_0x350723[_0xa5e4('0x54')][_0xa5e4('0x27')],_['isNil'](_0x350723[_0xa5e4('0x3a')])?'':_0x350723[_0xa5e4('0x3a')][_0xa5e4('0x12a')]()||'',_0x350723['dialCutDigit']>0x0?_0x1ecf44['phone'][_0xa5e4('0x12b')](_0x350723[_0xa5e4('0x12c')]):_0x1ecf44['phone']):util['format']('SIP/%s/%s%s',_['isNil'](_0x350723['TrunkBackup'])?_0x350723[_0xa5e4('0x54')]['name']:_0x350723[_0xa5e4('0x94')][_0xa5e4('0x27')],_['isNil'](_0x350723[_0xa5e4('0x3a')])?'':_0x350723['dialPrefix'][_0xa5e4('0x12a')]()||'',_0x350723[_0xa5e4('0x12c')]>0x0?_0x1ecf44[_0xa5e4('0x105')][_0xa5e4('0x12b')](_0x350723[_0xa5e4('0x12c')]):_0x1ecf44['phone']);var _0x5a4a9a=_0x4d03b0[_0xa5e4('0x93')](_0x350723[_0xa5e4('0x54')])?ut[_0xa5e4('0x12d')](_0x350723['Trunk']['callerid'],_0x350723[_0xa5e4('0x38')],_0x350723[_0xa5e4('0x12e')]>0x0?ut['getCallerIdRandom'](_0x350723['dialOriginateCallerIdNumber'],_0x350723[_0xa5e4('0x12e')]):_0x350723['dialOriginateCallerIdNumber']):ut[_0xa5e4('0x12d')](_[_0xa5e4('0x68')](_0x350723['TrunkBackup'])?_0x350723['Trunk'][_0xa5e4('0x12f')]:_0x350723[_0xa5e4('0x94')]['callerid'],_0x350723['dialOriginateCallerIdName'],_0x350723[_0xa5e4('0x12e')]>0x0?ut[_0xa5e4('0x130')](_0x350723[_0xa5e4('0x39')],_0x350723[_0xa5e4('0x12e')]):_0x350723['dialOriginateCallerIdNumber']);if(_0x5a4a9a){_0x24db5e['originatecalleridname']=ut[_0xa5e4('0x131')](_0x5a4a9a);_0x24db5e[_0xa5e4('0x132')]=ut[_0xa5e4('0x133')](_0x5a4a9a);}var _0x2445b=ut['addVariables'](_0x350723,_0x1ecf44,_0x4d43c7,_0x5a4a9a,_0xc4b9cc,_0x24db5e);_['merge'](_0x24db5e,ut[_0xa5e4('0x134')](_0x2445b));_0x24db5e[_0xa5e4('0x135')]=moment()['format'](_0xa5e4('0xb0'));_0x350723[_0xa5e4('0x136')]=_0x2445b;ami[_0xa5e4('0x70')](ut[_0xa5e4('0x137')](_0x24db5e,_0x350723,_0x2445b,_0x24db5e[_0xa5e4('0xa9')],_0x568f98))[_0xa5e4('0x7d')](function(_0xe106c4){_0x350723[_0xa5e4('0x50')]+=0x1;logger['info'](_0xa5e4('0x138'),_0xc4b9cc,_0xa5e4('0xb5'),_0x350723[_0xa5e4('0x27')],_0xa5e4('0xf5'),_0x350723[_0xa5e4('0x50')]);_0x35aef3(_0xe106c4);})[_0xa5e4('0x72')](function(_0x1a7ed9){ut['logAgent'](_0x24db5e,0xe,_0xa5e4('0x139'));rpcDb[_0xa5e4('0xfb')](_0x24db5e,_0xa5e4('0x13a'));_0x57bea7(_0x1a7ed9);});});};Preview[_0xa5e4('0xe')]['syncNewExten']=function(_0x34e567){if(this[_0xa5e4('0x16')][_0x34e567[_0xa5e4('0xaa')]]){this['actions'][_0x34e567[_0xa5e4('0xaa')]][_0xa5e4('0x71')]=_0x34e567[_0xa5e4('0x71')];}};Preview[_0xa5e4('0xe')]['syncOriginateResponse']=function(_0x4cca71){var _0x326b33=this;var _0x422017=this[_0xa5e4('0x16')][_0x4cca71['actionid']];if(_0x422017){if(_0x422017['lookAgent']&&this[_0xa5e4('0x17')][_0x422017[_0xa5e4('0x107')]]){ut[_0xa5e4('0x13b')](_0x422017,this[_0xa5e4('0x17')][_0x422017[_0xa5e4('0x107')]][_0xa5e4('0x27')],this[_0xa5e4('0x17')][_0x422017['lookAgent']]['id']);}var _0x4323a1=_[_0xa5e4('0x13c')](_0x422017);_0x4323a1[_0xa5e4('0xb1')]=moment()['format'](_0xa5e4('0xb0'));var _0x2c42a5=_0x326b33[_0xa5e4('0x13')][_0x422017[_0xa5e4('0x6a')]];if(ut[_0xa5e4('0x13d')](_0x4cca71['response'])){if(_0x422017[_0xa5e4('0xa8')]){rpcDb[_0xa5e4('0x11a')](_0x422017['idContact']);}if(_0x422017['activeContact']){rpcDb[_0xa5e4('0x85')](_0x422017[_0xa5e4('0xac')]);}ami[_0xa5e4('0x25')](_0xa5e4('0x13e'),ut[_0xa5e4('0x9c')](_0x422017,_0xa5e4('0x13f'),this['campaignsPreview'][_0x422017[_0xa5e4('0x6a')]]));this[_0xa5e4('0x140')](_0x4323a1,_0x2c42a5,_0x4cca71);}else{_0x422017[_0xa5e4('0x135')]=moment()[_0xa5e4('0x5b')](_0xa5e4('0xb0'));ut[_0xa5e4('0xfa')](_0x4323a1,0x4,'Answer');rpcDb['createAgentHistory'](_0x4323a1,_0xa5e4('0x141'));}}};Preview[_0xa5e4('0xe')]['syncHangup']=function(_0x544877){var _0x31b87a=this[_0xa5e4('0x16')][_0x544877['linkedid']];var _0x17c6c4;if(_0x31b87a){_0x17c6c4=this[_0xa5e4('0x13')][_0x31b87a[_0xa5e4('0x6a')]];logger[_0xa5e4('0x59')](_0xa5e4('0x142'),_0x544877[_0xa5e4('0xaa')],_0xa5e4('0xb5'),_0x17c6c4[_0xa5e4('0x27')],_0xa5e4('0x6b'),_0x17c6c4['pTalking']);}if(this[_0xa5e4('0x16')][_0x544877[_0xa5e4('0xaa')]]&&_0x544877[_0xa5e4('0xaa')]!==_0x544877[_0xa5e4('0xb4')]){if(_0x544877[_0xa5e4('0x143')]==='16'&&this[_0xa5e4('0x16')][_0x544877[_0xa5e4('0xaa')]][_0xa5e4('0x74')]){this[_0xa5e4('0x97')](_0x544877,_0x544877[_0xa5e4('0xaa')],_0x544877[_0xa5e4('0x143')]);}else if(this[_0xa5e4('0x16')][_0x544877[_0xa5e4('0xaa')]][_0xa5e4('0x74')]){logger[_0xa5e4('0x59')](_0xa5e4('0x144'),_0x544877['linkedid'],_0x544877['cause'],'\x20Queue',_0x17c6c4[_0xa5e4('0x27')],'pTalking:\x20',_0x17c6c4[_0xa5e4('0x2c')]);this[_0xa5e4('0x97')](_0x544877,_0x544877[_0xa5e4('0xaa')],_0x544877[_0xa5e4('0x143')]);}}else if(_0x31b87a&&_[_0xa5e4('0x68')](_0x31b87a[_0xa5e4('0x145')])&&_0x17c6c4[_0xa5e4('0x146')]&&_0x544877['linkedid']===_0x544877['uniqueid']&&_['isNil'](_0x544877[_0xa5e4('0xf9')])&&_0x544877['cause']==='16'&&_0x544877[_0xa5e4('0x147')]==='6'&&_['isUndefined'](_0x31b87a[_0xa5e4('0x148')])){if(_0x31b87a[_0xa5e4('0xa8')]){rpcDb[_0xa5e4('0x11a')](_0x31b87a[_0xa5e4('0xac')]);}if(_0x31b87a[_0xa5e4('0xa9')]){rpcDb[_0xa5e4('0x85')](_0x31b87a[_0xa5e4('0xac')]);}_0x544877[_0xa5e4('0xf9')]='22';this[_0xa5e4('0x140')](_0x31b87a,_0x17c6c4,_0x544877);}else if(_0x31b87a&&_0x31b87a[_0xa5e4('0x148')]){if(_0x544877['cause']==='16'&&this[_0xa5e4('0x16')][_0x544877['linkedid']][_0xa5e4('0x74')]){logger[_0xa5e4('0x59')](_0xa5e4('0x149'),_0x544877[_0xa5e4('0xaa')],_0x544877['cause'],_0xa5e4('0xb5'),_0x17c6c4['name'],_0xa5e4('0x6b'),_0x17c6c4[_0xa5e4('0x2c')]);this[_0xa5e4('0x97')](_0x544877,_0x544877[_0xa5e4('0xaa')],_0x544877[_0xa5e4('0x143')]);}else if(this['actions'][_0x544877[_0xa5e4('0xaa')]][_0xa5e4('0x74')]){logger[_0xa5e4('0x59')](_0xa5e4('0x144'),_0x544877[_0xa5e4('0xaa')],_0x544877[_0xa5e4('0x143')],_0xa5e4('0xb5'),_0x17c6c4['name'],_0xa5e4('0x6b'),_0x17c6c4[_0xa5e4('0x2c')]);this['callProgressDetectingCustomer'](_0x544877,_0x544877[_0xa5e4('0xaa')],_0x544877['cause']);}}};Preview['prototype'][_0xa5e4('0x1e')]=function(_0x2ea06a){if(this[_0xa5e4('0x16')][_0x2ea06a[_0xa5e4('0xf6')]]&&_0x2ea06a[_0xa5e4('0xf6')]!==_0x2ea06a[_0xa5e4('0x14a')]){this['callProgressDetectingCustomer'](_0x2ea06a,_0x2ea06a[_0xa5e4('0xf6')],_0x2ea06a['dialstatus']);}};Preview[_0xa5e4('0xe')][_0xa5e4('0x1d')]=function(_0x524c4c){if(this[_0xa5e4('0x16')][_0x524c4c[_0xa5e4('0xaa')]]&&_0x524c4c[_0xa5e4('0xaa')]!==_0x524c4c['uniqueid']&&!this[_0xa5e4('0x16')][_0x524c4c[_0xa5e4('0xaa')]]['dialAnswer']){if(_0x524c4c[_0xa5e4('0x143')]==='1'){this['callProgressDetectingCustomer'](_0x524c4c,_0x524c4c[_0xa5e4('0xaa')],_0x524c4c['cause']);}}};Preview[_0xa5e4('0xe')][_0xa5e4('0x14b')]=function(_0x3e8817,_0xbfdbed,_0x522d90){if(this[_0xa5e4('0x16')][_0x3e8817]){if(_[_0xa5e4('0x68')](this['actions'][_0x3e8817]['variables'])){this['actions'][_0x3e8817][_0xa5e4('0x136')]={};}this[_0xa5e4('0x16')][_0x3e8817]['variables'][_0xbfdbed]=_0x522d90;}};Preview[_0xa5e4('0xe')][_0xa5e4('0x14c')]=function(_0x918472){try{if(!_['isNil'](_0x918472)){if(ut[_0xa5e4('0x14d')](_[_0xa5e4('0x14e')](_0x918472['variable'])[0x0])){this[_0xa5e4('0x14b')](_0x918472[_0xa5e4('0xb4')],_['keys'](_0x918472[_0xa5e4('0x14f')])[0x0],_0x918472[_0xa5e4('0x150')]);}}}catch(_0x158ee4){logger[_0xa5e4('0x151')](_0xa5e4('0x152'),util[_0xa5e4('0x153')](_0x158ee4,{'showHidden':![],'depth':null}));}};Preview[_0xa5e4('0xe')][_0xa5e4('0x154')]=function(_0x16fb87){if(_0x16fb87){if(this[_0xa5e4('0x16')][_0x16fb87[_0xa5e4('0x155')]]){this[_0xa5e4('0x16')][_0x16fb87[_0xa5e4('0x155')]][_0xa5e4('0x148')]=!![];}}};Preview[_0xa5e4('0xe')][_0xa5e4('0x23')]=function(_0x1d9dc0){if(_0x1d9dc0){if(this[_0xa5e4('0x16')][_0x1d9dc0[_0xa5e4('0x156')]]){this[_0xa5e4('0x16')][_0x1d9dc0[_0xa5e4('0x156')]][_0xa5e4('0x148')]=!![];}}};module[_0xa5e4('0x157')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 055d337..09794a2 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 _0x2861=['[voiceQueueReport]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','create'];(function(_0x27c3f0,_0x198aa2){var _0x11e51c=function(_0x2a48ec){while(--_0x2a48ec){_0x27c3f0['push'](_0x27c3f0['shift']());}};_0x11e51c(++_0x198aa2);}(_0x2861,0x10c));var _0x1286=function(_0x7a68b8,_0x3b74d7){_0x7a68b8=_0x7a68b8-0x0;var _0x4cfd30=_0x2861[_0x7a68b8];return _0x4cfd30;};'use strict';var util=require('util');var BPromise=require(_0x1286('0x0'));var logger=require('../../../config/logger')(_0x1286('0x1'));var _=require(_0x1286('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x1286('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1286('0x4'));var voiceQueueRt=require(_0x1286('0x5'));var agentReportPreview=require(_0x1286('0x6'));var voiceQueueReport=require(_0x1286('0x7'));function loggerCatch(_0x2f9971){return function(_0x430e7c){logger[_0x1286('0x8')](_0x2f9971,util[_0x1286('0x9')](_0x430e7c,{'showHidden':![],'depth':null}));};}function create(_0x46e789){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopperHistory['createHistory'](_0x46e789))[_0x1286('0xc')](loggerCatch(_0x1286('0xd')));}function createAgent(_0x2763d9){return BPromise[_0x1286('0xa')]()['then'](agentReportPreview[_0x1286('0xe')](_0x2763d9))[_0x1286('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x16f5ab){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0xf')](_0x16f5ab,!![]))[_0x1286('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x1286('0x10')]=function(_0x2d7dc9){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopperBlack[_0x1286('0x10')](_0x2d7dc9))[_0x1286('0xc')](loggerCatch(_0x1286('0x11')));};exports[_0x1286('0x12')]=function(_0x42cbf6){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0x12')](_0x42cbf6))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x1286('0xe')]=function(_0x1088aa,_0x2e302d){create(_0x1088aa)['catch'](loggerCatch(_0x2e302d));moveContact(_0x1088aa)[_0x1286('0xc')](loggerCatch(_0x2e302d));};exports[_0x1286('0x13')]=function(_0x273669,_0x19d48c){createAgent(_0x273669)['catch'](loggerCatch(_0x19d48c));};exports[_0x1286('0x14')]=function(_0x54ef19,_0x5e3064){create(_0x54ef19)['catch'](loggerCatch(_0x5e3064));};exports[_0x1286('0x15')]=function(_0x5d8f33,_0x2f69c0){moveContact(_0x5d8f33)['catch'](loggerCatch(_0x2f69c0));};exports[_0x1286('0x16')]=function(_0x1c934e,_0x822658,_0xaec8aa){if(_0x822658){_0x1c934e[_0x1286('0x17')]=null;}if(_0xaec8aa){_0x1c934e[_0x1286('0x18')]=![];}return BPromise[_0x1286('0xa')]()['then'](cmHopper[_0x1286('0x16')](_0x1c934e))['catch'](loggerCatch(_0x1286('0x19')));};exports[_0x1286('0x1a')]=function(_0x5f2916){return BPromise[_0x1286('0xa')]()['then'](cmHopper['countReScheduled'](_0x5f2916))[_0x1286('0xc')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x414347){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper['unlockContact']({'UserId':null},_0x414347,0x1))[_0x1286('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x1286('0x1b')]=function(_0x2f4423){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0x1c')]({'active':![]},_0x2f4423,0x1))[_0x1286('0xc')](loggerCatch(_0x1286('0x1d')));};exports[_0x1286('0x1e')]=function(_0x3aadd6){var _0x40d990={};_0x40d990[_0x1286('0x1f')]=_0x3aadd6[_0x1286('0x1f')];_0x40d990[_0x1286('0x20')]=_0x3aadd6[_0x1286('0x20')];_0x40d990[_0x1286('0x21')]=_0x3aadd6[_0x1286('0x21')];_0x40d990['calleridname']=_0x3aadd6[_0x1286('0x22')];_0x40d990[_0x1286('0x23')]=_0x3aadd6['queue'];_0x40d990[_0x1286('0x24')]=_0x3aadd6['answertime'];_0x40d990[_0x1286('0x25')]=_0x3aadd6[_0x1286('0x26')];_0x40d990[_0x1286('0x27')]=0x1;_0x40d990['queuecallercompleteAt']=_0x3aadd6[_0x1286('0x28')];_0x40d990[_0x1286('0x29')]=_0x3aadd6[_0x1286('0x2a')];_0x40d990[_0x1286('0x2b')]=_0x1286('0x2c');_0x40d990['exten']=_0x1286('0x2d');_0x40d990[_0x1286('0x2e')]=0x0;_0x40d990[_0x1286('0x2f')]=0x1;_0x40d990['lastAssignedTo']=_0x3aadd6[_0x1286('0x2a')];_0x40d990[_0x1286('0x30')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport[_0x1286('0x31')](_0x40d990))[_0x1286('0xc')](loggerCatch(_0x1286('0x32')));};exports['getContactRecallMe']=function(_0x20f98b,_0x30e598){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper['getContactRecallMe'](_0x20f98b,_0x30e598))[_0x1286('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x1286('0x33')]=function(_0x284529){return BPromise[_0x1286('0xa')]()[_0x1286('0xb')](cmHopper[_0x1286('0x16')](_0x284529,!![],!![]))[_0x1286('0xc')](loggerCatch(_0x1286('0x34')));}; \ No newline at end of file +var _0x9381=['connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x9381,0x7a));var _0x1938=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9381[_0x22b68a];return _0x1ac67a;};'use strict';var util=require(_0x1938('0x0'));var BPromise=require(_0x1938('0x1'));var logger=require(_0x1938('0x2'))(_0x1938('0x3'));var _=require(_0x1938('0x4'));var cmHopper=require(_0x1938('0x5'));var cmHopperFinal=require(_0x1938('0x6'));var cmHopperHistory=require(_0x1938('0x7'));var cmHopperBlack=require(_0x1938('0x8'));var voiceQueueRt=require(_0x1938('0x9'));var agentReportPreview=require(_0x1938('0xa'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4ef5e7){return function(_0x361464){logger[_0x1938('0xb')](_0x4ef5e7,util['inspect'](_0x361464,{'showHidden':![],'depth':null}));};}function create(_0x450140){return BPromise[_0x1938('0xc')]()[_0x1938('0xd')](cmHopperHistory[_0x1938('0xe')](_0x450140))[_0x1938('0xf')](loggerCatch(_0x1938('0x10')));}function createAgent(_0x11c0fc){return BPromise['resolve']()[_0x1938('0xd')](agentReportPreview[_0x1938('0xe')](_0x11c0fc))['catch'](loggerCatch(_0x1938('0x10')));}function moveContact(_0x4a3398){return BPromise[_0x1938('0xc')]()['then'](cmHopper[_0x1938('0x11')](_0x4a3398,!![]))[_0x1938('0xf')](loggerCatch(_0x1938('0x12')));}exports[_0x1938('0x13')]=function(_0xeaeff9){return BPromise[_0x1938('0xc')]()[_0x1938('0xd')](cmHopperBlack['checkIsBlackList'](_0xeaeff9))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x1938('0x14')]=function(_0x47868d){return BPromise[_0x1938('0xc')]()[_0x1938('0xd')](cmHopper[_0x1938('0x14')](_0x47868d))['catch'](loggerCatch(_0x1938('0x15')));};exports[_0x1938('0xe')]=function(_0x52da6a,_0x17ccfe){create(_0x52da6a)[_0x1938('0xf')](loggerCatch(_0x17ccfe));moveContact(_0x52da6a)[_0x1938('0xf')](loggerCatch(_0x17ccfe));};exports['createAgentHistory']=function(_0x44e38e,_0x2d0113){createAgent(_0x44e38e)[_0x1938('0xf')](loggerCatch(_0x2d0113));};exports[_0x1938('0x16')]=function(_0x3ec9d6,_0x22a5ca){create(_0x3ec9d6)[_0x1938('0xf')](loggerCatch(_0x22a5ca));};exports[_0x1938('0x17')]=function(_0x2219ba,_0x1ee2d6){moveContact(_0x2219ba)['catch'](loggerCatch(_0x1ee2d6));};exports[_0x1938('0x18')]=function(_0x28377f,_0x23d8dd,_0x5d3f55){if(_0x23d8dd){_0x28377f['UserId']=null;}if(_0x5d3f55){_0x28377f[_0x1938('0x19')]=![];}return BPromise['resolve']()['then'](cmHopper[_0x1938('0x18')](_0x28377f))[_0x1938('0xf')](loggerCatch(_0x1938('0x1a')));};exports[_0x1938('0x1b')]=function(_0x1a108d){return BPromise['resolve']()[_0x1938('0xd')](cmHopper['countReScheduled'](_0x1a108d))[_0x1938('0xf')](loggerCatch(_0x1938('0x1c')));};exports['unlockContact']=function(_0x3549e5){return BPromise[_0x1938('0xc')]()[_0x1938('0xd')](cmHopper[_0x1938('0x1d')]({'UserId':null},_0x3549e5,0x1))['catch'](loggerCatch(_0x1938('0x1e')));};exports['disableContact']=function(_0x32d8ac){return BPromise['resolve']()[_0x1938('0xd')](cmHopper[_0x1938('0x1d')]({'active':![]},_0x32d8ac,0x1))['catch'](loggerCatch(_0x1938('0x1f')));};exports[_0x1938('0x20')]=function(_0x467144){var _0x37e298={};_0x37e298[_0x1938('0x21')]=_0x467144['type'];_0x37e298[_0x1938('0x22')]=_0x467144['uniqueid'];_0x37e298[_0x1938('0x23')]=_0x467144[_0x1938('0x23')];_0x37e298[_0x1938('0x24')]=_0x467144[_0x1938('0x24')];_0x37e298['queue']=_0x467144[_0x1938('0x25')];_0x37e298[_0x1938('0x26')]=_0x467144[_0x1938('0x27')];_0x37e298[_0x1938('0x28')]=_0x467144[_0x1938('0x27')];_0x37e298['queuecallercomplete']=0x1;_0x37e298[_0x1938('0x29')]=_0x467144[_0x1938('0x2a')];_0x37e298[_0x1938('0x2b')]=_0x467144['membername'];_0x37e298[_0x1938('0x2c')]=_0x1938('0x2d');_0x37e298[_0x1938('0x2e')]=_0x1938('0x2f');_0x37e298[_0x1938('0x30')]=0x0;_0x37e298[_0x1938('0x31')]=0x1;_0x37e298['lastAssignedTo']=_0x467144['membername'];_0x37e298['queuecallerexitreason']='COMPLETED';return BPromise['resolve']()[_0x1938('0xd')](voiceQueueReport['create'](_0x37e298))[_0x1938('0xf')](loggerCatch(_0x1938('0x32')));};exports['getContactRecallMe']=function(_0x3fbdad,_0x2a16cc){return BPromise['resolve']()[_0x1938('0xd')](cmHopper[_0x1938('0x33')](_0x3fbdad,_0x2a16cc))[_0x1938('0xf')](loggerCatch(_0x1938('0x34')));};exports[_0x1938('0x35')]=function(_0x47a126){return BPromise[_0x1938('0xc')]()[_0x1938('0xd')](cmHopper[_0x1938('0x18')](_0x47a126,!![],!![]))[_0x1938('0xf')](loggerCatch(_0x1938('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 5c10f91..55ed8b2 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 _0x096c=['variablesAction','RECALL','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','queue','interface','motionChannel','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','keys','variables','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','error','logger','info','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x096c,0x172));var _0xc096=function(_0x193156,_0x1df464){_0x193156=_0x193156-0x0;var _0x31540f=_0x096c[_0x193156];return _0x31540f;};'use strict';var util=require(_0xc096('0x0'));var _=require(_0xc096('0x1'));var moment=require(_0xc096('0x2'));var logger=require(_0xc096('0x3'))('preview');var ipAgi=process[_0xc096('0x4')]['XCALLY_IP_AGI']||_0xc096('0x5');function getSeconds(_0x255ca8,_0x5984b7){var _0x1afe79=moment(_0x255ca8)[_0xc096('0x6')](0x0);var _0x4e7bbe=moment(_0x5984b7)[_0xc096('0x6')](0x0);return _0x1afe79['diff'](_0x4e7bbe,'seconds');}exports['loggerCatch']=function(_0x246fe2){return function(_0x356069){logger[_0xc096('0x7')](_0x246fe2,util['inspect'](_0x356069,{'showHidden':![],'depth':null}));};};exports[_0xc096('0x8')]=function(_0xe3710f,_0x1de638){logger[_0xc096('0x9')](_0xe3710f,util[_0xc096('0xa')](_0x1de638,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1b7e11,_0x33c45f){logger[_0xc096('0x7')](_0x1b7e11,util[_0xc096('0xa')](_0x33c45f,{'showHidden':![],'depth':null}));};exports[_0xc096('0xb')]=function(_0x6d969e){return function(_0x2e03af){logger[_0xc096('0x9')](_0x6d969e,util[_0xc096('0xa')](_0x2e03af,{'showHidden':![],'depth':null}));};};exports[_0xc096('0xc')]=function(_0x16421a,_0x4639e2,_0x4de6bd){return{'message':_0x16421a,'unlock':_0x4639e2,'active':_0x4de6bd};};exports[_0xc096('0xd')]=function(_0x4a4bb2,_0x39f11d,_0x142f7f){if(!_[_0xc096('0xe')](_0x142f7f)&&_0xc096('0xf')===typeof _0x142f7f&&!_[_0xc096('0x10')](_0x142f7f)){if(!_['isUndefined'](_0x39f11d)&&'string'===typeof _0x39f11d&&!_[_0xc096('0x10')](_0x39f11d)){return util[_0xc096('0x11')](_0xc096('0x12'),_0x39f11d,_0x142f7f);}return util[_0xc096('0x11')](_0xc096('0x12'),_0x142f7f,_0x142f7f);}if(!_[_0xc096('0xe')](_0x4a4bb2)&&_0xc096('0xf')===typeof _0x4a4bb2&&!_[_0xc096('0x10')](_0x4a4bb2)){return _0x4a4bb2;}return'\x22\x22\x20<>';};exports[_0xc096('0x13')]=function(_0x32e1a5){if(_[_0xc096('0x14')](_0x32e1a5)){return![];}return _0x32e1a5;};exports[_0xc096('0x15')]=function(_0x59a761,_0xa591a7,_0x5b8b16,_0x28d7af,_0x1b8363,_0x3e85fa){var _0x171b04={'XMD-QUEUE':_0xa591a7[_0xc096('0x16')]?_0xa591a7[_0xc096('0x16')]['name']:'','XMD-CALLERID':_0x28d7af,'XMD-CALLERID-PREVIEW':_0x3e85fa?util['format'](_0xc096('0x12'),_0x3e85fa[_0xc096('0x17')],_0x3e85fa[_0xc096('0x18')]):_0x28d7af,'XMD-DIALID':_0x1b8363,'XMD-CONTACTID':_0xa591a7[_0xc096('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x28d7af,'XMD-VOICEQUEUEID':_0xa591a7['VoiceQueueId'],'XMD-DIALCHANNEL':_0x5b8b16,'XMD-DIALTIMEOUT':_0x59a761[_0xc096('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xc096('0x11')](_0xc096('0x1b'),_0x59a761['dialQueueProject2']?'g':'',_[_0xc096('0x10')](_0x59a761[_0xc096('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x59a761[_0xc096('0x1d')]||'','XMD-AGI':_0x59a761[_0xc096('0x1e')]?util[_0xc096('0x11')](_0xc096('0x1f'),ipAgi,_0x59a761[_0xc096('0x1e')]):_0xc096('0x20'),'XMD-AGIAFTER':_0x59a761[_0xc096('0x21')]?util[_0xc096('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x59a761['dialQueueProject2']):_0xc096('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x3e85fa?_0x3e85fa[_0xc096('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x3e85fa?_0x3e85fa[_0xc096('0x23')]:'','XMD-DESTINATION':_0xc096('0x24'),'SIPADDHEADER':_0xc096('0x25')};if(!_[_0xc096('0x10')](_0x59a761[_0xc096('0x1c')])){_0x171b04[util[_0xc096('0x11')]('%s',_0xc096('0x26'))]=_0x59a761['monitor_format'];_0x171b04[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1b8363;}if(_0xa591a7&&_0xa591a7[_0xc096('0x27')]){for(var _0x2f5409 in _0xa591a7['Contact']){if(_0xa591a7[_0xc096('0x27')]['hasOwnProperty'](_0x2f5409)){if(!_[_0xc096('0x14')](_0xa591a7['Contact'][_0x2f5409])&&_0x2f5409!=='id'&&_0x2f5409!=='tags'&&_0x2f5409!=='createdAt'&&_0x2f5409!=='updatedAt'){_0x171b04[util['format'](_0xc096('0x28'),_0xc096('0x29'),_[_0xc096('0x2a')](_0x2f5409))]=_0xa591a7[_0xc096('0x27')][_0x2f5409];}}}}return _0x171b04;};exports[_0xc096('0x2b')]=function(_0x1dc70b){var _0x390eac={};for(var _0x47ebdc in _0x1dc70b){if(_0x1dc70b[_0xc096('0x2c')](_0x47ebdc)){_0x390eac[util[_0xc096('0x11')]('%s',_[_0xc096('0x2d')](_0x47ebdc))]=_0x1dc70b[_0x47ebdc];}}return{'variables':_0x390eac};};exports[_0xc096('0x2e')]=function(_0x2760ec,_0x52a655){if(!_[_0xc096('0x14')](_0x2760ec)){if(_0x2760ec[_0xc096('0x2c')](_0xc096('0x2f'))){if(_0x2760ec['originated']>0x0){_0x2760ec[_0xc096('0x2f')]-=0x1;}else{logger[_0xc096('0x7')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x52a655);}}}else{logger['error'](_0xc096('0x30'),_0x52a655);}};exports[_0xc096('0x31')]=function(_0x314b89){var _0x27c0e8=moment()[_0xc096('0x11')](_0xc096('0x32'));_0x314b89[_0xc096('0x33')]=0xd;_0x314b89[_0xc096('0x34')]='Blacklist';_0x314b89[_0xc096('0x35')]=_0x27c0e8;_0x314b89['responsetime']=_0x27c0e8;_0x314b89[_0xc096('0x36')]=_0x27c0e8;};exports['logAgent']=function(_0x51f97c,_0x2e9f69,_0x150499){var _0x545800=moment()[_0xc096('0x11')](_0xc096('0x32'));_0x51f97c[_0xc096('0x33')]=_0x2e9f69;_0x51f97c['statedesc']=_0x150499;_0x51f97c[_0xc096('0x37')]=_0x545800;_0x51f97c[_0xc096('0x38')]=getSeconds(_0x51f97c[_0xc096('0x37')],_0x51f97c[_0xc096('0x35')]);};exports[_0xc096('0x39')]=function(_0x539435,_0x3d97d7,_0x517f48){_0x539435[_0xc096('0x3a')]=_0x3d97d7;_0x539435[_0xc096('0x3b')]=_0x517f48;};exports[_0xc096('0x3c')]=function(_0x15ea8f,_0x50e711,_0x1d1628){var _0x2fb5ae=moment()[_0xc096('0x11')](_0xc096('0x32'));_0x15ea8f[_0xc096('0x33')]=_0x50e711;_0x15ea8f[_0xc096('0x34')]=_0x1d1628;_0x15ea8f[_0xc096('0x37')]=_0x15ea8f['responsetime']?_0x15ea8f[_0xc096('0x37')]:_0x2fb5ae;_0x15ea8f[_0xc096('0x36')]=_0x15ea8f[_0xc096('0x36')]?_0x15ea8f['endtime']:_0x2fb5ae;_0x15ea8f['ringtime']=getSeconds(_0x15ea8f[_0xc096('0x37')]||0x0,_0x15ea8f[_0xc096('0x35')]||0x0);_0x15ea8f[_0xc096('0x3d')]=_0x15ea8f[_0xc096('0x3e')]?getSeconds(_0x15ea8f[_0xc096('0x36')],_0x15ea8f[_0xc096('0x3e')]):0x0;};exports[_0xc096('0x3f')]=function(_0xa2bc88){return _0xa2bc88===_0xc096('0x40');};exports[_0xc096('0x41')]=function(_0x5452c9,_0x29ceae,_0x29e90d,_0x2d78f2,_0x3ea5fc){var _0x32a18d=_0x2d78f2?_0xc096('0x42'):_0x5452c9[_0xc096('0x17')];_0x32a18d=_0x3ea5fc?'BOOKED':_0x32a18d;return{'actionid':_0x5452c9['uniqueid'],'action':_0xc096('0x43'),'channel':_0x5452c9[_0xc096('0x44')],'callerid':util['format'](_0xc096('0x12'),_0x32a18d,_0x5452c9['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xc096('0x45'),'Priority':'1','variable':_0x29e90d,'timeout':(_0x29ceae[_0xc096('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5452c9[_0xc096('0x47')]};};exports[_0xc096('0x48')]=function(_0x45c402){return _0x45c402[_0xc096('0x49')]+_0x45c402[_0xc096('0x4a')]+_0x45c402[_0xc096('0x4b')]+_0x45c402[_0xc096('0x4c')]+_0x45c402[_0xc096('0x4d')];};exports[_0xc096('0x4e')]=function(_0x10ebe2){var _0x40954e=_['clone'](_0x10ebe2);_0x40954e[_0xc096('0x33')]=0xf;_0x40954e[_0xc096('0x34')]=_0xc096('0x4f');return _0x40954e;};exports[_0xc096('0x50')]=function(_0x9527b3,_0x573717,_0x390011){var _0x3d261c={};_0x3d261c[_0x573717]=_0x9527b3[_0x573717];_0x3d261c[_0xc096('0x51')]=![];_0x3d261c[_0xc096('0x52')]=moment()[_0xc096('0x53')](_0x390011,_0xc096('0x54'))[_0xc096('0x11')](_0xc096('0x32'));_0x3d261c[_0xc096('0x19')]=_0x9527b3[_0xc096('0x19')];_0x3d261c[_0xc096('0x55')]=_0x9527b3[_0xc096('0x55')];_0x3d261c[_0xc096('0x56')]=_0x9527b3[_0xc096('0x56')]||undefined;return _0x3d261c;};exports[_0xc096('0x57')]=function(_0x50bcfc,_0x33c36e){if(!_[_0xc096('0x14')](_0x50bcfc)){if(_0x50bcfc[_0xc096('0x58')]>0x0){_0x50bcfc[_0xc096('0x58')]-=0x1;}else{logger[_0xc096('0x7')](_0x33c36e,_0xc096('0x59'));}}else{logger[_0xc096('0x7')](_0x33c36e,_0xc096('0x5a'));}};exports[_0xc096('0x5b')]=function(_0x16501b){if(_0x16501b<=0x0){return!![];}return![];};function buildObj(_0x36ee4a,_0x18d864,_0x4bcd98){_0x36ee4a['lastevent']=_0x18d864;_0x36ee4a[_0xc096('0x5c')]=_0x36ee4a[_0xc096('0x5d')];_0x36ee4a[_0xc096('0x5e')]=_0x36ee4a['channelAgent'];_0x36ee4a[_0xc096('0x5f')]='voice';if(_0x4bcd98){_0x36ee4a['mandatoryDisposition']=_0x4bcd98[_0xc096('0x60')];}return _0x36ee4a;}exports[_0xc096('0x61')]=buildObj;exports['buildAcw']=function(_0x3b7675){var _0x15ebde={};_0x15ebde[_0xc096('0x5d')]=_0x3b7675[_0xc096('0x5d')];_0x15ebde[_0xc096('0x5e')]=_0x3b7675[_0xc096('0x44')];_0x15ebde['uniqueid']=_0x3b7675[_0xc096('0x47')];return _0x15ebde;};exports[_0xc096('0x62')]=function(_0x1529ad){var _0x47349e=[];for(var _0x548e7f in _0x1529ad){if(_0x1529ad['hasOwnProperty'](_0x548e7f)){if(!_['isNil'](_0x1529ad[_0x548e7f])&&_0x1529ad[_0x548e7f][_0xc096('0x33')]===_0xc096('0x63')&&_0x1529ad[_0x548e7f][_0xc096('0x64')]===_0xc096('0x65')){_0x47349e[_0xc096('0x66')](_0x1529ad[_0x548e7f]['id']);}}}return _0x47349e;};exports[_0xc096('0x67')]=function(_0x375bd0){var _0x4c3b1c=moment()[_0xc096('0x6')](0x0);var _0x50ab59=moment(_0x375bd0)['milliseconds'](0x0);return _0x4c3b1c[_0xc096('0x68')](_0x50ab59,_0xc096('0x69'));};exports[_0xc096('0x6a')]=function(_0x35e7f8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x35e7f8[_0xc096('0x19')],'ListId':_0x35e7f8[_0xc096('0x55')],'VoiceQueueId':_0x35e7f8[_0xc096('0x56')]||undefined,'CampaignId':_0x35e7f8[_0xc096('0x6b')]||undefined};};exports[_0xc096('0x6c')]=function(_0x3438d5){if(_0x3438d5===_0xc096('0x47')||_0x3438d5===_0xc096('0x6d')||_0x3438d5===_0xc096('0x5d')||_0x3438d5===_0xc096('0x6e')||_0x3438d5===_0xc096('0x6f')||_0x3438d5===_0xc096('0x70')||_0x3438d5==='membername'||_0x3438d5===_0xc096('0x44')||_0x3438d5===_0xc096('0x17')||_0x3438d5==='active'||_0x3438d5===_0xc096('0x18')||_0x3438d5===_0xc096('0x52')||_0x3438d5==='countbusyretry'||_0x3438d5===_0xc096('0x4a')||_0x3438d5===_0xc096('0x4b')||_0x3438d5==='countglobal'||_0x3438d5===_0xc096('0x71')||_0x3438d5==='callbackuniqueid'||_0x3438d5===_0xc096('0x72')||_0x3438d5==='recallme'||_0x3438d5===_0xc096('0x19')||_0x3438d5===_0xc096('0x55')||_0x3438d5==='UserId'||_0x3438d5===_0xc096('0x56')||_0x3438d5===_0xc096('0x73')||_0x3438d5===_0xc096('0x74')||_0x3438d5===_0xc096('0x75')||_0x3438d5===_0xc096('0x76')||_0x3438d5===_0xc096('0x77')||_0x3438d5===_0xc096('0x78')||_0x3438d5===_0xc096('0x79')||_0x3438d5===_0xc096('0x7a')||_0x3438d5===_0xc096('0x7b')||_0x3438d5===_0xc096('0x7c')||_0x3438d5==='xmd-contactid'||_0x3438d5===_0xc096('0x7d')||_0x3438d5==='xmd-callerid'||_0x3438d5===_0xc096('0x7e')||_0x3438d5===_0xc096('0x7f')||_0x3438d5===_0xc096('0x80')||_0x3438d5==='rtpaudioqosbridged'||_0x3438d5==='rtpaudioqosjitter'||_0x3438d5===_0xc096('0x81')||_0x3438d5===_0xc096('0x82')||_0x3438d5===_0xc096('0x83')||_0x3438d5==='rtpaudioqosrtt'||_0x3438d5===_0xc096('0x84')||_0x3438d5===_0xc096('0x80')||_0x3438d5==='rtpaudioqosbridged'||_0x3438d5==='rtpaudioqosjitter'||_0x3438d5===_0xc096('0x81')||_0x3438d5===_0xc096('0x82')||_0x3438d5===_0xc096('0x83')||_0x3438d5===_0xc096('0x85')||_0x3438d5===_0xc096('0x84')||_0x3438d5===_0xc096('0x86')||_0x3438d5===_0xc096('0x87')||_0x3438d5==='state'||_0x3438d5===_0xc096('0x34')){return![];}return!![];};exports[_0xc096('0x88')]=function(_0x5d2041,_0x530e50){var _0x3c1f82,_0x243f2f,_0x51d2f7;if(_0x530e50<=0x0){_0x530e50=0x1;}_0x3c1f82=new RegExp('\x5cw{0,'+_0x530e50+'}$');_0x243f2f=Math[_0xc096('0x89')](0xa,_0x530e50-0x1);_0x51d2f7=Math['pow'](0xa,_0x530e50)-0x1;return util[_0xc096('0x11')]('%s',_[_0xc096('0x8a')](_0x5d2041,_0x3c1f82,_[_0xc096('0x8b')](_0x243f2f,_0x51d2f7)));};exports['extractCalleridName']=function(_0x30f67e){var _0xb9df35=_0x30f67e[_0xc096('0x8c')](/"(.*?)"/);return _0xb9df35?_0xb9df35[0x1]:_0x30f67e;};exports['extractCalleridNumber']=function(_0x42ef22){var _0x549f3a=_0x42ef22['match'](/<(.*?)>/);return _0x549f3a?_0x549f3a[0x1]:_0x42ef22;};function buildNoAnswerEventPayload(_0x1f493a,_0x242c86){var _0x19d576=buildObj(_0x1f493a,'noanswer');if(!_[_0xc096('0x10')](_0x242c86['variables'])){Object[_0xc096('0x8d')](_0x242c86[_0xc096('0x8e')])['forEach'](function(_0x572906){_0x19d576[_0x572906[_0xc096('0x8f')]()]=_0x242c86[_0xc096('0x8e')][_0x572906];});}return _0x19d576;}exports[_0xc096('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xa9eb=['diff','loggerCatch','inspect','logger','info','loggerError','error','logger2','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','responsetime','endtime','state','ringtime','logLookAgent','membername','UserId','logCustomer','answertime','isFailure','Failure','variablesAction','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','dialAnswer','calleridnum','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','buildNoAnswerEventPayload','util','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds'];(function(_0x58d808,_0x5e605d){var _0x3c9f9d=function(_0x32882d){while(--_0x32882d){_0x58d808['push'](_0x58d808['shift']());}};_0x3c9f9d(++_0x5e605d);}(_0xa9eb,0x1b3));var _0xba9e=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xa9eb[_0x1992f1];return _0x413dfe;};'use strict';var util=require(_0xba9e('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0xba9e('0x1'));var ipAgi=process[_0xba9e('0x2')][_0xba9e('0x3')]||_0xba9e('0x4');function getSeconds(_0x30d478,_0x3bb808){var _0x464273=moment(_0x30d478)[_0xba9e('0x5')](0x0);var _0x206477=moment(_0x3bb808)[_0xba9e('0x5')](0x0);return _0x464273[_0xba9e('0x6')](_0x206477,'seconds');}exports[_0xba9e('0x7')]=function(_0x1f050d){return function(_0x507fdf){logger['error'](_0x1f050d,util[_0xba9e('0x8')](_0x507fdf,{'showHidden':![],'depth':null}));};};exports[_0xba9e('0x9')]=function(_0x4f52df,_0x4f49c2){logger[_0xba9e('0xa')](_0x4f52df,util[_0xba9e('0x8')](_0x4f49c2,{'showHidden':![],'depth':null}));};exports[_0xba9e('0xb')]=function(_0x3f8500,_0x43a71d){logger[_0xba9e('0xc')](_0x3f8500,util[_0xba9e('0x8')](_0x43a71d,{'showHidden':![],'depth':null}));};exports[_0xba9e('0xd')]=function(_0x1913b6){return function(_0x4922c0){logger['info'](_0x1913b6,util[_0xba9e('0x8')](_0x4922c0,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2d3e9c,_0x50d6a7,_0x428c57){return{'message':_0x2d3e9c,'unlock':_0x50d6a7,'active':_0x428c57};};exports[_0xba9e('0xe')]=function(_0x71f83,_0x4d2f8d,_0x45a23e){if(!_['isUndefined'](_0x45a23e)&&_0xba9e('0xf')===typeof _0x45a23e&&!_[_0xba9e('0x10')](_0x45a23e)){if(!_['isUndefined'](_0x4d2f8d)&&'string'===typeof _0x4d2f8d&&!_[_0xba9e('0x10')](_0x4d2f8d)){return util[_0xba9e('0x11')](_0xba9e('0x12'),_0x4d2f8d,_0x45a23e);}return util[_0xba9e('0x11')](_0xba9e('0x12'),_0x45a23e,_0x45a23e);}if(!_['isUndefined'](_0x71f83)&&_0xba9e('0xf')===typeof _0x71f83&&!_[_0xba9e('0x10')](_0x71f83)){return _0x71f83;}return _0xba9e('0x13');};exports[_0xba9e('0x14')]=function(_0x44823b){if(_[_0xba9e('0x15')](_0x44823b)){return![];}return _0x44823b;};exports[_0xba9e('0x16')]=function(_0x3f41c1,_0x45e149,_0x32d768,_0x37ad81,_0x227b2c,_0x522898){var _0x4d480e={'XMD-QUEUE':_0x45e149[_0xba9e('0x17')]?_0x45e149[_0xba9e('0x17')]['name']:'','XMD-CALLERID':_0x37ad81,'XMD-CALLERID-PREVIEW':_0x522898?util[_0xba9e('0x11')](_0xba9e('0x12'),_0x522898[_0xba9e('0x18')],_0x522898['calleridnum']):_0x37ad81,'XMD-DIALID':_0x227b2c,'XMD-CONTACTID':_0x45e149[_0xba9e('0x19')],'XMD-CDRTYPE':_0xba9e('0x1a'),'CALLERID(all)':_0x37ad81,'XMD-VOICEQUEUEID':_0x45e149[_0xba9e('0x1b')],'XMD-DIALCHANNEL':_0x32d768,'XMD-DIALTIMEOUT':_0x3f41c1[_0xba9e('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x3f41c1[_0xba9e('0x1d')]?'g':'',_[_0xba9e('0x10')](_0x3f41c1['monitor_format'])?'':_0xba9e('0x1e')),'XMD-DIALURL':_0x3f41c1['dialPreviewUrl']||'','XMD-AGI':_0x3f41c1[_0xba9e('0x1f')]?util[_0xba9e('0x11')](_0xba9e('0x20'),ipAgi,_0x3f41c1['dialQueueProject']):_0xba9e('0x21'),'XMD-AGIAFTER':_0x3f41c1[_0xba9e('0x1d')]?util[_0xba9e('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3f41c1[_0xba9e('0x1d')]):_0xba9e('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x522898?_0x522898[_0xba9e('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x522898?_0x522898[_0xba9e('0x23')]:'','XMD-DESTINATION':_0xba9e('0x24'),'SIPADDHEADER':_0xba9e('0x25')};if(!_[_0xba9e('0x10')](_0x3f41c1['monitor_format'])){_0x4d480e[util[_0xba9e('0x11')]('%s',_0xba9e('0x26'))]=_0x3f41c1[_0xba9e('0x27')];_0x4d480e[util[_0xba9e('0x11')]('%s',_0xba9e('0x28'))]=_0x227b2c;}if(_0x45e149&&_0x45e149[_0xba9e('0x29')]){for(var _0x2769cd in _0x45e149[_0xba9e('0x29')]){if(_0x45e149[_0xba9e('0x29')][_0xba9e('0x2a')](_0x2769cd)){if(!_[_0xba9e('0x15')](_0x45e149[_0xba9e('0x29')][_0x2769cd])&&_0x2769cd!=='id'&&_0x2769cd!==_0xba9e('0x2b')&&_0x2769cd!=='createdAt'&&_0x2769cd!==_0xba9e('0x2c')){_0x4d480e[util[_0xba9e('0x11')](_0xba9e('0x2d'),'XMD-',_[_0xba9e('0x2e')](_0x2769cd))]=_0x45e149['Contact'][_0x2769cd];}}}}return _0x4d480e;};exports[_0xba9e('0x2f')]=function(_0x4b5ac3){var _0x2a8548={};for(var _0x4669f8 in _0x4b5ac3){if(_0x4b5ac3[_0xba9e('0x2a')](_0x4669f8)){_0x2a8548[util[_0xba9e('0x11')]('%s',_['toLower'](_0x4669f8))]=_0x4b5ac3[_0x4669f8];}}return{'variables':_0x2a8548};};exports[_0xba9e('0x30')]=function(_0x591c38,_0x42197f){if(!_[_0xba9e('0x15')](_0x591c38)){if(_0x591c38[_0xba9e('0x2a')](_0xba9e('0x31'))){if(_0x591c38[_0xba9e('0x31')]>0x0){_0x591c38[_0xba9e('0x31')]-=0x1;}else{logger[_0xba9e('0xc')](_0xba9e('0x32'),_0x42197f);}}}else{logger['error'](_0xba9e('0x33'),_0x42197f);}};exports[_0xba9e('0x34')]=function(_0x22975d){var _0x3ff686=moment()[_0xba9e('0x11')](_0xba9e('0x35'));_0x22975d['state']=0xd;_0x22975d[_0xba9e('0x36')]='Blacklist';_0x22975d[_0xba9e('0x37')]=_0x3ff686;_0x22975d[_0xba9e('0x38')]=_0x3ff686;_0x22975d[_0xba9e('0x39')]=_0x3ff686;};exports['logAgent']=function(_0x23ad8b,_0x5c7aa6,_0x2b84ee){var _0x3672f7=moment()['format'](_0xba9e('0x35'));_0x23ad8b[_0xba9e('0x3a')]=_0x5c7aa6;_0x23ad8b[_0xba9e('0x36')]=_0x2b84ee;_0x23ad8b[_0xba9e('0x38')]=_0x3672f7;_0x23ad8b[_0xba9e('0x3b')]=getSeconds(_0x23ad8b[_0xba9e('0x38')],_0x23ad8b[_0xba9e('0x37')]);};exports[_0xba9e('0x3c')]=function(_0x4b8142,_0x2aaeab,_0x4845fb){_0x4b8142[_0xba9e('0x3d')]=_0x2aaeab;_0x4b8142[_0xba9e('0x3e')]=_0x4845fb;};exports[_0xba9e('0x3f')]=function(_0xba2d70,_0x573719,_0x258e68){var _0x157e46=moment()['format'](_0xba9e('0x35'));_0xba2d70[_0xba9e('0x3a')]=_0x573719;_0xba2d70['statedesc']=_0x258e68;_0xba2d70[_0xba9e('0x38')]=_0xba2d70[_0xba9e('0x38')]?_0xba2d70[_0xba9e('0x38')]:_0x157e46;_0xba2d70[_0xba9e('0x39')]=_0xba2d70[_0xba9e('0x39')]?_0xba2d70[_0xba9e('0x39')]:_0x157e46;_0xba2d70[_0xba9e('0x3b')]=getSeconds(_0xba2d70[_0xba9e('0x38')]||0x0,_0xba2d70[_0xba9e('0x37')]||0x0);_0xba2d70['talktime']=_0xba2d70[_0xba9e('0x40')]?getSeconds(_0xba2d70[_0xba9e('0x39')],_0xba2d70['answertime']):0x0;};exports[_0xba9e('0x41')]=function(_0x4cf75f){return _0x4cf75f===_0xba9e('0x42');};exports[_0xba9e('0x43')]=function(_0x35e4d8,_0x45bc4e,_0x2829df,_0x2d3b32,_0x5d4aa0){var _0x567440=_0x2d3b32?'RECALL':_0x35e4d8['calleridname'];_0x567440=_0x5d4aa0?_0xba9e('0x44'):_0x567440;return{'actionid':_0x35e4d8['uniqueid'],'action':_0xba9e('0x45'),'channel':_0x35e4d8[_0xba9e('0x46')],'callerid':util[_0xba9e('0x11')](_0xba9e('0x12'),_0x567440,_0x35e4d8['calleridnum']),'Exten':_0xba9e('0x24'),'Context':_0xba9e('0x47'),'Priority':'1','variable':_0x2829df,'timeout':(_0x45bc4e[_0xba9e('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x35e4d8[_0xba9e('0x49')]};};exports[_0xba9e('0x4a')]=function(_0xc2dd53){return _0xc2dd53[_0xba9e('0x4b')]+_0xc2dd53['countcongestionretry']+_0xc2dd53[_0xba9e('0x4c')]+_0xc2dd53[_0xba9e('0x4d')]+_0xc2dd53[_0xba9e('0x4e')];};exports[_0xba9e('0x4f')]=function(_0xe29d12){var _0x4d8717=_[_0xba9e('0x50')](_0xe29d12);_0x4d8717[_0xba9e('0x3a')]=0xf;_0x4d8717[_0xba9e('0x36')]='Global';return _0x4d8717;};exports[_0xba9e('0x51')]=function(_0xe90feb,_0x5e6270,_0x484bee){var _0x1ba39e={};_0x1ba39e[_0x5e6270]=_0xe90feb[_0x5e6270];_0x1ba39e[_0xba9e('0x52')]=![];_0x1ba39e['scheduledat']=moment()[_0xba9e('0x53')](_0x484bee,_0xba9e('0x54'))[_0xba9e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ba39e[_0xba9e('0x19')]=_0xe90feb['ContactId'];_0x1ba39e[_0xba9e('0x55')]=_0xe90feb['ListId'];_0x1ba39e[_0xba9e('0x1b')]=_0xe90feb['VoiceQueueId']||undefined;return _0x1ba39e;};exports[_0xba9e('0x56')]=function(_0x364586,_0x209c85){if(!_[_0xba9e('0x15')](_0x364586)){if(_0x364586[_0xba9e('0x57')]>0x0){_0x364586[_0xba9e('0x57')]-=0x1;}else{logger[_0xba9e('0xc')](_0x209c85,_0xba9e('0x58'));}}else{logger['error'](_0x209c85,_0xba9e('0x59'));}};exports['IsNotLoggedIn']=function(_0x52b004){if(_0x52b004<=0x0){return!![];}return![];};function buildObj(_0x280c32,_0x5229c3,_0x17685a){_0x280c32[_0xba9e('0x5a')]=_0x5229c3;_0x280c32['name']=_0x280c32[_0xba9e('0x5b')];_0x280c32[_0xba9e('0x5c')]=_0x280c32['channelAgent'];_0x280c32[_0xba9e('0x5d')]='voice';if(_0x17685a){_0x280c32[_0xba9e('0x5e')]=_0x17685a['mandatoryDisposition'];}return _0x280c32;}exports[_0xba9e('0x5f')]=buildObj;exports[_0xba9e('0x60')]=function(_0x1ff830){var _0x39cb62={};_0x39cb62[_0xba9e('0x5b')]=_0x1ff830[_0xba9e('0x5b')];_0x39cb62[_0xba9e('0x5c')]=_0x1ff830[_0xba9e('0x46')];_0x39cb62[_0xba9e('0x49')]=_0x1ff830[_0xba9e('0x49')];return _0x39cb62;};exports[_0xba9e('0x61')]=function(_0x28d54c){var _0x468f42=[];for(var _0x3a42c8 in _0x28d54c){if(_0x28d54c[_0xba9e('0x2a')](_0x3a42c8)){if(!_[_0xba9e('0x15')](_0x28d54c[_0x3a42c8])&&_0x28d54c[_0x3a42c8][_0xba9e('0x3a')]===_0xba9e('0x62')&&_0x28d54c[_0x3a42c8][_0xba9e('0x63')]===_0xba9e('0x64')){_0x468f42[_0xba9e('0x65')](_0x28d54c[_0x3a42c8]['id']);}}}return _0x468f42;};exports[_0xba9e('0x66')]=function(_0x568320){var _0x3baf96=moment()[_0xba9e('0x5')](0x0);var _0x423250=moment(_0x568320)[_0xba9e('0x5')](0x0);return _0x3baf96[_0xba9e('0x6')](_0x423250,_0xba9e('0x67'));};exports[_0xba9e('0x68')]=function(_0x1cfd45){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1cfd45[_0xba9e('0x19')],'ListId':_0x1cfd45[_0xba9e('0x55')],'VoiceQueueId':_0x1cfd45[_0xba9e('0x1b')]||undefined,'CampaignId':_0x1cfd45[_0xba9e('0x69')]||undefined};};exports[_0xba9e('0x6a')]=function(_0x4e0b38){if(_0x4e0b38==='uniqueid'||_0x4e0b38===_0xba9e('0x6b')||_0x4e0b38===_0xba9e('0x5b')||_0x4e0b38===_0xba9e('0x6c')||_0x4e0b38==='campaigntype'||_0x4e0b38===_0xba9e('0x6d')||_0x4e0b38===_0xba9e('0x3d')||_0x4e0b38===_0xba9e('0x46')||_0x4e0b38===_0xba9e('0x18')||_0x4e0b38===_0xba9e('0x52')||_0x4e0b38===_0xba9e('0x6e')||_0x4e0b38==='scheduledat'||_0x4e0b38==='countbusyretry'||_0x4e0b38==='countcongestionretry'||_0x4e0b38===_0xba9e('0x4c')||_0x4e0b38===_0xba9e('0x6f')||_0x4e0b38==='callback'||_0x4e0b38===_0xba9e('0x70')||_0x4e0b38===_0xba9e('0x71')||_0x4e0b38===_0xba9e('0x72')||_0x4e0b38===_0xba9e('0x19')||_0x4e0b38===_0xba9e('0x55')||_0x4e0b38==='UserId'||_0x4e0b38===_0xba9e('0x1b')||_0x4e0b38===_0xba9e('0x73')||_0x4e0b38===_0xba9e('0x74')||_0x4e0b38===_0xba9e('0x75')||_0x4e0b38===_0xba9e('0x76')||_0x4e0b38==='xmd-listid'||_0x4e0b38==='xmd-dialurl'||_0x4e0b38===_0xba9e('0x77')||_0x4e0b38==='xmd-dialoptions'||_0x4e0b38===_0xba9e('0x78')||_0x4e0b38==='xmd-dialchannel'||_0x4e0b38===_0xba9e('0x79')||_0x4e0b38===_0xba9e('0x7a')||_0x4e0b38===_0xba9e('0x7b')||_0x4e0b38===_0xba9e('0x7c')||_0x4e0b38===_0xba9e('0x7d')||_0x4e0b38===_0xba9e('0x7e')||_0x4e0b38===_0xba9e('0x7f')||_0x4e0b38===_0xba9e('0x80')||_0x4e0b38===_0xba9e('0x81')||_0x4e0b38===_0xba9e('0x82')||_0x4e0b38===_0xba9e('0x83')||_0x4e0b38==='rtpaudioqosrtt'||_0x4e0b38===_0xba9e('0x84')||_0x4e0b38===_0xba9e('0x7e')||_0x4e0b38===_0xba9e('0x7f')||_0x4e0b38===_0xba9e('0x80')||_0x4e0b38===_0xba9e('0x81')||_0x4e0b38==='rtpaudioqosloss'||_0x4e0b38==='rtpaudioqoslossbridged'||_0x4e0b38===_0xba9e('0x85')||_0x4e0b38===_0xba9e('0x84')||_0x4e0b38===_0xba9e('0x86')||_0x4e0b38===_0xba9e('0x87')||_0x4e0b38===_0xba9e('0x3a')||_0x4e0b38===_0xba9e('0x36')){return![];}return!![];};exports[_0xba9e('0x88')]=function(_0xfee90b,_0x144db3){var _0x1470c0,_0x518690,_0x4ccf98;if(_0x144db3<=0x0){_0x144db3=0x1;}_0x1470c0=new RegExp(_0xba9e('0x89')+_0x144db3+'}$');_0x518690=Math[_0xba9e('0x8a')](0xa,_0x144db3-0x1);_0x4ccf98=Math[_0xba9e('0x8a')](0xa,_0x144db3)-0x1;return util[_0xba9e('0x11')]('%s',_[_0xba9e('0x8b')](_0xfee90b,_0x1470c0,_['random'](_0x518690,_0x4ccf98)));};exports[_0xba9e('0x8c')]=function(_0x1000ba){var _0x216074=_0x1000ba[_0xba9e('0x8d')](/"(.*?)"/);return _0x216074?_0x216074[0x1]:_0x1000ba;};exports[_0xba9e('0x8e')]=function(_0x33f182){var _0x3544b6=_0x33f182[_0xba9e('0x8d')](/<(.*?)>/);return _0x3544b6?_0x3544b6[0x1]:_0x33f182;};function buildNoAnswerEventPayload(_0x387670,_0x10a04f){var _0x331430=buildObj(_0x387670,'noanswer');if(!_[_0xba9e('0x10')](_0x10a04f[_0xba9e('0x8f')])){Object[_0xba9e('0x90')](_0x10a04f[_0xba9e('0x8f')])[_0xba9e('0x91')](function(_0x154228){_0x331430[_0x154228['toLowerCase']()]=_0x10a04f[_0xba9e('0x8f')][_0x154228];});}return _0x331430;}exports[_0xba9e('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ac0f6fa..3160270 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 _0x0dd6=['number','boolean','queuepause','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x571852,_0x34ae1f){var _0x1ec365=function(_0x398fe5){while(--_0x398fe5){_0x571852['push'](_0x571852['shift']());}};_0x1ec365(++_0x34ae1f);}(_0x0dd6,0x196));var _0x60dd=function(_0x3e9fdb,_0x40622){_0x3e9fdb=_0x3e9fdb-0x0;var _0xf847c4=_0x0dd6[_0x3e9fdb];return _0xf847c4;};'use strict';exports[_0x60dd('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x60dd('0x1'),'required':!![]},'membername':{'type':_0x60dd('0x1'),'required':!![]},'penalty':{'type':_0x60dd('0x2'),'required':![]},'paused':{'type':_0x60dd('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x60dd('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x60dd('0x4')]={'interface':{'type':_0x60dd('0x1'),'required':!![]},'paused':{'type':_0x60dd('0x3')},'reason':{'type':_0x60dd('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x60dd('0x5')]={'uniqueid':{'type':_0x60dd('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x60dd('0x1')},'mixmonitorid':{'type':_0x60dd('0x1')}};exports[_0x60dd('0x6')]={'uniqueid':{'type':_0x60dd('0x1'),'required':!![]}};exports[_0x60dd('0x7')]={'uniqueid':{'type':_0x60dd('0x1'),'required':!![]},'exten':{'type':_0x60dd('0x1'),'required':!![]},'context':{'type':_0x60dd('0x1')}}; \ No newline at end of file +var _0x8cbd=['string','number','boolean','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x8cbd,0x179));var _0xd8cb=function(_0x3fec22,_0x2b4645){_0x3fec22=_0x3fec22-0x0;var _0x402df5=_0x8cbd[_0x3fec22];return _0x402df5;};'use strict';exports[_0xd8cb('0x0')]={'queue':{'type':_0xd8cb('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xd8cb('0x1'),'required':!![]},'penalty':{'type':_0xd8cb('0x2'),'required':![]},'paused':{'type':_0xd8cb('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xd8cb('0x1'),'required':!![]},'interface':{'type':_0xd8cb('0x1'),'required':!![]}};exports[_0xd8cb('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xd8cb('0x3')},'reason':{'type':_0xd8cb('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xd8cb('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xd8cb('0x6')]={'uniqueid':{'type':_0xd8cb('0x1'),'required':!![]},'filename':{'type':_0xd8cb('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xd8cb('0x1')}};exports[_0xd8cb('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xd8cb('0x8')]={'uniqueid':{'type':_0xd8cb('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xd8cb('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 7de7ec2..8961590 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 _0xc5c8=['faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','total','answered','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initAgents','agents','length','interface','isUndefined','initTelephones','voiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','uniqueid','queue','queuecallerabandon','diff','seconds','sumDuration','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','outbound','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','util','lodash','moment','../model/telephone','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','telephones','trunks','campaigns','templates','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','freshsalesAccounts'];(function(_0x3d5859,_0x1be169){var _0xce6e80=function(_0xa16cb5){while(--_0xa16cb5){_0x3d5859['push'](_0x3d5859['shift']());}};_0xce6e80(++_0x1be169);}(_0xc5c8,0x118));var _0x8c5c=function(_0x20dd26,_0x2b0c02){_0x20dd26=_0x20dd26-0x0;var _0x5f2bed=_0xc5c8[_0x20dd26];return _0x5f2bed;};'use strict';var util=require(_0x8c5c('0x0'));var _=require(_0x8c5c('0x1'));var moment=require(_0x8c5c('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x8c5c('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x8c5c('0x4'));var Template=require(_0x8c5c('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x8c5c('0x6'));var ZendeskAccount=require(_0x8c5c('0x7'));var SalesforceAccount=require(_0x8c5c('0x8'));var FreshdeskAccount=require(_0x8c5c('0x9'));var SugarcrmAccount=require(_0x8c5c('0xa'));var ZohoAccount=require(_0x8c5c('0xb'));var DeskAccount=require(_0x8c5c('0xc'));var VtigerAccount=require(_0x8c5c('0xd'));var ServicenowAccount=require(_0x8c5c('0xe'));var Dynamics365Account=require(_0x8c5c('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0x8c5c('0x10')]={};this[_0x8c5c('0x11')]={};this['voiceQueues']={};this['triggers']={};this[_0x8c5c('0x12')]={};this[_0x8c5c('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x8c5c('0x14')]={};this[_0x8c5c('0x15')]={};this['outboundChannels']={};this['timers']={};this[_0x8c5c('0x16')]={};this[_0x8c5c('0x17')]={};this[_0x8c5c('0x18')]={};this['sugarcrmAccounts']={};this[_0x8c5c('0x19')]={};this[_0x8c5c('0x1a')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0x8c5c('0x1b')]={};this['dynamics365Accounts']={};this[_0x8c5c('0x1c')]={};this[_0x8c5c('0x1d')]={};};function freeIsNotKey(_0x2e820a,_0x3a3104,_0x535bb0){var _0x32e5cb=_[_0x8c5c('0x1e')](_0x2e820a,function(_0x107835,_0x189ddb){return _0x107835[_0x535bb0];});for(var _0x10614e in _0x3a3104){if(_0x3a3104['hasOwnProperty'](_0x10614e)){if(!_0x32e5cb[_0x10614e]){delete _0x3a3104[_0x10614e];}}}}function freeIsNotKeySip(_0x5d8dd3,_0x51ff6b){var _0x56a434=_[_0x8c5c('0x1e')](_0x5d8dd3,function(_0x53c6ad,_0x2c1e97){return util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x53c6ad[_0x8c5c('0x21')]);});for(var _0x21d0de in _0x51ff6b){if(_0x51ff6b[_0x8c5c('0x22')](_0x21d0de)){if(!_0x56a434[_0x21d0de]){delete _0x51ff6b[_0x21d0de];}}}}function freeIsNotKeyAgent(_0xc174a4,_0xac22f9){var _0x4a6618=_[_0x8c5c('0x1e')](_0xc174a4,function(_0x542b61,_0x2f3ef3){var _0x34f24e=_[_0x8c5c('0x23')](_0x542b61['interface'])?util[_0x8c5c('0x1f')]('SIP/%s',_0x542b61['name']):_0x542b61['interface'];return _0x34f24e;});for(var _0x32a426 in _0xac22f9){if(_0xac22f9[_0x8c5c('0x22')](_0x32a426)){if(!_0x4a6618[_0x32a426]){delete _0xac22f9[_0x32a426];}}}}function clearVoiceCallReports(_0x19389f){_0x19389f[_0x8c5c('0x24')]=0x0;_0x19389f[_0x8c5c('0x25')]=0x0;_0x19389f['sumHoldTime']=0x0;_0x19389f['sumDuration']=0x0;_0x19389f['sumBillable']=0x0;}function clearCampaigns(_0x19820f){if(!_[_0x8c5c('0x26')](_0x19820f)){for(var _0x2fc2f7 in _0x19820f){if(_0x19820f[_0x8c5c('0x22')](_0x2fc2f7)){_0x19820f[_0x2fc2f7][_0x8c5c('0x27')]=0x0;_0x19820f[_0x2fc2f7][_0x8c5c('0x28')]=0x0;}}}}function clearVoiceQueues(_0x40057e){if(!_[_0x8c5c('0x26')](_0x40057e)){for(var _0x140c21 in _0x40057e){if(_0x40057e[_0x8c5c('0x22')](_0x140c21)){_0x40057e[_0x140c21][_0x8c5c('0x24')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x25')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x29')]=0x0;_0x40057e[_0x140c21]['abandoned']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2a')]=0x0;_0x40057e[_0x140c21]['sumDuration']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2b')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2c')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2d')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2e')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2f')]=0x0;_0x40057e[_0x140c21]['outboundNoSuchCallsDay']=0x0;_0x40057e[_0x140c21]['outboundUnknownCallsDay']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x30')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x31')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x32')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x33')]=0x0;_0x40057e[_0x140c21]['outboundRejectCallsDay']=0x0;_0x40057e[_0x140c21][_0x8c5c('0x34')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x2c')]=0x0;_0x40057e[_0x140c21][_0x8c5c('0x35')]=0x0;_0x40057e[_0x140c21]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x8c5c('0x36')]=function(_0x5a8d42,_0x402404){for(var _0x184c34 in _0x402404){if(_0x5a8d42['hasOwnProperty'](_0x184c34)){_0x5a8d42[_0x184c34]=_0x402404[_0x184c34];}}};Realtime[_0x8c5c('0x37')][_0x8c5c('0x38')]=function(){var _0x15fddb=this;return function(_0x39d054){if(_0x39d054){freeIsNotKeyAgent(_0x39d054,_0x15fddb[_0x8c5c('0x39')]);for(var _0xc2c85c=0x0,_0x5e6f23={},_0x20bc66={};_0xc2c85c<_0x39d054[_0x8c5c('0x3a')];_0xc2c85c+=0x1){_0x5e6f23=_0x39d054[_0xc2c85c];var _0x161313=_[_0x8c5c('0x23')](_0x5e6f23[_0x8c5c('0x3b')])?util[_0x8c5c('0x1f')]('SIP/%s',_0x5e6f23[_0x8c5c('0x21')]):_0x5e6f23[_0x8c5c('0x3b')];if(_[_0x8c5c('0x3c')](_0x15fddb['agents'][_0x161313])){_0x15fddb[_0x8c5c('0x39')][_0x161313]=new Agent(_0x5e6f23);}else{_0x15fddb[_0x8c5c('0x36')](_0x15fddb[_0x8c5c('0x39')][_0x161313],_0x5e6f23);}}}return _0x15fddb[_0x8c5c('0x39')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x3d')]=function(){var _0x2d9273=this;return function(_0x91c4dd){if(_0x91c4dd){freeIsNotKeySip(_0x91c4dd,_0x2d9273[_0x8c5c('0x10')]);for(var _0x1098fb=0x0,_0x52c12b={},_0x163054={};_0x1098fb<_0x91c4dd[_0x8c5c('0x3a')];_0x1098fb+=0x1){_0x52c12b=_0x91c4dd[_0x1098fb];if(_[_0x8c5c('0x3c')](_0x2d9273[_0x8c5c('0x10')][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x52c12b['name'])])){_0x2d9273[_0x8c5c('0x10')][util[_0x8c5c('0x1f')]('SIP/%s',_0x52c12b[_0x8c5c('0x21')])]=new Telephone(_0x52c12b);}else{_0x2d9273['mergeFromDatabase'](_0x2d9273['telephones'][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x52c12b['name'])],_0x52c12b);}}}return _0x2d9273[_0x8c5c('0x10')];};};Realtime[_0x8c5c('0x37')]['initTrunks']=function(){var _0xbcc60c=this;return function(_0x3fa3f1){if(_0x3fa3f1){freeIsNotKeySip(_0x3fa3f1,_0xbcc60c[_0x8c5c('0x11')]);for(var _0x120182=0x0,_0x196fdc={},_0x834a33={};_0x120182<_0x3fa3f1[_0x8c5c('0x3a')];_0x120182+=0x1){_0x196fdc=_0x3fa3f1[_0x120182];if(_['isUndefined'](_0xbcc60c[_0x8c5c('0x11')][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x196fdc['name'])])){_0xbcc60c['trunks'][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x196fdc[_0x8c5c('0x21')])]=new Trunk(_0x196fdc);}else{_0xbcc60c['mergeFromDatabase'](_0xbcc60c[_0x8c5c('0x11')][util[_0x8c5c('0x1f')](_0x8c5c('0x20'),_0x196fdc['name'])],_0x196fdc);}}}return _0xbcc60c[_0x8c5c('0x11')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x238e24=this;return function(_0x5818a8){if(_0x5818a8){freeIsNotKey(_0x5818a8,_0x238e24[_0x8c5c('0x3e')],'name');for(var _0x3a7847=0x0,_0x1e00ba={},_0x31c52d={};_0x3a7847<_0x5818a8[_0x8c5c('0x3a')];_0x3a7847+=0x1){_0x1e00ba=_0x5818a8[_0x3a7847];if(_['isUndefined'](_0x238e24[_0x8c5c('0x3e')][_0x1e00ba['name']])){_0x238e24['voiceQueues'][_0x1e00ba['name']]=new VoiceQueue(_0x1e00ba);}else{_0x238e24[_0x8c5c('0x36')](_0x238e24[_0x8c5c('0x3e')][_0x1e00ba[_0x8c5c('0x21')]],_0x1e00ba);}}}return _0x238e24[_0x8c5c('0x3e')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x3f')]=function(){var _0x538bd9=this;return function(_0x44f33e){if(_0x44f33e){freeIsNotKey(_0x44f33e,_0x538bd9['triggers'],'id');for(var _0x222809=0x0,_0x3d2571={},_0x189938={};_0x222809<_0x44f33e[_0x8c5c('0x3a')];_0x222809+=0x1){_0x3d2571=_0x44f33e[_0x222809];if(_[_0x8c5c('0x3c')](_0x538bd9['triggers'][_0x3d2571['id']])){_0x538bd9[_0x8c5c('0x40')][_0x3d2571['id']]=new Trigger(_0x3d2571);}else{_0x538bd9[_0x8c5c('0x36')](_0x538bd9[_0x8c5c('0x40')][_0x3d2571['id']],_0x3d2571);}}}return _0x538bd9[_0x8c5c('0x40')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x41')]=function(){var _0x3ea922=this;return function(_0x173b8c){if(_0x173b8c){freeIsNotKey(_0x173b8c,_0x3ea922['templates'],'id');for(var _0x5f199f=0x0,_0x5d269d={},_0x338208={};_0x5f199f<_0x173b8c[_0x8c5c('0x3a')];_0x5f199f+=0x1){_0x5d269d=_0x173b8c[_0x5f199f];if(_[_0x8c5c('0x3c')](_0x3ea922['templates'][_0x5d269d['id']])){_0x3ea922[_0x8c5c('0x13')][_0x5d269d['id']]=new Template(_0x5d269d);}else{_0x3ea922[_0x8c5c('0x36')](_0x3ea922['templates'][_0x5d269d['id']],_0x5d269d);}}}return _0x3ea922[_0x8c5c('0x13')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x42')]=function(){var _0xae8f89=this;return function(_0x3fe87c){if(_0x3fe87c){freeIsNotKey(_0x3fe87c,_0xae8f89['zendeskAccounts'],'id');for(var _0xb1ef34=0x0,_0x141c60={},_0xdfb51d={};_0xb1ef34<_0x3fe87c[_0x8c5c('0x3a')];_0xb1ef34+=0x1){_0x141c60=_0x3fe87c[_0xb1ef34];if(_[_0x8c5c('0x3c')](_0xae8f89[_0x8c5c('0x17')][_0x141c60['id']])){_0xae8f89[_0x8c5c('0x17')][_0x141c60['id']]=new ZendeskAccount(_0x141c60);}else{_0xae8f89[_0x8c5c('0x36')](_0xae8f89[_0x8c5c('0x17')][_0x141c60['id']],_0x141c60);}}}return _0xae8f89[_0x8c5c('0x17')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x43')]=function(){var _0x354685=this;return function(_0x8a22df){if(_0x8a22df){freeIsNotKey(_0x8a22df,_0x354685[_0x8c5c('0x18')],'id');for(var _0x54a967=0x0,_0x321acf={},_0x51da3d={};_0x54a967<_0x8a22df[_0x8c5c('0x3a')];_0x54a967+=0x1){_0x321acf=_0x8a22df[_0x54a967];if(_[_0x8c5c('0x3c')](_0x354685['salesforceAccounts'][_0x321acf['id']])){_0x354685[_0x8c5c('0x18')][_0x321acf['id']]=new SalesforceAccount(_0x321acf);}else{_0x354685[_0x8c5c('0x36')](_0x354685[_0x8c5c('0x18')][_0x321acf['id']],_0x321acf);}}}return _0x354685[_0x8c5c('0x18')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x44')]=function(){var _0x11b2b1=this;return function(_0x3a689f){if(_0x3a689f){freeIsNotKey(_0x3a689f,_0x11b2b1['freshdeskAccounts'],'id');for(var _0x2d1050=0x0,_0x4ea6b4={},_0x23d412={};_0x2d1050<_0x3a689f[_0x8c5c('0x3a')];_0x2d1050+=0x1){_0x4ea6b4=_0x3a689f[_0x2d1050];if(_[_0x8c5c('0x3c')](_0x11b2b1[_0x8c5c('0x19')][_0x4ea6b4['id']])){_0x11b2b1['freshdeskAccounts'][_0x4ea6b4['id']]=new FreshdeskAccount(_0x4ea6b4);}else{_0x11b2b1[_0x8c5c('0x36')](_0x11b2b1[_0x8c5c('0x19')][_0x4ea6b4['id']],_0x4ea6b4);}}}return _0x11b2b1[_0x8c5c('0x19')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x45')]=function(){var _0x233347=this;return function(_0x4c531e){if(_0x4c531e){freeIsNotKey(_0x4c531e,_0x233347[_0x8c5c('0x1a')],'id');for(var _0x5e0bde=0x0,_0x5d5141={},_0x30c11d={};_0x5e0bde<_0x4c531e[_0x8c5c('0x3a')];_0x5e0bde+=0x1){_0x5d5141=_0x4c531e[_0x5e0bde];if(_[_0x8c5c('0x3c')](_0x233347[_0x8c5c('0x1a')][_0x5d5141['id']])){_0x233347[_0x8c5c('0x1a')][_0x5d5141['id']]=new ZohoAccount(_0x5d5141);}else{_0x233347[_0x8c5c('0x36')](_0x233347['zohoAccounts'][_0x5d5141['id']],_0x5d5141);}}}return _0x233347[_0x8c5c('0x1a')];};};Realtime['prototype'][_0x8c5c('0x46')]=function(){var _0x3a483e=this;return function(_0x283474){if(_0x283474){freeIsNotKey(_0x283474,_0x3a483e[_0x8c5c('0x47')],'id');for(var _0x1dab40=0x0,_0x4fdab7={},_0x522b3a={};_0x1dab40<_0x283474[_0x8c5c('0x3a')];_0x1dab40+=0x1){_0x4fdab7=_0x283474[_0x1dab40];if(_[_0x8c5c('0x3c')](_0x3a483e[_0x8c5c('0x47')][_0x4fdab7['id']])){_0x3a483e['deskAccounts'][_0x4fdab7['id']]=new DeskAccount(_0x4fdab7);}else{_0x3a483e['mergeFromDatabase'](_0x3a483e[_0x8c5c('0x47')][_0x4fdab7['id']],_0x4fdab7);}}}return _0x3a483e[_0x8c5c('0x47')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x54b872=this;return function(_0x2dd1e3){if(_0x2dd1e3){freeIsNotKey(_0x2dd1e3,_0x54b872[_0x8c5c('0x48')],'id');for(var _0x218bb4=0x0,_0x2b6c24={},_0x5dcd19={};_0x218bb4<_0x2dd1e3['length'];_0x218bb4+=0x1){_0x2b6c24=_0x2dd1e3[_0x218bb4];if(_[_0x8c5c('0x3c')](_0x54b872[_0x8c5c('0x48')][_0x2b6c24['id']])){_0x54b872['sugarcrmAccounts'][_0x2b6c24['id']]=new SugarcrmAccount(_0x2b6c24);}else{_0x54b872[_0x8c5c('0x36')](_0x54b872[_0x8c5c('0x48')][_0x2b6c24['id']],_0x2b6c24);}}}return _0x54b872[_0x8c5c('0x48')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x49')]=function(){var _0x3701de=this;return function(_0x630905){if(_0x630905){freeIsNotKey(_0x630905,_0x3701de[_0x8c5c('0x4a')],'id');for(var _0x880686=0x0,_0x2e8420={},_0x3c27f4={};_0x880686<_0x630905[_0x8c5c('0x3a')];_0x880686+=0x1){_0x2e8420=_0x630905[_0x880686];if(_[_0x8c5c('0x3c')](_0x3701de[_0x8c5c('0x4a')][_0x2e8420['id']])){_0x3701de['vtigerAccounts'][_0x2e8420['id']]=new VtigerAccount(_0x2e8420);}else{_0x3701de['mergeFromDatabase'](_0x3701de[_0x8c5c('0x4a')][_0x2e8420['id']],_0x2e8420);}}}return _0x3701de[_0x8c5c('0x4a')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x4b')]=function(){var _0x3d13f2=this;return function(_0x305566){if(_0x305566){freeIsNotKey(_0x305566,_0x3d13f2['servicenowAccounts'],'id');for(var _0x2803be=0x0,_0x41cded={},_0x355952={};_0x2803be<_0x305566[_0x8c5c('0x3a')];_0x2803be+=0x1){_0x41cded=_0x305566[_0x2803be];if(_['isUndefined'](_0x3d13f2[_0x8c5c('0x1b')][_0x41cded['id']])){_0x3d13f2[_0x8c5c('0x1b')][_0x41cded['id']]=new ServicenowAccount(_0x41cded);}else{_0x3d13f2[_0x8c5c('0x36')](_0x3d13f2['servicenowAccounts'][_0x41cded['id']],_0x41cded);}}}return _0x3d13f2['servicenowAccounts'];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x4c')]=function(){var _0x482cfd=this;return function(_0x2ac4e7){if(_0x2ac4e7){freeIsNotKey(_0x2ac4e7,_0x482cfd[_0x8c5c('0x4d')],'id');for(var _0x29df6f=0x0,_0x47aaf0={},_0x1bc68d={};_0x29df6f<_0x2ac4e7['length'];_0x29df6f+=0x1){_0x47aaf0=_0x2ac4e7[_0x29df6f];if(_['isUndefined'](_0x482cfd[_0x8c5c('0x4d')][_0x47aaf0['id']])){_0x482cfd['dynamics365Accounts'][_0x47aaf0['id']]=new Dynamics365Account(_0x47aaf0);}else{_0x482cfd[_0x8c5c('0x36')](_0x482cfd[_0x8c5c('0x4d')][_0x47aaf0['id']],_0x47aaf0);}}}return _0x482cfd[_0x8c5c('0x4d')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x4e')]=function(){var _0x1af882=this;return function(_0x283577){if(_0x283577){freeIsNotKey(_0x283577,_0x1af882[_0x8c5c('0x1c')],'id');for(var _0x3098e0=0x0,_0x5a2483={},_0x10d926={};_0x3098e0<_0x283577[_0x8c5c('0x3a')];_0x3098e0+=0x1){_0x5a2483=_0x283577[_0x3098e0];if(_[_0x8c5c('0x3c')](_0x1af882[_0x8c5c('0x1c')][_0x5a2483['id']])){_0x1af882['freshsalesAccounts'][_0x5a2483['id']]=new FreshsalesAccount(_0x5a2483);}else{_0x1af882['mergeFromDatabase'](_0x1af882[_0x8c5c('0x1c')][_0x5a2483['id']],_0x5a2483);}}}return _0x1af882[_0x8c5c('0x1c')];};};Realtime['prototype'][_0x8c5c('0x4f')]=function(){var _0x307f8c=this;return function(_0x2ae638){for(var _0x5a851b=0x0;_0x5a851b<_0x2ae638['length'];_0x5a851b+=0x1){_['merge'](_0x307f8c[_0x8c5c('0x3e')][_0x2ae638[_0x5a851b][_0x8c5c('0x21')]],_0x2ae638[_0x5a851b]);}return _0x307f8c[_0x8c5c('0x3e')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0xc0129a=this;return function(_0x3f4c05){clearVoiceQueues(_0xc0129a[_0x8c5c('0x3e')]);if(_0x3f4c05){_0x3f4c05=_['groupBy'](_0x3f4c05,_0x8c5c('0x50'));for(var _0xfd5319 in _0x3f4c05){if(_0x3f4c05['hasOwnProperty'](_0xfd5319)){var _0x193c42={};for(var _0x9eea0d=0x0;_0x9eea0d<_0x3f4c05[_0xfd5319][_0x8c5c('0x3a')];_0x9eea0d+=0x1){var _0x555682=_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x51')];if(_0xc0129a[_0x8c5c('0x3e')][_0x555682]){if(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerexit']){_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x29')]+=0x1;}if(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x52')]){_0xc0129a['voiceQueues'][_0x555682]['abandoned']+=0x1;}_0xc0129a['voiceQueues'][_0x555682][_0x8c5c('0x2a')]+=moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerleaveAt'])[_0x8c5c('0x53')](moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerjoinAt']),_0x8c5c('0x54'))||0x0;if(_0x9eea0d===_0x3f4c05[_0xfd5319][_0x8c5c('0x3a')]-0x1){_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x55')]+=moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallercompleteAt']||_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x56')]||_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerexitAt'])[_0x8c5c('0x53')](moment(_0x3f4c05[_0xfd5319][_0x9eea0d]['queuecallerjoinAt']),'seconds')||0x0;_0xc0129a['voiceQueues'][_0x555682][_0x8c5c('0x24')]+=0x1;if(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x57')]){_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x25')]+=0x1;_0xc0129a[_0x8c5c('0x3e')][_0x555682]['sumBillable']+=moment(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x58')])[_0x8c5c('0x53')](moment(_0x3f4c05[_0xfd5319][_0x9eea0d][_0x8c5c('0x59')]),'seconds')||0x0;}}else{_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x55')]+=_0xc0129a[_0x8c5c('0x3e')][_0x555682][_0x8c5c('0x2a')]||0x0;}}}}}}return _0xc0129a[_0x8c5c('0x3e')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x5a')]=function(){var _0x14f334=this;return function(_0x1bbb76){clearVoiceCallReports(_0x14f334[_0x8c5c('0x5b')]);if(_0x1bbb76){for(var _0x504825=0x0;_0x504825<_0x1bbb76[_0x8c5c('0x3a')];_0x504825+=0x1){_0x14f334[_0x8c5c('0x5b')][_0x8c5c('0x24')]+=0x1;_0x14f334['outbound'][_0x8c5c('0x55')]+=_0x1bbb76[_0x504825][_0x8c5c('0x5c')];if(_0x1bbb76[_0x504825]['disposition']===_0x8c5c('0x5d')){_0x14f334[_0x8c5c('0x5b')]['answered']+=0x1;_0x14f334[_0x8c5c('0x5b')][_0x8c5c('0x2a')]+=_0x1bbb76[_0x504825][_0x8c5c('0x5c')]-_0x1bbb76[_0x504825][_0x8c5c('0x5e')]||0x0;_0x14f334[_0x8c5c('0x5b')]['sumBillable']+=_0x1bbb76[_0x504825][_0x8c5c('0x5e')];}}}return _0x14f334[_0x8c5c('0x5b')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x5f')]=function(){var _0x2d6568=this;return function(_0xcf14bf){if(_0xcf14bf){freeIsNotKey(_0xcf14bf,_0x2d6568[_0x8c5c('0x12')],_0x8c5c('0x21'));for(var _0x3735d0=0x0,_0x468b11={};_0x3735d0<_0xcf14bf[_0x8c5c('0x3a')];_0x3735d0+=0x1){_0x468b11=_0xcf14bf[_0x3735d0];if(_['isUndefined'](_0x2d6568[_0x8c5c('0x12')][_0x468b11[_0x8c5c('0x21')]])){_0x2d6568['campaigns'][_0x468b11[_0x8c5c('0x21')]]=new Campaign(_0x468b11);}else{_0x2d6568['mergeFromDatabase'](_0x2d6568[_0x8c5c('0x12')][_0x468b11[_0x8c5c('0x21')]],_0x468b11);_0x2d6568[_0x8c5c('0x12')][_0x468b11['name']][_0x8c5c('0x60')]=_0x468b11['SquareProject']?_0x468b11[_0x8c5c('0x61')]['name']:undefined;}}}return _0x2d6568['campaigns'];};};Realtime['prototype'][_0x8c5c('0x62')]=function(){var _0x32e2ed=this;return function(_0x5800c4){if(_0x5800c4){freeIsNotKey(_0x5800c4,_0x32e2ed['voiceExtensions'],'id');for(var _0x56512f=0x0,_0x1ba8c8={};_0x56512f<_0x5800c4['length'];_0x56512f+=0x1){_0x1ba8c8=_0x5800c4[_0x56512f];if(_['isUndefined'](_0x32e2ed[_0x8c5c('0x63')][_0x1ba8c8['id']])){_0x32e2ed[_0x8c5c('0x63')][_0x1ba8c8['id']]=new VoiceExtension(_0x1ba8c8);}else{_0x32e2ed[_0x8c5c('0x36')](_0x32e2ed[_0x8c5c('0x63')][_0x1ba8c8['id']],_0x1ba8c8);}}}return _0x32e2ed[_0x8c5c('0x63')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x64')]=function(){var _0x1c0e37=this;return function(_0x2fb27d){clearCampaigns(_0x1c0e37[_0x8c5c('0x12')]);for(var _0x5c214d=0x0;_0x5c214d<_0x2fb27d[_0x8c5c('0x3a')];_0x5c214d+=0x1){_[_0x8c5c('0x65')](_0x1c0e37[_0x8c5c('0x12')][_0x2fb27d[_0x5c214d]['name']],_0x2fb27d[_0x5c214d]);}return _0x1c0e37[_0x8c5c('0x12')];};};Realtime[_0x8c5c('0x37')][_0x8c5c('0x66')]=function(){var _0x36faa2=this;return function(_0x4a1b3e){if(_0x4a1b3e){freeIsNotKey(_0x4a1b3e,_0x36faa2[_0x8c5c('0x1d')],'id');for(var _0x5c87f1=0x0,_0x242e23={},_0xf1daf1={};_0x5c87f1<_0x4a1b3e['length'];_0x5c87f1+=0x1){_0x242e23=_0x4a1b3e[_0x5c87f1];if(_[_0x8c5c('0x3c')](_0x36faa2[_0x8c5c('0x1d')][_0x242e23['id']])){_0x36faa2[_0x8c5c('0x1d')][_0x242e23['id']]=new FaxAccount(_0x242e23);}else{_0x36faa2[_0x8c5c('0x36')](_0x36faa2[_0x8c5c('0x1d')][_0x242e23['id']],_0x242e23);}}}return _0x36faa2[_0x8c5c('0x1d')];};};module['exports']=Realtime; \ No newline at end of file +var _0xb2b0=['duration','ANSWERED','billableseconds','campaigns','SquareProject','initVoiceExtensions','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','outbound','voiceExtensions','channels','outboundChannels','timers','settings','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','format','name','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isNil','SIP/%s','isUndefined','mergeFromDatabase','initTelephones','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','sumDuration','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0xb2b0,0x72));var _0x0b2b=function(_0x520265,_0x2ab208){_0x520265=_0x520265-0x0;var _0x44e175=_0xb2b0[_0x520265];return _0x44e175;};'use strict';var util=require(_0x0b2b('0x0'));var _=require(_0x0b2b('0x1'));var moment=require(_0x0b2b('0x2'));var Agent=require(_0x0b2b('0x3'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x0b2b('0x4'));var Trigger=require(_0x0b2b('0x5'));var Template=require(_0x0b2b('0x6'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x0b2b('0x7'));var ZendeskAccount=require(_0x0b2b('0x8'));var SalesforceAccount=require(_0x0b2b('0x9'));var FreshdeskAccount=require(_0x0b2b('0xa'));var SugarcrmAccount=require(_0x0b2b('0xb'));var ZohoAccount=require(_0x0b2b('0xc'));var DeskAccount=require(_0x0b2b('0xd'));var VtigerAccount=require(_0x0b2b('0xe'));var ServicenowAccount=require(_0x0b2b('0xf'));var Dynamics365Account=require(_0x0b2b('0x10'));var FreshsalesAccount=require(_0x0b2b('0x11'));var FaxAccount=require(_0x0b2b('0x12'));var Realtime=function(){this[_0x0b2b('0x13')]={};this[_0x0b2b('0x14')]={};this[_0x0b2b('0x15')]={};this[_0x0b2b('0x16')]={};this['triggers']={};this['campaigns']={};this['templates']={};this[_0x0b2b('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x0b2b('0x18')]={};this[_0x0b2b('0x19')]={};this['queueChannels']={};this[_0x0b2b('0x1a')]={};this[_0x0b2b('0x1b')]={};this[_0x0b2b('0x1c')]={};this['zendeskAccounts']={};this[_0x0b2b('0x1d')]={};this[_0x0b2b('0x1e')]={};this['freshdeskAccounts']={};this[_0x0b2b('0x1f')]={};this[_0x0b2b('0x20')]={};this[_0x0b2b('0x21')]={};this[_0x0b2b('0x22')]={};this[_0x0b2b('0x23')]={};this['freshsalesAccounts']={};this[_0x0b2b('0x24')]={};};function freeIsNotKey(_0x178e91,_0x323876,_0x5ca11a){var _0x42a4f7=_['mapKeys'](_0x178e91,function(_0x417bb1,_0x3afe33){return _0x417bb1[_0x5ca11a];});for(var _0x45133e in _0x323876){if(_0x323876[_0x0b2b('0x25')](_0x45133e)){if(!_0x42a4f7[_0x45133e]){delete _0x323876[_0x45133e];}}}}function freeIsNotKeySip(_0x194365,_0x3ac250){var _0x423798=_[_0x0b2b('0x26')](_0x194365,function(_0x22e23e,_0x422d27){return util[_0x0b2b('0x27')]('SIP/%s',_0x22e23e[_0x0b2b('0x28')]);});for(var _0xb2b3cb in _0x3ac250){if(_0x3ac250[_0x0b2b('0x25')](_0xb2b3cb)){if(!_0x423798[_0xb2b3cb]){delete _0x3ac250[_0xb2b3cb];}}}}function freeIsNotKeyAgent(_0x22b576,_0x16ed58){var _0x2fbbd2=_[_0x0b2b('0x26')](_0x22b576,function(_0x2d31b8,_0x437252){var _0x3b96e6=_['isNil'](_0x2d31b8[_0x0b2b('0x29')])?util['format']('SIP/%s',_0x2d31b8[_0x0b2b('0x28')]):_0x2d31b8[_0x0b2b('0x29')];return _0x3b96e6;});for(var _0x3c5724 in _0x16ed58){if(_0x16ed58[_0x0b2b('0x25')](_0x3c5724)){if(!_0x2fbbd2[_0x3c5724]){delete _0x16ed58[_0x3c5724];}}}}function clearVoiceCallReports(_0x4e7ce0){_0x4e7ce0[_0x0b2b('0x2a')]=0x0;_0x4e7ce0[_0x0b2b('0x2b')]=0x0;_0x4e7ce0[_0x0b2b('0x2c')]=0x0;_0x4e7ce0['sumDuration']=0x0;_0x4e7ce0[_0x0b2b('0x2d')]=0x0;}function clearCampaigns(_0x3bfda9){if(!_[_0x0b2b('0x2e')](_0x3bfda9)){for(var _0x37d5ed in _0x3bfda9){if(_0x3bfda9['hasOwnProperty'](_0x37d5ed)){_0x3bfda9[_0x37d5ed]['ivrTotalCallsDays']=0x0;_0x3bfda9[_0x37d5ed][_0x0b2b('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x1788ca){if(!_[_0x0b2b('0x2e')](_0x1788ca)){for(var _0xcf32b9 in _0x1788ca){if(_0x1788ca['hasOwnProperty'](_0xcf32b9)){_0x1788ca[_0xcf32b9][_0x0b2b('0x2a')]=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x2b')]=0x0;_0x1788ca[_0xcf32b9]['unmanaged']=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x30')]=0x0;_0x1788ca[_0xcf32b9]['sumHoldTime']=0x0;_0x1788ca[_0xcf32b9]['sumDuration']=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x2d')]=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x31')]=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x32')]=0x0;_0x1788ca[_0xcf32b9]['outboundBusyCallsDay']=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x33')]=0x0;_0x1788ca[_0xcf32b9]['outboundNoSuchCallsDay']=0x0;_0x1788ca[_0xcf32b9]['outboundUnknownCallsDay']=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x34')]=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x35')]=0x0;_0x1788ca[_0xcf32b9]['outboundBlacklistCallsDay']=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x36')]=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x37')]=0x0;_0x1788ca[_0xcf32b9]['outboundReCallsDay']=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x31')]=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x38')]=0x0;_0x1788ca[_0xcf32b9][_0x0b2b('0x39')]=!![];}}}}Realtime[_0x0b2b('0x3a')]['mergeFromDatabase']=function(_0x48c497,_0x45002e){for(var _0x2d7e37 in _0x45002e){if(_0x48c497[_0x0b2b('0x25')](_0x2d7e37)){_0x48c497[_0x2d7e37]=_0x45002e[_0x2d7e37];}}};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x3b')]=function(){var _0x4f5130=this;return function(_0x483143){if(_0x483143){freeIsNotKeyAgent(_0x483143,_0x4f5130['agents']);for(var _0x282f2d=0x0,_0x3d474f={},_0x2b92ed={};_0x282f2d<_0x483143[_0x0b2b('0x3c')];_0x282f2d+=0x1){_0x3d474f=_0x483143[_0x282f2d];var _0x4fab0d=_[_0x0b2b('0x3d')](_0x3d474f['interface'])?util[_0x0b2b('0x27')](_0x0b2b('0x3e'),_0x3d474f[_0x0b2b('0x28')]):_0x3d474f[_0x0b2b('0x29')];if(_[_0x0b2b('0x3f')](_0x4f5130['agents'][_0x4fab0d])){_0x4f5130[_0x0b2b('0x13')][_0x4fab0d]=new Agent(_0x3d474f);}else{_0x4f5130[_0x0b2b('0x40')](_0x4f5130[_0x0b2b('0x13')][_0x4fab0d],_0x3d474f);}}}return _0x4f5130[_0x0b2b('0x13')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x41')]=function(){var _0x2fcf67=this;return function(_0x421308){if(_0x421308){freeIsNotKeySip(_0x421308,_0x2fcf67[_0x0b2b('0x14')]);for(var _0x10abb0=0x0,_0x288424={},_0x1b6e4d={};_0x10abb0<_0x421308[_0x0b2b('0x3c')];_0x10abb0+=0x1){_0x288424=_0x421308[_0x10abb0];if(_[_0x0b2b('0x3f')](_0x2fcf67['telephones'][util[_0x0b2b('0x27')]('SIP/%s',_0x288424[_0x0b2b('0x28')])])){_0x2fcf67[_0x0b2b('0x14')][util[_0x0b2b('0x27')]('SIP/%s',_0x288424['name'])]=new Telephone(_0x288424);}else{_0x2fcf67[_0x0b2b('0x40')](_0x2fcf67[_0x0b2b('0x14')][util[_0x0b2b('0x27')](_0x0b2b('0x3e'),_0x288424[_0x0b2b('0x28')])],_0x288424);}}}return _0x2fcf67['telephones'];};};Realtime[_0x0b2b('0x3a')]['initTrunks']=function(){var _0x42f7d2=this;return function(_0x3f18b2){if(_0x3f18b2){freeIsNotKeySip(_0x3f18b2,_0x42f7d2[_0x0b2b('0x15')]);for(var _0x59c050=0x0,_0x579626={},_0x1c4308={};_0x59c050<_0x3f18b2[_0x0b2b('0x3c')];_0x59c050+=0x1){_0x579626=_0x3f18b2[_0x59c050];if(_[_0x0b2b('0x3f')](_0x42f7d2[_0x0b2b('0x15')][util[_0x0b2b('0x27')](_0x0b2b('0x3e'),_0x579626['name'])])){_0x42f7d2[_0x0b2b('0x15')][util[_0x0b2b('0x27')]('SIP/%s',_0x579626['name'])]=new Trunk(_0x579626);}else{_0x42f7d2[_0x0b2b('0x40')](_0x42f7d2['trunks'][util[_0x0b2b('0x27')](_0x0b2b('0x3e'),_0x579626[_0x0b2b('0x28')])],_0x579626);}}}return _0x42f7d2['trunks'];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x4d9120=this;return function(_0x16a2bf){if(_0x16a2bf){freeIsNotKey(_0x16a2bf,_0x4d9120[_0x0b2b('0x16')],_0x0b2b('0x28'));for(var _0x5e6ba5=0x0,_0x2758e0={},_0x96f4e9={};_0x5e6ba5<_0x16a2bf['length'];_0x5e6ba5+=0x1){_0x2758e0=_0x16a2bf[_0x5e6ba5];if(_[_0x0b2b('0x3f')](_0x4d9120[_0x0b2b('0x16')][_0x2758e0[_0x0b2b('0x28')]])){_0x4d9120['voiceQueues'][_0x2758e0['name']]=new VoiceQueue(_0x2758e0);}else{_0x4d9120[_0x0b2b('0x40')](_0x4d9120[_0x0b2b('0x16')][_0x2758e0[_0x0b2b('0x28')]],_0x2758e0);}}}return _0x4d9120['voiceQueues'];};};Realtime['prototype'][_0x0b2b('0x42')]=function(){var _0x3e83a0=this;return function(_0x469d3b){if(_0x469d3b){freeIsNotKey(_0x469d3b,_0x3e83a0['triggers'],'id');for(var _0x4dea89=0x0,_0x325b16={},_0x53c512={};_0x4dea89<_0x469d3b[_0x0b2b('0x3c')];_0x4dea89+=0x1){_0x325b16=_0x469d3b[_0x4dea89];if(_['isUndefined'](_0x3e83a0[_0x0b2b('0x43')][_0x325b16['id']])){_0x3e83a0[_0x0b2b('0x43')][_0x325b16['id']]=new Trigger(_0x325b16);}else{_0x3e83a0[_0x0b2b('0x40')](_0x3e83a0[_0x0b2b('0x43')][_0x325b16['id']],_0x325b16);}}}return _0x3e83a0['triggers'];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x44')]=function(){var _0x32abdc=this;return function(_0x32a454){if(_0x32a454){freeIsNotKey(_0x32a454,_0x32abdc[_0x0b2b('0x45')],'id');for(var _0x1078a3=0x0,_0x265eb7={},_0x5c27ca={};_0x1078a3<_0x32a454['length'];_0x1078a3+=0x1){_0x265eb7=_0x32a454[_0x1078a3];if(_['isUndefined'](_0x32abdc[_0x0b2b('0x45')][_0x265eb7['id']])){_0x32abdc[_0x0b2b('0x45')][_0x265eb7['id']]=new Template(_0x265eb7);}else{_0x32abdc['mergeFromDatabase'](_0x32abdc[_0x0b2b('0x45')][_0x265eb7['id']],_0x265eb7);}}}return _0x32abdc[_0x0b2b('0x45')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x46')]=function(){var _0x5f0f33=this;return function(_0x212384){if(_0x212384){freeIsNotKey(_0x212384,_0x5f0f33[_0x0b2b('0x47')],'id');for(var _0x83ba7a=0x0,_0x13f91d={},_0x160cff={};_0x83ba7a<_0x212384[_0x0b2b('0x3c')];_0x83ba7a+=0x1){_0x13f91d=_0x212384[_0x83ba7a];if(_['isUndefined'](_0x5f0f33[_0x0b2b('0x47')][_0x13f91d['id']])){_0x5f0f33[_0x0b2b('0x47')][_0x13f91d['id']]=new ZendeskAccount(_0x13f91d);}else{_0x5f0f33[_0x0b2b('0x40')](_0x5f0f33[_0x0b2b('0x47')][_0x13f91d['id']],_0x13f91d);}}}return _0x5f0f33[_0x0b2b('0x47')];};};Realtime[_0x0b2b('0x3a')]['initSalesforceAccounts']=function(){var _0xb8b36c=this;return function(_0x1fd487){if(_0x1fd487){freeIsNotKey(_0x1fd487,_0xb8b36c['salesforceAccounts'],'id');for(var _0x4fb4c0=0x0,_0xb83f8c={},_0x22b609={};_0x4fb4c0<_0x1fd487[_0x0b2b('0x3c')];_0x4fb4c0+=0x1){_0xb83f8c=_0x1fd487[_0x4fb4c0];if(_[_0x0b2b('0x3f')](_0xb8b36c['salesforceAccounts'][_0xb83f8c['id']])){_0xb8b36c[_0x0b2b('0x1d')][_0xb83f8c['id']]=new SalesforceAccount(_0xb83f8c);}else{_0xb8b36c['mergeFromDatabase'](_0xb8b36c[_0x0b2b('0x1d')][_0xb83f8c['id']],_0xb83f8c);}}}return _0xb8b36c[_0x0b2b('0x1d')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x48')]=function(){var _0x459bd5=this;return function(_0x2faabc){if(_0x2faabc){freeIsNotKey(_0x2faabc,_0x459bd5[_0x0b2b('0x49')],'id');for(var _0xe8a3f3=0x0,_0x54fb93={},_0x3b03a3={};_0xe8a3f3<_0x2faabc[_0x0b2b('0x3c')];_0xe8a3f3+=0x1){_0x54fb93=_0x2faabc[_0xe8a3f3];if(_[_0x0b2b('0x3f')](_0x459bd5[_0x0b2b('0x49')][_0x54fb93['id']])){_0x459bd5['freshdeskAccounts'][_0x54fb93['id']]=new FreshdeskAccount(_0x54fb93);}else{_0x459bd5[_0x0b2b('0x40')](_0x459bd5['freshdeskAccounts'][_0x54fb93['id']],_0x54fb93);}}}return _0x459bd5[_0x0b2b('0x49')];};};Realtime[_0x0b2b('0x3a')]['initZohoAccounts']=function(){var _0x2196f5=this;return function(_0x4bc27e){if(_0x4bc27e){freeIsNotKey(_0x4bc27e,_0x2196f5[_0x0b2b('0x1f')],'id');for(var _0x3df8a3=0x0,_0xdb1749={},_0x519bf8={};_0x3df8a3<_0x4bc27e['length'];_0x3df8a3+=0x1){_0xdb1749=_0x4bc27e[_0x3df8a3];if(_['isUndefined'](_0x2196f5['zohoAccounts'][_0xdb1749['id']])){_0x2196f5[_0x0b2b('0x1f')][_0xdb1749['id']]=new ZohoAccount(_0xdb1749);}else{_0x2196f5[_0x0b2b('0x40')](_0x2196f5[_0x0b2b('0x1f')][_0xdb1749['id']],_0xdb1749);}}}return _0x2196f5[_0x0b2b('0x1f')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x4a')]=function(){var _0x3e1fb9=this;return function(_0x91648f){if(_0x91648f){freeIsNotKey(_0x91648f,_0x3e1fb9[_0x0b2b('0x20')],'id');for(var _0x565970=0x0,_0x258729={},_0x100587={};_0x565970<_0x91648f[_0x0b2b('0x3c')];_0x565970+=0x1){_0x258729=_0x91648f[_0x565970];if(_[_0x0b2b('0x3f')](_0x3e1fb9['deskAccounts'][_0x258729['id']])){_0x3e1fb9[_0x0b2b('0x20')][_0x258729['id']]=new DeskAccount(_0x258729);}else{_0x3e1fb9[_0x0b2b('0x40')](_0x3e1fb9['deskAccounts'][_0x258729['id']],_0x258729);}}}return _0x3e1fb9[_0x0b2b('0x20')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x4b')]=function(){var _0x109bf5=this;return function(_0x494c3){if(_0x494c3){freeIsNotKey(_0x494c3,_0x109bf5[_0x0b2b('0x1e')],'id');for(var _0x10e25d=0x0,_0x49ecef={},_0x5bf422={};_0x10e25d<_0x494c3[_0x0b2b('0x3c')];_0x10e25d+=0x1){_0x49ecef=_0x494c3[_0x10e25d];if(_[_0x0b2b('0x3f')](_0x109bf5[_0x0b2b('0x1e')][_0x49ecef['id']])){_0x109bf5[_0x0b2b('0x1e')][_0x49ecef['id']]=new SugarcrmAccount(_0x49ecef);}else{_0x109bf5[_0x0b2b('0x40')](_0x109bf5['sugarcrmAccounts'][_0x49ecef['id']],_0x49ecef);}}}return _0x109bf5[_0x0b2b('0x1e')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x4c')]=function(){var _0x11f860=this;return function(_0x3ce8f1){if(_0x3ce8f1){freeIsNotKey(_0x3ce8f1,_0x11f860[_0x0b2b('0x21')],'id');for(var _0x20242d=0x0,_0x235e4a={},_0x37389f={};_0x20242d<_0x3ce8f1[_0x0b2b('0x3c')];_0x20242d+=0x1){_0x235e4a=_0x3ce8f1[_0x20242d];if(_['isUndefined'](_0x11f860[_0x0b2b('0x21')][_0x235e4a['id']])){_0x11f860[_0x0b2b('0x21')][_0x235e4a['id']]=new VtigerAccount(_0x235e4a);}else{_0x11f860[_0x0b2b('0x40')](_0x11f860[_0x0b2b('0x21')][_0x235e4a['id']],_0x235e4a);}}}return _0x11f860[_0x0b2b('0x21')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x4d')]=function(){var _0x537520=this;return function(_0x3ff6fe){if(_0x3ff6fe){freeIsNotKey(_0x3ff6fe,_0x537520[_0x0b2b('0x22')],'id');for(var _0x107d68=0x0,_0x284136={},_0x23dd19={};_0x107d68<_0x3ff6fe[_0x0b2b('0x3c')];_0x107d68+=0x1){_0x284136=_0x3ff6fe[_0x107d68];if(_['isUndefined'](_0x537520['servicenowAccounts'][_0x284136['id']])){_0x537520[_0x0b2b('0x22')][_0x284136['id']]=new ServicenowAccount(_0x284136);}else{_0x537520[_0x0b2b('0x40')](_0x537520['servicenowAccounts'][_0x284136['id']],_0x284136);}}}return _0x537520[_0x0b2b('0x22')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x4e')]=function(){var _0x1cb423=this;return function(_0x4d8eae){if(_0x4d8eae){freeIsNotKey(_0x4d8eae,_0x1cb423[_0x0b2b('0x23')],'id');for(var _0x4dff75=0x0,_0x422fb2={},_0x1b0870={};_0x4dff75<_0x4d8eae[_0x0b2b('0x3c')];_0x4dff75+=0x1){_0x422fb2=_0x4d8eae[_0x4dff75];if(_[_0x0b2b('0x3f')](_0x1cb423[_0x0b2b('0x23')][_0x422fb2['id']])){_0x1cb423['dynamics365Accounts'][_0x422fb2['id']]=new Dynamics365Account(_0x422fb2);}else{_0x1cb423[_0x0b2b('0x40')](_0x1cb423[_0x0b2b('0x23')][_0x422fb2['id']],_0x422fb2);}}}return _0x1cb423[_0x0b2b('0x23')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x4f')]=function(){var _0x3513de=this;return function(_0x1f817c){if(_0x1f817c){freeIsNotKey(_0x1f817c,_0x3513de[_0x0b2b('0x50')],'id');for(var _0x194323=0x0,_0x12562a={},_0x370210={};_0x194323<_0x1f817c[_0x0b2b('0x3c')];_0x194323+=0x1){_0x12562a=_0x1f817c[_0x194323];if(_[_0x0b2b('0x3f')](_0x3513de[_0x0b2b('0x50')][_0x12562a['id']])){_0x3513de[_0x0b2b('0x50')][_0x12562a['id']]=new FreshsalesAccount(_0x12562a);}else{_0x3513de['mergeFromDatabase'](_0x3513de['freshsalesAccounts'][_0x12562a['id']],_0x12562a);}}}return _0x3513de[_0x0b2b('0x50')];};};Realtime['prototype'][_0x0b2b('0x51')]=function(){var _0x7d101c=this;return function(_0x29f5fb){for(var _0x26a717=0x0;_0x26a717<_0x29f5fb[_0x0b2b('0x3c')];_0x26a717+=0x1){_[_0x0b2b('0x52')](_0x7d101c['voiceQueues'][_0x29f5fb[_0x26a717][_0x0b2b('0x28')]],_0x29f5fb[_0x26a717]);}return _0x7d101c[_0x0b2b('0x16')];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x53')]=function(){var _0xe34df0=this;return function(_0x189cf1){clearVoiceQueues(_0xe34df0[_0x0b2b('0x16')]);if(_0x189cf1){_0x189cf1=_[_0x0b2b('0x54')](_0x189cf1,_0x0b2b('0x55'));for(var _0x46277f in _0x189cf1){if(_0x189cf1[_0x0b2b('0x25')](_0x46277f)){var _0x1c9b17={};for(var _0x2b288f=0x0;_0x2b288f<_0x189cf1[_0x46277f][_0x0b2b('0x3c')];_0x2b288f+=0x1){var _0x385144=_0x189cf1[_0x46277f][_0x2b288f]['queue'];if(_0xe34df0['voiceQueues'][_0x385144]){if(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x56')]){_0xe34df0['voiceQueues'][_0x385144][_0x0b2b('0x57')]+=0x1;}if(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x58')]){_0xe34df0[_0x0b2b('0x16')][_0x385144][_0x0b2b('0x30')]+=0x1;}_0xe34df0[_0x0b2b('0x16')][_0x385144][_0x0b2b('0x2c')]+=moment(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x59')])[_0x0b2b('0x5a')](moment(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x5b')]),_0x0b2b('0x5c'))||0x0;if(_0x2b288f===_0x189cf1[_0x46277f][_0x0b2b('0x3c')]-0x1){_0xe34df0[_0x0b2b('0x16')][_0x385144][_0x0b2b('0x5d')]+=moment(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x5e')]||_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x5f')]||_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x60')])[_0x0b2b('0x5a')](moment(_0x189cf1[_0x46277f][_0x2b288f]['queuecallerjoinAt']),_0x0b2b('0x5c'))||0x0;_0xe34df0[_0x0b2b('0x16')][_0x385144][_0x0b2b('0x2a')]+=0x1;if(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x61')]){_0xe34df0[_0x0b2b('0x16')][_0x385144][_0x0b2b('0x2b')]+=0x1;_0xe34df0[_0x0b2b('0x16')][_0x385144][_0x0b2b('0x2d')]+=moment(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x5e')])['diff'](moment(_0x189cf1[_0x46277f][_0x2b288f][_0x0b2b('0x59')]),_0x0b2b('0x5c'))||0x0;}}else{_0xe34df0[_0x0b2b('0x16')][_0x385144][_0x0b2b('0x5d')]+=_0xe34df0['voiceQueues'][_0x385144][_0x0b2b('0x2c')]||0x0;}}}}}}return _0xe34df0['voiceQueues'];};};Realtime[_0x0b2b('0x3a')]['initVoiceCallReports']=function(){var _0x2812d2=this;return function(_0xc29ffc){clearVoiceCallReports(_0x2812d2[_0x0b2b('0x17')]);if(_0xc29ffc){for(var _0xcbd88e=0x0;_0xcbd88e<_0xc29ffc[_0x0b2b('0x3c')];_0xcbd88e+=0x1){_0x2812d2[_0x0b2b('0x17')][_0x0b2b('0x2a')]+=0x1;_0x2812d2[_0x0b2b('0x17')][_0x0b2b('0x5d')]+=_0xc29ffc[_0xcbd88e][_0x0b2b('0x62')];if(_0xc29ffc[_0xcbd88e]['disposition']===_0x0b2b('0x63')){_0x2812d2[_0x0b2b('0x17')]['answered']+=0x1;_0x2812d2[_0x0b2b('0x17')][_0x0b2b('0x2c')]+=_0xc29ffc[_0xcbd88e][_0x0b2b('0x62')]-_0xc29ffc[_0xcbd88e]['billableseconds']||0x0;_0x2812d2[_0x0b2b('0x17')][_0x0b2b('0x2d')]+=_0xc29ffc[_0xcbd88e][_0x0b2b('0x64')];}}}return _0x2812d2['outbound'];};};Realtime['prototype']['initCampaigns']=function(){var _0xb5f1ac=this;return function(_0x5cdd11){if(_0x5cdd11){freeIsNotKey(_0x5cdd11,_0xb5f1ac['campaigns'],'name');for(var _0x157bb5=0x0,_0x5813f3={};_0x157bb5<_0x5cdd11[_0x0b2b('0x3c')];_0x157bb5+=0x1){_0x5813f3=_0x5cdd11[_0x157bb5];if(_[_0x0b2b('0x3f')](_0xb5f1ac['campaigns'][_0x5813f3[_0x0b2b('0x28')]])){_0xb5f1ac['campaigns'][_0x5813f3[_0x0b2b('0x28')]]=new Campaign(_0x5813f3);}else{_0xb5f1ac[_0x0b2b('0x40')](_0xb5f1ac[_0x0b2b('0x65')][_0x5813f3['name']],_0x5813f3);_0xb5f1ac[_0x0b2b('0x65')][_0x5813f3[_0x0b2b('0x28')]]['dialQueueProject']=_0x5813f3[_0x0b2b('0x66')]?_0x5813f3[_0x0b2b('0x66')][_0x0b2b('0x28')]:undefined;}}}return _0xb5f1ac['campaigns'];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x67')]=function(){var _0x1ada19=this;return function(_0x33e4f2){if(_0x33e4f2){freeIsNotKey(_0x33e4f2,_0x1ada19['voiceExtensions'],'id');for(var _0x268be2=0x0,_0x501883={};_0x268be2<_0x33e4f2[_0x0b2b('0x3c')];_0x268be2+=0x1){_0x501883=_0x33e4f2[_0x268be2];if(_[_0x0b2b('0x3f')](_0x1ada19['voiceExtensions'][_0x501883['id']])){_0x1ada19['voiceExtensions'][_0x501883['id']]=new VoiceExtension(_0x501883);}else{_0x1ada19[_0x0b2b('0x40')](_0x1ada19[_0x0b2b('0x18')][_0x501883['id']],_0x501883);}}}return _0x1ada19['voiceExtensions'];};};Realtime[_0x0b2b('0x3a')]['initCampaignHopperHistory']=function(){var _0x278179=this;return function(_0x185800){clearCampaigns(_0x278179[_0x0b2b('0x65')]);for(var _0x356a22=0x0;_0x356a22<_0x185800[_0x0b2b('0x3c')];_0x356a22+=0x1){_['merge'](_0x278179[_0x0b2b('0x65')][_0x185800[_0x356a22][_0x0b2b('0x28')]],_0x185800[_0x356a22]);}return _0x278179['campaigns'];};};Realtime[_0x0b2b('0x3a')][_0x0b2b('0x68')]=function(){var _0x3b9ee2=this;return function(_0x487399){if(_0x487399){freeIsNotKey(_0x487399,_0x3b9ee2['faxAccounts'],'id');for(var _0x1ca803=0x0,_0xe53d5b={},_0x4218e4={};_0x1ca803<_0x487399[_0x0b2b('0x3c')];_0x1ca803+=0x1){_0xe53d5b=_0x487399[_0x1ca803];if(_[_0x0b2b('0x3f')](_0x3b9ee2[_0x0b2b('0x24')][_0xe53d5b['id']])){_0x3b9ee2[_0x0b2b('0x24')][_0xe53d5b['id']]=new FaxAccount(_0xe53d5b);}else{_0x3b9ee2['mergeFromDatabase'](_0x3b9ee2[_0x0b2b('0x24')][_0xe53d5b['id']],_0xe53d5b);}}}return _0x3b9ee2[_0x0b2b('0x24')];};};module[_0x0b2b('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index bbd7d8d..9084aae 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 _0xea3e=['bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','getCallType','channel','getAgentByInternal','outbound','internal','destination','dialer','lastapplication','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','split','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','exten','xcally-motion-dialer','voiceAgentReport','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','moment','util','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','voiceQueueReport'];(function(_0x146904,_0x424b32){var _0x236889=function(_0x215f21){while(--_0x215f21){_0x146904['push'](_0x146904['shift']());}};_0x236889(++_0x424b32);}(_0xea3e,0x107));var _0xeea3=function(_0x200140,_0x4fe93a){_0x200140=_0x200140-0x0;var _0x3bf111=_0xea3e[_0x200140];return _0x3bf111;};'use strict';var _=require('lodash');var moment=require(_0xeea3('0x0'));var util=require(_0xeea3('0x1'));var config=require('../../../config/environment');var ami=require(_0xeea3('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xeea3('0x3'));var RpcVoiceDialReport=require(_0xeea3('0x4'));var RpcMemberReport=require(_0xeea3('0x5'));var RpcVoiceQueueReport=require(_0xeea3('0x6'));var RpcVoiceRecording=require(_0xeea3('0x7'));var RpcVoiceTransferReport=require(_0xeea3('0x8'));var VoiceQueueReport=require(_0xeea3('0x9'));var VoiceCallReport=require(_0xeea3('0xa'));var VoiceAgentReport=require(_0xeea3('0xb'));var VoiceDialReport=require(_0xeea3('0xc'));var UserReport=require(_0xeea3('0xd'));function Report(_0x181441){this['realtime']=_0x181441;this[_0xeea3('0xe')]=_0x181441[_0xeea3('0xe')];this[_0xeea3('0xf')]=_0x181441[_0xeea3('0xf')];}Report[_0xeea3('0x10')][_0xeea3('0x11')]=function(_0x4361ae){var _0x42360b=new VoiceQueueReport(this['realtime']);var _0xf77443=new VoiceAgentReport(this[_0xeea3('0x12')]);var _0x52b40b=new VoiceDialReport(this[_0xeea3('0x12')]);var _0x4e4cd7=new VoiceCallReport(this[_0xeea3('0x12')]);var _0x40bd80=new UserReport(this[_0xeea3('0x12')]);if(config[_0xeea3('0x13')]&&config['xdr'][_0xeea3('0x14')]){ami['on']('custom:voiceQueueReport',this[_0xeea3('0x15')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x17'),this[_0xeea3('0x18')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x19'),this['voiceAgentReport'][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x1a'),this[_0xeea3('0x1b')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x1c'),this[_0xeea3('0x1d')][_0xeea3('0x16')](this));ami['on'](_0xeea3('0x1e'),this[_0xeea3('0x1f')][_0xeea3('0x16')](this));}};Report[_0xeea3('0x10')][_0xeea3('0x20')]=function(_0x1f3f0e){var _0x1a29f1;_0x1a29f1=_[_0xeea3('0x21')](this[_0xeea3('0xe')],function(_0x442be6){return _0x442be6[_0xeea3('0x22')]==_0x1f3f0e||_0x442be6[_0xeea3('0x23')]==_0x1f3f0e;});if(_[_0xeea3('0x24')](_0x1a29f1)){var _0x15546b=_['find'](this['telephones'],function(_0x174c14){return _0x174c14[_0xeea3('0x22')]==_0x1f3f0e||_0x174c14[_0xeea3('0x23')]==_0x1f3f0e;});if(_0x15546b){_0x1a29f1=_['find'](this[_0xeea3('0xe')],function(_0x4ae354){return _0x4ae354[_0xeea3('0x25')]==util['format'](_0xeea3('0x26'),_0x15546b[_0xeea3('0x23')]);});}}return _0x1a29f1;};Report[_0xeea3('0x10')]['voiceQueueReport']=function(_0x4d9d39){for(var _0x482c1b=0x0;_0x482c1b<_0x4d9d39[_0xeea3('0x27')];_0x482c1b+=0x1){var _0x18d8e5=this['findAgent'](_0x4d9d39[_0x482c1b][_0xeea3('0x28')]);if(_0x18d8e5){_0x4d9d39[_0x482c1b][_0xeea3('0x22')]=_0x18d8e5[_0xeea3('0x22')];_0x4d9d39[_0x482c1b]['assigned']=!![];_0x4d9d39[_0x482c1b][_0xeea3('0x29')]=_0x18d8e5[_0xeea3('0x23')];_0x4d9d39[_0x482c1b][_0xeea3('0x25')]=_[_0xeea3('0x24')](_0x18d8e5[_0xeea3('0x25')])?util[_0xeea3('0x2a')](_0xeea3('0x26'),_0x18d8e5['name']):_0x18d8e5[_0xeea3('0x25')];if(_0x4d9d39[_0x482c1b][_0xeea3('0x2b')]){_0x4d9d39[_0x482c1b][_0xeea3('0x2c')]=moment()[_0xeea3('0x2a')](_0xeea3('0x2d'));}if(_0x4d9d39[_0x482c1b]['queuecallerexit']){_0x4d9d39[_0x482c1b][_0xeea3('0x2e')]=moment()['format'](_0xeea3('0x2d'));}RpcMemberReport[_0xeea3('0x15')](_0x4d9d39[_0x482c1b]);}RpcVoiceQueueReport[_0xeea3('0x2f')](_0x4d9d39[_0x482c1b]);}};function extractCalleridNumber(_0x1977e7){var _0x2967dd=_0x1977e7['match'](/<(.*?)>/);return _0x2967dd?_0x2967dd[0x1]:_0x1977e7;}Report[_0xeea3('0x10')]['getAgentByInternal']=function(_0x47459f){for(var _0x128818=0x0;_0x128818/);return _0x5d0ad4?_0x5d0ad4[0x1]:_0x42e66f;}Report['prototype']['getAgentByInternal']=function(_0x435fc1){for(var _0x4c39f3=0x0;_0x4c39f3',_0x92055a[_0xdf8f('0x41')],_0x92055a['calleridnum']);}if(RpcVoiceTransferReport[_0xdf8f('0x42')][_0x92055a[_0xdf8f('0x43')]]){var _0x17b26b=RpcVoiceTransferReport['transfers'][_0x92055a[_0xdf8f('0x43')]];_0x17b26b[_0xdf8f('0x44')]=_0x92055a[_0xdf8f('0x45')];RpcVoiceTransferReport[_0xdf8f('0x1b')](_0x17b26b);delete RpcVoiceTransferReport[_0xdf8f('0x42')][_0x92055a['linkedid']];}if(_['isNil'](_0x92055a[_0xdf8f('0x35')])){_0x92055a[_0xdf8f('0x35')]=this[_0xdf8f('0x2e')](_0x92055a);}if(_[_0xdf8f('0x25')](_0x92055a['UserId'])){var _0x88accb=_0x92055a['channel'][_0xdf8f('0x30')]('-')[0x0];var _0x5509f4=this['agents'][_0x88accb];if(!_0x5509f4)_0x5509f4=this['getAgentByInternal'](_0x92055a[_0xdf8f('0x1f')]);if(_0x5509f4){_0x92055a[_0xdf8f('0x46')]=_0x5509f4['id'];_0x92055a[_0xdf8f('0x47')]=_0x5509f4[_0xdf8f('0x20')];}}RpcVoiceCallReport['create'](_0x92055a);if(_0x92055a[_0xdf8f('0x48')]){for(var _0x28d005=0x0;_0x28d005<_0x92055a[_0xdf8f('0x49')][_0xdf8f('0x24')];_0x28d005+=0x1){_0x92055a['monitorFilename']=_0x92055a[_0xdf8f('0x49')][_0x28d005][_0xdf8f('0x4a')];_0x92055a[_0xdf8f('0x4b')]=_0x92055a[_0xdf8f('0x49')][_0x28d005][_0xdf8f('0x4b')];if(_0x92055a['exten']==_0xdf8f('0x3b')){_0x92055a[_0xdf8f('0x32')]=_0x92055a[_0xdf8f('0x40')];_0x92055a[_0xdf8f('0x41')]=_0x92055a[_0xdf8f('0x4c')];_0x92055a[_0xdf8f('0x40')]=_0x92055a[_0xdf8f('0x1f')];_0x92055a[_0xdf8f('0x4c')]=_0x92055a[_0xdf8f('0x47')];_0x92055a['exten']=_0x92055a[_0xdf8f('0x3c')];}else if(_0x92055a[_0xdf8f('0x4d')]==_0xdf8f('0x4e')){_0x92055a[_0xdf8f('0x32')]=_0x92055a['destination'];_0x92055a[_0xdf8f('0x4d')]=_0x92055a[_0xdf8f('0x3c')];}RpcVoiceRecording[_0xdf8f('0x2b')](_0x92055a);}}};Report[_0xdf8f('0xe')][_0xdf8f('0x17')]=function(_0x123d43){if(_[_0xdf8f('0x4f')](_0x123d43)){_0x123d43[_0xdf8f('0x50')](function(_0x3866c7){RpcVoiceAgentReport[_0xdf8f('0x2b')](_0x3866c7);});}else{RpcVoiceAgentReport[_0xdf8f('0x2b')](_0x123d43);}};Report[_0xdf8f('0xe')][_0xdf8f('0x19')]=function(_0x9d355d){RpcVoiceDialReport['create'](_0x9d355d);var _0xdc816e;var _0x5e9596;var _0x19252a=_0x9d355d['channel'];if(_[_0xdf8f('0x51')](_0x19252a,_0xdf8f('0x52'))){_0x5e9596=_0x19252a[_0xdf8f('0x53')](_0x19252a['indexOf']('/')+0x1,_0x19252a[_0xdf8f('0x54')]('@'));_0xdc816e=_[_0xdf8f('0x21')](this[_0xdf8f('0xc')],function(_0x13bc43){return _0x13bc43[_0xdf8f('0x55')]==_0x5e9596||_0x13bc43[_0xdf8f('0x56')]==_0x5e9596||_0x13bc43['accountcode']==_0x5e9596;});}else{_0x5e9596=_0x19252a['substring'](_0x19252a['indexOf']('/')+0x1,_0x19252a['lastIndexOf']('-'));_0xdc816e=this[_0xdf8f('0x1e')](_0x5e9596);}if(_0xdc816e){_0x9d355d[_0xdf8f('0x22')]=_[_0xdf8f('0x25')](_0xdc816e[_0xdf8f('0x22')])?util['format'](_0xdf8f('0x23'),_0xdc816e[_0xdf8f('0x20')]):_0xdc816e[_0xdf8f('0x22')];_0x9d355d[_0xdf8f('0x47')]=_0xdc816e[_0xdf8f('0x20')];_0x9d355d[_0xdf8f('0x1f')]=_0xdc816e[_0xdf8f('0x1f')];RpcMemberReport['voiceDialReport'](_0x9d355d);}};Report['prototype'][_0xdf8f('0x1b')]=function(_0x176228){RpcVoiceTransferReport['transfers'][_0x176228[_0xdf8f('0x57')]]=_0x176228;};Report[_0xdf8f('0xe')][_0xdf8f('0x1d')]=function(_0x1831e2){RpcVoiceTransferReport[_0xdf8f('0x1d')](_0x1831e2);};module[_0xdf8f('0x58')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 3e13875..141917b 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 _0xe3de=['inspect','actionDeviceStateList','catch','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','merge','omit','event','actionid','trunk:%s','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','toNumber','format','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','substring','indexOf','mobile','phone','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncPeerStatus','syncRealtimeShow','resolve','then','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe3de,0x7d));var _0xee3d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe3de[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xee3d('0x0'));var moment=require(_0xee3d('0x1'));var util=require(_0xee3d('0x2'));var Redis=require(_0xee3d('0x3'));var BPromise=require(_0xee3d('0x4'));var config=require(_0xee3d('0x5'));var logger=require('../../../config/logger')(_0xee3d('0x6'));var ami=require(_0xee3d('0x7'));config[_0xee3d('0x8')]=_[_0xee3d('0x9')](config[_0xee3d('0x8')],{'host':_0xee3d('0xa'),'port':0x18eb});var io=require(_0xee3d('0xb'))(new Redis(config[_0xee3d('0x8')]));function UserReport(_0x21e883){this[_0xee3d('0xc')]=_0x21e883[_0xee3d('0xc')];this[_0xee3d('0xd')]=_0x21e883[_0xee3d('0xd')];this[_0xee3d('0xe')]=_0x21e883['telephones'];ami['on'](_0xee3d('0xf'),this[_0xee3d('0x10')][_0xee3d('0x11')](this));ami['on'](_0xee3d('0x12'),this[_0xee3d('0x10')][_0xee3d('0x11')](this));ami['on'](_0xee3d('0x13'),this['syncDeviceState'][_0xee3d('0x11')](this));ami['on']('peerstatus',this[_0xee3d('0x14')][_0xee3d('0x11')](this));return this[_0xee3d('0x15')]();}function showSipRegistrations(){Promise[_0xee3d('0x16')]()[_0xee3d('0x17')](ami['actionSipShowRegistry']())['catch'](function(_0x1fc75e){logger[_0xee3d('0x18')]('[userReport][sipshowregistry]',util[_0xee3d('0x19')](_0x1fc75e,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xee3d('0x17')](ami[_0xee3d('0x1a')]())[_0xee3d('0x1b')](function(_0x368b08){logger[_0xee3d('0x18')](_0xee3d('0x1c'),util[_0xee3d('0x19')](_0x368b08,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xee3d('0x16')]()[_0xee3d('0x17')](ami[_0xee3d('0x1d')]())['catch'](function(_0x55b173){logger[_0xee3d('0x18')](_0xee3d('0x1e'),util[_0xee3d('0x19')](_0x55b173,{'showHidden':![],'depth':null}));});}UserReport[_0xee3d('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xee3d('0x16')]()[_0xee3d('0x17')](showSipRegistrations())[_0xee3d('0x17')](listDeviceStates())[_0xee3d('0x17')](showPeersStatus());},0x32c8);};UserReport[_0xee3d('0x1f')][_0xee3d('0x20')]=function(_0x2bf522){return _0x2bf522!==null&&!_['isUndefined'](_0x2bf522);};UserReport[_0xee3d('0x1f')][_0xee3d('0x21')]=function(_0x2ce185,_0x16e0d9,_0x47c3b1){io['to'](_0x2ce185)[_0xee3d('0x21')](_0x16e0d9,_0x47c3b1);};UserReport[_0xee3d('0x1f')][_0xee3d('0x10')]=function(_0x24d57e){try{if(this[_0xee3d('0x20')](_0x24d57e)){logger[_0xee3d('0x22')](_0xee3d('0x23'),_0x24d57e['username'],_0x24d57e[_0xee3d('0x24')]);logger[_0xee3d('0x25')](_0xee3d('0x26'),util[_0xee3d('0x19')](_0x24d57e,{'showHidden':![],'depth':null}));var _0x37f257=_[_0xee3d('0x27')](this[_0xee3d('0xc')],{'defaultuser':_0x24d57e[_0xee3d('0x28')]});if(_0x37f257){_0x24d57e['stateRegistry']=_0x24d57e[_0xee3d('0x24')];_[_0xee3d('0x29')](_0x37f257,_[_0xee3d('0x2a')](_0x24d57e,[_0xee3d('0x2b'),_0xee3d('0x2c'),_0xee3d('0x28'),_0xee3d('0x24')]));logger[_0xee3d('0x25')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xee3d('0x19')](_0x37f257,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xee3d('0x2d'),_0x37f257[_0xee3d('0x2e')]),_0xee3d('0x2f'),_0x37f257);}}}catch(_0x4a0a01){logger[_0xee3d('0x18')](_0xee3d('0x26'),util[_0xee3d('0x19')](_0x4a0a01,{'showHidden':![],'depth':null}));}};UserReport[_0xee3d('0x1f')][_0xee3d('0x30')]=function(_0x3c6a72){try{if(this['isNotNull'](_0x3c6a72)){logger[_0xee3d('0x22')](_0xee3d('0x31'),_0x3c6a72[_0xee3d('0x32')],_0x3c6a72[_0xee3d('0x24')]);logger[_0xee3d('0x25')](_0xee3d('0x33'),util[_0xee3d('0x19')](_0x3c6a72,{'showHidden':![],'depth':null}));if(this[_0xee3d('0xd')][_0x3c6a72[_0xee3d('0x32')]]){if(!this[_0xee3d('0xd')][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x34')]||_0x3c6a72[_0xee3d('0x24')][_0xee3d('0x35')]()=='inuse'){this[_0xee3d('0xd')][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x34')]=![];if(this['agents'][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x24')]!==_0x3c6a72[_0xee3d('0x24')][_0xee3d('0x35')]()){this['agents'][_0x3c6a72['device']]['stateTime']=_[_0xee3d('0x36')](moment()[_0xee3d('0x37')]('x'));}this[_0xee3d('0xd')][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x24')]=_0x3c6a72[_0xee3d('0x24')]['toLowerCase']();this[_0xee3d('0xd')][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x38')](_0x3c6a72);}}else if(this[_0xee3d('0xe')][_0x3c6a72[_0xee3d('0x32')]]){if(this[_0xee3d('0xe')][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x24')]!==_0x3c6a72['state']['toLowerCase']()){this[_0xee3d('0xe')][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x39')]=_[_0xee3d('0x36')](moment()[_0xee3d('0x37')]('x'));}this['telephones'][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x24')]=_0x3c6a72['state'][_0xee3d('0x35')]();logger[_0xee3d('0x25')](_0xee3d('0x3a'),util['inspect'](this['telephones'][_0x3c6a72[_0xee3d('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xee3d('0x3b'),this[_0xee3d('0xe')][_0x3c6a72['device']][_0xee3d('0x2e')]),_0xee3d('0x3c'),this[_0xee3d('0xe')][_0x3c6a72[_0xee3d('0x32')]]);}else if(this['trunks'][_0x3c6a72['device']]){if(this['trunks'][_0x3c6a72['device']]['state']!==_0x3c6a72[_0xee3d('0x24')][_0xee3d('0x35')]()){this[_0xee3d('0xc')][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x39')]=_[_0xee3d('0x36')](moment()[_0xee3d('0x37')]('x'));}this['trunks'][_0x3c6a72[_0xee3d('0x32')]][_0xee3d('0x24')]=_0x3c6a72['state'][_0xee3d('0x35')]();logger[_0xee3d('0x25')](_0xee3d('0x3d'),util[_0xee3d('0x19')](this['trunks'][_0x3c6a72[_0xee3d('0x32')]],{'showHidden':![],'depth':null}));this[_0xee3d('0x21')](util[_0xee3d('0x37')]('trunk:%s',this[_0xee3d('0xc')][_0x3c6a72['device']]['name']),_0xee3d('0x2f'),this['trunks'][_0x3c6a72[_0xee3d('0x32')]]);}else if(_[_0xee3d('0x3e')](_0x3c6a72['device'],'Local')){var _0x5aa9e6=_0x3c6a72[_0xee3d('0x32')];var _0x1d2e6d=_0x5aa9e6[_0xee3d('0x3f')](_0x5aa9e6[_0xee3d('0x40')]('/')+0x1,_0x5aa9e6['indexOf']('@'));var _0x2f4a94=_['find'](this[_0xee3d('0xd')],function(_0x473d2b){return _0x473d2b[_0xee3d('0x41')]==_0x1d2e6d||_0x473d2b[_0xee3d('0x42')]==_0x1d2e6d||_0x473d2b['accountcode']==_0x1d2e6d;});if(_0x2f4a94){if(_0x2f4a94[_0xee3d('0x24')]!==_0x3c6a72[_0xee3d('0x24')][_0xee3d('0x35')]()){_0x2f4a94['stateTime']=_[_0xee3d('0x36')](moment()[_0xee3d('0x37')]('x'));}_0x2f4a94[_0xee3d('0x24')]=_0x3c6a72[_0xee3d('0x24')]['toLowerCase']();_0x2f4a94[_0xee3d('0x34')]=!![];_0x2f4a94['updateStatusRealtime'](_0x3c6a72);}}}}catch(_0x5aed17){logger[_0xee3d('0x18')](_0xee3d('0x33'),util[_0xee3d('0x19')](_0x5aed17,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xee3d('0x14')]=function(_0x18bce9){try{if(this[_0xee3d('0x20')](_0x18bce9)&&this[_0xee3d('0x20')](_0x18bce9[_0xee3d('0x43')])){logger[_0xee3d('0x22')](_0xee3d('0x44'),_0x18bce9['peer'],_0x18bce9[_0xee3d('0x45')],_0x18bce9['peerstatus']);logger['debug']('[userReport][peerstatus]',util[_0xee3d('0x19')](_0x18bce9,{'showHidden':![],'depth':null}));if(this[_0xee3d('0xd')][_0x18bce9[_0xee3d('0x46')]]){if(!this['agents'][_0x18bce9[_0xee3d('0x46')]]['local']||_0x18bce9[_0xee3d('0x43')][_0xee3d('0x35')]()==_0xee3d('0x47')){this[_0xee3d('0xd')][_0x18bce9[_0xee3d('0x46')]][_0xee3d('0x34')]=![];this[_0xee3d('0xd')][_0x18bce9[_0xee3d('0x46')]][_0xee3d('0x48')]=_0x18bce9[_0xee3d('0x43')][_0xee3d('0x35')]();this[_0xee3d('0xd')][_0x18bce9['peer']][_0xee3d('0x45')]=_0x18bce9[_0xee3d('0x45')];this[_0xee3d('0xd')][_0x18bce9[_0xee3d('0x46')]][_0xee3d('0x38')](_0x18bce9);}}else if(this[_0xee3d('0xe')][_0x18bce9[_0xee3d('0x46')]]){this[_0xee3d('0xe')][_0x18bce9[_0xee3d('0x46')]]['status']=_0x18bce9[_0xee3d('0x43')]['toLowerCase']();this['telephones'][_0x18bce9['peer']]['address']=_0x18bce9[_0xee3d('0x45')];logger[_0xee3d('0x25')](_0xee3d('0x49'),util['inspect'](this['telephones'][_0x18bce9[_0xee3d('0x46')]],{'showHidden':![],'depth':null}));this[_0xee3d('0x21')](util['format'](_0xee3d('0x3b'),this[_0xee3d('0xe')][_0x18bce9[_0xee3d('0x46')]]['name']),_0xee3d('0x3c'),this[_0xee3d('0xe')][_0x18bce9[_0xee3d('0x46')]]);}else if(this[_0xee3d('0xc')][_0x18bce9[_0xee3d('0x46')]]){this['trunks'][_0x18bce9[_0xee3d('0x46')]][_0xee3d('0x48')]=_0x18bce9[_0xee3d('0x43')]['toLowerCase']();this[_0xee3d('0xc')][_0x18bce9[_0xee3d('0x46')]][_0xee3d('0x45')]=_0x18bce9[_0xee3d('0x45')];logger[_0xee3d('0x25')](_0xee3d('0x4a'),util['inspect'](this[_0xee3d('0xc')][_0x18bce9['peer']],{'showHidden':![],'depth':null}));this[_0xee3d('0x21')](util[_0xee3d('0x37')](_0xee3d('0x2d'),this[_0xee3d('0xc')][_0x18bce9[_0xee3d('0x46')]][_0xee3d('0x2e')]),_0xee3d('0x2f'),this[_0xee3d('0xc')][_0x18bce9['peer']]);}}}catch(_0x18684a){logger[_0xee3d('0x18')]('[userReport][peerstatus]',util[_0xee3d('0x19')](_0x18684a,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xcc06=['trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','error','[userReport][sippeerstatus]','inspect','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','debug','[userReport][registry]','stateRegistry','merge','omit','event','state','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name'];(function(_0x95ad05,_0x3cadb6){var _0x2d79f4=function(_0x9868f2){while(--_0x9868f2){_0x95ad05['push'](_0x95ad05['shift']());}};_0x2d79f4(++_0x3cadb6);}(_0xcc06,0x1ea));var _0x6cc0=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xcc06[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x6cc0('0x0'));var moment=require(_0x6cc0('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0x6cc0('0x2'));var config=require(_0x6cc0('0x3'));var logger=require(_0x6cc0('0x4'))(_0x6cc0('0x5'));var ami=require(_0x6cc0('0x6'));config[_0x6cc0('0x7')]=_['defaults'](config[_0x6cc0('0x7')],{'host':_0x6cc0('0x8'),'port':0x18eb});var io=require(_0x6cc0('0x9'))(new Redis(config['redis']));function UserReport(_0x5445df){this[_0x6cc0('0xa')]=_0x5445df['trunks'];this['agents']=_0x5445df[_0x6cc0('0xb')];this[_0x6cc0('0xc')]=_0x5445df[_0x6cc0('0xc')];ami['on'](_0x6cc0('0xd'),this[_0x6cc0('0xe')][_0x6cc0('0xf')](this));ami['on']('registry',this[_0x6cc0('0xe')][_0x6cc0('0xf')](this));ami['on'](_0x6cc0('0x10'),this[_0x6cc0('0x11')][_0x6cc0('0xf')](this));ami['on'](_0x6cc0('0x12'),this[_0x6cc0('0x13')][_0x6cc0('0xf')](this));return this[_0x6cc0('0x14')]();}function showSipRegistrations(){Promise[_0x6cc0('0x15')]()[_0x6cc0('0x16')](ami[_0x6cc0('0x17')]())[_0x6cc0('0x18')](function(_0x381312){logger['error'](_0x6cc0('0x19'),util['inspect'](_0x381312,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami[_0x6cc0('0x1a')]())[_0x6cc0('0x18')](function(_0x5c18af){logger['error'](_0x6cc0('0x1b'),util['inspect'](_0x5c18af,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x6cc0('0x16')](ami[_0x6cc0('0x1c')]())[_0x6cc0('0x18')](function(_0x5b1798){logger[_0x6cc0('0x1d')](_0x6cc0('0x1e'),util[_0x6cc0('0x1f')](_0x5b1798,{'showHidden':![],'depth':null}));});}UserReport[_0x6cc0('0x20')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x6cc0('0x16')](showSipRegistrations())['then'](listDeviceStates())[_0x6cc0('0x16')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x6cc0('0x21')]=function(_0x37ec78){return _0x37ec78!==null&&!_[_0x6cc0('0x22')](_0x37ec78);};UserReport[_0x6cc0('0x20')][_0x6cc0('0x23')]=function(_0x447777,_0x5e062a,_0x48f8ce){io['to'](_0x447777)[_0x6cc0('0x23')](_0x5e062a,_0x48f8ce);};UserReport[_0x6cc0('0x20')]['syncRegistry']=function(_0x7009af){try{if(this[_0x6cc0('0x21')](_0x7009af)){logger[_0x6cc0('0x24')](_0x6cc0('0x25'),_0x7009af['username'],_0x7009af['state']);logger[_0x6cc0('0x26')](_0x6cc0('0x27'),util[_0x6cc0('0x1f')](_0x7009af,{'showHidden':![],'depth':null}));var _0x4a401a=_['find'](this[_0x6cc0('0xa')],{'defaultuser':_0x7009af['username']});if(_0x4a401a){_0x7009af[_0x6cc0('0x28')]=_0x7009af['state'];_[_0x6cc0('0x29')](_0x4a401a,_[_0x6cc0('0x2a')](_0x7009af,[_0x6cc0('0x2b'),'actionid','username',_0x6cc0('0x2c')]));logger['debug'](_0x6cc0('0x2d'),util['inspect'](_0x4a401a,{'showHidden':![],'depth':null}));this['emit'](util[_0x6cc0('0x2e')](_0x6cc0('0x2f'),_0x4a401a[_0x6cc0('0x30')]),_0x6cc0('0x31'),_0x4a401a);}}}catch(_0x1b4d85){logger[_0x6cc0('0x1d')](_0x6cc0('0x27'),util['inspect'](_0x1b4d85,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6cc0('0x11')]=function(_0x576c8b){try{if(this['isNotNull'](_0x576c8b)){logger[_0x6cc0('0x24')](_0x6cc0('0x32'),_0x576c8b[_0x6cc0('0x33')],_0x576c8b[_0x6cc0('0x2c')]);logger[_0x6cc0('0x26')](_0x6cc0('0x34'),util[_0x6cc0('0x1f')](_0x576c8b,{'showHidden':![],'depth':null}));if(this[_0x6cc0('0xb')][_0x576c8b['device']]){if(!this[_0x6cc0('0xb')][_0x576c8b[_0x6cc0('0x33')]][_0x6cc0('0x35')]||_0x576c8b[_0x6cc0('0x2c')][_0x6cc0('0x36')]()==_0x6cc0('0x37')){this[_0x6cc0('0xb')][_0x576c8b['device']]['local']=![];if(this['agents'][_0x576c8b['device']][_0x6cc0('0x2c')]!==_0x576c8b[_0x6cc0('0x2c')][_0x6cc0('0x36')]()){this[_0x6cc0('0xb')][_0x576c8b[_0x6cc0('0x33')]][_0x6cc0('0x38')]=_[_0x6cc0('0x39')](moment()['format']('x'));}this['agents'][_0x576c8b['device']][_0x6cc0('0x2c')]=_0x576c8b['state'][_0x6cc0('0x36')]();this['agents'][_0x576c8b[_0x6cc0('0x33')]]['updateStatusRealtime'](_0x576c8b);}}else if(this[_0x6cc0('0xc')][_0x576c8b[_0x6cc0('0x33')]]){if(this[_0x6cc0('0xc')][_0x576c8b[_0x6cc0('0x33')]]['state']!==_0x576c8b[_0x6cc0('0x2c')][_0x6cc0('0x36')]()){this[_0x6cc0('0xc')][_0x576c8b['device']]['stateTime']=_[_0x6cc0('0x39')](moment()[_0x6cc0('0x2e')]('x'));}this['telephones'][_0x576c8b['device']]['state']=_0x576c8b[_0x6cc0('0x2c')][_0x6cc0('0x36')]();logger[_0x6cc0('0x26')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x6cc0('0x1f')](this['telephones'][_0x576c8b[_0x6cc0('0x33')]],{'showHidden':![],'depth':null}));this[_0x6cc0('0x23')](util[_0x6cc0('0x2e')](_0x6cc0('0x3a'),this[_0x6cc0('0xc')][_0x576c8b[_0x6cc0('0x33')]][_0x6cc0('0x30')]),_0x6cc0('0x3b'),this[_0x6cc0('0xc')][_0x576c8b['device']]);}else if(this['trunks'][_0x576c8b[_0x6cc0('0x33')]]){if(this[_0x6cc0('0xa')][_0x576c8b[_0x6cc0('0x33')]][_0x6cc0('0x2c')]!==_0x576c8b[_0x6cc0('0x2c')][_0x6cc0('0x36')]()){this['trunks'][_0x576c8b['device']][_0x6cc0('0x38')]=_['toNumber'](moment()[_0x6cc0('0x2e')]('x'));}this['trunks'][_0x576c8b[_0x6cc0('0x33')]][_0x6cc0('0x2c')]=_0x576c8b[_0x6cc0('0x2c')]['toLowerCase']();logger['debug'](_0x6cc0('0x3c'),util[_0x6cc0('0x1f')](this[_0x6cc0('0xa')][_0x576c8b['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0x6cc0('0x2e')](_0x6cc0('0x2f'),this[_0x6cc0('0xa')][_0x576c8b['device']][_0x6cc0('0x30')]),'trunk:save',this[_0x6cc0('0xa')][_0x576c8b[_0x6cc0('0x33')]]);}else if(_['startsWith'](_0x576c8b[_0x6cc0('0x33')],_0x6cc0('0x3d'))){var _0x43b564=_0x576c8b['device'];var _0x377966=_0x43b564[_0x6cc0('0x3e')](_0x43b564[_0x6cc0('0x3f')]('/')+0x1,_0x43b564[_0x6cc0('0x3f')]('@'));var _0x20ad0c=_['find'](this['agents'],function(_0x5075a0){return _0x5075a0[_0x6cc0('0x40')]==_0x377966||_0x5075a0[_0x6cc0('0x41')]==_0x377966||_0x5075a0[_0x6cc0('0x42')]==_0x377966;});if(_0x20ad0c){if(_0x20ad0c[_0x6cc0('0x2c')]!==_0x576c8b[_0x6cc0('0x2c')][_0x6cc0('0x36')]()){_0x20ad0c['stateTime']=_['toNumber'](moment()[_0x6cc0('0x2e')]('x'));}_0x20ad0c[_0x6cc0('0x2c')]=_0x576c8b['state'][_0x6cc0('0x36')]();_0x20ad0c[_0x6cc0('0x35')]=!![];_0x20ad0c[_0x6cc0('0x43')](_0x576c8b);}}}}catch(_0x18d063){logger['error']('[userReport][devicestatechange]',util[_0x6cc0('0x1f')](_0x18d063,{'showHidden':![],'depth':null}));}};UserReport[_0x6cc0('0x20')][_0x6cc0('0x13')]=function(_0x32b3cb){try{if(this[_0x6cc0('0x21')](_0x32b3cb)&&this['isNotNull'](_0x32b3cb[_0x6cc0('0x12')])){logger[_0x6cc0('0x24')](_0x6cc0('0x44'),_0x32b3cb['peer'],_0x32b3cb[_0x6cc0('0x45')],_0x32b3cb['peerstatus']);logger['debug'](_0x6cc0('0x46'),util['inspect'](_0x32b3cb,{'showHidden':![],'depth':null}));if(this[_0x6cc0('0xb')][_0x32b3cb['peer']]){if(!this[_0x6cc0('0xb')][_0x32b3cb[_0x6cc0('0x47')]][_0x6cc0('0x35')]||_0x32b3cb['peerstatus']['toLowerCase']()==_0x6cc0('0x48')){this[_0x6cc0('0xb')][_0x32b3cb[_0x6cc0('0x47')]][_0x6cc0('0x35')]=![];this['agents'][_0x32b3cb['peer']]['status']=_0x32b3cb[_0x6cc0('0x12')][_0x6cc0('0x36')]();this['agents'][_0x32b3cb['peer']][_0x6cc0('0x45')]=_0x32b3cb['address'];this[_0x6cc0('0xb')][_0x32b3cb['peer']][_0x6cc0('0x43')](_0x32b3cb);}}else if(this['telephones'][_0x32b3cb[_0x6cc0('0x47')]]){this[_0x6cc0('0xc')][_0x32b3cb[_0x6cc0('0x47')]][_0x6cc0('0x49')]=_0x32b3cb[_0x6cc0('0x12')][_0x6cc0('0x36')]();this[_0x6cc0('0xc')][_0x32b3cb[_0x6cc0('0x47')]][_0x6cc0('0x45')]=_0x32b3cb[_0x6cc0('0x45')];logger[_0x6cc0('0x26')](_0x6cc0('0x4a'),util[_0x6cc0('0x1f')](this['telephones'][_0x32b3cb['peer']],{'showHidden':![],'depth':null}));this[_0x6cc0('0x23')](util[_0x6cc0('0x2e')](_0x6cc0('0x3a'),this[_0x6cc0('0xc')][_0x32b3cb['peer']][_0x6cc0('0x30')]),'telephone:save',this[_0x6cc0('0xc')][_0x32b3cb[_0x6cc0('0x47')]]);}else if(this[_0x6cc0('0xa')][_0x32b3cb[_0x6cc0('0x47')]]){this[_0x6cc0('0xa')][_0x32b3cb[_0x6cc0('0x47')]]['status']=_0x32b3cb[_0x6cc0('0x12')][_0x6cc0('0x36')]();this['trunks'][_0x32b3cb[_0x6cc0('0x47')]][_0x6cc0('0x45')]=_0x32b3cb['address'];logger[_0x6cc0('0x26')](_0x6cc0('0x4b'),util['inspect'](this['trunks'][_0x32b3cb[_0x6cc0('0x47')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x6cc0('0x2e')](_0x6cc0('0x2f'),this[_0x6cc0('0xa')][_0x32b3cb['peer']][_0x6cc0('0x30')]),_0x6cc0('0x31'),this[_0x6cc0('0xa')][_0x32b3cb['peer']]);}}}catch(_0x52957e){logger['error'](_0x6cc0('0x46'),util[_0x6cc0('0x1f')](_0x52957e,{'showHidden':![],'depth':null}));}};module[_0x6cc0('0x4c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index e4e5ef6..7f35f78 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 _0xb766=['moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','custom:agentcalled','interface','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports'];(function(_0xab58e1,_0x5d47ce){var _0x295351=function(_0x43f2a7){while(--_0x43f2a7){_0xab58e1['push'](_0xab58e1['shift']());}};_0x295351(++_0x5d47ce);}(_0xb766,0x9b));var _0x6b76=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0xb766[_0xfb0281];return _0x408dd3;};'use strict';var _=require('lodash');var moment=require(_0x6b76('0x0'));var util=require(_0x6b76('0x1'));var Redis=require(_0x6b76('0x2'));var config=require(_0x6b76('0x3'));var logger=require(_0x6b76('0x4'))('ami');var ami=require(_0x6b76('0x5'));config[_0x6b76('0x6')]=_[_0x6b76('0x7')](config[_0x6b76('0x6')],{'host':_0x6b76('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6b76('0x6')]));function VoiceAgentReport(_0x6ab46e){this['channels']={};this['voiceChannels']=_0x6ab46e[_0x6b76('0x9')];this[_0x6b76('0xa')]=_0x6ab46e[_0x6b76('0xa')];this[_0x6b76('0xb')]=_0x6ab46e['agents'];this[_0x6b76('0xc')]={};ami['on'](_0x6b76('0xd'),this[_0x6b76('0xe')][_0x6b76('0xf')](this));ami['on'](_0x6b76('0x10'),this[_0x6b76('0x11')][_0x6b76('0xf')](this));ami['on'](_0x6b76('0x12'),this['syncAgentRingNoAnswer'][_0x6b76('0xf')](this));ami['on'](_0x6b76('0x13'),this['syncQueueCallerAbandon'][_0x6b76('0xf')](this));ami['on'](_0x6b76('0x14'),this[_0x6b76('0x15')][_0x6b76('0xf')](this));ami['on'](_0x6b76('0x16'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0x6b76('0x17')][_0x6b76('0xf')](this));ami['on'](_0x6b76('0x18'),this['syncMusicOnHoldStart'][_0x6b76('0xf')](this));ami['on'](_0x6b76('0x19'),this[_0x6b76('0x1a')][_0x6b76('0xf')](this));ami['on']('attendedtransfer',this[_0x6b76('0x1b')]['bind'](this));ami['on'](_0x6b76('0x1c'),this[_0x6b76('0x1d')][_0x6b76('0xf')](this));}VoiceAgentReport[_0x6b76('0x1e')][_0x6b76('0x1f')]=function(_0x24f792,_0x183bff,_0x570067){io['to'](_0x24f792)[_0x6b76('0x1f')](_0x183bff,_0x570067);};VoiceAgentReport[_0x6b76('0x1e')]['isNotNull']=function(_0x5e2fca){return _0x5e2fca!==null&&!_[_0x6b76('0x20')](_0x5e2fca);};VoiceAgentReport[_0x6b76('0x1e')]['syncAgentCalled']=function(_0x35568a){try{if(this[_0x6b76('0x21')](_0x35568a)){logger[_0x6b76('0x22')](_0x6b76('0x23'),_0x35568a[_0x6b76('0x24')],_0x35568a[_0x6b76('0x25')],_0x35568a[_0x6b76('0x26')]);logger[_0x6b76('0x27')](_0x6b76('0x28'),_0x35568a[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x35568a,{'showHidden':![],'depth':null}));if(_[_0x6b76('0x20')](this[_0x6b76('0x9')][_0x35568a[_0x6b76('0x24')]])){this['channels'][_0x35568a[_0x6b76('0x24')]]={};}if(_['isUndefined'](this['channels'][_0x35568a[_0x6b76('0x24')]][_0x35568a[_0x6b76('0x26')]])){this[_0x6b76('0x9')][_0x35568a[_0x6b76('0x24')]][_0x35568a[_0x6b76('0x26')]]={'agentcalledAt':moment()[_0x6b76('0x2a')](_0x6b76('0x2b')),'lastevent':'called','mandatoryDisposition':this[_0x6b76('0xa')][_0x35568a['queue']]?this[_0x6b76('0xa')][_0x35568a[_0x6b76('0x2c')]][_0x6b76('0x2d')]||![]:![],'type':this[_0x6b76('0xa')][_0x35568a[_0x6b76('0x2c')]]?this[_0x6b76('0xa')][_0x35568a[_0x6b76('0x2c')]][_0x6b76('0x2e')]||'inbound':_0x6b76('0x2f'),'variables':this[_0x6b76('0xc')][_0x35568a[_0x6b76('0x24')]],'motionChannel':_0x6b76('0x30')};}_[_0x6b76('0x31')](this['channels'][_0x35568a[_0x6b76('0x24')]][_0x35568a[_0x6b76('0x26')]],_[_0x6b76('0x32')](_0x35568a,[_0x6b76('0x33'),'privilege']));logger[_0x6b76('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x35568a[_0x6b76('0x24')],util[_0x6b76('0x29')](this[_0x6b76('0x9')][_0x35568a[_0x6b76('0x24')]][_0x35568a[_0x6b76('0x26')]],{'showHidden':![],'depth':null}));ami[_0x6b76('0x1f')](_0x6b76('0x34'),this[_0x6b76('0x9')][_0x35568a['uniqueid']][_0x35568a['destuniqueid']]);var _0xed65b5={'id':this[_0x6b76('0xb')][_0x35568a[_0x6b76('0x35')]]['id'],'calleridnum':this[_0x6b76('0x9')][_0x35568a[_0x6b76('0x24')]][_0x35568a['destuniqueid']]['calleridnum'],'queue':this[_0x6b76('0x9')][_0x35568a['uniqueid']][_0x35568a[_0x6b76('0x26')]][_0x6b76('0x2c')],'variables':this[_0x6b76('0x9')][_0x35568a['uniqueid']][_0x35568a[_0x6b76('0x26')]][_0x6b76('0xc')]};logger['debug'](_0x6b76('0x36'),_0x35568a[_0x6b76('0x24')],util[_0x6b76('0x29')](_0xed65b5,{'showHidden':![],'depth':null}));this['emit'](util[_0x6b76('0x2a')]('user:%s',_0x35568a[_0x6b76('0x25')]),_0x6b76('0x37'),_0xed65b5);}}catch(_0x43d2e9){logger[_0x6b76('0x38')]('[%s][voiceAgentReport][agentcalled]',_0x35568a[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x43d2e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6b76('0x1e')]['syncAgentConnect']=function(_0x3b0c1d){try{if(this[_0x6b76('0x21')](_0x3b0c1d)){if(this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]]){logger[_0x6b76('0x27')](_0x6b76('0x39'),_0x3b0c1d[_0x6b76('0x24')],util['inspect'](_0x3b0c1d,{'showHidden':![],'depth':null}));for(var _0x3b7a88 in this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]]){if(this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x6b76('0x3a')](_0x3b7a88)){if(_0x3b0c1d[_0x6b76('0x26')]===_0x3b7a88){logger[_0x6b76('0x22')](_0x6b76('0x3b'),_0x3b0c1d['uniqueid'],_0x3b0c1d[_0x6b76('0x25')],_0x3b0c1d[_0x6b76('0x26')]);this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88]['agentconnectAt']=moment()[_0x6b76('0x2a')](_0x6b76('0x2b'));this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88]['connectedlinename']=_0x3b0c1d[_0x6b76('0x3c')];this[_0x6b76('0x9')][_0x3b0c1d['uniqueid']][_0x3b7a88][_0x6b76('0x3d')]=_0x3b0c1d[_0x6b76('0x3d')];this['channels'][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x3e')]=_0x3b0c1d[_0x6b76('0x3e')];this[_0x6b76('0x9')][_0x3b0c1d['uniqueid']][_0x3b7a88][_0x6b76('0x3f')]=_0x3b0c1d[_0x6b76('0x3f')];this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x40')]=_0x3b0c1d[_0x6b76('0x40')];this['channels'][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x41')]=_0x6b76('0x42');if(this['voiceChannels'][this['channels'][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88]['uniqueid']]){var _0x190729=this[_0x6b76('0x43')][this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88]['uniqueid']][_0x6b76('0x44')];this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x44')]=_0x190729;_0x3b0c1d[_0x6b76('0x44')]=_0x190729;}_[_0x6b76('0x31')](this[_0x6b76('0xb')][_0x3b0c1d['interface']],_[_0x6b76('0x45')](_0x3b0c1d,[_0x6b76('0x2c'),_0x6b76('0x46'),_0x6b76('0x44')]));logger['debug'](_0x6b76('0x47'),_0x3b0c1d[_0x6b76('0x24')],util[_0x6b76('0x29')](this[_0x6b76('0x9')][_0x3b0c1d['uniqueid']][_0x3b0c1d[_0x6b76('0x26')]],{'showHidden':![],'depth':null}));ami[_0x6b76('0x1f')](_0x6b76('0x48'),this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b0c1d[_0x6b76('0x26')]]);logger[_0x6b76('0x27')](_0x6b76('0x49'),_0x3b0c1d[_0x6b76('0x24')],util['inspect'](this['channels'][_0x3b0c1d['uniqueid']][_0x3b0c1d[_0x6b76('0x26')]],{'showHidden':![],'depth':null}));this[_0x6b76('0x1f')](util[_0x6b76('0x2a')](_0x6b76('0x4a'),_0x3b0c1d[_0x6b76('0x25')]),_0x6b76('0x4b'),this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b0c1d['destuniqueid']]);}else if(!this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x12')]&&!this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x14')]){logger[_0x6b76('0x22')](_0x6b76('0x4c'),_0x3b0c1d[_0x6b76('0x24')],this[_0x6b76('0x9')][_0x3b0c1d['uniqueid']][_0x3b7a88]['membername'],_0x3b7a88);this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x12')]=!![];this['channels'][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x4d')]=moment()[_0x6b76('0x2a')](_0x6b76('0x2b'));this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x4e')]=_0x3b0c1d[_0x6b76('0x26')];this[_0x6b76('0x9')][_0x3b0c1d['uniqueid']][_0x3b7a88]['answeredelsewheremembername']=_0x3b0c1d[_0x6b76('0x25')];this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x41')]=_0x6b76('0x4f');this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88][_0x6b76('0x50')]=_0x6b76('0x4f');logger['debug'](_0x6b76('0x51'),_0x3b0c1d[_0x6b76('0x24')],util[_0x6b76('0x29')](this['channels'][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88],{'showHidden':![],'depth':null}));ami[_0x6b76('0x1f')](_0x6b76('0x52'),this[_0x6b76('0x9')][_0x3b0c1d[_0x6b76('0x24')]][_0x3b7a88]);}}}}}}catch(_0x530887){logger[_0x6b76('0x38')](_0x6b76('0x53'),_0x3b0c1d[_0x6b76('0x24')],util['inspect'](_0x530887,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6b76('0x1e')][_0x6b76('0x54')]=function(_0x5b38b8){try{if(this[_0x6b76('0x21')](_0x5b38b8)){logger[_0x6b76('0x27')](_0x6b76('0x55'),_0x5b38b8[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x5b38b8,{'showHidden':![],'depth':null}));if(this['channels'][_0x5b38b8[_0x6b76('0x24')]]&&this['channels'][_0x5b38b8['uniqueid']][_0x5b38b8[_0x6b76('0x26')]]){logger[_0x6b76('0x22')](_0x6b76('0x56'),_0x5b38b8[_0x6b76('0x24')],_0x5b38b8[_0x6b76('0x25')],_0x5b38b8[_0x6b76('0x26')]);this[_0x6b76('0x9')][_0x5b38b8['uniqueid']][_0x5b38b8['destuniqueid']]['agentringnoanswer']=!![];this[_0x6b76('0x9')][_0x5b38b8[_0x6b76('0x24')]][_0x5b38b8[_0x6b76('0x26')]][_0x6b76('0x4d')]=moment()[_0x6b76('0x2a')](_0x6b76('0x2b'));this[_0x6b76('0x9')][_0x5b38b8['uniqueid']][_0x5b38b8[_0x6b76('0x26')]][_0x6b76('0x41')]='rejected';this[_0x6b76('0x9')][_0x5b38b8[_0x6b76('0x24')]][_0x5b38b8['destuniqueid']][_0x6b76('0x50')]=_0x6b76('0x57');logger[_0x6b76('0x27')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5b38b8[_0x6b76('0x24')],util[_0x6b76('0x29')](this[_0x6b76('0x9')][_0x5b38b8[_0x6b76('0x24')]][_0x5b38b8[_0x6b76('0x26')]],{'showHidden':![],'depth':null}));ami[_0x6b76('0x1f')]('custom:agentringnoanswer',this['channels'][_0x5b38b8['uniqueid']][_0x5b38b8[_0x6b76('0x26')]]);}}}catch(_0x328761){logger[_0x6b76('0x38')](_0x6b76('0x58'),_0x5b38b8['uniqueid'],util[_0x6b76('0x29')](_0x328761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6b76('0x1e')]['syncQueueCallerAbandon']=function(_0x22cc20){try{if(this[_0x6b76('0x21')](_0x22cc20)){logger[_0x6b76('0x27')](_0x6b76('0x59'),_0x22cc20['uniqueid'],util[_0x6b76('0x29')](_0x22cc20,{'showHidden':![],'depth':null}));if(this[_0x6b76('0x9')][_0x22cc20['uniqueid']]){for(var _0x2ddb9d in this['channels'][_0x22cc20['uniqueid']]){if(this[_0x6b76('0x9')][_0x22cc20['uniqueid']][_0x6b76('0x3a')](_0x2ddb9d)&&!this[_0x6b76('0x9')][_0x22cc20[_0x6b76('0x24')]][_0x2ddb9d][_0x6b76('0x12')]&&!this[_0x6b76('0x9')][_0x22cc20['uniqueid']][_0x2ddb9d][_0x6b76('0x14')]){logger[_0x6b76('0x22')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x22cc20[_0x6b76('0x24')],this['channels'][_0x22cc20[_0x6b76('0x24')]][_0x2ddb9d]['membername'],_0x2ddb9d);this[_0x6b76('0x9')][_0x22cc20['uniqueid']][_0x2ddb9d][_0x6b76('0x12')]=!![];this['channels'][_0x22cc20[_0x6b76('0x24')]][_0x2ddb9d]['agentringnoanswerAt']=moment()[_0x6b76('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6b76('0x9')][_0x22cc20[_0x6b76('0x24')]][_0x2ddb9d][_0x6b76('0x41')]=_0x6b76('0x5a');this[_0x6b76('0x9')][_0x22cc20[_0x6b76('0x24')]][_0x2ddb9d][_0x6b76('0x50')]=_0x6b76('0x5a');logger[_0x6b76('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x22cc20[_0x6b76('0x24')],util[_0x6b76('0x29')](this[_0x6b76('0x9')][_0x22cc20[_0x6b76('0x24')]][_0x2ddb9d],{'showHidden':![],'depth':null}));ami[_0x6b76('0x1f')]('custom:agentqueuecallerabandon',this['channels'][_0x22cc20[_0x6b76('0x24')]][_0x2ddb9d]);}}}}}catch(_0x3d656a){logger[_0x6b76('0x38')](_0x6b76('0x5b'),_0x22cc20[_0x6b76('0x24')],util['inspect'](_0x3d656a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6b76('0x1e')][_0x6b76('0x15')]=function(_0x49e347){try{if(this[_0x6b76('0x21')](_0x49e347)){logger['debug'](_0x6b76('0x5c'),_0x49e347[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x49e347,{'showHidden':![],'depth':null}));if(this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]]){for(var _0x37cec7 in this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]]){if(this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]][_0x6b76('0x3a')](_0x37cec7)){if(this['channels'][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x5d')]&&!this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x14')]){logger[_0x6b76('0x22')](_0x6b76('0x5e'),_0x49e347[_0x6b76('0x24')],this['channels'][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x25')],_0x37cec7);this[_0x6b76('0x9')][_0x49e347['uniqueid']][_0x37cec7]['agentcomplete']=!![];this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x5f')]=moment()[_0x6b76('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x41')]=_0x6b76('0x60');this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x50')]=_0x49e347['reason']==_0x6b76('0x61')?_0x6b76('0x62'):_0x49e347[_0x6b76('0x50')];this[_0x6b76('0x9')][_0x49e347['uniqueid']][_0x37cec7][_0x6b76('0x63')]=_0x49e347['talktime'];if(this[_0x6b76('0xa')][_0x49e347[_0x6b76('0x2c')]]&&this[_0x6b76('0xa')][_0x49e347[_0x6b76('0x2c')]][_0x6b76('0x64')]){this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x65')]=this[_0x6b76('0xa')][_0x49e347[_0x6b76('0x2c')]][_0x6b76('0x66')];this['channels'][_0x49e347[_0x6b76('0x24')]][_0x37cec7][_0x6b76('0x67')]=!![];}this['agents'][_0x49e347[_0x6b76('0x35')]]=_[_0x6b76('0x32')](this[_0x6b76('0xb')][_0x49e347[_0x6b76('0x35')]],[_0x6b76('0x2c'),_0x6b76('0x46')]);logger[_0x6b76('0x27')](_0x6b76('0x68'),_0x49e347[_0x6b76('0x24')],util[_0x6b76('0x29')](this['channels'][_0x49e347[_0x6b76('0x24')]][_0x37cec7],{'showHidden':![],'depth':null}));ami[_0x6b76('0x1f')](_0x6b76('0x69'),this[_0x6b76('0x9')][_0x49e347[_0x6b76('0x24')]][_0x37cec7]);logger[_0x6b76('0x27')](_0x6b76('0x6a'),_0x49e347[_0x6b76('0x24')],util[_0x6b76('0x29')]({'id':this['agents'][_0x49e347['interface']]['id'],'destaccountcode':_0x49e347['destaccountcode']},{'showHidden':![],'depth':null}));this[_0x6b76('0x1f')](util[_0x6b76('0x2a')]('user:%s',_0x49e347[_0x6b76('0x25')]),'user:agentcomplete',{'id':this[_0x6b76('0xb')][_0x49e347['interface']]['id'],'destaccountcode':_0x49e347[_0x6b76('0x6b')]});}}}}}}catch(_0x243cd9){logger[_0x6b76('0x38')](_0x6b76('0x6c'),_0x49e347[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x243cd9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6b76('0x1e')][_0x6b76('0x6d')]=function(_0x533d2c){try{if(this[_0x6b76('0x21')](_0x533d2c)){logger[_0x6b76('0x27')](_0x6b76('0x6e'),_0x533d2c['uniqueid'],util[_0x6b76('0x29')](_0x533d2c,{'showHidden':![],'depth':null}));this[_0x6b76('0x6f')](_0x533d2c[_0x6b76('0x24')],_[_0x6b76('0x70')](_0x533d2c[_0x6b76('0x71')])[0x0],_0x533d2c['value']);if(this['channels'][_0x533d2c[_0x6b76('0x24')]]){for(var _0x5628df in this['channels'][_0x533d2c['uniqueid']]){if(this[_0x6b76('0x9')][_0x533d2c[_0x6b76('0x24')]][_0x6b76('0x3a')](_0x5628df)){logger['info'](_0x6b76('0x72'),_0x533d2c[_0x6b76('0x24')],_0x5628df,_['keys'](_0x533d2c[_0x6b76('0x71')])[0x0],_0x533d2c[_0x6b76('0x73')]);if(_[_0x6b76('0x20')](this[_0x6b76('0x9')][_0x533d2c[_0x6b76('0x24')]][_0x5628df]['variables'])){this[_0x6b76('0x9')][_0x533d2c[_0x6b76('0x24')]][_0x5628df]['variables']={};}this[_0x6b76('0x9')][_0x533d2c[_0x6b76('0x24')]][_0x5628df][_0x6b76('0xc')]=this['variables'][_0x533d2c[_0x6b76('0x24')]];}}}}}catch(_0xad7f90){logger[_0x6b76('0x38')]('[%s][voiceAgentReport][varset]',_0x533d2c[_0x6b76('0x24')],util['inspect'](_0xad7f90,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6b76('0x1e')][_0x6b76('0x6f')]=function(_0x3e84c3,_0x4dc9f2,_0x47380d){var _0x1ddb70=[_0x6b76('0x74'),_0x6b76('0x75'),_0x6b76('0x76'),'rtpaudioqosjitterbridged',_0x6b76('0x77'),_0x6b76('0x78'),_0x6b76('0x79'),'rtpaudioqosrttbridged',_0x6b76('0x7a'),'sipuri',_0x6b76('0x7b'),_0x6b76('0x7c'),'membercalls',_0x6b76('0x7d'),_0x6b76('0x7e'),_0x6b76('0x7f'),_0x6b76('0x25'),_0x6b76('0x80'),_0x6b76('0x81')];if(!_[_0x6b76('0x82')](_0x4dc9f2)&&!_[_0x6b76('0x83')](_0x1ddb70,_0x4dc9f2)){if(_[_0x6b76('0x20')](this[_0x6b76('0xc')][_0x3e84c3])){this['variables'][_0x3e84c3]={};}this[_0x6b76('0xc')][_0x3e84c3][_0x4dc9f2]=_0x47380d;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x231e95){try{if(this[_0x6b76('0x21')](_0x231e95)){logger['debug'](_0x6b76('0x84'),_0x231e95['uniqueid'],util['inspect'](_0x231e95,{'showHidden':![],'depth':null}));if(this[_0x6b76('0x9')][_0x231e95[_0x6b76('0x24')]]){for(var _0x2fc360 in this['channels'][_0x231e95[_0x6b76('0x24')]]){if(this[_0x6b76('0x9')][_0x231e95['uniqueid']][_0x6b76('0x3a')](_0x2fc360)){if(this[_0x6b76('0x9')][_0x231e95[_0x6b76('0x24')]][_0x2fc360][_0x6b76('0x50')]==_0x6b76('0x61')&&this[_0x6b76('0x9')][_0x231e95[_0x6b76('0x24')]][_0x2fc360][_0x6b76('0x14')]){logger[_0x6b76('0x22')](_0x6b76('0x85'),_0x231e95[_0x6b76('0x24')],_0x2fc360);this[_0x6b76('0x9')][_0x231e95[_0x6b76('0x24')]][_0x2fc360][_0x6b76('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x6b76('0x27')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x231e95[_0x6b76('0x24')],util[_0x6b76('0x29')](_[_0x6b76('0x86')](this[_0x6b76('0x9')][_0x231e95[_0x6b76('0x24')]]),{'showHidden':![],'depth':null}));ami[_0x6b76('0x1f')](_0x6b76('0x87'),_[_0x6b76('0x86')](this[_0x6b76('0x9')][_0x231e95[_0x6b76('0x24')]]));delete this[_0x6b76('0x9')][_0x231e95[_0x6b76('0x24')]];}if(this['variables'][_0x231e95['uniqueid']]){delete this[_0x6b76('0xc')][_0x231e95[_0x6b76('0x24')]];}}}catch(_0x4e9f7f){logger[_0x6b76('0x38')](_0x6b76('0x88'),_0x231e95[_0x6b76('0x24')],util['inspect'](_0x4e9f7f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6b76('0x1b')]=function(_0xf08b95){try{if(this[_0x6b76('0x21')](_0xf08b95)){logger[_0x6b76('0x27')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0xf08b95['uniqueid'],util['inspect'](_0xf08b95,{'showHidden':![],'depth':null}));if(this['channels'][_0xf08b95[_0x6b76('0x89')]]){for(var _0x348d9a in this['channels'][_0xf08b95[_0x6b76('0x89')]]){if(this[_0x6b76('0x9')][_0xf08b95[_0x6b76('0x89')]]['hasOwnProperty'](_0x348d9a)){if(_0xf08b95[_0x6b76('0x8a')]===_0x348d9a){logger['info']('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xf08b95[_0x6b76('0x24')],this['channels'][_0xf08b95[_0x6b76('0x89')]][_0x348d9a][_0x6b76('0x25')],_0x348d9a);var _0x34aa57=moment();this[_0x6b76('0x9')][_0xf08b95[_0x6b76('0x89')]][_0x348d9a][_0x6b76('0x14')]=!![];this['channels'][_0xf08b95['transfereeuniqueid']][_0x348d9a][_0x6b76('0x5f')]=moment()[_0x6b76('0x2a')](_0x6b76('0x2b'));this['channels'][_0xf08b95['transfereeuniqueid']][_0x348d9a]['lastevent']='complete';this[_0x6b76('0x9')][_0xf08b95['transfereeuniqueid']][_0x348d9a][_0x6b76('0x50')]=_0x6b76('0x61');this[_0x6b76('0x9')][_0xf08b95['transfereeuniqueid']][_0x348d9a]['talktime']=_0x34aa57['diff'](this[_0x6b76('0x9')][_0xf08b95[_0x6b76('0x89')]][_0x348d9a][_0x6b76('0x5d')],_0x6b76('0x8b'));}}}}if(this['channels'][_0xf08b95['secondtransfereruniqueid']]){var _0xec9356=this[_0x6b76('0x9')][_0xf08b95[_0x6b76('0x8c')]];this[_0x6b76('0x9')][_0xf08b95[_0x6b76('0x8c')]]=this['channels'][_0xf08b95['transfereeuniqueid']];this['channels'][_0xf08b95[_0x6b76('0x89')]]=_0xec9356;}}}catch(_0x358620){logger[_0x6b76('0x38')]('[%s][voiceAgentReport][attendedtransfer]',_0xf08b95[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x358620,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6b76('0x1e')][_0x6b76('0x1d')]=function(_0x2e9e09){try{if(this[_0x6b76('0x21')](_0x2e9e09)){logger['debug'](_0x6b76('0x8d'),_0x2e9e09[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x2e9e09,{'showHidden':![],'depth':null}));if(this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]]){for(var _0x54c56e in this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]]){if(this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]][_0x6b76('0x3a')](_0x54c56e)){if(_0x2e9e09['transfereruniqueid']===_0x54c56e){logger['info'](_0x6b76('0x8e'),_0x2e9e09[_0x6b76('0x24')],this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]][_0x54c56e]['membername'],_0x54c56e);var _0x39a554=moment();this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]][_0x54c56e][_0x6b76('0x14')]=!![];this[_0x6b76('0x9')][_0x2e9e09['transfereeuniqueid']][_0x54c56e]['agentcompleteAt']=_0x39a554;this[_0x6b76('0x9')][_0x2e9e09['transfereeuniqueid']][_0x54c56e][_0x6b76('0x41')]='complete';this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]][_0x54c56e]['reason']='transfer';this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]][_0x54c56e][_0x6b76('0x63')]=_0x39a554[_0x6b76('0x8f')](this[_0x6b76('0x9')][_0x2e9e09[_0x6b76('0x89')]][_0x54c56e][_0x6b76('0x5d')],_0x6b76('0x8b'));}}}}}}catch(_0x43b8ad){logger[_0x6b76('0x38')]('[%s][voiceAgentReport][blindtransfer]',_0x2e9e09[_0x6b76('0x24')],util['inspect'](_0x43b8ad,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6b76('0x90')]=function(_0x505560){var _0x5d586b='';try{if(this['isNotNull'](_0x505560)){logger['debug'](_0x6b76('0x91'),_0x505560['uniqueid'],util[_0x6b76('0x29')](_0x505560,{'showHidden':![],'depth':null}));if(_0x505560[_0x6b76('0x92')]){_0x5d586b=_0x505560[_0x6b76('0x92')][_0x6b76('0x93')](0x0,_0x505560[_0x6b76('0x92')][_0x6b76('0x94')]('-'));if(this['agents'][_0x5d586b]){logger[_0x6b76('0x22')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x505560[_0x6b76('0x24')],_0x5d586b);this[_0x6b76('0xb')][_0x5d586b][_0x6b76('0x95')]=!![];}}}}catch(_0x10b94b){logger[_0x6b76('0x38')](_0x6b76('0x96'),_0x505560['uniqueid'],util['inspect'](_0x10b94b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6b76('0x1a')]=function(_0x1ad2fe){var _0x297bd8='';try{if(this['isNotNull'](_0x1ad2fe)){logger[_0x6b76('0x27')](_0x6b76('0x97'),_0x1ad2fe[_0x6b76('0x24')],util[_0x6b76('0x29')](_0x1ad2fe,{'showHidden':![],'depth':null}));if(_0x1ad2fe[_0x6b76('0x92')]){_0x297bd8=_0x1ad2fe[_0x6b76('0x92')]['substring'](0x0,_0x1ad2fe[_0x6b76('0x92')][_0x6b76('0x94')]('-'));if(this[_0x6b76('0xb')][_0x297bd8]){logger['info'](_0x6b76('0x98'),_0x1ad2fe[_0x6b76('0x24')],_0x297bd8);this['agents'][_0x297bd8][_0x6b76('0x95')]=![];}}}}catch(_0x2888f3){logger[_0x6b76('0x38')](_0x6b76('0x99'),_0x1ad2fe['uniqueid'],util['inspect'](_0x2888f3,{'showHidden':![],'depth':null}));}};module[_0x6b76('0x9a')]=VoiceAgentReport; \ No newline at end of file +var _0x97c6=['attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','uniqueid','membername','debug','channels','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','variables','voice','merge','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','interface','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','pick','destconnectedlinenum','user:agentconnect','agentcomplete','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','agentcompleteAt','complete','transfer','agent','talktime','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','variable','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','voiceQueues','agents','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','musiconholdstop'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0x97c6,0x7a));var _0x697c=function(_0x3a94e1,_0x22e4fd){_0x3a94e1=_0x3a94e1-0x0;var _0x6a09d5=_0x97c6[_0x3a94e1];return _0x6a09d5;};'use strict';var _=require(_0x697c('0x0'));var moment=require('moment');var util=require(_0x697c('0x1'));var Redis=require(_0x697c('0x2'));var config=require(_0x697c('0x3'));var logger=require('../../../config/logger')(_0x697c('0x4'));var ami=require(_0x697c('0x5'));config[_0x697c('0x6')]=_[_0x697c('0x7')](config[_0x697c('0x6')],{'host':_0x697c('0x8'),'port':0x18eb});var io=require(_0x697c('0x9'))(new Redis(config[_0x697c('0x6')]));function VoiceAgentReport(_0x1bb83a){this['channels']={};this[_0x697c('0xa')]=_0x1bb83a['channels'];this[_0x697c('0xb')]=_0x1bb83a[_0x697c('0xb')];this[_0x697c('0xc')]=_0x1bb83a[_0x697c('0xc')];this['variables']={};ami['on']('agentcalled',this[_0x697c('0xd')][_0x697c('0xe')](this));ami['on']('agentconnect',this[_0x697c('0xf')][_0x697c('0xe')](this));ami['on'](_0x697c('0x10'),this[_0x697c('0x11')][_0x697c('0xe')](this));ami['on'](_0x697c('0x12'),this[_0x697c('0x13')][_0x697c('0xe')](this));ami['on']('agentcomplete',this[_0x697c('0x14')]['bind'](this));ami['on'](_0x697c('0x15'),this[_0x697c('0x16')][_0x697c('0xe')](this));ami['on'](_0x697c('0x17'),this['syncHangup'][_0x697c('0xe')](this));ami['on'](_0x697c('0x18'),this['syncMusicOnHoldStart'][_0x697c('0xe')](this));ami['on'](_0x697c('0x19'),this['syncMusicOnHoldStop'][_0x697c('0xe')](this));ami['on'](_0x697c('0x1a'),this['syncAttendedTransfer'][_0x697c('0xe')](this));ami['on']('blindtransfer',this[_0x697c('0x1b')][_0x697c('0xe')](this));}VoiceAgentReport[_0x697c('0x1c')][_0x697c('0x1d')]=function(_0x3e2ef9,_0x377542,_0x356dc3){io['to'](_0x3e2ef9)[_0x697c('0x1d')](_0x377542,_0x356dc3);};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0x1e')]=function(_0x43766f){return _0x43766f!==null&&!_[_0x697c('0x1f')](_0x43766f);};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0xd')]=function(_0x138575){try{if(this[_0x697c('0x1e')](_0x138575)){logger[_0x697c('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x138575[_0x697c('0x21')],_0x138575[_0x697c('0x22')],_0x138575['destuniqueid']);logger[_0x697c('0x23')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x138575['uniqueid'],util['inspect'](_0x138575,{'showHidden':![],'depth':null}));if(_[_0x697c('0x1f')](this[_0x697c('0x24')][_0x138575[_0x697c('0x21')]])){this['channels'][_0x138575[_0x697c('0x21')]]={};}if(_['isUndefined'](this[_0x697c('0x24')][_0x138575[_0x697c('0x21')]][_0x138575[_0x697c('0x25')]])){this[_0x697c('0x24')][_0x138575['uniqueid']][_0x138575[_0x697c('0x25')]]={'agentcalledAt':moment()[_0x697c('0x26')](_0x697c('0x27')),'lastevent':_0x697c('0x28'),'mandatoryDisposition':this[_0x697c('0xb')][_0x138575['queue']]?this[_0x697c('0xb')][_0x138575[_0x697c('0x29')]][_0x697c('0x2a')]||![]:![],'type':this[_0x697c('0xb')][_0x138575[_0x697c('0x29')]]?this[_0x697c('0xb')][_0x138575['queue']][_0x697c('0x2b')]||_0x697c('0x2c'):_0x697c('0x2c'),'variables':this[_0x697c('0x2d')][_0x138575['uniqueid']],'motionChannel':_0x697c('0x2e')};}_[_0x697c('0x2f')](this[_0x697c('0x24')][_0x138575[_0x697c('0x21')]][_0x138575[_0x697c('0x25')]],_[_0x697c('0x30')](_0x138575,['event',_0x697c('0x31')]));logger['debug'](_0x697c('0x32'),_0x138575[_0x697c('0x21')],util[_0x697c('0x33')](this[_0x697c('0x24')][_0x138575[_0x697c('0x21')]][_0x138575['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x697c('0x1d')](_0x697c('0x34'),this[_0x697c('0x24')][_0x138575[_0x697c('0x21')]][_0x138575[_0x697c('0x25')]]);var _0x308b47={'id':this[_0x697c('0xc')][_0x138575[_0x697c('0x35')]]['id'],'calleridnum':this[_0x697c('0x24')][_0x138575[_0x697c('0x21')]][_0x138575[_0x697c('0x25')]]['calleridnum'],'queue':this['channels'][_0x138575['uniqueid']][_0x138575[_0x697c('0x25')]][_0x697c('0x29')],'variables':this[_0x697c('0x24')][_0x138575['uniqueid']][_0x138575[_0x697c('0x25')]]['variables']};logger[_0x697c('0x23')](_0x697c('0x36'),_0x138575[_0x697c('0x21')],util['inspect'](_0x308b47,{'showHidden':![],'depth':null}));this[_0x697c('0x1d')](util['format'](_0x697c('0x37'),_0x138575[_0x697c('0x22')]),_0x697c('0x38'),_0x308b47);}}catch(_0x17f695){logger[_0x697c('0x39')](_0x697c('0x3a'),_0x138575[_0x697c('0x21')],util[_0x697c('0x33')](_0x17f695,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0xf')]=function(_0x5302ec){try{if(this['isNotNull'](_0x5302ec)){if(this[_0x697c('0x24')][_0x5302ec['uniqueid']]){logger[_0x697c('0x23')](_0x697c('0x3b'),_0x5302ec[_0x697c('0x21')],util[_0x697c('0x33')](_0x5302ec,{'showHidden':![],'depth':null}));for(var _0x69536b in this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]]){if(this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x697c('0x3c')](_0x69536b)){if(_0x5302ec[_0x697c('0x25')]===_0x69536b){logger[_0x697c('0x20')](_0x697c('0x3d'),_0x5302ec[_0x697c('0x21')],_0x5302ec[_0x697c('0x22')],_0x5302ec['destuniqueid']);this[_0x697c('0x24')][_0x5302ec['uniqueid']][_0x69536b][_0x697c('0x3e')]=moment()[_0x697c('0x26')](_0x697c('0x27'));this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b]['connectedlinename']=_0x5302ec[_0x697c('0x3f')];this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x40')]=_0x5302ec['connectedlinenum'];this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x41')]=_0x5302ec[_0x697c('0x41')];this[_0x697c('0x24')][_0x5302ec['uniqueid']][_0x69536b][_0x697c('0x42')]=_0x5302ec['destchannelstatedesc'];this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x43')]=_0x5302ec[_0x697c('0x43')];this['channels'][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x44')]=_0x697c('0x45');if(this[_0x697c('0xa')][this[_0x697c('0x24')][_0x5302ec['uniqueid']][_0x69536b][_0x697c('0x21')]]){var _0x56fa80=this[_0x697c('0xa')][this['channels'][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x21')]][_0x697c('0x46')];this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b]['routealias']=_0x56fa80;_0x5302ec[_0x697c('0x46')]=_0x56fa80;}_[_0x697c('0x2f')](this[_0x697c('0xc')][_0x5302ec[_0x697c('0x35')]],_[_0x697c('0x47')](_0x5302ec,[_0x697c('0x29'),_0x697c('0x48'),_0x697c('0x46')]));logger[_0x697c('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x5302ec[_0x697c('0x21')],util[_0x697c('0x33')](this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x5302ec[_0x697c('0x25')]],{'showHidden':![],'depth':null}));ami[_0x697c('0x1d')]('custom:agentconnect',this['channels'][_0x5302ec[_0x697c('0x21')]][_0x5302ec[_0x697c('0x25')]]);logger[_0x697c('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x5302ec[_0x697c('0x21')],util[_0x697c('0x33')](this['channels'][_0x5302ec[_0x697c('0x21')]][_0x5302ec[_0x697c('0x25')]],{'showHidden':![],'depth':null}));this[_0x697c('0x1d')](util[_0x697c('0x26')](_0x697c('0x37'),_0x5302ec[_0x697c('0x22')]),_0x697c('0x49'),this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x5302ec[_0x697c('0x25')]]);}else if(!this[_0x697c('0x24')][_0x5302ec['uniqueid']][_0x69536b][_0x697c('0x10')]&&!this['channels'][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x4a')]){logger[_0x697c('0x20')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x5302ec[_0x697c('0x21')],this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x22')],_0x69536b);this[_0x697c('0x24')][_0x5302ec['uniqueid']][_0x69536b]['agentringnoanswer']=!![];this[_0x697c('0x24')][_0x5302ec['uniqueid']][_0x69536b][_0x697c('0x4b')]=moment()[_0x697c('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x4c')]=_0x5302ec['destuniqueid'];this['channels'][_0x5302ec[_0x697c('0x21')]][_0x69536b][_0x697c('0x4d')]=_0x5302ec[_0x697c('0x22')];this[_0x697c('0x24')][_0x5302ec['uniqueid']][_0x69536b]['lastevent']=_0x697c('0x4e');this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b]['reason']=_0x697c('0x4e');logger[_0x697c('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x5302ec[_0x697c('0x21')],util['inspect'](this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b],{'showHidden':![],'depth':null}));ami[_0x697c('0x1d')](_0x697c('0x4f'),this[_0x697c('0x24')][_0x5302ec[_0x697c('0x21')]][_0x69536b]);}}}}}}catch(_0x2ed1ab){logger[_0x697c('0x39')]('[%s][voiceAgentReport][agentconnect]',_0x5302ec['uniqueid'],util[_0x697c('0x33')](_0x2ed1ab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0x11')]=function(_0x313181){try{if(this[_0x697c('0x1e')](_0x313181)){logger[_0x697c('0x23')](_0x697c('0x50'),_0x313181[_0x697c('0x21')],util[_0x697c('0x33')](_0x313181,{'showHidden':![],'depth':null}));if(this[_0x697c('0x24')][_0x313181['uniqueid']]&&this[_0x697c('0x24')][_0x313181[_0x697c('0x21')]][_0x313181[_0x697c('0x25')]]){logger[_0x697c('0x20')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x313181['uniqueid'],_0x313181[_0x697c('0x22')],_0x313181[_0x697c('0x25')]);this[_0x697c('0x24')][_0x313181[_0x697c('0x21')]][_0x313181[_0x697c('0x25')]][_0x697c('0x10')]=!![];this[_0x697c('0x24')][_0x313181['uniqueid']][_0x313181['destuniqueid']][_0x697c('0x4b')]=moment()['format'](_0x697c('0x27'));this[_0x697c('0x24')][_0x313181[_0x697c('0x21')]][_0x313181[_0x697c('0x25')]]['lastevent']=_0x697c('0x51');this[_0x697c('0x24')][_0x313181[_0x697c('0x21')]][_0x313181['destuniqueid']][_0x697c('0x52')]=_0x697c('0x51');logger['debug'](_0x697c('0x53'),_0x313181[_0x697c('0x21')],util[_0x697c('0x33')](this[_0x697c('0x24')][_0x313181[_0x697c('0x21')]][_0x313181[_0x697c('0x25')]],{'showHidden':![],'depth':null}));ami[_0x697c('0x1d')](_0x697c('0x54'),this[_0x697c('0x24')][_0x313181[_0x697c('0x21')]][_0x313181[_0x697c('0x25')]]);}}}catch(_0x5a8e49){logger[_0x697c('0x39')]('[%s][voiceAgentReport][agentringnoanswer]',_0x313181[_0x697c('0x21')],util[_0x697c('0x33')](_0x5a8e49,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')]['syncQueueCallerAbandon']=function(_0x5590a6){try{if(this['isNotNull'](_0x5590a6)){logger[_0x697c('0x23')](_0x697c('0x55'),_0x5590a6[_0x697c('0x21')],util[_0x697c('0x33')](_0x5590a6,{'showHidden':![],'depth':null}));if(this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]]){for(var _0x4f0652 in this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]]){if(this['channels'][_0x5590a6[_0x697c('0x21')]][_0x697c('0x3c')](_0x4f0652)&&!this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]][_0x4f0652][_0x697c('0x10')]&&!this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]][_0x4f0652][_0x697c('0x4a')]){logger[_0x697c('0x20')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x5590a6['uniqueid'],this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]][_0x4f0652][_0x697c('0x22')],_0x4f0652);this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]][_0x4f0652][_0x697c('0x10')]=!![];this[_0x697c('0x24')][_0x5590a6['uniqueid']][_0x4f0652][_0x697c('0x4b')]=moment()[_0x697c('0x26')](_0x697c('0x27'));this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]][_0x4f0652]['lastevent']=_0x697c('0x56');this[_0x697c('0x24')][_0x5590a6['uniqueid']][_0x4f0652][_0x697c('0x52')]=_0x697c('0x56');logger['debug'](_0x697c('0x57'),_0x5590a6['uniqueid'],util['inspect'](this[_0x697c('0x24')][_0x5590a6[_0x697c('0x21')]][_0x4f0652],{'showHidden':![],'depth':null}));ami['emit']('custom:agentqueuecallerabandon',this['channels'][_0x5590a6[_0x697c('0x21')]][_0x4f0652]);}}}}}catch(_0x13763c){logger[_0x697c('0x39')](_0x697c('0x58'),_0x5590a6[_0x697c('0x21')],util[_0x697c('0x33')](_0x13763c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')]['syncAgentComplete']=function(_0x3f10c1){try{if(this['isNotNull'](_0x3f10c1)){logger[_0x697c('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x3f10c1[_0x697c('0x21')],util[_0x697c('0x33')](_0x3f10c1,{'showHidden':![],'depth':null}));if(this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]]){for(var _0x5aa370 in this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]]){if(this['channels'][_0x3f10c1['uniqueid']]['hasOwnProperty'](_0x5aa370)){if(this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]][_0x5aa370][_0x697c('0x3e')]&&!this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]][_0x5aa370]['agentcomplete']){logger[_0x697c('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3f10c1[_0x697c('0x21')],this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]][_0x5aa370]['membername'],_0x5aa370);this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]][_0x5aa370][_0x697c('0x4a')]=!![];this['channels'][_0x3f10c1[_0x697c('0x21')]][_0x5aa370][_0x697c('0x59')]=moment()['format'](_0x697c('0x27'));this[_0x697c('0x24')][_0x3f10c1['uniqueid']][_0x5aa370][_0x697c('0x44')]=_0x697c('0x5a');this['channels'][_0x3f10c1[_0x697c('0x21')]][_0x5aa370]['reason']=_0x3f10c1[_0x697c('0x52')]==_0x697c('0x5b')?_0x697c('0x5c'):_0x3f10c1[_0x697c('0x52')];this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]][_0x5aa370][_0x697c('0x5d')]=_0x3f10c1[_0x697c('0x5d')];if(this['voiceQueues'][_0x3f10c1[_0x697c('0x29')]]&&this[_0x697c('0xb')][_0x3f10c1[_0x697c('0x29')]]['acw']){this[_0x697c('0x24')][_0x3f10c1['uniqueid']][_0x5aa370][_0x697c('0x5e')]=this['voiceQueues'][_0x3f10c1[_0x697c('0x29')]]['acwTimeout'];this[_0x697c('0x24')][_0x3f10c1['uniqueid']][_0x5aa370][_0x697c('0x5f')]=!![];}this[_0x697c('0xc')][_0x3f10c1[_0x697c('0x35')]]=_['omit'](this[_0x697c('0xc')][_0x3f10c1[_0x697c('0x35')]],[_0x697c('0x29'),_0x697c('0x48')]);logger[_0x697c('0x23')](_0x697c('0x60'),_0x3f10c1[_0x697c('0x21')],util[_0x697c('0x33')](this[_0x697c('0x24')][_0x3f10c1[_0x697c('0x21')]][_0x5aa370],{'showHidden':![],'depth':null}));ami['emit'](_0x697c('0x61'),this[_0x697c('0x24')][_0x3f10c1['uniqueid']][_0x5aa370]);logger[_0x697c('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x3f10c1['uniqueid'],util['inspect']({'id':this[_0x697c('0xc')][_0x3f10c1['interface']]['id'],'destaccountcode':_0x3f10c1[_0x697c('0x62')]},{'showHidden':![],'depth':null}));this[_0x697c('0x1d')](util[_0x697c('0x26')](_0x697c('0x37'),_0x3f10c1[_0x697c('0x22')]),_0x697c('0x63'),{'id':this[_0x697c('0xc')][_0x3f10c1[_0x697c('0x35')]]['id'],'destaccountcode':_0x3f10c1[_0x697c('0x62')]});}}}}}}catch(_0x16d3cc){logger[_0x697c('0x39')](_0x697c('0x64'),_0x3f10c1['uniqueid'],util[_0x697c('0x33')](_0x16d3cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')]['syncVarSet']=function(_0x3e258a){try{if(this[_0x697c('0x1e')](_0x3e258a)){logger[_0x697c('0x23')](_0x697c('0x65'),_0x3e258a[_0x697c('0x21')],util[_0x697c('0x33')](_0x3e258a,{'showHidden':![],'depth':null}));this[_0x697c('0x66')](_0x3e258a[_0x697c('0x21')],_['keys'](_0x3e258a['variable'])[0x0],_0x3e258a[_0x697c('0x67')]);if(this[_0x697c('0x24')][_0x3e258a[_0x697c('0x21')]]){for(var _0x529ae9 in this[_0x697c('0x24')][_0x3e258a['uniqueid']]){if(this['channels'][_0x3e258a[_0x697c('0x21')]][_0x697c('0x3c')](_0x529ae9)){logger['info'](_0x697c('0x68'),_0x3e258a[_0x697c('0x21')],_0x529ae9,_[_0x697c('0x69')](_0x3e258a[_0x697c('0x6a')])[0x0],_0x3e258a['value']);if(_['isUndefined'](this['channels'][_0x3e258a['uniqueid']][_0x529ae9][_0x697c('0x2d')])){this['channels'][_0x3e258a[_0x697c('0x21')]][_0x529ae9][_0x697c('0x2d')]={};}this[_0x697c('0x24')][_0x3e258a['uniqueid']][_0x529ae9][_0x697c('0x2d')]=this['variables'][_0x3e258a[_0x697c('0x21')]];}}}}}catch(_0x4172c8){logger[_0x697c('0x39')](_0x697c('0x6b'),_0x3e258a[_0x697c('0x21')],util['inspect'](_0x4172c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0x66')]=function(_0x1bab0c,_0x5f0f0c,_0x2c2e07){var _0x40f95b=['rtpaudioqos',_0x697c('0x6c'),_0x697c('0x6d'),_0x697c('0x6e'),'rtpaudioqosloss',_0x697c('0x6f'),'rtpaudioqosrtt',_0x697c('0x70'),'sipcallid',_0x697c('0x71'),_0x697c('0x72'),'bridgepvtcallid',_0x697c('0x73'),'memberdynamic',_0x697c('0x74'),_0x697c('0x75'),_0x697c('0x22'),_0x697c('0x76'),_0x697c('0x77')];if(!_['isNil'](_0x5f0f0c)&&!_[_0x697c('0x78')](_0x40f95b,_0x5f0f0c)){if(_[_0x697c('0x1f')](this[_0x697c('0x2d')][_0x1bab0c])){this[_0x697c('0x2d')][_0x1bab0c]={};}this['variables'][_0x1bab0c][_0x5f0f0c]=_0x2c2e07;}};VoiceAgentReport[_0x697c('0x1c')]['syncHangup']=function(_0x4a8024){try{if(this['isNotNull'](_0x4a8024)){logger['debug']('[%s][voiceAgentReport][hangup]\x20event:',_0x4a8024['uniqueid'],util['inspect'](_0x4a8024,{'showHidden':![],'depth':null}));if(this[_0x697c('0x24')][_0x4a8024[_0x697c('0x21')]]){for(var _0x3e7b74 in this['channels'][_0x4a8024[_0x697c('0x21')]]){if(this[_0x697c('0x24')][_0x4a8024['uniqueid']][_0x697c('0x3c')](_0x3e7b74)){if(this[_0x697c('0x24')][_0x4a8024[_0x697c('0x21')]][_0x3e7b74][_0x697c('0x52')]==_0x697c('0x5b')&&this[_0x697c('0x24')][_0x4a8024['uniqueid']][_0x3e7b74][_0x697c('0x4a')]){logger[_0x697c('0x20')](_0x697c('0x79'),_0x4a8024[_0x697c('0x21')],_0x3e7b74);this[_0x697c('0x24')][_0x4a8024['uniqueid']][_0x3e7b74][_0x697c('0x59')]=moment()[_0x697c('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x697c('0x23')](_0x697c('0x7a'),_0x4a8024[_0x697c('0x21')],util['inspect'](_[_0x697c('0x7b')](this[_0x697c('0x24')][_0x4a8024[_0x697c('0x21')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x697c('0x7c'),_[_0x697c('0x7b')](this[_0x697c('0x24')][_0x4a8024[_0x697c('0x21')]]));delete this['channels'][_0x4a8024[_0x697c('0x21')]];}if(this['variables'][_0x4a8024['uniqueid']]){delete this[_0x697c('0x2d')][_0x4a8024['uniqueid']];}}}catch(_0x419026){logger['error'](_0x697c('0x7d'),_0x4a8024[_0x697c('0x21')],util[_0x697c('0x33')](_0x419026,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0x7e')]=function(_0x6c6b8e){try{if(this['isNotNull'](_0x6c6b8e)){logger['debug'](_0x697c('0x7f'),_0x6c6b8e[_0x697c('0x21')],util[_0x697c('0x33')](_0x6c6b8e,{'showHidden':![],'depth':null}));if(this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x80')]]){for(var _0x38c2a9 in this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x80')]]){if(this['channels'][_0x6c6b8e[_0x697c('0x80')]][_0x697c('0x3c')](_0x38c2a9)){if(_0x6c6b8e[_0x697c('0x81')]===_0x38c2a9){logger[_0x697c('0x20')](_0x697c('0x82'),_0x6c6b8e[_0x697c('0x21')],this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x80')]][_0x38c2a9][_0x697c('0x22')],_0x38c2a9);var _0x541d89=moment();this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x80')]][_0x38c2a9]['agentcomplete']=!![];this[_0x697c('0x24')][_0x6c6b8e['transfereeuniqueid']][_0x38c2a9]['agentcompleteAt']=moment()[_0x697c('0x26')](_0x697c('0x27'));this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x80')]][_0x38c2a9][_0x697c('0x44')]=_0x697c('0x5a');this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x80')]][_0x38c2a9][_0x697c('0x52')]=_0x697c('0x5b');this[_0x697c('0x24')][_0x6c6b8e['transfereeuniqueid']][_0x38c2a9]['talktime']=_0x541d89[_0x697c('0x83')](this[_0x697c('0x24')][_0x6c6b8e['transfereeuniqueid']][_0x38c2a9][_0x697c('0x3e')],'seconds');}}}}if(this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x84')]]){var _0x84d1e8=this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x84')]];this[_0x697c('0x24')][_0x6c6b8e['secondtransfereruniqueid']]=this[_0x697c('0x24')][_0x6c6b8e[_0x697c('0x80')]];this['channels'][_0x6c6b8e[_0x697c('0x80')]]=_0x84d1e8;}}}catch(_0x2e8e23){logger[_0x697c('0x39')](_0x697c('0x85'),_0x6c6b8e[_0x697c('0x21')],util[_0x697c('0x33')](_0x2e8e23,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x49fb5a){try{if(this['isNotNull'](_0x49fb5a)){logger[_0x697c('0x23')](_0x697c('0x86'),_0x49fb5a[_0x697c('0x21')],util['inspect'](_0x49fb5a,{'showHidden':![],'depth':null}));if(this['channels'][_0x49fb5a['transfereeuniqueid']]){for(var _0x37924a in this[_0x697c('0x24')][_0x49fb5a['transfereeuniqueid']]){if(this[_0x697c('0x24')][_0x49fb5a[_0x697c('0x80')]][_0x697c('0x3c')](_0x37924a)){if(_0x49fb5a[_0x697c('0x87')]===_0x37924a){logger[_0x697c('0x20')](_0x697c('0x88'),_0x49fb5a[_0x697c('0x21')],this[_0x697c('0x24')][_0x49fb5a[_0x697c('0x80')]][_0x37924a][_0x697c('0x22')],_0x37924a);var _0x41ebf6=moment();this[_0x697c('0x24')][_0x49fb5a[_0x697c('0x80')]][_0x37924a][_0x697c('0x4a')]=!![];this[_0x697c('0x24')][_0x49fb5a[_0x697c('0x80')]][_0x37924a][_0x697c('0x59')]=_0x41ebf6;this[_0x697c('0x24')][_0x49fb5a['transfereeuniqueid']][_0x37924a][_0x697c('0x44')]=_0x697c('0x5a');this[_0x697c('0x24')][_0x49fb5a[_0x697c('0x80')]][_0x37924a][_0x697c('0x52')]=_0x697c('0x5b');this['channels'][_0x49fb5a[_0x697c('0x80')]][_0x37924a][_0x697c('0x5d')]=_0x41ebf6[_0x697c('0x83')](this[_0x697c('0x24')][_0x49fb5a[_0x697c('0x80')]][_0x37924a][_0x697c('0x3e')],_0x697c('0x89'));}}}}}}catch(_0x39f867){logger['error'](_0x697c('0x8a'),_0x49fb5a['uniqueid'],util[_0x697c('0x33')](_0x39f867,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0x8b')]=function(_0x345ec8){var _0x5e72e4='';try{if(this['isNotNull'](_0x345ec8)){logger[_0x697c('0x23')](_0x697c('0x8c'),_0x345ec8[_0x697c('0x21')],util[_0x697c('0x33')](_0x345ec8,{'showHidden':![],'depth':null}));if(_0x345ec8['channel']){_0x5e72e4=_0x345ec8[_0x697c('0x8d')][_0x697c('0x8e')](0x0,_0x345ec8[_0x697c('0x8d')]['lastIndexOf']('-'));if(this['agents'][_0x5e72e4]){logger[_0x697c('0x20')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x345ec8['uniqueid'],_0x5e72e4);this['agents'][_0x5e72e4][_0x697c('0x8f')]=!![];}}}}catch(_0x43a1c0){logger['error'](_0x697c('0x90'),_0x345ec8[_0x697c('0x21')],util[_0x697c('0x33')](_0x43a1c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x697c('0x1c')][_0x697c('0x91')]=function(_0x1f786d){var _0x2230b6='';try{if(this[_0x697c('0x1e')](_0x1f786d)){logger[_0x697c('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x1f786d[_0x697c('0x21')],util[_0x697c('0x33')](_0x1f786d,{'showHidden':![],'depth':null}));if(_0x1f786d[_0x697c('0x8d')]){_0x2230b6=_0x1f786d['channel'][_0x697c('0x8e')](0x0,_0x1f786d[_0x697c('0x8d')]['lastIndexOf']('-'));if(this[_0x697c('0xc')][_0x2230b6]){logger[_0x697c('0x20')](_0x697c('0x92'),_0x1f786d['uniqueid'],_0x2230b6);this[_0x697c('0xc')][_0x2230b6]['onhold']=![];}}}}catch(_0x26d556){logger[_0x697c('0x39')]('[%s][voiceAgentReport][musiconholdstop]',_0x1f786d[_0x697c('0x21')],util['inspect'](_0x26d556,{'showHidden':![],'depth':null}));}};module[_0x697c('0x93')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index cbf40f0..98123d9 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 _0x2927=['[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','keys','context','from-sip','channel','split','exten','connectedlinenum','format','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','inspect','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','lastapplication','lastdata','cdr(','toLowerCase','match','type','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','answered','answertime','holdtime','diff','xcally-motion-preview','destinationchannel','membername','name','connectedlinename','UserId','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfercalleridnum','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','outbound','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','syncHangup','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','lodash','util','path','ioredis','../../../config/logger','ami','../model/channel','../rpc/setting','set','queue','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','bind','newexten','syncNewExten','newchannel','syncNewChannel','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','isNotNull','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug'];(function(_0x3e20e9,_0x3b8184){var _0x5c6e48=function(_0xb3500b){while(--_0xb3500b){_0x3e20e9['push'](_0x3e20e9['shift']());}};_0x5c6e48(++_0x3b8184);}(_0x2927,0x99));var _0x7292=function(_0x45ea18,_0x514491){_0x45ea18=_0x45ea18-0x0;var _0x6e5309=_0x2927[_0x45ea18];return _0x6e5309;};'use strict';var _=require(_0x7292('0x0'));var moment=require('moment');var util=require(_0x7292('0x1'));var path=require(_0x7292('0x2'));var Redis=require(_0x7292('0x3'));var config=require('../../../config/environment');var logger=require(_0x7292('0x4'))(_0x7292('0x5'));var ami=require('../ami');var Channel=require(_0x7292('0x6'));var RpcSetting=require(_0x7292('0x7'));var applications=[_0x7292('0x8'),_0x7292('0x9'),'agi',_0x7292('0xa'),_0x7292('0xb'),'voicemail'];var dispositions=[_0x7292('0xc'),_0x7292('0xd'),_0x7292('0xd'),_0x7292('0xc'),'NO\x20ANSWER',_0x7292('0xc'),_0x7292('0xe'),_0x7292('0xf'),_0x7292('0xd'),_0x7292('0xd'),_0x7292('0xd')];config[_0x7292('0x10')]=_[_0x7292('0x11')](config[_0x7292('0x10')],{'host':'localhost','port':0x18eb});var io=require(_0x7292('0x12'))(new Redis(config['redis']));function VoiceCallReport(_0xab263b){this[_0x7292('0x13')]=_0xab263b['channels'];this[_0x7292('0x14')]=_0xab263b[_0x7292('0x14')];this[_0x7292('0x15')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0x7292('0x16')](this));ami['on'](_0x7292('0x17'),this[_0x7292('0x18')]['bind'](this));ami['on'](_0x7292('0x19'),this[_0x7292('0x1a')][_0x7292('0x16')](this));ami['on']('newstate',this['syncNewState'][_0x7292('0x16')](this));ami['on'](_0x7292('0x1b'),this[_0x7292('0x1c')][_0x7292('0x16')](this));ami['on'](_0x7292('0x1d'),this['syncHangup']['bind'](this));ami['on'](_0x7292('0x1e'),this[_0x7292('0x1f')][_0x7292('0x16')](this));ami['on']('attendedtransfer',this[_0x7292('0x20')]['bind'](this));ami['on'](_0x7292('0x21'),this[_0x7292('0x22')][_0x7292('0x16')](this));ami['on'](_0x7292('0x23'),this['syncMusicOnHoldStart'][_0x7292('0x16')](this));ami['on'](_0x7292('0x24'),this['syncMusicOnHoldStop'][_0x7292('0x16')](this));try{logger[_0x7292('0x25')](_0x7292('0x26'));ami[_0x7292('0x27')]();}catch(_0x17ebbb){logger[_0x7292('0x28')](_0x7292('0x29'),util['inspect'](_0x17ebbb,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x7292('0x2a')]=function(_0x831b53){return _0x831b53!==null&&!_['isUndefined'](_0x831b53);};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x2c')]=function(_0xf99f7f,_0x99c726,_0x177408){io['to'](_0xf99f7f)[_0x7292('0x2c')](_0x99c726,_0x177408);};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x1f')]=function(_0x3c16a9){try{if(this[_0x7292('0x2a')](_0x3c16a9)){logger[_0x7292('0x25')](_0x7292('0x2d'),_0x3c16a9[_0x7292('0x2e')],_0x3c16a9['calleridname'],_0x3c16a9[_0x7292('0x2f')]);logger[_0x7292('0x30')](_0x7292('0x31'),_0x3c16a9[_0x7292('0x2e')],util['inspect'](_0x3c16a9,{'showHidden':![],'depth':null}));if(_0x3c16a9[_0x7292('0x2e')]===_0x3c16a9[_0x7292('0x32')]){if(!_[_0x7292('0x33')](this['channels'][_0x3c16a9[_0x7292('0x2e')]])){_[_0x7292('0x34')](this['channels'][_0x3c16a9[_0x7292('0x2e')]],_[_0x7292('0x35')](_0x3c16a9,_[_0x7292('0x36')](this[_0x7292('0x13')][_0x3c16a9[_0x7292('0x2e')]])));}}if(_0x3c16a9[_0x7292('0x37')]===_0x7292('0x38')){if(this[_0x7292('0x14')][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){if(_0x3c16a9[_0x7292('0x3b')]=='xcally-motion-preview'){this[_0x7292('0x14')][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['destconnectedlinenum']=_0x3c16a9[_0x7292('0x3c')];this[_0x7292('0x2c')](util[_0x7292('0x3d')]('user:%s',this[_0x7292('0x14')][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['name']),_0x7292('0x3e'),{'destaccountcode':this['agents'][_0x3c16a9[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x3c16a9[_0x7292('0x3c')]});}}}}}catch(_0x5c2b9a){logger[_0x7292('0x28')](_0x7292('0x40'),_0x3c16a9['uniqueid'],util[_0x7292('0x41')](_0x5c2b9a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7292('0x1a')]=function(_0x235a75){try{if(this[_0x7292('0x2a')](_0x235a75)){logger['debug'](_0x7292('0x42'),_0x235a75[_0x7292('0x2e')],util[_0x7292('0x41')](_0x235a75,{'showHidden':![],'depth':null}));if(this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]])return;if(_0x235a75['channel']===_0x7292('0x43'))return;if(_0x235a75['uniqueid']!==_0x235a75[_0x7292('0x32')]&&!this[_0x7292('0x15')][_0x235a75[_0x7292('0x32')]])return;logger[_0x7292('0x25')](_0x7292('0x44'),_0x235a75[_0x7292('0x2e')],_0x235a75[_0x7292('0x37')],_0x235a75['exten']);this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]]=new Channel();this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]][_0x7292('0x45')]=moment()[_0x7292('0x3d')](_0x7292('0x46'));this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]][_0x7292('0x47')]=dispositions[_[_0x7292('0x48')](_0x235a75[_0x7292('0x49')])];_['merge'](this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]],_[_0x7292('0x35')](_0x235a75,_[_0x7292('0x36')](this[_0x7292('0x13')][_0x235a75[_0x7292('0x2e')]])));if(_0x235a75[_0x7292('0x37')]==='from-sip'){if(this['agents'][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){if(_[_0x7292('0x33')](this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')]['split']('-')[0x0]][_0x7292('0x4a')])){this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x4a')]=_0x235a75['exten'];logger[_0x7292('0x30')](_0x7292('0x4b'),_0x235a75[_0x7292('0x2e')],util['inspect']({'id':this[_0x7292('0x14')][_0x235a75['channel'][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x235a75['channel']['split']('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x235a75[_0x7292('0x3b')]},{'showHidden':![],'depth':null}));this[_0x7292('0x2c')](util[_0x7292('0x3d')](_0x7292('0x4c'),this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['name']),_0x7292('0x3e'),{'id':this[_0x7292('0x14')][_0x235a75['channel'][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x235a75[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x235a75[_0x7292('0x3b')]});}}}}}catch(_0x1f2c43){logger[_0x7292('0x28')](_0x7292('0x4d'),_0x235a75['uniqueid'],util['inspect'](_0x1f2c43,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x18')]=function(_0x1ad365){try{if(this[_0x7292('0x2a')](_0x1ad365)){logger[_0x7292('0x30')](_0x7292('0x4e'),_0x1ad365[_0x7292('0x2e')],util[_0x7292('0x41')](_0x1ad365,{'showHidden':![],'depth':null}));if(_0x1ad365['channel']===_0x7292('0x43')||_0x1ad365[_0x7292('0x3b')]==='h')return;if(_0x1ad365[_0x7292('0x2e')]===_0x1ad365['linkedid']||this[_0x7292('0x15')][_0x1ad365[_0x7292('0x32')]]){_0x1ad365['application']=_0x1ad365[_0x7292('0x4f')]['toLowerCase']();_0x1ad365[_0x7292('0x50')]=_0x1ad365[_0x7292('0x51')]||_0x1ad365['applicationdata'];if(_0x1ad365[_0x7292('0x51')]&&!_0x1ad365[_0x7292('0x51')][_0x7292('0x52')](_0x7292('0x53'))&&_0x1ad365[_0x7292('0x4f')]!==_0x7292('0x9')){_0x1ad365[_0x7292('0x50')]=_0x1ad365[_0x7292('0x50')]['toLowerCase']();}logger[_0x7292('0x25')](_0x7292('0x54'),_0x1ad365['uniqueid'],_0x1ad365[_0x7292('0x4f')],_0x1ad365[_0x7292('0x50')]);if(_[_0x7292('0x33')](this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]])){this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]]=new Channel();this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]]['starttime']=_0x1ad365[_0x7292('0x55')]?moment()[_0x7292('0x56')](moment[_0x7292('0x55')](_0x1ad365['duration'])[_0x7292('0x57')](),_0x7292('0x57'))['format'](_0x7292('0x46')):moment()[_0x7292('0x3d')](_0x7292('0x46'));this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]]['disposition']='NO\x20ANSWER';}_[_0x7292('0x34')](this[_0x7292('0x13')][_0x1ad365['uniqueid']],_[_0x7292('0x35')](_0x1ad365,_['keys'](this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]])));if(_['includes'](applications,_0x1ad365[_0x7292('0x4f')])){this[_0x7292('0x13')][_0x1ad365['uniqueid']][_0x7292('0x58')]=_0x1ad365[_0x7292('0x4f')];this['channels'][_0x1ad365[_0x7292('0x2e')]][_0x7292('0x59')]=_0x1ad365[_0x7292('0x50')];if(_0x1ad365[_0x7292('0x4f')]==='set'&&_[_0x7292('0x52')](_0x1ad365['applicationdata']['toLowerCase'](),_0x7292('0x5a'))){var _0x1e7544=_0x1ad365[_0x7292('0x50')][_0x7292('0x3a')]('=');var _0x128165=_0x1e7544[0x0][_0x7292('0x5b')]()[_0x7292('0x5c')](/cdr\((.*)\)/);if(_0x128165){if(_0x128165[0x1]===_0x7292('0x5d')&&!_['isNil'](this[_0x7292('0x13')][_0x1ad365[_0x7292('0x2e')]][_0x128165[0x1]]))return;this['channels'][_0x1ad365['uniqueid']][_0x128165[0x1]]=_0x1e7544[0x1];}}else if(_0x1ad365[_0x7292('0x4f')]==='queue'){this['channels'][_0x1ad365[_0x7292('0x2e')]][_0x7292('0x9')]=_0x1ad365[_0x7292('0x50')]['split'](',')[0x0];}}}}}catch(_0x1194a1){logger[_0x7292('0x28')](_0x7292('0x5e'),_0x1ad365[_0x7292('0x2e')],util[_0x7292('0x41')](_0x1194a1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7292('0x5f')]=function(_0x4c0331){try{if(this[_0x7292('0x2a')](_0x4c0331)){logger[_0x7292('0x25')](_0x7292('0x60'),_0x4c0331[_0x7292('0x2e')],_0x4c0331[_0x7292('0x32')],_0x4c0331[_0x7292('0x61')],_0x4c0331['calleridnum']);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x4c0331['uniqueid'],util['inspect'](_0x4c0331,{'showHidden':![],'depth':null}));if(_0x4c0331[_0x7292('0x49')]!=='6')return;if(_0x4c0331[_0x7292('0x2e')]!==_0x4c0331[_0x7292('0x32')]){var _0x3a8e99=moment();if(this['channels'][_0x4c0331[_0x7292('0x32')]]){if(!this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x62')]){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x62')]=!![];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x63')]=_0x3a8e99[_0x7292('0x3d')](_0x7292('0x46'));if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x45')]){this['channels'][_0x4c0331[_0x7292('0x32')]][_0x7292('0x64')]=_0x3a8e99[_0x7292('0x65')](this[_0x7292('0x13')][_0x4c0331['linkedid']][_0x7292('0x45')],_0x7292('0x57'));}}this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x32')]=_0x4c0331['uniqueid'];if(_0x4c0331['calleridnum']!==_0x7292('0x66')){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x3c')]=_0x4c0331[_0x7292('0x2f')];}this[_0x7292('0x13')][_0x4c0331['linkedid']]['connectedlinename']=_0x4c0331[_0x7292('0x61')];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x67')]=_0x4c0331[_0x7292('0x39')];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x47')]=dispositions[_[_0x7292('0x48')](_0x4c0331['channelstate'])];if(this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]]['UserId']=this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]][_0x7292('0x68')]=this[_0x7292('0x14')][_0x4c0331['channel'][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x69')];}}if(this['channels'][_0x4c0331[_0x7292('0x2e')]]){if(!this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x62')]){this[_0x7292('0x13')][_0x4c0331['uniqueid']][_0x7292('0x62')]=!![];this[_0x7292('0x13')][_0x4c0331['uniqueid']][_0x7292('0x63')]=_0x3a8e99[_0x7292('0x3d')](_0x7292('0x46'));if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x45')]){this['channels'][_0x4c0331['uniqueid']]['holdtime']=_0x3a8e99['diff'](this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x45')],_0x7292('0x57'));}}if(_0x4c0331['calleridnum']!=='xcally-motion-preview'){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x3c')]=_0x4c0331[_0x7292('0x2f')];}this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x6a')]=_0x4c0331['calleridname'];this['channels'][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x67')]=_0x4c0331[_0x7292('0x39')];this[_0x7292('0x13')][_0x4c0331['uniqueid']]['disposition']=dispositions[_[_0x7292('0x48')](_0x4c0331[_0x7292('0x49')])];}}else{if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]]){if(this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x6b')]=this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'];this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]]['membername']=this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['name'];}}}if(_0x4c0331[_0x7292('0x37')]===_0x7292('0x38')){if(this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x4a')]=_0x4c0331[_0x7292('0x3b')];var _0x2e5ca6,_0x5ccaca;if(this[_0x7292('0x13')][_0x4c0331[_0x7292('0x2e')]]){_0x2e5ca6=this[_0x7292('0x13')][_0x4c0331['uniqueid']][_0x7292('0x6c')];_0x5ccaca=this['channels'][_0x4c0331[_0x7292('0x2e')]][_0x7292('0x9')];}else if(this['channels'][_0x4c0331['linkedid']]){_0x2e5ca6=this[_0x7292('0x13')][_0x4c0331['linkedid']][_0x7292('0x6c')];_0x5ccaca=this[_0x7292('0x13')][_0x4c0331[_0x7292('0x32')]]['queue'];}this['agents'][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x9')]=_0x5ccaca;this['agents'][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['routealias']=_0x2e5ca6;logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x4c0331[_0x7292('0x2e')],util[_0x7292('0x41')]({'id':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')],'destconnectedlinenum':_0x4c0331[_0x7292('0x3b')],'routealias':_0x2e5ca6,'queue':_0x5ccaca||undefined},{'showHidden':![],'depth':null}));this[_0x7292('0x2c')](util[_0x7292('0x3d')](_0x7292('0x4c'),this[_0x7292('0x14')][_0x4c0331['channel'][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x69')]),'user:agentconnect',{'id':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x7292('0x14')][_0x4c0331[_0x7292('0x39')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4c0331[_0x7292('0x3b')],'routealias':_0x2e5ca6,'queue':_0x5ccaca||undefined});}}}}catch(_0x4a96e7){logger[_0x7292('0x28')](_0x7292('0x6d'),_0x4c0331[_0x7292('0x2e')],util[_0x7292('0x41')](_0x4a96e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x6e')]=function(_0x27dc01,_0x58ea3e){try{if(this['channels'][_0x27dc01]){logger[_0x7292('0x25')](_0x7292('0x6f'),_0x27dc01,_0x58ea3e);this['channels'][_0x27dc01][_0x7292('0x70')]=!![];if(_[_0x7292('0x71')](_0x58ea3e,_0x7292('0x72'))){_0x58ea3e=_0x58ea3e[_0x7292('0x73')](_0x7292('0x72'),_0x7292('0x74'));}this[_0x7292('0x13')][_0x27dc01][_0x7292('0x75')]=_0x58ea3e;var _0x16a893=_[_0x7292('0x76')](this['channels'][_0x27dc01][_0x7292('0x77')],{'filename':_0x58ea3e});if(_[_0x7292('0x78')](_0x16a893)){this[_0x7292('0x13')][_0x27dc01][_0x7292('0x77')][_0x7292('0x79')]({'filename':_0x58ea3e,'createdAt':moment()['format'](_0x7292('0x46')),'mixmonitorid':'','status':_0x7292('0x7a')});}}}catch(_0x39247b){logger[_0x7292('0x28')](_0x7292('0x7b'),_0x27dc01,util[_0x7292('0x41')](_0x39247b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')][_0x7292('0x1c')]=function(_0xf027d0){try{if(this[_0x7292('0x2a')](_0xf027d0)){logger['debug'](_0x7292('0x7c'),_0xf027d0[_0x7292('0x2e')],util['inspect'](_0xf027d0,{'showHidden':![],'depth':null}));if(this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]]&&_0xf027d0[_0x7292('0x39')]!=_0x7292('0x43')){if(this[_0x7292('0x2a')](_0xf027d0['variable'])){if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')]['mixmonitor_filename'])){logger['info'](_0x7292('0x7e'),_0xf027d0['uniqueid'],_0xf027d0['value']);this[_0x7292('0x6e')](_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')][_0x7292('0x80')])){logger['info'](_0x7292('0x81'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0['uniqueid']]['calleridnum']=_0xf027d0[_0x7292('0x7f')];}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x82')])){logger[_0x7292('0x25')](_0x7292('0x83'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x84')]=_0xf027d0['value'];}else if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')][_0x7292('0x85')])){logger[_0x7292('0x25')](_0x7292('0x86'),_0xf027d0['uniqueid'],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x5d')]=_0xf027d0[_0x7292('0x7f')];}else if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')][_0x7292('0x87')])){logger[_0x7292('0x25')](_0x7292('0x88'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]['split'](',')[0x0]);this[_0x7292('0x13')][_0xf027d0['uniqueid']][_0x7292('0x9')]=_0xf027d0[_0x7292('0x7f')][_0x7292('0x3a')](',')[0x0];}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')][_0x7292('0x89')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0xf027d0[_0x7292('0x2e')],_0xf027d0['value']);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]]['originatecalleridnum']=_0xf027d0[_0x7292('0x7f')];}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x8a')])){logger[_0x7292('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this['channels'][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x8b')]=_0xf027d0[_0x7292('0x7f')];}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')][_0x7292('0x8c')])){logger[_0x7292('0x25')](_0x7292('0x8d'),_0xf027d0[_0x7292('0x2e')],_0xf027d0['value']);this[_0x7292('0x13')][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x8e')]=_0xf027d0['value'];}else if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')]['xmcs-queue'])){logger[_0x7292('0x25')](_0x7292('0x8f'),_0xf027d0[_0x7292('0x2e')],_0xf027d0['value']);this['channels'][_0xf027d0['uniqueid']][_0x7292('0x9')]=_0xf027d0['value'];}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x90')])){logger[_0x7292('0x25')](_0x7292('0x91'),_0xf027d0[_0x7292('0x2e')],_0xf027d0[_0x7292('0x7f')]);this['channels'][_0xf027d0[_0x7292('0x2e')]][_0x7292('0x92')]=_0xf027d0[_0x7292('0x7f')];}}}else if(this[_0x7292('0x2a')](_0xf027d0['variable'][_0x7292('0x93')])){if(_0xf027d0['value']){var _0x13a58a=path['parse'](_0xf027d0[_0x7292('0x7f')])[_0x7292('0x69')];logger[_0x7292('0x25')](_0x7292('0x7e'),_0x13a58a,_0xf027d0[_0x7292('0x7f')]);this['syncMixMonitorFilename'](_0x13a58a,_0xf027d0[_0x7292('0x7f')]);}}else if(this[_0x7292('0x13')][_0xf027d0[_0x7292('0x32')]]){if(this['isNotNull'](_0xf027d0[_0x7292('0x7d')])){if(this[_0x7292('0x2a')](_0xf027d0[_0x7292('0x7d')]['sipcallid'])){logger[_0x7292('0x25')](_0x7292('0x91'),_0xf027d0['linkedid'],_0xf027d0[_0x7292('0x7f')]);this[_0x7292('0x13')][_0xf027d0['linkedid']]['sipcalllinkedid']=_0xf027d0[_0x7292('0x7f')];}}}}}catch(_0x1d3199){logger[_0x7292('0x28')](_0x7292('0x94'),_0xf027d0[_0x7292('0x2e')],util[_0x7292('0x41')](_0x1d3199,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7292('0x2b')]['syncHangup']=function(_0x2d40ab){try{if(this[_0x7292('0x2a')](_0x2d40ab)){logger['debug'](_0x7292('0x95'),_0x2d40ab['uniqueid'],util['inspect'](_0x2d40ab,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x2d40ab['linkedid']]){if(this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]]){this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]]['uniqueid']=_0x2d40ab[_0x7292('0x2e')];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']]['linkedid']][_0x7292('0x62')]=this[_0x7292('0x13')][_0x2d40ab['uniqueid']][_0x7292('0x62')];this['channels'][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]][_0x7292('0x63')]=this[_0x7292('0x13')][_0x2d40ab['uniqueid']]['answertime'];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x32')]][_0x7292('0x67')]=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['linkedid']]['channel'];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x32')]][_0x7292('0x47')]=this['channels'][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x47')];this['channels'][_0x2d40ab[_0x7292('0x2e')]]=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']]['linkedid']];delete this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['linkedid']];}else if(this['channels'][this['blindTransfers'][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]]){this['channels'][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]]['uniqueid']=[this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x2e')]][_0x7292('0x32')],this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']]['uniqueid']]['linkedid']=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]][_0x7292('0x2e')]][0x0];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x2e')]][_0x7292('0x62')]=this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x62')];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]]['answertime']=this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x63')];this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['uniqueid']][_0x7292('0x67')]=this['channels'][this[_0x7292('0x15')][_0x2d40ab['linkedid']][_0x7292('0x2e')]][_0x7292('0x39')];this['channels'][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['uniqueid']][_0x7292('0x47')]=this[_0x7292('0x13')][_0x2d40ab['uniqueid']][_0x7292('0x47')];this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]=this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]]['uniqueid']];delete this[_0x7292('0x13')][this[_0x7292('0x15')][_0x2d40ab[_0x7292('0x32')]][_0x7292('0x2e')]];}}if(this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]){logger['info'](_0x7292('0x96'),_0x2d40ab[_0x7292('0x2e')],_0x2d40ab['cause-txt']);var _0x158639=moment();this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x97')]=_0x158639[_0x7292('0x3d')](_0x7292('0x46'));this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x55')]=_0x158639[_0x7292('0x65')](this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['starttime'],'seconds');if(this['channels'][_0x2d40ab['uniqueid']][_0x7292('0x62')]){this['channels'][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x98')]=_0x158639[_0x7292('0x65')](this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['answertime'],_0x7292('0x57'));this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]]['holdtime']=this[_0x7292('0x13')][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x55')]-this['channels'][_0x2d40ab[_0x7292('0x2e')]][_0x7292('0x98')];}if(_0x2d40ab['context']===_0x7292('0x38')){if(this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]){this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]=_[_0x7292('0x99')](this['agents'][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]],['destconnectedlinenum']);logger[_0x7292('0x30')](_0x7292('0x9a'),_0x2d40ab['uniqueid'],util[_0x7292('0x41')]({'id':this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x7292('0x14')][_0x2d40ab['channel']['split']('-')[0x0]][_0x7292('0x3f')]},{'showHidden':![],'depth':null}));this[_0x7292('0x2c')](util['format']('user:%s',this[_0x7292('0x14')][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x69')]),'user:agentcomplete',{'id':this[_0x7292('0x14')][_0x2d40ab['channel'][_0x7292('0x3a')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x2d40ab[_0x7292('0x39')][_0x7292('0x3a')]('-')[0x0]][_0x7292('0x3f')]});for(var _0x1212f8=0x0;_0x1212f80x0?_0x58f90f:0x0;this[_0x68fe('0x10')][_0x4d3731[_0x68fe('0x60')]][_0x68fe('0x2e')]=this[_0x68fe('0x10')][_0x4d3731['queue']][_0x68fe('0x2e')]>_[_0x68fe('0x64')](_0x4d3731[_0x68fe('0x67')])?_[_0x68fe('0x64')](_0x4d3731[_0x68fe('0x67')]):this[_0x68fe('0x10')][_0x4d3731[_0x68fe('0x60')]][_0x68fe('0x2e')];this[_0x68fe('0x4d')](this[_0x68fe('0x10')][_0x4d3731['queue']],_0x68fe('0x14'));}logger[_0x68fe('0x3f')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x68fe('0x38')](this['voiceQueues'][_0x4d3731[_0x68fe('0x60')]],{'showHidden':![],'depth':null}));ami[_0x68fe('0x3e')](_0x68fe('0x68'),this['voiceQueues'][_0x4d3731[_0x68fe('0x60')]]);}}}catch(_0x37c9f0){logger['error']('[voiceQueueReport][queuesummary]',util[_0x68fe('0x38')](_0x37c9f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x68fe('0x69')]=function(_0x26aea6){logger[_0x68fe('0x3f')](_0x68fe('0x6a'),util[_0x68fe('0x38')](_0x26aea6,{'showHidden':![],'depth':null}));ami[_0x68fe('0x3e')](_0x68fe('0x6b'),{});this[_0x68fe('0x11')]=!![];};VoiceQueueReport[_0x68fe('0x9')]['syncQueueCallerJoin']=function(_0x1f5447){try{if(this[_0x68fe('0x5d')](_0x1f5447)){logger[_0x68fe('0x3f')](_0x68fe('0x6c'),_0x1f5447['uniqueid'],util['inspect'](_0x1f5447,{'showHidden':![],'depth':null}));if(_[_0x68fe('0x5e')](this['queueReports'][_0x1f5447[_0x68fe('0x42')]]))this[_0x68fe('0x39')][_0x1f5447[_0x68fe('0x42')]]=[];if(_[_0x68fe('0x5e')](this[_0x68fe('0xe')][_0x1f5447[_0x68fe('0x42')]]))this[_0x68fe('0xe')][_0x1f5447[_0x68fe('0x42')]]={};var _0x2a93ab=new QueueReport();_0x2a93ab[_0x68fe('0x45')]=_0x1f5447[_0x68fe('0x60')];_0x2a93ab[_0x68fe('0x54')]=this[_0x68fe('0x10')][_0x2a93ab[_0x68fe('0x45')]]&&this[_0x68fe('0x10')][_0x2a93ab[_0x68fe('0x45')]][_0x68fe('0x54')]?this[_0x68fe('0x10')][_0x2a93ab['name']][_0x68fe('0x54')]||_0x68fe('0x4e'):_0x68fe('0x4e');_0x2a93ab[_0x68fe('0x60')]=_0x1f5447[_0x68fe('0x60')];_0x2a93ab[_0x68fe('0x6d')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0x2a93ab[_0x68fe('0x6f')]=_0x1f5447[_0x68fe('0x6f')];_0x2a93ab[_0x68fe('0x70')]=_0x1f5447[_0x68fe('0x70')];_0x2a93ab[_0x68fe('0x42')]=_0x1f5447[_0x68fe('0x42')];_0x2a93ab[_0x68fe('0x71')]=this[_0x68fe('0xe')][_0x1f5447[_0x68fe('0x42')]][_0x68fe('0x71')];logger[_0x68fe('0x62')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2a93ab[_0x68fe('0x45')],_0x2a93ab['type']);_[_0x68fe('0x72')](_0x2a93ab,_[_0x68fe('0x73')](_0x1f5447,_[_0x68fe('0x74')](_0x2a93ab)));this[_0x68fe('0x39')][_0x1f5447['uniqueid']][_0x68fe('0x75')](_0x2a93ab);this[_0x68fe('0xe')][_0x1f5447['uniqueid']]=_0x2a93ab;this[_0x68fe('0x76')](_0x2a93ab,_0x68fe('0x18'));}}catch(_0x54e91a){logger['error'](_0x68fe('0x6c'),_0x1f5447[_0x68fe('0x42')],util['inspect'](_0x54e91a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')]['syncQueueCallerAbandon']=function(_0x27500f){try{if(this[_0x68fe('0x5d')](_0x27500f)){logger[_0x68fe('0x3f')](_0x68fe('0x77'),_0x27500f[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x27500f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x27500f[_0x68fe('0x42')]]){var _0x3d7bcd=_[_0x68fe('0x78')](this[_0x68fe('0x39')][_0x27500f[_0x68fe('0x42')]]);_0x3d7bcd[_0x68fe('0x79')]=![];_0x3d7bcd[_0x68fe('0x7a')]=null;_0x3d7bcd[_0x68fe('0x7b')]=_0x27500f[_0x68fe('0x7b')];_0x3d7bcd[_0x68fe('0x7c')]=_0x27500f[_0x68fe('0x7c')];_0x3d7bcd['queuecallerabandon']=!![];_0x3d7bcd['queuecallerabandonAt']=moment()[_0x68fe('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d7bcd[_0x68fe('0x4a')]=_0x68fe('0x7d');_0x3d7bcd[_0x68fe('0x7e')]=null;logger[_0x68fe('0x62')](_0x68fe('0x7f'),_0x3d7bcd['name'],_0x3d7bcd[_0x68fe('0x54')]);this[_0x68fe('0xe')][_0x27500f[_0x68fe('0x42')]]=_0x3d7bcd;this[_0x68fe('0x48')](_0x3d7bcd,_0x68fe('0x19'));}}}catch(_0x30ca17){logger[_0x68fe('0x3a')](_0x68fe('0x77'),_0x27500f['uniqueid'],util[_0x68fe('0x38')](_0x30ca17,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x1c')]=function(_0x976495){try{if(this['isNotNull'](_0x976495)){logger[_0x68fe('0x3f')](_0x68fe('0x80'),_0x976495['uniqueid'],util['inspect'](_0x976495,{'showHidden':![],'depth':null}));if(this[_0x68fe('0x39')][_0x976495[_0x68fe('0x42')]]){var _0xf8997e=_[_0x68fe('0x78')](this['queueReports'][_0x976495[_0x68fe('0x42')]]);_0xf8997e[_0x68fe('0x81')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0xf8997e[_0x68fe('0x82')]=_0x976495[_0x68fe('0x82')];_0xf8997e[_0x68fe('0x83')]=_0x976495[_0x68fe('0x83')];logger[_0x68fe('0x62')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xf8997e[_0x68fe('0x45')],_0xf8997e['type'],_0x976495[_0x68fe('0x82')],_0x976495['connectedlinename']);this[_0x68fe('0xe')][_0x976495[_0x68fe('0x42')]]=_0xf8997e;this[_0x68fe('0x76')](_0xf8997e,_0x68fe('0x1b'));}}}catch(_0x4ecc1d){logger[_0x68fe('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x976495['uniqueid'],util['inspect'](_0x4ecc1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x1f')]=function(_0x2c4765){try{if(this[_0x68fe('0x5d')](_0x2c4765)){logger['debug'](_0x68fe('0x84'),_0x2c4765[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x2c4765,{'showHidden':![],'depth':null}));if(this[_0x68fe('0x39')][_0x2c4765[_0x68fe('0x42')]]){var _0x1e70ff=_[_0x68fe('0x78')](this[_0x68fe('0x39')][_0x2c4765[_0x68fe('0x42')]]);_0x1e70ff[_0x68fe('0x79')]=!![];_0x1e70ff[_0x68fe('0x4a')]='COMPLETEDBYAGENT';logger[_0x68fe('0x62')](_0x68fe('0x85'),_0x1e70ff[_0x68fe('0x45')],_0x1e70ff[_0x68fe('0x54')]);}}}catch(_0x2c3713){logger['error'](_0x68fe('0x84'),_0x2c4765[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x2c3713,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x86')]=function(_0xb47937){try{if(this['isNotNull'](_0xb47937)){logger[_0x68fe('0x3f')](_0x68fe('0x87'),_0xb47937['uniqueid'],util[_0x68fe('0x38')](_0xb47937,{'showHidden':![],'depth':null}));if(this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]]){var _0x917669=_['last'](this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]]);_0x917669[_0x68fe('0x19')]=![];_0x917669[_0x68fe('0x88')]=null;_0x917669[_0x68fe('0x89')]=!![];_0x917669[_0x68fe('0x7e')]=_0xb47937[_0x68fe('0x8a')];_0x917669[_0x68fe('0x7b')]=_0xb47937[_0x68fe('0x7b')];_0x917669[_0x68fe('0x79')]=!![];_0x917669[_0x68fe('0x8b')]=![];_0x917669[_0x68fe('0x8c')]=null;if(!_0x917669['transfer']){if(_0xb47937[_0x68fe('0x8d')]==_0x68fe('0x8e')){_0x917669['queuecallerexitreason']=_0x68fe('0x8f');logger[_0x68fe('0x62')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x917669[_0x68fe('0x45')],_0x917669[_0x68fe('0x54')]);}else{if(_[_0x68fe('0x90')](_0xb47937[_0x68fe('0x35')][_0x68fe('0x91')](),_0x68fe('0x92'))){if(this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x93')]]){var _0x10e164=_[_0x68fe('0x78')](this['queueReports'][_0xb47937['linkedid']]);_0x10e164[_0x68fe('0x79')]=![];_0x10e164[_0x68fe('0x8b')]=!![];_0x10e164['queuecallerexitAt']=moment(_0x917669[_0x68fe('0x6d')])['add'](_0xb47937['holdtime'],_0x68fe('0x94'))[_0x68fe('0x43')](_0x68fe('0x6e'));_0x10e164['queuecallerexitreason']=_0x68fe('0x95');_0x10e164[_0x68fe('0x8e')]=!![];_0x10e164[_0x68fe('0x96')]='FORWARD';_0x10e164[_0x68fe('0x97')]=_0xb47937[_0x68fe('0x98')];_0x10e164['transferuniqueid']=_0xb47937[_0x68fe('0x42')];logger['info'](_0x68fe('0x99'),_0x10e164[_0x68fe('0x45')],_0x10e164[_0x68fe('0x54')]);var _0x1c7263=this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x93')]];this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x93')]]=this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]];this[_0x68fe('0x39')][_0xb47937[_0x68fe('0x42')]]=_0x1c7263;}}else{_0x917669['queuecallerexitreason']=_0x68fe('0x9a')+_0xb47937[_0x68fe('0x8d')][_0x68fe('0x9b')]();logger[_0x68fe('0x62')](_0x68fe('0x9c'),_0x917669[_0x68fe('0x45')],_0x917669[_0x68fe('0x54')],_0x917669['queuecallerexitreason']);}}}this[_0x68fe('0xe')][_0xb47937[_0x68fe('0x42')]]=_0x917669;this['emitVoiceQueueChannelRemove'](_0x917669,_0x68fe('0x1d'));}}}catch(_0x1e9076){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0xb47937['uniqueid'],util['inspect'](_0x1e9076,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x21')]=function(_0x2c0446){try{if(this[_0x68fe('0x5d')](_0x2c0446)){logger[_0x68fe('0x3f')](_0x68fe('0x9d'),_0x2c0446['uniqueid'],util[_0x68fe('0x38')](_0x2c0446,{'showHidden':![],'depth':null}));this[_0x68fe('0x9e')](_0x2c0446['uniqueid'],_[_0x68fe('0x74')](_0x2c0446['variable'])[0x0],_0x2c0446[_0x68fe('0x9f')]);if(this[_0x68fe('0x39')][_0x2c0446[_0x68fe('0x42')]]){var _0x3935fe=_['last'](this[_0x68fe('0x39')][_0x2c0446[_0x68fe('0x42')]]);if(_0x3935fe){if(this[_0x68fe('0x5d')](_0x2c0446[_0x68fe('0xa0')])&&this[_0x68fe('0x5d')](_0x2c0446[_0x68fe('0xa0')]['queuestatus'])){switch(_0x2c0446['value']){case _0x68fe('0xa1'):_0x3935fe['queuecallerexit']=![];_0x3935fe['queuecallerexitAt']=null;break;case _0x68fe('0xa2'):_0x3935fe['lastevent']='timeout';_0x3935fe[_0x68fe('0x8b')]=!![];_0x3935fe[_0x68fe('0x8c')]=moment()['format'](_0x68fe('0x6e'));_0x3935fe[_0x68fe('0x81')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));logger[_0x68fe('0x3f')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2c0446['uniqueid'],util[_0x68fe('0x38')](_0x3935fe,{'showHidden':![],'depth':null}));ami[_0x68fe('0x3e')](_0x68fe('0xa3'),_0x3935fe);break;default:_0x3935fe[_0x68fe('0x8b')]=!![];_0x3935fe['queuecallerexitAt']=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0x3935fe['queuecallerleaveAt']=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));}_0x3935fe['queuecallerabandon']=![];_0x3935fe[_0x68fe('0x88')]=null;_0x3935fe[_0x68fe('0x4a')]=_0x2c0446[_0x68fe('0x9f')];this[_0x68fe('0xe')][_0x2c0446[_0x68fe('0x42')]]=_0x3935fe;this[_0x68fe('0x48')](_0x3935fe,_0x68fe('0x20'));}else if(this['isNotNull'](_0x2c0446[_0x68fe('0xa0')])&&this[_0x68fe('0x5d')](_0x2c0446['variable'][_0x68fe('0xa4')])){if(!_0x3935fe[_0x68fe('0x19')]){_0x3935fe['queuecallerexit']=!![];_0x3935fe[_0x68fe('0x8c')]=moment()[_0x68fe('0x43')](_0x68fe('0x6e'));_0x3935fe[_0x68fe('0x4a')]='EXITWITHKEY';_0x3935fe[_0x68fe('0x81')]=moment()[_0x68fe('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2c0446[_0x68fe('0x42')]]=_0x3935fe;}}logger[_0x68fe('0x62')](_0x68fe('0xa5'),_0x2c0446[_0x68fe('0x42')],_0x3935fe[_0x68fe('0x45')],_0x3935fe['type'],_['keys'](_0x2c0446[_0x68fe('0xa0')])[0x0],_0x2c0446['value']);_0x3935fe[_0x68fe('0x13')]=this['variables'][_0x2c0446[_0x68fe('0x42')]];}}}}catch(_0x38fa65){logger[_0x68fe('0x3a')](_0x68fe('0x9d'),_0x2c0446[_0x68fe('0x42')],util[_0x68fe('0x38')](_0x38fa65,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0x9e')]=function(_0x18c211,_0x115ab,_0x5a7a3f){var _0x3ac258=['rtpaudioqos',_0x68fe('0xa6'),_0x68fe('0xa7'),_0x68fe('0xa8'),_0x68fe('0xa9'),_0x68fe('0xaa'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x68fe('0xab'),'sipuri','bridgepeer',_0x68fe('0xac'),_0x68fe('0xad'),'memberdynamic','memberinterface',_0x68fe('0xae'),_0x68fe('0x8a'),_0x68fe('0xaf'),'memberrealtime'];if(!_['isNil'](_0x115ab)&&!_[_0x68fe('0xb0')](_0x3ac258,_0x115ab)){if(_['isUndefined'](this[_0x68fe('0x13')][_0x18c211])){this['variables'][_0x18c211]={};}this['variables'][_0x18c211][_0x115ab]=_0x5a7a3f;}};VoiceQueueReport[_0x68fe('0x9')][_0x68fe('0xb1')]=function(_0x2bde6d,_0x4a3ca2,_0x230400){var _0x83efea={};for(var _0x347e20=0x0;_0x347e200x0?_0x5a691a:0x0;this[_0x9b80('0xf')][_0x2dd63e[_0x9b80('0x6d')]][_0x9b80('0x57')]=this['voiceQueues'][_0x2dd63e[_0x9b80('0x6d')]]['talking']>_[_0x9b80('0x70')](_0x2dd63e[_0x9b80('0x72')])?_['toNumber'](_0x2dd63e[_0x9b80('0x72')]):this[_0x9b80('0xf')][_0x2dd63e['queue']][_0x9b80('0x57')];this[_0x9b80('0x4f')](this[_0x9b80('0xf')][_0x2dd63e[_0x9b80('0x6d')]],_0x9b80('0x12'));}logger[_0x9b80('0x6c')](_0x9b80('0x73'),util[_0x9b80('0x3a')](this['voiceQueues'][_0x2dd63e['queue']],{'showHidden':![],'depth':null}));ami[_0x9b80('0x42')](_0x9b80('0x74'),this[_0x9b80('0xf')][_0x2dd63e[_0x9b80('0x6d')]]);}}}catch(_0x5cd770){logger[_0x9b80('0x38')](_0x9b80('0x75'),util[_0x9b80('0x3a')](_0x5cd770,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9b80('0x33')][_0x9b80('0x16')]=function(_0x4d42da){logger[_0x9b80('0x6c')](_0x9b80('0x76'),util[_0x9b80('0x3a')](_0x4d42da,{'showHidden':![],'depth':null}));ami[_0x9b80('0x42')]('custom:queuesummarycomplete',{});this[_0x9b80('0x10')]=!![];};VoiceQueueReport[_0x9b80('0x33')][_0x9b80('0x18')]=function(_0x25f861){try{if(this[_0x9b80('0x6b')](_0x25f861)){logger['debug'](_0x9b80('0x77'),_0x25f861[_0x9b80('0x45')],util['inspect'](_0x25f861,{'showHidden':![],'depth':null}));if(_[_0x9b80('0x64')](this[_0x9b80('0xc')][_0x25f861[_0x9b80('0x45')]]))this['queueReports'][_0x25f861[_0x9b80('0x45')]]=[];if(_[_0x9b80('0x64')](this[_0x9b80('0xe')][_0x25f861[_0x9b80('0x45')]]))this[_0x9b80('0xe')][_0x25f861[_0x9b80('0x45')]]={};var _0x204641=new QueueReport();_0x204641['name']=_0x25f861[_0x9b80('0x6d')];_0x204641[_0x9b80('0x50')]=this[_0x9b80('0xf')][_0x204641[_0x9b80('0x47')]]&&this[_0x9b80('0xf')][_0x204641[_0x9b80('0x47')]][_0x9b80('0x50')]?this[_0x9b80('0xf')][_0x204641[_0x9b80('0x47')]][_0x9b80('0x50')]||'inbound':'inbound';_0x204641[_0x9b80('0x6d')]=_0x25f861['queue'];_0x204641['queuecallerjoinAt']=moment()['format'](_0x9b80('0x78'));_0x204641[_0x9b80('0x79')]=_0x25f861[_0x9b80('0x79')];_0x204641[_0x9b80('0x7a')]=_0x25f861[_0x9b80('0x7a')];_0x204641['uniqueid']=_0x25f861[_0x9b80('0x45')];_0x204641['routealias']=this[_0x9b80('0xe')][_0x25f861[_0x9b80('0x45')]][_0x9b80('0x7b')];logger[_0x9b80('0x6e')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x204641[_0x9b80('0x47')],_0x204641['type']);_['merge'](_0x204641,_[_0x9b80('0x7c')](_0x25f861,_[_0x9b80('0x7d')](_0x204641)));this['queueReports'][_0x25f861[_0x9b80('0x45')]]['push'](_0x204641);this[_0x9b80('0xe')][_0x25f861[_0x9b80('0x45')]]=_0x204641;this[_0x9b80('0x43')](_0x204641,_0x9b80('0x17'));}}catch(_0x3a2358){logger[_0x9b80('0x38')]('[%s][voiceQueueReport][queuecallerjoin]',_0x25f861['uniqueid'],util[_0x9b80('0x3a')](_0x3a2358,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9b80('0x33')][_0x9b80('0x1a')]=function(_0x3ef63c){try{if(this['isNotNull'](_0x3ef63c)){logger[_0x9b80('0x6c')](_0x9b80('0x7e'),_0x3ef63c['uniqueid'],util['inspect'](_0x3ef63c,{'showHidden':![],'depth':null}));if(this[_0x9b80('0xc')][_0x3ef63c[_0x9b80('0x45')]]){var _0x19e8c0=_['last'](this[_0x9b80('0xc')][_0x3ef63c[_0x9b80('0x45')]]);_0x19e8c0['queuecallercomplete']=![];_0x19e8c0['queuecallercompleteAt']=null;_0x19e8c0['holdtime']=_0x3ef63c['holdtime'];_0x19e8c0[_0x9b80('0x7f')]=_0x3ef63c['originalposition'];_0x19e8c0[_0x9b80('0x19')]=!![];_0x19e8c0[_0x9b80('0x80')]=moment()[_0x9b80('0x46')](_0x9b80('0x78'));_0x19e8c0['queuecallerexitreason']=_0x9b80('0x81');_0x19e8c0[_0x9b80('0x82')]=null;logger[_0x9b80('0x6e')](_0x9b80('0x83'),_0x19e8c0[_0x9b80('0x47')],_0x19e8c0[_0x9b80('0x50')]);this[_0x9b80('0xe')][_0x3ef63c[_0x9b80('0x45')]]=_0x19e8c0;this[_0x9b80('0x40')](_0x19e8c0,'queuecallerabandon');}}}catch(_0x56773a){logger[_0x9b80('0x38')]('[%s][voiceQueueReport][queuecallerabandon]',_0x3ef63c[_0x9b80('0x45')],util[_0x9b80('0x3a')](_0x56773a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9b80('0x33')][_0x9b80('0x1c')]=function(_0x1e4f13){try{if(this['isNotNull'](_0x1e4f13)){logger[_0x9b80('0x6c')](_0x9b80('0x84'),_0x1e4f13['uniqueid'],util[_0x9b80('0x3a')](_0x1e4f13,{'showHidden':![],'depth':null}));if(this[_0x9b80('0xc')][_0x1e4f13[_0x9b80('0x45')]]){var _0x5d732a=_['last'](this[_0x9b80('0xc')][_0x1e4f13[_0x9b80('0x45')]]);_0x5d732a['queuecallerleaveAt']=moment()[_0x9b80('0x46')](_0x9b80('0x78'));_0x5d732a['connectedlinenum']=_0x1e4f13['connectedlinenum'];_0x5d732a[_0x9b80('0x85')]=_0x1e4f13[_0x9b80('0x85')];logger[_0x9b80('0x6e')](_0x9b80('0x86'),_0x5d732a[_0x9b80('0x47')],_0x5d732a['type'],_0x1e4f13['connectedlinenum'],_0x1e4f13['connectedlinename']);this[_0x9b80('0xe')][_0x1e4f13[_0x9b80('0x45')]]=_0x5d732a;this[_0x9b80('0x43')](_0x5d732a,_0x9b80('0x1b'));}}}catch(_0x2035fe){logger[_0x9b80('0x38')]('[%s][voiceQueueReport][queuecallerleave]',_0x1e4f13[_0x9b80('0x45')],util[_0x9b80('0x3a')](_0x2035fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x222801){try{if(this['isNotNull'](_0x222801)){logger[_0x9b80('0x6c')](_0x9b80('0x87'),_0x222801[_0x9b80('0x45')],util[_0x9b80('0x3a')](_0x222801,{'showHidden':![],'depth':null}));if(this[_0x9b80('0xc')][_0x222801['uniqueid']]){var _0x2e0525=_[_0x9b80('0x88')](this[_0x9b80('0xc')][_0x222801[_0x9b80('0x45')]]);_0x2e0525[_0x9b80('0x89')]=!![];_0x2e0525[_0x9b80('0x8a')]='COMPLETEDBYAGENT';logger[_0x9b80('0x6e')](_0x9b80('0x8b'),_0x2e0525[_0x9b80('0x47')],_0x2e0525[_0x9b80('0x50')]);}}}catch(_0x2a9c50){logger['error'](_0x9b80('0x87'),_0x222801['uniqueid'],util[_0x9b80('0x3a')](_0x2a9c50,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9b80('0x1d')]=function(_0x11ec8f){try{if(this[_0x9b80('0x6b')](_0x11ec8f)){logger['debug'](_0x9b80('0x8c'),_0x11ec8f[_0x9b80('0x45')],util['inspect'](_0x11ec8f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x11ec8f[_0x9b80('0x45')]]){var _0x169c61=_[_0x9b80('0x88')](this['queueReports'][_0x11ec8f[_0x9b80('0x45')]]);_0x169c61[_0x9b80('0x19')]=![];_0x169c61[_0x9b80('0x80')]=null;_0x169c61['assigned']=!![];_0x169c61['lastAssignedTo']=_0x11ec8f[_0x9b80('0x8d')];_0x169c61[_0x9b80('0x8e')]=_0x11ec8f['holdtime'];_0x169c61['queuecallercomplete']=!![];_0x169c61[_0x9b80('0x8f')]=![];_0x169c61[_0x9b80('0x90')]=null;if(!_0x169c61[_0x9b80('0x91')]){if(_0x11ec8f['reason']==_0x9b80('0x91')){_0x169c61[_0x9b80('0x8a')]=_0x9b80('0x92');logger[_0x9b80('0x6e')](_0x9b80('0x93'),_0x169c61[_0x9b80('0x47')],_0x169c61[_0x9b80('0x50')]);}else{if(_[_0x9b80('0x94')](_0x11ec8f[_0x9b80('0x95')][_0x9b80('0x96')](),_0x9b80('0x97'))){if(this[_0x9b80('0xc')][_0x11ec8f[_0x9b80('0x98')]]){var _0x401e5d=_[_0x9b80('0x88')](this['queueReports'][_0x11ec8f['linkedid']]);_0x401e5d[_0x9b80('0x89')]=![];_0x401e5d[_0x9b80('0x8f')]=!![];_0x401e5d[_0x9b80('0x90')]=moment(_0x169c61['queuecallerjoinAt'])['add'](_0x11ec8f[_0x9b80('0x8e')],_0x9b80('0x99'))[_0x9b80('0x46')](_0x9b80('0x78'));_0x401e5d[_0x9b80('0x8a')]=_0x9b80('0x9a');_0x401e5d[_0x9b80('0x91')]=!![];_0x401e5d[_0x9b80('0x9b')]='FORWARD';_0x401e5d[_0x9b80('0x9c')]=_0x11ec8f['destexten'];_0x401e5d[_0x9b80('0x9d')]=_0x11ec8f[_0x9b80('0x45')];logger['info'](_0x9b80('0x9e'),_0x401e5d[_0x9b80('0x47')],_0x401e5d[_0x9b80('0x50')]);var _0x8fb9a3=this[_0x9b80('0xc')][_0x11ec8f[_0x9b80('0x98')]];this[_0x9b80('0xc')][_0x11ec8f['linkedid']]=this[_0x9b80('0xc')][_0x11ec8f[_0x9b80('0x45')]];this[_0x9b80('0xc')][_0x11ec8f[_0x9b80('0x45')]]=_0x8fb9a3;}}else{_0x169c61[_0x9b80('0x8a')]=_0x9b80('0x9f')+_0x11ec8f[_0x9b80('0xa0')][_0x9b80('0xa1')]();logger[_0x9b80('0x6e')](_0x9b80('0xa2'),_0x169c61['name'],_0x169c61[_0x9b80('0x50')],_0x169c61[_0x9b80('0x8a')]);}}}this[_0x9b80('0xe')][_0x11ec8f[_0x9b80('0x45')]]=_0x169c61;this[_0x9b80('0x40')](_0x169c61,_0x9b80('0xa3'));}}}catch(_0x32a0f7){logger[_0x9b80('0x38')](_0x9b80('0x8c'),_0x11ec8f[_0x9b80('0x45')],util[_0x9b80('0x3a')](_0x32a0f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9b80('0x33')][_0x9b80('0x21')]=function(_0xb41ec0){try{if(this[_0x9b80('0x6b')](_0xb41ec0)){logger[_0x9b80('0x6c')](_0x9b80('0xa4'),_0xb41ec0['uniqueid'],util['inspect'](_0xb41ec0,{'showHidden':![],'depth':null}));this[_0x9b80('0xa5')](_0xb41ec0['uniqueid'],_[_0x9b80('0x7d')](_0xb41ec0[_0x9b80('0xa6')])[0x0],_0xb41ec0[_0x9b80('0xa7')]);if(this[_0x9b80('0xc')][_0xb41ec0[_0x9b80('0x45')]]){var _0x337f61=_['last'](this[_0x9b80('0xc')][_0xb41ec0['uniqueid']]);if(_0x337f61){if(this[_0x9b80('0x6b')](_0xb41ec0['variable'])&&this[_0x9b80('0x6b')](_0xb41ec0[_0x9b80('0xa6')][_0x9b80('0xa8')])){switch(_0xb41ec0[_0x9b80('0xa7')]){case _0x9b80('0xa9'):_0x337f61[_0x9b80('0x8f')]=![];_0x337f61[_0x9b80('0x90')]=null;break;case'TIMEOUT':_0x337f61[_0x9b80('0xaa')]=_0x9b80('0xab');_0x337f61[_0x9b80('0x8f')]=!![];_0x337f61[_0x9b80('0x90')]=moment()[_0x9b80('0x46')](_0x9b80('0x78'));_0x337f61[_0x9b80('0xac')]=moment()[_0x9b80('0x46')](_0x9b80('0x78'));logger[_0x9b80('0x6c')](_0x9b80('0xad'),_0xb41ec0[_0x9b80('0x45')],util['inspect'](_0x337f61,{'showHidden':![],'depth':null}));ami[_0x9b80('0x42')](_0x9b80('0xae'),_0x337f61);break;default:_0x337f61[_0x9b80('0x8f')]=!![];_0x337f61[_0x9b80('0x90')]=moment()[_0x9b80('0x46')](_0x9b80('0x78'));_0x337f61[_0x9b80('0xac')]=moment()[_0x9b80('0x46')](_0x9b80('0x78'));}_0x337f61[_0x9b80('0x19')]=![];_0x337f61[_0x9b80('0x80')]=null;_0x337f61[_0x9b80('0x8a')]=_0xb41ec0['value'];this[_0x9b80('0xe')][_0xb41ec0['uniqueid']]=_0x337f61;this['emitVoiceQueueChannelRemove'](_0x337f61,'varset');}else if(this[_0x9b80('0x6b')](_0xb41ec0['variable'])&&this[_0x9b80('0x6b')](_0xb41ec0['variable'][_0x9b80('0xaf')])){if(!_0x337f61[_0x9b80('0x19')]){_0x337f61[_0x9b80('0x8f')]=!![];_0x337f61[_0x9b80('0x90')]=moment()[_0x9b80('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x337f61[_0x9b80('0x8a')]=_0x9b80('0xb0');_0x337f61[_0x9b80('0xac')]=moment()[_0x9b80('0x46')](_0x9b80('0x78'));this[_0x9b80('0xe')][_0xb41ec0[_0x9b80('0x45')]]=_0x337f61;}}logger[_0x9b80('0x6e')](_0x9b80('0xb1'),_0xb41ec0[_0x9b80('0x45')],_0x337f61[_0x9b80('0x47')],_0x337f61[_0x9b80('0x50')],_[_0x9b80('0x7d')](_0xb41ec0[_0x9b80('0xa6')])[0x0],_0xb41ec0[_0x9b80('0xa7')]);_0x337f61['variables']=this[_0x9b80('0x3c')][_0xb41ec0[_0x9b80('0x45')]];}}}}catch(_0x574e8c){logger[_0x9b80('0x38')](_0x9b80('0xa4'),_0xb41ec0['uniqueid'],util[_0x9b80('0x3a')](_0x574e8c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9b80('0x33')][_0x9b80('0xa5')]=function(_0x16093a,_0x253336,_0x209449){var _0x4cd2fe=[_0x9b80('0xb2'),'rtpaudioqosbridged',_0x9b80('0xb3'),_0x9b80('0xb4'),_0x9b80('0xb5'),_0x9b80('0xb6'),'rtpaudioqosrtt',_0x9b80('0xb7'),_0x9b80('0xb8'),_0x9b80('0xb9'),_0x9b80('0xba'),'bridgepvtcallid',_0x9b80('0xbb'),_0x9b80('0xbc'),_0x9b80('0xbd'),_0x9b80('0xbe'),_0x9b80('0x8d'),_0x9b80('0xbf'),_0x9b80('0xc0')];if(!_[_0x9b80('0x35')](_0x253336)&&!_[_0x9b80('0xc1')](_0x4cd2fe,_0x253336)){if(_[_0x9b80('0x64')](this[_0x9b80('0x3c')][_0x16093a])){this[_0x9b80('0x3c')][_0x16093a]={};}this[_0x9b80('0x3c')][_0x16093a][_0x253336]=_0x209449;}};VoiceQueueReport[_0x9b80('0x33')][_0x9b80('0xc2')]=function(_0x4a02a7,_0x4710db,_0x4c31cd){var _0x3f1b3c={};for(var _0x2c3c11=0x0;_0x2c3c11=0x0?moment(_0x160b07['endtime'])[_0x916a('0x17')](_0x160b07[_0x916a('0x15')],_0x916a('0xe')):null,'data1':_0x916a('0x18'),'data2':_0x160b07['accountcode'],'data3':_0x160b07[_0x916a('0x10')],'data4':_0x160b07[_0x916a('0x19')]||null,'role':'agent','internal':_0x160b07[_0x916a('0x11')]?_[_0x916a('0x12')](_0x160b07[_0x916a('0x11')]):undefined,'uniqueid':_0x160b07[_0x916a('0x1a')]},'log':_0x916a('0x6')});}; \ No newline at end of file +var _0x3881=['inbound','exten','agent','accountcode','toNumber','uniqueid','voice','membername','endtime','starttime','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','seconds'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x3881,0x13f));var _0x1388=function(_0x3638bb,_0x524397){_0x3638bb=_0x3638bb-0x0;var _0x30d386=_0x3881[_0x3638bb];return _0x30d386;};'use strict';var moment=require(_0x1388('0x0'));var _=require(_0x1388('0x1'));var util=require(_0x1388('0x2'));var client=require(_0x1388('0x3'));exports[_0x1388('0x4')]=function(_0x358f66){var _0x4ebba4=_0x358f66[_0x1388('0x5')]||_0x358f66[_0x1388('0x6')];return client['Request'](_0x1388('0x7'),{'body':{'channel':'voice','membername':_0x358f66['lastAssignedTo'],'interface':_[_0x1388('0x8')](_0x358f66[_0x1388('0x9')])?util[_0x1388('0xa')](_0x1388('0xb'),_0x358f66[_0x1388('0xc')]):_0x358f66[_0x1388('0x9')],'type':_0x1388('0xd'),'enterAt':_0x358f66['queuecallerleaveAt'],'exitAt':_0x4ebba4,'duration':moment(_0x4ebba4)[_0x1388('0xe')](_0x358f66[_0x1388('0xf')],_0x1388('0x10')),'data1':_0x1388('0x11'),'data2':_0x358f66['calleridnum'],'data3':_0x358f66[_0x1388('0x12')],'data4':null,'data5':_0x358f66['queue'],'role':_0x1388('0x13'),'internal':_0x358f66[_0x1388('0x14')]?_[_0x1388('0x15')](_0x358f66['accountcode']):undefined,'uniqueid':_0x358f66[_0x1388('0x16')]},'log':_0x1388('0x7')});};exports['voiceDialReport']=function(_0x40f5e2){return client['Request'](_0x1388('0x7'),{'body':{'channel':_0x1388('0x17'),'membername':_0x40f5e2[_0x1388('0x18')],'interface':_0x40f5e2['interface'],'type':_0x1388('0xd'),'enterAt':_0x40f5e2['starttime'],'exitAt':_0x40f5e2['endtime'],'duration':moment(_0x40f5e2[_0x1388('0x19')])['diff'](_0x40f5e2[_0x1388('0x1a')],_0x1388('0x10'))>=0x0?moment(_0x40f5e2['endtime'])['diff'](_0x40f5e2[_0x1388('0x1a')],_0x1388('0x10')):null,'data1':'outbound','data2':_0x40f5e2[_0x1388('0x14')],'data3':_0x40f5e2[_0x1388('0x12')],'data4':_0x40f5e2[_0x1388('0x1b')]||null,'role':_0x1388('0x13'),'internal':_0x40f5e2['accountcode']?_[_0x1388('0x15')](_0x40f5e2[_0x1388('0x14')]):undefined,'uniqueid':_0x40f5e2['uniqueid']},'log':_0x1388('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 84463ab..365da4b 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 _0xca1d=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2eecef,_0x193bf1){var _0x230c65=function(_0x1a440a){while(--_0x1a440a){_0x2eecef['push'](_0x2eecef['shift']());}};_0x230c65(++_0x193bf1);}(_0xca1d,0x1e6));var _0xdca1=function(_0x1b6db5,_0x27fedf){_0x1b6db5=_0x1b6db5-0x0;var _0x57169e=_0xca1d[_0x1b6db5];return _0x57169e;};'use strict';var client=require(_0xdca1('0x0'));exports[_0xdca1('0x1')]=function(){return client[_0xdca1('0x2')](_0xdca1('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xdca1('0x4'),_0xdca1('0x5')]},'log':_0xdca1('0x6')});}; \ No newline at end of file +var _0x30c7=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client','Request'];(function(_0x548c3f,_0x528fb0){var _0x547e16=function(_0xd93543){while(--_0xd93543){_0x548c3f['push'](_0x548c3f['shift']());}};_0x547e16(++_0x528fb0);}(_0x30c7,0x111));var _0x730c=function(_0x5956d1,_0x50f5fc){_0x5956d1=_0x5956d1-0x0;var _0x1a7d35=_0x30c7[_0x5956d1];return _0x1a7d35;};'use strict';var client=require(_0x730c('0x0'));exports['getSettings']=function(){return client[_0x730c('0x1')](_0x730c('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x730c('0x3'),'previewRecallmeReminderInterval']},'log':_0x730c('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 421c33d..f320284 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 _0xa400=['GetTemplate','name','html','../client','Request'];(function(_0x5ca6b5,_0x48a6dd){var _0x9adb46=function(_0x1fb723){while(--_0x1fb723){_0x5ca6b5['push'](_0x5ca6b5['shift']());}};_0x9adb46(++_0x48a6dd);}(_0xa400,0x1cf));var _0x0a40=function(_0x5b8334,_0x341c4b){_0x5b8334=_0x5b8334-0x0;var _0x17a341=_0xa400[_0x5b8334];return _0x17a341;};'use strict';var client=require(_0x0a40('0x0'));exports['getTemplates']=function(_0x5d1f1e){return function(_0x4d7efa){return client[_0x0a40('0x1')](_0x0a40('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0a40('0x3'),_0x0a40('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x7b00=['html','GetTemplate','../client','getTemplates','Request'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x7b00,0x1ba));var _0x07b0=function(_0x34b7d9,_0x337d3a){_0x34b7d9=_0x34b7d9-0x0;var _0x21ccdc=_0x7b00[_0x34b7d9];return _0x21ccdc;};'use strict';var client=require(_0x07b0('0x0'));exports[_0x07b0('0x1')]=function(_0xeed03e){return function(_0x4d560f){return client[_0x07b0('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x07b0('0x3')]},'log':_0x07b0('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 73edc2a..c86b1bc 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 _0x9ae8=['data4','data5','data7','../client','getTriggers','Request','name','channel','AllConditions','field','operator','value','Condition','AnyConditions','Action','action','data1','data2','data3'];(function(_0xf5d73f,_0x9a2f9c){var _0x5479ca=function(_0x4d32f7){while(--_0x4d32f7){_0xf5d73f['push'](_0xf5d73f['shift']());}};_0x5479ca(++_0x9a2f9c);}(_0x9ae8,0x9b));var _0x89ae=function(_0x5f00b8,_0x2e4642){_0x5f00b8=_0x5f00b8-0x0;var _0x41fb38=_0x9ae8[_0x5f00b8];return _0x41fb38;};'use strict';var client=require(_0x89ae('0x0'));exports[_0x89ae('0x1')]=function(_0x470037){return function(_0x3d8d08){return client[_0x89ae('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x89ae('0x3'),_0x89ae('0x4'),'status'],'include':[{'model':'Condition','as':_0x89ae('0x5'),'attributes':['id',_0x89ae('0x6'),_0x89ae('0x7'),_0x89ae('0x8')]},{'model':_0x89ae('0x9'),'as':_0x89ae('0xa'),'attributes':['id',_0x89ae('0x6'),_0x89ae('0x7'),_0x89ae('0x8')]},{'model':_0x89ae('0xb'),'as':'Actions','attributes':['id',_0x89ae('0xc'),_0x89ae('0xd'),_0x89ae('0xe'),_0x89ae('0xf'),_0x89ae('0x10'),_0x89ae('0x11'),'data6',_0x89ae('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x1cfd=['../client','getTriggers','Request','GetTrigger','channel','status','AllConditions','field','operator','value','Condition','AnyConditions','Action','Actions','action','data1','data2','data3','data5','data6','data7'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cfd,0x1a4));var _0xd1cf=function(_0x341b8e,_0xef30c9){_0x341b8e=_0x341b8e-0x0;var _0x2ea517=_0x1cfd[_0x341b8e];return _0x2ea517;};'use strict';var client=require(_0xd1cf('0x0'));exports[_0xd1cf('0x1')]=function(_0x3528db){return function(_0x1f8e67){return client[_0xd1cf('0x2')](_0xd1cf('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd1cf('0x4'),_0xd1cf('0x5')],'include':[{'model':'Condition','as':_0xd1cf('0x6'),'attributes':['id',_0xd1cf('0x7'),_0xd1cf('0x8'),_0xd1cf('0x9')]},{'model':_0xd1cf('0xa'),'as':_0xd1cf('0xb'),'attributes':['id',_0xd1cf('0x7'),'operator',_0xd1cf('0x9')]},{'model':_0xd1cf('0xc'),'as':_0xd1cf('0xd'),'attributes':['id',_0xd1cf('0xe'),_0xd1cf('0xf'),_0xd1cf('0x10'),_0xd1cf('0x11'),'data4',_0xd1cf('0x12'),_0xd1cf('0x13'),_0xd1cf('0x14')]}]},'log':_0xd1cf('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 257aa93..d5dd8bf 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 _0xc5b1=['GetTrunk','defaultuser','../client','getTrunks'];(function(_0x32abf8,_0x3e0374){var _0x20bcdf=function(_0x4ae592){while(--_0x4ae592){_0x32abf8['push'](_0x32abf8['shift']());}};_0x20bcdf(++_0x3e0374);}(_0xc5b1,0x106));var _0x1c5b=function(_0x5863b8,_0x22f9eb){_0x5863b8=_0x5863b8-0x0;var _0x531413=_0xc5b1[_0x5863b8];return _0x531413;};'use strict';var client=require(_0x1c5b('0x0'));exports[_0x1c5b('0x1')]=function(_0x140f1d){return function(_0x5a9bb3){return client['Request'](_0x1c5b('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x1c5b('0x3')]},'log':_0x1c5b('0x2')});};}; \ No newline at end of file +var _0x0624=['defaultuser','Request','GetTrunk','name','registry'];(function(_0x30f7fb,_0x4be188){var _0x29994c=function(_0x1bb6cd){while(--_0x1bb6cd){_0x30f7fb['push'](_0x30f7fb['shift']());}};_0x29994c(++_0x4be188);}(_0x0624,0x132));var _0x4062=function(_0x16cd17,_0x4e5b1f){_0x16cd17=_0x16cd17-0x0;var _0x4da629=_0x0624[_0x16cd17];return _0x4da629;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x53c126){return function(_0x4a5170){return client[_0x4062('0x0')](_0x4062('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4062('0x2'),_0x4062('0x3'),_0x4062('0x4')]},'log':_0x4062('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index e98b274..60db280 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x1d5e03,_0x35f91a){var _0x52ea3d=function(_0x54c32b){while(--_0x54c32b){_0x1d5e03['push'](_0x1d5e03['shift']());}};_0x52ea3d(++_0x35f91a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x21fe11,_0x52f846){var _0x5eb704=function(_0x6be159){while(--_0x6be159){_0x21fe11['push'](_0x21fe11['shift']());}};_0x5eb704(++_0x52f846);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0xcb91[_0x6182ff];return _0x1cec22;};'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 066247f..599b787 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 _0x544d=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x45f835,_0x548fa7){var _0x21d213=function(_0x56d780){while(--_0x56d780){_0x45f835['push'](_0x45f835['shift']());}};_0x21d213(++_0x548fa7);}(_0x544d,0xb5));var _0xd544=function(_0x4f3070,_0xa0e620){_0x4f3070=_0x4f3070-0x0;var _0x4c4675=_0x544d[_0x4f3070];return _0x4c4675;};'use strict';var client=require(_0xd544('0x0'));exports['create']=function(_0x37e12d){return client[_0xd544('0x1')](_0xd544('0x2'),{'body':_0x37e12d,'log':_0xd544('0x2')});};exports[_0xd544('0x3')]=function(_0x1b93e8,_0x240b1e,_0x20a47c){return client[_0xd544('0x1')]('UpdateVoiceAgentReport',{'body':_0x1b93e8,'options':{'where':{'uniqueid':_0x240b1e,'interface':_0x20a47c,'agentcomplete':!![]}},'log':_0xd544('0x4')});}; \ No newline at end of file +var _0x63a8=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x5a7b40,_0x585230){var _0x463559=function(_0x280fe4){while(--_0x280fe4){_0x5a7b40['push'](_0x5a7b40['shift']());}};_0x463559(++_0x585230);}(_0x63a8,0x1c0));var _0x863a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x63a8[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x863a('0x0'));exports[_0x863a('0x1')]=function(_0x5ca238){return client[_0x863a('0x2')](_0x863a('0x3'),{'body':_0x5ca238,'log':_0x863a('0x3')});};exports[_0x863a('0x4')]=function(_0x23c55b,_0x4c22ea,_0x82d9b7){return client[_0x863a('0x2')](_0x863a('0x5'),{'body':_0x23c55b,'options':{'where':{'uniqueid':_0x4c22ea,'interface':_0x82d9b7,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 1d39698..3a2055a 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 _0xdb9d=['format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','outbound','day'];(function(_0x3fea87,_0x5917e4){var _0x5c5a53=function(_0x3b8ceb){while(--_0x3b8ceb){_0x3fea87['push'](_0x3fea87['shift']());}};_0x5c5a53(++_0x5917e4);}(_0xdb9d,0x198));var _0xddb9=function(_0x59c86e,_0x38ce57){_0x59c86e=_0x59c86e-0x0;var _0x48a50e=_0xdb9d[_0x59c86e];return _0x48a50e;};'use strict';var moment=require(_0xddb9('0x0'));var util=require(_0xddb9('0x1'));var _=require(_0xddb9('0x2'));var client=require('../client');exports['create']=function(_0x3adce9){return client[_0xddb9('0x3')](_0xddb9('0x4'),{'body':_[_0xddb9('0x5')](_0x3adce9,{'source':_0x3adce9[_0xddb9('0x6')],'destinationcontext':_0x3adce9[_0xddb9('0x7')],'callerid':_0x3adce9['callerid'],'amaflags':_0xddb9('0x8')}),'log':_0xddb9('0x4')});};exports[_0xddb9('0x9')]=function(){return function(){return client[_0xddb9('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xddb9('0xa')],'createdAt':{'$between':[moment()['startOf'](_0xddb9('0xb'))[_0xddb9('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xddb9('0xd')](_0xddb9('0xb'))[_0xddb9('0xc')](_0xddb9('0xe'))]}},'attributes':[_0xddb9('0xf'),_0xddb9('0x10'),_0xddb9('0x11'),_0xddb9('0x12')]},'log':_0xddb9('0x13')});};}; \ No newline at end of file +var _0x6325=['GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','util','lodash','../client','create','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports'];(function(_0x428c99,_0x3f22c3){var _0x51c90f=function(_0x21a28e){while(--_0x21a28e){_0x428c99['push'](_0x428c99['shift']());}};_0x51c90f(++_0x3f22c3);}(_0x6325,0x118));var _0x5632=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6325[_0x4b369d];return _0x571a98;};'use strict';var moment=require('moment');var util=require(_0x5632('0x0'));var _=require(_0x5632('0x1'));var client=require(_0x5632('0x2'));exports[_0x5632('0x3')]=function(_0x2b8203){return client['Request'](_0x5632('0x4'),{'body':_[_0x5632('0x5')](_0x2b8203,{'source':_0x2b8203['calleridnum'],'destinationcontext':_0x2b8203[_0x5632('0x6')],'callerid':_0x2b8203[_0x5632('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x5632('0x4')});};exports[_0x5632('0x8')]=function(){return function(){return client['Request'](_0x5632('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x5632('0xa'))[_0x5632('0xb')](_0x5632('0xc')),moment()[_0x5632('0xd')](_0x5632('0xa'))[_0x5632('0xb')](_0x5632('0xc'))]}},'attributes':['type',_0x5632('0xe'),_0x5632('0xf'),_0x5632('0x10')]},'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 1bc8338..f9a0b0e 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 _0x6ebb=['CreateVoiceDialReport','Request'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x6ebb,0xfb));var _0xb6eb=function(_0x2c4d54,_0x33e012){_0x2c4d54=_0x2c4d54-0x0;var _0x3c9e0e=_0x6ebb[_0x2c4d54];return _0x3c9e0e;};'use strict';var client=require('../client');exports['create']=function(_0x390505){return client[_0xb6eb('0x0')](_0xb6eb('0x1'),{'body':_0x390505,'log':_0xb6eb('0x1')});}; \ No newline at end of file +var _0x2141=['../client','create','Request','CreateVoiceDialReport'];(function(_0x400e42,_0x5120ef){var _0x50c14f=function(_0x3ad61c){while(--_0x3ad61c){_0x400e42['push'](_0x400e42['shift']());}};_0x50c14f(++_0x5120ef);}(_0x2141,0x94));var _0x1214=function(_0x3e63e4,_0x31bcc7){_0x3e63e4=_0x3e63e4-0x0;var _0x213610=_0x2141[_0x3e63e4];return _0x213610;};'use strict';var client=require(_0x1214('0x0'));exports[_0x1214('0x1')]=function(_0x482547){return client[_0x1214('0x2')](_0x1214('0x3'),{'body':_0x482547,'log':_0x1214('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index fca18ce..f33b179 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 _0x0fd9=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x30ca97,_0x2603d4){var _0x4ec15e=function(_0x391650){while(--_0x391650){_0x30ca97['push'](_0x30ca97['shift']());}};_0x4ec15e(++_0x2603d4);}(_0x0fd9,0xa3));var _0x90fd=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0x0fd9[_0x2300c7];return _0x23f720;};'use strict';var client=require('../client');exports[_0x90fd('0x0')]=function(){return function(){return client[_0x90fd('0x1')](_0x90fd('0x2'),{'options':{'raw':!![],'attributes':['id',_0x90fd('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xc112=['recordingFormat','../client','getVoiceExtensions','Request','exten'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0xc112,0xec));var _0x2c11=function(_0x1fb389,_0x1038b9){_0x1fb389=_0x1fb389-0x0;var _0x54824c=_0xc112[_0x1fb389];return _0x54824c;};'use strict';var client=require(_0x2c11('0x0'));exports[_0x2c11('0x1')]=function(){return function(){return client[_0x2c11('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x2c11('0x3'),_0x2c11('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x2c11('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8003a94..3349d78 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 _0x9d71=['dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x412faa,_0x6d5ea8){var _0x204402=function(_0x1ddbe0){while(--_0x1ddbe0){_0x412faa['push'](_0x412faa['shift']());}};_0x204402(++_0x6d5ea8);}(_0x9d71,0xd4));var _0x19d7=function(_0x4abd12,_0x2732dd){_0x4abd12=_0x4abd12-0x0;var _0x1d4d92=_0x9d71[_0x4abd12];return _0x1d4d92;};'use strict';var client=require(_0x19d7('0x0'));exports[_0x19d7('0x1')]=function(){return function(){return client[_0x19d7('0x2')](_0x19d7('0x3'),{'options':{'raw':![],'attributes':['id',_0x19d7('0x4'),_0x19d7('0x5'),_0x19d7('0x6'),_0x19d7('0x7'),_0x19d7('0x8'),_0x19d7('0x9'),_0x19d7('0xa'),_0x19d7('0xb'),_0x19d7('0xc'),'dialLimitQueue','dialPowerLevel',_0x19d7('0xd'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0x19d7('0xe'),_0x19d7('0xf'),_0x19d7('0x10'),_0x19d7('0x11'),_0x19d7('0x12'),_0x19d7('0x13'),'dialCongestionRetryFrequency',_0x19d7('0x14'),_0x19d7('0x15'),'dialNoAnswerMaxRetry',_0x19d7('0x16'),_0x19d7('0x17'),_0x19d7('0x18'),'dialGlobalInterval',_0x19d7('0x19'),_0x19d7('0x1a'),_0x19d7('0x1b'),'dialAMDInitialSilence',_0x19d7('0x1c'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x19d7('0x1d'),_0x19d7('0x1e'),_0x19d7('0x1f'),_0x19d7('0x20'),'dialAMDMaximumWordLength',_0x19d7('0x21'),_0x19d7('0x22'),'dialRecallInQueue','dialOrderByScheduledAt',_0x19d7('0x23'),'dialAgiAfterHangupClient',_0x19d7('0x24'),'monitor_format',_0x19d7('0x25'),_0x19d7('0x26'),'dialCutDigit',_0x19d7('0x27'),'dialNoSuchNumberRetryFrequency',_0x19d7('0x28'),_0x19d7('0x29'),_0x19d7('0x2a'),'dialAbandonedRetryFrequency',_0x19d7('0x2b'),_0x19d7('0x2c'),_0x19d7('0x2d'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x19d7('0x2e'),_0x19d7('0x2f'),_0x19d7('0x30'),'dialPreviewRecallmeReminder',_0x19d7('0x31')],'include':[{'model':_0x19d7('0x32'),'as':_0x19d7('0x32'),'attributes':['id','name',_0x19d7('0x33'),_0x19d7('0x34')]},{'model':_0x19d7('0x35'),'as':_0x19d7('0x36'),'attributes':['id',_0x19d7('0x4')]},{'model':_0x19d7('0x32'),'as':_0x19d7('0x37'),'attributes':['id',_0x19d7('0x4'),_0x19d7('0x33'),_0x19d7('0x34')]},{'model':_0x19d7('0x38'),'as':_0x19d7('0x38'),'attributes':['id',_0x19d7('0x4')],'include':[{'model':'Interval','as':_0x19d7('0x39'),'attributes':['id','name',_0x19d7('0x3a')]}]}]},'log':_0x19d7('0x1')});};}; \ No newline at end of file +var _0x5579=['type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','monitor_format'];(function(_0x3cb054,_0x8d69ce){var _0x5f1582=function(_0x1b5751){while(--_0x1b5751){_0x3cb054['push'](_0x3cb054['shift']());}};_0x5f1582(++_0x8d69ce);}(_0x5579,0x19e));var _0x9557=function(_0x3b7dbc,_0x11ff61){_0x3b7dbc=_0x3b7dbc-0x0;var _0x2a8344=_0x5579[_0x3b7dbc];return _0x2a8344;};'use strict';var client=require('../client');exports[_0x9557('0x0')]=function(){return function(){return client['Request'](_0x9557('0x1'),{'options':{'raw':![],'attributes':['id',_0x9557('0x2'),_0x9557('0x3'),_0x9557('0x4'),'autopause',_0x9557('0x5'),_0x9557('0x6'),'dialActive',_0x9557('0x7'),_0x9557('0x8'),_0x9557('0x9'),_0x9557('0xa'),'dialPredictiveOptimization',_0x9557('0xb'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x9557('0xc'),'dialOriginateTimeout',_0x9557('0xd'),_0x9557('0xe'),_0x9557('0xf'),_0x9557('0x10'),_0x9557('0x11'),_0x9557('0x12'),_0x9557('0x13'),_0x9557('0x14'),_0x9557('0x15'),_0x9557('0x16'),_0x9557('0x17'),_0x9557('0x18'),'dialPrefix',_0x9557('0x19'),_0x9557('0x1a'),_0x9557('0x1b'),_0x9557('0x1c'),_0x9557('0x1d'),_0x9557('0x1e'),_0x9557('0x1f'),_0x9557('0x20'),_0x9557('0x21'),_0x9557('0x22'),_0x9557('0x23'),'timeout',_0x9557('0x24'),_0x9557('0x25'),_0x9557('0x26'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x9557('0x27'),_0x9557('0x5'),_0x9557('0x28'),'dialRandomLastDigitCallerIdNumber',_0x9557('0x29'),_0x9557('0x2a'),_0x9557('0x2b'),_0x9557('0x2c'),_0x9557('0x2d'),_0x9557('0x2e'),_0x9557('0x2f'),_0x9557('0x30'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x9557('0x31'),_0x9557('0x32'),'dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe',_0x9557('0x33'),_0x9557('0x34')],'include':[{'model':_0x9557('0x35'),'as':'Trunk','attributes':['id','name','callerid',_0x9557('0x36')]},{'model':_0x9557('0x37'),'as':_0x9557('0x38'),'attributes':['id',_0x9557('0x2')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x9557('0x2'),'callerid','active']},{'model':_0x9557('0x39'),'as':'Interval','attributes':['id',_0x9557('0x2')],'include':[{'model':_0x9557('0x39'),'as':_0x9557('0x3a'),'attributes':['id',_0x9557('0x2'),_0x9557('0x3b')]}]}]},'log':_0x9557('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index c196167..bc92469 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(_0x193826,_0x5f400d){var _0x4d9c6b=function(_0x559c8c){while(--_0x559c8c){_0x193826['push'](_0x193826['shift']());}};_0x4d9c6b(++_0x5f400d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x175602,_0x2300d7){var _0x4a0c2f=function(_0x36ddd9){while(--_0x36ddd9){_0x175602['push'](_0x175602['shift']());}};_0x4a0c2f(++_0x2300d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 a7a696e..ac8359e 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 _0x3574=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x2f653f,_0x1cef4e){var _0x479836=function(_0x4182c2){while(--_0x4182c2){_0x2f653f['push'](_0x2f653f['shift']());}};_0x479836(++_0x1cef4e);}(_0x3574,0x132));var _0x4357=function(_0x2cee5e,_0x62bcf5){_0x2cee5e=_0x2cee5e-0x0;var _0x394970=_0x3574[_0x2cee5e];return _0x394970;};'use strict';var client=require('../client');exports[_0x4357('0x0')]=function(_0x400536){return function(){return client[_0x4357('0x1')](_0x4357('0x2'),{'options':{'where':{'VoiceQueueId':_0x400536,'paused':!![]},'raw':!![]},'log':_0x4357('0x0')});};}; \ No newline at end of file +var _0x5d4c=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x57ba0e,_0x4c55a5){var _0x4fe8bf=function(_0x5085f4){while(--_0x5085f4){_0x57ba0e['push'](_0x57ba0e['shift']());}};_0x4fe8bf(++_0x4c55a5);}(_0x5d4c,0x124));var _0xc5d4=function(_0x59ff2d,_0x375bcd){_0x59ff2d=_0x59ff2d-0x0;var _0x8d9491=_0x5d4c[_0x59ff2d];return _0x8d9491;};'use strict';var client=require(_0xc5d4('0x0'));exports[_0xc5d4('0x1')]=function(_0x2092cf){return function(){return client[_0xc5d4('0x2')](_0xc5d4('0x3'),{'options':{'where':{'VoiceQueueId':_0x2092cf,'paused':!![]},'raw':!![]},'log':_0xc5d4('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0f7365d..de45e81 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x381acb,_0x1cd68c){var _0x56db71=function(_0x97d0ca){while(--_0x97d0ca){_0x381acb['push'](_0x381acb['shift']());}};_0x56db71(++_0x1cd68c);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5d0a,_0x1c6920){_0x4a5d0a=_0x4a5d0a-0x0;var _0x4adb50=_0x7a54[_0x4a5d0a];return _0x4adb50;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x12945f,_0x4429a0){var _0x2f55b7=function(_0x6766ac){while(--_0x6766ac){_0x12945f['push'](_0x12945f['shift']());}};_0x2f55b7(++_0x4429a0);}(_0x7a54,0x106));var _0x47a5=function(_0x42ceec,_0x270fa5){_0x42ceec=_0x42ceec-0x0;var _0x1ca46f=_0x7a54[_0x42ceec];return _0x1ca46f;};'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 edb7589..913d6db 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 _0x35d0=['transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum'];(function(_0x32c5ec,_0x413832){var _0x3a16bf=function(_0x26f83d){while(--_0x26f83d){_0x32c5ec['push'](_0x32c5ec['shift']());}};_0x3a16bf(++_0x413832);}(_0x35d0,0x193));var _0x035d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x35d0[_0x3e5086];return _0xfeb102;};'use strict';var client=require('../client');exports[_0x035d('0x0')]={};exports[_0x035d('0x1')]=function(_0x337e7b){return client[_0x035d('0x2')](_0x035d('0x3'),{'body':{'result':_0x337e7b[_0x035d('0x4')],'transfererchannel':_0x337e7b[_0x035d('0x5')],'transferercalleridnum':_0x337e7b[_0x035d('0x6')],'transferercalleridname':_0x337e7b['transferercalleridname'],'transfererconnectedlinenum':_0x337e7b[_0x035d('0x7')],'transfererconnectedlinename':_0x337e7b[_0x035d('0x8')],'transfereraccountcode':_0x337e7b[_0x035d('0x9')],'transferercontext':_0x337e7b[_0x035d('0xa')],'transfererexten':_0x337e7b[_0x035d('0xb')],'transfererlinkedid':_0x337e7b[_0x035d('0xc')],'transfereechannel':_0x337e7b[_0x035d('0xd')],'transfereecalleridnum':_0x337e7b[_0x035d('0xe')],'transfereecalleridname':_0x337e7b[_0x035d('0xf')],'transfereeconnectedlinenum':_0x337e7b[_0x035d('0x10')],'transfereeconnectedlinename':_0x337e7b[_0x035d('0x11')],'transfereeaccountcode':_0x337e7b[_0x035d('0x12')],'transfereecontext':_0x337e7b[_0x035d('0x13')],'transfereeexten':_0x337e7b[_0x035d('0x14')],'transfereelinkedid':_0x337e7b[_0x035d('0x15')],'isexternal':_0x337e7b['isexternal'],'context':_0x337e7b[_0x035d('0x16')],'extension':_0x337e7b[_0x035d('0x17')],'type':_0x035d('0x18')},'log':_0x035d('0x3')});};exports['attendedTransfer']=function(_0x37e92a){return client[_0x035d('0x2')](_0x035d('0x3'),{'body':{'result':_0x37e92a['result'],'transfererchannel':_0x37e92a[_0x035d('0x19')],'transferercalleridnum':_0x37e92a[_0x035d('0x1a')],'transferercalleridname':_0x37e92a[_0x035d('0x1b')],'transfererconnectedlinenum':_0x37e92a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x37e92a[_0x035d('0x1c')],'transfereraccountcode':_0x37e92a[_0x035d('0x1d')],'transferercontext':_0x37e92a['secondtransferercontext'],'transfererexten':_0x37e92a[_0x035d('0x1e')],'transfererlinkedid':_0x37e92a[_0x035d('0x1f')],'transfereechannel':_0x37e92a[_0x035d('0x20')],'transfereecalleridnum':_0x37e92a[_0x035d('0x21')],'transfereecalleridname':_0x37e92a[_0x035d('0x22')],'transfereeconnectedlinenum':_0x37e92a[_0x035d('0x23')],'transfereeconnectedlinename':_0x37e92a[_0x035d('0x24')],'transfereeaccountcode':_0x37e92a[_0x035d('0x25')],'transfereecontext':_0x37e92a[_0x035d('0x26')],'transfereeexten':_0x37e92a['transfertargetexten'],'transfereelinkedid':_0x37e92a['transfertargetlinkedid'],'isexternal':_0x37e92a['isexternal'],'context':_0x37e92a['origtransferercontext'],'extension':_0x37e92a[_0x035d('0x27')],'type':_0x035d('0x28')},'log':_0x035d('0x3')});}; \ No newline at end of file +var _0xac16=['transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','blindTransfer','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x344e50,_0x49123b){var _0x1ec3e6=function(_0x2c8d91){while(--_0x2c8d91){_0x344e50['push'](_0x344e50['shift']());}};_0x1ec3e6(++_0x49123b);}(_0xac16,0x119));var _0x6ac1=function(_0x52479c,_0x401853){_0x52479c=_0x52479c-0x0;var _0x232f09=_0xac16[_0x52479c];return _0x232f09;};'use strict';var client=require('../client');exports['transfers']={};exports[_0x6ac1('0x0')]=function(_0x33cb1a){return client['Request'](_0x6ac1('0x1'),{'body':{'result':_0x33cb1a[_0x6ac1('0x2')],'transfererchannel':_0x33cb1a['transfererchannel'],'transferercalleridnum':_0x33cb1a[_0x6ac1('0x3')],'transferercalleridname':_0x33cb1a['transferercalleridname'],'transfererconnectedlinenum':_0x33cb1a[_0x6ac1('0x4')],'transfererconnectedlinename':_0x33cb1a[_0x6ac1('0x5')],'transfereraccountcode':_0x33cb1a['transfereraccountcode'],'transferercontext':_0x33cb1a[_0x6ac1('0x6')],'transfererexten':_0x33cb1a[_0x6ac1('0x7')],'transfererlinkedid':_0x33cb1a[_0x6ac1('0x8')],'transfereechannel':_0x33cb1a['transfereechannel'],'transfereecalleridnum':_0x33cb1a[_0x6ac1('0x9')],'transfereecalleridname':_0x33cb1a[_0x6ac1('0xa')],'transfereeconnectedlinenum':_0x33cb1a[_0x6ac1('0xb')],'transfereeconnectedlinename':_0x33cb1a[_0x6ac1('0xc')],'transfereeaccountcode':_0x33cb1a[_0x6ac1('0xd')],'transfereecontext':_0x33cb1a['transfereecontext'],'transfereeexten':_0x33cb1a[_0x6ac1('0xe')],'transfereelinkedid':_0x33cb1a[_0x6ac1('0xf')],'isexternal':_0x33cb1a[_0x6ac1('0x10')],'context':_0x33cb1a[_0x6ac1('0x11')],'extension':_0x33cb1a[_0x6ac1('0x12')],'type':_0x6ac1('0x13')},'log':_0x6ac1('0x1')});};exports[_0x6ac1('0x14')]=function(_0x54ef8b){return client[_0x6ac1('0x15')](_0x6ac1('0x1'),{'body':{'result':_0x54ef8b[_0x6ac1('0x2')],'transfererchannel':_0x54ef8b[_0x6ac1('0x16')],'transferercalleridnum':_0x54ef8b[_0x6ac1('0x17')],'transferercalleridname':_0x54ef8b[_0x6ac1('0x18')],'transfererconnectedlinenum':_0x54ef8b[_0x6ac1('0x19')],'transfererconnectedlinename':_0x54ef8b[_0x6ac1('0x1a')],'transfereraccountcode':_0x54ef8b[_0x6ac1('0x1b')],'transferercontext':_0x54ef8b[_0x6ac1('0x1c')],'transfererexten':_0x54ef8b[_0x6ac1('0x1d')],'transfererlinkedid':_0x54ef8b[_0x6ac1('0x1e')],'transfereechannel':_0x54ef8b[_0x6ac1('0x1f')],'transfereecalleridnum':_0x54ef8b['transfertargetcalleridnum'],'transfereecalleridname':_0x54ef8b[_0x6ac1('0x20')],'transfereeconnectedlinenum':_0x54ef8b[_0x6ac1('0x21')],'transfereeconnectedlinename':_0x54ef8b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x54ef8b[_0x6ac1('0x22')],'transfereecontext':_0x54ef8b[_0x6ac1('0x23')],'transfereeexten':_0x54ef8b['transfertargetexten'],'transfereelinkedid':_0x54ef8b[_0x6ac1('0x24')],'isexternal':_0x54ef8b['isexternal'],'context':_0x54ef8b[_0x6ac1('0x25')],'extension':_0x54ef8b[_0x6ac1('0x26')],'type':'attended'},'log':_0x6ac1('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index f77f812..b37496c 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 _0x4058=['queueChannels','Redirect','exten','context','trunks','outboundChannels','campaigns','run','event','custom:','faxAccounts','send','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','asterisk','ami\x20disconnected','join','pick','keys','action','Reload','Action','then','message','catch','error','isConnected','username','command','Command','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumDuration','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','wav','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect'];(function(_0x3f3b97,_0x395d93){var _0xb6ab0c=function(_0x330c5a){while(--_0x330c5a){_0x3f3b97['push'](_0x3f3b97['shift']());}};_0xb6ab0c(++_0x395d93);}(_0x4058,0x129));var _0x8405=function(_0xa3b3ac,_0x355966){_0xa3b3ac=_0xa3b3ac-0x0;var _0x4bc57c=_0x4058[_0xa3b3ac];return _0x4bc57c;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var jayson=require(_0x8405('0x2'));var schema=require(_0x8405('0x3'));var moment=require(_0x8405('0x4'));var config=require(_0x8405('0x5'));var properties=require(_0x8405('0x6'));var ami=require(_0x8405('0x7'));exports[_0x8405('0x8')]=function(_0x4948b2,_0x5ebf0e,_0x57fb07){return new Promise(function(_0x1db7ea,_0x257d43){var _0x3d9bf6={'QueuePause':function(_0x1322e5){return new Promise(function(_0x1cb061){var _0x479c97=util[_0x8405('0x9')](_0x8405('0xa'),_0x8405('0xb'),_0x1322e5['name']);if(_0x4948b2[_0x8405('0xc')]&&_0x4948b2['timers'][_0x479c97]&&_0x4948b2[_0x8405('0xc')][_0x479c97][_0x8405('0xd')]){_0x4948b2['timers'][_0x479c97][_0x8405('0xe')]();}if(_0x4948b2[_0x8405('0xf')][_0x479c97]){_0x4948b2['agents'][_0x479c97]['updateStatusRealtime']({'statePause':_0x1322e5['pause']?!![]:![]});}_0x1cb061({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x262d32){var _0x575fcb=this;return new Promise(function(_0x495190,_0x4e6477){if(ami['isConnected']()==![]){return _0x4e6477(_0x575fcb['error'](0x1f4,[config[_0x8405('0x10')]['ip'],config[_0x8405('0x10')]['username'],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}_0x262d32=_[_0x8405('0x13')](_0x262d32,_[_0x8405('0x14')](properties['module']));_0x262d32[_0x8405('0x15')]=_0x8405('0x16');return ami[_0x8405('0x17')](_0x262d32)[_0x8405('0x18')](function(_0x135190){_0x495190({'code':0xc8,'message':_0x135190[_0x8405('0x19')]});})[_0x8405('0x1a')](function(_0x358633){_0x4e6477(_0x575fcb[_0x8405('0x1b')](0x1f5,_0x358633[_0x8405('0x19')]));});});},'Command':function(_0x34c79c){var _0x21376d=this;return new Promise(function(_0x131857,_0x241000){if(ami[_0x8405('0x1c')]()==![]){return _0x241000(_0x21376d[_0x8405('0x1b')](0x1f4,[config[_0x8405('0x10')]['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}_0x34c79c=_[_0x8405('0x13')](_0x34c79c,_0x8405('0x1e'));_0x34c79c[_0x8405('0x15')]=_0x8405('0x1f');return ami[_0x8405('0x17')](_0x34c79c)['then'](function(_0x4b0786){_0x131857({'code':0xc8,'message':_0x4b0786[_0x8405('0x20')]});})[_0x8405('0x1a')](function(_0x14436a){_0x241000(_0x21376d['error'](0x1f5,_0x14436a[_0x8405('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x5d51a9){var _0x48c5ea=[];for(var _0x480ad2 in _0x4948b2[_0x8405('0x21')]){if(_0x4948b2[_0x8405('0x21')][_0x8405('0x22')](_0x480ad2)){var _0x4450eb=_0x4948b2[_0x8405('0x21')][_0x480ad2];var _0x3e5b4c={'id':_0x4450eb['id'],'name':_0x4450eb[_0x8405('0x23')],'strategy':_0x4450eb[_0x8405('0x24')],'answered':_0x4450eb[_0x8405('0x25')],'available':_0x4450eb[_0x8405('0x26')],'loggedIn':_0x4450eb[_0x8405('0x27')],'pTalking':_0x4450eb[_0x8405('0x28')],'sumBillable':_0x4450eb['sumBillable'],'sumDuration':_0x4450eb[_0x8405('0x29')],'sumHoldTime':_0x4450eb['sumHoldTime']||0x0,'talking':_0x4450eb['talking'],'total':_0x4450eb[_0x8405('0x2a')],'type':_0x4450eb[_0x8405('0x2b')],'unmanaged':_0x4450eb[_0x8405('0x2c')],'abandoned':_0x4450eb[_0x8405('0x2d')],'waiting':_0x4450eb[_0x8405('0x2e')],'loggedInDb':_0x4450eb[_0x8405('0x2f')]};if(_0x4450eb[_0x8405('0x2b')]===_0x8405('0x30')){_0x3e5b4c[_0x8405('0x31')]=_0x4450eb[_0x8405('0x31')];_0x3e5b4c[_0x8405('0x32')]=_0x4450eb[_0x8405('0x32')];_0x3e5b4c[_0x8405('0x33')]=_0x4450eb['dialOriginateCallerIdName'];_0x3e5b4c[_0x8405('0x34')]=_0x4450eb[_0x8405('0x34')];_0x3e5b4c['dialOriginateTimeout']=_0x4450eb[_0x8405('0x35')];_0x3e5b4c[_0x8405('0x36')]=_0x4450eb[_0x8405('0x36')];_0x3e5b4c['temp']=_0x4450eb[_0x8405('0x37')];_0x3e5b4c[_0x8405('0x38')]=_0x4450eb[_0x8405('0x38')];_0x3e5b4c['outboundAnswerCallsDay']=_0x4450eb[_0x8405('0x39')];_0x3e5b4c[_0x8405('0x3a')]=_0x4450eb['outboundBlacklistCallsDay'];_0x3e5b4c[_0x8405('0x3b')]=_0x4450eb['outboundBusyCallsDay'];_0x3e5b4c[_0x8405('0x3c')]=_0x4450eb[_0x8405('0x3c')];_0x3e5b4c[_0x8405('0x3d')]=_0x4450eb[_0x8405('0x3d')];_0x3e5b4c[_0x8405('0x3e')]=_0x4450eb[_0x8405('0x3e')];_0x3e5b4c[_0x8405('0x3f')]=_0x4450eb[_0x8405('0x3f')];_0x3e5b4c[_0x8405('0x40')]=_0x4450eb[_0x8405('0x40')];_0x3e5b4c[_0x8405('0x41')]=_0x4450eb[_0x8405('0x41')];_0x3e5b4c['outboundOriginateFailureCallsDay']=_0x4450eb[_0x8405('0x42')];_0x3e5b4c['outboundReCallsDay']=_0x4450eb['outboundReCallsDay'];_0x3e5b4c[_0x8405('0x43')]=_0x4450eb[_0x8405('0x43')];_0x3e5b4c['outboundUnknownCallsDay']=_0x4450eb[_0x8405('0x44')];_0x3e5b4c[_0x8405('0x45')]=_0x4450eb[_0x8405('0x45')];_0x3e5b4c[_0x8405('0x46')]=_0x4450eb[_0x8405('0x46')];_0x3e5b4c['predictiveIntervalAvgTalktime']=_0x4450eb[_0x8405('0x47')];_0x3e5b4c[_0x8405('0x48')]=_0x4450eb[_0x8405('0x48')];_0x3e5b4c[_0x8405('0x49')]=_0x4450eb[_0x8405('0x49')];_0x3e5b4c['predictiveIntervalErlangCalls']=_0x4450eb[_0x8405('0x4a')];_0x3e5b4c[_0x8405('0x4b')]=_0x4450eb[_0x8405('0x4b')];_0x3e5b4c[_0x8405('0x4c')]=_0x4450eb[_0x8405('0x4c')];_0x3e5b4c[_0x8405('0x4d')]=_0x4450eb['predictiveIntervalMultiplicativeFactor'];_0x3e5b4c[_0x8405('0x4e')]=_0x4450eb[_0x8405('0x4e')];_0x3e5b4c[_0x8405('0x4f')]=_0x4450eb[_0x8405('0x4f')];_0x3e5b4c[_0x8405('0x50')]=_0x4450eb[_0x8405('0x50')];_0x3e5b4c[_0x8405('0x19')]=_0x4450eb['message'];_0x3e5b4c[_0x8405('0x51')]=_0x4450eb['originated'];_0x3e5b4c[_0x8405('0x52')]=_0x4450eb[_0x8405('0x52')];_0x3e5b4c['erlangCallToSecond']=_0x4450eb[_0x8405('0x53')];_0x3e5b4c[_0x8405('0x54')]=_0x4450eb[_0x8405('0x54')];_0x3e5b4c[_0x8405('0x55')]=_0x4450eb[_0x8405('0x55')];_0x3e5b4c[_0x8405('0x56')]=_0x4450eb[_0x8405('0x56')];_0x3e5b4c[_0x8405('0x57')]=_0x4450eb[_0x8405('0x57')];}if(_0x4450eb[_0x8405('0x58')]){_0x3e5b4c['Trunk']={'id':_0x4450eb['Trunk']['id'],'name':_0x4450eb[_0x8405('0x58')]['name'],'active':_0x4450eb[_0x8405('0x58')][_0x8405('0x59')],'callerid':_0x4450eb[_0x8405('0x58')]['callerid']};}if(_0x4450eb[_0x8405('0x5a')]){_0x3e5b4c[_0x8405('0x5a')]={'id':_0x4450eb['Interval']['id'],'name':_0x4450eb[_0x8405('0x5a')][_0x8405('0x23')]};}_0x48c5ea[_0x8405('0x5b')](_0x3e5b4c);}}_0x5d51a9({'count':_0x48c5ea[_0x8405('0x5c')],'rows':_0x48c5ea});});},'UpdateVoiceQueue':function(_0x55d189){return new Promise(function(_0x3b68b4,_0x336927){var _0x4fec13=_['find'](_0x4948b2['voiceQueues'],{'id':parseInt(_0x55d189['id'])});var _0x84020b=_[_0x8405('0x5d')](_0x55d189,['id']);if(_0x4fec13){for(var _0x1c0350 in _0x84020b){if(typeof _0x84020b[_0x1c0350]!==_0x8405('0x5e')&&typeof _0x4fec13[_0x1c0350]!=='undefined'){_0x4fec13[_0x1c0350]=_0x84020b[_0x1c0350];}}_0x3b68b4(_0x4fec13);}else{_0x336927();}});},'VoiceChannels':function(){return new Promise(function(_0x51ffcc){var _0x3c4ab2=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x60')]);_0x51ffcc({'count':_0x3c4ab2[_0x8405('0x5c')],'rows':_0x3c4ab2});});},'VoiceChannelMixMonitor':function(_0x2eced5){var _0x3c516f=this;return new Promise(function(_0x11a2d5,_0x600035){if(ami['isConnected']()==![]){return _0x600035(_0x3c516f[_0x8405('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}var _0x9a0ffe=schema(properties[_0x8405('0x61')])[_0x8405('0x3')](_0x2eced5);if(_0x9a0ffe[_0x8405('0x5c')]>0x0){return _0x600035(_0x3c516f['error'](0x1f4,_[_0x8405('0x62')](_0x9a0ffe,_0x8405('0x19'))[_0x8405('0x12')](',\x20')));}var _0x3e4473=_['find'](_0x4948b2['channels'],{'uniqueid':_0x2eced5[_0x8405('0x63')]});if(_0x3e4473&&_0x3e4473[_0x8405('0x64')]){var _0x152757=util[_0x8405('0x9')](_0x8405('0x65'),_0x2eced5[_0x8405('0x66')]||_0x2eced5[_0x8405('0x63')],_0x2eced5['format']||'wav');return ami[_0x8405('0x17')]({'action':'MixMonitor','channel':_0x3e4473[_0x8405('0x64')],'file':_0x152757,'options':_0x8405('0x67')})[_0x8405('0x18')](function(_0x4b8443){var _0x5b8a93=_[_0x8405('0x68')](_0x3e4473['monitors'],{'filename':_0x8405('0x69')+_0x152757[_0x8405('0x6a')]()});if(_[_0x8405('0x6b')](_0x5b8a93)){_0x3e4473[_0x8405('0x6c')][_0x8405('0x5b')]({'filename':_0x8405('0x69')+_0x152757[_0x8405('0x6a')](),'createdAt':moment()[_0x8405('0x9')](_0x8405('0x6d')),'mixmonitorid':_0x4b8443['mixmonitorid'],'status':_0x8405('0x6e')});}else{_0x5b8a93[_0x8405('0x6f')]=_0x4b8443[_0x8405('0x6f')];_0x5b8a93[_0x8405('0x70')]='rec';}_0x11a2d5({'code':0xc8,'message':[_0x2eced5[_0x8405('0x63')],_0x8405('0x71'),_0x4b8443[_0x8405('0x6f')]][_0x8405('0x12')]('\x20'),'mixmonitorid':_0x4b8443[_0x8405('0x6f')]});})[_0x8405('0x1a')](function(_0x4a2381){_0x600035(_0x3c516f[_0x8405('0x1b')](0x1f5,[_0x2eced5[_0x8405('0x63')],_0x4a2381[_0x8405('0x19')]['toLowerCase']()][_0x8405('0x12')]('\x20')));});}else{return _0x600035(_0x3c516f[_0x8405('0x1b')](0x1f5,_0x8405('0x72')));}});},'VoiceChannelStopMixMonitor':function(_0x2b8334){var _0x9b3747=this;return new Promise(function(_0x3bbdc5,_0x283dcb){if(ami[_0x8405('0x1c')]()==![]){return _0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f4,[config[_0x8405('0x10')]['ip'],config['asterisk'][_0x8405('0x1d')],'ami\x20disconnected'][_0x8405('0x12')]('\x20')));}var _0x4f96f8=schema(properties[_0x8405('0x61')])[_0x8405('0x3')](_0x2b8334);if(_0x4f96f8[_0x8405('0x5c')]>0x0){return _0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x4f96f8,'message')[_0x8405('0x12')](',\x20')));}var _0x48f7a7=_['find'](_0x4948b2[_0x8405('0x60')],{'uniqueid':_0x2b8334['uniqueid']});if(_0x48f7a7){return Promise[_0x8405('0x73')]()[_0x8405('0x18')](function(){if(_0x48f7a7[_0x8405('0x64')]){return ami['Action']({'action':_0x8405('0x74'),'channel':_0x48f7a7[_0x8405('0x64')],'mixmonitorid':_0x2b8334[_0x8405('0x6f')]})[_0x8405('0x1a')](function(){});}})[_0x8405('0x18')](function(){if(_0x48f7a7[_0x8405('0x75')]){return ami['Action']({'action':_0x8405('0x74'),'channel':_0x48f7a7[_0x8405('0x75')],'mixmonitorid':_0x2b8334[_0x8405('0x6f')]})['catch'](function(){});}})['then'](function(){var _0x230e33=_[_0x8405('0x68')](_0x48f7a7[_0x8405('0x6c')],{'mixmonitorid':_0x2b8334[_0x8405('0x6f')]});if(_0x230e33){_0x230e33[_0x8405('0x70')]='stop';}})['then'](function(){var _0x5cd043=util[_0x8405('0x9')](_0x8405('0x65'),_0x2b8334[_0x8405('0x66')]||_0x2b8334[_0x8405('0x63')],_0x2b8334[_0x8405('0x9')]||_0x8405('0x76'));var _0x1a4861=_[_0x8405('0x68')](_0x48f7a7[_0x8405('0x6c')],{'filename':_0x8405('0x69')+_0x5cd043[_0x8405('0x6a')]()});if(_0x1a4861){_0x1a4861[_0x8405('0x70')]='stop';}})[_0x8405('0x18')](function(){_0x3bbdc5({'code':0xc8,'message':[_0x2b8334[_0x8405('0x63')],'StopMixMonitor\x20Success'][_0x8405('0x12')]('\x20')});})[_0x8405('0x1a')](function(_0x2c0413){_0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f5,[_0x2b8334[_0x8405('0x63')],_0x2c0413[_0x8405('0x19')][_0x8405('0x6a')]()][_0x8405('0x12')]('\x20')));});}else{return _0x283dcb(_0x9b3747[_0x8405('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x1db269){var _0x4732dc=_[_0x8405('0x5f')](_0x4948b2['queueChannels']);_0x1db269({'count':_0x4732dc[_0x8405('0x5c')],'rows':_0x4732dc});});},'VoiceQueuesChannel':function(_0x320b03){var _0x20e9ac=this;return new Promise(function(_0x211e38,_0x27f1ef){var _0x4d9f1f=schema(properties[_0x8405('0x77')])[_0x8405('0x3')](_0x320b03);if(_0x4d9f1f[_0x8405('0x5c')]>0x0){return _0x27f1ef(_0x20e9ac[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x4d9f1f,_0x8405('0x19'))[_0x8405('0x12')](',\x20')));}var _0x83a45b=_[_0x8405('0x68')](_0x4948b2['queueChannels'],{'uniqueid':_0x320b03[_0x8405('0x63')]});if(_0x83a45b){_0x211e38(_0x83a45b);}else{return _0x27f1ef(_0x20e9ac['error'](0x1f5,_0x8405('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x8390dc){var _0x52592c=this;return new Promise(function(_0x4f203d,_0x5f4bb6){if(ami['isConnected']()==![]){return _0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}var _0x372ca9=schema(properties[_0x8405('0x78')])[_0x8405('0x3')](_0x8390dc);if(_0x372ca9['length']>0x0){return _0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x372ca9,'message')['join'](',\x20')));}var _0x48b045=_['find'](_0x4948b2['queueChannels'],{'uniqueid':_0x8390dc['uniqueid']});if(_0x48b045&&_0x48b045[_0x8405('0x64')]){return ami[_0x8405('0x17')]({'action':_0x8405('0x79'),'channel':_0x48b045[_0x8405('0x64')]})[_0x8405('0x18')](function(_0x5a6844){_0x4f203d({'code':0xc8,'message':[_0x8390dc[_0x8405('0x63')],_0x5a6844[_0x8405('0x19')][_0x8405('0x6a')]()][_0x8405('0x12')]('\x20')});})[_0x8405('0x1a')](function(_0x5c1bdb){_0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f5,[_0x8390dc[_0x8405('0x63')],_0x5c1bdb[_0x8405('0x19')][_0x8405('0x6a')]()][_0x8405('0x12')]('\x20')));});}else{return _0x5f4bb6(_0x52592c[_0x8405('0x1b')](0x1f5,_0x8405('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x1b2737){var _0x575115=this;return new Promise(function(_0x42049d,_0x132a09){if(ami[_0x8405('0x1c')]()==![]){return _0x132a09(_0x575115[_0x8405('0x1b')](0x1f4,[config[_0x8405('0x10')]['ip'],config[_0x8405('0x10')][_0x8405('0x1d')],_0x8405('0x11')][_0x8405('0x12')]('\x20')));}var _0x2be89b=schema(properties[_0x8405('0x7a')])[_0x8405('0x3')](_0x1b2737);if(_0x2be89b[_0x8405('0x5c')]>0x0){return _0x132a09(_0x575115[_0x8405('0x1b')](0x1f4,_[_0x8405('0x62')](_0x2be89b,_0x8405('0x19'))['join'](',\x20')));}var _0x2562c8=_[_0x8405('0x68')](_0x4948b2[_0x8405('0x7b')],{'uniqueid':_0x1b2737['uniqueid']});if(_0x2562c8&&_0x2562c8[_0x8405('0x64')]){return ami[_0x8405('0x17')]({'action':_0x8405('0x7c'),'channel':_0x2562c8[_0x8405('0x64')],'exten':_0x1b2737[_0x8405('0x7d')],'context':_0x1b2737[_0x8405('0x7e')]||_0x2562c8[_0x8405('0x7e')],'priority':0x1})[_0x8405('0x18')](function(_0x352112){_0x42049d({'code':0xc8,'message':[_0x1b2737[_0x8405('0x63')],_0x352112['message']['toLowerCase']()][_0x8405('0x12')]('\x20')});})[_0x8405('0x1a')](function(_0x5e6b24){_0x132a09(_0x575115[_0x8405('0x1b')](0x1f5,[_0x1b2737[_0x8405('0x63')],_0x5e6b24[_0x8405('0x19')]['toLowerCase']()]['join']('\x20')));});}else{return _0x132a09(_0x575115['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x151b4f){return new Promise(function(_0x337233){var _0x37a642=_['values'](_0x4948b2[_0x8405('0xf')]);if(_0x151b4f&&_0x151b4f['id']){var _0x35607a=_[_0x8405('0x68')](_0x37a642,function(_0x73c924){return _0x73c924['id']===_0x151b4f['id'];});_0x337233(_0x35607a);}else{_0x337233({'count':_0x37a642['length'],'rows':_0x37a642});}});},'Telephones':function(){return new Promise(function(_0x4bc83b){var _0x31b673=_[_0x8405('0x5f')](_0x4948b2['telephones']);_0x4bc83b({'count':_0x31b673[_0x8405('0x5c')],'rows':_0x31b673});});},'Trunks':function(){return new Promise(function(_0x1bbb21){var _0xc1f4ec=_['values'](_0x4948b2[_0x8405('0x7f')]);_0x1bbb21({'count':_0xc1f4ec[_0x8405('0x5c')],'rows':_0xc1f4ec});});},'OutboundChannels':function(){return new Promise(function(_0x23022d){var _0x360e0a=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x80')]);_0x23022d({'count':_0x360e0a[_0x8405('0x5c')],'rows':_0x360e0a});});},'Outbound':function(){return new Promise(function(_0x2ca863){_0x2ca863(_0x4948b2[_0x8405('0x30')]);});},'Campaigns':function(){return new Promise(function(_0x9aa5a6){var _0x488a7f=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x81')]);_0x9aa5a6({'count':_0x488a7f[_0x8405('0x5c')],'rows':_0x488a7f});});},'VoiceQueuesPreview':function(_0x4ea2bf){var _0x57adfd=this;return new Promise(function(_0x572981,_0x13c442){_0x5ebf0e[_0x8405('0x82')](_0x4ea2bf['id'])[_0x8405('0x18')](function(_0x279bd1){_0x572981({'code':0xc8,'message':_0x279bd1['message']});})[_0x8405('0x1a')](function(_0x1a3cc6){_0x13c442(_0x57adfd[_0x8405('0x1b')](0x1f4,_0x1a3cc6[_0x8405('0x19')]));});});},'EventManager':function(_0x9d6230){var _0x1f3e97=this;return new Promise(function(_0xbd79a0,_0x40da84){if(!_0x9d6230[_0x8405('0x83')]){return _0x40da84(_0x1f3e97[_0x8405('0x1b')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x8405('0x84')+_0x9d6230[_0x8405('0x83')],_0x9d6230[_0x8405('0x19')]);_0xbd79a0({'code':0xc8,'message':_0x9d6230});});},'FaxAccounts':function(){return new Promise(function(_0x3d855d){var _0x689ca1=_[_0x8405('0x5f')](_0x4948b2[_0x8405('0x85')]);_0x3d855d({'count':_0x689ca1[_0x8405('0x5c')],'rows':_0x689ca1});});},'SendFax':function(_0x2300d3){var _0x4c2153=this;return new Promise(function(_0x264c5d,_0x1c1d17){_0x57fb07[_0x8405('0x86')](_0x2300d3)['then'](function(_0x36cf2b){_0x264c5d({'code':0xc8,'message':_0x36cf2b[_0x8405('0x19')]});})[_0x8405('0x1a')](function(_0x4cc691){_0x1c1d17(_0x4c2153['error'](0x1f4,_0x4cc691['message']));});});},'CheckAfterSend':function(_0x6d0055){var _0x5c1a48=this;return new Promise(function(_0x57b076,_0x66c9f9){_0x57fb07[_0x8405('0x87')](_0x6d0055)['then'](function(_0x2dc00f){_0x57b076({'code':0xc8,'message':_0x2dc00f[_0x8405('0x19')]});})[_0x8405('0x1a')](function(_0x273e11){_0x66c9f9(_0x5c1a48[_0x8405('0x1b')](0x1f4,_0x273e11['message']));});});}};var _0x49ecf0=jayson[_0x8405('0x88')](_0x3d9bf6)['http']();_0x49ecf0['on'](_0x8405('0x1b'),function(_0x19dca3){return _0x257d43(_0x19dca3);});_0x49ecf0[_0x8405('0x8')](0x232a,_0x8405('0x89'),function(){console['log'](_0x8405('0x8a'),0x232a);return _0x1db7ea(_0x8405('0x8b')+0x232a);});});}; \ No newline at end of file +var _0x593e=['predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','undefined','values','channels','ami\x20disconnected','voicechannel','map','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','exten','context','telephones','outboundChannels','outbound','campaigns','run','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','module','action','Reload','Action','then','catch','message','Command','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses'];(function(_0x2263d6,_0x23ef72){var _0x392795=function(_0x555ceb){while(--_0x555ceb){_0x2263d6['push'](_0x2263d6['shift']());}};_0x392795(++_0x23ef72);}(_0x593e,0xcb));var _0xe593=function(_0x1f4a45,_0x4d8bf9){_0x1f4a45=_0x1f4a45-0x0;var _0x519e4d=_0x593e[_0x1f4a45];return _0x519e4d;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var jayson=require(_0xe593('0x2'));var schema=require(_0xe593('0x3'));var moment=require(_0xe593('0x4'));var config=require(_0xe593('0x5'));var properties=require(_0xe593('0x6'));var ami=require(_0xe593('0x7'));exports['listen']=function(_0x8a87e8,_0x2475f5,_0x404e3a){return new Promise(function(_0x1e50d3,_0x3b7082){var _0x14cff3={'QueuePause':function(_0x1cda29){return new Promise(function(_0x307dad){var _0x169c08=util[_0xe593('0x8')]('%s/%s',_0xe593('0x9'),_0x1cda29[_0xe593('0xa')]);if(_0x8a87e8[_0xe593('0xb')]&&_0x8a87e8['timers'][_0x169c08]&&_0x8a87e8['timers'][_0x169c08][_0xe593('0xc')]){_0x8a87e8[_0xe593('0xb')][_0x169c08][_0xe593('0xd')]();}if(_0x8a87e8['agents'][_0x169c08]){_0x8a87e8[_0xe593('0xe')][_0x169c08][_0xe593('0xf')]({'statePause':_0x1cda29[_0xe593('0x10')]?!![]:![]});}_0x307dad({'code':0xc8,'message':_0xe593('0x11')});});},'Reload':function(_0x8ee313){var _0x31dad0=this;return new Promise(function(_0x24c9fd,_0xa4d5e9){if(ami[_0xe593('0x12')]()==![]){return _0xa4d5e9(_0x31dad0[_0xe593('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xe593('0x14')][_0xe593('0x15')],'ami\x20disconnected'][_0xe593('0x16')]('\x20')));}_0x8ee313=_[_0xe593('0x17')](_0x8ee313,_['keys'](properties[_0xe593('0x18')]));_0x8ee313[_0xe593('0x19')]=_0xe593('0x1a');return ami[_0xe593('0x1b')](_0x8ee313)[_0xe593('0x1c')](function(_0xb427f0){_0x24c9fd({'code':0xc8,'message':_0xb427f0['message']});})[_0xe593('0x1d')](function(_0x470d07){_0xa4d5e9(_0x31dad0['error'](0x1f5,_0x470d07[_0xe593('0x1e')]));});});},'Command':function(_0x28b5ed){var _0x56b4ff=this;return new Promise(function(_0x1c94aa,_0x3dba1b){if(ami[_0xe593('0x12')]()==![]){return _0x3dba1b(_0x56b4ff[_0xe593('0x13')](0x1f4,[config[_0xe593('0x14')]['ip'],config[_0xe593('0x14')][_0xe593('0x15')],'ami\x20disconnected']['join']('\x20')));}_0x28b5ed=_[_0xe593('0x17')](_0x28b5ed,'command');_0x28b5ed['action']=_0xe593('0x1f');return ami[_0xe593('0x1b')](_0x28b5ed)['then'](function(_0xf57cc4){_0x1c94aa({'code':0xc8,'message':_0xf57cc4['content']});})[_0xe593('0x1d')](function(_0x2c191f){_0x3dba1b(_0x56b4ff[_0xe593('0x13')](0x1f5,_0x2c191f[_0xe593('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0x39103d){var _0x1d57ca=[];for(var _0x20a098 in _0x8a87e8[_0xe593('0x20')]){if(_0x8a87e8['voiceQueues'][_0xe593('0x21')](_0x20a098)){var _0x347d7d=_0x8a87e8['voiceQueues'][_0x20a098];var _0x59bd4c={'id':_0x347d7d['id'],'name':_0x347d7d[_0xe593('0xa')],'strategy':_0x347d7d[_0xe593('0x22')],'answered':_0x347d7d[_0xe593('0x23')],'available':_0x347d7d[_0xe593('0x24')],'loggedIn':_0x347d7d[_0xe593('0x25')],'pTalking':_0x347d7d[_0xe593('0x26')],'sumBillable':_0x347d7d['sumBillable'],'sumDuration':_0x347d7d[_0xe593('0x27')],'sumHoldTime':_0x347d7d['sumHoldTime']||0x0,'talking':_0x347d7d[_0xe593('0x28')],'total':_0x347d7d[_0xe593('0x29')],'type':_0x347d7d['type'],'unmanaged':_0x347d7d[_0xe593('0x2a')],'abandoned':_0x347d7d['abandoned'],'waiting':_0x347d7d[_0xe593('0x2b')],'loggedInDb':_0x347d7d[_0xe593('0x2c')]};if(_0x347d7d[_0xe593('0x2d')]==='outbound'){_0x59bd4c[_0xe593('0x2e')]=_0x347d7d[_0xe593('0x2e')];_0x59bd4c[_0xe593('0x2f')]=_0x347d7d[_0xe593('0x2f')];_0x59bd4c[_0xe593('0x30')]=_0x347d7d[_0xe593('0x30')];_0x59bd4c[_0xe593('0x31')]=_0x347d7d['dialOriginateCallerIdNumber'];_0x59bd4c[_0xe593('0x32')]=_0x347d7d[_0xe593('0x32')];_0x59bd4c['dialPrefix']=_0x347d7d[_0xe593('0x33')];_0x59bd4c['temp']=_0x347d7d[_0xe593('0x34')];_0x59bd4c[_0xe593('0x35')]=_0x347d7d[_0xe593('0x35')];_0x59bd4c[_0xe593('0x36')]=_0x347d7d[_0xe593('0x36')];_0x59bd4c[_0xe593('0x37')]=_0x347d7d[_0xe593('0x37')];_0x59bd4c[_0xe593('0x38')]=_0x347d7d[_0xe593('0x38')];_0x59bd4c[_0xe593('0x39')]=_0x347d7d['outboundCongestionCallsDay'];_0x59bd4c[_0xe593('0x3a')]=_0x347d7d[_0xe593('0x3a')];_0x59bd4c[_0xe593('0x3b')]=_0x347d7d['outboundDropCallsDayCallersExit'];_0x59bd4c['outboundDropCallsDayTimeout']=_0x347d7d[_0xe593('0x3c')];_0x59bd4c['outboundNoAnswerCallsDay']=_0x347d7d[_0xe593('0x3d')];_0x59bd4c[_0xe593('0x3e')]=_0x347d7d[_0xe593('0x3e')];_0x59bd4c[_0xe593('0x3f')]=_0x347d7d[_0xe593('0x3f')];_0x59bd4c[_0xe593('0x40')]=_0x347d7d[_0xe593('0x40')];_0x59bd4c['outboundRejectCallsDay']=_0x347d7d['outboundRejectCallsDay'];_0x59bd4c[_0xe593('0x41')]=_0x347d7d['outboundUnknownCallsDay'];_0x59bd4c[_0xe593('0x42')]=_0x347d7d['predictiveIntervalAnsweredCalls'];_0x59bd4c[_0xe593('0x43')]=_0x347d7d['predictiveIntervalAvgHoldtime'];_0x59bd4c['predictiveIntervalAvgTalktime']=_0x347d7d[_0xe593('0x44')];_0x59bd4c[_0xe593('0x45')]=_0x347d7d[_0xe593('0x45')];_0x59bd4c['predictiveIntervalDroppedCallsTimeout']=_0x347d7d['predictiveIntervalDroppedCallsTimeout'];_0x59bd4c['predictiveIntervalErlangCalls']=_0x347d7d[_0xe593('0x46')];_0x59bd4c['predictiveIntervalErlangCallsDroppedCalls']=_0x347d7d[_0xe593('0x47')];_0x59bd4c[_0xe593('0x48')]=_0x347d7d[_0xe593('0x48')];_0x59bd4c[_0xe593('0x49')]=_0x347d7d['predictiveIntervalMultiplicativeFactor'];_0x59bd4c[_0xe593('0x4a')]=_0x347d7d['predictiveIntervalPauses'];_0x59bd4c[_0xe593('0x4b')]=_0x347d7d['predictiveIntervalAvailable'];_0x59bd4c['predictiveIntervalTotalCalls']=_0x347d7d['predictiveIntervalTotalCalls'];_0x59bd4c[_0xe593('0x1e')]=_0x347d7d['message'];_0x59bd4c[_0xe593('0x4c')]=_0x347d7d[_0xe593('0x4c')];_0x59bd4c[_0xe593('0x4d')]=_0x347d7d['erlangCalls'];_0x59bd4c[_0xe593('0x4e')]=_0x347d7d[_0xe593('0x4e')];_0x59bd4c[_0xe593('0x4f')]=_0x347d7d[_0xe593('0x4f')];_0x59bd4c[_0xe593('0x50')]=_0x347d7d[_0xe593('0x50')];_0x59bd4c[_0xe593('0x51')]=_0x347d7d[_0xe593('0x51')];_0x59bd4c['startProgressive']=_0x347d7d[_0xe593('0x52')];}if(_0x347d7d[_0xe593('0x53')]){_0x59bd4c[_0xe593('0x53')]={'id':_0x347d7d[_0xe593('0x53')]['id'],'name':_0x347d7d[_0xe593('0x53')]['name'],'active':_0x347d7d['Trunk'][_0xe593('0x54')],'callerid':_0x347d7d[_0xe593('0x53')][_0xe593('0x55')]};}if(_0x347d7d['Interval']){_0x59bd4c[_0xe593('0x56')]={'id':_0x347d7d[_0xe593('0x56')]['id'],'name':_0x347d7d['Interval']['name']};}_0x1d57ca[_0xe593('0x57')](_0x59bd4c);}}_0x39103d({'count':_0x1d57ca[_0xe593('0x58')],'rows':_0x1d57ca});});},'UpdateVoiceQueue':function(_0x3d4feb){return new Promise(function(_0x4f5ee9,_0x2e88bf){var _0x1ed12d=_[_0xe593('0x59')](_0x8a87e8[_0xe593('0x20')],{'id':parseInt(_0x3d4feb['id'])});var _0x592586=_['omit'](_0x3d4feb,['id']);if(_0x1ed12d){for(var _0x4a7434 in _0x592586){if(typeof _0x592586[_0x4a7434]!=='undefined'&&typeof _0x1ed12d[_0x4a7434]!==_0xe593('0x5a')){_0x1ed12d[_0x4a7434]=_0x592586[_0x4a7434];}}_0x4f5ee9(_0x1ed12d);}else{_0x2e88bf();}});},'VoiceChannels':function(){return new Promise(function(_0x57264b){var _0x248944=_[_0xe593('0x5b')](_0x8a87e8[_0xe593('0x5c')]);_0x57264b({'count':_0x248944[_0xe593('0x58')],'rows':_0x248944});});},'VoiceChannelMixMonitor':function(_0xe96f5e){var _0x3f901a=this;return new Promise(function(_0x7b6f77,_0x297c3e){if(ami['isConnected']()==![]){return _0x297c3e(_0x3f901a[_0xe593('0x13')](0x1f4,[config[_0xe593('0x14')]['ip'],config[_0xe593('0x14')]['username'],_0xe593('0x5d')]['join']('\x20')));}var _0x39ec9e=schema(properties[_0xe593('0x5e')])[_0xe593('0x3')](_0xe96f5e);if(_0x39ec9e['length']>0x0){return _0x297c3e(_0x3f901a['error'](0x1f4,_[_0xe593('0x5f')](_0x39ec9e,_0xe593('0x1e'))['join'](',\x20')));}var _0x4f6e9c=_['find'](_0x8a87e8['channels'],{'uniqueid':_0xe96f5e['uniqueid']});if(_0x4f6e9c&&_0x4f6e9c[_0xe593('0x60')]){var _0x1e48d8=util[_0xe593('0x8')](_0xe593('0x61'),_0xe96f5e[_0xe593('0x62')]||_0xe96f5e[_0xe593('0x63')],_0xe96f5e[_0xe593('0x8')]||_0xe593('0x64'));return ami[_0xe593('0x1b')]({'action':_0xe593('0x65'),'channel':_0x4f6e9c[_0xe593('0x60')],'file':_0x1e48d8,'options':_0xe593('0x66')})[_0xe593('0x1c')](function(_0x171350){var _0xa25aa8=_[_0xe593('0x59')](_0x4f6e9c['monitors'],{'filename':_0xe593('0x67')+_0x1e48d8[_0xe593('0x68')]()});if(_[_0xe593('0x69')](_0xa25aa8)){_0x4f6e9c[_0xe593('0x6a')][_0xe593('0x57')]({'filename':_0xe593('0x67')+_0x1e48d8[_0xe593('0x68')](),'createdAt':moment()[_0xe593('0x8')](_0xe593('0x6b')),'mixmonitorid':_0x171350[_0xe593('0x6c')],'status':_0xe593('0x6d')});}else{_0xa25aa8[_0xe593('0x6c')]=_0x171350[_0xe593('0x6c')];_0xa25aa8[_0xe593('0x6e')]=_0xe593('0x6d');}_0x7b6f77({'code':0xc8,'message':[_0xe96f5e['uniqueid'],_0xe593('0x6f'),_0x171350[_0xe593('0x6c')]][_0xe593('0x16')]('\x20'),'mixmonitorid':_0x171350[_0xe593('0x6c')]});})[_0xe593('0x1d')](function(_0x5e1972){_0x297c3e(_0x3f901a['error'](0x1f5,[_0xe96f5e[_0xe593('0x63')],_0x5e1972[_0xe593('0x1e')][_0xe593('0x68')]()][_0xe593('0x16')]('\x20')));});}else{return _0x297c3e(_0x3f901a[_0xe593('0x13')](0x1f5,_0xe593('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x9d4172){var _0x518b6f=this;return new Promise(function(_0x54cc48,_0x546aa7){if(ami[_0xe593('0x12')]()==![]){return _0x546aa7(_0x518b6f['error'](0x1f4,[config[_0xe593('0x14')]['ip'],config[_0xe593('0x14')][_0xe593('0x15')],_0xe593('0x5d')][_0xe593('0x16')]('\x20')));}var _0x2a38fc=schema(properties[_0xe593('0x5e')])[_0xe593('0x3')](_0x9d4172);if(_0x2a38fc[_0xe593('0x58')]>0x0){return _0x546aa7(_0x518b6f[_0xe593('0x13')](0x1f4,_['map'](_0x2a38fc,_0xe593('0x1e'))[_0xe593('0x16')](',\x20')));}var _0x390b95=_[_0xe593('0x59')](_0x8a87e8[_0xe593('0x5c')],{'uniqueid':_0x9d4172[_0xe593('0x63')]});if(_0x390b95){return Promise[_0xe593('0x71')]()['then'](function(){if(_0x390b95[_0xe593('0x60')]){return ami[_0xe593('0x1b')]({'action':_0xe593('0x72'),'channel':_0x390b95[_0xe593('0x60')],'mixmonitorid':_0x9d4172['mixmonitorid']})[_0xe593('0x1d')](function(){});}})[_0xe593('0x1c')](function(){if(_0x390b95[_0xe593('0x73')]){return ami[_0xe593('0x1b')]({'action':_0xe593('0x72'),'channel':_0x390b95['destinationchannel'],'mixmonitorid':_0x9d4172[_0xe593('0x6c')]})[_0xe593('0x1d')](function(){});}})[_0xe593('0x1c')](function(){var _0x477c08=_[_0xe593('0x59')](_0x390b95[_0xe593('0x6a')],{'mixmonitorid':_0x9d4172[_0xe593('0x6c')]});if(_0x477c08){_0x477c08[_0xe593('0x6e')]='stop';}})[_0xe593('0x1c')](function(){var _0x16f9fc=util[_0xe593('0x8')](_0xe593('0x61'),_0x9d4172[_0xe593('0x62')]||_0x9d4172[_0xe593('0x63')],_0x9d4172[_0xe593('0x8')]||_0xe593('0x64'));var _0x3ffdc4=_[_0xe593('0x59')](_0x390b95['monitors'],{'filename':_0xe593('0x67')+_0x16f9fc[_0xe593('0x68')]()});if(_0x3ffdc4){_0x3ffdc4[_0xe593('0x6e')]='stop';}})[_0xe593('0x1c')](function(){_0x54cc48({'code':0xc8,'message':[_0x9d4172[_0xe593('0x63')],_0xe593('0x74')][_0xe593('0x16')]('\x20')});})[_0xe593('0x1d')](function(_0x5e263c){_0x546aa7(_0x518b6f[_0xe593('0x13')](0x1f5,[_0x9d4172[_0xe593('0x63')],_0x5e263c['message'][_0xe593('0x68')]()][_0xe593('0x16')]('\x20')));});}else{return _0x546aa7(_0x518b6f[_0xe593('0x13')](0x1f5,_0xe593('0x70')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x5b1525){var _0x15f47c=_[_0xe593('0x5b')](_0x8a87e8[_0xe593('0x75')]);_0x5b1525({'count':_0x15f47c['length'],'rows':_0x15f47c});});},'VoiceQueuesChannel':function(_0x43dcb0){var _0x43fe0b=this;return new Promise(function(_0x2ec8e7,_0x5bbf3d){var _0xb6846a=schema(properties[_0xe593('0x76')])[_0xe593('0x3')](_0x43dcb0);if(_0xb6846a[_0xe593('0x58')]>0x0){return _0x5bbf3d(_0x43fe0b[_0xe593('0x13')](0x1f4,_['map'](_0xb6846a,_0xe593('0x1e'))[_0xe593('0x16')](',\x20')));}var _0x2ceda4=_[_0xe593('0x59')](_0x8a87e8[_0xe593('0x75')],{'uniqueid':_0x43dcb0[_0xe593('0x63')]});if(_0x2ceda4){_0x2ec8e7(_0x2ceda4);}else{return _0x5bbf3d(_0x43fe0b[_0xe593('0x13')](0x1f5,_0xe593('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x3e6d23){var _0xb7d821=this;return new Promise(function(_0x44d868,_0x43f946){if(ami[_0xe593('0x12')]()==![]){return _0x43f946(_0xb7d821[_0xe593('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xe593('0x14')][_0xe593('0x15')],_0xe593('0x5d')][_0xe593('0x16')]('\x20')));}var _0xbe6e56=schema(properties[_0xe593('0x77')])[_0xe593('0x3')](_0x3e6d23);if(_0xbe6e56[_0xe593('0x58')]>0x0){return _0x43f946(_0xb7d821['error'](0x1f4,_['map'](_0xbe6e56,'message')[_0xe593('0x16')](',\x20')));}var _0x993a93=_[_0xe593('0x59')](_0x8a87e8['queueChannels'],{'uniqueid':_0x3e6d23['uniqueid']});if(_0x993a93&&_0x993a93[_0xe593('0x60')]){return ami['Action']({'action':_0xe593('0x78'),'channel':_0x993a93[_0xe593('0x60')]})[_0xe593('0x1c')](function(_0x58c6ef){_0x44d868({'code':0xc8,'message':[_0x3e6d23[_0xe593('0x63')],_0x58c6ef[_0xe593('0x1e')][_0xe593('0x68')]()][_0xe593('0x16')]('\x20')});})[_0xe593('0x1d')](function(_0x343633){_0x43f946(_0xb7d821[_0xe593('0x13')](0x1f5,[_0x3e6d23['uniqueid'],_0x343633[_0xe593('0x1e')][_0xe593('0x68')]()]['join']('\x20')));});}else{return _0x43f946(_0xb7d821[_0xe593('0x13')](0x1f5,_0xe593('0x70')));}});},'VoiceQueuesChannelRedirect':function(_0x3036a2){var _0x57e76d=this;return new Promise(function(_0x2e2f9b,_0x11eb00){if(ami[_0xe593('0x12')]()==![]){return _0x11eb00(_0x57e76d[_0xe593('0x13')](0x1f4,[config[_0xe593('0x14')]['ip'],config[_0xe593('0x14')]['username'],'ami\x20disconnected'][_0xe593('0x16')]('\x20')));}var _0x48b481=schema(properties['voicequeuechannelredirect'])['validate'](_0x3036a2);if(_0x48b481[_0xe593('0x58')]>0x0){return _0x11eb00(_0x57e76d[_0xe593('0x13')](0x1f4,_[_0xe593('0x5f')](_0x48b481,_0xe593('0x1e'))[_0xe593('0x16')](',\x20')));}var _0x56c586=_['find'](_0x8a87e8[_0xe593('0x75')],{'uniqueid':_0x3036a2[_0xe593('0x63')]});if(_0x56c586&&_0x56c586[_0xe593('0x60')]){return ami[_0xe593('0x1b')]({'action':'Redirect','channel':_0x56c586[_0xe593('0x60')],'exten':_0x3036a2[_0xe593('0x79')],'context':_0x3036a2[_0xe593('0x7a')]||_0x56c586['context'],'priority':0x1})[_0xe593('0x1c')](function(_0x454479){_0x2e2f9b({'code':0xc8,'message':[_0x3036a2['uniqueid'],_0x454479[_0xe593('0x1e')][_0xe593('0x68')]()]['join']('\x20')});})['catch'](function(_0x54d96b){_0x11eb00(_0x57e76d['error'](0x1f5,[_0x3036a2['uniqueid'],_0x54d96b['message'][_0xe593('0x68')]()]['join']('\x20')));});}else{return _0x11eb00(_0x57e76d[_0xe593('0x13')](0x1f5,_0xe593('0x70')));}});},'Agents':function(_0x41fa20){return new Promise(function(_0x57683e){var _0x47ac27=_[_0xe593('0x5b')](_0x8a87e8[_0xe593('0xe')]);if(_0x41fa20&&_0x41fa20['id']){var _0x3db9f1=_[_0xe593('0x59')](_0x47ac27,function(_0x488a5e){return _0x488a5e['id']===_0x41fa20['id'];});_0x57683e(_0x3db9f1);}else{_0x57683e({'count':_0x47ac27['length'],'rows':_0x47ac27});}});},'Telephones':function(){return new Promise(function(_0x12f9c4){var _0xf272d6=_['values'](_0x8a87e8[_0xe593('0x7b')]);_0x12f9c4({'count':_0xf272d6[_0xe593('0x58')],'rows':_0xf272d6});});},'Trunks':function(){return new Promise(function(_0x19012a){var _0xfbf7c5=_[_0xe593('0x5b')](_0x8a87e8['trunks']);_0x19012a({'count':_0xfbf7c5[_0xe593('0x58')],'rows':_0xfbf7c5});});},'OutboundChannels':function(){return new Promise(function(_0x483d90){var _0x27bf6c=_['values'](_0x8a87e8[_0xe593('0x7c')]);_0x483d90({'count':_0x27bf6c['length'],'rows':_0x27bf6c});});},'Outbound':function(){return new Promise(function(_0x50ab4d){_0x50ab4d(_0x8a87e8[_0xe593('0x7d')]);});},'Campaigns':function(){return new Promise(function(_0x2983f1){var _0x30c283=_['values'](_0x8a87e8[_0xe593('0x7e')]);_0x2983f1({'count':_0x30c283[_0xe593('0x58')],'rows':_0x30c283});});},'VoiceQueuesPreview':function(_0x1462f8){var _0x4a577a=this;return new Promise(function(_0x1deba3,_0x598805){_0x2475f5[_0xe593('0x7f')](_0x1462f8['id'])[_0xe593('0x1c')](function(_0x5ba386){_0x1deba3({'code':0xc8,'message':_0x5ba386[_0xe593('0x1e')]});})[_0xe593('0x1d')](function(_0x2eb96a){_0x598805(_0x4a577a['error'](0x1f4,_0x2eb96a['message']));});});},'EventManager':function(_0x31d2e6){var _0x5affa7=this;return new Promise(function(_0x177f4d,_0x359b0e){if(!_0x31d2e6['event']){return _0x359b0e(_0x5affa7['error'](0x1f4,_0xe593('0x80')));}ami[_0xe593('0x81')](_0xe593('0x82')+_0x31d2e6['event'],_0x31d2e6[_0xe593('0x1e')]);_0x177f4d({'code':0xc8,'message':_0x31d2e6});});},'FaxAccounts':function(){return new Promise(function(_0xd79cda){var _0x42369d=_[_0xe593('0x5b')](_0x8a87e8[_0xe593('0x83')]);_0xd79cda({'count':_0x42369d[_0xe593('0x58')],'rows':_0x42369d});});},'SendFax':function(_0x562291){var _0x40ef8f=this;return new Promise(function(_0x15e822,_0x29d7c5){_0x404e3a[_0xe593('0x84')](_0x562291)[_0xe593('0x1c')](function(_0x3f8cbf){_0x15e822({'code':0xc8,'message':_0x3f8cbf[_0xe593('0x1e')]});})['catch'](function(_0xa7de6){_0x29d7c5(_0x40ef8f[_0xe593('0x13')](0x1f4,_0xa7de6[_0xe593('0x1e')]));});});},'CheckAfterSend':function(_0x4ac1d7){var _0x5241ab=this;return new Promise(function(_0x49c44a,_0x102a9e){_0x404e3a[_0xe593('0x85')](_0x4ac1d7)['then'](function(_0x28c91a){_0x49c44a({'code':0xc8,'message':_0x28c91a[_0xe593('0x1e')]});})['catch'](function(_0x3a8e3d){_0x102a9e(_0x5241ab['error'](0x1f4,_0x3a8e3d['message']));});});}};var _0x28470c=jayson[_0xe593('0x86')](_0x14cff3)[_0xe593('0x87')]();_0x28470c['on'](_0xe593('0x13'),function(_0x3c517b){return _0x3b7082(_0x3c517b);});_0x28470c['listen'](0x232a,_0xe593('0x88'),function(){console[_0xe593('0x89')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1e50d3(_0xe593('0x8a')+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 b71df2c..0a4645b 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 _0xd23a=['socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','lastName','mobile','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','action','toLowerCase','merge','length','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost'];(function(_0x50336b,_0x5e54b4){var _0x1ea65b=function(_0xe99ef0){while(--_0xe99ef0){_0x50336b['push'](_0x50336b['shift']());}};_0x1ea65b(++_0x5e54b4);}(_0xd23a,0xe7));var _0xad23=function(_0x439041,_0x17225c){_0x439041=_0x439041-0x0;var _0x330200=_0xd23a[_0x439041];return _0x330200;};'use strict';var _=require(_0xad23('0x0'));var BPromise=require('bluebird');var Redis=require(_0xad23('0x1'));var util=require(_0xad23('0x2'));var config=require(_0xad23('0x3'));var logger=require(_0xad23('0x4'))(_0xad23('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xad23('0x6')]=_[_0xad23('0x7')](config['redis'],{'host':_0xad23('0x8'),'port':0x18eb});var io=require(_0xad23('0x9'))(new Redis(config[_0xad23('0x6')]));function emit(_0x17b224,_0x5248b9,_0x40fccc,_0x1b421e,_0x54891a){logger[_0xad23('0xa')](_0xad23('0xb'),_0x17b224,_0x5248b9['id'],_0x40fccc,_0x1b421e,JSON[_0xad23('0xc')](_0x54891a));io['to'](_0x40fccc)[_0xad23('0xd')](_0x1b421e,_0x54891a);}exports['exec']=function(_0x5c66aa,_0x3f3954,_0x25a158,_0x3da922){var _0x42e719,_0x5c35b5;var _0xb171e7={};var _0x20a019;var _0x7d1145=Number(_0x25a158[_0xad23('0xe')]);var _0x36d948=_0x25a158[_0xad23('0xf')]?Boolean(Number(_0x25a158[_0xad23('0xf')])):![];var _0x474922;var _0x2ab8ee=![];if(!_[_0xad23('0x10')](_0x25a158[_0xad23('0x11')])){if(_0x25a158['data5']=='1')_0x2ab8ee=!![];}if(!_0x2ab8ee){if(_0x3da922[_0xad23('0x12')]){_0xb171e7['id']=_0x3da922[_0xad23('0x12')];}}if(!_0xb171e7['id']){_0xb171e7[_0xad23('0x13')]=_0x7d1145;_0x474922=_0x25a158[_0xad23('0x14')]&&_0x25a158[_0xad23('0x14')]!=='0'?_0x25a158[_0xad23('0x14')][_0xad23('0x15')](','):[_0xad23('0x16')];_0xb171e7[_0xad23('0x17')]=_[_0xad23('0x18')](_0x474922,function(_0x54d1e3){var _0x34a1a3={};_0x34a1a3[_0x54d1e3]=_0x3da922[_0xad23('0x19')]?_0x3da922[_0xad23('0x1a')]:_0x3da922[_0xad23('0x1b')];return _0x34a1a3;});_0x20a019=_0x3da922[_0xad23('0x19')]?_0x3da922[_0xad23('0x1a')]:_0x3da922[_0xad23('0x1b')];}var _0x577c1b=['id','firstName',_0xad23('0x1c'),'phone',_0xad23('0x1d'),'fax',_0xad23('0x13'),_0xad23('0x1e'),_0xad23('0x1f'),_0xad23('0x20')];var _0x559981=_[_0xad23('0x21')](_0x577c1b,_0x474922);BPromise['resolve']()[_0xad23('0x22')](cmContactRpc[_0xad23('0x23')]({'attributes':_0x559981,'where':_0xb171e7,'phone':_0x20a019}))[_0xad23('0x22')](function(_0x204e6b){_0x5c35b5=_0x204e6b;if(!_[_0xad23('0x24')](_0x5c35b5)){if(_0x5c35b5['length']===0x1){_0x42e719=_0x5c35b5[0x0];logger[_0xad23('0xa')](_0xad23('0x25'),_0x3da922[_0xad23('0x26')],_0x3f3954['id'],_0x42e719['id']);}else{logger[_0xad23('0xa')](_0xad23('0x27'),_0x3da922[_0xad23('0x26')],_0x3f3954['id'],_[_0xad23('0x18')](_0x5c35b5,'id')[_0xad23('0x28')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x3da922[_0xad23('0x26')],_0x3f3954['id']);var _0x927e77={'ListId':_0x7d1145};var _0x43f184=_0x25a158['data4']&&_0x25a158[_0xad23('0x29')]!=='0'?_0x25a158['data4']:'phone';if(_0x36d948){logger['info'](_0xad23('0x2a'),_0x3da922[_0xad23('0x26')],_0x3f3954['id']);_0x927e77[_0x43f184]=_['isNil'](_0x3da922[_0xad23('0x19')])?_0x3da922[_0xad23('0x1b')]:_0x3da922[_0xad23('0x1a')];if(_[_0xad23('0x10')](_0x3da922[_0xad23('0x19')])){_0x927e77[_0xad23('0x2b')]=_0x3da922[_0xad23('0x2c')]&&_0x3da922[_0xad23('0x2c')]!==_0xad23('0x2d')?_0x3da922[_0xad23('0x2c')]:_0xad23('0x2e');}else{_0x927e77[_0xad23('0x2b')]=_0x3da922[_0xad23('0x2f')]&&_0x3da922[_0xad23('0x2f')]!==_0xad23('0x2d')?_0x3da922['destcalleridname']:_0xad23('0x2e');}return BPromise[_0xad23('0x30')]()[_0xad23('0x22')](cmContactRpc[_0xad23('0x31')](_0x927e77))[_0xad23('0x22')](function(_0x45c1d3){_0x42e719=_0x45c1d3;_0x5c35b5[_0xad23('0x32')](_0x45c1d3);if(_0x42e719){logger[_0xad23('0xa')](_0xad23('0x33'),_0x3da922[_0xad23('0x26')],_0x3f3954['id'],_0x42e719['id']);}return;});}else{logger[_0xad23('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x3da922[_0xad23('0x26')],_0x3f3954['id']);_0x927e77[_0x43f184]=_['isNil'](_0x3da922[_0xad23('0x19')])?_0x3da922[_0xad23('0x1b')]:_0x3da922['destcalleridnum'];if(_['isNil'](_0x3da922[_0xad23('0x19')])){_0x927e77['firstName']=_0x3da922[_0xad23('0x2c')]&&_0x3da922[_0xad23('0x2c')]!==''?_0x3da922['calleridname']:_0xad23('0x2e');}else{_0x927e77[_0xad23('0x2b')]=_0x3da922[_0xad23('0x2f')]&&_0x3da922[_0xad23('0x2f')]!==_0xad23('0x2d')?_0x3da922[_0xad23('0x2f')]:'Unknown';}_0x42e719=_0x927e77;_0x5c35b5[_0xad23('0x32')](_0x927e77);return;}}})[_0xad23('0x22')](function(){if(_0x5c66aa){emit(_0x3da922[_0xad23('0x26')],_0x3f3954,util[_0xad23('0x34')](_0xad23('0x35'),_0x5c66aa[_0xad23('0x36')]),util['format'](_0xad23('0x37'),_0x25a158[_0xad23('0x38')][_0xad23('0x39')]()),{'evt':_[_0xad23('0x3a')](_0x3da922,{'autoCreate':_0x36d948}),'contact':_0x42e719===undefined?{}:_0x42e719,'contacts':_0x5c35b5[_0xad23('0x3b')]===0x0?undefined:_0x5c35b5});}});}; \ No newline at end of file +var _0xf280=['then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','data4','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','routeId','calleridnum','destcalleridnum','firstName','lastName','phone','mobile','scheduledAt','updatedAt','union','resolve'];(function(_0x3805e9,_0x12966f){var _0x5afb09=function(_0x1d25a0){while(--_0x1d25a0){_0x3805e9['push'](_0x3805e9['shift']());}};_0x5afb09(++_0x12966f);}(_0xf280,0x84));var _0x0f28=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0xf280[_0x564821];return _0x2b604d;};'use strict';var _=require('lodash');var BPromise=require(_0x0f28('0x0'));var Redis=require(_0x0f28('0x1'));var util=require(_0x0f28('0x2'));var config=require(_0x0f28('0x3'));var logger=require('../../../../config/logger')(_0x0f28('0x4'));var cmContactRpc=require(_0x0f28('0x5'));config[_0x0f28('0x6')]=_['defaults'](config[_0x0f28('0x6')],{'host':_0x0f28('0x7'),'port':0x18eb});var io=require(_0x0f28('0x8'))(new Redis(config[_0x0f28('0x6')]));function emit(_0x28a942,_0xe851a8,_0x2d0d37,_0xc312eb,_0x3c3e74){logger[_0x0f28('0x9')](_0x0f28('0xa'),_0x28a942,_0xe851a8['id'],_0x2d0d37,_0xc312eb,JSON[_0x0f28('0xb')](_0x3c3e74));io['to'](_0x2d0d37)[_0x0f28('0xc')](_0xc312eb,_0x3c3e74);}exports['exec']=function(_0x26f80f,_0x46ef6b,_0x4c7c0f,_0x59be44){var _0x1b7887,_0x38f2a7;var _0x25d81e={};var _0x12a9a7;var _0x1b9414=Number(_0x4c7c0f[_0x0f28('0xd')]);var _0x3294b7=_0x4c7c0f[_0x0f28('0xe')]?Boolean(Number(_0x4c7c0f['data2'])):![];var _0x2c0baa;var _0x34c248=![];if(!_[_0x0f28('0xf')](_0x4c7c0f[_0x0f28('0x10')])){if(_0x4c7c0f[_0x0f28('0x10')]=='1')_0x34c248=!![];}if(!_0x34c248){if(_0x59be44[_0x0f28('0x11')]){_0x25d81e['id']=_0x59be44['xmd-contactid'];}}if(!_0x25d81e['id']){_0x25d81e[_0x0f28('0x12')]=_0x1b9414;_0x2c0baa=_0x4c7c0f[_0x0f28('0x13')]&&_0x4c7c0f[_0x0f28('0x13')]!=='0'?_0x4c7c0f[_0x0f28('0x13')][_0x0f28('0x14')](','):['phone'];_0x25d81e[_0x0f28('0x15')]=_['map'](_0x2c0baa,function(_0xbfb4c1){var _0x516398={};_0x516398[_0xbfb4c1]=_0x59be44[_0x0f28('0x16')]?_0x59be44['destcalleridnum']:_0x59be44[_0x0f28('0x17')];return _0x516398;});_0x12a9a7=_0x59be44['routeId']?_0x59be44[_0x0f28('0x18')]:_0x59be44[_0x0f28('0x17')];}var _0x26cd33=['id',_0x0f28('0x19'),_0x0f28('0x1a'),_0x0f28('0x1b'),_0x0f28('0x1c'),'fax',_0x0f28('0x12'),'createdAt',_0x0f28('0x1d'),_0x0f28('0x1e')];var _0x3815f7=_[_0x0f28('0x1f')](_0x26cd33,_0x2c0baa);BPromise[_0x0f28('0x20')]()['then'](cmContactRpc['getContacts']({'attributes':_0x3815f7,'where':_0x25d81e,'phone':_0x12a9a7}))[_0x0f28('0x21')](function(_0x3f6207){_0x38f2a7=_0x3f6207;if(!_[_0x0f28('0x22')](_0x38f2a7)){if(_0x38f2a7[_0x0f28('0x23')]===0x1){_0x1b7887=_0x38f2a7[0x0];logger[_0x0f28('0x9')](_0x0f28('0x24'),_0x59be44[_0x0f28('0x25')],_0x46ef6b['id'],_0x1b7887['id']);}else{logger[_0x0f28('0x9')](_0x0f28('0x26'),_0x59be44[_0x0f28('0x25')],_0x46ef6b['id'],_[_0x0f28('0x27')](_0x38f2a7,'id')['join'](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x59be44[_0x0f28('0x25')],_0x46ef6b['id']);var _0x2e1a38={'ListId':_0x1b9414};var _0x4376ac=_0x4c7c0f[_0x0f28('0x28')]&&_0x4c7c0f[_0x0f28('0x28')]!=='0'?_0x4c7c0f[_0x0f28('0x28')]:'phone';if(_0x3294b7){logger[_0x0f28('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x59be44[_0x0f28('0x25')],_0x46ef6b['id']);_0x2e1a38[_0x4376ac]=_[_0x0f28('0xf')](_0x59be44[_0x0f28('0x16')])?_0x59be44[_0x0f28('0x17')]:_0x59be44[_0x0f28('0x18')];if(_[_0x0f28('0xf')](_0x59be44[_0x0f28('0x16')])){_0x2e1a38[_0x0f28('0x19')]=_0x59be44['calleridname']&&_0x59be44[_0x0f28('0x29')]!==_0x0f28('0x2a')?_0x59be44['calleridname']:_0x0f28('0x2b');}else{_0x2e1a38[_0x0f28('0x19')]=_0x59be44['destcalleridname']&&_0x59be44[_0x0f28('0x2c')]!==''?_0x59be44[_0x0f28('0x2c')]:_0x0f28('0x2b');}return BPromise[_0x0f28('0x20')]()[_0x0f28('0x21')](cmContactRpc[_0x0f28('0x2d')](_0x2e1a38))[_0x0f28('0x21')](function(_0x379397){_0x1b7887=_0x379397;_0x38f2a7[_0x0f28('0x2e')](_0x379397);if(_0x1b7887){logger[_0x0f28('0x9')](_0x0f28('0x2f'),_0x59be44[_0x0f28('0x25')],_0x46ef6b['id'],_0x1b7887['id']);}return;});}else{logger[_0x0f28('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x59be44[_0x0f28('0x25')],_0x46ef6b['id']);_0x2e1a38[_0x4376ac]=_[_0x0f28('0xf')](_0x59be44[_0x0f28('0x16')])?_0x59be44[_0x0f28('0x17')]:_0x59be44[_0x0f28('0x18')];if(_['isNil'](_0x59be44[_0x0f28('0x16')])){_0x2e1a38[_0x0f28('0x19')]=_0x59be44[_0x0f28('0x29')]&&_0x59be44['calleridname']!==_0x0f28('0x2a')?_0x59be44[_0x0f28('0x29')]:_0x0f28('0x2b');}else{_0x2e1a38[_0x0f28('0x19')]=_0x59be44[_0x0f28('0x2c')]&&_0x59be44[_0x0f28('0x2c')]!==''?_0x59be44[_0x0f28('0x2c')]:'Unknown';}_0x1b7887=_0x2e1a38;_0x38f2a7[_0x0f28('0x2e')](_0x2e1a38);return;}}})['then'](function(){if(_0x26f80f){emit(_0x59be44[_0x0f28('0x25')],_0x46ef6b,util[_0x0f28('0x30')](_0x0f28('0x31'),_0x26f80f[_0x0f28('0x32')]),util[_0x0f28('0x30')](_0x0f28('0x33'),_0x4c7c0f[_0x0f28('0x34')][_0x0f28('0x35')]()),{'evt':_[_0x0f28('0x36')](_0x59be44,{'autoCreate':_0x3294b7}),'contact':_0x1b7887===undefined?{}:_0x1b7887,'contacts':_0x38f2a7['length']===0x0?undefined:_0x38f2a7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e0293d1..de5c031 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 _0xd5f9=['urlforward','script','query','search','replace','channel','AllConditions','length','every','checkConditions','AnyConditions','some','account','ChatWebsiteId','value','AccountId','event','operator','queue','agent','membername','lastevent','mailSubstatus','substatus','equals','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','defaults','redis','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','salesforceAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentcomplete','custom:agentbusy','custom:agentreject','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','voice','hasOwnProperty','status','checkTrigger','merge','variables','Actions','interface','toLowerCase','browser','data1','TemplateId','data2','html','render','uri','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','action','trigger:%s','contactmanager','exec','integration','routeId'];(function(_0xf02f86,_0x2af699){var _0x34e6bb=function(_0x1a9e75){while(--_0x1a9e75){_0xf02f86['push'](_0xf02f86['shift']());}};_0x34e6bb(++_0x2af699);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x3c7f1d,_0x44b37b){_0x3c7f1d=_0x3c7f1d-0x0;var _0xd7ab0c=_0xd5f9[_0x3c7f1d];return _0xd7ab0c;};'use strict';var util=require(_0x9d5f('0x0'));var _=require(_0x9d5f('0x1'));var url=require(_0x9d5f('0x2'));var Mustache=require(_0x9d5f('0x3'));var Redis=require('ioredis');var urlforward=require(_0x9d5f('0x4'));var integration=require(_0x9d5f('0x5'));var cmContact=require(_0x9d5f('0x6'));var script=require(_0x9d5f('0x7'));var config=require(_0x9d5f('0x8'));var logger=require(_0x9d5f('0x9'))('trigger');var ami=require('../ami');config['redis']=_[_0x9d5f('0xa')](config[_0x9d5f('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x9d5f('0xc'))(new Redis(config[_0x9d5f('0xb')]));var operators={'equals':function(_0x4bb4a2,_0x1960f8){return _0x4bb4a2==_0x1960f8;},'not_equals':function(_0x241166,_0x4c3def){return _0x241166!=_0x4c3def;}};var barAndWebActions=[_0x9d5f('0xd'),'url',_0x9d5f('0xe')];function Trigger(_0x3b71ed){this[_0x9d5f('0xf')]=_0x3b71ed[_0x9d5f('0xf')];this[_0x9d5f('0x10')]=_0x3b71ed['agents'];this[_0x9d5f('0x11')]=_0x3b71ed[_0x9d5f('0x11')];this[_0x9d5f('0x12')]=_0x3b71ed[_0x9d5f('0x12')];this[_0x9d5f('0x13')]=_0x3b71ed[_0x9d5f('0x13')];this[_0x9d5f('0x14')]=_0x3b71ed[_0x9d5f('0x14')];this[_0x9d5f('0x15')]=_0x3b71ed['freshdeskAccounts'];this['salesforceAccounts']=_0x3b71ed['salesforceAccounts'];this['sugarcrmAccounts']=_0x3b71ed[_0x9d5f('0x16')];this[_0x9d5f('0x17')]=_0x3b71ed['zohoAccounts'];this[_0x9d5f('0x18')]=_0x3b71ed[_0x9d5f('0x18')];this[_0x9d5f('0x19')]=_0x3b71ed[_0x9d5f('0x19')];this[_0x9d5f('0x1a')]=_0x3b71ed['servicenowAccounts'];this[_0x9d5f('0x1b')]=_0x3b71ed[_0x9d5f('0x1b')];this[_0x9d5f('0x1c')]=_0x3b71ed[_0x9d5f('0x1c')];this[_0x9d5f('0x1d')]={'zendesk':this[_0x9d5f('0x14')],'salesforce':this[_0x9d5f('0x1e')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x9d5f('0x16')],'zoho':this[_0x9d5f('0x17')],'desk':this[_0x9d5f('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x9d5f('0x1c')],'servicenow':this[_0x9d5f('0x1a')]};ami['on'](_0x9d5f('0x1f'),this[_0x9d5f('0x20')]['bind'](this));ami['on'](_0x9d5f('0x21'),this['syncCustomEvent'][_0x9d5f('0x22')](this));ami['on']('custom:agentringnoanswer',this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x23'),this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on']('custom:agentnosuchnumber',this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on']('custom:agentnoanswer',this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x24'),this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on']('custom:agentcongestion',this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x25'),this['syncCustomEvent'][_0x9d5f('0x22')](this));ami['on']('custom:amd',this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on']('custom:queuecallerabandon',this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x26'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0x9d5f('0x27')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x28'),this['syncAgentDial'][_0x9d5f('0x22')](this));ami['on']('custom:dialend',this[_0x9d5f('0x27')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x29'),this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x2a'),this['syncCustomEvent'][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x2b'),this[_0x9d5f('0x20')]['bind'](this));ami['on']('custom:incomingmessage',this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x2c'),this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x2d'),this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x2e'),this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));ami['on'](_0x9d5f('0x2f'),this[_0x9d5f('0x20')][_0x9d5f('0x22')](this));}Trigger[_0x9d5f('0x30')][_0x9d5f('0x31')]=function(_0xefc4bd,_0x118406,_0x215ec8){logger[_0x9d5f('0x32')](_0xefc4bd,_0x118406,JSON[_0x9d5f('0x33')](_0x215ec8));io['to'](_0xefc4bd)['emit'](_0x118406,_0x215ec8);};Trigger['prototype'][_0x9d5f('0x20')]=function(_0x3eb23c){var _0x3a4064=_[_0x9d5f('0x34')](_0x3eb23c);if(typeof _0x3a4064[_0x9d5f('0x35')]==='undefined'){_0x3a4064['motionChannel']=_0x9d5f('0x36');}this['checkTriggers'](_0x3a4064);};Trigger[_0x9d5f('0x30')]['syncAgentDial']=function(_0xfdde7c){if(this[_0x9d5f('0x10')][_0xfdde7c['interface']]){this[_0x9d5f('0x20')](_0xfdde7c);}};Trigger[_0x9d5f('0x30')]['checkTriggers']=function(_0x415c0c){var _0x55172a;for(var _0x5b9f1e in this[_0x9d5f('0xf')]){if(this[_0x9d5f('0xf')][_0x9d5f('0x37')](_0x5b9f1e)){if(this[_0x9d5f('0xf')][_0x5b9f1e][_0x9d5f('0x38')]){_0x55172a=this[_0x9d5f('0x39')](this[_0x9d5f('0xf')][_0x5b9f1e],_0x415c0c);if(_0x55172a){_[_0x9d5f('0x3a')](_0x415c0c,_0x415c0c[_0x9d5f('0x3b')]);for(var _0x37ecb4=0x0,_0xc1488d,_0x1fba76,_0x30a14d;_0x37ecb40x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0xad3aa0,_0x33747f){_0xad3aa0=_0xad3aa0-0x0;var _0x57b6bb=_0xe14b[_0xad3aa0];return _0x57b6bb;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_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 diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index d958a23..b25bea1 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 _0x0763=['ticketType','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','resolve','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','internalemailaddress','info','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','userId','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','4.0','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf'];(function(_0x9148ba,_0x2cb1b5){var _0x355e3b=function(_0x134846){while(--_0x134846){_0x9148ba['push'](_0x9148ba['shift']());}};_0x355e3b(++_0x2cb1b5);}(_0x0763,0x169));var _0x3076=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x0763[_0xe1b5f6];return _0x44636e;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require(_0x3076('0x0'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x3076('0x1'));var logger=require(_0x3076('0x2'))(_0x3076('0x3'));var config=require(_0x3076('0x4'));config[_0x3076('0x5')]=_['defaults'](config[_0x3076('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x3076('0x6'))(new Redis(config[_0x3076('0x5')]));function getAuthToken(_0x23404b,_0x56e2ae,_0x259b43){if(_0x23404b[_0x3076('0x7')]){_0x23404b['remoteUri']=_0x23404b[_0x3076('0x8')]['data7'];_0x23404b[_0x3076('0x9')]=_0x23404b['CloudProvider']['data2'];return Promise[_0x3076('0xa')](_0x23404b[_0x3076('0x8')]['data5']);}var _0x50205f={'method':_0x3076('0xb'),'uri':_0x56e2ae,'form':{'client_id':_0x23404b[_0x3076('0xc')],'resource':_0x23404b[_0x3076('0xd')],'username':_0x23404b[_0x3076('0xe')],'password':_0x23404b[_0x3076('0xf')],'grant_type':'password','client_secret':_0x23404b[_0x3076('0x10')]},'json':!![]};return rp(_0x50205f)[_0x3076('0x11')](function(_0x52edd1){return _0x52edd1[_0x3076('0x12')];})[_0x3076('0x13')](function(_0x45d160){logger[_0x3076('0x14')]('['+[_0x259b43[_0x3076('0x15')]()]+_0x3076('0x16'));return _0x45d160[_0x3076('0x17')];});}function getUser(_0x12f1bc,_0x421fb2,_0x11da1a,_0x2b2418,_0x5928e4,_0x272578){return new Promise(function(_0x8103c7,_0x47c9a6){return getAuthToken(_0x421fb2,_0x2b2418,_0x272578)[_0x3076('0x11')](function(_0x52119b){var _0x50b415={'method':_0x3076('0x18'),'uri':_0x5928e4+_0x3076('0x19'),'headers':{'Authorization':_0x3076('0x1a')+_0x52119b,'OData-Version':'4.0'},'json':!![]};return rp(_0x50b415);})[_0x3076('0x11')](function(_0x3f465c){var _0x19bd86=_0x3f465c[_0x3076('0x1b')];var _0x455651=![];var _0x206d37=null;if(!_[_0x3076('0x1c')](_0x11da1a)){if(intUtil[_0x3076('0x1d')](_0x11da1a[_0x3076('0x1e')])){_0x12f1bc[_0x3076('0x1f')]=_0x11da1a[_0x3076('0x1e')];for(_0x206d37=0x0;_0x206d37<_0x19bd86['length'];_0x206d37++){if(_0x19bd86[_0x206d37][_0x3076('0x20')]===_0x11da1a[_0x3076('0x1e')]&&!_0x19bd86[_0x206d37]['isdisabled']){_0x455651=!![];logger[_0x3076('0x21')]('['+[_0x272578[_0x3076('0x15')]()]+']\x20Agent\x20found\x20'+_0x19bd86[_0x206d37][_0x3076('0x22')]+'!');_0x12f1bc['userId']=_0x19bd86[_0x206d37][_0x3076('0x22')];}}}}if(!_0x455651){logger['info']('['+[_0x272578[_0x3076('0x15')]()]+_0x3076('0x23'));_0x12f1bc[_0x3076('0x1f')]=_0x421fb2[_0x3076('0xe')];for(_0x206d37=0x0;_0x206d37<_0x19bd86[_0x3076('0x24')];_0x206d37++){if(_0x19bd86[_0x206d37]['internalemailaddress']===_0x421fb2[_0x3076('0xe')]){_0x12f1bc[_0x3076('0x25')]=_0x19bd86[_0x206d37][_0x3076('0x22')];}}}_0x8103c7(_0x12f1bc);})['catch'](function(_0x1e2f45){_0x47c9a6(_0x1e2f45[_0x3076('0x17')]);});});}function createEndUser(_0x5b737a,_0xcf0d27,_0x5e4369,_0x5af8af,_0x3d3f62,_0x4abed6,_0x588e00){return new Promise(function(_0x503cc3,_0x866060){return getAuthToken(_0xcf0d27,_0x5e4369,_0x4abed6)['then'](function(_0x3a4d88){var _0x10024b=_0x4abed6[_0x3076('0x26')]()===_0x3076('0x27')?_0x3d3f62[_0x3076('0x28')]:_0x3d3f62[_0x3076('0x29')];var _0x311955={'method':_0x3076('0xb'),'uri':_0x5af8af+'contacts','body':{'fullname':_0x10024b,'firstname':_0x10024b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3076('0x2a')+_0x5b737a[_0x3076('0x25')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x3a4d88,'OData-Version':_0x3076('0x2b')},'json':!![],'resolveWithFullResponse':!![]};_0x311955[_0x3076('0x2c')][_0x588e00]=_0x10024b;return rp(_0x311955);})[_0x3076('0x11')](function(_0xfa6b79){var _0x4f94bb=_0xfa6b79[_0x3076('0x2d')][_0x3076('0x2e')];var _0x147272=_0x4f94bb[_0x3076('0x2f')](_0x4f94bb[_0x3076('0x30')]('(')+0x1,_0x4f94bb[_0x3076('0x30')](')'));_0x5b737a[_0x3076('0x31')]=_0x147272;_0x503cc3(_0x5b737a);})[_0x3076('0x13')](function(_0x428382){_0x866060(_0x428382['message']);});});}function getEndUser(_0x3bff7d,_0x1abaa0,_0x2ecfd4,_0x270e70,_0x370274,_0x42aebc,_0x321b93,_0x1c51c1){var _0x5e9392=_0x42aebc['toLowerCase']()===_0x3076('0x27')?_0x370274['destcalleridnum']:_0x370274['calleridnum'];return getAuthToken(_0x1abaa0,_0x2ecfd4,_0x42aebc)[_0x3076('0x11')](function(_0x4b797c){_0x1c51c1=_0x1c51c1?_0x1c51c1:_0x3076('0x32');var _0x4e431a={'method':'GET','uri':_0x270e70+_0x3076('0x33')+_0x1c51c1+_0x3076('0x34')+_0x1c51c1+_0x3076('0x35')+_0x5e9392[_0x3076('0x36')]('+','%2b')+'\x27','headers':{'Authorization':_0x3076('0x1a')+_0x4b797c,'If-None-Match':null,'OData-Version':_0x3076('0x2b')},'json':!![]};return rp(_0x4e431a);})[_0x3076('0x11')](function(_0x382512){var _0x2af339=![];if(!_0x382512)return _0x2af339;var _0x343ef5=_0x382512[_0x3076('0x1b')];for(var _0x4aa972=0x0;_0x4aa972<_0x343ef5[_0x3076('0x24')];_0x4aa972++){if(_0x343ef5[_0x4aa972][_0x1c51c1]===_0x5e9392){_0x2af339=!![];_0x3bff7d['enduserId']=_0x343ef5[_0x4aa972][_0x3076('0x37')];}}return _0x2af339;})['then'](function(_0x8fb43f){if(_0x8fb43f)return _0x3bff7d;if(_0x321b93==='nothing'){logger[_0x3076('0x21')]('['+[_0x42aebc[_0x3076('0x15')]()]+_0x3076('0x38'));return _0x3bff7d;}return createEndUser(_0x3bff7d,_0x1abaa0,_0x2ecfd4,_0x270e70,_0x370274,_0x42aebc,_0x1c51c1)[_0x3076('0x11')](function(_0x24cf42){logger[_0x3076('0x21')]('['+[_0x42aebc[_0x3076('0x15')]()]+_0x3076('0x39'),_0x24cf42['enduserId']);return _0x24cf42;});});}function getCustomFields(_0x1dca1c,_0x2b76cc,_0xec860){var _0x7c36d8={};if(_0x1dca1c[_0x3076('0x24')]>0x0){_[_0x3076('0x3a')](_0x1dca1c,function(_0x31ed60){if(_[_0x3076('0x3b')]([_0x3076('0x3c'),_0x3076('0x3d')],_0x31ed60[_0x3076('0x3e')])&&_0x31ed60[_0x3076('0x3f')]&&!_0x31ed60[_0x3076('0x40')]){var _0x40d3d1=_0x31ed60[_0x3076('0x41')][_0x3076('0x26')]();var _0x153b47=_0x40d3d1[_0x3076('0x2f')](0x0,_0x40d3d1[_0x3076('0x42')]('_'));var _0x55dfe6=_0x40d3d1[_0x3076('0x2f')](_0x40d3d1[_0x3076('0x42')]('_')+0x1);if(_0x153b47===_0xec860){_0x7c36d8[_0x55dfe6]=_0x31ed60['content'];}}});}return _0x7c36d8;}function getTicket(_0x48a67d,_0x3bfaca,_0x5afdcd,_0x39a635,_0x2cf74e,_0x297023,_0x53d47a){return new Promise(function(_0x4cac58,_0x54fc52){var _0x4dc677;return getAuthToken(_0x3bfaca,_0x5afdcd,_0x53d47a)['then'](function(_0x38f865){if(_0x297023[_0x3076('0x43')]===_0x3076('0x44')){_0x4dc677={'method':_0x3076('0xb'),'uri':_0x39a635+_0x3076('0x45'),'body':Object[_0x3076('0x46')]({},{'title':intUtil['getString'](_0x297023[_0x3076('0x47')],_0x2cf74e,'\x20'),'description':intUtil[_0x3076('0x48')](_0x297023[_0x3076('0x49')],_0x2cf74e,'\x0a'),'customerid_contact@odata.bind':_0x48a67d[_0x3076('0x31')]?_0x3076('0x4a')+_0x48a67d['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x48a67d['userId']+')','caseorigincode':'1'},getCustomFields(_0x297023[_0x3076('0x4b')],_0x2cf74e,_0x297023['ticketType'])),'headers':{'Authorization':_0x3076('0x1a')+_0x38f865,'OData-Version':_0x3076('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x297023[_0x3076('0x43')]===_0x3076('0x4c')){var _0x39a669=_0x48a67d['enduserId']?[{'partyid_systemuser@odata.bind':_0x3076('0x2a')+_0x48a67d[_0x3076('0x25')]+')','participationtypemask':_0x48a67d[_0x3076('0x4d')]===_0x3076('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x3076('0x4a')+_0x48a67d[_0x3076('0x31')]+')','participationtypemask':_0x48a67d[_0x3076('0x4d')]===_0x3076('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3076('0x2a')+_0x48a67d[_0x3076('0x25')]+')','participationtypemask':_0x48a67d['callDirection']===_0x3076('0x4e')?0x2:0x1}];_0x4dc677={'method':'POST','uri':_0x39a635+_0x3076('0x4f'),'body':Object[_0x3076('0x46')]({},{'subject':intUtil['getString'](_0x297023[_0x3076('0x47')],_0x2cf74e,'\x20'),'phonenumber':String(_0x2cf74e['calleridnum']),'description':intUtil[_0x3076('0x48')](_0x297023[_0x3076('0x49')],_0x2cf74e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x48a67d[_0x3076('0x31')]?_0x3076('0x4a')+_0x48a67d[_0x3076('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x48a67d[_0x3076('0x25')]+')','directioncode':_0x48a67d[_0x3076('0x4d')]==='queue'?![]:!![],'phonecall_activity_parties':_0x39a669},getCustomFields(_0x297023[_0x3076('0x4b')],_0x2cf74e,_0x297023[_0x3076('0x43')])),'headers':{'Authorization':_0x3076('0x1a')+_0x38f865,'OData-Version':_0x3076('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4dc677);})[_0x3076('0x11')](function(_0x53262b){var _0x122970=_0x53262b[_0x3076('0x2d')][_0x3076('0x2e')];var _0x5aff51=_0x122970['substring'](_0x122970[_0x3076('0x30')]('(')+0x1,_0x122970['lastIndexOf'](')'));_0x48a67d[_0x3076('0x50')]=_0x5aff51;_0x4cac58(_0x48a67d);})[_0x3076('0x13')](function(_0x44b585){_0x54fc52(_0x44b585[_0x3076('0x17')]);});});}function emit(_0x40754e,_0xc83591,_0x3ea73d,_0x236a4a){var _0x2f1b95={'uri':util['format'](_0x3076('0x51'),_0x40754e,_0x3ea73d,_0x236a4a)};io['to'](util[_0x3076('0x52')](_0x3076('0x53'),_0xc83591))[_0x3076('0x54')](_0x3076('0x55'),_0x2f1b95);}exports['cs']=function(_0x4e8e3d,_0x1c411e,_0x4a213d,_0x2acbe2,_0x392237,_0x506f5b,_0x28b4df,_0x5111f3){var _0xa76277={};_0x506f5b[_0x3076('0xd')]=_0x506f5b['modernAuthentication']?intUtil['stripTrailingSlash'](_0x506f5b['CloudProvider'][_0x3076('0x56')]):intUtil['stripTrailingSlash'](_0x506f5b['remoteUri']);_0x506f5b[_0x3076('0x57')]=intUtil['stripTrailingSlash'](_0x506f5b[_0x3076('0x57')]);_0xa76277['callDirection']=_0x5111f3===_0x3076('0x4e')||_0x5111f3===_0x3076('0x58')?_0x3076('0x4e'):_0x3076('0x27');var _0x24a715=_0x506f5b[_0x3076('0x7')]?util[_0x3076('0x52')](_0x3076('0x59'),_0x506f5b['CloudProvider'][_0x3076('0x56')]):util[_0x3076('0x52')](_0x3076('0x59'),_0x506f5b[_0x3076('0xd')]);var _0x2e9a7f=util[_0x3076('0x52')](_0x3076('0x5a'),_0x506f5b['tenantId']);var _0x56cadb=util['format'](_0x3076('0x5b'),_0x506f5b[_0x3076('0x57')],_0x1c411e[_0x3076('0x5c')],md5(_0x1c411e[_0x3076('0x5c')]));if(_0x392237&&_0x392237[_0x3076('0x5d')]){logger[_0x3076('0x21')]('[QUEUE]',_0x3076('0x5e'));_0x1c411e[_0x3076('0x5f')]=_0x56cadb;}else if(_0x28b4df&&_0x28b4df['recordingFormat']&&_0x28b4df['recordingFormat']!==_0x3076('0x60')){logger[_0x3076('0x21')](_0x3076('0x61'),'Recording\x20is\x20enabled!');_0x1c411e[_0x3076('0x5f')]=_0x56cadb;}else{_0x1c411e[_0x3076('0x5f')]='';}return getUser(_0xa76277,_0x506f5b,_0x2acbe2,_0x2e9a7f,_0x24a715,_0x5111f3)[_0x3076('0x11')](function(_0x5d6edb){logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x62'),_0x5d6edb[_0x3076('0x25')]);logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x63'),_0x5d6edb['userEmail']);return getEndUser(_0x5d6edb,_0x506f5b,_0x2e9a7f,_0x24a715,_0x1c411e,_0x5111f3,_0x4a213d[_0x3076('0x64')],_0x4a213d['additionalSearchContact']);})[_0x3076('0x11')](function(_0x44e85e){logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x65'),_0x44e85e['enduserId']);logger[_0x3076('0x21')]('['+_0x5111f3['toUpperCase']()+_0x3076('0x66'),_0x1c411e[_0x3076('0x29')]);return getTicket(_0x44e85e,_0x506f5b,_0x2e9a7f,_0x24a715,_0x1c411e,_0x4a213d,_0x5111f3);})[_0x3076('0x11')](function(_0x354113){logger[_0x3076('0x21')](util[_0x3076('0x52')]('['+_0x5111f3[_0x3076('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4a213d['ticketType'],_0x354113[_0x3076('0x50')]));logger[_0x3076('0x21')](util[_0x3076('0x52')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x67'),_0x5111f3));if(_0x5111f3!==_0x3076('0x58')&&_0x4a213d[_0x3076('0x68')]){logger[_0x3076('0x21')]('['+_0x5111f3[_0x3076('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x506f5b[_0x3076('0xd')],_0x2acbe2['name'],_0x4a213d['ticketType'],_0x354113[_0x3076('0x50')]);}})[_0x3076('0x13')](function(_0x378632){logger[_0x3076('0x14')]('['+_0x5111f3[_0x3076('0x15')]()+_0x3076('0x69'),_0x378632[_0x3076('0x17')]);console['error'](_0x3076('0x6a'),_0x378632);});}; \ No newline at end of file +var _0x4e96=['message','then','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','substring','lastIndexOf','enduserId','contacts?$select=','&$filter=','replace','%2b','value','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','queue','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','resolve','POST','clientId','password','clientSecret','catch','error','toUpperCase',']\x20Wrong\x20credentials!'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e96,0x19e));var _0x64e9=function(_0x4ff2bc,_0xedd1df){_0x4ff2bc=_0x4ff2bc-0x0;var _0x21751c=_0x4e96[_0x4ff2bc];return _0x21751c;};'use strict';var _=require(_0x64e9('0x0'));var rp=require(_0x64e9('0x1'));var util=require(_0x64e9('0x2'));var intUtil=require(_0x64e9('0x3'));var md5=require(_0x64e9('0x4'));var Redis=require(_0x64e9('0x5'));var logger=require(_0x64e9('0x6'))(_0x64e9('0x7'));var config=require(_0x64e9('0x8'));config[_0x64e9('0x9')]=_[_0x64e9('0xa')](config[_0x64e9('0x9')],{'host':_0x64e9('0xb'),'port':0x18eb});var io=require(_0x64e9('0xc'))(new Redis(config[_0x64e9('0x9')]));function getAuthToken(_0x3104e1,_0x452e34,_0x9752c9){if(_0x3104e1['modernAuthentication']){_0x3104e1[_0x64e9('0xd')]=_0x3104e1[_0x64e9('0xe')][_0x64e9('0xf')];_0x3104e1[_0x64e9('0x10')]=_0x3104e1[_0x64e9('0xe')]['data2'];return Promise[_0x64e9('0x11')](_0x3104e1['CloudProvider']['data5']);}var _0x36283b={'method':_0x64e9('0x12'),'uri':_0x452e34,'form':{'client_id':_0x3104e1[_0x64e9('0x13')],'resource':_0x3104e1['remoteUri'],'username':_0x3104e1['username'],'password':_0x3104e1[_0x64e9('0x14')],'grant_type':'password','client_secret':_0x3104e1[_0x64e9('0x15')]},'json':!![]};return rp(_0x36283b)['then'](function(_0x26a405){return _0x26a405['access_token'];})[_0x64e9('0x16')](function(_0x3212a1){logger[_0x64e9('0x17')]('['+[_0x9752c9[_0x64e9('0x18')]()]+_0x64e9('0x19'));return _0x3212a1[_0x64e9('0x1a')];});}function getUser(_0xd93723,_0x177bb1,_0x520eef,_0xbd2973,_0x3baef1,_0x3c0422){return new Promise(function(_0x1313a0,_0x4c57dc){return getAuthToken(_0x177bb1,_0xbd2973,_0x3c0422)[_0x64e9('0x1b')](function(_0x37863e){var _0x264737={'method':'GET','uri':_0x3baef1+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x64e9('0x1c')+_0x37863e,'OData-Version':_0x64e9('0x1d')},'json':!![]};return rp(_0x264737);})[_0x64e9('0x1b')](function(_0x5d8a1c){var _0x3c7588=_0x5d8a1c['value'];var _0x2c7807=![];var _0x22e33d=null;if(!_[_0x64e9('0x1e')](_0x520eef)){if(intUtil[_0x64e9('0x1f')](_0x520eef[_0x64e9('0x20')])){_0xd93723[_0x64e9('0x21')]=_0x520eef[_0x64e9('0x20')];for(_0x22e33d=0x0;_0x22e33d<_0x3c7588[_0x64e9('0x22')];_0x22e33d++){if(_0x3c7588[_0x22e33d][_0x64e9('0x23')]===_0x520eef['email']&&!_0x3c7588[_0x22e33d][_0x64e9('0x24')]){_0x2c7807=!![];logger[_0x64e9('0x25')]('['+[_0x3c0422['toUpperCase']()]+_0x64e9('0x26')+_0x3c7588[_0x22e33d]['systemuserid']+'!');_0xd93723['userId']=_0x3c7588[_0x22e33d][_0x64e9('0x27')];}}}}if(!_0x2c7807){logger[_0x64e9('0x25')]('['+[_0x3c0422[_0x64e9('0x18')]()]+_0x64e9('0x28'));_0xd93723[_0x64e9('0x21')]=_0x177bb1[_0x64e9('0x29')];for(_0x22e33d=0x0;_0x22e33d<_0x3c7588[_0x64e9('0x22')];_0x22e33d++){if(_0x3c7588[_0x22e33d][_0x64e9('0x23')]===_0x177bb1['username']){_0xd93723[_0x64e9('0x2a')]=_0x3c7588[_0x22e33d][_0x64e9('0x27')];}}}_0x1313a0(_0xd93723);})[_0x64e9('0x16')](function(_0x44062b){_0x4c57dc(_0x44062b[_0x64e9('0x1a')]);});});}function createEndUser(_0x5a49c4,_0x122d79,_0x3cde0e,_0x383c18,_0x1661d9,_0x102814,_0x7fad12){return new Promise(function(_0x284fcb,_0x298282){return getAuthToken(_0x122d79,_0x3cde0e,_0x102814)[_0x64e9('0x1b')](function(_0x11a711){var _0x14aeb0=_0x102814[_0x64e9('0x2b')]()===_0x64e9('0x2c')?_0x1661d9[_0x64e9('0x2d')]:_0x1661d9[_0x64e9('0x2e')];var _0x3fef58={'method':_0x64e9('0x12'),'uri':_0x383c18+_0x64e9('0x2f'),'body':{'fullname':_0x14aeb0,'firstname':_0x14aeb0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x64e9('0x30')+_0x5a49c4['userId']+')'},'headers':{'Authorization':_0x64e9('0x1c')+_0x11a711,'OData-Version':_0x64e9('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x3fef58[_0x64e9('0x31')][_0x7fad12]=_0x14aeb0;return rp(_0x3fef58);})['then'](function(_0x4b8ad0){var _0x51e64b=_0x4b8ad0[_0x64e9('0x32')]['odata-entityid'];var _0x41aee8=_0x51e64b[_0x64e9('0x33')](_0x51e64b[_0x64e9('0x34')]('(')+0x1,_0x51e64b[_0x64e9('0x34')](')'));_0x5a49c4[_0x64e9('0x35')]=_0x41aee8;_0x284fcb(_0x5a49c4);})[_0x64e9('0x16')](function(_0x154307){_0x298282(_0x154307[_0x64e9('0x1a')]);});});}function getEndUser(_0x509ff2,_0x1d68a9,_0x2d071b,_0x41fd82,_0x570239,_0x1abf3c,_0x278ca8,_0x3dd9ca){var _0x47588f=_0x1abf3c[_0x64e9('0x2b')]()===_0x64e9('0x2c')?_0x570239[_0x64e9('0x2d')]:_0x570239[_0x64e9('0x2e')];return getAuthToken(_0x1d68a9,_0x2d071b,_0x1abf3c)[_0x64e9('0x1b')](function(_0x49abe){_0x3dd9ca=_0x3dd9ca?_0x3dd9ca:'telephone1';var _0x5170fa={'method':'GET','uri':_0x41fd82+_0x64e9('0x36')+_0x3dd9ca+_0x64e9('0x37')+_0x3dd9ca+'\x20eq\x20\x27'+_0x47588f[_0x64e9('0x38')]('+',_0x64e9('0x39'))+'\x27','headers':{'Authorization':_0x64e9('0x1c')+_0x49abe,'If-None-Match':null,'OData-Version':_0x64e9('0x1d')},'json':!![]};return rp(_0x5170fa);})['then'](function(_0x55710c){var _0x48b63a=![];if(!_0x55710c)return _0x48b63a;var _0x5de51b=_0x55710c[_0x64e9('0x3a')];for(var _0x4177ac=0x0;_0x4177ac<_0x5de51b['length'];_0x4177ac++){if(_0x5de51b[_0x4177ac][_0x3dd9ca]===_0x47588f){_0x48b63a=!![];_0x509ff2[_0x64e9('0x35')]=_0x5de51b[_0x4177ac][_0x64e9('0x3b')];}}return _0x48b63a;})[_0x64e9('0x1b')](function(_0x150542){if(_0x150542)return _0x509ff2;if(_0x278ca8==='nothing'){logger['info']('['+[_0x1abf3c[_0x64e9('0x18')]()]+_0x64e9('0x3c'));return _0x509ff2;}return createEndUser(_0x509ff2,_0x1d68a9,_0x2d071b,_0x41fd82,_0x570239,_0x1abf3c,_0x3dd9ca)['then'](function(_0x89afc2){logger[_0x64e9('0x25')]('['+[_0x1abf3c[_0x64e9('0x18')]()]+_0x64e9('0x3d'),_0x89afc2[_0x64e9('0x35')]);return _0x89afc2;});});}function getCustomFields(_0x53e23c,_0x444088,_0x3bf443){var _0x40be7a={};if(_0x53e23c[_0x64e9('0x22')]>0x0){_[_0x64e9('0x3e')](_0x53e23c,function(_0x31a2d7){if(_[_0x64e9('0x3f')]([_0x64e9('0x40'),_0x64e9('0x41')],_0x31a2d7[_0x64e9('0x42')])&&_0x31a2d7['nameField']&&!_0x31a2d7['customField']){var _0x3d296c=_0x31a2d7[_0x64e9('0x43')][_0x64e9('0x2b')]();var _0x5a50fb=_0x3d296c[_0x64e9('0x33')](0x0,_0x3d296c[_0x64e9('0x44')]('_'));var _0x426ccf=_0x3d296c[_0x64e9('0x33')](_0x3d296c['indexOf']('_')+0x1);if(_0x5a50fb===_0x3bf443){_0x40be7a[_0x426ccf]=_0x31a2d7[_0x64e9('0x45')];}}});}return _0x40be7a;}function getTicket(_0x54daa9,_0x4a7737,_0x2b95e8,_0x1f9a48,_0x5b1e88,_0x26964c,_0x1bec35){return new Promise(function(_0x5c2c1e,_0x4c1610){var _0x1322b7;return getAuthToken(_0x4a7737,_0x2b95e8,_0x1bec35)['then'](function(_0x9bb716){if(_0x26964c[_0x64e9('0x46')]===_0x64e9('0x47')){_0x1322b7={'method':_0x64e9('0x12'),'uri':_0x1f9a48+_0x64e9('0x48'),'body':Object[_0x64e9('0x49')]({},{'title':intUtil[_0x64e9('0x4a')](_0x26964c[_0x64e9('0x4b')],_0x5b1e88,'\x20'),'description':intUtil[_0x64e9('0x4a')](_0x26964c[_0x64e9('0x4c')],_0x5b1e88,'\x0a'),'customerid_contact@odata.bind':_0x54daa9['enduserId']?_0x64e9('0x4d')+_0x54daa9['enduserId']+')':undefined,'ownerid@odata.bind':_0x64e9('0x30')+_0x54daa9['userId']+')','caseorigincode':'1'},getCustomFields(_0x26964c[_0x64e9('0x4e')],_0x5b1e88,_0x26964c['ticketType'])),'headers':{'Authorization':_0x64e9('0x1c')+_0x9bb716,'OData-Version':_0x64e9('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x26964c['ticketType']===_0x64e9('0x4f')){var _0x218967=_0x54daa9['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x54daa9[_0x64e9('0x2a')]+')','participationtypemask':_0x54daa9[_0x64e9('0x50')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x54daa9['enduserId']+')','participationtypemask':_0x54daa9[_0x64e9('0x50')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x64e9('0x30')+_0x54daa9['userId']+')','participationtypemask':_0x54daa9['callDirection']==='queue'?0x2:0x1}];_0x1322b7={'method':_0x64e9('0x12'),'uri':_0x1f9a48+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x64e9('0x4a')](_0x26964c['Subjects'],_0x5b1e88,'\x20'),'phonenumber':String(_0x5b1e88[_0x64e9('0x2e')]),'description':intUtil[_0x64e9('0x4a')](_0x26964c['Descriptions'],_0x5b1e88,'\x0a'),'regardingobjectid_contact@odata.bind':_0x54daa9[_0x64e9('0x35')]?_0x64e9('0x4d')+_0x54daa9[_0x64e9('0x35')]+')':undefined,'ownerid@odata.bind':_0x64e9('0x30')+_0x54daa9['userId']+')','directioncode':_0x54daa9[_0x64e9('0x50')]==='queue'?![]:!![],'phonecall_activity_parties':_0x218967},getCustomFields(_0x26964c['Fields'],_0x5b1e88,_0x26964c[_0x64e9('0x46')])),'headers':{'Authorization':_0x64e9('0x1c')+_0x9bb716,'OData-Version':_0x64e9('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1322b7);})['then'](function(_0x509e4b){var _0x16afef=_0x509e4b[_0x64e9('0x32')][_0x64e9('0x51')];var _0x1c0c7a=_0x16afef['substring'](_0x16afef[_0x64e9('0x34')]('(')+0x1,_0x16afef['lastIndexOf'](')'));_0x54daa9['ticketId']=_0x1c0c7a;_0x5c2c1e(_0x54daa9);})[_0x64e9('0x16')](function(_0x15b772){_0x4c1610(_0x15b772[_0x64e9('0x1a')]);});});}function emit(_0xe0b3c5,_0xd61ed4,_0x59f728,_0x19cbfb){var _0x3c3523={'uri':util[_0x64e9('0x52')](_0x64e9('0x53'),_0xe0b3c5,_0x59f728,_0x19cbfb)};io['to'](util[_0x64e9('0x52')](_0x64e9('0x54'),_0xd61ed4))['emit'](_0x64e9('0x55'),_0x3c3523);}exports['cs']=function(_0x3138f2,_0x1226e0,_0x46063b,_0x441923,_0x19d174,_0xf2787a,_0x27cd3b,_0x4c085e){var _0x3b25e5={};_0xf2787a['remoteUri']=_0xf2787a[_0x64e9('0x56')]?intUtil[_0x64e9('0x57')](_0xf2787a[_0x64e9('0xe')]['data7']):intUtil[_0x64e9('0x57')](_0xf2787a[_0x64e9('0xd')]);_0xf2787a[_0x64e9('0x58')]=intUtil[_0x64e9('0x57')](_0xf2787a[_0x64e9('0x58')]);_0x3b25e5[_0x64e9('0x50')]=_0x4c085e===_0x64e9('0x59')||_0x4c085e===_0x64e9('0x5a')?_0x64e9('0x59'):_0x64e9('0x2c');var _0x46fe7b=_0xf2787a[_0x64e9('0x56')]?util[_0x64e9('0x52')](_0x64e9('0x5b'),_0xf2787a[_0x64e9('0xe')][_0x64e9('0xf')]):util[_0x64e9('0x52')]('%s/api/data/v9.0/',_0xf2787a['remoteUri']);var _0xbabf41=util[_0x64e9('0x52')](_0x64e9('0x5c'),_0xf2787a[_0x64e9('0x10')]);var _0x8536f7=util[_0x64e9('0x52')](_0x64e9('0x5d'),_0xf2787a[_0x64e9('0x58')],_0x1226e0[_0x64e9('0x5e')],md5(_0x1226e0[_0x64e9('0x5e')]));if(_0x19d174&&_0x19d174['monitor_format']){logger[_0x64e9('0x25')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1226e0[_0x64e9('0x5f')]=_0x8536f7;}else if(_0x27cd3b&&_0x27cd3b['recordingFormat']&&_0x27cd3b[_0x64e9('0x60')]!==_0x64e9('0x61')){logger[_0x64e9('0x25')](_0x64e9('0x62'),_0x64e9('0x63'));_0x1226e0[_0x64e9('0x5f')]=_0x8536f7;}else{_0x1226e0['recordingURL']='';}return getUser(_0x3b25e5,_0xf2787a,_0x441923,_0xbabf41,_0x46fe7b,_0x4c085e)[_0x64e9('0x1b')](function(_0x2335a8){logger[_0x64e9('0x25')]('['+_0x4c085e['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x2335a8[_0x64e9('0x2a')]);logger['info']('['+_0x4c085e[_0x64e9('0x18')]()+_0x64e9('0x64'),_0x2335a8[_0x64e9('0x21')]);return getEndUser(_0x2335a8,_0xf2787a,_0xbabf41,_0x46fe7b,_0x1226e0,_0x4c085e,_0x46063b['moduleCreate'],_0x46063b[_0x64e9('0x65')]);})['then'](function(_0x4a0d1d){logger['info']('['+_0x4c085e[_0x64e9('0x18')]()+_0x64e9('0x66'),_0x4a0d1d['enduserId']);logger[_0x64e9('0x25')]('['+_0x4c085e[_0x64e9('0x18')]()+_0x64e9('0x67'),_0x1226e0[_0x64e9('0x2e')]);return getTicket(_0x4a0d1d,_0xf2787a,_0xbabf41,_0x46fe7b,_0x1226e0,_0x46063b,_0x4c085e);})['then'](function(_0x2b3bdc){logger[_0x64e9('0x25')](util['format']('['+_0x4c085e['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x46063b[_0x64e9('0x46')],_0x2b3bdc['ticketId']));logger[_0x64e9('0x25')](util[_0x64e9('0x52')]('['+_0x4c085e[_0x64e9('0x18')]()+_0x64e9('0x68'),_0x4c085e));if(_0x4c085e!==_0x64e9('0x5a')&&_0x46063b[_0x64e9('0x69')]){logger[_0x64e9('0x25')]('['+_0x4c085e[_0x64e9('0x18')]()+']',_0x64e9('0x6a'));emit(_0xf2787a[_0x64e9('0xd')],_0x441923[_0x64e9('0x6b')],_0x46063b['ticketType'],_0x2b3bdc['ticketId']);}})[_0x64e9('0x16')](function(_0x1b41c8){logger[_0x64e9('0x17')]('['+_0x4c085e['toUpperCase']()+_0x64e9('0x6c'),_0x1b41c8[_0x64e9('0x1a')]);console[_0x64e9('0x17')](_0x64e9('0x6d'),_0x1b41c8);});}; \ 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 bc94cc6..18b3f28 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 _0x9c24=['toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','lodash','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','localhost','socket.io-emitter','redis','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','custom_fields','value','format','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','length','map','forEach','string','nameField','toLowerCase','content','includes','picklist','type','idField','customField','variableName','push','Variable','name','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','Authorization','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','error','unmanaged','stripTrailingSlash','lastevent'];(function(_0x2a5a16,_0x1dc1e4){var _0x10ecaa=function(_0x4d7707){while(--_0x4d7707){_0x2a5a16['push'](_0x2a5a16['shift']());}};_0x10ecaa(++_0x1dc1e4);}(_0x9c24,0x1ca));var _0x49c2=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x9c24[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x49c2('0x0'));var rp=require('request-promise');var md5=require(_0x49c2('0x1'));var util=require(_0x49c2('0x2'));var Redis=require('ioredis');var intUtil=require(_0x49c2('0x3'));var config=require(_0x49c2('0x4'));var logger=require(_0x49c2('0x5'))(_0x49c2('0x6'));config['redis']=_[_0x49c2('0x7')](config['redis'],{'host':_0x49c2('0x8'),'port':0x18eb});var io=require(_0x49c2('0x9'))(new Redis(config[_0x49c2('0xa')]));var headers={'Content-Type':_0x49c2('0xb'),'Accept':_0x49c2('0xb')};function emit(_0x4e07ad,_0x2cec8d,_0x2b2894){io['to'](_0x4e07ad)[_0x49c2('0xc')](_0x2cec8d,_0x2b2894);}function getTicket(_0x2aa191,_0x6db5a8,_0x55bd32,_0x4e0c6b,_0x23e58f){logger[_0x49c2('0xd')](_0x49c2('0xe'));var _0xdd2ed6=_['merge']({'responder_id':_0x6db5a8['id'],'requester_id':_0x55bd32['id'],'name':util['format'](_0x49c2('0xf'),_0x23e58f[_0x49c2('0x10')]),'phone':_0x23e58f[_0x49c2('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x49c2('0x12')](_0x4e0c6b[_0x49c2('0x13')],_0x23e58f,'\x20'),'description':intUtil[_0x49c2('0x12')](_0x4e0c6b[_0x49c2('0x14')],_0x23e58f,_0x49c2('0x15')),'tags':getTags(_0x4e0c6b[_0x49c2('0x16')],'name')},getCustomFields(_0x4e0c6b['Fields'],_0x23e58f));_0xdd2ed6[_0x49c2('0x17')]=_['mapValues'](_['keyBy'](_0xdd2ed6[_0x49c2('0x17')],'id'),_0x49c2('0x18'));return request({'uri':util[_0x49c2('0x19')]('%s/api/v2/tickets',_0x2aa191[_0x49c2('0x1a')]),'method':_0x49c2('0x1b'),'body':_0xdd2ed6})[_0x49c2('0x1c')](function(_0x488377){logger['info'](_0x49c2('0x1d'));return _0x488377;});}function getUser(_0x50a044,_0x42fb88){if(intUtil[_0x49c2('0x1e')](_0x42fb88)){return request({'uri':util[_0x49c2('0x19')](_0x49c2('0x1f'),_0x50a044['remoteUri']),'qs':{'email':_0x42fb88}})['then'](function(_0x359b08){if(_0x359b08['length']){logger[_0x49c2('0xd')](_0x49c2('0x20'));return _['find'](_0x359b08,function(_0x3cead5){return _0x3cead5[_0x49c2('0x21')][_0x49c2('0x22')]===_0x42fb88;});}else{logger[_0x49c2('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x49c2('0x19')](_0x49c2('0x23'),_0x50a044[_0x49c2('0x1a')])})[_0x49c2('0x1c')](function(_0x553965){logger[_0x49c2('0xd')](_0x49c2('0x24'));return _0x553965;});}});}else{logger[_0x49c2('0xd')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x49c2('0x23'),_0x50a044[_0x49c2('0x1a')])})[_0x49c2('0x1c')](function(_0x54ab75){logger[_0x49c2('0xd')](_0x49c2('0x24'));return _0x54ab75;});}}function getEndUser(_0x3d1c0f,_0x52abff,_0x4917b5){logger[_0x49c2('0xd')](_0x49c2('0x25'),_0x4917b5);return request({'uri':util['format'](_0x49c2('0x26'),_0x3d1c0f['remoteUri']),'qs':{'phone':_0x4917b5}})[_0x49c2('0x1c')](function(_0x3ad705){if(_0x3ad705['length']){logger[_0x49c2('0xd')]('Enduser\x20found!');return _['find'](_0x3ad705,{'phone':_0x4917b5});}else{logger[_0x49c2('0xd')](_0x49c2('0x27'));return request({'uri':util[_0x49c2('0x19')](_0x49c2('0x26'),_0x3d1c0f[_0x49c2('0x1a')]),'method':_0x49c2('0x1b'),'body':{'name':_0x52abff,'phone':_0x4917b5}})[_0x49c2('0x1c')](function(_0x2a856f){logger[_0x49c2('0xd')](_0x49c2('0x28'));return _0x2a856f;});}});}function getAuth(_0x1c2e46){return util[_0x49c2('0x19')](_0x49c2('0x29'),new Buffer(_0x1c2e46[_0x49c2('0x2a')]+':X')[_0x49c2('0x2b')](_0x49c2('0x2c')));}function request(_0x55cb2f){logger['debug'](_0x49c2('0x2d'),JSON[_0x49c2('0x2e')](_0x55cb2f));return rp(_[_0x49c2('0x7')](_0x55cb2f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x41054a,_0x3fc77b){var _0x449a77=[];if(_0x41054a&&_0x41054a[_0x49c2('0x2f')]>0x0){_0x449a77=_[_0x49c2('0x30')](_0x41054a,_0x3fc77b);}return _0x449a77;}function getCustomFields(_0x426f9b,_0x34275b){var _0x57806b=[];var _0x337a83={'custom_fields':[]};if(_0x426f9b['length']>0x0){_[_0x49c2('0x31')](_0x426f9b,function(_0x1dee17){if(_['includes']([_0x49c2('0x32'),'picklist'],_0x1dee17['type'])&&_0x1dee17[_0x49c2('0x33')]&&!_0x1dee17['customField']){_0x337a83[_0x1dee17[_0x49c2('0x33')][_0x49c2('0x34')]()]=_0x1dee17[_0x49c2('0x35')]['toString']();}else if(_[_0x49c2('0x36')]([_0x49c2('0x32'),_0x49c2('0x37')],_0x1dee17[_0x49c2('0x38')])&&_0x1dee17[_0x49c2('0x39')]&&_0x1dee17[_0x49c2('0x3a')]){_0x337a83[_0x49c2('0x17')]['push']({'id':_0x1dee17[_0x49c2('0x39')],'value':_0x1dee17['content'][_0x49c2('0x2b')]()});}else if(_0x1dee17['type']==='variable'&&_0x1dee17[_0x49c2('0x3b')]&&_0x1dee17[_0x49c2('0x39')]&&_0x1dee17[_0x49c2('0x3a')]){_0x34275b[_0x1dee17[_0x49c2('0x3b')]]&&_0x337a83[_0x49c2('0x17')][_0x49c2('0x3c')]({'id':_0x1dee17[_0x49c2('0x39')],'value':_0x34275b[_0x1dee17[_0x49c2('0x3b')]][_0x49c2('0x2b')]()});}else if(_0x1dee17[_0x49c2('0x38')]==='customVariable'&&_0x1dee17[_0x49c2('0x3d')]&&_0x1dee17[_0x49c2('0x3d')][_0x49c2('0x3e')]&&_0x1dee17[_0x49c2('0x39')]&&_0x1dee17[_0x49c2('0x3a')]){_0x34275b[_0x1dee17[_0x49c2('0x3d')]['name'][_0x49c2('0x34')]()]&&_0x337a83['custom_fields'][_0x49c2('0x3c')]({'id':_0x1dee17[_0x49c2('0x39')],'value':_0x34275b[_0x1dee17[_0x49c2('0x3d')][_0x49c2('0x3e')][_0x49c2('0x34')]()][_0x49c2('0x2b')]()});}});}return _0x337a83;}exports[_0x49c2('0x3f')]=function(_0x1af7de,_0x34a644,_0x188f71,_0x2048d8,_0x328fbd,_0x1cc112){var _0x2697f6,_0x1ed67b;_0x1cc112[_0x49c2('0x1a')]=intUtil['stripTrailingSlash'](_0x1cc112['remoteUri']);_0x1cc112[_0x49c2('0x40')]=intUtil['stripTrailingSlash'](_0x1cc112[_0x49c2('0x40')]);if(_0x328fbd&&_0x328fbd[_0x49c2('0x41')]){logger[_0x49c2('0xd')](_0x49c2('0x42'),'Recording\x20is\x20enabled!');_0x34a644[_0x49c2('0x43')]=util[_0x49c2('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1cc112['serverUrl'],_0x34a644[_0x49c2('0x44')],md5(_0x34a644[_0x49c2('0x44')]));}else{_0x34a644[_0x49c2('0x43')]='';}headers[_0x49c2('0x45')]=getAuth(_0x1cc112);return getUser(_0x1cc112,_0x2048d8[_0x49c2('0x22')])[_0x49c2('0x1c')](function(_0x33a3c4){_0x2697f6=_0x33a3c4;logger[_0x49c2('0xd')]('The\x20User\x20ID\x20is:',_0x2697f6['id']);return getEndUser(_0x1cc112,_0x34a644[_0x49c2('0x10')],_0x34a644[_0x49c2('0x11')]);})['then'](function(_0x1c01e0){_0x1ed67b=_0x1c01e0;logger[_0x49c2('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1ed67b['id']);return getTicket(_0x1cc112,_0x2697f6,_0x1ed67b,_0x188f71,_0x34a644);})['then'](function(_0x166288){if(_0x166288&&_0x166288['id']){logger[_0x49c2('0xd')](_0x49c2('0x1d'));logger['info'](_0x49c2('0x46'),_0x166288['id']);logger[_0x49c2('0xd')]('[QUEUE]',_0x49c2('0x47'));emit(util[_0x49c2('0x19')](_0x49c2('0x48'),_0x2048d8['name']),_0x49c2('0x49'),{'uri':util[_0x49c2('0x19')](_0x49c2('0x4a'),_0x1cc112[_0x49c2('0x1a')],_0x166288['id'])});}})[_0x49c2('0x4b')](function(_0x3de123){logger['error'](_0x49c2('0x42'),JSON[_0x49c2('0x2e')](_0x3de123));});};exports[_0x49c2('0x4c')]=function(_0x3d346e,_0x13a3a0,_0x279549,_0x4dfca4,_0x1840b6,_0x54564b,_0x496e3a){var _0x2e5e18,_0x1249cf;_0x54564b['remoteUri']=intUtil['stripTrailingSlash'](_0x54564b[_0x49c2('0x1a')]);_0x54564b[_0x49c2('0x40')]=intUtil['stripTrailingSlash'](_0x54564b['serverUrl']);if(_0x496e3a&&_0x496e3a[_0x49c2('0x4d')]&&_0x496e3a['recordingFormat']!==_0x49c2('0x4e')){logger[_0x49c2('0xd')](_0x49c2('0x4f'),_0x49c2('0x50'));_0x13a3a0[_0x49c2('0x43')]=util[_0x49c2('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x54564b['serverUrl'],_0x13a3a0['uniqueid'],md5(_0x13a3a0[_0x49c2('0x44')]));}headers['Authorization']=getAuth(_0x54564b);return getUser(_0x54564b,_0x4dfca4[_0x49c2('0x22')])['then'](function(_0x17cdb1){_0x2e5e18=_0x17cdb1;logger['info']('The\x20User\x20ID\x20is:',_0x2e5e18['id']);return getEndUser(_0x54564b,_0x13a3a0[_0x49c2('0x51')],_0x13a3a0[_0x49c2('0x52')]);})[_0x49c2('0x1c')](function(_0x9427b2){_0x1249cf=_0x9427b2;logger[_0x49c2('0xd')](_0x49c2('0x53'),_0x1249cf['id']);return getTicket(_0x54564b,_0x2e5e18,_0x1249cf,_0x279549,_0x13a3a0);})['then'](function(_0x35558a){if(_0x35558a&&_0x35558a['id']){logger[_0x49c2('0xd')](_0x49c2('0x1d'));logger[_0x49c2('0xd')]('The\x20Ticket\x20ID\x20is:',_0x35558a['id']);logger[_0x49c2('0xd')]('[OUTBOUND]',_0x49c2('0x47'));emit(util[_0x49c2('0x19')](_0x49c2('0x48'),_0x4dfca4[_0x49c2('0x3e')]),_0x49c2('0x49'),{'uri':util[_0x49c2('0x19')](_0x49c2('0x4a'),_0x54564b['remoteUri'],_0x35558a['id'])});}})['catch'](function(_0x2ec9e6){logger[_0x49c2('0x54')](_0x49c2('0x4f'),JSON[_0x49c2('0x2e')](_0x2ec9e6));});};exports[_0x49c2('0x55')]=function(_0x11dde7,_0xcdfac,_0x2b3a31,_0x2ab712,_0x26a356,_0x32e8c4){var _0x471f8c,_0x304ca4;_0x32e8c4[_0x49c2('0x1a')]=intUtil[_0x49c2('0x56')](_0x32e8c4[_0x49c2('0x1a')]);_0x32e8c4[_0x49c2('0x40')]=intUtil['stripTrailingSlash'](_0x32e8c4[_0x49c2('0x40')]);if(_0x26a356&&_0x26a356['monitor_format']){logger['info']('['+_0xcdfac[_0x49c2('0x57')][_0x49c2('0x58')]()+']','Recording\x20is\x20enabled!');_0xcdfac[_0x49c2('0x43')]=util[_0x49c2('0x19')](_0x49c2('0x59'),_0x32e8c4[_0x49c2('0x40')],_0xcdfac[_0x49c2('0x44')],md5(_0xcdfac[_0x49c2('0x44')]));}else{_0xcdfac[_0x49c2('0x43')]='';}headers['Authorization']=getAuth(_0x32e8c4);return getUser(_0x32e8c4,'')[_0x49c2('0x1c')](function(_0x1c1dd3){_0x471f8c=_0x1c1dd3;logger[_0x49c2('0xd')](_0x49c2('0x5a'),_0x471f8c['id']);return getEndUser(_0x32e8c4,_0xcdfac[_0x49c2('0x10')],_0xcdfac['calleridnum']);})[_0x49c2('0x1c')](function(_0x12a5bf){_0x304ca4=_0x12a5bf;logger[_0x49c2('0xd')]('The\x20Enduser\x20ID\x20is:',_0x304ca4['id']);return getTicket(_0x32e8c4,_0x471f8c,_0x304ca4,_0x2b3a31,_0xcdfac);})[_0x49c2('0x1c')](function(_0x239d1c){if(_0x239d1c){logger[_0x49c2('0xd')](_0x49c2('0x1d'));logger[_0x49c2('0xd')](_0x49c2('0x46'),_0x239d1c['id']);}})[_0x49c2('0x4b')](function(_0x97d45a){logger['error']('['+_0xcdfac[_0x49c2('0x57')][_0x49c2('0x58')]()+']',JSON['stringify'](_0x97d45a));});}; \ No newline at end of file +var _0xb4f0=['validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variableName','push','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','recordingURL','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','user:%s','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','util','../../../../config/environment','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','POST','then','Ticket\x20created!'];(function(_0x188a28,_0x3018a9){var _0x5f3b63=function(_0x162f49){while(--_0x162f49){_0x188a28['push'](_0x188a28['shift']());}};_0x5f3b63(++_0x3018a9);}(_0xb4f0,0xfb));var _0x0b4f=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0xb4f0[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0x0b4f('0x0'));var rp=require(_0x0b4f('0x1'));var md5=require(_0x0b4f('0x2'));var util=require(_0x0b4f('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x0b4f('0x4'));var logger=require('../../../../config/logger')(_0x0b4f('0x5'));config[_0x0b4f('0x6')]=_['defaults'](config[_0x0b4f('0x6')],{'host':_0x0b4f('0x7'),'port':0x18eb});var io=require(_0x0b4f('0x8'))(new Redis(config[_0x0b4f('0x6')]));var headers={'Content-Type':_0x0b4f('0x9'),'Accept':_0x0b4f('0x9')};function emit(_0x5d1ff5,_0x449460,_0x3747b9){io['to'](_0x5d1ff5)[_0x0b4f('0xa')](_0x449460,_0x3747b9);}function getTicket(_0x57c45f,_0x22b320,_0x1b69aa,_0x175155,_0x329087){logger[_0x0b4f('0xb')](_0x0b4f('0xc'));var _0x5adf4e=_[_0x0b4f('0xd')]({'responder_id':_0x22b320['id'],'requester_id':_0x1b69aa['id'],'name':util[_0x0b4f('0xe')](_0x0b4f('0xf'),_0x329087[_0x0b4f('0x10')]),'phone':_0x329087['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x0b4f('0x11')](_0x175155[_0x0b4f('0x12')],_0x329087,'\x20'),'description':intUtil[_0x0b4f('0x11')](_0x175155[_0x0b4f('0x13')],_0x329087,_0x0b4f('0x14')),'tags':getTags(_0x175155[_0x0b4f('0x15')],_0x0b4f('0x16'))},getCustomFields(_0x175155[_0x0b4f('0x17')],_0x329087));_0x5adf4e['custom_fields']=_['mapValues'](_[_0x0b4f('0x18')](_0x5adf4e[_0x0b4f('0x19')],'id'),_0x0b4f('0x1a'));return request({'uri':util[_0x0b4f('0xe')](_0x0b4f('0x1b'),_0x57c45f['remoteUri']),'method':_0x0b4f('0x1c'),'body':_0x5adf4e})[_0x0b4f('0x1d')](function(_0x367896){logger[_0x0b4f('0xb')](_0x0b4f('0x1e'));return _0x367896;});}function getUser(_0x47fa3e,_0x1ab0af){if(intUtil[_0x0b4f('0x1f')](_0x1ab0af)){return request({'uri':util[_0x0b4f('0xe')](_0x0b4f('0x20'),_0x47fa3e['remoteUri']),'qs':{'email':_0x1ab0af}})[_0x0b4f('0x1d')](function(_0x2ddf4f){if(_0x2ddf4f[_0x0b4f('0x21')]){logger['info'](_0x0b4f('0x22'));return _[_0x0b4f('0x23')](_0x2ddf4f,function(_0x6d2c84){return _0x6d2c84[_0x0b4f('0x24')]['email']===_0x1ab0af;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x0b4f('0x25'),_0x47fa3e[_0x0b4f('0x26')])})[_0x0b4f('0x1d')](function(_0xf670ba){logger[_0x0b4f('0xb')](_0x0b4f('0x27'));return _0xf670ba;});}});}else{logger[_0x0b4f('0xb')](_0x0b4f('0x28'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x47fa3e[_0x0b4f('0x26')])})[_0x0b4f('0x1d')](function(_0x9b632a){logger['info'](_0x0b4f('0x27'));return _0x9b632a;});}}function getEndUser(_0x419ec0,_0x41e7d0,_0x1d003b){logger['info'](_0x0b4f('0x29'),_0x1d003b);return request({'uri':util[_0x0b4f('0xe')](_0x0b4f('0x2a'),_0x419ec0[_0x0b4f('0x26')]),'qs':{'phone':_0x1d003b}})[_0x0b4f('0x1d')](function(_0x44233a){if(_0x44233a[_0x0b4f('0x21')]){logger[_0x0b4f('0xb')]('Enduser\x20found!');return _[_0x0b4f('0x23')](_0x44233a,{'phone':_0x1d003b});}else{logger[_0x0b4f('0xb')](_0x0b4f('0x2b'));return request({'uri':util[_0x0b4f('0xe')](_0x0b4f('0x2a'),_0x419ec0['remoteUri']),'method':'POST','body':{'name':_0x41e7d0,'phone':_0x1d003b}})[_0x0b4f('0x1d')](function(_0x5b9853){logger[_0x0b4f('0xb')](_0x0b4f('0x2c'));return _0x5b9853;});}});}function getAuth(_0x4620cc){return util['format'](_0x0b4f('0x2d'),new Buffer(_0x4620cc[_0x0b4f('0x2e')]+':X')['toString'](_0x0b4f('0x2f')));}function request(_0x398220){logger[_0x0b4f('0x30')](_0x0b4f('0x31'),JSON[_0x0b4f('0x32')](_0x398220));return rp(_[_0x0b4f('0x33')](_0x398220,{'method':_0x0b4f('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x563797,_0x100c09){var _0x107ab9=[];if(_0x563797&&_0x563797[_0x0b4f('0x21')]>0x0){_0x107ab9=_[_0x0b4f('0x35')](_0x563797,_0x100c09);}return _0x107ab9;}function getCustomFields(_0x210ce4,_0x185b9b){var _0x3c664c=[];var _0x5a7e12={'custom_fields':[]};if(_0x210ce4[_0x0b4f('0x21')]>0x0){_[_0x0b4f('0x36')](_0x210ce4,function(_0x13a8c1){if(_[_0x0b4f('0x37')]([_0x0b4f('0x38'),_0x0b4f('0x39')],_0x13a8c1[_0x0b4f('0x3a')])&&_0x13a8c1[_0x0b4f('0x3b')]&&!_0x13a8c1['customField']){_0x5a7e12[_0x13a8c1['nameField'][_0x0b4f('0x3c')]()]=_0x13a8c1[_0x0b4f('0x3d')][_0x0b4f('0x3e')]();}else if(_[_0x0b4f('0x37')]([_0x0b4f('0x38'),_0x0b4f('0x39')],_0x13a8c1[_0x0b4f('0x3a')])&&_0x13a8c1[_0x0b4f('0x3f')]&&_0x13a8c1[_0x0b4f('0x40')]){_0x5a7e12['custom_fields']['push']({'id':_0x13a8c1[_0x0b4f('0x3f')],'value':_0x13a8c1[_0x0b4f('0x3d')]['toString']()});}else if(_0x13a8c1[_0x0b4f('0x3a')]==='variable'&&_0x13a8c1[_0x0b4f('0x41')]&&_0x13a8c1[_0x0b4f('0x3f')]&&_0x13a8c1[_0x0b4f('0x40')]){_0x185b9b[_0x13a8c1['variableName']]&&_0x5a7e12['custom_fields'][_0x0b4f('0x42')]({'id':_0x13a8c1['idField'],'value':_0x185b9b[_0x13a8c1[_0x0b4f('0x41')]][_0x0b4f('0x3e')]()});}else if(_0x13a8c1[_0x0b4f('0x3a')]==='customVariable'&&_0x13a8c1['Variable']&&_0x13a8c1[_0x0b4f('0x43')]['name']&&_0x13a8c1['idField']&&_0x13a8c1[_0x0b4f('0x40')]){_0x185b9b[_0x13a8c1[_0x0b4f('0x43')][_0x0b4f('0x16')]['toLowerCase']()]&&_0x5a7e12['custom_fields'][_0x0b4f('0x42')]({'id':_0x13a8c1['idField'],'value':_0x185b9b[_0x13a8c1[_0x0b4f('0x43')][_0x0b4f('0x16')]['toLowerCase']()][_0x0b4f('0x3e')]()});}});}return _0x5a7e12;}exports['queue']=function(_0x4e58c3,_0x1755fd,_0x25b5c5,_0x58110d,_0x1b41f7,_0x54debc){var _0x968bfd,_0x3a131f;_0x54debc['remoteUri']=intUtil['stripTrailingSlash'](_0x54debc[_0x0b4f('0x26')]);_0x54debc[_0x0b4f('0x44')]=intUtil[_0x0b4f('0x45')](_0x54debc['serverUrl']);if(_0x1b41f7&&_0x1b41f7[_0x0b4f('0x46')]){logger[_0x0b4f('0xb')](_0x0b4f('0x47'),_0x0b4f('0x48'));_0x1755fd['recordingURL']=util[_0x0b4f('0xe')](_0x0b4f('0x49'),_0x54debc[_0x0b4f('0x44')],_0x1755fd[_0x0b4f('0x4a')],md5(_0x1755fd[_0x0b4f('0x4a')]));}else{_0x1755fd['recordingURL']='';}headers[_0x0b4f('0x4b')]=getAuth(_0x54debc);return getUser(_0x54debc,_0x58110d['email'])[_0x0b4f('0x1d')](function(_0x3e533c){_0x968bfd=_0x3e533c;logger[_0x0b4f('0xb')]('The\x20User\x20ID\x20is:',_0x968bfd['id']);return getEndUser(_0x54debc,_0x1755fd['calleridname'],_0x1755fd[_0x0b4f('0x4c')]);})[_0x0b4f('0x1d')](function(_0x3c40f6){_0x3a131f=_0x3c40f6;logger[_0x0b4f('0xb')](_0x0b4f('0x4d'),_0x3a131f['id']);return getTicket(_0x54debc,_0x968bfd,_0x3a131f,_0x25b5c5,_0x1755fd);})[_0x0b4f('0x1d')](function(_0x11cd1c){if(_0x11cd1c&&_0x11cd1c['id']){logger[_0x0b4f('0xb')](_0x0b4f('0x1e'));logger[_0x0b4f('0xb')]('The\x20Ticket\x20ID\x20is:',_0x11cd1c['id']);logger['info']('[QUEUE]',_0x0b4f('0x4e'));emit(util[_0x0b4f('0xe')]('user:%s',_0x58110d[_0x0b4f('0x16')]),_0x0b4f('0x4f'),{'uri':util[_0x0b4f('0xe')]('%s/helpdesk/tickets/%d',_0x54debc[_0x0b4f('0x26')],_0x11cd1c['id'])});}})[_0x0b4f('0x50')](function(_0x1417fb){logger[_0x0b4f('0x51')]('[QUEUE]',JSON['stringify'](_0x1417fb));});};exports['outbound']=function(_0x48b901,_0x2c7bde,_0xd316d6,_0x2c846b,_0x1e0567,_0x3f8c70,_0x154cd9){var _0x5d9cc1,_0x2394f5;_0x3f8c70['remoteUri']=intUtil[_0x0b4f('0x45')](_0x3f8c70['remoteUri']);_0x3f8c70[_0x0b4f('0x44')]=intUtil['stripTrailingSlash'](_0x3f8c70[_0x0b4f('0x44')]);if(_0x154cd9&&_0x154cd9[_0x0b4f('0x52')]&&_0x154cd9[_0x0b4f('0x52')]!=='none'){logger['info'](_0x0b4f('0x53'),'Recording\x20is\x20enabled!');_0x2c7bde[_0x0b4f('0x54')]=util[_0x0b4f('0xe')](_0x0b4f('0x49'),_0x3f8c70['serverUrl'],_0x2c7bde['uniqueid'],md5(_0x2c7bde[_0x0b4f('0x4a')]));}headers[_0x0b4f('0x4b')]=getAuth(_0x3f8c70);return getUser(_0x3f8c70,_0x2c846b[_0x0b4f('0x55')])[_0x0b4f('0x1d')](function(_0x29d06d){_0x5d9cc1=_0x29d06d;logger[_0x0b4f('0xb')](_0x0b4f('0x56'),_0x5d9cc1['id']);return getEndUser(_0x3f8c70,_0x2c7bde[_0x0b4f('0x57')],_0x2c7bde[_0x0b4f('0x58')]);})[_0x0b4f('0x1d')](function(_0x2508ea){_0x2394f5=_0x2508ea;logger[_0x0b4f('0xb')](_0x0b4f('0x4d'),_0x2394f5['id']);return getTicket(_0x3f8c70,_0x5d9cc1,_0x2394f5,_0xd316d6,_0x2c7bde);})['then'](function(_0xf7c0f5){if(_0xf7c0f5&&_0xf7c0f5['id']){logger[_0x0b4f('0xb')](_0x0b4f('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xf7c0f5['id']);logger['info'](_0x0b4f('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0b4f('0xe')](_0x0b4f('0x59'),_0x2c846b[_0x0b4f('0x16')]),_0x0b4f('0x4f'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x3f8c70[_0x0b4f('0x26')],_0xf7c0f5['id'])});}})[_0x0b4f('0x50')](function(_0x2e7920){logger[_0x0b4f('0x51')]('[OUTBOUND]',JSON[_0x0b4f('0x32')](_0x2e7920));});};exports[_0x0b4f('0x5a')]=function(_0x59231e,_0x1bf7de,_0x439d26,_0x16bb64,_0x2662d0,_0x46062e){var _0x5ce069,_0x1ce019;_0x46062e[_0x0b4f('0x26')]=intUtil[_0x0b4f('0x45')](_0x46062e['remoteUri']);_0x46062e[_0x0b4f('0x44')]=intUtil[_0x0b4f('0x45')](_0x46062e[_0x0b4f('0x44')]);if(_0x2662d0&&_0x2662d0[_0x0b4f('0x46')]){logger[_0x0b4f('0xb')]('['+_0x1bf7de[_0x0b4f('0x5b')][_0x0b4f('0x5c')]()+']',_0x0b4f('0x48'));_0x1bf7de[_0x0b4f('0x54')]=util[_0x0b4f('0xe')](_0x0b4f('0x49'),_0x46062e[_0x0b4f('0x44')],_0x1bf7de[_0x0b4f('0x4a')],md5(_0x1bf7de['uniqueid']));}else{_0x1bf7de[_0x0b4f('0x54')]='';}headers[_0x0b4f('0x4b')]=getAuth(_0x46062e);return getUser(_0x46062e,'')['then'](function(_0x35f42c){_0x5ce069=_0x35f42c;logger['info']('The\x20User\x20ID\x20is:',_0x5ce069['id']);return getEndUser(_0x46062e,_0x1bf7de[_0x0b4f('0x10')],_0x1bf7de[_0x0b4f('0x4c')]);})[_0x0b4f('0x1d')](function(_0x52ee9f){_0x1ce019=_0x52ee9f;logger[_0x0b4f('0xb')](_0x0b4f('0x4d'),_0x1ce019['id']);return getTicket(_0x46062e,_0x5ce069,_0x1ce019,_0x439d26,_0x1bf7de);})[_0x0b4f('0x1d')](function(_0x49a1a6){if(_0x49a1a6){logger['info']('Ticket\x20created!');logger[_0x0b4f('0xb')](_0x0b4f('0x5d'),_0x49a1a6['id']);}})['catch'](function(_0x23183e){logger['error']('['+_0x1bf7de[_0x0b4f('0x5b')][_0x0b4f('0x5c')]()+']',JSON[_0x0b4f('0x32')](_0x23183e));});}; \ 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 e4f7800..a3931d2 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 _0xd79c=['./util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','GET','/api/selector/owners','headers','info','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','User\x20found:','userId','error','toUpperCase','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Subjects','Descriptions','Contact','add','Task\x20created:','ticketId','user:%s','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis'];(function(_0x34edec,_0x228935){var _0x2d276d=function(_0x1e1888){while(--_0x1e1888){_0x34edec['push'](_0x34edec['shift']());}};_0x2d276d(++_0x228935);}(_0xd79c,0xee));var _0xcd79=function(_0x2c6249,_0x4fc5d1){_0x2c6249=_0x2c6249-0x0;var _0x2eae85=_0xd79c[_0x2c6249];return _0x2eae85;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xcd79('0x0'));var util=require(_0xcd79('0x1'));var moment=require(_0xcd79('0x2'));var Promise=require(_0xcd79('0x3'));var Redis=require(_0xcd79('0x4'));var intUtil=require(_0xcd79('0x5'));var config=require(_0xcd79('0x6'));var logger=require(_0xcd79('0x7'))('freshsales');config['redis']=_[_0xcd79('0x8')](config['redis'],{'host':_0xcd79('0x9'),'port':0x18eb});var io=require(_0xcd79('0xa'))(new Redis(config[_0xcd79('0xb')]));function getAdminId(_0x226a7f,_0x3b00fa,_0x29ead1,_0x27652a){return new Promise(function(_0x2012bf,_0x5a2c63){var _0x3de8b0=![];var _0x412dca={'method':_0xcd79('0xc'),'uri':_0x27652a+_0xcd79('0xd'),'json':!![]};_0x412dca[_0xcd79('0xe')]=_0x29ead1;logger[_0xcd79('0xf')]('Getting\x20admin\x20information');return rp(_0x412dca)['then'](function(_0x58c18a){if(_0x58c18a){var _0x137056=_0x58c18a[_0xcd79('0x10')];var _0x10202b=null;for(_0x10202b=0x0;_0x10202b<_0x137056['length'];_0x10202b++){if(_0x137056[_0x10202b][_0xcd79('0x11')]===_0x226a7f[_0xcd79('0x12')]){_0x226a7f[_0xcd79('0x13')]=_0x137056[_0x10202b]['id'];_0x3de8b0=!![];}}if(_0x3de8b0){logger[_0xcd79('0xf')](_0xcd79('0x14'),_0x226a7f['adminId']);_0x2012bf(_0x226a7f);}else{_0x5a2c63({'statusCode':0x194,'message':_0xcd79('0x15')});}}else{_0x5a2c63({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xcd79('0x16')](function(_0x1aeba2){logger['error']('['+[_0x3b00fa['toUpperCase']()]+']',_0x1aeba2[_0xcd79('0x17')]);_0x5a2c63(_0x1aeba2);});});}function getUser(_0x40f2ac,_0x6b75dd,_0x3968f5){return function(_0x4945d0){return new Promise(function(_0x49b053,_0xc7d174){var _0x2258ff={'method':_0xcd79('0xc'),'uri':_0x3968f5+_0xcd79('0xd'),'json':!![]};_0x2258ff[_0xcd79('0xe')]=_0x6b75dd;logger['info'](_0xcd79('0x18'));return rp(_0x2258ff)[_0xcd79('0x19')](function(_0x51c64a){if(_0x51c64a){var _0x5e0bff=_0x51c64a[_0xcd79('0x10')];var _0x1a280f=![];var _0x24edcc=null;if(_0x4945d0[_0xcd79('0x1a')]!==null){logger['info'](_0xcd79('0x1b'),_0x4945d0[_0xcd79('0x1a')]);_0x4945d0[_0xcd79('0x1c')]=_0x4945d0[_0xcd79('0x1a')];for(_0x24edcc=0x0;_0x24edcc<_0x5e0bff[_0xcd79('0x1d')];_0x24edcc++){if(_0x5e0bff[_0x24edcc][_0xcd79('0x11')]===_0x4945d0[_0xcd79('0x1a')]){_0x1a280f=!![];_0x4945d0['userId']=_0x5e0bff[_0x24edcc]['id'];logger[_0xcd79('0xf')](_0xcd79('0x1e'),_0x4945d0[_0xcd79('0x1f')]);}}}if(!_0x1a280f){logger[_0xcd79('0xf')]('Admin\x20selected');_0x4945d0[_0xcd79('0x1c')]=_0x4945d0[_0xcd79('0x12')];_0x4945d0[_0xcd79('0x1f')]=_0x4945d0[_0xcd79('0x13')];_0x1a280f=!![];}if(_0x1a280f){_0x49b053(_0x4945d0);}else{_0xc7d174({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xc7d174({'statusCode':0x194,'message':_0xcd79('0x15')});}})['catch'](function(_0x57f887){logger[_0xcd79('0x20')]('['+[_0x40f2ac[_0xcd79('0x21')]()]+']',_0x57f887[_0xcd79('0x17')]);_0xc7d174(_0x57f887);});});};}function searchContact(_0x519f7b,_0x3c9615,_0x91067d,_0x3f7807){return new Promise(function(_0x34c120,_0x26e4ad){var _0xd7b9a8={'method':_0xcd79('0xc'),'headers':_0x3c9615,'uri':_0x519f7b+_0xcd79('0x22')+_0x3f7807+'&f='+_0x91067d+_0xcd79('0x23'),'json':!![]};rp(_0xd7b9a8)[_0xcd79('0x19')](function(_0x173db4){var _0x4ff156=_[_0xcd79('0x24')](_0x173db4[_0xcd79('0x25')][_0xcd79('0x25')],[_0x91067d,_0x3f7807]);_0x34c120(_0x4ff156);})[_0xcd79('0x16')](function(_0x2864a1){_0x26e4ad(_0x2864a1);});});}function getEndUser(_0x1397f7,_0x59699b,_0x21ee85){return function(_0x3ff30c){return new Promise(function(_0x29ac6a,_0x141cfc){logger[_0xcd79('0xf')](util[_0xcd79('0x26')](_0xcd79('0x27'),_0x3ff30c[_0xcd79('0x28')]));searchContact(_0x21ee85,_0x59699b,_0xcd79('0x29'),_0x3ff30c[_0xcd79('0x28')])[_0xcd79('0x19')](function(_0x4c9d6d){if(_0x4c9d6d){_0x3ff30c[_0xcd79('0x2a')]=_0x4c9d6d['id'];logger[_0xcd79('0xf')](_0xcd79('0x2b'),_0x3ff30c[_0xcd79('0x2a')]);return _0x29ac6a(_0x3ff30c);}searchContact(_0x21ee85,_0x59699b,_0xcd79('0x2c'),_0x3ff30c[_0xcd79('0x28')])['then'](function(_0x596680){if(_0x596680){_0x3ff30c['endUserId']=_0x596680['id'];logger[_0xcd79('0xf')]('Contact\x20found\x20work_number:',_0x3ff30c[_0xcd79('0x2a')]);return _0x29ac6a(_0x3ff30c);}createEndUser(_0x3ff30c,_0x1397f7,_0x59699b,_0x21ee85)[_0xcd79('0x19')](function(_0xec62f1){logger['info'](_0xcd79('0x2d'),_0xec62f1[_0xcd79('0x2a')]);return _0x29ac6a(_0xec62f1);});});})['catch'](function(_0x1ac174){_0x141cfc(_0x1ac174);});});};}function createEndUser(_0xdf0377,_0x42fe96,_0x631ab7,_0x3727cd){return new Promise(function(_0xa00da6,_0x255645){var _0x4b4d7d=moment();var _0x1cc761={'method':_0xcd79('0x2e'),'uri':_0x3727cd+_0xcd79('0x2f'),'body':{'contact':{'last_name':_0xdf0377['contactNumber'],'work_number':_0xdf0377[_0xcd79('0x28')],'mobile_number':_0xdf0377[_0xcd79('0x28')],'owner_id':_0xdf0377[_0xcd79('0x1f')],'created_at':_0x4b4d7d[_0xcd79('0x26')](_0xcd79('0x30'))}},'json':!![]};_0x1cc761[_0xcd79('0xe')]=_0x631ab7;logger['info'](_0xcd79('0x31'));return rp(_0x1cc761)['then'](function(_0x22f4aa){_0xdf0377['endUserId']=_0x22f4aa[_0xcd79('0x32')]['id'];_0xa00da6(_0xdf0377);})['catch'](function(_0x411803){logger[_0xcd79('0x20')]('['+[_0x42fe96['toUpperCase']()]+']',_0x411803[_0xcd79('0x17')]);_0x255645(_0x411803[_0xcd79('0x17')]);});});}function getTicket(_0x1a4168,_0x49a7d4,_0xd47d7b,_0x41a774,_0x359931){return function(_0x146683){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x111089,_0x1b0294){var _0x2075da=moment();var _0x1ed2fb={'method':_0xcd79('0x2e'),'uri':_0xd47d7b+'/api/tasks','body':{'title':intUtil[_0xcd79('0x33')](_0x41a774[_0xcd79('0x34')],_0x359931,'\x20'),'description':intUtil[_0xcd79('0x33')](_0x41a774[_0xcd79('0x35')],_0x359931,'\x0a'),'owner_id':_0x146683[_0xcd79('0x1f')],'creater_id':_0x146683[_0xcd79('0x13')],'targetable_id':_0x146683[_0xcd79('0x2a')],'targetable_type':_0xcd79('0x36'),'created_at':_0x2075da[_0xcd79('0x26')](_0xcd79('0x30')),'due_date':_0x2075da[_0xcd79('0x37')](0x1e,'m')[_0xcd79('0x26')](_0xcd79('0x30'))},'json':!![]};_0x1ed2fb[_0xcd79('0xe')]=_0x49a7d4;return rp(_0x1ed2fb)[_0xcd79('0x19')](function(_0x5cef7a){_0x146683['ticketId']=_0x5cef7a['task']['id'];logger[_0xcd79('0xf')](_0xcd79('0x38'),_0x146683[_0xcd79('0x39')]);_0x111089(_0x146683);})['catch'](function(_0xce4ab8){logger[_0xcd79('0x20')]('['+[_0x1a4168[_0xcd79('0x21')]()]+']',_0xce4ab8[_0xcd79('0x17')]);_0x1b0294(_0xce4ab8['message']);});});};}function emit(_0x23c028,_0x43b155,_0x3c0c1d){var _0x3bdfa7={'uri':_0x23c028+'/contacts/'+_0x3c0c1d};io['to'](util[_0xcd79('0x26')](_0xcd79('0x3a'),_0x43b155))['emit']('trigger:browser:url',_0x3bdfa7);}exports['cs']=function(_0x4b4f36,_0x32f642,_0x5b0679,_0x35fa5,_0x14577f,_0x1bba6b,_0x100f42,_0xcdda18){var _0x4f390f={};var _0x539f96={'Authorization':_0xcd79('0x3b')+_0x1bba6b['apiKey']};_0x1bba6b[_0xcd79('0x3c')]=intUtil[_0xcd79('0x3d')](_0x1bba6b['remoteUri']);_0x1bba6b[_0xcd79('0x3e')]=intUtil['stripTrailingSlash'](_0x1bba6b[_0xcd79('0x3e')]);var _0x5e251c=_0x1bba6b[_0xcd79('0x3c')];_0x4f390f[_0xcd79('0x12')]=_0x1bba6b[_0xcd79('0x3f')];_0x4f390f['contactNumber']=_0xcdda18[_0xcd79('0x40')]()===_0xcd79('0x41')?_0x32f642['destcalleridnum']:_0x32f642[_0xcd79('0x42')];_0x4f390f[_0xcd79('0x43')]=_0xcdda18===_0xcd79('0x44')||_0xcdda18===_0xcd79('0x45')?_0xcd79('0x44'):_0xcd79('0x41');if(_0x35fa5){_0x4f390f['agentEmail']=_0x35fa5[_0xcd79('0x11')];}var _0x2bee61=util[_0xcd79('0x26')](_0xcd79('0x46'),_0x1bba6b[_0xcd79('0x3e')],_0x32f642[_0xcd79('0x47')],md5(_0x32f642['uniqueid']));if(_0x14577f&&_0x14577f['monitor_format']){logger['info'](_0xcd79('0x48'),_0xcd79('0x49'));_0x32f642['recordingURL']=_0x2bee61;}else if(_0x100f42&&_0x100f42[_0xcd79('0x4a')]&&_0x100f42[_0xcd79('0x4a')]!==_0xcd79('0x4b')){logger[_0xcd79('0xf')](_0xcd79('0x4c'),_0xcd79('0x49'));_0x32f642[_0xcd79('0x4d')]=_0x2bee61;}else{_0x32f642[_0xcd79('0x4d')]='';}return getAdminId(_0x4f390f,_0xcdda18,_0x539f96,_0x5e251c)[_0xcd79('0x19')](getUser(_0xcdda18,_0x539f96,_0x5e251c))[_0xcd79('0x19')](getEndUser(_0xcdda18,_0x539f96,_0x5e251c))[_0xcd79('0x19')](getTicket(_0xcdda18,_0x539f96,_0x5e251c,_0x5b0679,_0x32f642))[_0xcd79('0x19')](function(_0x3133d9){logger[_0xcd79('0xf')](util[_0xcd79('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3133d9[_0xcd79('0x39')]));if(_0xcdda18!==_0xcd79('0x45')){logger['info']('['+[_0xcdda18[_0xcd79('0x21')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x5e251c,_0x35fa5[_0xcd79('0x4e')],_0x3133d9['endUserId']);}})[_0xcd79('0x16')](function(_0x66ede0){logger[_0xcd79('0x20')]('['+[_0xcdda18[_0xcd79('0x21')]()]+_0xcd79('0x4f'),util[_0xcd79('0x50')](_0x66ede0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2151=['Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','userEmail','toUpperCase','&f=','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','user:%s','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','name','inspect','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','info'];(function(_0x17bf4e,_0x43e95b){var _0x3156ce=function(_0x1cece4){while(--_0x1cece4){_0x17bf4e['push'](_0x17bf4e['shift']());}};_0x3156ce(++_0x43e95b);}(_0x2151,0xe3));var _0x1215=function(_0x4eeaa5,_0x5b9da2){_0x4eeaa5=_0x4eeaa5-0x0;var _0x23ba49=_0x2151[_0x4eeaa5];return _0x23ba49;};'use strict';var _=require(_0x1215('0x0'));var rp=require(_0x1215('0x1'));var md5=require(_0x1215('0x2'));var util=require(_0x1215('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x1215('0x4'));var intUtil=require(_0x1215('0x5'));var config=require(_0x1215('0x6'));var logger=require(_0x1215('0x7'))(_0x1215('0x8'));config['redis']=_[_0x1215('0x9')](config[_0x1215('0xa')],{'host':_0x1215('0xb'),'port':0x18eb});var io=require(_0x1215('0xc'))(new Redis(config[_0x1215('0xa')]));function getAdminId(_0x248146,_0x393e53,_0x825a7,_0x31ca4a){return new Promise(function(_0x5a63ee,_0x33cd4d){var _0x2c7cc0=![];var _0x38f92b={'method':_0x1215('0xd'),'uri':_0x31ca4a+_0x1215('0xe'),'json':!![]};_0x38f92b['headers']=_0x825a7;logger[_0x1215('0xf')](_0x1215('0x10'));return rp(_0x38f92b)[_0x1215('0x11')](function(_0x290af6){if(_0x290af6){var _0x520e14=_0x290af6[_0x1215('0x12')];var _0x5e81f0=null;for(_0x5e81f0=0x0;_0x5e81f0<_0x520e14[_0x1215('0x13')];_0x5e81f0++){if(_0x520e14[_0x5e81f0][_0x1215('0x14')]===_0x248146[_0x1215('0x15')]){_0x248146[_0x1215('0x16')]=_0x520e14[_0x5e81f0]['id'];_0x2c7cc0=!![];}}if(_0x2c7cc0){logger[_0x1215('0xf')]('Admin\x20found:',_0x248146[_0x1215('0x16')]);_0x5a63ee(_0x248146);}else{_0x33cd4d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x33cd4d({'statusCode':0x194,'message':_0x1215('0x17')});}})[_0x1215('0x18')](function(_0xb00131){logger[_0x1215('0x19')]('['+[_0x393e53['toUpperCase']()]+']',_0xb00131['message']);_0x33cd4d(_0xb00131);});});}function getUser(_0x4847dd,_0xac48a4,_0x45e045){return function(_0x3d446b){return new Promise(function(_0x4bc514,_0x3a5f36){var _0x2b4188={'method':_0x1215('0xd'),'uri':_0x45e045+'/api/selector/owners','json':!![]};_0x2b4188[_0x1215('0x1a')]=_0xac48a4;logger[_0x1215('0xf')](_0x1215('0x1b'));return rp(_0x2b4188)[_0x1215('0x11')](function(_0x1992aa){if(_0x1992aa){var _0x1313a7=_0x1992aa[_0x1215('0x12')];var _0x47c653=![];var _0x1a7987=null;if(_0x3d446b[_0x1215('0x1c')]!==null){logger[_0x1215('0xf')](_0x1215('0x1d'),_0x3d446b['agentEmail']);_0x3d446b['userEmail']=_0x3d446b[_0x1215('0x1c')];for(_0x1a7987=0x0;_0x1a7987<_0x1313a7[_0x1215('0x13')];_0x1a7987++){if(_0x1313a7[_0x1a7987]['email']===_0x3d446b[_0x1215('0x1c')]){_0x47c653=!![];_0x3d446b[_0x1215('0x1e')]=_0x1313a7[_0x1a7987]['id'];logger[_0x1215('0xf')](_0x1215('0x1f'),_0x3d446b[_0x1215('0x1e')]);}}}if(!_0x47c653){logger[_0x1215('0xf')](_0x1215('0x20'));_0x3d446b[_0x1215('0x21')]=_0x3d446b[_0x1215('0x15')];_0x3d446b[_0x1215('0x1e')]=_0x3d446b['adminId'];_0x47c653=!![];}if(_0x47c653){_0x4bc514(_0x3d446b);}else{_0x3a5f36({'statusCode':0x194,'message':_0x1215('0x17')});}}else{_0x3a5f36({'statusCode':0x194,'message':_0x1215('0x17')});}})['catch'](function(_0x2bffeb){logger[_0x1215('0x19')]('['+[_0x4847dd[_0x1215('0x22')]()]+']',_0x2bffeb['message']);_0x3a5f36(_0x2bffeb);});});};}function searchContact(_0x217cc6,_0xe2efcf,_0x1cdd91,_0x56195f){return new Promise(function(_0x513479,_0x2adc49){var _0x108ac1={'method':_0x1215('0xd'),'headers':_0xe2efcf,'uri':_0x217cc6+'/api/lookup?q='+_0x56195f+_0x1215('0x23')+_0x1cdd91+'&entities=contact','json':!![]};rp(_0x108ac1)[_0x1215('0x11')](function(_0x28dc5c){var _0x2a5379=_[_0x1215('0x24')](_0x28dc5c['contacts'][_0x1215('0x25')],[_0x1cdd91,_0x56195f]);_0x513479(_0x2a5379);})['catch'](function(_0x545d82){_0x2adc49(_0x545d82);});});}function getEndUser(_0x6a862f,_0x185914,_0x35df72){return function(_0x327b56){return new Promise(function(_0x4fec83,_0x1808d3){logger[_0x1215('0xf')](util[_0x1215('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x327b56[_0x1215('0x27')]));searchContact(_0x35df72,_0x185914,_0x1215('0x28'),_0x327b56[_0x1215('0x27')])['then'](function(_0x2e62c8){if(_0x2e62c8){_0x327b56[_0x1215('0x29')]=_0x2e62c8['id'];logger[_0x1215('0xf')](_0x1215('0x2a'),_0x327b56[_0x1215('0x29')]);return _0x4fec83(_0x327b56);}searchContact(_0x35df72,_0x185914,_0x1215('0x2b'),_0x327b56[_0x1215('0x27')])[_0x1215('0x11')](function(_0x366e3d){if(_0x366e3d){_0x327b56[_0x1215('0x29')]=_0x366e3d['id'];logger[_0x1215('0xf')](_0x1215('0x2c'),_0x327b56['endUserId']);return _0x4fec83(_0x327b56);}createEndUser(_0x327b56,_0x6a862f,_0x185914,_0x35df72)['then'](function(_0x4126f1){logger[_0x1215('0xf')](_0x1215('0x2d'),_0x4126f1[_0x1215('0x29')]);return _0x4fec83(_0x4126f1);});});})[_0x1215('0x18')](function(_0x4ee9ee){_0x1808d3(_0x4ee9ee);});});};}function createEndUser(_0x46b500,_0x309281,_0x39ad38,_0x1edc8c){return new Promise(function(_0xfd87c7,_0x39ddcf){var _0x486cb7=moment();var _0x30e637={'method':_0x1215('0x2e'),'uri':_0x1edc8c+'/api/contacts','body':{'contact':{'last_name':_0x46b500['contactNumber'],'work_number':_0x46b500[_0x1215('0x27')],'mobile_number':_0x46b500[_0x1215('0x27')],'owner_id':_0x46b500[_0x1215('0x1e')],'created_at':_0x486cb7['format'](_0x1215('0x2f'))}},'json':!![]};_0x30e637[_0x1215('0x1a')]=_0x39ad38;logger[_0x1215('0xf')](_0x1215('0x30'));return rp(_0x30e637)[_0x1215('0x11')](function(_0x347a2b){_0x46b500[_0x1215('0x29')]=_0x347a2b[_0x1215('0x31')]['id'];_0xfd87c7(_0x46b500);})['catch'](function(_0x3ed1c2){logger[_0x1215('0x19')]('['+[_0x309281[_0x1215('0x22')]()]+']',_0x3ed1c2[_0x1215('0x32')]);_0x39ddcf(_0x3ed1c2[_0x1215('0x32')]);});});}function getTicket(_0x1fc21c,_0x36cd73,_0x297403,_0x52ed93,_0x37b7c4){return function(_0x1ba4b0){logger[_0x1215('0xf')](_0x1215('0x33'));return new Promise(function(_0x4d2df6,_0x2362fa){var _0x1fb800=moment();var _0x38a512={'method':_0x1215('0x2e'),'uri':_0x297403+_0x1215('0x34'),'body':{'title':intUtil[_0x1215('0x35')](_0x52ed93[_0x1215('0x36')],_0x37b7c4,'\x20'),'description':intUtil[_0x1215('0x35')](_0x52ed93['Descriptions'],_0x37b7c4,'\x0a'),'owner_id':_0x1ba4b0[_0x1215('0x1e')],'creater_id':_0x1ba4b0['adminId'],'targetable_id':_0x1ba4b0[_0x1215('0x29')],'targetable_type':_0x1215('0x37'),'created_at':_0x1fb800['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1fb800[_0x1215('0x38')](0x1e,'m')[_0x1215('0x26')](_0x1215('0x2f'))},'json':!![]};_0x38a512[_0x1215('0x1a')]=_0x36cd73;return rp(_0x38a512)[_0x1215('0x11')](function(_0x4f3bd3){_0x1ba4b0[_0x1215('0x39')]=_0x4f3bd3[_0x1215('0x3a')]['id'];logger[_0x1215('0xf')]('Task\x20created:',_0x1ba4b0[_0x1215('0x39')]);_0x4d2df6(_0x1ba4b0);})['catch'](function(_0x2eca3b){logger[_0x1215('0x19')]('['+[_0x1fc21c[_0x1215('0x22')]()]+']',_0x2eca3b['message']);_0x2362fa(_0x2eca3b[_0x1215('0x32')]);});});};}function emit(_0x4384c4,_0x4b58e5,_0x241fbc){var _0x10171b={'uri':_0x4384c4+'/contacts/'+_0x241fbc};io['to'](util[_0x1215('0x26')](_0x1215('0x3b'),_0x4b58e5))['emit'](_0x1215('0x3c'),_0x10171b);}exports['cs']=function(_0x52ead4,_0x26001c,_0x547001,_0x3ee436,_0x514dd4,_0x3bf0a7,_0x21fbb6,_0x4525ca){var _0x3b5405={};var _0x59d2c9={'Authorization':'Token\x20token='+_0x3bf0a7[_0x1215('0x3d')]};_0x3bf0a7[_0x1215('0x3e')]=intUtil[_0x1215('0x3f')](_0x3bf0a7[_0x1215('0x3e')]);_0x3bf0a7[_0x1215('0x40')]=intUtil[_0x1215('0x3f')](_0x3bf0a7[_0x1215('0x40')]);var _0x3e3ce6=_0x3bf0a7['remoteUri'];_0x3b5405['adminEmail']=_0x3bf0a7[_0x1215('0x41')];_0x3b5405[_0x1215('0x27')]=_0x4525ca[_0x1215('0x42')]()===_0x1215('0x43')?_0x26001c[_0x1215('0x44')]:_0x26001c['calleridnum'];_0x3b5405[_0x1215('0x45')]=_0x4525ca===_0x1215('0x46')||_0x4525ca===_0x1215('0x47')?_0x1215('0x46'):_0x1215('0x43');if(_0x3ee436){_0x3b5405[_0x1215('0x1c')]=_0x3ee436[_0x1215('0x14')];}var _0x2741e2=util[_0x1215('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3bf0a7['serverUrl'],_0x26001c['uniqueid'],md5(_0x26001c[_0x1215('0x48')]));if(_0x514dd4&&_0x514dd4[_0x1215('0x49')]){logger[_0x1215('0xf')]('[QUEUE]',_0x1215('0x4a'));_0x26001c[_0x1215('0x4b')]=_0x2741e2;}else if(_0x21fbb6&&_0x21fbb6[_0x1215('0x4c')]&&_0x21fbb6[_0x1215('0x4c')]!==_0x1215('0x4d')){logger[_0x1215('0xf')]('[OUTBOUND]',_0x1215('0x4a'));_0x26001c['recordingURL']=_0x2741e2;}else{_0x26001c[_0x1215('0x4b')]='';}return getAdminId(_0x3b5405,_0x4525ca,_0x59d2c9,_0x3e3ce6)[_0x1215('0x11')](getUser(_0x4525ca,_0x59d2c9,_0x3e3ce6))[_0x1215('0x11')](getEndUser(_0x4525ca,_0x59d2c9,_0x3e3ce6))[_0x1215('0x11')](getTicket(_0x4525ca,_0x59d2c9,_0x3e3ce6,_0x547001,_0x26001c))[_0x1215('0x11')](function(_0x130268){logger['info'](util['format'](_0x1215('0x4e'),_0x130268[_0x1215('0x39')]));if(_0x4525ca!==_0x1215('0x47')){logger[_0x1215('0xf')]('['+[_0x4525ca[_0x1215('0x22')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3e3ce6,_0x3ee436[_0x1215('0x4f')],_0x130268[_0x1215('0x29')]);}})['catch'](function(_0x5e8c5e){logger[_0x1215('0x19')]('['+[_0x4525ca[_0x1215('0x22')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x1215('0x50')](_0x5e8c5e,{'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 15eaaa8..cfefdf3 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 _0x9637=['unmanaged','data1','zoho','servicenow','log','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','error','format','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','exec','includes','toLowerCase','queue','routeId','outbound','EVENT\x20UNKNOWN'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x9637,0x1bb));var _0x7963=function(_0x41fd6b,_0x462549){_0x41fd6b=_0x41fd6b-0x0;var _0x7dc11e=_0x9637[_0x41fd6b];return _0x7dc11e;};'use strict';var _=require('lodash');var util=require(_0x7963('0x0'));var zendesk=require(_0x7963('0x1'));var salesforce=require(_0x7963('0x2'));var sugarcrm=require(_0x7963('0x3'));var freshdesk=require(_0x7963('0x4'));var zoho=require(_0x7963('0x5'));var desk=require(_0x7963('0x6'));var vtiger=require(_0x7963('0x7'));var servicenow=require(_0x7963('0x8'));var dynamics365=require(_0x7963('0x9'));var freshsales=require('./freshsales');var integrations=[_0x7963('0xa'),_0x7963('0xb'),_0x7963('0xc'),_0x7963('0xd'),'zoho',_0x7963('0xe'),_0x7963('0xf'),_0x7963('0x10'),_0x7963('0x11'),'servicenow'];exports[_0x7963('0x12')]=function(_0x5b612a,_0x44e4ea,_0x2804f7,_0x378a4b,_0xe85e02,_0x3d310d){if(_0x2804f7){if(_[_0x7963('0x13')](integrations,_0x5b612a['data1'][_0x7963('0x14')]())){try{var _0xa4f874=null;var _0x4d755e='';var _0x39a22e=_0x2804f7[_0x5b612a['data1']['toLowerCase']()];if(_0x39a22e){var _0x183dd4=_0x39a22e[_0x5b612a['data2']];if(_0x183dd4){var _0x2e1f39=_['find'](_0x183dd4['Configurations'],{'id':parseInt(_0x5b612a['data3'],0xa)});if(_0x2e1f39){if(_0x378a4b){if(_0xe85e02&&_0x44e4ea[_0x7963('0x15')]){_0x4d755e=_0x7963('0x15');}else if(_0x44e4ea[_0x7963('0x16')]){_0x4d755e=_0x7963('0x17');}else{console['log'](_0x7963('0x18'),_0x44e4ea);}}else{_0x4d755e=_0x7963('0x19');}switch(_0x5b612a[_0x7963('0x1a')][_0x7963('0x14')]()){case _0x7963('0xa'):zendesk[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0xb'):salesforce[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0xc'):sugarcrm[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case'freshdesk':freshdesk[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0x1b'):zoho[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0xe'):desk[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case'vtiger':vtiger[_0x4d755e](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d);break;case _0x7963('0x11'):freshsales['cs'](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d,_0x4d755e);break;case _0x7963('0x1c'):servicenow['cs'](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d,_0x4d755e);break;case _0x7963('0x10'):dynamics365['cs'](_0x5b612a,_0x44e4ea,_0x2e1f39,_0x378a4b,_0xe85e02,_0x183dd4,_0x3d310d,_0x4d755e);break;default:console[_0x7963('0x1d')]('unknown\x20integration');}}else{_0xa4f874=require(_0x7963('0x1e'))(_0x5b612a[_0x7963('0x1a')][_0x7963('0x14')]());_0xa4f874['error'](_0x7963('0x1f'),util['format'](_0x7963('0x20'),_0x5b612a[_0x7963('0x1a')]['toLowerCase'](),_0x5b612a[_0x7963('0x21')]));}}else{_0xa4f874=require('../../../../config/logger')(_0x5b612a['data1'][_0x7963('0x14')]());_0xa4f874[_0x7963('0x22')]('[EXEC]',util[_0x7963('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x5b612a[_0x7963('0x1a')][_0x7963('0x14')](),_0x5b612a['data2']));}}else{}}catch(_0x4868af){console[_0x7963('0x22')](_0x4868af);}}}}; \ No newline at end of file +var _0x0bca=['error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','[EXEC]','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data2','find','Configurations','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','data1','zendesk','vtiger','log','unknown\x20integration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0bca,0x10f));var _0xa0bc=function(_0x304a4d,_0xb50bb){_0x304a4d=_0x304a4d-0x0;var _0x3ee9d2=_0x0bca[_0x304a4d];return _0x3ee9d2;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0xa0bc('0x0'));var salesforce=require(_0xa0bc('0x1'));var sugarcrm=require(_0xa0bc('0x2'));var freshdesk=require(_0xa0bc('0x3'));var zoho=require(_0xa0bc('0x4'));var desk=require(_0xa0bc('0x5'));var vtiger=require(_0xa0bc('0x6'));var servicenow=require(_0xa0bc('0x7'));var dynamics365=require(_0xa0bc('0x8'));var freshsales=require(_0xa0bc('0x9'));var integrations=['zendesk','salesforce',_0xa0bc('0xa'),_0xa0bc('0xb'),_0xa0bc('0xc'),_0xa0bc('0xd'),'vtiger',_0xa0bc('0xe'),_0xa0bc('0xf'),_0xa0bc('0x10')];exports[_0xa0bc('0x11')]=function(_0x2043bb,_0x433156,_0x278dc0,_0x2f2bbd,_0xab1810,_0x32d837){if(_0x278dc0){if(_[_0xa0bc('0x12')](integrations,_0x2043bb['data1']['toLowerCase']())){try{var _0x4e0bcf=null;var _0x4cf5fb='';var _0x4d7ac1=_0x278dc0[_0x2043bb['data1'][_0xa0bc('0x13')]()];if(_0x4d7ac1){var _0x3206e6=_0x4d7ac1[_0x2043bb[_0xa0bc('0x14')]];if(_0x3206e6){var _0x1b47b2=_[_0xa0bc('0x15')](_0x3206e6[_0xa0bc('0x16')],{'id':parseInt(_0x2043bb['data3'],0xa)});if(_0x1b47b2){if(_0x2f2bbd){if(_0xab1810&&_0x433156[_0xa0bc('0x17')]){_0x4cf5fb='queue';}else if(_0x433156[_0xa0bc('0x18')]){_0x4cf5fb=_0xa0bc('0x19');}else{console['log'](_0xa0bc('0x1a'),_0x433156);}}else{_0x4cf5fb=_0xa0bc('0x1b');}switch(_0x2043bb[_0xa0bc('0x1c')][_0xa0bc('0x13')]()){case _0xa0bc('0x1d'):zendesk[_0x4cf5fb](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837);break;case'salesforce':salesforce[_0x4cf5fb](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837);break;case _0xa0bc('0xa'):sugarcrm[_0x4cf5fb](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837);break;case _0xa0bc('0xb'):freshdesk[_0x4cf5fb](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837);break;case _0xa0bc('0xc'):zoho[_0x4cf5fb](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837);break;case _0xa0bc('0xd'):desk[_0x4cf5fb](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837);break;case _0xa0bc('0x1e'):vtiger[_0x4cf5fb](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837);break;case'freshsales':freshsales['cs'](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837,_0x4cf5fb);break;case _0xa0bc('0x10'):servicenow['cs'](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837,_0x4cf5fb);break;case _0xa0bc('0xe'):dynamics365['cs'](_0x2043bb,_0x433156,_0x1b47b2,_0x2f2bbd,_0xab1810,_0x3206e6,_0x32d837,_0x4cf5fb);break;default:console[_0xa0bc('0x1f')](_0xa0bc('0x20'));}}else{_0x4e0bcf=require('../../../../config/logger')(_0x2043bb[_0xa0bc('0x1c')]['toLowerCase']());_0x4e0bcf[_0xa0bc('0x21')]('[EXEC]',util[_0xa0bc('0x22')](_0xa0bc('0x23'),_0x2043bb[_0xa0bc('0x1c')][_0xa0bc('0x13')](),_0x2043bb[_0xa0bc('0x24')]));}}else{_0x4e0bcf=require('../../../../config/logger')(_0x2043bb[_0xa0bc('0x1c')][_0xa0bc('0x13')]());_0x4e0bcf[_0xa0bc('0x21')](_0xa0bc('0x25'),util[_0xa0bc('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x2043bb['data1'][_0xa0bc('0x13')](),_0x2043bb[_0xa0bc('0x14')]));}}else{}}catch(_0x4bb425){console[_0xa0bc('0x21')](_0x4bb425);}}}}; \ 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 91daf6f..cc16df2 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 _0x64c9=['merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','util','./util','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','account','WhatId','ticketType','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','execute','find','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact'];(function(_0x12ae74,_0x9e2b08){var _0x2794bc=function(_0x5bf594){while(--_0x5bf594){_0x12ae74['push'](_0x12ae74['shift']());}};_0x2794bc(++_0x9e2b08);}(_0x64c9,0x1bc));var _0x964c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64c9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x964c('0x0'));var rp=require(_0x964c('0x1'));var moment=require(_0x964c('0x2'));var BPromise=require(_0x964c('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x964c('0x4'));var Redis=require('ioredis');var intUtil=require(_0x964c('0x5'));var config=require('../../../../config/environment');var logger=require(_0x964c('0x6'))(_0x964c('0x7'));config['redis']=_[_0x964c('0x8')](config[_0x964c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x964c('0xa'))(new Redis(config[_0x964c('0x9')]));function emit(_0x29e2f0,_0x44a5ef,_0x2244e0){io['to'](_0x29e2f0)['emit'](_0x44a5ef,_0x2244e0);}function getTicket(_0x31c27c,_0x4ba179,_0x270bab,_0x5b3364,_0x2456e7,_0x3daa19,_0x300d0e,_0x3d2ef2){var _0xd07424=Object[_0x964c('0xb')]({},{'OwnerId':_0x4ba179['id'],'Subject':intUtil[_0x964c('0xc')](_0x5b3364[_0x964c('0xd')],_0x2456e7,'\x20'),'Description':intUtil[_0x964c('0xc')](_0x5b3364[_0x964c('0xe')],_0x2456e7,'\x0a')},getCustomFields(_0x3daa19,_0x2456e7));if(_0x270bab){if(_0x5b3364['ticketType']===_0x964c('0xf')){_0xd07424[_0x964c('0x10')]=moment[_0x964c('0x11')]();_0xd07424['IsReminderSet']=![];_0xd07424[_0x964c('0x12')]=![];if(_0x270bab[_0x964c('0x13')]===_0x964c('0x14')||_0x270bab['endUserType']==='lead'){_0xd07424['WhoId']=_0x270bab['id'];}else if(_0x270bab[_0x964c('0x13')]===_0x964c('0x15')){_0xd07424[_0x964c('0x16')]=_0x270bab['id'];}}else if(_0x5b3364[_0x964c('0x17')]==='Case'){if(_0x270bab[_0x964c('0x13')]===_0x964c('0x14')){_0xd07424[_0x964c('0x18')]=_0x270bab['id'];}else if(_0x270bab['endUserType']==='account'){_0xd07424['AccountId']=_0x270bab['id'];}else if(_0x270bab[_0x964c('0x13')]===_0x964c('0x19')&&_0x5b3364[_0x964c('0x1a')]){_0xd07424[_0x5b3364[_0x964c('0x1a')]]=_0x270bab['id'];}else{logger[_0x964c('0x1b')](_0x964c('0x1c'));}}}return _0x300d0e['sobject'](_0x5b3364[_0x964c('0x17')])[_0x964c('0x1d')](_0xd07424);}function getUser(_0x4f377d,_0x5633ce,_0x1c87a1){if(!_[_0x964c('0x1e')](_0x5633ce)&&intUtil[_0x964c('0x1f')](_0x5633ce)){var _0x40e83a={'Email':_0x5633ce};var _0x14476c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1c87a1[_0x964c('0x20')](_0x964c('0x21'))['find'](_0x40e83a,_0x14476c)[_0x964c('0x22')]()['then'](function(_0x407295){if(_0x407295['length']){var _0x2fc6d7=_[_0x964c('0x23')](_0x407295,function(_0xb032a9){return _0xb032a9['Email']===_0x5633ce;});if(_0x2fc6d7){logger[_0x964c('0x1b')](_0x964c('0x24'),_0x5633ce);return BPromise['resolve']({'id':_0x2fc6d7['Id'],'name':_0x2fc6d7[_0x964c('0x25')]});}}else{logger['info'](_0x964c('0x26'),_0x5633ce);return _0x1c87a1['identity']()[_0x964c('0x27')](function(_0x1865e3){return BPromise['resolve']({'id':_0x1865e3[_0x964c('0x28')],'name':_0x1865e3[_0x964c('0x29')]});});}});}else{logger[_0x964c('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5633ce);return _0x1c87a1['identity']()['then'](function(_0x430bb2){return BPromise[_0x964c('0x2a')]({'id':_0x430bb2[_0x964c('0x28')],'name':_0x430bb2[_0x964c('0x29')]});});}}function getEndUser(_0xd01f3f,_0x14ced5,_0x4dbfdc,_0x5a918b,_0x5a17e5){var _0x1447e7={'$or':{'Phone':_0x5a918b}};var _0x4e27ba={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x964c('0x2a')]()[_0x964c('0x27')](function(){logger[_0x964c('0x1b')](_0x964c('0x2b'),_0x5a918b,_0x14ced5[_0x964c('0x2c')]);switch(_0x14ced5[_0x964c('0x2c')]){case _0x964c('0x2d'):var _0xef3d2c=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5[_0x964c('0x2f')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x2f')]]=_0x5a918b;_[_0x964c('0x30')](_0xef3d2c[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x32'))[_0x964c('0x23')](_0xef3d2c,_0x4e27ba)['execute']()[_0x964c('0x27')](function(_0x376f56){if(_0x376f56&&_0x376f56['length']){return _0x376f56;}else{var _0x295569=_['cloneDeep'](_0x1447e7);if(_0x14ced5[_0x964c('0x33')]){var _0x26237d={};_0x26237d[_0x14ced5['additionalSearchLead']]=_0x5a918b;_[_0x964c('0x30')](_0x295569['$or'],_0x26237d);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x34'))[_0x964c('0x23')](_0x295569,_0x4e27ba);}});case _0x964c('0x35'):var _0x1dd770=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5[_0x964c('0x36')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x36')]]=_0x5a918b;_[_0x964c('0x30')](_0x1dd770[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x37'))[_0x964c('0x23')](_0x1dd770,_0x4e27ba)[_0x964c('0x22')]()['then'](function(_0x28a7d8){if(_0x28a7d8&&_0x28a7d8['length']){return _0x28a7d8;}else{var _0x912878=_['cloneDeep'](_0x1447e7);if(_0x14ced5[_0x964c('0x2f')]){var _0x1c95e9={};_0x1c95e9[_0x14ced5[_0x964c('0x2f')]]=_0x5a918b;_[_0x964c('0x30')](_0x912878[_0x964c('0x31')],_0x1c95e9);}return _0x5a17e5['sobject'](_0x964c('0x32'))[_0x964c('0x23')](_0x912878,_0x4e27ba)['then'](function(_0x2b5707){if(_0x2b5707&&_0x2b5707['length']){return _0x2b5707;}else{var _0x36aec1=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5['additionalSearchLead']){var _0x4f10cc={};_0x4f10cc[_0x14ced5['additionalSearchLead']]=_0x5a918b;_[_0x964c('0x30')](_0x36aec1[_0x964c('0x31')],_0x4f10cc);}return _0x5a17e5['sobject'](_0x964c('0x34'))['find'](_0x36aec1,_0x4e27ba);}});}});case _0x964c('0x14'):var _0xef3d2c=_['cloneDeep'](_0x1447e7);if(_0x14ced5[_0x964c('0x2f')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x2f')]]=_0x5a918b;_[_0x964c('0x30')](_0xef3d2c[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x32'))['find'](_0xef3d2c,_0x4e27ba)['execute']();case _0x964c('0x19'):var _0x41e6ec=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5[_0x964c('0x33')]){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x33')]]=_0x5a918b;_[_0x964c('0x30')](_0x41e6ec[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x34'))[_0x964c('0x23')](_0x41e6ec,_0x4e27ba);case _0x964c('0x15'):var _0x1dd770=_[_0x964c('0x2e')](_0x1447e7);if(_0x14ced5['additionalSearchAccount']){var _0x57726c={};_0x57726c[_0x14ced5[_0x964c('0x36')]]=_0x5a918b;_['merge'](_0x1dd770[_0x964c('0x31')],_0x57726c);}return _0x5a17e5[_0x964c('0x20')](_0x964c('0x37'))[_0x964c('0x23')](_0x1dd770,_0x4e27ba);default:return null;}})[_0x964c('0x27')](function(_0x13b6d2){if(_0x13b6d2&&_0x13b6d2['length']){var _0x2aac71=_['first'](_0x13b6d2);if(_0x2aac71){return BPromise[_0x964c('0x2a')]({'id':_0x2aac71['Id'],'name':_0x2aac71[_0x964c('0x25')],'phone':_0x2aac71['Phone'],'endUserType':_0x2aac71['attributes'][_0x964c('0x38')][_0x964c('0x39')]()});}}})[_0x964c('0x27')](function(_0x56220e){if(_0x56220e){logger[_0x964c('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x56220e[_0x964c('0x13')],_0x5a918b);return BPromise[_0x964c('0x2a')](_0x56220e);}else{logger[_0x964c('0x1b')](_0x964c('0x3a'),_0x5a918b);var _0x5719eb={'Phone':_0x5a918b};if(_0x14ced5[_0x964c('0x3b')]){if(_0x14ced5[_0x964c('0x3b')]===_0x964c('0x14')){logger['info'](_0x964c('0x3c'),_0x5a918b,_0x14ced5[_0x964c('0x3b')]);_0x5719eb[_0x964c('0x3d')]=_0x4dbfdc!==_0x964c('0x3e')?_0x4dbfdc:util[_0x964c('0x3f')]('Caller\x20-\x20%s',_0x5a918b);}else if(_0x14ced5[_0x964c('0x3b')]===_0x964c('0x19')){logger[_0x964c('0x1b')](_0x964c('0x3c'),_0x5a918b,_0x14ced5[_0x964c('0x3b')]);_0x5719eb['LastName']=_0x4dbfdc!==_0x964c('0x3e')?_0x4dbfdc:util[_0x964c('0x3f')](_0x964c('0x40'),_0x5a918b);_0x5719eb[_0x964c('0x41')]=_0x964c('0x42');}else if(_0x14ced5[_0x964c('0x3b')]==='account'){logger['info'](_0x964c('0x3c'),_0x5a918b,_0x14ced5[_0x964c('0x3b')]);_0x5719eb[_0x964c('0x25')]=_0x4dbfdc!==''?_0x4dbfdc:util['format'](_0x964c('0x40'),_0x5a918b);}else{return null;}}return _0x5a17e5['sobject'](_[_0x964c('0x43')](_0x14ced5['moduleCreate']))[_0x964c('0x1d')](_0x5719eb)[_0x964c('0x27')](function(_0x211d52){return BPromise['resolve']({'id':_0x211d52['id'],'endUserType':_0x14ced5[_0x964c('0x3b')]});});}});}function getCustomFields(_0x202aa9,_0x331d9d){var _0x269455={};if(_0x202aa9['length']>0x0){_[_0x964c('0x44')](_0x202aa9,function(_0x1deefc){if(_[_0x964c('0x45')]([_0x964c('0x46'),_0x964c('0x47')],_0x1deefc[_0x964c('0x38')])&&_0x1deefc[_0x964c('0x48')]){_0x269455[_0x1deefc[_0x964c('0x48')]]=_0x1deefc[_0x964c('0x49')][_0x964c('0x4a')]();}else if(_0x1deefc[_0x964c('0x38')]===_0x964c('0x4b')&&_0x1deefc[_0x964c('0x4c')]&&_0x1deefc[_0x964c('0x48')]){_0x331d9d[_0x1deefc['variableName']]&&(_0x269455[_0x1deefc[_0x964c('0x48')]]=_0x331d9d[_0x1deefc[_0x964c('0x4c')]][_0x964c('0x4a')]());}else if(_0x1deefc[_0x964c('0x38')]===_0x964c('0x4d')&&_0x1deefc[_0x964c('0x4e')]&&_0x1deefc[_0x964c('0x4e')][_0x964c('0x4f')]&&_0x1deefc[_0x964c('0x48')]){_0x331d9d[_0x1deefc[_0x964c('0x4e')][_0x964c('0x4f')][_0x964c('0x39')]()]&&(_0x269455[_0x1deefc[_0x964c('0x48')]]=_0x331d9d[_0x1deefc[_0x964c('0x4e')][_0x964c('0x4f')][_0x964c('0x39')]()]['toString']());}});}return _0x269455;}function getConnection(_0x48bd07){var _0x37ceae=_0x48bd07[_0x964c('0x50')][_0x964c('0x51')](_0x48bd07[_0x964c('0x52')]);var _0x3bffb8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x48bd07['remoteUri']||'https://login.salesforce.com','clientId':_0x48bd07[_0x964c('0x53')],'clientSecret':_0x48bd07[_0x964c('0x54')]}});return _0x3bffb8[_0x964c('0x55')](_0x48bd07['username'],_0x37ceae)[_0x964c('0x27')](function(){logger[_0x964c('0x1b')](_0x964c('0x56'));return _0x3bffb8;});}exports[_0x964c('0x57')]=function(_0x31a6c0,_0x164c34,_0x447c9f,_0x3dcb60,_0x102da8,_0x474dfe){var _0x3f201b,_0x2c779f,_0x3e9b6d,_0x2dbd9f;_0x474dfe[_0x964c('0x58')]=intUtil[_0x964c('0x59')](_0x474dfe['serverUrl']);_0x474dfe[_0x964c('0x5a')]=intUtil[_0x964c('0x59')](_0x474dfe[_0x964c('0x5a')]);if(_0x102da8&&_0x102da8[_0x964c('0x5b')]){logger[_0x964c('0x1b')](_0x964c('0x5c'),_0x964c('0x5d'));_0x164c34[_0x964c('0x5e')]=util[_0x964c('0x3f')](_0x964c('0x5f'),_0x474dfe[_0x964c('0x58')],_0x164c34[_0x964c('0x60')],md5(_0x164c34[_0x964c('0x60')]));}else{_0x164c34[_0x964c('0x5e')]='';}return getConnection(_0x474dfe)[_0x964c('0x27')](function(_0x2928bf){_0x2dbd9f=_0x2928bf;return getUser(_0x474dfe,_0x3dcb60[_0x964c('0x61')],_0x2dbd9f);})['then'](function(_0x16b860){_0x3f201b=_0x16b860;return getEndUser(_0x474dfe,_0x447c9f,_0x164c34[_0x964c('0x62')],_0x164c34[_0x964c('0x63')],_0x2dbd9f);})[_0x964c('0x27')](function(_0x140ec4){_0x2c779f=_0x140ec4;return getTicket(_0x474dfe,_0x3f201b,_0x2c779f,_0x447c9f,_0x164c34,_0x447c9f[_0x964c('0x64')],_0x2dbd9f,_0x964c('0x57'));})[_0x964c('0x27')](function(_0x1c4e46){_0x3e9b6d=_0x1c4e46;logger[_0x964c('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x3e9b6d['id']);logger['info'](_0x964c('0x65'),_0x3e9b6d['id'],_0x3dcb60[_0x964c('0x4f')],_0x474dfe[_0x964c('0x38')]);switch(_0x474dfe[_0x964c('0x38')]){case _0x964c('0x66'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x3dcb60[_0x964c('0x4f')]),_0x964c('0x68'),{'recordId':_0x3e9b6d['id']});break;case _0x964c('0x69'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x3dcb60[_0x964c('0x4f')]),_0x964c('0x6a'),{'uri':util['format'](_0x964c('0x6b'),_0x2dbd9f[_0x964c('0x6c')],_0x3e9b6d['id'])});break;default:logger[_0x964c('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x964c('0x6e')](function(_0x3ae61e){logger[_0x964c('0x6d')](_0x964c('0x5c'),_0x3ae61e);});};exports[_0x964c('0x6f')]=function(_0x367ca1,_0xe70933,_0x32d9d4,_0x525b5b,_0x2d3243,_0x52b5ba,_0x5ee65b){var _0xfb8db2,_0x9265b7,_0x3ea348,_0x5ab761;_0x52b5ba['serverUrl']=intUtil[_0x964c('0x59')](_0x52b5ba['serverUrl']);_0x52b5ba[_0x964c('0x5a')]=intUtil[_0x964c('0x59')](_0x52b5ba['remoteUri']);if(_0x5ee65b&&_0x5ee65b[_0x964c('0x70')]&&_0x5ee65b[_0x964c('0x70')]!==_0x964c('0x71')){logger['info'](_0x964c('0x72'),_0x964c('0x5d'));_0xe70933[_0x964c('0x5e')]=util[_0x964c('0x3f')](_0x964c('0x5f'),_0x52b5ba['serverUrl'],_0xe70933['uniqueid'],md5(_0xe70933['uniqueid']));}return getConnection(_0x52b5ba)[_0x964c('0x27')](function(_0x430c93){_0x5ab761=_0x430c93;return getUser(_0x52b5ba,_0x525b5b[_0x964c('0x61')],_0x5ab761);})['then'](function(_0x231e8b){_0xfb8db2=_0x231e8b;return getEndUser(_0x52b5ba,_0x32d9d4,_0xe70933['destcalleridname'],_0xe70933[_0x964c('0x73')],_0x5ab761);})['then'](function(_0x4f055e){_0x9265b7=_0x4f055e;return getTicket(_0x52b5ba,_0xfb8db2,_0x9265b7,_0x32d9d4,_0xe70933,_0x32d9d4[_0x964c('0x64')],_0x5ab761,_0x964c('0x6f'));})[_0x964c('0x27')](function(_0x4573e6){_0x3ea348=_0x4573e6;logger[_0x964c('0x1b')](_0x964c('0x74'),_0x3ea348['id']);logger[_0x964c('0x1b')](_0x964c('0x75'),_0x3ea348['id'],_0x525b5b[_0x964c('0x4f')],_0x52b5ba[_0x964c('0x38')]);switch(_0x52b5ba[_0x964c('0x38')]){case _0x964c('0x66'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x525b5b[_0x964c('0x4f')]),_0x964c('0x68'),{'recordId':_0x3ea348['id']});break;case _0x964c('0x69'):emit(util[_0x964c('0x3f')](_0x964c('0x67'),_0x525b5b[_0x964c('0x4f')]),_0x964c('0x6a'),{'uri':util[_0x964c('0x3f')]('%s/%s/e',_0x5ab761[_0x964c('0x6c')],_0x3ea348['id'])});break;default:logger[_0x964c('0x6d')](_0x964c('0x72'),_0x964c('0x76'));}})[_0x964c('0x6e')](function(_0x4d1c59){logger[_0x964c('0x6d')]('[OUTBOUND]',_0x4d1c59);});};exports[_0x964c('0x77')]=function(_0x5ea1ea,_0xb7195c,_0x41d6c4,_0x195df2,_0x8b019e,_0x423061){var _0x1ac403,_0xc642c6,_0x3f99de,_0x24d0ce;_0x423061[_0x964c('0x58')]=intUtil['stripTrailingSlash'](_0x423061[_0x964c('0x58')]);_0x423061[_0x964c('0x5a')]=intUtil[_0x964c('0x59')](_0x423061[_0x964c('0x5a')]);if(_0x8b019e&&_0x8b019e['monitor_format']){logger['info']('['+_0xb7195c[_0x964c('0x78')][_0x964c('0x79')]()+']',_0x964c('0x5d'));_0xb7195c[_0x964c('0x5e')]=util[_0x964c('0x3f')](_0x964c('0x5f'),_0x423061[_0x964c('0x58')],_0xb7195c[_0x964c('0x60')],md5(_0xb7195c['uniqueid']));}else{_0xb7195c[_0x964c('0x5e')]='';}return getConnection(_0x423061)[_0x964c('0x27')](function(_0x2715fc){_0x24d0ce=_0x2715fc;if(!_[_0x964c('0x1e')](_0x195df2)){return getUser(_0x423061,_0x195df2[_0x964c('0x4f')],_0x24d0ce);}else{return getUser(_0x423061,null,_0x24d0ce);}})[_0x964c('0x27')](function(_0x2c5237){_0x1ac403=_0x2c5237;return getEndUser(_0x423061,_0x41d6c4,_0xb7195c[_0x964c('0x62')],_0xb7195c['calleridnum'],_0x24d0ce);})['then'](function(_0x5452be){_0xc642c6=_0x5452be;return getTicket(_0x423061,_0x1ac403,_0xc642c6,_0x41d6c4,_0xb7195c,_0x41d6c4[_0x964c('0x64')],_0x24d0ce);})[_0x964c('0x27')](function(_0x2f4dbd){_0x3f99de=_0x2f4dbd;logger[_0x964c('0x1b')]('['+_0xb7195c['lastevent'][_0x964c('0x79')]()+']\x20Ticket\x20%s\x20created.',_0x3f99de['id']);logger[_0x964c('0x1b')]('['+_0xb7195c['lastevent'][_0x964c('0x79')]()+_0x964c('0x7a'),_0x423061[_0x964c('0x38')]);})[_0x964c('0x6e')](function(_0x1ac3ed){logger[_0x964c('0x6d')]('['+_0xb7195c['lastevent']['toUpperCase']()+']',_0x1ac3ed);});}; \ No newline at end of file +var _0x94d7=['jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','user_id','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','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','contact','Lead','account','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','string','picklist','idField','variable','variableName','toString','customVariable','name','Variable','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','recordingFormat','[OUTBOUND]','destcalleridname','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum','Fields',']\x20Integration\x20account\x20type\x20%s.','request-promise','bluebird','md5'];(function(_0x5cc65c,_0x3f042e){var _0x4030d0=function(_0x2817ab){while(--_0x2817ab){_0x5cc65c['push'](_0x5cc65c['shift']());}};_0x4030d0(++_0x3f042e);}(_0x94d7,0x17d));var _0x794d=function(_0x197637,_0x1456d5){_0x197637=_0x197637-0x0;var _0x1a244b=_0x94d7[_0x197637];return _0x1a244b;};'use strict';var _=require('lodash');var rp=require(_0x794d('0x0'));var moment=require('moment');var BPromise=require(_0x794d('0x1'));var md5=require(_0x794d('0x2'));var jsforce=require(_0x794d('0x3'));var util=require('util');var Redis=require(_0x794d('0x4'));var intUtil=require(_0x794d('0x5'));var config=require(_0x794d('0x6'));var logger=require(_0x794d('0x7'))(_0x794d('0x8'));config[_0x794d('0x9')]=_['defaults'](config[_0x794d('0x9')],{'host':_0x794d('0xa'),'port':0x18eb});var io=require(_0x794d('0xb'))(new Redis(config['redis']));function emit(_0x194cd5,_0x4cb73b,_0x28c285){io['to'](_0x194cd5)[_0x794d('0xc')](_0x4cb73b,_0x28c285);}function getTicket(_0x55fde3,_0x2258a1,_0x578fb9,_0x49bb49,_0x39f71f,_0x1f5e04,_0x1dbbc6,_0x5d9682){var _0x555420=Object['assign']({},{'OwnerId':_0x2258a1['id'],'Subject':intUtil['getString'](_0x49bb49['Subjects'],_0x39f71f,'\x20'),'Description':intUtil[_0x794d('0xd')](_0x49bb49[_0x794d('0xe')],_0x39f71f,'\x0a')},getCustomFields(_0x1f5e04,_0x39f71f));if(_0x578fb9){if(_0x49bb49[_0x794d('0xf')]===_0x794d('0x10')){_0x555420[_0x794d('0x11')]=moment[_0x794d('0x12')]();_0x555420[_0x794d('0x13')]=![];_0x555420[_0x794d('0x14')]=![];if(_0x578fb9['endUserType']==='contact'||_0x578fb9[_0x794d('0x15')]===_0x794d('0x16')){_0x555420[_0x794d('0x17')]=_0x578fb9['id'];}else if(_0x578fb9['endUserType']==='account'){_0x555420[_0x794d('0x18')]=_0x578fb9['id'];}}else if(_0x49bb49['ticketType']===_0x794d('0x19')){if(_0x578fb9[_0x794d('0x15')]==='contact'){_0x555420[_0x794d('0x1a')]=_0x578fb9['id'];}else if(_0x578fb9['endUserType']==='account'){_0x555420[_0x794d('0x1b')]=_0x578fb9['id'];}else if(_0x578fb9[_0x794d('0x15')]==='lead'&&_0x49bb49[_0x794d('0x1c')]){_0x555420[_0x49bb49[_0x794d('0x1c')]]=_0x578fb9['id'];}else{logger[_0x794d('0x1d')](_0x794d('0x1e'));}}}return _0x1dbbc6[_0x794d('0x1f')](_0x49bb49[_0x794d('0xf')])[_0x794d('0x20')](_0x555420);}function getUser(_0x339fa3,_0x3f1b9b,_0x7566f1){if(!_[_0x794d('0x21')](_0x3f1b9b)&&intUtil[_0x794d('0x22')](_0x3f1b9b)){var _0x50ef64={'Email':_0x3f1b9b};var _0x4dca91={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x7566f1['sobject']('User')[_0x794d('0x23')](_0x50ef64,_0x4dca91)[_0x794d('0x24')]()['then'](function(_0x59a93a){if(_0x59a93a[_0x794d('0x25')]){var _0x5ece50=_[_0x794d('0x23')](_0x59a93a,function(_0x1c2e2f){return _0x1c2e2f[_0x794d('0x26')]===_0x3f1b9b;});if(_0x5ece50){logger[_0x794d('0x1d')](_0x794d('0x27'),_0x3f1b9b);return BPromise[_0x794d('0x28')]({'id':_0x5ece50['Id'],'name':_0x5ece50[_0x794d('0x29')]});}}else{logger[_0x794d('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3f1b9b);return _0x7566f1[_0x794d('0x2a')]()['then'](function(_0x25e18b){return BPromise[_0x794d('0x28')]({'id':_0x25e18b[_0x794d('0x2b')],'name':_0x25e18b['display_name']});});}});}else{logger[_0x794d('0x1d')](_0x794d('0x2c'),_0x3f1b9b);return _0x7566f1[_0x794d('0x2a')]()[_0x794d('0x2d')](function(_0x243d59){return BPromise[_0x794d('0x28')]({'id':_0x243d59[_0x794d('0x2b')],'name':_0x243d59['display_name']});});}}function getEndUser(_0x18bfe2,_0x57af1c,_0x2c2b5a,_0x2e84ec,_0x575ef7){var _0x116930={'$or':{'Phone':_0x2e84ec}};var _0x4cd390={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x794d('0x28')]()[_0x794d('0x2d')](function(){logger[_0x794d('0x1d')](_0x794d('0x2e'),_0x2e84ec,_0x57af1c['moduleSearch']);switch(_0x57af1c[_0x794d('0x2f')]){case _0x794d('0x30'):var _0x59e64f=_[_0x794d('0x31')](_0x116930);if(_0x57af1c[_0x794d('0x32')]){var _0x4a54b4={};_0x4a54b4[_0x57af1c['additionalSearchContact']]=_0x2e84ec;_[_0x794d('0x33')](_0x59e64f[_0x794d('0x34')],_0x4a54b4);}return _0x575ef7[_0x794d('0x1f')](_0x794d('0x35'))[_0x794d('0x23')](_0x59e64f,_0x4cd390)[_0x794d('0x24')]()[_0x794d('0x2d')](function(_0x32035d){if(_0x32035d&&_0x32035d['length']){return _0x32035d;}else{var _0x46818e=_[_0x794d('0x31')](_0x116930);if(_0x57af1c[_0x794d('0x36')]){var _0x58e66b={};_0x58e66b[_0x57af1c['additionalSearchLead']]=_0x2e84ec;_[_0x794d('0x33')](_0x46818e[_0x794d('0x34')],_0x58e66b);}return _0x575ef7[_0x794d('0x1f')]('Lead')[_0x794d('0x23')](_0x46818e,_0x4cd390);}});case _0x794d('0x37'):var _0x487b70=_[_0x794d('0x31')](_0x116930);if(_0x57af1c[_0x794d('0x38')]){var _0x4a54b4={};_0x4a54b4[_0x57af1c[_0x794d('0x38')]]=_0x2e84ec;_['merge'](_0x487b70[_0x794d('0x34')],_0x4a54b4);}return _0x575ef7[_0x794d('0x1f')](_0x794d('0x39'))[_0x794d('0x23')](_0x487b70,_0x4cd390)[_0x794d('0x24')]()[_0x794d('0x2d')](function(_0xb4bff5){if(_0xb4bff5&&_0xb4bff5[_0x794d('0x25')]){return _0xb4bff5;}else{var _0x585267=_[_0x794d('0x31')](_0x116930);if(_0x57af1c[_0x794d('0x32')]){var _0x4ba803={};_0x4ba803[_0x57af1c[_0x794d('0x32')]]=_0x2e84ec;_[_0x794d('0x33')](_0x585267[_0x794d('0x34')],_0x4ba803);}return _0x575ef7[_0x794d('0x1f')](_0x794d('0x35'))['find'](_0x585267,_0x4cd390)['then'](function(_0x36adfa){if(_0x36adfa&&_0x36adfa['length']){return _0x36adfa;}else{var _0x782ef=_['cloneDeep'](_0x116930);if(_0x57af1c[_0x794d('0x36')]){var _0x4e2ca4={};_0x4e2ca4[_0x57af1c[_0x794d('0x36')]]=_0x2e84ec;_[_0x794d('0x33')](_0x782ef[_0x794d('0x34')],_0x4e2ca4);}return _0x575ef7[_0x794d('0x1f')]('Lead')[_0x794d('0x23')](_0x782ef,_0x4cd390);}});}});case _0x794d('0x3a'):var _0x59e64f=_[_0x794d('0x31')](_0x116930);if(_0x57af1c['additionalSearchContact']){var _0x4a54b4={};_0x4a54b4[_0x57af1c['additionalSearchContact']]=_0x2e84ec;_[_0x794d('0x33')](_0x59e64f[_0x794d('0x34')],_0x4a54b4);}return _0x575ef7['sobject'](_0x794d('0x35'))['find'](_0x59e64f,_0x4cd390)['execute']();case _0x794d('0x16'):var _0x375e7b=_[_0x794d('0x31')](_0x116930);if(_0x57af1c[_0x794d('0x36')]){var _0x4a54b4={};_0x4a54b4[_0x57af1c['additionalSearchLead']]=_0x2e84ec;_['merge'](_0x375e7b['$or'],_0x4a54b4);}return _0x575ef7[_0x794d('0x1f')](_0x794d('0x3b'))[_0x794d('0x23')](_0x375e7b,_0x4cd390);case _0x794d('0x3c'):var _0x487b70=_[_0x794d('0x31')](_0x116930);if(_0x57af1c['additionalSearchAccount']){var _0x4a54b4={};_0x4a54b4[_0x57af1c[_0x794d('0x38')]]=_0x2e84ec;_[_0x794d('0x33')](_0x487b70['$or'],_0x4a54b4);}return _0x575ef7[_0x794d('0x1f')]('Account')[_0x794d('0x23')](_0x487b70,_0x4cd390);default:return null;}})[_0x794d('0x2d')](function(_0x36b98e){if(_0x36b98e&&_0x36b98e[_0x794d('0x25')]){var _0x3941c1=_[_0x794d('0x3d')](_0x36b98e);if(_0x3941c1){return BPromise[_0x794d('0x28')]({'id':_0x3941c1['Id'],'name':_0x3941c1[_0x794d('0x29')],'phone':_0x3941c1['Phone'],'endUserType':_0x3941c1[_0x794d('0x3e')][_0x794d('0x3f')][_0x794d('0x40')]()});}}})[_0x794d('0x2d')](function(_0x357a60){if(_0x357a60){logger[_0x794d('0x1d')](_0x794d('0x41'),_0x357a60[_0x794d('0x15')],_0x2e84ec);return BPromise[_0x794d('0x28')](_0x357a60);}else{logger[_0x794d('0x1d')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x2e84ec);var _0x282ffa={'Phone':_0x2e84ec};if(_0x57af1c[_0x794d('0x42')]){if(_0x57af1c[_0x794d('0x42')]===_0x794d('0x3a')){logger['info'](_0x794d('0x43'),_0x2e84ec,_0x57af1c[_0x794d('0x42')]);_0x282ffa[_0x794d('0x44')]=_0x2c2b5a!==_0x794d('0x45')?_0x2c2b5a:util[_0x794d('0x46')](_0x794d('0x47'),_0x2e84ec);}else if(_0x57af1c[_0x794d('0x42')]==='lead'){logger[_0x794d('0x1d')](_0x794d('0x43'),_0x2e84ec,_0x57af1c[_0x794d('0x42')]);_0x282ffa['LastName']=_0x2c2b5a!==''?_0x2c2b5a:util[_0x794d('0x46')](_0x794d('0x47'),_0x2e84ec);_0x282ffa[_0x794d('0x48')]=_0x794d('0x49');}else if(_0x57af1c[_0x794d('0x42')]===_0x794d('0x3c')){logger['info'](_0x794d('0x43'),_0x2e84ec,_0x57af1c[_0x794d('0x42')]);_0x282ffa[_0x794d('0x29')]=_0x2c2b5a!==_0x794d('0x45')?_0x2c2b5a:util['format'](_0x794d('0x47'),_0x2e84ec);}else{return null;}}return _0x575ef7['sobject'](_[_0x794d('0x4a')](_0x57af1c['moduleCreate']))[_0x794d('0x20')](_0x282ffa)[_0x794d('0x2d')](function(_0x4a7a0d){return BPromise['resolve']({'id':_0x4a7a0d['id'],'endUserType':_0x57af1c[_0x794d('0x42')]});});}});}function getCustomFields(_0x358627,_0xb05fbd){var _0x27eb09={};if(_0x358627['length']>0x0){_['forEach'](_0x358627,function(_0x24a067){if(_['includes']([_0x794d('0x4b'),_0x794d('0x4c')],_0x24a067[_0x794d('0x3f')])&&_0x24a067[_0x794d('0x4d')]){_0x27eb09[_0x24a067['idField']]=_0x24a067['content']['toString']();}else if(_0x24a067[_0x794d('0x3f')]===_0x794d('0x4e')&&_0x24a067[_0x794d('0x4f')]&&_0x24a067[_0x794d('0x4d')]){_0xb05fbd[_0x24a067['variableName']]&&(_0x27eb09[_0x24a067[_0x794d('0x4d')]]=_0xb05fbd[_0x24a067[_0x794d('0x4f')]][_0x794d('0x50')]());}else if(_0x24a067[_0x794d('0x3f')]===_0x794d('0x51')&&_0x24a067['Variable']&&_0x24a067['Variable'][_0x794d('0x52')]&&_0x24a067[_0x794d('0x4d')]){_0xb05fbd[_0x24a067['Variable']['name'][_0x794d('0x40')]()]&&(_0x27eb09[_0x24a067[_0x794d('0x4d')]]=_0xb05fbd[_0x24a067[_0x794d('0x53')]['name'][_0x794d('0x40')]()]['toString']());}});}return _0x27eb09;}function getConnection(_0x4b7fd2){var _0x29aa7e=_0x4b7fd2[_0x794d('0x54')][_0x794d('0x55')](_0x4b7fd2[_0x794d('0x56')]);var _0x5d2f44=new jsforce[(_0x794d('0x57'))]({'oauth2':{'loginUrl':_0x4b7fd2[_0x794d('0x58')]||_0x794d('0x59'),'clientId':_0x4b7fd2[_0x794d('0x5a')],'clientSecret':_0x4b7fd2[_0x794d('0x5b')]}});return _0x5d2f44[_0x794d('0x5c')](_0x4b7fd2['username'],_0x29aa7e)['then'](function(){logger[_0x794d('0x1d')](_0x794d('0x5d'));return _0x5d2f44;});}exports[_0x794d('0x5e')]=function(_0x37e008,_0x580cc9,_0x1d4358,_0x451dcd,_0x59de97,_0x1d1d40){var _0x518986,_0x2d4471,_0x30ebc8,_0x483c1a;_0x1d1d40[_0x794d('0x5f')]=intUtil[_0x794d('0x60')](_0x1d1d40[_0x794d('0x5f')]);_0x1d1d40[_0x794d('0x58')]=intUtil['stripTrailingSlash'](_0x1d1d40['remoteUri']);if(_0x59de97&&_0x59de97[_0x794d('0x61')]){logger[_0x794d('0x1d')](_0x794d('0x62'),'Recording\x20is\x20enabled!');_0x580cc9[_0x794d('0x63')]=util[_0x794d('0x46')](_0x794d('0x64'),_0x1d1d40[_0x794d('0x5f')],_0x580cc9[_0x794d('0x65')],md5(_0x580cc9['uniqueid']));}else{_0x580cc9[_0x794d('0x63')]='';}return getConnection(_0x1d1d40)['then'](function(_0x2ea95e){_0x483c1a=_0x2ea95e;return getUser(_0x1d1d40,_0x451dcd[_0x794d('0x66')],_0x483c1a);})[_0x794d('0x2d')](function(_0x2ca531){_0x518986=_0x2ca531;return getEndUser(_0x1d1d40,_0x1d4358,_0x580cc9[_0x794d('0x67')],_0x580cc9['calleridnum'],_0x483c1a);})[_0x794d('0x2d')](function(_0x4f8d9d){_0x2d4471=_0x4f8d9d;return getTicket(_0x1d1d40,_0x518986,_0x2d4471,_0x1d4358,_0x580cc9,_0x1d4358['Fields'],_0x483c1a,'queue');})[_0x794d('0x2d')](function(_0x25eea5){_0x30ebc8=_0x25eea5;logger[_0x794d('0x1d')](_0x794d('0x68'),_0x30ebc8['id']);logger[_0x794d('0x1d')](_0x794d('0x69'),_0x30ebc8['id'],_0x451dcd[_0x794d('0x52')],_0x1d1d40['type']);switch(_0x1d1d40[_0x794d('0x3f')]){case _0x794d('0x6a'):emit(util[_0x794d('0x46')](_0x794d('0x6b'),_0x451dcd['name']),'trigger:salesforce:display',{'recordId':_0x30ebc8['id']});break;case _0x794d('0x6c'):emit(util[_0x794d('0x46')](_0x794d('0x6b'),_0x451dcd[_0x794d('0x52')]),_0x794d('0x6d'),{'uri':util[_0x794d('0x46')](_0x794d('0x6e'),_0x483c1a[_0x794d('0x6f')],_0x30ebc8['id'])});break;default:logger[_0x794d('0x70')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x794d('0x71')](function(_0x440e7b){logger['error'](_0x794d('0x62'),_0x440e7b);});};exports['outbound']=function(_0x46c469,_0x5c1712,_0x24f64f,_0x4a07bc,_0x1070e2,_0x37ac1b,_0x359329){var _0x346f20,_0x32d2a0,_0x1c2c23,_0x40f033;_0x37ac1b['serverUrl']=intUtil[_0x794d('0x60')](_0x37ac1b[_0x794d('0x5f')]);_0x37ac1b[_0x794d('0x58')]=intUtil['stripTrailingSlash'](_0x37ac1b['remoteUri']);if(_0x359329&&_0x359329['recordingFormat']&&_0x359329[_0x794d('0x72')]!=='none'){logger[_0x794d('0x1d')](_0x794d('0x73'),'Recording\x20is\x20enabled!');_0x5c1712[_0x794d('0x63')]=util[_0x794d('0x46')](_0x794d('0x64'),_0x37ac1b[_0x794d('0x5f')],_0x5c1712['uniqueid'],md5(_0x5c1712['uniqueid']));}return getConnection(_0x37ac1b)[_0x794d('0x2d')](function(_0x2f364a){_0x40f033=_0x2f364a;return getUser(_0x37ac1b,_0x4a07bc[_0x794d('0x66')],_0x40f033);})['then'](function(_0x81de6b){_0x346f20=_0x81de6b;return getEndUser(_0x37ac1b,_0x24f64f,_0x5c1712[_0x794d('0x74')],_0x5c1712['destcalleridnum'],_0x40f033);})[_0x794d('0x2d')](function(_0x5f4662){_0x32d2a0=_0x5f4662;return getTicket(_0x37ac1b,_0x346f20,_0x32d2a0,_0x24f64f,_0x5c1712,_0x24f64f['Fields'],_0x40f033,_0x794d('0x75'));})[_0x794d('0x2d')](function(_0x143b05){_0x1c2c23=_0x143b05;logger[_0x794d('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1c2c23['id']);logger[_0x794d('0x1d')](_0x794d('0x76'),_0x1c2c23['id'],_0x4a07bc[_0x794d('0x52')],_0x37ac1b['type']);switch(_0x37ac1b[_0x794d('0x3f')]){case _0x794d('0x6a'):emit(util[_0x794d('0x46')](_0x794d('0x6b'),_0x4a07bc[_0x794d('0x52')]),_0x794d('0x77'),{'recordId':_0x1c2c23['id']});break;case _0x794d('0x6c'):emit(util[_0x794d('0x46')]('user:%s',_0x4a07bc[_0x794d('0x52')]),_0x794d('0x6d'),{'uri':util[_0x794d('0x46')]('%s/%s/e',_0x40f033[_0x794d('0x6f')],_0x1c2c23['id'])});break;default:logger[_0x794d('0x70')]('[OUTBOUND]',_0x794d('0x78'));}})[_0x794d('0x71')](function(_0x8f5588){logger[_0x794d('0x70')](_0x794d('0x73'),_0x8f5588);});};exports[_0x794d('0x79')]=function(_0x29b57b,_0xe2cb74,_0xade697,_0x3d907f,_0x1ed4ac,_0x5511e2){var _0x4ddc28,_0x2b44eb,_0x14dc2a,_0x5c85b7;_0x5511e2[_0x794d('0x5f')]=intUtil[_0x794d('0x60')](_0x5511e2[_0x794d('0x5f')]);_0x5511e2[_0x794d('0x58')]=intUtil[_0x794d('0x60')](_0x5511e2[_0x794d('0x58')]);if(_0x1ed4ac&&_0x1ed4ac['monitor_format']){logger[_0x794d('0x1d')]('['+_0xe2cb74[_0x794d('0x7a')][_0x794d('0x7b')]()+']',_0x794d('0x7c'));_0xe2cb74['recordingURL']=util[_0x794d('0x46')](_0x794d('0x64'),_0x5511e2[_0x794d('0x5f')],_0xe2cb74[_0x794d('0x65')],md5(_0xe2cb74[_0x794d('0x65')]));}else{_0xe2cb74[_0x794d('0x63')]='';}return getConnection(_0x5511e2)['then'](function(_0x5b8bb4){_0x5c85b7=_0x5b8bb4;if(!_[_0x794d('0x21')](_0x3d907f)){return getUser(_0x5511e2,_0x3d907f['name'],_0x5c85b7);}else{return getUser(_0x5511e2,null,_0x5c85b7);}})[_0x794d('0x2d')](function(_0x5c17bc){_0x4ddc28=_0x5c17bc;return getEndUser(_0x5511e2,_0xade697,_0xe2cb74[_0x794d('0x67')],_0xe2cb74[_0x794d('0x7d')],_0x5c85b7);})[_0x794d('0x2d')](function(_0x1c9d2d){_0x2b44eb=_0x1c9d2d;return getTicket(_0x5511e2,_0x4ddc28,_0x2b44eb,_0xade697,_0xe2cb74,_0xade697[_0x794d('0x7e')],_0x5c85b7);})[_0x794d('0x2d')](function(_0xc089fb){_0x14dc2a=_0xc089fb;logger[_0x794d('0x1d')]('['+_0xe2cb74[_0x794d('0x7a')][_0x794d('0x7b')]()+']\x20Ticket\x20%s\x20created.',_0x14dc2a['id']);logger['info']('['+_0xe2cb74[_0x794d('0x7a')][_0x794d('0x7b')]()+_0x794d('0x7f'),_0x5511e2[_0x794d('0x3f')]);})[_0x794d('0x71')](function(_0x59c0eb){logger['error']('['+_0xe2cb74[_0x794d('0x7a')]['toUpperCase']()+']',_0x59c0eb);});}; \ 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 a0e0e6d..ac66da2 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 _0xcc4e=['sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','type','nameField','toLowerCase','content','includes','string','idField','customField','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','./util','../../../../config/environment','servicenow','defaults','redis','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','POST'];(function(_0x2ace8e,_0x5b7a3d){var _0x19d576=function(_0x184b02){while(--_0x184b02){_0x2ace8e['push'](_0x2ace8e['shift']());}};_0x19d576(++_0x5b7a3d);}(_0xcc4e,0x19d));var _0xecc4=function(_0x4f8cef,_0x511202){_0x4f8cef=_0x4f8cef-0x0;var _0x18d9b8=_0xcc4e[_0x4f8cef];return _0x18d9b8;};'use strict';var _=require(_0xecc4('0x0'));var Promise=require(_0xecc4('0x1'));var rp=require('request-promise');var util=require(_0xecc4('0x2'));var md5=require(_0xecc4('0x3'));var Redis=require('ioredis');var intUtil=require(_0xecc4('0x4'));var config=require(_0xecc4('0x5'));var logger=require('../../../../config/logger')(_0xecc4('0x6'));config['redis']=_[_0xecc4('0x7')](config[_0xecc4('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xecc4('0x9'))(new Redis(config[_0xecc4('0x8')]));function getAdminUser(_0x3883a7,_0x540d68,_0x550b86,_0x562acf,_0x5dce6e,_0x138d8a){return new Promise(function(_0x24fdc6,_0x180d68){var _0x221d6a={'method':'GET','uri':_0x562acf+_0xecc4('0xa')+'&'+_0x5dce6e+'&'+_0x138d8a,'auth':_0x540d68,'json':!![]};return rp(_0x221d6a)['then'](function(_0x228e9e){if(_0x228e9e['result'][_0xecc4('0xb')]>0x0){_0x550b86[_0xecc4('0xc')]=_0x228e9e[_0xecc4('0xd')][0x0][_0xecc4('0xe')];}logger[_0xecc4('0xf')]('['+[_0x3883a7[_0xecc4('0x10')]()]+_0xecc4('0x11'),_0x550b86);_0x24fdc6(_0x550b86);})[_0xecc4('0x12')](function(_0xaa6f0b){logger[_0xecc4('0x13')]('['+[_0x3883a7[_0xecc4('0x10')]()]+']',_0xaa6f0b[_0xecc4('0x14')]);_0x180d68(_0xaa6f0b[_0xecc4('0x14')]);});});}function getUser(_0x5aeb05,_0x1f3cfc,_0x2cb512,_0x20f182,_0x24fffd){return function(_0x4d9d54){logger[_0xecc4('0xf')]('['+[_0x5aeb05[_0xecc4('0x10')]()]+_0xecc4('0x15'),_0x4d9d54);return new Promise(function(_0x5c0314,_0x2eed83){if(intUtil[_0xecc4('0x16')](_0x4d9d54[_0xecc4('0x17')])){var _0x2d10da={'method':_0xecc4('0x18'),'uri':_0x2cb512+_0xecc4('0x19')+_0x4d9d54[_0xecc4('0x17')]+'&'+_0x20f182+'&'+_0x24fffd,'auth':_0x1f3cfc,'json':!![]};logger[_0xecc4('0xf')]('['+[_0x5aeb05[_0xecc4('0x10')]()]+_0xecc4('0x1a'),_0x2d10da);return rp(_0x2d10da)[_0xecc4('0x1b')](function(_0x4e93ee){logger[_0xecc4('0xf')]('['+[_0x5aeb05['toUpperCase']()]+_0xecc4('0x1c'),_0x4e93ee);if(_0x4e93ee[_0xecc4('0xd')][_0xecc4('0xb')]>0x0&&String(_0x4e93ee[_0xecc4('0xd')][0x0][_0xecc4('0x1d')])===_0xecc4('0x1e')){_0x4d9d54[_0xecc4('0x1f')]=_0x4e93ee[_0xecc4('0xd')][0x0][_0xecc4('0xe')];}else{_0x4d9d54[_0xecc4('0x1f')]=_0x4d9d54[_0xecc4('0xc')];_0x4d9d54[_0xecc4('0x17')]=_0x4d9d54[_0xecc4('0x20')];}logger[_0xecc4('0xf')]('['+[_0x5aeb05['toUpperCase']()]+_0xecc4('0x21'),_0x4d9d54);_0x5c0314(_0x4d9d54);})[_0xecc4('0x12')](function(_0x52cced){logger[_0xecc4('0x13')]('['+[_0x5aeb05['toUpperCase']()]+']',_0x52cced[_0xecc4('0x14')]);_0x2eed83(_0x52cced['message']);});}else{logger[_0xecc4('0xf')]('['+[_0x5aeb05[_0xecc4('0x10')]()]+']\x20using\x20admin\x20profile');_0x4d9d54[_0xecc4('0x1f')]=_0x4d9d54[_0xecc4('0xc')];_0x4d9d54[_0xecc4('0x17')]=_0x4d9d54[_0xecc4('0x20')];_0x5c0314(_0x4d9d54);}});};}function createEndUser(_0x580a69,_0x40fc3a,_0x1cdccd,_0x1d12a1,_0x314f5d){logger['info']('['+[_0x580a69[_0xecc4('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x1cdccd);return new Promise(function(_0x1b5c2c,_0x39a92c){var _0x1472ef={'method':_0xecc4('0x22'),'uri':_0x1d12a1+_0xecc4('0x23')+_0x314f5d,'body':{'user_name':_0x1cdccd[_0xecc4('0x24')],'roles':_0xecc4('0x25'),'first_name':_0x1cdccd[_0xecc4('0x24')],'active':_0xecc4('0x1e'),'date_format':_0xecc4('0x26'),'phone':_0x1cdccd[_0xecc4('0x24')]},'auth':_0x40fc3a,'json':!![]};return rp(_0x1472ef)[_0xecc4('0x1b')](function(_0xc41eb3){logger[_0xecc4('0xf')]('['+[_0x580a69[_0xecc4('0x10')]()]+_0xecc4('0x27'),_0xc41eb3['result']);_0x1cdccd['endUserId']=_0xc41eb3[_0xecc4('0xd')][_0xecc4('0xe')];_0x1b5c2c(_0x1cdccd);})[_0xecc4('0x12')](function(_0x4821a3){logger[_0xecc4('0x13')]('['+[_0x580a69[_0xecc4('0x10')]()]+']',_0x4821a3['message']);_0x39a92c(_0x4821a3[_0xecc4('0x14')]);});});}function getEndUser(_0x2ecba3,_0x2108eb,_0x3e4b37,_0x860c97,_0x273902){return function(_0x3f7b9a){logger[_0xecc4('0xf')]('['+[_0x2ecba3[_0xecc4('0x10')]()]+_0xecc4('0x28'),_0x3f7b9a);return new Promise(function(_0x2ab90f,_0x170801){var _0x358214={'method':_0xecc4('0x18'),'uri':_0x3e4b37+_0xecc4('0x29')+_0x3f7b9a[_0xecc4('0x24')]+'&'+_0x860c97+'&'+_0x273902,'auth':_0x2108eb,'json':!![]};return rp(_0x358214)[_0xecc4('0x1b')](function(_0x20e058){if(_0x20e058[_0xecc4('0xd')]['length']>0x0){_0x3f7b9a['endUserId']=_0x20e058[_0xecc4('0xd')][0x0]['sys_id'];logger['info']('['+[_0x2ecba3['toUpperCase']()]+_0xecc4('0x2a'),_0x3f7b9a);_0x2ab90f(_0x3f7b9a);}else{return createEndUser(_0x2ecba3,_0x2108eb,_0x3f7b9a,_0x3e4b37,_0x860c97)[_0xecc4('0x1b')](function(_0x15416c){logger[_0xecc4('0xf')]('['+[_0x2ecba3[_0xecc4('0x10')]()]+_0xecc4('0x2b'),_0x15416c);_0x2ab90f(_0x15416c);});}})[_0xecc4('0x12')](function(_0x2e9c58){logger['error']('['+[_0x2ecba3['toUpperCase']()]+']',_0x2e9c58['message']);_0x170801(_0x2e9c58['message']);});});};}function getCustomFields(_0x22b260,_0x5abd40){var _0xc7e1d3={};if(_0x22b260[_0xecc4('0xb')]>0x0){_[_0xecc4('0x2c')](_0x22b260,function(_0x4a163e){if(_['includes'](['string',_0xecc4('0x2d')],_0x4a163e[_0xecc4('0x2e')])&&_0x4a163e['nameField']&&!_0x4a163e['customField']){_0xc7e1d3[_0x4a163e[_0xecc4('0x2f')][_0xecc4('0x30')]()]=_0x4a163e[_0xecc4('0x31')]['toString']();}else if(_[_0xecc4('0x32')]([_0xecc4('0x33'),'picklist'],_0x4a163e[_0xecc4('0x2e')])&&_0x4a163e[_0xecc4('0x34')]&&_0x4a163e[_0xecc4('0x35')]){_0xc7e1d3[_0x4a163e['idField'][_0xecc4('0x30')]()]=_0x4a163e['content'][_0xecc4('0x36')]();}else if(_0x4a163e[_0xecc4('0x2e')]==='variable'&&_0x4a163e[_0xecc4('0x37')]&&_0x4a163e[_0xecc4('0x34')]&&_0x4a163e['customField']){_0xc7e1d3[_0x4a163e['idField'][_0xecc4('0x30')]()]=_0x5abd40[_0x4a163e[_0xecc4('0x37')]][_0xecc4('0x36')]();}else if(_0x4a163e[_0xecc4('0x2e')]===_0xecc4('0x38')&&_0x4a163e[_0xecc4('0x39')]&&_0x4a163e['Variable'][_0xecc4('0x3a')]&&_0x4a163e['idField']&&_0x4a163e[_0xecc4('0x35')]){_0xc7e1d3[_0x4a163e[_0xecc4('0x34')][_0xecc4('0x30')]()]=_0x5abd40[_0x4a163e[_0xecc4('0x39')][_0xecc4('0x3a')][_0xecc4('0x30')]()][_0xecc4('0x36')]();}});}return _0xc7e1d3;}function getTicket(_0x413ee7,_0x2dbaa3,_0x4b0b30,_0x3e06fa,_0x193c2f,_0x998b68){return function(_0x20017d){logger['info']('['+[_0x413ee7[_0xecc4('0x10')]()]+_0xecc4('0x3b'),_0x20017d);return new Promise(function(_0x5b6b3d,_0x1b441f){var _0x3bf075=_0x413ee7['toLowerCase']()===_0xecc4('0x3c')?_0x20017d[_0xecc4('0x1f')]:_0x20017d[_0xecc4('0x3d')];var _0x46007e={'method':_0xecc4('0x22'),'uri':_0x4b0b30+_0xecc4('0x3e')+'?'+_0x998b68,'body':Object[_0xecc4('0x3f')]({},{'active':_0xecc4('0x1e'),'caller_id':_0x3bf075,'assigned_to':_0x20017d['userId'],'short_description':intUtil[_0xecc4('0x40')](_0x3e06fa[_0xecc4('0x41')],_0x193c2f,'\x20'),'description':intUtil[_0xecc4('0x40')](_0x3e06fa['Descriptions'],_0x193c2f,'\x0a')},getCustomFields(_0x3e06fa[_0xecc4('0x42')],_0x193c2f)),'auth':_0x2dbaa3,'json':!![]};return rp(_0x46007e)['then'](function(_0x19e8ca){logger[_0xecc4('0xf')]('['+[_0x413ee7['toUpperCase']()]+_0xecc4('0x43'),_0x19e8ca[_0xecc4('0xd')]);_0x20017d[_0xecc4('0x44')]=_0x19e8ca[_0xecc4('0xd')][_0xecc4('0xe')];_0x20017d[_0xecc4('0x45')]=_0x19e8ca[_0xecc4('0xd')]['number'];logger[_0xecc4('0xf')]('['+[_0x413ee7[_0xecc4('0x10')]()]+']\x20getTicket\x20crm',_0x20017d);_0x5b6b3d(_0x20017d);})[_0xecc4('0x12')](function(_0x1090a9){logger[_0xecc4('0x13')]('['+[_0x413ee7['toUpperCase']()]+']',_0x1090a9[_0xecc4('0x14')]);_0x1b441f(_0x1090a9['message']);});});};}function createRemoteTag(_0x4d1a16,_0x18aa81,_0x2ebd25,_0x132ee9){return new Promise(function(_0x8489ae,_0x14ea40){var _0x30db59={'method':_0xecc4('0x22'),'uri':_0x2ebd25+_0xecc4('0x46')+'?'+_0x132ee9,'body':{'short_description':_0x4d1a16,'global':!![],'active':!![],'name':_0x4d1a16},'auth':_0x18aa81,'json':!![]};return rp(_0x30db59)[_0xecc4('0x1b')](function(_0xd167c5){var _0x3c1c19=_0xd167c5[_0xecc4('0xd')]['sys_id'];_0x8489ae(_0x3c1c19);});});}function getRemoteTag(_0x1f0b25,_0x1b908a,_0x30cdca,_0x33bcd5,_0x497044){return new Promise(function(_0x3aeb1,_0x27729e){var _0x23051e={'method':'GET','uri':_0x30cdca+'label'+'?sysparm_query=name%3D'+_0x1f0b25+'&'+_0x33bcd5,'auth':_0x1b908a,'json':!![]};return rp(_0x23051e)[_0xecc4('0x1b')](function(_0x3ed77a){if(_0x3ed77a[_0xecc4('0xd')][_0xecc4('0xb')]>0x0){var _0x2cb217=_0x3ed77a[_0xecc4('0xd')][0x0][_0xecc4('0xe')];_0x3aeb1(_0x2cb217);}else{return createRemoteTag(_0x1f0b25,_0x1b908a,_0x30cdca,_0x33bcd5)['then'](function(_0x20ad26){_0x3aeb1(_0x20ad26);});}});});}function assignTagToIncident(_0xcdfba4,_0x189343,_0x149b8d,_0x135a29,_0x5b7f77){return new Promise(function(_0x1c730f,_0x196403){var _0x2832e5={'method':'POST','uri':_0x149b8d+'label_entry'+'?'+_0x5b7f77,'body':{'label':_0xcdfba4,'table':'incident','id_type':_0xecc4('0x47'),'table_key':_0x135a29[_0xecc4('0x44')],'title':_0xecc4('0x48')+_0x135a29[_0xecc4('0x45')],'id_display':_0x135a29['ticketNumber']},'auth':_0x189343,'json':!![]};return rp(_0x2832e5)[_0xecc4('0x1b')](function(_0x78ed9){_0x1c730f();})[_0xecc4('0x12')](function(){_0x1c730f();});});}function manageTags(_0x3e70fd,_0x2af038,_0x5fd21,_0x304c5e,_0x42acbf,_0x22e109,_0x3db0de){return new Promise(function(_0x4652ce,_0x556349){var _0xc41bf2=[];_0x2af038[_0xecc4('0x2c')](function(_0x235dac){_0xc41bf2[_0xecc4('0x49')](getRemoteTag(_0x235dac,_0x5fd21,_0x304c5e,_0x22e109,_0x3db0de));});return Promise[_0xecc4('0x4a')](_0xc41bf2)[_0xecc4('0x1b')](function(_0x16b648){if(_0x16b648[_0xecc4('0xb')]){logger[_0xecc4('0xf')]('['+[_0x3e70fd[_0xecc4('0x10')]()]+_0xecc4('0x4b'),_0x16b648);var _0x1958f9=[];_0x16b648[_0xecc4('0x2c')](function(_0x3000e5){_0x1958f9[_0xecc4('0x49')](assignTagToIncident(_0x3000e5,_0x5fd21,_0x304c5e,_0x42acbf,_0x22e109));});return Promise['all'](_0x1958f9)[_0xecc4('0x1b')](function(){_0x4652ce();})[_0xecc4('0x12')](function(){_0x4652ce();});}else{_0x4652ce();}});});}function getTags(_0x324233,_0xef90f9,_0x58dd00,_0x5c319a,_0x10e105,_0x2c6d5b){return function(_0x43d060){return new Promise(function(_0x561e53,_0x54a559){var _0x145a77=[];var _0x59e9ec=_0x5c319a[_0xecc4('0x4c')];if(_0x59e9ec&&_0x59e9ec[_0xecc4('0xb')]>0x0){_0x145a77=_[_0xecc4('0x4d')](_0x59e9ec,_0xecc4('0x3a'));}if(_0x145a77['length']>0x0){return manageTags(_0x324233,_0x145a77,_0xef90f9,_0x58dd00,_0x43d060,_0x10e105,_0x2c6d5b)[_0xecc4('0x1b')](function(){_0x561e53(_0x43d060);});}else{_0x561e53(_0x43d060);}});};}function emit(_0x34151f,_0x4a9f7e,_0x2ba512){var _0x244036=_0xecc4('0x4e')+_0xecc4('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xecc4('0x50');var _0x8d40e2={'uri':_0x34151f+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2ba512+_0x244036};io['to'](util[_0xecc4('0x51')](_0xecc4('0x52'),_0x4a9f7e))[_0xecc4('0x53')]('trigger:browser:url',_0x8d40e2);}exports['cs']=function(_0x185f7f,_0x5f58c8,_0x220767,_0x2b229b,_0x524fc9,_0x47c027,_0x18be59,_0x4122f5){var _0x36e255={};var _0x269e03={'user':_0x47c027[_0xecc4('0x54')],'pass':_0x47c027[_0xecc4('0x55')]};var _0x936c17=_0xecc4('0x56');var _0x1a694b=_0xecc4('0x57');_0x47c027[_0xecc4('0x58')]=intUtil[_0xecc4('0x59')](_0x47c027[_0xecc4('0x58')]);_0x47c027[_0xecc4('0x5a')]=intUtil[_0xecc4('0x59')](_0x47c027[_0xecc4('0x5a')]);var _0x458bb5=util[_0xecc4('0x51')]('%s/api/now/table/',_0x47c027['remoteUri']);_0x36e255['userEmail']=!_[_0xecc4('0x5b')](_0x2b229b)?_0x2b229b[_0xecc4('0x5c')]:null;_0x36e255['adminEmail']=_0x47c027['email'];_0x36e255[_0xecc4('0x24')]=_0x4122f5['toLowerCase']()===_0xecc4('0x3c')?_0x5f58c8[_0xecc4('0x5d')]:_0x5f58c8[_0xecc4('0x5e')];_0x36e255[_0xecc4('0x5f')]=_0x4122f5===_0xecc4('0x60')||_0x4122f5===_0xecc4('0x61')?_0xecc4('0x60'):'outbound';var _0x394fe7=util[_0xecc4('0x51')](_0xecc4('0x62'),_0x47c027[_0xecc4('0x5a')],_0x5f58c8[_0xecc4('0x63')],md5(_0x5f58c8[_0xecc4('0x63')]));if(_0x524fc9&&_0x524fc9[_0xecc4('0x64')]){logger[_0xecc4('0xf')](_0xecc4('0x65'),_0xecc4('0x66'));_0x5f58c8['recordingURL']=_0x394fe7;}else if(_0x18be59&&_0x18be59[_0xecc4('0x67')]&&_0x18be59[_0xecc4('0x67')]!==_0xecc4('0x68')){logger[_0xecc4('0xf')](_0xecc4('0x69'),_0xecc4('0x66'));_0x5f58c8[_0xecc4('0x6a')]=_0x394fe7;}else{_0x5f58c8[_0xecc4('0x6a')]='';}return getAdminUser(_0x4122f5,_0x269e03,_0x36e255,_0x458bb5,_0x1a694b,_0x936c17)['then'](getUser(_0x4122f5,_0x269e03,_0x458bb5,_0x1a694b,_0x936c17))[_0xecc4('0x1b')](getEndUser(_0x4122f5,_0x269e03,_0x458bb5,_0x1a694b,_0x936c17))[_0xecc4('0x1b')](getTicket(_0x4122f5,_0x269e03,_0x458bb5,_0x220767,_0x5f58c8,_0x1a694b))[_0xecc4('0x1b')](function(_0x3fe0d7){logger[_0xecc4('0xf')](util['format'](_0xecc4('0x6b'),_0x3fe0d7[_0xecc4('0x44')]));logger[_0xecc4('0xf')](util[_0xecc4('0x51')](_0xecc4('0x6c'),_0x4122f5));if(_0x4122f5!=='unmanaged'){logger[_0xecc4('0xf')]('['+[_0x4122f5[_0xecc4('0x10')]()]+']',_0xecc4('0x6d'));emit(_0x47c027[_0xecc4('0x58')],_0x2b229b[_0xecc4('0x3a')],_0x3fe0d7[_0xecc4('0x44')]);}})[_0xecc4('0x12')](function(_0x373ea5){logger['error']('['+[_0x4122f5[_0xecc4('0x10')]()]+_0xecc4('0x6e'),util[_0xecc4('0x6f')](_0x373ea5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0933=['bluebird','request-promise','util','md5','./util','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','catch','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','POST','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','inspect','lodash'];(function(_0x547b79,_0x482001){var _0x132d9f=function(_0x3c89c5){while(--_0x3c89c5){_0x547b79['push'](_0x547b79['shift']());}};_0x132d9f(++_0x482001);}(_0x0933,0xd5));var _0x3093=function(_0x18d0c5,_0x42b892){_0x18d0c5=_0x18d0c5-0x0;var _0x4b7b0e=_0x0933[_0x18d0c5];return _0x4b7b0e;};'use strict';var _=require(_0x3093('0x0'));var Promise=require(_0x3093('0x1'));var rp=require(_0x3093('0x2'));var util=require(_0x3093('0x3'));var md5=require(_0x3093('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3093('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3093('0x6'))(_0x3093('0x7'));config[_0x3093('0x8')]=_[_0x3093('0x9')](config[_0x3093('0x8')],{'host':_0x3093('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3093('0x8')]));function getAdminUser(_0x28d7d5,_0x20cc06,_0x2e30d5,_0x3f144d,_0x2e4417,_0x3051af){return new Promise(function(_0xb6123,_0x16231a){var _0x1a4253={'method':_0x3093('0xb'),'uri':_0x3f144d+_0x3093('0xc')+'&'+_0x2e4417+'&'+_0x3051af,'auth':_0x20cc06,'json':!![]};return rp(_0x1a4253)['then'](function(_0x3eb710){if(_0x3eb710[_0x3093('0xd')][_0x3093('0xe')]>0x0){_0x2e30d5[_0x3093('0xf')]=_0x3eb710[_0x3093('0xd')][0x0][_0x3093('0x10')];}logger[_0x3093('0x11')]('['+[_0x28d7d5['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x2e30d5);_0xb6123(_0x2e30d5);})['catch'](function(_0x2af881){logger[_0x3093('0x12')]('['+[_0x28d7d5[_0x3093('0x13')]()]+']',_0x2af881[_0x3093('0x14')]);_0x16231a(_0x2af881[_0x3093('0x14')]);});});}function getUser(_0x43f015,_0x14cc9a,_0xc26352,_0x339e6a,_0x36fcc3){return function(_0x4c6fab){logger['info']('['+[_0x43f015['toUpperCase']()]+_0x3093('0x15'),_0x4c6fab);return new Promise(function(_0x77a36c,_0x3c3d15){if(intUtil[_0x3093('0x16')](_0x4c6fab[_0x3093('0x17')])){var _0x455616={'method':_0x3093('0xb'),'uri':_0xc26352+_0x3093('0x18')+_0x4c6fab['userEmail']+'&'+_0x339e6a+'&'+_0x36fcc3,'auth':_0x14cc9a,'json':!![]};logger[_0x3093('0x11')]('['+[_0x43f015[_0x3093('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x455616);return rp(_0x455616)[_0x3093('0x19')](function(_0x223cb6){logger[_0x3093('0x11')]('['+[_0x43f015[_0x3093('0x13')]()]+_0x3093('0x1a'),_0x223cb6);if(_0x223cb6['result'][_0x3093('0xe')]>0x0&&String(_0x223cb6['result'][0x0]['active'])===_0x3093('0x1b')){_0x4c6fab[_0x3093('0x1c')]=_0x223cb6[_0x3093('0xd')][0x0][_0x3093('0x10')];}else{_0x4c6fab[_0x3093('0x1c')]=_0x4c6fab[_0x3093('0xf')];_0x4c6fab[_0x3093('0x17')]=_0x4c6fab[_0x3093('0x1d')];}logger[_0x3093('0x11')]('['+[_0x43f015['toUpperCase']()]+_0x3093('0x1e'),_0x4c6fab);_0x77a36c(_0x4c6fab);})['catch'](function(_0x1bb3e1){logger['error']('['+[_0x43f015[_0x3093('0x13')]()]+']',_0x1bb3e1[_0x3093('0x14')]);_0x3c3d15(_0x1bb3e1[_0x3093('0x14')]);});}else{logger[_0x3093('0x11')]('['+[_0x43f015[_0x3093('0x13')]()]+_0x3093('0x1f'));_0x4c6fab[_0x3093('0x1c')]=_0x4c6fab[_0x3093('0xf')];_0x4c6fab['userEmail']=_0x4c6fab[_0x3093('0x1d')];_0x77a36c(_0x4c6fab);}});};}function createEndUser(_0x48d32b,_0x32b3fb,_0x3d8908,_0x21cab3,_0x4d3f1a){logger[_0x3093('0x11')]('['+[_0x48d32b['toUpperCase']()]+_0x3093('0x20'),_0x3d8908);return new Promise(function(_0x32ec42,_0x55bc6b){var _0x395315={'method':'POST','uri':_0x21cab3+_0x3093('0x21')+_0x4d3f1a,'body':{'user_name':_0x3d8908[_0x3093('0x22')],'roles':_0x3093('0x23'),'first_name':_0x3d8908[_0x3093('0x22')],'active':_0x3093('0x1b'),'date_format':'System','phone':_0x3d8908[_0x3093('0x22')]},'auth':_0x32b3fb,'json':!![]};return rp(_0x395315)[_0x3093('0x19')](function(_0x6ec0e3){logger[_0x3093('0x11')]('['+[_0x48d32b[_0x3093('0x13')]()]+_0x3093('0x24'),_0x6ec0e3[_0x3093('0xd')]);_0x3d8908['endUserId']=_0x6ec0e3[_0x3093('0xd')][_0x3093('0x10')];_0x32ec42(_0x3d8908);})[_0x3093('0x25')](function(_0x1c708c){logger['error']('['+[_0x48d32b['toUpperCase']()]+']',_0x1c708c['message']);_0x55bc6b(_0x1c708c[_0x3093('0x14')]);});});}function getEndUser(_0x224b50,_0x3ee60c,_0x4813b4,_0x8d1fe7,_0xc65dc5){return function(_0x21d02e){logger[_0x3093('0x11')]('['+[_0x224b50[_0x3093('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x21d02e);return new Promise(function(_0x5aae78,_0x3ae524){var _0x3ededc={'method':_0x3093('0xb'),'uri':_0x4813b4+_0x3093('0x26')+_0x21d02e[_0x3093('0x22')]+'&'+_0x8d1fe7+'&'+_0xc65dc5,'auth':_0x3ee60c,'json':!![]};return rp(_0x3ededc)['then'](function(_0x38de56){if(_0x38de56[_0x3093('0xd')][_0x3093('0xe')]>0x0){_0x21d02e[_0x3093('0x27')]=_0x38de56[_0x3093('0xd')][0x0][_0x3093('0x10')];logger[_0x3093('0x11')]('['+[_0x224b50['toUpperCase']()]+_0x3093('0x28'),_0x21d02e);_0x5aae78(_0x21d02e);}else{return createEndUser(_0x224b50,_0x3ee60c,_0x21d02e,_0x4813b4,_0x8d1fe7)[_0x3093('0x19')](function(_0x150914){logger[_0x3093('0x11')]('['+[_0x224b50['toUpperCase']()]+_0x3093('0x29'),_0x150914);_0x5aae78(_0x150914);});}})['catch'](function(_0x1c1e65){logger[_0x3093('0x12')]('['+[_0x224b50[_0x3093('0x13')]()]+']',_0x1c1e65[_0x3093('0x14')]);_0x3ae524(_0x1c1e65[_0x3093('0x14')]);});});};}function getCustomFields(_0x3ff2d5,_0x1573c4){var _0x5d1d6a={};if(_0x3ff2d5[_0x3093('0xe')]>0x0){_[_0x3093('0x2a')](_0x3ff2d5,function(_0x13c187){if(_[_0x3093('0x2b')](['string',_0x3093('0x2c')],_0x13c187[_0x3093('0x2d')])&&_0x13c187[_0x3093('0x2e')]&&!_0x13c187[_0x3093('0x2f')]){_0x5d1d6a[_0x13c187['nameField'][_0x3093('0x30')]()]=_0x13c187[_0x3093('0x31')][_0x3093('0x32')]();}else if(_[_0x3093('0x2b')]([_0x3093('0x33'),_0x3093('0x2c')],_0x13c187[_0x3093('0x2d')])&&_0x13c187['idField']&&_0x13c187[_0x3093('0x2f')]){_0x5d1d6a[_0x13c187[_0x3093('0x34')][_0x3093('0x30')]()]=_0x13c187[_0x3093('0x31')][_0x3093('0x32')]();}else if(_0x13c187[_0x3093('0x2d')]===_0x3093('0x35')&&_0x13c187[_0x3093('0x36')]&&_0x13c187[_0x3093('0x34')]&&_0x13c187[_0x3093('0x2f')]){_0x5d1d6a[_0x13c187[_0x3093('0x34')][_0x3093('0x30')]()]=_0x1573c4[_0x13c187[_0x3093('0x36')]][_0x3093('0x32')]();}else if(_0x13c187[_0x3093('0x2d')]===_0x3093('0x37')&&_0x13c187['Variable']&&_0x13c187[_0x3093('0x38')]['name']&&_0x13c187[_0x3093('0x34')]&&_0x13c187[_0x3093('0x2f')]){_0x5d1d6a[_0x13c187['idField'][_0x3093('0x30')]()]=_0x1573c4[_0x13c187[_0x3093('0x38')][_0x3093('0x39')][_0x3093('0x30')]()][_0x3093('0x32')]();}});}return _0x5d1d6a;}function getTicket(_0x183b7c,_0x292c4d,_0x1c9cf3,_0x131792,_0x23f3f4,_0x1bd00b){return function(_0x3f7e0b){logger['info']('['+[_0x183b7c[_0x3093('0x13')]()]+_0x3093('0x3a'),_0x3f7e0b);return new Promise(function(_0xf2264c,_0x32cc4b){var _0x1f6eaa=_0x183b7c[_0x3093('0x30')]()===_0x3093('0x3b')?_0x3f7e0b[_0x3093('0x1c')]:_0x3f7e0b['endUserId'];var _0x3b2104={'method':'POST','uri':_0x1c9cf3+_0x3093('0x3c')+'?'+_0x1bd00b,'body':Object[_0x3093('0x3d')]({},{'active':_0x3093('0x1b'),'caller_id':_0x1f6eaa,'assigned_to':_0x3f7e0b[_0x3093('0x1c')],'short_description':intUtil[_0x3093('0x3e')](_0x131792[_0x3093('0x3f')],_0x23f3f4,'\x20'),'description':intUtil[_0x3093('0x3e')](_0x131792[_0x3093('0x40')],_0x23f3f4,'\x0a')},getCustomFields(_0x131792['Fields'],_0x23f3f4)),'auth':_0x292c4d,'json':!![]};return rp(_0x3b2104)[_0x3093('0x19')](function(_0xeee841){logger[_0x3093('0x11')]('['+[_0x183b7c[_0x3093('0x13')]()]+_0x3093('0x41'),_0xeee841[_0x3093('0xd')]);_0x3f7e0b[_0x3093('0x42')]=_0xeee841['result'][_0x3093('0x10')];_0x3f7e0b[_0x3093('0x43')]=_0xeee841[_0x3093('0xd')]['number'];logger[_0x3093('0x11')]('['+[_0x183b7c[_0x3093('0x13')]()]+']\x20getTicket\x20crm',_0x3f7e0b);_0xf2264c(_0x3f7e0b);})['catch'](function(_0x27842d){logger[_0x3093('0x12')]('['+[_0x183b7c[_0x3093('0x13')]()]+']',_0x27842d['message']);_0x32cc4b(_0x27842d[_0x3093('0x14')]);});});};}function createRemoteTag(_0x292eac,_0x1f4b7c,_0x5ea239,_0x5a48eb){return new Promise(function(_0x2baf41,_0x2c6e74){var _0x1004ab={'method':_0x3093('0x44'),'uri':_0x5ea239+_0x3093('0x45')+'?'+_0x5a48eb,'body':{'short_description':_0x292eac,'global':!![],'active':!![],'name':_0x292eac},'auth':_0x1f4b7c,'json':!![]};return rp(_0x1004ab)['then'](function(_0x22134c){var _0x31642d=_0x22134c[_0x3093('0xd')][_0x3093('0x10')];_0x2baf41(_0x31642d);});});}function getRemoteTag(_0x56f203,_0x1a2748,_0x5de561,_0x4d0a64,_0x47f62c){return new Promise(function(_0x5871ca,_0x476c66){var _0x127245={'method':_0x3093('0xb'),'uri':_0x5de561+_0x3093('0x45')+_0x3093('0x46')+_0x56f203+'&'+_0x4d0a64,'auth':_0x1a2748,'json':!![]};return rp(_0x127245)[_0x3093('0x19')](function(_0x1ba608){if(_0x1ba608[_0x3093('0xd')][_0x3093('0xe')]>0x0){var _0x4a9d28=_0x1ba608[_0x3093('0xd')][0x0][_0x3093('0x10')];_0x5871ca(_0x4a9d28);}else{return createRemoteTag(_0x56f203,_0x1a2748,_0x5de561,_0x4d0a64)['then'](function(_0x4a9733){_0x5871ca(_0x4a9733);});}});});}function assignTagToIncident(_0x2bb7ab,_0x4141a6,_0x504947,_0x5671ce,_0x5a9e7b){return new Promise(function(_0x162d57,_0x5c8e71){var _0x3c34ea={'method':_0x3093('0x44'),'uri':_0x504947+'label_entry'+'?'+_0x5a9e7b,'body':{'label':_0x2bb7ab,'table':_0x3093('0x3c'),'id_type':_0x3093('0x47'),'table_key':_0x5671ce[_0x3093('0x42')],'title':_0x3093('0x48')+_0x5671ce[_0x3093('0x43')],'id_display':_0x5671ce['ticketNumber']},'auth':_0x4141a6,'json':!![]};return rp(_0x3c34ea)[_0x3093('0x19')](function(_0x126f90){_0x162d57();})['catch'](function(){_0x162d57();});});}function manageTags(_0x17f1a7,_0x2d7acd,_0x59fa93,_0x272c22,_0x5137fd,_0x118a46,_0x1be852){return new Promise(function(_0x18fce7,_0x30dd6f){var _0x6e3a91=[];_0x2d7acd[_0x3093('0x2a')](function(_0x4daae8){_0x6e3a91[_0x3093('0x49')](getRemoteTag(_0x4daae8,_0x59fa93,_0x272c22,_0x118a46,_0x1be852));});return Promise[_0x3093('0x4a')](_0x6e3a91)[_0x3093('0x19')](function(_0x1491dd){if(_0x1491dd[_0x3093('0xe')]){logger['info']('['+[_0x17f1a7['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1491dd);var _0x2962e5=[];_0x1491dd[_0x3093('0x2a')](function(_0x3e4847){_0x2962e5[_0x3093('0x49')](assignTagToIncident(_0x3e4847,_0x59fa93,_0x272c22,_0x5137fd,_0x118a46));});return Promise[_0x3093('0x4a')](_0x2962e5)[_0x3093('0x19')](function(){_0x18fce7();})['catch'](function(){_0x18fce7();});}else{_0x18fce7();}});});}function getTags(_0x308306,_0x25e18e,_0x27de52,_0x33da29,_0x40c680,_0x26eab5){return function(_0x8da8ae){return new Promise(function(_0x356588,_0x40ea98){var _0x3f4536=[];var _0x5e933d=_0x33da29[_0x3093('0x4b')];if(_0x5e933d&&_0x5e933d[_0x3093('0xe')]>0x0){_0x3f4536=_['map'](_0x5e933d,_0x3093('0x39'));}if(_0x3f4536[_0x3093('0xe')]>0x0){return manageTags(_0x308306,_0x3f4536,_0x25e18e,_0x27de52,_0x8da8ae,_0x40c680,_0x26eab5)['then'](function(){_0x356588(_0x8da8ae);});}else{_0x356588(_0x8da8ae);}});};}function emit(_0x8bcc23,_0x409087,_0x3db948){var _0x1d6671=_0x3093('0x4c')+_0x3093('0x4d')+_0x3093('0x4e')+'%255EORDERBYDESCnumber';var _0x29ba0f={'uri':_0x8bcc23+_0x3093('0x4f')+_0x3db948+_0x1d6671};io['to'](util['format']('user:%s',_0x409087))[_0x3093('0x50')](_0x3093('0x51'),_0x29ba0f);}exports['cs']=function(_0x45f867,_0x4fe74c,_0x372e1e,_0x45eee2,_0x2d5ddb,_0x23a843,_0x884a50,_0x42d964){var _0x541b70={};var _0x149347={'user':_0x23a843[_0x3093('0x52')],'pass':_0x23a843[_0x3093('0x53')]};var _0x1db7c9=_0x3093('0x54');var _0x5efad3=_0x3093('0x55');_0x23a843[_0x3093('0x56')]=intUtil[_0x3093('0x57')](_0x23a843['remoteUri']);_0x23a843['serverUrl']=intUtil[_0x3093('0x57')](_0x23a843['serverUrl']);var _0x3dc273=util[_0x3093('0x58')](_0x3093('0x59'),_0x23a843[_0x3093('0x56')]);_0x541b70[_0x3093('0x17')]=!_[_0x3093('0x5a')](_0x45eee2)?_0x45eee2['email']:null;_0x541b70['adminEmail']=_0x23a843[_0x3093('0x5b')];_0x541b70[_0x3093('0x22')]=_0x42d964['toLowerCase']()==='outbound'?_0x4fe74c[_0x3093('0x5c')]:_0x4fe74c[_0x3093('0x5d')];_0x541b70[_0x3093('0x5e')]=_0x42d964===_0x3093('0x5f')||_0x42d964==='unmanaged'?'queue':_0x3093('0x3b');var _0x4bb7db=util['format'](_0x3093('0x60'),_0x23a843[_0x3093('0x61')],_0x4fe74c[_0x3093('0x62')],md5(_0x4fe74c[_0x3093('0x62')]));if(_0x2d5ddb&&_0x2d5ddb['monitor_format']){logger['info'](_0x3093('0x63'),_0x3093('0x64'));_0x4fe74c[_0x3093('0x65')]=_0x4bb7db;}else if(_0x884a50&&_0x884a50[_0x3093('0x66')]&&_0x884a50[_0x3093('0x66')]!==_0x3093('0x67')){logger[_0x3093('0x11')](_0x3093('0x68'),_0x3093('0x64'));_0x4fe74c[_0x3093('0x65')]=_0x4bb7db;}else{_0x4fe74c['recordingURL']='';}return getAdminUser(_0x42d964,_0x149347,_0x541b70,_0x3dc273,_0x5efad3,_0x1db7c9)[_0x3093('0x19')](getUser(_0x42d964,_0x149347,_0x3dc273,_0x5efad3,_0x1db7c9))[_0x3093('0x19')](getEndUser(_0x42d964,_0x149347,_0x3dc273,_0x5efad3,_0x1db7c9))[_0x3093('0x19')](getTicket(_0x42d964,_0x149347,_0x3dc273,_0x372e1e,_0x4fe74c,_0x5efad3))[_0x3093('0x19')](function(_0x1fc35e){logger[_0x3093('0x11')](util[_0x3093('0x58')](_0x3093('0x69'),_0x1fc35e[_0x3093('0x42')]));logger['info'](util[_0x3093('0x58')]('call\x20direction:\x20%s',_0x42d964));if(_0x42d964!=='unmanaged'){logger[_0x3093('0x11')]('['+[_0x42d964[_0x3093('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x23a843['remoteUri'],_0x45eee2[_0x3093('0x39')],_0x1fc35e['ticketId']);}})[_0x3093('0x25')](function(_0x15fc20){logger[_0x3093('0x12')]('['+[_0x42d964['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x3093('0x6a')](_0x15fc20,{'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 0c62a87..09c58e1 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 _0x2939=['parent_id','Contacts','parent_name','name','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','Basic\x20%s','toString','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','length','find','entry_list','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','','Enduser\x20created.','[HTTP]','map','type','nameField','customField','toLowerCase','content','string','variable','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','then','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','catch','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','recordingURL','uniqueid','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','lastevent','toUpperCase','lodash','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','socket.io-emitter','redis','POST','emit','Subjects','assigned_user_id','description','getString','Descriptions','date_start','duration_minutes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2939,0x1b1));var _0x9293=function(_0x446098,_0x33eb6c){_0x446098=_0x446098-0x0;var _0x3c7a2c=_0x2939[_0x446098];return _0x3c7a2c;};'use strict';var _=require(_0x9293('0x0'));var rp=require('request-promise');var BPromise=require(_0x9293('0x1'));var md5=require(_0x9293('0x2'));var util=require(_0x9293('0x3'));var Redis=require(_0x9293('0x4'));var intUtil=require(_0x9293('0x5'));var config=require('../../../../config/environment');var logger=require(_0x9293('0x6'))(_0x9293('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9293('0x8'))(new Redis(config[_0x9293('0x9')]));var def={'method':_0x9293('0xa'),'json':!![]};function emit(_0x479b4c,_0xa4beee,_0x6b823f){io['to'](_0x479b4c)[_0x9293('0xb')](_0xa4beee,_0x6b823f);}function getTicket(_0x210d78,_0x534bf2,_0xd550c3,_0x436954,_0x2a9ce1,_0x5b58bf,_0x5c0d80,_0x5e603e){logger['info']('Creating\x20new\x20ticket...');var _0x374020=new Date();var _0x5aef6f=[{'name':'name','value':intUtil['getString'](_0x436954[_0x9293('0xc')],_0x2a9ce1,'\x20')},{'name':_0x9293('0xd'),'value':_0x534bf2['id']},{'name':'created_by','value':_0x534bf2['id']},{'name':_0x9293('0xe'),'value':intUtil[_0x9293('0xf')](_0x436954[_0x9293('0x10')],_0x2a9ce1,'\x0a')},{'name':_0x9293('0x11'),'value':_0x374020['toISOString']()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x9293('0x12'),'value':'15'},{'name':_0x9293('0x13'),'value':_0xd550c3['id']},{'name':'parent_type','value':_0x9293('0x14')},{'name':_0x9293('0x15'),'value':_0xd550c3[_0x9293('0x16')]},{'name':_0x9293('0x17'),'value':_0x5e603e}];if(_0x5b58bf['length']){_[_0x9293('0x18')](_0x5b58bf,function(_0x48b942){if(_0x2a9ce1[_0x48b942[_0x9293('0x19')]]){_0x5aef6f[_0x9293('0x1a')]({'name':_0x48b942[_0x9293('0x1b')],'value':_0x2a9ce1[_0x48b942[_0x9293('0x19')]]});}});}return request({'form':{'method':_0x9293('0x1c'),'input_type':'JSON','response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0x5c0d80['id'],'module_name':'Calls','name_value_list':_0x5aef6f})}});}function getAuth(_0x401a68){return util['format'](_0x9293('0x1f'),new Buffer(_0x401a68['apiKey']+':X')[_0x9293('0x20')](_0x9293('0x21')));}function getServerInfo(_0xe47b1b){return request({'form':{'method':'get_server_info','input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0xe47b1b['id']})}});}function getUser(_0x2ff39a,_0x1a0b4a,_0xcd1125){if(!_[_0x9293('0x22')](_0x1a0b4a)){logger[_0x9293('0x23')](_0x9293('0x24'),_0x1a0b4a);return request({'form':{'method':_0x9293('0x25'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9293('0x1e')]({'session':_0xcd1125['id'],'module_name':_0x9293('0x26'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1a0b4a),'order_by':'','offset':'0','select_fields':['id',_0x9293('0x16'),_0x9293('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3a3420){if(_0x3a3420['entry_list'][_0x9293('0x28')]){var _0x13f92a=_[_0x9293('0x29')](_0x3a3420[_0x9293('0x2a')],function(_0x236403){return _0x236403[_0x9293('0x2b')]['user_name'][_0x9293('0x2c')]===_0x1a0b4a;});if(_0x13f92a){logger[_0x9293('0x23')]('Agent\x20found!');return BPromise[_0x9293('0x2d')]({'id':_0x13f92a[_0x9293('0x2b')]['id'][_0x9293('0x2c')],'name':_0x13f92a[_0x9293('0x2b')][_0x9293('0x16')][_0x9293('0x2c')]});}}logger[_0x9293('0x23')](_0x9293('0x2e'));return BPromise[_0x9293('0x2d')]({'id':_0xcd1125[_0x9293('0x2b')][_0x9293('0x2f')]['value'],'name':_0xcd1125[_0x9293('0x2b')][_0x9293('0x27')][_0x9293('0x2c')]});});}else{logger[_0x9293('0x23')](_0x9293('0x30'));return BPromise[_0x9293('0x2d')]({'id':_0xcd1125[_0x9293('0x2b')][_0x9293('0x2f')][_0x9293('0x2c')],'name':_0xcd1125[_0x9293('0x2b')]['user_name'][_0x9293('0x2c')]});}}function getEndUser(_0x19eccb,_0xf561ce,_0x57c700,_0x26c57c){logger['info'](_0x9293('0x31'),_0x57c700);return request({'form':{'method':_0x9293('0x25'),'input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0x26c57c['id'],'module_name':'Contacts','query':util[_0x9293('0x32')](_0x9293('0x33'),_0x57c700),'order_by':'','offset':'0','select_fields':['id','name',_0x9293('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x37d3e7){if(_0x37d3e7[_0x9293('0x2a')][_0x9293('0x28')]){var _0x57d22b=_[_0x9293('0x29')](_0x37d3e7['entry_list'],function(_0x4472c3){return _0x4472c3[_0x9293('0x2b')]['phone_home'][_0x9293('0x2c')]===_0x57c700;});if(_0x57d22b){logger[_0x9293('0x23')](_0x9293('0x35'));return BPromise[_0x9293('0x2d')]({'id':_0x57d22b[_0x9293('0x2b')]['id'][_0x9293('0x2c')],'name':_0x57d22b[_0x9293('0x2b')]['name'][_0x9293('0x2c')],'phone':_0x57d22b['name_value_list'][_0x9293('0x34')]['value']});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x9293('0x1c'),'input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'session':_0x26c57c['id'],'module_name':_0x9293('0x14'),'name_value_list':[{'name':'first_name','value':_0xf561ce!==_0x9293('0x36')?_0xf561ce:util['format']('Caller\x20-\x20%s',_0x57c700)},{'name':'phone_home','value':_0x57c700}]})}})['then'](function(_0x5049e8){logger[_0x9293('0x23')](_0x9293('0x37'));return BPromise[_0x9293('0x2d')]({'id':_0x5049e8['id'],'name':_0x5049e8['entry_list']['first_name'][_0x9293('0x2c')],'phone':_0x5049e8['entry_list'][_0x9293('0x34')][_0x9293('0x2c')]});});}});}function request(_0x374023){logger['debug'](_0x9293('0x38'),JSON[_0x9293('0x1e')](_0x374023));return rp(_['merge'](def,_0x374023));}function getTags(_0x50e133,_0xd2f6){var _0x12f408=[];if(_0x50e133&&_0x50e133[_0x9293('0x28')]>0x0){_0x12f408=_[_0x9293('0x39')](_0x50e133,_0xd2f6);}return _0x12f408;}function getCustomFields(_0x323aaf,_0x4948f8){var _0x38784c=[];var _0x52fbf9={'custom_fields':[]};if(_0x323aaf['length']>0x0){_[_0x9293('0x18')](_0x323aaf,function(_0xf27376){if(_0xf27376[_0x9293('0x3a')]==='string'&&_0xf27376[_0x9293('0x3b')]&&!_0xf27376[_0x9293('0x3c')]){_0x52fbf9[_0xf27376[_0x9293('0x3b')][_0x9293('0x3d')]()]=_0xf27376[_0x9293('0x3e')][_0x9293('0x20')]();}else if(_0xf27376[_0x9293('0x3a')]===_0x9293('0x3f')&&_0xf27376[_0x9293('0x1b')]&&_0xf27376[_0x9293('0x3c')]){_0x52fbf9['custom_fields'][_0x9293('0x1a')]({'id':_0xf27376[_0x9293('0x1b')],'value':_0xf27376[_0x9293('0x3e')][_0x9293('0x20')]()});}else if(_0xf27376[_0x9293('0x3a')]===_0x9293('0x40')&&_0xf27376[_0x9293('0x19')]&&_0xf27376[_0x9293('0x1b')]&&_0xf27376[_0x9293('0x3c')]){_0x4948f8[_0xf27376[_0x9293('0x19')]]&&_0x52fbf9[_0x9293('0x41')][_0x9293('0x1a')]({'id':_0xf27376[_0x9293('0x1b')],'value':_0x4948f8[_0xf27376[_0x9293('0x19')]][_0x9293('0x20')]()});}else if(_0xf27376[_0x9293('0x3a')]===_0x9293('0x42')&&_0xf27376[_0x9293('0x43')]&&_0xf27376[_0x9293('0x43')][_0x9293('0x16')]&&_0xf27376['idField']&&_0xf27376[_0x9293('0x3c')]){_0x4948f8[_0xf27376[_0x9293('0x43')]['name'][_0x9293('0x3d')]()]&&_0x52fbf9[_0x9293('0x41')][_0x9293('0x1a')]({'id':_0xf27376['idField'],'value':_0x4948f8[_0xf27376['Variable'][_0x9293('0x16')]['toLowerCase']()][_0x9293('0x20')]()});}});}return _0x52fbf9;}function getConnection(_0x54ec67){return request({'method':_0x9293('0xa'),'form':{'method':_0x9293('0x44'),'input_type':_0x9293('0x1d'),'response_type':_0x9293('0x1d'),'rest_data':JSON[_0x9293('0x1e')]({'user_auth':{'user_name':_0x54ec67[_0x9293('0x45')],'password':_0x54ec67[_0x9293('0x46')],'encryption':_0x9293('0x47')},'application':_0x9293('0x48')})}})['then'](function(_0x8adab9){var _0x4ca041=_0x8adab9;if(_0x4ca041['id']){def[_0x9293('0x49')]=_0x4ca041['id'];return BPromise[_0x9293('0x2d')](_0x4ca041);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x54ec67['id']));}});}function setRelationship(_0x4a7212,_0x46284c,_0x475880,_0x6d20b7){return request({'form':{'method':_0x9293('0x4a'),'input_type':_0x9293('0x1d'),'response_type':'JSON','rest_data':JSON[_0x9293('0x1e')]({'session':_0x4a7212['id'],'module_name':_0x9293('0x4b'),'module_id':_0x475880['id'],'link_field_name':_0x6d20b7,'related_ids':[_0x46284c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9293('0x4c')]=function(_0x4b8391,_0x219e9,_0x40695b,_0x28401a,_0x517e47,_0x180bab){var _0x176d37,_0x5452ef,_0x2e9b94,_0xd9cf82;_0x180bab[_0x9293('0x4d')]=intUtil[_0x9293('0x4e')](_0x180bab['remoteUri']);_0x180bab[_0x9293('0x4f')]=intUtil['stripTrailingSlash'](_0x180bab[_0x9293('0x4f')]);def[_0x9293('0x50')]=util[_0x9293('0x32')]('%s/service/v4_1/rest.php',_0x180bab[_0x9293('0x4d')]);if(_0x517e47&&_0x517e47['monitor_format']){logger[_0x9293('0x23')]('[QUEUE]',_0x9293('0x51'));_0x219e9['recordingURL']=util['format'](_0x9293('0x52'),_0x180bab[_0x9293('0x4f')],_0x219e9['uniqueid'],md5(_0x219e9['uniqueid']));}else{_0x219e9['recordingURL']='';}return getConnection(_0x180bab)[_0x9293('0x53')](function(_0x64c2bd){_0xd9cf82=_0x64c2bd;return getUser(_0x180bab,_0x28401a[_0x9293('0x16')],_0xd9cf82);})[_0x9293('0x53')](function(_0x55ba18){_0x176d37=_0x55ba18;logger['info'](_0x9293('0x54'),_0x176d37['id']);return getEndUser(_0x180bab,_0x219e9[_0x9293('0x55')],_0x219e9[_0x9293('0x56')],_0xd9cf82);})['then'](function(_0x4f4aad){_0x5452ef=_0x4f4aad;logger[_0x9293('0x23')](_0x9293('0x57'),_0x5452ef['id']);return getTicket(_0x180bab,_0x176d37,_0x5452ef,_0x40695b,_0x219e9,_0x40695b[_0x9293('0x58')],_0xd9cf82,'Inbound');})['then'](function(_0x57733a){_0x2e9b94=_0x57733a;logger[_0x9293('0x23')]('Ticket\x20created!');logger[_0x9293('0x23')](_0x9293('0x59'),_0x2e9b94['id']);return setRelationship(_0xd9cf82,_0x176d37,_0x2e9b94,_0x9293('0x5a'));})['then'](function(){return setRelationship(_0xd9cf82,_0x5452ef,_0x2e9b94,_0x9293('0x5b'));})[_0x9293('0x53')](function(){return getServerInfo(_0xd9cf82);})['then'](function(_0x5c3d8e){var _0x5ea00f=parseInt(_0x5c3d8e[_0x9293('0x5c')][_0x9293('0x5d')](0x0));var _0x1b4942=util[_0x9293('0x32')](_0x9293('0x5e'),_0x180bab[_0x9293('0x4d')],_0x2e9b94['id']);if(_0x5ea00f>0x6){_0x1b4942=util[_0x9293('0x32')](_0x9293('0x5f'),_0x180bab[_0x9293('0x4d')],_0x2e9b94['id']);}logger[_0x9293('0x23')](_0x9293('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x9293('0x61'),_0x28401a[_0x9293('0x16')]),'trigger:browser:url',{'uri':_0x1b4942});})[_0x9293('0x62')](function(_0x3e460d){logger['error'](_0x9293('0x60'),JSON[_0x9293('0x1e')](_0x3e460d));});};exports['outbound']=function(_0x2bcd23,_0x56088a,_0x573333,_0x5f1202,_0xfeac72,_0x30b521,_0x1e07fc){var _0x598b84,_0x122637,_0x5a217f,_0x4b105b;_0x30b521[_0x9293('0x4d')]=intUtil[_0x9293('0x4e')](_0x30b521['remoteUri']);_0x30b521[_0x9293('0x4f')]=intUtil['stripTrailingSlash'](_0x30b521[_0x9293('0x4f')]);def[_0x9293('0x50')]=util[_0x9293('0x32')](_0x9293('0x63'),_0x30b521[_0x9293('0x4d')]);if(_0x1e07fc&&_0x1e07fc[_0x9293('0x64')]&&_0x1e07fc['recordingFormat']!=='none'){logger[_0x9293('0x23')](_0x9293('0x65'),_0x9293('0x51'));_0x56088a[_0x9293('0x66')]=util['format'](_0x9293('0x52'),_0x30b521['serverUrl'],_0x56088a[_0x9293('0x67')],md5(_0x56088a[_0x9293('0x67')]));}return getConnection(_0x30b521)[_0x9293('0x53')](function(_0x2d740d){_0x4b105b=_0x2d740d;return getUser(_0x30b521,_0x5f1202[_0x9293('0x16')],_0x4b105b);})[_0x9293('0x53')](function(_0x1eba6f){_0x598b84=_0x1eba6f;logger[_0x9293('0x23')]('The\x20User\x20ID\x20is:',_0x598b84['id']);return getEndUser(_0x30b521,_0x56088a[_0x9293('0x68')],_0x56088a[_0x9293('0x69')],_0x4b105b);})[_0x9293('0x53')](function(_0x90b67){_0x122637=_0x90b67;logger['info'](_0x9293('0x57'),_0x122637['id']);return getTicket(_0x30b521,_0x598b84,_0x122637,_0x573333,_0x56088a,_0x573333[_0x9293('0x58')],_0x4b105b,_0x9293('0x6a'));})[_0x9293('0x53')](function(_0x19a47c){_0x5a217f=_0x19a47c;logger[_0x9293('0x23')](_0x9293('0x6b'));logger['info'](_0x9293('0x59'),_0x5a217f['id']);return setRelationship(_0x4b105b,_0x598b84,_0x5a217f,_0x9293('0x5a'));})[_0x9293('0x53')](function(){return setRelationship(_0x4b105b,_0x122637,_0x5a217f,'contacts');})[_0x9293('0x53')](function(){return getServerInfo(_0x4b105b);})[_0x9293('0x53')](function(_0x291a04){var _0x4ae5a3=parseInt(_0x291a04[_0x9293('0x5c')]['charAt'](0x0));var _0x170ff8=util[_0x9293('0x32')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x30b521[_0x9293('0x4d')],_0x5a217f['id']);if(_0x4ae5a3>0x6){_0x170ff8=util[_0x9293('0x32')](_0x9293('0x5f'),_0x30b521[_0x9293('0x4d')],_0x5a217f['id']);}logger[_0x9293('0x23')](_0x9293('0x65'),_0x9293('0x6c'));emit(util[_0x9293('0x32')]('user:%s',_0x5f1202[_0x9293('0x16')]),_0x9293('0x6d'),{'uri':_0x170ff8});})[_0x9293('0x62')](function(_0x1a00e4){logger[_0x9293('0x6e')](_0x9293('0x65'),JSON[_0x9293('0x1e')](_0x1a00e4));});};exports['unmanaged']=function(_0x12a28b,_0x16b278,_0x41dd66,_0x2bf1c2,_0x1bfdb2,_0x46f202){var _0x365def,_0x1f743c,_0x1de41d,_0x489811;_0x46f202['remoteUri']=intUtil['stripTrailingSlash'](_0x46f202['remoteUri']);_0x46f202[_0x9293('0x4f')]=intUtil[_0x9293('0x4e')](_0x46f202[_0x9293('0x4f')]);def[_0x9293('0x50')]=util['format'](_0x9293('0x63'),_0x46f202[_0x9293('0x4d')]);if(_0x1bfdb2&&_0x1bfdb2['monitor_format']){logger[_0x9293('0x23')]('['+_0x16b278[_0x9293('0x6f')]['toUpperCase']()+']',_0x9293('0x51'));_0x16b278[_0x9293('0x66')]=util[_0x9293('0x32')](_0x9293('0x52'),_0x46f202[_0x9293('0x4f')],_0x16b278[_0x9293('0x67')],md5(_0x16b278[_0x9293('0x67')]));}else{_0x16b278[_0x9293('0x66')]='';}return getConnection(_0x46f202)[_0x9293('0x53')](function(_0x522350){_0x489811=_0x522350;if(!_[_0x9293('0x22')](_0x2bf1c2)){return getUser(_0x46f202,_0x2bf1c2[_0x9293('0x16')],_0x489811);}else{return getUser(_0x46f202,null,_0x489811);}})[_0x9293('0x53')](function(_0x3faf4d){_0x365def=_0x3faf4d;logger['info']('The\x20User\x20ID\x20is:',_0x365def['id']);return getEndUser(_0x46f202,_0x16b278['calleridname'],_0x16b278[_0x9293('0x56')],_0x489811);})[_0x9293('0x53')](function(_0x970864){_0x1f743c=_0x970864;logger[_0x9293('0x23')]('The\x20Enduser\x20ID\x20is:',_0x1f743c['id']);return getTicket(_0x46f202,_0x365def,_0x1f743c,_0x41dd66,_0x16b278,_0x41dd66[_0x9293('0x58')],_0x489811,'Inbound');})[_0x9293('0x53')](function(_0x5b6f26){_0x1de41d=_0x5b6f26;logger[_0x9293('0x23')]('Ticket\x20created!');logger[_0x9293('0x23')]('The\x20Ticket\x20ID\x20is:',_0x1de41d['id']);return setRelationship(_0x489811,_0x365def,_0x1de41d,_0x9293('0x5a'));})[_0x9293('0x53')](function(){return setRelationship(_0x489811,_0x1f743c,_0x1de41d,'contacts');})[_0x9293('0x53')](function(){return getServerInfo(_0x489811);})[_0x9293('0x62')](function(_0x42d9cb){logger[_0x9293('0x6e')]('['+_0x16b278[_0x9293('0x6f')][_0x9293('0x70')]()+']',JSON['stringify'](_0x42d9cb));});}; \ No newline at end of file +var _0x3678=['duration_hours','duration_minutes','parent_id','parent_type','Contacts','push','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','then','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Enduser\x20created.','debug','merge','forEach','type','string','nameField','customField','toLowerCase','content','idField','variable','variableName','customVariable','Variable','custom_fields','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','uri','recordingFormat','none','recordingURL','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','catch','error','unmanaged','monitor_format','lastevent','toUpperCase','contacts','request-promise','bluebird','util','ioredis','redis','defaults','localhost','socket.io-emitter','POST','info','name','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3678,0x158));var _0x8367=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x3678[_0x531cb8];return _0x5cf297;};'use strict';var _=require('lodash');var rp=require(_0x8367('0x0'));var BPromise=require(_0x8367('0x1'));var md5=require('md5');var util=require(_0x8367('0x2'));var Redis=require(_0x8367('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('sugarcrm');config[_0x8367('0x4')]=_[_0x8367('0x5')](config[_0x8367('0x4')],{'host':_0x8367('0x6'),'port':0x18eb});var io=require(_0x8367('0x7'))(new Redis(config[_0x8367('0x4')]));var def={'method':_0x8367('0x8'),'json':!![]};function emit(_0x4df2bd,_0x9d83ce,_0x55c463){io['to'](_0x4df2bd)['emit'](_0x9d83ce,_0x55c463);}function getTicket(_0x43c1fe,_0x52d6a0,_0x10e7bf,_0x18caa1,_0x1c0449,_0x199886,_0x5df071,_0x3613d2){logger[_0x8367('0x9')]('Creating\x20new\x20ticket...');var _0x155485=new Date();var _0x2d47ef=[{'name':_0x8367('0xa'),'value':intUtil['getString'](_0x18caa1['Subjects'],_0x1c0449,'\x20')},{'name':'assigned_user_id','value':_0x52d6a0['id']},{'name':_0x8367('0xb'),'value':_0x52d6a0['id']},{'name':_0x8367('0xc'),'value':intUtil[_0x8367('0xd')](_0x18caa1[_0x8367('0xe')],_0x1c0449,'\x0a')},{'name':_0x8367('0xf'),'value':_0x155485[_0x8367('0x10')]()[_0x8367('0x11')](0x0,0x13)[_0x8367('0x12')]('T','\x20')},{'name':_0x8367('0x13'),'value':'0'},{'name':_0x8367('0x14'),'value':'15'},{'name':_0x8367('0x15'),'value':_0x10e7bf['id']},{'name':_0x8367('0x16'),'value':_0x8367('0x17')},{'name':'parent_name','value':_0x10e7bf[_0x8367('0xa')]},{'name':'direction','value':_0x3613d2}];if(_0x199886['length']){_['forEach'](_0x199886,function(_0x15a1da){if(_0x1c0449[_0x15a1da['variableName']]){_0x2d47ef[_0x8367('0x18')]({'name':_0x15a1da['idField'],'value':_0x1c0449[_0x15a1da['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x8367('0x19'),'rest_data':JSON[_0x8367('0x1a')]({'session':_0x5df071['id'],'module_name':_0x8367('0x1b'),'name_value_list':_0x2d47ef})}});}function getAuth(_0x10406b){return util[_0x8367('0x1c')](_0x8367('0x1d'),new Buffer(_0x10406b[_0x8367('0x1e')]+':X')[_0x8367('0x1f')](_0x8367('0x20')));}function getServerInfo(_0x4c6488){return request({'form':{'method':_0x8367('0x21'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8367('0x1a')]({'session':_0x4c6488['id']})}});}function getUser(_0x1c45e7,_0x1c90d2,_0x44591a){if(!_[_0x8367('0x22')](_0x1c90d2)){logger['info'](_0x8367('0x23'),_0x1c90d2);return request({'form':{'method':'get_entry_list','input_type':_0x8367('0x19'),'response_type':_0x8367('0x19'),'rest_data':JSON[_0x8367('0x1a')]({'session':_0x44591a['id'],'module_name':_0x8367('0x24'),'query':util['format'](_0x8367('0x25'),_0x1c90d2),'order_by':'','offset':'0','select_fields':['id',_0x8367('0xa'),_0x8367('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2787a3){if(_0x2787a3[_0x8367('0x27')][_0x8367('0x28')]){var _0x2ed258=_[_0x8367('0x29')](_0x2787a3['entry_list'],function(_0x22ffae){return _0x22ffae['name_value_list'][_0x8367('0x26')][_0x8367('0x2a')]===_0x1c90d2;});if(_0x2ed258){logger['info'](_0x8367('0x2b'));return BPromise[_0x8367('0x2c')]({'id':_0x2ed258[_0x8367('0x2d')]['id'][_0x8367('0x2a')],'name':_0x2ed258[_0x8367('0x2d')][_0x8367('0xa')][_0x8367('0x2a')]});}}logger[_0x8367('0x9')](_0x8367('0x2e'));return BPromise[_0x8367('0x2c')]({'id':_0x44591a['name_value_list'][_0x8367('0x2f')][_0x8367('0x2a')],'name':_0x44591a[_0x8367('0x2d')][_0x8367('0x26')][_0x8367('0x2a')]});});}else{logger[_0x8367('0x9')](_0x8367('0x30'));return BPromise[_0x8367('0x2c')]({'id':_0x44591a[_0x8367('0x2d')][_0x8367('0x2f')][_0x8367('0x2a')],'name':_0x44591a[_0x8367('0x2d')][_0x8367('0x26')][_0x8367('0x2a')]});}}function getEndUser(_0x39f13d,_0x560064,_0x3ba378,_0x52dce2){logger['info'](_0x8367('0x31'),_0x3ba378);return request({'form':{'method':'get_entry_list','input_type':_0x8367('0x19'),'response_type':'JSON','rest_data':JSON[_0x8367('0x1a')]({'session':_0x52dce2['id'],'module_name':_0x8367('0x17'),'query':util[_0x8367('0x1c')](_0x8367('0x32'),_0x3ba378),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8367('0x33')](function(_0x29a523){if(_0x29a523['entry_list'][_0x8367('0x28')]){var _0x4f4a95=_[_0x8367('0x29')](_0x29a523[_0x8367('0x27')],function(_0x218dab){return _0x218dab[_0x8367('0x2d')][_0x8367('0x34')][_0x8367('0x2a')]===_0x3ba378;});if(_0x4f4a95){logger[_0x8367('0x9')](_0x8367('0x35'));return BPromise[_0x8367('0x2c')]({'id':_0x4f4a95[_0x8367('0x2d')]['id']['value'],'name':_0x4f4a95[_0x8367('0x2d')][_0x8367('0xa')][_0x8367('0x2a')],'phone':_0x4f4a95['name_value_list']['phone_home'][_0x8367('0x2a')]});}}else{logger[_0x8367('0x9')](_0x8367('0x36'));return request({'form':{'method':_0x8367('0x37'),'input_type':'JSON','response_type':_0x8367('0x19'),'rest_data':JSON[_0x8367('0x1a')]({'session':_0x52dce2['id'],'module_name':_0x8367('0x17'),'name_value_list':[{'name':_0x8367('0x38'),'value':_0x560064!==_0x8367('0x39')?_0x560064:util['format']('Caller\x20-\x20%s',_0x3ba378)},{'name':_0x8367('0x34'),'value':_0x3ba378}]})}})['then'](function(_0x568cc2){logger['info'](_0x8367('0x3a'));return BPromise[_0x8367('0x2c')]({'id':_0x568cc2['id'],'name':_0x568cc2['entry_list']['first_name'][_0x8367('0x2a')],'phone':_0x568cc2[_0x8367('0x27')]['phone_home'][_0x8367('0x2a')]});});}});}function request(_0x5d554f){logger[_0x8367('0x3b')]('[HTTP]',JSON['stringify'](_0x5d554f));return rp(_[_0x8367('0x3c')](def,_0x5d554f));}function getTags(_0x498c90,_0x2d9116){var _0x28aa2d=[];if(_0x498c90&&_0x498c90[_0x8367('0x28')]>0x0){_0x28aa2d=_['map'](_0x498c90,_0x2d9116);}return _0x28aa2d;}function getCustomFields(_0x4c354d,_0x420d78){var _0x291fd1=[];var _0x7f6184={'custom_fields':[]};if(_0x4c354d['length']>0x0){_[_0x8367('0x3d')](_0x4c354d,function(_0x2e9f20){if(_0x2e9f20[_0x8367('0x3e')]===_0x8367('0x3f')&&_0x2e9f20[_0x8367('0x40')]&&!_0x2e9f20[_0x8367('0x41')]){_0x7f6184[_0x2e9f20[_0x8367('0x40')][_0x8367('0x42')]()]=_0x2e9f20[_0x8367('0x43')][_0x8367('0x1f')]();}else if(_0x2e9f20[_0x8367('0x3e')]===_0x8367('0x3f')&&_0x2e9f20[_0x8367('0x44')]&&_0x2e9f20[_0x8367('0x41')]){_0x7f6184['custom_fields']['push']({'id':_0x2e9f20[_0x8367('0x44')],'value':_0x2e9f20['content'][_0x8367('0x1f')]()});}else if(_0x2e9f20[_0x8367('0x3e')]===_0x8367('0x45')&&_0x2e9f20['variableName']&&_0x2e9f20[_0x8367('0x44')]&&_0x2e9f20[_0x8367('0x41')]){_0x420d78[_0x2e9f20[_0x8367('0x46')]]&&_0x7f6184['custom_fields']['push']({'id':_0x2e9f20[_0x8367('0x44')],'value':_0x420d78[_0x2e9f20[_0x8367('0x46')]][_0x8367('0x1f')]()});}else if(_0x2e9f20[_0x8367('0x3e')]===_0x8367('0x47')&&_0x2e9f20[_0x8367('0x48')]&&_0x2e9f20['Variable'][_0x8367('0xa')]&&_0x2e9f20[_0x8367('0x44')]&&_0x2e9f20[_0x8367('0x41')]){_0x420d78[_0x2e9f20['Variable'][_0x8367('0xa')]['toLowerCase']()]&&_0x7f6184[_0x8367('0x49')][_0x8367('0x18')]({'id':_0x2e9f20[_0x8367('0x44')],'value':_0x420d78[_0x2e9f20[_0x8367('0x48')][_0x8367('0xa')]['toLowerCase']()][_0x8367('0x1f')]()});}});}return _0x7f6184;}function getConnection(_0x178286){return request({'method':_0x8367('0x8'),'form':{'method':_0x8367('0x4a'),'input_type':_0x8367('0x19'),'response_type':_0x8367('0x19'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x178286['username'],'password':_0x178286[_0x8367('0x4b')],'encryption':_0x8367('0x4c')},'application':_0x8367('0x4d')})}})['then'](function(_0x11c0d1){var _0x225a30=_0x11c0d1;if(_0x225a30['id']){def[_0x8367('0x4e')]=_0x225a30['id'];return BPromise['resolve'](_0x225a30);}else{throw new Error(util[_0x8367('0x1c')](_0x8367('0x4f'),_0x178286['id']));}});}function setRelationship(_0x5dedee,_0x1ea135,_0x4b83ce,_0x4fabed){return request({'form':{'method':_0x8367('0x50'),'input_type':_0x8367('0x19'),'response_type':_0x8367('0x19'),'rest_data':JSON[_0x8367('0x1a')]({'session':_0x5dedee['id'],'module_name':_0x8367('0x1b'),'module_id':_0x4b83ce['id'],'link_field_name':_0x4fabed,'related_ids':[_0x1ea135['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8367('0x51')]=function(_0x321eec,_0x4249eb,_0xa8eb76,_0x4f767e,_0x3650db,_0x1640ee){var _0x5a84b7,_0xe144d0,_0x1187ec,_0x3f505a;_0x1640ee[_0x8367('0x52')]=intUtil[_0x8367('0x53')](_0x1640ee[_0x8367('0x52')]);_0x1640ee[_0x8367('0x54')]=intUtil[_0x8367('0x53')](_0x1640ee[_0x8367('0x54')]);def['uri']=util[_0x8367('0x1c')](_0x8367('0x55'),_0x1640ee[_0x8367('0x52')]);if(_0x3650db&&_0x3650db['monitor_format']){logger[_0x8367('0x9')](_0x8367('0x56'),_0x8367('0x57'));_0x4249eb['recordingURL']=util[_0x8367('0x1c')](_0x8367('0x58'),_0x1640ee[_0x8367('0x54')],_0x4249eb[_0x8367('0x59')],md5(_0x4249eb[_0x8367('0x59')]));}else{_0x4249eb['recordingURL']='';}return getConnection(_0x1640ee)[_0x8367('0x33')](function(_0x34fe91){_0x3f505a=_0x34fe91;return getUser(_0x1640ee,_0x4f767e['name'],_0x3f505a);})[_0x8367('0x33')](function(_0x465993){_0x5a84b7=_0x465993;logger[_0x8367('0x9')](_0x8367('0x5a'),_0x5a84b7['id']);return getEndUser(_0x1640ee,_0x4249eb[_0x8367('0x5b')],_0x4249eb[_0x8367('0x5c')],_0x3f505a);})['then'](function(_0x6c254c){_0xe144d0=_0x6c254c;logger[_0x8367('0x9')]('The\x20Enduser\x20ID\x20is:',_0xe144d0['id']);return getTicket(_0x1640ee,_0x5a84b7,_0xe144d0,_0xa8eb76,_0x4249eb,_0xa8eb76[_0x8367('0x5d')],_0x3f505a,'Inbound');})['then'](function(_0x1b6d08){_0x1187ec=_0x1b6d08;logger[_0x8367('0x9')](_0x8367('0x5e'));logger[_0x8367('0x9')](_0x8367('0x5f'),_0x1187ec['id']);return setRelationship(_0x3f505a,_0x5a84b7,_0x1187ec,_0x8367('0x60'));})[_0x8367('0x33')](function(){return setRelationship(_0x3f505a,_0xe144d0,_0x1187ec,'contacts');})[_0x8367('0x33')](function(){return getServerInfo(_0x3f505a);})['then'](function(_0x3a7138){var _0x2f2169=parseInt(_0x3a7138[_0x8367('0x61')][_0x8367('0x62')](0x0));var _0x4f2fd3=util[_0x8367('0x1c')](_0x8367('0x63'),_0x1640ee['remoteUri'],_0x1187ec['id']);if(_0x2f2169>0x6){_0x4f2fd3=util[_0x8367('0x1c')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1640ee['remoteUri'],_0x1187ec['id']);}logger[_0x8367('0x9')]('[QUEUE]',_0x8367('0x64'));emit(util['format'](_0x8367('0x65'),_0x4f767e[_0x8367('0xa')]),_0x8367('0x66'),{'uri':_0x4f2fd3});})['catch'](function(_0x29284b){logger['error'](_0x8367('0x56'),JSON[_0x8367('0x1a')](_0x29284b));});};exports[_0x8367('0x67')]=function(_0x3bd422,_0x5c1226,_0x2b3aa9,_0x112490,_0x498156,_0x43c0a6,_0x4ed717){var _0x34896b,_0x3d7d69,_0x1cd789,_0x33e57c;_0x43c0a6[_0x8367('0x52')]=intUtil[_0x8367('0x53')](_0x43c0a6[_0x8367('0x52')]);_0x43c0a6[_0x8367('0x54')]=intUtil[_0x8367('0x53')](_0x43c0a6[_0x8367('0x54')]);def[_0x8367('0x68')]=util['format'](_0x8367('0x55'),_0x43c0a6['remoteUri']);if(_0x4ed717&&_0x4ed717[_0x8367('0x69')]&&_0x4ed717[_0x8367('0x69')]!==_0x8367('0x6a')){logger[_0x8367('0x9')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5c1226[_0x8367('0x6b')]=util[_0x8367('0x1c')](_0x8367('0x58'),_0x43c0a6[_0x8367('0x54')],_0x5c1226[_0x8367('0x59')],md5(_0x5c1226[_0x8367('0x59')]));}return getConnection(_0x43c0a6)['then'](function(_0x5dafc9){_0x33e57c=_0x5dafc9;return getUser(_0x43c0a6,_0x112490[_0x8367('0xa')],_0x33e57c);})[_0x8367('0x33')](function(_0x2d6f50){_0x34896b=_0x2d6f50;logger[_0x8367('0x9')](_0x8367('0x5a'),_0x34896b['id']);return getEndUser(_0x43c0a6,_0x5c1226[_0x8367('0x6c')],_0x5c1226[_0x8367('0x6d')],_0x33e57c);})[_0x8367('0x33')](function(_0x4f9602){_0x3d7d69=_0x4f9602;logger[_0x8367('0x9')](_0x8367('0x6e'),_0x3d7d69['id']);return getTicket(_0x43c0a6,_0x34896b,_0x3d7d69,_0x2b3aa9,_0x5c1226,_0x2b3aa9[_0x8367('0x5d')],_0x33e57c,_0x8367('0x6f'));})[_0x8367('0x33')](function(_0x47e211){_0x1cd789=_0x47e211;logger[_0x8367('0x9')](_0x8367('0x5e'));logger[_0x8367('0x9')]('The\x20Ticket\x20ID\x20is:',_0x1cd789['id']);return setRelationship(_0x33e57c,_0x34896b,_0x1cd789,_0x8367('0x60'));})[_0x8367('0x33')](function(){return setRelationship(_0x33e57c,_0x3d7d69,_0x1cd789,'contacts');})[_0x8367('0x33')](function(){return getServerInfo(_0x33e57c);})[_0x8367('0x33')](function(_0xf8d36c){var _0x29a491=parseInt(_0xf8d36c[_0x8367('0x61')][_0x8367('0x62')](0x0));var _0x50a49c=util[_0x8367('0x1c')](_0x8367('0x63'),_0x43c0a6['remoteUri'],_0x1cd789['id']);if(_0x29a491>0x6){_0x50a49c=util[_0x8367('0x1c')](_0x8367('0x70'),_0x43c0a6[_0x8367('0x52')],_0x1cd789['id']);}logger['info'](_0x8367('0x71'),_0x8367('0x64'));emit(util[_0x8367('0x1c')](_0x8367('0x65'),_0x112490[_0x8367('0xa')]),_0x8367('0x66'),{'uri':_0x50a49c});})[_0x8367('0x72')](function(_0x37df42){logger[_0x8367('0x73')]('[OUTBOUND]',JSON['stringify'](_0x37df42));});};exports[_0x8367('0x74')]=function(_0x4eb36a,_0x5c4b6a,_0x4b62eb,_0x455e10,_0x56a692,_0x595d6b){var _0xc66923,_0x674d4e,_0x1e8b20,_0x5d5c21;_0x595d6b[_0x8367('0x52')]=intUtil[_0x8367('0x53')](_0x595d6b[_0x8367('0x52')]);_0x595d6b['serverUrl']=intUtil[_0x8367('0x53')](_0x595d6b[_0x8367('0x54')]);def[_0x8367('0x68')]=util['format'](_0x8367('0x55'),_0x595d6b[_0x8367('0x52')]);if(_0x56a692&&_0x56a692[_0x8367('0x75')]){logger['info']('['+_0x5c4b6a[_0x8367('0x76')][_0x8367('0x77')]()+']','Recording\x20is\x20enabled!');_0x5c4b6a['recordingURL']=util[_0x8367('0x1c')](_0x8367('0x58'),_0x595d6b[_0x8367('0x54')],_0x5c4b6a[_0x8367('0x59')],md5(_0x5c4b6a['uniqueid']));}else{_0x5c4b6a['recordingURL']='';}return getConnection(_0x595d6b)[_0x8367('0x33')](function(_0x43237a){_0x5d5c21=_0x43237a;if(!_[_0x8367('0x22')](_0x455e10)){return getUser(_0x595d6b,_0x455e10[_0x8367('0xa')],_0x5d5c21);}else{return getUser(_0x595d6b,null,_0x5d5c21);}})['then'](function(_0xa3bbc7){_0xc66923=_0xa3bbc7;logger[_0x8367('0x9')](_0x8367('0x5a'),_0xc66923['id']);return getEndUser(_0x595d6b,_0x5c4b6a['calleridname'],_0x5c4b6a[_0x8367('0x5c')],_0x5d5c21);})[_0x8367('0x33')](function(_0x5b1d6f){_0x674d4e=_0x5b1d6f;logger[_0x8367('0x9')]('The\x20Enduser\x20ID\x20is:',_0x674d4e['id']);return getTicket(_0x595d6b,_0xc66923,_0x674d4e,_0x4b62eb,_0x5c4b6a,_0x4b62eb[_0x8367('0x5d')],_0x5d5c21,'Inbound');})[_0x8367('0x33')](function(_0x4b4f02){_0x1e8b20=_0x4b4f02;logger[_0x8367('0x9')]('Ticket\x20created!');logger[_0x8367('0x9')](_0x8367('0x5f'),_0x1e8b20['id']);return setRelationship(_0x5d5c21,_0xc66923,_0x1e8b20,_0x8367('0x60'));})['then'](function(){return setRelationship(_0x5d5c21,_0x674d4e,_0x1e8b20,_0x8367('0x78'));})[_0x8367('0x33')](function(){return getServerInfo(_0x5d5c21);})['catch'](function(_0x1fa174){logger[_0x8367('0x73')]('['+_0x5c4b6a['lastevent'][_0x8367('0x77')]()+']',JSON['stringify'](_0x1fa174));});}; \ 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 90af6f8..3696fdd 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 _0x9add=['format','%s:\x20%s','keyContent','keyType','key','toLowerCase','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name','keyValue'];(function(_0x3639da,_0x13c52c){var _0x3e2785=function(_0x27be25){while(--_0x27be25){_0x3639da['push'](_0x3639da['shift']());}};_0x3e2785(++_0x13c52c);}(_0x9add,0x151));var _0xd9ad=function(_0x2f5cdb,_0x364528){_0x2f5cdb=_0x2f5cdb-0x0;var _0x1412fb=_0x9add[_0x2f5cdb];return _0x1412fb;};'use strict';var _=require(_0xd9ad('0x0'));var util=require('util');exports[_0xd9ad('0x1')]=function(_0x3cc90a,_0xf59ecc,_0x595b38){var _0x370d7f=[];if(_0x3cc90a[_0xd9ad('0x2')]>0x0){var _0x51e87e=_[_0xd9ad('0x3')](_0x3cc90a,['id']);for(var _0x478c10=0x0;_0x478c10<_0x51e87e[_0xd9ad('0x2')];_0x478c10++){var _0x437b7=_0x51e87e[_0x478c10];if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0x5')){_0x370d7f[_0xd9ad('0x6')](_0x437b7['content']);}else if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0x7')&&_0x437b7[_0xd9ad('0x8')]){_0xf59ecc[_0x437b7[_0xd9ad('0x8')]]&&_0x370d7f['push'](_0xf59ecc[_0x437b7[_0xd9ad('0x8')]][_0xd9ad('0x9')]());}else if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0xa')&&_0x437b7[_0xd9ad('0xb')]&&_0x437b7[_0xd9ad('0xb')]['name']){_0xf59ecc[_0x437b7[_0xd9ad('0xb')]['name']['toLowerCase']()]&&_0x370d7f[_0xd9ad('0x6')](_0xf59ecc[_0x437b7[_0xd9ad('0xb')][_0xd9ad('0xc')]['toLowerCase']()][_0xd9ad('0x9')]());}else if(_0x437b7[_0xd9ad('0x4')]===_0xd9ad('0xd')){if(_0x437b7['keyType']==='string'&&_0x437b7['key']){_0x370d7f[_0xd9ad('0x6')](util[_0xd9ad('0xe')](_0xd9ad('0xf'),_0x437b7['key'],_0x437b7[_0xd9ad('0x10')]));}else if(_0x437b7[_0xd9ad('0x11')]===_0xd9ad('0x7')&&_0x437b7['variableName']&&_0x437b7[_0xd9ad('0x12')]){_0xf59ecc[_0x437b7[_0xd9ad('0x8')]]&&_0x370d7f['push'](util[_0xd9ad('0xe')](_0xd9ad('0xf'),_0x437b7[_0xd9ad('0x12')],_0xf59ecc[_0x437b7[_0xd9ad('0x8')]]));}else if(_0x437b7[_0xd9ad('0x11')]===_0xd9ad('0xa')&&_0x437b7[_0xd9ad('0xb')]&&_0x437b7['Variable'][_0xd9ad('0xc')]&&_0x437b7['key']){_0xf59ecc[_0x437b7[_0xd9ad('0xb')][_0xd9ad('0xc')][_0xd9ad('0x13')]()]&&_0x370d7f[_0xd9ad('0x6')](util[_0xd9ad('0xe')](_0xd9ad('0xf'),_0x437b7['key'],_0xf59ecc[_0x437b7[_0xd9ad('0xb')][_0xd9ad('0xc')]['toLowerCase']()]));}}}}return _0x370d7f[_0xd9ad('0x14')](_0x595b38);};exports[_0xd9ad('0x15')]=function(_0x118877){var _0x291110=_0x118877[_0xd9ad('0x16')](-0x1);if(_0x291110==='/'){_0x118877=_0x118877[_0xd9ad('0x17')](0x0,_0x118877[_0xd9ad('0x18')](_0x291110));}return _0x118877;};exports[_0xd9ad('0x19')]=function(_0x3eff85){if(!_['isNil'](_0x3eff85)&&_0x3eff85!==''){var _0x59e4d6=/^(([^<>()\[\]\\.,;:\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 _0x59e4d6[_0xd9ad('0x1a')](String(_0x3eff85)[_0xd9ad('0x13')]());}else{return![];}}; \ No newline at end of file +var _0xb539=['join','stripTrailingSlash','validateEmail','isNil','lodash','util','length','type','string','content','variable','variableName','push','toString','Variable','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','name'];(function(_0x2b7338,_0x71669b){var _0x26660e=function(_0x575e78){while(--_0x575e78){_0x2b7338['push'](_0x2b7338['shift']());}};_0x26660e(++_0x71669b);}(_0xb539,0x19c));var _0x9b53=function(_0x26470c,_0x93a969){_0x26470c=_0x26470c-0x0;var _0x2ed360=_0xb539[_0x26470c];return _0x2ed360;};'use strict';var _=require(_0x9b53('0x0'));var util=require(_0x9b53('0x1'));exports['getString']=function(_0x14ce35,_0x4a10d8,_0x1f69d2){var _0x19156e=[];if(_0x14ce35[_0x9b53('0x2')]>0x0){var _0x4df90e=_['sortBy'](_0x14ce35,['id']);for(var _0x1b2815=0x0;_0x1b2815<_0x4df90e[_0x9b53('0x2')];_0x1b2815++){var _0x7098cd=_0x4df90e[_0x1b2815];if(_0x7098cd[_0x9b53('0x3')]===_0x9b53('0x4')){_0x19156e['push'](_0x7098cd[_0x9b53('0x5')]);}else if(_0x7098cd['type']===_0x9b53('0x6')&&_0x7098cd[_0x9b53('0x7')]){_0x4a10d8[_0x7098cd[_0x9b53('0x7')]]&&_0x19156e[_0x9b53('0x8')](_0x4a10d8[_0x7098cd[_0x9b53('0x7')]][_0x9b53('0x9')]());}else if(_0x7098cd['type']==='customVariable'&&_0x7098cd[_0x9b53('0xa')]&&_0x7098cd['Variable']['name']){_0x4a10d8[_0x7098cd[_0x9b53('0xa')]['name'][_0x9b53('0xb')]()]&&_0x19156e['push'](_0x4a10d8[_0x7098cd[_0x9b53('0xa')]['name'][_0x9b53('0xb')]()][_0x9b53('0x9')]());}else if(_0x7098cd[_0x9b53('0x3')]===_0x9b53('0xc')){if(_0x7098cd[_0x9b53('0xd')]===_0x9b53('0x4')&&_0x7098cd[_0x9b53('0xe')]){_0x19156e['push'](util[_0x9b53('0xf')](_0x9b53('0x10'),_0x7098cd['key'],_0x7098cd[_0x9b53('0x11')]));}else if(_0x7098cd[_0x9b53('0xd')]===_0x9b53('0x6')&&_0x7098cd[_0x9b53('0x7')]&&_0x7098cd[_0x9b53('0xe')]){_0x4a10d8[_0x7098cd[_0x9b53('0x7')]]&&_0x19156e[_0x9b53('0x8')](util[_0x9b53('0xf')]('%s:\x20%s',_0x7098cd[_0x9b53('0xe')],_0x4a10d8[_0x7098cd[_0x9b53('0x7')]]));}else if(_0x7098cd[_0x9b53('0xd')]===_0x9b53('0x12')&&_0x7098cd[_0x9b53('0xa')]&&_0x7098cd[_0x9b53('0xa')]['name']&&_0x7098cd['key']){_0x4a10d8[_0x7098cd[_0x9b53('0xa')]['name'][_0x9b53('0xb')]()]&&_0x19156e['push'](util[_0x9b53('0xf')](_0x9b53('0x10'),_0x7098cd['key'],_0x4a10d8[_0x7098cd['Variable'][_0x9b53('0x13')][_0x9b53('0xb')]()]));}}}}return _0x19156e[_0x9b53('0x14')](_0x1f69d2);};exports[_0x9b53('0x15')]=function(_0x471a31){var _0x25c2da=_0x471a31['slice'](-0x1);if(_0x25c2da==='/'){_0x471a31=_0x471a31['substring'](0x0,_0x471a31['lastIndexOf'](_0x25c2da));}return _0x471a31;};exports[_0x9b53('0x16')]=function(_0x372a2a){if(!_[_0x9b53('0x17')](_0x372a2a)&&_0x372a2a!==''){var _0x3e4109=/^(([^<>()\[\]\\.,;:\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 _0x3e4109['test'](String(_0x372a2a)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index a2b40f8..53f9583 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 _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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x1ee3e7,_0x38fffb){var _0x3f9d5b=function(_0x537b07){while(--_0x537b07){_0x1ee3e7['push'](_0x1ee3e7['shift']());}};_0x3f9d5b(++_0x38fffb);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 7fc1dc2..fd9c744 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 _0x0965=['results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','filter','end-user','length','first','%s/users.json','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','type','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','toString','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:browser:url','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname','request-promise','util','ioredis','../../../../config/environment','redis','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find'];(function(_0x3f6e68,_0x53142a){var _0x234f16=function(_0x4e3b50){while(--_0x4e3b50){_0x3f6e68['push'](_0x3f6e68['shift']());}};_0x234f16(++_0x53142a);}(_0x0965,0xb4));var _0x5096=function(_0x16037f,_0x375f3b){_0x16037f=_0x16037f-0x0;var _0x569806=_0x0965[_0x16037f];return _0x569806;};'use strict';var _=require('lodash');var rp=require(_0x5096('0x0'));var md5=require('md5');var util=require(_0x5096('0x1'));var Redis=require(_0x5096('0x2'));var intUtil=require('./util');var config=require(_0x5096('0x3'));var logger=require('../../../../config/logger')('zendesk');config[_0x5096('0x4')]=_['defaults'](config[_0x5096('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x842dcd,_0x195660,_0x50bfea){io['to'](_0x842dcd)[_0x5096('0x5')](_0x195660,_0x50bfea);}var headers={'Content-Type':_0x5096('0x6'),'Accept':'application/json'};function getTicket(_0xd697d6,_0x5f311f,_0x3a8812,_0x55facb,_0xb65175){logger[_0x5096('0x7')](_0x5096('0x8'));return request({'uri':util['format'](_0x5096('0x9'),_0xd697d6[_0x5096('0xa')]),'method':_0x5096('0xb'),'body':{'ticket':_[_0x5096('0xc')]({'requester_id':_0x3a8812['id'],'submitter_id':_0x5f311f?_0x5f311f['id']:undefined,'assignee_id':_0x5f311f?_0x5f311f['id']:undefined,'tags':getTags(_0x55facb[_0x5096('0xd')],_0x5096('0xe')),'subject':intUtil[_0x5096('0xf')](_0x55facb[_0x5096('0x10')],_0xb65175,'\x20'),'description':intUtil[_0x5096('0xf')](_0x55facb['Descriptions'],_0xb65175,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5096('0xf')](_0x55facb[_0x5096('0x11')],_0xb65175,'\x0a')}},getCustomFields(_0x55facb['Fields'],_0xb65175))}})[_0x5096('0x12')](function(_0x1231de){logger['info'](_0x5096('0x13'));return _0x1231de[_0x5096('0x14')];});}function getUser(_0x212ecd,_0x1123fe){if(intUtil[_0x5096('0x15')](_0x1123fe)){logger[_0x5096('0x7')](_0x5096('0x16'),_0x1123fe);return request({'uri':util[_0x5096('0x17')]('%s/search.json',_0x212ecd[_0x5096('0xa')]),'qs':{'query':util[_0x5096('0x17')](_0x5096('0x18'),_0x1123fe)}})[_0x5096('0x12')](function(_0x5b1a42){if(_0x5b1a42[_0x5096('0x19')]){logger[_0x5096('0x7')](_0x5096('0x1a'));return _[_0x5096('0x1b')](_0x5b1a42[_0x5096('0x1c')],{'email':_0x1123fe,'role':'agent'});}else{logger['info'](_0x5096('0x1d'));return request({'uri':util[_0x5096('0x17')](_0x5096('0x1e'),_0x212ecd[_0x5096('0xa')])})[_0x5096('0x12')](function(_0x737cbe){logger['info'](_0x5096('0x1f'));return _0x737cbe['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5096('0x17')](_0x5096('0x1e'),_0x212ecd[_0x5096('0xa')])})[_0x5096('0x12')](function(_0x4c098f){logger['info'](_0x5096('0x1f'));return _0x4c098f[_0x5096('0x20')];});}}function getEndUser(_0xb8bb82,_0x395dea,_0x64207f){logger[_0x5096('0x7')](_0x5096('0x21'),_0x64207f);return request({'uri':util[_0x5096('0x17')]('%s/search.json',_0xb8bb82[_0x5096('0xa')]),'qs':{'query':util[_0x5096('0x17')]('type:user\x20role:end-user\x20phone:%s',_0x64207f)}})['then'](function(_0xa715e1){var _0xeb230e;if(_0xa715e1[_0x5096('0x1c')]['length']){_0xa715e1[_0x5096('0x1c')]=_[_0x5096('0x22')](_0xa715e1[_0x5096('0x1c')],{'suspended':![],'role':_0x5096('0x23')});if(_0xa715e1[_0x5096('0x1c')][_0x5096('0x24')]){_0xeb230e=_[_0x5096('0x25')](_0xa715e1[_0x5096('0x1c')]);}}if(_0xeb230e){logger[_0x5096('0x7')]('Enduser\x20found!');return _0xeb230e;}else{logger[_0x5096('0x7')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x5096('0x17')](_0x5096('0x26'),_0xb8bb82['remoteUri']),'method':_0x5096('0xb'),'body':{'user':{'role':_0x5096('0x23'),'name':util[_0x5096('0x17')]('Caller\x20-\x20%s',_0x395dea||_0x64207f),'phone':_0x64207f}}})['then'](function(_0x2b1a2a){logger['info'](_0x5096('0x27'));return _0x2b1a2a['user'];});}});}function getAuth(_0x3185c9){var _0x158e1b;if(_0x3185c9[_0x5096('0x28')]===_0x5096('0x29')){_0x158e1b=util[_0x5096('0x17')]('%s:%s',_0x3185c9[_0x5096('0x2a')],_0x3185c9[_0x5096('0x29')]);}else if(_0x3185c9[_0x5096('0x28')]===_0x5096('0x2b')){_0x158e1b=util[_0x5096('0x17')](_0x5096('0x2c'),_0x3185c9[_0x5096('0x2a')],_0x3185c9[_0x5096('0x2b')]);}return util[_0x5096('0x17')](_0x5096('0x2d'),new Buffer(_0x158e1b)['toString'](_0x5096('0x2e')));}function request(_0x487fca){logger[_0x5096('0x2f')](_0x5096('0x30'),JSON[_0x5096('0x31')](_0x487fca));return rp(_[_0x5096('0x32')](_0x487fca,{'method':_0x5096('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x57a45d,_0x2836fe){var _0x4088b1=[];if(_0x57a45d&&_0x57a45d[_0x5096('0x24')]>0x0){_0x4088b1=_[_0x5096('0x34')](_0x57a45d,_0x2836fe);}return _0x4088b1;}function getCustomFields(_0x3a2c24,_0x1fa1a0){var _0x3109f8=[];var _0x2b5fe5={'custom_fields':[]};if(_0x3a2c24[_0x5096('0x24')]>0x0){_[_0x5096('0x35')](_0x3a2c24,function(_0x20c87b){if(_[_0x5096('0x36')]([_0x5096('0x37'),'picklist'],_0x20c87b[_0x5096('0x38')])&&_0x20c87b[_0x5096('0x39')]&&!_0x20c87b['customField']){_0x2b5fe5[_0x20c87b[_0x5096('0x39')][_0x5096('0x3a')]()]=_0x20c87b[_0x5096('0x3b')]['toString']();}else if(_['includes']([_0x5096('0x37'),_0x5096('0x3c')],_0x20c87b[_0x5096('0x38')])&&_0x20c87b[_0x5096('0x3d')]&&_0x20c87b[_0x5096('0x3e')]){_0x2b5fe5[_0x5096('0x3f')]['push']({'id':_0x20c87b['idField'],'value':_0x20c87b[_0x5096('0x3b')][_0x5096('0x40')]()});}else if(_0x20c87b[_0x5096('0x38')]==='variable'&&_0x20c87b[_0x5096('0x41')]&&_0x20c87b[_0x5096('0x3d')]&&_0x20c87b[_0x5096('0x3e')]){_0x1fa1a0[_0x20c87b['variableName']]&&_0x2b5fe5[_0x5096('0x3f')][_0x5096('0x42')]({'id':_0x20c87b['idField'],'value':_0x1fa1a0[_0x20c87b[_0x5096('0x41')]]['toString']()});}else if(_0x20c87b[_0x5096('0x38')]===_0x5096('0x43')&&_0x20c87b[_0x5096('0x44')]&&_0x20c87b[_0x5096('0x44')][_0x5096('0xe')]&&_0x20c87b['idField']&&_0x20c87b[_0x5096('0x3e')]){_0x1fa1a0[_0x20c87b[_0x5096('0x44')][_0x5096('0xe')][_0x5096('0x3a')]()]&&_0x2b5fe5[_0x5096('0x3f')][_0x5096('0x42')]({'id':_0x20c87b[_0x5096('0x3d')],'value':_0x1fa1a0[_0x20c87b['Variable'][_0x5096('0xe')][_0x5096('0x3a')]()][_0x5096('0x40')]()});}});}return _0x2b5fe5;}exports[_0x5096('0x45')]=function(_0xd4b57d,_0x41a9d1,_0x5c5291,_0x34ea2a,_0x4215f1,_0x2d0842){var _0x375e33,_0x24174b;_0x2d0842[_0x5096('0xa')]=intUtil[_0x5096('0x46')](_0x2d0842[_0x5096('0xa')]);_0x2d0842[_0x5096('0x47')]=intUtil[_0x5096('0x46')](_0x2d0842[_0x5096('0x47')]);if(_0x4215f1&&_0x4215f1[_0x5096('0x48')]){logger[_0x5096('0x7')](_0x5096('0x49'),_0x5096('0x4a'));_0x41a9d1[_0x5096('0x4b')]=util[_0x5096('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2d0842[_0x5096('0x47')],_0x41a9d1[_0x5096('0x4c')],md5(_0x41a9d1[_0x5096('0x4c')]));}else{_0x41a9d1[_0x5096('0x4b')]='';}headers[_0x5096('0x4d')]=getAuth(_0x2d0842);return getUser(_0x2d0842,_0x34ea2a['email'])[_0x5096('0x12')](function(_0x2dfef2){_0x375e33=_0x2dfef2;logger[_0x5096('0x7')](_0x5096('0x4e'),_0x375e33['id']);return getEndUser(_0x2d0842,_0x41a9d1['calleridname'],_0x41a9d1[_0x5096('0x4f')]);})[_0x5096('0x12')](function(_0x323a61){_0x24174b=_0x323a61;logger[_0x5096('0x7')](_0x5096('0x50'),_0x24174b['id']);return getTicket(_0x2d0842,_0x375e33,_0x24174b,_0x5c5291,_0x41a9d1);})[_0x5096('0x12')](function(_0x115365){if(_0x115365){logger[_0x5096('0x7')](_0x5096('0x51'),_0x115365['id']);switch(_0x2d0842['type']){case _0x5096('0x52'):logger[_0x5096('0x7')](_0x5096('0x49'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5096('0x17')](_0x5096('0x53'),_0x2d0842[_0x5096('0xa')],_0x375e33['id'],_0x115365['id']),'method':_0x5096('0xb')});case _0x5096('0x54'):logger['info'](_0x5096('0x49'),_0x5096('0x55'));emit(util[_0x5096('0x17')](_0x5096('0x56'),_0x34ea2a[_0x5096('0xe')]),'trigger:browser:url',{'uri':util[_0x5096('0x17')](_0x5096('0x57'),_0x2d0842['remoteUri'][_0x5096('0x58')](_0x5096('0x59'),''),_0x115365['id'])});break;default:logger[_0x5096('0x5a')](_0x5096('0x49'),_0x5096('0x5b'));}}})[_0x5096('0x5c')](function(_0x2a210b){logger[_0x5096('0x5a')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5096('0x5d')](_0x2a210b,{'showHidden':!![],'depth':null}));});};exports[_0x5096('0x5e')]=function(_0x24d96b,_0x5a50dd,_0x1ebff1,_0x5b7437,_0x59a7c2,_0x4bd4e8,_0x2233ef){var _0x5a8e9d,_0x259432;_0x4bd4e8[_0x5096('0xa')]=intUtil[_0x5096('0x46')](_0x4bd4e8['remoteUri']);_0x4bd4e8[_0x5096('0x47')]=intUtil[_0x5096('0x46')](_0x4bd4e8[_0x5096('0x47')]);if(_0x2233ef&&_0x2233ef[_0x5096('0x5f')]&&_0x2233ef['recordingFormat']!==_0x5096('0x60')){logger[_0x5096('0x7')](_0x5096('0x61'),_0x5096('0x4a'));_0x5a50dd[_0x5096('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bd4e8[_0x5096('0x47')],_0x5a50dd[_0x5096('0x4c')],md5(_0x5a50dd[_0x5096('0x4c')]));}headers[_0x5096('0x4d')]=getAuth(_0x4bd4e8);return getUser(_0x4bd4e8,_0x5b7437['email'])['then'](function(_0x3383b5){_0x5a8e9d=_0x3383b5;logger['info'](_0x5096('0x4e'),_0x5a8e9d['id']);return getEndUser(_0x4bd4e8,_0x5a50dd[_0x5096('0x62')],_0x5a50dd['destcalleridnum']);})[_0x5096('0x12')](function(_0x57d8e0){_0x259432=_0x57d8e0;logger['info'](_0x5096('0x50'),_0x259432['id']);return getTicket(_0x4bd4e8,_0x5a8e9d,_0x259432,_0x1ebff1,_0x5a50dd);})['then'](function(_0x1ea10f){if(_0x1ea10f){logger[_0x5096('0x7')](_0x5096('0x51'),_0x1ea10f['id']);switch(_0x4bd4e8[_0x5096('0x38')]){case _0x5096('0x52'):logger['info'](_0x5096('0x61'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5096('0x17')](_0x5096('0x53'),_0x4bd4e8['remoteUri'],_0x5a8e9d['id'],_0x1ea10f['id']),'method':_0x5096('0xb')});case _0x5096('0x54'):logger[_0x5096('0x7')](_0x5096('0x61'),_0x5096('0x55'));emit(util['format']('user:%s',_0x5b7437[_0x5096('0xe')]),_0x5096('0x63'),{'uri':util[_0x5096('0x17')](_0x5096('0x57'),_0x4bd4e8[_0x5096('0xa')]['replace']('/api/v2',''),_0x1ea10f['id'])});break;default:logger[_0x5096('0x5a')](_0x5096('0x61'),_0x5096('0x5b'));}}})[_0x5096('0x5c')](function(_0x406b4e){logger[_0x5096('0x5a')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5096('0x5d')](_0x406b4e,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2af256,_0x39164b,_0xee1a60,_0x3baa59,_0xf0342,_0x4e2b5b){var _0x324e79,_0x37680d;_0x4e2b5b['remoteUri']=intUtil[_0x5096('0x46')](_0x4e2b5b[_0x5096('0xa')]);_0x4e2b5b['serverUrl']=intUtil[_0x5096('0x46')](_0x4e2b5b[_0x5096('0x47')]);if(_0xf0342&&_0xf0342['monitor_format']){logger['info']('['+_0x39164b[_0x5096('0x64')][_0x5096('0x65')]()+']',_0x5096('0x4a'));_0x39164b['recordingURL']=util[_0x5096('0x17')](_0x5096('0x66'),_0x4e2b5b[_0x5096('0x47')],_0x39164b[_0x5096('0x4c')],md5(_0x39164b[_0x5096('0x4c')]));}else{_0x39164b[_0x5096('0x4b')]='';}headers[_0x5096('0x4d')]=getAuth(_0x4e2b5b);return getUser(_0x4e2b5b)[_0x5096('0x12')](function(_0x2ca580){_0x324e79=_0x2ca580;logger[_0x5096('0x7')](_0x5096('0x4e'),_0x324e79['id']);return getEndUser(_0x4e2b5b,_0x39164b[_0x5096('0x67')],_0x39164b[_0x5096('0x4f')]);})[_0x5096('0x12')](function(_0x2b783c){_0x37680d=_0x2b783c;logger[_0x5096('0x7')]('The\x20Enduser\x20ID\x20is:',_0x37680d['id']);return getTicket(_0x4e2b5b,_0x324e79,_0x37680d,_0xee1a60,_0x39164b);})[_0x5096('0x12')](function(_0x410a8b){if(_0x410a8b){logger['info'](_0x5096('0x51'),_0x410a8b['id']);}})[_0x5096('0x5c')](function(_0x35f135){logger['error']('['+_0x39164b[_0x5096('0x64')][_0x5096('0x65')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x35f135,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe1cd=['%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','calleridname','lodash','request-promise','md5','util','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','base64','[HTTP]','map','forEach','string','picklist','type','nameField','customField','toLowerCase','includes','idField','custom_fields','push','content','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...'];(function(_0x2b4a12,_0x575e1c){var _0x5b8963=function(_0x431811){while(--_0x431811){_0x2b4a12['push'](_0x2b4a12['shift']());}};_0x5b8963(++_0x575e1c);}(_0xe1cd,0x160));var _0xde1c=function(_0x5cae86,_0x2c8653){_0x5cae86=_0x5cae86-0x0;var _0x3ec72c=_0xe1cd[_0x5cae86];return _0x3ec72c;};'use strict';var _=require(_0xde1c('0x0'));var rp=require(_0xde1c('0x1'));var md5=require(_0xde1c('0x2'));var util=require(_0xde1c('0x3'));var Redis=require(_0xde1c('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xde1c('0x5'))(_0xde1c('0x6'));config[_0xde1c('0x7')]=_[_0xde1c('0x8')](config[_0xde1c('0x7')],{'host':_0xde1c('0x9'),'port':0x18eb});var io=require(_0xde1c('0xa'))(new Redis(config[_0xde1c('0x7')]));function emit(_0x2fe94b,_0x39f84e,_0x435085){io['to'](_0x2fe94b)[_0xde1c('0xb')](_0x39f84e,_0x435085);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x395083,_0xf43b26,_0x2f1b55,_0x49a72e,_0x5a74bc){logger[_0xde1c('0xc')](_0xde1c('0xd'));return request({'uri':util[_0xde1c('0xe')](_0xde1c('0xf'),_0x395083['remoteUri']),'method':_0xde1c('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x2f1b55['id'],'submitter_id':_0xf43b26?_0xf43b26['id']:undefined,'assignee_id':_0xf43b26?_0xf43b26['id']:undefined,'tags':getTags(_0x49a72e[_0xde1c('0x11')],_0xde1c('0x12')),'subject':intUtil[_0xde1c('0x13')](_0x49a72e[_0xde1c('0x14')],_0x5a74bc,'\x20'),'description':intUtil[_0xde1c('0x13')](_0x49a72e[_0xde1c('0x15')],_0x5a74bc,'\x0a'),'comment':{'public':![],'body':intUtil[_0xde1c('0x13')](_0x49a72e[_0xde1c('0x15')],_0x5a74bc,'\x0a')}},getCustomFields(_0x49a72e[_0xde1c('0x16')],_0x5a74bc))}})[_0xde1c('0x17')](function(_0x41d2d9){logger[_0xde1c('0xc')](_0xde1c('0x18'));return _0x41d2d9['ticket'];});}function getUser(_0x18c39f,_0x752ac){if(intUtil[_0xde1c('0x19')](_0x752ac)){logger[_0xde1c('0xc')](_0xde1c('0x1a'),_0x752ac);return request({'uri':util['format'](_0xde1c('0x1b'),_0x18c39f[_0xde1c('0x1c')]),'qs':{'query':util[_0xde1c('0xe')](_0xde1c('0x1d'),_0x752ac)}})[_0xde1c('0x17')](function(_0x4562eb){if(_0x4562eb[_0xde1c('0x1e')]){logger[_0xde1c('0xc')]('Agent\x20found!');return _['find'](_0x4562eb[_0xde1c('0x1f')],{'email':_0x752ac,'role':_0xde1c('0x20')});}else{logger['info'](_0xde1c('0x21'));return request({'uri':util[_0xde1c('0xe')]('%s/users/me.json',_0x18c39f[_0xde1c('0x1c')])})[_0xde1c('0x17')](function(_0x5855b4){logger['info'](_0xde1c('0x22'));return _0x5855b4[_0xde1c('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xde1c('0x24'),_0x18c39f[_0xde1c('0x1c')])})[_0xde1c('0x17')](function(_0x3ed2fc){logger[_0xde1c('0xc')](_0xde1c('0x22'));return _0x3ed2fc[_0xde1c('0x23')];});}}function getEndUser(_0x4f4962,_0x75cbbf,_0xc3b4f){logger[_0xde1c('0xc')]('Searching\x20enduser\x20with\x20phone',_0xc3b4f);return request({'uri':util['format']('%s/search.json',_0x4f4962[_0xde1c('0x1c')]),'qs':{'query':util['format'](_0xde1c('0x25'),_0xc3b4f)}})['then'](function(_0x384591){var _0x353f83;if(_0x384591[_0xde1c('0x1f')][_0xde1c('0x26')]){_0x384591[_0xde1c('0x1f')]=_[_0xde1c('0x27')](_0x384591[_0xde1c('0x1f')],{'suspended':![],'role':_0xde1c('0x28')});if(_0x384591['results'][_0xde1c('0x26')]){_0x353f83=_[_0xde1c('0x29')](_0x384591[_0xde1c('0x1f')]);}}if(_0x353f83){logger[_0xde1c('0xc')](_0xde1c('0x2a'));return _0x353f83;}else{logger[_0xde1c('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xde1c('0x2b'),_0x4f4962[_0xde1c('0x1c')]),'method':'POST','body':{'user':{'role':_0xde1c('0x28'),'name':util[_0xde1c('0xe')]('Caller\x20-\x20%s',_0x75cbbf||_0xc3b4f),'phone':_0xc3b4f}}})['then'](function(_0x3b9f5a){logger[_0xde1c('0xc')](_0xde1c('0x2c'));return _0x3b9f5a[_0xde1c('0x23')];});}});}function getAuth(_0x581dd5){var _0x4e4ea4;if(_0x581dd5[_0xde1c('0x2d')]===_0xde1c('0x2e')){_0x4e4ea4=util[_0xde1c('0xe')](_0xde1c('0x2f'),_0x581dd5[_0xde1c('0x30')],_0x581dd5[_0xde1c('0x2e')]);}else if(_0x581dd5[_0xde1c('0x2d')]==='token'){_0x4e4ea4=util[_0xde1c('0xe')](_0xde1c('0x31'),_0x581dd5[_0xde1c('0x30')],_0x581dd5[_0xde1c('0x32')]);}return util[_0xde1c('0xe')](_0xde1c('0x33'),new Buffer(_0x4e4ea4)[_0xde1c('0x34')](_0xde1c('0x35')));}function request(_0x28d7b2){logger['debug'](_0xde1c('0x36'),JSON['stringify'](_0x28d7b2));return rp(_[_0xde1c('0x8')](_0x28d7b2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xef8a95,_0x287cee){var _0x3268ed=[];if(_0xef8a95&&_0xef8a95[_0xde1c('0x26')]>0x0){_0x3268ed=_[_0xde1c('0x37')](_0xef8a95,_0x287cee);}return _0x3268ed;}function getCustomFields(_0x12ea78,_0x4248f1){var _0x290e31=[];var _0x1b23fb={'custom_fields':[]};if(_0x12ea78[_0xde1c('0x26')]>0x0){_[_0xde1c('0x38')](_0x12ea78,function(_0x36b4cc){if(_['includes']([_0xde1c('0x39'),_0xde1c('0x3a')],_0x36b4cc[_0xde1c('0x3b')])&&_0x36b4cc[_0xde1c('0x3c')]&&!_0x36b4cc[_0xde1c('0x3d')]){_0x1b23fb[_0x36b4cc[_0xde1c('0x3c')][_0xde1c('0x3e')]()]=_0x36b4cc['content'][_0xde1c('0x34')]();}else if(_[_0xde1c('0x3f')]([_0xde1c('0x39'),'picklist'],_0x36b4cc[_0xde1c('0x3b')])&&_0x36b4cc[_0xde1c('0x40')]&&_0x36b4cc[_0xde1c('0x3d')]){_0x1b23fb[_0xde1c('0x41')][_0xde1c('0x42')]({'id':_0x36b4cc[_0xde1c('0x40')],'value':_0x36b4cc[_0xde1c('0x43')]['toString']()});}else if(_0x36b4cc[_0xde1c('0x3b')]==='variable'&&_0x36b4cc[_0xde1c('0x44')]&&_0x36b4cc[_0xde1c('0x40')]&&_0x36b4cc[_0xde1c('0x3d')]){_0x4248f1[_0x36b4cc['variableName']]&&_0x1b23fb['custom_fields'][_0xde1c('0x42')]({'id':_0x36b4cc[_0xde1c('0x40')],'value':_0x4248f1[_0x36b4cc[_0xde1c('0x44')]][_0xde1c('0x34')]()});}else if(_0x36b4cc[_0xde1c('0x3b')]===_0xde1c('0x45')&&_0x36b4cc['Variable']&&_0x36b4cc[_0xde1c('0x46')]['name']&&_0x36b4cc[_0xde1c('0x40')]&&_0x36b4cc[_0xde1c('0x3d')]){_0x4248f1[_0x36b4cc['Variable']['name']['toLowerCase']()]&&_0x1b23fb[_0xde1c('0x41')][_0xde1c('0x42')]({'id':_0x36b4cc['idField'],'value':_0x4248f1[_0x36b4cc['Variable']['name'][_0xde1c('0x3e')]()][_0xde1c('0x34')]()});}});}return _0x1b23fb;}exports[_0xde1c('0x47')]=function(_0x124955,_0x2d8f6c,_0x192b85,_0x5f32ba,_0x20de58,_0x5841fd){var _0x3cf645,_0x54c4bc;_0x5841fd['remoteUri']=intUtil['stripTrailingSlash'](_0x5841fd[_0xde1c('0x1c')]);_0x5841fd['serverUrl']=intUtil[_0xde1c('0x48')](_0x5841fd[_0xde1c('0x49')]);if(_0x20de58&&_0x20de58['monitor_format']){logger['info']('[QUEUE]',_0xde1c('0x4a'));_0x2d8f6c[_0xde1c('0x4b')]=util[_0xde1c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5841fd[_0xde1c('0x49')],_0x2d8f6c[_0xde1c('0x4c')],md5(_0x2d8f6c[_0xde1c('0x4c')]));}else{_0x2d8f6c[_0xde1c('0x4b')]='';}headers['Authorization']=getAuth(_0x5841fd);return getUser(_0x5841fd,_0x5f32ba['email'])['then'](function(_0x542551){_0x3cf645=_0x542551;logger['info'](_0xde1c('0x4d'),_0x3cf645['id']);return getEndUser(_0x5841fd,_0x2d8f6c['calleridname'],_0x2d8f6c[_0xde1c('0x4e')]);})[_0xde1c('0x17')](function(_0x1999d8){_0x54c4bc=_0x1999d8;logger['info'](_0xde1c('0x4f'),_0x54c4bc['id']);return getTicket(_0x5841fd,_0x3cf645,_0x54c4bc,_0x192b85,_0x2d8f6c);})[_0xde1c('0x17')](function(_0x35d852){if(_0x35d852){logger[_0xde1c('0xc')](_0xde1c('0x50'),_0x35d852['id']);switch(_0x5841fd[_0xde1c('0x3b')]){case _0xde1c('0x51'):logger[_0xde1c('0xc')](_0xde1c('0x52'),_0xde1c('0x53'));return request({'uri':util['format'](_0xde1c('0x54'),_0x5841fd[_0xde1c('0x1c')],_0x3cf645['id'],_0x35d852['id']),'method':_0xde1c('0x10')});case _0xde1c('0x55'):logger['info'](_0xde1c('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xde1c('0xe')](_0xde1c('0x56'),_0x5f32ba[_0xde1c('0x12')]),_0xde1c('0x57'),{'uri':util[_0xde1c('0xe')](_0xde1c('0x58'),_0x5841fd[_0xde1c('0x1c')][_0xde1c('0x59')](_0xde1c('0x5a'),''),_0x35d852['id'])});break;default:logger[_0xde1c('0x5b')](_0xde1c('0x52'),_0xde1c('0x5c'));}}})['catch'](function(_0x1a4b2d){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xde1c('0x5d')](_0x1a4b2d,{'showHidden':!![],'depth':null}));});};exports[_0xde1c('0x5e')]=function(_0x13f83d,_0x424988,_0x251c6a,_0x3c5965,_0x4678b5,_0x5c3d0d,_0x52d897){var _0x320628,_0x4267ff;_0x5c3d0d[_0xde1c('0x1c')]=intUtil[_0xde1c('0x48')](_0x5c3d0d['remoteUri']);_0x5c3d0d['serverUrl']=intUtil[_0xde1c('0x48')](_0x5c3d0d[_0xde1c('0x49')]);if(_0x52d897&&_0x52d897[_0xde1c('0x5f')]&&_0x52d897[_0xde1c('0x5f')]!==_0xde1c('0x60')){logger[_0xde1c('0xc')](_0xde1c('0x61'),_0xde1c('0x4a'));_0x424988[_0xde1c('0x4b')]=util['format'](_0xde1c('0x62'),_0x5c3d0d[_0xde1c('0x49')],_0x424988[_0xde1c('0x4c')],md5(_0x424988[_0xde1c('0x4c')]));}headers[_0xde1c('0x63')]=getAuth(_0x5c3d0d);return getUser(_0x5c3d0d,_0x3c5965['email'])[_0xde1c('0x17')](function(_0x16812e){_0x320628=_0x16812e;logger['info']('The\x20User\x20ID\x20is:',_0x320628['id']);return getEndUser(_0x5c3d0d,_0x424988[_0xde1c('0x64')],_0x424988[_0xde1c('0x65')]);})[_0xde1c('0x17')](function(_0x464f36){_0x4267ff=_0x464f36;logger[_0xde1c('0xc')](_0xde1c('0x4f'),_0x4267ff['id']);return getTicket(_0x5c3d0d,_0x320628,_0x4267ff,_0x251c6a,_0x424988);})['then'](function(_0x3b3a04){if(_0x3b3a04){logger['info'](_0xde1c('0x50'),_0x3b3a04['id']);switch(_0x5c3d0d[_0xde1c('0x3b')]){case _0xde1c('0x51'):logger['info'](_0xde1c('0x61'),_0xde1c('0x53'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5c3d0d['remoteUri'],_0x320628['id'],_0x3b3a04['id']),'method':'POST'});case _0xde1c('0x55'):logger[_0xde1c('0xc')]('[OUTBOUND]',_0xde1c('0x66'));emit(util[_0xde1c('0xe')](_0xde1c('0x56'),_0x3c5965['name']),_0xde1c('0x57'),{'uri':util[_0xde1c('0xe')](_0xde1c('0x58'),_0x5c3d0d[_0xde1c('0x1c')][_0xde1c('0x59')]('/api/v2',''),_0x3b3a04['id'])});break;default:logger[_0xde1c('0x5b')](_0xde1c('0x61'),_0xde1c('0x5c'));}}})[_0xde1c('0x67')](function(_0x4f3246){logger[_0xde1c('0x5b')](_0xde1c('0x68'),util[_0xde1c('0x5d')](_0x4f3246,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x430896,_0x67c744,_0x1e2a01,_0x5c7d9e,_0x59bcc2,_0x2a9076){var _0x3387d4,_0x14bb43;_0x2a9076[_0xde1c('0x1c')]=intUtil[_0xde1c('0x48')](_0x2a9076[_0xde1c('0x1c')]);_0x2a9076['serverUrl']=intUtil['stripTrailingSlash'](_0x2a9076['serverUrl']);if(_0x59bcc2&&_0x59bcc2[_0xde1c('0x69')]){logger[_0xde1c('0xc')]('['+_0x67c744[_0xde1c('0x6a')][_0xde1c('0x6b')]()+']',_0xde1c('0x4a'));_0x67c744[_0xde1c('0x4b')]=util[_0xde1c('0xe')](_0xde1c('0x62'),_0x2a9076[_0xde1c('0x49')],_0x67c744[_0xde1c('0x4c')],md5(_0x67c744[_0xde1c('0x4c')]));}else{_0x67c744[_0xde1c('0x4b')]='';}headers[_0xde1c('0x63')]=getAuth(_0x2a9076);return getUser(_0x2a9076)['then'](function(_0x25c77a){_0x3387d4=_0x25c77a;logger['info']('The\x20User\x20ID\x20is:',_0x3387d4['id']);return getEndUser(_0x2a9076,_0x67c744[_0xde1c('0x6c')],_0x67c744[_0xde1c('0x4e')]);})[_0xde1c('0x17')](function(_0x5af940){_0x14bb43=_0x5af940;logger[_0xde1c('0xc')](_0xde1c('0x4f'),_0x14bb43['id']);return getTicket(_0x2a9076,_0x3387d4,_0x14bb43,_0x1e2a01,_0x67c744);})[_0xde1c('0x17')](function(_0x18c5b7){if(_0x18c5b7){logger[_0xde1c('0xc')](_0xde1c('0x50'),_0x18c5b7['id']);}})['catch'](function(_0x1c7c8e){logger['error']('['+_0x67c744[_0xde1c('0x6a')][_0xde1c('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xde1c('0x5d')](_0x1c7c8e,{'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 217da6c..d5dd5d8 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 _0x7602=['outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridnum','Outbound','user:%s','trigger:browser:url','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','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','info','error','The\x20failing\x20result\x20is','catch','data','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','startCase','talktime','answertime','endtime','utc','diff','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time'];(function(_0xb08125,_0x561acb){var _0x2ace23=function(_0x50dbbf){while(--_0x50dbbf){_0xb08125['push'](_0xb08125['shift']());}};_0x2ace23(++_0x561acb);}(_0x7602,0x15e));var _0x2760=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x7602[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x2760('0x0'));var rp=require(_0x2760('0x1'));var md5=require(_0x2760('0x2'));var util=require(_0x2760('0x3'));var intUtil=require(_0x2760('0x4'));var moment=require(_0x2760('0x5'));var Redis=require(_0x2760('0x6'));var BPromise=require(_0x2760('0x7'));var config=require(_0x2760('0x8'));var logger=require(_0x2760('0x9'))(_0x2760('0xa'));config[_0x2760('0xb')]=_[_0x2760('0xc')](config[_0x2760('0xb')],{'host':_0x2760('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5e0ac6,_0x41ad79,_0x4dd9b3){io['to'](_0x5e0ac6)['emit'](_0x41ad79,_0x4dd9b3);}function request(_0x1cea59){logger[_0x2760('0xe')](_0x2760('0xf'),JSON[_0x2760('0x10')](_0x1cea59));return rp(_0x1cea59);}function getCustomFields(_0x3f0911,_0x1473cc){var _0x558ad5={};if(_0x3f0911[_0x2760('0x11')]>0x0){_[_0x2760('0x12')](_0x3f0911,function(_0x49d740){if(_['includes']([_0x2760('0x13'),_0x2760('0x14')],_0x49d740[_0x2760('0x15')])&&_0x49d740[_0x2760('0x16')]){_0x558ad5[_0x49d740[_0x2760('0x16')]]=_0x49d740['content'][_0x2760('0x17')]();}else if(_0x49d740[_0x2760('0x15')]===_0x2760('0x18')&&_0x49d740[_0x2760('0x19')]&&_0x49d740[_0x2760('0x16')]&&_0x1473cc[_0x49d740[_0x2760('0x19')]]){_0x558ad5[_0x49d740['idField']]=_0x1473cc[_0x49d740['variableName']][_0x2760('0x17')]();}else if(_0x49d740['type']==='customVariable'&&_0x49d740['Variable']&&_0x49d740[_0x2760('0x1a')][_0x2760('0x1b')]&&_0x49d740[_0x2760('0x16')]&&_0x1473cc[_0x49d740[_0x2760('0x1a')][_0x2760('0x1b')][_0x2760('0x1c')]()]){_0x558ad5[_0x49d740[_0x2760('0x16')]]=_0x1473cc[_0x49d740['Variable'][_0x2760('0x1b')][_0x2760('0x1c')]()][_0x2760('0x17')]();}});}return _0x558ad5;}function getName(_0x4cd1ce){if(_0x4cd1ce[_0x2760('0x1d')]('\x20')>0x0){var _0x593e9f=_0x4cd1ce['split'](/ (.+)/);if(_0x593e9f[0x1]){return _0x593e9f;}}return[_0x4cd1ce,_0x4cd1ce];}var accountsTokens={};function getAccessToken(_0xd54f5a){return new Promise(function(_0x5b9222,_0x4dad1e){if(!_['isNil'](accountsTokens[_0xd54f5a['id']])&&!_[_0x2760('0x1e')](accountsTokens[_0xd54f5a['id']][_0x2760('0x1f')])){if(moment()[_0x2760('0x20')](accountsTokens[_0xd54f5a['id']][_0x2760('0x21')])){_0x5b9222(accountsTokens[_0xd54f5a['id']][_0x2760('0x1f')]);}}var _0x26dde4;switch(_0xd54f5a['zone']){case'US':_0x26dde4=_0x2760('0x22');break;case'AU':_0x26dde4=_0x2760('0x23');break;case'EU':_0x26dde4='https://accounts.zoho.eu';break;case'IN':_0x26dde4='https://accounts.zoho.in';break;case'CN':_0x26dde4=_0x2760('0x24');break;default:_0x26dde4='https://accounts.zoho.eu';break;}var _0x49cc4a={'method':_0x2760('0x25'),'uri':_0x26dde4+_0x2760('0x26'),'qs':{'refresh_token':_0xd54f5a['refreshToken'],'client_id':_0xd54f5a[_0x2760('0x27')],'client_secret':_0xd54f5a[_0x2760('0x28')],'grant_type':_0x2760('0x29')},'json':!![]};return rp(_0x49cc4a)[_0x2760('0x2a')](function(_0x4569dd){accountsTokens[_0xd54f5a['id']]={'access_token':_0x4569dd[_0x2760('0x1f')],'expires_in':moment()['add'](_0x4569dd[_0x2760('0x21')],_0x2760('0x2b'))};_0x5b9222(_0x4569dd['access_token']);})['catch'](function(_0x1e3ae5){logger['error'](_0x2760('0x2c'),_0x1e3ae5[_0x2760('0x2d')]);_0x4dad1e(_0x1e3ae5);});});}function getUser(_0x15f7bf,_0x365a1d,_0x37b882,_0xb69fe7){logger['info'](_0x2760('0x2e'));return request({'method':'GET','uri':util[_0x2760('0x2f')](_0x2760('0x30'),_0x365a1d),'qs':{'type':_0x2760('0x31')},'headers':{'Authorization':_0x2760('0x32')+_0x15f7bf},'json':!![]})[_0x2760('0x2a')](function(_0x5d181e){if(_0x5d181e[_0x2760('0x33')]){var _0x1a5470=-0x1;if(_[_0x2760('0x34')](_0x5d181e[_0x2760('0x33')])){if(!_['isNil'](_0xb69fe7)){_0x1a5470=_[_0x2760('0x35')](_0x5d181e[_0x2760('0x33')],function(_0x539f95){return _0x539f95[_0x2760('0x36')]===_0xb69fe7;});}if(_0x1a5470>=0x0){logger['info'](_0x2760('0x37'));}else{logger['info'](_0x2760('0x38'));_0x1a5470=_[_0x2760('0x35')](_0x5d181e[_0x2760('0x33')],function(_0x8defaf){return _0x8defaf[_0x2760('0x39')][_0x2760('0x1b')]===_0x2760('0x3a');});}return _0x5d181e[_0x2760('0x33')][_0x1a5470];}else{if(_0x5d181e[_0x2760('0x3b')][_0x2760('0x39')][_0x2760('0x1b')]===_0x2760('0x3a')){logger[_0x2760('0x3c')](_0x2760('0x38'));user=_0x5d181e[_0x2760('0x3b')];return user;}else{logger[_0x2760('0x3d')](_0x2760('0x3e'),JSON['stringify'](_0x5d181e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2760('0x10')](_0x5d181e));}}}else{logger[_0x2760('0x3d')](_0x2760('0x3e'),JSON[_0x2760('0x10')](_0x5d181e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2760('0x10')](_0x5d181e));}})[_0x2760('0x3f')](function(_0x3676d2){console[_0x2760('0x3d')](_0x3676d2);});}function getZohoUser(_0x3e4a96,_0x381a4f){return new BPromise(function(_0x628fe4,_0x52e278){request(_0x3e4a96)[_0x2760('0x2a')](function(_0x3857b0){var _0x322970=null;if(_0x3857b0){_0x322970=_0x3857b0[_0x2760('0x40')][0x0];_0x322970['enduserType']=_0x381a4f;}_0x628fe4(_0x322970);})['catch'](function(_0x348cfe){_0x52e278(_0x348cfe);});});}function createEndUser(_0x188ae2,_0xb8ad3,_0x37dbdb,_0x3001c0,_0x551c52,_0x14e786){var _0x37dbdb=getName(_0x37dbdb);return request({'method':_0x2760('0x25'),'uri':_0x2760('0x41')+_0xb8ad3+'/crm/v2/'+_['startCase'](_0x14e786[_0x2760('0x42')])+'s','body':{'data':[{'Last_Name':_0x37dbdb[0x1],'First_Name':_0x37dbdb[0x0],'Phone':_0x3001c0,'Owner':{'name':!_[_0x2760('0x1e')](_0x551c52[_0x2760('0x43')]['name'])?_0x551c52[_0x2760('0x43')][_0x2760('0x1b')]:!_[_0x2760('0x1e')](_0x551c52[_0x2760('0x44')])?_0x551c52[_0x2760('0x44')]+'\x20'+_0x551c52['last_name']:_0x551c52[_0x2760('0x45')],'id':_0x551c52['id']}}]},'headers':{'Authorization':_0x2760('0x32')+_0x188ae2},'json':!![]})['then'](function(_0x2b02f0){if(_0x2b02f0&&_0x2b02f0[_0x2760('0x40')][0x0][_0x2760('0x46')]===_0x2760('0x47')){var _0x4f40e9=_0x2b02f0['data'][0x0]['details'];_0x4f40e9['enduserType']=_['startCase'](_0x14e786['moduleCreate'])+'s';return _0x4f40e9;}logger[_0x2760('0x3d')](_0x2760('0x3e'),JSON[_0x2760('0x10')](data));throw new Error(_0x2760('0x48')+JSON[_0x2760('0x10')](data));})[_0x2760('0x3f')](function(_0x322c43){console['log']('CREATE\x20ERROR',_0x322c43);});}function getEndUser(_0x5ecedf,_0x5141fc,_0x42a6cf,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b){var _0x5a98c5={'method':_0x2760('0x49'),'uri':'','headers':{'Authorization':_0x2760('0x32')+_0x5ecedf},'json':!![]};switch(_0x1d041b[_0x2760('0x4a')]){case _0x2760('0x4b'):_0x5a98c5['uri']=_0x2760('0x41')+_0x5141fc+_0x2760('0x4c')+_0x59af72+'))';return getZohoUser(_0x5a98c5,_0x2760('0x4d'))[_0x2760('0x2a')](function(_0x183dee){if(_0x183dee)return _0x183dee;_0x5a98c5[_0x2760('0x4e')]=_0x2760('0x41')+_0x5141fc+_0x2760('0x4f')+_0x59af72+'))';return getZohoUser(_0x5a98c5,'Leads')[_0x2760('0x2a')](function(_0x2857dc){if(_0x2857dc)return _0x2857dc;if(_0x1d041b[_0x2760('0x42')]!=_0x2760('0x50')){return createEndUser(_0x5ecedf,_0x5141fc,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b);}else{return{};}});});break;case'contact':_0x5a98c5[_0x2760('0x4e')]=_0x2760('0x41')+_0x5141fc+_0x2760('0x4c')+_0x59af72+'))';return getZohoUser(_0x5a98c5,_0x2760('0x4d'))[_0x2760('0x2a')](function(_0x19c1b1){if(_0x19c1b1)return _0x19c1b1;if(_0x1d041b[_0x2760('0x42')]!=_0x2760('0x50')){return createEndUser(_0x5ecedf,_0x5141fc,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b);}else{return{};}});break;case _0x2760('0x51'):_0x5a98c5['uri']=_0x2760('0x41')+_0x5141fc+_0x2760('0x4f')+_0x59af72+'))';return getZohoUser(_0x5a98c5,_0x2760('0x52'))[_0x2760('0x2a')](function(_0x65ce44){if(_0x65ce44)return _0x65ce44;if(_0x1d041b[_0x2760('0x42')]!=_0x2760('0x50')){return createEndUser(_0x5ecedf,_0x5141fc,_0x1bce8d,_0x59af72,_0x5daa69,_0x1d041b);}else{return{};}});break;}}function getCall(_0x5cb8f0,_0x2eb78a,_0x35b6ad,_0x48eab1,_0x144e77,_0x3ffbe9,_0x26805a,_0x276288){logger[_0x2760('0x3c')](_0x2760('0x53'));var _0x347cab={};_0x347cab[_0x2760('0x54')]={'name':!_[_0x2760('0x1e')](_0x48eab1[_0x2760('0x43')][_0x2760('0x1b')])&&!_['isNil'](_0x48eab1[_0x2760('0x39')]['name'])&&_0x48eab1[_0x2760('0x39')]['name']===_0x2760('0x55')?_0x48eab1[_0x2760('0x43')][_0x2760('0x1b')]:!_[_0x2760('0x1e')](_0x48eab1[_0x2760('0x44')])?_0x48eab1[_0x2760('0x44')]+'\x20'+_0x48eab1['last_name']:_0x48eab1[_0x2760('0x45')],'id':_0x48eab1['id']};_0x347cab['Subject']=intUtil[_0x2760('0x56')](_0x3ffbe9[_0x2760('0x57')],_0x26805a,'\x20');_0x347cab[_0x2760('0x58')]=intUtil[_0x2760('0x56')](_0x3ffbe9[_0x2760('0x59')],_0x26805a,'\x0a');if(_0x144e77[_0x2760('0x5a')]===_0x2760('0x4d')){_0x347cab[_0x2760('0x5b')]={'name':!_[_0x2760('0x1e')](_0x144e77[_0x2760('0x5c')])?_0x144e77[_0x2760('0x5c')]:!_[_0x2760('0x1e')](_0x144e77[_0x2760('0x5d')])?_0x144e77['First_Name']+'\x20'+_0x144e77['Last_Name']:_0x144e77[_0x2760('0x5e')],'id':_0x144e77['id']};}if(_0x144e77['enduserType']===_0x2760('0x52')){_0x347cab[_0x2760('0x5f')]={'name':!_['isNil'](_0x144e77[_0x2760('0x5c')])?_0x144e77[_0x2760('0x5c')]:!_[_0x2760('0x1e')](_0x144e77[_0x2760('0x5d')])?_0x144e77['First_Name']+'\x20'+_0x144e77[_0x2760('0x5e')]:_0x144e77[_0x2760('0x5e')],'id':_0x144e77['id']};_0x347cab['$se_module']=_[_0x2760('0x60')](_0x144e77[_0x2760('0x5a')]);}if(_0x26805a[_0x2760('0x61')]){_0x347cab['Call_Duration']=moment['utc'](parseInt(_0x26805a[_0x2760('0x61')])*0x3e8)[_0x2760('0x2f')]('mm:ss');}else if(_0x26805a[_0x2760('0x62')]&&_0x26805a[_0x2760('0x63')]){_0x347cab['Call_Duration']=moment[_0x2760('0x64')](moment(_0x26805a['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x2760('0x65')](moment(_0x26805a['starttime'],_0x2760('0x66'))))[_0x2760('0x2f')]('mm:ss');}switch(_0x26805a[_0x2760('0x67')]){case _0x2760('0x68'):_0x347cab[_0x2760('0x69')]='Called';break;case _0x2760('0x6a'):case _0x2760('0x6b'):_0x347cab[_0x2760('0x69')]=_0x2760('0x6c');break;case _0x2760('0x6d'):_0x347cab['Call_Result']=_0x2760('0x6e');break;case _0x2760('0x6f'):_0x347cab['Call_Result']=_0x2760('0x70');break;case'timeout':_0x347cab['Call_Result']=_0x2760('0x71');default:}_0x347cab[_0x2760('0x72')]=(_0x276288===_0x2760('0x73')?moment(_0x26805a[_0x2760('0x74')])[_0x2760('0x2f')](_0x2760('0x66')):moment(_0x26805a[_0x2760('0x75')])[_0x2760('0x2f')](_0x2760('0x66')))||moment()[_0x2760('0x2f')](_0x2760('0x66'));_0x347cab[_0x2760('0x76')]=_0x276288||_0x2760('0x77');_0x347cab=_[_0x2760('0x78')](_0x347cab,getCustomFields(_0x3ffbe9[_0x2760('0x79')],_0x26805a));return request({'method':'POST','uri':_0x2760('0x41')+_0x2eb78a+_0x2760('0x7a'),'headers':{'Authorization':_0x2760('0x32')+_0x5cb8f0},'body':{'data':[_0x347cab]},'json':!![]})[_0x2760('0x2a')](function(_0x1a6bc6){if(_0x1a6bc6&&_0x1a6bc6[_0x2760('0x40')][0x0][_0x2760('0x46')]===_0x2760('0x47')){logger['info'](_0x2760('0x7b'));return{'id':_0x1a6bc6[_0x2760('0x40')][0x0]['details']['id']};}})[_0x2760('0x3f')](function(_0x43e918){logger[_0x2760('0x3c')](_0x2760('0x7c'),_0x43e918[_0x2760('0x2d')]);console[_0x2760('0x7d')](_0x2760('0x7c'),_0x43e918);});}exports[_0x2760('0x7e')]=function(_0x28ddec,_0x28f412,_0x3d60c2,_0x4c6faa,_0x5905e9,_0x2918b4){var _0x3996da,_0x513e5e,_0x42b06e;_0x2918b4[_0x2760('0x7f')]=intUtil[_0x2760('0x80')](_0x2918b4[_0x2760('0x7f')]);_0x2918b4[_0x2760('0x81')]=intUtil[_0x2760('0x80')](_0x2918b4[_0x2760('0x81')]);if(_0x5905e9&&_0x5905e9[_0x2760('0x82')]){logger[_0x2760('0x3c')](_0x2760('0x83'),_0x2760('0x84'));_0x28f412[_0x2760('0x85')]=_0x2918b4['serverUrl']+'/api/voice/recordings/'+_0x28f412[_0x2760('0x86')]+_0x2760('0x87')+md5(_0x28f412[_0x2760('0x86')]);}else{_0x28f412[_0x2760('0x85')]='';}var _0x294138=_0x2918b4[_0x2760('0x7f')]===_0x2760('0x88')?'eu':_0x2760('0x89');return getAccessToken(_0x2918b4)[_0x2760('0x2a')](function(_0x2af6c2){_0x42b06e=_0x2af6c2;return getUser(_0x42b06e,_0x294138,_0x2918b4,_0x4c6faa['email']);})[_0x2760('0x2a')](function(_0x34b7e8){_0x3996da=_0x34b7e8;logger[_0x2760('0x3c')](_0x2760('0x8a'),_0x3996da['id']);return getEndUser(_0x42b06e,_0x294138,_0x2918b4,_0x28f412[_0x2760('0x8b')],_0x28f412[_0x2760('0x8c')],_0x3996da,_0x3d60c2);})[_0x2760('0x2a')](function(_0x3c01e8){_0x513e5e=_0x3c01e8;return getCall(_0x42b06e,_0x294138,_0x2918b4,_0x3996da,_0x513e5e,_0x3d60c2,_0x28f412,_0x2760('0x77'));})[_0x2760('0x2a')](function(_0x1697f9){if(_0x1697f9){logger[_0x2760('0x3c')](_0x2760('0x8d'),_0x1697f9['id']);logger['info'](_0x2760('0x83'),_0x2760('0x8e'));emit(util['format']('user:%s',_0x4c6faa[_0x2760('0x1b')]),'trigger:browser:url',{'uri':_0x2760('0x8f')+_0x2918b4[_0x2760('0x7f')]+_0x2760('0x90')+_0x1697f9['id']});}})['catch'](function(_0x9f6d){logger['error']('[QUEUE]',JSON[_0x2760('0x10')](_0x9f6d));});};exports[_0x2760('0x73')]=function(_0x16bce5,_0x15a2a4,_0x4455f6,_0x41e950,_0x301c6d,_0x1a704f,_0x2e22cb){var _0x5e276a,_0x52716b,_0x25b795;_0x1a704f[_0x2760('0x7f')]=intUtil[_0x2760('0x80')](_0x1a704f[_0x2760('0x7f')]);_0x1a704f[_0x2760('0x81')]=intUtil[_0x2760('0x80')](_0x1a704f[_0x2760('0x81')]);if(_0x2e22cb&&_0x2e22cb[_0x2760('0x91')]&&_0x2e22cb[_0x2760('0x91')]!==_0x2760('0x92')){logger['info'](_0x2760('0x93'),'Recording\x20is\x20enabled!');_0x15a2a4[_0x2760('0x85')]=_0x1a704f[_0x2760('0x81')]+_0x2760('0x94')+_0x15a2a4['uniqueid']+_0x2760('0x87')+md5(_0x15a2a4[_0x2760('0x86')]);}var _0x234da0=_0x1a704f[_0x2760('0x7f')]===_0x2760('0x88')?'eu':_0x2760('0x89');return getAccessToken(_0x1a704f)['then'](function(_0x17ba28){_0x25b795=_0x17ba28;return getUser(_0x25b795,_0x234da0,_0x1a704f,_0x41e950['email']);})['then'](function(_0x492dd4){_0x5e276a=_0x492dd4;logger[_0x2760('0x3c')](_0x2760('0x8a'),_0x5e276a['id']);return getEndUser(_0x25b795,_0x234da0,_0x1a704f,_0x15a2a4['destcalleridname'],_0x15a2a4[_0x2760('0x95')],_0x5e276a,_0x4455f6);})[_0x2760('0x2a')](function(_0x4a7aea){_0x52716b=_0x4a7aea;return getCall(_0x25b795,_0x234da0,_0x1a704f,_0x5e276a,_0x52716b,_0x4455f6,_0x15a2a4,_0x2760('0x96'));})[_0x2760('0x2a')](function(_0x241e00){if(_0x241e00){logger['info'](_0x2760('0x8d'),_0x241e00['id']);logger['info'](_0x2760('0x93'),_0x2760('0x8e'));emit(util[_0x2760('0x2f')](_0x2760('0x97'),_0x41e950[_0x2760('0x1b')]),_0x2760('0x98'),{'uri':'https://crm.'+_0x1a704f[_0x2760('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x241e00['id']});}})[_0x2760('0x3f')](function(_0x36d0fb){logger[_0x2760('0x3d')](_0x2760('0x93'),JSON[_0x2760('0x10')](_0x36d0fb));});};exports[_0x2760('0x99')]=function(_0x97408e,_0x1b4e71,_0x28232b,_0x1072d8,_0x40b051,_0x4bb5f7){var _0xa34ad1,_0x470999,_0x4fe312;_0x4bb5f7[_0x2760('0x7f')]=intUtil['stripTrailingSlash'](_0x4bb5f7['host']);_0x4bb5f7[_0x2760('0x81')]=intUtil[_0x2760('0x80')](_0x4bb5f7[_0x2760('0x81')]);if(_0x40b051&&_0x40b051[_0x2760('0x82')]){logger[_0x2760('0x3c')]('['+_0x1b4e71['lastevent'][_0x2760('0x9a')]()+']','Recording\x20is\x20enabled!');_0x1b4e71[_0x2760('0x85')]=_0x4bb5f7['serverUrl']+_0x2760('0x94')+_0x1b4e71[_0x2760('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x1b4e71[_0x2760('0x86')]);}else{_0x1b4e71['recordingURL']='';}var _0x337757=_0x4bb5f7[_0x2760('0x7f')]==='zoho.eu'?'eu':_0x2760('0x89');return getAccessToken(_0x4bb5f7)[_0x2760('0x2a')](function(_0x19a002){_0x4fe312=_0x19a002;return getUser(_0x4fe312,_0x337757,_0x4bb5f7);})['then'](function(_0x302aa5){_0xa34ad1=_0x302aa5;logger[_0x2760('0x3c')](_0x2760('0x8a'),_0xa34ad1['id']);return getEndUser(_0x4fe312,_0x337757,_0x4bb5f7,_0x1b4e71['calleridname'],_0x1b4e71['calleridnum'],_0xa34ad1,_0x28232b);})[_0x2760('0x2a')](function(_0x51a842){_0x470999=_0x51a842;return getCall(_0x4fe312,_0x337757,_0x4bb5f7,_0xa34ad1,_0x470999,_0x28232b,_0x1b4e71,_0x2760('0x77'));})[_0x2760('0x2a')](function(_0x279470){if(_0x279470){logger[_0x2760('0x3c')](_0x2760('0x8d'),_0x279470['id']);}})[_0x2760('0x3f')](function(_0x46a0f){logger[_0x2760('0x3d')]('['+_0x1b4e71[_0x2760('0x67')]['toUpperCase']()+']',JSON[_0x2760('0x10')](_0x46a0f));});}; \ No newline at end of file +var _0x3b43=['refresh_token','then','add','catch','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','details','Error:\x20','log','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','moduleCreate','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','Leads','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','email','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','lastevent','toUpperCase','The\x20User\x20ID\x20is:','calleridnum','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','zoho','defaults','localhost','socket.io-emitter','redis','emit','[HTTP]','stringify','forEach','string','picklist','type','idField','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret'];(function(_0x545712,_0x5cb4da){var _0xb4bd69=function(_0x1dae3d){while(--_0x1dae3d){_0x545712['push'](_0x545712['shift']());}};_0xb4bd69(++_0x5cb4da);}(_0x3b43,0x71));var _0x33b4=function(_0x45a8e6,_0x3b7119){_0x45a8e6=_0x45a8e6-0x0;var _0x4ff90e=_0x3b43[_0x45a8e6];return _0x4ff90e;};'use strict';var _=require(_0x33b4('0x0'));var rp=require(_0x33b4('0x1'));var md5=require(_0x33b4('0x2'));var util=require(_0x33b4('0x3'));var intUtil=require(_0x33b4('0x4'));var moment=require(_0x33b4('0x5'));var Redis=require('ioredis');var BPromise=require(_0x33b4('0x6'));var config=require(_0x33b4('0x7'));var logger=require('../../../../config/logger')(_0x33b4('0x8'));config['redis']=_[_0x33b4('0x9')](config['redis'],{'host':_0x33b4('0xa'),'port':0x18eb});var io=require(_0x33b4('0xb'))(new Redis(config[_0x33b4('0xc')]));function emit(_0x2ca486,_0x15f06e,_0x1e616b){io['to'](_0x2ca486)[_0x33b4('0xd')](_0x15f06e,_0x1e616b);}function request(_0x3b743e){logger['debug'](_0x33b4('0xe'),JSON[_0x33b4('0xf')](_0x3b743e));return rp(_0x3b743e);}function getCustomFields(_0x11105d,_0x6b05ae){var _0x5568cc={};if(_0x11105d['length']>0x0){_[_0x33b4('0x10')](_0x11105d,function(_0x4ed59b){if(_['includes']([_0x33b4('0x11'),_0x33b4('0x12')],_0x4ed59b[_0x33b4('0x13')])&&_0x4ed59b[_0x33b4('0x14')]){_0x5568cc[_0x4ed59b[_0x33b4('0x14')]]=_0x4ed59b['content']['toString']();}else if(_0x4ed59b[_0x33b4('0x13')]===_0x33b4('0x15')&&_0x4ed59b['variableName']&&_0x4ed59b[_0x33b4('0x14')]&&_0x6b05ae[_0x4ed59b[_0x33b4('0x16')]]){_0x5568cc[_0x4ed59b[_0x33b4('0x14')]]=_0x6b05ae[_0x4ed59b['variableName']][_0x33b4('0x17')]();}else if(_0x4ed59b['type']==='customVariable'&&_0x4ed59b[_0x33b4('0x18')]&&_0x4ed59b[_0x33b4('0x18')]['name']&&_0x4ed59b[_0x33b4('0x14')]&&_0x6b05ae[_0x4ed59b['Variable'][_0x33b4('0x19')][_0x33b4('0x1a')]()]){_0x5568cc[_0x4ed59b[_0x33b4('0x14')]]=_0x6b05ae[_0x4ed59b[_0x33b4('0x18')][_0x33b4('0x19')][_0x33b4('0x1a')]()][_0x33b4('0x17')]();}});}return _0x5568cc;}function getName(_0x1b356f){if(_0x1b356f[_0x33b4('0x1b')]('\x20')>0x0){var _0x3142b3=_0x1b356f[_0x33b4('0x1c')](/ (.+)/);if(_0x3142b3[0x1]){return _0x3142b3;}}return[_0x1b356f,_0x1b356f];}var accountsTokens={};function getAccessToken(_0x49220b){return new Promise(function(_0x24df08,_0x248949){if(!_[_0x33b4('0x1d')](accountsTokens[_0x49220b['id']])&&!_['isNil'](accountsTokens[_0x49220b['id']][_0x33b4('0x1e')])){if(moment()[_0x33b4('0x1f')](accountsTokens[_0x49220b['id']][_0x33b4('0x20')])){_0x24df08(accountsTokens[_0x49220b['id']]['access_token']);}}var _0x22c2d2;switch(_0x49220b['zone']){case'US':_0x22c2d2=_0x33b4('0x21');break;case'AU':_0x22c2d2=_0x33b4('0x22');break;case'EU':_0x22c2d2=_0x33b4('0x23');break;case'IN':_0x22c2d2=_0x33b4('0x24');break;case'CN':_0x22c2d2='https://accounts.zoho.com.cn';break;default:_0x22c2d2=_0x33b4('0x23');break;}var _0x1a005c={'method':_0x33b4('0x25'),'uri':_0x22c2d2+'/oauth/v2/token','qs':{'refresh_token':_0x49220b[_0x33b4('0x26')],'client_id':_0x49220b[_0x33b4('0x27')],'client_secret':_0x49220b[_0x33b4('0x28')],'grant_type':_0x33b4('0x29')},'json':!![]};return rp(_0x1a005c)[_0x33b4('0x2a')](function(_0x33bff0){accountsTokens[_0x49220b['id']]={'access_token':_0x33bff0[_0x33b4('0x1e')],'expires_in':moment()[_0x33b4('0x2b')](_0x33bff0[_0x33b4('0x20')],'seconds')};_0x24df08(_0x33bff0[_0x33b4('0x1e')]);})[_0x33b4('0x2c')](function(_0x1ab3d4){logger['error']('Failing\x20creating\x20the\x20access_token',_0x1ab3d4['stack']);_0x248949(_0x1ab3d4);});});}function getUser(_0x3e0b8e,_0xf1e1c6,_0x1ebb5e,_0x560437){logger['info'](_0x33b4('0x2d'));return request({'method':_0x33b4('0x2e'),'uri':util[_0x33b4('0x2f')](_0x33b4('0x30'),_0xf1e1c6),'qs':{'type':_0x33b4('0x31')},'headers':{'Authorization':_0x33b4('0x32')+_0x3e0b8e},'json':!![]})['then'](function(_0x3f4e10){if(_0x3f4e10['users']){var _0x110e56=-0x1;if(_[_0x33b4('0x33')](_0x3f4e10['users'])){if(!_[_0x33b4('0x1d')](_0x560437)){_0x110e56=_[_0x33b4('0x34')](_0x3f4e10[_0x33b4('0x35')],function(_0x81146e){return _0x81146e['email']===_0x560437;});}if(_0x110e56>=0x0){logger[_0x33b4('0x36')](_0x33b4('0x37'));}else{logger[_0x33b4('0x36')](_0x33b4('0x38'));_0x110e56=_[_0x33b4('0x34')](_0x3f4e10[_0x33b4('0x35')],function(_0x42daf7){return _0x42daf7[_0x33b4('0x39')][_0x33b4('0x19')]===_0x33b4('0x3a');});}return _0x3f4e10[_0x33b4('0x35')][_0x110e56];}else{if(_0x3f4e10[_0x33b4('0x3b')][_0x33b4('0x39')][_0x33b4('0x19')]==='Administrator'){logger[_0x33b4('0x36')]('Using\x20the\x20admin\x20account!');user=_0x3f4e10[_0x33b4('0x3b')];return user;}else{logger[_0x33b4('0x3c')](_0x33b4('0x3d'),JSON['stringify'](_0x3f4e10));throw new Error(_0x33b4('0x3e')+JSON[_0x33b4('0xf')](_0x3f4e10));}}}else{logger[_0x33b4('0x3c')](_0x33b4('0x3d'),JSON[_0x33b4('0xf')](_0x3f4e10));throw new Error(_0x33b4('0x3e')+JSON['stringify'](_0x3f4e10));}})[_0x33b4('0x2c')](function(_0x36d96a){console[_0x33b4('0x3c')](_0x36d96a);});}function getZohoUser(_0x5dad76,_0x17c78){return new BPromise(function(_0x13143b,_0x29e4d1){request(_0x5dad76)['then'](function(_0x564a9f){var _0x332733=null;if(_0x564a9f){_0x332733=_0x564a9f[_0x33b4('0x3f')][0x0];_0x332733['enduserType']=_0x17c78;}_0x13143b(_0x332733);})[_0x33b4('0x2c')](function(_0x3700b8){_0x29e4d1(_0x3700b8);});});}function createEndUser(_0x2bef15,_0x373c61,_0x3d77c9,_0x3e13ef,_0x318584,_0x48d77f){var _0x3d77c9=getName(_0x3d77c9);return request({'method':_0x33b4('0x25'),'uri':_0x33b4('0x40')+_0x373c61+_0x33b4('0x41')+_[_0x33b4('0x42')](_0x48d77f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3d77c9[0x1],'First_Name':_0x3d77c9[0x0],'Phone':_0x3e13ef,'Owner':{'name':!_[_0x33b4('0x1d')](_0x318584[_0x33b4('0x43')]['name'])?_0x318584[_0x33b4('0x43')][_0x33b4('0x19')]:!_[_0x33b4('0x1d')](_0x318584[_0x33b4('0x44')])?_0x318584[_0x33b4('0x44')]+'\x20'+_0x318584[_0x33b4('0x45')]:_0x318584[_0x33b4('0x45')],'id':_0x318584['id']}}]},'headers':{'Authorization':_0x33b4('0x32')+_0x2bef15},'json':!![]})['then'](function(_0x3b5122){if(_0x3b5122&&_0x3b5122[_0x33b4('0x3f')][0x0][_0x33b4('0x46')]==='SUCCESS'){var _0x1bab1f=_0x3b5122[_0x33b4('0x3f')][0x0][_0x33b4('0x47')];_0x1bab1f['enduserType']=_[_0x33b4('0x42')](_0x48d77f['moduleCreate'])+'s';return _0x1bab1f;}logger[_0x33b4('0x3c')](_0x33b4('0x3d'),JSON['stringify'](data));throw new Error(_0x33b4('0x48')+JSON[_0x33b4('0xf')](data));})['catch'](function(_0x555cf8){console[_0x33b4('0x49')]('CREATE\x20ERROR',_0x555cf8);});}function getEndUser(_0x806980,_0x32855a,_0x497a5a,_0x335674,_0x2126da,_0x547707,_0x36d913){var _0xa18ca6={'method':'GET','uri':'','headers':{'Authorization':_0x33b4('0x32')+_0x806980},'json':!![]};switch(_0x36d913[_0x33b4('0x4a')]){case'contact_lead':_0xa18ca6[_0x33b4('0x4b')]='https://www.zohoapis.'+_0x32855a+_0x33b4('0x4c')+_0x2126da+'))';return getZohoUser(_0xa18ca6,_0x33b4('0x4d'))[_0x33b4('0x2a')](function(_0x24394a){if(_0x24394a)return _0x24394a;_0xa18ca6[_0x33b4('0x4b')]=_0x33b4('0x40')+_0x32855a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2126da+'))';return getZohoUser(_0xa18ca6,'Leads')['then'](function(_0x2c68f7){if(_0x2c68f7)return _0x2c68f7;if(_0x36d913[_0x33b4('0x4e')]!=_0x33b4('0x4f')){return createEndUser(_0x806980,_0x32855a,_0x335674,_0x2126da,_0x547707,_0x36d913);}else{return{};}});});break;case _0x33b4('0x50'):_0xa18ca6[_0x33b4('0x4b')]='https://www.zohoapis.'+_0x32855a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2126da+'))';return getZohoUser(_0xa18ca6,_0x33b4('0x4d'))['then'](function(_0x5bf802){if(_0x5bf802)return _0x5bf802;if(_0x36d913[_0x33b4('0x4e')]!='nothing'){return createEndUser(_0x806980,_0x32855a,_0x335674,_0x2126da,_0x547707,_0x36d913);}else{return{};}});break;case _0x33b4('0x51'):_0xa18ca6[_0x33b4('0x4b')]='https://www.zohoapis.'+_0x32855a+_0x33b4('0x52')+_0x2126da+'))';return getZohoUser(_0xa18ca6,'Leads')[_0x33b4('0x2a')](function(_0x1016aa){if(_0x1016aa)return _0x1016aa;if(_0x36d913['moduleCreate']!='nothing'){return createEndUser(_0x806980,_0x32855a,_0x335674,_0x2126da,_0x547707,_0x36d913);}else{return{};}});break;}}function getCall(_0x555894,_0x40f90a,_0x55b7fd,_0x47d190,_0x28d7c0,_0x18c35f,_0x1c3a09,_0x6483cc){logger[_0x33b4('0x36')](_0x33b4('0x53'));var _0x47e9f1={};_0x47e9f1[_0x33b4('0x54')]={'name':!_['isNil'](_0x47d190[_0x33b4('0x43')][_0x33b4('0x19')])&&!_['isNil'](_0x47d190[_0x33b4('0x39')][_0x33b4('0x19')])&&_0x47d190[_0x33b4('0x39')][_0x33b4('0x19')]===_0x33b4('0x55')?_0x47d190[_0x33b4('0x43')]['name']:!_['isNil'](_0x47d190['first_name'])?_0x47d190[_0x33b4('0x44')]+'\x20'+_0x47d190[_0x33b4('0x45')]:_0x47d190[_0x33b4('0x45')],'id':_0x47d190['id']};_0x47e9f1['Subject']=intUtil[_0x33b4('0x56')](_0x18c35f[_0x33b4('0x57')],_0x1c3a09,'\x20');_0x47e9f1[_0x33b4('0x58')]=intUtil[_0x33b4('0x56')](_0x18c35f[_0x33b4('0x59')],_0x1c3a09,'\x0a');if(_0x28d7c0[_0x33b4('0x5a')]===_0x33b4('0x4d')){_0x47e9f1[_0x33b4('0x5b')]={'name':!_[_0x33b4('0x1d')](_0x28d7c0[_0x33b4('0x5c')])?_0x28d7c0['Full_Name']:!_[_0x33b4('0x1d')](_0x28d7c0[_0x33b4('0x5d')])?_0x28d7c0[_0x33b4('0x5d')]+'\x20'+_0x28d7c0[_0x33b4('0x5e')]:_0x28d7c0[_0x33b4('0x5e')],'id':_0x28d7c0['id']};}if(_0x28d7c0['enduserType']===_0x33b4('0x5f')){_0x47e9f1['What_Id']={'name':!_[_0x33b4('0x1d')](_0x28d7c0[_0x33b4('0x5c')])?_0x28d7c0['Full_Name']:!_['isNil'](_0x28d7c0[_0x33b4('0x5d')])?_0x28d7c0[_0x33b4('0x5d')]+'\x20'+_0x28d7c0[_0x33b4('0x5e')]:_0x28d7c0['Last_Name'],'id':_0x28d7c0['id']};_0x47e9f1[_0x33b4('0x60')]=_[_0x33b4('0x42')](_0x28d7c0[_0x33b4('0x5a')]);}if(_0x1c3a09['talktime']){_0x47e9f1[_0x33b4('0x61')]=moment[_0x33b4('0x62')](parseInt(_0x1c3a09[_0x33b4('0x63')])*0x3e8)['format'](_0x33b4('0x64'));}else if(_0x1c3a09[_0x33b4('0x65')]&&_0x1c3a09[_0x33b4('0x66')]){_0x47e9f1[_0x33b4('0x61')]=moment[_0x33b4('0x62')](moment(_0x1c3a09[_0x33b4('0x66')],_0x33b4('0x67'))[_0x33b4('0x68')](moment(_0x1c3a09[_0x33b4('0x69')],_0x33b4('0x67'))))[_0x33b4('0x2f')](_0x33b4('0x64'));}switch(_0x1c3a09['lastevent']){case _0x33b4('0x6a'):_0x47e9f1[_0x33b4('0x6b')]='Called';break;case'complete':case'connect':_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x6c');break;case _0x33b4('0x6d'):_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x6e');break;case _0x33b4('0x6f'):_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x70');break;case'timeout':_0x47e9f1[_0x33b4('0x6b')]=_0x33b4('0x71');default:}_0x47e9f1[_0x33b4('0x72')]=(_0x6483cc===_0x33b4('0x73')?moment(_0x1c3a09[_0x33b4('0x69')])[_0x33b4('0x2f')](_0x33b4('0x67')):moment(_0x1c3a09['agentcalledAt'])['format'](_0x33b4('0x67')))||moment()[_0x33b4('0x2f')](_0x33b4('0x67'));_0x47e9f1[_0x33b4('0x74')]=_0x6483cc||_0x33b4('0x75');_0x47e9f1=_['merge'](_0x47e9f1,getCustomFields(_0x18c35f[_0x33b4('0x76')],_0x1c3a09));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x40f90a+_0x33b4('0x77'),'headers':{'Authorization':_0x33b4('0x32')+_0x555894},'body':{'data':[_0x47e9f1]},'json':!![]})['then'](function(_0x48864d){if(_0x48864d&&_0x48864d[_0x33b4('0x3f')][0x0][_0x33b4('0x46')]===_0x33b4('0x78')){logger[_0x33b4('0x36')](_0x33b4('0x79'));return{'id':_0x48864d[_0x33b4('0x3f')][0x0][_0x33b4('0x47')]['id']};}})['catch'](function(_0x5e423a){logger['info'](_0x33b4('0x7a'),_0x5e423a[_0x33b4('0x7b')]);console[_0x33b4('0x49')](_0x33b4('0x7a'),_0x5e423a);});}exports[_0x33b4('0x7c')]=function(_0x107023,_0xa46eef,_0x309d6a,_0x103c92,_0x2f964e,_0x3829b1){var _0x1350f9,_0x7dbf50,_0x2445d7;_0x3829b1[_0x33b4('0x7d')]=intUtil[_0x33b4('0x7e')](_0x3829b1[_0x33b4('0x7d')]);_0x3829b1[_0x33b4('0x7f')]=intUtil[_0x33b4('0x7e')](_0x3829b1[_0x33b4('0x7f')]);if(_0x2f964e&&_0x2f964e[_0x33b4('0x80')]){logger[_0x33b4('0x36')](_0x33b4('0x81'),_0x33b4('0x82'));_0xa46eef[_0x33b4('0x83')]=_0x3829b1[_0x33b4('0x7f')]+_0x33b4('0x84')+_0xa46eef['uniqueid']+_0x33b4('0x85')+md5(_0xa46eef[_0x33b4('0x86')]);}else{_0xa46eef[_0x33b4('0x83')]='';}var _0x2b8fbf=_0x3829b1[_0x33b4('0x7d')]===_0x33b4('0x87')?'eu':_0x33b4('0x88');return getAccessToken(_0x3829b1)[_0x33b4('0x2a')](function(_0x446116){_0x2445d7=_0x446116;return getUser(_0x2445d7,_0x2b8fbf,_0x3829b1,_0x103c92[_0x33b4('0x89')]);})[_0x33b4('0x2a')](function(_0x4d9fdc){_0x1350f9=_0x4d9fdc;logger[_0x33b4('0x36')]('The\x20User\x20ID\x20is:',_0x1350f9['id']);return getEndUser(_0x2445d7,_0x2b8fbf,_0x3829b1,_0xa46eef[_0x33b4('0x8a')],_0xa46eef['calleridnum'],_0x1350f9,_0x309d6a);})[_0x33b4('0x2a')](function(_0x579e6b){_0x7dbf50=_0x579e6b;return getCall(_0x2445d7,_0x2b8fbf,_0x3829b1,_0x1350f9,_0x7dbf50,_0x309d6a,_0xa46eef,'Inbound');})['then'](function(_0x1844cd){if(_0x1844cd){logger[_0x33b4('0x36')](_0x33b4('0x8b'),_0x1844cd['id']);logger[_0x33b4('0x36')](_0x33b4('0x81'),_0x33b4('0x8c'));emit(util[_0x33b4('0x2f')](_0x33b4('0x8d'),_0x103c92[_0x33b4('0x19')]),'trigger:browser:url',{'uri':_0x33b4('0x8e')+_0x3829b1[_0x33b4('0x7d')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1844cd['id']});}})['catch'](function(_0x5cb308){logger[_0x33b4('0x3c')](_0x33b4('0x81'),JSON[_0x33b4('0xf')](_0x5cb308));});};exports['outbound']=function(_0x58f877,_0x32c6fd,_0x2fbc68,_0x548d94,_0x20faa3,_0x10a2d0,_0x59213b){var _0x20bce6,_0x6758b8,_0x4087ba;_0x10a2d0['host']=intUtil[_0x33b4('0x7e')](_0x10a2d0[_0x33b4('0x7d')]);_0x10a2d0[_0x33b4('0x7f')]=intUtil[_0x33b4('0x7e')](_0x10a2d0['serverUrl']);if(_0x59213b&&_0x59213b[_0x33b4('0x8f')]&&_0x59213b[_0x33b4('0x8f')]!=='none'){logger[_0x33b4('0x36')]('[OUTBOUND]',_0x33b4('0x82'));_0x32c6fd[_0x33b4('0x83')]=_0x10a2d0[_0x33b4('0x7f')]+_0x33b4('0x84')+_0x32c6fd[_0x33b4('0x86')]+_0x33b4('0x85')+md5(_0x32c6fd['uniqueid']);}var _0x3bd1c0=_0x10a2d0[_0x33b4('0x7d')]===_0x33b4('0x87')?'eu':_0x33b4('0x88');return getAccessToken(_0x10a2d0)[_0x33b4('0x2a')](function(_0x457e78){_0x4087ba=_0x457e78;return getUser(_0x4087ba,_0x3bd1c0,_0x10a2d0,_0x548d94[_0x33b4('0x89')]);})[_0x33b4('0x2a')](function(_0x21dc5d){_0x20bce6=_0x21dc5d;logger[_0x33b4('0x36')]('The\x20User\x20ID\x20is:',_0x20bce6['id']);return getEndUser(_0x4087ba,_0x3bd1c0,_0x10a2d0,_0x32c6fd[_0x33b4('0x90')],_0x32c6fd[_0x33b4('0x91')],_0x20bce6,_0x2fbc68);})[_0x33b4('0x2a')](function(_0x31c0bb){_0x6758b8=_0x31c0bb;return getCall(_0x4087ba,_0x3bd1c0,_0x10a2d0,_0x20bce6,_0x6758b8,_0x2fbc68,_0x32c6fd,_0x33b4('0x92'));})[_0x33b4('0x2a')](function(_0x53fd4f){if(_0x53fd4f){logger[_0x33b4('0x36')](_0x33b4('0x8b'),_0x53fd4f['id']);logger['info'](_0x33b4('0x93'),_0x33b4('0x8c'));emit(util[_0x33b4('0x2f')]('user:%s',_0x548d94[_0x33b4('0x19')]),_0x33b4('0x94'),{'uri':_0x33b4('0x8e')+_0x10a2d0['host']+_0x33b4('0x95')+_0x53fd4f['id']});}})['catch'](function(_0xf2a49e){logger[_0x33b4('0x3c')](_0x33b4('0x93'),JSON['stringify'](_0xf2a49e));});};exports['unmanaged']=function(_0x8ed985,_0x1af8cf,_0x466551,_0x1be726,_0xad391f,_0x4a9a99){var _0xcd1eed,_0x294250,_0xfb4cc6;_0x4a9a99[_0x33b4('0x7d')]=intUtil[_0x33b4('0x7e')](_0x4a9a99[_0x33b4('0x7d')]);_0x4a9a99[_0x33b4('0x7f')]=intUtil[_0x33b4('0x7e')](_0x4a9a99[_0x33b4('0x7f')]);if(_0xad391f&&_0xad391f['monitor_format']){logger[_0x33b4('0x36')]('['+_0x1af8cf[_0x33b4('0x96')][_0x33b4('0x97')]()+']',_0x33b4('0x82'));_0x1af8cf[_0x33b4('0x83')]=_0x4a9a99['serverUrl']+_0x33b4('0x84')+_0x1af8cf[_0x33b4('0x86')]+_0x33b4('0x85')+md5(_0x1af8cf['uniqueid']);}else{_0x1af8cf[_0x33b4('0x83')]='';}var _0xd30942=_0x4a9a99[_0x33b4('0x7d')]===_0x33b4('0x87')?'eu':_0x33b4('0x88');return getAccessToken(_0x4a9a99)[_0x33b4('0x2a')](function(_0x26cd89){_0xfb4cc6=_0x26cd89;return getUser(_0xfb4cc6,_0xd30942,_0x4a9a99);})[_0x33b4('0x2a')](function(_0x146fa1){_0xcd1eed=_0x146fa1;logger['info'](_0x33b4('0x98'),_0xcd1eed['id']);return getEndUser(_0xfb4cc6,_0xd30942,_0x4a9a99,_0x1af8cf[_0x33b4('0x8a')],_0x1af8cf[_0x33b4('0x99')],_0xcd1eed,_0x466551);})[_0x33b4('0x2a')](function(_0x28650b){_0x294250=_0x28650b;return getCall(_0xfb4cc6,_0xd30942,_0x4a9a99,_0xcd1eed,_0x294250,_0x466551,_0x1af8cf,'Inbound');})[_0x33b4('0x2a')](function(_0x500561){if(_0x500561){logger['info'](_0x33b4('0x8b'),_0x500561['id']);}})[_0x33b4('0x2c')](function(_0x5dd026){logger[_0x33b4('0x3c')]('['+_0x1af8cf[_0x33b4('0x96')][_0x33b4('0x97')]()+']',JSON[_0x33b4('0xf')](_0x5dd026));});}; \ 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 71fb1ed..f35c771 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 _0xac31=['error','format','info','util','../../../../config/logger','data2','Script','data3','exec'];(function(_0x380b8f,_0x32271d){var _0x646c69=function(_0x57c77f){while(--_0x57c77f){_0x380b8f['push'](_0x380b8f['shift']());}};_0x646c69(++_0x32271d);}(_0xac31,0x16b));var _0x1ac3=function(_0x179b96,_0x74bb85){_0x179b96=_0x179b96-0x0;var _0x52f631=_0xac31[_0x179b96];return _0x52f631;};'use strict';var util=require(_0x1ac3('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x1ac3('0x1'))('trigger');exports['exec']=function(_0x213d21,_0x23f139){var _0x56098c=_0x213d21[_0x1ac3('0x2')]?_0x213d21[_0x1ac3('0x2')]:_0x1ac3('0x3');var _0x21e16b=_0x213d21['data3']?Mustache['render'](_0x213d21[_0x1ac3('0x4')],_0x23f139):_0x23f139;sh[_0x1ac3('0x5')](_0x21e16b,function(_0x2b71ce,_0x55298d,_0x30f94a){if(_0x2b71ce!==0x0){logger[_0x1ac3('0x6')](util[_0x1ac3('0x7')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x56098c,_0x21e16b,_0x2b71ce,_0x30f94a));}else{logger[_0x1ac3('0x8')](util[_0x1ac3('0x7')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x56098c,_0x21e16b,_0x55298d));}});}; \ No newline at end of file +var _0x927d=['trigger','data2','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs'];(function(_0x16741b,_0x1a2eb6){var _0x53e301=function(_0x4fe916){while(--_0x4fe916){_0x16741b['push'](_0x16741b['shift']());}};_0x53e301(++_0x1a2eb6);}(_0x927d,0x13a));var _0xd927=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x927d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var sh=require(_0xd927('0x0'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xd927('0x1'));exports['exec']=function(_0xb26fd8,_0x12ac67){var _0x69597e=_0xb26fd8[_0xd927('0x2')]?_0xb26fd8[_0xd927('0x2')]:'Script';var _0x1a7788=_0xb26fd8['data3']?Mustache[_0xd927('0x3')](_0xb26fd8[_0xd927('0x4')],_0x12ac67):_0x12ac67;sh['exec'](_0x1a7788,function(_0x15bd7e,_0x782c55,_0xf5ddfc){if(_0x15bd7e!==0x0){logger[_0xd927('0x5')](util[_0xd927('0x6')](_0xd927('0x7'),_0x69597e,_0x1a7788,_0x15bd7e,_0xf5ddfc));}else{logger['info'](util[_0xd927('0x6')](_0xd927('0x8'),_0x69597e,_0x1a7788,_0x782c55));}});}; \ 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 e5b6477..12549a5 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 _0x2c74=['statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data5','number','headers','parse','error','stack','data1','DELETE','POST','PUT','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','isNil',',\x20request\x20body:\x20','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2'];(function(_0x2cfc34,_0x467114){var _0x37a4bc=function(_0x4b059c){while(--_0x4b059c){_0x2cfc34['push'](_0x2cfc34['shift']());}};_0x37a4bc(++_0x467114);}(_0x2c74,0x12e));var _0x42c7=function(_0x36bb0f,_0x5c49d5){_0x36bb0f=_0x36bb0f-0x0;var _0x3b68a8=_0x2c74[_0x36bb0f];return _0x3b68a8;};'use strict';var rp=require('request-promise');var util=require(_0x42c7('0x0'));var _=require('lodash');var Mustache=require(_0x42c7('0x1'));var logger=require(_0x42c7('0x2'))(_0x42c7('0x3'));exports[_0x42c7('0x4')]=function(_0x265a9d,_0xa5de0f){var _0x408aa6,_0x495319;var _0x41bb4c={'method':_0x265a9d['data1'][_0x42c7('0x5')](),'uri':Mustache[_0x42c7('0x6')](_0x265a9d['data2'],_0xa5de0f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x265a9d[_0x42c7('0x7')])===_0x42c7('0x8')&&parseInt(_0x265a9d[_0x42c7('0x7')])>=0x1&&parseInt(_0x265a9d[_0x42c7('0x7')])<=0xa?parseInt(_0x265a9d[_0x42c7('0x7')])*0x3e8:0x5*0x3e8};try{_0x41bb4c[_0x42c7('0x9')]=_0x265a9d['data6']?JSON[_0x42c7('0xa')](Mustache[_0x42c7('0x6')](_0x265a9d['data6'],_0xa5de0f)):{};}catch(_0x25f9ef){logger[_0x42c7('0xb')](_0x25f9ef[_0x42c7('0xc')]);}switch(_0x265a9d[_0x42c7('0xd')]['toUpperCase']()){case'GET':case _0x42c7('0xe'):_0x408aa6=null;_0x41bb4c['qs']=_0xa5de0f;break;case _0x42c7('0xf'):case _0x42c7('0x10'):if(_0x265a9d['data7']){try{_0x408aa6=JSON['parse'](Mustache['render'](_0x265a9d['data7'],_0xa5de0f));_0x41bb4c[_0x42c7('0x11')]=_0x408aa6;}catch(_0x22344f){logger[_0x42c7('0xb')](_0x22344f[_0x42c7('0xc')]);logger[_0x42c7('0xb')](_0x42c7('0x12'));}}else{_0x408aa6=_0xa5de0f;_0x41bb4c[_0x42c7('0x11')]=_0x408aa6;}break;}logger['info'](util[_0x42c7('0x13')](_0x42c7('0x14'),_0x265a9d[_0x42c7('0xd')],_0x265a9d['data2'],JSON['stringify'](_0x41bb4c)));rp(_0x41bb4c)['then'](function(_0x1215e9){_0x408aa6=!_[_0x42c7('0x15')](_0x408aa6)?_0x42c7('0x16')+_0x408aa6:'';_0x495319=typeof _0x1215e9[_0x42c7('0x11')]===_0x42c7('0x17')?JSON[_0x42c7('0x18')](_0x1215e9[_0x42c7('0x11')]):_0x1215e9[_0x42c7('0x11')];logger[_0x42c7('0x19')](util[_0x42c7('0x13')](_0x42c7('0x1a'),_0x265a9d[_0x42c7('0xd')],_0x265a9d[_0x42c7('0x1b')],_0x1215e9[_0x42c7('0x1c')],_0x495319));})[_0x42c7('0x1d')](function(_0x46312d){logger[_0x42c7('0xb')](util[_0x42c7('0x13')](_0x42c7('0x1e'),_0x265a9d[_0x42c7('0xd')],_0x265a9d[_0x42c7('0x1b')],_0x46312d[_0x42c7('0x1c')],_0x46312d[_0x42c7('0x1f')],_0x46312d[_0x42c7('0x20')]));});}; \ No newline at end of file +var _0x2770=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','parse','data6','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','isNil',',\x20request\x20body:\x20','object','stringify','statusCode'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x2770,0x1bc));var _0x0277=function(_0x5ee3d3,_0x537c30){_0x5ee3d3=_0x5ee3d3-0x0;var _0x4b272f=_0x2770[_0x5ee3d3];return _0x4b272f;};'use strict';var rp=require(_0x0277('0x0'));var util=require(_0x0277('0x1'));var _=require(_0x0277('0x2'));var Mustache=require(_0x0277('0x3'));var logger=require(_0x0277('0x4'))(_0x0277('0x5'));exports[_0x0277('0x6')]=function(_0x338827,_0x4b5e96){var _0xe7bc14,_0x525ceb;var _0x43f2b1={'method':_0x338827[_0x0277('0x7')][_0x0277('0x8')](),'uri':Mustache[_0x0277('0x9')](_0x338827[_0x0277('0xa')],_0x4b5e96),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x338827[_0x0277('0xb')])===_0x0277('0xc')&&parseInt(_0x338827['data5'])>=0x1&&parseInt(_0x338827['data5'])<=0xa?parseInt(_0x338827[_0x0277('0xb')])*0x3e8:0x5*0x3e8};try{_0x43f2b1[_0x0277('0xd')]=_0x338827['data6']?JSON[_0x0277('0xe')](Mustache[_0x0277('0x9')](_0x338827[_0x0277('0xf')],_0x4b5e96)):{};}catch(_0x8aaa80){logger['error'](_0x8aaa80[_0x0277('0x10')]);}switch(_0x338827['data1'][_0x0277('0x8')]()){case _0x0277('0x11'):case _0x0277('0x12'):_0xe7bc14=null;_0x43f2b1['qs']=_0x4b5e96;break;case _0x0277('0x13'):case _0x0277('0x14'):if(_0x338827[_0x0277('0x15')]){try{_0xe7bc14=JSON[_0x0277('0xe')](Mustache[_0x0277('0x9')](_0x338827[_0x0277('0x15')],_0x4b5e96));_0x43f2b1[_0x0277('0x16')]=_0xe7bc14;}catch(_0xe52678){logger[_0x0277('0x17')](_0xe52678[_0x0277('0x10')]);logger['error'](_0x0277('0x18'));}}else{_0xe7bc14=_0x4b5e96;_0x43f2b1[_0x0277('0x16')]=_0xe7bc14;}break;}logger[_0x0277('0x19')](util[_0x0277('0x1a')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x338827['data1'],_0x338827['data2'],JSON['stringify'](_0x43f2b1)));rp(_0x43f2b1)['then'](function(_0x1c6015){_0xe7bc14=!_[_0x0277('0x1b')](_0xe7bc14)?_0x0277('0x1c')+_0xe7bc14:'';_0x525ceb=typeof _0x1c6015[_0x0277('0x16')]===_0x0277('0x1d')?JSON[_0x0277('0x1e')](_0x1c6015[_0x0277('0x16')]):_0x1c6015[_0x0277('0x16')];logger[_0x0277('0x19')](util[_0x0277('0x1a')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x338827[_0x0277('0x7')],_0x338827[_0x0277('0xa')],_0x1c6015[_0x0277('0x1f')],_0x525ceb));})['catch'](function(_0x39890d){logger[_0x0277('0x17')](util[_0x0277('0x1a')](_0x0277('0x20'),_0x338827[_0x0277('0x7')],_0x338827[_0x0277('0xa')],_0x39890d['statusCode'],_0x39890d[_0x0277('0x21')],_0x39890d['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 38398bc..637fc19 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 _0x7830=['jayson/promise','../../config/logger','routing','http','request','then','rpc','error','message','result','catch','exports'];(function(_0x48a435,_0x426db1){var _0x510583=function(_0x104c40){while(--_0x104c40){_0x48a435['push'](_0x48a435['shift']());}};_0x510583(++_0x426db1);}(_0x7830,0x1e0));var _0x0783=function(_0x2a9163,_0x4436c4){_0x2a9163=_0x2a9163-0x0;var _0x80b227=_0x7830[_0x2a9163];return _0x80b227;};'use strict';var jayson=require(_0x0783('0x0'));var BPromise=require('bluebird');var logger=require(_0x0783('0x1'))(_0x0783('0x2'));var client=jayson['client'][_0x0783('0x3')]({'port':0x2329});client['Request']=function(_0x216cdf,_0x4ae196){return new BPromise(function(_0xceb1a9,_0x1c1725){return client[_0x0783('0x4')](_0x216cdf,_0x4ae196)[_0x0783('0x5')](function(_0x5d34d5){logger['debug'](_0x0783('0x6'),'routing',_0x216cdf,_0x4ae196,_0x5d34d5);if(_0x5d34d5[_0x0783('0x7')]){logger['error'](_0x0783('0x6'),_0x0783('0x2'),_0x216cdf,_0x5d34d5[_0x0783('0x7')][_0x0783('0x8')],_0x4ae196);return _0x1c1725(_0x5d34d5[_0x0783('0x7')][_0x0783('0x8')]);}else{return _0xceb1a9(_0x5d34d5[_0x0783('0x9')]);}})[_0x0783('0xa')](function(_0x362e4b){logger['error'](_0x0783('0x6'),_0x0783('0x2'),_0x216cdf,_0x362e4b,_0x4ae196);return _0x1c1725(_0x362e4b);});});};module[_0x0783('0xb')]=client; \ No newline at end of file +var _0xf87a=['message','result','exports','jayson/promise','routing','client','Request','request','then','debug','rpc','error'];(function(_0x3871d7,_0x3cfcc5){var _0x28ec09=function(_0x2bb918){while(--_0x2bb918){_0x3871d7['push'](_0x3871d7['shift']());}};_0x28ec09(++_0x3cfcc5);}(_0xf87a,0x1bf));var _0xaf87=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf87a[_0x21a9d9];return _0x46adce;};'use strict';var jayson=require(_0xaf87('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xaf87('0x1'));var client=jayson[_0xaf87('0x2')]['http']({'port':0x2329});client[_0xaf87('0x3')]=function(_0x3dc598,_0x3f0359){return new BPromise(function(_0x46e0ed,_0x1cd22c){return client[_0xaf87('0x4')](_0x3dc598,_0x3f0359)[_0xaf87('0x5')](function(_0x34af06){logger[_0xaf87('0x6')](_0xaf87('0x7'),_0xaf87('0x1'),_0x3dc598,_0x3f0359,_0x34af06);if(_0x34af06[_0xaf87('0x8')]){logger[_0xaf87('0x8')](_0xaf87('0x7'),_0xaf87('0x1'),_0x3dc598,_0x34af06['error'][_0xaf87('0x9')],_0x3f0359);return _0x1cd22c(_0x34af06[_0xaf87('0x8')]['message']);}else{return _0x46e0ed(_0x34af06[_0xaf87('0xa')]);}})['catch'](function(_0xcf8d08){logger[_0xaf87('0x8')]('rpc',_0xaf87('0x1'),_0x3dc598,_0xcf8d08,_0x3f0359);return _0x1cd22c(_0xcf8d08);});});};module[_0xaf87('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1a5cb26..1bb9ce3 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 _0xbbe4=['email','then','refresh','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x5198a7,_0x3ecd00){var _0x24dba6=function(_0x248669){while(--_0x248669){_0x5198a7['push'](_0x5198a7['shift']());}};_0x24dba6(++_0x3ecd00);}(_0xbbe4,0x13f));var _0x4bbe=function(_0x29a707,_0x342505){_0x29a707=_0x29a707-0x0;var _0x229e83=_0xbbe4[_0x29a707];return _0x229e83;};'use strict';var server=require(_0x4bbe('0x0'));var Realtime=require(_0x4bbe('0x1'));var EmailChannel=require(_0x4bbe('0x2'));var mailAccount=require(_0x4bbe('0x3'));var setting=require(_0x4bbe('0x4'));var logger=require('../../config/logger')(_0x4bbe('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x4bbe('0x6')](mailAccount['getMailAccounts']())[_0x4bbe('0x6')](realtime['initMailAccounts']())[_0x4bbe('0x6')](function(){email[_0x4bbe('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x4bbe('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0x4bbe('0x8')]();})[_0x4bbe('0x6')](function(_0x121605){return setInterval(initRealtime,_0x121605[_0x4bbe('0x9')]*0x3e8);})['catch'](function(_0x41028b){logger[_0x4bbe('0xa')](_0x4bbe('0xb'),_0x41028b);});}main(); \ No newline at end of file +var _0x7493=['loginMailFrequency','catch','error','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen','getSettings'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0x7493,0xe3));var _0x3749=function(_0x2221f2,_0x4acdaa){_0x2221f2=_0x2221f2-0x0;var _0x4ba58a=_0x7493[_0x2221f2];return _0x4ba58a;};'use strict';var server=require('./server');var Realtime=require(_0x3749('0x0'));var EmailChannel=require(_0x3749('0x1'));var mailAccount=require(_0x3749('0x2'));var setting=require(_0x3749('0x3'));var logger=require('../../config/logger')(_0x3749('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x3749('0x5')]()['then'](mailAccount[_0x3749('0x6')]())['then'](realtime[_0x3749('0x7')]())[_0x3749('0x8')](function(){email[_0x3749('0x9')](realtime[_0x3749('0xa')]);return realtime;});}function main(){return server[_0x3749('0xb')](realtime,email)[_0x3749('0x8')](function(){return initRealtime();})[_0x3749('0x8')](function(){return setting[_0x3749('0xc')]();})[_0x3749('0x8')](function(_0x4b14da){return setInterval(initRealtime,_0x4b14da[_0x3749('0xd')]*0x3e8);})[_0x3749('0xe')](function(_0x373518){logger[_0x3749('0xf')]('Email\x20service\x20initialization',_0x373518);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index fc2da54..0409c35 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 _0x5853=['handleImapEnd','error','handleImapError','disabled','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','Smtp','lastSync','verify','verified','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','status','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail'];(function(_0x44b14c,_0x2f77af){var _0x5e5548=function(_0x2330e8){while(--_0x2330e8){_0x44b14c['push'](_0x44b14c['shift']());}};_0x5e5548(++_0x2f77af);}(_0x5853,0xc2));var _0x3585=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x5853[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x3585('0x0'));var moment=require(_0x3585('0x1'));var BPromise=require(_0x3585('0x2'));var md5=require(_0x3585('0x3'));var Redis=require(_0x3585('0x4'));var config=require(_0x3585('0x5'));var logger=require(_0x3585('0x6'))(_0x3585('0x7'));config[_0x3585('0x8')]=_[_0x3585('0x9')](config[_0x3585('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3585('0xa'))(new Redis(config[_0x3585('0x8')]));var EmailImap=require(_0x3585('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3585('0xc'));var md5Accounts={};function EmailChannel(_0x3317bd){logger[_0x3585('0xd')](_0x3585('0xe'));this[_0x3585('0xf')]=_0x3317bd['mailAccounts'];this[_0x3585('0x10')]={};this[_0x3585('0x11')]=new EmailSmtp();}EmailChannel[_0x3585('0x12')]['emit']=function(_0x1f4b2c){var _0x3f725f=this[_0x3585('0xf')][_0x1f4b2c];var _0x4b83d3={'id':_0x3f725f['id'],'name':_0x3f725f[_0x3585('0x13')],'key':_0x3f725f[_0x3585('0x14')],'active':_0x3f725f[_0x3585('0x15')],'Imap':{'status':_0x3f725f[_0x3585('0x16')][_0x3585('0x17')],'messageStatus':_0x3f725f[_0x3585('0x16')]['messageStatus'],'total':_0x3f725f[_0x3585('0x16')][_0x3585('0x18')]}};if(_[_0x3585('0x19')](md5Accounts[_0x1f4b2c])){md5Accounts[_0x1f4b2c]={};}var _0x4c77d8=md5(JSON[_0x3585('0x1a')](_0x4b83d3));if(md5Accounts[_0x1f4b2c][_0x3585('0x3')]!==_0x4c77d8){md5Accounts[_0x1f4b2c][_0x3585('0x3')]=_0x4c77d8;io[_0x3585('0x1b')](_0x3585('0x1c'),_0x4b83d3);}};EmailChannel[_0x3585('0x12')][_0x3585('0x1d')]=function(_0x19ad7a){for(var _0x2de4a9 in _0x19ad7a){if(_0x19ad7a[_0x3585('0x1e')](_0x2de4a9)){if(_0x19ad7a[_0x2de4a9][_0x3585('0x16')]&&_0x19ad7a[_0x2de4a9][_0x3585('0x15')]){var _0x32853f=_0x19ad7a[_0x2de4a9]['Imap'];if(!_0x32853f[_0x3585('0x1f')]&&_0x19ad7a[_0x2de4a9][_0x3585('0x20')]!==_0x3585('0x21'))_0x32853f[_0x3585('0x1f')]=_0x19ad7a[_0x2de4a9]['provider'];if(!this[_0x3585('0x10')][_0x3585('0x1e')](_0x32853f['id'])){this['imapAccounts'][_0x32853f['id']]=new EmailImap(_0x32853f,_0x19ad7a[_0x2de4a9][_0x3585('0x7')]);this[_0x3585('0x10')][_0x32853f['id']]['on'](_0x3585('0x22'),this[_0x3585('0x23')][_0x3585('0x24')](this,_0x2de4a9));this[_0x3585('0x10')][_0x32853f['id']]['on'](_0x3585('0x7'),this[_0x3585('0x25')][_0x3585('0x24')](this,_0x2de4a9));this[_0x3585('0x10')][_0x32853f['id']]['on']('end',this[_0x3585('0x26')][_0x3585('0x24')](this,_0x2de4a9));this['imapAccounts'][_0x32853f['id']]['on'](_0x3585('0x27'),this[_0x3585('0x28')]['bind'](this,_0x2de4a9));}}else{if(_[_0x3585('0x19')](this[_0x3585('0xf')][_0x2de4a9][_0x3585('0x16')])){this[_0x3585('0xf')][_0x2de4a9][_0x3585('0x16')]={};}this['mailAccounts'][_0x2de4a9][_0x3585('0x16')][_0x3585('0x17')]=_0x3585('0x29');this[_0x3585('0xf')][_0x2de4a9]['Imap'][_0x3585('0x2a')]='';this[_0x3585('0x1b')](_0x2de4a9);}}}};EmailChannel[_0x3585('0x12')]['handleImapBox']=function(_0x2281c9,_0x39c024){if(this[_0x3585('0xf')][_0x2281c9]){this[_0x3585('0xf')][_0x2281c9]['Imap'][_0x3585('0x17')]='connected';this['mailAccounts'][_0x2281c9]['Imap'][_0x3585('0x2a')]=_0x39c024['name'];if(_0x39c024['messages']){this[_0x3585('0xf')][_0x2281c9]['Imap'][_0x3585('0x18')]=_0x39c024[_0x3585('0x2b')][_0x3585('0x18')];}return this[_0x3585('0x1b')](_0x2281c9);}};EmailChannel['prototype'][_0x3585('0x25')]=function(_0x4f12cc,_0x4982bc){logger['info'](_0x3585('0x2c'),_0x4982bc[_0x3585('0x2d')],_0x4982bc[_0x3585('0x2e')],_0x4982bc[_0x3585('0x2f')],_0x4f12cc);if(this[_0x3585('0xf')][_0x4f12cc]){return mailAccount[_0x3585('0x30')](_0x4f12cc,_0x4982bc)[_0x3585('0x31')](function(_0x4ce127){if(_0x4ce127){logger[_0x3585('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0x3585('0x32')](function(_0x5cf850){logger[_0x3585('0x27')](_0x3585('0x33'),JSON[_0x3585('0x1a')](_0x5cf850));});}};EmailChannel['prototype'][_0x3585('0x26')]=function(_0x541bfa){if(this[_0x3585('0xf')][_0x541bfa]&&this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]){if(this[_0x3585('0x10')][this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]['id']]){delete this[_0x3585('0x10')][this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]['id']];}this[_0x3585('0xf')][_0x541bfa][_0x3585('0x16')]['lastSync']=moment();this[_0x3585('0x1b')](_0x541bfa);}};EmailChannel[_0x3585('0x12')][_0x3585('0x28')]=function(_0x1f355c,_0x3f3923){if(this[_0x3585('0xf')][_0x1f355c]){this['mailAccounts'][_0x1f355c]['Imap'][_0x3585('0x17')]='error';this[_0x3585('0xf')][_0x1f355c]['Imap']['messageStatus']=_0x3f3923;return this['emit'](_0x1f355c);}};EmailChannel['prototype'][_0x3585('0x34')]=function(_0x464275,_0x51ca9b){return this[_0x3585('0x11')][_0x3585('0x35')](_0x464275,_0x51ca9b);};EmailChannel['prototype']['verifySmtp']=function(_0x49aed8){var _0x20276d=this;if(this[_0x3585('0xf')][_0x49aed8['id']]){if(_[_0x3585('0x19')](this[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')])){this['mailAccounts'][_0x49aed8['id']][_0x3585('0x36')]={};}this[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')][_0x3585('0x37')]=moment();return new BPromise(function(_0x49569f,_0x42f561){return _0x20276d[_0x3585('0x11')][_0x3585('0x38')](_0x49aed8)[_0x3585('0x31')](function(_0x5ed29e){_0x20276d[_0x3585('0xf')][_0x49aed8['id']]['Smtp'][_0x3585('0x17')]=_0x3585('0x39');_0x20276d[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')][_0x3585('0x2a')]='';_0x20276d[_0x3585('0x1b')](_0x49aed8['id']);_0x49569f(_0x5ed29e);})[_0x3585('0x32')](function(_0x5b4f92){_0x20276d[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')]['status']=_0x3585('0x27');_0x20276d[_0x3585('0xf')][_0x49aed8['id']][_0x3585('0x36')]['messageStatus']=_0x5b4f92;_0x20276d[_0x3585('0x1b')](_0x49aed8['id']);_0x42f561(_0x5b4f92);});});}return this[_0x3585('0x11')][_0x3585('0x38')](_0x49aed8);};module['exports']=EmailChannel; \ No newline at end of file +var _0x545e=['localhost','socket.io-emitter','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','active','Imap','messageStatus','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','email','handleImapEmail','end','error','handleImapError','disabled','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','status','verify','verified','Smtp','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults'];(function(_0x88271c,_0x105f12){var _0x127add=function(_0x254197){while(--_0x254197){_0x88271c['push'](_0x88271c['shift']());}};_0x127add(++_0x105f12);}(_0x545e,0x17f));var _0xe545=function(_0x2cdc68,_0x2172dd){_0x2cdc68=_0x2cdc68-0x0;var _0x57d988=_0x545e[_0x2cdc68];return _0x57d988;};'use strict';var _=require(_0xe545('0x0'));var moment=require(_0xe545('0x1'));var BPromise=require(_0xe545('0x2'));var md5=require(_0xe545('0x3'));var Redis=require(_0xe545('0x4'));var config=require(_0xe545('0x5'));var logger=require(_0xe545('0x6'))('email');config[_0xe545('0x7')]=_[_0xe545('0x8')](config[_0xe545('0x7')],{'host':_0xe545('0x9'),'port':0x18eb});var io=require(_0xe545('0xa'))(new Redis(config[_0xe545('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0xa5ae3a){logger[_0xe545('0xb')](_0xe545('0xc'));this[_0xe545('0xd')]=_0xa5ae3a['mailAccounts'];this[_0xe545('0xe')]={};this[_0xe545('0xf')]=new EmailSmtp();}EmailChannel[_0xe545('0x10')]['emit']=function(_0x753632){var _0x588178=this[_0xe545('0xd')][_0x753632];var _0x511f27={'id':_0x588178['id'],'name':_0x588178['name'],'key':_0x588178['key'],'active':_0x588178[_0xe545('0x11')],'Imap':{'status':_0x588178[_0xe545('0x12')]['status'],'messageStatus':_0x588178['Imap'][_0xe545('0x13')],'total':_0x588178[_0xe545('0x12')][_0xe545('0x14')]}};if(_[_0xe545('0x15')](md5Accounts[_0x753632])){md5Accounts[_0x753632]={};}var _0x4450cf=md5(JSON[_0xe545('0x16')](_0x511f27));if(md5Accounts[_0x753632][_0xe545('0x3')]!==_0x4450cf){md5Accounts[_0x753632][_0xe545('0x3')]=_0x4450cf;io[_0xe545('0x17')](_0xe545('0x18'),_0x511f27);}};EmailChannel['prototype'][_0xe545('0x19')]=function(_0x34f686){for(var _0x34839a in _0x34f686){if(_0x34f686[_0xe545('0x1a')](_0x34839a)){if(_0x34f686[_0x34839a][_0xe545('0x12')]&&_0x34f686[_0x34839a][_0xe545('0x11')]){var _0x4a9ff6=_0x34f686[_0x34839a][_0xe545('0x12')];if(!_0x4a9ff6[_0xe545('0x1b')]&&_0x34f686[_0x34839a][_0xe545('0x1c')]!==_0xe545('0x1d'))_0x4a9ff6[_0xe545('0x1b')]=_0x34f686[_0x34839a][_0xe545('0x1c')];if(!this[_0xe545('0xe')][_0xe545('0x1a')](_0x4a9ff6['id'])){this[_0xe545('0xe')][_0x4a9ff6['id']]=new EmailImap(_0x4a9ff6,_0x34f686[_0x34839a]['email']);this[_0xe545('0xe')][_0x4a9ff6['id']]['on'](_0xe545('0x1e'),this[_0xe545('0x1f')][_0xe545('0x20')](this,_0x34839a));this['imapAccounts'][_0x4a9ff6['id']]['on'](_0xe545('0x21'),this[_0xe545('0x22')][_0xe545('0x20')](this,_0x34839a));this['imapAccounts'][_0x4a9ff6['id']]['on'](_0xe545('0x23'),this['handleImapEnd'][_0xe545('0x20')](this,_0x34839a));this[_0xe545('0xe')][_0x4a9ff6['id']]['on'](_0xe545('0x24'),this[_0xe545('0x25')][_0xe545('0x20')](this,_0x34839a));}}else{if(_[_0xe545('0x15')](this['mailAccounts'][_0x34839a][_0xe545('0x12')])){this[_0xe545('0xd')][_0x34839a]['Imap']={};}this[_0xe545('0xd')][_0x34839a][_0xe545('0x12')]['status']=_0xe545('0x26');this['mailAccounts'][_0x34839a]['Imap']['messageStatus']='';this[_0xe545('0x17')](_0x34839a);}}}};EmailChannel['prototype'][_0xe545('0x1f')]=function(_0x545529,_0x54c047){if(this['mailAccounts'][_0x545529]){this[_0xe545('0xd')][_0x545529]['Imap']['status']=_0xe545('0x27');this[_0xe545('0xd')][_0x545529][_0xe545('0x12')][_0xe545('0x13')]=_0x54c047[_0xe545('0x28')];if(_0x54c047[_0xe545('0x29')]){this[_0xe545('0xd')][_0x545529]['Imap']['total']=_0x54c047['messages'][_0xe545('0x14')];}return this[_0xe545('0x17')](_0x545529);}};EmailChannel[_0xe545('0x10')][_0xe545('0x22')]=function(_0xbc46d8,_0x40ff33){logger[_0xe545('0xb')](_0xe545('0x2a'),_0x40ff33[_0xe545('0x2b')],_0x40ff33[_0xe545('0x2c')],_0x40ff33[_0xe545('0x2d')],_0xbc46d8);if(this[_0xe545('0xd')][_0xbc46d8]){return mailAccount[_0xe545('0x2e')](_0xbc46d8,_0x40ff33)['then'](function(_0x462e32){if(_0x462e32){logger['info'](_0xe545('0x2f'));}})['catch'](function(_0x530a98){logger['error'](_0xe545('0x30'),JSON['stringify'](_0x530a98));});}};EmailChannel[_0xe545('0x10')][_0xe545('0x31')]=function(_0x16a7ec){if(this[_0xe545('0xd')][_0x16a7ec]&&this['mailAccounts'][_0x16a7ec]['Imap']){if(this[_0xe545('0xe')][this[_0xe545('0xd')][_0x16a7ec][_0xe545('0x12')]['id']]){delete this[_0xe545('0xe')][this[_0xe545('0xd')][_0x16a7ec][_0xe545('0x12')]['id']];}this[_0xe545('0xd')][_0x16a7ec][_0xe545('0x12')][_0xe545('0x32')]=moment();this[_0xe545('0x17')](_0x16a7ec);}};EmailChannel[_0xe545('0x10')][_0xe545('0x25')]=function(_0x4dc361,_0x41e154){if(this[_0xe545('0xd')][_0x4dc361]){this[_0xe545('0xd')][_0x4dc361][_0xe545('0x12')][_0xe545('0x33')]=_0xe545('0x24');this['mailAccounts'][_0x4dc361][_0xe545('0x12')][_0xe545('0x13')]=_0x41e154;return this[_0xe545('0x17')](_0x4dc361);}};EmailChannel[_0xe545('0x10')]['sendMail']=function(_0x11b341,_0xa031ec){return this[_0xe545('0xf')]['send'](_0x11b341,_0xa031ec);};EmailChannel[_0xe545('0x10')]['verifySmtp']=function(_0x3db10f){var _0x3f1422=this;if(this[_0xe545('0xd')][_0x3db10f['id']]){if(_[_0xe545('0x15')](this[_0xe545('0xd')][_0x3db10f['id']]['Smtp'])){this[_0xe545('0xd')][_0x3db10f['id']]['Smtp']={};}this[_0xe545('0xd')][_0x3db10f['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x3b6705,_0x4dbfdb){return _0x3f1422[_0xe545('0xf')][_0xe545('0x34')](_0x3db10f)['then'](function(_0x4ecf73){_0x3f1422['mailAccounts'][_0x3db10f['id']]['Smtp'][_0xe545('0x33')]=_0xe545('0x35');_0x3f1422[_0xe545('0xd')][_0x3db10f['id']][_0xe545('0x36')][_0xe545('0x13')]='';_0x3f1422['emit'](_0x3db10f['id']);_0x3b6705(_0x4ecf73);})['catch'](function(_0x32ef59){_0x3f1422[_0xe545('0xd')][_0x3db10f['id']][_0xe545('0x36')][_0xe545('0x33')]=_0xe545('0x24');_0x3f1422[_0xe545('0xd')][_0x3db10f['id']][_0xe545('0x36')][_0xe545('0x13')]=_0x32ef59;_0x3f1422[_0xe545('0x17')](_0x3db10f['id']);_0x4dbfdb(_0x32ef59);});});}return this['smtp'][_0xe545('0x34')](_0x3db10f);};module[_0xe545('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b7f549b..ef71e73 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 _0x3e24=['handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleMessageAttributes','parser','account','stringify','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','once','handleReady','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen'];(function(_0x2c6ee7,_0x10f17c){var _0x1239d7=function(_0x42f4ec){while(--_0x42f4ec){_0x2c6ee7['push'](_0x2c6ee7['shift']());}};_0x1239d7(++_0x10f17c);}(_0x3e24,0x167));var _0x43e2=function(_0x38aec6,_0x2ad06a){_0x38aec6=_0x38aec6-0x0;var _0x56a203=_0x3e24[_0x38aec6];return _0x56a203;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var Imap=require(_0x43e2('0x2'));var simpleParser=require(_0x43e2('0x3'))[_0x43e2('0x4')];var Iconv=require('iconv')[_0x43e2('0x5')];var EventEmitter=require(_0x43e2('0x6'))['EventEmitter'];var utils=require(_0x43e2('0x7'));var logger=require(_0x43e2('0x8'))(_0x43e2('0x9'));function EmailImap(_0x28b144,_0x43b5a7){this[_0x43e2('0xa')]=_0x43e2('0xb');this['account']=this[_0x43e2('0xc')](_0x28b144,_0x43b5a7);this[_0x43e2('0x2')]=new Imap(this['account']);this[_0x43e2('0x2')][_0x43e2('0xd')]('ready',this[_0x43e2('0xe')][_0x43e2('0xf')](this));this['imap'][_0x43e2('0xd')]('end',this['handleEnd']['bind'](this));this[_0x43e2('0x2')]['on'](_0x43e2('0x10'),this[_0x43e2('0x11')][_0x43e2('0xf')](this));this[_0x43e2('0x2')][_0x43e2('0x12')]();}util[_0x43e2('0x13')](EmailImap,EventEmitter);EmailImap[_0x43e2('0x14')][_0x43e2('0xc')]=function(_0x218ae7,_0x377097){var _0x3ccccd={'connTimeout':_0x218ae7['connTimeout']?_0x218ae7[_0x43e2('0x15')]*0x3e8:0x2710,'authTimeout':_0x218ae7[_0x43e2('0x16')]?_0x218ae7[_0x43e2('0x16')]*0x3e8:0x1388};if(_0x218ae7[_0x43e2('0x17')]){_0x3ccccd['user']=_0x218ae7['user'];_0x3ccccd[_0x43e2('0x9')]=_0x377097||_0x218ae7[_0x43e2('0x18')]||_0x43e2('0x19');if(_0x218ae7[_0x43e2('0x1a')]){_0x3ccccd[_0x43e2('0x1b')]=utils[_0x43e2('0x1c')](_0x218ae7[_0x43e2('0x1d')][_0x43e2('0x1e')],_0x218ae7[_0x43e2('0x18')]);}else{_0x3ccccd[_0x43e2('0x1f')]=_0x218ae7['password'];}}else{if(_0x218ae7[_0x43e2('0x20')]){_0x3ccccd[_0x43e2('0x18')]=_0x218ae7['user'];_0x3ccccd[_0x43e2('0x1f')]=_0x218ae7['password'];}}_0x3ccccd[_0x43e2('0x21')]=_0x218ae7[_0x43e2('0x21')];_0x3ccccd[_0x43e2('0x22')]=_0x218ae7[_0x43e2('0x22')]||0x3e1;if(_0x218ae7[_0x43e2('0x23')]){_0x3ccccd['tls']=!![];}else{_0x3ccccd[_0x43e2('0x23')]=![];_0x3ccccd[_0x43e2('0x24')]=_0x43e2('0x25');}return _0x3ccccd;};EmailImap['prototype'][_0x43e2('0xe')]=function(){this[_0x43e2('0x2')][_0x43e2('0x26')](this[_0x43e2('0xa')],![],this['handleOpenBox'][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x27')]=function(_0x3b7b22,_0x178223){if(_0x3b7b22){this[_0x43e2('0x11')](_0x3b7b22,!![]);}else{this[_0x43e2('0x28')](_0x43e2('0x29'),_0x178223);this[_0x43e2('0x2a')]();}};EmailImap[_0x43e2('0x14')][_0x43e2('0x2b')]=function(_0x1de7e1){if(_0x1de7e1){this['handleError'](_0x1de7e1,!![]);}else{this[_0x43e2('0x2')][_0x43e2('0x2c')]();}};EmailImap['prototype'][_0x43e2('0x2a')]=function(){this[_0x43e2('0x2')][_0x43e2('0x2d')]([_0x43e2('0x2e')],this[_0x43e2('0x2f')]['bind'](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x2f')]=function(_0x1779f9,_0x3d8e16){if(_0x1779f9){this[_0x43e2('0x11')](_0x1779f9,!![]);}else{if(_0x3d8e16[_0x43e2('0x30')]){try{var _0x53f797=this['imap'][_0x43e2('0x31')](_0x3d8e16,{'bodies':'','markSeen':!![]});_0x53f797['on'](_0x43e2('0x32'),this[_0x43e2('0x33')][_0x43e2('0xf')](this));_0x53f797[_0x43e2('0xd')]('error',this[_0x43e2('0x34')][_0x43e2('0xf')](this));_0x53f797[_0x43e2('0xd')](_0x43e2('0x2c'),this[_0x43e2('0x35')][_0x43e2('0xf')](this));}catch(_0x2fcdd4){logger['error'](_0x2fcdd4);}}else{this['imap'][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')]['bind'](this));}}};EmailImap[_0x43e2('0x14')][_0x43e2('0x33')]=function(_0x4e79ed){_0x4e79ed['on'](_0x43e2('0x37'),this['handleMessageBody']['bind'](this));_0x4e79ed['once'](_0x43e2('0x38'),this['handleMessageAttributes'][_0x43e2('0xf')](this));_0x4e79ed[_0x43e2('0xd')](_0x43e2('0x2c'),this[_0x43e2('0x39')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x3a')]=function(_0x13be86){simpleParser(_0x13be86,{'Iconv':Iconv},this[_0x43e2('0x3b')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x3c')]=function(){};EmailImap[_0x43e2('0x14')][_0x43e2('0x39')]=function(){};EmailImap[_0x43e2('0x14')][_0x43e2('0x3b')]=function(_0x16fac0,_0x47f74c){if(_0x16fac0){logger['error'](_0x16fac0);}else{var _0x4c3f7d=this;utils[_0x43e2('0x3d')](this[_0x43e2('0x3e')],_0x47f74c,function(_0x490f4d){_0x4c3f7d['emit'](_0x43e2('0x9'),_0x490f4d);});}};EmailImap[_0x43e2('0x14')][_0x43e2('0x35')]=function(){this[_0x43e2('0x2')][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')][_0x43e2('0xf')](this));};EmailImap[_0x43e2('0x14')][_0x43e2('0x34')]=function(_0x39bf87){this[_0x43e2('0x11')](_0x39bf87);this[_0x43e2('0x2')][_0x43e2('0x36')](!![],this[_0x43e2('0x2b')]['bind'](this));};EmailImap[_0x43e2('0x14')]['handleEnd']=function(){this[_0x43e2('0x28')]('end');};EmailImap[_0x43e2('0x14')][_0x43e2('0x11')]=function(_0x273323,_0x4918bc){logger[_0x43e2('0x10')]('handleError',this[_0x43e2('0x3e')][_0x43e2('0x9')],JSON[_0x43e2('0x3f')](_0x273323));var _0x169a61='';if(_0x273323){if(_0x273323['textCode']){_0x169a61=_0x273323['textCode'];}else{for(var _0x95b22f in _0x273323){if(_0x273323[_0x43e2('0x40')](_0x95b22f)){_0x169a61+=_[_0x43e2('0x41')](_0x95b22f)+':\x20'+_0x273323[_0x95b22f]+'\x0a';}}}}if(_0x4918bc){this[_0x43e2('0x2')]['end']();}else{this[_0x43e2('0x28')](_0x43e2('0x10'),_0x169a61);this[_0x43e2('0x28')](_0x43e2('0x2c'));}};module[_0x43e2('0x42')]=EmailImap; \ No newline at end of file +var _0xa6b0=['error','handleError','connect','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleFetchError','stringify','textCode','exports','lodash','util','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','ready','handleReady','bind','once','end','handleEnd'];(function(_0x14865c,_0x43f60b){var _0x527126=function(_0x4a1b1d){while(--_0x4a1b1d){_0x14865c['push'](_0x14865c['shift']());}};_0x527126(++_0x43f60b);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x598f92,_0x417d09){_0x598f92=_0x598f92-0x0;var _0x1c09b8=_0xa6b0[_0x598f92];return _0x1c09b8;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0x0a6b('0x2')];var Iconv=require(_0x0a6b('0x3'))[_0x0a6b('0x4')];var EventEmitter=require('events')[_0x0a6b('0x5')];var utils=require(_0x0a6b('0x6'));var logger=require(_0x0a6b('0x7'))(_0x0a6b('0x8'));function EmailImap(_0x3dc2b0,_0x3b6967){this[_0x0a6b('0x9')]=_0x0a6b('0xa');this[_0x0a6b('0xb')]=this[_0x0a6b('0xc')](_0x3dc2b0,_0x3b6967);this[_0x0a6b('0xd')]=new Imap(this[_0x0a6b('0xb')]);this['imap']['once'](_0x0a6b('0xe'),this[_0x0a6b('0xf')][_0x0a6b('0x10')](this));this[_0x0a6b('0xd')][_0x0a6b('0x11')](_0x0a6b('0x12'),this[_0x0a6b('0x13')][_0x0a6b('0x10')](this));this[_0x0a6b('0xd')]['on'](_0x0a6b('0x14'),this[_0x0a6b('0x15')][_0x0a6b('0x10')](this));this[_0x0a6b('0xd')][_0x0a6b('0x16')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x0a6b('0xc')]=function(_0x2f27d6,_0x2abc4e){var _0x177e87={'connTimeout':_0x2f27d6[_0x0a6b('0x17')]?_0x2f27d6[_0x0a6b('0x17')]*0x3e8:0x2710,'authTimeout':_0x2f27d6[_0x0a6b('0x18')]?_0x2f27d6[_0x0a6b('0x18')]*0x3e8:0x1388};if(_0x2f27d6[_0x0a6b('0x19')]){_0x177e87[_0x0a6b('0x1a')]=_0x2f27d6['user'];_0x177e87[_0x0a6b('0x8')]=_0x2abc4e||_0x2f27d6[_0x0a6b('0x1a')]||'anonymous@xcally.com';if(_0x2f27d6[_0x0a6b('0x1b')]){_0x177e87['xoauth2']=utils[_0x0a6b('0x1c')](_0x2f27d6[_0x0a6b('0x1d')][_0x0a6b('0x1e')],_0x2f27d6[_0x0a6b('0x1a')]);}else{_0x177e87['password']=_0x2f27d6[_0x0a6b('0x1f')];}}else{if(_0x2f27d6[_0x0a6b('0x20')]){_0x177e87['user']=_0x2f27d6[_0x0a6b('0x1a')];_0x177e87[_0x0a6b('0x1f')]=_0x2f27d6[_0x0a6b('0x1f')];}}_0x177e87['host']=_0x2f27d6[_0x0a6b('0x21')];_0x177e87[_0x0a6b('0x22')]=_0x2f27d6[_0x0a6b('0x22')]||0x3e1;if(_0x2f27d6['tls']){_0x177e87[_0x0a6b('0x23')]=!![];}else{_0x177e87[_0x0a6b('0x23')]=![];_0x177e87[_0x0a6b('0x24')]=_0x0a6b('0x25');}return _0x177e87;};EmailImap[_0x0a6b('0x26')]['handleReady']=function(){this[_0x0a6b('0xd')][_0x0a6b('0x27')](this[_0x0a6b('0x9')],![],this['handleOpenBox'][_0x0a6b('0x10')](this));};EmailImap[_0x0a6b('0x26')][_0x0a6b('0x28')]=function(_0x1b8b78,_0x3b12a2){if(_0x1b8b78){this['handleError'](_0x1b8b78,!![]);}else{this[_0x0a6b('0x29')](_0x0a6b('0x2a'),_0x3b12a2);this[_0x0a6b('0x2b')]();}};EmailImap['prototype'][_0x0a6b('0x2c')]=function(_0x51e760){if(_0x51e760){this[_0x0a6b('0x15')](_0x51e760,!![]);}else{this[_0x0a6b('0xd')][_0x0a6b('0x12')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x0a6b('0xd')][_0x0a6b('0x2d')]([_0x0a6b('0x2e')],this[_0x0a6b('0x2f')][_0x0a6b('0x10')](this));};EmailImap[_0x0a6b('0x26')]['handleReadUnseen']=function(_0xa7ab7c,_0x439d27){if(_0xa7ab7c){this['handleError'](_0xa7ab7c,!![]);}else{if(_0x439d27[_0x0a6b('0x30')]){try{var _0x554145=this['imap'][_0x0a6b('0x31')](_0x439d27,{'bodies':'','markSeen':!![]});_0x554145['on'](_0x0a6b('0x32'),this[_0x0a6b('0x33')][_0x0a6b('0x10')](this));_0x554145[_0x0a6b('0x11')]('error',this['handleFetchError'][_0x0a6b('0x10')](this));_0x554145[_0x0a6b('0x11')](_0x0a6b('0x12'),this[_0x0a6b('0x34')]['bind'](this));}catch(_0xe2b82b){logger[_0x0a6b('0x14')](_0xe2b82b);}}else{this['imap']['closeBox'](!![],this[_0x0a6b('0x2c')][_0x0a6b('0x10')](this));}}};EmailImap['prototype'][_0x0a6b('0x33')]=function(_0x395bc3){_0x395bc3['on'](_0x0a6b('0x35'),this[_0x0a6b('0x36')][_0x0a6b('0x10')](this));_0x395bc3[_0x0a6b('0x11')](_0x0a6b('0x37'),this[_0x0a6b('0x38')][_0x0a6b('0x10')](this));_0x395bc3[_0x0a6b('0x11')](_0x0a6b('0x12'),this[_0x0a6b('0x39')]['bind'](this));};EmailImap[_0x0a6b('0x26')][_0x0a6b('0x36')]=function(_0x50036b){simpleParser(_0x50036b,{'Iconv':Iconv},this[_0x0a6b('0x3a')][_0x0a6b('0x10')](this));};EmailImap[_0x0a6b('0x26')][_0x0a6b('0x38')]=function(){};EmailImap[_0x0a6b('0x26')][_0x0a6b('0x39')]=function(){};EmailImap[_0x0a6b('0x26')][_0x0a6b('0x3a')]=function(_0x4cf002,_0x5d0a6a){if(_0x4cf002){logger[_0x0a6b('0x14')](_0x4cf002);}else{var _0x251a43=this;utils[_0x0a6b('0x3b')](this[_0x0a6b('0xb')],_0x5d0a6a,function(_0x3dd4df){_0x251a43[_0x0a6b('0x29')](_0x0a6b('0x8'),_0x3dd4df);});}};EmailImap[_0x0a6b('0x26')][_0x0a6b('0x34')]=function(){this['imap'][_0x0a6b('0x3c')](!![],this[_0x0a6b('0x2c')][_0x0a6b('0x10')](this));};EmailImap[_0x0a6b('0x26')][_0x0a6b('0x3d')]=function(_0x1af182){this[_0x0a6b('0x15')](_0x1af182);this[_0x0a6b('0xd')][_0x0a6b('0x3c')](!![],this['handleCloseBox'][_0x0a6b('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x0a6b('0x29')]('end');};EmailImap['prototype'][_0x0a6b('0x15')]=function(_0x1f756d,_0x307d4c){logger['error'](_0x0a6b('0x15'),this['account']['email'],JSON[_0x0a6b('0x3e')](_0x1f756d));var _0x5b5854='';if(_0x1f756d){if(_0x1f756d[_0x0a6b('0x3f')]){_0x5b5854=_0x1f756d['textCode'];}else{for(var _0x3879cb in _0x1f756d){if(_0x1f756d['hasOwnProperty'](_0x3879cb)){_0x5b5854+=_['upperFirst'](_0x3879cb)+':\x20'+_0x1f756d[_0x3879cb]+'\x0a';}}}}if(_0x307d4c){this[_0x0a6b('0xd')][_0x0a6b('0x12')]();}else{this[_0x0a6b('0x29')](_0x0a6b('0x14'),_0x5b5854);this['emit'](_0x0a6b('0x12'));}};module[_0x0a6b('0x40')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 87eb8a4..4e7cc47 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 _0x44b0=['sendMail','toString','verify','createTransport','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','compile'];(function(_0x359842,_0xd7d82d){var _0x317362=function(_0x5cc5fb){while(--_0x5cc5fb){_0x359842['push'](_0x359842['shift']());}};_0x317362(++_0xd7d82d);}(_0x44b0,0xd8));var _0x044b=function(_0x131246,_0x38752b){_0x131246=_0x131246-0x0;var _0x332465=_0x44b0[_0x131246];return _0x332465;};'use strict';var nodemailer=require(_0x044b('0x0'));var inlineBase64=require(_0x044b('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x044b('0x2')]=function(_0x32872b,_0x2cf2e7){return new Promise(function(_0x546867,_0x311ede){var _0xcbdf71=nodemailer['createTransport'](_0x32872b);_0xcbdf71['use'](_0x044b('0x3'),inlineBase64());_0xcbdf71[_0x044b('0x4')](_0x2cf2e7,function(_0x1e91ed,_0x27f29a){if(_0x1e91ed){_0x311ede(_0x1e91ed[_0x044b('0x5')]());}else{_0x546867(_0x27f29a);}});});};EmailSmtp['prototype'][_0x044b('0x6')]=function(_0x590f2b){return new Promise(function(_0x3329b6,_0x139a98){var _0x331819=nodemailer[_0x044b('0x7')](_0x590f2b);_0x331819[_0x044b('0x6')](function(_0x141d27,_0x53cdda){if(_0x141d27){_0x139a98(_0x141d27[_0x044b('0x5')]());}else{if(_0x53cdda){_0x3329b6(_0x53cdda);}else{_0x139a98(_0x044b('0x8'));}}});});};module[_0x044b('0x9')]=EmailSmtp; \ No newline at end of file +var _0x31fe=['compile','toString','verify','Not\x20verifired','nodemailer','prototype','send','createTransport'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x31fe,0x64));var _0xe31f=function(_0x1a511a,_0xdf348f){_0x1a511a=_0x1a511a-0x0;var _0xba4cd0=_0x31fe[_0x1a511a];return _0xba4cd0;};'use strict';var nodemailer=require(_0xe31f('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xe31f('0x1')][_0xe31f('0x2')]=function(_0x2b7318,_0xf84427){return new Promise(function(_0xab2422,_0x19a5b7){var _0x2a0735=nodemailer[_0xe31f('0x3')](_0x2b7318);_0x2a0735['use'](_0xe31f('0x4'),inlineBase64());_0x2a0735['sendMail'](_0xf84427,function(_0x521a8a,_0x36395b){if(_0x521a8a){_0x19a5b7(_0x521a8a[_0xe31f('0x5')]());}else{_0xab2422(_0x36395b);}});});};EmailSmtp[_0xe31f('0x1')][_0xe31f('0x6')]=function(_0x20bca7){return new Promise(function(_0x2acd6f,_0x495e0b){var _0x57c2dc=nodemailer['createTransport'](_0x20bca7);_0x57c2dc[_0xe31f('0x6')](function(_0x4a039a,_0x923cab){if(_0x4a039a){_0x495e0b(_0x4a039a[_0xe31f('0x5')]());}else{if(_0x923cab){_0x2acd6f(_0x923cab);}else{_0x495e0b(_0xe31f('0x7'));}}});});};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 2f12a42..45db5f4 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 _0xe2d9=['../../../config/environment','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','head','isEmpty','anonymous','html','replace','includes','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','utf-8','toString','base64','lodash','randomstring','path','util','email'];(function(_0x4bebef,_0x1a55f7){var _0x4d74e5=function(_0x5691a9){while(--_0x5691a9){_0x4bebef['push'](_0x4bebef['shift']());}};_0x4d74e5(++_0x1a55f7);}(_0xe2d9,0x193));var _0x9e2d=function(_0xb2e457,_0x305895){_0xb2e457=_0xb2e457-0x0;var _0x375570=_0xe2d9[_0xb2e457];return _0x375570;};'use strict';var _=require(_0x9e2d('0x0'));var moment=require('moment');var random=require(_0x9e2d('0x1'));var fs=require('fs');var path=require(_0x9e2d('0x2'));var util=require(_0x9e2d('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x9e2d('0x4'));var config=require(_0x9e2d('0x5'));function getAddress(_0x3d9f2d){var _0x4caa88=_['head'](_0x3d9f2d[_0x9e2d('0x6')]);return _0x4caa88&&_0x4caa88[_0x9e2d('0x7')]?_0x4caa88['address']:'anonymous'+random[_0x9e2d('0x8')](0x6)+_0x9e2d('0x9');}function getFirstName(_0x1d634d){var _0x43d15d=_['head'](_0x1d634d[_0x9e2d('0x6')]);if(_0x43d15d&&_0x43d15d[_0x9e2d('0xa')]){if(_0x43d15d[_0x9e2d('0xa')]==_0x43d15d[_0x9e2d('0x7')]){return _0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xb')](0x0,_0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xc')]('@'));}var _0xca12de=_0x43d15d[_0x9e2d('0xa')][_0x9e2d('0xd')](/\s+/);return _0xca12de[_0x9e2d('0xe')]>0x1?_0xca12de[_0x9e2d('0xf')](0x0,-0x1)['join']('\x20'):_0x43d15d[_0x9e2d('0xa')];}return _0x9e2d('0x10');}function getLastName(_0x3ca201){var _0x229efe=_[_0x9e2d('0x11')](_0x3ca201[_0x9e2d('0x6')]);if(_0x229efe&&_0x229efe['name']){var _0x544a91=_0x229efe[_0x9e2d('0xa')]['split'](/\s+/);return _0x544a91['length']>0x1?_0x544a91['pop']():'';}return'';}function getMails(_0x2513aa,_0x3d7823){var _0xcd69c4='';for(var _0x597ebb=0x0;_0x597ebb<_0x3d7823['value'][_0x9e2d('0xe')];_0x597ebb+=0x1){if(_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]!==_0x2513aa){if(!_[_0x9e2d('0x12')](_0xcd69c4)){_0xcd69c4+=',';}_0xcd69c4+=_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0xa')]||_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]||'';_0xcd69c4+='\x20<';_0xcd69c4+=_0x3d7823[_0x9e2d('0x6')][_0x597ebb][_0x9e2d('0x7')]?_0x3d7823[_0x9e2d('0x6')][_0x597ebb]['address']:_0x9e2d('0x13')+random[_0x9e2d('0x8')](0x6)+'@xcally.com';_0xcd69c4+='>';}}return _0xcd69c4;}function parseEmail(_0x42d451,_0x51ea51,_0xdbceca){if(_0x51ea51['html']){var _0x147dde=/)<[^<]*)*<\/script>/gi;while(_0x147dde['test'](_0x51ea51[_0x9e2d('0x14')])){_0x51ea51[_0x9e2d('0x14')]=_0x51ea51['html'][_0x9e2d('0x15')](_0x147dde,'');}if(_0x51ea51[_0x9e2d('0x14')][_0x9e2d('0x16')]('{_0x334b34[_0x9e2d('0x18')](_0x5468bd[_0x9e2d('0x19')]);});var _0x294891=/]+>/g;var _0x4b99ee=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5330db=_0x51ea51[_0x9e2d('0x14')][_0x9e2d('0x15')](_0x4b99ee,_0x9e2d('0x1a'));var _0x3454e8=_0x5330db[_0x9e2d('0x15')](_0x294891,_0x9e2d('0x1b'));for(let _0x3eef11=0x0;_0x3eef11<_0x334b34['length'];_0x3eef11++){var _0x15870c=_0x3454e8['replace'](_0x9e2d('0x1b'),_0x9e2d('0x1c')+_0x334b34[_0x3eef11]+_0x9e2d('0x1d'));_0x3454e8=_0x15870c;}_0x51ea51[_0x9e2d('0x14')]=_0x3454e8;}_0xdbceca[_0x9e2d('0x1e')]=_0x51ea51[_0x9e2d('0x14')];}else{_0xdbceca['body']=_0x51ea51[_0x9e2d('0x1f')];}if(_0xdbceca[_0x9e2d('0x1e')]){_0xdbceca[_0x9e2d('0x1e')]=_0xdbceca['body']['replace'](/0x0){var _0x19b17f=['Auto-Submitted:\x20auto-replied',_0x9e2d('0x30'),_0x9e2d('0x31')];for(var _0x557c2c=0x0;_0x557c2c<_0x51ea51['headerLines'][_0x9e2d('0xe')];_0x557c2c++){var _0x231a33=_[_0x9e2d('0xc')](_0x19b17f,_0x51ea51[_0x9e2d('0x2f')][_0x557c2c][_0x9e2d('0x32')]);if(_0x231a33>=0x0){_0xdbceca[_0x9e2d('0x33')]=!![];}}}return _0xdbceca;}exports['parser']=function(_0x42aac9,_0x181816,_0x251649){var _0x5d17fc={'from':getAddress(_0x181816['from']),'firstName':getFirstName(_0x181816[_0x9e2d('0x34')]),'lastName':getLastName(_0x181816[_0x9e2d('0x34')]),'mapKey':_0x9e2d('0x4'),'message':{'from':getMails(_0x42aac9['email'],_0x181816['from']),'to':_0x42aac9[_0x9e2d('0x4')],'cc':'','subject':_0x181816[_0x9e2d('0x35')]||'','messageId':_0x181816[_0x9e2d('0x36')],'inReplyTo':_0x181816['inReplyTo'],'sentAt':moment(_0x181816[_0x9e2d('0x37')])[_0x9e2d('0x28')](_0x9e2d('0x38')),'attach':![],'attachments':[]}};if(!_0x181816['html']&&!_0x181816[_0x9e2d('0x1f')]){var _0x3dbb9b=_[_0x9e2d('0x39')](_0x181816[_0x9e2d('0x25')],{'contentType':'application/ms-tnef'});if(_0x3dbb9b[_0x9e2d('0xe')]){logger[_0x9e2d('0x3a')](util[_0x9e2d('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x181816[_0x9e2d('0x36')]));tnef[_0x9e2d('0x3b')](_[_0x9e2d('0x3c')](_0x3dbb9b)['content'],function(_0x107177,_0x4197ee){if(_0x4197ee){_0x181816[_0x9e2d('0x14')]=_0x4197ee['BodyHTML']||_0x9e2d('0x3d');if(_0x4197ee[_0x9e2d('0x3e')]){for(var _0x47cc9e=0x0;_0x47cc9e<_0x4197ee['Attachments'][_0x9e2d('0xe')];_0x47cc9e++){var _0x2378ba=_0x4197ee[_0x9e2d('0x3e')][_0x47cc9e];_0x5d17fc['message']['attachments'][_0x9e2d('0x18')]({'filename':_0x2378ba[_0x9e2d('0x3f')],'content':Buffer[_0x9e2d('0x34')](_0x2378ba[_0x9e2d('0x40')])});}}}_0x251649(parseEmail(_0x42aac9,_0x181816,_0x5d17fc));});}else{_0x181816[_0x9e2d('0x14')]=_0x9e2d('0x3d');_0x251649(parseEmail(_0x42aac9,_0x181816,_0x5d17fc));}}else{_0x251649(parseEmail(_0x42aac9,_0x181816,_0x5d17fc));}};exports['generateXOAuth2Token']=function(_0x431495,_0x5b46cb){var _0x571450=['user='+(_0x5b46cb||''),'auth=Bearer\x20'+_0x431495,'',''];return Buffer['from'](_0x571450[_0x9e2d('0x2b')](''),_0x9e2d('0x41'))[_0x9e2d('0x42')](_0x9e2d('0x43'));}; \ No newline at end of file +var _0xb5ef=['../../../config/logger','email','../../../config/environment','head','value','generate','@xcally.com','name','address','substring','length','slice','pop','html','test','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','generateXOAuth2Token','auth=Bearer\x20','utf-8','lodash','moment','randomstring','node-tnef'];(function(_0x33f05a,_0x432d94){var _0x559d6e=function(_0x35186d){while(--_0x35186d){_0x33f05a['push'](_0x33f05a['shift']());}};_0x559d6e(++_0x432d94);}(_0xb5ef,0xd1));var _0xfb5e=function(_0x22fdba,_0x160b2d){_0x22fdba=_0x22fdba-0x0;var _0x356665=_0xb5ef[_0x22fdba];return _0x356665;};'use strict';var _=require(_0xfb5e('0x0'));var moment=require(_0xfb5e('0x1'));var random=require(_0xfb5e('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0xfb5e('0x3'));var logger=require(_0xfb5e('0x4'))(_0xfb5e('0x5'));var config=require(_0xfb5e('0x6'));function getAddress(_0x5cfacf){var _0x393fdf=_[_0xfb5e('0x7')](_0x5cfacf[_0xfb5e('0x8')]);return _0x393fdf&&_0x393fdf['address']?_0x393fdf['address']:'anonymous'+random[_0xfb5e('0x9')](0x6)+_0xfb5e('0xa');}function getFirstName(_0xcff05c){var _0x209138=_[_0xfb5e('0x7')](_0xcff05c[_0xfb5e('0x8')]);if(_0x209138&&_0x209138[_0xfb5e('0xb')]){if(_0x209138[_0xfb5e('0xb')]==_0x209138[_0xfb5e('0xc')]){return _0x209138[_0xfb5e('0xb')][_0xfb5e('0xd')](0x0,_0x209138[_0xfb5e('0xb')]['indexOf']('@'));}var _0x569004=_0x209138[_0xfb5e('0xb')]['split'](/\s+/);return _0x569004[_0xfb5e('0xe')]>0x1?_0x569004[_0xfb5e('0xf')](0x0,-0x1)['join']('\x20'):_0x209138['name'];}return'Anonymous';}function getLastName(_0x2dc4e4){var _0x5df673=_['head'](_0x2dc4e4[_0xfb5e('0x8')]);if(_0x5df673&&_0x5df673[_0xfb5e('0xb')]){var _0x5c6951=_0x5df673[_0xfb5e('0xb')]['split'](/\s+/);return _0x5c6951[_0xfb5e('0xe')]>0x1?_0x5c6951[_0xfb5e('0x10')]():'';}return'';}function getMails(_0x1c667a,_0x4fed1d){var _0x34edb2='';for(var _0x2a5fd7=0x0;_0x2a5fd7<_0x4fed1d['value'][_0xfb5e('0xe')];_0x2a5fd7+=0x1){if(_0x4fed1d[_0xfb5e('0x8')][_0x2a5fd7][_0xfb5e('0xc')]!==_0x1c667a){if(!_['isEmpty'](_0x34edb2)){_0x34edb2+=',';}_0x34edb2+=_0x4fed1d['value'][_0x2a5fd7][_0xfb5e('0xb')]||_0x4fed1d[_0xfb5e('0x8')][_0x2a5fd7]['address']||'';_0x34edb2+='\x20<';_0x34edb2+=_0x4fed1d[_0xfb5e('0x8')][_0x2a5fd7][_0xfb5e('0xc')]?_0x4fed1d[_0xfb5e('0x8')][_0x2a5fd7][_0xfb5e('0xc')]:'anonymous'+random[_0xfb5e('0x9')](0x6)+_0xfb5e('0xa');_0x34edb2+='>';}}return _0x34edb2;}function parseEmail(_0x35abae,_0x175268,_0x517ee6){if(_0x175268[_0xfb5e('0x11')]){var _0x4c2d7f=/)<[^<]*)*<\/script>/gi;while(_0x4c2d7f[_0xfb5e('0x12')](_0x175268[_0xfb5e('0x11')])){_0x175268[_0xfb5e('0x11')]=_0x175268['html'][_0xfb5e('0x13')](_0x4c2d7f,'');}if(_0x175268[_0xfb5e('0x11')][_0xfb5e('0x14')]('{_0x5e3d4a[_0xfb5e('0x17')](_0x87f473[_0xfb5e('0x18')]);});var _0x1a730d=/]+>/g;var _0x737759=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x27b343=_0x175268[_0xfb5e('0x11')]['replace'](_0x737759,_0xfb5e('0x19'));var _0x208132=_0x27b343['replace'](_0x1a730d,_0xfb5e('0x1a'));for(let _0x49381f=0x0;_0x49381f<_0x5e3d4a['length'];_0x49381f++){var _0xb99120=_0x208132[_0xfb5e('0x13')](_0xfb5e('0x1a'),_0xfb5e('0x1b')+_0x5e3d4a[_0x49381f]+_0xfb5e('0x1c'));_0x208132=_0xb99120;}_0x175268[_0xfb5e('0x11')]=_0x208132;}_0x517ee6[_0xfb5e('0x1d')]=_0x175268['html'];}else{_0x517ee6[_0xfb5e('0x1d')]=_0x175268[_0xfb5e('0x1e')];}if(_0x517ee6[_0xfb5e('0x1d')]){_0x517ee6[_0xfb5e('0x1d')]=_0x517ee6[_0xfb5e('0x1d')][_0xfb5e('0x13')](/0x0){var _0x319803=[_0xfb5e('0x2f'),_0xfb5e('0x30'),_0xfb5e('0x31')];for(var _0x337405=0x0;_0x337405<_0x175268[_0xfb5e('0x2e')][_0xfb5e('0xe')];_0x337405++){var _0xe3f880=_['indexOf'](_0x319803,_0x175268['headerLines'][_0x337405][_0xfb5e('0x32')]);if(_0xe3f880>=0x0){_0x517ee6[_0xfb5e('0x33')]=!![];}}}return _0x517ee6;}exports[_0xfb5e('0x34')]=function(_0x5ee4b6,_0x242e8b,_0x1b1866){var _0xcac6ed={'from':getAddress(_0x242e8b['from']),'firstName':getFirstName(_0x242e8b[_0xfb5e('0x35')]),'lastName':getLastName(_0x242e8b[_0xfb5e('0x35')]),'mapKey':_0xfb5e('0x5'),'message':{'from':getMails(_0x5ee4b6[_0xfb5e('0x5')],_0x242e8b[_0xfb5e('0x35')]),'to':_0x5ee4b6[_0xfb5e('0x5')],'cc':'','subject':_0x242e8b[_0xfb5e('0x36')]||'','messageId':_0x242e8b['messageId'],'inReplyTo':_0x242e8b['inReplyTo'],'sentAt':moment(_0x242e8b['date'])[_0xfb5e('0x37')](_0xfb5e('0x38')),'attach':![],'attachments':[]}};if(!_0x242e8b[_0xfb5e('0x11')]&&!_0x242e8b[_0xfb5e('0x1e')]){var _0x4fbeba=_[_0xfb5e('0x39')](_0x242e8b[_0xfb5e('0x15')],{'contentType':_0xfb5e('0x3a')});if(_0x4fbeba[_0xfb5e('0xe')]){logger[_0xfb5e('0x3b')](util[_0xfb5e('0x37')](_0xfb5e('0x3c'),_0x242e8b[_0xfb5e('0x3d')]));tnef[_0xfb5e('0x3e')](_[_0xfb5e('0x3f')](_0x4fbeba)[_0xfb5e('0x2c')],function(_0x9912c9,_0x25a1f9){if(_0x25a1f9){_0x242e8b[_0xfb5e('0x11')]=_0x25a1f9[_0xfb5e('0x40')]||_0xfb5e('0x41');if(_0x25a1f9[_0xfb5e('0x42')]){for(var _0x39b4a4=0x0;_0x39b4a4<_0x25a1f9['Attachments']['length'];_0x39b4a4++){var _0x58b714=_0x25a1f9[_0xfb5e('0x42')][_0x39b4a4];_0xcac6ed[_0xfb5e('0x22')][_0xfb5e('0x15')][_0xfb5e('0x17')]({'filename':_0x58b714[_0xfb5e('0x43')],'content':Buffer[_0xfb5e('0x35')](_0x58b714['Data'])});}}}_0x1b1866(parseEmail(_0x5ee4b6,_0x242e8b,_0xcac6ed));});}else{_0x242e8b[_0xfb5e('0x11')]=_0xfb5e('0x41');_0x1b1866(parseEmail(_0x5ee4b6,_0x242e8b,_0xcac6ed));}}else{_0x1b1866(parseEmail(_0x5ee4b6,_0x242e8b,_0xcac6ed));}};exports[_0xfb5e('0x44')]=function(_0x171230,_0x2d2f4a){var _0x272ded=['user='+(_0x2d2f4a||''),_0xfb5e('0x45')+_0x171230,'',''];return Buffer['from'](_0x272ded['join'](''),_0xfb5e('0x46'))['toString']('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index a762147..ce31ca9 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 _0xc9ab=['SERV','Smtp','exports','lodash','name','Service','key'];(function(_0x2a21f1,_0x5b6d1a){var _0x19b89a=function(_0x3c7a42){while(--_0x3c7a42){_0x2a21f1['push'](_0x2a21f1['shift']());}};_0x19b89a(++_0x5b6d1a);}(_0xc9ab,0x7a));var _0xbc9a=function(_0x41f84f,_0x52fc4f){_0x41f84f=_0x41f84f-0x0;var _0x415877=_0xc9ab[_0x41f84f];return _0x415877;};'use strict';var _=require(_0xbc9a('0x0'));function MailAccount(_0x38a0c7){this['id']=_0x38a0c7['id']||0x0;this[_0xbc9a('0x1')]=_0x38a0c7[_0xbc9a('0x1')]||_0xbc9a('0x2');this[_0xbc9a('0x3')]=_0x38a0c7['key']||_0xbc9a('0x4');this['active']=_0x38a0c7['active']||![];this['Imap']=_0x38a0c7['Imap']||[];this[_0xbc9a('0x5')]=_0x38a0c7[_0xbc9a('0x5')]||[];}module[_0xbc9a('0x6')]=MailAccount; \ No newline at end of file +var _0xe553=['key','Imap','Smtp','exports','lodash','name','Service'];(function(_0x1f1865,_0x3fd97d){var _0x4487b6=function(_0x169d6c){while(--_0x169d6c){_0x1f1865['push'](_0x1f1865['shift']());}};_0x4487b6(++_0x3fd97d);}(_0xe553,0x12a));var _0x3e55=function(_0x54abae,_0x154d8f){_0x54abae=_0x54abae-0x0;var _0x297e50=_0xe553[_0x54abae];return _0x297e50;};'use strict';var _=require(_0x3e55('0x0'));function MailAccount(_0x3a501b){this['id']=_0x3a501b['id']||0x0;this[_0x3e55('0x1')]=_0x3a501b['name']||_0x3e55('0x2');this[_0x3e55('0x3')]=_0x3a501b[_0x3e55('0x3')]||'SERV';this['active']=_0x3a501b['active']||![];this[_0x3e55('0x4')]=_0x3a501b[_0x3e55('0x4')]||[];this[_0x3e55('0x5')]=_0x3a501b[_0x3e55('0x5')]||[];}module[_0x3e55('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 65d23ac..e155f8e 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 _0xd539=['hasOwnProperty','prototype','mergeFromDatabase','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xd539,0xcd));var _0x9d53=function(_0x4b0091,_0x3321dd){_0x4b0091=_0x4b0091-0x0;var _0x581ae6=_0xd539[_0x4b0091];return _0x581ae6;};'use strict';var _=require(_0x9d53('0x0'));var MailAccount=require(_0x9d53('0x1'));var Realtime=function(){this[_0x9d53('0x2')]={};};function freeIsNotKey(_0xc59e44,_0x43bd4c,_0x16685c){var _0x243a8c=_['mapKeys'](_0xc59e44,function(_0x11060d,_0x4c7b08){return _0x11060d[_0x16685c];});for(var _0x204942 in _0x43bd4c){if(_0x43bd4c[_0x9d53('0x3')](_0x204942)){if(!_0x243a8c[_0x204942]){delete _0x43bd4c[_0x204942];}}}}Realtime[_0x9d53('0x4')][_0x9d53('0x5')]=function(_0x1cc2f3,_0x30a8f7){for(var _0x32e53a in _0x30a8f7){if(_0x1cc2f3['hasOwnProperty'](_0x32e53a)){_0x1cc2f3[_0x32e53a]=_0x30a8f7[_0x32e53a];}}};Realtime[_0x9d53('0x4')]['initMailAccounts']=function(){var _0x1b4488=this;return function(_0x584a20){if(_0x584a20){freeIsNotKey(_0x584a20,_0x1b4488[_0x9d53('0x2')],'id');for(var _0x3b3ab9=0x0,_0x568828={},_0x33c670={};_0x3b3ab9<_0x584a20['length'];_0x3b3ab9+=0x1){_0x568828=_0x584a20[_0x3b3ab9];if(_['isUndefined'](_0x1b4488['mailAccounts'][_0x568828['id']])){_0x1b4488[_0x9d53('0x2')][_0x568828['id']]=new MailAccount(_0x568828);}else{_[_0x9d53('0x6')](_0x1b4488[_0x9d53('0x2')][_0x568828['id']],_0x568828);}}}return _0x1b4488[_0x9d53('0x2')];};};module[_0x9d53('0x7')]=Realtime; \ No newline at end of file +var _0x292f=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined','merge','lodash','mailAccounts','mapKeys'];(function(_0x51b10b,_0x311567){var _0x45b2cf=function(_0xa17759){while(--_0xa17759){_0x51b10b['push'](_0x51b10b['shift']());}};_0x45b2cf(++_0x311567);}(_0x292f,0x1bf));var _0xf292=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x292f[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xf292('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xf292('0x1')]={};};function freeIsNotKey(_0x175e6c,_0x52ffa9,_0x43d552){var _0x23324d=_[_0xf292('0x2')](_0x175e6c,function(_0x2db778,_0x4ded3a){return _0x2db778[_0x43d552];});for(var _0x588661 in _0x52ffa9){if(_0x52ffa9[_0xf292('0x3')](_0x588661)){if(!_0x23324d[_0x588661]){delete _0x52ffa9[_0x588661];}}}}Realtime[_0xf292('0x4')][_0xf292('0x5')]=function(_0x438bbc,_0xc67277){for(var _0x423cf2 in _0xc67277){if(_0x438bbc['hasOwnProperty'](_0x423cf2)){_0x438bbc[_0x423cf2]=_0xc67277[_0x423cf2];}}};Realtime[_0xf292('0x4')][_0xf292('0x6')]=function(){var _0xee5f9=this;return function(_0x2c57c5){if(_0x2c57c5){freeIsNotKey(_0x2c57c5,_0xee5f9[_0xf292('0x1')],'id');for(var _0x1ab30c=0x0,_0x5b94b3={},_0x13e69a={};_0x1ab30c<_0x2c57c5['length'];_0x1ab30c+=0x1){_0x5b94b3=_0x2c57c5[_0x1ab30c];if(_[_0xf292('0x7')](_0xee5f9['mailAccounts'][_0x5b94b3['id']])){_0xee5f9[_0xf292('0x1')][_0x5b94b3['id']]=new MailAccount(_0x5b94b3);}else{_[_0xf292('0x8')](_0xee5f9[_0xf292('0x1')][_0x5b94b3['id']],_0x5b94b3);}}}return _0xee5f9[_0xf292('0x1')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 425f4d1..b772c5e 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 _0x35f5=['NotifyMailAccount','../client','Request','GetMailAccount','name','provider','key','ListId','MailServerIn','CloudProvider','type','MailServerOut','Smtp','service','data5','getMailAccount','notify'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x35f5,0x100));var _0x535f=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0x35f5[_0x403fc7];return _0x5d0827;};'use strict';var client=require(_0x535f('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x535f('0x1')](_0x535f('0x2'),{'options':{'attributes':['id',_0x535f('0x3'),_0x535f('0x4'),'service','email','active',_0x535f('0x5'),_0x535f('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x535f('0x7'),'as':'Imap','include':[{'model':_0x535f('0x8'),'attributes':['id',_0x535f('0x3'),'service',_0x535f('0x9'),'data5'],'as':_0x535f('0x8')}]},{'model':_0x535f('0xa'),'as':_0x535f('0xb'),'include':[{'model':_0x535f('0x8'),'attributes':['id',_0x535f('0x3'),_0x535f('0xc'),_0x535f('0x9'),_0x535f('0xd')],'as':'CloudProvider'}]}]},'log':_0x535f('0xe')});};};exports[_0x535f('0xf')]=function(_0x1e1c58,_0x336e28){return client[_0x535f('0x1')](_0x535f('0x10'),{'account':{'id':_0x1e1c58},'body':_0x336e28,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x02ca=['TemplateId','MailServerIn','Imap','CloudProvider','service','type','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','provider','email','active','key','ListId'];(function(_0x3cb8db,_0x55129b){var _0x26b555=function(_0x5d1eea){while(--_0x5d1eea){_0x3cb8db['push'](_0x3cb8db['shift']());}};_0x26b555(++_0x55129b);}(_0x02ca,0x97));var _0xa02c=function(_0x16268e,_0x49d117){_0x16268e=_0x16268e-0x0;var _0x1df8f6=_0x02ca[_0x16268e];return _0x1df8f6;};'use strict';var client=require(_0xa02c('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xa02c('0x1')](_0xa02c('0x2'),{'options':{'attributes':['id',_0xa02c('0x3'),_0xa02c('0x4'),'service',_0xa02c('0x5'),_0xa02c('0x6'),_0xa02c('0x7'),_0xa02c('0x8'),_0xa02c('0x9')],'raw':![],'include':[{'model':_0xa02c('0xa'),'as':_0xa02c('0xb'),'include':[{'model':_0xa02c('0xc'),'attributes':['id',_0xa02c('0x3'),_0xa02c('0xd'),_0xa02c('0xe'),'data5'],'as':_0xa02c('0xc')}]},{'model':_0xa02c('0xf'),'as':_0xa02c('0x10'),'include':[{'model':_0xa02c('0xc'),'attributes':['id',_0xa02c('0x3'),'service','type','data5'],'as':'CloudProvider'}]}]},'log':_0xa02c('0x11')});};};exports[_0xa02c('0x12')]=function(_0x363d4c,_0x3509a4){return client['Request'](_0xa02c('0x13'),{'account':{'id':_0x363d4c},'body':_0x3509a4,'log':_0xa02c('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 17dc0eb..b69a16c 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 _0xe4c3=['ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x397ff2,_0x3453b2){var _0x3752e2=function(_0x48a4c5){while(--_0x48a4c5){_0x397ff2['push'](_0x397ff2['shift']());}};_0x3752e2(++_0x3453b2);}(_0xe4c3,0x18b));var _0x3e4c=function(_0x1efe71,_0x539317){_0x1efe71=_0x1efe71-0x0;var _0x315970=_0xe4c3[_0x1efe71];return _0x315970;};'use strict';var client=require('../client');exports[_0x3e4c('0x0')]=function(){return client['Request'](_0x3e4c('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3e4c('0x2')]},'log':_0x3e4c('0x3')});}; \ No newline at end of file +var _0xc5bd=['../client','getSettings','Request','loginMailFrequency','GetSettings'];(function(_0x5dcda5,_0x5b93bb){var _0x4538fb=function(_0x53cf29){while(--_0x53cf29){_0x5dcda5['push'](_0x5dcda5['shift']());}};_0x4538fb(++_0x5b93bb);}(_0xc5bd,0x19f));var _0xdc5b=function(_0x5cd60a,_0x860a28){_0x5cd60a=_0x5cd60a-0x0;var _0x8981ee=_0xc5bd[_0x5cd60a];return _0x8981ee;};'use strict';var client=require(_0xdc5b('0x0'));exports[_0xdc5b('0x1')]=function(){return client[_0xdc5b('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xdc5b('0x3')]},'log':_0xdc5b('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 883e55a..5e07997 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 ba4d6dd..0fdc042 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 _0x1a1b=['defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','../../config/environment','createServer','listen','port','socket.io','polling','redis'];(function(_0xf64792,_0x32ce6c){var _0x4fb7d7=function(_0x4ea996){while(--_0x4ea996){_0xf64792['push'](_0xf64792['shift']());}};_0x4fb7d7(++_0x32ce6c);}(_0x1a1b,0x1aa));var _0xb1a1=function(_0x2c26e8,_0x392265){_0x2c26e8=_0x2c26e8-0x0;var _0x25d356=_0x1a1b[_0x2c26e8];return _0x25d356;};'use strict';var _=require(_0xb1a1('0x0'));var http=require(_0xb1a1('0x1'));var express=require(_0xb1a1('0x2'));var sticky=require('sticky-session');var Redis=require(_0xb1a1('0x3'));var config=require(_0xb1a1('0x4'));var app=express();var server=http[_0xb1a1('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0xb1a1('0x6')](server,config[_0xb1a1('0x7')])){var socketio=require(_0xb1a1('0x8'))(server,{'transports':['websocket',_0xb1a1('0x9')]});config[_0xb1a1('0xa')]=_[_0xb1a1('0xb')](config[_0xb1a1('0xa')],{'host':_0xb1a1('0xc'),'port':0x18eb});socketio[_0xb1a1('0xd')](require(_0xb1a1('0xe'))({'pubClient':new Redis(config[_0xb1a1('0xa')]),'subClient':new Redis(config[_0xb1a1('0xa')])}));require(_0xb1a1('0xf'))[_0xb1a1('0x10')]();require(_0xb1a1('0x11'))[_0xb1a1('0x10')](socketio);require(_0xb1a1('0x12'))[_0xb1a1('0x10')](app);require(_0xb1a1('0x13'))[_0xb1a1('0x10')](app);}else{server['once']('listening',function(){console[_0xb1a1('0x14')](_0xb1a1('0x15'),config['port']);});}exports=module[_0xb1a1('0x16')]=app; \ No newline at end of file +var _0x5b6f=['Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','express','sticky-session','ioredis','createServer','timeout','listen','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','once','log'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0x5b6f,0x144));var _0xf5b6=function(_0x52bd65,_0x160646){_0x52bd65=_0x52bd65-0x0;var _0x13fd57=_0x5b6f[_0x52bd65];return _0x13fd57;};'use strict';var _=require(_0xf5b6('0x0'));var http=require('http');var express=require(_0xf5b6('0x1'));var sticky=require(_0xf5b6('0x2'));var Redis=require(_0xf5b6('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xf5b6('0x4')](app);server[_0xf5b6('0x5')]=0xdbba0;if(sticky[_0xf5b6('0x6')](server,config['port'])){var socketio=require(_0xf5b6('0x7'))(server,{'transports':[_0xf5b6('0x8'),_0xf5b6('0x9')]});config[_0xf5b6('0xa')]=_[_0xf5b6('0xb')](config['redis'],{'host':_0xf5b6('0xc'),'port':0x18eb});socketio[_0xf5b6('0xd')](require(_0xf5b6('0xe'))({'pubClient':new Redis(config[_0xf5b6('0xa')]),'subClient':new Redis(config['redis'])}));require(_0xf5b6('0xf'))[_0xf5b6('0x10')]();require('../../config/socketio')['default'](socketio);require(_0xf5b6('0x11'))['default'](app);require(_0xf5b6('0x12'))[_0xf5b6('0x10')](app);}else{server[_0xf5b6('0x13')]('listening',function(){console[_0xf5b6('0x14')](_0xf5b6('0x15'),config[_0xf5b6('0x16')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index b9bc197..96f3431 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 _0x40ad=['Request','request','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client'];(function(_0x48d0be,_0x40cdb6){var _0x48901a=function(_0x562c42){while(--_0x562c42){_0x48d0be['push'](_0x48d0be['shift']());}};_0x48901a(++_0x40cdb6);}(_0x40ad,0x8b));var _0xd40a=function(_0x141380,_0x39a064){_0x141380=_0x141380-0x0;var _0x184ed8=_0x40ad[_0x141380];return _0x184ed8;};'use strict';var jayson=require(_0xd40a('0x0'));var BPromise=require(_0xd40a('0x1'));var logger=require('../../config/logger')(_0xd40a('0x2'));var client=jayson[_0xd40a('0x3')]['http']({'port':0x2329});client[_0xd40a('0x4')]=function(_0x691621,_0x4be846){return new BPromise(function(_0x56a158,_0x488f23){return client[_0xd40a('0x5')](_0x691621,_0x4be846)['then'](function(_0x5415fc){logger[_0xd40a('0x6')](_0xd40a('0x7'),_0xd40a('0x2'),_0x691621,_0x4be846,_0x5415fc);if(_0x5415fc['error']){logger['error'](_0xd40a('0x7'),'routing',_0x691621,_0x5415fc[_0xd40a('0x8')]['message'],_0x4be846);return _0x488f23(_0x5415fc[_0xd40a('0x8')][_0xd40a('0x9')]);}else{return _0x56a158(_0x5415fc[_0xd40a('0xa')]);}})[_0xd40a('0xb')](function(_0x31e614){logger[_0xd40a('0x8')](_0xd40a('0x7'),'routing',_0x691621,_0x31e614,_0x4be846);return _0x488f23(_0x31e614);});});};module[_0xd40a('0xc')]=client; \ No newline at end of file +var _0x4402=['message','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error'];(function(_0x511dd6,_0x5d294d){var _0x39f16b=function(_0x150692){while(--_0x150692){_0x511dd6['push'](_0x511dd6['shift']());}};_0x39f16b(++_0x5d294d);}(_0x4402,0x10c));var _0x2440=function(_0x3f889c,_0x1c16af){_0x3f889c=_0x3f889c-0x0;var _0x5edf2a=_0x4402[_0x3f889c];return _0x5edf2a;};'use strict';var jayson=require(_0x2440('0x0'));var BPromise=require(_0x2440('0x1'));var logger=require(_0x2440('0x2'))(_0x2440('0x3'));var client=jayson[_0x2440('0x4')][_0x2440('0x5')]({'port':0x2329});client[_0x2440('0x6')]=function(_0x1fbc4e,_0x353b46){return new BPromise(function(_0xdf5f31,_0x3bf391){return client[_0x2440('0x7')](_0x1fbc4e,_0x353b46)[_0x2440('0x8')](function(_0x26b25f){logger[_0x2440('0x9')](_0x2440('0xa'),_0x2440('0x3'),_0x1fbc4e,_0x353b46,_0x26b25f);if(_0x26b25f[_0x2440('0xb')]){logger[_0x2440('0xb')]('rpc',_0x2440('0x3'),_0x1fbc4e,_0x26b25f['error']['message'],_0x353b46);return _0x3bf391(_0x26b25f[_0x2440('0xb')][_0x2440('0xc')]);}else{return _0xdf5f31(_0x26b25f['result']);}})[_0x2440('0xd')](function(_0x4ad71b){logger[_0x2440('0xb')](_0x2440('0xa'),'routing',_0x1fbc4e,_0x4ad71b,_0x353b46);return _0x3bf391(_0x4ad71b);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a8baafc..80b0eb7 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 _0x5f95=['initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals'];(function(_0x1f3ea3,_0x34f96a){var _0x805512=function(_0x135804){while(--_0x135804){_0x1f3ea3['push'](_0x1f3ea3['shift']());}};_0x805512(++_0x34f96a);}(_0x5f95,0x142));var _0x55f9=function(_0x4dffbd,_0x101fa3){_0x4dffbd=_0x4dffbd-0x0;var _0x21d414=_0x5f95[_0x4dffbd];return _0x21d414;};'use strict';var BPromise=require(_0x55f9('0x0'));var server=require(_0x55f9('0x1'));var Realtime=require('./realtime');var user=require(_0x55f9('0x2'));var interval=require(_0x55f9('0x3'));var openchannelQueue=require(_0x55f9('0x4'));var chatQueue=require(_0x55f9('0x5'));var smsQueue=require(_0x55f9('0x6'));var mailQueue=require(_0x55f9('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x55f9('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x55f9('0x9')]()['then'](user[_0x55f9('0xa')]())[_0x55f9('0xb')](realtime[_0x55f9('0xc')]())[_0x55f9('0xb')](interval[_0x55f9('0xd')]())[_0x55f9('0xb')](realtime[_0x55f9('0xe')]())[_0x55f9('0xb')](openchannelQueue[_0x55f9('0xf')]())[_0x55f9('0xb')](realtime[_0x55f9('0x10')]())[_0x55f9('0xb')](chatQueue[_0x55f9('0x11')]())[_0x55f9('0xb')](realtime[_0x55f9('0x12')]())[_0x55f9('0xb')](smsQueue[_0x55f9('0x13')]())['then'](realtime['initSmsQueues']())[_0x55f9('0xb')](mailQueue[_0x55f9('0x14')]())[_0x55f9('0xb')](realtime[_0x55f9('0x15')]())[_0x55f9('0xb')](faxQueue[_0x55f9('0x16')]())[_0x55f9('0xb')](realtime[_0x55f9('0x17')]())[_0x55f9('0xb')](whatsappQueue[_0x55f9('0x18')]())[_0x55f9('0xb')](realtime['initWhatsappQueues']())[_0x55f9('0xb')](function(){return realtime;});}function main(){return server[_0x55f9('0x19')](realtime)['then'](function(_0x497c03){return initRealtime();})['then'](function(_0x23b416){return setInterval(initRealtime,0x1388);})[_0x55f9('0x1a')](function(_0x57e6ae){console[_0x55f9('0x1b')](_0x57e6ae);});}main(); \ No newline at end of file +var _0x468d=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x468d,0xb8));var _0xd468=function(_0x547074,_0x19651d){_0x547074=_0x547074-0x0;var _0x39caeb=_0x468d[_0x547074];return _0x39caeb;};'use strict';var BPromise=require(_0xd468('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0xd468('0x1'));var interval=require(_0xd468('0x2'));var openchannelQueue=require(_0xd468('0x3'));var chatQueue=require(_0xd468('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xd468('0x5'));var faxQueue=require(_0xd468('0x6'));var whatsappQueue=require(_0xd468('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd468('0x8')]()[_0xd468('0x9')](user[_0xd468('0xa')]())[_0xd468('0x9')](realtime[_0xd468('0xb')]())['then'](interval[_0xd468('0xc')]())[_0xd468('0x9')](realtime[_0xd468('0xd')]())[_0xd468('0x9')](openchannelQueue[_0xd468('0xe')]())[_0xd468('0x9')](realtime[_0xd468('0xf')]())[_0xd468('0x9')](chatQueue[_0xd468('0x10')]())['then'](realtime[_0xd468('0x11')]())[_0xd468('0x9')](smsQueue[_0xd468('0x12')]())[_0xd468('0x9')](realtime[_0xd468('0x13')]())[_0xd468('0x9')](mailQueue[_0xd468('0x14')]())[_0xd468('0x9')](realtime[_0xd468('0x15')]())[_0xd468('0x9')](faxQueue[_0xd468('0x16')]())[_0xd468('0x9')](realtime[_0xd468('0x17')]())[_0xd468('0x9')](whatsappQueue[_0xd468('0x18')]())[_0xd468('0x9')](realtime[_0xd468('0x19')]())[_0xd468('0x9')](function(){return realtime;});}function main(){return server[_0xd468('0x1a')](realtime)[_0xd468('0x9')](function(_0x293d9e){return initRealtime();})[_0xd468('0x9')](function(_0x99d113){return setInterval(initRealtime,0x1388);})[_0xd468('0x1b')](function(_0x21f558){console['log'](_0x21f558);});}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 3386c40..f1523aa 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(_0x469b4d,_0x1b748f){var _0xa08f41=function(_0xf2e50a){while(--_0xf2e50a){_0x469b4d['push'](_0x469b4d['shift']());}};_0xa08f41(++_0x1b748f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x209e59,_0x5343c0){var _0x4fd0a3=function(_0x33726b){while(--_0x33726b){_0x209e59['push'](_0x209e59['shift']());}};_0x4fd0a3(++_0x5343c0);}(_0x814b,0x1a2));var _0xb814=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x814b[_0x5216e0];return _0x5b3f40;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 666adf8..ceb25d9 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 _0x16c2=['message','result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then','error'];(function(_0x5cabcf,_0x37ac71){var _0x46896d=function(_0x4f24ec){while(--_0x4f24ec){_0x5cabcf['push'](_0x5cabcf['shift']());}};_0x46896d(++_0x37ac71);}(_0x16c2,0x94));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x216c('0x0'));var client=jayson[_0x216c('0x1')][_0x216c('0x2')]({'port':0x232b});function request(_0x4ffbf6,_0x37ea34){return new BPromise(function(_0x23bee9,_0x331817){return client[_0x216c('0x3')](_0x4ffbf6,_0x37ea34)[_0x216c('0x4')](function(_0x4b7ce9){if(_0x4b7ce9[_0x216c('0x5')]){return _0x331817(_0x4b7ce9['error'][_0x216c('0x6')]);}else{return _0x23bee9(_0x4b7ce9[_0x216c('0x7')]);}})[_0x216c('0x8')](function(_0x528846){return _0x331817(_0x528846);});});}exports[_0x216c('0x9')]=function(_0x1cd165,_0x55fd5c){return request(_0x216c('0xa'),{'account':_0x1cd165,'message':_0x55fd5c});}; \ No newline at end of file +var _0xeec9=['request','then','error','message','result','sendMailMessage','SendMail','bluebird','http'];(function(_0x22d0b5,_0x26b6ca){var _0xa6cc2b=function(_0x187c67){while(--_0x187c67){_0x22d0b5['push'](_0x22d0b5['shift']());}};_0xa6cc2b(++_0x26b6ca);}(_0xeec9,0x127));var _0x9eec=function(_0xf49ce2,_0x406c6f){_0xf49ce2=_0xf49ce2-0x0;var _0x970f=_0xeec9[_0xf49ce2];return _0x970f;};'use strict';var BPromise=require(_0x9eec('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9eec('0x1')]({'port':0x232b});function request(_0x26a66a,_0x1e92b8){return new BPromise(function(_0x5b1db6,_0x1252da){return client[_0x9eec('0x2')](_0x26a66a,_0x1e92b8)[_0x9eec('0x3')](function(_0x304247){if(_0x304247[_0x9eec('0x4')]){return _0x1252da(_0x304247['error'][_0x9eec('0x5')]);}else{return _0x5b1db6(_0x304247[_0x9eec('0x6')]);}})['catch'](function(_0x442e7c){return _0x1252da(_0x442e7c);});});}exports[_0x9eec('0x7')]=function(_0x10daa3,_0x5e7520){return request(_0x9eec('0x8'),{'account':_0x10daa3,'message':_0x5e7520});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 45f016e..0923e68 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 _0x5217=['chat','sms','whatsapp','length','StatusTime','format','Status','chatStatusTime','smsStatus','smsCurrentCapacity','busyQueue','stringify','user:save','lodash','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail'];(function(_0x486af0,_0x189ef2){var _0x436434=function(_0x10ece9){while(--_0x10ece9){_0x486af0['push'](_0x486af0['shift']());}};_0x436434(++_0x189ef2);}(_0x5217,0xbb));var _0x7521=function(_0x113c57,_0x554616){_0x113c57=_0x113c57-0x0;var _0x21d656=_0x5217[_0x113c57];return _0x21d656;};'use strict';var _=require(_0x7521('0x0'));var moment=require('moment');var md5=require(_0x7521('0x1'));var Redis=require('ioredis');var config=require(_0x7521('0x2'));config[_0x7521('0x3')]=_[_0x7521('0x4')](config[_0x7521('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7521('0x5'))(new Redis(config['redis']));function Agent(_0x588408){this['id']=_0x588408['id']||0x0;this['name']=_0x588408[_0x7521('0x6')]||'';this[_0x7521('0x7')]=_0x588408['online']||!![];this[_0x7521('0x8')]=_0x588408[_0x7521('0x8')]||![];this['chatPause']=_0x588408[_0x7521('0x9')]||![];this[_0x7521('0xa')]=_0x588408[_0x7521('0xa')]||![];this[_0x7521('0xb')]=_0x588408[_0x7521('0xb')]||![];this[_0x7521('0xc')]=_0x588408['smsPause']||![];this[_0x7521('0xd')]=_0x588408['openchannelPause']||![];this[_0x7521('0xe')]=_0x7521('0xf');this['chatStatusTime']=0x0;this[_0x7521('0x10')]=_0x588408[_0x7521('0x10')]||0x0;this[_0x7521('0x11')]=0x0;this[_0x7521('0x12')]='unknown';this[_0x7521('0x13')]=0x0;this[_0x7521('0x14')]=_0x588408[_0x7521('0x14')]||0x0;this[_0x7521('0x15')]=0x0;this[_0x7521('0x16')]=_0x7521('0xf');this[_0x7521('0x17')]=0x0;this[_0x7521('0x18')]=_0x588408[_0x7521('0x18')]||0x0;this[_0x7521('0x19')]=0x0;this['smsStatus']=_0x7521('0xf');this[_0x7521('0x1a')]=0x0;this['smsCapacity']=_0x588408[_0x7521('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x7521('0x1c')]='unknown';this[_0x7521('0x1d')]=0x0;this[_0x7521('0x1e')]=_0x588408[_0x7521('0x1e')]||0x0;this[_0x7521('0x1f')]=0x0;this[_0x7521('0x20')]=_0x7521('0xf');this[_0x7521('0x21')]=0x0;this[_0x7521('0x22')]=_0x588408['openchannelCapacity']||0x0;this[_0x7521('0x23')]=0x0;this[_0x7521('0x24')]=![];this['busyQueue']=undefined;this[_0x7521('0x1')]='';this[_0x7521('0x25')]();}Agent[_0x7521('0x26')][_0x7521('0x27')]=function(_0x4048c5){if(this[_0x4048c5+_0x7521('0x28')]>0x0){if(this[_0x4048c5+_0x7521('0x29')]>0x0&&this[_0x4048c5+_0x7521('0x28')]>=this[_0x4048c5+_0x7521('0x29')]){return _0x7521('0x2a');}else{return _0x7521('0x2b');}}else{return'idle';}};Agent[_0x7521('0x26')][_0x7521('0x25')]=function(){var _0x36cb70=[_0x7521('0x2c'),_0x7521('0x2d'),'openchannel','fax',_0x7521('0x2e'),_0x7521('0x2f')];for(var _0x264ed2=0x0;_0x264ed2<_0x36cb70[_0x7521('0x30')];_0x264ed2+=0x1){var _0x27d856=this[_0x7521('0x27')](_0x36cb70[_0x264ed2]);if(this[_0x36cb70[_0x264ed2]+'Status']!==_0x27d856){this[_0x36cb70[_0x264ed2]+_0x7521('0x31')]=_['toNumber'](moment()[_0x7521('0x32')]('x'));}this[_0x36cb70[_0x264ed2]+_0x7521('0x33')]=_0x27d856;}var _0x1bf2aa={'id':this['id'],'name':this[_0x7521('0x6')],'online':this[_0x7521('0x7')],'voicePause':this[_0x7521('0x8')],'chatPause':this[_0x7521('0x9')],'mailPause':this[_0x7521('0xa')],'smsPause':this[_0x7521('0xc')],'faxPause':this[_0x7521('0xb')],'openchannelPause':this[_0x7521('0xd')],'chatStatus':this[_0x7521('0xe')],'chatStatusTime':this[_0x7521('0x34')],'chatCapacity':this[_0x7521('0x10')],'chatCurrentCapacity':this[_0x7521('0x11')],'mailStatus':this[_0x7521('0x12')],'mailStatusTime':this[_0x7521('0x13')],'mailCapacity':this[_0x7521('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x7521('0x16')],'faxStatusTime':this[_0x7521('0x17')],'faxCapacity':this[_0x7521('0x18')],'faxCurrentCapacity':this[_0x7521('0x19')],'smsStatus':this[_0x7521('0x35')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x7521('0x1b')],'smsCurrentCapacity':this[_0x7521('0x36')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x7521('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x7521('0x1f')],'openchannelStatus':this[_0x7521('0x20')],'openchannelStatusTime':this[_0x7521('0x21')],'openchannelCapacity':this[_0x7521('0x22')],'openchannelCurrentCapacity':this[_0x7521('0x23')],'busy':this[_0x7521('0x24')],'busyQueue':this[_0x7521('0x37')]};var _0x5efb60=md5(JSON[_0x7521('0x38')](_0x1bf2aa));if(this['md5']!==_0x5efb60){this[_0x7521('0x1')]=_0x5efb60;io['emit'](_0x7521('0x39'),_0x1bf2aa);}};module['exports']=Agent; \ No newline at end of file +var _0x4fc2=['faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','Capacity','CurrentCapacity','working','updateRealtime','mail','chat','openchannel','fax','sms','whatsapp','getChannelStatus','Status','toNumber','format','chatCurrentCapacity','faxStatus','faxCurrentCapacity','openchannelStatus','stringify','emit','exports','lodash','moment','md5','ioredis','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x4fc2,0x111));var _0x24fc=function(_0x1ff575,_0xdba21f){_0x1ff575=_0x1ff575-0x0;var _0x48fc9e=_0x4fc2[_0x1ff575];return _0x48fc9e;};'use strict';var _=require(_0x24fc('0x0'));var moment=require(_0x24fc('0x1'));var md5=require(_0x24fc('0x2'));var Redis=require(_0x24fc('0x3'));var config=require('../../../config/environment');config[_0x24fc('0x4')]=_[_0x24fc('0x5')](config[_0x24fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x24fc('0x6'))(new Redis(config[_0x24fc('0x4')]));function Agent(_0x58dafc){this['id']=_0x58dafc['id']||0x0;this[_0x24fc('0x7')]=_0x58dafc[_0x24fc('0x7')]||'';this['online']=_0x58dafc[_0x24fc('0x8')]||!![];this[_0x24fc('0x9')]=_0x58dafc[_0x24fc('0x9')]||![];this[_0x24fc('0xa')]=_0x58dafc[_0x24fc('0xa')]||![];this[_0x24fc('0xb')]=_0x58dafc['mailPause']||![];this[_0x24fc('0xc')]=_0x58dafc[_0x24fc('0xc')]||![];this[_0x24fc('0xd')]=_0x58dafc[_0x24fc('0xd')]||![];this[_0x24fc('0xe')]=_0x58dafc[_0x24fc('0xe')]||![];this[_0x24fc('0xf')]=_0x24fc('0x10');this['chatStatusTime']=0x0;this[_0x24fc('0x11')]=_0x58dafc[_0x24fc('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x24fc('0x12')]=_0x24fc('0x10');this[_0x24fc('0x13')]=0x0;this[_0x24fc('0x14')]=_0x58dafc[_0x24fc('0x14')]||0x0;this[_0x24fc('0x15')]=0x0;this['faxStatus']=_0x24fc('0x10');this[_0x24fc('0x16')]=0x0;this[_0x24fc('0x17')]=_0x58dafc[_0x24fc('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x24fc('0x18')]='unknown';this[_0x24fc('0x19')]=0x0;this[_0x24fc('0x1a')]=_0x58dafc[_0x24fc('0x1a')]||0x0;this[_0x24fc('0x1b')]=0x0;this[_0x24fc('0x1c')]='unknown';this[_0x24fc('0x1d')]=0x0;this[_0x24fc('0x1e')]=_0x58dafc[_0x24fc('0x1e')]||0x0;this[_0x24fc('0x1f')]=0x0;this['openchannelStatus']=_0x24fc('0x10');this[_0x24fc('0x20')]=0x0;this[_0x24fc('0x21')]=_0x58dafc['openchannelCapacity']||0x0;this[_0x24fc('0x22')]=0x0;this[_0x24fc('0x23')]=![];this[_0x24fc('0x24')]=undefined;this[_0x24fc('0x2')]='';this['updateRealtime']();}Agent[_0x24fc('0x25')]['getChannelStatus']=function(_0x339b50){if(this[_0x339b50+'CurrentCapacity']>0x0){if(this[_0x339b50+_0x24fc('0x26')]>0x0&&this[_0x339b50+_0x24fc('0x27')]>=this[_0x339b50+_0x24fc('0x26')]){return'maxcapacity';}else{return _0x24fc('0x28');}}else{return'idle';}};Agent[_0x24fc('0x25')][_0x24fc('0x29')]=function(){var _0x36a9b4=[_0x24fc('0x2a'),_0x24fc('0x2b'),_0x24fc('0x2c'),_0x24fc('0x2d'),_0x24fc('0x2e'),_0x24fc('0x2f')];for(var _0x2a5c4b=0x0;_0x2a5c4b<_0x36a9b4['length'];_0x2a5c4b+=0x1){var _0x11c913=this[_0x24fc('0x30')](_0x36a9b4[_0x2a5c4b]);if(this[_0x36a9b4[_0x2a5c4b]+_0x24fc('0x31')]!==_0x11c913){this[_0x36a9b4[_0x2a5c4b]+'StatusTime']=_[_0x24fc('0x32')](moment()[_0x24fc('0x33')]('x'));}this[_0x36a9b4[_0x2a5c4b]+_0x24fc('0x31')]=_0x11c913;}var _0x290f84={'id':this['id'],'name':this[_0x24fc('0x7')],'online':this[_0x24fc('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x24fc('0xa')],'mailPause':this[_0x24fc('0xb')],'smsPause':this[_0x24fc('0xd')],'faxPause':this[_0x24fc('0xc')],'openchannelPause':this[_0x24fc('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x24fc('0x34')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x24fc('0x13')],'mailCapacity':this[_0x24fc('0x14')],'mailCurrentCapacity':this[_0x24fc('0x15')],'faxStatus':this[_0x24fc('0x35')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x24fc('0x17')],'faxCurrentCapacity':this[_0x24fc('0x36')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x24fc('0x19')],'smsCapacity':this[_0x24fc('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x24fc('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x24fc('0x1f')],'openchannelStatus':this[_0x24fc('0x37')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x24fc('0x21')],'openchannelCurrentCapacity':this[_0x24fc('0x22')],'busy':this[_0x24fc('0x23')],'busyQueue':this[_0x24fc('0x24')]};var _0x1c5874=md5(JSON[_0x24fc('0x38')](_0x290f84));if(this[_0x24fc('0x2')]!==_0x1c5874){this[_0x24fc('0x2')]=_0x1c5874;io[_0x24fc('0x39')]('user:save',_0x290f84);}};module[_0x24fc('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d3f2bd9..576c583 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 _0x5c63=['updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','waiting'];(function(_0x3d9769,_0x2f397d){var _0x4ab054=function(_0x1684ac){while(--_0x1684ac){_0x3d9769['push'](_0x3d9769['shift']());}};_0x4ab054(++_0x2f397d);}(_0x5c63,0xe7));var _0x35c6=function(_0x36ddc9,_0x5e8282){_0x36ddc9=_0x36ddc9-0x0;var _0x4b5b11=_0x5c63[_0x36ddc9];return _0x4b5b11;};'use strict';var _=require('lodash');var md5=require(_0x35c6('0x0'));var util=require(_0x35c6('0x1'));var Redis=require(_0x35c6('0x2'));var config=require(_0x35c6('0x3'));config[_0x35c6('0x4')]=_[_0x35c6('0x5')](config[_0x35c6('0x4')],{'host':_0x35c6('0x6'),'port':0x18eb});var io=require(_0x35c6('0x7'))(new Redis(config[_0x35c6('0x4')]));function ChatQueue(_0x42a9c3){this['id']=_0x42a9c3['id']||0x0;this[_0x35c6('0x8')]=_0x42a9c3[_0x35c6('0x8')]||'';this['timeout']=_0x42a9c3['timeout']||0xa;this[_0x35c6('0x9')]=_0x42a9c3[_0x35c6('0x9')]||'beepall';this[_0x35c6('0xa')]=_0x42a9c3[_0x35c6('0xa')];this['mapAgentsId']={};this[_0x35c6('0xb')]=0x0;this[_0x35c6('0x0')]='';this['updateRouting']();this[_0x35c6('0xc')]();}ChatQueue['prototype']['updateRouting']=function(){var _0xad8937=this[_0x35c6('0xd')][_0x35c6('0xe')];this['mapAgentsId']=_[_0x35c6('0xf')](this['Agents'],'id');this[_0x35c6('0xd')]['_rr']=_0xad8937;};ChatQueue[_0x35c6('0x10')][_0x35c6('0xc')]=function(){this[_0x35c6('0x11')]=0x0;this[_0x35c6('0x12')]=0x0;for(var _0x18f3ac=0x0;_0x18f3ac=0x0?this[_0x35c6('0x16')]:0x0;var _0x592d6f={'id':this['id'],'available':this[_0x35c6('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x35c6('0x8')],'paused':this[_0x35c6('0x12')],'waiting':this[_0x35c6('0xb')]};var _0x134988=md5(JSON['stringify'](_0x592d6f));if(this[_0x35c6('0x0')]!==_0x134988){this[_0x35c6('0x0')]=_0x134988;io['to'](util[_0x35c6('0x17')](_0x35c6('0x18'),_0x592d6f[_0x35c6('0x8')]))[_0x35c6('0x19')](_0x35c6('0x1a'),_0x592d6f);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xea70=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','md5','format','emit','lodash','ioredis'];(function(_0x7d8438,_0x5af0fb){var _0xa1fa81=function(_0x598010){while(--_0x598010){_0x7d8438['push'](_0x7d8438['shift']());}};_0xa1fa81(++_0x5af0fb);}(_0xea70,0x1ae));var _0x0ea7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xea70[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x0ea7('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x0ea7('0x1'));var config=require(_0x0ea7('0x2'));config['redis']=_['defaults'](config[_0x0ea7('0x3')],{'host':_0x0ea7('0x4'),'port':0x18eb});var io=require(_0x0ea7('0x5'))(new Redis(config[_0x0ea7('0x3')]));function ChatQueue(_0x692b04){this['id']=_0x692b04['id']||0x0;this[_0x0ea7('0x6')]=_0x692b04[_0x0ea7('0x6')]||'';this['timeout']=_0x692b04[_0x0ea7('0x7')]||0xa;this['strategy']=_0x692b04[_0x0ea7('0x8')]||_0x0ea7('0x9');this[_0x0ea7('0xa')]=_0x692b04[_0x0ea7('0xa')];this[_0x0ea7('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x0ea7('0xc')]();this[_0x0ea7('0xd')]();}ChatQueue['prototype'][_0x0ea7('0xc')]=function(){var _0x260bb0=this[_0x0ea7('0xb')]['_rr'];this[_0x0ea7('0xb')]=_[_0x0ea7('0xe')](this['Agents'],'id');this['mapAgentsId'][_0x0ea7('0xf')]=_0x260bb0;};ChatQueue[_0x0ea7('0x10')]['updateRealtime']=function(){this[_0x0ea7('0x11')]=0x0;this[_0x0ea7('0x12')]=0x0;for(var _0x1a15af=0x0;_0x1a15af=0x0?this['available']:0x0;var _0x1df836={'id':this['id'],'available':this[_0x0ea7('0x15')],'loggedIn':this[_0x0ea7('0x11')],'name':this[_0x0ea7('0x6')],'paused':this['paused'],'waiting':this[_0x0ea7('0x16')]};var _0x577d96=md5(JSON[_0x0ea7('0x17')](_0x1df836));if(this[_0x0ea7('0x18')]!==_0x577d96){this[_0x0ea7('0x18')]=_0x577d96;io['to'](util[_0x0ea7('0x19')]('chat:queue:%s',_0x1df836[_0x0ea7('0x6')]))[_0x0ea7('0x1a')]('chat_queue:save',_0x1df836);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 40b4e44..6a7743b 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 _0xc3b1=['loggedIn','paused','faxPause','available','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x37729f,_0x1e7d52){var _0x37a2e6=function(_0x4b1928){while(--_0x4b1928){_0x37729f['push'](_0x37729f['shift']());}};_0x37a2e6(++_0x1e7d52);}(_0xc3b1,0xeb));var _0x1c3b=function(_0x12610b,_0xc1a936){_0x12610b=_0x12610b-0x0;var _0x492008=_0xc3b1[_0x12610b];return _0x492008;};'use strict';var _=require(_0x1c3b('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x1c3b('0x1'));var config=require(_0x1c3b('0x2'));config['redis']=_[_0x1c3b('0x3')](config['redis'],{'host':_0x1c3b('0x4'),'port':0x18eb});var io=require(_0x1c3b('0x5'))(new Redis(config['redis']));function FaxQueue(_0x31f4f5){this['id']=_0x31f4f5['id']||0x0;this['name']=_0x31f4f5[_0x1c3b('0x6')]||'';this[_0x1c3b('0x7')]=_0x31f4f5[_0x1c3b('0x7')]||0xa;this['strategy']=_0x31f4f5[_0x1c3b('0x8')]||'beepall';this[_0x1c3b('0x9')]=_0x31f4f5['Agents'];this[_0x1c3b('0xa')]={};this[_0x1c3b('0xb')]=0x0;this['md5']='';this[_0x1c3b('0xc')]();this[_0x1c3b('0xd')]();}FaxQueue[_0x1c3b('0xe')][_0x1c3b('0xc')]=function(){var _0x26807c=this['mapAgentsId'][_0x1c3b('0xf')];this[_0x1c3b('0xa')]=_[_0x1c3b('0x10')](this[_0x1c3b('0x9')],'id');this['mapAgentsId'][_0x1c3b('0xf')]=_0x26807c;};FaxQueue['prototype'][_0x1c3b('0xd')]=function(){this[_0x1c3b('0x11')]=0x0;this[_0x1c3b('0x12')]=0x0;for(var _0x1f153c=0x0;_0x1f153c=0x0?this[_0x1c3b('0x14')]:0x0;var _0x46a56d={'id':this['id'],'available':this[_0x1c3b('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x1c3b('0x6')],'paused':this[_0x1c3b('0x12')],'waiting':this[_0x1c3b('0xb')]};var _0x1049cf=md5(JSON[_0x1c3b('0x15')](_0x46a56d));if(this['md5']!==_0x1049cf){this[_0x1c3b('0x16')]=_0x1049cf;io['to'](util[_0x1c3b('0x17')](_0x1c3b('0x18'),_0x46a56d[_0x1c3b('0x6')]))[_0x1c3b('0x19')](_0x1c3b('0x1a'),_0x46a56d);}};module[_0x1c3b('0x1b')]=FaxQueue; \ No newline at end of file +var _0x4cae=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','prototype','mapAgentsId','_rr','map','updateRealtime','paused','length','online','loggedIn','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis'];(function(_0x1d10cf,_0xddbb7b){var _0xaba839=function(_0x3bb97d){while(--_0x3bb97d){_0x1d10cf['push'](_0x1d10cf['shift']());}};_0xaba839(++_0xddbb7b);}(_0x4cae,0x13b));var _0xe4ca=function(_0x244c56,_0x3be56c){_0x244c56=_0x244c56-0x0;var _0x512931=_0x4cae[_0x244c56];return _0x512931;};'use strict';var _=require(_0xe4ca('0x0'));var md5=require(_0xe4ca('0x1'));var util=require(_0xe4ca('0x2'));var Redis=require(_0xe4ca('0x3'));var config=require(_0xe4ca('0x4'));config[_0xe4ca('0x5')]=_[_0xe4ca('0x6')](config[_0xe4ca('0x5')],{'host':_0xe4ca('0x7'),'port':0x18eb});var io=require(_0xe4ca('0x8'))(new Redis(config[_0xe4ca('0x5')]));function FaxQueue(_0x39f24f){this['id']=_0x39f24f['id']||0x0;this[_0xe4ca('0x9')]=_0x39f24f['name']||'';this[_0xe4ca('0xa')]=_0x39f24f[_0xe4ca('0xa')]||0xa;this[_0xe4ca('0xb')]=_0x39f24f[_0xe4ca('0xb')]||'beepall';this[_0xe4ca('0xc')]=_0x39f24f[_0xe4ca('0xc')];this['mapAgentsId']={};this[_0xe4ca('0xd')]=0x0;this[_0xe4ca('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xe4ca('0xe')]['updateRouting']=function(){var _0x4642d9=this[_0xe4ca('0xf')][_0xe4ca('0x10')];this[_0xe4ca('0xf')]=_[_0xe4ca('0x11')](this['Agents'],'id');this[_0xe4ca('0xf')][_0xe4ca('0x10')]=_0x4642d9;};FaxQueue['prototype'][_0xe4ca('0x12')]=function(){this['loggedIn']=0x0;this[_0xe4ca('0x13')]=0x0;for(var _0x53ee0f=0x0;_0x53ee0f=0x0?this['available']:0x0;var _0x4a704a={'id':this['id'],'available':this[_0xe4ca('0x18')],'loggedIn':this[_0xe4ca('0x16')],'name':this[_0xe4ca('0x9')],'paused':this[_0xe4ca('0x13')],'waiting':this[_0xe4ca('0xd')]};var _0x22b58e=md5(JSON['stringify'](_0x4a704a));if(this[_0xe4ca('0x1')]!==_0x22b58e){this[_0xe4ca('0x1')]=_0x22b58e;io['to'](util[_0xe4ca('0x19')](_0xe4ca('0x1a'),_0x4a704a[_0xe4ca('0x9')]))[_0xe4ca('0x1b')](_0xe4ca('0x1c'),_0x4a704a);}};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 1e44e9b..abbbca5 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 _0x7c12=['Intervals','name'];(function(_0x2939dc,_0x18b149){var _0x1fbc58=function(_0x45fa2c){while(--_0x45fa2c){_0x2939dc['push'](_0x2939dc['shift']());}};_0x1fbc58(++_0x18b149);}(_0x7c12,0x16f));var _0x27c1=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x7c12[_0x2f54b6];return _0x169f21;};'use strict';function Interval(_0x2f7d58){this['id']=_0x2f7d58['id']||0x0;this[_0x27c1('0x0')]=_0x2f7d58[_0x27c1('0x0')]||'';this[_0x27c1('0x1')]=_0x2f7d58[_0x27c1('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x7a2e=['exports','name','Intervals'];(function(_0xbd4ed1,_0x11c465){var _0x5db905=function(_0x509333){while(--_0x509333){_0xbd4ed1['push'](_0xbd4ed1['shift']());}};_0x5db905(++_0x11c465);}(_0x7a2e,0x18d));var _0xe7a2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7a2e[_0x40a045];return _0x1a687c;};'use strict';function Interval(_0x352023){this['id']=_0x352023['id']||0x0;this[_0xe7a2('0x0')]=_0x352023[_0xe7a2('0x0')]||'';this[_0xe7a2('0x1')]=_0x352023[_0xe7a2('0x1')]||{};}module[_0xe7a2('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index c3a0400..1082e11 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 _0x62d2=['mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','Agents','mailPause','available','stringify','mail:queue:%s','emit'];(function(_0x167c44,_0xe53cd5){var _0x22ab56=function(_0x38f89a){while(--_0x38f89a){_0x167c44['push'](_0x167c44['shift']());}};_0x22ab56(++_0xe53cd5);}(_0x62d2,0x1e8));var _0x262d=function(_0x5815af,_0x361f0b){_0x5815af=_0x5815af-0x0;var _0x3f14cb=_0x62d2[_0x5815af];return _0x3f14cb;};'use strict';var _=require(_0x262d('0x0'));var md5=require(_0x262d('0x1'));var util=require(_0x262d('0x2'));var Redis=require(_0x262d('0x3'));var config=require(_0x262d('0x4'));config['redis']=_[_0x262d('0x5')](config[_0x262d('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x262d('0x6')]));function MailQueue(_0x227774){this['id']=_0x227774['id']||0x0;this['name']=_0x227774[_0x262d('0x7')]||'';this['timeout']=_0x227774[_0x262d('0x8')]||0xa;this['strategy']=_0x227774[_0x262d('0x9')]||_0x262d('0xa');this['Agents']=_0x227774['Agents'];this[_0x262d('0xb')]={};this[_0x262d('0xc')]=0x0;this[_0x262d('0x1')]='';this[_0x262d('0xd')]();this[_0x262d('0xe')]();}MailQueue['prototype']['updateRouting']=function(){var _0xb63ea1=this[_0x262d('0xb')][_0x262d('0xf')];this[_0x262d('0xb')]=_['map'](this['Agents'],'id');this[_0x262d('0xb')]['_rr']=_0xb63ea1;};MailQueue[_0x262d('0x10')]['updateRealtime']=function(){this[_0x262d('0x11')]=0x0;this[_0x262d('0x12')]=0x0;for(var _0x3cad0b=0x0;_0x3cad0b=0x0?this['available']:0x0;var _0x57b21a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x262d('0x11')],'name':this['name'],'paused':this[_0x262d('0x12')],'waiting':this[_0x262d('0xc')]};var _0x5c7f33=md5(JSON[_0x262d('0x16')](_0x57b21a));if(this[_0x262d('0x1')]!==_0x5c7f33){this['md5']=_0x5c7f33;io['to'](util['format'](_0x262d('0x17'),_0x57b21a['name']))[_0x262d('0x18')](_0x262d('0x19'),_0x57b21a);}};module[_0x262d('0x1a')]=MailQueue; \ No newline at end of file +var _0x8fb1=['localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','loggedIn','paused','length','online','mailPause','available','name','stringify','mail:queue:%s','lodash','md5','ioredis','../../../config/environment','defaults','redis'];(function(_0x3dbaf5,_0x442483){var _0x560000=function(_0x11f46c){while(--_0x11f46c){_0x3dbaf5['push'](_0x3dbaf5['shift']());}};_0x560000(++_0x442483);}(_0x8fb1,0x13e));var _0x18fb=function(_0x21a02a,_0x11d2d1){_0x21a02a=_0x21a02a-0x0;var _0x36cdca=_0x8fb1[_0x21a02a];return _0x36cdca;};'use strict';var _=require(_0x18fb('0x0'));var md5=require(_0x18fb('0x1'));var util=require('util');var Redis=require(_0x18fb('0x2'));var config=require(_0x18fb('0x3'));config['redis']=_[_0x18fb('0x4')](config[_0x18fb('0x5')],{'host':_0x18fb('0x6'),'port':0x18eb});var io=require(_0x18fb('0x7'))(new Redis(config[_0x18fb('0x5')]));function MailQueue(_0x27afe9){this['id']=_0x27afe9['id']||0x0;this['name']=_0x27afe9['name']||'';this['timeout']=_0x27afe9[_0x18fb('0x8')]||0xa;this[_0x18fb('0x9')]=_0x27afe9[_0x18fb('0x9')]||_0x18fb('0xa');this[_0x18fb('0xb')]=_0x27afe9[_0x18fb('0xb')];this['mapAgentsId']={};this[_0x18fb('0xc')]=0x0;this['md5']='';this[_0x18fb('0xd')]();this[_0x18fb('0xe')]();}MailQueue[_0x18fb('0xf')][_0x18fb('0xd')]=function(){var _0x4518b6=this['mapAgentsId'][_0x18fb('0x10')];this[_0x18fb('0x11')]=_['map'](this[_0x18fb('0xb')],'id');this['mapAgentsId']['_rr']=_0x4518b6;};MailQueue['prototype'][_0x18fb('0xe')]=function(){this[_0x18fb('0x12')]=0x0;this[_0x18fb('0x13')]=0x0;for(var _0x3db314=0x0;_0x3db314=0x0?this[_0x18fb('0x17')]:0x0;var _0x2eea95={'id':this['id'],'available':this[_0x18fb('0x17')],'loggedIn':this[_0x18fb('0x12')],'name':this[_0x18fb('0x18')],'paused':this['paused'],'waiting':this[_0x18fb('0xc')]};var _0x4a4a71=md5(JSON[_0x18fb('0x19')](_0x2eea95));if(this[_0x18fb('0x1')]!==_0x4a4a71){this[_0x18fb('0x1')]=_0x4a4a71;io['to'](util['format'](_0x18fb('0x1a'),_0x2eea95[_0x18fb('0x18')]))['emit']('mail_queue:save',_0x2eea95);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index ba00ed1..3ede5dc 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 _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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'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 +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(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x2ef3,0xba));var _0x32ef=function(_0x54ad85,_0x5a9949){_0x54ad85=_0x54ad85-0x0;var _0x2d3c75=_0x2ef3[_0x54ad85];return _0x2d3c75;};'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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index be172b1..0405b02 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 _0x3e74=['paused','online','available','waiting','stringify','md5','format','emit','exports','lodash','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','loggedIn'];(function(_0x198247,_0x491c12){var _0x2b18bc=function(_0x4a43e2){while(--_0x4a43e2){_0x198247['push'](_0x198247['shift']());}};_0x2b18bc(++_0x491c12);}(_0x3e74,0x175));var _0x43e7=function(_0x5043a5,_0x3e79eb){_0x5043a5=_0x5043a5-0x0;var _0x18312a=_0x3e74[_0x5043a5];return _0x18312a;};'use strict';var _=require(_0x43e7('0x0'));var md5=require('md5');var util=require(_0x43e7('0x1'));var Redis=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));config['redis']=_['defaults'](config[_0x43e7('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x43e7('0x5'))(new Redis(config[_0x43e7('0x4')]));function SmsQueue(_0xe78cb7){this['id']=_0xe78cb7['id']||0x0;this[_0x43e7('0x6')]=_0xe78cb7[_0x43e7('0x6')]||'';this['timeout']=_0xe78cb7[_0x43e7('0x7')]||0xa;this[_0x43e7('0x8')]=_0xe78cb7[_0x43e7('0x8')]||_0x43e7('0x9');this[_0x43e7('0xa')]=_0xe78cb7['Agents'];this[_0x43e7('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x43e7('0xc')]();this[_0x43e7('0xd')]();}SmsQueue['prototype'][_0x43e7('0xc')]=function(){var _0x513707=this[_0x43e7('0xb')][_0x43e7('0xe')];this['mapAgentsId']=_[_0x43e7('0xf')](this[_0x43e7('0xa')],'id');this[_0x43e7('0xb')][_0x43e7('0xe')]=_0x513707;};SmsQueue['prototype']['updateRealtime']=function(){this[_0x43e7('0x10')]=0x0;this[_0x43e7('0x11')]=0x0;for(var _0x44b0bd=0x0;_0x44b0bd=0x0?this[_0x43e7('0x13')]:0x0;var _0x1ca758={'id':this['id'],'available':this[_0x43e7('0x13')],'loggedIn':this[_0x43e7('0x10')],'name':this[_0x43e7('0x6')],'paused':this[_0x43e7('0x11')],'waiting':this[_0x43e7('0x14')]};var _0x1441ef=md5(JSON[_0x43e7('0x15')](_0x1ca758));if(this[_0x43e7('0x16')]!==_0x1441ef){this[_0x43e7('0x16')]=_0x1441ef;io['to'](util[_0x43e7('0x17')]('sms:queue:%s',_0x1ca758[_0x43e7('0x6')]))[_0x43e7('0x18')]('sms_queue:save',_0x1ca758);}};module[_0x43e7('0x19')]=SmsQueue; \ No newline at end of file +var _0x4876=['Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','paused','length','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x1f28e3,_0x5174f2){var _0x376179=function(_0x516397){while(--_0x516397){_0x1f28e3['push'](_0x1f28e3['shift']());}};_0x376179(++_0x5174f2);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x6487('0x0'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6487('0x1')]=_['defaults'](config[_0x6487('0x1')],{'host':_0x6487('0x2'),'port':0x18eb});var io=require(_0x6487('0x3'))(new Redis(config[_0x6487('0x1')]));function SmsQueue(_0x57d99d){this['id']=_0x57d99d['id']||0x0;this[_0x6487('0x4')]=_0x57d99d[_0x6487('0x4')]||'';this['timeout']=_0x57d99d[_0x6487('0x5')]||0xa;this[_0x6487('0x6')]=_0x57d99d[_0x6487('0x6')]||_0x6487('0x7');this[_0x6487('0x8')]=_0x57d99d[_0x6487('0x8')];this[_0x6487('0x9')]={};this[_0x6487('0xa')]=0x0;this[_0x6487('0xb')]='';this['updateRouting']();this[_0x6487('0xc')]();}SmsQueue[_0x6487('0xd')][_0x6487('0xe')]=function(){var _0x2ba8ce=this[_0x6487('0x9')][_0x6487('0xf')];this[_0x6487('0x9')]=_[_0x6487('0x10')](this['Agents'],'id');this[_0x6487('0x9')][_0x6487('0xf')]=_0x2ba8ce;};SmsQueue[_0x6487('0xd')][_0x6487('0xc')]=function(){this['loggedIn']=0x0;this[_0x6487('0x11')]=0x0;for(var _0x10f2e1=0x0;_0x10f2e1=0x0?this['available']:0x0;var _0x4cedf9={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6487('0x13')],'name':this[_0x6487('0x4')],'paused':this[_0x6487('0x11')],'waiting':this[_0x6487('0xa')]};var _0x30abdc=md5(JSON[_0x6487('0x16')](_0x4cedf9));if(this[_0x6487('0xb')]!==_0x30abdc){this[_0x6487('0xb')]=_0x30abdc;io['to'](util[_0x6487('0x17')](_0x6487('0x18'),_0x4cedf9[_0x6487('0x4')]))[_0x6487('0x19')](_0x6487('0x1a'),_0x4cedf9);}};module[_0x6487('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 581847c..57ba60f 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 _0xaeed=['format','whatsapp:queue:%s','emit','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','_rr','map','mapAgentsId','updateRealtime','loggedIn','paused','length','online','available','stringify'];(function(_0x20d761,_0xf72fd){var _0x529b98=function(_0x28689a){while(--_0x28689a){_0x20d761['push'](_0x20d761['shift']());}};_0x529b98(++_0xf72fd);}(_0xaeed,0x1f1));var _0xdaee=function(_0x150216,_0x1e9d2f){_0x150216=_0x150216-0x0;var _0x5a9031=_0xaeed[_0x150216];return _0x5a9031;};'use strict';var _=require(_0xdaee('0x0'));var md5=require(_0xdaee('0x1'));var util=require('util');var Redis=require(_0xdaee('0x2'));var config=require('../../../config/environment');config[_0xdaee('0x3')]=_[_0xdaee('0x4')](config[_0xdaee('0x3')],{'host':_0xdaee('0x5'),'port':0x18eb});var io=require(_0xdaee('0x6'))(new Redis(config[_0xdaee('0x3')]));function WhatsappQueue(_0x1a4ed9){this['id']=_0x1a4ed9['id']||0x0;this[_0xdaee('0x7')]=_0x1a4ed9[_0xdaee('0x7')]||'';this[_0xdaee('0x8')]=_0x1a4ed9[_0xdaee('0x8')]||0xa;this[_0xdaee('0x9')]=_0x1a4ed9[_0xdaee('0x9')]||_0xdaee('0xa');this['Agents']=_0x1a4ed9[_0xdaee('0xb')];this['mapAgentsId']={};this[_0xdaee('0xc')]=0x0;this[_0xdaee('0x1')]='';this[_0xdaee('0xd')]();this['updateRealtime']();}WhatsappQueue[_0xdaee('0xe')][_0xdaee('0xd')]=function(){var _0x2a29da=this['mapAgentsId'][_0xdaee('0xf')];this['mapAgentsId']=_[_0xdaee('0x10')](this['Agents'],'id');this[_0xdaee('0x11')][_0xdaee('0xf')]=_0x2a29da;};WhatsappQueue[_0xdaee('0xe')][_0xdaee('0x12')]=function(){this[_0xdaee('0x13')]=0x0;this[_0xdaee('0x14')]=0x0;for(var _0x47bf02=0x0;_0x47bf02=0x0?this['available']:0x0;var _0x2a0806={'id':this['id'],'available':this[_0xdaee('0x17')],'loggedIn':this[_0xdaee('0x13')],'name':this[_0xdaee('0x7')],'paused':this['paused'],'waiting':this[_0xdaee('0xc')]};var _0x474138=md5(JSON[_0xdaee('0x18')](_0x2a0806));if(this[_0xdaee('0x1')]!==_0x474138){this[_0xdaee('0x1')]=_0x474138;io['to'](util[_0xdaee('0x19')](_0xdaee('0x1a'),_0x2a0806[_0xdaee('0x7')]))[_0xdaee('0x1b')]('whatsapp_queue:save',_0x2a0806);}};module[_0xdaee('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xc77b=['_rr','length','online','loggedIn','whatsappPause','paused','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map'];(function(_0x40c26d,_0x42e923){var _0x271b5a=function(_0x2047a3){while(--_0x2047a3){_0x40c26d['push'](_0x40c26d['shift']());}};_0x271b5a(++_0x42e923);}(_0xc77b,0x88));var _0xbc77=function(_0x3cee6e,_0x2ccb7e){_0x3cee6e=_0x3cee6e-0x0;var _0x138f7e=_0xc77b[_0x3cee6e];return _0x138f7e;};'use strict';var _=require(_0xbc77('0x0'));var md5=require(_0xbc77('0x1'));var util=require(_0xbc77('0x2'));var Redis=require(_0xbc77('0x3'));var config=require('../../../config/environment');config[_0xbc77('0x4')]=_[_0xbc77('0x5')](config[_0xbc77('0x4')],{'host':_0xbc77('0x6'),'port':0x18eb});var io=require(_0xbc77('0x7'))(new Redis(config[_0xbc77('0x4')]));function WhatsappQueue(_0x589683){this['id']=_0x589683['id']||0x0;this['name']=_0x589683[_0xbc77('0x8')]||'';this[_0xbc77('0x9')]=_0x589683['timeout']||0xa;this[_0xbc77('0xa')]=_0x589683['strategy']||_0xbc77('0xb');this[_0xbc77('0xc')]=_0x589683['Agents'];this['mapAgentsId']={};this[_0xbc77('0xd')]=0x0;this['md5']='';this[_0xbc77('0xe')]();this[_0xbc77('0xf')]();}WhatsappQueue[_0xbc77('0x10')][_0xbc77('0xe')]=function(){var _0x8db846=this[_0xbc77('0x11')]['_rr'];this[_0xbc77('0x11')]=_[_0xbc77('0x12')](this[_0xbc77('0xc')],'id');this[_0xbc77('0x11')][_0xbc77('0x13')]=_0x8db846;};WhatsappQueue[_0xbc77('0x10')][_0xbc77('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x5a46e7=0x0;_0x5a46e7=0x0?this[_0xbc77('0x19')]:0x0;var _0x43f1e9={'id':this['id'],'available':this[_0xbc77('0x19')],'loggedIn':this[_0xbc77('0x16')],'name':this[_0xbc77('0x8')],'paused':this[_0xbc77('0x18')],'waiting':this['waiting']};var _0x2bfae1=md5(JSON[_0xbc77('0x1a')](_0x43f1e9));if(this['md5']!==_0x2bfae1){this[_0xbc77('0x1')]=_0x2bfae1;io['to'](util[_0xbc77('0x1b')]('whatsapp:queue:%s',_0x43f1e9[_0xbc77('0x8')]))[_0xbc77('0x1c')](_0xbc77('0x1d'),_0x43f1e9);}};module[_0xbc77('0x1e')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 1f4b7b6..a70a54e 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(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x2a9fc3,_0x2933a4){var _0x352745=function(_0xe8d7c1){while(--_0xe8d7c1){_0x2a9fc3['push'](_0x2a9fc3['shift']());}};_0x352745(++_0x2933a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c34d8,_0x383073){_0x4c34d8=_0x4c34d8-0x0;var _0x4c21df=_0xb10b[_0x4c34d8];return _0x4c21df;};'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 6d8a220..de5b604 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 _0x5781=['update','UpdateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0xf2af61,_0x5c7551){var _0x4acae6=function(_0x1bfab2){while(--_0x1bfab2){_0xf2af61['push'](_0xf2af61['shift']());}};_0x4acae6(++_0x5c7551);}(_0x5781,0xdf));var _0x1578=function(_0x2d6780,_0x46cd62){_0x2d6780=_0x2d6780-0x0;var _0x3f1b8f=_0x5781[_0x2d6780];return _0x3f1b8f;};'use strict';var client=require(_0x1578('0x0'));exports[_0x1578('0x1')]=function(_0x2c9f24,_0xe11a95){return client['Request'](_0x1578('0x2'),{'body':_0xe11a95,'options':{'where':{'id':_0x2c9f24}},'log':'updateChatInteraction'});};exports[_0x1578('0x3')]=function(_0x15bc3b,_0xd815d8){return client[_0x1578('0x4')](_0x1578('0x5'),{'body':_0xd815d8,'options':{'where':{'id':_0x15bc3b}},'log':_0x1578('0x6')});}; \ No newline at end of file +var _0x5b07=['updateChatInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5b07,0x122));var _0x75b0=function(_0x4bf208,_0x44740e){_0x4bf208=_0x4bf208-0x0;var _0x18a57c=_0x5b07[_0x4bf208];return _0x18a57c;};'use strict';var client=require(_0x75b0('0x0'));exports['update']=function(_0x1313f6,_0x4cdd4f){return client[_0x75b0('0x1')]('UpdateChatInteraction',{'body':_0x4cdd4f,'options':{'where':{'id':_0x1313f6}},'log':_0x75b0('0x2')});};exports['addTags']=function(_0x5c8c4b,_0x39b44b){return client[_0x75b0('0x1')]('AddTagsToChatInteraction',{'body':_0x39b44b,'options':{'where':{'id':_0x5c8c4b}},'log':_0x75b0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 136f413..2e69650 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 _0x542d=['Request','CreateChatMessage','../client','create'];(function(_0x5d6b48,_0x2ab8d9){var _0x40b71c=function(_0x3ff761){while(--_0x3ff761){_0x5d6b48['push'](_0x5d6b48['shift']());}};_0x40b71c(++_0x2ab8d9);}(_0x542d,0x1d6));var _0xd542=function(_0x5e2250,_0x47097d){_0x5e2250=_0x5e2250-0x0;var _0x2e063a=_0x542d[_0x5e2250];return _0x2e063a;};'use strict';var client=require(_0xd542('0x0'));exports[_0xd542('0x1')]=function(_0x425a66){return client[_0xd542('0x2')](_0xd542('0x3'),{'body':_0x425a66,'log':'createChatMessage'});}; \ No newline at end of file +var _0x58ee=['../client','create','createChatMessage'];(function(_0x20e797,_0xb0e2a0){var _0x286ca8=function(_0x510112){while(--_0x510112){_0x20e797['push'](_0x20e797['shift']());}};_0x286ca8(++_0xb0e2a0);}(_0x58ee,0x123));var _0xe58e=function(_0x5ac412,_0x3ecf0f){_0x5ac412=_0x5ac412-0x0;var _0x4d8dbf=_0x58ee[_0x5ac412];return _0x4d8dbf;};'use strict';var client=require(_0xe58e('0x0'));exports[_0xe58e('0x1')]=function(_0x342115){return client['Request']('CreateChatMessage',{'body':_0x342115,'log':_0xe58e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 3c6d5de..fce0a8a 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 _0xf0ba=['GetChatQueue','name','strategy','User','chatPause','../client','getChatQueues','Request'];(function(_0x5967c0,_0x452377){var _0x2ad249=function(_0x7eb26){while(--_0x7eb26){_0x5967c0['push'](_0x5967c0['shift']());}};_0x2ad249(++_0x452377);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xaf0b('0x0'));exports[_0xaf0b('0x1')]=function(){return function(){return client[_0xaf0b('0x2')](_0xaf0b('0x3'),{'options':{'raw':![],'attributes':['id',_0xaf0b('0x4'),'timeout',_0xaf0b('0x5')],'include':[{'model':_0xaf0b('0x6'),'as':'Agents','attributes':['id',_0xaf0b('0x4'),'online',_0xaf0b('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x0e85=['GetChatQueue','name','Agents','online','chatPause','../client','getChatQueues'];(function(_0x4a1da1,_0x39c7ef){var _0x582240=function(_0x146066){while(--_0x146066){_0x4a1da1['push'](_0x4a1da1['shift']());}};_0x582240(++_0x39c7ef);}(_0x0e85,0x7c));var _0x50e8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x0e85[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0x50e8('0x0'));exports[_0x50e8('0x1')]=function(){return function(){return client['Request'](_0x50e8('0x2'),{'options':{'raw':![],'attributes':['id',_0x50e8('0x3'),'timeout','strategy'],'include':[{'model':'User','as':_0x50e8('0x4'),'attributes':['id','name',_0x50e8('0x5'),_0x50e8('0x6')]}]},'log':_0x50e8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 3f9dfb7..4a43636 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 _0x049e=['Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport','../client','create'];(function(_0x47598d,_0x1735ea){var _0x40acd0=function(_0xea85cf){while(--_0xea85cf){_0x47598d['push'](_0x47598d['shift']());}};_0x40acd0(++_0x1735ea);}(_0x049e,0x16a));var _0xe049=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x049e[_0x7d62cb];return _0x3a6266;};'use strict';var client=require(_0xe049('0x0'));exports[_0xe049('0x1')]=function(_0x5efb24){return client[_0xe049('0x2')]('CreateChatQueueReport',{'body':_0x5efb24,'log':_0xe049('0x3')});};exports[_0xe049('0x4')]=function(_0xb492b8,_0x4001a8){return client[_0xe049('0x2')]('UpdateChatQueueReport',{'body':_0x4001a8,'options':{'where':{'uniqueid':_0xb492b8},'order':[['id',_0xe049('0x5')]],'limit':0x1},'log':_0xe049('0x6')});}; \ No newline at end of file +var _0xe77f=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0xe77f,0xba));var _0xfe77=function(_0x1f9b47,_0x118075){_0x1f9b47=_0x1f9b47-0x0;var _0x2c5667=_0xe77f[_0x1f9b47];return _0x2c5667;};'use strict';var client=require(_0xfe77('0x0'));exports[_0xfe77('0x1')]=function(_0x53bc15){return client[_0xfe77('0x2')](_0xfe77('0x3'),{'body':_0x53bc15,'log':'CreateChatQueueReport'});};exports[_0xfe77('0x4')]=function(_0xd99b0d,_0x55a414){return client[_0xfe77('0x2')](_0xfe77('0x5'),{'body':_0x55a414,'options':{'where':{'uniqueid':_0xd99b0d},'order':[['id',_0xfe77('0x6')]],'limit':0x1},'log':_0xfe77('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index c307e7b..4cc60f3 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(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x7a54,0x106));var _0x47a5=function(_0x27b6ec,_0x213e7b){_0x27b6ec=_0x27b6ec-0x0;var _0x15bf41=_0x7a54[_0x27b6ec];return _0x15bf41;};'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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x427b3d,_0x7ac0b3){var _0x2ce42f=function(_0x49e37d){while(--_0x49e37d){_0x427b3d['push'](_0x427b3d['shift']());}};_0x2ce42f(++_0x7ac0b3);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 1bf9894..8fe55f2 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 _0xb975=['Request','createFaxMessage','../client','create'];(function(_0x385bac,_0x33f57d){var _0x253209=function(_0x427d12){while(--_0x427d12){_0x385bac['push'](_0x385bac['shift']());}};_0x253209(++_0x33f57d);}(_0xb975,0x162));var _0x5b97=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xb975[_0x307d86];return _0x361745;};'use strict';var client=require(_0x5b97('0x0'));exports[_0x5b97('0x1')]=function(_0x15bc4e){return client[_0x5b97('0x2')]('CreateFaxMessage',{'body':_0x15bc4e,'log':_0x5b97('0x3')});}; \ No newline at end of file +var _0x3de0=['CreateFaxMessage','createFaxMessage','../client','Request'];(function(_0x3a8a10,_0x21ca7a){var _0x30174b=function(_0x2e4e52){while(--_0x2e4e52){_0x3a8a10['push'](_0x3a8a10['shift']());}};_0x30174b(++_0x21ca7a);}(_0x3de0,0x1ae));var _0x03de=function(_0x4480d3,_0x19d17f){_0x4480d3=_0x4480d3-0x0;var _0x5f45d3=_0x3de0[_0x4480d3];return _0x5f45d3;};'use strict';var client=require(_0x03de('0x0'));exports['create']=function(_0x23afb8){return client[_0x03de('0x1')](_0x03de('0x2'),{'body':_0x23afb8,'log':_0x03de('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1b92e04..7a239da 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 _0x681f=['online','faxPause','getFaxQueues','Request','GetFaxQueue','timeout','Agents','name'];(function(_0x43379c,_0x271d36){var _0x495648=function(_0x3f4652){while(--_0x3f4652){_0x43379c['push'](_0x43379c['shift']());}};_0x495648(++_0x271d36);}(_0x681f,0xd2));var _0xf681=function(_0x5488ee,_0x19366c){_0x5488ee=_0x5488ee-0x0;var _0x3d21b9=_0x681f[_0x5488ee];return _0x3d21b9;};'use strict';var client=require('../client');exports[_0xf681('0x0')]=function(){return function(){return client[_0xf681('0x1')](_0xf681('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf681('0x3'),'strategy'],'include':[{'model':'User','as':_0xf681('0x4'),'attributes':['id',_0xf681('0x5'),_0xf681('0x6'),_0xf681('0x7')]}]},'log':_0xf681('0x0')});};}; \ No newline at end of file +var _0xfa24=['name','strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0xfa24,0xec));var _0x4fa2=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0xfa24[_0x21d0c3];return _0x4df18e;};'use strict';var client=require(_0x4fa2('0x0'));exports[_0x4fa2('0x1')]=function(){return function(){return client[_0x4fa2('0x2')](_0x4fa2('0x3'),{'options':{'raw':![],'attributes':['id',_0x4fa2('0x4'),'timeout',_0x4fa2('0x5')],'include':[{'model':_0x4fa2('0x6'),'as':_0x4fa2('0x7'),'attributes':['id',_0x4fa2('0x4'),_0x4fa2('0x8'),_0x4fa2('0x9')]}]},'log':_0x4fa2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 347ac7c..c7e3cfd 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 _0xc67e=['CreateFaxQueueReport','../client','create','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc67e,0xd9));var _0xec67=function(_0x2faca4,_0x4467a0){_0x2faca4=_0x2faca4-0x0;var _0x4703ed=_0xc67e[_0x2faca4];return _0x4703ed;};'use strict';var client=require(_0xec67('0x0'));exports[_0xec67('0x1')]=function(_0x9c1080){return client[_0xec67('0x2')](_0xec67('0x3'),{'body':_0x9c1080,'log':_0xec67('0x3')});};exports['update']=function(_0x3c2c92,_0x121bff){return client['Request']('UpdateFaxQueueReport',{'body':_0x121bff,'options':{'where':{'uniqueid':_0x3c2c92},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xd1ed=['update','Request','UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport'];(function(_0x4f9c45,_0x278765){var _0x212cbc=function(_0x4e79f7){while(--_0x4e79f7){_0x4f9c45['push'](_0x4f9c45['shift']());}};_0x212cbc(++_0x278765);}(_0xd1ed,0x1d9));var _0xdd1e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd1ed[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xdd1e('0x0'));exports[_0xdd1e('0x1')]=function(_0x13c817){return client['Request'](_0xdd1e('0x2'),{'body':_0x13c817,'log':_0xdd1e('0x2')});};exports[_0xdd1e('0x3')]=function(_0x5b6556,_0x3e0371){return client[_0xdd1e('0x4')](_0xdd1e('0x5'),{'body':_0x3e0371,'options':{'where':{'uniqueid':_0x5b6556},'order':[['id',_0xdd1e('0x6')]],'limit':0x1},'log':_0xdd1e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 15ad7d8..a992e7b 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 _0x89e7=['getIntervals','Request','name','Interval','Intervals','../client'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x89e7,0xb3));var _0x789e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x89e7[_0x1928c9];return _0x51b5fb;};'use strict';var client=require(_0x789e('0x0'));exports[_0x789e('0x1')]=function(){return function(){return client[_0x789e('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x789e('0x3')],'include':[{'model':_0x789e('0x4'),'as':_0x789e('0x5'),'attributes':['id',_0x789e('0x3'),'interval']}]},'log':_0x789e('0x1')});};}; \ No newline at end of file +var _0xac94=['Request','GetInterval','Interval','Intervals','name','interval','getIntervals'];(function(_0x584714,_0x22e620){var _0xf81a9e=function(_0x2ff7de){while(--_0x2ff7de){_0x584714['push'](_0x584714['shift']());}};_0xf81a9e(++_0x22e620);}(_0xac94,0xd8));var _0x4ac9=function(_0x1d9a08,_0x38e20e){_0x1d9a08=_0x1d9a08-0x0;var _0x3f26f8=_0xac94[_0x1d9a08];return _0x3f26f8;};'use strict';var client=require('../client');exports[_0x4ac9('0x0')]=function(){return function(){return client[_0x4ac9('0x1')](_0x4ac9('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x4ac9('0x3'),'as':_0x4ac9('0x4'),'attributes':['id',_0x4ac9('0x5'),_0x4ac9('0x6')]}]},'log':_0x4ac9('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ba50942..bc427e9 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 _0xa30a=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x4064d0,_0x3edc47){var _0x4a84d6=function(_0x1ade3a){while(--_0x1ade3a){_0x4064d0['push'](_0x4064d0['shift']());}};_0x4a84d6(++_0x3edc47);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xaa30('0x0'));exports[_0xaa30('0x1')]=function(_0x25634b,_0x4dfa7e){return client[_0xaa30('0x2')](_0xaa30('0x3'),{'body':_0x4dfa7e,'options':{'where':{'id':_0x25634b}},'log':_0xaa30('0x4')});};exports[_0xaa30('0x5')]=function(_0x2a9b06,_0x271425){return client[_0xaa30('0x2')]('AddTagsToMailInteraction',{'body':_0x271425,'options':{'where':{'id':_0x2a9b06}},'log':_0xaa30('0x6')});}; \ No newline at end of file +var _0x3a6d=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x5dcca6,_0x1672e8){var _0x178cae=function(_0x3f2ef0){while(--_0x3f2ef0){_0x5dcca6['push'](_0x5dcca6['shift']());}};_0x178cae(++_0x1672e8);}(_0x3a6d,0x143));var _0xd3a6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3a6d[_0xfae23b];return _0x200640;};'use strict';var client=require(_0xd3a6('0x0'));exports[_0xd3a6('0x1')]=function(_0x5cb93b,_0x389f73){return client[_0xd3a6('0x2')](_0xd3a6('0x3'),{'body':_0x389f73,'options':{'where':{'id':_0x5cb93b}},'log':_0xd3a6('0x4')});};exports[_0xd3a6('0x5')]=function(_0x585473,_0x1cb966){return client[_0xd3a6('0x2')](_0xd3a6('0x6'),{'body':_0x1cb966,'options':{'where':{'id':_0x585473}},'log':_0xd3a6('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index f566af6..4c53457 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 _0x9e6f=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0xb1c914,_0x214919){var _0x29cabe=function(_0x54dacd){while(--_0x54dacd){_0xb1c914['push'](_0xb1c914['shift']());}};_0x29cabe(++_0x214919);}(_0x9e6f,0x135));var _0xf9e6=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9e6f[_0x1969a7];return _0x3d665f;};'use strict';var client=require(_0xf9e6('0x0'));exports[_0xf9e6('0x1')]=function(_0x1ed259){return client[_0xf9e6('0x2')](_0xf9e6('0x3'),{'body':_0x1ed259,'log':_0xf9e6('0x4')});}; \ No newline at end of file +var _0x6b69=['create','Request','createMailMessage','../client'];(function(_0x53bfcf,_0x24937a){var _0x2825e4=function(_0x2ffd0a){while(--_0x2ffd0a){_0x53bfcf['push'](_0x53bfcf['shift']());}};_0x2825e4(++_0x24937a);}(_0x6b69,0xe3));var _0x96b6=function(_0xdbbda6,_0x19be74){_0xdbbda6=_0xdbbda6-0x0;var _0x22fe1d=_0x6b69[_0xdbbda6];return _0x22fe1d;};'use strict';var client=require(_0x96b6('0x0'));exports[_0x96b6('0x1')]=function(_0x1b2370){return client[_0x96b6('0x2')]('CreateMailMessage',{'body':_0x1b2370,'log':_0x96b6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 4ed6096..dc7f4bc 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 _0x35d4=['../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents','online'];(function(_0x2dc93b,_0xb41657){var _0x509f05=function(_0x342d0c){while(--_0x342d0c){_0x2dc93b['push'](_0x2dc93b['shift']());}};_0x509f05(++_0xb41657);}(_0x35d4,0x195));var _0x435d=function(_0x18175c,_0x39e841){_0x18175c=_0x18175c-0x0;var _0x49cb1f=_0x35d4[_0x18175c];return _0x49cb1f;};'use strict';var client=require(_0x435d('0x0'));exports[_0x435d('0x1')]=function(){return function(){return client[_0x435d('0x2')](_0x435d('0x3'),{'options':{'raw':![],'attributes':['id',_0x435d('0x4'),_0x435d('0x5'),_0x435d('0x6')],'include':[{'model':'User','as':_0x435d('0x7'),'attributes':['id','name',_0x435d('0x8'),'mailPause']}]},'log':_0x435d('0x1')});};}; \ No newline at end of file +var _0xf3be=['../client','getMailQueues','Request','name','timeout','User','Agents'];(function(_0x1d2e5e,_0x145ae6){var _0x4a1d68=function(_0x3dd5b6){while(--_0x3dd5b6){_0x1d2e5e['push'](_0x1d2e5e['shift']());}};_0x4a1d68(++_0x145ae6);}(_0xf3be,0x134));var _0xef3b=function(_0xd8b63c,_0x29e009){_0xd8b63c=_0xd8b63c-0x0;var _0x158400=_0xf3be[_0xd8b63c];return _0x158400;};'use strict';var client=require(_0xef3b('0x0'));exports[_0xef3b('0x1')]=function(){return function(){return client[_0xef3b('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xef3b('0x3'),_0xef3b('0x4'),'strategy'],'include':[{'model':_0xef3b('0x5'),'as':_0xef3b('0x6'),'attributes':['id','name','online','mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 74c3c4b..5421514 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 _0x54ff=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport','update'];(function(_0x9d53ec,_0x121155){var _0x1addfb=function(_0x388cea){while(--_0x388cea){_0x9d53ec['push'](_0x9d53ec['shift']());}};_0x1addfb(++_0x121155);}(_0x54ff,0x1a0));var _0xf54f=function(_0x568a45,_0x2999ca){_0x568a45=_0x568a45-0x0;var _0x44b093=_0x54ff[_0x568a45];return _0x44b093;};'use strict';var client=require(_0xf54f('0x0'));exports['create']=function(_0x161ac3){return client[_0xf54f('0x1')](_0xf54f('0x2'),{'body':_0x161ac3,'log':'CreateMailQueueReport'});};exports[_0xf54f('0x3')]=function(_0x366f7f,_0x4d194b){return client[_0xf54f('0x1')](_0xf54f('0x4'),{'body':_0x4d194b,'options':{'where':{'uniqueid':_0x366f7f},'order':[['id',_0xf54f('0x5')]],'limit':0x1},'log':_0xf54f('0x4')});}; \ No newline at end of file +var _0x93bf=['create','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x28dcc1,_0x190587){var _0x24c170=function(_0xe1da0d){while(--_0xe1da0d){_0x28dcc1['push'](_0x28dcc1['shift']());}};_0x24c170(++_0x190587);}(_0x93bf,0xac));var _0xf93b=function(_0xdd0391,_0x10fe74){_0xdd0391=_0xdd0391-0x0;var _0x45e9a3=_0x93bf[_0xdd0391];return _0x45e9a3;};'use strict';var client=require('../client');exports[_0xf93b('0x0')]=function(_0x2289ce){return client['Request'](_0xf93b('0x1'),{'body':_0x2289ce,'log':'CreateMailQueueReport'});};exports[_0xf93b('0x2')]=function(_0x1c7b4d,_0x340541){return client['Request'](_0xf93b('0x3'),{'body':_0x340541,'options':{'where':{'uniqueid':_0x1c7b4d},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 249d739..a29e1f3 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 _0x364e=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x2e8565,_0xaeec59){var _0x2c6e56=function(_0xaaa7ca){while(--_0xaaa7ca){_0x2e8565['push'](_0x2e8565['shift']());}};_0x2c6e56(++_0xaeec59);}(_0x364e,0xcd));var _0xe364=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x364e[_0xd0b415];return _0x2bdf2c;};'use strict';var client=require(_0xe364('0x0'));exports[_0xe364('0x1')]=function(_0x36794b,_0x531004){return client[_0xe364('0x2')](_0xe364('0x3'),{'body':_0x531004,'options':{'where':{'id':_0x36794b}},'log':'updateOpenchannelInteraction'});};exports[_0xe364('0x4')]=function(_0x4c9d8b,_0x271ad3){return client['Request'](_0xe364('0x5'),{'body':_0x271ad3,'options':{'where':{'id':_0x4c9d8b}},'log':_0xe364('0x6')});}; \ No newline at end of file +var _0x40ae=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0x40ae,0x1cc));var _0xe40a=function(_0x562a5a,_0x35e2dd){_0x562a5a=_0x562a5a-0x0;var _0x41aaee=_0x40ae[_0x562a5a];return _0x41aaee;};'use strict';var client=require(_0xe40a('0x0'));exports[_0xe40a('0x1')]=function(_0x1423ae,_0x287173){return client[_0xe40a('0x2')](_0xe40a('0x3'),{'body':_0x287173,'options':{'where':{'id':_0x1423ae}},'log':_0xe40a('0x4')});};exports[_0xe40a('0x5')]=function(_0x2b22c3,_0x58777b){return client[_0xe40a('0x2')](_0xe40a('0x6'),{'body':_0x58777b,'options':{'where':{'id':_0x2b22c3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index f60acb9..f1d77dd 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 _0xf37a=['../client','create'];(function(_0x1cb36e,_0x27194d){var _0x4ad32c=function(_0x5bdae8){while(--_0x5bdae8){_0x1cb36e['push'](_0x1cb36e['shift']());}};_0x4ad32c(++_0x27194d);}(_0xf37a,0x1dc));var _0xaf37=function(_0x108902,_0x7b318c){_0x108902=_0x108902-0x0;var _0x28271e=_0xf37a[_0x108902];return _0x28271e;};'use strict';var client=require(_0xaf37('0x0'));exports[_0xaf37('0x1')]=function(_0x58921d){return client['Request']('CreateOpenchannelMessage',{'body':_0x58921d,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x5031=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x5511e2,_0x2572c0){var _0x28a628=function(_0x5d06d6){while(--_0x5d06d6){_0x5511e2['push'](_0x5511e2['shift']());}};_0x28a628(++_0x2572c0);}(_0x5031,0xfa));var _0x1503=function(_0xae96ac,_0xdc7041){_0xae96ac=_0xae96ac-0x0;var _0xdd2e85=_0x5031[_0xae96ac];return _0xdd2e85;};'use strict';var client=require(_0x1503('0x0'));exports[_0x1503('0x1')]=function(_0x5854fd){return client[_0x1503('0x2')](_0x1503('0x3'),{'body':_0x5854fd,'log':_0x1503('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 69c6b10..0367a0a 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 _0x6177=['online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','User','Agents'];(function(_0x29b997,_0x3f7266){var _0x18fe58=function(_0x11ba28){while(--_0x11ba28){_0x29b997['push'](_0x29b997['shift']());}};_0x18fe58(++_0x3f7266);}(_0x6177,0x192));var _0x7617=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x6177[_0x187ee1];return _0x388160;};'use strict';var client=require('../client');exports[_0x7617('0x0')]=function(){return function(){return client[_0x7617('0x1')](_0x7617('0x2'),{'options':{'raw':![],'attributes':['id',_0x7617('0x3'),'timeout','strategy'],'include':[{'model':_0x7617('0x4'),'as':_0x7617('0x5'),'attributes':['id',_0x7617('0x3'),_0x7617('0x6'),_0x7617('0x7')]}]},'log':_0x7617('0x0')});};}; \ No newline at end of file +var _0x440d=['strategy','User','Agents','name','online','openchannelPause','getOpenchannelQueues','Request','timeout'];(function(_0x4bc599,_0x2ed822){var _0x41dc42=function(_0x1cba62){while(--_0x1cba62){_0x4bc599['push'](_0x4bc599['shift']());}};_0x41dc42(++_0x2ed822);}(_0x440d,0x1d1));var _0xd440=function(_0x36684c,_0xbab67){_0x36684c=_0x36684c-0x0;var _0x51ab53=_0x440d[_0x36684c];return _0x51ab53;};'use strict';var client=require('../client');exports[_0xd440('0x0')]=function(){return function(){return client[_0xd440('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0xd440('0x2'),_0xd440('0x3')],'include':[{'model':_0xd440('0x4'),'as':_0xd440('0x5'),'attributes':['id',_0xd440('0x6'),_0xd440('0x7'),_0xd440('0x8')]}]},'log':_0xd440('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index bae93e5..4bb6766 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 _0xef6a=['UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport'];(function(_0x131013,_0x2b2b73){var _0x244ba0=function(_0x4d8158){while(--_0x4d8158){_0x131013['push'](_0x131013['shift']());}};_0x244ba0(++_0x2b2b73);}(_0xef6a,0x1e9));var _0xaef6=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xef6a[_0x68c979];return _0x4f0001;};'use strict';var client=require(_0xaef6('0x0'));exports[_0xaef6('0x1')]=function(_0x338995){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x338995,'log':_0xaef6('0x2')});};exports['update']=function(_0x3ecb34,_0xab465){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0xab465,'options':{'where':{'uniqueid':_0x3ecb34},'order':[['id','DESC']],'limit':0x1},'log':_0xaef6('0x3')});}; \ No newline at end of file +var _0xf32e=['../client','create','Request','UpdateOpenchannelQueueReport'];(function(_0xc01281,_0x2332b3){var _0x5c9546=function(_0x5185b2){while(--_0x5185b2){_0xc01281['push'](_0xc01281['shift']());}};_0x5c9546(++_0x2332b3);}(_0xf32e,0x110));var _0xef32=function(_0x12ef9a,_0x5dfbf7){_0x12ef9a=_0x12ef9a-0x0;var _0x3a6833=_0xf32e[_0x12ef9a];return _0x3a6833;};'use strict';var client=require(_0xef32('0x0'));exports[_0xef32('0x1')]=function(_0x1fbf9d){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x1fbf9d,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x56dd5d,_0x11b78e){return client[_0xef32('0x2')](_0xef32('0x3'),{'body':_0x11b78e,'options':{'where':{'uniqueid':_0x56dd5d},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index cea935c..f3ce967 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 _0xe2cc=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x464f41,_0x37162c){var _0x110898=function(_0x503a1d){while(--_0x503a1d){_0x464f41['push'](_0x464f41['shift']());}};_0x110898(++_0x37162c);}(_0xe2cc,0x69));var _0xce2c=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xe2cc[_0x4154a6];return _0x3b2786;};'use strict';var client=require(_0xce2c('0x0'));exports[_0xce2c('0x1')]=function(_0x59c9fc,_0x4a4c87){return client[_0xce2c('0x2')](_0xce2c('0x3'),{'body':_0x4a4c87,'options':{'where':{'id':_0x59c9fc}},'log':_0xce2c('0x4')});};exports[_0xce2c('0x5')]=function(_0x25e41a,_0x1a7c4e){return client[_0xce2c('0x2')](_0xce2c('0x6'),{'body':_0x1a7c4e,'options':{'where':{'id':_0x25e41a}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x8a8b=['Request','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x25b0ae,_0x59c0d3){var _0x2d3853=function(_0x192314){while(--_0x192314){_0x25b0ae['push'](_0x25b0ae['shift']());}};_0x2d3853(++_0x59c0d3);}(_0x8a8b,0xae));var _0xb8a8=function(_0x5d0e50,_0x3e90eb){_0x5d0e50=_0x5d0e50-0x0;var _0x1a56ee=_0x8a8b[_0x5d0e50];return _0x1a56ee;};'use strict';var client=require(_0xb8a8('0x0'));exports['update']=function(_0x54e14e,_0x30a142){return client[_0xb8a8('0x1')]('UpdateSmsInteraction',{'body':_0x30a142,'options':{'where':{'id':_0x54e14e}},'log':_0xb8a8('0x2')});};exports['addTags']=function(_0xca9854,_0x4fe301){return client[_0xb8a8('0x1')](_0xb8a8('0x3'),{'body':_0x4fe301,'options':{'where':{'id':_0xca9854}},'log':_0xb8a8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index efb2882..70ba35f 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 _0x703d=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x543406,_0x2571fa){var _0x50c0d2=function(_0x28117b){while(--_0x28117b){_0x543406['push'](_0x543406['shift']());}};_0x50c0d2(++_0x2571fa);}(_0x703d,0x194));var _0xd703=function(_0x2e02db,_0x1b8bc5){_0x2e02db=_0x2e02db-0x0;var _0x29d103=_0x703d[_0x2e02db];return _0x29d103;};'use strict';var client=require('../client');exports[_0xd703('0x0')]=function(_0x10842c){return client[_0xd703('0x1')](_0xd703('0x2'),{'body':_0x10842c,'log':_0xd703('0x3')});}; \ No newline at end of file +var _0x987a=['CreateSmsMessage'];(function(_0x796a2c,_0x4863e1){var _0x3cdc29=function(_0x5b8f86){while(--_0x5b8f86){_0x796a2c['push'](_0x796a2c['shift']());}};_0x3cdc29(++_0x4863e1);}(_0x987a,0x1e6));var _0xa987=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x987a[_0x18ab2a];return _0x16dcee;};'use strict';var client=require('../client');exports['create']=function(_0x1e07e7){return client['Request'](_0xa987('0x0'),{'body':_0x1e07e7,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index b4a9135..a6be4ce 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x21c24d,_0x1de17c){var _0x552f96=function(_0x3b5cc5){while(--_0x3b5cc5){_0x21c24d['push'](_0x21c24d['shift']());}};_0x552f96(++_0x1de17c);}(_0xe706,0xa3));var _0x6e70=function(_0x288788,_0x13b561){_0x288788=_0x288788-0x0;var _0x71cb99=_0xe706[_0x288788];return _0x71cb99;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x263a7f,_0x2acce3){var _0x329c05=function(_0x235201){while(--_0x235201){_0x263a7f['push'](_0x263a7f['shift']());}};_0x329c05(++_0x2acce3);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb7e7[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c71b1de..e788bb0 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x4c9494,_0x15d8fa){var _0x5371a6=function(_0x17248){while(--_0x17248){_0x4c9494['push'](_0x4c9494['shift']());}};_0x5371a6(++_0x15d8fa);}(_0x55ca,0x126));var _0xa55c=function(_0x2bc7bc,_0x827ea){_0x2bc7bc=_0x2bc7bc-0x0;var _0xbae862=_0x55ca[_0x2bc7bc];return _0xbae862;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0xd6bc10,_0x331631){var _0x1713c2=function(_0x1fd445){while(--_0x1fd445){_0xd6bc10['push'](_0xd6bc10['shift']());}};_0x1713c2(++_0x331631);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 35499c0..547e6e9 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(_0x1e67d0,_0x13b2c1){var _0x54f7de=function(_0x32fa45){while(--_0x32fa45){_0x1e67d0['push'](_0x1e67d0['shift']());}};_0x54f7de(++_0x13b2c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3a9a4b,_0x37d396){var _0x23875f=function(_0x5815b5){while(--_0x5815b5){_0x3a9a4b['push'](_0x3a9a4b['shift']());}};_0x23875f(++_0x37d396);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 43da6b8..67a46d9 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 _0x01d9=['addTags','Request','AddTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x5a080f,_0x5ca651){var _0x3597ca=function(_0x4dbcd4){while(--_0x4dbcd4){_0x5a080f['push'](_0x5a080f['shift']());}};_0x3597ca(++_0x5ca651);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x901d('0x0'));exports[_0x901d('0x1')]=function(_0x30eba2,_0x209575){return client['Request'](_0x901d('0x2'),{'body':_0x209575,'options':{'where':{'id':_0x30eba2}},'log':_0x901d('0x3')});};exports[_0x901d('0x4')]=function(_0x8f7b4,_0x214f38){return client[_0x901d('0x5')](_0x901d('0x6'),{'body':_0x214f38,'options':{'where':{'id':_0x8f7b4}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x39c7=['updateWhatsappInteraction','update','Request','UpdateWhatsappInteraction'];(function(_0x542312,_0x54895d){var _0x4d73a0=function(_0x1196e5){while(--_0x1196e5){_0x542312['push'](_0x542312['shift']());}};_0x4d73a0(++_0x54895d);}(_0x39c7,0x85));var _0x739c=function(_0x479323,_0x1e0eae){_0x479323=_0x479323-0x0;var _0x260ea0=_0x39c7[_0x479323];return _0x260ea0;};'use strict';var client=require('../client');exports[_0x739c('0x0')]=function(_0x30270a,_0x11237b){return client[_0x739c('0x1')](_0x739c('0x2'),{'body':_0x11237b,'options':{'where':{'id':_0x30270a}},'log':_0x739c('0x3')});};exports['addTags']=function(_0x11c0a6,_0xff8215){return client[_0x739c('0x1')]('AddTagsToWhatsappInteraction',{'body':_0xff8215,'options':{'where':{'id':_0x11c0a6}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 1195b81..aaed471 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 _0xd358=['create','Request'];(function(_0x16c56b,_0x42f208){var _0xa2b5ae=function(_0x373e3a){while(--_0x373e3a){_0x16c56b['push'](_0x16c56b['shift']());}};_0xa2b5ae(++_0x42f208);}(_0xd358,0x12c));var _0x8d35=function(_0xa053b3,_0x34db1d){_0xa053b3=_0xa053b3-0x0;var _0x2c321d=_0xd358[_0xa053b3];return _0x2c321d;};'use strict';var client=require('../client');exports[_0x8d35('0x0')]=function(_0x175656){return client[_0x8d35('0x1')]('CreateWhatsappMessage',{'body':_0x175656,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x833a=['create','Request','createWhatsappMessage','../client'];(function(_0xd3466b,_0x4942f4){var _0x439656=function(_0x287d2f){while(--_0x287d2f){_0xd3466b['push'](_0xd3466b['shift']());}};_0x439656(++_0x4942f4);}(_0x833a,0x14b));var _0xa833=function(_0x4f2c5d,_0x4531e4){_0x4f2c5d=_0x4f2c5d-0x0;var _0x4f18ef=_0x833a[_0x4f2c5d];return _0x4f18ef;};'use strict';var client=require(_0xa833('0x0'));exports[_0xa833('0x1')]=function(_0x1b4507){return client[_0xa833('0x2')]('CreateWhatsappMessage',{'body':_0x1b4507,'log':_0xa833('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 3b6be79..d62e32f 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 _0x1b44=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','Agents','name','online'];(function(_0x1a6f7f,_0x45eaf1){var _0x4a09c2=function(_0x5a808c){while(--_0x5a808c){_0x1a6f7f['push'](_0x1a6f7f['shift']());}};_0x4a09c2(++_0x45eaf1);}(_0x1b44,0x16c));var _0x41b4=function(_0x5980b4,_0x324826){_0x5980b4=_0x5980b4-0x0;var _0x46f597=_0x1b44[_0x5980b4];return _0x46f597;};'use strict';var client=require(_0x41b4('0x0'));exports[_0x41b4('0x1')]=function(){return function(){return client[_0x41b4('0x2')](_0x41b4('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x41b4('0x4'),_0x41b4('0x5')],'include':[{'model':_0x41b4('0x6'),'as':_0x41b4('0x7'),'attributes':['id',_0x41b4('0x8'),_0x41b4('0x9'),_0x41b4('0xa')]}]},'log':_0x41b4('0x1')});};}; \ No newline at end of file +var _0x12f2=['timeout','strategy','Agents','online','whatsappPause','../client','getWhatsappQueues','name'];(function(_0x33aded,_0x173eb7){var _0x3e1558=function(_0x4d6e8c){while(--_0x4d6e8c){_0x33aded['push'](_0x33aded['shift']());}};_0x3e1558(++_0x173eb7);}(_0x12f2,0x135));var _0x212f=function(_0x3ee664,_0x4d3726){_0x3ee664=_0x3ee664-0x0;var _0x4d5454=_0x12f2[_0x3ee664];return _0x4d5454;};'use strict';var client=require(_0x212f('0x0'));exports[_0x212f('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x212f('0x2'),_0x212f('0x3'),_0x212f('0x4')],'include':[{'model':'User','as':_0x212f('0x5'),'attributes':['id',_0x212f('0x2'),_0x212f('0x6'),_0x212f('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 1784695..5298312 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 _0x4881=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client'];(function(_0x3b4f36,_0x3c2547){var _0x1b3386=function(_0x170ade){while(--_0x170ade){_0x3b4f36['push'](_0x3b4f36['shift']());}};_0x1b3386(++_0x3c2547);}(_0x4881,0xd1));var _0x1488=function(_0x51a6e4,_0x1dbcee){_0x51a6e4=_0x51a6e4-0x0;var _0xbed624=_0x4881[_0x51a6e4];return _0xbed624;};'use strict';var client=require(_0x1488('0x0'));exports['create']=function(_0x4f10e1){return client[_0x1488('0x1')](_0x1488('0x2'),{'body':_0x4f10e1,'log':'CreateWhatsappQueueReport'});};exports[_0x1488('0x3')]=function(_0x1034c1,_0x239d0){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x239d0,'options':{'where':{'uniqueid':_0x1034c1},'order':[['id','DESC']],'limit':0x1},'log':_0x1488('0x4')});}; \ No newline at end of file +var _0x7f6d=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x1477e5,_0x54d8e3){var _0x142b2f=function(_0x59b5ae){while(--_0x59b5ae){_0x1477e5['push'](_0x1477e5['shift']());}};_0x142b2f(++_0x54d8e3);}(_0x7f6d,0xe9));var _0xd7f6=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x7f6d[_0x21549c];return _0x426cbd;};'use strict';var client=require(_0xd7f6('0x0'));exports[_0xd7f6('0x1')]=function(_0x2380a8){return client[_0xd7f6('0x2')](_0xd7f6('0x3'),{'body':_0x2380a8,'log':_0xd7f6('0x3')});};exports['update']=function(_0x16b85d,_0x363433){return client['Request'](_0xd7f6('0x4'),{'body':_0x363433,'options':{'where':{'uniqueid':_0x16b85d},'order':[['id',_0xd7f6('0x5')]],'limit':0x1},'log':_0xd7f6('0x4')});}; \ 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 16b3e4d..614f43c 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 _0x4264=['number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','agents','createQueue','atimeout','channel','format','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x4996eb,_0x56041c){var _0x4ca9b9=function(_0x238802){while(--_0x238802){_0x4996eb['push'](_0x4996eb['shift']());}};_0x4ca9b9(++_0x56041c);}(_0x4264,0x6c));var _0x4426=function(_0x91045d,_0x1d9d27){_0x91045d=_0x91045d-0x0;var _0x18da9e=_0x4264[_0x91045d];return _0x18da9e;};'use strict';var schema=require(_0x4426('0x0'));var _=require(_0x4426('0x1'));var util=require(_0x4426('0x2'));var seqqueue=require(_0x4426('0x3'));var logger=require(_0x4426('0x4'))(_0x4426('0x5'));var strategy=require(_0x4426('0x6'));var queue=schema({'name':{'type':_0x4426('0x7'),'required':!![],'message':_0x4426('0x8')},'timeout':{'type':_0x4426('0x9'),'message':_0x4426('0xa')}});function writeLog(_0x1a8925,_0x11dd79,_0x23b44e){return logger['info'](util['format'](_0x4426('0xb'),_0x1a8925,_0x11dd79['name'],_0x23b44e));}function handleFindAgent(_0x884b10){return function(_0x4766d9){return _0x4766d9[_0x4426('0xc')][_0x4426('0xd')]()===_0x884b10[_0x4426('0xd')]();};}exports[_0x4426('0xe')]=function(_0x3250b1,_0x152981,_0x416c35,_0x303051){return function(_0x4dfb9a){try{var _0x33f9ac={'name':_0x152981[0x0],'timeout':_0x152981[0x1]};var _0xeefab6=queue[_0x4426('0x0')](_0x33f9ac,{'typecast':!![]});if(_0xeefab6[_0x4426('0xf')]){logger['error'](_0x4426('0x10'),_0x3250b1,_[_0x4426('0x11')](_0xeefab6,_0x4426('0x12'))[_0x4426('0x13')](',\x20'));_0x4dfb9a[_0x4426('0x14')]();}else{var _0xe820c3=_['find'](_0x416c35[_0x4426('0x15')],handleFindAgent(_0x33f9ac[_0x4426('0xc')]));if(_0xe820c3){var _0x4ff221=(_0x33f9ac['timeout']||0xa)*0x3e8;var _0xca5753,_0x464728;var _0xbada4f=seqqueue[_0x4426('0x16')](_0x4ff221);_0xbada4f['id']=_0x3250b1;_0xbada4f[_0x4426('0x17')]=_0x4ff221;_0xbada4f['channel']=_0x303051[_0x4426('0x18')];writeLog(_0x3250b1,_0xe820c3,util[_0x4426('0x19')]('START:%s',_0x4ff221));_0x416c35[_0x4426('0x1a')][_0x3250b1]['on'](_0x4426('0x1b'),function(){logger[_0x4426('0x1c')](_0x4426('0x1d'),_0x3250b1);clearTimeout(_0x464728);_0x464728=undefined;_0xbada4f['close']();if(_0x416c35[_0x4426('0x1a')][_0x3250b1]){delete _0x416c35[_0x4426('0x1a')][_0x3250b1];}_0x4dfb9a[_0x4426('0x14')]();});_0x416c35[_0x4426('0x1a')][_0x3250b1]['on'](_0x4426('0x1e'),function(){if(_0x416c35[_0x4426('0x1a')][_0x3250b1]){delete _0x416c35[_0x4426('0x1a')][_0x3250b1];}});_0x464728=setTimeout(function(){logger[_0x4426('0x1c')]('[%s][AGENT]\x20ROUTING\x20END',_0x3250b1);clearTimeout(_0x464728);_0xbada4f[_0x4426('0x1f')]();_0x4dfb9a[_0x4426('0x20')]();},_0x4ff221);strategy[_0x4426('0x21')](_0xbada4f,_0xe820c3,_0x416c35,_0x303051);}else{logger[_0x4426('0x22')](_0x4426('0x23'),_0x3250b1,_0x33f9ac[_0x4426('0xc')]);_0x4dfb9a[_0x4426('0x14')]();}}}catch(_0x5dab89){console[_0x4426('0x24')](_0x5dab89);logger['error'](_0x4426('0x25'),_0x3250b1,_0x5dab89[_0x4426('0x26')]);_0x4dfb9a[_0x4426('0x14')]();}};}; \ No newline at end of file +var _0x0cac=['rules','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','seq-queue','../../../../config/logger','routing','./strategy','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x0cac,0x18a));var _0xc0ca=function(_0x2ed57c,_0x2935b8){_0x2ed57c=_0x2ed57c-0x0;var _0x3c8041=_0x0cac[_0x2ed57c];return _0x3c8041;};'use strict';var schema=require(_0xc0ca('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xc0ca('0x1'));var logger=require(_0xc0ca('0x2'))(_0xc0ca('0x3'));var strategy=require(_0xc0ca('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc0ca('0x5'),'message':_0xc0ca('0x6')}});function writeLog(_0xa11214,_0x1139b5,_0x4fdcd3){return logger[_0xc0ca('0x7')](util['format'](_0xc0ca('0x8'),_0xa11214,_0x1139b5['name'],_0x4fdcd3));}function handleFindAgent(_0x50257b){return function(_0x293736){return _0x293736[_0xc0ca('0x9')]['toLowerCase']()===_0x50257b[_0xc0ca('0xa')]();};}exports[_0xc0ca('0xb')]=function(_0x26fbfe,_0x22c679,_0x3fbd2d,_0x431f5b){return function(_0x4b6598){try{var _0xefa226={'name':_0x22c679[0x0],'timeout':_0x22c679[0x1]};var _0x1dd9ba=queue[_0xc0ca('0x0')](_0xefa226,{'typecast':!![]});if(_0x1dd9ba[_0xc0ca('0xc')]){logger[_0xc0ca('0xd')](_0xc0ca('0xe'),_0x26fbfe,_[_0xc0ca('0xf')](_0x1dd9ba,'message')[_0xc0ca('0x10')](',\x20'));_0x4b6598[_0xc0ca('0x11')]();}else{var _0x26db18=_[_0xc0ca('0x12')](_0x3fbd2d[_0xc0ca('0x13')],handleFindAgent(_0xefa226['name']));if(_0x26db18){var _0x3a9a58=(_0xefa226[_0xc0ca('0x14')]||0xa)*0x3e8;var _0x62a186,_0x3a067c;var _0x1241ac=seqqueue['createQueue'](_0x3a9a58);_0x1241ac['id']=_0x26fbfe;_0x1241ac['atimeout']=_0x3a9a58;_0x1241ac[_0xc0ca('0x15')]=_0x431f5b[_0xc0ca('0x15')];writeLog(_0x26fbfe,_0x26db18,util[_0xc0ca('0x16')](_0xc0ca('0x17'),_0x3a9a58));_0x3fbd2d['rules'][_0x26fbfe]['on'](_0xc0ca('0x18'),function(){logger[_0xc0ca('0x7')](_0xc0ca('0x19'),_0x26fbfe);clearTimeout(_0x3a067c);_0x3a067c=undefined;_0x1241ac['close']();if(_0x3fbd2d[_0xc0ca('0x1a')][_0x26fbfe]){delete _0x3fbd2d['rules'][_0x26fbfe];}_0x4b6598['stop']();});_0x3fbd2d[_0xc0ca('0x1a')][_0x26fbfe]['on'](_0xc0ca('0x1b'),function(){if(_0x3fbd2d[_0xc0ca('0x1a')][_0x26fbfe]){delete _0x3fbd2d[_0xc0ca('0x1a')][_0x26fbfe];}});_0x3a067c=setTimeout(function(){logger[_0xc0ca('0x7')](_0xc0ca('0x1c'),_0x26fbfe);clearTimeout(_0x3a067c);_0x1241ac[_0xc0ca('0x1d')]();_0x4b6598[_0xc0ca('0x1e')]();},_0x3a9a58);strategy[_0xc0ca('0x1f')](_0x1241ac,_0x26db18,_0x3fbd2d,_0x431f5b);}else{logger[_0xc0ca('0xd')](_0xc0ca('0x20'),_0x26fbfe,_0xefa226[_0xc0ca('0x9')]);_0x4b6598[_0xc0ca('0x11')]();}}}catch(_0x53f59d){console[_0xc0ca('0x21')](_0x53f59d);logger[_0xc0ca('0xd')](_0xc0ca('0x22'),_0x26fbfe,_0x53f59d['stack']);_0x4b6598[_0xc0ca('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index fa8e4c7..82450f2 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 _0x779e=['account','upperFirst','AccountId','InteractionId','created','isEmpty','body','Message','create','then','info','catch','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','[%s][AMAZONLEX]\x20%s','amazonlex','providerResponse','stringify','dialogState','lodash','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId'];(function(_0x498580,_0x784ee2){var _0x4ab3ee=function(_0x1be591){while(--_0x1be591){_0x498580['push'](_0x498580['shift']());}};_0x4ab3ee(++_0x784ee2);}(_0x779e,0x170));var _0xe779=function(_0x18a16d,_0x199976){_0x18a16d=_0x18a16d-0x0;var _0x21cf0c=_0x779e[_0x18a16d];return _0x21cf0c;};'use strict';var _=require(_0xe779('0x0'));var moment=require('moment');var AWS=require(_0xe779('0x1'));var utils=require(_0xe779('0x2'));var logger=require(_0xe779('0x3'))(_0xe779('0x4'));var rpc={'chatMessage':require(_0xe779('0x5')),'openchannelMessage':require(_0xe779('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xe779('0x7')]=function(_0x402f4b,_0x2beec0){return function(_0x4679e8){try{if(!_['isNil'](this[_0xe779('0x8')][_0xe779('0x9')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x402f4b,_0xe779('0xa'));return _0x4679e8[_0xe779('0xb')]();}var _0x5e15eb={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xe779('0xc')),'direction':_0xe779('0xd')};if(this[_0xe779('0xe')]===_0xe779('0xf')||this[_0xe779('0xe')]===_0xe779('0x10')){_0x5e15eb[_0xe779('0x11')]=this[_0xe779('0x8')][_0xe779('0x11')];}var _0x191586=this[_0xe779('0xe')];if(_0x191586==='chat'){_0x5e15eb[_0xe779('0x12')]=this[_0xe779('0x13')]['id'];}else{_0x5e15eb[_[_0xe779('0x14')](_0x191586)+_0xe779('0x15')]=this[_0xe779('0x13')]['id'];}_0x5e15eb[_[_0xe779('0x14')](_0x191586)+_0xe779('0x16')]=this[_0xe779('0x8')]['id'];if(this['interaction'][_0xe779('0x17')]){var _0x18f780=_0x2beec0[0x4];if(!_[_0xe779('0x18')](_0x18f780)){_0x5e15eb[_0xe779('0x19')]=utils['getMustacheRender'](_0x18f780,this);return rpc[_0x191586+_0xe779('0x1a')][_0xe779('0x1b')](_0x5e15eb)[_0xe779('0x1c')](function(_0x23ba48){logger[_0xe779('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x402f4b,_0x5e15eb[_0xe779('0x19')]);})[_0xe779('0x1e')](function(_0xf23bb3){logger[_0xe779('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x402f4b,JSON['stringify'](_0xf23bb3));})[_0xe779('0x20')](function(){logger[_0xe779('0x1d')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x402f4b);_0x4679e8[_0xe779('0x21')]();});}else{logger['info'](_0xe779('0x22'),_0x402f4b);_0x4679e8[_0xe779('0x21')]();}}else{var _0x3a8d0b=this;var _0x3fc2a0=new AWS[(_0xe779('0x23'))]({'accessKeyId':_0x2beec0[0x0],'secretAccessKey':_0x2beec0[0x1],'region':_0x2beec0[0x2]});var _0x5e7abb={'botAlias':_0xe779('0x24'),'botName':_0x2beec0[0x3],'inputText':this[_0xe779('0x25')][_0xe779('0x19')],'userId':this[_0xe779('0xe')]+':'+this['interaction']['id']['toString']()};_0x3fc2a0['postText'](_0x5e7abb,function(_0x3daf35,_0x109d38){if(_0x3daf35){logger['error'](_0xe779('0x26'),_0x402f4b,_0x3daf35[_0xe779('0x25')]);_0x4679e8[_0xe779('0xb')]();}else if(_0x109d38&&_0x109d38[_0xe779('0x25')]){_0x3a8d0b[_0xe779('0x19')][_0xe779('0x27')]=_0x109d38;_0x5e15eb['body']=_0x109d38[_0xe779('0x25')];_0x5e15eb['providerName']=_0xe779('0x27');_0x5e15eb[_0xe779('0x28')]=JSON[_0xe779('0x29')](_0x109d38);return rpc[_0x191586+_0xe779('0x1a')][_0xe779('0x1b')](_0x5e15eb)[_0xe779('0x1c')](function(_0x109b12){logger[_0xe779('0x1d')](_0xe779('0x26'),_0x402f4b,_0x5e15eb[_0xe779('0x19')]);if(_0x109d38[_0xe779('0x2a')]=='Failed'){_0x4679e8[_0xe779('0xb')]();}else{_0x4679e8[_0xe779('0x21')]();}})['catch'](function(_0x231a4f){logger['error'](_0xe779('0x26'),_0x402f4b,JSON[_0xe779('0x29')](_0x231a4f));_0x4679e8[_0xe779('0xb')]();});}else{_0x4679e8['next']();}});}}catch(_0x58a2af){logger[_0xe779('0x1f')](_0xe779('0x26'),_0x402f4b,JSON[_0xe779('0x29')](_0x58a2af));_0x4679e8['stop']();}};}; \ No newline at end of file +var _0x353d=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','amazonlex','providerResponse','stringify','dialogState','Failed','moment','./utils','routing','../../rpc/openchannelMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','then','catch','error','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x353d,0x101));var _0xd353=function(_0x4a6176,_0x509130){_0x4a6176=_0x4a6176-0x0;var _0x50fc8d=_0x353d[_0x4a6176];return _0x50fc8d;};'use strict';var _=require('lodash');var moment=require(_0xd353('0x0'));var AWS=require('aws-sdk');var utils=require(_0xd353('0x1'));var logger=require('../../../../config/logger')(_0xd353('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xd353('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd353('0x4'))};exports[_0xd353('0x5')]=function(_0x11e71e,_0x3b75e7){return function(_0x3359a8){try{if(!_[_0xd353('0x6')](this[_0xd353('0x7')][_0xd353('0x8')])){logger['info'](_0xd353('0x9'),_0x11e71e,_0xd353('0xa'));return _0x3359a8[_0xd353('0xb')]();}var _0x43127a={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xd353('0xc')),'direction':_0xd353('0xd')};if(this[_0xd353('0xe')]===_0xd353('0xf')||this[_0xd353('0xe')]===_0xd353('0x10')){_0x43127a['phone']=this[_0xd353('0x7')]['phone'];}var _0x45318a=this[_0xd353('0xe')];if(_0x45318a===_0xd353('0x11')){_0x43127a[_0xd353('0x12')]=this[_0xd353('0x13')]['id'];}else{_0x43127a[_[_0xd353('0x14')](_0x45318a)+'AccountId']=this[_0xd353('0x13')]['id'];}_0x43127a[_['upperFirst'](_0x45318a)+'InteractionId']=this['interaction']['id'];if(this[_0xd353('0x7')][_0xd353('0x15')]){var _0x144092=_0x3b75e7[0x4];if(!_[_0xd353('0x16')](_0x144092)){_0x43127a[_0xd353('0x17')]=utils['getMustacheRender'](_0x144092,this);return rpc[_0x45318a+'Message']['create'](_0x43127a)[_0xd353('0x18')](function(_0x4fc63e){logger['info'](_0xd353('0x9'),_0x11e71e,_0x43127a['body']);})[_0xd353('0x19')](function(_0x282ab7){logger[_0xd353('0x1a')](_0xd353('0x9'),_0x11e71e,JSON['stringify'](_0x282ab7));})[_0xd353('0x1b')](function(){logger[_0xd353('0x1c')](_0xd353('0x1d'),_0x11e71e);_0x3359a8[_0xd353('0x1e')]();});}else{logger[_0xd353('0x1c')](_0xd353('0x1f'),_0x11e71e);_0x3359a8['stop']();}}else{var _0x9afcd4=this;var _0x25d2a7=new AWS[(_0xd353('0x20'))]({'accessKeyId':_0x3b75e7[0x0],'secretAccessKey':_0x3b75e7[0x1],'region':_0x3b75e7[0x2]});var _0x3d9f24={'botAlias':_0xd353('0x21'),'botName':_0x3b75e7[0x3],'inputText':this[_0xd353('0x22')][_0xd353('0x17')],'userId':this['channel']+':'+this[_0xd353('0x7')]['id'][_0xd353('0x23')]()};_0x25d2a7['postText'](_0x3d9f24,function(_0x577ad9,_0x263558){if(_0x577ad9){logger[_0xd353('0x1a')]('[%s][AMAZONLEX]\x20%s',_0x11e71e,_0x577ad9[_0xd353('0x22')]);_0x3359a8[_0xd353('0xb')]();}else if(_0x263558&&_0x263558[_0xd353('0x22')]){_0x9afcd4[_0xd353('0x17')]['amazonlex']=_0x263558;_0x43127a[_0xd353('0x17')]=_0x263558[_0xd353('0x22')];_0x43127a['providerName']=_0xd353('0x24');_0x43127a[_0xd353('0x25')]=JSON[_0xd353('0x26')](_0x263558);return rpc[_0x45318a+'Message']['create'](_0x43127a)['then'](function(_0x2310ea){logger['info']('[%s][AMAZONLEX]\x20%s',_0x11e71e,_0x43127a[_0xd353('0x17')]);if(_0x263558[_0xd353('0x27')]==_0xd353('0x28')){_0x3359a8[_0xd353('0xb')]();}else{_0x3359a8[_0xd353('0x1e')]();}})[_0xd353('0x19')](function(_0x37ac95){logger['error'](_0xd353('0x9'),_0x11e71e,JSON['stringify'](_0x37ac95));_0x3359a8[_0xd353('0xb')]();});}else{_0x3359a8[_0xd353('0xb')]();}});}}catch(_0x101593){logger[_0xd353('0x1a')](_0xd353('0x9'),_0x11e71e,JSON[_0xd353('0x26')](_0x101593));_0x3359a8[_0xd353('0x1e')]();}};}; \ 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 c847d34..61a5390 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 _0xfe0c=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','messageId','html','','replace','';_0x5d5a2e[_0xcfe0('0x31')]={'Auto-Submitted':_0xcfe0('0x32'),'X-Auto-Response-Suppress':_0xcfe0('0x33'),'Precedence':'auto_reply'};return mailRpc[_0xcfe0('0x34')](this[_0xcfe0('0x26')][_0xcfe0('0x35')],_0x5d5a2e)[_0xcfe0('0x36')](function(_0x1f5829){logger['info'](_0xcfe0('0x37'),_0x2ed311);_0x5d5a2e[_0xcfe0('0x2b')]=_0x1f5829[_0xcfe0('0x1d')][_0xcfe0('0x2b')];return rpc[_0x536f38+_0xcfe0('0x2a')]['create'](_0x5d5a2e);})['then'](function(_0x5e0fa9){logger['info'](_0xcfe0('0x38'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x5e0fa9));})[_0xcfe0('0x3a')](function(_0x49fefa){logger['error'](_0xcfe0('0x3b'),_0x2ed311,JSON['stringify'](_0x49fefa));})['finally'](function(){Promise['resolve']()['then'](function(){if(_0x10c20a[0x0]!=='2'||_0x27eba9['autoreplyExecuted'])return;return rpc[_0x536f38+_0xcfe0('0x3c')][_0xcfe0('0x3d')](_0x27eba9['id'],{'autoreplyExecuted':!![]})[_0xcfe0('0x36')](function(_0x8aa457){logger['info'](_0xcfe0('0x17'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x8aa457));})[_0xcfe0('0x3a')](function(_0x4e0b97){logger[_0xcfe0('0x3e')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2ed311,JSON[_0xcfe0('0x39')](_0x4e0b97));});})[_0xcfe0('0x36')](function(){_0x80f187['next']();});});}else{return rpc[this[_0xcfe0('0xe')]+_0xcfe0('0x2a')][_0xcfe0('0x3f')](_0x5d5a2e)[_0xcfe0('0x36')](function(){logger[_0xcfe0('0x11')](_0xcfe0('0x38'),_0x2ed311,_0x5d5a2e[_0xcfe0('0xf')]);})[_0xcfe0('0x3a')](function(_0x2c4b3e){logger['error'](_0xcfe0('0x38'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x2c4b3e));})['finally'](function(){Promise['resolve']()[_0xcfe0('0x36')](function(){if(_0x10c20a[0x0]!=='2'||_0x27eba9[_0xcfe0('0x40')])return;return rpc[_0x536f38+_0xcfe0('0x3c')][_0xcfe0('0x3d')](_0x27eba9['id'],{'autoreplyExecuted':!![]})[_0xcfe0('0x36')](function(_0x21590a){logger[_0xcfe0('0x11')](_0xcfe0('0x17'),_0x2ed311,JSON['stringify'](_0x21590a));})['catch'](function(_0x4fab09){logger[_0xcfe0('0x3e')](_0xcfe0('0x41'),_0x2ed311,JSON[_0xcfe0('0x39')](_0x4fab09));});})[_0xcfe0('0x36')](function(){_0x80f187[_0xcfe0('0x12')]();});});}}}catch(_0x262b7b){logger['error'](_0xcfe0('0x38'),_0x2ed311,JSON['stringify'](_0x262b7b));_0x80f187[_0xcfe0('0x42')]();}};}; \ No newline at end of file +var _0x55c2=['inReplyTo','messageId','html','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','channel','isAutoreply','[%s][AUTOREPLY]\x20%s','next','isNil','created','interaction','Autoreply\x20already\x20sent','info','format','mail','getMustacheRender','body','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','account','InteractionId'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x55c2,0x188));var _0x255c=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0x55c2[_0x2c1114];return _0x2b877c;};'use strict';var _=require('lodash');var moment=require(_0x255c('0x0'));var utils=require(_0x255c('0x1'));var logger=require(_0x255c('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x255c('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x255c('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x255c('0x5')),'chatInteraction':require(_0x255c('0x6')),'openchannelInteraction':require(_0x255c('0x7')),'mailInteraction':require(_0x255c('0x8')),'smsInteraction':require(_0x255c('0x9')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x255c('0xa'))};var mailRpc=require('../../mailRpc');exports[_0x255c('0xb')]=function(_0x5df1dd,_0x5ef976,_0x22f5de,_0x3aca35){return function(_0x4bd586){try{var _0x1d9320=this[_0x255c('0xc')];if(_0x1d9320==='mail'&&_0x3aca35['body'][_0x255c('0xd')]){logger['info'](_0x255c('0xe'),_0x5df1dd,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x4bd586[_0x255c('0xf')]();}if(_0x5ef976[0x0]==='1'&&(_[_0x255c('0x10')](this['interaction'][_0x255c('0x11')])||!this[_0x255c('0x12')][_0x255c('0x11')])){logger['info'](_0x255c('0xe'),_0x5df1dd,_0x255c('0x13'));return _0x4bd586[_0x255c('0xf')]();}if(_0x5ef976[0x0]==='2'&&this[_0x255c('0x12')]['autoreplyExecuted']){logger[_0x255c('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5df1dd,'One\x20Time\x20already\x20sent');return _0x4bd586[_0x255c('0xf')]();}var _0xcf32c0={'ContactId':this['contact']['id'],'sentAt':moment()[_0x255c('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x255c('0xc')]===_0x255c('0x16')){_0xcf32c0['body']=utils[_0x255c('0x17')](_0x5ef976[0x2],this);}else{_0xcf32c0[_0x255c('0x18')]=utils['getMustacheRender'](_0x5ef976[0x1],this);}if(this['message']){_0xcf32c0['to']=this[_0x255c('0x19')]['from']||'';if(this[_0x255c('0xc')]===_0x255c('0x16')&&_0x5ef976[0x1]==='1'){_0xcf32c0['cc']=this[_0x255c('0x19')]['cc']||'';}_0xcf32c0[_0x255c('0x1a')]=this[_0x255c('0x19')]['to']||'';_0xcf32c0[_0x255c('0x1b')]=this[_0x255c('0x19')][_0x255c('0x1b')]||'';_0xcf32c0[_0x255c('0x1c')]=!![];if(this[_0x255c('0x19')]['subject']){_0xcf32c0[_0x255c('0x1d')]='';_0xcf32c0['subject']+=_['startsWith'](this['message'][_0x255c('0x1d')],_0x255c('0x1e'))?'':_0x255c('0x1f');_0xcf32c0[_0x255c('0x1d')]+=this['message'][_0x255c('0x1d')];}}if(this[_0x255c('0xc')]==='chat'){_0xcf32c0[_0x255c('0x20')]=this[_0x255c('0x21')]['id'];}else{_0xcf32c0[_['upperFirst'](this[_0x255c('0xc')])+'AccountId']=this[_0x255c('0x21')]['id'];}_0xcf32c0[_['upperFirst'](this['channel'])+_0x255c('0x22')]=this[_0x255c('0x12')]['id'];var _0x2047b8=this[_0x255c('0x12')];if(rpc[this[_0x255c('0xc')]+'Message']){if(this['channel']===_0x255c('0x16')){_0xcf32c0[_0x255c('0x23')]=this[_0x255c('0x19')][_0x255c('0x24')];_0xcf32c0[_0x255c('0x25')]=''+_[_0x255c('0x26')](_0xcf32c0['body'],']+(>|$)/g,''),'priorityTrue':_0x5a6d3c[0x1],'priorityFalse':_0x5a6d3c[0x2]};var _0x466303=gotoif['validate'](_0x17b6b8,{'typecast':!![]});if(_0x466303[_0xdde9('0xa')]){logger[_0xdde9('0xb')](_0xdde9('0xc'),_0x14baf8,_[_0xdde9('0xd')](_0x466303,_0xdde9('0xe'))[_0xdde9('0xf')](',\x20'));_0xc89050[_0xdde9('0x10')]();}else{try{var _0x150887=eval('('+_0x17b6b8['condition']+')');var _0x547159=_0x150887?_0x17b6b8['priorityTrue']:_0x17b6b8[_0xdde9('0x11')];logger['info'](_0xdde9('0x12'),_0x14baf8,_0x17b6b8[_0xdde9('0x13')],_0x150887,_0x547159||_0xdde9('0x14'));if(_0x547159){var _0x4c51e6=_[_0xdde9('0x15')](_0xc89050[_0xdde9('0x16')](),{'p':_0x547159});if(_0x4c51e6>=0x0){logger[_0xdde9('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x14baf8,_0x547159||_0xdde9('0x14'),_0x4c51e6);_0xc89050[_0xdde9('0x14')](_0x4c51e6);}else{logger[_0xdde9('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x14baf8,_0x547159||_0xdde9('0x14'));_0xc89050[_0xdde9('0x10')]();}}else{_0xc89050[_0xdde9('0x14')]();}}catch(_0x2899e6){logger[_0xdde9('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x14baf8,_0x2899e6['message']);_0xc89050['stop']();}}}catch(_0xe242a9){logger['error'](_0xdde9('0xc'),_0x14baf8,JSON['stringify'](_0xe242a9));_0xc89050[_0xdde9('0x10')]();}};}; \ No newline at end of file +var _0xa0ca=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text'];(function(_0x559aa4,_0x2a8b5b){var _0x46af01=function(_0x187999){while(--_0x187999){_0x559aa4['push'](_0x559aa4['shift']());}};_0x46af01(++_0x2a8b5b);}(_0xa0ca,0xe7));var _0xaa0c=function(_0x162252,_0x103380){_0x162252=_0x162252-0x0;var _0x44785b=_0xa0ca[_0x162252];return _0x44785b;};'use strict';var schema=require(_0xaa0c('0x0'));var _=require(_0xaa0c('0x1'));var htmlToText=require(_0xaa0c('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xaa0c('0x3')},'priorityTrue':{'type':_0xaa0c('0x4'),'message':_0xaa0c('0x5')},'priorityFalse':{'type':_0xaa0c('0x4'),'message':_0xaa0c('0x6')}});exports[_0xaa0c('0x7')]=function(_0x3604db,_0x385d60){return function(_0x2b46ac){try{var _0x4514f3={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x385d60[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x385d60[0x1],'priorityFalse':_0x385d60[0x2]};var _0x2d4c92=gotoif[_0xaa0c('0x0')](_0x4514f3,{'typecast':!![]});if(_0x2d4c92[_0xaa0c('0x8')]){logger[_0xaa0c('0x9')](_0xaa0c('0xa'),_0x3604db,_[_0xaa0c('0xb')](_0x2d4c92,'message')[_0xaa0c('0xc')](',\x20'));_0x2b46ac[_0xaa0c('0xd')]();}else{try{var _0x3fbf45=eval('('+_0x4514f3[_0xaa0c('0xe')]+')');var _0x294086=_0x3fbf45?_0x4514f3[_0xaa0c('0xf')]:_0x4514f3[_0xaa0c('0x10')];logger[_0xaa0c('0x11')](_0xaa0c('0x12'),_0x3604db,_0x4514f3[_0xaa0c('0xe')],_0x3fbf45,_0x294086||_0xaa0c('0x13'));if(_0x294086){var _0x323f4c=_['findIndex'](_0x2b46ac[_0xaa0c('0x14')](),{'p':_0x294086});if(_0x323f4c>=0x0){logger['info'](_0xaa0c('0x15'),_0x3604db,_0x294086||_0xaa0c('0x13'),_0x323f4c);_0x2b46ac[_0xaa0c('0x13')](_0x323f4c);}else{logger['info'](_0xaa0c('0x16'),_0x3604db,_0x294086||'next');_0x2b46ac[_0xaa0c('0xd')]();}}else{_0x2b46ac[_0xaa0c('0x13')]();}}catch(_0x21ef2d){logger[_0xaa0c('0x9')](_0xaa0c('0x17'),_0x3604db,_0x21ef2d[_0xaa0c('0x18')]);_0x2b46ac[_0xaa0c('0xd')]();}}}catch(_0xa18446){logger[_0xaa0c('0x9')](_0xaa0c('0xa'),_0x3604db,JSON[_0xaa0c('0x19')](_0xa18446));_0x2b46ac[_0xaa0c('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 2a7af1d..400374c 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 _0x97be=['[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','map','join','stop','info'];(function(_0x48e612,_0x1f04a8){var _0x40681f=function(_0x27d926){while(--_0x27d926){_0x48e612['push'](_0x48e612['shift']());}};_0x40681f(++_0x1f04a8);}(_0x97be,0x14b));var _0xe97b=function(_0x2b6ab2,_0x530aa5){_0x2b6ab2=_0x2b6ab2-0x0;var _0x48ecb9=_0x97be[_0x2b6ab2];return _0x48ecb9;};'use strict';var schema=require(_0xe97b('0x0'));var _=require('lodash');var logger=require(_0xe97b('0x1'))(_0xe97b('0x2'));var gotop=schema({'priority':{'type':_0xe97b('0x3'),'required':!![],'message':_0xe97b('0x4')}});exports['consequence']=function(_0x1211ce,_0x2ea71d){return function(_0x26819b){try{var _0x5e60c8={'priority':_0x2ea71d[0x0]};var _0x5e4707=gotop[_0xe97b('0x0')](_0x5e60c8,{'typecast':!![]});if(_0x5e4707[_0xe97b('0x5')]){logger[_0xe97b('0x6')]('[%s][GOTOP]\x20%s',_0x1211ce,_[_0xe97b('0x7')](_0x5e4707,'message')[_0xe97b('0x8')](',\x20'));_0x26819b[_0xe97b('0x9')]();}else{logger[_0xe97b('0xa')](_0xe97b('0xb'),_0x1211ce,_0x5e60c8[_0xe97b('0xc')]);if(_0x5e60c8[_0xe97b('0xc')]){var _0x3f9cac=_[_0xe97b('0xd')](_0x26819b[_0xe97b('0xe')](),{'p':_0x5e60c8[_0xe97b('0xc')]});if(_0x3f9cac>=0x0){logger[_0xe97b('0xa')](_0xe97b('0xf'),_0x1211ce,_0x5e60c8[_0xe97b('0xc')]||'next',_0x3f9cac);_0x26819b[_0xe97b('0x10')](_0x3f9cac);}else{logger[_0xe97b('0xa')](_0xe97b('0x11'),_0x1211ce,_0x5e60c8['priority']||_0xe97b('0x10'));_0x26819b[_0xe97b('0x9')]();}}else{_0x26819b['next']();}}}catch(_0x467a86){logger[_0xe97b('0x6')]('[%s][GOTOP]\x20%s',_0x1211ce,JSON['stringify'](_0x467a86));_0x26819b[_0xe97b('0x9')]();}};}; \ No newline at end of file +var _0x9d39=['[%s][GOTOP]\x20%s','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error'];(function(_0x48bd66,_0x5bae26){var _0x510d04=function(_0x35428d){while(--_0x35428d){_0x48bd66['push'](_0x48bd66['shift']());}};_0x510d04(++_0x5bae26);}(_0x9d39,0x84));var _0x99d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9d39[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require(_0x99d3('0x0'));var _=require(_0x99d3('0x1'));var logger=require(_0x99d3('0x2'))(_0x99d3('0x3'));var gotop=schema({'priority':{'type':_0x99d3('0x4'),'required':!![],'message':_0x99d3('0x5')}});exports['consequence']=function(_0x5c624e,_0x4285cc){return function(_0x188d66){try{var _0x36898d={'priority':_0x4285cc[0x0]};var _0xe54b99=gotop['validate'](_0x36898d,{'typecast':!![]});if(_0xe54b99[_0x99d3('0x6')]){logger[_0x99d3('0x7')](_0x99d3('0x8'),_0x5c624e,_['map'](_0xe54b99,_0x99d3('0x9'))[_0x99d3('0xa')](',\x20'));_0x188d66['stop']();}else{logger[_0x99d3('0xb')](_0x99d3('0xc'),_0x5c624e,_0x36898d[_0x99d3('0xd')]);if(_0x36898d['priority']){var _0x389ede=_[_0x99d3('0xe')](_0x188d66[_0x99d3('0xf')](),{'p':_0x36898d[_0x99d3('0xd')]});if(_0x389ede>=0x0){logger[_0x99d3('0xb')](_0x99d3('0x10'),_0x5c624e,_0x36898d[_0x99d3('0xd')]||_0x99d3('0x11'),_0x389ede);_0x188d66['next'](_0x389ede);}else{logger[_0x99d3('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5c624e,_0x36898d[_0x99d3('0xd')]||_0x99d3('0x11'));_0x188d66[_0x99d3('0x12')]();}}else{_0x188d66[_0x99d3('0x11')]();}}}catch(_0x5d9502){logger[_0x99d3('0x7')](_0x99d3('0x8'),_0x5c624e,JSON[_0x99d3('0x13')](_0x5d9502));_0x188d66[_0x99d3('0x12')]();}};}; \ 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 8dfaca5..4e26826 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 _0xaeaa=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','info','[%s][MESSAGE]\x20%s','body','catch','error','stop','stringify'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xaeaa,0xf3));var _0xaaea=function(_0x360939,_0x29a94d){_0x360939=_0x360939-0x0;var _0x2a3366=_0xaeaa[_0x360939];return _0x2a3366;};'use strict';var _=require('lodash');var utils=require(_0xaaea('0x0'));var logger=require(_0xaaea('0x1'))(_0xaaea('0x2'));var rpc={'chatMessage':require(_0xaaea('0x3')),'openchannelMessage':require(_0xaaea('0x4')),'mailMessage':require(_0xaaea('0x5')),'smsMessage':require(_0xaaea('0x6')),'faxMessage':require(_0xaaea('0x7')),'whatsappMessage':require(_0xaaea('0x8'))};exports[_0xaaea('0x9')]=function(_0x18c591,_0x4390fd){return function(_0x132bd5){try{var _0x1e0ba3={'body':utils[_0xaaea('0xa')](_0x4390fd[0x0],this),'ContactId':this[_0xaaea('0xb')]['id']};if(this[_0xaaea('0xc')]===_0xaaea('0xd')){_0x1e0ba3[_0xaaea('0xe')]=this[_0xaaea('0xf')]['id'];}else{_0x1e0ba3[_[_0xaaea('0x10')](this[_0xaaea('0xc')])+_0xaaea('0x11')]=this[_0xaaea('0xf')]['id'];}_0x1e0ba3[_[_0xaaea('0x10')](this[_0xaaea('0xc')])+_0xaaea('0x12')]=this['interaction']['id'];if(rpc[this[_0xaaea('0xc')]+_0xaaea('0x13')]){return rpc[this['channel']+_0xaaea('0x13')]['create'](_0x1e0ba3)['then'](function(_0x162dd8){logger[_0xaaea('0x14')](_0xaaea('0x15'),_0x18c591,_0x1e0ba3[_0xaaea('0x16')]);_0x132bd5['next']();})[_0xaaea('0x17')](function(_0x19ddc1){logger[_0xaaea('0x18')]('[%s][MESSAGE]\x20%s',_0x18c591,JSON['stringify'](_0x19ddc1));_0x132bd5[_0xaaea('0x19')]();});}}catch(_0x24f949){logger[_0xaaea('0x18')]('[%s][MESSAGE]\x20%s',_0x18c591,JSON[_0xaaea('0x1a')](_0x24f949));_0x132bd5[_0xaaea('0x19')]();}};}; \ No newline at end of file +var _0x1e7b=['error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','body','next','catch'];(function(_0x5b9888,_0x2f741f){var _0x1659e6=function(_0x3a1988){while(--_0x3a1988){_0x5b9888['push'](_0x5b9888['shift']());}};_0x1659e6(++_0x2f741f);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x1317ed,_0x57217d){_0x1317ed=_0x1317ed-0x0;var _0xbaeca=_0x1e7b[_0x1317ed];return _0xbaeca;};'use strict';var _=require(_0xb1e7('0x0'));var utils=require(_0xb1e7('0x1'));var logger=require('../../../../config/logger')(_0xb1e7('0x2'));var rpc={'chatMessage':require(_0xb1e7('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb1e7('0x4')),'smsMessage':require(_0xb1e7('0x5')),'faxMessage':require(_0xb1e7('0x6')),'whatsappMessage':require(_0xb1e7('0x7'))};exports['consequence']=function(_0x1b473f,_0x2f733c){return function(_0x3bc43b){try{var _0x35c43c={'body':utils[_0xb1e7('0x8')](_0x2f733c[0x0],this),'ContactId':this['contact']['id']};if(this[_0xb1e7('0x9')]===_0xb1e7('0xa')){_0x35c43c[_0xb1e7('0xb')]=this[_0xb1e7('0xc')]['id'];}else{_0x35c43c[_[_0xb1e7('0xd')](this[_0xb1e7('0x9')])+_0xb1e7('0xe')]=this[_0xb1e7('0xc')]['id'];}_0x35c43c[_[_0xb1e7('0xd')](this[_0xb1e7('0x9')])+_0xb1e7('0xf')]=this[_0xb1e7('0x10')]['id'];if(rpc[this[_0xb1e7('0x9')]+_0xb1e7('0x11')]){return rpc[this[_0xb1e7('0x9')]+'Message']['create'](_0x35c43c)[_0xb1e7('0x12')](function(_0x1e943d){logger[_0xb1e7('0x13')]('[%s][MESSAGE]\x20%s',_0x1b473f,_0x35c43c[_0xb1e7('0x14')]);_0x3bc43b[_0xb1e7('0x15')]();})[_0xb1e7('0x16')](function(_0x4e1343){logger[_0xb1e7('0x17')](_0xb1e7('0x18'),_0x1b473f,JSON[_0xb1e7('0x19')](_0x4e1343));_0x3bc43b['stop']();});}}catch(_0x409fcd){logger[_0xb1e7('0x17')](_0xb1e7('0x18'),_0x1b473f,JSON[_0xb1e7('0x19')](_0x409fcd));_0x3bc43b[_0xb1e7('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 0dc3001..5b387da 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 _0x03db=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','next','error','stop','./utils'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x03db,0x1dc));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xb03d('0x0'));var logger=require(_0xb03d('0x1'))(_0xb03d('0x2'));exports[_0xb03d('0x3')]=function(_0x34d0ba,_0x5680f4){return function(_0x29930b){try{logger[_0xb03d('0x4')](_0xb03d('0x5'),_0x34d0ba,utils['getMustacheRender'](_0x5680f4[0x0],this));_0x29930b[_0xb03d('0x6')]();}catch(_0x35dc87){logger[_0xb03d('0x7')](_0xb03d('0x5'),_0x34d0ba,JSON['stringify'](_0x35dc87));_0x29930b[_0xb03d('0x8')]();}};}; \ No newline at end of file +var _0x6075=['getMustacheRender','error','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6075,0x191));var _0x5607=function(_0x2dedd0,_0x6a437a){_0x2dedd0=_0x2dedd0-0x0;var _0x3a29f4=_0x6075[_0x2dedd0];return _0x3a29f4;};'use strict';var utils=require('./utils');var logger=require(_0x5607('0x0'))(_0x5607('0x1'));exports[_0x5607('0x2')]=function(_0x24427f,_0x2bcf4e){return function(_0x120ba2){try{logger[_0x5607('0x3')](_0x5607('0x4'),_0x24427f,utils[_0x5607('0x5')](_0x2bcf4e[0x0],this));_0x120ba2['next']();}catch(_0x1f4637){logger[_0x5607('0x6')](_0x5607('0x4'),_0x24427f,JSON['stringify'](_0x1f4637));_0x120ba2['stop']();}};}; \ 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 7e4ee21..98a1233 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 _0x1f38=['complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','[%s][QUEUE]\x20%s','map','stop','find','Queues','timeout','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x1c7ced,_0x23f7d5){var _0x1000b8=function(_0x5a994b){while(--_0x5a994b){_0x1c7ced['push'](_0x1c7ced['shift']());}};_0x1000b8(++_0x23f7d5);}(_0x1f38,0x192));var _0x81f3=function(_0x1ee358,_0x42fdfb){_0x1ee358=_0x1ee358-0x0;var _0x4d01b9=_0x1f38[_0x1ee358];return _0x4d01b9;};'use strict';var schema=require('validate');var _=require(_0x81f3('0x0'));var util=require(_0x81f3('0x1'));var seqqueue=require(_0x81f3('0x2'));var moment=require(_0x81f3('0x3'));var Redis=require(_0x81f3('0x4'));var config=require('../../../../config/environment');var logger=require(_0x81f3('0x5'))(_0x81f3('0x6'));var strategy=require('./strategy');config[_0x81f3('0x7')]=_[_0x81f3('0x8')](config[_0x81f3('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x81f3('0x9'))(new Redis(config['redis']));var attributes=['id',_0x81f3('0xa'),_0x81f3('0xb'),_0x81f3('0xc'),_0x81f3('0xd'),_0x81f3('0xe')];function emit(_0x4dd0c,_0x48ca8f,_0x13dcf7){io['to'](_0x4dd0c)[_0x81f3('0xf')](_0x48ca8f,_0x13dcf7);}function emitChannelQueueInteraction(_0x55206e,_0x544bc4,_0x5002e6,_0x263be9,_0x5084d5,_0x1402aa,_0x55d05a,_0x55044d){var _0x53b1a2=_['clone'](_0x5002e6);_0x53b1a2['queue_id']=_0x55044d;_0x53b1a2['queue']=_0x544bc4;_0x53b1a2['account']=_0x263be9;_0x53b1a2['id']=_0x5084d5;if(_0x1402aa){_0x55d05a[util[_0x81f3('0x10')]('%sQueuesWaitingInteractions',_0x55206e)][_0x5084d5]=_[_0x81f3('0x11')](_0x53b1a2,attributes);}else{delete _0x55d05a[util[_0x81f3('0x10')](_0x81f3('0x12'),_0x55206e)][_0x5084d5];}emit(util[_0x81f3('0x10')](_0x81f3('0x13'),_0x55206e,_0x544bc4),util['format'](_0x81f3('0x14'),_0x55206e,_0x1402aa?'save':_0x81f3('0x15')),_['pick'](_0x53b1a2,attributes));}var rpc={'openchannelQueueReport':require(_0x81f3('0x16')),'mailQueueReport':require(_0x81f3('0x17')),'chatQueueReport':require(_0x81f3('0x18')),'smsQueueReport':require(_0x81f3('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x81f3('0x1a'))};var queue=schema({'name':{'type':_0x81f3('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x81f3('0x1c'),'message':_0x81f3('0x1d')}});function startRouting(_0xbbe1ea,_0x4b8af5,_0x4a4a77,_0x2a12ea){if(_0xbbe1ea&&_0x4b8af5&&_0x4a4a77){_0x4b8af5[_0x81f3('0x1e')]+=0x1;var _0x2ddf6f={'uniqueid':_0xbbe1ea,'from':_0x4a4a77['body']?_0x4a4a77['body'][_0x81f3('0xd')]:'','joinAt':moment()['format'](_0x81f3('0x1f')),'ContactId':_0x4a4a77[_0x81f3('0x20')]?_0x4a4a77['contact']['id']:null,'ListId':_0x4a4a77[_0x81f3('0x21')]?_0x4a4a77[_0x81f3('0x21')]['id']:null};_0x2ddf6f[_[_0x81f3('0x22')](_0x4a4a77[_0x81f3('0x23')])+_0x81f3('0x24')]=_0x4b8af5['id']||null;_0x2ddf6f[_[_0x81f3('0x22')](_0x4a4a77[_0x81f3('0x23')])+_0x81f3('0x25')]=_0x4a4a77[_0x81f3('0x26')]?_0x4a4a77[_0x81f3('0x26')]['id']:null;_0x2ddf6f[_['upperFirst'](_0x4a4a77[_0x81f3('0x23')])+_0x81f3('0x27')]=_0x4a4a77['message']?_0x4a4a77[_0x81f3('0x28')]['id']:null;_0x2ddf6f[_[_0x81f3('0x22')](_0x4a4a77[_0x81f3('0x23')])+(_0x4a4a77[_0x81f3('0x23')]!==_0x81f3('0x29')?'AccountId':_0x81f3('0x2a'))]=_0x4a4a77['account']?_0x4a4a77['account']['id']:null;logger[_0x81f3('0x2b')](util['format'](_0x81f3('0x2c'),_0xbbe1ea,_0x4b8af5['name']));emitChannelQueueInteraction(_0x4a4a77[_0x81f3('0x23')],_0x4b8af5[_0x81f3('0x2d')],_0x2ddf6f,_0x4a4a77[_0x81f3('0xb')][_0x81f3('0x2d')],_0x4a4a77[_0x81f3('0x28')]['id'],!![],_0x2a12ea,_0x4b8af5['id']);if(rpc[_0x4a4a77['channel']+_0x81f3('0x2e')]){return rpc[_0x4a4a77['channel']+_0x81f3('0x2e')][_0x81f3('0x2f')](_0x2ddf6f)[_0x81f3('0x30')](function(_0x23dcce){logger[_0x81f3('0x31')](_0x81f3('0x32'));});}}}function stopRouting(_0x10c22b,_0x471e3e,_0x170c6c,_0x3183cb){if(_0x10c22b&&_0x471e3e){_0x471e3e['waiting']-=0x1;var _0x4ee300={'leaveAt':moment()['format'](_0x81f3('0x1f')),'acceptAt':moment()[_0x81f3('0x10')](_0x81f3('0x1f')),'reason':_0x81f3('0x33')};logger[_0x81f3('0x2b')](util[_0x81f3('0x10')](_0x81f3('0x34'),_0x10c22b,_0x471e3e[_0x81f3('0x2d')]));emitChannelQueueInteraction(_0x170c6c[_0x81f3('0x23')],_0x471e3e[_0x81f3('0x2d')],_0x170c6c[_0x81f3('0x35')],_0x170c6c['account']['name'],_0x170c6c[_0x81f3('0x28')]['id'],![],_0x3183cb,_0x471e3e['id']);if(rpc[_0x170c6c['channel']+'QueueReport']){return rpc[_0x170c6c[_0x81f3('0x23')]+_0x81f3('0x2e')][_0x81f3('0x36')](_0x10c22b,_0x4ee300)[_0x81f3('0x30')](function(_0x12d9ce){logger[_0x81f3('0x31')](_0x81f3('0x37'));});}}}function endRouting(_0x3a709d,_0x1d8aa3,_0x53d786,_0x311c82){if(_0x3a709d&&_0x1d8aa3){_0x1d8aa3['waiting']-=0x1;var _0x53c710={'leaveAt':moment()[_0x81f3('0x10')](_0x81f3('0x1f')),'exitAt':moment()[_0x81f3('0x10')](_0x81f3('0x1f')),'reason':'timeout'};logger[_0x81f3('0x2b')](util[_0x81f3('0x10')](_0x81f3('0x38'),_0x3a709d,_0x1d8aa3[_0x81f3('0x2d')]));emitChannelQueueInteraction(_0x53d786[_0x81f3('0x23')],_0x1d8aa3[_0x81f3('0x2d')],_0x53d786[_0x81f3('0x35')],_0x53d786[_0x81f3('0xb')]['name'],_0x53d786[_0x81f3('0x28')]['id'],![],_0x311c82);if(rpc[_0x53d786[_0x81f3('0x23')]+_0x81f3('0x2e')]){return rpc[_0x53d786[_0x81f3('0x23')]+_0x81f3('0x2e')]['update'](_0x3a709d,_0x53c710)[_0x81f3('0x30')](function(_0x2d4b52){logger[_0x81f3('0x31')](_0x81f3('0x37'));});}}}function handleFindQueue(_0x5966a7){return function(_0xece5d4){return _0xece5d4[_0x81f3('0x2d')][_0x81f3('0x39')]()===_0x5966a7[_0x81f3('0x39')]();};}exports[_0x81f3('0x3a')]=function(_0x1f1282,_0x1ee9a3,_0x43e8c2,_0x25f4b2){return function(_0x25d24f){try{var _0x4f903a={'name':_0x1ee9a3[0x0],'timeout':_0x1ee9a3[0x1]};var _0x2ada45=queue[_0x81f3('0x3b')](_0x4f903a,{'typecast':!![]});if(_0x2ada45['length']){logger[_0x81f3('0x31')](_0x81f3('0x3c'),_0x1f1282,_[_0x81f3('0x3d')](_0x2ada45,_0x81f3('0x28'))['join'](',\x20'));_0x25d24f[_0x81f3('0x3e')]();}else{var _0x16fd08=_[_0x81f3('0x3f')](_0x43e8c2[_0x25f4b2[_0x81f3('0x23')]+_0x81f3('0x40')],handleFindQueue(_0x4f903a[_0x81f3('0x2d')]));if(_0x16fd08){startRouting(_0x1f1282,_0x16fd08,_0x25f4b2,_0x43e8c2);var _0x47f140=(_0x16fd08[_0x81f3('0x41')]||0xa)*0x3e8;var _0x239238=(_0x4f903a[_0x81f3('0x41')]||0x14)*0x3e8;var _0x4cefcb,_0x4770fd;if(_0x47f140>_0x239238){_0x239238=_0x47f140;}var _0x1f9de9=seqqueue['createQueue'](_0x47f140);_0x1f9de9['id']=_0x1f1282;_0x1f9de9[_0x81f3('0x42')]=_0x47f140;_0x1f9de9[_0x81f3('0x43')]=_0x239238;_0x1f9de9[_0x81f3('0x23')]=_0x25f4b2[_0x81f3('0x23')];_0x43e8c2[_0x81f3('0x44')][_0x1f1282]['on'](_0x81f3('0x45'),function(){logger[_0x81f3('0x2b')](_0x81f3('0x46'),_0x1f1282);stopRouting(_0x1f1282,_0x16fd08,_0x25f4b2,_0x43e8c2);clearTimeout(_0x4cefcb);_0x4cefcb=undefined;_0x1f9de9[_0x81f3('0x47')](!![]);if(_0x43e8c2[_0x81f3('0x44')][_0x1f1282]){delete _0x43e8c2[_0x81f3('0x44')][_0x1f1282];}_0x25d24f[_0x81f3('0x3e')]();});_0x43e8c2[_0x81f3('0x44')][_0x1f1282]['on'](_0x81f3('0x48'),function(){if(_0x43e8c2[_0x81f3('0x44')][_0x1f1282]){delete _0x43e8c2[_0x81f3('0x44')][_0x1f1282];}});_0x4cefcb=setTimeout(function(){logger['info'](_0x81f3('0x49'),_0x1f1282);endRouting(_0x1f1282,_0x16fd08,_0x25f4b2,_0x43e8c2);clearTimeout(_0x4cefcb);_0x1f9de9[_0x81f3('0x47')](!![]);_0x25d24f[_0x81f3('0x4a')]();},_0x239238);switch(_0x16fd08[_0x81f3('0x4b')]){case _0x81f3('0x4c'):strategy[_0x81f3('0x4c')](_0x1f9de9,_0x16fd08,_0x43e8c2,_0x25f4b2);break;default:strategy['beepall'](_0x1f9de9,_0x16fd08,_0x43e8c2,_0x25f4b2);}}else{logger[_0x81f3('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1f1282,_0x4f903a[_0x81f3('0x2d')]);_0x25d24f[_0x81f3('0x3e')]();}}}catch(_0x416997){console[_0x81f3('0x4d')](_0x416997);logger[_0x81f3('0x31')](_0x81f3('0x3c'),_0x1f1282,_0x416997[_0x81f3('0x4e')]);_0x25d24f[_0x81f3('0x3e')]();}};}; \ No newline at end of file +var _0xf131=['strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','joinAt','account','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','stop','find','timeout','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next'];(function(_0x1712cd,_0x2dcca7){var _0x262485=function(_0x3c2fb9){while(--_0x3c2fb9){_0x1712cd['push'](_0x1712cd['shift']());}};_0x262485(++_0x2dcca7);}(_0xf131,0x19d));var _0x1f13=function(_0x17d85e,_0x2e96b9){_0x17d85e=_0x17d85e-0x0;var _0x1e13a9=_0xf131[_0x17d85e];return _0x1e13a9;};'use strict';var schema=require(_0x1f13('0x0'));var _=require(_0x1f13('0x1'));var util=require('util');var seqqueue=require(_0x1f13('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x1f13('0x3'))('routing');var strategy=require(_0x1f13('0x4'));config[_0x1f13('0x5')]=_[_0x1f13('0x6')](config['redis'],{'host':_0x1f13('0x7'),'port':0x18eb});var io=require(_0x1f13('0x8'))(new Redis(config['redis']));var attributes=['id',_0x1f13('0x9'),'account','queue','from',_0x1f13('0xa')];function emit(_0x5517d7,_0x46b3d0,_0x21eab7){io['to'](_0x5517d7)['emit'](_0x46b3d0,_0x21eab7);}function emitChannelQueueInteraction(_0x4911e2,_0x1f9783,_0xe8ddc3,_0x261e36,_0x371540,_0x119a90,_0x57822a,_0xdd88d9){var _0x5183c0=_['clone'](_0xe8ddc3);_0x5183c0[_0x1f13('0x9')]=_0xdd88d9;_0x5183c0['queue']=_0x1f9783;_0x5183c0[_0x1f13('0xb')]=_0x261e36;_0x5183c0['id']=_0x371540;if(_0x119a90){_0x57822a[util['format'](_0x1f13('0xc'),_0x4911e2)][_0x371540]=_[_0x1f13('0xd')](_0x5183c0,attributes);}else{delete _0x57822a[util[_0x1f13('0xe')](_0x1f13('0xc'),_0x4911e2)][_0x371540];}emit(util[_0x1f13('0xe')](_0x1f13('0xf'),_0x4911e2,_0x1f9783),util['format']('%s_queue_waiting_interaction:%s',_0x4911e2,_0x119a90?_0x1f13('0x10'):'remove'),_[_0x1f13('0xd')](_0x5183c0,attributes));}var rpc={'openchannelQueueReport':require(_0x1f13('0x11')),'mailQueueReport':require(_0x1f13('0x12')),'chatQueueReport':require(_0x1f13('0x13')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x1f13('0x14')),'whatsappQueueReport':require(_0x1f13('0x15'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x1f13('0x16')},'timeout':{'type':_0x1f13('0x17'),'message':_0x1f13('0x18')}});function startRouting(_0x33b6cf,_0x4f737b,_0x1cf1dc,_0x48a148){if(_0x33b6cf&&_0x4f737b&&_0x1cf1dc){_0x4f737b[_0x1f13('0x19')]+=0x1;var _0x1b795a={'uniqueid':_0x33b6cf,'from':_0x1cf1dc[_0x1f13('0x1a')]?_0x1cf1dc[_0x1f13('0x1a')][_0x1f13('0x1b')]:'','joinAt':moment()[_0x1f13('0xe')](_0x1f13('0x1c')),'ContactId':_0x1cf1dc[_0x1f13('0x1d')]?_0x1cf1dc[_0x1f13('0x1d')]['id']:null,'ListId':_0x1cf1dc[_0x1f13('0x1e')]?_0x1cf1dc[_0x1f13('0x1e')]['id']:null};_0x1b795a[_[_0x1f13('0x1f')](_0x1cf1dc[_0x1f13('0x20')])+'QueueId']=_0x4f737b['id']||null;_0x1b795a[_['upperFirst'](_0x1cf1dc['channel'])+_0x1f13('0x21')]=_0x1cf1dc[_0x1f13('0x22')]?_0x1cf1dc['interaction']['id']:null;_0x1b795a[_[_0x1f13('0x1f')](_0x1cf1dc[_0x1f13('0x20')])+_0x1f13('0x23')]=_0x1cf1dc[_0x1f13('0x24')]?_0x1cf1dc['message']['id']:null;_0x1b795a[_[_0x1f13('0x1f')](_0x1cf1dc[_0x1f13('0x20')])+(_0x1cf1dc[_0x1f13('0x20')]!==_0x1f13('0x25')?'AccountId':'WebsiteId')]=_0x1cf1dc['account']?_0x1cf1dc[_0x1f13('0xb')]['id']:null;logger[_0x1f13('0x26')](util[_0x1f13('0xe')](_0x1f13('0x27'),_0x33b6cf,_0x4f737b['name']));emitChannelQueueInteraction(_0x1cf1dc['channel'],_0x4f737b[_0x1f13('0x28')],_0x1b795a,_0x1cf1dc[_0x1f13('0xb')][_0x1f13('0x28')],_0x1cf1dc[_0x1f13('0x24')]['id'],!![],_0x48a148,_0x4f737b['id']);if(rpc[_0x1cf1dc[_0x1f13('0x20')]+'QueueReport']){return rpc[_0x1cf1dc[_0x1f13('0x20')]+_0x1f13('0x29')][_0x1f13('0x2a')](_0x1b795a)[_0x1f13('0x2b')](function(_0x999dc2){logger[_0x1f13('0x2c')]('create\x20queue\x20report');});}}}function stopRouting(_0x2eb22e,_0x1ebb4d,_0x1e3849,_0x4dd25f){if(_0x2eb22e&&_0x1ebb4d){_0x1ebb4d[_0x1f13('0x19')]-=0x1;var _0x165521={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x1f13('0xe')](_0x1f13('0x1c')),'reason':'accepted'};logger[_0x1f13('0x26')](util['format'](_0x1f13('0x2d'),_0x2eb22e,_0x1ebb4d[_0x1f13('0x28')]));emitChannelQueueInteraction(_0x1e3849[_0x1f13('0x20')],_0x1ebb4d['name'],_0x1e3849[_0x1f13('0x1a')],_0x1e3849[_0x1f13('0xb')][_0x1f13('0x28')],_0x1e3849[_0x1f13('0x24')]['id'],![],_0x4dd25f,_0x1ebb4d['id']);if(rpc[_0x1e3849[_0x1f13('0x20')]+_0x1f13('0x29')]){return rpc[_0x1e3849['channel']+_0x1f13('0x29')]['update'](_0x2eb22e,_0x165521)[_0x1f13('0x2b')](function(_0xae015f){logger[_0x1f13('0x2c')](_0x1f13('0x2e'));});}}}function endRouting(_0x2a826e,_0xdfe333,_0x39e7f6,_0x352911){if(_0x2a826e&&_0xdfe333){_0xdfe333[_0x1f13('0x19')]-=0x1;var _0x48e817={'leaveAt':moment()['format'](_0x1f13('0x1c')),'exitAt':moment()[_0x1f13('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x1f13('0x26')](util[_0x1f13('0xe')]('[%s][END:QUEUE][NAME:%s]',_0x2a826e,_0xdfe333[_0x1f13('0x28')]));emitChannelQueueInteraction(_0x39e7f6['channel'],_0xdfe333[_0x1f13('0x28')],_0x39e7f6[_0x1f13('0x1a')],_0x39e7f6['account']['name'],_0x39e7f6[_0x1f13('0x24')]['id'],![],_0x352911);if(rpc[_0x39e7f6[_0x1f13('0x20')]+_0x1f13('0x29')]){return rpc[_0x39e7f6[_0x1f13('0x20')]+_0x1f13('0x29')]['update'](_0x2a826e,_0x48e817)[_0x1f13('0x2b')](function(_0xb1cd1f){logger['error'](_0x1f13('0x2e'));});}}}function handleFindQueue(_0x50713b){return function(_0x12b957){return _0x12b957[_0x1f13('0x28')][_0x1f13('0x2f')]()===_0x50713b['toLowerCase']();};}exports[_0x1f13('0x30')]=function(_0x549b06,_0x2e7e4f,_0x5d01b6,_0x4caaf8){return function(_0x340bc5){try{var _0x1049af={'name':_0x2e7e4f[0x0],'timeout':_0x2e7e4f[0x1]};var _0x581d16=queue[_0x1f13('0x0')](_0x1049af,{'typecast':!![]});if(_0x581d16[_0x1f13('0x31')]){logger[_0x1f13('0x2c')](_0x1f13('0x32'),_0x549b06,_['map'](_0x581d16,_0x1f13('0x24'))['join'](',\x20'));_0x340bc5[_0x1f13('0x33')]();}else{var _0x38991e=_[_0x1f13('0x34')](_0x5d01b6[_0x4caaf8[_0x1f13('0x20')]+'Queues'],handleFindQueue(_0x1049af[_0x1f13('0x28')]));if(_0x38991e){startRouting(_0x549b06,_0x38991e,_0x4caaf8,_0x5d01b6);var _0x1acd7a=(_0x38991e[_0x1f13('0x35')]||0xa)*0x3e8;var _0x2e368e=(_0x1049af['timeout']||0x14)*0x3e8;var _0x501e4c,_0xad0b97;if(_0x1acd7a>_0x2e368e){_0x2e368e=_0x1acd7a;}var _0x31019e=seqqueue[_0x1f13('0x36')](_0x1acd7a);_0x31019e['id']=_0x549b06;_0x31019e[_0x1f13('0x37')]=_0x1acd7a;_0x31019e['qtimeout']=_0x2e368e;_0x31019e[_0x1f13('0x20')]=_0x4caaf8[_0x1f13('0x20')];_0x5d01b6['rules'][_0x549b06]['on'](_0x1f13('0x38'),function(){logger[_0x1f13('0x26')](_0x1f13('0x39'),_0x549b06);stopRouting(_0x549b06,_0x38991e,_0x4caaf8,_0x5d01b6);clearTimeout(_0x501e4c);_0x501e4c=undefined;_0x31019e[_0x1f13('0x3a')](!![]);if(_0x5d01b6['rules'][_0x549b06]){delete _0x5d01b6[_0x1f13('0x3b')][_0x549b06];}_0x340bc5[_0x1f13('0x33')]();});_0x5d01b6[_0x1f13('0x3b')][_0x549b06]['on'](_0x1f13('0x3c'),function(){if(_0x5d01b6[_0x1f13('0x3b')][_0x549b06]){delete _0x5d01b6[_0x1f13('0x3b')][_0x549b06];}});_0x501e4c=setTimeout(function(){logger[_0x1f13('0x26')](_0x1f13('0x3d'),_0x549b06);endRouting(_0x549b06,_0x38991e,_0x4caaf8,_0x5d01b6);clearTimeout(_0x501e4c);_0x31019e['close'](!![]);_0x340bc5[_0x1f13('0x3e')]();},_0x2e368e);switch(_0x38991e[_0x1f13('0x3f')]){case _0x1f13('0x40'):strategy[_0x1f13('0x40')](_0x31019e,_0x38991e,_0x5d01b6,_0x4caaf8);break;default:strategy['beepall'](_0x31019e,_0x38991e,_0x5d01b6,_0x4caaf8);}}else{logger['error'](_0x1f13('0x41'),_0x549b06,_0x1049af[_0x1f13('0x28')]);_0x340bc5[_0x1f13('0x33')]();}}}catch(_0x2fcc3f){console[_0x1f13('0x42')](_0x2fcc3f);logger[_0x1f13('0x2c')](_0x1f13('0x32'),_0x549b06,_0x2fcc3f[_0x1f13('0x43')]);_0x340bc5['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 55c11e7..a2bf343 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 _0x12d7=['handleRun','handleTimeout','drained','handleDrained','bind','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','notificationId','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','squeue','agent'];(function(_0x1cf5c0,_0x1a8a6f){var _0x16efce=function(_0x2ab81b){while(--_0x2ab81b){_0x1cf5c0['push'](_0x1cf5c0['shift']());}};_0x16efce(++_0x1a8a6f);}(_0x12d7,0xda));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x712d('0x0'));var uuid=require('uuid');var util=require(_0x712d('0x1'));var logger=require(_0x712d('0x2'))(_0x712d('0x3'));var Agent=function(_0xfabbe6,_0x56683d,_0x1155b6,_0x2e0c40){this['notificationId']=uuid['v4']();this[_0x712d('0x4')]=_0xfabbe6;this[_0x712d('0x5')]=_0x56683d;this['realtime']=_0x1155b6;this[_0x712d('0x3')]=_0x2e0c40;this['squeue']['push'](this[_0x712d('0x6')]['bind'](this),this['handleTimeout']['bind'](this));this['squeue']['on']('timeout',this[_0x712d('0x7')]['bind'](this));this[_0x712d('0x4')]['on'](_0x712d('0x8'),this[_0x712d('0x9')][_0x712d('0xa')](this));};Agent[_0x712d('0xb')][_0x712d('0xc')]=function(){this[_0x712d('0x4')][_0x712d('0xc')](this['handleRun'][_0x712d('0xa')](this),this[_0x712d('0x7')][_0x712d('0xa')](this));};Agent[_0x712d('0xb')][_0x712d('0x9')]=function(){this[_0x712d('0x7')](!![]);};Agent[_0x712d('0xb')]['handleRun']=function(){logger['debug'](_0x712d('0xd'),this[_0x712d('0x4')]['id'],this['agent']['id']);if(_[_0x712d('0xe')](this[_0x712d('0xf')][_0x712d('0x10')][this[_0x712d('0x5')]['id']])){logger[_0x712d('0x11')](_0x712d('0x12'),this[_0x712d('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x712d('0xc')][_0x712d('0xa')](this),0x3e8);}else{if(this[_0x712d('0x3')][_0x712d('0x13')]||util[_0x712d('0x14')](this[_0x712d('0x4')]['id'],this[_0x712d('0xf')][_0x712d('0x10')][this['agent']['id']],this['squeue'][_0x712d('0x15')],![])){this['realtime']['agents'][this[_0x712d('0x5')]['id']][_0x712d('0x16')]=!![];this['realtime']['agents'][this[_0x712d('0x5')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x712d('0x17')],this[_0x712d('0x4')]['id'],this['realtime'][_0x712d('0x10')][this[_0x712d('0x5')]['id']],null,this[_0x712d('0x3')]);util[_0x712d('0x18')](this[_0x712d('0x4')]['id'],this['realtime']['agents'][this[_0x712d('0x5')]['id']],'RINGING'+(this[_0x712d('0x3')][_0x712d('0x13')]?':FORCED':''));}else{logger['debug'](_0x712d('0x19'),this['squeue']['id'],this[_0x712d('0x5')]['id']);setTimeout(this[_0x712d('0xc')][_0x712d('0xa')](this),0x3e8);}}};Agent[_0x712d('0xb')][_0x712d('0x7')]=function(_0x5c4270){if(_[_0x712d('0xe')](this[_0x712d('0xf')]['agents'][this['agent']['id']])){return logger['debug'](_0x712d('0x12'),this[_0x712d('0x4')]['id'],this[_0x712d('0x5')]['id']);}else{logger['debug'](_0x712d('0x1a'),this['squeue']['id'],this['agent']['id']);util[_0x712d('0x1b')](this['notificationId'],this['squeue']['id'],this[_0x712d('0xf')][_0x712d('0x10')][this[_0x712d('0x5')]['id']],null,this[_0x712d('0x3')]);this[_0x712d('0xf')]['agents'][this[_0x712d('0x5')]['id']]['busy']=![];this[_0x712d('0xf')]['agents'][this[_0x712d('0x5')]['id']][_0x712d('0x1c')]=undefined;util[_0x712d('0x18')](this[_0x712d('0x4')]['id'],this[_0x712d('0xf')][_0x712d('0x10')][this['agent']['id']],_0x5c4270?_0x712d('0x1d'):_0x712d('0x1e'));}if(!_0x5c4270){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x325948,_0x45a8c4,_0x5d0ad9,_0x3be1ca){return new Agent(_0x325948,_0x45a8c4,_0x5d0ad9,_0x3be1ca);}module[_0x712d('0x1f')]=agent; \ No newline at end of file +var _0xdc42=['debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','bind','drained','handleDrained','prototype','handleRun','handleTimeout'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdc42,0x167));var _0x2dc4=function(_0x43d57e,_0x3851b6){_0x43d57e=_0x43d57e-0x0;var _0x481cff=_0xdc42[_0x43d57e];return _0x481cff;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x2dc4('0x0'));var logger=require(_0x2dc4('0x1'))(_0x2dc4('0x2'));var Agent=function(_0x3cf9a3,_0x23c5e5,_0x494440,_0x1156a7){this['notificationId']=uuid['v4']();this[_0x2dc4('0x3')]=_0x3cf9a3;this[_0x2dc4('0x4')]=_0x23c5e5;this[_0x2dc4('0x5')]=_0x494440;this['routing']=_0x1156a7;this[_0x2dc4('0x3')][_0x2dc4('0x6')](this['handleRun']['bind'](this),this['handleTimeout'][_0x2dc4('0x7')](this));this[_0x2dc4('0x3')]['on']('timeout',this['handleTimeout'][_0x2dc4('0x7')](this));this[_0x2dc4('0x3')]['on'](_0x2dc4('0x8'),this[_0x2dc4('0x9')]['bind'](this));};Agent[_0x2dc4('0xa')][_0x2dc4('0x6')]=function(){this[_0x2dc4('0x3')][_0x2dc4('0x6')](this[_0x2dc4('0xb')][_0x2dc4('0x7')](this),this['handleTimeout']['bind'](this));};Agent[_0x2dc4('0xa')]['handleDrained']=function(){this[_0x2dc4('0xc')](!![]);};Agent[_0x2dc4('0xa')][_0x2dc4('0xb')]=function(){logger[_0x2dc4('0xd')](_0x2dc4('0xe'),this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x4')]['id']);if(_[_0x2dc4('0xf')](this[_0x2dc4('0x5')][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']])){logger[_0x2dc4('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x4')]['id']);setTimeout(this[_0x2dc4('0x6')][_0x2dc4('0x7')](this),0x3e8);}else{if(this[_0x2dc4('0x2')][_0x2dc4('0x11')]||util['isAgentAvailable'](this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x5')][_0x2dc4('0x10')][this['agent']['id']],this[_0x2dc4('0x3')]['channel'],![])){this[_0x2dc4('0x5')][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']][_0x2dc4('0x12')]=!![];this[_0x2dc4('0x5')][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']][_0x2dc4('0x13')]=undefined;util[_0x2dc4('0x14')](this[_0x2dc4('0x15')],this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x5')][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']],null,this['routing']);util[_0x2dc4('0x16')](this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x5')][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']],_0x2dc4('0x17')+(this[_0x2dc4('0x2')][_0x2dc4('0x11')]?_0x2dc4('0x18'):''));}else{logger[_0x2dc4('0xd')](_0x2dc4('0x19'),this['squeue']['id'],this[_0x2dc4('0x4')]['id']);setTimeout(this[_0x2dc4('0x6')][_0x2dc4('0x7')](this),0x3e8);}}};Agent[_0x2dc4('0xa')][_0x2dc4('0xc')]=function(_0x563bf7){if(_[_0x2dc4('0xf')](this['realtime'][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']])){return logger['debug'](_0x2dc4('0x1a'),this[_0x2dc4('0x3')]['id'],this['agent']['id']);}else{logger[_0x2dc4('0xd')](_0x2dc4('0x1b'),this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x4')]['id']);util['hideNotification'](this[_0x2dc4('0x15')],this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x5')][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']],null,this['routing']);this['realtime'][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']][_0x2dc4('0x12')]=![];this[_0x2dc4('0x5')]['agents'][this[_0x2dc4('0x4')]['id']][_0x2dc4('0x13')]=undefined;util[_0x2dc4('0x16')](this[_0x2dc4('0x3')]['id'],this[_0x2dc4('0x5')][_0x2dc4('0x10')][this[_0x2dc4('0x4')]['id']],_0x563bf7?_0x2dc4('0x1c'):_0x2dc4('0x1d'));}if(!_0x563bf7){setTimeout(this['push'][_0x2dc4('0x7')](this),0x3e8);}};function agent(_0x213a87,_0x284d9e,_0x40d846,_0x51feb9){return new Agent(_0x213a87,_0x284d9e,_0x40d846,_0x51feb9);}module[_0x2dc4('0x1e')]=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 9f2f659..2fafa14 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 _0x2ceb=['handleTimeout','timeout','drained','handleDrained','prototype','push','isNil','Agents','length','realtime','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busy','busyQueue','name','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','squeue','queue','handleRun','bind'];(function(_0x3bee49,_0x420058){var _0x30e8d0=function(_0x123ded){while(--_0x123ded){_0x3bee49['push'](_0x3bee49['shift']());}};_0x30e8d0(++_0x420058);}(_0x2ceb,0x110));var _0xb2ce=function(_0x22095e,_0x2b6ae8){_0x22095e=_0x22095e-0x0;var _0x529d83=_0x2ceb[_0x22095e];return _0x529d83;};'use strict';var _=require(_0xb2ce('0x0'));var uuid=require(_0xb2ce('0x1'));var util=require('./util');var logger=require(_0xb2ce('0x2'))(_0xb2ce('0x3'));var Beepall=function(_0xc03973,_0x1dbb1e,_0xa187b4,_0x35242f){this['notificationId']=uuid['v4']();this[_0xb2ce('0x4')]=_0xc03973;this[_0xb2ce('0x5')]=_0x1dbb1e;this['realtime']=_0xa187b4;this[_0xb2ce('0x3')]=_0x35242f;this[_0xb2ce('0x4')]['push'](this[_0xb2ce('0x6')][_0xb2ce('0x7')](this),this[_0xb2ce('0x8')]['bind'](this));this['squeue']['on'](_0xb2ce('0x9'),this[_0xb2ce('0x8')]['bind'](this));this[_0xb2ce('0x4')]['on'](_0xb2ce('0xa'),this[_0xb2ce('0xb')][_0xb2ce('0x7')](this));};Beepall[_0xb2ce('0xc')][_0xb2ce('0xd')]=function(){this['squeue'][_0xb2ce('0xd')](this[_0xb2ce('0x6')][_0xb2ce('0x7')](this),this[_0xb2ce('0x8')][_0xb2ce('0x7')](this));};Beepall['prototype']['handleDrained']=function(){this[_0xb2ce('0x8')](!![]);};Beepall[_0xb2ce('0xc')][_0xb2ce('0x6')]=function(){var _0x1cc91e=!![];if(!_[_0xb2ce('0xe')](this[_0xb2ce('0x5')])&&!_[_0xb2ce('0xe')](this[_0xb2ce('0x5')][_0xb2ce('0xf')])&&this[_0xb2ce('0x5')][_0xb2ce('0xf')][_0xb2ce('0x10')]>0x0){for(var _0x13ee00=0x0,_0x1bfe08;_0x13ee000x0){for(var _0x55ef62=0x0,_0x3b39df;_0x55ef620x0&&_0x486de2[_0x396646+_0xaf2c('0x24')]>=_0x486de2[_0x396646+_0xaf2c('0x25')]){writeLog(_0x237318,_0x486de2,_0x396646[_0xaf2c('0x26')]()+_0xaf2c('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x29f8b0,_0x2051be,_0x36f37c,_0x410536,_0x4b7cf2){return sendNotification(!![],_0x29f8b0,_0x2051be,_0x36f37c,_0x410536,_0x4b7cf2);};exports[_0xaf2c('0x28')]=function(_0x589d47,_0x38db1b,_0x42f980,_0x15466b,_0x5d685a){return sendNotification(![],_0x589d47,_0x38db1b,_0x42f980,_0x15466b,_0x5d685a);};exports[_0xaf2c('0x29')]=writeLog; \ No newline at end of file +var _0x032e=['toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','../utils','ioredis','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','CurrentCapacity','Capacity'];(function(_0x362add,_0x47dccf){var _0x44a7f2=function(_0x365072){while(--_0x365072){_0x362add['push'](_0x362add['shift']());}};_0x44a7f2(++_0x47dccf);}(_0x032e,0x124));var _0xe032=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x032e[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var utils=require(_0xe032('0x1'));var Redis=require(_0xe032('0x2'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0xe032('0x3'));config[_0xe032('0x4')]=_[_0xe032('0x5')](config[_0xe032('0x4')],{'host':_0xe032('0x6'),'port':0x18eb});var io=require(_0xe032('0x7'))(new Redis(config[_0xe032('0x4')]));function sendNotification(_0x33ad0b,_0x37432f,_0x1576c8,_0x3289b0,_0xd84027,_0xaf3907){io['to'](util[_0xe032('0x8')](_0xe032('0x9'),_0x3289b0[_0xe032('0xa')]))[_0xe032('0xb')](_0xe032('0xc'),_0x3289b0);var _0x4aec53=_0xaf3907||{};var _0x1382e1=_0x1576c8[_0xe032('0xd')]('.');var _0x13c126={'uniqueid':_0x37432f,'channel':_0x1382e1[0x0],'id':_0x1382e1[0x1],'title':_0x1382e1[0x0]+_0xe032('0xe'),'interactionId':_0x1382e1[0x2],'queue':_0xd84027?_0xd84027[_0xe032('0xa')]:null,'sound':_0x4aec53[_0xe032('0xf')][_0xe032('0x10')],'shake':_0x4aec53['account'][_0xe032('0x11')]};try{if(!_0x4aec53[_0xe032('0x12')]){_0x4aec53[_0xe032('0x12')]={};}if(_0xd84027){_0x4aec53[_0xe032('0x12')]['queue']=_0xd84027;}else if(_0x4aec53[_0xe032('0x12')][_0xe032('0x13')]){delete _0x4aec53[_0xe032('0x12')][_0xe032('0x13')];}_0x13c126[_0xe032('0x14')]=utils[_0xe032('0x15')](_0x4aec53[_0xe032('0xf')]['notificationTemplate'],_0x4aec53);}catch(_0x231c35){_0x13c126[_0xe032('0x14')]=_0xe032('0x16');logger[_0xe032('0x17')](util[_0xe032('0x8')](_0xe032('0x18'),_0x37432f,_0x231c35['message']));}io['to'](util[_0xe032('0x8')](_0xe032('0x9'),_0x3289b0[_0xe032('0xa')]))[_0xe032('0xb')](util[_0xe032('0x8')]('notification:%s',_0x33ad0b?'save':'remove'),_0x13c126);}function writeLog(_0x15475c,_0x505d8c,_0x46dc27){return logger[_0xe032('0x19')](util[_0xe032('0x8')](_0xe032('0x1a'),_0x15475c,_0x505d8c[_0xe032('0xa')],_0x46dc27));}exports[_0xe032('0x1b')]=function(_0x136f5d,_0x5a7b53,_0x32f8b6,_0x866c81){if(_0x5a7b53[_0xe032('0x1c')]){writeLog(_0x136f5d,_0x5a7b53,_0xe032('0x1d'));return![];}if(!_0x5a7b53[_0xe032('0x1e')]){writeLog(_0x136f5d,_0x5a7b53,_0xe032('0x1f'));return![];}if(_0x5a7b53[_0x32f8b6+_0xe032('0x20')]){writeLog(_0x136f5d,_0x5a7b53,_0xe032('0x21'));return![];}if(_0x866c81&&_0x5a7b53['hasOwnProperty'](_0x32f8b6+'Capacity')&&_0x5a7b53['hasOwnProperty'](_0x32f8b6+_0xe032('0x22'))){if(_0x5a7b53[_0x32f8b6+_0xe032('0x23')]>0x0&&_0x5a7b53[_0x32f8b6+_0xe032('0x22')]>=_0x5a7b53[_0x32f8b6+_0xe032('0x23')]){writeLog(_0x136f5d,_0x5a7b53,_0x32f8b6[_0xe032('0x24')]()+_0xe032('0x25'));return![];}}return!![];};exports[_0xe032('0x26')]=function(_0x2b6ffa,_0x4dcbf1,_0x1ac20b,_0x5bb36a,_0x189ed4){return sendNotification(!![],_0x2b6ffa,_0x4dcbf1,_0x1ac20b,_0x5bb36a,_0x189ed4);};exports[_0xe032('0x27')]=function(_0x3106aa,_0x2a521b,_0x5cc95d,_0x5573e4,_0x3e2575){return sendNotification(![],_0x3106aa,_0x2a521b,_0x5cc95d,_0x5573e4,_0x3e2575);};exports[_0xe032('0x28')]=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 6bb27a2..861267e 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 _0x6a72=['error','map','message','join','info','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x4f0b7d,_0x515942){var _0x599cf3=function(_0x496712){while(--_0x496712){_0x4f0b7d['push'](_0x4f0b7d['shift']());}};_0x599cf3(++_0x515942);}(_0x6a72,0x118));var _0x26a7=function(_0x3768f3,_0x4a40f1){_0x3768f3=_0x3768f3-0x0;var _0x526a13=_0x6a72[_0x3768f3];return _0x526a13;};'use strict';var schema=require(_0x26a7('0x0'));var sh=require(_0x26a7('0x1'));var _=require(_0x26a7('0x2'));var utils=require('./utils');var logger=require(_0x26a7('0x3'))('routing');var system=schema({'command':{'type':_0x26a7('0x4'),'required':!![],'message':_0x26a7('0x5')}});exports[_0x26a7('0x6')]=function(_0x113515,_0x3c326e){return function(_0x3f8f56){try{var _0x4751bb={'command':_0x3c326e[0x0]};var _0x27c9b0=system['validate'](_0x4751bb,{'typecast':!![]});if(_0x27c9b0[_0x26a7('0x7')]){logger[_0x26a7('0x8')]('[%s][SYSTEM]\x20%s',_0x113515,_[_0x26a7('0x9')](_0x27c9b0,_0x26a7('0xa'))[_0x26a7('0xb')](',\x20'));logger[_0x26a7('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x113515);_0x3f8f56[_0x26a7('0xd')]();}else{var _0x28115a=this;var _0x4a639f=utils['getMustacheRender'](_0x3c326e[0x0],this);logger[_0x26a7('0xc')](_0x26a7('0xe'),_0x113515,_0x4a639f);sh[_0x26a7('0xf')](_['trim'](_0x4a639f),function(_0x1d16e1,_0x3460ca){logger[_0x26a7('0xc')](_0x26a7('0x10'),_0x113515,_0x1d16e1);if(_0x1d16e1==0x0){var _0x193766=_0x3460ca['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x26a7('0x11')](_0x3c326e[0x1])||_['isEmpty'](_0x3c326e[0x1])){logger[_0x26a7('0xc')](_0x26a7('0x12'),_0x113515);_0x28115a[_0x26a7('0x13')][_0x3c326e[0x1]]=_0x193766;}else{logger[_0x26a7('0xc')](_0x26a7('0x14'),_0x113515,_0x3c326e[0x1],_0x193766);_0x28115a[_0x26a7('0x13')][_0x3c326e[0x1]]=_0x193766;}}_0x3f8f56[_0x26a7('0xd')]();});}}catch(_0x399795){logger[_0x26a7('0x8')](_0x26a7('0x15'),_0x113515,_[_0x26a7('0x16')](_0x399795)?JSON[_0x26a7('0x17')](_0x399795):_0x399795);logger[_0x26a7('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x113515);_0x3f8f56[_0x26a7('0xd')]();}};}; \ No newline at end of file +var _0x485a=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','isObject','shelljs','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info'];(function(_0xd6df5e,_0x4a4e46){var _0x155b12=function(_0x368fb6){while(--_0x368fb6){_0xd6df5e['push'](_0xd6df5e['shift']());}};_0x155b12(++_0x4a4e46);}(_0x485a,0x1d0));var _0xa485=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x485a[_0x4ff09b];return _0x3f5c2e;};'use strict';var schema=require('validate');var sh=require(_0xa485('0x0'));var _=require(_0xa485('0x1'));var utils=require('./utils');var logger=require(_0xa485('0x2'))(_0xa485('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0xa485('0x4')}});exports[_0xa485('0x5')]=function(_0x4a8b6b,_0x29eb40){return function(_0x360632){try{var _0x301b6d={'command':_0x29eb40[0x0]};var _0x1078cf=system[_0xa485('0x6')](_0x301b6d,{'typecast':!![]});if(_0x1078cf[_0xa485('0x7')]){logger[_0xa485('0x8')]('[%s][SYSTEM]\x20%s',_0x4a8b6b,_[_0xa485('0x9')](_0x1078cf,_0xa485('0xa'))[_0xa485('0xb')](',\x20'));logger['info'](_0xa485('0xc'),_0x4a8b6b);_0x360632[_0xa485('0xd')]();}else{var _0x24a799=this;var _0x40af36=utils[_0xa485('0xe')](_0x29eb40[0x0],this);logger[_0xa485('0xf')](_0xa485('0x10'),_0x4a8b6b,_0x40af36);sh[_0xa485('0x11')](_[_0xa485('0x12')](_0x40af36),function(_0x1ea4d2,_0x4322f2){logger[_0xa485('0xf')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x4a8b6b,_0x1ea4d2);if(_0x1ea4d2==0x0){var _0x28a8d2=_0x4322f2[_0xa485('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xa485('0x14')](_0x29eb40[0x1])||_['isEmpty'](_0x29eb40[0x1])){logger[_0xa485('0xf')](_0xa485('0x15'),_0x4a8b6b);_0x24a799[_0xa485('0x16')][_0x29eb40[0x1]]=_0x28a8d2;}else{logger[_0xa485('0xf')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4a8b6b,_0x29eb40[0x1],_0x28a8d2);_0x24a799[_0xa485('0x16')][_0x29eb40[0x1]]=_0x28a8d2;}}_0x360632[_0xa485('0xd')]();});}}catch(_0x2db333){logger[_0xa485('0x8')]('[%s][SYSTEM]\x20%s',_0x4a8b6b,_[_0xa485('0x17')](_0x2db333)?JSON['stringify'](_0x2db333):_0x2db333);logger[_0xa485('0xf')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4a8b6b);_0x360632[_0xa485('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index a97490b..5e5235c 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 _0x25b5=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','validate','../../rpc/chatInteraction'];(function(_0x489ad5,_0x2937b2){var _0x44d8b3=function(_0x78def8){while(--_0x78def8){_0x489ad5['push'](_0x489ad5['shift']());}};_0x44d8b3(++_0x2937b2);}(_0x25b5,0xf8));var _0x525b=function(_0x5fc6c3,_0x3b4a0){_0x5fc6c3=_0x5fc6c3-0x0;var _0x49c48a=_0x25b5[_0x5fc6c3];return _0x49c48a;};'use strict';var schema=require(_0x525b('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x525b('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x525b('0x2')),'mailInteraction':require(_0x525b('0x3')),'faxInteraction':require(_0x525b('0x4')),'whatsappInteraction':require(_0x525b('0x5'))};var logger=require(_0x525b('0x6'))(_0x525b('0x7'));var tag=schema({'tag':{'type':_0x525b('0x8'),'required':!![],'message':_0x525b('0x9')}});exports[_0x525b('0xa')]=function(_0x3cb781,_0x696afb,_0x4e2234,_0x555975){return function(_0x505a60){try{var _0xd2fce2={'tag':_0x696afb[0x0]};var _0x1354a8=tag[_0x525b('0x0')](_0xd2fce2,{'typecast':!![]});if(_0x1354a8['length']){logger[_0x525b('0xb')](_0x525b('0xc'),_0x3cb781,_['map'](_0x1354a8,_0x525b('0xd'))['join'](',\x20'));logger[_0x525b('0xe')](_0x525b('0xf'),_0x3cb781);_0x505a60[_0x525b('0x10')]();}else{var _0x1023c9={'ids':[_0x696afb[0x0]]};if(rpc[_0x555975[_0x525b('0x11')]+_0x525b('0x12')]){rpc[_0x555975[_0x525b('0x11')]+_0x525b('0x12')][_0x525b('0x13')](_0x555975[_0x525b('0x14')]['id'],_0x1023c9)['then'](function(_0x159d22){logger['info'](_0x525b('0x15'),_0x3cb781,_0x696afb[0x1],_0x555975[_0x525b('0x11')],_0x555975['interaction']['id']);})[_0x525b('0x16')](function(_0x2dac80){logger[_0x525b('0xb')](_0x525b('0xc'),_0x3cb781,JSON[_0x525b('0x17')](_0x2dac80));logger[_0x525b('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3cb781);})[_0x525b('0x18')](function(){_0x505a60[_0x525b('0x10')]();});}}}catch(_0x1a9bca){logger[_0x525b('0xb')]('[%s][TAG]\x20%s',_0x3cb781,_['isObject'](_0x1a9bca)?JSON[_0x525b('0x17')](_0x1a9bca):_0x1a9bca);logger['info'](_0x525b('0xf'),_0x3cb781);_0x505a60[_0x525b('0x10')]();}};}; \ No newline at end of file +var _0xdfb1=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','isObject','validate'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xdfb1,0x179));var _0x1dfb=function(_0x32e1f9,_0xd34aae){_0x32e1f9=_0x32e1f9-0x0;var _0x292f62=_0xdfb1[_0x32e1f9];return _0x292f62;};'use strict';var schema=require(_0x1dfb('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x1dfb('0x1')),'openchannelInteraction':require(_0x1dfb('0x2')),'smsInteraction':require(_0x1dfb('0x3')),'mailInteraction':require(_0x1dfb('0x4')),'faxInteraction':require(_0x1dfb('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x1dfb('0x6'))('routing');var tag=schema({'tag':{'type':_0x1dfb('0x7'),'required':!![],'message':_0x1dfb('0x8')}});exports[_0x1dfb('0x9')]=function(_0x47af28,_0x374c0c,_0x3e4a08,_0xfb8b6d){return function(_0x7b214){try{var _0x570190={'tag':_0x374c0c[0x0]};var _0x113283=tag[_0x1dfb('0x0')](_0x570190,{'typecast':!![]});if(_0x113283[_0x1dfb('0xa')]){logger[_0x1dfb('0xb')]('[%s][TAG]\x20%s',_0x47af28,_[_0x1dfb('0xc')](_0x113283,_0x1dfb('0xd'))['join'](',\x20'));logger[_0x1dfb('0xe')](_0x1dfb('0xf'),_0x47af28);_0x7b214[_0x1dfb('0x10')]();}else{var _0x4f6e37={'ids':[_0x374c0c[0x0]]};if(rpc[_0xfb8b6d['channel']+'Interaction']){rpc[_0xfb8b6d[_0x1dfb('0x11')]+_0x1dfb('0x12')]['addTags'](_0xfb8b6d[_0x1dfb('0x13')]['id'],_0x4f6e37)[_0x1dfb('0x14')](function(_0x1b07b0){logger[_0x1dfb('0xe')](_0x1dfb('0x15'),_0x47af28,_0x374c0c[0x1],_0xfb8b6d[_0x1dfb('0x11')],_0xfb8b6d[_0x1dfb('0x13')]['id']);})[_0x1dfb('0x16')](function(_0x2f12c2){logger[_0x1dfb('0xb')](_0x1dfb('0x17'),_0x47af28,JSON[_0x1dfb('0x18')](_0x2f12c2));logger[_0x1dfb('0xe')](_0x1dfb('0xf'),_0x47af28);})[_0x1dfb('0x19')](function(){_0x7b214[_0x1dfb('0x10')]();});}}}catch(_0xe0d1b){logger[_0x1dfb('0xb')](_0x1dfb('0x17'),_0x47af28,_[_0x1dfb('0x1a')](_0xe0d1b)?JSON[_0x1dfb('0x18')](_0xe0d1b):_0xe0d1b);logger['info'](_0x1dfb('0xf'),_0x47af28);_0x7b214['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index e685a80..e676483 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x725b=['&serviceId=','&sessionId=','&data=','info','catch','error','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','\x20-\x20','replace','includes','push','title','jsonrpc','2.0','params','stringify','utf8','POST','then','parse','logged','channelId='];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x725b,0x173));var _0xb725=function(_0x2d99d4,_0x32db5a){_0x2d99d4=_0x2d99d4-0x0;var _0x137524=_0x725b[_0x2d99d4];return _0x137524;};'use strict';var rp=require(_0xb725('0x0'));var logger=require(_0xb725('0x1'))(_0xb725('0x2'));var _=require(_0xb725('0x3'));var arr=[];exports['consequence']=function(_0x1e4dd0,_0x5eb678){return function(_0x96257a){var _0x59e8a2=_0x5eb678[0xa];var _0x4fb5f1=_0x5eb678[0xb];var _0x4a2b3e=_0x5eb678[0xc];var _0x198857=_0x5eb678[0xd];var _0x2fd844=_0x5eb678[0xe];var _0x59d19e=_0x5eb678[0xf]['replace'](/\n/g,_0xb725('0x4'));var _0x566914=_0x5eb678[0x10][_0xb725('0x5')](/\n/g,'\x20');if(!arr[_0xb725('0x6')](_0x4fb5f1)){arr[_0xb725('0x7')](_0x4fb5f1);var _0x400373=_0x5eb678[0x3];var _0x1e046e=_0x5eb678[0x4];var _0x12f6b1=_0x5eb678[0x1];var _0x3c94b4=_0x5eb678[0x0];var _0x216fe6={};_0x216fe6['urlOnAnswer']=_0x5eb678[0x8]+'?params='+_0x4a2b3e+'|'+_0x59e8a2+'|'+_0x198857+'|'+_0x4fb5f1+'|'+_0x2fd844;_0x216fe6['urlOnRing']=_0x5eb678[0x7]+'?params='+_0x4a2b3e+'|'+_0x59e8a2+'|'+_0x198857+'|'+_0x4fb5f1+'|'+_0x2fd844+'|'+_0x59d19e+'|'+_0x566914;_0x216fe6[_0xb725('0x8')]=_0x5eb678[0x9];var _0x41b622={};_0x41b622[_0xb725('0x9')]=_0xb725('0xa');_0x41b622['method']='login';var _0x213f32=[];_0x213f32[_0xb725('0x7')](_0x5eb678[0x2]);_0x213f32[_0xb725('0x7')](_0x5eb678[0x5]);_0x213f32[_0xb725('0x7')](_0x5eb678[0x6]);_0x41b622[_0xb725('0xb')]=_0x213f32;_0x41b622['id']=0x1;var _0x424e2d=JSON[_0xb725('0xc')](_0x41b622);var _0x2f46d3={'encoding':_0xb725('0xd'),'method':_0xb725('0xe'),'timeout':0x2710,'url':_0x400373,'headers':{'Content-Type':'application/json-rpc'},'body':_0x424e2d};return rp(_0x2f46d3)[_0xb725('0xf')](function(_0x34f466){const _0x2ea82c=JSON[_0xb725('0x10')](_0x34f466);if(!_0x2ea82c['result'][_0xb725('0x11')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x635699=_0x4fb5f1;var _0x59dd3b=_0xb725('0x12')+_0x12f6b1+_0xb725('0x13')+_0x3c94b4+_0xb725('0x14')+_0x635699+_0xb725('0x15')+JSON[_0xb725('0xc')](_0x216fe6);var _0x1ca251=_0x1e046e+'?'+_0x59dd3b;return rp(_0x1ca251);})[_0xb725('0xf')](function(_0x3e90b4){logger[_0xb725('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1e4dd0,_0x3e90b4);_0x96257a['stop']();})[_0xb725('0x17')](function(_0x30b3ea){logger[_0xb725('0x18')](_0xb725('0x19'),_0x1e4dd0,_[_0xb725('0x1a')](_0x30b3ea)?JSON[_0xb725('0xc')](_0x30b3ea):_0x30b3ea);_0x96257a[_0xb725('0x1b')]();});}else{logger['info'](_0xb725('0x1c'),_0x1e4dd0);_0x96257a[_0xb725('0x1d')]();}};}; \ No newline at end of file +var _0xfccf=['error','isObject','request-promise','../../../../config/logger','lodash','replace','\x20-\x20','?params=','urlOnRing','jsonrpc','2.0','login','push','params','stringify','utf8','POST','application/json-rpc','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&data=','then','info','stop','catch'];(function(_0x39b744,_0x5ef57f){var _0x5c6c82=function(_0x380222){while(--_0x380222){_0x39b744['push'](_0x39b744['shift']());}};_0x5c6c82(++_0x5ef57f);}(_0xfccf,0x115));var _0xffcc=function(_0x1a2e59,_0x3a2446){_0x1a2e59=_0x1a2e59-0x0;var _0x228dd6=_0xfccf[_0x1a2e59];return _0x228dd6;};'use strict';var rp=require(_0xffcc('0x0'));var logger=require(_0xffcc('0x1'))('routing');var _=require(_0xffcc('0x2'));var arr=[];exports['consequence']=function(_0x379a49,_0x127cd3){return function(_0x525a73){var _0x9b2cca=_0x127cd3[0xa];var _0x2d5aab=_0x127cd3[0xb];var _0x3e8b96=_0x127cd3[0xc];var _0x16e5c7=_0x127cd3[0xd];var _0x2b8d2d=_0x127cd3[0xe];var _0x5ee326=_0x127cd3[0xf][_0xffcc('0x3')](/\n/g,_0xffcc('0x4'));var _0x3e3f49=_0x127cd3[0x10][_0xffcc('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x2d5aab)){arr['push'](_0x2d5aab);var _0x5527ba=_0x127cd3[0x3];var _0x13aad8=_0x127cd3[0x4];var _0x37984d=_0x127cd3[0x1];var _0x860930=_0x127cd3[0x0];var _0x149a64={};_0x149a64['urlOnAnswer']=_0x127cd3[0x8]+_0xffcc('0x5')+_0x3e8b96+'|'+_0x9b2cca+'|'+_0x16e5c7+'|'+_0x2d5aab+'|'+_0x2b8d2d;_0x149a64[_0xffcc('0x6')]=_0x127cd3[0x7]+_0xffcc('0x5')+_0x3e8b96+'|'+_0x9b2cca+'|'+_0x16e5c7+'|'+_0x2d5aab+'|'+_0x2b8d2d+'|'+_0x5ee326+'|'+_0x3e3f49;_0x149a64['title']=_0x127cd3[0x9];var _0x1616e5={};_0x1616e5[_0xffcc('0x7')]=_0xffcc('0x8');_0x1616e5['method']=_0xffcc('0x9');var _0x1f10cf=[];_0x1f10cf[_0xffcc('0xa')](_0x127cd3[0x2]);_0x1f10cf[_0xffcc('0xa')](_0x127cd3[0x5]);_0x1f10cf['push'](_0x127cd3[0x6]);_0x1616e5[_0xffcc('0xb')]=_0x1f10cf;_0x1616e5['id']=0x1;var _0x14dd70=JSON[_0xffcc('0xc')](_0x1616e5);var _0x429e4f={'encoding':_0xffcc('0xd'),'method':_0xffcc('0xe'),'timeout':0x2710,'url':_0x5527ba,'headers':{'Content-Type':_0xffcc('0xf')},'body':_0x14dd70};return rp(_0x429e4f)['then'](function(_0x4c332c){const _0x5eb68b=JSON['parse'](_0x4c332c);if(!_0x5eb68b[_0xffcc('0x10')]['logged']){throw new Error(_0xffcc('0x11'));}var _0x2a53f9=_0x2d5aab;var _0x377aa7='channelId='+_0x37984d+'&serviceId='+_0x860930+'&sessionId='+_0x2a53f9+_0xffcc('0x12')+JSON['stringify'](_0x149a64);var _0x13b18c=_0x13aad8+'?'+_0x377aa7;return rp(_0x13b18c);})[_0xffcc('0x13')](function(_0x3a887c){logger[_0xffcc('0x14')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x379a49,_0x3a887c);_0x525a73[_0xffcc('0x15')]();})[_0xffcc('0x16')](function(_0x41cf05){logger[_0xffcc('0x17')]('[%s][TVOX]\x20%s',_0x379a49,_[_0xffcc('0x18')](_0x41cf05)?JSON[_0xffcc('0xc')](_0x41cf05):_0x41cf05);_0x525a73[_0xffcc('0x15')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x379a49);_0x525a73['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 1479bf5..f7b9657 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x3c50d6,_0x5911ef){var _0xd01d68=function(_0x5857f6){while(--_0x5857f6){_0x3c50d6['push'](_0x3c50d6['shift']());}};_0xd01d68(++_0x5911ef);}(_0xe706,0xa3));var _0x6e70=function(_0x3768f3,_0x4a40f1){_0x3768f3=_0x3768f3-0x0;var _0x526a13=_0xe706[_0x3768f3];return _0x526a13;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x327a32,_0x1d678a){var _0x17deae=function(_0x1f588d){while(--_0x1f588d){_0x327a32['push'](_0x327a32['shift']());}};_0x17deae(++_0x1d678a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 04b2f54..59f5f16 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 _0xb469=['update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','find','chatQueues','name','paused','mailQueues','loggedIn','waiting','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','Intervals','map','interval','listen','rules','message','interaction','applications','app','.js','toLowerCase','appdata','channel','push','slice','length','join','dialogflow','split','dialogflowv2','amazonlex','TagId','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agents','agent','busy','busyQueue','end','QueueReport'];(function(_0x48f210,_0xe6508c){var _0xe4a6af=function(_0x21e61b){while(--_0x21e61b){_0x48f210['push'](_0x48f210['shift']());}};_0xe4a6af(++_0xe6508c);}(_0xb469,0x13b));var _0x9b46=function(_0x334c68,_0x388a86){_0x334c68=_0x334c68-0x0;var _0x3ee650=_0xb469[_0x334c68];return _0x3ee650;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var path=require(_0x9b46('0x2'));var fs=require('fs');var jayson=require(_0x9b46('0x3'));var BPromise=require(_0x9b46('0x4'));var utils=require(_0x9b46('0x5'));var logger=require(_0x9b46('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x9b46('0x7')),'mailQueueReport':require(_0x9b46('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x9b46('0x9')),'faxQueueReport':require(_0x9b46('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x9b46('0xb'));function getId(_0x5bd834,_0x4c1ed9,_0x34c0de){return util['format'](_0x9b46('0xc'),_0x5bd834,_0x4c1ed9||0x0,_0x34c0de||0x0);}function getIntervals(_0xb9d1b5,_0x43a112){var _0x47adeb=[];if(!_[_0x9b46('0xd')](_0x43a112['IntervalId'])&&!_[_0x9b46('0xd')](_0xb9d1b5[_0x43a112['IntervalId']])&&!_[_0x9b46('0xd')](_0xb9d1b5[_0x43a112['IntervalId']][_0x9b46('0xe')])){_0x47adeb=_[_0x9b46('0xf')](_0xb9d1b5[_0x43a112['IntervalId']][_0x9b46('0xe')],_0x9b46('0x10'));}else if(!_['isNil'](_0x43a112[_0x9b46('0x10')])){_0x47adeb=[_0x43a112[_0x9b46('0x10')]];}return _0x47adeb;}exports[_0x9b46('0x11')]=function(_0x467086){_0x467086[_0x9b46('0x12')]={};return new BPromise(function(_0x35c5c1,_0x2136bc){var _0x2e70c3={'Start':function(_0x3f2b28){var _0x178293=this;return new Promise(function(_0xbc1ba6,_0x135cc2){if(_0x3f2b28){try{var _0x1e6911=[];var _0x559bdf=getId(_0x3f2b28['channel'],_0x3f2b28['message']?_0x3f2b28[_0x9b46('0x13')]['id']:0x0,_0x3f2b28[_0x9b46('0x14')]?_0x3f2b28[_0x9b46('0x14')]['id']:0x0);if(_0x3f2b28['applications']&&_['isArray'](_0x3f2b28[_0x9b46('0x15')])&&_0x3f2b28['applications']['length']){for(var _0xfeb1b9=0x0;_0xfeb1b9<_0x3f2b28[_0x9b46('0x15')]['length'];_0xfeb1b9+=0x1){var _0x2fd8f9=_0x3f2b28[_0x9b46('0x15')][_0xfeb1b9];if(fs['existsSync'](path['join'](__dirname,_0x9b46('0x15'),_0x2fd8f9[_0x9b46('0x16')]+_0x9b46('0x17')))){var _0x4e4c7d=[];switch(_0x2fd8f9['app'][_0x9b46('0x18')]()){case'autoreply':var _0x21dacb=_0x2fd8f9[_0x9b46('0x19')]['split'](',');if(_0x3f2b28[_0x9b46('0x1a')]==='mail'){_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[0x1]);_0x4e4c7d['push'](_0x21dacb[_0x9b46('0x1c')](0x2,_0x21dacb[_0x9b46('0x1d')])[_0x9b46('0x1e')](','));}else{_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x21dacb[_0x9b46('0x1c')](0x1,_0x21dacb[_0x9b46('0x1d')])['join'](','));}break;case _0x9b46('0x1f'):var _0x3ac37e=_0x2fd8f9[_0x9b46('0x19')][_0x9b46('0x20')](',');_0x4e4c7d[_0x9b46('0x1b')](_0x3ac37e[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x3ac37e[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x3ac37e['slice'](0x2,_0x3ac37e[_0x9b46('0x1d')])[_0x9b46('0x1e')](','));break;case _0x9b46('0x21'):var _0x376ccc=_0x2fd8f9[_0x9b46('0x19')][_0x9b46('0x20')](',');_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x2]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc[0x3]);_0x4e4c7d[_0x9b46('0x1b')](_0x376ccc['slice'](0x4,_0x376ccc[_0x9b46('0x1d')])[_0x9b46('0x1e')](','));break;case _0x9b46('0x22'):var _0x1ce069=_0x2fd8f9[_0x9b46('0x19')][_0x9b46('0x20')](',');_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x0]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x2]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069[0x3]);_0x4e4c7d[_0x9b46('0x1b')](_0x1ce069['slice'](0x4,_0x1ce069[_0x9b46('0x1d')])['join'](','));break;case _0x9b46('0x13'):_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x19')]);break;case'tag':_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x23')]);_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x19')]);break;case _0x9b46('0x24'):var _0x5cb73f=utils['getMustacheRender'](_0x3f2b28[_0x9b46('0x25')][_0x9b46('0x26')],_0x3f2b28);var _0x47367a=_0x2fd8f9[_0x9b46('0x19')]['split'](',');_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x0]);_0x4e4c7d['push'](_0x47367a[0x1]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x2]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x3]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x4]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x5]);_0x4e4c7d['push'](_0x47367a[0x6]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x7]);_0x4e4c7d['push'](_0x47367a[0x8]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0x9]);_0x4e4c7d[_0x9b46('0x1b')](_0x47367a[0xa]);_0x4e4c7d[_0x9b46('0x1b')](_0x3f2b28[_0x9b46('0x14')]['id']);_0x4e4c7d[_0x9b46('0x1b')](_0x3f2b28[_0x9b46('0x13')]['id']);_0x4e4c7d[_0x9b46('0x1b')](_0x2fd8f9[_0x9b46('0x27')]);_0x4e4c7d[_0x9b46('0x1b')](_0x3f2b28[_0x9b46('0x14')][_0x9b46('0x28')]);_0x4e4c7d['push'](_0x3f2b28[_0x9b46('0x29')]['body']);_0x4e4c7d[_0x9b46('0x1b')](_0x5cb73f);break;default:_0x4e4c7d=_[_0x9b46('0xd')](_0x2fd8f9['appdata'])?[]:_0x2fd8f9[_0x9b46('0x19')]['split'](',');}var _0x416538={'id':util['format'](_0x9b46('0x2a'),_0x559bdf,_0x2fd8f9['id'],_0x2fd8f9[_0x9b46('0x16')]),'condition':require(_0x9b46('0x2b'))[_0x9b46('0x2c')](_0x559bdf,getIntervals(_0x467086[_0x9b46('0x2d')],_0x2fd8f9),_0x467086),'consequence':require('./applications/'+_0x2fd8f9['app'])[_0x9b46('0x2e')](_0x559bdf,_0x4e4c7d,_0x467086,_0x3f2b28),'p':_0x2fd8f9['priority']||0x0};logger['info']('Push\x20new\x20rule',_0x416538['id'],'on\x20interval',getIntervals(_0x467086[_0x9b46('0x2d')],_0x2fd8f9)['join'](_0x9b46('0x2f')));_0x1e6911['push'](_0x416538);}else{logger[_0x9b46('0x30')](_0x9b46('0x31'),path[_0x9b46('0x1e')](__dirname,_0x9b46('0x15'),_0x2fd8f9[_0x9b46('0x16')]+_0x9b46('0x17')));}}_0x467086[_0x9b46('0x12')][_0x559bdf]=new RuleEngine(_0x1e6911);_0x467086[_0x9b46('0x12')][_0x559bdf][_0x9b46('0x32')](_0x3f2b28,function(_0x5602a9){logger[_0x9b46('0x33')](_0x9b46('0x34'),JSON[_0x9b46('0x35')](_0x5602a9[_0x9b46('0x36')]));if(_0x467086[_0x9b46('0x12')][_0x559bdf]){_0x467086[_0x9b46('0x12')][_0x559bdf][_0x9b46('0x37')](_0x9b46('0x38'));}});return _0xbc1ba6({'code':0xc8,'message':_0x3f2b28});}else{logger[_0x9b46('0x33')](_0x9b46('0x39'));return _0xbc1ba6({'code':0xc8,'message':_0x3f2b28});}}catch(_0x1f3b2b){logger[_0x9b46('0x30')](_0x1f3b2b[_0x9b46('0x3a')]);return _0x135cc2(_0x178293[_0x9b46('0x30')](0x1f4,_0x1f3b2b));}}return _0x135cc2('routing\x20is\x20empty');});},'AcceptMessage':function(_0x4a62c6){var _0xf81543=this;return new Promise(function(_0x23df60,_0x309a4f){if(_0x4a62c6['agent']&&_0x4a62c6['agent']['id']){if(_0x467086[_0x9b46('0x3b')][_0x4a62c6[_0x9b46('0x3c')]['id']]){_0x467086[_0x9b46('0x3b')][_0x4a62c6[_0x9b46('0x3c')]['id']][_0x9b46('0x3d')]=![];_0x467086[_0x9b46('0x3b')][_0x4a62c6['agent']['id']][_0x9b46('0x3e')]=undefined;}}if(_0x4a62c6[_0x9b46('0x13')]&&_0x4a62c6[_0x9b46('0x13')]['id']){try{var _0x47a938=getId(_0x4a62c6[_0x9b46('0x1a')],_0x4a62c6['message']?_0x4a62c6[_0x9b46('0x13')]['id']:0x0,_0x4a62c6[_0x9b46('0x14')]?_0x4a62c6[_0x9b46('0x14')]['id']:0x0);if(_0x467086['rules'][_0x47a938]){_0x467086[_0x9b46('0x12')][_0x47a938][_0x9b46('0x37')](_0x9b46('0x3f'));if(rpc[_0x4a62c6[_0x9b46('0x1a')]+_0x9b46('0x40')]){rpc[_0x4a62c6[_0x9b46('0x1a')]+'QueueReport'][_0x9b46('0x41')](_0x47a938,{'UserId':_0x4a62c6[_0x9b46('0x13')][_0x9b46('0x42')]})[_0x9b46('0x43')](function(){logger[_0x9b46('0x30')](_0x9b46('0x44'));});}}return _0x23df60({'code':0xc8,'message':_0x4a62c6});}catch(_0x4a1df0){logger[_0x9b46('0x30')](_0x4a1df0['stack']);return _0x309a4f(_0xf81543[_0x9b46('0x30')](0x1f4,_0x4a1df0));}}logger[_0x9b46('0x30')](_0x9b46('0x45'));return _0x309a4f(_0xf81543[_0x9b46('0x30')](0x1f4,_0x9b46('0x45')));});},'RejectMessage':function(_0x5f5ce9){var _0x15dbb0=this;return new Promise(function(_0x1c7e5d,_0x3d65ad){if(_0x5f5ce9[_0x9b46('0x3c')]&&_0x5f5ce9[_0x9b46('0x3c')]['id']){try{if(_0x467086[_0x9b46('0x3b')][_0x5f5ce9[_0x9b46('0x3c')]['id']]){_0x467086[_0x9b46('0x3b')][_0x5f5ce9[_0x9b46('0x3c')]['id']][_0x9b46('0x3d')]=![];_0x467086[_0x9b46('0x3b')][_0x5f5ce9['agent']['id']]['busyQueue']=undefined;}return _0x1c7e5d({'code':0xc8,'message':_0x5f5ce9});}catch(_0x496006){logger[_0x9b46('0x30')](_0x496006['stack']);return _0x3d65ad(_0x15dbb0[_0x9b46('0x30')](0x1f4,_0x496006));}}logger['error'](_0x9b46('0x45'));return _0x3d65ad(_0x15dbb0['error'](0x1f4,_0x9b46('0x45')));});},'AbandonInteraction':function(_0x443ccd){var _0x15e3d6=this;return new Promise(function(_0x52463b,_0x35f71d){if(_0x443ccd['channel']&&_0x443ccd[_0x9b46('0x14')]&&_0x443ccd[_0x9b46('0x14')]['id']){try{var _0x2c77d2=getId(_0x443ccd[_0x9b46('0x1a')],_0x443ccd[_0x9b46('0x13')]?_0x443ccd['message']['id']:0x0,_0x443ccd['interaction']?_0x443ccd[_0x9b46('0x14')]['id']:0x0);if(_0x467086[_0x9b46('0x12')][_0x2c77d2]){_0x467086[_0x9b46('0x12')][_0x2c77d2][_0x9b46('0x37')](_0x9b46('0x3f'));}return _0x52463b({'code':0xc8,'message':_0x443ccd});}catch(_0x164167){logger[_0x9b46('0x30')](_0x164167[_0x9b46('0x3a')]);return _0x35f71d(_0x15e3d6['error'](0x1f4,_0x164167));}}logger[_0x9b46('0x30')](_0x9b46('0x45'));return _0x35f71d(_0x15e3d6[_0x9b46('0x30')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x46dffa){var _0x145200=this;return new Promise(function(_0x1aa8c6,_0x12d825){if(_0x467086[_0x9b46('0x3b')][_0x9b46('0x46')](_0x46dffa['id'])){for(var _0x4b79a4 in _0x46dffa[_0x9b46('0x47')]){if(_0x46dffa[_0x9b46('0x47')][_0x9b46('0x46')](_0x4b79a4)){if(_0x467086[_0x9b46('0x3b')][_0x46dffa['id']][_0x9b46('0x46')](_0x4b79a4+_0x9b46('0x48'))){_0x467086['agents'][_0x46dffa['id']][_0x4b79a4+_0x9b46('0x48')]=parseInt(_0x46dffa['capacity'][_0x4b79a4],0xa);}}}_0x467086[_0x9b46('0x3b')][_0x46dffa['id']]['updateRealtime']();return _0x1aa8c6({'code':0xc8,'message':_0x467086[_0x9b46('0x3b')][_0x46dffa['id']]});}else{return _0x12d825(_0x145200[_0x9b46('0x30')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x171ad2){return new Promise(function(_0x1cc2f3){var _0x3abe23=_[_0x9b46('0x49')](_0x467086[_0x9b46('0x3b')]);if(_0x171ad2&&_0x171ad2['id']){var _0x5b9ec2=_[_0x9b46('0x4a')](_0x3abe23,function(_0x343a1e){return _0x343a1e['id']===_0x171ad2['id'];});_0x1cc2f3(_0x5b9ec2);}else{_0x1cc2f3({'count':_0x3abe23['length'],'rows':_0x3abe23});}});},'ChatQueues':function(){return new Promise(function(_0x4cf4ba){var _0x3aca4b=[];for(var _0x2801bb in _0x467086[_0x9b46('0x4b')]){if(_0x467086[_0x9b46('0x4b')][_0x9b46('0x46')](_0x2801bb)){var _0x1a6516=_0x467086[_0x9b46('0x4b')][_0x2801bb];var _0x19aa34={'id':_0x1a6516['id'],'available':_0x1a6516['available'],'loggedIn':_0x1a6516['loggedIn'],'name':_0x1a6516[_0x9b46('0x4c')],'paused':_0x1a6516[_0x9b46('0x4d')],'waiting':_0x1a6516['waiting']};_0x3aca4b[_0x9b46('0x1b')](_0x19aa34);}}_0x4cf4ba({'count':_0x3aca4b['length'],'rows':_0x3aca4b});});},'MailQueues':function(){return new Promise(function(_0x33d1ab){var _0x501544=[];for(var _0xf6f92 in _0x467086[_0x9b46('0x4e')]){if(_0x467086[_0x9b46('0x4e')]['hasOwnProperty'](_0xf6f92)){var _0x271ae8=_0x467086[_0x9b46('0x4e')][_0xf6f92];var _0xad2666={'id':_0x271ae8['id'],'available':_0x271ae8['available'],'loggedIn':_0x271ae8[_0x9b46('0x4f')],'name':_0x271ae8[_0x9b46('0x4c')],'paused':_0x271ae8[_0x9b46('0x4d')],'waiting':_0x271ae8[_0x9b46('0x50')]};_0x501544[_0x9b46('0x1b')](_0xad2666);}}_0x33d1ab({'count':_0x501544['length'],'rows':_0x501544});});},'OpenchannelQueues':function(){return new Promise(function(_0x5321c1){var _0x5386ef=[];for(var _0x533a4f in _0x467086['openchannelQueues']){if(_0x467086[_0x9b46('0x51')][_0x9b46('0x46')](_0x533a4f)){var _0x11243a=_0x467086[_0x9b46('0x51')][_0x533a4f];var _0x368cd2={'id':_0x11243a['id'],'available':_0x11243a[_0x9b46('0x52')],'loggedIn':_0x11243a[_0x9b46('0x4f')],'name':_0x11243a[_0x9b46('0x4c')],'paused':_0x11243a['paused'],'waiting':_0x11243a[_0x9b46('0x50')]};_0x5386ef[_0x9b46('0x1b')](_0x368cd2);}}_0x5321c1({'count':_0x5386ef['length'],'rows':_0x5386ef});});},'SmsQueues':function(){return new Promise(function(_0xb3e39e){var _0x4ea405=[];for(var _0x1f3e9e in _0x467086[_0x9b46('0x53')]){if(_0x467086[_0x9b46('0x53')][_0x9b46('0x46')](_0x1f3e9e)){var _0x453a53=_0x467086['smsQueues'][_0x1f3e9e];var _0x4e1175={'id':_0x453a53['id'],'available':_0x453a53[_0x9b46('0x52')],'loggedIn':_0x453a53['loggedIn'],'name':_0x453a53[_0x9b46('0x4c')],'paused':_0x453a53[_0x9b46('0x4d')],'waiting':_0x453a53['waiting']};_0x4ea405['push'](_0x4e1175);}}_0xb3e39e({'count':_0x4ea405['length'],'rows':_0x4ea405});});},'FaxQueues':function(){return new Promise(function(_0x2978aa){var _0x4a4e9a=[];for(var _0x56b870 in _0x467086[_0x9b46('0x54')]){if(_0x467086[_0x9b46('0x54')][_0x9b46('0x46')](_0x56b870)){var _0x1fa19d=_0x467086['faxQueues'][_0x56b870];var _0x46a294={'id':_0x1fa19d['id'],'available':_0x1fa19d[_0x9b46('0x52')],'loggedIn':_0x1fa19d[_0x9b46('0x4f')],'name':_0x1fa19d['name'],'paused':_0x1fa19d['paused'],'waiting':_0x1fa19d[_0x9b46('0x50')]};_0x4a4e9a[_0x9b46('0x1b')](_0x46a294);}}_0x2978aa({'count':_0x4a4e9a[_0x9b46('0x1d')],'rows':_0x4a4e9a});});},'WhatsappQueues':function(){return new Promise(function(_0x4fa1ad){var _0x2f60a3=[];for(var _0x3a1e1e in _0x467086['whatsappQueues']){if(_0x467086[_0x9b46('0x55')][_0x9b46('0x46')](_0x3a1e1e)){var _0x346a6c=_0x467086[_0x9b46('0x55')][_0x3a1e1e];var _0x4de02d={'id':_0x346a6c['id'],'available':_0x346a6c['available'],'loggedIn':_0x346a6c[_0x9b46('0x4f')],'name':_0x346a6c['name'],'paused':_0x346a6c[_0x9b46('0x4d')],'waiting':_0x346a6c[_0x9b46('0x50')]};_0x2f60a3['push'](_0x4de02d);}}_0x4fa1ad({'count':_0x2f60a3['length'],'rows':_0x2f60a3});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x536083){var _0x8bf222=_['values'](_0x467086[_0x9b46('0x56')]);_0x536083({'count':_0x8bf222[_0x9b46('0x1d')],'rows':_0x8bf222});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1f52c5){var _0x18006a=_['values'](_0x467086[_0x9b46('0x57')]);_0x1f52c5({'count':_0x18006a[_0x9b46('0x1d')],'rows':_0x18006a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xf1bc8d){var _0x195cf0=_[_0x9b46('0x49')](_0x467086['openchannelQueuesWaitingInteractions']);_0xf1bc8d({'count':_0x195cf0[_0x9b46('0x1d')],'rows':_0x195cf0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x591820){var _0x254c71=_[_0x9b46('0x49')](_0x467086['smsQueuesWaitingInteractions']);_0x591820({'count':_0x254c71[_0x9b46('0x1d')],'rows':_0x254c71});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4ffaee){var _0x3c0b46=_[_0x9b46('0x49')](_0x467086['faxQueuesWaitingInteractions']);_0x4ffaee({'count':_0x3c0b46[_0x9b46('0x1d')],'rows':_0x3c0b46});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x526e70){var _0x2cbca2=_[_0x9b46('0x49')](_0x467086[_0x9b46('0x58')]);_0x526e70({'count':_0x2cbca2['length'],'rows':_0x2cbca2});});}};var _0xe27fd6=jayson[_0x9b46('0x59')](_0x2e70c3)[_0x9b46('0x5a')]();_0xe27fd6['on'](_0x9b46('0x30'),function(_0x48f236){logger[_0x9b46('0x30')](JSON['stringify'](_0x48f236));return _0x2136bc(_0x48f236);});_0xe27fd6[_0x9b46('0x11')](0x232c,_0x9b46('0x5b'),function(){console[_0x9b46('0x5c')](_0x9b46('0x5d'),0x232c);return _0x35c5c1(_0x9b46('0x5e')+0x232c);});});}; \ No newline at end of file +var _0x6308=['stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','hasOwnProperty','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','127.0.0.1','log','lodash','path','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','channel','message','interaction','applications','isArray','length','app','.js','toLowerCase','appdata','split','push','slice','join','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute'];(function(_0x31fac8,_0x361189){var _0x449a02=function(_0x4dbf2b){while(--_0x4dbf2b){_0x31fac8['push'](_0x31fac8['shift']());}};_0x449a02(++_0x361189);}(_0x6308,0x1f2));var _0x8630=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x6308[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var path=require(_0x8630('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0x8630('0x2'));var logger=require(_0x8630('0x3'))(_0x8630('0x4'));var rpc={'openchannelQueueReport':require(_0x8630('0x5')),'mailQueueReport':require(_0x8630('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x8630('0x7')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x8630('0x8'));function getId(_0x3d5a10,_0x1bcfea,_0x2b87ea){return util[_0x8630('0x9')](_0x8630('0xa'),_0x3d5a10,_0x1bcfea||0x0,_0x2b87ea||0x0);}function getIntervals(_0x5bb8a3,_0x8b3652){var _0x5726fd=[];if(!_[_0x8630('0xb')](_0x8b3652[_0x8630('0xc')])&&!_[_0x8630('0xb')](_0x5bb8a3[_0x8b3652['IntervalId']])&&!_[_0x8630('0xb')](_0x5bb8a3[_0x8b3652[_0x8630('0xc')]][_0x8630('0xd')])){_0x5726fd=_['map'](_0x5bb8a3[_0x8b3652[_0x8630('0xc')]][_0x8630('0xd')],'interval');}else if(!_['isNil'](_0x8b3652[_0x8630('0xe')])){_0x5726fd=[_0x8b3652[_0x8630('0xe')]];}return _0x5726fd;}exports['listen']=function(_0x3040be){_0x3040be['rules']={};return new BPromise(function(_0xf31c17,_0x4cc542){var _0x1527b1={'Start':function(_0x594e75){var _0x53f236=this;return new Promise(function(_0x29a42d,_0x86c262){if(_0x594e75){try{var _0x49fce1=[];var _0x5c0ba0=getId(_0x594e75[_0x8630('0xf')],_0x594e75['message']?_0x594e75[_0x8630('0x10')]['id']:0x0,_0x594e75[_0x8630('0x11')]?_0x594e75[_0x8630('0x11')]['id']:0x0);if(_0x594e75[_0x8630('0x12')]&&_[_0x8630('0x13')](_0x594e75[_0x8630('0x12')])&&_0x594e75[_0x8630('0x12')][_0x8630('0x14')]){for(var _0xe1ecd0=0x0;_0xe1ecd0<_0x594e75['applications']['length'];_0xe1ecd0+=0x1){var _0x2730c0=_0x594e75[_0x8630('0x12')][_0xe1ecd0];if(fs['existsSync'](path['join'](__dirname,_0x8630('0x12'),_0x2730c0[_0x8630('0x15')]+_0x8630('0x16')))){var _0x491c65=[];switch(_0x2730c0['app'][_0x8630('0x17')]()){case'autoreply':var _0x30fb4d=_0x2730c0[_0x8630('0x18')][_0x8630('0x19')](',');if(_0x594e75[_0x8630('0xf')]==='mail'){_0x491c65[_0x8630('0x1a')](_0x30fb4d[0x0]);_0x491c65[_0x8630('0x1a')](_0x30fb4d[0x1]);_0x491c65[_0x8630('0x1a')](_0x30fb4d[_0x8630('0x1b')](0x2,_0x30fb4d[_0x8630('0x14')])[_0x8630('0x1c')](','));}else{_0x491c65[_0x8630('0x1a')](_0x30fb4d[0x0]);_0x491c65['push'](_0x30fb4d['slice'](0x1,_0x30fb4d[_0x8630('0x14')])[_0x8630('0x1c')](','));}break;case _0x8630('0x1d'):var _0xf97e31=_0x2730c0[_0x8630('0x18')][_0x8630('0x19')](',');_0x491c65[_0x8630('0x1a')](_0xf97e31[0x0]);_0x491c65[_0x8630('0x1a')](_0xf97e31[0x1]);_0x491c65[_0x8630('0x1a')](_0xf97e31[_0x8630('0x1b')](0x2,_0xf97e31[_0x8630('0x14')])[_0x8630('0x1c')](','));break;case _0x8630('0x1e'):var _0x4285ee=_0x2730c0[_0x8630('0x18')][_0x8630('0x19')](',');_0x491c65[_0x8630('0x1a')](_0x4285ee[0x0]);_0x491c65['push'](_0x4285ee[0x1]);_0x491c65[_0x8630('0x1a')](_0x4285ee[0x2]);_0x491c65[_0x8630('0x1a')](_0x4285ee[0x3]);_0x491c65[_0x8630('0x1a')](_0x4285ee[_0x8630('0x1b')](0x4,_0x4285ee['length'])[_0x8630('0x1c')](','));break;case _0x8630('0x1f'):var _0x3b030e=_0x2730c0[_0x8630('0x18')][_0x8630('0x19')](',');_0x491c65[_0x8630('0x1a')](_0x3b030e[0x0]);_0x491c65['push'](_0x3b030e[0x1]);_0x491c65[_0x8630('0x1a')](_0x3b030e[0x2]);_0x491c65[_0x8630('0x1a')](_0x3b030e[0x3]);_0x491c65[_0x8630('0x1a')](_0x3b030e['slice'](0x4,_0x3b030e[_0x8630('0x14')])[_0x8630('0x1c')](','));break;case _0x8630('0x10'):_0x491c65[_0x8630('0x1a')](_0x2730c0[_0x8630('0x18')]);break;case _0x8630('0x20'):_0x491c65['push'](_0x2730c0[_0x8630('0x21')]);_0x491c65[_0x8630('0x1a')](_0x2730c0[_0x8630('0x18')]);break;case _0x8630('0x22'):var _0x113bd1=utils[_0x8630('0x23')](_0x594e75[_0x8630('0x24')][_0x8630('0x25')],_0x594e75);var _0x141d05=_0x2730c0[_0x8630('0x18')][_0x8630('0x19')](',');_0x491c65[_0x8630('0x1a')](_0x141d05[0x0]);_0x491c65[_0x8630('0x1a')](_0x141d05[0x1]);_0x491c65[_0x8630('0x1a')](_0x141d05[0x2]);_0x491c65[_0x8630('0x1a')](_0x141d05[0x3]);_0x491c65[_0x8630('0x1a')](_0x141d05[0x4]);_0x491c65[_0x8630('0x1a')](_0x141d05[0x5]);_0x491c65['push'](_0x141d05[0x6]);_0x491c65[_0x8630('0x1a')](_0x141d05[0x7]);_0x491c65[_0x8630('0x1a')](_0x141d05[0x8]);_0x491c65['push'](_0x141d05[0x9]);_0x491c65['push'](_0x141d05[0xa]);_0x491c65[_0x8630('0x1a')](_0x594e75[_0x8630('0x11')]['id']);_0x491c65[_0x8630('0x1a')](_0x594e75[_0x8630('0x10')]['id']);_0x491c65[_0x8630('0x1a')](_0x2730c0['ChatWebsiteId']);_0x491c65[_0x8630('0x1a')](_0x594e75[_0x8630('0x11')][_0x8630('0x26')]);_0x491c65[_0x8630('0x1a')](_0x594e75['body'][_0x8630('0x27')]);_0x491c65[_0x8630('0x1a')](_0x113bd1);break;default:_0x491c65=_[_0x8630('0xb')](_0x2730c0[_0x8630('0x18')])?[]:_0x2730c0[_0x8630('0x18')][_0x8630('0x19')](',');}var _0x2fbb8c={'id':util['format'](_0x8630('0x28'),_0x5c0ba0,_0x2730c0['id'],_0x2730c0[_0x8630('0x15')]),'condition':require(_0x8630('0x29'))[_0x8630('0x2a')](_0x5c0ba0,getIntervals(_0x3040be[_0x8630('0x2b')],_0x2730c0),_0x3040be),'consequence':require(_0x8630('0x2c')+_0x2730c0[_0x8630('0x15')])[_0x8630('0x2d')](_0x5c0ba0,_0x491c65,_0x3040be,_0x594e75),'p':_0x2730c0[_0x8630('0x2e')]||0x0};logger[_0x8630('0x2f')]('Push\x20new\x20rule',_0x2fbb8c['id'],_0x8630('0x30'),getIntervals(_0x3040be['intervals'],_0x2730c0)[_0x8630('0x1c')](_0x8630('0x31')));_0x49fce1[_0x8630('0x1a')](_0x2fbb8c);}else{logger[_0x8630('0x32')](_0x8630('0x33'),path[_0x8630('0x1c')](__dirname,'applications',_0x2730c0[_0x8630('0x15')]+_0x8630('0x16')));}}_0x3040be[_0x8630('0x34')][_0x5c0ba0]=new RuleEngine(_0x49fce1);_0x3040be['rules'][_0x5c0ba0][_0x8630('0x35')](_0x594e75,function(_0x1ea295){logger[_0x8630('0x2f')](_0x8630('0x36'),JSON[_0x8630('0x37')](_0x1ea295[_0x8630('0x38')]));if(_0x3040be['rules'][_0x5c0ba0]){_0x3040be[_0x8630('0x34')][_0x5c0ba0][_0x8630('0x39')](_0x8630('0x3a'));}});return _0x29a42d({'code':0xc8,'message':_0x594e75});}else{logger['info'](_0x8630('0x3b'));return _0x29a42d({'code':0xc8,'message':_0x594e75});}}catch(_0x3e1ed5){logger['error'](_0x3e1ed5[_0x8630('0x3c')]);return _0x86c262(_0x53f236[_0x8630('0x32')](0x1f4,_0x3e1ed5));}}return _0x86c262(_0x8630('0x3d'));});},'AcceptMessage':function(_0x4a63a6){var _0x4e439a=this;return new Promise(function(_0x3aeffc,_0x4ab99a){if(_0x4a63a6['agent']&&_0x4a63a6[_0x8630('0x3e')]['id']){if(_0x3040be['agents'][_0x4a63a6[_0x8630('0x3e')]['id']]){_0x3040be[_0x8630('0x3f')][_0x4a63a6['agent']['id']][_0x8630('0x40')]=![];_0x3040be[_0x8630('0x3f')][_0x4a63a6[_0x8630('0x3e')]['id']][_0x8630('0x41')]=undefined;}}if(_0x4a63a6[_0x8630('0x10')]&&_0x4a63a6['message']['id']){try{var _0x40c47d=getId(_0x4a63a6[_0x8630('0xf')],_0x4a63a6['message']?_0x4a63a6[_0x8630('0x10')]['id']:0x0,_0x4a63a6[_0x8630('0x11')]?_0x4a63a6[_0x8630('0x11')]['id']:0x0);if(_0x3040be['rules'][_0x40c47d]){_0x3040be[_0x8630('0x34')][_0x40c47d][_0x8630('0x39')](_0x8630('0x42'));if(rpc[_0x4a63a6[_0x8630('0xf')]+_0x8630('0x43')]){rpc[_0x4a63a6[_0x8630('0xf')]+_0x8630('0x43')][_0x8630('0x44')](_0x40c47d,{'UserId':_0x4a63a6[_0x8630('0x10')]['UserId']})['catch'](function(){logger[_0x8630('0x32')](_0x8630('0x45'));});}}return _0x3aeffc({'code':0xc8,'message':_0x4a63a6});}catch(_0x34619c){logger[_0x8630('0x32')](_0x34619c[_0x8630('0x3c')]);return _0x4ab99a(_0x4e439a[_0x8630('0x32')](0x1f4,_0x34619c));}}logger[_0x8630('0x32')]('message\x20is\x20empty');return _0x4ab99a(_0x4e439a[_0x8630('0x32')](0x1f4,_0x8630('0x46')));});},'RejectMessage':function(_0x34e316){var _0x16c286=this;return new Promise(function(_0x2b61c5,_0x5b21ac){if(_0x34e316[_0x8630('0x3e')]&&_0x34e316[_0x8630('0x3e')]['id']){try{if(_0x3040be[_0x8630('0x3f')][_0x34e316[_0x8630('0x3e')]['id']]){_0x3040be['agents'][_0x34e316[_0x8630('0x3e')]['id']][_0x8630('0x40')]=![];_0x3040be['agents'][_0x34e316[_0x8630('0x3e')]['id']][_0x8630('0x41')]=undefined;}return _0x2b61c5({'code':0xc8,'message':_0x34e316});}catch(_0x31e440){logger[_0x8630('0x32')](_0x31e440['stack']);return _0x5b21ac(_0x16c286[_0x8630('0x32')](0x1f4,_0x31e440));}}logger[_0x8630('0x32')]('message\x20is\x20empty');return _0x5b21ac(_0x16c286['error'](0x1f4,_0x8630('0x46')));});},'AbandonInteraction':function(_0x9fef86){var _0x5f2496=this;return new Promise(function(_0x113e24,_0x510113){if(_0x9fef86[_0x8630('0xf')]&&_0x9fef86[_0x8630('0x11')]&&_0x9fef86[_0x8630('0x11')]['id']){try{var _0x47b0c6=getId(_0x9fef86[_0x8630('0xf')],_0x9fef86[_0x8630('0x10')]?_0x9fef86[_0x8630('0x10')]['id']:0x0,_0x9fef86[_0x8630('0x11')]?_0x9fef86[_0x8630('0x11')]['id']:0x0);if(_0x3040be[_0x8630('0x34')][_0x47b0c6]){_0x3040be[_0x8630('0x34')][_0x47b0c6]['emit'](_0x8630('0x42'));}return _0x113e24({'code':0xc8,'message':_0x9fef86});}catch(_0x1162fd){logger[_0x8630('0x32')](_0x1162fd['stack']);return _0x510113(_0x5f2496['error'](0x1f4,_0x1162fd));}}logger[_0x8630('0x32')]('message\x20is\x20empty');return _0x510113(_0x5f2496[_0x8630('0x32')](0x1f4,_0x8630('0x46')));});},'AgentCapacity':function(_0x56b383){var _0x26031c=this;return new Promise(function(_0x14de6a,_0x1336dc){if(_0x3040be[_0x8630('0x3f')]['hasOwnProperty'](_0x56b383['id'])){for(var _0x19af58 in _0x56b383[_0x8630('0x47')]){if(_0x56b383[_0x8630('0x47')]['hasOwnProperty'](_0x19af58)){if(_0x3040be['agents'][_0x56b383['id']]['hasOwnProperty'](_0x19af58+_0x8630('0x48'))){_0x3040be[_0x8630('0x3f')][_0x56b383['id']][_0x19af58+_0x8630('0x48')]=parseInt(_0x56b383[_0x8630('0x47')][_0x19af58],0xa);}}}_0x3040be[_0x8630('0x3f')][_0x56b383['id']]['updateRealtime']();return _0x14de6a({'code':0xc8,'message':_0x3040be[_0x8630('0x3f')][_0x56b383['id']]});}else{return _0x1336dc(_0x26031c[_0x8630('0x32')](0x1f4,_0x8630('0x49')));}});},'Agents':function(_0x4f352b){return new Promise(function(_0x5cc90c){var _0x15b4aa=_[_0x8630('0x4a')](_0x3040be['agents']);if(_0x4f352b&&_0x4f352b['id']){var _0x651278=_['find'](_0x15b4aa,function(_0x29c298){return _0x29c298['id']===_0x4f352b['id'];});_0x5cc90c(_0x651278);}else{_0x5cc90c({'count':_0x15b4aa[_0x8630('0x14')],'rows':_0x15b4aa});}});},'ChatQueues':function(){return new Promise(function(_0x2cb1f8){var _0x1fea4d=[];for(var _0x166dff in _0x3040be['chatQueues']){if(_0x3040be['chatQueues']['hasOwnProperty'](_0x166dff)){var _0x359b5b=_0x3040be[_0x8630('0x4b')][_0x166dff];var _0x4120ff={'id':_0x359b5b['id'],'available':_0x359b5b[_0x8630('0x4c')],'loggedIn':_0x359b5b[_0x8630('0x4d')],'name':_0x359b5b[_0x8630('0x4e')],'paused':_0x359b5b[_0x8630('0x4f')],'waiting':_0x359b5b[_0x8630('0x50')]};_0x1fea4d[_0x8630('0x1a')](_0x4120ff);}}_0x2cb1f8({'count':_0x1fea4d[_0x8630('0x14')],'rows':_0x1fea4d});});},'MailQueues':function(){return new Promise(function(_0x36a5f0){var _0x4581b1=[];for(var _0x4bccab in _0x3040be[_0x8630('0x51')]){if(_0x3040be['mailQueues'][_0x8630('0x52')](_0x4bccab)){var _0x960d3f=_0x3040be[_0x8630('0x51')][_0x4bccab];var _0x2d924d={'id':_0x960d3f['id'],'available':_0x960d3f['available'],'loggedIn':_0x960d3f['loggedIn'],'name':_0x960d3f[_0x8630('0x4e')],'paused':_0x960d3f[_0x8630('0x4f')],'waiting':_0x960d3f[_0x8630('0x50')]};_0x4581b1['push'](_0x2d924d);}}_0x36a5f0({'count':_0x4581b1[_0x8630('0x14')],'rows':_0x4581b1});});},'OpenchannelQueues':function(){return new Promise(function(_0x3942d5){var _0x5ce177=[];for(var _0x3c8749 in _0x3040be[_0x8630('0x53')]){if(_0x3040be[_0x8630('0x53')][_0x8630('0x52')](_0x3c8749)){var _0x2304e6=_0x3040be['openchannelQueues'][_0x3c8749];var _0x588d6e={'id':_0x2304e6['id'],'available':_0x2304e6[_0x8630('0x4c')],'loggedIn':_0x2304e6[_0x8630('0x4d')],'name':_0x2304e6[_0x8630('0x4e')],'paused':_0x2304e6['paused'],'waiting':_0x2304e6[_0x8630('0x50')]};_0x5ce177[_0x8630('0x1a')](_0x588d6e);}}_0x3942d5({'count':_0x5ce177['length'],'rows':_0x5ce177});});},'SmsQueues':function(){return new Promise(function(_0x45f085){var _0x1f5b06=[];for(var _0x103fc8 in _0x3040be[_0x8630('0x54')]){if(_0x3040be[_0x8630('0x54')][_0x8630('0x52')](_0x103fc8)){var _0x4cc35a=_0x3040be[_0x8630('0x54')][_0x103fc8];var _0x2c5d87={'id':_0x4cc35a['id'],'available':_0x4cc35a['available'],'loggedIn':_0x4cc35a['loggedIn'],'name':_0x4cc35a[_0x8630('0x4e')],'paused':_0x4cc35a[_0x8630('0x4f')],'waiting':_0x4cc35a[_0x8630('0x50')]};_0x1f5b06['push'](_0x2c5d87);}}_0x45f085({'count':_0x1f5b06[_0x8630('0x14')],'rows':_0x1f5b06});});},'FaxQueues':function(){return new Promise(function(_0x495eda){var _0x5ba827=[];for(var _0x184c75 in _0x3040be[_0x8630('0x55')]){if(_0x3040be[_0x8630('0x55')][_0x8630('0x52')](_0x184c75)){var _0x5107cf=_0x3040be[_0x8630('0x55')][_0x184c75];var _0x1d3ccd={'id':_0x5107cf['id'],'available':_0x5107cf[_0x8630('0x4c')],'loggedIn':_0x5107cf['loggedIn'],'name':_0x5107cf[_0x8630('0x4e')],'paused':_0x5107cf[_0x8630('0x4f')],'waiting':_0x5107cf[_0x8630('0x50')]};_0x5ba827[_0x8630('0x1a')](_0x1d3ccd);}}_0x495eda({'count':_0x5ba827[_0x8630('0x14')],'rows':_0x5ba827});});},'WhatsappQueues':function(){return new Promise(function(_0x14fa2b){var _0x2b543a=[];for(var _0x3edb06 in _0x3040be[_0x8630('0x56')]){if(_0x3040be[_0x8630('0x56')]['hasOwnProperty'](_0x3edb06)){var _0x3c384a=_0x3040be[_0x8630('0x56')][_0x3edb06];var _0x1ae20b={'id':_0x3c384a['id'],'available':_0x3c384a[_0x8630('0x4c')],'loggedIn':_0x3c384a[_0x8630('0x4d')],'name':_0x3c384a['name'],'paused':_0x3c384a[_0x8630('0x4f')],'waiting':_0x3c384a[_0x8630('0x50')]};_0x2b543a['push'](_0x1ae20b);}}_0x14fa2b({'count':_0x2b543a[_0x8630('0x14')],'rows':_0x2b543a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4a821a){var _0x269de1=_[_0x8630('0x4a')](_0x3040be['chatQueuesWaitingInteractions']);_0x4a821a({'count':_0x269de1['length'],'rows':_0x269de1});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x58013a){var _0x47b449=_[_0x8630('0x4a')](_0x3040be[_0x8630('0x57')]);_0x58013a({'count':_0x47b449[_0x8630('0x14')],'rows':_0x47b449});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x4c2cb1){var _0x1f8556=_[_0x8630('0x4a')](_0x3040be['openchannelQueuesWaitingInteractions']);_0x4c2cb1({'count':_0x1f8556['length'],'rows':_0x1f8556});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3c2db7){var _0x3f6a1e=_[_0x8630('0x4a')](_0x3040be['smsQueuesWaitingInteractions']);_0x3c2db7({'count':_0x3f6a1e[_0x8630('0x14')],'rows':_0x3f6a1e});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xf4db60){var _0x3728cd=_[_0x8630('0x4a')](_0x3040be['faxQueuesWaitingInteractions']);_0xf4db60({'count':_0x3728cd[_0x8630('0x14')],'rows':_0x3728cd});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1d4a0f){var _0x5c3173=_[_0x8630('0x4a')](_0x3040be[_0x8630('0x58')]);_0x1d4a0f({'count':_0x5c3173[_0x8630('0x14')],'rows':_0x5c3173});});}};var _0x11c171=jayson['server'](_0x1527b1)[_0x8630('0x59')]();_0x11c171['on'](_0x8630('0x32'),function(_0x1d518d){logger['error'](JSON[_0x8630('0x37')](_0x1d518d));return _0x4cc542(_0x1d518d);});_0x11c171[_0x8630('0x5a')](0x232c,_0x8630('0x5b'),function(){console[_0x8630('0x5c')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xf31c17('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 f3840a4..9e06cd9 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 _0xf51b=['join','\x20|\x20','stack','stop','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','when','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0xf51b,0x154));var _0xbf51=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf51b[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var BPromise=require(_0xbf51('0x0'));var jayson=require(_0xbf51('0x1'));var _=require(_0xbf51('0x2'));var logger=require(_0xbf51('0x3'))(_0xbf51('0x4'));var client=jayson[_0xbf51('0x5')]['http']({'port':0x232a});function request(_0x3aa8bf,_0x638bce){return new BPromise(function(_0x21e850,_0x220b69){return client['request'](_0x3aa8bf,_0x638bce)[_0xbf51('0x6')](function(_0x35cf52){if(_0x35cf52[_0xbf51('0x7')]){return _0x220b69(_0x35cf52[_0xbf51('0x7')][_0xbf51('0x8')]);}else{return _0x21e850(_0x35cf52['result']);}})[_0xbf51('0x9')](function(_0x395e38){return _0x220b69(_0x395e38);});});}exports[_0xbf51('0xa')]=function(_0x26adb8,_0x40be4a,_0x584d9a){return function(_0x71633){if(_0x584d9a[_0xbf51('0xb')]&&!_0x584d9a[_0xbf51('0xb')][_0x26adb8]){logger[_0xbf51('0xc')](_0xbf51('0xd'),_0x26adb8);return _0x71633['stop']();}var _0x553139=[];for(var _0x6661bf=0x0;_0x6661bf<_0x40be4a[_0xbf51('0xe')];_0x6661bf+=0x1){_0x553139['push'](request(_0xbf51('0xf'),{'command':util[_0xbf51('0x10')](_0xbf51('0x11'),_0x40be4a[_0x6661bf])})[_0xbf51('0x6')](function(_0x2b2e99){return _0x2b2e99&&_0x2b2e99[_0xbf51('0x8')]&&_0x2b2e99['message']['indexOf'](_0xbf51('0x12'))>=0x0?!![]:![];})[_0xbf51('0x9')](function(_0x2bd809){logger['error'](_0xbf51('0x13'),_0x26adb8,_0x40be4a[_0x6661bf]);}));}BPromise[_0xbf51('0x14')](_0x553139)[_0xbf51('0x6')](function(_0x5f5168){var _0x3edb9e=_[_0xbf51('0x15')](_0x5f5168);logger[_0xbf51('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x26adb8,_0x40be4a['join']('\x20|\x20'),_0x3edb9e);_0x71633[_0xbf51('0x16')](_0x3edb9e);})[_0xbf51('0x9')](function(_0x4588c2){console['log'](_0x4588c2);logger['error'](_0xbf51('0x17'),_0x26adb8,_0x40be4a[_0xbf51('0x18')](_0xbf51('0x19')),_0x4588c2[_0xbf51('0x1a')]);_0x71633[_0xbf51('0x1b')]();});};}; \ No newline at end of file +var _0xa9d7=['info','stop','length','Command','format','iftime\x20%s','message','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','stack','util','bluebird','lodash','../../../config/logger','client','then','error','result','condition','rules'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0xa9d7,0x1d2));var _0x7a9d=function(_0x3d7e48,_0x41acda){_0x3d7e48=_0x3d7e48-0x0;var _0x594bd8=_0xa9d7[_0x3d7e48];return _0x594bd8;};'use strict';var util=require(_0x7a9d('0x0'));var BPromise=require(_0x7a9d('0x1'));var jayson=require('jayson/promise');var _=require(_0x7a9d('0x2'));var logger=require(_0x7a9d('0x3'))('routing');var client=jayson[_0x7a9d('0x4')]['http']({'port':0x232a});function request(_0x400ff8,_0xa39a35){return new BPromise(function(_0x58f43c,_0x1b3fcd){return client['request'](_0x400ff8,_0xa39a35)[_0x7a9d('0x5')](function(_0x4159f2){if(_0x4159f2[_0x7a9d('0x6')]){return _0x1b3fcd(_0x4159f2['error']['message']);}else{return _0x58f43c(_0x4159f2[_0x7a9d('0x7')]);}})['catch'](function(_0x2e271c){return _0x1b3fcd(_0x2e271c);});});}exports[_0x7a9d('0x8')]=function(_0x3ebd79,_0x505dee,_0x1c58f1){return function(_0x16a805){if(_0x1c58f1[_0x7a9d('0x9')]&&!_0x1c58f1[_0x7a9d('0x9')][_0x3ebd79]){logger[_0x7a9d('0xa')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3ebd79);return _0x16a805[_0x7a9d('0xb')]();}var _0x47680d=[];for(var _0x573e26=0x0;_0x573e26<_0x505dee[_0x7a9d('0xc')];_0x573e26+=0x1){_0x47680d['push'](request(_0x7a9d('0xd'),{'command':util[_0x7a9d('0xe')](_0x7a9d('0xf'),_0x505dee[_0x573e26])})[_0x7a9d('0x5')](function(_0x9d7098){return _0x9d7098&&_0x9d7098[_0x7a9d('0x10')]&&_0x9d7098['message'][_0x7a9d('0x11')](_0x7a9d('0x12'))>=0x0?!![]:![];})[_0x7a9d('0x13')](function(_0x5ded0f){logger[_0x7a9d('0x6')](_0x7a9d('0x14'),_0x3ebd79,_0x505dee[_0x573e26]);}));}BPromise[_0x7a9d('0x15')](_0x47680d)[_0x7a9d('0x5')](function(_0x37e3bb){var _0x562ca5=_[_0x7a9d('0x16')](_0x37e3bb);logger[_0x7a9d('0xa')](_0x7a9d('0x17'),_0x3ebd79,_0x505dee[_0x7a9d('0x18')]('\x20|\x20'),_0x562ca5);_0x16a805[_0x7a9d('0x19')](_0x562ca5);})['catch'](function(_0x288742){console[_0x7a9d('0x1a')](_0x288742);logger[_0x7a9d('0x6')]('[%s][INTERVAL]\x20%s\x20%s',_0x3ebd79,_0x505dee[_0x7a9d('0x18')]('\x20|\x20'),_0x288742[_0x7a9d('0x1b')]);_0x16a805[_0x7a9d('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 0e1d07b..20d63e4 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 _0x1be1=['destuniqueid','agentcalled','debug','called','error','[%s][agents][agentcalled]','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','lastevent','timeout','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','reason','holdtime','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request'];(function(_0x31c410,_0x465c95){var _0x47b5c4=function(_0x307ba7){while(--_0x307ba7){_0x31c410['push'](_0x31c410['shift']());}};_0x47b5c4(++_0x465c95);}(_0x1be1,0x192));var _0x11be=function(_0x383b0e,_0x362b29){_0x383b0e=_0x383b0e-0x0;var _0x5070cf=_0x1be1[_0x383b0e];return _0x5070cf;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x11be('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x33a55d,_0x5527b3){utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x3'),_0x33a55d[_0x11be('0x4')],_0x33a55d['channel'],_0x33a55d[_0x11be('0x5')],_0x33a55d[_0x11be('0x6')],_0x33a55d[_0x11be('0x7')],_0x33a55d['calleridnum'],_0x33a55d[_0x11be('0x8')],_0x33a55d['lastevent']));if(_0x33a55d[_0x11be('0x5')]){utils[_0x11be('0x9')](_0x33a55d[_0x11be('0x5')])[_0x11be('0xa')](function(_0x162eaa){if(_0x162eaa){_0x33a55d['type']=_0x162eaa[_0x11be('0xb')];_0x33a55d[_0x11be('0xc')]=_0x33a55d['agentcomplete']?_0x162eaa[_0x11be('0xd')]:![];_0x33a55d[_0x11be('0xe')]=_0x33a55d[_0x11be('0xc')]?_0x162eaa[_0x11be('0xf')]:0x0;}utils['request'](_0x11be('0x10'),_0x33a55d);});}else{utils[_0x11be('0x11')](_0x11be('0x10'),_0x33a55d);}if(_0x5527b3){delete transfers[_0x33a55d['uniqueid']];}else{delete agents[_0x33a55d[_0x11be('0x12')]];}}exports[_0x11be('0x13')]=function(_0x4ce3ae){try{utils[_0x11be('0x14')](util['format']('[%s][agents][agentcalled]',_0x4ce3ae['uniqueid']),_0x4ce3ae);agents[_0x4ce3ae['destuniqueid']]=_0x4ce3ae;agents[_0x4ce3ae['destuniqueid']]['agentcalledAt']=utils['now']();agents[_0x4ce3ae[_0x11be('0x12')]]['lastevent']=_0x11be('0x15');agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x8')]=null;agents[_0x4ce3ae[_0x11be('0x12')]]['connectedlinename']=null;utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4ce3ae[_0x11be('0x4')],agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x6')],_0x4ce3ae['destuniqueid']));}catch(_0x51ba82){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x17'),_0x4ce3ae[_0x11be('0x4')]),_0x51ba82);}};exports['agentringnoanswer']=function(_0x12a5bd){try{if(!_[_0x11be('0x18')](agents[_0x12a5bd[_0x11be('0x12')]])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x19'),_0x12a5bd[_0x11be('0x4')]),_0x12a5bd);utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x1a'),_0x12a5bd['uniqueid'],agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x6')],_0x12a5bd[_0x11be('0x12')]));agents[_0x12a5bd['destuniqueid']]['agentringnoanswer']=!![];agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x1b')]=utils[_0x11be('0x1c')]();agents[_0x12a5bd['destuniqueid']][_0x11be('0x1d')]='timeout';agents[_0x12a5bd[_0x11be('0x12')]]['reason']=_0x11be('0x1e');agents[_0x12a5bd[_0x11be('0x12')]]['holdtime']=_0x12a5bd[_0x11be('0x1f')]?parseInt(_0x12a5bd[_0x11be('0x1f')])/0x3e8:0x0;agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x20')]=0x0;unanswered[_0x11be('0x21')](_0x12a5bd[_0x11be('0x12')]);}}catch(_0xf5a6ac){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][agentringnoanswer]',_0x12a5bd[_0x11be('0x4')]),_0xf5a6ac);}};exports['queuecallerabandon']=function(_0x182f6b){try{_[_0x11be('0x22')](agents,function(_0x510476,_0x584d4c){if(_0x510476[_0x11be('0x4')]==_0x182f6b[_0x11be('0x4')]&&!_[_0x11be('0x23')](unanswered,_0x510476[_0x11be('0x12')])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x24'),_0x182f6b[_0x11be('0x4')]),_0x182f6b);utils[_0x11be('0x1')](util['format'](_0x11be('0x25'),_0x182f6b[_0x11be('0x4')],_0x510476[_0x11be('0x6')],_0x510476[_0x11be('0x12')]));_0x510476[_0x11be('0x26')]=!![];_0x510476[_0x11be('0x1b')]=utils['now']();_0x510476[_0x11be('0x1d')]=_0x11be('0x27');_0x510476[_0x11be('0x28')]=_0x11be('0x27');_0x510476[_0x11be('0x29')]=_0x182f6b['holdtime'];_0x510476[_0x11be('0x20')]=0x0;writeDB(_0x510476);}});}catch(_0x254be5){utils[_0x11be('0x16')](util['format'](_0x11be('0x24'),_0x182f6b['uniqueid']),_0x254be5);}};exports['agentconnect']=function(_0x4c1f4d){try{if(agents[_0x4c1f4d['destuniqueid']]){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x4c1f4d);utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4c1f4d[_0x11be('0x4')],agents[_0x4c1f4d['destuniqueid']][_0x11be('0x6')],_0x4c1f4d['destuniqueid']));agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();agents[_0x4c1f4d[_0x11be('0x12')]]['connectedlinenum']=_0x4c1f4d[_0x11be('0x8')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2c')]=_0x4c1f4d[_0x11be('0x2c')];agents[_0x4c1f4d['destuniqueid']][_0x11be('0x29')]=_0x4c1f4d[_0x11be('0x1f')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x1d')]=_0x11be('0x2d');_[_0x11be('0x22')](agents,function(_0x5742d1,_0x5ee47c){if(_0x5742d1[_0x11be('0x12')]!=_0x4c1f4d[_0x11be('0x12')]&&_0x5742d1['uniqueid']==_0x4c1f4d[_0x11be('0x4')]){_0x5742d1[_0x11be('0x20')]=0x0;_0x5742d1['holdtime']=_0x4c1f4d[_0x11be('0x1f')];_0x5742d1['agentringnoanswer']=!![];_0x5742d1[_0x11be('0x1b')]=utils['now']();_0x5742d1[_0x11be('0x1d')]=_0x11be('0x2e');_0x5742d1['reason']=_0x11be('0x2e');_0x5742d1['answeredelsewheredestinationuniqueid']=_0x4c1f4d[_0x11be('0x12')];_0x5742d1[_0x11be('0x2f')]=_0x4c1f4d[_0x11be('0x6')];writeDB(_0x5742d1);}});}}catch(_0x383604){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x383604);}};exports[_0x11be('0x30')]=function(_0x18cddf){try{if(!_[_0x11be('0x18')](agents[_0x18cddf[_0x11be('0x12')]])){utils['debug'](util['format']('[%s][agents][agentcomplete]',_0x18cddf[_0x11be('0x4')]),_0x18cddf);utils['info'](util[_0x11be('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x18cddf[_0x11be('0x4')],agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x6')],_0x18cddf[_0x11be('0x12')]));agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x30')]=!![];agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt']=utils[_0x11be('0x1c')]();agents[_0x18cddf['destuniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt'],agents[_0x18cddf['destuniqueid']]['agentconnectAt']);agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x28')]=_0x18cddf['reason'];agents[_0x18cddf['destuniqueid']]['lastevent']=_0x11be('0x32');writeDB(agents[_0x18cddf[_0x11be('0x12')]]);}}catch(_0x2cdf2a){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x33'),_0x18cddf[_0x11be('0x4')]),_0x2cdf2a);}};exports[_0x11be('0x34')]=function(_0x2ce110){try{if(!_[_0x11be('0x18')](agents[_0x2ce110[_0x11be('0x35')]])){utils['debug'](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x2ce110);utils['info'](util['format'](_0x11be('0x37'),_0x2ce110['uniqueid'],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x6')],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x4')]));agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x38')]=!![];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x39')]=_0x11be('0x3a');agents[_0x2ce110['transfereruniqueid']][_0x11be('0x3b')]=_0x2ce110['extension'];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x3c')]=agents[_0x2ce110['transfereruniqueid']][_0x11be('0x4')];}}catch(_0x1164a4){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x1164a4);}};exports['attendedtransfer']=function(_0x46764d){try{utils[_0x11be('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x46764d[_0x11be('0x3d')]),_0x46764d);if(_0x46764d[_0x11be('0x3d')]==_0x46764d[_0x11be('0x3e')]){if(!_['isNil'](agents[_0x46764d['secondtransfereruniqueid']])){utils['info'](util[_0x11be('0x2')](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d['secondtransfereruniqueid']]['membername']));agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x39')]='ATTENDED';agents[_0x46764d[_0x11be('0x40')]]['transferexten']=_0x46764d['origtransfererexten'];agents[_0x46764d['secondtransfereruniqueid']]['transferuniqueid']=_0x46764d[_0x11be('0x3d')];}if(_0x46764d[_0x11be('0x41')]&&agents[_0x46764d[_0x11be('0x41')]]){agents[_0x46764d[_0x11be('0x41')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x41')]]=_[_0x11be('0x43')](agents[_0x46764d['transfereeuniqueid']]);transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x44')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x46')]=utils['now']();transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x41')]]['agententerreason']=0x2;}}else if(_0x46764d['secondtransfereruniqueid']==_0x46764d[_0x11be('0x47')]){if(!_[_0x11be('0x18')](agents[_0x46764d[_0x11be('0x3d')]])){utils[_0x11be('0x1')](util['format'](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x6')]));agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x39')]=_0x11be('0x48');agents[_0x46764d['origtransfereruniqueid']]['transferexten']=_0x46764d[_0x11be('0x49')];agents[_0x46764d[_0x11be('0x3d')]]['transferuniqueid']=_0x46764d[_0x11be('0x40')];}if(_0x46764d[_0x11be('0x4a')]&&agents[_0x46764d[_0x11be('0x4a')]]){agents[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x4a')]]=_[_0x11be('0x43')](agents[_0x46764d['transfertargetuniqueid']]);transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x44')];transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x46')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x2;}}}catch(_0x464459){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][attendedtransfer]',_0x46764d['origtransfereruniqueid']),_0x464459);}};exports[_0x11be('0x4b')]=function(_0x554aba){try{utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x4c'),_0x554aba[_0x11be('0x4')]),_0x554aba);if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')]===_0x11be('0x1e')){if(_0x554aba[_0x11be('0x4d')]==='21'){agents[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x4e');agents[_0x554aba[_0x11be('0x4')]]['lastevent']=_0x11be('0x4e');}utils[_0x11be('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba['uniqueid']][_0x11be('0x6')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]));writeDB(agents[_0x554aba['uniqueid']]);var _0x2c80b7=unanswered[_0x11be('0x4f')](_0x554aba[_0x11be('0x4')]);if(_0x2c80b7>-0x1){unanswered[_0x11be('0x50')](_0x2c80b7,0x1);}}if(transfers[_0x554aba[_0x11be('0x4')]]){transfers[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();transfers[_0x554aba['uniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]);transfers[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x52');transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils[_0x11be('0x1')](util['format'](_0x11be('0x53'),_0x554aba[_0x11be('0x4')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x6')],transfers[_0x554aba['uniqueid']][_0x11be('0x28')],transfers[_0x554aba[_0x11be('0x4')]]['lastevent']));writeDB(transfers[_0x554aba[_0x11be('0x4')]],!![]);}if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]){agents[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x554aba[_0x11be('0x4')]]['agentcompleteAt'],agents[_0x554aba[_0x11be('0x4')]]['agentconnectAt']);agents[_0x554aba['uniqueid']][_0x11be('0x28')]=agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x38')]?_0x11be('0x38'):_0x11be('0x52');agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils['info'](util[_0x11be('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba[_0x11be('0x4')]]['membername'],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba['uniqueid']][_0x11be('0x1d')]));writeDB(agents[_0x554aba[_0x11be('0x4')]]);}}catch(_0x56d8d7){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][hangup]',_0x554aba[_0x11be('0x4')]),_0x56d8d7);}}; \ No newline at end of file +var _0x4e81=['[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfer','transfertargetuniqueid','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][agentconnect]','agentconnectAt','connect','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete'];(function(_0xb81680,_0x326f7c){var _0x3c5263=function(_0x7ba2fc){while(--_0x7ba2fc){_0xb81680['push'](_0xb81680['shift']());}};_0x3c5263(++_0x326f7c);}(_0x4e81,0x1bc));var _0x14e8=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x4e81[_0x562faa];return _0xc70f59;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var utils=require(_0x14e8('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x533fb3,_0x4b9800){utils['info'](util[_0x14e8('0x3')](_0x14e8('0x4'),_0x533fb3[_0x14e8('0x5')],_0x533fb3[_0x14e8('0x6')],_0x533fb3[_0x14e8('0x7')],_0x533fb3[_0x14e8('0x8')],_0x533fb3['interface'],_0x533fb3['calleridnum'],_0x533fb3[_0x14e8('0x9')],_0x533fb3[_0x14e8('0xa')]));if(_0x533fb3[_0x14e8('0x7')]){utils[_0x14e8('0xb')](_0x533fb3[_0x14e8('0x7')])[_0x14e8('0xc')](function(_0x39127a){if(_0x39127a){_0x533fb3[_0x14e8('0xd')]=_0x39127a[_0x14e8('0xd')];_0x533fb3['agentacw']=_0x533fb3[_0x14e8('0xe')]?_0x39127a[_0x14e8('0xf')]:![];_0x533fb3[_0x14e8('0x10')]=_0x533fb3[_0x14e8('0x11')]?_0x39127a[_0x14e8('0x12')]:0x0;}utils[_0x14e8('0x13')](_0x14e8('0x14'),_0x533fb3);});}else{utils[_0x14e8('0x13')]('CreateVoiceAgentReport',_0x533fb3);}if(_0x4b9800){delete transfers[_0x533fb3[_0x14e8('0x5')]];}else{delete agents[_0x533fb3['destuniqueid']];}}exports[_0x14e8('0x15')]=function(_0x341d40){try{utils[_0x14e8('0x16')](util['format'](_0x14e8('0x17'),_0x341d40['uniqueid']),_0x341d40);agents[_0x341d40[_0x14e8('0x18')]]=_0x341d40;agents[_0x341d40['destuniqueid']][_0x14e8('0x19')]=utils[_0x14e8('0x1a')]();agents[_0x341d40[_0x14e8('0x18')]][_0x14e8('0xa')]='called';agents[_0x341d40[_0x14e8('0x18')]][_0x14e8('0x9')]=null;agents[_0x341d40[_0x14e8('0x18')]][_0x14e8('0x1b')]=null;utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x1d'),_0x341d40[_0x14e8('0x5')],agents[_0x341d40['destuniqueid']][_0x14e8('0x8')],_0x341d40[_0x14e8('0x18')]));}catch(_0x151f16){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')]('[%s][agents][agentcalled]',_0x341d40[_0x14e8('0x5')]),_0x151f16);}};exports[_0x14e8('0x1f')]=function(_0x2abfec){try{if(!_['isNil'](agents[_0x2abfec[_0x14e8('0x18')]])){utils['debug'](util[_0x14e8('0x3')](_0x14e8('0x20'),_0x2abfec[_0x14e8('0x5')]),_0x2abfec);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x2abfec[_0x14e8('0x5')],agents[_0x2abfec['destuniqueid']][_0x14e8('0x8')],_0x2abfec[_0x14e8('0x18')]));agents[_0x2abfec['destuniqueid']]['agentringnoanswer']=!![];agents[_0x2abfec['destuniqueid']][_0x14e8('0x21')]=utils[_0x14e8('0x1a')]();agents[_0x2abfec[_0x14e8('0x18')]][_0x14e8('0xa')]=_0x14e8('0x22');agents[_0x2abfec['destuniqueid']][_0x14e8('0x23')]=_0x14e8('0x22');agents[_0x2abfec[_0x14e8('0x18')]][_0x14e8('0x24')]=_0x2abfec[_0x14e8('0x25')]?parseInt(_0x2abfec[_0x14e8('0x25')])/0x3e8:0x0;agents[_0x2abfec[_0x14e8('0x18')]]['talktime']=0x0;unanswered[_0x14e8('0x26')](_0x2abfec[_0x14e8('0x18')]);}}catch(_0x393ab0){utils['error'](util['format']('[%s][agents][agentringnoanswer]',_0x2abfec[_0x14e8('0x5')]),_0x393ab0);}};exports[_0x14e8('0x27')]=function(_0x567385){try{_[_0x14e8('0x28')](agents,function(_0x1d71ca,_0x176e8f){if(_0x1d71ca[_0x14e8('0x5')]==_0x567385['uniqueid']&&!_[_0x14e8('0x29')](unanswered,_0x1d71ca[_0x14e8('0x18')])){utils[_0x14e8('0x16')](util[_0x14e8('0x3')](_0x14e8('0x2a'),_0x567385['uniqueid']),_0x567385);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x2b'),_0x567385[_0x14e8('0x5')],_0x1d71ca['membername'],_0x1d71ca[_0x14e8('0x18')]));_0x1d71ca['agentringnoanswer']=!![];_0x1d71ca[_0x14e8('0x21')]=utils[_0x14e8('0x1a')]();_0x1d71ca[_0x14e8('0xa')]=_0x14e8('0x2c');_0x1d71ca[_0x14e8('0x23')]=_0x14e8('0x2c');_0x1d71ca[_0x14e8('0x24')]=_0x567385[_0x14e8('0x24')];_0x1d71ca[_0x14e8('0x2d')]=0x0;writeDB(_0x1d71ca);}});}catch(_0x2acf6a){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')]('[%s][agents][queuecallerabandon]',_0x567385['uniqueid']),_0x2acf6a);}};exports['agentconnect']=function(_0x16ff09){try{if(agents[_0x16ff09['destuniqueid']]){utils[_0x14e8('0x16')](util['format'](_0x14e8('0x2e'),_0x16ff09[_0x14e8('0x5')]),_0x16ff09);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x16ff09[_0x14e8('0x5')],agents[_0x16ff09['destuniqueid']][_0x14e8('0x8')],_0x16ff09[_0x14e8('0x18')]));agents[_0x16ff09[_0x14e8('0x18')]][_0x14e8('0x2f')]=utils[_0x14e8('0x1a')]();agents[_0x16ff09[_0x14e8('0x18')]]['connectedlinenum']=_0x16ff09[_0x14e8('0x9')];agents[_0x16ff09['destuniqueid']][_0x14e8('0x1b')]=_0x16ff09[_0x14e8('0x1b')];agents[_0x16ff09[_0x14e8('0x18')]]['holdtime']=_0x16ff09[_0x14e8('0x25')];agents[_0x16ff09[_0x14e8('0x18')]]['lastevent']=_0x14e8('0x30');_[_0x14e8('0x28')](agents,function(_0x1f429a,_0x3a7aa7){if(_0x1f429a[_0x14e8('0x18')]!=_0x16ff09[_0x14e8('0x18')]&&_0x1f429a[_0x14e8('0x5')]==_0x16ff09[_0x14e8('0x5')]){_0x1f429a[_0x14e8('0x2d')]=0x0;_0x1f429a[_0x14e8('0x24')]=_0x16ff09[_0x14e8('0x25')];_0x1f429a[_0x14e8('0x1f')]=!![];_0x1f429a[_0x14e8('0x21')]=utils[_0x14e8('0x1a')]();_0x1f429a[_0x14e8('0xa')]='answered_elsewhere';_0x1f429a[_0x14e8('0x23')]='answered_elsewhere';_0x1f429a['answeredelsewheredestinationuniqueid']=_0x16ff09['destuniqueid'];_0x1f429a[_0x14e8('0x31')]=_0x16ff09['membername'];writeDB(_0x1f429a);}});}}catch(_0x46a3c4){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')](_0x14e8('0x2e'),_0x16ff09[_0x14e8('0x5')]),_0x46a3c4);}};exports[_0x14e8('0xe')]=function(_0x125af5){try{if(!_[_0x14e8('0x32')](agents[_0x125af5[_0x14e8('0x18')]])){utils[_0x14e8('0x16')](util[_0x14e8('0x3')]('[%s][agents][agentcomplete]',_0x125af5[_0x14e8('0x5')]),_0x125af5);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x33'),_0x125af5['uniqueid'],agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0x8')],_0x125af5['destuniqueid']));agents[_0x125af5['destuniqueid']][_0x14e8('0xe')]=!![];agents[_0x125af5['destuniqueid']]['agentcompleteAt']=utils[_0x14e8('0x1a')]();agents[_0x125af5[_0x14e8('0x18')]]['talktime']=utils[_0x14e8('0x34')](agents[_0x125af5[_0x14e8('0x18')]]['agentcompleteAt'],agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0x2f')]);agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0x23')]=_0x125af5[_0x14e8('0x23')];agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0xa')]=_0x14e8('0x35');writeDB(agents[_0x125af5[_0x14e8('0x18')]]);}}catch(_0x42180d){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')](_0x14e8('0x36'),_0x125af5[_0x14e8('0x5')]),_0x42180d);}};exports[_0x14e8('0x37')]=function(_0x1f50bc){try{if(!_['isNil'](agents[_0x1f50bc[_0x14e8('0x38')]])){utils['debug'](util[_0x14e8('0x3')](_0x14e8('0x39'),_0x1f50bc[_0x14e8('0x5')]),_0x1f50bc);utils[_0x14e8('0x1c')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1f50bc['uniqueid'],agents[_0x1f50bc[_0x14e8('0x38')]]['membername'],agents[_0x1f50bc['transfereruniqueid']][_0x14e8('0x5')]));agents[_0x1f50bc[_0x14e8('0x38')]]['transfer']=!![];agents[_0x1f50bc[_0x14e8('0x38')]][_0x14e8('0x3a')]=_0x14e8('0x3b');agents[_0x1f50bc[_0x14e8('0x38')]]['transferexten']=_0x1f50bc['extension'];agents[_0x1f50bc[_0x14e8('0x38')]][_0x14e8('0x3c')]=agents[_0x1f50bc[_0x14e8('0x38')]][_0x14e8('0x5')];}}catch(_0x41b5ab){utils[_0x14e8('0x1e')](util['format'](_0x14e8('0x39'),_0x1f50bc[_0x14e8('0x5')]),_0x41b5ab);}};exports[_0x14e8('0x3d')]=function(_0xd5adc1){try{utils['debug'](util[_0x14e8('0x3')](_0x14e8('0x3e'),_0xd5adc1[_0x14e8('0x3f')]),_0xd5adc1);if(_0xd5adc1[_0x14e8('0x3f')]==_0xd5adc1['origtransfererlinkedid']){if(!_[_0x14e8('0x32')](agents[_0xd5adc1[_0x14e8('0x40')]])){utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x41'),_0xd5adc1[_0x14e8('0x3f')],agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x8')]));agents[_0xd5adc1['secondtransfereruniqueid']]['transfer']=!![];agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x3a')]=_0x14e8('0x42');agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x43')]=_0xd5adc1['origtransfererexten'];agents[_0xd5adc1['secondtransfereruniqueid']]['transferuniqueid']=_0xd5adc1[_0x14e8('0x3f')];}if(_0xd5adc1[_0x14e8('0x44')]&&agents[_0xd5adc1[_0x14e8('0x44')]]){agents[_0xd5adc1['transfereeuniqueid']][_0x14e8('0x45')]=0x1;transfers[_0xd5adc1[_0x14e8('0x44')]]=_[_0x14e8('0x46')](agents[_0xd5adc1['transfereeuniqueid']]);transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x47')]=agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x47')];transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x48')]=agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x48')];transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x19')]=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1['transfereeuniqueid']][_0x14e8('0x2f')]=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x24')]=0x0;transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x45')]=0x2;}}else if(_0xd5adc1[_0x14e8('0x40')]==_0xd5adc1[_0x14e8('0x49')]){if(!_[_0x14e8('0x32')](agents[_0xd5adc1[_0x14e8('0x3f')]])){utils[_0x14e8('0x1c')](util[_0x14e8('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0xd5adc1[_0x14e8('0x3f')],agents[_0xd5adc1[_0x14e8('0x3f')]]['membername']));agents[_0xd5adc1[_0x14e8('0x3f')]][_0x14e8('0x4a')]=!![];agents[_0xd5adc1[_0x14e8('0x3f')]][_0x14e8('0x3a')]=_0x14e8('0x42');agents[_0xd5adc1[_0x14e8('0x3f')]][_0x14e8('0x43')]=_0xd5adc1['secondtransfererexten'];agents[_0xd5adc1['origtransfereruniqueid']]['transferuniqueid']=_0xd5adc1[_0x14e8('0x40')];}if(_0xd5adc1[_0x14e8('0x4b')]&&agents[_0xd5adc1[_0x14e8('0x4b')]]){agents[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x45')]=0x1;transfers[_0xd5adc1[_0x14e8('0x4b')]]=_[_0x14e8('0x46')](agents[_0xd5adc1['transfertargetuniqueid']]);transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x47')]=agents[_0xd5adc1['origtransfereruniqueid']][_0x14e8('0x47')];transfers[_0xd5adc1[_0x14e8('0x4b')]]['calleridname']=agents[_0xd5adc1['origtransfereruniqueid']]['calleridname'];transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x19')]=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1[_0x14e8('0x4b')]]['agentconnectAt']=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x24')]=0x0;transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x45')]=0x2;}}}catch(_0x36d0e5){utils['error'](util[_0x14e8('0x3')](_0x14e8('0x3e'),_0xd5adc1[_0x14e8('0x3f')]),_0x36d0e5);}};exports['hangup']=function(_0x5add74){try{utils[_0x14e8('0x16')](util['format'](_0x14e8('0x4c'),_0x5add74['uniqueid']),_0x5add74);if(agents[_0x5add74[_0x14e8('0x5')]]&&agents[_0x5add74['uniqueid']][_0x14e8('0x23')]===_0x14e8('0x22')){if(_0x5add74['cause']==='21'){agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x23')]=_0x14e8('0x4d');agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]=_0x14e8('0x4d');}utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x4e'),_0x5add74[_0x14e8('0x5')],agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x8')],agents[_0x5add74[_0x14e8('0x5')]]['reason'],agents[_0x5add74['uniqueid']]['lastevent']));writeDB(agents[_0x5add74[_0x14e8('0x5')]]);var _0x52f0a7=unanswered[_0x14e8('0x4f')](_0x5add74['uniqueid']);if(_0x52f0a7>-0x1){unanswered[_0x14e8('0x50')](_0x52f0a7,0x1);}}if(transfers[_0x5add74['uniqueid']]){transfers[_0x5add74['uniqueid']]['agentcomplete']=!![];transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x51')]=utils[_0x14e8('0x1a')]();transfers[_0x5add74['uniqueid']][_0x14e8('0x2d')]=utils['diffTime'](transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x51')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x2f')]);transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x23')]=_0x14e8('0x52');transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]='complete';utils[_0x14e8('0x1c')](util['format'](_0x14e8('0x4e'),_0x5add74[_0x14e8('0x5')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x8')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x23')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]));writeDB(transfers[_0x5add74[_0x14e8('0x5')]],!![]);}if(agents[_0x5add74['uniqueid']]&&agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x2f')]){agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xe')]=!![];agents[_0x5add74['uniqueid']][_0x14e8('0x51')]=utils[_0x14e8('0x1a')]();agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x2d')]=utils['diffTime'](agents[_0x5add74[_0x14e8('0x5')]]['agentcompleteAt'],agents[_0x5add74[_0x14e8('0x5')]]['agentconnectAt']);agents[_0x5add74['uniqueid']][_0x14e8('0x23')]=agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x4a')]?_0x14e8('0x4a'):_0x14e8('0x52');agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]=_0x14e8('0x35');utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x4e'),_0x5add74['uniqueid'],agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x8')],agents[_0x5add74[_0x14e8('0x5')]]['reason'],agents[_0x5add74['uniqueid']][_0x14e8('0xa')]));writeDB(agents[_0x5add74[_0x14e8('0x5')]]);}}catch(_0xc3ebbc){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')](_0x14e8('0x4c'),_0x5add74[_0x14e8('0x5')]),_0xc3ebbc);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 438b25e..4f9362c 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 _0x4e99=['channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','endtime','duration','diffTime','starttime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','gotoif','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','format','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil'];(function(_0x5ed2e5,_0x13ae2e){var _0x578fc6=function(_0x55d796){while(--_0x55d796){_0x5ed2e5['push'](_0x5ed2e5['shift']());}};_0x578fc6(++_0x13ae2e);}(_0x4e99,0x122));var _0x94e9=function(_0x46b58b,_0x4002db){_0x46b58b=_0x46b58b-0x0;var _0x332218=_0x4e99[_0x46b58b];return _0x332218;};'use strict';var _=require('lodash');var util=require(_0x94e9('0x0'));var utils=require(_0x94e9('0x1'));var transfers=require(_0x94e9('0x2'));var dispositions=[_0x94e9('0x3'),'FAILED',_0x94e9('0x4'),'NO\x20ANSWER',_0x94e9('0x3'),_0x94e9('0x3'),_0x94e9('0x5'),'BUSY',_0x94e9('0x4'),'FAILED',_0x94e9('0x4')];var channels={};function writeDB(_0x368e50){var _0x3986a4;if(transfers['blinds'][_0x368e50[_0x94e9('0x6')]]){_0x3986a4=_0x368e50[_0x94e9('0x6')];_0x368e50['uniqueid']=transfers[_0x94e9('0x7')][_0x368e50['uniqueid']][_0x94e9('0x8')];}utils[_0x94e9('0x9')](util['format'](_0x94e9('0xa'),_0x368e50[_0x94e9('0x6')],_0x368e50[_0x94e9('0xb')],_0x368e50[_0x94e9('0xc')],_0x368e50[_0x94e9('0xd')],_0x368e50[_0x94e9('0xe')],_0x368e50[_0x94e9('0xf')],_0x368e50[_0x94e9('0x10')],_0x368e50[_0x94e9('0x11')]));if(_0x368e50[_0x94e9('0x12')]){utils[_0x94e9('0x13')](_0x368e50[_0x94e9('0x12')])[_0x94e9('0x14')](function(_0x4550a7){if(_0x4550a7){_0x368e50[_0x94e9('0x15')]=_0x4550a7['id'];}utils[_0x94e9('0x16')](_0x94e9('0x17'),_0x368e50);});}else{utils[_0x94e9('0x16')]('CreateVoiceCallReport',_0x368e50);}if(channels[_0x368e50[_0x94e9('0x6')]]){delete channels[_0x368e50[_0x94e9('0x6')]];}else if(_0x3986a4&&channels[_0x3986a4]){if(!transfers[_0x94e9('0x7')][_0x3986a4]['recording'])delete transfers['blinds'][_0x3986a4];delete channels[_0x3986a4];}}exports['newchannel']=function(_0x4e8d64){try{utils[_0x94e9('0x18')](util[_0x94e9('0x19')]('[%s][calls][newchannel]',_0x4e8d64[_0x94e9('0x6')]),_0x4e8d64);if(_0x4e8d64['uniqueid']==_0x4e8d64[_0x94e9('0x1a')]&&_0x4e8d64['channel']!=_0x94e9('0x1b')){utils[_0x94e9('0x9')](util['format'](_0x94e9('0x1c'),_0x4e8d64['uniqueid'],_0x4e8d64[_0x94e9('0x1d')],_0x4e8d64['exten']));channels[_0x4e8d64[_0x94e9('0x6')]]={'uniqueid':_0x4e8d64['uniqueid'],'accountcode':_0x4e8d64[_0x94e9('0x12')],'source':_0x4e8d64[_0x94e9('0xf')],'destination':_0x4e8d64[_0x94e9('0x1e')],'destinationcontext':_0x4e8d64[_0x94e9('0x1d')],'channel':_0x4e8d64[_0x94e9('0xb')],'starttime':utils[_0x94e9('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x94e9('0x3'),'amaflags':_0x94e9('0x20')};}}catch(_0x4f7088){utils[_0x94e9('0x21')](util[_0x94e9('0x19')]('[%s][calls][newchannel]',_0x4e8d64['uniqueid']),_0x4f7088);}};exports[_0x94e9('0x22')]=function(_0x38f889){try{utils['debug'](util['format'](_0x94e9('0x23'),_0x38f889[_0x94e9('0x6')]),_0x38f889);if(!_[_0x94e9('0x24')](channels[_0x38f889[_0x94e9('0x6')]])&&_0x38f889[_0x94e9('0x25')]==0x6){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x26'),_0x38f889[_0x94e9('0x6')],_0x38f889['context'],_0x38f889[_0x94e9('0xb')]));if(_[_0x94e9('0x24')](channels[_0x38f889[_0x94e9('0x6')]][_0x94e9('0x27')])){channels[_0x38f889[_0x94e9('0x6')]][_0x94e9('0x27')]=utils[_0x94e9('0x1f')]();}}else if(!_['isNil'](channels[_0x38f889['linkedid']])&&_0x38f889[_0x94e9('0x25')]==0x6&&_0x38f889[_0x94e9('0x1d')]!=_0x94e9('0x28')){utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x38f889[_0x94e9('0x6')],_0x38f889[_0x94e9('0x1a')],_0x38f889['context'],_0x38f889['channel']));channels[_0x38f889[_0x94e9('0x1a')]][_0x94e9('0x12')]=_0x38f889[_0x94e9('0x12')];channels[_0x38f889['linkedid']][_0x94e9('0x29')]=_0x38f889['channel'];if(_[_0x94e9('0x24')](channels[_0x38f889['linkedid']][_0x94e9('0x2a')])){channels[_0x38f889[_0x94e9('0x1a')]][_0x94e9('0x2a')]=utils['now']();}channels[_0x38f889[_0x94e9('0x1a')]][_0x94e9('0x2b')]=dispositions[_[_0x94e9('0x2c')](_0x38f889[_0x94e9('0x25')])]||_0x94e9('0x5');}}catch(_0xd5971f){utils[_0x94e9('0x21')](util[_0x94e9('0x19')]('[%s][calls][newstate]',_0x38f889[_0x94e9('0x6')]),_0xd5971f);}};exports[_0x94e9('0x2d')]=function(_0x44b014){try{if(!_[_0x94e9('0x24')](channels[_0x44b014[_0x94e9('0x6')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')]('[%s][calls][hangup]',_0x44b014['uniqueid']),_0x44b014);if(_[_0x94e9('0x24')](channels[_0x44b014['uniqueid']][_0x94e9('0x2e')])){channels[_0x44b014['uniqueid']]['callerid']=_0x44b014[_0x94e9('0x2f')]+'\x20<'+_0x44b014[_0x94e9('0xf')]+'>';}utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x44b014['uniqueid'],channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x2e')],_0x44b014['cause-txt']));channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x30')]=utils['now']();channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x31')]=utils[_0x94e9('0x32')](channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x30')],channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x33')]);channels[_0x44b014[_0x94e9('0x6')]]['billableseconds']=channels[_0x44b014[_0x94e9('0x6')]][_0x94e9('0x2a')]?utils[_0x94e9('0x32')](channels[_0x44b014['uniqueid']]['endtime'],channels[_0x44b014['uniqueid']][_0x94e9('0x2a')]):0x0;writeDB(channels[_0x44b014[_0x94e9('0x6')]]);}}catch(_0x4edf27){utils[_0x94e9('0x21')](util[_0x94e9('0x19')](_0x94e9('0x34'),_0x44b014['uniqueid']),_0x4edf27);}};exports[_0x94e9('0x35')]=function(_0x569973){try{if(!_[_0x94e9('0x24')](channels[_0x569973[_0x94e9('0x36')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')]('[%s][calls][attendedtransfer]',_0x569973[_0x94e9('0x37')]),_0x569973);if(channels[_0x569973[_0x94e9('0x36')]][_0x94e9('0xb')]==_0x569973[_0x94e9('0x38')]){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x39'),_0x569973[_0x94e9('0x37')],_0x569973[_0x94e9('0x36')],_0x569973[_0x94e9('0x3a')]));channels[_0x569973[_0x94e9('0x36')]][_0x94e9('0x29')]=_0x569973[_0x94e9('0x3a')];channels[_0x569973[_0x94e9('0x36')]][_0x94e9('0x3b')]=_0x94e9('0x3c');}else if(channels[_0x569973['localtwolinkedid']][_0x94e9('0xb')]=_0x569973[_0x94e9('0x3d')]){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x39'),_0x569973[_0x94e9('0x37')],_0x569973[_0x94e9('0x36')],_0x569973[_0x94e9('0x3e')]));channels[_0x569973[_0x94e9('0x36')]]['destinationchannel']=_0x569973[_0x94e9('0x3e')];channels[_0x569973[_0x94e9('0x36')]]['userfield']='_attended';}}}catch(_0x254f82){utils['error'](util[_0x94e9('0x19')]('[%s][calls][attendedtransfer]',_0x569973[_0x94e9('0x37')]),_0x254f82);}};exports[_0x94e9('0x3f')]=function(_0x5c9565){try{if(!_[_0x94e9('0x24')](channels[_0x5c9565[_0x94e9('0x6')]])){utils['debug'](util[_0x94e9('0x19')]('[%s][calls][musiconholdstart]',_0x5c9565[_0x94e9('0x6')]),_0x5c9565);channels[_0x5c9565[_0x94e9('0x6')]][_0x94e9('0x40')]=utils[_0x94e9('0x1f')]();utils['info'](util[_0x94e9('0x19')](_0x94e9('0x41'),_0x5c9565['uniqueid'],channels[_0x5c9565[_0x94e9('0x6')]][_0x94e9('0x40')]));}}catch(_0x28c469){utils[_0x94e9('0x21')](util[_0x94e9('0x19')](_0x94e9('0x42'),_0x5c9565['uniqueid']),_0x28c469);}};exports[_0x94e9('0x43')]=function(_0x349582){try{if(!_[_0x94e9('0x24')](channels[_0x349582[_0x94e9('0x6')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')](_0x94e9('0x44'),_0x349582['uniqueid']),_0x349582);if(!_[_0x94e9('0x24')](channels[_0x349582[_0x94e9('0x6')]][_0x94e9('0x40')])){channels[_0x349582[_0x94e9('0x6')]][_0x94e9('0x45')]+=utils[_0x94e9('0x32')](utils['now'](),channels[_0x349582[_0x94e9('0x6')]]['musiconholdstartAt']);utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x46'),_0x349582['uniqueid'],channels[_0x349582[_0x94e9('0x6')]][_0x94e9('0x45')]));delete channels[_0x349582['uniqueid']]['musiconholdstartAt'];}}}catch(_0x459ac9){utils[_0x94e9('0x21')](util['format'](_0x94e9('0x44'),_0x349582[_0x94e9('0x6')]),_0x459ac9);}};exports[_0x94e9('0x47')]=function(_0x51adf2){try{if(!_['isNil'](channels[_0x51adf2[_0x94e9('0x6')]])){utils[_0x94e9('0x18')](util[_0x94e9('0x19')](_0x94e9('0x48'),_0x51adf2['uniqueid']),_0x51adf2);if(!_[_0x94e9('0x24')](_0x51adf2['variable'][_0x94e9('0x49')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x4b')]=_0x51adf2[_0x94e9('0x4a')];}if(!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x4d')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x4e'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x4f')]=_0x51adf2[_0x94e9('0x4a')];channels[_0x51adf2['uniqueid']][_0x94e9('0x2e')]='\x22'+_0x51adf2[_0x94e9('0x4a')]+_0x94e9('0x50')+_0x51adf2[_0x94e9('0x4a')]+'>';}if(!_['isNil'](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x51')])||!_[_0x94e9('0x24')](_0x51adf2['variable'][_0x94e9('0x52')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x53'),_0x51adf2['uniqueid'],!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x51')])?_0x94e9('0x51'):_0x94e9('0x52'),_0x51adf2['value']));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x2e')]=_0x51adf2['value'];}if(!_[_0x94e9('0x24')](_0x51adf2['variable'][_0x94e9('0x54')])||!_['isNil'](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x55')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x53'),_0x51adf2['uniqueid'],!_['isNil'](_0x51adf2['variable']['xmd-queue'])?_0x94e9('0x54'):'xmcs-queue',_0x51adf2['value']));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x56')]=_0x94e9('0x57');channels[_0x51adf2['uniqueid']][_0x94e9('0x58')]=_0x51adf2['value'];channels[_0x51adf2['uniqueid']][_0x94e9('0xc')]=!![];}if(!_[_0x94e9('0x24')](_0x51adf2['variable']['xmd-contactid'])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x59'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]]['ContactId']=_0x51adf2[_0x94e9('0x4a')];}if(!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')]['xmd-cdrtype'])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x5a')]=_0x51adf2['value'];}if(!_['isNil'](_0x51adf2['variable'][_0x94e9('0x5b')])){utils[_0x94e9('0x9')](util[_0x94e9('0x19')](_0x94e9('0x5c'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2[_0x94e9('0x6')]][_0x94e9('0x5d')]=_0x51adf2[_0x94e9('0x4a')];}if(!_[_0x94e9('0x24')](_0x51adf2[_0x94e9('0x4c')][_0x94e9('0x5e')])){utils['info'](util[_0x94e9('0x19')](_0x94e9('0x5f'),_0x51adf2[_0x94e9('0x6')],_0x51adf2[_0x94e9('0x4a')]));channels[_0x51adf2['uniqueid']][_0x94e9('0x5e')]=_0x51adf2[_0x94e9('0x4a')];}}}catch(_0x3ad04a){utils[_0x94e9('0x21')](util[_0x94e9('0x19')]('[%s][calls][varset]',_0x51adf2[_0x94e9('0x6')]),_0x3ad04a);}};exports[_0x94e9('0x60')]=function(_0x4b0898){try{if(!_[_0x94e9('0x24')](channels[_0x4b0898['uniqueid']])){utils['debug'](util[_0x94e9('0x19')](_0x94e9('0x61'),_0x4b0898[_0x94e9('0x6')]),_0x4b0898);utils['info'](util[_0x94e9('0x19')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4b0898['uniqueid'],_0x4b0898[_0x94e9('0x62')],_0x4b0898['appdata']));if(_0x4b0898[_0x94e9('0x62')][_0x94e9('0x63')]()==_0x94e9('0x64')&&_[_0x94e9('0x65')](_0x4b0898[_0x94e9('0x66')][_0x94e9('0x63')](),_0x94e9('0x67'))){var _0x344614=_0x4b0898['appdata'][_0x94e9('0x68')]('=');var _0x49309b=_0x344614[0x0][_0x94e9('0x69')](_0x344614[0x0][_0x94e9('0x6a')]('(')+0x1,_0x344614[0x0][_0x94e9('0x6a')](')'));var _0x27e7cc=_0x344614[0x1];channels[_0x4b0898[_0x94e9('0x6')]][_0x49309b]=_0x27e7cc;}if(!_['includes']([_0x94e9('0x2d'),_0x94e9('0x6b'),'execif','set',_0x94e9('0x6c')],_0x4b0898['application'][_0x94e9('0x63')]())){channels[_0x4b0898[_0x94e9('0x6')]][_0x94e9('0x56')]=_0x4b0898[_0x94e9('0x62')];channels[_0x4b0898[_0x94e9('0x6')]][_0x94e9('0x58')]=_0x4b0898['appdata'];}}}catch(_0x393405){utils[_0x94e9('0x21')](util[_0x94e9('0x19')](_0x94e9('0x61'),_0x4b0898[_0x94e9('0x6')]),_0x393405);}}; \ No newline at end of file +var _0xbccd=['lodash','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','info','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','destinationchannel','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','varset','[%s][calls][varset]','variable','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','execif','gotoif','lastdata'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbccd[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xdbcc('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0xdbcc('0x1'));var dispositions=[_0xdbcc('0x2'),_0xdbcc('0x3'),_0xdbcc('0x3'),_0xdbcc('0x2'),_0xdbcc('0x2'),'NO\x20ANSWER',_0xdbcc('0x4'),_0xdbcc('0x5'),_0xdbcc('0x3'),_0xdbcc('0x3'),_0xdbcc('0x3')];var channels={};function writeDB(_0xf05e4a){var _0x216289;if(transfers[_0xdbcc('0x6')][_0xf05e4a[_0xdbcc('0x7')]]){_0x216289=_0xf05e4a[_0xdbcc('0x7')];_0xf05e4a[_0xdbcc('0x7')]=transfers['blinds'][_0xf05e4a['uniqueid']][_0xdbcc('0x8')];}utils['info'](util[_0xdbcc('0x9')](_0xdbcc('0xa'),_0xf05e4a[_0xdbcc('0x7')],_0xf05e4a[_0xdbcc('0xb')],_0xf05e4a[_0xdbcc('0xc')],_0xf05e4a[_0xdbcc('0xd')],_0xf05e4a[_0xdbcc('0xe')],_0xf05e4a['calleridnum'],_0xf05e4a[_0xdbcc('0xf')],_0xf05e4a['lastevent']));if(_0xf05e4a['accountcode']){utils['getUserByInternal'](_0xf05e4a[_0xdbcc('0x10')])[_0xdbcc('0x11')](function(_0x290b93){if(_0x290b93){_0xf05e4a[_0xdbcc('0x12')]=_0x290b93['id'];}utils[_0xdbcc('0x13')](_0xdbcc('0x14'),_0xf05e4a);});}else{utils[_0xdbcc('0x13')](_0xdbcc('0x14'),_0xf05e4a);}if(channels[_0xf05e4a['uniqueid']]){delete channels[_0xf05e4a['uniqueid']];}else if(_0x216289&&channels[_0x216289]){if(!transfers[_0xdbcc('0x6')][_0x216289][_0xdbcc('0x15')])delete transfers[_0xdbcc('0x6')][_0x216289];delete channels[_0x216289];}}exports[_0xdbcc('0x16')]=function(_0x2d0aed){try{utils[_0xdbcc('0x17')](util[_0xdbcc('0x9')](_0xdbcc('0x18'),_0x2d0aed[_0xdbcc('0x7')]),_0x2d0aed);if(_0x2d0aed[_0xdbcc('0x7')]==_0x2d0aed[_0xdbcc('0x19')]&&_0x2d0aed[_0xdbcc('0xb')]!=_0xdbcc('0x1a')){utils['info'](util['format'](_0xdbcc('0x1b'),_0x2d0aed[_0xdbcc('0x7')],_0x2d0aed['context'],_0x2d0aed[_0xdbcc('0x1c')]));channels[_0x2d0aed['uniqueid']]={'uniqueid':_0x2d0aed[_0xdbcc('0x7')],'accountcode':_0x2d0aed['accountcode'],'source':_0x2d0aed['calleridnum'],'destination':_0x2d0aed[_0xdbcc('0x1c')],'destinationcontext':_0x2d0aed[_0xdbcc('0x1d')],'channel':_0x2d0aed[_0xdbcc('0xb')],'starttime':utils[_0xdbcc('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdbcc('0x2'),'amaflags':_0xdbcc('0x1f')};}}catch(_0x2d797a){utils[_0xdbcc('0x20')](util['format'](_0xdbcc('0x18'),_0x2d0aed['uniqueid']),_0x2d797a);}};exports[_0xdbcc('0x21')]=function(_0x3622af){try{utils['debug'](util[_0xdbcc('0x9')](_0xdbcc('0x22'),_0x3622af[_0xdbcc('0x7')]),_0x3622af);if(!_['isNil'](channels[_0x3622af['uniqueid']])&&_0x3622af[_0xdbcc('0x23')]==0x6){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x3622af[_0xdbcc('0x7')],_0x3622af[_0xdbcc('0x1d')],_0x3622af['channel']));if(_[_0xdbcc('0x25')](channels[_0x3622af[_0xdbcc('0x7')]][_0xdbcc('0x26')])){channels[_0x3622af['uniqueid']][_0xdbcc('0x26')]=utils['now']();}}else if(!_[_0xdbcc('0x25')](channels[_0x3622af['linkedid']])&&_0x3622af[_0xdbcc('0x23')]==0x6&&_0x3622af['context']!=_0xdbcc('0x27')){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x28'),_0x3622af[_0xdbcc('0x7')],_0x3622af[_0xdbcc('0x19')],_0x3622af[_0xdbcc('0x1d')],_0x3622af['channel']));channels[_0x3622af[_0xdbcc('0x19')]]['accountcode']=_0x3622af[_0xdbcc('0x10')];channels[_0x3622af['linkedid']]['destinationchannel']=_0x3622af[_0xdbcc('0xb')];if(_[_0xdbcc('0x25')](channels[_0x3622af['linkedid']][_0xdbcc('0x29')])){channels[_0x3622af['linkedid']][_0xdbcc('0x29')]=utils[_0xdbcc('0x1e')]();}channels[_0x3622af[_0xdbcc('0x19')]][_0xdbcc('0x2a')]=dispositions[_[_0xdbcc('0x2b')](_0x3622af['channelstate'])]||_0xdbcc('0x4');}}catch(_0x1e9ac0){utils[_0xdbcc('0x20')](util[_0xdbcc('0x9')]('[%s][calls][newstate]',_0x3622af['uniqueid']),_0x1e9ac0);}};exports[_0xdbcc('0x2c')]=function(_0x51d86f){try{if(!_['isNil'](channels[_0x51d86f[_0xdbcc('0x7')]])){utils[_0xdbcc('0x17')](util[_0xdbcc('0x9')]('[%s][calls][hangup]',_0x51d86f['uniqueid']),_0x51d86f);if(_[_0xdbcc('0x25')](channels[_0x51d86f[_0xdbcc('0x7')]]['callerid'])){channels[_0x51d86f['uniqueid']][_0xdbcc('0x2d')]=_0x51d86f[_0xdbcc('0x2e')]+'\x20<'+_0x51d86f[_0xdbcc('0x2f')]+'>';}utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x30'),_0x51d86f[_0xdbcc('0x7')],channels[_0x51d86f['uniqueid']][_0xdbcc('0x2d')],_0x51d86f['cause-txt']));channels[_0x51d86f[_0xdbcc('0x7')]][_0xdbcc('0x31')]=utils['now']();channels[_0x51d86f[_0xdbcc('0x7')]][_0xdbcc('0x32')]=utils[_0xdbcc('0x33')](channels[_0x51d86f[_0xdbcc('0x7')]][_0xdbcc('0x31')],channels[_0x51d86f[_0xdbcc('0x7')]][_0xdbcc('0x34')]);channels[_0x51d86f[_0xdbcc('0x7')]]['billableseconds']=channels[_0x51d86f[_0xdbcc('0x7')]][_0xdbcc('0x29')]?utils[_0xdbcc('0x33')](channels[_0x51d86f[_0xdbcc('0x7')]]['endtime'],channels[_0x51d86f[_0xdbcc('0x7')]][_0xdbcc('0x29')]):0x0;writeDB(channels[_0x51d86f[_0xdbcc('0x7')]]);}}catch(_0x2f9b62){utils[_0xdbcc('0x20')](util[_0xdbcc('0x9')]('[%s][calls][hangup]',_0x51d86f[_0xdbcc('0x7')]),_0x2f9b62);}};exports['attendedtransfer']=function(_0x4b8333){try{if(!_[_0xdbcc('0x25')](channels[_0x4b8333[_0xdbcc('0x35')]])){utils[_0xdbcc('0x17')](util['format'](_0xdbcc('0x36'),_0x4b8333['origtransfereruniqueid']),_0x4b8333);if(channels[_0x4b8333[_0xdbcc('0x35')]][_0xdbcc('0xb')]==_0x4b8333[_0xdbcc('0x37')]){utils['info'](util[_0xdbcc('0x9')](_0xdbcc('0x38'),_0x4b8333[_0xdbcc('0x39')],_0x4b8333['localtwolinkedid'],_0x4b8333[_0xdbcc('0x3a')]));channels[_0x4b8333[_0xdbcc('0x35')]]['destinationchannel']=_0x4b8333[_0xdbcc('0x3a')];channels[_0x4b8333[_0xdbcc('0x35')]][_0xdbcc('0x3b')]='_attended';}else if(channels[_0x4b8333[_0xdbcc('0x35')]][_0xdbcc('0xb')]=_0x4b8333[_0xdbcc('0x3c')]){utils[_0xdbcc('0x24')](util['format'](_0xdbcc('0x38'),_0x4b8333[_0xdbcc('0x39')],_0x4b8333['localtwolinkedid'],_0x4b8333[_0xdbcc('0x3d')]));channels[_0x4b8333[_0xdbcc('0x35')]][_0xdbcc('0x3e')]=_0x4b8333['origtransfererchannel'];channels[_0x4b8333[_0xdbcc('0x35')]][_0xdbcc('0x3b')]=_0xdbcc('0x3f');}}}catch(_0x4a3369){utils[_0xdbcc('0x20')](util[_0xdbcc('0x9')](_0xdbcc('0x36'),_0x4b8333[_0xdbcc('0x39')]),_0x4a3369);}};exports['musiconholdstart']=function(_0x48541f){try{if(!_[_0xdbcc('0x25')](channels[_0x48541f[_0xdbcc('0x7')]])){utils[_0xdbcc('0x17')](util['format'](_0xdbcc('0x40'),_0x48541f[_0xdbcc('0x7')]),_0x48541f);channels[_0x48541f[_0xdbcc('0x7')]][_0xdbcc('0x41')]=utils['now']();utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x42'),_0x48541f[_0xdbcc('0x7')],channels[_0x48541f[_0xdbcc('0x7')]][_0xdbcc('0x41')]));}}catch(_0x56aa01){utils['error'](util[_0xdbcc('0x9')]('[%s][calls][musiconholdstart]',_0x48541f[_0xdbcc('0x7')]),_0x56aa01);}};exports['musiconholdstop']=function(_0x581f58){try{if(!_[_0xdbcc('0x25')](channels[_0x581f58['uniqueid']])){utils[_0xdbcc('0x17')](util[_0xdbcc('0x9')]('[%s][calls][musiconholdstop]',_0x581f58[_0xdbcc('0x7')]),_0x581f58);if(!_[_0xdbcc('0x25')](channels[_0x581f58['uniqueid']][_0xdbcc('0x41')])){channels[_0x581f58[_0xdbcc('0x7')]][_0xdbcc('0x43')]+=utils[_0xdbcc('0x33')](utils[_0xdbcc('0x1e')](),channels[_0x581f58[_0xdbcc('0x7')]][_0xdbcc('0x41')]);utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x581f58[_0xdbcc('0x7')],channels[_0x581f58[_0xdbcc('0x7')]][_0xdbcc('0x43')]));delete channels[_0x581f58['uniqueid']][_0xdbcc('0x41')];}}}catch(_0xbbe241){utils[_0xdbcc('0x20')](util[_0xdbcc('0x9')]('[%s][calls][musiconholdstop]',_0x581f58[_0xdbcc('0x7')]),_0xbbe241);}};exports[_0xdbcc('0x44')]=function(_0x481168){try{if(!_[_0xdbcc('0x25')](channels[_0x481168[_0xdbcc('0x7')]])){utils[_0xdbcc('0x17')](util[_0xdbcc('0x9')](_0xdbcc('0x45'),_0x481168['uniqueid']),_0x481168);if(!_[_0xdbcc('0x25')](_0x481168[_0xdbcc('0x46')]['xmd-originatecalleridnum'])){utils[_0xdbcc('0x24')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x481168[_0xdbcc('0x7')],_0x481168['value']));channels[_0x481168[_0xdbcc('0x7')]][_0xdbcc('0x47')]=_0x481168['value'];}if(!_['isNil'](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x48')])){utils[_0xdbcc('0x24')](util['format'](_0xdbcc('0x49'),_0x481168['uniqueid'],_0x481168[_0xdbcc('0x4a')]));channels[_0x481168['uniqueid']]['destination']=_0x481168['value'];channels[_0x481168[_0xdbcc('0x7')]][_0xdbcc('0x2d')]='\x22'+_0x481168['value']+_0xdbcc('0x4b')+_0x481168[_0xdbcc('0x4a')]+'>';}if(!_['isNil'](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x4c')])||!_[_0xdbcc('0x25')](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x4d')])){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x481168[_0xdbcc('0x7')],!_[_0xdbcc('0x25')](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x4c')])?_0xdbcc('0x4c'):_0xdbcc('0x4d'),_0x481168[_0xdbcc('0x4a')]));channels[_0x481168['uniqueid']][_0xdbcc('0x2d')]=_0x481168['value'];}if(!_[_0xdbcc('0x25')](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x4e')])||!_[_0xdbcc('0x25')](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x4f')])){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x50'),_0x481168[_0xdbcc('0x7')],!_['isNil'](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x4e')])?_0xdbcc('0x4e'):_0xdbcc('0x4f'),_0x481168[_0xdbcc('0x4a')]));channels[_0x481168[_0xdbcc('0x7')]][_0xdbcc('0x51')]=_0xdbcc('0x52');channels[_0x481168['uniqueid']]['lastdata']=_0x481168[_0xdbcc('0x4a')];channels[_0x481168[_0xdbcc('0x7')]][_0xdbcc('0xc')]=!![];}if(!_[_0xdbcc('0x25')](_0x481168['variable'][_0xdbcc('0x53')])){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x54'),_0x481168[_0xdbcc('0x7')],_0x481168[_0xdbcc('0x4a')]));channels[_0x481168[_0xdbcc('0x7')]][_0xdbcc('0x55')]=_0x481168['value'];}if(!_[_0xdbcc('0x25')](_0x481168['variable'][_0xdbcc('0x56')])){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x57'),_0x481168['uniqueid'],_0x481168[_0xdbcc('0x4a')]));channels[_0x481168[_0xdbcc('0x7')]]['type']=_0x481168[_0xdbcc('0x4a')];}if(!_[_0xdbcc('0x25')](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x58')])){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x59'),_0x481168['uniqueid'],_0x481168[_0xdbcc('0x4a')]));channels[_0x481168[_0xdbcc('0x7')]][_0xdbcc('0x5a')]=_0x481168[_0xdbcc('0x4a')];}if(!_['isNil'](_0x481168[_0xdbcc('0x46')][_0xdbcc('0x5b')])){utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x5c'),_0x481168[_0xdbcc('0x7')],_0x481168['value']));channels[_0x481168[_0xdbcc('0x7')]]['sipcallid']=_0x481168[_0xdbcc('0x4a')];}}}catch(_0x43b162){utils[_0xdbcc('0x20')](util['format'](_0xdbcc('0x45'),_0x481168[_0xdbcc('0x7')]),_0x43b162);}};exports[_0xdbcc('0x5d')]=function(_0x78a97){try{if(!_[_0xdbcc('0x25')](channels[_0x78a97[_0xdbcc('0x7')]])){utils[_0xdbcc('0x17')](util['format'](_0xdbcc('0x5e'),_0x78a97[_0xdbcc('0x7')]),_0x78a97);utils[_0xdbcc('0x24')](util[_0xdbcc('0x9')](_0xdbcc('0x5f'),_0x78a97[_0xdbcc('0x7')],_0x78a97[_0xdbcc('0x60')],_0x78a97[_0xdbcc('0x61')]));if(_0x78a97['application'][_0xdbcc('0x62')]()==_0xdbcc('0x63')&&_[_0xdbcc('0x64')](_0x78a97[_0xdbcc('0x61')][_0xdbcc('0x62')](),_0xdbcc('0x65'))){var _0x36d7bf=_0x78a97[_0xdbcc('0x61')]['split']('=');var _0x549250=_0x36d7bf[0x0][_0xdbcc('0x66')](_0x36d7bf[0x0][_0xdbcc('0x67')]('(')+0x1,_0x36d7bf[0x0][_0xdbcc('0x67')](')'));var _0x55d6bf=_0x36d7bf[0x1];channels[_0x78a97['uniqueid']][_0x549250]=_0x55d6bf;}if(!_[_0xdbcc('0x68')](['hangup','noop',_0xdbcc('0x69'),_0xdbcc('0x63'),_0xdbcc('0x6a')],_0x78a97[_0xdbcc('0x60')][_0xdbcc('0x62')]())){channels[_0x78a97[_0xdbcc('0x7')]][_0xdbcc('0x51')]=_0x78a97[_0xdbcc('0x60')];channels[_0x78a97[_0xdbcc('0x7')]][_0xdbcc('0x6b')]=_0x78a97['appdata'];}}}catch(_0x30c00e){utils[_0xdbcc('0x20')](util[_0xdbcc('0x9')]('[%s][calls][newexten]',_0x78a97['uniqueid']),_0x30c00e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 2e721b3..4991776 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 _0xacc6=['[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x5c9b55,_0x5befc4){var _0x113969=function(_0x5a404d){while(--_0x5a404d){_0x5c9b55['push'](_0x5c9b55['shift']());}};_0x113969(++_0x5befc4);}(_0xacc6,0x11d));var _0x6acc=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xacc6[_0x272638];return _0x19d027;};'use strict';var utils=require(_0x6acc('0x0'));exports[_0x6acc('0x1')]=function(){utils[_0x6acc('0x2')](_0x6acc('0x3'));};exports[_0x6acc('0x4')]=function(){utils[_0x6acc('0x2')]('[core]\x20shutdown');};exports[_0x6acc('0x5')]=function(){utils[_0x6acc('0x2')](_0x6acc('0x6'));};exports[_0x6acc('0x7')]=function(_0x3db805){utils[_0x6acc('0x7')](_0x6acc('0x8'),_0x3db805);};exports[_0x6acc('0x9')]=function(){utils['info'](_0x6acc('0xa'));};exports[_0x6acc('0xb')]=function(_0x2e7648){}; \ No newline at end of file +var _0x9650=['info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','connect'];(function(_0x2dccda,_0x7b8076){var _0x1c06d5=function(_0x450cf7){while(--_0x450cf7){_0x2dccda['push'](_0x2dccda['shift']());}};_0x1c06d5(++_0x7b8076);}(_0x9650,0x106));var _0x0965=function(_0x10b4a3,_0xae9419){_0x10b4a3=_0x10b4a3-0x0;var _0x5d83d5=_0x9650[_0x10b4a3];return _0x5d83d5;};'use strict';var utils=require(_0x0965('0x0'));exports[_0x0965('0x1')]=function(){utils[_0x0965('0x2')]('[core]\x20connected');};exports[_0x0965('0x3')]=function(){utils[_0x0965('0x2')](_0x0965('0x4'));};exports[_0x0965('0x5')]=function(){utils[_0x0965('0x2')](_0x0965('0x6'));};exports[_0x0965('0x7')]=function(_0x36e207){utils['error'](_0x0965('0x8'),_0x36e207);};exports[_0x0965('0x9')]=function(){utils[_0x0965('0x2')](_0x0965('0xa'));};exports['managerevent']=function(_0x2f47ac){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 34c2565..8da4b24 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 _0xc173=['request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','cause-txt','complete','diffTime','billableseconds','[%s][dials][hangup]','./utils','info','format','uniqueid','channel','dialstring','dialstatus'];(function(_0x57d895,_0x19c3cd){var _0x445702=function(_0x1fa774){while(--_0x1fa774){_0x57d895['push'](_0x57d895['shift']());}};_0x445702(++_0x19c3cd);}(_0xc173,0x1d9));var _0x3c17=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc173[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3c17('0x0'));var dials={};function writeDB(_0x1aea6c){utils[_0x3c17('0x1')](util[_0x3c17('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1aea6c[_0x3c17('0x3')],_0x1aea6c[_0x3c17('0x4')],_0x1aea6c[_0x3c17('0x5')],_0x1aea6c['calleridnum'],_0x1aea6c['connectedlinenum'],_0x1aea6c[_0x3c17('0x6')]));utils[_0x3c17('0x7')](_0x3c17('0x8'),_0x1aea6c);delete dials[_0x1aea6c[_0x3c17('0x3')]];}exports[_0x3c17('0x9')]=function(_0x418a46){try{utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0xb'),_0x418a46[_0x3c17('0x3')]),_0x418a46);utils[_0x3c17('0x1')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x418a46[_0x3c17('0x3')],_0x418a46[_0x3c17('0xc')],_0x418a46[_0x3c17('0xd')]));if(_0x418a46['application'][_0x3c17('0xe')]()==_0x3c17('0xf')&&_[_0x3c17('0x10')](_0x418a46[_0x3c17('0xd')][_0x3c17('0xe')](),_0x3c17('0x11'))){var _0x173235=_0x418a46[_0x3c17('0xd')][_0x3c17('0x12')]('=');dials[_0x418a46[_0x3c17('0x3')]]={'routeId':_0x173235[0x1]};}}catch(_0x3fff1f){utils[_0x3c17('0x13')](util['format'](_0x3c17('0xb'),_0x418a46[_0x3c17('0x3')]),_0x3fff1f);}};exports[_0x3c17('0x14')]=function(_0x55ed73){try{utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0x15'),_0x55ed73['uniqueid']),_0x55ed73);if(!_[_0x3c17('0x16')](_0x55ed73[_0x3c17('0x17')][_0x3c17('0x18')])){utils[_0x3c17('0x1')](util['format'](_0x3c17('0x19'),_0x55ed73[_0x3c17('0x3')],_0x55ed73[_0x3c17('0x1a')]));dials[_0x55ed73[_0x3c17('0x3')]]={'routeId':_0x55ed73[_0x3c17('0x1a')]};}}catch(_0x30703a){utils['error'](util[_0x3c17('0x2')](_0x3c17('0x15'),_0x55ed73[_0x3c17('0x3')]),_0x30703a);}};exports['dialbegin']=function(_0x266e3e){try{if(!_[_0x3c17('0x16')](dials[_0x266e3e['uniqueid']])){utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0x1b'),_0x266e3e[_0x3c17('0x3')]),_0x266e3e);dials[_0x266e3e[_0x3c17('0x3')]]=_[_0x3c17('0x1c')](dials[_0x266e3e[_0x3c17('0x3')]],_0x266e3e);dials[_0x266e3e[_0x3c17('0x3')]][_0x3c17('0x1d')]=utils['now']();dials[_0x266e3e[_0x3c17('0x3')]]['lastevent']=_0x3c17('0x1e');utils['info'](util['format'](_0x3c17('0x1f'),_0x266e3e[_0x3c17('0x3')],dials[_0x266e3e[_0x3c17('0x3')]][_0x3c17('0x1d')]));}}catch(_0x2da5e5){utils[_0x3c17('0x13')](util[_0x3c17('0x2')](_0x3c17('0x1b'),_0x266e3e[_0x3c17('0x3')]),_0x2da5e5);}};exports['dialend']=function(_0x5118f8){try{if(!_[_0x3c17('0x16')](dials[_0x5118f8['uniqueid']])){utils[_0x3c17('0xa')](util[_0x3c17('0x2')](_0x3c17('0x20'),_0x5118f8[_0x3c17('0x3')]),_0x5118f8);dials[_0x5118f8[_0x3c17('0x3')]]['dialstatus']=_0x5118f8[_0x3c17('0x6')];if(_0x5118f8[_0x3c17('0x6')]==_0x3c17('0x21')){dials[_0x5118f8['uniqueid']]=_['assign'](dials[_0x5118f8[_0x3c17('0x3')]],_0x5118f8);dials[_0x5118f8[_0x3c17('0x3')]]['answertime']=utils[_0x3c17('0x22')]();dials[_0x5118f8[_0x3c17('0x3')]][_0x3c17('0x23')]=_0x3c17('0x24');utils[_0x3c17('0x1')](util[_0x3c17('0x2')](_0x3c17('0x25'),_0x5118f8['uniqueid'],_0x5118f8[_0x3c17('0x6')],dials[_0x5118f8[_0x3c17('0x3')]][_0x3c17('0x26')]));}else{utils[_0x3c17('0x1')](util[_0x3c17('0x2')](_0x3c17('0x27'),_0x5118f8[_0x3c17('0x3')],_0x5118f8[_0x3c17('0x6')]));}}}catch(_0x31ec16){utils[_0x3c17('0x13')](util[_0x3c17('0x2')]('[%s][dials][dialend]',_0x5118f8[_0x3c17('0x3')]),_0x31ec16);}};exports[_0x3c17('0x28')]=function(_0x3ea118){try{if(!_[_0x3c17('0x16')](dials[_0x3ea118[_0x3c17('0x3')]])){utils[_0x3c17('0xa')](util[_0x3c17('0x2')]('[%s][dials][hangup]',_0x3ea118[_0x3c17('0x3')]),_0x3ea118);utils[_0x3c17('0x1')](util[_0x3c17('0x2')](_0x3c17('0x29'),_0x3ea118[_0x3c17('0x3')],_0x3ea118[_0x3c17('0x2a')],_0x3ea118['calleridname'],_0x3ea118[_0x3c17('0x2b')]));dials[_0x3ea118[_0x3c17('0x3')]]=_[_0x3c17('0x1c')](dials[_0x3ea118[_0x3c17('0x3')]],{'endtime':utils[_0x3c17('0x22')](),'lastevent':_0x3c17('0x2c')});dials[_0x3ea118[_0x3c17('0x3')]]['duration']=utils[_0x3c17('0x2d')](dials[_0x3ea118[_0x3c17('0x3')]]['endtime'],dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x1d')]);dials[_0x3ea118[_0x3c17('0x3')]]['holdtime']=utils['diffTime'](dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x26')]||dials[_0x3ea118[_0x3c17('0x3')]]['endtime'],dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x1d')]);dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x2e')]=dials[_0x3ea118['uniqueid']]['answertime']?utils[_0x3c17('0x2d')](dials[_0x3ea118['uniqueid']]['endtime'],dials[_0x3ea118[_0x3c17('0x3')]][_0x3c17('0x26')]):0x0;writeDB(dials[_0x3ea118[_0x3c17('0x3')]]);}}catch(_0x123e74){utils[_0x3c17('0x13')](util[_0x3c17('0x2')](_0x3c17('0x2f'),_0x3ea118[_0x3c17('0x3')]),_0x123e74);}}; \ No newline at end of file +var _0x88b4=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','holdtime','billableseconds','util','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','error','[%s][dials][varset]','variable','outboundrouteid','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]'];(function(_0x3294c1,_0x56787d){var _0x422f50=function(_0x39ce72){while(--_0x39ce72){_0x3294c1['push'](_0x3294c1['shift']());}};_0x422f50(++_0x56787d);}(_0x88b4,0x9e));var _0x488b=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x88b4[_0x17882c];return _0x355a59;};'use strict';var _=require('lodash');var util=require(_0x488b('0x0'));var utils=require(_0x488b('0x1'));var dials={};function writeDB(_0x1daca8){utils[_0x488b('0x2')](util[_0x488b('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1daca8[_0x488b('0x4')],_0x1daca8[_0x488b('0x5')],_0x1daca8[_0x488b('0x6')],_0x1daca8[_0x488b('0x7')],_0x1daca8[_0x488b('0x8')],_0x1daca8[_0x488b('0x9')]));utils[_0x488b('0xa')](_0x488b('0xb'),_0x1daca8);delete dials[_0x1daca8['uniqueid']];}exports[_0x488b('0xc')]=function(_0x5043a5){try{utils[_0x488b('0xd')](util[_0x488b('0x3')](_0x488b('0xe'),_0x5043a5[_0x488b('0x4')]),_0x5043a5);utils['info'](util[_0x488b('0x3')](_0x488b('0xf'),_0x5043a5['uniqueid'],_0x5043a5['application'],_0x5043a5[_0x488b('0x10')]));if(_0x5043a5[_0x488b('0x11')][_0x488b('0x12')]()==_0x488b('0x13')&&_[_0x488b('0x14')](_0x5043a5['appdata'][_0x488b('0x12')](),'cdr(routeid)')){var _0x54c099=_0x5043a5[_0x488b('0x10')][_0x488b('0x15')]('=');dials[_0x5043a5[_0x488b('0x4')]]={'routeId':_0x54c099[0x1]};}}catch(_0x42b106){utils[_0x488b('0x16')](util[_0x488b('0x3')]('[%s][dials][newexten]',_0x5043a5[_0x488b('0x4')]),_0x42b106);}};exports['varset']=function(_0x24bd41){try{utils[_0x488b('0xd')](util['format'](_0x488b('0x17'),_0x24bd41[_0x488b('0x4')]),_0x24bd41);if(!_['isNil'](_0x24bd41[_0x488b('0x18')][_0x488b('0x19')])){utils[_0x488b('0x2')](util[_0x488b('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x24bd41['uniqueid'],_0x24bd41[_0x488b('0x1a')]));dials[_0x24bd41['uniqueid']]={'routeId':_0x24bd41['value']};}}catch(_0x1bcb19){utils[_0x488b('0x16')](util[_0x488b('0x3')]('[%s][dials][varset]',_0x24bd41['uniqueid']),_0x1bcb19);}};exports[_0x488b('0x1b')]=function(_0x4100db){try{if(!_[_0x488b('0x1c')](dials[_0x4100db[_0x488b('0x4')]])){utils[_0x488b('0xd')](util[_0x488b('0x3')](_0x488b('0x1d'),_0x4100db[_0x488b('0x4')]),_0x4100db);dials[_0x4100db[_0x488b('0x4')]]=_[_0x488b('0x1e')](dials[_0x4100db[_0x488b('0x4')]],_0x4100db);dials[_0x4100db['uniqueid']][_0x488b('0x1f')]=utils[_0x488b('0x20')]();dials[_0x4100db['uniqueid']]['lastevent']='called';utils['info'](util[_0x488b('0x3')](_0x488b('0x21'),_0x4100db[_0x488b('0x4')],dials[_0x4100db[_0x488b('0x4')]][_0x488b('0x1f')]));}}catch(_0x4921bc){utils['error'](util['format'](_0x488b('0x1d'),_0x4100db['uniqueid']),_0x4921bc);}};exports[_0x488b('0x22')]=function(_0x2d09a1){try{if(!_[_0x488b('0x1c')](dials[_0x2d09a1[_0x488b('0x4')]])){utils[_0x488b('0xd')](util[_0x488b('0x3')](_0x488b('0x23'),_0x2d09a1['uniqueid']),_0x2d09a1);dials[_0x2d09a1['uniqueid']][_0x488b('0x9')]=_0x2d09a1[_0x488b('0x9')];if(_0x2d09a1[_0x488b('0x9')]==_0x488b('0x24')){dials[_0x2d09a1[_0x488b('0x4')]]=_[_0x488b('0x1e')](dials[_0x2d09a1[_0x488b('0x4')]],_0x2d09a1);dials[_0x2d09a1['uniqueid']][_0x488b('0x25')]=utils[_0x488b('0x20')]();dials[_0x2d09a1[_0x488b('0x4')]][_0x488b('0x26')]='connect';utils['info'](util[_0x488b('0x3')](_0x488b('0x27'),_0x2d09a1[_0x488b('0x4')],_0x2d09a1[_0x488b('0x9')],dials[_0x2d09a1[_0x488b('0x4')]][_0x488b('0x25')]));}else{utils[_0x488b('0x2')](util[_0x488b('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x2d09a1['uniqueid'],_0x2d09a1[_0x488b('0x9')]));}}}catch(_0x1b0b43){utils[_0x488b('0x16')](util[_0x488b('0x3')](_0x488b('0x23'),_0x2d09a1[_0x488b('0x4')]),_0x1b0b43);}};exports[_0x488b('0x28')]=function(_0x55480d){try{if(!_[_0x488b('0x1c')](dials[_0x55480d[_0x488b('0x4')]])){utils[_0x488b('0xd')](util['format'](_0x488b('0x29'),_0x55480d['uniqueid']),_0x55480d);utils[_0x488b('0x2')](util['format'](_0x488b('0x2a'),_0x55480d[_0x488b('0x4')],_0x55480d['calleridnum'],_0x55480d[_0x488b('0x2b')],_0x55480d[_0x488b('0x2c')]));dials[_0x55480d[_0x488b('0x4')]]=_[_0x488b('0x1e')](dials[_0x55480d[_0x488b('0x4')]],{'endtime':utils[_0x488b('0x20')](),'lastevent':_0x488b('0x2d')});dials[_0x55480d[_0x488b('0x4')]]['duration']=utils[_0x488b('0x2e')](dials[_0x55480d['uniqueid']][_0x488b('0x2f')],dials[_0x55480d[_0x488b('0x4')]][_0x488b('0x1f')]);dials[_0x55480d['uniqueid']][_0x488b('0x30')]=utils['diffTime'](dials[_0x55480d[_0x488b('0x4')]][_0x488b('0x25')]||dials[_0x55480d[_0x488b('0x4')]][_0x488b('0x2f')],dials[_0x55480d[_0x488b('0x4')]][_0x488b('0x1f')]);dials[_0x55480d[_0x488b('0x4')]][_0x488b('0x31')]=dials[_0x55480d[_0x488b('0x4')]][_0x488b('0x25')]?utils[_0x488b('0x2e')](dials[_0x55480d[_0x488b('0x4')]][_0x488b('0x2f')],dials[_0x55480d['uniqueid']][_0x488b('0x25')]):0x0;writeDB(dials[_0x55480d[_0x488b('0x4')]]);}}catch(_0x1c20ef){utils[_0x488b('0x16')](util[_0x488b('0x3')](_0x488b('0x29'),_0x55480d[_0x488b('0x4')]),_0x1c20ef);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index fd35791..870dbb3 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 _0x2675=['./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','error','debug','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x4dd943,_0x5f379e){var _0x4e06ee=function(_0x2c1747){while(--_0x2c1747){_0x4dd943['push'](_0x4dd943['shift']());}};_0x4e06ee(++_0x5f379e);}(_0x2675,0x14b));var _0x5267=function(_0x9b711f,_0xe1b9dd){_0x9b711f=_0x9b711f-0x0;var _0x28608d=_0x2675[_0x9b711f];return _0x28608d;};var AsteriskManager=require(_0x5267('0x0'));var config=require('../../config/environment');var utils=require(_0x5267('0x1'));var util=require(_0x5267('0x2'));var isXDREnabled=config['xdr']&&config[_0x5267('0x3')][_0x5267('0x4')]?!config['xdr']['disabled']:!![];var isProduction=config[_0x5267('0x5')]===_0x5267('0x6')||![];var isLocalAsterisk=config[_0x5267('0x3')]&&config[_0x5267('0x3')][_0x5267('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x5267('0x8')][_0x5267('0x9')],config[_0x5267('0x8')]['ip'],config[_0x5267('0x8')][_0x5267('0xa')],config[_0x5267('0x8')][_0x5267('0xb')],!![]);ami[_0x5267('0xc')]();if(!isXDREnabled){utils['info'](_0x5267('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x5267('0xe'));}else{var agents=require('./agents.controller');var calls=require(_0x5267('0xf'));var queues=require(_0x5267('0x10'));var recordings=require(_0x5267('0x11'));var members=require(_0x5267('0x12'));var dials=require(_0x5267('0x13'));var transfers=require(_0x5267('0x14'));var core=require(_0x5267('0x15'));ami['on'](_0x5267('0x16'),core[_0x5267('0x16')]);ami['on']('shutdown',core[_0x5267('0x17')]);ami['on'](_0x5267('0x18'),core[_0x5267('0x18')]);ami['on']('error',core['error']);ami['on']('close',core[_0x5267('0x19')]);ami['on'](_0x5267('0x1a'),core[_0x5267('0x1a')]);ami['on'](_0x5267('0x1b'),function(_0x5091dd){try{utils['debug'](util['format'](_0x5267('0x1c'),_0x5091dd[_0x5267('0x1d')]),_0x5091dd);members[_0x5267('0x1b')](_0x5091dd);}catch(_0x5c8855){utils[_0x5267('0x1e')](util['format']('[%s][index][devicestatechange]',_0x5091dd[_0x5267('0x1d')]),_0x5c8855);}});ami['on']('agentcalled',function(_0x57ecbf){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x21'),_0x57ecbf[_0x5267('0x22')]),_0x57ecbf);agents['agentcalled'](_0x57ecbf);}catch(_0x3cf95b){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x21'),_0x57ecbf[_0x5267('0x22')]),_0x3cf95b);}});ami['on'](_0x5267('0x23'),function(_0x13e951){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x24'),_0x13e951[_0x5267('0x22')]),_0x13e951);agents[_0x5267('0x23')](_0x13e951);}catch(_0x51a946){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x24'),_0x13e951[_0x5267('0x22')]),_0x51a946);}});ami['on'](_0x5267('0x25'),function(_0xdc519b){try{utils['debug'](util['format']('[%s][index][agentconnect]',_0xdc519b[_0x5267('0x22')]),_0xdc519b);agents['agentconnect'](_0xdc519b);queues[_0x5267('0x25')](_0xdc519b);}catch(_0x24c884){utils['error'](util[_0x5267('0x20')](_0x5267('0x26'),_0xdc519b[_0x5267('0x22')]),_0x24c884);}});ami['on'](_0x5267('0x27'),function(_0xce8a0a){try{utils['debug'](util[_0x5267('0x20')]('[%s][index][agentcomplete]',_0xce8a0a[_0x5267('0x22')]),_0xce8a0a);agents[_0x5267('0x27')](_0xce8a0a);queues[_0x5267('0x27')](_0xce8a0a);members[_0x5267('0x27')](_0xce8a0a);}catch(_0x4dce95){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][agentcomplete]',_0xce8a0a[_0x5267('0x22')]),_0x4dce95);}});ami['on']('queuecallerabandon',function(_0x163e8b){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x28'),_0x163e8b[_0x5267('0x22')]),_0x163e8b);agents['queuecallerabandon'](_0x163e8b);queues['queuecallerabandon'](_0x163e8b);}catch(_0x461dfc){utils['error'](util[_0x5267('0x20')]('[%s][index][queuecallerabandon]',_0x163e8b['uniqueid']),_0x461dfc);}});ami['on']('queuecallerjoin',function(_0x4fbd02){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x29'),_0x4fbd02[_0x5267('0x22')]),_0x4fbd02);queues['queuecallerjoin'](_0x4fbd02);recordings[_0x5267('0x2a')](_0x4fbd02);}catch(_0x319af7){utils['error'](util[_0x5267('0x20')]('[%s][index][queuecallerjoin]',_0x4fbd02[_0x5267('0x22')]),_0x319af7);}});ami['on'](_0x5267('0x2b'),function(_0x1050a9){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x2c'),_0x1050a9[_0x5267('0x22')]),_0x1050a9);queues[_0x5267('0x2b')](_0x1050a9);}catch(_0x2fc479){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][queuecallerleave]',_0x1050a9[_0x5267('0x22')]),_0x2fc479);}});ami['on'](_0x5267('0x2d'),function(_0x31a90a){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x2e'),_0x31a90a[_0x5267('0x22')]),_0x31a90a);queues[_0x5267('0x2d')](_0x31a90a);calls[_0x5267('0x2d')](_0x31a90a);}catch(_0x3b2b36){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][musiconholdstart]',_0x31a90a[_0x5267('0x22')]),_0x3b2b36);}});ami['on'](_0x5267('0x2f'),function(_0x461b09){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')]('[%s][index][musiconholdstop]',_0x461b09[_0x5267('0x22')]),_0x461b09);queues[_0x5267('0x2f')](_0x461b09);calls[_0x5267('0x2f')](_0x461b09);}catch(_0x5be7c8){utils['error'](util[_0x5267('0x20')](_0x5267('0x30'),_0x461b09[_0x5267('0x22')]),_0x5be7c8);}});ami['on'](_0x5267('0x31'),function(_0x31bf70){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')]('[%s][index][newstate]',_0x31bf70[_0x5267('0x22')]),_0x31bf70);calls[_0x5267('0x31')](_0x31bf70);recordings[_0x5267('0x31')](_0x31bf70);}catch(_0x5cdc98){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x32'),_0x31bf70[_0x5267('0x22')]),_0x5cdc98);}});ami['on']('hangup',function(_0x5a323f){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x33'),_0x5a323f[_0x5267('0x22')]),_0x5a323f);calls[_0x5267('0x34')](_0x5a323f);recordings[_0x5267('0x34')](_0x5a323f);dials['hangup'](_0x5a323f);agents[_0x5267('0x34')](_0x5a323f);queues[_0x5267('0x34')](_0x5a323f);}catch(_0x313fef){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][hangup]',_0x5a323f[_0x5267('0x22')]),_0x313fef);}});ami['on'](_0x5267('0x35'),function(_0xf0865d){try{utils[_0x5267('0x1f')](util['format']('[%s][index][cdr]',_0xf0865d['uniqueid']),_0xf0865d);members['cdr'](_0xf0865d);}catch(_0x1ba042){utils[_0x5267('0x1e')](util['format'](_0x5267('0x36'),_0xf0865d['uniqueid']),_0x1ba042);}});ami['on'](_0x5267('0x37'),function(_0x27859){try{utils[_0x5267('0x1f')](util['format'](_0x5267('0x38'),_0x27859['uniqueid']),_0x27859);queues[_0x5267('0x37')](_0x27859);agents[_0x5267('0x37')](_0x27859);transfers['blindtransfer'](_0x27859);recordings[_0x5267('0x37')](_0x27859);}catch(_0x43f40e){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x38'),_0x27859[_0x5267('0x22')]),_0x43f40e);}});ami['on']('attendedtransfer',function(_0x499963){try{utils[_0x5267('0x1f')](util['format'](_0x5267('0x39'),_0x499963[_0x5267('0x3a')]),_0x499963);queues[_0x5267('0x3b')](_0x499963);transfers[_0x5267('0x3b')](_0x499963);agents['attendedtransfer'](_0x499963);calls[_0x5267('0x3b')](_0x499963);}catch(_0x440845){utils[_0x5267('0x1e')](util['format'](_0x5267('0x39'),_0x499963[_0x5267('0x3a')]),_0x440845);}});ami['on'](_0x5267('0x3c'),function(_0x329e2a){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x3d'),_0x329e2a[_0x5267('0x22')]),_0x329e2a);queues[_0x5267('0x3c')](_0x329e2a);recordings[_0x5267('0x3c')](_0x329e2a);calls[_0x5267('0x3c')](_0x329e2a);dials[_0x5267('0x3c')](_0x329e2a);}catch(_0x41b23f){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x3d'),_0x329e2a[_0x5267('0x22')]),_0x41b23f);}});ami['on'](_0x5267('0x3e'),function(_0x77a431){try{utils[_0x5267('0x1f')](util['format'](_0x5267('0x3f'),_0x77a431['uniqueid']),_0x77a431);calls[_0x5267('0x3e')](_0x77a431);recordings['newexten'](_0x77a431);dials['newexten'](_0x77a431);}catch(_0x5cc372){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s][index][newexten]',_0x77a431[_0x5267('0x22')]),_0x5cc372);}});ami['on'](_0x5267('0x40'),function(_0xca2ed1){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x41'),_0xca2ed1['uniqueid']),_0xca2ed1);calls[_0x5267('0x40')](_0xca2ed1);recordings[_0x5267('0x40')](_0xca2ed1);}catch(_0x55cb10){utils['error'](util['format']('[%s][index][newchannel]',_0xca2ed1['uniqueid']),_0x55cb10);}});ami['on'](_0x5267('0x42'),function(_0x40332e){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')](_0x5267('0x43'),_0x40332e['uniqueid']),_0x40332e);dials[_0x5267('0x42')](_0x40332e);}catch(_0x4cb1b9){utils[_0x5267('0x1e')](util[_0x5267('0x20')]('[%s]dialbegin',_0x40332e[_0x5267('0x22')]),_0x4cb1b9);}});ami['on'](_0x5267('0x44'),function(_0xc939c8){try{utils[_0x5267('0x1f')](util[_0x5267('0x20')]('[%s][index][dialend]',_0xc939c8['uniqueid']),_0xc939c8);dials[_0x5267('0x44')](_0xc939c8);}catch(_0x23961e){utils[_0x5267('0x1e')](util[_0x5267('0x20')](_0x5267('0x45'),_0xc939c8[_0x5267('0x22')]),_0x23961e);}});} \ No newline at end of file +var _0xf3c6=['agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','local','asterisk','username','password','keepConnected','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','[%s][index][devicestatechange]','device','format','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xf3c6,0x173));var _0x6f3c=function(_0x13321a,_0x273c96){_0x13321a=_0x13321a-0x0;var _0x452c07=_0xf3c6[_0x13321a];return _0x452c07;};var AsteriskManager=require(_0x6f3c('0x0'));var config=require(_0x6f3c('0x1'));var utils=require(_0x6f3c('0x2'));var util=require('util');var isXDREnabled=config[_0x6f3c('0x3')]&&config[_0x6f3c('0x3')][_0x6f3c('0x4')]?!config[_0x6f3c('0x3')][_0x6f3c('0x4')]:!![];var isProduction=config[_0x6f3c('0x5')]===_0x6f3c('0x6')||![];var isLocalAsterisk=config[_0x6f3c('0x3')]&&config[_0x6f3c('0x3')][_0x6f3c('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x6f3c('0x8')]['port'],config[_0x6f3c('0x8')]['ip'],config[_0x6f3c('0x8')][_0x6f3c('0x9')],config['asterisk'][_0x6f3c('0xa')],!![]);ami[_0x6f3c('0xb')]();if(!isXDREnabled){utils['info'](_0x6f3c('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x6f3c('0xd'));}else{var agents=require(_0x6f3c('0xe'));var calls=require('./calls.controller');var queues=require(_0x6f3c('0xf'));var recordings=require(_0x6f3c('0x10'));var members=require('./members.controller');var dials=require(_0x6f3c('0x11'));var transfers=require(_0x6f3c('0x12'));var core=require(_0x6f3c('0x13'));ami['on']('connect',core[_0x6f3c('0x14')]);ami['on'](_0x6f3c('0x15'),core['shutdown']);ami['on'](_0x6f3c('0x16'),core[_0x6f3c('0x16')]);ami['on'](_0x6f3c('0x17'),core[_0x6f3c('0x17')]);ami['on'](_0x6f3c('0x18'),core[_0x6f3c('0x18')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x6f3c('0x19'),function(_0x14e9b9){try{utils[_0x6f3c('0x1a')](util['format'](_0x6f3c('0x1b'),_0x14e9b9[_0x6f3c('0x1c')]),_0x14e9b9);members[_0x6f3c('0x19')](_0x14e9b9);}catch(_0x1169fb){utils[_0x6f3c('0x17')](util['format'](_0x6f3c('0x1b'),_0x14e9b9['device']),_0x1169fb);}});ami['on']('agentcalled',function(_0x26bcba){try{utils['debug'](util[_0x6f3c('0x1d')](_0x6f3c('0x1e'),_0x26bcba[_0x6f3c('0x1f')]),_0x26bcba);agents[_0x6f3c('0x20')](_0x26bcba);}catch(_0x301a49){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')]('[%s][index][agentcalled]',_0x26bcba[_0x6f3c('0x1f')]),_0x301a49);}});ami['on']('agentringnoanswer',function(_0x165f28){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x21'),_0x165f28[_0x6f3c('0x1f')]),_0x165f28);agents[_0x6f3c('0x22')](_0x165f28);}catch(_0x24f47b){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x21'),_0x165f28['uniqueid']),_0x24f47b);}});ami['on'](_0x6f3c('0x23'),function(_0x2a688f){try{utils['debug'](util[_0x6f3c('0x1d')](_0x6f3c('0x24'),_0x2a688f['uniqueid']),_0x2a688f);agents[_0x6f3c('0x23')](_0x2a688f);queues['agentconnect'](_0x2a688f);}catch(_0x3ba4fc){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x24'),_0x2a688f[_0x6f3c('0x1f')]),_0x3ba4fc);}});ami['on'](_0x6f3c('0x25'),function(_0x120a50){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x26'),_0x120a50[_0x6f3c('0x1f')]),_0x120a50);agents['agentcomplete'](_0x120a50);queues['agentcomplete'](_0x120a50);members['agentcomplete'](_0x120a50);}catch(_0x11e5fa){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x26'),_0x120a50['uniqueid']),_0x11e5fa);}});ami['on'](_0x6f3c('0x27'),function(_0x58e53d){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x28'),_0x58e53d[_0x6f3c('0x1f')]),_0x58e53d);agents[_0x6f3c('0x27')](_0x58e53d);queues[_0x6f3c('0x27')](_0x58e53d);}catch(_0x1ee0f1){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x28'),_0x58e53d[_0x6f3c('0x1f')]),_0x1ee0f1);}});ami['on'](_0x6f3c('0x29'),function(_0x272bea){try{utils[_0x6f3c('0x1a')](util['format'](_0x6f3c('0x2a'),_0x272bea[_0x6f3c('0x1f')]),_0x272bea);queues[_0x6f3c('0x29')](_0x272bea);recordings['queuecallerjoin'](_0x272bea);}catch(_0x590b4c){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')]('[%s][index][queuecallerjoin]',_0x272bea['uniqueid']),_0x590b4c);}});ami['on'](_0x6f3c('0x2b'),function(_0x3ea613){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x2c'),_0x3ea613[_0x6f3c('0x1f')]),_0x3ea613);queues[_0x6f3c('0x2b')](_0x3ea613);}catch(_0x14394a){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x2c'),_0x3ea613[_0x6f3c('0x1f')]),_0x14394a);}});ami['on'](_0x6f3c('0x2d'),function(_0x439398){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x2e'),_0x439398[_0x6f3c('0x1f')]),_0x439398);queues[_0x6f3c('0x2d')](_0x439398);calls['musiconholdstart'](_0x439398);}catch(_0x4e8e26){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x2e'),_0x439398[_0x6f3c('0x1f')]),_0x4e8e26);}});ami['on'](_0x6f3c('0x2f'),function(_0x41b67e){try{utils[_0x6f3c('0x1a')](util['format'](_0x6f3c('0x30'),_0x41b67e[_0x6f3c('0x1f')]),_0x41b67e);queues[_0x6f3c('0x2f')](_0x41b67e);calls[_0x6f3c('0x2f')](_0x41b67e);}catch(_0x20a8d6){utils['error'](util[_0x6f3c('0x1d')](_0x6f3c('0x30'),_0x41b67e[_0x6f3c('0x1f')]),_0x20a8d6);}});ami['on'](_0x6f3c('0x31'),function(_0x4294aa){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x32'),_0x4294aa[_0x6f3c('0x1f')]),_0x4294aa);calls[_0x6f3c('0x31')](_0x4294aa);recordings[_0x6f3c('0x31')](_0x4294aa);}catch(_0x213392){utils['error'](util[_0x6f3c('0x1d')](_0x6f3c('0x32'),_0x4294aa[_0x6f3c('0x1f')]),_0x213392);}});ami['on'](_0x6f3c('0x33'),function(_0x343edc){try{utils[_0x6f3c('0x1a')](util['format'](_0x6f3c('0x34'),_0x343edc[_0x6f3c('0x1f')]),_0x343edc);calls[_0x6f3c('0x33')](_0x343edc);recordings['hangup'](_0x343edc);dials['hangup'](_0x343edc);agents[_0x6f3c('0x33')](_0x343edc);queues[_0x6f3c('0x33')](_0x343edc);}catch(_0x3c9a6a){utils['error'](util[_0x6f3c('0x1d')](_0x6f3c('0x34'),_0x343edc['uniqueid']),_0x3c9a6a);}});ami['on'](_0x6f3c('0x35'),function(_0x312fab){try{utils['debug'](util[_0x6f3c('0x1d')]('[%s][index][cdr]',_0x312fab[_0x6f3c('0x1f')]),_0x312fab);members[_0x6f3c('0x35')](_0x312fab);}catch(_0x12c6e0){utils['error'](util[_0x6f3c('0x1d')]('[%s][index][cdr]',_0x312fab[_0x6f3c('0x1f')]),_0x12c6e0);}});ami['on']('blindtransfer',function(_0x5dbe27){try{utils[_0x6f3c('0x1a')](util['format'](_0x6f3c('0x36'),_0x5dbe27[_0x6f3c('0x1f')]),_0x5dbe27);queues['blindtransfer'](_0x5dbe27);agents[_0x6f3c('0x37')](_0x5dbe27);transfers[_0x6f3c('0x37')](_0x5dbe27);recordings[_0x6f3c('0x37')](_0x5dbe27);}catch(_0x2365ce){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x36'),_0x5dbe27[_0x6f3c('0x1f')]),_0x2365ce);}});ami['on'](_0x6f3c('0x38'),function(_0x140740){try{utils[_0x6f3c('0x1a')](util['format'](_0x6f3c('0x39'),_0x140740['origtransfereruniqueid']),_0x140740);queues[_0x6f3c('0x38')](_0x140740);transfers[_0x6f3c('0x38')](_0x140740);agents[_0x6f3c('0x38')](_0x140740);calls[_0x6f3c('0x38')](_0x140740);}catch(_0x1a0280){utils[_0x6f3c('0x17')](util['format'](_0x6f3c('0x39'),_0x140740['origtransfereruniqueid']),_0x1a0280);}});ami['on'](_0x6f3c('0x3a'),function(_0x4f713c){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x3b'),_0x4f713c['uniqueid']),_0x4f713c);queues[_0x6f3c('0x3a')](_0x4f713c);recordings['varset'](_0x4f713c);calls[_0x6f3c('0x3a')](_0x4f713c);dials[_0x6f3c('0x3a')](_0x4f713c);}catch(_0x31933e){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')](_0x6f3c('0x3b'),_0x4f713c['uniqueid']),_0x31933e);}});ami['on'](_0x6f3c('0x3c'),function(_0x15dc56){try{utils['debug'](util[_0x6f3c('0x1d')](_0x6f3c('0x3d'),_0x15dc56[_0x6f3c('0x1f')]),_0x15dc56);calls[_0x6f3c('0x3c')](_0x15dc56);recordings[_0x6f3c('0x3c')](_0x15dc56);dials[_0x6f3c('0x3c')](_0x15dc56);}catch(_0x5b5c50){utils['error'](util['format'](_0x6f3c('0x3d'),_0x15dc56[_0x6f3c('0x1f')]),_0x5b5c50);}});ami['on'](_0x6f3c('0x3e'),function(_0x34f02c){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')]('[%s][index][newchannel]',_0x34f02c[_0x6f3c('0x1f')]),_0x34f02c);calls[_0x6f3c('0x3e')](_0x34f02c);recordings[_0x6f3c('0x3e')](_0x34f02c);}catch(_0x818461){utils[_0x6f3c('0x17')](util[_0x6f3c('0x1d')]('[%s][index][newchannel]',_0x34f02c[_0x6f3c('0x1f')]),_0x818461);}});ami['on'](_0x6f3c('0x3f'),function(_0x369680){try{utils[_0x6f3c('0x1a')](util[_0x6f3c('0x1d')](_0x6f3c('0x40'),_0x369680[_0x6f3c('0x1f')]),_0x369680);dials['dialbegin'](_0x369680);}catch(_0xbdc8aa){utils['error'](util[_0x6f3c('0x1d')](_0x6f3c('0x41'),_0x369680['uniqueid']),_0xbdc8aa);}});ami['on']('dialend',function(_0xcc18e6){try{utils['debug'](util[_0x6f3c('0x1d')](_0x6f3c('0x42'),_0xcc18e6[_0x6f3c('0x1f')]),_0xcc18e6);dials[_0x6f3c('0x43')](_0xcc18e6);}catch(_0x2529da){utils['error'](util['format'](_0x6f3c('0x42'),_0xcc18e6[_0x6f3c('0x1f')]),_0x2529da);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 0bdcefc..c31d676 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 _0x4e3c=['devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','membername','error','[%s][members][writeDB]','some'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x4e3c,0x1b4));var _0xc4e3=function(_0x4a18f0,_0x903c50){_0x4a18f0=_0x4a18f0-0x0;var _0x158316=_0x4e3c[_0x4a18f0];return _0x158316;};'use strict';var _=require('lodash');var util=require(_0xc4e3('0x0'));var utils=require(_0xc4e3('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xc4e3('0x2')];function writeDB(_0x29269c){utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x5'),_0x29269c[_0xc4e3('0x6')],_0x29269c[_0xc4e3('0x7')],_0x29269c[_0xc4e3('0x8')],_0x29269c[_0xc4e3('0x9')],_0x29269c['membername'],_0x29269c[_0xc4e3('0xa')]));if(_0x29269c['interface']){utils[_0xc4e3('0xb')](_0x29269c['interface'])[_0xc4e3('0xc')](function(_0x5bf803){if(_0x5bf803){_0x29269c['membername']=_0x5bf803[_0xc4e3('0xd')];_0x29269c['internal']=_0x5bf803[_0xc4e3('0xe')];utils[_0xc4e3('0xf')](_0xc4e3('0x10'),_0x29269c);}else{utils[_0xc4e3('0x11')](_0x29269c[_0xc4e3('0x7')][_0xc4e3('0x12')]('/')[0x1])['then'](function(_0x4420d8){if(_0x4420d8){_0x29269c[_0xc4e3('0x13')]=_0x4420d8[_0xc4e3('0xd')];_0x29269c[_0xc4e3('0xe')]=_0x4420d8['internal'];utils[_0xc4e3('0xf')](_0xc4e3('0x10'),_0x29269c);}});}})['catch'](function(_0x24b2c1){utils[_0xc4e3('0x14')](util[_0xc4e3('0x4')](_0xc4e3('0x15'),_0x29269c[_0xc4e3('0x6')]),_0x24b2c1);});}delete members[_0x29269c[_0xc4e3('0x7')]];}function startsWith(_0x3f4a79,_0x27b6c0){return _[_0xc4e3('0x16')](_0x3f4a79,function(_0x229425){return _['startsWith'](_0x27b6c0,_0x229425);});}exports[_0xc4e3('0x17')]=function(_0x1920f8){try{utils[_0xc4e3('0x18')](util[_0xc4e3('0x4')](_0xc4e3('0x19'),members[_0x1920f8[_0xc4e3('0x1a')]]?members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x6')]:_0x1920f8['device']),_0x1920f8);utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x1b'),members[_0x1920f8[_0xc4e3('0x1a')]]?members[_0x1920f8[_0xc4e3('0x1a')]]['uniqueid']:_0x1920f8[_0xc4e3('0x1a')],_0x1920f8[_0xc4e3('0x1c')],_0x1920f8[_0xc4e3('0x1a')]));switch(_0x1920f8[_0xc4e3('0x1c')]){case _0xc4e3('0x1d'):case _0xc4e3('0x1e'):if(!startsWith(exclude,_0x1920f8['device'])){members[_0x1920f8[_0xc4e3('0x1a')]]={'channel':_0xc4e3('0x1f'),'interface':_0x1920f8[_0xc4e3('0x1a')],'type':_0xc4e3('0x20'),'enterAt':utils[_0xc4e3('0x21')](),'role':_0xc4e3('0x22')};}break;case'NOT_INUSE':if(!_[_0xc4e3('0x23')](members[_0x1920f8[_0xc4e3('0x1a')]])){members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x24')]=utils['now']();members[_0x1920f8['device']][_0xc4e3('0x25')]=utils['diffTime'](members[_0x1920f8['device']][_0xc4e3('0x24')],members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x26')]);if(members[_0x1920f8[_0xc4e3('0x1a')]]['uniqueid']){writeDB(members[_0x1920f8[_0xc4e3('0x1a')]]);}}break;default:break;}}catch(_0xa0f471){utils[_0xc4e3('0x14')](util['format'](_0xc4e3('0x19'),members[_0x1920f8[_0xc4e3('0x1a')]]?members[_0x1920f8[_0xc4e3('0x1a')]][_0xc4e3('0x6')]:_0x1920f8[_0xc4e3('0x1a')]),_0xa0f471);}};exports['agentcomplete']=function(_0x59234a){try{if(!_[_0xc4e3('0x23')](members[_0x59234a[_0xc4e3('0x7')]])){utils['debug'](util[_0xc4e3('0x4')](_0xc4e3('0x27'),_0x59234a[_0xc4e3('0x6')]),_0x59234a);utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x28'),_0x59234a['uniqueid'],_0x59234a['interface'],_0x59234a[_0xc4e3('0x29')]));members[_0x59234a[_0xc4e3('0x7')]]=_[_0xc4e3('0x2a')](members[_0x59234a['interface']],{'data4':_0x59234a[_0xc4e3('0x29')],'uniqueid':_0x59234a[_0xc4e3('0x6')]});}}catch(_0x3b7596){utils[_0xc4e3('0x14')](util['format'](_0xc4e3('0x27'),_0x59234a[_0xc4e3('0x6')]),_0x3b7596);}};exports[_0xc4e3('0x2b')]=function(_0xc3f60f){try{utils[_0xc4e3('0x18')](util[_0xc4e3('0x4')](_0xc4e3('0x2c'),_0xc3f60f[_0xc4e3('0x6')]),_0xc3f60f);if(_0xc3f60f[_0xc4e3('0x8')]){var _0x2ca0c1=_0xc3f60f[_0xc4e3('0x8')][_0xc4e3('0x12')]('-')[0x0];if(!_['isNil'](members[_0x2ca0c1])){members[_0x2ca0c1]=_['assign'](members[_0x2ca0c1],{'data1':members[_0x2ca0c1][_0xc4e3('0x2d')]||_0xc3f60f[_0xc4e3('0xa')],'data2':members[_0x2ca0c1]['data2']||_0xc3f60f[_0xc4e3('0x2e')],'data3':members[_0x2ca0c1][_0xc4e3('0x2f')]||_0xc3f60f[_0xc4e3('0x30')],'uniqueid':members[_0x2ca0c1]['uniqueid']||_0xc3f60f['uniqueid']});utils[_0xc4e3('0x3')](util[_0xc4e3('0x4')](_0xc4e3('0x31'),_0xc3f60f[_0xc4e3('0x6')],members[_0x2ca0c1]['data1'],members[_0x2ca0c1][_0xc4e3('0x9')],members[_0x2ca0c1][_0xc4e3('0x2f')]));if(members[_0x2ca0c1][_0xc4e3('0x24')]){writeDB(members[_0x2ca0c1]);}}}if(_0xc3f60f[_0xc4e3('0x32')]){var _0x216a21=_0xc3f60f['destinationchannel'][_0xc4e3('0x12')]('-')[0x0];if(!_[_0xc4e3('0x23')](members[_0x216a21])){members[_0x216a21]=_[_0xc4e3('0x2a')](members[_0x216a21],{'data1':members[_0x216a21][_0xc4e3('0x2d')]||_0xc3f60f[_0xc4e3('0xa')],'data2':members[_0x216a21][_0xc4e3('0x9')]||_0xc3f60f['source'],'data3':members[_0x216a21][_0xc4e3('0x2f')]||_0xc3f60f['destination'],'uniqueid':members[_0x216a21][_0xc4e3('0x6')]||_0xc3f60f[_0xc4e3('0x6')]});utils[_0xc4e3('0x3')](util['format'](_0xc4e3('0x31'),_0xc3f60f[_0xc4e3('0x6')],members[_0x216a21][_0xc4e3('0x2d')],members[_0x216a21][_0xc4e3('0x9')],members[_0x216a21][_0xc4e3('0x2f')]));if(members[_0x216a21][_0xc4e3('0x24')]){writeDB(members[_0x216a21]);}}}}catch(_0x460a17){utils[_0xc4e3('0x14')](util[_0xc4e3('0x4')](_0xc4e3('0x2c'),_0xc3f60f[_0xc4e3('0x6')]),_0x460a17);}}; \ No newline at end of file +var _0xea67=['uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','split','then','CreateMemberReport','error','some','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','isNil','exitAt','duration','diffTime','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','assign','data1','source','destination','data3','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0xea67,0x172));var _0x7ea6=function(_0x4bfd95,_0x1c3b3b){_0x4bfd95=_0x4bfd95-0x0;var _0x1484cd=_0xea67[_0x4bfd95];return _0x1484cd;};'use strict';var _=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var utils=require(_0x7ea6('0x2'));var members={};var exclude=[_0x7ea6('0x3'),'Queue:'];function writeDB(_0x2a7e53){utils[_0x7ea6('0x4')](util[_0x7ea6('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x2a7e53[_0x7ea6('0x6')],_0x2a7e53[_0x7ea6('0x7')],_0x2a7e53[_0x7ea6('0x8')],_0x2a7e53[_0x7ea6('0x9')],_0x2a7e53[_0x7ea6('0xa')],_0x2a7e53[_0x7ea6('0xb')]));if(_0x2a7e53[_0x7ea6('0x7')]){utils[_0x7ea6('0xc')](_0x2a7e53[_0x7ea6('0x7')])['then'](function(_0x208396){if(_0x208396){_0x2a7e53['membername']=_0x208396[_0x7ea6('0xd')];_0x2a7e53[_0x7ea6('0xe')]=_0x208396[_0x7ea6('0xe')];utils[_0x7ea6('0xf')]('CreateMemberReport',_0x2a7e53);}else{utils['getUserByName'](_0x2a7e53[_0x7ea6('0x7')][_0x7ea6('0x10')]('/')[0x1])[_0x7ea6('0x11')](function(_0x4d453b){if(_0x4d453b){_0x2a7e53[_0x7ea6('0xa')]=_0x4d453b[_0x7ea6('0xd')];_0x2a7e53['internal']=_0x4d453b[_0x7ea6('0xe')];utils[_0x7ea6('0xf')](_0x7ea6('0x12'),_0x2a7e53);}});}})['catch'](function(_0xfb4b00){utils[_0x7ea6('0x13')](util['format']('[%s][members][writeDB]',_0x2a7e53[_0x7ea6('0x6')]),_0xfb4b00);});}delete members[_0x2a7e53[_0x7ea6('0x7')]];}function startsWith(_0x2ab7d,_0x48a81){return _[_0x7ea6('0x14')](_0x2ab7d,function(_0x44ebb9){return _['startsWith'](_0x48a81,_0x44ebb9);});}exports[_0x7ea6('0x15')]=function(_0x17f588){try{utils['debug'](util[_0x7ea6('0x5')](_0x7ea6('0x16'),members[_0x17f588['device']]?members[_0x17f588[_0x7ea6('0x17')]][_0x7ea6('0x6')]:_0x17f588[_0x7ea6('0x17')]),_0x17f588);utils[_0x7ea6('0x4')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x17f588[_0x7ea6('0x17')]]?members[_0x17f588[_0x7ea6('0x17')]][_0x7ea6('0x6')]:_0x17f588[_0x7ea6('0x17')],_0x17f588[_0x7ea6('0x18')],_0x17f588[_0x7ea6('0x17')]));switch(_0x17f588[_0x7ea6('0x18')]){case _0x7ea6('0x19'):case _0x7ea6('0x1a'):if(!startsWith(exclude,_0x17f588[_0x7ea6('0x17')])){members[_0x17f588['device']]={'channel':_0x7ea6('0x1b'),'interface':_0x17f588[_0x7ea6('0x17')],'type':_0x7ea6('0x1c'),'enterAt':utils[_0x7ea6('0x1d')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x7ea6('0x1e')](members[_0x17f588['device']])){members[_0x17f588[_0x7ea6('0x17')]][_0x7ea6('0x1f')]=utils[_0x7ea6('0x1d')]();members[_0x17f588['device']][_0x7ea6('0x20')]=utils[_0x7ea6('0x21')](members[_0x17f588[_0x7ea6('0x17')]][_0x7ea6('0x1f')],members[_0x17f588[_0x7ea6('0x17')]]['enterAt']);if(members[_0x17f588['device']]['uniqueid']){writeDB(members[_0x17f588[_0x7ea6('0x17')]]);}}break;default:break;}}catch(_0x287b4e){utils[_0x7ea6('0x13')](util[_0x7ea6('0x5')](_0x7ea6('0x16'),members[_0x17f588['device']]?members[_0x17f588[_0x7ea6('0x17')]][_0x7ea6('0x6')]:_0x17f588[_0x7ea6('0x17')]),_0x287b4e);}};exports[_0x7ea6('0x22')]=function(_0x161fe9){try{if(!_[_0x7ea6('0x1e')](members[_0x161fe9[_0x7ea6('0x7')]])){utils[_0x7ea6('0x23')](util[_0x7ea6('0x5')](_0x7ea6('0x24'),_0x161fe9['uniqueid']),_0x161fe9);utils[_0x7ea6('0x4')](util['format'](_0x7ea6('0x25'),_0x161fe9[_0x7ea6('0x6')],_0x161fe9[_0x7ea6('0x7')],_0x161fe9[_0x7ea6('0x26')]));members[_0x161fe9[_0x7ea6('0x7')]]=_['assign'](members[_0x161fe9[_0x7ea6('0x7')]],{'data4':_0x161fe9[_0x7ea6('0x26')],'uniqueid':_0x161fe9[_0x7ea6('0x6')]});}}catch(_0x2012d5){utils[_0x7ea6('0x13')](util['format'](_0x7ea6('0x24'),_0x161fe9[_0x7ea6('0x6')]),_0x2012d5);}};exports[_0x7ea6('0x27')]=function(_0x250c05){try{utils[_0x7ea6('0x23')](util[_0x7ea6('0x5')](_0x7ea6('0x28'),_0x250c05[_0x7ea6('0x6')]),_0x250c05);if(_0x250c05[_0x7ea6('0x8')]){var _0x3de3a0=_0x250c05['channel']['split']('-')[0x0];if(!_[_0x7ea6('0x1e')](members[_0x3de3a0])){members[_0x3de3a0]=_[_0x7ea6('0x29')](members[_0x3de3a0],{'data1':members[_0x3de3a0][_0x7ea6('0x2a')]||_0x250c05[_0x7ea6('0xb')],'data2':members[_0x3de3a0][_0x7ea6('0x9')]||_0x250c05[_0x7ea6('0x2b')],'data3':members[_0x3de3a0]['data3']||_0x250c05[_0x7ea6('0x2c')],'uniqueid':members[_0x3de3a0][_0x7ea6('0x6')]||_0x250c05[_0x7ea6('0x6')]});utils[_0x7ea6('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x250c05[_0x7ea6('0x6')],members[_0x3de3a0]['data1'],members[_0x3de3a0][_0x7ea6('0x9')],members[_0x3de3a0][_0x7ea6('0x2d')]));if(members[_0x3de3a0][_0x7ea6('0x1f')]){writeDB(members[_0x3de3a0]);}}}if(_0x250c05[_0x7ea6('0x2e')]){var _0x25f88d=_0x250c05[_0x7ea6('0x2e')]['split']('-')[0x0];if(!_['isNil'](members[_0x25f88d])){members[_0x25f88d]=_['assign'](members[_0x25f88d],{'data1':members[_0x25f88d][_0x7ea6('0x2a')]||_0x250c05[_0x7ea6('0xb')],'data2':members[_0x25f88d][_0x7ea6('0x9')]||_0x250c05[_0x7ea6('0x2b')],'data3':members[_0x25f88d][_0x7ea6('0x2d')]||_0x250c05[_0x7ea6('0x2c')],'uniqueid':members[_0x25f88d][_0x7ea6('0x6')]||_0x250c05[_0x7ea6('0x6')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x250c05[_0x7ea6('0x6')],members[_0x25f88d][_0x7ea6('0x2a')],members[_0x25f88d]['data2'],members[_0x25f88d]['data3']));if(members[_0x25f88d][_0x7ea6('0x1f')]){writeDB(members[_0x25f88d]);}}}}catch(_0x4402a6){utils[_0x7ea6('0x13')](util[_0x7ea6('0x5')](_0x7ea6('0x28'),_0x250c05[_0x7ea6('0x6')]),_0x4402a6);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 8ab12e5..cef13d3 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 _0xc580=['[%s][queues][varset]','queuestatus','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','format','position','assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','transfereduniqueid','error'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0xc580,0x1e4));var _0x0c58=function(_0x4bec28,_0x178142){_0x4bec28=_0x4bec28-0x0;var _0x4ac8fe=_0xc580[_0x4bec28];return _0x4ac8fe;};'use strict';var _=require('lodash');var util=require(_0x0c58('0x0'));var utils=require(_0x0c58('0x1'));var queues={};function writeDB(_0x4560e4){utils[_0x0c58('0x2')](util['format'](_0x0c58('0x3'),_0x4560e4[_0x0c58('0x4')],_0x4560e4['channel'],_0x4560e4[_0x0c58('0x5')],_0x4560e4[_0x0c58('0x6')],_0x4560e4[_0x0c58('0x7')],_0x4560e4[_0x0c58('0x8')],_0x4560e4['queuecallerexitreason']));if(_0x4560e4[_0x0c58('0x5')]){utils['getVoiceQueueByName'](_0x4560e4[_0x0c58('0x5')])['then'](function(_0x4c2c7c){if(_0x4c2c7c){_0x4560e4[_0x0c58('0x9')]=_0x4c2c7c[_0x0c58('0x9')];}utils[_0x0c58('0xa')]('CreateVoiceQueueReport',_0x4560e4);});}else{utils[_0x0c58('0xa')](_0x0c58('0xb'),_0x4560e4);}if(_0x4560e4['transfereduniqueid']){delete queues[_0x4560e4['transfereduniqueid']];}else{delete queues[_0x4560e4['uniqueid']];}}exports[_0x0c58('0xc')]=function(_0x310aff){try{utils[_0x0c58('0xd')](util[_0x0c58('0xe')]('[%s][queues][queuecallerjoin]',_0x310aff['uniqueid']),_0x310aff);utils[_0x0c58('0x2')](util[_0x0c58('0xe')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x310aff[_0x0c58('0x4')],_0x310aff[_0x0c58('0x5')],_0x310aff[_0x0c58('0xf')]));queues[_0x310aff[_0x0c58('0x4')]]=_[_0x0c58('0x10')](_0x310aff,{'originalposition':_0x310aff['position'],'queuecallerjoinAt':utils[_0x0c58('0x11')](),'mohtime':0x0});}catch(_0x1eddf3){utils['error'](util['format']('[%s][queues][queuecallerjoin]',_0x310aff[_0x0c58('0x4')]),_0x1eddf3);}};exports[_0x0c58('0x12')]=function(_0x982ea0){try{if(!_[_0x0c58('0x13')](queues[_0x982ea0[_0x0c58('0x4')]])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x14'),_0x982ea0['uniqueid']),_0x982ea0);if(queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x15')]){if(!queues[_0x982ea0['uniqueid']]['queuecallerabandon']&&!queues[_0x982ea0[_0x0c58('0x4')]]['queuecallerexit']){queues[_0x982ea0['uniqueid']][_0x0c58('0x16')]=!![];queues[_0x982ea0['uniqueid']][_0x0c58('0x17')]=utils[_0x0c58('0x11')]();queues[_0x982ea0['uniqueid']]['queuecallerexitreason']=_0x0c58('0x18');}utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x19'),_0x982ea0[_0x0c58('0x4')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1b')]));writeDB(queues[_0x982ea0[_0x0c58('0x4')]]);}else if(queues[_0x982ea0[_0x0c58('0x4')]]['transfereduniqueid']){utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x1c'),_0x982ea0[_0x0c58('0x4')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1d')]));queues[queues[_0x982ea0['uniqueid']][_0x0c58('0x1d')]]=queues[_0x982ea0[_0x0c58('0x4')]];queues[queues[_0x982ea0[_0x0c58('0x4')]][_0x0c58('0x1d')]]['queuecallerenterreason']=0x2;delete queues[_0x982ea0[_0x0c58('0x4')]];}}}catch(_0x6dd9e0){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')](_0x0c58('0x14'),_0x982ea0['uniqueid']),_0x6dd9e0);}};exports['varset']=function(_0x120bcd){try{utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x1f'),_0x120bcd['uniqueid']),_0x120bcd);if(!_[_0x0c58('0x13')](_0x120bcd['variable'][_0x0c58('0x20')])&&_0x120bcd['value']['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x120bcd[_0x0c58('0x4')]])){queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x21')]=![];queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x22')]=null;queues[_0x120bcd['uniqueid']][_0x0c58('0x23')]=!![];queues[_0x120bcd['uniqueid']][_0x0c58('0x24')]=utils['now']();queues[_0x120bcd[_0x0c58('0x4')]]['queuecallerexitreason']=_0x120bcd[_0x0c58('0x25')]['toUpperCase']();utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x26'),_0x120bcd['uniqueid'],queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x1a')],_0x120bcd[_0x0c58('0x25')],queues[_0x120bcd[_0x0c58('0x4')]][_0x0c58('0x1b')]));writeDB(queues[_0x120bcd[_0x0c58('0x4')]]);}}else if(!_[_0x0c58('0x13')](_0x120bcd[_0x0c58('0x27')][_0x0c58('0x28')])){if(!_[_0x0c58('0x13')](queues[_0x120bcd[_0x0c58('0x4')]])&&!queues[_0x120bcd[_0x0c58('0x4')]]['queuecallerabandon']){queues[_0x120bcd['uniqueid']][_0x0c58('0x21')]=![];queues[_0x120bcd['uniqueid']]['queuecallerabandonAt']=null;queues[_0x120bcd['uniqueid']][_0x0c58('0x23')]=!![];queues[_0x120bcd['uniqueid']][_0x0c58('0x24')]=utils[_0x0c58('0x11')]();queues[_0x120bcd['uniqueid']][_0x0c58('0x1b')]=_0x0c58('0x29');utils['info'](util[_0x0c58('0xe')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x120bcd['uniqueid'],queues[_0x120bcd['uniqueid']][_0x0c58('0x1a')],_0x120bcd[_0x0c58('0x25')],queues[_0x120bcd[_0x0c58('0x4')]]['queuecallerexitreason']));}}}catch(_0x5c1180){utils['error'](util[_0x0c58('0xe')]('[%s][queues][varset]',_0x120bcd['uniqueid']),_0x5c1180);}};exports[_0x0c58('0x21')]=function(_0x4d6141){try{if(!_[_0x0c58('0x13')](queues[_0x4d6141['uniqueid']])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x2a'),_0x4d6141[_0x0c58('0x4')]),_0x4d6141);queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x23')]=![];queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x24')]=null;queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x21')]=!![];queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x22')]=utils[_0x0c58('0x11')]();queues[_0x4d6141['uniqueid']][_0x0c58('0x1b')]='ABANDONED';utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x2b'),_0x4d6141[_0x0c58('0x4')],queues[_0x4d6141[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x4d6141['uniqueid']]['queuecallerexitreason']));}}catch(_0x5e2262){utils['error'](util[_0x0c58('0xe')]('[%s][queues][queuecallerabandon]',_0x4d6141[_0x0c58('0x4')]),_0x5e2262);}};exports[_0x0c58('0x2c')]=function(_0x8b2af4){try{if(!_[_0x0c58('0x13')](queues[_0x8b2af4[_0x0c58('0x4')]])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x2d'),_0x8b2af4[_0x0c58('0x4')]),_0x8b2af4);utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x2e'),_0x8b2af4[_0x0c58('0x4')],queues[_0x8b2af4[_0x0c58('0x4')]]['name'],_0x8b2af4[_0x0c58('0x2f')],_0x8b2af4[_0x0c58('0x30')]));queues[_0x8b2af4[_0x0c58('0x4')]][_0x0c58('0x2c')]=!![];queues[_0x8b2af4[_0x0c58('0x4')]]['queuecallerleaveAt']=utils['now']();queues[_0x8b2af4[_0x0c58('0x4')]]['holdtime']=utils[_0x0c58('0x31')](queues[_0x8b2af4[_0x0c58('0x4')]][_0x0c58('0x15')],queues[_0x8b2af4[_0x0c58('0x4')]]['queuecallerjoinAt']);queues[_0x8b2af4[_0x0c58('0x4')]]['position']=_0x8b2af4['position'];queues[_0x8b2af4['uniqueid']][_0x0c58('0x32')]=_0x8b2af4[_0x0c58('0x32')];queues[_0x8b2af4[_0x0c58('0x4')]][_0x0c58('0x2f')]=_0x8b2af4[_0x0c58('0x2f')];queues[_0x8b2af4['uniqueid']][_0x0c58('0x30')]=_0x8b2af4[_0x0c58('0x30')];}}catch(_0x57e2f9){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][queuecallerleave]',_0x8b2af4[_0x0c58('0x4')]),_0x57e2f9);}};exports[_0x0c58('0x33')]=function(_0x4606d){try{if(!_[_0x0c58('0x13')](queues[_0x4606d[_0x0c58('0x4')]])){utils['debug'](util[_0x0c58('0xe')](_0x0c58('0x34'),_0x4606d['uniqueid']),_0x4606d);utils[_0x0c58('0x2')](util['format'](_0x0c58('0x35'),_0x4606d[_0x0c58('0x4')],queues[_0x4606d['uniqueid']][_0x0c58('0x1a')],_0x4606d[_0x0c58('0x36')],_0x4606d[_0x0c58('0x37')]));queues[_0x4606d[_0x0c58('0x4')]][_0x0c58('0x21')]=![];queues[_0x4606d[_0x0c58('0x4')]]['queuecallerabandon']=![];queues[_0x4606d[_0x0c58('0x4')]][_0x0c58('0x22')]=null;queues[_0x4606d[_0x0c58('0x4')]][_0x0c58('0x23')]=![];queues[_0x4606d['uniqueid']][_0x0c58('0x1b')]=null;queues[_0x4606d[_0x0c58('0x4')]]['queuecallerexitAt']=null;queues[_0x4606d['uniqueid']]['assigned']=!![];queues[_0x4606d[_0x0c58('0x4')]]['accountcode']=_0x4606d[_0x0c58('0x37')];queues[_0x4606d[_0x0c58('0x4')]]['lastAssignedTo']=_0x4606d['membername'];}}catch(_0x248361){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')](_0x0c58('0x34'),_0x4606d[_0x0c58('0x4')]),_0x248361);}};exports[_0x0c58('0x38')]=function(_0x22c15d){try{if(!_['isNil'](queues[_0x22c15d['uniqueid']])){if(queues[_0x22c15d[_0x0c58('0x4')]]['queuecallerleaveAt']){utils['debug'](util[_0x0c58('0xe')](_0x0c58('0x39'),_0x22c15d['uniqueid']),_0x22c15d);queues[_0x22c15d['uniqueid']][_0x0c58('0x21')]=![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x21')]=![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x22')]=null;queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x23')]=![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x24')]=null;queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x3a')]=!![];queues[_0x22c15d[_0x0c58('0x4')]]['lastAssignedTo']=_0x22c15d[_0x0c58('0x36')];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x16')]=!![];queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x17')]=utils[_0x0c58('0x11')]();if(_0x22c15d['reason']==_0x0c58('0x3b')){if(!queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x3b')]){queues[_0x22c15d[_0x0c58('0x4')]]['queuecallerexitreason']=_0x0c58('0x3c');}}else{queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x1b')]=_0x0c58('0x3d')+_0x22c15d[_0x0c58('0x3e')][_0x0c58('0x3f')]();}utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x40'),_0x22c15d['uniqueid'],queues[_0x22c15d[_0x0c58('0x4')]][_0x0c58('0x1a')],_0x22c15d[_0x0c58('0x36')],queues[_0x22c15d[_0x0c58('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x22c15d['uniqueid']]);}}}catch(_0x510369){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][agentcomplete]',_0x22c15d[_0x0c58('0x4')]),_0x510369);}};exports[_0x0c58('0x41')]=function(_0x2fc751){try{if(!_[_0x0c58('0x13')](queues[_0x2fc751[_0x0c58('0x42')]])){utils[_0x0c58('0xd')](util['format']('[%s][queues][blindtransfer]',_0x2fc751[_0x0c58('0x4')]),_0x2fc751);queues[_0x2fc751[_0x0c58('0x42')]][_0x0c58('0x3b')]=!![];queues[_0x2fc751[_0x0c58('0x42')]]['transfertype']=_0x0c58('0x43');queues[_0x2fc751[_0x0c58('0x42')]][_0x0c58('0x44')]=_0x2fc751['extension'];queues[_0x2fc751['transfereeuniqueid']][_0x0c58('0x45')]=_0x2fc751[_0x0c58('0x42')];queues[_0x2fc751['transfereeuniqueid']][_0x0c58('0x1b')]=_0x0c58('0x46');utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x47'),_0x2fc751['uniqueid'],queues[_0x2fc751[_0x0c58('0x42')]][_0x0c58('0x1a')],_0x2fc751[_0x0c58('0x42')],_0x2fc751[_0x0c58('0x48')]));}}catch(_0xd49582){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][blindtransfer]',_0x2fc751[_0x0c58('0x4')]),_0xd49582);}};exports[_0x0c58('0x49')]=function(_0x535ac0){try{utils[_0x0c58('0xd')](util[_0x0c58('0xe')](_0x0c58('0x4a'),_0x535ac0[_0x0c58('0x4b')]),_0x535ac0);if(_0x535ac0[_0x0c58('0x4b')]==_0x535ac0['origtransfererlinkedid']){if(!_[_0x0c58('0x13')](queues[_0x535ac0[_0x0c58('0x4c')]])){utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x4d'),_0x535ac0['origtransfereruniqueid'],queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x1a')],_0x535ac0[_0x0c58('0x4e')]));queues[_0x535ac0['secondtransfererlinkedid']][_0x0c58('0x3b')]=!![];queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x4f')]=_0x0c58('0x50');queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x44')]=_0x535ac0['origtransfererexten'];queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x45')]=_0x535ac0[_0x0c58('0x4b')];queues[_0x535ac0['secondtransfererlinkedid']]['queuecallerexitreason']=_0x0c58('0x51');}if(!_[_0x0c58('0x13')](queues[_0x535ac0[_0x0c58('0x52')]])){if(_0x535ac0[_0x0c58('0x53')]&&queues[_0x535ac0['transfereelinkedid']]){queues[_0x535ac0[_0x0c58('0x53')]][_0x0c58('0x54')]=0x1;queues[_0x535ac0[_0x0c58('0x42')]]=_[_0x0c58('0x55')](queues[_0x535ac0[_0x0c58('0x53')]]);queues[_0x535ac0['transfereeuniqueid']][_0x0c58('0x1d')]=_0x535ac0[_0x0c58('0x56')];queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x54')]=0x2;queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x7')]=queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x7')];queues[_0x535ac0['transfereeuniqueid']][_0x0c58('0x57')]=queues[_0x535ac0[_0x0c58('0x4c')]]['calleridname'];queues[_0x535ac0[_0x0c58('0x42')]]['queuecallerjoinAt']=utils[_0x0c58('0x11')]();queues[_0x535ac0[_0x0c58('0x42')]]['queuecallerleaveAt']=utils[_0x0c58('0x11')]();queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x58')]=0x0;queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x59')]=0x0;utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x5a'),_0x535ac0[_0x0c58('0x4b')],queues[_0x535ac0['transfereeuniqueid']]['name'],queues[_0x535ac0[_0x0c58('0x42')]]['calleridnum'],queues[_0x535ac0[_0x0c58('0x42')]][_0x0c58('0x57')]));}else{utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x5b'),_0x535ac0[_0x0c58('0x4b')],queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x1a')],_0x535ac0[_0x0c58('0x4c')]));queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x1d')]=_0x535ac0[_0x0c58('0x4c')];}}}else if(_0x535ac0[_0x0c58('0x5c')]==_0x535ac0['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x535ac0[_0x0c58('0x52')]])){utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x5d'),_0x535ac0['origtransfereruniqueid'],queues[_0x535ac0[_0x0c58('0x52')]]['name'],_0x535ac0['secondtransfereruniqueid'],_0x535ac0[_0x0c58('0x5e')]));queues[_0x535ac0['origtransfererlinkedid']][_0x0c58('0x3b')]=!![];queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x4f')]='ATTENDED';queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x44')]=_0x535ac0[_0x0c58('0x5e')];queues[_0x535ac0[_0x0c58('0x52')]]['transferuniqueid']=_0x535ac0['secondtransfereruniqueid'];queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x1b')]=_0x0c58('0x51');}if(!_[_0x0c58('0x13')](queues[_0x535ac0[_0x0c58('0x4c')]])){if(_0x535ac0[_0x0c58('0x5f')]&&queues[_0x535ac0[_0x0c58('0x5f')]]){queues[_0x535ac0[_0x0c58('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x535ac0[_0x0c58('0x56')]]=_[_0x0c58('0x55')](queues[_0x535ac0[_0x0c58('0x5f')]]);queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x1d')]=_0x535ac0[_0x0c58('0x56')];queues[_0x535ac0['transfertargetuniqueid']][_0x0c58('0x54')]=0x2;queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x7')]=queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x7')];queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x57')]=queues[_0x535ac0[_0x0c58('0x52')]][_0x0c58('0x57')];queues[_0x535ac0['transfertargetuniqueid']][_0x0c58('0x60')]=utils[_0x0c58('0x11')]();queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x15')]=utils[_0x0c58('0x11')]();queues[_0x535ac0['transfertargetuniqueid']][_0x0c58('0x58')]=0x0;queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x59')]=0x0;utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x61'),_0x535ac0['origtransfereruniqueid'],queues[_0x535ac0[_0x0c58('0x56')]]['name'],queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x1d')],queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x7')],queues[_0x535ac0[_0x0c58('0x56')]][_0x0c58('0x57')]));}else{utils[_0x0c58('0x2')](util[_0x0c58('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x535ac0[_0x0c58('0x4b')],queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x1a')],_0x535ac0[_0x0c58('0x52')]));queues[_0x535ac0[_0x0c58('0x4c')]][_0x0c58('0x1d')]=_0x535ac0['origtransfererlinkedid'];}}}}catch(_0x142e17){utils['error'](util[_0x0c58('0xe')]('[%s][queues][attendedtransfer]',_0x535ac0[_0x0c58('0x4b')]),_0x142e17);}};exports['musiconholdstart']=function(_0x1c5317){try{if(!_['isNil'](queues[_0x1c5317[_0x0c58('0x4')]])){utils[_0x0c58('0xd')](util['format']('[%s][queues][musiconholdstart]',_0x1c5317[_0x0c58('0x4')]),_0x1c5317);queues[_0x1c5317[_0x0c58('0x4')]][_0x0c58('0x62')]=utils['now']();utils['info'](util['format'](_0x0c58('0x63'),_0x1c5317[_0x0c58('0x4')],queues[_0x1c5317[_0x0c58('0x4')]][_0x0c58('0x1a')],queues[_0x1c5317[_0x0c58('0x4')]][_0x0c58('0x62')]));}}catch(_0x294840){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')]('[%s][queues][musiconholdstart]',_0x1c5317[_0x0c58('0x4')]),_0x294840);}};exports[_0x0c58('0x64')]=function(_0x333216){try{if(!_[_0x0c58('0x13')](queues[_0x333216[_0x0c58('0x4')]])){if(!_[_0x0c58('0x13')](queues[_0x333216[_0x0c58('0x4')]][_0x0c58('0x62')])){utils[_0x0c58('0xd')](util[_0x0c58('0xe')]('[%s][queues][musiconholdstop]',_0x333216['uniqueid']),_0x333216);queues[_0x333216['uniqueid']]['mohtime']+=utils[_0x0c58('0x31')](utils[_0x0c58('0x11')](),queues[_0x333216[_0x0c58('0x4')]][_0x0c58('0x62')]);utils[_0x0c58('0x2')](util[_0x0c58('0xe')](_0x0c58('0x65'),_0x333216[_0x0c58('0x4')],queues[_0x333216['uniqueid']]['name'],queues[_0x333216[_0x0c58('0x4')]][_0x0c58('0x59')]));delete queues[_0x333216[_0x0c58('0x4')]]['musiconholdstartAt'];}}}catch(_0x136a04){utils[_0x0c58('0x1e')](util[_0x0c58('0xe')](_0x0c58('0x66'),_0x333216[_0x0c58('0x4')]),_0x136a04);}}; \ No newline at end of file +var _0x5417=['assigned','membername','queuecallercompleteAt','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','diffTime','[%s][queues][musiconholdstop]','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','[%s][queues][hangup]','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','varset','isNil','variable','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','queueposition','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','connectedlinename','queuecallerleaveAt','holdtime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','agentcomplete','[%s][queues][agentcomplete]'];(function(_0x205e56,_0x366e77){var _0x489d5d=function(_0x130a84){while(--_0x130a84){_0x205e56['push'](_0x205e56['shift']());}};_0x489d5d(++_0x366e77);}(_0x5417,0x156));var _0x7541=function(_0x695d8a,_0x47eebd){_0x695d8a=_0x695d8a-0x0;var _0x4115c3=_0x5417[_0x695d8a];return _0x4115c3;};'use strict';var _=require('lodash');var util=require(_0x7541('0x0'));var utils=require(_0x7541('0x1'));var queues={};function writeDB(_0x5b43c5){utils[_0x7541('0x2')](util['format'](_0x7541('0x3'),_0x5b43c5[_0x7541('0x4')],_0x5b43c5['channel'],_0x5b43c5[_0x7541('0x5')],_0x5b43c5[_0x7541('0x6')],_0x5b43c5[_0x7541('0x7')],_0x5b43c5[_0x7541('0x8')],_0x5b43c5[_0x7541('0x9')]));if(_0x5b43c5[_0x7541('0x5')]){utils['getVoiceQueueByName'](_0x5b43c5[_0x7541('0x5')])[_0x7541('0xa')](function(_0x3b69a5){if(_0x3b69a5){_0x5b43c5[_0x7541('0xb')]=_0x3b69a5[_0x7541('0xb')];}utils[_0x7541('0xc')](_0x7541('0xd'),_0x5b43c5);});}else{utils[_0x7541('0xc')](_0x7541('0xd'),_0x5b43c5);}if(_0x5b43c5[_0x7541('0xe')]){delete queues[_0x5b43c5[_0x7541('0xe')]];}else{delete queues[_0x5b43c5[_0x7541('0x4')]];}}exports[_0x7541('0xf')]=function(_0x538d5f){try{utils[_0x7541('0x10')](util[_0x7541('0x11')](_0x7541('0x12'),_0x538d5f[_0x7541('0x4')]),_0x538d5f);utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x13'),_0x538d5f['uniqueid'],_0x538d5f[_0x7541('0x5')],_0x538d5f[_0x7541('0x14')]));queues[_0x538d5f[_0x7541('0x4')]]=_[_0x7541('0x15')](_0x538d5f,{'originalposition':_0x538d5f[_0x7541('0x14')],'queuecallerjoinAt':utils[_0x7541('0x16')](),'mohtime':0x0});}catch(_0x53c4ac){utils['error'](util['format']('[%s][queues][queuecallerjoin]',_0x538d5f[_0x7541('0x4')]),_0x53c4ac);}};exports[_0x7541('0x17')]=function(_0x115d5d){try{if(!_['isNil'](queues[_0x115d5d[_0x7541('0x4')]])){utils[_0x7541('0x10')](util[_0x7541('0x11')](_0x7541('0x18'),_0x115d5d[_0x7541('0x4')]),_0x115d5d);if(queues[_0x115d5d[_0x7541('0x4')]]['queuecallerleaveAt']){if(!queues[_0x115d5d['uniqueid']]['queuecallerabandon']&&!queues[_0x115d5d['uniqueid']]['queuecallerexit']){queues[_0x115d5d[_0x7541('0x4')]]['queuecallercomplete']=!![];queues[_0x115d5d[_0x7541('0x4')]]['queuecallercompleteAt']=utils['now']();queues[_0x115d5d['uniqueid']][_0x7541('0x9')]=_0x7541('0x19');}utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x1a'),_0x115d5d[_0x7541('0x4')],queues[_0x115d5d[_0x7541('0x4')]][_0x7541('0x1b')],queues[_0x115d5d[_0x7541('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x115d5d[_0x7541('0x4')]]);}else if(queues[_0x115d5d[_0x7541('0x4')]][_0x7541('0xe')]){utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x1c'),_0x115d5d[_0x7541('0x4')],queues[_0x115d5d['uniqueid']][_0x7541('0x1b')],queues[_0x115d5d[_0x7541('0x4')]]['transfereduniqueid']));queues[queues[_0x115d5d[_0x7541('0x4')]][_0x7541('0xe')]]=queues[_0x115d5d[_0x7541('0x4')]];queues[queues[_0x115d5d[_0x7541('0x4')]][_0x7541('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x115d5d[_0x7541('0x4')]];}}}catch(_0x42df79){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x18'),_0x115d5d[_0x7541('0x4')]),_0x42df79);}};exports[_0x7541('0x1e')]=function(_0x35736d){try{utils[_0x7541('0x10')](util[_0x7541('0x11')]('[%s][queues][varset]',_0x35736d[_0x7541('0x4')]),_0x35736d);if(!_[_0x7541('0x1f')](_0x35736d[_0x7541('0x20')][_0x7541('0x21')])&&_0x35736d[_0x7541('0x22')][_0x7541('0x23')]()!=='CONTINUE'){if(!_[_0x7541('0x1f')](queues[_0x35736d[_0x7541('0x4')]])){queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x24')]=![];queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x25')]=null;queues[_0x35736d[_0x7541('0x4')]]['queuecallerexit']=!![];queues[_0x35736d['uniqueid']][_0x7541('0x26')]=utils[_0x7541('0x16')]();queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x9')]=_0x35736d['value'][_0x7541('0x23')]();utils['info'](util[_0x7541('0x11')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x35736d[_0x7541('0x4')],queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x1b')],_0x35736d[_0x7541('0x22')],queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x9')]));writeDB(queues[_0x35736d['uniqueid']]);}}else if(!_[_0x7541('0x1f')](_0x35736d[_0x7541('0x20')][_0x7541('0x27')])){if(!_['isNil'](queues[_0x35736d[_0x7541('0x4')]])&&!queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x24')]){queues[_0x35736d['uniqueid']][_0x7541('0x24')]=![];queues[_0x35736d['uniqueid']][_0x7541('0x25')]=null;queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x28')]=!![];queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x26')]=utils[_0x7541('0x16')]();queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x9')]='EXITWITHKEY';utils['info'](util[_0x7541('0x11')](_0x7541('0x29'),_0x35736d[_0x7541('0x4')],queues[_0x35736d[_0x7541('0x4')]]['name'],_0x35736d['value'],queues[_0x35736d[_0x7541('0x4')]][_0x7541('0x9')]));}}}catch(_0xef4cb8){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x2a'),_0x35736d[_0x7541('0x4')]),_0xef4cb8);}};exports[_0x7541('0x24')]=function(_0x4fc557){try{if(!_[_0x7541('0x1f')](queues[_0x4fc557[_0x7541('0x4')]])){utils[_0x7541('0x10')](util[_0x7541('0x11')](_0x7541('0x2b'),_0x4fc557[_0x7541('0x4')]),_0x4fc557);queues[_0x4fc557[_0x7541('0x4')]][_0x7541('0x28')]=![];queues[_0x4fc557[_0x7541('0x4')]]['queuecallerexitAt']=null;queues[_0x4fc557[_0x7541('0x4')]][_0x7541('0x24')]=!![];queues[_0x4fc557[_0x7541('0x4')]][_0x7541('0x25')]=utils['now']();queues[_0x4fc557[_0x7541('0x4')]]['queuecallerexitreason']=_0x7541('0x2c');utils['info'](util[_0x7541('0x11')](_0x7541('0x2d'),_0x4fc557[_0x7541('0x4')],queues[_0x4fc557['uniqueid']]['name'],queues[_0x4fc557[_0x7541('0x4')]][_0x7541('0x9')]));}}catch(_0x2640cf){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x2b'),_0x4fc557[_0x7541('0x4')]),_0x2640cf);}};exports['queuecallerleave']=function(_0x57b23d){try{if(!_[_0x7541('0x1f')](queues[_0x57b23d[_0x7541('0x4')]])){utils[_0x7541('0x10')](util[_0x7541('0x11')](_0x7541('0x2e'),_0x57b23d[_0x7541('0x4')]),_0x57b23d);utils['info'](util[_0x7541('0x11')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x57b23d[_0x7541('0x4')],queues[_0x57b23d[_0x7541('0x4')]]['name'],_0x57b23d['connectedlinenum'],_0x57b23d[_0x7541('0x2f')]));queues[_0x57b23d[_0x7541('0x4')]]['queuecallerleave']=!![];queues[_0x57b23d[_0x7541('0x4')]][_0x7541('0x30')]=utils[_0x7541('0x16')]();queues[_0x57b23d[_0x7541('0x4')]][_0x7541('0x31')]=utils['diffTime'](queues[_0x57b23d['uniqueid']][_0x7541('0x30')],queues[_0x57b23d['uniqueid']][_0x7541('0x32')]);queues[_0x57b23d['uniqueid']][_0x7541('0x14')]=_0x57b23d[_0x7541('0x14')];queues[_0x57b23d[_0x7541('0x4')]][_0x7541('0x33')]=_0x57b23d[_0x7541('0x33')];queues[_0x57b23d[_0x7541('0x4')]][_0x7541('0x34')]=_0x57b23d[_0x7541('0x34')];queues[_0x57b23d[_0x7541('0x4')]][_0x7541('0x2f')]=_0x57b23d['connectedlinename'];}}catch(_0x42952f){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x2e'),_0x57b23d[_0x7541('0x4')]),_0x42952f);}};exports['agentconnect']=function(_0x359b2e){try{if(!_[_0x7541('0x1f')](queues[_0x359b2e['uniqueid']])){utils[_0x7541('0x10')](util[_0x7541('0x11')](_0x7541('0x35'),_0x359b2e[_0x7541('0x4')]),_0x359b2e);utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x36'),_0x359b2e['uniqueid'],queues[_0x359b2e[_0x7541('0x4')]][_0x7541('0x1b')],_0x359b2e['membername'],_0x359b2e[_0x7541('0x37')]));queues[_0x359b2e['uniqueid']][_0x7541('0x24')]=![];queues[_0x359b2e[_0x7541('0x4')]][_0x7541('0x24')]=![];queues[_0x359b2e[_0x7541('0x4')]][_0x7541('0x25')]=null;queues[_0x359b2e[_0x7541('0x4')]]['queuecallerexit']=![];queues[_0x359b2e['uniqueid']][_0x7541('0x9')]=null;queues[_0x359b2e['uniqueid']][_0x7541('0x26')]=null;queues[_0x359b2e[_0x7541('0x4')]]['assigned']=!![];queues[_0x359b2e[_0x7541('0x4')]]['accountcode']=_0x359b2e[_0x7541('0x37')];queues[_0x359b2e['uniqueid']]['lastAssignedTo']=_0x359b2e['membername'];}}catch(_0x2fdc60){utils[_0x7541('0x1d')](util['format']('[%s][queues][agentconnect]',_0x359b2e['uniqueid']),_0x2fdc60);}};exports[_0x7541('0x38')]=function(_0x4c37c6){try{if(!_[_0x7541('0x1f')](queues[_0x4c37c6['uniqueid']])){if(queues[_0x4c37c6['uniqueid']][_0x7541('0x30')]){utils['debug'](util[_0x7541('0x11')](_0x7541('0x39'),_0x4c37c6[_0x7541('0x4')]),_0x4c37c6);queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x24')]=![];queues[_0x4c37c6['uniqueid']]['queuecallerabandon']=![];queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x25')]=null;queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x28')]=![];queues[_0x4c37c6['uniqueid']][_0x7541('0x26')]=null;queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x3a')]=!![];queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x6')]=_0x4c37c6[_0x7541('0x3b')];queues[_0x4c37c6[_0x7541('0x4')]]['queuecallercomplete']=!![];queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x3c')]=utils[_0x7541('0x16')]();if(_0x4c37c6['reason']==_0x7541('0x3d')){if(!queues[_0x4c37c6['uniqueid']]['transfer']){queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x9')]=_0x7541('0x3e');}}else{queues[_0x4c37c6[_0x7541('0x4')]][_0x7541('0x9')]=_0x7541('0x3f')+_0x4c37c6['reason'][_0x7541('0x23')]();}utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x40'),_0x4c37c6['uniqueid'],queues[_0x4c37c6[_0x7541('0x4')]]['name'],_0x4c37c6[_0x7541('0x3b')],queues[_0x4c37c6[_0x7541('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x4c37c6['uniqueid']]);}}}catch(_0x1165b7){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x39'),_0x4c37c6[_0x7541('0x4')]),_0x1165b7);}};exports['blindtransfer']=function(_0x38b6d8){try{if(!_[_0x7541('0x1f')](queues[_0x38b6d8[_0x7541('0x41')]])){utils[_0x7541('0x10')](util[_0x7541('0x11')](_0x7541('0x42'),_0x38b6d8['uniqueid']),_0x38b6d8);queues[_0x38b6d8[_0x7541('0x41')]]['transfer']=!![];queues[_0x38b6d8[_0x7541('0x41')]][_0x7541('0x43')]=_0x7541('0x44');queues[_0x38b6d8[_0x7541('0x41')]][_0x7541('0x45')]=_0x38b6d8[_0x7541('0x46')];queues[_0x38b6d8[_0x7541('0x41')]][_0x7541('0x47')]=_0x38b6d8[_0x7541('0x41')];queues[_0x38b6d8['transfereeuniqueid']]['queuecallerexitreason']=_0x7541('0x48');utils[_0x7541('0x2')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x38b6d8[_0x7541('0x4')],queues[_0x38b6d8[_0x7541('0x41')]][_0x7541('0x1b')],_0x38b6d8['transfereeuniqueid'],_0x38b6d8[_0x7541('0x46')]));}}catch(_0x49788f){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x42'),_0x38b6d8['uniqueid']),_0x49788f);}};exports[_0x7541('0x49')]=function(_0x2c9048){try{utils[_0x7541('0x10')](util['format'](_0x7541('0x4a'),_0x2c9048['origtransfereruniqueid']),_0x2c9048);if(_0x2c9048[_0x7541('0x4b')]==_0x2c9048['origtransfererlinkedid']){if(!_['isNil'](queues[_0x2c9048[_0x7541('0x4c')]])){utils['info'](util[_0x7541('0x11')](_0x7541('0x4d'),_0x2c9048[_0x7541('0x4b')],queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x1b')],_0x2c9048['origtransfererexten']));queues[_0x2c9048[_0x7541('0x4c')]]['transfer']=!![];queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x43')]='ATTENDED';queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x45')]=_0x2c9048[_0x7541('0x4e')];queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x47')]=_0x2c9048[_0x7541('0x4b')];queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x7541('0x1f')](queues[_0x2c9048[_0x7541('0x4f')]])){if(_0x2c9048[_0x7541('0x50')]&&queues[_0x2c9048['transfereelinkedid']]){queues[_0x2c9048[_0x7541('0x50')]][_0x7541('0x51')]=0x1;queues[_0x2c9048['transfereeuniqueid']]=_[_0x7541('0x52')](queues[_0x2c9048['transfereelinkedid']]);queues[_0x2c9048[_0x7541('0x41')]]['transfereduniqueid']=_0x2c9048['transfertargetuniqueid'];queues[_0x2c9048[_0x7541('0x41')]][_0x7541('0x51')]=0x2;queues[_0x2c9048[_0x7541('0x41')]][_0x7541('0x7')]=queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x7')];queues[_0x2c9048[_0x7541('0x41')]][_0x7541('0x53')]=queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x53')];queues[_0x2c9048['transfereeuniqueid']][_0x7541('0x32')]=utils[_0x7541('0x16')]();queues[_0x2c9048[_0x7541('0x41')]][_0x7541('0x30')]=utils[_0x7541('0x16')]();queues[_0x2c9048[_0x7541('0x41')]][_0x7541('0x31')]=0x0;queues[_0x2c9048['transfereeuniqueid']][_0x7541('0x54')]=0x0;utils['info'](util[_0x7541('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x2c9048['origtransfereruniqueid'],queues[_0x2c9048['transfereeuniqueid']][_0x7541('0x1b')],queues[_0x2c9048[_0x7541('0x41')]][_0x7541('0x7')],queues[_0x2c9048['transfereeuniqueid']][_0x7541('0x53')]));}else{utils[_0x7541('0x2')](util['format'](_0x7541('0x55'),_0x2c9048[_0x7541('0x4b')],queues[_0x2c9048[_0x7541('0x4f')]]['name'],_0x2c9048[_0x7541('0x4c')]));queues[_0x2c9048[_0x7541('0x4f')]][_0x7541('0xe')]=_0x2c9048[_0x7541('0x4c')];}}}else if(_0x2c9048[_0x7541('0x56')]==_0x2c9048[_0x7541('0x4c')]){if(!_[_0x7541('0x1f')](queues[_0x2c9048[_0x7541('0x4f')]])){utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x57'),_0x2c9048['origtransfereruniqueid'],queues[_0x2c9048[_0x7541('0x4f')]][_0x7541('0x1b')],_0x2c9048[_0x7541('0x56')],_0x2c9048['secondtransfererexten']));queues[_0x2c9048['origtransfererlinkedid']][_0x7541('0x3d')]=!![];queues[_0x2c9048[_0x7541('0x4f')]][_0x7541('0x43')]=_0x7541('0x58');queues[_0x2c9048['origtransfererlinkedid']]['transferexten']=_0x2c9048[_0x7541('0x59')];queues[_0x2c9048[_0x7541('0x4f')]][_0x7541('0x47')]=_0x2c9048[_0x7541('0x56')];queues[_0x2c9048[_0x7541('0x4f')]][_0x7541('0x9')]=_0x7541('0x5a');}if(!_['isNil'](queues[_0x2c9048[_0x7541('0x4c')]])){if(_0x2c9048[_0x7541('0x5b')]&&queues[_0x2c9048[_0x7541('0x5b')]]){queues[_0x2c9048[_0x7541('0x5b')]]['queuecallerenterreason']=0x1;queues[_0x2c9048[_0x7541('0x5c')]]=_[_0x7541('0x52')](queues[_0x2c9048[_0x7541('0x5b')]]);queues[_0x2c9048['transfertargetuniqueid']][_0x7541('0xe')]=_0x2c9048[_0x7541('0x5c')];queues[_0x2c9048[_0x7541('0x5c')]][_0x7541('0x51')]=0x2;queues[_0x2c9048[_0x7541('0x5c')]]['calleridnum']=queues[_0x2c9048['origtransfererlinkedid']][_0x7541('0x7')];queues[_0x2c9048[_0x7541('0x5c')]][_0x7541('0x53')]=queues[_0x2c9048[_0x7541('0x4f')]][_0x7541('0x53')];queues[_0x2c9048['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x7541('0x16')]();queues[_0x2c9048[_0x7541('0x5c')]][_0x7541('0x30')]=utils['now']();queues[_0x2c9048[_0x7541('0x5c')]][_0x7541('0x31')]=0x0;queues[_0x2c9048[_0x7541('0x5c')]][_0x7541('0x54')]=0x0;utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x5d'),_0x2c9048['origtransfereruniqueid'],queues[_0x2c9048[_0x7541('0x5c')]][_0x7541('0x1b')],queues[_0x2c9048['transfertargetuniqueid']][_0x7541('0xe')],queues[_0x2c9048[_0x7541('0x5c')]][_0x7541('0x7')],queues[_0x2c9048['transfertargetuniqueid']][_0x7541('0x53')]));}else{utils['info'](util[_0x7541('0x11')](_0x7541('0x55'),_0x2c9048[_0x7541('0x4b')],queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0x1b')],_0x2c9048[_0x7541('0x4f')]));queues[_0x2c9048[_0x7541('0x4c')]][_0x7541('0xe')]=_0x2c9048[_0x7541('0x4f')];}}}}catch(_0x9689ee){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x4a'),_0x2c9048['origtransfereruniqueid']),_0x9689ee);}};exports['musiconholdstart']=function(_0x122864){try{if(!_[_0x7541('0x1f')](queues[_0x122864[_0x7541('0x4')]])){utils['debug'](util[_0x7541('0x11')](_0x7541('0x5e'),_0x122864['uniqueid']),_0x122864);queues[_0x122864[_0x7541('0x4')]][_0x7541('0x5f')]=utils[_0x7541('0x16')]();utils[_0x7541('0x2')](util[_0x7541('0x11')](_0x7541('0x60'),_0x122864[_0x7541('0x4')],queues[_0x122864[_0x7541('0x4')]][_0x7541('0x1b')],queues[_0x122864['uniqueid']]['musiconholdstartAt']));}}catch(_0xec1f7d){utils[_0x7541('0x1d')](util[_0x7541('0x11')]('[%s][queues][musiconholdstart]',_0x122864[_0x7541('0x4')]),_0xec1f7d);}};exports[_0x7541('0x61')]=function(_0x17d192){try{if(!_[_0x7541('0x1f')](queues[_0x17d192['uniqueid']])){if(!_[_0x7541('0x1f')](queues[_0x17d192[_0x7541('0x4')]]['musiconholdstartAt'])){utils[_0x7541('0x10')](util[_0x7541('0x11')]('[%s][queues][musiconholdstop]',_0x17d192[_0x7541('0x4')]),_0x17d192);queues[_0x17d192[_0x7541('0x4')]][_0x7541('0x54')]+=utils[_0x7541('0x62')](utils[_0x7541('0x16')](),queues[_0x17d192[_0x7541('0x4')]]['musiconholdstartAt']);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x17d192['uniqueid'],queues[_0x17d192['uniqueid']][_0x7541('0x1b')],queues[_0x17d192[_0x7541('0x4')]][_0x7541('0x54')]));delete queues[_0x17d192[_0x7541('0x4')]]['musiconholdstartAt'];}}}catch(_0x4a5be9){utils[_0x7541('0x1d')](util[_0x7541('0x11')](_0x7541('0x63'),_0x17d192['uniqueid']),_0x4a5be9);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b02d69c..b6a2ec4 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 _0xc7d6=['debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','util','./transfers.controller','info','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xc7d6,0x1e3));var _0x6c7d=function(_0x589352,_0x131683){_0x589352=_0x589352-0x0;var _0x3f4137=_0xc7d6[_0x589352];return _0x3f4137;};'use strict';var _=require('lodash');var util=require(_0x6c7d('0x0'));var utils=require('./utils');var transfers=require(_0x6c7d('0x1'));var recordings={};function writeDB(_0x5938c8){var _0x1e9f6b;utils[_0x6c7d('0x2')](util['format']('[%s][recordings][writeDB]',_0x5938c8[_0x6c7d('0x3')]));if(transfers['blinds'][_0x5938c8[_0x6c7d('0x3')]]){_0x1e9f6b=_0x5938c8[_0x6c7d('0x3')];_0x5938c8[_0x6c7d('0x3')]=transfers[_0x6c7d('0x4')][_0x5938c8['uniqueid']][_0x6c7d('0x5')];}if(_0x5938c8[_0x6c7d('0x6')]){utils['getUserByInternal'](_0x5938c8[_0x6c7d('0x6')])[_0x6c7d('0x7')](function(_0x8493e1){if(_0x8493e1){_0x5938c8[_0x6c7d('0x8')]=_0x8493e1[_0x6c7d('0x9')];_0x5938c8[_0x6c7d('0xa')]=_0x8493e1['id'];}utils[_0x6c7d('0xb')](_0x6c7d('0xc'),_0x5938c8);});}else{utils[_0x6c7d('0xb')](_0x6c7d('0xc'),_0x5938c8);}if(_0x1e9f6b)delete transfers[_0x6c7d('0x4')][_0x1e9f6b];}exports[_0x6c7d('0xd')]=function(_0x29441f){try{utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x10'),_0x29441f[_0x6c7d('0x3')]),_0x29441f);if(_0x29441f[_0x6c7d('0x3')]==_0x29441f[_0x6c7d('0x11')]){utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')](_0x6c7d('0x12'),_0x29441f[_0x6c7d('0x3')],_0x29441f[_0x6c7d('0x13')],_0x29441f['exten']));recordings[_0x29441f[_0x6c7d('0x3')]]={'uniqueid':_0x29441f[_0x6c7d('0x3')],'accountcode':_0x29441f[_0x6c7d('0x6')],'exten':_0x29441f[_0x6c7d('0x14')],'context':_0x29441f[_0x6c7d('0x13')],'channel':_0x29441f[_0x6c7d('0x15')],'monitors':[]};}}catch(_0x26584b){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')]('[%s][recordings][newchannel]',_0x29441f[_0x6c7d('0x3')]),_0x26584b);}};exports[_0x6c7d('0x17')]=function(_0x46ffba){try{utils[_0x6c7d('0xe')](util['format'](_0x6c7d('0x18'),_0x46ffba[_0x6c7d('0x3')]),_0x46ffba);if(!_[_0x6c7d('0x19')](recordings[_0x46ffba['uniqueid']])&&_0x46ffba['channelstate']==0x6){utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x46ffba['uniqueid'],_0x46ffba['context'],_0x46ffba['channel']));}else if(!_['isNil'](recordings[_0x46ffba['linkedid']])&&_0x46ffba['channelstate']==0x6&&_0x46ffba['context']!=_0x6c7d('0x1a')){utils['info'](util[_0x6c7d('0xf')](_0x6c7d('0x1b'),_0x46ffba[_0x6c7d('0x3')],_0x46ffba[_0x6c7d('0x11')],_0x46ffba[_0x6c7d('0x13')],_0x46ffba['channel']));recordings[_0x46ffba[_0x6c7d('0x11')]][_0x6c7d('0x6')]=_0x46ffba[_0x6c7d('0x6')];}}catch(_0x185251){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')]('[%s][recordings][newstate]',_0x46ffba[_0x6c7d('0x3')]),_0x185251);}};exports[_0x6c7d('0x1c')]=function(_0x37cabe){try{if(!_[_0x6c7d('0x19')](_0x37cabe[_0x6c7d('0x1d')])&&!_[_0x6c7d('0x19')](_0x37cabe[_0x6c7d('0x1d')][_0x6c7d('0x1e')])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x1f'),_0x37cabe[_0x6c7d('0x3')]),_0x37cabe);utils['info'](util[_0x6c7d('0xf')](_0x6c7d('0x20'),_0x37cabe[_0x6c7d('0x3')],_0x37cabe[_0x6c7d('0x1d')],_0x37cabe[_0x6c7d('0x21')]));if(_[_0x6c7d('0x22')](_0x37cabe[_0x6c7d('0x21')],_0x6c7d('0x23'))){_0x37cabe['value']=_0x37cabe[_0x6c7d('0x21')][_0x6c7d('0x24')]('.wav49',_0x6c7d('0x25'));}if(recordings[_0x37cabe[_0x6c7d('0x11')]]){var _0x392928=_[_0x6c7d('0x26')](recordings[_0x37cabe[_0x6c7d('0x11')]]['monitors'],{'value':_0x37cabe[_0x6c7d('0x21')]});if(_['isNil'](_0x392928)){recordings[_0x37cabe['linkedid']][_0x6c7d('0x27')][_0x6c7d('0x28')]({'value':_0x37cabe[_0x6c7d('0x21')]});}}}}catch(_0x538c87){utils['error'](util[_0x6c7d('0xf')]('[%s][recordings][varset]',_0x37cabe[_0x6c7d('0x3')]),_0x538c87);}};exports['hangup']=function(_0x510541){try{if(!_[_0x6c7d('0x19')](recordings[_0x510541['uniqueid']])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x29'),_0x510541['uniqueid']),_0x510541);utils[_0x6c7d('0x2')](util['format'](_0x6c7d('0x2a'),_0x510541[_0x6c7d('0x3')],_0x510541['calleridnum'],_0x510541['calleridname'],_0x510541[_0x6c7d('0x2b')]));recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x2c')]=_0x510541['calleridnum'];recordings[_0x510541['uniqueid']][_0x6c7d('0x2d')]=_0x510541[_0x6c7d('0x2d')];recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x2e')]=_0x510541[_0x6c7d('0x2e')];recordings[_0x510541['uniqueid']][_0x6c7d('0x2f')]=_0x510541['connectedlinename'];if(recordings[_0x510541[_0x6c7d('0x3')]]['type']==_0x6c7d('0x30')&&recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x6')]){recordings[_0x510541['uniqueid']][_0x6c7d('0x2e')]=recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x6')];recordings[_0x510541[_0x6c7d('0x3')]][_0x6c7d('0x2f')]='';}recordings[_0x510541['uniqueid']][_0x6c7d('0x27')][_0x6c7d('0x31')](function(_0x39256f){var _0x2b8828=_['clone'](recordings[_0x510541[_0x6c7d('0x3')]]);_0x2b8828[_0x6c7d('0x21')]=_0x39256f[_0x6c7d('0x21')];writeDB(_0x2b8828);});delete recordings[_0x510541[_0x6c7d('0x3')]];}}catch(_0x2d25fd){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')](_0x6c7d('0x29'),_0x510541[_0x6c7d('0x3')]),_0x2d25fd);}};exports['newexten']=function(_0x56738b){try{if(!_[_0x6c7d('0x19')](recordings[_0x56738b[_0x6c7d('0x3')]])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')]('[%s][recordings][newexten]',_0x56738b[_0x6c7d('0x3')]),_0x56738b);utils['info'](util[_0x6c7d('0xf')](_0x6c7d('0x32'),_0x56738b['uniqueid'],_0x56738b[_0x6c7d('0x33')],_0x56738b['appdata']));if(_0x56738b[_0x6c7d('0x33')][_0x6c7d('0x34')]()==_0x6c7d('0x35')&&_[_0x6c7d('0x36')](_0x56738b[_0x6c7d('0x37')][_0x6c7d('0x34')](),_0x6c7d('0x38'))){var _0x32d470=_0x56738b['appdata'][_0x6c7d('0x39')]('=');var _0x371ca7=_0x32d470[0x0]['substring'](_0x32d470[0x0][_0x6c7d('0x3a')]('(')+0x1,_0x32d470[0x0][_0x6c7d('0x3a')](')'));var _0x4e2edc=_0x32d470[0x1];recordings[_0x56738b[_0x6c7d('0x3')]][_0x371ca7]=_0x4e2edc;}}}catch(_0x1db4ef){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')](_0x6c7d('0x3b'),_0x56738b[_0x6c7d('0x3')]),_0x1db4ef);}};exports[_0x6c7d('0x3c')]=function(_0x44042f){try{if(!_[_0x6c7d('0x19')](recordings[_0x44042f['uniqueid']])){utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x3d'),_0x44042f[_0x6c7d('0x3')]),_0x44042f);utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')](_0x6c7d('0x3e'),_0x44042f[_0x6c7d('0x3')],_0x44042f[_0x6c7d('0x3f')]));recordings[_0x44042f['uniqueid']][_0x6c7d('0x3f')]=_0x44042f[_0x6c7d('0x3f')];}}catch(_0x29121f){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')](_0x6c7d('0x3d'),_0x44042f[_0x6c7d('0x3')]),_0x29121f);}};exports[_0x6c7d('0x40')]=function(_0x52d8ab){try{utils[_0x6c7d('0xe')](util[_0x6c7d('0xf')](_0x6c7d('0x41'),_0x52d8ab[_0x6c7d('0x3')]),_0x52d8ab);utils[_0x6c7d('0x2')](util[_0x6c7d('0xf')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x52d8ab['uniqueid'],_0x52d8ab[_0x6c7d('0x42')],_0x52d8ab[_0x6c7d('0x43')],_0x52d8ab[_0x6c7d('0x44')],_0x52d8ab['transfereecalleridname']));if(recordings[_0x52d8ab[_0x6c7d('0x45')]]&&transfers[_0x6c7d('0x4')][_0x52d8ab[_0x6c7d('0x45')]]){transfers[_0x6c7d('0x4')][_0x52d8ab[_0x6c7d('0x45')]][_0x6c7d('0x46')]=!![];}}catch(_0x51add1){utils[_0x6c7d('0x16')](util[_0x6c7d('0xf')]('[%s][recordings][blindtransfer]',_0x52d8ab['uniqueid']),_0x51add1);}}; \ No newline at end of file +var _0xac0b=['format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','UserId','request','CreateVoiceRecording','debug','linkedid','context','exten','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','cdr','appdata','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./utils'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0xac0b,0x160));var _0xbac0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xac0b[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xbac0('0x0'));var util=require(_0xbac0('0x1'));var utils=require(_0xbac0('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x2c7b24){var _0x3b7fc2;utils['info'](util[_0xbac0('0x3')](_0xbac0('0x4'),_0x2c7b24[_0xbac0('0x5')]));if(transfers[_0xbac0('0x6')][_0x2c7b24[_0xbac0('0x5')]]){_0x3b7fc2=_0x2c7b24[_0xbac0('0x5')];_0x2c7b24[_0xbac0('0x5')]=transfers[_0xbac0('0x6')][_0x2c7b24['uniqueid']][_0xbac0('0x7')];}if(_0x2c7b24[_0xbac0('0x8')]){utils[_0xbac0('0x9')](_0x2c7b24['accountcode'])[_0xbac0('0xa')](function(_0x254fc6){if(_0x254fc6){_0x2c7b24[_0xbac0('0xb')]=_0x254fc6['name'];_0x2c7b24[_0xbac0('0xc')]=_0x254fc6['id'];}utils[_0xbac0('0xd')](_0xbac0('0xe'),_0x2c7b24);});}else{utils[_0xbac0('0xd')]('CreateVoiceRecording',_0x2c7b24);}if(_0x3b7fc2)delete transfers['blinds'][_0x3b7fc2];}exports['newchannel']=function(_0x19bd21){try{utils[_0xbac0('0xf')](util[_0xbac0('0x3')]('[%s][recordings][newchannel]',_0x19bd21[_0xbac0('0x5')]),_0x19bd21);if(_0x19bd21[_0xbac0('0x5')]==_0x19bd21[_0xbac0('0x10')]){utils['info'](util[_0xbac0('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x19bd21[_0xbac0('0x5')],_0x19bd21[_0xbac0('0x11')],_0x19bd21[_0xbac0('0x12')]));recordings[_0x19bd21[_0xbac0('0x5')]]={'uniqueid':_0x19bd21[_0xbac0('0x5')],'accountcode':_0x19bd21[_0xbac0('0x8')],'exten':_0x19bd21[_0xbac0('0x12')],'context':_0x19bd21[_0xbac0('0x11')],'channel':_0x19bd21['channel'],'monitors':[]};}}catch(_0x4d4b7d){utils[_0xbac0('0x13')](util[_0xbac0('0x3')](_0xbac0('0x14'),_0x19bd21[_0xbac0('0x5')]),_0x4d4b7d);}};exports['newstate']=function(_0x974e0d){try{utils[_0xbac0('0xf')](util[_0xbac0('0x3')](_0xbac0('0x15'),_0x974e0d[_0xbac0('0x5')]),_0x974e0d);if(!_[_0xbac0('0x16')](recordings[_0x974e0d[_0xbac0('0x5')]])&&_0x974e0d[_0xbac0('0x17')]==0x6){utils[_0xbac0('0x18')](util[_0xbac0('0x3')](_0xbac0('0x19'),_0x974e0d[_0xbac0('0x5')],_0x974e0d[_0xbac0('0x11')],_0x974e0d['channel']));}else if(!_[_0xbac0('0x16')](recordings[_0x974e0d[_0xbac0('0x10')]])&&_0x974e0d[_0xbac0('0x17')]==0x6&&_0x974e0d[_0xbac0('0x11')]!=_0xbac0('0x1a')){utils[_0xbac0('0x18')](util['format'](_0xbac0('0x1b'),_0x974e0d['uniqueid'],_0x974e0d[_0xbac0('0x10')],_0x974e0d[_0xbac0('0x11')],_0x974e0d[_0xbac0('0x1c')]));recordings[_0x974e0d['linkedid']][_0xbac0('0x8')]=_0x974e0d[_0xbac0('0x8')];}}catch(_0x54d8dc){utils[_0xbac0('0x13')](util[_0xbac0('0x3')](_0xbac0('0x15'),_0x974e0d[_0xbac0('0x5')]),_0x54d8dc);}};exports['varset']=function(_0x2f8b22){try{if(!_[_0xbac0('0x16')](_0x2f8b22[_0xbac0('0x1d')])&&!_['isNil'](_0x2f8b22[_0xbac0('0x1d')][_0xbac0('0x1e')])){utils[_0xbac0('0xf')](util['format'](_0xbac0('0x1f'),_0x2f8b22['uniqueid']),_0x2f8b22);utils[_0xbac0('0x18')](util[_0xbac0('0x3')](_0xbac0('0x20'),_0x2f8b22[_0xbac0('0x5')],_0x2f8b22[_0xbac0('0x1d')],_0x2f8b22[_0xbac0('0x21')]));if(_['endsWith'](_0x2f8b22['value'],_0xbac0('0x22'))){_0x2f8b22[_0xbac0('0x21')]=_0x2f8b22[_0xbac0('0x21')][_0xbac0('0x23')](_0xbac0('0x22'),_0xbac0('0x24'));}if(recordings[_0x2f8b22[_0xbac0('0x10')]]){var _0x151222=_[_0xbac0('0x25')](recordings[_0x2f8b22[_0xbac0('0x10')]][_0xbac0('0x26')],{'value':_0x2f8b22[_0xbac0('0x21')]});if(_[_0xbac0('0x16')](_0x151222)){recordings[_0x2f8b22[_0xbac0('0x10')]][_0xbac0('0x26')][_0xbac0('0x27')]({'value':_0x2f8b22['value']});}}}}catch(_0x24e4e9){utils[_0xbac0('0x13')](util[_0xbac0('0x3')]('[%s][recordings][varset]',_0x2f8b22['uniqueid']),_0x24e4e9);}};exports[_0xbac0('0x28')]=function(_0x234608){try{if(!_['isNil'](recordings[_0x234608[_0xbac0('0x5')]])){utils[_0xbac0('0xf')](util[_0xbac0('0x3')](_0xbac0('0x29'),_0x234608['uniqueid']),_0x234608);utils['info'](util[_0xbac0('0x3')](_0xbac0('0x2a'),_0x234608[_0xbac0('0x5')],_0x234608[_0xbac0('0x2b')],_0x234608['calleridname'],_0x234608['cause-txt']));recordings[_0x234608[_0xbac0('0x5')]][_0xbac0('0x2b')]=_0x234608['calleridnum'];recordings[_0x234608['uniqueid']][_0xbac0('0x2c')]=_0x234608['calleridname'];recordings[_0x234608[_0xbac0('0x5')]]['connectedlinenum']=_0x234608['connectedlinenum'];recordings[_0x234608[_0xbac0('0x5')]][_0xbac0('0x2d')]=_0x234608[_0xbac0('0x2d')];if(recordings[_0x234608['uniqueid']]['type']=='outbound'&&recordings[_0x234608[_0xbac0('0x5')]][_0xbac0('0x8')]){recordings[_0x234608[_0xbac0('0x5')]][_0xbac0('0x2e')]=recordings[_0x234608['uniqueid']][_0xbac0('0x8')];recordings[_0x234608[_0xbac0('0x5')]][_0xbac0('0x2d')]='';}recordings[_0x234608[_0xbac0('0x5')]][_0xbac0('0x26')][_0xbac0('0x2f')](function(_0x1ee7bc){var _0x4a0af9=_[_0xbac0('0x30')](recordings[_0x234608[_0xbac0('0x5')]]);_0x4a0af9['value']=_0x1ee7bc['value'];writeDB(_0x4a0af9);});delete recordings[_0x234608[_0xbac0('0x5')]];}}catch(_0x35b47d){utils[_0xbac0('0x13')](util['format'](_0xbac0('0x29'),_0x234608[_0xbac0('0x5')]),_0x35b47d);}};exports[_0xbac0('0x31')]=function(_0x137f9d){try{if(!_['isNil'](recordings[_0x137f9d[_0xbac0('0x5')]])){utils[_0xbac0('0xf')](util[_0xbac0('0x3')](_0xbac0('0x32'),_0x137f9d[_0xbac0('0x5')]),_0x137f9d);utils[_0xbac0('0x18')](util[_0xbac0('0x3')](_0xbac0('0x33'),_0x137f9d[_0xbac0('0x5')],_0x137f9d['application'],_0x137f9d['appdata']));if(_0x137f9d[_0xbac0('0x34')][_0xbac0('0x35')]()==_0xbac0('0x36')&&_['startsWith'](_0x137f9d['appdata'][_0xbac0('0x35')](),_0xbac0('0x37'))){var _0x219dea=_0x137f9d[_0xbac0('0x38')]['split']('=');var _0x54e437=_0x219dea[0x0][_0xbac0('0x39')](_0x219dea[0x0][_0xbac0('0x3a')]('(')+0x1,_0x219dea[0x0][_0xbac0('0x3a')](')'));var _0x8934f2=_0x219dea[0x1];recordings[_0x137f9d[_0xbac0('0x5')]][_0x54e437]=_0x8934f2;}}}catch(_0x5f56e9){utils[_0xbac0('0x13')](util[_0xbac0('0x3')](_0xbac0('0x32'),_0x137f9d[_0xbac0('0x5')]),_0x5f56e9);}};exports[_0xbac0('0x3b')]=function(_0xd2f3c8){try{if(!_[_0xbac0('0x16')](recordings[_0xd2f3c8[_0xbac0('0x5')]])){utils['debug'](util[_0xbac0('0x3')](_0xbac0('0x3c'),_0xd2f3c8[_0xbac0('0x5')]),_0xd2f3c8);utils['info'](util[_0xbac0('0x3')](_0xbac0('0x3d'),_0xd2f3c8[_0xbac0('0x5')],_0xd2f3c8[_0xbac0('0x3e')]));recordings[_0xd2f3c8['uniqueid']][_0xbac0('0x3e')]=_0xd2f3c8[_0xbac0('0x3e')];}}catch(_0xadde65){utils[_0xbac0('0x13')](util['format'](_0xbac0('0x3c'),_0xd2f3c8[_0xbac0('0x5')]),_0xadde65);}};exports[_0xbac0('0x3f')]=function(_0x70affe){try{utils[_0xbac0('0xf')](util[_0xbac0('0x3')]('[%s][recordings][blindtransfer]',_0x70affe[_0xbac0('0x5')]),_0x70affe);utils[_0xbac0('0x18')](util['format'](_0xbac0('0x40'),_0x70affe[_0xbac0('0x5')],_0x70affe[_0xbac0('0x41')],_0x70affe['transferercalleridname'],_0x70affe[_0xbac0('0x42')],_0x70affe[_0xbac0('0x43')]));if(recordings[_0x70affe[_0xbac0('0x44')]]&&transfers[_0xbac0('0x6')][_0x70affe[_0xbac0('0x44')]]){transfers[_0xbac0('0x6')][_0x70affe['transfereruniqueid']][_0xbac0('0x45')]=!![];}}catch(_0xb19142){utils[_0xbac0('0x13')](util[_0xbac0('0x3')](_0xbac0('0x46'),_0x70affe[_0xbac0('0x5')]),_0xb19142);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index db10341..0947c1f 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 _0x5ff9=['transfertargetexten','transfertargetlinkedid','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5ff9,0x17e));var _0x95ff=function(_0x21c857,_0x1f9812){_0x21c857=_0x21c857-0x0;var _0x2e6516=_0x5ff9[_0x21c857];return _0x2e6516;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var utils=require('./utils');function writeDB(_0x8db227){utils[_0x95ff('0x2')](util[_0x95ff('0x3')](_0x95ff('0x4'),_0x8db227[_0x95ff('0x5')]===_0x95ff('0x6')?_0x8db227[_0x95ff('0x7')]:_0x8db227['uniqueid'],_0x8db227['type']));utils[_0x95ff('0x8')]('CreateVoiceTransferReport',_0x8db227);}exports[_0x95ff('0x9')]={};exports['blindtransfer']=function(_0xd32ee3){try{utils[_0x95ff('0xa')](util['format'](_0x95ff('0xb'),_0xd32ee3['uniqueid']),_0xd32ee3);utils['info'](util[_0x95ff('0x3')](_0x95ff('0xc'),_0xd32ee3[_0x95ff('0xd')],_0xd32ee3[_0x95ff('0xe')],_0xd32ee3[_0x95ff('0xf')],_0xd32ee3['transfereecalleridnum'],_0xd32ee3[_0x95ff('0x10')]));_0xd32ee3['type']=_0x95ff('0x11');exports[_0x95ff('0x9')][_0xd32ee3[_0x95ff('0x12')]]=_0xd32ee3;writeDB(_0xd32ee3);}catch(_0x34afb9){utils['error'](util[_0x95ff('0x3')]('[%s][transfers][blindtransfer]',_0xd32ee3[_0x95ff('0xd')]),_0x34afb9);}};exports['attendedtransfer']=function(_0x41d6ef){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x41d6ef['origtransfereruniqueid']),_0x41d6ef);utils['info'](util[_0x95ff('0x3')](_0x95ff('0x13'),_0x41d6ef[_0x95ff('0x7')],_0x41d6ef[_0x95ff('0x14')],_0x41d6ef[_0x95ff('0x15')],_0x41d6ef[_0x95ff('0x16')],_0x41d6ef['transfertargetcalleridname']));_0x41d6ef=_[_0x95ff('0x17')](_0x41d6ef,{'transfererchannel':_0x41d6ef[_0x95ff('0x18')],'transferercalleridnum':_0x41d6ef[_0x95ff('0x14')],'transferercalleridname':_0x41d6ef[_0x95ff('0x15')],'transfererconnectedlinenum':_0x41d6ef[_0x95ff('0x19')],'transfererconnectedlinename':_0x41d6ef[_0x95ff('0x1a')],'transfereraccountcode':_0x41d6ef[_0x95ff('0x1b')],'transferercontext':_0x41d6ef[_0x95ff('0x1c')],'transfererexten':_0x41d6ef['secondtransfererexten'],'transfererlinkedid':_0x41d6ef[_0x95ff('0x1d')],'context':_0x41d6ef['origtransferercontext'],'extension':_0x41d6ef[_0x95ff('0x1e')],'type':_0x95ff('0x6')});if(_[_0x95ff('0x1f')](_0x41d6ef[_0x95ff('0x20')])){_0x41d6ef=_[_0x95ff('0x17')](_0x41d6ef,{'transfereechannel':_0x41d6ef['transfertargetchannel'],'transfereecalleridnum':_0x41d6ef[_0x95ff('0x16')],'transfereecalleridname':_0x41d6ef[_0x95ff('0x21')],'transfereeconnectedlinenum':_0x41d6ef['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x41d6ef[_0x95ff('0x22')],'transfereeaccountcode':_0x41d6ef[_0x95ff('0x23')],'transfereecontext':_0x41d6ef['transfertargetcontext'],'transfereeexten':_0x41d6ef[_0x95ff('0x24')],'transfereelinkedid':_0x41d6ef[_0x95ff('0x25')]});}writeDB(_0x41d6ef);}catch(_0x361720){utils['error'](util[_0x95ff('0x3')]('[%s][transfers][attendedtransfer]',_0x41d6ef[_0x95ff('0x7')]),_0x361720);}}; \ No newline at end of file +var _0xed0f=['request','CreateVoiceTransferReport','blinds','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid'];(function(_0xbe9b5d,_0x5d411b){var _0x3459c2=function(_0xb31f1){while(--_0xb31f1){_0xbe9b5d['push'](_0xbe9b5d['shift']());}};_0x3459c2(++_0x5d411b);}(_0xed0f,0x102));var _0xfed0=function(_0x5a0a2b,_0x16c32e){_0x5a0a2b=_0x5a0a2b-0x0;var _0x50e505=_0xed0f[_0x5a0a2b];return _0x50e505;};'use strict';var _=require('lodash');var util=require(_0xfed0('0x0'));var utils=require('./utils');function writeDB(_0x142e76){utils[_0xfed0('0x1')](util[_0xfed0('0x2')](_0xfed0('0x3'),_0x142e76[_0xfed0('0x4')]===_0xfed0('0x5')?_0x142e76[_0xfed0('0x6')]:_0x142e76[_0xfed0('0x7')],_0x142e76[_0xfed0('0x4')]));utils[_0xfed0('0x8')](_0xfed0('0x9'),_0x142e76);}exports[_0xfed0('0xa')]={};exports['blindtransfer']=function(_0x5835e3){try{utils['debug'](util['format']('[%s][transfers][blindtransfer]',_0x5835e3['uniqueid']),_0x5835e3);utils[_0xfed0('0x1')](util[_0xfed0('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5835e3['uniqueid'],_0x5835e3[_0xfed0('0xb')],_0x5835e3[_0xfed0('0xc')],_0x5835e3['transfereecalleridnum'],_0x5835e3[_0xfed0('0xd')]));_0x5835e3[_0xfed0('0x4')]=_0xfed0('0xe');exports[_0xfed0('0xa')][_0x5835e3[_0xfed0('0xf')]]=_0x5835e3;writeDB(_0x5835e3);}catch(_0xe69143){utils[_0xfed0('0x10')](util[_0xfed0('0x2')](_0xfed0('0x11'),_0x5835e3[_0xfed0('0x7')]),_0xe69143);}};exports['attendedtransfer']=function(_0x13bc70){try{utils[_0xfed0('0x12')](util['format'](_0xfed0('0x13'),_0x13bc70[_0xfed0('0x6')]),_0x13bc70);utils['info'](util['format'](_0xfed0('0x14'),_0x13bc70['origtransfereruniqueid'],_0x13bc70[_0xfed0('0x15')],_0x13bc70[_0xfed0('0x16')],_0x13bc70[_0xfed0('0x17')],_0x13bc70[_0xfed0('0x18')]));_0x13bc70=_[_0xfed0('0x19')](_0x13bc70,{'transfererchannel':_0x13bc70['origtransfererchannel'],'transferercalleridnum':_0x13bc70[_0xfed0('0x15')],'transferercalleridname':_0x13bc70[_0xfed0('0x16')],'transfererconnectedlinenum':_0x13bc70[_0xfed0('0x1a')],'transfererconnectedlinename':_0x13bc70[_0xfed0('0x1b')],'transfereraccountcode':_0x13bc70[_0xfed0('0x1c')],'transferercontext':_0x13bc70['secondtransferercontext'],'transfererexten':_0x13bc70['secondtransfererexten'],'transfererlinkedid':_0x13bc70['origtransfererlinkedid'],'context':_0x13bc70[_0xfed0('0x1d')],'extension':_0x13bc70[_0xfed0('0x1e')],'type':_0xfed0('0x5')});if(_[_0xfed0('0x1f')](_0x13bc70['transfereechannel'])){_0x13bc70=_[_0xfed0('0x19')](_0x13bc70,{'transfereechannel':_0x13bc70[_0xfed0('0x20')],'transfereecalleridnum':_0x13bc70[_0xfed0('0x17')],'transfereecalleridname':_0x13bc70[_0xfed0('0x18')],'transfereeconnectedlinenum':_0x13bc70[_0xfed0('0x21')],'transfereeconnectedlinename':_0x13bc70['transfertargetconnectedlinename'],'transfereeaccountcode':_0x13bc70[_0xfed0('0x22')],'transfereecontext':_0x13bc70[_0xfed0('0x23')],'transfereeexten':_0x13bc70[_0xfed0('0x24')],'transfereelinkedid':_0x13bc70[_0xfed0('0x25')]});}writeDB(_0x13bc70);}catch(_0xa18d0c){utils[_0xfed0('0x10')](util[_0xfed0('0x2')](_0xfed0('0x13'),_0x13bc70[_0xfed0('0x6')]),_0xa18d0c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 9c76994..6b9470a 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 _0xd1ad=['stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s'];(function(_0xa2a82d,_0x5f293b){var _0x157cf4=function(_0x26ffcc){while(--_0x26ffcc){_0xa2a82d['push'](_0xa2a82d['shift']());}};_0x157cf4(++_0x5f293b);}(_0xd1ad,0x1d7));var _0xdd1a=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0xd1ad[_0x46b22a];return _0x44c2e8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xdd1a('0x0'));var moment=require(_0xdd1a('0x1'));var util=require(_0xdd1a('0x2'));var client=jayson[_0xdd1a('0x3')][_0xdd1a('0x4')]({'port':0x2329});var logger=require(_0xdd1a('0x5'))(_0xdd1a('0x6'));exports[_0xdd1a('0x7')]=function(_0x3bbd1c,_0x3091cc){logger[_0xdd1a('0x7')](_0x3bbd1c,_0x3091cc?util[_0xdd1a('0x8')](_0x3091cc,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x1f0675,_0x3a1927){logger['debug'](_0x1f0675,_0x3a1927?util[_0xdd1a('0x8')](_0x3a1927,{'showHidden':![],'depth':null}):'');};exports[_0xdd1a('0x9')]=function(_0x226672,_0x500e57){logger['error'](_0x226672,_0x500e57?util['inspect'](_0x500e57,{'showHidden':![],'depth':null}):'');};exports[_0xdd1a('0xa')]=function(_0xf52d5,_0x5dcaf9){return client[_0xdd1a('0xa')](_0xf52d5,{'body':_0x5dcaf9})[_0xdd1a('0xb')](function(_0xe0957c){logger[_0xdd1a('0xc')](_0xdd1a('0xd'),_0xf52d5,_0xe0957c?util['inspect'](_0xe0957c,{'showHidden':![],'depth':null}):'');})[_0xdd1a('0xe')](function(_0x2138c5){logger[_0xdd1a('0x9')]('[utils][request]\x20name:%s',_0xf52d5,_0x2138c5?util[_0xdd1a('0x8')](_0x2138c5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x21c47a){return client[_0xdd1a('0xa')](_0xdd1a('0xf'),{'options':{'raw':!![],'attributes':['id',_0xdd1a('0x10'),_0xdd1a('0x11'),'interface'],'where':_0x21c47a,'limit':0x1}})[_0xdd1a('0xb')](function(_0x1cc747){logger[_0xdd1a('0xc')](_0xdd1a('0x12'),JSON[_0xdd1a('0x13')](_0x21c47a),_0x1cc747?util['inspect'](_0x1cc747,{'showHidden':![],'depth':null}):'');return _0x1cc747[_0xdd1a('0x14')][_0xdd1a('0x15')]?_0x1cc747['result'][0x0]:null;});}exports[_0xdd1a('0x16')]=function(_0x1c275b){return new BPromise(function(_0x1f66e2,_0x29d42f){if(_0x1c275b){return getUser({'internal':_0x1c275b})['then'](function(_0x3cd1f9){logger['info'](_0xdd1a('0x17'),_0x1c275b,_0x3cd1f9?_0xdd1a('0x18'):_0xdd1a('0x19'));return _0x1f66e2(_0x3cd1f9);})[_0xdd1a('0xe')](function(_0x57f907){logger[_0xdd1a('0x9')](_0xdd1a('0x1a'),_0x57f907?util[_0xdd1a('0x8')](_0x57f907,{'showHidden':![],'depth':null}):'');return _0x1f66e2(null);});}return _0x1f66e2(null);});};exports['getUserByInterface']=function(_0x3d62c5){return new BPromise(function(_0x931d37,_0xe04c39){if(_0x3d62c5){return getUser({'interface':_0x3d62c5})[_0xdd1a('0xb')](function(_0x23bedb){logger[_0xdd1a('0x7')](_0xdd1a('0x1b'),_0x3d62c5,_0x23bedb?'found':_0xdd1a('0x19'));return _0x931d37(_0x23bedb);})[_0xdd1a('0xe')](function(_0x33e67b){logger['error'](_0xdd1a('0x1c'),_0x33e67b?util[_0xdd1a('0x8')](_0x33e67b,{'showHidden':![],'depth':null}):'');return _0x931d37(null);});}return _0x931d37(null);});};exports[_0xdd1a('0x1d')]=function(_0x60f617){return new BPromise(function(_0x24527e,_0x3deb27){if(_0x60f617){return getUser({'name':_0x60f617})[_0xdd1a('0xb')](function(_0x3a9522){logger[_0xdd1a('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x60f617,_0x3a9522?_0xdd1a('0x18'):_0xdd1a('0x19'));return _0x24527e(_0x3a9522);})['catch'](function(_0x5f172f){logger['error'](_0xdd1a('0x1e'),_0x5f172f?util[_0xdd1a('0x8')](_0x5f172f,{'showHidden':![],'depth':null}):'');return _0x24527e(null);});}return _0x24527e(null);});};exports[_0xdd1a('0x1f')]=function(_0x1e970c){return new BPromise(function(_0x18df8f,_0x3f338e){if(_0x1e970c){return client['request'](_0xdd1a('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0xdd1a('0x21'),_0xdd1a('0x22'),_0xdd1a('0x23')],'where':{'name':_0x1e970c},'limit':0x1}})[_0xdd1a('0xb')](function(_0x18fd78){logger[_0xdd1a('0xc')](_0xdd1a('0x24'),_0x1e970c,_0x18fd78?util[_0xdd1a('0x8')](_0x18fd78,{'showHidden':![],'depth':null}):'');logger[_0xdd1a('0x7')](_0xdd1a('0x25'),_0x1e970c,_0x18fd78?_0xdd1a('0x18'):_0xdd1a('0x19'));return _0x18df8f(_0x18fd78['result']['length']?_0x18fd78['result'][0x0]:null);})['catch'](function(_0xce2a58){logger[_0xdd1a('0x9')](_0xdd1a('0x26'),_0xce2a58?util[_0xdd1a('0x8')](_0xce2a58,{'showHidden':![],'depth':null}):'');return _0x18df8f(null);});}return _0x18df8f(null);});};exports['addTime']=function(_0x456d6d,_0x4679c6){return moment(_0x456d6d)[_0xdd1a('0x27')](_0x4679c6,_0xdd1a('0x28'))[_0xdd1a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdd1a('0x2a')]=function(_0x4908b2,_0x5edbe1){return moment(_0x4908b2)[_0xdd1a('0x2b')](_0x5edbe1,_0xdd1a('0x28'))['format'](_0xdd1a('0x2c'));};exports['diffTime']=function(_0x535518,_0x5c2f38){return moment(_0x535518)['diff'](moment(_0x5c2f38),_0xdd1a('0x28'));};exports[_0xdd1a('0x2d')]=function(_0x5de46a,_0x37d243){return parseInt(_0x5de46a,0xa)+parseInt(_0x37d243,0xa);};exports[_0xdd1a('0x2e')]=function(){return moment()[_0xdd1a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdd1a('0x2f')]=function(_0x3c5eb0,_0x36bc36){if(_0x36bc36){return moment(_0x3c5eb0)['isAfter'](_0x36bc36);}return!![];};exports[_0xdd1a('0x30')]=function(_0x10e608,_0x3c93f3){if(_0x3c93f3){return moment(_0x10e608)[_0xdd1a('0x30')](_0x3c93f3);}else if(_0x10e608){return!![];}return![];}; \ No newline at end of file +var _0xe3e4=['jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','GetUser','internal','name','[utils][getUser]\x20where:%s','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime','subtract','diffTime','diff','sumTime','now','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','bluebird'];(function(_0x51ef40,_0x48a870){var _0x3ff060=function(_0x25e0a2){while(--_0x25e0a2){_0x51ef40['push'](_0x51ef40['shift']());}};_0x3ff060(++_0x48a870);}(_0xe3e4,0xc3));var _0x4e3e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe3e4[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x4e3e('0x0'));var jayson=require(_0x4e3e('0x1'));var moment=require(_0x4e3e('0x2'));var util=require('util');var client=jayson[_0x4e3e('0x3')][_0x4e3e('0x4')]({'port':0x2329});var logger=require(_0x4e3e('0x5'))(_0x4e3e('0x6'));exports[_0x4e3e('0x7')]=function(_0x556719,_0x1f0efe){logger['info'](_0x556719,_0x1f0efe?util[_0x4e3e('0x8')](_0x1f0efe,{'showHidden':![],'depth':null}):'');};exports[_0x4e3e('0x9')]=function(_0x2f5942,_0x1edbea){logger[_0x4e3e('0x9')](_0x2f5942,_0x1edbea?util[_0x4e3e('0x8')](_0x1edbea,{'showHidden':![],'depth':null}):'');};exports[_0x4e3e('0xa')]=function(_0x458a49,_0x3ace53){logger[_0x4e3e('0xa')](_0x458a49,_0x3ace53?util[_0x4e3e('0x8')](_0x3ace53,{'showHidden':![],'depth':null}):'');};exports[_0x4e3e('0xb')]=function(_0x21bb0b,_0x1cb7aa){return client['request'](_0x21bb0b,{'body':_0x1cb7aa})[_0x4e3e('0xc')](function(_0x27fe1b){logger[_0x4e3e('0x9')]('[utils][request]\x20name:%s',_0x21bb0b,_0x27fe1b?util[_0x4e3e('0x8')](_0x27fe1b,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x16ef90){logger['error']('[utils][request]\x20name:%s',_0x21bb0b,_0x16ef90?util[_0x4e3e('0x8')](_0x16ef90,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5cc8d4){return client['request'](_0x4e3e('0xd'),{'options':{'raw':!![],'attributes':['id',_0x4e3e('0xe'),_0x4e3e('0xf'),'interface'],'where':_0x5cc8d4,'limit':0x1}})['then'](function(_0xb16d0c){logger['debug'](_0x4e3e('0x10'),JSON['stringify'](_0x5cc8d4),_0xb16d0c?util[_0x4e3e('0x8')](_0xb16d0c,{'showHidden':![],'depth':null}):'');return _0xb16d0c['result']['length']?_0xb16d0c[_0x4e3e('0x11')][0x0]:null;});}exports[_0x4e3e('0x12')]=function(_0x5506fd){return new BPromise(function(_0x5c540b,_0x278940){if(_0x5506fd){return getUser({'internal':_0x5506fd})[_0x4e3e('0xc')](function(_0x4d8b58){logger[_0x4e3e('0x7')](_0x4e3e('0x13'),_0x5506fd,_0x4d8b58?_0x4e3e('0x14'):_0x4e3e('0x15'));return _0x5c540b(_0x4d8b58);})[_0x4e3e('0x16')](function(_0x1e979d){logger[_0x4e3e('0xa')](_0x4e3e('0x17'),_0x1e979d?util['inspect'](_0x1e979d,{'showHidden':![],'depth':null}):'');return _0x5c540b(null);});}return _0x5c540b(null);});};exports[_0x4e3e('0x18')]=function(_0x66202f){return new BPromise(function(_0x29b826,_0x242f00){if(_0x66202f){return getUser({'interface':_0x66202f})[_0x4e3e('0xc')](function(_0x478dd1){logger['info'](_0x4e3e('0x19'),_0x66202f,_0x478dd1?_0x4e3e('0x14'):_0x4e3e('0x15'));return _0x29b826(_0x478dd1);})['catch'](function(_0x3f31a4){logger[_0x4e3e('0xa')](_0x4e3e('0x1a'),_0x3f31a4?util[_0x4e3e('0x8')](_0x3f31a4,{'showHidden':![],'depth':null}):'');return _0x29b826(null);});}return _0x29b826(null);});};exports[_0x4e3e('0x1b')]=function(_0x5de421){return new BPromise(function(_0x551199,_0x2ac0b6){if(_0x5de421){return getUser({'name':_0x5de421})[_0x4e3e('0xc')](function(_0x1b67e2){logger[_0x4e3e('0x7')](_0x4e3e('0x1c'),_0x5de421,_0x1b67e2?_0x4e3e('0x14'):_0x4e3e('0x15'));return _0x551199(_0x1b67e2);})[_0x4e3e('0x16')](function(_0x4ad25f){logger['error'](_0x4e3e('0x1d'),_0x4ad25f?util[_0x4e3e('0x8')](_0x4ad25f,{'showHidden':![],'depth':null}):'');return _0x551199(null);});}return _0x551199(null);});};exports[_0x4e3e('0x1e')]=function(_0x651ee9){return new BPromise(function(_0x5b1adc,_0x4ed7ae){if(_0x651ee9){return client['request'](_0x4e3e('0x1f'),{'options':{'raw':!![],'attributes':['id','name','type',_0x4e3e('0x20'),_0x4e3e('0x21')],'where':{'name':_0x651ee9},'limit':0x1}})[_0x4e3e('0xc')](function(_0x2270b5){logger['debug'](_0x4e3e('0x22'),_0x651ee9,_0x2270b5?util['inspect'](_0x2270b5,{'showHidden':![],'depth':null}):'');logger[_0x4e3e('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x651ee9,_0x2270b5?_0x4e3e('0x14'):_0x4e3e('0x15'));return _0x5b1adc(_0x2270b5[_0x4e3e('0x11')]['length']?_0x2270b5['result'][0x0]:null);})[_0x4e3e('0x16')](function(_0x395bf0){logger['error'](_0x4e3e('0x23'),_0x395bf0?util[_0x4e3e('0x8')](_0x395bf0,{'showHidden':![],'depth':null}):'');return _0x5b1adc(null);});}return _0x5b1adc(null);});};exports[_0x4e3e('0x24')]=function(_0x59a188,_0x298bb2){return moment(_0x59a188)[_0x4e3e('0x25')](_0x298bb2,_0x4e3e('0x26'))[_0x4e3e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x4e3e('0x28')]=function(_0x211763,_0x26f73b){return moment(_0x211763)[_0x4e3e('0x29')](_0x26f73b,_0x4e3e('0x26'))[_0x4e3e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x4e3e('0x2a')]=function(_0x1362c3,_0x3010ba){return moment(_0x1362c3)[_0x4e3e('0x2b')](moment(_0x3010ba),'seconds');};exports[_0x4e3e('0x2c')]=function(_0x163b87,_0x3333c6){return parseInt(_0x163b87,0xa)+parseInt(_0x3333c6,0xa);};exports[_0x4e3e('0x2d')]=function(){return moment()[_0x4e3e('0x27')](_0x4e3e('0x2e'));};exports[_0x4e3e('0x2f')]=function(_0x2fef07,_0x470046){if(_0x470046){return moment(_0x2fef07)['isAfter'](_0x470046);}return!![];};exports[_0x4e3e('0x30')]=function(_0x1b5bc3,_0x211f5f){if(_0x211f5f){return moment(_0x1b5bc3)[_0x4e3e('0x30')](_0x211f5f);}else if(_0x1b5bc3){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 1f62f50..f1bc044 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b2c=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','remoteAddress','role','other','agent_id','agent_name','test','setupLoggers','lodash','express-winston','util','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','name','ensureDir','then','user','no-user','timestamp','catch','error','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','url','responseTime','inspect'];(function(_0x2767c3,_0x4077be){var _0x2658c7=function(_0x49c582){while(--_0x49c582){_0x2767c3['push'](_0x2767c3['shift']());}};_0x2658c7(++_0x4077be);}(_0x4b2c,0x1e1));var _0xc4b2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4b2c[_0x2dafbe];return _0x58a45a;};var fs=require('fs-extra');var _=require(_0xc4b2('0x0'));var ewinston=require(_0xc4b2('0x1'));var path=require('path');var util=require(_0xc4b2('0x2'));var fileLogger=require(_0xc4b2('0x3'))[_0xc4b2('0x4')];var safeTemplate=require('./safe-template')[_0xc4b2('0x5')];var maskSensitiveData=require(_0xc4b2('0x6'))[_0xc4b2('0x7')];function ClientSideLogger(){function _0x3e87ae(_0x49d9d2){var _0x26a025=path['join'](_0xc4b2('0x8'),_0xc4b2('0x9'),_0xc4b2('0xa'));var _0x289907=path[_0xc4b2('0xb')](_0xc4b2('0xc'),_0x49d9d2['role']+'-'+_0x49d9d2[_0xc4b2('0xd')]);return fs[_0xc4b2('0xe')](path['join'](_0x26a025,_0x289907))[_0xc4b2('0xf')](function(){var _0x5cede0=fileLogger(_0xc4b2('0xc'),path['join'](_0x26a025,_0x289907));return _0x5cede0;})['catch'](function(_0x33b377){throw _0x33b377;});}this['log']=function(_0x3cd1d9,_0x66a735,_0x1fda6d,_0x570fe4){return _0x3e87ae(_0x3cd1d9[_0xc4b2('0x10')])[_0xc4b2('0xf')](function(_0x1c01fc){var _0x4d03f8=_0x1c01fc[_0x66a735];return _0x4d03f8;})[_0xc4b2('0xf')](function(_0x2386bf){var _0x4cf984=_0x3cd1d9[_0xc4b2('0x10')]?_0x3cd1d9[_0xc4b2('0x10')]['id']:_0xc4b2('0x11');var _0x345bc4=_0x570fe4['data'];var _0x4a155e=_0x570fe4[_0xc4b2('0x12')];var _0x8fa4f7=new Date(Number(_0x4a155e));return _0x2386bf(_0x4cf984,_0x8fa4f7,_0x1fda6d,_0x345bc4);})[_0xc4b2('0x13')](function(_0x337e60){fileLogger('client')[_0xc4b2('0x14')](_0x337e60);});};}function setupLoggers(_0x109cda){return new Promise(function(_0x3bba86){var _0x4484b6=new ClientSideLogger();var _0x4c9e13=fileLogger('api');var _0x531dd3=fileLogger('auth');_0x109cda[_0xc4b2('0x15')](_0xc4b2('0x16'),_0x4484b6);_0x109cda[_0xc4b2('0x17')](ewinston[_0xc4b2('0x18')]({'winstonInstance':_0x4c9e13,'meta':![],'statusLevels':!![],'msg':function(_0x5920f1,_0xc1c079){var _0x4d1989=_0xc4b2('0x19');if(!_[_0xc4b2('0x1a')](_0x5920f1[_0xc4b2('0x1b')])){_0x4d1989+=_0xc4b2('0x1c');var _0x29e577=_0x5920f1['body'];maskSensitiveData(_0x29e577);}return safeTemplate(util[_0xc4b2('0x1d')](_0x4d1989,_0x5920f1['method'],_0x5920f1[_0xc4b2('0x1e')][_0xc4b2('0x1f')]?_0x5920f1[_0xc4b2('0x1e')][_0xc4b2('0x1f')]:_0x5920f1[_0xc4b2('0x20')]['remoteAddress']||_0x5920f1['ip'],_0x5920f1[_0xc4b2('0x21')],_0xc1c079['statusCode'],_0xc1c079[_0xc4b2('0x22')],_0x5920f1[_0xc4b2('0x10')]?_0x5920f1[_0xc4b2('0x10')]['id']:null,_0x5920f1[_0xc4b2('0x10')]?_0x5920f1[_0xc4b2('0x10')][_0xc4b2('0xd')]:null,_0x5920f1[_0xc4b2('0x10')]?_0x5920f1[_0xc4b2('0x10')]['role']:null,_0x29e577?util[_0xc4b2('0x23')](_0x29e577,![],null):''));}}));_0x109cda['use'](ewinston[_0xc4b2('0x18')]({'winstonInstance':_0x531dd3,'meta':![],'statusLevels':!![],'msg':function(_0x215596,_0x5a3534){var _0xc13e54=_0xc4b2('0x24');if(_0x215596[_0xc4b2('0x1b')]&&_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x25')]&&_0x215596[_0xc4b2('0x1b')]['agent_id']){_0xc13e54=_0xc4b2('0x26');}return util['format'](_0xc13e54,_0x215596[_0xc4b2('0x27')],_0x215596[_0xc4b2('0x1e')][_0xc4b2('0x1f')]?_0x215596['headers'][_0xc4b2('0x1f')]:_0x215596['connection'][_0xc4b2('0x28')]||_0x215596['ip'],_0x215596['url'],_0x5a3534['statusCode'],_0x5a3534['responseTime'],_0x215596[_0xc4b2('0x10')]?_0x215596[_0xc4b2('0x10')]['id']:null,_0x215596[_0xc4b2('0x10')]?_0x215596[_0xc4b2('0x10')][_0xc4b2('0xd')]:null,_0x215596[_0xc4b2('0x10')]?_0x215596[_0xc4b2('0x10')][_0xc4b2('0x29')]:null,_0x215596['body']&&_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x25')]?_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x25')]:_0xc4b2('0x2a'),_0x215596[_0xc4b2('0x1b')]&&_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x2b')]?_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x2b')]:'',_0x215596[_0xc4b2('0x1b')]&&_0x215596['body'][_0xc4b2('0x2c')]?_0x215596[_0xc4b2('0x1b')][_0xc4b2('0x2c')]:'');},'ignoreRoute':function(_0x293e7b){var _0x1efa23=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1efa23[_0xc4b2('0x2d')](_0x293e7b['url']);}}));return _0x3bba86();});}exports[_0xc4b2('0x2e')]=setupLoggers; \ No newline at end of file +var _0xfd88=['use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','name','then','catch','user','timestamp','client','error','api','set'];(function(_0x147fe3,_0x20fa03){var _0x49efa2=function(_0x33baf0){while(--_0x33baf0){_0x147fe3['push'](_0x147fe3['shift']());}};_0x49efa2(++_0x20fa03);}(_0xfd88,0x1c2));var _0x8fd8=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0xfd88[_0x435044];return _0x33d4c6;};var fs=require(_0x8fd8('0x0'));var _=require(_0x8fd8('0x1'));var ewinston=require(_0x8fd8('0x2'));var path=require(_0x8fd8('0x3'));var util=require('util');var fileLogger=require('./loggers')[_0x8fd8('0x4')];var safeTemplate=require(_0x8fd8('0x5'))[_0x8fd8('0x6')];var maskSensitiveData=require(_0x8fd8('0x7'))[_0x8fd8('0x8')];function ClientSideLogger(){function _0x38333b(_0x25fec7){var _0x5045e8=path[_0x8fd8('0x9')](_0x8fd8('0xa'),_0x8fd8('0xb'),_0x8fd8('0xc'));var _0xec5426=path[_0x8fd8('0x9')]('client',_0x25fec7[_0x8fd8('0xd')]+'-'+_0x25fec7[_0x8fd8('0xe')]);return fs['ensureDir'](path[_0x8fd8('0x9')](_0x5045e8,_0xec5426))[_0x8fd8('0xf')](function(){var _0x3bdd98=fileLogger('client',path[_0x8fd8('0x9')](_0x5045e8,_0xec5426));return _0x3bdd98;})[_0x8fd8('0x10')](function(_0x213846){throw _0x213846;});}this[_0x8fd8('0xb')]=function(_0x51785e,_0x4d7be9,_0x103154,_0x1a9bd6){return _0x38333b(_0x51785e[_0x8fd8('0x11')])[_0x8fd8('0xf')](function(_0x519319){var _0x5141c3=_0x519319[_0x4d7be9];return _0x5141c3;})[_0x8fd8('0xf')](function(_0x10aa84){var _0x5e01aa=_0x51785e[_0x8fd8('0x11')]?_0x51785e[_0x8fd8('0x11')]['id']:'no-user';var _0x21f5b4=_0x1a9bd6['data'];var _0x1d98aa=_0x1a9bd6[_0x8fd8('0x12')];var _0x63e7e9=new Date(Number(_0x1d98aa));return _0x10aa84(_0x5e01aa,_0x63e7e9,_0x103154,_0x21f5b4);})['catch'](function(_0x1c2ba9){fileLogger(_0x8fd8('0x13'))[_0x8fd8('0x14')](_0x1c2ba9);});};}function setupLoggers(_0x39bfe0){return new Promise(function(_0x13bfaf){var _0x41ad2e=new ClientSideLogger();var _0x514017=fileLogger(_0x8fd8('0x15'));var _0x54ede0=fileLogger('auth');_0x39bfe0[_0x8fd8('0x16')]('client-side-logger',_0x41ad2e);_0x39bfe0[_0x8fd8('0x17')](ewinston[_0x8fd8('0x18')]({'winstonInstance':_0x514017,'meta':![],'statusLevels':!![],'msg':function(_0x22a29c,_0x2f5e7c){var _0xece660=_0x8fd8('0x19');if(!_[_0x8fd8('0x1a')](_0x22a29c[_0x8fd8('0x1b')])){_0xece660+='\x20body=%s';var _0x467192=_0x22a29c[_0x8fd8('0x1b')];maskSensitiveData(_0x467192);}return safeTemplate(util[_0x8fd8('0x1c')](_0xece660,_0x22a29c['method'],_0x22a29c[_0x8fd8('0x1d')]['x-forwarded-for']?_0x22a29c[_0x8fd8('0x1d')][_0x8fd8('0x1e')]:_0x22a29c[_0x8fd8('0x1f')][_0x8fd8('0x20')]||_0x22a29c['ip'],_0x22a29c[_0x8fd8('0x21')],_0x2f5e7c[_0x8fd8('0x22')],_0x2f5e7c[_0x8fd8('0x23')],_0x22a29c[_0x8fd8('0x11')]?_0x22a29c[_0x8fd8('0x11')]['id']:null,_0x22a29c[_0x8fd8('0x11')]?_0x22a29c[_0x8fd8('0x11')][_0x8fd8('0xe')]:null,_0x22a29c['user']?_0x22a29c[_0x8fd8('0x11')][_0x8fd8('0xd')]:null,_0x467192?util[_0x8fd8('0x24')](_0x467192,![],null):''));}}));_0x39bfe0[_0x8fd8('0x17')](ewinston[_0x8fd8('0x18')]({'winstonInstance':_0x54ede0,'meta':![],'statusLevels':!![],'msg':function(_0xc40acb,_0x5257d4){var _0x3a45b9='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xc40acb[_0x8fd8('0x1b')]&&_0xc40acb[_0x8fd8('0x1b')][_0x8fd8('0x25')]&&_0xc40acb[_0x8fd8('0x1b')][_0x8fd8('0x26')]){_0x3a45b9=_0x8fd8('0x27');}return util[_0x8fd8('0x1c')](_0x3a45b9,_0xc40acb['method'],_0xc40acb[_0x8fd8('0x1d')][_0x8fd8('0x1e')]?_0xc40acb[_0x8fd8('0x1d')][_0x8fd8('0x1e')]:_0xc40acb[_0x8fd8('0x1f')][_0x8fd8('0x20')]||_0xc40acb['ip'],_0xc40acb['url'],_0x5257d4['statusCode'],_0x5257d4[_0x8fd8('0x23')],_0xc40acb['user']?_0xc40acb[_0x8fd8('0x11')]['id']:null,_0xc40acb[_0x8fd8('0x11')]?_0xc40acb['user'][_0x8fd8('0xe')]:null,_0xc40acb['user']?_0xc40acb[_0x8fd8('0x11')]['role']:null,_0xc40acb[_0x8fd8('0x1b')]&&_0xc40acb[_0x8fd8('0x1b')][_0x8fd8('0x25')]?_0xc40acb[_0x8fd8('0x1b')][_0x8fd8('0x25')]:_0x8fd8('0x28'),_0xc40acb['body']&&_0xc40acb[_0x8fd8('0x1b')][_0x8fd8('0x26')]?_0xc40acb['body'][_0x8fd8('0x26')]:'',_0xc40acb[_0x8fd8('0x1b')]&&_0xc40acb['body'][_0x8fd8('0x29')]?_0xc40acb[_0x8fd8('0x1b')][_0x8fd8('0x29')]:'');},'ignoreRoute':function(_0x3c627a){var _0x2b1056=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2b1056['test'](_0x3c627a[_0x8fd8('0x21')]);}}));return _0x13bfaf();});}exports[_0x8fd8('0x2a')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 75a8356..b89ceed 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ff6=['consoleLogger','fileLogger','moment','winston','../config/environment','debugLevel','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','keys','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','File','%s-%s','error'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x4ff6,0x11a));var _0x64ff=function(_0x16e61a,_0x3150ac){_0x16e61a=_0x16e61a-0x0;var _0x31fbb2=_0x4ff6[_0x16e61a];return _0x31fbb2;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x64ff('0x0'));var winston=require(_0x64ff('0x1'));var config=require(_0x64ff('0x2'));var debugLevel=config['debugLevel']?config[_0x64ff('0x3')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x64ff('0x4'),'warn':_0x64ff('0x5'),'info':_0x64ff('0x6'),'print':_0x64ff('0x7'),'success':_0x64ff('0x8'),'http':'gray','verbose':_0x64ff('0x9'),'debug':_0x64ff('0xa'),'silly':_0x64ff('0xb')};winston[_0x64ff('0xc')](XC_LOG_COLORS);function getLogFileName(_0xb0e0b2,_0x561f5e,_0x1cb153){var _0x514858=_0xb0e0b2||_0x64ff('0xd');return path[_0x64ff('0xe')](_0x514858,util[_0x64ff('0xf')]('%s-%s.log',_0x561f5e,_0x1cb153));}function formatter(_0x36be0b,_0x4075bd){_0x4075bd[_0x64ff('0x10')]=_0x4075bd[_0x64ff('0x10')][_0x64ff('0x11')](/@@{/g,'{{{')[_0x64ff('0x11')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0x64ff('0x11')](/}@/g,'}}');return util[_0x64ff('0xf')](_0x64ff('0x12'),moment()[_0x64ff('0xf')](_0x64ff('0x13')),_0x4075bd[_0x64ff('0x14')][_0x64ff('0x15')](),_0x36be0b,_0x4075bd[_0x64ff('0x10')]);}function fileFormat(_0x4624ca,_0x1bffef){_0x1bffef[_0x64ff('0x10')]=_0x1bffef[_0x64ff('0x10')]['replace'](/@@{/g,_0x64ff('0x16'))[_0x64ff('0x11')](/}@@/g,'}}}')[_0x64ff('0x11')](/@{/g,'{{')[_0x64ff('0x11')](/}@/g,'}}');var _0x347418=_0x1bffef['meta']&&Object[_0x64ff('0x17')](_0x1bffef[_0x64ff('0x18')])['length']?'\x0a\x09'+JSON[_0x64ff('0x19')](_0x1bffef[_0x64ff('0x18')]):'';return util['format'](_0x64ff('0x1a'),moment()[_0x64ff('0xf')](_0x64ff('0x13')),_0x1bffef[_0x64ff('0x14')][_0x64ff('0x15')](),_0x4624ca,_0x1bffef[_0x64ff('0x10')],_0x347418);}function consoleLogger(){var _0x458548=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x64ff('0x1b'))][(_0x64ff('0x1c'))]({'level':_0x64ff('0x1d'),'json':![],'formatter':function(_0x23df69){return formatter('',_0x23df69);}})]});return _0x458548;}function fileLogger(_0x1f2399,_0x22cad1){var _0x2dbbca=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x64ff('0x1e'))]({'name':util[_0x64ff('0xf')](_0x64ff('0x1f'),_0x1f2399,_0x64ff('0x20')),'filename':getLogFileName(_0x22cad1,_0x1f2399,_0x64ff('0x20')),'level':_0x64ff('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10f891){return fileFormat(_0x1f2399,_0x10f891);}}),new winston[(_0x64ff('0x1b'))][(_0x64ff('0x1e'))]({'name':util[_0x64ff('0xf')](_0x64ff('0x1f'),_0x1f2399,debugLevel),'filename':getLogFileName(_0x22cad1,_0x1f2399,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd967c4){return fileFormat(_0x1f2399,_0xd967c4);}}),new winston[(_0x64ff('0x1b'))][(_0x64ff('0x1c'))]({'level':_0x64ff('0x1d'),'json':![],'formatter':function(_0xc14ed9){return fileFormat(_0x1f2399,_0xc14ed9);}})]});return _0x2dbbca;}exports[_0x64ff('0x21')]=consoleLogger;exports[_0x64ff('0x22')]=fileLogger; \ No newline at end of file +var _0x8005=['%s-%s','error','Console','consoleLogger','path','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','meta','length','stringify','transports','warn','Logger','File'];(function(_0x42676f,_0x4c3299){var _0x2b884e=function(_0x478f3f){while(--_0x478f3f){_0x42676f['push'](_0x42676f['shift']());}};_0x2b884e(++_0x4c3299);}(_0x8005,0x13f));var _0x5800=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0x8005[_0x18546c];return _0x46ef43;};'use strict';var path=require(_0x5800('0x0'));var util=require('util');var moment=require('moment');var winston=require(_0x5800('0x1'));var config=require(_0x5800('0x2'));var debugLevel=config[_0x5800('0x3')]?config[_0x5800('0x3')][_0x5800('0x4')]():_0x5800('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x5800('0x6'),'warn':_0x5800('0x7'),'info':_0x5800('0x8'),'print':_0x5800('0x9'),'success':'bold\x20green','http':_0x5800('0xa'),'verbose':_0x5800('0xb'),'debug':_0x5800('0xc'),'silly':'bold\x20cyan'};winston[_0x5800('0xd')](XC_LOG_COLORS);function getLogFileName(_0x57e19e,_0x1309ee,_0x57e76d){var _0x482d77=_0x57e19e||_0x5800('0xe');return path[_0x5800('0xf')](_0x482d77,util[_0x5800('0x10')]('%s-%s.log',_0x1309ee,_0x57e76d));}function formatter(_0x2ed9e2,_0x38f206){_0x38f206[_0x5800('0x11')]=_0x38f206[_0x5800('0x11')][_0x5800('0x12')](/@@{/g,_0x5800('0x13'))[_0x5800('0x12')](/}@@/g,_0x5800('0x14'))[_0x5800('0x12')](/@{/g,'{{')[_0x5800('0x12')](/}@/g,'}}');return util[_0x5800('0x10')](_0x5800('0x15'),moment()[_0x5800('0x10')](_0x5800('0x16')),_0x38f206[_0x5800('0x17')]['toUpperCase'](),_0x2ed9e2,_0x38f206['message']);}function fileFormat(_0x17f5ce,_0xb6157b){_0xb6157b[_0x5800('0x11')]=_0xb6157b[_0x5800('0x11')][_0x5800('0x12')](/@@{/g,_0x5800('0x13'))[_0x5800('0x12')](/}@@/g,'}}}')[_0x5800('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x544a69=_0xb6157b['meta']&&Object['keys'](_0xb6157b[_0x5800('0x18')])[_0x5800('0x19')]?'\x0a\x09'+JSON[_0x5800('0x1a')](_0xb6157b['meta']):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x5800('0x10')](_0x5800('0x16')),_0xb6157b['level']['toUpperCase'](),_0x17f5ce,_0xb6157b[_0x5800('0x11')],_0x544a69);}function consoleLogger(){var _0x320f8f=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5800('0x1b'))]['Console']({'level':_0x5800('0x1c'),'json':![],'formatter':function(_0x5e5be6){return formatter('',_0x5e5be6);}})]});return _0x320f8f;}function fileLogger(_0xefa6d8,_0x138e7b){var _0x2a5ac1=new winston[(_0x5800('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x5800('0x1e'))]({'name':util[_0x5800('0x10')](_0x5800('0x1f'),_0xefa6d8,_0x5800('0x20')),'filename':getLogFileName(_0x138e7b,_0xefa6d8,_0x5800('0x20')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x290e7c){return fileFormat(_0xefa6d8,_0x290e7c);}}),new winston[(_0x5800('0x1b'))][(_0x5800('0x1e'))]({'name':util['format'](_0x5800('0x1f'),_0xefa6d8,debugLevel),'filename':getLogFileName(_0x138e7b,_0xefa6d8,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x275c5f){return fileFormat(_0xefa6d8,_0x275c5f);}}),new winston[(_0x5800('0x1b'))][(_0x5800('0x21'))]({'level':_0x5800('0x1c'),'json':![],'formatter':function(_0xdc5ec5){return fileFormat(_0xefa6d8,_0xdc5ec5);}})]});return _0x2a5ac1;}exports[_0x5800('0x22')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index d6e4bc9..da112f3 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x2b94a1,_0x134a4d){var _0x3a7615=function(_0x169404){while(--_0x169404){_0x2b94a1['push'](_0x2b94a1['shift']());}};_0x3a7615(++_0x134a4d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x593bb6,_0x4ccbed){_0x593bb6=_0x593bb6-0x0;var _0x208dad=_0x5f2f[_0x593bb6];return _0x208dad;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x57ca,0x108));var _0xa57c=function(_0x56dac0,_0x169130){_0x56dac0=_0x56dac0-0x0;var _0x5ca8e0=_0x57ca[_0x56dac0];return _0x5ca8e0;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 0306304..bfb4307 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['isArray','map','isPlainObject','reduce','exports','safeTemplate','{\x20{\x20','string','replace'];(function(_0x53c89d,_0x46e997){var _0x4a30a1=function(_0x10347c){while(--_0x10347c){_0x53c89d['push'](_0x53c89d['shift']());}};_0x4a30a1(++_0x46e997);}(_0x757a,0xde));var _0xa757=function(_0x41269a,_0x3ad3b6){_0x41269a=_0x41269a-0x0;var _0x199af1=_0x757a[_0x41269a];return _0x199af1;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x24afaf){return _0x24afaf==='{{'?_0xa757('0x0'):'\x20}\x20}';}function safeTemplate(_0x5c03c3){var _0x5709ed=_0x5c03c3;if(typeof _0x5c03c3===_0xa757('0x1')){_0x5709ed=_0x5c03c3[_0xa757('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xa757('0x3')](_0x5c03c3)){_0x5709ed=_0x5c03c3[_0xa757('0x4')](function(_0x32630d){return safeTemplate(_0x32630d);});}else if(_[_0xa757('0x5')](_0x5c03c3)){_0x5709ed=Object['keys'](_0x5c03c3)[_0xa757('0x6')](function(_0x4343b6,_0x53be0e){_0x4343b6[_0x53be0e]=safeTemplate(_0x5c03c3[_0x53be0e]);return _0x4343b6;},{});}return _0x5709ed;}module[_0xa757('0x7')][_0xa757('0x8')]=safeTemplate; \ No newline at end of file +var _0x2032=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2032,0xd9));var _0x2203=function(_0x1ad384,_0x291d00){_0x1ad384=_0x1ad384-0x0;var _0x1942f7=_0x2032[_0x1ad384];return _0x1942f7;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2c2259){return _0x2c2259==='{{'?_0x2203('0x0'):_0x2203('0x1');}function safeTemplate(_0x4c28da){var _0x486390=_0x4c28da;if(typeof _0x4c28da===_0x2203('0x2')){_0x486390=_0x4c28da['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2203('0x3')](_0x4c28da)){_0x486390=_0x4c28da[_0x2203('0x4')](function(_0x44ccfd){return safeTemplate(_0x44ccfd);});}else if(_[_0x2203('0x5')](_0x4c28da)){_0x486390=Object[_0x2203('0x6')](_0x4c28da)[_0x2203('0x7')](function(_0x2e0f63,_0x2676aa){_0x2e0f63[_0x2676aa]=safeTemplate(_0x4c28da[_0x2676aa]);return _0x2e0f63;},{});}return _0x486390;}module[_0x2203('0x8')][_0x2203('0x9')]=safeTemplate; \ No newline at end of file